From e102ae3d28eace7f350ece188187c2566920e654 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 21 Mar 2018 16:28:32 -0400 Subject: [PATCH 0001/1190] Roll Skia (#4841) --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 94a8cd5bb4a18..4b28d2c30fdb1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '91fba61f24943a6e12f69732d9308beb76f8a7c6', + 'skia_revision': 'abf7b763e2c1ba069942dedec914494817fd27a8', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 61e303baf6ced..bb8778b6dc2b6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a3593f9d3adf185eaa6a15b0f50df584 +Signature: a714ae47f09ddeaf5ab4e20e34c3743a UNUSED LICENSES: @@ -17800,10 +17800,10 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Debug-GDI.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Release.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-MSVC-x86-Debug-Exceptions.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json @@ -17928,9 +17928,9 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Cl FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x86_64-Release.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-arm64-Release-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug-Exceptions.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-MSVC-x86-Debug-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-MSVC-x86-Debug-Exceptions.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-MSVC-x86-Debug.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-MSVC-x86-Release-GDI.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/alternate_repo.json @@ -20360,7 +20360,9 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzAnimatedImage.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzDrawFunctions.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzGradients.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImage.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp ---------------------------------------------------------------------------------------------------- Copyright 2018 Google, LLC From 60befc2cdec54818ce738fd07236624dc1b287a2 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 21 Mar 2018 17:13:05 -0400 Subject: [PATCH 0002/1190] VulkanSurface and GPUSurfaceGL no longer use GrPixelConfig (#4814) * VulkanSurface and GPUSurfaceGL no longer use GrPixelConfig * fix 565 * fix gpu_surface_gl changes --- content_handler/vulkan_surface.cc | 8 ++++++-- content_handler/vulkan_surface.h | 1 + shell/gpu/gpu_surface_gl.cc | 28 ++++++++++++++++++---------- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index efb3f8934a49b..7dbcc908ec30d 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -152,6 +152,8 @@ bool VulkanSurface::AllocateDeviceMemory(sk_sp context, return false; } + const SkColorType color_type = kBGRA_8888_SkColorType; + // Create the image. const VkImageCreateInfo image_create_info = { .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, @@ -255,12 +257,13 @@ bool VulkanSurface::AllocateDeviceMemory(sk_sp context, return false; } - return SetupSkiaSurface(std::move(context), size, image_create_info, - memory_reqs); + return SetupSkiaSurface(std::move(context), size, color_type, + image_create_info, memory_reqs); } bool VulkanSurface::SetupSkiaSurface(sk_sp context, const SkISize& size, + SkColorType color_type, const VkImageCreateInfo& image_create_info, const VkMemoryRequirements& memory_reqs) { if (context == nullptr) { @@ -286,6 +289,7 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp context, SkSurface::MakeFromBackendRenderTarget(context.get(), // sk_render_target, // kTopLeft_GrSurfaceOrigin, // + color_type, // nullptr, // &sk_surface_props // ); diff --git a/content_handler/vulkan_surface.h b/content_handler/vulkan_surface.h index 3a0d2801a1c46..41a807af81f9c 100644 --- a/content_handler/vulkan_surface.h +++ b/content_handler/vulkan_surface.h @@ -80,6 +80,7 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { bool SetupSkiaSurface(sk_sp context, const SkISize& size, + SkColorType color_type, const VkImageCreateInfo& image_create_info, const VkMemoryRequirements& memory_reqs); diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 36551f1c088eb..b825ffc6617c1 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -4,6 +4,9 @@ #include "gpu_surface_gl.h" +#include +#include + #include "flutter/glue/trace_event.h" #include "lib/fxl/arraysize.h" #include "lib/fxl/logging.h" @@ -71,31 +74,35 @@ bool GPUSurfaceGL::IsValid() { return valid_; } -static GrPixelConfig FirstSupportedConfig(GrContext* context) { -#define RETURN_IF_RENDERABLE(x) \ - if (context->caps()->isConfigRenderable((x), false)) { \ - return (x); \ +static SkColorType FirstSupportedColorType(GrContext* context, GLenum* format) { +#define RETURN_IF_RENDERABLE(x, y) \ + if (context->colorTypeSupportedAsSurface((x))) { \ + *format = (y); \ + return (x); \ } - RETURN_IF_RENDERABLE(kRGBA_8888_GrPixelConfig); - RETURN_IF_RENDERABLE(kRGBA_4444_GrPixelConfig); - RETURN_IF_RENDERABLE(kRGB_565_GrPixelConfig); - return kUnknown_GrPixelConfig; + RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8_OES); + RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GL_RGBA4); + RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GL_RGB565); + return kUnknown_SkColorType; } static sk_sp WrapOnscreenSurface(GrContext* context, const SkISize& size, intptr_t fbo) { + + GLenum format; + const SkColorType color_type = FirstSupportedColorType(context, &format); + const GrGLFramebufferInfo framebuffer_info = { .fFBOID = static_cast(fbo), + .fFormat = format, }; - const GrPixelConfig pixel_config = FirstSupportedConfig(context); GrBackendRenderTarget render_target(size.fWidth, // width size.fHeight, // height 0, // sample count 0, // stencil bits (TODO) - pixel_config, // pixel config framebuffer_info // framebuffer info ); @@ -108,6 +115,7 @@ static sk_sp WrapOnscreenSurface(GrContext* context, context, // gr context render_target, // render target GrSurfaceOrigin::kBottomLeft_GrSurfaceOrigin, // origin + color_type, // color type colorspace, // colorspace &surface_props // surface properties ); From 086c76aa00ab43251869909f58dd207d07e6db2c Mon Sep 17 00:00:00 2001 From: James Robinson Date: Wed, 21 Mar 2018 15:35:16 -0700 Subject: [PATCH 0003/1190] [fuchsia] Fix up includes of Zircon headers (#4842) --- content_handler/rasterizer.h | 3 ++- content_handler/session_connection.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/content_handler/rasterizer.h b/content_handler/rasterizer.h index c00c39b3c457f..94602120249d0 100644 --- a/content_handler/rasterizer.h +++ b/content_handler/rasterizer.h @@ -7,10 +7,11 @@ #include +#include + #include "flutter/flow/layers/layer_tree.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" -#include "zircon/system/ulib/zx/include/zx/eventpair.h" namespace flutter_runner { diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index a33266f148ff2..7af1f8cb6a034 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -5,6 +5,8 @@ #ifndef FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ #define FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ +#include + #include "flutter/common/threads.h" #include "flutter/content_handler/vulkan_surface_producer.h" #include "flutter/flow/compositor_context.h" @@ -14,7 +16,6 @@ #include "lib/fxl/macros.h" #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" -#include "zircon/system/ulib/zx/include/zx/eventpair.h" namespace flutter_runner { From 604f51e675d6a912b7370950958c94b96323cd82 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 21 Mar 2018 16:16:04 -0700 Subject: [PATCH 0004/1190] Handle Apple-specific GLES headers (#4843) In 60befc2cdec54818ce738fd07236624dc1b287a2, includes were added for GLES. On macOS/iOS, these headers are named slightly differently. --- shell/gpu/gpu_surface_gl.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index b825ffc6617c1..34aa74e00c5ca 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -4,8 +4,13 @@ #include "gpu_surface_gl.h" +#if OS_MACOSX || OS_IOS +#include +#include +#else #include #include +#endif #include "flutter/glue/trace_event.h" #include "lib/fxl/arraysize.h" From 9b837652b12ad89ca8ac3ced88a7ed21dbfa4ba4 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 21 Mar 2018 16:45:41 -0700 Subject: [PATCH 0005/1190] Fix GPUSurfaceGL includes on macOS (#4844) macOS doesn't include GLES support. --- shell/gpu/gpu_surface_gl.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 34aa74e00c5ca..f21304c64c99c 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -4,9 +4,11 @@ #include "gpu_surface_gl.h" -#if OS_MACOSX || OS_IOS +#if OS_IOS #include #include +#elif OS_MACOSX +#include #else #include #include @@ -85,7 +87,11 @@ static SkColorType FirstSupportedColorType(GrContext* context, GLenum* format) { *format = (y); \ return (x); \ } +#if OS_MACOSX + RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8); +#else RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8_OES); +#endif RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GL_RGBA4); RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GL_RGB565); return kUnknown_SkColorType; From 2ec5a67d53269b1a1ff3b7984b3d209524fd20cd Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 21 Mar 2018 19:31:24 -0700 Subject: [PATCH 0006/1190] Fix supported color type check on iOS simulators (#4846) Since OS_MACOSX and OS_IOS are both enabled for simulator builds, ensure we're using constants conistent with our #includes. --- shell/gpu/gpu_surface_gl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index f21304c64c99c..e434f541d4c28 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -87,7 +87,7 @@ static SkColorType FirstSupportedColorType(GrContext* context, GLenum* format) { *format = (y); \ return (x); \ } -#if OS_MACOSX +#if OS_MACOSX && !OS_IOS RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8); #else RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8_OES); From 55e5c4d026113b48f9e89edf1ee923e36568f4e8 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Thu, 22 Mar 2018 10:52:50 -0700 Subject: [PATCH 0007/1190] Slightly improve the docs for the internal _futurize method (#4847) --- lib/ui/painting.dart | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 2412101c5bd79..d69314bbb7659 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2881,32 +2881,35 @@ typedef String _Callbacker(_Callback callback); /// Converts a method that receives a value-returning callback to a method that /// returns a Future. /// +/// Return a [String] to cause an [Exception] to be sychnorously thrown with that +/// string as a message. +/// +/// If the callback is called with null, the future completes with an error. +/// /// Example usage: +/// /// ```dart /// typedef void IntCallback(int result); /// -/// void doSomethingAndCallback(IntCallback callback) { +/// String _doSomethingAndCallback(IntCallback callback) { /// new Timer(new Duration(seconds: 1), () { callback(1); }); /// } /// /// Future doSomething() { -/// return _futurize(domeSomethingAndCallback); +/// return _futurize(_doSomethingAndCallback); /// } /// ``` -/// Future _futurize(_Callbacker callbacker) { final Completer completer = new Completer.sync(); - final String err = callbacker((T t) { + final String error = callbacker((T t) { if (t == null) { completer.completeError(new Exception('operation failed')); } else { completer.complete(t); } }); - - if (err != null) - throw new Exception(err); - + if (error != null) + throw new Exception(error); return completer.future; } From 01be4c6017f98532eea2456ea422e2c285e219c8 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 22 Mar 2018 11:40:29 -0700 Subject: [PATCH 0008/1190] Fix GPUSurfaceGL includes on Linux (#4849) --- shell/gpu/gpu_surface_gl.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index e434f541d4c28..331fd188a9ed3 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -9,6 +9,8 @@ #include #elif OS_MACOSX #include +#elif OS_LINUX +#include #else #include #include @@ -87,7 +89,7 @@ static SkColorType FirstSupportedColorType(GrContext* context, GLenum* format) { *format = (y); \ return (x); \ } -#if OS_MACOSX && !OS_IOS +#if (OS_MACOSX && !OS_IOS) || OS_LINUX RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8); #else RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8_OES); From 288fe3e4d4b44420e9f1f3b5b1f75b32228db6a6 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 22 Mar 2018 13:16:49 -0700 Subject: [PATCH 0009/1190] Roll dart to 95e9e890a9 (#4850) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Roll dart to 95e9e890a9 Changes since last roll: ``` 95e9e890a9 [kernel/vm] Implement NSM-forwarding in the VM. 7450e2ad60 Fix parsing of invalid interpolation in string literal cd03f35a0b Prepare for analyzer 0.31.2-alpha.1, front_end 0.1.0-alpha.11, and kernel 0.3.0-alpha.11. 38b0825a55 [kernel] Add target for Flutter on Fuchsia. 2fd9969c96 extend unstable API to pass in the location of the libraries-specification 1caf7b7ecd Revert "Create new AnalysisSession instance on changes." c90ca298ed Provide a message for InconsistentAnalysisException. b6944e3165 Make use of environment overrides in fasta's implementation of config specific imports 26c06cdd82 Clean up Dart 2 type issues related to YAML support 4989976a81 Add CFE support for noSuchMethod forwarders 014bd821e6 Retry when fixes cannot be computed because of an inconsistent session (issue 32635) 04f5d1b974 Recover from missing while in do/while statement dc5a8b2e91 Improve the fix to add an explicit cast c7cdb72f32 Move CloneWithoutBody to Kernel API 2be1456309 [fasta] Fix not being able to output a program because of erroneousProgram 17a778c9cb Changed AudioScheduledSourceNode.start to start2. Fixes https://github.com/dart-lang/sdk/issues/32624 ae9b76dba6 [kernel] Add flag for NSM-forwarding stubs. 691bb9b299 [vm/compiler] Add a comment about MakeTemporary limitation. 83bfbcdd96 Incremental compilation: computing class hierarchy for reachable things only 0dd2a8dbdb Incremental compiler: Only include libraries loaded from dill if used b4206bb92c Remove dartk bb2bf609be Incremental compiler: Deal with disappearing package 2e366e8c9a [fasta] Refactor incremental_load_from_dill_test 4f40e43d7a Incremental compiler: Add test that mixes in something from the sdk 83c0a75564 [fasta] Add failing test to incremental compiler test suite 3a81263fee [ VM / Dart 2] Split DartAPI_PropagateError into DartAPI_PropagateError and DartAPI_PropagateCompileError since the compile time error from the missing semicolon prevented the code from being executed in Dart 2. 4905a2da7c Fix pub issues links from bde48c67ec6bd76a475ead02f45a16c1c0309529 bde48c67ec Update pub dependency 95089a2eeb cleanup CHANGELOG for -dev.39 and -dev.40 068be3b656 [ VM / Dart 2 ] Fixed issue where TokenPosition::kNoSource was being registered as the position of native methods. Fixes DartAPI_CurrentStackTraceInfo 5430010395 Use writeFieldDeclaration() and writeFunctionDeclaration() to write extracted widget. 1d774b7f77 Add "environment_overrides" section to libraries-specification. 36d4fd37a7 Mark test as flaky f2806ab624 [Corelib, VM runtime] Fix handling of zero operand in Bigint operations (fixes #32465). Fix VM, dart2js, and dcc Bigint implementations. Add shift tests. Re-enable Bigint intrinsics on VM. 9f0e391e28 Rename writeParameterSource() to writeParameter() and make 'type' optional. 8136c957a1 Improve fasta parser library declaration recovery b3c4b1c2ef Remove pkg/browser from SDK source – use mirror 179db6dc6a Remove usage of pkg:browser from tools/dart2js/sourceMapViewer a81f4babcc Revert "[ VM / Dart 2 ] Fixed StackTraceFormat test to expect file URIs in stacks generated by the Dart frontend." ae130bc187 [ VM / Dart 2 ] Fixed StackTraceFormat test to expect file URIs in stacks generated by the Dart frontend. 2546f2235e Fix status lines for html group tests - group was duplicated in logs. 8658a7403e Check for references/writes to superclass members. 15bf72615d Fix for using isFinal/isConst with type in writeFieldDeclaration(). a8986cf45a Support for parameters for extracted widget. aac5d04198 [infra] Add optimization_counter_threshold builder tag to the test matrix fe5e2444ad [ VM / Dart 2 ] Fixed DartAPI_InvokeCrossLibrary test. dddb578fbb Update Safari status for two tests 521846c832 [VM] When generating the token position list for each line (for a [Script]), only scan relevant classes/functions/fields 8630c69c9f Add typeInfo expression accessor 587e4f8723 Parse local function metadata 8493f68271 Adjusted status for lib_2/async/future_or_type_test.dart 7c05f1e608 Add more tests for FutureOr used as a type. 1fc73bf1a6 Compute ClassFunctionType from signature function in Dart 2 ad5f5abb13 Remove dart2js self analysis tests 31dd6683f8 [VM] Optimize performance of dart_boostrap in debug-kernel-strong mode. 38dc57504b [status] Update corelib_2 status for bigint test 6469f4c78a Support for extracting widget from a function. 00ec3b0867 [vm] Fix several kernel-specific memory leaks. b7c3c32f63 [vm] Do not assign type to phi if it was loaded from a different local d26c310a27 Rework parsing of local const declarations 06638dd17f [ VM / Dart 2 ] Removed DartAPI_NativeFieldAccess and DartAPI_InjectNativeFields1 as they were using Dart_CreateNativeWrapper which doesn't make sense in the context of Dart 2. Also did some status file cleanup and reorganization. a5966ad988 Fix dart2js libraries.yaml ec65830504 [ VM / Dart 2 ] Fixed DartAPI_LookupLibrary test which was treating the script in Dart_LoadScript as kernel instead of source. 8abeb56ebb Basic 'Extract Widget' refactoring. 996277d427 Entity-fy the non-frequence minifier so it can be supported under the CFE. 0e764393f3 A few more Dart2 related fixes 965cb81c0f Add AnalysisSessionHelper and move getClass() into it. 1c5d2e9016 Bump linter to 0.1.45 86b1646475 webSQL is not suported by Firefox fixed test supported should of true should not be expected. 3d34f4d4fe Updated CHANGELOG with Chrome 63 roll changes and fixed status file test now passes. 08d305bbd7 Inline modifiers into endTopLevelFields and endFields events efab00ce5c Fix type issues caused by running with --preview-dart-2 adb9f8cc0b Inline modifiers into beginClassDeclaration and beginNamedMixinApplication b75fb574ee Fix async_compiler_input_provider_test for Windows fd005e17bc Rework parsing of local function declarations 8eb749e032 Fix sourcemaps/name_test for kernel 581c512345 Fixed DOMRectList not having a prototype field. 031ef989ac Provide better error message when a linked dependency doesn't exist d9878ae0da fix regression in DDC handling of top-level field named 'name' ac322d0fb4 Move LibraryElement caching to AnalysisSession. 2047d44631 Handle the case where there is no selection(issue 32563) ``` * Update license hash. No changes to licenses. --- DEPS | 6 +++--- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 4b28d2c30fdb1..3f05aa8ea61c8 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '06949dc98556adb807e270c47cbb9407ec781064', + 'dart_revision': '95e9e890a996b9a61ade6cc81830dd7cf295ec9d', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -60,7 +60,7 @@ vars = { 'dart_intl_tag': '0.15.2', 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.44', + 'dart_linter_tag': '0.1.45', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', @@ -75,7 +75,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': 'dbe8be2bb8bca9b26ba7bd583272c62f9a0153fd', + 'dart_pub_rev': '875d35005a7d33f367d70a3e31e9d3bad5d1ebd8', 'dart_pub_semver_tag': '1.3.2', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index bb8778b6dc2b6..3d301b7b2754b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a714ae47f09ddeaf5ab4e20e34c3743a +Signature: 93a18f7523d168b169c0648c3927b9c1 UNUSED LICENSES: From 7e80d4f816455049802dff93cc2a152bb0ed6f8d Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Thu, 22 Mar 2018 15:55:59 -0700 Subject: [PATCH 0010/1190] Document Window.defaultRouteName a little better. (#4851) --- lib/ui/window.dart | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index 03f9009ab58fa..26b7021929ed3 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -552,8 +552,36 @@ class Window { _onPointerDataPacketZone = Zone.current; } - /// The route or path that the operating system requested when the application - /// was launched. + /// The route or path that the embedder requested when the application was + /// launched. + /// + /// This will be the string "`/`" if no particular route was requested. + /// + /// ## Android + /// + /// On Android, calling + /// [`FlutterView.setInitialRoute`](/javadoc/io/flutter/view/FlutterView.html#setInitialRoute-java.lang.String-) + /// will set this value. The value must be set sufficiently early, i.e. before + /// the [runApp] call is executed in Dart, for this to have any effect on the + /// framework. The `createFlutterView` method in your `FlutterActivity` + /// subclass is a suitable time to set the value. The application's + /// `AndroidManifest.xml` file must also be updated to have a suitable + /// [``](https://developer.android.com/guide/topics/manifest/intent-filter-element.html). + /// + /// ## iOS + /// + /// On iOS, calling + /// [`FlutterViewController.setInitialRoute`](/objcdoc/Classes/FlutterViewController.html#/c:objc%28cs%29FlutterViewController%28im%29setInitialRoute:) + /// will set this value. The value must be set sufficiently early, i.e. before + /// the [runApp] call is executed in Dart, for this to have any effect on the + /// framework. The `application:didFinishLaunchingWithOptions:` method is a + /// suitable time to set this value. + /// + /// See also: + /// + /// * [Navigator], a widget that handles routing. + /// * [SystemChannels.navigation], which handles subsequent navigation + /// requests from the embedder. String get defaultRouteName => _defaultRouteName(); String _defaultRouteName() native 'Window_defaultRouteName'; From 7d9728d017715fb2767d5694455a5a056798cde2 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 22 Mar 2018 16:20:12 -0700 Subject: [PATCH 0011/1190] Roll flutter 20180322a (#4852) * Roll dart to af1436931b. Changes since last dart roll: ``` af1436931b (HEAD, origin/master, origin/HEAD) [CFE] Fix for insertion of duplicate NSM forwarders 48644d5f6a [CFE] Fix crash when trying to add NSM forwarder for a field 898260a998 Split dependency on dart:html from dart:js ef919c5eb3 fix commit queue: update nSM test expectation on ddc too. d014fce4de Update dartkp NSM expectations. 6bd38cc912 Analysis Server API for 'Extract Widget' refactoring. 123e59c189 Improve for loop recovery 790b7b98fb [kernel] Update more NSM expectations. 696be0ae46 Initial support for extracting methods. 8d669c9d4e [kernel] Update NSM-forwarding test expectations. edf039d510 [ VM / Dart 2 ] Made StackMapGC test strong-mode clean. Fixes part of 32190. 77239ee1db [fuchsia] Replace use of deprecated fdio_get_vmo with fdio_get_vmo_clone. ``` * Update license hash. No changes to the licenses --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3f05aa8ea61c8..3fd8afc62eafa 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '95e9e890a996b9a61ade6cc81830dd7cf295ec9d', + 'dart_revision': 'af1436931b93e755d38223c487d33a0a1f5eadf5', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3d301b7b2754b..5e6285f8446ae 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 93a18f7523d168b169c0648c3927b9c1 +Signature: 53f63598ec036cd96d4a27505157fc0f UNUSED LICENSES: From fc834f368793195de57e43848f030641fd23b2dc Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 22 Mar 2018 21:22:04 -0700 Subject: [PATCH 0012/1190] Roll back pub upgrade. (#4854) New version of pub causes https://github.com/flutter/flutter/issues/15848. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 3fd8afc62eafa..706c1507d6871 100644 --- a/DEPS +++ b/DEPS @@ -75,7 +75,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '875d35005a7d33f367d70a3e31e9d3bad5d1ebd8', + 'dart_pub_rev': 'dbe8be2bb8bca9b26ba7bd583272c62f9a0153fd', 'dart_pub_semver_tag': '1.3.2', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', From 9e0e724765e37523bde926e677bb79f265f91252 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 22 Mar 2018 22:30:24 -0700 Subject: [PATCH 0013/1190] Revert dart roll 20180322 (#4855) * Revert "Roll back pub upgrade. (#4854)" This reverts commit fc834f368793195de57e43848f030641fd23b2dc. * Revert "Roll flutter 20180322a (#4852)" This reverts commit 7d9728d017715fb2767d5694455a5a056798cde2. * Revert "Roll dart to 95e9e890a9 (#4850)" This reverts commit 288fe3e4d4b44420e9f1f3b5b1f75b32228db6a6. --- DEPS | 4 ++-- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 706c1507d6871..4b28d2c30fdb1 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'af1436931b93e755d38223c487d33a0a1f5eadf5', + 'dart_revision': '06949dc98556adb807e270c47cbb9407ec781064', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -60,7 +60,7 @@ vars = { 'dart_intl_tag': '0.15.2', 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.45', + 'dart_linter_tag': '0.1.44', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5e6285f8446ae..bb8778b6dc2b6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 53f63598ec036cd96d4a27505157fc0f +Signature: a714ae47f09ddeaf5ab4e20e34c3743a UNUSED LICENSES: From 8a218122f84c3e7a84afe14f291c8930cfe4a346 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Fri, 23 Mar 2018 12:38:41 -0400 Subject: [PATCH 0014/1190] Vulkan swap chain setup no longer uses GrPixelConfig and doesn't include from skia/src (#4856) --- content_handler/vulkan_surface.cc | 1 - content_handler/vulkan_surface_producer.cc | 1 - vulkan/vulkan_backbuffer.cc | 2 +- vulkan/vulkan_device.cc | 44 +++-------- vulkan/vulkan_device.h | 5 +- vulkan/vulkan_swapchain.cc | 87 ++++++++++++++-------- vulkan/vulkan_swapchain.h | 8 +- 7 files changed, 80 insertions(+), 68 deletions(-) diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 7dbcc908ec30d..9f7d7913a7200 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -10,7 +10,6 @@ #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContext.h" -#include "third_party/skia/src/gpu/vk/GrVkImage.h" namespace flutter_runner { diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index a994b04261e49..6f605c109b7df 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -11,7 +11,6 @@ #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" -#include "third_party/skia/src/gpu/vk/GrVkUtil.h" namespace flutter_runner { diff --git a/vulkan/vulkan_backbuffer.cc b/vulkan/vulkan_backbuffer.cc index e12a037f3dd6a..0bcfa1643dcc4 100644 --- a/vulkan/vulkan_backbuffer.cc +++ b/vulkan/vulkan_backbuffer.cc @@ -6,9 +6,9 @@ #include +#include "flutter/vulkan/skia_vulkan_header.h" #include "flutter/vulkan/vulkan_proc_table.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" -#include "third_party/skia/src/gpu/vk/GrVkUtil.h" namespace vulkan { diff --git a/vulkan/vulkan_device.cc b/vulkan/vulkan_device.cc index c989f4f09dc85..bb6c2e8a1437c 100644 --- a/vulkan/vulkan_device.cc +++ b/vulkan/vulkan_device.cc @@ -12,7 +12,6 @@ #include "flutter/vulkan/vulkan_surface.h" #include "flutter/vulkan/vulkan_utilities.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -#include "third_party/skia/src/gpu/vk/GrVkUtil.h" namespace vulkan { @@ -260,65 +259,46 @@ std::vector VulkanDevice::GetQueueFamilyProperties() return properties; } -bool VulkanDevice::ChooseSurfaceFormat(const VulkanSurface& surface, - VkSurfaceFormatKHR* format) const { +int VulkanDevice::ChooseSurfaceFormat(const VulkanSurface& surface, + std::vector desired_formats, + VkSurfaceFormatKHR* format) const { if (!surface.IsValid() || format == nullptr) { - return false; + return -1; } uint32_t format_count = 0; if (VK_CALL_LOG_ERROR(vk.GetPhysicalDeviceSurfaceFormatsKHR( physical_device_, surface.Handle(), &format_count, nullptr)) != VK_SUCCESS) { - return false; + return -1; } if (format_count == 0) { - return false; + return -1; } VkSurfaceFormatKHR formats[format_count]; if (VK_CALL_LOG_ERROR(vk.GetPhysicalDeviceSurfaceFormatsKHR( physical_device_, surface.Handle(), &format_count, formats)) != VK_SUCCESS) { - return false; + return -1; } std::map supported_formats; - for (uint32_t i = 0; i < format_count; i++) { - GrPixelConfig pixel_config = GrVkFormatToPixelConfig(formats[i].format); - if (pixel_config != kUnknown_GrPixelConfig) { - supported_formats[formats[i].format] = formats[i]; - } + supported_formats[formats[i].format] = formats[i]; } - if (supported_formats.size() == 0) { - return false; - } - - const std::vector desired_formats = { - VK_FORMAT_R8G8B8A8_SRGB, // kSRGBA_8888_GrPixelConfig - VK_FORMAT_B8G8R8A8_SRGB, // kSBGRA_8888_GrPixelConfig - VK_FORMAT_R16G16B16A16_SFLOAT, // kRGBA_half_GrPixelConfig - VK_FORMAT_R8G8B8A8_UNORM, // kRGBA_8888_GrPixelConfig - VK_FORMAT_B8G8R8A8_UNORM, // kBGRA_8888_GrPixelConfig - }; - // Try to find the first supported format in the list of desired formats. - for (VkFormat current_format : desired_formats) { - auto found = supported_formats.find(current_format); + for (size_t i = 0; i < desired_formats.size(); ++i) { + auto found = supported_formats.find(desired_formats[i]); if (found != supported_formats.end()) { *format = found->second; - return true; + return static_cast(i); } } - // None of the desired formats were supported. Return the first supported - // format even if we don't like it all that much (it has already returned true - // for GrVkFormatToPixelConfig). - *format = supported_formats.begin()->second; - return true; + return -1; } bool VulkanDevice::ChoosePresentMode(const VulkanSurface& surface, diff --git a/vulkan/vulkan_device.h b/vulkan/vulkan_device.h index bbb7fb66fbcee..e9abf757f6a94 100644 --- a/vulkan/vulkan_device.h +++ b/vulkan/vulkan_device.h @@ -49,8 +49,9 @@ class VulkanDevice { uint32_t* /* mask of GrVkFeatureFlags */ features) const; FXL_WARN_UNUSED_RESULT - bool ChooseSurfaceFormat(const VulkanSurface& surface, - VkSurfaceFormatKHR* format) const; + int ChooseSurfaceFormat(const VulkanSurface& surface, + std::vector desired_formats, + VkSurfaceFormatKHR* format) const; FXL_WARN_UNUSED_RESULT bool ChoosePresentMode(const VulkanSurface& surface, diff --git a/vulkan/vulkan_swapchain.cc b/vulkan/vulkan_swapchain.cc index a43859eca2cb7..f3ca6d0c10a37 100644 --- a/vulkan/vulkan_swapchain.cc +++ b/vulkan/vulkan_swapchain.cc @@ -10,11 +10,32 @@ #include "flutter/vulkan/vulkan_proc_table.h" #include "flutter/vulkan/vulkan_surface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" +#include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" -#include "third_party/skia/src/gpu/vk/GrVkUtil.h" namespace vulkan { +namespace { +struct FormatInfo { + VkFormat format_; + SkColorType color_type_; + sk_sp color_space_; +}; +} // namespace + +static std::vector DesiredFormatInfos() { + return {{VK_FORMAT_R8G8B8A8_SRGB, kRGBA_8888_SkColorType, + SkColorSpace::MakeSRGB()}, + {VK_FORMAT_B8G8R8A8_SRGB, kRGBA_8888_SkColorType, + SkColorSpace::MakeSRGB()}, + {VK_FORMAT_R16G16B16A16_SFLOAT, kRGBA_F16_SkColorType, + SkColorSpace::MakeSRGBLinear()}, + {VK_FORMAT_R8G8B8A8_UNORM, kRGBA_8888_SkColorType, + SkColorSpace::MakeSRGB()}, + {VK_FORMAT_B8G8R8A8_UNORM, kRGBA_8888_SkColorType, + SkColorSpace::MakeSRGB()}}; +} + VulkanSwapchain::VulkanSwapchain(const VulkanProcTable& p_vk, const VulkanDevice& device, const VulkanSurface& surface, @@ -39,7 +60,20 @@ VulkanSwapchain::VulkanSwapchain(const VulkanProcTable& p_vk, return; } - if (!device_.ChooseSurfaceFormat(surface, &surface_format_)) { + const auto format_infos = DesiredFormatInfos(); + std::vector desired_formats(format_infos.size()); + for (size_t i = 0; i < format_infos.size(); ++i) { + if (skia_context->colorTypeSupportedAsSurface( + format_infos[i].color_type_)) { + desired_formats[i] = format_infos[i].format_; + } else { + desired_formats[i] = VK_FORMAT_UNDEFINED; + } + } + + int format_index = + device_.ChooseSurfaceFormat(surface, desired_formats, &surface_format_); + if (format_index < 0) { FXL_DLOG(INFO) << "Could not choose surface format."; return; } @@ -115,7 +149,9 @@ VulkanSwapchain::VulkanSwapchain(const VulkanProcTable& p_vk, nullptr); }}; - if (!CreateSwapchainImages(skia_context)) { + if (!CreateSwapchainImages(skia_context, + format_infos[format_index].color_type_, + format_infos[format_index].color_space_)) { FXL_DLOG(INFO) << "Could not create swapchain images."; return; } @@ -171,29 +207,18 @@ SkISize VulkanSwapchain::GetSize() const { return SkISize::Make(extents.width, extents.height); } -static sk_sp SkColorSpaceFromVkFormat(VkFormat format) { - if (GrVkFormatIsSRGB(format, nullptr /* dont care */)) { - return SkColorSpace::MakeSRGB(); - } - - if (format == VK_FORMAT_R16G16B16A16_SFLOAT) { - return SkColorSpace::MakeSRGBLinear(); - } - - return nullptr; -} - -sk_sp VulkanSwapchain::CreateSkiaSurface(GrContext* gr_context, - VkImage image, - const SkISize& size) const { +sk_sp VulkanSwapchain::CreateSkiaSurface( + GrContext* gr_context, + VkImage image, + const SkISize& size, + SkColorType color_type, + sk_sp color_space) const { if (gr_context == nullptr) { return nullptr; } - GrPixelConfig pixel_config = GrVkFormatToPixelConfig(surface_format_.format); - - if (pixel_config == kUnknown_GrPixelConfig) { - // Vulkan format unsupported by Skia. + if (color_type == kUnknown_SkColorType) { + // Unexpected Vulkan format. return nullptr; } @@ -212,15 +237,18 @@ sk_sp VulkanSwapchain::CreateSkiaSurface(GrContext* gr_context, SkSurfaceProps props(SkSurfaceProps::InitType::kLegacyFontHost_InitType); return SkSurface::MakeFromBackendRenderTarget( - gr_context, // context - backend_render_target, // backend render target - kTopLeft_GrSurfaceOrigin, - SkColorSpaceFromVkFormat(surface_format_.format), // colorspace - &props // surface properties + gr_context, // context + backend_render_target, // backend render target + kTopLeft_GrSurfaceOrigin, // origin + color_type, // color type + std::move(color_space), // color space + &props // surface properties ); } -bool VulkanSwapchain::CreateSwapchainImages(GrContext* skia_context) { +bool VulkanSwapchain::CreateSwapchainImages(GrContext* skia_context, + SkColorType color_type, + sk_sp color_space) { std::vector images = GetImages(); if (images.size() == 0) { @@ -250,7 +278,8 @@ bool VulkanSwapchain::CreateSwapchainImages(GrContext* skia_context) { images_.emplace_back(std::move(vulkan_image)); // Populate the surface. - auto surface = CreateSkiaSurface(skia_context, image, surface_size); + auto surface = CreateSkiaSurface(skia_context, image, surface_size, + color_type, color_space); if (surface == nullptr) { return false; diff --git a/vulkan/vulkan_swapchain.h b/vulkan/vulkan_swapchain.h index 43cfe8a9c88ce..fcc60b1fe001d 100644 --- a/vulkan/vulkan_swapchain.h +++ b/vulkan/vulkan_swapchain.h @@ -77,11 +77,15 @@ class VulkanSwapchain { std::vector GetImages() const; - bool CreateSwapchainImages(GrContext* skia_context); + bool CreateSwapchainImages(GrContext* skia_context, + SkColorType color_type, + sk_sp color_space); sk_sp CreateSkiaSurface(GrContext* skia_context, VkImage image, - const SkISize& size) const; + const SkISize& size, + SkColorType color_type, + sk_sp color_space) const; VulkanBackbuffer* GetNextBackbuffer(); From 3e877d371a359097d7af28aa6e85026fa2318baa Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Fri, 23 Mar 2018 12:38:58 -0400 Subject: [PATCH 0015/1190] Remove declaration for undefined GPUSurfaceGL::SelectPixelConfig (#4857) --- shell/gpu/gpu_surface_gl.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/shell/gpu/gpu_surface_gl.h b/shell/gpu/gpu_surface_gl.h index 3f951a4481b56..5cf092dae66c5 100644 --- a/shell/gpu/gpu_surface_gl.h +++ b/shell/gpu/gpu_surface_gl.h @@ -52,8 +52,6 @@ class GPUSurfaceGL : public Surface { bool PresentSurface(SkCanvas* canvas); - bool SelectPixelConfig(GrPixelConfig* config); - FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceGL); }; From e622bd93c902a308788c28f3637325154b9e9cc4 Mon Sep 17 00:00:00 2001 From: Siva Date: Fri, 23 Mar 2018 15:33:21 -0700 Subject: [PATCH 0016/1190] - roll Dart to 2f68e82526d59b679a522e25db224d8c7e23d280 (#4864) --- DEPS | 8 ++++---- travis/licenses_golden/licenses_third_party | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index 4b28d2c30fdb1..a4a324424c4bd 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '06949dc98556adb807e270c47cbb9407ec781064', + 'dart_revision': '2f68e82526d59b679a522e25db224d8c7e23d280', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -54,13 +54,13 @@ vars = { 'dart_html_tag': '0.13.3', 'dart_http_multi_server_tag': '2.0.4', 'dart_http_parser_tag': '3.1.1', - 'dart_http_retry_tag': '0.1.0', + 'dart_http_retry_tag': '0.1.1', 'dart_http_tag': '0.11.3+16', 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.44', + 'dart_linter_tag': '0.1.45', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', @@ -75,7 +75,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': 'dbe8be2bb8bca9b26ba7bd583272c62f9a0153fd', + 'dart_pub_rev': '875d35005a7d33f367d70a3e31e9d3bad5d1ebd8', 'dart_pub_semver_tag': '1.3.2', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index bb8778b6dc2b6..8080dfc3eadf1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a714ae47f09ddeaf5ab4e20e34c3743a +Signature: 1c586b7cec7bcad97600f92debbb310c UNUSED LICENSES: @@ -6062,6 +6062,9 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h +FILE: ../../../third_party/dart/sdk/lib/js/_js.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file From ea17fff90b7d79332813c68ca5c7f4c22a479fb6 Mon Sep 17 00:00:00 2001 From: Yegor Date: Fri, 23 Mar 2018 17:50:52 -0700 Subject: [PATCH 0017/1190] CONTRIBUTING.md: explain the need for building host with non-host (#4863) * CONTRIBUTING.md: explain the need for building host with non-host * address comments * locally-built --- CONTRIBUTING.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b8adf8cf129a3..e13cf7a72fe19 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -95,8 +95,9 @@ Run the following steps, from the `src` directory created in the steps above: * `git pull upstream master` in `src/flutter` to update the Flutter Engine repo. * `gclient sync` to update your dependencies. -* `./flutter/tools/gn --android --unoptimized` to prepare your build files (or `--android --android-cpu [x86|x64] --unoptimized` for x86/x64 emulators) . -* `ninja -C out/android_debug_unopt` to actually build the Android binary (or `out/android_debug_unopt_x64` for x86/x64 emulators). +* `./flutter/tools/gn --android --unoptimized` to prepare your build files for device-side executables (or `--android --android-cpu [x86|x64] --unoptimized` for x86/x64 emulators) . +* `./flutter/tools/gn --unoptimized` to prepare the build files for host-side executables. +* `ninja -C out/android_debug_unopt -C out/host_debug_unopt` to build all executables (use `out/android_debug_unopt_x64` for x86/x64 emulators). This builds a debug-enabled ("unoptimized") binary configured to run Dart in checked mode ("debug"). There are other versions, [discussed on the wiki](https://github.com/flutter/flutter/wiki/Flutter's-modes). @@ -137,10 +138,11 @@ to test the engine. * Make sure you have Xcode 9.0+ installed. * `git pull upstream master` in `src/flutter` to update the Flutter Engine repo. * `gclient sync` to update dependencies. -* `./flutter/tools/gn --ios --unoptimized` to prepare build files (or `--ios --simulator --unoptimized` for simulator). +* `./flutter/tools/gn --ios --unoptimized` to prepare build files for device-side executables (or `--ios --simulator --unoptimized` for simulator). * For a discussion on the various flags and modes, [read this discussion](https://github.com/flutter/flutter/wiki/Flutter's-modes). * This also produces an Xcode project for working with the engine source code at `out/ios_debug_unopt` -* `ninja -C out/ios_debug_unopt` to build iOS artifacts (or `out/ios_debug_sim_unopt` for simulator). +* `./flutter/tools/gn --unoptimized` to prepare the build files for host-side executables. +* `ninja -C out/ios_debug_unopt -C out/host_debug_unopt` to build all artifacts (use `out/ios_debug_sim_unopt` for Simulator). Once the artifacts are built, you can start using them in your application by following these steps: * `cd /path/to/flutter/examples/hello_world` @@ -151,15 +153,17 @@ Once the artifacts are built, you can start using them in your application by fo ### Desktop (Mac and Linux), for tests +To run the tests, you should first clone [the main Flutter repository](https://github.com/flutter/flutter). +See [the instructions for contributing](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md) +to the main Flutter repository for detailed instructions. By default, Flutter will use the bundled version +of the engine. Follow the next steps to run tests using the locally-built engine: + * `git pull upstream master` in `src/flutter` to update the Flutter Engine repo. * `gclient sync` to update your dependencies. * `./flutter/tools/gn --unoptimized` to prepare your build files. * `ninja -C out/host_debug_unopt` to build a desktop unoptimized binary. * `--unoptimized` disables C++ compiler optimizations and does not strip debug symbols. You may skip the flag and invoke `ninja -C out/host_debug` if you would rather have the native components optimized. - -To run the tests, you'll also need to clone [the main Flutter repository](https://github.com/flutter/flutter). -See [the instructions for contributing](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md) -to the main Flutter repository for detailed instructions. +* `flutter test --local-engine=host_debug_unopt` will run tests using the locally-built `flutter_tester`. ### Desktop (gen_snapshot for Windows) From 7fa08b3ba94cb32cf0a2f466e5ee5d539d144705 Mon Sep 17 00:00:00 2001 From: Stanislav Baranov Date: Mon, 26 Mar 2018 13:14:38 -0700 Subject: [PATCH 0018/1190] Support for decimal and signed numeric keyboard (#4853) * Support for decimal and signed numeric keyboard * Comments --- .../plugin/editing/TextInputPlugin.java | 19 +++++++++++++------ .../Source/FlutterTextInputPlugin.mm | 15 ++++++++++----- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java b/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java index d5e952d7c2025..0d8f05e3a94a4 100644 --- a/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java +++ b/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java @@ -77,13 +77,20 @@ public void onMethodCall(MethodCall call, Result result) { } } - private static int inputTypeFromTextInputType(String inputType, - boolean obscureText, - boolean autocorrect) { + private static int inputTypeFromTextInputType( + JSONObject type, boolean obscureText, boolean autocorrect) throws JSONException { + + String inputType = type.getString("name"); if (inputType.equals("TextInputType.datetime")) return InputType.TYPE_CLASS_DATETIME; - if (inputType.equals("TextInputType.number")) - return InputType.TYPE_CLASS_NUMBER; + if (inputType.equals("TextInputType.number")) { + int textType = InputType.TYPE_CLASS_NUMBER; + if (type.optBoolean("signed")) + textType |= InputType.TYPE_NUMBER_FLAG_SIGNED; + if (type.optBoolean("decimal")) + textType |= InputType.TYPE_NUMBER_FLAG_DECIMAL; + return textType; + } if (inputType.equals("TextInputType.phone")) return InputType.TYPE_CLASS_PHONE; @@ -119,7 +126,7 @@ public InputConnection createInputConnection(FlutterView view, EditorInfo outAtt return null; outAttrs.inputType = inputTypeFromTextInputType( - mConfiguration.getString("inputType"), + mConfiguration.getJSONObject("inputType"), mConfiguration.optBoolean("obscureText"), mConfiguration.optBoolean("autocorrect", true)); outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index d7431ea7d91ec..2a9f6b62ec188 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -9,13 +9,17 @@ static const char _kTextAffinityDownstream[] = "TextAffinity.downstream"; static const char _kTextAffinityUpstream[] = "TextAffinity.upstream"; -static UIKeyboardType ToUIKeyboardType(NSString* inputType) { +static UIKeyboardType ToUIKeyboardType(NSDictionary* type) { + NSString* inputType = type[@"name"]; if ([inputType isEqualToString:@"TextInputType.text"]) return UIKeyboardTypeDefault; if ([inputType isEqualToString:@"TextInputType.multiline"]) return UIKeyboardTypeDefault; - if ([inputType isEqualToString:@"TextInputType.number"]) + if ([inputType isEqualToString:@"TextInputType.number"]) { + if ([type[@"signed"] boolValue]) + return UIKeyboardTypeNumbersAndPunctuation; return UIKeyboardTypeDecimalPad; + } if ([inputType isEqualToString:@"TextInputType.phone"]) return UIKeyboardTypePhonePad; if ([inputType isEqualToString:@"TextInputType.emailAddress"]) @@ -606,9 +610,10 @@ - (void)hideTextInput { } - (void)setTextInputClient:(int)client withConfiguration:(NSDictionary*)configuration { - _view.keyboardType = ToUIKeyboardType(configuration[@"inputType"]); - _view.returnKeyType = ToUIReturnKeyType(configuration[@"inputType"]); - _view.autocapitalizationType = ToUITextAutocapitalizationType(configuration[@"inputType"]); + NSDictionary* inputType = configuration[@"inputType"]; + _view.keyboardType = ToUIKeyboardType(inputType); + _view.returnKeyType = ToUIReturnKeyType(inputType[@"name"]); + _view.autocapitalizationType = ToUITextAutocapitalizationType(inputType[@"name"]); _view.secureTextEntry = [configuration[@"obscureText"] boolValue]; NSString* autocorrect = configuration[@"autocorrect"]; _view.autocorrectionType = autocorrect && ![autocorrect boolValue] From d9ec2de7d081b24d844590ebdb5fca37b57731c6 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Mon, 26 Mar 2018 14:05:25 -0700 Subject: [PATCH 0019/1190] Fix vulkan include path (#4870) --- vulkan/skia_vulkan_header.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vulkan/skia_vulkan_header.h b/vulkan/skia_vulkan_header.h index e3f36ff0f96a8..1001dbcead16e 100644 --- a/vulkan/skia_vulkan_header.h +++ b/vulkan/skia_vulkan_header.h @@ -8,4 +8,4 @@ #endif // VK_USE_PLATFORM_ANDROID_KHR #endif // __ANDROID__ -#include "third_party/vulkan/src/vulkan/vulkan.h" +#include "vulkan/vulkan.h" From 5e8557330af74c4d96f625ee3b02072248cad639 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 26 Mar 2018 15:43:38 -0700 Subject: [PATCH 0020/1190] Allow FirstFrameListeners to remove themselves from the FlutterView's list (#4871) Fixes https://github.com/flutter/flutter/issues/15884 --- shell/platform/android/io/flutter/view/FlutterView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index e875f00073831..6b8f6b47f6fd4 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -767,7 +767,9 @@ public void updateSemantics(ByteBuffer buffer, String[] strings) { // Called by native to notify first Flutter frame rendered. public void onFirstFrame() { - for (FirstFrameListener listener : mFirstFrameListeners) { + // Allow listeners to remove themselves when they are called. + List listeners = new ArrayList<>(mFirstFrameListeners); + for (FirstFrameListener listener : listeners) { listener.onFirstFrame(); } } From a80905b5eee4d62259672a86730b11e82c252302 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Mon, 26 Mar 2018 16:56:00 -0700 Subject: [PATCH 0021/1190] Revert "Fix vulkan include path (#4870)" (#4872) Breaks Linux and Mac build bots. This reverts commit d9ec2de7d081b24d844590ebdb5fca37b57731c6. --- vulkan/skia_vulkan_header.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vulkan/skia_vulkan_header.h b/vulkan/skia_vulkan_header.h index 1001dbcead16e..e3f36ff0f96a8 100644 --- a/vulkan/skia_vulkan_header.h +++ b/vulkan/skia_vulkan_header.h @@ -8,4 +8,4 @@ #endif // VK_USE_PLATFORM_ANDROID_KHR #endif // __ANDROID__ -#include "vulkan/vulkan.h" +#include "third_party/vulkan/src/vulkan/vulkan.h" From dd6f46c485192f4506035088c9065b9f5dbba9ab Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Mon, 26 Mar 2018 20:51:19 -0700 Subject: [PATCH 0022/1190] Make flutter_test on Mac exit on error like Linux and Windows. (#4873) --- shell/platform/darwin/desktop/main_mac.mm | 81 ++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/shell/platform/darwin/desktop/main_mac.mm b/shell/platform/darwin/desktop/main_mac.mm index 8087d0e92cd6d..808a5f63f1d14 100644 --- a/shell/platform/darwin/desktop/main_mac.mm +++ b/shell/platform/darwin/desktop/main_mac.mm @@ -7,13 +7,69 @@ #include #include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" #include "flutter/shell/platform/darwin/common/platform_mac.h" #include "flutter/shell/platform/darwin/desktop/flutter_application.h" +#include "flutter/shell/testing/test_runner.h" #include "flutter/shell/testing/testing.h" #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" +#include "lib/tonic/dart_microtask_queue.h" + +// Exit codes used by the Dart command line tool. +const int kApiErrorExitCode = 253; +const int kCompilationErrorExitCode = 254; +const int kErrorExitCode = 255; + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver : public fml::TaskObserver { + public: + ScriptCompletionTaskObserver(fxl::RefPtr task_runner) + : main_task_runner_(std::move(task_runner)), + prev_live_(false), + last_error_(tonic::kNoError) {} + + void DidProcessTask() override { + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + shell::Engine& engine = test_runner.platform_view().engine(); + + if (engine.GetLoadScriptError() != tonic::kNoError) { + last_error_ = engine.GetLoadScriptError(); + main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); + return; + } + + bool live = engine.UIIsolateHasLivePorts(); + if (prev_live_ && !live) { + last_error_ = engine.GetUIIsolateLastError(); + main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + prev_live_ = live; + } + + tonic::DartErrorHandleType last_error() { return last_error_; } + + private: + fxl::RefPtr main_task_runner_; + bool prev_live_; + tonic::DartErrorHandleType last_error_; +}; + +int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { + switch (error) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } +} static fxl::CommandLine InitializedCommandLine() { std::vector args_vector; @@ -47,8 +103,31 @@ int main(int argc, const char* argv[]) { if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::NonInteractive))) { if (!shell::InitForTesting(std::move(command_line))) return 1; + + // Note that this task observer must be added after the observer that drains + // the microtask queue. + ScriptCompletionTaskObserver task_observer(fml::MessageLoop::GetCurrent().GetTaskRunner()); + blink::Threads::UI()->PostTask( + [&task_observer] { fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); }); + fml::MessageLoop::GetCurrent().Run(); - return EXIT_SUCCESS; + + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + tonic::DartErrorHandleType error = test_runner.platform_view().engine().GetLoadScriptError(); + if (error == tonic::kNoError) + error = task_observer.last_error(); + if (error == tonic::kNoError) { + fxl::AutoResetWaitableEvent latch; + blink::Threads::UI()->PostTask([&error, &latch] { + error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); + latch.Signal(); + }); + latch.Wait(); + } + + // The script has completed and the engine may not be in a clean state, + // so just stop the process. + exit(ConvertErrorTypeToExitCode(error)); } else { return NSApplicationMain(argc, argv); } From 5bfdc8f9bbe5d1af3d20f80d5b22ee8b4575144e Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Tue, 27 Mar 2018 10:10:45 -0700 Subject: [PATCH 0023/1190] Retry fixing vulkan include (#4874) --- vulkan/vulkan_backbuffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vulkan/vulkan_backbuffer.cc b/vulkan/vulkan_backbuffer.cc index 0bcfa1643dcc4..3ad3d21c1e1ad 100644 --- a/vulkan/vulkan_backbuffer.cc +++ b/vulkan/vulkan_backbuffer.cc @@ -6,9 +6,9 @@ #include -#include "flutter/vulkan/skia_vulkan_header.h" #include "flutter/vulkan/vulkan_proc_table.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" +#include "vulkan/vulkan.h" namespace vulkan { From 6473f1b106485cb0b4ea569af383173daeef8895 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Tue, 27 Mar 2018 13:53:01 -0400 Subject: [PATCH 0024/1190] Use newer Skia API for constructing mask blur filters (#4875) Old API is going to be hidden/removed soon --- sky/engine/platform/graphics/DrawLooperBuilder.cpp | 8 +++----- sky/engine/platform/graphics/GraphicsContext.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sky/engine/platform/graphics/DrawLooperBuilder.cpp b/sky/engine/platform/graphics/DrawLooperBuilder.cpp index fdf0925c26a94..376cc2e92dcf0 100644 --- a/sky/engine/platform/graphics/DrawLooperBuilder.cpp +++ b/sky/engine/platform/graphics/DrawLooperBuilder.cpp @@ -37,8 +37,8 @@ #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColorFilter.h" #include "third_party/skia/include/core/SkDrawLooper.h" +#include "third_party/skia/include/core/SkMaskFilter.h" #include "third_party/skia/include/core/SkPaint.h" -#include "third_party/skia/include/effects/SkBlurMaskFilter.h" namespace blink { @@ -100,11 +100,9 @@ void DrawLooperBuilder::addShadow(const FloatSize& offset, if (blur) { const SkScalar sigma = RadiusToSigma(blur / 2); - uint32_t mfFlags = SkBlurMaskFilter::kHighQuality_BlurFlag; - if (shadowTransformMode == ShadowIgnoresTransforms) - mfFlags |= SkBlurMaskFilter::kIgnoreTransform_BlurFlag; + bool respectCTM = (shadowTransformMode != ShadowIgnoresTransforms); paint->setMaskFilter( - SkBlurMaskFilter::Make(kNormal_SkBlurStyle, sigma, mfFlags)); + SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, sigma, respectCTM)); } paint->setColorFilter( diff --git a/sky/engine/platform/graphics/GraphicsContext.cpp b/sky/engine/platform/graphics/GraphicsContext.cpp index c32bfcc72b514..a0f8bc8f29161 100644 --- a/sky/engine/platform/graphics/GraphicsContext.cpp +++ b/sky/engine/platform/graphics/GraphicsContext.cpp @@ -37,11 +37,11 @@ #include "third_party/skia/include/core/SkAnnotation.h" #include "third_party/skia/include/core/SkColorFilter.h" #include "third_party/skia/include/core/SkData.h" +#include "third_party/skia/include/core/SkMaskFilter.h" #include "third_party/skia/include/core/SkPicture.h" #include "third_party/skia/include/core/SkRRect.h" #include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/include/effects/SkBlurMaskFilter.h" #include "third_party/skia/include/effects/SkCornerPathEffect.h" #include "third_party/skia/include/effects/SkLumaColorFilter.h" #include "third_party/skia/include/effects/SkPictureImageFilter.h" From ea7bb0d5fde67ac05d31d08b22b89c9d4bd98c8d Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 28 Mar 2018 14:18:37 -0700 Subject: [PATCH 0025/1190] libtxt: move to the next run if the current run ends before the start of the line block (#4891) Fixes https://github.com/flutter/flutter/issues/15975 --- third_party/txt/src/txt/paragraph.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index f9d11f457bf21..b2d4f7c70fc6c 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -239,6 +239,10 @@ bool Paragraph::ComputeLineBreaks() { StyledRuns::Run run = runs_.GetRun(run_index); if (run.start >= block_end) break; + if (run.end < block_start) { + run_index++; + continue; + } minikin::FontStyle font; minikin::MinikinPaint paint; From 9af82c5a1a79ae02477db13e721c8365f31a4840 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Wed, 28 Mar 2018 14:36:58 -0700 Subject: [PATCH 0026/1190] Rolled Dart SDK to e3051175192c83fafa3636c0f16d804734bb285a (#4877) * Rolled Dart SDK to e3051175192c83fafa3636c0f16d804734bb285a --- DEPS | 4 ++-- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index a4a324424c4bd..3c2e0c058ed69 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '2f68e82526d59b679a522e25db224d8c7e23d280', + 'dart_revision': 'e3051175192c83fafa3636c0f16d804734bb285a', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -60,7 +60,7 @@ vars = { 'dart_intl_tag': '0.15.2', 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.45', + 'dart_linter_tag': '0.1.46', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8080dfc3eadf1..c8c21e21b054c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1c586b7cec7bcad97600f92debbb310c +Signature: 5591b9dbad944ddf64a6bf58db4c153f UNUSED LICENSES: From 564c6a5a9c3c16e4220301d88807aea69d878cef Mon Sep 17 00:00:00 2001 From: xster Date: Wed, 28 Mar 2018 15:51:33 -0700 Subject: [PATCH 0027/1190] Add hint to use ninja with goma (#4894) --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e13cf7a72fe19..543b586063bc6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,6 +98,7 @@ Run the following steps, from the `src` directory created in the steps above: * `./flutter/tools/gn --android --unoptimized` to prepare your build files for device-side executables (or `--android --android-cpu [x86|x64] --unoptimized` for x86/x64 emulators) . * `./flutter/tools/gn --unoptimized` to prepare the build files for host-side executables. * `ninja -C out/android_debug_unopt -C out/host_debug_unopt` to build all executables (use `out/android_debug_unopt_x64` for x86/x64 emulators). + * For Googlers, consider also using the option `-j 1000` to parallelize the build using Goma. This builds a debug-enabled ("unoptimized") binary configured to run Dart in checked mode ("debug"). There are other versions, [discussed on the wiki](https://github.com/flutter/flutter/wiki/Flutter's-modes). @@ -143,6 +144,7 @@ to test the engine. * This also produces an Xcode project for working with the engine source code at `out/ios_debug_unopt` * `./flutter/tools/gn --unoptimized` to prepare the build files for host-side executables. * `ninja -C out/ios_debug_unopt -C out/host_debug_unopt` to build all artifacts (use `out/ios_debug_sim_unopt` for Simulator). + * For Googlers, consider also using the option `-j 1000` to parallelize the build using Goma. Once the artifacts are built, you can start using them in your application by following these steps: * `cd /path/to/flutter/examples/hello_world` @@ -162,6 +164,7 @@ of the engine. Follow the next steps to run tests using the locally-built engine * `gclient sync` to update your dependencies. * `./flutter/tools/gn --unoptimized` to prepare your build files. * `ninja -C out/host_debug_unopt` to build a desktop unoptimized binary. + * For Googlers, consider also using the option `-j 1000` to parallelize the build using Goma. * `--unoptimized` disables C++ compiler optimizations and does not strip debug symbols. You may skip the flag and invoke `ninja -C out/host_debug` if you would rather have the native components optimized. * `flutter test --local-engine=host_debug_unopt` will run tests using the locally-built `flutter_tester`. From af63732deff0df8ebd108a44d932d836d3e64443 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Thu, 29 Mar 2018 00:04:47 -0400 Subject: [PATCH 0028/1190] Support `Path.addCircle` (#4783) * add Path.addCircle * docs formatting * revert path.cc/path.h; remove addCircle and update docs on addOval * add missing file. --- AUTHORS | 1 + lib/ui/painting.dart | 3 +++ 2 files changed, 4 insertions(+) diff --git a/AUTHORS b/AUTHORS index 649be0fcbe92a..5fdf752a2e376 100644 --- a/AUTHORS +++ b/AUTHORS @@ -7,3 +7,4 @@ Google Inc. Jim Simon Ali Bitek Jacob Greenfield +Dan Field diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index d69314bbb7659..9ee3ef39a2597 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1513,6 +1513,9 @@ class Path extends NativeFieldWrapperClass2 { /// Adds a new subpath that consists of a curve that forms the /// ellipse that fills the given rectangle. + /// + /// To add a circle, pass an appropriate rectangle as `oval`. [Rect.fromCircle] + /// can be used to easily describe the circle's center [Offset] and radius. void addOval(Rect oval) { assert(_rectIsValid(oval)); _addOval(oval.left, oval.top, oval.right, oval.bottom); From 94cdd81031a287babbf70144ea93d18d88abae4a Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 29 Mar 2018 14:54:24 -0700 Subject: [PATCH 0029/1190] Roll dart. (#4902) * Roll dart. Changes since last roll: 4da52281aa [frontend-server] Return non-zero exit code if there are errors. d7a540bfe7 Document --enable-asserts in dart2js's help, and remove --checked. d9c3190e44 [vm] Remove some bin -> vm includes. 3dcdaf9e57 [vm] Check for OOM when allocating a new handle block. 865f52737a [dart:io] Adds IOOverrides.socketConnect f858e5d539 Replace Token.previous usage in BodyBuilder f66532b31b Replace more occurrences of token.previous with findPrevious d46915d239 Bring in the latest pub 7470f410dd Clean up documentation of command-line analyzer options 4b682341d9 [ VM / Dart 2 ] Marked tests that exercise functionality not supported in Dart 2 as SkipByDesign. 859632b439 Fixes for uninitialized fields of Flutter widgets create constructors in Flutter style. c9e9c1d8e9 Remove dart:isolate runtime support in DDC 0482cf4da1 [fuchsia] Add rules to build gen_snapshot targeting Fuchsia 2de82410e0 Make isolate patch play nice with web workers. be3baa0b8f Additional ExprBuilder implementation. 42581e4fa6 [VM] Added '--enable-asserts' to the top-level help message. 44dbba2b80 Use offset/length of the import prefix, or empty. Same for constructor names. 85b4c604c5 [VM runtime] Improve type error messages in Dart 2 (fixes #32564). Hide private class _Future and map it to core lib class Future. In Dart 2, show dynamic as type argument(s) of raw generic types. ebdee7ee0f More prep work to allow the linker to re-use resolution logic. 91e6c8b019 Fix missing_return warning in expr_builder.dart 59de9710ea Complete Flutter's setState() as a whole statement, with a closure, and the caret inside the closure. b82e5b4704 Replace code completion usage of token.previous with findPrevious 0e8457c8c8 Fix for building sequence of identifiers and several tests. 6a84638d7a Updated for proper failure. 577b168c39 Fix jsinterop bug: we incorrectly added null values for js-interop constructor calls. 8e02ff92db Added @category annotation for Web libraries and removed createCustomUpgrader. c60199cf86 [vm/kernel/aot] Tree shaking based on results of TFA, take 2. b217e21907 Mark a few more co19 failures to fix. 70f455351d [kernel] Add field for instantiate-to-bounds algorithm in TypeParameter. bc75856e54 Update getClientRects, removed xtab, removed bogus entry in dom.json, expose ServiceWorker, removed query and queryAll from in dart:html, added constructor to MessageChannel and removed getCssCanvasContext. f9e12f1116 step 3 of ??: ignore old options from old FE c0fa4e2fe3 step 2 of ??: remove unnecessary pattern in -m option 51867f28a2 step 1 of ??: cleaning up options... * Update license hash. No license changes. --- DEPS | 6 +++--- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 3c2e0c058ed69..13821537a9ea3 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'e3051175192c83fafa3636c0f16d804734bb285a', + 'dart_revision': '4da52281aa35b6c1951b3e269a6934412b15b105', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -48,7 +48,7 @@ vars = { 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.5+1', 'dart_dart_style_tag': '1.0.10', - 'dart_dartdoc_tag': 'v0.17.1+1', + 'dart_dartdoc_tag': 'v0.18.0', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', @@ -75,7 +75,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '875d35005a7d33f367d70a3e31e9d3bad5d1ebd8', + 'dart_pub_rev': 'bc2b5ff80e50b4b1c317230e8963c1fada3cfe73', 'dart_pub_semver_tag': '1.3.2', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c8c21e21b054c..7e6fc0fbaacb6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5591b9dbad944ddf64a6bf58db4c153f +Signature: 240f392a30cdf33f0ddff5fc2cf9241b UNUSED LICENSES: From ac552fba4a8082102c689cdc43de2638570ad547 Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Thu, 29 Mar 2018 21:49:35 -0700 Subject: [PATCH 0030/1190] Port flutter content handler to FIDL2. (#4903) --- content_handler/BUILD.gn | 5 +- content_handler/accessibility_bridge.cc | 3 +- content_handler/accessibility_bridge.h | 4 +- content_handler/app.cc | 10 +- content_handler/app.h | 10 +- .../application_controller_impl.cc | 42 ++--- content_handler/application_controller_impl.h | 34 ++-- content_handler/fuchsia_font_manager.cc | 22 +-- content_handler/fuchsia_font_manager.h | 2 +- content_handler/rasterizer.h | 2 +- content_handler/runtime_holder.cc | 152 +++++++++--------- content_handler/runtime_holder.h | 64 ++++---- content_handler/session_connection.cc | 21 +-- content_handler/session_connection.h | 8 +- content_handler/vulkan_rasterizer.cc | 2 +- content_handler/vulkan_rasterizer.h | 2 +- content_handler/vulkan_surface.cc | 18 +-- flow/BUILD.gn | 2 +- flow/export_node.cc | 4 +- flow/layers/layer.h | 2 +- flow/layers/layer_tree.cc | 4 +- flow/layers/layer_tree.h | 6 +- flow/raster_cache.cc | 4 +- flow/raster_cache.h | 4 +- flow/scene_update_context.h | 7 +- .../fonts/fuchsia/FontCacheFuchsia.cpp | 24 +-- .../platform/fonts/fuchsia/FontCacheFuchsia.h | 2 +- 27 files changed, 227 insertions(+), 233 deletions(-) diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 2c0fb37963050..6bc00b4e2786c 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -64,11 +64,10 @@ template("flutter_content_handler") { "//garnet/public/lib/svc/cpp", "//garnet/public/lib/ui/input/fidl", "//garnet/public/lib/ui/scenic:client", - "//garnet/public/lib/ui/views/fidl", + "//garnet/public/lib/ui/views/fidl:v1", "//garnet/public/lib/vulkan", "//garnet/public/lib/zip", - "//peridot/public/lib/clipboard/fidl", - "//peridot/public/lib/context/fidl", + "//peridot/public/lib:fidl", "//third_party/rapidjson", "//third_party/skia", "//topaz/lib/tonic", diff --git a/content_handler/accessibility_bridge.cc b/content_handler/accessibility_bridge.cc index 7547d2678f369..cb6f9b8e21155 100644 --- a/content_handler/accessibility_bridge.cc +++ b/content_handler/accessibility_bridge.cc @@ -8,7 +8,6 @@ #include "flutter/lib/ui/semantics/semantics_node.h" #include "lib/app/cpp/application_context.h" -#include "lib/context/fidl/context_writer.fidl.h" #include "lib/fxl/macros.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/stringbuffer.h" @@ -17,7 +16,7 @@ namespace flutter_runner { AccessibilityBridge::AccessibilityBridge(component::ApplicationContext* context) - : writer_(context->ConnectToEnvironmentService()) {} + : writer_(context->ConnectToEnvironmentService()) {} void AccessibilityBridge::UpdateSemantics( const blink::SemanticsNodeUpdates& update) { diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h index 07c8d248c2407..7ac54e754d9b6 100644 --- a/content_handler/accessibility_bridge.h +++ b/content_handler/accessibility_bridge.h @@ -9,7 +9,7 @@ #include "flutter/lib/ui/semantics/semantics_node.h" #include "lib/app/cpp/application_context.h" -#include "lib/context/fidl/context_writer.fidl.h" +#include namespace flutter_runner { @@ -34,7 +34,7 @@ class AccessibilityBridge { void EraseUnvisitedNodes(const std::vector& visited_nodes); std::map semantics_nodes_; - maxwell::ContextWriterPtr writer_; + modular::ContextWriterPtr writer_; }; } // namespace flutter_runner diff --git a/content_handler/app.cc b/content_handler/app.cc index dd72e32226ff3..1f1bde833d2f3 100644 --- a/content_handler/app.cc +++ b/content_handler/app.cc @@ -79,7 +79,7 @@ App::App() { } context_->outgoing_services()->AddService( - [this](f1dl::InterfaceRequest request) { + [this](fidl::InterfaceRequest request) { runner_bindings_.AddBinding(this, std::move(request)); }); } @@ -129,12 +129,12 @@ void App::WaitForPlatformViewsIdsUIThread( } void App::StartApplication( - component::ApplicationPackagePtr application, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller) { + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) { if (controllers_.empty()) { // Name this process after the url of the first application being launched. - base_label_ = "flutter:" + GetLabelFromURL(startup_info->launch_info->url); + base_label_ = "flutter:" + GetLabelFromURL(startup_info.launch_info.url); } std::unique_ptr impl = diff --git a/content_handler/app.h b/content_handler/app.h index 9faeaa78dba66..dc8c49927d897 100644 --- a/content_handler/app.h +++ b/content_handler/app.h @@ -10,7 +10,7 @@ #include "flutter/content_handler/application_controller_impl.h" #include "lib/app/cpp/application_context.h" -#include "lib/app/fidl/application_runner.fidl.h" +#include #include "lib/fsl/threading/thread.h" #include "lib/fxl/macros.h" #include "lib/fxl/synchronization/waitable_event.h" @@ -27,9 +27,9 @@ class App : public component::ApplicationRunner { // |component::ApplicationRunner| implementation: void StartApplication( - component::ApplicationPackagePtr application, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller) override; + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) override; void Destroy(ApplicationControllerImpl* controller); @@ -50,7 +50,7 @@ class App : public component::ApplicationRunner { std::unique_ptr context_; std::unique_ptr gpu_thread_; std::unique_ptr io_thread_; - f1dl::BindingSet runner_bindings_; + fidl::BindingSet runner_bindings_; std::unordered_map> controllers_; diff --git a/content_handler/application_controller_impl.cc b/content_handler/application_controller_impl.cc index c38e27d9e39ac..dfed01a48348f 100644 --- a/content_handler/application_controller_impl.cc +++ b/content_handler/application_controller_impl.cc @@ -19,9 +19,9 @@ namespace flutter_runner { ApplicationControllerImpl::ApplicationControllerImpl( App* app, - component::ApplicationPackagePtr application, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller) + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) : app_(app), binding_(this) { if (controller.is_valid()) { binding_.Bind(std::move(controller)); @@ -32,8 +32,8 @@ ApplicationControllerImpl::ApplicationControllerImpl( } std::vector bundle; - if (application->data) { - if (!fsl::VectorFromVmo(std::move(application->data), &bundle)) { + if (application.data) { + if (!fsl::VectorFromVmo(std::move(*application.data), &bundle)) { FXL_LOG(ERROR) << "Failed to receive bundle."; return; } @@ -42,13 +42,13 @@ ApplicationControllerImpl::ApplicationControllerImpl( // TODO(jeffbrown): Decide what to do with command-line arguments and // startup handles. - if (startup_info->launch_info->directory_request.is_valid()) { + if (startup_info.launch_info.directory_request.is_valid()) { service_provider_bridge_.ServeDirectory( - std::move(startup_info->launch_info->directory_request)); + std::move(startup_info.launch_info.directory_request)); } - service_provider_bridge_.AddService( - [this](f1dl::InterfaceRequest request) { + service_provider_bridge_.AddService( + [this](fidl::InterfaceRequest request) { view_provider_bindings_.AddBinding(this, std::move(request)); }); @@ -56,13 +56,13 @@ ApplicationControllerImpl::ApplicationControllerImpl( auto request = service_provider.NewRequest(); service_provider_bridge_.set_backend(std::move(service_provider)); - fdio_ns_t* fdio_ns = SetupNamespace(startup_info->flat_namespace); + fdio_ns_t* fdio_ns = SetupNamespace(std::move(startup_info.flat_namespace)); if (fdio_ns == nullptr) { FXL_LOG(ERROR) << "Failed to initialize namespace"; return; } - url_ = startup_info->launch_info->url; + url_ = startup_info.launch_info.url; runtime_holder_.reset(new RuntimeHolder()); runtime_holder_->SetMainIsolateShutdownCallback([this]() { Kill(); }); runtime_holder_->Init( @@ -75,24 +75,24 @@ ApplicationControllerImpl::~ApplicationControllerImpl() = default; constexpr char kServiceRootPath[] = "/svc"; fdio_ns_t* ApplicationControllerImpl::SetupNamespace( - const component::FlatNamespacePtr& flat) { + component::FlatNamespace flat) { fdio_ns_t* fdio_namespc; zx_status_t status = fdio_ns_create(&fdio_namespc); if (status != ZX_OK) { FXL_LOG(ERROR) << "Failed to create namespace"; return nullptr; } - for (size_t i = 0; i < flat->paths->size(); ++i) { - if (flat->paths->at(i) == kServiceRootPath) { + for (size_t i = 0; i < flat.paths->size(); ++i) { + if (flat.paths->at(i) == kServiceRootPath) { // Ownership of /svc goes to the ApplicationContext created above. continue; } - zx::channel dir = std::move(flat->directories->at(i)); + zx::channel dir = std::move(flat.directories->at(i)); zx_handle_t dir_handle = dir.release(); - const char* path = flat->paths->at(i)->data(); + const char* path = flat.paths->at(i)->data(); status = fdio_ns_bind(fdio_namespc, path, dir_handle); if (status != ZX_OK) { - FXL_LOG(ERROR) << "Failed to bind " << flat->paths->at(i) + FXL_LOG(ERROR) << "Failed to bind " << flat.paths->at(i) << " to namespace"; zx_handle_close(dir_handle); fdio_ns_destroy(fdio_namespc); @@ -113,8 +113,8 @@ void ApplicationControllerImpl::Detach() { binding_.set_error_handler(fxl::Closure()); } -void ApplicationControllerImpl::Wait(const WaitCallback& callback) { - wait_callbacks_.push_back(callback); +void ApplicationControllerImpl::Wait(WaitCallback callback) { + wait_callbacks_.push_back(std::move(callback)); } void ApplicationControllerImpl::SendReturnCode(int32_t return_code) { @@ -125,8 +125,8 @@ void ApplicationControllerImpl::SendReturnCode(int32_t return_code) { } void ApplicationControllerImpl::CreateView( - f1dl::InterfaceRequest view_owner_request, - f1dl::InterfaceRequest services) { + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services) { runtime_holder_->CreateView(url_, std::move(view_owner_request), std::move(services)); } diff --git a/content_handler/application_controller_impl.h b/content_handler/application_controller_impl.h index 812afb35024e9..2065ad51c8587 100644 --- a/content_handler/application_controller_impl.h +++ b/content_handler/application_controller_impl.h @@ -9,15 +9,15 @@ #include -#include "lib/app/fidl/application_controller.fidl.h" -#include "lib/app/fidl/application_runner.fidl.h" -#include "lib/app/fidl/service_provider.fidl.h" -#include "lib/fidl/cpp/bindings/binding.h" -#include "lib/fidl/cpp/bindings/binding_set.h" +#include +#include +#include + +#include "lib/fidl/cpp/binding.h" +#include "lib/fidl/cpp/binding_set.h" #include "lib/fxl/macros.h" #include "lib/fxl/synchronization/waitable_event.h" #include "lib/svc/cpp/service_provider_bridge.h" -#include "lib/ui/views/fidl/view_provider.fidl.h" #include "third_party/dart/runtime/include/dart_api.h" namespace flutter_runner { @@ -25,13 +25,13 @@ class App; class RuntimeHolder; class ApplicationControllerImpl : public component::ApplicationController, - public mozart::ViewProvider { + public views_v1::ViewProvider { public: ApplicationControllerImpl( App* app, - component::ApplicationPackagePtr application, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller); + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller); ~ApplicationControllerImpl() override; @@ -39,13 +39,13 @@ class ApplicationControllerImpl : public component::ApplicationController, void Kill() override; void Detach() override; - void Wait(const WaitCallback& callback) override; + void Wait(WaitCallback callback) override; - // |mozart::ViewProvider| implementation + // |views_v1::ViewProvider| implementation void CreateView( - f1dl::InterfaceRequest view_owner_request, - f1dl::InterfaceRequest services) override; + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services) override; Dart_Port GetUIIsolateMainPort(); std::string GetUIIsolateName(); @@ -54,14 +54,14 @@ class ApplicationControllerImpl : public component::ApplicationController, void StartRuntimeIfReady(); void SendReturnCode(int32_t return_code); - fdio_ns_t* SetupNamespace(const component::FlatNamespacePtr& flat); + fdio_ns_t* SetupNamespace(component::FlatNamespace flat); App* app_; - f1dl::Binding binding_; + fidl::Binding binding_; component::ServiceProviderBridge service_provider_bridge_; - f1dl::BindingSet view_provider_bindings_; + fidl::BindingSet view_provider_bindings_; std::string url_; std::unique_ptr runtime_holder_; diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc index 8138d1dfbf970..b68eb610edb24 100644 --- a/content_handler/fuchsia_font_manager.cc +++ b/content_handler/fuchsia_font_manager.cc @@ -32,14 +32,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { - if (!fsl::SizedVmo::IsSizeValid(vmo->vmo, vmo->size) || - vmo->size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromVMO(fsl::SizedVmoTransport vmo) { + if (!fsl::SizedVmo::IsSizeValid(vmo.vmo, vmo.size) || + vmo.size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = vmo->size; + uint64_t size = vmo.size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, vmo->vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, vmo.vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -88,11 +88,11 @@ SkFontStyleSet* FuchsiaFontManager::onMatchFamily( SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( const char family_name[], const SkFontStyle& style) const { - auto request = fonts::FontRequest::New(); - request->family = family_name; - request->weight = style.weight(); - request->width = style.width(); - request->slant = ToFontSlant(style.slant()); + fonts::FontRequest request; + request.family = family_name; + request.weight = style.weight(); + request.width = style.width(); + request.slant = ToFontSlant(style.slant()); fonts::FontResponsePtr response; font_provider_->GetFont( @@ -107,7 +107,7 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( if (!response) return nullptr; - sk_sp data = MakeSkDataFromVMO(response->data->vmo); + sk_sp data = MakeSkDataFromVMO(std::move(response->data.vmo)); if (!data) return nullptr; diff --git a/content_handler/fuchsia_font_manager.h b/content_handler/fuchsia_font_manager.h index 1d13a88747f4f..e57d6ef76e72f 100644 --- a/content_handler/fuchsia_font_manager.h +++ b/content_handler/fuchsia_font_manager.h @@ -18,7 +18,7 @@ #define TXT_FUCHSIA_FONT_MANAGER_H_ #include -#include "lib/fonts/fidl/font_provider.fidl.h" +#include #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" diff --git a/content_handler/rasterizer.h b/content_handler/rasterizer.h index 94602120249d0..398f262a568cd 100644 --- a/content_handler/rasterizer.h +++ b/content_handler/rasterizer.h @@ -22,7 +22,7 @@ class Rasterizer { static std::unique_ptr Create(); virtual void SetScene( - f1dl::InterfaceHandle mozart, + fidl::InterfaceHandle mozart, zx::eventpair import_token, fxl::Closure metrics_changed_callback) = 0; diff --git a/content_handler/runtime_holder.cc b/content_handler/runtime_holder.cc index a69420896ffc7..421731b9691d0 100644 --- a/content_handler/runtime_holder.cc +++ b/content_handler/runtime_holder.cc @@ -60,21 +60,21 @@ void SetThreadName(fxl::RefPtr runner, std::string name) { } blink::PointerData::Change GetChangeFromPointerEventPhase( - mozart::PointerEvent::Phase phase) { + input::PointerEventPhase phase) { switch (phase) { - case mozart::PointerEvent::Phase::ADD: + case input::PointerEventPhase::ADD: return blink::PointerData::Change::kAdd; - case mozart::PointerEvent::Phase::HOVER: + case input::PointerEventPhase::HOVER: return blink::PointerData::Change::kHover; - case mozart::PointerEvent::Phase::DOWN: + case input::PointerEventPhase::DOWN: return blink::PointerData::Change::kDown; - case mozart::PointerEvent::Phase::MOVE: + case input::PointerEventPhase::MOVE: return blink::PointerData::Change::kMove; - case mozart::PointerEvent::Phase::UP: + case input::PointerEventPhase::UP: return blink::PointerData::Change::kUp; - case mozart::PointerEvent::Phase::REMOVE: + case input::PointerEventPhase::REMOVE: return blink::PointerData::Change::kRemove; - case mozart::PointerEvent::Phase::CANCEL: + case input::PointerEventPhase::CANCEL: return blink::PointerData::Change::kCancel; default: return blink::PointerData::Change::kCancel; @@ -82,11 +82,11 @@ blink::PointerData::Change GetChangeFromPointerEventPhase( } blink::PointerData::DeviceKind GetKindFromPointerType( - mozart::PointerEvent::Type type) { + input::PointerEventType type) { switch (type) { - case mozart::PointerEvent::Type::TOUCH: + case input::PointerEventType::TOUCH: return blink::PointerData::DeviceKind::kTouch; - case mozart::PointerEvent::Type::MOUSE: + case input::PointerEventType::MOUSE: return blink::PointerData::DeviceKind::kMouse; default: return blink::PointerData::DeviceKind::kTouch; @@ -111,7 +111,7 @@ RuntimeHolder::~RuntimeHolder() { void RuntimeHolder::Init( fdio_ns_t* namespc, std::unique_ptr context, - f1dl::InterfaceRequest outgoing_services, + fidl::InterfaceRequest outgoing_services, std::vector bundle) { FXL_DCHECK(!rasterizer_); rasterizer_ = Rasterizer::Create(); @@ -193,8 +193,8 @@ void RuntimeHolder::Init( void RuntimeHolder::CreateView( const std::string& script_uri, - f1dl::InterfaceRequest view_owner_request, - f1dl::InterfaceRequest services) { + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services) { if (view_listener_binding_.is_bound()) { // TODO(jeffbrown): Refactor this to support multiple view instances // sharing the same underlying root bundle (but with different runtimes). @@ -220,7 +220,7 @@ void RuntimeHolder::CreateView( FXL_LOG(ERROR) << "Could not create an event pair."; return; } - mozart::ViewListenerPtr view_listener; + views_v1::ViewListenerPtr view_listener; view_listener_binding_.Bind(view_listener.NewRequest()); view_manager_->CreateView(view_.NewRequest(), // view std::move(view_owner_request), // view owner @@ -233,12 +233,12 @@ void RuntimeHolder::CreateView( // Listen for input events. ConnectToService(view_services.get(), input_connection_.NewRequest()); - mozart::InputListenerPtr input_listener; + input::InputListenerPtr input_listener; input_listener_binding_.Bind(input_listener.NewRequest()); input_connection_->SetEventListener(std::move(input_listener)); // Setup the session. - f1dl::InterfaceHandle scenic; + fidl::InterfaceHandle scenic; view_manager_->GetScenic(scenic.NewRequest()); blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ @@ -444,7 +444,7 @@ void RuntimeHolder::InitDartIoInternal() { } void RuntimeHolder::InitFuchsia() { - f1dl::InterfaceHandle environment; + fidl::InterfaceHandle environment; context_->ConnectToEnvironmentService(environment.NewRequest()); fuchsia::dart::Initialize(std::move(environment), std::move(outgoing_services_)); @@ -467,7 +467,7 @@ void RuntimeHolder::InitZircon() { } void RuntimeHolder::InitScenicInternal() { - f1dl::InterfaceHandle view_container; + fidl::InterfaceHandle view_container; view_->GetContainer(view_container.NewRequest()); Dart_Handle mozart_internal = @@ -509,7 +509,7 @@ void RuntimeHolder::InitRootBundle(std::vector bundle) { } } -mozart::View* RuntimeHolder::GetMozartView() { +views_v1::View* RuntimeHolder::GetMozartView() { return view_.get(); } @@ -558,13 +558,13 @@ bool RuntimeHolder::HandleFlutterPlatformMessage( clipboard_->Push(text); response->CompleteEmpty(); } else if (method->value == "Clipboard.getData") { - clipboard_->Peek([response](const ::f1dl::String& text) { + clipboard_->Peek([response](fidl::StringPtr text) { rapidjson::StringBuffer json_buffer; rapidjson::Writer writer(json_buffer); writer.StartArray(); writer.StartObject(); writer.Key("text"); - writer.String(text); + writer.String(text.get()); writer.EndObject(); writer.EndArray(); @@ -613,12 +613,10 @@ bool RuntimeHolder::HandleTextInputPlatformMessage( return false; // TODO(abarth): Read the keyboard type form the configuration. current_text_input_client_ = args->value[0].GetInt(); - mozart::TextInputStatePtr state = mozart::TextInputState::New(); - state->text = std::string(); - state->selection = mozart::TextSelection::New(); - state->composing = mozart::TextRange::New(); + input::TextInputState state; + state.text = std::string(); input_connection_->GetInputMethodEditor( - mozart::KeyboardType::TEXT, mozart::InputMethodAction::DONE, + input::KeyboardType::TEXT, input::InputMethodAction::DONE, std::move(state), text_input_binding_.NewBinding(), input_method_editor_.NewRequest()); } else if (method->value == "TextInput.setEditingState") { @@ -627,36 +625,34 @@ bool RuntimeHolder::HandleTextInputPlatformMessage( if (args_it == root.MemberEnd() || !args_it->value.IsObject()) return false; const auto& args = args_it->value; - mozart::TextInputStatePtr state = mozart::TextInputState::New(); - state->selection = mozart::TextSelection::New(); - state->composing = mozart::TextRange::New(); + input::TextInputState state; // TODO(abarth): Deserialize state. auto text = args.FindMember("text"); if (text != args.MemberEnd() && text->value.IsString()) - state->text = text->value.GetString(); + state.text = text->value.GetString(); auto selection_base = args.FindMember("selectionBase"); if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) - state->selection->base = selection_base->value.GetInt(); + state.selection.base = selection_base->value.GetInt(); auto selection_extent = args.FindMember("selectionExtent"); if (selection_extent != args.MemberEnd() && selection_extent->value.IsInt()) - state->selection->extent = selection_extent->value.GetInt(); + state.selection.extent = selection_extent->value.GetInt(); auto selection_affinity = args.FindMember("selectionAffinity"); if (selection_affinity != args.MemberEnd() && selection_affinity->value.IsString() && selection_affinity->value == "TextAffinity.upstream") - state->selection->affinity = mozart::TextAffinity::UPSTREAM; + state.selection.affinity = input::TextAffinity::UPSTREAM; else - state->selection->affinity = mozart::TextAffinity::DOWNSTREAM; + state.selection.affinity = input::TextAffinity::DOWNSTREAM; // We ignore selectionIsDirectional because that concept doesn't exist on // Fuchsia. auto composing_base = args.FindMember("composingBase"); if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) - state->composing->start = composing_base->value.GetInt(); + state.composing.start = composing_base->value.GetInt(); auto composing_extent = args.FindMember("composingExtent"); if (composing_extent != args.MemberEnd() && composing_extent->value.IsInt()) - state->composing->end = composing_extent->value.GetInt(); + state.composing.end = composing_extent->value.GetInt(); input_method_editor_->SetState(std::move(state)); } } else if (method->value == "TextInput.clearClient") { @@ -680,20 +676,20 @@ blink::UnzipperProvider RuntimeHolder::GetUnzipperProviderForRootBundle() { }; } -void RuntimeHolder::OnEvent(mozart::InputEventPtr event, - const OnEventCallback& callback) { +void RuntimeHolder::OnEvent(input::InputEvent event, + OnEventCallback callback) { bool handled = false; - if (event->is_pointer()) { - const mozart::PointerEventPtr& pointer = event->get_pointer(); + if (event.is_pointer()) { + const input::PointerEvent& pointer = event.pointer(); blink::PointerData pointer_data; - pointer_data.time_stamp = pointer->event_time / 1000; - pointer_data.change = GetChangeFromPointerEventPhase(pointer->phase); - pointer_data.kind = GetKindFromPointerType(pointer->type); - pointer_data.device = pointer->pointer_id; - pointer_data.physical_x = pointer->x * viewport_metrics_.device_pixel_ratio; - pointer_data.physical_y = pointer->y * viewport_metrics_.device_pixel_ratio; + pointer_data.time_stamp = pointer.event_time / 1000; + pointer_data.change = GetChangeFromPointerEventPhase(pointer.phase); + pointer_data.kind = GetKindFromPointerType(pointer.type); + pointer_data.device = pointer.pointer_id; + pointer_data.physical_x = pointer.x * viewport_metrics_.device_pixel_ratio; + pointer_data.physical_y = pointer.y * viewport_metrics_.device_pixel_ratio; // Buttons are single bit values starting with kMousePrimaryButton = 1. - pointer_data.buttons = static_cast(pointer->buttons); + pointer_data.buttons = static_cast(pointer.buttons); switch (pointer_data.change) { case blink::PointerData::Change::kDown: @@ -729,14 +725,14 @@ void RuntimeHolder::OnEvent(mozart::InputEventPtr event, runtime_->DispatchPointerDataPacket(packet); handled = true; - } else if (event->is_keyboard()) { - const mozart::KeyboardEventPtr& keyboard = event->get_keyboard(); + } else if (event.is_keyboard()) { + const input::KeyboardEvent& keyboard = event.keyboard(); const char* type = nullptr; - if (keyboard->phase == mozart::KeyboardEvent::Phase::PRESSED) + if (keyboard.phase == input::KeyboardEventPhase::PRESSED) type = "keydown"; - else if (keyboard->phase == mozart::KeyboardEvent::Phase::REPEAT) + else if (keyboard.phase == input::KeyboardEventPhase::REPEAT) type = "keydown"; // TODO change this to keyrepeat - else if (keyboard->phase == mozart::KeyboardEvent::Phase::RELEASED) + else if (keyboard.phase == input::KeyboardEventPhase::RELEASED) type = "keyup"; if (type) { @@ -746,9 +742,9 @@ void RuntimeHolder::OnEvent(mozart::InputEventPtr event, document.AddMember("type", rapidjson::Value(type, strlen(type)), allocator); document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); - document.AddMember("hidUsage", keyboard->hid_usage, allocator); - document.AddMember("codePoint", keyboard->code_point, allocator); - document.AddMember("modifiers", keyboard->modifiers, allocator); + document.AddMember("hidUsage", keyboard.hid_usage, allocator); + document.AddMember("codePoint", keyboard.code_point, allocator); + document.AddMember("modifiers", keyboard.modifiers, allocator); rapidjson::StringBuffer buffer; rapidjson::Writer writer(buffer); document.Accept(writer); @@ -766,26 +762,24 @@ void RuntimeHolder::OnEvent(mozart::InputEventPtr event, } void RuntimeHolder::OnPropertiesChanged( - mozart::ViewPropertiesPtr properties, - const OnPropertiesChangedCallback& callback) { - FXL_DCHECK(properties); - + views_v1::ViewProperties properties, + OnPropertiesChangedCallback callback) { // Attempt to read the device pixel ratio. float pixel_ratio = 1.f; - if (auto& metrics = properties->display_metrics) { + if (auto& metrics = properties.display_metrics) { pixel_ratio = metrics->device_pixel_ratio; } // Apply view property changes. - if (auto& layout = properties->view_layout) { - viewport_metrics_.physical_width = layout->size->width * pixel_ratio; - viewport_metrics_.physical_height = layout->size->height * pixel_ratio; - viewport_metrics_.physical_padding_top = layout->inset->top * pixel_ratio; + if (auto& layout = properties.view_layout) { + viewport_metrics_.physical_width = layout->size.width * pixel_ratio; + viewport_metrics_.physical_height = layout->size.height * pixel_ratio; + viewport_metrics_.physical_padding_top = layout->inset.top * pixel_ratio; viewport_metrics_.physical_padding_right = - layout->inset->right * pixel_ratio; + layout->inset.right * pixel_ratio; viewport_metrics_.physical_padding_bottom = - layout->inset->bottom * pixel_ratio; - viewport_metrics_.physical_padding_left = layout->inset->left * pixel_ratio; + layout->inset.bottom * pixel_ratio; + viewport_metrics_.physical_padding_left = layout->inset.left * pixel_ratio; viewport_metrics_.device_pixel_ratio = pixel_ratio; runtime_->SetViewportMetrics(viewport_metrics_); } @@ -795,31 +789,31 @@ void RuntimeHolder::OnPropertiesChanged( callback(); } -void RuntimeHolder::DidUpdateState(mozart::TextInputStatePtr state, - mozart::InputEventPtr event) { +void RuntimeHolder::DidUpdateState(input::TextInputState state, + input::InputEventPtr event) { rapidjson::Document document; auto& allocator = document.GetAllocator(); rapidjson::Value encoded_state(rapidjson::kObjectType); - encoded_state.AddMember("text", state->text.get(), allocator); - encoded_state.AddMember("selectionBase", state->selection->base, allocator); - encoded_state.AddMember("selectionExtent", state->selection->extent, + encoded_state.AddMember("text", state.text.get(), allocator); + encoded_state.AddMember("selectionBase", state.selection.base, allocator); + encoded_state.AddMember("selectionExtent", state.selection.extent, allocator); - switch (state->selection->affinity) { - case mozart::TextAffinity::UPSTREAM: + switch (state.selection.affinity) { + case input::TextAffinity::UPSTREAM: encoded_state.AddMember("selectionAffinity", rapidjson::Value("TextAffinity.upstream"), allocator); break; - case mozart::TextAffinity::DOWNSTREAM: + case input::TextAffinity::DOWNSTREAM: encoded_state.AddMember("selectionAffinity", rapidjson::Value("TextAffinity.downstream"), allocator); break; } encoded_state.AddMember("selectionIsDirectional", true, allocator); - encoded_state.AddMember("composingBase", state->composing->start, allocator); - encoded_state.AddMember("composingExtent", state->composing->end, allocator); + encoded_state.AddMember("composingBase", state.composing.start, allocator); + encoded_state.AddMember("composingExtent", state.composing.end, allocator); rapidjson::Value args(rapidjson::kArrayType); args.PushBack(current_text_input_client_, allocator); @@ -841,7 +835,7 @@ void RuntimeHolder::DidUpdateState(mozart::TextInputStatePtr state, nullptr)); } -void RuntimeHolder::OnAction(mozart::InputMethodAction action) { +void RuntimeHolder::OnAction(input::InputMethodAction action) { rapidjson::Document document; auto& allocator = document.GetAllocator(); diff --git a/content_handler/runtime_holder.h b/content_handler/runtime_holder.h index b22839a6ec17c..b9d55d9f9bacc 100644 --- a/content_handler/runtime_holder.h +++ b/content_handler/runtime_holder.h @@ -21,17 +21,17 @@ #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "lib/app/cpp/application_context.h" -#include "lib/app/fidl/application_environment.fidl.h" -#include "lib/app/fidl/service_provider.fidl.h" -#include "lib/clipboard/fidl/clipboard.fidl.h" -#include "lib/fidl/cpp/bindings/binding.h" +#include +#include +#include +#include "lib/fidl/cpp/binding.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" #include "lib/ui/flutter/sdk_ext/src/natives.h" -#include "lib/ui/input/fidl/input_connection.fidl.h" -#include "lib/ui/input/fidl/text_input.fidl.h" -#include "lib/ui/views/fidl/view_manager.fidl.h" +#include +#include +#include namespace flutter_runner { @@ -39,20 +39,20 @@ class Rasterizer; class RuntimeHolder : public blink::RuntimeDelegate, public mozart::NativesDelegate, - public mozart::ViewListener, - public mozart::InputListener, - public mozart::InputMethodEditorClient { + public views_v1::ViewListener, + public input::InputListener, + public input::InputMethodEditorClient { public: RuntimeHolder(); ~RuntimeHolder(); void Init(fdio_ns_t* namespc, std::unique_ptr context, - f1dl::InterfaceRequest outgoing_services, + fidl::InterfaceRequest outgoing_services, std::vector bundle); void CreateView(const std::string& script_uri, - f1dl::InterfaceRequest view_owner_request, - f1dl::InterfaceRequest services); + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services); Dart_Port GetUIIsolateMainPort(); std::string GetUIIsolateName(); @@ -73,21 +73,21 @@ class RuntimeHolder : public blink::RuntimeDelegate, void DidShutdownMainIsolate() override; // |mozart::NativesDelegate| implementation: - mozart::View* GetMozartView() override; + views_v1::View* GetMozartView() override; - // |mozart::InputListener| implementation: - void OnEvent(mozart::InputEventPtr event, - const OnEventCallback& callback) override; + // |input::InputListener| implementation: + void OnEvent(input::InputEvent event, + OnEventCallback callback) override; - // |mozart::ViewListener| implementation: + // |views_v1::ViewListener| implementation: void OnPropertiesChanged( - mozart::ViewPropertiesPtr properties, - const OnPropertiesChangedCallback& callback) override; + views_v1::ViewProperties properties, + OnPropertiesChangedCallback callback) override; - // |mozart::InputMethodEditorClient| implementation: - void DidUpdateState(mozart::TextInputStatePtr state, - mozart::InputEventPtr event) override; - void OnAction(mozart::InputMethodAction action) override; + // |input::InputMethodEditorClient| implementation: + void DidUpdateState(input::TextInputState state, + input::InputEventPtr event) override; + void OnAction(input::InputMethodAction action) override; fxl::WeakPtr GetWeakPtr(); @@ -112,7 +112,7 @@ class RuntimeHolder : public blink::RuntimeDelegate, fdio_ns_t* namespc_; int dirfd_; std::unique_ptr context_; - f1dl::InterfaceRequest outgoing_services_; + fidl::InterfaceRequest outgoing_services_; std::vector root_bundle_data_; // TODO(zarah): Remove asset_store_ when flx is completely removed fxl::RefPtr asset_store_; @@ -121,14 +121,14 @@ class RuntimeHolder : public blink::RuntimeDelegate, std::unique_ptr rasterizer_; std::unique_ptr runtime_; blink::ViewportMetrics viewport_metrics_; - mozart::ViewManagerPtr view_manager_; - f1dl::Binding view_listener_binding_; - f1dl::Binding input_listener_binding_; - mozart::InputConnectionPtr input_connection_; - mozart::ViewPtr view_; + views_v1::ViewManagerPtr view_manager_; + fidl::Binding view_listener_binding_; + fidl::Binding input_listener_binding_; + input::InputConnectionPtr input_connection_; + views_v1::ViewPtr view_; std::unordered_set down_pointers_; - mozart::InputMethodEditorPtr input_method_editor_; - f1dl::Binding text_input_binding_; + input::InputMethodEditorPtr input_method_editor_; + fidl::Binding text_input_binding_; int current_text_input_client_ = 0; fxl::TimePoint last_begin_frame_time_; bool frame_outstanding_ = false; diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index e003e92bd0842..b496ae37f40f2 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "flutter/content_handler/session_connection.h" +#include "lib/fidl/cpp/optional.h" #include "lib/ui/scenic/fidl_helpers.h" namespace flutter_runner { @@ -21,8 +22,8 @@ SessionConnection::SessionConnection(ui::ScenicPtr scenic, this, std::placeholders::_1)); root_node_.Bind(std::move(import_token)); - root_node_.SetEventMask(ui::gfx::kMetricsEventMask); - session_.Present(0, [](ui::PresentationInfoPtr info) {}); + root_node_.SetEventMask(gfx::kMetricsEventMask); + session_.Present(0, [](images::PresentationInfo info) {}); present_callback_ = std::bind(&SessionConnection::OnPresent, this, std::placeholders::_1); @@ -38,18 +39,18 @@ void SessionConnection::OnSessionError() { FXL_CHECK(false) << "Session connection was terminated."; } -void SessionConnection::OnSessionEvents(f1dl::Array events) { - ui::gfx::MetricsPtr new_metrics; - for (const auto& event : *events) { - if (event->is_gfx() && event->get_gfx()->is_metrics() && - event->get_gfx()->get_metrics()->node_id == root_node_.id()) { - new_metrics = std::move(event->get_gfx()->get_metrics()->metrics); +void SessionConnection::OnSessionEvents(fidl::VectorPtr events) { + gfx::Metrics* new_metrics; + for (auto& event : *events) { + if (event.is_gfx() && event.gfx().is_metrics() && + event.gfx().metrics().node_id == root_node_.id()) { + new_metrics = &event.gfx().metrics().metrics; } } if (!new_metrics) return; - scene_update_context_.set_metrics(std::move(new_metrics)); + scene_update_context_.set_metrics(fidl::MakeOptional(std::move(*new_metrics))); if (metrics_changed_callback_) metrics_changed_callback_(); @@ -80,7 +81,7 @@ void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, EnqueueClearCommands(); } -void SessionConnection::OnPresent(ui::PresentationInfoPtr info) { +void SessionConnection::OnPresent(images::PresentationInfo info) { ASSERT_IS_GPU_THREAD; auto callback = pending_on_present_callback_; pending_on_present_callback_ = nullptr; diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index 7af1f8cb6a034..a80ba3a2235d2 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -11,7 +11,7 @@ #include "flutter/content_handler/vulkan_surface_producer.h" #include "flutter/flow/compositor_context.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fidl/cpp/bindings/interface_handle.h" +#include "lib/fidl/cpp/interface_handle.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/ui/scenic/client/resources.h" @@ -27,7 +27,7 @@ class SessionConnection { bool has_metrics() const { return scene_update_context_.has_metrics(); } - const ui::gfx::MetricsPtr& metrics() const { + const gfx::MetricsPtr& metrics() const { return scene_update_context_.metrics(); } @@ -57,11 +57,11 @@ class SessionConnection { fxl::Closure metrics_changed_callback_; void OnSessionError(); - void OnSessionEvents(f1dl::Array events); + void OnSessionEvents(fidl::VectorPtr events); void EnqueueClearCommands(); - void OnPresent(ui::PresentationInfoPtr info); + void OnPresent(images::PresentationInfo info); FXL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); }; diff --git a/content_handler/vulkan_rasterizer.cc b/content_handler/vulkan_rasterizer.cc index 4394b8712d09d..25f90c460ce3f 100644 --- a/content_handler/vulkan_rasterizer.cc +++ b/content_handler/vulkan_rasterizer.cc @@ -53,7 +53,7 @@ bool VulkanRasterizer::IsValid() const { return valid_; } -void VulkanRasterizer::SetScene(f1dl::InterfaceHandle scenic, +void VulkanRasterizer::SetScene(fidl::InterfaceHandle scenic, zx::eventpair import_token, fxl::Closure metrics_changed_callback) { ASSERT_IS_GPU_THREAD; diff --git a/content_handler/vulkan_rasterizer.h b/content_handler/vulkan_rasterizer.h index 806bb66b7b3eb..c3ae211553f5a 100644 --- a/content_handler/vulkan_rasterizer.h +++ b/content_handler/vulkan_rasterizer.h @@ -22,7 +22,7 @@ class VulkanRasterizer : public Rasterizer { bool IsValid() const; - void SetScene(f1dl::InterfaceHandle scenic, + void SetScene(fidl::InterfaceHandle scenic, zx::eventpair import_token, fxl::Closure metrics_changed_callback) override; diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 9f7d7913a7200..0e5fa00d8422a 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -308,15 +308,15 @@ bool VulkanSurface::PushSessionImageSetupOps(scenic_lib::Session* session, } scenic_lib::Memory memory(session, std::move(exported_vmo), - ui::gfx::MemoryType::VK_DEVICE_MEMORY); - - auto image_info = ui::gfx::ImageInfo::New(); - image_info->width = sk_surface_->width(); - image_info->height = sk_surface_->height(); - image_info->stride = 4 * sk_surface_->width(); - image_info->pixel_format = ui::gfx::ImageInfo::PixelFormat::BGRA_8; - image_info->color_space = ui::gfx::ImageInfo::ColorSpace::SRGB; - image_info->tiling = ui::gfx::ImageInfo::Tiling::LINEAR; + images::MemoryType::VK_DEVICE_MEMORY); + + images::ImageInfo image_info; + image_info.width = sk_surface_->width(); + image_info.height = sk_surface_->height(); + image_info.stride = 4 * sk_surface_->width(); + image_info.pixel_format = images::PixelFormat::BGRA_8; + image_info.color_space = images::ColorSpace::SRGB; + image_info.tiling = images::Tiling::LINEAR; session_image_ = std::make_unique( memory, 0 /* memory offset */, std::move(image_info)); diff --git a/flow/BUILD.gn b/flow/BUILD.gn index 47c7316edfcd6..e6a6411a6c1da 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -83,7 +83,7 @@ source_set("flow") { "scene_update_context.h", ] - deps += [ + public_deps += [ "//garnet/public/lib/ui/scenic:client", "//garnet/public/lib/ui/scenic/fidl", "//topaz/public/dart-pkg/zircon", diff --git a/flow/export_node.cc b/flow/export_node.cc index b6ce18ba7c68d..a130c426a75bf 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -61,8 +61,8 @@ void ExportNode::Bind(SceneUpdateContext& context, container.AddChild(*node_); node_->SetTranslation(offset.x(), offset.y(), 0.f); node_->SetHitTestBehavior(hit_testable - ? ui::gfx::HitTestBehavior::kDefault - : ui::gfx::HitTestBehavior::kSuppress); + ? gfx::HitTestBehavior::kDefault + : gfx::HitTestBehavior::kSuppress); } } diff --git a/flow/layers/layer.h b/flow/layers/layer.h index 09b82dddb0265..d0ef1990ab4f2 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -45,7 +45,7 @@ class Layer { struct PrerollContext { #if defined(OS_FUCHSIA) - ui::gfx::Metrics* metrics = nullptr; + gfx::Metrics* metrics = nullptr; #endif RasterCache* raster_cache; GrContext* gr_context; diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index 9a52cb57d7f48..fde2fc4bf0866 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -19,7 +19,7 @@ LayerTree::~LayerTree() = default; void LayerTree::Raster(CompositorContext::ScopedFrame& frame, #if defined(OS_FUCHSIA) - ui::gfx::Metrics* metrics, + gfx::Metrics* metrics, #endif bool ignore_raster_cache) { #if defined(OS_FUCHSIA) @@ -35,7 +35,7 @@ void LayerTree::Raster(CompositorContext::ScopedFrame& frame, void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, #if defined(OS_FUCHSIA) - ui::gfx::Metrics* metrics, + gfx::Metrics* metrics, #endif bool ignore_raster_cache) { #if defined(OS_FUCHSIA) diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index a040180ad30a7..5ddebd088de9e 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -14,7 +14,7 @@ #include "lib/fxl/macros.h" #include "lib/fxl/time/time_delta.h" #if defined(OS_FUCHSIA) -#include "lib/ui/scenic/fidl/events.fidl.h" +#include #endif #include "third_party/skia/include/core/SkSize.h" @@ -29,13 +29,13 @@ class LayerTree { // Raster includes both Preroll and Paint. void Raster(CompositorContext::ScopedFrame& frame, #if defined(OS_FUCHSIA) - ui::gfx::Metrics* metrics, + gfx::Metrics* metrics, #endif bool ignore_raster_cache = false); void Preroll(CompositorContext::ScopedFrame& frame, #if defined(OS_FUCHSIA) - ui::gfx::Metrics* metrics, + gfx::Metrics* metrics, #endif bool ignore_raster_cache = false); diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 472dbd6bd9d94..aa9fad0e281de 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -74,7 +74,7 @@ RasterCacheResult RasterizePicture(SkPicture* picture, const MatrixDecomposition& matrix, SkColorSpace* dst_color_space, #if defined(OS_FUCHSIA) - ui::gfx::Metrics* metrics, + gfx::Metrics* metrics, #endif bool checkerboard) { TRACE_EVENT0("flutter", "RasterCachePopulate"); @@ -154,7 +154,7 @@ RasterCacheResult RasterCache::GetPrerolledImage( const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, #if defined(OS_FUCHSIA) - ui::gfx::Metrics* metrics, + gfx::Metrics* metrics, #endif bool is_complex, bool will_change) { diff --git a/flow/raster_cache.h b/flow/raster_cache.h index 3600866190204..31201049b6119 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -13,7 +13,7 @@ #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" #if defined(OS_FUCHSIA) -#include "lib/ui/scenic/fidl/events.fidl.h" +#include #endif #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -58,7 +58,7 @@ class RasterCache { const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, #if defined(OS_FUCHSIA) - ui::gfx::Metrics* metrics, + gfx::Metrics* metrics, #endif bool is_complex, bool will_change); diff --git a/flow/scene_update_context.h b/flow/scene_update_context.h index 32affd4ca0f77..ea1de247542ba 100644 --- a/flow/scene_update_context.h +++ b/flow/scene_update_context.h @@ -6,6 +6,7 @@ #define FLUTTER_FLOW_SCENE_UPDATE_CONTEXT_H_ #include +#include #include #include "flutter/flow/compositor_context.h" @@ -118,10 +119,10 @@ class SceneUpdateContext { scenic_lib::Session* session() { return session_; } bool has_metrics() const { return !!metrics_; } - void set_metrics(ui::gfx::MetricsPtr metrics) { + void set_metrics(gfx::MetricsPtr metrics) { metrics_ = std::move(metrics); } - const ui::gfx::MetricsPtr& metrics() const { return metrics_; } + const gfx::MetricsPtr& metrics() const { return metrics_; } void AddChildScene(ExportNode* export_node, SkPoint offset, @@ -181,7 +182,7 @@ class SceneUpdateContext { scenic_lib::Session* const session_; SurfaceProducer* const surface_producer_; - ui::gfx::MetricsPtr metrics_; + gfx::MetricsPtr metrics_; std::vector paint_tasks_; diff --git a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp b/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp index 9a8a08d336a31..446a2939dc64b 100644 --- a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp +++ b/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp @@ -13,7 +13,7 @@ #include "flutter/sky/engine/platform/fonts/AlternateFontFamily.h" #include "flutter/sky/engine/platform/fonts/FontCache.h" #include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "lib/fonts/fidl/font_provider.fidl.h" +#include #include "lib/fsl/vmo/sized_vmo.h" #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkData.h" @@ -65,14 +65,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { - if (!fsl::SizedVmo::IsSizeValid(vmo->vmo, vmo->size) || - vmo->size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransport& vmo) { + if (!fsl::SizedVmo::IsSizeValid(vmo.vmo, vmo.size) || + vmo.size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = vmo->size; + uint64_t size = vmo.size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, vmo->vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, vmo.vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -111,11 +111,11 @@ sk_sp FontCache::createTypeface( name = family.utf8(); } - auto request = fonts::FontRequest::New(); - request->family = name.data(); - request->weight = ToIntegerWeight(fontDescription.weight()); - request->width = static_cast(fontDescription.stretch()); - request->slant = ToFontSlant(fontDescription.style()); + fonts::FontRequest request; + request.family = name.data(); + request.weight = ToIntegerWeight(fontDescription.weight()); + request.width = static_cast(fontDescription.stretch()); + request.slant = ToFontSlant(fontDescription.style()); fonts::FontResponsePtr response; auto& font_provider = GetFontProvider(); @@ -132,7 +132,7 @@ sk_sp FontCache::createTypeface( if (!response) return nullptr; - sk_sp data = MakeSkDataFromVMO(response->data->vmo); + sk_sp data = MakeSkDataFromVMO(response->data.vmo); if (!data) return nullptr; diff --git a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h b/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h index 66f6448b06b43..fd11337f7d2b8 100644 --- a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h +++ b/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h @@ -5,7 +5,7 @@ #ifndef SKY_ENGINE_PLATFORM_FONTS_FUCHSIA_FONT_CACHE_FUCHSIA_H_ #define SKY_ENGINE_PLATFORM_FONTS_FUCHSIA_FONT_CACHE_FUCHSIA_H_ -#include "lib/fonts/fidl/font_provider.fidl.h" +#include namespace blink { From ec1e96864ac8649789e8b1074d344b26f777e755 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Fri, 30 Mar 2018 07:37:03 -0700 Subject: [PATCH 0031/1190] Revert pub roll from recent dart roll. (#4904) pub rolll causes https://github.com/dart-lang/pub/issues/1853. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 13821537a9ea3..01036fd1cec20 100644 --- a/DEPS +++ b/DEPS @@ -75,7 +75,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': 'bc2b5ff80e50b4b1c317230e8963c1fada3cfe73', + 'dart_pub_rev': '875d35005a7d33f367d70a3e31e9d3bad5d1ebd8', 'dart_pub_semver_tag': '1.3.2', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', From ca3d13f21853fa0cecb947ff6fb320ff148539df Mon Sep 17 00:00:00 2001 From: Ian McKellar Date: Fri, 30 Mar 2018 13:33:51 -0700 Subject: [PATCH 0032/1190] Roll Dart for FIDL2 (#4906) --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 01036fd1cec20..1b8e2865bd392 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '4da52281aa35b6c1951b3e269a6934412b15b105', + 'dart_revision': 'cdc696f9a71f2a6c2c3b3f4dad229a5981305149', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', From f85d21f552c8d79c9993138ccc5e82891223e292 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Fri, 30 Mar 2018 13:56:55 -0700 Subject: [PATCH 0033/1190] Revert "Roll Dart for FIDL2 (#4906)" (#4907) This reverts commit ca3d13f21853fa0cecb947ff6fb320ff148539df. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 1b8e2865bd392..01036fd1cec20 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'cdc696f9a71f2a6c2c3b3f4dad229a5981305149', + 'dart_revision': '4da52281aa35b6c1951b3e269a6934412b15b105', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', From c903c217a1a8206cdebdab1703b52ec6180edf37 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Fri, 30 Mar 2018 14:07:57 -0700 Subject: [PATCH 0034/1190] Roll dart to 52afcba357ad398e8c24f3e3363ac6ff5293df63 (#4905) * Roll to 59d859645ef0557bc7f8e2ee07957f506b755255 Changes since last roll: ``` 59d859645e [fasta] Do new/const insertion in simple cases 4c0a09b79f [vm-service] Add setFlag. bed5debbeb Callable object support in Analyzer and DDC. a1e4d8e0bf Don't do implicit new/const code generation with --preview-dart-2 enabled. 49558b9c4c Fixed MessageChannel receiveing messages on ports. Removed pkg browser from tests. e150bf638c Fix tests for missing required SDK libraries on Windows. b970d834e1 Update type_representation_test to test strong mode types 85d5812a93 Port type_representation_test to work with kernel 8504808ce3 Remove Dart 2 errors in package:js_ast a6a2152482 Add runtime type representation for void 477a773cdb [fidl] Port Dart runtime to FIDL2. d46dd1bd68 fix error message for dcalls on null af22f6a591 Track calls to 'pub get' from analysis_server 8d689fcca7 step 4 of ??: add omit-implicit-checks and preview-dart-2 flags, strong-mode defaults to include implicit checks. f201ace7f3 Check for missing required libraries dart:core and dart:async. d53291d156 Fix MockErrorCode after adding isUnresolvedIdentifier. b05ba71b0c [VM runtime] Minor clean up of type test with non-function type object. ce1d52481c Don't remove unused imports when there are unresolved symbols. ad9afa1656 Add the isUnresolvedIdentifier flag for ErrorCode. 14806df576 Make correction parameter optional named in ErrorCode and subclasses. 98f627f989 Issue 32708. Make GenericFunctionTypeElementForLink implement GenericFunctionTypeElementImpl. 3306aabd82 Fix for type inference from instance creation arguments. 055dfad887 Fix the test to determine whether a library is in the SDK 506ac7f953 Rework linker type inference using ExprBuilder. 494b861d00 Further prep work for #32525. 7d90df42f1 [Kernel, VM runtime] Hook up bool checks in strong mode (fixes #32336). Update kernel status file. ``` * Update license hash. No changes to licenses. * Roll to pick up SIGTTOU fix. * Update license hash. No changes to licenses --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 01036fd1cec20..951273676b8d7 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '4da52281aa35b6c1951b3e269a6934412b15b105', + 'dart_revision': '52afcba357ad398e8c24f3e3363ac6ff5293df63', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7e6fc0fbaacb6..29afc9b045284 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 240f392a30cdf33f0ddff5fc2cf9241b +Signature: 391179c630438133ec3f2d4060984728 UNUSED LICENSES: From 924b111cea817a629e057bff49df2189be3b08bc Mon Sep 17 00:00:00 2001 From: Alan Russian Date: Fri, 30 Mar 2018 19:03:49 -0700 Subject: [PATCH 0035/1190] Add CallSuper annotation to onCreate(). (#4789) This provides improved code inspection, making it easier for developers to figure out what might be going wrong if they override this and don't call super, like I just did. :-) --- shell/platform/android/io/flutter/app/FlutterApplication.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/platform/android/io/flutter/app/FlutterApplication.java b/shell/platform/android/io/flutter/app/FlutterApplication.java index 0651eb616ea4e..d25d68eda35f9 100644 --- a/shell/platform/android/io/flutter/app/FlutterApplication.java +++ b/shell/platform/android/io/flutter/app/FlutterApplication.java @@ -6,6 +6,7 @@ import android.app.Activity; import android.app.Application; +import android.support.annotation.CallSuper; import io.flutter.view.FlutterMain; @@ -15,6 +16,7 @@ */ public class FlutterApplication extends Application { @Override + @CallSuper public void onCreate() { super.onCreate(); FlutterMain.startInitialization(this); From 4a347699e7bdd7cf48291c2bfef65bacbacea1e4 Mon Sep 17 00:00:00 2001 From: "P.Y. Laligand" Date: Fri, 30 Mar 2018 19:27:15 -0700 Subject: [PATCH 0036/1190] [fuchsia] Use the dart_library template instead of the build system's implementation. (#4908) --- lib/snapshot/BUILD.gn | 42 ++++++++++----------------------------- lib/snapshot/pubspec.yaml | 5 +++++ 2 files changed, 16 insertions(+), 31 deletions(-) create mode 100644 lib/snapshot/pubspec.yaml diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 03b23a58ae99e..3aebf855123a2 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -7,6 +7,7 @@ import("//third_party/dart/utils/compile_platform.gni") import("//third_party/dart/utils/generate_entry_points_json.gni") if (is_fuchsia) { + import("//build/dart/dart_library.gni") import("//build/dart/toolchain.gni") import("//topaz/public/dart-pkg/fuchsia/sdk_ext.gni") import("//topaz/public/dart-pkg/zircon/sdk_ext.gni") @@ -24,39 +25,18 @@ copy("generate_dart_ui") { } if (is_fuchsia) { - action("generate_package_map") { - dart_deps = [ - "//topaz/public/dart/fuchsia", - "//topaz/public/dart/zircon", - ] + dart_library("generate_package_map") { + # The sole purpose of this target is to generate a .packages file. + sources = [] - dot_packages_file = "$target_gen_dir/snapshot.packages" - outputs = [ - dot_packages_file - ] - deps = [] - foreach(dep, dart_deps) { - deps += [ "$dep($dart_toolchain)" ] - } + infer_package_name = true - depfile = "$dot_packages_file.d" + disable_analysis = true - script = "//build/dart/gen_dot_packages.py" - args = [ - "--out", - rebase_path(dot_packages_file, root_build_dir), - "--source-dir", - rebase_path("."), - "--root-build-dir", - rebase_path(root_build_dir), - "--root-gen-dir", - rebase_path(dart_root_gen_dir), - "--package-name", - "snapshot_root", - "--depfile", - rebase_path(depfile), - "--deps", - ] + dart_deps + deps = [ + "//topaz/public/dart/fuchsia", + "//topaz/public/dart/zircon", + ] } } @@ -157,7 +137,7 @@ action("generate_snapshot_bin") { "--url_mapping=dart:fuchsia,$fuchsia_path", "--url_mapping=dart:mozart.internal,$mozart_internal_path", "--packages", - rebase_path("$target_gen_dir/snapshot.packages"), + rebase_path("$target_gen_dir/generate_package_map.packages"), "--load_compilation_trace", rebase_path("fuchsia_compilation_trace.txt"), ] diff --git a/lib/snapshot/pubspec.yaml b/lib/snapshot/pubspec.yaml new file mode 100644 index 0000000000000..1b1139ebc4c3d --- /dev/null +++ b/lib/snapshot/pubspec.yaml @@ -0,0 +1,5 @@ +# 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. + +# This file is needed by Fuchsia's dart_library template. From f6905f575a8e3bcfd2000291e88d3145448bb699 Mon Sep 17 00:00:00 2001 From: "P.Y. Laligand" Date: Fri, 30 Mar 2018 21:08:47 -0700 Subject: [PATCH 0037/1190] [fuchsia] Look for .packages under the proper directory. (#4909) --- lib/snapshot/BUILD.gn | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 3aebf855123a2..2b53ffc4d4f6d 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -128,7 +128,10 @@ action("generate_snapshot_bin") { } if (is_fuchsia) { - inputs += zircon_sdk_ext_files + mozart_dart_sdk_ext_files + package_gen_dir = get_label_info(":bogus($dart_toolchain)", + "target_gen_dir") + package_file = "$package_gen_dir/generate_package_map.packages" + inputs += zircon_sdk_ext_files + mozart_dart_sdk_ext_files + [package_file] zircon_path = rebase_path(zircon_sdk_ext_lib) fuchsia_path = rebase_path(fuchsia_sdk_ext_lib) mozart_internal_path = rebase_path(mozart_dart_sdk_ext_lib) @@ -137,7 +140,7 @@ action("generate_snapshot_bin") { "--url_mapping=dart:fuchsia,$fuchsia_path", "--url_mapping=dart:mozart.internal,$mozart_internal_path", "--packages", - rebase_path("$target_gen_dir/generate_package_map.packages"), + rebase_path(package_file), "--load_compilation_trace", rebase_path("fuchsia_compilation_trace.txt"), ] From d653be87f982826227ec2c49ccd680ee93928e7d Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 31 Mar 2018 16:12:08 -0400 Subject: [PATCH 0038/1190] Roll ../src/third_party/skia/ abf7b763e..b33feaca1 (173 commits) (#4911) https://skia.googlesource.com/skia.git/+log/abf7b763e2c1..b33feaca1caa $ git log abf7b763e..b33feaca1 --date=short --no-merges --format='%ad %ae %s' 2018-03-31 update-docs Update markdown files 2018-03-31 angle-skia-autoroll Roll skia/third_party/externals/angle2/ b33972d4a..d104918fd (1 commit) 2018-03-30 kjlubick Add Encoder fuzzers 2018-03-30 robertphillips Add SkSurface factory that takes an SkSurfaceCharacterization 2018-03-30 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ a8bceef13..a0790e0c9 (2 commits) 2018-03-30 csmartdalton Revert "Delete GPU alpha clip masks" 2018-03-30 mtklein Revert "allow timing in release-with-assert builds" 2018-03-30 angle-skia-autoroll Roll skia/third_party/externals/angle2/ b1de5a7e6..b33972d4a (1 commit) 2018-03-30 mtklein allow timing in release-with-assert builds 2018-03-30 phosek Disable GPU support by default when building for host in Fuchsia 2018-03-30 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ d8ece14aa..a8bceef13 (1 commit) 2018-03-30 angle-skia-autoroll Roll skia/third_party/externals/angle2/ 5cf4d06cd..b1de5a7e6 (2 commits) 2018-03-29 csmartdalton Revert "vulkan: Blacklist MSAA path renderer on Qualcomm drivers" 2018-03-29 angle-skia-autoroll Roll skia/third_party/externals/angle2/ 96310cdad..5cf4d06cd (5 commits) 2018-03-29 robertphillips Add SK_API to GrContextThreadSafeProxy 2018-03-29 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ ffeadc2cb..d8ece14aa (1 commit) 2018-03-28 halcanary SkPDF/Clusterator: expose to the light of a unit test 2018-03-29 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 11231dcb6..ffeadc2cb (1 commit) 2018-03-29 metzman Add libFuzzer style fuzzer for NullGLCanvas for use on OSS-Fuzz. 2018-03-29 robertphillips Fix up .fp files 2018-03-29 csmartdalton vulkan: Blacklist MSAA path renderer on Qualcomm drivers 2018-03-29 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 193fc66b4..11231dcb6 (3 commits) 2018-03-29 halcanary SkAdvancedTypefaceMetrics: distinguish between font names 2018-03-29 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 115e2853e..193fc66b4 (1 commit) 2018-03-29 jvanverth Snap non-scaled emoji to pixel borders 2018-03-29 djsollen Dump additional details about the gpu resources. 2018-03-29 halcanary SkPDF: type3: more descriptor values 2018-03-29 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 3f0009288..115e2853e (2 commits) 2018-03-29 bungeman Remove path ranges from gpu. 2018-03-28 halcanary SkDynamicMemoryWStream: clean up, asserts, etc. 2018-03-28 senorblanco Reland "GrTessellator: hang fix." 2018-03-29 angle-skia-autoroll Roll skia/third_party/externals/angle2/ a3b220f36..96310cdad (1 commit) 2018-03-29 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 5678b9d6a..3f0009288 (1 commit) 2018-03-28 kdonev Fixing build with SK_IGNORE_TO_STRING defined. 2018-03-28 ethannicholas fixed type mismatches in SkSL comparison operators 2018-03-28 csmartdalton Don't use gl_FragCoord on legacy Tegra hardware 2018-03-29 mtklein Revert "GrTessellator: hang fix." 2018-03-29 angle-skia-autoroll Roll skia/third_party/externals/angle2/ 78c5eb2ab..a3b220f36 (7 commits) 2018-03-28 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ ed6a9bd48..5678b9d6a (1 commit) 2018-03-28 liyuqian Update trans limit after zoom changes in viewer 2018-03-14 rmistry Whitespace change 2018-02-15 bungeman Add color fonts. 2018-03-28 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 59fdb4e14..ed6a9bd48 (2 commits) 2018-03-28 senorblanco GrTessellator: hang fix. 2018-03-28 robertphillips Add new GrResourceCache::purgeUnlockedResources variant 2018-03-28 bungeman Check that paint is not null in OveridePaintFilterCanvas. 2018-03-27 robertphillips Remove old method of drawing DDL SKPs from DM (in favor of ViaDDL method) 2018-03-28 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 680ab5a31..59fdb4e14 (3 commits) 2018-03-28 angle-skia-autoroll Roll skia/third_party/externals/angle2/ c7575da54..78c5eb2ab (1 commit) 2018-03-28 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ fc0d0c4c7..680ab5a31 (1 commit) 2018-03-27 bungeman Roll FreeType. 2018-03-27 halcanary SkPDF: Accept non-monotonic text cluster indices 2018-03-27 csmartdalton Delete GPU alpha clip masks 2018-03-28 jvanverth Rename SkInsetConvexPolygon to SkOffsetPolygon. 2018-03-27 robertphillips Add handling for allocation failure in GrTextureOpList 2018-03-28 angle-skia-autoroll Roll skia/third_party/externals/angle2/ e858cb1db..c7575da54 (1 commit) 2018-03-27 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 80ac04dc4..fc0d0c4c7 (1 commit) 2018-03-27 angle-skia-autoroll Roll skia/third_party/externals/angle2/ 15c7d0a64..e858cb1db (12 commits) 2018-03-27 herb Various cleanup to remote_demo 2018-03-27 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 6793c6ab0..80ac04dc4 (2 commits) 2018-03-27 robertphillips Reland "Switch bots to use ViaDDL (i.e., ddl-gl) instead of old --ddl flag" 2018-03-27 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ aa8c0f3d2..6793c6ab0 (1 commit) 2018-03-27 ethannicholas initial SkSLJIT checkin 2018-03-27 bungeman Revert "Add color fonts." 2018-03-27 mtklein exclude SkColorSpaceXform_skcms.cpp from Google3 2018-03-27 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 07da72a48..aa8c0f3d2 (1 commit) 2018-02-15 bungeman Add color fonts. 2018-03-27 bungeman Remove include/svg from public.bzl includes. 2018-03-27 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 7e5292bb2..07da72a48 (1 commit) 2018-03-27 brianosman Remove duplicate entry for SkTDPQueue.h in gni 2018-03-27 mtklein cache SkMatrix44 type in makeColorSpin() 2018-03-27 robertphillips Fix flushing of context in ViaDDL 2018-03-26 csmartdalton ccpr: Various cleanups 2018-03-27 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 286108ae1..7e5292bb2 (1 commit) 2018-03-27 brianosman Pin color type when a cross-context image is constructed 2018-03-26 benjaminwagner Update doc for connecting to GCE bots. 2018-03-27 robertphillips Fix TSAN race in SkPaintToGrPaintNoShader 2018-03-27 robertphillips Revert "Switch bots to use ViaDDL (i.e., ddl-gl) instead of old --ddl flag" 2018-03-27 angle-skia-autoroll Roll skia/third_party/externals/angle2/ 84fdc62c6..15c7d0a64 (1 commit) 2018-03-20 kdonev Fixed warnings for casting large type to smaller one. 2018-03-27 robertphillips Switch bots to use ViaDDL (i.e., ddl-gl) instead of old --ddl flag 2018-03-26 brianosman Add SkColorSpaceXform_skcms 2018-03-27 liyuqian Reland "Use DAA for small cubics and non-convex paths that fit into a mask" 2018-03-27 robertphillips Switch DDL rendering to be a Via in DM (take 2) 2018-03-23 herb Remove SkAutoGlyphCache 2018-03-27 angle-skia-autoroll Roll skia/third_party/externals/angle2/ a571f28d4..84fdc62c6 (6 commits) 2018-03-26 benjaminwagner [Bazel] Add missing include dir. 2018-03-26 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ db50cadbb..286108ae1 (1 commit) 2018-03-21 csmartdalton ccpr: Use Manhattan distance for curve AA 2018-03-26 benjaminwagner External part of internal cl/190527962 2018-03-26 bungeman Remove src/xml/*.h from DM in public.bzl. 2018-03-21 herb Move cache difference code into remote cache files 2018-03-26 herb Cleanup SkAutoGlyphCache in SkXPSDevice. 2018-03-26 robertphillips Revert "Switch DDL rendering to be a Via in DM" 2018-03-26 robertphillips Switch DDL rendering to be a Via in DM 2018-03-21 csmartdalton ccpr: Replace curve corner MSAA with analytic attenuation 2018-03-26 bungeman Add the xml and svg model code to DM in public.bzl. 2018-03-26 ethannicholas added frexp support to SkSL 2018-03-26 robertphillips Remove copy of TableColorFilter data when GPU rendering 2018-03-26 mtklein specialize arm64 allTrue()/anyTrue() (...) Created with: roll-dep ../src/third_party/skia --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 96 +++++++++++++++------ 2 files changed, 72 insertions(+), 26 deletions(-) diff --git a/DEPS b/DEPS index 951273676b8d7..5da543fa95310 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'abf7b763e2c1ba069942dedec914494817fd27a8', + 'skia_revision': 'b33feaca1caa965677d92ad7d4d37dda1367fb88', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 29afc9b045284..bf9c54da2d6cf 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 391179c630438133ec3f2d4060984728 +Signature: 0bcdb05515ca500aaa3f1a8349501cf4 UNUSED LICENSES: @@ -4455,13 +4455,13 @@ FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/type_argume FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unknown_ref.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_view.dart FILE: ../../../third_party/dart/runtime/observatory/lib/tracer.dart +FILE: ../../../third_party/dart/runtime/platform/atomic.h +FILE: ../../../third_party/dart/runtime/platform/atomic_android.h +FILE: ../../../third_party/dart/runtime/platform/atomic_linux.h +FILE: ../../../third_party/dart/runtime/platform/atomic_macos.h +FILE: ../../../third_party/dart/runtime/platform/atomic_win.h FILE: ../../../third_party/dart/runtime/platform/signal_blocker.h FILE: ../../../third_party/dart/runtime/vm/allocation.h -FILE: ../../../third_party/dart/runtime/vm/atomic.h -FILE: ../../../third_party/dart/runtime/vm/atomic_android.h -FILE: ../../../third_party/dart/runtime/vm/atomic_linux.h -FILE: ../../../third_party/dart/runtime/vm/atomic_macos.h -FILE: ../../../third_party/dart/runtime/vm/atomic_win.h FILE: ../../../third_party/dart/runtime/vm/class_finalizer.cc FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm.cc FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm_test.cc @@ -5755,9 +5755,9 @@ FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/target. FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/top_retaining_instances.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/type_arguments.dart FILE: ../../../third_party/dart/runtime/observatory/web/timeline_message_handler.js +FILE: ../../../third_party/dart/runtime/platform/atomic_fuchsia.h FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.cc FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.h -FILE: ../../../third_party/dart/runtime/vm/atomic_fuchsia.h FILE: ../../../third_party/dart/runtime/vm/become.cc FILE: ../../../third_party/dart/runtime/vm/become.h FILE: ../../../third_party/dart/runtime/vm/clustered_snapshot.cc @@ -17727,6 +17727,7 @@ FILE: ../../../third_party/skia/infra/bots/assets/go/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_debug/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_release/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_sdk/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/node/VERSION FILE: ../../../third_party/skia/infra/bots/assets/procdump_win/VERSION FILE: ../../../third_party/skia/infra/bots/assets/protoc/VERSION FILE: ../../../third_party/skia/infra/bots/assets/skimage/VERSION @@ -17816,7 +17817,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Ubuntu14-GCC-GCE-CPU-AVX2-x86_64-Release-All-CT_BENCH_1k_SKPs.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Ubuntu14-Clang-GCE-CPU-AVX2-x86_64-Release-All-CT_BENCH_1k_SKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json @@ -17932,10 +17933,9 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Cl FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x86_64-Release.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-arm64-Release-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug-Exceptions.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Debug-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Release-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-MSVC-x86-Debug-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-MSVC-x86-Debug.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-MSVC-x86-Release-GDI.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/alternate_repo.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/flutter_trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/pdfium_trybot.json @@ -18058,7 +18058,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clan FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FAAA.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FDAA.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FSAA.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win8-MSVC-Golo-CPU-AVX-x86-Debug-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win8-Clang-Golo-CPU-AVX-x86-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-iOS-Clang-iPadPro-GPU-GT7800-arm64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_dm.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_get_hashes.json @@ -18179,6 +18179,7 @@ FILE: ../../../third_party/skia/src/core/SkOrderedReadBuffer.h FILE: ../../../third_party/skia/src/sksl/lex/layout.lex FILE: ../../../third_party/skia/src/sksl/lex/sksl.lex FILE: ../../../third_party/skia/src/sksl/sksl.inc +FILE: ../../../third_party/skia/src/sksl/sksl_cpu.inc FILE: ../../../third_party/skia/src/sksl/sksl_fp.inc FILE: ../../../third_party/skia/src/sksl/sksl_frag.inc FILE: ../../../third_party/skia/src/sksl/sksl_geom.inc @@ -18436,7 +18437,6 @@ FILE: ../../../third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp FILE: ../../../third_party/skia/src/effects/SkTableMaskFilter.cpp FILE: ../../../third_party/skia/src/gpu/GrContext.cpp FILE: ../../../third_party/skia/src/gpu/GrGpu.h -FILE: ../../../third_party/skia/src/gpu/GrGpuFactory.cpp FILE: ../../../third_party/skia/src/gpu/GrGpuResource.cpp FILE: ../../../third_party/skia/src/gpu/GrPaint.h FILE: ../../../third_party/skia/src/gpu/GrPathRenderer.cpp @@ -18688,8 +18688,6 @@ FILE: ../../../third_party/skia/src/gpu/GrFragmentProcessor.h FILE: ../../../third_party/skia/src/gpu/GrGpuResourceCacheAccess.h FILE: ../../../third_party/skia/src/gpu/GrGpuResourceRef.cpp FILE: ../../../third_party/skia/src/gpu/GrGpuResourceRef.h -FILE: ../../../third_party/skia/src/gpu/GrPathRange.cpp -FILE: ../../../third_party/skia/src/gpu/GrPathRange.h FILE: ../../../third_party/skia/src/gpu/GrPathRendering.cpp FILE: ../../../third_party/skia/src/gpu/GrPathRendering.h FILE: ../../../third_party/skia/src/gpu/GrPendingProgramElement.h @@ -18725,8 +18723,6 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrPorterDuffXferProcessor.h FILE: ../../../third_party/skia/src/gpu/effects/GrRRectEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrRRectEffect.h FILE: ../../../third_party/skia/src/gpu/gl/GrGLAssembleInterface.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLPathRange.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLPathRange.h FILE: ../../../third_party/skia/src/gpu/gl/GrGLPathRendering.cpp FILE: ../../../third_party/skia/src/gpu/gl/GrGLPathRendering.h FILE: ../../../third_party/skia/src/gpu/gl/GrGLTextureRenderTarget.h @@ -19293,7 +19289,6 @@ FILE: ../../../third_party/skia/src/gpu/GrDrawOpTest.h FILE: ../../../third_party/skia/src/gpu/GrDrawingManager.cpp FILE: ../../../third_party/skia/src/gpu/GrDrawingManager.h FILE: ../../../third_party/skia/src/gpu/GrFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/GrGpuFactory.h FILE: ../../../third_party/skia/src/gpu/GrGpuResourcePriv.h FILE: ../../../third_party/skia/src/gpu/GrMesh.h FILE: ../../../third_party/skia/src/gpu/GrNonAtomicRef.h @@ -19750,8 +19745,8 @@ FILE: ../../../third_party/skia/experimental/skottie/Skottie.cpp FILE: ../../../third_party/skia/experimental/skottie/Skottie.h FILE: ../../../third_party/skia/experimental/skottie/SkottieAnimator.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAnimator.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieProperties.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieProperties.h +FILE: ../../../third_party/skia/experimental/skottie/SkottieValue.cpp +FILE: ../../../third_party/skia/experimental/skottie/SkottieValue.h FILE: ../../../third_party/skia/experimental/sksg/SkSGDraw.cpp FILE: ../../../third_party/skia/experimental/sksg/SkSGDraw.h FILE: ../../../third_party/skia/experimental/sksg/SkSGEffectNode.cpp @@ -19850,6 +19845,7 @@ FILE: ../../../third_party/skia/include/gpu/mock/GrMockTypes.h FILE: ../../../third_party/skia/include/gpu/mtl/GrMtlTypes.h FILE: ../../../third_party/skia/include/private/GrSharedEnums.h FILE: ../../../third_party/skia/include/private/SkDeferredDisplayList.h +FILE: ../../../third_party/skia/include/private/SkImageInfoPriv.h FILE: ../../../third_party/skia/include/private/SkMalloc.h FILE: ../../../third_party/skia/include/private/SkShadowFlags.h FILE: ../../../third_party/skia/include/utils/SkShadowUtils.h @@ -19899,7 +19895,6 @@ FILE: ../../../third_party/skia/src/core/SkFontMgrPriv.h FILE: ../../../third_party/skia/src/core/SkGaussFilter.cpp FILE: ../../../third_party/skia/src/core/SkGaussFilter.h FILE: ../../../third_party/skia/src/core/SkImageFilterPriv.h -FILE: ../../../third_party/skia/src/core/SkImageInfoPriv.h FILE: ../../../third_party/skia/src/core/SkMaskBlurFilter.cpp FILE: ../../../third_party/skia/src/core/SkMaskBlurFilter.h FILE: ../../../third_party/skia/src/core/SkRasterClipStack.h @@ -20064,10 +20059,10 @@ FILE: ../../../third_party/skia/src/sksl/lex/RegexParser.h FILE: ../../../third_party/skia/src/sksl/sksl_enums.inc FILE: ../../../third_party/skia/src/utils/SkFloatToDecimal.cpp FILE: ../../../third_party/skia/src/utils/SkFloatToDecimal.h -FILE: ../../../third_party/skia/src/utils/SkInsetConvexPolygon.cpp -FILE: ../../../third_party/skia/src/utils/SkInsetConvexPolygon.h FILE: ../../../third_party/skia/src/utils/SkJSONWriter.cpp FILE: ../../../third_party/skia/src/utils/SkJSONWriter.h +FILE: ../../../third_party/skia/src/utils/SkOffsetPolygon.cpp +FILE: ../../../third_party/skia/src/utils/SkOffsetPolygon.h FILE: ../../../third_party/skia/src/utils/SkShadowTessellator.cpp FILE: ../../../third_party/skia/src/utils/SkShadowTessellator.h FILE: ../../../third_party/skia/src/utils/SkShadowUtils.cpp @@ -20166,8 +20161,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp +FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.h FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.cpp @@ -20197,6 +20194,7 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionSetPath.cpp FILE: ../../../third_party/skia/gm/hugepath.cpp FILE: ../../../third_party/skia/gm/makeRasterImage.cpp FILE: ../../../third_party/skia/gm/orientation.cpp +FILE: ../../../third_party/skia/gm/pathmeasure.cpp FILE: ../../../third_party/skia/gm/scaledemoji.cpp FILE: ../../../third_party/skia/gm/shadermaskfilter.cpp FILE: ../../../third_party/skia/gm/sharedcorners.cpp @@ -20213,6 +20211,7 @@ FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp FILE: ../../../third_party/skia/src/core/SkBlurPriv.h FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_skcms.cpp FILE: ../../../third_party/skia/src/core/SkCoverageModePriv.h FILE: ../../../third_party/skia/src/core/SkCubicMap.cpp FILE: ../../../third_party/skia/src/core/SkCubicMap.h @@ -20288,6 +20287,14 @@ FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp FILE: ../../../third_party/skia/src/opts/SkRasterPipeline_opts.h +FILE: ../../../third_party/skia/src/pdf/SkClusterator.cpp +FILE: ../../../third_party/skia/src/pdf/SkClusterator.h +FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.h +FILE: ../../../third_party/skia/src/sksl/SkSLJIT.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLJIT.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp ---------------------------------------------------------------------------------------------------- Copyright 2018 Google Inc. @@ -20353,6 +20360,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/fuzz/FuzzEncoders.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/fuzz/FuzzEncoders.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2018 Google LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/fuzz/oss_fuzz/FuzzAPIImageFilter.cpp + ../../../third_party/skia/LICENSE @@ -20363,10 +20405,14 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzAnimatedImage.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzDrawFunctions.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzGradients.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImage.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJPEGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullGLCanvas.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp ---------------------------------------------------------------------------------------------------- Copyright 2018 Google, LLC @@ -22353,4 +22399,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 319 +Total license count: 320 From 1f8ce953c636df59ef4c54aa2c1fb90a422d10b7 Mon Sep 17 00:00:00 2001 From: Luigi Rosso Date: Sat, 31 Mar 2018 20:01:40 -0700 Subject: [PATCH 0039/1190] Allow setting transform on radial gradients. (#4916) --- lib/ui/painting.dart | 11 +++++++++-- lib/ui/painting/gradient.cc | 11 +++++++++-- lib/ui/painting/gradient.h | 5 ++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 9ee3ef39a2597..7d39b1b717bf1 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1921,23 +1921,30 @@ class Gradient extends Shader { /// If `center`, `radius`, `colors`, or `tileMode` are null, or if `colors` or /// `colorStops` contain null values, this constructor will throw a /// [NoSuchMethodError]. + /// + /// If `matrix4` is provided, the gradient fill will be transformed by the + /// specified 4x4 matrix relative to the local coordinate system. `matrix4` must + /// be a column-major matrix packed into a list of 16 values. Gradient.radial( Offset center, double radius, List colors, [ List colorStops, TileMode tileMode = TileMode.clamp, + Float64List matrix4 ]) : assert(_offsetIsValid(center)), assert(colors != null), assert(tileMode != null), super._() { + if (matrix4 != null && matrix4.length != 16) + throw new ArgumentError('"matrix4" must have 16 entries.'); _validateColorStops(colors, colorStops); final Int32List colorsBuffer = _encodeColorList(colors); final Float32List colorStopsBuffer = colorStops == null ? null : new Float32List.fromList(colorStops); _constructor(); - _initRadial(center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index); + _initRadial(center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); } - void _initRadial(double centerX, double centerY, double radius, Int32List colors, Float32List colorStops, int tileMode) native 'Gradient_initRadial'; + void _initRadial(double centerX, double centerY, double radius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initRadial'; static void _validateColorStops(List colors, List colorStops) { if (colorStops == null) { diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 7035df81b6804..f6bb864627740 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -59,17 +59,24 @@ void CanvasGradient::initRadial(double center_x, double radius, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode) { + SkShader::TileMode tile_mode, + const tonic::Float64List& matrix4) { FXL_DCHECK(colors.num_elements() == color_stops.num_elements() || color_stops.data() == nullptr); static_assert(sizeof(SkColor) == sizeof(int32_t), "SkColor doesn't use int32_t."); + SkMatrix sk_matrix; + bool has_matrix = matrix4.data() != nullptr; + if (has_matrix) { + sk_matrix = ToSkMatrix(matrix4); + } + set_shader(SkGradientShader::MakeRadial( SkPoint::Make(center_x, center_y), radius, reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode)); + colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr)); } CanvasGradient::CanvasGradient() : Shader(nullptr) {} diff --git a/lib/ui/painting/gradient.h b/lib/ui/painting/gradient.h index 94a55a57acc25..5f0580b178648 100644 --- a/lib/ui/painting/gradient.h +++ b/lib/ui/painting/gradient.h @@ -5,9 +5,11 @@ #ifndef FLUTTER_LIB_UI_PAINTING_GRADIENT_H_ #define FLUTTER_LIB_UI_PAINTING_GRADIENT_H_ +#include "flutter/lib/ui/painting/matrix.h" #include "flutter/lib/ui/painting/shader.h" #include "lib/tonic/dart_wrappable.h" #include "lib/tonic/typed_data/float32_list.h" +#include "lib/tonic/typed_data/float64_list.h" #include "lib/tonic/typed_data/int32_list.h" #include "third_party/skia/include/effects/SkGradientShader.h" @@ -38,7 +40,8 @@ class CanvasGradient : public Shader { double radius, const tonic::Int32List& colors, const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode); + SkShader::TileMode tile_mode, + const tonic::Float64List& matrix4); static void RegisterNatives(tonic::DartLibraryNatives* natives); From 76f97fec91f7fc1f0241989d3dbccd59f693cbd0 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Mon, 2 Apr 2018 13:59:49 -0400 Subject: [PATCH 0040/1190] Remove use of legacy Skia API (#4917) --- lib/ui/painting/paint.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ui/painting/paint.cc b/lib/ui/painting/paint.cc index 6e3acd8f4197d..b61a48c351fda 100644 --- a/lib/ui/painting/paint.cc +++ b/lib/ui/painting/paint.cc @@ -11,7 +11,6 @@ #include "third_party/skia/include/core/SkMaskFilter.h" #include "third_party/skia/include/core/SkShader.h" #include "third_party/skia/include/core/SkString.h" -#include "third_party/skia/include/effects/SkBlurMaskFilter.h" using namespace blink; @@ -140,7 +139,7 @@ Paint DartConverter::FromArguments(Dart_NativeArguments args, SkBlurStyle blur_style = static_cast(uint_data[kMaskFilterBlurStyleIndex]); double sigma = float_data[kMaskFilterSigmaIndex]; - paint.setMaskFilter(SkBlurMaskFilter::Make(blur_style, sigma)); + paint.setMaskFilter(SkMaskFilter::MakeBlur(blur_style, sigma)); break; } From c092e1475ad473d30fe740bc307bfd08b54a84fc Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Mon, 2 Apr 2018 14:36:15 -0400 Subject: [PATCH 0041/1190] Remove use of SkRect::MakeLargest (#4918) This API is being hidden for safety reasons. Instead, use a locally defined rect that's slightly smaller (so operations don't overflow). --- flow/layers/default_layer_builder.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index 9cf822528f3f9..a33b0eaa681b7 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -26,8 +26,10 @@ namespace flow { +static const SkRect kGiantRect = SkRect::MakeLTRB( -1E9F, -1E9F, 1E9F, 1E9F ); + DefaultLayerBuilder::DefaultLayerBuilder() { - cull_rects_.push(SkRect::MakeLargest()); + cull_rects_.push(kGiantRect); } DefaultLayerBuilder::~DefaultLayerBuilder() = default; @@ -38,7 +40,7 @@ void DefaultLayerBuilder::PushTransform(const SkMatrix& sk_matrix) { if (sk_matrix.invert(&inverse_sk_matrix)) { inverse_sk_matrix.mapRect(&cullRect, cull_rects_.top()); } else { - cullRect = SkRect::MakeLargest(); + cullRect = kGiantRect; } auto layer = std::make_unique(); From a594a91a70b14ce0998224b9c50caa51b2dedfeb Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Mon, 2 Apr 2018 12:27:54 -0700 Subject: [PATCH 0042/1190] [fuchsia] Set up namespace properly (#4920) When we converted this code to FIDL2, we moved the FlatNamespace into SetupNamespace, which meant it grabed the service root handle instead of leaving it in-place for ApplicationContext::CreateFrom to pick it up. Now, we pass this object by pointer, which is what we did in FIDL1. --- content_handler/application_controller_impl.cc | 17 +++++++++-------- content_handler/application_controller_impl.h | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/content_handler/application_controller_impl.cc b/content_handler/application_controller_impl.cc index dfed01a48348f..9a1b449138a1b 100644 --- a/content_handler/application_controller_impl.cc +++ b/content_handler/application_controller_impl.cc @@ -56,7 +56,7 @@ ApplicationControllerImpl::ApplicationControllerImpl( auto request = service_provider.NewRequest(); service_provider_bridge_.set_backend(std::move(service_provider)); - fdio_ns_t* fdio_ns = SetupNamespace(std::move(startup_info.flat_namespace)); + fdio_ns_t* fdio_ns = SetupNamespace(&startup_info.flat_namespace); if (fdio_ns == nullptr) { FXL_LOG(ERROR) << "Failed to initialize namespace"; return; @@ -66,7 +66,8 @@ ApplicationControllerImpl::ApplicationControllerImpl( runtime_holder_.reset(new RuntimeHolder()); runtime_holder_->SetMainIsolateShutdownCallback([this]() { Kill(); }); runtime_holder_->Init( - fdio_ns, component::ApplicationContext::CreateFrom(std::move(startup_info)), + fdio_ns, + component::ApplicationContext::CreateFrom(std::move(startup_info)), std::move(request), std::move(bundle)); } @@ -75,24 +76,24 @@ ApplicationControllerImpl::~ApplicationControllerImpl() = default; constexpr char kServiceRootPath[] = "/svc"; fdio_ns_t* ApplicationControllerImpl::SetupNamespace( - component::FlatNamespace flat) { + component::FlatNamespace* flat) { fdio_ns_t* fdio_namespc; zx_status_t status = fdio_ns_create(&fdio_namespc); if (status != ZX_OK) { FXL_LOG(ERROR) << "Failed to create namespace"; return nullptr; } - for (size_t i = 0; i < flat.paths->size(); ++i) { - if (flat.paths->at(i) == kServiceRootPath) { + for (size_t i = 0; i < flat->paths->size(); ++i) { + if (flat->paths->at(i) == kServiceRootPath) { // Ownership of /svc goes to the ApplicationContext created above. continue; } - zx::channel dir = std::move(flat.directories->at(i)); + zx::channel dir = std::move(flat->directories->at(i)); zx_handle_t dir_handle = dir.release(); - const char* path = flat.paths->at(i)->data(); + const char* path = flat->paths->at(i)->data(); status = fdio_ns_bind(fdio_namespc, path, dir_handle); if (status != ZX_OK) { - FXL_LOG(ERROR) << "Failed to bind " << flat.paths->at(i) + FXL_LOG(ERROR) << "Failed to bind " << flat->paths->at(i) << " to namespace"; zx_handle_close(dir_handle); fdio_ns_destroy(fdio_namespc); diff --git a/content_handler/application_controller_impl.h b/content_handler/application_controller_impl.h index 2065ad51c8587..01700f2886ffb 100644 --- a/content_handler/application_controller_impl.h +++ b/content_handler/application_controller_impl.h @@ -54,7 +54,7 @@ class ApplicationControllerImpl : public component::ApplicationController, void StartRuntimeIfReady(); void SendReturnCode(int32_t return_code); - fdio_ns_t* SetupNamespace(component::FlatNamespace flat); + fdio_ns_t* SetupNamespace(component::FlatNamespace* flat); App* app_; fidl::Binding binding_; From 467e2e7fc845194e7ae502f3568f57efe387d92e Mon Sep 17 00:00:00 2001 From: Ravi Mistry Date: Mon, 2 Apr 2018 16:13:00 -0400 Subject: [PATCH 0043/1190] Roll ../src/third_party/skia/ b33feaca1..9874bf1bc (19 commits) (#4919) https://skia.googlesource.com/skia.git/+log/b33feaca1caa..9874bf1bcecd $ git log b33feaca1..9874bf1bc --date=short --no-merges --format='%ad %ae %s' 2018-04-02 angle-skia-autoroll Roll skia/third_party/externals/angle2/ d104918fd..5a7e61bbd (1 commit) 2018-03-29 halcanary SkPDF/SkTypefaceMetrics: Set PostScript Name in Directwrite backend. 2018-04-02 djsollen Add multilib support as the default build option for libskqp 2018-04-02 mtklein In older STLs, std::vector::insert() returns void. 2018-04-02 benjaminwagner Revert "Temporarily remove Win10 QuadroP400 from CQ." 2018-04-02 halcanary SkPDF/Clusterator: a second test 2018-03-28 csmartdalton ccpr: Normalize homogeneous coords with frexp/ldexp 2018-04-02 robertphillips Turn on rendertarget sorting 2018-03-22 mtklein implement SkTDArray with std::vector 2018-04-02 egdaniel Remove specVersion check on vk extensions. 2018-04-02 kjlubick Add mock gl fuzzer 2018-04-02 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ a0790e0c9..d2cc6a7f7 (1 commit) 2018-04-02 kjlubick Roll Pixel 2 XL version 2018-03-21 caryclark fix SkRRect fuzzer assert 2018-04-02 kjlubick More nans causing infinite recursion in GrPathUtils::convertCubicToQuads 2018-04-02 caryclark fix a couple of minor surface doc changes 2018-03-29 ethannicholas fix for frexp dataflow analysis 2018-04-01 update-skps Update SKP version 2018-03-31 rmistry Revert "Whitespace change" Created with: roll-dep ../src/third_party/skia --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5da543fa95310..06d0b4d786623 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b33feaca1caa965677d92ad7d4d37dda1367fb88', + 'skia_revision': '9874bf1bcecd0113087bd8a51cf838da0efa3bfe', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index bf9c54da2d6cf..b6551f20cfa47 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0bcdb05515ca500aaa3f1a8349501cf4 +Signature: 6d40c6cdc2b0a27173677e57f49fb54a UNUSED LICENSES: From 04f3c6557c02879191a558320ed8ec81f8b2b619 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 2 Apr 2018 15:19:04 -0700 Subject: [PATCH 0044/1190] Provide a texture registry to the compositor context used for screenshots (#4921) Fixes https://github.com/flutter/flutter/issues/16143 --- shell/platform/android/platform_view_android.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 931fc28575ea3..8f677045fb1f5 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -727,6 +727,7 @@ void PlatformViewAndroid::GetBitmapGpuTask(jobject* pixels_out, image_info, pixels, frame_size.width() * sizeof(jint)); flow::CompositorContext compositor_context(nullptr); + compositor_context.SetTextureRegistry(&texture_registry_); SkCanvas* canvas = surface->getCanvas(); flow::CompositorContext::ScopedFrame frame = compositor_context.AcquireFrame(nullptr, canvas, false); From deea53519bd4461463063e27d8650933ed787d5c Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 3 Apr 2018 09:47:57 -0700 Subject: [PATCH 0045/1190] Set the asset bundle path when initializing the shell in the embedder API (#4925) This is required so that Dart initialization can find the platform kernel assets when running in Dart 2 mode --- shell/platform/embedder/embedder.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 2ac87f753357e..866413cbc077b 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -153,7 +153,8 @@ FlutterResult FlutterEngineRun(size_t version, shell::Shell::InitStandalone( std::move(command_line), icu_data_path, // icu data path default lookup. - "" // application library not supported in JIT mode. + "", // application library not supported in JIT mode. + args->assets_path ); }); From 11ceb7a0861cb14330cef66bc156e196b0c86857 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 3 Apr 2018 14:34:46 -0700 Subject: [PATCH 0046/1190] Roll buildroot to 8dddd90bf943a8174913564353b30a3b11ee0f7a (#4928) Includes: * Derive iOS host toolchain from $host_cpu (flutter/buildroot#131) --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 06d0b4d786623..2cca21e22cd8f 100644 --- a/DEPS +++ b/DEPS @@ -115,7 +115,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '35d44f8c4e20043de7615adf2f1203acb12ad236', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '8dddd90bf943a8174913564353b30a3b11ee0f7a', # Fuchsia compatibility # From 7dc7f581312fac11a4f131822be7729a0c9ae7cb Mon Sep 17 00:00:00 2001 From: Craig Stout Date: Tue, 3 Apr 2018 13:26:20 -0700 Subject: [PATCH 0047/1190] [vulkan] Add VK_ERROR_NOT_PERMITTED_EXT --- vulkan/vulkan_interface.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vulkan/vulkan_interface.cc b/vulkan/vulkan_interface.cc index 4c50635c615b1..fb8893b6e760f 100644 --- a/vulkan/vulkan_interface.cc +++ b/vulkan/vulkan_interface.cc @@ -62,6 +62,12 @@ std::string VulkanResultToString(VkResult result) { return "VK_RESULT_RANGE_SIZE"; case VK_RESULT_MAX_ENUM: return "VK_RESULT_MAX_ENUM"; + +#if VK_HEADER_VERSION >= 63 + case VK_ERROR_NOT_PERMITTED_EXT: + return "VK_ERROR_NOT_PERMITTED_EXT"; +#endif + #if OS_FUCHSIA #if VK_KHR_external_memory case VK_ERROR_INVALID_EXTERNAL_HANDLE_KHR: From c17abdea886c57ed441238b4425d4aac1bca3853 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 4 Apr 2018 09:36:08 -0400 Subject: [PATCH 0048/1190] Make Rect.largest match the "largest" rect used in DefaultLayerBuilder (#4926) --- lib/ui/geometry.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ui/geometry.dart b/lib/ui/geometry.dart index 005a076450504..b35ec55b066e8 100644 --- a/lib/ui/geometry.dart +++ b/lib/ui/geometry.dart @@ -659,13 +659,13 @@ class Rect { /// A rectangle with left, top, right, and bottom edges all at zero. static final Rect zero = new Rect._(); - static const double _skScalarMax = 3.402823466e+38; // from Skia's SkScalar.h + static const double _giantScalar = 1.0E+9; // matches kGiantRect from default_layer_builder.cc /// A rectangle that covers the entire coordinate space. /// - /// This actually covers the space from about -3e38,-3e38 to about 3e38,3e38. + /// This covers the space from -1e9,-1e9 to 1e9,1e9. /// This is the space over which graphics operations are valid. - static final Rect largest = new Rect.fromLTRB(-_skScalarMax, -_skScalarMax, _skScalarMax, _skScalarMax); + static final Rect largest = new Rect.fromLTRB(-_giantScalar, -_giantScalar, _giantScalar, _giantScalar); /// Whether any of the coordinates of this rectangle are equal to positive infinity. // included for consistency with Offset and Size From 31e5af64b927796d4d40b9c4be7939a2c265c77e Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 4 Apr 2018 09:37:51 -0700 Subject: [PATCH 0049/1190] libtxt: use Helvetica as a fallback font on iOS 8 and earlier (#4930) Fixes https://github.com/flutter/flutter/issues/16055 --- third_party/txt/src/txt/platform_mac.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/third_party/txt/src/txt/platform_mac.mm b/third_party/txt/src/txt/platform_mac.mm index 8b6bb9c33c1b1..9a97e06f099cc 100644 --- a/third_party/txt/src/txt/platform_mac.mm +++ b/third_party/txt/src/txt/platform_mac.mm @@ -3,6 +3,7 @@ // found in the LICENSE file. #include +#include "flutter/fml/platform/darwin/platform_version.h" #include "txt/platform.h" #if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR @@ -16,7 +17,11 @@ namespace txt { std::string GetDefaultFontFamily() { - return [FONT_CLASS systemFontOfSize:14].familyName.UTF8String; + if (fml::IsPlatformVersionAtLeast(9)) { + return [FONT_CLASS systemFontOfSize:14].familyName.UTF8String; + } else { + return "Helvetica"; + } } } // namespace txt From ac4089145203a19d317747c32c9114dd4894aa82 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 4 Apr 2018 10:12:41 -0700 Subject: [PATCH 0050/1190] libtxt: add missing dependency for Mac/iOS builds (#4931) --- third_party/txt/BUILD.gn | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/third_party/txt/BUILD.gn b/third_party/txt/BUILD.gn index 26edd3fdbff09..0cd1fff5ac506 100644 --- a/third_party/txt/BUILD.gn +++ b/third_party/txt/BUILD.gn @@ -103,16 +103,6 @@ source_set("txt") { "src/utils/WindowsUtils.h", ] - if (is_mac || is_ios) { - set_sources_assignment_filter([]) - sources += [ "src/txt/platform_mac.mm" ] - set_sources_assignment_filter(sources_assignment_filter) - } else if (is_android) { - sources += [ "src/txt/platform_android.cc" ] - } else { - sources += [ "src/txt/platform.cc" ] - } - public_configs = [ ":txt_config" ] public_deps = [ @@ -125,6 +115,17 @@ source_set("txt") { deps = [ "//third_party/skia:effects", ] + + if (is_mac || is_ios) { + set_sources_assignment_filter([]) + sources += [ "src/txt/platform_mac.mm" ] + set_sources_assignment_filter(sources_assignment_filter) + deps += [ "$flutter_root/fml" ] + } else if (is_android) { + sources += [ "src/txt/platform_android.cc" ] + } else { + sources += [ "src/txt/platform.cc" ] + } } txt_common_executable_deps = [ From 58d6ea360ee8454dc1ee442d69408d66fe088a03 Mon Sep 17 00:00:00 2001 From: Siva Date: Wed, 4 Apr 2018 12:16:50 -0700 Subject: [PATCH 0051/1190] Roll dart to 4bcf8ad411bd90da16d44ad399bf350e8423eac9 (#4929) --- DEPS | 10 +- travis/licenses_golden/licenses_third_party | 2443 ++++++++----------- 2 files changed, 984 insertions(+), 1469 deletions(-) diff --git a/DEPS b/DEPS index 2cca21e22cd8f..eb6c3ba308f7f 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '52afcba357ad398e8c24f3e3363ac6ff5293df63', + 'dart_revision': '4bcf8ad411bd90da16d44ad399bf350e8423eac9', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -48,7 +48,7 @@ vars = { 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.5+1', 'dart_dart_style_tag': '1.0.10', - 'dart_dartdoc_tag': 'v0.18.0', + 'dart_dartdoc_tag': 'v0.18.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', @@ -68,15 +68,15 @@ vars = { 'dart_mockito_tag': 'a92db054fba18bc2d605be7670aee74b7cadc00a', 'dart_mustache4dart_tag': 'v2.1.0', 'dart_oauth2_tag': '1.1.0', - 'dart_observatory_pub_packages_rev': '4c282bb240b68f407c8c7779a65c68eeb0139dc6', + 'dart_observatory_pub_packages_rev': 'd3a3aebefbd35aa30fe7bbc2889b772b398f7d7f', 'dart_package_config_tag': '1.0.3', 'dart_package_resolver_tag': '1.0.2+1', 'dart_path_tag': '1.5.1', 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '875d35005a7d33f367d70a3e31e9d3bad5d1ebd8', - 'dart_pub_semver_tag': '1.3.2', + 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', + 'dart_pub_semver_tag': '1.3.4', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b6551f20cfa47..d6c9148867fe5 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6d40c6cdc2b0a27173677e57f49fb54a +Signature: c38fa8133a5c87e15329c5b7f037824d UNUSED LICENSES: @@ -4202,110 +4202,126 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/loader.dart + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/address_sanitizer.cc -FILE: ../../../third_party/dart/runtime/bin/builtin_common.cc -FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.cc -FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.h -FILE: ../../../third_party/dart/runtime/bin/observatory_assets_empty.cc -FILE: ../../../third_party/dart/runtime/bin/vmservice/loader.dart -FILE: ../../../third_party/dart/runtime/lib/async_patch.dart -FILE: ../../../third_party/dart/runtime/lib/compact_hash.dart -FILE: ../../../third_party/dart/runtime/lib/developer.cc -FILE: ../../../third_party/dart/runtime/lib/developer.dart -FILE: ../../../third_party/dart/runtime/lib/timeline.cc -FILE: ../../../third_party/dart/runtime/lib/timeline.dart -FILE: ../../../third_party/dart/runtime/lib/vmservice.cc -FILE: ../../../third_party/dart/runtime/observatory/lib/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/cli.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/sample_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/allocation_profile/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/analytics.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/cli/command.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger_location.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging_list.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/persistent_handles.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/ports.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline_page.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/view_footer.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/sample_profile/sample_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/web/timeline.js -FILE: ../../../third_party/dart/runtime/vm/atomic_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.h -FILE: ../../../third_party/dart/runtime/vm/log.cc -FILE: ../../../third_party/dart/runtime/vm/log.h -FILE: ../../../third_party/dart/runtime/vm/log_test.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread.cc -FILE: ../../../third_party/dart/runtime/vm/profiler_service.cc -FILE: ../../../third_party/dart/runtime/vm/profiler_service.h -FILE: ../../../third_party/dart/runtime/vm/program_visitor.cc -FILE: ../../../third_party/dart/runtime/vm/program_visitor.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode_inl.h -FILE: ../../../third_party/dart/runtime/vm/regexp_bytecodes.h -FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.h -FILE: ../../../third_party/dart/runtime/vm/scope_timer.h -FILE: ../../../third_party/dart/runtime/vm/service_event.cc -FILE: ../../../third_party/dart/runtime/vm/service_event.h -FILE: ../../../third_party/dart/runtime/vm/service_isolate.cc -FILE: ../../../third_party/dart/runtime/vm/source_report.cc -FILE: ../../../third_party/dart/runtime/vm/source_report.h -FILE: ../../../third_party/dart/runtime/vm/source_report_test.cc -FILE: ../../../third_party/dart/runtime/vm/thread.cc -FILE: ../../../third_party/dart/runtime/vm/thread.h -FILE: ../../../third_party/dart/runtime/vm/thread_barrier.h -FILE: ../../../third_party/dart/runtime/vm/thread_barrier_test.cc -FILE: ../../../third_party/dart/runtime/vm/thread_registry.cc -FILE: ../../../third_party/dart/runtime/vm/thread_registry.h -FILE: ../../../third_party/dart/runtime/vm/timeline.cc -FILE: ../../../third_party/dart/runtime/vm/timeline.h -FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.cc -FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.h -FILE: ../../../third_party/dart/runtime/vm/timeline_test.cc -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/developer_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/d8.js -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart -FILE: ../../../third_party/dart/sdk/lib/convert/base64.dart -FILE: ../../../third_party/dart/sdk/lib/dart_client.platform -FILE: ../../../third_party/dart/sdk/lib/dart_server.platform -FILE: ../../../third_party/dart/sdk/lib/dart_shared.platform -FILE: ../../../third_party/dart/sdk/lib/developer/developer.dart -FILE: ../../../third_party/dart/sdk/lib/developer/extension.dart -FILE: ../../../third_party/dart/sdk/lib/developer/timeline.dart -FILE: ../../../third_party/dart/sdk/lib/io/io_resource_info.dart -FILE: ../../../third_party/dart/sdk/lib/io/security_context.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/asset.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/vmservice.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/common.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/html_import_annotation_recorder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/import_inliner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/mirrors_remover.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/script_compactor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/test_compatibility.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/web_components.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/custom_element_proxy.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/html_import_annotation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/init.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/custom_element.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/init.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/normalize_path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/web_components.dart +FILE: ../../../third_party/dart/runtime/lib/bigint.dart +FILE: ../../../third_party/dart/runtime/lib/class_id.cc +FILE: ../../../third_party/dart/runtime/lib/class_id.dart +FILE: ../../../third_party/dart/runtime/lib/convert_patch.dart +FILE: ../../../third_party/dart/runtime/lib/lib_prefix.dart +FILE: ../../../third_party/dart/runtime/lib/linked_hash_map.cc +FILE: ../../../third_party/dart/runtime/lib/profiler.cc +FILE: ../../../third_party/dart/runtime/lib/profiler.dart +FILE: ../../../third_party/dart/runtime/observatory/bin/shell.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/app.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_common.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_html.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_io.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/utils.dart +FILE: ../../../third_party/dart/runtime/observatory/web/main.dart +FILE: ../../../third_party/dart/runtime/platform/address_sanitizer.h +FILE: ../../../third_party/dart/runtime/platform/math.h +FILE: ../../../third_party/dart/runtime/platform/memory_sanitizer.h +FILE: ../../../third_party/dart/runtime/platform/safe_stack.h +FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart +FILE: ../../../third_party/dart/runtime/vm/ast_transformer.cc +FILE: ../../../third_party/dart/runtime/vm/ast_transformer.h +FILE: ../../../third_party/dart/runtime/vm/bigint_test.cc +FILE: ../../../third_party/dart/runtime/vm/bit_set_test.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h +FILE: ../../../third_party/dart/runtime/vm/constants_arm64.h +FILE: ../../../third_party/dart/runtime/vm/cpu_arm.h +FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.h +FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.h +FILE: ../../../third_party/dart/runtime/vm/cpu_x64.h +FILE: ../../../third_party/dart/runtime/vm/cpuid.cc +FILE: ../../../third_party/dart/runtime/vm/cpuid.h +FILE: ../../../third_party/dart/runtime/vm/cpuinfo.h +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_test.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/hash_table.h +FILE: ../../../third_party/dart/runtime/vm/hash_table_test.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.h +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/metrics.cc +FILE: ../../../third_party/dart/runtime/vm/metrics.h +FILE: ../../../third_party/dart/runtime/vm/metrics_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_graph.cc +FILE: ../../../third_party/dart/runtime/vm/object_graph.h +FILE: ../../../third_party/dart/runtime/vm/object_graph_test.cc +FILE: ../../../third_party/dart/runtime/vm/regexp.cc +FILE: ../../../third_party/dart/runtime/vm/regexp.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h +FILE: ../../../third_party/dart/runtime/vm/regexp_ast.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_ast.h +FILE: ../../../third_party/dart/runtime/vm/regexp_parser.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_parser.h +FILE: ../../../third_party/dart/runtime/vm/regexp_test.cc +FILE: ../../../third_party/dart/runtime/vm/report.cc +FILE: ../../../third_party/dart/runtime/vm/report.h +FILE: ../../../third_party/dart/runtime/vm/ring_buffer.h +FILE: ../../../third_party/dart/runtime/vm/ring_buffer_test.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/scavenger_test.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.h +FILE: ../../../third_party/dart/runtime/vm/spaces.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/tags.cc +FILE: ../../../third_party/dart/runtime/vm/unibrow-inl.h +FILE: ../../../third_party/dart/runtime/vm/unibrow.cc +FILE: ../../../third_party/dart/runtime/vm/unibrow.h +FILE: ../../../third_party/dart/runtime/vm/verified_memory_test.cc +FILE: ../../../third_party/dart/runtime/vm/weak_code.cc +FILE: ../../../third_party/dart/runtime/vm/weak_code.h +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_serialization.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart +FILE: ../../../third_party/dart/sdk/lib/collection/set.dart +FILE: ../../../third_party/dart/sdk/lib/core/sink.dart +FILE: ../../../third_party/dart/sdk/lib/developer/profiler.dart +FILE: ../../../third_party/dart/sdk/lib/io/process.dart +FILE: ../../../third_party/dart/sdk/lib/io/service_object.dart +FILE: ../../../third_party/dart/sdk/lib/isolate/capability.dart +FILE: ../../../third_party/dart/sdk/lib/profiler/profiler.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/css_class_set.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -4335,505 +4351,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/server.dart + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/WATCHLISTS -FILE: ../../../third_party/dart/runtime/bin/eventhandler_win.cc -FILE: ../../../third_party/dart/runtime/bin/file.cc -FILE: ../../../third_party/dart/runtime/bin/file.h -FILE: ../../../third_party/dart/runtime/bin/file_system_entity_patch.dart -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.cc -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.h -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_android.cc -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_linux.cc -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_macos.cc -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_win.cc -FILE: ../../../third_party/dart/runtime/bin/filter.cc -FILE: ../../../third_party/dart/runtime/bin/filter.h -FILE: ../../../third_party/dart/runtime/bin/filter_patch.dart -FILE: ../../../third_party/dart/runtime/bin/gen_snapshot.cc -FILE: ../../../third_party/dart/runtime/bin/io_natives.cc -FILE: ../../../third_party/dart/runtime/bin/io_service.cc -FILE: ../../../third_party/dart/runtime/bin/io_service.h -FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.cc -FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.h -FILE: ../../../third_party/dart/runtime/bin/io_service_patch.dart -FILE: ../../../third_party/dart/runtime/bin/process.cc -FILE: ../../../third_party/dart/runtime/bin/process_patch.dart -FILE: ../../../third_party/dart/runtime/bin/socket.cc -FILE: ../../../third_party/dart/runtime/bin/socket.h -FILE: ../../../third_party/dart/runtime/bin/socket_base_linux.cc -FILE: ../../../third_party/dart/runtime/bin/socket_base_macos.cc -FILE: ../../../third_party/dart/runtime/bin/socket_base_win.cc -FILE: ../../../third_party/dart/runtime/bin/socket_linux.cc -FILE: ../../../third_party/dart/runtime/bin/socket_macos.cc -FILE: ../../../third_party/dart/runtime/bin/socket_patch.dart -FILE: ../../../third_party/dart/runtime/bin/socket_win.cc -FILE: ../../../third_party/dart/runtime/bin/stdio.cc -FILE: ../../../third_party/dart/runtime/bin/stdio.h -FILE: ../../../third_party/dart/runtime/bin/stdio_android.cc -FILE: ../../../third_party/dart/runtime/bin/stdio_linux.cc -FILE: ../../../third_party/dart/runtime/bin/stdio_macos.cc -FILE: ../../../third_party/dart/runtime/bin/stdio_patch.dart -FILE: ../../../third_party/dart/runtime/bin/stdio_win.cc -FILE: ../../../third_party/dart/runtime/bin/vmservice/server.dart -FILE: ../../../third_party/dart/runtime/bin/vmservice/vmservice_io.dart -FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.cc -FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.h -FILE: ../../../third_party/dart/runtime/include/dart_mirrors_api.h -FILE: ../../../third_party/dart/runtime/include/dart_native_api.h -FILE: ../../../third_party/dart/runtime/lib/collection_patch.dart -FILE: ../../../third_party/dart/runtime/lib/core_patch.dart -FILE: ../../../third_party/dart/runtime/lib/deferred_load_patch.dart -FILE: ../../../third_party/dart/runtime/lib/function.dart -FILE: ../../../third_party/dart/runtime/lib/internal_patch.dart -FILE: ../../../third_party/dart/runtime/lib/invocation_mirror.h -FILE: ../../../third_party/dart/runtime/lib/libgen_in.cc -FILE: ../../../third_party/dart/runtime/lib/mirror_reference.dart -FILE: ../../../third_party/dart/runtime/lib/null_patch.dart -FILE: ../../../third_party/dart/runtime/lib/schedule_microtask_patch.dart -FILE: ../../../third_party/dart/runtime/lib/simd128.cc -FILE: ../../../third_party/dart/runtime/lib/stacktrace.cc -FILE: ../../../third_party/dart/runtime/lib/stacktrace.dart -FILE: ../../../third_party/dart/runtime/lib/symbol_patch.dart -FILE: ../../../third_party/dart/runtime/lib/timer_impl.dart -FILE: ../../../third_party/dart/runtime/lib/typed_data.cc -FILE: ../../../third_party/dart/runtime/lib/typed_data_patch.dart -FILE: ../../../third_party/dart/runtime/lib/uri.cc -FILE: ../../../third_party/dart/runtime/lib/uri_patch.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/application.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/location_manager.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_instances.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile_table.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/curly_block.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/eval_box.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/flag_list.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/any_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/json_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/local_var_descriptors_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/native_memory_profiler.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_common.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectstore_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/observatory_application.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/pc_descriptors_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sample_buffer_control.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_inset.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_value.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_inset.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/stack_trace_tree_config.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/token_stream_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/type_arguments_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unknown_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/tracer.dart -FILE: ../../../third_party/dart/runtime/platform/atomic.h -FILE: ../../../third_party/dart/runtime/platform/atomic_android.h -FILE: ../../../third_party/dart/runtime/platform/atomic_linux.h -FILE: ../../../third_party/dart/runtime/platform/atomic_macos.h -FILE: ../../../third_party/dart/runtime/platform/atomic_win.h -FILE: ../../../third_party/dart/runtime/platform/signal_blocker.h -FILE: ../../../third_party/dart/runtime/vm/allocation.h -FILE: ../../../third_party/dart/runtime/vm/class_finalizer.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_x64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.h -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_x64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.cc -FILE: ../../../third_party/dart/runtime/vm/constants_arm.h -FILE: ../../../third_party/dart/runtime/vm/constants_ia32.h -FILE: ../../../third_party/dart/runtime/vm/constants_x64.h -FILE: ../../../third_party/dart/runtime/vm/dart.cc -FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.cc -FILE: ../../../third_party/dart/runtime/vm/deferred_objects.cc -FILE: ../../../third_party/dart/runtime/vm/deferred_objects.h -FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.cc -FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.h -FILE: ../../../third_party/dart/runtime/vm/guard_field_test.cc -FILE: ../../../third_party/dart/runtime/vm/instructions.h -FILE: ../../../third_party/dart/runtime/vm/instructions_arm.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm.h -FILE: ../../../third_party/dart/runtime/vm/instructions_arm_test.cc -FILE: ../../../third_party/dart/runtime/vm/isolate.cc -FILE: ../../../third_party/dart/runtime/vm/isolate.h -FILE: ../../../third_party/dart/runtime/vm/json_stream.cc -FILE: ../../../third_party/dart/runtime/vm/json_stream.h -FILE: ../../../third_party/dart/runtime/vm/mirrors_api_impl.cc -FILE: ../../../third_party/dart/runtime/vm/native_api_impl.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol.h -FILE: ../../../third_party/dart/runtime/vm/native_symbol_android.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_linux.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_macos.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_win.cc -FILE: ../../../third_party/dart/runtime/vm/object_id_ring.cc -FILE: ../../../third_party/dart/runtime/vm/object_id_ring.h -FILE: ../../../third_party/dart/runtime/vm/object_id_ring_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_store.cc -FILE: ../../../third_party/dart/runtime/vm/os_test.cc -FILE: ../../../third_party/dart/runtime/vm/profiler.cc -FILE: ../../../third_party/dart/runtime/vm/profiler.h -FILE: ../../../third_party/dart/runtime/vm/profiler_test.cc -FILE: ../../../third_party/dart/runtime/vm/random.cc -FILE: ../../../third_party/dart/runtime/vm/random.h -FILE: ../../../third_party/dart/runtime/vm/reusable_handles.h -FILE: ../../../third_party/dart/runtime/vm/service.cc -FILE: ../../../third_party/dart/runtime/vm/service.h -FILE: ../../../third_party/dart/runtime/vm/service_isolate.h -FILE: ../../../third_party/dart/runtime/vm/service_test.cc -FILE: ../../../third_party/dart/runtime/vm/signal_handler.h -FILE: ../../../third_party/dart/runtime/vm/signal_handler_android.cc -FILE: ../../../third_party/dart/runtime/vm/signal_handler_linux.cc -FILE: ../../../third_party/dart/runtime/vm/signal_handler_macos.cc -FILE: ../../../third_party/dart/runtime/vm/signal_handler_win.cc -FILE: ../../../third_party/dart/runtime/vm/simulator.h -FILE: ../../../third_party/dart/runtime/vm/simulator_arm.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_ia32.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_x64.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm_test.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_x64.cc -FILE: ../../../third_party/dart/runtime/vm/tags.h -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.cc -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.h -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_android.cc -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_linux.cc -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_macos.cc -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_win.cc -FILE: ../../../third_party/dart/runtime/vm/weak_table.cc -FILE: ../../../third_party/dart/runtime/vm/weak_table.h -FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http_headers.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http_impl.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http_parser.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http_session.dart -FILE: ../../../third_party/dart/sdk/lib/_http/websocket.dart -FILE: ../../../third_party/dart/sdk/lib/_http/websocket_impl.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/annotations.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/collection_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/convert_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/internal_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/io_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_helper.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_names.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_primitives.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_rti.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart -FILE: ../../../third_party/dart/sdk/lib/async/deferred_load.dart -FILE: ../../../third_party/dart/sdk/lib/async/schedule_microtask.dart -FILE: ../../../third_party/dart/sdk/lib/async/stream.dart -FILE: ../../../third_party/dart/sdk/lib/async/stream_transformers.dart -FILE: ../../../third_party/dart/sdk/lib/async/zone.dart -FILE: ../../../third_party/dart/sdk/lib/collection/collections.dart -FILE: ../../../third_party/dart/sdk/lib/collection/hash_map.dart -FILE: ../../../third_party/dart/sdk/lib/collection/hash_set.dart -FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_map.dart -FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_set.dart -FILE: ../../../third_party/dart/sdk/lib/collection/linked_list.dart -FILE: ../../../third_party/dart/sdk/lib/collection/list.dart -FILE: ../../../third_party/dart/sdk/lib/convert/ascii.dart -FILE: ../../../third_party/dart/sdk/lib/convert/byte_conversion.dart -FILE: ../../../third_party/dart/sdk/lib/convert/chunked_conversion.dart -FILE: ../../../third_party/dart/sdk/lib/convert/codec.dart -FILE: ../../../third_party/dart/sdk/lib/convert/convert.dart -FILE: ../../../third_party/dart/sdk/lib/convert/converter.dart -FILE: ../../../third_party/dart/sdk/lib/convert/encoding.dart -FILE: ../../../third_party/dart/sdk/lib/convert/html_escape.dart -FILE: ../../../third_party/dart/sdk/lib/convert/json.dart -FILE: ../../../third_party/dart/sdk/lib/convert/latin1.dart -FILE: ../../../third_party/dart/sdk/lib/convert/line_splitter.dart -FILE: ../../../third_party/dart/sdk/lib/convert/string_conversion.dart -FILE: ../../../third_party/dart/sdk/lib/convert/utf.dart -FILE: ../../../third_party/dart/sdk/lib/core/annotations.dart -FILE: ../../../third_party/dart/sdk/lib/core/null.dart -FILE: ../../../third_party/dart/sdk/lib/core/stacktrace.dart -FILE: ../../../third_party/dart/sdk/lib/core/string_sink.dart -FILE: ../../../third_party/dart/sdk/lib/core/symbol.dart -FILE: ../../../third_party/dart/sdk/lib/internal/list.dart -FILE: ../../../third_party/dart/sdk/lib/internal/print.dart -FILE: ../../../third_party/dart/sdk/lib/internal/symbol.dart -FILE: ../../../third_party/dart/sdk/lib/io/bytes_builder.dart -FILE: ../../../third_party/dart/sdk/lib/io/data_transformer.dart -FILE: ../../../third_party/dart/sdk/lib/io/file.dart -FILE: ../../../third_party/dart/sdk/lib/io/file_impl.dart -FILE: ../../../third_party/dart/sdk/lib/io/file_system_entity.dart -FILE: ../../../third_party/dart/sdk/lib/io/io_service.dart -FILE: ../../../third_party/dart/sdk/lib/io/io_sink.dart -FILE: ../../../third_party/dart/sdk/lib/io/link.dart -FILE: ../../../third_party/dart/sdk/lib/io/secure_socket.dart -FILE: ../../../third_party/dart/sdk/lib/io/socket.dart -FILE: ../../../third_party/dart/sdk/lib/io/stdio.dart -FILE: ../../../third_party/dart/sdk/lib/io/string_transformer.dart -FILE: ../../../third_party/dart/sdk/lib/js/dart2js/js_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/math/jenkins_smi_hash.dart -FILE: ../../../third_party/dart/sdk/lib/math/point.dart -FILE: ../../../third_party/dart/sdk/lib/math/rectangle.dart -FILE: ../../../third_party/dart/sdk/lib/mirrors/mirrors.dart -FILE: ../../../third_party/dart/sdk/lib/typed_data/typed_data.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/client.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/constants.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/message.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/message_router.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolate.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolates.dart -FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/import_crawler.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/polyfill.dart -FILE: ../../../third_party/dart/utils/compiler/create_snapshot_entry.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/lib/bigint.dart -FILE: ../../../third_party/dart/runtime/lib/class_id.cc -FILE: ../../../third_party/dart/runtime/lib/class_id.dart -FILE: ../../../third_party/dart/runtime/lib/convert_patch.dart -FILE: ../../../third_party/dart/runtime/lib/lib_prefix.dart -FILE: ../../../third_party/dart/runtime/lib/linked_hash_map.cc -FILE: ../../../third_party/dart/runtime/lib/profiler.cc -FILE: ../../../third_party/dart/runtime/lib/profiler.dart -FILE: ../../../third_party/dart/runtime/observatory/bin/shell.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/app.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_common.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_html.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_io.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/utils.dart -FILE: ../../../third_party/dart/runtime/observatory/web/main.dart -FILE: ../../../third_party/dart/runtime/platform/address_sanitizer.h -FILE: ../../../third_party/dart/runtime/platform/math.h -FILE: ../../../third_party/dart/runtime/platform/memory_sanitizer.h -FILE: ../../../third_party/dart/runtime/platform/safe_stack.h -FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart -FILE: ../../../third_party/dart/runtime/vm/ast_transformer.cc -FILE: ../../../third_party/dart/runtime/vm/ast_transformer.h -FILE: ../../../third_party/dart/runtime/vm/bigint_test.cc -FILE: ../../../third_party/dart/runtime/vm/bit_set_test.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h -FILE: ../../../third_party/dart/runtime/vm/constants_arm64.h -FILE: ../../../third_party/dart/runtime/vm/cpu_arm.h -FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.h -FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.h -FILE: ../../../third_party/dart/runtime/vm/cpu_x64.h -FILE: ../../../third_party/dart/runtime/vm/cpuid.cc -FILE: ../../../third_party/dart/runtime/vm/cpuid.h -FILE: ../../../third_party/dart/runtime/vm/cpuinfo.h -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_test.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/hash_table.h -FILE: ../../../third_party/dart/runtime/vm/hash_table_test.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.h -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/metrics.cc -FILE: ../../../third_party/dart/runtime/vm/metrics.h -FILE: ../../../third_party/dart/runtime/vm/metrics_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_graph.cc -FILE: ../../../third_party/dart/runtime/vm/object_graph.h -FILE: ../../../third_party/dart/runtime/vm/object_graph_test.cc -FILE: ../../../third_party/dart/runtime/vm/regexp.cc -FILE: ../../../third_party/dart/runtime/vm/regexp.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h -FILE: ../../../third_party/dart/runtime/vm/regexp_ast.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_ast.h -FILE: ../../../third_party/dart/runtime/vm/regexp_parser.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_parser.h -FILE: ../../../third_party/dart/runtime/vm/regexp_test.cc -FILE: ../../../third_party/dart/runtime/vm/report.cc -FILE: ../../../third_party/dart/runtime/vm/report.h -FILE: ../../../third_party/dart/runtime/vm/ring_buffer.h -FILE: ../../../third_party/dart/runtime/vm/ring_buffer_test.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/scavenger_test.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.h -FILE: ../../../third_party/dart/runtime/vm/spaces.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/tags.cc -FILE: ../../../third_party/dart/runtime/vm/unibrow-inl.h -FILE: ../../../third_party/dart/runtime/vm/unibrow.cc -FILE: ../../../third_party/dart/runtime/vm/unibrow.h -FILE: ../../../third_party/dart/runtime/vm/verified_memory_test.cc -FILE: ../../../third_party/dart/runtime/vm/weak_code.cc -FILE: ../../../third_party/dart/runtime/vm/weak_code.h -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_serialization.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart -FILE: ../../../third_party/dart/sdk/lib/collection/set.dart -FILE: ../../../third_party/dart/sdk/lib/core/sink.dart -FILE: ../../../third_party/dart/sdk/lib/developer/profiler.dart -FILE: ../../../third_party/dart/sdk/lib/io/process.dart -FILE: ../../../third_party/dart/sdk/lib/io/service_object.dart -FILE: ../../../third_party/dart/sdk/lib/isolate/capability.dart -FILE: ../../../third_party/dart/sdk/lib/profiler/profiler.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/css_class_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/dart_support.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop_support.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/mirror_initializer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/static_initializer.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/dart/.mailmap FILE: ../../../third_party/dart/client/idea/.idea/.name @@ -5492,8 +5010,6 @@ FILE: ../../../third_party/dart/runtime/vm/stack_trace.h FILE: ../../../third_party/dart/runtime/vm/timeline_android.cc FILE: ../../../third_party/dart/runtime/vm/timeline_fuchsia.cc FILE: ../../../third_party/dart/runtime/vm/timeline_linux.cc -FILE: ../../../third_party/dart/runtime/vm/timeline_macos.cc -FILE: ../../../third_party/dart/runtime/vm/timeline_win.cc FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.cc FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.h FILE: ../../../third_party/dart/sdk/lib/_http/overrides.dart @@ -5824,7 +5340,254 @@ FILE: ../../../third_party/dart/sdk/lib/developer/service.dart FILE: ../../../third_party/dart/sdk/lib/js_util/dart2js/js_util_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/vmservice/devfs.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/process_test.cc + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/process_test.cc +FILE: ../../../third_party/dart/runtime/bin/snapshot_empty.cc +FILE: ../../../third_party/dart/runtime/bin/snapshot_in.cc +FILE: ../../../third_party/dart/runtime/include/dart_tools_api.h +FILE: ../../../third_party/dart/runtime/lib/double.cc +FILE: ../../../third_party/dart/runtime/lib/math.cc +FILE: ../../../third_party/dart/runtime/lib/mirrors.h +FILE: ../../../third_party/dart/runtime/lib/object.cc +FILE: ../../../third_party/dart/runtime/lib/string.cc +FILE: ../../../third_party/dart/runtime/platform/c99_support_win.h +FILE: ../../../third_party/dart/runtime/platform/inttypes_support_win.h +FILE: ../../../third_party/dart/runtime/vm/ast.cc +FILE: ../../../third_party/dart/runtime/vm/ast_printer.cc +FILE: ../../../third_party/dart/runtime/vm/ast_printer.h +FILE: ../../../third_party/dart/runtime/vm/bitfield.h +FILE: ../../../third_party/dart/runtime/vm/code_patcher_ia32_test.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_x64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler_stats.cc +FILE: ../../../third_party/dart/runtime/vm/compiler_stats.h +FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/custom_isolate_test.cc +FILE: ../../../third_party/dart/runtime/vm/dart.h +FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.h +FILE: ../../../third_party/dart/runtime/vm/dart_entry.cc +FILE: ../../../third_party/dart/runtime/vm/dart_entry.h +FILE: ../../../third_party/dart/runtime/vm/debugger_arm.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_x64.cc +FILE: ../../../third_party/dart/runtime/vm/double_conversion.cc +FILE: ../../../third_party/dart/runtime/vm/double_conversion.h +FILE: ../../../third_party/dart/runtime/vm/exceptions.cc +FILE: ../../../third_party/dart/runtime/vm/exceptions.h +FILE: ../../../third_party/dart/runtime/vm/freelist.cc +FILE: ../../../third_party/dart/runtime/vm/gc_marker.cc +FILE: ../../../third_party/dart/runtime/vm/gc_marker.h +FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.cc +FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.h +FILE: ../../../third_party/dart/runtime/vm/handles.h +FILE: ../../../third_party/dart/runtime/vm/longjump.cc +FILE: ../../../third_party/dart/runtime/vm/longjump.h +FILE: ../../../third_party/dart/runtime/vm/longjump_test.cc +FILE: ../../../third_party/dart/runtime/vm/memory_region.cc +FILE: ../../../third_party/dart/runtime/vm/message.cc +FILE: ../../../third_party/dart/runtime/vm/message.h +FILE: ../../../third_party/dart/runtime/vm/message_handler.cc +FILE: ../../../third_party/dart/runtime/vm/message_handler.h +FILE: ../../../third_party/dart/runtime/vm/native_entry.cc +FILE: ../../../third_party/dart/runtime/vm/native_entry.h +FILE: ../../../third_party/dart/runtime/vm/native_entry_test.cc +FILE: ../../../third_party/dart/runtime/vm/native_entry_test.h +FILE: ../../../third_party/dart/runtime/vm/object_store_test.cc +FILE: ../../../third_party/dart/runtime/vm/os.h +FILE: ../../../third_party/dart/runtime/vm/pages.h +FILE: ../../../third_party/dart/runtime/vm/parser_test.cc +FILE: ../../../third_party/dart/runtime/vm/port.h +FILE: ../../../third_party/dart/runtime/vm/resolver.cc +FILE: ../../../third_party/dart/runtime/vm/resolver.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_list.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_x64.cc +FILE: ../../../third_party/dart/runtime/vm/scanner.h +FILE: ../../../third_party/dart/runtime/vm/scavenger.cc +FILE: ../../../third_party/dart/runtime/vm/stack_frame.h +FILE: ../../../third_party/dart/runtime/vm/stub_code.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32_test.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_x64_test.cc +FILE: ../../../third_party/dart/runtime/vm/timer.cc +FILE: ../../../third_party/dart/runtime/vm/timer.h +FILE: ../../../third_party/dart/runtime/vm/token.cc +FILE: ../../../third_party/dart/runtime/vm/unicode_data.cc +FILE: ../../../third_party/dart/runtime/vm/unicode_test.cc +FILE: ../../../third_party/dart/runtime/vm/unit_test.h +FILE: ../../../third_party/dart/runtime/vm/verifier.h +FILE: ../../../third_party/dart/runtime/vm/visitor.h +FILE: ../../../third_party/dart/sdk/lib/collection/queue.dart +FILE: ../../../third_party/dart/sdk/lib/core/comparable.dart +FILE: ../../../third_party/dart/sdk/lib/core/date_time.dart +FILE: ../../../third_party/dart/sdk/lib/core/duration.dart +FILE: ../../../third_party/dart/sdk/lib/core/function.dart +FILE: ../../../third_party/dart/sdk/lib/core/iterable.dart +FILE: ../../../third_party/dart/sdk/lib/core/map.dart +FILE: ../../../third_party/dart/sdk/lib/core/pattern.dart +FILE: ../../../third_party/dart/sdk/lib/core/set.dart +FILE: ../../../third_party/dart/sdk/lib/core/stopwatch.dart +FILE: ../../../third_party/dart/sdk/lib/core/string_buffer.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/device.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/filtered_element_list.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/lists.dart +FILE: ../../../third_party/dart/sdk/lib/internal/iterable.dart +FILE: ../../../third_party/dart/sdk/lib/internal/sort.dart +FILE: ../../../third_party/dart/utils/peg/pegparser.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/loader.dart + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/address_sanitizer.cc +FILE: ../../../third_party/dart/runtime/bin/builtin_common.cc +FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.cc +FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.h +FILE: ../../../third_party/dart/runtime/bin/observatory_assets_empty.cc +FILE: ../../../third_party/dart/runtime/bin/vmservice/loader.dart +FILE: ../../../third_party/dart/runtime/lib/async_patch.dart +FILE: ../../../third_party/dart/runtime/lib/compact_hash.dart +FILE: ../../../third_party/dart/runtime/lib/developer.cc +FILE: ../../../third_party/dart/runtime/lib/developer.dart +FILE: ../../../third_party/dart/runtime/lib/timeline.cc +FILE: ../../../third_party/dart/runtime/lib/timeline.dart +FILE: ../../../third_party/dart/runtime/lib/vmservice.cc +FILE: ../../../third_party/dart/runtime/observatory/lib/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/cli.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/sample_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/allocation_profile/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/analytics.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/cli/command.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger_location.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging_list.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/persistent_handles.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/ports.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline_page.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/view_footer.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/sample_profile/sample_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/web/timeline.js +FILE: ../../../third_party/dart/runtime/vm/atomic_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.h +FILE: ../../../third_party/dart/runtime/vm/log.cc +FILE: ../../../third_party/dart/runtime/vm/log.h +FILE: ../../../third_party/dart/runtime/vm/log_test.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread.cc +FILE: ../../../third_party/dart/runtime/vm/profiler_service.cc +FILE: ../../../third_party/dart/runtime/vm/profiler_service.h +FILE: ../../../third_party/dart/runtime/vm/program_visitor.cc +FILE: ../../../third_party/dart/runtime/vm/program_visitor.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode_inl.h +FILE: ../../../third_party/dart/runtime/vm/regexp_bytecodes.h +FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.h +FILE: ../../../third_party/dart/runtime/vm/scope_timer.h +FILE: ../../../third_party/dart/runtime/vm/service_event.cc +FILE: ../../../third_party/dart/runtime/vm/service_event.h +FILE: ../../../third_party/dart/runtime/vm/service_isolate.cc +FILE: ../../../third_party/dart/runtime/vm/source_report.cc +FILE: ../../../third_party/dart/runtime/vm/source_report.h +FILE: ../../../third_party/dart/runtime/vm/source_report_test.cc +FILE: ../../../third_party/dart/runtime/vm/thread.cc +FILE: ../../../third_party/dart/runtime/vm/thread.h +FILE: ../../../third_party/dart/runtime/vm/thread_barrier.h +FILE: ../../../third_party/dart/runtime/vm/thread_barrier_test.cc +FILE: ../../../third_party/dart/runtime/vm/thread_registry.cc +FILE: ../../../third_party/dart/runtime/vm/thread_registry.h +FILE: ../../../third_party/dart/runtime/vm/timeline.cc +FILE: ../../../third_party/dart/runtime/vm/timeline.h +FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.cc +FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.h +FILE: ../../../third_party/dart/runtime/vm/timeline_test.cc +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/developer_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/d8.js +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart +FILE: ../../../third_party/dart/sdk/lib/convert/base64.dart +FILE: ../../../third_party/dart/sdk/lib/dart_client.platform +FILE: ../../../third_party/dart/sdk/lib/dart_server.platform +FILE: ../../../third_party/dart/sdk/lib/dart_shared.platform +FILE: ../../../third_party/dart/sdk/lib/developer/developer.dart +FILE: ../../../third_party/dart/sdk/lib/developer/extension.dart +FILE: ../../../third_party/dart/sdk/lib/developer/timeline.dart +FILE: ../../../third_party/dart/sdk/lib/io/io_resource_info.dart +FILE: ../../../third_party/dart/sdk/lib/io/security_context.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/asset.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/vmservice.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -5854,107 +5617,316 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/process_test.cc + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/server.dart + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/process_test.cc -FILE: ../../../third_party/dart/runtime/bin/snapshot_empty.cc -FILE: ../../../third_party/dart/runtime/bin/snapshot_in.cc -FILE: ../../../third_party/dart/runtime/include/dart_tools_api.h -FILE: ../../../third_party/dart/runtime/lib/double.cc -FILE: ../../../third_party/dart/runtime/lib/math.cc -FILE: ../../../third_party/dart/runtime/lib/mirrors.h -FILE: ../../../third_party/dart/runtime/lib/object.cc -FILE: ../../../third_party/dart/runtime/lib/string.cc -FILE: ../../../third_party/dart/runtime/platform/c99_support_win.h -FILE: ../../../third_party/dart/runtime/platform/inttypes_support_win.h -FILE: ../../../third_party/dart/runtime/vm/ast.cc -FILE: ../../../third_party/dart/runtime/vm/ast_printer.cc -FILE: ../../../third_party/dart/runtime/vm/ast_printer.h -FILE: ../../../third_party/dart/runtime/vm/bitfield.h -FILE: ../../../third_party/dart/runtime/vm/code_patcher_ia32_test.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_x64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler_stats.cc -FILE: ../../../third_party/dart/runtime/vm/compiler_stats.h -FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/custom_isolate_test.cc -FILE: ../../../third_party/dart/runtime/vm/dart.h -FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.h -FILE: ../../../third_party/dart/runtime/vm/dart_entry.cc -FILE: ../../../third_party/dart/runtime/vm/dart_entry.h -FILE: ../../../third_party/dart/runtime/vm/debugger_arm.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_x64.cc -FILE: ../../../third_party/dart/runtime/vm/double_conversion.cc -FILE: ../../../third_party/dart/runtime/vm/double_conversion.h -FILE: ../../../third_party/dart/runtime/vm/exceptions.cc -FILE: ../../../third_party/dart/runtime/vm/exceptions.h -FILE: ../../../third_party/dart/runtime/vm/freelist.cc -FILE: ../../../third_party/dart/runtime/vm/gc_marker.cc -FILE: ../../../third_party/dart/runtime/vm/gc_marker.h -FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.cc -FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.h -FILE: ../../../third_party/dart/runtime/vm/handles.h -FILE: ../../../third_party/dart/runtime/vm/longjump.cc -FILE: ../../../third_party/dart/runtime/vm/longjump.h -FILE: ../../../third_party/dart/runtime/vm/longjump_test.cc -FILE: ../../../third_party/dart/runtime/vm/memory_region.cc -FILE: ../../../third_party/dart/runtime/vm/message.cc -FILE: ../../../third_party/dart/runtime/vm/message.h -FILE: ../../../third_party/dart/runtime/vm/message_handler.cc -FILE: ../../../third_party/dart/runtime/vm/message_handler.h -FILE: ../../../third_party/dart/runtime/vm/native_entry.cc -FILE: ../../../third_party/dart/runtime/vm/native_entry.h -FILE: ../../../third_party/dart/runtime/vm/native_entry_test.cc -FILE: ../../../third_party/dart/runtime/vm/native_entry_test.h -FILE: ../../../third_party/dart/runtime/vm/object_store_test.cc -FILE: ../../../third_party/dart/runtime/vm/os.h -FILE: ../../../third_party/dart/runtime/vm/pages.h -FILE: ../../../third_party/dart/runtime/vm/parser_test.cc -FILE: ../../../third_party/dart/runtime/vm/port.h -FILE: ../../../third_party/dart/runtime/vm/resolver.cc -FILE: ../../../third_party/dart/runtime/vm/resolver.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_list.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_x64.cc -FILE: ../../../third_party/dart/runtime/vm/scanner.h -FILE: ../../../third_party/dart/runtime/vm/scavenger.cc -FILE: ../../../third_party/dart/runtime/vm/stack_frame.h -FILE: ../../../third_party/dart/runtime/vm/stub_code.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32_test.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_x64_test.cc -FILE: ../../../third_party/dart/runtime/vm/timer.cc -FILE: ../../../third_party/dart/runtime/vm/timer.h -FILE: ../../../third_party/dart/runtime/vm/token.cc -FILE: ../../../third_party/dart/runtime/vm/unicode_data.cc -FILE: ../../../third_party/dart/runtime/vm/unicode_test.cc -FILE: ../../../third_party/dart/runtime/vm/unit_test.h -FILE: ../../../third_party/dart/runtime/vm/verifier.h -FILE: ../../../third_party/dart/runtime/vm/visitor.h -FILE: ../../../third_party/dart/sdk/lib/collection/queue.dart -FILE: ../../../third_party/dart/sdk/lib/core/comparable.dart -FILE: ../../../third_party/dart/sdk/lib/core/date_time.dart -FILE: ../../../third_party/dart/sdk/lib/core/duration.dart -FILE: ../../../third_party/dart/sdk/lib/core/function.dart -FILE: ../../../third_party/dart/sdk/lib/core/iterable.dart -FILE: ../../../third_party/dart/sdk/lib/core/map.dart -FILE: ../../../third_party/dart/sdk/lib/core/pattern.dart -FILE: ../../../third_party/dart/sdk/lib/core/set.dart -FILE: ../../../third_party/dart/sdk/lib/core/stopwatch.dart -FILE: ../../../third_party/dart/sdk/lib/core/string_buffer.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/device.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/filtered_element_list.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/lists.dart -FILE: ../../../third_party/dart/sdk/lib/internal/iterable.dart -FILE: ../../../third_party/dart/sdk/lib/internal/sort.dart -FILE: ../../../third_party/dart/utils/peg/pegparser.dart +FILE: ../../../third_party/dart/WATCHLISTS +FILE: ../../../third_party/dart/runtime/bin/eventhandler_win.cc +FILE: ../../../third_party/dart/runtime/bin/file.cc +FILE: ../../../third_party/dart/runtime/bin/file.h +FILE: ../../../third_party/dart/runtime/bin/file_system_entity_patch.dart +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.cc +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.h +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_android.cc +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_linux.cc +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_macos.cc +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_win.cc +FILE: ../../../third_party/dart/runtime/bin/filter.cc +FILE: ../../../third_party/dart/runtime/bin/filter.h +FILE: ../../../third_party/dart/runtime/bin/filter_patch.dart +FILE: ../../../third_party/dart/runtime/bin/gen_snapshot.cc +FILE: ../../../third_party/dart/runtime/bin/io_natives.cc +FILE: ../../../third_party/dart/runtime/bin/io_service.cc +FILE: ../../../third_party/dart/runtime/bin/io_service.h +FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.cc +FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.h +FILE: ../../../third_party/dart/runtime/bin/io_service_patch.dart +FILE: ../../../third_party/dart/runtime/bin/process.cc +FILE: ../../../third_party/dart/runtime/bin/process_patch.dart +FILE: ../../../third_party/dart/runtime/bin/socket.cc +FILE: ../../../third_party/dart/runtime/bin/socket.h +FILE: ../../../third_party/dart/runtime/bin/socket_base_linux.cc +FILE: ../../../third_party/dart/runtime/bin/socket_base_macos.cc +FILE: ../../../third_party/dart/runtime/bin/socket_base_win.cc +FILE: ../../../third_party/dart/runtime/bin/socket_linux.cc +FILE: ../../../third_party/dart/runtime/bin/socket_macos.cc +FILE: ../../../third_party/dart/runtime/bin/socket_patch.dart +FILE: ../../../third_party/dart/runtime/bin/socket_win.cc +FILE: ../../../third_party/dart/runtime/bin/stdio.cc +FILE: ../../../third_party/dart/runtime/bin/stdio.h +FILE: ../../../third_party/dart/runtime/bin/stdio_android.cc +FILE: ../../../third_party/dart/runtime/bin/stdio_linux.cc +FILE: ../../../third_party/dart/runtime/bin/stdio_macos.cc +FILE: ../../../third_party/dart/runtime/bin/stdio_patch.dart +FILE: ../../../third_party/dart/runtime/bin/stdio_win.cc +FILE: ../../../third_party/dart/runtime/bin/vmservice/server.dart +FILE: ../../../third_party/dart/runtime/bin/vmservice/vmservice_io.dart +FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.cc +FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.h +FILE: ../../../third_party/dart/runtime/include/dart_mirrors_api.h +FILE: ../../../third_party/dart/runtime/include/dart_native_api.h +FILE: ../../../third_party/dart/runtime/lib/collection_patch.dart +FILE: ../../../third_party/dart/runtime/lib/core_patch.dart +FILE: ../../../third_party/dart/runtime/lib/deferred_load_patch.dart +FILE: ../../../third_party/dart/runtime/lib/function.dart +FILE: ../../../third_party/dart/runtime/lib/internal_patch.dart +FILE: ../../../third_party/dart/runtime/lib/invocation_mirror.h +FILE: ../../../third_party/dart/runtime/lib/libgen_in.cc +FILE: ../../../third_party/dart/runtime/lib/mirror_reference.dart +FILE: ../../../third_party/dart/runtime/lib/null_patch.dart +FILE: ../../../third_party/dart/runtime/lib/schedule_microtask_patch.dart +FILE: ../../../third_party/dart/runtime/lib/simd128.cc +FILE: ../../../third_party/dart/runtime/lib/stacktrace.cc +FILE: ../../../third_party/dart/runtime/lib/stacktrace.dart +FILE: ../../../third_party/dart/runtime/lib/symbol_patch.dart +FILE: ../../../third_party/dart/runtime/lib/timer_impl.dart +FILE: ../../../third_party/dart/runtime/lib/typed_data.cc +FILE: ../../../third_party/dart/runtime/lib/typed_data_patch.dart +FILE: ../../../third_party/dart/runtime/lib/uri.cc +FILE: ../../../third_party/dart/runtime/lib/uri_patch.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/application.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/location_manager.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_instances.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile_table.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/curly_block.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/eval_box.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/flag_list.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/any_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/json_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/local_var_descriptors_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/native_memory_profiler.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_common.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectstore_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/observatory_application.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/pc_descriptors_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sample_buffer_control.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_inset.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_value.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_inset.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/stack_trace_tree_config.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/token_stream_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/type_arguments_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unknown_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/tracer.dart +FILE: ../../../third_party/dart/runtime/platform/atomic.h +FILE: ../../../third_party/dart/runtime/platform/atomic_android.h +FILE: ../../../third_party/dart/runtime/platform/atomic_linux.h +FILE: ../../../third_party/dart/runtime/platform/atomic_macos.h +FILE: ../../../third_party/dart/runtime/platform/atomic_win.h +FILE: ../../../third_party/dart/runtime/platform/signal_blocker.h +FILE: ../../../third_party/dart/runtime/vm/allocation.h +FILE: ../../../third_party/dart/runtime/vm/class_finalizer.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_x64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.h +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_x64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.cc +FILE: ../../../third_party/dart/runtime/vm/constants_arm.h +FILE: ../../../third_party/dart/runtime/vm/constants_ia32.h +FILE: ../../../third_party/dart/runtime/vm/constants_x64.h +FILE: ../../../third_party/dart/runtime/vm/dart.cc +FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.cc +FILE: ../../../third_party/dart/runtime/vm/deferred_objects.cc +FILE: ../../../third_party/dart/runtime/vm/deferred_objects.h +FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.cc +FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.h +FILE: ../../../third_party/dart/runtime/vm/guard_field_test.cc +FILE: ../../../third_party/dart/runtime/vm/instructions.h +FILE: ../../../third_party/dart/runtime/vm/instructions_arm.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_arm.h +FILE: ../../../third_party/dart/runtime/vm/instructions_arm_test.cc +FILE: ../../../third_party/dart/runtime/vm/isolate.cc +FILE: ../../../third_party/dart/runtime/vm/isolate.h +FILE: ../../../third_party/dart/runtime/vm/json_stream.cc +FILE: ../../../third_party/dart/runtime/vm/json_stream.h +FILE: ../../../third_party/dart/runtime/vm/mirrors_api_impl.cc +FILE: ../../../third_party/dart/runtime/vm/native_api_impl.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol.h +FILE: ../../../third_party/dart/runtime/vm/native_symbol_android.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol_linux.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol_macos.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol_win.cc +FILE: ../../../third_party/dart/runtime/vm/object_id_ring.cc +FILE: ../../../third_party/dart/runtime/vm/object_id_ring.h +FILE: ../../../third_party/dart/runtime/vm/object_id_ring_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_store.cc +FILE: ../../../third_party/dart/runtime/vm/os_test.cc +FILE: ../../../third_party/dart/runtime/vm/profiler.cc +FILE: ../../../third_party/dart/runtime/vm/profiler.h +FILE: ../../../third_party/dart/runtime/vm/profiler_test.cc +FILE: ../../../third_party/dart/runtime/vm/random.cc +FILE: ../../../third_party/dart/runtime/vm/random.h +FILE: ../../../third_party/dart/runtime/vm/reusable_handles.h +FILE: ../../../third_party/dart/runtime/vm/service.cc +FILE: ../../../third_party/dart/runtime/vm/service.h +FILE: ../../../third_party/dart/runtime/vm/service_isolate.h +FILE: ../../../third_party/dart/runtime/vm/service_test.cc +FILE: ../../../third_party/dart/runtime/vm/signal_handler.h +FILE: ../../../third_party/dart/runtime/vm/signal_handler_android.cc +FILE: ../../../third_party/dart/runtime/vm/signal_handler_linux.cc +FILE: ../../../third_party/dart/runtime/vm/signal_handler_macos.cc +FILE: ../../../third_party/dart/runtime/vm/signal_handler_win.cc +FILE: ../../../third_party/dart/runtime/vm/simulator.h +FILE: ../../../third_party/dart/runtime/vm/simulator_arm.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_ia32.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_x64.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm_test.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_x64.cc +FILE: ../../../third_party/dart/runtime/vm/tags.h +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.cc +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.h +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_android.cc +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_linux.cc +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_macos.cc +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_win.cc +FILE: ../../../third_party/dart/runtime/vm/weak_table.cc +FILE: ../../../third_party/dart/runtime/vm/weak_table.h +FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http_headers.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http_impl.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http_parser.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http_session.dart +FILE: ../../../third_party/dart/sdk/lib/_http/websocket.dart +FILE: ../../../third_party/dart/sdk/lib/_http/websocket_impl.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/annotations.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/collection_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/convert_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/internal_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/io_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_helper.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_names.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_primitives.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_rti.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart +FILE: ../../../third_party/dart/sdk/lib/async/deferred_load.dart +FILE: ../../../third_party/dart/sdk/lib/async/schedule_microtask.dart +FILE: ../../../third_party/dart/sdk/lib/async/stream.dart +FILE: ../../../third_party/dart/sdk/lib/async/stream_transformers.dart +FILE: ../../../third_party/dart/sdk/lib/async/zone.dart +FILE: ../../../third_party/dart/sdk/lib/collection/collections.dart +FILE: ../../../third_party/dart/sdk/lib/collection/hash_map.dart +FILE: ../../../third_party/dart/sdk/lib/collection/hash_set.dart +FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_map.dart +FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_set.dart +FILE: ../../../third_party/dart/sdk/lib/collection/linked_list.dart +FILE: ../../../third_party/dart/sdk/lib/collection/list.dart +FILE: ../../../third_party/dart/sdk/lib/convert/ascii.dart +FILE: ../../../third_party/dart/sdk/lib/convert/byte_conversion.dart +FILE: ../../../third_party/dart/sdk/lib/convert/chunked_conversion.dart +FILE: ../../../third_party/dart/sdk/lib/convert/codec.dart +FILE: ../../../third_party/dart/sdk/lib/convert/convert.dart +FILE: ../../../third_party/dart/sdk/lib/convert/converter.dart +FILE: ../../../third_party/dart/sdk/lib/convert/encoding.dart +FILE: ../../../third_party/dart/sdk/lib/convert/html_escape.dart +FILE: ../../../third_party/dart/sdk/lib/convert/json.dart +FILE: ../../../third_party/dart/sdk/lib/convert/latin1.dart +FILE: ../../../third_party/dart/sdk/lib/convert/line_splitter.dart +FILE: ../../../third_party/dart/sdk/lib/convert/string_conversion.dart +FILE: ../../../third_party/dart/sdk/lib/convert/utf.dart +FILE: ../../../third_party/dart/sdk/lib/core/annotations.dart +FILE: ../../../third_party/dart/sdk/lib/core/null.dart +FILE: ../../../third_party/dart/sdk/lib/core/stacktrace.dart +FILE: ../../../third_party/dart/sdk/lib/core/string_sink.dart +FILE: ../../../third_party/dart/sdk/lib/core/symbol.dart +FILE: ../../../third_party/dart/sdk/lib/internal/list.dart +FILE: ../../../third_party/dart/sdk/lib/internal/print.dart +FILE: ../../../third_party/dart/sdk/lib/internal/symbol.dart +FILE: ../../../third_party/dart/sdk/lib/io/bytes_builder.dart +FILE: ../../../third_party/dart/sdk/lib/io/data_transformer.dart +FILE: ../../../third_party/dart/sdk/lib/io/file.dart +FILE: ../../../third_party/dart/sdk/lib/io/file_impl.dart +FILE: ../../../third_party/dart/sdk/lib/io/file_system_entity.dart +FILE: ../../../third_party/dart/sdk/lib/io/io_service.dart +FILE: ../../../third_party/dart/sdk/lib/io/io_sink.dart +FILE: ../../../third_party/dart/sdk/lib/io/link.dart +FILE: ../../../third_party/dart/sdk/lib/io/secure_socket.dart +FILE: ../../../third_party/dart/sdk/lib/io/socket.dart +FILE: ../../../third_party/dart/sdk/lib/io/stdio.dart +FILE: ../../../third_party/dart/sdk/lib/io/string_transformer.dart +FILE: ../../../third_party/dart/sdk/lib/js/dart2js/js_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/math/jenkins_smi_hash.dart +FILE: ../../../third_party/dart/sdk/lib/math/point.dart +FILE: ../../../third_party/dart/sdk/lib/math/rectangle.dart +FILE: ../../../third_party/dart/sdk/lib/mirrors/mirrors.dart +FILE: ../../../third_party/dart/sdk/lib/typed_data/typed_data.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/client.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/constants.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/message.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/message_router.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolate.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolates.dart +FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart +FILE: ../../../third_party/dart/utils/compiler/create_snapshot_entry.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -15027,64 +14999,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages LIBRARY: pkg -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/instrumentation/file_instrumentation.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/instrumentation/file_instrumentation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/command_line.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/resolver_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/task.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/analysis_options_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/embedder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/error_processor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/path_filter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/sdk_ext.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/cache.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/context.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/source.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/type_system.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/visitors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/command_line_plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/engine_plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/options_plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/plugin_configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/services/lint.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/format.fbs -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/idl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/public_namespace_computer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/resynthesize.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summarize_elements.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summary_sdk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/dart.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/dart_work_manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/driver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/general.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/html.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/html_work_manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/incremental_element_builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/inputs.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/model.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/options_work_manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/strong/checker.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/strong_mode.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/absolute_path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/asserts.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/glob.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/lru_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/yaml.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/dart.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/general.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/html.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/model.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/check_test.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/generate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/idl_model.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/task_dependency_graph/check_test.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/task_dependency_graph/generate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/task_dependency_graph/tasks.dot FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_memoizer.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/cancelable_operation.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart @@ -15103,85 +15019,14 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/as FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_splitter.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/subscription_stream.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/lib/cli_util.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/comparators.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/convert.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/hex.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/hex/decoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/hex/encoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/percent.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/percent/decoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/percent/encoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/example/hash.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/digest.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/digest_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/hash.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/bin/format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/example/format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/fast_hash.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/line_splitter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/rule_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/solve_state.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/solve_state_queue.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/nesting_builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/nesting_level.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/argument.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/combinator.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/metadata.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/rule.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/type_argument.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/tool/grind.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/build/initializer_plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/build/loader_replacer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/initialize.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/init_method.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/initialize_tracker.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/initializer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/mirror_loader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/static_loader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/test_package/lib/bar.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/test_package/lib/foo.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/example/http_server.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/example/runner_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/isolate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/isolate_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/load_balancer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/ports.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/registry.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/src/errors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/src/lists.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/src/raw_receive_port_multiplexer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/discovery.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/discovery_analysis.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/packages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/packages_file.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/src/packages_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/src/packages_io_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/src/util.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/plugin/lib/manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/plugin/lib/plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/plugin/lib/src/plugin_impl.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/location_mixin.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/unparsed_frame.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/eager_span_scanner.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/expected_function.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/group_context.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/shared.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/benchmark/path_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/file_watcher.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/file_watcher/native.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/file_watcher/polling.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/benchmark/benchmark.dart FILE: ../../../third_party/pkg/when/lib/when.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file @@ -15220,7 +15065,6 @@ LIBRARY: skia LIBRARY: vulkan ORIGIN: ../../../flutter/third_party/txt/LICENSE TYPE: LicenseType.apache -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/async.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/cache.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/check.dart @@ -15234,7 +15078,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/qu FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/concat.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/countdown_timer.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/enumerate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/future_group.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/future_stream.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/iteration.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/metronome.dart @@ -15267,6 +15110,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/qu FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/pattern/glob.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/clock.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/duration_unit_constants.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/util.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/strings.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/time.dart FILE: ../../../third_party/skia/src/images/SkWebpEncoder.cpp @@ -15480,14 +15324,8 @@ limitations under the License. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/viz.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/web_app.dart.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/tasks.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/package_bundle_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/build_sdk_summaries.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/.analysis_options @@ -15501,6 +15339,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cs FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/af.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/am.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar_DZ.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/az.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/be.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/bg.json @@ -15523,6 +15362,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IE.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IN.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ISO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_MY.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_SG.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_US.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ZA.json @@ -15538,6 +15378,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fil.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ga.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gl.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gsw.json @@ -15552,6 +15393,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/in.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/is.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/iw.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ja.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ka.json @@ -15580,11 +15422,13 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/or.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pa.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ps.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_BR.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_PT.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ro.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ru.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sd.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sh.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/si.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sk.json @@ -15611,6 +15455,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/af.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/am.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar_DZ.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/az.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/be.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/bg.json @@ -15633,6 +15478,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IE.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IN.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ISO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_MY.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_SG.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_US.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ZA.json @@ -15648,6 +15494,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fil.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ga.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gl.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gsw.json @@ -15662,6 +15509,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/in.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/is.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/iw.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ja.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ka.json @@ -15684,157 +15532,41 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/nb.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ne.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/nl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no_NO.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/or.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pa.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_BR.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_PT.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ro.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ru.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/si.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sq.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr_Latn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sv.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ta.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/te.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/th.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ur.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uz.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/vi.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_CN.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_HK.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_TW.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zu.json ----------------------------------------------------------------------------------------------------- -Copyright 2013, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/benchmark/errors_in_all_libraries.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/benchmark/errors_in_all_libraries.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/ast_factory.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/resolution_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/standard_ast_factory.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/standard_resolution_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/syntactic_entity.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/embedded_resolver_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/custom_resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/ast_factory.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/resolution_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/resolver/inheritance_manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/sdk/sdk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/error/pending_error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/bazel.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/package.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/source/source_resource.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/api_signature.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/bazel_summary.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/flat_buffers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/link.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/name_filter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/prelink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/pub_summary.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summarize_ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summarize_const_expr.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summary_file_builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/strong/ast_properties.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/yaml.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/fast_uri.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/yaml.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/dump_inferred_types.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/inspect.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/stats.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/null_stream_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/value.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/single_subscription_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_completer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/handler_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/stream_transformer_wrapper.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/typed.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_subscription_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream_subscription.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed_stream_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/empty_unmodifiable_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/functions.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/typed_wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set_controller.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/accumulator_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/byte_accumulator_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/string_accumulator_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/tool/node_format_service.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/compact_number_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/plural_rules.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/order_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/meta.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_record.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/list_diff.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/property_change_record.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/to_observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/relative_span_scanner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no_NO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/or.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pa.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ps.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_BR.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_PT.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ro.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ru.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/si.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sq.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr_Latn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sv.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ta.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/te.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/th.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ur.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uz.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/vi.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_CN.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_HK.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_TW.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zu.json ---------------------------------------------------------------------------------------------------- -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - +Copyright 2013, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -15864,124 +15596,77 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/dart.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/dart.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/example/parser_driver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/example/resolver_driver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/example/scanner_driver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/analyzer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/string_source.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/args.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/usage.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/async.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/stream_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/barback.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_forwarder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_id.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/internal_asset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/barback.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/build_result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/errors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/asset_cascade.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/group_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/package_graph.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_forwarder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_output.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/transform_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/log.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/package_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/serialize.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/barback_settings.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transform_logger.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer_group.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/cancelable_future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/file_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/multiset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_replayer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/dart.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/interop.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/messages/build_logger.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/algorithms.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/collection.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/iterable_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/algorithms.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/iterable_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/unmodifiable_wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/css.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/css_printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/polyfill.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/stream_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/pretty_print.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/context.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/parsed_path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/posix.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/url.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/windows.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/refactor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/source_maps.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/src/vlq.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/chain.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/frame.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/stack_zone_specification.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/vm_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/stack_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/typed_data/lib/typed_buffers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/typed_data/lib/typed_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/compact_vm_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_enhanced_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_individual_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/pretty_print.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/simple_configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/test_case.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/unittest.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/vm_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/example/watch.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/async_queue.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/constructable_file_system_event.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/linux.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/mac_os.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/polling.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/path_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/resubscribable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/stat.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/watch_event.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/watcher.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/simple_transformer/lib/transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/bin/css.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/analyzer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/messages.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/options.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/property.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/token.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer_base.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenkind.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_base.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/validate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/visitor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_file.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_http_request.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbols.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_browser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_standalone.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/message_lookup_by_library.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/locale_list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/date_format_internal.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/file_data_reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/http_request_data_reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_formatter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_field.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_helpers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/number_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl_helpers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/lazy_locale_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/tool/generate_locale_data_files.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/lib/logging.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/core_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/description.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/error_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/interfaces.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/iterable_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/map_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/numeric_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/operator_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/string_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/core_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/description.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/error_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/expect.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/future_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/interfaces.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/iterable_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/map_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/numeric_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/operator_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/string_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/constants.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/list_range.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf16.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf32.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf8.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_16_code_unit_decoder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/util.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/utf.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -16013,76 +15698,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/context/declared_variables.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/context/declared_variables.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/constant/value.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/element/element.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/element/type.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/element/visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/error/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/error/listener.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/exception/exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/file_system/file_system.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/file_system/memory_file_system.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/file_system/physical_file_system.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/instrumentation/instrumentation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/package_map_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/package_map_resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/pub_package_map_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/cancelable_future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/codegen/html.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/codegen/text_formatter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/codegen/tools.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/utilities.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/constant/evaluation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/constant/utilities.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/constant/value.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/element.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/handle.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/member.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/type.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/utilities.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/error/syntactic_errors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/resolver/scope.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/scanner/reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/scanner/scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/error/codes.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/constant.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/element.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/element_handle.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/element_resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/engine.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/error_verifier.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/incremental_logger.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/incremental_resolution_validator.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/incremental_resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/interner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_core.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_engine.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_engine_io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/sdk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/sdk_io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/source.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/source_io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/static_type_analyzer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/utilities_collection.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/utilities_dart.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/utilities_general.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/utilities_timing.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/command_runner.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_results.dart @@ -16113,45 +15730,11 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/ba FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/ascii.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/charcode.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/html_entity.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/assets.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/benchmarks.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/messages/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/async_benchmark_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/dart_sdk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/delete_file.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/entry_point.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/remove_sourcemap_comment.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/resolver_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/resolvers.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/priority_queue.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/canonicalized_map.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/priority_queue.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/queue_list.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/benchmark/benchmark.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/dart_style.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/argument_list_visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/call_chain_visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/chunk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/chunk_builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/dart_formatter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/debug.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/error_listener.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/formatter_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/formatter_options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_writer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/source_code.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/source_visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/whitespace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/glob.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/list_tree.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_time_patterns.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/.status @@ -16163,7 +15746,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pa FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/internal_style.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/lib/pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/src/source_map_span.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/source_span.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/colors.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/file.dart @@ -16173,12 +15755,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/so FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span_mixin.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span_with_context.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/line_scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/span_scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/string_scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/string_scanner.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/internal_test_case.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher.dart @@ -16196,17 +15772,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/us FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/usage_html.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/usage_io.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/tool/grind.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/windows.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/event.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/loader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/null_span.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/style.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_document.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_node_wrapper.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. @@ -16240,85 +15805,164 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/null_stream_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/error.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/result.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/value.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/single_subscription_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_completer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/handler_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/stream_transformer_wrapper.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/typed.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_subscription_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/future.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream_subscription.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed_stream_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/empty_unmodifiable_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/functions.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set_controller.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/compact_number_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/plural_rules.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/order_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/meta.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/observable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/list_diff.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/property_change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/to_observable.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/simple_transformer/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/crypto.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/hash_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/hmac.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/md5.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/sha1.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/sha256.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/bin/css.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/analyzer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/property.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenkind.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/validate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_file.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_http_request.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbols.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_browser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_standalone.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/message_lookup_by_library.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/locale_list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/date_format_internal.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/file_data_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/http_request_data_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_formatter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_field.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_helpers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/number_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl_helpers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/lazy_locale_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/tool/generate_locale_data_files.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/lib/logging.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/core_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/description.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/error_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/interfaces.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/iterable_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/map_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/numeric_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/operator_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/string_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/core_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/description.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/error_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/expect.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/future_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/interfaces.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/iterable_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/map_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/numeric_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/operator_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/string_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/constants.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/list_range.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf16.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf32.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf8.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_16_code_unit_decoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/util.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/utf.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/yaml.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/args.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/usage.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/async.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/barback.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_forwarder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_id.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/internal_asset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/barback.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/build_result.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/errors.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/asset_cascade.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/group_runner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/package_graph.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_forwarder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_output.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/transform_node.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/log.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/package_provider.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/serialize.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/barback_settings.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transform_logger.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer_group.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/cancelable_future.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/file_pool.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/multiset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_pool.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_replayer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/dart.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/interop.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/algorithms.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/collection.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/equality.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/iterable_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/algorithms.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/iterable_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/unmodifiable_wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/css.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/css_printer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/polyfill.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_printer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/pretty_print.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/context.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/parsed_path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/posix.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/url.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/windows.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/chain.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/frame.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/stack_zone_specification.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/vm_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/stack_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/compact_vm_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_enhanced_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_individual_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/configuration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/pretty_print.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/simple_configuration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/test_case.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/unittest.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/vm_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_stream.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -16352,16 +15996,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/tool/rename_build_outputs.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/typed_data/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/.test_config ---------------------------------------------------------------------------------------------------- Copyright 2015, the Dart project authors. All rights reserved. @@ -16398,9 +16034,6 @@ ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/ TYPE: LicenseType.bsd FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_cache.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/byte_collector.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/example/main.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/lib/cli_logging.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_iterable.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_list.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_map.dart @@ -16441,32 +16074,23 @@ LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/dist/dart-style.d.ts -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/web/index.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/web/main.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/compiler.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/encodings.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/libraries/Dart_Packages.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/libraries/Dart_SDK.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/misc.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/modules.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/pool.iml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/vcs.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/workspace.xml FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/benchmark/output.json ---------------------------------------------------------------------------------------------------- Copyright 2014, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -16704,7 +16328,7 @@ met: LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/LICENSE TYPE: LicenseType.mit -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/dom.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/dom_parsing.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/parser.dart @@ -16747,12 +16371,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2014, the Dart project authors. +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. @@ -16785,11 +16408,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols_data.dart ---------------------------------------------------------------------------------------------------- -Copyright 2016, the Dart project authors. All rights reserved. +Copyright (c) 2014, the Dart project authors. +Please see the AUTHORS file +for details. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16819,14 +16446,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/test_controller.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/.analysis_options ---------------------------------------------------------------------------------------------------- -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - +Copyright 2016, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16856,99 +16480,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/e2e_test/html_imports/lib/theme.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/bower.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/package.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/test_controller.js ---------------------------------------------------------------------------------------------------- -Copyright (c) 2012 The Polymer Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/CustomElements.js -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/CustomElements.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/CustomElements.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/HTMLImports.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/HTMLImports.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/MutationObserver.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/MutationObserver.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/ShadowDOM.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/ShadowDOM.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents-lite.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents-lite.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents.min.js ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014 The Polymer Authors. All rights reserved. +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop_support.html + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop_support.html ----------------------------------------------------------------------------------------------------- -Copyright 2014 The Dart project authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above @@ -16958,6 +16501,7 @@ met: * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -16971,35 +16515,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/libyaml-license.txt -TYPE: LicenseType.mit -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/benchmark/output.json ----------------------------------------------------------------------------------------------------- -Copyright (c) 2006 Kirill Simonov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -==================================================================================================== - ==================================================================================================== LIBRARY: rapidjson ORIGIN: ../../../third_party/rapidjson/rapidjson/error/en.h @@ -22399,4 +21914,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 320 +Total license count: 317 From 4883131507286def8cbd6f1ab9f32b0766c70c8c Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 4 Apr 2018 13:53:49 -0700 Subject: [PATCH 0052/1190] Set FlutterTexture copyPixelBuffer return nullable (#4934) This is to support Swift users, where nil is allowed for CVPixelBufferRef. --- shell/platform/darwin/ios/framework/Headers/FlutterTexture.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h b/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h index c755ebf7112de..f2b8670a8a9e2 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h @@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN FLUTTER_EXPORT @protocol FlutterTexture -- (CVPixelBufferRef)copyPixelBuffer; +- (CVPixelBufferRef _Nullable)copyPixelBuffer; @end FLUTTER_EXPORT From 2ef8e3039603e7f3dda0a98deacb7b14c64aba71 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 4 Apr 2018 14:01:21 -0700 Subject: [PATCH 0053/1190] libtxt: render fake bold text if a bold font is not available (#4933) Fixes https://github.com/flutter/flutter/issues/16149 --- third_party/txt/src/txt/paragraph.cc | 33 +++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index b2d4f7c70fc6c..cad44199e7e70 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -43,10 +43,31 @@ namespace txt { namespace { -const sk_sp& GetTypefaceForGlyph(const minikin::Layout& layout, - size_t index) { +class GlyphTypeface { + public: + GlyphTypeface(sk_sp typeface, minikin::FontFakery fakery) + : typeface_(std::move(typeface)), fake_bold_(fakery.isFakeBold()) {} + + bool operator==(GlyphTypeface& other) { + return other.typeface_.get() == typeface_.get() && + other.fake_bold_ == fake_bold_; + } + + bool operator!=(GlyphTypeface& other) { return !(*this == other); } + + void apply(SkPaint& paint) { + paint.setTypeface(typeface_); + paint.setFakeBoldText(fake_bold_); + } + + private: + sk_sp typeface_; + bool fake_bold_; +}; + +GlyphTypeface GetGlyphTypeface(const minikin::Layout& layout, size_t index) { const FontSkia* font = static_cast(layout.getFont(index)); - return font->GetSkTypeface(); + return GlyphTypeface(font->GetSkTypeface(), layout.getFakery(index)); } // Return ranges of text that have the same typeface in the layout. @@ -56,9 +77,9 @@ std::vector> GetLayoutTypefaceRuns( if (layout.nGlyphs() == 0) return result; size_t run_start = 0; - const SkTypeface* run_typeface = GetTypefaceForGlyph(layout, run_start).get(); + GlyphTypeface run_typeface = GetGlyphTypeface(layout, run_start); for (size_t i = 1; i < layout.nGlyphs(); ++i) { - const SkTypeface* typeface = GetTypefaceForGlyph(layout, i).get(); + GlyphTypeface typeface = GetGlyphTypeface(layout, i); if (typeface != run_typeface) { result.emplace_back(run_start, i); run_start = i; @@ -524,7 +545,7 @@ void Paragraph::Layout(double width, bool force) { for (const Range& glyph_blob : glyph_blobs) { std::vector glyph_positions; - paint.setTypeface(GetTypefaceForGlyph(layout, glyph_blob.start)); + GetGlyphTypeface(layout, glyph_blob.start).apply(paint); const SkTextBlobBuilder::RunBuffer& blob_buffer = builder.allocRunPos(paint, glyph_blob.end - glyph_blob.start); From 23c0b7bbf77762d774cb96f93af0016776ec60c4 Mon Sep 17 00:00:00 2001 From: Siva Date: Wed, 4 Apr 2018 16:32:06 -0700 Subject: [PATCH 0054/1190] Revert "Roll dart to 4bcf8ad411bd90da16d44ad399bf350e8423eac9" (#4936) * Revert "Roll dart to 4bcf8ad411bd90da16d44ad399bf350e8423eac9 (#4929)" --- DEPS | 10 +- travis/licenses_golden/licenses_third_party | 3803 +++++++++++-------- 2 files changed, 2149 insertions(+), 1664 deletions(-) diff --git a/DEPS b/DEPS index eb6c3ba308f7f..2cca21e22cd8f 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '4bcf8ad411bd90da16d44ad399bf350e8423eac9', + 'dart_revision': '52afcba357ad398e8c24f3e3363ac6ff5293df63', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -48,7 +48,7 @@ vars = { 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.5+1', 'dart_dart_style_tag': '1.0.10', - 'dart_dartdoc_tag': 'v0.18.1', + 'dart_dartdoc_tag': 'v0.18.0', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', @@ -68,15 +68,15 @@ vars = { 'dart_mockito_tag': 'a92db054fba18bc2d605be7670aee74b7cadc00a', 'dart_mustache4dart_tag': 'v2.1.0', 'dart_oauth2_tag': '1.1.0', - 'dart_observatory_pub_packages_rev': 'd3a3aebefbd35aa30fe7bbc2889b772b398f7d7f', + 'dart_observatory_pub_packages_rev': '4c282bb240b68f407c8c7779a65c68eeb0139dc6', 'dart_package_config_tag': '1.0.3', 'dart_package_resolver_tag': '1.0.2+1', 'dart_path_tag': '1.5.1', 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', - 'dart_pub_semver_tag': '1.3.4', + 'dart_pub_rev': '875d35005a7d33f367d70a3e31e9d3bad5d1ebd8', + 'dart_pub_semver_tag': '1.3.2', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d6c9148867fe5..b6551f20cfa47 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c38fa8133a5c87e15329c5b7f037824d +Signature: 6d40c6cdc2b0a27173677e57f49fb54a UNUSED LICENSES: @@ -4202,126 +4202,110 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/loader.dart + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/lib/bigint.dart -FILE: ../../../third_party/dart/runtime/lib/class_id.cc -FILE: ../../../third_party/dart/runtime/lib/class_id.dart -FILE: ../../../third_party/dart/runtime/lib/convert_patch.dart -FILE: ../../../third_party/dart/runtime/lib/lib_prefix.dart -FILE: ../../../third_party/dart/runtime/lib/linked_hash_map.cc -FILE: ../../../third_party/dart/runtime/lib/profiler.cc -FILE: ../../../third_party/dart/runtime/lib/profiler.dart -FILE: ../../../third_party/dart/runtime/observatory/bin/shell.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/app.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_common.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_html.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_io.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/utils.dart -FILE: ../../../third_party/dart/runtime/observatory/web/main.dart -FILE: ../../../third_party/dart/runtime/platform/address_sanitizer.h -FILE: ../../../third_party/dart/runtime/platform/math.h -FILE: ../../../third_party/dart/runtime/platform/memory_sanitizer.h -FILE: ../../../third_party/dart/runtime/platform/safe_stack.h -FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart -FILE: ../../../third_party/dart/runtime/vm/ast_transformer.cc -FILE: ../../../third_party/dart/runtime/vm/ast_transformer.h -FILE: ../../../third_party/dart/runtime/vm/bigint_test.cc -FILE: ../../../third_party/dart/runtime/vm/bit_set_test.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h -FILE: ../../../third_party/dart/runtime/vm/constants_arm64.h -FILE: ../../../third_party/dart/runtime/vm/cpu_arm.h -FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.h -FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.h -FILE: ../../../third_party/dart/runtime/vm/cpu_x64.h -FILE: ../../../third_party/dart/runtime/vm/cpuid.cc -FILE: ../../../third_party/dart/runtime/vm/cpuid.h -FILE: ../../../third_party/dart/runtime/vm/cpuinfo.h -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_test.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/hash_table.h -FILE: ../../../third_party/dart/runtime/vm/hash_table_test.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.h -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/metrics.cc -FILE: ../../../third_party/dart/runtime/vm/metrics.h -FILE: ../../../third_party/dart/runtime/vm/metrics_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_graph.cc -FILE: ../../../third_party/dart/runtime/vm/object_graph.h -FILE: ../../../third_party/dart/runtime/vm/object_graph_test.cc -FILE: ../../../third_party/dart/runtime/vm/regexp.cc -FILE: ../../../third_party/dart/runtime/vm/regexp.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h -FILE: ../../../third_party/dart/runtime/vm/regexp_ast.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_ast.h -FILE: ../../../third_party/dart/runtime/vm/regexp_parser.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_parser.h -FILE: ../../../third_party/dart/runtime/vm/regexp_test.cc -FILE: ../../../third_party/dart/runtime/vm/report.cc -FILE: ../../../third_party/dart/runtime/vm/report.h -FILE: ../../../third_party/dart/runtime/vm/ring_buffer.h -FILE: ../../../third_party/dart/runtime/vm/ring_buffer_test.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/scavenger_test.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.h -FILE: ../../../third_party/dart/runtime/vm/spaces.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/tags.cc -FILE: ../../../third_party/dart/runtime/vm/unibrow-inl.h -FILE: ../../../third_party/dart/runtime/vm/unibrow.cc -FILE: ../../../third_party/dart/runtime/vm/unibrow.h -FILE: ../../../third_party/dart/runtime/vm/verified_memory_test.cc -FILE: ../../../third_party/dart/runtime/vm/weak_code.cc -FILE: ../../../third_party/dart/runtime/vm/weak_code.h -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_serialization.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart -FILE: ../../../third_party/dart/sdk/lib/collection/set.dart -FILE: ../../../third_party/dart/sdk/lib/core/sink.dart -FILE: ../../../third_party/dart/sdk/lib/developer/profiler.dart -FILE: ../../../third_party/dart/sdk/lib/io/process.dart -FILE: ../../../third_party/dart/sdk/lib/io/service_object.dart -FILE: ../../../third_party/dart/sdk/lib/isolate/capability.dart -FILE: ../../../third_party/dart/sdk/lib/profiler/profiler.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/css_class_set.dart +FILE: ../../../third_party/dart/runtime/bin/address_sanitizer.cc +FILE: ../../../third_party/dart/runtime/bin/builtin_common.cc +FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.cc +FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.h +FILE: ../../../third_party/dart/runtime/bin/observatory_assets_empty.cc +FILE: ../../../third_party/dart/runtime/bin/vmservice/loader.dart +FILE: ../../../third_party/dart/runtime/lib/async_patch.dart +FILE: ../../../third_party/dart/runtime/lib/compact_hash.dart +FILE: ../../../third_party/dart/runtime/lib/developer.cc +FILE: ../../../third_party/dart/runtime/lib/developer.dart +FILE: ../../../third_party/dart/runtime/lib/timeline.cc +FILE: ../../../third_party/dart/runtime/lib/timeline.dart +FILE: ../../../third_party/dart/runtime/lib/vmservice.cc +FILE: ../../../third_party/dart/runtime/observatory/lib/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/cli.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/sample_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/allocation_profile/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/analytics.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/cli/command.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger_location.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging_list.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/persistent_handles.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/ports.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline_page.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/view_footer.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/sample_profile/sample_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/web/timeline.js +FILE: ../../../third_party/dart/runtime/vm/atomic_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.h +FILE: ../../../third_party/dart/runtime/vm/log.cc +FILE: ../../../third_party/dart/runtime/vm/log.h +FILE: ../../../third_party/dart/runtime/vm/log_test.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread.cc +FILE: ../../../third_party/dart/runtime/vm/profiler_service.cc +FILE: ../../../third_party/dart/runtime/vm/profiler_service.h +FILE: ../../../third_party/dart/runtime/vm/program_visitor.cc +FILE: ../../../third_party/dart/runtime/vm/program_visitor.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode_inl.h +FILE: ../../../third_party/dart/runtime/vm/regexp_bytecodes.h +FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.h +FILE: ../../../third_party/dart/runtime/vm/scope_timer.h +FILE: ../../../third_party/dart/runtime/vm/service_event.cc +FILE: ../../../third_party/dart/runtime/vm/service_event.h +FILE: ../../../third_party/dart/runtime/vm/service_isolate.cc +FILE: ../../../third_party/dart/runtime/vm/source_report.cc +FILE: ../../../third_party/dart/runtime/vm/source_report.h +FILE: ../../../third_party/dart/runtime/vm/source_report_test.cc +FILE: ../../../third_party/dart/runtime/vm/thread.cc +FILE: ../../../third_party/dart/runtime/vm/thread.h +FILE: ../../../third_party/dart/runtime/vm/thread_barrier.h +FILE: ../../../third_party/dart/runtime/vm/thread_barrier_test.cc +FILE: ../../../third_party/dart/runtime/vm/thread_registry.cc +FILE: ../../../third_party/dart/runtime/vm/thread_registry.h +FILE: ../../../third_party/dart/runtime/vm/timeline.cc +FILE: ../../../third_party/dart/runtime/vm/timeline.h +FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.cc +FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.h +FILE: ../../../third_party/dart/runtime/vm/timeline_test.cc +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/developer_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/d8.js +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart +FILE: ../../../third_party/dart/sdk/lib/convert/base64.dart +FILE: ../../../third_party/dart/sdk/lib/dart_client.platform +FILE: ../../../third_party/dart/sdk/lib/dart_server.platform +FILE: ../../../third_party/dart/sdk/lib/dart_shared.platform +FILE: ../../../third_party/dart/sdk/lib/developer/developer.dart +FILE: ../../../third_party/dart/sdk/lib/developer/extension.dart +FILE: ../../../third_party/dart/sdk/lib/developer/timeline.dart +FILE: ../../../third_party/dart/sdk/lib/io/io_resource_info.dart +FILE: ../../../third_party/dart/sdk/lib/io/security_context.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/asset.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/vmservice.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/common.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/html_import_annotation_recorder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/import_inliner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/messages.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/mirrors_remover.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/script_compactor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/test_compatibility.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/web_components.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/custom_element_proxy.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/html_import_annotation.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/init.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/custom_element.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/init.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/normalize_path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/web_components.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -4351,1273 +4335,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/.mailmap -FILE: ../../../third_party/dart/client/idea/.idea/.name -FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Default.xml -FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml -FILE: ../../../third_party/dart/runtime/CPPLINT.cfg -FILE: ../../../third_party/dart/runtime/observatory/.analysis_options -FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/isolate_icon.png -FILE: ../../../third_party/dart/runtime/observatory/maintainers/pubspec.template -FILE: ../../../third_party/dart/runtime/observatory/web/favicon.ico -FILE: ../../../third_party/dart/runtime/observatory/web/index.html -FILE: ../../../third_party/dart/runtime/observatory/web/third_party/trace_viewer_full.html -FILE: ../../../third_party/dart/runtime/observatory/web/timeline.html -FILE: ../../../third_party/dart/runtime/vm/snapshot_test_in.dat -FILE: ../../../third_party/dart/samples/build_dart/test.foo -FILE: ../../../third_party/dart/samples/build_dart_simple/test.foo -FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common.dart -FILE: ../../../third_party/dart/sdk/lib/libraries.json -FILE: ../../../third_party/dart/sdk/lib/vmservice_libraries.json -FILE: ../../../third_party/dart/third_party/7zip.tar.gz.sha1 -FILE: ../../../third_party/dart/third_party/clang.tar.gz.sha1 -FILE: ../../../third_party/dart/third_party/gsutil.tar.gz.sha1 ----------------------------------------------------------------------------------------------------- -Copyright 2012, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/client/dart.js + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/DEPS -FILE: ../../../third_party/dart/client/dart.js -FILE: ../../../third_party/dart/runtime/bin/builtin.cc -FILE: ../../../third_party/dart/runtime/bin/builtin.dart -FILE: ../../../third_party/dart/runtime/bin/builtin.h -FILE: ../../../third_party/dart/runtime/bin/builtin_gen_snapshot.cc -FILE: ../../../third_party/dart/runtime/bin/builtin_in.cc -FILE: ../../../third_party/dart/runtime/bin/builtin_natives.cc -FILE: ../../../third_party/dart/runtime/bin/builtin_nolib.cc -FILE: ../../../third_party/dart/runtime/bin/common_patch.dart -FILE: ../../../third_party/dart/runtime/bin/crypto.cc -FILE: ../../../third_party/dart/runtime/bin/crypto.h -FILE: ../../../third_party/dart/runtime/bin/crypto_android.cc -FILE: ../../../third_party/dart/runtime/bin/crypto_linux.cc -FILE: ../../../third_party/dart/runtime/bin/crypto_macos.cc -FILE: ../../../third_party/dart/runtime/bin/crypto_win.cc -FILE: ../../../third_party/dart/runtime/bin/dartutils.cc -FILE: ../../../third_party/dart/runtime/bin/dartutils.h -FILE: ../../../third_party/dart/runtime/bin/directory.cc -FILE: ../../../third_party/dart/runtime/bin/directory.h -FILE: ../../../third_party/dart/runtime/bin/directory_android.cc -FILE: ../../../third_party/dart/runtime/bin/directory_linux.cc -FILE: ../../../third_party/dart/runtime/bin/directory_macos.cc -FILE: ../../../third_party/dart/runtime/bin/directory_patch.dart -FILE: ../../../third_party/dart/runtime/bin/directory_win.cc -FILE: ../../../third_party/dart/runtime/bin/eventhandler.cc -FILE: ../../../third_party/dart/runtime/bin/eventhandler.h -FILE: ../../../third_party/dart/runtime/bin/eventhandler_android.cc -FILE: ../../../third_party/dart/runtime/bin/eventhandler_android.h -FILE: ../../../third_party/dart/runtime/bin/eventhandler_linux.cc -FILE: ../../../third_party/dart/runtime/bin/eventhandler_linux.h -FILE: ../../../third_party/dart/runtime/bin/eventhandler_macos.cc -FILE: ../../../third_party/dart/runtime/bin/eventhandler_macos.h -FILE: ../../../third_party/dart/runtime/bin/eventhandler_patch.dart -FILE: ../../../third_party/dart/runtime/bin/eventhandler_test.cc -FILE: ../../../third_party/dart/runtime/bin/eventhandler_win.h -FILE: ../../../third_party/dart/runtime/bin/extensions.cc -FILE: ../../../third_party/dart/runtime/bin/extensions.h -FILE: ../../../third_party/dart/runtime/bin/extensions_android.cc -FILE: ../../../third_party/dart/runtime/bin/extensions_linux.cc -FILE: ../../../third_party/dart/runtime/bin/extensions_macos.cc -FILE: ../../../third_party/dart/runtime/bin/extensions_win.cc -FILE: ../../../third_party/dart/runtime/bin/fdutils.h -FILE: ../../../third_party/dart/runtime/bin/fdutils_android.cc -FILE: ../../../third_party/dart/runtime/bin/fdutils_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/fdutils_linux.cc -FILE: ../../../third_party/dart/runtime/bin/fdutils_macos.cc -FILE: ../../../third_party/dart/runtime/bin/file_android.cc -FILE: ../../../third_party/dart/runtime/bin/file_linux.cc -FILE: ../../../third_party/dart/runtime/bin/file_macos.cc -FILE: ../../../third_party/dart/runtime/bin/file_patch.dart -FILE: ../../../third_party/dart/runtime/bin/file_test.cc -FILE: ../../../third_party/dart/runtime/bin/file_win.cc -FILE: ../../../third_party/dart/runtime/bin/hashmap_test.cc -FILE: ../../../third_party/dart/runtime/bin/io_buffer.cc -FILE: ../../../third_party/dart/runtime/bin/io_buffer.h -FILE: ../../../third_party/dart/runtime/bin/io_natives.h -FILE: ../../../third_party/dart/runtime/bin/isolate_data.h -FILE: ../../../third_party/dart/runtime/bin/lockers.h -FILE: ../../../third_party/dart/runtime/bin/log.h -FILE: ../../../third_party/dart/runtime/bin/log_android.cc -FILE: ../../../third_party/dart/runtime/bin/log_linux.cc -FILE: ../../../third_party/dart/runtime/bin/log_macos.cc -FILE: ../../../third_party/dart/runtime/bin/log_win.cc -FILE: ../../../third_party/dart/runtime/bin/main.cc -FILE: ../../../third_party/dart/runtime/bin/platform.cc -FILE: ../../../third_party/dart/runtime/bin/platform.h -FILE: ../../../third_party/dart/runtime/bin/platform_android.cc -FILE: ../../../third_party/dart/runtime/bin/platform_linux.cc -FILE: ../../../third_party/dart/runtime/bin/platform_macos.cc -FILE: ../../../third_party/dart/runtime/bin/platform_patch.dart -FILE: ../../../third_party/dart/runtime/bin/platform_win.cc -FILE: ../../../third_party/dart/runtime/bin/process.h -FILE: ../../../third_party/dart/runtime/bin/process_android.cc -FILE: ../../../third_party/dart/runtime/bin/process_linux.cc -FILE: ../../../third_party/dart/runtime/bin/process_macos.cc -FILE: ../../../third_party/dart/runtime/bin/process_win.cc -FILE: ../../../third_party/dart/runtime/bin/run_vm_tests.cc -FILE: ../../../third_party/dart/runtime/bin/secure_socket_patch.dart -FILE: ../../../third_party/dart/runtime/bin/secure_socket_unsupported.cc -FILE: ../../../third_party/dart/runtime/bin/socket_android.cc -FILE: ../../../third_party/dart/runtime/bin/socket_base_android.cc -FILE: ../../../third_party/dart/runtime/bin/socket_base_android.h -FILE: ../../../third_party/dart/runtime/bin/socket_base_linux.h -FILE: ../../../third_party/dart/runtime/bin/socket_base_macos.h -FILE: ../../../third_party/dart/runtime/bin/socket_base_win.h -FILE: ../../../third_party/dart/runtime/bin/test_extension.c -FILE: ../../../third_party/dart/runtime/bin/test_extension_dllmain_win.cc -FILE: ../../../third_party/dart/runtime/bin/thread.h -FILE: ../../../third_party/dart/runtime/bin/thread_android.cc -FILE: ../../../third_party/dart/runtime/bin/thread_android.h -FILE: ../../../third_party/dart/runtime/bin/thread_linux.cc -FILE: ../../../third_party/dart/runtime/bin/thread_linux.h -FILE: ../../../third_party/dart/runtime/bin/thread_macos.cc -FILE: ../../../third_party/dart/runtime/bin/thread_macos.h -FILE: ../../../third_party/dart/runtime/bin/thread_win.cc -FILE: ../../../third_party/dart/runtime/bin/thread_win.h -FILE: ../../../third_party/dart/runtime/bin/utils.h -FILE: ../../../third_party/dart/runtime/bin/utils_android.cc -FILE: ../../../third_party/dart/runtime/bin/utils_linux.cc -FILE: ../../../third_party/dart/runtime/bin/utils_macos.cc -FILE: ../../../third_party/dart/runtime/bin/utils_win.cc -FILE: ../../../third_party/dart/runtime/bin/utils_win.h -FILE: ../../../third_party/dart/runtime/include/dart_api.h -FILE: ../../../third_party/dart/runtime/lib/array.cc -FILE: ../../../third_party/dart/runtime/lib/array.dart -FILE: ../../../third_party/dart/runtime/lib/array_patch.dart -FILE: ../../../third_party/dart/runtime/lib/bool.cc -FILE: ../../../third_party/dart/runtime/lib/bool_patch.dart -FILE: ../../../third_party/dart/runtime/lib/date.cc -FILE: ../../../third_party/dart/runtime/lib/date_patch.dart -FILE: ../../../third_party/dart/runtime/lib/double.dart -FILE: ../../../third_party/dart/runtime/lib/double_patch.dart -FILE: ../../../third_party/dart/runtime/lib/empty_source.dart -FILE: ../../../third_party/dart/runtime/lib/errors.cc -FILE: ../../../third_party/dart/runtime/lib/errors_patch.dart -FILE: ../../../third_party/dart/runtime/lib/expando_patch.dart -FILE: ../../../third_party/dart/runtime/lib/function.cc -FILE: ../../../third_party/dart/runtime/lib/function_patch.dart -FILE: ../../../third_party/dart/runtime/lib/growable_array.cc -FILE: ../../../third_party/dart/runtime/lib/growable_array.dart -FILE: ../../../third_party/dart/runtime/lib/identical.cc -FILE: ../../../third_party/dart/runtime/lib/identical_patch.dart -FILE: ../../../third_party/dart/runtime/lib/immutable_map.dart -FILE: ../../../third_party/dart/runtime/lib/integers.cc -FILE: ../../../third_party/dart/runtime/lib/integers.dart -FILE: ../../../third_party/dart/runtime/lib/integers_patch.dart -FILE: ../../../third_party/dart/runtime/lib/invocation_mirror_patch.dart -FILE: ../../../third_party/dart/runtime/lib/isolate.cc -FILE: ../../../third_party/dart/runtime/lib/isolate_patch.dart -FILE: ../../../third_party/dart/runtime/lib/map_patch.dart -FILE: ../../../third_party/dart/runtime/lib/math_patch.dart -FILE: ../../../third_party/dart/runtime/lib/mirrors.cc -FILE: ../../../third_party/dart/runtime/lib/mirrors_impl.dart -FILE: ../../../third_party/dart/runtime/lib/mirrors_patch.dart -FILE: ../../../third_party/dart/runtime/lib/object_patch.dart -FILE: ../../../third_party/dart/runtime/lib/print_patch.dart -FILE: ../../../third_party/dart/runtime/lib/regexp.cc -FILE: ../../../third_party/dart/runtime/lib/regexp_patch.dart -FILE: ../../../third_party/dart/runtime/lib/stopwatch.cc -FILE: ../../../third_party/dart/runtime/lib/stopwatch_patch.dart -FILE: ../../../third_party/dart/runtime/lib/string_buffer_patch.dart -FILE: ../../../third_party/dart/runtime/lib/string_patch.dart -FILE: ../../../third_party/dart/runtime/lib/timer_patch.dart -FILE: ../../../third_party/dart/runtime/lib/type_patch.dart -FILE: ../../../third_party/dart/runtime/lib/weak_property.cc -FILE: ../../../third_party/dart/runtime/lib/weak_property.dart -FILE: ../../../third_party/dart/runtime/platform/assert.cc -FILE: ../../../third_party/dart/runtime/platform/assert.h -FILE: ../../../third_party/dart/runtime/platform/floating_point.h -FILE: ../../../third_party/dart/runtime/platform/floating_point_win.cc -FILE: ../../../third_party/dart/runtime/platform/floating_point_win.h -FILE: ../../../third_party/dart/runtime/platform/globals.h -FILE: ../../../third_party/dart/runtime/platform/hashmap.cc -FILE: ../../../third_party/dart/runtime/platform/hashmap.h -FILE: ../../../third_party/dart/runtime/platform/text_buffer.cc -FILE: ../../../third_party/dart/runtime/platform/text_buffer.h -FILE: ../../../third_party/dart/runtime/platform/utils.cc -FILE: ../../../third_party/dart/runtime/platform/utils.h -FILE: ../../../third_party/dart/runtime/platform/utils_android.cc -FILE: ../../../third_party/dart/runtime/platform/utils_android.h -FILE: ../../../third_party/dart/runtime/platform/utils_linux.cc -FILE: ../../../third_party/dart/runtime/platform/utils_linux.h -FILE: ../../../third_party/dart/runtime/platform/utils_macos.cc -FILE: ../../../third_party/dart/runtime/platform/utils_macos.h -FILE: ../../../third_party/dart/runtime/platform/utils_win.cc -FILE: ../../../third_party/dart/runtime/platform/utils_win.h -FILE: ../../../third_party/dart/runtime/vm/allocation.cc -FILE: ../../../third_party/dart/runtime/vm/allocation_test.cc -FILE: ../../../third_party/dart/runtime/vm/assert_test.cc -FILE: ../../../third_party/dart/runtime/vm/ast.h -FILE: ../../../third_party/dart/runtime/vm/ast_printer_test.cc -FILE: ../../../third_party/dart/runtime/vm/ast_test.cc -FILE: ../../../third_party/dart/runtime/vm/base_isolate.h -FILE: ../../../third_party/dart/runtime/vm/benchmark_test.cc -FILE: ../../../third_party/dart/runtime/vm/benchmark_test.h -FILE: ../../../third_party/dart/runtime/vm/bit_set.h -FILE: ../../../third_party/dart/runtime/vm/bit_vector.cc -FILE: ../../../third_party/dart/runtime/vm/bit_vector.h -FILE: ../../../third_party/dart/runtime/vm/bit_vector_test.cc -FILE: ../../../third_party/dart/runtime/vm/bitfield_test.cc -FILE: ../../../third_party/dart/runtime/vm/bitmap.cc -FILE: ../../../third_party/dart/runtime/vm/bitmap.h -FILE: ../../../third_party/dart/runtime/vm/bitmap_test.cc -FILE: ../../../third_party/dart/runtime/vm/boolfield.h -FILE: ../../../third_party/dart/runtime/vm/boolfield_test.cc -FILE: ../../../third_party/dart/runtime/vm/bootstrap.cc -FILE: ../../../third_party/dart/runtime/vm/bootstrap.h -FILE: ../../../third_party/dart/runtime/vm/bootstrap_natives.cc -FILE: ../../../third_party/dart/runtime/vm/bootstrap_natives.h -FILE: ../../../third_party/dart/runtime/vm/bootstrap_nocore.cc -FILE: ../../../third_party/dart/runtime/vm/class_finalizer.h -FILE: ../../../third_party/dart/runtime/vm/class_finalizer_test.cc -FILE: ../../../third_party/dart/runtime/vm/class_table.cc -FILE: ../../../third_party/dart/runtime/vm/class_table.h -FILE: ../../../third_party/dart/runtime/vm/code_descriptors.cc -FILE: ../../../third_party/dart/runtime/vm/code_descriptors.h -FILE: ../../../third_party/dart/runtime/vm/code_descriptors_test.cc -FILE: ../../../third_party/dart/runtime/vm/code_observers.cc -FILE: ../../../third_party/dart/runtime/vm/code_observers.h -FILE: ../../../third_party/dart/runtime/vm/code_patcher.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher.h -FILE: ../../../third_party/dart/runtime/vm/code_patcher_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_x64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_x86.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_printer.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_printer.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.h -FILE: ../../../third_party/dart/runtime/vm/compiler/cha.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/cha.h -FILE: ../../../third_party/dart/runtime/vm/compiler/cha_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/code_generator_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder.h -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier.h -FILE: ../../../third_party/dart/runtime/vm/compiler/jit/compiler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/jit/compiler.h -FILE: ../../../third_party/dart/runtime/vm/compiler_test.cc -FILE: ../../../third_party/dart/runtime/vm/cpu.h -FILE: ../../../third_party/dart/runtime/vm/cpu_arm.cc -FILE: ../../../third_party/dart/runtime/vm/cpu_test.cc -FILE: ../../../third_party/dart/runtime/vm/cpu_x64.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_linux.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_macos.cc -FILE: ../../../third_party/dart/runtime/vm/dart_api_impl_test.cc -FILE: ../../../third_party/dart/runtime/vm/dart_api_message.cc -FILE: ../../../third_party/dart/runtime/vm/dart_api_message.h -FILE: ../../../third_party/dart/runtime/vm/dart_api_state.h -FILE: ../../../third_party/dart/runtime/vm/dart_entry_test.cc -FILE: ../../../third_party/dart/runtime/vm/datastream.h -FILE: ../../../third_party/dart/runtime/vm/debugger.cc -FILE: ../../../third_party/dart/runtime/vm/debugger.h -FILE: ../../../third_party/dart/runtime/vm/debugger_api_impl_test.cc -FILE: ../../../third_party/dart/runtime/vm/double_internals.h -FILE: ../../../third_party/dart/runtime/vm/exceptions_test.cc -FILE: ../../../third_party/dart/runtime/vm/find_code_object_test.cc -FILE: ../../../third_party/dart/runtime/vm/flag_list.h -FILE: ../../../third_party/dart/runtime/vm/flags.cc -FILE: ../../../third_party/dart/runtime/vm/flags.h -FILE: ../../../third_party/dart/runtime/vm/flags_test.cc -FILE: ../../../third_party/dart/runtime/vm/freelist.h -FILE: ../../../third_party/dart/runtime/vm/freelist_test.cc -FILE: ../../../third_party/dart/runtime/vm/globals.h -FILE: ../../../third_party/dart/runtime/vm/growable_array.h -FILE: ../../../third_party/dart/runtime/vm/growable_array_test.cc -FILE: ../../../third_party/dart/runtime/vm/handles.cc -FILE: ../../../third_party/dart/runtime/vm/handles_impl.h -FILE: ../../../third_party/dart/runtime/vm/handles_test.cc -FILE: ../../../third_party/dart/runtime/vm/hash_map.h -FILE: ../../../third_party/dart/runtime/vm/hash_map_test.cc -FILE: ../../../third_party/dart/runtime/vm/heap.cc -FILE: ../../../third_party/dart/runtime/vm/heap.h -FILE: ../../../third_party/dart/runtime/vm/heap_test.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_ia32.h -FILE: ../../../third_party/dart/runtime/vm/instructions_ia32_test.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_x64.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_x64.h -FILE: ../../../third_party/dart/runtime/vm/instructions_x64_test.cc -FILE: ../../../third_party/dart/runtime/vm/isolate_test.cc -FILE: ../../../third_party/dart/runtime/vm/json_test.cc -FILE: ../../../third_party/dart/runtime/vm/lockers.h -FILE: ../../../third_party/dart/runtime/vm/megamorphic_cache_table.cc -FILE: ../../../third_party/dart/runtime/vm/megamorphic_cache_table.h -FILE: ../../../third_party/dart/runtime/vm/memory_region.h -FILE: ../../../third_party/dart/runtime/vm/memory_region_test.cc -FILE: ../../../third_party/dart/runtime/vm/message_handler_test.cc -FILE: ../../../third_party/dart/runtime/vm/message_test.cc -FILE: ../../../third_party/dart/runtime/vm/native_arguments.h -FILE: ../../../third_party/dart/runtime/vm/native_message_handler.cc -FILE: ../../../third_party/dart/runtime/vm/native_message_handler.h -FILE: ../../../third_party/dart/runtime/vm/object.cc -FILE: ../../../third_party/dart/runtime/vm/object.h -FILE: ../../../third_party/dart/runtime/vm/object_arm_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_ia32_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_set.h -FILE: ../../../third_party/dart/runtime/vm/object_store.h -FILE: ../../../third_party/dart/runtime/vm/object_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_x64_test.cc -FILE: ../../../third_party/dart/runtime/vm/os_android.cc -FILE: ../../../third_party/dart/runtime/vm/os_linux.cc -FILE: ../../../third_party/dart/runtime/vm/os_macos.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread.h -FILE: ../../../third_party/dart/runtime/vm/os_thread_android.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread_android.h -FILE: ../../../third_party/dart/runtime/vm/os_thread_linux.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread_linux.h -FILE: ../../../third_party/dart/runtime/vm/os_thread_macos.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread_macos.h -FILE: ../../../third_party/dart/runtime/vm/os_thread_win.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread_win.h -FILE: ../../../third_party/dart/runtime/vm/os_win.cc -FILE: ../../../third_party/dart/runtime/vm/pages.cc -FILE: ../../../third_party/dart/runtime/vm/pages_test.cc -FILE: ../../../third_party/dart/runtime/vm/parser.cc -FILE: ../../../third_party/dart/runtime/vm/parser.h -FILE: ../../../third_party/dart/runtime/vm/port.cc -FILE: ../../../third_party/dart/runtime/vm/port_test.cc -FILE: ../../../third_party/dart/runtime/vm/proccpuinfo.cc -FILE: ../../../third_party/dart/runtime/vm/proccpuinfo.h -FILE: ../../../third_party/dart/runtime/vm/raw_object.cc -FILE: ../../../third_party/dart/runtime/vm/raw_object.h -FILE: ../../../third_party/dart/runtime/vm/raw_object_snapshot.cc -FILE: ../../../third_party/dart/runtime/vm/resolver_test.cc -FILE: ../../../third_party/dart/runtime/vm/scanner.cc -FILE: ../../../third_party/dart/runtime/vm/scanner_test.cc -FILE: ../../../third_party/dart/runtime/vm/scavenger.h -FILE: ../../../third_party/dart/runtime/vm/scopes.cc -FILE: ../../../third_party/dart/runtime/vm/scopes.h -FILE: ../../../third_party/dart/runtime/vm/scopes_test.cc -FILE: ../../../third_party/dart/runtime/vm/snapshot.cc -FILE: ../../../third_party/dart/runtime/vm/snapshot.h -FILE: ../../../third_party/dart/runtime/vm/snapshot_ids.h -FILE: ../../../third_party/dart/runtime/vm/snapshot_test.cc -FILE: ../../../third_party/dart/runtime/vm/snapshot_test.dart -FILE: ../../../third_party/dart/runtime/vm/stack_frame.cc -FILE: ../../../third_party/dart/runtime/vm/stack_frame_test.cc -FILE: ../../../third_party/dart/runtime/vm/store_buffer.cc -FILE: ../../../third_party/dart/runtime/vm/store_buffer.h -FILE: ../../../third_party/dart/runtime/vm/stub_code.cc -FILE: ../../../third_party/dart/runtime/vm/symbols.cc -FILE: ../../../third_party/dart/runtime/vm/symbols.h -FILE: ../../../third_party/dart/runtime/vm/thread_pool.cc -FILE: ../../../third_party/dart/runtime/vm/thread_pool.h -FILE: ../../../third_party/dart/runtime/vm/thread_pool_test.cc -FILE: ../../../third_party/dart/runtime/vm/thread_test.cc -FILE: ../../../third_party/dart/runtime/vm/token.h -FILE: ../../../third_party/dart/runtime/vm/unicode.cc -FILE: ../../../third_party/dart/runtime/vm/unicode.h -FILE: ../../../third_party/dart/runtime/vm/unit_test.cc -FILE: ../../../third_party/dart/runtime/vm/utils_test.cc -FILE: ../../../third_party/dart/runtime/vm/verifier.cc -FILE: ../../../third_party/dart/runtime/vm/version.h -FILE: ../../../third_party/dart/runtime/vm/version_in.cc -FILE: ../../../third_party/dart/runtime/vm/virtual_memory.cc -FILE: ../../../third_party/dart/runtime/vm/virtual_memory.h -FILE: ../../../third_party/dart/runtime/vm/virtual_memory_android.cc -FILE: ../../../third_party/dart/runtime/vm/virtual_memory_linux.cc -FILE: ../../../third_party/dart/runtime/vm/virtual_memory_macos.cc -FILE: ../../../third_party/dart/runtime/vm/virtual_memory_test.cc -FILE: ../../../third_party/dart/runtime/vm/virtual_memory_win.cc -FILE: ../../../third_party/dart/runtime/vm/zone.cc -FILE: ../../../third_party/dart/runtime/vm/zone.h -FILE: ../../../third_party/dart/runtime/vm/zone_test.cc -FILE: ../../../third_party/dart/samples/build_dart/bin/test.dart -FILE: ../../../third_party/dart/samples/build_dart/build.dart -FILE: ../../../third_party/dart/samples/build_dart_simple/build.dart -FILE: ../../../third_party/dart/samples/build_dart_simple/test.dart -FILE: ../../../third_party/dart/samples/sample_extension/sample_asynchronous_extension.dart -FILE: ../../../third_party/dart/samples/sample_extension/sample_extension.cc -FILE: ../../../third_party/dart/samples/sample_extension/sample_extension_dllmain_win.cc -FILE: ../../../third_party/dart/samples/sample_extension/sample_synchronous_extension.dart -FILE: ../../../third_party/dart/samples/sample_extension/test_sample_asynchronous_extension.dart -FILE: ../../../third_party/dart/samples/sample_extension/test_sample_synchronous_extension.dart -FILE: ../../../third_party/dart/samples/samples.status -FILE: ../../../third_party/dart/sdk/lib/_http/crypto.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http_date.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/async_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/constant_map.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/core_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/foreign_helper.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/interceptors.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_array.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_number.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_string.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/math_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/mirrors_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/mirrors_patch_cfe.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_helper.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/string_helper.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart -FILE: ../../../third_party/dart/sdk/lib/async/async.dart -FILE: ../../../third_party/dart/sdk/lib/async/async_error.dart -FILE: ../../../third_party/dart/sdk/lib/async/broadcast_stream_controller.dart -FILE: ../../../third_party/dart/sdk/lib/async/future.dart -FILE: ../../../third_party/dart/sdk/lib/async/future_impl.dart -FILE: ../../../third_party/dart/sdk/lib/async/stream_controller.dart -FILE: ../../../third_party/dart/sdk/lib/async/stream_impl.dart -FILE: ../../../third_party/dart/sdk/lib/async/stream_pipe.dart -FILE: ../../../third_party/dart/sdk/lib/async/timer.dart -FILE: ../../../third_party/dart/sdk/lib/collection/collection.dart -FILE: ../../../third_party/dart/sdk/lib/collection/iterable.dart -FILE: ../../../third_party/dart/sdk/lib/collection/iterator.dart -FILE: ../../../third_party/dart/sdk/lib/collection/maps.dart -FILE: ../../../third_party/dart/sdk/lib/collection/splay_tree.dart -FILE: ../../../third_party/dart/sdk/lib/core/bool.dart -FILE: ../../../third_party/dart/sdk/lib/core/core.dart -FILE: ../../../third_party/dart/sdk/lib/core/double.dart -FILE: ../../../third_party/dart/sdk/lib/core/errors.dart -FILE: ../../../third_party/dart/sdk/lib/core/exceptions.dart -FILE: ../../../third_party/dart/sdk/lib/core/expando.dart -FILE: ../../../third_party/dart/sdk/lib/core/identical.dart -FILE: ../../../third_party/dart/sdk/lib/core/int.dart -FILE: ../../../third_party/dart/sdk/lib/core/invocation.dart -FILE: ../../../third_party/dart/sdk/lib/core/iterator.dart -FILE: ../../../third_party/dart/sdk/lib/core/list.dart -FILE: ../../../third_party/dart/sdk/lib/core/num.dart -FILE: ../../../third_party/dart/sdk/lib/core/object.dart -FILE: ../../../third_party/dart/sdk/lib/core/print.dart -FILE: ../../../third_party/dart/sdk/lib/core/regexp.dart -FILE: ../../../third_party/dart/sdk/lib/core/string.dart -FILE: ../../../third_party/dart/sdk/lib/core/type.dart -FILE: ../../../third_party/dart/sdk/lib/core/uri.dart -FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/html/dartium/nativewrappers.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/css_class_set.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/metadata.dart -FILE: ../../../third_party/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/internal/async_cast.dart -FILE: ../../../third_party/dart/sdk/lib/internal/cast.dart -FILE: ../../../third_party/dart/sdk/lib/internal/internal.dart -FILE: ../../../third_party/dart/sdk/lib/io/common.dart -FILE: ../../../third_party/dart/sdk/lib/io/directory.dart -FILE: ../../../third_party/dart/sdk/lib/io/directory_impl.dart -FILE: ../../../third_party/dart/sdk/lib/io/eventhandler.dart -FILE: ../../../third_party/dart/sdk/lib/io/io.dart -FILE: ../../../third_party/dart/sdk/lib/io/platform.dart -FILE: ../../../third_party/dart/sdk/lib/io/platform_impl.dart -FILE: ../../../third_party/dart/sdk/lib/io/secure_server_socket.dart -FILE: ../../../third_party/dart/sdk/lib/isolate/isolate.dart -FILE: ../../../third_party/dart/sdk/lib/math/math.dart -FILE: ../../../third_party/dart/sdk/lib/math/random.dart -FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/cli.cc + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/cli.cc -FILE: ../../../third_party/dart/runtime/bin/cli_patch.dart -FILE: ../../../third_party/dart/runtime/bin/dfe.cc -FILE: ../../../third_party/dart/runtime/bin/dfe.h -FILE: ../../../third_party/dart/runtime/bin/error_exit.cc -FILE: ../../../third_party/dart/runtime/bin/error_exit.h -FILE: ../../../third_party/dart/runtime/bin/gzip.cc -FILE: ../../../third_party/dart/runtime/bin/gzip.h -FILE: ../../../third_party/dart/runtime/bin/isolate_data.cc -FILE: ../../../third_party/dart/runtime/bin/main_options.cc -FILE: ../../../third_party/dart/runtime/bin/main_options.h -FILE: ../../../third_party/dart/runtime/bin/namespace.cc -FILE: ../../../third_party/dart/runtime/bin/namespace.h -FILE: ../../../third_party/dart/runtime/bin/namespace_android.cc -FILE: ../../../third_party/dart/runtime/bin/namespace_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/namespace_linux.cc -FILE: ../../../third_party/dart/runtime/bin/namespace_macos.cc -FILE: ../../../third_party/dart/runtime/bin/namespace_patch.dart -FILE: ../../../third_party/dart/runtime/bin/namespace_win.cc -FILE: ../../../third_party/dart/runtime/bin/options.cc -FILE: ../../../third_party/dart/runtime/bin/options.h -FILE: ../../../third_party/dart/runtime/bin/secure_socket_filter.cc -FILE: ../../../third_party/dart/runtime/bin/secure_socket_filter.h -FILE: ../../../third_party/dart/runtime/bin/secure_socket_utils.cc -FILE: ../../../third_party/dart/runtime/bin/secure_socket_utils.h -FILE: ../../../third_party/dart/runtime/bin/security_context.cc -FILE: ../../../third_party/dart/runtime/bin/security_context.h -FILE: ../../../third_party/dart/runtime/bin/security_context_android.cc -FILE: ../../../third_party/dart/runtime/bin/security_context_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/security_context_linux.cc -FILE: ../../../third_party/dart/runtime/bin/security_context_macos.cc -FILE: ../../../third_party/dart/runtime/bin/security_context_win.cc -FILE: ../../../third_party/dart/runtime/bin/snapshot_utils.cc -FILE: ../../../third_party/dart/runtime/bin/snapshot_utils.h -FILE: ../../../third_party/dart/runtime/bin/socket_base.cc -FILE: ../../../third_party/dart/runtime/bin/socket_base.h -FILE: ../../../third_party/dart/runtime/bin/sync_socket.cc -FILE: ../../../third_party/dart/runtime/bin/sync_socket.h -FILE: ../../../third_party/dart/runtime/bin/sync_socket_android.cc -FILE: ../../../third_party/dart/runtime/bin/sync_socket_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/sync_socket_linux.cc -FILE: ../../../third_party/dart/runtime/bin/sync_socket_macos.cc -FILE: ../../../third_party/dart/runtime/bin/sync_socket_patch.dart -FILE: ../../../third_party/dart/runtime/bin/sync_socket_win.cc -FILE: ../../../third_party/dart/runtime/lib/async.cc -FILE: ../../../third_party/dart/runtime/lib/bigint_patch.dart -FILE: ../../../third_party/dart/runtime/lib/class_id_fasta.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/search_bar.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/allocations.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/dashboard.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/graph.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/reload.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/singletargetcache_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/singletargetcache_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/subtypetestcache_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/subtypetestcache_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline/dashboard.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unlinkedcall_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unlinkedcall_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/service.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/single_target_cache.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/subtype_test_cache.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/timeline.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/unlinked_call.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/single_target_cache.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/subtype_test_cache.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/timeline.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/unlinked_call.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/vm.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/single_target_cache.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/subtype_test_cache.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/timeline.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/unlinked_call.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/vm.dart -FILE: ../../../third_party/dart/runtime/platform/allocation.h -FILE: ../../../third_party/dart/runtime/platform/growable_array.h -FILE: ../../../third_party/dart/runtime/vm/compilation_trace.cc -FILE: ../../../third_party/dart/runtime/vm/compilation_trace.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers_arm.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/call_specializer.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/call_specializer.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/prologue_builder.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/prologue_builder.h -FILE: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.h -FILE: ../../../third_party/dart/runtime/vm/constants_x86.h -FILE: ../../../third_party/dart/runtime/vm/debugger_api_impl_test.h -FILE: ../../../third_party/dart/runtime/vm/dwarf.cc -FILE: ../../../third_party/dart/runtime/vm/dwarf.h -FILE: ../../../third_party/dart/runtime/vm/fixed_cache.h -FILE: ../../../third_party/dart/runtime/vm/fixed_cache_test.cc -FILE: ../../../third_party/dart/runtime/vm/gc_compactor.cc -FILE: ../../../third_party/dart/runtime/vm/gc_compactor.h -FILE: ../../../third_party/dart/runtime/vm/gdb_helpers.cc -FILE: ../../../third_party/dart/runtime/vm/image_snapshot.cc -FILE: ../../../third_party/dart/runtime/vm/image_snapshot.h -FILE: ../../../third_party/dart/runtime/vm/json_writer.cc -FILE: ../../../third_party/dart/runtime/vm/json_writer.h -FILE: ../../../third_party/dart/runtime/vm/kernel_binary.h -FILE: ../../../third_party/dart/runtime/vm/malloc_hooks.h -FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_arm.cc -FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_jemalloc.cc -FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_tcmalloc.cc -FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_test.cc -FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_unsupported.cc -FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_x64.cc -FILE: ../../../third_party/dart/runtime/vm/mixin_test.cc -FILE: ../../../third_party/dart/runtime/vm/stack_trace.cc -FILE: ../../../third_party/dart/runtime/vm/stack_trace.h -FILE: ../../../third_party/dart/runtime/vm/timeline_android.cc -FILE: ../../../third_party/dart/runtime/vm/timeline_fuchsia.cc -FILE: ../../../third_party/dart/runtime/vm/timeline_linux.cc -FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.cc -FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.h -FILE: ../../../third_party/dart/sdk/lib/_http/overrides.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/cli_patch.dart -FILE: ../../../third_party/dart/sdk/lib/cli/cli.dart -FILE: ../../../third_party/dart/sdk/lib/cli/wait_for.dart -FILE: ../../../third_party/dart/sdk/lib/core/bigint.dart -FILE: ../../../third_party/dart/sdk/lib/internal/linked_list.dart -FILE: ../../../third_party/dart/sdk/lib/internal/patch.dart -FILE: ../../../third_party/dart/sdk/lib/io/embedder_config.dart -FILE: ../../../third_party/dart/sdk/lib/io/namespace_impl.dart -FILE: ../../../third_party/dart/sdk/lib/io/overrides.dart -FILE: ../../../third_party/dart/sdk/lib/io/sync_socket.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/named_lookup.dart -FILE: ../../../third_party/dart/utils/bazel/kernel_summary_worker.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/console.h + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/console.h -FILE: ../../../third_party/dart/runtime/bin/console_posix.cc -FILE: ../../../third_party/dart/runtime/bin/console_win.cc ----------------------------------------------------------------------------------------------------- -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/crypto_fuchsia.cc + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/crypto_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/crypto_test.cc -FILE: ../../../third_party/dart/runtime/bin/directory_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/directory_test.cc -FILE: ../../../third_party/dart/runtime/bin/eventhandler_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/eventhandler_fuchsia.h -FILE: ../../../third_party/dart/runtime/bin/extensions_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/file_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/file_support.cc -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/loader.cc -FILE: ../../../third_party/dart/runtime/bin/loader.h -FILE: ../../../third_party/dart/runtime/bin/log_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/platform_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/process_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/reference_counting.h -FILE: ../../../third_party/dart/runtime/bin/root_certificates_unsupported.cc -FILE: ../../../third_party/dart/runtime/bin/socket_base_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/socket_base_fuchsia.h -FILE: ../../../third_party/dart/runtime/bin/socket_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/stdio_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/thread_fuchsia.cc -FILE: ../../../third_party/dart/runtime/bin/thread_fuchsia.h -FILE: ../../../third_party/dart/runtime/bin/utils_fuchsia.cc -FILE: ../../../third_party/dart/runtime/lib/stacktrace.h -FILE: ../../../third_party/dart/runtime/observatory/lib/event.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/models.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/repositories.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/notification.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/virtual_collection.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/virtual_tree.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/general_error.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/nav_bar.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/nav_menu.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/rendering_queue.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/rendering_scheduler.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/tag.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/uris.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/inbound_references.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/counter_chart.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/location.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/run_state.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/shared_summary.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/summary.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metric/details.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metric/graph.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/class_menu.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/isolate_menu.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/library_menu.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/menu_item.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify_event.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify_exception.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/refresh.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/top_menu.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/vm_menu.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/retaining_path.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_link.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/strongly_reachable_instances.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/top_retaining_instances.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect_target.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/exceptions.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/breakpoint.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/class.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/code.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/context.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/error.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/event.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/extension_data.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/field.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/flag.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/frame.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/function.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/guarded.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/heap_space.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/icdata.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/inbound_references.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/instance.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/isolate.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/library.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/local_var_descriptors.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/map_association.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/megamorphiccache.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/metric.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/notification.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/object.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/objectpool.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/objectstore.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/pc_descriptors.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/persistent_handles.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/ports.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/retaining_path.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/sample_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/script.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/sentinel.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/source_location.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/target.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/thread.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/timeline_event.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/token_stream.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/type_arguments.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/unknown.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/vm.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/zone.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/breakpoint.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/class.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/context.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/editor.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/eval.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/event.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/field.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/flag.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/function.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/icdata.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/inbound_references.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/instance.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/isolate.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/library.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/megamorphiccache.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/metric.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/notification.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/object.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/objectpool.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/objectstore.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/persistent_handles.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/ports.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/reachable_size.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/retained_size.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/retaining_path.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/sample_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/script.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/strongly_reachable_instances.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/target.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/top_retaining_instances.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/type_arguments.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/breakpoint.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/class.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/context.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/editor.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/eval.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/event.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/field.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/flag.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/function.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/icdata.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/inbound_references.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/instance.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/isolate.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/library.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/megamorphiccache.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/metric.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/notification.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/object.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/objectpool.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/objectstore.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/persistent_handles.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/ports.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/reachable_size.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/retained_size.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/retaining_path.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/sample_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/script.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/settings.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/strongly_reachable_instances.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/target.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/top_retaining_instances.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/type_arguments.dart -FILE: ../../../third_party/dart/runtime/observatory/web/timeline_message_handler.js -FILE: ../../../third_party/dart/runtime/platform/atomic_fuchsia.h -FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.cc -FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.h -FILE: ../../../third_party/dart/runtime/vm/become.cc -FILE: ../../../third_party/dart/runtime/vm/become.h -FILE: ../../../third_party/dart/runtime/vm/clustered_snapshot.cc -FILE: ../../../third_party/dart/runtime/vm/clustered_snapshot.h -FILE: ../../../third_party/dart/runtime/vm/code_patcher_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_dbc.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_dbc_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/branch_optimizer.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/branch_optimizer.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.h -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/constants_dbc.h -FILE: ../../../third_party/dart/runtime/vm/cpu_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/cpu_dbc.h -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_fuchsia.cc -FILE: ../../../third_party/dart/runtime/vm/dart_api_state.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_dbc.h -FILE: ../../../third_party/dart/runtime/vm/isolate_reload.cc -FILE: ../../../third_party/dart/runtime/vm/isolate_reload.h -FILE: ../../../third_party/dart/runtime/vm/isolate_reload_test.cc -FILE: ../../../third_party/dart/runtime/vm/kernel.cc -FILE: ../../../third_party/dart/runtime/vm/kernel.h -FILE: ../../../third_party/dart/runtime/vm/kernel_binary.cc -FILE: ../../../third_party/dart/runtime/vm/kernel_isolate.cc -FILE: ../../../third_party/dart/runtime/vm/kernel_isolate.h -FILE: ../../../third_party/dart/runtime/vm/kernel_loader.cc -FILE: ../../../third_party/dart/runtime/vm/kernel_loader.h -FILE: ../../../third_party/dart/runtime/vm/lockers.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_fuchsia.cc -FILE: ../../../third_party/dart/runtime/vm/object_dbc_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_reload.cc -FILE: ../../../third_party/dart/runtime/vm/object_service.cc -FILE: ../../../third_party/dart/runtime/vm/os_fuchsia.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/safepoint.cc -FILE: ../../../third_party/dart/runtime/vm/safepoint.h -FILE: ../../../third_party/dart/runtime/vm/signal_handler_fuchsia.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_dbc.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_dbc.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_fuchsia.cc -FILE: ../../../third_party/dart/runtime/vm/token_position.cc -FILE: ../../../third_party/dart/runtime/vm/token_position.h -FILE: ../../../third_party/dart/runtime/vm/type_table.h -FILE: ../../../third_party/dart/runtime/vm/uri.cc -FILE: ../../../third_party/dart/runtime/vm/uri.h -FILE: ../../../third_party/dart/runtime/vm/uri_test.cc -FILE: ../../../third_party/dart/runtime/vm/virtual_memory_fuchsia.cc -FILE: ../../../third_party/dart/sdk/lib/developer/service.dart -FILE: ../../../third_party/dart/sdk/lib/js_util/dart2js/js_util_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/devfs.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/process_test.cc + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/process_test.cc -FILE: ../../../third_party/dart/runtime/bin/snapshot_empty.cc -FILE: ../../../third_party/dart/runtime/bin/snapshot_in.cc -FILE: ../../../third_party/dart/runtime/include/dart_tools_api.h -FILE: ../../../third_party/dart/runtime/lib/double.cc -FILE: ../../../third_party/dart/runtime/lib/math.cc -FILE: ../../../third_party/dart/runtime/lib/mirrors.h -FILE: ../../../third_party/dart/runtime/lib/object.cc -FILE: ../../../third_party/dart/runtime/lib/string.cc -FILE: ../../../third_party/dart/runtime/platform/c99_support_win.h -FILE: ../../../third_party/dart/runtime/platform/inttypes_support_win.h -FILE: ../../../third_party/dart/runtime/vm/ast.cc -FILE: ../../../third_party/dart/runtime/vm/ast_printer.cc -FILE: ../../../third_party/dart/runtime/vm/ast_printer.h -FILE: ../../../third_party/dart/runtime/vm/bitfield.h -FILE: ../../../third_party/dart/runtime/vm/code_patcher_ia32_test.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_x64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler_stats.cc -FILE: ../../../third_party/dart/runtime/vm/compiler_stats.h -FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/custom_isolate_test.cc -FILE: ../../../third_party/dart/runtime/vm/dart.h -FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.h -FILE: ../../../third_party/dart/runtime/vm/dart_entry.cc -FILE: ../../../third_party/dart/runtime/vm/dart_entry.h -FILE: ../../../third_party/dart/runtime/vm/debugger_arm.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_x64.cc -FILE: ../../../third_party/dart/runtime/vm/double_conversion.cc -FILE: ../../../third_party/dart/runtime/vm/double_conversion.h -FILE: ../../../third_party/dart/runtime/vm/exceptions.cc -FILE: ../../../third_party/dart/runtime/vm/exceptions.h -FILE: ../../../third_party/dart/runtime/vm/freelist.cc -FILE: ../../../third_party/dart/runtime/vm/gc_marker.cc -FILE: ../../../third_party/dart/runtime/vm/gc_marker.h -FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.cc -FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.h -FILE: ../../../third_party/dart/runtime/vm/handles.h -FILE: ../../../third_party/dart/runtime/vm/longjump.cc -FILE: ../../../third_party/dart/runtime/vm/longjump.h -FILE: ../../../third_party/dart/runtime/vm/longjump_test.cc -FILE: ../../../third_party/dart/runtime/vm/memory_region.cc -FILE: ../../../third_party/dart/runtime/vm/message.cc -FILE: ../../../third_party/dart/runtime/vm/message.h -FILE: ../../../third_party/dart/runtime/vm/message_handler.cc -FILE: ../../../third_party/dart/runtime/vm/message_handler.h -FILE: ../../../third_party/dart/runtime/vm/native_entry.cc -FILE: ../../../third_party/dart/runtime/vm/native_entry.h -FILE: ../../../third_party/dart/runtime/vm/native_entry_test.cc -FILE: ../../../third_party/dart/runtime/vm/native_entry_test.h -FILE: ../../../third_party/dart/runtime/vm/object_store_test.cc -FILE: ../../../third_party/dart/runtime/vm/os.h -FILE: ../../../third_party/dart/runtime/vm/pages.h -FILE: ../../../third_party/dart/runtime/vm/parser_test.cc -FILE: ../../../third_party/dart/runtime/vm/port.h -FILE: ../../../third_party/dart/runtime/vm/resolver.cc -FILE: ../../../third_party/dart/runtime/vm/resolver.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_list.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_x64.cc -FILE: ../../../third_party/dart/runtime/vm/scanner.h -FILE: ../../../third_party/dart/runtime/vm/scavenger.cc -FILE: ../../../third_party/dart/runtime/vm/stack_frame.h -FILE: ../../../third_party/dart/runtime/vm/stub_code.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32_test.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_x64_test.cc -FILE: ../../../third_party/dart/runtime/vm/timer.cc -FILE: ../../../third_party/dart/runtime/vm/timer.h -FILE: ../../../third_party/dart/runtime/vm/token.cc -FILE: ../../../third_party/dart/runtime/vm/unicode_data.cc -FILE: ../../../third_party/dart/runtime/vm/unicode_test.cc -FILE: ../../../third_party/dart/runtime/vm/unit_test.h -FILE: ../../../third_party/dart/runtime/vm/verifier.h -FILE: ../../../third_party/dart/runtime/vm/visitor.h -FILE: ../../../third_party/dart/sdk/lib/collection/queue.dart -FILE: ../../../third_party/dart/sdk/lib/core/comparable.dart -FILE: ../../../third_party/dart/sdk/lib/core/date_time.dart -FILE: ../../../third_party/dart/sdk/lib/core/duration.dart -FILE: ../../../third_party/dart/sdk/lib/core/function.dart -FILE: ../../../third_party/dart/sdk/lib/core/iterable.dart -FILE: ../../../third_party/dart/sdk/lib/core/map.dart -FILE: ../../../third_party/dart/sdk/lib/core/pattern.dart -FILE: ../../../third_party/dart/sdk/lib/core/set.dart -FILE: ../../../third_party/dart/sdk/lib/core/stopwatch.dart -FILE: ../../../third_party/dart/sdk/lib/core/string_buffer.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/device.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/filtered_element_list.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/lists.dart -FILE: ../../../third_party/dart/sdk/lib/internal/iterable.dart -FILE: ../../../third_party/dart/sdk/lib/internal/sort.dart -FILE: ../../../third_party/dart/utils/peg/pegparser.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/loader.dart + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/address_sanitizer.cc -FILE: ../../../third_party/dart/runtime/bin/builtin_common.cc -FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.cc -FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.h -FILE: ../../../third_party/dart/runtime/bin/observatory_assets_empty.cc -FILE: ../../../third_party/dart/runtime/bin/vmservice/loader.dart -FILE: ../../../third_party/dart/runtime/lib/async_patch.dart -FILE: ../../../third_party/dart/runtime/lib/compact_hash.dart -FILE: ../../../third_party/dart/runtime/lib/developer.cc -FILE: ../../../third_party/dart/runtime/lib/developer.dart -FILE: ../../../third_party/dart/runtime/lib/timeline.cc -FILE: ../../../third_party/dart/runtime/lib/timeline.dart -FILE: ../../../third_party/dart/runtime/lib/vmservice.cc -FILE: ../../../third_party/dart/runtime/observatory/lib/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/cli.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/sample_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/allocation_profile/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/analytics.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/cli/command.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger_location.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging_list.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/persistent_handles.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/ports.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline_page.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/view_footer.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/sample_profile/sample_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/web/timeline.js -FILE: ../../../third_party/dart/runtime/vm/atomic_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.h -FILE: ../../../third_party/dart/runtime/vm/log.cc -FILE: ../../../third_party/dart/runtime/vm/log.h -FILE: ../../../third_party/dart/runtime/vm/log_test.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread.cc -FILE: ../../../third_party/dart/runtime/vm/profiler_service.cc -FILE: ../../../third_party/dart/runtime/vm/profiler_service.h -FILE: ../../../third_party/dart/runtime/vm/program_visitor.cc -FILE: ../../../third_party/dart/runtime/vm/program_visitor.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode_inl.h -FILE: ../../../third_party/dart/runtime/vm/regexp_bytecodes.h -FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.h -FILE: ../../../third_party/dart/runtime/vm/scope_timer.h -FILE: ../../../third_party/dart/runtime/vm/service_event.cc -FILE: ../../../third_party/dart/runtime/vm/service_event.h -FILE: ../../../third_party/dart/runtime/vm/service_isolate.cc -FILE: ../../../third_party/dart/runtime/vm/source_report.cc -FILE: ../../../third_party/dart/runtime/vm/source_report.h -FILE: ../../../third_party/dart/runtime/vm/source_report_test.cc -FILE: ../../../third_party/dart/runtime/vm/thread.cc -FILE: ../../../third_party/dart/runtime/vm/thread.h -FILE: ../../../third_party/dart/runtime/vm/thread_barrier.h -FILE: ../../../third_party/dart/runtime/vm/thread_barrier_test.cc -FILE: ../../../third_party/dart/runtime/vm/thread_registry.cc -FILE: ../../../third_party/dart/runtime/vm/thread_registry.h -FILE: ../../../third_party/dart/runtime/vm/timeline.cc -FILE: ../../../third_party/dart/runtime/vm/timeline.h -FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.cc -FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.h -FILE: ../../../third_party/dart/runtime/vm/timeline_test.cc -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/developer_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/d8.js -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart -FILE: ../../../third_party/dart/sdk/lib/convert/base64.dart -FILE: ../../../third_party/dart/sdk/lib/dart_client.platform -FILE: ../../../third_party/dart/sdk/lib/dart_server.platform -FILE: ../../../third_party/dart/sdk/lib/dart_shared.platform -FILE: ../../../third_party/dart/sdk/lib/developer/developer.dart -FILE: ../../../third_party/dart/sdk/lib/developer/extension.dart -FILE: ../../../third_party/dart/sdk/lib/developer/timeline.dart -FILE: ../../../third_party/dart/sdk/lib/io/io_resource_info.dart -FILE: ../../../third_party/dart/sdk/lib/io/security_context.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/asset.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/vmservice.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/server.dart + ../../../third_party/dart/LICENSE +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/server.dart + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/dart/WATCHLISTS FILE: ../../../third_party/dart/runtime/bin/eventhandler_win.cc @@ -5924,9 +4643,1318 @@ FILE: ../../../third_party/dart/sdk/lib/vmservice/message_router.dart FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolate.dart FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolates.dart FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/import_crawler.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/polyfill.dart FILE: ../../../third_party/dart/utils/compiler/create_snapshot_entry.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/lib/bigint.dart +FILE: ../../../third_party/dart/runtime/lib/class_id.cc +FILE: ../../../third_party/dart/runtime/lib/class_id.dart +FILE: ../../../third_party/dart/runtime/lib/convert_patch.dart +FILE: ../../../third_party/dart/runtime/lib/lib_prefix.dart +FILE: ../../../third_party/dart/runtime/lib/linked_hash_map.cc +FILE: ../../../third_party/dart/runtime/lib/profiler.cc +FILE: ../../../third_party/dart/runtime/lib/profiler.dart +FILE: ../../../third_party/dart/runtime/observatory/bin/shell.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/app.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_common.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_html.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_io.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/utils.dart +FILE: ../../../third_party/dart/runtime/observatory/web/main.dart +FILE: ../../../third_party/dart/runtime/platform/address_sanitizer.h +FILE: ../../../third_party/dart/runtime/platform/math.h +FILE: ../../../third_party/dart/runtime/platform/memory_sanitizer.h +FILE: ../../../third_party/dart/runtime/platform/safe_stack.h +FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart +FILE: ../../../third_party/dart/runtime/vm/ast_transformer.cc +FILE: ../../../third_party/dart/runtime/vm/ast_transformer.h +FILE: ../../../third_party/dart/runtime/vm/bigint_test.cc +FILE: ../../../third_party/dart/runtime/vm/bit_set_test.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h +FILE: ../../../third_party/dart/runtime/vm/constants_arm64.h +FILE: ../../../third_party/dart/runtime/vm/cpu_arm.h +FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.h +FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.h +FILE: ../../../third_party/dart/runtime/vm/cpu_x64.h +FILE: ../../../third_party/dart/runtime/vm/cpuid.cc +FILE: ../../../third_party/dart/runtime/vm/cpuid.h +FILE: ../../../third_party/dart/runtime/vm/cpuinfo.h +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_test.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/hash_table.h +FILE: ../../../third_party/dart/runtime/vm/hash_table_test.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.h +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/metrics.cc +FILE: ../../../third_party/dart/runtime/vm/metrics.h +FILE: ../../../third_party/dart/runtime/vm/metrics_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_graph.cc +FILE: ../../../third_party/dart/runtime/vm/object_graph.h +FILE: ../../../third_party/dart/runtime/vm/object_graph_test.cc +FILE: ../../../third_party/dart/runtime/vm/regexp.cc +FILE: ../../../third_party/dart/runtime/vm/regexp.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h +FILE: ../../../third_party/dart/runtime/vm/regexp_ast.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_ast.h +FILE: ../../../third_party/dart/runtime/vm/regexp_parser.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_parser.h +FILE: ../../../third_party/dart/runtime/vm/regexp_test.cc +FILE: ../../../third_party/dart/runtime/vm/report.cc +FILE: ../../../third_party/dart/runtime/vm/report.h +FILE: ../../../third_party/dart/runtime/vm/ring_buffer.h +FILE: ../../../third_party/dart/runtime/vm/ring_buffer_test.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/scavenger_test.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.h +FILE: ../../../third_party/dart/runtime/vm/spaces.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/tags.cc +FILE: ../../../third_party/dart/runtime/vm/unibrow-inl.h +FILE: ../../../third_party/dart/runtime/vm/unibrow.cc +FILE: ../../../third_party/dart/runtime/vm/unibrow.h +FILE: ../../../third_party/dart/runtime/vm/verified_memory_test.cc +FILE: ../../../third_party/dart/runtime/vm/weak_code.cc +FILE: ../../../third_party/dart/runtime/vm/weak_code.h +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_serialization.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart +FILE: ../../../third_party/dart/sdk/lib/collection/set.dart +FILE: ../../../third_party/dart/sdk/lib/core/sink.dart +FILE: ../../../third_party/dart/sdk/lib/developer/profiler.dart +FILE: ../../../third_party/dart/sdk/lib/io/process.dart +FILE: ../../../third_party/dart/sdk/lib/io/service_object.dart +FILE: ../../../third_party/dart/sdk/lib/isolate/capability.dart +FILE: ../../../third_party/dart/sdk/lib/profiler/profiler.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.status +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/css_class_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/dart_support.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop_support.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/mirror_initializer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/static_initializer.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/.mailmap +FILE: ../../../third_party/dart/client/idea/.idea/.name +FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Default.xml +FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml +FILE: ../../../third_party/dart/runtime/CPPLINT.cfg +FILE: ../../../third_party/dart/runtime/observatory/.analysis_options +FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/isolate_icon.png +FILE: ../../../third_party/dart/runtime/observatory/maintainers/pubspec.template +FILE: ../../../third_party/dart/runtime/observatory/web/favicon.ico +FILE: ../../../third_party/dart/runtime/observatory/web/index.html +FILE: ../../../third_party/dart/runtime/observatory/web/third_party/trace_viewer_full.html +FILE: ../../../third_party/dart/runtime/observatory/web/timeline.html +FILE: ../../../third_party/dart/runtime/vm/snapshot_test_in.dat +FILE: ../../../third_party/dart/samples/build_dart/test.foo +FILE: ../../../third_party/dart/samples/build_dart_simple/test.foo +FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common.dart +FILE: ../../../third_party/dart/sdk/lib/libraries.json +FILE: ../../../third_party/dart/sdk/lib/vmservice_libraries.json +FILE: ../../../third_party/dart/third_party/7zip.tar.gz.sha1 +FILE: ../../../third_party/dart/third_party/clang.tar.gz.sha1 +FILE: ../../../third_party/dart/third_party/gsutil.tar.gz.sha1 +---------------------------------------------------------------------------------------------------- +Copyright 2012, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/client/dart.js + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/DEPS +FILE: ../../../third_party/dart/client/dart.js +FILE: ../../../third_party/dart/runtime/bin/builtin.cc +FILE: ../../../third_party/dart/runtime/bin/builtin.dart +FILE: ../../../third_party/dart/runtime/bin/builtin.h +FILE: ../../../third_party/dart/runtime/bin/builtin_gen_snapshot.cc +FILE: ../../../third_party/dart/runtime/bin/builtin_in.cc +FILE: ../../../third_party/dart/runtime/bin/builtin_natives.cc +FILE: ../../../third_party/dart/runtime/bin/builtin_nolib.cc +FILE: ../../../third_party/dart/runtime/bin/common_patch.dart +FILE: ../../../third_party/dart/runtime/bin/crypto.cc +FILE: ../../../third_party/dart/runtime/bin/crypto.h +FILE: ../../../third_party/dart/runtime/bin/crypto_android.cc +FILE: ../../../third_party/dart/runtime/bin/crypto_linux.cc +FILE: ../../../third_party/dart/runtime/bin/crypto_macos.cc +FILE: ../../../third_party/dart/runtime/bin/crypto_win.cc +FILE: ../../../third_party/dart/runtime/bin/dartutils.cc +FILE: ../../../third_party/dart/runtime/bin/dartutils.h +FILE: ../../../third_party/dart/runtime/bin/directory.cc +FILE: ../../../third_party/dart/runtime/bin/directory.h +FILE: ../../../third_party/dart/runtime/bin/directory_android.cc +FILE: ../../../third_party/dart/runtime/bin/directory_linux.cc +FILE: ../../../third_party/dart/runtime/bin/directory_macos.cc +FILE: ../../../third_party/dart/runtime/bin/directory_patch.dart +FILE: ../../../third_party/dart/runtime/bin/directory_win.cc +FILE: ../../../third_party/dart/runtime/bin/eventhandler.cc +FILE: ../../../third_party/dart/runtime/bin/eventhandler.h +FILE: ../../../third_party/dart/runtime/bin/eventhandler_android.cc +FILE: ../../../third_party/dart/runtime/bin/eventhandler_android.h +FILE: ../../../third_party/dart/runtime/bin/eventhandler_linux.cc +FILE: ../../../third_party/dart/runtime/bin/eventhandler_linux.h +FILE: ../../../third_party/dart/runtime/bin/eventhandler_macos.cc +FILE: ../../../third_party/dart/runtime/bin/eventhandler_macos.h +FILE: ../../../third_party/dart/runtime/bin/eventhandler_patch.dart +FILE: ../../../third_party/dart/runtime/bin/eventhandler_test.cc +FILE: ../../../third_party/dart/runtime/bin/eventhandler_win.h +FILE: ../../../third_party/dart/runtime/bin/extensions.cc +FILE: ../../../third_party/dart/runtime/bin/extensions.h +FILE: ../../../third_party/dart/runtime/bin/extensions_android.cc +FILE: ../../../third_party/dart/runtime/bin/extensions_linux.cc +FILE: ../../../third_party/dart/runtime/bin/extensions_macos.cc +FILE: ../../../third_party/dart/runtime/bin/extensions_win.cc +FILE: ../../../third_party/dart/runtime/bin/fdutils.h +FILE: ../../../third_party/dart/runtime/bin/fdutils_android.cc +FILE: ../../../third_party/dart/runtime/bin/fdutils_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/fdutils_linux.cc +FILE: ../../../third_party/dart/runtime/bin/fdutils_macos.cc +FILE: ../../../third_party/dart/runtime/bin/file_android.cc +FILE: ../../../third_party/dart/runtime/bin/file_linux.cc +FILE: ../../../third_party/dart/runtime/bin/file_macos.cc +FILE: ../../../third_party/dart/runtime/bin/file_patch.dart +FILE: ../../../third_party/dart/runtime/bin/file_test.cc +FILE: ../../../third_party/dart/runtime/bin/file_win.cc +FILE: ../../../third_party/dart/runtime/bin/hashmap_test.cc +FILE: ../../../third_party/dart/runtime/bin/io_buffer.cc +FILE: ../../../third_party/dart/runtime/bin/io_buffer.h +FILE: ../../../third_party/dart/runtime/bin/io_natives.h +FILE: ../../../third_party/dart/runtime/bin/isolate_data.h +FILE: ../../../third_party/dart/runtime/bin/lockers.h +FILE: ../../../third_party/dart/runtime/bin/log.h +FILE: ../../../third_party/dart/runtime/bin/log_android.cc +FILE: ../../../third_party/dart/runtime/bin/log_linux.cc +FILE: ../../../third_party/dart/runtime/bin/log_macos.cc +FILE: ../../../third_party/dart/runtime/bin/log_win.cc +FILE: ../../../third_party/dart/runtime/bin/main.cc +FILE: ../../../third_party/dart/runtime/bin/platform.cc +FILE: ../../../third_party/dart/runtime/bin/platform.h +FILE: ../../../third_party/dart/runtime/bin/platform_android.cc +FILE: ../../../third_party/dart/runtime/bin/platform_linux.cc +FILE: ../../../third_party/dart/runtime/bin/platform_macos.cc +FILE: ../../../third_party/dart/runtime/bin/platform_patch.dart +FILE: ../../../third_party/dart/runtime/bin/platform_win.cc +FILE: ../../../third_party/dart/runtime/bin/process.h +FILE: ../../../third_party/dart/runtime/bin/process_android.cc +FILE: ../../../third_party/dart/runtime/bin/process_linux.cc +FILE: ../../../third_party/dart/runtime/bin/process_macos.cc +FILE: ../../../third_party/dart/runtime/bin/process_win.cc +FILE: ../../../third_party/dart/runtime/bin/run_vm_tests.cc +FILE: ../../../third_party/dart/runtime/bin/secure_socket_patch.dart +FILE: ../../../third_party/dart/runtime/bin/secure_socket_unsupported.cc +FILE: ../../../third_party/dart/runtime/bin/socket_android.cc +FILE: ../../../third_party/dart/runtime/bin/socket_base_android.cc +FILE: ../../../third_party/dart/runtime/bin/socket_base_android.h +FILE: ../../../third_party/dart/runtime/bin/socket_base_linux.h +FILE: ../../../third_party/dart/runtime/bin/socket_base_macos.h +FILE: ../../../third_party/dart/runtime/bin/socket_base_win.h +FILE: ../../../third_party/dart/runtime/bin/test_extension.c +FILE: ../../../third_party/dart/runtime/bin/test_extension_dllmain_win.cc +FILE: ../../../third_party/dart/runtime/bin/thread.h +FILE: ../../../third_party/dart/runtime/bin/thread_android.cc +FILE: ../../../third_party/dart/runtime/bin/thread_android.h +FILE: ../../../third_party/dart/runtime/bin/thread_linux.cc +FILE: ../../../third_party/dart/runtime/bin/thread_linux.h +FILE: ../../../third_party/dart/runtime/bin/thread_macos.cc +FILE: ../../../third_party/dart/runtime/bin/thread_macos.h +FILE: ../../../third_party/dart/runtime/bin/thread_win.cc +FILE: ../../../third_party/dart/runtime/bin/thread_win.h +FILE: ../../../third_party/dart/runtime/bin/utils.h +FILE: ../../../third_party/dart/runtime/bin/utils_android.cc +FILE: ../../../third_party/dart/runtime/bin/utils_linux.cc +FILE: ../../../third_party/dart/runtime/bin/utils_macos.cc +FILE: ../../../third_party/dart/runtime/bin/utils_win.cc +FILE: ../../../third_party/dart/runtime/bin/utils_win.h +FILE: ../../../third_party/dart/runtime/include/dart_api.h +FILE: ../../../third_party/dart/runtime/lib/array.cc +FILE: ../../../third_party/dart/runtime/lib/array.dart +FILE: ../../../third_party/dart/runtime/lib/array_patch.dart +FILE: ../../../third_party/dart/runtime/lib/bool.cc +FILE: ../../../third_party/dart/runtime/lib/bool_patch.dart +FILE: ../../../third_party/dart/runtime/lib/date.cc +FILE: ../../../third_party/dart/runtime/lib/date_patch.dart +FILE: ../../../third_party/dart/runtime/lib/double.dart +FILE: ../../../third_party/dart/runtime/lib/double_patch.dart +FILE: ../../../third_party/dart/runtime/lib/empty_source.dart +FILE: ../../../third_party/dart/runtime/lib/errors.cc +FILE: ../../../third_party/dart/runtime/lib/errors_patch.dart +FILE: ../../../third_party/dart/runtime/lib/expando_patch.dart +FILE: ../../../third_party/dart/runtime/lib/function.cc +FILE: ../../../third_party/dart/runtime/lib/function_patch.dart +FILE: ../../../third_party/dart/runtime/lib/growable_array.cc +FILE: ../../../third_party/dart/runtime/lib/growable_array.dart +FILE: ../../../third_party/dart/runtime/lib/identical.cc +FILE: ../../../third_party/dart/runtime/lib/identical_patch.dart +FILE: ../../../third_party/dart/runtime/lib/immutable_map.dart +FILE: ../../../third_party/dart/runtime/lib/integers.cc +FILE: ../../../third_party/dart/runtime/lib/integers.dart +FILE: ../../../third_party/dart/runtime/lib/integers_patch.dart +FILE: ../../../third_party/dart/runtime/lib/invocation_mirror_patch.dart +FILE: ../../../third_party/dart/runtime/lib/isolate.cc +FILE: ../../../third_party/dart/runtime/lib/isolate_patch.dart +FILE: ../../../third_party/dart/runtime/lib/map_patch.dart +FILE: ../../../third_party/dart/runtime/lib/math_patch.dart +FILE: ../../../third_party/dart/runtime/lib/mirrors.cc +FILE: ../../../third_party/dart/runtime/lib/mirrors_impl.dart +FILE: ../../../third_party/dart/runtime/lib/mirrors_patch.dart +FILE: ../../../third_party/dart/runtime/lib/object_patch.dart +FILE: ../../../third_party/dart/runtime/lib/print_patch.dart +FILE: ../../../third_party/dart/runtime/lib/regexp.cc +FILE: ../../../third_party/dart/runtime/lib/regexp_patch.dart +FILE: ../../../third_party/dart/runtime/lib/stopwatch.cc +FILE: ../../../third_party/dart/runtime/lib/stopwatch_patch.dart +FILE: ../../../third_party/dart/runtime/lib/string_buffer_patch.dart +FILE: ../../../third_party/dart/runtime/lib/string_patch.dart +FILE: ../../../third_party/dart/runtime/lib/timer_patch.dart +FILE: ../../../third_party/dart/runtime/lib/type_patch.dart +FILE: ../../../third_party/dart/runtime/lib/weak_property.cc +FILE: ../../../third_party/dart/runtime/lib/weak_property.dart +FILE: ../../../third_party/dart/runtime/platform/assert.cc +FILE: ../../../third_party/dart/runtime/platform/assert.h +FILE: ../../../third_party/dart/runtime/platform/floating_point.h +FILE: ../../../third_party/dart/runtime/platform/floating_point_win.cc +FILE: ../../../third_party/dart/runtime/platform/floating_point_win.h +FILE: ../../../third_party/dart/runtime/platform/globals.h +FILE: ../../../third_party/dart/runtime/platform/hashmap.cc +FILE: ../../../third_party/dart/runtime/platform/hashmap.h +FILE: ../../../third_party/dart/runtime/platform/text_buffer.cc +FILE: ../../../third_party/dart/runtime/platform/text_buffer.h +FILE: ../../../third_party/dart/runtime/platform/utils.cc +FILE: ../../../third_party/dart/runtime/platform/utils.h +FILE: ../../../third_party/dart/runtime/platform/utils_android.cc +FILE: ../../../third_party/dart/runtime/platform/utils_android.h +FILE: ../../../third_party/dart/runtime/platform/utils_linux.cc +FILE: ../../../third_party/dart/runtime/platform/utils_linux.h +FILE: ../../../third_party/dart/runtime/platform/utils_macos.cc +FILE: ../../../third_party/dart/runtime/platform/utils_macos.h +FILE: ../../../third_party/dart/runtime/platform/utils_win.cc +FILE: ../../../third_party/dart/runtime/platform/utils_win.h +FILE: ../../../third_party/dart/runtime/vm/allocation.cc +FILE: ../../../third_party/dart/runtime/vm/allocation_test.cc +FILE: ../../../third_party/dart/runtime/vm/assert_test.cc +FILE: ../../../third_party/dart/runtime/vm/ast.h +FILE: ../../../third_party/dart/runtime/vm/ast_printer_test.cc +FILE: ../../../third_party/dart/runtime/vm/ast_test.cc +FILE: ../../../third_party/dart/runtime/vm/base_isolate.h +FILE: ../../../third_party/dart/runtime/vm/benchmark_test.cc +FILE: ../../../third_party/dart/runtime/vm/benchmark_test.h +FILE: ../../../third_party/dart/runtime/vm/bit_set.h +FILE: ../../../third_party/dart/runtime/vm/bit_vector.cc +FILE: ../../../third_party/dart/runtime/vm/bit_vector.h +FILE: ../../../third_party/dart/runtime/vm/bit_vector_test.cc +FILE: ../../../third_party/dart/runtime/vm/bitfield_test.cc +FILE: ../../../third_party/dart/runtime/vm/bitmap.cc +FILE: ../../../third_party/dart/runtime/vm/bitmap.h +FILE: ../../../third_party/dart/runtime/vm/bitmap_test.cc +FILE: ../../../third_party/dart/runtime/vm/boolfield.h +FILE: ../../../third_party/dart/runtime/vm/boolfield_test.cc +FILE: ../../../third_party/dart/runtime/vm/bootstrap.cc +FILE: ../../../third_party/dart/runtime/vm/bootstrap.h +FILE: ../../../third_party/dart/runtime/vm/bootstrap_natives.cc +FILE: ../../../third_party/dart/runtime/vm/bootstrap_natives.h +FILE: ../../../third_party/dart/runtime/vm/bootstrap_nocore.cc +FILE: ../../../third_party/dart/runtime/vm/class_finalizer.h +FILE: ../../../third_party/dart/runtime/vm/class_finalizer_test.cc +FILE: ../../../third_party/dart/runtime/vm/class_table.cc +FILE: ../../../third_party/dart/runtime/vm/class_table.h +FILE: ../../../third_party/dart/runtime/vm/code_descriptors.cc +FILE: ../../../third_party/dart/runtime/vm/code_descriptors.h +FILE: ../../../third_party/dart/runtime/vm/code_descriptors_test.cc +FILE: ../../../third_party/dart/runtime/vm/code_observers.cc +FILE: ../../../third_party/dart/runtime/vm/code_observers.h +FILE: ../../../third_party/dart/runtime/vm/code_patcher.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher.h +FILE: ../../../third_party/dart/runtime/vm/code_patcher_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_x64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_x86.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_printer.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_printer.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.h +FILE: ../../../third_party/dart/runtime/vm/compiler/cha.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/cha.h +FILE: ../../../third_party/dart/runtime/vm/compiler/cha_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/code_generator_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder.h +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier.h +FILE: ../../../third_party/dart/runtime/vm/compiler/jit/compiler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/jit/compiler.h +FILE: ../../../third_party/dart/runtime/vm/compiler_test.cc +FILE: ../../../third_party/dart/runtime/vm/cpu.h +FILE: ../../../third_party/dart/runtime/vm/cpu_arm.cc +FILE: ../../../third_party/dart/runtime/vm/cpu_test.cc +FILE: ../../../third_party/dart/runtime/vm/cpu_x64.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_linux.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_macos.cc +FILE: ../../../third_party/dart/runtime/vm/dart_api_impl_test.cc +FILE: ../../../third_party/dart/runtime/vm/dart_api_message.cc +FILE: ../../../third_party/dart/runtime/vm/dart_api_message.h +FILE: ../../../third_party/dart/runtime/vm/dart_api_state.h +FILE: ../../../third_party/dart/runtime/vm/dart_entry_test.cc +FILE: ../../../third_party/dart/runtime/vm/datastream.h +FILE: ../../../third_party/dart/runtime/vm/debugger.cc +FILE: ../../../third_party/dart/runtime/vm/debugger.h +FILE: ../../../third_party/dart/runtime/vm/debugger_api_impl_test.cc +FILE: ../../../third_party/dart/runtime/vm/double_internals.h +FILE: ../../../third_party/dart/runtime/vm/exceptions_test.cc +FILE: ../../../third_party/dart/runtime/vm/find_code_object_test.cc +FILE: ../../../third_party/dart/runtime/vm/flag_list.h +FILE: ../../../third_party/dart/runtime/vm/flags.cc +FILE: ../../../third_party/dart/runtime/vm/flags.h +FILE: ../../../third_party/dart/runtime/vm/flags_test.cc +FILE: ../../../third_party/dart/runtime/vm/freelist.h +FILE: ../../../third_party/dart/runtime/vm/freelist_test.cc +FILE: ../../../third_party/dart/runtime/vm/globals.h +FILE: ../../../third_party/dart/runtime/vm/growable_array.h +FILE: ../../../third_party/dart/runtime/vm/growable_array_test.cc +FILE: ../../../third_party/dart/runtime/vm/handles.cc +FILE: ../../../third_party/dart/runtime/vm/handles_impl.h +FILE: ../../../third_party/dart/runtime/vm/handles_test.cc +FILE: ../../../third_party/dart/runtime/vm/hash_map.h +FILE: ../../../third_party/dart/runtime/vm/hash_map_test.cc +FILE: ../../../third_party/dart/runtime/vm/heap.cc +FILE: ../../../third_party/dart/runtime/vm/heap.h +FILE: ../../../third_party/dart/runtime/vm/heap_test.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_ia32.h +FILE: ../../../third_party/dart/runtime/vm/instructions_ia32_test.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_x64.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_x64.h +FILE: ../../../third_party/dart/runtime/vm/instructions_x64_test.cc +FILE: ../../../third_party/dart/runtime/vm/isolate_test.cc +FILE: ../../../third_party/dart/runtime/vm/json_test.cc +FILE: ../../../third_party/dart/runtime/vm/lockers.h +FILE: ../../../third_party/dart/runtime/vm/megamorphic_cache_table.cc +FILE: ../../../third_party/dart/runtime/vm/megamorphic_cache_table.h +FILE: ../../../third_party/dart/runtime/vm/memory_region.h +FILE: ../../../third_party/dart/runtime/vm/memory_region_test.cc +FILE: ../../../third_party/dart/runtime/vm/message_handler_test.cc +FILE: ../../../third_party/dart/runtime/vm/message_test.cc +FILE: ../../../third_party/dart/runtime/vm/native_arguments.h +FILE: ../../../third_party/dart/runtime/vm/native_message_handler.cc +FILE: ../../../third_party/dart/runtime/vm/native_message_handler.h +FILE: ../../../third_party/dart/runtime/vm/object.cc +FILE: ../../../third_party/dart/runtime/vm/object.h +FILE: ../../../third_party/dart/runtime/vm/object_arm_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_ia32_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_set.h +FILE: ../../../third_party/dart/runtime/vm/object_store.h +FILE: ../../../third_party/dart/runtime/vm/object_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_x64_test.cc +FILE: ../../../third_party/dart/runtime/vm/os_android.cc +FILE: ../../../third_party/dart/runtime/vm/os_linux.cc +FILE: ../../../third_party/dart/runtime/vm/os_macos.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread.h +FILE: ../../../third_party/dart/runtime/vm/os_thread_android.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread_android.h +FILE: ../../../third_party/dart/runtime/vm/os_thread_linux.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread_linux.h +FILE: ../../../third_party/dart/runtime/vm/os_thread_macos.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread_macos.h +FILE: ../../../third_party/dart/runtime/vm/os_thread_win.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread_win.h +FILE: ../../../third_party/dart/runtime/vm/os_win.cc +FILE: ../../../third_party/dart/runtime/vm/pages.cc +FILE: ../../../third_party/dart/runtime/vm/pages_test.cc +FILE: ../../../third_party/dart/runtime/vm/parser.cc +FILE: ../../../third_party/dart/runtime/vm/parser.h +FILE: ../../../third_party/dart/runtime/vm/port.cc +FILE: ../../../third_party/dart/runtime/vm/port_test.cc +FILE: ../../../third_party/dart/runtime/vm/proccpuinfo.cc +FILE: ../../../third_party/dart/runtime/vm/proccpuinfo.h +FILE: ../../../third_party/dart/runtime/vm/raw_object.cc +FILE: ../../../third_party/dart/runtime/vm/raw_object.h +FILE: ../../../third_party/dart/runtime/vm/raw_object_snapshot.cc +FILE: ../../../third_party/dart/runtime/vm/resolver_test.cc +FILE: ../../../third_party/dart/runtime/vm/scanner.cc +FILE: ../../../third_party/dart/runtime/vm/scanner_test.cc +FILE: ../../../third_party/dart/runtime/vm/scavenger.h +FILE: ../../../third_party/dart/runtime/vm/scopes.cc +FILE: ../../../third_party/dart/runtime/vm/scopes.h +FILE: ../../../third_party/dart/runtime/vm/scopes_test.cc +FILE: ../../../third_party/dart/runtime/vm/snapshot.cc +FILE: ../../../third_party/dart/runtime/vm/snapshot.h +FILE: ../../../third_party/dart/runtime/vm/snapshot_ids.h +FILE: ../../../third_party/dart/runtime/vm/snapshot_test.cc +FILE: ../../../third_party/dart/runtime/vm/snapshot_test.dart +FILE: ../../../third_party/dart/runtime/vm/stack_frame.cc +FILE: ../../../third_party/dart/runtime/vm/stack_frame_test.cc +FILE: ../../../third_party/dart/runtime/vm/store_buffer.cc +FILE: ../../../third_party/dart/runtime/vm/store_buffer.h +FILE: ../../../third_party/dart/runtime/vm/stub_code.cc +FILE: ../../../third_party/dart/runtime/vm/symbols.cc +FILE: ../../../third_party/dart/runtime/vm/symbols.h +FILE: ../../../third_party/dart/runtime/vm/thread_pool.cc +FILE: ../../../third_party/dart/runtime/vm/thread_pool.h +FILE: ../../../third_party/dart/runtime/vm/thread_pool_test.cc +FILE: ../../../third_party/dart/runtime/vm/thread_test.cc +FILE: ../../../third_party/dart/runtime/vm/token.h +FILE: ../../../third_party/dart/runtime/vm/unicode.cc +FILE: ../../../third_party/dart/runtime/vm/unicode.h +FILE: ../../../third_party/dart/runtime/vm/unit_test.cc +FILE: ../../../third_party/dart/runtime/vm/utils_test.cc +FILE: ../../../third_party/dart/runtime/vm/verifier.cc +FILE: ../../../third_party/dart/runtime/vm/version.h +FILE: ../../../third_party/dart/runtime/vm/version_in.cc +FILE: ../../../third_party/dart/runtime/vm/virtual_memory.cc +FILE: ../../../third_party/dart/runtime/vm/virtual_memory.h +FILE: ../../../third_party/dart/runtime/vm/virtual_memory_android.cc +FILE: ../../../third_party/dart/runtime/vm/virtual_memory_linux.cc +FILE: ../../../third_party/dart/runtime/vm/virtual_memory_macos.cc +FILE: ../../../third_party/dart/runtime/vm/virtual_memory_test.cc +FILE: ../../../third_party/dart/runtime/vm/virtual_memory_win.cc +FILE: ../../../third_party/dart/runtime/vm/zone.cc +FILE: ../../../third_party/dart/runtime/vm/zone.h +FILE: ../../../third_party/dart/runtime/vm/zone_test.cc +FILE: ../../../third_party/dart/samples/build_dart/bin/test.dart +FILE: ../../../third_party/dart/samples/build_dart/build.dart +FILE: ../../../third_party/dart/samples/build_dart_simple/build.dart +FILE: ../../../third_party/dart/samples/build_dart_simple/test.dart +FILE: ../../../third_party/dart/samples/sample_extension/sample_asynchronous_extension.dart +FILE: ../../../third_party/dart/samples/sample_extension/sample_extension.cc +FILE: ../../../third_party/dart/samples/sample_extension/sample_extension_dllmain_win.cc +FILE: ../../../third_party/dart/samples/sample_extension/sample_synchronous_extension.dart +FILE: ../../../third_party/dart/samples/sample_extension/test_sample_asynchronous_extension.dart +FILE: ../../../third_party/dart/samples/sample_extension/test_sample_synchronous_extension.dart +FILE: ../../../third_party/dart/samples/samples.status +FILE: ../../../third_party/dart/sdk/lib/_http/crypto.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http_date.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/async_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/constant_map.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/core_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/foreign_helper.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/interceptors.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_array.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_number.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_string.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/math_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/mirrors_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/mirrors_patch_cfe.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_helper.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/string_helper.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart +FILE: ../../../third_party/dart/sdk/lib/async/async.dart +FILE: ../../../third_party/dart/sdk/lib/async/async_error.dart +FILE: ../../../third_party/dart/sdk/lib/async/broadcast_stream_controller.dart +FILE: ../../../third_party/dart/sdk/lib/async/future.dart +FILE: ../../../third_party/dart/sdk/lib/async/future_impl.dart +FILE: ../../../third_party/dart/sdk/lib/async/stream_controller.dart +FILE: ../../../third_party/dart/sdk/lib/async/stream_impl.dart +FILE: ../../../third_party/dart/sdk/lib/async/stream_pipe.dart +FILE: ../../../third_party/dart/sdk/lib/async/timer.dart +FILE: ../../../third_party/dart/sdk/lib/collection/collection.dart +FILE: ../../../third_party/dart/sdk/lib/collection/iterable.dart +FILE: ../../../third_party/dart/sdk/lib/collection/iterator.dart +FILE: ../../../third_party/dart/sdk/lib/collection/maps.dart +FILE: ../../../third_party/dart/sdk/lib/collection/splay_tree.dart +FILE: ../../../third_party/dart/sdk/lib/core/bool.dart +FILE: ../../../third_party/dart/sdk/lib/core/core.dart +FILE: ../../../third_party/dart/sdk/lib/core/double.dart +FILE: ../../../third_party/dart/sdk/lib/core/errors.dart +FILE: ../../../third_party/dart/sdk/lib/core/exceptions.dart +FILE: ../../../third_party/dart/sdk/lib/core/expando.dart +FILE: ../../../third_party/dart/sdk/lib/core/identical.dart +FILE: ../../../third_party/dart/sdk/lib/core/int.dart +FILE: ../../../third_party/dart/sdk/lib/core/invocation.dart +FILE: ../../../third_party/dart/sdk/lib/core/iterator.dart +FILE: ../../../third_party/dart/sdk/lib/core/list.dart +FILE: ../../../third_party/dart/sdk/lib/core/num.dart +FILE: ../../../third_party/dart/sdk/lib/core/object.dart +FILE: ../../../third_party/dart/sdk/lib/core/print.dart +FILE: ../../../third_party/dart/sdk/lib/core/regexp.dart +FILE: ../../../third_party/dart/sdk/lib/core/string.dart +FILE: ../../../third_party/dart/sdk/lib/core/type.dart +FILE: ../../../third_party/dart/sdk/lib/core/uri.dart +FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/html/dartium/nativewrappers.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/css_class_set.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/metadata.dart +FILE: ../../../third_party/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/internal/async_cast.dart +FILE: ../../../third_party/dart/sdk/lib/internal/cast.dart +FILE: ../../../third_party/dart/sdk/lib/internal/internal.dart +FILE: ../../../third_party/dart/sdk/lib/io/common.dart +FILE: ../../../third_party/dart/sdk/lib/io/directory.dart +FILE: ../../../third_party/dart/sdk/lib/io/directory_impl.dart +FILE: ../../../third_party/dart/sdk/lib/io/eventhandler.dart +FILE: ../../../third_party/dart/sdk/lib/io/io.dart +FILE: ../../../third_party/dart/sdk/lib/io/platform.dart +FILE: ../../../third_party/dart/sdk/lib/io/platform_impl.dart +FILE: ../../../third_party/dart/sdk/lib/io/secure_server_socket.dart +FILE: ../../../third_party/dart/sdk/lib/isolate/isolate.dart +FILE: ../../../third_party/dart/sdk/lib/math/math.dart +FILE: ../../../third_party/dart/sdk/lib/math/random.dart +FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/cli.cc + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/cli.cc +FILE: ../../../third_party/dart/runtime/bin/cli_patch.dart +FILE: ../../../third_party/dart/runtime/bin/dfe.cc +FILE: ../../../third_party/dart/runtime/bin/dfe.h +FILE: ../../../third_party/dart/runtime/bin/error_exit.cc +FILE: ../../../third_party/dart/runtime/bin/error_exit.h +FILE: ../../../third_party/dart/runtime/bin/gzip.cc +FILE: ../../../third_party/dart/runtime/bin/gzip.h +FILE: ../../../third_party/dart/runtime/bin/isolate_data.cc +FILE: ../../../third_party/dart/runtime/bin/main_options.cc +FILE: ../../../third_party/dart/runtime/bin/main_options.h +FILE: ../../../third_party/dart/runtime/bin/namespace.cc +FILE: ../../../third_party/dart/runtime/bin/namespace.h +FILE: ../../../third_party/dart/runtime/bin/namespace_android.cc +FILE: ../../../third_party/dart/runtime/bin/namespace_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/namespace_linux.cc +FILE: ../../../third_party/dart/runtime/bin/namespace_macos.cc +FILE: ../../../third_party/dart/runtime/bin/namespace_patch.dart +FILE: ../../../third_party/dart/runtime/bin/namespace_win.cc +FILE: ../../../third_party/dart/runtime/bin/options.cc +FILE: ../../../third_party/dart/runtime/bin/options.h +FILE: ../../../third_party/dart/runtime/bin/secure_socket_filter.cc +FILE: ../../../third_party/dart/runtime/bin/secure_socket_filter.h +FILE: ../../../third_party/dart/runtime/bin/secure_socket_utils.cc +FILE: ../../../third_party/dart/runtime/bin/secure_socket_utils.h +FILE: ../../../third_party/dart/runtime/bin/security_context.cc +FILE: ../../../third_party/dart/runtime/bin/security_context.h +FILE: ../../../third_party/dart/runtime/bin/security_context_android.cc +FILE: ../../../third_party/dart/runtime/bin/security_context_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/security_context_linux.cc +FILE: ../../../third_party/dart/runtime/bin/security_context_macos.cc +FILE: ../../../third_party/dart/runtime/bin/security_context_win.cc +FILE: ../../../third_party/dart/runtime/bin/snapshot_utils.cc +FILE: ../../../third_party/dart/runtime/bin/snapshot_utils.h +FILE: ../../../third_party/dart/runtime/bin/socket_base.cc +FILE: ../../../third_party/dart/runtime/bin/socket_base.h +FILE: ../../../third_party/dart/runtime/bin/sync_socket.cc +FILE: ../../../third_party/dart/runtime/bin/sync_socket.h +FILE: ../../../third_party/dart/runtime/bin/sync_socket_android.cc +FILE: ../../../third_party/dart/runtime/bin/sync_socket_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/sync_socket_linux.cc +FILE: ../../../third_party/dart/runtime/bin/sync_socket_macos.cc +FILE: ../../../third_party/dart/runtime/bin/sync_socket_patch.dart +FILE: ../../../third_party/dart/runtime/bin/sync_socket_win.cc +FILE: ../../../third_party/dart/runtime/lib/async.cc +FILE: ../../../third_party/dart/runtime/lib/bigint_patch.dart +FILE: ../../../third_party/dart/runtime/lib/class_id_fasta.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/search_bar.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/allocations.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/dashboard.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/graph.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/memory/snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/reload.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/singletargetcache_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/singletargetcache_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/subtypetestcache_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/subtypetestcache_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline/dashboard.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unlinkedcall_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unlinkedcall_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/service.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/single_target_cache.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/subtype_test_cache.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/timeline.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/unlinked_call.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/single_target_cache.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/subtype_test_cache.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/timeline.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/unlinked_call.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/vm.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/single_target_cache.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/subtype_test_cache.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/timeline.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/unlinked_call.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/vm.dart +FILE: ../../../third_party/dart/runtime/platform/allocation.h +FILE: ../../../third_party/dart/runtime/platform/growable_array.h +FILE: ../../../third_party/dart/runtime/vm/compilation_trace.cc +FILE: ../../../third_party/dart/runtime/vm/compilation_trace.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers_arm.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations_helpers_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/call_specializer.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/call_specializer.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/prologue_builder.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/prologue_builder.h +FILE: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.h +FILE: ../../../third_party/dart/runtime/vm/constants_x86.h +FILE: ../../../third_party/dart/runtime/vm/debugger_api_impl_test.h +FILE: ../../../third_party/dart/runtime/vm/dwarf.cc +FILE: ../../../third_party/dart/runtime/vm/dwarf.h +FILE: ../../../third_party/dart/runtime/vm/fixed_cache.h +FILE: ../../../third_party/dart/runtime/vm/fixed_cache_test.cc +FILE: ../../../third_party/dart/runtime/vm/gc_compactor.cc +FILE: ../../../third_party/dart/runtime/vm/gc_compactor.h +FILE: ../../../third_party/dart/runtime/vm/gdb_helpers.cc +FILE: ../../../third_party/dart/runtime/vm/image_snapshot.cc +FILE: ../../../third_party/dart/runtime/vm/image_snapshot.h +FILE: ../../../third_party/dart/runtime/vm/json_writer.cc +FILE: ../../../third_party/dart/runtime/vm/json_writer.h +FILE: ../../../third_party/dart/runtime/vm/kernel_binary.h +FILE: ../../../third_party/dart/runtime/vm/malloc_hooks.h +FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_arm.cc +FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_jemalloc.cc +FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_tcmalloc.cc +FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_test.cc +FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_unsupported.cc +FILE: ../../../third_party/dart/runtime/vm/malloc_hooks_x64.cc +FILE: ../../../third_party/dart/runtime/vm/mixin_test.cc +FILE: ../../../third_party/dart/runtime/vm/stack_trace.cc +FILE: ../../../third_party/dart/runtime/vm/stack_trace.h +FILE: ../../../third_party/dart/runtime/vm/timeline_android.cc +FILE: ../../../third_party/dart/runtime/vm/timeline_fuchsia.cc +FILE: ../../../third_party/dart/runtime/vm/timeline_linux.cc +FILE: ../../../third_party/dart/runtime/vm/timeline_macos.cc +FILE: ../../../third_party/dart/runtime/vm/timeline_win.cc +FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.cc +FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.h +FILE: ../../../third_party/dart/sdk/lib/_http/overrides.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/cli_patch.dart +FILE: ../../../third_party/dart/sdk/lib/cli/cli.dart +FILE: ../../../third_party/dart/sdk/lib/cli/wait_for.dart +FILE: ../../../third_party/dart/sdk/lib/core/bigint.dart +FILE: ../../../third_party/dart/sdk/lib/internal/linked_list.dart +FILE: ../../../third_party/dart/sdk/lib/internal/patch.dart +FILE: ../../../third_party/dart/sdk/lib/io/embedder_config.dart +FILE: ../../../third_party/dart/sdk/lib/io/namespace_impl.dart +FILE: ../../../third_party/dart/sdk/lib/io/overrides.dart +FILE: ../../../third_party/dart/sdk/lib/io/sync_socket.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/named_lookup.dart +FILE: ../../../third_party/dart/utils/bazel/kernel_summary_worker.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/console.h + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/console.h +FILE: ../../../third_party/dart/runtime/bin/console_posix.cc +FILE: ../../../third_party/dart/runtime/bin/console_win.cc +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/crypto_fuchsia.cc + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/crypto_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/crypto_test.cc +FILE: ../../../third_party/dart/runtime/bin/directory_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/directory_test.cc +FILE: ../../../third_party/dart/runtime/bin/eventhandler_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/eventhandler_fuchsia.h +FILE: ../../../third_party/dart/runtime/bin/extensions_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/file_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/file_support.cc +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/loader.cc +FILE: ../../../third_party/dart/runtime/bin/loader.h +FILE: ../../../third_party/dart/runtime/bin/log_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/platform_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/process_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/reference_counting.h +FILE: ../../../third_party/dart/runtime/bin/root_certificates_unsupported.cc +FILE: ../../../third_party/dart/runtime/bin/socket_base_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/socket_base_fuchsia.h +FILE: ../../../third_party/dart/runtime/bin/socket_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/stdio_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/thread_fuchsia.cc +FILE: ../../../third_party/dart/runtime/bin/thread_fuchsia.h +FILE: ../../../third_party/dart/runtime/bin/utils_fuchsia.cc +FILE: ../../../third_party/dart/runtime/lib/stacktrace.h +FILE: ../../../third_party/dart/runtime/observatory/lib/event.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/models.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/repositories.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/notification.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/virtual_collection.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/containers/virtual_tree.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/general_error.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/nav_bar.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/nav_menu.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/rendering_queue.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/rendering_scheduler.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/tag.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/uris.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/inbound_references.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/counter_chart.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/location.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/run_state.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/shared_summary.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate/summary.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metric/details.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metric/graph.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/class_menu.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/isolate_menu.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/library_menu.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/menu_item.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify_event.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/notify_exception.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/refresh.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/top_menu.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/nav/vm_menu.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/retaining_path.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_link.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/strongly_reachable_instances.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/top_retaining_instances.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect_target.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/heap_snapshot/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/exceptions.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/breakpoint.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/class.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/code.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/context.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/error.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/event.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/extension_data.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/field.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/flag.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/frame.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/function.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/guarded.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/heap_space.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/icdata.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/inbound_references.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/instance.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/isolate.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/library.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/local_var_descriptors.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/map_association.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/megamorphiccache.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/metric.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/notification.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/object.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/objectpool.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/objectstore.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/pc_descriptors.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/persistent_handles.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/ports.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/retaining_path.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/sample_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/script.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/sentinel.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/source_location.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/target.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/thread.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/timeline_event.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/token_stream.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/type_arguments.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/unknown.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/vm.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/objects/zone.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/breakpoint.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/class.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/context.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/editor.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/eval.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/event.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/field.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/flag.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/function.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/icdata.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/inbound_references.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/instance.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/isolate.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/library.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/megamorphiccache.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/metric.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/notification.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/object.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/objectpool.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/objectstore.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/persistent_handles.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/ports.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/reachable_size.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/retained_size.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/retaining_path.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/sample_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/script.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/strongly_reachable_instances.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/target.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/top_retaining_instances.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/models/repositories/type_arguments.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/breakpoint.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/class.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/context.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/editor.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/eval.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/event.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/field.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/flag.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/function.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/icdata.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/inbound_references.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/instance.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/isolate.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/library.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/megamorphiccache.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/metric.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/notification.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/object.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/objectpool.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/objectstore.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/persistent_handles.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/ports.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/reachable_size.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/retained_size.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/retaining_path.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/sample_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/script.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/settings.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/strongly_reachable_instances.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/target.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/top_retaining_instances.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/repositories/type_arguments.dart +FILE: ../../../third_party/dart/runtime/observatory/web/timeline_message_handler.js +FILE: ../../../third_party/dart/runtime/platform/atomic_fuchsia.h +FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.cc +FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.h +FILE: ../../../third_party/dart/runtime/vm/become.cc +FILE: ../../../third_party/dart/runtime/vm/become.h +FILE: ../../../third_party/dart/runtime/vm/clustered_snapshot.cc +FILE: ../../../third_party/dart/runtime/vm/clustered_snapshot.h +FILE: ../../../third_party/dart/runtime/vm/code_patcher_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_dbc.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_dbc_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/branch_optimizer.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/branch_optimizer.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.h +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/constants_dbc.h +FILE: ../../../third_party/dart/runtime/vm/cpu_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/cpu_dbc.h +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_fuchsia.cc +FILE: ../../../third_party/dart/runtime/vm/dart_api_state.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_dbc.h +FILE: ../../../third_party/dart/runtime/vm/isolate_reload.cc +FILE: ../../../third_party/dart/runtime/vm/isolate_reload.h +FILE: ../../../third_party/dart/runtime/vm/isolate_reload_test.cc +FILE: ../../../third_party/dart/runtime/vm/kernel.cc +FILE: ../../../third_party/dart/runtime/vm/kernel.h +FILE: ../../../third_party/dart/runtime/vm/kernel_binary.cc +FILE: ../../../third_party/dart/runtime/vm/kernel_isolate.cc +FILE: ../../../third_party/dart/runtime/vm/kernel_isolate.h +FILE: ../../../third_party/dart/runtime/vm/kernel_loader.cc +FILE: ../../../third_party/dart/runtime/vm/kernel_loader.h +FILE: ../../../third_party/dart/runtime/vm/lockers.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol_fuchsia.cc +FILE: ../../../third_party/dart/runtime/vm/object_dbc_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_reload.cc +FILE: ../../../third_party/dart/runtime/vm/object_service.cc +FILE: ../../../third_party/dart/runtime/vm/os_fuchsia.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/safepoint.cc +FILE: ../../../third_party/dart/runtime/vm/safepoint.h +FILE: ../../../third_party/dart/runtime/vm/signal_handler_fuchsia.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_dbc.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_dbc.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_fuchsia.cc +FILE: ../../../third_party/dart/runtime/vm/token_position.cc +FILE: ../../../third_party/dart/runtime/vm/token_position.h +FILE: ../../../third_party/dart/runtime/vm/type_table.h +FILE: ../../../third_party/dart/runtime/vm/uri.cc +FILE: ../../../third_party/dart/runtime/vm/uri.h +FILE: ../../../third_party/dart/runtime/vm/uri_test.cc +FILE: ../../../third_party/dart/runtime/vm/virtual_memory_fuchsia.cc +FILE: ../../../third_party/dart/sdk/lib/developer/service.dart +FILE: ../../../third_party/dart/sdk/lib/js_util/dart2js/js_util_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/devfs.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/process_test.cc + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/process_test.cc +FILE: ../../../third_party/dart/runtime/bin/snapshot_empty.cc +FILE: ../../../third_party/dart/runtime/bin/snapshot_in.cc +FILE: ../../../third_party/dart/runtime/include/dart_tools_api.h +FILE: ../../../third_party/dart/runtime/lib/double.cc +FILE: ../../../third_party/dart/runtime/lib/math.cc +FILE: ../../../third_party/dart/runtime/lib/mirrors.h +FILE: ../../../third_party/dart/runtime/lib/object.cc +FILE: ../../../third_party/dart/runtime/lib/string.cc +FILE: ../../../third_party/dart/runtime/platform/c99_support_win.h +FILE: ../../../third_party/dart/runtime/platform/inttypes_support_win.h +FILE: ../../../third_party/dart/runtime/vm/ast.cc +FILE: ../../../third_party/dart/runtime/vm/ast_printer.cc +FILE: ../../../third_party/dart/runtime/vm/ast_printer.h +FILE: ../../../third_party/dart/runtime/vm/bitfield.h +FILE: ../../../third_party/dart/runtime/vm/code_patcher_ia32_test.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_x64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler_stats.cc +FILE: ../../../third_party/dart/runtime/vm/compiler_stats.h +FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/custom_isolate_test.cc +FILE: ../../../third_party/dart/runtime/vm/dart.h +FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.h +FILE: ../../../third_party/dart/runtime/vm/dart_entry.cc +FILE: ../../../third_party/dart/runtime/vm/dart_entry.h +FILE: ../../../third_party/dart/runtime/vm/debugger_arm.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_x64.cc +FILE: ../../../third_party/dart/runtime/vm/double_conversion.cc +FILE: ../../../third_party/dart/runtime/vm/double_conversion.h +FILE: ../../../third_party/dart/runtime/vm/exceptions.cc +FILE: ../../../third_party/dart/runtime/vm/exceptions.h +FILE: ../../../third_party/dart/runtime/vm/freelist.cc +FILE: ../../../third_party/dart/runtime/vm/gc_marker.cc +FILE: ../../../third_party/dart/runtime/vm/gc_marker.h +FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.cc +FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.h +FILE: ../../../third_party/dart/runtime/vm/handles.h +FILE: ../../../third_party/dart/runtime/vm/longjump.cc +FILE: ../../../third_party/dart/runtime/vm/longjump.h +FILE: ../../../third_party/dart/runtime/vm/longjump_test.cc +FILE: ../../../third_party/dart/runtime/vm/memory_region.cc +FILE: ../../../third_party/dart/runtime/vm/message.cc +FILE: ../../../third_party/dart/runtime/vm/message.h +FILE: ../../../third_party/dart/runtime/vm/message_handler.cc +FILE: ../../../third_party/dart/runtime/vm/message_handler.h +FILE: ../../../third_party/dart/runtime/vm/native_entry.cc +FILE: ../../../third_party/dart/runtime/vm/native_entry.h +FILE: ../../../third_party/dart/runtime/vm/native_entry_test.cc +FILE: ../../../third_party/dart/runtime/vm/native_entry_test.h +FILE: ../../../third_party/dart/runtime/vm/object_store_test.cc +FILE: ../../../third_party/dart/runtime/vm/os.h +FILE: ../../../third_party/dart/runtime/vm/pages.h +FILE: ../../../third_party/dart/runtime/vm/parser_test.cc +FILE: ../../../third_party/dart/runtime/vm/port.h +FILE: ../../../third_party/dart/runtime/vm/resolver.cc +FILE: ../../../third_party/dart/runtime/vm/resolver.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_list.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_x64.cc +FILE: ../../../third_party/dart/runtime/vm/scanner.h +FILE: ../../../third_party/dart/runtime/vm/scavenger.cc +FILE: ../../../third_party/dart/runtime/vm/stack_frame.h +FILE: ../../../third_party/dart/runtime/vm/stub_code.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32_test.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_x64_test.cc +FILE: ../../../third_party/dart/runtime/vm/timer.cc +FILE: ../../../third_party/dart/runtime/vm/timer.h +FILE: ../../../third_party/dart/runtime/vm/token.cc +FILE: ../../../third_party/dart/runtime/vm/unicode_data.cc +FILE: ../../../third_party/dart/runtime/vm/unicode_test.cc +FILE: ../../../third_party/dart/runtime/vm/unit_test.h +FILE: ../../../third_party/dart/runtime/vm/verifier.h +FILE: ../../../third_party/dart/runtime/vm/visitor.h +FILE: ../../../third_party/dart/sdk/lib/collection/queue.dart +FILE: ../../../third_party/dart/sdk/lib/core/comparable.dart +FILE: ../../../third_party/dart/sdk/lib/core/date_time.dart +FILE: ../../../third_party/dart/sdk/lib/core/duration.dart +FILE: ../../../third_party/dart/sdk/lib/core/function.dart +FILE: ../../../third_party/dart/sdk/lib/core/iterable.dart +FILE: ../../../third_party/dart/sdk/lib/core/map.dart +FILE: ../../../third_party/dart/sdk/lib/core/pattern.dart +FILE: ../../../third_party/dart/sdk/lib/core/set.dart +FILE: ../../../third_party/dart/sdk/lib/core/stopwatch.dart +FILE: ../../../third_party/dart/sdk/lib/core/string_buffer.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/device.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/filtered_element_list.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/lists.dart +FILE: ../../../third_party/dart/sdk/lib/internal/iterable.dart +FILE: ../../../third_party/dart/sdk/lib/internal/sort.dart +FILE: ../../../third_party/dart/utils/peg/pegparser.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -14999,8 +15027,64 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages LIBRARY: pkg -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/instrumentation/file_instrumentation.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/instrumentation/file_instrumentation.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/command_line.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/options.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/resolver_provider.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/task.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/analysis_options_provider.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/embedder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/error_processor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/path_filter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/sdk_ext.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/cache.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/context.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/source.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/type_system.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/visitors.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/command_line_plugin.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/engine_plugin.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/options_plugin.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/plugin_configuration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/services/lint.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/format.fbs +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/idl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/public_namespace_computer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/resynthesize.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summarize_elements.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summary_sdk.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/dart.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/dart_work_manager.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/driver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/general.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/html.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/html_work_manager.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/incremental_element_builder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/inputs.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/manager.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/model.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/options.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/options_work_manager.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/strong/checker.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/strong_mode.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/absolute_path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/asserts.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/glob.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/lru_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/yaml.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/dart.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/general.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/html.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/model.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/check_test.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/generate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/idl_model.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/task_dependency_graph/check_test.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/task_dependency_graph/generate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/task_dependency_graph/tasks.dot FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_memoizer.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/cancelable_operation.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart @@ -15019,14 +15103,85 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/as FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_splitter.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/subscription_stream.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.status +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/.status +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/lib/cli_util.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/comparators.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/convert.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/hex.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/hex/decoder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/hex/encoder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/percent.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/percent/decoder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/percent/encoder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/.status +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/example/hash.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/digest.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/digest_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/hash.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/bin/format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/example/format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/fast_hash.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/line_splitter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/rule_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/solve_state.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/solve_state_queue.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/nesting_builder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/nesting_level.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/argument.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/combinator.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/metadata.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/rule.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/type_argument.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/tool/grind.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/build/initializer_plugin.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/build/loader_replacer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/initialize.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/init_method.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/initialize_tracker.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/initializer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/mirror_loader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/static_loader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/test_package/lib/bar.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/test_package/lib/foo.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/.status +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/example/http_server.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/example/runner_pool.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/isolate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/isolate_runner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/load_balancer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/ports.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/registry.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/runner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/src/errors.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/src/lists.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/src/raw_receive_port_multiplexer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/discovery.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/discovery_analysis.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/packages.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/packages_file.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/src/packages_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/src/packages_io_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/src/util.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/plugin/lib/manager.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/plugin/lib/plugin.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/plugin/lib/src/plugin_impl.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/location_mixin.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/unparsed_frame.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/eager_span_scanner.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/expected_function.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/group_context.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/shared.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/benchmark/path_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/file_watcher.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/file_watcher/native.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/file_watcher/polling.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/benchmark/benchmark.dart FILE: ../../../third_party/pkg/when/lib/when.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file @@ -15065,6 +15220,7 @@ LIBRARY: skia LIBRARY: vulkan ORIGIN: ../../../flutter/third_party/txt/LICENSE TYPE: LicenseType.apache +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/async.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/cache.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/check.dart @@ -15078,6 +15234,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/qu FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/concat.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/countdown_timer.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/enumerate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/future_group.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/future_stream.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/iteration.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/metronome.dart @@ -15110,7 +15267,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/qu FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/pattern/glob.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/clock.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/duration_unit_constants.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/util.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/strings.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/time.dart FILE: ../../../third_party/skia/src/images/SkWebpEncoder.cpp @@ -15324,8 +15480,14 @@ limitations under the License. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/viz.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/web_app.dart.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/tasks.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/package_bundle_reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/build_sdk_summaries.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/.analysis_options @@ -15339,7 +15501,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cs FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/af.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/am.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar_DZ.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/az.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/be.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/bg.json @@ -15362,7 +15523,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IE.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IN.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ISO.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_MY.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_SG.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_US.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ZA.json @@ -15378,7 +15538,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fil.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CA.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ga.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gl.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gsw.json @@ -15393,7 +15552,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/in.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/is.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/iw.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ja.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ka.json @@ -15422,13 +15580,11 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/or.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pa.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ps.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_BR.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_PT.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ro.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ru.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sd.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sh.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/si.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sk.json @@ -15455,7 +15611,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/af.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/am.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar_DZ.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/az.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/be.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/bg.json @@ -15478,7 +15633,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IE.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IN.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ISO.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_MY.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_SG.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_US.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ZA.json @@ -15494,7 +15648,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fil.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CA.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ga.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gl.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gsw.json @@ -15509,7 +15662,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/in.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/is.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/iw.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ja.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ka.json @@ -15537,7 +15689,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/or.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pa.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ps.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_BR.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_PT.json @@ -15566,7 +15717,124 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_TW.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zu.json ---------------------------------------------------------------------------------------------------- -Copyright 2013, the Dart project authors. All rights reserved. +Copyright 2013, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/benchmark/errors_in_all_libraries.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/benchmark/errors_in_all_libraries.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/ast_factory.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/resolution_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/standard_ast_factory.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/standard_resolution_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/syntactic_entity.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/embedded_resolver_provider.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/custom_resolver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/builder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/ast_factory.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/resolution_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/resolver/inheritance_manager.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/sdk/sdk.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/error/pending_error.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/bazel.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/package.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/source/source_resource.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/api_signature.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/bazel_summary.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/flat_buffers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/link.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/name_filter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/prelink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/pub_summary.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summarize_ast.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summarize_const_expr.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summary_file_builder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/strong/ast_properties.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/yaml.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/fast_uri.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/yaml.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/dump_inferred_types.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/inspect.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/stats.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/null_stream_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/error.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/value.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/single_subscription_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_completer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/handler_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/stream_transformer_wrapper.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/typed.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_subscription_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/future.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream_subscription.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed_stream_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/empty_unmodifiable_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/functions.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/typed_wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set_controller.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/accumulator_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/byte_accumulator_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/string_accumulator_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/tool/node_format_service.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/compact_number_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/plural_rules.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/order_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/meta.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/observable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/list_diff.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/property_change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/to_observable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/relative_span_scanner.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -15596,77 +15864,124 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/dart.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/simple_transformer/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/bin/css.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/analyzer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/property.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenkind.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/validate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_file.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_http_request.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbols.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_browser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_standalone.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/message_lookup_by_library.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/locale_list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/date_format_internal.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/file_data_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/http_request_data_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_formatter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_field.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_helpers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/number_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl_helpers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/lazy_locale_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/tool/generate_locale_data_files.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/lib/logging.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/core_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/description.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/error_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/interfaces.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/iterable_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/map_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/numeric_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/operator_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/string_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/core_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/description.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/error_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/expect.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/future_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/interfaces.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/iterable_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/map_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/numeric_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/operator_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/string_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/constants.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/list_range.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf16.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf32.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf8.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_16_code_unit_decoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/util.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/utf.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/dart.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/example/parser_driver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/example/resolver_driver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/example/scanner_driver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/analyzer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/error.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/string_source.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/args.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/usage.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/async.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/result.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/stream_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/barback.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_forwarder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_id.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/internal_asset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/barback.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/build_result.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/errors.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/asset_cascade.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/group_runner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/package_graph.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_forwarder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_output.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/transform_node.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/log.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/package_provider.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/serialize.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/barback_settings.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transform_logger.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer_group.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/cancelable_future.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/file_pool.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/multiset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_pool.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_replayer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/dart.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/interop.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/messages/build_logger.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/algorithms.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/collection.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/equality.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/iterable_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/algorithms.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/iterable_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/unmodifiable_wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/css.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/css_printer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/polyfill.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_printer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/stream_pool.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/pretty_print.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/context.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/parsed_path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/posix.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/url.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/windows.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/builder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/printer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/refactor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/source_maps.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/src/vlq.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/chain.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/frame.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/stack_zone_specification.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/vm_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/stack_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/typed_data/lib/typed_buffers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/typed_data/lib/typed_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/compact_vm_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_enhanced_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_individual_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/configuration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/pretty_print.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/simple_configuration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/test_case.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/unittest.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/vm_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/example/watch.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/async_queue.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/constructable_file_system_event.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/linux.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/mac_os.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/polling.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/path_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/resubscribable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/stat.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/watch_event.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/watcher.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_exception.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -15698,8 +16013,76 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/context/declared_variables.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/context/declared_variables.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/ast.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/token.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/visitor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/constant/value.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/element/element.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/element/type.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/element/visitor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/error/error.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/error/listener.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/exception/exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/file_system/file_system.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/file_system/memory_file_system.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/file_system/physical_file_system.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/instrumentation/instrumentation.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/package_map_provider.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/package_map_resolver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/pub_package_map_provider.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/cancelable_future.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/codegen/html.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/codegen/text_formatter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/codegen/tools.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/ast.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/token.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/utilities.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/constant/evaluation.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/constant/utilities.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/constant/value.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/builder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/element.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/handle.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/member.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/type.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/utilities.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/error/syntactic_errors.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/resolver/scope.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/scanner/reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/scanner/scanner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/error/codes.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/ast.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/constant.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/element.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/element_handle.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/element_resolver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/engine.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/error.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/error_verifier.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/incremental_logger.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/incremental_resolution_validator.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/incremental_resolver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/interner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_core.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_engine.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_engine_io.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_io.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/resolver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/scanner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/sdk.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/sdk_io.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/source.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/source_io.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/static_type_analyzer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/utilities_collection.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/utilities_dart.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/utilities_general.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/base.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/utilities_timing.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/command_runner.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_results.dart @@ -15730,11 +16113,45 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/ba FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/ascii.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/charcode.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/html_entity.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/assets.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/benchmarks.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/messages/messages.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/resolver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/async_benchmark_base.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/dart_sdk.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/delete_file.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/entry_point.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/messages.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/remove_sourcemap_comment.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/resolver.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/resolver_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/resolvers.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/priority_queue.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/canonicalized_map.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/priority_queue.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/queue_list.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/benchmark/benchmark.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/dart_style.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/argument_list_visitor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/call_chain_visitor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/chunk.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/chunk_builder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/dart_formatter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/debug.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/error_listener.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/formatter_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/formatter_options.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/io.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_writer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/source_code.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/source_visitor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/whitespace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/glob.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/ast.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/list_tree.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_time_patterns.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/.status @@ -15746,6 +16163,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pa FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/internal_style.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/lib/pool.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/src/source_map_span.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/source_span.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/colors.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/file.dart @@ -15755,6 +16173,12 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/so FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span_mixin.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span_with_context.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/line_scanner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/span_scanner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/string_scanner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/string_scanner.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/internal_test_case.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher.dart @@ -15772,83 +16196,19 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/us FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/usage_html.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/usage_io.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/tool/grind.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/windows.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/equality.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/event.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/loader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/null_span.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/scanner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/style.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/token.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_document.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_node_wrapper.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/null_stream_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/value.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/single_subscription_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_completer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/handler_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/stream_transformer_wrapper.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/typed.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_subscription_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream_subscription.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed_stream_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/empty_unmodifiable_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/functions.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set_controller.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/compact_number_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/plural_rules.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/order_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/meta.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_record.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/list_diff.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/property_change_record.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/to_observable.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -15880,89 +16240,85 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/args.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/usage.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/async.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/barback.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_forwarder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_id.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/internal_asset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/barback.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/build_result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/errors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/asset_cascade.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/group_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/package_graph.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_forwarder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_output.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/transform_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/log.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/package_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/serialize.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/barback_settings.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transform_logger.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer_group.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/cancelable_future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/file_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/multiset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_replayer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/dart.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/interop.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/algorithms.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/collection.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/iterable_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/algorithms.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/iterable_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/unmodifiable_wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/css.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/css_printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/polyfill.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/pretty_print.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/context.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/parsed_path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/posix.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/url.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/windows.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/chain.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/frame.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/stack_zone_specification.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/vm_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/stack_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/compact_vm_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_enhanced_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_individual_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/pretty_print.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/simple_configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/test_case.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/unittest.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/vm_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/simple_transformer/lib/transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/crypto.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/hash_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/hmac.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/md5.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/sha1.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/sha256.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/bin/css.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/analyzer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/messages.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/options.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/property.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/token.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer_base.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenkind.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_base.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/validate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/visitor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_file.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_http_request.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbols.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_browser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_standalone.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/message_lookup_by_library.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/locale_list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/date_format_internal.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/file_data_reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/http_request_data_reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_formatter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_field.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_helpers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/number_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl_helpers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/lazy_locale_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/tool/generate_locale_data_files.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/lib/logging.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/core_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/description.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/error_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/interfaces.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/iterable_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/map_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/numeric_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/operator_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/string_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/core_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/description.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/error_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/expect.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/future_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/interfaces.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/iterable_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/map_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/numeric_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/operator_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/string_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/constants.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/list_range.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf16.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf32.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf8.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_16_code_unit_decoder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/util.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/utf.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_node.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/yaml.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -15996,8 +16352,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/tool/rename_build_outputs.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/typed_data/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/.test_config ---------------------------------------------------------------------------------------------------- Copyright 2015, the Dart project authors. All rights reserved. @@ -16034,6 +16398,9 @@ ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/ TYPE: LicenseType.bsd FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_cache.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/byte_collector.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/example/main.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/lib/cli_logging.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_iterable.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_list.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_map.dart @@ -16074,23 +16441,32 @@ LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/dist/dart-style.d.ts +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/web/index.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/web/main.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/compiler.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/encodings.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/libraries/Dart_Packages.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/libraries/Dart_SDK.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/misc.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/modules.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/pool.iml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/vcs.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/workspace.xml FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/benchmark/output.json ---------------------------------------------------------------------------------------------------- Copyright 2014, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -16328,7 +16704,7 @@ met: LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/LICENSE TYPE: LicenseType.mit -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/dom.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/dom_parsing.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/parser.dart @@ -16371,11 +16747,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols_data.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2017, the Dart project authors. +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. @@ -16408,15 +16785,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/.analysis_options ---------------------------------------------------------------------------------------------------- -Copyright (c) 2014, the Dart project authors. -Please see the AUTHORS file -for details. All rights reserved. - +Copyright 2016, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16446,11 +16819,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/test_controller.js ---------------------------------------------------------------------------------------------------- -Copyright 2016, the Dart project authors. All rights reserved. +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16480,18 +16856,99 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/test_controller.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/e2e_test/html_imports/lib/theme.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/bower.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/package.json ---------------------------------------------------------------------------------------------------- -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright (c) 2012 The Polymer Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/CustomElements.js +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/CustomElements.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/CustomElements.min.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/HTMLImports.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/HTMLImports.min.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/MutationObserver.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/MutationObserver.min.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/ShadowDOM.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/ShadowDOM.min.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents-lite.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents-lite.min.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents.min.js +---------------------------------------------------------------------------------------------------- +Copyright (c) 2014 The Polymer Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop_support.html + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop_support.html +---------------------------------------------------------------------------------------------------- +Copyright 2014 The Dart project authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above @@ -16501,7 +16958,6 @@ met: * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -16515,6 +16971,35 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/libyaml-license.txt +TYPE: LicenseType.mit +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/benchmark/output.json +---------------------------------------------------------------------------------------------------- +Copyright (c) 2006 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: rapidjson ORIGIN: ../../../third_party/rapidjson/rapidjson/error/en.h @@ -21914,4 +22399,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 317 +Total license count: 320 From d6dd4e598e9b23029c2ac0c81e796314b234289d Mon Sep 17 00:00:00 2001 From: Siva Date: Wed, 4 Apr 2018 23:04:09 -0700 Subject: [PATCH 0055/1190] Roll dart to version 2676c132cbfd88befcecc544b2e902c255e44b34 (#4938) --- DEPS | 10 +- travis/licenses_golden/licenses_third_party | 2443 ++++++++----------- 2 files changed, 984 insertions(+), 1469 deletions(-) diff --git a/DEPS b/DEPS index 2cca21e22cd8f..f80f52c24b1a8 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '52afcba357ad398e8c24f3e3363ac6ff5293df63', + 'dart_revision': '2676c132cbfd88befcecc544b2e902c255e44b34', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -48,7 +48,7 @@ vars = { 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.5+1', 'dart_dart_style_tag': '1.0.10', - 'dart_dartdoc_tag': 'v0.18.0', + 'dart_dartdoc_tag': 'v0.18.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', @@ -68,15 +68,15 @@ vars = { 'dart_mockito_tag': 'a92db054fba18bc2d605be7670aee74b7cadc00a', 'dart_mustache4dart_tag': 'v2.1.0', 'dart_oauth2_tag': '1.1.0', - 'dart_observatory_pub_packages_rev': '4c282bb240b68f407c8c7779a65c68eeb0139dc6', + 'dart_observatory_pub_packages_rev': 'd3a3aebefbd35aa30fe7bbc2889b772b398f7d7f', 'dart_package_config_tag': '1.0.3', 'dart_package_resolver_tag': '1.0.2+1', 'dart_path_tag': '1.5.1', 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '875d35005a7d33f367d70a3e31e9d3bad5d1ebd8', - 'dart_pub_semver_tag': '1.3.2', + 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', + 'dart_pub_semver_tag': '1.3.4', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b6551f20cfa47..fb8be9a44e68a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6d40c6cdc2b0a27173677e57f49fb54a +Signature: 3fc14486250c20c91df483399a9ffd9b UNUSED LICENSES: @@ -4202,110 +4202,126 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/loader.dart + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/address_sanitizer.cc -FILE: ../../../third_party/dart/runtime/bin/builtin_common.cc -FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.cc -FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.h -FILE: ../../../third_party/dart/runtime/bin/observatory_assets_empty.cc -FILE: ../../../third_party/dart/runtime/bin/vmservice/loader.dart -FILE: ../../../third_party/dart/runtime/lib/async_patch.dart -FILE: ../../../third_party/dart/runtime/lib/compact_hash.dart -FILE: ../../../third_party/dart/runtime/lib/developer.cc -FILE: ../../../third_party/dart/runtime/lib/developer.dart -FILE: ../../../third_party/dart/runtime/lib/timeline.cc -FILE: ../../../third_party/dart/runtime/lib/timeline.dart -FILE: ../../../third_party/dart/runtime/lib/vmservice.cc -FILE: ../../../third_party/dart/runtime/observatory/lib/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/cli.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/sample_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/allocation_profile/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/analytics.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/cli/command.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger_location.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging_list.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/persistent_handles.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/ports.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline_page.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/view_footer.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/sample_profile/sample_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/web/timeline.js -FILE: ../../../third_party/dart/runtime/vm/atomic_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.h -FILE: ../../../third_party/dart/runtime/vm/log.cc -FILE: ../../../third_party/dart/runtime/vm/log.h -FILE: ../../../third_party/dart/runtime/vm/log_test.cc -FILE: ../../../third_party/dart/runtime/vm/os_thread.cc -FILE: ../../../third_party/dart/runtime/vm/profiler_service.cc -FILE: ../../../third_party/dart/runtime/vm/profiler_service.h -FILE: ../../../third_party/dart/runtime/vm/program_visitor.cc -FILE: ../../../third_party/dart/runtime/vm/program_visitor.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode_inl.h -FILE: ../../../third_party/dart/runtime/vm/regexp_bytecodes.h -FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.h -FILE: ../../../third_party/dart/runtime/vm/scope_timer.h -FILE: ../../../third_party/dart/runtime/vm/service_event.cc -FILE: ../../../third_party/dart/runtime/vm/service_event.h -FILE: ../../../third_party/dart/runtime/vm/service_isolate.cc -FILE: ../../../third_party/dart/runtime/vm/source_report.cc -FILE: ../../../third_party/dart/runtime/vm/source_report.h -FILE: ../../../third_party/dart/runtime/vm/source_report_test.cc -FILE: ../../../third_party/dart/runtime/vm/thread.cc -FILE: ../../../third_party/dart/runtime/vm/thread.h -FILE: ../../../third_party/dart/runtime/vm/thread_barrier.h -FILE: ../../../third_party/dart/runtime/vm/thread_barrier_test.cc -FILE: ../../../third_party/dart/runtime/vm/thread_registry.cc -FILE: ../../../third_party/dart/runtime/vm/thread_registry.h -FILE: ../../../third_party/dart/runtime/vm/timeline.cc -FILE: ../../../third_party/dart/runtime/vm/timeline.h -FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.cc -FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.h -FILE: ../../../third_party/dart/runtime/vm/timeline_test.cc -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/developer_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/d8.js -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart -FILE: ../../../third_party/dart/sdk/lib/convert/base64.dart -FILE: ../../../third_party/dart/sdk/lib/dart_client.platform -FILE: ../../../third_party/dart/sdk/lib/dart_server.platform -FILE: ../../../third_party/dart/sdk/lib/dart_shared.platform -FILE: ../../../third_party/dart/sdk/lib/developer/developer.dart -FILE: ../../../third_party/dart/sdk/lib/developer/extension.dart -FILE: ../../../third_party/dart/sdk/lib/developer/timeline.dart -FILE: ../../../third_party/dart/sdk/lib/io/io_resource_info.dart -FILE: ../../../third_party/dart/sdk/lib/io/security_context.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/asset.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/vmservice.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/common.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/html_import_annotation_recorder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/import_inliner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/mirrors_remover.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/script_compactor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/test_compatibility.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/web_components.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/custom_element_proxy.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/html_import_annotation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/init.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/custom_element.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/init.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/normalize_path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/web_components.dart +FILE: ../../../third_party/dart/runtime/lib/bigint.dart +FILE: ../../../third_party/dart/runtime/lib/class_id.cc +FILE: ../../../third_party/dart/runtime/lib/class_id.dart +FILE: ../../../third_party/dart/runtime/lib/convert_patch.dart +FILE: ../../../third_party/dart/runtime/lib/lib_prefix.dart +FILE: ../../../third_party/dart/runtime/lib/linked_hash_map.cc +FILE: ../../../third_party/dart/runtime/lib/profiler.cc +FILE: ../../../third_party/dart/runtime/lib/profiler.dart +FILE: ../../../third_party/dart/runtime/observatory/bin/shell.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/app.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_common.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_html.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_io.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/utils.dart +FILE: ../../../third_party/dart/runtime/observatory/web/main.dart +FILE: ../../../third_party/dart/runtime/platform/address_sanitizer.h +FILE: ../../../third_party/dart/runtime/platform/math.h +FILE: ../../../third_party/dart/runtime/platform/memory_sanitizer.h +FILE: ../../../third_party/dart/runtime/platform/safe_stack.h +FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart +FILE: ../../../third_party/dart/runtime/vm/ast_transformer.cc +FILE: ../../../third_party/dart/runtime/vm/ast_transformer.h +FILE: ../../../third_party/dart/runtime/vm/bigint_test.cc +FILE: ../../../third_party/dart/runtime/vm/bit_set_test.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h +FILE: ../../../third_party/dart/runtime/vm/constants_arm64.h +FILE: ../../../third_party/dart/runtime/vm/cpu_arm.h +FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.h +FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.h +FILE: ../../../third_party/dart/runtime/vm/cpu_x64.h +FILE: ../../../third_party/dart/runtime/vm/cpuid.cc +FILE: ../../../third_party/dart/runtime/vm/cpuid.h +FILE: ../../../third_party/dart/runtime/vm/cpuinfo.h +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_test.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/hash_table.h +FILE: ../../../third_party/dart/runtime/vm/hash_table_test.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.h +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/metrics.cc +FILE: ../../../third_party/dart/runtime/vm/metrics.h +FILE: ../../../third_party/dart/runtime/vm/metrics_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_graph.cc +FILE: ../../../third_party/dart/runtime/vm/object_graph.h +FILE: ../../../third_party/dart/runtime/vm/object_graph_test.cc +FILE: ../../../third_party/dart/runtime/vm/regexp.cc +FILE: ../../../third_party/dart/runtime/vm/regexp.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h +FILE: ../../../third_party/dart/runtime/vm/regexp_ast.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_ast.h +FILE: ../../../third_party/dart/runtime/vm/regexp_parser.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_parser.h +FILE: ../../../third_party/dart/runtime/vm/regexp_test.cc +FILE: ../../../third_party/dart/runtime/vm/report.cc +FILE: ../../../third_party/dart/runtime/vm/report.h +FILE: ../../../third_party/dart/runtime/vm/ring_buffer.h +FILE: ../../../third_party/dart/runtime/vm/ring_buffer_test.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/scavenger_test.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.h +FILE: ../../../third_party/dart/runtime/vm/spaces.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/tags.cc +FILE: ../../../third_party/dart/runtime/vm/unibrow-inl.h +FILE: ../../../third_party/dart/runtime/vm/unibrow.cc +FILE: ../../../third_party/dart/runtime/vm/unibrow.h +FILE: ../../../third_party/dart/runtime/vm/verified_memory_test.cc +FILE: ../../../third_party/dart/runtime/vm/weak_code.cc +FILE: ../../../third_party/dart/runtime/vm/weak_code.h +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_serialization.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart +FILE: ../../../third_party/dart/sdk/lib/collection/set.dart +FILE: ../../../third_party/dart/sdk/lib/core/sink.dart +FILE: ../../../third_party/dart/sdk/lib/developer/profiler.dart +FILE: ../../../third_party/dart/sdk/lib/io/process.dart +FILE: ../../../third_party/dart/sdk/lib/io/service_object.dart +FILE: ../../../third_party/dart/sdk/lib/isolate/capability.dart +FILE: ../../../third_party/dart/sdk/lib/profiler/profiler.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/css_class_set.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -4335,505 +4351,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/server.dart + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/WATCHLISTS -FILE: ../../../third_party/dart/runtime/bin/eventhandler_win.cc -FILE: ../../../third_party/dart/runtime/bin/file.cc -FILE: ../../../third_party/dart/runtime/bin/file.h -FILE: ../../../third_party/dart/runtime/bin/file_system_entity_patch.dart -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.cc -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.h -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_android.cc -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_linux.cc -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_macos.cc -FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_win.cc -FILE: ../../../third_party/dart/runtime/bin/filter.cc -FILE: ../../../third_party/dart/runtime/bin/filter.h -FILE: ../../../third_party/dart/runtime/bin/filter_patch.dart -FILE: ../../../third_party/dart/runtime/bin/gen_snapshot.cc -FILE: ../../../third_party/dart/runtime/bin/io_natives.cc -FILE: ../../../third_party/dart/runtime/bin/io_service.cc -FILE: ../../../third_party/dart/runtime/bin/io_service.h -FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.cc -FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.h -FILE: ../../../third_party/dart/runtime/bin/io_service_patch.dart -FILE: ../../../third_party/dart/runtime/bin/process.cc -FILE: ../../../third_party/dart/runtime/bin/process_patch.dart -FILE: ../../../third_party/dart/runtime/bin/socket.cc -FILE: ../../../third_party/dart/runtime/bin/socket.h -FILE: ../../../third_party/dart/runtime/bin/socket_base_linux.cc -FILE: ../../../third_party/dart/runtime/bin/socket_base_macos.cc -FILE: ../../../third_party/dart/runtime/bin/socket_base_win.cc -FILE: ../../../third_party/dart/runtime/bin/socket_linux.cc -FILE: ../../../third_party/dart/runtime/bin/socket_macos.cc -FILE: ../../../third_party/dart/runtime/bin/socket_patch.dart -FILE: ../../../third_party/dart/runtime/bin/socket_win.cc -FILE: ../../../third_party/dart/runtime/bin/stdio.cc -FILE: ../../../third_party/dart/runtime/bin/stdio.h -FILE: ../../../third_party/dart/runtime/bin/stdio_android.cc -FILE: ../../../third_party/dart/runtime/bin/stdio_linux.cc -FILE: ../../../third_party/dart/runtime/bin/stdio_macos.cc -FILE: ../../../third_party/dart/runtime/bin/stdio_patch.dart -FILE: ../../../third_party/dart/runtime/bin/stdio_win.cc -FILE: ../../../third_party/dart/runtime/bin/vmservice/server.dart -FILE: ../../../third_party/dart/runtime/bin/vmservice/vmservice_io.dart -FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.cc -FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.h -FILE: ../../../third_party/dart/runtime/include/dart_mirrors_api.h -FILE: ../../../third_party/dart/runtime/include/dart_native_api.h -FILE: ../../../third_party/dart/runtime/lib/collection_patch.dart -FILE: ../../../third_party/dart/runtime/lib/core_patch.dart -FILE: ../../../third_party/dart/runtime/lib/deferred_load_patch.dart -FILE: ../../../third_party/dart/runtime/lib/function.dart -FILE: ../../../third_party/dart/runtime/lib/internal_patch.dart -FILE: ../../../third_party/dart/runtime/lib/invocation_mirror.h -FILE: ../../../third_party/dart/runtime/lib/libgen_in.cc -FILE: ../../../third_party/dart/runtime/lib/mirror_reference.dart -FILE: ../../../third_party/dart/runtime/lib/null_patch.dart -FILE: ../../../third_party/dart/runtime/lib/schedule_microtask_patch.dart -FILE: ../../../third_party/dart/runtime/lib/simd128.cc -FILE: ../../../third_party/dart/runtime/lib/stacktrace.cc -FILE: ../../../third_party/dart/runtime/lib/stacktrace.dart -FILE: ../../../third_party/dart/runtime/lib/symbol_patch.dart -FILE: ../../../third_party/dart/runtime/lib/timer_impl.dart -FILE: ../../../third_party/dart/runtime/lib/typed_data.cc -FILE: ../../../third_party/dart/runtime/lib/typed_data_patch.dart -FILE: ../../../third_party/dart/runtime/lib/uri.cc -FILE: ../../../third_party/dart/runtime/lib/uri_patch.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/application.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/location_manager.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_instances.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile_table.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/curly_block.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/eval_box.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/flag_list.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/any_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/json_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/local_var_descriptors_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/native_memory_profiler.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_common.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectstore_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/observatory_application.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/pc_descriptors_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sample_buffer_control.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_inset.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_value.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_inset.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/stack_trace_tree_config.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/token_stream_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/type_arguments_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unknown_ref.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_view.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/tracer.dart -FILE: ../../../third_party/dart/runtime/platform/atomic.h -FILE: ../../../third_party/dart/runtime/platform/atomic_android.h -FILE: ../../../third_party/dart/runtime/platform/atomic_linux.h -FILE: ../../../third_party/dart/runtime/platform/atomic_macos.h -FILE: ../../../third_party/dart/runtime/platform/atomic_win.h -FILE: ../../../third_party/dart/runtime/platform/signal_blocker.h -FILE: ../../../third_party/dart/runtime/vm/allocation.h -FILE: ../../../third_party/dart/runtime/vm/class_finalizer.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_x64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.h -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_x64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.cc -FILE: ../../../third_party/dart/runtime/vm/constants_arm.h -FILE: ../../../third_party/dart/runtime/vm/constants_ia32.h -FILE: ../../../third_party/dart/runtime/vm/constants_x64.h -FILE: ../../../third_party/dart/runtime/vm/dart.cc -FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.cc -FILE: ../../../third_party/dart/runtime/vm/deferred_objects.cc -FILE: ../../../third_party/dart/runtime/vm/deferred_objects.h -FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.cc -FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.h -FILE: ../../../third_party/dart/runtime/vm/guard_field_test.cc -FILE: ../../../third_party/dart/runtime/vm/instructions.h -FILE: ../../../third_party/dart/runtime/vm/instructions_arm.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm.h -FILE: ../../../third_party/dart/runtime/vm/instructions_arm_test.cc -FILE: ../../../third_party/dart/runtime/vm/isolate.cc -FILE: ../../../third_party/dart/runtime/vm/isolate.h -FILE: ../../../third_party/dart/runtime/vm/json_stream.cc -FILE: ../../../third_party/dart/runtime/vm/json_stream.h -FILE: ../../../third_party/dart/runtime/vm/mirrors_api_impl.cc -FILE: ../../../third_party/dart/runtime/vm/native_api_impl.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol.h -FILE: ../../../third_party/dart/runtime/vm/native_symbol_android.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_linux.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_macos.cc -FILE: ../../../third_party/dart/runtime/vm/native_symbol_win.cc -FILE: ../../../third_party/dart/runtime/vm/object_id_ring.cc -FILE: ../../../third_party/dart/runtime/vm/object_id_ring.h -FILE: ../../../third_party/dart/runtime/vm/object_id_ring_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_store.cc -FILE: ../../../third_party/dart/runtime/vm/os_test.cc -FILE: ../../../third_party/dart/runtime/vm/profiler.cc -FILE: ../../../third_party/dart/runtime/vm/profiler.h -FILE: ../../../third_party/dart/runtime/vm/profiler_test.cc -FILE: ../../../third_party/dart/runtime/vm/random.cc -FILE: ../../../third_party/dart/runtime/vm/random.h -FILE: ../../../third_party/dart/runtime/vm/reusable_handles.h -FILE: ../../../third_party/dart/runtime/vm/service.cc -FILE: ../../../third_party/dart/runtime/vm/service.h -FILE: ../../../third_party/dart/runtime/vm/service_isolate.h -FILE: ../../../third_party/dart/runtime/vm/service_test.cc -FILE: ../../../third_party/dart/runtime/vm/signal_handler.h -FILE: ../../../third_party/dart/runtime/vm/signal_handler_android.cc -FILE: ../../../third_party/dart/runtime/vm/signal_handler_linux.cc -FILE: ../../../third_party/dart/runtime/vm/signal_handler_macos.cc -FILE: ../../../third_party/dart/runtime/vm/signal_handler_win.cc -FILE: ../../../third_party/dart/runtime/vm/simulator.h -FILE: ../../../third_party/dart/runtime/vm/simulator_arm.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_ia32.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_x64.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm_test.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_x64.cc -FILE: ../../../third_party/dart/runtime/vm/tags.h -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.cc -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.h -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_android.cc -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_linux.cc -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_macos.cc -FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_win.cc -FILE: ../../../third_party/dart/runtime/vm/weak_table.cc -FILE: ../../../third_party/dart/runtime/vm/weak_table.h -FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http_headers.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http_impl.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http_parser.dart -FILE: ../../../third_party/dart/sdk/lib/_http/http_session.dart -FILE: ../../../third_party/dart/sdk/lib/_http/websocket.dart -FILE: ../../../third_party/dart/sdk/lib/_http/websocket_impl.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/annotations.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/collection_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/convert_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/internal_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/io_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_helper.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_names.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_primitives.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_rti.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart -FILE: ../../../third_party/dart/sdk/lib/async/deferred_load.dart -FILE: ../../../third_party/dart/sdk/lib/async/schedule_microtask.dart -FILE: ../../../third_party/dart/sdk/lib/async/stream.dart -FILE: ../../../third_party/dart/sdk/lib/async/stream_transformers.dart -FILE: ../../../third_party/dart/sdk/lib/async/zone.dart -FILE: ../../../third_party/dart/sdk/lib/collection/collections.dart -FILE: ../../../third_party/dart/sdk/lib/collection/hash_map.dart -FILE: ../../../third_party/dart/sdk/lib/collection/hash_set.dart -FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_map.dart -FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_set.dart -FILE: ../../../third_party/dart/sdk/lib/collection/linked_list.dart -FILE: ../../../third_party/dart/sdk/lib/collection/list.dart -FILE: ../../../third_party/dart/sdk/lib/convert/ascii.dart -FILE: ../../../third_party/dart/sdk/lib/convert/byte_conversion.dart -FILE: ../../../third_party/dart/sdk/lib/convert/chunked_conversion.dart -FILE: ../../../third_party/dart/sdk/lib/convert/codec.dart -FILE: ../../../third_party/dart/sdk/lib/convert/convert.dart -FILE: ../../../third_party/dart/sdk/lib/convert/converter.dart -FILE: ../../../third_party/dart/sdk/lib/convert/encoding.dart -FILE: ../../../third_party/dart/sdk/lib/convert/html_escape.dart -FILE: ../../../third_party/dart/sdk/lib/convert/json.dart -FILE: ../../../third_party/dart/sdk/lib/convert/latin1.dart -FILE: ../../../third_party/dart/sdk/lib/convert/line_splitter.dart -FILE: ../../../third_party/dart/sdk/lib/convert/string_conversion.dart -FILE: ../../../third_party/dart/sdk/lib/convert/utf.dart -FILE: ../../../third_party/dart/sdk/lib/core/annotations.dart -FILE: ../../../third_party/dart/sdk/lib/core/null.dart -FILE: ../../../third_party/dart/sdk/lib/core/stacktrace.dart -FILE: ../../../third_party/dart/sdk/lib/core/string_sink.dart -FILE: ../../../third_party/dart/sdk/lib/core/symbol.dart -FILE: ../../../third_party/dart/sdk/lib/internal/list.dart -FILE: ../../../third_party/dart/sdk/lib/internal/print.dart -FILE: ../../../third_party/dart/sdk/lib/internal/symbol.dart -FILE: ../../../third_party/dart/sdk/lib/io/bytes_builder.dart -FILE: ../../../third_party/dart/sdk/lib/io/data_transformer.dart -FILE: ../../../third_party/dart/sdk/lib/io/file.dart -FILE: ../../../third_party/dart/sdk/lib/io/file_impl.dart -FILE: ../../../third_party/dart/sdk/lib/io/file_system_entity.dart -FILE: ../../../third_party/dart/sdk/lib/io/io_service.dart -FILE: ../../../third_party/dart/sdk/lib/io/io_sink.dart -FILE: ../../../third_party/dart/sdk/lib/io/link.dart -FILE: ../../../third_party/dart/sdk/lib/io/secure_socket.dart -FILE: ../../../third_party/dart/sdk/lib/io/socket.dart -FILE: ../../../third_party/dart/sdk/lib/io/stdio.dart -FILE: ../../../third_party/dart/sdk/lib/io/string_transformer.dart -FILE: ../../../third_party/dart/sdk/lib/js/dart2js/js_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/math/jenkins_smi_hash.dart -FILE: ../../../third_party/dart/sdk/lib/math/point.dart -FILE: ../../../third_party/dart/sdk/lib/math/rectangle.dart -FILE: ../../../third_party/dart/sdk/lib/mirrors/mirrors.dart -FILE: ../../../third_party/dart/sdk/lib/typed_data/typed_data.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/client.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/constants.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/message.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/message_router.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolate.dart -FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolates.dart -FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/build/import_crawler.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/polyfill.dart -FILE: ../../../third_party/dart/utils/compiler/create_snapshot_entry.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/lib/bigint.dart -FILE: ../../../third_party/dart/runtime/lib/class_id.cc -FILE: ../../../third_party/dart/runtime/lib/class_id.dart -FILE: ../../../third_party/dart/runtime/lib/convert_patch.dart -FILE: ../../../third_party/dart/runtime/lib/lib_prefix.dart -FILE: ../../../third_party/dart/runtime/lib/linked_hash_map.cc -FILE: ../../../third_party/dart/runtime/lib/profiler.cc -FILE: ../../../third_party/dart/runtime/lib/profiler.dart -FILE: ../../../third_party/dart/runtime/observatory/bin/shell.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/app.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_common.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_html.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_io.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/utils.dart -FILE: ../../../third_party/dart/runtime/observatory/web/main.dart -FILE: ../../../third_party/dart/runtime/platform/address_sanitizer.h -FILE: ../../../third_party/dart/runtime/platform/math.h -FILE: ../../../third_party/dart/runtime/platform/memory_sanitizer.h -FILE: ../../../third_party/dart/runtime/platform/safe_stack.h -FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart -FILE: ../../../third_party/dart/runtime/vm/ast_transformer.cc -FILE: ../../../third_party/dart/runtime/vm/ast_transformer.h -FILE: ../../../third_party/dart/runtime/vm/bigint_test.cc -FILE: ../../../third_party/dart/runtime/vm/bit_set_test.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h -FILE: ../../../third_party/dart/runtime/vm/constants_arm64.h -FILE: ../../../third_party/dart/runtime/vm/cpu_arm.h -FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.h -FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.h -FILE: ../../../third_party/dart/runtime/vm/cpu_x64.h -FILE: ../../../third_party/dart/runtime/vm/cpuid.cc -FILE: ../../../third_party/dart/runtime/vm/cpuid.h -FILE: ../../../third_party/dart/runtime/vm/cpuinfo.h -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_test.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/hash_table.h -FILE: ../../../third_party/dart/runtime/vm/hash_table_test.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.h -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/metrics.cc -FILE: ../../../third_party/dart/runtime/vm/metrics.h -FILE: ../../../third_party/dart/runtime/vm/metrics_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_graph.cc -FILE: ../../../third_party/dart/runtime/vm/object_graph.h -FILE: ../../../third_party/dart/runtime/vm/object_graph_test.cc -FILE: ../../../third_party/dart/runtime/vm/regexp.cc -FILE: ../../../third_party/dart/runtime/vm/regexp.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h -FILE: ../../../third_party/dart/runtime/vm/regexp_ast.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_ast.h -FILE: ../../../third_party/dart/runtime/vm/regexp_parser.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_parser.h -FILE: ../../../third_party/dart/runtime/vm/regexp_test.cc -FILE: ../../../third_party/dart/runtime/vm/report.cc -FILE: ../../../third_party/dart/runtime/vm/report.h -FILE: ../../../third_party/dart/runtime/vm/ring_buffer.h -FILE: ../../../third_party/dart/runtime/vm/ring_buffer_test.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/scavenger_test.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.h -FILE: ../../../third_party/dart/runtime/vm/spaces.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/tags.cc -FILE: ../../../third_party/dart/runtime/vm/unibrow-inl.h -FILE: ../../../third_party/dart/runtime/vm/unibrow.cc -FILE: ../../../third_party/dart/runtime/vm/unibrow.h -FILE: ../../../third_party/dart/runtime/vm/verified_memory_test.cc -FILE: ../../../third_party/dart/runtime/vm/weak_code.cc -FILE: ../../../third_party/dart/runtime/vm/weak_code.h -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_serialization.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart -FILE: ../../../third_party/dart/sdk/lib/collection/set.dart -FILE: ../../../third_party/dart/sdk/lib/core/sink.dart -FILE: ../../../third_party/dart/sdk/lib/developer/profiler.dart -FILE: ../../../third_party/dart/sdk/lib/io/process.dart -FILE: ../../../third_party/dart/sdk/lib/io/service_object.dart -FILE: ../../../third_party/dart/sdk/lib/isolate/capability.dart -FILE: ../../../third_party/dart/sdk/lib/profiler/profiler.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/css_class_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/dart_support.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop_support.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/mirror_initializer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/src/static_initializer.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/dart/.mailmap FILE: ../../../third_party/dart/client/idea/.idea/.name @@ -5492,8 +5010,6 @@ FILE: ../../../third_party/dart/runtime/vm/stack_trace.h FILE: ../../../third_party/dart/runtime/vm/timeline_android.cc FILE: ../../../third_party/dart/runtime/vm/timeline_fuchsia.cc FILE: ../../../third_party/dart/runtime/vm/timeline_linux.cc -FILE: ../../../third_party/dart/runtime/vm/timeline_macos.cc -FILE: ../../../third_party/dart/runtime/vm/timeline_win.cc FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.cc FILE: ../../../third_party/dart/runtime/vm/zone_text_buffer.h FILE: ../../../third_party/dart/sdk/lib/_http/overrides.dart @@ -5824,7 +5340,254 @@ FILE: ../../../third_party/dart/sdk/lib/developer/service.dart FILE: ../../../third_party/dart/sdk/lib/js_util/dart2js/js_util_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/vmservice/devfs.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/process_test.cc + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/process_test.cc +FILE: ../../../third_party/dart/runtime/bin/snapshot_empty.cc +FILE: ../../../third_party/dart/runtime/bin/snapshot_in.cc +FILE: ../../../third_party/dart/runtime/include/dart_tools_api.h +FILE: ../../../third_party/dart/runtime/lib/double.cc +FILE: ../../../third_party/dart/runtime/lib/math.cc +FILE: ../../../third_party/dart/runtime/lib/mirrors.h +FILE: ../../../third_party/dart/runtime/lib/object.cc +FILE: ../../../third_party/dart/runtime/lib/string.cc +FILE: ../../../third_party/dart/runtime/platform/c99_support_win.h +FILE: ../../../third_party/dart/runtime/platform/inttypes_support_win.h +FILE: ../../../third_party/dart/runtime/vm/ast.cc +FILE: ../../../third_party/dart/runtime/vm/ast_printer.cc +FILE: ../../../third_party/dart/runtime/vm/ast_printer.h +FILE: ../../../third_party/dart/runtime/vm/bitfield.h +FILE: ../../../third_party/dart/runtime/vm/code_patcher_ia32_test.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_x64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler_stats.cc +FILE: ../../../third_party/dart/runtime/vm/compiler_stats.h +FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/custom_isolate_test.cc +FILE: ../../../third_party/dart/runtime/vm/dart.h +FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.h +FILE: ../../../third_party/dart/runtime/vm/dart_entry.cc +FILE: ../../../third_party/dart/runtime/vm/dart_entry.h +FILE: ../../../third_party/dart/runtime/vm/debugger_arm.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_x64.cc +FILE: ../../../third_party/dart/runtime/vm/double_conversion.cc +FILE: ../../../third_party/dart/runtime/vm/double_conversion.h +FILE: ../../../third_party/dart/runtime/vm/exceptions.cc +FILE: ../../../third_party/dart/runtime/vm/exceptions.h +FILE: ../../../third_party/dart/runtime/vm/freelist.cc +FILE: ../../../third_party/dart/runtime/vm/gc_marker.cc +FILE: ../../../third_party/dart/runtime/vm/gc_marker.h +FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.cc +FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.h +FILE: ../../../third_party/dart/runtime/vm/handles.h +FILE: ../../../third_party/dart/runtime/vm/longjump.cc +FILE: ../../../third_party/dart/runtime/vm/longjump.h +FILE: ../../../third_party/dart/runtime/vm/longjump_test.cc +FILE: ../../../third_party/dart/runtime/vm/memory_region.cc +FILE: ../../../third_party/dart/runtime/vm/message.cc +FILE: ../../../third_party/dart/runtime/vm/message.h +FILE: ../../../third_party/dart/runtime/vm/message_handler.cc +FILE: ../../../third_party/dart/runtime/vm/message_handler.h +FILE: ../../../third_party/dart/runtime/vm/native_entry.cc +FILE: ../../../third_party/dart/runtime/vm/native_entry.h +FILE: ../../../third_party/dart/runtime/vm/native_entry_test.cc +FILE: ../../../third_party/dart/runtime/vm/native_entry_test.h +FILE: ../../../third_party/dart/runtime/vm/object_store_test.cc +FILE: ../../../third_party/dart/runtime/vm/os.h +FILE: ../../../third_party/dart/runtime/vm/pages.h +FILE: ../../../third_party/dart/runtime/vm/parser_test.cc +FILE: ../../../third_party/dart/runtime/vm/port.h +FILE: ../../../third_party/dart/runtime/vm/resolver.cc +FILE: ../../../third_party/dart/runtime/vm/resolver.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_list.h +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_x64.cc +FILE: ../../../third_party/dart/runtime/vm/scanner.h +FILE: ../../../third_party/dart/runtime/vm/scavenger.cc +FILE: ../../../third_party/dart/runtime/vm/stack_frame.h +FILE: ../../../third_party/dart/runtime/vm/stub_code.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32_test.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_x64_test.cc +FILE: ../../../third_party/dart/runtime/vm/timer.cc +FILE: ../../../third_party/dart/runtime/vm/timer.h +FILE: ../../../third_party/dart/runtime/vm/token.cc +FILE: ../../../third_party/dart/runtime/vm/unicode_data.cc +FILE: ../../../third_party/dart/runtime/vm/unicode_test.cc +FILE: ../../../third_party/dart/runtime/vm/unit_test.h +FILE: ../../../third_party/dart/runtime/vm/verifier.h +FILE: ../../../third_party/dart/runtime/vm/visitor.h +FILE: ../../../third_party/dart/sdk/lib/collection/queue.dart +FILE: ../../../third_party/dart/sdk/lib/core/comparable.dart +FILE: ../../../third_party/dart/sdk/lib/core/date_time.dart +FILE: ../../../third_party/dart/sdk/lib/core/duration.dart +FILE: ../../../third_party/dart/sdk/lib/core/function.dart +FILE: ../../../third_party/dart/sdk/lib/core/iterable.dart +FILE: ../../../third_party/dart/sdk/lib/core/map.dart +FILE: ../../../third_party/dart/sdk/lib/core/pattern.dart +FILE: ../../../third_party/dart/sdk/lib/core/set.dart +FILE: ../../../third_party/dart/sdk/lib/core/stopwatch.dart +FILE: ../../../third_party/dart/sdk/lib/core/string_buffer.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/device.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/filtered_element_list.dart +FILE: ../../../third_party/dart/sdk/lib/html/html_common/lists.dart +FILE: ../../../third_party/dart/sdk/lib/internal/iterable.dart +FILE: ../../../third_party/dart/sdk/lib/internal/sort.dart +FILE: ../../../third_party/dart/utils/peg/pegparser.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/loader.dart + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/address_sanitizer.cc +FILE: ../../../third_party/dart/runtime/bin/builtin_common.cc +FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.cc +FILE: ../../../third_party/dart/runtime/bin/embedded_dart_io.h +FILE: ../../../third_party/dart/runtime/bin/observatory_assets_empty.cc +FILE: ../../../third_party/dart/runtime/bin/vmservice/loader.dart +FILE: ../../../third_party/dart/runtime/lib/async_patch.dart +FILE: ../../../third_party/dart/runtime/lib/compact_hash.dart +FILE: ../../../third_party/dart/runtime/lib/developer.cc +FILE: ../../../third_party/dart/runtime/lib/developer.dart +FILE: ../../../third_party/dart/runtime/lib/timeline.cc +FILE: ../../../third_party/dart/runtime/lib/timeline.dart +FILE: ../../../third_party/dart/runtime/lib/vmservice.cc +FILE: ../../../third_party/dart/runtime/observatory/lib/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/cli.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/sample_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/allocation_profile/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/analytics.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/cli/command.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/debugger/debugger_location.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/logging_list.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/persistent_handles.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/ports.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/timeline_page.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/view_footer.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/sample_profile/sample_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/web/timeline.js +FILE: ../../../third_party/dart/runtime/vm/atomic_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/aot/precompiler.h +FILE: ../../../third_party/dart/runtime/vm/log.cc +FILE: ../../../third_party/dart/runtime/vm/log.h +FILE: ../../../third_party/dart/runtime/vm/log_test.cc +FILE: ../../../third_party/dart/runtime/vm/os_thread.cc +FILE: ../../../third_party/dart/runtime/vm/profiler_service.cc +FILE: ../../../third_party/dart/runtime/vm/profiler_service.h +FILE: ../../../third_party/dart/runtime/vm/program_visitor.cc +FILE: ../../../third_party/dart/runtime/vm/program_visitor.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_bytecode_inl.h +FILE: ../../../third_party/dart/runtime/vm/regexp_bytecodes.h +FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_interpreter.h +FILE: ../../../third_party/dart/runtime/vm/scope_timer.h +FILE: ../../../third_party/dart/runtime/vm/service_event.cc +FILE: ../../../third_party/dart/runtime/vm/service_event.h +FILE: ../../../third_party/dart/runtime/vm/service_isolate.cc +FILE: ../../../third_party/dart/runtime/vm/source_report.cc +FILE: ../../../third_party/dart/runtime/vm/source_report.h +FILE: ../../../third_party/dart/runtime/vm/source_report_test.cc +FILE: ../../../third_party/dart/runtime/vm/thread.cc +FILE: ../../../third_party/dart/runtime/vm/thread.h +FILE: ../../../third_party/dart/runtime/vm/thread_barrier.h +FILE: ../../../third_party/dart/runtime/vm/thread_barrier_test.cc +FILE: ../../../third_party/dart/runtime/vm/thread_registry.cc +FILE: ../../../third_party/dart/runtime/vm/thread_registry.h +FILE: ../../../third_party/dart/runtime/vm/timeline.cc +FILE: ../../../third_party/dart/runtime/vm/timeline.h +FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.cc +FILE: ../../../third_party/dart/runtime/vm/timeline_analysis.h +FILE: ../../../third_party/dart/runtime/vm/timeline_test.cc +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/developer_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/d8.js +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/async_await_error_codes.dart +FILE: ../../../third_party/dart/sdk/lib/convert/base64.dart +FILE: ../../../third_party/dart/sdk/lib/dart_client.platform +FILE: ../../../third_party/dart/sdk/lib/dart_server.platform +FILE: ../../../third_party/dart/sdk/lib/dart_shared.platform +FILE: ../../../third_party/dart/sdk/lib/developer/developer.dart +FILE: ../../../third_party/dart/sdk/lib/developer/extension.dart +FILE: ../../../third_party/dart/sdk/lib/developer/timeline.dart +FILE: ../../../third_party/dart/sdk/lib/io/io_resource_info.dart +FILE: ../../../third_party/dart/sdk/lib/io/security_context.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/asset.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/vmservice.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -5854,107 +5617,316 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/process_test.cc + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/server.dart + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/process_test.cc -FILE: ../../../third_party/dart/runtime/bin/snapshot_empty.cc -FILE: ../../../third_party/dart/runtime/bin/snapshot_in.cc -FILE: ../../../third_party/dart/runtime/include/dart_tools_api.h -FILE: ../../../third_party/dart/runtime/lib/double.cc -FILE: ../../../third_party/dart/runtime/lib/math.cc -FILE: ../../../third_party/dart/runtime/lib/mirrors.h -FILE: ../../../third_party/dart/runtime/lib/object.cc -FILE: ../../../third_party/dart/runtime/lib/string.cc -FILE: ../../../third_party/dart/runtime/platform/c99_support_win.h -FILE: ../../../third_party/dart/runtime/platform/inttypes_support_win.h -FILE: ../../../third_party/dart/runtime/vm/ast.cc -FILE: ../../../third_party/dart/runtime/vm/ast_printer.cc -FILE: ../../../third_party/dart/runtime/vm/ast_printer.h -FILE: ../../../third_party/dart/runtime/vm/bitfield.h -FILE: ../../../third_party/dart/runtime/vm/code_patcher_ia32_test.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_x64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler_stats.cc -FILE: ../../../third_party/dart/runtime/vm/compiler_stats.h -FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/custom_isolate_test.cc -FILE: ../../../third_party/dart/runtime/vm/dart.h -FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.h -FILE: ../../../third_party/dart/runtime/vm/dart_entry.cc -FILE: ../../../third_party/dart/runtime/vm/dart_entry.h -FILE: ../../../third_party/dart/runtime/vm/debugger_arm.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_x64.cc -FILE: ../../../third_party/dart/runtime/vm/double_conversion.cc -FILE: ../../../third_party/dart/runtime/vm/double_conversion.h -FILE: ../../../third_party/dart/runtime/vm/exceptions.cc -FILE: ../../../third_party/dart/runtime/vm/exceptions.h -FILE: ../../../third_party/dart/runtime/vm/freelist.cc -FILE: ../../../third_party/dart/runtime/vm/gc_marker.cc -FILE: ../../../third_party/dart/runtime/vm/gc_marker.h -FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.cc -FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.h -FILE: ../../../third_party/dart/runtime/vm/handles.h -FILE: ../../../third_party/dart/runtime/vm/longjump.cc -FILE: ../../../third_party/dart/runtime/vm/longjump.h -FILE: ../../../third_party/dart/runtime/vm/longjump_test.cc -FILE: ../../../third_party/dart/runtime/vm/memory_region.cc -FILE: ../../../third_party/dart/runtime/vm/message.cc -FILE: ../../../third_party/dart/runtime/vm/message.h -FILE: ../../../third_party/dart/runtime/vm/message_handler.cc -FILE: ../../../third_party/dart/runtime/vm/message_handler.h -FILE: ../../../third_party/dart/runtime/vm/native_entry.cc -FILE: ../../../third_party/dart/runtime/vm/native_entry.h -FILE: ../../../third_party/dart/runtime/vm/native_entry_test.cc -FILE: ../../../third_party/dart/runtime/vm/native_entry_test.h -FILE: ../../../third_party/dart/runtime/vm/object_store_test.cc -FILE: ../../../third_party/dart/runtime/vm/os.h -FILE: ../../../third_party/dart/runtime/vm/pages.h -FILE: ../../../third_party/dart/runtime/vm/parser_test.cc -FILE: ../../../third_party/dart/runtime/vm/port.h -FILE: ../../../third_party/dart/runtime/vm/resolver.cc -FILE: ../../../third_party/dart/runtime/vm/resolver.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_ia32.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_list.h -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_x64.cc -FILE: ../../../third_party/dart/runtime/vm/scanner.h -FILE: ../../../third_party/dart/runtime/vm/scavenger.cc -FILE: ../../../third_party/dart/runtime/vm/stack_frame.h -FILE: ../../../third_party/dart/runtime/vm/stub_code.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32_test.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_x64_test.cc -FILE: ../../../third_party/dart/runtime/vm/timer.cc -FILE: ../../../third_party/dart/runtime/vm/timer.h -FILE: ../../../third_party/dart/runtime/vm/token.cc -FILE: ../../../third_party/dart/runtime/vm/unicode_data.cc -FILE: ../../../third_party/dart/runtime/vm/unicode_test.cc -FILE: ../../../third_party/dart/runtime/vm/unit_test.h -FILE: ../../../third_party/dart/runtime/vm/verifier.h -FILE: ../../../third_party/dart/runtime/vm/visitor.h -FILE: ../../../third_party/dart/sdk/lib/collection/queue.dart -FILE: ../../../third_party/dart/sdk/lib/core/comparable.dart -FILE: ../../../third_party/dart/sdk/lib/core/date_time.dart -FILE: ../../../third_party/dart/sdk/lib/core/duration.dart -FILE: ../../../third_party/dart/sdk/lib/core/function.dart -FILE: ../../../third_party/dart/sdk/lib/core/iterable.dart -FILE: ../../../third_party/dart/sdk/lib/core/map.dart -FILE: ../../../third_party/dart/sdk/lib/core/pattern.dart -FILE: ../../../third_party/dart/sdk/lib/core/set.dart -FILE: ../../../third_party/dart/sdk/lib/core/stopwatch.dart -FILE: ../../../third_party/dart/sdk/lib/core/string_buffer.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/device.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/filtered_element_list.dart -FILE: ../../../third_party/dart/sdk/lib/html/html_common/lists.dart -FILE: ../../../third_party/dart/sdk/lib/internal/iterable.dart -FILE: ../../../third_party/dart/sdk/lib/internal/sort.dart -FILE: ../../../third_party/dart/utils/peg/pegparser.dart +FILE: ../../../third_party/dart/WATCHLISTS +FILE: ../../../third_party/dart/runtime/bin/eventhandler_win.cc +FILE: ../../../third_party/dart/runtime/bin/file.cc +FILE: ../../../third_party/dart/runtime/bin/file.h +FILE: ../../../third_party/dart/runtime/bin/file_system_entity_patch.dart +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.cc +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher.h +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_android.cc +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_linux.cc +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_macos.cc +FILE: ../../../third_party/dart/runtime/bin/file_system_watcher_win.cc +FILE: ../../../third_party/dart/runtime/bin/filter.cc +FILE: ../../../third_party/dart/runtime/bin/filter.h +FILE: ../../../third_party/dart/runtime/bin/filter_patch.dart +FILE: ../../../third_party/dart/runtime/bin/gen_snapshot.cc +FILE: ../../../third_party/dart/runtime/bin/io_natives.cc +FILE: ../../../third_party/dart/runtime/bin/io_service.cc +FILE: ../../../third_party/dart/runtime/bin/io_service.h +FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.cc +FILE: ../../../third_party/dart/runtime/bin/io_service_no_ssl.h +FILE: ../../../third_party/dart/runtime/bin/io_service_patch.dart +FILE: ../../../third_party/dart/runtime/bin/process.cc +FILE: ../../../third_party/dart/runtime/bin/process_patch.dart +FILE: ../../../third_party/dart/runtime/bin/socket.cc +FILE: ../../../third_party/dart/runtime/bin/socket.h +FILE: ../../../third_party/dart/runtime/bin/socket_base_linux.cc +FILE: ../../../third_party/dart/runtime/bin/socket_base_macos.cc +FILE: ../../../third_party/dart/runtime/bin/socket_base_win.cc +FILE: ../../../third_party/dart/runtime/bin/socket_linux.cc +FILE: ../../../third_party/dart/runtime/bin/socket_macos.cc +FILE: ../../../third_party/dart/runtime/bin/socket_patch.dart +FILE: ../../../third_party/dart/runtime/bin/socket_win.cc +FILE: ../../../third_party/dart/runtime/bin/stdio.cc +FILE: ../../../third_party/dart/runtime/bin/stdio.h +FILE: ../../../third_party/dart/runtime/bin/stdio_android.cc +FILE: ../../../third_party/dart/runtime/bin/stdio_linux.cc +FILE: ../../../third_party/dart/runtime/bin/stdio_macos.cc +FILE: ../../../third_party/dart/runtime/bin/stdio_patch.dart +FILE: ../../../third_party/dart/runtime/bin/stdio_win.cc +FILE: ../../../third_party/dart/runtime/bin/vmservice/server.dart +FILE: ../../../third_party/dart/runtime/bin/vmservice/vmservice_io.dart +FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.cc +FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.h +FILE: ../../../third_party/dart/runtime/include/dart_mirrors_api.h +FILE: ../../../third_party/dart/runtime/include/dart_native_api.h +FILE: ../../../third_party/dart/runtime/lib/collection_patch.dart +FILE: ../../../third_party/dart/runtime/lib/core_patch.dart +FILE: ../../../third_party/dart/runtime/lib/deferred_load_patch.dart +FILE: ../../../third_party/dart/runtime/lib/function.dart +FILE: ../../../third_party/dart/runtime/lib/internal_patch.dart +FILE: ../../../third_party/dart/runtime/lib/invocation_mirror.h +FILE: ../../../third_party/dart/runtime/lib/libgen_in.cc +FILE: ../../../third_party/dart/runtime/lib/mirror_reference.dart +FILE: ../../../third_party/dart/runtime/lib/null_patch.dart +FILE: ../../../third_party/dart/runtime/lib/schedule_microtask_patch.dart +FILE: ../../../third_party/dart/runtime/lib/simd128.cc +FILE: ../../../third_party/dart/runtime/lib/stacktrace.cc +FILE: ../../../third_party/dart/runtime/lib/stacktrace.dart +FILE: ../../../third_party/dart/runtime/lib/symbol_patch.dart +FILE: ../../../third_party/dart/runtime/lib/timer_impl.dart +FILE: ../../../third_party/dart/runtime/lib/typed_data.cc +FILE: ../../../third_party/dart/runtime/lib/typed_data_patch.dart +FILE: ../../../third_party/dart/runtime/lib/uri.cc +FILE: ../../../third_party/dart/runtime/lib/uri_patch.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/application.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/location_manager.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_instances.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/code_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/context_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/cpu_profile_table.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/curly_block.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/error_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/eval_box.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/field_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/flag_list.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/function_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_snapshot.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/helpers/any_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/icdata_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/instance_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/json_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/library_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/local_var_descriptors_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/megamorphiccache_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/native_memory_profiler.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_common.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/object_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectpool_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/objectstore_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/observatory_application.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/pc_descriptors_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sample_buffer_control.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_inset.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/script_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_value.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/sentinel_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/source_inset.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/stack_trace_tree_config.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/token_stream_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/type_arguments_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/unknown_ref.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_view.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/tracer.dart +FILE: ../../../third_party/dart/runtime/platform/atomic.h +FILE: ../../../third_party/dart/runtime/platform/atomic_android.h +FILE: ../../../third_party/dart/runtime/platform/atomic_linux.h +FILE: ../../../third_party/dart/runtime/platform/atomic_macos.h +FILE: ../../../third_party/dart/runtime/platform/atomic_win.h +FILE: ../../../third_party/dart/runtime/platform/signal_blocker.h +FILE: ../../../third_party/dart/runtime/vm/allocation.h +FILE: ../../../third_party/dart/runtime/vm/class_finalizer.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/aot/aot_call_specializer.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_ia32.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_x64.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/block_scheduler.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/constant_propagator.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_x64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_x64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/inliner.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/linearscan.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/locations.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/type_propagator.h +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_x64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/jit/jit_call_specializer.cc +FILE: ../../../third_party/dart/runtime/vm/constants_arm.h +FILE: ../../../third_party/dart/runtime/vm/constants_ia32.h +FILE: ../../../third_party/dart/runtime/vm/constants_x64.h +FILE: ../../../third_party/dart/runtime/vm/dart.cc +FILE: ../../../third_party/dart/runtime/vm/dart_api_impl.cc +FILE: ../../../third_party/dart/runtime/vm/deferred_objects.cc +FILE: ../../../third_party/dart/runtime/vm/deferred_objects.h +FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.cc +FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.h +FILE: ../../../third_party/dart/runtime/vm/guard_field_test.cc +FILE: ../../../third_party/dart/runtime/vm/instructions.h +FILE: ../../../third_party/dart/runtime/vm/instructions_arm.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_arm.h +FILE: ../../../third_party/dart/runtime/vm/instructions_arm_test.cc +FILE: ../../../third_party/dart/runtime/vm/isolate.cc +FILE: ../../../third_party/dart/runtime/vm/isolate.h +FILE: ../../../third_party/dart/runtime/vm/json_stream.cc +FILE: ../../../third_party/dart/runtime/vm/json_stream.h +FILE: ../../../third_party/dart/runtime/vm/mirrors_api_impl.cc +FILE: ../../../third_party/dart/runtime/vm/native_api_impl.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol.h +FILE: ../../../third_party/dart/runtime/vm/native_symbol_android.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol_linux.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol_macos.cc +FILE: ../../../third_party/dart/runtime/vm/native_symbol_win.cc +FILE: ../../../third_party/dart/runtime/vm/object_id_ring.cc +FILE: ../../../third_party/dart/runtime/vm/object_id_ring.h +FILE: ../../../third_party/dart/runtime/vm/object_id_ring_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_store.cc +FILE: ../../../third_party/dart/runtime/vm/os_test.cc +FILE: ../../../third_party/dart/runtime/vm/profiler.cc +FILE: ../../../third_party/dart/runtime/vm/profiler.h +FILE: ../../../third_party/dart/runtime/vm/profiler_test.cc +FILE: ../../../third_party/dart/runtime/vm/random.cc +FILE: ../../../third_party/dart/runtime/vm/random.h +FILE: ../../../third_party/dart/runtime/vm/reusable_handles.h +FILE: ../../../third_party/dart/runtime/vm/service.cc +FILE: ../../../third_party/dart/runtime/vm/service.h +FILE: ../../../third_party/dart/runtime/vm/service_isolate.h +FILE: ../../../third_party/dart/runtime/vm/service_test.cc +FILE: ../../../third_party/dart/runtime/vm/signal_handler.h +FILE: ../../../third_party/dart/runtime/vm/signal_handler_android.cc +FILE: ../../../third_party/dart/runtime/vm/signal_handler_linux.cc +FILE: ../../../third_party/dart/runtime/vm/signal_handler_macos.cc +FILE: ../../../third_party/dart/runtime/vm/signal_handler_win.cc +FILE: ../../../third_party/dart/runtime/vm/simulator.h +FILE: ../../../third_party/dart/runtime/vm/simulator_arm.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_ia32.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_x64.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm_test.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_x64.cc +FILE: ../../../third_party/dart/runtime/vm/tags.h +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.cc +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter.h +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_android.cc +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_linux.cc +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_macos.cc +FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_win.cc +FILE: ../../../third_party/dart/runtime/vm/weak_table.cc +FILE: ../../../third_party/dart/runtime/vm/weak_table.h +FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http_headers.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http_impl.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http_parser.dart +FILE: ../../../third_party/dart/sdk/lib/_http/http_session.dart +FILE: ../../../third_party/dart/sdk/lib/_http/websocket.dart +FILE: ../../../third_party/dart/sdk/lib/_http/websocket_impl.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/annotations.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/collection_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/convert_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/internal_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/io_patch.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_helper.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_names.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_primitives.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_rti.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart +FILE: ../../../third_party/dart/sdk/lib/async/deferred_load.dart +FILE: ../../../third_party/dart/sdk/lib/async/schedule_microtask.dart +FILE: ../../../third_party/dart/sdk/lib/async/stream.dart +FILE: ../../../third_party/dart/sdk/lib/async/stream_transformers.dart +FILE: ../../../third_party/dart/sdk/lib/async/zone.dart +FILE: ../../../third_party/dart/sdk/lib/collection/collections.dart +FILE: ../../../third_party/dart/sdk/lib/collection/hash_map.dart +FILE: ../../../third_party/dart/sdk/lib/collection/hash_set.dart +FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_map.dart +FILE: ../../../third_party/dart/sdk/lib/collection/linked_hash_set.dart +FILE: ../../../third_party/dart/sdk/lib/collection/linked_list.dart +FILE: ../../../third_party/dart/sdk/lib/collection/list.dart +FILE: ../../../third_party/dart/sdk/lib/convert/ascii.dart +FILE: ../../../third_party/dart/sdk/lib/convert/byte_conversion.dart +FILE: ../../../third_party/dart/sdk/lib/convert/chunked_conversion.dart +FILE: ../../../third_party/dart/sdk/lib/convert/codec.dart +FILE: ../../../third_party/dart/sdk/lib/convert/convert.dart +FILE: ../../../third_party/dart/sdk/lib/convert/converter.dart +FILE: ../../../third_party/dart/sdk/lib/convert/encoding.dart +FILE: ../../../third_party/dart/sdk/lib/convert/html_escape.dart +FILE: ../../../third_party/dart/sdk/lib/convert/json.dart +FILE: ../../../third_party/dart/sdk/lib/convert/latin1.dart +FILE: ../../../third_party/dart/sdk/lib/convert/line_splitter.dart +FILE: ../../../third_party/dart/sdk/lib/convert/string_conversion.dart +FILE: ../../../third_party/dart/sdk/lib/convert/utf.dart +FILE: ../../../third_party/dart/sdk/lib/core/annotations.dart +FILE: ../../../third_party/dart/sdk/lib/core/null.dart +FILE: ../../../third_party/dart/sdk/lib/core/stacktrace.dart +FILE: ../../../third_party/dart/sdk/lib/core/string_sink.dart +FILE: ../../../third_party/dart/sdk/lib/core/symbol.dart +FILE: ../../../third_party/dart/sdk/lib/internal/list.dart +FILE: ../../../third_party/dart/sdk/lib/internal/print.dart +FILE: ../../../third_party/dart/sdk/lib/internal/symbol.dart +FILE: ../../../third_party/dart/sdk/lib/io/bytes_builder.dart +FILE: ../../../third_party/dart/sdk/lib/io/data_transformer.dart +FILE: ../../../third_party/dart/sdk/lib/io/file.dart +FILE: ../../../third_party/dart/sdk/lib/io/file_impl.dart +FILE: ../../../third_party/dart/sdk/lib/io/file_system_entity.dart +FILE: ../../../third_party/dart/sdk/lib/io/io_service.dart +FILE: ../../../third_party/dart/sdk/lib/io/io_sink.dart +FILE: ../../../third_party/dart/sdk/lib/io/link.dart +FILE: ../../../third_party/dart/sdk/lib/io/secure_socket.dart +FILE: ../../../third_party/dart/sdk/lib/io/socket.dart +FILE: ../../../third_party/dart/sdk/lib/io/stdio.dart +FILE: ../../../third_party/dart/sdk/lib/io/string_transformer.dart +FILE: ../../../third_party/dart/sdk/lib/js/dart2js/js_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/math/jenkins_smi_hash.dart +FILE: ../../../third_party/dart/sdk/lib/math/point.dart +FILE: ../../../third_party/dart/sdk/lib/math/rectangle.dart +FILE: ../../../third_party/dart/sdk/lib/mirrors/mirrors.dart +FILE: ../../../third_party/dart/sdk/lib/typed_data/typed_data.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/client.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/constants.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/message.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/message_router.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolate.dart +FILE: ../../../third_party/dart/sdk/lib/vmservice/running_isolates.dart +FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart +FILE: ../../../third_party/dart/utils/compiler/create_snapshot_entry.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -15027,64 +14999,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages LIBRARY: pkg -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/instrumentation/file_instrumentation.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/instrumentation/file_instrumentation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/command_line.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/resolver_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/task.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/analysis_options_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/embedder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/error_processor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/path_filter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/sdk_ext.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/cache.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/context.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/source.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/type_system.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/visitors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/command_line_plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/engine_plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/options_plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/plugin/plugin_configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/services/lint.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/format.fbs -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/idl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/public_namespace_computer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/resynthesize.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summarize_elements.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summary_sdk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/dart.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/dart_work_manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/driver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/general.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/html.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/html_work_manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/incremental_element_builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/inputs.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/model.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/options_work_manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/strong/checker.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/strong_mode.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/absolute_path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/asserts.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/glob.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/lru_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/yaml.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/dart.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/general.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/html.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/model.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/check_test.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/generate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/idl_model.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/task_dependency_graph/check_test.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/task_dependency_graph/generate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/task_dependency_graph/tasks.dot FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_memoizer.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/cancelable_operation.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart @@ -15103,85 +15019,14 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/as FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_splitter.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/subscription_stream.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/lib/cli_util.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/comparators.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/convert.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/hex.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/hex/decoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/hex/encoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/percent.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/percent/decoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/percent/encoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/example/hash.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/digest.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/digest_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/hash.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/bin/format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/example/format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/fast_hash.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/line_splitter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/rule_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/solve_state.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_splitting/solve_state_queue.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/nesting_builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/nesting_level.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/argument.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/combinator.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/metadata.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/rule.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/rule/type_argument.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/tool/grind.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/build/initializer_plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/build/loader_replacer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/initialize.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/init_method.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/initialize_tracker.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/initializer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/mirror_loader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/src/static_loader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/test_package/lib/bar.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/test_package/lib/foo.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/example/http_server.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/example/runner_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/isolate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/isolate_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/load_balancer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/ports.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/registry.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/src/errors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/src/lists.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/isolate/lib/src/raw_receive_port_multiplexer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/discovery.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/discovery_analysis.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/packages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/packages_file.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/src/packages_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/src/packages_io_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/package_config/lib/src/util.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/plugin/lib/manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/plugin/lib/plugin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/plugin/lib/src/plugin_impl.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/location_mixin.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/unparsed_frame.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/eager_span_scanner.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/expected_function.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/group_context.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/shared.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/benchmark/path_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/file_watcher.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/file_watcher/native.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/file_watcher/polling.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/benchmark/benchmark.dart FILE: ../../../third_party/pkg/when/lib/when.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file @@ -15220,7 +15065,6 @@ LIBRARY: skia LIBRARY: vulkan ORIGIN: ../../../flutter/third_party/txt/LICENSE TYPE: LicenseType.apache -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/async.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/cache.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/check.dart @@ -15234,7 +15078,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/qu FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/concat.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/countdown_timer.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/enumerate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/future_group.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/future_stream.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/iteration.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/metronome.dart @@ -15267,6 +15110,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/qu FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/pattern/glob.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/clock.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/duration_unit_constants.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/util.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/strings.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/time.dart FILE: ../../../third_party/skia/src/images/SkWebpEncoder.cpp @@ -15480,14 +15324,8 @@ limitations under the License. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/viz.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/web_app.dart.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/tasks.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/package_bundle_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/build_sdk_summaries.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/.analysis_options @@ -15501,6 +15339,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cs FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/af.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/am.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar_DZ.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/az.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/be.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/bg.json @@ -15523,6 +15362,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IE.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IN.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ISO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_MY.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_SG.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_US.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ZA.json @@ -15538,6 +15378,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fil.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ga.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gl.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gsw.json @@ -15552,6 +15393,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/in.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/is.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/iw.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ja.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ka.json @@ -15580,11 +15422,13 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/or.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pa.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ps.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_BR.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_PT.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ro.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ru.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sd.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sh.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/si.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sk.json @@ -15611,6 +15455,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/af.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/am.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar_DZ.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/az.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/be.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/bg.json @@ -15633,6 +15478,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IE.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IN.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ISO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_MY.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_SG.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_US.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ZA.json @@ -15648,6 +15494,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fil.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ga.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gl.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gsw.json @@ -15662,6 +15509,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/in.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/is.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it_CH.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/iw.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ja.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ka.json @@ -15684,157 +15532,41 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/nb.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ne.json FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/nl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no_NO.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/or.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pa.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_BR.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_PT.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ro.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ru.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/si.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sq.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr_Latn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sv.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ta.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/te.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/th.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ur.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uz.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/vi.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_CN.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_HK.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_TW.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zu.json ----------------------------------------------------------------------------------------------------- -Copyright 2013, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/benchmark/errors_in_all_libraries.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/benchmark/errors_in_all_libraries.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/ast_factory.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/resolution_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/standard_ast_factory.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/standard_resolution_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/syntactic_entity.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/plugin/embedded_resolver_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/custom_resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/context/builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/ast_factory.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/resolution_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/resolver/inheritance_manager.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/sdk/sdk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/error/pending_error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/bazel.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/package.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/source/source_resource.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/api_signature.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/bazel_summary.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/flat_buffers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/link.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/name_filter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/prelink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/pub_summary.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summarize_ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summarize_const_expr.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/summary_file_builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/strong/ast_properties.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/task/yaml.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/fast_uri.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/task/yaml.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/dump_inferred_types.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/inspect.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/tool/summary/stats.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/null_stream_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/value.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/single_subscription_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_completer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/handler_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/stream_transformer_wrapper.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/typed.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_subscription_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream_subscription.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed_stream_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/empty_unmodifiable_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/functions.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/typed_wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set_controller.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/accumulator_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/byte_accumulator_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/lib/src/string_accumulator_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/tool/node_format_service.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/compact_number_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/plural_rules.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/order_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/meta.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_record.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/list_diff.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/property_change_record.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/to_observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/relative_span_scanner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no_NO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/or.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pa.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ps.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_BR.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_PT.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ro.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ru.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/si.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sq.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr_Latn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sv.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ta.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/te.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/th.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ur.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uz.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/vi.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_CN.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_HK.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_TW.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zu.json ---------------------------------------------------------------------------------------------------- -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - +Copyright 2013, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -15864,124 +15596,77 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/dart.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/doc/support/dart.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/example/parser_driver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/example/resolver_driver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/example/scanner_driver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/analyzer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/string_source.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/args.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/usage.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/async.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/stream_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/barback.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_forwarder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_id.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/internal_asset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/barback.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/build_result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/errors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/asset_cascade.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/group_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/package_graph.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_forwarder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_output.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/transform_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/log.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/package_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/serialize.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/barback_settings.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transform_logger.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer_group.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/cancelable_future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/file_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/multiset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_replayer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/dart.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/interop.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/messages/build_logger.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/algorithms.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/collection.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/iterable_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/algorithms.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/iterable_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/unmodifiable_wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/css.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/css_printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/polyfill.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/stream_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/pretty_print.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/context.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/parsed_path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/posix.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/url.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/windows.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/refactor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/source_maps.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/src/vlq.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/chain.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/frame.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/stack_zone_specification.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/vm_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/stack_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/typed_data/lib/typed_buffers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/typed_data/lib/typed_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/compact_vm_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_enhanced_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_individual_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/pretty_print.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/simple_configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/test_case.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/unittest.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/vm_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/example/watch.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/async_queue.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/constructable_file_system_event.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/linux.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/mac_os.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/polling.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/path_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/resubscribable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/stat.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/watch_event.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/watcher.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/simple_transformer/lib/transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/bin/css.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/analyzer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/messages.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/options.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/property.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/token.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer_base.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenkind.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_base.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/validate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/visitor.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_file.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_http_request.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbols.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_browser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_standalone.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/message_lookup_by_library.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/locale_list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/date_format_internal.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/file_data_reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/http_request_data_reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_formatter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_field.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_helpers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/number_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl_helpers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/lazy_locale_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/tool/generate_locale_data_files.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/lib/logging.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/core_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/description.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/error_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/interfaces.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/iterable_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/map_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/numeric_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/operator_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/string_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/core_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/description.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/error_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/expect.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/future_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/interfaces.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/iterable_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/map_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/numeric_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/operator_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/string_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/constants.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/list_range.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf16.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf32.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf8.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_16_code_unit_decoder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/util.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/utf.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -16013,76 +15698,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/context/declared_variables.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/context/declared_variables.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/ast/visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/constant/value.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/element/element.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/element/type.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/dart/element/visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/error/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/error/listener.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/exception/exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/file_system/file_system.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/file_system/memory_file_system.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/file_system/physical_file_system.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/instrumentation/instrumentation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/package_map_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/package_map_resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/source/pub_package_map_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/cancelable_future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/codegen/html.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/codegen/text_formatter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/codegen/tools.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/ast/utilities.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/constant/evaluation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/constant/utilities.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/constant/value.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/element.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/handle.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/member.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/type.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/element/utilities.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/error/syntactic_errors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/resolver/scope.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/scanner/reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/dart/scanner/scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/error/codes.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/constant.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/element.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/element_handle.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/element_resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/engine.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/error_verifier.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/incremental_logger.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/incremental_resolution_validator.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/incremental_resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/interner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_core.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_engine.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_engine_io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/java_io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/sdk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/sdk_io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/source.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/source_io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/static_type_analyzer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/utilities_collection.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/utilities_dart.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/generated/utilities_general.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/summary/base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/lib/src/util/utilities_timing.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/command_runner.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_results.dart @@ -16113,45 +15730,11 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/ba FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/ascii.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/charcode.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/html_entity.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/assets.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/benchmarks.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/messages/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/async_benchmark_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/dart_sdk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/delete_file.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/entry_point.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/remove_sourcemap_comment.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/resolver.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/resolver_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/lib/src/resolvers.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/priority_queue.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/canonicalized_map.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/priority_queue.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/queue_list.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/benchmark/benchmark.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/dart_style.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/argument_list_visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/call_chain_visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/chunk.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/chunk_builder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/dart_formatter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/debug.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/error_listener.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/formatter_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/formatter_options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/line_writer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/source_code.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/source_visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/lib/src/whitespace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/glob.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/ast.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/list_tree.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_time_patterns.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/.status @@ -16163,7 +15746,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pa FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/internal_style.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/lib/pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/lib/src/source_map_span.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/source_span.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/colors.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/file.dart @@ -16173,12 +15755,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/so FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span_mixin.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span_with_context.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/line_scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/span_scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/string_scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/lib/string_scanner.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/internal_test_case.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher.dart @@ -16196,17 +15772,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/us FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/usage_html.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/usage_io.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/tool/grind.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/lib/src/directory_watcher/windows.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/event.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/loader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/null_span.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/scanner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/style.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_document.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_node_wrapper.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. @@ -16240,85 +15805,164 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/null_stream_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/error.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/result.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/value.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/single_subscription_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_completer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/handler_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/stream_transformer_wrapper.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/typed.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_subscription_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/future.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream_subscription.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed_stream_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/empty_unmodifiable_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/functions.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set_controller.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/compact_number_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/plural_rules.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/order_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/meta.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/observable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/list_diff.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/property_change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/to_observable.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/simple_transformer/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/crypto.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/hash_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/hmac.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/md5.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/sha1.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/lib/src/sha256.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/bin/css.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/analyzer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/property.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenkind.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/validate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_file.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_http_request.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbols.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_browser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_standalone.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/message_lookup_by_library.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/locale_list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/date_format_internal.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/file_data_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/http_request_data_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_formatter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_field.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_helpers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/number_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl_helpers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/lazy_locale_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/tool/generate_locale_data_files.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/lib/logging.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/core_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/description.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/error_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/interfaces.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/iterable_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/map_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/numeric_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/operator_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/string_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/core_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/description.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/error_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/expect.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/future_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/interfaces.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/iterable_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/map_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/numeric_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/operator_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/string_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/constants.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/list_range.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf16.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf32.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf8.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_16_code_unit_decoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/util.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/utf.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/src/yaml_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/lib/yaml.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/args.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/usage.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/async.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/barback.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_forwarder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_id.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/internal_asset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/barback.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/build_result.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/errors.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/asset_cascade.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/group_runner.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/package_graph.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_forwarder.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_output.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/transform_node.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/log.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/package_provider.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/serialize.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/barback_settings.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transform_logger.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer_group.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/cancelable_future.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/file_pool.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/multiset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_pool.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_replayer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/dart.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/interop.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/algorithms.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/collection.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/equality.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/iterable_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/algorithms.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/iterable_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/unmodifiable_wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/css.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/css_printer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/polyfill.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_printer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/pretty_print.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/context.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/parsed_path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/posix.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/url.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/windows.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/chain.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/frame.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/stack_zone_specification.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/vm_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/stack_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/compact_vm_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_enhanced_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_individual_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/configuration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/pretty_print.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/simple_configuration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/test_case.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/unittest.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/vm_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_stream.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -16352,16 +15996,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/convert/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/crypto/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/initialize/tool/rename_build_outputs.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/typed_data/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/.test_config ---------------------------------------------------------------------------------------------------- Copyright 2015, the Dart project authors. All rights reserved. @@ -16398,9 +16034,6 @@ ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/ TYPE: LicenseType.bsd FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_cache.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/byte_collector.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/example/main.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/lib/cli_logging.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/cli_util/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_iterable.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_list.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_map.dart @@ -16441,32 +16074,23 @@ LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/code_transformers/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/dist/dart-style.d.ts -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/web/index.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_style/web/main.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/glob/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/compiler.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/encodings.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/libraries/Dart_Packages.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/libraries/Dart_SDK.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/misc.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/modules.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/pool.iml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/vcs.xml +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/workspace.xml FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_maps/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/string_scanner/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/.analysis_options FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/watcher/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/benchmark/output.json ---------------------------------------------------------------------------------------------------- Copyright 2014, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -16704,7 +16328,7 @@ met: LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/LICENSE TYPE: LicenseType.mit -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.test_config FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/dom.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/dom_parsing.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/parser.dart @@ -16747,12 +16371,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/analyzer/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2014, the Dart project authors. +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. @@ -16785,11 +16408,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols_data.dart ---------------------------------------------------------------------------------------------------- -Copyright 2016, the Dart project authors. All rights reserved. +Copyright (c) 2014, the Dart project authors. +Please see the AUTHORS file +for details. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16819,14 +16446,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/test_controller.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/.analysis_options ---------------------------------------------------------------------------------------------------- -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - +Copyright 2016, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16856,99 +16480,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/e2e_test/html_imports/lib/theme.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/bower.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/package.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/coverage_controller.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/test_controller.js ---------------------------------------------------------------------------------------------------- -Copyright (c) 2012 The Polymer Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/CustomElements.js -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/CustomElements.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/CustomElements.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/HTMLImports.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/HTMLImports.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/MutationObserver.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/MutationObserver.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/ShadowDOM.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/ShadowDOM.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents-lite.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents-lite.min.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/webcomponents.min.js ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014 The Polymer Authors. All rights reserved. +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop_support.html + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/web_components/lib/interop_support.html ----------------------------------------------------------------------------------------------------- -Copyright 2014 The Dart project authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above @@ -16958,6 +16501,7 @@ met: * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -16971,35 +16515,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/libyaml-license.txt -TYPE: LicenseType.mit -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/yaml/benchmark/output.json ----------------------------------------------------------------------------------------------------- -Copyright (c) 2006 Kirill Simonov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -==================================================================================================== - ==================================================================================================== LIBRARY: rapidjson ORIGIN: ../../../third_party/rapidjson/rapidjson/error/en.h @@ -22399,4 +21914,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 320 +Total license count: 317 From be070599a30413bd203f2d77d2179220c5569c08 Mon Sep 17 00:00:00 2001 From: Siva Date: Thu, 5 Apr 2018 10:02:55 -0700 Subject: [PATCH 0056/1190] Roll dart to 3e6b8717fedce5cc28a21616f4591683c211f752 (#4940) 3e6b8717fe Fixed GamePadList not working in DDC and hide MessagePort.start operation. edb6e776f1 Update parseFields to use typeInfo fdc787efc8 Adjusted issue numbers of a test 22d99d8920 Update status for LUCI versions of dart2js chrome builders 20ea3f5d69 Pass a list of context messages in onProblem callback. bbb281ff3b Error reporting functions take a list of context messages. 83ef97f873 Wrap a formatted message with line and column in a FormattedMessage. b2d7749643 Fix issue with missing sources 765242d1b0 Add an issue template to the SDK 3acccedc40 Mark IsolateReload_TearOff_Parameter_Count_Mismatch failing 006fda374b Update test matrix with correct path to dart on Mac OS 4d7327b7b7 Run inference test in strong mode c502578096 Replace skipTypeReferenceOpt with computeType 7ed7e57aaa Assert that inference isn't expected on abstract methods. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f80f52c24b1a8..e5c6af7fee6e2 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '2676c132cbfd88befcecc544b2e902c255e44b34', + 'dart_revision': '3e6b8717fedce5cc28a21616f4591683c211f752', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fb8be9a44e68a..0f3ddc0332996 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3fc14486250c20c91df483399a9ffd9b +Signature: e57916cfc106e31b9115fb6ab9ec28cb UNUSED LICENSES: From adf5ddfb76f7f3f5fb30954205d819d3585a66e4 Mon Sep 17 00:00:00 2001 From: Siva Date: Thu, 5 Apr 2018 14:07:02 -0700 Subject: [PATCH 0057/1190] Roll Dart to version 09e1766e6caa537e1271fbce04ebcbf8212b6569 (#4941) 09e1766e6c [vm] Omnibus memory leaks. eb3669717c [fasta] Make ConstnessEvaluator evaluate potential constness e448d18591 Allow empty flutter: sections in pubspec files. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e5c6af7fee6e2..f175164679bc9 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '3e6b8717fedce5cc28a21616f4591683c211f752', + 'dart_revision': '09e1766e6caa537e1271fbce04ebcbf8212b6569', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 0f3ddc0332996..02eb6e6dd824f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e57916cfc106e31b9115fb6ab9ec28cb +Signature: 93afdbdd65d1aea7e59730d0a9fe9f4b UNUSED LICENSES: From aa9ce7092801e7ed8f3f86df0d1067279d13784d Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 5 Apr 2018 14:14:34 -0700 Subject: [PATCH 0058/1190] Add armv7 support to create_ios_framework script (#4942) This adds support for --armv7-out-dir and renames --device-out-dir to --arm64-out-dir for clarity. It preserves --device-out-dir as a fallback until the bot recipe has been updated to use --arm64-out-dir. --- sky/tools/create_ios_framework.py | 44 ++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/sky/tools/create_ios_framework.py b/sky/tools/create_ios_framework.py index 8651982cc5f7d..45759c32046df 100755 --- a/sky/tools/create_ios_framework.py +++ b/sky/tools/create_ios_framework.py @@ -14,28 +14,46 @@ def main(): parser = argparse.ArgumentParser(description='Creates Flutter.framework') parser.add_argument('--dst', type=str, required=True) - parser.add_argument('--device-out-dir', type=str, required=True) + # TODO(cbracken) eliminate --device-out-dir and make armv7-out-dir and + # arm64-out-dir required once bot recipe is updated. + parser.add_argument('--device-out-dir', type=str, required=False) + parser.add_argument('--arm64-out-dir', type=str, required=False) + parser.add_argument('--armv7-out-dir', type=str, required=False) parser.add_argument('--simulator-out-dir', type=str, required=True) args = parser.parse_args() + if not (args.arm64_out_dir or args.device_out_dir): + print 'One of --device-out-dir or --arm64-out-dir must be specified' fat_framework = os.path.join(args.dst, 'Flutter.framework') - device_framework = os.path.join(args.device_out_dir, 'Flutter.framework') + arm64_framework = os.path.join(args.arm64_out_dir if args.arm64_out_dir else args.device_out_dir, 'Flutter.framework') + armv7_framework = os.path.join(args.armv7_out_dir, 'Flutter.framework') if args.armv7_out_dir else None simulator_framework = os.path.join(args.simulator_out_dir, 'Flutter.framework') - device_dylib = os.path.join(device_framework, 'Flutter') + arm64_dylib = os.path.join(arm64_framework, 'Flutter') + armv7_dylib = os.path.join(armv7_framework, 'Flutter') if args.armv7_out_dir else None simulator_dylib = os.path.join(simulator_framework, 'Flutter') - if not os.path.isdir(device_framework): - print 'Cannot find iOS device Framework at', device_framework + if not os.path.isdir(arm64_framework): + print 'Cannot find iOS arm64 Framework at', arm64_framework + return 1 + + # TODO(cbracken): require armv7 once bot recipe is updated. + if armv7_framework and not os.path.isdir(armv7_framework): + print 'Cannot find iOS armv7 Framework at', armv7_framework return 1 if not os.path.isdir(simulator_framework): print 'Cannot find iOS simulator Framework at', simulator_framework return 1 - if not os.path.isfile(device_dylib): - print 'Cannot find iOS device dylib at', device_dylib + if not os.path.isfile(arm64_dylib): + print 'Cannot find iOS arm64 dylib at', arm64_dylib + return 1 + + # TODO(cbracken): require armv7 once bot recipe is updated. + if armv7_dylib and not os.path.isfile(armv7_dylib): + print 'Cannot find iOS armv7 dylib at', armv7_dylib return 1 if not os.path.isfile(simulator_dylib): @@ -43,12 +61,14 @@ def main(): return 1 shutil.rmtree(fat_framework, True) - shutil.copytree(device_framework, fat_framework) + shutil.copytree(arm64_framework, fat_framework) + + # TODO(cbracken): require armv7 once bot recipe is updated. + dylibs = [arm64_dylib, simulator_dylib] + if armv7_dylib: + dylibs += [armv7_dylib] - subprocess.call([ - 'lipo', - device_dylib, - simulator_dylib, + subprocess.call(['lipo'] + dylibs + [ '-create', '-output', os.path.join(fat_framework, 'Flutter') From b6f466b344108731e26dbdf44a11a3c98d70f696 Mon Sep 17 00:00:00 2001 From: Majid Valipour Date: Thu, 5 Apr 2018 20:26:49 -0400 Subject: [PATCH 0059/1190] Enable Image encoding by leveraging existing Skia functionality (#4762) Add Image.toByeData() Fixes flutter/flutter#11648 --- lib/ui/BUILD.gn | 2 + lib/ui/painting.dart | 91 +++++++++++++++++++ lib/ui/painting/image.cc | 8 ++ lib/ui/painting/image.h | 1 + lib/ui/painting/image_encoding.cc | 113 ++++++++++++++++++++++++ lib/ui/painting/image_encoding.h | 21 +++++ testing/dart/encoding_test.dart | 63 +++++++++++++ testing/resources/square-80.jpg | Bin 0 -> 928 bytes testing/resources/square-80.webp | Bin 0 -> 666 bytes testing/resources/square.png | Bin 0 -> 125 bytes travis/licenses_golden/licenses_flutter | 2 + 11 files changed, 301 insertions(+) create mode 100644 lib/ui/painting/image_encoding.cc create mode 100644 lib/ui/painting/image_encoding.h create mode 100644 testing/dart/encoding_test.dart create mode 100644 testing/resources/square-80.jpg create mode 100644 testing/resources/square-80.webp create mode 100644 testing/resources/square.png diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 2862a9b68cf96..8b3be72d5973b 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -24,6 +24,8 @@ source_set("ui") { "painting/gradient.h", "painting/image.cc", "painting/image.h", + "painting/image_encoding.cc", + "painting/image_encoding.h", "painting/image_filter.cc", "painting/image_filter.h", "painting/image_shader.cc", diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 7d39b1b717bf1..02c4b4986e194 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1196,6 +1196,80 @@ class Paint { } } +/// An encoding format to use with the [Image.toByteData]. +class EncodingFormat { + /// PNG format. + /// + /// A loss-less compression format for images. This format is well suited for + /// images with hard edges, such as screenshots or sprites, and images with + /// text. Transparency is supported. The PNG format supports images up to + /// 2,147,483,647 pixels in either dimension, though in practice available + /// memory provides a more immediate limitation on maximum image size. + /// + /// PNG images normally use the `.png` file extension and the `image/png` MIME + /// type. + /// + /// See also: + /// + /// * , the Wikipedia page on PNG. + /// * , the PNG standard. + const EncodingFormat.png() + : _format = _pngFormat, + _quality = 0; + + /// JPEG format. + /// + /// This format, strictly speaking called JFIF, is a lossy compression + /// graphics format that can handle images up to 65,535 pixels in either + /// dimension. The [quality] metric is a value in the range 0 to 100 that + /// controls the compression ratio. Values in the range of about 50 to 90 are + /// somewhat reasonable; values above 95 increase the file size with little + /// noticeable improvement to the quality, values below 50 drop the quality + /// substantially. + /// + /// This format is well suited for photographs. It is very poorly suited for + /// images with hard edges or text. It does not support transparency. + /// + /// JPEG images normally use the `.jpeg` file extension and the `image/jpeg` + /// MIME type. + /// + /// See also: + /// + /// * , the Wikipedia page on JPEG. + const EncodingFormat.jpeg({int quality = 80}) + : _format = _jpegFormat, + _quality = quality; + + /// WebP format. + /// + /// The WebP format supports both lossy and lossless compression; however, the + /// [Image.toByteData] method always uses lossy compression when [webp] is + /// specified. The [quality] metric is a value in the range 0 to 100 that + /// controls the compression ratio; higher values result in better quality but + /// larger file sizes, and vice versa. WebP images are limited to 16,383 + /// pixels in each direction (width and height). + /// + /// WebP images normally use the `.webp` file extension and the `image/webp` + /// MIME type. + /// + /// See also: + /// + /// * , the Wikipedia page on WebP. + const EncodingFormat.webp({int quality = 80}) + : _format = _webpFormat, + _quality = quality; + + final int _format; + final int _quality; + + // Be conservative with the formats we expose. It is easy to add new formats + // in future but difficult to remove. + // These values must be kept in sync with the logic in ToSkEncodedImageFormat. + static const int _jpegFormat = 0; + static const int _pngFormat = 1; + static const int _webpFormat = 2; +} + /// Opaque handle to raw decoded image data (pixels). /// /// To obtain an [Image] object, use [instantiateImageCodec]. @@ -1215,6 +1289,23 @@ class Image extends NativeFieldWrapperClass2 { /// The number of image pixels along the image's vertical axis. int get height native 'Image_height'; + /// Converts the [Image] object into a byte array. + /// + /// The [format] is encoding format to be used. + /// + /// Returns a future which complete with the binary image data (e.g a PNG or JPEG binary data) or + /// an error if encoding fails. + Future toByteData({EncodingFormat format: const EncodingFormat.jpeg()}) { + return _futurize((_Callback callback) { + return _toByteData(format._format, format._quality, (Uint8List encoded) { + callback(encoded.buffer.asByteData()); + }); + }); + } + + /// Returns an error message on failure, null on success. + String _toByteData(int format, int quality, _Callback callback) native 'Image_toByteData'; + /// Release the resources used by this object. The object is no longer usable /// after this method is called. void dispose() native 'Image_dispose'; diff --git a/lib/ui/painting/image.cc b/lib/ui/painting/image.cc index 0b0127cd0c6c2..42e733241c990 100644 --- a/lib/ui/painting/image.cc +++ b/lib/ui/painting/image.cc @@ -5,6 +5,7 @@ #include "flutter/lib/ui/painting/image.h" #include "flutter/common/threads.h" +#include "flutter/lib/ui/painting/image_encoding.h" #include "flutter/lib/ui/painting/utils.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" @@ -20,6 +21,7 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Image); #define FOR_EACH_BINDING(V) \ V(Image, width) \ V(Image, height) \ + V(Image, toByteData) \ V(Image, dispose) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -36,6 +38,12 @@ CanvasImage::~CanvasImage() { SkiaUnrefOnIOThread(&image_); } +Dart_Handle CanvasImage::toByteData(int format, + int quality, + Dart_Handle callback) { + return EncodeImage(this, format, quality, callback); +} + void CanvasImage::dispose() { ClearDartWrapper(); } diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index 8ad11660721f0..a7ed4298506f5 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -27,6 +27,7 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, int width() { return image_->width(); } int height() { return image_->height(); } + Dart_Handle toByteData(int format, int quality, Dart_Handle callback); void dispose(); const sk_sp& image() const { return image_; } diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc new file mode 100644 index 0000000000000..f356e955f6745 --- /dev/null +++ b/lib/ui/painting/image_encoding.cc @@ -0,0 +1,113 @@ +// 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. + +#include "flutter/lib/ui/painting/image_encoding.h" + +#include "flutter/common/threads.h" +#include "flutter/lib/ui/painting/image.h" +#include "flutter/lib/ui/painting/resource_context.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/tonic/dart_persistent_value.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/logging/dart_invoke.h" +#include "lib/tonic/typed_data/uint8_list.h" +#include "third_party/skia/include/core/SkEncodedImageFormat.h" +#include "third_party/skia/include/core/SkImage.h" + +using tonic::DartInvoke; +using tonic::DartPersistentValue; +using tonic::ToDart; + +namespace blink { +namespace { + +void InvokeDataCallback(std::unique_ptr callback, + sk_sp buffer) { + tonic::DartState* dart_state = callback->dart_state().get(); + if (!dart_state) { + return; + } + tonic::DartState::Scope scope(dart_state); + if (!buffer) { + DartInvoke(callback->value(), {Dart_Null()}); + } else { + Dart_Handle dart_data = tonic::DartConverter::ToDart( + buffer->bytes(), buffer->size()); + DartInvoke(callback->value(), {dart_data}); + } +} + +sk_sp EncodeImage(sk_sp image, + SkEncodedImageFormat format, + int quality) { + if (image == nullptr) { + return nullptr; + } + return image->encodeToData(format, quality); +} + +void EncodeImageAndInvokeDataCallback( + std::unique_ptr callback, + sk_sp image, + SkEncodedImageFormat format, + int quality) { + sk_sp encoded = EncodeImage(std::move(image), format, quality); + + Threads::UI()->PostTask( + fxl::MakeCopyable([callback = std::move(callback), encoded]() mutable { + InvokeDataCallback(std::move(callback), std::move(encoded)); + })); +} + +SkEncodedImageFormat ToSkEncodedImageFormat(int format) { + // Map the formats exposed in flutter to formats supported in Skia. + // See: + // https://github.com/google/skia/blob/master/include/core/SkEncodedImageFormat.h + switch (format) { + case 0: + return SkEncodedImageFormat::kJPEG; + case 1: + return SkEncodedImageFormat::kPNG; + case 2: + return SkEncodedImageFormat::kWEBP; + default: + /* NOTREACHED */ + return SkEncodedImageFormat::kWEBP; + } +} + +} // namespace + +Dart_Handle EncodeImage(CanvasImage* canvas_image, + int format, + int quality, + Dart_Handle callback_handle) { + if (!canvas_image) + return ToDart("encode called with non-genuine Image."); + + if (!Dart_IsClosure(callback_handle)) + return ToDart("Callback must be a function."); + + SkEncodedImageFormat image_format = ToSkEncodedImageFormat(format); + + if (quality > 100) + quality = 100; + if (quality < 0) + quality = 0; + + auto callback = std::make_unique( + tonic::DartState::Current(), callback_handle); + sk_sp image = canvas_image->image(); + + Threads::IO()->PostTask(fxl::MakeCopyable( + [callback = std::move(callback), image, image_format, quality]() mutable { + EncodeImageAndInvokeDataCallback(std::move(callback), std::move(image), + image_format, quality); + })); + + return Dart_Null(); +} + +} // namespace blink diff --git a/lib/ui/painting/image_encoding.h b/lib/ui/painting/image_encoding.h new file mode 100644 index 0000000000000..a121d597ccefd --- /dev/null +++ b/lib/ui/painting/image_encoding.h @@ -0,0 +1,21 @@ +// 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. + +#ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_ENCODING_H_ +#define FLUTTER_LIB_UI_PAINTING_IMAGE_ENCODING_H_ + +#include "lib/tonic/dart_library_natives.h" + +namespace blink { + +class CanvasImage; + +Dart_Handle EncodeImage(CanvasImage* canvas_image, + int format, + int quality, + Dart_Handle callback_handle); + +} // namespace blink + +#endif // FLUTTER_LIB_UI_PAINTING_IMAGE_ENCODING_H_ diff --git a/testing/dart/encoding_test.dart b/testing/dart/encoding_test.dart new file mode 100644 index 0000000000000..5fbbb4eb63909 --- /dev/null +++ b/testing/dart/encoding_test.dart @@ -0,0 +1,63 @@ +// 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 'dart:ui'; +import 'dart:typed_data'; +import 'dart:io'; + +import 'package:test/test.dart'; +import 'package:path/path.dart' as path; + +void main() { + final Image testImage = createSquareTestImage(); + + test('Encode with default arguments', () async { + ByteData data = await testImage.toByteData(); + List expected = readFile('square-80.jpg'); + expect(new Uint8List.view(data.buffer), expected); + }); + + test('Encode JPEG', () async { + ByteData data = await testImage.toByteData( + format: new EncodingFormat.jpeg(quality: 80)); + List expected = readFile('square-80.jpg'); + expect(new Uint8List.view(data.buffer), expected); + }); + + test('Encode PNG', () async { + ByteData data = + await testImage.toByteData(format: new EncodingFormat.png()); + List expected = readFile('square.png'); + expect(new Uint8List.view(data.buffer), expected); + }); + + test('Encode WEBP', () async { + ByteData data = await testImage.toByteData( + format: new EncodingFormat.webp(quality: 80)); + List expected = readFile('square-80.webp'); + expect(new Uint8List.view(data.buffer), expected); + }); +} + +Image createSquareTestImage() { + PictureRecorder recorder = new PictureRecorder(); + Canvas canvas = new Canvas(recorder, new Rect.fromLTWH(0.0, 0.0, 10.0, 10.0)); + + Paint black = new Paint() + ..strokeWidth = 1.0 + ..color = const Color.fromRGBO(0, 0, 0, 1.0); + Paint green = new Paint() + ..strokeWidth = 1.0 + ..color = const Color.fromRGBO(0, 255, 0, 1.0); + + canvas.drawRect(new Rect.fromLTWH(0.0, 0.0, 10.0, 10.0), black); + canvas.drawRect(new Rect.fromLTWH(2.0, 2.0, 6.0, 6.0), green); + return recorder.endRecording().toImage(10, 10); +} + +List readFile(fileName) { + final file = new File(path.join('flutter', 'testing', 'resources', fileName)); + return file.readAsBytesSync(); +} diff --git a/testing/resources/square-80.jpg b/testing/resources/square-80.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1140c33bd39039758e39b057c1da6ea0746bee4e GIT binary patch literal 928 zcmex=dDF&IcpE-rwvvCu$szg+{F&cJY47mGY0A>d!iC?v=ksAd6>t&xtzPC{armlTu$)tmsSPcA3|vF`xcHn};aAiF>S zGB z4}|FqISi=`3JjhMc?`)6dO(&Dg8_pfgW3Pv49*N}EUav-ENpD7Z0zi899#liT%4R- zB7FQj0^%YP65=9aVp6iI@>0^uGGby1Itt2a>Y7@blJdF+x*7(m8k!m)Lm1iF*||8l zgt@qcHKfF(G)M;j4=@OFFmN$&F*7PLFbOg;3o`yc!XO4ryNoc;LufX3ptu4s9ka49 zBTF$dF#|mzD9kRTXb4mxilLE(6(}q($iT$N%!;Iuk(r4_P?15&Ffh^S|1Aa{prK5H z%z_N|46To=#qP}9^mz4?#oI%7Z{GEN$DD^pRraU~)+k97F!1VX3mo&yF%mLo`184O f^8GnkrJ}-_x2_p3OGJ$(bU=hK^z`&pY#GGK{>FgXJ0hDE6V3Gin0t^hfc_l?b?oJ93 zkx>dDF&IcpE-rwvvCxbR4BxIX07(Xh%eq+P2?=qgq!uRw6@38Wk|Lnx3=E7ZK(9f_TU#4ax>C;_TD0aBk_Py}M%0kUm!b4o#WfdI(G zJgIr1!9Y3!h-Dax8G;zx8JvJ@sscoK<}YSou=vKnz&sHlmNbQdVS6hBgTx(#n94#1 z27aK}wkrjRMTua?umDM>v@`~WPsf4F%}28J29*~C-V}>VJUX<4B-HR z8jh3>AYa|n#W6%;YH~_K!jJO~ED1_(g3Lg`J*V|_jGK_J3>TNAzopr06J_NxBvhE literal 0 HcmV?d00001 diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 7de50c115fd76..8749f6880dbf4 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -1642,6 +1642,8 @@ ORIGIN: ../../../flutter/assets/asset_provider.h + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/assets/asset_provider.h FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart +FILE: ../../../flutter/lib/ui/painting/image_encoding.cc +FILE: ../../../flutter/lib/ui/painting/image_encoding.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm From d2b69fec751d6d11f62019c863b2cba4ce575bfe Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 5 Apr 2018 17:43:30 -0700 Subject: [PATCH 0060/1190] Require armv7 in create_ios_framework.py (#4944) This enforces that iOS Flutter.framework builds include arm64, armv7, and x86_64 (simulator) architectures. This change also eliminates the previous --device-out-dir option, which has been replaced by --arm64-out-dir. --- sky/tools/create_ios_framework.py | 32 ++++++++++++------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/sky/tools/create_ios_framework.py b/sky/tools/create_ios_framework.py index 45759c32046df..2f2a277859797 100755 --- a/sky/tools/create_ios_framework.py +++ b/sky/tools/create_ios_framework.py @@ -14,32 +14,26 @@ def main(): parser = argparse.ArgumentParser(description='Creates Flutter.framework') parser.add_argument('--dst', type=str, required=True) - # TODO(cbracken) eliminate --device-out-dir and make armv7-out-dir and - # arm64-out-dir required once bot recipe is updated. - parser.add_argument('--device-out-dir', type=str, required=False) - parser.add_argument('--arm64-out-dir', type=str, required=False) - parser.add_argument('--armv7-out-dir', type=str, required=False) + parser.add_argument('--arm64-out-dir', type=str, required=True) + parser.add_argument('--armv7-out-dir', type=str, required=True) parser.add_argument('--simulator-out-dir', type=str, required=True) args = parser.parse_args() - if not (args.arm64_out_dir or args.device_out_dir): - print 'One of --device-out-dir or --arm64-out-dir must be specified' fat_framework = os.path.join(args.dst, 'Flutter.framework') - arm64_framework = os.path.join(args.arm64_out_dir if args.arm64_out_dir else args.device_out_dir, 'Flutter.framework') - armv7_framework = os.path.join(args.armv7_out_dir, 'Flutter.framework') if args.armv7_out_dir else None + arm64_framework = os.path.join(args.arm64_out_dir, 'Flutter.framework') + armv7_framework = os.path.join(args.armv7_out_dir, 'Flutter.framework') simulator_framework = os.path.join(args.simulator_out_dir, 'Flutter.framework') arm64_dylib = os.path.join(arm64_framework, 'Flutter') - armv7_dylib = os.path.join(armv7_framework, 'Flutter') if args.armv7_out_dir else None + armv7_dylib = os.path.join(armv7_framework, 'Flutter') simulator_dylib = os.path.join(simulator_framework, 'Flutter') if not os.path.isdir(arm64_framework): print 'Cannot find iOS arm64 Framework at', arm64_framework return 1 - # TODO(cbracken): require armv7 once bot recipe is updated. - if armv7_framework and not os.path.isdir(armv7_framework): + if not os.path.isdir(armv7_framework): print 'Cannot find iOS armv7 Framework at', armv7_framework return 1 @@ -51,8 +45,7 @@ def main(): print 'Cannot find iOS arm64 dylib at', arm64_dylib return 1 - # TODO(cbracken): require armv7 once bot recipe is updated. - if armv7_dylib and not os.path.isfile(armv7_dylib): + if not os.path.isfile(armv7_dylib): print 'Cannot find iOS armv7 dylib at', armv7_dylib return 1 @@ -63,12 +56,11 @@ def main(): shutil.rmtree(fat_framework, True) shutil.copytree(arm64_framework, fat_framework) - # TODO(cbracken): require armv7 once bot recipe is updated. - dylibs = [arm64_dylib, simulator_dylib] - if armv7_dylib: - dylibs += [armv7_dylib] - - subprocess.call(['lipo'] + dylibs + [ + subprocess.call([ + 'lipo', + arm64_dylib, + armv7_dylib, + simulator_dylib, '-create', '-output', os.path.join(fat_framework, 'Flutter') From d42b5b73b5057ef6a5ad5c61ccc6a137ffdf0fbf Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 6 Apr 2018 11:48:03 -0700 Subject: [PATCH 0061/1190] libtxt: support for locale-specific text styles (#4943) Fixes https://github.com/flutter/flutter/issues/12630 --- lib/snapshot/fuchsia_compilation_trace.txt | 2 + lib/ui/text.dart | 51 +++++++++++++++++----- lib/ui/text/paragraph_builder.cc | 25 ++++++++--- lib/ui/text/paragraph_builder.h | 9 ++-- third_party/txt/src/txt/paragraph.cc | 8 +++- third_party/txt/src/txt/paragraph_style.cc | 1 + third_party/txt/src/txt/paragraph_style.h | 2 + third_party/txt/src/txt/text_style.cc | 2 + third_party/txt/src/txt/text_style.h | 1 + 9 files changed, 80 insertions(+), 21 deletions(-) diff --git a/lib/snapshot/fuchsia_compilation_trace.txt b/lib/snapshot/fuchsia_compilation_trace.txt index ccefbcce8471c..49bf715cfcdca 100644 --- a/lib/snapshot/fuchsia_compilation_trace.txt +++ b/lib/snapshot/fuchsia_compilation_trace.txt @@ -1845,6 +1845,7 @@ dart:ui,TextStyle,get:_fontSize dart:ui,TextStyle,get:_letterSpacing dart:ui,TextStyle,get:_wordSpacing dart:ui,TextStyle,get:_height +dart:ui,TextStyle,get:_locale dart:ui,FilterQuality,get:index dart:ui,ParagraphStyle,ParagraphStyle. dart:ui,ParagraphStyle,get:_encoded @@ -1852,6 +1853,7 @@ dart:ui,ParagraphStyle,get:_fontFamily dart:ui,ParagraphStyle,get:_fontSize dart:ui,ParagraphStyle,get:_lineHeight dart:ui,ParagraphStyle,get:_ellipsis +dart:ui,ParagraphStyle,get:_locale dart:ui,_Jenkins,combine dart:ui,_Jenkins,finish dart:ui,_HashEnd,_HashEnd. diff --git a/lib/ui/text.dart b/lib/ui/text.dart index 5a456eeb232cb..7c42c878a9e55 100644 --- a/lib/ui/text.dart +++ b/lib/ui/text.dart @@ -256,6 +256,7 @@ Int32List _encodeTextStyle( double letterSpacing, double wordSpacing, double height, + Locale locale, ) { final Int32List result = new Int32List(8); if (color != null) { @@ -306,6 +307,10 @@ Int32List _encodeTextStyle( result[0] |= 1 << 12; // Passed separately to native. } + if (locale != null) { + result[0] |= 1 << 13; + // Passed separately to native. + } return result; } @@ -325,6 +330,7 @@ class TextStyle { /// * `wordSpacing`: The amount of space (in logical pixels) to add at each sequence of white-space (i.e. between each word). /// * `textBaseline`: The common baseline that should be aligned between this text span and its parent text span, or, for the root text spans, with the line box. /// * `height`: The height of this text span, as a multiple of the font size. + /// * `locale`: The locale used to select region-specific glyphs. TextStyle({ Color color, TextDecoration decoration, @@ -338,6 +344,7 @@ class TextStyle { double letterSpacing, double wordSpacing, double height, + Locale locale, }) : _encoded = _encodeTextStyle( color, decoration, @@ -351,12 +358,14 @@ class TextStyle { letterSpacing, wordSpacing, height, + locale, ), _fontFamily = fontFamily ?? '', _fontSize = fontSize, _letterSpacing = letterSpacing, _wordSpacing = wordSpacing, - _height = height; + _height = height, + _locale = locale; final Int32List _encoded; final String _fontFamily; @@ -364,6 +373,7 @@ class TextStyle { final double _letterSpacing; final double _wordSpacing; final double _height; + final Locale _locale; @override bool operator ==(dynamic other) { @@ -376,7 +386,8 @@ class TextStyle { _fontSize != typedOther._fontSize || _letterSpacing != typedOther._letterSpacing || _wordSpacing != typedOther._wordSpacing || - _height != typedOther._height) + _height != typedOther._height || + _locale != typedOther._locale) return false; for (int index = 0; index < _encoded.length; index += 1) { if (_encoded[index] != typedOther._encoded[index]) @@ -386,7 +397,7 @@ class TextStyle { } @override - int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _letterSpacing, _wordSpacing, _height); + int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _letterSpacing, _wordSpacing, _height, _locale); @override String toString() { @@ -402,7 +413,8 @@ class TextStyle { 'fontSize: ${ _encoded[0] & 0x0200 == 0x0200 ? _fontSize : "unspecified"}, ' 'letterSpacing: ${ _encoded[0] & 0x0400 == 0x0400 ? "${_letterSpacing}x" : "unspecified"}, ' 'wordSpacing: ${ _encoded[0] & 0x0800 == 0x0800 ? "${_wordSpacing}x" : "unspecified"}, ' - 'height: ${ _encoded[0] & 0x1000 == 0x1000 ? "${_height}x" : "unspecified"}' + 'height: ${ _encoded[0] & 0x1000 == 0x1000 ? "${_height}x" : "unspecified"}, ' + 'locale: ${ _encoded[0] & 0x2000 == 0x2000 ? _locale : "unspecified"}' ')'; } } @@ -434,6 +446,7 @@ Int32List _encodeParagraphStyle( double fontSize, double lineHeight, String ellipsis, + Locale locale, ) { final Int32List result = new Int32List(6); // also update paragraph_builder.cc if (textAlign != null) { @@ -472,6 +485,10 @@ Int32List _encodeParagraphStyle( result[0] |= 1 << 9; // Passed separately to native. } + if (locale != null) { + result[0] |= 1 << 10; + // Passed separately to native. + } return result; } @@ -521,6 +538,8 @@ class ParagraphStyle { /// constraints are those set in the [ParagraphConstraints] object passed to /// the [Paragraph.layout] method. The empty string and the null value are /// considered equivalent and turn off this behavior. + /// + /// * `locale`: The locale used to select region-specific glyphs. ParagraphStyle({ TextAlign textAlign, TextDirection textDirection, @@ -531,6 +550,7 @@ class ParagraphStyle { double fontSize, double lineHeight, String ellipsis, + Locale locale, }) : _encoded = _encodeParagraphStyle( textAlign, textDirection, @@ -541,17 +561,20 @@ class ParagraphStyle { fontSize, lineHeight, ellipsis, + locale, ), _fontFamily = fontFamily, _fontSize = fontSize, _lineHeight = lineHeight, - _ellipsis = ellipsis; + _ellipsis = ellipsis, + _locale = locale; final Int32List _encoded; final String _fontFamily; final double _fontSize; final double _lineHeight; final String _ellipsis; + final Locale _locale; @override bool operator ==(dynamic other) { @@ -563,7 +586,8 @@ class ParagraphStyle { if (_fontFamily != typedOther._fontFamily || _fontSize != typedOther._fontSize || _lineHeight != typedOther._lineHeight || - _ellipsis != typedOther._ellipsis) + _ellipsis != typedOther._ellipsis || + _locale != typedOther._locale) return false; for (int index = 0; index < _encoded.length; index += 1) { if (_encoded[index] != typedOther._encoded[index]) @@ -573,7 +597,7 @@ class ParagraphStyle { } @override - int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _lineHeight, _ellipsis); + int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _lineHeight, _ellipsis, _locale); @override String toString() { @@ -586,7 +610,8 @@ class ParagraphStyle { 'fontFamily: ${ _encoded[0] & 0x040 == 0x040 ? _fontFamily : "unspecified"}, ' 'fontSize: ${ _encoded[0] & 0x080 == 0x080 ? _fontSize : "unspecified"}, ' 'lineHeight: ${ _encoded[0] & 0x100 == 0x100 ? "${_lineHeight}x" : "unspecified"}, ' - 'ellipsis: ${ _encoded[0] & 0x200 == 0x200 ? "\"$_ellipsis\"" : "unspecified"}' + 'ellipsis: ${ _encoded[0] & 0x200 == 0x200 ? "\"$_ellipsis\"" : "unspecified"}, ' + 'locale: ${ _encoded[0] & 0x400 == 0x400 ? _locale : "unspecified"}' ')'; } } @@ -982,14 +1007,16 @@ class Paragraph extends NativeFieldWrapperClass2 { class ParagraphBuilder extends NativeFieldWrapperClass2 { /// Creates a [ParagraphBuilder] object, which is used to create a /// [Paragraph]. - ParagraphBuilder(ParagraphStyle style) { _constructor(style._encoded, style._fontFamily, style._fontSize, style._lineHeight, style._ellipsis); } - void _constructor(Int32List encoded, String fontFamily, double fontSize, double lineHeight, String ellipsis) native 'ParagraphBuilder_constructor'; + ParagraphBuilder(ParagraphStyle style) { _constructor(style._encoded, style._fontFamily, style._fontSize, style._lineHeight, style._ellipsis, _encodeLocale(style._locale)); } + void _constructor(Int32List encoded, String fontFamily, double fontSize, double lineHeight, String ellipsis, String locale) native 'ParagraphBuilder_constructor'; /// Applies the given style to the added text until [pop] is called. /// /// See [pop] for details. - void pushStyle(TextStyle style) => _pushStyle(style._encoded, style._fontFamily, style._fontSize, style._letterSpacing, style._wordSpacing, style._height); - void _pushStyle(Int32List encoded, String fontFamily, double fontSize, double letterSpacing, double wordSpacing, double height) native 'ParagraphBuilder_pushStyle'; + void pushStyle(TextStyle style) => _pushStyle(style._encoded, style._fontFamily, style._fontSize, style._letterSpacing, style._wordSpacing, style._height, _encodeLocale(style._locale)); + void _pushStyle(Int32List encoded, String fontFamily, double fontSize, double letterSpacing, double wordSpacing, double height, String locale) native 'ParagraphBuilder_pushStyle'; + + static String _encodeLocale(Locale locale) => locale?.toString() ?? ''; /// Ends the effect of the most recent call to [pushStyle]. /// diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index 469f2ca939c7b..44d05053ba342 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -41,6 +41,7 @@ const int tsFontSizeIndex = 9; const int tsLetterSpacingIndex = 10; const int tsWordSpacingIndex = 11; const int tsHeightIndex = 12; +const int tsLocaleIndex = 13; const int tsColorMask = 1 << tsColorIndex; const int tsTextDecorationMask = 1 << tsTextDecorationIndex; @@ -54,6 +55,7 @@ const int tsFontSizeMask = 1 << tsFontSizeIndex; const int tsLetterSpacingMask = 1 << tsLetterSpacingIndex; const int tsWordSpacingMask = 1 << tsWordSpacingIndex; const int tsHeightMask = 1 << tsHeightIndex; +const int tsLocaleMask = 1 << tsLocaleIndex; // ParagraphStyle @@ -66,6 +68,7 @@ const int psFontFamilyIndex = 6; const int psFontSizeIndex = 7; const int psLineHeightIndex = 8; const int psEllipsisIndex = 9; +const int psLocaleIndex = 10; const int psTextAlignMask = 1 << psTextAlignIndex; const int psTextDirectionMask = 1 << psTextDirectionIndex; @@ -76,6 +79,7 @@ const int psFontFamilyMask = 1 << psFontFamilyIndex; const int psFontSizeMask = 1 << psFontSizeIndex; const int psLineHeightMask = 1 << psLineHeightIndex; const int psEllipsisMask = 1 << psEllipsisIndex; +const int psLocaleMask = 1 << psLocaleIndex; float getComputedSizeFromSpecifiedSize(float specifiedSize) { if (specifiedSize < std::numeric_limits::epsilon()) @@ -191,7 +195,7 @@ FOR_EACH_BINDING(DART_NATIVE_CALLBACK) void ParagraphBuilder::RegisterNatives(tonic::DartLibraryNatives* natives) { natives->Register( - {{"ParagraphBuilder_constructor", ParagraphBuilder_constructor, 6, true}, + {{"ParagraphBuilder_constructor", ParagraphBuilder_constructor, 7, true}, FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } @@ -200,16 +204,18 @@ fxl::RefPtr ParagraphBuilder::create( const std::string& fontFamily, double fontSize, double lineHeight, - const std::u16string& ellipsis) { + const std::u16string& ellipsis, + const std::string& locale) { return fxl::MakeRefCounted(encoded, fontFamily, fontSize, - lineHeight, ellipsis); + lineHeight, ellipsis, locale); } ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, const std::string& fontFamily, double fontSize, double lineHeight, - const std::u16string& ellipsis) { + const std::u16string& ellipsis, + const std::string& locale) { if (!Settings::Get().using_blink) { int32_t mask = encoded[0]; txt::ParagraphStyle style; @@ -242,6 +248,10 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, style.ellipsis = ellipsis; } + if (mask & psLocaleMask) { + style.locale = locale; + } + m_paragraphBuilder = std::make_unique( style, blink::FontCollection::ForProcess().GetFontCollection()); } else { @@ -274,7 +284,8 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, double fontSize, double letterSpacing, double wordSpacing, - double height) { + double height, + const std::string& locale) { FXL_DCHECK(encoded.num_elements() == 8); int32_t mask = encoded[0]; @@ -331,6 +342,10 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, style.height = height; } + if (mask & tsLocaleMask) { + style.locale = locale; + } + m_paragraphBuilder->PushStyle(style); } else { // Blink Version. diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index ceb8c3a5de8f6..37a1e9a3e74cf 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -31,7 +31,8 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, const std::string& fontFamily, double fontSize, double lineHeight, - const std::u16string& ellipsis); + const std::u16string& ellipsis, + const std::string& locale); ~ParagraphBuilder() override; @@ -40,7 +41,8 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double letterSpacing, double wordSpacing, - double height); + double height, + const std::string& locale); void pop(); @@ -55,7 +57,8 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, const std::string& fontFamily, double fontSize, double lineHeight, - const std::u16string& ellipsis); + const std::u16string& ellipsis, + const std::string& locale); void createRenderView(); diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index cad44199e7e70..aec59771798e4 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -28,6 +28,7 @@ #include "font_collection.h" #include "font_skia.h" #include "lib/fxl/logging.h" +#include "minikin/FontLanguageListCache.h" #include "minikin/HbFontCache.h" #include "minikin/LayoutUtils.h" #include "minikin/LineBreaker.h" @@ -130,7 +131,12 @@ bool GetItalic(const TextStyle& style) { } minikin::FontStyle GetMinikinFontStyle(const TextStyle& style) { - return minikin::FontStyle(GetWeight(style), GetItalic(style)); + uint32_t language_list_id = + style.locale.empty() + ? minikin::FontLanguageListCache::kEmptyListId + : minikin::FontStyle::registerLanguageList(style.locale); + return minikin::FontStyle(language_list_id, 0, GetWeight(style), + GetItalic(style)); } void GetFontAndMinikinPaint(const TextStyle& style, diff --git a/third_party/txt/src/txt/paragraph_style.cc b/third_party/txt/src/txt/paragraph_style.cc index a7941ad4e5bfe..362f138bb3056 100644 --- a/third_party/txt/src/txt/paragraph_style.cc +++ b/third_party/txt/src/txt/paragraph_style.cc @@ -24,6 +24,7 @@ TextStyle ParagraphStyle::GetTextStyle() const { result.font_style = font_style; result.font_family = font_family; result.font_size = font_size; + result.locale = locale; return result; } diff --git a/third_party/txt/src/txt/paragraph_style.h b/third_party/txt/src/txt/paragraph_style.h index 8c2701768b6a1..13d32106c1df3 100644 --- a/third_party/txt/src/txt/paragraph_style.h +++ b/third_party/txt/src/txt/paragraph_style.h @@ -53,6 +53,8 @@ class ParagraphStyle { size_t max_lines = std::numeric_limits::max(); double line_height = 1.0; std::u16string ellipsis; + std::string locale; + // Default strategy is kBreakStrategy_Greedy. Sometimes, // kBreakStrategy_HighQuality will produce more desireable layouts (eg, very // long words are more likely to be reasonably placed). diff --git a/third_party/txt/src/txt/text_style.cc b/third_party/txt/src/txt/text_style.cc index 0796ad27e4f75..242b6f3818b77 100644 --- a/third_party/txt/src/txt/text_style.cc +++ b/third_party/txt/src/txt/text_style.cc @@ -47,6 +47,8 @@ bool TextStyle::equals(const TextStyle& other) const { return false; if (height != other.height) return false; + if (locale != other.locale) + return false; return true; } diff --git a/third_party/txt/src/txt/text_style.h b/third_party/txt/src/txt/text_style.h index 6e125606384aa..0a57cc7c681a0 100644 --- a/third_party/txt/src/txt/text_style.h +++ b/third_party/txt/src/txt/text_style.h @@ -45,6 +45,7 @@ class TextStyle { double letter_spacing = 0.0; double word_spacing = 0.0; double height = 1.0; + std::string locale; TextStyle(); From 5156f92d7982b7de18b8b1cfd6f50bc90767c5b3 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Fri, 6 Apr 2018 13:23:31 -0700 Subject: [PATCH 0062/1190] [fuchsia] Add dummy setAssetBundle service extension (#4945) --- content_handler/service_protocol_hooks.cc | 73 +++++++++++++++++++++++ content_handler/service_protocol_hooks.h | 8 +++ 2 files changed, 81 insertions(+) diff --git a/content_handler/service_protocol_hooks.cc b/content_handler/service_protocol_hooks.cc index 947f2a226e615..9a91254f13488 100644 --- a/content_handler/service_protocol_hooks.cc +++ b/content_handler/service_protocol_hooks.cc @@ -17,6 +17,32 @@ namespace flutter_runner { namespace { constexpr char kViewIdPrefx[] = "_flutterView/"; +constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; + +static intptr_t KeyIndex(const char** param_keys, + intptr_t num_params, + const char* key) { + if (param_keys == NULL) { + return -1; + } + for (intptr_t i = 0; i < num_params; i++) { + if (strcmp(param_keys[i], key) == 0) { + return i; + } + } + return -1; +} + +static const char* ValueForKey(const char** param_keys, + const char** param_values, + intptr_t num_params, + const char* key) { + intptr_t index = KeyIndex(param_keys, num_params, key); + if (index < 0) { + return NULL; + } + return param_values[index]; +} static void AppendIsolateRef(std::stringstream* stream, int64_t main_port, @@ -47,6 +73,9 @@ void ServiceProtocolHooks::RegisterHooks(bool running_precompiled_code) { // Listing of FlutterViews. Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, nullptr); + + Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, + &SetAssetBundlePath, nullptr); } const char* ServiceProtocolHooks::kListViewsExtensionName = @@ -88,4 +117,48 @@ bool ServiceProtocolHooks::ListViews(const char* method, return true; } +const char* ServiceProtocolHooks::kSetAssetBundlePathExtensionName = + "_flutter.setAssetBundlePath"; + +bool ServiceProtocolHooks::SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + const char* view_id_str = + ValueForKey(param_keys, param_values, num_params, "viewId"); + + // Ask the App for the list of platform views. This will run a task on + // the UI thread before returning. + App& app = App::Shared(); + std::vector platform_views; + app.WaitForPlatformViewIds(&platform_views); + + // Convert the actual flutter view hex id into a number. + uintptr_t view_id_as_num = + std::stoull((view_id_str + kViewIdPrefxLength), nullptr, 16); + + // The view existed and the isolate was created. Success. + std::stringstream response; + response << "{\"type\":\"Success\"," + << "\"view\":"; + for (auto it = platform_views.begin(); it != platform_views.end(); it++) { + uintptr_t view_id = it->view_id; + int64_t isolate_id = it->isolate_id; + const std::string& isolate_name = it->isolate_name; + if (!view_id || view_id != view_id_as_num) { + continue; + } + + // TODO(DX): Set up asset bundle path for the isolate. + + AppendFlutterView(&response, view_id, isolate_id, isolate_name); + break; + } + response << "}"; + *json_object = strdup(response.str().c_str()); + return true; +} + } // namespace flutter_runner diff --git a/content_handler/service_protocol_hooks.h b/content_handler/service_protocol_hooks.h index eb73a6c869f49..479fb71471f1e 100644 --- a/content_handler/service_protocol_hooks.h +++ b/content_handler/service_protocol_hooks.h @@ -22,6 +22,14 @@ class ServiceProtocolHooks { intptr_t num_params, void* user_data, const char** json_object); + + static const char* kSetAssetBundlePathExtensionName; + static bool SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); }; } // namespace flutter_runner From 0122d58426750a9cc0a6ce9e48cba33b903d5c96 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 6 Apr 2018 17:13:41 -0700 Subject: [PATCH 0063/1190] [fuchsia] Update for SizedVmoTransport to Buffer rename (#4946) --- content_handler/fuchsia_font_manager.cc | 12 ++++++------ .../platform/fonts/fuchsia/FontCacheFuchsia.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc index b68eb610edb24..4e409cae94f6a 100644 --- a/content_handler/fuchsia_font_manager.cc +++ b/content_handler/fuchsia_font_manager.cc @@ -32,14 +32,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromVMO(fsl::SizedVmoTransport vmo) { - if (!fsl::SizedVmo::IsSizeValid(vmo.vmo, vmo.size) || - vmo.size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromBuffer(mem::Buffer data) { + if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || + data.size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = vmo.size; + uint64_t size = data.size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, vmo.vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -107,7 +107,7 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( if (!response) return nullptr; - sk_sp data = MakeSkDataFromVMO(std::move(response->data.vmo)); + sk_sp data = MakeSkDataFromBuffer(std::move(response->data.buffer)); if (!data) return nullptr; diff --git a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp b/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp index 446a2939dc64b..78ac2b4d33243 100644 --- a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp +++ b/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp @@ -65,14 +65,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransport& vmo) { - if (!fsl::SizedVmo::IsSizeValid(vmo.vmo, vmo.size) || - vmo.size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromBuffer(const mem::Buffer& data) { + if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || + data.size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = vmo.size; + uint64_t size = data.size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, vmo.vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -132,7 +132,7 @@ sk_sp FontCache::createTypeface( if (!response) return nullptr; - sk_sp data = MakeSkDataFromVMO(response->data.vmo); + sk_sp data = MakeSkDataFromBuffer(response->data.buffer); if (!data) return nullptr; From 4173601071f750bef9421257ed2db3fc01428b54 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 6 Apr 2018 19:21:05 -0700 Subject: [PATCH 0064/1190] Add tool to create multi-arch iOS gen_snapshot (#4948) This adds create_macos_gen_snapshot.py, which can be used to generate a multi-architecture (x86_64, i386) gen_snapshot fat binary. The resulting binary can then be run in the desired mode using: /usr/bin/arch -i386 path/to/gen_snapshot /usr/bin/arch -x86_64 path/to/gen_snapshot When creating AOT snapshots for iOS, running as an i386 binary will generate armv7 code, whereas running as an x86_64 binary will generate arm64 code. The primary user of this script is the build bot. --- sky/tools/create_macos_gen_snapshot.py | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 sky/tools/create_macos_gen_snapshot.py diff --git a/sky/tools/create_macos_gen_snapshot.py b/sky/tools/create_macos_gen_snapshot.py new file mode 100755 index 0000000000000..b7597200a3b38 --- /dev/null +++ b/sky/tools/create_macos_gen_snapshot.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# 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 argparse +import subprocess +import sys +import os + + +def main(): + parser = argparse.ArgumentParser(description='Creates multi-arch gen_snapshot') + + parser.add_argument('--dst', type=str, required=True) + parser.add_argument('--arm64-out-dir', type=str, required=True) + parser.add_argument('--armv7-out-dir', type=str, required=True) + + args = parser.parse_args() + + fat_gen_snapshot = os.path.join(args.dst, 'gen_snapshot') + arm64_gen_snapshot = os.path.join(args.arm64_out_dir, 'clang_x64', 'gen_snapshot') + armv7_gen_snapshot = os.path.join(args.armv7_out_dir, 'clang_x86', 'gen_snapshot') + + if not os.path.isfile(arm64_gen_snapshot): + print 'Cannot find x86_64 (arm64) gen_snapshot at', arm64_gen_snapshot + return 1 + + if not os.path.isfile(armv7_gen_snapshot): + print 'Cannot find i386 (armv7) gen_snapshot at', armv7_gen_snapshot + return 1 + + subprocess.call([ + 'lipo', + arm64_gen_snapshot, + armv7_gen_snapshot, + '-create', + '-output', + fat_gen_snapshot, + ]) + + +if __name__ == '__main__': + sys.exit(main()) + From 8c00101a59cd16c30d51663b58c6f2ee9ee2e2b9 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 9 Apr 2018 14:45:39 -0400 Subject: [PATCH 0065/1190] Add support for measuring, combining, and getting bounds of Path objects (#4799) * add path measure * fix typo * getBound and addPathWithMatrix * Add myself to Authors, add PathOps * fix linting issues * update licenses_flutter to add new files * Use matrix4 instead of matrix3 for consistency/interop * put pubspec back * fix bug in getSegment * fix typo * Add return value for PathOp * refactoring from review * refactoring from review - still TBD on computeMetrics() * add doc * lint issue * fix computeMetrics, add Path.from * add missing wireup for clone * change PathMetrics to iterable, fix bug with angle on Tangent * prefer std::make_unique * cleanup docs * add path measure * fix typo * getBound and addPathWithMatrix * Add myself to Authors, add PathOps * fix linting issues * update licenses_flutter to add new files * Use matrix4 instead of matrix3 for consistency/interop * put pubspec back * fix bug in getSegment * fix typo * Add return value for PathOp * refactoring from review * refactoring from review - still TBD on computeMetrics() * add doc * lint issue * fix computeMetrics, add Path.from * add missing wireup for clone * change PathMetrics to iterable, fix bug with angle on Tangent * prefer std::make_unique * cleanup docs * fix iterator bug * remove unnecessary clone for computeMetrics * fix some doc issues * fix PathMeasure iterator, extendWithPath, isClosed, and pubspec.lock * get rid of orElse; use StateException * StateError, not StateException * doc improvements and nits * add unit tests, fix bugs found during testing * fix two uncommited doc changes * one more * change sign of tangent angle, update docs * update unit tests for inverted angle * update tangent to include vector * Doc fixes --- lib/ui/BUILD.gn | 2 + lib/ui/dart_ui.cc | 2 + lib/ui/painting.dart | 306 +++++++++++++++++++++++- lib/ui/painting/path.cc | 52 +++- lib/ui/painting/path.h | 18 ++ lib/ui/painting/path_measure.cc | 110 +++++++++ lib/ui/painting/path_measure.h | 51 ++++ lib/ui/ui.dart | 1 + testing/dart/path_test.dart | 225 +++++++++++++++++ travis/licenses_golden/licenses_flutter | 2 + 10 files changed, 758 insertions(+), 11 deletions(-) create mode 100644 lib/ui/painting/path_measure.cc create mode 100644 lib/ui/painting/path_measure.h create mode 100644 testing/dart/path_test.dart diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 8b3be72d5973b..57824f8e1ec3c 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -36,6 +36,8 @@ source_set("ui") { "painting/paint.h", "painting/path.cc", "painting/path.h", + "painting/path_measure.cc", + "painting/path_measure.h", "painting/picture.cc", "painting/picture.h", "painting/picture_recorder.cc", diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc index 59d083a191778..824152e28e8d0 100644 --- a/lib/ui/dart_ui.cc +++ b/lib/ui/dart_ui.cc @@ -15,6 +15,7 @@ #include "flutter/lib/ui/painting/image_filter.h" #include "flutter/lib/ui/painting/image_shader.h" #include "flutter/lib/ui/painting/path.h" +#include "flutter/lib/ui/painting/path_measure.h" #include "flutter/lib/ui/painting/picture.h" #include "flutter/lib/ui/painting/picture_recorder.h" #include "flutter/lib/ui/painting/vertices.h" @@ -53,6 +54,7 @@ void DartUI::InitForGlobal() { CanvasGradient::RegisterNatives(g_natives); CanvasImage::RegisterNatives(g_natives); CanvasPath::RegisterNatives(g_natives); + CanvasPathMeasure::RegisterNatives(g_natives); Codec::RegisterNatives(g_natives); DartRuntimeHooks::RegisterNatives(g_natives); FrameInfo::RegisterNatives(g_natives); diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 02c4b4986e194..a26cdf9ac87bd 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -39,6 +39,12 @@ bool _offsetIsValid(Offset offset) { return true; } +bool _matrix4IsValid(Float64List matrix4) { + assert(matrix4 != null, 'Matrix4 argument was null.'); + assert(matrix4.length == 16, 'Matrix4 must have 16 entries.'); + return true; +} + bool _radiusIsValid(Radius radius) { assert(radius != null, 'Radius argument was null.'); assert(!radius.x.isNaN && !radius.y.isNaN, 'Radius argument contained a NaN value.'); @@ -1431,6 +1437,62 @@ enum PathFillType { evenOdd, } +/// Strategies for combining paths. +/// +/// See also: +/// +/// * [Path.combine], which uses this enum to decide how to combine two paths. +// Must be kept in sync with SkPathOp +enum PathOperation { + /// Subtract the second path from the first path. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the result would be a crescent portion of the + /// first circle that was not overlapped by the second circle. + /// + /// See also: + /// + /// * [reverseDifference], which is the same but subtracting the first path + /// from the second. + difference, + /// Create a new path that is the intersection of the two paths, leaving the + /// overlapping pieces of the path. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the result would be only the overlapping portion + /// of the two circles. + /// + /// See also: + /// * [xor], which is the inverse of this operation + intersect, + /// Create a new path that is the union (inclusive-or) of the two paths. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the result would be a figure-eight like shape + /// matching the outter boundaries of both circles. + union, + /// Create a new path that is the exclusive-or of the two paths, leaving + /// everything but the overlapping pieces of the path. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the figure-eight like shape less the overlapping parts + /// + /// See also: + /// * [intersect], which is the inverse of this operation + xor, + /// Subtract the first path from the second path. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the result would be a crescent portion of the + /// second circle that was not overlapped by the first circle. + /// + /// See also: + /// + /// * [difference], which is the same but subtracting the second path + /// from the frist. + reverseDifference, +} + /// A complex, one-dimensional subset of a plane. /// /// A path consists of a number of subpaths, and a _current point_. @@ -1453,6 +1515,15 @@ class Path extends NativeFieldWrapperClass2 { Path() { _constructor(); } void _constructor() native 'Path_constructor'; + /// Creates a copy of another [Path]. + /// + /// This copy is fast and does not require additional memory unless either + /// the `source` path or the path returned by this constructor are modified. + factory Path.from(Path source) { + return source._clone(); + } + Path _clone() native 'Path_clone'; + /// Determines how the interior of this path is calculated. /// /// Defaults to the non-zero winding rule, [PathFillType.nonZero]. @@ -1650,23 +1721,43 @@ class Path extends NativeFieldWrapperClass2 { } void _addRRect(Float32List rrect) native 'Path_addRRect'; - /// Adds a new subpath that consists of the given path offset by the given - /// offset. - void addPath(Path path, Offset offset) { + /// Adds a new subpath that consists of the given `path` offset by the given + /// `offset`. + /// + /// If `matrix4` is specified, the path will be transformed by this matrix + /// after the matrix is translated by the given offset. The matrix is a 4x4 + /// matrix stored in column major order. + void addPath(Path path, Offset offset, {Float64List matrix4}) { assert(path != null); // path is checked on the engine side assert(_offsetIsValid(offset)); - _addPath(path, offset.dx, offset.dy); + if (matrix4 != null) { + assert(_matrix4IsValid(matrix4)); + _addPathWithMatrix(path, offset.dx, offset.dy, matrix4); + } else { + _addPath(path, offset.dx, offset.dy); + } } void _addPath(Path path, double dx, double dy) native 'Path_addPath'; - + void _addPathWithMatrix(Path path, double dx, double dy, Float64List matrix) native 'Path_addPathWithMatrix'; + /// Adds the given path to this path by extending the current segment of this /// path with the the first segment of the given path. - void extendWithPath(Path path, Offset offset) { + /// + /// If `matrix4` is specified, the path will be transformed by this matrix + /// after the matrix is translated by the given `offset`. The matrix is a 4x4 + /// matrix stored in column major order. + void extendWithPath(Path path, Offset offset, {Float64List matrix4}) { assert(path != null); // path is checked on the engine side assert(_offsetIsValid(offset)); - _extendWithPath(path, offset.dx, offset.dy); + if (matrix4 != null) { + assert(_matrix4IsValid(matrix4)); + _extendWithPathAndMatrix(path, offset.dx, offset.dy, matrix4); + } else { + _extendWithPath(path, offset.dx, offset.dy); + } } void _extendWithPath(Path path, double dx, double dy) native 'Path_extendWithPath'; + void _extendWithPathAndMatrix(Path path, double dx, double dy, Float64List matrix) native 'Path_extendWithPathAndMatrix'; /// Closes the last subpath, as if a straight line had been drawn /// from the current point to the first point of the subpath. @@ -1701,12 +1792,207 @@ class Path extends NativeFieldWrapperClass2 { /// Returns a copy of the path with all the segments of every /// subpath transformed by the given matrix. Path transform(Float64List matrix4) { - assert(matrix4 != null); - if (matrix4.length != 16) - throw new ArgumentError('"matrix4" must have 16 entries.'); + assert(_matrix4IsValid(matrix4)); return _transform(matrix4); } Path _transform(Float64List matrix4) native 'Path_transform'; + + /// Computes the bounding rectangle for this path. + Rect getBounds() { + final Float32List rect = _getBounds(); + return new Rect.fromLTRB(rect[0], rect[1], rect[2], rect[3]); + } + Float32List _getBounds() native 'Path_getBounds'; + + /// Combines the two paths according to the manner specified by the given + /// `operation`. + /// + /// The resulting path will be constructed from non-overlapping contours. The + /// curve order is reduced where possible so that cubics may be turned into + /// quadratics, and quadratics maybe turned into lines. + static Path combine(PathOperation operation, Path path1, Path path2) { + assert(path1 != null); + assert(path2 != null); + final Path path = new Path(); + if (path._op(path1, path2, operation.index)) { + return path; + } + throw new StateError('Path.combine() failed. This may be due an invalid path; in particular, check for NaN values.'); + } + bool _op(Path path1, Path path2, int operation) native 'Path_op'; + + /// Creates a [PathMetrics] object for this path. + /// + /// If `forceClosed` is set to true, the contours of the path will be measured + /// as if they had been closed, even if they were not explicitly closed. + PathMetrics computeMetrics({bool forceClosed: false}) { + return new PathMetrics._(this, forceClosed); + } +} + +/// The geometric description of a tangent: the angle at a point. +/// +/// See also: +/// * [PathMetric.getTangentForOffset], which returns the tangent of an offset along a path. +class Tangent { + /// Creates a [Tangent] with the given values. + /// + /// The arguments must not be null. + const Tangent(this.position, this.vector) + : assert(position != null), + assert(vector != null); + + /// Creates a [Tangent] based on the angle rather than the vector. + /// + /// The [vector] is computed to be the unit vector at the given angle, interpreted + /// as clockwise radians from the x axis. + factory Tangent.fromAngle(Offset position, double angle) { + return new Tangent(position, new Offset(math.cos(angle), math.sin(angle))); + } + + /// Position of the tangent. + /// + /// When used with [PathMetric.getTangentForOffset], this represents the precise + /// position that the given offset along the path corresponds to. + final Offset position; + + /// The vector of the curve at [position]. + /// + /// When used with [PathMetric.getTangentForOffset], this is the vector of the + /// curve that is at the given offset along the path (i.e. the direction of the + /// curve at [position]). + final Offset vector; + + /// The direction of the curve at [position]. + /// + /// When used with [PathMetric.getTangentForOffset], this is the angle of the + /// curve that is the given offset along the path (i.e. the direction of the + /// curve at [position]). + /// + /// This value is in radians, with 0.0 meaning pointing along the x axis in + /// the positive x-axis direction, positive numbers pointing downward toward + /// the negative y-axis, i.e. in a clockwise direction, and negative numbers + /// pointing upward toward the positive y-axis, i.e. in a counter-clockwise + /// direction. + // flip the sign to be consistent with [Path.arcTo]'s `sweepAngle` + double get angle => -math.atan2(vector.dy, vector.dx); +} + +/// An iterable collection of [PathMetric] objects describing a [Path]. +/// +/// A [PathMetrics] object is created by using the [Path.computeMetrics] method, +/// and represents the path as it stood at the time of the call. Subsequent +/// modifications of the path do not affect the [PathMetrics] object. +/// +/// Each path metric corresponds to a segment, or contour, of a path. +/// +/// For example, a path consisting of a [Path.lineTo], a [Path.moveTo], and +/// another [Path.lineTo] will contain two contours and thus be represented by +/// two [PathMetric] objects. +/// +/// When iterating across a [PathMetrics]' contours, the [PathMetric] objects are only +/// valid until the next one is obtained. +class PathMetrics extends collection.IterableBase { + PathMetrics._(Path path, bool forceClosed) : + _iterator = new PathMetricIterator._(new PathMetric._(path, forceClosed)); + + final Iterator _iterator; + + @override + Iterator get iterator => _iterator; +} + +/// Tracks iteration from one segment of a path to the next for measurement. +class PathMetricIterator implements Iterator { + PathMetricIterator._(this._pathMetric); + + PathMetric _pathMetric; + bool _firstTime = true; + + @override + PathMetric get current => _firstTime ? null : _pathMetric; + + @override + bool moveNext() { + // PathMetric isn't a normal iterable - it's already initialized to its + // first Path. Should only call _moveNext when done with the first one. + if (_firstTime == true) { + _firstTime = false; + return true; + } else if (_pathMetric?._moveNext() == true) { + return true; + } + _pathMetric = null; + return false; + } +} + +/// Utilities for measuring a [Path] and extracting subpaths. +/// +/// Iterate over the object returned by [Path.computeMetrics] to obtain +/// [PathMetric] objects. +/// +/// Once created, metrics will only be valid while the iterator is at the given +/// contour. When the next contour's [PathMetric] is obtained, this object +/// becomes invalid. +class PathMetric extends NativeFieldWrapperClass2 { + /// Create a new empty [Path] object. + PathMetric._(Path path, bool forceClosed) { _constructor(path, forceClosed); } + void _constructor(Path path, bool forceClosed) native 'PathMeasure_constructor'; + + /// Return the total length of the current contour. + double get length native 'PathMeasure_getLength'; + + /// Computes the position of hte current contour at the given offset, and the + /// angle of the path at that point. + /// + /// For example, calling this method with a distance of 1.41 for a line from + /// 0.0,0.0 to 2.0,2.0 would give a point 1.0,1.0 and the angle 45 degrees + /// (but in radians). + /// + /// Returns null if the contour has zero [length]. + /// + /// The distance is clamped to the [length] of the current contour. + Tangent getTangentForOffset(double distance) { + final Float32List posTan = _getPosTan(distance); + // first entry == 0 indicates that Skia returned false + if (posTan[0] == 0.0) { + return null; + } else { + return new Tangent( + new Offset(posTan[1], posTan[2]), + new Offset(posTan[3], posTan[4]) + ); + } + } + Float32List _getPosTan(double distance) native 'PathMeasure_getPosTan'; + + /// Given a start and stop distance, return the intervening segment(s). + /// + /// `start` and `end` are pinned to legal values (0..[length]) + /// Returns null if the segment is 0 length or `start` > `stop`. + /// Begin the segment with a moveTo if `startWithMoveTo` is true. + Path extractPath(double start, double end, {bool startWithMoveTo: true}) native 'PathMeasure_getSegment'; + + /// Whether the contour is closed. + /// + /// Returns true if the contour ends with a call to [Path.close] (which may + /// have been implied when using [Path.addRect]) or if `forceClosed` was + /// specified as true in the call to [Path.computeMetrics]. Returns false + /// otherwise. + bool get isClosed native 'PathMeasure_isClosed'; + + // Move to the next contour in the path. + // + // A path can have a next contour if [Path.moveTo] was called after drawing began. + // Return true if one exists, or false. + // + // This is not exactly congruent with a regular [Iterator.moveNext]. + // Typically, [Iterator.moveNext] should be called before accessing the + // [Iterator.current]. In this case, the [PathMetric] is valid before + // calling `_moveNext` - `_moveNext` should be called after the first + // iteration is done instead of before. + bool _moveNext() native 'PathMeasure_nextContour'; } /// Styles to use for blurs in [MaskFilter] objects. diff --git a/lib/ui/painting/path.cc b/lib/ui/painting/path.cc index ee85ca2c69431..ffd9f4b7c5b02 100644 --- a/lib/ui/painting/path.cc +++ b/lib/ui/painting/path.cc @@ -38,6 +38,7 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Path); V(Path, contains) \ V(Path, cubicTo) \ V(Path, extendWithPath) \ + V(Path, extendWithPathAndMatrix) \ V(Path, getFillType) \ V(Path, lineTo) \ V(Path, moveTo) \ @@ -51,7 +52,11 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Path); V(Path, reset) \ V(Path, setFillType) \ V(Path, shift) \ - V(Path, transform) + V(Path, transform) \ + V(Path, getBounds) \ + V(Path, addPathWithMatrix) \ + V(Path, op) \ + V(Path, clone) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -207,6 +212,17 @@ void CanvasPath::addPath(CanvasPath* path, double dx, double dy) { path_.addPath(path->path(), dx, dy, SkPath::kAppend_AddPathMode); } +void CanvasPath::addPathWithMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { + if (!path) + Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); + + SkMatrix matrix = ToSkMatrix(matrix4); + matrix.setTranslateX(matrix.getTranslateX() + dx); + matrix.setTranslateY(matrix.getTranslateY() + dy); + path_.addPath(path->path(), matrix, SkPath::kAppend_AddPathMode); + matrix4.Release(); +} + void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) { if (!path) Dart_ThrowException( @@ -214,6 +230,17 @@ void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) { path_.addPath(path->path(), dx, dy, SkPath::kExtend_AddPathMode); } +void CanvasPath::extendWithPathAndMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { + if (!path) + Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); + + SkMatrix matrix = ToSkMatrix(matrix4); + matrix.setTranslateX(matrix.getTranslateX() + dx); + matrix.setTranslateY(matrix.getTranslateY() + dy); + path_.addPath(path->path(), matrix, SkPath::kExtend_AddPathMode); + matrix4.Release(); +} + void CanvasPath::close() { path_.close(); } @@ -239,4 +266,27 @@ fxl::RefPtr CanvasPath::transform(tonic::Float64List& matrix4) { return path; } +tonic::Float32List CanvasPath::getBounds() { + tonic::Float32List rect(Dart_NewTypedData(Dart_TypedData_kFloat32, 4)); + const SkRect& bounds = path_.getBounds(); + rect[0] = bounds.left(); + rect[1] = bounds.top(); + rect[2] = bounds.right(); + rect[3] = bounds.bottom(); + return rect; +} + + +bool CanvasPath::op(CanvasPath* path1, CanvasPath* path2, int operation) { + return Op(path1->path(), path2->path(), (SkPathOp)operation, &path_); +} + +fxl::RefPtr CanvasPath::clone() { + fxl::RefPtr path = CanvasPath::Create(); + // per Skia docs, this will create a fast copy + // data is shared until the source path or dest path are mutated + path->path_ = path_; + return path; +} + } // namespace blink diff --git a/lib/ui/painting/path.h b/lib/ui/painting/path.h index 900ca0e3f57ef..afe670b72ff20 100644 --- a/lib/ui/painting/path.h +++ b/lib/ui/painting/path.h @@ -10,6 +10,7 @@ #include "lib/tonic/typed_data/float32_list.h" #include "lib/tonic/typed_data/float64_list.h" #include "third_party/skia/include/core/SkPath.h" +#include "third_party/skia/include/pathops/SkPathOps.h" namespace tonic { class DartLibraryNatives; @@ -28,6 +29,12 @@ class CanvasPath : public fxl::RefCountedThreadSafe, return fxl::MakeRefCounted(); } + static fxl::RefPtr CreateFrom(const SkPath& src) { + fxl::RefPtr path = CanvasPath::Create(); + path->path_ = src; + return path; + } + int getFillType(); void setFillType(int fill_type); @@ -78,12 +85,23 @@ class CanvasPath : public fxl::RefCountedThreadSafe, void addPolygon(const tonic::Float32List& points, bool close); void addRRect(const RRect& rrect); void addPath(CanvasPath* path, double dx, double dy); + void addPathWithMatrix(CanvasPath* path, + double dx, + double dy, + tonic::Float64List& matrix4); void extendWithPath(CanvasPath* path, double dx, double dy); + void extendWithPathAndMatrix(CanvasPath* path, + double dx, + double dy, + tonic::Float64List& matrix4); void close(); void reset(); bool contains(double x, double y); fxl::RefPtr shift(double dx, double dy); fxl::RefPtr transform(tonic::Float64List& matrix4); + tonic::Float32List getBounds(); + bool op(CanvasPath* path1, CanvasPath* path2, int operation); + fxl::RefPtr clone(); const SkPath& path() const { return path_; } diff --git a/lib/ui/painting/path_measure.cc b/lib/ui/painting/path_measure.cc new file mode 100644 index 0000000000000..0260cd3c1c66b --- /dev/null +++ b/lib/ui/painting/path_measure.cc @@ -0,0 +1,110 @@ +// Copyright 2015 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. + +#include "flutter/lib/ui/painting/path_measure.h" + +#include + +#include "flutter/lib/ui/painting/matrix.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_args.h" +#include "lib/tonic/dart_binding_macros.h" +#include "lib/tonic/dart_library_natives.h" + +using tonic::ToDart; + +namespace blink { + +typedef CanvasPathMeasure PathMeasure; + +static void PathMeasure_constructor(Dart_NativeArguments args) { + DartCallConstructor(&CanvasPathMeasure::Create, args); +} + +IMPLEMENT_WRAPPERTYPEINFO(ui, PathMeasure); + +#define FOR_EACH_BINDING(V) \ + V(PathMeasure, setPath) \ + V(PathMeasure, getLength) \ + V(PathMeasure, getPosTan) \ + V(PathMeasure, getSegment) \ + V(PathMeasure, isClosed) \ + V(PathMeasure, nextContour) + +FOR_EACH_BINDING(DART_NATIVE_CALLBACK) + +void CanvasPathMeasure::RegisterNatives(tonic::DartLibraryNatives* natives) { + natives->Register( + {{"PathMeasure_constructor", PathMeasure_constructor, 3, true}, + FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); +} + +fxl::RefPtr CanvasPathMeasure::Create(const CanvasPath* path, + bool forceClosed) { + fxl::RefPtr pathMeasure = + fxl::MakeRefCounted(); + if (path) { + const SkPath skPath = path->path(); + pathMeasure->path_measure_ = + std::make_unique(skPath, forceClosed, 1); + } else { + pathMeasure->path_measure_ = std::make_unique(); + } + return pathMeasure; +} + +CanvasPathMeasure::CanvasPathMeasure() {} + +CanvasPathMeasure::~CanvasPathMeasure() {} + +void CanvasPathMeasure::setPath(const CanvasPath* path, bool isClosed) { + const SkPath* skPath = &(path->path()); + path_measure_->setPath(skPath, isClosed); +} + +float CanvasPathMeasure::getLength() { + return path_measure_->getLength(); +} + +tonic::Float32List CanvasPathMeasure::getPosTan(float distance) { + SkPoint pos; + SkVector tan; + bool success = path_measure_->getPosTan(distance, &pos, &tan); + + tonic::Float32List posTan(Dart_NewTypedData(Dart_TypedData_kFloat32, 5)); + if (success) { + posTan[0] = 1; // dart code will check for this for success + posTan[1] = pos.x(); + posTan[2] = pos.y(); + posTan[3] = tan.x(); + posTan[4] = tan.y(); + } else { + posTan[0] = 0; // dart code will check for this for failure + } + + return posTan; +} + +fxl::RefPtr CanvasPathMeasure::getSegment(float startD, + float stopD, + bool startWithMoveTo) { + SkPath dst; + bool success = + path_measure_->getSegment(startD, stopD, &dst, startWithMoveTo); + if (!success) { + return CanvasPath::Create(); + } else { + return CanvasPath::CreateFrom(dst); + } +} + +bool CanvasPathMeasure::isClosed() { + return path_measure_->isClosed(); +} + +bool CanvasPathMeasure::nextContour() { + return path_measure_->nextContour(); +} + +} // namespace blink diff --git a/lib/ui/painting/path_measure.h b/lib/ui/painting/path_measure.h new file mode 100644 index 0000000000000..7862081a88ec1 --- /dev/null +++ b/lib/ui/painting/path_measure.h @@ -0,0 +1,51 @@ +// Copyright 2015 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. + +#ifndef FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ +#define FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ + +#include "flutter/lib/ui/painting/path.h" +#include "lib/tonic/dart_wrappable.h" +#include "lib/tonic/typed_data/float64_list.h" +#include "third_party/skia/include/core/SkPath.h" +#include "third_party/skia/include/core/SkPathMeasure.h" + +namespace tonic { +class DartLibraryNatives; +} // namespace tonic + +// Be sure that the client doesn't modify a path on us before Skia finishes +// See AOSP's reasoning in PathMeasure.cpp + +namespace blink { + +class CanvasPathMeasure : public fxl::RefCountedThreadSafe, + public tonic::DartWrappable { + DEFINE_WRAPPERTYPEINFO(); + FRIEND_MAKE_REF_COUNTED(CanvasPathMeasure); + + public: + ~CanvasPathMeasure() override; + static fxl::RefPtr Create(const CanvasPath* path, bool forceClosed); + + void setPath(const CanvasPath* path, bool isClosed); + float getLength(); + tonic::Float32List getPosTan(float distance); + fxl::RefPtr getSegment(float startD, float stopD, bool startWithMoveTo); + bool isClosed(); + bool nextContour(); + + static void RegisterNatives(tonic::DartLibraryNatives* natives); + + const SkPathMeasure& pathMeasure() const { return *path_measure_; } + + private: + CanvasPathMeasure(); + + std::unique_ptr path_measure_; +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index 5d6bc3ef21306..149cbde2101d4 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -13,6 +13,7 @@ library dart.ui; import 'dart:_internal' hide Symbol; import 'dart:async'; +import 'dart:collection' as collection; import 'dart:convert'; import 'dart:developer' as developer; import 'dart:math' as math; diff --git a/testing/dart/path_test.dart b/testing/dart/path_test.dart new file mode 100644 index 0000000000000..2ce334c416e21 --- /dev/null +++ b/testing/dart/path_test.dart @@ -0,0 +1,225 @@ +// 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:typed_data' show Float64List; +import 'dart:ui'; + +import 'package:test/test.dart'; + +Matcher moreOrLessEquals(double value, {double epsilon: 1e-10}) { + return new _MoreOrLessEquals(value, epsilon); +} + +class _MoreOrLessEquals extends Matcher { + const _MoreOrLessEquals(this.value, this.epsilon); + + final double value; + final double epsilon; + + @override + bool matches(Object object, Map matchState) { + if (object is! double) return false; + if (object == value) return true; + final double test = object; + return (test - value).abs() <= epsilon; + } + + @override + Description describe(Description description) => + description.add('$value (±$epsilon)'); +} + +void main() { + test('path getBounds', () { + final Rect r = new Rect.fromLTRB(1.0, 3.0, 5.0, 7.0); + final Path p = new Path()..addRect(r); + expect(p.getBounds(), equals(r)); + p.lineTo(20.0, 15.0); + expect(p.getBounds(), equals(new Rect.fromLTRB(1.0, 3.0, 20.0, 15.0))); + }); + + test('path combine rect', () { + final Rect c1 = + new Rect.fromCircle(center: const Offset(10.0, 10.0), radius: 10.0); + final Rect c2 = + new Rect.fromCircle(center: const Offset(5.0, 5.0), radius: 10.0); + final Rect c1UnionC2 = c1.expandToInclude(c2); + final Rect c1IntersectC2 = c1.intersect(c2); + final Path pathCircle1 = new Path()..addRect(c1); + final Path pathCircle2 = new Path()..addRect(c2); + + final Path difference = + Path.combine(PathOperation.difference, pathCircle1, pathCircle2); + expect(difference.getBounds(), equals(c1)); + + final Path reverseDifference = + Path.combine(PathOperation.reverseDifference, pathCircle1, pathCircle2); + expect(reverseDifference.getBounds(), equals(c2)); + + final Path union = + Path.combine(PathOperation.union, pathCircle1, pathCircle2); + expect(union.getBounds(), equals(c1UnionC2)); + + final Path intersect = + Path.combine(PathOperation.intersect, pathCircle1, pathCircle2); + expect(intersect.getBounds(), equals(c1IntersectC2)); + + // the bounds on this will be the same as union - but would draw a missing inside piece. + final Path xor = Path.combine(PathOperation.xor, pathCircle1, pathCircle2); + expect(xor.getBounds(), equals(c1UnionC2)); + }); + + test('path combine oval', () { + final Rect c1 = + new Rect.fromCircle(center: const Offset(10.0, 10.0), radius: 10.0); + final Rect c2 = + new Rect.fromCircle(center: const Offset(5.0, 5.0), radius: 10.0); + final Rect c1UnionC2 = c1.expandToInclude(c2); + final Rect c1IntersectC2 = c1.intersect(c2); + final Path pathCircle1 = new Path()..addOval(c1); + final Path pathCircle2 = new Path()..addOval(c2); + + final Path difference = + Path.combine(PathOperation.difference, pathCircle1, pathCircle2); + + expect(difference.getBounds().top, moreOrLessEquals(0.88, epsilon: 0.01)); + + final Path reverseDifference = + Path.combine(PathOperation.reverseDifference, pathCircle1, pathCircle2); + expect(reverseDifference.getBounds().right, + moreOrLessEquals(14.11, epsilon: 0.01)); + + final Path union = + Path.combine(PathOperation.union, pathCircle1, pathCircle2); + expect(union.getBounds(), equals(c1UnionC2)); + + final Path intersect = + Path.combine(PathOperation.intersect, pathCircle1, pathCircle2); + expect(intersect.getBounds(), equals(c1IntersectC2)); + + // the bounds on this will be the same as union - but would draw a missing inside piece. + final Path xor = Path.combine(PathOperation.xor, pathCircle1, pathCircle2); + expect(xor.getBounds(), equals(c1UnionC2)); + }); + + test('path clone', () { + final Path p1 = new Path()..lineTo(20.0, 20.0); + final Path p2 = new Path.from(p1); + + expect(p1.getBounds(), equals(p2.getBounds())); + + p1.lineTo(10.0, 30.0); + expect(p1.getBounds().bottom, equals(p2.getBounds().bottom + 10)); + }); + + test('transformation tests', () { + final Rect bounds = new Rect.fromLTRB(0.0, 0.0, 10.0, 10.0); + final Path p = new Path()..addRect(bounds); + final Float64List scaleMatrix = new Float64List.fromList([ + 2.5, 0.0, 0.0, 0.0, // first col + 0.0, 0.5, 0.0, 0.0, // second col + 0.0, 0.0, 1.0, 0.0, // third col + 0.0, 0.0, 0.0, 1.0, // fourth col + ]); + + expect(p.getBounds(), equals(bounds)); + final Path pTransformed = p.transform(scaleMatrix); + + expect(pTransformed.getBounds(), + equals(new Rect.fromLTRB(0.0, 0.0, 10 * 2.5, 10 * 0.5))); + + final Path p2 = new Path()..lineTo(10.0, 10.0); + + p.addPath(p2, const Offset(10.0, 10.0)); + expect(p.getBounds(), equals(new Rect.fromLTRB(0.0, 0.0, 20.0, 20.0))); + + p.addPath(p2, const Offset(20.0, 20.0), matrix4: scaleMatrix); + expect(p.getBounds(), + equals(new Rect.fromLTRB(0.0, 0.0, 20 + (10 * 2.5), 20 + (10 * .5)))); + + p.extendWithPath(p2, const Offset(0.0, 0.0)); + expect(p.getBounds(), equals(new Rect.fromLTRB(0.0, 0.0, 45.0, 25.0))); + + p.extendWithPath(p2, const Offset(45.0, 25.0), matrix4: scaleMatrix); + expect(p.getBounds(), equals(new Rect.fromLTRB(0.0, 0.0, 70.0, 30.0))); + }); + + test('path metrics tests', () { + final Path simpleHorizontalLine = new Path()..lineTo(10.0, 0.0); + + // basic tests on horizontal line + final PathMetrics simpleHorizontalMetrics = + simpleHorizontalLine.computeMetrics(); + expect(simpleHorizontalMetrics.iterator.current, isNull); + expect(simpleHorizontalMetrics.iterator.moveNext(), isTrue); + expect(simpleHorizontalMetrics.iterator.current, isNotNull); + expect(simpleHorizontalMetrics.iterator.current.length, equals(10.0)); + expect(simpleHorizontalMetrics.iterator.current.isClosed, isFalse); + final Path simpleExtract = + simpleHorizontalMetrics.iterator.current.extractPath(1.0, 9.0); + expect(simpleExtract.getBounds(), + equals(new Rect.fromLTRB(1.0, 0.0, 9.0, 0.0))); + final Tangent posTan = + simpleHorizontalMetrics.iterator.current.getTangentForOffset(1.0); + expect(posTan, isNotNull); + expect(posTan.position, equals(const Offset(1.0, 0.0))); + expect(posTan.angle, equals(0.0)); + + expect(simpleHorizontalMetrics.iterator.moveNext(), isFalse); + expect(simpleHorizontalMetrics.iterator.current, isNull); + + // test with forceClosed + final PathMetrics simpleMetricsClosed = + simpleHorizontalLine.computeMetrics(forceClosed: true); + expect(simpleMetricsClosed.iterator.current, isNull); + expect(simpleMetricsClosed.iterator.moveNext(), isTrue); + expect(simpleMetricsClosed.iterator.current, isNotNull); + expect(simpleMetricsClosed.iterator.current.length, + equals(20.0)); // because we forced close + expect(simpleMetricsClosed.iterator.current.isClosed, isTrue); + final Path simpleExtract2 = + simpleMetricsClosed.iterator.current.extractPath(1.0, 9.0); + expect(simpleExtract2.getBounds(), + equals(new Rect.fromLTRB(1.0, 0.0, 9.0, 0.0))); + expect(simpleMetricsClosed.iterator.moveNext(), isFalse); + + // test getTangentForOffset with vertical line + final Path simpleVerticalLine = new Path()..lineTo(0.0, 10.0); + final PathMetrics simpleMetricsVertical = + simpleVerticalLine.computeMetrics()..iterator.moveNext(); + final Tangent posTanVertical = + simpleMetricsVertical.iterator.current.getTangentForOffset(5.0); + expect(posTanVertical.position, equals(const Offset(0.0, 5.0))); + expect(posTanVertical.angle, + moreOrLessEquals(-1.5708, epsilon: .0001)); // 90 degrees + + // test getTangentForOffset with diagonal line + final Path simpleDiagonalLine = new Path()..lineTo(10.0, 10.0); + final PathMetrics simpleMetricsDiagonal = + simpleDiagonalLine.computeMetrics()..iterator.moveNext(); + final double midPoint = simpleMetricsDiagonal.iterator.current.length / 2; + final Tangent posTanDiagonal = + simpleMetricsDiagonal.iterator.current.getTangentForOffset(midPoint); + expect(posTanDiagonal.position, equals(new Offset(5.0, 5.0))); + expect(posTanDiagonal.angle, + moreOrLessEquals(-0.7853981633974483, epsilon: .00001)); // ~45 degrees + + // test a multi-contour path + final Path multiContour = new Path() + ..lineTo(0.0, 10.0) + ..moveTo(10.0, 10.0) + ..lineTo(10.0, 15.0); + + final PathMetrics multiContourMetric = multiContour.computeMetrics(); + expect(multiContourMetric.iterator.current, isNull); + expect(multiContourMetric.iterator.moveNext(), isTrue); + expect(multiContourMetric.iterator.current, isNotNull); + expect(multiContourMetric.iterator.current.length, equals(10.0)); + expect(multiContourMetric.iterator.moveNext(), isTrue); + expect(multiContourMetric.iterator.current, isNotNull); + expect(multiContourMetric.iterator.current.length, equals(5.0)); + expect(multiContourMetric.iterator.moveNext(), isFalse); + expect(multiContourMetric.iterator.current, isNull); + }); +} diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 8749f6880dbf4..1d9b6410e904f 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -9845,6 +9845,8 @@ FILE: ../../../flutter/lib/ui/painting/paint.cc FILE: ../../../flutter/lib/ui/painting/paint.h FILE: ../../../flutter/lib/ui/painting/path.cc FILE: ../../../flutter/lib/ui/painting/path.h +FILE: ../../../flutter/lib/ui/painting/path_measure.cc +FILE: ../../../flutter/lib/ui/painting/path_measure.h FILE: ../../../flutter/lib/ui/painting/picture.cc FILE: ../../../flutter/lib/ui/painting/picture.h FILE: ../../../flutter/lib/ui/painting/picture_recorder.cc From 7be9d6f3c21799d83e9524f2763f9d0528ab2601 Mon Sep 17 00:00:00 2001 From: Alexander Markov Date: Mon, 9 Apr 2018 13:00:36 -0700 Subject: [PATCH 0066/1190] Roll Dart to ef926f98f525b085e1488be8c42b1c3f0a24c50d (#4951) --- DEPS | 2 +- tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index f175164679bc9..aa3dc7026f0e5 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '09e1766e6caa537e1271fbce04ebcbf8212b6569', + 'dart_revision': 'ef926f98f525b085e1488be8c42b1c3f0a24c50d', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 2277d0961f21d..26c6f128265d0 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-edge.0d5cf900b021bf5c9fa593ffa12b15bcd1cc5fe0" + dart: ">=1.21.0 <=2.0.0-edge.af1436931b93e755d38223c487d33a0a1f5eadf5" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 02eb6e6dd824f..a7c8651437843 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 93afdbdd65d1aea7e59730d0a9fe9f4b +Signature: 5e7a29bc2be55a7311df8f5a7dff2d34 UNUSED LICENSES: From 894e1e4ac5c7c249e3675620a91575ff1a6ed88b Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 9 Apr 2018 13:06:59 -0700 Subject: [PATCH 0067/1190] Return non-zero exit code when frontend reports errors. (#4952) --- frontend_server/bin/starter.dart | 7 +++++-- frontend_server/lib/server.dart | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend_server/bin/starter.dart b/frontend_server/bin/starter.dart index f8abbe57051a3..62a006af94106 100644 --- a/frontend_server/bin/starter.dart +++ b/frontend_server/bin/starter.dart @@ -1,7 +1,10 @@ library frontend_server; +import 'dart:async'; +import 'dart:io'; + import 'package:frontend_server/server.dart'; -void main(List args) { - starter(args); +Future main(List args) async { + exit(await starter(args)); } diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index 7c287e2b2637c..13f6308ea36e3 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -104,8 +104,9 @@ Future starter( compiler ??= new _FlutterFrontendCompiler(output, trackWidgetCreation: options['track-widget-creation']); if (options.rest.isNotEmpty) { - await compiler.compile(options.rest[0], options); - return 0; + return await compiler.compile(options.rest[0], options) + ? 0 + : 254; } frontend.listenAndCompile(compiler, input ?? stdin, options, () { exit(0); } ); From 44927304000e35a0a9e195a536c189c7e913e0bf Mon Sep 17 00:00:00 2001 From: Alexander Markov Date: Mon, 9 Apr 2018 13:46:54 -0700 Subject: [PATCH 0068/1190] Revert "Roll Dart to ef926f98f525b085e1488be8c42b1c3f0a24c50d" (#4953) Engine build is currently broken, so reverting Dart SDK roll for now. * Revert "Roll Dart to ef926f98f525b085e1488be8c42b1c3f0a24c50d (#4951)" This reverts commit 7be9d6f3c21799d83e9524f2763f9d0528ab2601. --- DEPS | 2 +- tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index aa3dc7026f0e5..f175164679bc9 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'ef926f98f525b085e1488be8c42b1c3f0a24c50d', + 'dart_revision': '09e1766e6caa537e1271fbce04ebcbf8212b6569', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 26c6f128265d0..2277d0961f21d 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-edge.af1436931b93e755d38223c487d33a0a1f5eadf5" + dart: ">=1.21.0 <=2.0.0-edge.0d5cf900b021bf5c9fa593ffa12b15bcd1cc5fe0" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a7c8651437843..02eb6e6dd824f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5e7a29bc2be55a7311df8f5a7dff2d34 +Signature: 93afdbdd65d1aea7e59730d0a9fe9f4b UNUSED LICENSES: From 3cc6c672e1eac2935697bc91a52d3d9f0bcc0114 Mon Sep 17 00:00:00 2001 From: Alexander Markov Date: Mon, 9 Apr 2018 14:31:30 -0700 Subject: [PATCH 0069/1190] Revert "Add support for measuring, combining, and getting bounds of Path objects " (#4954) * Revert "Add support for measuring, combining, and getting bounds of Path objects (#4799)" This reverts commit 8c00101a59cd16c30d51663b58c6f2ee9ee2e2b9, as it broke engine build bots on Linux and Windows. --- lib/ui/BUILD.gn | 2 - lib/ui/dart_ui.cc | 2 - lib/ui/painting.dart | 306 +----------------------- lib/ui/painting/path.cc | 52 +--- lib/ui/painting/path.h | 18 -- lib/ui/painting/path_measure.cc | 110 --------- lib/ui/painting/path_measure.h | 51 ---- lib/ui/ui.dart | 1 - testing/dart/path_test.dart | 225 ----------------- travis/licenses_golden/licenses_flutter | 2 - 10 files changed, 11 insertions(+), 758 deletions(-) delete mode 100644 lib/ui/painting/path_measure.cc delete mode 100644 lib/ui/painting/path_measure.h delete mode 100644 testing/dart/path_test.dart diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 57824f8e1ec3c..8b3be72d5973b 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -36,8 +36,6 @@ source_set("ui") { "painting/paint.h", "painting/path.cc", "painting/path.h", - "painting/path_measure.cc", - "painting/path_measure.h", "painting/picture.cc", "painting/picture.h", "painting/picture_recorder.cc", diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc index 824152e28e8d0..59d083a191778 100644 --- a/lib/ui/dart_ui.cc +++ b/lib/ui/dart_ui.cc @@ -15,7 +15,6 @@ #include "flutter/lib/ui/painting/image_filter.h" #include "flutter/lib/ui/painting/image_shader.h" #include "flutter/lib/ui/painting/path.h" -#include "flutter/lib/ui/painting/path_measure.h" #include "flutter/lib/ui/painting/picture.h" #include "flutter/lib/ui/painting/picture_recorder.h" #include "flutter/lib/ui/painting/vertices.h" @@ -54,7 +53,6 @@ void DartUI::InitForGlobal() { CanvasGradient::RegisterNatives(g_natives); CanvasImage::RegisterNatives(g_natives); CanvasPath::RegisterNatives(g_natives); - CanvasPathMeasure::RegisterNatives(g_natives); Codec::RegisterNatives(g_natives); DartRuntimeHooks::RegisterNatives(g_natives); FrameInfo::RegisterNatives(g_natives); diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index a26cdf9ac87bd..02c4b4986e194 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -39,12 +39,6 @@ bool _offsetIsValid(Offset offset) { return true; } -bool _matrix4IsValid(Float64List matrix4) { - assert(matrix4 != null, 'Matrix4 argument was null.'); - assert(matrix4.length == 16, 'Matrix4 must have 16 entries.'); - return true; -} - bool _radiusIsValid(Radius radius) { assert(radius != null, 'Radius argument was null.'); assert(!radius.x.isNaN && !radius.y.isNaN, 'Radius argument contained a NaN value.'); @@ -1437,62 +1431,6 @@ enum PathFillType { evenOdd, } -/// Strategies for combining paths. -/// -/// See also: -/// -/// * [Path.combine], which uses this enum to decide how to combine two paths. -// Must be kept in sync with SkPathOp -enum PathOperation { - /// Subtract the second path from the first path. - /// - /// For example, if the two paths are overlapping circles of equal diameter - /// but differing centers, the result would be a crescent portion of the - /// first circle that was not overlapped by the second circle. - /// - /// See also: - /// - /// * [reverseDifference], which is the same but subtracting the first path - /// from the second. - difference, - /// Create a new path that is the intersection of the two paths, leaving the - /// overlapping pieces of the path. - /// - /// For example, if the two paths are overlapping circles of equal diameter - /// but differing centers, the result would be only the overlapping portion - /// of the two circles. - /// - /// See also: - /// * [xor], which is the inverse of this operation - intersect, - /// Create a new path that is the union (inclusive-or) of the two paths. - /// - /// For example, if the two paths are overlapping circles of equal diameter - /// but differing centers, the result would be a figure-eight like shape - /// matching the outter boundaries of both circles. - union, - /// Create a new path that is the exclusive-or of the two paths, leaving - /// everything but the overlapping pieces of the path. - /// - /// For example, if the two paths are overlapping circles of equal diameter - /// but differing centers, the figure-eight like shape less the overlapping parts - /// - /// See also: - /// * [intersect], which is the inverse of this operation - xor, - /// Subtract the first path from the second path. - /// - /// For example, if the two paths are overlapping circles of equal diameter - /// but differing centers, the result would be a crescent portion of the - /// second circle that was not overlapped by the first circle. - /// - /// See also: - /// - /// * [difference], which is the same but subtracting the second path - /// from the frist. - reverseDifference, -} - /// A complex, one-dimensional subset of a plane. /// /// A path consists of a number of subpaths, and a _current point_. @@ -1515,15 +1453,6 @@ class Path extends NativeFieldWrapperClass2 { Path() { _constructor(); } void _constructor() native 'Path_constructor'; - /// Creates a copy of another [Path]. - /// - /// This copy is fast and does not require additional memory unless either - /// the `source` path or the path returned by this constructor are modified. - factory Path.from(Path source) { - return source._clone(); - } - Path _clone() native 'Path_clone'; - /// Determines how the interior of this path is calculated. /// /// Defaults to the non-zero winding rule, [PathFillType.nonZero]. @@ -1721,43 +1650,23 @@ class Path extends NativeFieldWrapperClass2 { } void _addRRect(Float32List rrect) native 'Path_addRRect'; - /// Adds a new subpath that consists of the given `path` offset by the given - /// `offset`. - /// - /// If `matrix4` is specified, the path will be transformed by this matrix - /// after the matrix is translated by the given offset. The matrix is a 4x4 - /// matrix stored in column major order. - void addPath(Path path, Offset offset, {Float64List matrix4}) { + /// Adds a new subpath that consists of the given path offset by the given + /// offset. + void addPath(Path path, Offset offset) { assert(path != null); // path is checked on the engine side assert(_offsetIsValid(offset)); - if (matrix4 != null) { - assert(_matrix4IsValid(matrix4)); - _addPathWithMatrix(path, offset.dx, offset.dy, matrix4); - } else { - _addPath(path, offset.dx, offset.dy); - } + _addPath(path, offset.dx, offset.dy); } void _addPath(Path path, double dx, double dy) native 'Path_addPath'; - void _addPathWithMatrix(Path path, double dx, double dy, Float64List matrix) native 'Path_addPathWithMatrix'; - + /// Adds the given path to this path by extending the current segment of this /// path with the the first segment of the given path. - /// - /// If `matrix4` is specified, the path will be transformed by this matrix - /// after the matrix is translated by the given `offset`. The matrix is a 4x4 - /// matrix stored in column major order. - void extendWithPath(Path path, Offset offset, {Float64List matrix4}) { + void extendWithPath(Path path, Offset offset) { assert(path != null); // path is checked on the engine side assert(_offsetIsValid(offset)); - if (matrix4 != null) { - assert(_matrix4IsValid(matrix4)); - _extendWithPathAndMatrix(path, offset.dx, offset.dy, matrix4); - } else { - _extendWithPath(path, offset.dx, offset.dy); - } + _extendWithPath(path, offset.dx, offset.dy); } void _extendWithPath(Path path, double dx, double dy) native 'Path_extendWithPath'; - void _extendWithPathAndMatrix(Path path, double dx, double dy, Float64List matrix) native 'Path_extendWithPathAndMatrix'; /// Closes the last subpath, as if a straight line had been drawn /// from the current point to the first point of the subpath. @@ -1792,207 +1701,12 @@ class Path extends NativeFieldWrapperClass2 { /// Returns a copy of the path with all the segments of every /// subpath transformed by the given matrix. Path transform(Float64List matrix4) { - assert(_matrix4IsValid(matrix4)); + assert(matrix4 != null); + if (matrix4.length != 16) + throw new ArgumentError('"matrix4" must have 16 entries.'); return _transform(matrix4); } Path _transform(Float64List matrix4) native 'Path_transform'; - - /// Computes the bounding rectangle for this path. - Rect getBounds() { - final Float32List rect = _getBounds(); - return new Rect.fromLTRB(rect[0], rect[1], rect[2], rect[3]); - } - Float32List _getBounds() native 'Path_getBounds'; - - /// Combines the two paths according to the manner specified by the given - /// `operation`. - /// - /// The resulting path will be constructed from non-overlapping contours. The - /// curve order is reduced where possible so that cubics may be turned into - /// quadratics, and quadratics maybe turned into lines. - static Path combine(PathOperation operation, Path path1, Path path2) { - assert(path1 != null); - assert(path2 != null); - final Path path = new Path(); - if (path._op(path1, path2, operation.index)) { - return path; - } - throw new StateError('Path.combine() failed. This may be due an invalid path; in particular, check for NaN values.'); - } - bool _op(Path path1, Path path2, int operation) native 'Path_op'; - - /// Creates a [PathMetrics] object for this path. - /// - /// If `forceClosed` is set to true, the contours of the path will be measured - /// as if they had been closed, even if they were not explicitly closed. - PathMetrics computeMetrics({bool forceClosed: false}) { - return new PathMetrics._(this, forceClosed); - } -} - -/// The geometric description of a tangent: the angle at a point. -/// -/// See also: -/// * [PathMetric.getTangentForOffset], which returns the tangent of an offset along a path. -class Tangent { - /// Creates a [Tangent] with the given values. - /// - /// The arguments must not be null. - const Tangent(this.position, this.vector) - : assert(position != null), - assert(vector != null); - - /// Creates a [Tangent] based on the angle rather than the vector. - /// - /// The [vector] is computed to be the unit vector at the given angle, interpreted - /// as clockwise radians from the x axis. - factory Tangent.fromAngle(Offset position, double angle) { - return new Tangent(position, new Offset(math.cos(angle), math.sin(angle))); - } - - /// Position of the tangent. - /// - /// When used with [PathMetric.getTangentForOffset], this represents the precise - /// position that the given offset along the path corresponds to. - final Offset position; - - /// The vector of the curve at [position]. - /// - /// When used with [PathMetric.getTangentForOffset], this is the vector of the - /// curve that is at the given offset along the path (i.e. the direction of the - /// curve at [position]). - final Offset vector; - - /// The direction of the curve at [position]. - /// - /// When used with [PathMetric.getTangentForOffset], this is the angle of the - /// curve that is the given offset along the path (i.e. the direction of the - /// curve at [position]). - /// - /// This value is in radians, with 0.0 meaning pointing along the x axis in - /// the positive x-axis direction, positive numbers pointing downward toward - /// the negative y-axis, i.e. in a clockwise direction, and negative numbers - /// pointing upward toward the positive y-axis, i.e. in a counter-clockwise - /// direction. - // flip the sign to be consistent with [Path.arcTo]'s `sweepAngle` - double get angle => -math.atan2(vector.dy, vector.dx); -} - -/// An iterable collection of [PathMetric] objects describing a [Path]. -/// -/// A [PathMetrics] object is created by using the [Path.computeMetrics] method, -/// and represents the path as it stood at the time of the call. Subsequent -/// modifications of the path do not affect the [PathMetrics] object. -/// -/// Each path metric corresponds to a segment, or contour, of a path. -/// -/// For example, a path consisting of a [Path.lineTo], a [Path.moveTo], and -/// another [Path.lineTo] will contain two contours and thus be represented by -/// two [PathMetric] objects. -/// -/// When iterating across a [PathMetrics]' contours, the [PathMetric] objects are only -/// valid until the next one is obtained. -class PathMetrics extends collection.IterableBase { - PathMetrics._(Path path, bool forceClosed) : - _iterator = new PathMetricIterator._(new PathMetric._(path, forceClosed)); - - final Iterator _iterator; - - @override - Iterator get iterator => _iterator; -} - -/// Tracks iteration from one segment of a path to the next for measurement. -class PathMetricIterator implements Iterator { - PathMetricIterator._(this._pathMetric); - - PathMetric _pathMetric; - bool _firstTime = true; - - @override - PathMetric get current => _firstTime ? null : _pathMetric; - - @override - bool moveNext() { - // PathMetric isn't a normal iterable - it's already initialized to its - // first Path. Should only call _moveNext when done with the first one. - if (_firstTime == true) { - _firstTime = false; - return true; - } else if (_pathMetric?._moveNext() == true) { - return true; - } - _pathMetric = null; - return false; - } -} - -/// Utilities for measuring a [Path] and extracting subpaths. -/// -/// Iterate over the object returned by [Path.computeMetrics] to obtain -/// [PathMetric] objects. -/// -/// Once created, metrics will only be valid while the iterator is at the given -/// contour. When the next contour's [PathMetric] is obtained, this object -/// becomes invalid. -class PathMetric extends NativeFieldWrapperClass2 { - /// Create a new empty [Path] object. - PathMetric._(Path path, bool forceClosed) { _constructor(path, forceClosed); } - void _constructor(Path path, bool forceClosed) native 'PathMeasure_constructor'; - - /// Return the total length of the current contour. - double get length native 'PathMeasure_getLength'; - - /// Computes the position of hte current contour at the given offset, and the - /// angle of the path at that point. - /// - /// For example, calling this method with a distance of 1.41 for a line from - /// 0.0,0.0 to 2.0,2.0 would give a point 1.0,1.0 and the angle 45 degrees - /// (but in radians). - /// - /// Returns null if the contour has zero [length]. - /// - /// The distance is clamped to the [length] of the current contour. - Tangent getTangentForOffset(double distance) { - final Float32List posTan = _getPosTan(distance); - // first entry == 0 indicates that Skia returned false - if (posTan[0] == 0.0) { - return null; - } else { - return new Tangent( - new Offset(posTan[1], posTan[2]), - new Offset(posTan[3], posTan[4]) - ); - } - } - Float32List _getPosTan(double distance) native 'PathMeasure_getPosTan'; - - /// Given a start and stop distance, return the intervening segment(s). - /// - /// `start` and `end` are pinned to legal values (0..[length]) - /// Returns null if the segment is 0 length or `start` > `stop`. - /// Begin the segment with a moveTo if `startWithMoveTo` is true. - Path extractPath(double start, double end, {bool startWithMoveTo: true}) native 'PathMeasure_getSegment'; - - /// Whether the contour is closed. - /// - /// Returns true if the contour ends with a call to [Path.close] (which may - /// have been implied when using [Path.addRect]) or if `forceClosed` was - /// specified as true in the call to [Path.computeMetrics]. Returns false - /// otherwise. - bool get isClosed native 'PathMeasure_isClosed'; - - // Move to the next contour in the path. - // - // A path can have a next contour if [Path.moveTo] was called after drawing began. - // Return true if one exists, or false. - // - // This is not exactly congruent with a regular [Iterator.moveNext]. - // Typically, [Iterator.moveNext] should be called before accessing the - // [Iterator.current]. In this case, the [PathMetric] is valid before - // calling `_moveNext` - `_moveNext` should be called after the first - // iteration is done instead of before. - bool _moveNext() native 'PathMeasure_nextContour'; } /// Styles to use for blurs in [MaskFilter] objects. diff --git a/lib/ui/painting/path.cc b/lib/ui/painting/path.cc index ffd9f4b7c5b02..ee85ca2c69431 100644 --- a/lib/ui/painting/path.cc +++ b/lib/ui/painting/path.cc @@ -38,7 +38,6 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Path); V(Path, contains) \ V(Path, cubicTo) \ V(Path, extendWithPath) \ - V(Path, extendWithPathAndMatrix) \ V(Path, getFillType) \ V(Path, lineTo) \ V(Path, moveTo) \ @@ -52,11 +51,7 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Path); V(Path, reset) \ V(Path, setFillType) \ V(Path, shift) \ - V(Path, transform) \ - V(Path, getBounds) \ - V(Path, addPathWithMatrix) \ - V(Path, op) \ - V(Path, clone) + V(Path, transform) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -212,17 +207,6 @@ void CanvasPath::addPath(CanvasPath* path, double dx, double dy) { path_.addPath(path->path(), dx, dy, SkPath::kAppend_AddPathMode); } -void CanvasPath::addPathWithMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { - if (!path) - Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); - - SkMatrix matrix = ToSkMatrix(matrix4); - matrix.setTranslateX(matrix.getTranslateX() + dx); - matrix.setTranslateY(matrix.getTranslateY() + dy); - path_.addPath(path->path(), matrix, SkPath::kAppend_AddPathMode); - matrix4.Release(); -} - void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) { if (!path) Dart_ThrowException( @@ -230,17 +214,6 @@ void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) { path_.addPath(path->path(), dx, dy, SkPath::kExtend_AddPathMode); } -void CanvasPath::extendWithPathAndMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { - if (!path) - Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); - - SkMatrix matrix = ToSkMatrix(matrix4); - matrix.setTranslateX(matrix.getTranslateX() + dx); - matrix.setTranslateY(matrix.getTranslateY() + dy); - path_.addPath(path->path(), matrix, SkPath::kExtend_AddPathMode); - matrix4.Release(); -} - void CanvasPath::close() { path_.close(); } @@ -266,27 +239,4 @@ fxl::RefPtr CanvasPath::transform(tonic::Float64List& matrix4) { return path; } -tonic::Float32List CanvasPath::getBounds() { - tonic::Float32List rect(Dart_NewTypedData(Dart_TypedData_kFloat32, 4)); - const SkRect& bounds = path_.getBounds(); - rect[0] = bounds.left(); - rect[1] = bounds.top(); - rect[2] = bounds.right(); - rect[3] = bounds.bottom(); - return rect; -} - - -bool CanvasPath::op(CanvasPath* path1, CanvasPath* path2, int operation) { - return Op(path1->path(), path2->path(), (SkPathOp)operation, &path_); -} - -fxl::RefPtr CanvasPath::clone() { - fxl::RefPtr path = CanvasPath::Create(); - // per Skia docs, this will create a fast copy - // data is shared until the source path or dest path are mutated - path->path_ = path_; - return path; -} - } // namespace blink diff --git a/lib/ui/painting/path.h b/lib/ui/painting/path.h index afe670b72ff20..900ca0e3f57ef 100644 --- a/lib/ui/painting/path.h +++ b/lib/ui/painting/path.h @@ -10,7 +10,6 @@ #include "lib/tonic/typed_data/float32_list.h" #include "lib/tonic/typed_data/float64_list.h" #include "third_party/skia/include/core/SkPath.h" -#include "third_party/skia/include/pathops/SkPathOps.h" namespace tonic { class DartLibraryNatives; @@ -29,12 +28,6 @@ class CanvasPath : public fxl::RefCountedThreadSafe, return fxl::MakeRefCounted(); } - static fxl::RefPtr CreateFrom(const SkPath& src) { - fxl::RefPtr path = CanvasPath::Create(); - path->path_ = src; - return path; - } - int getFillType(); void setFillType(int fill_type); @@ -85,23 +78,12 @@ class CanvasPath : public fxl::RefCountedThreadSafe, void addPolygon(const tonic::Float32List& points, bool close); void addRRect(const RRect& rrect); void addPath(CanvasPath* path, double dx, double dy); - void addPathWithMatrix(CanvasPath* path, - double dx, - double dy, - tonic::Float64List& matrix4); void extendWithPath(CanvasPath* path, double dx, double dy); - void extendWithPathAndMatrix(CanvasPath* path, - double dx, - double dy, - tonic::Float64List& matrix4); void close(); void reset(); bool contains(double x, double y); fxl::RefPtr shift(double dx, double dy); fxl::RefPtr transform(tonic::Float64List& matrix4); - tonic::Float32List getBounds(); - bool op(CanvasPath* path1, CanvasPath* path2, int operation); - fxl::RefPtr clone(); const SkPath& path() const { return path_; } diff --git a/lib/ui/painting/path_measure.cc b/lib/ui/painting/path_measure.cc deleted file mode 100644 index 0260cd3c1c66b..0000000000000 --- a/lib/ui/painting/path_measure.cc +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/lib/ui/painting/path_measure.h" - -#include - -#include "flutter/lib/ui/painting/matrix.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" - -using tonic::ToDart; - -namespace blink { - -typedef CanvasPathMeasure PathMeasure; - -static void PathMeasure_constructor(Dart_NativeArguments args) { - DartCallConstructor(&CanvasPathMeasure::Create, args); -} - -IMPLEMENT_WRAPPERTYPEINFO(ui, PathMeasure); - -#define FOR_EACH_BINDING(V) \ - V(PathMeasure, setPath) \ - V(PathMeasure, getLength) \ - V(PathMeasure, getPosTan) \ - V(PathMeasure, getSegment) \ - V(PathMeasure, isClosed) \ - V(PathMeasure, nextContour) - -FOR_EACH_BINDING(DART_NATIVE_CALLBACK) - -void CanvasPathMeasure::RegisterNatives(tonic::DartLibraryNatives* natives) { - natives->Register( - {{"PathMeasure_constructor", PathMeasure_constructor, 3, true}, - FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); -} - -fxl::RefPtr CanvasPathMeasure::Create(const CanvasPath* path, - bool forceClosed) { - fxl::RefPtr pathMeasure = - fxl::MakeRefCounted(); - if (path) { - const SkPath skPath = path->path(); - pathMeasure->path_measure_ = - std::make_unique(skPath, forceClosed, 1); - } else { - pathMeasure->path_measure_ = std::make_unique(); - } - return pathMeasure; -} - -CanvasPathMeasure::CanvasPathMeasure() {} - -CanvasPathMeasure::~CanvasPathMeasure() {} - -void CanvasPathMeasure::setPath(const CanvasPath* path, bool isClosed) { - const SkPath* skPath = &(path->path()); - path_measure_->setPath(skPath, isClosed); -} - -float CanvasPathMeasure::getLength() { - return path_measure_->getLength(); -} - -tonic::Float32List CanvasPathMeasure::getPosTan(float distance) { - SkPoint pos; - SkVector tan; - bool success = path_measure_->getPosTan(distance, &pos, &tan); - - tonic::Float32List posTan(Dart_NewTypedData(Dart_TypedData_kFloat32, 5)); - if (success) { - posTan[0] = 1; // dart code will check for this for success - posTan[1] = pos.x(); - posTan[2] = pos.y(); - posTan[3] = tan.x(); - posTan[4] = tan.y(); - } else { - posTan[0] = 0; // dart code will check for this for failure - } - - return posTan; -} - -fxl::RefPtr CanvasPathMeasure::getSegment(float startD, - float stopD, - bool startWithMoveTo) { - SkPath dst; - bool success = - path_measure_->getSegment(startD, stopD, &dst, startWithMoveTo); - if (!success) { - return CanvasPath::Create(); - } else { - return CanvasPath::CreateFrom(dst); - } -} - -bool CanvasPathMeasure::isClosed() { - return path_measure_->isClosed(); -} - -bool CanvasPathMeasure::nextContour() { - return path_measure_->nextContour(); -} - -} // namespace blink diff --git a/lib/ui/painting/path_measure.h b/lib/ui/painting/path_measure.h deleted file mode 100644 index 7862081a88ec1..0000000000000 --- a/lib/ui/painting/path_measure.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015 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. - -#ifndef FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ -#define FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ - -#include "flutter/lib/ui/painting/path.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float64_list.h" -#include "third_party/skia/include/core/SkPath.h" -#include "third_party/skia/include/core/SkPathMeasure.h" - -namespace tonic { -class DartLibraryNatives; -} // namespace tonic - -// Be sure that the client doesn't modify a path on us before Skia finishes -// See AOSP's reasoning in PathMeasure.cpp - -namespace blink { - -class CanvasPathMeasure : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { - DEFINE_WRAPPERTYPEINFO(); - FRIEND_MAKE_REF_COUNTED(CanvasPathMeasure); - - public: - ~CanvasPathMeasure() override; - static fxl::RefPtr Create(const CanvasPath* path, bool forceClosed); - - void setPath(const CanvasPath* path, bool isClosed); - float getLength(); - tonic::Float32List getPosTan(float distance); - fxl::RefPtr getSegment(float startD, float stopD, bool startWithMoveTo); - bool isClosed(); - bool nextContour(); - - static void RegisterNatives(tonic::DartLibraryNatives* natives); - - const SkPathMeasure& pathMeasure() const { return *path_measure_; } - - private: - CanvasPathMeasure(); - - std::unique_ptr path_measure_; -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index 149cbde2101d4..5d6bc3ef21306 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -13,7 +13,6 @@ library dart.ui; import 'dart:_internal' hide Symbol; import 'dart:async'; -import 'dart:collection' as collection; import 'dart:convert'; import 'dart:developer' as developer; import 'dart:math' as math; diff --git a/testing/dart/path_test.dart b/testing/dart/path_test.dart deleted file mode 100644 index 2ce334c416e21..0000000000000 --- a/testing/dart/path_test.dart +++ /dev/null @@ -1,225 +0,0 @@ -// 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:typed_data' show Float64List; -import 'dart:ui'; - -import 'package:test/test.dart'; - -Matcher moreOrLessEquals(double value, {double epsilon: 1e-10}) { - return new _MoreOrLessEquals(value, epsilon); -} - -class _MoreOrLessEquals extends Matcher { - const _MoreOrLessEquals(this.value, this.epsilon); - - final double value; - final double epsilon; - - @override - bool matches(Object object, Map matchState) { - if (object is! double) return false; - if (object == value) return true; - final double test = object; - return (test - value).abs() <= epsilon; - } - - @override - Description describe(Description description) => - description.add('$value (±$epsilon)'); -} - -void main() { - test('path getBounds', () { - final Rect r = new Rect.fromLTRB(1.0, 3.0, 5.0, 7.0); - final Path p = new Path()..addRect(r); - expect(p.getBounds(), equals(r)); - p.lineTo(20.0, 15.0); - expect(p.getBounds(), equals(new Rect.fromLTRB(1.0, 3.0, 20.0, 15.0))); - }); - - test('path combine rect', () { - final Rect c1 = - new Rect.fromCircle(center: const Offset(10.0, 10.0), radius: 10.0); - final Rect c2 = - new Rect.fromCircle(center: const Offset(5.0, 5.0), radius: 10.0); - final Rect c1UnionC2 = c1.expandToInclude(c2); - final Rect c1IntersectC2 = c1.intersect(c2); - final Path pathCircle1 = new Path()..addRect(c1); - final Path pathCircle2 = new Path()..addRect(c2); - - final Path difference = - Path.combine(PathOperation.difference, pathCircle1, pathCircle2); - expect(difference.getBounds(), equals(c1)); - - final Path reverseDifference = - Path.combine(PathOperation.reverseDifference, pathCircle1, pathCircle2); - expect(reverseDifference.getBounds(), equals(c2)); - - final Path union = - Path.combine(PathOperation.union, pathCircle1, pathCircle2); - expect(union.getBounds(), equals(c1UnionC2)); - - final Path intersect = - Path.combine(PathOperation.intersect, pathCircle1, pathCircle2); - expect(intersect.getBounds(), equals(c1IntersectC2)); - - // the bounds on this will be the same as union - but would draw a missing inside piece. - final Path xor = Path.combine(PathOperation.xor, pathCircle1, pathCircle2); - expect(xor.getBounds(), equals(c1UnionC2)); - }); - - test('path combine oval', () { - final Rect c1 = - new Rect.fromCircle(center: const Offset(10.0, 10.0), radius: 10.0); - final Rect c2 = - new Rect.fromCircle(center: const Offset(5.0, 5.0), radius: 10.0); - final Rect c1UnionC2 = c1.expandToInclude(c2); - final Rect c1IntersectC2 = c1.intersect(c2); - final Path pathCircle1 = new Path()..addOval(c1); - final Path pathCircle2 = new Path()..addOval(c2); - - final Path difference = - Path.combine(PathOperation.difference, pathCircle1, pathCircle2); - - expect(difference.getBounds().top, moreOrLessEquals(0.88, epsilon: 0.01)); - - final Path reverseDifference = - Path.combine(PathOperation.reverseDifference, pathCircle1, pathCircle2); - expect(reverseDifference.getBounds().right, - moreOrLessEquals(14.11, epsilon: 0.01)); - - final Path union = - Path.combine(PathOperation.union, pathCircle1, pathCircle2); - expect(union.getBounds(), equals(c1UnionC2)); - - final Path intersect = - Path.combine(PathOperation.intersect, pathCircle1, pathCircle2); - expect(intersect.getBounds(), equals(c1IntersectC2)); - - // the bounds on this will be the same as union - but would draw a missing inside piece. - final Path xor = Path.combine(PathOperation.xor, pathCircle1, pathCircle2); - expect(xor.getBounds(), equals(c1UnionC2)); - }); - - test('path clone', () { - final Path p1 = new Path()..lineTo(20.0, 20.0); - final Path p2 = new Path.from(p1); - - expect(p1.getBounds(), equals(p2.getBounds())); - - p1.lineTo(10.0, 30.0); - expect(p1.getBounds().bottom, equals(p2.getBounds().bottom + 10)); - }); - - test('transformation tests', () { - final Rect bounds = new Rect.fromLTRB(0.0, 0.0, 10.0, 10.0); - final Path p = new Path()..addRect(bounds); - final Float64List scaleMatrix = new Float64List.fromList([ - 2.5, 0.0, 0.0, 0.0, // first col - 0.0, 0.5, 0.0, 0.0, // second col - 0.0, 0.0, 1.0, 0.0, // third col - 0.0, 0.0, 0.0, 1.0, // fourth col - ]); - - expect(p.getBounds(), equals(bounds)); - final Path pTransformed = p.transform(scaleMatrix); - - expect(pTransformed.getBounds(), - equals(new Rect.fromLTRB(0.0, 0.0, 10 * 2.5, 10 * 0.5))); - - final Path p2 = new Path()..lineTo(10.0, 10.0); - - p.addPath(p2, const Offset(10.0, 10.0)); - expect(p.getBounds(), equals(new Rect.fromLTRB(0.0, 0.0, 20.0, 20.0))); - - p.addPath(p2, const Offset(20.0, 20.0), matrix4: scaleMatrix); - expect(p.getBounds(), - equals(new Rect.fromLTRB(0.0, 0.0, 20 + (10 * 2.5), 20 + (10 * .5)))); - - p.extendWithPath(p2, const Offset(0.0, 0.0)); - expect(p.getBounds(), equals(new Rect.fromLTRB(0.0, 0.0, 45.0, 25.0))); - - p.extendWithPath(p2, const Offset(45.0, 25.0), matrix4: scaleMatrix); - expect(p.getBounds(), equals(new Rect.fromLTRB(0.0, 0.0, 70.0, 30.0))); - }); - - test('path metrics tests', () { - final Path simpleHorizontalLine = new Path()..lineTo(10.0, 0.0); - - // basic tests on horizontal line - final PathMetrics simpleHorizontalMetrics = - simpleHorizontalLine.computeMetrics(); - expect(simpleHorizontalMetrics.iterator.current, isNull); - expect(simpleHorizontalMetrics.iterator.moveNext(), isTrue); - expect(simpleHorizontalMetrics.iterator.current, isNotNull); - expect(simpleHorizontalMetrics.iterator.current.length, equals(10.0)); - expect(simpleHorizontalMetrics.iterator.current.isClosed, isFalse); - final Path simpleExtract = - simpleHorizontalMetrics.iterator.current.extractPath(1.0, 9.0); - expect(simpleExtract.getBounds(), - equals(new Rect.fromLTRB(1.0, 0.0, 9.0, 0.0))); - final Tangent posTan = - simpleHorizontalMetrics.iterator.current.getTangentForOffset(1.0); - expect(posTan, isNotNull); - expect(posTan.position, equals(const Offset(1.0, 0.0))); - expect(posTan.angle, equals(0.0)); - - expect(simpleHorizontalMetrics.iterator.moveNext(), isFalse); - expect(simpleHorizontalMetrics.iterator.current, isNull); - - // test with forceClosed - final PathMetrics simpleMetricsClosed = - simpleHorizontalLine.computeMetrics(forceClosed: true); - expect(simpleMetricsClosed.iterator.current, isNull); - expect(simpleMetricsClosed.iterator.moveNext(), isTrue); - expect(simpleMetricsClosed.iterator.current, isNotNull); - expect(simpleMetricsClosed.iterator.current.length, - equals(20.0)); // because we forced close - expect(simpleMetricsClosed.iterator.current.isClosed, isTrue); - final Path simpleExtract2 = - simpleMetricsClosed.iterator.current.extractPath(1.0, 9.0); - expect(simpleExtract2.getBounds(), - equals(new Rect.fromLTRB(1.0, 0.0, 9.0, 0.0))); - expect(simpleMetricsClosed.iterator.moveNext(), isFalse); - - // test getTangentForOffset with vertical line - final Path simpleVerticalLine = new Path()..lineTo(0.0, 10.0); - final PathMetrics simpleMetricsVertical = - simpleVerticalLine.computeMetrics()..iterator.moveNext(); - final Tangent posTanVertical = - simpleMetricsVertical.iterator.current.getTangentForOffset(5.0); - expect(posTanVertical.position, equals(const Offset(0.0, 5.0))); - expect(posTanVertical.angle, - moreOrLessEquals(-1.5708, epsilon: .0001)); // 90 degrees - - // test getTangentForOffset with diagonal line - final Path simpleDiagonalLine = new Path()..lineTo(10.0, 10.0); - final PathMetrics simpleMetricsDiagonal = - simpleDiagonalLine.computeMetrics()..iterator.moveNext(); - final double midPoint = simpleMetricsDiagonal.iterator.current.length / 2; - final Tangent posTanDiagonal = - simpleMetricsDiagonal.iterator.current.getTangentForOffset(midPoint); - expect(posTanDiagonal.position, equals(new Offset(5.0, 5.0))); - expect(posTanDiagonal.angle, - moreOrLessEquals(-0.7853981633974483, epsilon: .00001)); // ~45 degrees - - // test a multi-contour path - final Path multiContour = new Path() - ..lineTo(0.0, 10.0) - ..moveTo(10.0, 10.0) - ..lineTo(10.0, 15.0); - - final PathMetrics multiContourMetric = multiContour.computeMetrics(); - expect(multiContourMetric.iterator.current, isNull); - expect(multiContourMetric.iterator.moveNext(), isTrue); - expect(multiContourMetric.iterator.current, isNotNull); - expect(multiContourMetric.iterator.current.length, equals(10.0)); - expect(multiContourMetric.iterator.moveNext(), isTrue); - expect(multiContourMetric.iterator.current, isNotNull); - expect(multiContourMetric.iterator.current.length, equals(5.0)); - expect(multiContourMetric.iterator.moveNext(), isFalse); - expect(multiContourMetric.iterator.current, isNull); - }); -} diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 1d9b6410e904f..8749f6880dbf4 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -9845,8 +9845,6 @@ FILE: ../../../flutter/lib/ui/painting/paint.cc FILE: ../../../flutter/lib/ui/painting/paint.h FILE: ../../../flutter/lib/ui/painting/path.cc FILE: ../../../flutter/lib/ui/painting/path.h -FILE: ../../../flutter/lib/ui/painting/path_measure.cc -FILE: ../../../flutter/lib/ui/painting/path_measure.h FILE: ../../../flutter/lib/ui/painting/picture.cc FILE: ../../../flutter/lib/ui/painting/picture.h FILE: ../../../flutter/lib/ui/painting/picture_recorder.cc From eea6197a24256fe588e18127f56c733bc42b6a8d Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 9 Apr 2018 14:34:46 -0700 Subject: [PATCH 0070/1190] Perform exit from server, not starter as awaiting from starter causes hanging in incremental compilation scenario. (#4955) --- frontend_server/bin/starter.dart | 7 ++----- frontend_server/lib/server.dart | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/frontend_server/bin/starter.dart b/frontend_server/bin/starter.dart index 62a006af94106..ab7e03a4b297f 100644 --- a/frontend_server/bin/starter.dart +++ b/frontend_server/bin/starter.dart @@ -1,10 +1,7 @@ library frontend_server; -import 'dart:async'; -import 'dart:io'; - import 'package:frontend_server/server.dart'; -Future main(List args) async { - exit(await starter(args)); +void main(List args){ + starter(args); } diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index 13f6308ea36e3..4965e82be7c3a 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -104,9 +104,9 @@ Future starter( compiler ??= new _FlutterFrontendCompiler(output, trackWidgetCreation: options['track-widget-creation']); if (options.rest.isNotEmpty) { - return await compiler.compile(options.rest[0], options) + exit(await compiler.compile(options.rest[0], options) ? 0 - : 254; + : 254); } frontend.listenAndCompile(compiler, input ?? stdin, options, () { exit(0); } ); From 6474647f5210a968d186901cc511153ec442e897 Mon Sep 17 00:00:00 2001 From: Alexander Markov Date: Mon, 9 Apr 2018 14:48:32 -0700 Subject: [PATCH 0071/1190] Roll Dart to ef926f98f525b085e1488be8c42b1c3f0a24c50d (#4956) --- DEPS | 2 +- tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index f175164679bc9..aa3dc7026f0e5 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '09e1766e6caa537e1271fbce04ebcbf8212b6569', + 'dart_revision': 'ef926f98f525b085e1488be8c42b1c3f0a24c50d', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 2277d0961f21d..26c6f128265d0 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-edge.0d5cf900b021bf5c9fa593ffa12b15bcd1cc5fe0" + dart: ">=1.21.0 <=2.0.0-edge.af1436931b93e755d38223c487d33a0a1f5eadf5" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 02eb6e6dd824f..a7c8651437843 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 93afdbdd65d1aea7e59730d0a9fe9f4b +Signature: 5e7a29bc2be55a7311df8f5a7dff2d34 UNUSED LICENSES: From 11882ab9eb5ffe99eee4918ec2c839a3c0ca0dc3 Mon Sep 17 00:00:00 2001 From: Ravi Mistry Date: Tue, 10 Apr 2018 11:04:13 -0400 Subject: [PATCH 0072/1190] Roll src/third_party/skia/ 9874bf1bc..52e16d984 (135 commits) (#4958) https://skia.googlesource.com/skia.git/+log/9874bf1bcecd..52e16d984898 $ git log 9874bf1bc..52e16d984 --date=short --no-merges --format='%ad %ae %s' 2018-04-10 egdaniel Update getBackendInfo calls on GrBackendTexture to support VkImageLayout better. 2018-04-10 caryclark one more path is rect bug 2018-04-09 caryclark fix path to rect when missing close verb 2018-04-09 benjaminwagner Omit skbug6653 on internal device. 2018-04-09 brianosman Remove SkDEBUGFAIL for non-invertible XYZ matrix 2018-04-09 angle-skia-autoroll Roll third_party/externals/angle2/ 6c59e4a15..0ce016c1b (2 commits) 2018-04-06 reed identify interesting cubic points 2018-04-09 mtklein use commonPaint for all raster pipeline 2018-04-06 benjaminwagner Upgrade Debian9 bots to 9.4. 2018-04-09 bsalomon Reland "Remove deprectated GrContext::MakeGL overloads that take raw ptr" 2018-04-09 skcms-skia-autoroll Roll third_party/externals/skcms/ 8a727815d..16a9cebff (1 commit) 2018-04-06 csmartdalton ccpr: Remove WindMethod from GrCCCoverageProcessor 2018-04-09 angle-skia-autoroll Roll third_party/externals/angle2/ 6c7ab7fe8..6c59e4a15 (3 commits) 2018-04-06 bsalomon Add canvas2D fast paths to new read/write pixels code paths. 2018-04-09 egdaniel Make sure GrBackendTextures are valid before starting to do things with them 2018-04-06 brianosman Remove code that was only used by the old debugger 2018-04-08 csmartdalton Implement Sk2f::Store2 2018-04-09 angle-skia-autoroll Roll third_party/externals/angle2/ 5ae64c94d..6c7ab7fe8 (1 commit) 2018-04-08 herb Revert "Remove all notion of transport from the API." 2018-04-07 angle-skia-autoroll Roll third_party/externals/angle2/ e547aac75..5ae64c94d (1 commit) 2018-04-05 halcanary SkPDF: smarter Jpeg when libjpeg-turbo is present 2018-04-07 angle-skia-autoroll Roll third_party/externals/angle2/ d2488aba5..e547aac75 (2 commits) 2018-04-06 herb Better layer tracking fidelity 2018-04-06 angle-skia-autoroll Roll third_party/externals/angle2/ b8e396609..d2488aba5 (2 commits) 2018-04-06 skcms-skia-autoroll Roll third_party/externals/skcms/ 24c91d143..8a727815d (1 commit) 2018-04-06 brianosman Remove scanlineOrder switch statements that always do the same thing 2018-04-06 reed detect if makeOffset failed 2018-04-05 csmartdalton vulkan: Fix an optimus-related failure with vkEnumeratePhysicalDevices 2018-04-06 egdaniel Make generated effects from sksl fp files not need SK_SUPPORT_GPU 2018-04-05 herb Remove all notion of transport from the API. 2018-04-04 halcanary SkRegion: Use less memory for SkRegion::Oper 2018-04-06 brianosman Remove old debugger (it no longer builds) 2018-04-06 liyuqian Revert "Exercise the threaded backend in test bots" 2018-04-06 egdaniel Remove unneeded SK_SUPPORT_GPU checks in gpu only files. 2018-04-06 halcanary Region Op Fuzzer 2018-04-05 csmartdalton ccpr: Make curve corners more seamless 2018-04-05 brianosman Remove SK_SUPPORT_LEGACY_BLURMASKFILTER 2018-04-06 bsalomon Add versions of MakeGL() that don't require include GrGLInterface.h in order to use the GrGLMakeNativeInterface 2018-04-06 egdaniel Don't use GrPixelConfig value as proxy for valid on GrBackendSurface. 2018-04-05 liyuqian Exercise the threaded backend in test bots 2018-04-06 angle-skia-autoroll Roll third_party/externals/angle2/ c3755fc56..b8e396609 (1 commit) 2018-04-06 update-docs Update markdown files 2018-04-05 angle-skia-autoroll Roll third_party/externals/angle2/ dd196e0bc..c3755fc56 (5 commits) 2018-04-05 caryclark remove SK_IGNORE_TO_STRING 2018-03-29 bungeman Distinguish between glyphs with empty path and no path. 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ 6959d4597..24c91d143 (1 commit) 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ d75edb2e3..6959d4597 (1 commit) 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ a7974d9f6..d75edb2e3 (1 commit) 2018-04-05 fmalita Clip SlideDir slides to their declared dimensions 2018-04-05 bungeman Mac to better serialize OTTO fonts. 2018-04-05 robertphillips Revert "Remove deprectated GrContext::MakeGL overloads that take raw ptr" 2018-04-05 bsalomon Remove SK_DISABLE_TEXTURE_OP_AA 2018-04-05 fmalita [viewer] Consolidate external slide loading 2018-04-05 liyuqian Flush before snap SkThreadedBMPDevice 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ 3cb9ba6ae..a7974d9f6 (3 commits) 2018-04-04 bryct Update 'Working in a Chromium repo' documentation. 2018-04-05 kjlubick Avoid nonsortable rects in drawRect/drawOval 2018-04-04 bsalomon Remove deprectated GrContext::MakeGL overloads that take raw ptr 2018-04-05 bsalomon Add maxTextureSize()/maxRenderTargetSize() to GrContext 2018-04-05 fmalita Viewer SVG support 2018-04-04 bungeman Via*::draw to finish before checking. 2018-04-05 reed replace size-alignment assert with round-down 2018-04-05 angle-skia-autoroll Roll third_party/externals/angle2/ bc54342bf..dd196e0bc (14 commits) 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ d26d270c8..3cb9ba6ae (7 commits) 2018-04-02 halcanary SkPDF: implement xheight for type3 fonts 2018-04-05 robertphillips Add GrBackendTexture/RenderTarget accessors to SkSurface 2018-04-05 robertphillips Add SK_API to SkSurfaceCharacterization 2018-04-03 halcanary experimental/tools: minor code cleanup 2018-04-04 brianosman Workaround for lack of ESSL3 external image extension on older Samsung devices 2018-04-05 caryclark tweak SkImage documentation 2018-04-05 robertphillips Fix iOS bot in Chrome CQ 2018-04-05 update-docs Update markdown files 2018-04-04 bsalomon Avoid calling glGetString(GL_EXTENSIONS) on core profiles 2018-04-04 bsalomon Stop using clear-as-draw workaround on newer Intel drivers on macOS 2018-04-04 liyuqian Ensure that pointers/arrays are valid until flush in threaded backend 2018-04-04 benjaminwagner Add loongson3a Build jobs. 2018-04-04 robertphillips Add GrBackendTexture accessor to SkImage (take 2) 2018-04-04 reed move SkIPoint16 to private header 2018-04-04 benjaminwagner Update mips64el_toolchain_linux to GCC 7 2018-04-04 fmalita Fix SkLocalMatrixShader nesting semantics 2018-04-04 egdaniel Make sure we set the origin when initDescForDstCopy fails 2018-04-04 fmalita Banish SkShaderBase::isRasterPipelineOnly() 2018-03-22 liyuqian Fix drawBitmapRect in the threaded backend 2018-04-03 mtklein add Mac ASAN bots 2018-04-04 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 7dd7eed65..d26d270c8 (1 commit) 2018-04-04 djsollen Tag the unique keys of lazy images. 2018-04-04 robertphillips Add SkSurfaceCharacterization operator== && != 2018-04-04 bsalomon Revert "Revert "Make SkSL GLSL generator declare sk_FragColor inout when EXT fb fetch is used."" 2018-04-04 angle-skia-autoroll Roll skia/third_party/externals/angle2/ 5d232d53b..bc54342bf (6 commits) 2018-04-04 egdaniel Don't use the inner radius when not stroking in DIEllipse 2018-04-04 bsalomon Revert "Make SkSL GLSL generator declare sk_FragColor inout when EXT fb fetch is used." 2018-04-03 benjaminwagner Add mips64el_toolchain_linux asset. 2018-04-03 bsalomon Make SkSL GLSL generator declare sk_FragColor inout when EXT fb fetch is used. 2018-04-04 egdaniel Handle perspective scales in GrPathUtil scaleToleranceToSrc 2018-04-03 robertphillips Hide GrPixelConfig in SkSurfaceCharacterization 2018-04-04 skcms-skia-autoroll Roll skia/third_party/externals/skcms/ 770177dc9..7dd7eed65 (1 commit) 2018-04-03 khushalsagar Add API for SkTextBlob serialization into caller's memory. 2018-04-03 herb Clean up buffering and serializatoin. 2018-04-03 egdaniel Check if fan point is finite in GrAAConvexPathRenderer. 2018-04-03 caryclark fix global method indentation (...) Created with: roll-dep src/third_party/skia --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 62 ++++++--------------- 2 files changed, 19 insertions(+), 45 deletions(-) diff --git a/DEPS b/DEPS index aa3dc7026f0e5..5a6f7d2b80299 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9874bf1bcecd0113087bd8a51cf838da0efa3bfe', + 'skia_revision': '52e16d984898f18c84de773507da875a7954b922', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a7c8651437843..82b715094dc42 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5e7a29bc2be55a7311df8f5a7dff2d34 +Signature: 35f9050d548a4901197f2e7d61e60f2d UNUSED LICENSES: @@ -13984,7 +13984,6 @@ FILE: ../../../third_party/skia/bench/StreamBench.cpp FILE: ../../../third_party/skia/bench/SwizzleBench.cpp FILE: ../../../third_party/skia/bench/TileImageFilterBench.cpp FILE: ../../../third_party/skia/bench/pack_int_uint16_t_Bench.cpp -FILE: ../../../third_party/skia/debugger/QT/SkRasterWidget.h FILE: ../../../third_party/skia/experimental/svg/model/SkPEG.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.h @@ -14029,7 +14028,6 @@ FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTransformableNode.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTypes.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.h -FILE: ../../../third_party/skia/experimental/tools/generate-unicode-test-txt FILE: ../../../third_party/skia/experimental/xps_to_png/xps_to_png.cs FILE: ../../../third_party/skia/fuzz/Fuzz.h FILE: ../../../third_party/skia/fuzz/FuzzGradients.cpp @@ -17177,26 +17175,9 @@ FILE: ../../../third_party/skia/animations/redcross#1.jpg FILE: ../../../third_party/skia/animations/text#1.xml FILE: ../../../third_party/skia/bench/microbench.json FILE: ../../../third_party/skia/bench/skpbench.json -FILE: ../../../third_party/skia/debugger/QT/Icons/.qrc -FILE: ../../../third_party/skia/debugger/QT/Icons/blank.png -FILE: ../../../third_party/skia/debugger/QT/Icons/breakpoint.png -FILE: ../../../third_party/skia/debugger/QT/Icons/breakpoint_16x16.png -FILE: ../../../third_party/skia/debugger/QT/Icons/delete.png -FILE: ../../../third_party/skia/debugger/QT/Icons/inspector.png -FILE: ../../../third_party/skia/debugger/QT/Icons/next.png -FILE: ../../../third_party/skia/debugger/QT/Icons/pause.png -FILE: ../../../third_party/skia/debugger/QT/Icons/play.png -FILE: ../../../third_party/skia/debugger/QT/Icons/previous.png -FILE: ../../../third_party/skia/debugger/QT/Icons/profile.png -FILE: ../../../third_party/skia/debugger/QT/Icons/reload.png -FILE: ../../../third_party/skia/debugger/QT/Icons/rewind.png -FILE: ../../../third_party/skia/debugger/QT/Icons/skia.png -FILE: ../../../third_party/skia/debugger/QT/SkIcons.qrc -FILE: ../../../third_party/skia/debugger/QT/qrc_SkIcons.cpp FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh -FILE: ../../../third_party/skia/docs/SkIPoint16_Reference.bmh FILE: ../../../third_party/skia/docs/SkIPoint_Reference.bmh FILE: ../../../third_party/skia/docs/SkIRect_Reference.bmh FILE: ../../../third_party/skia/docs/SkImageInfo_Reference.bmh @@ -17242,6 +17223,7 @@ FILE: ../../../third_party/skia/infra/bots/assets/go/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_debug/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_release/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_sdk/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/mips64el_toolchain_linux/VERSION FILE: ../../../third_party/skia/infra/bots/assets/node/VERSION FILE: ../../../third_party/skia/infra/bots/assets/procdump_win/VERSION FILE: ../../../third_party/skia/infra/bots/assets/protoc/VERSION @@ -17301,12 +17283,14 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-arm64-Release-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Chromebook_GLES.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Mini.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-loongson3a-Release.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Debug-EmbededResouces.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json @@ -17345,6 +17329,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SafeStack.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu16-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_ProcDump.json @@ -18082,8 +18067,6 @@ FILE: ../../../third_party/skia/bench/RotatedRectBench.cpp FILE: ../../../third_party/skia/bench/SKPBench.cpp FILE: ../../../third_party/skia/bench/SKPBench.h FILE: ../../../third_party/skia/bench/nanobench.cpp -FILE: ../../../third_party/skia/debugger/QT/SkDrawCommandGeometryWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkDrawCommandGeometryWidget.h FILE: ../../../third_party/skia/dm/DMGpuSupport.h FILE: ../../../third_party/skia/dm/DMJsonWriter.cpp FILE: ../../../third_party/skia/dm/DMJsonWriter.h @@ -18341,22 +18324,6 @@ FILE: ../../../third_party/skia/bench/MorphologyBench.cpp FILE: ../../../third_party/skia/bench/RTreeBench.cpp FILE: ../../../third_party/skia/bench/RefCntBench.cpp FILE: ../../../third_party/skia/bench/TableBench.cpp -FILE: ../../../third_party/skia/debugger/QT/SkCanvasWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkCanvasWidget.h -FILE: ../../../third_party/skia/debugger/QT/SkDebuggerGUI.cpp -FILE: ../../../third_party/skia/debugger/QT/SkDebuggerGUI.h -FILE: ../../../third_party/skia/debugger/QT/SkGLWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkGLWidget.h -FILE: ../../../third_party/skia/debugger/QT/SkInspectorWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkInspectorWidget.h -FILE: ../../../third_party/skia/debugger/QT/SkListWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkListWidget.h -FILE: ../../../third_party/skia/debugger/QT/SkRasterWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkSettingsWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkSettingsWidget.h -FILE: ../../../third_party/skia/debugger/SkDebugger.cpp -FILE: ../../../third_party/skia/debugger/SkDebugger.h -FILE: ../../../third_party/skia/debugger/debuggermain.cpp FILE: ../../../third_party/skia/gm/bigmatrix.cpp FILE: ../../../third_party/skia/gm/blurrect.cpp FILE: ../../../third_party/skia/gm/colorfilterimagefilter.cpp @@ -19298,6 +19265,7 @@ FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.h +FILE: ../../../third_party/skia/experimental/tools/gerrit-change-id-to-number FILE: ../../../third_party/skia/fuzz/FuzzCanvas.cpp FILE: ../../../third_party/skia/gm/alpha_image.cpp FILE: ../../../third_party/skia/gm/atlastext.cpp @@ -19465,7 +19433,6 @@ FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCTriangleShader.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.h FILE: ../../../third_party/skia/src/gpu/effects/GrAtlasedShaderHelpers.h @@ -19702,14 +19669,17 @@ FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.cpp FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.h FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp +FILE: ../../../third_party/skia/fuzz/FuzzRegionOp.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionSetPath.cpp FILE: ../../../third_party/skia/gm/hugepath.cpp +FILE: ../../../third_party/skia/gm/localmatrixshader.cpp FILE: ../../../third_party/skia/gm/makeRasterImage.cpp FILE: ../../../third_party/skia/gm/orientation.cpp FILE: ../../../third_party/skia/gm/pathmeasure.cpp +FILE: ../../../third_party/skia/gm/polygonoffset.cpp FILE: ../../../third_party/skia/gm/scaledemoji.cpp FILE: ../../../third_party/skia/gm/shadermaskfilter.cpp FILE: ../../../third_party/skia/gm/sharedcorners.cpp @@ -19719,6 +19689,7 @@ FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h +FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp @@ -19732,6 +19703,7 @@ FILE: ../../../third_party/skia/src/core/SkCubicMap.cpp FILE: ../../../third_party/skia/src/core/SkCubicMap.h FILE: ../../../third_party/skia/src/core/SkDeferredDisplayList.cpp FILE: ../../../third_party/skia/src/core/SkGlyph.cpp +FILE: ../../../third_party/skia/src/core/SkIPoint16.h FILE: ../../../third_party/skia/src/core/SkMaskFilterBase.h FILE: ../../../third_party/skia/src/core/SkPath_serial.cpp FILE: ../../../third_party/skia/src/core/SkRRectPriv.h @@ -19739,11 +19711,9 @@ FILE: ../../../third_party/skia/src/core/SkRectPriv.h FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.cpp FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.h FILE: ../../../third_party/skia/src/core/SkSafeRange.h +FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h -FILE: ../../../third_party/skia/src/effects/GrAlphaThresholdFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/effects/GrAlphaThresholdFragmentProcessor.fp -FILE: ../../../third_party/skia/src/effects/GrAlphaThresholdFragmentProcessor.h FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp FILE: ../../../third_party/skia/src/effects/SkTrimPE.h FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp @@ -19759,6 +19729,9 @@ FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.h FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.fp FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.h @@ -19800,6 +19773,8 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp FILE: ../../../third_party/skia/src/opts/SkRasterPipeline_opts.h FILE: ../../../third_party/skia/src/pdf/SkClusterator.cpp @@ -19921,8 +19896,8 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzDrawFunctions.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzGradients.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImage.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJPEGEncoder.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullGLCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp @@ -20121,7 +20096,6 @@ FILE: ../../../third_party/skia/src/core/SkXfermode.cpp FILE: ../../../third_party/skia/src/core/SkXfermodePriv.h FILE: ../../../third_party/skia/src/effects/Sk1DPathEffect.cpp FILE: ../../../third_party/skia/src/effects/Sk2DPathEffect.cpp -FILE: ../../../third_party/skia/src/effects/SkBlurMaskFilter.cpp FILE: ../../../third_party/skia/src/effects/SkCornerPathEffect.cpp FILE: ../../../third_party/skia/src/effects/SkDashPathEffect.cpp FILE: ../../../third_party/skia/src/effects/SkDiscretePathEffect.cpp From 132ebdda892381c8c4bd03f55fc2d7f597bb5910 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Tue, 10 Apr 2018 13:39:06 -0400 Subject: [PATCH 0073/1190] Revert "Roll src/third_party/skia/ 9874bf1bc..52e16d984 (135 commits) (#4958)" (#4961) This reverts commit 11882ab9eb5ffe99eee4918ec2c839a3c0ca0dc3. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 62 +++++++++++++++------ 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/DEPS b/DEPS index 5a6f7d2b80299..aa3dc7026f0e5 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '52e16d984898f18c84de773507da875a7954b922', + 'skia_revision': '9874bf1bcecd0113087bd8a51cf838da0efa3bfe', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 82b715094dc42..a7c8651437843 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 35f9050d548a4901197f2e7d61e60f2d +Signature: 5e7a29bc2be55a7311df8f5a7dff2d34 UNUSED LICENSES: @@ -13984,6 +13984,7 @@ FILE: ../../../third_party/skia/bench/StreamBench.cpp FILE: ../../../third_party/skia/bench/SwizzleBench.cpp FILE: ../../../third_party/skia/bench/TileImageFilterBench.cpp FILE: ../../../third_party/skia/bench/pack_int_uint16_t_Bench.cpp +FILE: ../../../third_party/skia/debugger/QT/SkRasterWidget.h FILE: ../../../third_party/skia/experimental/svg/model/SkPEG.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.h @@ -14028,6 +14029,7 @@ FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTransformableNode.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTypes.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.h +FILE: ../../../third_party/skia/experimental/tools/generate-unicode-test-txt FILE: ../../../third_party/skia/experimental/xps_to_png/xps_to_png.cs FILE: ../../../third_party/skia/fuzz/Fuzz.h FILE: ../../../third_party/skia/fuzz/FuzzGradients.cpp @@ -17175,9 +17177,26 @@ FILE: ../../../third_party/skia/animations/redcross#1.jpg FILE: ../../../third_party/skia/animations/text#1.xml FILE: ../../../third_party/skia/bench/microbench.json FILE: ../../../third_party/skia/bench/skpbench.json +FILE: ../../../third_party/skia/debugger/QT/Icons/.qrc +FILE: ../../../third_party/skia/debugger/QT/Icons/blank.png +FILE: ../../../third_party/skia/debugger/QT/Icons/breakpoint.png +FILE: ../../../third_party/skia/debugger/QT/Icons/breakpoint_16x16.png +FILE: ../../../third_party/skia/debugger/QT/Icons/delete.png +FILE: ../../../third_party/skia/debugger/QT/Icons/inspector.png +FILE: ../../../third_party/skia/debugger/QT/Icons/next.png +FILE: ../../../third_party/skia/debugger/QT/Icons/pause.png +FILE: ../../../third_party/skia/debugger/QT/Icons/play.png +FILE: ../../../third_party/skia/debugger/QT/Icons/previous.png +FILE: ../../../third_party/skia/debugger/QT/Icons/profile.png +FILE: ../../../third_party/skia/debugger/QT/Icons/reload.png +FILE: ../../../third_party/skia/debugger/QT/Icons/rewind.png +FILE: ../../../third_party/skia/debugger/QT/Icons/skia.png +FILE: ../../../third_party/skia/debugger/QT/SkIcons.qrc +FILE: ../../../third_party/skia/debugger/QT/qrc_SkIcons.cpp FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh +FILE: ../../../third_party/skia/docs/SkIPoint16_Reference.bmh FILE: ../../../third_party/skia/docs/SkIPoint_Reference.bmh FILE: ../../../third_party/skia/docs/SkIRect_Reference.bmh FILE: ../../../third_party/skia/docs/SkImageInfo_Reference.bmh @@ -17223,7 +17242,6 @@ FILE: ../../../third_party/skia/infra/bots/assets/go/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_debug/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_release/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_sdk/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/mips64el_toolchain_linux/VERSION FILE: ../../../third_party/skia/infra/bots/assets/node/VERSION FILE: ../../../third_party/skia/infra/bots/assets/procdump_win/VERSION FILE: ../../../third_party/skia/infra/bots/assets/protoc/VERSION @@ -17283,14 +17301,12 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-arm64-Release-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Chromebook_GLES.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Mini.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-loongson3a-Release.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Debug-EmbededResouces.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json @@ -17329,7 +17345,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SafeStack.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu16-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_ProcDump.json @@ -18067,6 +18082,8 @@ FILE: ../../../third_party/skia/bench/RotatedRectBench.cpp FILE: ../../../third_party/skia/bench/SKPBench.cpp FILE: ../../../third_party/skia/bench/SKPBench.h FILE: ../../../third_party/skia/bench/nanobench.cpp +FILE: ../../../third_party/skia/debugger/QT/SkDrawCommandGeometryWidget.cpp +FILE: ../../../third_party/skia/debugger/QT/SkDrawCommandGeometryWidget.h FILE: ../../../third_party/skia/dm/DMGpuSupport.h FILE: ../../../third_party/skia/dm/DMJsonWriter.cpp FILE: ../../../third_party/skia/dm/DMJsonWriter.h @@ -18324,6 +18341,22 @@ FILE: ../../../third_party/skia/bench/MorphologyBench.cpp FILE: ../../../third_party/skia/bench/RTreeBench.cpp FILE: ../../../third_party/skia/bench/RefCntBench.cpp FILE: ../../../third_party/skia/bench/TableBench.cpp +FILE: ../../../third_party/skia/debugger/QT/SkCanvasWidget.cpp +FILE: ../../../third_party/skia/debugger/QT/SkCanvasWidget.h +FILE: ../../../third_party/skia/debugger/QT/SkDebuggerGUI.cpp +FILE: ../../../third_party/skia/debugger/QT/SkDebuggerGUI.h +FILE: ../../../third_party/skia/debugger/QT/SkGLWidget.cpp +FILE: ../../../third_party/skia/debugger/QT/SkGLWidget.h +FILE: ../../../third_party/skia/debugger/QT/SkInspectorWidget.cpp +FILE: ../../../third_party/skia/debugger/QT/SkInspectorWidget.h +FILE: ../../../third_party/skia/debugger/QT/SkListWidget.cpp +FILE: ../../../third_party/skia/debugger/QT/SkListWidget.h +FILE: ../../../third_party/skia/debugger/QT/SkRasterWidget.cpp +FILE: ../../../third_party/skia/debugger/QT/SkSettingsWidget.cpp +FILE: ../../../third_party/skia/debugger/QT/SkSettingsWidget.h +FILE: ../../../third_party/skia/debugger/SkDebugger.cpp +FILE: ../../../third_party/skia/debugger/SkDebugger.h +FILE: ../../../third_party/skia/debugger/debuggermain.cpp FILE: ../../../third_party/skia/gm/bigmatrix.cpp FILE: ../../../third_party/skia/gm/blurrect.cpp FILE: ../../../third_party/skia/gm/colorfilterimagefilter.cpp @@ -19265,7 +19298,6 @@ FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.h -FILE: ../../../third_party/skia/experimental/tools/gerrit-change-id-to-number FILE: ../../../third_party/skia/fuzz/FuzzCanvas.cpp FILE: ../../../third_party/skia/gm/alpha_image.cpp FILE: ../../../third_party/skia/gm/atlastext.cpp @@ -19433,6 +19465,7 @@ FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCTriangleShader.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.h FILE: ../../../third_party/skia/src/gpu/effects/GrAtlasedShaderHelpers.h @@ -19669,17 +19702,14 @@ FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.cpp FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.h FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp -FILE: ../../../third_party/skia/fuzz/FuzzRegionOp.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionSetPath.cpp FILE: ../../../third_party/skia/gm/hugepath.cpp -FILE: ../../../third_party/skia/gm/localmatrixshader.cpp FILE: ../../../third_party/skia/gm/makeRasterImage.cpp FILE: ../../../third_party/skia/gm/orientation.cpp FILE: ../../../third_party/skia/gm/pathmeasure.cpp -FILE: ../../../third_party/skia/gm/polygonoffset.cpp FILE: ../../../third_party/skia/gm/scaledemoji.cpp FILE: ../../../third_party/skia/gm/shadermaskfilter.cpp FILE: ../../../third_party/skia/gm/sharedcorners.cpp @@ -19689,7 +19719,6 @@ FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h -FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp @@ -19703,7 +19732,6 @@ FILE: ../../../third_party/skia/src/core/SkCubicMap.cpp FILE: ../../../third_party/skia/src/core/SkCubicMap.h FILE: ../../../third_party/skia/src/core/SkDeferredDisplayList.cpp FILE: ../../../third_party/skia/src/core/SkGlyph.cpp -FILE: ../../../third_party/skia/src/core/SkIPoint16.h FILE: ../../../third_party/skia/src/core/SkMaskFilterBase.h FILE: ../../../third_party/skia/src/core/SkPath_serial.cpp FILE: ../../../third_party/skia/src/core/SkRRectPriv.h @@ -19711,9 +19739,11 @@ FILE: ../../../third_party/skia/src/core/SkRectPriv.h FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.cpp FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.h FILE: ../../../third_party/skia/src/core/SkSafeRange.h -FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h +FILE: ../../../third_party/skia/src/effects/GrAlphaThresholdFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/effects/GrAlphaThresholdFragmentProcessor.fp +FILE: ../../../third_party/skia/src/effects/GrAlphaThresholdFragmentProcessor.h FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp FILE: ../../../third_party/skia/src/effects/SkTrimPE.h FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp @@ -19729,9 +19759,6 @@ FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.h FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.fp FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.h @@ -19773,8 +19800,6 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp FILE: ../../../third_party/skia/src/opts/SkRasterPipeline_opts.h FILE: ../../../third_party/skia/src/pdf/SkClusterator.cpp @@ -19896,8 +19921,8 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzDrawFunctions.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzGradients.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImage.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJPEGEncoder.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullGLCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp @@ -20096,6 +20121,7 @@ FILE: ../../../third_party/skia/src/core/SkXfermode.cpp FILE: ../../../third_party/skia/src/core/SkXfermodePriv.h FILE: ../../../third_party/skia/src/effects/Sk1DPathEffect.cpp FILE: ../../../third_party/skia/src/effects/Sk2DPathEffect.cpp +FILE: ../../../third_party/skia/src/effects/SkBlurMaskFilter.cpp FILE: ../../../third_party/skia/src/effects/SkCornerPathEffect.cpp FILE: ../../../third_party/skia/src/effects/SkDashPathEffect.cpp FILE: ../../../third_party/skia/src/effects/SkDiscretePathEffect.cpp From 0c8993a1a12b30c73113f739ba30ef6b8324deca Mon Sep 17 00:00:00 2001 From: egdaniel Date: Tue, 10 Apr 2018 14:54:59 -0400 Subject: [PATCH 0074/1190] Update to use new vulkan GrBackendRenderTarget ctor (part 2) (#4963) This moves to the new skia ctor for vulkan GrBackendRenderTarget which doesn't take a stencil count since vulkan doesn't bind stencil and render target together like GL does with framebuffer so it is not needed. This is the same idea as pull, https://github.com/flutter/engine/pull/4962, but the github UI was only allowing me to change one file via the online edit :( --- vulkan/vulkan_swapchain.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vulkan/vulkan_swapchain.cc b/vulkan/vulkan_swapchain.cc index f3ca6d0c10a37..887cf0ad0dba2 100644 --- a/vulkan/vulkan_swapchain.cc +++ b/vulkan/vulkan_swapchain.cc @@ -232,7 +232,7 @@ sk_sp VulkanSwapchain::CreateSkiaSurface( }; // TODO(chinmaygarde): Setup the stencil buffer and the sampleCnt. - GrBackendRenderTarget backend_render_target(size.fWidth, size.fHeight, 0, 0, + GrBackendRenderTarget backend_render_target(size.fWidth, size.fHeight, 0, image_info); SkSurfaceProps props(SkSurfaceProps::InitType::kLegacyFontHost_InitType); From 5ff5272952837c5b63d90a288a36289af09408bf Mon Sep 17 00:00:00 2001 From: egdaniel Date: Tue, 10 Apr 2018 14:55:14 -0400 Subject: [PATCH 0075/1190] Update to use new vulkan GrBackendRenderTarget ctor. (#4962) This moves to the new skia ctor for vulkan GrBackendRenderTarget which doesn't take a stencil count since vulkan doesn't bind stencil and render target together like GL does with framebuffer so it is not needed. --- content_handler/vulkan_surface.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 0e5fa00d8422a..47ac87e375e81 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -278,7 +278,7 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp context, .fLevelCount = image_create_info.mipLevels, }; - GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0, 0, + GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0, image_info); SkSurfaceProps sk_surface_props( From c8e4c6984b6607ef8626fc5668b8f804538bac78 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 10 Apr 2018 12:15:58 -0700 Subject: [PATCH 0076/1190] Avoid copying the contents of large platform message responses (#4947) Assets are loaded via platform messages, and currently asset payloads are being copied into Dart typed data buffers. This change uses external typed data objects that wrap the existing buffer if copying would be expensive. See https://github.com/flutter/flutter/issues/16291 --- .../window/platform_message_response_dart.cc | 43 +++++++++++++------ lib/ui/window/window.cc | 34 +++++++-------- lib/ui/window/window.h | 2 + 3 files changed, 49 insertions(+), 30 deletions(-) diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index adddae83653d7..065159b79713b 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -7,12 +7,41 @@ #include #include "flutter/common/threads.h" +#include "flutter/lib/ui/window/window.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_invoke.h" namespace blink { +namespace { + +// Avoid copying the contents of messages beyond a certain size. +const int kMessageCopyThreshold = 1000; + +void MessageDataFinalizer(void* isolate_callback_data, + Dart_WeakPersistentHandle handle, + void* peer) { + std::vector* data = reinterpret_cast*>(peer); + delete data; +} + +Dart_Handle WrapByteData(std::vector data) { + if (data.size() < kMessageCopyThreshold) { + return ToByteData(data); + } else { + std::vector* heap_data = new std::vector(std::move(data)); + Dart_Handle data_handle = Dart_NewExternalTypedData( + Dart_TypedData_kByteData, heap_data->data(), heap_data->size()); + DART_CHECK_VALID(data_handle); + Dart_NewWeakPersistentHandle(data_handle, heap_data, heap_data->size(), + MessageDataFinalizer); + return data_handle; + } +} + +} // anonymous namespace + PlatformMessageResponseDart::PlatformMessageResponseDart( tonic::DartPersistentValue callback) : callback_(std::move(callback)) {} @@ -38,19 +67,7 @@ void PlatformMessageResponseDart::Complete(std::vector data) { return; tonic::DartState::Scope scope(dart_state); - Dart_Handle byte_buffer = - Dart_NewTypedData(Dart_TypedData_kByteData, data.size()); - DART_CHECK_VALID(byte_buffer); - - void* buffer; - intptr_t length; - Dart_TypedData_Type type; - DART_CHECK_VALID( - Dart_TypedDataAcquireData(byte_buffer, &type, &buffer, &length)); - FXL_CHECK(type == Dart_TypedData_kByteData); - FXL_CHECK(static_cast(length) == data.size()); - memcpy(buffer, data.data(), length); - Dart_TypedDataReleaseData(byte_buffer); + Dart_Handle byte_buffer = WrapByteData(std::move(data)); tonic::DartInvoke(callback.Release(), {byte_buffer}); })); } diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 7b4cf2cde1247..e12e03f10d01f 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -22,23 +22,6 @@ using tonic::ToDart; namespace blink { namespace { -Dart_Handle ToByteData(const std::vector& buffer) { - Dart_Handle data_handle = - Dart_NewTypedData(Dart_TypedData_kByteData, buffer.size()); - if (Dart_IsError(data_handle)) - return data_handle; - - Dart_TypedData_Type type; - void* data = nullptr; - intptr_t num_bytes = 0; - FXL_CHECK(!Dart_IsError( - Dart_TypedDataAcquireData(data_handle, &type, &data, &num_bytes))); - - memcpy(data, buffer.data(), num_bytes); - Dart_TypedDataReleaseData(data_handle); - return data_handle; -} - void DefaultRouteName(Dart_NativeArguments args) { std::string routeName = UIDartState::Current()->window()->client()->DefaultRouteName(); @@ -119,6 +102,23 @@ void _RespondToPlatformMessage(Dart_NativeArguments args) { } // namespace +Dart_Handle ToByteData(const std::vector& buffer) { + Dart_Handle data_handle = + Dart_NewTypedData(Dart_TypedData_kByteData, buffer.size()); + if (Dart_IsError(data_handle)) + return data_handle; + + Dart_TypedData_Type type; + void* data = nullptr; + intptr_t num_bytes = 0; + FXL_CHECK(!Dart_IsError( + Dart_TypedDataAcquireData(data_handle, &type, &data, &num_bytes))); + + memcpy(data, buffer.data(), num_bytes); + Dart_TypedDataReleaseData(data_handle); + return data_handle; +} + WindowClient::~WindowClient() {} Window::Window(WindowClient* client) : client_(client) {} diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index fa8ce41835b0a..ef0d7ef863a0e 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -21,6 +21,8 @@ class DartLibraryNatives; namespace blink { class Scene; +Dart_Handle ToByteData(const std::vector& buffer); + class WindowClient { public: virtual std::string DefaultRouteName() = 0; From 31c5bb4272f608c93802c60ad527742d16a93e6d Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Tue, 10 Apr 2018 14:09:08 -0700 Subject: [PATCH 0077/1190] Roll dart to 7764e6962e22afcf4b58c4e3cef3147330f3c884. (#4960) * Roll dart to 7764e6962e22afcf4b58c4e3cef3147330f3c884. Changes since last roll: ``` 7764e6962e Initial API to build analysis contexts (replaces ContextLocator.locateContexts) 5ea271bb01 Clean up documentation of implicit new/const insertions tests. cf93009caf Removed the magic const feature from implicit-creation.md bd39320b3b Recover from error on undefined continue label. 5d89a1ac32 Add tests for mixin application constructor forwarding. e6962790a1 Use import URIs when invalidating files 23c59bd819 Fix compare_failures 290cc58e71 Use actual receiver when error-wrapping a null-aware property get. 34763bc4c9 Reland "[VM] Introduction of type testing stubs - Part 1-4" a86b864fa9 Handle updated .packages in incremental compiler f555ae505a Trust type annotations in strong mode 0a4a3bed68 When cloning YieldStatement, copy the flags 91bbc798fa Skip abstract forwarding stubs 7689dc9e06 Bring in the latest pub_semver f71d204185 Fix expected type in substByContext 5e99872770 Improve missing/invalid type reference recovery 899dbe4dae Forward type arguments in one-shot interceptors. 1fd3011f47 dart2js: Add more whole-program information to dump-info 5e23c2843d Revert "[infra] Temporarily disable Windows SDK builder on CQ" 2471888d4a Serialize any MethodInvocation as possible const. b430570364 dart2js: handle constant casts with type variable substitutions 3575b810b3 Only add const in a constant context (issue 32819) 09f7d2aee5 dart2js: naive support for instantiations in constants - ignore the actual instantiation 4dd5e6e6ad js_runtime: fix _JsonMap keys list type 71ffe976a9 Correctly handle constant fields when computing constness (take 2) d58b0e2d44 [VM] Mark bigint test slow after small Smi change 1e997ee6b7 Revert "Reland "[VM] Introduction of type testing stubs - Part 1-4"" 00097adce0 Remove reference to deprecated setter cb065a116f [infra] Update checked-in SDK version to 2.0.0-dev.46.0 0e9a77a360 [VM] Reduce Smi size to 32 bit on 64 bit platforms 34bfefd508 [gardening] Update status file 969c0de335 Avoid crash on EOF error in file with Windows line encoding 8054409a02 Reland "[VM] Introduction of type testing stubs - Part 1-4" ``` * Ignore freetype2 in skia since 'we use our own version' * Update license hash --- DEPS | 8 ++++---- tools/licenses/lib/main.dart | 1 + travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index aa3dc7026f0e5..30a88e2b6a355 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'ef926f98f525b085e1488be8c42b1c3f0a24c50d', + 'dart_revision': '7764e6962e22afcf4b58c4e3cef3147330f3c884', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -46,7 +46,7 @@ vars = { 'dart_convert_tag': '2.0.1', 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', - 'dart_dart2js_info_tag': '0.5.5+1', + 'dart_dart2js_info_tag': '0.5.6', 'dart_dart_style_tag': '1.0.10', 'dart_dartdoc_tag': 'v0.18.1', 'dart_fixnum_tag': '0.10.5', @@ -60,7 +60,7 @@ vars = { 'dart_intl_tag': '0.15.2', 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.46', + 'dart_linter_tag': '0.1.47', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', @@ -76,7 +76,7 @@ vars = { 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', - 'dart_pub_semver_tag': '1.3.4', + 'dart_pub_semver_tag': '1.3.6', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index e75c6c171958e..2cf747123ed40 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -1809,6 +1809,7 @@ class RepositorySkiaThirdPartyDirectory extends RepositoryGenericThirdPartyDirec bool shouldRecurse(fs.IoNode entry) { return entry.name != 'giflib' // contains nothing that ends up in the binary executable && entry.name != 'freetype' // we use our own version + && entry.name != 'freetype2' // we use our own version && entry.name != 'icu' // we use our own version && entry.name != 'libjpeg-turbo' // we use our own version && entry.name != 'libpng' // we use our own version diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a7c8651437843..7d9f7ce6b8916 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5e7a29bc2be55a7311df8f5a7dff2d34 +Signature: bea26d7863b6f1cfa1d0c0ae3775bf93 UNUSED LICENSES: From 6baff4c821350bbcb64e7d029574b567f3801a1a Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 10 Apr 2018 14:57:02 -0700 Subject: [PATCH 0078/1190] Support multiple shells in a single process. (#4932) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Support multiple shells in a single process. The Flutter Engine currently works by initializing a singleton shell instance. This shell has to be created on the platform thread. The shell is responsible for creating the 3 main threads used by Flutter (UI, IO, GPU) as well as initializing the Dart VM. The shell, references to task runners of the main threads as well as all snapshots used for VM initialization are stored in singleton objects. The Flutter shell only creates the threads, rasterizers, contexts, etc. to fully support a single Flutter application. Current support for multiple Flutter applications is achieved by making multiple applications share the same resources (via the platform views mechanism). This scheme has the following limitations: * The shell is a singleton and there is no way to tear it down. Once you run a Flutter application in a process, all resources managed by it will remain referenced till process termination. * The threads on which the shell performs its operations are all singletons. These threads are never torn down and multiple Flutter applications (if present) have to compete with one another on these threads. * Resources referenced by the Dart VM are leaked because the VM isn't shutdown even when there are no more Flutter views. * The shell as a target does not compile on Fuchsia. The Fuchsia content handler uses specific dependencies of the shell to rebuild all the shell dependencies on its own. This leads to differences in frame scheduling, VM setup, service protocol endpoint setup, tracing, etc.. Fuchsia is very much a second class citizen in this world. * Since threads and message loops are managed by the engine, the engine has to know about threading and platform message loop interop on each supported platform. Specific updates in this patch: * The shell is no longer a singleton and the embedder holds the unique reference to the shell. * Shell setup and teardown is deterministic. * Threads are no longer managed by the shell. Instead, the shell is given a task runner configuration by the embedder. * Since the shell does not own its threads, the embedder can control threads and the message loops operating on these threads. The shell is only given references to the task runners that execute tasks on these threads. * The shell only needs task runner references. These references can be to the same task runner. So, if the embedder thinks that a particular Flutter application would not need all the threads, it can pass references to the same task runner. This effectively makes Flutter application run in single threaded mode. There are some places in the shell that make synchronous calls, these sites have been updated to ensure that they don’t deadlock. * The test runner and the headless Dart code runner are now Flutter applications that are effectively single threaded (since they don’t have rendering concerns of big-boy Flutter application). * The embedder has to guarantee that the threads and outlive the shell. It is easy for the embedder to make that guarantee because shell termination is deterministic. * The embedder can create as many shell as it wants. Typically it creates a shell per Flutter application with its own task runner configuration. Most embedders obtain these task runners from threads dedicated to the shell. But, it is entirely possible that the embedder can obtain these task runners from a thread pool. * There can only be one Dart VM in the process. The numerous shell interact with one another to manage the VM lifecycle. Once the last shell goes away, the VM does as well and hence all resources associated with the VM are collected. * The shell as a target can now compile and run on Fuchsia. The current content handler has been removed from the Flutter engine source tree and a new implementation has been written that uses the new shell target. * Isolate management has been significantly overhauled. There are no owning references to Dart isolates within the shell. The VM owns the only strong reference to the Dart isolate. The isolate that has window bindings is now called the root isolate. Child isolates can now be created from the root isolate and their bindings and thread configurations are now inherited from the root isolate. * Terminating the shell terminates its root isolates as well as all the isolates spawned by this isolate. This is necessary be shell shutdown is deterministic and the embedder is free to collect the threads on which the isolates execute their tasks (and listen for mircrotasks flushes on). * Launching the root isolate is now significantly overhauled. The shell side (non-owning) reference to an isolate is now a little state machine and illegal state transitions should be impossible (barring construction issues). This is the only way to manage Dart isolates in the shell (the shell does not use the C API is dart_api.h anymore). * Once an isolate is launched, it must be prepared (and hence move to the ready phase) by associating a snapshot with the same. This snapshot can either be a precompiled snapshot, kernel snapshot, script snapshot or source file. Depending on the kind of data specified as a snapshot as well as the capabilities of the VM running in the process, isolate preparation can fail preparation with the right message. * Asset management has been significantly overhauled. All asset resolution goes through an abstract asset resolver interface. An asset manager implements this interface and manages one or more child asset resolvers. These asset resolvers typically resolve assets from directories, ZIP files (legacy FLX assets if provided), APK bundles, FDIO namespaces, etc… * Each launch of the shell requires a separate and fully configured asset resolver. This is necessary because launching isolates for the engine may require resolving snapshots as assets from the asset resolver. Asset resolvers can be shared by multiple launch instances in multiple shells and need to be thread safe. * References to the command line object have been removed from the shell. Instead, the shell only takes a settings object that may be configured from the command line. This makes it easy for embedders and platforms that don’t have a command line (Fuchsia) to configure the shell. Consequently, there is only one spot where the various switches are read from the command line (by the embedder and not the shell) to form the settings object. * All platform now respect the log tag (this was done only by Android till now) and each shell instance have its own log tag. This makes logs from multiple Flutter application in the same process (mainly Fuchsia) more easily decipherable. * The per shell IO task runner now has a new component that is unfortunately named the IOManager. This component manages the IO GrContext (used for asynchronous texture uploads) that cooperates with the GrContext on the GPU task runner associated with the shell. The IOManager is also responsible for flushing tasks that collect Skia objects that reference GPU resources during deterministic shell shutdown. * The embedder now has to be careful to only enable Blink on a single instance of the shell. Launching the legacy text layout and rendering engine multiple times is will trip assertions. The entirety of this runtime has been separated out into a separate object and can be removed in one go when the migration to libtxt is complete. * There is a new test target for the various C++ objects that the shell uses to interact with the Dart VM (the shell no longer use the C API in dart_api.h). This allows engine developers to test VM/Isolate initialization and teardown without having the setup a full shell instance. * There is a new test target for the testing a single shell instances without having to configure and launch an entire VM and associated root isolate. * Mac, Linux & Windows used to have different target that created the flutter_tester referenced by the tool. This has now been converted into a single target that compiles on all platforms. * WeakPointers vended by the fml::WeakPtrFactory(notice the difference between the same class in the fxl namespace) add threading checks on each use. This is enabled by getting rid of the “re-origination” feature of the WeakPtrFactory in the fxl namespace. The side effect of this is that all non-thread safe components have to be created, used and destroyed on the same thread. Numerous thread safety issues were caught by this extra assertion and have now been fixed. * Glossary of components that are only safe on a specific thread (and have the fml variants of the WeakPtrFactory): * Platform Thread: Shell * UI Thread: Engine, RuntimeDelegate, DartIsolate, Animator * GPU Thread: Rasterizer, Surface * IO Thread: IOManager This patch was reviewed in smaller chunks in the following pull requests. All comments from the pulls requests has been incorporated into this patch: * flutter/assets: https://github.com/flutter/engine/pull/4829 * flutter/common: https://github.com/flutter/engine/pull/4830 * flutter/content_handler: https://github.com/flutter/engine/pull/4831 * flutter/flow: https://github.com/flutter/engine/pull/4832 * flutter/fml: https://github.com/flutter/engine/pull/4833 * flutter/lib/snapshot: https://github.com/flutter/engine/pull/4834 * flutter/lib/ui: https://github.com/flutter/engine/pull/4835 * flutter/runtime: https://github.com/flutter/engine/pull/4836 * flutter/shell: https://github.com/flutter/engine/pull/4837 * flutter/synchronization: https://github.com/flutter/engine/pull/4838 * flutter/testing: https://github.com/flutter/engine/pull/4839 --- BUILD.gn | 74 +- DEPS | 2 +- assets/BUILD.gn | 12 +- assets/asset_manager.cc | 55 + assets/asset_manager.h | 47 + assets/asset_provider.h | 25 - assets/asset_resolver.h | 32 + assets/directory_asset_bundle.cc | 85 +- assets/directory_asset_bundle.h | 32 +- assets/unzipper_provider.cc | 21 - assets/unzipper_provider.h | 20 - assets/zip_asset_store.cc | 24 +- assets/zip_asset_store.h | 24 +- common/BUILD.gn | 5 +- common/settings.cc | 58 +- common/settings.h | 74 +- common/task_runners.cc | 48 + common/task_runners.h | 46 + common/threads.cc | 56 - common/threads.h | 48 - content_handler/BUILD.gn | 59 +- content_handler/README.md | 4 + content_handler/accessibility_bridge.cc | 15 +- content_handler/accessibility_bridge.h | 25 +- content_handler/app.cc | 174 --- content_handler/app.h | 64 - content_handler/application.cc | 313 +++++ content_handler/application.h | 97 ++ .../application_controller_impl.cc | 148 --- content_handler/application_controller_impl.h | 76 -- content_handler/application_runner.cc | 90 ++ content_handler/application_runner.h | 79 ++ content_handler/compositor_context.cc | 86 ++ content_handler/compositor_context.h | 39 + content_handler/engine.cc | 258 +++++ content_handler/engine.h | 63 + content_handler/fuchsia_font_manager.cc | 47 +- content_handler/fuchsia_font_manager.h | 2 +- content_handler/isolate_configurator.cc | 114 ++ content_handler/isolate_configurator.h | 55 + content_handler/main.cc | 20 +- content_handler/platform_view.cc | 551 +++++++++ content_handler/platform_view.h | 120 ++ content_handler/rasterizer.cc | 19 - content_handler/rasterizer.h | 35 - content_handler/runtime_holder.cc | 911 --------------- content_handler/runtime_holder.h | 152 --- content_handler/service_protocol_hooks.cc | 164 --- content_handler/service_protocol_hooks.h | 37 - content_handler/session_connection.cc | 108 +- content_handler/session_connection.h | 52 +- content_handler/surface.cc | 73 ++ content_handler/surface.h | 47 + content_handler/task_observers.cc | 43 + content_handler/task_observers.h | 16 + content_handler/unique_fdio_ns.h | 34 + content_handler/vulkan_rasterizer.cc | 117 -- content_handler/vulkan_rasterizer.h | 42 - content_handler/vulkan_surface.cc | 24 +- content_handler/vulkan_surface.h | 11 +- content_handler/vulkan_surface_pool.cc | 7 +- content_handler/vulkan_surface_pool.h | 9 +- content_handler/vulkan_surface_producer.cc | 9 +- content_handler/vulkan_surface_producer.h | 18 +- flow/BUILD.gn | 10 +- flow/compositor_context.cc | 26 +- flow/compositor_context.h | 44 +- flow/debug_print.cc | 5 + flow/debug_print.h | 9 +- flow/export_node.cc | 15 +- flow/export_node.h | 5 +- flow/layers/default_layer_builder.cc | 6 +- flow/layers/default_layer_builder.h | 2 +- flow/layers/layer.h | 4 - flow/layers/layer_builder.h | 3 +- flow/layers/layer_tree.cc | 55 +- flow/layers/layer_tree.h | 21 - flow/layers/performance_overlay_layer.cc | 33 - flow/layers/performance_overlay_layer.h | 2 - flow/layers/picture_layer.cc | 23 +- flow/layers/picture_layer.h | 13 +- flow/process_info.h | 31 - flow/raster_cache.cc | 33 +- flow/raster_cache.h | 6 - flow/raster_cache_key.h | 30 +- flow/scene_update_context.cc | 17 +- flow/skia_gpu_object.cc | 44 + flow/skia_gpu_object.h | 88 ++ flow/texture.cc | 6 +- flow/texture.h | 5 +- fml/BUILD.gn | 18 +- fml/file.h | 35 + fml/icu_util.cc | 17 +- fml/macros.h | 20 + fml/mapping.cc | 20 + fml/mapping.h | 37 +- fml/memory/thread_checker.h | 69 ++ fml/memory/weak_ptr.h | 43 +- fml/message_loop.cc | 10 +- fml/message_loop.h | 9 +- fml/message_loop_impl.cc | 43 +- fml/message_loop_impl.h | 8 +- fml/message_loop_unittests.cc | 24 +- fml/native_library.h | 52 + fml/paths.cc | 31 + fml/paths.h | 4 + fml/platform/android/message_loop_android.h | 6 +- .../darwin/resource_mapping_darwin.mm | 4 +- fml/platform/fuchsia/paths_fuchsia.cc | 15 + fml/platform/linux/message_loop_linux.h | 6 +- fml/platform/posix/file_posix.cc | 71 ++ fml/platform/posix/mapping_posix.cc | 18 +- fml/platform/posix/native_library_posix.cc | 60 + fml/platform/win/file_win.cc | 119 ++ fml/platform/win/mapping_win.cc | 59 +- fml/platform/win/native_library_win.cc | 51 + fml/platform/win/wstring_conversion.h | 25 + fml/task_observer.h | 21 - fml/task_runner.cc | 12 + fml/task_runner.h | 7 +- fml/thread.cc | 9 +- fml/thread.h | 6 +- fml/unique_fd.cc | 35 + fml/unique_fd.h | 60 + fml/unique_object.h | 137 +++ lib/snapshot/BUILD.gn | 54 +- lib/ui/BUILD.gn | 11 +- lib/ui/compositing/scene_builder.cc | 9 +- lib/ui/compositing/scene_host.cc | 6 +- lib/ui/dart_runtime_hooks.cc | 62 +- lib/ui/painting/codec.cc | 114 +- lib/ui/painting/codec.h | 7 +- lib/ui/painting/gradient.cc | 12 +- lib/ui/painting/image.cc | 14 +- lib/ui/painting/image.h | 17 +- lib/ui/painting/image_encoding.cc | 23 +- lib/ui/painting/image_shader.cc | 11 +- lib/ui/painting/picture.cc | 25 +- lib/ui/painting/picture.h | 9 +- lib/ui/painting/picture_recorder.cc | 5 +- lib/ui/painting/resource_context.cc | 51 - lib/ui/painting/resource_context.h | 60 - lib/ui/painting/shader.cc | 12 +- lib/ui/painting/shader.h | 13 +- lib/ui/painting/utils.cc | 46 - lib/ui/painting/utils.h | 38 - lib/ui/text/font_collection.cc | 14 +- lib/ui/text/font_collection.h | 7 +- lib/ui/text/paragraph.cc | 5 +- lib/ui/text/paragraph.h | 5 + lib/ui/text/paragraph_builder.cc | 27 +- lib/ui/text/paragraph_builder.h | 11 +- lib/ui/text/paragraph_impl_blink.cc | 4 +- lib/ui/text/paragraph_impl_blink.h | 5 + lib/ui/text/paragraph_impl_txt.cc | 2 +- lib/ui/ui_dart_state.cc | 93 +- lib/ui/ui_dart_state.h | 101 +- .../window/platform_message_response_dart.cc | 14 +- .../window/platform_message_response_dart.h | 6 +- lib/ui/window/viewport_metrics.h | 19 + lib/ui/window/window.cc | 5 +- lib/ui/window/window.h | 5 +- runtime/BUILD.gn | 60 +- runtime/asset_font_selector.cc | 38 +- runtime/asset_font_selector.h | 17 +- runtime/dart_controller.cc | 250 ---- runtime/dart_controller.h | 55 - runtime/dart_init.cc | 725 ------------ runtime/dart_init.h | 64 - runtime/dart_isolate.cc | 715 ++++++++++++ runtime/dart_isolate.h | 152 +++ runtime/dart_isolate_unittests.cc | 103 ++ runtime/dart_service_isolate.h | 2 - runtime/dart_snapshot.cc | 159 +++ runtime/dart_snapshot.h | 57 + runtime/dart_snapshot_buffer.cc | 72 ++ runtime/dart_snapshot_buffer.h | 34 + runtime/dart_vm.cc | 472 ++++++++ runtime/dart_vm.h | 75 ++ runtime/dart_vm_unittests.cc | 21 + runtime/fixtures/simple_main.dart | 7 + runtime/runtime_controller.cc | 274 +++-- runtime/runtime_controller.h | 99 +- runtime/runtime_delegate.cc | 8 +- runtime/runtime_delegate.h | 8 +- runtime/runtime_init.cc | 35 - runtime/runtime_init.h | 21 - runtime/service_protocol.cc | 279 +++++ runtime/service_protocol.h | 99 ++ shell/common/BUILD.gn | 43 +- shell/common/animator.cc | 75 +- shell/common/animator.h | 37 +- shell/common/engine.cc | 583 +++------- shell/common/engine.h | 153 +-- shell/common/io_manager.cc | 73 ++ shell/common/io_manager.h | 52 + shell/common/isolate_configuration.cc | 144 +++ shell/common/isolate_configuration.h | 51 + shell/common/null_platform_view.cc | 37 - shell/common/null_platform_view.h | 39 - shell/common/null_rasterizer.cc | 67 -- shell/common/null_rasterizer.h | 51 - shell/common/platform_view.cc | 182 +-- shell/common/platform_view.h | 119 +- .../common/platform_view_service_protocol.cc | 447 ------- shell/common/platform_view_service_protocol.h | 85 -- shell/common/rasterizer.cc | 197 ++++ shell/common/rasterizer.h | 65 +- shell/common/run_configuration.cc | 80 ++ shell/common/run_configuration.h | 56 + shell/common/shell.cc | 1025 ++++++++++++----- shell/common/shell.h | 254 ++-- shell/common/shell_unittests.cc | 133 +++ shell/common/surface.cc | 28 +- shell/common/surface.h | 14 +- shell/common/switches.cc | 122 ++ shell/common/switches.h | 37 +- shell/common/thread_host.cc | 38 + shell/common/thread_host.h | 43 + shell/common/tracing_controller.cc | 51 - shell/common/tracing_controller.h | 34 - shell/common/vsync_waiter.cc | 37 + shell/common/vsync_waiter.h | 21 +- shell/common/vsync_waiter_fallback.cc | 24 +- shell/common/vsync_waiter_fallback.h | 13 +- shell/gpu/BUILD.gn | 11 +- shell/gpu/gpu_rasterizer.cc | 168 --- shell/gpu/gpu_rasterizer.h | 68 -- shell/gpu/gpu_surface_gl.cc | 13 +- shell/gpu/gpu_surface_gl.h | 5 +- shell/gpu/gpu_surface_software.cc | 17 +- shell/gpu/gpu_surface_software.h | 7 +- shell/gpu/gpu_surface_vulkan.h | 5 +- shell/platform/BUILD.gn | 6 +- shell/platform/android/BUILD.gn | 16 +- shell/platform/android/android_context_gl.cc | 24 +- shell/platform/android/android_context_gl.h | 1 - .../android/android_external_texture_gl.cc | 9 +- .../android/android_external_texture_gl.h | 3 +- .../platform/android/android_shell_holder.cc | 169 +++ shell/platform/android/android_shell_holder.h | 59 + shell/platform/android/android_surface.cc | 24 + shell/platform/android/android_surface.h | 7 +- shell/platform/android/android_surface_gl.cc | 37 +- shell/platform/android/android_surface_gl.h | 24 +- .../android/android_surface_software.cc | 14 +- .../android/android_surface_software.h | 26 +- .../android/android_surface_vulkan.cc | 15 +- .../platform/android/android_surface_vulkan.h | 13 +- shell/platform/android/apk_asset_provider.cc | 29 +- shell/platform/android/apk_asset_provider.h | 27 +- shell/platform/android/flutter_main.cc | 75 +- shell/platform/android/flutter_main.h | 27 +- shell/platform/android/library_loader.cc | 2 +- .../platform_message_response_android.cc | 62 + .../platform_message_response_android.h | 39 + .../platform/android/platform_view_android.cc | 589 ++-------- .../platform/android/platform_view_android.h | 98 +- .../android/platform_view_android_jni.cc | 416 +++++-- .../platform/android/vsync_waiter_android.cc | 100 +- shell/platform/android/vsync_waiter_android.h | 15 +- shell/platform/darwin/BUILD.gn | 12 +- shell/platform/darwin/common/BUILD.gn | 13 +- shell/platform/darwin/common/command_line.h | 17 + shell/platform/darwin/common/command_line.mm | 21 + shell/platform/darwin/common/platform_mac.h | 20 - shell/platform/darwin/common/platform_mac.mm | 160 --- .../darwin/common/process_info_mac.cc | 36 - .../platform/darwin/common/process_info_mac.h | 36 - shell/platform/darwin/desktop/BUILD.gn | 22 +- shell/platform/darwin/desktop/Info.plist | 8 +- .../darwin/desktop/flutter_app_delegate.h | 14 - .../darwin/desktop/flutter_app_delegate.m | 15 - .../darwin/desktop/flutter_application.mm | 8 - ...ation.h => flutter_application_delegate.h} | 11 +- .../desktop/flutter_application_delegate.mm | 80 ++ shell/platform/darwin/desktop/flutter_mac.xib | 695 ----------- .../platform/darwin/desktop/flutter_window.h | 6 +- .../platform/darwin/desktop/flutter_window.mm | 201 +++- shell/platform/darwin/desktop/main_mac.mm | 112 +- .../darwin/desktop/platform_view_mac.h | 27 +- .../darwin/desktop/platform_view_mac.mm | 107 +- .../darwin/desktop/vsync_waiter_mac.cc | 16 +- .../darwin/desktop/vsync_waiter_mac.h | 10 +- shell/platform/darwin/ios/BUILD.gn | 13 +- .../framework/Source/FlutterDartProject.mm | 397 +++---- .../Source/FlutterDartProject_Internal.h | 23 +- .../ios/framework/Source/FlutterDartSource.h | 30 - .../ios/framework/Source/FlutterDartSource.mm | 100 -- .../Source/FlutterHeadlessDartRunner.mm | 88 +- .../darwin/ios/framework/Source/FlutterView.h | 6 + .../ios/framework/Source/FlutterView.mm | 103 +- .../framework/Source/FlutterViewController.mm | 337 +++--- .../Source/FlutterViewController_Internal.h | 17 + .../framework/Source/accessibility_bridge.mm | 4 +- .../ios/framework/Source/flutter_main_ios.h | 18 - .../ios/framework/Source/flutter_main_ios.mm | 25 - .../Source/platform_message_response_darwin.h | 50 + .../platform_message_response_darwin.mm | 11 + .../Source/platform_message_router.h | 5 +- .../Source/platform_message_router.mm | 15 +- .../ios/framework/Source/vsync_waiter_ios.h | 19 +- .../ios/framework/Source/vsync_waiter_ios.mm | 115 +- .../darwin/ios/ios_external_texture_gl.h | 2 + .../darwin/ios/ios_external_texture_gl.mm | 19 +- shell/platform/darwin/ios/ios_gl_context.h | 2 +- shell/platform/darwin/ios/ios_gl_context.mm | 60 +- shell/platform/darwin/ios/ios_surface.h | 19 +- shell/platform/darwin/ios/ios_surface.mm | 31 +- shell/platform/darwin/ios/ios_surface_gl.h | 3 +- shell/platform/darwin/ios/ios_surface_gl.mm | 5 +- .../darwin/ios/ios_surface_software.h | 11 +- .../darwin/ios/ios_surface_software.mm | 9 +- shell/platform/darwin/ios/platform_view_ios.h | 93 +- .../platform/darwin/ios/platform_view_ios.mm | 143 +-- shell/platform/embedder/BUILD.gn | 8 +- shell/platform/embedder/embedder.cc | 245 ++-- shell/platform/embedder/embedder_engine.cc | 119 ++ shell/platform/embedder/embedder_engine.h | 53 + .../embedder/platform_view_embedder.cc | 53 +- .../embedder/platform_view_embedder.h | 29 +- shell/platform/linux/BUILD.gn | 23 - shell/platform/linux/main_linux.cc | 142 --- shell/platform/win/BUILD.gn | 30 - shell/platform/win/main_win.cc | 142 --- shell/testing/BUILD.gn | 26 +- shell/testing/platform_view_test.cc | 32 - shell/testing/platform_view_test.h | 38 - shell/testing/test_runner.cc | 48 - shell/testing/test_runner.h | 42 - shell/testing/tester_main.cc | 243 ++++ shell/testing/testing.cc | 24 - shell/testing/testing.h | 16 - sky/engine/platform/SharedBuffer.cpp | 1 - .../platform/fonts/FontFallbackList.cpp | 10 +- sky/engine/platform/fonts/FontFallbackList.h | 3 + sky/engine/web/Sky.cpp | 56 - synchronization/BUILD.gn | 5 +- synchronization/debug_thread_checker.h | 25 - synchronization/semaphore.cc | 6 +- testing/BUILD.gn | 4 + testing/thread_test.cc | 33 + testing/thread_test.h | 37 + tools/gn | 4 + travis/licenses_golden/licenses_flutter | 233 ++-- 345 files changed, 12543 insertions(+), 11072 deletions(-) create mode 100644 assets/asset_manager.cc create mode 100644 assets/asset_manager.h delete mode 100644 assets/asset_provider.h create mode 100644 assets/asset_resolver.h delete mode 100644 assets/unzipper_provider.cc delete mode 100644 assets/unzipper_provider.h create mode 100644 common/task_runners.cc create mode 100644 common/task_runners.h delete mode 100644 common/threads.cc delete mode 100644 common/threads.h create mode 100644 content_handler/README.md delete mode 100644 content_handler/app.cc delete mode 100644 content_handler/app.h create mode 100644 content_handler/application.cc create mode 100644 content_handler/application.h delete mode 100644 content_handler/application_controller_impl.cc delete mode 100644 content_handler/application_controller_impl.h create mode 100644 content_handler/application_runner.cc create mode 100644 content_handler/application_runner.h create mode 100644 content_handler/compositor_context.cc create mode 100644 content_handler/compositor_context.h create mode 100644 content_handler/engine.cc create mode 100644 content_handler/engine.h create mode 100644 content_handler/isolate_configurator.cc create mode 100644 content_handler/isolate_configurator.h create mode 100644 content_handler/platform_view.cc create mode 100644 content_handler/platform_view.h delete mode 100644 content_handler/rasterizer.cc delete mode 100644 content_handler/rasterizer.h delete mode 100644 content_handler/runtime_holder.cc delete mode 100644 content_handler/runtime_holder.h delete mode 100644 content_handler/service_protocol_hooks.cc delete mode 100644 content_handler/service_protocol_hooks.h create mode 100644 content_handler/surface.cc create mode 100644 content_handler/surface.h create mode 100644 content_handler/task_observers.cc create mode 100644 content_handler/task_observers.h create mode 100644 content_handler/unique_fdio_ns.h delete mode 100644 content_handler/vulkan_rasterizer.cc delete mode 100644 content_handler/vulkan_rasterizer.h delete mode 100644 flow/process_info.h create mode 100644 flow/skia_gpu_object.cc create mode 100644 flow/skia_gpu_object.h create mode 100644 fml/file.h create mode 100644 fml/macros.h create mode 100644 fml/mapping.cc create mode 100644 fml/memory/thread_checker.h create mode 100644 fml/native_library.h create mode 100644 fml/paths.cc create mode 100644 fml/platform/fuchsia/paths_fuchsia.cc create mode 100644 fml/platform/posix/file_posix.cc create mode 100644 fml/platform/posix/native_library_posix.cc create mode 100644 fml/platform/win/file_win.cc create mode 100644 fml/platform/win/native_library_win.cc create mode 100644 fml/platform/win/wstring_conversion.h delete mode 100644 fml/task_observer.h create mode 100644 fml/unique_fd.cc create mode 100644 fml/unique_fd.h create mode 100644 fml/unique_object.h delete mode 100644 lib/ui/painting/resource_context.cc delete mode 100644 lib/ui/painting/resource_context.h delete mode 100644 lib/ui/painting/utils.cc delete mode 100644 lib/ui/painting/utils.h delete mode 100644 runtime/dart_controller.cc delete mode 100644 runtime/dart_controller.h delete mode 100644 runtime/dart_init.cc delete mode 100644 runtime/dart_init.h create mode 100644 runtime/dart_isolate.cc create mode 100644 runtime/dart_isolate.h create mode 100644 runtime/dart_isolate_unittests.cc create mode 100644 runtime/dart_snapshot.cc create mode 100644 runtime/dart_snapshot.h create mode 100644 runtime/dart_snapshot_buffer.cc create mode 100644 runtime/dart_snapshot_buffer.h create mode 100644 runtime/dart_vm.cc create mode 100644 runtime/dart_vm.h create mode 100644 runtime/dart_vm_unittests.cc create mode 100644 runtime/fixtures/simple_main.dart delete mode 100644 runtime/runtime_init.cc delete mode 100644 runtime/runtime_init.h create mode 100644 runtime/service_protocol.cc create mode 100644 runtime/service_protocol.h create mode 100644 shell/common/io_manager.cc create mode 100644 shell/common/io_manager.h create mode 100644 shell/common/isolate_configuration.cc create mode 100644 shell/common/isolate_configuration.h delete mode 100644 shell/common/null_platform_view.cc delete mode 100644 shell/common/null_platform_view.h delete mode 100644 shell/common/null_rasterizer.cc delete mode 100644 shell/common/null_rasterizer.h delete mode 100644 shell/common/platform_view_service_protocol.cc delete mode 100644 shell/common/platform_view_service_protocol.h create mode 100644 shell/common/run_configuration.cc create mode 100644 shell/common/run_configuration.h create mode 100644 shell/common/shell_unittests.cc create mode 100644 shell/common/thread_host.cc create mode 100644 shell/common/thread_host.h delete mode 100644 shell/common/tracing_controller.cc delete mode 100644 shell/common/tracing_controller.h delete mode 100644 shell/gpu/gpu_rasterizer.cc delete mode 100644 shell/gpu/gpu_rasterizer.h create mode 100644 shell/platform/android/android_shell_holder.cc create mode 100644 shell/platform/android/android_shell_holder.h create mode 100644 shell/platform/android/platform_message_response_android.cc create mode 100644 shell/platform/android/platform_message_response_android.h create mode 100644 shell/platform/darwin/common/command_line.h create mode 100644 shell/platform/darwin/common/command_line.mm delete mode 100644 shell/platform/darwin/common/platform_mac.h delete mode 100644 shell/platform/darwin/common/platform_mac.mm delete mode 100644 shell/platform/darwin/common/process_info_mac.cc delete mode 100644 shell/platform/darwin/common/process_info_mac.h delete mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.h delete mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.m delete mode 100644 shell/platform/darwin/desktop/flutter_application.mm rename shell/platform/darwin/desktop/{flutter_application.h => flutter_application_delegate.h} (65%) create mode 100644 shell/platform/darwin/desktop/flutter_application_delegate.mm delete mode 100644 shell/platform/darwin/desktop/flutter_mac.xib delete mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.h delete mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h delete mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.h delete mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm create mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h create mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm create mode 100644 shell/platform/embedder/embedder_engine.cc create mode 100644 shell/platform/embedder/embedder_engine.h delete mode 100644 shell/platform/linux/BUILD.gn delete mode 100644 shell/platform/linux/main_linux.cc delete mode 100644 shell/platform/win/BUILD.gn delete mode 100644 shell/platform/win/main_win.cc delete mode 100644 shell/testing/platform_view_test.cc delete mode 100644 shell/testing/platform_view_test.h delete mode 100644 shell/testing/test_runner.cc delete mode 100644 shell/testing/test_runner.h create mode 100644 shell/testing/tester_main.cc delete mode 100644 shell/testing/testing.cc delete mode 100644 shell/testing/testing.h delete mode 100644 synchronization/debug_thread_checker.h create mode 100644 testing/thread_test.cc create mode 100644 testing/thread_test.h diff --git a/BUILD.gn b/BUILD.gn index 24dda026c6245..b37b0b8d4054c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,14 +10,12 @@ group("flutter") { public_deps = [ "$flutter_root/lib/snapshot:generate_snapshot_bin", "$flutter_root/lib/snapshot:kernel_platform_files", + "$flutter_root/shell/testing", "$flutter_root/sky", - "$flutter_root/third_party/txt", ] if (flutter_runtime_mode != "debug") { - public_deps += [ - "$flutter_root/lib/snapshot:entry_points_json_files", - ] + public_deps += [ "$flutter_root/lib/snapshot:entry_points_json_files" ] } if (!is_fuchsia && !is_fuchsia_host) { @@ -45,20 +43,24 @@ group("flutter") { "$flutter_root/shell/platform/embedder:flutter_embedder_framework", ] } - if (!is_win) { - public_deps += [ - "$flutter_root/shell/platform/embedder:embedder_unittests", - "$flutter_root/shell/platform/embedder:flutter_engine", - ] - } + public_deps += [ "$flutter_root/flow:flow_unittests", "$flutter_root/fml:fml_unittests", + "$flutter_root/runtime:runtime_unittests", + "$flutter_root/shell/common:shell_unittests", "$flutter_root/sky/engine/wtf:wtf_unittests", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", "//garnet/public/lib/fxl:fxl_unittests", ] + + if (!is_win) { + public_deps += [ + "$flutter_root/shell/platform/embedder:embedder_unittests", + "$flutter_root/shell/platform/embedder:flutter_engine", + ] + } } } @@ -74,29 +76,23 @@ if (is_fuchsia) { "$flutter_root/content_handler:aot", ] if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] + deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] } binary = "flutter_aot_runner" if (flutter_runtime_mode != "release") { - resources = [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] + resources = [ { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + } ] } - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] + meta = [ { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + } ] } package("flutter_jit_runner") { @@ -104,29 +100,23 @@ if (is_fuchsia) { "$flutter_root/content_handler:jit", ] if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] + deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] } binary = "flutter_jit_runner" if (flutter_runtime_mode != "release") { - resources = [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] + resources = [ { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + } ] } - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] + meta = [ { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + } ] } } else { group("dist") { diff --git a/DEPS b/DEPS index 30a88e2b6a355..0f47bd8ceeecb 100644 --- a/DEPS +++ b/DEPS @@ -115,7 +115,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '8dddd90bf943a8174913564353b30a3b11ee0f7a', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '3cf97e01cdbd4bb920fa3d40282a56c4b2d62a58', # Fuchsia compatibility # diff --git a/assets/BUILD.gn b/assets/BUILD.gn index c4901375ad810..28d7e569659f1 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -4,16 +4,18 @@ source_set("assets") { sources = [ - "asset_provider.h", + "asset_manager.cc", + "asset_manager.h", + "asset_resolver.h", "directory_asset_bundle.cc", "directory_asset_bundle.h", - "unzipper_provider.cc", - "unzipper_provider.h", "zip_asset_store.cc", "zip_asset_store.h", ] deps = [ + "$flutter_root/common", + "$flutter_root/fml", "$flutter_root/glue", "//garnet/public/lib/fxl", "//garnet/public/lib/zip", @@ -23,7 +25,5 @@ source_set("assets") { "//third_party/zlib:minizip", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc new file mode 100644 index 0000000000000..8a313f0729c96 --- /dev/null +++ b/assets/asset_manager.cc @@ -0,0 +1,55 @@ +// Copyright 2017 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/assets/asset_manager.h" + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/glue/trace_event.h" +#include "lib/fxl/files/path.h" + +namespace blink { + +AssetManager::AssetManager() = default; + +AssetManager::~AssetManager() = default; + +void AssetManager::PushFront(std::unique_ptr resolver) { + if (resolver == nullptr || !resolver->IsValid()) { + return; + } + + resolvers_.push_front(std::move(resolver)); +} + +void AssetManager::PushBack(std::unique_ptr resolver) { + if (resolver == nullptr || !resolver->IsValid()) { + return; + } + + resolvers_.push_back(std::move(resolver)); +} + +// |blink::AssetResolver| +bool AssetManager::GetAsBuffer(const std::string& asset_name, + std::vector* data) const { + if (asset_name.size() == 0) { + return false; + } + TRACE_EVENT0("flutter", "AssetManager::GetAsBuffer"); + for (const auto& resolver : resolvers_) { + if (resolver->GetAsBuffer(asset_name, data)) { + return true; + } + } + FXL_DLOG(ERROR) << "Could not find asset: " << asset_name; + return false; +} + +// |blink::AssetResolver| +bool AssetManager::IsValid() const { + return resolvers_.size() > 0; +} + +} // namespace blink diff --git a/assets/asset_manager.h b/assets/asset_manager.h new file mode 100644 index 0000000000000..fc7f3ef05210e --- /dev/null +++ b/assets/asset_manager.h @@ -0,0 +1,47 @@ +// Copyright 2017 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_ASSETS_ASSET_MANAGER_H_ +#define FLUTTER_ASSETS_ASSET_MANAGER_H_ + +#include +#include +#include + +#include "flutter/assets/asset_resolver.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" + +namespace blink { + +class AssetManager final : public AssetResolver, + public fxl::RefCountedThreadSafe { + public: + void PushFront(std::unique_ptr resolver); + + void PushBack(std::unique_ptr resolver); + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; + + private: + std::deque> resolvers_; + + AssetManager(); + + ~AssetManager(); + + FXL_DISALLOW_COPY_AND_ASSIGN(AssetManager); + FRIEND_MAKE_REF_COUNTED(AssetManager); + FRIEND_REF_COUNTED_THREAD_SAFE(AssetManager); +}; + +} // namespace blink + +#endif // FLUTTER_ASSETS_ASSET_MANAGER_H_ diff --git a/assets/asset_provider.h b/assets/asset_provider.h deleted file mode 100644 index 68b7f5c2b7b9c..0000000000000 --- a/assets/asset_provider.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -#ifndef FLUTTER_ASSETS_ASSET_PROVIDER_H_ -#define FLUTTER_ASSETS_ASSET_PROVIDER_H_ - -#include -#include - -#include "lib/fxl/memory/ref_counted.h" - -namespace blink { - -class AssetProvider - : public fxl::RefCountedThreadSafe - { - public: - virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data) = 0; - virtual ~AssetProvider() = default; -}; - -} // namespace blink -#endif // FLUTTER_ASSETS_ASSET_PROVIDER_H diff --git a/assets/asset_resolver.h b/assets/asset_resolver.h new file mode 100644 index 0000000000000..6cfe27961a9f4 --- /dev/null +++ b/assets/asset_resolver.h @@ -0,0 +1,32 @@ +// Copyright 2017 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_ASSETS_ASSET_RESOLVER_H_ +#define FLUTTER_ASSETS_ASSET_RESOLVER_H_ + +#include +#include + +#include "lib/fxl/macros.h" + +namespace blink { + +class AssetResolver { + public: + AssetResolver() = default; + + virtual ~AssetResolver() = default; + + virtual bool IsValid() const = 0; + + virtual bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const = 0; + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(AssetResolver); +}; + +} // namespace blink + +#endif // FLUTTER_ASSETS_ASSET_RESOLVER_H_ diff --git a/assets/directory_asset_bundle.cc b/assets/directory_asset_bundle.cc index 43933079a81bd..8e5d4df2ab977 100644 --- a/assets/directory_asset_bundle.cc +++ b/assets/directory_asset_bundle.cc @@ -3,73 +3,54 @@ // found in the LICENSE file. #include "flutter/assets/directory_asset_bundle.h" -#include "lib/fxl/build_config.h" - -#include #include +#include "flutter/fml/file.h" +#include "flutter/fml/mapping.h" #include "lib/fxl/files/eintr_wrapper.h" -#include "lib/fxl/files/file.h" -#include "lib/fxl/files/path.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/portable_unistd.h" namespace blink { -bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, - std::vector* data) { - if (fd_.is_valid()) { -#if defined(OS_WIN) - // This code path is not valid in a Windows environment. - return false; -#else - fxl::UniqueFD asset_file(openat(fd_.get(), asset_name.c_str(), O_RDONLY)); - if (!asset_file.is_valid()) - return false; - - constexpr size_t kBufferSize = 1 << 16; - size_t offset = 0; - ssize_t bytes_read = 0; - do { - offset += bytes_read; - data->resize(offset + kBufferSize); - bytes_read = read(asset_file.get(), &(*data)[offset], kBufferSize); - } while (bytes_read > 0); +DirectoryAssetBundle::DirectoryAssetBundle(fml::UniqueFD descriptor) + : descriptor_(std::move(descriptor)) { + if (!fml::IsDirectory(descriptor_)) { + return; + } + is_valid_ = true; +} - if (bytes_read < 0) { - FXL_LOG(ERROR) << "Reading " << asset_name << " failed"; - data->clear(); - return false; - } +DirectoryAssetBundle::~DirectoryAssetBundle() = default; - data->resize(offset + bytes_read); - return true; -#endif - } - std::string asset_path = GetPathForAsset(asset_name); - if (asset_path.empty()) - return false; - return files::ReadFileToVector(asset_path, data); +// |blink::AssetResolver| +bool DirectoryAssetBundle::IsValid() const { + return is_valid_; } -DirectoryAssetBundle::~DirectoryAssetBundle() {} +// |blink::AssetResolver| +bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, + std::vector* data) const { + if (data == nullptr) { + return false; + } -DirectoryAssetBundle::DirectoryAssetBundle(std::string directory) - : directory_(std::move(directory)), fd_() {} + if (!is_valid_) { + FXL_DLOG(WARNING) << "Asset bundle was not valid."; + return false; + } -DirectoryAssetBundle::DirectoryAssetBundle(fxl::UniqueFD fd) - : fd_(std::move(fd)) {} + fml::FileMapping mapping( + fml::OpenFile(descriptor_, asset_name.c_str(), fml::OpenPermission::kRead, + false /* directory */), + false /* executable */); -std::string DirectoryAssetBundle::GetPathForAsset( - const std::string& asset_name) { - std::string asset_path = files::SimplifyPath(directory_ + "/" + asset_name); - if (asset_path.find(directory_) != 0u) { - FXL_LOG(ERROR) << "Asset name '" << asset_name - << "' attempted to traverse outside asset bundle."; - return std::string(); + if (mapping.GetMapping() == nullptr) { + return false; } - return asset_path; + + data->resize(mapping.GetSize()); + memmove(data->data(), mapping.GetMapping(), mapping.GetSize()); + return true; } } // namespace blink diff --git a/assets/directory_asset_bundle.h b/assets/directory_asset_bundle.h index c710a513796ae..b594e1357fbe2 100644 --- a/assets/directory_asset_bundle.h +++ b/assets/directory_asset_bundle.h @@ -5,31 +5,31 @@ #ifndef FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ #define FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ -#include -#include - -#include "flutter/assets/asset_provider.h" -#include "lib/fxl/files/unique_fd.h" +#include "flutter/assets/asset_resolver.h" +#include "flutter/fml/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class DirectoryAssetBundle - : public AssetProvider { +class DirectoryAssetBundle : public AssetResolver { public: - explicit DirectoryAssetBundle(std::string directory); - // Expects fd to be valid, otherwise the file descriptor is ignored. - explicit DirectoryAssetBundle(fxl::UniqueFD fd); - virtual ~DirectoryAssetBundle(); - - virtual bool GetAsBuffer(const std::string& asset_name, std::vector* data); + explicit DirectoryAssetBundle(fml::UniqueFD descriptor); - std::string GetPathForAsset(const std::string& asset_name); + ~DirectoryAssetBundle() override; private: - const std::string directory_; - fxl::UniqueFD fd_; + const fml::UniqueFD descriptor_; + bool is_valid_ = false; + + std::string GetPathForAsset(const std::string& asset_name) const; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); }; diff --git a/assets/unzipper_provider.cc b/assets/unzipper_provider.cc deleted file mode 100644 index 8ed023f9a20e9..0000000000000 --- a/assets/unzipper_provider.cc +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/assets/unzipper_provider.h" - -#include "lib/fxl/logging.h" -#include "third_party/zlib/contrib/minizip/unzip.h" - -namespace blink { - -UnzipperProvider GetUnzipperProviderForPath(std::string zip_path) { - return [zip_path]() { - zip::UniqueUnzipper unzipper(unzOpen2(zip_path.c_str(), nullptr)); - if (!unzipper.is_valid()) - FXL_LOG(ERROR) << "Unable to open zip file: " << zip_path; - return unzipper; - }; -} - -} // namespace blink diff --git a/assets/unzipper_provider.h b/assets/unzipper_provider.h deleted file mode 100644 index f0f8d9597dffd..0000000000000 --- a/assets/unzipper_provider.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_ASSETS_UNZIP_PROVIDER_H_ -#define FLUTTER_ASSETS_UNZIP_PROVIDER_H_ - -#include - -#include "lib/zip/unique_unzipper.h" - -namespace blink { - -using UnzipperProvider = std::function; - -UnzipperProvider GetUnzipperProviderForPath(std::string zip_path); - -} // namespace blink - -#endif // FLUTTER_ASSETS_UNZIP_PROVIDER_H_ diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index c8534fa10c216..1b9216bd34530 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -15,21 +15,28 @@ #include #include "flutter/glue/trace_event.h" -#include "lib/fxl/files/eintr_wrapper.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/zip/unique_unzipper.h" namespace blink { -ZipAssetStore::ZipAssetStore(UnzipperProvider unzipper_provider) - : unzipper_provider_(std::move(unzipper_provider)) { +ZipAssetStore::ZipAssetStore(std::string file_path) + : file_path_(std::move(file_path)) { BuildStatCache(); } ZipAssetStore::~ZipAssetStore() = default; +zip::UniqueUnzipper ZipAssetStore::CreateUnzipper() const { + return zip::UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)}; +} + +// |blink::AssetResolver| +bool ZipAssetStore::IsValid() const { + return stat_cache_.size() > 0; +} + +// |blink::AssetResolver| bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, - std::vector* data) { + std::vector* data) const { TRACE_EVENT0("flutter", "ZipAssetStore::GetAsBuffer"); auto found = stat_cache_.find(asset_name); @@ -37,7 +44,7 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, return false; } - auto unzipper = unzipper_provider_(); + auto unzipper = CreateUnzipper(); if (!unzipper.is_valid()) { return false; @@ -73,7 +80,8 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, void ZipAssetStore::BuildStatCache() { TRACE_EVENT0("flutter", "ZipAssetStore::BuildStatCache"); - auto unzipper = unzipper_provider_(); + + auto unzipper = CreateUnzipper(); if (!unzipper.is_valid()) { return; diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h index 1ffda483ba9b7..558678e25bc08 100644 --- a/assets/zip_asset_store.h +++ b/assets/zip_asset_store.h @@ -6,21 +6,20 @@ #define FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ #include -#include -#include "flutter/assets/unzipper_provider.h" +#include "flutter/assets/asset_resolver.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" +#include "lib/zip/unique_unzipper.h" #include "third_party/zlib/contrib/minizip/unzip.h" namespace blink { -class ZipAssetStore : public fxl::RefCountedThreadSafe { +class ZipAssetStore final : public AssetResolver { public: - explicit ZipAssetStore(UnzipperProvider unzipper_provider); - ~ZipAssetStore(); + ZipAssetStore(std::string file_path); - bool GetAsBuffer(const std::string& asset_name, std::vector* data); + ~ZipAssetStore() override; private: struct CacheEntry { @@ -30,11 +29,20 @@ class ZipAssetStore : public fxl::RefCountedThreadSafe { : file_pos(p_file_pos), uncompressed_size(p_uncompressed_size) {} }; - UnzipperProvider unzipper_provider_; - std::map stat_cache_; + std::string file_path_; + mutable std::map stat_cache_; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; void BuildStatCache(); + zip::UniqueUnzipper CreateUnzipper() const; + FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); }; diff --git a/common/BUILD.gn b/common/BUILD.gn index 53b71914d49d1..47cd7d3d62644 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -12,11 +12,12 @@ source_set("common") { sources = [ "settings.cc", "settings.h", - "threads.cc", - "threads.h", + "task_runners.cc", + "task_runners.h", ] deps = [ + "$flutter_root/fml", "//garnet/public/lib/fxl", ] diff --git a/common/settings.cc b/common/settings.cc index 0198f714cbaad..85523e1b9a29f 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -4,26 +4,50 @@ #include "flutter/common/settings.h" -#include - -#include "lib/fxl/logging.h" +#include namespace blink { -namespace { - -Settings* g_settings = nullptr; - -} // namespace - -const Settings& Settings::Get() { - FXL_CHECK(g_settings); - return *g_settings; -} -void Settings::Set(const Settings& settings) { - FXL_CHECK(!g_settings); - g_settings = new Settings(); - *g_settings = settings; +std::string Settings::ToString() const { + std::stringstream stream; + stream << "Settings: " << std::endl; + stream << "aot_snapshot_path: " << aot_snapshot_path << std::endl; + stream << "script_snapshot_path: " << script_snapshot_path << std::endl; + stream << "aot_vm_snapshot_data_filename: " << aot_vm_snapshot_data_filename + << std::endl; + stream << "aot_vm_snapshot_instr_filename: " << aot_vm_snapshot_instr_filename + << std::endl; + stream << "aot_isolate_snapshot_data_filename: " + << aot_isolate_snapshot_data_filename << std::endl; + stream << "aot_isolate_snapshot_instr_filename: " + << aot_isolate_snapshot_instr_filename << std::endl; + stream << "application_library_path: " << application_library_path + << std::endl; + stream << "main_dart_file_path: " << main_dart_file_path << std::endl; + stream << "packages_file_path: " << packages_file_path << std::endl; + stream << "temp_directory_path: " << temp_directory_path << std::endl; + stream << "dart_flags:" << std::endl; + for (const auto& dart_flag : dart_flags) { + stream << " " << dart_flag << std::endl; + } + stream << "start_paused: " << start_paused << std::endl; + stream << "trace_skia: " << trace_skia << std::endl; + stream << "trace_startup: " << trace_startup << std::endl; + stream << "endless_trace_buffer: " << endless_trace_buffer << std::endl; + stream << "enable_dart_profiling: " << enable_dart_profiling << std::endl; + stream << "dart_non_checked_mode: " << dart_non_checked_mode << std::endl; + stream << "enable_observatory: " << enable_observatory << std::endl; + stream << "observatory_port: " << observatory_port << std::endl; + stream << "ipv6: " << ipv6 << std::endl; + stream << "use_test_fonts: " << use_test_fonts << std::endl; + stream << "enable_software_rendering: " << enable_software_rendering + << std::endl; + stream << "using_blink: " << using_blink << std::endl; + stream << "log_tag: " << log_tag << std::endl; + stream << "icu_data_path: " << icu_data_path << std::endl; + stream << "assets_dir: " << assets_dir << std::endl; + stream << "assets_path: " << assets_path << std::endl; + return stream.str(); } } // namespace blink diff --git a/common/settings.h b/common/settings.h index 5bb5c6cbbea42..c6c3159766a37 100644 --- a/common/settings.h +++ b/common/settings.h @@ -5,40 +5,82 @@ #ifndef FLUTTER_COMMON_SETTINGS_H_ #define FLUTTER_COMMON_SETTINGS_H_ +#include #include +#include #include #include +#include "flutter/fml/unique_fd.h" +#include "lib/fxl/functional/closure.h" + namespace blink { +using TaskObserverAdd = + std::function; +using TaskObserverRemove = std::function; + struct Settings { - bool enable_observatory = false; - // Port on target will be auto selected by the OS. A message will be printed - // on the target with the port after it has been selected. - uint32_t observatory_port = 0; - bool ipv6 = false; - bool start_paused = false; - bool trace_startup = false; - bool endless_trace_buffer = false; - bool enable_dart_profiling = false; - bool use_test_fonts = false; - bool dart_non_checked_mode = false; - bool enable_software_rendering = false; - bool using_blink = true; - std::string aot_shared_library_path; + // VM settings + std::string script_snapshot_path; + std::string kernel_snapshot_path; + std::string aot_snapshot_path; std::string aot_vm_snapshot_data_filename; std::string aot_vm_snapshot_instr_filename; std::string aot_isolate_snapshot_data_filename; std::string aot_isolate_snapshot_instr_filename; + std::string application_library_path; + std::string application_kernel_asset; + + std::string main_dart_file_path; + std::string packages_file_path; + std::string temp_directory_path; std::vector dart_flags; + + // Isolate settings + bool start_paused = false; + bool trace_skia = false; + bool trace_startup = false; + bool endless_trace_buffer = false; + bool enable_dart_profiling = false; + bool dart_non_checked_mode = false; + + // Observatory settings + bool enable_observatory = false; + // Port on target will be auto selected by the OS. A message will be printed + // on the target with the port after it has been selected. + uint32_t observatory_port = 0; + bool ipv6 = false; + + // Font settings + bool use_test_fonts = false; + + // Engine settings + TaskObserverAdd task_observer_add; + TaskObserverRemove task_observer_remove; + // The main isolate is current when this callback is made. This is a good spot + // to perform native Dart bindings for libraries not built in. + fxl::Closure root_isolate_create_callback; + // The isolate is not current and may have already been destroyed when this + // call is made. + fxl::Closure root_isolate_shutdown_callback; + bool enable_software_rendering = false; + bool using_blink = false; + bool skia_deterministic_rendering_on_cpu = false; std::string log_tag = "flutter"; + std::string icu_data_path; + + // Assets settings + fml::UniqueFD::element_type assets_dir = + fml::UniqueFD::traits_type::InvalidValue(); + std::string assets_path; + std::string flx_path; - static const Settings& Get(); - static void Set(const Settings& settings); + std::string ToString() const; }; } // namespace blink diff --git a/common/task_runners.cc b/common/task_runners.cc new file mode 100644 index 0000000000000..1a09daec1815c --- /dev/null +++ b/common/task_runners.cc @@ -0,0 +1,48 @@ +// Copyright 2017 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/common/task_runners.h" + +#include + +namespace blink { + +TaskRunners::TaskRunners(std::string label, + fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io) + : label_(std::move(label)), + platform_(std::move(platform)), + gpu_(std::move(gpu)), + ui_(std::move(ui)), + io_(std::move(io)) {} + +TaskRunners::~TaskRunners() = default; + +const std::string& TaskRunners::GetLabel() const { + return label_; +} + +fxl::RefPtr TaskRunners::GetPlatformTaskRunner() const { + return platform_; +} + +fxl::RefPtr TaskRunners::GetUITaskRunner() const { + return ui_; +} + +fxl::RefPtr TaskRunners::GetIOTaskRunner() const { + return io_; +} + +fxl::RefPtr TaskRunners::GetGPUTaskRunner() const { + return gpu_; +} + +bool TaskRunners::IsValid() const { + return platform_ && gpu_ && ui_ && io_; +} + +} // namespace blink diff --git a/common/task_runners.h b/common/task_runners.h new file mode 100644 index 0000000000000..f41ae147ebad0 --- /dev/null +++ b/common/task_runners.h @@ -0,0 +1,46 @@ +// Copyright 2017 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 + +#include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" + +namespace blink { + +class TaskRunners { + public: + TaskRunners(std::string label, + fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io); + + ~TaskRunners(); + + const std::string& GetLabel() const; + + fxl::RefPtr GetPlatformTaskRunner() const; + + fxl::RefPtr GetUITaskRunner() const; + + fxl::RefPtr GetIOTaskRunner() const; + + fxl::RefPtr GetGPUTaskRunner() const; + + bool IsValid() const; + + private: + const std::string label_; + fxl::RefPtr platform_; + fxl::RefPtr gpu_; + fxl::RefPtr ui_; + fxl::RefPtr io_; +}; +} // namespace blink + +#endif // FLUTTER_COMMON_TASK_RUNNERS_H_ diff --git a/common/threads.cc b/common/threads.cc deleted file mode 100644 index 3634d8d7c8723..0000000000000 --- a/common/threads.cc +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/common/threads.h" - -#include - -namespace blink { -namespace { - -Threads* g_threads = nullptr; - -} // namespace - -Threads::Threads() {} - -Threads::Threads(fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io) - : platform_(std::move(platform)), - gpu_(std::move(gpu)), - ui_(std::move(ui)), - io_(std::move(io)) {} - -Threads::~Threads() {} - -const fxl::RefPtr& Threads::Platform() { - return Get().platform_; -} - -const fxl::RefPtr& Threads::Gpu() { - return Get().gpu_; -} - -const fxl::RefPtr& Threads::UI() { - return Get().ui_; -} - -const fxl::RefPtr& Threads::IO() { - return Get().io_; -} - -const Threads& Threads::Get() { - FXL_CHECK(g_threads); - return *g_threads; -} - -void Threads::Set(const Threads& threads) { - FXL_CHECK(!g_threads); - g_threads = new Threads(); - *g_threads = threads; -} - -} // namespace blink diff --git a/common/threads.h b/common/threads.h deleted file mode 100644 index 456a5eba8ad97..0000000000000 --- a/common/threads.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_COMMON_THREADS_H_ -#define FLUTTER_COMMON_THREADS_H_ - -#include "lib/fxl/tasks/task_runner.h" - -#define ASSERT_IS_PLATFORM_THREAD \ - FXL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread()); -#define ASSERT_IS_GPU_THREAD \ - FXL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread()); -#define ASSERT_IS_UI_THREAD \ - FXL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread()); -#define ASSERT_IS_IO_THREAD \ - FXL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread()); - -namespace blink { - -class Threads { - public: - Threads(); - Threads(fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io); - ~Threads(); - - static const fxl::RefPtr& Platform(); - static const fxl::RefPtr& Gpu(); - static const fxl::RefPtr& UI(); - static const fxl::RefPtr& IO(); - - static void Set(const Threads& settings); - - private: - static const Threads& Get(); - - fxl::RefPtr platform_; - fxl::RefPtr gpu_; - fxl::RefPtr ui_; - fxl::RefPtr io_; -}; - -} // namespace blink - -#endif // FLUTTER_COMMON_THREADS_H_ diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 6bc00b4e2786c..4778784baa643 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -20,23 +20,28 @@ template("flutter_content_handler") { sources = [ "accessibility_bridge.cc", "accessibility_bridge.h", - "app.cc", - "app.h", - "application_controller_impl.cc", - "application_controller_impl.h", + "application.cc", + "application.h", + "application_runner.cc", + "application_runner.h", + "compositor_context.cc", + "compositor_context.h", + "engine.cc", + "engine.h", "fuchsia_font_manager.cc", "fuchsia_font_manager.h", + "isolate_configurator.cc", + "isolate_configurator.h", "main.cc", - "rasterizer.cc", - "rasterizer.h", - "runtime_holder.cc", - "runtime_holder.h", - "service_protocol_hooks.cc", - "service_protocol_hooks.h", + "platform_view.cc", + "platform_view.h", "session_connection.cc", "session_connection.h", - "vulkan_rasterizer.cc", - "vulkan_rasterizer.h", + "surface.cc", + "surface.h", + "task_observers.cc", + "task_observers.h", + "unique_fdio_ns.h", "vulkan_surface.cc", "vulkan_surface.h", "vulkan_surface_pool.cc", @@ -45,18 +50,26 @@ template("flutter_content_handler") { "vulkan_surface_producer.h", ] + # The use of these dependencies is temporary and will be moved behind the + # embedder API. + flutter_deps = [ + "$flutter_root/assets", + "$flutter_root/common", + "$flutter_root/flow", + "$flutter_root/glue", + "$flutter_root/lib/ui", + "$flutter_root/runtime", + "$flutter_root/sky/engine/platform", + "$flutter_root/third_party/txt", + "$flutter_root/vulkan", + "$flutter_root/fml", + "$flutter_root/shell/common", + "$flutter_root/shell/gpu", + ] + deps = [ "//third_party/dart/runtime/bin:libdart_builtin", "//third_party/dart/runtime/platform:libdart_platform", - "$flutter_root/assets", - "$flutter_root/common", - "$flutter_root/flow", - "$flutter_root/glue", - "$flutter_root/lib/ui", - "$flutter_root/runtime", - "$flutter_root/sky/engine/platform", - "$flutter_root/third_party/txt", - "$flutter_root/vulkan", "//garnet/public/lib/app/cpp", "//garnet/public/lib/fsl", "//garnet/public/lib/fxl", @@ -73,8 +86,10 @@ template("flutter_content_handler") { "//topaz/lib/tonic", "//topaz/public/dart-pkg/fuchsia", "//topaz/public/lib/ui/flutter/sdk_ext", + "//third_party/skia:gpu", + "//third_party/zlib:minizip", "//zircon/public/lib/trace-provider", - ] + extra_deps + ] + extra_deps + flutter_deps # The flags below are needed so that Dart's CPU profiler can walk the # C++ stack. diff --git a/content_handler/README.md b/content_handler/README.md new file mode 100644 index 0000000000000..4461e808d1a47 --- /dev/null +++ b/content_handler/README.md @@ -0,0 +1,4 @@ +Flutter Application Runner +========================== + +Implements the `component::ApplicationRunner` FIDL interface to launch and run mutliple Flutter applications within the same process. diff --git a/content_handler/accessibility_bridge.cc b/content_handler/accessibility_bridge.cc index cb6f9b8e21155..f3d52f6cdbbb6 100644 --- a/content_handler/accessibility_bridge.cc +++ b/content_handler/accessibility_bridge.cc @@ -2,21 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/content_handler/accessibility_bridge.h" +#include "accessibility_bridge.h" #include -#include "flutter/lib/ui/semantics/semantics_node.h" #include "lib/app/cpp/application_context.h" -#include "lib/fxl/macros.h" +#include "lib/context/fidl/context_writer.fidl.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/stringbuffer.h" #include "third_party/rapidjson/rapidjson/writer.h" -namespace flutter_runner { +namespace flutter { -AccessibilityBridge::AccessibilityBridge(component::ApplicationContext* context) - : writer_(context->ConnectToEnvironmentService()) {} +AccessibilityBridge::AccessibilityBridge(maxwell::ContextWriterPtr writer) + : writer_(std::move(writer)) {} + +AccessibilityBridge::~AccessibilityBridge() = default; void AccessibilityBridge::UpdateSemantics( const blink::SemanticsNodeUpdates& update) { @@ -77,4 +78,4 @@ void AccessibilityBridge::EraseUnvisitedNodes( } } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h index 7ac54e754d9b6..dde8bfaa54c36 100644 --- a/content_handler/accessibility_bridge.h +++ b/content_handler/accessibility_bridge.h @@ -2,28 +2,32 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ -#define FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ +#pragma once #include #include "flutter/lib/ui/semantics/semantics_node.h" -#include "lib/app/cpp/application_context.h" -#include +#include "lib/context/fidl/context_writer.fidl.h" +#include "lib/fxl/macros.h" -namespace flutter_runner { +namespace flutter { // Maintain an up-to-date list of SemanticsNodes on screen, and communicate // with the Context Service. -class AccessibilityBridge { +class AccessibilityBridge final { public: - explicit AccessibilityBridge(component::ApplicationContext* context); + AccessibilityBridge(maxwell::ContextWriterPtr writer); + + ~AccessibilityBridge(); // Update the internal representation of the semantics nodes, and write the // semantics to Context Service. void UpdateSemantics(const blink::SemanticsNodeUpdates& update); private: + maxwell::ContextWriterPtr writer_; + std::map semantics_nodes_; + // Walk the semantics node tree starting at |id|, and store the id of each // visited child in |visited_nodes|. void UpdateVisitedForNodeAndChildren(const int id, @@ -33,10 +37,7 @@ class AccessibilityBridge { // |visited_nodes|. void EraseUnvisitedNodes(const std::vector& visited_nodes); - std::map semantics_nodes_; - modular::ContextWriterPtr writer_; + FXL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); }; -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ +} // namespace flutter diff --git a/content_handler/app.cc b/content_handler/app.cc deleted file mode 100644 index 1f1bde833d2f3..0000000000000 --- a/content_handler/app.cc +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/app.h" - -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" -#include "flutter/content_handler/fuchsia_font_manager.h" -#include "flutter/lib/ui/text/font_collection.h" -#include "flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" -#include "lib/icu_data/cpp/icu_data.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace flutter_runner { -namespace { - -static App* g_app = nullptr; - -void QuitMessageLoop() { - fsl::MessageLoop::GetCurrent()->QuitNow(); -} - -std::string GetLabelFromURL(const std::string& url) { - size_t last_slash = url.rfind('/'); - if (last_slash == std::string::npos || last_slash + 1 == url.length()) - return url; - return url.substr(last_slash + 1); -} - -} // namespace - -App::App() { - g_app = this; - context_ = component::ApplicationContext::CreateFromStartupInfo(); - - gpu_thread_ = std::make_unique(); - io_thread_ = std::make_unique(); - - auto gpu_thread_success = gpu_thread_->Run(); - auto io_thread_success = io_thread_->Run(); - - FXL_CHECK(gpu_thread_success) << "Must be able to create the GPU thread"; - FXL_CHECK(io_thread_success) << "Must be able to create the IO thread"; - - auto ui_task_runner = fsl::MessageLoop::GetCurrent()->task_runner(); - auto gpu_task_runner = gpu_thread_->TaskRunner(); - auto io_task_runner = io_thread_->TaskRunner(); - - // Notice that the Platform and UI threads are actually the same. - blink::Threads::Set(blink::Threads(ui_task_runner, // Platform - gpu_task_runner, // GPU - ui_task_runner, // UI - io_task_runner // IO - )); - - if (!icu_data::Initialize(context_.get())) { - FXL_LOG(ERROR) << "Could not initialize ICU data."; - } - - blink::Settings settings; - settings.enable_observatory = true; - blink::Settings::Set(settings); - - fonts::FontProviderPtr font_provider( - context_->ConnectToEnvironmentService()); - if (settings.using_blink) { - blink::SetFontProvider(std::move(font_provider)); - } else { - blink::FontCollection::ForProcess().GetFontCollection()-> - SetAssetFontManager( - sk_make_sp(std::move(font_provider))); - } - - context_->outgoing_services()->AddService( - [this](fidl::InterfaceRequest request) { - runner_bindings_.AddBinding(this, std::move(request)); - }); -} - -App::~App() { - icu_data::Release(); - blink::Threads::Gpu()->PostTask(QuitMessageLoop); - blink::Threads::IO()->PostTask(QuitMessageLoop); - g_app = nullptr; -} - -App& App::Shared() { - FXL_DCHECK(g_app); - return *g_app; -} - -void App::WaitForPlatformViewIds( - std::vector* platform_view_ids) { - fxl::AutoResetWaitableEvent latch; - - blink::Threads::UI()->PostTask([this, platform_view_ids, &latch]() { - WaitForPlatformViewsIdsUIThread(platform_view_ids, &latch); - }); - - latch.Wait(); -} - -void App::WaitForPlatformViewsIdsUIThread( - std::vector* platform_view_ids, - fxl::AutoResetWaitableEvent* latch) { - for (auto it = controllers_.begin(); it != controllers_.end(); it++) { - ApplicationControllerImpl* controller = it->first; - - if (!controller) { - continue; - } - - PlatformViewInfo info; - // TODO(zra): We should create real IDs for these instead of relying on the - // address of the controller. Maybe just use the UI Isolate main port? - info.view_id = reinterpret_cast(controller); - info.isolate_id = controller->GetUIIsolateMainPort(); - info.isolate_name = controller->GetUIIsolateName(); - platform_view_ids->push_back(info); - } - latch->Signal(); -} - -void App::StartApplication( - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) { - if (controllers_.empty()) { - // Name this process after the url of the first application being launched. - base_label_ = "flutter:" + GetLabelFromURL(startup_info.launch_info.url); - } - - std::unique_ptr impl = - std::make_unique(this, std::move(application), - std::move(startup_info), - std::move(controller)); - ApplicationControllerImpl* key = impl.get(); - controllers_.emplace(key, std::move(impl)); - - UpdateProcessLabel(); -} - -void App::Destroy(ApplicationControllerImpl* controller) { - auto it = controllers_.find(controller); - if (it == controllers_.end()) - return; - controllers_.erase(it); - UpdateProcessLabel(); -} - -void App::UpdateProcessLabel() { - std::string label; - if (controllers_.size() < 2) { - label = base_label_; - } else { - std::string suffix = " (+" + std::to_string(controllers_.size() - 1) + ")"; - if (base_label_.size() + suffix.size() <= ZX_MAX_NAME_LEN - 1) { - label = base_label_ + suffix; - } else { - label = base_label_.substr(0, ZX_MAX_NAME_LEN - 1 - suffix.size() - 3) + - "..." + suffix; - } - } - zx::process::self().set_property(ZX_PROP_NAME, label.c_str(), label.size()); -} - -} // namespace flutter_runner diff --git a/content_handler/app.h b/content_handler/app.h deleted file mode 100644 index dc8c49927d897..0000000000000 --- a/content_handler/app.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_APP_H_ -#define FLUTTER_CONTENT_HANDLER_APP_H_ - -#include -#include - -#include "flutter/content_handler/application_controller_impl.h" -#include "lib/app/cpp/application_context.h" -#include -#include "lib/fsl/threading/thread.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/synchronization/waitable_event.h" - -namespace flutter_runner { - -class App : public component::ApplicationRunner { - public: - App(); - ~App(); - - static App& Shared(); - - // |component::ApplicationRunner| implementation: - - void StartApplication( - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) override; - - void Destroy(ApplicationControllerImpl* controller); - - struct PlatformViewInfo { - uintptr_t view_id; - int64_t isolate_id; - std::string isolate_name; - }; - - void WaitForPlatformViewIds(std::vector* platform_view_ids); - - private: - void WaitForPlatformViewsIdsUIThread( - std::vector* platform_view_ids, - fxl::AutoResetWaitableEvent* latch); - void UpdateProcessLabel(); - - std::unique_ptr context_; - std::unique_ptr gpu_thread_; - std::unique_ptr io_thread_; - fidl::BindingSet runner_bindings_; - std::unordered_map> - controllers_; - std::string base_label_; - - FXL_DISALLOW_COPY_AND_ASSIGN(App); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_APP_H_ diff --git a/content_handler/application.cc b/content_handler/application.cc new file mode 100644 index 0000000000000..7dd2270d42317 --- /dev/null +++ b/content_handler/application.cc @@ -0,0 +1,313 @@ +// Copyright 2018 The Fuchsia 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 "application.h" + +#include +#include + +#include + +#include "flutter/shell/common/switches.h" +#include "lib/fsl/vmo/file.h" +#include "lib/fsl/vmo/vector.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "task_observers.h" + +namespace flutter { + +std::pair, std::unique_ptr> +Application::Create( + Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller) { + auto thread = std::make_unique(); + std::unique_ptr application; + + fxl::AutoResetWaitableEvent latch; + thread->TaskRunner()->PostTask([&]() mutable { + application.reset(new Application(delegate, // + std::move(package), // + std::move(startup_info), // + std::move(controller) // + )); + latch.Signal(); + }); + thread->Run(); + latch.Wait(); + return {std::move(thread), std::move(application)}; +} + +static std::string DebugLabelForURL(const std::string url) { + auto found = url.rfind("/"); + if (found == std::string::npos) { + return url; + } else { + return {url, found + 1}; + } +} + +Application::Application( + Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest + application_controller_request) + : delegate_(delegate), + debug_label_(DebugLabelForURL(startup_info->launch_info->url)), + application_controller_(this) { + application_controller_.set_error_handler([this]() { Kill(); }); + + FXL_DCHECK(fdio_ns_.is_valid()); + // ApplicationLaunchInfo::url non-optional. + auto& launch_info = startup_info->launch_info; + + // ApplicationLaunchInfo::arguments optional. + if (auto& arguments = launch_info->arguments) { + settings_ = shell::SettingsFromCommandLine( + fxl::CommandLineFromIterators(arguments->begin(), arguments->end())); + } + + // TODO: ApplicationLaunchInfo::out optional. + + // TODO: ApplicationLaunchInfo::err optional. + + // ApplicationLaunchInfo::service_request optional. + if (launch_info->directory_request) { + service_provider_bridge_.ServeDirectory( + std::move(launch_info->directory_request)); + } + + // ApplicationLaunchInfo::flat_namespace optional. + if (auto& flat_namespace = startup_info->flat_namespace) { + for (size_t i = 0; i < flat_namespace->paths->size(); ++i) { + const auto& path = flat_namespace->paths->at(i); + if (path == "/svc") { + continue; + } + + zx::channel dir = std::move(flat_namespace->directories->at(i)); + zx_handle_t dir_handle = dir.release(); + if (fdio_ns_bind(fdio_ns_.get(), path->data(), dir_handle) != ZX_OK) { + FXL_DLOG(ERROR) << "Could not bind path to namespace: " << path; + zx_handle_close(dir_handle); + } + } + } else { + FXL_DLOG(ERROR) << "There was no flat namespace."; + } + + application_directory_.reset(fdio_ns_opendir(fdio_ns_.get())); + FXL_DCHECK(application_directory_.is_valid()); + + application_assets_directory_.reset( + openat(application_directory_.get(), "pkg/data", O_RDONLY | O_DIRECTORY)); + + // TODO: ApplicationLaunchInfo::additional_services optional. + + // ApplicationPackage::data: This is legacy FLX data. Ensure that we dont have + // any. + FXL_DCHECK(!package->data) << "Legacy FLX data must not be supplied."; + + // All launch arguments have been read. Perform service binding and + // final settings configuration. The next call will be to create a view + // for this application. + + service_provider_bridge_.AddService( + std::bind(&Application::CreateShellForView, this, std::placeholders::_1)); + + component::ServiceProviderPtr outgoing_services; + outgoing_services_request_ = outgoing_services.NewRequest(); + service_provider_bridge_.set_backend(std::move(outgoing_services)); + + // Setup the application controller binding. + if (application_controller_request) { + application_controller_.Bind(std::move(application_controller_request)); + } + + application_context_ = + component::ApplicationContext::CreateFrom(std::move(startup_info)); + + settings_.enable_observatory = true; + + settings_.icu_data_path = ""; + + settings_.using_blink = false; + + settings_.assets_dir = application_assets_directory_.get(); + + settings_.script_snapshot_path = "snapshot_blob.bin"; + + settings_.log_tag = debug_label_ + std::string{"(flutter)"}; + +#ifndef NDEBUG + // Debug mode + settings_.dart_non_checked_mode = false; +#else // NDEBUG + // Release mode + settings_.dart_non_checked_mode = true; +#endif // NDEBUG + + settings_.task_observer_add = + std::bind(&CurrentMessageLoopAddAfterTaskObserver, std::placeholders::_1, + std::placeholders::_2); + + settings_.task_observer_remove = std::bind( + &CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1); + + AttemptVMLaunchWithCurrentSettings(settings_); +} + +Application::~Application() = default; + +void Application::AttemptVMLaunchWithCurrentSettings( + const blink::Settings& settings) const { + if (blink::DartVM::ForProcessIfInitialized()) { + return; + } + + if (!blink::DartVM::IsRunningPrecompiledCode()) { + // We will be initializing the VM lazily in this case. + return; + } + + fsl::SizedVmo dylib_vmo; + + if (!fsl::VmoFromFilenameAt( + application_assets_directory_.get() /* /pkg/data */, "libapp.so", + &dylib_vmo)) { + FXL_LOG(ERROR) << "Dylib containing VM and isolate snapshots does not " + "exist. Will not be able to launch VM."; + return; + } + + dlerror(); + + auto library_handle = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); + + if (library_handle == nullptr) { + FXL_LOG(ERROR) << "Could not open dylib: " << dlerror(); + return; + } + + auto lib = fxl::MakeRefCounted( + library_handle, // library handle + true // close the handle when done + ); + + auto symbol = [](const char* str) { + return std::string{"_"} + std::string{str}; + }; + + fxl::RefPtr vm_snapshot = + fxl::MakeRefCounted( + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kVMDataSymbol).c_str()), + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kVMInstructionsSymbol).c_str())); + + fxl::RefPtr isolate_snapshot = + fxl::MakeRefCounted( + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kIsolateDataSymbol).c_str()), + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, + symbol(blink::DartSnapshot::kIsolateInstructionsSymbol).c_str())); + + blink::DartVM::ForProcess(settings_, // + std::move(vm_snapshot), // + std::move(isolate_snapshot) // + ); + if (blink::DartVM::ForProcessIfInitialized()) { + FXL_DLOG(INFO) << "VM successfully initialized for AOT mode."; + } else { + FXL_LOG(ERROR) << "VM could not be initialized for AOT mode."; + } +} + +// |component::ApplicationController| +void Application::Kill() { + if (last_return_code_.first) { + for (auto wait_callback : wait_callbacks_) { + wait_callback(last_return_code_.second); + } + } + wait_callbacks_.clear(); + + delegate_.OnApplicationTerminate(this); + // WARNING: Don't do anything past this point as this instance may have been + // collected. +} + +// |component::ApplicationController| +void Application::Detach() { + application_controller_.set_error_handler(nullptr); +} + +// |component::ApplicationController| +void Application::Wait(const WaitCallback& callback) { + wait_callbacks_.emplace_back(std::move(callback)); +} + +// |flutter::Engine::Delegate| +void Application::OnEngineTerminate(const Engine* shell_holder) { + auto found = std::find_if(shell_holders_.begin(), shell_holders_.end(), + [shell_holder](const auto& holder) { + return holder.get() == shell_holder; + }); + + if (found == shell_holders_.end()) { + return; + } + + // We may launch multiple shell in this application. However, we will + // terminate when the last shell goes away. The error code return to the + // application controller will be the last isolate that had an error. + auto return_code = shell_holder->GetEngineReturnCode(); + if (return_code.first) { + last_return_code_ = return_code; + } + + shell_holders_.erase(found); + + if (shell_holders_.size() == 0) { + Kill(); + // WARNING: Don't do anything past this point because the delegate may have + // collected this instance via the termination callback. + } +} + +void Application::CreateShellForView( + f1dl::InterfaceRequest view_provider_request) { + shells_bindings_.AddBinding(this, std::move(view_provider_request)); +} + +// |mozart::ViewProvider| +void Application::CreateView( + f1dl::InterfaceRequest view_owner, + f1dl::InterfaceRequest) { + if (!application_context_) { + FXL_DLOG(ERROR) << "Application context was invalid when attempting to " + "create a shell for a view provider request."; + return; + } + + // This method may be called multiple times. Care must be taken to ensure that + // all arguments can be accessed or synthesized multiple times. + // TODO(chinmaygarde): Figure out how to re-create the outgoing service + // request handle. + shell_holders_.emplace(std::make_unique( + *this, // delegate + debug_label_, // thread label + *application_context_, // application context + settings_, // settings + std::move(view_owner), // view owner + fdio_ns_, // FDIO namespace + std::move(outgoing_services_request_) // outgoing request + )); +} + +} // namespace flutter diff --git a/content_handler/application.h b/content_handler/application.h new file mode 100644 index 0000000000000..e4f5da105cac8 --- /dev/null +++ b/content_handler/application.h @@ -0,0 +1,97 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include +#include +#include + +#include "engine.h" +#include "flutter/common/settings.h" +#include "lib/app/cpp/application_context.h" +#include "lib/app/fidl/application_controller.fidl.h" +#include "lib/fidl/cpp/bindings/binding_set.h" +#include "lib/fsl/threading/thread.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" +#include "lib/svc/cpp/service_provider_bridge.h" +#include "lib/ui/views/fidl/view_provider.fidl.h" +#include "unique_fdio_ns.h" + +namespace flutter { + +// Represents an instance of a Flutter application that contains one of more +// Flutter engine instances. +class Application final : public Engine::Delegate, + public component::ApplicationController, + public mozart::ViewProvider { + public: + class Delegate { + public: + virtual void OnApplicationTerminate(const Application* application) = 0; + }; + + // Creates a dedicated thread to run the application and constructions the + // application on it. The application can be accessed only on this thread. + // This is a synchronous operation. + static std::pair, std::unique_ptr> + Create(Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller); + + // Must be called on the same thread returned from the create call. The thread + // may be collected after. + ~Application(); + + private: + blink::Settings settings_; + Delegate& delegate_; + const std::string debug_label_; + UniqueFDIONS fdio_ns_ = UniqueFDIONSCreate(); + fxl::UniqueFD application_directory_; + fxl::UniqueFD application_assets_directory_; + f1dl::Binding application_controller_; + f1dl::InterfaceRequest outgoing_services_request_; + component::ServiceProviderBridge service_provider_bridge_; + std::unique_ptr application_context_; + f1dl::BindingSet shells_bindings_; + std::set> shell_holders_; + std::vector wait_callbacks_; + std::pair last_return_code_; + + Application( + Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller); + + // |component::ApplicationController| + void Kill() override; + + // |component::ApplicationController| + void Detach() override; + + // |component::ApplicationController| + void Wait(const WaitCallback& callback) override; + + // |mozart::ViewProvider| + void CreateView( + f1dl::InterfaceRequest view_owner, + f1dl::InterfaceRequest services) override; + + // |flutter::Engine::Delegate| + void OnEngineTerminate(const Engine* holder) override; + + void CreateShellForView( + f1dl::InterfaceRequest view_provider_request); + + void AttemptVMLaunchWithCurrentSettings( + const blink::Settings& settings) const; + + FXL_DISALLOW_COPY_AND_ASSIGN(Application); +}; + +} // namespace flutter diff --git a/content_handler/application_controller_impl.cc b/content_handler/application_controller_impl.cc deleted file mode 100644 index 9a1b449138a1b..0000000000000 --- a/content_handler/application_controller_impl.cc +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/application_controller_impl.h" - -#include - -#include -#include - -#include "flutter/content_handler/app.h" -#include "flutter/content_handler/runtime_holder.h" -#include "lib/app/cpp/connect.h" -#include "lib/fsl/vmo/vector.h" -#include "lib/fxl/logging.h" - -namespace flutter_runner { - -ApplicationControllerImpl::ApplicationControllerImpl( - App* app, - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) - : app_(app), binding_(this) { - if (controller.is_valid()) { - binding_.Bind(std::move(controller)); - binding_.set_error_handler([this] { - app_->Destroy(this); - // |this| has been deleted at this point. - }); - } - - std::vector bundle; - if (application.data) { - if (!fsl::VectorFromVmo(std::move(*application.data), &bundle)) { - FXL_LOG(ERROR) << "Failed to receive bundle."; - return; - } - } - - // TODO(jeffbrown): Decide what to do with command-line arguments and - // startup handles. - - if (startup_info.launch_info.directory_request.is_valid()) { - service_provider_bridge_.ServeDirectory( - std::move(startup_info.launch_info.directory_request)); - } - - service_provider_bridge_.AddService( - [this](fidl::InterfaceRequest request) { - view_provider_bindings_.AddBinding(this, std::move(request)); - }); - - component::ServiceProviderPtr service_provider; - auto request = service_provider.NewRequest(); - service_provider_bridge_.set_backend(std::move(service_provider)); - - fdio_ns_t* fdio_ns = SetupNamespace(&startup_info.flat_namespace); - if (fdio_ns == nullptr) { - FXL_LOG(ERROR) << "Failed to initialize namespace"; - return; - } - - url_ = startup_info.launch_info.url; - runtime_holder_.reset(new RuntimeHolder()); - runtime_holder_->SetMainIsolateShutdownCallback([this]() { Kill(); }); - runtime_holder_->Init( - fdio_ns, - component::ApplicationContext::CreateFrom(std::move(startup_info)), - std::move(request), std::move(bundle)); -} - -ApplicationControllerImpl::~ApplicationControllerImpl() = default; - -constexpr char kServiceRootPath[] = "/svc"; - -fdio_ns_t* ApplicationControllerImpl::SetupNamespace( - component::FlatNamespace* flat) { - fdio_ns_t* fdio_namespc; - zx_status_t status = fdio_ns_create(&fdio_namespc); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Failed to create namespace"; - return nullptr; - } - for (size_t i = 0; i < flat->paths->size(); ++i) { - if (flat->paths->at(i) == kServiceRootPath) { - // Ownership of /svc goes to the ApplicationContext created above. - continue; - } - zx::channel dir = std::move(flat->directories->at(i)); - zx_handle_t dir_handle = dir.release(); - const char* path = flat->paths->at(i)->data(); - status = fdio_ns_bind(fdio_namespc, path, dir_handle); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Failed to bind " << flat->paths->at(i) - << " to namespace"; - zx_handle_close(dir_handle); - fdio_ns_destroy(fdio_namespc); - return nullptr; - } - } - return fdio_namespc; -} - -void ApplicationControllerImpl::Kill() { - SendReturnCode(runtime_holder_->return_code()); - runtime_holder_.reset(); - app_->Destroy(this); - // |this| has been deleted at this point. -} - -void ApplicationControllerImpl::Detach() { - binding_.set_error_handler(fxl::Closure()); -} - -void ApplicationControllerImpl::Wait(WaitCallback callback) { - wait_callbacks_.push_back(std::move(callback)); -} - -void ApplicationControllerImpl::SendReturnCode(int32_t return_code) { - for (const auto& iter : wait_callbacks_) { - iter(return_code); - } - wait_callbacks_.clear(); -} - -void ApplicationControllerImpl::CreateView( - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services) { - runtime_holder_->CreateView(url_, std::move(view_owner_request), - std::move(services)); -} - -Dart_Port ApplicationControllerImpl::GetUIIsolateMainPort() { - if (!runtime_holder_) - return ILLEGAL_PORT; - return runtime_holder_->GetUIIsolateMainPort(); -} - -std::string ApplicationControllerImpl::GetUIIsolateName() { - if (!runtime_holder_) { - return ""; - } - return runtime_holder_->GetUIIsolateName(); -} - -} // namespace flutter_runner diff --git a/content_handler/application_controller_impl.h b/content_handler/application_controller_impl.h deleted file mode 100644 index 01700f2886ffb..0000000000000 --- a/content_handler/application_controller_impl.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ -#define FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ - -#include - -#include - -#include -#include -#include - -#include "lib/fidl/cpp/binding.h" -#include "lib/fidl/cpp/binding_set.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "lib/svc/cpp/service_provider_bridge.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace flutter_runner { -class App; -class RuntimeHolder; - -class ApplicationControllerImpl : public component::ApplicationController, - public views_v1::ViewProvider { - public: - ApplicationControllerImpl( - App* app, - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller); - - ~ApplicationControllerImpl() override; - - // |component::ApplicationController| implementation - - void Kill() override; - void Detach() override; - void Wait(WaitCallback callback) override; - - // |views_v1::ViewProvider| implementation - - void CreateView( - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services) override; - - Dart_Port GetUIIsolateMainPort(); - std::string GetUIIsolateName(); - - private: - void StartRuntimeIfReady(); - void SendReturnCode(int32_t return_code); - - fdio_ns_t* SetupNamespace(component::FlatNamespace* flat); - - App* app_; - fidl::Binding binding_; - - component::ServiceProviderBridge service_provider_bridge_; - - fidl::BindingSet view_provider_bindings_; - - std::string url_; - std::unique_ptr runtime_holder_; - - std::vector wait_callbacks_; - - FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationControllerImpl); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc new file mode 100644 index 0000000000000..2d77f43cbdd45 --- /dev/null +++ b/content_handler/application_runner.cc @@ -0,0 +1,90 @@ +// Copyright 2018 The Fuchsia 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 "application_runner.h" + +#include + +#include "flutter/lib/ui/text/font_collection.h" +#include "fuchsia_font_manager.h" +#include "lib/fonts/fidl/font_provider.fidl.h" +#include "lib/icu_data/cpp/icu_data.h" + +namespace flutter { + +ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) + : on_termination_callback_(std::move(on_termination_callback)), + host_context_(component::ApplicationContext::CreateFromStartupInfo()) { + SetupICU(); + + SetupGlobalFonts(); + + const std::string process_label = "flutter"; + zx::process::self().set_property(ZX_PROP_NAME, process_label.c_str(), + process_label.size()); + + host_context_->outgoing_services()->AddService( + std::bind(&ApplicationRunner::RegisterApplication, this, + std::placeholders::_1)); + + active_applications_bindings_.set_empty_set_handler( + [this]() { FireTerminationCallbackIfNecessary(); }); +} + +ApplicationRunner::~ApplicationRunner() { + host_context_->outgoing_services() + ->RemoveService(); +} + +void ApplicationRunner::RegisterApplication( + f1dl::InterfaceRequest request) { + active_applications_bindings_.AddBinding(this, std::move(request)); +} + +void ApplicationRunner::StartApplication( + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller) { + auto thread_application_pair = + Application::Create(*this, // delegate + std::move(package), // application pacakge + std::move(startup_info), // startup info + std::move(controller) // controller request + ); + active_applications_[thread_application_pair.second.get()] = + std::move(thread_application_pair); +} + +void ApplicationRunner::OnApplicationTerminate(const Application* application) { + active_applications_.erase(application); + FireTerminationCallbackIfNecessary(); +} + +void ApplicationRunner::SetupICU() { + if (!icu_data::Initialize(host_context_.get())) { + FXL_LOG(ERROR) << "Could not initialize ICU data."; + } +} + +void ApplicationRunner::SetupGlobalFonts() { + fonts::FontProviderPtr font_provider( + host_context_->ConnectToEnvironmentService()); + auto font_manager = + sk_make_sp(std::move(font_provider)); + blink::FontCollection::ForProcess() + .GetFontCollection() + ->SetDefaultFontManager(std::move(font_manager)); +} + +void ApplicationRunner::FireTerminationCallbackIfNecessary() { + // We have no reason to exist if: + // 1: No previously launched applications are running. + // 2: No bindings exist that may require launching more applications. + if (on_termination_callback_ && active_applications_.size() == 0 && + active_applications_bindings_.size() == 0) { + on_termination_callback_(); + } +} + +} // namespace flutter diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h new file mode 100644 index 0000000000000..fdf5b4420dc0f --- /dev/null +++ b/content_handler/application_runner.h @@ -0,0 +1,79 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include +#include + +#include "application.h" +#include "lib/app/cpp/application_context.h" +#include "lib/app/fidl/application_runner.fidl.h" +#include "lib/fidl/cpp/bindings/binding_set.h" +#include "lib/fsl/tasks/message_loop.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/macros.h" + +namespace flutter { + +// Publishes the |component::ApplicationRunner| service and runs applications on +// their own threads. +class ApplicationRunner final : public Application::Delegate, + public component::ApplicationRunner { + public: + ApplicationRunner(fxl::Closure on_termination_callback); + + ~ApplicationRunner(); + + private: + struct ActiveApplication { + std::unique_ptr thread; + std::unique_ptr application; + + ActiveApplication(std::pair, + std::unique_ptr> pair) + : thread(std::move(pair.first)), application(std::move(pair.second)) {} + + ActiveApplication() { + if (thread && application) { + thread->TaskRunner()->PostTask( + fxl::MakeCopyable([application = std::move(application)]() mutable { + application.reset(); + fsl::MessageLoop::GetCurrent()->PostQuitTask(); + })); + thread.reset(); // join + } + } + }; + + fxl::Closure on_termination_callback_; + std::unique_ptr host_context_; + f1dl::BindingSet active_applications_bindings_; + std::unordered_map + active_applications_; + + // |component::ApplicationRunner| + void StartApplication(component::ApplicationPackagePtr application, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest + controller) override; + + void RegisterApplication( + f1dl::InterfaceRequest request); + + void UnregisterApplication(const Application* application); + + // |Application::Delegate| + void OnApplicationTerminate(const Application* application) override; + + void SetupICU(); + + void SetupGlobalFonts(); + + void FireTerminationCallbackIfNecessary(); + + FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationRunner); +}; + +} // namespace flutter diff --git a/content_handler/compositor_context.cc b/content_handler/compositor_context.cc new file mode 100644 index 0000000000000..efad9ac2b9583 --- /dev/null +++ b/content_handler/compositor_context.cc @@ -0,0 +1,86 @@ +// Copyright 2018 The Fuchsia 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 "compositor_context.h" + +#include "flutter/flow/layers/layer_tree.h" +#include "flutter/glue/trace_event.h" + +namespace flutter { + +class ScopedFrame final : public flow::CompositorContext::ScopedFrame { + public: + ScopedFrame(flow::CompositorContext& context, + bool instrumentation_enabled, + SessionConnection& session_connection) + : flow::CompositorContext::ScopedFrame(context, + nullptr, + nullptr, + instrumentation_enabled), + session_connection_(session_connection) {} + + private: + SessionConnection& session_connection_; + + bool Raster(flow::LayerTree& layer_tree, bool ignore_raster_cache) override { + if (!session_connection_.has_metrics()) { + return true; + } + + { + // Preroll the Flutter layer tree. This allows Flutter to perform + // pre-paint optimizations. + TRACE_EVENT0("flutter", "Preroll"); + layer_tree.Preroll(*this, true /* ignore raster cache */); + } + + { + // Traverse the Flutter layer tree so that the necessary session ops to + // represent the frame are enqueued in the underlying session. + TRACE_EVENT0("flutter", "UpdateScene"); + layer_tree.UpdateScene(session_connection_.scene_update_context(), + session_connection_.root_node()); + } + + { + // Flush all pending session ops. + TRACE_EVENT0("flutter", "SessionPresent"); + session_connection_.Present(*this); + } + + return true; + } + + FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); +}; + +CompositorContext::CompositorContext( + const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback) + : debug_label_(std::move(debug_label)), + session_connection_(scenic, + debug_label_, + std::move(import_token), + std::move(session_metrics_did_change_callback), + std::move(session_error_callback)) {} + +CompositorContext::~CompositorContext() = default; + +std::unique_ptr +CompositorContext::AcquireFrame(GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled) { + // TODO: The AcquireFrame interface is too broad and must be refactored to get + // rid of the context and canvas arguments as those seem to be only used for + // colorspace correctness purposes on the mobile shells. + return std::make_unique(*this, // + instrumentation_enabled, // + session_connection_ // + ); +} + +} // namespace flutter diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h new file mode 100644 index 0000000000000..a6e5429c6072c --- /dev/null +++ b/content_handler/compositor_context.h @@ -0,0 +1,39 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "flutter/flow/compositor_context.h" +#include "garnet/public/lib/ui/scenic/fidl/scenic.fidl-common.h" +#include "lib/fxl/macros.h" +#include "session_connection.h" + +namespace flutter { + +// Holds composition specific state and bindings specific to composition on +// Fuchsia. +class CompositorContext final : public flow::CompositorContext { + public: + CompositorContext(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback); + + ~CompositorContext() override; + + private: + const std::string debug_label_; + SessionConnection session_connection_; + + // |flow::CompositorContext| + std::unique_ptr AcquireFrame( + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled) override; + + FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); +}; + +} // namespace flutter diff --git a/content_handler/engine.cc b/content_handler/engine.cc new file mode 100644 index 0000000000000..3349c09bdf1af --- /dev/null +++ b/content_handler/engine.cc @@ -0,0 +1,258 @@ +// Copyright 2018 The Fuchsia 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 "engine.h" + +#include + +#include "flutter/common/task_runners.h" +#include "flutter/fml/task_runner.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/run_configuration.h" +#include "lib/fsl/tasks/message_loop.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "platform_view.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace flutter { + +Engine::Engine(Delegate& delegate, + std::string thread_label, + component::ApplicationContext& application_context, + blink::Settings settings, + f1dl::InterfaceRequest view_owner, + const UniqueFDIONS& fdio_ns, + f1dl::InterfaceRequest + outgoing_services_request) + : delegate_(delegate), + thread_label_(std::move(thread_label)), + settings_(std::move(settings)), + weak_factory_(this) { + // Launch the threads that will be used to run the shell. These threads will + // be joined in the destructor. + for (auto& thread : host_threads_) { + thread.Run(); + } + + mozart::ViewManagerPtr view_manager; + application_context.ConnectToEnvironmentService(view_manager.NewRequest()); + + zx::eventpair import_token, export_token; + if (zx::eventpair::create(0u, &import_token, &export_token) != ZX_OK) { + FXL_DLOG(ERROR) << "Could not create event pair."; + return; + } + + // Setup the session connection. + ui::ScenicPtr scenic; + view_manager->GetScenic(scenic.NewRequest()); + + // Grab the parent environent services. The platform view may want to access + // some of these services. + component::ServiceProviderPtr parent_environment_service_provider; + application_context.environment()->GetServices( + parent_environment_service_provider.NewRequest()); + + // We need to manually schedule a frame when the session metrics change. + OnMetricsUpdate on_session_metrics_change_callback = std::bind( + &Engine::OnSessionMetricsDidChange, this, std::placeholders::_1); + + fxl::Closure on_session_error_callback = std::bind(&Engine::Terminate, this); + + // Grab the accessibilty context writer that can understand the semtics tree + // on the platform view. + maxwell::ContextWriterPtr accessibility_context_writer; + application_context.ConnectToEnvironmentService( + accessibility_context_writer.NewRequest()); + + // Setup the callback that will instantiate the platform view. + shell::Shell::CreateCallback on_create_platform_view = + fxl::MakeCopyable([debug_label = thread_label_, // + parent_environment_service_provider = + std::move(parent_environment_service_provider), // + view_manager = std::ref(view_manager), // + view_owner = std::move(view_owner), // + scenic = std::move(scenic), // + accessibility_context_writer = + std::move(accessibility_context_writer), // + export_token = std::move(export_token), // + import_token = std::move(import_token), // + on_session_metrics_change_callback, // + on_session_error_callback // + ](shell::Shell& shell) mutable { + return std::make_unique( + shell, // delegate + debug_label, // debug label + shell.GetTaskRunners(), // task runners + std::move(parent_environment_service_provider), // services + view_manager, // view manager + std::move(view_owner), // view owner + std::move(scenic), // scenic + std::move(export_token), // export token + std::move(import_token), // import token + std::move( + accessibility_context_writer), // accessibility context writer + std::move(on_session_metrics_change_callback), // metrics change + std::move(on_session_error_callback) // session_error + ); + }); + + // Setup the callback that will instantiate the rasterizer. + shell::Shell::CreateCallback on_create_rasterizer = + [](shell::Shell& shell) { + return std::make_unique( + shell.GetTaskRunners() // task runners + ); + }; + + // Get the task runners from the managed threads. The current thread will be + // used as the "platform" thread. + blink::TaskRunners task_runners( + thread_label_, // Dart thread labels + fsl::MessageLoop::GetCurrent()->task_runner(), // platform + host_threads_[0].TaskRunner(), // gpu + host_threads_[1].TaskRunner(), // ui + host_threads_[2].TaskRunner() // io + ); + + settings_.root_isolate_create_callback = + std::bind(&Engine::OnMainIsolateStart, this); + + settings_.root_isolate_shutdown_callback = + std::bind([weak = weak_factory_.GetWeakPtr(), + runner = task_runners.GetPlatformTaskRunner()]() { + runner->PostTask([weak = std::move(weak)] { + if (weak) { + weak->OnMainIsolateShutdown(); + } + }); + }); + + shell_ = shell::Shell::Create( + task_runners, // host task runners + settings_, // shell launch settings + on_create_platform_view, // platform view create callback + on_create_rasterizer // rasterizer create callback + ); + + if (!shell_) { + FXL_LOG(ERROR) << "Could not launch the shell with settings: " + << settings_.ToString(); + return; + } + + // Shell has been created. Before we run the engine, setup the isolate + // configurator. + { + PlatformView* platform_view = + static_cast(shell_->GetPlatformView().get()); + auto& view = platform_view->GetMozartView(); + component::ApplicationEnvironmentPtr application_environment; + application_context.ConnectToEnvironmentService( + application_environment.NewRequest()); + + isolate_configurator_ = std::make_unique( + fdio_ns, // + view, // + std::move(application_environment), // + std::move(outgoing_services_request) // + ); + } + + // This platform does not get a separate surface platform view creation + // notification. Fire one eagerly. + shell_->GetPlatformView()->NotifyCreated(); + + // Launch the engine in the appropriate configuration. + auto run_configuration = + shell::RunConfiguration::InferFromSettings(settings_); + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = shell_->GetEngine(), // + run_configuration = std::move(run_configuration) // + ]() mutable { + if (!engine || !engine->Run(std::move(run_configuration))) { + FXL_LOG(ERROR) << "Could not (re)launch the engine in configuration"; + } + })); + + UpdateNativeThreadLabelNames(); +} + +Engine::~Engine() { + for (const auto& thread : host_threads_) { + thread.TaskRunner()->PostTask( + []() { fsl::MessageLoop::GetCurrent()->PostQuitTask(); }); + } +} + +void Engine::UpdateNativeThreadLabelNames() const { + auto set_thread_name = [](fxl::RefPtr runner, + std::string prefix, std::string suffix) { + runner->PostTask([name = prefix + suffix]() { + zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); + }); + }; + auto runners = shell_->GetTaskRunners(); + set_thread_name(runners.GetPlatformTaskRunner(), thread_label_, ".platform"); + set_thread_name(runners.GetUITaskRunner(), thread_label_, ".ui"); + set_thread_name(runners.GetGPUTaskRunner(), thread_label_, ".gpu"); + set_thread_name(runners.GetIOTaskRunner(), thread_label_, ".io"); +} + +std::pair Engine::GetEngineReturnCode() const { + std::pair code(false, 0); + if (!shell_) { + return code; + } + fxl::AutoResetWaitableEvent latch; + fml::TaskRunner::RunNowOrPostTask( + shell_->GetTaskRunners().GetUITaskRunner(), + [&latch, &code, engine = shell_->GetEngine()]() { + if (engine) { + code = engine->GetUIIsolateReturnCode(); + } + latch.Signal(); + }); + latch.Wait(); + return code; +} + +void Engine::OnMainIsolateStart() { + if (!isolate_configurator_ || + !isolate_configurator_->ConfigureCurrentIsolate()) { + FXL_LOG(ERROR) << "Could not configure some native embedder bindings for a " + "new root isolate."; + } +} + +void Engine::OnMainIsolateShutdown() { + Terminate(); +} + +void Engine::Terminate() { + delegate_.OnEngineTerminate(this); + // Warning. Do not do anything after this point as the delegate may have + // collected this object. +} + +void Engine::OnSessionMetricsDidChange(double device_pixel_ratio) { + if (!shell_) { + return; + } + + shell_->GetTaskRunners().GetPlatformTaskRunner()->PostTask( + [platform_view = shell_->GetPlatformView(), device_pixel_ratio]() { + if (platform_view) { + reinterpret_cast(platform_view.get()) + ->UpdateViewportMetrics(device_pixel_ratio); + } + }); +} + +} // namespace flutter diff --git a/content_handler/engine.h b/content_handler/engine.h new file mode 100644 index 0000000000000..60c0ad7c2f80d --- /dev/null +++ b/content_handler/engine.h @@ -0,0 +1,63 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "flutter/shell/common/shell.h" +#include "isolate_configurator.h" +#include "lib/app/cpp/application_context.h" +#include "lib/fsl/threading/thread.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/ui/views/fidl/view_manager.fidl.h" + +namespace flutter { + +// Represents an instance of running Flutter engine along with the threads that +// host the same. +class Engine final { + public: + class Delegate { + public: + virtual void OnEngineTerminate(const Engine* holder) = 0; + }; + + Engine(Delegate& delegate, + std::string thread_label, + component::ApplicationContext& application_context, + blink::Settings settings, + f1dl::InterfaceRequest view_owner, + const UniqueFDIONS& fdio_ns, + f1dl::InterfaceRequest + outgoing_services_request); + + ~Engine(); + + // Returns the Dart return code for the root isolate if one is present. This + // call is thread safe and synchronous. This call must be made infrequently. + std::pair GetEngineReturnCode() const; + + private: + Delegate& delegate_; + const std::string thread_label_; + blink::Settings settings_; + std::array host_threads_; + std::unique_ptr isolate_configurator_; + std::unique_ptr shell_; + fxl::WeakPtrFactory weak_factory_; + + void OnMainIsolateStart(); + + void OnMainIsolateShutdown(); + + void Terminate(); + + void OnSessionMetricsDidChange(double device_pixel_ratio); + + void UpdateNativeThreadLabelNames() const; + + FXL_DISALLOW_COPY_AND_ASSIGN(Engine); +}; + +} // namespace flutter diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc index 4e409cae94f6a..877c931130eb4 100644 --- a/content_handler/fuchsia_font_manager.cc +++ b/content_handler/fuchsia_font_manager.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "flutter/content_handler/fuchsia_font_manager.h" +#include "fuchsia_font_manager.h" #include @@ -32,14 +32,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromBuffer(mem::Buffer data) { - if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || - data.size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { + if (!fsl::SizedVmo::IsSizeValid(vmo->vmo, vmo->size) || + vmo->size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = data.size; + uint64_t size = vmo->size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, vmo->vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -49,7 +49,7 @@ sk_sp MakeSkDataFromBuffer(mem::Buffer data) { fonts::FontSlant ToFontSlant(SkFontStyle::Slant slant) { return (slant == SkFontStyle::kItalic_Slant) ? fonts::FontSlant::ITALIC - : fonts::FontSlant::UPRIGHT; + : fonts::FontSlant::UPRIGHT; } } // anonymous namespace @@ -64,7 +64,8 @@ int FuchsiaFontManager::onCountFamilies() const { return 0; } -void FuchsiaFontManager::onGetFamilyName(int index, SkString* familyName) const { +void FuchsiaFontManager::onGetFamilyName(int index, + SkString* familyName) const { FXL_DCHECK(false); } @@ -87,12 +88,13 @@ SkFontStyleSet* FuchsiaFontManager::onMatchFamily( } SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( - const char family_name[], const SkFontStyle& style) const { - fonts::FontRequest request; - request.family = family_name; - request.weight = style.weight(); - request.width = style.width(); - request.slant = ToFontSlant(style.slant()); + const char family_name[], + const SkFontStyle& style) const { + auto request = fonts::FontRequest::New(); + request->family = family_name; + request->weight = style.weight(); + request->width = style.width(); + request->slant = ToFontSlant(style.slant()); fonts::FontResponsePtr response; font_provider_->GetFont( @@ -100,14 +102,13 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( [&response](fonts::FontResponsePtr r) { response = std::move(r); }); font_provider_.WaitForResponse(); - FXL_DCHECK(response) - << "Unable to contact the font provider. Did you run " - "Flutter in an environment that has a font manager?\n"; - - if (!response) + if (!response) { + FXL_DLOG(ERROR) << "Unable to contact the font provider. Did you run " + "Flutter in an environment that has a font manager?"; return nullptr; + } - sk_sp data = MakeSkDataFromBuffer(std::move(response->data.buffer)); + sk_sp data = MakeSkDataFromVMO(response->data->vmo); if (!data) return nullptr; @@ -127,13 +128,13 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyleCharacter( } SkTypeface* FuchsiaFontManager::onMatchFaceStyle(const SkTypeface*, - const SkFontStyle&) const { + const SkFontStyle&) const { FXL_DCHECK(false); return nullptr; } sk_sp FuchsiaFontManager::onMakeFromData(sk_sp, - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } @@ -153,7 +154,7 @@ sk_sp FuchsiaFontManager::onMakeFromStreamArgs( } sk_sp FuchsiaFontManager::onMakeFromFile(const char path[], - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } diff --git a/content_handler/fuchsia_font_manager.h b/content_handler/fuchsia_font_manager.h index e57d6ef76e72f..ecfb724b85878 100644 --- a/content_handler/fuchsia_font_manager.h +++ b/content_handler/fuchsia_font_manager.h @@ -26,7 +26,7 @@ namespace txt { -class FuchsiaFontManager : public SkFontMgr { +class FuchsiaFontManager final : public SkFontMgr { public: FuchsiaFontManager(fonts::FontProviderPtr provider); diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc new file mode 100644 index 0000000000000..d085bea698b95 --- /dev/null +++ b/content_handler/isolate_configurator.cc @@ -0,0 +1,114 @@ +// Copyright 2018 The Fuchsia 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 "isolate_configurator.h" + +#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" +#include "dart-pkg/zircon/sdk_ext/handle.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/ui/flutter/sdk_ext/src/natives.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace flutter { + +IsolateConfigurator::IsolateConfigurator( + const UniqueFDIONS& fdio_ns, + mozart::ViewPtr& view, + component::ApplicationEnvironmentPtr application_environment, + f1dl::InterfaceRequest + outgoing_services_request) + : fdio_ns_(fdio_ns), + view_(view), + application_environment_(std::move(application_environment)), + outgoing_services_request_(std::move(outgoing_services_request)) {} + +IsolateConfigurator::~IsolateConfigurator() = default; + +bool IsolateConfigurator::ConfigureCurrentIsolate() { + if (used_) { + return false; + } + used_ = true; + + BindFuchsia(); + BindZircon(); + BindDartIO(); + BindScenic(); + + return true; +} + +// |mozart::NativesDelegate| +mozart::View* IsolateConfigurator::GetMozartView() { + return view_.get(); +} + +void IsolateConfigurator::BindFuchsia() { + fuchsia::dart::Initialize(application_environment_.Unbind(), + std::move(outgoing_services_request_)); +} + +void IsolateConfigurator::BindZircon() { + // Tell dart:zircon about the FDIO namespace configured for this instance. + Dart_Handle zircon_lib = Dart_LookupLibrary(tonic::ToDart("dart:zircon")); + DART_CHECK_VALID(zircon_lib); + + Dart_Handle namespace_type = + Dart_GetType(zircon_lib, tonic::ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + DART_CHECK_VALID( + Dart_SetField(namespace_type, // + tonic::ToDart("_namespace"), // + tonic::ToDart(reinterpret_cast(fdio_ns_.get())))); +} + +void IsolateConfigurator::BindDartIO() { + // Grab the dart:io lib. + Dart_Handle io_lib = Dart_LookupLibrary(tonic::ToDart("dart:io")); + DART_CHECK_VALID(io_lib); + + // Disable dart:io exit() + Dart_Handle embedder_config_type = + Dart_GetType(io_lib, tonic::ToDart("_EmbedderConfig"), 0, nullptr); + DART_CHECK_VALID(embedder_config_type); + DART_CHECK_VALID(Dart_SetField(embedder_config_type, + tonic::ToDart("_mayExit"), Dart_False())); + + // Tell dart:io about the FDIO namespace configured for this instance. + Dart_Handle namespace_type = + Dart_GetType(io_lib, tonic::ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + Dart_Handle namespace_args[] = { + Dart_NewInteger(reinterpret_cast(fdio_ns_.get())), // + }; + DART_CHECK_VALID(namespace_args[0]); + DART_CHECK_VALID(Dart_Invoke(namespace_type, tonic::ToDart("_setupNamespace"), + 1, namespace_args)); +} + +void IsolateConfigurator::BindScenic() { + Dart_Handle mozart_internal = + Dart_LookupLibrary(tonic::ToDart("dart:mozart.internal")); + DART_CHECK_VALID(mozart_internal); + DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, // + mozart::NativeLookup, // + mozart::NativeSymbol) // + ); + DART_CHECK_VALID(Dart_SetField( + mozart_internal, // + tonic::ToDart("_context"), // + tonic::DartConverter::ToDart(reinterpret_cast( + static_cast(this))))); + mozart::ViewContainerPtr view_container; + view_->GetContainer(view_container.NewRequest()); + DART_CHECK_VALID( + Dart_SetField(mozart_internal, // + tonic::ToDart("_viewContainer"), // + tonic::ToDart(zircon::dart::Handle::Create( + view_container.Unbind().TakeChannel().release())))); +} + +} // namespace flutter diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h new file mode 100644 index 0000000000000..a5da083633ee7 --- /dev/null +++ b/content_handler/isolate_configurator.h @@ -0,0 +1,55 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "lib/app/fidl/application_environment.fidl.h" +#include "lib/fxl/macros.h" +#include "lib/ui/flutter/sdk_ext/src/natives.h" +#include "lib/ui/views/fidl/view_containers.fidl.h" +#include "lib/ui/views/fidl/views.fidl.h" +#include "unique_fdio_ns.h" + +namespace flutter { + +// Contains all the information necessary to configure a new root isolate. This +// is a single use item. The lifetime of this object must extend past that of +// the root isolate. +class IsolateConfigurator final : mozart::NativesDelegate { + public: + IsolateConfigurator( + const UniqueFDIONS& fdio_ns, + mozart::ViewPtr& view, + component::ApplicationEnvironmentPtr application_environment, + f1dl::InterfaceRequest + outgoing_services_request); + + ~IsolateConfigurator(); + + // Can be used only once and only on the UI thread with the newly created + // isolate already current. + bool ConfigureCurrentIsolate(); + + private: + bool used_ = false; + const UniqueFDIONS& fdio_ns_; + mozart::ViewPtr& view_; + component::ApplicationEnvironmentPtr application_environment_; + f1dl::InterfaceRequest outgoing_services_request_; + + // |mozart::NativesDelegate| + mozart::View* GetMozartView() override; + + void BindFuchsia(); + + void BindZircon(); + + void BindDartIO(); + + void BindScenic(); + + FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfigurator); +}; + +} // namespace flutter diff --git a/content_handler/main.cc b/content_handler/main.cc index d3eac3c81dcbf..15b8cede5b9b2 100644 --- a/content_handler/main.cc +++ b/content_handler/main.cc @@ -1,16 +1,26 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// Copyright 2018 The Fuchsia 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 +#include -#include "flutter/content_handler/app.h" +#include "application_runner.h" #include "lib/fsl/tasks/message_loop.h" -int main(int argc, const char** argv) { +int main(int argc, char const* argv[]) { fsl::MessageLoop loop; + trace::TraceProvider provider(loop.async()); - flutter_runner::App app; + FXL_DCHECK(provider.is_valid()) << "Trace provider must be valid."; + + FXL_LOG(INFO) << "Flutter application services initialized."; + flutter::ApplicationRunner runner([&loop]() { + loop.PostQuitTask(); + FXL_LOG(INFO) << "Flutter application services terminated. Good bye..."; + }); + loop.Run(); - return 0; + + return EXIT_SUCCESS; } diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc new file mode 100644 index 0000000000000..8ac41613e449b --- /dev/null +++ b/content_handler/platform_view.cc @@ -0,0 +1,551 @@ +// Copyright 2018 The Fuchsia 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 RAPIDJSON_HAS_STDSTRING 1 + +#include "platform_view.h" + +#include + +#include "flutter/lib/ui/window/pointer_data.h" +#include "lib/app/cpp/connect.h" +#include "third_party/rapidjson/rapidjson/document.h" +#include "third_party/rapidjson/rapidjson/stringbuffer.h" +#include "third_party/rapidjson/rapidjson/writer.h" + +namespace flutter { + +constexpr char kFlutterPlatformChannel[] = "flutter/platform"; +constexpr char kTextInputChannel[] = "flutter/textinput"; +constexpr char kKeyEventChannel[] = "flutter/keyevent"; + +PlatformView::PlatformView( + PlatformView::Delegate& delegate, + std::string debug_label, + blink::TaskRunners task_runners, + component::ServiceProviderPtr parent_environment_service_provider, + mozart::ViewManagerPtr& view_manager, + f1dl::InterfaceRequest view_owner, + ui::ScenicPtr scenic, + zx::eventpair export_token, + zx::eventpair import_token, + maxwell::ContextWriterPtr accessibility_context_writer, + OnMetricsUpdate on_session_metrics_did_change, + fxl::Closure session_error_callback) + : shell::PlatformView(delegate, std::move(task_runners)), + debug_label_(std::move(debug_label)), + view_listener_(this), + input_listener_(this), + ime_client_(this), + scenic_(std::move(scenic)), + accessibility_bridge_(std::move(accessibility_context_writer)), + surface_( + std::make_unique(scenic_, + debug_label_, + std::move(import_token), + std::move(on_session_metrics_did_change), + std::move(session_error_callback))) { + // Create the view. + view_manager->CreateView(view_.NewRequest(), // view + std::move(view_owner), // view owner + view_listener_.NewBinding(), // view listener + std::move(export_token), // export token + debug_label_ // diagnostic label + ); + + // Get the services from the created view. + component::ServiceProviderPtr service_provider; + view_->GetServiceProvider(service_provider.NewRequest()); + + // Get the input connection from the services of the view. + component::ConnectToService(service_provider.get(), + input_connection_.NewRequest()); + + // Set the input listener on the input connection. + input_connection_->SetEventListener(input_listener_.NewBinding()); + + // Access the clipboard. + component::ConnectToService(parent_environment_service_provider.get(), + clipboard_.NewRequest()); + + // Finally! Register the native platform message handlers. + RegisterPlatformMessageHandlers(); +} + +PlatformView::~PlatformView() = default; + +void PlatformView::RegisterPlatformMessageHandlers() { + platform_message_handlers_[kFlutterPlatformChannel] = + std::bind(&PlatformView::HandleFlutterPlatformChannelPlatformMessage, // + this, // + std::placeholders::_1); + platform_message_handlers_[kTextInputChannel] = + std::bind(&PlatformView::HandleFlutterTextInputChannelPlatformMessage, // + this, // + std::placeholders::_1); +} + +mozart::ViewPtr& PlatformView::GetMozartView() { + return view_; +} + +// |mozart::ViewListener| +void PlatformView::OnPropertiesChanged( + mozart::ViewPropertiesPtr properties, + const OnPropertiesChangedCallback& callback) { + UpdateViewportMetrics(properties->view_layout); + callback(); +} + +void PlatformView::UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout) { + if (!layout) { + return; + } + + metrics_.size.width = layout->size->width; + metrics_.size.height = layout->size->height; + + metrics_.padding.left = layout->inset->left; + metrics_.padding.top = layout->inset->top; + metrics_.padding.right = layout->inset->right; + metrics_.padding.bottom = layout->inset->bottom; + + FlushViewportMetrics(); +} + +void PlatformView::UpdateViewportMetrics(double pixel_ratio) { + metrics_.scale = pixel_ratio; + + FlushViewportMetrics(); +} + +void PlatformView::FlushViewportMetrics() { + const auto scale = metrics_.scale; + blink::ViewportMetrics metrics = { + .device_pixel_ratio = static_cast(scale), + + .physical_width = static_cast(metrics_.size.width * scale), + .physical_height = static_cast(metrics_.size.height * scale), + + .physical_padding_top = + static_cast(metrics_.padding.top * scale), + .physical_padding_right = + static_cast(metrics_.padding.right * scale), + .physical_padding_bottom = + static_cast(metrics_.padding.bottom * scale), + .physical_padding_left = + static_cast(metrics_.padding.left * scale), + + .physical_view_inset_top = + static_cast(metrics_.view_inset.top * scale), + .physical_view_inset_right = + static_cast(metrics_.view_inset.right * scale), + .physical_view_inset_bottom = + static_cast(metrics_.view_inset.bottom * scale), + .physical_view_inset_left = + static_cast(metrics_.view_inset.left * scale), + }; + + SetViewportMetrics(metrics); +} + +// |mozart::InputMethodEditorClient| +void PlatformView::DidUpdateState(mozart::TextInputStatePtr state, + mozart::InputEventPtr event) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + rapidjson::Value encoded_state(rapidjson::kObjectType); + encoded_state.AddMember("text", state->text.get(), allocator); + encoded_state.AddMember("selectionBase", state->selection->base, allocator); + encoded_state.AddMember("selectionExtent", state->selection->extent, + allocator); + switch (state->selection->affinity) { + case mozart::TextAffinity::UPSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.upstream"), + allocator); + break; + case mozart::TextAffinity::DOWNSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.downstream"), + allocator); + break; + } + encoded_state.AddMember("selectionIsDirectional", true, allocator); + encoded_state.AddMember("composingBase", state->composing->start, allocator); + encoded_state.AddMember("composingExtent", state->composing->end, allocator); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + args.PushBack(encoded_state, allocator); + + document.SetObject(); + document.AddMember("method", + rapidjson::Value("TextInputClient.updateEditingState"), + allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, // channel + std::vector(data, data + buffer.GetSize()), // message + nullptr) // response + ); +} + +// |mozart::InputMethodEditorClient| +void PlatformView::OnAction(mozart::InputMethodAction action) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + + // Done is currently the only text input action defined by Flutter. + args.PushBack("TextInputAction.done", allocator); + + document.SetObject(); + document.AddMember( + "method", rapidjson::Value("TextInputClient.performAction"), allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, // channel + std::vector(data, data + buffer.GetSize()), // message + nullptr) // response + ); +} + +// |mozart::InputListener| +void PlatformView::OnEvent(mozart::InputEventPtr event, + const OnEventCallback& callback) { + using Type = mozart::InputEvent::Tag; + switch (event->which()) { + case Type::POINTER: + callback(OnHandlePointerEvent(event->get_pointer())); + return; + case Type::KEYBOARD: + callback(OnHandleKeyboardEvent(event->get_keyboard())); + return; + case Type::FOCUS: + callback(OnHandleFocusEvent(event->get_focus())); + return; + case Type::__UNKNOWN__: + break; + } + + callback(false); +} + +static blink::PointerData::Change GetChangeFromPointerEventPhase( + mozart::PointerEvent::Phase phase) { + switch (phase) { + case mozart::PointerEvent::Phase::ADD: + return blink::PointerData::Change::kAdd; + case mozart::PointerEvent::Phase::HOVER: + return blink::PointerData::Change::kHover; + case mozart::PointerEvent::Phase::DOWN: + return blink::PointerData::Change::kDown; + case mozart::PointerEvent::Phase::MOVE: + return blink::PointerData::Change::kMove; + case mozart::PointerEvent::Phase::UP: + return blink::PointerData::Change::kUp; + case mozart::PointerEvent::Phase::REMOVE: + return blink::PointerData::Change::kRemove; + case mozart::PointerEvent::Phase::CANCEL: + return blink::PointerData::Change::kCancel; + default: + return blink::PointerData::Change::kCancel; + } +} + +static blink::PointerData::DeviceKind GetKindFromPointerType( + mozart::PointerEvent::Type type) { + switch (type) { + case mozart::PointerEvent::Type::TOUCH: + return blink::PointerData::DeviceKind::kTouch; + case mozart::PointerEvent::Type::MOUSE: + return blink::PointerData::DeviceKind::kMouse; + default: + return blink::PointerData::DeviceKind::kTouch; + } +} + +bool PlatformView::OnHandlePointerEvent( + const mozart::PointerEventPtr& pointer) { + blink::PointerData pointer_data; + pointer_data.time_stamp = pointer->event_time / 1000; + pointer_data.change = GetChangeFromPointerEventPhase(pointer->phase); + pointer_data.kind = GetKindFromPointerType(pointer->type); + pointer_data.device = pointer->pointer_id; + pointer_data.physical_x = pointer->x * metrics_.scale; + pointer_data.physical_y = pointer->y * metrics_.scale; + + switch (pointer_data.change) { + case blink::PointerData::Change::kDown: + down_pointers_.insert(pointer_data.device); + break; + case blink::PointerData::Change::kCancel: + case blink::PointerData::Change::kUp: + down_pointers_.erase(pointer_data.device); + break; + case blink::PointerData::Change::kMove: + if (down_pointers_.count(pointer_data.device) == 0) { + pointer_data.change = blink::PointerData::Change::kHover; + } + break; + case blink::PointerData::Change::kAdd: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received add event for down pointer."; + } + break; + case blink::PointerData::Change::kRemove: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received remove event for down pointer."; + } + break; + case blink::PointerData::Change::kHover: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received hover event for down pointer."; + } + break; + } + + auto packet = std::make_unique(1); + packet->SetPointerData(0, pointer_data); + DispatchPointerDataPacket(std::move(packet)); + return true; +} + +bool PlatformView::OnHandleKeyboardEvent( + const mozart::KeyboardEventPtr& keyboard) { + const char* type = nullptr; + if (keyboard->phase == mozart::KeyboardEvent::Phase::PRESSED) { + type = "keydown"; + } else if (keyboard->phase == mozart::KeyboardEvent::Phase::REPEAT) { + type = "keydown"; // TODO change this to keyrepeat + } else if (keyboard->phase == mozart::KeyboardEvent::Phase::RELEASED) { + type = "keyup"; + } + + if (type == nullptr) { + FXL_DLOG(ERROR) << "Unknown key event phase."; + return false; + } + + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + document.SetObject(); + document.AddMember("type", rapidjson::Value(type, strlen(type)), allocator); + document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); + document.AddMember("hidUsage", keyboard->hid_usage, allocator); + document.AddMember("codePoint", keyboard->code_point, allocator); + document.AddMember("modifiers", keyboard->modifiers, allocator); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + DispatchPlatformMessage(fxl::MakeRefCounted( + kKeyEventChannel, // channel + std::vector(data, data + buffer.GetSize()), // data + nullptr) // response + ); + + return true; +} + +bool PlatformView::OnHandleFocusEvent(const mozart::FocusEventPtr& focus) { + if (!focus->focused && current_text_input_client_ != 0) { + current_text_input_client_ = 0; + if (ime_) { + ime_->Hide(); + ime_ = nullptr; + } + if (ime_client_.is_bound()) { + ime_client_.Unbind(); + } + return true; + } + return false; +} + +// |shell::PlatformView| +std::unique_ptr PlatformView::CreateRenderingSurface() { + // This platform does not repeatly lose and gain a surface connection. So the + // surface is setup once during platform view setup and and returned to the + // shell on the initial (and only) |NotifyCreated| call. + return std::move(surface_); +} + +// |shell::PlatformView| +void PlatformView::HandlePlatformMessage( + fxl::RefPtr message) { + if (!message) { + return; + } + auto found = platform_message_handlers_.find(message->channel()); + if (found == platform_message_handlers_.end()) { + FXL_DLOG(ERROR) + << "Platform view received message on channel '" << message->channel() + << "' with no registed handler. And empty response will be generated. " + "Please implement the native message handler."; + PlatformView::HandlePlatformMessage(std::move(message)); + return; + } + found->second(std::move(message)); +} + +// |shell::PlatformView| +void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) { + accessibility_bridge_.UpdateSemantics(update); +} + +// Channel handler for kFlutterPlatformChannel +void PlatformView::HandleFlutterPlatformChannelPlatformMessage( + fxl::RefPtr message) { + FXL_DCHECK(message->channel() == kFlutterPlatformChannel); + const auto& data = message->data(); + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) { + return; + } + + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) { + return; + } + + fxl::RefPtr response = message->response(); + if (method->value == "Clipboard.setData") { + auto text = root["args"]["text"].GetString(); + clipboard_->Push(text); + response->CompleteEmpty(); + } else if (method->value == "Clipboard.getData") { + clipboard_->Peek([response](const f1dl::String& text) { + rapidjson::StringBuffer json_buffer; + rapidjson::Writer writer(json_buffer); + writer.StartArray(); + writer.StartObject(); + writer.Key("text"); + writer.String(text); + writer.EndObject(); + writer.EndArray(); + std::string result = json_buffer.GetString(); + response->Complete(std::vector{result.begin(), result.end()}); + }); + } else { + response->CompleteEmpty(); + } +} + +// Channel handler for kTextInputChannel +void PlatformView::HandleFlutterTextInputChannelPlatformMessage( + fxl::RefPtr message) { + FXL_DCHECK(message->channel() == kTextInputChannel); + const auto& data = message->data(); + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) { + return; + } + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) { + return; + } + + if (method->value == "TextInput.show") { + if (ime_) { + ime_->Show(); + } + } else if (method->value == "TextInput.hide") { + if (ime_) { + ime_->Hide(); + } + } else if (method->value == "TextInput.setClient") { + current_text_input_client_ = 0; + if (ime_client_.is_bound()) + ime_client_.Unbind(); + ime_ = nullptr; + + auto args = root.FindMember("args"); + if (args == root.MemberEnd() || !args->value.IsArray() || + args->value.Size() != 2) + return; + const auto& configuration = args->value[1]; + if (!configuration.IsObject()) { + return; + } + // TODO(abarth): Read the keyboard type from the configuration. + current_text_input_client_ = args->value[0].GetInt(); + mozart::TextInputStatePtr state = mozart::TextInputState::New(); + state->text = std::string(); + state->selection = mozart::TextSelection::New(); + state->composing = mozart::TextRange::New(); + input_connection_->GetInputMethodEditor( + mozart::KeyboardType::TEXT, mozart::InputMethodAction::DONE, + std::move(state), ime_client_.NewBinding(), ime_.NewRequest()); + } else if (method->value == "TextInput.setEditingState") { + if (ime_) { + auto args_it = root.FindMember("args"); + if (args_it == root.MemberEnd() || !args_it->value.IsObject()) { + return; + } + const auto& args = args_it->value; + mozart::TextInputStatePtr state = mozart::TextInputState::New(); + state->selection = mozart::TextSelection::New(); + state->composing = mozart::TextRange::New(); + // TODO(abarth): Deserialize state. + auto text = args.FindMember("text"); + if (text != args.MemberEnd() && text->value.IsString()) + state->text = text->value.GetString(); + auto selection_base = args.FindMember("selectionBase"); + if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) + state->selection->base = selection_base->value.GetInt(); + auto selection_extent = args.FindMember("selectionExtent"); + if (selection_extent != args.MemberEnd() && + selection_extent->value.IsInt()) + state->selection->extent = selection_extent->value.GetInt(); + auto selection_affinity = args.FindMember("selectionAffinity"); + if (selection_affinity != args.MemberEnd() && + selection_affinity->value.IsString() && + selection_affinity->value == "TextAffinity.upstream") + state->selection->affinity = mozart::TextAffinity::UPSTREAM; + else + state->selection->affinity = mozart::TextAffinity::DOWNSTREAM; + // We ignore selectionIsDirectional because that concept doesn't exist on + // Fuchsia. + auto composing_base = args.FindMember("composingBase"); + if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) + state->composing->start = composing_base->value.GetInt(); + auto composing_extent = args.FindMember("composingExtent"); + if (composing_extent != args.MemberEnd() && + composing_extent->value.IsInt()) + state->composing->end = composing_extent->value.GetInt(); + ime_->SetState(std::move(state)); + } + } else if (method->value == "TextInput.clearClient") { + current_text_input_client_ = 0; + if (ime_client_.is_bound()) + ime_client_.Unbind(); + ime_ = nullptr; + } else { + FXL_DLOG(ERROR) << "Unknown " << message->channel() << " method " + << method->value.GetString(); + } +} + +} // namespace flutter diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h new file mode 100644 index 0000000000000..9888d061352bb --- /dev/null +++ b/content_handler/platform_view.h @@ -0,0 +1,120 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include +#include + +#include "accessibility_bridge.h" +#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/shell/common/platform_view.h" +#include "lib/clipboard/fidl/clipboard.fidl.h" +#include "lib/fidl/cpp/bindings/binding.h" +#include "lib/fxl/macros.h" +#include "lib/ui/input/fidl/input_connection.fidl.h" +#include "lib/ui/views/fidl/view_manager.fidl.h" +#include "lib/ui/views/fidl/views.fidl.h" +#include "surface.h" + +namespace flutter { + +// The per engine component residing on the platform thread is responsible for +// all platform specific integrations. +class PlatformView final : public shell::PlatformView, + public mozart::ViewListener, + public mozart::InputMethodEditorClient, + public mozart::InputListener { + public: + PlatformView( + PlatformView::Delegate& delegate, + std::string debug_label, + blink::TaskRunners task_runners, + component::ServiceProviderPtr parent_environment_service_provider, + mozart::ViewManagerPtr& view_manager, + f1dl::InterfaceRequest view_owner, + ui::ScenicPtr scenic, + zx::eventpair export_token, + zx::eventpair import_token, + maxwell::ContextWriterPtr accessibility_context_writer, + OnMetricsUpdate on_session_metrics_did_change, + fxl::Closure session_error_callback); + + ~PlatformView(); + + void UpdateViewportMetrics(double pixel_ratio); + + mozart::ViewPtr& GetMozartView(); + + private: + const std::string debug_label_; + mozart::ViewPtr view_; + f1dl::Binding view_listener_; + mozart::InputConnectionPtr input_connection_; + f1dl::Binding input_listener_; + int current_text_input_client_ = 0; + f1dl::Binding ime_client_; + mozart::InputMethodEditorPtr ime_; + modular::ClipboardPtr clipboard_; + ui::ScenicPtr scenic_; + AccessibilityBridge accessibility_bridge_; + std::unique_ptr surface_; + blink::LogicalMetrics metrics_; + std::set down_pointers_; + std::map< + std::string /* channel */, + std::function /* message */)> /* handler */> + platform_message_handlers_; + + void RegisterPlatformMessageHandlers(); + + void UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout); + + void FlushViewportMetrics(); + + // |mozart::ViewListener| + void OnPropertiesChanged( + mozart::ViewPropertiesPtr properties, + const OnPropertiesChangedCallback& callback) override; + + // |mozart::InputMethodEditorClient| + void DidUpdateState(mozart::TextInputStatePtr state, + mozart::InputEventPtr event) override; + + // |mozart::InputMethodEditorClient| + void OnAction(mozart::InputMethodAction action) override; + + // |mozart::InputListener| + void OnEvent(mozart::InputEventPtr event, + const OnEventCallback& callback) override; + + bool OnHandlePointerEvent(const mozart::PointerEventPtr& pointer); + + bool OnHandleKeyboardEvent(const mozart::KeyboardEventPtr& keyboard); + + bool OnHandleFocusEvent(const mozart::FocusEventPtr& focus); + + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; + + // |shell::PlatformView| + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + // Channel handler for kFlutterPlatformChannel + void HandleFlutterPlatformChannelPlatformMessage( + fxl::RefPtr message); + + // Channel handler for kTextInputChannel + void HandleFlutterTextInputChannelPlatformMessage( + fxl::RefPtr message); + + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); +}; + +} // namespace flutter diff --git a/content_handler/rasterizer.cc b/content_handler/rasterizer.cc deleted file mode 100644 index b720809b17a45..0000000000000 --- a/content_handler/rasterizer.cc +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/rasterizer.h" -#include "flutter/content_handler/vulkan_rasterizer.h" - -namespace flutter_runner { - -Rasterizer::~Rasterizer() = default; - -std::unique_ptr Rasterizer::Create() { - auto vulkan_rasterizer = std::make_unique(); - FXL_CHECK(vulkan_rasterizer) - << "The vulkan rasterizer must be correctly initialized."; - return vulkan_rasterizer; -} - -} // namespace flutter_runner diff --git a/content_handler/rasterizer.h b/content_handler/rasterizer.h deleted file mode 100644 index 398f262a568cd..0000000000000 --- a/content_handler/rasterizer.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ -#define FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ - -#include - -#include - -#include "flutter/flow/layers/layer_tree.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" - -namespace flutter_runner { - -class Rasterizer { - public: - virtual ~Rasterizer(); - - static std::unique_ptr Create(); - - virtual void SetScene( - fidl::InterfaceHandle mozart, - zx::eventpair import_token, - fxl::Closure metrics_changed_callback) = 0; - - virtual void Draw(std::unique_ptr layer_tree, - fxl::Closure callback) = 0; -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ diff --git a/content_handler/runtime_holder.cc b/content_handler/runtime_holder.cc deleted file mode 100644 index 421731b9691d0..0000000000000 --- a/content_handler/runtime_holder.cc +++ /dev/null @@ -1,911 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/runtime_holder.h" - -#include -#include -#include -#include -#include - -#include "dart-pkg/zircon/sdk_ext/handle.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/common/threads.h" -#include "flutter/content_handler/accessibility_bridge.h" -#include "flutter/content_handler/rasterizer.h" -#include "flutter/content_handler/service_protocol_hooks.h" -#include "flutter/lib/snapshot/snapshot.h" -#include "flutter/lib/ui/window/pointer_data_packet.h" -#include "flutter/runtime/asset_font_selector.h" -#include "flutter/runtime/dart_controller.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/runtime_init.h" -#include "lib/app/cpp/connect.h" -#include "lib/fsl/vmo/vector.h" -#include "lib/fxl/files/path.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/zip/create_unzipper.h" -#include "third_party/dart/runtime/include/dart_api.h" -#include "third_party/rapidjson/rapidjson/document.h" -#include "third_party/rapidjson/rapidjson/stringbuffer.h" -#include "third_party/rapidjson/rapidjson/writer.h" - -using tonic::DartConverter; -using tonic::ToDart; - -namespace flutter_runner { -namespace { - -constexpr char kKernelKey[] = "kernel_blob.bin"; -constexpr char kSnapshotKey[] = "snapshot_blob.bin"; -constexpr char kDylibKey[] = "libapp.so"; -constexpr char kAssetChannel[] = "flutter/assets"; -constexpr char kKeyEventChannel[] = "flutter/keyevent"; -constexpr char kTextInputChannel[] = "flutter/textinput"; -constexpr char kFlutterPlatformChannel[] = "flutter/platform"; -constexpr char kFuchsiaPackageResourceDirectory[] = "pkg/data"; -constexpr char kDartPkgContentsKey[] = "dart-pkg/contents"; - -void SetThreadName(fxl::RefPtr runner, std::string name) { - runner->PostTask([name]() { - zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); - Dart_SetThreadName(name.c_str()); - }); -} - -blink::PointerData::Change GetChangeFromPointerEventPhase( - input::PointerEventPhase phase) { - switch (phase) { - case input::PointerEventPhase::ADD: - return blink::PointerData::Change::kAdd; - case input::PointerEventPhase::HOVER: - return blink::PointerData::Change::kHover; - case input::PointerEventPhase::DOWN: - return blink::PointerData::Change::kDown; - case input::PointerEventPhase::MOVE: - return blink::PointerData::Change::kMove; - case input::PointerEventPhase::UP: - return blink::PointerData::Change::kUp; - case input::PointerEventPhase::REMOVE: - return blink::PointerData::Change::kRemove; - case input::PointerEventPhase::CANCEL: - return blink::PointerData::Change::kCancel; - default: - return blink::PointerData::Change::kCancel; - } -} - -blink::PointerData::DeviceKind GetKindFromPointerType( - input::PointerEventType type) { - switch (type) { - case input::PointerEventType::TOUCH: - return blink::PointerData::DeviceKind::kTouch; - case input::PointerEventType::MOUSE: - return blink::PointerData::DeviceKind::kMouse; - default: - return blink::PointerData::DeviceKind::kTouch; - } -} - -} // namespace - -RuntimeHolder::RuntimeHolder() - : view_listener_binding_(this), - input_listener_binding_(this), - text_input_binding_(this), - weak_factory_(this) {} - -RuntimeHolder::~RuntimeHolder() { - blink::Threads::Gpu()->PostTask( - fxl::MakeCopyable([rasterizer = std::move(rasterizer_)](){ - // Deletes rasterizer. - })); -} - -void RuntimeHolder::Init( - fdio_ns_t* namespc, - std::unique_ptr context, - fidl::InterfaceRequest outgoing_services, - std::vector bundle) { - FXL_DCHECK(!rasterizer_); - rasterizer_ = Rasterizer::Create(); - FXL_DCHECK(rasterizer_); - - namespc_ = namespc; - dirfd_ = fdio_ns_opendir(namespc); - if (dirfd_ == -1) { - FXL_LOG(ERROR) << "Failed to get fd for namespace"; - return; - } - context_ = std::move(context); - outgoing_services_ = std::move(outgoing_services); - - context_->ConnectToEnvironmentService(view_manager_.NewRequest()); - - // TODO(zarah): remove bundle entirely once flx is removed. - InitRootBundle(std::move(bundle)); - - const uint8_t* vm_snapshot_data; - const uint8_t* vm_snapshot_instr; - const uint8_t* default_isolate_snapshot_data; - const uint8_t* default_isolate_snapshot_instr; - if (!Dart_IsPrecompiledRuntime()) { - vm_snapshot_data = ::kDartVmSnapshotData; - vm_snapshot_instr = ::kDartVmSnapshotInstructions; - default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; - default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; - } else { - std::vector dylib_blob; - if (!GetAssetAsBuffer(kDylibKey, &dylib_blob)) { - FXL_LOG(ERROR) << "Failed to extract app dylib"; - return; - } - - fsl::SizedVmo dylib_vmo; - if (!fsl::VmoFromVector(dylib_blob, &dylib_vmo)) { - FXL_LOG(ERROR) << "Failed to load app dylib"; - return; - } - - dlerror(); - dylib_handle_ = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); - if (dylib_handle_ == nullptr) { - FXL_LOG(ERROR) << "dlopen failed: " << dlerror(); - return; - } - vm_snapshot_data = reinterpret_cast( - dlsym(dylib_handle_, "_kDartVmSnapshotData")); - vm_snapshot_instr = reinterpret_cast( - dlsym(dylib_handle_, "_kDartVmSnapshotInstructions")); - default_isolate_snapshot_data = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); - default_isolate_snapshot_instr = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); - } - - // TODO(rmacnak): We should generate the AOT vm snapshot separately from - // each app so we can initialize before receiving the first app bundle. - static bool first_app = true; - if (first_app) { - first_app = false; - blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, - default_isolate_snapshot_data, - default_isolate_snapshot_instr, - /* bundle_path = */ ""); - - // This has to happen after the Dart runtime is initialized. - SetThreadName(blink::Threads::UI(), "ui"); - SetThreadName(blink::Threads::Gpu(), "gpu"); - SetThreadName(blink::Threads::IO(), "io"); - - blink::SetRegisterNativeServiceProtocolExtensionHook( - ServiceProtocolHooks::RegisterHooks); - } - - accessibility_bridge_ = std::make_unique(context_.get()); -} - -void RuntimeHolder::CreateView( - const std::string& script_uri, - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services) { - if (view_listener_binding_.is_bound()) { - // TODO(jeffbrown): Refactor this to support multiple view instances - // sharing the same underlying root bundle (but with different runtimes). - FXL_LOG(ERROR) << "The view has already been created."; - return; - } - - std::vector kernel; - std::vector snapshot; - bool maybe_running_from_source = false; - if (!Dart_IsPrecompiledRuntime()) { - if (!GetAssetAsBuffer(kKernelKey, &kernel) && - !GetAssetAsBuffer(kSnapshotKey, &snapshot)) { - maybe_running_from_source = true; - FXL_LOG(INFO) << "No kernel or snapshot in root bundle."; - } - } - - // Create the view. - zx::eventpair import_token, export_token; - zx_status_t status = zx::eventpair::create(0u, &import_token, &export_token); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Could not create an event pair."; - return; - } - views_v1::ViewListenerPtr view_listener; - view_listener_binding_.Bind(view_listener.NewRequest()); - view_manager_->CreateView(view_.NewRequest(), // view - std::move(view_owner_request), // view owner - std::move(view_listener), // view listener - std::move(export_token), // export token - script_uri // diagnostic label - ); - component::ServiceProviderPtr view_services; - view_->GetServiceProvider(view_services.NewRequest()); - - // Listen for input events. - ConnectToService(view_services.get(), input_connection_.NewRequest()); - input::InputListenerPtr input_listener; - input_listener_binding_.Bind(input_listener.NewRequest()); - input_connection_->SetEventListener(std::move(input_listener)); - - // Setup the session. - fidl::InterfaceHandle scenic; - view_manager_->GetScenic(scenic.NewRequest()); - - blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ - rasterizer = rasterizer_.get(), // - scenic = std::move(scenic), // - import_token = std::move(import_token), // - weak_runtime_holder = GetWeakPtr() - ]() mutable { - ASSERT_IS_GPU_THREAD; - rasterizer->SetScene( - std::move(scenic), std::move(import_token), - // TODO(MZ-222): Ideally we would immediately redraw the previous layer - // tree when the metrics change since there's no need to rerecord it. - // However, we want to make sure there's only one outstanding frame. - // We should improve the frame scheduling so that the rasterizer thread - // can self-schedule re-rasterization. - [weak_runtime_holder] { - // This is on the GPU thread thread. Post to the Platform/UI - // thread for the completion callback. - ASSERT_IS_GPU_THREAD; - blink::Threads::Platform()->PostTask([weak_runtime_holder]() { - // On the Platform/UI thread. - ASSERT_IS_UI_THREAD; - if (weak_runtime_holder) { - weak_runtime_holder->OnRedrawFrame(); - } - }); - }); - })); - runtime_ = blink::RuntimeController::Create(this); - - const uint8_t* isolate_snapshot_data; - const uint8_t* isolate_snapshot_instr; - if (!Dart_IsPrecompiledRuntime()) { - isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; - isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; - } else { - isolate_snapshot_data = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); - isolate_snapshot_instr = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); - } - runtime_->CreateDartController(script_uri, isolate_snapshot_data, - isolate_snapshot_instr, dirfd_); - - runtime_->SetViewportMetrics(viewport_metrics_); - - if (Dart_IsPrecompiledRuntime()) { - runtime_->dart_controller()->RunFromPrecompiledSnapshot(); - } else if (!kernel.empty()) { - runtime_->dart_controller()->RunFromKernel(std::move(kernel)); - } else if (maybe_running_from_source) { - std::vector data; - if (!GetAssetAsBuffer(kDartPkgContentsKey, &data)) { - FXL_LOG(ERROR) << "Contents file not found for " << script_uri; - return; - } - std::string package_name(data.begin(), data.end()); - std::string main_dart = "pkg/data/dart-pkg/" + package_name + "/lib/main.dart"; - FXL_LOG(INFO) << "Running from source with entrypoint: '" << main_dart - << "'"; - runtime_->dart_controller()->RunFromSource(main_dart, "pkg/data/dart-pkg/.packages"); - } else { - runtime_->dart_controller()->RunFromScriptSnapshot(snapshot.data(), - snapshot.size()); - } - - runtime_->dart_controller()->dart_state()->SetReturnCodeCallback( - [this](int32_t return_code) { return_code_ = return_code; }); -} - -Dart_Port RuntimeHolder::GetUIIsolateMainPort() { - if (!runtime_) - return ILLEGAL_PORT; - return runtime_->GetMainPort(); -} - -void RuntimeHolder::DidShutdownMainIsolate() { - if (main_isolate_shutdown_callback_) { - main_isolate_shutdown_callback_(); - } -} - -void RuntimeHolder::SetMainIsolateShutdownCallback( - std::function callback) { - main_isolate_shutdown_callback_ = callback; -} - -std::string RuntimeHolder::GetUIIsolateName() { - if (!runtime_) { - return ""; - } - return runtime_->GetIsolateName(); -} - -std::string RuntimeHolder::DefaultRouteName() { - return "/"; -} - -void RuntimeHolder::ScheduleFrame(bool regenerate_layer_tree) { - ASSERT_IS_UI_THREAD; - // TODO(mravn): We assume regenerate_layer_tree is true (and thus ignore - // that we may be able to reuse the current layer tree.) - if (!frame_scheduled_) { - frame_scheduled_ = true; - if (!frame_outstanding_) - PostBeginFrame(); - } -} - -void RuntimeHolder::Render(std::unique_ptr layer_tree) { - if (!frame_outstanding_ || frame_rendering_) { - // TODO(MZ-193): We probably shouldn't be discarding the layer tree here. - // But then, Flutter shouldn't be calling Render() if we didn't call - // BeginFrame(). - return; // Spurious. - } - - frame_rendering_ = true; - - layer_tree->set_construction_time(fxl::TimePoint::Now() - - last_begin_frame_time_); - layer_tree->set_frame_size(SkISize::Make(viewport_metrics_.physical_width, - viewport_metrics_.physical_height)); - layer_tree->set_device_pixel_ratio(viewport_metrics_.device_pixel_ratio); - - // We are on the Platform/UI thread. Post to the GPU thread to render. - ASSERT_IS_PLATFORM_THREAD; - blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ - rasterizer = rasterizer_.get(), // - layer_tree = std::move(layer_tree), // - weak_runtime_holder = GetWeakPtr() // - ]() mutable { - // On the GPU Thread. - ASSERT_IS_GPU_THREAD; - rasterizer->Draw(std::move(layer_tree), [weak_runtime_holder]() { - // This is on the GPU thread thread. Post to the Platform/UI thread - // for the completion callback. - ASSERT_IS_GPU_THREAD; - blink::Threads::Platform()->PostTask([weak_runtime_holder]() { - // On the Platform/UI thread. - ASSERT_IS_UI_THREAD; - if (weak_runtime_holder) { - weak_runtime_holder->frame_rendering_ = false; - weak_runtime_holder->OnFrameComplete(); - } - }); - }); - })); -} - -void RuntimeHolder::UpdateSemantics(blink::SemanticsNodeUpdates update) { - accessibility_bridge_->UpdateSemantics(update); -} - -void RuntimeHolder::HandlePlatformMessage( - fxl::RefPtr message) { - if (message->channel() == kAssetChannel) { - if (HandleAssetPlatformMessage(message.get())) - return; - } else if (message->channel() == kTextInputChannel) { - if (HandleTextInputPlatformMessage(message.get())) - return; - } else if (message->channel() == kFlutterPlatformChannel) { - if (HandleFlutterPlatformMessage(message.get())) - return; - } - if (auto response = message->response()) - response->CompleteEmpty(); -} - -void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) { - if (asset_provider_) { - blink::AssetFontSelector::Install(asset_provider_); - } else if (asset_store_) { - blink::AssetFontSelector::Install(asset_store_); - } - InitDartIoInternal(); - InitFuchsia(); - InitZircon(); - InitScenicInternal(); -} - -void RuntimeHolder::InitDartIoInternal() { - Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io")); - - // Set up the namespace. - Dart_Handle namespace_type = - Dart_GetType(io_lib, ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - Dart_Handle namespace_args[1]; - namespace_args[0] = Dart_NewInteger(reinterpret_cast(namespc_)); - DART_CHECK_VALID(namespace_args[0]); - DART_CHECK_VALID(Dart_Invoke(namespace_type, ToDart("_setupNamespace"), 1, - namespace_args)); - - // Disable dart:io exit() - Dart_Handle embedder_config_type = - Dart_GetType(io_lib, ToDart("_EmbedderConfig"), 0, nullptr); - DART_CHECK_VALID(embedder_config_type); - DART_CHECK_VALID( - Dart_SetField(embedder_config_type, ToDart("_mayExit"), Dart_False())); -} - -void RuntimeHolder::InitFuchsia() { - fidl::InterfaceHandle environment; - context_->ConnectToEnvironmentService(environment.NewRequest()); - fuchsia::dart::Initialize(std::move(environment), - std::move(outgoing_services_)); - - component::ServiceProviderPtr parent_env_service_provider; - context_->environment()->GetServices( - parent_env_service_provider.NewRequest()); - ConnectToService(parent_env_service_provider.get(), clipboard_.NewRequest()); -} - -void RuntimeHolder::InitZircon() { - Dart_Handle zircon_lib = Dart_LookupLibrary(ToDart("dart:zircon")); - DART_CHECK_VALID(zircon_lib); - - Dart_Handle namespace_type = - Dart_GetType(zircon_lib, ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - DART_CHECK_VALID(Dart_SetField(namespace_type, ToDart("_namespace"), - ToDart(reinterpret_cast(namespc_)))); -} - -void RuntimeHolder::InitScenicInternal() { - fidl::InterfaceHandle view_container; - view_->GetContainer(view_container.NewRequest()); - - Dart_Handle mozart_internal = - Dart_LookupLibrary(ToDart("dart:mozart.internal")); - - DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, mozart::NativeLookup, - mozart::NativeSymbol)); - - DART_CHECK_VALID( - Dart_SetField(mozart_internal, ToDart("_context"), - DartConverter::ToDart(reinterpret_cast( - static_cast(this))))); - - DART_CHECK_VALID(Dart_SetField(mozart_internal, ToDart("_viewContainer"), - ToDart(zircon::dart::Handle::Create( - view_container.TakeChannel().release())))); -} - -void RuntimeHolder::InitRootBundle(std::vector bundle) { - if (!bundle.empty()) { - root_bundle_data_ = std::move(bundle); - asset_store_ = fxl::MakeRefCounted( - GetUnzipperProviderForRootBundle()); - } else { - fxl::UniqueFD root_dir(fdio_ns_opendir(namespc_)); - if (!root_dir.is_valid()) { - FXL_LOG(ERROR) << "Unable to load root dir"; - return; - } - fxl::UniqueFD data_dir(openat(root_dir.get(), - kFuchsiaPackageResourceDirectory, - O_RDONLY | O_DIRECTORY)); - if (!data_dir.is_valid()) { - FXL_LOG(ERROR) << "Unable to load data dir"; - return; - } - asset_provider_ = - fxl::MakeRefCounted(std::move(data_dir)); - } -} - -views_v1::View* RuntimeHolder::GetMozartView() { - return view_.get(); -} - -bool RuntimeHolder::HandleAssetPlatformMessage( - blink::PlatformMessage* message) { - fxl::RefPtr response = message->response(); - if (!response) - return false; - const auto& data = message->data(); - std::string asset_name(reinterpret_cast(data.data()), - data.size()); - std::vector asset_data; - if (GetAssetAsBuffer(asset_name, &asset_data)) { - response->Complete(std::move(asset_data)); - } else { - response->CompleteEmpty(); - } - return true; -} - -bool RuntimeHolder::GetAssetAsBuffer(const std::string& name, - std::vector* data) { - return (asset_provider_ && - asset_provider_->GetAsBuffer(name, data)) || - (asset_store_ && asset_store_->GetAsBuffer(name, data)); -} - -bool RuntimeHolder::HandleFlutterPlatformMessage( - blink::PlatformMessage* message) { - const auto& data = message->data(); - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) { - return false; - } - - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) { - return false; - } - - fxl::RefPtr response = message->response(); - if (method->value == "Clipboard.setData") { - auto text = root["args"]["text"].GetString(); - clipboard_->Push(text); - response->CompleteEmpty(); - } else if (method->value == "Clipboard.getData") { - clipboard_->Peek([response](fidl::StringPtr text) { - rapidjson::StringBuffer json_buffer; - rapidjson::Writer writer(json_buffer); - writer.StartArray(); - writer.StartObject(); - writer.Key("text"); - writer.String(text.get()); - writer.EndObject(); - writer.EndArray(); - - std::string result = json_buffer.GetString(); - response->Complete(std::vector{result.begin(), result.end()}); - }); - } else { - response->CompleteEmpty(); - } - return true; -} - -bool RuntimeHolder::HandleTextInputPlatformMessage( - blink::PlatformMessage* message) { - const auto& data = message->data(); - - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) - return false; - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) - return false; - - if (method->value == "TextInput.show") { - if (input_method_editor_) { - input_method_editor_->Show(); - } - } else if (method->value == "TextInput.hide") { - if (input_method_editor_) { - input_method_editor_->Hide(); - } - } else if (method->value == "TextInput.setClient") { - current_text_input_client_ = 0; - if (text_input_binding_.is_bound()) - text_input_binding_.Unbind(); - input_method_editor_ = nullptr; - - auto args = root.FindMember("args"); - if (args == root.MemberEnd() || !args->value.IsArray() || - args->value.Size() != 2) - return false; - const auto& configuration = args->value[1]; - if (!configuration.IsObject()) - return false; - // TODO(abarth): Read the keyboard type form the configuration. - current_text_input_client_ = args->value[0].GetInt(); - input::TextInputState state; - state.text = std::string(); - input_connection_->GetInputMethodEditor( - input::KeyboardType::TEXT, input::InputMethodAction::DONE, - std::move(state), text_input_binding_.NewBinding(), - input_method_editor_.NewRequest()); - } else if (method->value == "TextInput.setEditingState") { - if (input_method_editor_) { - auto args_it = root.FindMember("args"); - if (args_it == root.MemberEnd() || !args_it->value.IsObject()) - return false; - const auto& args = args_it->value; - input::TextInputState state; - // TODO(abarth): Deserialize state. - auto text = args.FindMember("text"); - if (text != args.MemberEnd() && text->value.IsString()) - state.text = text->value.GetString(); - auto selection_base = args.FindMember("selectionBase"); - if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) - state.selection.base = selection_base->value.GetInt(); - auto selection_extent = args.FindMember("selectionExtent"); - if (selection_extent != args.MemberEnd() && - selection_extent->value.IsInt()) - state.selection.extent = selection_extent->value.GetInt(); - auto selection_affinity = args.FindMember("selectionAffinity"); - if (selection_affinity != args.MemberEnd() && - selection_affinity->value.IsString() && - selection_affinity->value == "TextAffinity.upstream") - state.selection.affinity = input::TextAffinity::UPSTREAM; - else - state.selection.affinity = input::TextAffinity::DOWNSTREAM; - // We ignore selectionIsDirectional because that concept doesn't exist on - // Fuchsia. - auto composing_base = args.FindMember("composingBase"); - if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) - state.composing.start = composing_base->value.GetInt(); - auto composing_extent = args.FindMember("composingExtent"); - if (composing_extent != args.MemberEnd() && - composing_extent->value.IsInt()) - state.composing.end = composing_extent->value.GetInt(); - input_method_editor_->SetState(std::move(state)); - } - } else if (method->value == "TextInput.clearClient") { - current_text_input_client_ = 0; - if (text_input_binding_.is_bound()) - text_input_binding_.Unbind(); - input_method_editor_ = nullptr; - } else { - FXL_DLOG(ERROR) << "Unknown " << kTextInputChannel << " method " - << method->value.GetString(); - } - - return false; -} - -blink::UnzipperProvider RuntimeHolder::GetUnzipperProviderForRootBundle() { - return [self = GetWeakPtr()]() { - if (!self) - return zip::UniqueUnzipper(); - return zip::CreateUnzipper(&self->root_bundle_data_); - }; -} - -void RuntimeHolder::OnEvent(input::InputEvent event, - OnEventCallback callback) { - bool handled = false; - if (event.is_pointer()) { - const input::PointerEvent& pointer = event.pointer(); - blink::PointerData pointer_data; - pointer_data.time_stamp = pointer.event_time / 1000; - pointer_data.change = GetChangeFromPointerEventPhase(pointer.phase); - pointer_data.kind = GetKindFromPointerType(pointer.type); - pointer_data.device = pointer.pointer_id; - pointer_data.physical_x = pointer.x * viewport_metrics_.device_pixel_ratio; - pointer_data.physical_y = pointer.y * viewport_metrics_.device_pixel_ratio; - // Buttons are single bit values starting with kMousePrimaryButton = 1. - pointer_data.buttons = static_cast(pointer.buttons); - - switch (pointer_data.change) { - case blink::PointerData::Change::kDown: - down_pointers_.insert(pointer_data.device); - break; - case blink::PointerData::Change::kCancel: - case blink::PointerData::Change::kUp: - down_pointers_.erase(pointer_data.device); - break; - case blink::PointerData::Change::kMove: - if (down_pointers_.count(pointer_data.device) == 0) - pointer_data.change = blink::PointerData::Change::kHover; - break; - case blink::PointerData::Change::kAdd: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received add event for down pointer."; - } - break; - case blink::PointerData::Change::kRemove: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received remove event for down pointer."; - } - break; - case blink::PointerData::Change::kHover: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received hover event for down pointer."; - } - break; - } - - blink::PointerDataPacket packet(1); - packet.SetPointerData(0, pointer_data); - runtime_->DispatchPointerDataPacket(packet); - - handled = true; - } else if (event.is_keyboard()) { - const input::KeyboardEvent& keyboard = event.keyboard(); - const char* type = nullptr; - if (keyboard.phase == input::KeyboardEventPhase::PRESSED) - type = "keydown"; - else if (keyboard.phase == input::KeyboardEventPhase::REPEAT) - type = "keydown"; // TODO change this to keyrepeat - else if (keyboard.phase == input::KeyboardEventPhase::RELEASED) - type = "keyup"; - - if (type) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - document.SetObject(); - document.AddMember("type", rapidjson::Value(type, strlen(type)), - allocator); - document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); - document.AddMember("hidUsage", keyboard.hid_usage, allocator); - document.AddMember("codePoint", keyboard.code_point, allocator); - document.AddMember("modifiers", keyboard.modifiers, allocator); - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = - reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage( - fxl::MakeRefCounted( - kKeyEventChannel, - std::vector(data, data + buffer.GetSize()), nullptr)); - handled = true; - } - } - callback(handled); -} - -void RuntimeHolder::OnPropertiesChanged( - views_v1::ViewProperties properties, - OnPropertiesChangedCallback callback) { - // Attempt to read the device pixel ratio. - float pixel_ratio = 1.f; - if (auto& metrics = properties.display_metrics) { - pixel_ratio = metrics->device_pixel_ratio; - } - - // Apply view property changes. - if (auto& layout = properties.view_layout) { - viewport_metrics_.physical_width = layout->size.width * pixel_ratio; - viewport_metrics_.physical_height = layout->size.height * pixel_ratio; - viewport_metrics_.physical_padding_top = layout->inset.top * pixel_ratio; - viewport_metrics_.physical_padding_right = - layout->inset.right * pixel_ratio; - viewport_metrics_.physical_padding_bottom = - layout->inset.bottom * pixel_ratio; - viewport_metrics_.physical_padding_left = layout->inset.left * pixel_ratio; - viewport_metrics_.device_pixel_ratio = pixel_ratio; - runtime_->SetViewportMetrics(viewport_metrics_); - } - - ScheduleFrame(); - - callback(); -} - -void RuntimeHolder::DidUpdateState(input::TextInputState state, - input::InputEventPtr event) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - - rapidjson::Value encoded_state(rapidjson::kObjectType); - encoded_state.AddMember("text", state.text.get(), allocator); - encoded_state.AddMember("selectionBase", state.selection.base, allocator); - encoded_state.AddMember("selectionExtent", state.selection.extent, - allocator); - switch (state.selection.affinity) { - case input::TextAffinity::UPSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.upstream"), - allocator); - break; - case input::TextAffinity::DOWNSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.downstream"), - allocator); - break; - } - encoded_state.AddMember("selectionIsDirectional", true, allocator); - encoded_state.AddMember("composingBase", state.composing.start, allocator); - encoded_state.AddMember("composingExtent", state.composing.end, allocator); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - args.PushBack(encoded_state, allocator); - - document.SetObject(); - document.AddMember("method", - rapidjson::Value("TextInputClient.updateEditingState"), - allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, std::vector(data, data + buffer.GetSize()), - nullptr)); -} - -void RuntimeHolder::OnAction(input::InputMethodAction action) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - - // Done is currently the only text input action defined by Flutter. - args.PushBack("TextInputAction.done", allocator); - - document.SetObject(); - document.AddMember( - "method", rapidjson::Value("TextInputClient.performAction"), allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, std::vector(data, data + buffer.GetSize()), - nullptr)); -} - -fxl::WeakPtr RuntimeHolder::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -void RuntimeHolder::PostBeginFrame() { - blink::Threads::Platform()->PostTask([weak_runtime_holder = GetWeakPtr()]() { - // On the Platform/UI thread. - ASSERT_IS_UI_THREAD; - if (weak_runtime_holder) { - weak_runtime_holder->BeginFrame(); - } - }); -} - -void RuntimeHolder::BeginFrame() { - ASSERT_IS_UI_THREAD - FXL_DCHECK(frame_scheduled_); - FXL_DCHECK(!frame_outstanding_); - frame_scheduled_ = false; - frame_outstanding_ = true; - int64_t dart_frame_start_micros = Dart_TimelineGetMicros(); - last_begin_frame_time_ = fxl::TimePoint::Now(); - runtime_->BeginFrame(last_begin_frame_time_); - - if (frame_scheduled_) { - // HACK(rmacnak): This assumes 16ms/frame; it should use the frame deadline - // once we have access to it. Compare shell/common/animator.cc. - runtime_->NotifyIdle(dart_frame_start_micros + 16000); - } else { - // We don't have another frame pending, so we're waiting on user input - // or I/O. Allow the Dart VM 100 ms. - runtime_->NotifyIdle(dart_frame_start_micros + 100000); - } -} - -void RuntimeHolder::OnFrameComplete() { - ASSERT_IS_UI_THREAD - FXL_DCHECK(frame_outstanding_); - frame_outstanding_ = false; - if (frame_scheduled_) - PostBeginFrame(); -} - -void RuntimeHolder::OnRedrawFrame() { - if (!frame_outstanding_) - ScheduleFrame(); -} - -} // namespace flutter_runner diff --git a/content_handler/runtime_holder.h b/content_handler/runtime_holder.h deleted file mode 100644 index b9d55d9f9bacc..0000000000000 --- a/content_handler/runtime_holder.h +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ -#define FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ - -#include -#include - -#include - -#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" -#include "flutter/assets/asset_provider.h" -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/unzipper_provider.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/content_handler/accessibility_bridge.h" -#include "flutter/flow/layers/layer_tree.h" -#include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/runtime/runtime_controller.h" -#include "flutter/runtime/runtime_delegate.h" -#include "lib/app/cpp/application_context.h" -#include -#include -#include -#include "lib/fidl/cpp/binding.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" -#include -#include -#include - -namespace flutter_runner { - -class Rasterizer; - -class RuntimeHolder : public blink::RuntimeDelegate, - public mozart::NativesDelegate, - public views_v1::ViewListener, - public input::InputListener, - public input::InputMethodEditorClient { - public: - RuntimeHolder(); - ~RuntimeHolder(); - - void Init(fdio_ns_t* namespc, - std::unique_ptr context, - fidl::InterfaceRequest outgoing_services, - std::vector bundle); - void CreateView(const std::string& script_uri, - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services); - - Dart_Port GetUIIsolateMainPort(); - std::string GetUIIsolateName(); - - int32_t return_code() { return return_code_; } - - void SetMainIsolateShutdownCallback(std::function callback); - - private: - // |blink::RuntimeDelegate| implementation: - std::string DefaultRouteName() override; - void ScheduleFrame(bool regenerate_layer_tree = true) override; - void Render(std::unique_ptr layer_tree) override; - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - void HandlePlatformMessage( - fxl::RefPtr message) override; - void DidCreateMainIsolate(Dart_Isolate isolate) override; - void DidShutdownMainIsolate() override; - - // |mozart::NativesDelegate| implementation: - views_v1::View* GetMozartView() override; - - // |input::InputListener| implementation: - void OnEvent(input::InputEvent event, - OnEventCallback callback) override; - - // |views_v1::ViewListener| implementation: - void OnPropertiesChanged( - views_v1::ViewProperties properties, - OnPropertiesChangedCallback callback) override; - - // |input::InputMethodEditorClient| implementation: - void DidUpdateState(input::TextInputState state, - input::InputEventPtr event) override; - void OnAction(input::InputMethodAction action) override; - - fxl::WeakPtr GetWeakPtr(); - - void InitRootBundle(std::vector bundle); - blink::UnzipperProvider GetUnzipperProviderForRootBundle(); - bool HandleAssetPlatformMessage(blink::PlatformMessage* message); - bool GetAssetAsBuffer(const std::string& name, std::vector* data); - bool HandleTextInputPlatformMessage(blink::PlatformMessage* message); - bool HandleFlutterPlatformMessage(blink::PlatformMessage* message); - - void InitDartIoInternal(); - void InitFuchsia(); - void InitZircon(); - void InitScenicInternal(); - - void PostBeginFrame(); - void BeginFrame(); - void OnFrameComplete(); - void OnRedrawFrame(); - void Invalidate(); - - fdio_ns_t* namespc_; - int dirfd_; - std::unique_ptr context_; - fidl::InterfaceRequest outgoing_services_; - std::vector root_bundle_data_; - // TODO(zarah): Remove asset_store_ when flx is completely removed - fxl::RefPtr asset_store_; - fxl::RefPtr asset_provider_; - void* dylib_handle_ = nullptr; - std::unique_ptr rasterizer_; - std::unique_ptr runtime_; - blink::ViewportMetrics viewport_metrics_; - views_v1::ViewManagerPtr view_manager_; - fidl::Binding view_listener_binding_; - fidl::Binding input_listener_binding_; - input::InputConnectionPtr input_connection_; - views_v1::ViewPtr view_; - std::unordered_set down_pointers_; - input::InputMethodEditorPtr input_method_editor_; - fidl::Binding text_input_binding_; - int current_text_input_client_ = 0; - fxl::TimePoint last_begin_frame_time_; - bool frame_outstanding_ = false; - bool frame_scheduled_ = false; - bool frame_rendering_ = false; - int32_t return_code_ = 0; - - fxl::WeakPtrFactory weak_factory_; - - std::unique_ptr accessibility_bridge_; - - std::function main_isolate_shutdown_callback_; - - modular::ClipboardPtr clipboard_; - - FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeHolder); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ diff --git a/content_handler/service_protocol_hooks.cc b/content_handler/service_protocol_hooks.cc deleted file mode 100644 index 9a91254f13488..0000000000000 --- a/content_handler/service_protocol_hooks.cc +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/content_handler/service_protocol_hooks.h" - -#include - -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/content_handler/app.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace flutter_runner { -namespace { - -constexpr char kViewIdPrefx[] = "_flutterView/"; -constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; - -static intptr_t KeyIndex(const char** param_keys, - intptr_t num_params, - const char* key) { - if (param_keys == NULL) { - return -1; - } - for (intptr_t i = 0; i < num_params; i++) { - if (strcmp(param_keys[i], key) == 0) { - return i; - } - } - return -1; -} - -static const char* ValueForKey(const char** param_keys, - const char** param_values, - intptr_t num_params, - const char* key) { - intptr_t index = KeyIndex(param_keys, num_params, key); - if (index < 0) { - return NULL; - } - return param_values[index]; -} - -static void AppendIsolateRef(std::stringstream* stream, - int64_t main_port, - const std::string name) { - *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; - *stream << main_port << "\",\"name\":\"" << name << "\","; - *stream << "\"number\":\"" << main_port << "\"}"; -} - -static void AppendFlutterView(std::stringstream* stream, - uintptr_t view_id, - int64_t isolate_id, - const std::string isolate_name) { - *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" - << std::hex << view_id << std::dec << "\""; - if (isolate_id != ILLEGAL_PORT) { - // Append the isolate (if it exists). - *stream << "," - << "\"isolate\":"; - AppendIsolateRef(stream, isolate_id, isolate_name); - } - *stream << "}"; -} - -} // namespace - -void ServiceProtocolHooks::RegisterHooks(bool running_precompiled_code) { - // Listing of FlutterViews. - Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, - nullptr); - - Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, - &SetAssetBundlePath, nullptr); -} - -const char* ServiceProtocolHooks::kListViewsExtensionName = - "_flutter.listViews"; - -bool ServiceProtocolHooks::ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - // Ask the App for the list of platform views. This will run a task on - // the UI thread before returning. - App& app = App::Shared(); - std::vector platform_views; - app.WaitForPlatformViewIds(&platform_views); - - std::stringstream response; - - response << "{\"type\":\"FlutterViewList\",\"views\":["; - bool prefix_comma = false; - for (auto it = platform_views.begin(); it != platform_views.end(); it++) { - uintptr_t view_id = it->view_id; - int64_t isolate_id = it->isolate_id; - const std::string& isolate_name = it->isolate_name; - if (!view_id) { - continue; - } - if (prefix_comma) { - response << ','; - } else { - prefix_comma = true; - } - AppendFlutterView(&response, view_id, isolate_id, isolate_name); - } - response << "]}"; - // Copy the response. - *json_object = strdup(response.str().c_str()); - return true; -} - -const char* ServiceProtocolHooks::kSetAssetBundlePathExtensionName = - "_flutter.setAssetBundlePath"; - -bool ServiceProtocolHooks::SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - const char* view_id_str = - ValueForKey(param_keys, param_values, num_params, "viewId"); - - // Ask the App for the list of platform views. This will run a task on - // the UI thread before returning. - App& app = App::Shared(); - std::vector platform_views; - app.WaitForPlatformViewIds(&platform_views); - - // Convert the actual flutter view hex id into a number. - uintptr_t view_id_as_num = - std::stoull((view_id_str + kViewIdPrefxLength), nullptr, 16); - - // The view existed and the isolate was created. Success. - std::stringstream response; - response << "{\"type\":\"Success\"," - << "\"view\":"; - for (auto it = platform_views.begin(); it != platform_views.end(); it++) { - uintptr_t view_id = it->view_id; - int64_t isolate_id = it->isolate_id; - const std::string& isolate_name = it->isolate_name; - if (!view_id || view_id != view_id_as_num) { - continue; - } - - // TODO(DX): Set up asset bundle path for the isolate. - - AppendFlutterView(&response, view_id, isolate_id, isolate_name); - break; - } - response << "}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -} // namespace flutter_runner diff --git a/content_handler/service_protocol_hooks.h b/content_handler/service_protocol_hooks.h deleted file mode 100644 index 479fb71471f1e..0000000000000 --- a/content_handler/service_protocol_hooks.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ -#define FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ - -#include "lib/fxl/synchronization/waitable_event.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace flutter_runner { - -class ServiceProtocolHooks { - public: - static void RegisterHooks(bool running_precompiled_code); - - private: - static const char* kListViewsExtensionName; - static bool ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kSetAssetBundlePathExtensionName; - static bool SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index b496ae37f40f2..870020abb670f 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -2,72 +2,69 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/content_handler/session_connection.h" -#include "lib/fidl/cpp/optional.h" +#include "session_connection.h" + #include "lib/ui/scenic/fidl_helpers.h" -namespace flutter_runner { +namespace flutter { -SessionConnection::SessionConnection(ui::ScenicPtr scenic, - zx::eventpair import_token) - : session_(scenic.get()), +SessionConnection::SessionConnection( + const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback) + : debug_label_(std::move(debug_label)), + session_(scenic.get()), root_node_(&session_), surface_producer_(std::make_unique(&session_)), - scene_update_context_(&session_, surface_producer_.get()) { - ASSERT_IS_GPU_THREAD; - - session_.set_error_handler( - std::bind(&SessionConnection::OnSessionError, this)); + scene_update_context_(&session_, surface_producer_.get()), + metrics_changed_callback_( + std::move(session_metrics_did_change_callback)) { + session_.set_error_handler(std::move(session_error_callback)); session_.set_event_handler(std::bind(&SessionConnection::OnSessionEvents, this, std::placeholders::_1)); root_node_.Bind(std::move(import_token)); - root_node_.SetEventMask(gfx::kMetricsEventMask); - session_.Present(0, [](images::PresentationInfo info) {}); - - present_callback_ = - std::bind(&SessionConnection::OnPresent, this, std::placeholders::_1); + root_node_.SetEventMask(ui::gfx::kMetricsEventMask); + session_.Present(0, [](ui::PresentationInfoPtr info) {}); } -SessionConnection::~SessionConnection() { - ASSERT_IS_GPU_THREAD; -} +SessionConnection::~SessionConnection() = default; -void SessionConnection::OnSessionError() { - ASSERT_IS_GPU_THREAD; - // TODO: Not this. - FXL_CHECK(false) << "Session connection was terminated."; -} +void SessionConnection::OnSessionEvents(f1dl::Array events) { + using Type = ui::gfx::Event::Tag; -void SessionConnection::OnSessionEvents(fidl::VectorPtr events) { - gfx::Metrics* new_metrics; - for (auto& event : *events) { - if (event.is_gfx() && event.gfx().is_metrics() && - event.gfx().metrics().node_id == root_node_.id()) { - new_metrics = &event.gfx().metrics().metrics; + for (auto& raw_event : *events) { + if (!raw_event->is_gfx()) { + continue; } - } - if (!new_metrics) - return; - scene_update_context_.set_metrics(fidl::MakeOptional(std::move(*new_metrics))); - - if (metrics_changed_callback_) - metrics_changed_callback_(); + auto& event = raw_event->get_gfx(); + + switch (event->which()) { + case Type::METRICS: { + if (event->get_metrics()->node_id == root_node_.id()) { + auto& metrics = event->get_metrics()->metrics; + double device_pixel_ratio = metrics->scale_x; + scene_update_context_.set_metrics(std::move(metrics)); + if (metrics_changed_callback_) { + metrics_changed_callback_(device_pixel_ratio); + } + } + } break; + default: + break; + } + } } -void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, - fxl::Closure on_present_callback) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(pending_on_present_callback_ == nullptr); - FXL_DCHECK(on_present_callback != nullptr); - pending_on_present_callback_ = on_present_callback; - +void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { // Flush all session ops. Paint tasks have not yet executed but those are // fenced. The compositor can start processing ops while we finalize paint // tasks. - session_.Present(0, // presentation_time. Placeholder for now. - present_callback_ // callback + session_.Present(0, // presentation_time. (placeholder). + [](ui::PresentationInfoPtr) {} // callback ); // Execute paint tasks and signal fences. @@ -77,22 +74,15 @@ void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, // book-keeping on buffer caches. surface_producer_->OnSurfacesPresented(std::move(surfaces_to_submit)); - // Prepare for the next frame. - EnqueueClearCommands(); -} - -void SessionConnection::OnPresent(images::PresentationInfo info) { - ASSERT_IS_GPU_THREAD; - auto callback = pending_on_present_callback_; - pending_on_present_callback_ = nullptr; - callback(); + // Prepare for the next frame. These ops won't be processed till the next + // present. + EnqueueClearOps(); } -void SessionConnection::EnqueueClearCommands() { - ASSERT_IS_GPU_THREAD; +void SessionConnection::EnqueueClearOps() { // We are going to be sending down a fresh node hierarchy every frame. So just - // enqueue a detach command on the imported root node. + // enqueue a detach op on the imported root node. session_.Enqueue(scenic_lib::NewDetachChildrenCommand(root_node_.id())); } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index a80ba3a2235d2..e4f39d314c98f 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -2,70 +2,62 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ -#define FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ +#pragma once #include -#include "flutter/common/threads.h" -#include "flutter/content_handler/vulkan_surface_producer.h" #include "flutter/flow/compositor_context.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fidl/cpp/interface_handle.h" +#include "lib/fidl/cpp/bindings/interface_handle.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" +#include "vulkan_surface_producer.h" -namespace flutter_runner { +namespace flutter { -class SessionConnection { +using OnMetricsUpdate = std::function; + +// The component residing on the GPU thread that is responsible for +// maintaining the Scenic session connection and presenting node updates. +class SessionConnection final { public: - SessionConnection(ui::ScenicPtr scenic, zx::eventpair import_token); + SessionConnection(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback); ~SessionConnection(); bool has_metrics() const { return scene_update_context_.has_metrics(); } - const gfx::MetricsPtr& metrics() const { + const ui::gfx::MetricsPtr& metrics() const { return scene_update_context_.metrics(); } - void set_metrics_changed_callback(fxl::Closure callback) { - metrics_changed_callback_ = std::move(callback); - } - flow::SceneUpdateContext& scene_update_context() { return scene_update_context_; } - scenic_lib::ImportNode& root_node() { - ASSERT_IS_GPU_THREAD; - return root_node_; - } + scenic_lib::ImportNode& root_node() { return root_node_; } - void Present(flow::CompositorContext::ScopedFrame& frame, - fxl::Closure on_present_callback); + void Present(flow::CompositorContext::ScopedFrame& frame); private: + const std::string debug_label_; scenic_lib::Session session_; scenic_lib::ImportNode root_node_; - scenic_lib::Session::PresentCallback present_callback_; - fxl::Closure pending_on_present_callback_; std::unique_ptr surface_producer_; flow::SceneUpdateContext scene_update_context_; - fxl::Closure metrics_changed_callback_; - - void OnSessionError(); - void OnSessionEvents(fidl::VectorPtr events); + OnMetricsUpdate metrics_changed_callback_; - void EnqueueClearCommands(); + void OnSessionEvents(f1dl::Array events); - void OnPresent(images::PresentationInfo info); + void EnqueueClearOps(); FXL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); }; -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ +} // namespace flutter diff --git a/content_handler/surface.cc b/content_handler/surface.cc new file mode 100644 index 0000000000000..8efe1975fbfdb --- /dev/null +++ b/content_handler/surface.cc @@ -0,0 +1,73 @@ +// Copyright 2018 The Fuchsia 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 "surface.h" + +#include +#include +#include +#include + +#include "lib/fxl/files/unique_fd.h" + +namespace flutter { + +Surface::Surface(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback) + : shell::Surface(std::make_unique( + scenic, + debug_label, + std::move(import_token), + std::move(session_metrics_did_change_callback), + std::move(session_error_callback))), + debug_label_(debug_label) {} + +Surface::~Surface() = default; + +// |shell::Surface| +bool Surface::IsValid() { + return valid_; +} + +// |shell::Surface| +std::unique_ptr Surface::AcquireFrame( + const SkISize& size) { + return std::make_unique( + nullptr, [](const shell::SurfaceFrame& surface_frame, SkCanvas* canvas) { + return true; + }); +} + +// |shell::Surface| +GrContext* Surface::GetContext() { + return nullptr; +} + +static zx_status_t DriverWatcher(int dirfd, + int event, + const char* fn, + void* cookie) { + if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { + return ZX_ERR_STOP; + } + return ZX_OK; +} + +bool Surface::CanConnectToDisplay() { + constexpr char kDisplayDriverClass[] = "/dev/class/display"; + fxl::UniqueFD fd(open(kDisplayDriverClass, O_DIRECTORY | O_RDONLY)); + if (fd.get() < 0) { + FXL_DLOG(ERROR) << "Failed to open " << kDisplayDriverClass; + return false; + } + + zx_status_t status = fdio_watch_directory( + fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(1)), nullptr); + return status == ZX_ERR_STOP; +} + +} // namespace flutter diff --git a/content_handler/surface.h b/content_handler/surface.h new file mode 100644 index 0000000000000..4ad27aaf540f3 --- /dev/null +++ b/content_handler/surface.h @@ -0,0 +1,47 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "compositor_context.h" +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/shell/common/surface.h" +#include "lib/fxl/macros.h" + +namespace flutter { + +// The interface between the Flutter rasterizer and the underlying platform. May +// be constructed on any thread but will be used by the engine only on the GPU +// thread. +class Surface final : public shell::Surface { + public: + Surface(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback); + + ~Surface() override; + + private: + const bool valid_ = CanConnectToDisplay(); + const std::string debug_label_; + std::unique_ptr compositor_context_; + + // |shell::Surface| + bool IsValid() override; + + // |shell::Surface| + std::unique_ptr AcquireFrame( + const SkISize& size) override; + + // |shell::Surface| + GrContext* GetContext() override; + + static bool CanConnectToDisplay(); + + FXL_DISALLOW_COPY_AND_ASSIGN(Surface); +}; + +} // namespace flutter diff --git a/content_handler/task_observers.cc b/content_handler/task_observers.cc new file mode 100644 index 0000000000000..f23265e7b1653 --- /dev/null +++ b/content_handler/task_observers.cc @@ -0,0 +1,43 @@ +// Copyright 2018 The Fuchsia 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 "task_observers.h" + +#include + +#include "lib/fsl/tasks/message_loop.h" + +namespace flutter { + +thread_local std::map tTaskObservers; + +static void ExecuteAfterTaskObservers() { + for (const auto& callback : tTaskObservers) { + callback.second(); + } +} + +void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, + fxl::Closure observer) { + if (!observer) { + return; + } + + if (tTaskObservers.size() == 0) { + fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback( + std::bind(&ExecuteAfterTaskObservers)); + } + + tTaskObservers[key] = observer; +} + +void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key) { + tTaskObservers.erase(key); + + if (tTaskObservers.size() == 0) { + fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); + } +} + +} // namespace flutter diff --git a/content_handler/task_observers.h b/content_handler/task_observers.h new file mode 100644 index 0000000000000..53f6b96222000 --- /dev/null +++ b/content_handler/task_observers.h @@ -0,0 +1,16 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "lib/fxl/functional/closure.h" + +namespace flutter { + +void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, + fxl::Closure observer); + +void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key); + +} // namespace flutter diff --git a/content_handler/unique_fdio_ns.h b/content_handler/unique_fdio_ns.h new file mode 100644 index 0000000000000..726137d729f85 --- /dev/null +++ b/content_handler/unique_fdio_ns.h @@ -0,0 +1,34 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "fdio/namespace.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/memory/unique_object.h" + +namespace flutter { + +struct UniqueFDIONSTraits { + static fdio_ns_t* InvalidValue() { return nullptr; } + + static bool IsValid(fdio_ns_t* ns) { return ns != InvalidValue(); } + + static void Free(fdio_ns_t* ns) { + auto status = fdio_ns_destroy(ns); + FXL_DCHECK(status == ZX_OK); + } +}; + +using UniqueFDIONS = fxl::UniqueObject; + +inline UniqueFDIONS UniqueFDIONSCreate() { + fdio_ns_t* ns = nullptr; + if (fdio_ns_create(&ns) == ZX_OK) { + return UniqueFDIONS{ns}; + } + return UniqueFDIONS{nullptr}; +} + +} // namespace flutter diff --git a/content_handler/vulkan_rasterizer.cc b/content_handler/vulkan_rasterizer.cc deleted file mode 100644 index 25f90c460ce3f..0000000000000 --- a/content_handler/vulkan_rasterizer.cc +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/content_handler/vulkan_rasterizer.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/glue/trace_event.h" -#include "lib/fxl/files/unique_fd.h" - -namespace flutter_runner { - -constexpr char kGpuDriverClass[] = "/dev/class/gpu"; - -static zx_status_t DriverWatcher(int dirfd, - int event, - const char* fn, - void* cookie) { - if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { - return ZX_ERR_STOP; - } - return ZX_OK; -} - -bool WaitForFirstGpuDriver() { - fxl::UniqueFD fd(open(kGpuDriverClass, O_DIRECTORY | O_RDONLY)); - if (fd.get() < 0) { - FXL_DLOG(ERROR) << "Failed to open " << kGpuDriverClass; - return false; - } - - zx_status_t status = fdio_watch_directory( - fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(5)), nullptr); - return status == ZX_ERR_STOP; -} - -VulkanRasterizer::VulkanRasterizer() : compositor_context_(nullptr) { - valid_ = WaitForFirstGpuDriver(); -} - -VulkanRasterizer::~VulkanRasterizer() = default; - -bool VulkanRasterizer::IsValid() const { - return valid_; -} - -void VulkanRasterizer::SetScene(fidl::InterfaceHandle scenic, - zx::eventpair import_token, - fxl::Closure metrics_changed_callback) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(valid_ && !session_connection_); - session_connection_ = std::make_unique( - scenic.Bind(), std::move(import_token)); - session_connection_->set_metrics_changed_callback( - std::move(metrics_changed_callback)); -} - -void VulkanRasterizer::Draw(std::unique_ptr layer_tree, - fxl::Closure callback) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(callback != nullptr); - - if (layer_tree == nullptr) { - FXL_LOG(ERROR) << "Layer tree was not valid."; - callback(); - return; - } - - if (!session_connection_) { - FXL_LOG(ERROR) << "Session was not valid."; - callback(); - return; - } - - if (!session_connection_->has_metrics()) { - // Still awaiting metrics. Will redraw when we get them. - callback(); - return; - } - - compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); - - flow::CompositorContext::ScopedFrame frame = compositor_context_.AcquireFrame( - nullptr, nullptr, true /* instrumentation enabled */); - { - // Preroll the Flutter layer tree. This allows Flutter to perform pre-paint - // optimizations. - TRACE_EVENT0("flutter", "Preroll"); - layer_tree->Preroll(frame, session_connection_->metrics().get()); - } - - { - // Traverse the Flutter layer tree so that the necessary session ops to - // represent the frame are enqueued in the underlying session. - TRACE_EVENT0("flutter", "UpdateScene"); - layer_tree->UpdateScene(session_connection_->scene_update_context(), - session_connection_->root_node()); - } - - { - // Flush all pending session ops. - TRACE_EVENT0("flutter", "SessionPresent"); - session_connection_->Present( - frame, [callback = std::move(callback)]() { callback(); }); - } -} - -} // namespace flutter_runner diff --git a/content_handler/vulkan_rasterizer.h b/content_handler/vulkan_rasterizer.h deleted file mode 100644 index c3ae211553f5a..0000000000000 --- a/content_handler/vulkan_rasterizer.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ -#define FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ - -#include - -#include "flutter/content_handler/rasterizer.h" -#include "flutter/content_handler/session_connection.h" -#include "flutter/flow/compositor_context.h" -#include "lib/fxl/macros.h" - -namespace flutter_runner { - -class VulkanRasterizer : public Rasterizer { - public: - VulkanRasterizer(); - - ~VulkanRasterizer() override; - - bool IsValid() const; - - void SetScene(fidl::InterfaceHandle scenic, - zx::eventpair import_token, - fxl::Closure metrics_changed_callback) override; - - void Draw(std::unique_ptr layer_tree, - fxl::Closure callback) override; - - private: - flow::CompositorContext compositor_context_; - std::unique_ptr session_connection_; - bool valid_; - - FXL_DISALLOW_COPY_AND_ASSIGN(VulkanRasterizer); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 47ac87e375e81..c78ad6c127545 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "vulkan_surface.h" + #include -#include "flutter/content_handler/vulkan_surface.h" -#include "flutter/common/threads.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter_runner { +namespace flutter { VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -22,8 +22,6 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, backend_context_(std::move(backend_context)), session_(session), wait_(this) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(session_); zx::vmo exported_vmo; @@ -55,7 +53,6 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, } VulkanSurface::~VulkanSurface() { - ASSERT_IS_GPU_THREAD; if (async_) { wait_.Cancel(async_); wait_.set_object(ZX_HANDLE_INVALID); @@ -325,7 +322,6 @@ bool VulkanSurface::PushSessionImageSetupOps(scenic_lib::Session* session, } scenic_lib::Image* VulkanSurface::GetImage() { - ASSERT_IS_GPU_THREAD; if (!valid_) { return 0; } @@ -333,7 +329,6 @@ scenic_lib::Image* VulkanSurface::GetImage() { } sk_sp VulkanSurface::GetSkiaSurface() const { - ASSERT_IS_GPU_THREAD; return valid_ ? sk_surface_ : nullptr; } @@ -358,7 +353,6 @@ bool VulkanSurface::FlushSessionAcquireAndReleaseEvents() { void VulkanSurface::SignalWritesFinished( std::function on_writes_committed) { - ASSERT_IS_GPU_THREAD; FXL_DCHECK(on_writes_committed); if (!valid_) { @@ -374,8 +368,6 @@ void VulkanSurface::SignalWritesFinished( } void VulkanSurface::Reset() { - ASSERT_IS_GPU_THREAD; - if (acquire_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK || release_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK) { valid_ = false; @@ -410,10 +402,10 @@ void VulkanSurface::Reset() { } } -async_wait_result_t VulkanSurface::OnHandleReady(async_t* async, - zx_status_t status, - const zx_packet_signal_t* signal) { - ASSERT_IS_GPU_THREAD; +async_wait_result_t VulkanSurface::OnHandleReady( + async_t* async, + zx_status_t status, + const zx_packet_signal_t* signal) { if (status != ZX_OK) return ASYNC_WAIT_FINISHED; FXL_DCHECK(signal->observed & ZX_EVENT_SIGNALED); @@ -421,4 +413,4 @@ async_wait_result_t VulkanSurface::OnHandleReady(async_t* async, return ASYNC_WAIT_AGAIN; } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface.h b/content_handler/vulkan_surface.h index 41a807af81f9c..7add6b05bb8cc 100644 --- a/content_handler/vulkan_surface.h +++ b/content_handler/vulkan_surface.h @@ -20,9 +20,10 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -namespace flutter_runner { +namespace flutter { -class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { +class VulkanSurface final + : public flow::SceneUpdateContext::SurfaceProducerSurface { public: VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -32,12 +33,16 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { ~VulkanSurface() override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| size_t AdvanceAndGetAge() override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| bool FlushSessionAcquireAndReleaseEvents() override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| bool IsValid() const override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| SkISize GetSize() const override; // Note: It is safe for the caller to collect the surface in the @@ -115,4 +120,4 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); }; -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_pool.cc b/content_handler/vulkan_surface_pool.cc index af23ef711b7ad..93d14c2ddbff7 100644 --- a/content_handler/vulkan_surface_pool.cc +++ b/content_handler/vulkan_surface_pool.cc @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "vulkan_surface_pool.h" + #include -#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter_runner { +namespace flutter { VulkanSurfacePool::VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -177,4 +178,4 @@ void VulkanSurfacePool::TraceStats() { trace_surfaces_reused_ = 0; } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_pool.h b/content_handler/vulkan_surface_pool.h index 52dd3ed6aa417..4900816762910 100644 --- a/content_handler/vulkan_surface_pool.h +++ b/content_handler/vulkan_surface_pool.h @@ -6,12 +6,13 @@ #include #include -#include "flutter/content_handler/vulkan_surface.h" + #include "lib/fxl/macros.h" +#include "vulkan_surface.h" -namespace flutter_runner { +namespace flutter { -class VulkanSurfacePool { +class VulkanSurfacePool final { public: static const size_t kMaxSurfacesOfSameSize = 3; static const size_t kMaxSurfaceAge = 3; @@ -74,4 +75,4 @@ class VulkanSurfacePool { FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfacePool); }; -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index 6f605c109b7df..ff8a9ab9d1f4a 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -2,17 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/content_handler/vulkan_surface_producer.h" +#include "vulkan_surface_producer.h" #include #include #include + #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" -namespace flutter_runner { +namespace flutter { VulkanSurfaceProducer::VulkanSurfaceProducer( scenic_lib::Session* mozart_session) { @@ -42,7 +43,7 @@ bool VulkanSurfaceProducer::Initialize(scenic_lib::Session* mozart_session) { VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, }; application_ = std::make_unique( - *vk_, "FlutterContentHandler", std::move(extensions)); + *vk_, "FlutterApplicationRunner", std::move(extensions)); if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) { // Make certain the application instance was created and it setup the @@ -200,4 +201,4 @@ void VulkanSurfaceProducer::SubmitSurface( surface_pool_->SubmitSurface(std::move(surface)); } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_producer.h b/content_handler/vulkan_surface_producer.h index 2338a8a6ba709..15c4419e8cde7 100644 --- a/content_handler/vulkan_surface_producer.h +++ b/content_handler/vulkan_surface_producer.h @@ -2,11 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ -#define FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +#pragma once -#include "flutter/content_handler/vulkan_surface.h" -#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/flow/scene_update_context.h" #include "flutter/vulkan/vulkan_application.h" #include "flutter/vulkan/vulkan_device.h" @@ -17,11 +14,14 @@ #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" +#include "vulkan_surface.h" +#include "vulkan_surface_pool.h" -namespace flutter_runner { +namespace flutter { -class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer, - public vulkan::VulkanProvider { +class VulkanSurfaceProducer final + : public flow::SceneUpdateContext::SurfaceProducer, + public vulkan::VulkanProvider { public: VulkanSurfaceProducer(scenic_lib::Session* mozart_session); @@ -74,6 +74,4 @@ class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer, FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfaceProducer); }; -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +} // namespace flutter diff --git a/flow/BUILD.gn b/flow/BUILD.gn index e6a6411a6c1da..07c5d4e5d4e7b 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -48,11 +48,12 @@ source_set("flow") { "matrix_decomposition.h", "paint_utils.cc", "paint_utils.h", - "process_info.h", "raster_cache.cc", "raster_cache.h", "raster_cache_key.cc", "raster_cache_key.h", + "skia_gpu_object.cc", + "skia_gpu_object.h", "texture.cc", "texture.h", ] @@ -61,12 +62,11 @@ source_set("flow") { "//garnet/public/lib/fxl", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] deps = [ "$flutter_root/common", + "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/synchronization", "//third_party/skia", @@ -103,8 +103,8 @@ executable("flow_unittests") { deps = [ ":flow", - "//third_party/dart/runtime:libdart_jit", # for tracing "$flutter_root/testing", + "//third_party/dart/runtime:libdart_jit", # for tracing "//third_party/skia", ] } diff --git a/flow/compositor_context.cc b/flow/compositor_context.cc index e0d17229e7981..53659103be9f1 100644 --- a/flow/compositor_context.cc +++ b/flow/compositor_context.cc @@ -4,12 +4,12 @@ #include "flutter/flow/compositor_context.h" +#include "flutter/flow/layers/layer_tree.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { -CompositorContext::CompositorContext(std::unique_ptr info) - : process_info_(std::move(info)) {} +CompositorContext::CompositorContext() = default; CompositorContext::~CompositorContext() = default; @@ -18,10 +18,6 @@ void CompositorContext::BeginFrame(ScopedFrame& frame, if (enable_instrumentation) { frame_count_.Increment(); frame_time_.Start(); - - if (process_info_ && process_info_->SampleNow()) { - memory_usage_.Add(process_info_->GetResidentMemorySize()); - } } } @@ -33,11 +29,12 @@ void CompositorContext::EndFrame(ScopedFrame& frame, } } -CompositorContext::ScopedFrame CompositorContext::AcquireFrame( +std::unique_ptr CompositorContext::AcquireFrame( GrContext* gr_context, SkCanvas* canvas, bool instrumentation_enabled) { - return ScopedFrame(*this, gr_context, canvas, instrumentation_enabled); + return std::make_unique(*this, gr_context, canvas, + instrumentation_enabled); } CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, @@ -51,18 +48,23 @@ CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, context_.BeginFrame(*this, instrumentation_enabled_); } -CompositorContext::ScopedFrame::ScopedFrame(ScopedFrame&& frame) = default; - CompositorContext::ScopedFrame::~ScopedFrame() { context_.EndFrame(*this, instrumentation_enabled_); } +bool CompositorContext::ScopedFrame::Raster(flow::LayerTree& layer_tree, + bool ignore_raster_cache) { + layer_tree.Preroll(*this, ignore_raster_cache); + layer_tree.Paint(*this); + return true; +} + void CompositorContext::OnGrContextCreated() { - texture_registry_->OnGrContextCreated(); + texture_registry_.OnGrContextCreated(); } void CompositorContext::OnGrContextDestroyed() { - texture_registry_->OnGrContextDestroyed(); + texture_registry_.OnGrContextDestroyed(); raster_cache_.Clear(); } diff --git a/flow/compositor_context.h b/flow/compositor_context.h index 2d310422747b7..14c2449dbecd0 100644 --- a/flow/compositor_context.h +++ b/flow/compositor_context.h @@ -9,7 +9,6 @@ #include #include "flutter/flow/instrumentation.h" -#include "flutter/flow/process_info.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" #include "lib/fxl/macros.h" @@ -18,19 +17,26 @@ namespace flow { +class LayerTree; + class CompositorContext { public: class ScopedFrame { public: + ScopedFrame(CompositorContext& context, + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled); + + virtual ~ScopedFrame(); + SkCanvas* canvas() { return canvas_; } CompositorContext& context() const { return context_; } GrContext* gr_context() const { return gr_context_; } - ScopedFrame(ScopedFrame&& frame); - - ~ScopedFrame(); + virtual bool Raster(LayerTree& layer_tree, bool ignore_raster_cache); private: CompositorContext& context_; @@ -38,23 +44,17 @@ class CompositorContext { SkCanvas* canvas_; const bool instrumentation_enabled_; - ScopedFrame(CompositorContext& context, - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled); - - friend class CompositorContext; - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); }; - CompositorContext(std::unique_ptr info); + CompositorContext(); - ~CompositorContext(); + virtual ~CompositorContext(); - ScopedFrame AcquireFrame(GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled = true); + virtual std::unique_ptr AcquireFrame( + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled); void OnGrContextCreated(); @@ -62,7 +62,7 @@ class CompositorContext { RasterCache& raster_cache() { return raster_cache_; } - TextureRegistry& texture_registry() { return *texture_registry_; } + TextureRegistry& texture_registry() { return texture_registry_; } const Counter& frame_count() const { return frame_count_; } @@ -70,20 +70,12 @@ class CompositorContext { Stopwatch& engine_time() { return engine_time_; } - const CounterValues& memory_usage() const { return memory_usage_; } - - void SetTextureRegistry(TextureRegistry* textureRegistry) { - texture_registry_ = textureRegistry; - } - private: RasterCache raster_cache_; - TextureRegistry* texture_registry_; - std::unique_ptr process_info_; + TextureRegistry texture_registry_; Counter frame_count_; Stopwatch frame_time_; Stopwatch engine_time_; - CounterValues memory_usage_; void BeginFrame(ScopedFrame& frame, bool enable_instrumentation); diff --git a/flow/debug_print.cc b/flow/debug_print.cc index 0aa5b4b3b7d2d..3311b9c2b43e3 100644 --- a/flow/debug_print.cc +++ b/flow/debug_print.cc @@ -80,3 +80,8 @@ std::ostream& operator<<(std::ostream& os, const flow::RasterCacheKey& k) { ; return os; } + +std::ostream& operator<<(std::ostream& os, const SkISize& size) { + os << size.width() << ", " << size.height(); + return os; +} diff --git a/flow/debug_print.h b/flow/debug_print.h index ca5973eeb0977..78a28fe38562d 100644 --- a/flow/debug_print.h +++ b/flow/debug_print.h @@ -15,14 +15,15 @@ #define DEF_PRINTER(x) std::ostream& operator<<(std::ostream&, const x&); -DEF_PRINTER(flow::RasterCacheKey); DEF_PRINTER(flow::MatrixDecomposition); +DEF_PRINTER(flow::RasterCacheKey); +DEF_PRINTER(SkISize); DEF_PRINTER(SkMatrix); DEF_PRINTER(SkMatrix44); -DEF_PRINTER(SkVector3); -DEF_PRINTER(SkVector4); +DEF_PRINTER(SkPoint); DEF_PRINTER(SkRect); DEF_PRINTER(SkRRect); -DEF_PRINTER(SkPoint); +DEF_PRINTER(SkVector3); +DEF_PRINTER(SkVector4); #endif // FLUTTER_FLOW_DEBUG_PRINT_H_ diff --git a/flow/export_node.cc b/flow/export_node.cc index a130c426a75bf..27ab34030ca42 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -4,28 +4,27 @@ #include "flutter/flow/export_node.h" -#include "flutter/common/threads.h" #include "lib/fxl/functional/make_copyable.h" namespace flow { ExportNodeHolder::ExportNodeHolder( + fxl::RefPtr gpu_task_runner, fxl::RefPtr export_token_handle) - : export_node_(std::make_unique(export_token_handle)) { - ASSERT_IS_UI_THREAD; + : gpu_task_runner_(std::move(gpu_task_runner)), + export_node_(std::make_unique(export_token_handle)) { + FXL_DCHECK(gpu_task_runner_); } void ExportNodeHolder::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { - ASSERT_IS_GPU_THREAD; export_node_->Bind(context, container, offset, hit_testable); } ExportNodeHolder::~ExportNodeHolder() { - ASSERT_IS_UI_THREAD; - blink::Threads::Gpu()->PostTask( + gpu_task_runner_->PostTask( fxl::MakeCopyable([export_node = std::move(export_node_)]() { export_node->Dispose(true); })); @@ -44,8 +43,6 @@ void ExportNode::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { - ASSERT_IS_GPU_THREAD; - if (export_token_) { // Happens first time we bind. node_.reset(new scenic_lib::EntityNode(container.session())); @@ -67,8 +64,6 @@ void ExportNode::Bind(SceneUpdateContext& context, } void ExportNode::Dispose(bool remove_from_scene_update_context) { - ASSERT_IS_GPU_THREAD; - // If scene_update_context_ is set, then we should still have a node left to // dereference. // If scene_update_context_ is null, then either: diff --git a/flow/export_node.h b/flow/export_node.h index 24f94fcebf20f..e6a11175e561e 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -15,6 +15,7 @@ #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/ui/scenic/client/resources.h" +#include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" namespace flow { @@ -24,7 +25,8 @@ namespace flow { // held by the ExportNode. class ExportNodeHolder : public fxl::RefCountedThreadSafe { public: - ExportNodeHolder(fxl::RefPtr export_token_handle); + ExportNodeHolder(fxl::RefPtr gpu_task_runner, + fxl::RefPtr export_token_handle); ~ExportNodeHolder(); // Calls Bind() on the wrapped ExportNode. @@ -36,6 +38,7 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { ExportNode* export_node() { return export_node_.get(); } private: + fxl::RefPtr gpu_task_runner_; std::unique_ptr export_node_; FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index a33b0eaa681b7..ca228a7d58f76 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -137,20 +137,20 @@ void DefaultLayerBuilder::PushPerformanceOverlay(uint64_t enabled_options, } void DefaultLayerBuilder::PushPicture(const SkPoint& offset, - sk_sp picture, + SkiaGPUObject picture, bool picture_is_complex, bool picture_will_change) { if (!current_layer_) { return; } - SkRect pictureRect = picture->cullRect(); + SkRect pictureRect = picture.get()->cullRect(); pictureRect.offset(offset.x(), offset.y()); if (!SkRect::Intersects(pictureRect, cull_rects_.top())) { return; } auto layer = std::make_unique(); layer->set_offset(offset); - layer->set_picture(picture); + layer->set_picture(std::move(picture)); layer->set_is_complex(picture_is_complex); layer->set_will_change(picture_will_change); current_layer_->Add(std::move(layer)); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index a62ec46714d21..cadd173ab5a84 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -59,7 +59,7 @@ class DefaultLayerBuilder final : public LayerBuilder { // |flow::LayerBuilder| void PushPicture(const SkPoint& offset, - sk_sp picture, + SkiaGPUObject picture, bool picture_is_complex, bool picture_will_change) override; diff --git a/flow/layers/layer.h b/flow/layers/layer.h index d0ef1990ab4f2..cf7ad71c36fae 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -44,9 +44,6 @@ class Layer { virtual ~Layer(); struct PrerollContext { -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics = nullptr; -#endif RasterCache* raster_cache; GrContext* gr_context; SkColorSpace* dst_color_space; @@ -59,7 +56,6 @@ class Layer { SkCanvas& canvas; const Stopwatch& frame_time; const Stopwatch& engine_time; - const CounterValues& memory_usage; TextureRegistry& texture_registry; const bool checkerboard_offscreen_layers; }; diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index 91ae13974a23b..a29e959514428 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -8,6 +8,7 @@ #include #include "flutter/flow/layers/layer.h" +#include "flutter/flow/skia_gpu_object.h" #include "garnet/public/lib/fxl/macros.h" #include "third_party/skia/include/core/SkBlendMode.h" #include "third_party/skia/include/core/SkColor.h" @@ -57,7 +58,7 @@ class LayerBuilder { const SkRect& rect) = 0; virtual void PushPicture(const SkPoint& offset, - sk_sp picture, + SkiaGPUObject picture, bool picture_is_complex, bool picture_will_change) = 0; diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index fde2fc4bf0866..d9fb374194688 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -17,43 +17,18 @@ LayerTree::LayerTree() LayerTree::~LayerTree() = default; -void LayerTree::Raster(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif - bool ignore_raster_cache) { -#if defined(OS_FUCHSIA) - FXL_DCHECK(metrics); -#endif - Preroll(frame, -#if defined(OS_FUCHSIA) - metrics, -#endif - ignore_raster_cache); - Paint(frame); -} - void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool ignore_raster_cache) { -#if defined(OS_FUCHSIA) - FXL_DCHECK(metrics); -#endif TRACE_EVENT0("flutter", "LayerTree::Preroll"); SkColorSpace* color_space = frame.canvas() ? frame.canvas()->imageInfo().colorSpace() : nullptr; frame.context().raster_cache().SetCheckboardCacheImages( checkerboard_raster_cache_images_); Layer::PrerollContext context = { -#if defined(OS_FUCHSIA) - metrics, -#endif - ignore_raster_cache ? nullptr : &frame.context().raster_cache(), - frame.gr_context(), - color_space, - SkRect::MakeEmpty(), + ignore_raster_cache ? nullptr : &frame.context().raster_cache(), + frame.gr_context(), + color_space, + SkRect::MakeEmpty(), }; root_layer_->Preroll(&context, SkMatrix::I()); @@ -63,9 +38,12 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, void LayerTree::UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container) { TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); - - SceneUpdateContext::Transform transform(context, 1.f / device_pixel_ratio_, - 1.f / device_pixel_ratio_, 1.f); + const auto& metrics = context.metrics(); + SceneUpdateContext::Transform transform(context, // context + 1.0f / metrics->scale_x, // X + 1.0f / metrics->scale_y, // Y + 1.0f / metrics->scale_z // Z + ); SceneUpdateContext::Frame frame( context, SkRRect::MakeRect( @@ -82,12 +60,13 @@ void LayerTree::UpdateScene(SceneUpdateContext& context, #endif void LayerTree::Paint(CompositorContext::ScopedFrame& frame) const { - Layer::PaintContext context = {*frame.canvas(), - frame.context().frame_time(), - frame.context().engine_time(), - frame.context().memory_usage(), - frame.context().texture_registry(), - checkerboard_offscreen_layers_}; + Layer::PaintContext context = { + *frame.canvas(), // + frame.context().frame_time(), // + frame.context().engine_time(), // + frame.context().texture_registry(), // + checkerboard_offscreen_layers_ // + }; TRACE_EVENT0("flutter", "LayerTree::Paint"); if (root_layer_->needs_painting()) diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 5ddebd088de9e..25a8e072cfa21 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -13,9 +13,6 @@ #include "flutter/flow/layers/layer.h" #include "lib/fxl/macros.h" #include "lib/fxl/time/time_delta.h" -#if defined(OS_FUCHSIA) -#include -#endif #include "third_party/skia/include/core/SkSize.h" namespace flow { @@ -26,24 +23,10 @@ class LayerTree { ~LayerTree(); - // Raster includes both Preroll and Paint. - void Raster(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif - bool ignore_raster_cache = false); - void Preroll(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool ignore_raster_cache = false); #if defined(OS_FUCHSIA) - void set_device_pixel_ratio(float device_pixel_ratio) { - device_pixel_ratio_ = device_pixel_ratio; - } - void UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container); #endif @@ -93,10 +76,6 @@ class LayerTree { bool checkerboard_raster_cache_images_; bool checkerboard_offscreen_layers_; -#if defined(OS_FUCHSIA) - float device_pixel_ratio_ = 1.f; -#endif - FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree); }; diff --git a/flow/layers/performance_overlay_layer.cc b/flow/layers/performance_overlay_layer.cc index cc55500115a08..7d871af33b94f 100644 --- a/flow/layers/performance_overlay_layer.cc +++ b/flow/layers/performance_overlay_layer.cc @@ -57,34 +57,6 @@ void VisualizeStopWatch(SkCanvas& canvas, } } -void VisualizeCounterValuesBytes(SkCanvas& canvas, - const CounterValues& counter_values, - SkScalar x, - SkScalar y, - SkScalar width, - SkScalar height, - bool show_graph, - bool show_labels, - const std::string& label_prefix) { - 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); - counter_values.Visualize(canvas, visualization_rect); - } - - auto current_usage = counter_values.GetCurrentValue(); - - if (show_labels && current_usage > 0) { - std::stringstream stream; - stream.setf(std::ios::fixed | std::ios::showpoint); - stream << std::setprecision(2); - stream << label_prefix << " " << current_usage * 1e-6 << " MB"; - DrawStatisticsText(canvas, stream.str(), x + label_x, y + height + label_y); - } -} - } // namespace PerformanceOverlayLayer::PerformanceOverlayLayer(uint64_t options) @@ -111,11 +83,6 @@ void PerformanceOverlayLayer::Paint(PaintContext& context) const { VisualizeStopWatch(context.canvas, context.engine_time, x, y + height, width, height - padding, options_ & kVisualizeEngineStatistics, options_ & kDisplayEngineStatistics, "UI"); - - VisualizeCounterValuesBytes( - context.canvas, context.memory_usage, x, y + (2 * height), width, - height - padding, options_ & kVisualizeMemoryStatistics, - options_ & kDisplayMemoryStatistics, "Memory (Resident)"); } } // namespace flow diff --git a/flow/layers/performance_overlay_layer.h b/flow/layers/performance_overlay_layer.h index e7c3ac530a02a..77448107147a4 100644 --- a/flow/layers/performance_overlay_layer.h +++ b/flow/layers/performance_overlay_layer.h @@ -14,8 +14,6 @@ const int kDisplayRasterizerStatistics = 1 << 0; const int kVisualizeRasterizerStatistics = 1 << 1; const int kDisplayEngineStatistics = 1 << 2; const int kVisualizeEngineStatistics = 1 << 3; -const int kDisplayMemoryStatistics = 1 << 4; -const int kVisualizeMemoryStatistics = 1 << 5; class PerformanceOverlayLayer : public Layer { public: diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index 4a99d7d07f75e..552ca0443bd80 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -4,39 +4,30 @@ #include "flutter/flow/layers/picture_layer.h" -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace flow { PictureLayer::PictureLayer() = default; -PictureLayer::~PictureLayer() { - // The picture may contain references to textures that are associated - // with the IO thread's context. - SkPicture* picture = picture_.release(); - if (picture) { - blink::Threads::IO()->PostTask([picture]() { picture->unref(); }); - } -} +PictureLayer::~PictureLayer() = default; void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { + SkPicture* sk_picture = picture(); + if (auto cache = context->raster_cache) { raster_cache_result_ = cache->GetPrerolledImage( - context->gr_context, picture_.get(), matrix, context->dst_color_space, -#if defined(OS_FUCHSIA) - context->metrics, -#endif + context->gr_context, sk_picture, matrix, context->dst_color_space, is_complex_, will_change_); } - SkRect bounds = picture_->cullRect().makeOffset(offset_.x(), offset_.y()); + SkRect bounds = sk_picture->cullRect().makeOffset(offset_.x(), offset_.y()); set_paint_bounds(bounds); } void PictureLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PictureLayer::Paint"); - FXL_DCHECK(picture_); + FXL_DCHECK(picture_.get()); FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); @@ -53,7 +44,7 @@ void PictureLayer::Paint(PaintContext& context) const { SkCanvas::kStrict_SrcRectConstraint // source constraint ); } else { - context.canvas.drawPicture(picture_.get()); + context.canvas.drawPicture(picture()); } } diff --git a/flow/layers/picture_layer.h b/flow/layers/picture_layer.h index 191ef9d7097a2..c67929b7cb455 100644 --- a/flow/layers/picture_layer.h +++ b/flow/layers/picture_layer.h @@ -5,8 +5,11 @@ #ifndef FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ #define FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ +#include + #include "flutter/flow/layers/layer.h" #include "flutter/flow/raster_cache.h" +#include "flutter/flow/skia_gpu_object.h" namespace flow { @@ -16,12 +19,14 @@ class PictureLayer : public Layer { ~PictureLayer() override; void set_offset(const SkPoint& offset) { offset_ = offset; } - void set_picture(sk_sp picture) { picture_ = std::move(picture); } + void set_picture(SkiaGPUObject picture) { + picture_ = std::move(picture); + } void set_is_complex(bool value) { is_complex_ = value; } void set_will_change(bool value) { will_change_ = value; } - SkPicture* picture() const { return picture_.get(); } + SkPicture* picture() const { return picture_.get().get(); } void Preroll(PrerollContext* frame, const SkMatrix& matrix) override; @@ -29,7 +34,9 @@ class PictureLayer : public Layer { private: SkPoint offset_; - sk_sp picture_; + // Even though pictures themselves are not GPU resources, they may reference + // images that have a reference to a GPU resource. + SkiaGPUObject picture_; bool is_complex_ = false; bool will_change_ = false; RasterCacheResult raster_cache_result_; diff --git a/flow/process_info.h b/flow/process_info.h deleted file mode 100644 index 6623fe7257396..0000000000000 --- a/flow/process_info.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_FLOW_PROCESS_INFO_H_ -#define FLUTTER_FLOW_PROCESS_INFO_H_ - -#include "lib/fxl/macros.h" - -namespace flow { - -/// The CompositorContext attempts to collect information from the process for -/// instrumentation purposes. The compositor does not have the platform -/// specific capabilities to collect this information on its own. The platform -/// can choose to provide this information however. -class ProcessInfo { - public: - virtual ~ProcessInfo() = default; - - virtual bool SampleNow() = 0; - - /// Virtual memory size in bytes. - virtual size_t GetVirtualMemorySize() = 0; - - /// Resident memory size in bytes. - virtual size_t GetResidentMemorySize() = 0; -}; - -} // namespace flow - -#endif // FLUTTER_FLOW_PROCESS_INFO_H_ diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index aa9fad0e281de..11a86729b489b 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -6,7 +6,6 @@ #include -#include "flutter/common/threads.h" #include "flutter/flow/paint_utils.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @@ -73,9 +72,6 @@ RasterCacheResult RasterizePicture(SkPicture* picture, GrContext* context, const MatrixDecomposition& matrix, SkColorSpace* dst_color_space, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool checkerboard) { TRACE_EVENT0("flutter", "RasterCachePopulate"); @@ -83,17 +79,9 @@ RasterCacheResult RasterizePicture(SkPicture* picture, const SkRect logical_rect = picture->cullRect(); -#if defined(OS_FUCHSIA) - float metrics_scale_x = metrics->scale_x; - float metrics_scale_y = metrics->scale_y; -#else - float metrics_scale_x = 1.f; - float metrics_scale_y = 1.f; -#endif - - const SkRect physical_rect = SkRect::MakeWH( - std::fabs(logical_rect.width() * metrics_scale_x * scale.x()), - std::fabs(logical_rect.height() * metrics_scale_y * scale.y())); + const SkRect physical_rect = + SkRect::MakeWH(std::fabs(logical_rect.width() * scale.x()), + std::fabs(logical_rect.height() * scale.y())); const SkImageInfo image_info = SkImageInfo::MakeN32Premul( std::ceil(physical_rect.width()), // physical width @@ -120,8 +108,7 @@ RasterCacheResult RasterizePicture(SkPicture* picture, } canvas->clear(SK_ColorTRANSPARENT); - canvas->scale(std::abs(scale.x() * metrics_scale_x), - std::abs(scale.y() * metrics_scale_y)); + canvas->scale(std::abs(scale.x()), std::abs(scale.y())); canvas->translate(-logical_rect.left(), -logical_rect.top()); canvas->drawPicture(picture); @@ -153,9 +140,6 @@ RasterCacheResult RasterCache::GetPrerolledImage( SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool is_complex, bool will_change) { if (!IsPictureWorthRasterizing(picture, will_change, is_complex)) { @@ -172,11 +156,7 @@ RasterCacheResult RasterCache::GetPrerolledImage( return {}; } - RasterCacheKey cache_key(*picture, -#if defined(OS_FUCHSIA) - metrics->scale_x, metrics->scale_y, -#endif - matrix); + RasterCacheKey cache_key(*picture, matrix); Entry& entry = cache_[cache_key]; entry.access_count = ClampSize(entry.access_count + 1, 0, threshold_); @@ -189,9 +169,6 @@ RasterCacheResult RasterCache::GetPrerolledImage( if (!entry.image.is_valid()) { entry.image = RasterizePicture(picture, context, matrix, dst_color_space, -#if defined(OS_FUCHSIA) - metrics, -#endif checkerboard_images_); } diff --git a/flow/raster_cache.h b/flow/raster_cache.h index 31201049b6119..3278eb355b030 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -12,9 +12,6 @@ #include "flutter/flow/raster_cache_key.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" -#if defined(OS_FUCHSIA) -#include -#endif #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -57,9 +54,6 @@ class RasterCache { SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool is_complex, bool will_change); diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index 83df52658c981..1f28ea5320d36 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -15,30 +15,15 @@ namespace flow { class RasterCacheKey { public: - RasterCacheKey(const SkPicture& picture, -#if defined(OS_FUCHSIA) - float metrics_scale_x, - float metrics_scale_y, -#endif - const MatrixDecomposition& matrix) + RasterCacheKey(const SkPicture& picture, const MatrixDecomposition& matrix) : picture_id_(picture.uniqueID()), -#if defined(OS_FUCHSIA) - metrics_scale_x_(metrics_scale_x), - metrics_scale_y_(metrics_scale_y), -#endif - scale_key_( - SkISize::Make(matrix.scale().x() * 1e3, matrix.scale().y() * 1e3)) { - } + scale_key_(SkISize::Make(matrix.scale().x() * 1e3, + matrix.scale().y() * 1e3)) {} uint32_t picture_id() const { return picture_id_; } const SkISize& scale_key() const { return scale_key_; } -#if defined(OS_FUCHSIA) - float metrics_scale_x() const { return metrics_scale_x_; } - float metrics_scale_y() const { return metrics_scale_y_; } -#endif - struct Hash { std::size_t operator()(RasterCacheKey const& key) const { return key.picture_id_; @@ -49,11 +34,6 @@ class RasterCacheKey { constexpr bool operator()(const RasterCacheKey& lhs, const RasterCacheKey& rhs) const { return lhs.picture_id_ == rhs.picture_id_ && -#if defined(OS_FUCHSIA) - lhs.metrics_scale_x_ == rhs.metrics_scale_x_ && - - lhs.metrics_scale_y_ == rhs.metrics_scale_y_ && -#endif lhs.scale_key_ == rhs.scale_key_; } }; @@ -63,10 +43,6 @@ class RasterCacheKey { private: uint32_t picture_id_; -#if defined(OS_FUCHSIA) - float metrics_scale_x_; - float metrics_scale_y_; -#endif SkISize scale_key_; }; diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index 83883c508b4df..b9d6801cc82ee 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -4,7 +4,6 @@ #include "flutter/flow/scene_update_context.h" -#include "flutter/common/threads.h" #include "flutter/flow/export_node.h" #include "flutter/flow/layers/layer.h" #include "flutter/flow/matrix_decomposition.h" @@ -19,9 +18,7 @@ SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session, } SceneUpdateContext::~SceneUpdateContext() { - ASSERT_IS_GPU_THREAD; - - // Release Scenic session resources for all ExportNodes. + // Release Mozart session resources for all ExportNodes. for (auto export_node : export_nodes_) { export_node->Dispose(false); } @@ -30,21 +27,16 @@ SceneUpdateContext::~SceneUpdateContext() { void SceneUpdateContext::AddChildScene(ExportNode* export_node, SkPoint offset, bool hit_testable) { - ASSERT_IS_GPU_THREAD; FXL_DCHECK(top_entity_); export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable); } void SceneUpdateContext::AddExportNode(ExportNode* export_node) { - ASSERT_IS_GPU_THREAD; - export_nodes_.insert(export_node); // Might already have been added. } void SceneUpdateContext::RemoveExportNode(ExportNode* export_node) { - ASSERT_IS_GPU_THREAD; - export_nodes_.erase(export_node); } @@ -195,12 +187,9 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { for (auto& task : paint_tasks_) { FXL_DCHECK(task.surface); SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas(); - Layer::PaintContext context = {*canvas, - frame.context().frame_time(), + Layer::PaintContext context = {*canvas, frame.context().frame_time(), frame.context().engine_time(), - frame.context().memory_usage(), - frame.context().texture_registry(), - false}; + frame.context().texture_registry(), false}; canvas->restoreToCount(1); canvas->save(); canvas->clear(task.background_color); diff --git a/flow/skia_gpu_object.cc b/flow/skia_gpu_object.cc new file mode 100644 index 0000000000000..ce2312f921580 --- /dev/null +++ b/flow/skia_gpu_object.cc @@ -0,0 +1,44 @@ +// Copyright 2017 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/skia_gpu_object.h" + +#include "flutter/fml/message_loop.h" + +namespace flow { + +SkiaUnrefQueue::SkiaUnrefQueue(fxl::RefPtr task_runner, + fxl::TimeDelta delay) + : task_runner_(std::move(task_runner)), + drain_delay_(delay), + drain_pending_(false) {} + +SkiaUnrefQueue::~SkiaUnrefQueue() { + Drain(); +} + +void SkiaUnrefQueue::Unref(SkRefCnt* object) { + std::lock_guard lock(mutex_); + objects_.push_back(object); + if (!drain_pending_) { + drain_pending_ = true; + task_runner_->PostDelayedTask( + [strong = fxl::Ref(this)]() { strong->Drain(); }, drain_delay_); + } +} + +void SkiaUnrefQueue::Drain() { + std::deque skia_objects; + { + std::lock_guard lock(mutex_); + objects_.swap(skia_objects); + drain_pending_ = false; + } + + for (SkRefCnt* skia_object : skia_objects) { + skia_object->unref(); + } +} + +} // namespace flow diff --git a/flow/skia_gpu_object.h b/flow/skia_gpu_object.h new file mode 100644 index 0000000000000..4711f80c6f4fd --- /dev/null +++ b/flow/skia_gpu_object.h @@ -0,0 +1,88 @@ +// Copyright 2017 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_FLOW_SKIA_GPU_OBJECT_H_ +#define FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ + +#include +#include + +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/task_runner.h" +#include "lib/fxl/memory/ref_ptr.h" +#include "third_party/skia/include/core/SkRefCnt.h" + +namespace flow { + +// A queue that holds Skia objects that must be destructed on the the given task +// runner. +class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { + public: + void Unref(SkRefCnt* object); + + // Usually, the drain is called automatically. However, during IO manager + // shutdown (when the platform side reference to the OpenGL context is about + // to go away), we may need to pre-emptively drain the unref queue. It is the + // responsibility of the caller to ensure that no further unrefs are queued + // after this call. + void Drain(); + + private: + const fxl::RefPtr task_runner_; + const fxl::TimeDelta drain_delay_; + std::mutex mutex_; + std::deque objects_; + bool drain_pending_; + + SkiaUnrefQueue(fxl::RefPtr task_runner, + fxl::TimeDelta delay); + + ~SkiaUnrefQueue(); + + FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); + FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); + FXL_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); +}; + +/// An object whose deallocation needs to be performed on an specific unref +/// queue. The template argument U need to have a call operator that returns +/// that unref queue. +template +class SkiaGPUObject { + public: + using SkiaObjectType = T; + + SkiaGPUObject() = default; + + SkiaGPUObject(sk_sp object, fxl::RefPtr queue) + : object_(std::move(object)), queue_(std::move(queue)) { + FXL_DCHECK(queue_ && object_); + } + + SkiaGPUObject(SkiaGPUObject&&) = default; + + ~SkiaGPUObject() { reset(); } + + SkiaGPUObject& operator=(SkiaGPUObject&&) = default; + + sk_sp get() const { return object_; } + + void reset() { + if (object_) { + queue_->Unref(object_.release()); + } + queue_ = nullptr; + FXL_DCHECK(object_ == nullptr); + } + + private: + sk_sp object_; + fxl::RefPtr queue_; + + FXL_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); +}; + +} // namespace flow + +#endif // FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ diff --git a/flow/texture.cc b/flow/texture.cc index 33a48af989477..d5cc3ae228aa7 100644 --- a/flow/texture.cc +++ b/flow/texture.cc @@ -11,36 +11,32 @@ TextureRegistry::TextureRegistry() = default; TextureRegistry::~TextureRegistry() = default; void TextureRegistry::RegisterTexture(std::shared_ptr texture) { - ASSERT_IS_GPU_THREAD mapping_[texture->Id()] = texture; } void TextureRegistry::UnregisterTexture(int64_t id) { - ASSERT_IS_GPU_THREAD mapping_.erase(id); } void TextureRegistry::OnGrContextCreated() { - ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextCreated(); } } void TextureRegistry::OnGrContextDestroyed() { - ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextDestroyed(); } } std::shared_ptr TextureRegistry::GetTexture(int64_t id) { - ASSERT_IS_GPU_THREAD auto it = mapping_.find(id); return it != mapping_.end() ? it->second : nullptr; } Texture::Texture(int64_t id) : id_(id) {} + Texture::~Texture() = default; } // namespace flow diff --git a/flow/texture.h b/flow/texture.h index a602a6b45b5b4..f5e4430834084 100644 --- a/flow/texture.h +++ b/flow/texture.h @@ -6,7 +6,7 @@ #define FLUTTER_FLOW_TEXTURE_H_ #include -#include "flutter/common/threads.h" + #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -29,6 +29,9 @@ class Texture { // Called from GPU thread. virtual void OnGrContextDestroyed() = 0; + // Called on GPU thread. + virtual void MarkNewFrameAvailable() = 0; + int64_t Id() { return id_; } private: diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 6dabcb446c912..ffbf949cc0957 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -4,9 +4,12 @@ source_set("fml") { sources = [ + "file.h", "icu_util.cc", "icu_util.h", + "mapping.cc", "mapping.h", + "memory/thread_checker.h", "memory/weak_ptr.h", "memory/weak_ptr_internal.cc", "memory/weak_ptr_internal.h", @@ -14,8 +17,9 @@ source_set("fml") { "message_loop.h", "message_loop_impl.cc", "message_loop_impl.h", + "native_library.h", + "paths.cc", "paths.h", - "task_observer.h", "task_runner.cc", "task_runner.h", "thread.cc", @@ -23,6 +27,9 @@ source_set("fml") { "thread_local.h", "trace_event.cc", "trace_event.h", + "unique_fd.cc", + "unique_fd.h", + "unique_object.h", ] deps = [ @@ -95,16 +102,25 @@ source_set("fml") { ] } + if (is_fuchsia) { + sources += [ "platform/fuchsia/paths_fuchsia.cc" ] + } + if (is_win) { sources += [ + "platform/win/file_win.cc", "platform/win/mapping_win.cc", "platform/win/message_loop_win.cc", "platform/win/message_loop_win.h", + "platform/win/native_library_win.cc", "platform/win/paths_win.cc", + "platform/win/wstring_conversion.h", ] } else { sources += [ + "platform/posix/file_posix.cc", "platform/posix/mapping_posix.cc", + "platform/posix/native_library_posix.cc", ] } } diff --git a/fml/file.h b/fml/file.h new file mode 100644 index 0000000000000..2327b2eef831e --- /dev/null +++ b/fml/file.h @@ -0,0 +1,35 @@ +// Copyright 2018 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_FILE_H_ +#define FLUTTER_FML_FILE_H_ + +#include "flutter/fml/unique_fd.h" +#include "lib/fxl/macros.h" + +namespace fml { + +enum class OpenPermission { + kRead = 1, + kWrite = 1 << 1, + kReadWrite = kRead | kWrite, + kExecute, +}; + +fml::UniqueFD OpenFile(const char* path, + OpenPermission permission, + bool is_directory = false); + +fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, + const char* path, + OpenPermission permission, + bool is_directory = false); + +fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor); + +bool IsDirectory(const fml::UniqueFD& directory); + +} // namespace fml + +#endif // FLUTTER_FML_FILE_H_ diff --git a/fml/icu_util.cc b/fml/icu_util.cc index 093dc3d02b1bc..0c0acd06dbbdf 100644 --- a/fml/icu_util.cc +++ b/fml/icu_util.cc @@ -22,8 +22,6 @@ static constexpr char kPathSeparator = '\\'; static constexpr char kPathSeparator = '/'; #endif -static constexpr char kIcuDataFileName[] = "icudtl.dat"; - class ICUContext { public: ICUContext(const std::string& icu_data_path) : valid_(false) { @@ -34,15 +32,15 @@ class ICUContext { bool SetupMapping(const std::string& icu_data_path) { // Check if the explicit path specified exists. - auto overriden_path_mapping = std::make_unique(icu_data_path); - if (overriden_path_mapping->GetSize() != 0) { - mapping_ = std::move(overriden_path_mapping); + auto path_mapping = std::make_unique(icu_data_path, false); + if (path_mapping->GetSize() != 0) { + mapping_ = std::move(path_mapping); return true; } // Check to see if the mapping is in the resources bundle. if (PlatformHasResourcesBundle()) { - auto resource = GetResourceMapping(kIcuDataFileName); + auto resource = GetResourceMapping(icu_data_path); if (resource != nullptr && resource->GetSize() != 0) { mapping_ = std::move(resource); return true; @@ -57,10 +55,8 @@ class ICUContext { return false; } - // FIXME(chinmaygarde): There is no Path::Join in FXL. So a non-portable - // version is used here. Patch FXL and update. auto file = std::make_unique( - directory.second + kPathSeparator + kIcuDataFileName); + directory.second + kPathSeparator + icu_data_path, false); if (file->GetSize() != 0) { mapping_ = std::move(file); return true; @@ -96,7 +92,8 @@ class ICUContext { void InitializeICUOnce(const std::string& icu_data_path) { static ICUContext* context = new ICUContext(icu_data_path); - FXL_CHECK(context->IsValid()) << "Must be able to initialize the ICU context"; + FXL_CHECK(context->IsValid()) + << "Must be able to initialize the ICU context. Tried: " << icu_data_path; } std::once_flag g_icu_init_flag; diff --git a/fml/macros.h b/fml/macros.h new file mode 100644 index 0000000000000..ba46b9dda4b4d --- /dev/null +++ b/fml/macros.h @@ -0,0 +1,20 @@ +// Copyright 2018 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_MACROS_H_ +#define FLUTTER_FML_MACROS_H_ + +#include "lib/fxl/macros.h" + +#ifndef FML_USED_ON_EMBEDDER + +#define FML_EMBEDDER_ONLY [[deprecated]] + +#else // FML_USED_ON_EMBEDDER + +#define FML_EMBEDDER_ONLY + +#endif // FML_USED_ON_EMBEDDER + +#endif // FLUTTER_FML_MACROS_H_ diff --git a/fml/mapping.cc b/fml/mapping.cc new file mode 100644 index 0000000000000..97d7905015f61 --- /dev/null +++ b/fml/mapping.cc @@ -0,0 +1,20 @@ +// Copyright 2018 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/mapping.h" + +namespace fml { + +DataMapping::DataMapping(std::vector data) : data_(std::move(data)) {} + +DataMapping::~DataMapping() = default; + +size_t DataMapping::GetSize() const { + return data_.size(); +} + +const uint8_t* DataMapping::GetMapping() const { + return data_.data(); +} +} // namespace fml diff --git a/fml/mapping.h b/fml/mapping.h index 8963b22a9c1f6..00e9685dd6b0c 100644 --- a/fml/mapping.h +++ b/fml/mapping.h @@ -7,14 +7,10 @@ #include #include +#include +#include "flutter/fml//unique_fd.h" #include "lib/fxl/build_config.h" - -#if OS_WIN -#include -#endif - -#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { @@ -39,12 +35,9 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name); class FileMapping : public Mapping { public: - FileMapping(const std::string& path); + FileMapping(const std::string& path, bool executable = false); -// fxl::UniqueFD isn't supported for Windows handles. -#if !OS_WIN - FileMapping(const fxl::UniqueFD& fd); -#endif + FileMapping(const fml::UniqueFD& fd, bool executable = false); ~FileMapping() override; @@ -53,16 +46,32 @@ class FileMapping : public Mapping { const uint8_t* GetMapping() const override; private: - size_t size_; - uint8_t* mapping_; + size_t size_ = 0; + uint8_t* mapping_ = nullptr; #if OS_WIN - HANDLE mapping_handle_; + fml::UniqueFD mapping_handle_; #endif FXL_DISALLOW_COPY_AND_ASSIGN(FileMapping); }; +class DataMapping : public Mapping { + public: + DataMapping(std::vector data); + + ~DataMapping() override; + + size_t GetSize() const override; + + const uint8_t* GetMapping() const override; + + private: + std::vector data_; + + FXL_DISALLOW_COPY_AND_ASSIGN(DataMapping); +}; + } // namespace fml #endif // FLUTTER_FML_MAPPING_H_ diff --git a/fml/memory/thread_checker.h b/fml/memory/thread_checker.h new file mode 100644 index 0000000000000..f22e9d1cfaf06 --- /dev/null +++ b/fml/memory/thread_checker.h @@ -0,0 +1,69 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// A class for checking that the current thread is/isn't the same as an initial +// thread. + +#ifndef FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ +#define FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ + +#include "lib/fxl/build_config.h" + +#if defined(OS_WIN) +#include +#else +#include +#endif + +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" + +namespace fml { + +// A simple class that records the identity of the thread that it was created +// on, and at later points can tell if the current thread is the same as its +// creation thread. This class is thread-safe. +// +// Note: Unlike Chromium's |base::ThreadChecker|, this is *not* Debug-only (so +// #ifdef it out if you want something Debug-only). (Rationale: Having a +// |CalledOnValidThread()| that lies in Release builds seems bad. Moreover, +// there's a small space cost to having even an empty class. ) +class ThreadChecker final { + public: +#if defined(OS_WIN) + ThreadChecker() : self_(GetCurrentThreadId()) {} + ~ThreadChecker() {} + + bool IsCreationThreadCurrent() const { return GetCurrentThreadId() == self_; } + + private: + DWORD self_; + +#else + ThreadChecker() : self_(pthread_self()) {} + ~ThreadChecker() {} + + // Returns true if the current thread is the thread this object was created + // on and false otherwise. + bool IsCreationThreadCurrent() const { + return !!pthread_equal(pthread_self(), self_); + } + + private: + pthread_t self_; +#endif +}; + +#ifndef NDEBUG +#define FML_DECLARE_THREAD_CHECKER(c) fml::ThreadChecker c +#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) \ + FXL_DCHECK((c).IsCreationThreadCurrent()) +#else +#define FML_DECLARE_THREAD_CHECKER(c) +#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) ((void)0) +#endif + +} // namespace fml + +#endif // FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ diff --git a/fml/memory/weak_ptr.h b/fml/memory/weak_ptr.h index 5b85c531966b2..2b369952d7306 100644 --- a/fml/memory/weak_ptr.h +++ b/fml/memory/weak_ptr.h @@ -10,12 +10,17 @@ #include +#include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr_internal.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_counted.h" namespace fml { +struct DebugThreadChecker { + FML_DECLARE_THREAD_CHECKER(checker); +}; + // Forward declaration, so |WeakPtr| can friend it. template class WeakPtrFactory; @@ -41,13 +46,17 @@ class WeakPtr { WeakPtr(const WeakPtr& r) = default; template - WeakPtr(const WeakPtr& r) : ptr_(r.ptr_), flag_(r.flag_) {} + WeakPtr(const WeakPtr& r) + : ptr_(static_cast(r.ptr_)), flag_(r.flag_), checker_(r.checker_) {} // Move constructor. WeakPtr(WeakPtr&& r) = default; template - WeakPtr(WeakPtr&& r) : ptr_(r.ptr_), flag_(std::move(r.flag_)) {} + WeakPtr(WeakPtr&& r) + : ptr_(static_cast(r.ptr_)), + flag_(std::move(r.flag_)), + checker_(r.checker_) {} ~WeakPtr() = default; @@ -65,16 +74,24 @@ class WeakPtr { // The following methods should only be called on the same thread as the // "originating" |WeakPtrFactory|. - explicit operator bool() const { return flag_ && flag_->is_valid(); } + explicit operator bool() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); + return flag_ && flag_->is_valid(); + } - T* get() const { return *this ? ptr_ : nullptr; } + T* get() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); + return *this ? ptr_ : nullptr; + } T& operator*() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return *get(); } T* operator->() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return get(); } @@ -85,11 +102,14 @@ class WeakPtr { friend class WeakPtrFactory; - explicit WeakPtr(T* ptr, fxl::RefPtr&& flag) - : ptr_(ptr), flag_(std::move(flag)) {} + explicit WeakPtr(T* ptr, + fxl::RefPtr&& flag, + DebugThreadChecker checker) + : ptr_(ptr), flag_(std::move(flag)), checker_(checker) {} T* ptr_; fxl::RefPtr flag_; + DebugThreadChecker checker_; // Copy/move construction/assignment supported. }; @@ -140,19 +160,22 @@ template class WeakPtrFactory { public: explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { FXL_DCHECK(ptr_); } + ~WeakPtrFactory() { InvalidateWeakPtrs(); } // Gets a new weak pointer, which will be valid until either // |InvalidateWeakPtrs()| is called or this object is destroyed. WeakPtr GetWeakPtr() { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) flag_ = fxl::MakeRefCounted(); - return WeakPtr(ptr_, flag_.Clone()); + return WeakPtr(ptr_, flag_.Clone(), checker_); } // Call this method to invalidate all existing weak pointers. (Note that // additional weak pointers can be produced even after this is called.) void InvalidateWeakPtrs() { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) return; flag_->Invalidate(); @@ -162,13 +185,17 @@ class WeakPtrFactory { // Call this method to determine if any weak pointers exist. (Note that a // "false" result is definitive, but a "true" result may not be if weak // pointers are held/reset/destroyed/reassigned on other threads.) - bool HasWeakPtrs() const { return flag_ && !flag_->HasOneRef(); } + bool HasWeakPtrs() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); + return flag_ && !flag_->HasOneRef(); + } private: // Note: See weak_ptr_internal.h for an explanation of why we store the // pointer here, instead of in the "flag". T* const ptr_; fxl::RefPtr flag_; + DebugThreadChecker checker_; FXL_DISALLOW_COPY_AND_ASSIGN(WeakPtrFactory); }; diff --git a/fml/message_loop.cc b/fml/message_loop.cc index 4765cfa76558f..44a0e307c1dd1 100644 --- a/fml/message_loop.cc +++ b/fml/message_loop.cc @@ -55,7 +55,7 @@ void MessageLoop::Terminate() { loop_->DoTerminate(); } -fxl::RefPtr MessageLoop::GetTaskRunner() const { +fxl::RefPtr MessageLoop::GetTaskRunner() const { return task_runner_; } @@ -63,12 +63,12 @@ fxl::RefPtr MessageLoop::GetLoopImpl() const { return loop_; } -void MessageLoop::AddTaskObserver(TaskObserver* observer) { - loop_->AddTaskObserver(observer); +void MessageLoop::AddTaskObserver(intptr_t key, fxl::Closure callback) { + loop_->AddTaskObserver(key, callback); } -void MessageLoop::RemoveTaskObserver(TaskObserver* observer) { - loop_->RemoveTaskObserver(observer); +void MessageLoop::RemoveTaskObserver(intptr_t key) { + loop_->RemoveTaskObserver(key); } void MessageLoop::RunExpiredTasksNow() { diff --git a/fml/message_loop.h b/fml/message_loop.h index 87773619ccc51..3bfb1c40c6df7 100644 --- a/fml/message_loop.h +++ b/fml/message_loop.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_MESSAGE_LOOP_H_ #define FLUTTER_FML_MESSAGE_LOOP_H_ -#include "flutter/fml/task_observer.h" +#include "flutter/fml/macros.h" #include "lib/fxl/macros.h" #include "lib/fxl/tasks/task_runner.h" @@ -16,6 +16,7 @@ class MessageLoopImpl; class MessageLoop { public: + FML_EMBEDDER_ONLY static MessageLoop& GetCurrent(); bool IsValid() const; @@ -24,11 +25,11 @@ class MessageLoop { void Terminate(); - void AddTaskObserver(TaskObserver* observer); + void AddTaskObserver(intptr_t key, fxl::Closure callback); - void RemoveTaskObserver(TaskObserver* observer); + void RemoveTaskObserver(intptr_t key); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; // Exposed for the embedder shell which allows clients to poll for events // instead of dedicating a thread to the message loop. diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index cec9b7e448f1a..df885f3792d5f 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -2,6 +2,8 @@ // 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 @@ -11,35 +13,29 @@ #include "lib/fxl/build_config.h" #if OS_MACOSX - #include "flutter/fml/platform/darwin/message_loop_darwin.h" -using PlatformMessageLoopImpl = fml::MessageLoopDarwin; - #elif OS_ANDROID - #include "flutter/fml/platform/android/message_loop_android.h" -using PlatformMessageLoopImpl = fml::MessageLoopAndroid; - #elif OS_LINUX - #include "flutter/fml/platform/linux/message_loop_linux.h" -using PlatformMessageLoopImpl = fml::MessageLoopLinux; - #elif OS_WIN - #include "flutter/fml/platform/win/message_loop_win.h" -using PlatformMessageLoopImpl = fml::MessageLoopWin; - -#else - -#error This platform does not have a message loop implementation. - #endif namespace fml { fxl::RefPtr MessageLoopImpl::Create() { - return fxl::MakeRefCounted<::PlatformMessageLoopImpl>(); +#if OS_MACOSX + return fxl::MakeRefCounted(); +#elif OS_ANDROID + return fxl::MakeRefCounted(); +#elif OS_LINUX + return fxl::MakeRefCounted(); +#elif OS_WIN + return fxl::MakeRefCounted(); +#else + return nullptr; +#endif } MessageLoopImpl::MessageLoopImpl() : order_(0), terminated_(false) {} @@ -55,20 +51,19 @@ void MessageLoopImpl::RunExpiredTasksNow() { RunExpiredTasks(); } -void MessageLoopImpl::AddTaskObserver(TaskObserver* observer) { - FXL_DCHECK(observer != nullptr); +void MessageLoopImpl::AddTaskObserver(intptr_t key, fxl::Closure callback) { + FXL_DCHECK(callback != nullptr); FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be added on the same thread as the " "loop."; - task_observers_.insert(observer); + task_observers_[key] = std::move(callback); } -void MessageLoopImpl::RemoveTaskObserver(TaskObserver* observer) { - FXL_DCHECK(observer != nullptr); +void MessageLoopImpl::RemoveTaskObserver(intptr_t key) { FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be removed from the same thread as " "the loop."; - task_observers_.erase(observer); + task_observers_.erase(key); } void MessageLoopImpl::DoRun() { @@ -144,7 +139,7 @@ void MessageLoopImpl::RunExpiredTasks() { for (const auto& invocation : invocations) { invocation(); for (const auto& observer : task_observers_) { - observer->DidProcessTask(); + observer.second(); } } } diff --git a/fml/message_loop_impl.h b/fml/message_loop_impl.h index bfdb2064cb264..478cbd1f1a0be 100644 --- a/fml/message_loop_impl.h +++ b/fml/message_loop_impl.h @@ -7,9 +7,9 @@ #include #include +#include #include #include -#include #include #include "flutter/fml/message_loop.h" @@ -34,9 +34,9 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { void PostTask(fxl::Closure task, fxl::TimePoint target_time); - void AddTaskObserver(TaskObserver* observer); + void AddTaskObserver(intptr_t key, fxl::Closure callback); - void RemoveTaskObserver(TaskObserver* observer); + void RemoveTaskObserver(intptr_t key); void DoRun(); @@ -71,7 +71,7 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { using DelayedTaskQueue = std:: priority_queue, DelayedTaskCompare>; - std::set task_observers_; + std::map task_observers_; std::mutex delayed_tasks_mutex_; DelayedTaskQueue delayed_tasks_; size_t order_; diff --git a/fml/message_loop_unittests.cc b/fml/message_loop_unittests.cc index 11ea72c3900eb..cd2acd308b46a 100644 --- a/fml/message_loop_unittests.cc +++ b/fml/message_loop_unittests.cc @@ -2,9 +2,12 @@ // 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 #include "flutter/fml/message_loop.h" +#include "flutter/fml/task_runner.h" #include "gtest/gtest.h" #include "lib/fxl/synchronization/waitable_event.h" @@ -244,22 +247,6 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) { ASSERT_EQ(checked, count); } -class CustomTaskObserver : public fml::TaskObserver { - public: - CustomTaskObserver(std::function lambda) : lambda_(lambda){}; - - ~CustomTaskObserver() override = default; - - void DidProcessTask() override { - if (lambda_) { - lambda_(); - } - }; - - private: - std::function lambda_; -}; - TEST(MessageLoop, TaskObserverFire) { bool started = false; bool terminated = false; @@ -269,8 +256,7 @@ TEST(MessageLoop, TaskObserverFire) { auto& loop = fml::MessageLoop::GetCurrent(); size_t task_count = 0; size_t obs_count = 0; - CustomTaskObserver obs( - PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }); + auto obs = PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }; for (size_t i = 0; i < count; i++) { loop.GetTaskRunner()->PostTask( PLATFORM_SPECIFIC_CAPTURE(&terminated, i, &task_count)() { @@ -282,7 +268,7 @@ TEST(MessageLoop, TaskObserverFire) { } }); } - loop.AddTaskObserver(&obs); + loop.AddTaskObserver(0, obs); loop.Run(); ASSERT_EQ(task_count, count); ASSERT_EQ(obs_count, count); diff --git a/fml/native_library.h b/fml/native_library.h new file mode 100644 index 0000000000000..7e48ed6d3a3ff --- /dev/null +++ b/fml/native_library.h @@ -0,0 +1,52 @@ +// Copyright 2018 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_NATIVE_LIBRARY_H_ +#define FLUTTER_FML_NATIVE_LIBRARY_H_ + +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" + +#if OS_WIN + +#include + +#endif // OS_WIN + +namespace fml { +class NativeLibrary : public fxl::RefCountedThreadSafe { + public: +#if OS_WIN + using Handle = HMODULE; +#else // OS_WIN + using Handle = void*; +#endif // OS_WIN + + static fxl::RefPtr Create(const char* path); + + static fxl::RefPtr CreateForCurrentProcess(); + + const uint8_t* ResolveSymbol(const char* symbol); + + private: + Handle handle_ = nullptr; + bool close_handle_ = true; + + NativeLibrary(const char* path); + + NativeLibrary(Handle handle, bool close_handle); + + ~NativeLibrary(); + + Handle GetHandle() const; + + FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrary); + FRIEND_REF_COUNTED_THREAD_SAFE(NativeLibrary); + FRIEND_MAKE_REF_COUNTED(NativeLibrary); +}; + +} // namespace fml + +#endif // FLUTTER_FML_NATIVE_LIBRARY_H_ diff --git a/fml/paths.cc b/fml/paths.cc new file mode 100644 index 0000000000000..9b06b6847f415 --- /dev/null +++ b/fml/paths.cc @@ -0,0 +1,31 @@ +// Copyright 2018 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/paths.h" + +#include "lib/fxl/build_config.h" + +namespace fml { +namespace paths { + +std::string JoinPaths(std::initializer_list components) { + std::stringstream stream; + size_t i = 0; + const size_t size = components.size(); + for (const auto& component : components) { + i++; + stream << component; + if (i != size) { +#if OS_WIN + stream << "\\"; +#else // OS_WIN + stream << "/"; +#endif // OS_WIN + } + } + return stream.str(); +} + +} // namespace paths +} // namespace fml diff --git a/fml/paths.h b/fml/paths.h index 8ec3b4b580476..0d4367654de4a 100644 --- a/fml/paths.h +++ b/fml/paths.h @@ -8,11 +8,15 @@ #include #include +#include "lib/fxl/strings/string_view.h" + namespace fml { namespace paths { std::pair GetExecutableDirectoryPath(); +std::string JoinPaths(std::initializer_list components); + } // namespace paths } // namespace fml diff --git a/fml/platform/android/message_loop_android.h b/fml/platform/android/message_loop_android.h index e6d04e8253401..19c1eafe79845 100644 --- a/fml/platform/android/message_loop_android.h +++ b/fml/platform/android/message_loop_android.h @@ -10,7 +10,7 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "lib/fxl/files/unique_fd.h" +#include "flutter/fml/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/unique_object.h" @@ -24,8 +24,8 @@ struct UniqueLooperTraits { class MessageLoopAndroid : public MessageLoopImpl { private: - fxl::UniqueObject looper_; - fxl::UniqueFD timer_fd_; + fml::UniqueObject looper_; + fml::UniqueFD timer_fd_; bool running_; MessageLoopAndroid(); diff --git a/fml/platform/darwin/resource_mapping_darwin.mm b/fml/platform/darwin/resource_mapping_darwin.mm index 5d1b9664e20bc..3ee100121ad0f 100644 --- a/fml/platform/darwin/resource_mapping_darwin.mm +++ b/fml/platform/darwin/resource_mapping_darwin.mm @@ -9,8 +9,8 @@ namespace fml { ResourceMappingDarwin::ResourceMappingDarwin(const std::string& resource) - : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String]) { -} + : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String], + false) {} ResourceMappingDarwin::~ResourceMappingDarwin() = default; diff --git a/fml/platform/fuchsia/paths_fuchsia.cc b/fml/platform/fuchsia/paths_fuchsia.cc new file mode 100644 index 0000000000000..20def9f34fae9 --- /dev/null +++ b/fml/platform/fuchsia/paths_fuchsia.cc @@ -0,0 +1,15 @@ +// Copyright 2018 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/paths.h" + +namespace fml { +namespace paths { + +std::pair GetExecutableDirectoryPath() { + return {false, ""}; +} + +} // namespace paths +} // namespace fml diff --git a/fml/platform/linux/message_loop_linux.h b/fml/platform/linux/message_loop_linux.h index 51dc690ce887b..ba5e902d4ac89 100644 --- a/fml/platform/linux/message_loop_linux.h +++ b/fml/platform/linux/message_loop_linux.h @@ -8,15 +8,15 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "lib/fxl/files/unique_fd.h" +#include "flutter/fml/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { class MessageLoopLinux : public MessageLoopImpl { private: - fxl::UniqueFD epoll_fd_; - fxl::UniqueFD timer_fd_; + fml::UniqueFD epoll_fd_; + fml::UniqueFD timer_fd_; bool running_; MessageLoopLinux(); diff --git a/fml/platform/posix/file_posix.cc b/fml/platform/posix/file_posix.cc new file mode 100644 index 0000000000000..028f49f4d183d --- /dev/null +++ b/fml/platform/posix/file_posix.cc @@ -0,0 +1,71 @@ +// Copyright 2018 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/file.h" + +#include +#include +#include + +#include "lib/fxl/files/eintr_wrapper.h" + +namespace fml { + +fml::UniqueFD OpenFile(const char* path, + OpenPermission permission, + bool is_directory) { + return OpenFile(fml::UniqueFD{AT_FDCWD}, path, permission, is_directory); +} + +fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, + const char* path, + OpenPermission permission, + bool is_directory) { + if (path == nullptr) { + return fml::UniqueFD{}; + } + + int flags = 0; + switch (permission) { + case OpenPermission::kRead: + flags = O_RDONLY; + break; + case OpenPermission::kWrite: + flags = O_WRONLY; + break; + case OpenPermission::kReadWrite: + flags = O_RDWR; + break; + case OpenPermission::kExecute: + flags = O_RDONLY; + break; + } + + if (is_directory) { + flags |= O_DIRECTORY; + } + + return fml::UniqueFD{ + HANDLE_EINTR(::openat(base_directory.get(), path, flags))}; +} + +fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { + return fml::UniqueFD{HANDLE_EINTR(::dup(descriptor))}; +} + +bool IsDirectory(const fml::UniqueFD& directory) { + if (!directory.is_valid()) { + return false; + } + + struct stat stat_result = {}; + + if (::fstat(directory.get(), &stat_result) != 0) { + return false; + } + + return S_ISDIR(stat_result.st_mode); +} + +} // namespace fml diff --git a/fml/platform/posix/mapping_posix.cc b/fml/platform/posix/mapping_posix.cc index 07f7edb074ab9..fc53d6a4f7fc9 100644 --- a/fml/platform/posix/mapping_posix.cc +++ b/fml/platform/posix/mapping_posix.cc @@ -11,6 +11,7 @@ #include +#include "flutter/fml/unique_fd.h" #include "lib/fxl/build_config.h" #include "lib/fxl/files/eintr_wrapper.h" @@ -39,11 +40,11 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path) - : FileMapping(fxl::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}) { -} +FileMapping::FileMapping(const std::string& path, bool executable) + : FileMapping(fml::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}, + executable) {} -FileMapping::FileMapping(const fxl::UniqueFD& handle) +FileMapping::FileMapping(const fml::UniqueFD& handle, bool executable) : size_(0), mapping_(nullptr) { if (!handle.is_valid()) { return; @@ -59,8 +60,13 @@ FileMapping::FileMapping(const fxl::UniqueFD& handle) return; } - auto mapping = ::mmap(nullptr, stat_buffer.st_size, PROT_READ, MAP_PRIVATE, - handle.get(), 0); + int flags = PROT_READ; + if (executable) { + flags |= PROT_EXEC; + } + + auto mapping = + ::mmap(nullptr, stat_buffer.st_size, flags, MAP_PRIVATE, handle.get(), 0); if (mapping == MAP_FAILED) { return; diff --git a/fml/platform/posix/native_library_posix.cc b/fml/platform/posix/native_library_posix.cc new file mode 100644 index 0000000000000..1255c38fc0821 --- /dev/null +++ b/fml/platform/posix/native_library_posix.cc @@ -0,0 +1,60 @@ +// Copyright 2018 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/native_library.h" + +#include +#include + +namespace fml { + +NativeLibrary::NativeLibrary(const char* path) { + ::dlerror(); + handle_ = ::dlopen(path, RTLD_NOW); + if (handle_ == nullptr) { + FXL_LOG(ERROR) << "Could not open library '" << path << "' due to error '" + << ::dlerror() << "'."; + } +} + +NativeLibrary::NativeLibrary(Handle handle, bool close_handle) + : handle_(handle), close_handle_(close_handle) {} + +NativeLibrary::~NativeLibrary() { + if (handle_ == nullptr) { + return; + } + + if (close_handle_) { + ::dlerror(); + if (::dlclose(handle_) != 0) { + handle_ = nullptr; + FXL_LOG(ERROR) << "Could not close library due to error '" << ::dlerror() + << "'."; + } + } +} + +NativeLibrary::Handle NativeLibrary::GetHandle() const { + return handle_; +} + +fxl::RefPtr NativeLibrary::Create(const char* path) { + auto library = fxl::AdoptRef(new NativeLibrary(path)); + return library->GetHandle() != nullptr ? library : nullptr; +} + +fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { + return fxl::AdoptRef(new NativeLibrary(RTLD_DEFAULT, false)); +} + +const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { + auto resolved_symbol = static_cast(::dlsym(handle_, symbol)); + if (resolved_symbol == nullptr) { + FXL_DLOG(ERROR) << "Could not resolve symbol in library: " << symbol; + } + return resolved_symbol; +} + +} // namespace fml diff --git a/fml/platform/win/file_win.cc b/fml/platform/win/file_win.cc new file mode 100644 index 0000000000000..3f5e90494b013 --- /dev/null +++ b/fml/platform/win/file_win.cc @@ -0,0 +1,119 @@ +// Copyright 2018 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/file.h" + +#include + +#include + +#include "flutter/fml/platform/win/wstring_conversion.h" + +namespace fml { + +fml::UniqueFD OpenFile(const std::wstring& path, + OpenPermission permission, + bool is_directory) { + if (path.size() == 0) { + return fml::UniqueFD{}; + } + + DWORD desired_access = 0; + + switch (permission) { + case OpenPermission::kRead: + desired_access = GENERIC_READ; + break; + case OpenPermission::kWrite: + desired_access = GENERIC_WRITE; + break; + case OpenPermission::kReadWrite: + desired_access = GENERIC_WRITE | GENERIC_READ; + break; + case OpenPermission::kExecute: + desired_access = GENERIC_READ | GENERIC_EXECUTE; + break; + } + + return fml::UniqueFD{::CreateFile( + path.c_str(), // lpFileName + desired_access, // dwDesiredAccess + FILE_SHARE_READ, // dwShareMode + 0, // lpSecurityAttributes + OPEN_EXISTING, // dwCreationDisposition + FILE_ATTRIBUTE_NORMAL, // dwFlagsAndAttributes + 0 // hTemplateFile + )}; +} + +fml::UniqueFD OpenFile(const char* path, + OpenPermission permission, + bool is_directory) { + return OpenFile(ConvertToWString(path), permission, is_directory); +} + +static std::wstring GetFullHandlePath(const fml::UniqueFD& handle) { + wchar_t buffer[MAX_PATH]; + + DWORD returned = ::GetFinalPathNameByHandle(handle.get(), buffer, MAX_PATH, + FILE_NAME_NORMALIZED); + if (returned == 0 || returned > MAX_PATH) { + return {}; + } + + return {buffer}; +} + +fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, + const char* path, + OpenPermission permission, + bool is_directory) { + // If the base directory is invalid or the path is absolute, use the generic + // open file variant. + if (!base_directory.is_valid()) { + return OpenFile(path, permission, is_directory); + } + + const auto wpath = ConvertToWString(path); + + if (!::PathIsRelative(wpath.c_str())) { + return OpenFile(path, permission, is_directory); + } + + std::wstringstream stream; + stream << GetFullHandlePath(base_directory) << "\\" << path; + return OpenFile(stream.str(), permission, is_directory); +} + +fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { + if (descriptor == INVALID_HANDLE_VALUE) { + return fml::UniqueFD{}; + } + + HANDLE duplicated = INVALID_HANDLE_VALUE; + + if (!::DuplicateHandle( + GetCurrentProcess(), // source process + descriptor, // source handle + GetCurrentProcess(), // target process + &duplicated, // target handle + 0, // desired access (ignored because DUPLICATE_SAME_ACCESS) + FALSE, // inheritable + DUPLICATE_SAME_ACCESS) // options + ) { + return fml::UniqueFD{}; + } + + return fml::UniqueFD{duplicated}; +} + +bool IsDirectory(const fml::UniqueFD& directory) { + BY_HANDLE_FILE_INFORMATION info; + if (!::GetFileInformationByHandle(directory.get(), &info)) { + return false; + } + return info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; +} + +} // namespace fml diff --git a/fml/platform/win/mapping_win.cc b/fml/platform/win/mapping_win.cc index fd404a14f37dc..9dd5dcf6f2249 100644 --- a/fml/platform/win/mapping_win.cc +++ b/fml/platform/win/mapping_win.cc @@ -5,13 +5,13 @@ #include "flutter/fml/mapping.h" #include +#include +#include #include -#include "lib/fxl/build_config.h" - -#include -#include +#include "flutter/fml/file.h" +#include "flutter/fml/platform/win/wstring_conversion.h" using PlatformResourceMapping = fml::FileMapping; @@ -29,47 +29,50 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path) - : size_(0), mapping_(nullptr) { - HANDLE file_handle_ = - CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, - FILE_SHARE_READ, nullptr, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); +FileMapping::FileMapping(const std::string& path, bool executable) + : FileMapping(OpenFile(path.c_str(), + executable ? OpenPermission::kExecute + : OpenPermission::kRead, + false), + executable) {} - if (file_handle_ == INVALID_HANDLE_VALUE) { +FileMapping::FileMapping(const fml::UniqueFD& fd, bool executable) + : size_(0), mapping_(nullptr) { + if (!fd.is_valid()) { return; } - size_ = GetFileSize(file_handle_, nullptr); - if (size_ == INVALID_FILE_SIZE) { - size_ = 0; - return; + if (auto size = ::GetFileSize(fd.get(), nullptr)) { + if (size > 0) { + size_ = size; + } else { + return; + } } - mapping_handle_ = CreateFileMapping(file_handle_, nullptr, PAGE_READONLY, 0, - size_, nullptr); + const DWORD protect = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; - CloseHandle(file_handle_); + mapping_handle_.reset(::CreateFileMapping(fd.get(), // hFile + nullptr, // lpAttributes + protect, // flProtect + 0, // dwMaximumSizeHigh + 0, // dwMaximumSizeLow + nullptr // lpName + )); - if (mapping_handle_ == INVALID_HANDLE_VALUE) { + if (!mapping_handle_.is_valid()) { return; } - auto mapping = MapViewOfFile(mapping_handle_, FILE_MAP_READ, 0, 0, size_); - - if (mapping == INVALID_HANDLE_VALUE) { - CloseHandle(mapping_handle_); - mapping_handle_ = INVALID_HANDLE_VALUE; - return; - } + const DWORD desired_access = executable ? FILE_MAP_ALL_ACCESS : FILE_MAP_READ; - mapping_ = static_cast(mapping); + mapping_ = reinterpret_cast( + MapViewOfFile(mapping_handle_.get(), desired_access, 0, 0, size_)); } FileMapping::~FileMapping() { if (mapping_ != nullptr) { UnmapViewOfFile(mapping_); - CloseHandle(mapping_handle_); } } diff --git a/fml/platform/win/native_library_win.cc b/fml/platform/win/native_library_win.cc new file mode 100644 index 0000000000000..6992f06f3e886 --- /dev/null +++ b/fml/platform/win/native_library_win.cc @@ -0,0 +1,51 @@ +// Copyright 2018 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/native_library.h" + +#include + +#include "flutter/fml/platform/win/wstring_conversion.h" + +namespace fml { + +NativeLibrary::NativeLibrary(const char* path) + : handle_(nullptr), close_handle_(true) { + if (path == nullptr) { + return; + } + + handle_ = ::LoadLibrary(ConvertToWString(path).c_str()); +} + +NativeLibrary::NativeLibrary(Handle handle, bool close_handle) + : handle_(handle), close_handle_(close_handle) {} + +NativeLibrary::~NativeLibrary() { + if (handle_ != nullptr && close_handle_) { + ::FreeLibrary(handle_); + } +} + +NativeLibrary::Handle NativeLibrary::GetHandle() const { + return handle_; +} + +fxl::RefPtr NativeLibrary::Create(const char* path) { + auto library = fxl::AdoptRef(new NativeLibrary(path)); + return library->GetHandle() != nullptr ? library : nullptr; +} + +fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { + return fxl::AdoptRef(new NativeLibrary(::GetModuleHandle(nullptr), false)); +} + +const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { + if (symbol == nullptr || handle_ == nullptr) { + return nullptr; + } + return reinterpret_cast(::GetProcAddress(handle_, symbol)); +} + +} // namespace fml diff --git a/fml/platform/win/wstring_conversion.h b/fml/platform/win/wstring_conversion.h new file mode 100644 index 0000000000000..0682dd84067bf --- /dev/null +++ b/fml/platform/win/wstring_conversion.h @@ -0,0 +1,25 @@ +// Copyright 2018 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_WIN_WSTRING_CONVERSION_H_ +#define FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ + +#include +#include +#include + +namespace fml { + +inline std::wstring ConvertToWString(const char* path) { + if (path == nullptr) { + return {}; + } + std::string path8(path); + std::wstring_convert, wchar_t> wchar_conv; + return wchar_conv.from_bytes(path8); +} + +} // namespace fml + +#endif // FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ diff --git a/fml/task_observer.h b/fml/task_observer.h deleted file mode 100644 index 21697cf022005..0000000000000 --- a/fml/task_observer.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_FML_TASK_OBSERVER_H_ -#define FLUTTER_FML_TASK_OBSERVER_H_ - -#include "lib/fxl/macros.h" - -namespace fml { - -class TaskObserver { - public: - virtual ~TaskObserver() = default; - - virtual void DidProcessTask() = 0; -}; - -} // namespace fml - -#endif // FLUTTER_FML_TASK_OBSERVER_H_ diff --git a/fml/task_runner.cc b/fml/task_runner.cc index 3d13674d78c11..95f91de8e9124 100644 --- a/fml/task_runner.cc +++ b/fml/task_runner.cc @@ -2,6 +2,8 @@ // 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/task_runner.h" #include @@ -38,4 +40,14 @@ bool TaskRunner::RunsTasksOnCurrentThread() { return MessageLoop::GetCurrent().GetLoopImpl() == loop_; } +void TaskRunner::RunNowOrPostTask(fxl::RefPtr runner, + fxl::Closure task) { + FXL_DCHECK(runner); + if (runner->RunsTasksOnCurrentThread()) { + task(); + } else { + runner->PostTask(std::move(task)); + } +} + } // namespace fml diff --git a/fml/task_runner.h b/fml/task_runner.h index 20ea85e4e521b..3b3d2de01639d 100644 --- a/fml/task_runner.h +++ b/fml/task_runner.h @@ -13,7 +13,7 @@ namespace fml { class MessageLoopImpl; -class TaskRunner : public fxl::TaskRunner { +class TaskRunner final : public fxl::TaskRunner { public: void PostTask(fxl::Closure task) override; @@ -23,12 +23,15 @@ class TaskRunner : public fxl::TaskRunner { bool RunsTasksOnCurrentThread() override; + static void RunNowOrPostTask(fxl::RefPtr runner, + fxl::Closure task); + private: fxl::RefPtr loop_; TaskRunner(fxl::RefPtr loop); - ~TaskRunner(); + ~TaskRunner() override; FRIEND_MAKE_REF_COUNTED(TaskRunner); FRIEND_REF_COUNTED_THREAD_SAFE(TaskRunner); diff --git a/fml/thread.cc b/fml/thread.cc index a1500bfef46a4..de4ee6dd368a8 100644 --- a/fml/thread.cc +++ b/fml/thread.cc @@ -2,6 +2,8 @@ // 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/thread.h" #include "lib/fxl/build_config.h" @@ -22,7 +24,7 @@ namespace fml { Thread::Thread(const std::string& name) : joined_(false) { fxl::AutoResetWaitableEvent latch; - fxl::RefPtr runner; + fxl::RefPtr runner; thread_ = std::make_unique([&latch, &runner, name]() -> void { SetCurrentThreadName(name); fml::MessageLoop::EnsureInitializedForCurrentThread(); @@ -39,7 +41,7 @@ Thread::~Thread() { Join(); } -fxl::RefPtr Thread::GetTaskRunner() const { +fxl::RefPtr Thread::GetTaskRunner() const { return task_runner_; } @@ -84,7 +86,8 @@ void Thread::SetCurrentThreadName(const std::string& name) { } __except (EXCEPTION_CONTINUE_EXECUTION) { } #else -#error Unsupported Platform + FXL_DLOG(INFO) << "Could not set the thread name to '" << name + << "' on this platform."; #endif } diff --git a/fml/thread.h b/fml/thread.h index 44062f1032116..542871f788845 100644 --- a/fml/thread.h +++ b/fml/thread.h @@ -9,8 +9,8 @@ #include #include +#include "flutter/fml/task_runner.h" #include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" namespace fml { @@ -20,13 +20,13 @@ class Thread { ~Thread(); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; void Join(); private: std::unique_ptr thread_; - fxl::RefPtr task_runner_; + fxl::RefPtr task_runner_; std::atomic_bool joined_; static void SetCurrentThreadName(const std::string& name); diff --git a/fml/unique_fd.cc b/fml/unique_fd.cc new file mode 100644 index 0000000000000..bab79f7a9b743 --- /dev/null +++ b/fml/unique_fd.cc @@ -0,0 +1,35 @@ +// Copyright 2018 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/unique_fd.h" + +#include "lib/fxl/files/eintr_wrapper.h" + +namespace fml { +namespace internal { + +#if OS_WIN + +namespace win { + +void UniqueFDTraits::Free(HANDLE fd) { + CloseHandle(fd); +} + +} // namespace win + +#else // OS_WIN + +namespace unix { + +void UniqueFDTraits::Free(int fd) { + IGNORE_EINTR(fd); +} + +} // namespace unix + +#endif // OS_WIN + +} // namespace internal +} // namespace fml diff --git a/fml/unique_fd.h b/fml/unique_fd.h new file mode 100644 index 0000000000000..9f2d796579d8c --- /dev/null +++ b/fml/unique_fd.h @@ -0,0 +1,60 @@ +// Copyright 2018 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_UNIQUE_FD_H_ +#define FLUTTER_FML_UNIQUE_FD_H_ + +#include "flutter/fml/unique_object.h" +#include "lib/fxl/build_config.h" + +#if OS_WIN + +#include + +#endif // OS_WIN + +namespace fml { +namespace internal { + +#if OS_WIN + +namespace win { + +struct UniqueFDTraits { + static HANDLE InvalidValue() { return INVALID_HANDLE_VALUE; } + static bool IsValid(HANDLE value) { return value != InvalidValue(); } + static void Free(HANDLE fd); +}; + +} // namespace win + +#else // OS_WIN + +namespace unix { + +struct UniqueFDTraits { + static int InvalidValue() { return -1; } + static bool IsValid(int value) { return value >= 0; } + static void Free(int fd); +}; + +} // namespace unix + +#endif // OS_WIN + +} // namespace internal + +#if OS_WIN + +using UniqueFD = UniqueObject; + +#else // OS_WIN + +using UniqueFD = UniqueObject; + +#endif // OS_WIN + +} // namespace fml + +#endif // FLUTTER_FML_UNIQUE_FD_H_ diff --git a/fml/unique_object.h b/fml/unique_object.h new file mode 100644 index 0000000000000..e2487a53881a9 --- /dev/null +++ b/fml/unique_object.h @@ -0,0 +1,137 @@ +// Copyright 2018 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_UNIQUE_OBJECT_H_ +#define FLUTTER_FML_UNIQUE_OBJECT_H_ + +#include + +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" + +namespace fml { + +// struct UniqueFooTraits { +// // This function should be fast an inline. +// static int InvalidValue() { return 0; } +// +// // This function should be fast an inline. +// static bool IsValid(const T& value) { return value != InvalidValue(); } +// +// // This free function will not be called if f == InvalidValue()! +// static void Free(int f) { ::FreeFoo(f); } +// }; + +template +class UniqueObject { + private: + // This must be first since it's used inline below. + // + // Use the empty base class optimization to allow us to have a Traits + // member, while avoiding any space overhead for it when Traits is an + // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good + // discussion of this technique. + struct Data : public Traits { + explicit Data(const T& in) : generic(in) {} + Data(const T& in, const Traits& other) : Traits(other), generic(in) {} + + T generic; + }; + + public: + using element_type = T; + using traits_type = Traits; + + UniqueObject() : data_(Traits::InvalidValue()) {} + explicit UniqueObject(const T& value) : data_(value) {} + + UniqueObject(const T& value, const Traits& traits) : data_(value, traits) {} + + UniqueObject(UniqueObject&& other) + : data_(other.release(), other.get_traits()) {} + + ~UniqueObject() { FreeIfNecessary(); } + + UniqueObject& operator=(UniqueObject&& other) { + reset(other.release()); + return *this; + } + + void reset(const T& value = Traits::InvalidValue()) { + FXL_CHECK(data_.generic == Traits::InvalidValue() || + data_.generic != value); + FreeIfNecessary(); + data_.generic = value; + } + + void swap(UniqueObject& other) { + // Standard swap idiom: 'using std::swap' ensures that std::swap is + // present in the overload set, but we call swap unqualified so that + // any more-specific overloads can be used, if available. + using std::swap; + swap(static_cast(data_), static_cast(other.data_)); + swap(data_.generic, other.data_.generic); + } + + // Release the object. The return value is the current object held by this + // object. After this operation, this object will hold an invalid value, and + // will not own the object any more. + T release() FXL_WARN_UNUSED_RESULT { + T old_generic = data_.generic; + data_.generic = Traits::InvalidValue(); + return old_generic; + } + + const T& get() const { return data_.generic; } + + bool is_valid() const { return Traits::IsValid(data_.generic); } + + bool operator==(const T& value) const { return data_.generic == value; } + + bool operator!=(const T& value) const { return data_.generic != value; } + + Traits& get_traits() { return data_; } + const Traits& get_traits() const { return data_; } + + private: + void FreeIfNecessary() { + if (data_.generic != Traits::InvalidValue()) { + data_.Free(data_.generic); + data_.generic = Traits::InvalidValue(); + } + } + + // Forbid comparison. If U != T, it totally doesn't make sense, and if U == + // T, it still doesn't make sense because you should never have the same + // object owned by two different UniqueObject. + template + bool operator==(const UniqueObject& p2) const = delete; + + template + bool operator!=(const UniqueObject& p2) const = delete; + + Data data_; + + FXL_DISALLOW_COPY_AND_ASSIGN(UniqueObject); +}; + +template +void swap(const UniqueObject& a, const UniqueObject& b) { + a.swap(b); +} + +template +bool operator==(const T& value, const UniqueObject& object) { + return value == object.get(); +} + +template +bool operator!=(const T& value, const UniqueObject& object) { + return !(value == object.get()); +} + +} // namespace fml + +#endif // FLUTTER_FML_UNIQUE_OBJECT_H_ diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 2b53ffc4d4f6d..8c568f4773c90 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -29,20 +29,40 @@ if (is_fuchsia) { # The sole purpose of this target is to generate a .packages file. sources = [] - infer_package_name = true + dot_packages_file = "$target_gen_dir/snapshot.packages" + outputs = [ + dot_packages_file, + ] + deps = [] + foreach(dep, dart_deps) { + deps += [ "$dep($dart_toolchain)" ] + } disable_analysis = true - deps = [ - "//topaz/public/dart/fuchsia", - "//topaz/public/dart/zircon", - ] + script = "//build/dart/gen_dot_packages.py" + args = [ + "--out", + rebase_path(dot_packages_file, root_build_dir), + "--source-dir", + rebase_path("."), + "--root-build-dir", + rebase_path(root_build_dir), + "--root-gen-dir", + rebase_path(dart_root_gen_dir), + "--package-name", + "snapshot_root", + "--depfile", + rebase_path(depfile), + "--deps", + ] + dart_deps } } action("generate_snapshot_bin") { if (is_fuchsia) { snapshot_dart = "snapshot_fuchsia.dart" + # TODO(rmacnak): Fuchsia cross builds use the wrong Dart target # architecture, and have added steps that depend on this error for # reasonable build times (e.g., invoking the analyzer). @@ -85,9 +105,9 @@ action("generate_snapshot_bin") { rebased_dart_ui_path = rebase_path(dart_ui_path) - gen_snapshot_dir = - get_label_info("//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", - "root_out_dir") + gen_snapshot_dir = get_label_info( + "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", + "root_out_dir") script = "//third_party/dart/runtime/tools/create_snapshot_bin.py" args = [ @@ -209,7 +229,7 @@ bin_to_assembly("isolate_snapshot_data_assembly") { ] input = "$target_gen_dir/isolate_snapshot.bin" output = "$target_gen_dir/isolate_snapshot_data.S" - symbol = "kDartIsolateCoreSnapshotData" + symbol = "kDartIsolateSnapshotData" executable = false } @@ -219,7 +239,7 @@ bin_to_assembly("isolate_snapshot_instructions_assembly") { ] input = "$target_gen_dir/isolate_snapshot_instructions.bin" output = "$target_gen_dir/isolate_snapshot_instructions.S" - symbol = "kDartIsolateCoreSnapshotInstructions" + symbol = "kDartIsolateSnapshotInstructions" executable = true } @@ -249,9 +269,9 @@ compile_platform("non_strong_platform") { ] args = [ - "--target=flutter", - "dart:core", - ] + "--target=flutter", + "dart:core", + ] } compile_platform("strong_platform") { @@ -265,10 +285,10 @@ compile_platform("strong_platform") { ] args = [ - "--target=flutter", - "--strong", - "dart:core" - ] + "--target=flutter", + "--strong", + "dart:core", + ] } group("kernel_platform_files") { diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 8b3be72d5973b..6a75cd22c8614 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -40,14 +40,10 @@ source_set("ui") { "painting/picture.h", "painting/picture_recorder.cc", "painting/picture_recorder.h", - "painting/resource_context.cc", - "painting/resource_context.h", "painting/rrect.cc", "painting/rrect.h", "painting/shader.cc", "painting/shader.h", - "painting/utils.cc", - "painting/utils.h", "painting/vertices.cc", "painting/vertices.h", "semantics/semantics_node.cc", @@ -87,19 +83,18 @@ source_set("ui") { "window/window.h", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] deps = [ - "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", + "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/runtime:test_font", "$flutter_root/sky/engine", "$flutter_root/third_party/txt", + "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", diff --git a/lib/ui/compositing/scene_builder.cc b/lib/ui/compositing/scene_builder.cc index 006826abbfdf6..60b911cb4ddec 100644 --- a/lib/ui/compositing/scene_builder.cc +++ b/lib/ui/compositing/scene_builder.cc @@ -120,10 +120,11 @@ void SceneBuilder::addPicture(double dx, double dy, Picture* picture, int hints) { - layer_builder_->PushPicture(SkPoint::Make(dx, dy), // - picture->picture(), // - !!(hints & 1), // picture is complex - !!(hints & 2) // picture will change + layer_builder_->PushPicture( + SkPoint::Make(dx, dy), // + UIDartState::CreateGPUObject(picture->picture()), // + !!(hints & 1), // picture is complex + !!(hints & 2) // picture will change ); } diff --git a/lib/ui/compositing/scene_host.cc b/lib/ui/compositing/scene_host.cc index c0e4c5332580a..f5e0cfb3547d8 100644 --- a/lib/ui/compositing/scene_host.cc +++ b/lib/ui/compositing/scene_host.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/compositing/scene_host.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" @@ -37,8 +38,9 @@ fxl::RefPtr SceneHost::create( } SceneHost::SceneHost(fxl::RefPtr export_token_handle) { - export_node_holder_ = - fxl::MakeRefCounted(export_token_handle); + export_node_holder_ = fxl::MakeRefCounted( + blink::UIDartState::Current()->GetTaskRunners().GetGPUTaskRunner(), + export_token_handle); } #else fxl::RefPtr SceneHost::create(Dart_Handle export_token_handle) { diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index edd51245b05db..32a244c9cb67d 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -8,7 +8,11 @@ #include #include +#include +#include + #include "flutter/common/settings.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/tonic/converter/dart_converter.h" @@ -141,17 +145,43 @@ void DartRuntimeHooks::Install(IsolateType isolate_type, // Implementation of native functions which are used for some // test/debug functionality in standalone dart mode. void Logger_PrintString(Dart_NativeArguments args) { - intptr_t length = 0; - uint8_t* chars = nullptr; - Dart_Handle str = Dart_GetNativeArgument(args, 0); - Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); - if (Dart_IsError(result)) { - Dart_PropagateError(result); - } else { + std::stringstream stream; + const auto& logger_prefix = UIDartState::Current()->logger_prefix(); + +#if !OS(ANDROID) + // Prepend all logs with the isolate debug name except on Android where that + // prefix is specified in the log tag. + if (logger_prefix.size() > 0) { + stream << logger_prefix << ": "; + } +#endif // !OS(ANDROID) + + // Append the log buffer obtained from Dart code. + { + Dart_Handle str = Dart_GetNativeArgument(args, 0); + uint8_t* chars = nullptr; + intptr_t length = 0; + Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); + if (Dart_IsError(result)) { + Dart_PropagateError(result); + return; + } + if (length > 0) { + stream << std::string{reinterpret_cast(chars), + static_cast(length)}; + } + } + + const auto log_string = stream.str(); + const char* chars = log_string.c_str(); + const size_t length = log_string.size(); + + // Log using platform specific mechanisms + { #if defined(OS_ANDROID) // Write to the logcat on Android. - const char* tag = Settings::Get().log_tag.c_str(); - __android_log_print(ANDROID_LOG_INFO, tag, "%.*s", (int)length, chars); + __android_log_print(ANDROID_LOG_INFO, logger_prefix.c_str(), "%.*s", + (int)length, chars); #elif defined(OS_IOS) // Write to syslog on iOS. // @@ -159,26 +189,22 @@ void Logger_PrintString(Dart_NativeArguments args) { // iOS logging APIs altogether. syslog(1 /* LOG_ALERT */, "%.*s", (int)length, chars); #else - // On Fuchsia and in flutter_tester (on both macOS and Linux), write - // directly to stdout. - fwrite(chars, 1, length, stdout); - fputs("\n", stdout); - fflush(stdout); + std::cout << log_string << std::endl; #endif } + if (dart::bin::ShouldCaptureStdout()) { // For now we report print output on the Stdout stream. uint8_t newline[] = {'\n'}; - Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length); + Dart_ServiceSendDataEvent("Stdout", "WriteEvent", + reinterpret_cast(chars), length); Dart_ServiceSendDataEvent("Stdout", "WriteEvent", newline, sizeof(newline)); } } void ScheduleMicrotask(Dart_NativeArguments args) { Dart_Handle closure = Dart_GetNativeArgument(args, 0); - if (LogIfError(closure) || !Dart_IsClosure(closure)) - return; - tonic::DartMicrotaskQueue::GetForCurrentThread()->ScheduleMicrotask(closure); + UIDartState::Current()->ScheduleMicrotask(closure); } } // namespace blink diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 3e47ba86d50a5..758a722b409e2 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -4,11 +4,11 @@ #include "flutter/lib/ui/painting/codec.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/frame_info.h" -#include "flutter/lib/ui/painting/resource_context.h" #include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/logging.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" #include "lib/tonic/dart_state.h" @@ -17,6 +17,10 @@ #include "third_party/skia/include/codec/SkCodec.h" #include "third_party/skia/include/core/SkPixelRef.h" +#ifdef ERROR +#undef ERROR +#endif + using tonic::DartInvoke; using tonic::DartPersistentValue; using tonic::ToDart; @@ -28,9 +32,9 @@ namespace { static constexpr const char* kInitCodecTraceTag = "InitCodec"; static constexpr const char* kCodecNextFrameTraceTag = "CodecNextFrame"; -void InvokeCodecCallback(fxl::RefPtr codec, - std::unique_ptr callback, - size_t trace_id) { +static void InvokeCodecCallback(fxl::RefPtr codec, + std::unique_ptr callback, + size_t trace_id) { tonic::DartState* dart_state = callback->dart_state().get(); if (!dart_state) { TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); @@ -45,7 +49,9 @@ void InvokeCodecCallback(fxl::RefPtr codec, TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); } -sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { +static sk_sp DecodeImage(fml::WeakPtr context, + sk_sp buffer, + size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("flutter", "DecodeImage"); @@ -53,13 +59,11 @@ sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { return nullptr; } - std::unique_ptr resourceContext = ResourceContext::Acquire(); - GrContext* context = resourceContext->Get(); if (context) { // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromEncoded(context, std::move(buffer), - false, dstColorSpace.get()); + return SkImage::MakeCrossContextFromEncoded( + context.get(), std::move(buffer), false, dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -68,7 +72,10 @@ sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { } } -fxl::RefPtr InitCodec(sk_sp buffer, size_t trace_id) { +fxl::RefPtr InitCodec(fml::WeakPtr context, + sk_sp buffer, + fxl::RefPtr unref_queue, + size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("blink", "InitCodec"); @@ -86,27 +93,31 @@ fxl::RefPtr InitCodec(sk_sp buffer, size_t trace_id) { if (skCodec->getFrameCount() > 1) { return fxl::MakeRefCounted(std::move(skCodec)); } - auto skImage = DecodeImage(buffer, trace_id); + auto skImage = DecodeImage(context, buffer, trace_id); if (!skImage) { FXL_LOG(ERROR) << "DecodeImage failed"; return nullptr; } auto image = CanvasImage::Create(); - image->set_image(skImage); + image->set_image({skImage, unref_queue}); auto frameInfo = fxl::MakeRefCounted(std::move(image), 0); return fxl::MakeRefCounted(std::move(frameInfo)); } void InitCodecAndInvokeCodecCallback( + fxl::RefPtr ui_task_runner, + fml::WeakPtr context, + fxl::RefPtr unref_queue, std::unique_ptr callback, sk_sp buffer, size_t trace_id) { - auto codec = InitCodec(std::move(buffer), trace_id); - Threads::UI()->PostTask(fxl::MakeCopyable([ - callback = std::move(callback), codec = std::move(codec), trace_id - ]() mutable { - InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); - })); + auto codec = + InitCodec(context, std::move(buffer), std::move(unref_queue), trace_id); + ui_task_runner->PostTask( + fxl::MakeCopyable([callback = std::move(callback), + codec = std::move(codec), trace_id]() mutable { + InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); + })); } void InstantiateImageCodec(Dart_NativeArguments args) { @@ -133,14 +144,20 @@ void InstantiateImageCodec(Dart_NativeArguments args) { auto buffer = SkData::MakeWithCopy(list.data(), list.num_elements()); - Threads::IO()->PostTask(fxl::MakeCopyable([ - callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - buffer = std::move(buffer), trace_id - ]() mutable { - InitCodecAndInvokeCodecCallback(std::move(callback), std::move(buffer), - trace_id); - })); + auto dart_state = UIDartState::Current(); + + const auto& task_runners = dart_state->GetTaskRunners(); + task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( + [callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + buffer = std::move(buffer), trace_id, + ui_task_runner = task_runners.GetUITaskRunner(), + context = dart_state->GetResourceContext(), + queue = UIDartState::Current()->GetSkiaUnrefQueue()]() mutable { + InitCodecAndInvokeCodecCallback(std::move(ui_task_runner), context, + std::move(queue), std::move(callback), + std::move(buffer), trace_id); + })); } bool copy_to(SkBitmap* dst, SkColorType dstColorType, const SkBitmap& src) { @@ -213,7 +230,8 @@ MultiFrameCodec::MultiFrameCodec(std::unique_ptr codec) nextFrameIndex_ = 0; } -sk_sp MultiFrameCodec::GetNextFrameImage() { +sk_sp MultiFrameCodec::GetNextFrameImage( + fml::WeakPtr resourceContext) { SkBitmap& bitmap = frameBitmaps_[nextFrameIndex_]; if (!bitmap.getPixels()) { // We haven't decoded this frame yet const SkImageInfo info = codec_->getInfo().makeColorType(kN32_SkColorType); @@ -245,15 +263,13 @@ sk_sp MultiFrameCodec::GetNextFrameImage() { } } - std::unique_ptr resourceContext = ResourceContext::Acquire(); - GrContext* context = resourceContext->Get(); - if (context) { + if (resourceContext) { SkPixmap pixmap(bitmap.info(), bitmap.pixelRef()->pixels(), bitmap.pixelRef()->rowBytes()); // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromPixmap(context, pixmap, false, - dstColorSpace.get()); + return SkImage::MakeCrossContextFromPixmap(resourceContext.get(), pixmap, + false, dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -264,19 +280,22 @@ sk_sp MultiFrameCodec::GetNextFrameImage() { void MultiFrameCodec::GetNextFrameAndInvokeCallback( std::unique_ptr callback, + fxl::RefPtr ui_task_runner, + fml::WeakPtr resourceContext, + fxl::RefPtr unref_queue, size_t trace_id) { fxl::RefPtr frameInfo = NULL; - sk_sp skImage = GetNextFrameImage(); + sk_sp skImage = GetNextFrameImage(resourceContext); if (skImage) { fxl::RefPtr image = CanvasImage::Create(); - image->set_image(skImage); + image->set_image({skImage, std::move(unref_queue)}); frameInfo = fxl::MakeRefCounted( std::move(image), frameInfos_[nextFrameIndex_].fDuration); } nextFrameIndex_ = (nextFrameIndex_ + 1) % frameInfos_.size(); - Threads::UI()->PostTask(fxl::MakeCopyable( - [ callback = std::move(callback), frameInfo, trace_id ]() mutable { + ui_task_runner->PostTask(fxl::MakeCopyable( + [callback = std::move(callback), frameInfo, trace_id]() mutable { InvokeNextFrameCallback(frameInfo, std::move(callback), trace_id); })); @@ -293,13 +312,20 @@ Dart_Handle MultiFrameCodec::getNextFrame(Dart_Handle callback_handle) { return ToDart("Callback must be a function"); } - Threads::IO()->PostTask(fxl::MakeCopyable([ - callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - this, trace_id - ]() mutable { - GetNextFrameAndInvokeCallback(std::move(callback), trace_id); - })); + auto dart_state = UIDartState::Current(); + + const auto& task_runners = dart_state->GetTaskRunners(); + + task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( + [callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + this, trace_id, ui_task_runner = task_runners.GetUITaskRunner(), + queue = UIDartState::Current()->GetSkiaUnrefQueue(), + context = dart_state->GetResourceContext()]() mutable { + GetNextFrameAndInvokeCallback(std::move(callback), + std::move(ui_task_runner), context, + std::move(queue), trace_id); + })); return Dart_Null(); } diff --git a/lib/ui/painting/codec.h b/lib/ui/painting/codec.h index 98e5bc56df375..9fdce1a8c1a33 100644 --- a/lib/ui/painting/codec.h +++ b/lib/ui/painting/codec.h @@ -43,11 +43,16 @@ class MultiFrameCodec : public Codec { private: MultiFrameCodec(std::unique_ptr codec); + ~MultiFrameCodec() {} - sk_sp GetNextFrameImage(); + sk_sp GetNextFrameImage(fml::WeakPtr resourceContext); + void GetNextFrameAndInvokeCallback( std::unique_ptr callback, + fxl::RefPtr ui_task_runner, + fml::WeakPtr resourceContext, + fxl::RefPtr unref_queue, size_t trace_id); const std::unique_ptr codec_; diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index f6bb864627740..52ccd63f3f5d3 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -48,10 +48,10 @@ void CanvasGradient::initLinear(const tonic::Float32List& end_points, static_assert(sizeof(SkColor) == sizeof(int32_t), "SkColor doesn't use int32_t."); - set_shader(SkGradientShader::MakeLinear( + set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeLinear( reinterpret_cast(end_points.data()), reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode)); + colors.num_elements(), tile_mode))); } void CanvasGradient::initRadial(double center_x, @@ -73,14 +73,14 @@ void CanvasGradient::initRadial(double center_x, sk_matrix = ToSkMatrix(matrix4); } - set_shader(SkGradientShader::MakeRadial( + set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeRadial( SkPoint::Make(center_x, center_y), radius, reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr)); + colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr))); } -CanvasGradient::CanvasGradient() : Shader(nullptr) {} +CanvasGradient::CanvasGradient() = default; -CanvasGradient::~CanvasGradient() {} +CanvasGradient::~CanvasGradient() = default; } // namespace blink diff --git a/lib/ui/painting/image.cc b/lib/ui/painting/image.cc index 42e733241c990..a1b9b45cdc863 100644 --- a/lib/ui/painting/image.cc +++ b/lib/ui/painting/image.cc @@ -4,9 +4,7 @@ #include "flutter/lib/ui/painting/image.h" -#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/image_encoding.h" -#include "flutter/lib/ui/painting/utils.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -30,13 +28,9 @@ void CanvasImage::RegisterNatives(tonic::DartLibraryNatives* natives) { natives->Register({FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -CanvasImage::CanvasImage() {} +CanvasImage::CanvasImage() = default; -CanvasImage::~CanvasImage() { - // Skia objects must be deleted on the IO thread so that any associated GL - // objects will be cleaned up through the IO thread's GL context. - SkiaUnrefOnIOThread(&image_); -} +CanvasImage::~CanvasImage() = default; Dart_Handle CanvasImage::toByteData(int format, int quality, @@ -49,8 +43,8 @@ void CanvasImage::dispose() { } size_t CanvasImage::GetAllocationSize() { - if (image_) { - return image_->width() * image_->height() * 4; + if (auto image = image_.get()) { + return image->width() * image->height() * 4; } else { return sizeof(CanvasImage); } diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index a7ed4298506f5..aeec2a0149c73 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -5,6 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_H_ #define FLUTTER_LIB_UI_PAINTING_IMAGE_H_ +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkImage.h" @@ -25,13 +27,18 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, return fxl::MakeRefCounted(); } - int width() { return image_->width(); } - int height() { return image_->height(); } + int width() { return image_.get()->width(); } + + int height() { return image_.get()->height(); } + Dart_Handle toByteData(int format, int quality, Dart_Handle callback); + void dispose(); - const sk_sp& image() const { return image_; } - void set_image(sk_sp image) { image_ = std::move(image); } + sk_sp image() const { return image_.get(); } + void set_image(flow::SkiaGPUObject image) { + image_ = std::move(image); + } virtual size_t GetAllocationSize() override; @@ -40,7 +47,7 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, private: CanvasImage(); - sk_sp image_; + flow::SkiaGPUObject image_; }; } // namespace blink diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index f356e955f6745..f010fce893d3e 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -4,13 +4,15 @@ #include "flutter/lib/ui/painting/image_encoding.h" -#include "flutter/common/threads.h" +#include +#include + +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/painting/image.h" -#include "flutter/lib/ui/painting/resource_context.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_persistent_value.h" -#include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_invoke.h" #include "lib/tonic/typed_data/uint8_list.h" #include "third_party/skia/include/core/SkEncodedImageFormat.h" @@ -52,10 +54,11 @@ void EncodeImageAndInvokeDataCallback( std::unique_ptr callback, sk_sp image, SkEncodedImageFormat format, - int quality) { + int quality, + fxl::RefPtr ui_task_runner) { sk_sp encoded = EncodeImage(std::move(image), format, quality); - Threads::UI()->PostTask( + ui_task_runner->PostTask( fxl::MakeCopyable([callback = std::move(callback), encoded]() mutable { InvokeDataCallback(std::move(callback), std::move(encoded)); })); @@ -101,10 +104,14 @@ Dart_Handle EncodeImage(CanvasImage* canvas_image, tonic::DartState::Current(), callback_handle); sk_sp image = canvas_image->image(); - Threads::IO()->PostTask(fxl::MakeCopyable( - [callback = std::move(callback), image, image_format, quality]() mutable { + const auto& task_runners = UIDartState::Current()->GetTaskRunners(); + + task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( + [callback = std::move(callback), image, image_format, quality, + ui_task_runner = task_runners.GetUITaskRunner()]() mutable { EncodeImageAndInvokeDataCallback(std::move(callback), std::move(image), - image_format, quality); + image_format, quality, + std::move(ui_task_runner)); })); return Dart_Null(); diff --git a/lib/ui/painting/image_shader.cc b/lib/ui/painting/image_shader.cc index 0fabd134c737c..a4ddbba0ea24b 100644 --- a/lib/ui/painting/image_shader.cc +++ b/lib/ui/painting/image_shader.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/painting/image_shader.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -37,15 +38,17 @@ void ImageShader::initWithImage(CanvasImage* image, SkShader::TileMode tmx, SkShader::TileMode tmy, const tonic::Float64List& matrix4) { - if (!image) + if (!image) { Dart_ThrowException( ToDart("ImageShader constructor called with non-genuine Image.")); + } SkMatrix sk_matrix = ToSkMatrix(matrix4); - set_shader(image->image()->makeShader(tmx, tmy, &sk_matrix)); + set_shader(UIDartState::CreateGPUObject( + image->image()->makeShader(tmx, tmy, &sk_matrix))); } -ImageShader::ImageShader() : Shader(nullptr) {} +ImageShader::ImageShader() = default; -ImageShader::~ImageShader() {} +ImageShader::~ImageShader() = default; } // namespace blink diff --git a/lib/ui/painting/picture.cc b/lib/ui/painting/picture.cc index 89ddbf5f41bb0..34f92b8c315fd 100644 --- a/lib/ui/painting/picture.cc +++ b/lib/ui/painting/picture.cc @@ -4,9 +4,8 @@ #include "flutter/lib/ui/painting/picture.h" -#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/canvas.h" -#include "flutter/lib/ui/painting/utils.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -23,24 +22,20 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Picture); DART_BIND_ALL(Picture, FOR_EACH_BINDING) -fxl::RefPtr Picture::Create(sk_sp picture) { +fxl::RefPtr Picture::Create(flow::SkiaGPUObject picture) { return fxl::MakeRefCounted(std::move(picture)); } -Picture::Picture(sk_sp picture) : picture_(std::move(picture)) {} +Picture::Picture(flow::SkiaGPUObject picture) + : picture_(std::move(picture)) {} -Picture::~Picture() { - // Skia objects must be deleted on the IO thread so that any associated GL - // objects will be cleaned up through the IO thread's GL context. - SkiaUnrefOnIOThread(&picture_); -} +Picture::~Picture() = default; fxl::RefPtr Picture::toImage(int width, int height) { fxl::RefPtr image = CanvasImage::Create(); - // TODO(abarth): We should pass in an SkColorSpace at some point. - image->set_image(SkImage::MakeFromPicture( - picture_, SkISize::Make(width, height), nullptr, nullptr, - SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB())); + image->set_image(UIDartState::CreateGPUObject(SkImage::MakeFromPicture( + picture_.get(), SkISize::Make(width, height), nullptr, nullptr, + SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()))); return image; } @@ -49,8 +44,8 @@ void Picture::dispose() { } size_t Picture::GetAllocationSize() { - if (picture_) { - return picture_->approximateBytesUsed(); + if (auto picture = picture_.get()) { + return picture->approximateBytesUsed(); } else { return sizeof(Picture); } diff --git a/lib/ui/painting/picture.h b/lib/ui/painting/picture.h index 4a26d01c08374..d916086b02f02 100644 --- a/lib/ui/painting/picture.h +++ b/lib/ui/painting/picture.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_PAINTING_PICTURE_H_ #define FLUTTER_LIB_UI_PAINTING_PICTURE_H_ +#include "flutter/flow/skia_gpu_object.h" #include "flutter/lib/ui/painting/image.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkPicture.h" @@ -23,9 +24,9 @@ class Picture : public fxl::RefCountedThreadSafe, public: ~Picture() override; - static fxl::RefPtr Create(sk_sp picture); + static fxl::RefPtr Create(flow::SkiaGPUObject picture); - const sk_sp& picture() const { return picture_; } + sk_sp picture() const { return picture_.get(); } fxl::RefPtr toImage(int width, int height); @@ -36,9 +37,9 @@ class Picture : public fxl::RefCountedThreadSafe, static void RegisterNatives(tonic::DartLibraryNatives* natives); private: - explicit Picture(sk_sp picture); + explicit Picture(flow::SkiaGPUObject picture); - sk_sp picture_; + flow::SkiaGPUObject picture_; }; } // namespace blink diff --git a/lib/ui/painting/picture_recorder.cc b/lib/ui/painting/picture_recorder.cc index adc73c0043920..e870e400a7230 100644 --- a/lib/ui/painting/picture_recorder.cc +++ b/lib/ui/painting/picture_recorder.cc @@ -50,8 +50,9 @@ SkCanvas* PictureRecorder::BeginRecording(SkRect bounds) { fxl::RefPtr PictureRecorder::endRecording() { if (!isRecording()) return nullptr; - fxl::RefPtr picture = - Picture::Create(picture_recorder_.finishRecordingAsPicture()); + + fxl::RefPtr picture = Picture::Create(UIDartState::CreateGPUObject( + picture_recorder_.finishRecordingAsPicture())); canvas_->Clear(); canvas_->ClearDartWrapper(); canvas_ = nullptr; diff --git a/lib/ui/painting/resource_context.cc b/lib/ui/painting/resource_context.cc deleted file mode 100644 index 1b9f71548c15f..0000000000000 --- a/lib/ui/painting/resource_context.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/lib/ui/painting/resource_context.h" - -#include - -#include "lib/fxl/logging.h" - -namespace blink { -namespace { - -static GrContext* g_context = nullptr; -static std::mutex g_mutex; -static volatile bool g_freeze = false; - -} // namespace - -ResourceContext::ResourceContext() { - g_mutex.lock(); -} - -ResourceContext::~ResourceContext() { - g_mutex.unlock(); -} - -void ResourceContext::Set(sk_sp context) { - FXL_DCHECK(!g_context); - g_context = context.release(); -} - -GrContext* ResourceContext::Get() { - return g_freeze ? nullptr : g_context; -} - -std::unique_ptr ResourceContext::Acquire() { - return std::make_unique(); -} - -void ResourceContext::Freeze() { - std::lock_guard lock(g_mutex); - g_freeze = true; -} - -void ResourceContext::Unfreeze() { - std::lock_guard lock(g_mutex); - g_freeze = false; -} - -} // namespace blink diff --git a/lib/ui/painting/resource_context.h b/lib/ui/painting/resource_context.h deleted file mode 100644 index 627b2053c2df9..0000000000000 --- a/lib/ui/painting/resource_context.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ -#define FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ - -#include "lib/fxl/macros.h" -#include "third_party/skia/include/gpu/GrContext.h" - -namespace blink { - -class ResourceContext { - public: - /** - * Globally set the GrContext singleton instance. - */ - static void Set(sk_sp context); - - /** - * Acquire a GrContext wrapping ResourceContext that's also an exclusive mutex - * on GrContext operations. - * - * Destructing the ResourceContext frees the mutex. - */ - static std::unique_ptr Acquire(); - - /** - * Synchronously signal a freeze on GrContext operations. - * - * ResourceContext instances will return nullptr on GrContext Get until - * unfrozen. - */ - static void Freeze(); - - /** - * Synchronously unfreeze GrContext operations. - * - * ResourceContext instances will continue to return the global GrContext - * instance on Get. - */ - static void Unfreeze(); - - ResourceContext(); - ~ResourceContext(); - - /** - * Returns global GrContext instance. May return null when operations are - * frozen. - * - * Happens on iOS when background operations on GrContext are forbidden. - */ - GrContext* Get(); - - FXL_DISALLOW_COPY_AND_ASSIGN(ResourceContext); -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ diff --git a/lib/ui/painting/shader.cc b/lib/ui/painting/shader.cc index d7d8ccf20aefc..7999b84dfcc29 100644 --- a/lib/ui/painting/shader.cc +++ b/lib/ui/painting/shader.cc @@ -4,19 +4,15 @@ #include "flutter/lib/ui/painting/shader.h" -#include "flutter/common/threads.h" -#include "flutter/lib/ui/painting/utils.h" +#include "flutter/lib/ui/ui_dart_state.h" namespace blink { IMPLEMENT_WRAPPERTYPEINFO(ui, Shader); -Shader::Shader(sk_sp shader) : shader_(shader) {} +Shader::Shader(flow::SkiaGPUObject shader) + : shader_(std::move(shader)) {} -Shader::~Shader() { - // Skia objects must be deleted on the IO thread so that any associated GL - // objects will be cleaned up through the IO thread's GL context. - SkiaUnrefOnIOThread(&shader_); -} +Shader::~Shader() = default; } // namespace blink diff --git a/lib/ui/painting/shader.h b/lib/ui/painting/shader.h index 9c0f3c601db56..205197250eb84 100644 --- a/lib/ui/painting/shader.h +++ b/lib/ui/painting/shader.h @@ -5,6 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_SHADER_H_ #define FLUTTER_LIB_UI_PAINTING_SHADER_H_ +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkShader.h" @@ -18,14 +20,17 @@ class Shader : public fxl::RefCountedThreadSafe, public: ~Shader() override; - const sk_sp& shader() { return shader_; } - void set_shader(sk_sp shader) { shader_ = std::move(shader); } + sk_sp shader() { return shader_.get(); } + + void set_shader(flow::SkiaGPUObject shader) { + shader_ = std::move(shader); + } protected: - Shader(sk_sp shader); + Shader(flow::SkiaGPUObject shader = {}); private: - sk_sp shader_; + flow::SkiaGPUObject shader_; }; } // namespace blink diff --git a/lib/ui/painting/utils.cc b/lib/ui/painting/utils.cc deleted file mode 100644 index b3f87135ac0a8..0000000000000 --- a/lib/ui/painting/utils.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/lib/ui/painting/utils.h" -#include "flutter/common/threads.h" - -namespace blink { - -namespace { - -constexpr fxl::TimeDelta kDrainDelay = fxl::TimeDelta::FromMilliseconds(250); - -} // anonymous namespace - -SkiaUnrefQueue::SkiaUnrefQueue() : drain_pending_(false) {} - -SkiaUnrefQueue SkiaUnrefQueue::instance_; - -SkiaUnrefQueue& SkiaUnrefQueue::Get() { - return instance_; -} - -void SkiaUnrefQueue::Unref(SkRefCnt* object) { - std::lock_guard lock(mutex_); - objects_.push_back(object); - if (!drain_pending_) { - drain_pending_ = true; - Threads::IO()->PostDelayedTask([this] { Drain(); }, kDrainDelay); - } -} - -void SkiaUnrefQueue::Drain() { - std::deque skia_objects; - { - std::lock_guard lock(mutex_); - objects_.swap(skia_objects); - drain_pending_ = false; - } - - for (SkRefCnt* skia_object : skia_objects) { - skia_object->unref(); - } -} - -} // namespace blink diff --git a/lib/ui/painting/utils.h b/lib/ui/painting/utils.h deleted file mode 100644 index 02782c67962bc..0000000000000 --- a/lib/ui/painting/utils.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 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. - -#include "third_party/skia/include/core/SkRefCnt.h" - -#include -#include - -namespace blink { - -// A queue that holds Skia objects that must be destructed on the IO thread. -class SkiaUnrefQueue { - public: - static SkiaUnrefQueue& Get(); - - void Unref(SkRefCnt* object); - - private: - SkiaUnrefQueue(); - void Drain(); - - static SkiaUnrefQueue instance_; - - std::mutex mutex_; - std::deque objects_; - bool drain_pending_; -}; - -template -void SkiaUnrefOnIOThread(sk_sp* sp) { - T* object = sp->release(); - if (object) { - SkiaUnrefQueue::Get().Unref(object); - } -} - -} // namespace blink diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index d6407f9ed42e1..248468cc9701d 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -34,15 +34,9 @@ std::shared_ptr FontCollection::GetFontCollection() const { return collection_; } -void FontCollection::RegisterFontsFromAssetProvider( - fxl::RefPtr asset_provider) { - - if (!asset_provider){ - return; - } - +void FontCollection::RegisterFonts(const AssetManager& asset_manager) { std::vector manifest_data; - if (!asset_provider->GetAsBuffer("FontManifest.json", &manifest_data)) { + if (!asset_manager.GetAsBuffer("FontManifest.json", &manifest_data)) { FXL_DLOG(WARNING) << "Could not find the font manifest in the asset store."; return; } @@ -92,8 +86,8 @@ void FontCollection::RegisterFontsFromAssetProvider( // TODO: Handle weights and styles. std::vector font_data; - if (asset_provider->GetAsBuffer(font_asset->value.GetString(), - &font_data)) { + if (asset_manager.GetAsBuffer(font_asset->value.GetString(), + &font_data)) { // The data must be copied because it needs to be moved into the // typeface as a stream. auto data = diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index fb393b1582b79..ea9c2f46a96a0 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -7,10 +7,10 @@ #include #include -#include "flutter/assets/asset_provider.h" + +#include "flutter/assets/asset_manager.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" -#include "txt/asset_data_provider.h" #include "txt/font_collection.h" namespace blink { @@ -21,7 +21,8 @@ class FontCollection { std::shared_ptr GetFontCollection() const; - void RegisterFontsFromAssetProvider(fxl::RefPtr asset_provider); + void RegisterFonts(const AssetManager& asset_manager); + void RegisterTestFonts(); private: diff --git a/lib/ui/text/paragraph.cc b/lib/ui/text/paragraph.cc index 858ccd01d4ef6..fd00f6f51b3a3 100644 --- a/lib/ui/text/paragraph.cc +++ b/lib/ui/text/paragraph.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" #include "flutter/sky/engine/core/rendering/RenderParagraph.h" #include "flutter/sky/engine/core/rendering/RenderText.h" @@ -53,7 +53,8 @@ Paragraph::Paragraph(std::unique_ptr paragraph) Paragraph::~Paragraph() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + destruction_task_runner_->PostTask( + [renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph.h b/lib/ui/text/paragraph.h index 1b2019373553a..b3a943209ab4c 100644 --- a/lib/ui/text/paragraph.h +++ b/lib/ui/text/paragraph.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/paragraph_impl_blink.h" @@ -66,6 +67,10 @@ class Paragraph : public fxl::RefCountedThreadSafe, explicit Paragraph(std::unique_ptr paragraph); + // TODO: This can be removed when the render view association for the legacy + // runtime is removed. + fxl::RefPtr destruction_task_runner_ = + UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index 44d05053ba342..b987e3fde6272 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph_builder.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/sky/engine/core/rendering/RenderInline.h" @@ -205,9 +205,11 @@ fxl::RefPtr ParagraphBuilder::create( double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale) { - return fxl::MakeRefCounted(encoded, fontFamily, fontSize, - lineHeight, ellipsis, locale); + const std::string& locale, + bool use_blink) { + return fxl::MakeRefCounted( + encoded, fontFamily, fontSize, lineHeight, ellipsis, locale, + UIDartState::Current()->use_blink()); } ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, @@ -215,8 +217,10 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale) { - if (!Settings::Get().using_blink) { + const std::string& locale, + bool use_blink) + : m_useBlink(use_blink) { + if (!m_useBlink) { int32_t mask = encoded[0]; txt::ParagraphStyle style; if (mask & psTextAlignMask) @@ -275,7 +279,8 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, ParagraphBuilder::~ParagraphBuilder() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + destruction_task_runner_->PostTask( + [renderView]() { renderView->destroy(); }); } } @@ -290,7 +295,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, int32_t mask = encoded[0]; - if (!Settings::Get().using_blink) { + if (!m_useBlink) { // Set to use the properties of the previous style if the property is not // explicitly given. txt::TextStyle style = m_paragraphBuilder->PeekStyle(); @@ -423,7 +428,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, } void ParagraphBuilder::pop() { - if (!Settings::Get().using_blink) { + if (!m_useBlink) { m_paragraphBuilder->Pop(); } else { // Blink Version. @@ -445,7 +450,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { if (error_code != U_BUFFER_OVERFLOW_ERROR) return tonic::ToDart("string is not well-formed UTF-16"); - if (!Settings::Get().using_blink) { + if (!m_useBlink) { m_paragraphBuilder->AddText(text); } else { // Blink Version. @@ -464,7 +469,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { fxl::RefPtr ParagraphBuilder::build() { m_currentRenderObject = nullptr; - if (!Settings::Get().using_blink) { + if (!m_useBlink) { return Paragraph::Create(m_paragraphBuilder->Build()); } else { return Paragraph::Create(m_renderView.release()); diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 37a1e9a3e74cf..1c38d98696def 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -32,7 +32,8 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale); + const std::string& locale, + bool use_blink); ~ParagraphBuilder() override; @@ -58,14 +59,20 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale); + const std::string& locale, + bool use_blink); void createRenderView(); + // TODO: This can be removed when the render view association for the legacy + // runtime is removed. + fxl::RefPtr destruction_task_runner_ = + UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; RenderObject* m_renderParagraph; RenderObject* m_currentRenderObject; std::unique_ptr m_paragraphBuilder; + bool m_useBlink; }; } // namespace blink diff --git a/lib/ui/text/paragraph_impl_blink.cc b/lib/ui/text/paragraph_impl_blink.cc index c7752c0a7c757..5c50f047afa33 100644 --- a/lib/ui/text/paragraph_impl_blink.cc +++ b/lib/ui/text/paragraph_impl_blink.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/text/paragraph_impl_blink.h" -#include "flutter/common/threads.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" @@ -30,7 +29,8 @@ ParagraphImplBlink::ParagraphImplBlink(PassOwnPtr renderView) ParagraphImplBlink::~ParagraphImplBlink() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + destruction_task_runner_->PostTask( + [renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph_impl_blink.h b/lib/ui/text/paragraph_impl_blink.h index 79d89ad471962..ebd80f8dd5382 100644 --- a/lib/ui/text/paragraph_impl_blink.h +++ b/lib/ui/text/paragraph_impl_blink.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/text_box.h" @@ -41,6 +42,10 @@ class ParagraphImplBlink : public ParagraphImpl { int absoluteOffsetForPosition(const PositionWithAffinity& position); + // TODO: This can be removed when the render view association for the legacy + // runtime is removed. + fxl::RefPtr destruction_task_runner_ = + UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_impl_txt.cc b/lib/ui/text/paragraph_impl_txt.cc index de8d8ff0b2fc3..28c6ea19a8157 100644 --- a/lib/ui/text/paragraph_impl_txt.cc +++ b/lib/ui/text/paragraph_impl_txt.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/text/paragraph_impl_txt.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "lib/fxl/logging.h" diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 3bdf21e6a1a93..8ef7ca98fd758 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/window.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" #include "lib/tonic/converter/dart_converter.h" @@ -12,34 +13,44 @@ using tonic::ToDart; namespace blink { -IsolateClient::~IsolateClient() {} - -UIDartState::UIDartState(IsolateClient* isolate_client, - std::unique_ptr window, - int dirfd) - : tonic::DartState(dirfd), - isolate_client_(isolate_client), - main_port_(ILLEGAL_PORT), - window_(std::move(window)) {} +UIDartState::UIDartState(TaskRunners task_runners, + TaskObserverAdd add_callback, + TaskObserverRemove remove_callback, + fml::WeakPtr resource_context, + fxl::RefPtr skia_unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, + std::string logger_prefix) + : task_runners_(std::move(task_runners)), + add_callback_(std::move(add_callback)), + remove_callback_(std::move(remove_callback)), + resource_context_(std::move(resource_context)), + advisory_script_uri_(std::move(advisory_script_uri)), + advisory_script_entrypoint_(std::move(advisory_script_entrypoint)), + logger_prefix_(std::move(logger_prefix)), + skia_unref_queue_(std::move(skia_unref_queue)), + weak_factory_(this) { + AddOrRemoveTaskObserver(true /* add */); +} UIDartState::~UIDartState() { - main_port_ = ILLEGAL_PORT; - // We've already destroyed the isolate. Revoke any weak ptrs held by - // DartPersistentValues so they don't try to enter the destroyed isolate to - // clean themselves up. - // TODO(abarth): Can we do this work in the base class? - weak_factory_.InvalidateWeakPtrs(); + AddOrRemoveTaskObserver(false /* remove */); } -UIDartState* UIDartState::CreateForChildIsolate() { - return new UIDartState(isolate_client_, nullptr); +const std::string& UIDartState::GetAdvisoryScriptURI() const { + return advisory_script_uri_; +} + +const std::string& UIDartState::GetAdvisoryScriptEntrypoint() const { + return advisory_script_entrypoint_; } void UIDartState::DidSetIsolate() { - FXL_DCHECK(!debug_name_prefix_.empty()); main_port_ = Dart_GetMainPortId(); std::ostringstream debug_name; - debug_name << debug_name_prefix_ << "$main-" << main_port_; + // main.dart$main-1234 + debug_name << advisory_script_uri_ << "$" << advisory_script_entrypoint_ + << "-" << main_port_; debug_name_ = debug_name.str(); } @@ -55,8 +66,48 @@ PassRefPtr UIDartState::font_selector() { return font_selector_; } -void UIDartState::set_debug_name_prefix(const std::string& debug_name_prefix) { - debug_name_prefix_ = debug_name_prefix; +void UIDartState::SetWindow(std::unique_ptr window) { + window_ = std::move(window); +} + +const TaskRunners& UIDartState::GetTaskRunners() const { + return task_runners_; +} + +fxl::RefPtr UIDartState::GetSkiaUnrefQueue() const { + return skia_unref_queue_; +} + +void UIDartState::ScheduleMicrotask(Dart_Handle closure) { + if (tonic::LogIfError(closure) || !Dart_IsClosure(closure)) { + return; + } + + microtask_queue_.ScheduleMicrotask(closure); +} + +void UIDartState::FlushMicrotasksNow() { + microtask_queue_.RunMicrotasks(); +} + +void UIDartState::AddOrRemoveTaskObserver(bool add) { + auto task_runner = task_runners_.GetUITaskRunner(); + if (!task_runner) { + // This may happen in case the isolate has no thread affinity (for example, + // the service isolate). + return; + } + FXL_DCHECK(add_callback_ && remove_callback_); + if (add) { + add_callback_(reinterpret_cast(this), + [this]() { this->FlushMicrotasksNow(); }); + } else { + remove_callback_(reinterpret_cast(this)); + } +} + +fml::WeakPtr UIDartState::GetResourceContext() const { + return resource_context_; } } // namespace blink diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index 0f7f9343d4958..a5c78c1671815 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -5,65 +5,106 @@ #ifndef FLUTTER_LIB_UI_UI_DART_STATE_H_ #define FLUTTER_LIB_UI_UI_DART_STATE_H_ +#include +#include #include +#include "flutter/common/settings.h" +#include "flutter/common/task_runners.h" +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/sky/engine/wtf/RefPtr.h" #include "lib/fxl/build_config.h" +#include "lib/tonic/dart_microtask_queue.h" #include "lib/tonic/dart_persistent_value.h" #include "lib/tonic/dart_state.h" #include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/skia/include/gpu/GrContext.h" namespace blink { class FontSelector; class Window; -class IsolateClient { - public: - virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate) = 0; - virtual void DidShutdownMainIsolate() = 0; - - protected: - virtual ~IsolateClient(); -}; - class UIDartState : public tonic::DartState { public: - UIDartState(IsolateClient* isolate_client, - std::unique_ptr window, - int dirfd = -1); - ~UIDartState() override; - static UIDartState* Current(); - UIDartState* CreateForChildIsolate(); - - IsolateClient* isolate_client() const { return isolate_client_; } - void set_isolate_client(IsolateClient* isolate_client) { - isolate_client_ = isolate_client; - } Dart_Port main_port() const { return main_port_; } + const std::string& debug_name() const { return debug_name_; } + + const std::string& logger_prefix() const { return logger_prefix_; } + Window* window() const { return window_.get(); } - void set_debug_name_prefix(const std::string& debug_name_prefix); void set_font_selector(PassRefPtr selector); + PassRefPtr font_selector(); - bool is_controller_state() const { return is_controller_state_; } - void set_is_controller_state(bool value) { is_controller_state_ = value; } - bool shutting_down() const { return shutting_down_; } - void set_shutting_down(bool value) { shutting_down_ = value; } + + bool use_blink() const { return use_blink_; } + + const TaskRunners& GetTaskRunners() const; + + void ScheduleMicrotask(Dart_Handle handle); + + void FlushMicrotasksNow(); + + fxl::RefPtr GetSkiaUnrefQueue() const; + + fml::WeakPtr GetResourceContext() const; + + template + static flow::SkiaGPUObject CreateGPUObject(sk_sp object) { + if (!object) { + return {}; + } + auto state = UIDartState::Current(); + FXL_DCHECK(state); + auto queue = state->GetSkiaUnrefQueue(); + return {std::move(object), std::move(queue)}; + }; + + protected: + UIDartState(TaskRunners task_runners, + TaskObserverAdd add_callback, + TaskObserverRemove remove_callback, + fml::WeakPtr resource_context, + fxl::RefPtr skia_unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, + std::string logger_prefix); + + ~UIDartState() override; + + void SetWindow(std::unique_ptr window); + + void set_use_blink(bool use_blink) { use_blink_ = use_blink; } + + const std::string& GetAdvisoryScriptURI() const; + + const std::string& GetAdvisoryScriptEntrypoint() const; private: void DidSetIsolate() override; - IsolateClient* isolate_client_; - Dart_Port main_port_; - std::string debug_name_prefix_; + const TaskRunners task_runners_; + const TaskObserverAdd add_callback_; + const TaskObserverRemove remove_callback_; + fml::WeakPtr resource_context_; + const std::string advisory_script_uri_; + const std::string advisory_script_entrypoint_; + const std::string logger_prefix_; + Dart_Port main_port_ = ILLEGAL_PORT; std::string debug_name_; std::unique_ptr window_; RefPtr font_selector_; - bool is_controller_state_; - bool shutting_down_ = false; + fxl::RefPtr skia_unref_queue_; + tonic::DartMicrotaskQueue microtask_queue_; + fml::WeakPtrFactory weak_factory_; + + void AddOrRemoveTaskObserver(bool add); + + bool use_blink_ = false; }; } // namespace blink diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index 065159b79713b..2cca2fd179888 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -6,7 +6,7 @@ #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/window/window.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_state.h" @@ -43,12 +43,14 @@ Dart_Handle WrapByteData(std::vector data) { } // anonymous namespace PlatformMessageResponseDart::PlatformMessageResponseDart( - tonic::DartPersistentValue callback) - : callback_(std::move(callback)) {} + tonic::DartPersistentValue callback, + fxl::RefPtr ui_task_runner) + : callback_(std::move(callback)), + ui_task_runner_(std::move(ui_task_runner)) {} PlatformMessageResponseDart::~PlatformMessageResponseDart() { if (!callback_.is_empty()) { - Threads::UI()->PostTask( + ui_task_runner_->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { callback.Clear(); })); @@ -60,7 +62,7 @@ void PlatformMessageResponseDart::Complete(std::vector data) { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - Threads::UI()->PostTask(fxl::MakeCopyable( + ui_task_runner_->PostTask(fxl::MakeCopyable( [ callback = std::move(callback_), data = std::move(data) ]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) @@ -77,7 +79,7 @@ void PlatformMessageResponseDart::CompleteEmpty() { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - Threads::UI()->PostTask( + ui_task_runner_->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) diff --git a/lib/ui/window/platform_message_response_dart.h b/lib/ui/window/platform_message_response_dart.h index 51c55a930014b..67bfb3d359691 100644 --- a/lib/ui/window/platform_message_response_dart.h +++ b/lib/ui/window/platform_message_response_dart.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ #define FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/platform_message_response.h" #include "lib/tonic/dart_persistent_value.h" @@ -19,10 +20,13 @@ class PlatformMessageResponseDart : public PlatformMessageResponse { void CompleteEmpty() override; protected: - explicit PlatformMessageResponseDart(tonic::DartPersistentValue callback); + explicit PlatformMessageResponseDart( + tonic::DartPersistentValue callback, + fxl::RefPtr ui_task_runner); ~PlatformMessageResponseDart() override; tonic::DartPersistentValue callback_; + fxl::RefPtr ui_task_runner_; }; } // namespace blink diff --git a/lib/ui/window/viewport_metrics.h b/lib/ui/window/viewport_metrics.h index 1e443ae8c1404..5085d06f42724 100644 --- a/lib/ui/window/viewport_metrics.h +++ b/lib/ui/window/viewport_metrics.h @@ -23,6 +23,25 @@ struct ViewportMetrics { int32_t physical_view_inset_left = 0; }; +struct LogicalSize { + double width = 0.0; + double height = 0.0; +}; + +struct LogicalInset { + double left = 0.0; + double top = 0.0; + double right = 0.0; + double bottom = 0.0; +}; + +struct LogicalMetrics { + LogicalSize size; + double scale = 1.0; + LogicalInset padding; + LogicalInset view_inset; +}; + } // namespace blink #endif // FLUTTER_LIB_UI_WINDOW_VIEWPORT_METRICS_H_ diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index e12e03f10d01f..4cce1cc5903b0 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -63,7 +63,8 @@ void SendPlatformMessage(Dart_Handle window, fxl::RefPtr response; if (!Dart_IsNull(callback)) { response = fxl::MakeRefCounted( - tonic::DartPersistentValue(dart_state, callback)); + tonic::DartPersistentValue(dart_state, callback), + dart_state->GetTaskRunners().GetUITaskRunner()); } if (Dart_IsNull(data.dart_handle())) { UIDartState::Current()->window()->client()->HandlePlatformMessage( @@ -254,7 +255,7 @@ void Window::BeginFrame(fxl::TimePoint frameTime) { Dart_NewInteger(microseconds), }); - tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); + UIDartState::Current()->FlushMicrotasksNow(); DartInvokeField(library_.value(), "_drawFrame", {}); } diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index ef0d7ef863a0e..2feeccb65f9cc 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -13,6 +13,7 @@ #include "flutter/lib/ui/window/viewport_metrics.h" #include "lib/fxl/time/time_point.h" #include "lib/tonic/dart_persistent_value.h" +#include "third_party/skia/include/gpu/GrContext.h" namespace tonic { class DartLibraryNatives; @@ -35,12 +36,14 @@ class WindowClient { virtual ~WindowClient(); }; -class Window { +class Window final { public: explicit Window(WindowClient* client); + ~Window(); WindowClient* client() const { return client_; } + const ViewportMetrics& viewport_metrics() { return viewport_metrics_; } void DidCreateIsolate(); diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index dea8a8906d031..455d7e228168f 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -4,6 +4,7 @@ import("//third_party/dart/runtime/bin/vmservice/vmservice_sources.gni") import("$flutter_root/common/config.gni") +import("$flutter_root/testing/testing.gni") action("gen_embedded_resources_cc") { script = "//third_party/dart/runtime/tools/create_resources.py" @@ -37,9 +38,7 @@ source_set("embedded_resources_cc") { deps = [ ":gen_embedded_resources_cc", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } source_set("test_font") { @@ -50,9 +49,7 @@ source_set("test_font") { deps = [ "//third_party/skia", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] defines = [] if (flutter_runtime_mode == "debug" || current_toolchain == host_toolchain) { # Though the test font data is small, we dont want to add to the binary size @@ -63,16 +60,19 @@ source_set("test_font") { } source_set("runtime") { - sources = [ "asset_font_selector.cc", "asset_font_selector.h", - "dart_controller.cc", - "dart_controller.h", - "dart_init.cc", - "dart_init.h", + "dart_isolate.cc", + "dart_isolate.h", "dart_service_isolate.cc", "dart_service_isolate.h", + "dart_snapshot.cc", + "dart_snapshot.h", + "dart_snapshot_buffer.cc", + "dart_snapshot_buffer.h", + "dart_vm.cc", + "dart_vm.h", "embedder_resources.cc", "embedder_resources.h", "platform_impl.cc", @@ -81,8 +81,8 @@ source_set("runtime") { "runtime_controller.h", "runtime_delegate.cc", "runtime_delegate.h", - "runtime_init.cc", - "runtime_init.h", + "service_protocol.cc", + "service_protocol.h", "start_up.cc", "start_up.h", "test_font_selector.cc", @@ -92,25 +92,24 @@ source_set("runtime") { deps = [ ":embedded_resources_cc", ":test_font", - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", + "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/io", "$flutter_root/lib/ui", "$flutter_root/sky/engine/platform", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//topaz/lib/tonic", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] # In AOT mode, precompiled snapshots contain the instruction buffer. # Generation of the same requires all application specific script code to be @@ -119,3 +118,28 @@ source_set("runtime") { deps += [ "$flutter_root/lib/snapshot" ] } } + +test_fixtures("runtime_fixtures") { + fixtures = [ "fixtures/simple_main.dart" ] +} + +executable("runtime_unittests") { + testonly = true + + sources = [ + "dart_isolate_unittests.cc", + "dart_vm_unittests.cc", + ] + + deps = [ + ":runtime", + ":runtime_fixtures", + "$flutter_root/fml", + "$flutter_root/lib/snapshot", + "$flutter_root/testing", + "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", + "//third_party/skia", + "//topaz/lib/tonic", + ] +} diff --git a/runtime/asset_font_selector.cc b/runtime/asset_font_selector.cc index abf4bf9874ddd..2a43f39e3a89b 100644 --- a/runtime/asset_font_selector.cc +++ b/runtime/asset_font_selector.cc @@ -80,27 +80,15 @@ struct FontMatcher { } // namespace -void AssetFontSelector::Install( - fxl::RefPtr asset_provider) { +void AssetFontSelector::Install(fxl::RefPtr asset_manager) { RefPtr font_selector = - adoptRef(new AssetFontSelector(std::move(asset_provider))); + adoptRef(new AssetFontSelector(std::move(asset_manager))); font_selector->parseFontManifest(); UIDartState::Current()->set_font_selector(font_selector); } -void AssetFontSelector::Install(fxl::RefPtr asset_store) { - RefPtr font_selector = - adoptRef(new AssetFontSelector(std::move(asset_store))); - font_selector->parseFontManifest(); - UIDartState::Current()->set_font_selector(font_selector); -} - -AssetFontSelector::AssetFontSelector( - fxl::RefPtr asset_provider) - : asset_provider_(std::move(asset_provider)) {} - -AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_store) - : asset_store_(std::move(asset_store)) {} +AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_manager) + : asset_manager_(std::move(asset_manager)) {} AssetFontSelector::~AssetFontSelector() {} @@ -118,12 +106,9 @@ AssetFontSelector::FlutterFontAttributes::~FlutterFontAttributes() {} void AssetFontSelector::parseFontManifest() { std::vector font_manifest_data; - if (!asset_provider_ || - !asset_provider_->GetAsBuffer(kFontManifestAssetPath, - &font_manifest_data)) { - if (!asset_store_ || - !asset_store_->GetAsBuffer(kFontManifestAssetPath, &font_manifest_data)) - return; + if (!asset_manager_->GetAsBuffer(kFontManifestAssetPath, + &font_manifest_data)) { + return; } rapidjson::Document document; @@ -239,13 +224,8 @@ sk_sp AssetFontSelector::getTypefaceAsset( } std::unique_ptr typeface_asset(new TypefaceAsset); - if (!asset_provider_ || !asset_provider_->GetAsBuffer( - asset_path, &typeface_asset->data)) { - if (!asset_store_ || - !asset_store_->GetAsBuffer(asset_path, &typeface_asset->data)) { - typeface_cache_.insert(std::make_pair(asset_path, nullptr)); - return nullptr; - } + if (!asset_manager_->GetAsBuffer(asset_path, &typeface_asset->data)) { + return nullptr; } sk_sp font_mgr(SkFontMgr::RefDefault()); diff --git a/runtime/asset_font_selector.h b/runtime/asset_font_selector.h index 921c0472dba78..8d7e946d89e7e 100644 --- a/runtime/asset_font_selector.h +++ b/runtime/asset_font_selector.h @@ -8,7 +8,7 @@ #include #include -#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/asset_manager.h" #include "flutter/assets/zip_asset_store.h" #include "flutter/sky/engine/platform/fonts/FontCacheKey.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" @@ -24,11 +24,7 @@ class AssetFontSelector : public FontSelector { ~AssetFontSelector() override; - static void Install(fxl::RefPtr asset_provider); - - // TODO(zarah): Remove this and related code using asset_store once flx is - // removed. - static void Install(fxl::RefPtr asset_store); + static void Install(fxl::RefPtr asset_manager); PassRefPtr getFontData(const FontDescription& font_description, const AtomicString& family_name) override; @@ -44,19 +40,14 @@ class AssetFontSelector : public FontSelector { private: struct TypefaceAsset; - explicit AssetFontSelector( - fxl::RefPtr asset_provider); - - explicit AssetFontSelector(fxl::RefPtr asset_store); + explicit AssetFontSelector(fxl::RefPtr asset_manager); void parseFontManifest(); sk_sp getTypefaceAsset(const FontDescription& font_description, const AtomicString& family_name); - fxl::RefPtr asset_provider_; - - fxl::RefPtr asset_store_; + fxl::RefPtr asset_manager_; HashMap> font_family_map_; diff --git a/runtime/dart_controller.cc b/runtime/dart_controller.cc deleted file mode 100644 index 84cfceeaecc10..0000000000000 --- a/runtime/dart_controller.cc +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/runtime/dart_controller.h" -#include "lib/fxl/build_config.h" - -#if defined(OS_WIN) -#include -#undef GetCurrentDirectory -#endif - -#include - -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" -#include "flutter/glue/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "lib/fxl/files/directory.h" -#include "lib/fxl/files/path.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_message_handler.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -using tonic::LogIfError; -using tonic::ToDart; - -namespace blink { -namespace { -#if defined(OS_WIN) - -std::string FindAndReplace(const std::string& str, - const std::string& findStr, - const std::string& replaceStr) { - std::string rStr = str; - size_t pos = 0; - while ((pos = rStr.find(findStr, pos)) != std::string::npos) { - rStr.replace(pos, findStr.length(), replaceStr); - pos += replaceStr.length(); - } - return rStr; -} - -std::string SanitizePath(const std::string& path) { - return FindAndReplace(path, "\\\\", "/"); -} - -std::string ResolvePath(std::string path) { - std::string sanitized = SanitizePath(path); - if ((sanitized.length() > 2) && (sanitized[1] == ':')) { - return sanitized; - } - return files::SimplifyPath(files::GetCurrentDirectory() + "/" + sanitized); -} - -#else // defined(OS_WIN) - -std::string SanitizePath(const std::string& path) { - return path; -} - -// TODO(abarth): Consider adding this to //garnet/public/lib/fxl. -std::string ResolvePath(std::string path) { - if (!path.empty() && path[0] == '/') - return path; - return files::SimplifyPath(files::GetCurrentDirectory() + "/" + path); -} - -#endif - -} // namespace - -DartController::DartController() : ui_dart_state_(nullptr) {} - -DartController::~DartController() { - if (ui_dart_state_) { - ui_dart_state_->set_isolate_client(nullptr); - - if (!ui_dart_state_->shutting_down()) { - // Don't use a tonic::DartIsolateScope here since we never exit the - // isolate. - Dart_EnterIsolate(ui_dart_state_->isolate()); - // Clear the message notify callback. - Dart_SetMessageNotifyCallback(nullptr); - Dart_ShutdownIsolate(); - } - } -} - -const std::string DartController::main_entrypoint_ = "main"; - -bool DartController::SendStartMessage(Dart_Handle root_library, - const std::string& entrypoint) { - if (LogIfError(root_library)) - return true; - - { - // Temporarily exit the isolate while we make it runnable. - Dart_Isolate isolate = dart_state()->isolate(); - FXL_DCHECK(Dart_CurrentIsolate() == isolate); - Dart_ExitIsolate(); - Dart_IsolateMakeRunnable(isolate); - Dart_EnterIsolate(isolate); - } - - // In order to support pausing the isolate at start, we indirectly invoke - // main by sending a message to the isolate. - - // Get the closure of main(). - Dart_Handle main_closure = Dart_GetClosure( - root_library, Dart_NewStringFromCString(entrypoint.c_str())); - if (LogIfError(main_closure)) - return true; - - // Grab the 'dart:isolate' library. - Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); - DART_CHECK_VALID(isolate_lib); - - // Send the start message containing the entry point by calling - // _startMainIsolate in dart:isolate. - const intptr_t kNumIsolateArgs = 2; - Dart_Handle isolate_args[kNumIsolateArgs]; - isolate_args[0] = main_closure; - isolate_args[1] = Dart_Null(); - Dart_Handle result = Dart_Invoke(isolate_lib, ToDart("_startMainIsolate"), - kNumIsolateArgs, isolate_args); - return LogIfError(result); -} - -tonic::DartErrorHandleType DartController::RunFromKernel( - const std::vector& kernel, - const std::string& entrypoint) { - tonic::DartState::Scope scope(dart_state()); - tonic::DartErrorHandleType error = tonic::kNoError; - if (Dart_IsNull(Dart_RootLibrary())) { - Dart_Handle result = Dart_LoadScriptFromKernel(kernel.data(), kernel.size()); - LogIfError(result); - error = tonic::GetErrorHandleType(result); - } - if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { - return tonic::kUnknownErrorType; - } - return error; -} - -tonic::DartErrorHandleType DartController::RunFromPrecompiledSnapshot( - const std::string& entrypoint) { - TRACE_EVENT0("flutter", "DartController::RunFromPrecompiledSnapshot"); - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - tonic::DartState::Scope scope(dart_state()); - if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { - return tonic::kUnknownErrorType; - } - return tonic::kNoError; -} - -tonic::DartErrorHandleType DartController::RunFromScriptSnapshot( - const uint8_t* buffer, - size_t size, - const std::string& entrypoint) { - tonic::DartState::Scope scope(dart_state()); - tonic::DartErrorHandleType error = tonic::kNoError; - if (Dart_IsNull(Dart_RootLibrary())) { - Dart_Handle result = Dart_LoadScriptFromSnapshot(buffer, size); - LogIfError(result); - error = tonic::GetErrorHandleType(result); - } - if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { - return tonic::kUnknownErrorType; - } - return error; -} - -tonic::DartErrorHandleType DartController::RunFromSource( - const std::string& main, - const std::string& packages) { - tonic::DartState::Scope scope(dart_state()); - tonic::DartErrorHandleType error = tonic::kNoError; - if (Dart_IsNull(Dart_RootLibrary())) { - tonic::FileLoader& loader = dart_state()->file_loader(); - if (!packages.empty() && !loader.LoadPackagesMap(ResolvePath(packages))) - FXL_LOG(WARNING) << "Failed to load package map: " << packages; - Dart_Handle result = loader.LoadScript(SanitizePath(main)); - LogIfError(result); - error = tonic::GetErrorHandleType(result); - } - if (SendStartMessage(Dart_RootLibrary())) { - return tonic::kCompilationErrorType; - } - return error; -} - -void DartController::CreateIsolateFor(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - std::unique_ptr state) { - char* error = nullptr; - - void* platform_kernel = GetKernelPlatformBinary(); - - Dart_Isolate isolate; - if (platform_kernel != nullptr) { - isolate = Dart_CreateIsolateFromKernel( - script_uri.c_str(), "main", platform_kernel, nullptr /* flags */, - static_cast(state.get()), &error); - } else { - isolate = - Dart_CreateIsolate(script_uri.c_str(), "main", isolate_snapshot_data, - isolate_snapshot_instr, nullptr, - static_cast(state.get()), &error); - } - FXL_CHECK(isolate) << error; - ui_dart_state_ = state.release(); - ui_dart_state_->set_is_controller_state(true); - dart_state()->message_handler().Initialize(blink::Threads::UI()); - - Dart_SetShouldPauseOnStart(Settings::Get().start_paused); - - ui_dart_state_->set_debug_name_prefix(script_uri); - ui_dart_state_->SetIsolate(isolate); - FXL_CHECK(!LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); - - { - tonic::DartApiScope dart_api_scope; - DartIO::InitForIsolate(); - DartUI::InitForIsolate(); - DartRuntimeHooks::Install(DartRuntimeHooks::MainIsolate, script_uri); - - std::unique_ptr ui_class_provider( - new tonic::DartClassProvider(dart_state(), "dart:ui")); - dart_state()->class_library().add_provider("ui", - std::move(ui_class_provider)); - } - Dart_ExitIsolate(); -} - -} // namespace blink diff --git a/runtime/dart_controller.h b/runtime/dart_controller.h deleted file mode 100644 index 4b11a8660b7e7..0000000000000 --- a/runtime/dart_controller.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2015 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. - -#ifndef FLUTTER_RUNTIME_DART_CONTROLLER_H_ -#define FLUTTER_RUNTIME_DART_CONTROLLER_H_ - -#include -#include - -#include "lib/fxl/macros.h" -#include "lib/tonic/logging/dart_error.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace blink { -class UIDartState; - -class DartController { - public: - DartController(); - ~DartController(); - - tonic::DartErrorHandleType RunFromKernel( - const std::vector& kernel, - const std::string& entrypoint = main_entrypoint_); - tonic::DartErrorHandleType RunFromPrecompiledSnapshot( - const std::string& entrypoint = main_entrypoint_); - tonic::DartErrorHandleType RunFromScriptSnapshot( - const uint8_t* buffer, - size_t size, - const std::string& entrypoint = main_entrypoint_); - tonic::DartErrorHandleType RunFromSource(const std::string& main, - const std::string& packages); - - void CreateIsolateFor(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - std::unique_ptr ui_dart_state); - - UIDartState* dart_state() const { return ui_dart_state_; } - - private: - bool SendStartMessage(Dart_Handle root_library, - const std::string& entrypoint = main_entrypoint_); - - static const std::string main_entrypoint_; - - // The DartState associated with the main isolate. - UIDartState* ui_dart_state_; - - FXL_DISALLOW_COPY_AND_ASSIGN(DartController); -}; -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_CONTROLLER_H_ diff --git a/runtime/dart_init.cc b/runtime/dart_init.cc deleted file mode 100644 index e3d88322a4882..0000000000000 --- a/runtime/dart_init.cc +++ /dev/null @@ -1,725 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/runtime/dart_init.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#include -#include -#include - -#if defined(OS_WIN) -#include -#include -#undef ERROR - -#define access _access -#define R_OK 0x4 - -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif - -#else -#include -#endif - -#include -#include -#include -#include - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/unzipper_provider.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/common/settings.h" -#include "flutter/glue/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/runtime/start_up.h" -#include "lib/fxl/arraysize.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/files/path.h" -#include "lib/fxl/files/file.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/dart_sticky_error.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" -#include "lib/tonic/typed_data/uint8_list.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" -#include "third_party/dart/runtime/include/dart_mirrors_api.h" - -using tonic::DartClassProvider; -using tonic::LogIfError; -using tonic::ToDart; - -namespace dart { -namespace observatory { - -#if !OS(FUCHSIA) && FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - -// These two symbols are defined in |observatory_archive.cc| which is generated -// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. -// Both of these symbols will be part of the data segment and therefore are read -// only. -extern unsigned int observatory_assets_archive_len; -extern const uint8_t* observatory_assets_archive; - -#endif // FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - -} // namespace observatory -} // namespace dart - -namespace blink { - -const char kKernelAssetKey[] = "kernel_blob.bin"; -const char kSnapshotAssetKey[] = "snapshot_blob.bin"; -const char kPlatformKernelAssetKey[] = "platform.dill"; - -namespace { - -// Arguments passed to the Dart VM in all configurations. -static const char* kDartLanguageArgs[] = { - "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", - "--causal_async_stacks", "--limit-ints-to-64-bits", -}; - -static const char* kDartPrecompilationArgs[] = { - "--precompilation", -}; - -static const char* kDartWriteProtectCodeArgs[] FXL_ALLOW_UNUSED_TYPE = { - "--no_write_protect_code", -}; - -static const char* kDartAssertArgs[] = { - // clang-format off - "--enable_asserts", - // clang-format on -}; - -static const char* kDartCheckedModeArgs[] = { - // clang-format off - "--enable_type_checks", - "--error_on_bad_type", - "--error_on_bad_override", - // clang-format on -}; - -static const char* kDartStrongModeArgs[] = { - // clang-format off - "--limit_ints_to_64_bits", - "--reify_generic_functions", - "--strong", - "--sync_async", - // clang-format on -}; - -static const char* kDartStartPausedArgs[]{ - "--pause_isolates_on_start", -}; - -static const char* kDartTraceStartupArgs[]{ - "--timeline_streams=Compiler,Dart,Embedder,GC", -}; - -static const char* kDartEndlessTraceBufferArgs[]{ - "--timeline_recorder=endless", -}; - -static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { - "--systrace_timeline", - "--timeline_streams=VM,Isolate,Compiler,Dart,GC", -}; - -constexpr char kFileUriPrefix[] = "file://"; -constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; - -static const uint8_t* g_default_isolate_snapshot_data = nullptr; -static const uint8_t* g_default_isolate_snapshot_instructions = nullptr; -static bool g_service_isolate_initialized = false; -static ServiceIsolateHook g_service_isolate_hook = nullptr; -static RegisterNativeServiceProtocolExtensionHook - g_register_native_service_protocol_extensions_hook = nullptr; - -// Kernel representation of core dart libraries(loaded from platform.dill). -// TODO(aam): This (and platform_data below) have to be released when engine -// gets torn down. At that point we could also call Dart_Cleanup to complete -// Dart VM cleanup. -static void* kernel_platform = nullptr; -// Bytes actually read from platform.dill that are referenced by kernel_platform -static std::vector platform_data; - -void IsolateShutdownCallback(void* callback_data) { - if (tonic::DartStickyError::IsSet()) { - tonic::DartApiScope api_scope; - FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) - << " exited with an error"; - Dart_Handle sticky_error = Dart_GetStickyError(); - FXL_CHECK(LogIfError(sticky_error)); - } - - UIDartState* dart_state = static_cast(callback_data); - // If the isolate that's shutting down is the main one, tell the higher layers - // of the stack. - if ((dart_state != NULL) && dart_state->is_controller_state()) { - dart_state->set_shutting_down(true); - if (dart_state->isolate_client()) { - dart_state->isolate_client()->DidShutdownMainIsolate(); - } - } -} - -// The cleanup callback frees the DartState object. -void IsolateCleanupCallback(void* callback_data) { - UIDartState* dart_state = static_cast(callback_data); - delete dart_state; -} - -bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { - if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { - // Assume modified. - return true; - } - - const char* path = source_url + kFileUriPrefixLength; - struct stat info; - if (stat(path, &info) < 0) - return true; - - // If st_mtime is zero, it's more likely that the file system doesn't support - // mtime than that the file was actually modified in the 1970s. - if (!info.st_mtime) - return true; - - // It's very unclear what time bases we're with here. The Dart API doesn't - // document the time base for since_ms. Reading the code, the value varies by - // platform, with a typical source being something like gettimeofday. - // - // We add one to st_mtime because st_mtime has less precision than since_ms - // and we want to treat the file as modified if the since time is between - // ticks of the mtime. - fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); - fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); - - return mtime > since; -} - -void ThreadExitCallback() {} - -bool IsServiceIsolateURL(const char* url_name) { - return url_name != nullptr && - std::string(url_name) == DART_VM_SERVICE_ISOLATE_NAME; -} - -static bool StringEndsWith(const std::string& string, - const std::string& ending) { - if (ending.size() > string.size()) - return false; - - return string.compare(string.size() - ending.size(), ending.size(), ending) == - 0; -} - -static void ReleaseFetchedBytes(uint8_t* buffer) { - free(buffer); -} - -Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, - Dart_IsolateFlags* flags, - char** error) { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - // No VM-service in release mode. - return nullptr; -#else // FLUTTER_RUNTIME_MODE - UIDartState* dart_state = new UIDartState(nullptr, nullptr); - - bool is_running_from_kernel = GetKernelPlatformBinary() != nullptr; - - flags->load_vmservice_library = true; - Dart_Isolate isolate = - is_running_from_kernel - ? Dart_CreateIsolateFromKernel( - script_uri, "main", kernel_platform, flags, - static_cast(dart_state), error) - : Dart_CreateIsolate( - script_uri, "main", g_default_isolate_snapshot_data, - g_default_isolate_snapshot_instructions, flags, - static_cast(dart_state), error); - - FXL_CHECK(isolate) << error; - dart_state->set_debug_name_prefix(script_uri); - dart_state->SetIsolate(isolate); - FXL_CHECK(Dart_IsServiceIsolate(isolate)); - FXL_CHECK(!LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); - { - tonic::DartApiScope dart_api_scope; - DartIO::InitForIsolate(); - DartUI::InitForIsolate(); - DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); - const Settings& settings = Settings::Get(); - if (settings.enable_observatory) { - std::string ip = settings.ipv6 ? "::1" : "127.0.0.1"; - const intptr_t port = settings.observatory_port; - const bool disable_websocket_origin_check = false; - const bool service_isolate_booted = DartServiceIsolate::Startup( - ip, port, tonic::DartState::HandleLibraryTag, - !IsRunningPrecompiledCode() && !is_running_from_kernel, - disable_websocket_origin_check, error); - FXL_CHECK(service_isolate_booted) << error; - } - - if (g_service_isolate_hook) - g_service_isolate_hook(IsRunningPrecompiledCode()); - } - Dart_ExitIsolate(); - - g_service_isolate_initialized = true; - // Register any native service protocol extensions. - if (g_register_native_service_protocol_extensions_hook) { - g_register_native_service_protocol_extensions_hook( - IsRunningPrecompiledCode()); - } - return isolate; -#endif // FLUTTER_RUNTIME_MODE -} - -static bool GetAssetAsBuffer( - const std::string& name, - std::vector* data, - fxl::RefPtr& directory_asset_bundle, - fxl::RefPtr& asset_store) { - return (directory_asset_bundle && - directory_asset_bundle->GetAsBuffer(name, data)) || - (asset_store && asset_store->GetAsBuffer(name, data)); -} - -Dart_Isolate IsolateCreateCallback(const char* script_uri, - const char* main, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - void* callback_data, - char** error) { - TRACE_EVENT0("flutter", __func__); - - if (IsServiceIsolateURL(script_uri)) { - return ServiceIsolateCreateCallback(script_uri, flags, error); - } - - std::string entry_uri = script_uri; - // Are we running from a Dart source file? - const bool running_from_source = StringEndsWith(entry_uri, ".dart"); - - std::vector kernel_data; - std::vector snapshot_data; - std::string entry_path; - if (!IsRunningPrecompiledCode()) { - // Check that the entry script URI starts with file:// - if (entry_uri.find(kFileUriPrefix) != 0u) { - *error = strdup("Isolates must use file:// URIs"); - return nullptr; - } - // Entry script path (file:// is stripped). - entry_path = std::string(script_uri + strlen(kFileUriPrefix)); - if (StringEndsWith(entry_path, ".dill")) { - // Load the kernel from the script URI. - if (!files::ReadFileToVector(entry_path, &kernel_data)) { - FXL_LOG(ERROR) << "Failed to load kernel"; - } - } else if (!running_from_source) { - // Attempt to copy the snapshot or kernel from the asset bundle. - const std::string& bundle_path = entry_path; - - struct stat stat_result = {}; - if (::stat(bundle_path.c_str(), &stat_result) == 0) { - fxl::RefPtr directory_asset_bundle; - // TODO(zarah): Remove usage of zip_asset_store once app.flx is removed. - fxl::RefPtr zip_asset_store; - // bundle_path is either the path to app.flx or the flutter assets - // directory. - std::string flx_path = bundle_path; - if (S_ISDIR(stat_result.st_mode)) { - directory_asset_bundle = - fxl::MakeRefCounted(bundle_path); - flx_path = files::GetDirectoryName(bundle_path) + "/app.flx"; - } - - if (access(flx_path.c_str(), R_OK) == 0) { - zip_asset_store = fxl::MakeRefCounted( - GetUnzipperProviderForPath(flx_path)); - } - GetAssetAsBuffer(kKernelAssetKey, &kernel_data, directory_asset_bundle, - zip_asset_store); - GetAssetAsBuffer(kSnapshotAssetKey, &snapshot_data, - directory_asset_bundle, zip_asset_store); - } - } - } - - UIDartState* parent_dart_state = static_cast(callback_data); - UIDartState* dart_state = parent_dart_state->CreateForChildIsolate(); - - Dart_Isolate isolate = - kernel_platform != nullptr - ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_platform, - nullptr /* flags */, dart_state, error) - : Dart_CreateIsolate(script_uri, main, - g_default_isolate_snapshot_data, - g_default_isolate_snapshot_instructions, nullptr, - dart_state, error); - FXL_CHECK(isolate) << error; - dart_state->set_debug_name_prefix(script_uri); - dart_state->SetIsolate(isolate); - FXL_CHECK(!LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); - - { - tonic::DartApiScope dart_api_scope; - DartIO::InitForIsolate(); - DartUI::InitForIsolate(); - DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); - - std::unique_ptr ui_class_provider( - new DartClassProvider(dart_state, "dart:ui")); - dart_state->class_library().add_provider("ui", - std::move(ui_class_provider)); - - if (!kernel_data.empty()) { - // We are running kernel code. - FXL_CHECK(!LogIfError(Dart_LoadScriptFromKernel(kernel_data.data(), - kernel_data.size()))); - } else if (!snapshot_data.empty()) { - // We are running from a script snapshot. - FXL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(), - snapshot_data.size()))); - } else if (running_from_source) { - // We are running from source. - // Forward the .packages configuration from the parent isolate to the - // child isolate. - tonic::FileLoader& parent_loader = parent_dart_state->file_loader(); - const std::string& packages = parent_loader.packages(); - tonic::FileLoader& loader = dart_state->file_loader(); - if (!packages.empty() && !loader.LoadPackagesMap(packages)) { - FXL_LOG(WARNING) << "Failed to load package map: " << packages; - } - // Load the script. - FXL_CHECK(!LogIfError(loader.LoadScript(entry_path))); - } - - dart_state->isolate_client()->DidCreateSecondaryIsolate(isolate); - } - - Dart_ExitIsolate(); - - FXL_CHECK(Dart_IsolateMakeRunnable(isolate)); - return isolate; -} - -Dart_Handle GetVMServiceAssetsArchiveCallback() { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - return nullptr; -#elif OS(FUCHSIA) - std::vector observatory_assets_archive; - if (!files::ReadFileToVector("pkg/data/observatory.tar", - &observatory_assets_archive)) { - FXL_LOG(ERROR) << "Fail to load Observatory archive"; - return nullptr; - } - return tonic::DartConverter::ToDart( - observatory_assets_archive.data(), - observatory_assets_archive.size()); -#else - return tonic::DartConverter::ToDart( - ::dart::observatory::observatory_assets_archive, - ::dart::observatory::observatory_assets_archive_len); -#endif -} - -static const char kStdoutStreamId[] = "Stdout"; -static const char kStderrStreamId[] = "Stderr"; - -static bool ServiceStreamListenCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(true); - return true; - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(true); - return true; - } - return false; -} - -static void ServiceStreamCancelCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(false); - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(false); - } -} - -} // namespace - -bool IsRunningPrecompiledCode() { - return Dart_IsPrecompiledRuntime(); -} - -EmbedderTracingCallbacks* g_tracing_callbacks = nullptr; - -EmbedderTracingCallbacks::EmbedderTracingCallbacks( - EmbedderTracingCallback start, - EmbedderTracingCallback stop) - : start_tracing_callback(start), stop_tracing_callback(stop) {} - -void SetEmbedderTracingCallbacks( - std::unique_ptr callbacks) { - g_tracing_callbacks = callbacks.release(); -} - -static void EmbedderTimelineStartRecording() { - if (g_tracing_callbacks) - g_tracing_callbacks->start_tracing_callback(); -} - -static void EmbedderTimelineStopRecording() { - if (g_tracing_callbacks) - g_tracing_callbacks->stop_tracing_callback(); -} - -static std::vector ProfilingFlags(bool enable_profiling) { -// Disable Dart's built in profiler when building a debug build. This -// works around a race condition that would sometimes stop a crash's -// stack trace from being printed on Android. -#ifndef NDEBUG - enable_profiling = false; -#endif - - // We want to disable profiling by default because it overwhelms LLDB. But - // the VM enables the same by default. In either case, we have some profiling - // flags. - if (enable_profiling) { - return { - // This is the default. But just be explicit. - "--profiler", - // This instructs the profiler to walk C++ frames, and to include - // them in the profile. - "--profile-vm"}; - } else { - return {"--no-profiler"}; - } -} - -void SetServiceIsolateHook(ServiceIsolateHook hook) { - FXL_CHECK(!g_service_isolate_initialized); - g_service_isolate_hook = hook; -} - -void SetRegisterNativeServiceProtocolExtensionHook( - RegisterNativeServiceProtocolExtensionHook hook) { - FXL_CHECK(!g_service_isolate_initialized); - g_register_native_service_protocol_extensions_hook = hook; -} - -void PushBackAll(std::vector* args, - const char** argv, - size_t argc) { - for (size_t i = 0; i < argc; ++i) { - args->push_back(argv[i]); - } -} - -static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { - info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; - dart::bin::GetIOEmbedderInformation(info); - info->name = "Flutter"; -} - -void* GetKernelPlatformBinary() { - return kernel_platform; -} - -void InitDartVM(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path) { - TRACE_EVENT0("flutter", __func__); - - g_default_isolate_snapshot_data = default_isolate_snapshot_data; - g_default_isolate_snapshot_instructions = - default_isolate_snapshot_instructions; - - const Settings& settings = Settings::Get(); - - { - TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); - dart::bin::BootstrapDartIo(); - - if (!settings.temp_directory_path.empty()) { - dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); - } - } - - std::vector args; - - // Instruct the VM to ignore unrecognized flags. - // There is a lot of diversity in a lot of combinations when it - // comes to the arguments the VM supports. And, if the VM comes across a flag - // it does not recognize, it exits immediately. - args.push_back("--ignore-unrecognized-flags"); - - for (const auto& profiler_flag : - ProfilingFlags(settings.enable_dart_profiling)) { - args.push_back(profiler_flag); - } - - PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); - - if (IsRunningPrecompiledCode()) { - PushBackAll(&args, kDartPrecompilationArgs, - arraysize(kDartPrecompilationArgs)); - } - -#if defined(OS_FUCHSIA) -#if defined(NDEBUG) - // Do not enable checked mode for Fuchsia release builds - // TODO(mikejurka): remove this once precompiled code is working on Fuchsia - const bool use_checked_mode = false; -#else // !defined(NDEBUG) - const bool use_checked_mode = true; -#endif // !defined(NDEBUG) -#else // !defined(OS_FUCHSIA) - // Enable checked mode if we are not running precompiled code. We run non- - // precompiled code only in the debug product mode. - const bool use_checked_mode = - !IsRunningPrecompiledCode() && !settings.dart_non_checked_mode; -#endif // !defined(OS_FUCHSIA) - -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - // Debug mode uses the JIT, disable code page write protection to avoid - // memory page protection changes before and after every compilation. - PushBackAll(&args, kDartWriteProtectCodeArgs, - arraysize(kDartWriteProtectCodeArgs)); -#endif - - if (settings.start_paused) - PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); - - if (settings.endless_trace_buffer || settings.trace_startup) { - // If we are tracing startup, make sure the trace buffer is endless so we - // don't lose early traces. - PushBackAll(&args, kDartEndlessTraceBufferArgs, - arraysize(kDartEndlessTraceBufferArgs)); - } - - if (settings.trace_startup) { - PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); - } - -#if defined(OS_FUCHSIA) - PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); -#endif - - if (!bundle_path.empty()) { - fxl::RefPtr directory_asset_bundle = - fxl::MakeRefCounted( - std::move(bundle_path)); - directory_asset_bundle->GetAsBuffer(kPlatformKernelAssetKey, - &platform_data); - if (!platform_data.empty()) { - uint8_t* kernel_buf = static_cast(malloc(platform_data.size())); - memcpy(kernel_buf, platform_data.data(), platform_data.size()); - kernel_platform = Dart_ReadKernelBinary(kernel_buf, platform_data.size(), - ReleaseFetchedBytes); - FXL_DCHECK(kernel_platform != nullptr); - } - } - if ((kernel_platform != nullptr) || - Dart_IsDart2Snapshot(g_default_isolate_snapshot_data)) { - // The presence of the kernel platform file or a snapshot that was generated - // for Dart2 indicates we are running in preview-dart-2 mode and in this - // mode enable strong mode options by default. - // Note: When we start using core snapshots instead of the platform file - // in the engine just sniffing the snapshot file should be sufficient. - PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); - // In addition if we are running in debug mode we also enable asserts. - if (use_checked_mode) { - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - } - } else if (use_checked_mode) { - // In non preview-dart-2 mode we enable checked mode and asserts if - // we are running in debug mode. - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); - } - - for (size_t i = 0; i < settings.dart_flags.size(); i++) - args.push_back(settings.dart_flags[i].c_str()); - - FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); - - DartUI::InitForGlobal(); - - // Setup embedder tracing hooks. To avoid data races, it is recommended that - // these hooks be installed before the DartInitialize, so do that setup now. - Dart_SetEmbedderTimelineCallbacks(&EmbedderTimelineStartRecording, - &EmbedderTimelineStopRecording); - - Dart_SetFileModifiedCallback(&DartFileModifiedCallback); - - { - TRACE_EVENT0("flutter", "Dart_Initialize"); - Dart_InitializeParams params = {}; - params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; - params.vm_snapshot_data = vm_snapshot_data; - params.vm_snapshot_instructions = vm_snapshot_instructions; - params.create = IsolateCreateCallback; - params.shutdown = IsolateShutdownCallback; - params.cleanup = IsolateCleanupCallback; - params.thread_exit = ThreadExitCallback; - params.get_service_assets = GetVMServiceAssetsArchiveCallback; - params.entropy_source = DartIO::EntropySource; - char* init_error = Dart_Initialize(¶ms); - if (init_error != nullptr) - FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; - free(init_error); - - // Send the earliest available timestamp in the application lifecycle to - // timeline. The difference between this timestamp and the time we render - // the very first frame gives us a good idea about Flutter's startup time. - // Use a duration event so about:tracing will consider this event when - // deciding the earliest event to use as time 0. - if (blink::engine_main_enter_ts != 0) { - Dart_TimelineEvent("FlutterEngineMainEnter", // label - blink::engine_main_enter_ts, // timestamp0 - blink::engine_main_enter_ts, // timestamp1_or_async_id - Dart_Timeline_Event_Duration, // event type - 0, // argument_count - nullptr, // argument_names - nullptr // argument_values - ); - } - } - - // Allow streaming of stdout and stderr by the Dart vm. - Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, - &ServiceStreamCancelCallback); - - Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); -} - -} // namespace blink diff --git a/runtime/dart_init.h b/runtime/dart_init.h deleted file mode 100644 index 99c8fe89137e3..0000000000000 --- a/runtime/dart_init.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2015 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. - -#ifndef FLUTTER_RUNTIME_DART_INIT_H_ -#define FLUTTER_RUNTIME_DART_INIT_H_ - -#include "lib/fxl/build_config.h" -#include "lib/fxl/functional/closure.h" -#include "third_party/dart/runtime/include/dart_api.h" - -#include -#include -#include - -namespace blink { - -// Name of the kernel blob asset within the asset directory. -extern const char kKernelAssetKey[]; - -// Name of the snapshot blob asset within the asset directory. -extern const char kSnapshotAssetKey[]; - -// Name of the platform kernel blob asset within the asset directory. -extern const char kPlatformKernelAssetKey[]; - -bool IsRunningPrecompiledCode(); - -using EmbedderTracingCallback = fxl::Closure; - -typedef void (*ServiceIsolateHook)(bool); -typedef void (*RegisterNativeServiceProtocolExtensionHook)(bool); - -struct EmbedderTracingCallbacks { - EmbedderTracingCallback start_tracing_callback; - EmbedderTracingCallback stop_tracing_callback; - - EmbedderTracingCallbacks(EmbedderTracingCallback start, - EmbedderTracingCallback stop); -}; - -void InitDartVM(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path); - -void* GetKernelPlatformBinary(); - -void SetEmbedderTracingCallbacks( - std::unique_ptr callbacks); - -// Provide a function that will be called during initialization of the -// service isolate. -void SetServiceIsolateHook(ServiceIsolateHook hook); - -// Provide a function that will be called to register native service protocol -// extensions. -void SetRegisterNativeServiceProtocolExtensionHook( - RegisterNativeServiceProtocolExtensionHook hook); - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_INIT_H_ diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc new file mode 100644 index 0000000000000..c5fd770b1b40c --- /dev/null +++ b/runtime/dart_isolate.cc @@ -0,0 +1,715 @@ +// Copyright 2017 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/runtime/dart_isolate.h" + +#include +#include + +#include "flutter/fml/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/runtime/dart_vm.h" +#include "lib/fxl/files/path.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_class_provider.h" +#include "lib/tonic/dart_message_handler.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/dart_sticky_error.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/scopes/dart_isolate_scope.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace blink { + +fml::WeakPtr DartIsolate::CreateRootIsolate( + const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + std::unique_ptr window, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, + Dart_IsolateFlags* flags) { + TRACE_EVENT0("flutter", "DartIsolate::CreateRootIsolate"); + Dart_Isolate vm_isolate = nullptr; + fml::WeakPtr embedder_isolate; + + char* error = nullptr; + + // Since this is the root isolate, we fake a parent embedder data object. We + // cannot use unique_ptr here because the destructor is private (since the + // isolate lifecycle is entirely managed by the VM). + auto root_embedder_data = std::make_unique( + vm, // VM + std::move(isolate_snapshot), // isolate snapshot + task_runners, // task runners + std::move(resource_context), // resource context + std::move(unref_queue), // skia unref queue + advisory_script_uri, // advisory URI + advisory_script_entrypoint // advisory entrypoint + ); + + std::tie(vm_isolate, embedder_isolate) = CreateDartVMAndEmbedderObjectPair( + advisory_script_uri.c_str(), // advisory script URI + advisory_script_entrypoint.c_str(), // advisory script entrypoint + nullptr, // package root + nullptr, // package config + flags, // flags + root_embedder_data.get(), // parent embedder data + true, // is root isolate + &error // error (out) + ); + + if (error != nullptr) { + free(error); + } + + if (vm_isolate == nullptr) { + return {}; + } + + if (embedder_isolate) { + // Only root isolates can interact with windows. + embedder_isolate->SetWindow(std::move(window)); + embedder_isolate->set_use_blink(vm->GetSettings().using_blink); + } + + return embedder_isolate; +} + +DartIsolate::DartIsolate(const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint) + : UIDartState(std::move(task_runners), + vm->GetSettings().task_observer_add, + vm->GetSettings().task_observer_remove, + std::move(resource_context), + std::move(unref_queue), + advisory_script_uri, + advisory_script_entrypoint, + vm->GetSettings().log_tag), + vm_(vm), + isolate_snapshot_(std::move(isolate_snapshot)), + weak_factory_(this) { + FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; + weak_prototype_ = weak_factory_.GetWeakPtr(); + + if (vm_ == nullptr) { + return; + } + + phase_ = Phase::Uninitialized; +} + +DartIsolate::~DartIsolate() = default; + +DartIsolate::Phase DartIsolate::GetPhase() const { + return phase_; +} + +const DartVM* DartIsolate::GetDartVM() const { + return vm_; +} + +bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { + TRACE_EVENT0("flutter", "DartIsolate::Initialize"); + if (phase_ != Phase::Uninitialized) { + return false; + } + + if (dart_isolate == nullptr) { + return false; + } + + if (Dart_CurrentIsolate() != dart_isolate) { + return false; + } + + if (Dart_IsolateData(dart_isolate) != this) { + return false; + } + + // After this point, isolate scopes can be safely used. + SetIsolate(dart_isolate); + + // We are entering a new scope (for the first time since initialization) and + // we want to restore the current scope to null when we exit out of this + // method. This balances the implicit Dart_EnterIsolate call made by + // Dart_CreateIsolate (which calls the Initialize). + Dart_ExitIsolate(); + + tonic::DartIsolateScope scope(isolate()); + + if (is_root_isolate) { + if (auto task_runner = GetTaskRunners().GetUITaskRunner()) { + // Isolates may not have any particular thread affinity. Only initialize + // the message handler if a task runner is explicitly specified. + message_handler().Initialize(task_runner); + } + } + + if (tonic::LogIfError( + Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))) { + return false; + } + + if (!UpdateThreadPoolNames()) { + return false; + } + + phase_ = Phase::Initialized; + return true; +} + +// Updating thread names here does not change the underlying OS thread names. +// Instead, this is just additional metadata for the Observatory to show the +// thread name of the isolate. +bool DartIsolate::UpdateThreadPoolNames() const { + // TODO(chinmaygarde): This implementation does not account for multiple + // shells sharing the same (or subset of) threads. + const auto& task_runners = GetTaskRunners(); + + if (auto task_runner = task_runners.GetGPUTaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".gpu"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + if (auto task_runner = task_runners.GetUITaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".ui"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + if (auto task_runner = task_runners.GetIOTaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".io"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + if (auto task_runner = task_runners.GetPlatformTaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".platform"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + return true; +} + +bool DartIsolate::LoadLibraries() { + TRACE_EVENT0("flutter", "DartIsolate::LoadLibraries"); + if (phase_ != Phase::Initialized) { + return false; + } + + tonic::DartState::Scope scope(this); + + DartIO::InitForIsolate(); + + DartUI::InitForIsolate(); + + const bool is_service_isolate = Dart_IsServiceIsolate(isolate()); + + DartRuntimeHooks::Install(is_service_isolate + ? DartRuntimeHooks::SecondaryIsolate + : DartRuntimeHooks::MainIsolate, + GetAdvisoryScriptURI()); + + if (!is_service_isolate) { + class_library().add_provider( + "ui", std::make_unique(this, "dart:ui")); + } + + phase_ = Phase::LibrariesSetup; + return true; +} + +bool DartIsolate::PrepareForRunningFromPrecompiledCode() { + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromPrecompiledCode"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + if (!DartVM::IsRunningPrecompiledCode()) { + return false; + } + + tonic::DartState::Scope scope(this); + + if (Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!MarkIsolateRunnable()) { + return false; + } + + phase_ = Phase::Ready; + return true; +} + +static bool LoadScriptSnapshot(std::unique_ptr mapping) { + if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), + mapping->GetSize()))) { + return false; + } + return true; +} + +static bool LoadKernelSnapshot(std::unique_ptr mapping) { + if (tonic::LogIfError(Dart_LoadScriptFromKernel(mapping->GetMapping(), + mapping->GetSize()))) { + return false; + } + + return true; +} + +static bool LoadSnapshot(std::unique_ptr mapping, + bool is_kernel) { + if (is_kernel) { + return LoadKernelSnapshot(std::move(mapping)); + } else { + return LoadScriptSnapshot(std::move(mapping)); + } + return false; +} + +FXL_WARN_UNUSED_RESULT +bool DartIsolate::PrepareForRunningFromSnapshot( + std::unique_ptr mapping) { + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSnapshot"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + if (DartVM::IsRunningPrecompiledCode()) { + return false; + } + + if (!mapping || mapping->GetSize() == 0) { + return false; + } + + tonic::DartState::Scope scope(this); + + if (!Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!LoadSnapshot(std::move(mapping), vm_->GetPlatformKernel() != nullptr)) { + return false; + } + + if (Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!MarkIsolateRunnable()) { + return false; + } + + phase_ = Phase::Ready; + return true; +} + +static bool FileNameIsDill(const std::string& name) { + const std::string suffix = ".dill"; + + if (name.size() < suffix.size()) { + return false; + } + + if (name.rfind(suffix, name.size()) == name.size() - suffix.size()) { + return true; + } + return false; +} + +bool DartIsolate::PrepareForRunningFromSource( + const std::string& main_source_file, + const std::string& packages) { + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSource"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + if (DartVM::IsRunningPrecompiledCode()) { + return false; + } + + if (main_source_file.empty()) { + return false; + } + + tonic::DartState::Scope scope(this); + + if (!Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + auto& loader = file_loader(); + + if (!packages.empty()) { + auto packages_absolute_path = files::AbsolutePath(packages); + FXL_DLOG(INFO) << "Loading from packages: " << packages_absolute_path; + if (!loader.LoadPackagesMap(packages_absolute_path)) { + return false; + } + } + + auto main_source_absolute_path = files::AbsolutePath(main_source_file); + FXL_DLOG(INFO) << "Loading from source: " << main_source_absolute_path; + + // The "source" file may be a ".dill" file. + if (FileNameIsDill(main_source_absolute_path)) { + auto mapping = + std::make_unique(main_source_absolute_path, false); + if (mapping == nullptr) { + return false; + } + if (!LoadKernelSnapshot(std::move(mapping))) { + return false; + } + } else { + if (tonic::LogIfError(loader.LoadScript(main_source_absolute_path))) { + return false; + } + } + + if (Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!MarkIsolateRunnable()) { + return false; + } + + phase_ = Phase::Ready; + return true; +} + +bool DartIsolate::MarkIsolateRunnable() { + TRACE_EVENT0("flutter", "DartIsolate::MarkIsolateRunnable"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + // This function may only be called from an active isolate scope. + if (Dart_CurrentIsolate() != isolate()) { + return false; + } + + // There must be no current isolate to mark an isolate as being runnable. + Dart_ExitIsolate(); + + if (!Dart_IsolateMakeRunnable(isolate())) { + // Failed. Restore the isolate. + Dart_EnterIsolate(isolate()); + return false; + } + // Success. Restore the isolate. + Dart_EnterIsolate(isolate()); + return true; +} + +FXL_WARN_UNUSED_RESULT +bool DartIsolate::Run(const std::string& entrypoint_name) { + TRACE_EVENT0("flutter", "DartIsolate::Run"); + if (phase_ != Phase::Ready) { + return false; + } + + tonic::DartState::Scope scope(this); + + Dart_Handle entrypoint = Dart_GetClosure( + Dart_RootLibrary(), tonic::ToDart(entrypoint_name.c_str())); + if (tonic::LogIfError(entrypoint)) { + return false; + } + + Dart_Handle isolate_lib = Dart_LookupLibrary(tonic::ToDart("dart:isolate")); + if (tonic::LogIfError(isolate_lib)) { + return false; + } + + Dart_Handle isolate_args[] = { + entrypoint, + Dart_Null(), + }; + + if (tonic::LogIfError(Dart_Invoke( + isolate_lib, tonic::ToDart("_startMainIsolate"), + sizeof(isolate_args) / sizeof(isolate_args[0]), isolate_args))) { + return false; + } + + phase_ = Phase::Running; + return true; +} + +bool DartIsolate::Shutdown() { + TRACE_EVENT0("flutter", "DartIsolate::Shutdown"); + // This call may be re-entrant since Dart_ShutdownIsolate can invoke the + // cleanup callback which deletes the embedder side object of the dart isolate + // (a.k.a. this). + if (phase_ == Phase::Shutdown) { + return false; + } + phase_ = Phase::Shutdown; + Dart_Isolate vm_isolate = isolate(); + // The isolate can be nullptr if this instance is the stub isolate data used + // during root isolate creation. + if (vm_isolate != nullptr) { + // We need to enter the isolate because Dart_ShutdownIsolate does not take + // the isolate to shutdown as a parameter. + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + Dart_EnterIsolate(vm_isolate); + Dart_ShutdownIsolate(); + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + } + return true; +} + +static Dart_Isolate DartCreateAndStartServiceIsolate( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + char** error) { + auto vm = DartVM::ForProcessIfInitialized(); + + if (!vm) { + *error = strdup( + "Could not resolve the VM when attempting to create the service " + "isolate."); + return nullptr; + } + + const auto& settings = vm->GetSettings(); + + if (!settings.enable_observatory) { + FXL_DLOG(INFO) << "Observatory is disabled."; + return nullptr; + } + + blink::TaskRunners null_task_runners( + "io.flutter." DART_VM_SERVICE_ISOLATE_NAME, nullptr, nullptr, nullptr, + nullptr); + + flags->load_vmservice_library = true; + + auto service_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + null_task_runners, // task runners + nullptr, // window + {}, // resource context + {}, // unref queue + advisory_script_uri == nullptr ? "" : advisory_script_uri, // script uri + advisory_script_entrypoint == nullptr + ? "" + : advisory_script_entrypoint, // script entrypoint + flags // flags + ); + + if (!service_isolate) { + *error = strdup("Could not create the service isolate."); + FXL_DLOG(ERROR) << *error; + return nullptr; + } + + // The engine never holds a strong reference to the VM service isolate. Since + // we are about to lose our last weak reference to it, start the VM service + // while we have this reference. + + const bool running_from_sources = + !DartVM::IsRunningPrecompiledCode() && vm->GetPlatformKernel() == nullptr; + + tonic::DartState::Scope scope(service_isolate.get()); + if (!DartServiceIsolate::Startup( + settings.ipv6 ? "::1" : "127.0.0.1", // server IP address + settings.observatory_port, // server observatory port + tonic::DartState::HandleLibraryTag, // embedder library tag handler + running_from_sources, // running from source code + false, // disable websocket origin check + error // error (out) + )) { + // Error is populated by call to startup. + FXL_DLOG(ERROR) << *error; + return nullptr; + } + + vm->GetServiceProtocol().ToggleHooks(true); + + return service_isolate->isolate(); +} + +// |Dart_IsolateCreateCallback| +Dart_Isolate DartIsolate::DartIsolateCreateCallback( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* parent_embedder_isolate, + char** error) { + if (parent_embedder_isolate == nullptr && + strcmp(advisory_script_uri, DART_VM_SERVICE_ISOLATE_NAME) == 0) { + // The VM attempts to start the VM service for us on |Dart_Initialize|. In + // such a case, the callback data will be null and the script URI will be + // DART_VM_SERVICE_ISOLATE_NAME. In such cases, we just create the service + // isolate like normal but dont hold a reference to it at all. We also start + // this isolate since we will never again reference it from the engine. + return DartCreateAndStartServiceIsolate(advisory_script_uri, // + advisory_script_entrypoint, // + package_root, // + package_config, // + flags, // + error // + ); + } + + return CreateDartVMAndEmbedderObjectPair( + advisory_script_uri, // URI + advisory_script_entrypoint, // entrypoint + package_root, // package root + package_config, // package config + flags, // isolate flags + parent_embedder_isolate, // embedder data + false, // is root isolate + error // error + ) + .first; +} + +std::pair> +DartIsolate::CreateDartVMAndEmbedderObjectPair( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* parent_embedder_isolate, + bool is_root_isolate, + char** error) { + TRACE_EVENT0("flutter", "DartIsolate::CreateDartVMAndEmbedderObjectPair"); + if (parent_embedder_isolate == nullptr || + parent_embedder_isolate->GetDartVM() == nullptr) { + *error = + strdup("Parent isolate did not have embedder specific callback data."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + const DartVM* vm = parent_embedder_isolate->GetDartVM(); + + // Create the native object on the embedder side. This object is deleted in + // the cleanup callback. + auto embedder_isolate = std::make_unique( + vm, // + parent_embedder_isolate->GetIsolateSnapshot(), // + parent_embedder_isolate->GetTaskRunners(), // + parent_embedder_isolate->GetResourceContext(), // + parent_embedder_isolate->GetSkiaUnrefQueue(), // + advisory_script_uri, // + advisory_script_entrypoint // + ); + + // Create the Dart VM isolate and give it the embedder object as the baton. + Dart_Isolate isolate = + vm->GetPlatformKernel() != nullptr + ? Dart_CreateIsolateFromKernel(advisory_script_uri, // + advisory_script_entrypoint, // + vm->GetPlatformKernel(), // + flags, // + embedder_isolate.get(), // + error // + ) + : Dart_CreateIsolate(advisory_script_uri, // + advisory_script_entrypoint, // + embedder_isolate->GetIsolateSnapshot() + ->GetData() + ->GetSnapshotPointer(), // + embedder_isolate->GetIsolateSnapshot() + ->GetInstructionsIfPresent(), // + flags, // + embedder_isolate.get(), // + error // + ); + + if (isolate == nullptr) { + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + if (!embedder_isolate->Initialize(isolate, is_root_isolate)) { + *error = strdup("Embedder could not initialize the Dart isolate."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + if (!embedder_isolate->LoadLibraries()) { + *error = + strdup("Embedder could not load libraries in the new Dart isolate."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + // The ownership of the embedder object is controlled by the Dart VM. So the + // only reference returned to the caller is weak. + return {isolate, embedder_isolate.release()->GetWeakIsolatePtr()}; +} + +// |Dart_IsolateShutdownCallback| +void DartIsolate::DartIsolateShutdownCallback(DartIsolate* embedder_isolate) { + if (!tonic::DartStickyError::IsSet()) { + return; + } + + tonic::DartApiScope api_scope; + FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) + << " exited with an error"; + Dart_Handle sticky_error = Dart_GetStickyError(); + FXL_CHECK(tonic::LogIfError(sticky_error)); +} + +// |Dart_IsolateCleanupCallback| +void DartIsolate::DartIsolateCleanupCallback(DartIsolate* embedder_isolate) { + delete embedder_isolate; +} + +fxl::RefPtr DartIsolate::GetIsolateSnapshot() const { + return isolate_snapshot_; +} + +fml::WeakPtr DartIsolate::GetWeakIsolatePtr() const { + return weak_prototype_; +} + +void DartIsolate::AddIsolateShutdownCallback(fxl::Closure closure) { + shutdown_callbacks_.emplace_back( + std::make_unique(std::move(closure))); +} + +} // namespace blink diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h new file mode 100644 index 0000000000000..13d573ebe333f --- /dev/null +++ b/runtime/dart_isolate.h @@ -0,0 +1,152 @@ +// Copyright 2017 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_RUNTIME_DART_ISOLATE_H_ +#define FLUTTER_RUNTIME_DART_ISOLATE_H_ + +#include +#include + +#include "flutter/common/task_runners.h" +#include "flutter/fml/mapping.h" +#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_snapshot.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" +#include "lib/tonic/dart_state.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace blink { +class DartVM; + +class DartIsolate : public UIDartState { + public: + enum class Phase { + Unknown, + Uninitialized, + Initialized, + LibrariesSetup, + Ready, + Running, + Shutdown, + }; + + // The root isolate of a Flutter application is special because it gets Window + // bindings. From the VM's perspective, this isolate is not special in any + // way. + static fml::WeakPtr CreateRootIsolate( + const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + std::unique_ptr window, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri = "main.dart", + std::string advisory_script_entrypoint = "main", + Dart_IsolateFlags* flags = nullptr); + + DartIsolate(const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint); + + ~DartIsolate() override; + + Phase GetPhase() const; + + FXL_WARN_UNUSED_RESULT + bool PrepareForRunningFromPrecompiledCode(); + + FXL_WARN_UNUSED_RESULT + bool PrepareForRunningFromSnapshot(std::unique_ptr snapshot); + + FXL_WARN_UNUSED_RESULT + bool PrepareForRunningFromSource(const std::string& main_source_file, + const std::string& packages); + + FXL_WARN_UNUSED_RESULT + bool Run(const std::string& entrypoint); + + FXL_WARN_UNUSED_RESULT + bool Shutdown(); + + void AddIsolateShutdownCallback(fxl::Closure closure); + + const DartVM* GetDartVM() const; + + fxl::RefPtr GetIsolateSnapshot() const; + + fml::WeakPtr GetWeakIsolatePtr() const; + + private: + class AutoFireClosure { + public: + AutoFireClosure(fxl::Closure closure) : closure_(std::move(closure)) {} + ~AutoFireClosure() { + if (closure_) { + closure_(); + } + } + + private: + fxl::Closure closure_; + FXL_DISALLOW_COPY_AND_ASSIGN(AutoFireClosure); + }; + friend class DartVM; + + const DartVM* vm_ = nullptr; + Phase phase_ = Phase::Unknown; + const fxl::RefPtr isolate_snapshot_; + std::vector> shutdown_callbacks_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + FXL_WARN_UNUSED_RESULT + bool Initialize(Dart_Isolate isolate, bool is_root_isolate); + + FXL_WARN_UNUSED_RESULT + bool LoadLibraries(); + + bool UpdateThreadPoolNames() const; + + FXL_WARN_UNUSED_RESULT + bool MarkIsolateRunnable(); + + // |Dart_IsolateCreateCallback| + static Dart_Isolate DartIsolateCreateCallback( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* embedder_isolate, + char** error); + + static std::pair /* embedder */> + CreateDartVMAndEmbedderObjectPair(const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* parent_embedder_isolate, + bool is_root_isolate, + char** error); + + // |Dart_IsolateShutdownCallback| + static void DartIsolateShutdownCallback(DartIsolate* embedder_isolate); + + // |Dart_IsolateCleanupCallback| + static void DartIsolateCleanupCallback(DartIsolate* embedder_isolate); + + FXL_DISALLOW_COPY_AND_ASSIGN(DartIsolate); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_ISOLATE_H_ diff --git a/runtime/dart_isolate_unittests.cc b/runtime/dart_isolate_unittests.cc new file mode 100644 index 0000000000000..d8f2e02382da1 --- /dev/null +++ b/runtime/dart_isolate_unittests.cc @@ -0,0 +1,103 @@ +// Copyright 2017 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/thread.h" +#include "flutter/runtime/dart_isolate.h" +#include "flutter/runtime/dart_vm.h" +#include "flutter/testing/testing.h" +#include "flutter/testing/thread_test.h" + +#define CURRENT_TEST_NAME \ + std::string { \ + ::testing::UnitTest::GetInstance()->current_test_info()->name() \ + } + +namespace blink { + +using DartIsolateTest = ::testing::ThreadTest; + +TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + TaskRunners task_runners(CURRENT_TEST_NAME, // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner() // + ); + auto root_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + std::move(task_runners), // task runners + nullptr, // window + {}, // resource context + nullptr // unref qeueue + ); + ASSERT_TRUE(root_isolate); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); + ASSERT_TRUE(root_isolate->Shutdown()); +} + +TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + TaskRunners task_runners(CURRENT_TEST_NAME, // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner() // + ); + auto root_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + std::move(task_runners), // task runners + nullptr, // window + {}, // resource context + nullptr // unref qeueue + ); + ASSERT_TRUE(root_isolate); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); + ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( + testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); + ASSERT_TRUE(root_isolate->Shutdown()); +} + +TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + TaskRunners task_runners(CURRENT_TEST_NAME, // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner() // + ); + auto root_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + std::move(task_runners), // task runners + nullptr, // window + {}, // resource context + nullptr // unref qeueue + ); + ASSERT_TRUE(root_isolate); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); + ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( + testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); + ASSERT_TRUE(root_isolate->Run("simple_main")); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Running); + ASSERT_TRUE(root_isolate->Shutdown()); +} + +} // namespace blink diff --git a/runtime/dart_service_isolate.h b/runtime/dart_service_isolate.h index 9edd663feb6bd..59a02e2e9d495 100644 --- a/runtime/dart_service_isolate.h +++ b/runtime/dart_service_isolate.h @@ -13,8 +13,6 @@ namespace blink { class DartServiceIsolate { public: - static bool Bootstrap(); - static bool Startup(std::string server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc new file mode 100644 index 0000000000000..5d759257d1d4b --- /dev/null +++ b/runtime/dart_snapshot.cc @@ -0,0 +1,159 @@ +// Copyright 2017 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/runtime/dart_snapshot.h" + +#include + +#include "flutter/fml/native_library.h" +#include "flutter/fml/paths.h" +#include "flutter/fml/trace_event.h" +#include "flutter/runtime/dart_snapshot_buffer.h" +#include "flutter/runtime/dart_vm.h" + +namespace blink { + +const char* DartSnapshot::kVMDataSymbol = "kDartVmSnapshotData"; +const char* DartSnapshot::kVMInstructionsSymbol = "kDartVmSnapshotInstructions"; +const char* DartSnapshot::kIsolateDataSymbol = "kDartIsolateSnapshotData"; +const char* DartSnapshot::kIsolateInstructionsSymbol = + "kDartIsolateSnapshotInstructions"; + +static std::unique_ptr ResolveVMData( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = fml::paths::JoinPaths( + {settings.aot_snapshot_path, settings.aot_vm_snapshot_data_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), false /* executable */)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kVMDataSymbol); +} + +static std::unique_ptr ResolveVMInstructions( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = fml::paths::JoinPaths( + {settings.aot_snapshot_path, settings.aot_vm_snapshot_instr_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), true /* executable */)) { + return source; + } + } + + if (settings.application_library_path.size() > 0) { + auto library = + fml::NativeLibrary::Create(settings.application_library_path.c_str()); + if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( + library, DartSnapshot::kVMInstructionsSymbol)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kVMInstructionsSymbol); +} + +static std::unique_ptr ResolveIsolateData( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = + fml::paths::JoinPaths({settings.aot_snapshot_path, + settings.aot_isolate_snapshot_data_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), false /* executable */)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kIsolateDataSymbol); +} + +static std::unique_ptr ResolveIsolateInstructions( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = + fml::paths::JoinPaths({settings.aot_snapshot_path, + settings.aot_isolate_snapshot_instr_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), true /* executable */)) { + return source; + } + } + + if (settings.application_library_path.size() > 0) { + auto library = + fml::NativeLibrary::Create(settings.application_library_path.c_str()); + if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( + library, DartSnapshot::kIsolateInstructionsSymbol)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kIsolateInstructionsSymbol); +} + +fxl::RefPtr DartSnapshot::VMSnapshotFromSettings( + const Settings& settings) { + TRACE_EVENT0("flutter", "DartSnapshot::VMSnapshotFromSettings"); + auto snapshot = + fxl::MakeRefCounted(ResolveVMData(settings), // + ResolveVMInstructions(settings) // + ); + if (snapshot->IsValid()) { + return snapshot; + } + return nullptr; +} + +fxl::RefPtr DartSnapshot::IsolateSnapshotFromSettings( + const Settings& settings) { + TRACE_EVENT0("flutter", "DartSnapshot::IsolateSnapshotFromSettings"); + auto snapshot = + fxl::MakeRefCounted(ResolveIsolateData(settings), // + ResolveIsolateInstructions(settings) // + ); + if (snapshot->IsValid()) { + return snapshot; + } + return nullptr; +} + +DartSnapshot::DartSnapshot(std::unique_ptr data, + std::unique_ptr instructions) + : data_(std::move(data)), instructions_(std::move(instructions)) {} + +DartSnapshot::~DartSnapshot() = default; + +bool DartSnapshot::IsValid() const { + return static_cast(data_); +} + +bool DartSnapshot::IsValidForAOT() const { + return data_ && instructions_; +} + +const DartSnapshotBuffer* DartSnapshot::GetData() const { + return data_.get(); +} + +const DartSnapshotBuffer* DartSnapshot::GetInstructions() const { + return instructions_.get(); +} + +const uint8_t* DartSnapshot::GetInstructionsIfPresent() const { + return instructions_ ? instructions_->GetSnapshotPointer() : nullptr; +} + +} // namespace blink diff --git a/runtime/dart_snapshot.h b/runtime/dart_snapshot.h new file mode 100644 index 0000000000000..4f04765b4f5a9 --- /dev/null +++ b/runtime/dart_snapshot.h @@ -0,0 +1,57 @@ +// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_H_ +#define FLUTTER_RUNTIME_DART_SNAPSHOT_H_ + +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/runtime/dart_snapshot_buffer.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" + +namespace blink { + +class DartSnapshot : public fxl::RefCountedThreadSafe { + public: + static const char* kVMDataSymbol; + static const char* kVMInstructionsSymbol; + static const char* kIsolateDataSymbol; + static const char* kIsolateInstructionsSymbol; + + static fxl::RefPtr VMSnapshotFromSettings( + const Settings& settings); + + static fxl::RefPtr IsolateSnapshotFromSettings( + const Settings& settings); + + bool IsValid() const; + + bool IsValidForAOT() const; + + const DartSnapshotBuffer* GetData() const; + + const DartSnapshotBuffer* GetInstructions() const; + + const uint8_t* GetInstructionsIfPresent() const; + + private: + std::unique_ptr data_; + std::unique_ptr instructions_; + + DartSnapshot(std::unique_ptr data, + std::unique_ptr instructions); + + ~DartSnapshot(); + + FRIEND_REF_COUNTED_THREAD_SAFE(DartSnapshot); + FRIEND_MAKE_REF_COUNTED(DartSnapshot); + FXL_DISALLOW_COPY_AND_ASSIGN(DartSnapshot); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_H_ diff --git a/runtime/dart_snapshot_buffer.cc b/runtime/dart_snapshot_buffer.cc new file mode 100644 index 0000000000000..c39233ac8334a --- /dev/null +++ b/runtime/dart_snapshot_buffer.cc @@ -0,0 +1,72 @@ +// Copyright 2017 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/runtime/dart_snapshot_buffer.h" + +#include + +#include "flutter/fml/mapping.h" + +namespace blink { + +class NativeLibrarySnapshotBuffer final : public DartSnapshotBuffer { + public: + NativeLibrarySnapshotBuffer(fxl::RefPtr library, + const char* symbol_name) + : library_(std::move(library)) { + if (library_) { + symbol_ = library_->ResolveSymbol(symbol_name); + } + } + + const uint8_t* GetSnapshotPointer() const override { return symbol_; } + + size_t GetSnapshotSize() const override { return 0; } + + private: + fxl::RefPtr library_; + const uint8_t* symbol_ = nullptr; + + FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrarySnapshotBuffer); +}; + +class FileSnapshotBuffer final : public DartSnapshotBuffer { + public: + FileSnapshotBuffer(const char* path, bool executable) + : mapping_(path, executable) { + if (mapping_.GetSize() > 0) { + symbol_ = mapping_.GetMapping(); + } + } + + const uint8_t* GetSnapshotPointer() const override { return symbol_; } + + size_t GetSnapshotSize() const override { return mapping_.GetSize(); } + + private: + fml::FileMapping mapping_; + const uint8_t* symbol_ = nullptr; + + FXL_DISALLOW_COPY_AND_ASSIGN(FileSnapshotBuffer); +}; + +std::unique_ptr +DartSnapshotBuffer::CreateWithSymbolInLibrary( + fxl::RefPtr library, + const char* symbol_name) { + auto source = std::make_unique( + std::move(library), symbol_name); + return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); +} + +std::unique_ptr +DartSnapshotBuffer::CreateWithContentsOfFile(const char* file_path, + bool executable) { + auto source = std::make_unique(file_path, executable); + return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); +} + +DartSnapshotBuffer::~DartSnapshotBuffer() = default; + +} // namespace blink diff --git a/runtime/dart_snapshot_buffer.h b/runtime/dart_snapshot_buffer.h new file mode 100644 index 0000000000000..675946c0ca63f --- /dev/null +++ b/runtime/dart_snapshot_buffer.h @@ -0,0 +1,34 @@ +// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_BUFFER_H_ +#define FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ + +#include + +#include "flutter/fml/native_library.h" +#include "lib/fxl/macros.h" + +namespace blink { + +class DartSnapshotBuffer { + public: + static std::unique_ptr CreateWithSymbolInLibrary( + fxl::RefPtr library, + const char* symbol_name); + + static std::unique_ptr CreateWithContentsOfFile( + const char* file_path, + bool executable); + + virtual ~DartSnapshotBuffer(); + + virtual const uint8_t* GetSnapshotPointer() const = 0; + + virtual size_t GetSnapshotSize() const = 0; +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc new file mode 100644 index 0000000000000..bb46779078583 --- /dev/null +++ b/runtime/dart_vm.cc @@ -0,0 +1,472 @@ +// Copyright 2017 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/runtime/dart_vm.h" + +#include + +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/fml/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/runtime/dart_isolate.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/runtime/start_up.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/files/file.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/time/time_delta.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_class_provider.h" +#include "lib/tonic/dart_sticky_error.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/typed_data/uint8_list.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace dart { +namespace observatory { + +#if !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) + +// These two symbols are defined in |observatory_archive.cc| which is generated +// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. +// Both of these symbols will be part of the data segment and therefore are read +// only. +extern unsigned int observatory_assets_archive_len; +extern const uint8_t* observatory_assets_archive; + +#endif // !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != + // FLUTTER_RUNTIME_MODE_RELEASE) + +} // namespace observatory +} // namespace dart + +namespace blink { + +// Arguments passed to the Dart VM in all configurations. +static const char* kDartLanguageArgs[] = { + "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", + "--causal_async_stacks", "--limit-ints-to-64-bits", +}; + +static const char* kDartPrecompilationArgs[] = { + "--precompilation", +}; + +FXL_ALLOW_UNUSED_TYPE +static const char* kDartWriteProtectCodeArgs[] = { + "--no_write_protect_code", +}; + +static const char* kDartAssertArgs[] = { + // clang-format off + "--enable_asserts", + // clang-format on +}; + +static const char* kDartCheckedModeArgs[] = { + // clang-format off + "--enable_type_checks", + "--error_on_bad_type", + "--error_on_bad_override", + // clang-format on +}; + +static const char* kDartStrongModeArgs[] = { + // clang-format off + "--strong", + "--reify_generic_functions", + "--limit_ints_to_64_bits", + "--sync_async", + // clang-format on +}; + +static const char* kDartStartPausedArgs[]{ + "--pause_isolates_on_start", +}; + +static const char* kDartTraceStartupArgs[]{ + "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", +}; + +static const char* kDartEndlessTraceBufferArgs[]{ + "--timeline_recorder=endless", +}; + +static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { + "--systrace_timeline", + "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", +}; + +constexpr char kFileUriPrefix[] = "file://"; +constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; + +bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { + if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { + // Assume modified. + return true; + } + + const char* path = source_url + kFileUriPrefixLength; + struct stat info; + if (stat(path, &info) < 0) + return true; + + // If st_mtime is zero, it's more likely that the file system doesn't support + // mtime than that the file was actually modified in the 1970s. + if (!info.st_mtime) + return true; + + // It's very unclear what time bases we're with here. The Dart API doesn't + // document the time base for since_ms. Reading the code, the value varies by + // platform, with a typical source being something like gettimeofday. + // + // We add one to st_mtime because st_mtime has less precision than since_ms + // and we want to treat the file as modified if the since time is between + // ticks of the mtime. + fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); + fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); + + return mtime > since; +} + +void ThreadExitCallback() {} + +Dart_Handle GetVMServiceAssetsArchiveCallback() { +#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) + return nullptr; +#elif OS(FUCHSIA) + std::vector observatory_assets_archive; + if (!files::ReadFileToVector("pkg/data/observatory.tar", + &observatory_assets_archive)) { + FXL_LOG(ERROR) << "Fail to load Observatory archive"; + return nullptr; + } + return tonic::DartConverter::ToDart( + observatory_assets_archive.data(), observatory_assets_archive.size()); +#else + return tonic::DartConverter::ToDart( + ::dart::observatory::observatory_assets_archive, + ::dart::observatory::observatory_assets_archive_len); +#endif +} + +static const char kStdoutStreamId[] = "Stdout"; +static const char kStderrStreamId[] = "Stderr"; + +static bool ServiceStreamListenCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(true); + return true; + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(true); + return true; + } + return false; +} + +static void ServiceStreamCancelCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(false); + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(false); + } +} + +bool DartVM::IsRunningPrecompiledCode() { + return Dart_IsPrecompiledRuntime(); +} + +static std::vector ProfilingFlags(bool enable_profiling) { +// Disable Dart's built in profiler when building a debug build. This +// works around a race condition that would sometimes stop a crash's +// stack trace from being printed on Android. +#ifndef NDEBUG + enable_profiling = false; +#endif + + // We want to disable profiling by default because it overwhelms LLDB. But + // the VM enables the same by default. In either case, we have some profiling + // flags. + if (enable_profiling) { + return {// This is the default. But just be explicit. + "--profiler", + // This instructs the profiler to walk C++ frames, and to include + // them in the profile. + "--profile-vm"}; + } else { + return {"--no-profiler"}; + } +} + +void PushBackAll(std::vector* args, + const char** argv, + size_t argc) { + for (size_t i = 0; i < argc; ++i) { + args->push_back(argv[i]); + } +} + +static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { + info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; + dart::bin::GetIOEmbedderInformation(info); + info->name = "Flutter"; +} + +fxl::RefPtr DartVM::ForProcess(Settings settings) { + return ForProcess(settings, nullptr, nullptr); +} + +static std::once_flag gVMInitialization; +static fxl::RefPtr gVM; + +fxl::RefPtr DartVM::ForProcess( + Settings settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot) { + std::call_once(gVMInitialization, [settings, // + vm_snapshot, // + isolate_snapshot // + ]() mutable { + if (!vm_snapshot) { + vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings); + } + if (!isolate_snapshot) { + isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings); + } + gVM = fxl::MakeRefCounted(settings, // + std::move(vm_snapshot), // + std::move(isolate_snapshot) // + ); + }); + return gVM; +} + +fxl::RefPtr DartVM::ForProcessIfInitialized() { + return gVM; +} + +DartVM::DartVM(const Settings& settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot) + : settings_(settings), + vm_snapshot_(std::move(vm_snapshot)), + isolate_snapshot_(std::move(isolate_snapshot)), + platform_kernel_mapping_( + std::make_unique(settings.kernel_snapshot_path)), + weak_factory_(this) { + TRACE_EVENT0("flutter", "DartVMInitializer"); + FXL_DLOG(INFO) << "Attempting Dart VM launch for mode: " + << (IsRunningPrecompiledCode() ? "AOT" : "Interpreter"); + + FXL_DCHECK(vm_snapshot_ && vm_snapshot_->IsValid()) + << "VM snapshot must be valid."; + + FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid()) + << "Isolate snapshot must be valid."; + + if (platform_kernel_mapping_->GetSize() > 0) { + // The platform kernel mapping lifetime is managed by this instance of the + // DartVM and hence will exceed that of the PlatformKernel. So provide an + // empty release callback. + Dart_ReleaseBufferCallback empty = [](auto arg) {}; + platform_kernel_ = reinterpret_cast(Dart_ReadKernelBinary( + platform_kernel_mapping_->GetMapping(), // buffer + platform_kernel_mapping_->GetSize(), // buffer size + empty // buffer deleter + )); + } + + { + TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); + dart::bin::BootstrapDartIo(); + + if (!settings.temp_directory_path.empty()) { + dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); + } + } + + std::vector args; + + // Instruct the VM to ignore unrecognized flags. + // There is a lot of diversity in a lot of combinations when it + // comes to the arguments the VM supports. And, if the VM comes across a flag + // it does not recognize, it exits immediately. + args.push_back("--ignore-unrecognized-flags"); + + for (const auto& profiler_flag : + ProfilingFlags(settings.enable_dart_profiling)) { + args.push_back(profiler_flag); + } + + PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); + + if (IsRunningPrecompiledCode()) { + PushBackAll(&args, kDartPrecompilationArgs, + arraysize(kDartPrecompilationArgs)); + } + + // Enable checked mode if we are not running precompiled code. We run non- + // precompiled code only in the debug product mode. + bool use_checked_mode = !settings.dart_non_checked_mode; + +#if !OS(FUCHSIA) + if (IsRunningPrecompiledCode()) { + use_checked_mode = false; + } +#endif // !OS(FUCHSIA) + +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + // Debug mode uses the JIT, disable code page write protection to avoid + // memory page protection changes before and after every compilation. + PushBackAll(&args, kDartWriteProtectCodeArgs, + arraysize(kDartWriteProtectCodeArgs)); +#endif + + const bool isolate_snapshot_is_dart_2 = + Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); + + const bool is_preview_dart2 = + platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; + + if (is_preview_dart2) { + FXL_DLOG(INFO) << "Dart 2 is enabled."; + } else { + FXL_DLOG(INFO) << "Dart 2 is NOT enabled. Platform kernel: " + << static_cast(platform_kernel_) + << " Isolate Snapshot is Dart 2: " + << isolate_snapshot_is_dart_2; + } + if (is_preview_dart2) { + PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); + if (use_checked_mode) { + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + } + } else if (use_checked_mode) { + FXL_DLOG(INFO) << "Checked mode is ON"; + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); + } else { + FXL_DLOG(INFO) << "Is not Dart 2 and Checked mode is OFF"; + } + + if (settings.start_paused) { + PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); + } + + if (settings.endless_trace_buffer || settings.trace_startup) { + // If we are tracing startup, make sure the trace buffer is endless so we + // don't lose early traces. + PushBackAll(&args, kDartEndlessTraceBufferArgs, + arraysize(kDartEndlessTraceBufferArgs)); + } + + if (settings.trace_startup) { + PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); + } + +#if defined(OS_FUCHSIA) + PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); +#endif + + for (size_t i = 0; i < settings.dart_flags.size(); i++) + args.push_back(settings.dart_flags[i].c_str()); + + FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); + + DartUI::InitForGlobal(); + + { + TRACE_EVENT0("flutter", "Dart_Initialize"); + Dart_InitializeParams params = {}; + params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; + params.vm_snapshot_data = vm_snapshot_->GetData()->GetSnapshotPointer(); + params.vm_snapshot_instructions = vm_snapshot_->GetInstructionsIfPresent(); + params.create = reinterpret_cast( + DartIsolate::DartIsolateCreateCallback); + params.shutdown = reinterpret_cast( + DartIsolate::DartIsolateShutdownCallback); + params.cleanup = reinterpret_cast( + DartIsolate::DartIsolateCleanupCallback); + params.thread_exit = ThreadExitCallback; + params.get_service_assets = GetVMServiceAssetsArchiveCallback; + params.entropy_source = DartIO::EntropySource; + char* init_error = Dart_Initialize(¶ms); + if (init_error) { + FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; + ::free(init_error); + } + // Send the earliest available timestamp in the application lifecycle to + // timeline. The difference between this timestamp and the time we render + // the very first frame gives us a good idea about Flutter's startup time. + // Use a duration event so about:tracing will consider this event when + // deciding the earliest event to use as time 0. + if (blink::engine_main_enter_ts != 0) { + Dart_TimelineEvent("FlutterEngineMainEnter", // label + blink::engine_main_enter_ts, // timestamp0 + blink::engine_main_enter_ts, // timestamp1_or_async_id + Dart_Timeline_Event_Duration, // event type + 0, // argument_count + nullptr, // argument_names + nullptr // argument_values + ); + } + } + + // Allow streaming of stdout and stderr by the Dart vm. + Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, + &ServiceStreamCancelCallback); + + Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); +} + +DartVM::~DartVM() { + if (Dart_CurrentIsolate() != nullptr) { + Dart_ExitIsolate(); + } + char* result = Dart_Cleanup(); + if (result != nullptr) { + FXL_LOG(ERROR) << "Could not cleanly shut down the Dart VM. Message: \"" + << result << "\"."; + free(result); + } +} + +const Settings& DartVM::GetSettings() const { + return settings_; +} + +DartVM::PlatformKernel* DartVM::GetPlatformKernel() const { + return platform_kernel_; +} + +const DartSnapshot& DartVM::GetVMSnapshot() const { + return *vm_snapshot_.get(); +} + +fxl::RefPtr DartVM::GetIsolateSnapshot() const { + return isolate_snapshot_; +} + +ServiceProtocol& DartVM::GetServiceProtocol() { + return service_protocol_; +} + +fxl::WeakPtr DartVM::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +} // namespace blink diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h new file mode 100644 index 0000000000000..e8feb9ba1de92 --- /dev/null +++ b/runtime/dart_vm.h @@ -0,0 +1,75 @@ +// Copyright 2017 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_RUNTIME_DART_VM_H_ +#define FLUTTER_RUNTIME_DART_VM_H_ + +#include +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/runtime/dart_isolate.h" +#include "flutter/runtime/dart_snapshot.h" +#include "flutter/runtime/service_protocol.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace blink { + +class DartVM : public fxl::RefCountedThreadSafe { + public: + class PlatformKernel; + + static fxl::RefPtr ForProcess(Settings settings); + + static fxl::RefPtr ForProcess( + Settings settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot); + + static fxl::RefPtr ForProcessIfInitialized(); + + static bool IsRunningPrecompiledCode(); + + const Settings& GetSettings() const; + + PlatformKernel* GetPlatformKernel() const; + + const DartSnapshot& GetVMSnapshot() const; + + fxl::RefPtr GetIsolateSnapshot() const; + + fxl::WeakPtr GetWeakPtr(); + + ServiceProtocol& GetServiceProtocol(); + + private: + const Settings settings_; + const fxl::RefPtr vm_snapshot_; + const fxl::RefPtr isolate_snapshot_; + std::unique_ptr platform_kernel_mapping_; + PlatformKernel* platform_kernel_ = nullptr; + ServiceProtocol service_protocol_; + fxl::WeakPtrFactory weak_factory_; + + DartVM(const Settings& settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot); + + ~DartVM(); + + FRIEND_REF_COUNTED_THREAD_SAFE(DartVM); + FRIEND_MAKE_REF_COUNTED(DartVM); + FXL_DISALLOW_COPY_AND_ASSIGN(DartVM); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_VM_H_ diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc new file mode 100644 index 0000000000000..5b2f5e6ee8299 --- /dev/null +++ b/runtime/dart_vm_unittests.cc @@ -0,0 +1,21 @@ +// Copyright 2017 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/runtime/dart_vm.h" +#include "gtest/gtest.h" + +namespace blink { + +TEST(DartVM, SimpleInitialization) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + ASSERT_EQ(vm, DartVM::ForProcess(settings)); + ASSERT_FALSE(DartVM::IsRunningPrecompiledCode()); + ASSERT_EQ(vm->GetPlatformKernel(), nullptr); +} + +} // namespace blink diff --git a/runtime/fixtures/simple_main.dart b/runtime/fixtures/simple_main.dart new file mode 100644 index 0000000000000..552dfbe344902 --- /dev/null +++ b/runtime/fixtures/simple_main.dart @@ -0,0 +1,7 @@ +// Copyright 2016 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. + +void simple_main() { + print("Hello"); +} diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 75796cd68697e..d3e138c937f60 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -4,192 +4,244 @@ #include "flutter/runtime/runtime_controller.h" +#include "flutter/fml/message_loop.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "lib/tonic/dart_message_handler.h" -using tonic::DartState; - namespace blink { -std::unique_ptr RuntimeController::Create( - RuntimeDelegate* client) { - return std::unique_ptr(new RuntimeController(client)); +RuntimeController::RuntimeController( + RuntimeDelegate& p_client, + const DartVM* p_vm, + TaskRunners p_task_runners, + fml::WeakPtr p_resource_context, + fxl::RefPtr p_unref_queue) + : RuntimeController(p_client, + p_vm, + std::move(p_task_runners), + std::move(p_resource_context), + std::move(p_unref_queue), + WindowData{/* default window data */}) {} + +RuntimeController::RuntimeController( + RuntimeDelegate& p_client, + const DartVM* p_vm, + TaskRunners p_task_runners, + fml::WeakPtr p_resource_context, + fxl::RefPtr p_unref_queue, + WindowData p_window_data) + : client_(p_client), + vm_(p_vm), + task_runners_(p_task_runners), + resource_context_(p_resource_context), + unref_queue_(p_unref_queue), + window_data_(std::move(p_window_data)), + root_isolate_( + DartIsolate::CreateRootIsolate(vm_, + vm_->GetIsolateSnapshot(), + task_runners_, + std::make_unique(this), + resource_context_, + unref_queue_)) { + root_isolate_->SetReturnCodeCallback([this](uint32_t code) { + root_isolate_return_code_ = {true, code}; + }); + if (auto window = GetWindowIfAvailable()) { + tonic::DartState::Scope scope(root_isolate_.get()); + window->DidCreateIsolate(); + if (!FlushRuntimeStateToIsolate()) { + FXL_DLOG(ERROR) << "Could not setup intial isolate state."; + } + } else { + FXL_DCHECK(false) << "RuntimeController created without window binding."; + } + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); +} + +RuntimeController::~RuntimeController() { + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + if (root_isolate_) { + root_isolate_->SetReturnCodeCallback(nullptr); + auto result = root_isolate_->Shutdown(); + if (!result) { + FXL_DLOG(ERROR) << "Could not shutdown the root isolate."; + } + root_isolate_ = {}; + } } -RuntimeController::RuntimeController(RuntimeDelegate* client) - : client_(client) {} - -RuntimeController::~RuntimeController() {} +std::unique_ptr RuntimeController::Clone() const { + return std::unique_ptr(new RuntimeController( + client_, // + vm_, // + task_runners_, // + resource_context_, // + unref_queue_, // + window_data_ // + )); +} -void RuntimeController::CreateDartController( - const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - int dirfd) { - FXL_DCHECK(!dart_controller_); +bool RuntimeController::FlushRuntimeStateToIsolate() { + return SetViewportMetrics(window_data_.viewport_metrics) && + SetLocale(window_data_.language_code, window_data_.country_code) && + SetSemanticsEnabled(window_data_.semantics_enabled); +} - dart_controller_.reset(new DartController()); - dart_controller_->CreateIsolateFor( - script_uri, isolate_snapshot_data, isolate_snapshot_instr, - std::make_unique(this, std::make_unique(this), - dirfd)); +bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { + window_data_.viewport_metrics = metrics; - UIDartState* dart_state = dart_controller_->dart_state(); - DartState::Scope scope(dart_state); - dart_state->window()->DidCreateIsolate(); - client_->DidCreateMainIsolate(dart_state->isolate()); + if (auto window = GetWindowIfAvailable()) { + window->UpdateWindowMetrics(metrics); + return true; + } + return false; +} - Window* window = GetWindow(); +bool RuntimeController::SetLocale(const std::string& language_code, + const std::string& country_code) { + window_data_.language_code = language_code; + window_data_.country_code = country_code; - window->UpdateLocale(language_code_, country_code_); + if (auto window = GetWindowIfAvailable()) { + window->UpdateLocale(window_data_.language_code, window_data_.country_code); + return true; + } - if (semantics_enabled_) - window->UpdateSemanticsEnabled(semantics_enabled_); + return false; } -void RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { - GetWindow()->UpdateWindowMetrics(metrics); -} +bool RuntimeController::SetUserSettingsData(const std::string& data) { + window_data_.user_settings_data = data; -void RuntimeController::SetLocale(const std::string& language_code, - const std::string& country_code) { - if (language_code_ == language_code && country_code_ == country_code) - return; + if (auto window = GetWindowIfAvailable()) { + window->UpdateUserSettingsData(window_data_.user_settings_data); + return true; + } - language_code_ = language_code; - country_code_ = country_code; - GetWindow()->UpdateLocale(language_code_, country_code_); + return false; } -void RuntimeController::SetUserSettingsData(const std::string& data) { - if (user_settings_data_ == data) - return; - user_settings_data_ = data; - GetWindow()->UpdateUserSettingsData(user_settings_data_); -} +bool RuntimeController::SetSemanticsEnabled(bool enabled) { + window_data_.semantics_enabled = enabled; + + if (auto window = GetWindowIfAvailable()) { + window->UpdateSemanticsEnabled(window_data_.semantics_enabled); + return true; + } -void RuntimeController::SetSemanticsEnabled(bool enabled) { - if (semantics_enabled_ == enabled) - return; - semantics_enabled_ = enabled; - GetWindow()->UpdateSemanticsEnabled(semantics_enabled_); + return false; } -void RuntimeController::BeginFrame(fxl::TimePoint frame_time) { - GetWindow()->BeginFrame(frame_time); +bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) { + if (auto window = GetWindowIfAvailable()) { + window->BeginFrame(frame_time); + return true; + } + return false; } -void RuntimeController::NotifyIdle(int64_t deadline) { - UIDartState* dart_state = dart_controller_->dart_state(); - if (!dart_state) { - return; +bool RuntimeController::NotifyIdle(int64_t deadline) { + if (!root_isolate_) { + return false; } - DartState::Scope scope(dart_state); + + tonic::DartState::Scope scope(root_isolate_.get()); Dart_NotifyIdle(deadline); + return true; } -void RuntimeController::DispatchPlatformMessage( +bool RuntimeController::DispatchPlatformMessage( fxl::RefPtr message) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", "mode", - "basic"); - GetWindow()->DispatchPlatformMessage(std::move(message)); + if (auto window = GetWindowIfAvailable()) { + TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", + "mode", "basic"); + window->DispatchPlatformMessage(std::move(message)); + return true; + } + return false; } -void RuntimeController::DispatchPointerDataPacket( +bool RuntimeController::DispatchPointerDataPacket( const PointerDataPacket& packet) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", - "mode", "basic"); - GetWindow()->DispatchPointerDataPacket(packet); + if (auto window = GetWindowIfAvailable()) { + TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", + "mode", "basic"); + window->DispatchPointerDataPacket(packet); + return true; + } + return false; } -void RuntimeController::DispatchSemanticsAction(int32_t id, +bool RuntimeController::DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args) { TRACE_EVENT1("flutter", "RuntimeController::DispatchSemanticsAction", "mode", "basic"); - GetWindow()->DispatchSemanticsAction(id, action, std::move(args)); + if (auto window = GetWindowIfAvailable()) { + window->DispatchSemanticsAction(id, action, std::move(args)); + return true; + } + return false; } -Window* RuntimeController::GetWindow() { - return dart_controller_->dart_state()->window(); +Window* RuntimeController::GetWindowIfAvailable() { + return root_isolate_ ? root_isolate_->window() : nullptr; } std::string RuntimeController::DefaultRouteName() { - return client_->DefaultRouteName(); + return client_.DefaultRouteName(); } void RuntimeController::ScheduleFrame() { - client_->ScheduleFrame(); + client_.ScheduleFrame(); } void RuntimeController::Render(Scene* scene) { - client_->Render(scene->takeLayerTree()); + client_.Render(scene->takeLayerTree()); } void RuntimeController::UpdateSemantics(SemanticsUpdate* update) { - if (semantics_enabled_) - client_->UpdateSemantics(update->takeNodes()); + if (window_data_.semantics_enabled) { + client_.UpdateSemantics(update->takeNodes()); + } } void RuntimeController::HandlePlatformMessage( fxl::RefPtr message) { - client_->HandlePlatformMessage(std::move(message)); -} - -void RuntimeController::DidCreateSecondaryIsolate(Dart_Isolate isolate) { - client_->DidCreateSecondaryIsolate(isolate); -} - -void RuntimeController::DidShutdownMainIsolate() { - client_->DidShutdownMainIsolate(); + client_.HandlePlatformMessage(std::move(message)); } Dart_Port RuntimeController::GetMainPort() { - if (!dart_controller_) { - return ILLEGAL_PORT; - } - if (!dart_controller_->dart_state()) { - return ILLEGAL_PORT; - } - return dart_controller_->dart_state()->main_port(); + return root_isolate_ ? root_isolate_->main_port() : ILLEGAL_PORT; } std::string RuntimeController::GetIsolateName() { - if (!dart_controller_) { - return ""; - } - if (!dart_controller_->dart_state()) { - return ""; - } - return dart_controller_->dart_state()->debug_name(); + return root_isolate_ ? root_isolate_->debug_name() : ""; } bool RuntimeController::HasLivePorts() { - if (!dart_controller_) { + if (!root_isolate_) { return false; } - UIDartState* dart_state = dart_controller_->dart_state(); - if (!dart_state) { - return false; - } - DartState::Scope scope(dart_state); + tonic::DartState::Scope scope(root_isolate_.get()); return Dart_HasLivePorts(); } tonic::DartErrorHandleType RuntimeController::GetLastError() { - if (!dart_controller_) { - return tonic::kNoError; - } - UIDartState* dart_state = dart_controller_->dart_state(); - if (!dart_state) { - return tonic::kNoError; - } - return dart_state->message_handler().isolate_last_error(); + return root_isolate_ ? root_isolate_->message_handler().isolate_last_error() + : tonic::kNoError; +} + +fml::WeakPtr RuntimeController::GetRootIsolate() { + return root_isolate_; +} + +std::pair RuntimeController::GetRootIsolateReturnCode() { + return root_isolate_return_code_; } } // namespace blink diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 628bc699395c0..326c517f31db2 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -7,71 +7,108 @@ #include +#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_vm.h" #include "lib/fxl/macros.h" namespace blink { -class DartController; -class DartLibraryProvider; class Scene; class RuntimeDelegate; class View; class Window; -class RuntimeController : public WindowClient, public IsolateClient { +class RuntimeController final : public WindowClient { public: - static std::unique_ptr Create(RuntimeDelegate* client); + RuntimeController(RuntimeDelegate& client, + const DartVM* vm, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue); + ~RuntimeController(); - void CreateDartController(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - int dirfd = -1); - DartController* dart_controller() const { return dart_controller_.get(); } + std::unique_ptr Clone() const; + + bool SetViewportMetrics(const ViewportMetrics& metrics); - void SetViewportMetrics(const ViewportMetrics& metrics); - void SetLocale(const std::string& language_code, + bool SetLocale(const std::string& language_code, const std::string& country_code); - void SetUserSettingsData(const std::string& data); - void SetSemanticsEnabled(bool enabled); - void BeginFrame(fxl::TimePoint frame_time); - void NotifyIdle(int64_t deadline); + bool SetUserSettingsData(const std::string& data); + + bool SetSemanticsEnabled(bool enabled); + + bool BeginFrame(fxl::TimePoint frame_time); + + bool NotifyIdle(int64_t deadline); - void DispatchPlatformMessage(fxl::RefPtr message); - void DispatchPointerDataPacket(const PointerDataPacket& packet); - void DispatchSemanticsAction(int32_t id, + bool DispatchPlatformMessage(fxl::RefPtr message); + + bool DispatchPointerDataPacket(const PointerDataPacket& packet); + + bool DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args); Dart_Port GetMainPort(); + std::string GetIsolateName(); + bool HasLivePorts(); + tonic::DartErrorHandleType GetLastError(); - private: - explicit RuntimeController(RuntimeDelegate* client); + fml::WeakPtr GetRootIsolate(); - Window* GetWindow(); + std::pair GetRootIsolateReturnCode(); + private: + struct WindowData { + ViewportMetrics viewport_metrics; + std::string language_code; + std::string country_code; + std::string user_settings_data = "{}"; + bool semantics_enabled = false; + }; + + RuntimeDelegate& client_; + const DartVM* vm_; + TaskRunners task_runners_; + fml::WeakPtr resource_context_; + fxl::RefPtr unref_queue_; + WindowData window_data_; + fml::WeakPtr root_isolate_; + std::pair root_isolate_return_code_ = {false, 0}; + + RuntimeController(RuntimeDelegate& client, + const DartVM* vm, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + WindowData data); + + Window* GetWindowIfAvailable(); + + bool FlushRuntimeStateToIsolate(); + + // |blink::WindowClient| std::string DefaultRouteName() override; + + // |blink::WindowClient| void ScheduleFrame() override; + + // |blink::WindowClient| void Render(Scene* scene) override; - void UpdateSemantics(SemanticsUpdate* update) override; - void HandlePlatformMessage(fxl::RefPtr message) override; - void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; - void DidShutdownMainIsolate() override; + // |blink::WindowClient| + void UpdateSemantics(SemanticsUpdate* update) override; - RuntimeDelegate* client_; - std::string language_code_; - std::string country_code_; - std::string user_settings_data_ = "{}"; - bool semantics_enabled_ = false; - std::unique_ptr dart_controller_; + // |blink::WindowClient| + void HandlePlatformMessage(fxl::RefPtr message) override; FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeController); }; diff --git a/runtime/runtime_delegate.cc b/runtime/runtime_delegate.cc index 6ec55c4c2e6a0..902672be06d8f 100644 --- a/runtime/runtime_delegate.cc +++ b/runtime/runtime_delegate.cc @@ -6,12 +6,6 @@ namespace blink { -RuntimeDelegate::~RuntimeDelegate() {} - -void RuntimeDelegate::DidCreateMainIsolate(Dart_Isolate isolate) {} - -void RuntimeDelegate::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} - -void RuntimeDelegate::DidShutdownMainIsolate() {} +RuntimeDelegate::~RuntimeDelegate() = default; } // namespace blink diff --git a/runtime/runtime_delegate.h b/runtime/runtime_delegate.h index 36650fe7fb70b..c6d6c0a92b2b4 100644 --- a/runtime/runtime_delegate.h +++ b/runtime/runtime_delegate.h @@ -18,14 +18,14 @@ namespace blink { class RuntimeDelegate { public: virtual std::string DefaultRouteName() = 0; + virtual void ScheduleFrame(bool regenerate_layer_tree = true) = 0; + virtual void Render(std::unique_ptr layer_tree) = 0; + virtual void UpdateSemantics(blink::SemanticsNodeUpdates update) = 0; - virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; - virtual void DidCreateMainIsolate(Dart_Isolate isolate); - virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate); - virtual void DidShutdownMainIsolate(); + virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; protected: virtual ~RuntimeDelegate(); diff --git a/runtime/runtime_init.cc b/runtime/runtime_init.cc deleted file mode 100644 index eda66e5495aed..0000000000000 --- a/runtime/runtime_init.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/runtime/runtime_init.h" - -#include "flutter/glue/trace_event.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/platform_impl.h" -#include "flutter/sky/engine/public/web/Sky.h" -#include "lib/fxl/logging.h" - -namespace blink { -namespace { - -PlatformImpl* g_platform_impl = nullptr; - -} // namespace - -void InitRuntime(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path) { - TRACE_EVENT0("flutter", "InitRuntime"); - - FXL_CHECK(!g_platform_impl); - g_platform_impl = new PlatformImpl(); - InitEngine(g_platform_impl); - InitDartVM(vm_snapshot_data, vm_snapshot_instructions, - default_isolate_snapshot_data, - default_isolate_snapshot_instructions, bundle_path); -} - -} // namespace blink diff --git a/runtime/runtime_init.h b/runtime/runtime_init.h deleted file mode 100644 index 515ae284e3460..0000000000000 --- a/runtime/runtime_init.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_RUNTIME_RUNTIME_INIT_H_ -#define FLUTTER_RUNTIME_RUNTIME_INIT_H_ - -#include -#include - -namespace blink { - -void InitRuntime(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path); - -} // namespace blink - -#endif // FLUTTER_RUNTIME_RUNTIME_INIT_H_ diff --git a/runtime/service_protocol.cc b/runtime/service_protocol.cc new file mode 100644 index 0000000000000..030901e54269d --- /dev/null +++ b/runtime/service_protocol.cc @@ -0,0 +1,279 @@ +// Copyright 2017 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 RAPIDJSON_HAS_STDSTRING 1 + +#include "flutter/runtime/service_protocol.h" + +#include + +#include +#include +#include +#include + +#include "lib/fxl/synchronization/waitable_event.h" +#include "rapidjson/stringbuffer.h" +#include "rapidjson/writer.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace blink { + +const fxl::StringView ServiceProtocol::kScreenshotExtensionName = + "_flutter.screenshot"; +const fxl::StringView ServiceProtocol::kScreenshotSkpExtensionName = + "_flutter.screenshotSkp"; +const fxl::StringView ServiceProtocol::kRunInViewExtensionName = + "_flutter.runInView"; +const fxl::StringView ServiceProtocol::kFlushUIThreadTasksExtensionName = + "_flutter.flushUIThreadTasks"; +const fxl::StringView ServiceProtocol::kSetAssetBundlePathExtensionName = + "_flutter.setAssetBundlePath"; + +static constexpr fxl::StringView kViewIdPrefx = "_flutterView/"; +static constexpr fxl::StringView kListViewsExtensionName = "_flutter.listViews"; + +ServiceProtocol::ServiceProtocol() + : endpoints_({ + // Private + kListViewsExtensionName, + + // Public + kScreenshotExtensionName, + kScreenshotSkpExtensionName, + kRunInViewExtensionName, + kFlushUIThreadTasksExtensionName, + kSetAssetBundlePathExtensionName, + }) {} + +ServiceProtocol::~ServiceProtocol() { + ToggleHooks(false); +} + +void ServiceProtocol::AddHandler(Handler* handler) { + std::lock_guard lock(handlers_mutex_); + handlers_.emplace(handler); +} + +void ServiceProtocol::RemoveHandler(Handler* handler) { + std::lock_guard lock(handlers_mutex_); + handlers_.erase(handler); +} + +void ServiceProtocol::ToggleHooks(bool set) { + for (const auto& endpoint : endpoints_) { + Dart_RegisterRootServiceRequestCallback( + endpoint.data(), // method + &ServiceProtocol::HandleMessage, // callback + set ? this : nullptr // user data + ); + } +} + +static void WriteServerErrorResponse(rapidjson::Document& document, + const char* message) { + document.SetObject(); + document.AddMember("code", -32000, document.GetAllocator()); + rapidjson::Value message_value; + message_value.SetString(message, document.GetAllocator()); + document.AddMember("message", message_value, document.GetAllocator()); +} + +bool ServiceProtocol::HandleMessage(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + Handler::ServiceProtocolMap params; + for (intptr_t i = 0; i < num_params; i++) { + params[fxl::StringView{param_keys[i]}] = fxl::StringView{param_values[i]}; + } + +#ifndef NDEBUG + FXL_DLOG(INFO) << "Service protcol method: " << method; + FXL_DLOG(INFO) << "Arguments: " << params.size(); + for (intptr_t i = 0; i < num_params; i++) { + FXL_DLOG(INFO) << " " << i + 1 << ": " << param_keys[i] << " = " + << param_values[i]; + } +#endif // NDEBUG + + rapidjson::Document document; + bool result = HandleMessage(fxl::StringView{method}, // + params, // + static_cast(user_data), // + document // + ); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + *json_object = strdup(buffer.GetString()); + +#ifndef NDEBUG + FXL_DLOG(INFO) << "Response: " << *json_object; + FXL_DLOG(INFO) << "RPC Result: " << result; +#endif // NDEBUG + + return result; +} + +bool ServiceProtocol::HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + ServiceProtocol* service_protocol, + rapidjson::Document& response) { + if (service_protocol == nullptr) { + WriteServerErrorResponse(response, "Service protocol unavailable."); + return false; + } + + return service_protocol->HandleMessage(method, params, response); +} + +FXL_WARN_UNUSED_RESULT +static bool HandleMessageOnHandler( + ServiceProtocol::Handler* handler, + fxl::StringView method, + const ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& document) { + FXL_DCHECK(handler); + fxl::AutoResetWaitableEvent latch; + bool result = false; + fml::TaskRunner::RunNowOrPostTask( + handler->GetServiceProtocolHandlerTaskRunner(method), + [&latch, // + &result, // + &handler, // + &method, // + ¶ms, // + &document // + ]() { + result = + handler->HandleServiceProtocolMessage(method, params, document); + latch.Signal(); + }); + latch.Wait(); + return result; +} + +bool ServiceProtocol::HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + rapidjson::Document& response) const { + if (method == kListViewsExtensionName) { + // So far, this is the only built-in method that does not forward to the + // dynamic set of handlers. + return HandleListViewsMethod(response); + } + + std::lock_guard lock(handlers_mutex_); + + if (handlers_.size() == 0) { + WriteServerErrorResponse(response, + "There are no running service protocol handlers."); + return false; + } + + // Find the handler by its "viewId" in the params. + auto view_id_param_found = params.find(fxl::StringView{"viewId"}); + if (view_id_param_found != params.end()) { + auto handler = reinterpret_cast(std::stoull( + view_id_param_found->second.data() + kViewIdPrefx.size(), nullptr, 16)); + auto handler_found = handlers_.find(handler); + if (handler_found != handlers_.end()) { + return HandleMessageOnHandler(handler, method, params, response); + } + } + + // Handle legacy calls that do not specify a handler in their args. + // TODO(chinmaygarde): Deprecate these calls in the tools and remove these + // fallbacks. + if (method == kScreenshotExtensionName || + method == kScreenshotSkpExtensionName) { + return HandleMessageOnHandler(*handlers_.begin(), method, params, response); + } + + WriteServerErrorResponse( + response, + "Service protocol could not handle or find a handler for the " + "requested method."); + return false; +} + +static std::string CreateFlutterViewID(intptr_t handler) { + std::stringstream stream; + stream << kViewIdPrefx << "0x" << std::hex << handler; + return stream.str(); +} + +static std::string CreateIsolateID(int64_t isolate) { + std::stringstream stream; + stream << "isolates/" << isolate; + return stream.str(); +} + +void ServiceProtocol::Handler::Description::Write( + Handler* handler, + rapidjson::Value& view, + rapidjson::MemoryPoolAllocator<>& allocator) const { + view.SetObject(); + view.AddMember("type", "FlutterView", allocator); + view.AddMember("id", CreateFlutterViewID(reinterpret_cast(handler)), + allocator); + if (isolate_port != 0) { + rapidjson::Value isolate(rapidjson::Type::kObjectType); + { + isolate.AddMember("type", "@Isolate", allocator); + isolate.AddMember("fixedId", true, allocator); + isolate.AddMember("id", CreateIsolateID(isolate_port), allocator); + isolate.AddMember("name", isolate_name, allocator); + isolate.AddMember("number", isolate_port, allocator); + } + view.AddMember("isolate", isolate, allocator); + } +} + +bool ServiceProtocol::HandleListViewsMethod( + rapidjson::Document& response) const { + // Collect handler descriptions on their respective task runners. + std::lock_guard lock(handlers_mutex_); + std::vector> descriptions; + for (const auto& handler : handlers_) { + fxl::AutoResetWaitableEvent latch; + Handler::Description description; + + fml::TaskRunner::RunNowOrPostTask( + handler->GetServiceProtocolHandlerTaskRunner( + kListViewsExtensionName), // task runner + [&latch, // + &description, // + &handler // + ]() { + description = handler->GetServiceProtocolDescription(); + latch.Signal(); + }); + latch.Wait(); + descriptions.emplace_back(std::make_pair( + reinterpret_cast(handler), std::move(description))); + } + + auto& allocator = response.GetAllocator(); + + // Construct the response objects. + response.SetObject(); + response.AddMember("type", "FlutterViewList", allocator); + + rapidjson::Value viewsList(rapidjson::Type::kArrayType); + for (const auto& description : descriptions) { + rapidjson::Value view(rapidjson::Type::kObjectType); + description.second.Write(reinterpret_cast(description.first), + view, allocator); + viewsList.PushBack(view, allocator); + } + + response.AddMember("views", viewsList, allocator); + + return true; +} + +} // namespace blink diff --git a/runtime/service_protocol.h b/runtime/service_protocol.h new file mode 100644 index 0000000000000..056f7389ea79a --- /dev/null +++ b/runtime/service_protocol.h @@ -0,0 +1,99 @@ +// Copyright 2017 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_RUNTIME_SERVICE_PROTOCOL_H_ +#define FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ + +#include +#include +#include +#include + +#include "flutter/fml/task_runner.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/strings/string_view.h" +#include "lib/fxl/synchronization/thread_annotations.h" +#include "third_party/rapidjson/rapidjson/document.h" + +namespace blink { + +class ServiceProtocol { + public: + static const fxl::StringView kScreenshotExtensionName; + static const fxl::StringView kScreenshotSkpExtensionName; + static const fxl::StringView kRunInViewExtensionName; + static const fxl::StringView kFlushUIThreadTasksExtensionName; + static const fxl::StringView kSetAssetBundlePathExtensionName; + + class Handler { + public: + struct Description { + int64_t isolate_port = 0 /* illegal port by default. */; + std::string isolate_name; + + Description() {} + + Description(int64_t p_isolate_port, std::string p_isolate_name) + : isolate_port(p_isolate_port), + isolate_name(std::move(p_isolate_name)) {} + + void Write(Handler* handler, + rapidjson::Value& value, + rapidjson::MemoryPoolAllocator<>& allocator) const; + }; + + using ServiceProtocolMap = std::map; + + virtual fxl::RefPtr GetServiceProtocolHandlerTaskRunner( + fxl::StringView method) const = 0; + + virtual Description GetServiceProtocolDescription() const = 0; + + virtual bool HandleServiceProtocolMessage( + fxl::StringView method, // one if the extension names specified above. + const ServiceProtocolMap& params, + rapidjson::Document& response) = 0; + }; + + ServiceProtocol(); + + ~ServiceProtocol(); + + void ToggleHooks(bool set); + + void AddHandler(Handler* handler); + + void RemoveHandler(Handler* handler); + + private: + const std::set endpoints_; + mutable std::mutex handlers_mutex_; + std::set handlers_; + + FXL_WARN_UNUSED_RESULT + static bool HandleMessage(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + FXL_WARN_UNUSED_RESULT + static bool HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + ServiceProtocol* service_protocol, + rapidjson::Document& response); + FXL_WARN_UNUSED_RESULT + bool HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + rapidjson::Document& response) const; + + FXL_WARN_UNUSED_RESULT + bool HandleListViewsMethod(rapidjson::Document& response) const; + + FXL_DISALLOW_COPY_AND_ASSIGN(ServiceProtocol); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index f9e25a3c8d6d7..25edcfa23bd85 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("$flutter_root/testing/testing.gni") + # Template to generate a dart embedder resource.cc file. # Required invoker inputs: # String output (name of output file) @@ -61,18 +63,18 @@ source_set("common") { "animator.h", "engine.cc", "engine.h", - "null_platform_view.cc", - "null_platform_view.h", - "null_rasterizer.cc", - "null_rasterizer.h", + "io_manager.cc", + "io_manager.h", + "isolate_configuration.cc", + "isolate_configuration.h", "picture_serializer.cc", "picture_serializer.h", "platform_view.cc", "platform_view.h", - "platform_view_service_protocol.cc", - "platform_view_service_protocol.h", "rasterizer.cc", "rasterizer.h", + "run_configuration.cc", + "run_configuration.h", "shell.cc", "shell.h", "skia_event_tracer_impl.cc", @@ -81,8 +83,8 @@ source_set("common") { "surface.h", "switches.cc", "switches.h", - "tracing_controller.cc", - "tracing_controller.h", + "thread_host.cc", + "thread_host.h", "vsync_waiter.cc", "vsync_waiter.h", "vsync_waiter_fallback.cc", @@ -90,8 +92,6 @@ source_set("common") { ] deps = [ - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/platform:libdart_platform", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", @@ -99,10 +99,13 @@ source_set("common") { "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", + "$flutter_root/sky/engine/platform", "$flutter_root/sky/engine/wtf", "$flutter_root/synchronization", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/platform:libdart_platform", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", @@ -112,7 +115,23 @@ source_set("common") { "//topaz/lib/tonic", ] - public_configs = [ - "$flutter_root:config", + public_configs = [ "$flutter_root:config" ] +} + +executable("shell_unittests") { + testonly = true + + sources = [ + "shell_unittests.cc", + ] + deps = [ + ":common", + "$flutter_root/fml", + "$flutter_root/lib/snapshot", + "$flutter_root/testing", + "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", + "//third_party/skia", + "//topaz/lib/tonic", ] } diff --git a/shell/common/animator.cc b/shell/common/animator.cc index d5679a0160a86..60177a18f89ab 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -4,19 +4,18 @@ #include "flutter/shell/common/animator.h" -#include "flutter/common/threads.h" -#include "flutter/fml/trace_event.h" +#include "flutter/glue/trace_event.h" #include "lib/fxl/time/stopwatch.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -Animator::Animator(fml::WeakPtr rasterizer, - VsyncWaiter* waiter, - Engine* engine) - : rasterizer_(rasterizer), - waiter_(waiter), - engine_(engine), +Animator::Animator(Delegate& delegate, + blink::TaskRunners task_runners, + std::unique_ptr waiter) + : delegate_(delegate), + task_runners_(std::move(task_runners)), + waiter_(std::move(waiter)), last_begin_frame_time_(), dart_frame_deadline_(0), layer_tree_pipeline_(fxl::MakeRefCounted(2)), @@ -79,7 +78,6 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, // If we still don't have valid continuation, the pipeline is currently // full because the consumer is being too slow. Try again at the next // frame interval. - TRACE_EVENT_INSTANT0("flutter", "ConsumerSlowDefer"); RequestFrame(); return; } @@ -94,13 +92,13 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, { TRACE_EVENT2("flutter", "Framework Workload", "mode", "basic", "frame", FrameParity()); - engine_->BeginFrame(last_begin_frame_time_); + delegate_.OnAnimatorBeginFrame(*this, last_begin_frame_time_); } if (!frame_scheduled_) { // We don't have another frame pending, so we're waiting on user input // or I/O. Allow the Dart VM 100 ms. - engine_->NotifyIdle(dart_frame_deadline_ + 100000); + delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_ + 100000); } } @@ -120,15 +118,7 @@ void Animator::Render(std::unique_ptr layer_tree) { // Commit the pending continuation. producer_continuation_.Complete(std::move(layer_tree)); - blink::Threads::Gpu()->PostTask([ - rasterizer = rasterizer_, pipeline = layer_tree_pipeline_, - frame_id = FrameParity() - ]() { - if (!rasterizer.get()) - return; - TRACE_EVENT2("flutter", "GPU Workload", "mode", "basic", "frame", frame_id); - rasterizer->Draw(pipeline); - }); + delegate_.OnAnimatorDraw(*this, layer_tree_pipeline_); } bool Animator::CanReuseLastLayerTree() { @@ -137,10 +127,7 @@ bool Animator::CanReuseLastLayerTree() { void Animator::DrawLastLayerTree() { pending_frame_semaphore_.Signal(); - blink::Threads::Gpu()->PostTask([rasterizer = rasterizer_]() { - if (rasterizer.get()) - rasterizer->DrawLastLayerTree(); - }); + delegate_.OnAnimatorDrawLastLayerTree(*this); } void Animator::RequestFrame(bool regenerate_layer_tree) { @@ -164,31 +151,31 @@ void Animator::RequestFrame(bool regenerate_layer_tree) { // started an expensive operation right after posting this message however. // To support that, we need edge triggered wakes on VSync. - blink::Threads::UI()->PostTask( - [ self = weak_factory_.GetWeakPtr(), frame_number = frame_number_ ]() { - if (!self.get()) { - return; - } - TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", - frame_number); - self->AwaitVSync(); - }); + task_runners_.GetUITaskRunner()->PostTask([self = weak_factory_.GetWeakPtr(), + frame_number = frame_number_]() { + if (!self.get()) { + return; + } + TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", frame_number); + self->AwaitVSync(); + }); frame_scheduled_ = true; } void Animator::AwaitVSync() { - waiter_->AsyncWaitForVsync([self = weak_factory_.GetWeakPtr()]( - fxl::TimePoint frame_start_time, fxl::TimePoint frame_target_time) { - if (self) { - if (self->CanReuseLastLayerTree()) { - self->DrawLastLayerTree(); - } else { - self->BeginFrame(frame_start_time, frame_target_time); - } - } - }); + waiter_->AsyncWaitForVsync( + [self = weak_factory_.GetWeakPtr()](fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { + if (self) { + if (self->CanReuseLastLayerTree()) { + self->DrawLastLayerTree(); + } else { + self->BeginFrame(frame_start_time, frame_target_time); + } + } + }); - engine_->NotifyIdle(dart_frame_deadline_); + delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_); } } // namespace shell diff --git a/shell/common/animator.h b/shell/common/animator.h index bc2ee21441b29..53b2ac6884158 100644 --- a/shell/common/animator.h +++ b/shell/common/animator.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_SHELL_COMMON_ANIMATOR_H_ #define FLUTTER_SHELL_COMMON_ANIMATOR_H_ -#include "flutter/shell/common/engine.h" +#include "flutter/common/task_runners.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/vsync_waiter.h" #include "flutter/synchronization/pipeline.h" @@ -16,17 +16,28 @@ namespace shell { -class Animator { +class Animator final { public: - Animator(fml::WeakPtr rasterizer, - VsyncWaiter* waiter, - Engine* engine); + class Delegate { + public: + virtual void OnAnimatorBeginFrame(const Animator& animator, + fxl::TimePoint frame_time) = 0; - ~Animator(); + virtual void OnAnimatorNotifyIdle(const Animator& animator, + int64_t deadline) = 0; + + virtual void OnAnimatorDraw( + const Animator& animator, + fxl::RefPtr> pipeline) = 0; + + virtual void OnAnimatorDrawLastLayerTree(const Animator& animator) = 0; + }; - void set_rasterizer(fml::WeakPtr rasterizer) { - rasterizer_ = rasterizer; - } + Animator(Delegate& delegate, + blink::TaskRunners task_runners, + std::unique_ptr waiter); + + ~Animator(); void RequestFrame(bool regenerate_layer_tree = true); @@ -51,9 +62,9 @@ class Animator { const char* FrameParity(); - fml::WeakPtr rasterizer_; - VsyncWaiter* waiter_; - Engine* engine_; + Delegate& delegate_; + blink::TaskRunners task_runners_; + std::unique_ptr waiter_; fxl::TimePoint last_begin_frame_time_; int64_t dart_frame_deadline_; @@ -67,7 +78,7 @@ class Animator { bool dimension_change_pending_; SkISize last_layer_tree_size_; - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(Animator); }; diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 3629b729c29f7..3d6fd496d3fa9 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -4,47 +4,20 @@ #include "flutter/shell/common/engine.h" -#if OS(WIN) -#include -#include -#define access _access -#define R_OK 0x4 - -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) -#endif - -#else -#include -#include -#include -#endif // OS(WIN) - -#include -#include #include #include -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/unzipper_provider.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/assets/asset_provider.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/runtime/asset_font_selector.h" -#include "flutter/runtime/dart_controller.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/runtime_init.h" +#include "flutter/runtime/platform_impl.h" #include "flutter/runtime/test_font_selector.h" #include "flutter/shell/common/animator.h" #include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" #include "flutter/sky/engine/public/web/Sky.h" #include "lib/fxl/files/eintr_wrapper.h" #include "lib/fxl/files/file.h" @@ -55,380 +28,208 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" -namespace shell { -namespace { - -constexpr char kAssetChannel[] = "flutter/assets"; -constexpr char kLifecycleChannel[] = "flutter/lifecycle"; -constexpr char kNavigationChannel[] = "flutter/navigation"; -constexpr char kLocalizationChannel[] = "flutter/localization"; -constexpr char kSettingsChannel[] = "flutter/settings"; - -#if OS(WIN) -void FindAndReplaceInPlace(std::string& str, - const std::string& findStr, - const std::string& replaceStr) { - size_t pos = 0; - while ((pos = str.find(findStr, pos)) != std::string::npos) { - str.replace(pos, findStr.length(), replaceStr); - pos += replaceStr.length(); - } -} -#endif - -std::string SanitizePath(const std::string& path) { -#if OS(WIN) - std::string sanitized = path; - FindAndReplaceInPlace(sanitized, "\\\\", "/"); - if ((sanitized.length() > 2) && (sanitized[1] == ':')) { - // Path begins with a drive letter. - sanitized = '/' + sanitized; - } - return sanitized; -#else - return path; +#ifdef ERROR +#undef ERROR #endif -} - -bool PathExists(const std::string& path) { - return access(path.c_str(), R_OK) == 0; -} - -std::string FindPackagesPath(const std::string& main_dart) { - std::string directory = files::GetDirectoryName(main_dart); - std::string packages_path = directory + "/.packages"; - if (!PathExists(packages_path)) { - directory = files::GetDirectoryName(directory); - packages_path = directory + "/.packages"; - if (!PathExists(packages_path)) - packages_path = std::string(); - } - return packages_path; -} -std::string GetScriptUriFromPath(const std::string& path) { - return "file://" + SanitizePath(path); -} - -} // namespace +namespace shell { -Engine::Engine(PlatformView* platform_view) - : platform_view_(platform_view->GetWeakPtr()), - animator_(std::make_unique( - platform_view->rasterizer().GetWeakRasterizerPtr(), - platform_view->GetVsyncWaiter(), - this)), +static constexpr char kAssetChannel[] = "flutter/assets"; +static constexpr char kLifecycleChannel[] = "flutter/lifecycle"; +static constexpr char kNavigationChannel[] = "flutter/navigation"; +static constexpr char kLocalizationChannel[] = "flutter/localization"; +static constexpr char kSettingsChannel[] = "flutter/settings"; + +Engine::Engine(Delegate& delegate, + const blink::DartVM& vm, + blink::TaskRunners task_runners, + blink::Settings settings, + std::unique_ptr animator, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue) + : delegate_(delegate), + settings_(std::move(settings)), + animator_(std::move(animator)), + legacy_sky_platform_(settings_.using_blink ? new blink::PlatformImpl() + : nullptr), load_script_error_(tonic::kNoError), - user_settings_data_("{}"), activity_running_(false), have_surface_(false), - weak_factory_(this) {} + weak_factory_(this) { + weak_prototype_ = weak_factory_.GetWeakPtr(); -Engine::~Engine() {} + if (legacy_sky_platform_) { + // TODO: Remove this legacy call along with the platform. This is what makes + // the engine unable to run from multiple threads in the legacy + // configuration. + blink::InitEngine(legacy_sky_platform_.get()); + } -void Engine::set_rasterizer(fml::WeakPtr rasterizer) { - animator_->set_rasterizer(rasterizer); + // Runtime controller is initialized here because it takes a reference to this + // object as its delegate. The delegate may be called in the constructor and + // we want to be fully initilazed by that point. + runtime_controller_ = std::make_unique( + *this, // runtime delegate + &vm, // VM + std::move(task_runners), // task runners + std::move(resource_context), // resource context + std::move(unref_queue) // skia unref queue + ); } -fml::WeakPtr Engine::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); +Engine::~Engine() { + if (legacy_sky_platform_) { + blink::ShutdownEngine(/* legacy_sky_platform_ */); + } } -#if !FLUTTER_AOT -#elif OS(IOS) -#elif OS(ANDROID) -// TODO(bkonyi): do we even get here for Windows? -static const uint8_t* MemMapSnapshot(const std::string& aot_snapshot_path, - const std::string& default_file_name, - const std::string& settings_file_name, - bool executable) { - std::string asset_path; - if (settings_file_name.empty()) { - asset_path = aot_snapshot_path + "/" + default_file_name; - } else { - asset_path = aot_snapshot_path + "/" + settings_file_name; +fml::WeakPtr Engine::GetWeakPtr() const { + return weak_prototype_; +} + +bool Engine::UpdateAssetManager( + fxl::RefPtr new_asset_manager) { + if (asset_manager_ == new_asset_manager) { + return false; } -#if OS(WIN) - HANDLE file_handle_ = - CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, - FILE_SHARE_READ, nullptr, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); + asset_manager_ = new_asset_manager; - if (file_handle_ == INVALID_HANDLE_VALUE) { - return; + if (!asset_manager_) { + return false; } - size_ = GetFileSize(file_handle_, nullptr); - if (size_ == INVALID_FILE_SIZE) { - size_ = 0; - return; + if (settings_.using_blink) { + // Using blink as the text engine. + blink::FontFallbackList::SetUseTestFonts(settings_.use_test_fonts); + } else { + // Using libTXT as the text engine. + if (settings_.use_test_fonts) { + blink::FontCollection::ForProcess().RegisterTestFonts(); + } else { + blink::FontCollection::ForProcess().RegisterFonts(*asset_manager_.get()); + } } - int mapping_flags = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; - mapping_handle_ = CreateFileMapping(file_handle_, nullptr, mapping_flags, 0, - size_, nullptr); - - CloseHandle(file_handle_); + return true; +} - if (mapping_handle_ == INVALID_HANDLE_VALUE) { - return; +bool Engine::Restart(RunConfiguration configuration) { + TRACE_EVENT0("flutter", "Engine::Restart"); + if (!configuration.IsValid()) { + FXL_LOG(ERROR) << "Engine run configuration was invalid."; + return false; } + runtime_controller_ = runtime_controller_->Clone(); + UpdateAssetManager(nullptr); + return Run(std::move(configuration)); +} - int access_flags = FILE_MAP_READ; - if (executable) { - access_flags |= FILE_MAP_EXECUTE; +bool Engine::Run(RunConfiguration configuration) { + if (!configuration.IsValid()) { + FXL_LOG(ERROR) << "Engine run configuration was invalid."; + return false; } - auto mapping = MapViewOfFile(mapping_handle_, access_flags, 0, 0, size_); - if (mapping == INVALID_HANDLE_VALUE) { - CloseHandle(mapping_handle_); - mapping_handle_ = INVALID_HANDLE_VALUE; - return; + if (!PrepareAndLaunchIsolate(std::move(configuration))) { + return false; } - void* symbol = static_cast(mapping); - if (symbol == NULL) { - return nullptr; - } -#else - struct stat info; - if (stat(asset_path.c_str(), &info) < 0) { - return nullptr; - } - int64_t asset_size = info.st_size; + auto isolate = runtime_controller_->GetRootIsolate(); - fxl::UniqueFD fd(HANDLE_EINTR(open(asset_path.c_str(), O_RDONLY))); - if (fd.get() == -1) { - return nullptr; - } + bool isolate_running = + isolate && isolate->GetPhase() == blink::DartIsolate::Phase::Running; - int mmap_flags = PROT_READ; - if (executable) - mmap_flags |= PROT_EXEC; + if (isolate_running) { + tonic::DartState::Scope scope(isolate.get()); - void* symbol = mmap(NULL, asset_size, mmap_flags, MAP_PRIVATE, fd.get(), 0); - if (symbol == MAP_FAILED) { - return nullptr; - } -#endif - return reinterpret_cast(symbol); -} -#endif + if (settings_.root_isolate_create_callback) { + settings_.root_isolate_create_callback(); + } -static const uint8_t* default_isolate_snapshot_data = nullptr; -static const uint8_t* default_isolate_snapshot_instr = nullptr; - -void Engine::Init(const std::string& bundle_path) { - const uint8_t* vm_snapshot_data; - const uint8_t* vm_snapshot_instr; -#if !FLUTTER_AOT - vm_snapshot_data = ::kDartVmSnapshotData; - vm_snapshot_instr = ::kDartVmSnapshotInstructions; - default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; - default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; -#elif OS(IOS) - const char* kDartApplicationLibraryPath = "App.framework/App"; - const char* application_library_path = kDartApplicationLibraryPath; - const blink::Settings& settings = blink::Settings::Get(); - const std::string& application_library_path_setting = - settings.application_library_path; - if (!application_library_path_setting.empty()) { - application_library_path = application_library_path_setting.c_str(); - } - dlerror(); // clear previous errors on thread - void* library_handle = dlopen(application_library_path, RTLD_NOW); - const char* err = dlerror(); - if (err != nullptr) { - FXL_LOG(FATAL) << "dlopen failed: " << err; - } - vm_snapshot_data = reinterpret_cast( - dlsym(library_handle, "kDartVmSnapshotData")); - vm_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "kDartVmSnapshotInstructions")); - default_isolate_snapshot_data = reinterpret_cast( - dlsym(library_handle, "kDartIsolateSnapshotData")); - default_isolate_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "kDartIsolateSnapshotInstructions")); -#elif OS(ANDROID) || OS(WIN) - const blink::Settings& settings = blink::Settings::Get(); - const std::string& aot_shared_library_path = settings.aot_shared_library_path; - const std::string& aot_snapshot_path = settings.aot_snapshot_path; - - if (!aot_shared_library_path.empty()) { - FXL_CHECK(aot_snapshot_path.empty()); - dlerror(); // clear previous errors on thread - void* library_handle = dlopen(aot_shared_library_path.c_str(), RTLD_NOW); - const char* err = dlerror(); - if (err != nullptr) { - FXL_LOG(FATAL) << "dlopen failed: " << err; + if (settings_.root_isolate_shutdown_callback) { + isolate->AddIsolateShutdownCallback( + settings_.root_isolate_shutdown_callback); + } + + // Blink uses a per isolate font selector. + if (settings_.using_blink) { + if (settings_.use_test_fonts) { + blink::TestFontSelector::Install(); + } else { + blink::AssetFontSelector::Install(asset_manager_); + } } - vm_snapshot_data = reinterpret_cast( - dlsym(library_handle, "_kDartVmSnapshotData")); - vm_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "_kDartVmSnapshotInstructions")); - default_isolate_snapshot_data = reinterpret_cast( - dlsym(library_handle, "_kDartIsolateSnapshotData")); - default_isolate_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "_kDartIsolateSnapshotInstructions")); - } else { - FXL_CHECK(!aot_snapshot_path.empty()); - vm_snapshot_data = - MemMapSnapshot(aot_snapshot_path, "vm_snapshot_data", - settings.aot_vm_snapshot_data_filename, false); - vm_snapshot_instr = - MemMapSnapshot(aot_snapshot_path, "vm_snapshot_instr", - settings.aot_vm_snapshot_instr_filename, true); - default_isolate_snapshot_data = - MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_data", - settings.aot_isolate_snapshot_data_filename, false); - default_isolate_snapshot_instr = - MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_instr", - settings.aot_isolate_snapshot_instr_filename, true); } -#else -#error Unknown OS -#endif - blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, - default_isolate_snapshot_data, - default_isolate_snapshot_instr, bundle_path); + + return isolate_running; } -const std::string Engine::main_entrypoint_ = "main"; +bool Engine::PrepareAndLaunchIsolate(RunConfiguration configuration) { + TRACE_EVENT0("flutter", "Engine::PrepareAndLaunchIsolate"); -void Engine::RunBundle(const std::string& bundle_path, - const std::string& entrypoint, - bool reuse_runtime_controller) { - TRACE_EVENT0("flutter", "Engine::RunBundle"); - ConfigureAssetBundle(bundle_path); - DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, - reuse_runtime_controller); -} + UpdateAssetManager(configuration.GetAssetManager()); -void Engine::DoRunBundle(const std::string& script_uri, - const std::string& entrypoint, - bool reuse_runtime_controller) { - ConfigureRuntime(script_uri, reuse_runtime_controller); - if (blink::IsRunningPrecompiledCode()) { - runtime_->dart_controller()->RunFromPrecompiledSnapshot(entrypoint); - } else { - std::vector kernel; - if (GetAssetAsBuffer(blink::kKernelAssetKey, &kernel)) { - runtime_->dart_controller()->RunFromKernel(kernel, entrypoint); - return; - } - std::vector snapshot; - if (!GetAssetAsBuffer(blink::kSnapshotAssetKey, &snapshot)) - return; - runtime_->dart_controller()->RunFromScriptSnapshot( - snapshot.data(), snapshot.size(), entrypoint); + auto isolate_configuration = configuration.TakeIsolateConfiguration(); + + auto isolate = runtime_controller_->GetRootIsolate(); + + if (!isolate_configuration->PrepareIsolate(isolate)) { + FXL_DLOG(ERROR) << "Could not prepare to run the isolate."; + return false; } -} -// TODO(jsimmons): merge this with RunBundle -void Engine::RunBundleWithAssets( - fxl::RefPtr asset_provider, - const std::string& bundle_path, - const std::string& entrypoint, - bool reuse_runtime_controller) { - TRACE_EVENT0("flutter", "Engine::RunBundleWithAssets"); - asset_provider_ = asset_provider; - DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, - reuse_runtime_controller); -} - -void Engine::RunBundleAndSource(const std::string& bundle_path, - const std::string& main, - const std::string& packages, - bool reuse_runtime_controller) { - TRACE_EVENT0("flutter", "Engine::RunBundleAndSource"); - FXL_CHECK(!blink::IsRunningPrecompiledCode()) - << "Cannot run from source in a precompiled build."; - std::string packages_path = packages; - if (packages_path.empty()) - packages_path = FindPackagesPath(main); - - if (!bundle_path.empty()) - ConfigureAssetBundle(bundle_path); - - ConfigureRuntime(main, reuse_runtime_controller); - - if (blink::GetKernelPlatformBinary() != nullptr) { - std::vector kernel; - if (!files::ReadFileToVector(main, &kernel)) { - load_script_error_ = tonic::kUnknownErrorType; - } - load_script_error_ = runtime_->dart_controller()->RunFromKernel(kernel); - } else { - load_script_error_ = - runtime_->dart_controller()->RunFromSource(main, packages_path); + if (!isolate->Run(configuration.GetEntrypoint())) { + FXL_DLOG(ERROR) << "Could not run the isolate."; + return false; } + + return true; } void Engine::BeginFrame(fxl::TimePoint frame_time) { TRACE_EVENT0("flutter", "Engine::BeginFrame"); - if (runtime_) - runtime_->BeginFrame(frame_time); + runtime_controller_->BeginFrame(frame_time); } void Engine::NotifyIdle(int64_t deadline) { TRACE_EVENT0("flutter", "Engine::NotifyIdle"); - if (runtime_) - runtime_->NotifyIdle(deadline); -} - -void Engine::RunFromSource(const std::string& main, - const std::string& packages, - const std::string& bundle_path) { - RunBundleAndSource(bundle_path, main, packages); + runtime_controller_->NotifyIdle(deadline); } -void Engine::SetAssetBundlePath(const std::string& bundle_path) { - TRACE_EVENT0("flutter", "Engine::SetAssetBundlePath"); - ConfigureAssetBundle(bundle_path); +std::pair Engine::GetUIIsolateReturnCode() { + return runtime_controller_->GetRootIsolateReturnCode(); } Dart_Port Engine::GetUIIsolateMainPort() { - if (!runtime_) - return ILLEGAL_PORT; - return runtime_->GetMainPort(); + return runtime_controller_->GetMainPort(); } std::string Engine::GetUIIsolateName() { - if (!runtime_) { - return ""; - } - return runtime_->GetIsolateName(); + return runtime_controller_->GetIsolateName(); } bool Engine::UIIsolateHasLivePorts() { - if (!runtime_) - return false; - return runtime_->HasLivePorts(); + return runtime_controller_->HasLivePorts(); } tonic::DartErrorHandleType Engine::GetUIIsolateLastError() { - if (!runtime_) - return tonic::kNoError; - return runtime_->GetLastError(); + return runtime_controller_->GetLastError(); } tonic::DartErrorHandleType Engine::GetLoadScriptError() { return load_script_error_; } -void Engine::OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation) { - blink::Threads::Gpu()->PostTask(gpu_continuation); +void Engine::OnOutputSurfaceCreated() { have_surface_ = true; StartAnimatorIfPossible(); - if (runtime_) - ScheduleFrame(); + ScheduleFrame(); } -void Engine::OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation) { +void Engine::OnOutputSurfaceDestroyed() { have_surface_ = false; StopAnimator(); - blink::Threads::Gpu()->PostTask(gpu_continuation); } void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { @@ -436,8 +237,7 @@ void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { viewport_metrics_.physical_height != metrics.physical_height || viewport_metrics_.physical_width != metrics.physical_width; viewport_metrics_ = metrics; - if (runtime_) - runtime_->SetViewportMetrics(viewport_metrics_); + runtime_controller_->SetViewportMetrics(viewport_metrics_); if (animator_) { if (dimensions_changed) animator_->SetDimensionChangePending(); @@ -459,8 +259,7 @@ void Engine::DispatchPlatformMessage( return; } - if (runtime_) { - runtime_->DispatchPlatformMessage(std::move(message)); + if (runtime_controller_->DispatchPlatformMessage(std::move(message))) { return; } @@ -493,7 +292,6 @@ bool Engine::HandleLifecyclePlatformMessage(blink::PlatformMessage* message) { bool Engine::HandleNavigationPlatformMessage( fxl::RefPtr message) { - FXL_DCHECK(!runtime_); const auto& data = message->data(); rapidjson::Document document; @@ -532,99 +330,33 @@ bool Engine::HandleLocalizationPlatformMessage( if (!language.IsString() || !country.IsString()) return false; - language_code_ = language.GetString(); - country_code_ = country.GetString(); - if (runtime_) - runtime_->SetLocale(language_code_, country_code_); - return true; + return runtime_controller_->SetLocale(language.GetString(), + country.GetString()); } void Engine::HandleSettingsPlatformMessage(blink::PlatformMessage* message) { const auto& data = message->data(); std::string jsonData(reinterpret_cast(data.data()), data.size()); - user_settings_data_ = jsonData; - if (runtime_) { - runtime_->SetUserSettingsData(user_settings_data_); - if (have_surface_) - ScheduleFrame(); + if (runtime_controller_->SetUserSettingsData(std::move(jsonData)) && + have_surface_) { + ScheduleFrame(); } } -void Engine::DispatchPointerDataPacket(const PointerDataPacket& packet) { - if (runtime_) - runtime_->DispatchPointerDataPacket(packet); +void Engine::DispatchPointerDataPacket(const blink::PointerDataPacket& packet) { + runtime_controller_->DispatchPointerDataPacket(packet); } void Engine::DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args) { - if (runtime_) - runtime_->DispatchSemanticsAction(id, action, std::move(args)); + runtime_controller_->DispatchSemanticsAction(id, action, std::move(args)); } void Engine::SetSemanticsEnabled(bool enabled) { - semantics_enabled_ = enabled; - if (runtime_) - runtime_->SetSemanticsEnabled(semantics_enabled_); -} - -void Engine::ConfigureAssetBundle(const std::string& path) { - asset_provider_ = fxl::MakeRefCounted(path); - - struct stat stat_result = {}; - - // TODO(abarth): We should reset directory_asset_bundle_, but that might break - // custom font loading in hot reload. - - if (::stat(path.c_str(), &stat_result) != 0) { - FXL_LOG(INFO) << "Could not configure asset bundle at path: " << path; - return; - } - - std::string flx_path; - if (S_ISDIR(stat_result.st_mode)) { - flx_path = files::GetDirectoryName(path) + "/app.flx"; - } else if (S_ISREG(stat_result.st_mode)) { - flx_path = path; - } - - if (PathExists(flx_path)) { - asset_store_ = fxl::MakeRefCounted( - blink::GetUnzipperProviderForPath(flx_path)); - } -} - -void Engine::ConfigureRuntime(const std::string& script_uri, - bool reuse_runtime_controller) { - if (runtime_ && reuse_runtime_controller) { - return; - } - runtime_ = blink::RuntimeController::Create(this); - runtime_->CreateDartController(std::move(script_uri), - default_isolate_snapshot_data, - default_isolate_snapshot_instr); - runtime_->SetViewportMetrics(viewport_metrics_); - runtime_->SetLocale(language_code_, country_code_); - runtime_->SetUserSettingsData(user_settings_data_); - runtime_->SetSemanticsEnabled(semantics_enabled_); -} - -void Engine::DidCreateMainIsolate(Dart_Isolate isolate) { - if (blink::Settings::Get().use_test_fonts) { - blink::TestFontSelector::Install(); - if (!blink::Settings::Get().using_blink) - blink::FontCollection::ForProcess().RegisterTestFonts(); - } else if (asset_provider_) { - blink::AssetFontSelector::Install(asset_provider_); - if (!blink::Settings::Get().using_blink) { - blink::FontCollection::ForProcess().RegisterFontsFromAssetProvider( - asset_provider_); - } - } + runtime_controller_->SetSemanticsEnabled(enabled); } -void Engine::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} - void Engine::StopAnimator() { animator_->Stop(); } @@ -659,49 +391,34 @@ void Engine::Render(std::unique_ptr layer_tree) { } void Engine::UpdateSemantics(blink::SemanticsNodeUpdates update) { - blink::Threads::Platform()->PostTask(fxl::MakeCopyable([ - platform_view = platform_view_.lock(), update = std::move(update) - ]() mutable { - if (platform_view) - platform_view->UpdateSemantics(std::move(update)); - })); + delegate_.OnEngineUpdateSemantics(*this, std::move(update)); } void Engine::HandlePlatformMessage( fxl::RefPtr message) { if (message->channel() == kAssetChannel) { HandleAssetPlatformMessage(std::move(message)); - return; + } else { + delegate_.OnEngineHandlePlatformMessage(*this, std::move(message)); } - blink::Threads::Platform()->PostTask([ - platform_view = platform_view_.lock(), message = std::move(message) - ]() mutable { - if (platform_view) - platform_view->HandlePlatformMessage(std::move(message)); - }); } void Engine::HandleAssetPlatformMessage( fxl::RefPtr message) { fxl::RefPtr response = message->response(); - if (!response) + if (!response) { return; + } const auto& data = message->data(); std::string asset_name(reinterpret_cast(data.data()), data.size()); + std::vector asset_data; - if (GetAssetAsBuffer(asset_name, &asset_data)) { + if (asset_manager_ && asset_manager_->GetAsBuffer(asset_name, &asset_data)) { response->Complete(std::move(asset_data)); } else { response->CompleteEmpty(); } } -bool Engine::GetAssetAsBuffer(const std::string& name, - std::vector* data) { - return ((asset_provider_ && - asset_provider_->GetAsBuffer(name, data)) || - (asset_store_ && asset_store_->GetAsBuffer(name, data))); -} - } // namespace shell diff --git a/shell/common/engine.h b/shell/common/engine.h index a0c5183338a43..ede442ee3e8a4 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -5,131 +5,144 @@ #ifndef SHELL_COMMON_ENGINE_H_ #define SHELL_COMMON_ENGINE_H_ -#include "flutter/assets/zip_asset_store.h" -#include "flutter/assets/asset_provider.h" +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "flutter/common/task_runners.h" +#include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/runtime/dart_vm.h" +#include "flutter/runtime/platform_impl.h" #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" +#include "flutter/shell/common/animator.h" #include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/run_configuration.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkPicture.h" -namespace blink { -class DirectoryAssetBundle; -class ZipAssetBundle; -} // namespace blink - namespace shell { -class PlatformView; -class Animator; -using PointerDataPacket = blink::PointerDataPacket; -class Engine : public blink::RuntimeDelegate { +class Engine final : public blink::RuntimeDelegate { public: - explicit Engine(PlatformView* platform_view); + class Delegate { + public: + virtual void OnEngineUpdateSemantics( + const Engine& engine, + blink::SemanticsNodeUpdates update) = 0; + + virtual void OnEngineHandlePlatformMessage( + const Engine& engine, + fxl::RefPtr message) = 0; + }; + + Engine(Delegate& delegate, + const blink::DartVM& vm, + blink::TaskRunners task_runners, + blink::Settings settings, + std::unique_ptr animator, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue); ~Engine() override; - fml::WeakPtr GetWeakPtr(); - - static void Init(const std::string& bundle_path); + fml::WeakPtr GetWeakPtr() const; - void RunBundle(const std::string& bundle_path, - const std::string& entrypoint = main_entrypoint_, - bool reuse_runtime_controller = false); + FXL_WARN_UNUSED_RESULT + bool Run(RunConfiguration configuration); - // Uses the given provider to locate assets. - void RunBundleWithAssets(fxl::RefPtr asset_provider, - const std::string& bundle_path, - const std::string& entrypoint = main_entrypoint_, - bool reuse_runtime_controller = false); + // Used to "cold reload" a running application where the shell (along with the + // platform view and its rasterizer bindings) remains the same but the root + // isolate is torn down and restarted with the new configuration. Only used in + // the development workflow. + FXL_WARN_UNUSED_RESULT + bool Restart(RunConfiguration configuration); - // Uses the given source code instead of looking inside the bundle for the - // source code. - void RunBundleAndSource(const std::string& bundle_path, - const std::string& main, - const std::string& packages, - bool reuse_runtime_controller = false); + bool UpdateAssetManager(fxl::RefPtr asset_manager); void BeginFrame(fxl::TimePoint frame_time); - void NotifyIdle(int64_t deadline); - void RunFromSource(const std::string& main, - const std::string& packages, - const std::string& bundle); - void SetAssetBundlePath(const std::string& bundle_path); + void NotifyIdle(int64_t deadline); Dart_Port GetUIIsolateMainPort(); + std::string GetUIIsolateName(); + bool UIIsolateHasLivePorts(); + tonic::DartErrorHandleType GetUIIsolateLastError(); + tonic::DartErrorHandleType GetLoadScriptError(); - void OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation); - void OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation); + std::pair GetUIIsolateReturnCode(); + + void OnOutputSurfaceCreated(); + + void OnOutputSurfaceDestroyed(); + void SetViewportMetrics(const blink::ViewportMetrics& metrics); + void DispatchPlatformMessage(fxl::RefPtr message); - void DispatchPointerDataPacket(const PointerDataPacket& packet); + + void DispatchPointerDataPacket(const blink::PointerDataPacket& packet); + void DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args); + void SetSemanticsEnabled(bool enabled); - void ScheduleFrame(bool regenerate_layer_tree = true) override; - void set_rasterizer(fml::WeakPtr rasterizer); + void ScheduleFrame(bool regenerate_layer_tree = true) override; private: - // RuntimeDelegate methods: + Engine::Delegate& delegate_; + const blink::Settings settings_; + std::unique_ptr animator_; + std::unique_ptr runtime_controller_; + std::unique_ptr legacy_sky_platform_; + tonic::DartErrorHandleType load_script_error_; + std::string initial_route_; + blink::ViewportMetrics viewport_metrics_; + fxl::RefPtr asset_manager_; + bool activity_running_; + bool have_surface_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + // |blink::RuntimeDelegate| std::string DefaultRouteName() override; + + // |blink::RuntimeDelegate| void Render(std::unique_ptr layer_tree) override; + + // |blink::RuntimeDelegate| void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + // |blink::RuntimeDelegate| void HandlePlatformMessage( fxl::RefPtr message) override; - void DidCreateMainIsolate(Dart_Isolate isolate) override; - void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; void StopAnimator(); - void StartAnimatorIfPossible(); - - void DoRunBundle(const std::string& script_uri, - const std::string& entrypoint, - bool reuse_runtime_controller); - void ConfigureAssetBundle(const std::string& path); - void ConfigureRuntime(const std::string& script_uri, - bool reuse_runtime_controller = false); + void StartAnimatorIfPossible(); bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message); + bool HandleNavigationPlatformMessage( fxl::RefPtr message); + bool HandleLocalizationPlatformMessage(blink::PlatformMessage* message); + void HandleSettingsPlatformMessage(blink::PlatformMessage* message); void HandleAssetPlatformMessage(fxl::RefPtr message); - bool GetAssetAsBuffer(const std::string& name, std::vector* data); - static const std::string main_entrypoint_; + bool GetAssetAsBuffer(const std::string& name, std::vector* data); - fxl::RefPtr asset_provider_; - std::weak_ptr platform_view_; - std::unique_ptr animator_; - std::unique_ptr runtime_; - tonic::DartErrorHandleType load_script_error_; - std::string initial_route_; - blink::ViewportMetrics viewport_metrics_; - std::string language_code_; - std::string country_code_; - std::string user_settings_data_; - bool semantics_enabled_ = false; - // TODO(zarah): Remove usage of asset_store_ once app.flx is removed. - fxl::RefPtr asset_store_; - fxl::RefPtr directory_asset_bundle_; - // TODO(eseidel): This should move into an AnimatorStateMachine. - bool activity_running_; - bool have_surface_; - fml::WeakPtrFactory weak_factory_; + bool PrepareAndLaunchIsolate(RunConfiguration configuration); FXL_DISALLOW_COPY_AND_ASSIGN(Engine); }; diff --git a/shell/common/io_manager.cc b/shell/common/io_manager.cc new file mode 100644 index 0000000000000..4161422978fcf --- /dev/null +++ b/shell/common/io_manager.cc @@ -0,0 +1,73 @@ +// Copyright 2017 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/shell/common/io_manager.h" + +#include "flutter/fml/message_loop.h" +#include "third_party/skia/include/gpu/gl/GrGLInterface.h" + +namespace shell { + +sk_sp IOManager::CreateCompatibleResourceLoadingContext( + GrBackend backend) { + if (backend != GrBackend::kOpenGL_GrBackend) { + return nullptr; + } + + GrContextOptions options = {}; + + // There is currently a bug with doing GPU YUV to RGB conversions on the IO + // thread. The necessary work isn't being flushed or synchronized with the + // other threads correctly, so the textures end up blank. For now, suppress + // that feature, which will cause texture uploads to do CPU YUV conversion. + options.fDisableGpuYUVConversion = true; + + if (auto context = GrContext::MakeGL(GrGLMakeNativeInterface(), options)) { + // Do not cache textures created by the image decoder. These textures + // should be deleted when they are no longer referenced by an SkImage. + context->setResourceCacheLimits(0, 0); + return context; + } + + return nullptr; +} + +IOManager::IOManager(sk_sp resource_context, + fxl::RefPtr unref_queue_task_runner) + : resource_context_(std::move(resource_context)), + resource_context_weak_factory_( + resource_context_ ? std::make_unique>( + resource_context_.get()) + : nullptr), + unref_queue_(fxl::MakeRefCounted( + std::move(unref_queue_task_runner), + fxl::TimeDelta::FromMilliseconds(250))), + weak_factory_(this) { + if (!resource_context_) { + FXL_DLOG(WARNING) << "The IO manager was initialized without a resource " + "context. Async texture uploads will be disabled. " + "Expect performance degradation."; + } + + if (resource_context_weak_factory_) { + resource_context_weak_prototype_ = + resource_context_weak_factory_->GetWeakPtr(); + } +} + +IOManager::~IOManager() { + // Last chance to drain the IO queue as the platform side reference to the + // underlying OpenGL context may be going away. + unref_queue_->Drain(); +} + +fml::WeakPtr IOManager::GetResourceContext() const { + return resource_context_weak_prototype_; +} + +fxl::RefPtr IOManager::GetSkiaUnrefQueue() const { + return unref_queue_; +} + +} // namespace shell diff --git a/shell/common/io_manager.h b/shell/common/io_manager.h new file mode 100644 index 0000000000000..1077a28d0ae36 --- /dev/null +++ b/shell/common/io_manager.h @@ -0,0 +1,52 @@ +// Copyright 2017 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_SHELL_COMMON_IO_MANAGER_H_ +#define FLUTTER_SHELL_COMMON_IO_MANAGER_H_ + +#include + +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/fml/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "third_party/skia/include/gpu/GrContext.h" + +namespace shell { + +class IOManager { + public: + // Convenience methods for platforms to create a GrContext used to supply to + // the IOManager. The platforms may create the context themselves if they so + // desire. + static sk_sp CreateCompatibleResourceLoadingContext( + GrBackend backend); + + IOManager(sk_sp resource_context, + fxl::RefPtr unref_queue_task_runner); + + ~IOManager(); + + fml::WeakPtr GetResourceContext() const; + + fxl::RefPtr GetSkiaUnrefQueue() const; + + private: + // Resource context management. + sk_sp resource_context_; + fml::WeakPtr resource_context_weak_prototype_; + std::unique_ptr> + resource_context_weak_factory_; + + // Unref queue management. + fxl::RefPtr unref_queue_; + + fml::WeakPtrFactory weak_factory_; + + FXL_DISALLOW_COPY_AND_ASSIGN(IOManager); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_IO_MANAGER_H_ diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc new file mode 100644 index 0000000000000..0706ee5ab58df --- /dev/null +++ b/shell/common/isolate_configuration.cc @@ -0,0 +1,144 @@ +// Copyright 2018 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/shell/common/isolate_configuration.h" + +#include "flutter/runtime/dart_vm.h" + +namespace shell { + +IsolateConfiguration::IsolateConfiguration() = default; + +IsolateConfiguration::~IsolateConfiguration() = default; + +bool IsolateConfiguration::PrepareIsolate( + fml::WeakPtr isolate) { + if (!isolate) { + return false; + } + + if (isolate->GetPhase() != blink::DartIsolate::Phase::LibrariesSetup) { + FXL_DLOG(ERROR) + << "Isolate was in incorrect phase to be prepared for running."; + return false; + } + + return DoPrepareIsolate(*isolate); +} + +class PrecompiledIsolateConfiguration final : public IsolateConfiguration { + public: + PrecompiledIsolateConfiguration() = default; + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (!blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + return isolate.PrepareForRunningFromPrecompiledCode(); + } + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(PrecompiledIsolateConfiguration); +}; + +class SnapshotIsolateConfiguration : public IsolateConfiguration { + public: + SnapshotIsolateConfiguration(std::unique_ptr snapshot) + : snapshot_(std::move(snapshot)) {} + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + return isolate.PrepareForRunningFromSnapshot(std::move(snapshot_)); + } + + private: + std::unique_ptr snapshot_; + + FXL_DISALLOW_COPY_AND_ASSIGN(SnapshotIsolateConfiguration); +}; + +class SourceIsolateConfiguration final : public IsolateConfiguration { + public: + SourceIsolateConfiguration(std::string main_path, std::string packages_path) + : main_path_(std::move(main_path)), + packages_path_(std::move(packages_path)) {} + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + return isolate.PrepareForRunningFromSource(std::move(main_path_), + std::move(packages_path_)); + } + + private: + std::string main_path_; + std::string packages_path_; + + FXL_DISALLOW_COPY_AND_ASSIGN(SourceIsolateConfiguration); +}; + +std::unique_ptr IsolateConfiguration::InferFromSettings( + const blink::Settings& settings, + fxl::RefPtr asset_manager) { + // Running in AOT mode. + if (blink::DartVM::IsRunningPrecompiledCode()) { + return CreateForPrecompiledCode(); + } + + // Run from sources. + { + const auto& main = settings.main_dart_file_path; + const auto& packages = settings.packages_file_path; + if (main.size() != 0 && packages.size() != 0) { + return CreateForSource(std::move(main), std::move(packages)); + } + } + + // Running from kernel snapshot. + { + std::vector kernel; + if (asset_manager && asset_manager->GetAsBuffer( + settings.application_kernel_asset, &kernel)) { + return CreateForSnapshot( + std::make_unique(std::move(kernel))); + } + } + + // Running from script snapshot. + { + std::vector script_snapshot; + if (asset_manager && asset_manager->GetAsBuffer( + settings.script_snapshot_path, &script_snapshot)) { + return CreateForSnapshot( + std::make_unique(std::move(script_snapshot))); + } + } + + return nullptr; +} + +std::unique_ptr +IsolateConfiguration::CreateForPrecompiledCode() { + return std::make_unique(); +} + +std::unique_ptr IsolateConfiguration::CreateForSnapshot( + std::unique_ptr snapshot) { + return std::make_unique(std::move(snapshot)); +} + +std::unique_ptr IsolateConfiguration::CreateForSource( + std::string main_path, + std::string packages_path) { + return std::make_unique(std::move(main_path), + std::move(packages_path)); +} + +} // namespace shell diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h new file mode 100644 index 0000000000000..82d06dac621b2 --- /dev/null +++ b/shell/common/isolate_configuration.h @@ -0,0 +1,51 @@ +// Copyright 2018 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_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ +#define FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ + +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "flutter/assets/asset_resolver.h" +#include "flutter/common/settings.h" +#include "flutter/fml/mapping.h" +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/runtime/dart_isolate.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class IsolateConfiguration { + public: + static std::unique_ptr InferFromSettings( + const blink::Settings& settings, + fxl::RefPtr asset_manager); + + static std::unique_ptr CreateForPrecompiledCode(); + + static std::unique_ptr CreateForSnapshot( + std::unique_ptr snapshot); + + static std::unique_ptr CreateForSource( + std::string main_path, + std::string packages_path); + + IsolateConfiguration(); + + virtual ~IsolateConfiguration(); + + bool PrepareIsolate(fml::WeakPtr isolate); + + protected: + virtual bool DoPrepareIsolate(blink::DartIsolate& isolate) = 0; + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfiguration); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ diff --git a/shell/common/null_platform_view.cc b/shell/common/null_platform_view.cc deleted file mode 100644 index 49fdf5a935b80..0000000000000 --- a/shell/common/null_platform_view.cc +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/shell/common/null_platform_view.h" - -#include "flutter/shell/common/null_rasterizer.h" -#include "flutter/shell/common/shell.h" - -namespace shell { - -NullPlatformView::NullPlatformView() - : PlatformView(std::make_unique()), weak_factory_(this) {} - -void NullPlatformView::Attach() { - CreateEngine(); -} - -NullPlatformView::~NullPlatformView() = default; - -fxl::WeakPtr NullPlatformView::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -bool NullPlatformView::ResourceContextMakeCurrent() { - return false; -} - -// Hot-reload of the null platform view is not supported. -void NullPlatformView::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) {} - -void NullPlatformView::SetAssetBundlePath(const std::string& assets_directory) { -} - -} // namespace shell diff --git a/shell/common/null_platform_view.h b/shell/common/null_platform_view.h deleted file mode 100644 index eb23d67b48a7c..0000000000000 --- a/shell/common/null_platform_view.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 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. - -#ifndef COMMON_NULL_PLATFORM_VIEW_H_ -#define COMMON_NULL_PLATFORM_VIEW_H_ - -#include "flutter/shell/common/platform_view.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class NullPlatformView : public PlatformView { - public: - NullPlatformView(); - - ~NullPlatformView(); - - fxl::WeakPtr GetWeakPtr(); - - virtual void Attach() override; - - bool ResourceContextMakeCurrent() override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - void SetAssetBundlePath(const std::string& assets_directory) override; - - private: - fxl::WeakPtrFactory weak_factory_; - - FXL_DISALLOW_COPY_AND_ASSIGN(NullPlatformView); -}; - -} // namespace shell - -#endif // COMMON_NULL_PLATFORM_VIEW_H_ diff --git a/shell/common/null_rasterizer.cc b/shell/common/null_rasterizer.cc deleted file mode 100644 index 81efdd11d4970..0000000000000 --- a/shell/common/null_rasterizer.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/common/null_rasterizer.h" - -namespace shell { - -NullRasterizer::NullRasterizer() : weak_factory_(this) {} - -void NullRasterizer::Setup( - std::unique_ptr surface_or_null, - fxl::Closure rasterizer_continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) { - surface_ = std::move(surface_or_null); - rasterizer_continuation(); - setup_completion_event->Signal(); -} - -void NullRasterizer::Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) { - if (surface_) { - surface_.reset(); - } - teardown_completion_event->Signal(); -} - -fml::WeakPtr NullRasterizer::GetWeakRasterizerPtr() { - return weak_factory_.GetWeakPtr(); -} - -flow::LayerTree* NullRasterizer::GetLastLayerTree() { - return nullptr; -} - -void NullRasterizer::DrawLastLayerTree() { - // Null rasterizer. Nothing to do. -} - -flow::TextureRegistry& NullRasterizer::GetTextureRegistry() { - return *texture_registry_; -} - -void NullRasterizer::Clear(SkColor color, const SkISize& size) { - // Null rasterizer. Nothing to do. -} - -void NullRasterizer::Draw( - fxl::RefPtr> pipeline) { - FXL_ALLOW_UNUSED_LOCAL( - pipeline->Consume([](std::unique_ptr) { - // Drop the layer tree on the floor. We only need the pipeline empty so - // that frame requests are not deferred indefinitely due to - // backpressure. - })); -} - -void NullRasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { - // Null rasterizer. Nothing to do. -} - -void NullRasterizer::SetTextureRegistry( - flow::TextureRegistry* textureRegistry) { - texture_registry_ = textureRegistry; -} - -} // namespace shell diff --git a/shell/common/null_rasterizer.h b/shell/common/null_rasterizer.h deleted file mode 100644 index 8558a3c3accaa..0000000000000 --- a/shell/common/null_rasterizer.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ -#define FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ - -#include "flutter/shell/common/rasterizer.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class NullRasterizer : public Rasterizer { - public: - NullRasterizer(); - - void Setup(std::unique_ptr surface_or_null, - fxl::Closure rasterizer_continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) override; - - void Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) override; - - void Clear(SkColor color, const SkISize& size) override; - - fml::WeakPtr GetWeakRasterizerPtr() override; - - flow::LayerTree* GetLastLayerTree() override; - - void DrawLastLayerTree() override; - - flow::TextureRegistry& GetTextureRegistry() override; - - void Draw(fxl::RefPtr> pipeline) override; - - void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; - - void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; - - private: - std::unique_ptr surface_; - fml::WeakPtrFactory weak_factory_; - flow::TextureRegistry* texture_registry_; - - FXL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index 2d5715a1733bd..b2bfce051a5bf 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -6,124 +6,74 @@ #include -#include "flutter/common/threads.h" -#include "flutter/lib/ui/painting/resource_context.h" #include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" #include "flutter/shell/common/vsync_waiter_fallback.h" #include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" namespace shell { -PlatformView::PlatformView(std::unique_ptr rasterizer) - : rasterizer_(std::move(rasterizer)), size_(SkISize::Make(0, 0)) { - rasterizer_->SetTextureRegistry(&texture_registry_); - Shell::Shared().AddPlatformView(this); +PlatformView::PlatformView(Delegate& delegate, blink::TaskRunners task_runners) + : delegate_(delegate), + task_runners_(std::move(task_runners)), + size_(SkISize::Make(0, 0)), + weak_factory_(this) { + weak_prototype_ = weak_factory_.GetWeakPtr(); } -PlatformView::~PlatformView() { - Shell::Shared().RemovePlatformView(this); +PlatformView::~PlatformView() = default; - Rasterizer* rasterizer = rasterizer_.release(); - blink::Threads::Gpu()->PostTask([rasterizer]() { delete rasterizer; }); - - Engine* engine = engine_.release(); - blink::Threads::UI()->PostTask([engine]() { delete engine; }); -} - -void PlatformView::SetRasterizer(std::unique_ptr rasterizer) { - Rasterizer* r = rasterizer_.release(); - blink::Threads::Gpu()->PostTask([r]() { delete r; }); - rasterizer_ = std::move(rasterizer); - rasterizer_->SetTextureRegistry(&texture_registry_); - engine_->set_rasterizer(rasterizer_->GetWeakRasterizerPtr()); -} - -void PlatformView::CreateEngine() { - engine_.reset(new Engine(this)); +std::unique_ptr PlatformView::CreateVSyncWaiter() { + FXL_DLOG(WARNING) + << "This platform does not provide a Vsync waiter implementation. A " + "simple timer based fallback is being used."; + return std::make_unique(task_runners_); } void PlatformView::DispatchPlatformMessage( fxl::RefPtr message) { - blink::Threads::UI()->PostTask( - [engine = engine_->GetWeakPtr(), message = std::move(message)] { - if (engine) { - engine->DispatchPlatformMessage(message); - } - }); + delegate_.OnPlatformViewDispatchPlatformMessage(*this, std::move(message)); +} + +void PlatformView::DispatchPointerDataPacket( + std::unique_ptr packet) { + delegate_.OnPlatformViewDispatchPointerDataPacket(*this, std::move(packet)); } void PlatformView::DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args) { - blink::Threads::UI()->PostTask( - [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { - if (engine) { - engine->DispatchSemanticsAction( - id, static_cast(action), std::move(args)); - } - }); + delegate_.OnPlatformViewDispatchSemanticsAction(*this, id, action, + std::move(args)); } void PlatformView::SetSemanticsEnabled(bool enabled) { - blink::Threads::UI()->PostTask([engine = engine_->GetWeakPtr(), enabled] { - if (engine) - engine->SetSemanticsEnabled(enabled); - }); + delegate_.OnPlatformViewSetSemanticsEnabled(*this, enabled); } -void PlatformView::NotifyCreated(std::unique_ptr surface) { - NotifyCreated(std::move(surface), []() {}); +void PlatformView::SetViewportMetrics(const blink::ViewportMetrics& metrics) { + delegate_.OnPlatformViewSetViewportMetrics(*this, metrics); } -void PlatformView::NotifyCreated(std::unique_ptr surface, - fxl::Closure caller_continuation) { - fxl::AutoResetWaitableEvent latch; - - auto ui_continuation = fxl::MakeCopyable([this, // - surface = std::move(surface), // - caller_continuation, // - &latch]() mutable { - auto gpu_continuation = fxl::MakeCopyable([this, // - surface = std::move(surface), // - caller_continuation, // - &latch]() mutable { - // Runs on the GPU Thread. So does the Caller Continuation. - rasterizer_->Setup(std::move(surface), caller_continuation, &latch); - }); - // Runs on the UI Thread. - engine_->OnOutputSurfaceCreated(std::move(gpu_continuation)); - }); - - // Runs on the Platform Thread. - blink::Threads::UI()->PostTask(std::move(ui_continuation)); - - latch.Wait(); +void PlatformView::NotifyCreated() { + delegate_.OnPlatformViewCreated(*this, CreateRenderingSurface()); } void PlatformView::NotifyDestroyed() { - fxl::AutoResetWaitableEvent latch; - - auto engine_continuation = [this, &latch]() { - rasterizer_->Teardown(&latch); - }; - - blink::Threads::UI()->PostTask([this, engine_continuation]() { - engine_->OnOutputSurfaceDestroyed(engine_continuation); - }); - - latch.Wait(); + delegate_.OnPlatformViewDestroyed(*this); } -std::weak_ptr PlatformView::GetWeakPtr() { - return shared_from_this(); +sk_sp PlatformView::CreateResourceContext() const { + FXL_DLOG(WARNING) << "This platform does not setup the resource " + "context on the IO thread for async texture uploads."; + return nullptr; } -VsyncWaiter* PlatformView::GetVsyncWaiter() { - if (!vsync_waiter_) - vsync_waiter_ = std::make_unique(); - return vsync_waiter_.get(); +fml::WeakPtr PlatformView::GetWeakPtr() const { + return weak_prototype_; } void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) {} @@ -135,71 +85,31 @@ void PlatformView::HandlePlatformMessage( } void PlatformView::RegisterTexture(std::shared_ptr texture) { - ASSERT_IS_PLATFORM_THREAD - blink::Threads::Gpu()->PostTask([this, texture]() { - rasterizer_->GetTextureRegistry().RegisterTexture(texture); - }); + delegate_.OnPlatformViewRegisterTexture(*this, std::move(texture)); } void PlatformView::UnregisterTexture(int64_t texture_id) { - ASSERT_IS_PLATFORM_THREAD - blink::Threads::Gpu()->PostTask([this, texture_id]() { - rasterizer_->GetTextureRegistry().UnregisterTexture(texture_id); - }); + delegate_.OnPlatformViewUnregisterTexture(*this, texture_id); } void PlatformView::MarkTextureFrameAvailable(int64_t texture_id) { - ASSERT_IS_PLATFORM_THREAD - blink::Threads::UI()->PostTask([this]() { engine_->ScheduleFrame(false); }); + delegate_.OnPlatformViewMarkTextureFrameAvailable(*this, texture_id); } -void PlatformView::SetupResourceContextOnIOThread() { - fxl::AutoResetWaitableEvent latch; - - blink::Threads::IO()->PostTask( - [this, &latch]() { SetupResourceContextOnIOThreadPerform(&latch); }); - - latch.Wait(); +std::unique_ptr PlatformView::CreateRenderingSurface() { + // We have a default implementation because tests create a platform view but + // never a rendering surface. + FXL_DCHECK(false) << "This platform does not provide a rendering surface but " + "it was notified of surface rendering surface creation."; + return nullptr; } -void PlatformView::SetupResourceContextOnIOThreadPerform( - fxl::AutoResetWaitableEvent* latch) { - std::unique_ptr resourceContext = - blink::ResourceContext::Acquire(); - if (resourceContext->Get() != nullptr) { - // The resource context was already setup. This could happen if platforms - // try to setup a context multiple times, or, if there are multiple platform - // views. In any case, there is nothing else to do. So just signal the - // latch. - latch->Signal(); +void PlatformView::SetNextFrameCallback(fxl::Closure closure) { + if (!closure) { return; } - bool current = ResourceContextMakeCurrent(); - - if (!current) { - FXL_DLOG(WARNING) - << "WARNING: Could not setup a context on the resource loader."; - latch->Signal(); - return; - } - - GrContextOptions options; - // There is currently a bug with doing GPU YUV to RGB conversions on the IO - // thread. The necessary work isn't being flushed or synchronized with the - // other threads correctly, so the textures end up blank. For now, suppress - // that feature, which will cause texture uploads to do CPU YUV conversion. - options.fDisableGpuYUVConversion = true; - - blink::ResourceContext::Set( - GrContext::MakeGL(GrGLMakeNativeInterface(), options)); - - // Do not cache textures created by the image decoder. These textures should - // be deleted when they are no longer referenced by an SkImage. - if (resourceContext->Get()) - resourceContext->Get()->setResourceCacheLimits(0, 0); - - latch->Signal(); + delegate_.OnPlatformViewSetNextFrameCallback(*this, std::move(closure)); } } // namespace shell diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 66b1fcae10c79..56179a6114777 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -7,63 +7,104 @@ #include +#include "flutter/common/task_runners.h" #include "flutter/flow/texture.h" +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/lib/ui/semantics/semantics_node.h" -#include "flutter/shell/common/engine.h" -#include "flutter/shell/common/shell.h" +#include "flutter/lib/ui/window/platform_message.h" +#include "flutter/lib/ui/window/pointer_data_packet.h" +#include "flutter/lib/ui/window/viewport_metrics.h" #include "flutter/shell/common/surface.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { -class Rasterizer; +class Shell; -class PlatformView : public std::enable_shared_from_this { +class PlatformView { public: - struct SurfaceConfig { - uint8_t red_bits = 8; - uint8_t green_bits = 8; - uint8_t blue_bits = 8; - uint8_t alpha_bits = 8; - uint8_t depth_bits = 0; - uint8_t stencil_bits = 0; + class Delegate { + public: + virtual void OnPlatformViewCreated(const PlatformView& view, + std::unique_ptr surface) = 0; + + virtual void OnPlatformViewDestroyed(const PlatformView& view) = 0; + + virtual void OnPlatformViewSetNextFrameCallback(const PlatformView& view, + fxl::Closure closure) = 0; + + virtual void OnPlatformViewSetViewportMetrics( + const PlatformView& view, + const blink::ViewportMetrics& metrics) = 0; + + virtual void OnPlatformViewDispatchPlatformMessage( + const PlatformView& view, + fxl::RefPtr message) = 0; + + virtual void OnPlatformViewDispatchPointerDataPacket( + const PlatformView& view, + std::unique_ptr packet) = 0; + + virtual void OnPlatformViewDispatchSemanticsAction( + const PlatformView& view, + int32_t id, + blink::SemanticsAction action, + std::vector args) = 0; + + virtual void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, + bool enabled) = 0; + + virtual void OnPlatformViewRegisterTexture( + const PlatformView& view, + std::shared_ptr texture) = 0; + + virtual void OnPlatformViewUnregisterTexture(const PlatformView& view, + int64_t texture_id) = 0; + + virtual void OnPlatformViewMarkTextureFrameAvailable( + const PlatformView& view, + int64_t texture_id) = 0; }; - void SetupResourceContextOnIOThread(); + explicit PlatformView(Delegate& delegate, blink::TaskRunners task_runners); virtual ~PlatformView(); - virtual void Attach() = 0; + virtual std::unique_ptr CreateVSyncWaiter(); void DispatchPlatformMessage(fxl::RefPtr message); + void DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args); - void SetSemanticsEnabled(bool enabled); - void NotifyCreated(std::unique_ptr surface); + virtual void SetSemanticsEnabled(bool enabled); - void NotifyCreated(std::unique_ptr surface, - fxl::Closure continuation); + void SetViewportMetrics(const blink::ViewportMetrics& metrics); - void NotifyDestroyed(); + void NotifyCreated(); - std::weak_ptr GetWeakPtr(); + virtual void NotifyDestroyed(); - // The VsyncWaiter will live at least as long as the PlatformView. - virtual VsyncWaiter* GetVsyncWaiter(); + // Unlike all other methods on the platform view, this one may be called on a + // non-platform task runner. + virtual sk_sp CreateResourceContext() const; - virtual bool ResourceContextMakeCurrent() = 0; + fml::WeakPtr GetWeakPtr() const; virtual void UpdateSemantics(blink::SemanticsNodeUpdates update); + virtual void HandlePlatformMessage( fxl::RefPtr message); + void SetNextFrameCallback(fxl::Closure closure); + + void DispatchPointerDataPacket( + std::unique_ptr packet); + // Called once per texture, on the platform thread. void RegisterTexture(std::shared_ptr texture); @@ -71,34 +112,18 @@ class PlatformView : public std::enable_shared_from_this { void UnregisterTexture(int64_t texture_id); // Called once per texture update (e.g. video frame), on the platform thread. - virtual void MarkTextureFrameAvailable(int64_t texture_id); - - void SetRasterizer(std::unique_ptr rasterizer); - - Rasterizer& rasterizer() { return *rasterizer_; } - Engine& engine() { return *engine_; } - - virtual void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) = 0; - - virtual void SetAssetBundlePath(const std::string& assets_directory) = 0; + void MarkTextureFrameAvailable(int64_t texture_id); protected: - explicit PlatformView(std::unique_ptr rasterizer); - - void CreateEngine(); - - void SetupResourceContextOnIOThreadPerform( - fxl::AutoResetWaitableEvent* event); - - SurfaceConfig surface_config_; - std::unique_ptr rasterizer_; - flow::TextureRegistry texture_registry_; - std::unique_ptr engine_; + PlatformView::Delegate& delegate_; + const blink::TaskRunners task_runners_; std::unique_ptr vsync_waiter_; SkISize size_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + virtual std::unique_ptr CreateRenderingSurface(); private: FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); diff --git a/shell/common/platform_view_service_protocol.cc b/shell/common/platform_view_service_protocol.cc deleted file mode 100644 index 8785c4812e202..0000000000000 --- a/shell/common/platform_view_service_protocol.cc +++ /dev/null @@ -1,447 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/common/platform_view_service_protocol.h" - -#include - -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/shell/common/picture_serializer.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/shell.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/src/utils/SkBase64.h" - -namespace shell { -namespace { - -constexpr char kViewIdPrefx[] = "_flutterView/"; -constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; - -static intptr_t KeyIndex(const char** param_keys, - intptr_t num_params, - const char* key) { - if (param_keys == NULL) { - return -1; - } - for (intptr_t i = 0; i < num_params; i++) { - if (strcmp(param_keys[i], key) == 0) { - return i; - } - } - return -1; -} - -static const char* ValueForKey(const char** param_keys, - const char** param_values, - intptr_t num_params, - const char* key) { - intptr_t index = KeyIndex(param_keys, num_params, key); - if (index < 0) { - return NULL; - } - return param_values[index]; -} - -static bool ErrorMissingParameter(const char** json_object, const char* name) { - const intptr_t kInvalidParams = -32602; - std::stringstream response; - response << "{\"code\":" << std::to_string(kInvalidParams) << ","; - response << "\"message\":\"Invalid params\","; - response << "\"data\": {\"details\": \"" << name << "\"}}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static bool ErrorBadParameter(const char** json_object, - const char* name, - const char* value) { - const intptr_t kInvalidParams = -32602; - std::stringstream response; - response << "{\"code\":" << std::to_string(kInvalidParams) << ","; - response << "\"message\":\"Invalid params\","; - response << "\"data\": {\"details\": \"parameter: " << name << " has a bad "; - response << "value: " << value << "\"}}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static bool ErrorUnknownView(const char** json_object, const char* view_id) { - const intptr_t kInvalidParams = -32602; - std::stringstream response; - response << "{\"code\":" << std::to_string(kInvalidParams) << ","; - response << "\"message\":\"Invalid params\","; - response << "\"data\": {\"details\": \"view not found: " << view_id << "\"}}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static bool ErrorServer(const char** json_object, const char* message) { - const intptr_t kServerError = -32000; - std::stringstream response; - response << "{\"code\":" << std::to_string(kServerError) << ","; - response << "\"message\":\"" << message << "\"}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static void AppendIsolateRef(std::stringstream* stream, - int64_t main_port, - const std::string name) { - *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; - *stream << main_port << "\",\"name\":\"" << name << "\","; - *stream << "\"number\":\"" << main_port << "\"}"; -} - -static void AppendFlutterView(std::stringstream* stream, - uintptr_t view_id, - int64_t isolate_id, - const std::string isolate_name) { - *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" - << std::hex << view_id << std::dec << "\""; - if (isolate_id != ILLEGAL_PORT) { - // Append the isolate (if it exists). - *stream << "," - << "\"isolate\":"; - AppendIsolateRef(stream, isolate_id, isolate_name); - } - *stream << "}"; -} - -} // namespace - -void PlatformViewServiceProtocol::RegisterHook(bool running_precompiled_code) { - // Listing of FlutterViews. - Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, - nullptr); - // Screenshot. - Dart_RegisterRootServiceRequestCallback(kScreenshotExtensionName, &Screenshot, - nullptr); - - // SkPicture Screenshot. - Dart_RegisterRootServiceRequestCallback(kScreenshotSkpExtensionName, - &ScreenshotSkp, nullptr); - - // The following set of service protocol extensions require debug build - if (running_precompiled_code) { - return; - } - Dart_RegisterRootServiceRequestCallback(kRunInViewExtensionName, &RunInView, - nullptr); - Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, - &SetAssetBundlePath, nullptr); - // [benchmark helper] Wait for the UI Thread to idle. - Dart_RegisterRootServiceRequestCallback(kFlushUIThreadTasksExtensionName, - &FlushUIThreadTasks, nullptr); -} - -const char* PlatformViewServiceProtocol::kRunInViewExtensionName = - "_flutter.runInView"; - -bool PlatformViewServiceProtocol::RunInView(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - const char* view_id = - ValueForKey(param_keys, param_values, num_params, "viewId"); - const char* asset_directory = - ValueForKey(param_keys, param_values, num_params, "assetDirectory"); - const char* main_script = - ValueForKey(param_keys, param_values, num_params, "mainScript"); - const char* packages_file = - ValueForKey(param_keys, param_values, num_params, "packagesFile"); - if (view_id == NULL) { - return ErrorMissingParameter(json_object, "viewId"); - } - if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { - return ErrorBadParameter(json_object, "viewId", view_id); - } - if (asset_directory == NULL) { - return ErrorMissingParameter(json_object, "assetDirectory"); - } - if (main_script == NULL) { - return ErrorMissingParameter(json_object, "mainScript"); - } - if (packages_file == NULL) { - return ErrorMissingParameter(json_object, "packagesFile"); - } - - // Convert the actual flutter view hex id into a number. - uintptr_t view_id_as_num = - std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); - - // Ask the Shell to run this script in the specified view. This will run a - // task on the UI thread before returning. - Shell& shell = Shell::Shared(); - bool view_existed = false; - Dart_Port main_port = ILLEGAL_PORT; - std::string isolate_name; - shell.RunInPlatformView(view_id_as_num, main_script, packages_file, - asset_directory, &view_existed, &main_port, - &isolate_name); - - if (!view_existed) { - // If the view did not exist this request has definitely failed. - return ErrorUnknownView(json_object, view_id); - } - - // The view existed and the isolate was created. Success. - std::stringstream response; - response << "{\"type\":\"Success\"," - << "\"view\":"; - AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); - response << "}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -const char* PlatformViewServiceProtocol::kListViewsExtensionName = - "_flutter.listViews"; - -bool PlatformViewServiceProtocol::ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - std::stringstream response; - response << "{\"type\":\"FlutterViewList\",\"views\":["; - bool prefix_comma = false; - Shell::Shared().IteratePlatformViews( - [&response, &prefix_comma](PlatformView* view) -> bool { - if (prefix_comma) { - response << ','; - } else { - prefix_comma = true; - } - AppendFlutterView(&response, reinterpret_cast(view), - view->engine().GetUIIsolateMainPort(), - view->engine().GetUIIsolateName()); - return true; - }); - response << "]}"; - // Copy the response. - *json_object = strdup(response.str().c_str()); - return true; -} - -const char* PlatformViewServiceProtocol::kScreenshotExtensionName = - "_flutter.screenshot"; - -static sk_sp EncodeBitmapAsPNG(const SkBitmap& bitmap) { - return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); -} - -static fml::WeakPtr GetRandomRasterizer() { - fml::WeakPtr rasterizer; - Shell::Shared().IteratePlatformViews( - [&rasterizer](PlatformView* view) -> bool { - rasterizer = view->rasterizer().GetWeakRasterizerPtr(); - // We just grab the first rasterizer so there is no need to iterate - // further. - return false; - }); - return rasterizer; -} - -bool PlatformViewServiceProtocol::Screenshot(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - fxl::AutoResetWaitableEvent latch; - SkBitmap bitmap; - blink::Threads::Gpu()->PostTask([&latch, &bitmap]() { - ScreenshotGpuTask(&bitmap); - latch.Signal(); - }); - - latch.Wait(); - - sk_sp png(EncodeBitmapAsPNG(bitmap)); - - if (!png) - return ErrorServer(json_object, "can not encode screenshot"); - - size_t b64_size = SkBase64::Encode(png->data(), png->size(), nullptr); - SkAutoTMalloc b64_data(b64_size); - SkBase64::Encode(png->data(), png->size(), b64_data.get()); - - std::stringstream response; - response << "{\"type\":\"Screenshot\"," - << "\"screenshot\":\"" << std::string{b64_data.get(), b64_size} - << "\"}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -void PlatformViewServiceProtocol::ScreenshotGpuTask(SkBitmap* bitmap) { - auto rasterizer = GetRandomRasterizer(); - - if (!rasterizer) - return; - - flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); - if (layer_tree == nullptr) - return; - - const SkISize& frame_size = layer_tree->frame_size(); - if (!bitmap->tryAllocN32Pixels(frame_size.width(), frame_size.height())) - return; - - sk_sp surface = SkSurface::MakeRasterDirect( - bitmap->info(), bitmap->getPixels(), bitmap->rowBytes()); - - flow::CompositorContext compositor_context(nullptr); - SkCanvas* canvas = surface->getCanvas(); - flow::CompositorContext::ScopedFrame frame = - compositor_context.AcquireFrame(nullptr, canvas, false); - - canvas->clear(SK_ColorBLACK); - layer_tree->Raster(frame); - canvas->flush(); -} - -const char* PlatformViewServiceProtocol::kScreenshotSkpExtensionName = - "_flutter.screenshotSkp"; - -bool PlatformViewServiceProtocol::ScreenshotSkp(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - fxl::AutoResetWaitableEvent latch; - sk_sp picture; - blink::Threads::Gpu()->PostTask([&latch, &picture]() { - picture = ScreenshotSkpGpuTask(); - latch.Signal(); - }); - - latch.Wait(); - - sk_sp skp_data = picture->serialize(); - - size_t b64_size = - SkBase64::Encode(skp_data->data(), skp_data->size(), nullptr); - SkAutoTMalloc b64_data(b64_size); - SkBase64::Encode(skp_data->data(), skp_data->size(), b64_data.get()); - - std::stringstream response; - response << "{\"type\":\"ScreenshotSkp\"," - << "\"skp\":\"" << std::string{b64_data.get(), b64_size} << "\"}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -sk_sp PlatformViewServiceProtocol::ScreenshotSkpGpuTask() { - auto rasterizer = GetRandomRasterizer(); - - if (!rasterizer) - return nullptr; - - flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); - if (layer_tree == nullptr) - return nullptr; - - SkPictureRecorder recorder; - recorder.beginRecording(SkRect::MakeWH(layer_tree->frame_size().width(), - layer_tree->frame_size().height())); - - flow::CompositorContext compositor_context(nullptr); - flow::CompositorContext::ScopedFrame frame = compositor_context.AcquireFrame( - nullptr, recorder.getRecordingCanvas(), false); - layer_tree->Raster(frame); - - return recorder.finishRecordingAsPicture(); -} - -const char* PlatformViewServiceProtocol::kFlushUIThreadTasksExtensionName = - "_flutter.flushUIThreadTasks"; - -// This API should not be invoked by production code. -// It can potentially starve the service isolate if the main isolate pauses -// at a breakpoint or is in an infinite loop. -// -// It should be invoked from the VM Service and and blocks it until UI thread -// tasks are processed. -bool PlatformViewServiceProtocol::FlushUIThreadTasks(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&latch]() { - // This task is empty because we just need to synchronize this RPC with the - // UI Thread - latch.Signal(); - }); - - latch.Wait(); - - *json_object = strdup("{\"type\":\"Success\"}"); - return true; -} - -const char* PlatformViewServiceProtocol::kSetAssetBundlePathExtensionName = - "_flutter.setAssetBundlePath"; - -bool PlatformViewServiceProtocol::SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - const char* view_id = - ValueForKey(param_keys, param_values, num_params, "viewId"); - if (view_id == nullptr) { - return ErrorMissingParameter(json_object, "viewId"); - } - if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { - return ErrorBadParameter(json_object, "viewId", view_id); - } - const char* asset_directory = - ValueForKey(param_keys, param_values, num_params, "assetDirectory"); - if (asset_directory == nullptr) { - return ErrorMissingParameter(json_object, "assetDirectory"); - } - - // Convert the actual flutter view hex id into a number. - uintptr_t view_id_as_num = - std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); - - // Ask the Shell to update asset bundle path in the specified view. - // This will run a task on the UI thread before returning. - Shell& shell = Shell::Shared(); - bool view_existed = false; - Dart_Port main_port = ILLEGAL_PORT; - std::string isolate_name; - shell.SetAssetBundlePathInPlatformView(view_id_as_num, asset_directory, - &view_existed, &main_port, - &isolate_name); - - if (!view_existed) { - // If the view did not exist this request has definitely failed. - return ErrorUnknownView(json_object, view_id); - } - - // The view existed and the isolate was created. Success. - std::stringstream response; - response << "{\"type\":\"Success\"," - << "\"view\":"; - AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); - response << "}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -} // namespace shell diff --git a/shell/common/platform_view_service_protocol.h b/shell/common/platform_view_service_protocol.h deleted file mode 100644 index b7f74b56a08ba..0000000000000 --- a/shell/common/platform_view_service_protocol.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2016 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. - -#ifndef SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ -#define SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ - -#include - -#include "flutter/shell/common/platform_view.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" -#include "third_party/skia/include/core/SkBitmap.h" - -namespace shell { - -class PlatformViewServiceProtocol { - public: - static void RegisterHook(bool running_precompiled_code); - - private: - static const char* kRunInViewExtensionName; - // It should be invoked from the VM Service and and blocks it until previous - // UI thread tasks are processed. - static bool RunInView(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kListViewsExtensionName; - static bool ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kScreenshotExtensionName; - // It should be invoked from the VM Service and and blocks it until previous - // GPU thread tasks are processed. - static bool Screenshot(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - static void ScreenshotGpuTask(SkBitmap* bitmap); - - static const char* kScreenshotSkpExtensionName; - static bool ScreenshotSkp(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - static sk_sp ScreenshotSkpGpuTask(); - - // This API should not be invoked by production code. - // It can potentially starve the service isolate if the main isolate pauses - // at a breakpoint or is in an infinite loop. - // - // It should be invoked from the VM Service and and blocks it until previous - // GPU thread tasks are processed. - static const char* kFlushUIThreadTasksExtensionName; - static bool FlushUIThreadTasks(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kSetAssetBundlePathExtensionName; - static bool SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); -}; - -} // namespace shell - -#endif // SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 905ee6285c5d3..5a519b3efea26 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -4,8 +4,205 @@ #include "flutter/shell/common/rasterizer.h" +#include + +#include "third_party/skia/include/core/SkEncodedImageFormat.h" +#include "third_party/skia/include/core/SkImageEncoder.h" +#include "third_party/skia/include/core/SkPictureRecorder.h" +#include "third_party/skia/include/core/SkSurface.h" +#include "third_party/skia/src/utils/SkBase64.h" + namespace shell { +Rasterizer::Rasterizer(blink::TaskRunners task_runners) + : task_runners_(std::move(task_runners)), weak_factory_(this) { + weak_prototype_ = weak_factory_.GetWeakPtr(); +} + Rasterizer::~Rasterizer() = default; +fml::WeakPtr Rasterizer::GetWeakPtr() const { + return weak_prototype_; +} + +void Rasterizer::Setup(std::unique_ptr surface) { + surface_ = std::move(surface); +} + +void Rasterizer::Teardown() { + surface_.reset(); + last_layer_tree_.reset(); +} + +flow::TextureRegistry* Rasterizer::GetTextureRegistry() { + if (!surface_) { + return nullptr; + } + + return &(surface_->GetCompositorContext().texture_registry()); +} + +flow::LayerTree* Rasterizer::GetLastLayerTree() { + return last_layer_tree_.get(); +} + +void Rasterizer::DrawLastLayerTree() { + if (!last_layer_tree_ || !surface_) { + return; + } + DrawToSurface(*last_layer_tree_); +} + +void Rasterizer::Draw( + fxl::RefPtr> pipeline) { + TRACE_EVENT0("flutter", "GPURasterizer::Draw"); + + flutter::Pipeline::Consumer consumer = + std::bind(&Rasterizer::DoDraw, this, std::placeholders::_1); + + // Consume as many pipeline items as possible. But yield the event loop + // between successive tries. + switch (pipeline->Consume(consumer)) { + case flutter::PipelineConsumeResult::MoreAvailable: { + task_runners_.GetGPUTaskRunner()->PostTask( + [weak_this = weak_factory_.GetWeakPtr(), pipeline]() { + if (weak_this) { + weak_this->Draw(pipeline); + } + }); + break; + } + default: + break; + } +} + +void Rasterizer::DoDraw(std::unique_ptr layer_tree) { + if (!layer_tree || !surface_) { + return; + } + + if (DrawToSurface(*layer_tree)) { + last_layer_tree_ = std::move(layer_tree); + } +} + +bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) { + FXL_DCHECK(surface_); + + auto frame = surface_->AcquireFrame(layer_tree.frame_size()); + + if (frame == nullptr) { + return false; + } + + auto& compositor_context = surface_->GetCompositorContext(); + + // There is no way for the compositor to know how long the layer tree + // construction took. Fortunately, the layer tree does. Grab that time + // for instrumentation. + compositor_context.engine_time().SetLapTime(layer_tree.construction_time()); + + auto compositor_frame = compositor_context.AcquireFrame( + surface_->GetContext(), frame->SkiaCanvas(), true); + + if (compositor_frame && compositor_frame->Raster(layer_tree, false)) { + frame->Submit(); + FireNextFrameCallbackIfPresent(); + return true; + } + + return false; +} + +static sk_sp ScreenshotLayerTreeAsPicture(flow::LayerTree* tree) { + FXL_DCHECK(tree != nullptr); + SkPictureRecorder recorder; + recorder.beginRecording( + SkRect::MakeWH(tree->frame_size().width(), tree->frame_size().height())); + + flow::CompositorContext compositor_context; + auto frame = compositor_context.AcquireFrame( + nullptr, recorder.getRecordingCanvas(), false); + + frame->Raster(*tree, true); + + return recorder.finishRecordingAsPicture(); +} + +static sk_sp ScreenshotLayerTreeAsImage(flow::LayerTree* tree, + bool compressed) { + const SkISize& frame_size = tree->frame_size(); + SkBitmap bitmap; + if (!bitmap.tryAllocN32Pixels(frame_size.width(), frame_size.height())) { + return nullptr; + } + auto bitmap_surface = SkSurface::MakeRasterDirect( + bitmap.info(), bitmap.getPixels(), bitmap.rowBytes()); + flow::CompositorContext compositor_context; + auto canvas = bitmap_surface->getCanvas(); + auto frame = compositor_context.AcquireFrame(nullptr, canvas, false); + canvas->clear(SK_ColorBLACK); + frame->Raster(*tree, true); + canvas->flush(); + if (compressed) { + return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); + } else { + return SkData::MakeWithCopy(bitmap.getPixels(), bitmap.computeByteSize()); + } + return nullptr; +} + +Rasterizer::Screenshot Rasterizer::ScreenshotLastLayerTree( + Rasterizer::ScreenshotType type, + bool base64_encode) { + auto layer_tree = GetLastLayerTree(); + if (layer_tree == nullptr) { + FXL_DLOG(INFO) << "Last layer tree was null when screenshotting."; + return {}; + } + + sk_sp data = nullptr; + + switch (type) { + case ScreenshotType::SkiaPicture: + data = ScreenshotLayerTreeAsPicture(layer_tree)->serialize(); + break; + case ScreenshotType::UncompressedImage: + data = ScreenshotLayerTreeAsImage(layer_tree, false); + break; + case ScreenshotType::CompressedImage: + data = ScreenshotLayerTreeAsImage(layer_tree, true); + break; + } + + if (data == nullptr) { + FXL_DLOG(INFO) << "Sceenshot data was null."; + return {}; + } + + if (base64_encode) { + size_t b64_size = SkBase64::Encode(data->data(), data->size(), nullptr); + auto b64_data = SkData::MakeUninitialized(b64_size); + SkBase64::Encode(data->data(), data->size(), b64_data->writable_data()); + return Rasterizer::Screenshot{b64_data, layer_tree->frame_size()}; + } + + return Rasterizer::Screenshot{data, layer_tree->frame_size()}; +} + +void Rasterizer::SetNextFrameCallback(fxl::Closure callback) { + next_frame_callback_ = callback; +} + +void Rasterizer::FireNextFrameCallbackIfPresent() { + if (!next_frame_callback_) { + return; + } + // It is safe for the callback to set a new callback. + auto callback = next_frame_callback_; + next_frame_callback_ = nullptr; + callback(); +} + } // namespace shell diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 6f45f49d8178a..908717b74c168 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -7,6 +7,7 @@ #include +#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" @@ -16,34 +17,64 @@ namespace shell { -class Rasterizer { +class Rasterizer final { public: - virtual ~Rasterizer(); + Rasterizer(blink::TaskRunners task_runners); - virtual void Setup(std::unique_ptr surface_or_null, - fxl::Closure rasterizer_continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) = 0; + ~Rasterizer(); - virtual void Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) = 0; + void Setup(std::unique_ptr surface); - virtual void Clear(SkColor color, const SkISize& size) = 0; + void Teardown(); - virtual fml::WeakPtr GetWeakRasterizerPtr() = 0; + fml::WeakPtr GetWeakPtr() const; - virtual flow::LayerTree* GetLastLayerTree() = 0; + flow::LayerTree* GetLastLayerTree(); - virtual void DrawLastLayerTree() = 0; + void DrawLastLayerTree(); - virtual flow::TextureRegistry& GetTextureRegistry() = 0; + flow::TextureRegistry* GetTextureRegistry(); - virtual void Draw( - fxl::RefPtr> pipeline) = 0; + void Draw(fxl::RefPtr> pipeline); - // Set a callback to be called once when the next frame is drawn. - virtual void AddNextFrameCallback(fxl::Closure nextFrameCallback) = 0; + enum class ScreenshotType { + SkiaPicture, + UncompressedImage, // In kN32_SkColorType format + CompressedImage, + }; - virtual void SetTextureRegistry(flow::TextureRegistry* textureRegistry) = 0; + struct Screenshot { + sk_sp data; + SkISize frame_size = SkISize::MakeEmpty(); + + Screenshot() {} + + Screenshot(sk_sp p_data, SkISize p_size) + : data(std::move(p_data)), frame_size(p_size) {} + }; + + Screenshot ScreenshotLastLayerTree(ScreenshotType type, bool base64_encode); + + // Sets a callback that will be executed after the next frame is submitted to + // the surface on the GPU task runner. + void SetNextFrameCallback(fxl::Closure callback); + + private: + blink::TaskRunners task_runners_; + std::unique_ptr surface_; + std::unique_ptr compositor_context_; + std::unique_ptr last_layer_tree_; + fxl::Closure next_frame_callback_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + void DoDraw(std::unique_ptr layer_tree); + + bool DrawToSurface(flow::LayerTree& layer_tree); + + void FireNextFrameCallbackIfPresent(); + + FXL_DISALLOW_COPY_AND_ASSIGN(Rasterizer); }; } // namespace shell diff --git a/shell/common/run_configuration.cc b/shell/common/run_configuration.cc new file mode 100644 index 0000000000000..7fb385fb4d9dc --- /dev/null +++ b/shell/common/run_configuration.cc @@ -0,0 +1,80 @@ +// Copyright 2017 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/shell/common/run_configuration.h" + +#include + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/fml/file.h" +#include "flutter/runtime/dart_vm.h" + +namespace shell { + +RunConfiguration RunConfiguration::InferFromSettings( + const blink::Settings& settings) { + auto asset_manager = fxl::MakeRefCounted(); + + asset_manager->PushBack(std::make_unique( + fml::Duplicate(settings.assets_dir))); + + asset_manager->PushBack( + std::make_unique(fml::OpenFile( + settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); + + asset_manager->PushBack( + std::make_unique(settings.flx_path)); + + return {IsolateConfiguration::InferFromSettings(settings, asset_manager), + asset_manager}; +} + +RunConfiguration::RunConfiguration( + std::unique_ptr configuration) + : RunConfiguration(std::move(configuration), + fxl::MakeRefCounted()) {} + +RunConfiguration::RunConfiguration( + std::unique_ptr configuration, + fxl::RefPtr asset_manager) + : isolate_configuration_(std::move(configuration)), + asset_manager_(std::move(asset_manager)) {} + +RunConfiguration::RunConfiguration(RunConfiguration&&) = default; + +RunConfiguration::~RunConfiguration() = default; + +bool RunConfiguration::IsValid() const { + return asset_manager_ && isolate_configuration_; +} + +bool RunConfiguration::AddAssetResolver( + std::unique_ptr resolver) { + if (!resolver || !resolver->IsValid()) { + return false; + } + + asset_manager_->PushBack(std::move(resolver)); + return true; +} + +void RunConfiguration::SetEntrypoint(std::string entrypoint) { + entrypoint_ = std::move(entrypoint); +} + +fxl::RefPtr RunConfiguration::GetAssetManager() const { + return asset_manager_; +} + +const std::string& RunConfiguration::GetEntrypoint() const { + return entrypoint_; +} + +std::unique_ptr +RunConfiguration::TakeIsolateConfiguration() { + return std::move(isolate_configuration_); +} + +} // namespace shell diff --git a/shell/common/run_configuration.h b/shell/common/run_configuration.h new file mode 100644 index 0000000000000..59aa07566685c --- /dev/null +++ b/shell/common/run_configuration.h @@ -0,0 +1,56 @@ +// Copyright 2017 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_SHELL_COMMON_RUN_CONFIGURATION_H_ +#define FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ + +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "flutter/assets/asset_resolver.h" +#include "flutter/common/settings.h" +#include "flutter/fml/mapping.h" +#include "flutter/shell/common/isolate_configuration.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class RunConfiguration { + public: + static RunConfiguration InferFromSettings(const blink::Settings& settings); + + RunConfiguration(std::unique_ptr configuration); + + RunConfiguration(std::unique_ptr configuration, + fxl::RefPtr asset_manager); + + RunConfiguration(RunConfiguration&&); + + ~RunConfiguration(); + + bool IsValid() const; + + bool AddAssetResolver(std::unique_ptr resolver); + + void SetEntrypoint(std::string entrypoint); + + fxl::RefPtr GetAssetManager() const; + + const std::string& GetEntrypoint() const; + + std::unique_ptr TakeIsolateConfiguration(); + + private: + std::unique_ptr isolate_configuration_; + fxl::RefPtr asset_manager_; + std::string entrypoint_ = "main"; + + FXL_DISALLOW_COPY_AND_ASSIGN(RunConfiguration); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 14f8fee84bb5f..53527a996bd76 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -2,362 +2,859 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#define RAPIDJSON_HAS_STDSTRING 1 + #include "flutter/shell/common/shell.h" -#include #include #include #include -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/fml/file.h" #include "flutter/fml/icu_util.h" #include "flutter/fml/message_loop.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/dart_init.h" +#include "flutter/glue/trace_event.h" +#include "flutter/runtime/dart_vm.h" #include "flutter/shell/common/engine.h" -#include "flutter/shell/common/platform_view_service_protocol.h" #include "flutter/shell/common/skia_event_tracer_impl.h" #include "flutter/shell/common/switches.h" +#include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/logging.h" #include "third_party/dart/runtime/include/dart_tools_api.h" #include "third_party/skia/include/core/SkGraphics.h" namespace shell { -namespace { -static Shell* g_shell = nullptr; +std::unique_ptr Shell::CreateShellOnPlatformThread( + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) { + if (!task_runners.IsValid()) { + return nullptr; + } + + auto shell = std::unique_ptr(new Shell(task_runners, settings)); + + // Create the platform view on the platform thread (this thread). + auto platform_view = on_create_platform_view(*shell.get()); + if (!platform_view || !platform_view->GetWeakPtr()) { + return nullptr; + } + + // Ask the platform view for the vsync waiter. This will be used by the engine + // to create the animator. + auto vsync_waiter = platform_view->CreateVSyncWaiter(); + if (!vsync_waiter) { + return nullptr; + } + + // Create the IO manager on the IO thread. The IO manager must be initialized + // first because it has state that the other subsystems depend on. It must + // first be booted and the necessary references obtained to initialize the + // other subsystems. + fxl::AutoResetWaitableEvent io_latch; + std::unique_ptr io_manager; + fml::WeakPtr resource_context; + fxl::RefPtr unref_queue; + auto io_task_runner = shell->GetTaskRunners().GetIOTaskRunner(); + fml::TaskRunner::RunNowOrPostTask( + io_task_runner, + [&io_latch, // + &io_manager, // + &resource_context, // + &unref_queue, // + &platform_view, // + io_task_runner // + ]() { + io_manager = std::make_unique( + platform_view->CreateResourceContext(), io_task_runner); + resource_context = io_manager->GetResourceContext(); + unref_queue = io_manager->GetSkiaUnrefQueue(); + io_latch.Signal(); + }); + io_latch.Wait(); + + // Create the rasterizer on the GPU thread. + fxl::AutoResetWaitableEvent gpu_latch; + std::unique_ptr rasterizer; + fml::TaskRunner::RunNowOrPostTask( + task_runners.GetGPUTaskRunner(), [&gpu_latch, // + &rasterizer, // + on_create_rasterizer, // + shell = shell.get() // + ]() { + if (auto new_rasterizer = on_create_rasterizer(*shell)) { + rasterizer = std::move(new_rasterizer); + } + gpu_latch.Signal(); + }); + + // Create the engine on the UI thread. + fxl::AutoResetWaitableEvent ui_latch; + std::unique_ptr engine; + fml::TaskRunner::RunNowOrPostTask( + shell->GetTaskRunners().GetUITaskRunner(), + fxl::MakeCopyable([&ui_latch, // + &engine, // + shell = shell.get(), // + vsync_waiter = std::move(vsync_waiter), // + resource_context = std::move(resource_context), // + unref_queue = std::move(unref_queue) // + ]() mutable { + const auto& task_runners = shell->GetTaskRunners(); + + // The animator is owned by the UI thread but it gets its vsync pulses + // from the platform. + auto animator = std::make_unique(*shell, task_runners, + std::move(vsync_waiter)); + + engine = std::make_unique(*shell, // + shell->GetDartVM(), // + task_runners, // + shell->GetSettings(), // + std::move(animator), // + std::move(resource_context), // + std::move(unref_queue) // + ); + ui_latch.Signal(); + })); + + gpu_latch.Wait(); + ui_latch.Wait(); + // We are already on the platform thread. So there is no platform latch to + // wait on. + + if (!shell->Setup(std::move(platform_view), // + std::move(engine), // + std::move(rasterizer), // + std::move(io_manager)) // + ) { + return nullptr; + } + + return shell; +} + +std::unique_ptr Shell::Create( + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) { + if (!task_runners.IsValid() || !on_create_platform_view || + !on_create_rasterizer) { + return nullptr; + } + + fxl::AutoResetWaitableEvent latch; + std::unique_ptr shell; + fml::TaskRunner::RunNowOrPostTask( + task_runners.GetPlatformTaskRunner(), + [&latch, &shell, task_runners = std::move(task_runners), settings, + on_create_platform_view, on_create_rasterizer]() { + shell = CreateShellOnPlatformThread(std::move(task_runners), settings, + on_create_platform_view, + on_create_rasterizer); + latch.Signal(); + }); + latch.Wait(); + return shell; +} + +Shell::Shell(blink::TaskRunners task_runners, blink::Settings settings) + : task_runners_(std::move(task_runners)), + settings_(std::move(settings)), + vm_(blink::DartVM::ForProcess(settings_)) { + FXL_DCHECK(task_runners_.IsValid()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + if (settings_.icu_data_path.size() != 0) { + fml::icu::InitializeICU(settings_.icu_data_path); + } else { + FXL_DLOG(WARNING) << "Skipping ICU initialization in the shell."; + } + + if (settings_.trace_skia) { + InitSkiaEventTracer(settings_.trace_skia); + } -template -bool GetSwitchValue(const fxl::CommandLine& command_line, - Switch sw, - T* result) { - std::string switch_string; + if (!settings_.skia_deterministic_rendering_on_cpu) { + SkGraphics::Init(); + } else { + FXL_DLOG(INFO) << "Skia deterministic rendering is enabled."; + } - if (!command_line.GetOptionValue(FlagForSwitch(sw), &switch_string)) { + // Install service protocol handlers. + + service_protocol_handlers_[blink::ServiceProtocol::kScreenshotExtensionName + .ToString()] = { + task_runners_.GetGPUTaskRunner(), + std::bind(&Shell::OnServiceProtocolScreenshot, this, + std::placeholders::_1, std::placeholders::_2)}; + service_protocol_handlers_[blink::ServiceProtocol::kScreenshotSkpExtensionName + .ToString()] = { + task_runners_.GetGPUTaskRunner(), + std::bind(&Shell::OnServiceProtocolScreenshotSKP, this, + std::placeholders::_1, std::placeholders::_2)}; + service_protocol_handlers_[blink::ServiceProtocol::kRunInViewExtensionName + .ToString()] = { + task_runners_.GetUITaskRunner(), + std::bind(&Shell::OnServiceProtocolRunInView, this, std::placeholders::_1, + std::placeholders::_2)}; + service_protocol_handlers_ + [blink::ServiceProtocol::kFlushUIThreadTasksExtensionName.ToString()] = { + task_runners_.GetUITaskRunner(), + std::bind(&Shell::OnServiceProtocolFlushUIThreadTasks, this, + std::placeholders::_1, std::placeholders::_2)}; + service_protocol_handlers_ + [blink::ServiceProtocol::kSetAssetBundlePathExtensionName.ToString()] = { + task_runners_.GetUITaskRunner(), + std::bind(&Shell::OnServiceProtocolSetAssetBundlePath, this, + std::placeholders::_1, std::placeholders::_2)}; +} + +Shell::~Shell() { + if (auto vm = blink::DartVM::ForProcessIfInitialized()) { + vm->GetServiceProtocol().RemoveHandler(this); + } + + fxl::AutoResetWaitableEvent ui_latch, gpu_latch, platform_latch, io_latch; + + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetUITaskRunner(), + fxl::MakeCopyable([engine = std::move(engine_), &ui_latch]() mutable { + engine.reset(); + ui_latch.Signal(); + })); + ui_latch.Wait(); + + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetGPUTaskRunner(), + fxl::MakeCopyable( + [rasterizer = std::move(rasterizer_), &gpu_latch]() mutable { + rasterizer.reset(); + gpu_latch.Signal(); + })); + gpu_latch.Wait(); + + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetIOTaskRunner(), + fxl::MakeCopyable( + [io_manager = std::move(io_manager_), &io_latch]() mutable { + io_manager.reset(); + io_latch.Signal(); + })); + + io_latch.Wait(); + + // The platform view must go last because it may be holding onto platform side + // counterparts to resources owned by subsystems running on other threads. For + // example, the NSOpenGLContext on the Mac. + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetPlatformTaskRunner(), + fxl::MakeCopyable([platform_view = std::move(platform_view_), + &platform_latch]() mutable { + platform_view.reset(); + platform_latch.Signal(); + })); + platform_latch.Wait(); +} + +bool Shell::IsSetup() const { + return is_setup_; +} + +bool Shell::Setup(std::unique_ptr platform_view, + std::unique_ptr engine, + std::unique_ptr rasterizer, + std::unique_ptr io_manager) { + if (is_setup_) { return false; } - std::stringstream stream(switch_string); - T value = 0; - if (stream >> value) { - *result = value; - return true; + if (!platform_view || !engine || !rasterizer || !io_manager) { + return false; } - return false; + platform_view_ = std::move(platform_view); + engine_ = std::move(engine); + rasterizer_ = std::move(rasterizer); + io_manager_ = std::move(io_manager); + + is_setup_ = true; + + if (auto vm = blink::DartVM::ForProcessIfInitialized()) { + vm->GetServiceProtocol().AddHandler(this); + } + + return true; } -} // namespace +const blink::Settings& Shell::GetSettings() const { + return settings_; +} -Shell::Shell(fxl::CommandLine command_line) - : command_line_(std::move(command_line)) { - FXL_DCHECK(!g_shell); +const blink::TaskRunners& Shell::GetTaskRunners() const { + return task_runners_; +} - gpu_thread_.reset(new fml::Thread("gpu_thread")); - ui_thread_.reset(new fml::Thread("ui_thread")); - io_thread_.reset(new fml::Thread("io_thread")); +fml::WeakPtr Shell::GetRasterizer() { + FXL_DCHECK(is_setup_); + return rasterizer_->GetWeakPtr(); +} - // Since we are not using fml::Thread, we need to initialize the message loop - // manually. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - blink::Threads threads(fml::MessageLoop::GetCurrent().GetTaskRunner(), - gpu_thread_->GetTaskRunner(), - ui_thread_->GetTaskRunner(), - io_thread_->GetTaskRunner()); - blink::Threads::Set(threads); +fml::WeakPtr Shell::GetEngine() { + FXL_DCHECK(is_setup_); + return engine_->GetWeakPtr(); +} - blink::Threads::Gpu()->PostTask([this]() { InitGpuThread(); }); - blink::Threads::UI()->PostTask([this]() { InitUIThread(); }); +fml::WeakPtr Shell::GetPlatformView() { + FXL_DCHECK(is_setup_); + return platform_view_->GetWeakPtr(); +} - blink::SetRegisterNativeServiceProtocolExtensionHook( - PlatformViewServiceProtocol::RegisterHook); +const blink::DartVM& Shell::GetDartVM() const { + return *vm_; } -Shell::~Shell() {} +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewCreated(const PlatformView& view, + std::unique_ptr surface) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); -void Shell::InitStandalone(fxl::CommandLine command_line, - std::string icu_data_path, - std::string application_library_path, - std::string bundle_path) { - TRACE_EVENT0("flutter", "Shell::InitStandalone"); + // Note: + // This is a synchronous operation because certain platforms depend on + // setup/suspension of all activities that may be interacting with the GPU in + // a synchronous fashion. - fml::icu::InitializeICU(icu_data_path); + fxl::AutoResetWaitableEvent latch; + auto gpu_task = fxl::MakeCopyable([rasterizer = rasterizer_->GetWeakPtr(), // + surface = std::move(surface), // + &latch]() mutable { + if (rasterizer) { + rasterizer->Setup(std::move(surface)); + } + // Step 2: All done. Signal the latch that the platform thread is waiting + // on. + latch.Signal(); + }); - if (!command_line.HasOption( - FlagForSwitch(Switch::SkiaDeterministicRendering))) - SkGraphics::Init(); + auto ui_task = [engine = engine_->GetWeakPtr(), // + gpu_task_runner = task_runners_.GetGPUTaskRunner(), // + gpu_task // + ] { + if (engine) { + engine->OnOutputSurfaceCreated(); + } + // Step 1: Next, tell the GPU thread that it should create a surface for its + // rasterizer. + fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); + }; + + // Step 0: Post a task onto the UI thread to tell the engine that it has an + // output surface. + fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); + latch.Wait(); +} - blink::Settings settings; - settings.application_library_path = application_library_path; +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDestroyed(const PlatformView& view) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - // Enable Observatory - settings.enable_observatory = - !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); + // Note: + // This is a synchronous operation because certain platforms depend on + // setup/suspension of all activities that may be interacting with the GPU in + // a synchronous fashion. + + fxl::AutoResetWaitableEvent latch; - // Set Observatory Port - if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { - if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, - &settings.observatory_port)) { - FXL_LOG(INFO) - << "Observatory port specified was malformed. Will default to " - << settings.observatory_port; + auto gpu_task = [rasterizer = rasterizer_->GetWeakPtr(), &latch]() { + if (rasterizer) { + rasterizer->Teardown(); } - } + // Step 2: All done. Signal the latch that the platform thread is waiting + // on. + latch.Signal(); + }; + + auto ui_task = [engine = engine_->GetWeakPtr(), + gpu_task_runner = task_runners_.GetGPUTaskRunner(), + gpu_task]() { + if (engine) { + engine->OnOutputSurfaceDestroyed(); + } + // Step 1: Next, tell the GPU thread that its rasterizer should suspend + // access to the underlying surface. + fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); + }; + + // Step 0: Post a task onto the UI thread to tell the engine that its output + // surface is about to go away. + fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); + latch.Wait(); +} + +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewSetViewportMetrics( + const PlatformView& view, + const blink::ViewportMetrics& metrics) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), metrics]() { + if (engine) { + engine->SetViewportMetrics(metrics); + } + }); +} + +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDispatchPlatformMessage( + const PlatformView& view, + fxl::RefPtr message) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), message = std::move(message)] { + if (engine) { + engine->DispatchPlatformMessage(std::move(message)); + } + }); +} - // Checked mode overrides. - settings.dart_non_checked_mode = - command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDispatchPointerDataPacket( + const PlatformView& view, + std::unique_ptr packet) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + task_runners_.GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = engine_->GetWeakPtr(), packet = std::move(packet)] { + if (engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); +} - settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDispatchSemanticsAction(const PlatformView& view, + int32_t id, + blink::SemanticsAction action, + std::vector args) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { + if (engine) { + engine->DispatchSemanticsAction(id, action, std::move(args)); + } + }); +} - settings.start_paused = - command_line.HasOption(FlagForSwitch(Switch::StartPaused)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewSetSemanticsEnabled(const PlatformView& view, + bool enabled) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), enabled] { + if (engine) { + engine->SetSemanticsEnabled(enabled); + } + }); +} - settings.enable_dart_profiling = - command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewRegisterTexture( + const PlatformView& view, + std::shared_ptr texture) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), texture] { + if (rasterizer) { + if (auto registry = rasterizer->GetTextureRegistry()) { + registry->RegisterTexture(texture); + } + } + }); +} - settings.enable_software_rendering = - command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewUnregisterTexture(const PlatformView& view, + int64_t texture_id) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { + if (rasterizer) { + if (auto registry = rasterizer->GetTextureRegistry()) { + registry->UnregisterTexture(texture_id); + } + } + }); +} - settings.using_blink = - command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, + int64_t texture_id) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - settings.endless_trace_buffer = - command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); + // Tell the rasterizer that one of its textures has a new frame available. + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { + auto registry = rasterizer->GetTextureRegistry(); - settings.trace_startup = - command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); + if (!registry) { + return; + } - command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), - &settings.aot_snapshot_path); + auto texture = registry->GetTexture(texture_id); - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), - &settings.aot_vm_snapshot_data_filename); + if (!texture) { + return; + } - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), - &settings.aot_vm_snapshot_instr_filename); + texture->MarkNewFrameAvailable(); + }); - command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), - &settings.aot_isolate_snapshot_data_filename); + // Schedule a new frame without having to rebuild the layer tree. + task_runners_.GetUITaskRunner()->PostTask([engine = engine_->GetWeakPtr()]() { + if (engine) { + engine->ScheduleFrame(false); + } + }); +} - command_line.GetOptionValue(FlagForSwitch(Switch::AotSharedLibraryPath), - &settings.aot_shared_library_path); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewSetNextFrameCallback(const PlatformView& view, + fxl::Closure closure) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), closure = std::move(closure)]() { + if (rasterizer) { + rasterizer->SetNextFrameCallback(std::move(closure)); + } + }); +} - command_line.GetOptionValue( - FlagForSwitch(Switch::AotIsolateSnapshotInstructions), - &settings.aot_isolate_snapshot_instr_filename); +// |shell::Animator::Delegate| +void Shell::OnAnimatorBeginFrame(const Animator& animator, + fxl::TimePoint frame_time) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), - &settings.temp_directory_path); + if (engine_) { + engine_->BeginFrame(frame_time); + } +} - settings.use_test_fonts = - command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); +// |shell::Animator::Delegate| +void Shell::OnAnimatorNotifyIdle(const Animator& animator, int64_t deadline) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - std::string all_dart_flags; - if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), - &all_dart_flags)) { - std::stringstream stream(all_dart_flags); - std::istream_iterator end; - for (std::istream_iterator it(stream); it != end; ++it) - settings.dart_flags.push_back(*it); + if (engine_) { + engine_->NotifyIdle(deadline); } +} - command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); +// |shell::Animator::Delegate| +void Shell::OnAnimatorDraw( + const Animator& animator, + fxl::RefPtr> pipeline) { + FXL_DCHECK(is_setup_); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), + pipeline = std::move(pipeline)]() { + if (rasterizer) { + rasterizer->Draw(pipeline); + } + }); +} - blink::Settings::Set(settings); +// |shell::Animator::Delegate| +void Shell::OnAnimatorDrawLastLayerTree(const Animator& animator) { + FXL_DCHECK(is_setup_); - Init(std::move(command_line), bundle_path); + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr()]() { + if (rasterizer) { + rasterizer->DrawLastLayerTree(); + } + }); } -void Shell::Init(fxl::CommandLine command_line, - const std::string& bundle_path) { -#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - bool trace_skia = command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); - InitSkiaEventTracer(trace_skia); -#endif +// |shell::Engine::Delegate| +void Shell::OnEngineUpdateSemantics(const Engine& engine, + blink::SemanticsNodeUpdates update) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - FXL_DCHECK(!g_shell); - g_shell = new Shell(std::move(command_line)); - blink::Threads::UI()->PostTask( - [bundle_path]() { Engine::Init(bundle_path); }); + task_runners_.GetPlatformTaskRunner()->PostTask( + [view = platform_view_->GetWeakPtr(), update = std::move(update)] { + if (view) { + view->UpdateSemantics(std::move(update)); + } + }); } -Shell& Shell::Shared() { - FXL_DCHECK(g_shell); - return *g_shell; +// |shell::Engine::Delegate| +void Shell::OnEngineHandlePlatformMessage( + const Engine& engine, + fxl::RefPtr message) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetPlatformTaskRunner()->PostTask( + [view = platform_view_->GetWeakPtr(), message = std::move(message)]() { + if (view) { + view->HandlePlatformMessage(std::move(message)); + } + }); } -const fxl::CommandLine& Shell::GetCommandLine() const { - return command_line_; +// |blink::ServiceProtocol::Handler| +fxl::RefPtr Shell::GetServiceProtocolHandlerTaskRunner( + fxl::StringView method) const { + FXL_DCHECK(is_setup_); + auto found = service_protocol_handlers_.find(method.ToString()); + if (found != service_protocol_handlers_.end()) { + return found->second.first; + } + return task_runners_.GetUITaskRunner(); } -void Shell::InitGpuThread() { - gpu_thread_checker_.reset(new fxl::ThreadChecker()); +// |blink::ServiceProtocol::Handler| +bool Shell::HandleServiceProtocolMessage( + fxl::StringView method, // one if the extension names specified above. + const ServiceProtocolMap& params, + rapidjson::Document& response) { + auto found = service_protocol_handlers_.find(method.ToString()); + if (found != service_protocol_handlers_.end()) { + return found->second.second(params, response); + } + return false; } -void Shell::InitUIThread() { - ui_thread_checker_.reset(new fxl::ThreadChecker()); +// |blink::ServiceProtocol::Handler| +blink::ServiceProtocol::Handler::Description +Shell::GetServiceProtocolDescription() const { + return { + engine_->GetUIIsolateMainPort(), + engine_->GetUIIsolateName(), + }; } -void Shell::AddPlatformView(PlatformView* platform_view) { - if (platform_view == nullptr) { - return; +static void ServiceProtocolParameterError(rapidjson::Document& response, + std::string parameter_name) { + auto& allocator = response.GetAllocator(); + response.SetObject(); + const int64_t kInvalidParams = -32602; + response.AddMember("code", kInvalidParams, allocator); + response.AddMember("message", "Invalid params", allocator); + { + rapidjson::Value details(rapidjson::kObjectType); + details.AddMember("details", parameter_name, allocator); + response.AddMember("data", details, allocator); } - std::lock_guard lock(platform_views_mutex_); - platform_views_.insert(platform_view); } -void Shell::RemovePlatformView(PlatformView* platform_view) { - if (platform_view == nullptr) { - return; +// Service protocol handler +bool Shell::OnServiceProtocolScreenshot( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); + auto screenshot = rasterizer_->ScreenshotLastLayerTree( + Rasterizer::ScreenshotType::CompressedImage, true); + if (screenshot.data) { + response.SetObject(); + auto& allocator = response.GetAllocator(); + response.AddMember("type", "Screenshot", allocator); + rapidjson::Value image; + image.SetString(static_cast(screenshot.data->data()), + screenshot.data->size(), allocator); + response.AddMember("screenshot", image, allocator); + return true; } - std::lock_guard lock(platform_views_mutex_); - platform_views_.erase(platform_view); + ServiceProtocolParameterError(response, + "Could not capture image screenshot."); + return false; } -void Shell::IteratePlatformViews( - std::function iterator) const { - if (iterator == nullptr) { - return; +// Service protocol handler +bool Shell::OnServiceProtocolScreenshotSKP( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); + auto screenshot = rasterizer_->ScreenshotLastLayerTree( + Rasterizer::ScreenshotType::SkiaPicture, true); + if (screenshot.data) { + response.SetObject(); + auto& allocator = response.GetAllocator(); + response.AddMember("type", "ScreenshotSkp", allocator); + rapidjson::Value skp; + skp.SetString(static_cast(screenshot.data->data()), + screenshot.data->size(), allocator); + response.AddMember("skp", skp, allocator); + return true; } - std::lock_guard lock(platform_views_mutex_); - for (PlatformView* view : platform_views_) { - if (!iterator(view)) { - return; - } + ServiceProtocolParameterError(response, "Could not capture SKP screenshot."); + return false; +} + +// Service protocol handler +bool Shell::OnServiceProtocolRunInView( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + + if (params.count("mainScript") == 0) { + ServiceProtocolParameterError(response, + "'mainScript' parameter is missing."); + return false; + } + + if (params.count("packagesFile") == 0) { + ServiceProtocolParameterError(response, + "'packagesFile' parameter is missing."); + return false; } + + if (params.count("assetDirectory") == 0) { + ServiceProtocolParameterError(response, + "'assetDirectory' parameter is missing."); + return false; + } + + RunConfiguration configuration(IsolateConfiguration::CreateForSource( + params.at("mainScript").ToString(), + params.at("packagesFile").ToString())); + + configuration.AddAssetResolver(std::make_unique( + fml::OpenFile(params.at("assetDirectory").ToString().c_str(), + fml::OpenPermission::kRead, true))); + + auto& allocator = response.GetAllocator(); + response.SetObject(); + if (engine_->Restart(std::move(configuration))) { + response.AddMember("type", "Success", allocator); + auto new_description = GetServiceProtocolDescription(); + rapidjson::Value view(rapidjson::kObjectType); + new_description.Write(this, view, allocator); + response.AddMember("view", view, allocator); + return true; + } else { + FXL_DLOG(ERROR) << "Could not run configuration in engine."; + response.AddMember("type", "Failure", allocator); + return false; + } + + FXL_DCHECK(false); + return false; } -void Shell::RunInPlatformView(uintptr_t view_id, - const char* main_script, - const char* packages_file, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name) { - fxl::AutoResetWaitableEvent latch; - FXL_DCHECK(view_id != 0); - FXL_DCHECK(main_script); - FXL_DCHECK(packages_file); - FXL_DCHECK(asset_directory); - FXL_DCHECK(view_existed); - - blink::Threads::UI()->PostTask([this, view_id, main_script, packages_file, - asset_directory, view_existed, - dart_isolate_id, isolate_name, &latch]() { - RunInPlatformViewUIThread(view_id, main_script, packages_file, - asset_directory, view_existed, dart_isolate_id, - isolate_name, &latch); - }); - latch.Wait(); +// Service protocol handler +bool Shell::OnServiceProtocolFlushUIThreadTasks( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + // This API should not be invoked by production code. + // It can potentially starve the service isolate if the main isolate pauses + // at a breakpoint or is in an infinite loop. + // + // It should be invoked from the VM Service and and blocks it until UI thread + // tasks are processed. + response.SetObject(); + response.AddMember("type", "Success", response.GetAllocator()); + return true; } -void Shell::RunInPlatformViewUIThread(uintptr_t view_id, - const std::string& main, - const std::string& packages, - const std::string& assets_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch) { - FXL_DCHECK(ui_thread_checker_ && - ui_thread_checker_->IsCreationThreadCurrent()); - - *view_existed = false; - - IteratePlatformViews( - [view_id, // argument -#if !defined(OS_WIN) - // Using std::move on const references inside lambda capture is - // not supported on Windows for some reason. - assets_directory = std::move(assets_directory), // argument - main = std::move(main), // argument - packages = std::move(packages), // argument -#else - assets_directory, // argument - main, // argument - packages, // argument -#endif - &view_existed, // out - &dart_isolate_id, // out - &isolate_name // out - ](PlatformView* view) -> bool { - if (reinterpret_cast(view) != view_id) { - // Keep looking. - return true; - } - *view_existed = true; - view->RunFromSource(assets_directory, main, packages); - *dart_isolate_id = view->engine().GetUIIsolateMainPort(); - *isolate_name = view->engine().GetUIIsolateName(); - // We found the requested view. Stop iterating over platform views. - return false; - }); +// Service protocol handler +bool Shell::OnServiceProtocolSetAssetBundlePath( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - latch->Signal(); -} + if (params.count("assetDirectory") == 0) { + ServiceProtocolParameterError(response, + "'assetDirectory' parameter is missing."); + return false; + } -void Shell::SetAssetBundlePathInPlatformView(uintptr_t view_id, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name) { - fxl::AutoResetWaitableEvent latch; - FXL_DCHECK(view_id != 0); - FXL_DCHECK(asset_directory); - FXL_DCHECK(view_existed); - - blink::Threads::UI()->PostTask([this, view_id, asset_directory, view_existed, - dart_isolate_id, isolate_name, &latch]() { - SetAssetBundlePathInPlatformViewUIThread(view_id, asset_directory, - view_existed, dart_isolate_id, - isolate_name, &latch); - }); - latch.Wait(); + auto& allocator = response.GetAllocator(); + response.SetObject(); + + auto asset_manager = fxl::MakeRefCounted(); + + asset_manager->PushFront(std::make_unique( + fml::OpenFile(params.at("assetDirectory").ToString().c_str(), + fml::OpenPermission::kRead, true))); + + if (engine_->UpdateAssetManager(std::move(asset_manager))) { + response.AddMember("type", "Success", allocator); + auto new_description = GetServiceProtocolDescription(); + rapidjson::Value view(rapidjson::kObjectType); + new_description.Write(this, view, allocator); + response.AddMember("view", view, allocator); + return true; + } else { + FXL_DLOG(ERROR) << "Could not update asset directory."; + response.AddMember("type", "Failure", allocator); + return false; + } + + FXL_DCHECK(false); + return false; } -void Shell::SetAssetBundlePathInPlatformViewUIThread( - uintptr_t view_id, - const std::string& assets_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch) { - FXL_DCHECK(ui_thread_checker_ && - ui_thread_checker_->IsCreationThreadCurrent()); - - *view_existed = false; - - IteratePlatformViews( - [view_id, // argument -#if !defined(OS_WIN) - // Using std::move on const references inside lambda capture is - // not supported on Windows for some reason. - // TODO(https://github.com/flutter/flutter/issues/13908): - // Investigate the root cause of the difference. - assets_directory = std::move(assets_directory), // argument -#else - assets_directory, // argument -#endif - &view_existed, // out - &dart_isolate_id, // out - &isolate_name // out - ](PlatformView* view) -> bool { - if (reinterpret_cast(view) != view_id) { - // Keep looking. - return true; +Rasterizer::Screenshot Shell::Screenshot( + Rasterizer::ScreenshotType screenshot_type, + bool base64_encode) { + TRACE_EVENT0("flutter", "Shell::Screenshot"); + fxl::AutoResetWaitableEvent latch; + Rasterizer::Screenshot screenshot; + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetGPUTaskRunner(), [&latch, // + rasterizer = GetRasterizer(), // + &screenshot, // + screenshot_type, // + base64_encode // + ]() { + if (rasterizer) { + screenshot = rasterizer->ScreenshotLastLayerTree(screenshot_type, + base64_encode); } - *view_existed = true; - view->SetAssetBundlePath(assets_directory); - *dart_isolate_id = view->engine().GetUIIsolateMainPort(); - *isolate_name = view->engine().GetUIIsolateName(); - // We found the requested view. Stop iterating over - // platform views. - return false; + latch.Signal(); }); - - latch->Signal(); + latch.Wait(); + return screenshot; } } // namespace shell diff --git a/shell/common/shell.h b/shell/common/shell.h index 92c315dcf2aa7..02a642b0ba40f 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -5,96 +5,214 @@ #ifndef SHELL_COMMON_SHELL_H_ #define SHELL_COMMON_SHELL_H_ -#include -#include - +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/common/task_runners.h" +#include "flutter/flow/texture.h" +#include "flutter/fml/memory/thread_checker.h" +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/thread.h" -#include "flutter/shell/common/tracing_controller.h" -#include "lib/fxl/command_line.h" +#include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/window/platform_message.h" +#include "flutter/runtime/service_protocol.h" +#include "flutter/shell/common/animator.h" +#include "flutter/shell/common/engine.h" +#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" #include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/strings/string_view.h" +#include "lib/fxl/synchronization/thread_annotations.h" #include "lib/fxl/synchronization/thread_checker.h" #include "lib/fxl/synchronization/waitable_event.h" -#include "lib/fxl/tasks/task_runner.h" namespace shell { -class PlatformView; - -class Shell { +class Shell final : public PlatformView::Delegate, + public Animator::Delegate, + public Engine::Delegate, + public blink::ServiceProtocol::Handler { public: + template + using CreateCallback = std::function(Shell&)>; + static std::unique_ptr Create( + blink::TaskRunners task_runners, + blink::Settings settings, + CreateCallback on_create_platform_view, + CreateCallback on_create_rasterizer); + ~Shell(); - static void InitStandalone(fxl::CommandLine command_line, - std::string icu_data_path = "", - std::string application_library_path = "", - std::string bundle_path = ""); + const blink::Settings& GetSettings() const; - static Shell& Shared(); + const blink::TaskRunners& GetTaskRunners() const; - const fxl::CommandLine& GetCommandLine() const; + fml::WeakPtr GetRasterizer(); - void AddPlatformView(PlatformView* platform_view); + fml::WeakPtr GetEngine(); - void RemovePlatformView(PlatformView* platform_view); + fml::WeakPtr GetPlatformView(); - void IteratePlatformViews( - std::function iterator) const; + const blink::DartVM& GetDartVM() const; - // Attempt to run a script inside a flutter view indicated by |view_id|. - // Will set |view_existed| to true if the view was found and false otherwise. - void RunInPlatformView(uintptr_t view_id, - const char* main_script, - const char* packages_file, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name); + bool IsSetup() const; - void SetAssetBundlePathInPlatformView(uintptr_t view_id, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name); + Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, + bool base64_encode); private: - fxl::CommandLine command_line_; - std::unique_ptr gpu_thread_; - std::unique_ptr ui_thread_; - std::unique_ptr io_thread_; - std::unique_ptr gpu_thread_checker_; - std::unique_ptr ui_thread_checker_; - TracingController tracing_controller_; - mutable std::mutex platform_views_mutex_; - std::unordered_set platform_views_; - - static void Init(fxl::CommandLine command_line, - const std::string& bundle_path); - - Shell(fxl::CommandLine command_line); - - void InitGpuThread(); - - void InitUIThread(); - - void RunInPlatformViewUIThread(uintptr_t view_id, - const std::string& main, - const std::string& packages, - const std::string& assets_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch); - - void SetAssetBundlePathInPlatformViewUIThread( - uintptr_t view_id, - const std::string& main, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch); + using ServiceProtocolHandler = std::function; + + const blink::TaskRunners task_runners_; + const blink::Settings settings_; + fxl::RefPtr vm_; + std::unique_ptr platform_view_; // on platform task runner + std::unique_ptr engine_; // on UI task runner + std::unique_ptr rasterizer_; // on GPU task runner + std::unique_ptr io_manager_; // on IO task runner + + std::unordered_map, + ServiceProtocolHandler> // task-runner/function + // pair + > + service_protocol_handlers_; + bool is_setup_ = false; + + Shell(blink::TaskRunners task_runners, blink::Settings settings); + + static std::unique_ptr CreateShellOnPlatformThread( + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer); + + bool Setup(std::unique_ptr platform_view, + std::unique_ptr engine, + std::unique_ptr rasterizer, + std::unique_ptr io_manager); + + // |shell::PlatformView::Delegate| + void OnPlatformViewCreated(const PlatformView& view, + std::unique_ptr surface) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDestroyed(const PlatformView& view) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewSetViewportMetrics( + const PlatformView& view, + const blink::ViewportMetrics& metrics) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDispatchPlatformMessage( + const PlatformView& view, + fxl::RefPtr message) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDispatchPointerDataPacket( + const PlatformView& view, + std::unique_ptr packet) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDispatchSemanticsAction( + const PlatformView& view, + int32_t id, + blink::SemanticsAction action, + std::vector args) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, + bool enabled) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewRegisterTexture( + const PlatformView& view, + std::shared_ptr texture) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewUnregisterTexture(const PlatformView& view, + int64_t texture_id) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, + int64_t texture_id) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewSetNextFrameCallback(const PlatformView& view, + fxl::Closure closure) override; + + // |shell::Animator::Delegate| + void OnAnimatorBeginFrame(const Animator& animator, + fxl::TimePoint frame_time) override; + + // |shell::Animator::Delegate| + void OnAnimatorNotifyIdle(const Animator& animator, + int64_t deadline) override; + + // |shell::Animator::Delegate| + void OnAnimatorDraw( + const Animator& animator, + fxl::RefPtr> pipeline) override; + + // |shell::Animator::Delegate| + void OnAnimatorDrawLastLayerTree(const Animator& animator) override; + + // |shell::Engine::Delegate| + void OnEngineUpdateSemantics(const Engine& engine, + blink::SemanticsNodeUpdates update) override; + + // |shell::Engine::Delegate| + void OnEngineHandlePlatformMessage( + const Engine& engine, + fxl::RefPtr message) override; + + // |blink::ServiceProtocol::Handler| + fxl::RefPtr GetServiceProtocolHandlerTaskRunner( + fxl::StringView method) const override; + + // |blink::ServiceProtocol::Handler| + bool HandleServiceProtocolMessage( + fxl::StringView method, // one if the extension names specified above. + const ServiceProtocolMap& params, + rapidjson::Document& response) override; + + // |blink::ServiceProtocol::Handler| + blink::ServiceProtocol::Handler::Description GetServiceProtocolDescription() + const override; + + // Service protocol handler + bool OnServiceProtocolScreenshot( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolScreenshotSKP( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolRunInView( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolFlushUIThreadTasks( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolSetAssetBundlePath( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); FXL_DISALLOW_COPY_AND_ASSIGN(Shell); }; diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc new file mode 100644 index 0000000000000..67689341a1586 --- /dev/null +++ b/shell/common/shell_unittests.cc @@ -0,0 +1,133 @@ +// Copyright 2017 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 +#include +#include + +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/thread_host.h" +#include "gtest/gtest.h" +#include "lib/fxl/synchronization/waitable_event.h" + +#define CURRENT_TEST_NAME \ + std::string { \ + ::testing::UnitTest::GetInstance()->current_test_info()->name() \ + } + +namespace shell { + +TEST(ShellTest, InitializeWithInvalidThreads) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + blink::TaskRunners task_runners("test", nullptr, nullptr, nullptr, nullptr); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_FALSE(shell); +} + +TEST(ShellTest, InitializeWithDifferentThreads) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", + ThreadHost::Type::Platform | ThreadHost::Type::GPU | + ThreadHost::Type::IO | ThreadHost::Type::UI); + blink::TaskRunners task_runners("test", + thread_host.platform_thread->GetTaskRunner(), + thread_host.gpu_thread->GetTaskRunner(), + thread_host.ui_thread->GetTaskRunner(), + thread_host.io_thread->GetTaskRunner()); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +TEST(ShellTest, InitializeWithSingleThread) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", + ThreadHost::Type::Platform); + auto task_runner = thread_host.platform_thread->GetTaskRunner(); + blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, + task_runner); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +TEST(ShellTest, InitializeWithSingleThreadWhichIsTheCallingThread) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + fml::MessageLoop::EnsureInitializedForCurrentThread(); + auto task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); + blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, + task_runner); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +TEST(ShellTest, InitializeWithMultipleThreadButCallingThreadAsPlatformThread) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + ThreadHost thread_host( + "io.flutter.test." + CURRENT_TEST_NAME + ".", + ThreadHost::Type::GPU | ThreadHost::Type::IO | ThreadHost::Type::UI); + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::TaskRunners task_runners( + "test", fml::MessageLoop::GetCurrent().GetTaskRunner(), + thread_host.gpu_thread->GetTaskRunner(), + thread_host.ui_thread->GetTaskRunner(), + thread_host.io_thread->GetTaskRunner()); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +} // namespace shell diff --git a/shell/common/surface.cc b/shell/common/surface.cc index 01d288a5e5085..228647e8b3512 100644 --- a/shell/common/surface.cc +++ b/shell/common/surface.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "flutter/shell/common/surface.h" + #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" #include "third_party/skia/include/core/SkSurface.h" @@ -59,27 +60,22 @@ bool SurfaceFrame::PerformSubmit() { return false; } -Surface::Surface() : scale_(1.0) {} - -Surface::~Surface() = default; +Surface::Surface() : Surface(std::make_unique()) {} -bool Surface::SupportsScaling() const { - return false; +Surface::Surface(std::unique_ptr compositor_context) + : compositor_context_(std::move(compositor_context)) { + FXL_DCHECK(compositor_context_); + // TODO: Get rid of these explicit calls and move the logic to the c/dtors of + // the compositor context. + compositor_context_->OnGrContextCreated(); } -double Surface::GetScale() const { - return scale_; +Surface::~Surface() { + compositor_context_->OnGrContextDestroyed(); } -void Surface::SetScale(double scale) { - static constexpr double kMaxScale = 1.0; - static constexpr double kMinScale = 0.25; - if (scale > kMaxScale) { - scale = kMaxScale; - } else if (scale < kMinScale) { - scale = kMinScale; - } - scale_ = scale; +flow::CompositorContext& Surface::GetCompositorContext() { + return *compositor_context_; } } // namespace shell diff --git a/shell/common/surface.h b/shell/common/surface.h index 906480237f416..6133a7d519fff 100644 --- a/shell/common/surface.h +++ b/shell/common/surface.h @@ -7,7 +7,7 @@ #include -#include "lib/fxl/compiler_specific.h" +#include "flutter/flow/compositor_context.h" #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -45,6 +45,8 @@ class Surface { public: Surface(); + Surface(std::unique_ptr compositor_context); + virtual ~Surface(); virtual bool IsValid() = 0; @@ -53,14 +55,12 @@ class Surface { virtual GrContext* GetContext() = 0; - virtual bool SupportsScaling() const; - - double GetScale() const; - - void SetScale(double scale); + flow::CompositorContext& GetCompositorContext(); private: - double scale_; + std::unique_ptr compositor_context_; + + FXL_DISALLOW_COPY_AND_ASSIGN(Surface); }; } // namespace shell diff --git a/shell/common/switches.cc b/shell/common/switches.cc index c1c82ff166ac1..82da6ee180af8 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -90,4 +91,125 @@ const fxl::StringView FlagForSwitch(Switch swtch) { return fxl::StringView(); } +template +static bool GetSwitchValue(const fxl::CommandLine& command_line, + shell::Switch sw, + T* result) { + std::string switch_string; + + if (!command_line.GetOptionValue(shell::FlagForSwitch(sw), &switch_string)) { + return false; + } + + std::stringstream stream(switch_string); + T value = 0; + if (stream >> value) { + *result = value; + return true; + } + + return false; +} + +blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { + blink::Settings settings = {}; + + // Enable Observatory + settings.enable_observatory = + !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); + + // Set Observatory Port + if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { + if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, + &settings.observatory_port)) { + FXL_LOG(INFO) + << "Observatory port specified was malformed. Will default to " + << settings.observatory_port; + } + } + + // Checked mode overrides. + settings.dart_non_checked_mode = + command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); + + settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); + + settings.start_paused = + command_line.HasOption(FlagForSwitch(Switch::StartPaused)); + + settings.enable_dart_profiling = + command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); + + settings.enable_software_rendering = + command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); + + settings.using_blink = + command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); + + settings.endless_trace_buffer = + command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); + + settings.trace_startup = + command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); + + settings.skia_deterministic_rendering_on_cpu = + command_line.HasOption(FlagForSwitch(Switch::SkiaDeterministicRendering)); + + command_line.GetOptionValue(FlagForSwitch(Switch::FLX), &settings.flx_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir), + &settings.assets_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::Snapshot), + &settings.script_snapshot_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::MainDartFile), + &settings.main_dart_file_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::Packages), + &settings.packages_file_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), + &settings.aot_snapshot_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), + &settings.aot_vm_snapshot_data_filename); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), + &settings.aot_vm_snapshot_instr_filename); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), + &settings.aot_isolate_snapshot_data_filename); + + command_line.GetOptionValue( + FlagForSwitch(Switch::AotIsolateSnapshotInstructions), + &settings.aot_isolate_snapshot_instr_filename); + + command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), + &settings.temp_directory_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::ICUDataFilePath), + &settings.icu_data_path); + + settings.use_test_fonts = + command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); + + command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); + std::string all_dart_flags; + if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), + &all_dart_flags)) { + std::stringstream stream(all_dart_flags); + std::istream_iterator end; + for (std::istream_iterator it(stream); it != end; ++it) + settings.dart_flags.push_back(*it); + } + +#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE + settings.trace_skia = + command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); +#endif + + return settings; +} + } // namespace shell diff --git a/shell/common/switches.h b/shell/common/switches.h index 91778a78e92cc..6b67b1f6a1567 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "flutter/common/settings.h" +#include "lib/fxl/command_line.h" #include "lib/fxl/strings/string_view.h" #ifndef SHELL_COMMON_SWITCHES_H_ @@ -23,12 +25,29 @@ namespace shell { DEF_SWITCHES_START DEF_SWITCH(AotSharedLibraryPath, "aot-shared-library-path", "Path to the *.so.") -DEF_SWITCH(AotSnapshotPath, "aot-snapshot-path", "Path to the AOT snapshot.") -DEF_SWITCH(AotVmSnapshotData, "vm-snapshot-data", "") -DEF_SWITCH(AotVmSnapshotInstructions, "vm-snapshot-instr", "") -DEF_SWITCH(AotIsolateSnapshotData, "isolate-snapshot-data", "") -DEF_SWITCH(AotIsolateSnapshotInstructions, "isolate-snapshot-instr", "") +DEF_SWITCH(AotSnapshotPath, + "aot-snapshot-path", + "Path to the directory containing the four files specified by " + "AotVmSnapshotData, AotVmSnapshotInstructions, " + "AotVmSnapshotInstructions and AotIsolateSnapshotInstructions.") +DEF_SWITCH(AotVmSnapshotData, + "vm-snapshot-data", + "The VM snapshot data that will be memory mapped as read-only. " + "AotSnapshotPath must be present.") +DEF_SWITCH(AotVmSnapshotInstructions, + "vm-snapshot-instr", + "The VM instructions snapshot that will be memory mapped as read " + "and executable. AotSnapshotPath must be present.") +DEF_SWITCH(AotIsolateSnapshotData, + "isolate-snapshot-data", + "The isolate snapshot data that will be memory mapped as read-only. " + "AotSnapshotPath must be present.") +DEF_SWITCH(AotIsolateSnapshotInstructions, + "isolate-snapshot-instr", + "The isolate instructions snapshot that will be memory mapped as " + "read and executable. AotSnapshotPath must be present.") DEF_SWITCH(CacheDirPath, "cache-dir-path", "Path to the cache directory.") +DEF_SWITCH(ICUDataFilePath, "icu-data-file-path", "Path to the ICU data file.") DEF_SWITCH(DartFlags, "dart-flags", "Flags passed directly to the Dart VM without being interpreted " @@ -73,10 +92,6 @@ DEF_SWITCH(FlutterAssetsDir, DEF_SWITCH(Help, "help", "Display this help text.") DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.") DEF_SWITCH(MainDartFile, "dart-main", "The path to the main Dart file.") -DEF_SWITCH(NonInteractive, - "non-interactive", - "Make the shell non-interactive. By default, the shell attempts " - "to setup a window and create an OpenGL context.") DEF_SWITCH(Packages, "packages", "Specify the path to the packages.") DEF_SWITCH(Snapshot, "snapshot-blob", "Specify the path to the snapshot blob") DEF_SWITCH(StartPaused, @@ -113,7 +128,9 @@ DEF_SWITCHES_END void PrintUsage(const std::string& executable_name); -const fxl::StringView FlagForSwitch(Switch sw); +const fxl::StringView FlagForSwitch(Switch swtch); + +blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line); } // namespace shell diff --git a/shell/common/thread_host.cc b/shell/common/thread_host.cc new file mode 100644 index 0000000000000..f35594829d5d9 --- /dev/null +++ b/shell/common/thread_host.cc @@ -0,0 +1,38 @@ +// Copyright 2017 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/shell/common/thread_host.h" + +namespace shell { + +ThreadHost::ThreadHost() = default; + +ThreadHost::ThreadHost(std::string name_prefix, uint64_t mask) { + if (mask & ThreadHost::Type::Platform) { + platform_thread = std::make_unique(name_prefix + ".platform"); + } + + if (mask & ThreadHost::Type::UI) { + ui_thread = std::make_unique(name_prefix + ".ui"); + } + + if (mask & ThreadHost::Type::GPU) { + gpu_thread = std::make_unique(name_prefix + ".gpu"); + } + + if (mask & ThreadHost::Type::IO) { + io_thread = std::make_unique(name_prefix + ".io"); + } +} + +ThreadHost::~ThreadHost() = default; + +void ThreadHost::Reset() { + platform_thread.reset(); + ui_thread.reset(); + gpu_thread.reset(); + io_thread.reset(); +} + +} // namespace shell diff --git a/shell/common/thread_host.h b/shell/common/thread_host.h new file mode 100644 index 0000000000000..a688aa6a06a85 --- /dev/null +++ b/shell/common/thread_host.h @@ -0,0 +1,43 @@ +// Copyright 2017 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_SHELL_COMMON_THREAD_HOST_H_ +#define FLUTTER_SHELL_COMMON_THREAD_HOST_H_ + +#include + +#include "flutter/fml/thread.h" +#include "lib/fxl/macros.h" + +namespace shell { + +struct ThreadHost { + enum Type { + Platform = 1 << 0, + UI = 1 << 1, + GPU = 1 << 2, + IO = 1 << 3, + }; + + std::unique_ptr platform_thread; + std::unique_ptr ui_thread; + std::unique_ptr gpu_thread; + std::unique_ptr io_thread; + + ThreadHost(); + + ThreadHost(ThreadHost&&) = default; + + ThreadHost& operator=(ThreadHost&&) = default; + + ThreadHost(std::string name_prefix, uint64_t type_mask); + + ~ThreadHost(); + + void Reset(); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_THREAD_HOST_H_ diff --git a/shell/common/tracing_controller.cc b/shell/common/tracing_controller.cc deleted file mode 100644 index 6fa8d9d5ee87f..0000000000000 --- a/shell/common/tracing_controller.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/common/tracing_controller.h" - -#include - -#include "flutter/common/threads.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/shell/common/shell.h" -#include "lib/fxl/logging.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace shell { - -TracingController::TracingController() : tracing_active_(false) { - blink::SetEmbedderTracingCallbacks( - std::unique_ptr( - new blink::EmbedderTracingCallbacks([this]() { StartTracing(); }, - [this]() { StopTracing(); }))); -} - -TracingController::~TracingController() { - blink::SetEmbedderTracingCallbacks(nullptr); -} - -static void AddTraceMetadata() { - blink::Threads::Gpu()->PostTask([]() { Dart_SetThreadName("gpu_thread"); }); - blink::Threads::UI()->PostTask([]() { Dart_SetThreadName("ui_thread"); }); - blink::Threads::IO()->PostTask([]() { Dart_SetThreadName("io_thread"); }); - blink::Threads::Platform()->PostTask( - []() { Dart_SetThreadName("platform_thread"); }); -} - -void TracingController::StartTracing() { - if (tracing_active_) - return; - tracing_active_ = true; - AddTraceMetadata(); -} - -void TracingController::StopTracing() { - if (!tracing_active_) { - return; - } - tracing_active_ = false; -} - -} // namespace shell diff --git a/shell/common/tracing_controller.h b/shell/common/tracing_controller.h deleted file mode 100644 index 3f9e6f03ab14c..0000000000000 --- a/shell/common/tracing_controller.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_COMMON_TRACING_CONTROLLER_H_ -#define SHELL_COMMON_TRACING_CONTROLLER_H_ - -#include - -#include "lib/fxl/macros.h" - -namespace shell { - -class TracingController { - public: - TracingController(); - - ~TracingController(); - - void StartTracing(); - - void StopTracing(); - - bool tracing_active() const { return tracing_active_; } - - private: - bool tracing_active_; - - FXL_DISALLOW_COPY_AND_ASSIGN(TracingController); -}; - -} // namespace shell - -#endif // SHELL_COMMON_TRACING_CONTROLLER_H_ diff --git a/shell/common/vsync_waiter.cc b/shell/common/vsync_waiter.cc index 5acc235b1f68d..ba2f21c389c11 100644 --- a/shell/common/vsync_waiter.cc +++ b/shell/common/vsync_waiter.cc @@ -4,8 +4,45 @@ #include "flutter/shell/common/vsync_waiter.h" +#include "flutter/fml/task_runner.h" +#include "flutter/fml/trace_event.h" + namespace shell { +VsyncWaiter::VsyncWaiter(blink::TaskRunners task_runners) + : task_runners_(std::move(task_runners)) {} + VsyncWaiter::~VsyncWaiter() = default; +void VsyncWaiter::AsyncWaitForVsync(Callback callback) { + { + std::lock_guard lock(callback_mutex_); + callback_ = std::move(callback); + } + AwaitVSync(); +} + +void VsyncWaiter::FireCallback(fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { + Callback callback; + + { + std::lock_guard lock(callback_mutex_); + callback = std::move(callback_); + } + + if (!callback) { + return; + } + + task_runners_.GetUITaskRunner()->PostTask( + [callback, frame_start_time, frame_target_time]() { + // Note: The tag name must be "VSYNC" (it is special) so that the + // "Highlight + // Vsync" checkbox in the timeline can be enabled. + TRACE_EVENT0("flutter", "VSYNC"); + callback(frame_start_time, frame_target_time); + }); +} + } // namespace shell diff --git a/shell/common/vsync_waiter.h b/shell/common/vsync_waiter.h index 77319ed8b6966..82231fdf4f853 100644 --- a/shell/common/vsync_waiter.h +++ b/shell/common/vsync_waiter.h @@ -6,7 +6,10 @@ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_H_ #include +#include +#include +#include "flutter/common/task_runners.h" #include "lib/fxl/time/time_point.h" namespace shell { @@ -16,9 +19,23 @@ class VsyncWaiter { using Callback = std::function; - virtual void AsyncWaitForVsync(Callback callback) = 0; - virtual ~VsyncWaiter(); + + void AsyncWaitForVsync(Callback callback); + + protected: + const blink::TaskRunners task_runners_; + std::mutex callback_mutex_; + Callback callback_; + + VsyncWaiter(blink::TaskRunners task_runners); + + virtual void AwaitVSync() = 0; + + void FireCallback(fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time); + + FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiter); }; } // namespace shell diff --git a/shell/common/vsync_waiter_fallback.cc b/shell/common/vsync_waiter_fallback.cc index 01c86cdedc6aa..bcf061bb7615f 100644 --- a/shell/common/vsync_waiter_fallback.cc +++ b/shell/common/vsync_waiter_fallback.cc @@ -4,7 +4,6 @@ #include "flutter/shell/common/vsync_waiter_fallback.h" -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { @@ -21,28 +20,25 @@ fxl::TimePoint SnapToNextTick(fxl::TimePoint value, } // namespace -VsyncWaiterFallback::VsyncWaiterFallback() - : phase_(fxl::TimePoint::Now()), weak_factory_(this) {} +VsyncWaiterFallback::VsyncWaiterFallback(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)), + phase_(fxl::TimePoint::Now()), + weak_factory_(this) {} VsyncWaiterFallback::~VsyncWaiterFallback() = default; constexpr fxl::TimeDelta interval = fxl::TimeDelta::FromSecondsF(1.0 / 60.0); -void VsyncWaiterFallback::AsyncWaitForVsync(Callback callback) { - FXL_DCHECK(!callback_); - callback_ = std::move(callback); - +void VsyncWaiterFallback::AwaitVSync() { fxl::TimePoint now = fxl::TimePoint::Now(); fxl::TimePoint next = SnapToNextTick(now, phase_, interval); - blink::Threads::UI()->PostDelayedTask( + task_runners_.GetUITaskRunner()->PostDelayedTask( [self = weak_factory_.GetWeakPtr()] { - if (!self) - return; - fxl::TimePoint frame_time = fxl::TimePoint::Now(); - Callback callback = std::move(self->callback_); - self->callback_ = Callback(); - callback(frame_time, frame_time + interval); + if (self) { + const auto frame_time = fxl::TimePoint::Now(); + self->FireCallback(frame_time, frame_time + interval); + } }, next - now); } diff --git a/shell/common/vsync_waiter_fallback.h b/shell/common/vsync_waiter_fallback.h index bfb7e118b1330..d3cc8faaf6ce7 100644 --- a/shell/common/vsync_waiter_fallback.h +++ b/shell/common/vsync_waiter_fallback.h @@ -5,25 +5,24 @@ #ifndef FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "lib/fxl/time/time_point.h" namespace shell { -class VsyncWaiterFallback : public VsyncWaiter { +class VsyncWaiterFallback final : public VsyncWaiter { public: - VsyncWaiterFallback(); - ~VsyncWaiterFallback() override; + VsyncWaiterFallback(blink::TaskRunners task_runners); - void AsyncWaitForVsync(Callback callback) override; + ~VsyncWaiterFallback() override; private: fxl::TimePoint phase_; - Callback callback_; + fxl::WeakPtrFactory weak_factory_; - fml::WeakPtrFactory weak_factory_; + void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback); }; diff --git a/shell/gpu/BUILD.gn b/shell/gpu/BUILD.gn index c050e120b0a10..cd093e1238f7f 100644 --- a/shell/gpu/BUILD.gn +++ b/shell/gpu/BUILD.gn @@ -6,14 +6,17 @@ import("$flutter_root/shell/config.gni") source_set("gpu") { sources = [ - "gpu_rasterizer.cc", - "gpu_rasterizer.h", - "gpu_surface_gl.cc", - "gpu_surface_gl.h", "gpu_surface_software.cc", "gpu_surface_software.h", ] + if (!is_fuchsia) { + sources += [ + "gpu_surface_gl.cc", + "gpu_surface_gl.h", + ] + } + if (shell_enable_vulkan) { sources += [ "gpu_surface_vulkan.cc", diff --git a/shell/gpu/gpu_rasterizer.cc b/shell/gpu/gpu_rasterizer.cc deleted file mode 100644 index 3424f989b3205..0000000000000 --- a/shell/gpu/gpu_rasterizer.cc +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2015 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. - -#include "gpu_rasterizer.h" - -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/glue/trace_event.h" -#include "flutter/shell/common/picture_serializer.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "third_party/skia/include/core/SkPicture.h" - -namespace shell { - -GPURasterizer::GPURasterizer(std::unique_ptr info) - : compositor_context_(std::move(info)), weak_factory_(this) {} - -GPURasterizer::~GPURasterizer() = default; - -fml::WeakPtr GPURasterizer::GetWeakRasterizerPtr() { - return weak_factory_.GetWeakPtr(); -} - -void GPURasterizer::Setup(std::unique_ptr surface, - fxl::Closure continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) { - surface_ = std::move(surface); - compositor_context_.OnGrContextCreated(); - - continuation(); - - setup_completion_event->Signal(); -} - -void GPURasterizer::Clear(SkColor color, const SkISize& size) { - if (surface_ == nullptr) { - return; - } - - auto frame = surface_->AcquireFrame(size); - - if (frame == nullptr) { - return; - } - - SkCanvas* canvas = frame->SkiaCanvas(); - - if (canvas == nullptr) { - return; - } - - canvas->clear(color); - - frame->Submit(); -} - -void GPURasterizer::Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) { - compositor_context_.OnGrContextDestroyed(); - if (surface_) { - surface_.reset(); - } - last_layer_tree_.reset(); - teardown_completion_event->Signal(); -} - -flow::LayerTree* GPURasterizer::GetLastLayerTree() { - return last_layer_tree_.get(); -} - -void GPURasterizer::DrawLastLayerTree() { - if (!last_layer_tree_ || !surface_) { - return; - } - DrawToSurface(*last_layer_tree_); -} - -flow::TextureRegistry& GPURasterizer::GetTextureRegistry() { - return compositor_context_.texture_registry(); -} - -void GPURasterizer::Draw( - fxl::RefPtr> pipeline) { - TRACE_EVENT0("flutter", "GPURasterizer::Draw"); - - flutter::Pipeline::Consumer consumer = - std::bind(&GPURasterizer::DoDraw, this, std::placeholders::_1); - - // Consume as many pipeline items as possible. But yield the event loop - // between successive tries. - switch (pipeline->Consume(consumer)) { - case flutter::PipelineConsumeResult::MoreAvailable: { - auto weak_this = weak_factory_.GetWeakPtr(); - blink::Threads::Gpu()->PostTask([weak_this, pipeline]() { - if (weak_this) { - weak_this->Draw(pipeline); - } - }); - break; - } - default: - break; - } -} - -void GPURasterizer::DoDraw(std::unique_ptr layer_tree) { - if (!layer_tree || !surface_) { - return; - } - - // There is no way for the compositor to know how long the layer tree - // construction took. Fortunately, the layer tree does. Grab that time - // for instrumentation. - compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); - - DrawToSurface(*layer_tree); - - NotifyNextFrameOnce(); - - last_layer_tree_ = std::move(layer_tree); -} - -void GPURasterizer::DrawToSurface(flow::LayerTree& layer_tree) { - auto frame = surface_->AcquireFrame(layer_tree.frame_size()); - - if (frame == nullptr) { - return; - } - - auto canvas = frame->SkiaCanvas(); - - if (canvas == nullptr) { - return; - } - - auto compositor_frame = - compositor_context_.AcquireFrame(surface_->GetContext(), canvas); - - canvas->clear(SK_ColorBLACK); - - layer_tree.Raster(compositor_frame); - - frame->Submit(); -} - -void GPURasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { - nextFrameCallback_ = nextFrameCallback; -} - -void GPURasterizer::NotifyNextFrameOnce() { - if (nextFrameCallback_) { - blink::Threads::Platform()->PostTask([callback = nextFrameCallback_] { - TRACE_EVENT0("flutter", "GPURasterizer::NotifyNextFrameOnce"); - callback(); - }); - nextFrameCallback_ = nullptr; - } -} - -void GPURasterizer::SetTextureRegistry(flow::TextureRegistry* textureRegistry) { - compositor_context_.SetTextureRegistry(textureRegistry); -} - -} // namespace shell diff --git a/shell/gpu/gpu_rasterizer.h b/shell/gpu/gpu_rasterizer.h deleted file mode 100644 index ad16ee2c47989..0000000000000 --- a/shell/gpu/gpu_rasterizer.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ -#define SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ - -#include "flutter/flow/compositor_context.h" -#include "flutter/shell/common/rasterizer.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/fxl/synchronization/waitable_event.h" - -namespace shell { - -class Surface; - -class GPURasterizer : public Rasterizer { - public: - GPURasterizer(std::unique_ptr info); - - ~GPURasterizer() override; - - void Setup(std::unique_ptr surface, - fxl::Closure continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) override; - - void Clear(SkColor color, const SkISize& size) override; - - void Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) override; - - fml::WeakPtr GetWeakRasterizerPtr() override; - - flow::LayerTree* GetLastLayerTree() override; - - void DrawLastLayerTree() override; - - flow::TextureRegistry& GetTextureRegistry() override; - - void Draw(fxl::RefPtr> pipeline) override; - - // Set a callback to be called once when the next frame is drawn. - void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; - - void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; - - private: - std::unique_ptr surface_; - flow::CompositorContext compositor_context_; - std::unique_ptr last_layer_tree_; - // A closure to be called when the underlaying surface presents a frame the - // next time. NULL if there is no callback or the callback was set back to - // NULL after being called. - fxl::Closure nextFrameCallback_; - fml::WeakPtrFactory weak_factory_; - - void DoDraw(std::unique_ptr layer_tree); - - void DrawToSurface(flow::LayerTree& layer_tree); - - void NotifyNextFrameOnce(); - - FXL_DISALLOW_COPY_AND_ASSIGN(GPURasterizer); -}; - -} // namespace shell - -#endif // SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 331fd188a9ed3..284a10e413b46 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -72,6 +72,8 @@ GPUSurfaceGL::~GPUSurfaceGL() { return; } + GetCompositorContext().OnGrContextDestroyed(); + onscreen_surface_ = nullptr; context_->releaseResourcesAndAbandonContext(); context_ = nullptr; @@ -210,12 +212,11 @@ std::unique_ptr GPUSurfaceGL::AcquireFrame(const SkISize& size) { return nullptr; } - auto weak_this = weak_factory_.GetWeakPtr(); - - SurfaceFrame::SubmitCallback submit_callback = - [weak_this](const SurfaceFrame& surface_frame, SkCanvas* canvas) { - return weak_this ? weak_this->PresentSurface(canvas) : false; - }; + SurfaceFrame::SubmitCallback submit_callback = [weak = weak_factory_ + .GetWeakPtr()]( + const SurfaceFrame& surface_frame, SkCanvas* canvas) { + return weak ? weak->PresentSurface(canvas) : false; + }; return std::make_unique(surface, submit_callback); } diff --git a/shell/gpu/gpu_surface_gl.h b/shell/gpu/gpu_surface_gl.h index 5cf092dae66c5..abc9f46aee297 100644 --- a/shell/gpu/gpu_surface_gl.h +++ b/shell/gpu/gpu_surface_gl.h @@ -5,10 +5,9 @@ #ifndef SHELL_GPU_GPU_SURFACE_GL_H_ #define SHELL_GPU_GPU_SURFACE_GL_H_ -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" -#include "flutter/synchronization/debug_thread_checker.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { @@ -44,7 +43,7 @@ class GPUSurfaceGL : public Surface { sk_sp onscreen_surface_; sk_sp offscreen_surface_; bool valid_ = false; - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; bool CreateOrUpdateSurfaces(const SkISize& size); diff --git a/shell/gpu/gpu_surface_software.cc b/shell/gpu/gpu_surface_software.cc index e340e605652dd..ea8c827b22405 100644 --- a/shell/gpu/gpu_surface_software.cc +++ b/shell/gpu/gpu_surface_software.cc @@ -18,20 +18,13 @@ bool GPUSurfaceSoftware::IsValid() { return delegate_ != nullptr; } -bool GPUSurfaceSoftware::SupportsScaling() const { - return true; -} - std::unique_ptr GPUSurfaceSoftware::AcquireFrame( const SkISize& logical_size) { if (!IsValid()) { return nullptr; } - // Check if we need to support surface scaling. - const auto scale = SupportsScaling() ? GetScale() : 1.0; - const auto size = SkISize::Make(logical_size.width() * scale, - logical_size.height() * scale); + const auto size = SkISize::Make(logical_size.width(), logical_size.height()); sk_sp backing_store = delegate_->AcquireBackingStore(size); @@ -48,12 +41,10 @@ std::unique_ptr GPUSurfaceSoftware::AcquireFrame( // irrespective of surface scaling. SkCanvas* canvas = backing_store->getCanvas(); canvas->resetMatrix(); - canvas->scale(scale, scale); - SurfaceFrame::SubmitCallback - on_submit = [self = weak_factory_.GetWeakPtr()]( - const SurfaceFrame& surface_frame, SkCanvas* canvas) - ->bool { + SurfaceFrame::SubmitCallback on_submit = + [self = weak_factory_.GetWeakPtr()](const SurfaceFrame& surface_frame, + SkCanvas* canvas) -> bool { // If the surface itself went away, there is nothing more to do. if (!self || !self->IsValid() || canvas == nullptr) { return false; diff --git a/shell/gpu/gpu_surface_software.h b/shell/gpu/gpu_surface_software.h index f7312153db8bc..238754f312b80 100644 --- a/shell/gpu/gpu_surface_software.h +++ b/shell/gpu/gpu_surface_software.h @@ -5,9 +5,9 @@ #ifndef FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkSurface.h" namespace shell { @@ -30,12 +30,9 @@ class GPUSurfaceSoftware : public Surface { GrContext* GetContext() override; - bool SupportsScaling() const override; - private: GPUSurfaceSoftwareDelegate* delegate_; - - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceSoftware); }; diff --git a/shell/gpu/gpu_surface_vulkan.h b/shell/gpu/gpu_surface_vulkan.h index eafed43a6296d..f1e25fbe987b8 100644 --- a/shell/gpu/gpu_surface_vulkan.h +++ b/shell/gpu/gpu_surface_vulkan.h @@ -6,11 +6,12 @@ #define SHELL_GPU_GPU_SURFACE_VULKAN_H_ #include -#include "flutter/fml/memory/weak_ptr.h" + #include "flutter/shell/common/surface.h" #include "flutter/vulkan/vulkan_native_surface.h" #include "flutter/vulkan/vulkan_window.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -29,7 +30,7 @@ class GPUSurfaceVulkan : public Surface { private: vulkan::VulkanWindow window_; - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan); }; diff --git a/shell/platform/BUILD.gn b/shell/platform/BUILD.gn index 4b1e1a9e0bfeb..ae3b1003f22fe 100644 --- a/shell/platform/BUILD.gn +++ b/shell/platform/BUILD.gn @@ -13,13 +13,11 @@ group("platform") { ] } else if (is_linux) { deps = [ - "linux", "embedder", ] } else if (is_win) { - deps = [ - "win" - ] + # There is no platform target on windows. Instead, only a tester is used. + deps = [] } else { assert(false, "Unknown/Unsupported platform.") } diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index d9744ad890caa..129c877faed0f 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -17,21 +17,25 @@ shared_library("flutter_shell_native") { "android_context_gl.h", "android_environment_gl.cc", "android_environment_gl.h", - "android_external_texture_gl.h", "android_external_texture_gl.cc", + "android_external_texture_gl.h", "android_native_window.cc", "android_native_window.h", + "android_shell_holder.cc", + "android_shell_holder.h", "android_surface.cc", "android_surface.h", "android_surface_gl.cc", "android_surface_gl.h", - "android_surface_software.h", "android_surface_software.cc", - "apk_asset_provider.h", + "android_surface_software.h", "apk_asset_provider.cc", + "apk_asset_provider.h", "flutter_main.cc", "flutter_main.h", "library_loader.cc", + "platform_message_response_android.cc", + "platform_message_response_android.h", "platform_view_android.cc", "platform_view_android.h", "platform_view_android_jni.cc", @@ -41,10 +45,10 @@ shared_library("flutter_shell_native") { ] deps = [ + "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/assets", "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/shell/common", @@ -59,9 +63,7 @@ shared_library("flutter_shell_native") { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] defines = [] diff --git a/shell/platform/android/android_context_gl.cc b/shell/platform/android/android_context_gl.cc index f54629f8644b9..6338dc96908e1 100644 --- a/shell/platform/android/android_context_gl.cc +++ b/shell/platform/android/android_context_gl.cc @@ -3,9 +3,13 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_context_gl.h" + #include + #include +#include "flutter/fml/trace_event.h" + namespace shell { template @@ -65,19 +69,17 @@ static EGLResult CreateContext(EGLDisplay display, return {context != EGL_NO_CONTEXT, context}; } -static EGLResult ChooseEGLConfiguration( - EGLDisplay display, - PlatformView::SurfaceConfig config) { +static EGLResult ChooseEGLConfiguration(EGLDisplay display) { EGLint attributes[] = { // clang-format off EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RED_SIZE, config.red_bits, - EGL_GREEN_SIZE, config.green_bits, - EGL_BLUE_SIZE, config.blue_bits, - EGL_ALPHA_SIZE, config.alpha_bits, - EGL_DEPTH_SIZE, config.depth_bits, - EGL_STENCIL_SIZE, config.stencil_bits, + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_ALPHA_SIZE, 8, + EGL_DEPTH_SIZE, 0, + EGL_STENCIL_SIZE, 0, EGL_NONE, // termination sentinel // clang-format on }; @@ -142,7 +144,6 @@ bool AndroidContextGL::CreatePBufferSurface() { } AndroidContextGL::AndroidContextGL(fxl::RefPtr env, - PlatformView::SurfaceConfig config, const AndroidContextGL* share_context) : environment_(env), window_(nullptr), @@ -158,8 +159,7 @@ AndroidContextGL::AndroidContextGL(fxl::RefPtr env, // Choose a valid configuration. - std::tie(success, config_) = - ChooseEGLConfiguration(environment_->Display(), config); + std::tie(success, config_) = ChooseEGLConfiguration(environment_->Display()); if (!success) { FXL_LOG(ERROR) << "Could not choose an EGL configuration."; diff --git a/shell/platform/android/android_context_gl.h b/shell/platform/android/android_context_gl.h index 207f621c66bd1..b29851b34564d 100644 --- a/shell/platform/android/android_context_gl.h +++ b/shell/platform/android/android_context_gl.h @@ -44,7 +44,6 @@ class AndroidContextGL : public fxl::RefCountedThreadSafe { bool valid_; AndroidContextGL(fxl::RefPtr env, - PlatformView::SurfaceConfig config, const AndroidContextGL* share_context = nullptr); ~AndroidContextGL(); diff --git a/shell/platform/android/android_external_texture_gl.cc b/shell/platform/android/android_external_texture_gl.cc index 02a40c22474a1..35db9cbbfdb95 100644 --- a/shell/platform/android/android_external_texture_gl.cc +++ b/shell/platform/android/android_external_texture_gl.cc @@ -5,7 +5,7 @@ #include "flutter/shell/platform/android/android_external_texture_gl.h" #include -#include "flutter/common/threads.h" + #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "third_party/skia/include/gpu/GrTexture.h" @@ -19,17 +19,14 @@ AndroidExternalTextureGL::AndroidExternalTextureGL( AndroidExternalTextureGL::~AndroidExternalTextureGL() = default; void AndroidExternalTextureGL::OnGrContextCreated() { - ASSERT_IS_GPU_THREAD; state_ = AttachmentState::uninitialized; } void AndroidExternalTextureGL::MarkNewFrameAvailable() { - ASSERT_IS_GPU_THREAD; new_frame_ready_ = true; } void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { - ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::detached) { return; } @@ -42,7 +39,8 @@ void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { Update(); new_frame_ready_ = false; } - GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, GL_RGBA8_OES}; + GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, + GL_RGBA8_OES}; GrBackendTexture backendTexture(1, 1, GrMipMapped::kNo, textureInfo); sk_sp image = SkImage::MakeFromTexture( canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, @@ -82,7 +80,6 @@ void AndroidExternalTextureGL::UpdateTransform() { } void AndroidExternalTextureGL::OnGrContextDestroyed() { - ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::attached) { Detach(); } diff --git a/shell/platform/android/android_external_texture_gl.h b/shell/platform/android/android_external_texture_gl.h index df890b91c827f..67d6541d964c2 100644 --- a/shell/platform/android/android_external_texture_gl.h +++ b/shell/platform/android/android_external_texture_gl.h @@ -25,8 +25,7 @@ class AndroidExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; - // Called on GPU thread. - void MarkNewFrameAvailable(); + void MarkNewFrameAvailable() override; private: void Attach(jint textureName); diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc new file mode 100644 index 0000000000000..7dc454f1fb74a --- /dev/null +++ b/shell/platform/android/android_shell_holder.cc @@ -0,0 +1,169 @@ +// Copyright 2018 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/shell/platform/android/android_shell_holder.h" + +#include +#include + +#include +#include +#include + +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/platform/android/platform_view_android.h" +#include "lib/fxl/functional/make_copyable.h" + +namespace shell { + +AndroidShellHolder::AndroidShellHolder( + blink::Settings settings, + fml::jni::JavaObjectWeakGlobalRef java_object) + : settings_(std::move(settings)), java_object_(java_object) { + static size_t shell_count = 1; + auto thread_label = std::to_string(shell_count++); + + thread_host_ = {thread_label, ThreadHost::Type::UI | ThreadHost::Type::GPU | + ThreadHost::Type::IO}; + + fml::WeakPtr weak_platform_view; + Shell::CreateCallback on_create_platform_view = + [java_object, &weak_platform_view](Shell& shell) { + auto platform_view_android = std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + java_object, // java object handle for JNI interop + shell.GetSettings() + .enable_software_rendering // use software rendering + ); + weak_platform_view = platform_view_android->GetWeakPtr(); + return platform_view_android; + }; + + Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // The current thread will be used as the platform thread. Ensure that the + // message loop is initialized. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + blink::TaskRunners task_runners( + thread_label, // label + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + thread_host_.gpu_thread->GetTaskRunner(), // gpu + thread_host_.ui_thread->GetTaskRunner(), // ui + thread_host_.io_thread->GetTaskRunner() // io + ); + + shell_ = + Shell::Create(task_runners, // task runners + settings_, // settings + on_create_platform_view, // platform view create callback + on_create_rasterizer // rasterizer create callback + ); + + platform_view_ = weak_platform_view; + FXL_DCHECK(platform_view_); + + is_valid_ = shell_ != nullptr; + + if (is_valid_) { + task_runners.GetGPUTaskRunner()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); + task_runners.GetUITaskRunner()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); + } +} + +AndroidShellHolder::~AndroidShellHolder() = default; + +bool AndroidShellHolder::IsValid() const { + return is_valid_; +} + +const blink::Settings& AndroidShellHolder::GetSettings() const { + return settings_; +} + +void AndroidShellHolder::Launch(RunConfiguration config) { + if (!IsValid()) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = shell_->GetEngine(), // + config = std::move(config) // + ]() mutable { + if (engine) { + if (!engine->Run(std::move(config))) { + FXL_LOG(ERROR) << "Could not launch engine in configuration."; + } + } + })); +} + +void AndroidShellHolder::SetViewportMetrics( + const blink::ViewportMetrics& metrics) { + if (!IsValid()) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), metrics]() { + if (engine) { + engine->SetViewportMetrics(metrics); + } + }); +} + +void AndroidShellHolder::DispatchPointerDataPacket( + std::unique_ptr packet) { + if (!IsValid()) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = shell_->GetEngine(), packet = std::move(packet)] { + if (engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); +} + +Rasterizer::Screenshot AndroidShellHolder::Screenshot( + Rasterizer::ScreenshotType type, + bool base64_encode) { + if (!IsValid()) { + return {nullptr, SkISize::MakeEmpty()}; + } + return shell_->Screenshot(type, base64_encode); +} + +fml::WeakPtr AndroidShellHolder::GetPlatformView() { + FXL_DCHECK(platform_view_); + return platform_view_; +} + +void AndroidShellHolder::UpdateAssetManager( + fxl::RefPtr asset_manager) { + if (!IsValid() || !asset_manager) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), + asset_manager = std::move(asset_manager)]() { + if (engine) { + if (!engine->UpdateAssetManager(std::move(asset_manager))) { + FXL_DLOG(ERROR) << "Could not update asset asset manager."; + } + } + }); +} + +} // namespace shell diff --git a/shell/platform/android/android_shell_holder.h b/shell/platform/android/android_shell_holder.h new file mode 100644 index 0000000000000..e0905f0f9e42e --- /dev/null +++ b/shell/platform/android/android_shell_holder.h @@ -0,0 +1,59 @@ +// Copyright 2018 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_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ + +#include + +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/shell/common/run_configuration.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/android/platform_view_android.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class AndroidShellHolder { + public: + AndroidShellHolder(blink::Settings settings, + fml::jni::JavaObjectWeakGlobalRef java_object); + + ~AndroidShellHolder(); + + bool IsValid() const; + + void Launch(RunConfiguration configuration); + + void SetViewportMetrics(const blink::ViewportMetrics& metrics); + + void DispatchPointerDataPacket( + std::unique_ptr packet); + + const blink::Settings& GetSettings() const; + + fml::WeakPtr GetPlatformView(); + + Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, + bool base64_encode); + + void UpdateAssetManager(fxl::RefPtr asset_manager); + + private: + const blink::Settings settings_; + const fml::jni::JavaObjectWeakGlobalRef java_object_; + fml::WeakPtr platform_view_; + ThreadHost thread_host_; + std::unique_ptr shell_; + bool is_valid_ = false; + + FXL_DISALLOW_COPY_AND_ASSIGN(AndroidShellHolder); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ diff --git a/shell/platform/android/android_surface.cc b/shell/platform/android/android_surface.cc index 4dd08609da370..a8b41bacbf7c5 100644 --- a/shell/platform/android/android_surface.cc +++ b/shell/platform/android/android_surface.cc @@ -4,8 +4,32 @@ #include "flutter/shell/platform/android/android_surface.h" +#include + +#include "flutter/shell/platform/android/android_surface_gl.h" +#include "flutter/shell/platform/android/android_surface_software.h" +#if SHELL_ENABLE_VULKAN +#include "flutter/shell/platform/android/android_surface_vulkan.h" +#endif // SHELL_ENABLE_VULKAN + namespace shell { +std::unique_ptr AndroidSurface::Create( + bool use_software_rendering) { + if (use_software_rendering) { + auto software_surface = std::make_unique(); + return software_surface->IsValid() ? std::move(software_surface) : nullptr; + } +#if SHELL_ENABLE_VULKAN + auto vulkan_surface = std::make_unique(); + return vulkan_surface->IsValid() ? std::move(vulkan_surface) : nullptr; +#else // SHELL_ENABLE_VULKAN + auto gl_surface = std::make_unique(); + return gl_surface->IsOffscreenContextValid() ? std::move(gl_surface) + : nullptr; +#endif // SHELL_ENABLE_VULKAN +} + AndroidSurface::~AndroidSurface() = default; } // namespace shell diff --git a/shell/platform/android/android_surface.h b/shell/platform/android/android_surface.h index 2425a61e20707..858b07eb45d9f 100644 --- a/shell/platform/android/android_surface.h +++ b/shell/platform/android/android_surface.h @@ -19,6 +19,8 @@ namespace shell { class AndroidSurface { public: + static std::unique_ptr Create(bool use_software_rendering); + virtual ~AndroidSurface(); virtual bool IsValid() const = 0; @@ -27,14 +29,11 @@ class AndroidSurface { virtual std::unique_ptr CreateGPUSurface() = 0; - virtual SkISize OnScreenSurfaceSize() const = 0; - virtual bool OnScreenSurfaceResize(const SkISize& size) const = 0; virtual bool ResourceContextMakeCurrent() = 0; - virtual bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config = {}) = 0; + virtual bool SetNativeWindow(fxl::RefPtr window) = 0; }; } // namespace shell diff --git a/shell/platform/android/android_surface_gl.cc b/shell/platform/android/android_surface_gl.cc index f30ac1272b043..274b652a97b74 100644 --- a/shell/platform/android/android_surface_gl.cc +++ b/shell/platform/android/android_surface_gl.cc @@ -6,14 +6,12 @@ #include -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_ptr.h" namespace shell { -static fxl::RefPtr GlobalResourceLoadingContext( - PlatformView::SurfaceConfig offscreen_config) { +static fxl::RefPtr GlobalResourceLoadingContext() { // AndroidSurfaceGL instances are only ever created on the platform thread. So // there is no need to lock here. @@ -29,11 +27,7 @@ static fxl::RefPtr GlobalResourceLoadingContext( return nullptr; } - // TODO(chinmaygarde): We should check that the configurations are stable - // across multiple invocations. - - auto context = - fxl::MakeRefCounted(environment, offscreen_config); + auto context = fxl::MakeRefCounted(environment); if (!context->IsValid()) { return nullptr; @@ -43,10 +37,9 @@ static fxl::RefPtr GlobalResourceLoadingContext( return global_context; } -AndroidSurfaceGL::AndroidSurfaceGL( - PlatformView::SurfaceConfig offscreen_config) { +AndroidSurfaceGL::AndroidSurfaceGL() { // Acquire the offscreen context. - offscreen_context_ = GlobalResourceLoadingContext(offscreen_config); + offscreen_context_ = GlobalResourceLoadingContext(); if (!offscreen_context_ || !offscreen_context_->IsValid()) { offscreen_context_ = nullptr; @@ -60,14 +53,9 @@ bool AndroidSurfaceGL::IsOffscreenContextValid() const { } void AndroidSurfaceGL::TeardownOnScreenContext() { - fxl::AutoResetWaitableEvent latch; - blink::Threads::Gpu()->PostTask([this, &latch]() { - if (IsValid()) { - GLContextClearCurrent(); - } - latch.Signal(); - }); - latch.Wait(); + if (onscreen_context_) { + onscreen_context_->ClearCurrent(); + } onscreen_context_ = nullptr; } @@ -84,11 +72,6 @@ std::unique_ptr AndroidSurfaceGL::CreateGPUSurface() { return surface->IsValid() ? std::move(surface) : nullptr; } -SkISize AndroidSurfaceGL::OnScreenSurfaceSize() const { - FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); - return onscreen_context_->GetSize(); -} - bool AndroidSurfaceGL::OnScreenSurfaceResize(const SkISize& size) const { FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->Resize(size); @@ -99,8 +82,8 @@ bool AndroidSurfaceGL::ResourceContextMakeCurrent() { return offscreen_context_->MakeCurrent(); } -bool AndroidSurfaceGL::SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) { +bool AndroidSurfaceGL::SetNativeWindow( + fxl::RefPtr window) { // In any case, we want to get rid of our current onscreen context. onscreen_context_ = nullptr; @@ -112,7 +95,7 @@ bool AndroidSurfaceGL::SetNativeWindow(fxl::RefPtr window, // Create the onscreen context. onscreen_context_ = fxl::MakeRefCounted( - offscreen_context_->Environment(), config, + offscreen_context_->Environment(), offscreen_context_.get() /* sharegroup */); if (!onscreen_context_->IsValid()) { diff --git a/shell/platform/android/android_surface_gl.h b/shell/platform/android/android_surface_gl.h index 08aee081c8266..e26f2bf50d3a9 100644 --- a/shell/platform/android/android_surface_gl.h +++ b/shell/platform/android/android_surface_gl.h @@ -16,35 +16,43 @@ namespace shell { -class AndroidSurfaceGL : public GPUSurfaceGLDelegate, public AndroidSurface { +class AndroidSurfaceGL final : public GPUSurfaceGLDelegate, + public AndroidSurface { public: - explicit AndroidSurfaceGL(PlatformView::SurfaceConfig offscreen_config); + AndroidSurfaceGL(); ~AndroidSurfaceGL() override; - bool IsValid() const override; - bool IsOffscreenContextValid() const; + // |shell::AndroidSurface| + bool IsValid() const override; + + // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; + // |shell::AndroidSurface| void TeardownOnScreenContext() override; - SkISize OnScreenSurfaceSize() const override; - + // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; + // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) override; + // |shell::AndroidSurface| + bool SetNativeWindow(fxl::RefPtr window) override; + // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; + // |shell::GPUSurfaceGLDelegate| bool GLContextClearCurrent() override; + // |shell::GPUSurfaceGLDelegate| bool GLContextPresent() override; + // |shell::GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; private: diff --git a/shell/platform/android/android_surface_software.cc b/shell/platform/android/android_surface_software.cc index 68bf99b27ba56..4b1378802d9e4 100644 --- a/shell/platform/android/android_surface_software.cc +++ b/shell/platform/android/android_surface_software.cc @@ -3,15 +3,14 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_surface_software.h" -#include "flutter/common/threads.h" -#include "flutter/fml/platform/android/jni_weak_ref.h" -#include "flutter/fml/platform/android/scoped_java_ref.h" -#include "flutter/shell/platform/android/platform_view_android_jni.h" #include #include +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" +#include "flutter/shell/platform/android/platform_view_android_jni.h" #include "lib/fxl/logging.h" namespace shell { @@ -132,17 +131,12 @@ bool AndroidSurfaceSoftware::PresentBackingStore( void AndroidSurfaceSoftware::TeardownOnScreenContext() {} -SkISize AndroidSurfaceSoftware::OnScreenSurfaceSize() const { - return SkISize(); -} - bool AndroidSurfaceSoftware::OnScreenSurfaceResize(const SkISize& size) const { return true; } bool AndroidSurfaceSoftware::SetNativeWindow( - fxl::RefPtr window, - PlatformView::SurfaceConfig config) { + fxl::RefPtr window) { native_window_ = std::move(window); if (!(native_window_ && native_window_->IsValid())) return false; diff --git a/shell/platform/android/android_surface_software.h b/shell/platform/android/android_surface_software.h index 76184b707cf74..0f82fc5dfe154 100644 --- a/shell/platform/android/android_surface_software.h +++ b/shell/platform/android/android_surface_software.h @@ -13,35 +13,39 @@ namespace shell { -class AndroidSurfaceSoftware : public AndroidSurface, - public GPUSurfaceSoftwareDelegate { +class AndroidSurfaceSoftware final : public AndroidSurface, + public GPUSurfaceSoftwareDelegate { public: AndroidSurfaceSoftware(); ~AndroidSurfaceSoftware() override; + // |shell::AndroidSurface| bool IsValid() const override; + // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; + // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; - sk_sp AcquireBackingStore(const SkISize& size) override; - - bool PresentBackingStore(sk_sp backing_store) override; - + // |shell::AndroidSurface| void TeardownOnScreenContext() override; - SkISize OnScreenSurfaceSize() const override; - + // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; - bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) override; + // |shell::AndroidSurface| + bool SetNativeWindow(fxl::RefPtr window) override; + + // |shell::GPUSurfaceSoftwareDelegate| + sk_sp AcquireBackingStore(const SkISize& size) override; + + // |shell::GPUSurfaceSoftwareDelegate| + bool PresentBackingStore(sk_sp backing_store) override; private: sk_sp sk_surface_; - fxl::RefPtr native_window_; SkColorType target_color_type_; SkAlphaType target_alpha_type_; diff --git a/shell/platform/android/android_surface_vulkan.cc b/shell/platform/android/android_surface_vulkan.cc index ccacf538b8781..e8817690188c2 100644 --- a/shell/platform/android/android_surface_vulkan.cc +++ b/shell/platform/android/android_surface_vulkan.cc @@ -21,10 +21,12 @@ bool AndroidSurfaceVulkan::IsValid() const { return proc_table_->HasAcquiredMandatoryProcAddresses(); } +// |shell::AndroidSurface| void AndroidSurfaceVulkan::TeardownOnScreenContext() { - // + // Nothing to do. } +// |shell::AndroidSurface| std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { if (!IsValid()) { return nullptr; @@ -52,21 +54,20 @@ std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { return gpu_surface; } -SkISize AndroidSurfaceVulkan::OnScreenSurfaceSize() const { - return native_window_ ? native_window_->GetSize() : SkISize::Make(0, 0); -} - +// |shell::AndroidSurface| bool AndroidSurfaceVulkan::OnScreenSurfaceResize(const SkISize& size) const { return true; } +// |shell::AndroidSurface| bool AndroidSurfaceVulkan::ResourceContextMakeCurrent() { + FXL_DLOG(ERROR) << "The vulkan backend does not support resource contexts."; return false; } +// |shell::AndroidSurface| bool AndroidSurfaceVulkan::SetNativeWindow( - fxl::RefPtr window, - PlatformView::SurfaceConfig config) { + fxl::RefPtr window) { native_window_ = std::move(window); return native_window_ && native_window_->IsValid(); } diff --git a/shell/platform/android/android_surface_vulkan.h b/shell/platform/android/android_surface_vulkan.h index f1ecf610c8584..fd3f493d49790 100644 --- a/shell/platform/android/android_surface_vulkan.h +++ b/shell/platform/android/android_surface_vulkan.h @@ -20,20 +20,23 @@ class AndroidSurfaceVulkan : public AndroidSurface { ~AndroidSurfaceVulkan() override; + // |shell::AndroidSurface| bool IsValid() const override; - void TeardownOnScreenContext() override; - + // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; - SkISize OnScreenSurfaceSize() const override; + // |shell::AndroidSurface| + void TeardownOnScreenContext() override; + // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; + // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) override; + // |shell::AndroidSurface| + bool SetNativeWindow(fxl::RefPtr window) override; private: fxl::RefPtr proc_table_; diff --git a/shell/platform/android/apk_asset_provider.cc b/shell/platform/android/apk_asset_provider.cc index fdd4910a12f4c..4cf6da16dc64f 100644 --- a/shell/platform/android/apk_asset_provider.cc +++ b/shell/platform/android/apk_asset_provider.cc @@ -7,32 +7,41 @@ namespace blink { +APKAssetProvider::APKAssetProvider(JNIEnv* env, + jobject jassetManager, + std::string directory) + : directory_(std::move(directory)) { + assetManager_ = AAssetManager_fromJava(env, jassetManager); +} + +APKAssetProvider::~APKAssetProvider() = default; + +bool APKAssetProvider::IsValid() const { + return true; +} + bool APKAssetProvider::GetAsBuffer(const std::string& asset_name, - std::vector* data) { + std::vector* data) const { std::stringstream ss; ss << directory_.c_str() << "/" << asset_name; - AAsset* asset = AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); + AAsset* asset = + AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); if (!asset) { - return false; + return false; } uint8_t* buffer = (uint8_t*)AAsset_getBuffer(asset); if (!buffer) { FXL_LOG(ERROR) << "Got null trying to acquire buffer for asset:" << asset; + AAsset_close(asset); return false; } data->resize(AAsset_getLength(asset)); std::copy(buffer, buffer + data->size(), data->begin()); + AAsset_close(asset); return true; } -APKAssetProvider::~APKAssetProvider() {} - -APKAssetProvider::APKAssetProvider(JNIEnv* env, jobject jassetManager, std::string directory) - : directory_(std::move(directory)) { - assetManager_ = AAssetManager_fromJava(env, jassetManager); -} - } // namespace blink diff --git a/shell/platform/android/apk_asset_provider.h b/shell/platform/android/apk_asset_provider.h index c40b1ed2a1866..70ddbe454bc61 100644 --- a/shell/platform/android/apk_asset_provider.h +++ b/shell/platform/android/apk_asset_provider.h @@ -5,28 +5,35 @@ #ifndef FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ #define FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ -#include #include +#include -#include "flutter/assets/asset_provider.h" +#include "flutter/assets/asset_resolver.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class APKAssetProvider - : public AssetProvider { +class APKAssetProvider final : public AssetResolver { public: - explicit APKAssetProvider(JNIEnv* env, jobject assetManager, std::string directory); + explicit APKAssetProvider(JNIEnv* env, + jobject assetManager, + std::string directory); virtual ~APKAssetProvider(); + private: + AAssetManager* assetManager_; + const std::string directory_; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data); + std::vector* data) const override; - private: - AAssetManager* assetManager_; - const std::string directory_; + FXL_DISALLOW_COPY_AND_ASSIGN(APKAssetProvider); }; } // namespace blink -#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file +#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file diff --git a/shell/platform/android/flutter_main.cc b/shell/platform/android/flutter_main.cc index 6df346a128722..08d97add93b87 100644 --- a/shell/platform/android/flutter_main.cc +++ b/shell/platform/android/flutter_main.cc @@ -2,38 +2,85 @@ // 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/shell/platform/android/flutter_main.h" #include +#include "flutter/fml/message_loop.h" +#include "flutter/fml/paths.h" #include "flutter/fml/platform/android/jni_util.h" +#include "flutter/runtime/dart_vm.h" #include "flutter/runtime/start_up.h" #include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" #include "lib/fxl/arraysize.h" #include "lib/fxl/command_line.h" +#include "lib/fxl/files/file.h" #include "lib/fxl/macros.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -static void Init(JNIEnv* env, - jclass clazz, - jobject context, - jobjectArray jargs, - jstring bundlePath) { - // Prepare command line arguments and initialize the shell. +FlutterMain::FlutterMain(blink::Settings settings) + : settings_(std::move(settings)) {} + +FlutterMain::~FlutterMain() = default; + +static std::unique_ptr g_flutter_main; + +FlutterMain& FlutterMain::Get() { + FXL_CHECK(g_flutter_main) << "ensureInitializationComplete must have already " + "been called."; + return *g_flutter_main; +} + +const blink::Settings& FlutterMain::GetSettings() const { + return settings_; +} + +void FlutterMain::Init(JNIEnv* env, + jclass clazz, + jobject context, + jobjectArray jargs, + jstring bundlePath) { std::vector args; - args.push_back("flutter_tester"); + args.push_back("flutter"); for (auto& arg : fml::jni::StringArrayToVector(env, jargs)) { args.push_back(std::move(arg)); } - auto command_line = fxl::CommandLineFromIterators(args.begin(), args.end()); - std::string icu_data_path = - command_line.GetOptionValueWithDefault("icu-data-file-path", ""); - Shell::InitStandalone(std::move(command_line), std::move(icu_data_path), - /* application_library_path= */ "", - fml::jni::JavaStringToString(env, bundlePath)); + + auto settings = SettingsFromCommandLine(command_line); + + settings.assets_path = fml::jni::JavaStringToString(env, bundlePath); + + if (!blink::DartVM::IsRunningPrecompiledCode()) { + // Check to see if the appropriate kernel files are present and configure + // settings accordingly. + auto platform_kernel_path = + fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); + auto application_kernel_path = + fml::paths::JoinPaths({settings.assets_path, "kernel_blob.bin"}); + + if (files::IsFile(platform_kernel_path) && + files::IsFile(application_kernel_path)) { + settings.kernel_snapshot_path = platform_kernel_path; + settings.application_kernel_asset = application_kernel_path; + } + } + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + // Not thread safe. Will be removed when FlutterMain is refactored to no + // longer be a singleton. + g_flutter_main.reset(new FlutterMain(std::move(settings))); } static void RecordStartTimestamp(JNIEnv* env, @@ -44,7 +91,7 @@ static void RecordStartTimestamp(JNIEnv* env, blink::engine_main_enter_ts = Dart_TimelineGetMicros() - initTimeMicros; } -bool RegisterFlutterMain(JNIEnv* env) { +bool FlutterMain::Register(JNIEnv* env) { static const JNINativeMethod methods[] = { { .name = "nativeInit", diff --git a/shell/platform/android/flutter_main.h b/shell/platform/android/flutter_main.h index f4f65c499f966..6c8717e9cebdb 100644 --- a/shell/platform/android/flutter_main.h +++ b/shell/platform/android/flutter_main.h @@ -7,9 +7,34 @@ #include +#include "flutter/common/settings.h" +#include "lib/fxl/macros.h" + namespace shell { -bool RegisterFlutterMain(JNIEnv* env); +class FlutterMain { + public: + ~FlutterMain(); + + static bool Register(JNIEnv* env); + + static FlutterMain& Get(); + + const blink::Settings& GetSettings() const; + + private: + const blink::Settings settings_; + + FlutterMain(blink::Settings settings); + + static void Init(JNIEnv* env, + jclass clazz, + jobject context, + jobjectArray jargs, + jstring bundlePath); + + FXL_DISALLOW_COPY_AND_ASSIGN(FlutterMain); +}; } // namespace shell diff --git a/shell/platform/android/library_loader.cc b/shell/platform/android/library_loader.cc index c51d0114282f6..569825ce33e21 100644 --- a/shell/platform/android/library_loader.cc +++ b/shell/platform/android/library_loader.cc @@ -16,7 +16,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { bool result = false; // Register FlutterMain. - result = shell::RegisterFlutterMain(env); + result = shell::FlutterMain::Register(env); FXL_CHECK(result); // Register PlatformView diff --git a/shell/platform/android/platform_message_response_android.cc b/shell/platform/android/platform_message_response_android.cc new file mode 100644 index 0000000000000..214080ec5bde3 --- /dev/null +++ b/shell/platform/android/platform_message_response_android.cc @@ -0,0 +1,62 @@ +// Copyright 2018 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/shell/platform/android/platform_message_response_android.h" + +#include "flutter/shell/platform/android/platform_view_android_jni.h" +#include "lib/fxl/functional/make_copyable.h" + +namespace shell { + +PlatformMessageResponseAndroid::PlatformMessageResponseAndroid( + int response_id, + fml::jni::JavaObjectWeakGlobalRef weak_java_object, + fxl::RefPtr platform_task_runner) + : response_id_(response_id), + weak_java_object_(weak_java_object), + platform_task_runner_(std::move(platform_task_runner)) {} + +// |blink::PlatformMessageResponse| +void PlatformMessageResponseAndroid::Complete(std::vector data) { + platform_task_runner_->PostTask( + fxl::MakeCopyable([response = response_id_, // + weak_java_object = weak_java_object_, // + data = std::move(data) // + ]() { + // We are on the platform thread. Attempt to get the strong reference to + // the Java object. + auto env = fml::jni::AttachCurrentThread(); + auto java_object = weak_java_object.get(env); + + if (java_object.is_null()) { + // The Java object was collected before this message response got to + // it. Drop the response on the floor. + return; + } + + if (data.size() == 0) { + // If the data is empty, there is no reason to create a Java byte + // array. Make the response now with a nullptr now. + FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), + response, nullptr); + } + + // Convert the vector to a Java byte array. + fml::jni::ScopedJavaLocalRef data_array( + env, env->NewByteArray(data.size())); + env->SetByteArrayRegion(data_array.obj(), 0, data.size(), + reinterpret_cast(data.data())); + + // Make the response call into Java. + FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), + response, data_array.obj()); + })); +} + +// |blink::PlatformMessageResponse| +void PlatformMessageResponseAndroid::CompleteEmpty() { + Complete(std::vector{}); +} + +} // namespace shell diff --git a/shell/platform/android/platform_message_response_android.h b/shell/platform/android/platform_message_response_android.h new file mode 100644 index 0000000000000..2ee7f3336ac6d --- /dev/null +++ b/shell/platform/android/platform_message_response_android.h @@ -0,0 +1,39 @@ +// Copyright 2018 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_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ + +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/fml/task_runner.h" +#include "flutter/lib/ui/window/platform_message_response.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { + public: + // |blink::PlatformMessageResponse| + void Complete(std::vector data) override; + + // |blink::PlatformMessageResponse| + void CompleteEmpty() override; + + private: + PlatformMessageResponseAndroid( + int response_id, + fml::jni::JavaObjectWeakGlobalRef weak_java_object, + fxl::RefPtr platform_task_runner); + + int response_id_; + fml::jni::JavaObjectWeakGlobalRef weak_java_object_; + fxl::RefPtr platform_task_runner_; + + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageResponseAndroid); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 8f677045fb1f5..00d1e4b59e848 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -4,288 +4,55 @@ #include "flutter/shell/platform/android/platform_view_android.h" -#include -#include -#include -#include - +#include #include -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" -#include "flutter/fml/platform/android/jni_util.h" -#include "flutter/fml/platform/android/scoped_java_ref.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/shell/common/null_rasterizer.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" +#include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" #include "flutter/shell/platform/android/android_surface_gl.h" -#include "flutter/shell/platform/android/android_surface_software.h" -#include "flutter/shell/platform/android/apk_asset_provider.h" +#include "flutter/shell/platform/android/platform_message_response_android.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "flutter/shell/platform/android/vsync_waiter_android.h" -#include "lib/fxl/functional/make_copyable.h" - -#if SHELL_ENABLE_VULKAN -#include "flutter/shell/platform/android/android_surface_vulkan.h" -#endif // SHELL_ENABLE_VULKAN +#include "lib/fxl/synchronization/waitable_event.h" namespace shell { -class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); - - public: - void Complete(std::vector data) override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask( - fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { - std::shared_ptr view = self->view_.lock(); - if (!view) - return; - static_cast(view.get()) - ->HandlePlatformMessageResponse(self->response_id_, - std::move(data)); - })); - } - - void CompleteEmpty() override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask(fxl::MakeCopyable([self]() mutable { - std::shared_ptr view = self->view_.lock(); - if (!view) - return; - static_cast(view.get()) - ->HandlePlatformMessageEmptyResponse(self->response_id_); - })); - } - - private: - PlatformMessageResponseAndroid(int response_id, - std::weak_ptr view) - : response_id_(response_id), view_(view) {} - - int response_id_; - std::weak_ptr view_; -}; - -static std::unique_ptr InitializePlatformSurfaceGL() { - const PlatformView::SurfaceConfig offscreen_config = { - .red_bits = 8, - .green_bits = 8, - .blue_bits = 8, - .alpha_bits = 8, - .depth_bits = 0, - .stencil_bits = 0, - }; - auto surface = std::make_unique(offscreen_config); - return surface->IsOffscreenContextValid() ? std::move(surface) : nullptr; -} - -static std::unique_ptr InitializePlatformSurfaceVulkan() { -#if SHELL_ENABLE_VULKAN - auto surface = std::make_unique(); - return surface->IsValid() ? std::move(surface) : nullptr; -#else // SHELL_ENABLE_VULKAN - return nullptr; -#endif // SHELL_ENABLE_VULKAN +PlatformViewAndroid::PlatformViewAndroid( + PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + fml::jni::JavaObjectWeakGlobalRef java_object, + bool use_software_rendering) + : PlatformView(delegate, std::move(task_runners)), + java_object_(java_object), + android_surface_(AndroidSurface::Create(use_software_rendering)) { + FXL_CHECK(android_surface_) + << "Could not create an OpenGL, Vulkan or Software surface to setup " + "rendering."; } -static std::unique_ptr InitializePlatformSurfaceSoftware() { - auto surface = std::make_unique(); - return surface->IsValid() ? std::move(surface) : nullptr; -} - -static std::unique_ptr InitializePlatformSurface() { - if (blink::Settings::Get().enable_software_rendering) { - if (auto surface = InitializePlatformSurfaceSoftware()) { - FXL_DLOG(INFO) << "Software surface initialized."; - return surface; - } - } - - if (auto surface = InitializePlatformSurfaceVulkan()) { - FXL_DLOG(INFO) << "Vulkan surface initialized."; - return surface; - } - - FXL_DLOG(INFO) - << "Could not initialize Vulkan surface. Falling back to OpenGL."; - - if (auto surface = InitializePlatformSurfaceGL()) { - FXL_DLOG(INFO) << "GL surface initialized."; - return surface; - } - - if (auto surface = InitializePlatformSurfaceSoftware()) { - FXL_DLOG(INFO) << "Software surface initialized."; - return surface; - } - - FXL_CHECK(false) - << "Could not initialize either the Vulkan, OpenGL, or Software" - "surface backends. Flutter requires a GPU to render."; - return nullptr; -} - -PlatformViewAndroid::PlatformViewAndroid() - : PlatformView(std::make_unique()), - android_surface_(InitializePlatformSurface()) {} - PlatformViewAndroid::~PlatformViewAndroid() = default; -void PlatformViewAndroid::Attach() { - CreateEngine(); - - // Eagerly setup the IO thread context. We have already setup the surface. - SetupResourceContextOnIOThread(); - - UpdateThreadPriorities(); +void PlatformViewAndroid::NotifyCreated( + fxl::RefPtr native_window) { + InstallFirstFrameCallback(); + android_surface_->SetNativeWindow(native_window); + PlatformView::NotifyCreated(); } -void PlatformViewAndroid::Detach() { - ReleaseSurface(); -} - -void PlatformViewAndroid::SurfaceCreated(JNIEnv* env, - jobject jsurface, - jint backgroundColor) { - // Note: This frame ensures that any local references used by - // ANativeWindow_fromSurface are released immediately. This is needed as a - // workaround for https://code.google.com/p/android/issues/detail?id=68174 - fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); - - // We have a drawing surface, so swap in a non-Null rasterizer. - SetRasterizer(std::make_unique(nullptr)); - - rasterizer_->AddNextFrameCallback([this]() { - JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - if (!view.is_null()) { - FlutterViewOnFirstFrame(env, view.obj()); - } - }); - - auto native_window = fxl::MakeRefCounted( - ANativeWindow_fromSurface(env, jsurface)); - - if (!native_window->IsValid()) { - return; - } - - if (!android_surface_->SetNativeWindow(native_window)) { - return; - } - - std::unique_ptr gpu_surface = android_surface_->CreateGPUSurface(); - - if (gpu_surface == nullptr || !gpu_surface->IsValid()) { - return; - } - - NotifyCreated(std::move(gpu_surface), [ - this, backgroundColor, native_window_size = native_window->GetSize() - ] { rasterizer().Clear(backgroundColor, native_window_size); }); -} - -void PlatformViewAndroid::SurfaceChanged(jint width, jint height) { - blink::Threads::Gpu()->PostTask([this, width, height]() { - if (android_surface_) { - android_surface_->OnScreenSurfaceResize(SkISize::Make(width, height)); - } - }); -} - -void PlatformViewAndroid::UpdateThreadPriorities() { - blink::Threads::Gpu()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); - - blink::Threads::UI()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); -} - -void PlatformViewAndroid::SurfaceDestroyed() { - ReleaseSurface(); -} - -void PlatformViewAndroid::RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, - std::string snapshot_override, - std::string entrypoint, - bool reuse_runtime_controller, - jobject assetManager) { - // TODO(jsimmons): remove snapshot_override from the public FlutterView API - FXL_CHECK(snapshot_override.empty()) << "snapshot_override is obsolete"; - - // The flutter assets directory name is the last directory of the bundle_path - // and the path into the APK - size_t last_slash_idx = bundle_path.rfind("/", bundle_path.size()); - std::string flutter_assets_dir = bundle_path.substr( - last_slash_idx + 1, bundle_path.size() - last_slash_idx); - - fxl::RefPtr asset_provider = - fxl::MakeRefCounted(env, assetManager, - flutter_assets_dir); - blink::Threads::UI()->PostTask( - [engine = engine_->GetWeakPtr(), - asset_provider = std::move(asset_provider), - bundle_path = std::move(bundle_path), entrypoint = std::move(entrypoint), - reuse_runtime_controller = reuse_runtime_controller] { - if (engine) - engine->RunBundleWithAssets( - std::move(asset_provider), std::move(bundle_path), - std::move(entrypoint), reuse_runtime_controller); - }); -} - -void PlatformViewAndroid::RunBundleAndSource(std::string bundle_path, - std::string main, - std::string packages) { - blink::Threads::UI()->PostTask([ - engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path), - main = std::move(main), packages = std::move(packages) - ] { - if (engine) - engine->RunBundleAndSource(std::move(bundle_path), std::move(main), - std::move(packages)); - }); +void PlatformViewAndroid::NotifyDestroyed() { + PlatformView::NotifyDestroyed(); + android_surface_->TeardownOnScreenContext(); } -void PlatformViewAndroid::SetAssetBundlePathOnUI(std::string bundle_path) { - blink::Threads::UI()->PostTask( - [ engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path) ] { - if (engine) - engine->SetAssetBundlePath(std::move(bundle_path)); +void PlatformViewAndroid::NotifyChanged(const SkISize& size) { + fxl::AutoResetWaitableEvent latch; + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetGPUTaskRunner(), // + [&latch, surface = android_surface_.get(), size]() { + surface->OnScreenSurfaceResize(size); + latch.Signal(); }); -} - -void PlatformViewAndroid::SetViewportMetrics(jfloat device_pixel_ratio, - jint physical_width, - jint physical_height, - jint physical_padding_top, - jint physical_padding_right, - jint physical_padding_bottom, - jint physical_padding_left, - jint physical_view_inset_top, - jint physical_view_inset_right, - jint physical_view_inset_bottom, - jint physical_view_inset_left) { - blink::ViewportMetrics metrics; - metrics.device_pixel_ratio = device_pixel_ratio; - metrics.physical_width = physical_width; - metrics.physical_height = physical_height; - metrics.physical_padding_top = physical_padding_top; - metrics.physical_padding_right = physical_padding_right; - metrics.physical_padding_bottom = physical_padding_bottom; - metrics.physical_padding_left = physical_padding_left; - metrics.physical_view_inset_top = physical_view_inset_top; - metrics.physical_view_inset_right = physical_view_inset_right; - metrics.physical_view_inset_bottom = physical_view_inset_bottom; - metrics.physical_view_inset_left = physical_view_inset_left; - - blink::Threads::UI()->PostTask([ engine = engine_->GetWeakPtr(), metrics ] { - if (engine) - engine->SetViewportMetrics(metrics); - }); + latch.Wait(); } void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, @@ -301,7 +68,7 @@ void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, GetWeakPtr()); + response_id, java_object_, task_runners_.GetPlatformTaskRunner()); } PlatformView::DispatchPlatformMessage( @@ -315,7 +82,7 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, GetWeakPtr()); + response_id, java_object_, task_runners_.GetPlatformTaskRunner()); } PlatformView::DispatchPlatformMessage( @@ -323,20 +90,6 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, std::move(response))); } -void PlatformViewAndroid::DispatchPointerDataPacket(JNIEnv* env, - jobject buffer, - jint position) { - uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); - - blink::Threads::UI()->PostTask(fxl::MakeCopyable([ - engine = engine_->GetWeakPtr(), - packet = std::make_unique(data, position) - ] { - if (engine.get()) - engine->DispatchPointerDataPacket(*packet); - })); -} - void PlatformViewAndroid::InvokePlatformMessageResponseCallback( JNIEnv* env, jint response_id, @@ -369,10 +122,11 @@ void PlatformViewAndroid::InvokePlatformMessageEmptyResponseCallback( message_response->CompleteEmpty(); } +// |shell::PlatformView| void PlatformViewAndroid::HandlePlatformMessage( fxl::RefPtr message) { JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + fml::jni::ScopedJavaLocalRef view = java_object_.get(env); if (view.is_null()) return; @@ -402,35 +156,6 @@ void PlatformViewAndroid::HandlePlatformMessage( } } -void PlatformViewAndroid::HandlePlatformMessageResponse( - int response_id, - std::vector data) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - - if (view.is_null()) - return; - fml::jni::ScopedJavaLocalRef data_array( - env, env->NewByteArray(data.size())); - env->SetByteArrayRegion(data_array.obj(), 0, data.size(), - reinterpret_cast(data.data())); - - FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, - data_array.obj()); -} - -void PlatformViewAndroid::HandlePlatformMessageEmptyResponse(int response_id) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - - if (view.is_null()) - return; - FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, - nullptr); -} - void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, jint id, jint action, @@ -451,35 +176,14 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, id, static_cast(action), std::move(args_vector)); } -void PlatformViewAndroid::SetSemanticsEnabled(jboolean enabled) { - PlatformView::SetSemanticsEnabled(enabled); -} - -void PlatformViewAndroid::ReleaseSurface() { - NotifyDestroyed(); - android_surface_->TeardownOnScreenContext(); - SetRasterizer(std::make_unique()); -} - -VsyncWaiter* PlatformViewAndroid::GetVsyncWaiter() { - if (!vsync_waiter_) - vsync_waiter_ = std::make_unique(); - return vsync_waiter_.get(); -} - -bool PlatformViewAndroid::ResourceContextMakeCurrent() { - FXL_CHECK(android_surface_); - return android_surface_->ResourceContextMakeCurrent(); -} - -void PlatformViewAndroid::UpdateSemantics( - blink::SemanticsNodeUpdates update) { +// |shell::PlatformView| +void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { constexpr size_t kBytesPerNode = 36 * sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t); JNIEnv* env = fml::jni::AttachCurrentThread(); { - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + fml::jni::ScopedJavaLocalRef view = java_object_.get(env); if (view.is_null()) return; @@ -560,79 +264,6 @@ void PlatformViewAndroid::UpdateSemantics( } } -void PlatformViewAndroid::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - FXL_CHECK(env); - - { - fml::jni::ScopedJavaLocalRef local_flutter_view = - flutter_view_.get(env); - if (local_flutter_view.is_null()) { - // Collected. - return; - } - - // Grab the class of the flutter view. - jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); - FXL_CHECK(flutter_view_class); - - // Grab the runFromSource method id. - jmethodID run_from_source_method_id = env->GetMethodID( - flutter_view_class, "runFromSource", - "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); - FXL_CHECK(run_from_source_method_id); - - // Invoke runFromSource on the Android UI thread. - jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); - FXL_CHECK(java_assets_directory); - jstring java_main = env->NewStringUTF(main.c_str()); - FXL_CHECK(java_main); - jstring java_packages = env->NewStringUTF(packages.c_str()); - FXL_CHECK(java_packages); - env->CallVoidMethod(local_flutter_view.obj(), run_from_source_method_id, - java_assets_directory, java_main, java_packages); - } - - // Detaching from the VM deletes any stray local references. - fml::jni::DetachFromVM(); -} - -void PlatformViewAndroid::SetAssetBundlePath( - const std::string& assets_directory) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - FXL_CHECK(env); - - { - fml::jni::ScopedJavaLocalRef local_flutter_view = - flutter_view_.get(env); - if (local_flutter_view.is_null()) { - // Collected. - return; - } - - // Grab the class of the flutter view. - jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); - FXL_CHECK(flutter_view_class); - - // Grab the setAssetBundlePath method id. - jmethodID method_id = env->GetMethodID( - flutter_view_class, "setAssetBundlePathOnUI", "(Ljava/lang/String;)V"); - FXL_CHECK(method_id); - - // Invoke setAssetBundlePath on the Android UI thread. - jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); - FXL_CHECK(java_assets_directory); - - env->CallVoidMethod(local_flutter_view.obj(), method_id, - java_assets_directory); - } - - // Detaching from the VM deletes any stray local references. - fml::jni::DetachFromVM(); -} - void PlatformViewAndroid::RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture) { @@ -640,116 +271,56 @@ void PlatformViewAndroid::RegisterExternalTexture( std::make_shared(texture_id, surface_texture)); } -void PlatformViewAndroid::MarkTextureFrameAvailable(int64_t texture_id) { - blink::Threads::Gpu()->PostTask([this, texture_id]() { - std::shared_ptr texture = - static_pointer_cast( - rasterizer_->GetTextureRegistry().GetTexture(texture_id)); - if (texture) { - texture->MarkNewFrameAvailable(); - } - }); - PlatformView::MarkTextureFrameAvailable(texture_id); +// |shell::PlatformView| +std::unique_ptr PlatformViewAndroid::CreateVSyncWaiter() { + return std::make_unique(task_runners_); } -fml::jni::ScopedJavaLocalRef PlatformViewAndroid::GetBitmap( - JNIEnv* env) { - // Render the last frame to an array of pixels on the GPU thread. - // The pixels will be returned as a global JNI reference to an int array. - fxl::AutoResetWaitableEvent latch; - jobject pixels_ref = nullptr; - SkISize frame_size; - blink::Threads::Gpu()->PostTask([this, &latch, &pixels_ref, &frame_size]() { - GetBitmapGpuTask(&pixels_ref, &frame_size); - latch.Signal(); - }); - - latch.Wait(); - - // Convert the pixel array to an Android bitmap. - if (pixels_ref == nullptr) - return fml::jni::ScopedJavaLocalRef(); - - fml::jni::ScopedJavaGlobalRef pixels(env, pixels_ref); - - jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); - FXL_CHECK(bitmap_class); - - jmethodID create_bitmap = env->GetStaticMethodID( - bitmap_class, "createBitmap", - "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); - FXL_CHECK(create_bitmap); - - jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); - FXL_CHECK(bitmap_config_class); - - jmethodID bitmap_config_value_of = env->GetStaticMethodID( - bitmap_config_class, "valueOf", - "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); - FXL_CHECK(bitmap_config_value_of); - - jstring argb = env->NewStringUTF("ARGB_8888"); - FXL_CHECK(argb); - - jobject bitmap_config = env->CallStaticObjectMethod( - bitmap_config_class, bitmap_config_value_of, argb); - FXL_CHECK(bitmap_config); +// |shell::PlatformView| +std::unique_ptr PlatformViewAndroid::CreateRenderingSurface() { + return android_surface_->CreateGPUSurface(); +} - jobject bitmap = env->CallStaticObjectMethod( - bitmap_class, create_bitmap, pixels.obj(), frame_size.width(), - frame_size.height(), bitmap_config); +// |shell::PlatformView| +sk_sp PlatformViewAndroid::CreateResourceContext() const { + sk_sp resource_context; + if (android_surface_->ResourceContextMakeCurrent()) { + // TODO(chinmaygarde): Currently, this code depends on the fact that only + // the OpenGL surface will be able to make a resource context current. If + // this changes, this assumption breaks. Handle the same. + resource_context = IOManager::CreateCompatibleResourceLoadingContext( + GrBackend::kOpenGL_GrBackend); + } else { + FXL_DLOG(ERROR) << "Could not make the resource context current."; + } - return fml::jni::ScopedJavaLocalRef(env, bitmap); + return resource_context; +} + +void PlatformViewAndroid::InstallFirstFrameCallback() { + // On Platform Task Runner. + SetNextFrameCallback( + [platform_view = GetWeakPtr(), + platform_task_runner = task_runners_.GetPlatformTaskRunner()]() { + // On GPU Task Runner. + platform_task_runner->PostTask([platform_view]() { + // Back on Platform Task Runner. + if (platform_view) { + reinterpret_cast(platform_view.get()) + ->FireFirstFrameCallback(); + } + }); + }); } -void PlatformViewAndroid::GetBitmapGpuTask(jobject* pixels_out, - SkISize* size_out) { - flow::LayerTree* layer_tree = rasterizer_->GetLastLayerTree(); - if (layer_tree == nullptr) - return; - +void PlatformViewAndroid::FireFirstFrameCallback() { JNIEnv* env = fml::jni::AttachCurrentThread(); - FXL_CHECK(env); - - const SkISize& frame_size = layer_tree->frame_size(); - jsize pixels_size = frame_size.width() * frame_size.height(); - jintArray pixels_array = env->NewIntArray(pixels_size); - FXL_CHECK(pixels_array); - - jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); - FXL_CHECK(pixels); - - SkImageInfo image_info = - SkImageInfo::Make(frame_size.width(), frame_size.height(), - kRGBA_8888_SkColorType, kPremul_SkAlphaType); - - sk_sp surface = SkSurface::MakeRasterDirect( - image_info, pixels, frame_size.width() * sizeof(jint)); - - flow::CompositorContext compositor_context(nullptr); - compositor_context.SetTextureRegistry(&texture_registry_); - SkCanvas* canvas = surface->getCanvas(); - flow::CompositorContext::ScopedFrame frame = - compositor_context.AcquireFrame(nullptr, canvas, false); - - canvas->clear(SK_ColorBLACK); - layer_tree->Raster(frame); - canvas->flush(); - - // Our configuration of Skia does not support rendering to the - // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. - // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). - for (int i = 0; i < pixels_size; i++) { - uint8_t* bytes = reinterpret_cast(pixels + i); - std::swap(bytes[0], bytes[2]); + fml::jni::ScopedJavaLocalRef view = java_object_.get(env); + if (view.is_null()) { + // The Java object died. + return; } - - env->ReleaseIntArrayElements(pixels_array, pixels, 0); - - *pixels_out = env->NewGlobalRef(pixels_array); - *size_out = frame_size; - - fml::jni::DetachFromVM(); + FlutterViewOnFirstFrame(fml::jni::AttachCurrentThread(), view.obj()); } } // namespace shell diff --git a/shell/platform/android/platform_view_android.h b/shell/platform/android/platform_view_android.h index 4779ea16ab4a7..9976c443f4248 100644 --- a/shell/platform/android/platform_view_android.h +++ b/shell/platform/android/platform_view_android.h @@ -20,45 +20,23 @@ namespace shell { -class PlatformViewAndroid : public PlatformView { +class PlatformViewAndroid final : public PlatformView { public: static bool Register(JNIEnv* env); - PlatformViewAndroid(); + PlatformViewAndroid(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + fml::jni::JavaObjectWeakGlobalRef java_object, + bool use_software_rendering); ~PlatformViewAndroid() override; - virtual void Attach() override; + void NotifyCreated(fxl::RefPtr native_window); - void Detach(); + void NotifyChanged(const SkISize& size); - void SurfaceCreated(JNIEnv* env, jobject jsurface, jint backgroundColor); - - void SurfaceChanged(jint width, jint height); - - void SurfaceDestroyed(); - - void RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, - std::string snapshot_override, - std::string entrypoint, - bool reuse_isolate, - jobject assetManager); - - void RunBundleAndSource(std::string bundle_path, - std::string main, - std::string packages); - - void SetViewportMetrics(jfloat device_pixel_ratio, - jint physical_width, - jint physical_height, - jint physical_padding_top, - jint physical_padding_right, - jint physical_padding_bottom, - jint physical_padding_left, - jint physical_view_inset_top, - jint physical_view_inset_right, - jint physical_view_inset_bottom, - jint physical_view_inset_left); + // |shell::PlatformView| + void NotifyDestroyed() override; void DispatchPlatformMessage(JNIEnv* env, std::string name, @@ -70,8 +48,6 @@ class PlatformViewAndroid : public PlatformView { std::string name, jint response_id); - void DispatchPointerDataPacket(JNIEnv* env, jobject buffer, jint position); - void InvokePlatformMessageResponseCallback(JNIEnv* env, jint response_id, jobject java_response_data, @@ -86,55 +62,37 @@ class PlatformViewAndroid : public PlatformView { jobject args, jint args_position); - void SetSemanticsEnabled(jboolean enabled); - - fml::jni::ScopedJavaLocalRef GetBitmap(JNIEnv* env); - - VsyncWaiter* GetVsyncWaiter() override; - - bool ResourceContextMakeCurrent() override; - - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - void HandlePlatformMessage( - fxl::RefPtr message) override; - - void HandlePlatformMessageResponse(int response_id, - std::vector data); - - void HandlePlatformMessageEmptyResponse(int response_id); - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - void SetAssetBundlePathOnUI(std::string bundle_path); - - void SetAssetBundlePath(const std::string& assets_directory) override; - void RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture); - void MarkTextureFrameAvailable(int64_t texture_id) override; - - void set_flutter_view(const fml::jni::JavaObjectWeakGlobalRef& flutter_view) { - flutter_view_ = flutter_view; - } - private: - std::unique_ptr android_surface_; - fml::jni::JavaObjectWeakGlobalRef flutter_view_; + const fml::jni::JavaObjectWeakGlobalRef java_object_; + const std::unique_ptr android_surface_; // We use id 0 to mean that no response is expected. int next_response_id_ = 1; std::unordered_map> pending_responses_; - void UpdateThreadPriorities(); + // |shell::PlatformView| + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; + + // |shell::PlatformView| + std::unique_ptr CreateVSyncWaiter() override; + + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; + + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; - void ReleaseSurface(); + void InstallFirstFrameCallback(); - void GetBitmapGpuTask(jobject* pixels_out, SkISize* size_out); + void FireFirstFrameCallback(); FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); }; diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index c819f3bfb5e41..f75f54a896850 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -4,17 +4,26 @@ #include "flutter/shell/platform/android/platform_view_android_jni.h" +#include + +#include + +#include "flutter/assets/directory_asset_bundle.h" #include "flutter/common/settings.h" +#include "flutter/fml/file.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/jni_weak_ref.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/runtime/dart_service_isolate.h" +#include "flutter/shell/common/run_configuration.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" +#include "flutter/shell/platform/android/android_shell_holder.h" +#include "flutter/shell/platform/android/apk_asset_provider.h" +#include "flutter/shell/platform/android/flutter_main.h" #include "lib/fxl/arraysize.h" -#include "lib/fxl/logging.h" -#define PLATFORM_VIEW \ - (*reinterpret_cast*>(platform_view)) +#define ANDROID_SHELL_HOLDER \ + (reinterpret_cast(shell_holder)) namespace shell { @@ -78,14 +87,12 @@ void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj) { static jmethodID g_attach_to_gl_context_method = nullptr; void SurfaceTextureAttachToGLContext(JNIEnv* env, jobject obj, jint textureId) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_attach_to_gl_context_method, textureId); FXL_CHECK(CheckException(env)); } static jmethodID g_update_tex_image_method = nullptr; void SurfaceTextureUpdateTexImage(JNIEnv* env, jobject obj) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_update_tex_image_method); FXL_CHECK(CheckException(env)); } @@ -94,14 +101,12 @@ static jmethodID g_get_transform_matrix_method = nullptr; void SurfaceTextureGetTransformMatrix(JNIEnv* env, jobject obj, jfloatArray result) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_get_transform_matrix_method, result); FXL_CHECK(CheckException(env)); } static jmethodID g_detach_from_gl_context_method = nullptr; void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_detach_from_gl_context_method); FXL_CHECK(CheckException(env)); } @@ -109,22 +114,22 @@ void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { // Called By Java static jlong Attach(JNIEnv* env, jclass clazz, jobject flutterView) { - auto view = new PlatformViewAndroid(); - auto storage = new std::shared_ptr(view); - // Create a weak reference to the flutterView Java object so that we can make - // calls into it later. - view->Attach(); - view->set_flutter_view(fml::jni::JavaObjectWeakGlobalRef(env, flutterView)); - return reinterpret_cast(storage); + fml::jni::JavaObjectWeakGlobalRef java_object(env, flutterView); + auto shell_holder = std::make_unique( + FlutterMain::Get().GetSettings(), java_object); + if (shell_holder->IsValid()) { + return reinterpret_cast(shell_holder.release()); + } else { + return 0; + } } -static void Detach(JNIEnv* env, jobject jcaller, jlong platform_view) { - PLATFORM_VIEW->Detach(); +static void Detach(JNIEnv* env, jobject jcaller, jlong shell_holder) { + // Nothing to do. } -static void Destroy(JNIEnv* env, jobject jcaller, jlong platform_view) { - PLATFORM_VIEW->Detach(); - delete &PLATFORM_VIEW; +static void Destroy(JNIEnv* env, jobject jcaller, jlong shell_holder) { + delete ANDROID_SHELL_HOLDER; } static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { @@ -134,67 +139,180 @@ static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { static void SurfaceCreated(JNIEnv* env, jobject jcaller, - jlong platform_view, - jobject surface, + jlong shell_holder, + jobject jsurface, jint backgroundColor) { - return PLATFORM_VIEW->SurfaceCreated(env, surface, backgroundColor); + // Note: This frame ensures that any local references used by + // ANativeWindow_fromSurface are released immediately. This is needed as a + // workaround for https://code.google.com/p/android/issues/detail?id=68174 + fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); + auto window = fxl::MakeRefCounted( + ANativeWindow_fromSurface(env, jsurface)); + ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyCreated(std::move(window)); } static void SurfaceChanged(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint width, jint height) { - return PLATFORM_VIEW->SurfaceChanged(width, height); -} - -static void SurfaceDestroyed(JNIEnv* env, - jobject jcaller, - jlong platform_view) { - return PLATFORM_VIEW->SurfaceDestroyed(); -} - -static void RunBundleAndSnapshot(JNIEnv* env, - jobject jcaller, - jlong platform_view, - jstring bundlePath, - jstring snapshotOverride, - jstring entrypoint, - jboolean reuse_runtime_controller, - jobject assetManager) { - return PLATFORM_VIEW->RunBundleAndSnapshot( - env, - fml::jni::JavaStringToString(env, bundlePath), // - fml::jni::JavaStringToString(env, snapshotOverride), // - fml::jni::JavaStringToString(env, entrypoint), // - reuse_runtime_controller, // - assetManager - ); + ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyChanged( + SkISize::Make(width, height)); } -void RunBundleAndSource(JNIEnv* env, - jobject jcaller, - jlong platform_view, - jstring bundlePath, - jstring main, - jstring packages) { - return PLATFORM_VIEW->RunBundleAndSource( - fml::jni::JavaStringToString(env, bundlePath), - fml::jni::JavaStringToString(env, main), - fml::jni::JavaStringToString(env, packages)); +static void SurfaceDestroyed(JNIEnv* env, jobject jcaller, jlong shell_holder) { + ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyDestroyed(); +} + +std::unique_ptr CreateIsolateConfiguration( + const blink::AssetManager& asset_manager) { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return IsolateConfiguration::CreateForPrecompiledCode(); + } + + const auto configuration_from_blob = + [&asset_manager](const std::string& snapshot_name) + -> std::unique_ptr { + std::vector blob; + if (asset_manager.GetAsBuffer(snapshot_name, &blob)) { + return IsolateConfiguration::CreateForSnapshot( + std::make_unique(std::move(blob))); + } + return nullptr; + }; + + if (auto kernel = configuration_from_blob("kernel_blob.bin")) { + return kernel; + } + + if (auto script = configuration_from_blob("snapshot_blob.bin")) { + return script; + } + + return nullptr; +} + +static void RunBundleAndSnapshot( + JNIEnv* env, + jobject jcaller, + jlong shell_holder, + jstring jbundlepath, + jstring /* snapshot override (unused) */, + jstring jEntrypoint, + jboolean /* reuse runtime controller (unused) */, + jobject jAssetManager) { + auto asset_manager = fxl::MakeRefCounted(); + + const auto bundlepath = fml::jni::JavaStringToString(env, jbundlepath); + + if (bundlepath.size() > 0) { + // If we got a bundle path, attempt to use that as a directory asset + // bundle. + asset_manager->PushBack(std::make_unique( + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true))); + + // Use the last path component of the bundle path to determine the + // directory in the APK assets. + const auto last_slash_index = bundlepath.rfind("/", bundlepath.size()); + if (last_slash_index != std::string::npos) { + auto apk_asset_dir = bundlepath.substr( + last_slash_index + 1, bundlepath.size() - last_slash_index); + + asset_manager->PushBack(std::make_unique( + env, // jni environment + jAssetManager, // asset manager + std::move(apk_asset_dir)) // apk asset dir + ); + } + } + + auto isolate_configuration = CreateIsolateConfiguration(*asset_manager); + + if (!isolate_configuration) { + FXL_DLOG(ERROR) + << "Isolate configuration could not be determined for engine launch."; + return; + } + + RunConfiguration config(std::move(isolate_configuration), + std::move(asset_manager)); + + { + auto entrypoint = fml::jni::JavaStringToString(env, jEntrypoint); + if (entrypoint.size() > 0) { + config.SetEntrypoint(std::move(entrypoint)); + } + } + + ANDROID_SHELL_HOLDER->Launch(std::move(config)); +} + +static void RunBundleAndSource(JNIEnv* env, + jobject jcaller, + jlong shell_holder, + jstring jBundlePath, + jstring main, + jstring packages) { + auto asset_manager = fxl::MakeRefCounted(); + + const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); + + if (bundlepath.size() > 0) { + auto directory = + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); + asset_manager->PushBack( + std::make_unique(std::move(directory))); + } + + auto main_file_path = fml::jni::JavaStringToString(env, main); + auto packages_file_path = fml::jni::JavaStringToString(env, packages); + + auto config = + IsolateConfiguration::CreateForSource(main_file_path, packages_file_path); + + if (!config) { + return; + } + + RunConfiguration run_configuration(std::move(config), + std::move(asset_manager)); + + ANDROID_SHELL_HOLDER->Launch(std::move(run_configuration)); } void SetAssetBundlePathOnUI(JNIEnv* env, jobject jcaller, - jlong platform_view, - jstring bundlePath) { - return PLATFORM_VIEW->SetAssetBundlePathOnUI( - fml::jni::JavaStringToString(env, bundlePath)); + jlong shell_holder, + jstring jBundlePath) { + const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); + + if (bundlepath.size() == 0) { + return; + } + + auto directory = + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); + + if (!directory.is_valid()) { + return; + } + + std::unique_ptr directory_asset_bundle = + std::make_unique(std::move(directory)); + + if (!directory_asset_bundle->IsValid()) { + return; + } + + auto asset_manager = fxl::MakeRefCounted(); + asset_manager->PushBack(std::move(directory_asset_bundle)); + + ANDROID_SHELL_HOLDER->UpdateAssetManager(std::move(asset_manager)); } static void SetViewportMetrics(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jfloat devicePixelRatio, jint physicalWidth, jint physicalHeight, @@ -206,115 +324,194 @@ static void SetViewportMetrics(JNIEnv* env, jint physicalViewInsetRight, jint physicalViewInsetBottom, jint physicalViewInsetLeft) { - return PLATFORM_VIEW->SetViewportMetrics(devicePixelRatio, // - physicalWidth, // - physicalHeight, // - physicalPaddingTop, // - physicalPaddingRight, // - physicalPaddingBottom, // - physicalPaddingLeft, // - physicalViewInsetTop, // - physicalViewInsetRight, // - physicalViewInsetBottom, // - physicalViewInsetLeft); + const blink::ViewportMetrics metrics = { + .device_pixel_ratio = devicePixelRatio, + .physical_width = physicalWidth, + .physical_height = physicalHeight, + .physical_padding_top = physicalPaddingTop, + .physical_padding_right = physicalPaddingRight, + .physical_padding_bottom = physicalPaddingBottom, + .physical_padding_left = physicalPaddingLeft, + .physical_view_inset_top = physicalViewInsetTop, + .physical_view_inset_right = physicalViewInsetRight, + .physical_view_inset_bottom = physicalViewInsetBottom, + .physical_view_inset_left = physicalViewInsetLeft, + }; + + ANDROID_SHELL_HOLDER->SetViewportMetrics(metrics); } -static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong platform_view) { - return PLATFORM_VIEW->GetBitmap(env).Release(); +static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) { + auto screenshot = ANDROID_SHELL_HOLDER->Screenshot( + Rasterizer::ScreenshotType::UncompressedImage, false); + if (screenshot.data == nullptr) { + return nullptr; + } + + const SkISize& frame_size = screenshot.frame_size; + jsize pixels_size = frame_size.width() * frame_size.height(); + jintArray pixels_array = env->NewIntArray(pixels_size); + FXL_CHECK(pixels_array); + + jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); + FXL_CHECK(pixels); + + auto pixels_src = static_cast(screenshot.data->data()); + + // Our configuration of Skia does not support rendering to the + // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. + // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). + for (int i = 0; i < pixels_size; i++) { + int32_t src_pixel = pixels_src[i]; + uint8_t* src_bytes = reinterpret_cast(&src_pixel); + std::swap(src_bytes[0], src_bytes[2]); + pixels[i] = src_pixel; + } + + env->ReleaseIntArrayElements(pixels_array, pixels, 0); + + jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); + FXL_CHECK(bitmap_class); + + jmethodID create_bitmap = env->GetStaticMethodID( + bitmap_class, "createBitmap", + "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); + FXL_CHECK(create_bitmap); + + jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); + FXL_CHECK(bitmap_config_class); + + jmethodID bitmap_config_value_of = env->GetStaticMethodID( + bitmap_config_class, "valueOf", + "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); + FXL_CHECK(bitmap_config_value_of); + + jstring argb = env->NewStringUTF("ARGB_8888"); + FXL_CHECK(argb); + + jobject bitmap_config = env->CallStaticObjectMethod( + bitmap_config_class, bitmap_config_value_of, argb); + FXL_CHECK(bitmap_config); + + return env->CallStaticObjectMethod(bitmap_class, create_bitmap, pixels_array, + frame_size.width(), frame_size.height(), + bitmap_config); } static void DispatchPlatformMessage(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jstring channel, jobject message, jint position, jint responseId) { - return PLATFORM_VIEW->DispatchPlatformMessage( - env, fml::jni::JavaStringToString(env, channel), message, position, - responseId); + ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPlatformMessage( + env, // + fml::jni::JavaStringToString(env, channel), // + message, // + position, // + responseId // + ); } static void DispatchEmptyPlatformMessage(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jstring channel, jint responseId) { - return PLATFORM_VIEW->DispatchEmptyPlatformMessage( - env, fml::jni::JavaStringToString(env, channel), responseId); + ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchEmptyPlatformMessage( + env, // + fml::jni::JavaStringToString(env, channel), // + responseId // + ); } static void DispatchPointerDataPacket(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jobject buffer, jint position) { - return PLATFORM_VIEW->DispatchPointerDataPacket(env, buffer, position); + uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); + auto packet = std::make_unique(data, position); + ANDROID_SHELL_HOLDER->DispatchPointerDataPacket(std::move(packet)); } static void DispatchSemanticsAction(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint id, jint action, jobject args, jint args_position) { - return PLATFORM_VIEW->DispatchSemanticsAction(env, id, action, args, - args_position); + ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchSemanticsAction( + env, // + id, // + action, // + args, // + args_position // + ); } static void SetSemanticsEnabled(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jboolean enabled) { - return PLATFORM_VIEW->SetSemanticsEnabled(enabled); + ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled); } static jboolean GetIsSoftwareRendering(JNIEnv* env, jobject jcaller) { - return blink::Settings::Get().enable_software_rendering; + return FlutterMain::Get().GetSettings().enable_software_rendering; } static void RegisterTexture(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jlong texture_id, jobject surface_texture) { - PLATFORM_VIEW->RegisterExternalTexture( - static_cast(texture_id), - fml::jni::JavaObjectWeakGlobalRef(env, surface_texture)); + ANDROID_SHELL_HOLDER->GetPlatformView()->RegisterExternalTexture( + static_cast(texture_id), // + fml::jni::JavaObjectWeakGlobalRef(env, surface_texture) // + ); } static void MarkTextureFrameAvailable(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jlong texture_id) { - return PLATFORM_VIEW->MarkTextureFrameAvailable( + ANDROID_SHELL_HOLDER->GetPlatformView()->MarkTextureFrameAvailable( static_cast(texture_id)); } static void UnregisterTexture(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jlong texture_id) { - PLATFORM_VIEW->UnregisterTexture(static_cast(texture_id)); + ANDROID_SHELL_HOLDER->GetPlatformView()->UnregisterTexture( + static_cast(texture_id)); } static void InvokePlatformMessageResponseCallback(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint responseId, jobject message, jint position) { - return PLATFORM_VIEW->InvokePlatformMessageResponseCallback( - env, responseId, message, position); + ANDROID_SHELL_HOLDER->GetPlatformView() + ->InvokePlatformMessageResponseCallback(env, // + responseId, // + message, // + position // + ); } static void InvokePlatformMessageEmptyResponseCallback(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint responseId) { - return PLATFORM_VIEW->InvokePlatformMessageEmptyResponseCallback(env, - responseId); + ANDROID_SHELL_HOLDER->GetPlatformView() + ->InvokePlatformMessageEmptyResponseCallback(env, // + responseId // + ); } bool PlatformViewAndroid::Register(JNIEnv* env) { @@ -353,8 +550,8 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { }, { .name = "nativeRunBundleAndSnapshot", - .signature = - "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLandroid/content/res/AssetManager;)V", + .signature = "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/" + "String;ZLandroid/content/res/AssetManager;)V", .fnPtr = reinterpret_cast(&shell::RunBundleAndSnapshot), }, { @@ -373,11 +570,6 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { .signature = "(J)V", .fnPtr = reinterpret_cast(&shell::Detach), }, - { - .name = "nativeDestroy", - .signature = "(J)V", - .fnPtr = reinterpret_cast(&shell::Destroy), - }, { .name = "nativeGetObservatoryUri", .signature = "()Ljava/lang/String;", diff --git a/shell/platform/android/vsync_waiter_android.cc b/shell/platform/android/vsync_waiter_android.cc index 29e1958dcc011..052de023b9a12 100644 --- a/shell/platform/android/vsync_waiter_android.cc +++ b/shell/platform/android/vsync_waiter_android.cc @@ -7,7 +7,7 @@ #include #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" @@ -16,68 +16,49 @@ namespace shell { +static jlong CreatePendingCallback(VsyncWaiter::Callback callback); + +static void ConsumePendingCallback(jlong java_baton, + fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time); + static fml::jni::ScopedJavaGlobalRef* g_vsync_waiter_class = nullptr; static jmethodID g_async_wait_for_vsync_method_ = nullptr; -VsyncWaiterAndroid::VsyncWaiterAndroid() : weak_factory_(this) {} +VsyncWaiterAndroid::VsyncWaiterAndroid(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)) {} VsyncWaiterAndroid::~VsyncWaiterAndroid() = default; -void VsyncWaiterAndroid::AsyncWaitForVsync(Callback callback) { - FXL_DCHECK(!callback_); - callback_ = std::move(callback); - fml::WeakPtr* weak = - new fml::WeakPtr(); - *weak = weak_factory_.GetWeakPtr(); +// |shell::VsyncWaiter| +void VsyncWaiterAndroid::AwaitVSync() { + auto java_baton = + CreatePendingCallback(std::bind(&VsyncWaiterAndroid::FireCallback, // + this, // + std::placeholders::_1, // + std::placeholders::_2 // + )); - blink::Threads::Platform()->PostTask([weak] { + task_runners_.GetPlatformTaskRunner()->PostTask([java_baton]() { JNIEnv* env = fml::jni::AttachCurrentThread(); - env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), - g_async_wait_for_vsync_method_, - reinterpret_cast(weak)); + env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), // + g_async_wait_for_vsync_method_, // + java_baton // + ); }); } -void VsyncWaiterAndroid::OnVsync(int64_t frameTimeNanos, - int64_t frameTargetTimeNanos) { - Callback callback = std::move(callback_); - callback_ = Callback(); - blink::Threads::UI()->PostTask( - [callback, frameTimeNanos, frameTargetTimeNanos] { - callback(fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTimeNanos)), - fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos))); - }); -} - static void OnNativeVsync(JNIEnv* env, jclass jcaller, jlong frameTimeNanos, jlong frameTargetTimeNanos, - jlong cookie) { - // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight - // Vsync" checkbox in the timeline can be enabled. - // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 - // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); -#else - { - constexpr size_t num_chars = sizeof(jlong) * CHAR_BIT * 3.4 + 2; - char deadline[num_chars]; - sprintf(deadline, "%lld", frameTargetTimeNanos / 1000); // microseconds - TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); - } -#endif - fml::WeakPtr* weak = - reinterpret_cast*>(cookie); - VsyncWaiterAndroid* waiter = weak->get(); - delete weak; - if (waiter) { - waiter->OnVsync(static_cast(frameTimeNanos), - static_cast(frameTargetTimeNanos)); - } + jlong java_baton) { + auto frame_time = fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTimeNanos)); + auto target_time = fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos)); + + ConsumePendingCallback(java_baton, frame_time, target_time); } bool VsyncWaiterAndroid::Register(JNIEnv* env) { @@ -105,4 +86,27 @@ bool VsyncWaiterAndroid::Register(JNIEnv* env) { return env->RegisterNatives(clazz, methods, arraysize(methods)) == 0; } +struct PendingCallbackData { + VsyncWaiter::Callback callback; + + PendingCallbackData(VsyncWaiter::Callback p_callback) + : callback(std::move(p_callback)) { + FXL_DCHECK(callback); + } +}; + +static jlong CreatePendingCallback(VsyncWaiter::Callback callback) { + // This delete for this new is balanced in the consume call. + auto data = new PendingCallbackData(std::move(callback)); + return reinterpret_cast(data); +} + +static void ConsumePendingCallback(jlong java_baton, + fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { + auto data = reinterpret_cast(java_baton); + data->callback(frame_start_time, frame_target_time); + delete data; +} + } // namespace shell diff --git a/shell/platform/android/vsync_waiter_android.h b/shell/platform/android/vsync_waiter_android.h index c73af4bfca6f0..fd72a0a21f563 100644 --- a/shell/platform/android/vsync_waiter_android.h +++ b/shell/platform/android/vsync_waiter_android.h @@ -12,22 +12,17 @@ namespace shell { -class VsyncWaiterAndroid : public VsyncWaiter { +class VsyncWaiterAndroid final : public VsyncWaiter { public: - VsyncWaiterAndroid(); - - ~VsyncWaiterAndroid() override; - static bool Register(JNIEnv* env); - void AsyncWaitForVsync(Callback callback) override; + VsyncWaiterAndroid(blink::TaskRunners task_runners); - void OnVsync(int64_t frameTimeNanos, int64_t frameTargetTimeNanos); + ~VsyncWaiterAndroid() override; private: - Callback callback_; - fml::WeakPtr self_; - fml::WeakPtrFactory weak_factory_; + // |shell::VsyncWaiter| + void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterAndroid); }; diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index c971c443bcc30..c6f7acd6be76a 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -6,11 +6,8 @@ assert(is_mac || is_ios) group("darwin") { if (is_mac) { - deps = [ - "desktop:shell_standalone", - ] if (!is_fuchsia_host) { - deps += [ + deps = [ "desktop:shell_application_bundle", ] } @@ -45,15 +42,12 @@ source_set("flutter_channels") { "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", - "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", "//third_party/skia", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } executable("flutter_channels_unittests") { @@ -68,7 +62,7 @@ executable("flutter_channels_unittests") { deps = [ ":flutter_channels", - "//third_party/dart/runtime:libdart_jit", "$flutter_root/testing", + "//third_party/dart/runtime:libdart_jit", ] } diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index e6fa86366b080..a1023737973a7 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -9,28 +9,23 @@ source_set("common") { sources = [ "buffer_conversions.h", "buffer_conversions.mm", - "platform_mac.h", - "platform_mac.mm", - "process_info_mac.cc", - "process_info_mac.h", + "command_line.h", + "command_line.mm", ] set_sources_assignment_filter(sources_assignment_filter) deps = [ - "//third_party/dart/runtime:dart_api", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", - "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:dart_api", "//third_party/skia", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } diff --git a/shell/platform/darwin/common/command_line.h b/shell/platform/darwin/common/command_line.h new file mode 100644 index 0000000000000..dfc995b90f378 --- /dev/null +++ b/shell/platform/darwin/common/command_line.h @@ -0,0 +1,17 @@ +// Copyright 2017 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_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ + +#include "lib/fxl/command_line.h" +#include "lib/fxl/macros.h" + +namespace shell { + +fxl::CommandLine CommandLineFromNSProcessInfo(); + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ diff --git a/shell/platform/darwin/common/command_line.mm b/shell/platform/darwin/common/command_line.mm new file mode 100644 index 0000000000000..bf8d4cc9d40f4 --- /dev/null +++ b/shell/platform/darwin/common/command_line.mm @@ -0,0 +1,21 @@ +// Copyright 2017 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/shell/platform/darwin/common/command_line.h" + +#import + +namespace shell { + +fxl::CommandLine CommandLineFromNSProcessInfo() { + std::vector args_vector; + + for (NSString* arg in [NSProcessInfo processInfo].arguments) { + args_vector.emplace_back(arg.UTF8String); + } + + return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); +} + +} // namespace shell diff --git a/shell/platform/darwin/common/platform_mac.h b/shell/platform/darwin/common/platform_mac.h deleted file mode 100644 index 1989b25f11c43..0000000000000 --- a/shell/platform/darwin/common/platform_mac.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ -#define SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ - -#include "flutter/shell/common/engine.h" - -namespace shell { - -void PlatformMacMain(std::string icu_data_path, - std::string application_library_path, - std::string bundle_path); - -bool AttemptLaunchFromCommandLineSwitches(Engine* engine); - -} // namespace shell - -#endif // SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ diff --git a/shell/platform/darwin/common/platform_mac.mm b/shell/platform/darwin/common/platform_mac.mm deleted file mode 100644 index 5af35a430beef..0000000000000 --- a/shell/platform/darwin/common/platform_mac.mm +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/platform/darwin/common/platform_mac.h" - -#include - -#include "flutter/common/threads.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/start_up.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/common/tracing_controller.h" -#include "flutter/sky/engine/wtf/MakeUnique.h" -#include "lib/fxl/command_line.h" -#include "lib/fxl/strings/string_view.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace shell { - -static fxl::CommandLine InitializedCommandLine() { - std::vector args_vector; - - for (NSString* arg in [NSProcessInfo processInfo].arguments) { - args_vector.emplace_back(arg.UTF8String); - } - - return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); -} - -class EmbedderState { - public: - EmbedderState(std::string icu_data_path, - std::string application_library_path, - std::string bundle_path) { - blink::engine_main_enter_ts = Dart_TimelineGetMicros(); - FXL_DCHECK([NSThread isMainThread]) - << "Embedder initialization must occur on the main platform thread"; - - auto command_line = InitializedCommandLine(); - - // This is about as early as tracing of any kind can start. Add an instant - // marker that can be used as a reference for startup. - TRACE_EVENT_INSTANT0("flutter", "main"); - - shell::Shell::InitStandalone(std::move(command_line), icu_data_path, application_library_path, - bundle_path); - } - - ~EmbedderState() {} - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderState); -}; - -void PlatformMacMain(std::string icu_data_path, - std::string application_library_path, - std::string bundle_path) { - static std::unique_ptr g_embedder; - static std::once_flag once_main; - - std::call_once(once_main, [&]() { - g_embedder = - WTF::MakeUnique(icu_data_path, application_library_path, bundle_path); - }); -} - -static bool FlagsValidForCommandLineLaunch(const std::string& bundle_path, - const std::string& main, - const std::string& packages) { - if (main.empty() || packages.empty() || bundle_path.empty()) { - return false; - } - - // Ensure that the paths exists. This catches cases where the user has - // successfully launched the application from the tooling but has since moved - // the source files on disk and is launching again directly. - - NSFileManager* manager = [NSFileManager defaultManager]; - - if (![manager fileExistsAtPath:@(main.c_str())]) { - return false; - } - - if (![manager fileExistsAtPath:@(packages.c_str())]) { - return false; - } - - if (![manager fileExistsAtPath:@(bundle_path.c_str())]) { - return false; - } - - return true; -} - -static std::string ResolveCommandLineLaunchFlag(const fxl::StringView name) { - const auto& command_line = shell::Shell::Shared().GetCommandLine(); - - std::string command_line_option; - if (command_line.GetOptionValue(name, &command_line_option)) { - return command_line_option; - } - - const char* saved_default = - [[NSUserDefaults standardUserDefaults] stringForKey:@(name.data())].UTF8String; - - if (saved_default != NULL) { - return saved_default; - } - - return ""; -} - -bool AttemptLaunchFromCommandLineSwitches(Engine* engine) { - NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - - const auto& command_line = shell::Shell::Shared().GetCommandLine(); - - if (command_line.HasOption(FlagForSwitch(Switch::FlutterAssetsDir)) || - command_line.HasOption(FlagForSwitch(Switch::MainDartFile)) || - command_line.HasOption(FlagForSwitch(Switch::Packages))) { - // The main dart file, Flutter assets directory and the package root must be - // specified in one go. We dont want to end up in a situation where we take - // one value from the command line and the others from user defaults. In - // case, any new flags are specified, forget about all the old ones. - [defaults removeObjectForKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; - [defaults removeObjectForKey:@(FlagForSwitch(Switch::MainDartFile).data())]; - [defaults removeObjectForKey:@(FlagForSwitch(Switch::Packages).data())]; - - [defaults synchronize]; - } - - std::string bundle_path = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::FlutterAssetsDir)); - std::string main = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::MainDartFile)); - std::string packages = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::Packages)); - - if (!FlagsValidForCommandLineLaunch(bundle_path, main, packages)) { - return false; - } - - // Save the newly resolved dart main file and the package root to user - // defaults so that the next time the user launches the application in the - // simulator without the tooling, the application boots up. - [defaults setObject:@(bundle_path.c_str()) - forKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; - [defaults setObject:@(main.c_str()) forKey:@(FlagForSwitch(Switch::MainDartFile).data())]; - [defaults setObject:@(packages.c_str()) forKey:@(FlagForSwitch(Switch::Packages).data())]; - - [defaults synchronize]; - - blink::Threads::UI()->PostTask([ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { - if (engine) - engine->RunBundleAndSource(bundle_path, main, packages); - }); - - return true; -} - -} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.cc b/shell/platform/darwin/common/process_info_mac.cc deleted file mode 100644 index 11f70f305a3e9..0000000000000 --- a/shell/platform/darwin/common/process_info_mac.cc +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/platform/darwin/common/process_info_mac.h" - -namespace shell { - -ProcessInfoMac::ProcessInfoMac() = default; - -ProcessInfoMac::~ProcessInfoMac() = default; - -bool ProcessInfoMac::SampleNow() { - mach_msg_type_number_t size = MACH_TASK_BASIC_INFO_COUNT; - kern_return_t result = - task_info(mach_task_self(), // - MACH_TASK_BASIC_INFO, // - reinterpret_cast(&last_sample_), // - &size); - if (result == KERN_SUCCESS) { - return true; - } - - last_sample_ = {}; - return false; -} - -size_t ProcessInfoMac::GetVirtualMemorySize() { - return last_sample_.virtual_size; -} - -size_t ProcessInfoMac::GetResidentMemorySize() { - return last_sample_.resident_size; -} - -} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.h b/shell/platform/darwin/common/process_info_mac.h deleted file mode 100644 index 7edc8034173e0..0000000000000 --- a/shell/platform/darwin/common/process_info_mac.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ - -#include -#include -#include -#include "flutter/flow/process_info.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class ProcessInfoMac : public flow::ProcessInfo { - public: - ProcessInfoMac(); - - ~ProcessInfoMac(); - - bool SampleNow() override; - - size_t GetVirtualMemorySize() override; - - size_t GetResidentMemorySize() override; - - private: - struct mach_task_basic_info last_sample_; - - FXL_DISALLOW_COPY_AND_ASSIGN(ProcessInfoMac); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ diff --git a/shell/platform/darwin/desktop/BUILD.gn b/shell/platform/darwin/desktop/BUILD.gn index a9c05f85ef284..5ec3298be4aa4 100644 --- a/shell/platform/darwin/desktop/BUILD.gn +++ b/shell/platform/darwin/desktop/BUILD.gn @@ -8,10 +8,8 @@ source_set("mac_desktop_platform") { visibility = [ ":*" ] sources = [ - "flutter_app_delegate.h", - "flutter_app_delegate.m", - "flutter_application.h", - "flutter_application.mm", + "flutter_application_delegate.h", + "flutter_application_delegate.mm", "flutter_window.h", "flutter_window.mm", "main_mac.mm", @@ -22,32 +20,22 @@ source_set("mac_desktop_platform") { ] deps = [ - "//third_party/dart/runtime:libdart_jit", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", - "$flutter_root/shell/testing", "$flutter_root/synchronization", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", "//third_party/skia", + "//third_party/skia:gpu", ] - public_configs = [ - "$flutter_root:config", - ] -} - -executable("shell_standalone") { - output_name = "flutter_tester" - deps = [ - ":mac_desktop_platform", - ] + public_configs = [ "$flutter_root:config" ] } if (!is_fuchsia_host) { - import("//build/config/mac/rules.gni") resource_copy_mac("mac_desktop_resources") { diff --git a/shell/platform/darwin/desktop/Info.plist b/shell/platform/darwin/desktop/Info.plist index 31d3f1240db6b..048afb6dadca2 100644 --- a/shell/platform/darwin/desktop/Info.plist +++ b/shell/platform/darwin/desktop/Info.plist @@ -9,11 +9,11 @@ CFBundleIconFile CFBundleIdentifier - io.flutter + io.flutter.engine CFBundleInfoDictionaryVersion 6.0 CFBundleName - Flutter + Flutter Engine CFBundlePackageType APPL CFBundleShortVersionString @@ -26,9 +26,7 @@ 10.6 NSHumanReadableCopyright Copyright 2015 The Flutter Authors. All rights reserved. - NSMainNibFile - flutter_mac NSPrincipalClass - FlutterApplication + NSApplication diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.h b/shell/platform/darwin/desktop/flutter_app_delegate.h deleted file mode 100644 index d6addcb17d0a4..0000000000000 --- a/shell/platform/darwin/desktop/flutter_app_delegate.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 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. - -#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ -#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ - -#import - -@interface FlutterAppDelegate : NSObject - -@end - -#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__) */ diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.m b/shell/platform/darwin/desktop/flutter_app_delegate.m deleted file mode 100644 index 7e2dfd68389f8..0000000000000 --- a/shell/platform/darwin/desktop/flutter_app_delegate.m +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2015 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 "flutter_app_delegate.h" - -@interface FlutterAppDelegate () - -@property(assign) IBOutlet NSWindow* window; - -@end - -@implementation FlutterAppDelegate - -@end diff --git a/shell/platform/darwin/desktop/flutter_application.mm b/shell/platform/darwin/desktop/flutter_application.mm deleted file mode 100644 index 57b1c83ba069a..0000000000000 --- a/shell/platform/darwin/desktop/flutter_application.mm +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/platform/darwin/desktop/flutter_application.h" - -@implementation FlutterApplication -@end diff --git a/shell/platform/darwin/desktop/flutter_application.h b/shell/platform/darwin/desktop/flutter_application_delegate.h similarity index 65% rename from shell/platform/darwin/desktop/flutter_application.h rename to shell/platform/darwin/desktop/flutter_application_delegate.h index 6a4167b5f273a..3995557b25e79 100644 --- a/shell/platform/darwin/desktop/flutter_application.h +++ b/shell/platform/darwin/desktop/flutter_application_delegate.h @@ -1,13 +1,14 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. +// Copyright 2017 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_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ +#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ #import -@interface FlutterApplication : NSApplication +@interface FlutterApplicationDelegate : NSObject + @end -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ diff --git a/shell/platform/darwin/desktop/flutter_application_delegate.mm b/shell/platform/darwin/desktop/flutter_application_delegate.mm new file mode 100644 index 0000000000000..03076b848b25f --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_application_delegate.mm @@ -0,0 +1,80 @@ +// Copyright 2017 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/shell/platform/darwin/desktop/flutter_application_delegate.h" +#include "flutter/shell/platform/darwin/desktop/flutter_window.h" + +#include + +@implementation FlutterApplicationDelegate + +- (void)applicationWillFinishLaunching:(NSNotification*)notification { + [self configureMainMenuBar]; + [self onNewFlutterWindow:self]; +} + +- (void)configureMainMenuBar { + NSMenu* mainMenu = [[[NSMenu alloc] initWithTitle:@"MainMenu"] autorelease]; + + NSMenuItem* engineItem = + [[[NSMenuItem alloc] initWithTitle:@"Engine" action:NULL keyEquivalent:@""] autorelease]; + + NSMenu* engineMenu = [[[NSMenu alloc] initWithTitle:@"EngineMenu"] autorelease]; + + NSMenuItem* newEngineItem = [[[NSMenuItem alloc] initWithTitle:@"New Engine" + action:@selector(onNewFlutterWindow:) + keyEquivalent:@""] autorelease]; + newEngineItem.keyEquivalent = @"n"; + newEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; + + NSMenuItem* shutdownEngineItem = + [[[NSMenuItem alloc] initWithTitle:@"Shutdown Engine" + action:@selector(onShutdownFlutterWindow:) + keyEquivalent:@""] autorelease]; + shutdownEngineItem.keyEquivalent = @"w"; + shutdownEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; + + NSMenuItem* quitItem = [[[NSMenuItem alloc] initWithTitle:@"Quit" + action:@selector(onQuitFlutterApplication:) + keyEquivalent:@""] autorelease]; + quitItem.keyEquivalent = @"q"; + quitItem.keyEquivalentModifierMask = NSCommandKeyMask; + + [mainMenu addItem:engineItem]; + [engineItem setSubmenu:engineMenu]; + [engineMenu addItem:newEngineItem]; + [engineMenu addItem:shutdownEngineItem]; + [engineMenu addItem:quitItem]; + + [NSApplication sharedApplication].mainMenu = mainMenu; +} + +- (void)onNewFlutterWindow:(id)sender { + FlutterWindow* window = [[FlutterWindow alloc] init]; + [window setReleasedWhenClosed:YES]; + + NSWindow* currentKeyWindow = [NSApplication sharedApplication].keyWindow; + + if (currentKeyWindow == nil) { + [window center]; + } else { + [window center]; + NSPoint currentWindowFrameOrigin = window.frame.origin; + currentWindowFrameOrigin.x = currentKeyWindow.frame.origin.x + 20; + currentWindowFrameOrigin.y = currentKeyWindow.frame.origin.y - 20; + [window setFrameOrigin:currentWindowFrameOrigin]; + } + + [window makeKeyAndOrderFront:sender]; +} + +- (void)onShutdownFlutterWindow:(id)sender { + [[NSApplication sharedApplication].keyWindow close]; +} + +- (void)onQuitFlutterApplication:(id)sender { + exit(0); +} + +@end diff --git a/shell/platform/darwin/desktop/flutter_mac.xib b/shell/platform/darwin/desktop/flutter_mac.xib deleted file mode 100644 index c02ab7912da5a..0000000000000 --- a/shell/platform/darwin/desktop/flutter_mac.xib +++ /dev/null @@ -1,695 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/shell/platform/darwin/desktop/flutter_window.h b/shell/platform/darwin/desktop/flutter_window.h index 851535ba38e9e..e07fe4eeb7520 100644 --- a/shell/platform/darwin/desktop/flutter_window.h +++ b/shell/platform/darwin/desktop/flutter_window.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ -#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ +#ifndef SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ +#define SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ #import @@ -11,4 +11,4 @@ @end -#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__) */ +#endif // SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ diff --git a/shell/platform/darwin/desktop/flutter_window.mm b/shell/platform/darwin/desktop/flutter_window.mm index ca080e9275742..4c87200fb3856 100644 --- a/shell/platform/darwin/desktop/flutter_window.mm +++ b/shell/platform/darwin/desktop/flutter_window.mm @@ -2,16 +2,25 @@ // 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 + #import "flutter_window.h" -#include "flutter/common/threads.h" +#include + +#include "flutter/common/task_runners.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/thread_host.h" #include "flutter/shell/gpu/gpu_surface_gl.h" +#include "flutter/shell/platform/darwin/common/command_line.h" #include "flutter/shell/platform/darwin/desktop/platform_view_mac.h" +#include "lib/fxl/functional/make_copyable.h" -@interface FlutterWindow () +@interface FlutterWindow () -@property(assign) IBOutlet NSOpenGLView* renderSurface; -@property(getter=isSurfaceSetup) BOOL surfaceSetup; +@property(strong) NSOpenGLView* renderSurface; @end @@ -37,34 +46,130 @@ @interface FlutterWindow () } @implementation FlutterWindow { - std::shared_ptr _platformView; + shell::ThreadHost _thread_host; + std::unique_ptr _shell; bool _mouseIsDown; } -@synthesize renderSurface = _renderSurface; -@synthesize surfaceSetup = _surfaceSetup; +- (instancetype)init { + self = + [super initWithContentRect:NSMakeRect(10.0, 10.0, 800.0, 600.0) + styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask + backing:NSBackingStoreBuffered + defer:YES]; + if (self) { + self.delegate = self; + [self setupRenderSurface]; + [self setupShell]; + [self updateWindowSize]; + } + + return self; +} + +- (void)setupRenderSurface { + NSOpenGLView* renderSurface = [[[NSOpenGLView alloc] init] autorelease]; + const NSOpenGLPixelFormatAttribute attrs[] = { + NSOpenGLPFADoubleBuffer, // + NSOpenGLPFAAllowOfflineRenderers, // + 0 // + }; + renderSurface.pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease]; + renderSurface.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + renderSurface.frame = + NSMakeRect(0.0, 0.0, self.contentView.bounds.size.width, self.contentView.bounds.size.height); + [self.contentView addSubview:renderSurface]; + self.renderSurface = renderSurface; +} -- (void)awakeFromNib { - [super awakeFromNib]; +static std::string CreateThreadLabel() { + std::stringstream stream; + static int index = 1; + stream << "io.flutter." << index++; + return stream.str(); +} - self.delegate = self; +- (void)setupShell { + FXL_DCHECK(!_shell) << "The shell must not already be set."; - [self updateWindowSize]; + auto thread_label = CreateThreadLabel(); + + // Create the threads on which to run the shell. + _thread_host = {thread_label, shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::UI | + shell::ThreadHost::Type::IO}; + + // Grab the task runners for the newly created threads. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::TaskRunners task_runners(thread_label, // label + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + _thread_host.gpu_thread->GetTaskRunner(), // GPU + _thread_host.ui_thread->GetTaskRunner(), // UI + _thread_host.io_thread->GetTaskRunner() // IO + ); + + // Figure out the settings from the command line arguments. + auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); + + if (settings.icu_data_path.size() == 0) { + settings.icu_data_path = + [[NSBundle mainBundle] pathForResource:@"icudtl.dat" ofType:@""].UTF8String; + } + + settings.using_blink = false; + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + // Setup the callback that will be run on the appropriate threads. + shell::Shell::CreateCallback on_create_platform_view = + [render_surface = self.renderSurface](shell::Shell& shell) { + return std::make_unique(shell, render_surface); + }; + + shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // Finally, create the shell. + _shell = shell::Shell::Create(std::move(task_runners), settings, on_create_platform_view, + on_create_rasterizer); + + // Launch the engine with the inferred run configuration. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = _shell->GetEngine(), + config = shell::RunConfiguration::InferFromSettings(_shell->GetSettings())]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch the engine with configuration."; + } + } + })); + + [self notifySurfaceCreated]; } -- (void)setupPlatformView { - FXL_DCHECK(_platformView == nullptr) << "The platform view must not already be set."; +- (void)notifySurfaceCreated { + if (!_shell || !_shell->IsSetup()) { + return; + } - _platformView = std::make_shared(self.renderSurface); - _platformView->Attach(); - _platformView->SetupResourceContextOnIOThread(); - _platformView->NotifyCreated(std::make_unique(_platformView.get())); + // Tell the platform view that it has a GL surface. + _shell->GetPlatformView()->NotifyCreated(); } -// TODO(eseidel): This does not belong in flutter_window! -// Probably belongs in NSApplicationDelegate didFinishLaunching. -- (void)setupAndLoadDart { - _platformView->SetupAndLoadDart(); +- (void)notifySurfaceDestroyed { + if (!_shell || !_shell->IsSetup()) { + return; + } + + // Tell the platform view that its surface is about to be lost. + _shell->GetPlatformView()->NotifyDestroyed(); } - (void)windowDidResize:(NSNotification*)notification { @@ -72,34 +177,28 @@ - (void)windowDidResize:(NSNotification*)notification { } - (void)updateWindowSize { - [self setupSurfaceIfNecessary]; + if (!_shell) { + return; + } blink::ViewportMetrics metrics; auto size = self.renderSurface.frame.size; metrics.physical_width = size.width; metrics.physical_height = size.height; - - blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), metrics ] { - if (engine.get()) { + _shell->GetTaskRunners().GetUITaskRunner()->PostTask([engine = _shell->GetEngine(), metrics]() { + if (engine) { engine->SetViewportMetrics(metrics); } }); } -- (void)setupSurfaceIfNecessary { - if (self.isSurfaceSetup) { - return; - } - - self.surfaceSetup = YES; - - [self setupPlatformView]; - [self setupAndLoadDart]; -} - #pragma mark - Responder overrides - (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { + if (!_shell) { + return; + } + NSPoint location = [_renderSurface convertPoint:event.locationInWindow fromView:nil]; location.y = _renderSurface.frame.size.height - location.y; @@ -134,13 +233,14 @@ - (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { break; } - blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), pointer_data ] { - if (engine.get()) { - blink::PointerDataPacket packet(1); - packet.SetPointerData(0, pointer_data); - engine->DispatchPointerDataPacket(packet); - } - }); + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = _shell->GetEngine(), pointer_data] { + if (engine) { + blink::PointerDataPacket packet(1); + packet.SetPointerData(0, pointer_data); + engine->DispatchPointerDataPacket(packet); + } + }); } - (void)mouseDown:(NSEvent*)event { @@ -155,11 +255,18 @@ - (void)mouseUp:(NSEvent*)event { [self dispatchEvent:event phase:NSEventPhaseEnded]; } -- (void)dealloc { - if (_platformView) { - _platformView->NotifyDestroyed(); - } +- (void)reset { + [self notifySurfaceDestroyed]; + _shell.reset(); + _thread_host.Reset(); +} +- (void)windowWillClose:(NSNotification*)notification { + [self reset]; +} + +- (void)dealloc { + [self reset]; [super dealloc]; } diff --git a/shell/platform/darwin/desktop/main_mac.mm b/shell/platform/darwin/desktop/main_mac.mm index 808a5f63f1d14..edd08d0c8b783 100644 --- a/shell/platform/darwin/desktop/main_mac.mm +++ b/shell/platform/darwin/desktop/main_mac.mm @@ -7,91 +7,20 @@ #include #include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/desktop/flutter_application.h" -#include "flutter/shell/testing/test_runner.h" -#include "flutter/shell/testing/testing.h" +#include "flutter/shell/platform/darwin/desktop/flutter_application_delegate.h" #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" -#include "lib/tonic/dart_microtask_queue.h" -// Exit codes used by the Dart command line tool. -const int kApiErrorExitCode = 253; -const int kCompilationErrorExitCode = 254; -const int kErrorExitCode = 255; - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver : public fml::TaskObserver { - public: - ScriptCompletionTaskObserver(fxl::RefPtr task_runner) - : main_task_runner_(std::move(task_runner)), - prev_live_(false), - last_error_(tonic::kNoError) {} - - void DidProcessTask() override { - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - shell::Engine& engine = test_runner.platform_view().engine(); - - if (engine.GetLoadScriptError() != tonic::kNoError) { - last_error_ = engine.GetLoadScriptError(); - main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); - return; - } - - bool live = engine.UIIsolateHasLivePorts(); - if (prev_live_ && !live) { - last_error_ = engine.GetUIIsolateLastError(); - main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - prev_live_ = live; - } - - tonic::DartErrorHandleType last_error() { return last_error_; } - - private: - fxl::RefPtr main_task_runner_; - bool prev_live_; - tonic::DartErrorHandleType last_error_; -}; - -int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { - switch (error) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } -} - -static fxl::CommandLine InitializedCommandLine() { +int main(int argc, const char* argv[]) { std::vector args_vector; for (NSString* arg in [NSProcessInfo processInfo].arguments) { args_vector.emplace_back(arg.UTF8String); } - return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); -} - -int main(int argc, const char* argv[]) { - [FlutterApplication sharedApplication]; - - // Can't use shell::Shell::Shared().GetCommandLine() because it is initialized only - // in shell::PlatformMacMain call below. - auto command_line = InitializedCommandLine(); - - std::string bundle_path = ""; - command_line.GetOptionValue(FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); - - shell::PlatformMacMain("", "", bundle_path); + auto command_line = fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); // Print help. if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { @@ -99,36 +28,7 @@ int main(int argc, const char* argv[]) { return EXIT_SUCCESS; } - // Decide between interactive and non-interactive modes. - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::NonInteractive))) { - if (!shell::InitForTesting(std::move(command_line))) - return 1; - - // Note that this task observer must be added after the observer that drains - // the microtask queue. - ScriptCompletionTaskObserver task_observer(fml::MessageLoop::GetCurrent().GetTaskRunner()); - blink::Threads::UI()->PostTask( - [&task_observer] { fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); }); - - fml::MessageLoop::GetCurrent().Run(); - - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - tonic::DartErrorHandleType error = test_runner.platform_view().engine().GetLoadScriptError(); - if (error == tonic::kNoError) - error = task_observer.last_error(); - if (error == tonic::kNoError) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&error, &latch] { - error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); - latch.Signal(); - }); - latch.Wait(); - } - - // The script has completed and the engine may not be in a clean state, - // so just stop the process. - exit(ConvertErrorTypeToExitCode(error)); - } else { - return NSApplicationMain(argc, argv); - } + [NSApplication sharedApplication].delegate = + [[[FlutterApplicationDelegate alloc] init] autorelease]; + return NSApplicationMain(argc, argv); } diff --git a/shell/platform/darwin/desktop/platform_view_mac.h b/shell/platform/darwin/desktop/platform_view_mac.h index 501400b6803d4..d4b19b94d1d99 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.h +++ b/shell/platform/darwin/desktop/platform_view_mac.h @@ -7,6 +7,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "lib/fxl/memory/weak_ptr.h" @@ -15,15 +16,13 @@ namespace shell { -class PlatformViewMac : public PlatformView, public GPUSurfaceGLDelegate { +class PlatformViewMac final : public PlatformView, public GPUSurfaceGLDelegate { public: - PlatformViewMac(NSOpenGLView* gl_view); + PlatformViewMac(Shell& shell, NSOpenGLView* gl_view); ~PlatformViewMac() override; - virtual void Attach() override; - - void SetupAndLoadDart(); + std::unique_ptr CreateVSyncWaiter() override; bool GLContextMakeCurrent() override; @@ -33,27 +32,17 @@ class PlatformViewMac : public PlatformView, public GPUSurfaceGLDelegate { intptr_t GLContextFBO() const override; - VsyncWaiter* GetVsyncWaiter() override; - - bool ResourceContextMakeCurrent() override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - void SetAssetBundlePath(const std::string& assets_directory) override; - private: fml::scoped_nsobject opengl_view_; fml::scoped_nsobject resource_loading_context_; bool IsValid() const; - void SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages); + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; - void SetAssetBundlePathOnUI(const std::string& assets_directory); + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewMac); }; diff --git a/shell/platform/darwin/desktop/platform_view_mac.mm b/shell/platform/darwin/desktop/platform_view_mac.mm index 42948386fbcd4..f25fa6945af23 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.mm +++ b/shell/platform/darwin/desktop/platform_view_mac.mm @@ -7,77 +7,26 @@ #include #include -#include "flutter/common/threads.h" #include "flutter/fml/trace_event.h" +#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/common/process_info_mac.h" #include "flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h" #include "lib/fxl/command_line.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewMac::PlatformViewMac(NSOpenGLView* gl_view) - : PlatformView(std::make_unique(std::make_unique())), +PlatformViewMac::PlatformViewMac(Shell& shell, NSOpenGLView* gl_view) + : PlatformView(shell, shell.GetTaskRunners()), opengl_view_([gl_view retain]), resource_loading_context_([[NSOpenGLContext alloc] initWithFormat:gl_view.pixelFormat shareContext:gl_view.openGLContext]) {} PlatformViewMac::~PlatformViewMac() = default; -void PlatformViewMac::Attach() { - CreateEngine(); -} - -void PlatformViewMac::SetupAndLoadDart() { - if (AttemptLaunchFromCommandLineSwitches(&engine())) { - // This attempts launching from a Flutter assets directory that does not - // contain a dart snapshot. - return; - } - - const auto& command_line = shell::Shell::Shared().GetCommandLine(); - - std::string bundle_path = - command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::FlutterAssetsDir), ""); - if (!bundle_path.empty()) { - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), bundle_path ] { - if (engine) - engine->RunBundle(bundle_path); - }); - return; - } - - auto args = command_line.positional_args(); - if (args.size() > 0) { - std::string main = args[0]; - std::string packages = - command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::Packages), ""); - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), main, packages ] { - if (engine) - engine->RunBundleAndSource(std::string(), main, packages); - }); - return; - } -} - -void PlatformViewMac::SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - blink::Threads::UI()->PostTask( - [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { - if (engine) - engine->RunBundleAndSource(assets_directory, main, packages); - }); -} - -void PlatformViewMac::SetAssetBundlePathOnUI(const std::string& assets_directory) { - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { - if (engine) - engine->SetAssetBundlePath(assets_directory); - }); +std::unique_ptr PlatformViewMac::CreateVSyncWaiter() { + return std::make_unique(task_runners_); } intptr_t PlatformViewMac::GLContextFBO() const { @@ -115,21 +64,9 @@ return true; } -VsyncWaiter* PlatformViewMac::GetVsyncWaiter() { - if (!vsync_waiter_) - vsync_waiter_ = std::make_unique(); - return vsync_waiter_.get(); -} - -bool PlatformViewMac::ResourceContextMakeCurrent() { - NSOpenGLContext* context = resource_loading_context_.get(); - - if (context == nullptr) { - return false; - } - - [context makeCurrentContext]; - return true; +sk_sp PlatformViewMac::CreateResourceContext() const { + [resource_loading_context_.get() makeCurrentContext]; + return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); } bool PlatformViewMac::IsValid() const { @@ -146,30 +83,8 @@ return true; } -void PlatformViewMac::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetupAndLoadFromSource(assets_directory, main, packages); - latch->Signal(); - }); - - latch->Wait(); - delete latch; -} - -void PlatformViewMac::SetAssetBundlePath(const std::string& assets_directory) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetAssetBundlePathOnUI(assets_directory); - latch->Signal(); - }); - - latch->Wait(); - delete latch; +std::unique_ptr PlatformViewMac::CreateRenderingSurface() { + return std::make_unique(this); } } // namespace shell diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.cc b/shell/platform/darwin/desktop/vsync_waiter_mac.cc index a28ff62edb918..0ccadaf42754d 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.cc +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.cc @@ -6,14 +6,14 @@ #include -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { #define link_ (reinterpret_cast(opaque_)) -VsyncWaiterMac::VsyncWaiterMac() : opaque_(nullptr) { +VsyncWaiterMac::VsyncWaiterMac(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)), opaque_(nullptr) { // Create the link. CVDisplayLinkRef link = nullptr; CVDisplayLinkCreateWithActiveCGDisplays(&link); @@ -48,18 +48,10 @@ void VsyncWaiterMac::OnDisplayLink() { CVDisplayLinkStop(link_); - auto callback = std::move(callback_); - callback_ = Callback(); - - blink::Threads::UI()->PostTask( - [callback, frame_start_time, frame_target_time] { - callback(frame_start_time, frame_target_time); - }); + FireCallback(frame_start_time, frame_target_time); } -void VsyncWaiterMac::AsyncWaitForVsync(Callback callback) { - FXL_DCHECK(!callback_); - callback_ = std::move(callback); +void VsyncWaiterMac::AwaitVSync() { CVDisplayLinkStart(link_); } diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.h b/shell/platform/darwin/desktop/vsync_waiter_mac.h index 15f551f212901..0ad929a509ea3 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.h +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.h @@ -10,19 +10,19 @@ namespace shell { -class VsyncWaiterMac : public VsyncWaiter { +class VsyncWaiterMac final : public VsyncWaiter { public: - VsyncWaiterMac(); + VsyncWaiterMac(blink::TaskRunners task_runners); ~VsyncWaiterMac() override; - void AsyncWaitForVsync(Callback callback) override; - private: void* opaque_; - Callback callback_; + + void AwaitVSync() override; static void OnDisplayLink(void* context); + void OnDisplayLink(); FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterMac); diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 310af79c2ed8e..8946ee954c23a 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -40,8 +40,6 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterDartProject.mm", "framework/Source/FlutterDartProject_Internal.h", "framework/Source/FlutterHeadlessDartRunner.mm", - "framework/Source/FlutterDartSource.h", - "framework/Source/FlutterDartSource.mm", "framework/Source/FlutterNavigationController.mm", "framework/Source/FlutterPlatformPlugin.h", "framework/Source/FlutterPlatformPlugin.mm", @@ -53,14 +51,15 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterView.h", "framework/Source/FlutterView.mm", "framework/Source/FlutterViewController.mm", + "framework/Source/FlutterViewController_Internal.h", "framework/Source/accessibility_bridge.h", "framework/Source/accessibility_bridge.mm", "framework/Source/accessibility_text_entry.h", "framework/Source/accessibility_text_entry.mm", - "framework/Source/flutter_main_ios.h", - "framework/Source/flutter_main_ios.mm", "framework/Source/flutter_touch_mapper.h", "framework/Source/flutter_touch_mapper.mm", + "framework/Source/platform_message_response_darwin.h", + "framework/Source/platform_message_response_darwin.mm", "framework/Source/platform_message_router.h", "framework/Source/platform_message_router.mm", "framework/Source/vsync_waiter_ios.h", @@ -86,6 +85,7 @@ shared_library("create_flutter_framework_dylib") { "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/ui", + "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", @@ -95,7 +95,10 @@ shared_library("create_flutter_framework_dylib") { "//third_party/skia", ] if (flutter_runtime_mode == "debug") { - deps += [ "//third_party/dart/runtime:libdart_jit" ] + deps += [ + "$flutter_root/lib/snapshot", + "//third_party/dart/runtime:libdart_jit", + ] } else { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index d5f30d02664d9..3c613c9fbad8f 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -2,42 +2,121 @@ // 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/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" +#include "flutter/fml/message_loop.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" +#include "flutter/runtime/dart_vm.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" -#include "lib/fxl/strings/string_view.h" -#include "third_party/dart/runtime/include/dart_api.h" - -static NSURL* URLForSwitch(const fxl::StringView name) { - const auto& cmd = shell::Shell::Shared().GetCommandLine(); - NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - - std::string switch_value; - if (cmd.GetOptionValue(name, &switch_value)) { - auto url = [NSURL fileURLWithPath:@(switch_value.c_str())]; - [defaults setURL:url forKey:@(name.data())]; - [defaults synchronize]; - return url; +#include "flutter/shell/platform/darwin/common/command_line.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" + +static const char* kScriptSnapshotFileName = "snapshot_blob.bin"; +static const char* kVMKernelSnapshotFileName = "platform.dill"; +static const char* kApplicationKernelSnapshotFileName = "kernel_blob.bin"; + +static blink::Settings DefaultSettingsForProcess() { + auto command_line = shell::CommandLineFromNSProcessInfo(); + + // Settings passed in explicitly via command line arguments take priority. + auto settings = shell::SettingsFromCommandLine(command_line); + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + // The command line arguments may not always be complete. If they aren't, attempt to fill in + // defaults. + + // Flutter ships the ICU data file in the the bundle of the engine. Look for it there. + if (settings.icu_data_path.size() == 0) { + NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; + NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; + if (icuDataPath.length > 0) { + settings.icu_data_path = icuDataPath.UTF8String; + } } - return [defaults URLForKey:@(name.data())]; -} + if (blink::DartVM::IsRunningPrecompiledCode()) { + // The application bundle could be specified in the Info.plist. + if (settings.application_library_path.size() == 0) { + NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; + NSString* libraryPath = [[NSBundle mainBundle] pathForResource:libraryName ofType:nil]; + if (libraryPath.length > 0) { + settings.application_library_path = + [NSBundle bundleWithPath:libraryPath].executablePath.UTF8String; + } + } -@implementation FlutterDartProject { - NSBundle* _precompiledDartBundle; - FlutterDartSource* _dartSource; + // In case the application bundle is still not specified, look for the App.framework in the + // Frameworks directory. + if (settings.application_library_path.size() == 0) { + NSString* applicationFrameworkPath = + [[NSBundle mainBundle] pathForResource:@"Frameworks/App.framework" ofType:@""]; + if (applicationFrameworkPath.length > 0) { + settings.application_library_path = + [NSBundle bundleWithPath:applicationFrameworkPath].executablePath.UTF8String; + } + } + } - VMType _vmTypeRequirement; + // Checks to see if the flutter assets directory is already present. + if (settings.assets_path.size() == 0) { + NSString* assetsPath = [[NSBundle mainBundle] pathForResource:@"flutter_assets" ofType:@""]; + + if (assetsPath.length > 0) { + settings.assets_path = assetsPath.UTF8String; + + if (!blink::DartVM::IsRunningPrecompiledCode()) { + // Looking for the various script and kernel snapshot buffers only makes sense if we have a + // VM that can use these buffers. + { + // Check if there is a script snapshot in the assets directory we could potentially use. + NSURL* scriptSnapshotURL = [NSURL URLWithString:@(kScriptSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotURL.path]) { + settings.script_snapshot_path = scriptSnapshotURL.path.UTF8String; + } + } + + { + // Check if there is a VM kernel snapshot in the assets directory we could potentially + // use. + NSURL* vmKernelSnapshotURL = [NSURL URLWithString:@(kVMKernelSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:vmKernelSnapshotURL.path]) { + settings.kernel_snapshot_path = vmKernelSnapshotURL.path.UTF8String; + } + } + + { + // Check if there is an application kernel snapshot in the assets directory we could + // potentially use. + NSURL* applicationKernelSnapshotURL = + [NSURL URLWithString:@(kApplicationKernelSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:applicationKernelSnapshotURL.path]) { + settings.application_kernel_asset = applicationKernelSnapshotURL.path.UTF8String; + } + } + } + } + } + + return settings; } -+ (void)initialize { - if (self == [FlutterDartProject class]) { - shell::FlutterMain(); - } +@implementation FlutterDartProject { + fml::scoped_nsobject _precompiledDartBundle; + blink::Settings _settings; } #pragma mark - Override base class designated initializers @@ -52,9 +131,16 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle { self = [super init]; if (self) { - _precompiledDartBundle = [bundle retain]; + _precompiledDartBundle.reset([bundle retain]); - [self checkReadiness]; + _settings = DefaultSettingsForProcess(); + + if (bundle != nil) { + NSString* executablePath = _precompiledDartBundle.get().executablePath; + if ([[NSFileManager defaultManager] fileExistsAtPath:executablePath]) { + _settings.application_library_path = executablePath.UTF8String; + } + } } return self; @@ -66,11 +152,15 @@ - (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _dartSource = [[FlutterDartSource alloc] initWithDartMain:dartMainURL - packages:dartPackages - flutterAssets:flutterAssetsURL]; + _settings = DefaultSettingsForProcess(); - [self checkReadiness]; + if ([[NSFileManager defaultManager] fileExistsAtPath:dartMainURL.path]) { + _settings.main_dart_file_path = dartMainURL.path.UTF8String; + } + + if ([[NSFileManager defaultManager] fileExistsAtPath:dartPackages.path]) { + _settings.packages_file_path = dartPackages.path.UTF8String; + } } return self; @@ -80,10 +170,17 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _dartSource = - [[FlutterDartSource alloc] initWithFlutterAssetsWithScriptSnapshot:flutterAssetsURL]; + _settings = DefaultSettingsForProcess(); - [self checkReadiness]; + if ([[NSFileManager defaultManager] fileExistsAtPath:flutterAssetsURL.path]) { + _settings.assets_path = flutterAssetsURL.path.UTF8String; + + NSURL* scriptSnapshotPath = + [NSURL URLWithString:@(kScriptSnapshotFileName) relativeToURL:flutterAssetsURL]; + if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotPath.path]) { + _settings.script_snapshot_path = scriptSnapshotPath.path.UTF8String; + } + } } return self; @@ -92,56 +189,19 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL #pragma mark - Convenience initializers - (instancetype)initFromDefaultSourceForConfiguration { - NSBundle* bundle = [NSBundle mainBundle]; - - if (Dart_IsPrecompiledRuntime()) { - // Load from an AOTC snapshot. - return [self initWithPrecompiledDartBundle:bundle]; + if (blink::DartVM::IsRunningPrecompiledCode()) { + return [self initWithPrecompiledDartBundle:nil]; } else { - // Load directly from sources if the appropriate command line flags are - // specified. If not, try loading from a script snapshot in the framework - // bundle. - NSURL* flutterAssetsURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::FlutterAssetsDir)); - - if (flutterAssetsURL == nil) { - // If the URL was not specified on the command line, look inside the - // FlutterApplication bundle. - NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:bundle]; - if (flutterAssetsPath != nil) { - flutterAssetsURL = [NSURL fileURLWithPath:flutterAssetsPath isDirectory:NO]; - } - } - - if (flutterAssetsURL == nil) { - NSLog(@"Error: flutterAssets directory not present in bundle; unable to start app."); - [self release]; - return nil; - } - - NSURL* dartMainURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::MainDartFile)); - NSURL* dartPackagesURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::Packages)); - - return - [self initWithFlutterAssets:flutterAssetsURL dartMain:dartMainURL packages:dartPackagesURL]; + return [self initWithFlutterAssets:nil dartMain:nil packages:nil]; } - - NSAssert(NO, @"Unreachable"); - [self release]; - return nil; } -#pragma mark - Common initialization tasks - -- (void)checkReadiness { - if (_precompiledDartBundle != nil) { - _vmTypeRequirement = VMTypePrecompilation; - return; - } +- (const blink::Settings&)settings { + return _settings; +} - if (_dartSource != nil) { - _vmTypeRequirement = VMTypeInterpreter; - return; - } +- (shell::RunConfiguration)runConfiguration { + return shell::RunConfiguration::InferFromSettings(_settings); } #pragma mark - Assets-related utilities @@ -161,7 +221,7 @@ + (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle { } + (NSString*)lookupKeyForAsset:(NSString*)asset { - NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName: [NSBundle mainBundle]]; + NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName:[NSBundle mainBundle]]; return [NSString stringWithFormat:@"%@/%@", flutterAssetsName, asset]; } @@ -169,179 +229,4 @@ + (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { return [self lookupKeyForAsset:[NSString stringWithFormat:@"packages/%@/%@", package, asset]]; } -#pragma mark - Launching the project in a preconfigured engine. - -static NSString* NSStringFromVMType(VMType type) { - switch (type) { - case VMTypeInvalid: - return @"Invalid"; - case VMTypeInterpreter: - return @"Interpreter"; - case VMTypePrecompilation: - return @"Precompilation"; - } - - return @"Unknown"; -} - -- (void)launchInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - embedderVMType:(VMType)embedderVMType - result:(LaunchResult)result { - if (_vmTypeRequirement == VMTypeInvalid) { - result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); - return; - } - - if (embedderVMType == VMTypeInvalid) { - result(NO, @"The embedder is invalid."); - return; - } - - if (_vmTypeRequirement != embedderVMType) { - NSString* message = - [NSString stringWithFormat: - @"Could not load the project because of differing project type. " - @"The project can run in '%@' but the embedder is configured as " - @"'%@'", - NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; - result(NO, message); - return; - } - - switch (_vmTypeRequirement) { - case VMTypeInterpreter: - [self runFromSourceInEngine:engine withEntrypoint:entrypoint result:result]; - return; - case VMTypePrecompilation: - [self runFromPrecompiledSourceInEngine:engine withEntrypoint:entrypoint result:result]; - return; - case VMTypeInvalid: - break; - } - - return result(NO, @"Internal error"); -} - -- (void)launchInEngine:(shell::Engine*)engine - embedderVMType:(VMType)embedderVMType - result:(LaunchResult)result { - if (_vmTypeRequirement == VMTypeInvalid) { - result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); - return; - } - - if (embedderVMType == VMTypeInvalid) { - result(NO, @"The embedder is invalid."); - return; - } - - if (_vmTypeRequirement != embedderVMType) { - NSString* message = - [NSString stringWithFormat: - @"Could not load the project because of differing project type. " - @"The project can run in '%@' but the embedder is configured as " - @"'%@'", - NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; - result(NO, message); - return; - } - - switch (_vmTypeRequirement) { - case VMTypeInterpreter: - [self runFromSourceInEngine:engine withEntrypoint:@"main" result:result]; - return; - case VMTypePrecompilation: - [self runFromPrecompiledSourceInEngine:engine withEntrypoint:@"main" result:result]; - return; - case VMTypeInvalid: - break; - } - - return result(NO, @"Internal error"); -} - -#pragma mark - Running from precompiled application bundles - -- (void)runFromPrecompiledSourceInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - result:(LaunchResult)result { - if (![_precompiledDartBundle load]) { - NSString* message = [NSString - stringWithFormat:@"Could not load the framework ('%@') containing precompiled code.", - _precompiledDartBundle.bundleIdentifier]; - result(NO, message); - return; - } - - NSString* path = [FlutterDartProject pathForFlutterAssetsFromBundle:_precompiledDartBundle]; - if (path.length == 0) { - NSString* message = [NSString stringWithFormat: - @"Could not find the 'flutter_assets' dir in " - @"the precompiled Dart bundle with ID '%@'", - _precompiledDartBundle.bundleIdentifier]; - result(NO, message); - return; - } - - std::string bundle_path = path.UTF8String; - blink::Threads::UI()->PostTask([ - engine = engine->GetWeakPtr(), bundle_path, entrypoint = std::string([entrypoint UTF8String]) - ] { - if (engine) - engine->RunBundle(bundle_path, entrypoint); - }); - - result(YES, @"Success"); -} - -#pragma mark - Running from source - -- (void)runFromSourceInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - result:(LaunchResult)result { - if (_dartSource == nil) { - result(NO, @"Dart source not specified."); - return; - } - - [_dartSource validate:^(BOOL success, NSString* message) { - if (!success) { - return result(NO, message); - } - - std::string bundle_path = _dartSource.flutterAssets.absoluteURL.path.UTF8String; - - if (_dartSource.assetsDirContainsScriptSnapshot) { - blink::Threads::UI()->PostTask([ - engine = engine->GetWeakPtr(), bundle_path, - entrypoint = std::string([entrypoint UTF8String]) - ] { - if (engine) - engine->RunBundle(bundle_path, entrypoint); - }); - } else { - std::string main = _dartSource.dartMain.absoluteURL.path.UTF8String; - std::string packages = _dartSource.packages.absoluteURL.path.UTF8String; - blink::Threads::UI()->PostTask( - [ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { - if (engine) - engine->RunBundleAndSource(bundle_path, main, packages); - }); - } - - result(YES, @"Success"); - }]; -} - -#pragma mark - Misc. - -- (void)dealloc { - [_precompiledDartBundle unload]; - [_precompiledDartBundle release]; - [_dartSource release]; - - [super dealloc]; -} - @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h index 75db7c4049dd9..7fe1fc364f328 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h @@ -5,32 +5,15 @@ #ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ +#include "flutter/common/settings.h" #include "flutter/shell/common/engine.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h" -enum VMType { - // An invalid VM configuration. - VMTypeInvalid = 0, - // VM can execute Dart code as an interpreter. - VMTypeInterpreter, - // VM can execute precompiled Dart code. - VMTypePrecompilation, -}; - -typedef void (^LaunchResult)(BOOL success, NSString* message); - @interface FlutterDartProject () -- (void)launchInEngine:(shell::Engine*)engine - embedderVMType:(VMType)type - result:(LaunchResult)result; - -- (void)launchInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - embedderVMType:(VMType)type - result:(LaunchResult)result; +- (const blink::Settings&)settings; -+ (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle; +- (shell::RunConfiguration)runConfiguration; @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h deleted file mode 100644 index c3881ce065185..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 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. - -#ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ -#define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ - -#import - -typedef void (^ValidationResult)(BOOL result, NSString* message); - -@interface FlutterDartSource : NSObject - -@property(nonatomic, readonly) NSURL* dartMain; -@property(nonatomic, readonly) NSURL* packages; -@property(nonatomic, readonly) NSURL* flutterAssets; -@property(nonatomic, readonly) BOOL assetsDirContainsScriptSnapshot; - -- (instancetype)initWithDartMain:(NSURL*)dartMain - packages:(NSURL*)packages - flutterAssets:(NSURL*)flutterAssets NS_DESIGNATED_INITIALIZER; - -- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets - NS_DESIGNATED_INITIALIZER; - -- (void)validate:(ValidationResult)result; - -@end - -#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm deleted file mode 100644 index aecb4e5806b3a..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" - -@implementation FlutterDartSource - -@synthesize dartMain = _dartMain; -@synthesize packages = _packages; -@synthesize flutterAssets = _flutterAssets; -@synthesize assetsDirContainsScriptSnapshot = _assetsDirContainsScriptSnapshot; - -#pragma mark - Convenience Initializers - -- (instancetype)init { - return [self initWithDartMain:nil packages:nil flutterAssets:nil]; -} - -#pragma mark - Designated Initializers - -- (instancetype)initWithDartMain:(NSURL*)dartMain - packages:(NSURL*)packages - flutterAssets:(NSURL*)flutterAssets { - self = [super init]; - - if (self) { - _dartMain = [dartMain copy]; - _packages = [packages copy]; - _flutterAssets = [flutterAssets copy]; - - NSFileManager* fileManager = [NSFileManager defaultManager]; - - const BOOL dartMainExists = [fileManager fileExistsAtPath:dartMain.absoluteURL.path]; - const BOOL packagesExists = [fileManager fileExistsAtPath:packages.absoluteURL.path]; - - if (!dartMainExists || !packagesExists) { - // We cannot actually verify this without opening up the directory. This is - // just an assumption. - _assetsDirContainsScriptSnapshot = YES; - } - } - - return self; -} - -- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets { - self = [super init]; - - if (self) { - _flutterAssets = [flutterAssets copy]; - _assetsDirContainsScriptSnapshot = YES; - } - - return self; -} - -static BOOL CheckDartProjectURL(NSMutableString* log, NSURL* url, NSString* logLabel) { - if (url == nil) { - [log appendFormat:@"The %@ was not specified.\n", logLabel]; - return false; - } - - if (!url.isFileURL) { - [log appendFormat:@"The %@ must be a file URL.\n", logLabel]; - return false; - } - - if (![[NSFileManager defaultManager] fileExistsAtPath:url.absoluteURL.path]) { - [log appendFormat:@"No file found at '%@' when looking for the %@.\n", url, logLabel]; - return false; - } - - return true; -} - -- (void)validate:(ValidationResult)result { - NSMutableString* log = [[[NSMutableString alloc] init] autorelease]; - - BOOL isValid = YES; - - isValid &= CheckDartProjectURL(log, _flutterAssets, @"Flutter assets"); - - if (!_assetsDirContainsScriptSnapshot) { - isValid &= CheckDartProjectURL(log, _dartMain, @"Dart main"); - isValid &= CheckDartProjectURL(log, _packages, @"Dart packages"); - } - - result(isValid, log); -} - -- (void)dealloc { - [_dartMain release]; - [_packages release]; - [_flutterAssets release]; - - [super dealloc]; -} - -@end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm index 2143f362f7905..dee11d08934a5 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm @@ -2,38 +2,84 @@ // 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 + #import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h" +#include #include -#include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/null_platform_view.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/engine.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/run_configuration.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/darwin/common/command_line.h" +#include "lib/fxl/functional/make_copyable.h" -@interface FlutterHeadlessDartRunner () -@end +static std::unique_ptr CreateHeadlessPlatformView(shell::Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); +} -@implementation FlutterHeadlessDartRunner { - fml::scoped_nsprotocol _dartProject; - std::shared_ptr _platformView; +static std::unique_ptr CreateHeadlessRasterizer(shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); } -- (instancetype)init { - _dartProject.reset([[FlutterDartProject alloc] initFromDefaultSourceForConfiguration]); - _platformView = std::make_shared(); - _platformView->Attach(); - return self; +@implementation FlutterHeadlessDartRunner { + shell::ThreadHost _threadHost; + std::unique_ptr _shell; } - (void)runWithEntrypoint:(NSString*)entrypoint { - const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; - [_dartProject launchInEngine:&_platformView->engine() - withEntrypoint:entrypoint - embedderVMType:type - result:^(BOOL success, NSString* message) { - if (!success) - NSLog(@"%@", message); - }]; + if (_shell != nullptr || entrypoint.length == 0) { + FXL_LOG(ERROR) << "This headless dart runner was already used to run some code."; + return; + } + + const auto label = "io.flutter.headless"; + + // Create the threads to run the shell on. + _threadHost = { + label, // native thread label + shell::ThreadHost::Type::UI // managed threads to create + }; + + // Configure shell task runners. + auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); + auto single_task_runner = _threadHost.ui_thread->GetTaskRunner(); + blink::TaskRunners task_runners(label, // dart thread label + current_task_runner, // platform + single_task_runner, // gpu + single_task_runner, // ui + single_task_runner // io + ); + + auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); + + // Create the shell. This is a blocking operation. + _shell = shell::Shell::Create( + std::move(task_runners), // task runners + std::move(settings), // settings + std::bind(&CreateHeadlessPlatformView, std::placeholders::_1), // platform view creation + std::bind(&CreateHeadlessRasterizer, std::placeholders::_1) // rasterzier creation + ); + + if (_shell == nullptr) { + FXL_LOG(ERROR) << "Could not start a shell for the headless dart runner with entrypoint: " + << entrypoint.UTF8String; + return; + } + + // Override the default run configuration with the specified entrypoint. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), + config = shell::RunConfiguration::InferFromSettings(settings)]() mutable { + if (!engine || !engine->Run(std::move(config))) { + FXL_LOG(ERROR) << "Could not launch engine with configuration."; + } + })); } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.h b/shell/platform/darwin/ios/framework/Source/FlutterView.h index 661940620c947..5e3d303401725 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.h @@ -7,8 +7,14 @@ #include +#include + +#include "flutter/shell/platform/darwin/ios/ios_surface.h" + @interface FlutterView : UIView +- (std::unique_ptr)createSurface; + @end #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 7c382838c6f5c..27e3d48c4cb50 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -5,20 +5,41 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" +#include "flutter/fml/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" +#include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" +#include "flutter/shell/platform/darwin/ios/ios_surface_software.h" #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" -@interface FlutterView () +@interface FlutterView () @end @implementation FlutterView +- (FlutterViewController*)flutterViewController { + // Find the first view controller in the responder chain and see if it is a FlutterViewController. + for (UIResponder* responder = self.nextResponder; responder != nil; + responder = responder.nextResponder) { + if ([responder isKindOfClass:[UIViewController class]]) { + if ([responder isKindOfClass:[FlutterViewController class]]) { + return reinterpret_cast(responder); + } else { + // Should only happen if a non-FlutterViewController tries to somehow (via dynamic class + // resolution or reparenting) set a FlutterView as its view. + return nil; + } + } + } + return nil; +} + - (void)layoutSubviews { if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { CAEAGLLayer* layer = reinterpret_cast(self.layer); @@ -40,13 +61,24 @@ + (Class)layerClass { #endif // TARGET_IPHONE_SIMULATOR } +- (std::unique_ptr)createSurface { + if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { + fml::scoped_nsobject eagl_layer( + reinterpret_cast([self.layer retain])); + return std::make_unique(std::move(eagl_layer)); + } else { + fml::scoped_nsobject layer(reinterpret_cast([self.layer retain])); + return std::make_unique(std::move(layer)); + } +} + - (BOOL)enableInputClicksWhenVisible { return YES; } -void SnapshotRasterizer(fml::WeakPtr rasterizer, - CGContextRef context, - bool is_opaque) { +static void SnapshotRasterizer(fml::WeakPtr rasterizer, + CGContextRef context, + bool is_opaque) { if (!rasterizer) { return; } @@ -77,10 +109,11 @@ void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCanvas canvas(bitmap); - { - flow::CompositorContext compositor_context(nullptr); - auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */); - layer_tree->Raster(frame, false /* ignore raster cache. */); + flow::CompositorContext compositor_context; + + if (auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */)) { + layer_tree->Preroll(*frame, true /* ignore raster cache */); + layer_tree->Paint(*frame); } canvas.flush(); @@ -89,41 +122,6 @@ void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCGDrawBitmap(context, bitmap, 0, 0); } -static fml::WeakPtr GetRandomRasterizer() { - fml::WeakPtr rasterizer; - shell::Shell::Shared().IteratePlatformViews([&rasterizer](shell::PlatformView* view) -> bool { - rasterizer = view->rasterizer().GetWeakRasterizerPtr(); - // We just grab the first rasterizer so there is no need to iterate - // further. - return false; - }); - return rasterizer; -} - -void SnapshotContents(CGContextRef context, bool is_opaque) { - // TODO(chinmaygarde): Currently, there is no way to get the rasterizer for - // a particular platform view from the shell. But, for now, we only have one - // platform view. So use that. Once we support multiple platform views, the - // shell will need to provide a way to get the rasterizer for a specific - // platform view. - SnapshotRasterizer(GetRandomRasterizer(), context, is_opaque); -} - -void SnapshotContentsSync(CGContextRef context, UIView* view) { - auto gpu_thread = blink::Threads::Gpu(); - - if (!gpu_thread) { - return; - } - - fxl::AutoResetWaitableEvent latch; - gpu_thread->PostTask([&latch, context, view]() { - SnapshotContents(context, [view isOpaque]); - latch.Signal(); - }); - latch.Wait(); -} - // Override the default CALayerDelegate method so that APIs that attempt to // screenshot the view display contents correctly. We cannot depend on // reading @@ -132,7 +130,22 @@ void SnapshotContentsSync(CGContextRef context, UIView* view) { // 2: The call is made of the platform thread and not the GPU thread. // 3: There may be a software rasterizer. - (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { - SnapshotContentsSync(context, self); + TRACE_EVENT0("flutter", "SnapshotFlutterView"); + FlutterViewController* controller = [self flutterViewController]; + + if (controller == nil) { + return; + } + + auto& shell = [controller shell]; + + fxl::AutoResetWaitableEvent latch; + shell.GetTaskRunners().GetGPUTaskRunner()->PostTask( + [&latch, rasterizer = shell.GetRasterizer(), context, opaque = layer.opaque]() { + SnapshotRasterizer(std::move(rasterizer), context, opaque); + latch.Signal(); + }); + latch.Wait(); } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index a467a5a8cf1a5..17e9a4eff48f6 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -2,90 +2,54 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#define FML_USED_ON_EMBEDDER + +#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" #include -#include "flutter/common/threads.h" -#include "flutter/flow/texture.h" +#include "flutter/fml/message_loop.h" #include "flutter/fml/platform/darwin/platform_version.h" -#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/lib/ui/painting/resource_context.h" -#include "flutter/shell/platform/darwin/common/buffer_conversions.h" -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterCodecs.h" +#include "flutter/shell/common/thread_host.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h" -#include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" #include "flutter/shell/platform/darwin/ios/platform_view_ios.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/time/time_delta.h" - -namespace { - -typedef void (^PlatformMessageResponseCallback)(NSData*); - -class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); - - public: - void Complete(std::vector data) override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask( - fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { - self->callback_.get()(shell::GetNSDataFromVector(data)); - })); - } - - void CompleteEmpty() override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask( - fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); - } - - private: - explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback) - : callback_(callback, fml::OwnershipPolicy::Retain) {} - fml::ScopedBlock callback_; -}; - -} // namespace - -@interface FlutterViewController () +@interface FlutterViewController () @end @implementation FlutterViewController { - fml::scoped_nsprotocol _dartProject; + fml::scoped_nsobject _dartProject; + shell::ThreadHost _threadHost; + std::unique_ptr _shell; + + // Channels + fml::scoped_nsobject _platformPlugin; + fml::scoped_nsobject _textInputPlugin; + fml::scoped_nsobject _localizationChannel; + fml::scoped_nsobject _navigationChannel; + fml::scoped_nsobject _platformChannel; + fml::scoped_nsobject _textInputChannel; + fml::scoped_nsobject _lifecycleChannel; + fml::scoped_nsobject _systemChannel; + fml::scoped_nsobject _settingsChannel; + + // We keep a separate reference to this and create it ahead of time because we want to be able to + // setup a shell along with its platform view before the view has to appear. + fml::scoped_nsobject _flutterView; + fml::scoped_nsobject _launchView; UIInterfaceOrientationMask _orientationPreferences; UIStatusBarStyle _statusBarStyle; blink::ViewportMetrics _viewportMetrics; shell::TouchMapper _touchMapper; - std::shared_ptr _platformView; - fml::scoped_nsprotocol _platformPlugin; - fml::scoped_nsprotocol _textInputPlugin; - fml::scoped_nsprotocol _localizationChannel; - fml::scoped_nsprotocol _navigationChannel; - fml::scoped_nsprotocol _platformChannel; - fml::scoped_nsprotocol _textInputChannel; - fml::scoped_nsprotocol _lifecycleChannel; - fml::scoped_nsprotocol _systemChannel; - fml::scoped_nsprotocol _settingsChannel; - fml::scoped_nsprotocol _launchView; int64_t _nextTextureId; BOOL _initialized; - BOOL _connected; -} - -+ (void)initialize { - if (self == [FlutterViewController class]) { - shell::FlutterMain(); - } } #pragma mark - Manage and override all designated initializers @@ -125,26 +89,92 @@ - (void)performCommonViewControllerInitialization { _orientationPreferences = UIInterfaceOrientationMaskAll; _statusBarStyle = UIStatusBarStyleDefault; - _platformView = std::make_shared( - reinterpret_cast(self.view.layer), self); - - _platformView->Attach( - // First frame callback. - [self]() { - TRACE_EVENT0("flutter", "First Frame"); - if (_launchView) { - [UIView animateWithDuration:0.2 - animations:^{ - _launchView.get().alpha = 0; - } - completion:^(BOOL finished) { - [_launchView.get() removeFromSuperview]; - _launchView.reset(); - }]; + + if ([self setupShell]) { + [self setupChannels]; + [self setupNotificationCenterObservers]; + } +} + +- (shell::Shell&)shell { + FXL_DCHECK(_shell); + return *_shell; +} + +- (fml::WeakPtr)iosPlatformView { + FXL_DCHECK(_shell); + return _shell->GetPlatformView(); +} + +- (BOOL)setupShell { + FXL_DCHECK(_shell == nullptr); + + static size_t shell_count = 1; + + auto threadLabel = [NSString stringWithFormat:@"io.flutter.%zu", shell_count++]; + + _threadHost = { + threadLabel.UTF8String, // label + shell::ThreadHost::Type::UI | shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::IO}; + + // The current thread will be used as the platform thread. Ensure that the message loop is + // initialized. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + blink::TaskRunners task_runners(threadLabel.UTF8String, // label + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + _threadHost.gpu_thread->GetTaskRunner(), // gpu + _threadHost.ui_thread->GetTaskRunner(), // ui + _threadHost.io_thread->GetTaskRunner() // io + ); + + _flutterView.reset([[FlutterView alloc] init]); + + // Lambda captures by pointers to ObjC objects are fine here because the create call is + // synchronous. + shell::Shell::CreateCallback on_create_platform_view = + [flutter_view_controller = self, flutter_view = _flutterView.get()](shell::Shell& shell) { + auto platform_view_ios = std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + flutter_view_controller, // flutter view controller owner + flutter_view // flutter view owner + ); + return platform_view_ios; + }; + + shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // Create the shell. + _shell = shell::Shell::Create(std::move(task_runners), // + [_dartProject settings], // + on_create_platform_view, // + on_create_rasterizer // + ); + + if (!_shell) { + FXL_LOG(ERROR) << "Could not setup a shell to run the Dart application."; + return false; + } + + // Launch the Dart application with the inferred run configuration. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), // + config = [_dartProject.get() runConfiguration] // + ]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch engine with configuration."; + } } - }); - _platformView->SetupResourceContextOnIOThread(); + })); + return true; +} +- (void)setupChannels { _localizationChannel.reset([[FlutterMethodChannel alloc] initWithName:@"flutter/localization" binaryMessenger:self @@ -190,9 +220,8 @@ - (void)performCommonViewControllerInitialization { [_textInputChannel.get() setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { [_textInputPlugin.get() handleMethodCall:call result:result]; }]; - _platformView->SetTextInputPlugin(_textInputPlugin); - - [self setupNotificationCenterObservers]; + static_cast(_shell->GetPlatformView().get()) + ->SetTextInputPlugin(_textInputPlugin); } - (void)setupNotificationCenterObservers { @@ -261,50 +290,24 @@ - (void)setupNotificationCenterObservers { - (void)setInitialRoute:(NSString*)route { [_navigationChannel.get() invokeMethod:@"setInitialRoute" arguments:route]; } -#pragma mark - Initializing the engine - -- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { - exit(0); -} - -- (void)connectToEngineAndLoad { - if (_connected) - return; - _connected = YES; - - TRACE_EVENT0("flutter", "connectToEngineAndLoad"); - - // We ask the VM to check what it supports. - const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; - - [_dartProject launchInEngine:&_platformView->engine() - embedderVMType:type - result:^(BOOL success, NSString* message) { - if (!success) { - UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Launch Error" - message:message - delegate:self - cancelButtonTitle:@"OK" - otherButtonTitles:nil]; - [alert show]; - [alert release]; - } - }]; -} #pragma mark - Loading the view - (void)loadView { - FlutterView* view = [[FlutterView alloc] init]; - - self.view = view; + self.view = _flutterView.get(); self.view.multipleTouchEnabled = YES; self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [view release]; + [self installLaunchViewIfNecessary]; +} + +#pragma mark - Managing launch views +- (void)installLaunchViewIfNecessary { // Show the launch screen view again on top of the FlutterView if available. // This launch screen view will be removed once the first Flutter frame is rendered. + [_launchView.get() removeFromSuperview]; + _launchView.reset(); NSString* launchStoryboardName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UILaunchStoryboardName"]; if (launchStoryboardName && !self.isBeingPresented && !self.isMovingToParentViewController) { @@ -319,16 +322,57 @@ - (void)loadView { } } +- (void)removeLaunchViewIfPresent { + if (!_launchView) { + return; + } + + [UIView animateWithDuration:0.2 + animations:^{ + _launchView.get().alpha = 0; + } + completion:^(BOOL finished) { + [_launchView.get() removeFromSuperview]; + _launchView.reset(); + }]; +} + +- (void)installLaunchViewCallback { + if (!_shell || !_launchView) { + return; + } + auto weak_platform_view = _shell->GetPlatformView(); + if (!weak_platform_view) { + return; + } + __unsafe_unretained auto weak_flutter_view_controller = self; + // This is on the platform thread. + weak_platform_view->SetNextFrameCallback( + [weak_platform_view, weak_flutter_view_controller, + task_runner = _shell->GetTaskRunners().GetPlatformTaskRunner()]() { + // This is on the GPU thread. + task_runner->PostTask([weak_platform_view, weak_flutter_view_controller]() { + // We check if the weak platform view is alive. If it is alive, then the view controller + // also has to be alive since the view controller owns the platform view via the shell + // association. Thus, we are not convinced that the unsafe unretained weak object is in + // fact alive. + if (weak_platform_view) { + [weak_flutter_view_controller removeLaunchViewIfPresent]; + } + }); + }); +} + #pragma mark - Surface creation and teardown updates - (void)surfaceUpdated:(BOOL)appeared { - FXL_CHECK(_platformView != nullptr); - // NotifyCreated/NotifyDestroyed are synchronous and require hops between the UI and GPU thread. if (appeared) { - _platformView->NotifyCreated(); + [self installLaunchViewCallback]; + _shell->GetPlatformView()->NotifyCreated(); + } else { - _platformView->NotifyDestroyed(); + _shell->GetPlatformView()->NotifyDestroyed(); } } @@ -336,7 +380,6 @@ - (void)surfaceUpdated:(BOOL)appeared { - (void)viewWillAppear:(BOOL)animated { TRACE_EVENT0("flutter", "viewWillAppear"); - [self connectToEngineAndLoad]; // Only recreate surface on subsequent appearances when viewport metrics are known. // First time surface creation is done on viewDidLayoutSubviews. if (_viewportMetrics.physical_width) @@ -391,8 +434,6 @@ - (void)applicationWillResignActive:(NSNotification*)notification { - (void)applicationDidEnterBackground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationDidEnterBackground"); [self surfaceUpdated:NO]; - // GrContext operations are blocked when the app is in the background. - blink::ResourceContext::Freeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.paused"]; } @@ -400,7 +441,6 @@ - (void)applicationWillEnterForeground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationWillEnterForeground"); if (_viewportMetrics.physical_width) [self surfaceUpdated:YES]; - blink::ResourceContext::Unfreeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.inactive"]; } @@ -547,10 +587,11 @@ - (void)dispatchTouches:(NSSet*)touches phase:(UITouchPhase)phase { packet->SetPointerData(i++, pointer_data); } - blink::Threads::UI()->PostTask(fxl::MakeCopyable( - [ engine = _platformView->engine().GetWeakPtr(), packet = std::move(packet) ] { - if (engine.get()) + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), packet = std::move(packet)] { + if (engine) { engine->DispatchPointerDataPacket(*packet); + } })); } @@ -573,13 +614,11 @@ - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event { #pragma mark - Handle view resizing - (void)updateViewportMetrics { - blink::Threads::UI()->PostTask( - [ weak_platform_view = _platformView->GetWeakPtr(), metrics = _viewportMetrics ] { - if (!weak_platform_view) { - return; + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = _shell->GetEngine(), metrics = _viewportMetrics]() { + if (engine) { + engine->SetViewportMetrics(std::move(metrics)); } - weak_platform_view->UpdateSurfaceSize(); - weak_platform_view->engine().SetViewportMetrics(metrics); }); } @@ -709,7 +748,7 @@ - (void)onVoiceOverChanged:(NSNotification*)notification { #else bool enabled = UIAccessibilityIsVoiceOverRunning(); #endif - _platformView->ToggleAccessibility(self.view, enabled); + _shell->GetPlatformView()->SetSemanticsEnabled(enabled); } #pragma mark - Memory Notifications @@ -875,46 +914,50 @@ - (void)sendOnChannel:(NSString*)channel message:(NSData*)message binaryReply:(FlutterBinaryReply)callback { NSAssert(channel, @"The channel must not be null"); - fxl::RefPtr response = + fxl::RefPtr response = (callback == nil) ? nullptr - : fxl::MakeRefCounted(^(NSData* reply) { - callback(reply); - }); + : fxl::MakeRefCounted( + ^(NSData* reply) { + callback(reply); + }, + _shell->GetTaskRunners().GetPlatformTaskRunner()); fxl::RefPtr platformMessage = (message == nil) ? fxl::MakeRefCounted(channel.UTF8String, response) : fxl::MakeRefCounted( channel.UTF8String, shell::GetVectorFromNSData(message), response); - _platformView->DispatchPlatformMessage(platformMessage); + + _shell->GetPlatformView()->DispatchPlatformMessage(platformMessage); } - (void)setMessageHandlerOnChannel:(NSString*)channel binaryMessageHandler:(FlutterBinaryMessageHandler)handler { NSAssert(channel, @"The channel must not be null"); - _platformView->platform_message_router().SetMessageHandler(channel.UTF8String, handler); + [self iosPlatformView] -> GetPlatformMessageRouter().SetMessageHandler(channel.UTF8String, + handler); } #pragma mark - FlutterTextureRegistry - (int64_t)registerTexture:(NSObject*)texture { int64_t textureId = _nextTextureId++; - _platformView->RegisterExternalTexture(textureId, texture); + [self iosPlatformView] -> RegisterExternalTexture(textureId, texture); return textureId; } - (void)unregisterTexture:(int64_t)textureId { - _platformView->UnregisterTexture(textureId); + _shell->GetPlatformView()->UnregisterTexture(textureId); } - (void)textureFrameAvailable:(int64_t)textureId { - _platformView->MarkTextureFrameAvailable(textureId); + _shell->GetPlatformView()->MarkTextureFrameAvailable(textureId); } - (NSString*)lookupKeyForAsset:(NSString*)asset { - return [FlutterDartProject lookupKeyForAsset:asset]; + return [FlutterDartProject lookupKeyForAsset:asset]; } - (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { - return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; + return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h new file mode 100644 index 0000000000000..482379c8f17eb --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h @@ -0,0 +1,17 @@ +// Copyright 2017 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ + +#include "flutter/shell/common/shell.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" + +@interface FlutterViewController () + +- (shell::Shell&)shell; + +@end + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 3f96f37a9c2db..6a545b95e4276 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -427,7 +427,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { weak_factory_(this) { accessibility_channel_.reset([[FlutterBasicMessageChannel alloc] initWithName:@"flutter/accessibility" - binaryMessenger:platform_view->binary_messenger() + binaryMessenger:platform_view->GetOwnerViewController() codec:[FlutterStandardMessageCodec sharedInstance]]); [accessibility_channel_.get() setMessageHandler:^(id message, FlutterReply reply) { HandleEvent((NSDictionary*)message); @@ -440,7 +440,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { } UIView* AccessibilityBridge::textInputView() { - return [platform_view_->text_input_plugin() textInputView]; + return [platform_view_->GetTextInputPlugin() textInputView]; } void AccessibilityBridge::UpdateSemantics(blink::SemanticsNodeUpdates nodes) { diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h deleted file mode 100644 index f2e54dd2c2806..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ - -#include "lib/fxl/macros.h" - -namespace shell { - -/// Initializes the Flutter shell. This must be called before interacting with -/// the engine in any way. It is safe to call this method multiple times. -void FlutterMain(); - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm deleted file mode 100644 index aa7ad5fd85727..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" - -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" - -namespace shell { - -void FlutterMain() { - NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; - NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; - NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; - - NSBundle* mainBundle = [NSBundle mainBundle]; - NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:mainBundle]; - - shell::PlatformMacMain(icuDataPath.UTF8String, libraryName != nil ? libraryName.UTF8String : "", - flutterAssetsPath.UTF8String); -} - -} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h new file mode 100644 index 0000000000000..b861c5036e97d --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h @@ -0,0 +1,50 @@ +// Copyright 2018 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ + +#include + +#include "flutter/fml/platform/darwin/scoped_block.h" +#include "flutter/fml/task_runner.h" +#include "flutter/lib/ui/window/platform_message_response.h" +#include "flutter/shell/platform/darwin/common/buffer_conversions.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/macros.h" + +typedef void (^PlatformMessageResponseCallback)(NSData*); + +namespace shell { + +class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { + public: + void Complete(std::vector data) override { + fxl::RefPtr self(this); + platform_task_runner_->PostTask(fxl::MakeCopyable([self, data = std::move(data)]() mutable { + self->callback_.get()(shell::GetNSDataFromVector(data)); + })); + } + + void CompleteEmpty() override { + fxl::RefPtr self(this); + platform_task_runner_->PostTask( + fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); + } + + private: + explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback, + fxl::RefPtr platform_task_runner) + : callback_(callback, fml::OwnershipPolicy::Retain), + platform_task_runner_(std::move(platform_task_runner)) {} + + fml::ScopedBlock callback_; + fxl::RefPtr platform_task_runner_; + + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm new file mode 100644 index 0000000000000..8590b4e36942b --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm @@ -0,0 +1,11 @@ +// Copyright 2018 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/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" + +namespace shell { + +// + +} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.h b/shell/platform/darwin/ios/framework/Source/platform_message_router.h index cfa91c04771c3..d2488f82fe47c 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.h +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.h @@ -7,6 +7,7 @@ #include +#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterBinaryMessenger.h" #include "lib/fxl/memory/weak_ptr.h" @@ -18,13 +19,13 @@ class PlatformMessageRouter { PlatformMessageRouter(); ~PlatformMessageRouter(); - void HandlePlatformMessage(fxl::RefPtr message); + void HandlePlatformMessage(fxl::RefPtr message) const; void SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler); private: - std::unordered_map + std::unordered_map> message_handlers_; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter); diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm index 70625143b623e..3ab75bff522f8 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm @@ -14,7 +14,8 @@ PlatformMessageRouter::~PlatformMessageRouter() = default; -void PlatformMessageRouter::HandlePlatformMessage(fxl::RefPtr message) { +void PlatformMessageRouter::HandlePlatformMessage( + fxl::RefPtr message) const { fxl::RefPtr completer = message->response(); auto it = message_handlers_.find(message->channel()); if (it != message_handlers_.end()) { @@ -41,14 +42,10 @@ void PlatformMessageRouter::SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler) { - if (handler) - message_handlers_[channel] = [handler copy]; - else { - auto it = message_handlers_.find(channel); - if (it != message_handlers_.end()) { - [it->second release]; - message_handlers_.erase(it); - } + message_handlers_.erase(channel); + if (handler) { + message_handlers_[channel] = + fml::ScopedBlock{handler, fml::OwnershipPolicy::Retain}; } } diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h index 6a3362b215667..23aaf02510d6d 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h @@ -5,27 +5,26 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" -#if __OBJC__ @class VSyncClient; -#else // __OBJC__ -class VSyncClient; -#endif // __OBJC__ namespace shell { -class VsyncWaiterIOS : public VsyncWaiter { +class VsyncWaiterIOS final : public VsyncWaiter { public: - VsyncWaiterIOS(); - ~VsyncWaiterIOS() override; + VsyncWaiterIOS(blink::TaskRunners task_runners); - void AsyncWaitForVsync(Callback callback) override; + ~VsyncWaiterIOS() override; private: - Callback callback_; - VSyncClient* client_; + fml::scoped_nsobject client_; + + // |shell::VsyncWaiter| + void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterIOS); }; diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm index 78d6678189123..4589368acd3fb 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm @@ -10,29 +10,62 @@ #include #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @interface VSyncClient : NSObject +- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner + callback:(shell::VsyncWaiter::Callback)callback; + +- (void)await; + +- (void)invalidate; + @end +namespace shell { + +VsyncWaiterIOS::VsyncWaiterIOS(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)), + client_([[VSyncClient alloc] initWithTaskRunner:task_runners_.GetUITaskRunner() + callback:std::bind(&VsyncWaiterIOS::FireCallback, + this, + std::placeholders::_1, + std::placeholders::_2)]) {} + +VsyncWaiterIOS::~VsyncWaiterIOS() { + // This way, we will get no more callbacks from the display link that holds a weak (non-nilling) + // reference to this C++ object. + [client_.get() invalidate]; +} + +void VsyncWaiterIOS::AwaitVSync() { + [client_.get() await]; +} + +} // namespace shell + @implementation VSyncClient { - CADisplayLink* _displayLink; - shell::VsyncWaiter::Callback _pendingCallback; + shell::VsyncWaiter::Callback callback_; + fml::scoped_nsobject display_link_; } -- (instancetype)init { +- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner + callback:(shell::VsyncWaiter::Callback)callback { self = [super init]; if (self) { - _displayLink = - [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain]; - _displayLink.paused = YES; - - blink::Threads::UI()->PostTask([client = [self retain]]() { - [client->_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; + callback_ = std::move(callback); + display_link_ = fml::scoped_nsobject { + [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain] + }; + display_link_.get().paused = YES; + + task_runner->PostTask([client = [self retain]]() { + [client->display_link_.get() addToRunLoop:[NSRunLoop currentRunLoop] + forMode:NSRunLoopCommonModes]; [client release]; }); } @@ -40,68 +73,28 @@ - (instancetype)init { return self; } -- (void)await:(shell::VsyncWaiter::Callback)callback { - FXL_DCHECK(!_pendingCallback); - _pendingCallback = std::move(callback); - _displayLink.paused = NO; +- (void)await { + display_link_.get().paused = NO; } - (void)onDisplayLink:(CADisplayLink*)link { fxl::TimePoint frame_start_time = fxl::TimePoint::Now(); fxl::TimePoint frame_target_time = frame_start_time + fxl::TimeDelta::FromSecondsF(link.duration); - _displayLink.paused = YES; - - // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight - // Vsync" checkbox in the timeline can be enabled. - // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 - // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); -#else - { - fxl::TimeDelta delta = frame_target_time.ToEpochDelta(); - constexpr size_t num_chars = sizeof(int64_t) * CHAR_BIT * 3.4 + 2; - char deadline[num_chars]; - sprintf(deadline, "%lld", delta.ToMicroseconds()); - TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); - } -#endif - - // Note: Even though we know we are on the UI thread already (since the - // display link was scheduled on the UI thread in the contructor), we use - // the PostTask mechanism because the callback may have side-effects that need - // to be addressed via a task observer. Invoking the callback by itself - // bypasses such task observers. - // - // We are not using the PostTask for thread switching, but to make task - // observers work. - blink::Threads::UI()->PostTask([ - callback = _pendingCallback, frame_start_time, frame_target_time - ]() { callback(frame_start_time, frame_target_time); }); - - _pendingCallback = nullptr; + display_link_.get().paused = YES; + + callback_(frame_start_time, frame_target_time); +} + +- (void)invalidate { + // [CADisplayLink invalidate] is thread-safe. + [display_link_.get() invalidate]; } - (void)dealloc { - [_displayLink invalidate]; - [_displayLink release]; + [self invalidate]; [super dealloc]; } @end - -namespace shell { - -VsyncWaiterIOS::VsyncWaiterIOS() : client_([[VSyncClient alloc] init]) {} - -VsyncWaiterIOS::~VsyncWaiterIOS() { - [client_ release]; -} - -void VsyncWaiterIOS::AsyncWaitForVsync(Callback callback) { - [client_ await:callback]; -} - -} // namespace shell diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.h b/shell/platform/darwin/ios/ios_external_texture_gl.h index a658fdf31628a..baedf298bd61d 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.h +++ b/shell/platform/darwin/ios/ios_external_texture_gl.h @@ -25,6 +25,8 @@ class IOSExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; + virtual void MarkNewFrameAvailable() override; + private: NSObject* external_texture_; fml::CFRef cache_ref_; diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.mm b/shell/platform/darwin/ios/ios_external_texture_gl.mm index 2cc9721e7f09a..0bd9a8ca3c7cb 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.mm +++ b/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -4,11 +4,10 @@ #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" -#include +#import #import #import -#include "flutter/common/threads.h" -#include "flutter/lib/ui/painting/resource_context.h" + #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" @@ -26,7 +25,6 @@ IOSExternalTextureGL::~IOSExternalTextureGL() = default; void IOSExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { - ASSERT_IS_GPU_THREAD; if (!cache_ref_) { CVOpenGLESTextureCacheRef cache; CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, @@ -57,10 +55,8 @@ return; } GrGLTextureInfo textureInfo = {CVOpenGLESTextureGetTarget(texture_ref_), - CVOpenGLESTextureGetName(texture_ref_), - GL_RGBA8_OES}; - GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, - textureInfo); + CVOpenGLESTextureGetName(texture_ref_), GL_RGBA8_OES}; + GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, textureInfo); sk_sp image = SkImage::MakeFromTexture(canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr); @@ -69,14 +65,13 @@ GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kN } } -void IOSExternalTextureGL::OnGrContextCreated() { - ASSERT_IS_GPU_THREAD -} +void IOSExternalTextureGL::OnGrContextCreated() {} void IOSExternalTextureGL::OnGrContextDestroyed() { - ASSERT_IS_GPU_THREAD texture_ref_.Reset(nullptr); cache_ref_.Reset(nullptr); } +void IOSExternalTextureGL::MarkNewFrameAvailable() {} + } // namespace shell diff --git a/shell/platform/darwin/ios/ios_gl_context.h b/shell/platform/darwin/ios/ios_gl_context.h index 89ad7e0347eac..f42c1436461b1 100644 --- a/shell/platform/darwin/ios/ios_gl_context.h +++ b/shell/platform/darwin/ios/ios_gl_context.h @@ -18,7 +18,7 @@ namespace shell { class IOSGLContext { public: - IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer); + IOSGLContext(fml::scoped_nsobject layer); ~IOSGLContext(); diff --git a/shell/platform/darwin/ios/ios_gl_context.mm b/shell/platform/darwin/ios/ios_gl_context.mm index de94018d0689e..77a124e64a291 100644 --- a/shell/platform/darwin/ios/ios_gl_context.mm +++ b/shell/platform/darwin/ios/ios_gl_context.mm @@ -3,21 +3,17 @@ // found in the LICENSE file. #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" -#include "third_party/skia/include/gpu/GrContextOptions.h" -#include "third_party/skia/include/gpu/gl/GrGLInterface.h" #include -namespace shell { +#include "flutter/fml/trace_event.h" +#include "third_party/skia/include/gpu/GrContextOptions.h" +#include "third_party/skia/include/gpu/gl/GrGLInterface.h" -#define VERIFY(x) \ - if (!(x)) { \ - FXL_DLOG(ERROR) << "Failed: " #x; \ - return; \ - }; +namespace shell { -IOSGLContext::IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer) - : layer_([layer retain]), +IOSGLContext::IOSGLContext(fml::scoped_nsobject layer) + : layer_(std::move(layer)), context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]), resource_context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:context_.get().sharegroup]), @@ -26,34 +22,34 @@ storage_size_width_(0), storage_size_height_(0), valid_(false) { - VERIFY(layer_ != nullptr); - VERIFY(context_ != nullptr); - VERIFY(resource_context_ != nullptr); + FXL_DCHECK(layer_ != nullptr); + FXL_DCHECK(context_ != nullptr); + FXL_DCHECK(resource_context_ != nullptr); bool context_current = [EAGLContext setCurrentContext:context_]; - VERIFY(context_current); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(context_current); + FXL_DCHECK(glGetError() == GL_NO_ERROR); // Generate the framebuffer glGenFramebuffers(1, &framebuffer_); - VERIFY(glGetError() == GL_NO_ERROR); - VERIFY(framebuffer_ != GL_NONE); + FXL_DCHECK(glGetError() == GL_NO_ERROR); + FXL_DCHECK(framebuffer_ != GL_NONE); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(glGetError() == GL_NO_ERROR); // Setup color attachment glGenRenderbuffers(1, &colorbuffer_); - VERIFY(colorbuffer_ != GL_NONE); + FXL_DCHECK(colorbuffer_ != GL_NONE); glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(glGetError() == GL_NO_ERROR); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorbuffer_); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(glGetError() == GL_NO_ERROR); // TODO: // iOS displays are more variable than just P3 or sRGB. Reading the display @@ -139,24 +135,12 @@ return false; } - GLint width = 0; - GLint height = 0; - - if (colorbuffer_ != GL_NONE) { - // Fetch the dimensions of the color buffer whose backing was just updated - // so that backing of the attachments can be updated - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - - glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - } + // Fetch the dimensions of the color buffer whose backing was just updated. + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &storage_size_width_); + FXL_DCHECK(glGetError() == GL_NO_ERROR); - storage_size_width_ = width; - storage_size_height_ = height; + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &storage_size_height_); + FXL_DCHECK(glGetError() == GL_NO_ERROR); FXL_DCHECK(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); diff --git a/shell/platform/darwin/ios/ios_surface.h b/shell/platform/darwin/ios/ios_surface.h index c164fab15500e..b629c2709e3d1 100644 --- a/shell/platform/darwin/ios/ios_surface.h +++ b/shell/platform/darwin/ios/ios_surface.h @@ -5,25 +5,17 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ +#include + #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/surface.h" #include "lib/fxl/macros.h" -@class CALayer; - namespace shell { class IOSSurface { public: - static std::unique_ptr Create( - PlatformView::SurfaceConfig surface_config, - CALayer* layer); - - IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer); - - CALayer* GetLayer() const; - - PlatformView::SurfaceConfig GetSurfaceConfig() const; + IOSSurface(); virtual ~IOSSurface(); @@ -36,9 +28,6 @@ class IOSSurface { virtual std::unique_ptr CreateGPUSurface() = 0; public: - PlatformView::SurfaceConfig surface_config_; - fml::scoped_nsobject layer_; - FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurface); }; diff --git a/shell/platform/darwin/ios/ios_surface.mm b/shell/platform/darwin/ios/ios_surface.mm index 91067838330f6..b0b9cc3245183 100644 --- a/shell/platform/darwin/ios/ios_surface.mm +++ b/shell/platform/darwin/ios/ios_surface.mm @@ -4,40 +4,15 @@ #include "flutter/shell/platform/darwin/ios/ios_surface.h" -#include -#include #include -@class CALayer; -@class CAEAGLLayer; +#include +#include namespace shell { -std::unique_ptr IOSSurface::Create(PlatformView::SurfaceConfig surface_config, - CALayer* layer) { - // Check if we can use OpenGL. - if ([layer isKindOfClass:[CAEAGLLayer class]]) { - return std::make_unique(surface_config, reinterpret_cast(layer)); - } - - // If we ever support the metal rendering API, a check for CAMetalLayer would - // go here. - - // Finally, fallback to software rendering. - return std::make_unique(surface_config, layer); -} - -IOSSurface::IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer) - : surface_config_(surface_config), layer_([layer retain]) {} +IOSSurface::IOSSurface() = default; IOSSurface::~IOSSurface() = default; -CALayer* IOSSurface::GetLayer() const { - return layer_; -} - -PlatformView::SurfaceConfig IOSSurface::GetSurfaceConfig() const { - return surface_config_; -} - } // namespace shell diff --git a/shell/platform/darwin/ios/ios_surface_gl.h b/shell/platform/darwin/ios/ios_surface_gl.h index f7e43e2588984..7486d343eb0fd 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.h +++ b/shell/platform/darwin/ios/ios_surface_gl.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" @@ -16,7 +17,7 @@ namespace shell { class IOSSurfaceGL : public IOSSurface, public GPUSurfaceGLDelegate { public: - IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer); + IOSSurfaceGL(fml::scoped_nsobject layer); ~IOSSurfaceGL() override; diff --git a/shell/platform/darwin/ios/ios_surface_gl.mm b/shell/platform/darwin/ios/ios_surface_gl.mm index 60756d6094fc9..253531c4800aa 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/shell/platform/darwin/ios/ios_surface_gl.mm @@ -4,13 +4,12 @@ #include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" +#include "flutter/fml/trace_event.h" #include "flutter/shell/gpu/gpu_surface_gl.h" namespace shell { -IOSSurfaceGL::IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer) - : IOSSurface(surface_config, reinterpret_cast(layer)), - context_(surface_config, layer) {} +IOSSurfaceGL::IOSSurfaceGL(fml::scoped_nsobject layer) : context_(std::move(layer)) {} IOSSurfaceGL::~IOSSurfaceGL() = default; diff --git a/shell/platform/darwin/ios/ios_surface_software.h b/shell/platform/darwin/ios/ios_surface_software.h index 7e3f264b28ce6..e8fc332f06c8c 100644 --- a/shell/platform/darwin/ios/ios_surface_software.h +++ b/shell/platform/darwin/ios/ios_surface_software.h @@ -5,17 +5,19 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_software.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/macros.h" +@class CALayer; + namespace shell { -class IOSSurfaceSoftware : public IOSSurface, - public GPUSurfaceSoftwareDelegate { +class IOSSurfaceSoftware final : public IOSSurface, + public GPUSurfaceSoftwareDelegate { public: - IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, - CALayer* layer); + IOSSurfaceSoftware(fml::scoped_nsobject layer); ~IOSSurfaceSoftware() override; @@ -32,6 +34,7 @@ class IOSSurfaceSoftware : public IOSSurface, bool PresentBackingStore(sk_sp backing_store) override; private: + fml::scoped_nsobject layer_; sk_sp sk_surface_; FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware); diff --git a/shell/platform/darwin/ios/ios_surface_software.mm b/shell/platform/darwin/ios/ios_surface_software.mm index 9a4e90e45dfba..b09a5d9a2d8a3 100644 --- a/shell/platform/darwin/ios/ios_surface_software.mm +++ b/shell/platform/darwin/ios/ios_surface_software.mm @@ -15,15 +15,15 @@ namespace shell { -IOSSurfaceSoftware::IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, CALayer* layer) - : IOSSurface(surface_config, layer) { +IOSSurfaceSoftware::IOSSurfaceSoftware(fml::scoped_nsobject layer) + : layer_(std::move(layer)) { UpdateStorageSizeIfNecessary(); } IOSSurfaceSoftware::~IOSSurfaceSoftware() = default; bool IOSSurfaceSoftware::IsValid() const { - return GetLayer() != nullptr; + return layer_; } bool IOSSurfaceSoftware::ResourceContextMakeCurrent() { @@ -120,8 +120,7 @@ return false; } - CALayer* layer = GetLayer(); - layer.contents = reinterpret_cast(static_cast(pixmap_image)); + layer_.get().contents = reinterpret_cast(static_cast(pixmap_image)); return true; } diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index dab19a0f9ce1a..e7849dda44641 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -8,95 +8,66 @@ #include #include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h" #include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" -@class CALayer; -@class UIView; - namespace shell { -class PlatformViewIOS : public PlatformView { +class PlatformViewIOS final : public PlatformView { public: - explicit PlatformViewIOS(CALayer* layer, - NSObject* binaryMessenger); + explicit PlatformViewIOS(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + FlutterViewController* owner_controller_, + FlutterView* owner_view_); ~PlatformViewIOS() override; - void Attach() override; - - void Attach(fxl::Closure firstFrameCallback); - - void NotifyCreated(); - - void ToggleAccessibility(UIView* view, bool enabled); - - PlatformMessageRouter& platform_message_router() { - return platform_message_router_; - } - - fml::WeakPtr GetWeakPtr(); - - void UpdateSurfaceSize(); + PlatformMessageRouter& GetPlatformMessageRouter(); - VsyncWaiter* GetVsyncWaiter() override; - - bool ResourceContextMakeCurrent() override; - - void HandlePlatformMessage( - fxl::RefPtr message) override; + FlutterViewController* GetOwnerViewController() const; void RegisterExternalTexture(int64_t id, NSObject* texture); - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; + fml::scoped_nsprotocol GetTextInputPlugin() const; - void SetAssetBundlePath(const std::string& assets_directory) override; - - /** - * Exposes the `FlutterTextInputPlugin` singleton for the - * `AccessibilityBridge` to be able to interact with the text entry system. - */ - fml::scoped_nsprotocol text_input_plugin() { - return text_input_plugin_; - } - - /** - * Sets the `FlutterTextInputPlugin` singleton returned by - * `text_input_plugin`. - */ void SetTextInputPlugin( - fml::scoped_nsprotocol textInputPlugin) { - text_input_plugin_ = textInputPlugin; - } - - NSObject* binary_messenger() const { - return binary_messenger_; - } + fml::scoped_nsprotocol plugin); private: + FlutterViewController* owner_controller_; // weak reference. + FlutterView* owner_view_; // weak reference. std::unique_ptr ios_surface_; PlatformMessageRouter platform_message_router_; std::unique_ptr accessibility_bridge_; - fxl::Closure firstFrameCallback_; - fml::WeakPtrFactory weak_factory_; - NSObject* binary_messenger_; fml::scoped_nsprotocol text_input_plugin_; + fxl::Closure firstFrameCallback_; + + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; - void SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages); + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; + + // |shell::PlatformView| + void SetSemanticsEnabled(bool enabled) override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; + + // |shell::PlatformView| + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - void SetAssetBundlePathOnUI(const std::string& assets_directory); + // |shell::PlatformView| + std::unique_ptr CreateVSyncWaiter() override; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewIOS); }; diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index 19c5dd4e663a1..1fba8e5e026e5 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -8,135 +8,92 @@ #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" -#include "flutter/shell/platform/darwin/common/process_info_mac.h" +#include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewIOS::PlatformViewIOS(CALayer* layer, NSObject* binaryMessenger) - : PlatformView(std::make_unique(std::make_unique())), - ios_surface_(IOSSurface::Create(surface_config_, layer)), - weak_factory_(this), - binary_messenger_(binaryMessenger) {} - -PlatformViewIOS::~PlatformViewIOS() = default; - -void PlatformViewIOS::Attach() { - Attach(NULL); +PlatformViewIOS::PlatformViewIOS(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + FlutterViewController* owner_controller, + FlutterView* owner_view) + : PlatformView(delegate, std::move(task_runners)), + owner_controller_(owner_controller), + owner_view_(owner_view), + ios_surface_(owner_view_.createSurface) { + FXL_DCHECK(ios_surface_ != nullptr); + FXL_DCHECK(owner_controller_ != nullptr); + FXL_DCHECK(owner_view_ != nullptr); } -void PlatformViewIOS::Attach(fxl::Closure firstFrameCallback) { - CreateEngine(); - - if (firstFrameCallback) { - firstFrameCallback_ = firstFrameCallback; - rasterizer_->AddNextFrameCallback([weakSelf = GetWeakPtr()] { - if (weakSelf) { - weakSelf->firstFrameCallback_(); - weakSelf->firstFrameCallback_ = nullptr; - } - }); - } -} +PlatformViewIOS::~PlatformViewIOS() = default; -void PlatformViewIOS::NotifyCreated() { - PlatformView::NotifyCreated(ios_surface_->CreateGPUSurface()); +FlutterViewController* PlatformViewIOS::GetOwnerViewController() const { + return owner_controller_; } -void PlatformViewIOS::ToggleAccessibility(UIView* view, bool enabled) { - if (enabled) { - if (!accessibility_bridge_) { - accessibility_bridge_.reset(new shell::AccessibilityBridge(view, this)); - } - } else { - accessibility_bridge_ = nullptr; - } - SetSemanticsEnabled(enabled); +PlatformMessageRouter& PlatformViewIOS::GetPlatformMessageRouter() { + return platform_message_router_; } -void PlatformViewIOS::SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - blink::Threads::UI()->PostTask( - [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { - if (engine) - engine->RunBundleAndSource(assets_directory, main, packages); - }); +void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, + NSObject* texture) { + RegisterTexture(std::make_shared(texture_id, texture)); } -void PlatformViewIOS::SetAssetBundlePathOnUI(const std::string& assets_directory) { - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { - if (engine) - engine->SetAssetBundlePath(assets_directory); - }); +// |shell::PlatformView| +std::unique_ptr PlatformViewIOS::CreateRenderingSurface() { + return ios_surface_->CreateGPUSurface(); } -fml::WeakPtr PlatformViewIOS::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} +// |shell::PlatformView| +sk_sp PlatformViewIOS::CreateResourceContext() const { + if (!ios_surface_->ResourceContextMakeCurrent()) { + FXL_DLOG(INFO) << "Could not make resource context current on IO thread. Async texture uploads " + "will be disabled."; + return nullptr; + } -void PlatformViewIOS::UpdateSurfaceSize() { - blink::Threads::Gpu()->PostTask([self = GetWeakPtr()]() { - if (self && self->ios_surface_ != nullptr) { - self->ios_surface_->UpdateStorageSizeIfNecessary(); - } - }); + return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); } -VsyncWaiter* PlatformViewIOS::GetVsyncWaiter() { - if (!vsync_waiter_) { - vsync_waiter_ = std::make_unique(); +// |shell::PlatformView| +void PlatformViewIOS::SetSemanticsEnabled(bool enabled) { + if (enabled && !accessibility_bridge_) { + accessibility_bridge_ = std::make_unique(owner_view_, this); + } else { + accessibility_bridge_.reset(); } - return vsync_waiter_.get(); -} - -bool PlatformViewIOS::ResourceContextMakeCurrent() { - return ios_surface_ != nullptr ? ios_surface_->ResourceContextMakeCurrent() : false; + PlatformView::SetSemanticsEnabled(enabled); } +// |shell::PlatformView| void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update) { - if (accessibility_bridge_) + if (accessibility_bridge_) { accessibility_bridge_->UpdateSemantics(std::move(update)); + } } +// |shell::PlatformView| void PlatformViewIOS::HandlePlatformMessage(fxl::RefPtr message) { platform_message_router_.HandlePlatformMessage(std::move(message)); } -void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, - NSObject* texture) { - RegisterTexture(std::make_shared(texture_id, texture)); +// |shell::PlatformView| +std::unique_ptr PlatformViewIOS::CreateVSyncWaiter() { + return std::make_unique(task_runners_); } -void PlatformViewIOS::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetupAndLoadFromSource(assets_directory, main, packages); - latch->Signal(); - }); - - latch->Wait(); - delete latch; +fml::scoped_nsprotocol PlatformViewIOS::GetTextInputPlugin() const { + return text_input_plugin_; } -void PlatformViewIOS::SetAssetBundlePath(const std::string& assets_directory) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetAssetBundlePathOnUI(assets_directory); - latch->Signal(); - }); - - latch->Wait(); - delete latch; +void PlatformViewIOS::SetTextInputPlugin(fml::scoped_nsprotocol plugin) { + text_input_plugin_ = plugin; } } // namespace shell diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 7ce6f7e8d5be1..b1e0b3e4f3b71 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -4,16 +4,21 @@ import("$flutter_root/testing/testing.gni") -source_set("embedder") { +static_library("embedder") { + complete_static_lib = true + sources = [ "embedder.cc", "embedder.h", + "embedder_engine.cc", + "embedder_engine.h", "embedder_include.c", "platform_view_embedder.cc", "platform_view_embedder.h", ] deps = [ + "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", @@ -22,6 +27,7 @@ source_set("embedder") { "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", + "//third_party/skia:gpu", "//topaz/lib/tonic", ] diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 866413cbc077b..a7ee807934663 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -2,14 +2,30 @@ // 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 "lib/fxl/build_config.h" + +#if OS_WIN +#define FLUTTER_EXPORT __declspec(dllexport) +#else // OS_WIN #define FLUTTER_EXPORT __attribute__((visibility("default"))) +#endif // OS_WIN #include "flutter/shell/platform/embedder/embedder.h" #include -#include "flutter/common/threads.h" + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/common/task_runners.h" +#include "flutter/fml/file.h" #include "flutter/fml/message_loop.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/platform/embedder/embedder.h" +#include "flutter/shell/platform/embedder/embedder_engine.h" #include "flutter/shell/platform/embedder/platform_view_embedder.h" +#include "lib/fxl/command_line.h" #include "lib/fxl/functional/make_copyable.h" #define SAFE_ACCESS(pointer, member, default_value) \ @@ -41,21 +57,6 @@ bool IsRendererValid(const FlutterRendererConfig* config) { return true; } -class PlatformViewHolder { - public: - PlatformViewHolder(std::shared_ptr ptr) - : platform_view_(std::move(ptr)) {} - - std::shared_ptr view() const { - return platform_view_; - } - - private: - std::shared_ptr platform_view_; - - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewHolder); -}; - struct _FlutterPlatformMessageResponseHandle { fxl::RefPtr message; }; @@ -65,6 +66,7 @@ FlutterResult FlutterEngineRun(size_t version, const FlutterProjectArgs* args, void* user_data, FlutterEngine* engine_out) { + // Step 0: Figure out arguments for shell creation. if (version != FLUTTER_ENGINE_VERSION) { return kInvalidLibraryVersion; } @@ -87,51 +89,44 @@ FlutterResult FlutterEngineRun(size_t version, return kInvalidArguments; } - auto make_current = - [ ptr = config->open_gl.make_current, user_data ]()->bool { - return ptr(user_data); - }; + auto make_current = [ptr = config->open_gl.make_current, + user_data]() -> bool { return ptr(user_data); }; - auto clear_current = - [ ptr = config->open_gl.clear_current, user_data ]()->bool { - return ptr(user_data); - }; + auto clear_current = [ptr = config->open_gl.clear_current, + user_data]() -> bool { return ptr(user_data); }; - auto present = [ ptr = config->open_gl.present, user_data ]()->bool { + auto present = [ptr = config->open_gl.present, user_data]() -> bool { return ptr(user_data); }; - auto fbo_callback = - [ ptr = config->open_gl.fbo_callback, user_data ]()->intptr_t { - return ptr(user_data); - }; + auto fbo_callback = [ptr = config->open_gl.fbo_callback, + user_data]() -> intptr_t { return ptr(user_data); }; shell::PlatformViewEmbedder::PlatformMessageResponseCallback platform_message_response_callback = nullptr; if (SAFE_ACCESS(args, platform_message_callback, nullptr) != nullptr) { platform_message_response_callback = - [ ptr = args->platform_message_callback, - user_data ](fxl::RefPtr message) { - auto handle = new FlutterPlatformMessageResponseHandle(); - const FlutterPlatformMessage incoming_message = { - .struct_size = sizeof(FlutterPlatformMessage), - .channel = message->channel().c_str(), - .message = message->data().data(), - .message_size = message->data().size(), - .response_handle = handle, - }; - handle->message = std::move(message); - return ptr(&incoming_message, user_data); - }; + [ptr = args->platform_message_callback, + user_data](fxl::RefPtr message) { + auto handle = new FlutterPlatformMessageResponseHandle(); + const FlutterPlatformMessage incoming_message = { + .struct_size = sizeof(FlutterPlatformMessage), + .channel = message->channel().c_str(), + .message = message->data().data(), + .message_size = message->data().size(), + .response_handle = handle, + }; + handle->message = std::move(message); + return ptr(&incoming_message, user_data); + }; } const FlutterOpenGLRendererConfig* open_gl_config = &config->open_gl; std::function make_resource_current_callback = nullptr; if (SAFE_ACCESS(open_gl_config, make_resource_current, nullptr) != nullptr) { - make_resource_current_callback = - [ ptr = config->open_gl.make_resource_current, user_data ]() { - return ptr(user_data); - }; + make_resource_current_callback = [ptr = + config->open_gl.make_resource_current, + user_data]() { return ptr(user_data); }; } std::string icu_data_path; @@ -147,18 +142,33 @@ FlutterResult FlutterEngineRun(size_t version, SAFE_ACCESS(args, command_line_argv, nullptr)); } - static std::once_flag once_shell_initialization; - std::call_once(once_shell_initialization, [&]() { - fxl::CommandLine null_command_line; - shell::Shell::InitStandalone( - std::move(command_line), - icu_data_path, // icu data path default lookup. - "", // application library not supported in JIT mode. - args->assets_path - ); - }); - - shell::PlatformViewEmbedder::DispatchTable table = { + blink::Settings settings = shell::SettingsFromCommandLine(command_line); + settings.icu_data_path = icu_data_path; + settings.main_dart_file_path = args->main_path; + settings.packages_file_path = args->packages_path; + settings.assets_path = args->assets_path; + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + // Create a thread host with the current thread as the platform thread and all + // other threads managed. + shell::ThreadHost thread_host("io.flutter", shell::ThreadHost::Type::GPU | + shell::ThreadHost::Type::IO | + shell::ThreadHost::Type::UI); + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::TaskRunners task_runners( + "io.flutter", + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + thread_host.gpu_thread->GetTaskRunner(), // gpu + thread_host.ui_thread->GetTaskRunner(), // ui + thread_host.io_thread->GetTaskRunner() // io + ); + + shell::PlatformViewEmbedder::DispatchTable dispatch_table = { .gl_make_current_callback = make_current, .gl_clear_current_callback = clear_current, .gl_present_callback = present, @@ -167,31 +177,55 @@ FlutterResult FlutterEngineRun(size_t version, .gl_make_resource_current_callback = make_resource_current_callback, }; - auto platform_view = std::make_shared(table); - platform_view->Attach(); - - std::string assets(args->assets_path); - std::string main(args->main_path); - std::string packages(args->packages_path); - - blink::Threads::UI()->PostTask([ - weak_engine = platform_view->engine().GetWeakPtr(), // - assets = std::move(assets), // - main = std::move(main), // - packages = std::move(packages) // - ] { - if (auto engine = weak_engine) { - if (main.empty()) { - engine->RunBundle(assets); - } else { - engine->RunBundleAndSource(assets, main, packages); - } - } - }); - - *engine_out = reinterpret_cast( - new PlatformViewHolder(std::move(platform_view))); + shell::Shell::CreateCallback on_create_platform_view = + [dispatch_table](shell::Shell& shell) { + return std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + dispatch_table // embedder dispatch table + ); + }; + + shell::Shell::CreateCallback on_create_rasterizer = + [](shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // Step 1: Create the engine. + auto embedder_engine = + std::make_unique(std::move(thread_host), // + std::move(task_runners), // + settings, // + on_create_platform_view, // + on_create_rasterizer // + ); + + if (!embedder_engine->IsValid()) { + return kInvalidArguments; + } + + // Step 2: Setup the rendering surface. + if (!embedder_engine->NotifyCreated()) { + return kInvalidArguments; + } + + // Step 3: Run the engine. + auto run_configuration = shell::RunConfiguration::InferFromSettings(settings); + + run_configuration.AddAssetResolver( + std::make_unique( + fml::Duplicate(settings.assets_dir))); + run_configuration.AddAssetResolver( + std::make_unique(fml::OpenFile( + settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); + + if (!embedder_engine->Run(std::move(run_configuration))) { + return kInvalidArguments; + } + + // Finally! Release the ownership of the embedder engine to the caller. + *engine_out = reinterpret_cast(embedder_engine.release()); return kSuccess; } @@ -199,7 +233,9 @@ FlutterResult FlutterEngineShutdown(FlutterEngine engine) { if (engine == nullptr) { return kInvalidArguments; } - delete reinterpret_cast(engine); + auto embedder_engine = reinterpret_cast(engine); + embedder_engine->NotifyDestroyed(); + delete embedder_engine; return kSuccess; } @@ -210,21 +246,16 @@ FlutterResult FlutterEngineSendWindowMetricsEvent( return kInvalidArguments; } - auto holder = reinterpret_cast(engine); - blink::ViewportMetrics metrics; metrics.physical_width = SAFE_ACCESS(flutter_metrics, width, 0.0); metrics.physical_height = SAFE_ACCESS(flutter_metrics, height, 0.0); metrics.device_pixel_ratio = SAFE_ACCESS(flutter_metrics, pixel_ratio, 1.0); - blink::Threads::UI()->PostTask( - [ weak_engine = holder->view()->engine().GetWeakPtr(), metrics ] { - if (auto engine = weak_engine) { - engine->SetViewportMetrics(metrics); - } - }); - return kSuccess; + return reinterpret_cast(engine)->SetViewportMetrics( + std::move(metrics)) + ? kSuccess + : kInvalidArguments; } inline blink::PointerData::Change ToPointerDataChange( @@ -267,19 +298,10 @@ FlutterResult FlutterEngineSendPointerEvent(FlutterEngine engine, reinterpret_cast(current) + current->struct_size); } - blink::Threads::UI()->PostTask(fxl::MakeCopyable([ - weak_engine = reinterpret_cast(engine) - ->view() - ->engine() - .GetWeakPtr(), - packet = std::move(packet) - ] { - if (auto engine = weak_engine) { - engine->DispatchPointerDataPacket(*packet); - } - })); - - return kSuccess; + return reinterpret_cast(engine) + ->DispatchPointerDataPacket(std::move(packet)) + ? kSuccess + : kInvalidArguments; } FlutterResult FlutterEngineSendPlatformMessage( @@ -294,8 +316,6 @@ FlutterResult FlutterEngineSendPlatformMessage( return kInvalidArguments; } - auto holder = reinterpret_cast(engine); - auto message = fxl::MakeRefCounted( flutter_message->channel, std::vector( @@ -303,13 +323,10 @@ FlutterResult FlutterEngineSendPlatformMessage( flutter_message->message + flutter_message->message_size), nullptr); - blink::Threads::UI()->PostTask( - [ weak_engine = holder->view()->engine().GetWeakPtr(), message ] { - if (auto engine = weak_engine) { - engine->DispatchPlatformMessage(message); - } - }); - return kSuccess; + return reinterpret_cast(engine)->SendPlatformMessage( + std::move(message)) + ? kSuccess + : kInvalidArguments; } FlutterResult FlutterEngineSendPlatformMessageResponse( diff --git a/shell/platform/embedder/embedder_engine.cc b/shell/platform/embedder/embedder_engine.cc new file mode 100644 index 0000000000000..7416441d7902e --- /dev/null +++ b/shell/platform/embedder/embedder_engine.cc @@ -0,0 +1,119 @@ +// Copyright 2017 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/shell/platform/embedder/embedder_engine.h" + +#include "lib/fxl/functional/make_copyable.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace shell { + +EmbedderEngine::EmbedderEngine( + ThreadHost thread_host, + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) + : thread_host_(std::move(thread_host)), + shell_(Shell::Create(std::move(task_runners), + std::move(settings), + on_create_platform_view, + on_create_rasterizer)) { + is_valid_ = shell_ != nullptr; +} + +EmbedderEngine::~EmbedderEngine() = default; + +bool EmbedderEngine::IsValid() const { + return is_valid_; +} + +bool EmbedderEngine::NotifyCreated() { + if (!IsValid()) { + return false; + } + + shell_->GetPlatformView()->NotifyCreated(); + return true; +} + +bool EmbedderEngine::NotifyDestroyed() { + if (!IsValid()) { + return false; + } + + shell_->GetPlatformView()->NotifyDestroyed(); + return true; +} + +bool EmbedderEngine::Run(RunConfiguration run_configuration) { + if (!IsValid()) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = shell_->GetEngine(), // engine + config = std::move(run_configuration) // config + ]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch the engine with configuration."; + } + } + })); + + return true; +} + +bool EmbedderEngine::SetViewportMetrics(blink::ViewportMetrics metrics) { + if (!IsValid()) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), metrics = std::move(metrics)]() { + if (engine) { + engine->SetViewportMetrics(std::move(metrics)); + } + }); + return true; +} + +bool EmbedderEngine::DispatchPointerDataPacket( + std::unique_ptr packet) { + if (!IsValid() || !packet) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = shell_->GetEngine(), packet = std::move(packet)] { + if (engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); + + return true; +} + +bool EmbedderEngine::SendPlatformMessage( + fxl::RefPtr message) { + if (!IsValid() || !message) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), message] { + if (engine) { + engine->DispatchPlatformMessage(message); + } + }); + + return true; +} + +} // namespace shell diff --git a/shell/platform/embedder/embedder_engine.h b/shell/platform/embedder/embedder_engine.h new file mode 100644 index 0000000000000..c01b86c2aac47 --- /dev/null +++ b/shell/platform/embedder/embedder_engine.h @@ -0,0 +1,53 @@ +// Copyright 2017 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_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ +#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ + +#include + +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/embedder/embedder.h" +#include "lib/fxl/macros.h" + +namespace shell { + +// The object that is returned to the embedder as an opaque pointer to the +// instance of the Flutter engine. +class EmbedderEngine { + public: + EmbedderEngine(ThreadHost thread_host, blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer); + + ~EmbedderEngine(); + + bool NotifyCreated(); + + bool NotifyDestroyed(); + + bool Run(RunConfiguration run_configuration); + + bool IsValid() const; + + bool SetViewportMetrics(blink::ViewportMetrics metrics); + + bool DispatchPointerDataPacket( + std::unique_ptr packet); + + bool SendPlatformMessage(fxl::RefPtr message); + + private: + const ThreadHost thread_host_; + std::unique_ptr shell_; + bool is_valid_ = false; + + FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderEngine); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ diff --git a/shell/platform/embedder/platform_view_embedder.cc b/shell/platform/embedder/platform_view_embedder.cc index 46e0390770da4..db1bea35c691e 100644 --- a/shell/platform/embedder/platform_view_embedder.cc +++ b/shell/platform/embedder/platform_view_embedder.cc @@ -3,17 +3,18 @@ // found in the LICENSE file. #include "flutter/shell/platform/embedder/platform_view_embedder.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" + +#include "flutter/shell/common/io_manager.h" namespace shell { -PlatformViewEmbedder::PlatformViewEmbedder(DispatchTable dispatch_table) - : PlatformView(std::make_unique(nullptr)), +PlatformViewEmbedder::PlatformViewEmbedder(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + DispatchTable dispatch_table) + : PlatformView(delegate, std::move(task_runners)), dispatch_table_(dispatch_table) {} -PlatformViewEmbedder::~PlatformViewEmbedder() { - NotifyDestroyed(); -} +PlatformViewEmbedder::~PlatformViewEmbedder() = default; bool PlatformViewEmbedder::GLContextMakeCurrent() { return dispatch_table_.gl_make_current_callback(); @@ -31,33 +32,6 @@ intptr_t PlatformViewEmbedder::GLContextFBO() const { return dispatch_table_.gl_fbo_callback(); } -void PlatformViewEmbedder::Attach() { - CreateEngine(); - NotifyCreated(std::make_unique(this)); - - if (dispatch_table_.gl_make_resource_current_callback != nullptr) { - SetupResourceContextOnIOThread(); - } -} - -bool PlatformViewEmbedder::ResourceContextMakeCurrent() { - if (dispatch_table_.gl_make_resource_current_callback == nullptr) { - return false; - } - return dispatch_table_.gl_make_resource_current_callback(); -} - -void PlatformViewEmbedder::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - FXL_LOG(INFO) << "Hot reloading is unsupported on this platform."; -} - -void PlatformViewEmbedder::SetAssetBundlePath( - const std::string& assets_directory) { - FXL_LOG(INFO) << "Set asset bundle path is unsupported on this platform."; -} - void PlatformViewEmbedder::HandlePlatformMessage( fxl::RefPtr message) { if (!message) { @@ -76,4 +50,17 @@ void PlatformViewEmbedder::HandlePlatformMessage( dispatch_table_.platform_message_response_callback(std::move(message)); } +std::unique_ptr PlatformViewEmbedder::CreateRenderingSurface() { + return std::make_unique(this); +} + +sk_sp PlatformViewEmbedder::CreateResourceContext() const { + auto callback = dispatch_table_.gl_make_resource_current_callback; + if (callback && callback()) { + return IOManager::CreateCompatibleResourceLoadingContext( + GrBackend::kOpenGL_GrBackend); + } + return nullptr; +} + } // namespace shell diff --git a/shell/platform/embedder/platform_view_embedder.h b/shell/platform/embedder/platform_view_embedder.h index c287fc5ac86f1..a5b76dfaa07ba 100644 --- a/shell/platform/embedder/platform_view_embedder.h +++ b/shell/platform/embedder/platform_view_embedder.h @@ -12,7 +12,8 @@ namespace shell { -class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { +class PlatformViewEmbedder final : public PlatformView, + public GPUSurfaceGLDelegate { public: using PlatformMessageResponseCallback = std::function)>; @@ -26,9 +27,11 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { std::function gl_make_resource_current_callback; // optional }; - PlatformViewEmbedder(DispatchTable dispatch_table); + PlatformViewEmbedder(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + DispatchTable dispatch_table); - ~PlatformViewEmbedder(); + ~PlatformViewEmbedder() override; // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; @@ -42,20 +45,6 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { // |shell::GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; - // |shell::PlatformView| - void Attach() override; - - // |shell::PlatformView| - bool ResourceContextMakeCurrent() override; - - // |shell::PlatformView| - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - // |shell::PlatformView| - void SetAssetBundlePath(const std::string& assets_directory) override; - // |shell::PlatformView| void HandlePlatformMessage( fxl::RefPtr message) override; @@ -63,6 +52,12 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { private: DispatchTable dispatch_table_; + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; + + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewEmbedder); }; diff --git a/shell/platform/linux/BUILD.gn b/shell/platform/linux/BUILD.gn deleted file mode 100644 index 6e9f1f596b09d..0000000000000 --- a/shell/platform/linux/BUILD.gn +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2016 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. - -executable("linux") { - output_name = "flutter_tester" - - sources = [ - "main_linux.cc", - ] - - deps = [ - "//third_party/dart/runtime:libdart_jit", - "//third_party/dart/runtime/bin:embedded_dart_io", - "$flutter_root/common", - "$flutter_root/fml", - "$flutter_root/shell/common", - "$flutter_root/shell/testing", - "//garnet/public/lib/fxl", - "//third_party/skia", - "//topaz/lib/tonic", - ] -} diff --git a/shell/platform/linux/main_linux.cc b/shell/platform/linux/main_linux.cc deleted file mode 100644 index a20d425ed1eed..0000000000000 --- a/shell/platform/linux/main_linux.cc +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/common/threads.h" -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/testing/test_runner.h" -#include "flutter/shell/testing/testing.h" -#include "flutter/sky/engine/public/web/Sky.h" -#include "lib/fxl/command_line.h" -#include "lib/tonic/dart_microtask_queue.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -namespace { - -// Exit codes used by the Dart command line tool. -const int kApiErrorExitCode = 253; -const int kCompilationErrorExitCode = 254; -const int kErrorExitCode = 255; - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver : public fml::TaskObserver { - public: - ScriptCompletionTaskObserver(fxl::RefPtr task_runner) - : main_task_runner_(std::move(task_runner)), - prev_live_(false), - last_error_(tonic::kNoError) {} - - void DidProcessTask() override { - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - shell::Engine& engine = test_runner.platform_view().engine(); - - if (engine.GetLoadScriptError() != tonic::kNoError) { - last_error_ = engine.GetLoadScriptError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - return; - } - - bool live = engine.UIIsolateHasLivePorts(); - if (prev_live_ && !live) { - last_error_ = engine.GetUIIsolateLastError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - prev_live_ = live; - } - - tonic::DartErrorHandleType last_error() { return last_error_; } - - private: - fxl::RefPtr main_task_runner_; - bool prev_live_; - tonic::DartErrorHandleType last_error_; -}; - -int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { - switch (error) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } -} - -void RunNonInteractive(fxl::CommandLine initial_command_line, - bool run_forever) { - // This is a platform thread (i.e not one created by fml::Thread), so perform - // one time initialization. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - std::string bundle_path = ""; - initial_command_line.GetOptionValue( - FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); - - shell::Shell::InitStandalone(initial_command_line, - /* icu_data_path= */ "", - /* application_library_path= */ "", bundle_path); - - // Note that this task observer must be added after the observer that drains - // the microtask queue. - ScriptCompletionTaskObserver task_observer( - fml::MessageLoop::GetCurrent().GetTaskRunner()); - if (!run_forever) { - blink::Threads::UI()->PostTask([&task_observer] { - fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); - }); - } - - if (!shell::InitForTesting(initial_command_line)) { - shell::PrintUsage("flutter_tester"); - exit(EXIT_FAILURE); - return; - } - - fml::MessageLoop::GetCurrent().Run(); - - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - tonic::DartErrorHandleType error = - test_runner.platform_view().engine().GetLoadScriptError(); - if (error == tonic::kNoError) - error = task_observer.last_error(); - if (error == tonic::kNoError) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&error, &latch] { - error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); - latch.Signal(); - }); - latch.Wait(); - } - - // The script has completed and the engine may not be in a clean state, - // so just stop the process. - exit(ConvertErrorTypeToExitCode(error)); -} - -} // namespace - -int main(int argc, char* argv[]) { - dart::bin::SetExecutableName(argv[0]); - dart::bin::SetExecutableArguments(argc - 1, argv); - - auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); - - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { - shell::PrintUsage("flutter_tester"); - return EXIT_SUCCESS; - } - - bool run_forever = - command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); - RunNonInteractive(std::move(command_line), run_forever); - return EXIT_SUCCESS; -} diff --git a/shell/platform/win/BUILD.gn b/shell/platform/win/BUILD.gn deleted file mode 100644 index b4a2fe5033c18..0000000000000 --- a/shell/platform/win/BUILD.gn +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2016 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. - -executable("win") { - output_name = "flutter_tester" - - sources = [ - "main_win.cc", - ] - - deps = [ - "//flutter/common", - "//flutter/flow", - "//flutter/fml", - "//flutter/shell/common", - "//flutter/shell/testing", - "//flutter/sky/engine/wtf", - "//garnet/public/lib/fxl", - "//third_party/dart/runtime/bin:embedded_dart_io", - "//third_party/dart/runtime:libdart_jit", - "//third_party/skia", - "//topaz/lib/tonic", - ] - - libs = [ - "iphlpapi.lib", - "Rpcrt4.lib" - ] -} diff --git a/shell/platform/win/main_win.cc b/shell/platform/win/main_win.cc deleted file mode 100644 index c31c88ca915cb..0000000000000 --- a/shell/platform/win/main_win.cc +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015 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. - -#include - -#include "flutter/common/threads.h" -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/testing/test_runner.h" -#include "flutter/shell/testing/testing.h" -#include "lib/fxl/command_line.h" -#include "lib/tonic/dart_microtask_queue.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -namespace { - -// Exit codes used by the Dart command line tool. -const int kApiErrorExitCode = 253; -const int kCompilationErrorExitCode = 254; -const int kErrorExitCode = 255; - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver : public fml::TaskObserver { - public: - ScriptCompletionTaskObserver(fxl::RefPtr task_runner) - : main_task_runner_(std::move(task_runner)), - prev_live_(false), - last_error_(tonic::kNoError) {} - - void DidProcessTask() override { - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - shell::Engine& engine = test_runner.platform_view().engine(); - - if (engine.GetLoadScriptError() != tonic::kNoError) { - last_error_ = engine.GetLoadScriptError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - return; - } - - bool live = engine.UIIsolateHasLivePorts(); - if (prev_live_ && !live) { - last_error_ = engine.GetUIIsolateLastError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - prev_live_ = live; - } - - tonic::DartErrorHandleType last_error() { return last_error_; } - - private: - fxl::RefPtr main_task_runner_; - bool prev_live_; - tonic::DartErrorHandleType last_error_; -}; - -int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { - switch (error) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } -} - -void RunNonInteractive(fxl::CommandLine initial_command_line, - bool run_forever) { - // This is a platform thread (i.e not one created by fml::Thread), so perform - // one time initialization. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - std::string bundle_path = ""; - initial_command_line.GetOptionValue( - FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); - - shell::Shell::InitStandalone(initial_command_line, - /* icu_data_path= */ "", - /* application_library_path= */ "", bundle_path); - - // Note that this task observer must be added after the observer that drains - // the microtask queue. - ScriptCompletionTaskObserver task_observer( - fml::MessageLoop::GetCurrent().GetTaskRunner()); - if (!run_forever) { - blink::Threads::UI()->PostTask([&task_observer] { - fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); - }); - } - - if (!shell::InitForTesting(initial_command_line)) { - shell::PrintUsage("flutter_tester"); - ::ExitProcess(EXIT_FAILURE); - return; - } - - fml::MessageLoop::GetCurrent().Run(); - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - tonic::DartErrorHandleType error = - test_runner.platform_view().engine().GetLoadScriptError(); - if (error == tonic::kNoError) - error = task_observer.last_error(); - if (error == tonic::kNoError) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&error, &latch] { - error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); - latch.Signal(); - }); - latch.Wait(); - } - - // The script has completed and the engine may not be in a clean state, - // so just stop the process. - ::ExitProcess(ConvertErrorTypeToExitCode(error)); -} - -} // namespace - -int main(int argc, char* argv[]) { - dart::bin::SetExecutableName(argv[0]); - dart::bin::SetExecutableArguments(argc - 1, argv); - - auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); - - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { - shell::PrintUsage("flutter_tester"); - return EXIT_SUCCESS; - } - - bool run_forever = - command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); - RunNonInteractive(std::move(command_line), run_forever); - return EXIT_SUCCESS; -} diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index 659c241cc49b8..f11a3a2d07501 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -2,24 +2,30 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -source_set("testing") { +executable("testing") { + testonly = true + + output_name = "flutter_tester" + + public_configs = [ "$flutter_root:config" ] + sources = [ - "platform_view_test.cc", - "platform_view_test.h", - "test_runner.cc", - "test_runner.h", - "testing.cc", - "testing.h", + "tester_main.cc", ] deps = [ + "$flutter_root/assets", "$flutter_root/common", + "$flutter_root/fml", "$flutter_root/shell/common", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", + "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", + "//topaz/lib/tonic", ] - public_configs = [ - "$flutter_root:config", - ] + if (is_linux) { + ldflags = [ "-rdynamic" ] + } } diff --git a/shell/testing/platform_view_test.cc b/shell/testing/platform_view_test.cc deleted file mode 100644 index a59684d31bc94..0000000000000 --- a/shell/testing/platform_view_test.cc +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/testing/platform_view_test.h" - -#include "flutter/shell/common/null_rasterizer.h" -#include "flutter/shell/common/shell.h" - -namespace shell { - -PlatformViewTest::PlatformViewTest() - : PlatformView(std::unique_ptr(new NullRasterizer())) {} - -void PlatformViewTest::Attach() { - CreateEngine(); -} - -PlatformViewTest::~PlatformViewTest() = default; - -bool PlatformViewTest::ResourceContextMakeCurrent() { - return false; -} - -void PlatformViewTest::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) {} - -void PlatformViewTest::SetAssetBundlePath(const std::string& assets_directory) { -} - -} // namespace shell diff --git a/shell/testing/platform_view_test.h b/shell/testing/platform_view_test.h deleted file mode 100644 index 3612d0363ab58..0000000000000 --- a/shell/testing/platform_view_test.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 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. - -#ifndef SHELL_TESTING_PLATFORM_VIEW_TEST_H_ -#define SHELL_TESTING_PLATFORM_VIEW_TEST_H_ - -#include "flutter/shell/common/platform_view.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class Shell; - -class PlatformViewTest : public PlatformView { - public: - PlatformViewTest(); - - ~PlatformViewTest(); - - virtual void Attach() override; - - bool ResourceContextMakeCurrent() override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - void SetAssetBundlePath(const std::string& assets_directory) override; - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewTest); -}; - -} // namespace shell - -#endif // SHELL_TESTING_PLATFORM_VIEW_TEST_H_ diff --git a/shell/testing/test_runner.cc b/shell/testing/test_runner.cc deleted file mode 100644 index 838b04120c773..0000000000000 --- a/shell/testing/test_runner.cc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/shell/testing/test_runner.h" - -#include - -#include "flutter/common/threads.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/testing/platform_view_test.h" - -namespace shell { - -TestRunner::TestRunner() - : platform_view_(std::make_shared()) { - platform_view_->Attach(); - blink::ViewportMetrics metrics; - metrics.device_pixel_ratio = 3.0; - metrics.physical_width = 2400; // 800 at 3x resolution - metrics.physical_height = 1800; // 600 at 3x resolution - - blink::Threads::UI()->PostTask( - [ engine = platform_view_->engine().GetWeakPtr(), metrics ] { - if (engine) - engine->SetViewportMetrics(metrics); - }); -} - -TestRunner::~TestRunner() = default; - -TestRunner& TestRunner::Shared() { - static TestRunner* g_test_runner = nullptr; - if (!g_test_runner) - g_test_runner = new TestRunner(); - return *g_test_runner; -} - -void TestRunner::Run(const TestDescriptor& test) { - blink::Threads::UI()->PostTask( - [ engine = platform_view_->engine().GetWeakPtr(), test ] { - if (engine) - engine->RunBundleAndSource(std::string(), test.path, test.packages); - }); -} - -} // namespace shell diff --git a/shell/testing/test_runner.h b/shell/testing/test_runner.h deleted file mode 100644 index 8f303d7eb7683..0000000000000 --- a/shell/testing/test_runner.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_TESTING_TEST_RUNNER_H_ -#define SHELL_TESTING_TEST_RUNNER_H_ - -#include -#include - -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class PlatformView; - -class TestRunner { - public: - static TestRunner& Shared(); - - struct TestDescriptor { - std::string path; - std::string packages; - }; - - void Run(const TestDescriptor& test); - - PlatformView& platform_view() { return *platform_view_; } - - private: - TestRunner(); - ~TestRunner(); - - std::shared_ptr platform_view_; - - FXL_DISALLOW_COPY_AND_ASSIGN(TestRunner); -}; - -} // namespace shell - -#endif // SHELL_TESTING_TEST_RUNNER_H_ diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc new file mode 100644 index 0000000000000..a9e7bafc74d93 --- /dev/null +++ b/shell/testing/tester_main.cc @@ -0,0 +1,243 @@ +// Copyright 2018 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 + +#include "flutter/assets/asset_manager.h" +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/fml/file.h" +#include "flutter/fml/message_loop.h" +#include "flutter/fml/paths.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/thread_host.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace shell { + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver { + public: + ScriptCompletionTaskObserver(Shell& shell, + fxl::RefPtr main_task_runner, + bool run_forever) + : engine_(shell.GetEngine()), + main_task_runner_(std::move(main_task_runner)), + run_forever_(run_forever) {} + + int GetExitCodeForLastError() const { + // Exit codes used by the Dart command line tool. + const int kApiErrorExitCode = 253; + const int kCompilationErrorExitCode = 254; + const int kErrorExitCode = 255; + switch (last_error_) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } + } + + void DidProcessTask() { + if (engine_) { + last_error_ = engine_->GetUIIsolateLastError(); + if (engine_->UIIsolateHasLivePorts()) { + // The UI isolate still has live ports and is running. Nothing to do + // just yet. + return; + } + } + + if (run_forever_) { + // We need this script to run forever. We have already recorded the last + // error. Keep going. + return; + } + + if (!has_terminated) { + // Only try to terminate the loop once. + has_terminated = true; + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + } + + private: + fml::WeakPtr engine_; + fxl::RefPtr main_task_runner_; + bool run_forever_ = false; + tonic::DartErrorHandleType last_error_ = tonic::kUnknownErrorType; + bool has_terminated = false; + + FXL_DISALLOW_COPY_AND_ASSIGN(ScriptCompletionTaskObserver); +}; + +int RunTester(const blink::Settings& settings, bool run_forever) { + const auto thread_label = "io.flutter.test"; + + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); + + // Setup a single threaded test runner configuration. + const blink::TaskRunners task_runners(thread_label, // dart thread label + current_task_runner, // platform + current_task_runner, // gpu + current_task_runner, // ui + current_task_runner // io + ); + + Shell::CreateCallback on_create_platform_view = + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }; + + Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + auto shell = Shell::Create(task_runners, // + settings, // + on_create_platform_view, // + on_create_rasterizer // + ); + + if (!shell || !shell->IsSetup()) { + FXL_LOG(ERROR) << "Could not setup the shell."; + return EXIT_FAILURE; + } + + auto isolate_configuration = IsolateConfiguration::CreateForSource( + settings.main_dart_file_path, settings.packages_file_path); + + if (!isolate_configuration) { + FXL_LOG(ERROR) << "Could create isolate configuration."; + return EXIT_FAILURE; + } + + auto asset_manager = fxl::MakeRefCounted(); + asset_manager->PushBack(std::make_unique( + fml::Duplicate(settings.assets_dir))); + asset_manager->PushBack( + std::make_unique(fml::OpenFile( + settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); + + RunConfiguration run_configuration(std::move(isolate_configuration), + std::move(asset_manager)); + + // The script completion task observer that will be installed on the UI thread + // that watched if the engine has any live ports. + ScriptCompletionTaskObserver completion_observer( + *shell, // a valid shell + fml::MessageLoop::GetCurrent() + .GetTaskRunner(), // the message loop to terminate + run_forever // should the exit be ignored + ); + + bool engine_did_run = false; + + shell->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [&completion_observer, engine = shell->GetEngine(), + config = std::move(run_configuration), &engine_did_run]() mutable { + fml::MessageLoop::GetCurrent().AddTaskObserver( + reinterpret_cast(&completion_observer), + [&completion_observer]() { completion_observer.DidProcessTask(); }); + if (engine->Run(std::move(config))) { + engine_did_run = true; + + blink::ViewportMetrics metrics; + metrics.device_pixel_ratio = 3.0; + metrics.physical_width = 2400; // 800 at 3x resolution + metrics.physical_height = 1800; // 600 at 3x resolution + engine->SetViewportMetrics(metrics); + + } else { + FXL_DLOG(ERROR) << "Could not launch the engine with configuration."; + } + })); + + // Run the message loop and wait for the script to do its thing. + fml::MessageLoop::GetCurrent().Run(); + + // Cleanup the completion observer synchronously as it is living on the + // stack. + fxl::AutoResetWaitableEvent latch; + fml::TaskRunner::RunNowOrPostTask( + shell->GetTaskRunners().GetUITaskRunner(), + [&latch, &completion_observer] { + fml::MessageLoop::GetCurrent().RemoveTaskObserver( + reinterpret_cast(&completion_observer)); + latch.Signal(); + }); + latch.Wait(); + + if (!engine_did_run) { + // If the engine itself didn't have a chance to run, there is no point in + // asking it if there was an error. Signal a failure unconditionally. + return EXIT_FAILURE; + } + + return completion_observer.GetExitCodeForLastError(); +} + +} // namespace shell + +int main(int argc, char* argv[]) { + dart::bin::SetExecutableName(argv[0]); + dart::bin::SetExecutableArguments(argc - 1, argv); + + auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); + + if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { + shell::PrintUsage("flutter_tester"); + return EXIT_SUCCESS; + } + + auto settings = shell::SettingsFromCommandLine(command_line); + if (command_line.positional_args().size() > 0) { + // The tester may not use the switch for the main dart file path. Specifying + // it as a positional argument instead. + settings.main_dart_file_path = command_line.positional_args()[0]; + } + + if (settings.main_dart_file_path.size() == 0) { + FXL_LOG(ERROR) << "Main dart file path not specified."; + return EXIT_FAILURE; + } + + settings.icu_data_path = "icudtl.dat"; + + settings.kernel_snapshot_path = + fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); + + // The tools that read logs get confused if there is a log tag specified. + settings.log_tag = ""; + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + return shell::RunTester( + settings, + command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever))); +} diff --git a/shell/testing/testing.cc b/shell/testing/testing.cc deleted file mode 100644 index 13a3ab5be3d93..0000000000000 --- a/shell/testing/testing.cc +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/testing/testing.h" - -#include "flutter/shell/common/switches.h" -#include "flutter/shell/testing/test_runner.h" - -namespace shell { - -bool InitForTesting(const fxl::CommandLine& command_line) { - TestRunner::TestDescriptor test; - test.packages = command_line.GetOptionValueWithDefault( - FlagForSwitch(Switch::Packages), ""); - auto args = command_line.positional_args(); - if (args.empty()) - return false; - test.path = args[0]; - TestRunner::Shared().Run(test); - return true; -} - -} // namespace shell diff --git a/shell/testing/testing.h b/shell/testing/testing.h deleted file mode 100644 index 99f8b4fe983de..0000000000000 --- a/shell/testing/testing.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_TESTING_TESTING_H_ -#define SHELL_TESTING_TESTING_H_ - -#include "lib/fxl/command_line.h" - -namespace shell { - -bool InitForTesting(const fxl::CommandLine& command_line); - -} // namespace shell - -#endif // SHELL_TESTING_TESTING_H_ diff --git a/sky/engine/platform/SharedBuffer.cpp b/sky/engine/platform/SharedBuffer.cpp index 8577ab16f2938..bc94f22e97ce6 100644 --- a/sky/engine/platform/SharedBuffer.cpp +++ b/sky/engine/platform/SharedBuffer.cpp @@ -26,7 +26,6 @@ #include "flutter/sky/engine/platform/SharedBuffer.h" -#include "flutter/common/threads.h" #include "flutter/sky/engine/public/platform/Platform.h" #include "flutter/sky/engine/wtf/unicode/UTF8.h" #include "flutter/sky/engine/wtf/unicode/Unicode.h" diff --git a/sky/engine/platform/fonts/FontFallbackList.cpp b/sky/engine/platform/fonts/FontFallbackList.cpp index 177f161adaa7e..4786d65e0d7ad 100644 --- a/sky/engine/platform/fonts/FontFallbackList.cpp +++ b/sky/engine/platform/fonts/FontFallbackList.cpp @@ -37,6 +37,11 @@ namespace blink { +bool gUseTestFonts = false; +void FontFallbackList::SetUseTestFonts(bool useTestFonts) { + gUseTestFonts = useTestFonts; +} + FontFallbackList::FontFallbackList() : m_pageZero(0), m_cachedPrimarySimpleFontData(0), @@ -45,7 +50,8 @@ FontFallbackList::FontFallbackList() m_familyIndex(0), m_generation(FontCache::fontCache()->generation()), m_pitch(UnknownPitch), - m_hasLoadingFallback(false) {} + m_hasLoadingFallback(false), + m_useTestFonts(gUseTestFonts) {} void FontFallbackList::invalidate(PassRefPtr fontSelector) { releaseFontData(); @@ -193,7 +199,7 @@ PassRefPtr FontFallbackList::getFontData( const FontFamily* currFamily = startFamily; while (currFamily && !result) { familyIndex++; - if (currFamily->family().length() || Settings::Get().use_test_fonts) { + if (currFamily->family().length() || m_useTestFonts) { if (m_fontSelector) result = m_fontSelector->getFontData(fontDescription, currFamily->family()); diff --git a/sky/engine/platform/fonts/FontFallbackList.h b/sky/engine/platform/fonts/FontFallbackList.h index fdac27e5013bd..3331387968edc 100644 --- a/sky/engine/platform/fonts/FontFallbackList.h +++ b/sky/engine/platform/fonts/FontFallbackList.h @@ -103,6 +103,8 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { m_pageZero = node; } + static void SetUseTestFonts(bool useTestFonts); + private: FontFallbackList(); @@ -125,6 +127,7 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { unsigned short m_generation; mutable unsigned m_pitch : 3; // Pitch mutable bool m_hasLoadingFallback : 1; + bool m_useTestFonts = false; }; } // namespace blink diff --git a/sky/engine/web/Sky.cpp b/sky/engine/web/Sky.cpp index e90539e96cf87..52c6243743d7b 100644 --- a/sky/engine/web/Sky.cpp +++ b/sky/engine/web/Sky.cpp @@ -53,56 +53,6 @@ namespace blink { -namespace { - -void didProcessTask() { - tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); - // FIXME: Report memory usage to dart? -} - -#if defined(OS_FUCHSIA) - -void addMessageLoopObservers() { - fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback(didProcessTask); -} - -void removeMessageLoopObservers() { - fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); -} - -#else // defined(OS_FUCHSIA) - -class RunMicrotasksTaskObserver : public fml::TaskObserver { - public: - RunMicrotasksTaskObserver() = default; - - ~RunMicrotasksTaskObserver() override = default; - - void DidProcessTask() override { didProcessTask(); } -}; - -// FIXME(chinmaygarde): The awkward use of the global here is be cause we cannot -// introduce the fml::TaskObserver subclass in common code because Fuchsia does -// not support the same. Unify the API and remove hack. -static RunMicrotasksTaskObserver* g_run_microtasks_task_observer = nullptr; - -void addMessageLoopObservers() { - g_run_microtasks_task_observer = new RunMicrotasksTaskObserver(); - fml::MessageLoop::GetCurrent().AddTaskObserver( - g_run_microtasks_task_observer); -} - -void removeMessageLoopObservers() { - fml::MessageLoop::GetCurrent().RemoveTaskObserver( - g_run_microtasks_task_observer); - delete g_run_microtasks_task_observer; - g_run_microtasks_task_observer = nullptr; -} - -#endif // defined(OS_FUCHSIA) - -} // namespace - // Make sure we are not re-initialized in the same address space. // Doing so may cause hard to reproduce crashes. static bool s_webKitInitialized = false; @@ -130,15 +80,9 @@ void InitEngine(Platform* platform) { // the initialization thread-safe, but given that so many code paths use // this, initializing this lazily probably doesn't buy us much. WTF::UTF8Encoding(); - - tonic::DartMicrotaskQueue::StartForCurrentThread(); - addMessageLoopObservers(); } void ShutdownEngine() { - removeMessageLoopObservers(); - tonic::DartMicrotaskQueue::GetForCurrentThread()->Destroy(); - // FIXME: Shutdown dart? CoreInitializer::shutdown(); diff --git a/synchronization/BUILD.gn b/synchronization/BUILD.gn index 977a571c8da30..9ee7680cc1160 100644 --- a/synchronization/BUILD.gn +++ b/synchronization/BUILD.gn @@ -4,16 +4,13 @@ source_set("synchronization") { sources = [ - "debug_thread_checker.h", "pipeline.cc", "pipeline.h", "semaphore.cc", "semaphore.h", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] public_deps = [ "$flutter_root/glue", diff --git a/synchronization/debug_thread_checker.h b/synchronization/debug_thread_checker.h deleted file mode 100644 index 69614eb89d217..0000000000000 --- a/synchronization/debug_thread_checker.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ -#define FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ - -#ifndef NDEBUG - -#include -#include "lib/fxl/synchronization/thread_checker.h" - -#define FLUTTER_THREAD_CHECKER_DECLARE(x) ::fxl::ThreadChecker x; - -#define FLUTTER_THREAD_CHECKER_CHECK(x) FXL_CHECK(x.IsCreationThreadCurrent()); - -#else // NDEBUG - -#define FLUTTER_THREAD_CHECKER_DECLARE(x) - -#define FLUTTER_THREAD_CHECKER_CHECK(x) - -#endif // NDEBUG - -#endif // FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ diff --git a/synchronization/semaphore.cc b/synchronization/semaphore.cc index c6e0bdf9e2d53..4dc5f6220e350 100644 --- a/synchronization/semaphore.cc +++ b/synchronization/semaphore.cc @@ -15,9 +15,12 @@ namespace flutter { class PlatformSemaphore { public: explicit PlatformSemaphore(uint32_t count) - : _sem(dispatch_semaphore_create(count)) {} + : _sem(dispatch_semaphore_create(count)), _initial(count) {} ~PlatformSemaphore() { + for (uint32_t i = 0; i < _initial; ++i) { + Signal(); + } if (_sem != nullptr) { dispatch_release(reinterpret_cast(_sem)); _sem = nullptr; @@ -42,6 +45,7 @@ class PlatformSemaphore { private: dispatch_semaphore_t _sem; + const uint32_t _initial; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; diff --git a/testing/BUILD.gn b/testing/BUILD.gn index 3927e71cfc0e4..a65311bfaeb7c 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -9,9 +9,13 @@ source_set("testing") { "$flutter_root/testing/run_all_unittests.cc", "$flutter_root/testing/testing.cc", "$flutter_root/testing/testing.h", + "$flutter_root/testing/thread_test.cc", + "$flutter_root/testing/thread_test.h", ] public_deps = [ + "$flutter_root/fml", + "//garnet/public/lib/fxl", "//third_party/googletest:gtest", ] diff --git a/testing/thread_test.cc b/testing/thread_test.cc new file mode 100644 index 0000000000000..1306f37678fbe --- /dev/null +++ b/testing/thread_test.cc @@ -0,0 +1,33 @@ +// Copyright 2017 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/testing/thread_test.h" + +namespace testing { + +void ThreadTest::SetUp() { + thread_ = std::make_unique(); + thread_task_runner_ = thread_->GetTaskRunner(); + + fml::MessageLoop::EnsureInitializedForCurrentThread(); + current_task_runner_ = fml::MessageLoop::GetCurrent().GetTaskRunner(); +} + +void ThreadTest::TearDown() { + thread_task_runner_ = nullptr; + thread_ = nullptr; + current_task_runner_ = nullptr; +} + +fxl::RefPtr ThreadTest::GetCurrentTaskRunner() { + return current_task_runner_; +} + +fxl::RefPtr ThreadTest::GetThreadTaskRunner() { + return thread_task_runner_; +} + +} // namespace testing diff --git a/testing/thread_test.h b/testing/thread_test.h new file mode 100644 index 0000000000000..511d09c978858 --- /dev/null +++ b/testing/thread_test.h @@ -0,0 +1,37 @@ +// Copyright 2017 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_TESTING_THREAD_TEST_H_ +#define FLUTTER_TESTING_THREAD_TEST_H_ + +#include + +#include "flutter/fml/message_loop.h" +#include "flutter/fml/task_runner.h" +#include "flutter/fml/thread.h" +#include "gtest/gtest.h" +#include "lib/fxl/macros.h" + +namespace testing { + +class ThreadTest : public Test { + public: + fxl::RefPtr GetCurrentTaskRunner(); + + fxl::RefPtr GetThreadTaskRunner(); + + protected: + void SetUp() override; + + void TearDown() override; + + private: + std::unique_ptr thread_; + fxl::RefPtr thread_task_runner_; + fxl::RefPtr current_task_runner_; +}; + +} // namespace testing + +#endif // FLUTTER_TESTING_THREAD_TEST_H_ diff --git a/tools/gn b/tools/gn index ea7071ac0a474..b4b15f99f1d4f 100755 --- a/tools/gn +++ b/tools/gn @@ -232,6 +232,10 @@ def main(argv): # On the Mac, also generate Xcode projects for ease of editing. command.append('--ide=xcode') + if sys.platform.startswith('win'): + # On Windows, also generate Visual Studio project for ease of editing. + command.append('--ide=vs') + gn_args = to_command_line(to_gn_args(args)) out_dir = get_out_dir(args) print "gn gen --check in %s" % out_dir diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 8749f6880dbf4..b15c608425095 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -1059,14 +1059,10 @@ USED LICENSES: ==================================================================================================== LIBRARY: engine LIBRARY: txt -ORIGIN: ../../../flutter/content_handler/service_protocol_hooks.cc + ../../../LICENSE +ORIGIN: ../../../flutter/content_handler/session_connection.cc + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/content_handler/service_protocol_hooks.cc -FILE: ../../../flutter/content_handler/service_protocol_hooks.h FILE: ../../../flutter/content_handler/session_connection.cc FILE: ../../../flutter/content_handler/session_connection.h -FILE: ../../../flutter/content_handler/vulkan_rasterizer.cc -FILE: ../../../flutter/content_handler/vulkan_rasterizer.h FILE: ../../../flutter/content_handler/vulkan_surface_producer.cc FILE: ../../../flutter/content_handler/vulkan_surface_producer.h FILE: ../../../flutter/flow/debug_print.cc @@ -1126,7 +1122,6 @@ FILE: ../../../flutter/fml/platform/win/mapping_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.h FILE: ../../../flutter/fml/platform/win/paths_win.cc -FILE: ../../../flutter/fml/task_observer.h FILE: ../../../flutter/fml/task_runner.cc FILE: ../../../flutter/fml/task_runner.h FILE: ../../../flutter/fml/thread.cc @@ -1142,13 +1137,10 @@ FILE: ../../../flutter/lib/ui/painting/codec.cc FILE: ../../../flutter/lib/ui/painting/codec.h FILE: ../../../flutter/lib/ui/painting/frame_info.cc FILE: ../../../flutter/lib/ui/painting/frame_info.h -FILE: ../../../flutter/lib/ui/painting/utils.cc FILE: ../../../flutter/lib/ui/painting/vertices.cc FILE: ../../../flutter/lib/ui/painting/vertices.h FILE: ../../../flutter/lib/ui/text/font_collection.cc FILE: ../../../flutter/lib/ui/text/font_collection.h -FILE: ../../../flutter/shell/common/null_platform_view.cc -FILE: ../../../flutter/shell/common/null_platform_view.h FILE: ../../../flutter/shell/gpu/gpu_surface_software.cc FILE: ../../../flutter/shell/gpu/gpu_surface_software.h FILE: ../../../flutter/shell/platform/android/android_external_texture_gl.cc @@ -1195,8 +1187,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandar FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_standard_codec_unittest.mm FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.h FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -1563,7 +1553,6 @@ FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc FILE: ../../../flutter/shell/platform/android/apk_asset_provider.cc FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/JSONUtil.java FILE: ../../../flutter/shell/platform/darwin/desktop/Info.plist -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_mac.xib FILE: ../../../flutter/shell/platform/darwin/ios/framework/Flutter.podspec FILE: ../../../flutter/shell/platform/darwin/ios/framework/Info.plist FILE: ../../../flutter/shell/platform/darwin/ios/framework/module.modulemap @@ -1638,17 +1627,48 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/assets/asset_provider.h + ../../../LICENSE +ORIGIN: ../../../flutter/assets/asset_manager.cc + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/assets/asset_provider.h -FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart -FILE: ../../../flutter/lib/ui/painting/image_encoding.cc -FILE: ../../../flutter/lib/ui/painting/image_encoding.h -FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +FILE: ../../../flutter/assets/asset_manager.cc +FILE: ../../../flutter/assets/asset_manager.h +FILE: ../../../flutter/assets/asset_resolver.h +FILE: ../../../flutter/common/task_runners.cc +FILE: ../../../flutter/common/task_runners.h +FILE: ../../../flutter/flow/layers/default_layer_builder.cc +FILE: ../../../flutter/flow/layers/default_layer_builder.h +FILE: ../../../flutter/flow/layers/layer_builder.cc +FILE: ../../../flutter/flow/layers/layer_builder.h +FILE: ../../../flutter/flow/skia_gpu_object.cc +FILE: ../../../flutter/flow/skia_gpu_object.h +FILE: ../../../flutter/runtime/dart_isolate.cc +FILE: ../../../flutter/runtime/dart_isolate.h +FILE: ../../../flutter/runtime/dart_isolate_unittests.cc +FILE: ../../../flutter/runtime/dart_snapshot.cc +FILE: ../../../flutter/runtime/dart_snapshot.h +FILE: ../../../flutter/runtime/dart_snapshot_buffer.cc +FILE: ../../../flutter/runtime/dart_snapshot_buffer.h +FILE: ../../../flutter/runtime/dart_vm.cc +FILE: ../../../flutter/runtime/dart_vm.h +FILE: ../../../flutter/runtime/dart_vm_unittests.cc +FILE: ../../../flutter/runtime/service_protocol.cc +FILE: ../../../flutter/runtime/service_protocol.h +FILE: ../../../flutter/shell/common/io_manager.cc +FILE: ../../../flutter/shell/common/io_manager.h +FILE: ../../../flutter/shell/common/run_configuration.cc +FILE: ../../../flutter/shell/common/run_configuration.h +FILE: ../../../flutter/shell/common/shell_unittests.cc +FILE: ../../../flutter/shell/common/thread_host.cc +FILE: ../../../flutter/shell/common/thread_host.h +FILE: ../../../flutter/shell/platform/darwin/common/command_line.h +FILE: ../../../flutter/shell/platform/darwin/common/command_line.mm +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.h +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.mm +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h +FILE: ../../../flutter/shell/platform/embedder/embedder.h +FILE: ../../../flutter/shell/platform/embedder/embedder_engine.cc +FILE: ../../../flutter/shell/platform/embedder/embedder_engine.h ---------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. +Copyright 2017 The Flutter Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1683,23 +1703,10 @@ ORIGIN: ../../../flutter/assets/directory_asset_bundle.cc + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/assets/directory_asset_bundle.cc FILE: ../../../flutter/assets/directory_asset_bundle.h -FILE: ../../../flutter/assets/unzipper_provider.cc -FILE: ../../../flutter/assets/unzipper_provider.h FILE: ../../../flutter/assets/zip_asset_store.cc FILE: ../../../flutter/assets/zip_asset_store.h FILE: ../../../flutter/common/settings.cc FILE: ../../../flutter/common/settings.h -FILE: ../../../flutter/common/threads.cc -FILE: ../../../flutter/common/threads.h -FILE: ../../../flutter/content_handler/app.cc -FILE: ../../../flutter/content_handler/app.h -FILE: ../../../flutter/content_handler/application_controller_impl.cc -FILE: ../../../flutter/content_handler/application_controller_impl.h -FILE: ../../../flutter/content_handler/main.cc -FILE: ../../../flutter/content_handler/rasterizer.cc -FILE: ../../../flutter/content_handler/rasterizer.h -FILE: ../../../flutter/content_handler/runtime_holder.cc -FILE: ../../../flutter/content_handler/runtime_holder.h FILE: ../../../flutter/flow/export_node.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.h @@ -1707,7 +1714,6 @@ FILE: ../../../flutter/flow/layers/child_scene_layer.cc FILE: ../../../flutter/flow/layers/child_scene_layer.h FILE: ../../../flutter/flow/layers/shader_mask_layer.cc FILE: ../../../flutter/flow/layers/shader_mask_layer.h -FILE: ../../../flutter/flow/process_info.h FILE: ../../../flutter/flow/raster_cache.cc FILE: ../../../flutter/flow/raster_cache.h FILE: ../../../flutter/flow/scene_update_context.cc @@ -1718,9 +1724,6 @@ FILE: ../../../flutter/glue/stack_trace_fuchsia.cc FILE: ../../../flutter/glue/trace_event.h FILE: ../../../flutter/lib/ui/painting/image_filter.cc FILE: ../../../flutter/lib/ui/painting/image_filter.h -FILE: ../../../flutter/lib/ui/painting/resource_context.cc -FILE: ../../../flutter/lib/ui/painting/resource_context.h -FILE: ../../../flutter/lib/ui/painting/utils.h FILE: ../../../flutter/lib/ui/semantics.dart FILE: ../../../flutter/lib/ui/semantics/semantics_node.cc FILE: ../../../flutter/lib/ui/semantics/semantics_node.h @@ -1742,18 +1745,13 @@ FILE: ../../../flutter/runtime/asset_font_selector.cc FILE: ../../../flutter/runtime/asset_font_selector.h FILE: ../../../flutter/runtime/embedder_resources.cc FILE: ../../../flutter/runtime/embedder_resources.h -FILE: ../../../flutter/runtime/runtime_init.cc -FILE: ../../../flutter/runtime/runtime_init.h +FILE: ../../../flutter/runtime/fixtures/simple_main.dart FILE: ../../../flutter/runtime/start_up.cc FILE: ../../../flutter/runtime/start_up.h FILE: ../../../flutter/runtime/test_font_data.cc FILE: ../../../flutter/runtime/test_font_data.h FILE: ../../../flutter/runtime/test_font_selector.cc FILE: ../../../flutter/runtime/test_font_selector.h -FILE: ../../../flutter/shell/common/null_rasterizer.cc -FILE: ../../../flutter/shell/common/null_rasterizer.h -FILE: ../../../flutter/shell/common/platform_view_service_protocol.cc -FILE: ../../../flutter/shell/common/platform_view_service_protocol.h FILE: ../../../flutter/shell/common/skia_event_tracer_impl.h FILE: ../../../flutter/shell/common/surface.cc FILE: ../../../flutter/shell/common/surface.h @@ -1782,8 +1780,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/view/VsyncWaiter.java FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.cc FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.mm -FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.cc -FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.h FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h @@ -1792,8 +1788,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterMacros FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h @@ -1816,7 +1810,6 @@ FILE: ../../../flutter/sky/engine/platform/text/ICUError.cpp FILE: ../../../flutter/sky/engine/platform/text/ICUError.h FILE: ../../../flutter/sky/engine/platform/text/TextBox.h FILE: ../../../flutter/sky/packages/flutter_services/lib/empty.dart -FILE: ../../../flutter/synchronization/debug_thread_checker.h FILE: ../../../flutter/synchronization/pipeline.cc FILE: ../../../flutter/synchronization/pipeline.h FILE: ../../../flutter/synchronization/semaphore.cc @@ -1884,15 +1877,68 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/flow/layers/default_layer_builder.cc + ../../../LICENSE +ORIGIN: ../../../flutter/content_handler/application.cc + ../../../garnet/LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/flow/layers/default_layer_builder.cc -FILE: ../../../flutter/flow/layers/default_layer_builder.h -FILE: ../../../flutter/flow/layers/layer_builder.cc -FILE: ../../../flutter/flow/layers/layer_builder.h -FILE: ../../../flutter/shell/platform/embedder/embedder.h +FILE: ../../../flutter/content_handler/application.cc +FILE: ../../../flutter/content_handler/application.h +FILE: ../../../flutter/content_handler/application_runner.cc +FILE: ../../../flutter/content_handler/application_runner.h +FILE: ../../../flutter/content_handler/compositor_context.cc +FILE: ../../../flutter/content_handler/compositor_context.h +FILE: ../../../flutter/content_handler/engine.cc +FILE: ../../../flutter/content_handler/engine.h +FILE: ../../../flutter/content_handler/isolate_configurator.cc +FILE: ../../../flutter/content_handler/isolate_configurator.h +FILE: ../../../flutter/content_handler/main.cc +FILE: ../../../flutter/content_handler/platform_view.cc +FILE: ../../../flutter/content_handler/platform_view.h +FILE: ../../../flutter/content_handler/surface.cc +FILE: ../../../flutter/content_handler/surface.h +FILE: ../../../flutter/content_handler/task_observers.cc +FILE: ../../../flutter/content_handler/task_observers.h +FILE: ../../../flutter/content_handler/unique_fdio_ns.h ---------------------------------------------------------------------------------------------------- -Copyright 2017 The Flutter Authors. All rights reserved. +Copyright 2018 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: engine +ORIGIN: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart +FILE: ../../../flutter/lib/ui/painting/image_encoding.cc +FILE: ../../../flutter/lib/ui/painting/image_encoding.h +FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1957,6 +2003,62 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: engine +ORIGIN: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../flutter/fml/file.h +FILE: ../../../flutter/fml/macros.h +FILE: ../../../flutter/fml/mapping.cc +FILE: ../../../flutter/fml/native_library.h +FILE: ../../../flutter/fml/paths.cc +FILE: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc +FILE: ../../../flutter/fml/platform/posix/file_posix.cc +FILE: ../../../flutter/fml/platform/posix/native_library_posix.cc +FILE: ../../../flutter/fml/platform/win/file_win.cc +FILE: ../../../flutter/fml/platform/win/native_library_win.cc +FILE: ../../../flutter/fml/platform/win/wstring_conversion.h +FILE: ../../../flutter/fml/unique_fd.cc +FILE: ../../../flutter/fml/unique_fd.h +FILE: ../../../flutter/fml/unique_object.h +FILE: ../../../flutter/shell/common/isolate_configuration.cc +FILE: ../../../flutter/shell/common/isolate_configuration.h +FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc +FILE: ../../../flutter/shell/platform/android/android_shell_holder.h +FILE: ../../../flutter/shell/platform/android/platform_message_response_android.cc +FILE: ../../../flutter/shell/platform/android/platform_message_response_android.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: engine ORIGIN: ../../../flutter/lib/ui/painting/image.cc + ../../../LICENSE @@ -9873,10 +9975,6 @@ FILE: ../../../flutter/lib/ui/window.dart FILE: ../../../flutter/lib/ui/window/pointer_data.cc FILE: ../../../flutter/lib/ui/window/pointer_data_packet.cc FILE: ../../../flutter/lib/ui/window/window.cc -FILE: ../../../flutter/runtime/dart_controller.cc -FILE: ../../../flutter/runtime/dart_controller.h -FILE: ../../../flutter/runtime/dart_init.cc -FILE: ../../../flutter/runtime/dart_init.h FILE: ../../../flutter/runtime/dart_service_isolate.cc FILE: ../../../flutter/runtime/dart_service_isolate.h FILE: ../../../flutter/runtime/platform_impl.cc @@ -9896,13 +9994,9 @@ FILE: ../../../flutter/shell/common/rasterizer.cc FILE: ../../../flutter/shell/common/rasterizer.h FILE: ../../../flutter/shell/common/shell.cc FILE: ../../../flutter/shell/common/shell.h -FILE: ../../../flutter/shell/common/tracing_controller.cc -FILE: ../../../flutter/shell/common/tracing_controller.h FILE: ../../../flutter/shell/common/vsync_waiter.cc FILE: ../../../flutter/shell/common/vsync_waiter.h FILE: ../../../flutter/shell/common/vsync_waiter_fallback.h -FILE: ../../../flutter/shell/gpu/gpu_rasterizer.cc -FILE: ../../../flutter/shell/gpu/gpu_rasterizer.h FILE: ../../../flutter/shell/platform/android/AndroidManifest.xml FILE: ../../../flutter/shell/platform/android/flutter_main.cc FILE: ../../../flutter/shell/platform/android/flutter_main.h @@ -9915,12 +10009,6 @@ FILE: ../../../flutter/shell/platform/android/library_loader.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h -FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.h -FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.mm -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.m -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.mm FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.h FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.mm FILE: ../../../flutter/shell/platform/darwin/desktop/main_mac.mm @@ -9930,8 +10018,6 @@ FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.cc FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm -FILE: ../../../flutter/shell/platform/linux/main_linux.cc -FILE: ../../../flutter/shell/platform/win/main_win.cc FILE: ../../../flutter/sky/engine/wtf/Allocator.h FILE: ../../../flutter/sky/engine/wtf/MakeUnique.h ---------------------------------------------------------------------------------------------------- @@ -9968,6 +10054,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: engine ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd +FILE: ../../../flutter/fml/memory/thread_checker.h FILE: ../../../flutter/fml/memory/weak_ptr.h FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc FILE: ../../../flutter/fml/memory/weak_ptr_internal.h @@ -10001,4 +10088,4 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -Total license count: 216 +Total license count: 218 From 9199b40f2a2a6e448cd251de44e020ec3b75002d Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 10 Apr 2018 15:28:43 -0700 Subject: [PATCH 0079/1190] Revert "Support multiple shells in a single process. (#4932)" (#4964) This reverts commit 6baff4c821350bbcb64e7d029574b567f3801a1a. --- BUILD.gn | 74 +- DEPS | 2 +- assets/BUILD.gn | 12 +- assets/asset_manager.cc | 55 - assets/asset_manager.h | 47 - assets/asset_provider.h | 25 + assets/asset_resolver.h | 32 - assets/directory_asset_bundle.cc | 85 +- assets/directory_asset_bundle.h | 32 +- assets/unzipper_provider.cc | 21 + assets/unzipper_provider.h | 20 + assets/zip_asset_store.cc | 24 +- assets/zip_asset_store.h | 24 +- common/BUILD.gn | 5 +- common/settings.cc | 58 +- common/settings.h | 74 +- common/task_runners.cc | 48 - common/task_runners.h | 46 - common/threads.cc | 56 + common/threads.h | 48 + content_handler/BUILD.gn | 59 +- content_handler/README.md | 4 - content_handler/accessibility_bridge.cc | 15 +- content_handler/accessibility_bridge.h | 25 +- content_handler/app.cc | 174 +++ content_handler/app.h | 64 + content_handler/application.cc | 313 ----- content_handler/application.h | 97 -- .../application_controller_impl.cc | 148 +++ content_handler/application_controller_impl.h | 76 ++ content_handler/application_runner.cc | 90 -- content_handler/application_runner.h | 79 -- content_handler/compositor_context.cc | 86 -- content_handler/compositor_context.h | 39 - content_handler/engine.cc | 258 ----- content_handler/engine.h | 63 - content_handler/fuchsia_font_manager.cc | 47 +- content_handler/fuchsia_font_manager.h | 2 +- content_handler/isolate_configurator.cc | 114 -- content_handler/isolate_configurator.h | 55 - content_handler/main.cc | 20 +- content_handler/platform_view.cc | 551 --------- content_handler/platform_view.h | 120 -- content_handler/rasterizer.cc | 19 + content_handler/rasterizer.h | 35 + content_handler/runtime_holder.cc | 911 +++++++++++++++ content_handler/runtime_holder.h | 152 +++ content_handler/service_protocol_hooks.cc | 164 +++ content_handler/service_protocol_hooks.h | 37 + content_handler/session_connection.cc | 108 +- content_handler/session_connection.h | 52 +- content_handler/surface.cc | 73 -- content_handler/surface.h | 47 - content_handler/task_observers.cc | 43 - content_handler/task_observers.h | 16 - content_handler/unique_fdio_ns.h | 34 - content_handler/vulkan_rasterizer.cc | 117 ++ content_handler/vulkan_rasterizer.h | 42 + content_handler/vulkan_surface.cc | 24 +- content_handler/vulkan_surface.h | 11 +- content_handler/vulkan_surface_pool.cc | 7 +- content_handler/vulkan_surface_pool.h | 9 +- content_handler/vulkan_surface_producer.cc | 9 +- content_handler/vulkan_surface_producer.h | 18 +- flow/BUILD.gn | 10 +- flow/compositor_context.cc | 26 +- flow/compositor_context.h | 44 +- flow/debug_print.cc | 5 - flow/debug_print.h | 9 +- flow/export_node.cc | 15 +- flow/export_node.h | 5 +- flow/layers/default_layer_builder.cc | 6 +- flow/layers/default_layer_builder.h | 2 +- flow/layers/layer.h | 4 + flow/layers/layer_builder.h | 3 +- flow/layers/layer_tree.cc | 55 +- flow/layers/layer_tree.h | 21 + flow/layers/performance_overlay_layer.cc | 33 + flow/layers/performance_overlay_layer.h | 2 + flow/layers/picture_layer.cc | 23 +- flow/layers/picture_layer.h | 13 +- flow/process_info.h | 31 + flow/raster_cache.cc | 33 +- flow/raster_cache.h | 6 + flow/raster_cache_key.h | 30 +- flow/scene_update_context.cc | 17 +- flow/skia_gpu_object.cc | 44 - flow/skia_gpu_object.h | 88 -- flow/texture.cc | 6 +- flow/texture.h | 5 +- fml/BUILD.gn | 18 +- fml/file.h | 35 - fml/icu_util.cc | 17 +- fml/macros.h | 20 - fml/mapping.cc | 20 - fml/mapping.h | 37 +- fml/memory/thread_checker.h | 69 -- fml/memory/weak_ptr.h | 43 +- fml/message_loop.cc | 10 +- fml/message_loop.h | 9 +- fml/message_loop_impl.cc | 43 +- fml/message_loop_impl.h | 8 +- fml/message_loop_unittests.cc | 24 +- fml/native_library.h | 52 - fml/paths.cc | 31 - fml/paths.h | 4 - fml/platform/android/message_loop_android.h | 6 +- .../darwin/resource_mapping_darwin.mm | 4 +- fml/platform/fuchsia/paths_fuchsia.cc | 15 - fml/platform/linux/message_loop_linux.h | 6 +- fml/platform/posix/file_posix.cc | 71 -- fml/platform/posix/mapping_posix.cc | 18 +- fml/platform/posix/native_library_posix.cc | 60 - fml/platform/win/file_win.cc | 119 -- fml/platform/win/mapping_win.cc | 59 +- fml/platform/win/native_library_win.cc | 51 - fml/platform/win/wstring_conversion.h | 25 - fml/task_observer.h | 21 + fml/task_runner.cc | 12 - fml/task_runner.h | 7 +- fml/thread.cc | 9 +- fml/thread.h | 6 +- fml/unique_fd.cc | 35 - fml/unique_fd.h | 60 - fml/unique_object.h | 137 --- lib/snapshot/BUILD.gn | 54 +- lib/ui/BUILD.gn | 11 +- lib/ui/compositing/scene_builder.cc | 9 +- lib/ui/compositing/scene_host.cc | 6 +- lib/ui/dart_runtime_hooks.cc | 62 +- lib/ui/painting/codec.cc | 114 +- lib/ui/painting/codec.h | 7 +- lib/ui/painting/gradient.cc | 12 +- lib/ui/painting/image.cc | 14 +- lib/ui/painting/image.h | 17 +- lib/ui/painting/image_encoding.cc | 23 +- lib/ui/painting/image_shader.cc | 11 +- lib/ui/painting/picture.cc | 25 +- lib/ui/painting/picture.h | 9 +- lib/ui/painting/picture_recorder.cc | 5 +- lib/ui/painting/resource_context.cc | 51 + lib/ui/painting/resource_context.h | 60 + lib/ui/painting/shader.cc | 12 +- lib/ui/painting/shader.h | 13 +- lib/ui/painting/utils.cc | 46 + lib/ui/painting/utils.h | 38 + lib/ui/text/font_collection.cc | 14 +- lib/ui/text/font_collection.h | 7 +- lib/ui/text/paragraph.cc | 5 +- lib/ui/text/paragraph.h | 5 - lib/ui/text/paragraph_builder.cc | 27 +- lib/ui/text/paragraph_builder.h | 11 +- lib/ui/text/paragraph_impl_blink.cc | 4 +- lib/ui/text/paragraph_impl_blink.h | 5 - lib/ui/text/paragraph_impl_txt.cc | 2 +- lib/ui/ui_dart_state.cc | 93 +- lib/ui/ui_dart_state.h | 101 +- .../window/platform_message_response_dart.cc | 14 +- .../window/platform_message_response_dart.h | 6 +- lib/ui/window/viewport_metrics.h | 19 - lib/ui/window/window.cc | 5 +- lib/ui/window/window.h | 5 +- runtime/BUILD.gn | 60 +- runtime/asset_font_selector.cc | 38 +- runtime/asset_font_selector.h | 17 +- runtime/dart_controller.cc | 250 ++++ runtime/dart_controller.h | 55 + runtime/dart_init.cc | 725 ++++++++++++ runtime/dart_init.h | 64 + runtime/dart_isolate.cc | 715 ------------ runtime/dart_isolate.h | 152 --- runtime/dart_isolate_unittests.cc | 103 -- runtime/dart_service_isolate.h | 2 + runtime/dart_snapshot.cc | 159 --- runtime/dart_snapshot.h | 57 - runtime/dart_snapshot_buffer.cc | 72 -- runtime/dart_snapshot_buffer.h | 34 - runtime/dart_vm.cc | 472 -------- runtime/dart_vm.h | 75 -- runtime/dart_vm_unittests.cc | 21 - runtime/fixtures/simple_main.dart | 7 - runtime/runtime_controller.cc | 274 ++--- runtime/runtime_controller.h | 99 +- runtime/runtime_delegate.cc | 8 +- runtime/runtime_delegate.h | 8 +- runtime/runtime_init.cc | 35 + runtime/runtime_init.h | 21 + runtime/service_protocol.cc | 279 ----- runtime/service_protocol.h | 99 -- shell/common/BUILD.gn | 43 +- shell/common/animator.cc | 75 +- shell/common/animator.h | 37 +- shell/common/engine.cc | 583 +++++++--- shell/common/engine.h | 153 ++- shell/common/io_manager.cc | 73 -- shell/common/io_manager.h | 52 - shell/common/isolate_configuration.cc | 144 --- shell/common/isolate_configuration.h | 51 - shell/common/null_platform_view.cc | 37 + shell/common/null_platform_view.h | 39 + shell/common/null_rasterizer.cc | 67 ++ shell/common/null_rasterizer.h | 51 + shell/common/platform_view.cc | 182 ++- shell/common/platform_view.h | 119 +- .../common/platform_view_service_protocol.cc | 447 +++++++ shell/common/platform_view_service_protocol.h | 85 ++ shell/common/rasterizer.cc | 197 ---- shell/common/rasterizer.h | 65 +- shell/common/run_configuration.cc | 80 -- shell/common/run_configuration.h | 56 - shell/common/shell.cc | 1025 +++++------------ shell/common/shell.h | 254 ++-- shell/common/shell_unittests.cc | 133 --- shell/common/surface.cc | 28 +- shell/common/surface.h | 14 +- shell/common/switches.cc | 122 -- shell/common/switches.h | 37 +- shell/common/thread_host.cc | 38 - shell/common/thread_host.h | 43 - shell/common/tracing_controller.cc | 51 + shell/common/tracing_controller.h | 34 + shell/common/vsync_waiter.cc | 37 - shell/common/vsync_waiter.h | 21 +- shell/common/vsync_waiter_fallback.cc | 24 +- shell/common/vsync_waiter_fallback.h | 13 +- shell/gpu/BUILD.gn | 11 +- shell/gpu/gpu_rasterizer.cc | 168 +++ shell/gpu/gpu_rasterizer.h | 68 ++ shell/gpu/gpu_surface_gl.cc | 13 +- shell/gpu/gpu_surface_gl.h | 5 +- shell/gpu/gpu_surface_software.cc | 17 +- shell/gpu/gpu_surface_software.h | 7 +- shell/gpu/gpu_surface_vulkan.h | 5 +- shell/platform/BUILD.gn | 6 +- shell/platform/android/BUILD.gn | 16 +- shell/platform/android/android_context_gl.cc | 24 +- shell/platform/android/android_context_gl.h | 1 + .../android/android_external_texture_gl.cc | 9 +- .../android/android_external_texture_gl.h | 3 +- .../platform/android/android_shell_holder.cc | 169 --- shell/platform/android/android_shell_holder.h | 59 - shell/platform/android/android_surface.cc | 24 - shell/platform/android/android_surface.h | 7 +- shell/platform/android/android_surface_gl.cc | 37 +- shell/platform/android/android_surface_gl.h | 24 +- .../android/android_surface_software.cc | 14 +- .../android/android_surface_software.h | 26 +- .../android/android_surface_vulkan.cc | 15 +- .../platform/android/android_surface_vulkan.h | 13 +- shell/platform/android/apk_asset_provider.cc | 29 +- shell/platform/android/apk_asset_provider.h | 27 +- shell/platform/android/flutter_main.cc | 75 +- shell/platform/android/flutter_main.h | 27 +- shell/platform/android/library_loader.cc | 2 +- .../platform_message_response_android.cc | 62 - .../platform_message_response_android.h | 39 - .../platform/android/platform_view_android.cc | 589 ++++++++-- .../platform/android/platform_view_android.h | 98 +- .../android/platform_view_android_jni.cc | 416 ++----- .../platform/android/vsync_waiter_android.cc | 100 +- shell/platform/android/vsync_waiter_android.h | 15 +- shell/platform/darwin/BUILD.gn | 12 +- shell/platform/darwin/common/BUILD.gn | 13 +- shell/platform/darwin/common/command_line.h | 17 - shell/platform/darwin/common/command_line.mm | 21 - shell/platform/darwin/common/platform_mac.h | 20 + shell/platform/darwin/common/platform_mac.mm | 160 +++ .../darwin/common/process_info_mac.cc | 36 + .../platform/darwin/common/process_info_mac.h | 36 + shell/platform/darwin/desktop/BUILD.gn | 22 +- shell/platform/darwin/desktop/Info.plist | 8 +- .../darwin/desktop/flutter_app_delegate.h | 14 + .../darwin/desktop/flutter_app_delegate.m | 15 + ...ation_delegate.h => flutter_application.h} | 11 +- .../darwin/desktop/flutter_application.mm | 8 + .../desktop/flutter_application_delegate.mm | 80 -- shell/platform/darwin/desktop/flutter_mac.xib | 695 +++++++++++ .../platform/darwin/desktop/flutter_window.h | 6 +- .../platform/darwin/desktop/flutter_window.mm | 201 +--- shell/platform/darwin/desktop/main_mac.mm | 112 +- .../darwin/desktop/platform_view_mac.h | 27 +- .../darwin/desktop/platform_view_mac.mm | 107 +- .../darwin/desktop/vsync_waiter_mac.cc | 16 +- .../darwin/desktop/vsync_waiter_mac.h | 10 +- shell/platform/darwin/ios/BUILD.gn | 13 +- .../framework/Source/FlutterDartProject.mm | 397 ++++--- .../Source/FlutterDartProject_Internal.h | 23 +- .../ios/framework/Source/FlutterDartSource.h | 30 + .../ios/framework/Source/FlutterDartSource.mm | 100 ++ .../Source/FlutterHeadlessDartRunner.mm | 88 +- .../darwin/ios/framework/Source/FlutterView.h | 6 - .../ios/framework/Source/FlutterView.mm | 103 +- .../framework/Source/FlutterViewController.mm | 337 +++--- .../Source/FlutterViewController_Internal.h | 17 - .../framework/Source/accessibility_bridge.mm | 4 +- .../ios/framework/Source/flutter_main_ios.h | 18 + .../ios/framework/Source/flutter_main_ios.mm | 25 + .../Source/platform_message_response_darwin.h | 50 - .../platform_message_response_darwin.mm | 11 - .../Source/platform_message_router.h | 5 +- .../Source/platform_message_router.mm | 15 +- .../ios/framework/Source/vsync_waiter_ios.h | 19 +- .../ios/framework/Source/vsync_waiter_ios.mm | 115 +- .../darwin/ios/ios_external_texture_gl.h | 2 - .../darwin/ios/ios_external_texture_gl.mm | 19 +- shell/platform/darwin/ios/ios_gl_context.h | 2 +- shell/platform/darwin/ios/ios_gl_context.mm | 60 +- shell/platform/darwin/ios/ios_surface.h | 19 +- shell/platform/darwin/ios/ios_surface.mm | 31 +- shell/platform/darwin/ios/ios_surface_gl.h | 3 +- shell/platform/darwin/ios/ios_surface_gl.mm | 5 +- .../darwin/ios/ios_surface_software.h | 11 +- .../darwin/ios/ios_surface_software.mm | 9 +- shell/platform/darwin/ios/platform_view_ios.h | 93 +- .../platform/darwin/ios/platform_view_ios.mm | 143 ++- shell/platform/embedder/BUILD.gn | 8 +- shell/platform/embedder/embedder.cc | 245 ++-- shell/platform/embedder/embedder_engine.cc | 119 -- shell/platform/embedder/embedder_engine.h | 53 - .../embedder/platform_view_embedder.cc | 53 +- .../embedder/platform_view_embedder.h | 29 +- shell/platform/linux/BUILD.gn | 23 + shell/platform/linux/main_linux.cc | 142 +++ shell/platform/win/BUILD.gn | 30 + shell/platform/win/main_win.cc | 142 +++ shell/testing/BUILD.gn | 26 +- shell/testing/platform_view_test.cc | 32 + shell/testing/platform_view_test.h | 38 + shell/testing/test_runner.cc | 48 + shell/testing/test_runner.h | 42 + shell/testing/tester_main.cc | 243 ---- shell/testing/testing.cc | 24 + shell/testing/testing.h | 16 + sky/engine/platform/SharedBuffer.cpp | 1 + .../platform/fonts/FontFallbackList.cpp | 10 +- sky/engine/platform/fonts/FontFallbackList.h | 3 - sky/engine/web/Sky.cpp | 56 + synchronization/BUILD.gn | 5 +- synchronization/debug_thread_checker.h | 25 + synchronization/semaphore.cc | 6 +- testing/BUILD.gn | 4 - testing/thread_test.cc | 33 - testing/thread_test.h | 37 - tools/gn | 4 - travis/licenses_golden/licenses_flutter | 233 ++-- 345 files changed, 11072 insertions(+), 12543 deletions(-) delete mode 100644 assets/asset_manager.cc delete mode 100644 assets/asset_manager.h create mode 100644 assets/asset_provider.h delete mode 100644 assets/asset_resolver.h create mode 100644 assets/unzipper_provider.cc create mode 100644 assets/unzipper_provider.h delete mode 100644 common/task_runners.cc delete mode 100644 common/task_runners.h create mode 100644 common/threads.cc create mode 100644 common/threads.h delete mode 100644 content_handler/README.md create mode 100644 content_handler/app.cc create mode 100644 content_handler/app.h delete mode 100644 content_handler/application.cc delete mode 100644 content_handler/application.h create mode 100644 content_handler/application_controller_impl.cc create mode 100644 content_handler/application_controller_impl.h delete mode 100644 content_handler/application_runner.cc delete mode 100644 content_handler/application_runner.h delete mode 100644 content_handler/compositor_context.cc delete mode 100644 content_handler/compositor_context.h delete mode 100644 content_handler/engine.cc delete mode 100644 content_handler/engine.h delete mode 100644 content_handler/isolate_configurator.cc delete mode 100644 content_handler/isolate_configurator.h delete mode 100644 content_handler/platform_view.cc delete mode 100644 content_handler/platform_view.h create mode 100644 content_handler/rasterizer.cc create mode 100644 content_handler/rasterizer.h create mode 100644 content_handler/runtime_holder.cc create mode 100644 content_handler/runtime_holder.h create mode 100644 content_handler/service_protocol_hooks.cc create mode 100644 content_handler/service_protocol_hooks.h delete mode 100644 content_handler/surface.cc delete mode 100644 content_handler/surface.h delete mode 100644 content_handler/task_observers.cc delete mode 100644 content_handler/task_observers.h delete mode 100644 content_handler/unique_fdio_ns.h create mode 100644 content_handler/vulkan_rasterizer.cc create mode 100644 content_handler/vulkan_rasterizer.h create mode 100644 flow/process_info.h delete mode 100644 flow/skia_gpu_object.cc delete mode 100644 flow/skia_gpu_object.h delete mode 100644 fml/file.h delete mode 100644 fml/macros.h delete mode 100644 fml/mapping.cc delete mode 100644 fml/memory/thread_checker.h delete mode 100644 fml/native_library.h delete mode 100644 fml/paths.cc delete mode 100644 fml/platform/fuchsia/paths_fuchsia.cc delete mode 100644 fml/platform/posix/file_posix.cc delete mode 100644 fml/platform/posix/native_library_posix.cc delete mode 100644 fml/platform/win/file_win.cc delete mode 100644 fml/platform/win/native_library_win.cc delete mode 100644 fml/platform/win/wstring_conversion.h create mode 100644 fml/task_observer.h delete mode 100644 fml/unique_fd.cc delete mode 100644 fml/unique_fd.h delete mode 100644 fml/unique_object.h create mode 100644 lib/ui/painting/resource_context.cc create mode 100644 lib/ui/painting/resource_context.h create mode 100644 lib/ui/painting/utils.cc create mode 100644 lib/ui/painting/utils.h create mode 100644 runtime/dart_controller.cc create mode 100644 runtime/dart_controller.h create mode 100644 runtime/dart_init.cc create mode 100644 runtime/dart_init.h delete mode 100644 runtime/dart_isolate.cc delete mode 100644 runtime/dart_isolate.h delete mode 100644 runtime/dart_isolate_unittests.cc delete mode 100644 runtime/dart_snapshot.cc delete mode 100644 runtime/dart_snapshot.h delete mode 100644 runtime/dart_snapshot_buffer.cc delete mode 100644 runtime/dart_snapshot_buffer.h delete mode 100644 runtime/dart_vm.cc delete mode 100644 runtime/dart_vm.h delete mode 100644 runtime/dart_vm_unittests.cc delete mode 100644 runtime/fixtures/simple_main.dart create mode 100644 runtime/runtime_init.cc create mode 100644 runtime/runtime_init.h delete mode 100644 runtime/service_protocol.cc delete mode 100644 runtime/service_protocol.h delete mode 100644 shell/common/io_manager.cc delete mode 100644 shell/common/io_manager.h delete mode 100644 shell/common/isolate_configuration.cc delete mode 100644 shell/common/isolate_configuration.h create mode 100644 shell/common/null_platform_view.cc create mode 100644 shell/common/null_platform_view.h create mode 100644 shell/common/null_rasterizer.cc create mode 100644 shell/common/null_rasterizer.h create mode 100644 shell/common/platform_view_service_protocol.cc create mode 100644 shell/common/platform_view_service_protocol.h delete mode 100644 shell/common/run_configuration.cc delete mode 100644 shell/common/run_configuration.h delete mode 100644 shell/common/shell_unittests.cc delete mode 100644 shell/common/thread_host.cc delete mode 100644 shell/common/thread_host.h create mode 100644 shell/common/tracing_controller.cc create mode 100644 shell/common/tracing_controller.h create mode 100644 shell/gpu/gpu_rasterizer.cc create mode 100644 shell/gpu/gpu_rasterizer.h delete mode 100644 shell/platform/android/android_shell_holder.cc delete mode 100644 shell/platform/android/android_shell_holder.h delete mode 100644 shell/platform/android/platform_message_response_android.cc delete mode 100644 shell/platform/android/platform_message_response_android.h delete mode 100644 shell/platform/darwin/common/command_line.h delete mode 100644 shell/platform/darwin/common/command_line.mm create mode 100644 shell/platform/darwin/common/platform_mac.h create mode 100644 shell/platform/darwin/common/platform_mac.mm create mode 100644 shell/platform/darwin/common/process_info_mac.cc create mode 100644 shell/platform/darwin/common/process_info_mac.h create mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.h create mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.m rename shell/platform/darwin/desktop/{flutter_application_delegate.h => flutter_application.h} (65%) create mode 100644 shell/platform/darwin/desktop/flutter_application.mm delete mode 100644 shell/platform/darwin/desktop/flutter_application_delegate.mm create mode 100644 shell/platform/darwin/desktop/flutter_mac.xib create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.h create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm delete mode 100644 shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h create mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.h create mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm delete mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h delete mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm delete mode 100644 shell/platform/embedder/embedder_engine.cc delete mode 100644 shell/platform/embedder/embedder_engine.h create mode 100644 shell/platform/linux/BUILD.gn create mode 100644 shell/platform/linux/main_linux.cc create mode 100644 shell/platform/win/BUILD.gn create mode 100644 shell/platform/win/main_win.cc create mode 100644 shell/testing/platform_view_test.cc create mode 100644 shell/testing/platform_view_test.h create mode 100644 shell/testing/test_runner.cc create mode 100644 shell/testing/test_runner.h delete mode 100644 shell/testing/tester_main.cc create mode 100644 shell/testing/testing.cc create mode 100644 shell/testing/testing.h create mode 100644 synchronization/debug_thread_checker.h delete mode 100644 testing/thread_test.cc delete mode 100644 testing/thread_test.h diff --git a/BUILD.gn b/BUILD.gn index b37b0b8d4054c..24dda026c6245 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,12 +10,14 @@ group("flutter") { public_deps = [ "$flutter_root/lib/snapshot:generate_snapshot_bin", "$flutter_root/lib/snapshot:kernel_platform_files", - "$flutter_root/shell/testing", "$flutter_root/sky", + "$flutter_root/third_party/txt", ] if (flutter_runtime_mode != "debug") { - public_deps += [ "$flutter_root/lib/snapshot:entry_points_json_files" ] + public_deps += [ + "$flutter_root/lib/snapshot:entry_points_json_files", + ] } if (!is_fuchsia && !is_fuchsia_host) { @@ -43,24 +45,20 @@ group("flutter") { "$flutter_root/shell/platform/embedder:flutter_embedder_framework", ] } - + if (!is_win) { + public_deps += [ + "$flutter_root/shell/platform/embedder:embedder_unittests", + "$flutter_root/shell/platform/embedder:flutter_engine", + ] + } public_deps += [ "$flutter_root/flow:flow_unittests", "$flutter_root/fml:fml_unittests", - "$flutter_root/runtime:runtime_unittests", - "$flutter_root/shell/common:shell_unittests", "$flutter_root/sky/engine/wtf:wtf_unittests", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", "//garnet/public/lib/fxl:fxl_unittests", ] - - if (!is_win) { - public_deps += [ - "$flutter_root/shell/platform/embedder:embedder_unittests", - "$flutter_root/shell/platform/embedder:flutter_engine", - ] - } } } @@ -76,23 +74,29 @@ if (is_fuchsia) { "$flutter_root/content_handler:aot", ] if (flutter_runtime_mode != "release") { - deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] + deps += [ + "//third_party/dart/runtime/observatory:embedded_archive_observatory", + ] } binary = "flutter_aot_runner" if (flutter_runtime_mode != "release") { - resources = [ { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - } ] + resources = [ + { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + }, + ] } - meta = [ { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - } ] + meta = [ + { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + }, + ] } package("flutter_jit_runner") { @@ -100,23 +104,29 @@ if (is_fuchsia) { "$flutter_root/content_handler:jit", ] if (flutter_runtime_mode != "release") { - deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] + deps += [ + "//third_party/dart/runtime/observatory:embedded_archive_observatory", + ] } binary = "flutter_jit_runner" if (flutter_runtime_mode != "release") { - resources = [ { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - } ] + resources = [ + { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + }, + ] } - meta = [ { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - } ] + meta = [ + { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + }, + ] } } else { group("dist") { diff --git a/DEPS b/DEPS index 0f47bd8ceeecb..30a88e2b6a355 100644 --- a/DEPS +++ b/DEPS @@ -115,7 +115,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '3cf97e01cdbd4bb920fa3d40282a56c4b2d62a58', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '8dddd90bf943a8174913564353b30a3b11ee0f7a', # Fuchsia compatibility # diff --git a/assets/BUILD.gn b/assets/BUILD.gn index 28d7e569659f1..c4901375ad810 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -4,18 +4,16 @@ source_set("assets") { sources = [ - "asset_manager.cc", - "asset_manager.h", - "asset_resolver.h", + "asset_provider.h", "directory_asset_bundle.cc", "directory_asset_bundle.h", + "unzipper_provider.cc", + "unzipper_provider.h", "zip_asset_store.cc", "zip_asset_store.h", ] deps = [ - "$flutter_root/common", - "$flutter_root/fml", "$flutter_root/glue", "//garnet/public/lib/fxl", "//garnet/public/lib/zip", @@ -25,5 +23,7 @@ source_set("assets") { "//third_party/zlib:minizip", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] } diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc deleted file mode 100644 index 8a313f0729c96..0000000000000 --- a/assets/asset_manager.cc +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2017 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/assets/asset_manager.h" - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/glue/trace_event.h" -#include "lib/fxl/files/path.h" - -namespace blink { - -AssetManager::AssetManager() = default; - -AssetManager::~AssetManager() = default; - -void AssetManager::PushFront(std::unique_ptr resolver) { - if (resolver == nullptr || !resolver->IsValid()) { - return; - } - - resolvers_.push_front(std::move(resolver)); -} - -void AssetManager::PushBack(std::unique_ptr resolver) { - if (resolver == nullptr || !resolver->IsValid()) { - return; - } - - resolvers_.push_back(std::move(resolver)); -} - -// |blink::AssetResolver| -bool AssetManager::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { - if (asset_name.size() == 0) { - return false; - } - TRACE_EVENT0("flutter", "AssetManager::GetAsBuffer"); - for (const auto& resolver : resolvers_) { - if (resolver->GetAsBuffer(asset_name, data)) { - return true; - } - } - FXL_DLOG(ERROR) << "Could not find asset: " << asset_name; - return false; -} - -// |blink::AssetResolver| -bool AssetManager::IsValid() const { - return resolvers_.size() > 0; -} - -} // namespace blink diff --git a/assets/asset_manager.h b/assets/asset_manager.h deleted file mode 100644 index fc7f3ef05210e..0000000000000 --- a/assets/asset_manager.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2017 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_ASSETS_ASSET_MANAGER_H_ -#define FLUTTER_ASSETS_ASSET_MANAGER_H_ - -#include -#include -#include - -#include "flutter/assets/asset_resolver.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" - -namespace blink { - -class AssetManager final : public AssetResolver, - public fxl::RefCountedThreadSafe { - public: - void PushFront(std::unique_ptr resolver); - - void PushBack(std::unique_ptr resolver); - - // |blink::AssetResolver| - bool IsValid() const override; - - // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; - - private: - std::deque> resolvers_; - - AssetManager(); - - ~AssetManager(); - - FXL_DISALLOW_COPY_AND_ASSIGN(AssetManager); - FRIEND_MAKE_REF_COUNTED(AssetManager); - FRIEND_REF_COUNTED_THREAD_SAFE(AssetManager); -}; - -} // namespace blink - -#endif // FLUTTER_ASSETS_ASSET_MANAGER_H_ diff --git a/assets/asset_provider.h b/assets/asset_provider.h new file mode 100644 index 0000000000000..68b7f5c2b7b9c --- /dev/null +++ b/assets/asset_provider.h @@ -0,0 +1,25 @@ +// 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. + +#ifndef FLUTTER_ASSETS_ASSET_PROVIDER_H_ +#define FLUTTER_ASSETS_ASSET_PROVIDER_H_ + +#include +#include + +#include "lib/fxl/memory/ref_counted.h" + +namespace blink { + +class AssetProvider + : public fxl::RefCountedThreadSafe + { + public: + virtual bool GetAsBuffer(const std::string& asset_name, + std::vector* data) = 0; + virtual ~AssetProvider() = default; +}; + +} // namespace blink +#endif // FLUTTER_ASSETS_ASSET_PROVIDER_H diff --git a/assets/asset_resolver.h b/assets/asset_resolver.h deleted file mode 100644 index 6cfe27961a9f4..0000000000000 --- a/assets/asset_resolver.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2017 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_ASSETS_ASSET_RESOLVER_H_ -#define FLUTTER_ASSETS_ASSET_RESOLVER_H_ - -#include -#include - -#include "lib/fxl/macros.h" - -namespace blink { - -class AssetResolver { - public: - AssetResolver() = default; - - virtual ~AssetResolver() = default; - - virtual bool IsValid() const = 0; - - virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const = 0; - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(AssetResolver); -}; - -} // namespace blink - -#endif // FLUTTER_ASSETS_ASSET_RESOLVER_H_ diff --git a/assets/directory_asset_bundle.cc b/assets/directory_asset_bundle.cc index 8e5d4df2ab977..43933079a81bd 100644 --- a/assets/directory_asset_bundle.cc +++ b/assets/directory_asset_bundle.cc @@ -3,54 +3,73 @@ // found in the LICENSE file. #include "flutter/assets/directory_asset_bundle.h" +#include "lib/fxl/build_config.h" + +#include #include -#include "flutter/fml/file.h" -#include "flutter/fml/mapping.h" #include "lib/fxl/files/eintr_wrapper.h" +#include "lib/fxl/files/file.h" +#include "lib/fxl/files/path.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/portable_unistd.h" namespace blink { -DirectoryAssetBundle::DirectoryAssetBundle(fml::UniqueFD descriptor) - : descriptor_(std::move(descriptor)) { - if (!fml::IsDirectory(descriptor_)) { - return; - } - is_valid_ = true; -} +bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, + std::vector* data) { + if (fd_.is_valid()) { +#if defined(OS_WIN) + // This code path is not valid in a Windows environment. + return false; +#else + fxl::UniqueFD asset_file(openat(fd_.get(), asset_name.c_str(), O_RDONLY)); + if (!asset_file.is_valid()) + return false; -DirectoryAssetBundle::~DirectoryAssetBundle() = default; + constexpr size_t kBufferSize = 1 << 16; + size_t offset = 0; + ssize_t bytes_read = 0; + do { + offset += bytes_read; + data->resize(offset + kBufferSize); + bytes_read = read(asset_file.get(), &(*data)[offset], kBufferSize); + } while (bytes_read > 0); -// |blink::AssetResolver| -bool DirectoryAssetBundle::IsValid() const { - return is_valid_; -} + if (bytes_read < 0) { + FXL_LOG(ERROR) << "Reading " << asset_name << " failed"; + data->clear(); + return false; + } -// |blink::AssetResolver| -bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { - if (data == nullptr) { - return false; + data->resize(offset + bytes_read); + return true; +#endif } - - if (!is_valid_) { - FXL_DLOG(WARNING) << "Asset bundle was not valid."; + std::string asset_path = GetPathForAsset(asset_name); + if (asset_path.empty()) return false; - } + return files::ReadFileToVector(asset_path, data); +} - fml::FileMapping mapping( - fml::OpenFile(descriptor_, asset_name.c_str(), fml::OpenPermission::kRead, - false /* directory */), - false /* executable */); +DirectoryAssetBundle::~DirectoryAssetBundle() {} - if (mapping.GetMapping() == nullptr) { - return false; - } +DirectoryAssetBundle::DirectoryAssetBundle(std::string directory) + : directory_(std::move(directory)), fd_() {} + +DirectoryAssetBundle::DirectoryAssetBundle(fxl::UniqueFD fd) + : fd_(std::move(fd)) {} - data->resize(mapping.GetSize()); - memmove(data->data(), mapping.GetMapping(), mapping.GetSize()); - return true; +std::string DirectoryAssetBundle::GetPathForAsset( + const std::string& asset_name) { + std::string asset_path = files::SimplifyPath(directory_ + "/" + asset_name); + if (asset_path.find(directory_) != 0u) { + FXL_LOG(ERROR) << "Asset name '" << asset_name + << "' attempted to traverse outside asset bundle."; + return std::string(); + } + return asset_path; } } // namespace blink diff --git a/assets/directory_asset_bundle.h b/assets/directory_asset_bundle.h index b594e1357fbe2..c710a513796ae 100644 --- a/assets/directory_asset_bundle.h +++ b/assets/directory_asset_bundle.h @@ -5,31 +5,31 @@ #ifndef FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ #define FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ -#include "flutter/assets/asset_resolver.h" -#include "flutter/fml/unique_fd.h" +#include +#include + +#include "flutter/assets/asset_provider.h" +#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class DirectoryAssetBundle : public AssetResolver { +class DirectoryAssetBundle + : public AssetProvider { public: - explicit DirectoryAssetBundle(fml::UniqueFD descriptor); - - ~DirectoryAssetBundle() override; + explicit DirectoryAssetBundle(std::string directory); + // Expects fd to be valid, otherwise the file descriptor is ignored. + explicit DirectoryAssetBundle(fxl::UniqueFD fd); + virtual ~DirectoryAssetBundle(); - private: - const fml::UniqueFD descriptor_; - bool is_valid_ = false; + virtual bool GetAsBuffer(const std::string& asset_name, std::vector* data); - std::string GetPathForAsset(const std::string& asset_name) const; + std::string GetPathForAsset(const std::string& asset_name); - // |blink::AssetResolver| - bool IsValid() const override; - - // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + private: + const std::string directory_; + fxl::UniqueFD fd_; FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); }; diff --git a/assets/unzipper_provider.cc b/assets/unzipper_provider.cc new file mode 100644 index 0000000000000..8ed023f9a20e9 --- /dev/null +++ b/assets/unzipper_provider.cc @@ -0,0 +1,21 @@ +// Copyright 2016 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. + +#include "flutter/assets/unzipper_provider.h" + +#include "lib/fxl/logging.h" +#include "third_party/zlib/contrib/minizip/unzip.h" + +namespace blink { + +UnzipperProvider GetUnzipperProviderForPath(std::string zip_path) { + return [zip_path]() { + zip::UniqueUnzipper unzipper(unzOpen2(zip_path.c_str(), nullptr)); + if (!unzipper.is_valid()) + FXL_LOG(ERROR) << "Unable to open zip file: " << zip_path; + return unzipper; + }; +} + +} // namespace blink diff --git a/assets/unzipper_provider.h b/assets/unzipper_provider.h new file mode 100644 index 0000000000000..f0f8d9597dffd --- /dev/null +++ b/assets/unzipper_provider.h @@ -0,0 +1,20 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_ASSETS_UNZIP_PROVIDER_H_ +#define FLUTTER_ASSETS_UNZIP_PROVIDER_H_ + +#include + +#include "lib/zip/unique_unzipper.h" + +namespace blink { + +using UnzipperProvider = std::function; + +UnzipperProvider GetUnzipperProviderForPath(std::string zip_path); + +} // namespace blink + +#endif // FLUTTER_ASSETS_UNZIP_PROVIDER_H_ diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index 1b9216bd34530..c8534fa10c216 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -15,28 +15,21 @@ #include #include "flutter/glue/trace_event.h" +#include "lib/fxl/files/eintr_wrapper.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/zip/unique_unzipper.h" namespace blink { -ZipAssetStore::ZipAssetStore(std::string file_path) - : file_path_(std::move(file_path)) { +ZipAssetStore::ZipAssetStore(UnzipperProvider unzipper_provider) + : unzipper_provider_(std::move(unzipper_provider)) { BuildStatCache(); } ZipAssetStore::~ZipAssetStore() = default; -zip::UniqueUnzipper ZipAssetStore::CreateUnzipper() const { - return zip::UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)}; -} - -// |blink::AssetResolver| -bool ZipAssetStore::IsValid() const { - return stat_cache_.size() > 0; -} - -// |blink::AssetResolver| bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { + std::vector* data) { TRACE_EVENT0("flutter", "ZipAssetStore::GetAsBuffer"); auto found = stat_cache_.find(asset_name); @@ -44,7 +37,7 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, return false; } - auto unzipper = CreateUnzipper(); + auto unzipper = unzipper_provider_(); if (!unzipper.is_valid()) { return false; @@ -80,8 +73,7 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, void ZipAssetStore::BuildStatCache() { TRACE_EVENT0("flutter", "ZipAssetStore::BuildStatCache"); - - auto unzipper = CreateUnzipper(); + auto unzipper = unzipper_provider_(); if (!unzipper.is_valid()) { return; diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h index 558678e25bc08..1ffda483ba9b7 100644 --- a/assets/zip_asset_store.h +++ b/assets/zip_asset_store.h @@ -6,20 +6,21 @@ #define FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ #include +#include -#include "flutter/assets/asset_resolver.h" +#include "flutter/assets/unzipper_provider.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" -#include "lib/zip/unique_unzipper.h" #include "third_party/zlib/contrib/minizip/unzip.h" namespace blink { -class ZipAssetStore final : public AssetResolver { +class ZipAssetStore : public fxl::RefCountedThreadSafe { public: - ZipAssetStore(std::string file_path); + explicit ZipAssetStore(UnzipperProvider unzipper_provider); + ~ZipAssetStore(); - ~ZipAssetStore() override; + bool GetAsBuffer(const std::string& asset_name, std::vector* data); private: struct CacheEntry { @@ -29,20 +30,11 @@ class ZipAssetStore final : public AssetResolver { : file_pos(p_file_pos), uncompressed_size(p_uncompressed_size) {} }; - std::string file_path_; - mutable std::map stat_cache_; - - // |blink::AssetResolver| - bool IsValid() const override; - - // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + UnzipperProvider unzipper_provider_; + std::map stat_cache_; void BuildStatCache(); - zip::UniqueUnzipper CreateUnzipper() const; - FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); }; diff --git a/common/BUILD.gn b/common/BUILD.gn index 47cd7d3d62644..53b71914d49d1 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -12,12 +12,11 @@ source_set("common") { sources = [ "settings.cc", "settings.h", - "task_runners.cc", - "task_runners.h", + "threads.cc", + "threads.h", ] deps = [ - "$flutter_root/fml", "//garnet/public/lib/fxl", ] diff --git a/common/settings.cc b/common/settings.cc index 85523e1b9a29f..0198f714cbaad 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -4,50 +4,26 @@ #include "flutter/common/settings.h" -#include +#include + +#include "lib/fxl/logging.h" namespace blink { +namespace { + +Settings* g_settings = nullptr; + +} // namespace + +const Settings& Settings::Get() { + FXL_CHECK(g_settings); + return *g_settings; +} -std::string Settings::ToString() const { - std::stringstream stream; - stream << "Settings: " << std::endl; - stream << "aot_snapshot_path: " << aot_snapshot_path << std::endl; - stream << "script_snapshot_path: " << script_snapshot_path << std::endl; - stream << "aot_vm_snapshot_data_filename: " << aot_vm_snapshot_data_filename - << std::endl; - stream << "aot_vm_snapshot_instr_filename: " << aot_vm_snapshot_instr_filename - << std::endl; - stream << "aot_isolate_snapshot_data_filename: " - << aot_isolate_snapshot_data_filename << std::endl; - stream << "aot_isolate_snapshot_instr_filename: " - << aot_isolate_snapshot_instr_filename << std::endl; - stream << "application_library_path: " << application_library_path - << std::endl; - stream << "main_dart_file_path: " << main_dart_file_path << std::endl; - stream << "packages_file_path: " << packages_file_path << std::endl; - stream << "temp_directory_path: " << temp_directory_path << std::endl; - stream << "dart_flags:" << std::endl; - for (const auto& dart_flag : dart_flags) { - stream << " " << dart_flag << std::endl; - } - stream << "start_paused: " << start_paused << std::endl; - stream << "trace_skia: " << trace_skia << std::endl; - stream << "trace_startup: " << trace_startup << std::endl; - stream << "endless_trace_buffer: " << endless_trace_buffer << std::endl; - stream << "enable_dart_profiling: " << enable_dart_profiling << std::endl; - stream << "dart_non_checked_mode: " << dart_non_checked_mode << std::endl; - stream << "enable_observatory: " << enable_observatory << std::endl; - stream << "observatory_port: " << observatory_port << std::endl; - stream << "ipv6: " << ipv6 << std::endl; - stream << "use_test_fonts: " << use_test_fonts << std::endl; - stream << "enable_software_rendering: " << enable_software_rendering - << std::endl; - stream << "using_blink: " << using_blink << std::endl; - stream << "log_tag: " << log_tag << std::endl; - stream << "icu_data_path: " << icu_data_path << std::endl; - stream << "assets_dir: " << assets_dir << std::endl; - stream << "assets_path: " << assets_path << std::endl; - return stream.str(); +void Settings::Set(const Settings& settings) { + FXL_CHECK(!g_settings); + g_settings = new Settings(); + *g_settings = settings; } } // namespace blink diff --git a/common/settings.h b/common/settings.h index c6c3159766a37..5bb5c6cbbea42 100644 --- a/common/settings.h +++ b/common/settings.h @@ -5,82 +5,40 @@ #ifndef FLUTTER_COMMON_SETTINGS_H_ #define FLUTTER_COMMON_SETTINGS_H_ -#include #include -#include #include #include -#include "flutter/fml/unique_fd.h" -#include "lib/fxl/functional/closure.h" - namespace blink { -using TaskObserverAdd = - std::function; -using TaskObserverRemove = std::function; - struct Settings { - // VM settings - std::string script_snapshot_path; - std::string kernel_snapshot_path; - + bool enable_observatory = false; + // Port on target will be auto selected by the OS. A message will be printed + // on the target with the port after it has been selected. + uint32_t observatory_port = 0; + bool ipv6 = false; + bool start_paused = false; + bool trace_startup = false; + bool endless_trace_buffer = false; + bool enable_dart_profiling = false; + bool use_test_fonts = false; + bool dart_non_checked_mode = false; + bool enable_software_rendering = false; + bool using_blink = true; + std::string aot_shared_library_path; std::string aot_snapshot_path; std::string aot_vm_snapshot_data_filename; std::string aot_vm_snapshot_instr_filename; std::string aot_isolate_snapshot_data_filename; std::string aot_isolate_snapshot_instr_filename; - std::string application_library_path; - std::string application_kernel_asset; - - std::string main_dart_file_path; - std::string packages_file_path; - std::string temp_directory_path; std::vector dart_flags; - - // Isolate settings - bool start_paused = false; - bool trace_skia = false; - bool trace_startup = false; - bool endless_trace_buffer = false; - bool enable_dart_profiling = false; - bool dart_non_checked_mode = false; - - // Observatory settings - bool enable_observatory = false; - // Port on target will be auto selected by the OS. A message will be printed - // on the target with the port after it has been selected. - uint32_t observatory_port = 0; - bool ipv6 = false; - - // Font settings - bool use_test_fonts = false; - - // Engine settings - TaskObserverAdd task_observer_add; - TaskObserverRemove task_observer_remove; - // The main isolate is current when this callback is made. This is a good spot - // to perform native Dart bindings for libraries not built in. - fxl::Closure root_isolate_create_callback; - // The isolate is not current and may have already been destroyed when this - // call is made. - fxl::Closure root_isolate_shutdown_callback; - bool enable_software_rendering = false; - bool using_blink = false; - bool skia_deterministic_rendering_on_cpu = false; std::string log_tag = "flutter"; - std::string icu_data_path; - - // Assets settings - fml::UniqueFD::element_type assets_dir = - fml::UniqueFD::traits_type::InvalidValue(); - std::string assets_path; - std::string flx_path; - std::string ToString() const; + static const Settings& Get(); + static void Set(const Settings& settings); }; } // namespace blink diff --git a/common/task_runners.cc b/common/task_runners.cc deleted file mode 100644 index 1a09daec1815c..0000000000000 --- a/common/task_runners.cc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2017 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/common/task_runners.h" - -#include - -namespace blink { - -TaskRunners::TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io) - : label_(std::move(label)), - platform_(std::move(platform)), - gpu_(std::move(gpu)), - ui_(std::move(ui)), - io_(std::move(io)) {} - -TaskRunners::~TaskRunners() = default; - -const std::string& TaskRunners::GetLabel() const { - return label_; -} - -fxl::RefPtr TaskRunners::GetPlatformTaskRunner() const { - return platform_; -} - -fxl::RefPtr TaskRunners::GetUITaskRunner() const { - return ui_; -} - -fxl::RefPtr TaskRunners::GetIOTaskRunner() const { - return io_; -} - -fxl::RefPtr TaskRunners::GetGPUTaskRunner() const { - return gpu_; -} - -bool TaskRunners::IsValid() const { - return platform_ && gpu_ && ui_ && io_; -} - -} // namespace blink diff --git a/common/task_runners.h b/common/task_runners.h deleted file mode 100644 index f41ae147ebad0..0000000000000 --- a/common/task_runners.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2017 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 - -#include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" - -namespace blink { - -class TaskRunners { - public: - TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io); - - ~TaskRunners(); - - const std::string& GetLabel() const; - - fxl::RefPtr GetPlatformTaskRunner() const; - - fxl::RefPtr GetUITaskRunner() const; - - fxl::RefPtr GetIOTaskRunner() const; - - fxl::RefPtr GetGPUTaskRunner() const; - - bool IsValid() const; - - private: - const std::string label_; - fxl::RefPtr platform_; - fxl::RefPtr gpu_; - fxl::RefPtr ui_; - fxl::RefPtr io_; -}; -} // namespace blink - -#endif // FLUTTER_COMMON_TASK_RUNNERS_H_ diff --git a/common/threads.cc b/common/threads.cc new file mode 100644 index 0000000000000..3634d8d7c8723 --- /dev/null +++ b/common/threads.cc @@ -0,0 +1,56 @@ +// Copyright 2016 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. + +#include "flutter/common/threads.h" + +#include + +namespace blink { +namespace { + +Threads* g_threads = nullptr; + +} // namespace + +Threads::Threads() {} + +Threads::Threads(fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io) + : platform_(std::move(platform)), + gpu_(std::move(gpu)), + ui_(std::move(ui)), + io_(std::move(io)) {} + +Threads::~Threads() {} + +const fxl::RefPtr& Threads::Platform() { + return Get().platform_; +} + +const fxl::RefPtr& Threads::Gpu() { + return Get().gpu_; +} + +const fxl::RefPtr& Threads::UI() { + return Get().ui_; +} + +const fxl::RefPtr& Threads::IO() { + return Get().io_; +} + +const Threads& Threads::Get() { + FXL_CHECK(g_threads); + return *g_threads; +} + +void Threads::Set(const Threads& threads) { + FXL_CHECK(!g_threads); + g_threads = new Threads(); + *g_threads = threads; +} + +} // namespace blink diff --git a/common/threads.h b/common/threads.h new file mode 100644 index 0000000000000..456a5eba8ad97 --- /dev/null +++ b/common/threads.h @@ -0,0 +1,48 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_COMMON_THREADS_H_ +#define FLUTTER_COMMON_THREADS_H_ + +#include "lib/fxl/tasks/task_runner.h" + +#define ASSERT_IS_PLATFORM_THREAD \ + FXL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread()); +#define ASSERT_IS_GPU_THREAD \ + FXL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread()); +#define ASSERT_IS_UI_THREAD \ + FXL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread()); +#define ASSERT_IS_IO_THREAD \ + FXL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread()); + +namespace blink { + +class Threads { + public: + Threads(); + Threads(fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io); + ~Threads(); + + static const fxl::RefPtr& Platform(); + static const fxl::RefPtr& Gpu(); + static const fxl::RefPtr& UI(); + static const fxl::RefPtr& IO(); + + static void Set(const Threads& settings); + + private: + static const Threads& Get(); + + fxl::RefPtr platform_; + fxl::RefPtr gpu_; + fxl::RefPtr ui_; + fxl::RefPtr io_; +}; + +} // namespace blink + +#endif // FLUTTER_COMMON_THREADS_H_ diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 4778784baa643..6bc00b4e2786c 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -20,28 +20,23 @@ template("flutter_content_handler") { sources = [ "accessibility_bridge.cc", "accessibility_bridge.h", - "application.cc", - "application.h", - "application_runner.cc", - "application_runner.h", - "compositor_context.cc", - "compositor_context.h", - "engine.cc", - "engine.h", + "app.cc", + "app.h", + "application_controller_impl.cc", + "application_controller_impl.h", "fuchsia_font_manager.cc", "fuchsia_font_manager.h", - "isolate_configurator.cc", - "isolate_configurator.h", "main.cc", - "platform_view.cc", - "platform_view.h", + "rasterizer.cc", + "rasterizer.h", + "runtime_holder.cc", + "runtime_holder.h", + "service_protocol_hooks.cc", + "service_protocol_hooks.h", "session_connection.cc", "session_connection.h", - "surface.cc", - "surface.h", - "task_observers.cc", - "task_observers.h", - "unique_fdio_ns.h", + "vulkan_rasterizer.cc", + "vulkan_rasterizer.h", "vulkan_surface.cc", "vulkan_surface.h", "vulkan_surface_pool.cc", @@ -50,26 +45,18 @@ template("flutter_content_handler") { "vulkan_surface_producer.h", ] - # The use of these dependencies is temporary and will be moved behind the - # embedder API. - flutter_deps = [ - "$flutter_root/assets", - "$flutter_root/common", - "$flutter_root/flow", - "$flutter_root/glue", - "$flutter_root/lib/ui", - "$flutter_root/runtime", - "$flutter_root/sky/engine/platform", - "$flutter_root/third_party/txt", - "$flutter_root/vulkan", - "$flutter_root/fml", - "$flutter_root/shell/common", - "$flutter_root/shell/gpu", - ] - deps = [ "//third_party/dart/runtime/bin:libdart_builtin", "//third_party/dart/runtime/platform:libdart_platform", + "$flutter_root/assets", + "$flutter_root/common", + "$flutter_root/flow", + "$flutter_root/glue", + "$flutter_root/lib/ui", + "$flutter_root/runtime", + "$flutter_root/sky/engine/platform", + "$flutter_root/third_party/txt", + "$flutter_root/vulkan", "//garnet/public/lib/app/cpp", "//garnet/public/lib/fsl", "//garnet/public/lib/fxl", @@ -86,10 +73,8 @@ template("flutter_content_handler") { "//topaz/lib/tonic", "//topaz/public/dart-pkg/fuchsia", "//topaz/public/lib/ui/flutter/sdk_ext", - "//third_party/skia:gpu", - "//third_party/zlib:minizip", "//zircon/public/lib/trace-provider", - ] + extra_deps + flutter_deps + ] + extra_deps # The flags below are needed so that Dart's CPU profiler can walk the # C++ stack. diff --git a/content_handler/README.md b/content_handler/README.md deleted file mode 100644 index 4461e808d1a47..0000000000000 --- a/content_handler/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Flutter Application Runner -========================== - -Implements the `component::ApplicationRunner` FIDL interface to launch and run mutliple Flutter applications within the same process. diff --git a/content_handler/accessibility_bridge.cc b/content_handler/accessibility_bridge.cc index f3d52f6cdbbb6..cb6f9b8e21155 100644 --- a/content_handler/accessibility_bridge.cc +++ b/content_handler/accessibility_bridge.cc @@ -2,22 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "accessibility_bridge.h" +#include "flutter/content_handler/accessibility_bridge.h" #include +#include "flutter/lib/ui/semantics/semantics_node.h" #include "lib/app/cpp/application_context.h" -#include "lib/context/fidl/context_writer.fidl.h" +#include "lib/fxl/macros.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/stringbuffer.h" #include "third_party/rapidjson/rapidjson/writer.h" -namespace flutter { +namespace flutter_runner { -AccessibilityBridge::AccessibilityBridge(maxwell::ContextWriterPtr writer) - : writer_(std::move(writer)) {} - -AccessibilityBridge::~AccessibilityBridge() = default; +AccessibilityBridge::AccessibilityBridge(component::ApplicationContext* context) + : writer_(context->ConnectToEnvironmentService()) {} void AccessibilityBridge::UpdateSemantics( const blink::SemanticsNodeUpdates& update) { @@ -78,4 +77,4 @@ void AccessibilityBridge::EraseUnvisitedNodes( } } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h index dde8bfaa54c36..7ac54e754d9b6 100644 --- a/content_handler/accessibility_bridge.h +++ b/content_handler/accessibility_bridge.h @@ -2,32 +2,28 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ +#define FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ #include #include "flutter/lib/ui/semantics/semantics_node.h" -#include "lib/context/fidl/context_writer.fidl.h" -#include "lib/fxl/macros.h" +#include "lib/app/cpp/application_context.h" +#include -namespace flutter { +namespace flutter_runner { // Maintain an up-to-date list of SemanticsNodes on screen, and communicate // with the Context Service. -class AccessibilityBridge final { +class AccessibilityBridge { public: - AccessibilityBridge(maxwell::ContextWriterPtr writer); - - ~AccessibilityBridge(); + explicit AccessibilityBridge(component::ApplicationContext* context); // Update the internal representation of the semantics nodes, and write the // semantics to Context Service. void UpdateSemantics(const blink::SemanticsNodeUpdates& update); private: - maxwell::ContextWriterPtr writer_; - std::map semantics_nodes_; - // Walk the semantics node tree starting at |id|, and store the id of each // visited child in |visited_nodes|. void UpdateVisitedForNodeAndChildren(const int id, @@ -37,7 +33,10 @@ class AccessibilityBridge final { // |visited_nodes|. void EraseUnvisitedNodes(const std::vector& visited_nodes); - FXL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); + std::map semantics_nodes_; + modular::ContextWriterPtr writer_; }; -} // namespace flutter +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ diff --git a/content_handler/app.cc b/content_handler/app.cc new file mode 100644 index 0000000000000..1f1bde833d2f3 --- /dev/null +++ b/content_handler/app.cc @@ -0,0 +1,174 @@ +// Copyright 2016 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. + +#include "flutter/content_handler/app.h" + +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/common/threads.h" +#include "flutter/content_handler/fuchsia_font_manager.h" +#include "flutter/lib/ui/text/font_collection.h" +#include "flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h" +#include "lib/fsl/tasks/message_loop.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" +#include "lib/icu_data/cpp/icu_data.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace flutter_runner { +namespace { + +static App* g_app = nullptr; + +void QuitMessageLoop() { + fsl::MessageLoop::GetCurrent()->QuitNow(); +} + +std::string GetLabelFromURL(const std::string& url) { + size_t last_slash = url.rfind('/'); + if (last_slash == std::string::npos || last_slash + 1 == url.length()) + return url; + return url.substr(last_slash + 1); +} + +} // namespace + +App::App() { + g_app = this; + context_ = component::ApplicationContext::CreateFromStartupInfo(); + + gpu_thread_ = std::make_unique(); + io_thread_ = std::make_unique(); + + auto gpu_thread_success = gpu_thread_->Run(); + auto io_thread_success = io_thread_->Run(); + + FXL_CHECK(gpu_thread_success) << "Must be able to create the GPU thread"; + FXL_CHECK(io_thread_success) << "Must be able to create the IO thread"; + + auto ui_task_runner = fsl::MessageLoop::GetCurrent()->task_runner(); + auto gpu_task_runner = gpu_thread_->TaskRunner(); + auto io_task_runner = io_thread_->TaskRunner(); + + // Notice that the Platform and UI threads are actually the same. + blink::Threads::Set(blink::Threads(ui_task_runner, // Platform + gpu_task_runner, // GPU + ui_task_runner, // UI + io_task_runner // IO + )); + + if (!icu_data::Initialize(context_.get())) { + FXL_LOG(ERROR) << "Could not initialize ICU data."; + } + + blink::Settings settings; + settings.enable_observatory = true; + blink::Settings::Set(settings); + + fonts::FontProviderPtr font_provider( + context_->ConnectToEnvironmentService()); + if (settings.using_blink) { + blink::SetFontProvider(std::move(font_provider)); + } else { + blink::FontCollection::ForProcess().GetFontCollection()-> + SetAssetFontManager( + sk_make_sp(std::move(font_provider))); + } + + context_->outgoing_services()->AddService( + [this](fidl::InterfaceRequest request) { + runner_bindings_.AddBinding(this, std::move(request)); + }); +} + +App::~App() { + icu_data::Release(); + blink::Threads::Gpu()->PostTask(QuitMessageLoop); + blink::Threads::IO()->PostTask(QuitMessageLoop); + g_app = nullptr; +} + +App& App::Shared() { + FXL_DCHECK(g_app); + return *g_app; +} + +void App::WaitForPlatformViewIds( + std::vector* platform_view_ids) { + fxl::AutoResetWaitableEvent latch; + + blink::Threads::UI()->PostTask([this, platform_view_ids, &latch]() { + WaitForPlatformViewsIdsUIThread(platform_view_ids, &latch); + }); + + latch.Wait(); +} + +void App::WaitForPlatformViewsIdsUIThread( + std::vector* platform_view_ids, + fxl::AutoResetWaitableEvent* latch) { + for (auto it = controllers_.begin(); it != controllers_.end(); it++) { + ApplicationControllerImpl* controller = it->first; + + if (!controller) { + continue; + } + + PlatformViewInfo info; + // TODO(zra): We should create real IDs for these instead of relying on the + // address of the controller. Maybe just use the UI Isolate main port? + info.view_id = reinterpret_cast(controller); + info.isolate_id = controller->GetUIIsolateMainPort(); + info.isolate_name = controller->GetUIIsolateName(); + platform_view_ids->push_back(info); + } + latch->Signal(); +} + +void App::StartApplication( + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) { + if (controllers_.empty()) { + // Name this process after the url of the first application being launched. + base_label_ = "flutter:" + GetLabelFromURL(startup_info.launch_info.url); + } + + std::unique_ptr impl = + std::make_unique(this, std::move(application), + std::move(startup_info), + std::move(controller)); + ApplicationControllerImpl* key = impl.get(); + controllers_.emplace(key, std::move(impl)); + + UpdateProcessLabel(); +} + +void App::Destroy(ApplicationControllerImpl* controller) { + auto it = controllers_.find(controller); + if (it == controllers_.end()) + return; + controllers_.erase(it); + UpdateProcessLabel(); +} + +void App::UpdateProcessLabel() { + std::string label; + if (controllers_.size() < 2) { + label = base_label_; + } else { + std::string suffix = " (+" + std::to_string(controllers_.size() - 1) + ")"; + if (base_label_.size() + suffix.size() <= ZX_MAX_NAME_LEN - 1) { + label = base_label_ + suffix; + } else { + label = base_label_.substr(0, ZX_MAX_NAME_LEN - 1 - suffix.size() - 3) + + "..." + suffix; + } + } + zx::process::self().set_property(ZX_PROP_NAME, label.c_str(), label.size()); +} + +} // namespace flutter_runner diff --git a/content_handler/app.h b/content_handler/app.h new file mode 100644 index 0000000000000..dc8c49927d897 --- /dev/null +++ b/content_handler/app.h @@ -0,0 +1,64 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_CONTENT_HANDLER_APP_H_ +#define FLUTTER_CONTENT_HANDLER_APP_H_ + +#include +#include + +#include "flutter/content_handler/application_controller_impl.h" +#include "lib/app/cpp/application_context.h" +#include +#include "lib/fsl/threading/thread.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/synchronization/waitable_event.h" + +namespace flutter_runner { + +class App : public component::ApplicationRunner { + public: + App(); + ~App(); + + static App& Shared(); + + // |component::ApplicationRunner| implementation: + + void StartApplication( + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) override; + + void Destroy(ApplicationControllerImpl* controller); + + struct PlatformViewInfo { + uintptr_t view_id; + int64_t isolate_id; + std::string isolate_name; + }; + + void WaitForPlatformViewIds(std::vector* platform_view_ids); + + private: + void WaitForPlatformViewsIdsUIThread( + std::vector* platform_view_ids, + fxl::AutoResetWaitableEvent* latch); + void UpdateProcessLabel(); + + std::unique_ptr context_; + std::unique_ptr gpu_thread_; + std::unique_ptr io_thread_; + fidl::BindingSet runner_bindings_; + std::unordered_map> + controllers_; + std::string base_label_; + + FXL_DISALLOW_COPY_AND_ASSIGN(App); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_APP_H_ diff --git a/content_handler/application.cc b/content_handler/application.cc deleted file mode 100644 index 7dd2270d42317..0000000000000 --- a/content_handler/application.cc +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "application.h" - -#include -#include - -#include - -#include "flutter/shell/common/switches.h" -#include "lib/fsl/vmo/file.h" -#include "lib/fsl/vmo/vector.h" -#include "lib/fxl/command_line.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "task_observers.h" - -namespace flutter { - -std::pair, std::unique_ptr> -Application::Create( - Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller) { - auto thread = std::make_unique(); - std::unique_ptr application; - - fxl::AutoResetWaitableEvent latch; - thread->TaskRunner()->PostTask([&]() mutable { - application.reset(new Application(delegate, // - std::move(package), // - std::move(startup_info), // - std::move(controller) // - )); - latch.Signal(); - }); - thread->Run(); - latch.Wait(); - return {std::move(thread), std::move(application)}; -} - -static std::string DebugLabelForURL(const std::string url) { - auto found = url.rfind("/"); - if (found == std::string::npos) { - return url; - } else { - return {url, found + 1}; - } -} - -Application::Application( - Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest - application_controller_request) - : delegate_(delegate), - debug_label_(DebugLabelForURL(startup_info->launch_info->url)), - application_controller_(this) { - application_controller_.set_error_handler([this]() { Kill(); }); - - FXL_DCHECK(fdio_ns_.is_valid()); - // ApplicationLaunchInfo::url non-optional. - auto& launch_info = startup_info->launch_info; - - // ApplicationLaunchInfo::arguments optional. - if (auto& arguments = launch_info->arguments) { - settings_ = shell::SettingsFromCommandLine( - fxl::CommandLineFromIterators(arguments->begin(), arguments->end())); - } - - // TODO: ApplicationLaunchInfo::out optional. - - // TODO: ApplicationLaunchInfo::err optional. - - // ApplicationLaunchInfo::service_request optional. - if (launch_info->directory_request) { - service_provider_bridge_.ServeDirectory( - std::move(launch_info->directory_request)); - } - - // ApplicationLaunchInfo::flat_namespace optional. - if (auto& flat_namespace = startup_info->flat_namespace) { - for (size_t i = 0; i < flat_namespace->paths->size(); ++i) { - const auto& path = flat_namespace->paths->at(i); - if (path == "/svc") { - continue; - } - - zx::channel dir = std::move(flat_namespace->directories->at(i)); - zx_handle_t dir_handle = dir.release(); - if (fdio_ns_bind(fdio_ns_.get(), path->data(), dir_handle) != ZX_OK) { - FXL_DLOG(ERROR) << "Could not bind path to namespace: " << path; - zx_handle_close(dir_handle); - } - } - } else { - FXL_DLOG(ERROR) << "There was no flat namespace."; - } - - application_directory_.reset(fdio_ns_opendir(fdio_ns_.get())); - FXL_DCHECK(application_directory_.is_valid()); - - application_assets_directory_.reset( - openat(application_directory_.get(), "pkg/data", O_RDONLY | O_DIRECTORY)); - - // TODO: ApplicationLaunchInfo::additional_services optional. - - // ApplicationPackage::data: This is legacy FLX data. Ensure that we dont have - // any. - FXL_DCHECK(!package->data) << "Legacy FLX data must not be supplied."; - - // All launch arguments have been read. Perform service binding and - // final settings configuration. The next call will be to create a view - // for this application. - - service_provider_bridge_.AddService( - std::bind(&Application::CreateShellForView, this, std::placeholders::_1)); - - component::ServiceProviderPtr outgoing_services; - outgoing_services_request_ = outgoing_services.NewRequest(); - service_provider_bridge_.set_backend(std::move(outgoing_services)); - - // Setup the application controller binding. - if (application_controller_request) { - application_controller_.Bind(std::move(application_controller_request)); - } - - application_context_ = - component::ApplicationContext::CreateFrom(std::move(startup_info)); - - settings_.enable_observatory = true; - - settings_.icu_data_path = ""; - - settings_.using_blink = false; - - settings_.assets_dir = application_assets_directory_.get(); - - settings_.script_snapshot_path = "snapshot_blob.bin"; - - settings_.log_tag = debug_label_ + std::string{"(flutter)"}; - -#ifndef NDEBUG - // Debug mode - settings_.dart_non_checked_mode = false; -#else // NDEBUG - // Release mode - settings_.dart_non_checked_mode = true; -#endif // NDEBUG - - settings_.task_observer_add = - std::bind(&CurrentMessageLoopAddAfterTaskObserver, std::placeholders::_1, - std::placeholders::_2); - - settings_.task_observer_remove = std::bind( - &CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1); - - AttemptVMLaunchWithCurrentSettings(settings_); -} - -Application::~Application() = default; - -void Application::AttemptVMLaunchWithCurrentSettings( - const blink::Settings& settings) const { - if (blink::DartVM::ForProcessIfInitialized()) { - return; - } - - if (!blink::DartVM::IsRunningPrecompiledCode()) { - // We will be initializing the VM lazily in this case. - return; - } - - fsl::SizedVmo dylib_vmo; - - if (!fsl::VmoFromFilenameAt( - application_assets_directory_.get() /* /pkg/data */, "libapp.so", - &dylib_vmo)) { - FXL_LOG(ERROR) << "Dylib containing VM and isolate snapshots does not " - "exist. Will not be able to launch VM."; - return; - } - - dlerror(); - - auto library_handle = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); - - if (library_handle == nullptr) { - FXL_LOG(ERROR) << "Could not open dylib: " << dlerror(); - return; - } - - auto lib = fxl::MakeRefCounted( - library_handle, // library handle - true // close the handle when done - ); - - auto symbol = [](const char* str) { - return std::string{"_"} + std::string{str}; - }; - - fxl::RefPtr vm_snapshot = - fxl::MakeRefCounted( - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kVMDataSymbol).c_str()), - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kVMInstructionsSymbol).c_str())); - - fxl::RefPtr isolate_snapshot = - fxl::MakeRefCounted( - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kIsolateDataSymbol).c_str()), - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, - symbol(blink::DartSnapshot::kIsolateInstructionsSymbol).c_str())); - - blink::DartVM::ForProcess(settings_, // - std::move(vm_snapshot), // - std::move(isolate_snapshot) // - ); - if (blink::DartVM::ForProcessIfInitialized()) { - FXL_DLOG(INFO) << "VM successfully initialized for AOT mode."; - } else { - FXL_LOG(ERROR) << "VM could not be initialized for AOT mode."; - } -} - -// |component::ApplicationController| -void Application::Kill() { - if (last_return_code_.first) { - for (auto wait_callback : wait_callbacks_) { - wait_callback(last_return_code_.second); - } - } - wait_callbacks_.clear(); - - delegate_.OnApplicationTerminate(this); - // WARNING: Don't do anything past this point as this instance may have been - // collected. -} - -// |component::ApplicationController| -void Application::Detach() { - application_controller_.set_error_handler(nullptr); -} - -// |component::ApplicationController| -void Application::Wait(const WaitCallback& callback) { - wait_callbacks_.emplace_back(std::move(callback)); -} - -// |flutter::Engine::Delegate| -void Application::OnEngineTerminate(const Engine* shell_holder) { - auto found = std::find_if(shell_holders_.begin(), shell_holders_.end(), - [shell_holder](const auto& holder) { - return holder.get() == shell_holder; - }); - - if (found == shell_holders_.end()) { - return; - } - - // We may launch multiple shell in this application. However, we will - // terminate when the last shell goes away. The error code return to the - // application controller will be the last isolate that had an error. - auto return_code = shell_holder->GetEngineReturnCode(); - if (return_code.first) { - last_return_code_ = return_code; - } - - shell_holders_.erase(found); - - if (shell_holders_.size() == 0) { - Kill(); - // WARNING: Don't do anything past this point because the delegate may have - // collected this instance via the termination callback. - } -} - -void Application::CreateShellForView( - f1dl::InterfaceRequest view_provider_request) { - shells_bindings_.AddBinding(this, std::move(view_provider_request)); -} - -// |mozart::ViewProvider| -void Application::CreateView( - f1dl::InterfaceRequest view_owner, - f1dl::InterfaceRequest) { - if (!application_context_) { - FXL_DLOG(ERROR) << "Application context was invalid when attempting to " - "create a shell for a view provider request."; - return; - } - - // This method may be called multiple times. Care must be taken to ensure that - // all arguments can be accessed or synthesized multiple times. - // TODO(chinmaygarde): Figure out how to re-create the outgoing service - // request handle. - shell_holders_.emplace(std::make_unique( - *this, // delegate - debug_label_, // thread label - *application_context_, // application context - settings_, // settings - std::move(view_owner), // view owner - fdio_ns_, // FDIO namespace - std::move(outgoing_services_request_) // outgoing request - )); -} - -} // namespace flutter diff --git a/content_handler/application.h b/content_handler/application.h deleted file mode 100644 index e4f5da105cac8..0000000000000 --- a/content_handler/application.h +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include -#include - -#include "engine.h" -#include "flutter/common/settings.h" -#include "lib/app/cpp/application_context.h" -#include "lib/app/fidl/application_controller.fidl.h" -#include "lib/fidl/cpp/bindings/binding_set.h" -#include "lib/fsl/threading/thread.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" -#include "lib/svc/cpp/service_provider_bridge.h" -#include "lib/ui/views/fidl/view_provider.fidl.h" -#include "unique_fdio_ns.h" - -namespace flutter { - -// Represents an instance of a Flutter application that contains one of more -// Flutter engine instances. -class Application final : public Engine::Delegate, - public component::ApplicationController, - public mozart::ViewProvider { - public: - class Delegate { - public: - virtual void OnApplicationTerminate(const Application* application) = 0; - }; - - // Creates a dedicated thread to run the application and constructions the - // application on it. The application can be accessed only on this thread. - // This is a synchronous operation. - static std::pair, std::unique_ptr> - Create(Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller); - - // Must be called on the same thread returned from the create call. The thread - // may be collected after. - ~Application(); - - private: - blink::Settings settings_; - Delegate& delegate_; - const std::string debug_label_; - UniqueFDIONS fdio_ns_ = UniqueFDIONSCreate(); - fxl::UniqueFD application_directory_; - fxl::UniqueFD application_assets_directory_; - f1dl::Binding application_controller_; - f1dl::InterfaceRequest outgoing_services_request_; - component::ServiceProviderBridge service_provider_bridge_; - std::unique_ptr application_context_; - f1dl::BindingSet shells_bindings_; - std::set> shell_holders_; - std::vector wait_callbacks_; - std::pair last_return_code_; - - Application( - Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller); - - // |component::ApplicationController| - void Kill() override; - - // |component::ApplicationController| - void Detach() override; - - // |component::ApplicationController| - void Wait(const WaitCallback& callback) override; - - // |mozart::ViewProvider| - void CreateView( - f1dl::InterfaceRequest view_owner, - f1dl::InterfaceRequest services) override; - - // |flutter::Engine::Delegate| - void OnEngineTerminate(const Engine* holder) override; - - void CreateShellForView( - f1dl::InterfaceRequest view_provider_request); - - void AttemptVMLaunchWithCurrentSettings( - const blink::Settings& settings) const; - - FXL_DISALLOW_COPY_AND_ASSIGN(Application); -}; - -} // namespace flutter diff --git a/content_handler/application_controller_impl.cc b/content_handler/application_controller_impl.cc new file mode 100644 index 0000000000000..9a1b449138a1b --- /dev/null +++ b/content_handler/application_controller_impl.cc @@ -0,0 +1,148 @@ +// Copyright 2016 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. + +#include "flutter/content_handler/application_controller_impl.h" + +#include + +#include +#include + +#include "flutter/content_handler/app.h" +#include "flutter/content_handler/runtime_holder.h" +#include "lib/app/cpp/connect.h" +#include "lib/fsl/vmo/vector.h" +#include "lib/fxl/logging.h" + +namespace flutter_runner { + +ApplicationControllerImpl::ApplicationControllerImpl( + App* app, + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) + : app_(app), binding_(this) { + if (controller.is_valid()) { + binding_.Bind(std::move(controller)); + binding_.set_error_handler([this] { + app_->Destroy(this); + // |this| has been deleted at this point. + }); + } + + std::vector bundle; + if (application.data) { + if (!fsl::VectorFromVmo(std::move(*application.data), &bundle)) { + FXL_LOG(ERROR) << "Failed to receive bundle."; + return; + } + } + + // TODO(jeffbrown): Decide what to do with command-line arguments and + // startup handles. + + if (startup_info.launch_info.directory_request.is_valid()) { + service_provider_bridge_.ServeDirectory( + std::move(startup_info.launch_info.directory_request)); + } + + service_provider_bridge_.AddService( + [this](fidl::InterfaceRequest request) { + view_provider_bindings_.AddBinding(this, std::move(request)); + }); + + component::ServiceProviderPtr service_provider; + auto request = service_provider.NewRequest(); + service_provider_bridge_.set_backend(std::move(service_provider)); + + fdio_ns_t* fdio_ns = SetupNamespace(&startup_info.flat_namespace); + if (fdio_ns == nullptr) { + FXL_LOG(ERROR) << "Failed to initialize namespace"; + return; + } + + url_ = startup_info.launch_info.url; + runtime_holder_.reset(new RuntimeHolder()); + runtime_holder_->SetMainIsolateShutdownCallback([this]() { Kill(); }); + runtime_holder_->Init( + fdio_ns, + component::ApplicationContext::CreateFrom(std::move(startup_info)), + std::move(request), std::move(bundle)); +} + +ApplicationControllerImpl::~ApplicationControllerImpl() = default; + +constexpr char kServiceRootPath[] = "/svc"; + +fdio_ns_t* ApplicationControllerImpl::SetupNamespace( + component::FlatNamespace* flat) { + fdio_ns_t* fdio_namespc; + zx_status_t status = fdio_ns_create(&fdio_namespc); + if (status != ZX_OK) { + FXL_LOG(ERROR) << "Failed to create namespace"; + return nullptr; + } + for (size_t i = 0; i < flat->paths->size(); ++i) { + if (flat->paths->at(i) == kServiceRootPath) { + // Ownership of /svc goes to the ApplicationContext created above. + continue; + } + zx::channel dir = std::move(flat->directories->at(i)); + zx_handle_t dir_handle = dir.release(); + const char* path = flat->paths->at(i)->data(); + status = fdio_ns_bind(fdio_namespc, path, dir_handle); + if (status != ZX_OK) { + FXL_LOG(ERROR) << "Failed to bind " << flat->paths->at(i) + << " to namespace"; + zx_handle_close(dir_handle); + fdio_ns_destroy(fdio_namespc); + return nullptr; + } + } + return fdio_namespc; +} + +void ApplicationControllerImpl::Kill() { + SendReturnCode(runtime_holder_->return_code()); + runtime_holder_.reset(); + app_->Destroy(this); + // |this| has been deleted at this point. +} + +void ApplicationControllerImpl::Detach() { + binding_.set_error_handler(fxl::Closure()); +} + +void ApplicationControllerImpl::Wait(WaitCallback callback) { + wait_callbacks_.push_back(std::move(callback)); +} + +void ApplicationControllerImpl::SendReturnCode(int32_t return_code) { + for (const auto& iter : wait_callbacks_) { + iter(return_code); + } + wait_callbacks_.clear(); +} + +void ApplicationControllerImpl::CreateView( + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services) { + runtime_holder_->CreateView(url_, std::move(view_owner_request), + std::move(services)); +} + +Dart_Port ApplicationControllerImpl::GetUIIsolateMainPort() { + if (!runtime_holder_) + return ILLEGAL_PORT; + return runtime_holder_->GetUIIsolateMainPort(); +} + +std::string ApplicationControllerImpl::GetUIIsolateName() { + if (!runtime_holder_) { + return ""; + } + return runtime_holder_->GetUIIsolateName(); +} + +} // namespace flutter_runner diff --git a/content_handler/application_controller_impl.h b/content_handler/application_controller_impl.h new file mode 100644 index 0000000000000..01700f2886ffb --- /dev/null +++ b/content_handler/application_controller_impl.h @@ -0,0 +1,76 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ +#define FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ + +#include + +#include + +#include +#include +#include + +#include "lib/fidl/cpp/binding.h" +#include "lib/fidl/cpp/binding_set.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "lib/svc/cpp/service_provider_bridge.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace flutter_runner { +class App; +class RuntimeHolder; + +class ApplicationControllerImpl : public component::ApplicationController, + public views_v1::ViewProvider { + public: + ApplicationControllerImpl( + App* app, + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller); + + ~ApplicationControllerImpl() override; + + // |component::ApplicationController| implementation + + void Kill() override; + void Detach() override; + void Wait(WaitCallback callback) override; + + // |views_v1::ViewProvider| implementation + + void CreateView( + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services) override; + + Dart_Port GetUIIsolateMainPort(); + std::string GetUIIsolateName(); + + private: + void StartRuntimeIfReady(); + void SendReturnCode(int32_t return_code); + + fdio_ns_t* SetupNamespace(component::FlatNamespace* flat); + + App* app_; + fidl::Binding binding_; + + component::ServiceProviderBridge service_provider_bridge_; + + fidl::BindingSet view_provider_bindings_; + + std::string url_; + std::unique_ptr runtime_holder_; + + std::vector wait_callbacks_; + + FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationControllerImpl); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc deleted file mode 100644 index 2d77f43cbdd45..0000000000000 --- a/content_handler/application_runner.cc +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "application_runner.h" - -#include - -#include "flutter/lib/ui/text/font_collection.h" -#include "fuchsia_font_manager.h" -#include "lib/fonts/fidl/font_provider.fidl.h" -#include "lib/icu_data/cpp/icu_data.h" - -namespace flutter { - -ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) - : on_termination_callback_(std::move(on_termination_callback)), - host_context_(component::ApplicationContext::CreateFromStartupInfo()) { - SetupICU(); - - SetupGlobalFonts(); - - const std::string process_label = "flutter"; - zx::process::self().set_property(ZX_PROP_NAME, process_label.c_str(), - process_label.size()); - - host_context_->outgoing_services()->AddService( - std::bind(&ApplicationRunner::RegisterApplication, this, - std::placeholders::_1)); - - active_applications_bindings_.set_empty_set_handler( - [this]() { FireTerminationCallbackIfNecessary(); }); -} - -ApplicationRunner::~ApplicationRunner() { - host_context_->outgoing_services() - ->RemoveService(); -} - -void ApplicationRunner::RegisterApplication( - f1dl::InterfaceRequest request) { - active_applications_bindings_.AddBinding(this, std::move(request)); -} - -void ApplicationRunner::StartApplication( - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller) { - auto thread_application_pair = - Application::Create(*this, // delegate - std::move(package), // application pacakge - std::move(startup_info), // startup info - std::move(controller) // controller request - ); - active_applications_[thread_application_pair.second.get()] = - std::move(thread_application_pair); -} - -void ApplicationRunner::OnApplicationTerminate(const Application* application) { - active_applications_.erase(application); - FireTerminationCallbackIfNecessary(); -} - -void ApplicationRunner::SetupICU() { - if (!icu_data::Initialize(host_context_.get())) { - FXL_LOG(ERROR) << "Could not initialize ICU data."; - } -} - -void ApplicationRunner::SetupGlobalFonts() { - fonts::FontProviderPtr font_provider( - host_context_->ConnectToEnvironmentService()); - auto font_manager = - sk_make_sp(std::move(font_provider)); - blink::FontCollection::ForProcess() - .GetFontCollection() - ->SetDefaultFontManager(std::move(font_manager)); -} - -void ApplicationRunner::FireTerminationCallbackIfNecessary() { - // We have no reason to exist if: - // 1: No previously launched applications are running. - // 2: No bindings exist that may require launching more applications. - if (on_termination_callback_ && active_applications_.size() == 0 && - active_applications_bindings_.size() == 0) { - on_termination_callback_(); - } -} - -} // namespace flutter diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h deleted file mode 100644 index fdf5b4420dc0f..0000000000000 --- a/content_handler/application_runner.h +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include - -#include "application.h" -#include "lib/app/cpp/application_context.h" -#include "lib/app/fidl/application_runner.fidl.h" -#include "lib/fidl/cpp/bindings/binding_set.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/macros.h" - -namespace flutter { - -// Publishes the |component::ApplicationRunner| service and runs applications on -// their own threads. -class ApplicationRunner final : public Application::Delegate, - public component::ApplicationRunner { - public: - ApplicationRunner(fxl::Closure on_termination_callback); - - ~ApplicationRunner(); - - private: - struct ActiveApplication { - std::unique_ptr thread; - std::unique_ptr application; - - ActiveApplication(std::pair, - std::unique_ptr> pair) - : thread(std::move(pair.first)), application(std::move(pair.second)) {} - - ActiveApplication() { - if (thread && application) { - thread->TaskRunner()->PostTask( - fxl::MakeCopyable([application = std::move(application)]() mutable { - application.reset(); - fsl::MessageLoop::GetCurrent()->PostQuitTask(); - })); - thread.reset(); // join - } - } - }; - - fxl::Closure on_termination_callback_; - std::unique_ptr host_context_; - f1dl::BindingSet active_applications_bindings_; - std::unordered_map - active_applications_; - - // |component::ApplicationRunner| - void StartApplication(component::ApplicationPackagePtr application, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest - controller) override; - - void RegisterApplication( - f1dl::InterfaceRequest request); - - void UnregisterApplication(const Application* application); - - // |Application::Delegate| - void OnApplicationTerminate(const Application* application) override; - - void SetupICU(); - - void SetupGlobalFonts(); - - void FireTerminationCallbackIfNecessary(); - - FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationRunner); -}; - -} // namespace flutter diff --git a/content_handler/compositor_context.cc b/content_handler/compositor_context.cc deleted file mode 100644 index efad9ac2b9583..0000000000000 --- a/content_handler/compositor_context.cc +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "compositor_context.h" - -#include "flutter/flow/layers/layer_tree.h" -#include "flutter/glue/trace_event.h" - -namespace flutter { - -class ScopedFrame final : public flow::CompositorContext::ScopedFrame { - public: - ScopedFrame(flow::CompositorContext& context, - bool instrumentation_enabled, - SessionConnection& session_connection) - : flow::CompositorContext::ScopedFrame(context, - nullptr, - nullptr, - instrumentation_enabled), - session_connection_(session_connection) {} - - private: - SessionConnection& session_connection_; - - bool Raster(flow::LayerTree& layer_tree, bool ignore_raster_cache) override { - if (!session_connection_.has_metrics()) { - return true; - } - - { - // Preroll the Flutter layer tree. This allows Flutter to perform - // pre-paint optimizations. - TRACE_EVENT0("flutter", "Preroll"); - layer_tree.Preroll(*this, true /* ignore raster cache */); - } - - { - // Traverse the Flutter layer tree so that the necessary session ops to - // represent the frame are enqueued in the underlying session. - TRACE_EVENT0("flutter", "UpdateScene"); - layer_tree.UpdateScene(session_connection_.scene_update_context(), - session_connection_.root_node()); - } - - { - // Flush all pending session ops. - TRACE_EVENT0("flutter", "SessionPresent"); - session_connection_.Present(*this); - } - - return true; - } - - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); -}; - -CompositorContext::CompositorContext( - const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback) - : debug_label_(std::move(debug_label)), - session_connection_(scenic, - debug_label_, - std::move(import_token), - std::move(session_metrics_did_change_callback), - std::move(session_error_callback)) {} - -CompositorContext::~CompositorContext() = default; - -std::unique_ptr -CompositorContext::AcquireFrame(GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled) { - // TODO: The AcquireFrame interface is too broad and must be refactored to get - // rid of the context and canvas arguments as those seem to be only used for - // colorspace correctness purposes on the mobile shells. - return std::make_unique(*this, // - instrumentation_enabled, // - session_connection_ // - ); -} - -} // namespace flutter diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h deleted file mode 100644 index a6e5429c6072c..0000000000000 --- a/content_handler/compositor_context.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "flutter/flow/compositor_context.h" -#include "garnet/public/lib/ui/scenic/fidl/scenic.fidl-common.h" -#include "lib/fxl/macros.h" -#include "session_connection.h" - -namespace flutter { - -// Holds composition specific state and bindings specific to composition on -// Fuchsia. -class CompositorContext final : public flow::CompositorContext { - public: - CompositorContext(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback); - - ~CompositorContext() override; - - private: - const std::string debug_label_; - SessionConnection session_connection_; - - // |flow::CompositorContext| - std::unique_ptr AcquireFrame( - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled) override; - - FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); -}; - -} // namespace flutter diff --git a/content_handler/engine.cc b/content_handler/engine.cc deleted file mode 100644 index 3349c09bdf1af..0000000000000 --- a/content_handler/engine.cc +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "engine.h" - -#include - -#include "flutter/common/task_runners.h" -#include "flutter/fml/task_runner.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/run_configuration.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "platform_view.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace flutter { - -Engine::Engine(Delegate& delegate, - std::string thread_label, - component::ApplicationContext& application_context, - blink::Settings settings, - f1dl::InterfaceRequest view_owner, - const UniqueFDIONS& fdio_ns, - f1dl::InterfaceRequest - outgoing_services_request) - : delegate_(delegate), - thread_label_(std::move(thread_label)), - settings_(std::move(settings)), - weak_factory_(this) { - // Launch the threads that will be used to run the shell. These threads will - // be joined in the destructor. - for (auto& thread : host_threads_) { - thread.Run(); - } - - mozart::ViewManagerPtr view_manager; - application_context.ConnectToEnvironmentService(view_manager.NewRequest()); - - zx::eventpair import_token, export_token; - if (zx::eventpair::create(0u, &import_token, &export_token) != ZX_OK) { - FXL_DLOG(ERROR) << "Could not create event pair."; - return; - } - - // Setup the session connection. - ui::ScenicPtr scenic; - view_manager->GetScenic(scenic.NewRequest()); - - // Grab the parent environent services. The platform view may want to access - // some of these services. - component::ServiceProviderPtr parent_environment_service_provider; - application_context.environment()->GetServices( - parent_environment_service_provider.NewRequest()); - - // We need to manually schedule a frame when the session metrics change. - OnMetricsUpdate on_session_metrics_change_callback = std::bind( - &Engine::OnSessionMetricsDidChange, this, std::placeholders::_1); - - fxl::Closure on_session_error_callback = std::bind(&Engine::Terminate, this); - - // Grab the accessibilty context writer that can understand the semtics tree - // on the platform view. - maxwell::ContextWriterPtr accessibility_context_writer; - application_context.ConnectToEnvironmentService( - accessibility_context_writer.NewRequest()); - - // Setup the callback that will instantiate the platform view. - shell::Shell::CreateCallback on_create_platform_view = - fxl::MakeCopyable([debug_label = thread_label_, // - parent_environment_service_provider = - std::move(parent_environment_service_provider), // - view_manager = std::ref(view_manager), // - view_owner = std::move(view_owner), // - scenic = std::move(scenic), // - accessibility_context_writer = - std::move(accessibility_context_writer), // - export_token = std::move(export_token), // - import_token = std::move(import_token), // - on_session_metrics_change_callback, // - on_session_error_callback // - ](shell::Shell& shell) mutable { - return std::make_unique( - shell, // delegate - debug_label, // debug label - shell.GetTaskRunners(), // task runners - std::move(parent_environment_service_provider), // services - view_manager, // view manager - std::move(view_owner), // view owner - std::move(scenic), // scenic - std::move(export_token), // export token - std::move(import_token), // import token - std::move( - accessibility_context_writer), // accessibility context writer - std::move(on_session_metrics_change_callback), // metrics change - std::move(on_session_error_callback) // session_error - ); - }); - - // Setup the callback that will instantiate the rasterizer. - shell::Shell::CreateCallback on_create_rasterizer = - [](shell::Shell& shell) { - return std::make_unique( - shell.GetTaskRunners() // task runners - ); - }; - - // Get the task runners from the managed threads. The current thread will be - // used as the "platform" thread. - blink::TaskRunners task_runners( - thread_label_, // Dart thread labels - fsl::MessageLoop::GetCurrent()->task_runner(), // platform - host_threads_[0].TaskRunner(), // gpu - host_threads_[1].TaskRunner(), // ui - host_threads_[2].TaskRunner() // io - ); - - settings_.root_isolate_create_callback = - std::bind(&Engine::OnMainIsolateStart, this); - - settings_.root_isolate_shutdown_callback = - std::bind([weak = weak_factory_.GetWeakPtr(), - runner = task_runners.GetPlatformTaskRunner()]() { - runner->PostTask([weak = std::move(weak)] { - if (weak) { - weak->OnMainIsolateShutdown(); - } - }); - }); - - shell_ = shell::Shell::Create( - task_runners, // host task runners - settings_, // shell launch settings - on_create_platform_view, // platform view create callback - on_create_rasterizer // rasterizer create callback - ); - - if (!shell_) { - FXL_LOG(ERROR) << "Could not launch the shell with settings: " - << settings_.ToString(); - return; - } - - // Shell has been created. Before we run the engine, setup the isolate - // configurator. - { - PlatformView* platform_view = - static_cast(shell_->GetPlatformView().get()); - auto& view = platform_view->GetMozartView(); - component::ApplicationEnvironmentPtr application_environment; - application_context.ConnectToEnvironmentService( - application_environment.NewRequest()); - - isolate_configurator_ = std::make_unique( - fdio_ns, // - view, // - std::move(application_environment), // - std::move(outgoing_services_request) // - ); - } - - // This platform does not get a separate surface platform view creation - // notification. Fire one eagerly. - shell_->GetPlatformView()->NotifyCreated(); - - // Launch the engine in the appropriate configuration. - auto run_configuration = - shell::RunConfiguration::InferFromSettings(settings_); - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = shell_->GetEngine(), // - run_configuration = std::move(run_configuration) // - ]() mutable { - if (!engine || !engine->Run(std::move(run_configuration))) { - FXL_LOG(ERROR) << "Could not (re)launch the engine in configuration"; - } - })); - - UpdateNativeThreadLabelNames(); -} - -Engine::~Engine() { - for (const auto& thread : host_threads_) { - thread.TaskRunner()->PostTask( - []() { fsl::MessageLoop::GetCurrent()->PostQuitTask(); }); - } -} - -void Engine::UpdateNativeThreadLabelNames() const { - auto set_thread_name = [](fxl::RefPtr runner, - std::string prefix, std::string suffix) { - runner->PostTask([name = prefix + suffix]() { - zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); - }); - }; - auto runners = shell_->GetTaskRunners(); - set_thread_name(runners.GetPlatformTaskRunner(), thread_label_, ".platform"); - set_thread_name(runners.GetUITaskRunner(), thread_label_, ".ui"); - set_thread_name(runners.GetGPUTaskRunner(), thread_label_, ".gpu"); - set_thread_name(runners.GetIOTaskRunner(), thread_label_, ".io"); -} - -std::pair Engine::GetEngineReturnCode() const { - std::pair code(false, 0); - if (!shell_) { - return code; - } - fxl::AutoResetWaitableEvent latch; - fml::TaskRunner::RunNowOrPostTask( - shell_->GetTaskRunners().GetUITaskRunner(), - [&latch, &code, engine = shell_->GetEngine()]() { - if (engine) { - code = engine->GetUIIsolateReturnCode(); - } - latch.Signal(); - }); - latch.Wait(); - return code; -} - -void Engine::OnMainIsolateStart() { - if (!isolate_configurator_ || - !isolate_configurator_->ConfigureCurrentIsolate()) { - FXL_LOG(ERROR) << "Could not configure some native embedder bindings for a " - "new root isolate."; - } -} - -void Engine::OnMainIsolateShutdown() { - Terminate(); -} - -void Engine::Terminate() { - delegate_.OnEngineTerminate(this); - // Warning. Do not do anything after this point as the delegate may have - // collected this object. -} - -void Engine::OnSessionMetricsDidChange(double device_pixel_ratio) { - if (!shell_) { - return; - } - - shell_->GetTaskRunners().GetPlatformTaskRunner()->PostTask( - [platform_view = shell_->GetPlatformView(), device_pixel_ratio]() { - if (platform_view) { - reinterpret_cast(platform_view.get()) - ->UpdateViewportMetrics(device_pixel_ratio); - } - }); -} - -} // namespace flutter diff --git a/content_handler/engine.h b/content_handler/engine.h deleted file mode 100644 index 60c0ad7c2f80d..0000000000000 --- a/content_handler/engine.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "flutter/shell/common/shell.h" -#include "isolate_configurator.h" -#include "lib/app/cpp/application_context.h" -#include "lib/fsl/threading/thread.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/ui/views/fidl/view_manager.fidl.h" - -namespace flutter { - -// Represents an instance of running Flutter engine along with the threads that -// host the same. -class Engine final { - public: - class Delegate { - public: - virtual void OnEngineTerminate(const Engine* holder) = 0; - }; - - Engine(Delegate& delegate, - std::string thread_label, - component::ApplicationContext& application_context, - blink::Settings settings, - f1dl::InterfaceRequest view_owner, - const UniqueFDIONS& fdio_ns, - f1dl::InterfaceRequest - outgoing_services_request); - - ~Engine(); - - // Returns the Dart return code for the root isolate if one is present. This - // call is thread safe and synchronous. This call must be made infrequently. - std::pair GetEngineReturnCode() const; - - private: - Delegate& delegate_; - const std::string thread_label_; - blink::Settings settings_; - std::array host_threads_; - std::unique_ptr isolate_configurator_; - std::unique_ptr shell_; - fxl::WeakPtrFactory weak_factory_; - - void OnMainIsolateStart(); - - void OnMainIsolateShutdown(); - - void Terminate(); - - void OnSessionMetricsDidChange(double device_pixel_ratio); - - void UpdateNativeThreadLabelNames() const; - - FXL_DISALLOW_COPY_AND_ASSIGN(Engine); -}; - -} // namespace flutter diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc index 877c931130eb4..4e409cae94f6a 100644 --- a/content_handler/fuchsia_font_manager.cc +++ b/content_handler/fuchsia_font_manager.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "fuchsia_font_manager.h" +#include "flutter/content_handler/fuchsia_font_manager.h" #include @@ -32,14 +32,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { - if (!fsl::SizedVmo::IsSizeValid(vmo->vmo, vmo->size) || - vmo->size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromBuffer(mem::Buffer data) { + if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || + data.size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = vmo->size; + uint64_t size = data.size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, vmo->vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -49,7 +49,7 @@ sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { fonts::FontSlant ToFontSlant(SkFontStyle::Slant slant) { return (slant == SkFontStyle::kItalic_Slant) ? fonts::FontSlant::ITALIC - : fonts::FontSlant::UPRIGHT; + : fonts::FontSlant::UPRIGHT; } } // anonymous namespace @@ -64,8 +64,7 @@ int FuchsiaFontManager::onCountFamilies() const { return 0; } -void FuchsiaFontManager::onGetFamilyName(int index, - SkString* familyName) const { +void FuchsiaFontManager::onGetFamilyName(int index, SkString* familyName) const { FXL_DCHECK(false); } @@ -88,13 +87,12 @@ SkFontStyleSet* FuchsiaFontManager::onMatchFamily( } SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( - const char family_name[], - const SkFontStyle& style) const { - auto request = fonts::FontRequest::New(); - request->family = family_name; - request->weight = style.weight(); - request->width = style.width(); - request->slant = ToFontSlant(style.slant()); + const char family_name[], const SkFontStyle& style) const { + fonts::FontRequest request; + request.family = family_name; + request.weight = style.weight(); + request.width = style.width(); + request.slant = ToFontSlant(style.slant()); fonts::FontResponsePtr response; font_provider_->GetFont( @@ -102,13 +100,14 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( [&response](fonts::FontResponsePtr r) { response = std::move(r); }); font_provider_.WaitForResponse(); - if (!response) { - FXL_DLOG(ERROR) << "Unable to contact the font provider. Did you run " - "Flutter in an environment that has a font manager?"; + FXL_DCHECK(response) + << "Unable to contact the font provider. Did you run " + "Flutter in an environment that has a font manager?\n"; + + if (!response) return nullptr; - } - sk_sp data = MakeSkDataFromVMO(response->data->vmo); + sk_sp data = MakeSkDataFromBuffer(std::move(response->data.buffer)); if (!data) return nullptr; @@ -128,13 +127,13 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyleCharacter( } SkTypeface* FuchsiaFontManager::onMatchFaceStyle(const SkTypeface*, - const SkFontStyle&) const { + const SkFontStyle&) const { FXL_DCHECK(false); return nullptr; } sk_sp FuchsiaFontManager::onMakeFromData(sk_sp, - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } @@ -154,7 +153,7 @@ sk_sp FuchsiaFontManager::onMakeFromStreamArgs( } sk_sp FuchsiaFontManager::onMakeFromFile(const char path[], - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } diff --git a/content_handler/fuchsia_font_manager.h b/content_handler/fuchsia_font_manager.h index ecfb724b85878..e57d6ef76e72f 100644 --- a/content_handler/fuchsia_font_manager.h +++ b/content_handler/fuchsia_font_manager.h @@ -26,7 +26,7 @@ namespace txt { -class FuchsiaFontManager final : public SkFontMgr { +class FuchsiaFontManager : public SkFontMgr { public: FuchsiaFontManager(fonts::FontProviderPtr provider); diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc deleted file mode 100644 index d085bea698b95..0000000000000 --- a/content_handler/isolate_configurator.cc +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "isolate_configurator.h" - -#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" -#include "dart-pkg/zircon/sdk_ext/handle.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace flutter { - -IsolateConfigurator::IsolateConfigurator( - const UniqueFDIONS& fdio_ns, - mozart::ViewPtr& view, - component::ApplicationEnvironmentPtr application_environment, - f1dl::InterfaceRequest - outgoing_services_request) - : fdio_ns_(fdio_ns), - view_(view), - application_environment_(std::move(application_environment)), - outgoing_services_request_(std::move(outgoing_services_request)) {} - -IsolateConfigurator::~IsolateConfigurator() = default; - -bool IsolateConfigurator::ConfigureCurrentIsolate() { - if (used_) { - return false; - } - used_ = true; - - BindFuchsia(); - BindZircon(); - BindDartIO(); - BindScenic(); - - return true; -} - -// |mozart::NativesDelegate| -mozart::View* IsolateConfigurator::GetMozartView() { - return view_.get(); -} - -void IsolateConfigurator::BindFuchsia() { - fuchsia::dart::Initialize(application_environment_.Unbind(), - std::move(outgoing_services_request_)); -} - -void IsolateConfigurator::BindZircon() { - // Tell dart:zircon about the FDIO namespace configured for this instance. - Dart_Handle zircon_lib = Dart_LookupLibrary(tonic::ToDart("dart:zircon")); - DART_CHECK_VALID(zircon_lib); - - Dart_Handle namespace_type = - Dart_GetType(zircon_lib, tonic::ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - DART_CHECK_VALID( - Dart_SetField(namespace_type, // - tonic::ToDart("_namespace"), // - tonic::ToDart(reinterpret_cast(fdio_ns_.get())))); -} - -void IsolateConfigurator::BindDartIO() { - // Grab the dart:io lib. - Dart_Handle io_lib = Dart_LookupLibrary(tonic::ToDart("dart:io")); - DART_CHECK_VALID(io_lib); - - // Disable dart:io exit() - Dart_Handle embedder_config_type = - Dart_GetType(io_lib, tonic::ToDart("_EmbedderConfig"), 0, nullptr); - DART_CHECK_VALID(embedder_config_type); - DART_CHECK_VALID(Dart_SetField(embedder_config_type, - tonic::ToDart("_mayExit"), Dart_False())); - - // Tell dart:io about the FDIO namespace configured for this instance. - Dart_Handle namespace_type = - Dart_GetType(io_lib, tonic::ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - Dart_Handle namespace_args[] = { - Dart_NewInteger(reinterpret_cast(fdio_ns_.get())), // - }; - DART_CHECK_VALID(namespace_args[0]); - DART_CHECK_VALID(Dart_Invoke(namespace_type, tonic::ToDart("_setupNamespace"), - 1, namespace_args)); -} - -void IsolateConfigurator::BindScenic() { - Dart_Handle mozart_internal = - Dart_LookupLibrary(tonic::ToDart("dart:mozart.internal")); - DART_CHECK_VALID(mozart_internal); - DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, // - mozart::NativeLookup, // - mozart::NativeSymbol) // - ); - DART_CHECK_VALID(Dart_SetField( - mozart_internal, // - tonic::ToDart("_context"), // - tonic::DartConverter::ToDart(reinterpret_cast( - static_cast(this))))); - mozart::ViewContainerPtr view_container; - view_->GetContainer(view_container.NewRequest()); - DART_CHECK_VALID( - Dart_SetField(mozart_internal, // - tonic::ToDart("_viewContainer"), // - tonic::ToDart(zircon::dart::Handle::Create( - view_container.Unbind().TakeChannel().release())))); -} - -} // namespace flutter diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h deleted file mode 100644 index a5da083633ee7..0000000000000 --- a/content_handler/isolate_configurator.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "lib/app/fidl/application_environment.fidl.h" -#include "lib/fxl/macros.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" -#include "lib/ui/views/fidl/view_containers.fidl.h" -#include "lib/ui/views/fidl/views.fidl.h" -#include "unique_fdio_ns.h" - -namespace flutter { - -// Contains all the information necessary to configure a new root isolate. This -// is a single use item. The lifetime of this object must extend past that of -// the root isolate. -class IsolateConfigurator final : mozart::NativesDelegate { - public: - IsolateConfigurator( - const UniqueFDIONS& fdio_ns, - mozart::ViewPtr& view, - component::ApplicationEnvironmentPtr application_environment, - f1dl::InterfaceRequest - outgoing_services_request); - - ~IsolateConfigurator(); - - // Can be used only once and only on the UI thread with the newly created - // isolate already current. - bool ConfigureCurrentIsolate(); - - private: - bool used_ = false; - const UniqueFDIONS& fdio_ns_; - mozart::ViewPtr& view_; - component::ApplicationEnvironmentPtr application_environment_; - f1dl::InterfaceRequest outgoing_services_request_; - - // |mozart::NativesDelegate| - mozart::View* GetMozartView() override; - - void BindFuchsia(); - - void BindZircon(); - - void BindDartIO(); - - void BindScenic(); - - FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfigurator); -}; - -} // namespace flutter diff --git a/content_handler/main.cc b/content_handler/main.cc index 15b8cede5b9b2..d3eac3c81dcbf 100644 --- a/content_handler/main.cc +++ b/content_handler/main.cc @@ -1,26 +1,16 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Copyright 2016 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. #include -#include -#include "application_runner.h" +#include "flutter/content_handler/app.h" #include "lib/fsl/tasks/message_loop.h" -int main(int argc, char const* argv[]) { +int main(int argc, const char** argv) { fsl::MessageLoop loop; - trace::TraceProvider provider(loop.async()); - FXL_DCHECK(provider.is_valid()) << "Trace provider must be valid."; - - FXL_LOG(INFO) << "Flutter application services initialized."; - flutter::ApplicationRunner runner([&loop]() { - loop.PostQuitTask(); - FXL_LOG(INFO) << "Flutter application services terminated. Good bye..."; - }); - + flutter_runner::App app; loop.Run(); - - return EXIT_SUCCESS; + return 0; } diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc deleted file mode 100644 index 8ac41613e449b..0000000000000 --- a/content_handler/platform_view.cc +++ /dev/null @@ -1,551 +0,0 @@ -// Copyright 2018 The Fuchsia 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 RAPIDJSON_HAS_STDSTRING 1 - -#include "platform_view.h" - -#include - -#include "flutter/lib/ui/window/pointer_data.h" -#include "lib/app/cpp/connect.h" -#include "third_party/rapidjson/rapidjson/document.h" -#include "third_party/rapidjson/rapidjson/stringbuffer.h" -#include "third_party/rapidjson/rapidjson/writer.h" - -namespace flutter { - -constexpr char kFlutterPlatformChannel[] = "flutter/platform"; -constexpr char kTextInputChannel[] = "flutter/textinput"; -constexpr char kKeyEventChannel[] = "flutter/keyevent"; - -PlatformView::PlatformView( - PlatformView::Delegate& delegate, - std::string debug_label, - blink::TaskRunners task_runners, - component::ServiceProviderPtr parent_environment_service_provider, - mozart::ViewManagerPtr& view_manager, - f1dl::InterfaceRequest view_owner, - ui::ScenicPtr scenic, - zx::eventpair export_token, - zx::eventpair import_token, - maxwell::ContextWriterPtr accessibility_context_writer, - OnMetricsUpdate on_session_metrics_did_change, - fxl::Closure session_error_callback) - : shell::PlatformView(delegate, std::move(task_runners)), - debug_label_(std::move(debug_label)), - view_listener_(this), - input_listener_(this), - ime_client_(this), - scenic_(std::move(scenic)), - accessibility_bridge_(std::move(accessibility_context_writer)), - surface_( - std::make_unique(scenic_, - debug_label_, - std::move(import_token), - std::move(on_session_metrics_did_change), - std::move(session_error_callback))) { - // Create the view. - view_manager->CreateView(view_.NewRequest(), // view - std::move(view_owner), // view owner - view_listener_.NewBinding(), // view listener - std::move(export_token), // export token - debug_label_ // diagnostic label - ); - - // Get the services from the created view. - component::ServiceProviderPtr service_provider; - view_->GetServiceProvider(service_provider.NewRequest()); - - // Get the input connection from the services of the view. - component::ConnectToService(service_provider.get(), - input_connection_.NewRequest()); - - // Set the input listener on the input connection. - input_connection_->SetEventListener(input_listener_.NewBinding()); - - // Access the clipboard. - component::ConnectToService(parent_environment_service_provider.get(), - clipboard_.NewRequest()); - - // Finally! Register the native platform message handlers. - RegisterPlatformMessageHandlers(); -} - -PlatformView::~PlatformView() = default; - -void PlatformView::RegisterPlatformMessageHandlers() { - platform_message_handlers_[kFlutterPlatformChannel] = - std::bind(&PlatformView::HandleFlutterPlatformChannelPlatformMessage, // - this, // - std::placeholders::_1); - platform_message_handlers_[kTextInputChannel] = - std::bind(&PlatformView::HandleFlutterTextInputChannelPlatformMessage, // - this, // - std::placeholders::_1); -} - -mozart::ViewPtr& PlatformView::GetMozartView() { - return view_; -} - -// |mozart::ViewListener| -void PlatformView::OnPropertiesChanged( - mozart::ViewPropertiesPtr properties, - const OnPropertiesChangedCallback& callback) { - UpdateViewportMetrics(properties->view_layout); - callback(); -} - -void PlatformView::UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout) { - if (!layout) { - return; - } - - metrics_.size.width = layout->size->width; - metrics_.size.height = layout->size->height; - - metrics_.padding.left = layout->inset->left; - metrics_.padding.top = layout->inset->top; - metrics_.padding.right = layout->inset->right; - metrics_.padding.bottom = layout->inset->bottom; - - FlushViewportMetrics(); -} - -void PlatformView::UpdateViewportMetrics(double pixel_ratio) { - metrics_.scale = pixel_ratio; - - FlushViewportMetrics(); -} - -void PlatformView::FlushViewportMetrics() { - const auto scale = metrics_.scale; - blink::ViewportMetrics metrics = { - .device_pixel_ratio = static_cast(scale), - - .physical_width = static_cast(metrics_.size.width * scale), - .physical_height = static_cast(metrics_.size.height * scale), - - .physical_padding_top = - static_cast(metrics_.padding.top * scale), - .physical_padding_right = - static_cast(metrics_.padding.right * scale), - .physical_padding_bottom = - static_cast(metrics_.padding.bottom * scale), - .physical_padding_left = - static_cast(metrics_.padding.left * scale), - - .physical_view_inset_top = - static_cast(metrics_.view_inset.top * scale), - .physical_view_inset_right = - static_cast(metrics_.view_inset.right * scale), - .physical_view_inset_bottom = - static_cast(metrics_.view_inset.bottom * scale), - .physical_view_inset_left = - static_cast(metrics_.view_inset.left * scale), - }; - - SetViewportMetrics(metrics); -} - -// |mozart::InputMethodEditorClient| -void PlatformView::DidUpdateState(mozart::TextInputStatePtr state, - mozart::InputEventPtr event) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - rapidjson::Value encoded_state(rapidjson::kObjectType); - encoded_state.AddMember("text", state->text.get(), allocator); - encoded_state.AddMember("selectionBase", state->selection->base, allocator); - encoded_state.AddMember("selectionExtent", state->selection->extent, - allocator); - switch (state->selection->affinity) { - case mozart::TextAffinity::UPSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.upstream"), - allocator); - break; - case mozart::TextAffinity::DOWNSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.downstream"), - allocator); - break; - } - encoded_state.AddMember("selectionIsDirectional", true, allocator); - encoded_state.AddMember("composingBase", state->composing->start, allocator); - encoded_state.AddMember("composingExtent", state->composing->end, allocator); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - args.PushBack(encoded_state, allocator); - - document.SetObject(); - document.AddMember("method", - rapidjson::Value("TextInputClient.updateEditingState"), - allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, // channel - std::vector(data, data + buffer.GetSize()), // message - nullptr) // response - ); -} - -// |mozart::InputMethodEditorClient| -void PlatformView::OnAction(mozart::InputMethodAction action) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - - // Done is currently the only text input action defined by Flutter. - args.PushBack("TextInputAction.done", allocator); - - document.SetObject(); - document.AddMember( - "method", rapidjson::Value("TextInputClient.performAction"), allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, // channel - std::vector(data, data + buffer.GetSize()), // message - nullptr) // response - ); -} - -// |mozart::InputListener| -void PlatformView::OnEvent(mozart::InputEventPtr event, - const OnEventCallback& callback) { - using Type = mozart::InputEvent::Tag; - switch (event->which()) { - case Type::POINTER: - callback(OnHandlePointerEvent(event->get_pointer())); - return; - case Type::KEYBOARD: - callback(OnHandleKeyboardEvent(event->get_keyboard())); - return; - case Type::FOCUS: - callback(OnHandleFocusEvent(event->get_focus())); - return; - case Type::__UNKNOWN__: - break; - } - - callback(false); -} - -static blink::PointerData::Change GetChangeFromPointerEventPhase( - mozart::PointerEvent::Phase phase) { - switch (phase) { - case mozart::PointerEvent::Phase::ADD: - return blink::PointerData::Change::kAdd; - case mozart::PointerEvent::Phase::HOVER: - return blink::PointerData::Change::kHover; - case mozart::PointerEvent::Phase::DOWN: - return blink::PointerData::Change::kDown; - case mozart::PointerEvent::Phase::MOVE: - return blink::PointerData::Change::kMove; - case mozart::PointerEvent::Phase::UP: - return blink::PointerData::Change::kUp; - case mozart::PointerEvent::Phase::REMOVE: - return blink::PointerData::Change::kRemove; - case mozart::PointerEvent::Phase::CANCEL: - return blink::PointerData::Change::kCancel; - default: - return blink::PointerData::Change::kCancel; - } -} - -static blink::PointerData::DeviceKind GetKindFromPointerType( - mozart::PointerEvent::Type type) { - switch (type) { - case mozart::PointerEvent::Type::TOUCH: - return blink::PointerData::DeviceKind::kTouch; - case mozart::PointerEvent::Type::MOUSE: - return blink::PointerData::DeviceKind::kMouse; - default: - return blink::PointerData::DeviceKind::kTouch; - } -} - -bool PlatformView::OnHandlePointerEvent( - const mozart::PointerEventPtr& pointer) { - blink::PointerData pointer_data; - pointer_data.time_stamp = pointer->event_time / 1000; - pointer_data.change = GetChangeFromPointerEventPhase(pointer->phase); - pointer_data.kind = GetKindFromPointerType(pointer->type); - pointer_data.device = pointer->pointer_id; - pointer_data.physical_x = pointer->x * metrics_.scale; - pointer_data.physical_y = pointer->y * metrics_.scale; - - switch (pointer_data.change) { - case blink::PointerData::Change::kDown: - down_pointers_.insert(pointer_data.device); - break; - case blink::PointerData::Change::kCancel: - case blink::PointerData::Change::kUp: - down_pointers_.erase(pointer_data.device); - break; - case blink::PointerData::Change::kMove: - if (down_pointers_.count(pointer_data.device) == 0) { - pointer_data.change = blink::PointerData::Change::kHover; - } - break; - case blink::PointerData::Change::kAdd: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received add event for down pointer."; - } - break; - case blink::PointerData::Change::kRemove: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received remove event for down pointer."; - } - break; - case blink::PointerData::Change::kHover: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received hover event for down pointer."; - } - break; - } - - auto packet = std::make_unique(1); - packet->SetPointerData(0, pointer_data); - DispatchPointerDataPacket(std::move(packet)); - return true; -} - -bool PlatformView::OnHandleKeyboardEvent( - const mozart::KeyboardEventPtr& keyboard) { - const char* type = nullptr; - if (keyboard->phase == mozart::KeyboardEvent::Phase::PRESSED) { - type = "keydown"; - } else if (keyboard->phase == mozart::KeyboardEvent::Phase::REPEAT) { - type = "keydown"; // TODO change this to keyrepeat - } else if (keyboard->phase == mozart::KeyboardEvent::Phase::RELEASED) { - type = "keyup"; - } - - if (type == nullptr) { - FXL_DLOG(ERROR) << "Unknown key event phase."; - return false; - } - - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - document.SetObject(); - document.AddMember("type", rapidjson::Value(type, strlen(type)), allocator); - document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); - document.AddMember("hidUsage", keyboard->hid_usage, allocator); - document.AddMember("codePoint", keyboard->code_point, allocator); - document.AddMember("modifiers", keyboard->modifiers, allocator); - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - DispatchPlatformMessage(fxl::MakeRefCounted( - kKeyEventChannel, // channel - std::vector(data, data + buffer.GetSize()), // data - nullptr) // response - ); - - return true; -} - -bool PlatformView::OnHandleFocusEvent(const mozart::FocusEventPtr& focus) { - if (!focus->focused && current_text_input_client_ != 0) { - current_text_input_client_ = 0; - if (ime_) { - ime_->Hide(); - ime_ = nullptr; - } - if (ime_client_.is_bound()) { - ime_client_.Unbind(); - } - return true; - } - return false; -} - -// |shell::PlatformView| -std::unique_ptr PlatformView::CreateRenderingSurface() { - // This platform does not repeatly lose and gain a surface connection. So the - // surface is setup once during platform view setup and and returned to the - // shell on the initial (and only) |NotifyCreated| call. - return std::move(surface_); -} - -// |shell::PlatformView| -void PlatformView::HandlePlatformMessage( - fxl::RefPtr message) { - if (!message) { - return; - } - auto found = platform_message_handlers_.find(message->channel()); - if (found == platform_message_handlers_.end()) { - FXL_DLOG(ERROR) - << "Platform view received message on channel '" << message->channel() - << "' with no registed handler. And empty response will be generated. " - "Please implement the native message handler."; - PlatformView::HandlePlatformMessage(std::move(message)); - return; - } - found->second(std::move(message)); -} - -// |shell::PlatformView| -void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) { - accessibility_bridge_.UpdateSemantics(update); -} - -// Channel handler for kFlutterPlatformChannel -void PlatformView::HandleFlutterPlatformChannelPlatformMessage( - fxl::RefPtr message) { - FXL_DCHECK(message->channel() == kFlutterPlatformChannel); - const auto& data = message->data(); - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) { - return; - } - - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) { - return; - } - - fxl::RefPtr response = message->response(); - if (method->value == "Clipboard.setData") { - auto text = root["args"]["text"].GetString(); - clipboard_->Push(text); - response->CompleteEmpty(); - } else if (method->value == "Clipboard.getData") { - clipboard_->Peek([response](const f1dl::String& text) { - rapidjson::StringBuffer json_buffer; - rapidjson::Writer writer(json_buffer); - writer.StartArray(); - writer.StartObject(); - writer.Key("text"); - writer.String(text); - writer.EndObject(); - writer.EndArray(); - std::string result = json_buffer.GetString(); - response->Complete(std::vector{result.begin(), result.end()}); - }); - } else { - response->CompleteEmpty(); - } -} - -// Channel handler for kTextInputChannel -void PlatformView::HandleFlutterTextInputChannelPlatformMessage( - fxl::RefPtr message) { - FXL_DCHECK(message->channel() == kTextInputChannel); - const auto& data = message->data(); - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) { - return; - } - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) { - return; - } - - if (method->value == "TextInput.show") { - if (ime_) { - ime_->Show(); - } - } else if (method->value == "TextInput.hide") { - if (ime_) { - ime_->Hide(); - } - } else if (method->value == "TextInput.setClient") { - current_text_input_client_ = 0; - if (ime_client_.is_bound()) - ime_client_.Unbind(); - ime_ = nullptr; - - auto args = root.FindMember("args"); - if (args == root.MemberEnd() || !args->value.IsArray() || - args->value.Size() != 2) - return; - const auto& configuration = args->value[1]; - if (!configuration.IsObject()) { - return; - } - // TODO(abarth): Read the keyboard type from the configuration. - current_text_input_client_ = args->value[0].GetInt(); - mozart::TextInputStatePtr state = mozart::TextInputState::New(); - state->text = std::string(); - state->selection = mozart::TextSelection::New(); - state->composing = mozart::TextRange::New(); - input_connection_->GetInputMethodEditor( - mozart::KeyboardType::TEXT, mozart::InputMethodAction::DONE, - std::move(state), ime_client_.NewBinding(), ime_.NewRequest()); - } else if (method->value == "TextInput.setEditingState") { - if (ime_) { - auto args_it = root.FindMember("args"); - if (args_it == root.MemberEnd() || !args_it->value.IsObject()) { - return; - } - const auto& args = args_it->value; - mozart::TextInputStatePtr state = mozart::TextInputState::New(); - state->selection = mozart::TextSelection::New(); - state->composing = mozart::TextRange::New(); - // TODO(abarth): Deserialize state. - auto text = args.FindMember("text"); - if (text != args.MemberEnd() && text->value.IsString()) - state->text = text->value.GetString(); - auto selection_base = args.FindMember("selectionBase"); - if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) - state->selection->base = selection_base->value.GetInt(); - auto selection_extent = args.FindMember("selectionExtent"); - if (selection_extent != args.MemberEnd() && - selection_extent->value.IsInt()) - state->selection->extent = selection_extent->value.GetInt(); - auto selection_affinity = args.FindMember("selectionAffinity"); - if (selection_affinity != args.MemberEnd() && - selection_affinity->value.IsString() && - selection_affinity->value == "TextAffinity.upstream") - state->selection->affinity = mozart::TextAffinity::UPSTREAM; - else - state->selection->affinity = mozart::TextAffinity::DOWNSTREAM; - // We ignore selectionIsDirectional because that concept doesn't exist on - // Fuchsia. - auto composing_base = args.FindMember("composingBase"); - if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) - state->composing->start = composing_base->value.GetInt(); - auto composing_extent = args.FindMember("composingExtent"); - if (composing_extent != args.MemberEnd() && - composing_extent->value.IsInt()) - state->composing->end = composing_extent->value.GetInt(); - ime_->SetState(std::move(state)); - } - } else if (method->value == "TextInput.clearClient") { - current_text_input_client_ = 0; - if (ime_client_.is_bound()) - ime_client_.Unbind(); - ime_ = nullptr; - } else { - FXL_DLOG(ERROR) << "Unknown " << message->channel() << " method " - << method->value.GetString(); - } -} - -} // namespace flutter diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h deleted file mode 100644 index 9888d061352bb..0000000000000 --- a/content_handler/platform_view.h +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include - -#include "accessibility_bridge.h" -#include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/shell/common/platform_view.h" -#include "lib/clipboard/fidl/clipboard.fidl.h" -#include "lib/fidl/cpp/bindings/binding.h" -#include "lib/fxl/macros.h" -#include "lib/ui/input/fidl/input_connection.fidl.h" -#include "lib/ui/views/fidl/view_manager.fidl.h" -#include "lib/ui/views/fidl/views.fidl.h" -#include "surface.h" - -namespace flutter { - -// The per engine component residing on the platform thread is responsible for -// all platform specific integrations. -class PlatformView final : public shell::PlatformView, - public mozart::ViewListener, - public mozart::InputMethodEditorClient, - public mozart::InputListener { - public: - PlatformView( - PlatformView::Delegate& delegate, - std::string debug_label, - blink::TaskRunners task_runners, - component::ServiceProviderPtr parent_environment_service_provider, - mozart::ViewManagerPtr& view_manager, - f1dl::InterfaceRequest view_owner, - ui::ScenicPtr scenic, - zx::eventpair export_token, - zx::eventpair import_token, - maxwell::ContextWriterPtr accessibility_context_writer, - OnMetricsUpdate on_session_metrics_did_change, - fxl::Closure session_error_callback); - - ~PlatformView(); - - void UpdateViewportMetrics(double pixel_ratio); - - mozart::ViewPtr& GetMozartView(); - - private: - const std::string debug_label_; - mozart::ViewPtr view_; - f1dl::Binding view_listener_; - mozart::InputConnectionPtr input_connection_; - f1dl::Binding input_listener_; - int current_text_input_client_ = 0; - f1dl::Binding ime_client_; - mozart::InputMethodEditorPtr ime_; - modular::ClipboardPtr clipboard_; - ui::ScenicPtr scenic_; - AccessibilityBridge accessibility_bridge_; - std::unique_ptr surface_; - blink::LogicalMetrics metrics_; - std::set down_pointers_; - std::map< - std::string /* channel */, - std::function /* message */)> /* handler */> - platform_message_handlers_; - - void RegisterPlatformMessageHandlers(); - - void UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout); - - void FlushViewportMetrics(); - - // |mozart::ViewListener| - void OnPropertiesChanged( - mozart::ViewPropertiesPtr properties, - const OnPropertiesChangedCallback& callback) override; - - // |mozart::InputMethodEditorClient| - void DidUpdateState(mozart::TextInputStatePtr state, - mozart::InputEventPtr event) override; - - // |mozart::InputMethodEditorClient| - void OnAction(mozart::InputMethodAction action) override; - - // |mozart::InputListener| - void OnEvent(mozart::InputEventPtr event, - const OnEventCallback& callback) override; - - bool OnHandlePointerEvent(const mozart::PointerEventPtr& pointer); - - bool OnHandleKeyboardEvent(const mozart::KeyboardEventPtr& keyboard); - - bool OnHandleFocusEvent(const mozart::FocusEventPtr& focus); - - // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; - - // |shell::PlatformView| - void HandlePlatformMessage( - fxl::RefPtr message) override; - - // |shell::PlatformView| - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - // Channel handler for kFlutterPlatformChannel - void HandleFlutterPlatformChannelPlatformMessage( - fxl::RefPtr message); - - // Channel handler for kTextInputChannel - void HandleFlutterTextInputChannelPlatformMessage( - fxl::RefPtr message); - - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); -}; - -} // namespace flutter diff --git a/content_handler/rasterizer.cc b/content_handler/rasterizer.cc new file mode 100644 index 0000000000000..b720809b17a45 --- /dev/null +++ b/content_handler/rasterizer.cc @@ -0,0 +1,19 @@ +// Copyright 2016 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. + +#include "flutter/content_handler/rasterizer.h" +#include "flutter/content_handler/vulkan_rasterizer.h" + +namespace flutter_runner { + +Rasterizer::~Rasterizer() = default; + +std::unique_ptr Rasterizer::Create() { + auto vulkan_rasterizer = std::make_unique(); + FXL_CHECK(vulkan_rasterizer) + << "The vulkan rasterizer must be correctly initialized."; + return vulkan_rasterizer; +} + +} // namespace flutter_runner diff --git a/content_handler/rasterizer.h b/content_handler/rasterizer.h new file mode 100644 index 0000000000000..398f262a568cd --- /dev/null +++ b/content_handler/rasterizer.h @@ -0,0 +1,35 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ +#define FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ + +#include + +#include + +#include "flutter/flow/layers/layer_tree.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" + +namespace flutter_runner { + +class Rasterizer { + public: + virtual ~Rasterizer(); + + static std::unique_ptr Create(); + + virtual void SetScene( + fidl::InterfaceHandle mozart, + zx::eventpair import_token, + fxl::Closure metrics_changed_callback) = 0; + + virtual void Draw(std::unique_ptr layer_tree, + fxl::Closure callback) = 0; +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ diff --git a/content_handler/runtime_holder.cc b/content_handler/runtime_holder.cc new file mode 100644 index 0000000000000..421731b9691d0 --- /dev/null +++ b/content_handler/runtime_holder.cc @@ -0,0 +1,911 @@ +// Copyright 2016 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. + +#include "flutter/content_handler/runtime_holder.h" + +#include +#include +#include +#include +#include + +#include "dart-pkg/zircon/sdk_ext/handle.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/common/threads.h" +#include "flutter/content_handler/accessibility_bridge.h" +#include "flutter/content_handler/rasterizer.h" +#include "flutter/content_handler/service_protocol_hooks.h" +#include "flutter/lib/snapshot/snapshot.h" +#include "flutter/lib/ui/window/pointer_data_packet.h" +#include "flutter/runtime/asset_font_selector.h" +#include "flutter/runtime/dart_controller.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/runtime/runtime_init.h" +#include "lib/app/cpp/connect.h" +#include "lib/fsl/vmo/vector.h" +#include "lib/fxl/files/path.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/time/time_delta.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/zip/create_unzipper.h" +#include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/rapidjson/rapidjson/document.h" +#include "third_party/rapidjson/rapidjson/stringbuffer.h" +#include "third_party/rapidjson/rapidjson/writer.h" + +using tonic::DartConverter; +using tonic::ToDart; + +namespace flutter_runner { +namespace { + +constexpr char kKernelKey[] = "kernel_blob.bin"; +constexpr char kSnapshotKey[] = "snapshot_blob.bin"; +constexpr char kDylibKey[] = "libapp.so"; +constexpr char kAssetChannel[] = "flutter/assets"; +constexpr char kKeyEventChannel[] = "flutter/keyevent"; +constexpr char kTextInputChannel[] = "flutter/textinput"; +constexpr char kFlutterPlatformChannel[] = "flutter/platform"; +constexpr char kFuchsiaPackageResourceDirectory[] = "pkg/data"; +constexpr char kDartPkgContentsKey[] = "dart-pkg/contents"; + +void SetThreadName(fxl::RefPtr runner, std::string name) { + runner->PostTask([name]() { + zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); + Dart_SetThreadName(name.c_str()); + }); +} + +blink::PointerData::Change GetChangeFromPointerEventPhase( + input::PointerEventPhase phase) { + switch (phase) { + case input::PointerEventPhase::ADD: + return blink::PointerData::Change::kAdd; + case input::PointerEventPhase::HOVER: + return blink::PointerData::Change::kHover; + case input::PointerEventPhase::DOWN: + return blink::PointerData::Change::kDown; + case input::PointerEventPhase::MOVE: + return blink::PointerData::Change::kMove; + case input::PointerEventPhase::UP: + return blink::PointerData::Change::kUp; + case input::PointerEventPhase::REMOVE: + return blink::PointerData::Change::kRemove; + case input::PointerEventPhase::CANCEL: + return blink::PointerData::Change::kCancel; + default: + return blink::PointerData::Change::kCancel; + } +} + +blink::PointerData::DeviceKind GetKindFromPointerType( + input::PointerEventType type) { + switch (type) { + case input::PointerEventType::TOUCH: + return blink::PointerData::DeviceKind::kTouch; + case input::PointerEventType::MOUSE: + return blink::PointerData::DeviceKind::kMouse; + default: + return blink::PointerData::DeviceKind::kTouch; + } +} + +} // namespace + +RuntimeHolder::RuntimeHolder() + : view_listener_binding_(this), + input_listener_binding_(this), + text_input_binding_(this), + weak_factory_(this) {} + +RuntimeHolder::~RuntimeHolder() { + blink::Threads::Gpu()->PostTask( + fxl::MakeCopyable([rasterizer = std::move(rasterizer_)](){ + // Deletes rasterizer. + })); +} + +void RuntimeHolder::Init( + fdio_ns_t* namespc, + std::unique_ptr context, + fidl::InterfaceRequest outgoing_services, + std::vector bundle) { + FXL_DCHECK(!rasterizer_); + rasterizer_ = Rasterizer::Create(); + FXL_DCHECK(rasterizer_); + + namespc_ = namespc; + dirfd_ = fdio_ns_opendir(namespc); + if (dirfd_ == -1) { + FXL_LOG(ERROR) << "Failed to get fd for namespace"; + return; + } + context_ = std::move(context); + outgoing_services_ = std::move(outgoing_services); + + context_->ConnectToEnvironmentService(view_manager_.NewRequest()); + + // TODO(zarah): remove bundle entirely once flx is removed. + InitRootBundle(std::move(bundle)); + + const uint8_t* vm_snapshot_data; + const uint8_t* vm_snapshot_instr; + const uint8_t* default_isolate_snapshot_data; + const uint8_t* default_isolate_snapshot_instr; + if (!Dart_IsPrecompiledRuntime()) { + vm_snapshot_data = ::kDartVmSnapshotData; + vm_snapshot_instr = ::kDartVmSnapshotInstructions; + default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; + default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; + } else { + std::vector dylib_blob; + if (!GetAssetAsBuffer(kDylibKey, &dylib_blob)) { + FXL_LOG(ERROR) << "Failed to extract app dylib"; + return; + } + + fsl::SizedVmo dylib_vmo; + if (!fsl::VmoFromVector(dylib_blob, &dylib_vmo)) { + FXL_LOG(ERROR) << "Failed to load app dylib"; + return; + } + + dlerror(); + dylib_handle_ = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); + if (dylib_handle_ == nullptr) { + FXL_LOG(ERROR) << "dlopen failed: " << dlerror(); + return; + } + vm_snapshot_data = reinterpret_cast( + dlsym(dylib_handle_, "_kDartVmSnapshotData")); + vm_snapshot_instr = reinterpret_cast( + dlsym(dylib_handle_, "_kDartVmSnapshotInstructions")); + default_isolate_snapshot_data = reinterpret_cast( + dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); + default_isolate_snapshot_instr = reinterpret_cast( + dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); + } + + // TODO(rmacnak): We should generate the AOT vm snapshot separately from + // each app so we can initialize before receiving the first app bundle. + static bool first_app = true; + if (first_app) { + first_app = false; + blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, + default_isolate_snapshot_data, + default_isolate_snapshot_instr, + /* bundle_path = */ ""); + + // This has to happen after the Dart runtime is initialized. + SetThreadName(blink::Threads::UI(), "ui"); + SetThreadName(blink::Threads::Gpu(), "gpu"); + SetThreadName(blink::Threads::IO(), "io"); + + blink::SetRegisterNativeServiceProtocolExtensionHook( + ServiceProtocolHooks::RegisterHooks); + } + + accessibility_bridge_ = std::make_unique(context_.get()); +} + +void RuntimeHolder::CreateView( + const std::string& script_uri, + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services) { + if (view_listener_binding_.is_bound()) { + // TODO(jeffbrown): Refactor this to support multiple view instances + // sharing the same underlying root bundle (but with different runtimes). + FXL_LOG(ERROR) << "The view has already been created."; + return; + } + + std::vector kernel; + std::vector snapshot; + bool maybe_running_from_source = false; + if (!Dart_IsPrecompiledRuntime()) { + if (!GetAssetAsBuffer(kKernelKey, &kernel) && + !GetAssetAsBuffer(kSnapshotKey, &snapshot)) { + maybe_running_from_source = true; + FXL_LOG(INFO) << "No kernel or snapshot in root bundle."; + } + } + + // Create the view. + zx::eventpair import_token, export_token; + zx_status_t status = zx::eventpair::create(0u, &import_token, &export_token); + if (status != ZX_OK) { + FXL_LOG(ERROR) << "Could not create an event pair."; + return; + } + views_v1::ViewListenerPtr view_listener; + view_listener_binding_.Bind(view_listener.NewRequest()); + view_manager_->CreateView(view_.NewRequest(), // view + std::move(view_owner_request), // view owner + std::move(view_listener), // view listener + std::move(export_token), // export token + script_uri // diagnostic label + ); + component::ServiceProviderPtr view_services; + view_->GetServiceProvider(view_services.NewRequest()); + + // Listen for input events. + ConnectToService(view_services.get(), input_connection_.NewRequest()); + input::InputListenerPtr input_listener; + input_listener_binding_.Bind(input_listener.NewRequest()); + input_connection_->SetEventListener(std::move(input_listener)); + + // Setup the session. + fidl::InterfaceHandle scenic; + view_manager_->GetScenic(scenic.NewRequest()); + + blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ + rasterizer = rasterizer_.get(), // + scenic = std::move(scenic), // + import_token = std::move(import_token), // + weak_runtime_holder = GetWeakPtr() + ]() mutable { + ASSERT_IS_GPU_THREAD; + rasterizer->SetScene( + std::move(scenic), std::move(import_token), + // TODO(MZ-222): Ideally we would immediately redraw the previous layer + // tree when the metrics change since there's no need to rerecord it. + // However, we want to make sure there's only one outstanding frame. + // We should improve the frame scheduling so that the rasterizer thread + // can self-schedule re-rasterization. + [weak_runtime_holder] { + // This is on the GPU thread thread. Post to the Platform/UI + // thread for the completion callback. + ASSERT_IS_GPU_THREAD; + blink::Threads::Platform()->PostTask([weak_runtime_holder]() { + // On the Platform/UI thread. + ASSERT_IS_UI_THREAD; + if (weak_runtime_holder) { + weak_runtime_holder->OnRedrawFrame(); + } + }); + }); + })); + runtime_ = blink::RuntimeController::Create(this); + + const uint8_t* isolate_snapshot_data; + const uint8_t* isolate_snapshot_instr; + if (!Dart_IsPrecompiledRuntime()) { + isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; + isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; + } else { + isolate_snapshot_data = reinterpret_cast( + dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); + isolate_snapshot_instr = reinterpret_cast( + dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); + } + runtime_->CreateDartController(script_uri, isolate_snapshot_data, + isolate_snapshot_instr, dirfd_); + + runtime_->SetViewportMetrics(viewport_metrics_); + + if (Dart_IsPrecompiledRuntime()) { + runtime_->dart_controller()->RunFromPrecompiledSnapshot(); + } else if (!kernel.empty()) { + runtime_->dart_controller()->RunFromKernel(std::move(kernel)); + } else if (maybe_running_from_source) { + std::vector data; + if (!GetAssetAsBuffer(kDartPkgContentsKey, &data)) { + FXL_LOG(ERROR) << "Contents file not found for " << script_uri; + return; + } + std::string package_name(data.begin(), data.end()); + std::string main_dart = "pkg/data/dart-pkg/" + package_name + "/lib/main.dart"; + FXL_LOG(INFO) << "Running from source with entrypoint: '" << main_dart + << "'"; + runtime_->dart_controller()->RunFromSource(main_dart, "pkg/data/dart-pkg/.packages"); + } else { + runtime_->dart_controller()->RunFromScriptSnapshot(snapshot.data(), + snapshot.size()); + } + + runtime_->dart_controller()->dart_state()->SetReturnCodeCallback( + [this](int32_t return_code) { return_code_ = return_code; }); +} + +Dart_Port RuntimeHolder::GetUIIsolateMainPort() { + if (!runtime_) + return ILLEGAL_PORT; + return runtime_->GetMainPort(); +} + +void RuntimeHolder::DidShutdownMainIsolate() { + if (main_isolate_shutdown_callback_) { + main_isolate_shutdown_callback_(); + } +} + +void RuntimeHolder::SetMainIsolateShutdownCallback( + std::function callback) { + main_isolate_shutdown_callback_ = callback; +} + +std::string RuntimeHolder::GetUIIsolateName() { + if (!runtime_) { + return ""; + } + return runtime_->GetIsolateName(); +} + +std::string RuntimeHolder::DefaultRouteName() { + return "/"; +} + +void RuntimeHolder::ScheduleFrame(bool regenerate_layer_tree) { + ASSERT_IS_UI_THREAD; + // TODO(mravn): We assume regenerate_layer_tree is true (and thus ignore + // that we may be able to reuse the current layer tree.) + if (!frame_scheduled_) { + frame_scheduled_ = true; + if (!frame_outstanding_) + PostBeginFrame(); + } +} + +void RuntimeHolder::Render(std::unique_ptr layer_tree) { + if (!frame_outstanding_ || frame_rendering_) { + // TODO(MZ-193): We probably shouldn't be discarding the layer tree here. + // But then, Flutter shouldn't be calling Render() if we didn't call + // BeginFrame(). + return; // Spurious. + } + + frame_rendering_ = true; + + layer_tree->set_construction_time(fxl::TimePoint::Now() - + last_begin_frame_time_); + layer_tree->set_frame_size(SkISize::Make(viewport_metrics_.physical_width, + viewport_metrics_.physical_height)); + layer_tree->set_device_pixel_ratio(viewport_metrics_.device_pixel_ratio); + + // We are on the Platform/UI thread. Post to the GPU thread to render. + ASSERT_IS_PLATFORM_THREAD; + blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ + rasterizer = rasterizer_.get(), // + layer_tree = std::move(layer_tree), // + weak_runtime_holder = GetWeakPtr() // + ]() mutable { + // On the GPU Thread. + ASSERT_IS_GPU_THREAD; + rasterizer->Draw(std::move(layer_tree), [weak_runtime_holder]() { + // This is on the GPU thread thread. Post to the Platform/UI thread + // for the completion callback. + ASSERT_IS_GPU_THREAD; + blink::Threads::Platform()->PostTask([weak_runtime_holder]() { + // On the Platform/UI thread. + ASSERT_IS_UI_THREAD; + if (weak_runtime_holder) { + weak_runtime_holder->frame_rendering_ = false; + weak_runtime_holder->OnFrameComplete(); + } + }); + }); + })); +} + +void RuntimeHolder::UpdateSemantics(blink::SemanticsNodeUpdates update) { + accessibility_bridge_->UpdateSemantics(update); +} + +void RuntimeHolder::HandlePlatformMessage( + fxl::RefPtr message) { + if (message->channel() == kAssetChannel) { + if (HandleAssetPlatformMessage(message.get())) + return; + } else if (message->channel() == kTextInputChannel) { + if (HandleTextInputPlatformMessage(message.get())) + return; + } else if (message->channel() == kFlutterPlatformChannel) { + if (HandleFlutterPlatformMessage(message.get())) + return; + } + if (auto response = message->response()) + response->CompleteEmpty(); +} + +void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) { + if (asset_provider_) { + blink::AssetFontSelector::Install(asset_provider_); + } else if (asset_store_) { + blink::AssetFontSelector::Install(asset_store_); + } + InitDartIoInternal(); + InitFuchsia(); + InitZircon(); + InitScenicInternal(); +} + +void RuntimeHolder::InitDartIoInternal() { + Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io")); + + // Set up the namespace. + Dart_Handle namespace_type = + Dart_GetType(io_lib, ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + Dart_Handle namespace_args[1]; + namespace_args[0] = Dart_NewInteger(reinterpret_cast(namespc_)); + DART_CHECK_VALID(namespace_args[0]); + DART_CHECK_VALID(Dart_Invoke(namespace_type, ToDart("_setupNamespace"), 1, + namespace_args)); + + // Disable dart:io exit() + Dart_Handle embedder_config_type = + Dart_GetType(io_lib, ToDart("_EmbedderConfig"), 0, nullptr); + DART_CHECK_VALID(embedder_config_type); + DART_CHECK_VALID( + Dart_SetField(embedder_config_type, ToDart("_mayExit"), Dart_False())); +} + +void RuntimeHolder::InitFuchsia() { + fidl::InterfaceHandle environment; + context_->ConnectToEnvironmentService(environment.NewRequest()); + fuchsia::dart::Initialize(std::move(environment), + std::move(outgoing_services_)); + + component::ServiceProviderPtr parent_env_service_provider; + context_->environment()->GetServices( + parent_env_service_provider.NewRequest()); + ConnectToService(parent_env_service_provider.get(), clipboard_.NewRequest()); +} + +void RuntimeHolder::InitZircon() { + Dart_Handle zircon_lib = Dart_LookupLibrary(ToDart("dart:zircon")); + DART_CHECK_VALID(zircon_lib); + + Dart_Handle namespace_type = + Dart_GetType(zircon_lib, ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + DART_CHECK_VALID(Dart_SetField(namespace_type, ToDart("_namespace"), + ToDart(reinterpret_cast(namespc_)))); +} + +void RuntimeHolder::InitScenicInternal() { + fidl::InterfaceHandle view_container; + view_->GetContainer(view_container.NewRequest()); + + Dart_Handle mozart_internal = + Dart_LookupLibrary(ToDart("dart:mozart.internal")); + + DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, mozart::NativeLookup, + mozart::NativeSymbol)); + + DART_CHECK_VALID( + Dart_SetField(mozart_internal, ToDart("_context"), + DartConverter::ToDart(reinterpret_cast( + static_cast(this))))); + + DART_CHECK_VALID(Dart_SetField(mozart_internal, ToDart("_viewContainer"), + ToDart(zircon::dart::Handle::Create( + view_container.TakeChannel().release())))); +} + +void RuntimeHolder::InitRootBundle(std::vector bundle) { + if (!bundle.empty()) { + root_bundle_data_ = std::move(bundle); + asset_store_ = fxl::MakeRefCounted( + GetUnzipperProviderForRootBundle()); + } else { + fxl::UniqueFD root_dir(fdio_ns_opendir(namespc_)); + if (!root_dir.is_valid()) { + FXL_LOG(ERROR) << "Unable to load root dir"; + return; + } + fxl::UniqueFD data_dir(openat(root_dir.get(), + kFuchsiaPackageResourceDirectory, + O_RDONLY | O_DIRECTORY)); + if (!data_dir.is_valid()) { + FXL_LOG(ERROR) << "Unable to load data dir"; + return; + } + asset_provider_ = + fxl::MakeRefCounted(std::move(data_dir)); + } +} + +views_v1::View* RuntimeHolder::GetMozartView() { + return view_.get(); +} + +bool RuntimeHolder::HandleAssetPlatformMessage( + blink::PlatformMessage* message) { + fxl::RefPtr response = message->response(); + if (!response) + return false; + const auto& data = message->data(); + std::string asset_name(reinterpret_cast(data.data()), + data.size()); + std::vector asset_data; + if (GetAssetAsBuffer(asset_name, &asset_data)) { + response->Complete(std::move(asset_data)); + } else { + response->CompleteEmpty(); + } + return true; +} + +bool RuntimeHolder::GetAssetAsBuffer(const std::string& name, + std::vector* data) { + return (asset_provider_ && + asset_provider_->GetAsBuffer(name, data)) || + (asset_store_ && asset_store_->GetAsBuffer(name, data)); +} + +bool RuntimeHolder::HandleFlutterPlatformMessage( + blink::PlatformMessage* message) { + const auto& data = message->data(); + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) { + return false; + } + + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) { + return false; + } + + fxl::RefPtr response = message->response(); + if (method->value == "Clipboard.setData") { + auto text = root["args"]["text"].GetString(); + clipboard_->Push(text); + response->CompleteEmpty(); + } else if (method->value == "Clipboard.getData") { + clipboard_->Peek([response](fidl::StringPtr text) { + rapidjson::StringBuffer json_buffer; + rapidjson::Writer writer(json_buffer); + writer.StartArray(); + writer.StartObject(); + writer.Key("text"); + writer.String(text.get()); + writer.EndObject(); + writer.EndArray(); + + std::string result = json_buffer.GetString(); + response->Complete(std::vector{result.begin(), result.end()}); + }); + } else { + response->CompleteEmpty(); + } + return true; +} + +bool RuntimeHolder::HandleTextInputPlatformMessage( + blink::PlatformMessage* message) { + const auto& data = message->data(); + + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) + return false; + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) + return false; + + if (method->value == "TextInput.show") { + if (input_method_editor_) { + input_method_editor_->Show(); + } + } else if (method->value == "TextInput.hide") { + if (input_method_editor_) { + input_method_editor_->Hide(); + } + } else if (method->value == "TextInput.setClient") { + current_text_input_client_ = 0; + if (text_input_binding_.is_bound()) + text_input_binding_.Unbind(); + input_method_editor_ = nullptr; + + auto args = root.FindMember("args"); + if (args == root.MemberEnd() || !args->value.IsArray() || + args->value.Size() != 2) + return false; + const auto& configuration = args->value[1]; + if (!configuration.IsObject()) + return false; + // TODO(abarth): Read the keyboard type form the configuration. + current_text_input_client_ = args->value[0].GetInt(); + input::TextInputState state; + state.text = std::string(); + input_connection_->GetInputMethodEditor( + input::KeyboardType::TEXT, input::InputMethodAction::DONE, + std::move(state), text_input_binding_.NewBinding(), + input_method_editor_.NewRequest()); + } else if (method->value == "TextInput.setEditingState") { + if (input_method_editor_) { + auto args_it = root.FindMember("args"); + if (args_it == root.MemberEnd() || !args_it->value.IsObject()) + return false; + const auto& args = args_it->value; + input::TextInputState state; + // TODO(abarth): Deserialize state. + auto text = args.FindMember("text"); + if (text != args.MemberEnd() && text->value.IsString()) + state.text = text->value.GetString(); + auto selection_base = args.FindMember("selectionBase"); + if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) + state.selection.base = selection_base->value.GetInt(); + auto selection_extent = args.FindMember("selectionExtent"); + if (selection_extent != args.MemberEnd() && + selection_extent->value.IsInt()) + state.selection.extent = selection_extent->value.GetInt(); + auto selection_affinity = args.FindMember("selectionAffinity"); + if (selection_affinity != args.MemberEnd() && + selection_affinity->value.IsString() && + selection_affinity->value == "TextAffinity.upstream") + state.selection.affinity = input::TextAffinity::UPSTREAM; + else + state.selection.affinity = input::TextAffinity::DOWNSTREAM; + // We ignore selectionIsDirectional because that concept doesn't exist on + // Fuchsia. + auto composing_base = args.FindMember("composingBase"); + if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) + state.composing.start = composing_base->value.GetInt(); + auto composing_extent = args.FindMember("composingExtent"); + if (composing_extent != args.MemberEnd() && + composing_extent->value.IsInt()) + state.composing.end = composing_extent->value.GetInt(); + input_method_editor_->SetState(std::move(state)); + } + } else if (method->value == "TextInput.clearClient") { + current_text_input_client_ = 0; + if (text_input_binding_.is_bound()) + text_input_binding_.Unbind(); + input_method_editor_ = nullptr; + } else { + FXL_DLOG(ERROR) << "Unknown " << kTextInputChannel << " method " + << method->value.GetString(); + } + + return false; +} + +blink::UnzipperProvider RuntimeHolder::GetUnzipperProviderForRootBundle() { + return [self = GetWeakPtr()]() { + if (!self) + return zip::UniqueUnzipper(); + return zip::CreateUnzipper(&self->root_bundle_data_); + }; +} + +void RuntimeHolder::OnEvent(input::InputEvent event, + OnEventCallback callback) { + bool handled = false; + if (event.is_pointer()) { + const input::PointerEvent& pointer = event.pointer(); + blink::PointerData pointer_data; + pointer_data.time_stamp = pointer.event_time / 1000; + pointer_data.change = GetChangeFromPointerEventPhase(pointer.phase); + pointer_data.kind = GetKindFromPointerType(pointer.type); + pointer_data.device = pointer.pointer_id; + pointer_data.physical_x = pointer.x * viewport_metrics_.device_pixel_ratio; + pointer_data.physical_y = pointer.y * viewport_metrics_.device_pixel_ratio; + // Buttons are single bit values starting with kMousePrimaryButton = 1. + pointer_data.buttons = static_cast(pointer.buttons); + + switch (pointer_data.change) { + case blink::PointerData::Change::kDown: + down_pointers_.insert(pointer_data.device); + break; + case blink::PointerData::Change::kCancel: + case blink::PointerData::Change::kUp: + down_pointers_.erase(pointer_data.device); + break; + case blink::PointerData::Change::kMove: + if (down_pointers_.count(pointer_data.device) == 0) + pointer_data.change = blink::PointerData::Change::kHover; + break; + case blink::PointerData::Change::kAdd: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received add event for down pointer."; + } + break; + case blink::PointerData::Change::kRemove: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received remove event for down pointer."; + } + break; + case blink::PointerData::Change::kHover: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received hover event for down pointer."; + } + break; + } + + blink::PointerDataPacket packet(1); + packet.SetPointerData(0, pointer_data); + runtime_->DispatchPointerDataPacket(packet); + + handled = true; + } else if (event.is_keyboard()) { + const input::KeyboardEvent& keyboard = event.keyboard(); + const char* type = nullptr; + if (keyboard.phase == input::KeyboardEventPhase::PRESSED) + type = "keydown"; + else if (keyboard.phase == input::KeyboardEventPhase::REPEAT) + type = "keydown"; // TODO change this to keyrepeat + else if (keyboard.phase == input::KeyboardEventPhase::RELEASED) + type = "keyup"; + + if (type) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + document.SetObject(); + document.AddMember("type", rapidjson::Value(type, strlen(type)), + allocator); + document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); + document.AddMember("hidUsage", keyboard.hid_usage, allocator); + document.AddMember("codePoint", keyboard.code_point, allocator); + document.AddMember("modifiers", keyboard.modifiers, allocator); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = + reinterpret_cast(buffer.GetString()); + runtime_->DispatchPlatformMessage( + fxl::MakeRefCounted( + kKeyEventChannel, + std::vector(data, data + buffer.GetSize()), nullptr)); + handled = true; + } + } + callback(handled); +} + +void RuntimeHolder::OnPropertiesChanged( + views_v1::ViewProperties properties, + OnPropertiesChangedCallback callback) { + // Attempt to read the device pixel ratio. + float pixel_ratio = 1.f; + if (auto& metrics = properties.display_metrics) { + pixel_ratio = metrics->device_pixel_ratio; + } + + // Apply view property changes. + if (auto& layout = properties.view_layout) { + viewport_metrics_.physical_width = layout->size.width * pixel_ratio; + viewport_metrics_.physical_height = layout->size.height * pixel_ratio; + viewport_metrics_.physical_padding_top = layout->inset.top * pixel_ratio; + viewport_metrics_.physical_padding_right = + layout->inset.right * pixel_ratio; + viewport_metrics_.physical_padding_bottom = + layout->inset.bottom * pixel_ratio; + viewport_metrics_.physical_padding_left = layout->inset.left * pixel_ratio; + viewport_metrics_.device_pixel_ratio = pixel_ratio; + runtime_->SetViewportMetrics(viewport_metrics_); + } + + ScheduleFrame(); + + callback(); +} + +void RuntimeHolder::DidUpdateState(input::TextInputState state, + input::InputEventPtr event) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + + rapidjson::Value encoded_state(rapidjson::kObjectType); + encoded_state.AddMember("text", state.text.get(), allocator); + encoded_state.AddMember("selectionBase", state.selection.base, allocator); + encoded_state.AddMember("selectionExtent", state.selection.extent, + allocator); + switch (state.selection.affinity) { + case input::TextAffinity::UPSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.upstream"), + allocator); + break; + case input::TextAffinity::DOWNSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.downstream"), + allocator); + break; + } + encoded_state.AddMember("selectionIsDirectional", true, allocator); + encoded_state.AddMember("composingBase", state.composing.start, allocator); + encoded_state.AddMember("composingExtent", state.composing.end, allocator); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + args.PushBack(encoded_state, allocator); + + document.SetObject(); + document.AddMember("method", + rapidjson::Value("TextInputClient.updateEditingState"), + allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, std::vector(data, data + buffer.GetSize()), + nullptr)); +} + +void RuntimeHolder::OnAction(input::InputMethodAction action) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + + // Done is currently the only text input action defined by Flutter. + args.PushBack("TextInputAction.done", allocator); + + document.SetObject(); + document.AddMember( + "method", rapidjson::Value("TextInputClient.performAction"), allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, std::vector(data, data + buffer.GetSize()), + nullptr)); +} + +fxl::WeakPtr RuntimeHolder::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +void RuntimeHolder::PostBeginFrame() { + blink::Threads::Platform()->PostTask([weak_runtime_holder = GetWeakPtr()]() { + // On the Platform/UI thread. + ASSERT_IS_UI_THREAD; + if (weak_runtime_holder) { + weak_runtime_holder->BeginFrame(); + } + }); +} + +void RuntimeHolder::BeginFrame() { + ASSERT_IS_UI_THREAD + FXL_DCHECK(frame_scheduled_); + FXL_DCHECK(!frame_outstanding_); + frame_scheduled_ = false; + frame_outstanding_ = true; + int64_t dart_frame_start_micros = Dart_TimelineGetMicros(); + last_begin_frame_time_ = fxl::TimePoint::Now(); + runtime_->BeginFrame(last_begin_frame_time_); + + if (frame_scheduled_) { + // HACK(rmacnak): This assumes 16ms/frame; it should use the frame deadline + // once we have access to it. Compare shell/common/animator.cc. + runtime_->NotifyIdle(dart_frame_start_micros + 16000); + } else { + // We don't have another frame pending, so we're waiting on user input + // or I/O. Allow the Dart VM 100 ms. + runtime_->NotifyIdle(dart_frame_start_micros + 100000); + } +} + +void RuntimeHolder::OnFrameComplete() { + ASSERT_IS_UI_THREAD + FXL_DCHECK(frame_outstanding_); + frame_outstanding_ = false; + if (frame_scheduled_) + PostBeginFrame(); +} + +void RuntimeHolder::OnRedrawFrame() { + if (!frame_outstanding_) + ScheduleFrame(); +} + +} // namespace flutter_runner diff --git a/content_handler/runtime_holder.h b/content_handler/runtime_holder.h new file mode 100644 index 0000000000000..b9d55d9f9bacc --- /dev/null +++ b/content_handler/runtime_holder.h @@ -0,0 +1,152 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ +#define FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ + +#include +#include + +#include + +#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" +#include "flutter/assets/asset_provider.h" +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/unzipper_provider.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/content_handler/accessibility_bridge.h" +#include "flutter/flow/layers/layer_tree.h" +#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/runtime/runtime_controller.h" +#include "flutter/runtime/runtime_delegate.h" +#include "lib/app/cpp/application_context.h" +#include +#include +#include +#include "lib/fidl/cpp/binding.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/ui/flutter/sdk_ext/src/natives.h" +#include +#include +#include + +namespace flutter_runner { + +class Rasterizer; + +class RuntimeHolder : public blink::RuntimeDelegate, + public mozart::NativesDelegate, + public views_v1::ViewListener, + public input::InputListener, + public input::InputMethodEditorClient { + public: + RuntimeHolder(); + ~RuntimeHolder(); + + void Init(fdio_ns_t* namespc, + std::unique_ptr context, + fidl::InterfaceRequest outgoing_services, + std::vector bundle); + void CreateView(const std::string& script_uri, + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services); + + Dart_Port GetUIIsolateMainPort(); + std::string GetUIIsolateName(); + + int32_t return_code() { return return_code_; } + + void SetMainIsolateShutdownCallback(std::function callback); + + private: + // |blink::RuntimeDelegate| implementation: + std::string DefaultRouteName() override; + void ScheduleFrame(bool regenerate_layer_tree = true) override; + void Render(std::unique_ptr layer_tree) override; + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + void HandlePlatformMessage( + fxl::RefPtr message) override; + void DidCreateMainIsolate(Dart_Isolate isolate) override; + void DidShutdownMainIsolate() override; + + // |mozart::NativesDelegate| implementation: + views_v1::View* GetMozartView() override; + + // |input::InputListener| implementation: + void OnEvent(input::InputEvent event, + OnEventCallback callback) override; + + // |views_v1::ViewListener| implementation: + void OnPropertiesChanged( + views_v1::ViewProperties properties, + OnPropertiesChangedCallback callback) override; + + // |input::InputMethodEditorClient| implementation: + void DidUpdateState(input::TextInputState state, + input::InputEventPtr event) override; + void OnAction(input::InputMethodAction action) override; + + fxl::WeakPtr GetWeakPtr(); + + void InitRootBundle(std::vector bundle); + blink::UnzipperProvider GetUnzipperProviderForRootBundle(); + bool HandleAssetPlatformMessage(blink::PlatformMessage* message); + bool GetAssetAsBuffer(const std::string& name, std::vector* data); + bool HandleTextInputPlatformMessage(blink::PlatformMessage* message); + bool HandleFlutterPlatformMessage(blink::PlatformMessage* message); + + void InitDartIoInternal(); + void InitFuchsia(); + void InitZircon(); + void InitScenicInternal(); + + void PostBeginFrame(); + void BeginFrame(); + void OnFrameComplete(); + void OnRedrawFrame(); + void Invalidate(); + + fdio_ns_t* namespc_; + int dirfd_; + std::unique_ptr context_; + fidl::InterfaceRequest outgoing_services_; + std::vector root_bundle_data_; + // TODO(zarah): Remove asset_store_ when flx is completely removed + fxl::RefPtr asset_store_; + fxl::RefPtr asset_provider_; + void* dylib_handle_ = nullptr; + std::unique_ptr rasterizer_; + std::unique_ptr runtime_; + blink::ViewportMetrics viewport_metrics_; + views_v1::ViewManagerPtr view_manager_; + fidl::Binding view_listener_binding_; + fidl::Binding input_listener_binding_; + input::InputConnectionPtr input_connection_; + views_v1::ViewPtr view_; + std::unordered_set down_pointers_; + input::InputMethodEditorPtr input_method_editor_; + fidl::Binding text_input_binding_; + int current_text_input_client_ = 0; + fxl::TimePoint last_begin_frame_time_; + bool frame_outstanding_ = false; + bool frame_scheduled_ = false; + bool frame_rendering_ = false; + int32_t return_code_ = 0; + + fxl::WeakPtrFactory weak_factory_; + + std::unique_ptr accessibility_bridge_; + + std::function main_isolate_shutdown_callback_; + + modular::ClipboardPtr clipboard_; + + FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeHolder); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ diff --git a/content_handler/service_protocol_hooks.cc b/content_handler/service_protocol_hooks.cc new file mode 100644 index 0000000000000..9a91254f13488 --- /dev/null +++ b/content_handler/service_protocol_hooks.cc @@ -0,0 +1,164 @@ +// Copyright 2017 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. + +#include "flutter/content_handler/service_protocol_hooks.h" + +#include + +#include +#include + +#include "flutter/common/threads.h" +#include "flutter/content_handler/app.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace flutter_runner { +namespace { + +constexpr char kViewIdPrefx[] = "_flutterView/"; +constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; + +static intptr_t KeyIndex(const char** param_keys, + intptr_t num_params, + const char* key) { + if (param_keys == NULL) { + return -1; + } + for (intptr_t i = 0; i < num_params; i++) { + if (strcmp(param_keys[i], key) == 0) { + return i; + } + } + return -1; +} + +static const char* ValueForKey(const char** param_keys, + const char** param_values, + intptr_t num_params, + const char* key) { + intptr_t index = KeyIndex(param_keys, num_params, key); + if (index < 0) { + return NULL; + } + return param_values[index]; +} + +static void AppendIsolateRef(std::stringstream* stream, + int64_t main_port, + const std::string name) { + *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; + *stream << main_port << "\",\"name\":\"" << name << "\","; + *stream << "\"number\":\"" << main_port << "\"}"; +} + +static void AppendFlutterView(std::stringstream* stream, + uintptr_t view_id, + int64_t isolate_id, + const std::string isolate_name) { + *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" + << std::hex << view_id << std::dec << "\""; + if (isolate_id != ILLEGAL_PORT) { + // Append the isolate (if it exists). + *stream << "," + << "\"isolate\":"; + AppendIsolateRef(stream, isolate_id, isolate_name); + } + *stream << "}"; +} + +} // namespace + +void ServiceProtocolHooks::RegisterHooks(bool running_precompiled_code) { + // Listing of FlutterViews. + Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, + nullptr); + + Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, + &SetAssetBundlePath, nullptr); +} + +const char* ServiceProtocolHooks::kListViewsExtensionName = + "_flutter.listViews"; + +bool ServiceProtocolHooks::ListViews(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + // Ask the App for the list of platform views. This will run a task on + // the UI thread before returning. + App& app = App::Shared(); + std::vector platform_views; + app.WaitForPlatformViewIds(&platform_views); + + std::stringstream response; + + response << "{\"type\":\"FlutterViewList\",\"views\":["; + bool prefix_comma = false; + for (auto it = platform_views.begin(); it != platform_views.end(); it++) { + uintptr_t view_id = it->view_id; + int64_t isolate_id = it->isolate_id; + const std::string& isolate_name = it->isolate_name; + if (!view_id) { + continue; + } + if (prefix_comma) { + response << ','; + } else { + prefix_comma = true; + } + AppendFlutterView(&response, view_id, isolate_id, isolate_name); + } + response << "]}"; + // Copy the response. + *json_object = strdup(response.str().c_str()); + return true; +} + +const char* ServiceProtocolHooks::kSetAssetBundlePathExtensionName = + "_flutter.setAssetBundlePath"; + +bool ServiceProtocolHooks::SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + const char* view_id_str = + ValueForKey(param_keys, param_values, num_params, "viewId"); + + // Ask the App for the list of platform views. This will run a task on + // the UI thread before returning. + App& app = App::Shared(); + std::vector platform_views; + app.WaitForPlatformViewIds(&platform_views); + + // Convert the actual flutter view hex id into a number. + uintptr_t view_id_as_num = + std::stoull((view_id_str + kViewIdPrefxLength), nullptr, 16); + + // The view existed and the isolate was created. Success. + std::stringstream response; + response << "{\"type\":\"Success\"," + << "\"view\":"; + for (auto it = platform_views.begin(); it != platform_views.end(); it++) { + uintptr_t view_id = it->view_id; + int64_t isolate_id = it->isolate_id; + const std::string& isolate_name = it->isolate_name; + if (!view_id || view_id != view_id_as_num) { + continue; + } + + // TODO(DX): Set up asset bundle path for the isolate. + + AppendFlutterView(&response, view_id, isolate_id, isolate_name); + break; + } + response << "}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +} // namespace flutter_runner diff --git a/content_handler/service_protocol_hooks.h b/content_handler/service_protocol_hooks.h new file mode 100644 index 0000000000000..479fb71471f1e --- /dev/null +++ b/content_handler/service_protocol_hooks.h @@ -0,0 +1,37 @@ +// Copyright 2017 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. + +#ifndef FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ +#define FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ + +#include "lib/fxl/synchronization/waitable_event.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace flutter_runner { + +class ServiceProtocolHooks { + public: + static void RegisterHooks(bool running_precompiled_code); + + private: + static const char* kListViewsExtensionName; + static bool ListViews(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + + static const char* kSetAssetBundlePathExtensionName; + static bool SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index 870020abb670f..b496ae37f40f2 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -2,69 +2,72 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "session_connection.h" - +#include "flutter/content_handler/session_connection.h" +#include "lib/fidl/cpp/optional.h" #include "lib/ui/scenic/fidl_helpers.h" -namespace flutter { +namespace flutter_runner { -SessionConnection::SessionConnection( - const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback) - : debug_label_(std::move(debug_label)), - session_(scenic.get()), +SessionConnection::SessionConnection(ui::ScenicPtr scenic, + zx::eventpair import_token) + : session_(scenic.get()), root_node_(&session_), surface_producer_(std::make_unique(&session_)), - scene_update_context_(&session_, surface_producer_.get()), - metrics_changed_callback_( - std::move(session_metrics_did_change_callback)) { - session_.set_error_handler(std::move(session_error_callback)); + scene_update_context_(&session_, surface_producer_.get()) { + ASSERT_IS_GPU_THREAD; + + session_.set_error_handler( + std::bind(&SessionConnection::OnSessionError, this)); session_.set_event_handler(std::bind(&SessionConnection::OnSessionEvents, this, std::placeholders::_1)); root_node_.Bind(std::move(import_token)); - root_node_.SetEventMask(ui::gfx::kMetricsEventMask); - session_.Present(0, [](ui::PresentationInfoPtr info) {}); -} + root_node_.SetEventMask(gfx::kMetricsEventMask); + session_.Present(0, [](images::PresentationInfo info) {}); -SessionConnection::~SessionConnection() = default; + present_callback_ = + std::bind(&SessionConnection::OnPresent, this, std::placeholders::_1); +} -void SessionConnection::OnSessionEvents(f1dl::Array events) { - using Type = ui::gfx::Event::Tag; +SessionConnection::~SessionConnection() { + ASSERT_IS_GPU_THREAD; +} - for (auto& raw_event : *events) { - if (!raw_event->is_gfx()) { - continue; - } +void SessionConnection::OnSessionError() { + ASSERT_IS_GPU_THREAD; + // TODO: Not this. + FXL_CHECK(false) << "Session connection was terminated."; +} - auto& event = raw_event->get_gfx(); - - switch (event->which()) { - case Type::METRICS: { - if (event->get_metrics()->node_id == root_node_.id()) { - auto& metrics = event->get_metrics()->metrics; - double device_pixel_ratio = metrics->scale_x; - scene_update_context_.set_metrics(std::move(metrics)); - if (metrics_changed_callback_) { - metrics_changed_callback_(device_pixel_ratio); - } - } - } break; - default: - break; +void SessionConnection::OnSessionEvents(fidl::VectorPtr events) { + gfx::Metrics* new_metrics; + for (auto& event : *events) { + if (event.is_gfx() && event.gfx().is_metrics() && + event.gfx().metrics().node_id == root_node_.id()) { + new_metrics = &event.gfx().metrics().metrics; } } + if (!new_metrics) + return; + + scene_update_context_.set_metrics(fidl::MakeOptional(std::move(*new_metrics))); + + if (metrics_changed_callback_) + metrics_changed_callback_(); } -void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { +void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, + fxl::Closure on_present_callback) { + ASSERT_IS_GPU_THREAD; + FXL_DCHECK(pending_on_present_callback_ == nullptr); + FXL_DCHECK(on_present_callback != nullptr); + pending_on_present_callback_ = on_present_callback; + // Flush all session ops. Paint tasks have not yet executed but those are // fenced. The compositor can start processing ops while we finalize paint // tasks. - session_.Present(0, // presentation_time. (placeholder). - [](ui::PresentationInfoPtr) {} // callback + session_.Present(0, // presentation_time. Placeholder for now. + present_callback_ // callback ); // Execute paint tasks and signal fences. @@ -74,15 +77,22 @@ void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { // book-keeping on buffer caches. surface_producer_->OnSurfacesPresented(std::move(surfaces_to_submit)); - // Prepare for the next frame. These ops won't be processed till the next - // present. - EnqueueClearOps(); + // Prepare for the next frame. + EnqueueClearCommands(); +} + +void SessionConnection::OnPresent(images::PresentationInfo info) { + ASSERT_IS_GPU_THREAD; + auto callback = pending_on_present_callback_; + pending_on_present_callback_ = nullptr; + callback(); } -void SessionConnection::EnqueueClearOps() { +void SessionConnection::EnqueueClearCommands() { + ASSERT_IS_GPU_THREAD; // We are going to be sending down a fresh node hierarchy every frame. So just - // enqueue a detach op on the imported root node. + // enqueue a detach command on the imported root node. session_.Enqueue(scenic_lib::NewDetachChildrenCommand(root_node_.id())); } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index e4f39d314c98f..a80ba3a2235d2 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -2,62 +2,70 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ +#define FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ #include +#include "flutter/common/threads.h" +#include "flutter/content_handler/vulkan_surface_producer.h" #include "flutter/flow/compositor_context.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fidl/cpp/bindings/interface_handle.h" +#include "lib/fidl/cpp/interface_handle.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" -#include "vulkan_surface_producer.h" -namespace flutter { +namespace flutter_runner { -using OnMetricsUpdate = std::function; - -// The component residing on the GPU thread that is responsible for -// maintaining the Scenic session connection and presenting node updates. -class SessionConnection final { +class SessionConnection { public: - SessionConnection(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback); + SessionConnection(ui::ScenicPtr scenic, zx::eventpair import_token); ~SessionConnection(); bool has_metrics() const { return scene_update_context_.has_metrics(); } - const ui::gfx::MetricsPtr& metrics() const { + const gfx::MetricsPtr& metrics() const { return scene_update_context_.metrics(); } + void set_metrics_changed_callback(fxl::Closure callback) { + metrics_changed_callback_ = std::move(callback); + } + flow::SceneUpdateContext& scene_update_context() { return scene_update_context_; } - scenic_lib::ImportNode& root_node() { return root_node_; } + scenic_lib::ImportNode& root_node() { + ASSERT_IS_GPU_THREAD; + return root_node_; + } - void Present(flow::CompositorContext::ScopedFrame& frame); + void Present(flow::CompositorContext::ScopedFrame& frame, + fxl::Closure on_present_callback); private: - const std::string debug_label_; scenic_lib::Session session_; scenic_lib::ImportNode root_node_; + scenic_lib::Session::PresentCallback present_callback_; + fxl::Closure pending_on_present_callback_; std::unique_ptr surface_producer_; flow::SceneUpdateContext scene_update_context_; - OnMetricsUpdate metrics_changed_callback_; + fxl::Closure metrics_changed_callback_; + + void OnSessionError(); + void OnSessionEvents(fidl::VectorPtr events); - void OnSessionEvents(f1dl::Array events); + void EnqueueClearCommands(); - void EnqueueClearOps(); + void OnPresent(images::PresentationInfo info); FXL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); }; -} // namespace flutter +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ diff --git a/content_handler/surface.cc b/content_handler/surface.cc deleted file mode 100644 index 8efe1975fbfdb..0000000000000 --- a/content_handler/surface.cc +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "surface.h" - -#include -#include -#include -#include - -#include "lib/fxl/files/unique_fd.h" - -namespace flutter { - -Surface::Surface(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback) - : shell::Surface(std::make_unique( - scenic, - debug_label, - std::move(import_token), - std::move(session_metrics_did_change_callback), - std::move(session_error_callback))), - debug_label_(debug_label) {} - -Surface::~Surface() = default; - -// |shell::Surface| -bool Surface::IsValid() { - return valid_; -} - -// |shell::Surface| -std::unique_ptr Surface::AcquireFrame( - const SkISize& size) { - return std::make_unique( - nullptr, [](const shell::SurfaceFrame& surface_frame, SkCanvas* canvas) { - return true; - }); -} - -// |shell::Surface| -GrContext* Surface::GetContext() { - return nullptr; -} - -static zx_status_t DriverWatcher(int dirfd, - int event, - const char* fn, - void* cookie) { - if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { - return ZX_ERR_STOP; - } - return ZX_OK; -} - -bool Surface::CanConnectToDisplay() { - constexpr char kDisplayDriverClass[] = "/dev/class/display"; - fxl::UniqueFD fd(open(kDisplayDriverClass, O_DIRECTORY | O_RDONLY)); - if (fd.get() < 0) { - FXL_DLOG(ERROR) << "Failed to open " << kDisplayDriverClass; - return false; - } - - zx_status_t status = fdio_watch_directory( - fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(1)), nullptr); - return status == ZX_ERR_STOP; -} - -} // namespace flutter diff --git a/content_handler/surface.h b/content_handler/surface.h deleted file mode 100644 index 4ad27aaf540f3..0000000000000 --- a/content_handler/surface.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "compositor_context.h" -#include "flutter/fml/memory/weak_ptr.h" -#include "flutter/shell/common/surface.h" -#include "lib/fxl/macros.h" - -namespace flutter { - -// The interface between the Flutter rasterizer and the underlying platform. May -// be constructed on any thread but will be used by the engine only on the GPU -// thread. -class Surface final : public shell::Surface { - public: - Surface(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback); - - ~Surface() override; - - private: - const bool valid_ = CanConnectToDisplay(); - const std::string debug_label_; - std::unique_ptr compositor_context_; - - // |shell::Surface| - bool IsValid() override; - - // |shell::Surface| - std::unique_ptr AcquireFrame( - const SkISize& size) override; - - // |shell::Surface| - GrContext* GetContext() override; - - static bool CanConnectToDisplay(); - - FXL_DISALLOW_COPY_AND_ASSIGN(Surface); -}; - -} // namespace flutter diff --git a/content_handler/task_observers.cc b/content_handler/task_observers.cc deleted file mode 100644 index f23265e7b1653..0000000000000 --- a/content_handler/task_observers.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "task_observers.h" - -#include - -#include "lib/fsl/tasks/message_loop.h" - -namespace flutter { - -thread_local std::map tTaskObservers; - -static void ExecuteAfterTaskObservers() { - for (const auto& callback : tTaskObservers) { - callback.second(); - } -} - -void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, - fxl::Closure observer) { - if (!observer) { - return; - } - - if (tTaskObservers.size() == 0) { - fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback( - std::bind(&ExecuteAfterTaskObservers)); - } - - tTaskObservers[key] = observer; -} - -void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key) { - tTaskObservers.erase(key); - - if (tTaskObservers.size() == 0) { - fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); - } -} - -} // namespace flutter diff --git a/content_handler/task_observers.h b/content_handler/task_observers.h deleted file mode 100644 index 53f6b96222000..0000000000000 --- a/content_handler/task_observers.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "lib/fxl/functional/closure.h" - -namespace flutter { - -void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, - fxl::Closure observer); - -void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key); - -} // namespace flutter diff --git a/content_handler/unique_fdio_ns.h b/content_handler/unique_fdio_ns.h deleted file mode 100644 index 726137d729f85..0000000000000 --- a/content_handler/unique_fdio_ns.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "fdio/namespace.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/memory/unique_object.h" - -namespace flutter { - -struct UniqueFDIONSTraits { - static fdio_ns_t* InvalidValue() { return nullptr; } - - static bool IsValid(fdio_ns_t* ns) { return ns != InvalidValue(); } - - static void Free(fdio_ns_t* ns) { - auto status = fdio_ns_destroy(ns); - FXL_DCHECK(status == ZX_OK); - } -}; - -using UniqueFDIONS = fxl::UniqueObject; - -inline UniqueFDIONS UniqueFDIONSCreate() { - fdio_ns_t* ns = nullptr; - if (fdio_ns_create(&ns) == ZX_OK) { - return UniqueFDIONS{ns}; - } - return UniqueFDIONS{nullptr}; -} - -} // namespace flutter diff --git a/content_handler/vulkan_rasterizer.cc b/content_handler/vulkan_rasterizer.cc new file mode 100644 index 0000000000000..25f90c460ce3f --- /dev/null +++ b/content_handler/vulkan_rasterizer.cc @@ -0,0 +1,117 @@ +// Copyright 2017 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. + +#include "flutter/content_handler/vulkan_rasterizer.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "flutter/common/threads.h" +#include "flutter/glue/trace_event.h" +#include "lib/fxl/files/unique_fd.h" + +namespace flutter_runner { + +constexpr char kGpuDriverClass[] = "/dev/class/gpu"; + +static zx_status_t DriverWatcher(int dirfd, + int event, + const char* fn, + void* cookie) { + if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { + return ZX_ERR_STOP; + } + return ZX_OK; +} + +bool WaitForFirstGpuDriver() { + fxl::UniqueFD fd(open(kGpuDriverClass, O_DIRECTORY | O_RDONLY)); + if (fd.get() < 0) { + FXL_DLOG(ERROR) << "Failed to open " << kGpuDriverClass; + return false; + } + + zx_status_t status = fdio_watch_directory( + fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(5)), nullptr); + return status == ZX_ERR_STOP; +} + +VulkanRasterizer::VulkanRasterizer() : compositor_context_(nullptr) { + valid_ = WaitForFirstGpuDriver(); +} + +VulkanRasterizer::~VulkanRasterizer() = default; + +bool VulkanRasterizer::IsValid() const { + return valid_; +} + +void VulkanRasterizer::SetScene(fidl::InterfaceHandle scenic, + zx::eventpair import_token, + fxl::Closure metrics_changed_callback) { + ASSERT_IS_GPU_THREAD; + FXL_DCHECK(valid_ && !session_connection_); + session_connection_ = std::make_unique( + scenic.Bind(), std::move(import_token)); + session_connection_->set_metrics_changed_callback( + std::move(metrics_changed_callback)); +} + +void VulkanRasterizer::Draw(std::unique_ptr layer_tree, + fxl::Closure callback) { + ASSERT_IS_GPU_THREAD; + FXL_DCHECK(callback != nullptr); + + if (layer_tree == nullptr) { + FXL_LOG(ERROR) << "Layer tree was not valid."; + callback(); + return; + } + + if (!session_connection_) { + FXL_LOG(ERROR) << "Session was not valid."; + callback(); + return; + } + + if (!session_connection_->has_metrics()) { + // Still awaiting metrics. Will redraw when we get them. + callback(); + return; + } + + compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); + + flow::CompositorContext::ScopedFrame frame = compositor_context_.AcquireFrame( + nullptr, nullptr, true /* instrumentation enabled */); + { + // Preroll the Flutter layer tree. This allows Flutter to perform pre-paint + // optimizations. + TRACE_EVENT0("flutter", "Preroll"); + layer_tree->Preroll(frame, session_connection_->metrics().get()); + } + + { + // Traverse the Flutter layer tree so that the necessary session ops to + // represent the frame are enqueued in the underlying session. + TRACE_EVENT0("flutter", "UpdateScene"); + layer_tree->UpdateScene(session_connection_->scene_update_context(), + session_connection_->root_node()); + } + + { + // Flush all pending session ops. + TRACE_EVENT0("flutter", "SessionPresent"); + session_connection_->Present( + frame, [callback = std::move(callback)]() { callback(); }); + } +} + +} // namespace flutter_runner diff --git a/content_handler/vulkan_rasterizer.h b/content_handler/vulkan_rasterizer.h new file mode 100644 index 0000000000000..c3ae211553f5a --- /dev/null +++ b/content_handler/vulkan_rasterizer.h @@ -0,0 +1,42 @@ +// Copyright 2017 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. + +#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ +#define FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ + +#include + +#include "flutter/content_handler/rasterizer.h" +#include "flutter/content_handler/session_connection.h" +#include "flutter/flow/compositor_context.h" +#include "lib/fxl/macros.h" + +namespace flutter_runner { + +class VulkanRasterizer : public Rasterizer { + public: + VulkanRasterizer(); + + ~VulkanRasterizer() override; + + bool IsValid() const; + + void SetScene(fidl::InterfaceHandle scenic, + zx::eventpair import_token, + fxl::Closure metrics_changed_callback) override; + + void Draw(std::unique_ptr layer_tree, + fxl::Closure callback) override; + + private: + flow::CompositorContext compositor_context_; + std::unique_ptr session_connection_; + bool valid_; + + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanRasterizer); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index c78ad6c127545..47ac87e375e81 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "vulkan_surface.h" - #include +#include "flutter/content_handler/vulkan_surface.h" +#include "flutter/common/threads.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter { +namespace flutter_runner { VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -22,6 +22,8 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, backend_context_(std::move(backend_context)), session_(session), wait_(this) { + ASSERT_IS_GPU_THREAD; + FXL_DCHECK(session_); zx::vmo exported_vmo; @@ -53,6 +55,7 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, } VulkanSurface::~VulkanSurface() { + ASSERT_IS_GPU_THREAD; if (async_) { wait_.Cancel(async_); wait_.set_object(ZX_HANDLE_INVALID); @@ -322,6 +325,7 @@ bool VulkanSurface::PushSessionImageSetupOps(scenic_lib::Session* session, } scenic_lib::Image* VulkanSurface::GetImage() { + ASSERT_IS_GPU_THREAD; if (!valid_) { return 0; } @@ -329,6 +333,7 @@ scenic_lib::Image* VulkanSurface::GetImage() { } sk_sp VulkanSurface::GetSkiaSurface() const { + ASSERT_IS_GPU_THREAD; return valid_ ? sk_surface_ : nullptr; } @@ -353,6 +358,7 @@ bool VulkanSurface::FlushSessionAcquireAndReleaseEvents() { void VulkanSurface::SignalWritesFinished( std::function on_writes_committed) { + ASSERT_IS_GPU_THREAD; FXL_DCHECK(on_writes_committed); if (!valid_) { @@ -368,6 +374,8 @@ void VulkanSurface::SignalWritesFinished( } void VulkanSurface::Reset() { + ASSERT_IS_GPU_THREAD; + if (acquire_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK || release_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK) { valid_ = false; @@ -402,10 +410,10 @@ void VulkanSurface::Reset() { } } -async_wait_result_t VulkanSurface::OnHandleReady( - async_t* async, - zx_status_t status, - const zx_packet_signal_t* signal) { +async_wait_result_t VulkanSurface::OnHandleReady(async_t* async, + zx_status_t status, + const zx_packet_signal_t* signal) { + ASSERT_IS_GPU_THREAD; if (status != ZX_OK) return ASYNC_WAIT_FINISHED; FXL_DCHECK(signal->observed & ZX_EVENT_SIGNALED); @@ -413,4 +421,4 @@ async_wait_result_t VulkanSurface::OnHandleReady( return ASYNC_WAIT_AGAIN; } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface.h b/content_handler/vulkan_surface.h index 7add6b05bb8cc..41a807af81f9c 100644 --- a/content_handler/vulkan_surface.h +++ b/content_handler/vulkan_surface.h @@ -20,10 +20,9 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -namespace flutter { +namespace flutter_runner { -class VulkanSurface final - : public flow::SceneUpdateContext::SurfaceProducerSurface { +class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { public: VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -33,16 +32,12 @@ class VulkanSurface final ~VulkanSurface() override; - // |flow::SceneUpdateContext::SurfaceProducerSurface| size_t AdvanceAndGetAge() override; - // |flow::SceneUpdateContext::SurfaceProducerSurface| bool FlushSessionAcquireAndReleaseEvents() override; - // |flow::SceneUpdateContext::SurfaceProducerSurface| bool IsValid() const override; - // |flow::SceneUpdateContext::SurfaceProducerSurface| SkISize GetSize() const override; // Note: It is safe for the caller to collect the surface in the @@ -120,4 +115,4 @@ class VulkanSurface final FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); }; -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface_pool.cc b/content_handler/vulkan_surface_pool.cc index 93d14c2ddbff7..af23ef711b7ad 100644 --- a/content_handler/vulkan_surface_pool.cc +++ b/content_handler/vulkan_surface_pool.cc @@ -2,14 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "vulkan_surface_pool.h" - #include +#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter { +namespace flutter_runner { VulkanSurfacePool::VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -178,4 +177,4 @@ void VulkanSurfacePool::TraceStats() { trace_surfaces_reused_ = 0; } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface_pool.h b/content_handler/vulkan_surface_pool.h index 4900816762910..52dd3ed6aa417 100644 --- a/content_handler/vulkan_surface_pool.h +++ b/content_handler/vulkan_surface_pool.h @@ -6,13 +6,12 @@ #include #include - +#include "flutter/content_handler/vulkan_surface.h" #include "lib/fxl/macros.h" -#include "vulkan_surface.h" -namespace flutter { +namespace flutter_runner { -class VulkanSurfacePool final { +class VulkanSurfacePool { public: static const size_t kMaxSurfacesOfSameSize = 3; static const size_t kMaxSurfaceAge = 3; @@ -75,4 +74,4 @@ class VulkanSurfacePool final { FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfacePool); }; -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index ff8a9ab9d1f4a..6f605c109b7df 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -2,18 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "vulkan_surface_producer.h" +#include "flutter/content_handler/vulkan_surface_producer.h" #include #include #include - #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" -namespace flutter { +namespace flutter_runner { VulkanSurfaceProducer::VulkanSurfaceProducer( scenic_lib::Session* mozart_session) { @@ -43,7 +42,7 @@ bool VulkanSurfaceProducer::Initialize(scenic_lib::Session* mozart_session) { VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, }; application_ = std::make_unique( - *vk_, "FlutterApplicationRunner", std::move(extensions)); + *vk_, "FlutterContentHandler", std::move(extensions)); if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) { // Make certain the application instance was created and it setup the @@ -201,4 +200,4 @@ void VulkanSurfaceProducer::SubmitSurface( surface_pool_->SubmitSurface(std::move(surface)); } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface_producer.h b/content_handler/vulkan_surface_producer.h index 15c4419e8cde7..2338a8a6ba709 100644 --- a/content_handler/vulkan_surface_producer.h +++ b/content_handler/vulkan_surface_producer.h @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +#define FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +#include "flutter/content_handler/vulkan_surface.h" +#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/flow/scene_update_context.h" #include "flutter/vulkan/vulkan_application.h" #include "flutter/vulkan/vulkan_device.h" @@ -14,14 +17,11 @@ #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -#include "vulkan_surface.h" -#include "vulkan_surface_pool.h" -namespace flutter { +namespace flutter_runner { -class VulkanSurfaceProducer final - : public flow::SceneUpdateContext::SurfaceProducer, - public vulkan::VulkanProvider { +class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer, + public vulkan::VulkanProvider { public: VulkanSurfaceProducer(scenic_lib::Session* mozart_session); @@ -74,4 +74,6 @@ class VulkanSurfaceProducer final FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfaceProducer); }; -} // namespace flutter +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ diff --git a/flow/BUILD.gn b/flow/BUILD.gn index 07c5d4e5d4e7b..e6a6411a6c1da 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -48,12 +48,11 @@ source_set("flow") { "matrix_decomposition.h", "paint_utils.cc", "paint_utils.h", + "process_info.h", "raster_cache.cc", "raster_cache.h", "raster_cache_key.cc", "raster_cache_key.h", - "skia_gpu_object.cc", - "skia_gpu_object.h", "texture.cc", "texture.h", ] @@ -62,11 +61,12 @@ source_set("flow") { "//garnet/public/lib/fxl", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] deps = [ "$flutter_root/common", - "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/synchronization", "//third_party/skia", @@ -103,8 +103,8 @@ executable("flow_unittests") { deps = [ ":flow", - "$flutter_root/testing", "//third_party/dart/runtime:libdart_jit", # for tracing + "$flutter_root/testing", "//third_party/skia", ] } diff --git a/flow/compositor_context.cc b/flow/compositor_context.cc index 53659103be9f1..e0d17229e7981 100644 --- a/flow/compositor_context.cc +++ b/flow/compositor_context.cc @@ -4,12 +4,12 @@ #include "flutter/flow/compositor_context.h" -#include "flutter/flow/layers/layer_tree.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { -CompositorContext::CompositorContext() = default; +CompositorContext::CompositorContext(std::unique_ptr info) + : process_info_(std::move(info)) {} CompositorContext::~CompositorContext() = default; @@ -18,6 +18,10 @@ void CompositorContext::BeginFrame(ScopedFrame& frame, if (enable_instrumentation) { frame_count_.Increment(); frame_time_.Start(); + + if (process_info_ && process_info_->SampleNow()) { + memory_usage_.Add(process_info_->GetResidentMemorySize()); + } } } @@ -29,12 +33,11 @@ void CompositorContext::EndFrame(ScopedFrame& frame, } } -std::unique_ptr CompositorContext::AcquireFrame( +CompositorContext::ScopedFrame CompositorContext::AcquireFrame( GrContext* gr_context, SkCanvas* canvas, bool instrumentation_enabled) { - return std::make_unique(*this, gr_context, canvas, - instrumentation_enabled); + return ScopedFrame(*this, gr_context, canvas, instrumentation_enabled); } CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, @@ -48,23 +51,18 @@ CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, context_.BeginFrame(*this, instrumentation_enabled_); } +CompositorContext::ScopedFrame::ScopedFrame(ScopedFrame&& frame) = default; + CompositorContext::ScopedFrame::~ScopedFrame() { context_.EndFrame(*this, instrumentation_enabled_); } -bool CompositorContext::ScopedFrame::Raster(flow::LayerTree& layer_tree, - bool ignore_raster_cache) { - layer_tree.Preroll(*this, ignore_raster_cache); - layer_tree.Paint(*this); - return true; -} - void CompositorContext::OnGrContextCreated() { - texture_registry_.OnGrContextCreated(); + texture_registry_->OnGrContextCreated(); } void CompositorContext::OnGrContextDestroyed() { - texture_registry_.OnGrContextDestroyed(); + texture_registry_->OnGrContextDestroyed(); raster_cache_.Clear(); } diff --git a/flow/compositor_context.h b/flow/compositor_context.h index 14c2449dbecd0..2d310422747b7 100644 --- a/flow/compositor_context.h +++ b/flow/compositor_context.h @@ -9,6 +9,7 @@ #include #include "flutter/flow/instrumentation.h" +#include "flutter/flow/process_info.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" #include "lib/fxl/macros.h" @@ -17,26 +18,19 @@ namespace flow { -class LayerTree; - class CompositorContext { public: class ScopedFrame { public: - ScopedFrame(CompositorContext& context, - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled); - - virtual ~ScopedFrame(); - SkCanvas* canvas() { return canvas_; } CompositorContext& context() const { return context_; } GrContext* gr_context() const { return gr_context_; } - virtual bool Raster(LayerTree& layer_tree, bool ignore_raster_cache); + ScopedFrame(ScopedFrame&& frame); + + ~ScopedFrame(); private: CompositorContext& context_; @@ -44,17 +38,23 @@ class CompositorContext { SkCanvas* canvas_; const bool instrumentation_enabled_; + ScopedFrame(CompositorContext& context, + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled); + + friend class CompositorContext; + FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); }; - CompositorContext(); + CompositorContext(std::unique_ptr info); - virtual ~CompositorContext(); + ~CompositorContext(); - virtual std::unique_ptr AcquireFrame( - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled); + ScopedFrame AcquireFrame(GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled = true); void OnGrContextCreated(); @@ -62,7 +62,7 @@ class CompositorContext { RasterCache& raster_cache() { return raster_cache_; } - TextureRegistry& texture_registry() { return texture_registry_; } + TextureRegistry& texture_registry() { return *texture_registry_; } const Counter& frame_count() const { return frame_count_; } @@ -70,12 +70,20 @@ class CompositorContext { Stopwatch& engine_time() { return engine_time_; } + const CounterValues& memory_usage() const { return memory_usage_; } + + void SetTextureRegistry(TextureRegistry* textureRegistry) { + texture_registry_ = textureRegistry; + } + private: RasterCache raster_cache_; - TextureRegistry texture_registry_; + TextureRegistry* texture_registry_; + std::unique_ptr process_info_; Counter frame_count_; Stopwatch frame_time_; Stopwatch engine_time_; + CounterValues memory_usage_; void BeginFrame(ScopedFrame& frame, bool enable_instrumentation); diff --git a/flow/debug_print.cc b/flow/debug_print.cc index 3311b9c2b43e3..0aa5b4b3b7d2d 100644 --- a/flow/debug_print.cc +++ b/flow/debug_print.cc @@ -80,8 +80,3 @@ std::ostream& operator<<(std::ostream& os, const flow::RasterCacheKey& k) { ; return os; } - -std::ostream& operator<<(std::ostream& os, const SkISize& size) { - os << size.width() << ", " << size.height(); - return os; -} diff --git a/flow/debug_print.h b/flow/debug_print.h index 78a28fe38562d..ca5973eeb0977 100644 --- a/flow/debug_print.h +++ b/flow/debug_print.h @@ -15,15 +15,14 @@ #define DEF_PRINTER(x) std::ostream& operator<<(std::ostream&, const x&); -DEF_PRINTER(flow::MatrixDecomposition); DEF_PRINTER(flow::RasterCacheKey); -DEF_PRINTER(SkISize); +DEF_PRINTER(flow::MatrixDecomposition); DEF_PRINTER(SkMatrix); DEF_PRINTER(SkMatrix44); -DEF_PRINTER(SkPoint); -DEF_PRINTER(SkRect); -DEF_PRINTER(SkRRect); DEF_PRINTER(SkVector3); DEF_PRINTER(SkVector4); +DEF_PRINTER(SkRect); +DEF_PRINTER(SkRRect); +DEF_PRINTER(SkPoint); #endif // FLUTTER_FLOW_DEBUG_PRINT_H_ diff --git a/flow/export_node.cc b/flow/export_node.cc index 27ab34030ca42..a130c426a75bf 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -4,27 +4,28 @@ #include "flutter/flow/export_node.h" +#include "flutter/common/threads.h" #include "lib/fxl/functional/make_copyable.h" namespace flow { ExportNodeHolder::ExportNodeHolder( - fxl::RefPtr gpu_task_runner, fxl::RefPtr export_token_handle) - : gpu_task_runner_(std::move(gpu_task_runner)), - export_node_(std::make_unique(export_token_handle)) { - FXL_DCHECK(gpu_task_runner_); + : export_node_(std::make_unique(export_token_handle)) { + ASSERT_IS_UI_THREAD; } void ExportNodeHolder::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { + ASSERT_IS_GPU_THREAD; export_node_->Bind(context, container, offset, hit_testable); } ExportNodeHolder::~ExportNodeHolder() { - gpu_task_runner_->PostTask( + ASSERT_IS_UI_THREAD; + blink::Threads::Gpu()->PostTask( fxl::MakeCopyable([export_node = std::move(export_node_)]() { export_node->Dispose(true); })); @@ -43,6 +44,8 @@ void ExportNode::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { + ASSERT_IS_GPU_THREAD; + if (export_token_) { // Happens first time we bind. node_.reset(new scenic_lib::EntityNode(container.session())); @@ -64,6 +67,8 @@ void ExportNode::Bind(SceneUpdateContext& context, } void ExportNode::Dispose(bool remove_from_scene_update_context) { + ASSERT_IS_GPU_THREAD; + // If scene_update_context_ is set, then we should still have a node left to // dereference. // If scene_update_context_ is null, then either: diff --git a/flow/export_node.h b/flow/export_node.h index e6a11175e561e..24f94fcebf20f 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -15,7 +15,6 @@ #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/ui/scenic/client/resources.h" -#include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" namespace flow { @@ -25,8 +24,7 @@ namespace flow { // held by the ExportNode. class ExportNodeHolder : public fxl::RefCountedThreadSafe { public: - ExportNodeHolder(fxl::RefPtr gpu_task_runner, - fxl::RefPtr export_token_handle); + ExportNodeHolder(fxl::RefPtr export_token_handle); ~ExportNodeHolder(); // Calls Bind() on the wrapped ExportNode. @@ -38,7 +36,6 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { ExportNode* export_node() { return export_node_.get(); } private: - fxl::RefPtr gpu_task_runner_; std::unique_ptr export_node_; FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index ca228a7d58f76..a33b0eaa681b7 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -137,20 +137,20 @@ void DefaultLayerBuilder::PushPerformanceOverlay(uint64_t enabled_options, } void DefaultLayerBuilder::PushPicture(const SkPoint& offset, - SkiaGPUObject picture, + sk_sp picture, bool picture_is_complex, bool picture_will_change) { if (!current_layer_) { return; } - SkRect pictureRect = picture.get()->cullRect(); + SkRect pictureRect = picture->cullRect(); pictureRect.offset(offset.x(), offset.y()); if (!SkRect::Intersects(pictureRect, cull_rects_.top())) { return; } auto layer = std::make_unique(); layer->set_offset(offset); - layer->set_picture(std::move(picture)); + layer->set_picture(picture); layer->set_is_complex(picture_is_complex); layer->set_will_change(picture_will_change); current_layer_->Add(std::move(layer)); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index cadd173ab5a84..a62ec46714d21 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -59,7 +59,7 @@ class DefaultLayerBuilder final : public LayerBuilder { // |flow::LayerBuilder| void PushPicture(const SkPoint& offset, - SkiaGPUObject picture, + sk_sp picture, bool picture_is_complex, bool picture_will_change) override; diff --git a/flow/layers/layer.h b/flow/layers/layer.h index cf7ad71c36fae..d0ef1990ab4f2 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -44,6 +44,9 @@ class Layer { virtual ~Layer(); struct PrerollContext { +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics = nullptr; +#endif RasterCache* raster_cache; GrContext* gr_context; SkColorSpace* dst_color_space; @@ -56,6 +59,7 @@ class Layer { SkCanvas& canvas; const Stopwatch& frame_time; const Stopwatch& engine_time; + const CounterValues& memory_usage; TextureRegistry& texture_registry; const bool checkerboard_offscreen_layers; }; diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index a29e959514428..91ae13974a23b 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -8,7 +8,6 @@ #include #include "flutter/flow/layers/layer.h" -#include "flutter/flow/skia_gpu_object.h" #include "garnet/public/lib/fxl/macros.h" #include "third_party/skia/include/core/SkBlendMode.h" #include "third_party/skia/include/core/SkColor.h" @@ -58,7 +57,7 @@ class LayerBuilder { const SkRect& rect) = 0; virtual void PushPicture(const SkPoint& offset, - SkiaGPUObject picture, + sk_sp picture, bool picture_is_complex, bool picture_will_change) = 0; diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index d9fb374194688..fde2fc4bf0866 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -17,18 +17,43 @@ LayerTree::LayerTree() LayerTree::~LayerTree() = default; +void LayerTree::Raster(CompositorContext::ScopedFrame& frame, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif + bool ignore_raster_cache) { +#if defined(OS_FUCHSIA) + FXL_DCHECK(metrics); +#endif + Preroll(frame, +#if defined(OS_FUCHSIA) + metrics, +#endif + ignore_raster_cache); + Paint(frame); +} + void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool ignore_raster_cache) { +#if defined(OS_FUCHSIA) + FXL_DCHECK(metrics); +#endif TRACE_EVENT0("flutter", "LayerTree::Preroll"); SkColorSpace* color_space = frame.canvas() ? frame.canvas()->imageInfo().colorSpace() : nullptr; frame.context().raster_cache().SetCheckboardCacheImages( checkerboard_raster_cache_images_); Layer::PrerollContext context = { - ignore_raster_cache ? nullptr : &frame.context().raster_cache(), - frame.gr_context(), - color_space, - SkRect::MakeEmpty(), +#if defined(OS_FUCHSIA) + metrics, +#endif + ignore_raster_cache ? nullptr : &frame.context().raster_cache(), + frame.gr_context(), + color_space, + SkRect::MakeEmpty(), }; root_layer_->Preroll(&context, SkMatrix::I()); @@ -38,12 +63,9 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, void LayerTree::UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container) { TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); - const auto& metrics = context.metrics(); - SceneUpdateContext::Transform transform(context, // context - 1.0f / metrics->scale_x, // X - 1.0f / metrics->scale_y, // Y - 1.0f / metrics->scale_z // Z - ); + + SceneUpdateContext::Transform transform(context, 1.f / device_pixel_ratio_, + 1.f / device_pixel_ratio_, 1.f); SceneUpdateContext::Frame frame( context, SkRRect::MakeRect( @@ -60,13 +82,12 @@ void LayerTree::UpdateScene(SceneUpdateContext& context, #endif void LayerTree::Paint(CompositorContext::ScopedFrame& frame) const { - Layer::PaintContext context = { - *frame.canvas(), // - frame.context().frame_time(), // - frame.context().engine_time(), // - frame.context().texture_registry(), // - checkerboard_offscreen_layers_ // - }; + Layer::PaintContext context = {*frame.canvas(), + frame.context().frame_time(), + frame.context().engine_time(), + frame.context().memory_usage(), + frame.context().texture_registry(), + checkerboard_offscreen_layers_}; TRACE_EVENT0("flutter", "LayerTree::Paint"); if (root_layer_->needs_painting()) diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 25a8e072cfa21..5ddebd088de9e 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -13,6 +13,9 @@ #include "flutter/flow/layers/layer.h" #include "lib/fxl/macros.h" #include "lib/fxl/time/time_delta.h" +#if defined(OS_FUCHSIA) +#include +#endif #include "third_party/skia/include/core/SkSize.h" namespace flow { @@ -23,10 +26,24 @@ class LayerTree { ~LayerTree(); + // Raster includes both Preroll and Paint. + void Raster(CompositorContext::ScopedFrame& frame, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif + bool ignore_raster_cache = false); + void Preroll(CompositorContext::ScopedFrame& frame, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool ignore_raster_cache = false); #if defined(OS_FUCHSIA) + void set_device_pixel_ratio(float device_pixel_ratio) { + device_pixel_ratio_ = device_pixel_ratio; + } + void UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container); #endif @@ -76,6 +93,10 @@ class LayerTree { bool checkerboard_raster_cache_images_; bool checkerboard_offscreen_layers_; +#if defined(OS_FUCHSIA) + float device_pixel_ratio_ = 1.f; +#endif + FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree); }; diff --git a/flow/layers/performance_overlay_layer.cc b/flow/layers/performance_overlay_layer.cc index 7d871af33b94f..cc55500115a08 100644 --- a/flow/layers/performance_overlay_layer.cc +++ b/flow/layers/performance_overlay_layer.cc @@ -57,6 +57,34 @@ void VisualizeStopWatch(SkCanvas& canvas, } } +void VisualizeCounterValuesBytes(SkCanvas& canvas, + const CounterValues& counter_values, + SkScalar x, + SkScalar y, + SkScalar width, + SkScalar height, + bool show_graph, + bool show_labels, + const std::string& label_prefix) { + 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); + counter_values.Visualize(canvas, visualization_rect); + } + + auto current_usage = counter_values.GetCurrentValue(); + + if (show_labels && current_usage > 0) { + std::stringstream stream; + stream.setf(std::ios::fixed | std::ios::showpoint); + stream << std::setprecision(2); + stream << label_prefix << " " << current_usage * 1e-6 << " MB"; + DrawStatisticsText(canvas, stream.str(), x + label_x, y + height + label_y); + } +} + } // namespace PerformanceOverlayLayer::PerformanceOverlayLayer(uint64_t options) @@ -83,6 +111,11 @@ void PerformanceOverlayLayer::Paint(PaintContext& context) const { VisualizeStopWatch(context.canvas, context.engine_time, x, y + height, width, height - padding, options_ & kVisualizeEngineStatistics, options_ & kDisplayEngineStatistics, "UI"); + + VisualizeCounterValuesBytes( + context.canvas, context.memory_usage, x, y + (2 * height), width, + height - padding, options_ & kVisualizeMemoryStatistics, + options_ & kDisplayMemoryStatistics, "Memory (Resident)"); } } // namespace flow diff --git a/flow/layers/performance_overlay_layer.h b/flow/layers/performance_overlay_layer.h index 77448107147a4..e7c3ac530a02a 100644 --- a/flow/layers/performance_overlay_layer.h +++ b/flow/layers/performance_overlay_layer.h @@ -14,6 +14,8 @@ const int kDisplayRasterizerStatistics = 1 << 0; const int kVisualizeRasterizerStatistics = 1 << 1; const int kDisplayEngineStatistics = 1 << 2; const int kVisualizeEngineStatistics = 1 << 3; +const int kDisplayMemoryStatistics = 1 << 4; +const int kVisualizeMemoryStatistics = 1 << 5; class PerformanceOverlayLayer : public Layer { public: diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index 552ca0443bd80..4a99d7d07f75e 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -4,30 +4,39 @@ #include "flutter/flow/layers/picture_layer.h" +#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace flow { PictureLayer::PictureLayer() = default; -PictureLayer::~PictureLayer() = default; +PictureLayer::~PictureLayer() { + // The picture may contain references to textures that are associated + // with the IO thread's context. + SkPicture* picture = picture_.release(); + if (picture) { + blink::Threads::IO()->PostTask([picture]() { picture->unref(); }); + } +} void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { - SkPicture* sk_picture = picture(); - if (auto cache = context->raster_cache) { raster_cache_result_ = cache->GetPrerolledImage( - context->gr_context, sk_picture, matrix, context->dst_color_space, + context->gr_context, picture_.get(), matrix, context->dst_color_space, +#if defined(OS_FUCHSIA) + context->metrics, +#endif is_complex_, will_change_); } - SkRect bounds = sk_picture->cullRect().makeOffset(offset_.x(), offset_.y()); + SkRect bounds = picture_->cullRect().makeOffset(offset_.x(), offset_.y()); set_paint_bounds(bounds); } void PictureLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PictureLayer::Paint"); - FXL_DCHECK(picture_.get()); + FXL_DCHECK(picture_); FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); @@ -44,7 +53,7 @@ void PictureLayer::Paint(PaintContext& context) const { SkCanvas::kStrict_SrcRectConstraint // source constraint ); } else { - context.canvas.drawPicture(picture()); + context.canvas.drawPicture(picture_.get()); } } diff --git a/flow/layers/picture_layer.h b/flow/layers/picture_layer.h index c67929b7cb455..191ef9d7097a2 100644 --- a/flow/layers/picture_layer.h +++ b/flow/layers/picture_layer.h @@ -5,11 +5,8 @@ #ifndef FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ #define FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ -#include - #include "flutter/flow/layers/layer.h" #include "flutter/flow/raster_cache.h" -#include "flutter/flow/skia_gpu_object.h" namespace flow { @@ -19,14 +16,12 @@ class PictureLayer : public Layer { ~PictureLayer() override; void set_offset(const SkPoint& offset) { offset_ = offset; } - void set_picture(SkiaGPUObject picture) { - picture_ = std::move(picture); - } + void set_picture(sk_sp picture) { picture_ = std::move(picture); } void set_is_complex(bool value) { is_complex_ = value; } void set_will_change(bool value) { will_change_ = value; } - SkPicture* picture() const { return picture_.get().get(); } + SkPicture* picture() const { return picture_.get(); } void Preroll(PrerollContext* frame, const SkMatrix& matrix) override; @@ -34,9 +29,7 @@ class PictureLayer : public Layer { private: SkPoint offset_; - // Even though pictures themselves are not GPU resources, they may reference - // images that have a reference to a GPU resource. - SkiaGPUObject picture_; + sk_sp picture_; bool is_complex_ = false; bool will_change_ = false; RasterCacheResult raster_cache_result_; diff --git a/flow/process_info.h b/flow/process_info.h new file mode 100644 index 0000000000000..6623fe7257396 --- /dev/null +++ b/flow/process_info.h @@ -0,0 +1,31 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_FLOW_PROCESS_INFO_H_ +#define FLUTTER_FLOW_PROCESS_INFO_H_ + +#include "lib/fxl/macros.h" + +namespace flow { + +/// The CompositorContext attempts to collect information from the process for +/// instrumentation purposes. The compositor does not have the platform +/// specific capabilities to collect this information on its own. The platform +/// can choose to provide this information however. +class ProcessInfo { + public: + virtual ~ProcessInfo() = default; + + virtual bool SampleNow() = 0; + + /// Virtual memory size in bytes. + virtual size_t GetVirtualMemorySize() = 0; + + /// Resident memory size in bytes. + virtual size_t GetResidentMemorySize() = 0; +}; + +} // namespace flow + +#endif // FLUTTER_FLOW_PROCESS_INFO_H_ diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 11a86729b489b..aa9fad0e281de 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -6,6 +6,7 @@ #include +#include "flutter/common/threads.h" #include "flutter/flow/paint_utils.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @@ -72,6 +73,9 @@ RasterCacheResult RasterizePicture(SkPicture* picture, GrContext* context, const MatrixDecomposition& matrix, SkColorSpace* dst_color_space, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool checkerboard) { TRACE_EVENT0("flutter", "RasterCachePopulate"); @@ -79,9 +83,17 @@ RasterCacheResult RasterizePicture(SkPicture* picture, const SkRect logical_rect = picture->cullRect(); - const SkRect physical_rect = - SkRect::MakeWH(std::fabs(logical_rect.width() * scale.x()), - std::fabs(logical_rect.height() * scale.y())); +#if defined(OS_FUCHSIA) + float metrics_scale_x = metrics->scale_x; + float metrics_scale_y = metrics->scale_y; +#else + float metrics_scale_x = 1.f; + float metrics_scale_y = 1.f; +#endif + + const SkRect physical_rect = SkRect::MakeWH( + std::fabs(logical_rect.width() * metrics_scale_x * scale.x()), + std::fabs(logical_rect.height() * metrics_scale_y * scale.y())); const SkImageInfo image_info = SkImageInfo::MakeN32Premul( std::ceil(physical_rect.width()), // physical width @@ -108,7 +120,8 @@ RasterCacheResult RasterizePicture(SkPicture* picture, } canvas->clear(SK_ColorTRANSPARENT); - canvas->scale(std::abs(scale.x()), std::abs(scale.y())); + canvas->scale(std::abs(scale.x() * metrics_scale_x), + std::abs(scale.y() * metrics_scale_y)); canvas->translate(-logical_rect.left(), -logical_rect.top()); canvas->drawPicture(picture); @@ -140,6 +153,9 @@ RasterCacheResult RasterCache::GetPrerolledImage( SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool is_complex, bool will_change) { if (!IsPictureWorthRasterizing(picture, will_change, is_complex)) { @@ -156,7 +172,11 @@ RasterCacheResult RasterCache::GetPrerolledImage( return {}; } - RasterCacheKey cache_key(*picture, matrix); + RasterCacheKey cache_key(*picture, +#if defined(OS_FUCHSIA) + metrics->scale_x, metrics->scale_y, +#endif + matrix); Entry& entry = cache_[cache_key]; entry.access_count = ClampSize(entry.access_count + 1, 0, threshold_); @@ -169,6 +189,9 @@ RasterCacheResult RasterCache::GetPrerolledImage( if (!entry.image.is_valid()) { entry.image = RasterizePicture(picture, context, matrix, dst_color_space, +#if defined(OS_FUCHSIA) + metrics, +#endif checkerboard_images_); } diff --git a/flow/raster_cache.h b/flow/raster_cache.h index 3278eb355b030..31201049b6119 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -12,6 +12,9 @@ #include "flutter/flow/raster_cache_key.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" +#if defined(OS_FUCHSIA) +#include +#endif #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -54,6 +57,9 @@ class RasterCache { SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool is_complex, bool will_change); diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index 1f28ea5320d36..83df52658c981 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -15,15 +15,30 @@ namespace flow { class RasterCacheKey { public: - RasterCacheKey(const SkPicture& picture, const MatrixDecomposition& matrix) + RasterCacheKey(const SkPicture& picture, +#if defined(OS_FUCHSIA) + float metrics_scale_x, + float metrics_scale_y, +#endif + const MatrixDecomposition& matrix) : picture_id_(picture.uniqueID()), - scale_key_(SkISize::Make(matrix.scale().x() * 1e3, - matrix.scale().y() * 1e3)) {} +#if defined(OS_FUCHSIA) + metrics_scale_x_(metrics_scale_x), + metrics_scale_y_(metrics_scale_y), +#endif + scale_key_( + SkISize::Make(matrix.scale().x() * 1e3, matrix.scale().y() * 1e3)) { + } uint32_t picture_id() const { return picture_id_; } const SkISize& scale_key() const { return scale_key_; } +#if defined(OS_FUCHSIA) + float metrics_scale_x() const { return metrics_scale_x_; } + float metrics_scale_y() const { return metrics_scale_y_; } +#endif + struct Hash { std::size_t operator()(RasterCacheKey const& key) const { return key.picture_id_; @@ -34,6 +49,11 @@ class RasterCacheKey { constexpr bool operator()(const RasterCacheKey& lhs, const RasterCacheKey& rhs) const { return lhs.picture_id_ == rhs.picture_id_ && +#if defined(OS_FUCHSIA) + lhs.metrics_scale_x_ == rhs.metrics_scale_x_ && + + lhs.metrics_scale_y_ == rhs.metrics_scale_y_ && +#endif lhs.scale_key_ == rhs.scale_key_; } }; @@ -43,6 +63,10 @@ class RasterCacheKey { private: uint32_t picture_id_; +#if defined(OS_FUCHSIA) + float metrics_scale_x_; + float metrics_scale_y_; +#endif SkISize scale_key_; }; diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index b9d6801cc82ee..83883c508b4df 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -4,6 +4,7 @@ #include "flutter/flow/scene_update_context.h" +#include "flutter/common/threads.h" #include "flutter/flow/export_node.h" #include "flutter/flow/layers/layer.h" #include "flutter/flow/matrix_decomposition.h" @@ -18,7 +19,9 @@ SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session, } SceneUpdateContext::~SceneUpdateContext() { - // Release Mozart session resources for all ExportNodes. + ASSERT_IS_GPU_THREAD; + + // Release Scenic session resources for all ExportNodes. for (auto export_node : export_nodes_) { export_node->Dispose(false); } @@ -27,16 +30,21 @@ SceneUpdateContext::~SceneUpdateContext() { void SceneUpdateContext::AddChildScene(ExportNode* export_node, SkPoint offset, bool hit_testable) { + ASSERT_IS_GPU_THREAD; FXL_DCHECK(top_entity_); export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable); } void SceneUpdateContext::AddExportNode(ExportNode* export_node) { + ASSERT_IS_GPU_THREAD; + export_nodes_.insert(export_node); // Might already have been added. } void SceneUpdateContext::RemoveExportNode(ExportNode* export_node) { + ASSERT_IS_GPU_THREAD; + export_nodes_.erase(export_node); } @@ -187,9 +195,12 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { for (auto& task : paint_tasks_) { FXL_DCHECK(task.surface); SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas(); - Layer::PaintContext context = {*canvas, frame.context().frame_time(), + Layer::PaintContext context = {*canvas, + frame.context().frame_time(), frame.context().engine_time(), - frame.context().texture_registry(), false}; + frame.context().memory_usage(), + frame.context().texture_registry(), + false}; canvas->restoreToCount(1); canvas->save(); canvas->clear(task.background_color); diff --git a/flow/skia_gpu_object.cc b/flow/skia_gpu_object.cc deleted file mode 100644 index ce2312f921580..0000000000000 --- a/flow/skia_gpu_object.cc +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017 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/skia_gpu_object.h" - -#include "flutter/fml/message_loop.h" - -namespace flow { - -SkiaUnrefQueue::SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay) - : task_runner_(std::move(task_runner)), - drain_delay_(delay), - drain_pending_(false) {} - -SkiaUnrefQueue::~SkiaUnrefQueue() { - Drain(); -} - -void SkiaUnrefQueue::Unref(SkRefCnt* object) { - std::lock_guard lock(mutex_); - objects_.push_back(object); - if (!drain_pending_) { - drain_pending_ = true; - task_runner_->PostDelayedTask( - [strong = fxl::Ref(this)]() { strong->Drain(); }, drain_delay_); - } -} - -void SkiaUnrefQueue::Drain() { - std::deque skia_objects; - { - std::lock_guard lock(mutex_); - objects_.swap(skia_objects); - drain_pending_ = false; - } - - for (SkRefCnt* skia_object : skia_objects) { - skia_object->unref(); - } -} - -} // namespace flow diff --git a/flow/skia_gpu_object.h b/flow/skia_gpu_object.h deleted file mode 100644 index 4711f80c6f4fd..0000000000000 --- a/flow/skia_gpu_object.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2017 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_FLOW_SKIA_GPU_OBJECT_H_ -#define FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ - -#include -#include - -#include "flutter/fml/memory/weak_ptr.h" -#include "flutter/fml/task_runner.h" -#include "lib/fxl/memory/ref_ptr.h" -#include "third_party/skia/include/core/SkRefCnt.h" - -namespace flow { - -// A queue that holds Skia objects that must be destructed on the the given task -// runner. -class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { - public: - void Unref(SkRefCnt* object); - - // Usually, the drain is called automatically. However, during IO manager - // shutdown (when the platform side reference to the OpenGL context is about - // to go away), we may need to pre-emptively drain the unref queue. It is the - // responsibility of the caller to ensure that no further unrefs are queued - // after this call. - void Drain(); - - private: - const fxl::RefPtr task_runner_; - const fxl::TimeDelta drain_delay_; - std::mutex mutex_; - std::deque objects_; - bool drain_pending_; - - SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay); - - ~SkiaUnrefQueue(); - - FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); - FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); -}; - -/// An object whose deallocation needs to be performed on an specific unref -/// queue. The template argument U need to have a call operator that returns -/// that unref queue. -template -class SkiaGPUObject { - public: - using SkiaObjectType = T; - - SkiaGPUObject() = default; - - SkiaGPUObject(sk_sp object, fxl::RefPtr queue) - : object_(std::move(object)), queue_(std::move(queue)) { - FXL_DCHECK(queue_ && object_); - } - - SkiaGPUObject(SkiaGPUObject&&) = default; - - ~SkiaGPUObject() { reset(); } - - SkiaGPUObject& operator=(SkiaGPUObject&&) = default; - - sk_sp get() const { return object_; } - - void reset() { - if (object_) { - queue_->Unref(object_.release()); - } - queue_ = nullptr; - FXL_DCHECK(object_ == nullptr); - } - - private: - sk_sp object_; - fxl::RefPtr queue_; - - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); -}; - -} // namespace flow - -#endif // FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ diff --git a/flow/texture.cc b/flow/texture.cc index d5cc3ae228aa7..33a48af989477 100644 --- a/flow/texture.cc +++ b/flow/texture.cc @@ -11,32 +11,36 @@ TextureRegistry::TextureRegistry() = default; TextureRegistry::~TextureRegistry() = default; void TextureRegistry::RegisterTexture(std::shared_ptr texture) { + ASSERT_IS_GPU_THREAD mapping_[texture->Id()] = texture; } void TextureRegistry::UnregisterTexture(int64_t id) { + ASSERT_IS_GPU_THREAD mapping_.erase(id); } void TextureRegistry::OnGrContextCreated() { + ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextCreated(); } } void TextureRegistry::OnGrContextDestroyed() { + ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextDestroyed(); } } std::shared_ptr TextureRegistry::GetTexture(int64_t id) { + ASSERT_IS_GPU_THREAD auto it = mapping_.find(id); return it != mapping_.end() ? it->second : nullptr; } Texture::Texture(int64_t id) : id_(id) {} - Texture::~Texture() = default; } // namespace flow diff --git a/flow/texture.h b/flow/texture.h index f5e4430834084..a602a6b45b5b4 100644 --- a/flow/texture.h +++ b/flow/texture.h @@ -6,7 +6,7 @@ #define FLUTTER_FLOW_TEXTURE_H_ #include - +#include "flutter/common/threads.h" #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -29,9 +29,6 @@ class Texture { // Called from GPU thread. virtual void OnGrContextDestroyed() = 0; - // Called on GPU thread. - virtual void MarkNewFrameAvailable() = 0; - int64_t Id() { return id_; } private: diff --git a/fml/BUILD.gn b/fml/BUILD.gn index ffbf949cc0957..6dabcb446c912 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -4,12 +4,9 @@ source_set("fml") { sources = [ - "file.h", "icu_util.cc", "icu_util.h", - "mapping.cc", "mapping.h", - "memory/thread_checker.h", "memory/weak_ptr.h", "memory/weak_ptr_internal.cc", "memory/weak_ptr_internal.h", @@ -17,9 +14,8 @@ source_set("fml") { "message_loop.h", "message_loop_impl.cc", "message_loop_impl.h", - "native_library.h", - "paths.cc", "paths.h", + "task_observer.h", "task_runner.cc", "task_runner.h", "thread.cc", @@ -27,9 +23,6 @@ source_set("fml") { "thread_local.h", "trace_event.cc", "trace_event.h", - "unique_fd.cc", - "unique_fd.h", - "unique_object.h", ] deps = [ @@ -102,25 +95,16 @@ source_set("fml") { ] } - if (is_fuchsia) { - sources += [ "platform/fuchsia/paths_fuchsia.cc" ] - } - if (is_win) { sources += [ - "platform/win/file_win.cc", "platform/win/mapping_win.cc", "platform/win/message_loop_win.cc", "platform/win/message_loop_win.h", - "platform/win/native_library_win.cc", "platform/win/paths_win.cc", - "platform/win/wstring_conversion.h", ] } else { sources += [ - "platform/posix/file_posix.cc", "platform/posix/mapping_posix.cc", - "platform/posix/native_library_posix.cc", ] } } diff --git a/fml/file.h b/fml/file.h deleted file mode 100644 index 2327b2eef831e..0000000000000 --- a/fml/file.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2018 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_FILE_H_ -#define FLUTTER_FML_FILE_H_ - -#include "flutter/fml/unique_fd.h" -#include "lib/fxl/macros.h" - -namespace fml { - -enum class OpenPermission { - kRead = 1, - kWrite = 1 << 1, - kReadWrite = kRead | kWrite, - kExecute, -}; - -fml::UniqueFD OpenFile(const char* path, - OpenPermission permission, - bool is_directory = false); - -fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, - const char* path, - OpenPermission permission, - bool is_directory = false); - -fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor); - -bool IsDirectory(const fml::UniqueFD& directory); - -} // namespace fml - -#endif // FLUTTER_FML_FILE_H_ diff --git a/fml/icu_util.cc b/fml/icu_util.cc index 0c0acd06dbbdf..093dc3d02b1bc 100644 --- a/fml/icu_util.cc +++ b/fml/icu_util.cc @@ -22,6 +22,8 @@ static constexpr char kPathSeparator = '\\'; static constexpr char kPathSeparator = '/'; #endif +static constexpr char kIcuDataFileName[] = "icudtl.dat"; + class ICUContext { public: ICUContext(const std::string& icu_data_path) : valid_(false) { @@ -32,15 +34,15 @@ class ICUContext { bool SetupMapping(const std::string& icu_data_path) { // Check if the explicit path specified exists. - auto path_mapping = std::make_unique(icu_data_path, false); - if (path_mapping->GetSize() != 0) { - mapping_ = std::move(path_mapping); + auto overriden_path_mapping = std::make_unique(icu_data_path); + if (overriden_path_mapping->GetSize() != 0) { + mapping_ = std::move(overriden_path_mapping); return true; } // Check to see if the mapping is in the resources bundle. if (PlatformHasResourcesBundle()) { - auto resource = GetResourceMapping(icu_data_path); + auto resource = GetResourceMapping(kIcuDataFileName); if (resource != nullptr && resource->GetSize() != 0) { mapping_ = std::move(resource); return true; @@ -55,8 +57,10 @@ class ICUContext { return false; } + // FIXME(chinmaygarde): There is no Path::Join in FXL. So a non-portable + // version is used here. Patch FXL and update. auto file = std::make_unique( - directory.second + kPathSeparator + icu_data_path, false); + directory.second + kPathSeparator + kIcuDataFileName); if (file->GetSize() != 0) { mapping_ = std::move(file); return true; @@ -92,8 +96,7 @@ class ICUContext { void InitializeICUOnce(const std::string& icu_data_path) { static ICUContext* context = new ICUContext(icu_data_path); - FXL_CHECK(context->IsValid()) - << "Must be able to initialize the ICU context. Tried: " << icu_data_path; + FXL_CHECK(context->IsValid()) << "Must be able to initialize the ICU context"; } std::once_flag g_icu_init_flag; diff --git a/fml/macros.h b/fml/macros.h deleted file mode 100644 index ba46b9dda4b4d..0000000000000 --- a/fml/macros.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 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_MACROS_H_ -#define FLUTTER_FML_MACROS_H_ - -#include "lib/fxl/macros.h" - -#ifndef FML_USED_ON_EMBEDDER - -#define FML_EMBEDDER_ONLY [[deprecated]] - -#else // FML_USED_ON_EMBEDDER - -#define FML_EMBEDDER_ONLY - -#endif // FML_USED_ON_EMBEDDER - -#endif // FLUTTER_FML_MACROS_H_ diff --git a/fml/mapping.cc b/fml/mapping.cc deleted file mode 100644 index 97d7905015f61..0000000000000 --- a/fml/mapping.cc +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 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/mapping.h" - -namespace fml { - -DataMapping::DataMapping(std::vector data) : data_(std::move(data)) {} - -DataMapping::~DataMapping() = default; - -size_t DataMapping::GetSize() const { - return data_.size(); -} - -const uint8_t* DataMapping::GetMapping() const { - return data_.data(); -} -} // namespace fml diff --git a/fml/mapping.h b/fml/mapping.h index 00e9685dd6b0c..8963b22a9c1f6 100644 --- a/fml/mapping.h +++ b/fml/mapping.h @@ -7,10 +7,14 @@ #include #include -#include -#include "flutter/fml//unique_fd.h" #include "lib/fxl/build_config.h" + +#if OS_WIN +#include +#endif + +#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { @@ -35,9 +39,12 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name); class FileMapping : public Mapping { public: - FileMapping(const std::string& path, bool executable = false); + FileMapping(const std::string& path); - FileMapping(const fml::UniqueFD& fd, bool executable = false); +// fxl::UniqueFD isn't supported for Windows handles. +#if !OS_WIN + FileMapping(const fxl::UniqueFD& fd); +#endif ~FileMapping() override; @@ -46,32 +53,16 @@ class FileMapping : public Mapping { const uint8_t* GetMapping() const override; private: - size_t size_ = 0; - uint8_t* mapping_ = nullptr; + size_t size_; + uint8_t* mapping_; #if OS_WIN - fml::UniqueFD mapping_handle_; + HANDLE mapping_handle_; #endif FXL_DISALLOW_COPY_AND_ASSIGN(FileMapping); }; -class DataMapping : public Mapping { - public: - DataMapping(std::vector data); - - ~DataMapping() override; - - size_t GetSize() const override; - - const uint8_t* GetMapping() const override; - - private: - std::vector data_; - - FXL_DISALLOW_COPY_AND_ASSIGN(DataMapping); -}; - } // namespace fml #endif // FLUTTER_FML_MAPPING_H_ diff --git a/fml/memory/thread_checker.h b/fml/memory/thread_checker.h deleted file mode 100644 index f22e9d1cfaf06..0000000000000 --- a/fml/memory/thread_checker.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// A class for checking that the current thread is/isn't the same as an initial -// thread. - -#ifndef FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ -#define FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ - -#include "lib/fxl/build_config.h" - -#if defined(OS_WIN) -#include -#else -#include -#endif - -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" - -namespace fml { - -// A simple class that records the identity of the thread that it was created -// on, and at later points can tell if the current thread is the same as its -// creation thread. This class is thread-safe. -// -// Note: Unlike Chromium's |base::ThreadChecker|, this is *not* Debug-only (so -// #ifdef it out if you want something Debug-only). (Rationale: Having a -// |CalledOnValidThread()| that lies in Release builds seems bad. Moreover, -// there's a small space cost to having even an empty class. ) -class ThreadChecker final { - public: -#if defined(OS_WIN) - ThreadChecker() : self_(GetCurrentThreadId()) {} - ~ThreadChecker() {} - - bool IsCreationThreadCurrent() const { return GetCurrentThreadId() == self_; } - - private: - DWORD self_; - -#else - ThreadChecker() : self_(pthread_self()) {} - ~ThreadChecker() {} - - // Returns true if the current thread is the thread this object was created - // on and false otherwise. - bool IsCreationThreadCurrent() const { - return !!pthread_equal(pthread_self(), self_); - } - - private: - pthread_t self_; -#endif -}; - -#ifndef NDEBUG -#define FML_DECLARE_THREAD_CHECKER(c) fml::ThreadChecker c -#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) \ - FXL_DCHECK((c).IsCreationThreadCurrent()) -#else -#define FML_DECLARE_THREAD_CHECKER(c) -#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) ((void)0) -#endif - -} // namespace fml - -#endif // FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ diff --git a/fml/memory/weak_ptr.h b/fml/memory/weak_ptr.h index 2b369952d7306..5b85c531966b2 100644 --- a/fml/memory/weak_ptr.h +++ b/fml/memory/weak_ptr.h @@ -10,17 +10,12 @@ #include -#include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr_internal.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_counted.h" namespace fml { -struct DebugThreadChecker { - FML_DECLARE_THREAD_CHECKER(checker); -}; - // Forward declaration, so |WeakPtr| can friend it. template class WeakPtrFactory; @@ -46,17 +41,13 @@ class WeakPtr { WeakPtr(const WeakPtr& r) = default; template - WeakPtr(const WeakPtr& r) - : ptr_(static_cast(r.ptr_)), flag_(r.flag_), checker_(r.checker_) {} + WeakPtr(const WeakPtr& r) : ptr_(r.ptr_), flag_(r.flag_) {} // Move constructor. WeakPtr(WeakPtr&& r) = default; template - WeakPtr(WeakPtr&& r) - : ptr_(static_cast(r.ptr_)), - flag_(std::move(r.flag_)), - checker_(r.checker_) {} + WeakPtr(WeakPtr&& r) : ptr_(r.ptr_), flag_(std::move(r.flag_)) {} ~WeakPtr() = default; @@ -74,24 +65,16 @@ class WeakPtr { // The following methods should only be called on the same thread as the // "originating" |WeakPtrFactory|. - explicit operator bool() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - return flag_ && flag_->is_valid(); - } + explicit operator bool() const { return flag_ && flag_->is_valid(); } - T* get() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - return *this ? ptr_ : nullptr; - } + T* get() const { return *this ? ptr_ : nullptr; } T& operator*() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return *get(); } T* operator->() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return get(); } @@ -102,14 +85,11 @@ class WeakPtr { friend class WeakPtrFactory; - explicit WeakPtr(T* ptr, - fxl::RefPtr&& flag, - DebugThreadChecker checker) - : ptr_(ptr), flag_(std::move(flag)), checker_(checker) {} + explicit WeakPtr(T* ptr, fxl::RefPtr&& flag) + : ptr_(ptr), flag_(std::move(flag)) {} T* ptr_; fxl::RefPtr flag_; - DebugThreadChecker checker_; // Copy/move construction/assignment supported. }; @@ -160,22 +140,19 @@ template class WeakPtrFactory { public: explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { FXL_DCHECK(ptr_); } - ~WeakPtrFactory() { InvalidateWeakPtrs(); } // Gets a new weak pointer, which will be valid until either // |InvalidateWeakPtrs()| is called or this object is destroyed. WeakPtr GetWeakPtr() { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) flag_ = fxl::MakeRefCounted(); - return WeakPtr(ptr_, flag_.Clone(), checker_); + return WeakPtr(ptr_, flag_.Clone()); } // Call this method to invalidate all existing weak pointers. (Note that // additional weak pointers can be produced even after this is called.) void InvalidateWeakPtrs() { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) return; flag_->Invalidate(); @@ -185,17 +162,13 @@ class WeakPtrFactory { // Call this method to determine if any weak pointers exist. (Note that a // "false" result is definitive, but a "true" result may not be if weak // pointers are held/reset/destroyed/reassigned on other threads.) - bool HasWeakPtrs() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - return flag_ && !flag_->HasOneRef(); - } + bool HasWeakPtrs() const { return flag_ && !flag_->HasOneRef(); } private: // Note: See weak_ptr_internal.h for an explanation of why we store the // pointer here, instead of in the "flag". T* const ptr_; fxl::RefPtr flag_; - DebugThreadChecker checker_; FXL_DISALLOW_COPY_AND_ASSIGN(WeakPtrFactory); }; diff --git a/fml/message_loop.cc b/fml/message_loop.cc index 44a0e307c1dd1..4765cfa76558f 100644 --- a/fml/message_loop.cc +++ b/fml/message_loop.cc @@ -55,7 +55,7 @@ void MessageLoop::Terminate() { loop_->DoTerminate(); } -fxl::RefPtr MessageLoop::GetTaskRunner() const { +fxl::RefPtr MessageLoop::GetTaskRunner() const { return task_runner_; } @@ -63,12 +63,12 @@ fxl::RefPtr MessageLoop::GetLoopImpl() const { return loop_; } -void MessageLoop::AddTaskObserver(intptr_t key, fxl::Closure callback) { - loop_->AddTaskObserver(key, callback); +void MessageLoop::AddTaskObserver(TaskObserver* observer) { + loop_->AddTaskObserver(observer); } -void MessageLoop::RemoveTaskObserver(intptr_t key) { - loop_->RemoveTaskObserver(key); +void MessageLoop::RemoveTaskObserver(TaskObserver* observer) { + loop_->RemoveTaskObserver(observer); } void MessageLoop::RunExpiredTasksNow() { diff --git a/fml/message_loop.h b/fml/message_loop.h index 3bfb1c40c6df7..87773619ccc51 100644 --- a/fml/message_loop.h +++ b/fml/message_loop.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_MESSAGE_LOOP_H_ #define FLUTTER_FML_MESSAGE_LOOP_H_ -#include "flutter/fml/macros.h" +#include "flutter/fml/task_observer.h" #include "lib/fxl/macros.h" #include "lib/fxl/tasks/task_runner.h" @@ -16,7 +16,6 @@ class MessageLoopImpl; class MessageLoop { public: - FML_EMBEDDER_ONLY static MessageLoop& GetCurrent(); bool IsValid() const; @@ -25,11 +24,11 @@ class MessageLoop { void Terminate(); - void AddTaskObserver(intptr_t key, fxl::Closure callback); + void AddTaskObserver(TaskObserver* observer); - void RemoveTaskObserver(intptr_t key); + void RemoveTaskObserver(TaskObserver* observer); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; // Exposed for the embedder shell which allows clients to poll for events // instead of dedicating a thread to the message loop. diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index df885f3792d5f..cec9b7e448f1a 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -2,8 +2,6 @@ // 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 @@ -13,29 +11,35 @@ #include "lib/fxl/build_config.h" #if OS_MACOSX + #include "flutter/fml/platform/darwin/message_loop_darwin.h" +using PlatformMessageLoopImpl = fml::MessageLoopDarwin; + #elif OS_ANDROID + #include "flutter/fml/platform/android/message_loop_android.h" +using PlatformMessageLoopImpl = fml::MessageLoopAndroid; + #elif OS_LINUX + #include "flutter/fml/platform/linux/message_loop_linux.h" +using PlatformMessageLoopImpl = fml::MessageLoopLinux; + #elif OS_WIN + #include "flutter/fml/platform/win/message_loop_win.h" +using PlatformMessageLoopImpl = fml::MessageLoopWin; + +#else + +#error This platform does not have a message loop implementation. + #endif namespace fml { fxl::RefPtr MessageLoopImpl::Create() { -#if OS_MACOSX - return fxl::MakeRefCounted(); -#elif OS_ANDROID - return fxl::MakeRefCounted(); -#elif OS_LINUX - return fxl::MakeRefCounted(); -#elif OS_WIN - return fxl::MakeRefCounted(); -#else - return nullptr; -#endif + return fxl::MakeRefCounted<::PlatformMessageLoopImpl>(); } MessageLoopImpl::MessageLoopImpl() : order_(0), terminated_(false) {} @@ -51,19 +55,20 @@ void MessageLoopImpl::RunExpiredTasksNow() { RunExpiredTasks(); } -void MessageLoopImpl::AddTaskObserver(intptr_t key, fxl::Closure callback) { - FXL_DCHECK(callback != nullptr); +void MessageLoopImpl::AddTaskObserver(TaskObserver* observer) { + FXL_DCHECK(observer != nullptr); FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be added on the same thread as the " "loop."; - task_observers_[key] = std::move(callback); + task_observers_.insert(observer); } -void MessageLoopImpl::RemoveTaskObserver(intptr_t key) { +void MessageLoopImpl::RemoveTaskObserver(TaskObserver* observer) { + FXL_DCHECK(observer != nullptr); FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be removed from the same thread as " "the loop."; - task_observers_.erase(key); + task_observers_.erase(observer); } void MessageLoopImpl::DoRun() { @@ -139,7 +144,7 @@ void MessageLoopImpl::RunExpiredTasks() { for (const auto& invocation : invocations) { invocation(); for (const auto& observer : task_observers_) { - observer.second(); + observer->DidProcessTask(); } } } diff --git a/fml/message_loop_impl.h b/fml/message_loop_impl.h index 478cbd1f1a0be..bfdb2064cb264 100644 --- a/fml/message_loop_impl.h +++ b/fml/message_loop_impl.h @@ -7,9 +7,9 @@ #include #include -#include #include #include +#include #include #include "flutter/fml/message_loop.h" @@ -34,9 +34,9 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { void PostTask(fxl::Closure task, fxl::TimePoint target_time); - void AddTaskObserver(intptr_t key, fxl::Closure callback); + void AddTaskObserver(TaskObserver* observer); - void RemoveTaskObserver(intptr_t key); + void RemoveTaskObserver(TaskObserver* observer); void DoRun(); @@ -71,7 +71,7 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { using DelayedTaskQueue = std:: priority_queue, DelayedTaskCompare>; - std::map task_observers_; + std::set task_observers_; std::mutex delayed_tasks_mutex_; DelayedTaskQueue delayed_tasks_; size_t order_; diff --git a/fml/message_loop_unittests.cc b/fml/message_loop_unittests.cc index cd2acd308b46a..11ea72c3900eb 100644 --- a/fml/message_loop_unittests.cc +++ b/fml/message_loop_unittests.cc @@ -2,12 +2,9 @@ // 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 #include "flutter/fml/message_loop.h" -#include "flutter/fml/task_runner.h" #include "gtest/gtest.h" #include "lib/fxl/synchronization/waitable_event.h" @@ -247,6 +244,22 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) { ASSERT_EQ(checked, count); } +class CustomTaskObserver : public fml::TaskObserver { + public: + CustomTaskObserver(std::function lambda) : lambda_(lambda){}; + + ~CustomTaskObserver() override = default; + + void DidProcessTask() override { + if (lambda_) { + lambda_(); + } + }; + + private: + std::function lambda_; +}; + TEST(MessageLoop, TaskObserverFire) { bool started = false; bool terminated = false; @@ -256,7 +269,8 @@ TEST(MessageLoop, TaskObserverFire) { auto& loop = fml::MessageLoop::GetCurrent(); size_t task_count = 0; size_t obs_count = 0; - auto obs = PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }; + CustomTaskObserver obs( + PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }); for (size_t i = 0; i < count; i++) { loop.GetTaskRunner()->PostTask( PLATFORM_SPECIFIC_CAPTURE(&terminated, i, &task_count)() { @@ -268,7 +282,7 @@ TEST(MessageLoop, TaskObserverFire) { } }); } - loop.AddTaskObserver(0, obs); + loop.AddTaskObserver(&obs); loop.Run(); ASSERT_EQ(task_count, count); ASSERT_EQ(obs_count, count); diff --git a/fml/native_library.h b/fml/native_library.h deleted file mode 100644 index 7e48ed6d3a3ff..0000000000000 --- a/fml/native_library.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2018 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_NATIVE_LIBRARY_H_ -#define FLUTTER_FML_NATIVE_LIBRARY_H_ - -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" -#include "lib/fxl/memory/ref_ptr.h" - -#if OS_WIN - -#include - -#endif // OS_WIN - -namespace fml { -class NativeLibrary : public fxl::RefCountedThreadSafe { - public: -#if OS_WIN - using Handle = HMODULE; -#else // OS_WIN - using Handle = void*; -#endif // OS_WIN - - static fxl::RefPtr Create(const char* path); - - static fxl::RefPtr CreateForCurrentProcess(); - - const uint8_t* ResolveSymbol(const char* symbol); - - private: - Handle handle_ = nullptr; - bool close_handle_ = true; - - NativeLibrary(const char* path); - - NativeLibrary(Handle handle, bool close_handle); - - ~NativeLibrary(); - - Handle GetHandle() const; - - FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrary); - FRIEND_REF_COUNTED_THREAD_SAFE(NativeLibrary); - FRIEND_MAKE_REF_COUNTED(NativeLibrary); -}; - -} // namespace fml - -#endif // FLUTTER_FML_NATIVE_LIBRARY_H_ diff --git a/fml/paths.cc b/fml/paths.cc deleted file mode 100644 index 9b06b6847f415..0000000000000 --- a/fml/paths.cc +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 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/paths.h" - -#include "lib/fxl/build_config.h" - -namespace fml { -namespace paths { - -std::string JoinPaths(std::initializer_list components) { - std::stringstream stream; - size_t i = 0; - const size_t size = components.size(); - for (const auto& component : components) { - i++; - stream << component; - if (i != size) { -#if OS_WIN - stream << "\\"; -#else // OS_WIN - stream << "/"; -#endif // OS_WIN - } - } - return stream.str(); -} - -} // namespace paths -} // namespace fml diff --git a/fml/paths.h b/fml/paths.h index 0d4367654de4a..8ec3b4b580476 100644 --- a/fml/paths.h +++ b/fml/paths.h @@ -8,15 +8,11 @@ #include #include -#include "lib/fxl/strings/string_view.h" - namespace fml { namespace paths { std::pair GetExecutableDirectoryPath(); -std::string JoinPaths(std::initializer_list components); - } // namespace paths } // namespace fml diff --git a/fml/platform/android/message_loop_android.h b/fml/platform/android/message_loop_android.h index 19c1eafe79845..e6d04e8253401 100644 --- a/fml/platform/android/message_loop_android.h +++ b/fml/platform/android/message_loop_android.h @@ -10,7 +10,7 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "flutter/fml/unique_fd.h" +#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/unique_object.h" @@ -24,8 +24,8 @@ struct UniqueLooperTraits { class MessageLoopAndroid : public MessageLoopImpl { private: - fml::UniqueObject looper_; - fml::UniqueFD timer_fd_; + fxl::UniqueObject looper_; + fxl::UniqueFD timer_fd_; bool running_; MessageLoopAndroid(); diff --git a/fml/platform/darwin/resource_mapping_darwin.mm b/fml/platform/darwin/resource_mapping_darwin.mm index 3ee100121ad0f..5d1b9664e20bc 100644 --- a/fml/platform/darwin/resource_mapping_darwin.mm +++ b/fml/platform/darwin/resource_mapping_darwin.mm @@ -9,8 +9,8 @@ namespace fml { ResourceMappingDarwin::ResourceMappingDarwin(const std::string& resource) - : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String], - false) {} + : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String]) { +} ResourceMappingDarwin::~ResourceMappingDarwin() = default; diff --git a/fml/platform/fuchsia/paths_fuchsia.cc b/fml/platform/fuchsia/paths_fuchsia.cc deleted file mode 100644 index 20def9f34fae9..0000000000000 --- a/fml/platform/fuchsia/paths_fuchsia.cc +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 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/paths.h" - -namespace fml { -namespace paths { - -std::pair GetExecutableDirectoryPath() { - return {false, ""}; -} - -} // namespace paths -} // namespace fml diff --git a/fml/platform/linux/message_loop_linux.h b/fml/platform/linux/message_loop_linux.h index ba5e902d4ac89..51dc690ce887b 100644 --- a/fml/platform/linux/message_loop_linux.h +++ b/fml/platform/linux/message_loop_linux.h @@ -8,15 +8,15 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "flutter/fml/unique_fd.h" +#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { class MessageLoopLinux : public MessageLoopImpl { private: - fml::UniqueFD epoll_fd_; - fml::UniqueFD timer_fd_; + fxl::UniqueFD epoll_fd_; + fxl::UniqueFD timer_fd_; bool running_; MessageLoopLinux(); diff --git a/fml/platform/posix/file_posix.cc b/fml/platform/posix/file_posix.cc deleted file mode 100644 index 028f49f4d183d..0000000000000 --- a/fml/platform/posix/file_posix.cc +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2018 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/file.h" - -#include -#include -#include - -#include "lib/fxl/files/eintr_wrapper.h" - -namespace fml { - -fml::UniqueFD OpenFile(const char* path, - OpenPermission permission, - bool is_directory) { - return OpenFile(fml::UniqueFD{AT_FDCWD}, path, permission, is_directory); -} - -fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, - const char* path, - OpenPermission permission, - bool is_directory) { - if (path == nullptr) { - return fml::UniqueFD{}; - } - - int flags = 0; - switch (permission) { - case OpenPermission::kRead: - flags = O_RDONLY; - break; - case OpenPermission::kWrite: - flags = O_WRONLY; - break; - case OpenPermission::kReadWrite: - flags = O_RDWR; - break; - case OpenPermission::kExecute: - flags = O_RDONLY; - break; - } - - if (is_directory) { - flags |= O_DIRECTORY; - } - - return fml::UniqueFD{ - HANDLE_EINTR(::openat(base_directory.get(), path, flags))}; -} - -fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { - return fml::UniqueFD{HANDLE_EINTR(::dup(descriptor))}; -} - -bool IsDirectory(const fml::UniqueFD& directory) { - if (!directory.is_valid()) { - return false; - } - - struct stat stat_result = {}; - - if (::fstat(directory.get(), &stat_result) != 0) { - return false; - } - - return S_ISDIR(stat_result.st_mode); -} - -} // namespace fml diff --git a/fml/platform/posix/mapping_posix.cc b/fml/platform/posix/mapping_posix.cc index fc53d6a4f7fc9..07f7edb074ab9 100644 --- a/fml/platform/posix/mapping_posix.cc +++ b/fml/platform/posix/mapping_posix.cc @@ -11,7 +11,6 @@ #include -#include "flutter/fml/unique_fd.h" #include "lib/fxl/build_config.h" #include "lib/fxl/files/eintr_wrapper.h" @@ -40,11 +39,11 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path, bool executable) - : FileMapping(fml::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}, - executable) {} +FileMapping::FileMapping(const std::string& path) + : FileMapping(fxl::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}) { +} -FileMapping::FileMapping(const fml::UniqueFD& handle, bool executable) +FileMapping::FileMapping(const fxl::UniqueFD& handle) : size_(0), mapping_(nullptr) { if (!handle.is_valid()) { return; @@ -60,13 +59,8 @@ FileMapping::FileMapping(const fml::UniqueFD& handle, bool executable) return; } - int flags = PROT_READ; - if (executable) { - flags |= PROT_EXEC; - } - - auto mapping = - ::mmap(nullptr, stat_buffer.st_size, flags, MAP_PRIVATE, handle.get(), 0); + auto mapping = ::mmap(nullptr, stat_buffer.st_size, PROT_READ, MAP_PRIVATE, + handle.get(), 0); if (mapping == MAP_FAILED) { return; diff --git a/fml/platform/posix/native_library_posix.cc b/fml/platform/posix/native_library_posix.cc deleted file mode 100644 index 1255c38fc0821..0000000000000 --- a/fml/platform/posix/native_library_posix.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2018 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/native_library.h" - -#include -#include - -namespace fml { - -NativeLibrary::NativeLibrary(const char* path) { - ::dlerror(); - handle_ = ::dlopen(path, RTLD_NOW); - if (handle_ == nullptr) { - FXL_LOG(ERROR) << "Could not open library '" << path << "' due to error '" - << ::dlerror() << "'."; - } -} - -NativeLibrary::NativeLibrary(Handle handle, bool close_handle) - : handle_(handle), close_handle_(close_handle) {} - -NativeLibrary::~NativeLibrary() { - if (handle_ == nullptr) { - return; - } - - if (close_handle_) { - ::dlerror(); - if (::dlclose(handle_) != 0) { - handle_ = nullptr; - FXL_LOG(ERROR) << "Could not close library due to error '" << ::dlerror() - << "'."; - } - } -} - -NativeLibrary::Handle NativeLibrary::GetHandle() const { - return handle_; -} - -fxl::RefPtr NativeLibrary::Create(const char* path) { - auto library = fxl::AdoptRef(new NativeLibrary(path)); - return library->GetHandle() != nullptr ? library : nullptr; -} - -fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { - return fxl::AdoptRef(new NativeLibrary(RTLD_DEFAULT, false)); -} - -const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { - auto resolved_symbol = static_cast(::dlsym(handle_, symbol)); - if (resolved_symbol == nullptr) { - FXL_DLOG(ERROR) << "Could not resolve symbol in library: " << symbol; - } - return resolved_symbol; -} - -} // namespace fml diff --git a/fml/platform/win/file_win.cc b/fml/platform/win/file_win.cc deleted file mode 100644 index 3f5e90494b013..0000000000000 --- a/fml/platform/win/file_win.cc +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2018 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/file.h" - -#include - -#include - -#include "flutter/fml/platform/win/wstring_conversion.h" - -namespace fml { - -fml::UniqueFD OpenFile(const std::wstring& path, - OpenPermission permission, - bool is_directory) { - if (path.size() == 0) { - return fml::UniqueFD{}; - } - - DWORD desired_access = 0; - - switch (permission) { - case OpenPermission::kRead: - desired_access = GENERIC_READ; - break; - case OpenPermission::kWrite: - desired_access = GENERIC_WRITE; - break; - case OpenPermission::kReadWrite: - desired_access = GENERIC_WRITE | GENERIC_READ; - break; - case OpenPermission::kExecute: - desired_access = GENERIC_READ | GENERIC_EXECUTE; - break; - } - - return fml::UniqueFD{::CreateFile( - path.c_str(), // lpFileName - desired_access, // dwDesiredAccess - FILE_SHARE_READ, // dwShareMode - 0, // lpSecurityAttributes - OPEN_EXISTING, // dwCreationDisposition - FILE_ATTRIBUTE_NORMAL, // dwFlagsAndAttributes - 0 // hTemplateFile - )}; -} - -fml::UniqueFD OpenFile(const char* path, - OpenPermission permission, - bool is_directory) { - return OpenFile(ConvertToWString(path), permission, is_directory); -} - -static std::wstring GetFullHandlePath(const fml::UniqueFD& handle) { - wchar_t buffer[MAX_PATH]; - - DWORD returned = ::GetFinalPathNameByHandle(handle.get(), buffer, MAX_PATH, - FILE_NAME_NORMALIZED); - if (returned == 0 || returned > MAX_PATH) { - return {}; - } - - return {buffer}; -} - -fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, - const char* path, - OpenPermission permission, - bool is_directory) { - // If the base directory is invalid or the path is absolute, use the generic - // open file variant. - if (!base_directory.is_valid()) { - return OpenFile(path, permission, is_directory); - } - - const auto wpath = ConvertToWString(path); - - if (!::PathIsRelative(wpath.c_str())) { - return OpenFile(path, permission, is_directory); - } - - std::wstringstream stream; - stream << GetFullHandlePath(base_directory) << "\\" << path; - return OpenFile(stream.str(), permission, is_directory); -} - -fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { - if (descriptor == INVALID_HANDLE_VALUE) { - return fml::UniqueFD{}; - } - - HANDLE duplicated = INVALID_HANDLE_VALUE; - - if (!::DuplicateHandle( - GetCurrentProcess(), // source process - descriptor, // source handle - GetCurrentProcess(), // target process - &duplicated, // target handle - 0, // desired access (ignored because DUPLICATE_SAME_ACCESS) - FALSE, // inheritable - DUPLICATE_SAME_ACCESS) // options - ) { - return fml::UniqueFD{}; - } - - return fml::UniqueFD{duplicated}; -} - -bool IsDirectory(const fml::UniqueFD& directory) { - BY_HANDLE_FILE_INFORMATION info; - if (!::GetFileInformationByHandle(directory.get(), &info)) { - return false; - } - return info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; -} - -} // namespace fml diff --git a/fml/platform/win/mapping_win.cc b/fml/platform/win/mapping_win.cc index 9dd5dcf6f2249..fd404a14f37dc 100644 --- a/fml/platform/win/mapping_win.cc +++ b/fml/platform/win/mapping_win.cc @@ -5,13 +5,13 @@ #include "flutter/fml/mapping.h" #include -#include -#include #include -#include "flutter/fml/file.h" -#include "flutter/fml/platform/win/wstring_conversion.h" +#include "lib/fxl/build_config.h" + +#include +#include using PlatformResourceMapping = fml::FileMapping; @@ -29,50 +29,47 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path, bool executable) - : FileMapping(OpenFile(path.c_str(), - executable ? OpenPermission::kExecute - : OpenPermission::kRead, - false), - executable) {} - -FileMapping::FileMapping(const fml::UniqueFD& fd, bool executable) +FileMapping::FileMapping(const std::string& path) : size_(0), mapping_(nullptr) { - if (!fd.is_valid()) { + HANDLE file_handle_ = + CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, + FILE_SHARE_READ, nullptr, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); + + if (file_handle_ == INVALID_HANDLE_VALUE) { return; } - if (auto size = ::GetFileSize(fd.get(), nullptr)) { - if (size > 0) { - size_ = size; - } else { - return; - } + size_ = GetFileSize(file_handle_, nullptr); + if (size_ == INVALID_FILE_SIZE) { + size_ = 0; + return; } - const DWORD protect = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; + mapping_handle_ = CreateFileMapping(file_handle_, nullptr, PAGE_READONLY, 0, + size_, nullptr); - mapping_handle_.reset(::CreateFileMapping(fd.get(), // hFile - nullptr, // lpAttributes - protect, // flProtect - 0, // dwMaximumSizeHigh - 0, // dwMaximumSizeLow - nullptr // lpName - )); + CloseHandle(file_handle_); - if (!mapping_handle_.is_valid()) { + if (mapping_handle_ == INVALID_HANDLE_VALUE) { return; } - const DWORD desired_access = executable ? FILE_MAP_ALL_ACCESS : FILE_MAP_READ; + auto mapping = MapViewOfFile(mapping_handle_, FILE_MAP_READ, 0, 0, size_); + + if (mapping == INVALID_HANDLE_VALUE) { + CloseHandle(mapping_handle_); + mapping_handle_ = INVALID_HANDLE_VALUE; + return; + } - mapping_ = reinterpret_cast( - MapViewOfFile(mapping_handle_.get(), desired_access, 0, 0, size_)); + mapping_ = static_cast(mapping); } FileMapping::~FileMapping() { if (mapping_ != nullptr) { UnmapViewOfFile(mapping_); + CloseHandle(mapping_handle_); } } diff --git a/fml/platform/win/native_library_win.cc b/fml/platform/win/native_library_win.cc deleted file mode 100644 index 6992f06f3e886..0000000000000 --- a/fml/platform/win/native_library_win.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018 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/native_library.h" - -#include - -#include "flutter/fml/platform/win/wstring_conversion.h" - -namespace fml { - -NativeLibrary::NativeLibrary(const char* path) - : handle_(nullptr), close_handle_(true) { - if (path == nullptr) { - return; - } - - handle_ = ::LoadLibrary(ConvertToWString(path).c_str()); -} - -NativeLibrary::NativeLibrary(Handle handle, bool close_handle) - : handle_(handle), close_handle_(close_handle) {} - -NativeLibrary::~NativeLibrary() { - if (handle_ != nullptr && close_handle_) { - ::FreeLibrary(handle_); - } -} - -NativeLibrary::Handle NativeLibrary::GetHandle() const { - return handle_; -} - -fxl::RefPtr NativeLibrary::Create(const char* path) { - auto library = fxl::AdoptRef(new NativeLibrary(path)); - return library->GetHandle() != nullptr ? library : nullptr; -} - -fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { - return fxl::AdoptRef(new NativeLibrary(::GetModuleHandle(nullptr), false)); -} - -const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { - if (symbol == nullptr || handle_ == nullptr) { - return nullptr; - } - return reinterpret_cast(::GetProcAddress(handle_, symbol)); -} - -} // namespace fml diff --git a/fml/platform/win/wstring_conversion.h b/fml/platform/win/wstring_conversion.h deleted file mode 100644 index 0682dd84067bf..0000000000000 --- a/fml/platform/win/wstring_conversion.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2018 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_WIN_WSTRING_CONVERSION_H_ -#define FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ - -#include -#include -#include - -namespace fml { - -inline std::wstring ConvertToWString(const char* path) { - if (path == nullptr) { - return {}; - } - std::string path8(path); - std::wstring_convert, wchar_t> wchar_conv; - return wchar_conv.from_bytes(path8); -} - -} // namespace fml - -#endif // FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ diff --git a/fml/task_observer.h b/fml/task_observer.h new file mode 100644 index 0000000000000..21697cf022005 --- /dev/null +++ b/fml/task_observer.h @@ -0,0 +1,21 @@ +// Copyright 2017 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. + +#ifndef FLUTTER_FML_TASK_OBSERVER_H_ +#define FLUTTER_FML_TASK_OBSERVER_H_ + +#include "lib/fxl/macros.h" + +namespace fml { + +class TaskObserver { + public: + virtual ~TaskObserver() = default; + + virtual void DidProcessTask() = 0; +}; + +} // namespace fml + +#endif // FLUTTER_FML_TASK_OBSERVER_H_ diff --git a/fml/task_runner.cc b/fml/task_runner.cc index 95f91de8e9124..3d13674d78c11 100644 --- a/fml/task_runner.cc +++ b/fml/task_runner.cc @@ -2,8 +2,6 @@ // 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/task_runner.h" #include @@ -40,14 +38,4 @@ bool TaskRunner::RunsTasksOnCurrentThread() { return MessageLoop::GetCurrent().GetLoopImpl() == loop_; } -void TaskRunner::RunNowOrPostTask(fxl::RefPtr runner, - fxl::Closure task) { - FXL_DCHECK(runner); - if (runner->RunsTasksOnCurrentThread()) { - task(); - } else { - runner->PostTask(std::move(task)); - } -} - } // namespace fml diff --git a/fml/task_runner.h b/fml/task_runner.h index 3b3d2de01639d..20ea85e4e521b 100644 --- a/fml/task_runner.h +++ b/fml/task_runner.h @@ -13,7 +13,7 @@ namespace fml { class MessageLoopImpl; -class TaskRunner final : public fxl::TaskRunner { +class TaskRunner : public fxl::TaskRunner { public: void PostTask(fxl::Closure task) override; @@ -23,15 +23,12 @@ class TaskRunner final : public fxl::TaskRunner { bool RunsTasksOnCurrentThread() override; - static void RunNowOrPostTask(fxl::RefPtr runner, - fxl::Closure task); - private: fxl::RefPtr loop_; TaskRunner(fxl::RefPtr loop); - ~TaskRunner() override; + ~TaskRunner(); FRIEND_MAKE_REF_COUNTED(TaskRunner); FRIEND_REF_COUNTED_THREAD_SAFE(TaskRunner); diff --git a/fml/thread.cc b/fml/thread.cc index de4ee6dd368a8..a1500bfef46a4 100644 --- a/fml/thread.cc +++ b/fml/thread.cc @@ -2,8 +2,6 @@ // 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/thread.h" #include "lib/fxl/build_config.h" @@ -24,7 +22,7 @@ namespace fml { Thread::Thread(const std::string& name) : joined_(false) { fxl::AutoResetWaitableEvent latch; - fxl::RefPtr runner; + fxl::RefPtr runner; thread_ = std::make_unique([&latch, &runner, name]() -> void { SetCurrentThreadName(name); fml::MessageLoop::EnsureInitializedForCurrentThread(); @@ -41,7 +39,7 @@ Thread::~Thread() { Join(); } -fxl::RefPtr Thread::GetTaskRunner() const { +fxl::RefPtr Thread::GetTaskRunner() const { return task_runner_; } @@ -86,8 +84,7 @@ void Thread::SetCurrentThreadName(const std::string& name) { } __except (EXCEPTION_CONTINUE_EXECUTION) { } #else - FXL_DLOG(INFO) << "Could not set the thread name to '" << name - << "' on this platform."; +#error Unsupported Platform #endif } diff --git a/fml/thread.h b/fml/thread.h index 542871f788845..44062f1032116 100644 --- a/fml/thread.h +++ b/fml/thread.h @@ -9,8 +9,8 @@ #include #include -#include "flutter/fml/task_runner.h" #include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" namespace fml { @@ -20,13 +20,13 @@ class Thread { ~Thread(); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; void Join(); private: std::unique_ptr thread_; - fxl::RefPtr task_runner_; + fxl::RefPtr task_runner_; std::atomic_bool joined_; static void SetCurrentThreadName(const std::string& name); diff --git a/fml/unique_fd.cc b/fml/unique_fd.cc deleted file mode 100644 index bab79f7a9b743..0000000000000 --- a/fml/unique_fd.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2018 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/unique_fd.h" - -#include "lib/fxl/files/eintr_wrapper.h" - -namespace fml { -namespace internal { - -#if OS_WIN - -namespace win { - -void UniqueFDTraits::Free(HANDLE fd) { - CloseHandle(fd); -} - -} // namespace win - -#else // OS_WIN - -namespace unix { - -void UniqueFDTraits::Free(int fd) { - IGNORE_EINTR(fd); -} - -} // namespace unix - -#endif // OS_WIN - -} // namespace internal -} // namespace fml diff --git a/fml/unique_fd.h b/fml/unique_fd.h deleted file mode 100644 index 9f2d796579d8c..0000000000000 --- a/fml/unique_fd.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2018 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_UNIQUE_FD_H_ -#define FLUTTER_FML_UNIQUE_FD_H_ - -#include "flutter/fml/unique_object.h" -#include "lib/fxl/build_config.h" - -#if OS_WIN - -#include - -#endif // OS_WIN - -namespace fml { -namespace internal { - -#if OS_WIN - -namespace win { - -struct UniqueFDTraits { - static HANDLE InvalidValue() { return INVALID_HANDLE_VALUE; } - static bool IsValid(HANDLE value) { return value != InvalidValue(); } - static void Free(HANDLE fd); -}; - -} // namespace win - -#else // OS_WIN - -namespace unix { - -struct UniqueFDTraits { - static int InvalidValue() { return -1; } - static bool IsValid(int value) { return value >= 0; } - static void Free(int fd); -}; - -} // namespace unix - -#endif // OS_WIN - -} // namespace internal - -#if OS_WIN - -using UniqueFD = UniqueObject; - -#else // OS_WIN - -using UniqueFD = UniqueObject; - -#endif // OS_WIN - -} // namespace fml - -#endif // FLUTTER_FML_UNIQUE_FD_H_ diff --git a/fml/unique_object.h b/fml/unique_object.h deleted file mode 100644 index e2487a53881a9..0000000000000 --- a/fml/unique_object.h +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2018 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_UNIQUE_OBJECT_H_ -#define FLUTTER_FML_UNIQUE_OBJECT_H_ - -#include - -#include "lib/fxl/compiler_specific.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" - -namespace fml { - -// struct UniqueFooTraits { -// // This function should be fast an inline. -// static int InvalidValue() { return 0; } -// -// // This function should be fast an inline. -// static bool IsValid(const T& value) { return value != InvalidValue(); } -// -// // This free function will not be called if f == InvalidValue()! -// static void Free(int f) { ::FreeFoo(f); } -// }; - -template -class UniqueObject { - private: - // This must be first since it's used inline below. - // - // Use the empty base class optimization to allow us to have a Traits - // member, while avoiding any space overhead for it when Traits is an - // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good - // discussion of this technique. - struct Data : public Traits { - explicit Data(const T& in) : generic(in) {} - Data(const T& in, const Traits& other) : Traits(other), generic(in) {} - - T generic; - }; - - public: - using element_type = T; - using traits_type = Traits; - - UniqueObject() : data_(Traits::InvalidValue()) {} - explicit UniqueObject(const T& value) : data_(value) {} - - UniqueObject(const T& value, const Traits& traits) : data_(value, traits) {} - - UniqueObject(UniqueObject&& other) - : data_(other.release(), other.get_traits()) {} - - ~UniqueObject() { FreeIfNecessary(); } - - UniqueObject& operator=(UniqueObject&& other) { - reset(other.release()); - return *this; - } - - void reset(const T& value = Traits::InvalidValue()) { - FXL_CHECK(data_.generic == Traits::InvalidValue() || - data_.generic != value); - FreeIfNecessary(); - data_.generic = value; - } - - void swap(UniqueObject& other) { - // Standard swap idiom: 'using std::swap' ensures that std::swap is - // present in the overload set, but we call swap unqualified so that - // any more-specific overloads can be used, if available. - using std::swap; - swap(static_cast(data_), static_cast(other.data_)); - swap(data_.generic, other.data_.generic); - } - - // Release the object. The return value is the current object held by this - // object. After this operation, this object will hold an invalid value, and - // will not own the object any more. - T release() FXL_WARN_UNUSED_RESULT { - T old_generic = data_.generic; - data_.generic = Traits::InvalidValue(); - return old_generic; - } - - const T& get() const { return data_.generic; } - - bool is_valid() const { return Traits::IsValid(data_.generic); } - - bool operator==(const T& value) const { return data_.generic == value; } - - bool operator!=(const T& value) const { return data_.generic != value; } - - Traits& get_traits() { return data_; } - const Traits& get_traits() const { return data_; } - - private: - void FreeIfNecessary() { - if (data_.generic != Traits::InvalidValue()) { - data_.Free(data_.generic); - data_.generic = Traits::InvalidValue(); - } - } - - // Forbid comparison. If U != T, it totally doesn't make sense, and if U == - // T, it still doesn't make sense because you should never have the same - // object owned by two different UniqueObject. - template - bool operator==(const UniqueObject& p2) const = delete; - - template - bool operator!=(const UniqueObject& p2) const = delete; - - Data data_; - - FXL_DISALLOW_COPY_AND_ASSIGN(UniqueObject); -}; - -template -void swap(const UniqueObject& a, const UniqueObject& b) { - a.swap(b); -} - -template -bool operator==(const T& value, const UniqueObject& object) { - return value == object.get(); -} - -template -bool operator!=(const T& value, const UniqueObject& object) { - return !(value == object.get()); -} - -} // namespace fml - -#endif // FLUTTER_FML_UNIQUE_OBJECT_H_ diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 8c568f4773c90..2b53ffc4d4f6d 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -29,40 +29,20 @@ if (is_fuchsia) { # The sole purpose of this target is to generate a .packages file. sources = [] - dot_packages_file = "$target_gen_dir/snapshot.packages" - outputs = [ - dot_packages_file, - ] - deps = [] - foreach(dep, dart_deps) { - deps += [ "$dep($dart_toolchain)" ] - } + infer_package_name = true disable_analysis = true - script = "//build/dart/gen_dot_packages.py" - args = [ - "--out", - rebase_path(dot_packages_file, root_build_dir), - "--source-dir", - rebase_path("."), - "--root-build-dir", - rebase_path(root_build_dir), - "--root-gen-dir", - rebase_path(dart_root_gen_dir), - "--package-name", - "snapshot_root", - "--depfile", - rebase_path(depfile), - "--deps", - ] + dart_deps + deps = [ + "//topaz/public/dart/fuchsia", + "//topaz/public/dart/zircon", + ] } } action("generate_snapshot_bin") { if (is_fuchsia) { snapshot_dart = "snapshot_fuchsia.dart" - # TODO(rmacnak): Fuchsia cross builds use the wrong Dart target # architecture, and have added steps that depend on this error for # reasonable build times (e.g., invoking the analyzer). @@ -105,9 +85,9 @@ action("generate_snapshot_bin") { rebased_dart_ui_path = rebase_path(dart_ui_path) - gen_snapshot_dir = get_label_info( - "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", - "root_out_dir") + gen_snapshot_dir = + get_label_info("//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", + "root_out_dir") script = "//third_party/dart/runtime/tools/create_snapshot_bin.py" args = [ @@ -229,7 +209,7 @@ bin_to_assembly("isolate_snapshot_data_assembly") { ] input = "$target_gen_dir/isolate_snapshot.bin" output = "$target_gen_dir/isolate_snapshot_data.S" - symbol = "kDartIsolateSnapshotData" + symbol = "kDartIsolateCoreSnapshotData" executable = false } @@ -239,7 +219,7 @@ bin_to_assembly("isolate_snapshot_instructions_assembly") { ] input = "$target_gen_dir/isolate_snapshot_instructions.bin" output = "$target_gen_dir/isolate_snapshot_instructions.S" - symbol = "kDartIsolateSnapshotInstructions" + symbol = "kDartIsolateCoreSnapshotInstructions" executable = true } @@ -269,9 +249,9 @@ compile_platform("non_strong_platform") { ] args = [ - "--target=flutter", - "dart:core", - ] + "--target=flutter", + "dart:core", + ] } compile_platform("strong_platform") { @@ -285,10 +265,10 @@ compile_platform("strong_platform") { ] args = [ - "--target=flutter", - "--strong", - "dart:core", - ] + "--target=flutter", + "--strong", + "dart:core" + ] } group("kernel_platform_files") { diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 6a75cd22c8614..8b3be72d5973b 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -40,10 +40,14 @@ source_set("ui") { "painting/picture.h", "painting/picture_recorder.cc", "painting/picture_recorder.h", + "painting/resource_context.cc", + "painting/resource_context.h", "painting/rrect.cc", "painting/rrect.h", "painting/shader.cc", "painting/shader.h", + "painting/utils.cc", + "painting/utils.h", "painting/vertices.cc", "painting/vertices.h", "semantics/semantics_node.cc", @@ -83,18 +87,19 @@ source_set("ui") { "window/window.h", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] deps = [ + "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", - "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/runtime:test_font", "$flutter_root/sky/engine", "$flutter_root/third_party/txt", - "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", diff --git a/lib/ui/compositing/scene_builder.cc b/lib/ui/compositing/scene_builder.cc index 60b911cb4ddec..006826abbfdf6 100644 --- a/lib/ui/compositing/scene_builder.cc +++ b/lib/ui/compositing/scene_builder.cc @@ -120,11 +120,10 @@ void SceneBuilder::addPicture(double dx, double dy, Picture* picture, int hints) { - layer_builder_->PushPicture( - SkPoint::Make(dx, dy), // - UIDartState::CreateGPUObject(picture->picture()), // - !!(hints & 1), // picture is complex - !!(hints & 2) // picture will change + layer_builder_->PushPicture(SkPoint::Make(dx, dy), // + picture->picture(), // + !!(hints & 1), // picture is complex + !!(hints & 2) // picture will change ); } diff --git a/lib/ui/compositing/scene_host.cc b/lib/ui/compositing/scene_host.cc index f5e0cfb3547d8..c0e4c5332580a 100644 --- a/lib/ui/compositing/scene_host.cc +++ b/lib/ui/compositing/scene_host.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/compositing/scene_host.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" @@ -38,9 +37,8 @@ fxl::RefPtr SceneHost::create( } SceneHost::SceneHost(fxl::RefPtr export_token_handle) { - export_node_holder_ = fxl::MakeRefCounted( - blink::UIDartState::Current()->GetTaskRunners().GetGPUTaskRunner(), - export_token_handle); + export_node_holder_ = + fxl::MakeRefCounted(export_token_handle); } #else fxl::RefPtr SceneHost::create(Dart_Handle export_token_handle) { diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index 32a244c9cb67d..edd51245b05db 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -8,11 +8,7 @@ #include #include -#include -#include - #include "flutter/common/settings.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/tonic/converter/dart_converter.h" @@ -145,43 +141,17 @@ void DartRuntimeHooks::Install(IsolateType isolate_type, // Implementation of native functions which are used for some // test/debug functionality in standalone dart mode. void Logger_PrintString(Dart_NativeArguments args) { - std::stringstream stream; - const auto& logger_prefix = UIDartState::Current()->logger_prefix(); - -#if !OS(ANDROID) - // Prepend all logs with the isolate debug name except on Android where that - // prefix is specified in the log tag. - if (logger_prefix.size() > 0) { - stream << logger_prefix << ": "; - } -#endif // !OS(ANDROID) - - // Append the log buffer obtained from Dart code. - { - Dart_Handle str = Dart_GetNativeArgument(args, 0); - uint8_t* chars = nullptr; - intptr_t length = 0; - Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); - if (Dart_IsError(result)) { - Dart_PropagateError(result); - return; - } - if (length > 0) { - stream << std::string{reinterpret_cast(chars), - static_cast(length)}; - } - } - - const auto log_string = stream.str(); - const char* chars = log_string.c_str(); - const size_t length = log_string.size(); - - // Log using platform specific mechanisms - { + intptr_t length = 0; + uint8_t* chars = nullptr; + Dart_Handle str = Dart_GetNativeArgument(args, 0); + Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); + if (Dart_IsError(result)) { + Dart_PropagateError(result); + } else { #if defined(OS_ANDROID) // Write to the logcat on Android. - __android_log_print(ANDROID_LOG_INFO, logger_prefix.c_str(), "%.*s", - (int)length, chars); + const char* tag = Settings::Get().log_tag.c_str(); + __android_log_print(ANDROID_LOG_INFO, tag, "%.*s", (int)length, chars); #elif defined(OS_IOS) // Write to syslog on iOS. // @@ -189,22 +159,26 @@ void Logger_PrintString(Dart_NativeArguments args) { // iOS logging APIs altogether. syslog(1 /* LOG_ALERT */, "%.*s", (int)length, chars); #else - std::cout << log_string << std::endl; + // On Fuchsia and in flutter_tester (on both macOS and Linux), write + // directly to stdout. + fwrite(chars, 1, length, stdout); + fputs("\n", stdout); + fflush(stdout); #endif } - if (dart::bin::ShouldCaptureStdout()) { // For now we report print output on the Stdout stream. uint8_t newline[] = {'\n'}; - Dart_ServiceSendDataEvent("Stdout", "WriteEvent", - reinterpret_cast(chars), length); + Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length); Dart_ServiceSendDataEvent("Stdout", "WriteEvent", newline, sizeof(newline)); } } void ScheduleMicrotask(Dart_NativeArguments args) { Dart_Handle closure = Dart_GetNativeArgument(args, 0); - UIDartState::Current()->ScheduleMicrotask(closure); + if (LogIfError(closure) || !Dart_IsClosure(closure)) + return; + tonic::DartMicrotaskQueue::GetForCurrentThread()->ScheduleMicrotask(closure); } } // namespace blink diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 758a722b409e2..3e47ba86d50a5 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -4,11 +4,11 @@ #include "flutter/lib/ui/painting/codec.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/frame_info.h" +#include "flutter/lib/ui/painting/resource_context.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/logging.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" #include "lib/tonic/dart_state.h" @@ -17,10 +17,6 @@ #include "third_party/skia/include/codec/SkCodec.h" #include "third_party/skia/include/core/SkPixelRef.h" -#ifdef ERROR -#undef ERROR -#endif - using tonic::DartInvoke; using tonic::DartPersistentValue; using tonic::ToDart; @@ -32,9 +28,9 @@ namespace { static constexpr const char* kInitCodecTraceTag = "InitCodec"; static constexpr const char* kCodecNextFrameTraceTag = "CodecNextFrame"; -static void InvokeCodecCallback(fxl::RefPtr codec, - std::unique_ptr callback, - size_t trace_id) { +void InvokeCodecCallback(fxl::RefPtr codec, + std::unique_ptr callback, + size_t trace_id) { tonic::DartState* dart_state = callback->dart_state().get(); if (!dart_state) { TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); @@ -49,9 +45,7 @@ static void InvokeCodecCallback(fxl::RefPtr codec, TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); } -static sk_sp DecodeImage(fml::WeakPtr context, - sk_sp buffer, - size_t trace_id) { +sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("flutter", "DecodeImage"); @@ -59,11 +53,13 @@ static sk_sp DecodeImage(fml::WeakPtr context, return nullptr; } + std::unique_ptr resourceContext = ResourceContext::Acquire(); + GrContext* context = resourceContext->Get(); if (context) { // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromEncoded( - context.get(), std::move(buffer), false, dstColorSpace.get()); + return SkImage::MakeCrossContextFromEncoded(context, std::move(buffer), + false, dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -72,10 +68,7 @@ static sk_sp DecodeImage(fml::WeakPtr context, } } -fxl::RefPtr InitCodec(fml::WeakPtr context, - sk_sp buffer, - fxl::RefPtr unref_queue, - size_t trace_id) { +fxl::RefPtr InitCodec(sk_sp buffer, size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("blink", "InitCodec"); @@ -93,31 +86,27 @@ fxl::RefPtr InitCodec(fml::WeakPtr context, if (skCodec->getFrameCount() > 1) { return fxl::MakeRefCounted(std::move(skCodec)); } - auto skImage = DecodeImage(context, buffer, trace_id); + auto skImage = DecodeImage(buffer, trace_id); if (!skImage) { FXL_LOG(ERROR) << "DecodeImage failed"; return nullptr; } auto image = CanvasImage::Create(); - image->set_image({skImage, unref_queue}); + image->set_image(skImage); auto frameInfo = fxl::MakeRefCounted(std::move(image), 0); return fxl::MakeRefCounted(std::move(frameInfo)); } void InitCodecAndInvokeCodecCallback( - fxl::RefPtr ui_task_runner, - fml::WeakPtr context, - fxl::RefPtr unref_queue, std::unique_ptr callback, sk_sp buffer, size_t trace_id) { - auto codec = - InitCodec(context, std::move(buffer), std::move(unref_queue), trace_id); - ui_task_runner->PostTask( - fxl::MakeCopyable([callback = std::move(callback), - codec = std::move(codec), trace_id]() mutable { - InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); - })); + auto codec = InitCodec(std::move(buffer), trace_id); + Threads::UI()->PostTask(fxl::MakeCopyable([ + callback = std::move(callback), codec = std::move(codec), trace_id + ]() mutable { + InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); + })); } void InstantiateImageCodec(Dart_NativeArguments args) { @@ -144,20 +133,14 @@ void InstantiateImageCodec(Dart_NativeArguments args) { auto buffer = SkData::MakeWithCopy(list.data(), list.num_elements()); - auto dart_state = UIDartState::Current(); - - const auto& task_runners = dart_state->GetTaskRunners(); - task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( - [callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - buffer = std::move(buffer), trace_id, - ui_task_runner = task_runners.GetUITaskRunner(), - context = dart_state->GetResourceContext(), - queue = UIDartState::Current()->GetSkiaUnrefQueue()]() mutable { - InitCodecAndInvokeCodecCallback(std::move(ui_task_runner), context, - std::move(queue), std::move(callback), - std::move(buffer), trace_id); - })); + Threads::IO()->PostTask(fxl::MakeCopyable([ + callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + buffer = std::move(buffer), trace_id + ]() mutable { + InitCodecAndInvokeCodecCallback(std::move(callback), std::move(buffer), + trace_id); + })); } bool copy_to(SkBitmap* dst, SkColorType dstColorType, const SkBitmap& src) { @@ -230,8 +213,7 @@ MultiFrameCodec::MultiFrameCodec(std::unique_ptr codec) nextFrameIndex_ = 0; } -sk_sp MultiFrameCodec::GetNextFrameImage( - fml::WeakPtr resourceContext) { +sk_sp MultiFrameCodec::GetNextFrameImage() { SkBitmap& bitmap = frameBitmaps_[nextFrameIndex_]; if (!bitmap.getPixels()) { // We haven't decoded this frame yet const SkImageInfo info = codec_->getInfo().makeColorType(kN32_SkColorType); @@ -263,13 +245,15 @@ sk_sp MultiFrameCodec::GetNextFrameImage( } } - if (resourceContext) { + std::unique_ptr resourceContext = ResourceContext::Acquire(); + GrContext* context = resourceContext->Get(); + if (context) { SkPixmap pixmap(bitmap.info(), bitmap.pixelRef()->pixels(), bitmap.pixelRef()->rowBytes()); // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromPixmap(resourceContext.get(), pixmap, - false, dstColorSpace.get()); + return SkImage::MakeCrossContextFromPixmap(context, pixmap, false, + dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -280,22 +264,19 @@ sk_sp MultiFrameCodec::GetNextFrameImage( void MultiFrameCodec::GetNextFrameAndInvokeCallback( std::unique_ptr callback, - fxl::RefPtr ui_task_runner, - fml::WeakPtr resourceContext, - fxl::RefPtr unref_queue, size_t trace_id) { fxl::RefPtr frameInfo = NULL; - sk_sp skImage = GetNextFrameImage(resourceContext); + sk_sp skImage = GetNextFrameImage(); if (skImage) { fxl::RefPtr image = CanvasImage::Create(); - image->set_image({skImage, std::move(unref_queue)}); + image->set_image(skImage); frameInfo = fxl::MakeRefCounted( std::move(image), frameInfos_[nextFrameIndex_].fDuration); } nextFrameIndex_ = (nextFrameIndex_ + 1) % frameInfos_.size(); - ui_task_runner->PostTask(fxl::MakeCopyable( - [callback = std::move(callback), frameInfo, trace_id]() mutable { + Threads::UI()->PostTask(fxl::MakeCopyable( + [ callback = std::move(callback), frameInfo, trace_id ]() mutable { InvokeNextFrameCallback(frameInfo, std::move(callback), trace_id); })); @@ -312,20 +293,13 @@ Dart_Handle MultiFrameCodec::getNextFrame(Dart_Handle callback_handle) { return ToDart("Callback must be a function"); } - auto dart_state = UIDartState::Current(); - - const auto& task_runners = dart_state->GetTaskRunners(); - - task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( - [callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - this, trace_id, ui_task_runner = task_runners.GetUITaskRunner(), - queue = UIDartState::Current()->GetSkiaUnrefQueue(), - context = dart_state->GetResourceContext()]() mutable { - GetNextFrameAndInvokeCallback(std::move(callback), - std::move(ui_task_runner), context, - std::move(queue), trace_id); - })); + Threads::IO()->PostTask(fxl::MakeCopyable([ + callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + this, trace_id + ]() mutable { + GetNextFrameAndInvokeCallback(std::move(callback), trace_id); + })); return Dart_Null(); } diff --git a/lib/ui/painting/codec.h b/lib/ui/painting/codec.h index 9fdce1a8c1a33..98e5bc56df375 100644 --- a/lib/ui/painting/codec.h +++ b/lib/ui/painting/codec.h @@ -43,16 +43,11 @@ class MultiFrameCodec : public Codec { private: MultiFrameCodec(std::unique_ptr codec); - ~MultiFrameCodec() {} - sk_sp GetNextFrameImage(fml::WeakPtr resourceContext); - + sk_sp GetNextFrameImage(); void GetNextFrameAndInvokeCallback( std::unique_ptr callback, - fxl::RefPtr ui_task_runner, - fml::WeakPtr resourceContext, - fxl::RefPtr unref_queue, size_t trace_id); const std::unique_ptr codec_; diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 52ccd63f3f5d3..f6bb864627740 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -48,10 +48,10 @@ void CanvasGradient::initLinear(const tonic::Float32List& end_points, static_assert(sizeof(SkColor) == sizeof(int32_t), "SkColor doesn't use int32_t."); - set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeLinear( + set_shader(SkGradientShader::MakeLinear( reinterpret_cast(end_points.data()), reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode))); + colors.num_elements(), tile_mode)); } void CanvasGradient::initRadial(double center_x, @@ -73,14 +73,14 @@ void CanvasGradient::initRadial(double center_x, sk_matrix = ToSkMatrix(matrix4); } - set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeRadial( + set_shader(SkGradientShader::MakeRadial( SkPoint::Make(center_x, center_y), radius, reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr))); + colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr)); } -CanvasGradient::CanvasGradient() = default; +CanvasGradient::CanvasGradient() : Shader(nullptr) {} -CanvasGradient::~CanvasGradient() = default; +CanvasGradient::~CanvasGradient() {} } // namespace blink diff --git a/lib/ui/painting/image.cc b/lib/ui/painting/image.cc index a1b9b45cdc863..42e733241c990 100644 --- a/lib/ui/painting/image.cc +++ b/lib/ui/painting/image.cc @@ -4,7 +4,9 @@ #include "flutter/lib/ui/painting/image.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/image_encoding.h" +#include "flutter/lib/ui/painting/utils.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -28,9 +30,13 @@ void CanvasImage::RegisterNatives(tonic::DartLibraryNatives* natives) { natives->Register({FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -CanvasImage::CanvasImage() = default; +CanvasImage::CanvasImage() {} -CanvasImage::~CanvasImage() = default; +CanvasImage::~CanvasImage() { + // Skia objects must be deleted on the IO thread so that any associated GL + // objects will be cleaned up through the IO thread's GL context. + SkiaUnrefOnIOThread(&image_); +} Dart_Handle CanvasImage::toByteData(int format, int quality, @@ -43,8 +49,8 @@ void CanvasImage::dispose() { } size_t CanvasImage::GetAllocationSize() { - if (auto image = image_.get()) { - return image->width() * image->height() * 4; + if (image_) { + return image_->width() * image_->height() * 4; } else { return sizeof(CanvasImage); } diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index aeec2a0149c73..a7ed4298506f5 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -5,8 +5,6 @@ #ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_H_ #define FLUTTER_LIB_UI_PAINTING_IMAGE_H_ -#include "flutter/flow/skia_gpu_object.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkImage.h" @@ -27,18 +25,13 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, return fxl::MakeRefCounted(); } - int width() { return image_.get()->width(); } - - int height() { return image_.get()->height(); } - + int width() { return image_->width(); } + int height() { return image_->height(); } Dart_Handle toByteData(int format, int quality, Dart_Handle callback); - void dispose(); - sk_sp image() const { return image_.get(); } - void set_image(flow::SkiaGPUObject image) { - image_ = std::move(image); - } + const sk_sp& image() const { return image_; } + void set_image(sk_sp image) { image_ = std::move(image); } virtual size_t GetAllocationSize() override; @@ -47,7 +40,7 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, private: CanvasImage(); - flow::SkiaGPUObject image_; + sk_sp image_; }; } // namespace blink diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index f010fce893d3e..f356e955f6745 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -4,15 +4,13 @@ #include "flutter/lib/ui/painting/image_encoding.h" -#include -#include - -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/image.h" -#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/painting/resource_context.h" #include "lib/fxl/build_config.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_persistent_value.h" +#include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_invoke.h" #include "lib/tonic/typed_data/uint8_list.h" #include "third_party/skia/include/core/SkEncodedImageFormat.h" @@ -54,11 +52,10 @@ void EncodeImageAndInvokeDataCallback( std::unique_ptr callback, sk_sp image, SkEncodedImageFormat format, - int quality, - fxl::RefPtr ui_task_runner) { + int quality) { sk_sp encoded = EncodeImage(std::move(image), format, quality); - ui_task_runner->PostTask( + Threads::UI()->PostTask( fxl::MakeCopyable([callback = std::move(callback), encoded]() mutable { InvokeDataCallback(std::move(callback), std::move(encoded)); })); @@ -104,14 +101,10 @@ Dart_Handle EncodeImage(CanvasImage* canvas_image, tonic::DartState::Current(), callback_handle); sk_sp image = canvas_image->image(); - const auto& task_runners = UIDartState::Current()->GetTaskRunners(); - - task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( - [callback = std::move(callback), image, image_format, quality, - ui_task_runner = task_runners.GetUITaskRunner()]() mutable { + Threads::IO()->PostTask(fxl::MakeCopyable( + [callback = std::move(callback), image, image_format, quality]() mutable { EncodeImageAndInvokeDataCallback(std::move(callback), std::move(image), - image_format, quality, - std::move(ui_task_runner)); + image_format, quality); })); return Dart_Null(); diff --git a/lib/ui/painting/image_shader.cc b/lib/ui/painting/image_shader.cc index a4ddbba0ea24b..0fabd134c737c 100644 --- a/lib/ui/painting/image_shader.cc +++ b/lib/ui/painting/image_shader.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/painting/image_shader.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -38,17 +37,15 @@ void ImageShader::initWithImage(CanvasImage* image, SkShader::TileMode tmx, SkShader::TileMode tmy, const tonic::Float64List& matrix4) { - if (!image) { + if (!image) Dart_ThrowException( ToDart("ImageShader constructor called with non-genuine Image.")); - } SkMatrix sk_matrix = ToSkMatrix(matrix4); - set_shader(UIDartState::CreateGPUObject( - image->image()->makeShader(tmx, tmy, &sk_matrix))); + set_shader(image->image()->makeShader(tmx, tmy, &sk_matrix)); } -ImageShader::ImageShader() = default; +ImageShader::ImageShader() : Shader(nullptr) {} -ImageShader::~ImageShader() = default; +ImageShader::~ImageShader() {} } // namespace blink diff --git a/lib/ui/painting/picture.cc b/lib/ui/painting/picture.cc index 34f92b8c315fd..89ddbf5f41bb0 100644 --- a/lib/ui/painting/picture.cc +++ b/lib/ui/painting/picture.cc @@ -4,8 +4,9 @@ #include "flutter/lib/ui/painting/picture.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/canvas.h" -#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/painting/utils.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -22,20 +23,24 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Picture); DART_BIND_ALL(Picture, FOR_EACH_BINDING) -fxl::RefPtr Picture::Create(flow::SkiaGPUObject picture) { +fxl::RefPtr Picture::Create(sk_sp picture) { return fxl::MakeRefCounted(std::move(picture)); } -Picture::Picture(flow::SkiaGPUObject picture) - : picture_(std::move(picture)) {} +Picture::Picture(sk_sp picture) : picture_(std::move(picture)) {} -Picture::~Picture() = default; +Picture::~Picture() { + // Skia objects must be deleted on the IO thread so that any associated GL + // objects will be cleaned up through the IO thread's GL context. + SkiaUnrefOnIOThread(&picture_); +} fxl::RefPtr Picture::toImage(int width, int height) { fxl::RefPtr image = CanvasImage::Create(); - image->set_image(UIDartState::CreateGPUObject(SkImage::MakeFromPicture( - picture_.get(), SkISize::Make(width, height), nullptr, nullptr, - SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()))); + // TODO(abarth): We should pass in an SkColorSpace at some point. + image->set_image(SkImage::MakeFromPicture( + picture_, SkISize::Make(width, height), nullptr, nullptr, + SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB())); return image; } @@ -44,8 +49,8 @@ void Picture::dispose() { } size_t Picture::GetAllocationSize() { - if (auto picture = picture_.get()) { - return picture->approximateBytesUsed(); + if (picture_) { + return picture_->approximateBytesUsed(); } else { return sizeof(Picture); } diff --git a/lib/ui/painting/picture.h b/lib/ui/painting/picture.h index d916086b02f02..4a26d01c08374 100644 --- a/lib/ui/painting/picture.h +++ b/lib/ui/painting/picture.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_LIB_UI_PAINTING_PICTURE_H_ #define FLUTTER_LIB_UI_PAINTING_PICTURE_H_ -#include "flutter/flow/skia_gpu_object.h" #include "flutter/lib/ui/painting/image.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkPicture.h" @@ -24,9 +23,9 @@ class Picture : public fxl::RefCountedThreadSafe, public: ~Picture() override; - static fxl::RefPtr Create(flow::SkiaGPUObject picture); + static fxl::RefPtr Create(sk_sp picture); - sk_sp picture() const { return picture_.get(); } + const sk_sp& picture() const { return picture_; } fxl::RefPtr toImage(int width, int height); @@ -37,9 +36,9 @@ class Picture : public fxl::RefCountedThreadSafe, static void RegisterNatives(tonic::DartLibraryNatives* natives); private: - explicit Picture(flow::SkiaGPUObject picture); + explicit Picture(sk_sp picture); - flow::SkiaGPUObject picture_; + sk_sp picture_; }; } // namespace blink diff --git a/lib/ui/painting/picture_recorder.cc b/lib/ui/painting/picture_recorder.cc index e870e400a7230..adc73c0043920 100644 --- a/lib/ui/painting/picture_recorder.cc +++ b/lib/ui/painting/picture_recorder.cc @@ -50,9 +50,8 @@ SkCanvas* PictureRecorder::BeginRecording(SkRect bounds) { fxl::RefPtr PictureRecorder::endRecording() { if (!isRecording()) return nullptr; - - fxl::RefPtr picture = Picture::Create(UIDartState::CreateGPUObject( - picture_recorder_.finishRecordingAsPicture())); + fxl::RefPtr picture = + Picture::Create(picture_recorder_.finishRecordingAsPicture()); canvas_->Clear(); canvas_->ClearDartWrapper(); canvas_ = nullptr; diff --git a/lib/ui/painting/resource_context.cc b/lib/ui/painting/resource_context.cc new file mode 100644 index 0000000000000..1b9f71548c15f --- /dev/null +++ b/lib/ui/painting/resource_context.cc @@ -0,0 +1,51 @@ +// Copyright 2016 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. + +#include "flutter/lib/ui/painting/resource_context.h" + +#include + +#include "lib/fxl/logging.h" + +namespace blink { +namespace { + +static GrContext* g_context = nullptr; +static std::mutex g_mutex; +static volatile bool g_freeze = false; + +} // namespace + +ResourceContext::ResourceContext() { + g_mutex.lock(); +} + +ResourceContext::~ResourceContext() { + g_mutex.unlock(); +} + +void ResourceContext::Set(sk_sp context) { + FXL_DCHECK(!g_context); + g_context = context.release(); +} + +GrContext* ResourceContext::Get() { + return g_freeze ? nullptr : g_context; +} + +std::unique_ptr ResourceContext::Acquire() { + return std::make_unique(); +} + +void ResourceContext::Freeze() { + std::lock_guard lock(g_mutex); + g_freeze = true; +} + +void ResourceContext::Unfreeze() { + std::lock_guard lock(g_mutex); + g_freeze = false; +} + +} // namespace blink diff --git a/lib/ui/painting/resource_context.h b/lib/ui/painting/resource_context.h new file mode 100644 index 0000000000000..627b2053c2df9 --- /dev/null +++ b/lib/ui/painting/resource_context.h @@ -0,0 +1,60 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ +#define FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ + +#include "lib/fxl/macros.h" +#include "third_party/skia/include/gpu/GrContext.h" + +namespace blink { + +class ResourceContext { + public: + /** + * Globally set the GrContext singleton instance. + */ + static void Set(sk_sp context); + + /** + * Acquire a GrContext wrapping ResourceContext that's also an exclusive mutex + * on GrContext operations. + * + * Destructing the ResourceContext frees the mutex. + */ + static std::unique_ptr Acquire(); + + /** + * Synchronously signal a freeze on GrContext operations. + * + * ResourceContext instances will return nullptr on GrContext Get until + * unfrozen. + */ + static void Freeze(); + + /** + * Synchronously unfreeze GrContext operations. + * + * ResourceContext instances will continue to return the global GrContext + * instance on Get. + */ + static void Unfreeze(); + + ResourceContext(); + ~ResourceContext(); + + /** + * Returns global GrContext instance. May return null when operations are + * frozen. + * + * Happens on iOS when background operations on GrContext are forbidden. + */ + GrContext* Get(); + + FXL_DISALLOW_COPY_AND_ASSIGN(ResourceContext); +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ diff --git a/lib/ui/painting/shader.cc b/lib/ui/painting/shader.cc index 7999b84dfcc29..d7d8ccf20aefc 100644 --- a/lib/ui/painting/shader.cc +++ b/lib/ui/painting/shader.cc @@ -4,15 +4,19 @@ #include "flutter/lib/ui/painting/shader.h" -#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/common/threads.h" +#include "flutter/lib/ui/painting/utils.h" namespace blink { IMPLEMENT_WRAPPERTYPEINFO(ui, Shader); -Shader::Shader(flow::SkiaGPUObject shader) - : shader_(std::move(shader)) {} +Shader::Shader(sk_sp shader) : shader_(shader) {} -Shader::~Shader() = default; +Shader::~Shader() { + // Skia objects must be deleted on the IO thread so that any associated GL + // objects will be cleaned up through the IO thread's GL context. + SkiaUnrefOnIOThread(&shader_); +} } // namespace blink diff --git a/lib/ui/painting/shader.h b/lib/ui/painting/shader.h index 205197250eb84..9c0f3c601db56 100644 --- a/lib/ui/painting/shader.h +++ b/lib/ui/painting/shader.h @@ -5,8 +5,6 @@ #ifndef FLUTTER_LIB_UI_PAINTING_SHADER_H_ #define FLUTTER_LIB_UI_PAINTING_SHADER_H_ -#include "flutter/flow/skia_gpu_object.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkShader.h" @@ -20,17 +18,14 @@ class Shader : public fxl::RefCountedThreadSafe, public: ~Shader() override; - sk_sp shader() { return shader_.get(); } - - void set_shader(flow::SkiaGPUObject shader) { - shader_ = std::move(shader); - } + const sk_sp& shader() { return shader_; } + void set_shader(sk_sp shader) { shader_ = std::move(shader); } protected: - Shader(flow::SkiaGPUObject shader = {}); + Shader(sk_sp shader); private: - flow::SkiaGPUObject shader_; + sk_sp shader_; }; } // namespace blink diff --git a/lib/ui/painting/utils.cc b/lib/ui/painting/utils.cc new file mode 100644 index 0000000000000..b3f87135ac0a8 --- /dev/null +++ b/lib/ui/painting/utils.cc @@ -0,0 +1,46 @@ +// Copyright 2017 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. + +#include "flutter/lib/ui/painting/utils.h" +#include "flutter/common/threads.h" + +namespace blink { + +namespace { + +constexpr fxl::TimeDelta kDrainDelay = fxl::TimeDelta::FromMilliseconds(250); + +} // anonymous namespace + +SkiaUnrefQueue::SkiaUnrefQueue() : drain_pending_(false) {} + +SkiaUnrefQueue SkiaUnrefQueue::instance_; + +SkiaUnrefQueue& SkiaUnrefQueue::Get() { + return instance_; +} + +void SkiaUnrefQueue::Unref(SkRefCnt* object) { + std::lock_guard lock(mutex_); + objects_.push_back(object); + if (!drain_pending_) { + drain_pending_ = true; + Threads::IO()->PostDelayedTask([this] { Drain(); }, kDrainDelay); + } +} + +void SkiaUnrefQueue::Drain() { + std::deque skia_objects; + { + std::lock_guard lock(mutex_); + objects_.swap(skia_objects); + drain_pending_ = false; + } + + for (SkRefCnt* skia_object : skia_objects) { + skia_object->unref(); + } +} + +} // namespace blink diff --git a/lib/ui/painting/utils.h b/lib/ui/painting/utils.h new file mode 100644 index 0000000000000..02782c67962bc --- /dev/null +++ b/lib/ui/painting/utils.h @@ -0,0 +1,38 @@ +// Copyright 2016 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. + +#include "third_party/skia/include/core/SkRefCnt.h" + +#include +#include + +namespace blink { + +// A queue that holds Skia objects that must be destructed on the IO thread. +class SkiaUnrefQueue { + public: + static SkiaUnrefQueue& Get(); + + void Unref(SkRefCnt* object); + + private: + SkiaUnrefQueue(); + void Drain(); + + static SkiaUnrefQueue instance_; + + std::mutex mutex_; + std::deque objects_; + bool drain_pending_; +}; + +template +void SkiaUnrefOnIOThread(sk_sp* sp) { + T* object = sp->release(); + if (object) { + SkiaUnrefQueue::Get().Unref(object); + } +} + +} // namespace blink diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index 248468cc9701d..d6407f9ed42e1 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -34,9 +34,15 @@ std::shared_ptr FontCollection::GetFontCollection() const { return collection_; } -void FontCollection::RegisterFonts(const AssetManager& asset_manager) { +void FontCollection::RegisterFontsFromAssetProvider( + fxl::RefPtr asset_provider) { + + if (!asset_provider){ + return; + } + std::vector manifest_data; - if (!asset_manager.GetAsBuffer("FontManifest.json", &manifest_data)) { + if (!asset_provider->GetAsBuffer("FontManifest.json", &manifest_data)) { FXL_DLOG(WARNING) << "Could not find the font manifest in the asset store."; return; } @@ -86,8 +92,8 @@ void FontCollection::RegisterFonts(const AssetManager& asset_manager) { // TODO: Handle weights and styles. std::vector font_data; - if (asset_manager.GetAsBuffer(font_asset->value.GetString(), - &font_data)) { + if (asset_provider->GetAsBuffer(font_asset->value.GetString(), + &font_data)) { // The data must be copied because it needs to be moved into the // typeface as a stream. auto data = diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index ea9c2f46a96a0..fb393b1582b79 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -7,10 +7,10 @@ #include #include - -#include "flutter/assets/asset_manager.h" +#include "flutter/assets/asset_provider.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" +#include "txt/asset_data_provider.h" #include "txt/font_collection.h" namespace blink { @@ -21,8 +21,7 @@ class FontCollection { std::shared_ptr GetFontCollection() const; - void RegisterFonts(const AssetManager& asset_manager); - + void RegisterFontsFromAssetProvider(fxl::RefPtr asset_provider); void RegisterTestFonts(); private: diff --git a/lib/ui/text/paragraph.cc b/lib/ui/text/paragraph.cc index fd00f6f51b3a3..858ccd01d4ef6 100644 --- a/lib/ui/text/paragraph.cc +++ b/lib/ui/text/paragraph.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph.h" #include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" #include "flutter/sky/engine/core/rendering/RenderParagraph.h" #include "flutter/sky/engine/core/rendering/RenderText.h" @@ -53,8 +53,7 @@ Paragraph::Paragraph(std::unique_ptr paragraph) Paragraph::~Paragraph() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - destruction_task_runner_->PostTask( - [renderView]() { renderView->destroy(); }); + Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph.h b/lib/ui/text/paragraph.h index b3a943209ab4c..1b2019373553a 100644 --- a/lib/ui/text/paragraph.h +++ b/lib/ui/text/paragraph.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ -#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/paragraph_impl_blink.h" @@ -67,10 +66,6 @@ class Paragraph : public fxl::RefCountedThreadSafe, explicit Paragraph(std::unique_ptr paragraph); - // TODO: This can be removed when the render view association for the legacy - // runtime is removed. - fxl::RefPtr destruction_task_runner_ = - UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index b987e3fde6272..44d05053ba342 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph_builder.h" #include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/sky/engine/core/rendering/RenderInline.h" @@ -205,11 +205,9 @@ fxl::RefPtr ParagraphBuilder::create( double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink) { - return fxl::MakeRefCounted( - encoded, fontFamily, fontSize, lineHeight, ellipsis, locale, - UIDartState::Current()->use_blink()); + const std::string& locale) { + return fxl::MakeRefCounted(encoded, fontFamily, fontSize, + lineHeight, ellipsis, locale); } ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, @@ -217,10 +215,8 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink) - : m_useBlink(use_blink) { - if (!m_useBlink) { + const std::string& locale) { + if (!Settings::Get().using_blink) { int32_t mask = encoded[0]; txt::ParagraphStyle style; if (mask & psTextAlignMask) @@ -279,8 +275,7 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, ParagraphBuilder::~ParagraphBuilder() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - destruction_task_runner_->PostTask( - [renderView]() { renderView->destroy(); }); + Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); } } @@ -295,7 +290,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, int32_t mask = encoded[0]; - if (!m_useBlink) { + if (!Settings::Get().using_blink) { // Set to use the properties of the previous style if the property is not // explicitly given. txt::TextStyle style = m_paragraphBuilder->PeekStyle(); @@ -428,7 +423,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, } void ParagraphBuilder::pop() { - if (!m_useBlink) { + if (!Settings::Get().using_blink) { m_paragraphBuilder->Pop(); } else { // Blink Version. @@ -450,7 +445,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { if (error_code != U_BUFFER_OVERFLOW_ERROR) return tonic::ToDart("string is not well-formed UTF-16"); - if (!m_useBlink) { + if (!Settings::Get().using_blink) { m_paragraphBuilder->AddText(text); } else { // Blink Version. @@ -469,7 +464,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { fxl::RefPtr ParagraphBuilder::build() { m_currentRenderObject = nullptr; - if (!m_useBlink) { + if (!Settings::Get().using_blink) { return Paragraph::Create(m_paragraphBuilder->Build()); } else { return Paragraph::Create(m_renderView.release()); diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 1c38d98696def..37a1e9a3e74cf 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -32,8 +32,7 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink); + const std::string& locale); ~ParagraphBuilder() override; @@ -59,20 +58,14 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink); + const std::string& locale); void createRenderView(); - // TODO: This can be removed when the render view association for the legacy - // runtime is removed. - fxl::RefPtr destruction_task_runner_ = - UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; RenderObject* m_renderParagraph; RenderObject* m_currentRenderObject; std::unique_ptr m_paragraphBuilder; - bool m_useBlink; }; } // namespace blink diff --git a/lib/ui/text/paragraph_impl_blink.cc b/lib/ui/text/paragraph_impl_blink.cc index 5c50f047afa33..c7752c0a7c757 100644 --- a/lib/ui/text/paragraph_impl_blink.cc +++ b/lib/ui/text/paragraph_impl_blink.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/text/paragraph_impl_blink.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" @@ -29,8 +30,7 @@ ParagraphImplBlink::ParagraphImplBlink(PassOwnPtr renderView) ParagraphImplBlink::~ParagraphImplBlink() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - destruction_task_runner_->PostTask( - [renderView]() { renderView->destroy(); }); + Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph_impl_blink.h b/lib/ui/text/paragraph_impl_blink.h index ebd80f8dd5382..79d89ad471962 100644 --- a/lib/ui/text/paragraph_impl_blink.h +++ b/lib/ui/text/paragraph_impl_blink.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ -#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/text_box.h" @@ -42,10 +41,6 @@ class ParagraphImplBlink : public ParagraphImpl { int absoluteOffsetForPosition(const PositionWithAffinity& position); - // TODO: This can be removed when the render view association for the legacy - // runtime is removed. - fxl::RefPtr destruction_task_runner_ = - UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_impl_txt.cc b/lib/ui/text/paragraph_impl_txt.cc index 28c6ea19a8157..de8d8ff0b2fc3 100644 --- a/lib/ui/text/paragraph_impl_txt.cc +++ b/lib/ui/text/paragraph_impl_txt.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/text/paragraph_impl_txt.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "lib/fxl/logging.h" diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 8ef7ca98fd758..3bdf21e6a1a93 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/window.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" #include "lib/tonic/converter/dart_converter.h" @@ -13,44 +12,34 @@ using tonic::ToDart; namespace blink { -UIDartState::UIDartState(TaskRunners task_runners, - TaskObserverAdd add_callback, - TaskObserverRemove remove_callback, - fml::WeakPtr resource_context, - fxl::RefPtr skia_unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint, - std::string logger_prefix) - : task_runners_(std::move(task_runners)), - add_callback_(std::move(add_callback)), - remove_callback_(std::move(remove_callback)), - resource_context_(std::move(resource_context)), - advisory_script_uri_(std::move(advisory_script_uri)), - advisory_script_entrypoint_(std::move(advisory_script_entrypoint)), - logger_prefix_(std::move(logger_prefix)), - skia_unref_queue_(std::move(skia_unref_queue)), - weak_factory_(this) { - AddOrRemoveTaskObserver(true /* add */); -} +IsolateClient::~IsolateClient() {} -UIDartState::~UIDartState() { - AddOrRemoveTaskObserver(false /* remove */); -} +UIDartState::UIDartState(IsolateClient* isolate_client, + std::unique_ptr window, + int dirfd) + : tonic::DartState(dirfd), + isolate_client_(isolate_client), + main_port_(ILLEGAL_PORT), + window_(std::move(window)) {} -const std::string& UIDartState::GetAdvisoryScriptURI() const { - return advisory_script_uri_; +UIDartState::~UIDartState() { + main_port_ = ILLEGAL_PORT; + // We've already destroyed the isolate. Revoke any weak ptrs held by + // DartPersistentValues so they don't try to enter the destroyed isolate to + // clean themselves up. + // TODO(abarth): Can we do this work in the base class? + weak_factory_.InvalidateWeakPtrs(); } -const std::string& UIDartState::GetAdvisoryScriptEntrypoint() const { - return advisory_script_entrypoint_; +UIDartState* UIDartState::CreateForChildIsolate() { + return new UIDartState(isolate_client_, nullptr); } void UIDartState::DidSetIsolate() { + FXL_DCHECK(!debug_name_prefix_.empty()); main_port_ = Dart_GetMainPortId(); std::ostringstream debug_name; - // main.dart$main-1234 - debug_name << advisory_script_uri_ << "$" << advisory_script_entrypoint_ - << "-" << main_port_; + debug_name << debug_name_prefix_ << "$main-" << main_port_; debug_name_ = debug_name.str(); } @@ -66,48 +55,8 @@ PassRefPtr UIDartState::font_selector() { return font_selector_; } -void UIDartState::SetWindow(std::unique_ptr window) { - window_ = std::move(window); -} - -const TaskRunners& UIDartState::GetTaskRunners() const { - return task_runners_; -} - -fxl::RefPtr UIDartState::GetSkiaUnrefQueue() const { - return skia_unref_queue_; -} - -void UIDartState::ScheduleMicrotask(Dart_Handle closure) { - if (tonic::LogIfError(closure) || !Dart_IsClosure(closure)) { - return; - } - - microtask_queue_.ScheduleMicrotask(closure); -} - -void UIDartState::FlushMicrotasksNow() { - microtask_queue_.RunMicrotasks(); -} - -void UIDartState::AddOrRemoveTaskObserver(bool add) { - auto task_runner = task_runners_.GetUITaskRunner(); - if (!task_runner) { - // This may happen in case the isolate has no thread affinity (for example, - // the service isolate). - return; - } - FXL_DCHECK(add_callback_ && remove_callback_); - if (add) { - add_callback_(reinterpret_cast(this), - [this]() { this->FlushMicrotasksNow(); }); - } else { - remove_callback_(reinterpret_cast(this)); - } -} - -fml::WeakPtr UIDartState::GetResourceContext() const { - return resource_context_; +void UIDartState::set_debug_name_prefix(const std::string& debug_name_prefix) { + debug_name_prefix_ = debug_name_prefix; } } // namespace blink diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index a5c78c1671815..0f7f9343d4958 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -5,106 +5,65 @@ #ifndef FLUTTER_LIB_UI_UI_DART_STATE_H_ #define FLUTTER_LIB_UI_UI_DART_STATE_H_ -#include -#include #include -#include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" -#include "flutter/flow/skia_gpu_object.h" -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/sky/engine/wtf/RefPtr.h" #include "lib/fxl/build_config.h" -#include "lib/tonic/dart_microtask_queue.h" #include "lib/tonic/dart_persistent_value.h" #include "lib/tonic/dart_state.h" #include "third_party/dart/runtime/include/dart_api.h" -#include "third_party/skia/include/gpu/GrContext.h" namespace blink { class FontSelector; class Window; +class IsolateClient { + public: + virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate) = 0; + virtual void DidShutdownMainIsolate() = 0; + + protected: + virtual ~IsolateClient(); +}; + class UIDartState : public tonic::DartState { public: + UIDartState(IsolateClient* isolate_client, + std::unique_ptr window, + int dirfd = -1); + ~UIDartState() override; + static UIDartState* Current(); - Dart_Port main_port() const { return main_port_; } + UIDartState* CreateForChildIsolate(); + IsolateClient* isolate_client() const { return isolate_client_; } + void set_isolate_client(IsolateClient* isolate_client) { + isolate_client_ = isolate_client; + } + Dart_Port main_port() const { return main_port_; } const std::string& debug_name() const { return debug_name_; } - - const std::string& logger_prefix() const { return logger_prefix_; } - Window* window() const { return window_.get(); } + void set_debug_name_prefix(const std::string& debug_name_prefix); void set_font_selector(PassRefPtr selector); - PassRefPtr font_selector(); - - bool use_blink() const { return use_blink_; } - - const TaskRunners& GetTaskRunners() const; - - void ScheduleMicrotask(Dart_Handle handle); - - void FlushMicrotasksNow(); - - fxl::RefPtr GetSkiaUnrefQueue() const; - - fml::WeakPtr GetResourceContext() const; - - template - static flow::SkiaGPUObject CreateGPUObject(sk_sp object) { - if (!object) { - return {}; - } - auto state = UIDartState::Current(); - FXL_DCHECK(state); - auto queue = state->GetSkiaUnrefQueue(); - return {std::move(object), std::move(queue)}; - }; - - protected: - UIDartState(TaskRunners task_runners, - TaskObserverAdd add_callback, - TaskObserverRemove remove_callback, - fml::WeakPtr resource_context, - fxl::RefPtr skia_unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint, - std::string logger_prefix); - - ~UIDartState() override; - - void SetWindow(std::unique_ptr window); - - void set_use_blink(bool use_blink) { use_blink_ = use_blink; } - - const std::string& GetAdvisoryScriptURI() const; - - const std::string& GetAdvisoryScriptEntrypoint() const; + bool is_controller_state() const { return is_controller_state_; } + void set_is_controller_state(bool value) { is_controller_state_ = value; } + bool shutting_down() const { return shutting_down_; } + void set_shutting_down(bool value) { shutting_down_ = value; } private: void DidSetIsolate() override; - const TaskRunners task_runners_; - const TaskObserverAdd add_callback_; - const TaskObserverRemove remove_callback_; - fml::WeakPtr resource_context_; - const std::string advisory_script_uri_; - const std::string advisory_script_entrypoint_; - const std::string logger_prefix_; - Dart_Port main_port_ = ILLEGAL_PORT; + IsolateClient* isolate_client_; + Dart_Port main_port_; + std::string debug_name_prefix_; std::string debug_name_; std::unique_ptr window_; RefPtr font_selector_; - fxl::RefPtr skia_unref_queue_; - tonic::DartMicrotaskQueue microtask_queue_; - fml::WeakPtrFactory weak_factory_; - - void AddOrRemoveTaskObserver(bool add); - - bool use_blink_ = false; + bool is_controller_state_; + bool shutting_down_ = false; }; } // namespace blink diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index 2cca2fd179888..065159b79713b 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -6,7 +6,7 @@ #include -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/window/window.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_state.h" @@ -43,14 +43,12 @@ Dart_Handle WrapByteData(std::vector data) { } // anonymous namespace PlatformMessageResponseDart::PlatformMessageResponseDart( - tonic::DartPersistentValue callback, - fxl::RefPtr ui_task_runner) - : callback_(std::move(callback)), - ui_task_runner_(std::move(ui_task_runner)) {} + tonic::DartPersistentValue callback) + : callback_(std::move(callback)) {} PlatformMessageResponseDart::~PlatformMessageResponseDart() { if (!callback_.is_empty()) { - ui_task_runner_->PostTask( + Threads::UI()->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { callback.Clear(); })); @@ -62,7 +60,7 @@ void PlatformMessageResponseDart::Complete(std::vector data) { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - ui_task_runner_->PostTask(fxl::MakeCopyable( + Threads::UI()->PostTask(fxl::MakeCopyable( [ callback = std::move(callback_), data = std::move(data) ]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) @@ -79,7 +77,7 @@ void PlatformMessageResponseDart::CompleteEmpty() { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - ui_task_runner_->PostTask( + Threads::UI()->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) diff --git a/lib/ui/window/platform_message_response_dart.h b/lib/ui/window/platform_message_response_dart.h index 67bfb3d359691..51c55a930014b 100644 --- a/lib/ui/window/platform_message_response_dart.h +++ b/lib/ui/window/platform_message_response_dart.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ #define FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ -#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/platform_message_response.h" #include "lib/tonic/dart_persistent_value.h" @@ -20,13 +19,10 @@ class PlatformMessageResponseDart : public PlatformMessageResponse { void CompleteEmpty() override; protected: - explicit PlatformMessageResponseDart( - tonic::DartPersistentValue callback, - fxl::RefPtr ui_task_runner); + explicit PlatformMessageResponseDart(tonic::DartPersistentValue callback); ~PlatformMessageResponseDart() override; tonic::DartPersistentValue callback_; - fxl::RefPtr ui_task_runner_; }; } // namespace blink diff --git a/lib/ui/window/viewport_metrics.h b/lib/ui/window/viewport_metrics.h index 5085d06f42724..1e443ae8c1404 100644 --- a/lib/ui/window/viewport_metrics.h +++ b/lib/ui/window/viewport_metrics.h @@ -23,25 +23,6 @@ struct ViewportMetrics { int32_t physical_view_inset_left = 0; }; -struct LogicalSize { - double width = 0.0; - double height = 0.0; -}; - -struct LogicalInset { - double left = 0.0; - double top = 0.0; - double right = 0.0; - double bottom = 0.0; -}; - -struct LogicalMetrics { - LogicalSize size; - double scale = 1.0; - LogicalInset padding; - LogicalInset view_inset; -}; - } // namespace blink #endif // FLUTTER_LIB_UI_WINDOW_VIEWPORT_METRICS_H_ diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 4cce1cc5903b0..e12e03f10d01f 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -63,8 +63,7 @@ void SendPlatformMessage(Dart_Handle window, fxl::RefPtr response; if (!Dart_IsNull(callback)) { response = fxl::MakeRefCounted( - tonic::DartPersistentValue(dart_state, callback), - dart_state->GetTaskRunners().GetUITaskRunner()); + tonic::DartPersistentValue(dart_state, callback)); } if (Dart_IsNull(data.dart_handle())) { UIDartState::Current()->window()->client()->HandlePlatformMessage( @@ -255,7 +254,7 @@ void Window::BeginFrame(fxl::TimePoint frameTime) { Dart_NewInteger(microseconds), }); - UIDartState::Current()->FlushMicrotasksNow(); + tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); DartInvokeField(library_.value(), "_drawFrame", {}); } diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index 2feeccb65f9cc..ef0d7ef863a0e 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -13,7 +13,6 @@ #include "flutter/lib/ui/window/viewport_metrics.h" #include "lib/fxl/time/time_point.h" #include "lib/tonic/dart_persistent_value.h" -#include "third_party/skia/include/gpu/GrContext.h" namespace tonic { class DartLibraryNatives; @@ -36,14 +35,12 @@ class WindowClient { virtual ~WindowClient(); }; -class Window final { +class Window { public: explicit Window(WindowClient* client); - ~Window(); WindowClient* client() const { return client_; } - const ViewportMetrics& viewport_metrics() { return viewport_metrics_; } void DidCreateIsolate(); diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 455d7e228168f..dea8a8906d031 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -4,7 +4,6 @@ import("//third_party/dart/runtime/bin/vmservice/vmservice_sources.gni") import("$flutter_root/common/config.gni") -import("$flutter_root/testing/testing.gni") action("gen_embedded_resources_cc") { script = "//third_party/dart/runtime/tools/create_resources.py" @@ -38,7 +37,9 @@ source_set("embedded_resources_cc") { deps = [ ":gen_embedded_resources_cc", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] } source_set("test_font") { @@ -49,7 +50,9 @@ source_set("test_font") { deps = [ "//third_party/skia", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] defines = [] if (flutter_runtime_mode == "debug" || current_toolchain == host_toolchain) { # Though the test font data is small, we dont want to add to the binary size @@ -60,19 +63,16 @@ source_set("test_font") { } source_set("runtime") { + sources = [ "asset_font_selector.cc", "asset_font_selector.h", - "dart_isolate.cc", - "dart_isolate.h", + "dart_controller.cc", + "dart_controller.h", + "dart_init.cc", + "dart_init.h", "dart_service_isolate.cc", "dart_service_isolate.h", - "dart_snapshot.cc", - "dart_snapshot.h", - "dart_snapshot_buffer.cc", - "dart_snapshot_buffer.h", - "dart_vm.cc", - "dart_vm.h", "embedder_resources.cc", "embedder_resources.h", "platform_impl.cc", @@ -81,8 +81,8 @@ source_set("runtime") { "runtime_controller.h", "runtime_delegate.cc", "runtime_delegate.h", - "service_protocol.cc", - "service_protocol.h", + "runtime_init.cc", + "runtime_init.h", "start_up.cc", "start_up.h", "test_font_selector.cc", @@ -92,24 +92,25 @@ source_set("runtime") { deps = [ ":embedded_resources_cc", ":test_font", + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", - "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/io", "$flutter_root/lib/ui", "$flutter_root/sky/engine/platform", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//topaz/lib/tonic", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] # In AOT mode, precompiled snapshots contain the instruction buffer. # Generation of the same requires all application specific script code to be @@ -118,28 +119,3 @@ source_set("runtime") { deps += [ "$flutter_root/lib/snapshot" ] } } - -test_fixtures("runtime_fixtures") { - fixtures = [ "fixtures/simple_main.dart" ] -} - -executable("runtime_unittests") { - testonly = true - - sources = [ - "dart_isolate_unittests.cc", - "dart_vm_unittests.cc", - ] - - deps = [ - ":runtime", - ":runtime_fixtures", - "$flutter_root/fml", - "$flutter_root/lib/snapshot", - "$flutter_root/testing", - "//garnet/public/lib/fxl", - "//third_party/dart/runtime:libdart_jit", - "//third_party/skia", - "//topaz/lib/tonic", - ] -} diff --git a/runtime/asset_font_selector.cc b/runtime/asset_font_selector.cc index 2a43f39e3a89b..abf4bf9874ddd 100644 --- a/runtime/asset_font_selector.cc +++ b/runtime/asset_font_selector.cc @@ -80,15 +80,27 @@ struct FontMatcher { } // namespace -void AssetFontSelector::Install(fxl::RefPtr asset_manager) { +void AssetFontSelector::Install( + fxl::RefPtr asset_provider) { RefPtr font_selector = - adoptRef(new AssetFontSelector(std::move(asset_manager))); + adoptRef(new AssetFontSelector(std::move(asset_provider))); font_selector->parseFontManifest(); UIDartState::Current()->set_font_selector(font_selector); } -AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_manager) - : asset_manager_(std::move(asset_manager)) {} +void AssetFontSelector::Install(fxl::RefPtr asset_store) { + RefPtr font_selector = + adoptRef(new AssetFontSelector(std::move(asset_store))); + font_selector->parseFontManifest(); + UIDartState::Current()->set_font_selector(font_selector); +} + +AssetFontSelector::AssetFontSelector( + fxl::RefPtr asset_provider) + : asset_provider_(std::move(asset_provider)) {} + +AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_store) + : asset_store_(std::move(asset_store)) {} AssetFontSelector::~AssetFontSelector() {} @@ -106,9 +118,12 @@ AssetFontSelector::FlutterFontAttributes::~FlutterFontAttributes() {} void AssetFontSelector::parseFontManifest() { std::vector font_manifest_data; - if (!asset_manager_->GetAsBuffer(kFontManifestAssetPath, - &font_manifest_data)) { - return; + if (!asset_provider_ || + !asset_provider_->GetAsBuffer(kFontManifestAssetPath, + &font_manifest_data)) { + if (!asset_store_ || + !asset_store_->GetAsBuffer(kFontManifestAssetPath, &font_manifest_data)) + return; } rapidjson::Document document; @@ -224,8 +239,13 @@ sk_sp AssetFontSelector::getTypefaceAsset( } std::unique_ptr typeface_asset(new TypefaceAsset); - if (!asset_manager_->GetAsBuffer(asset_path, &typeface_asset->data)) { - return nullptr; + if (!asset_provider_ || !asset_provider_->GetAsBuffer( + asset_path, &typeface_asset->data)) { + if (!asset_store_ || + !asset_store_->GetAsBuffer(asset_path, &typeface_asset->data)) { + typeface_cache_.insert(std::make_pair(asset_path, nullptr)); + return nullptr; + } } sk_sp font_mgr(SkFontMgr::RefDefault()); diff --git a/runtime/asset_font_selector.h b/runtime/asset_font_selector.h index 8d7e946d89e7e..921c0472dba78 100644 --- a/runtime/asset_font_selector.h +++ b/runtime/asset_font_selector.h @@ -8,7 +8,7 @@ #include #include -#include "flutter/assets/asset_manager.h" +#include "flutter/assets/directory_asset_bundle.h" #include "flutter/assets/zip_asset_store.h" #include "flutter/sky/engine/platform/fonts/FontCacheKey.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" @@ -24,7 +24,11 @@ class AssetFontSelector : public FontSelector { ~AssetFontSelector() override; - static void Install(fxl::RefPtr asset_manager); + static void Install(fxl::RefPtr asset_provider); + + // TODO(zarah): Remove this and related code using asset_store once flx is + // removed. + static void Install(fxl::RefPtr asset_store); PassRefPtr getFontData(const FontDescription& font_description, const AtomicString& family_name) override; @@ -40,14 +44,19 @@ class AssetFontSelector : public FontSelector { private: struct TypefaceAsset; - explicit AssetFontSelector(fxl::RefPtr asset_manager); + explicit AssetFontSelector( + fxl::RefPtr asset_provider); + + explicit AssetFontSelector(fxl::RefPtr asset_store); void parseFontManifest(); sk_sp getTypefaceAsset(const FontDescription& font_description, const AtomicString& family_name); - fxl::RefPtr asset_manager_; + fxl::RefPtr asset_provider_; + + fxl::RefPtr asset_store_; HashMap> font_family_map_; diff --git a/runtime/dart_controller.cc b/runtime/dart_controller.cc new file mode 100644 index 0000000000000..84cfceeaecc10 --- /dev/null +++ b/runtime/dart_controller.cc @@ -0,0 +1,250 @@ +// Copyright 2015 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. + +#include "flutter/runtime/dart_controller.h" +#include "lib/fxl/build_config.h" + +#if defined(OS_WIN) +#include +#undef GetCurrentDirectory +#endif + +#include + +#include "flutter/common/settings.h" +#include "flutter/common/threads.h" +#include "flutter/glue/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "lib/fxl/files/directory.h" +#include "lib/fxl/files/path.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_message_handler.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/dart_wrappable.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/tonic/logging/dart_invoke.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/scopes/dart_isolate_scope.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +using tonic::LogIfError; +using tonic::ToDart; + +namespace blink { +namespace { +#if defined(OS_WIN) + +std::string FindAndReplace(const std::string& str, + const std::string& findStr, + const std::string& replaceStr) { + std::string rStr = str; + size_t pos = 0; + while ((pos = rStr.find(findStr, pos)) != std::string::npos) { + rStr.replace(pos, findStr.length(), replaceStr); + pos += replaceStr.length(); + } + return rStr; +} + +std::string SanitizePath(const std::string& path) { + return FindAndReplace(path, "\\\\", "/"); +} + +std::string ResolvePath(std::string path) { + std::string sanitized = SanitizePath(path); + if ((sanitized.length() > 2) && (sanitized[1] == ':')) { + return sanitized; + } + return files::SimplifyPath(files::GetCurrentDirectory() + "/" + sanitized); +} + +#else // defined(OS_WIN) + +std::string SanitizePath(const std::string& path) { + return path; +} + +// TODO(abarth): Consider adding this to //garnet/public/lib/fxl. +std::string ResolvePath(std::string path) { + if (!path.empty() && path[0] == '/') + return path; + return files::SimplifyPath(files::GetCurrentDirectory() + "/" + path); +} + +#endif + +} // namespace + +DartController::DartController() : ui_dart_state_(nullptr) {} + +DartController::~DartController() { + if (ui_dart_state_) { + ui_dart_state_->set_isolate_client(nullptr); + + if (!ui_dart_state_->shutting_down()) { + // Don't use a tonic::DartIsolateScope here since we never exit the + // isolate. + Dart_EnterIsolate(ui_dart_state_->isolate()); + // Clear the message notify callback. + Dart_SetMessageNotifyCallback(nullptr); + Dart_ShutdownIsolate(); + } + } +} + +const std::string DartController::main_entrypoint_ = "main"; + +bool DartController::SendStartMessage(Dart_Handle root_library, + const std::string& entrypoint) { + if (LogIfError(root_library)) + return true; + + { + // Temporarily exit the isolate while we make it runnable. + Dart_Isolate isolate = dart_state()->isolate(); + FXL_DCHECK(Dart_CurrentIsolate() == isolate); + Dart_ExitIsolate(); + Dart_IsolateMakeRunnable(isolate); + Dart_EnterIsolate(isolate); + } + + // In order to support pausing the isolate at start, we indirectly invoke + // main by sending a message to the isolate. + + // Get the closure of main(). + Dart_Handle main_closure = Dart_GetClosure( + root_library, Dart_NewStringFromCString(entrypoint.c_str())); + if (LogIfError(main_closure)) + return true; + + // Grab the 'dart:isolate' library. + Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); + DART_CHECK_VALID(isolate_lib); + + // Send the start message containing the entry point by calling + // _startMainIsolate in dart:isolate. + const intptr_t kNumIsolateArgs = 2; + Dart_Handle isolate_args[kNumIsolateArgs]; + isolate_args[0] = main_closure; + isolate_args[1] = Dart_Null(); + Dart_Handle result = Dart_Invoke(isolate_lib, ToDart("_startMainIsolate"), + kNumIsolateArgs, isolate_args); + return LogIfError(result); +} + +tonic::DartErrorHandleType DartController::RunFromKernel( + const std::vector& kernel, + const std::string& entrypoint) { + tonic::DartState::Scope scope(dart_state()); + tonic::DartErrorHandleType error = tonic::kNoError; + if (Dart_IsNull(Dart_RootLibrary())) { + Dart_Handle result = Dart_LoadScriptFromKernel(kernel.data(), kernel.size()); + LogIfError(result); + error = tonic::GetErrorHandleType(result); + } + if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { + return tonic::kUnknownErrorType; + } + return error; +} + +tonic::DartErrorHandleType DartController::RunFromPrecompiledSnapshot( + const std::string& entrypoint) { + TRACE_EVENT0("flutter", "DartController::RunFromPrecompiledSnapshot"); + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + tonic::DartState::Scope scope(dart_state()); + if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { + return tonic::kUnknownErrorType; + } + return tonic::kNoError; +} + +tonic::DartErrorHandleType DartController::RunFromScriptSnapshot( + const uint8_t* buffer, + size_t size, + const std::string& entrypoint) { + tonic::DartState::Scope scope(dart_state()); + tonic::DartErrorHandleType error = tonic::kNoError; + if (Dart_IsNull(Dart_RootLibrary())) { + Dart_Handle result = Dart_LoadScriptFromSnapshot(buffer, size); + LogIfError(result); + error = tonic::GetErrorHandleType(result); + } + if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { + return tonic::kUnknownErrorType; + } + return error; +} + +tonic::DartErrorHandleType DartController::RunFromSource( + const std::string& main, + const std::string& packages) { + tonic::DartState::Scope scope(dart_state()); + tonic::DartErrorHandleType error = tonic::kNoError; + if (Dart_IsNull(Dart_RootLibrary())) { + tonic::FileLoader& loader = dart_state()->file_loader(); + if (!packages.empty() && !loader.LoadPackagesMap(ResolvePath(packages))) + FXL_LOG(WARNING) << "Failed to load package map: " << packages; + Dart_Handle result = loader.LoadScript(SanitizePath(main)); + LogIfError(result); + error = tonic::GetErrorHandleType(result); + } + if (SendStartMessage(Dart_RootLibrary())) { + return tonic::kCompilationErrorType; + } + return error; +} + +void DartController::CreateIsolateFor(const std::string& script_uri, + const uint8_t* isolate_snapshot_data, + const uint8_t* isolate_snapshot_instr, + std::unique_ptr state) { + char* error = nullptr; + + void* platform_kernel = GetKernelPlatformBinary(); + + Dart_Isolate isolate; + if (platform_kernel != nullptr) { + isolate = Dart_CreateIsolateFromKernel( + script_uri.c_str(), "main", platform_kernel, nullptr /* flags */, + static_cast(state.get()), &error); + } else { + isolate = + Dart_CreateIsolate(script_uri.c_str(), "main", isolate_snapshot_data, + isolate_snapshot_instr, nullptr, + static_cast(state.get()), &error); + } + FXL_CHECK(isolate) << error; + ui_dart_state_ = state.release(); + ui_dart_state_->set_is_controller_state(true); + dart_state()->message_handler().Initialize(blink::Threads::UI()); + + Dart_SetShouldPauseOnStart(Settings::Get().start_paused); + + ui_dart_state_->set_debug_name_prefix(script_uri); + ui_dart_state_->SetIsolate(isolate); + FXL_CHECK(!LogIfError( + Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); + + { + tonic::DartApiScope dart_api_scope; + DartIO::InitForIsolate(); + DartUI::InitForIsolate(); + DartRuntimeHooks::Install(DartRuntimeHooks::MainIsolate, script_uri); + + std::unique_ptr ui_class_provider( + new tonic::DartClassProvider(dart_state(), "dart:ui")); + dart_state()->class_library().add_provider("ui", + std::move(ui_class_provider)); + } + Dart_ExitIsolate(); +} + +} // namespace blink diff --git a/runtime/dart_controller.h b/runtime/dart_controller.h new file mode 100644 index 0000000000000..4b11a8660b7e7 --- /dev/null +++ b/runtime/dart_controller.h @@ -0,0 +1,55 @@ +// Copyright 2015 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. + +#ifndef FLUTTER_RUNTIME_DART_CONTROLLER_H_ +#define FLUTTER_RUNTIME_DART_CONTROLLER_H_ + +#include +#include + +#include "lib/fxl/macros.h" +#include "lib/tonic/logging/dart_error.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace blink { +class UIDartState; + +class DartController { + public: + DartController(); + ~DartController(); + + tonic::DartErrorHandleType RunFromKernel( + const std::vector& kernel, + const std::string& entrypoint = main_entrypoint_); + tonic::DartErrorHandleType RunFromPrecompiledSnapshot( + const std::string& entrypoint = main_entrypoint_); + tonic::DartErrorHandleType RunFromScriptSnapshot( + const uint8_t* buffer, + size_t size, + const std::string& entrypoint = main_entrypoint_); + tonic::DartErrorHandleType RunFromSource(const std::string& main, + const std::string& packages); + + void CreateIsolateFor(const std::string& script_uri, + const uint8_t* isolate_snapshot_data, + const uint8_t* isolate_snapshot_instr, + std::unique_ptr ui_dart_state); + + UIDartState* dart_state() const { return ui_dart_state_; } + + private: + bool SendStartMessage(Dart_Handle root_library, + const std::string& entrypoint = main_entrypoint_); + + static const std::string main_entrypoint_; + + // The DartState associated with the main isolate. + UIDartState* ui_dart_state_; + + FXL_DISALLOW_COPY_AND_ASSIGN(DartController); +}; +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_CONTROLLER_H_ diff --git a/runtime/dart_init.cc b/runtime/dart_init.cc new file mode 100644 index 0000000000000..e3d88322a4882 --- /dev/null +++ b/runtime/dart_init.cc @@ -0,0 +1,725 @@ +// Copyright 2015 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. + +#include "flutter/runtime/dart_init.h" +#include "flutter/sky/engine/wtf/OperatingSystem.h" + +#include +#include +#include + +#if defined(OS_WIN) +#include +#include +#undef ERROR + +#define access _access +#define R_OK 0x4 + +#ifndef S_ISDIR +#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#endif + +#else +#include +#endif + +#include +#include +#include +#include + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/unzipper_provider.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/common/settings.h" +#include "flutter/glue/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/runtime/start_up.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/files/path.h" +#include "lib/fxl/files/file.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/time/time_delta.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/dart_sticky_error.h" +#include "lib/tonic/dart_wrappable.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/tonic/logging/dart_invoke.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/scopes/dart_isolate_scope.h" +#include "lib/tonic/typed_data/uint8_list.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" +#include "third_party/dart/runtime/include/dart_mirrors_api.h" + +using tonic::DartClassProvider; +using tonic::LogIfError; +using tonic::ToDart; + +namespace dart { +namespace observatory { + +#if !OS(FUCHSIA) && FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE + +// These two symbols are defined in |observatory_archive.cc| which is generated +// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. +// Both of these symbols will be part of the data segment and therefore are read +// only. +extern unsigned int observatory_assets_archive_len; +extern const uint8_t* observatory_assets_archive; + +#endif // FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE + +} // namespace observatory +} // namespace dart + +namespace blink { + +const char kKernelAssetKey[] = "kernel_blob.bin"; +const char kSnapshotAssetKey[] = "snapshot_blob.bin"; +const char kPlatformKernelAssetKey[] = "platform.dill"; + +namespace { + +// Arguments passed to the Dart VM in all configurations. +static const char* kDartLanguageArgs[] = { + "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", + "--causal_async_stacks", "--limit-ints-to-64-bits", +}; + +static const char* kDartPrecompilationArgs[] = { + "--precompilation", +}; + +static const char* kDartWriteProtectCodeArgs[] FXL_ALLOW_UNUSED_TYPE = { + "--no_write_protect_code", +}; + +static const char* kDartAssertArgs[] = { + // clang-format off + "--enable_asserts", + // clang-format on +}; + +static const char* kDartCheckedModeArgs[] = { + // clang-format off + "--enable_type_checks", + "--error_on_bad_type", + "--error_on_bad_override", + // clang-format on +}; + +static const char* kDartStrongModeArgs[] = { + // clang-format off + "--limit_ints_to_64_bits", + "--reify_generic_functions", + "--strong", + "--sync_async", + // clang-format on +}; + +static const char* kDartStartPausedArgs[]{ + "--pause_isolates_on_start", +}; + +static const char* kDartTraceStartupArgs[]{ + "--timeline_streams=Compiler,Dart,Embedder,GC", +}; + +static const char* kDartEndlessTraceBufferArgs[]{ + "--timeline_recorder=endless", +}; + +static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { + "--systrace_timeline", + "--timeline_streams=VM,Isolate,Compiler,Dart,GC", +}; + +constexpr char kFileUriPrefix[] = "file://"; +constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; + +static const uint8_t* g_default_isolate_snapshot_data = nullptr; +static const uint8_t* g_default_isolate_snapshot_instructions = nullptr; +static bool g_service_isolate_initialized = false; +static ServiceIsolateHook g_service_isolate_hook = nullptr; +static RegisterNativeServiceProtocolExtensionHook + g_register_native_service_protocol_extensions_hook = nullptr; + +// Kernel representation of core dart libraries(loaded from platform.dill). +// TODO(aam): This (and platform_data below) have to be released when engine +// gets torn down. At that point we could also call Dart_Cleanup to complete +// Dart VM cleanup. +static void* kernel_platform = nullptr; +// Bytes actually read from platform.dill that are referenced by kernel_platform +static std::vector platform_data; + +void IsolateShutdownCallback(void* callback_data) { + if (tonic::DartStickyError::IsSet()) { + tonic::DartApiScope api_scope; + FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) + << " exited with an error"; + Dart_Handle sticky_error = Dart_GetStickyError(); + FXL_CHECK(LogIfError(sticky_error)); + } + + UIDartState* dart_state = static_cast(callback_data); + // If the isolate that's shutting down is the main one, tell the higher layers + // of the stack. + if ((dart_state != NULL) && dart_state->is_controller_state()) { + dart_state->set_shutting_down(true); + if (dart_state->isolate_client()) { + dart_state->isolate_client()->DidShutdownMainIsolate(); + } + } +} + +// The cleanup callback frees the DartState object. +void IsolateCleanupCallback(void* callback_data) { + UIDartState* dart_state = static_cast(callback_data); + delete dart_state; +} + +bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { + if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { + // Assume modified. + return true; + } + + const char* path = source_url + kFileUriPrefixLength; + struct stat info; + if (stat(path, &info) < 0) + return true; + + // If st_mtime is zero, it's more likely that the file system doesn't support + // mtime than that the file was actually modified in the 1970s. + if (!info.st_mtime) + return true; + + // It's very unclear what time bases we're with here. The Dart API doesn't + // document the time base for since_ms. Reading the code, the value varies by + // platform, with a typical source being something like gettimeofday. + // + // We add one to st_mtime because st_mtime has less precision than since_ms + // and we want to treat the file as modified if the since time is between + // ticks of the mtime. + fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); + fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); + + return mtime > since; +} + +void ThreadExitCallback() {} + +bool IsServiceIsolateURL(const char* url_name) { + return url_name != nullptr && + std::string(url_name) == DART_VM_SERVICE_ISOLATE_NAME; +} + +static bool StringEndsWith(const std::string& string, + const std::string& ending) { + if (ending.size() > string.size()) + return false; + + return string.compare(string.size() - ending.size(), ending.size(), ending) == + 0; +} + +static void ReleaseFetchedBytes(uint8_t* buffer) { + free(buffer); +} + +Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, + Dart_IsolateFlags* flags, + char** error) { +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE + // No VM-service in release mode. + return nullptr; +#else // FLUTTER_RUNTIME_MODE + UIDartState* dart_state = new UIDartState(nullptr, nullptr); + + bool is_running_from_kernel = GetKernelPlatformBinary() != nullptr; + + flags->load_vmservice_library = true; + Dart_Isolate isolate = + is_running_from_kernel + ? Dart_CreateIsolateFromKernel( + script_uri, "main", kernel_platform, flags, + static_cast(dart_state), error) + : Dart_CreateIsolate( + script_uri, "main", g_default_isolate_snapshot_data, + g_default_isolate_snapshot_instructions, flags, + static_cast(dart_state), error); + + FXL_CHECK(isolate) << error; + dart_state->set_debug_name_prefix(script_uri); + dart_state->SetIsolate(isolate); + FXL_CHECK(Dart_IsServiceIsolate(isolate)); + FXL_CHECK(!LogIfError( + Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); + { + tonic::DartApiScope dart_api_scope; + DartIO::InitForIsolate(); + DartUI::InitForIsolate(); + DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); + const Settings& settings = Settings::Get(); + if (settings.enable_observatory) { + std::string ip = settings.ipv6 ? "::1" : "127.0.0.1"; + const intptr_t port = settings.observatory_port; + const bool disable_websocket_origin_check = false; + const bool service_isolate_booted = DartServiceIsolate::Startup( + ip, port, tonic::DartState::HandleLibraryTag, + !IsRunningPrecompiledCode() && !is_running_from_kernel, + disable_websocket_origin_check, error); + FXL_CHECK(service_isolate_booted) << error; + } + + if (g_service_isolate_hook) + g_service_isolate_hook(IsRunningPrecompiledCode()); + } + Dart_ExitIsolate(); + + g_service_isolate_initialized = true; + // Register any native service protocol extensions. + if (g_register_native_service_protocol_extensions_hook) { + g_register_native_service_protocol_extensions_hook( + IsRunningPrecompiledCode()); + } + return isolate; +#endif // FLUTTER_RUNTIME_MODE +} + +static bool GetAssetAsBuffer( + const std::string& name, + std::vector* data, + fxl::RefPtr& directory_asset_bundle, + fxl::RefPtr& asset_store) { + return (directory_asset_bundle && + directory_asset_bundle->GetAsBuffer(name, data)) || + (asset_store && asset_store->GetAsBuffer(name, data)); +} + +Dart_Isolate IsolateCreateCallback(const char* script_uri, + const char* main, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + void* callback_data, + char** error) { + TRACE_EVENT0("flutter", __func__); + + if (IsServiceIsolateURL(script_uri)) { + return ServiceIsolateCreateCallback(script_uri, flags, error); + } + + std::string entry_uri = script_uri; + // Are we running from a Dart source file? + const bool running_from_source = StringEndsWith(entry_uri, ".dart"); + + std::vector kernel_data; + std::vector snapshot_data; + std::string entry_path; + if (!IsRunningPrecompiledCode()) { + // Check that the entry script URI starts with file:// + if (entry_uri.find(kFileUriPrefix) != 0u) { + *error = strdup("Isolates must use file:// URIs"); + return nullptr; + } + // Entry script path (file:// is stripped). + entry_path = std::string(script_uri + strlen(kFileUriPrefix)); + if (StringEndsWith(entry_path, ".dill")) { + // Load the kernel from the script URI. + if (!files::ReadFileToVector(entry_path, &kernel_data)) { + FXL_LOG(ERROR) << "Failed to load kernel"; + } + } else if (!running_from_source) { + // Attempt to copy the snapshot or kernel from the asset bundle. + const std::string& bundle_path = entry_path; + + struct stat stat_result = {}; + if (::stat(bundle_path.c_str(), &stat_result) == 0) { + fxl::RefPtr directory_asset_bundle; + // TODO(zarah): Remove usage of zip_asset_store once app.flx is removed. + fxl::RefPtr zip_asset_store; + // bundle_path is either the path to app.flx or the flutter assets + // directory. + std::string flx_path = bundle_path; + if (S_ISDIR(stat_result.st_mode)) { + directory_asset_bundle = + fxl::MakeRefCounted(bundle_path); + flx_path = files::GetDirectoryName(bundle_path) + "/app.flx"; + } + + if (access(flx_path.c_str(), R_OK) == 0) { + zip_asset_store = fxl::MakeRefCounted( + GetUnzipperProviderForPath(flx_path)); + } + GetAssetAsBuffer(kKernelAssetKey, &kernel_data, directory_asset_bundle, + zip_asset_store); + GetAssetAsBuffer(kSnapshotAssetKey, &snapshot_data, + directory_asset_bundle, zip_asset_store); + } + } + } + + UIDartState* parent_dart_state = static_cast(callback_data); + UIDartState* dart_state = parent_dart_state->CreateForChildIsolate(); + + Dart_Isolate isolate = + kernel_platform != nullptr + ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_platform, + nullptr /* flags */, dart_state, error) + : Dart_CreateIsolate(script_uri, main, + g_default_isolate_snapshot_data, + g_default_isolate_snapshot_instructions, nullptr, + dart_state, error); + FXL_CHECK(isolate) << error; + dart_state->set_debug_name_prefix(script_uri); + dart_state->SetIsolate(isolate); + FXL_CHECK(!LogIfError( + Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); + + { + tonic::DartApiScope dart_api_scope; + DartIO::InitForIsolate(); + DartUI::InitForIsolate(); + DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); + + std::unique_ptr ui_class_provider( + new DartClassProvider(dart_state, "dart:ui")); + dart_state->class_library().add_provider("ui", + std::move(ui_class_provider)); + + if (!kernel_data.empty()) { + // We are running kernel code. + FXL_CHECK(!LogIfError(Dart_LoadScriptFromKernel(kernel_data.data(), + kernel_data.size()))); + } else if (!snapshot_data.empty()) { + // We are running from a script snapshot. + FXL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(), + snapshot_data.size()))); + } else if (running_from_source) { + // We are running from source. + // Forward the .packages configuration from the parent isolate to the + // child isolate. + tonic::FileLoader& parent_loader = parent_dart_state->file_loader(); + const std::string& packages = parent_loader.packages(); + tonic::FileLoader& loader = dart_state->file_loader(); + if (!packages.empty() && !loader.LoadPackagesMap(packages)) { + FXL_LOG(WARNING) << "Failed to load package map: " << packages; + } + // Load the script. + FXL_CHECK(!LogIfError(loader.LoadScript(entry_path))); + } + + dart_state->isolate_client()->DidCreateSecondaryIsolate(isolate); + } + + Dart_ExitIsolate(); + + FXL_CHECK(Dart_IsolateMakeRunnable(isolate)); + return isolate; +} + +Dart_Handle GetVMServiceAssetsArchiveCallback() { +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE + return nullptr; +#elif OS(FUCHSIA) + std::vector observatory_assets_archive; + if (!files::ReadFileToVector("pkg/data/observatory.tar", + &observatory_assets_archive)) { + FXL_LOG(ERROR) << "Fail to load Observatory archive"; + return nullptr; + } + return tonic::DartConverter::ToDart( + observatory_assets_archive.data(), + observatory_assets_archive.size()); +#else + return tonic::DartConverter::ToDart( + ::dart::observatory::observatory_assets_archive, + ::dart::observatory::observatory_assets_archive_len); +#endif +} + +static const char kStdoutStreamId[] = "Stdout"; +static const char kStderrStreamId[] = "Stderr"; + +static bool ServiceStreamListenCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(true); + return true; + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(true); + return true; + } + return false; +} + +static void ServiceStreamCancelCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(false); + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(false); + } +} + +} // namespace + +bool IsRunningPrecompiledCode() { + return Dart_IsPrecompiledRuntime(); +} + +EmbedderTracingCallbacks* g_tracing_callbacks = nullptr; + +EmbedderTracingCallbacks::EmbedderTracingCallbacks( + EmbedderTracingCallback start, + EmbedderTracingCallback stop) + : start_tracing_callback(start), stop_tracing_callback(stop) {} + +void SetEmbedderTracingCallbacks( + std::unique_ptr callbacks) { + g_tracing_callbacks = callbacks.release(); +} + +static void EmbedderTimelineStartRecording() { + if (g_tracing_callbacks) + g_tracing_callbacks->start_tracing_callback(); +} + +static void EmbedderTimelineStopRecording() { + if (g_tracing_callbacks) + g_tracing_callbacks->stop_tracing_callback(); +} + +static std::vector ProfilingFlags(bool enable_profiling) { +// Disable Dart's built in profiler when building a debug build. This +// works around a race condition that would sometimes stop a crash's +// stack trace from being printed on Android. +#ifndef NDEBUG + enable_profiling = false; +#endif + + // We want to disable profiling by default because it overwhelms LLDB. But + // the VM enables the same by default. In either case, we have some profiling + // flags. + if (enable_profiling) { + return { + // This is the default. But just be explicit. + "--profiler", + // This instructs the profiler to walk C++ frames, and to include + // them in the profile. + "--profile-vm"}; + } else { + return {"--no-profiler"}; + } +} + +void SetServiceIsolateHook(ServiceIsolateHook hook) { + FXL_CHECK(!g_service_isolate_initialized); + g_service_isolate_hook = hook; +} + +void SetRegisterNativeServiceProtocolExtensionHook( + RegisterNativeServiceProtocolExtensionHook hook) { + FXL_CHECK(!g_service_isolate_initialized); + g_register_native_service_protocol_extensions_hook = hook; +} + +void PushBackAll(std::vector* args, + const char** argv, + size_t argc) { + for (size_t i = 0; i < argc; ++i) { + args->push_back(argv[i]); + } +} + +static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { + info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; + dart::bin::GetIOEmbedderInformation(info); + info->name = "Flutter"; +} + +void* GetKernelPlatformBinary() { + return kernel_platform; +} + +void InitDartVM(const uint8_t* vm_snapshot_data, + const uint8_t* vm_snapshot_instructions, + const uint8_t* default_isolate_snapshot_data, + const uint8_t* default_isolate_snapshot_instructions, + const std::string& bundle_path) { + TRACE_EVENT0("flutter", __func__); + + g_default_isolate_snapshot_data = default_isolate_snapshot_data; + g_default_isolate_snapshot_instructions = + default_isolate_snapshot_instructions; + + const Settings& settings = Settings::Get(); + + { + TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); + dart::bin::BootstrapDartIo(); + + if (!settings.temp_directory_path.empty()) { + dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); + } + } + + std::vector args; + + // Instruct the VM to ignore unrecognized flags. + // There is a lot of diversity in a lot of combinations when it + // comes to the arguments the VM supports. And, if the VM comes across a flag + // it does not recognize, it exits immediately. + args.push_back("--ignore-unrecognized-flags"); + + for (const auto& profiler_flag : + ProfilingFlags(settings.enable_dart_profiling)) { + args.push_back(profiler_flag); + } + + PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); + + if (IsRunningPrecompiledCode()) { + PushBackAll(&args, kDartPrecompilationArgs, + arraysize(kDartPrecompilationArgs)); + } + +#if defined(OS_FUCHSIA) +#if defined(NDEBUG) + // Do not enable checked mode for Fuchsia release builds + // TODO(mikejurka): remove this once precompiled code is working on Fuchsia + const bool use_checked_mode = false; +#else // !defined(NDEBUG) + const bool use_checked_mode = true; +#endif // !defined(NDEBUG) +#else // !defined(OS_FUCHSIA) + // Enable checked mode if we are not running precompiled code. We run non- + // precompiled code only in the debug product mode. + const bool use_checked_mode = + !IsRunningPrecompiledCode() && !settings.dart_non_checked_mode; +#endif // !defined(OS_FUCHSIA) + +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + // Debug mode uses the JIT, disable code page write protection to avoid + // memory page protection changes before and after every compilation. + PushBackAll(&args, kDartWriteProtectCodeArgs, + arraysize(kDartWriteProtectCodeArgs)); +#endif + + if (settings.start_paused) + PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); + + if (settings.endless_trace_buffer || settings.trace_startup) { + // If we are tracing startup, make sure the trace buffer is endless so we + // don't lose early traces. + PushBackAll(&args, kDartEndlessTraceBufferArgs, + arraysize(kDartEndlessTraceBufferArgs)); + } + + if (settings.trace_startup) { + PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); + } + +#if defined(OS_FUCHSIA) + PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); +#endif + + if (!bundle_path.empty()) { + fxl::RefPtr directory_asset_bundle = + fxl::MakeRefCounted( + std::move(bundle_path)); + directory_asset_bundle->GetAsBuffer(kPlatformKernelAssetKey, + &platform_data); + if (!platform_data.empty()) { + uint8_t* kernel_buf = static_cast(malloc(platform_data.size())); + memcpy(kernel_buf, platform_data.data(), platform_data.size()); + kernel_platform = Dart_ReadKernelBinary(kernel_buf, platform_data.size(), + ReleaseFetchedBytes); + FXL_DCHECK(kernel_platform != nullptr); + } + } + if ((kernel_platform != nullptr) || + Dart_IsDart2Snapshot(g_default_isolate_snapshot_data)) { + // The presence of the kernel platform file or a snapshot that was generated + // for Dart2 indicates we are running in preview-dart-2 mode and in this + // mode enable strong mode options by default. + // Note: When we start using core snapshots instead of the platform file + // in the engine just sniffing the snapshot file should be sufficient. + PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); + // In addition if we are running in debug mode we also enable asserts. + if (use_checked_mode) { + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + } + } else if (use_checked_mode) { + // In non preview-dart-2 mode we enable checked mode and asserts if + // we are running in debug mode. + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); + } + + for (size_t i = 0; i < settings.dart_flags.size(); i++) + args.push_back(settings.dart_flags[i].c_str()); + + FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); + + DartUI::InitForGlobal(); + + // Setup embedder tracing hooks. To avoid data races, it is recommended that + // these hooks be installed before the DartInitialize, so do that setup now. + Dart_SetEmbedderTimelineCallbacks(&EmbedderTimelineStartRecording, + &EmbedderTimelineStopRecording); + + Dart_SetFileModifiedCallback(&DartFileModifiedCallback); + + { + TRACE_EVENT0("flutter", "Dart_Initialize"); + Dart_InitializeParams params = {}; + params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; + params.vm_snapshot_data = vm_snapshot_data; + params.vm_snapshot_instructions = vm_snapshot_instructions; + params.create = IsolateCreateCallback; + params.shutdown = IsolateShutdownCallback; + params.cleanup = IsolateCleanupCallback; + params.thread_exit = ThreadExitCallback; + params.get_service_assets = GetVMServiceAssetsArchiveCallback; + params.entropy_source = DartIO::EntropySource; + char* init_error = Dart_Initialize(¶ms); + if (init_error != nullptr) + FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; + free(init_error); + + // Send the earliest available timestamp in the application lifecycle to + // timeline. The difference between this timestamp and the time we render + // the very first frame gives us a good idea about Flutter's startup time. + // Use a duration event so about:tracing will consider this event when + // deciding the earliest event to use as time 0. + if (blink::engine_main_enter_ts != 0) { + Dart_TimelineEvent("FlutterEngineMainEnter", // label + blink::engine_main_enter_ts, // timestamp0 + blink::engine_main_enter_ts, // timestamp1_or_async_id + Dart_Timeline_Event_Duration, // event type + 0, // argument_count + nullptr, // argument_names + nullptr // argument_values + ); + } + } + + // Allow streaming of stdout and stderr by the Dart vm. + Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, + &ServiceStreamCancelCallback); + + Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); +} + +} // namespace blink diff --git a/runtime/dart_init.h b/runtime/dart_init.h new file mode 100644 index 0000000000000..99c8fe89137e3 --- /dev/null +++ b/runtime/dart_init.h @@ -0,0 +1,64 @@ +// Copyright 2015 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. + +#ifndef FLUTTER_RUNTIME_DART_INIT_H_ +#define FLUTTER_RUNTIME_DART_INIT_H_ + +#include "lib/fxl/build_config.h" +#include "lib/fxl/functional/closure.h" +#include "third_party/dart/runtime/include/dart_api.h" + +#include +#include +#include + +namespace blink { + +// Name of the kernel blob asset within the asset directory. +extern const char kKernelAssetKey[]; + +// Name of the snapshot blob asset within the asset directory. +extern const char kSnapshotAssetKey[]; + +// Name of the platform kernel blob asset within the asset directory. +extern const char kPlatformKernelAssetKey[]; + +bool IsRunningPrecompiledCode(); + +using EmbedderTracingCallback = fxl::Closure; + +typedef void (*ServiceIsolateHook)(bool); +typedef void (*RegisterNativeServiceProtocolExtensionHook)(bool); + +struct EmbedderTracingCallbacks { + EmbedderTracingCallback start_tracing_callback; + EmbedderTracingCallback stop_tracing_callback; + + EmbedderTracingCallbacks(EmbedderTracingCallback start, + EmbedderTracingCallback stop); +}; + +void InitDartVM(const uint8_t* vm_snapshot_data, + const uint8_t* vm_snapshot_instructions, + const uint8_t* default_isolate_snapshot_data, + const uint8_t* default_isolate_snapshot_instructions, + const std::string& bundle_path); + +void* GetKernelPlatformBinary(); + +void SetEmbedderTracingCallbacks( + std::unique_ptr callbacks); + +// Provide a function that will be called during initialization of the +// service isolate. +void SetServiceIsolateHook(ServiceIsolateHook hook); + +// Provide a function that will be called to register native service protocol +// extensions. +void SetRegisterNativeServiceProtocolExtensionHook( + RegisterNativeServiceProtocolExtensionHook hook); + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_INIT_H_ diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc deleted file mode 100644 index c5fd770b1b40c..0000000000000 --- a/runtime/dart_isolate.cc +++ /dev/null @@ -1,715 +0,0 @@ -// Copyright 2017 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/runtime/dart_isolate.h" - -#include -#include - -#include "flutter/fml/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/runtime/dart_vm.h" -#include "lib/fxl/files/path.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_class_provider.h" -#include "lib/tonic/dart_message_handler.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/dart_sticky_error.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace blink { - -fml::WeakPtr DartIsolate::CreateRootIsolate( - const DartVM* vm, - fxl::RefPtr isolate_snapshot, - TaskRunners task_runners, - std::unique_ptr window, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint, - Dart_IsolateFlags* flags) { - TRACE_EVENT0("flutter", "DartIsolate::CreateRootIsolate"); - Dart_Isolate vm_isolate = nullptr; - fml::WeakPtr embedder_isolate; - - char* error = nullptr; - - // Since this is the root isolate, we fake a parent embedder data object. We - // cannot use unique_ptr here because the destructor is private (since the - // isolate lifecycle is entirely managed by the VM). - auto root_embedder_data = std::make_unique( - vm, // VM - std::move(isolate_snapshot), // isolate snapshot - task_runners, // task runners - std::move(resource_context), // resource context - std::move(unref_queue), // skia unref queue - advisory_script_uri, // advisory URI - advisory_script_entrypoint // advisory entrypoint - ); - - std::tie(vm_isolate, embedder_isolate) = CreateDartVMAndEmbedderObjectPair( - advisory_script_uri.c_str(), // advisory script URI - advisory_script_entrypoint.c_str(), // advisory script entrypoint - nullptr, // package root - nullptr, // package config - flags, // flags - root_embedder_data.get(), // parent embedder data - true, // is root isolate - &error // error (out) - ); - - if (error != nullptr) { - free(error); - } - - if (vm_isolate == nullptr) { - return {}; - } - - if (embedder_isolate) { - // Only root isolates can interact with windows. - embedder_isolate->SetWindow(std::move(window)); - embedder_isolate->set_use_blink(vm->GetSettings().using_blink); - } - - return embedder_isolate; -} - -DartIsolate::DartIsolate(const DartVM* vm, - fxl::RefPtr isolate_snapshot, - TaskRunners task_runners, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint) - : UIDartState(std::move(task_runners), - vm->GetSettings().task_observer_add, - vm->GetSettings().task_observer_remove, - std::move(resource_context), - std::move(unref_queue), - advisory_script_uri, - advisory_script_entrypoint, - vm->GetSettings().log_tag), - vm_(vm), - isolate_snapshot_(std::move(isolate_snapshot)), - weak_factory_(this) { - FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; - weak_prototype_ = weak_factory_.GetWeakPtr(); - - if (vm_ == nullptr) { - return; - } - - phase_ = Phase::Uninitialized; -} - -DartIsolate::~DartIsolate() = default; - -DartIsolate::Phase DartIsolate::GetPhase() const { - return phase_; -} - -const DartVM* DartIsolate::GetDartVM() const { - return vm_; -} - -bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { - TRACE_EVENT0("flutter", "DartIsolate::Initialize"); - if (phase_ != Phase::Uninitialized) { - return false; - } - - if (dart_isolate == nullptr) { - return false; - } - - if (Dart_CurrentIsolate() != dart_isolate) { - return false; - } - - if (Dart_IsolateData(dart_isolate) != this) { - return false; - } - - // After this point, isolate scopes can be safely used. - SetIsolate(dart_isolate); - - // We are entering a new scope (for the first time since initialization) and - // we want to restore the current scope to null when we exit out of this - // method. This balances the implicit Dart_EnterIsolate call made by - // Dart_CreateIsolate (which calls the Initialize). - Dart_ExitIsolate(); - - tonic::DartIsolateScope scope(isolate()); - - if (is_root_isolate) { - if (auto task_runner = GetTaskRunners().GetUITaskRunner()) { - // Isolates may not have any particular thread affinity. Only initialize - // the message handler if a task runner is explicitly specified. - message_handler().Initialize(task_runner); - } - } - - if (tonic::LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))) { - return false; - } - - if (!UpdateThreadPoolNames()) { - return false; - } - - phase_ = Phase::Initialized; - return true; -} - -// Updating thread names here does not change the underlying OS thread names. -// Instead, this is just additional metadata for the Observatory to show the -// thread name of the isolate. -bool DartIsolate::UpdateThreadPoolNames() const { - // TODO(chinmaygarde): This implementation does not account for multiple - // shells sharing the same (or subset of) threads. - const auto& task_runners = GetTaskRunners(); - - if (auto task_runner = task_runners.GetGPUTaskRunner()) { - task_runner->PostTask( - [label = task_runners.GetLabel() + std::string{".gpu"}]() { - Dart_SetThreadName(label.c_str()); - }); - } - - if (auto task_runner = task_runners.GetUITaskRunner()) { - task_runner->PostTask( - [label = task_runners.GetLabel() + std::string{".ui"}]() { - Dart_SetThreadName(label.c_str()); - }); - } - - if (auto task_runner = task_runners.GetIOTaskRunner()) { - task_runner->PostTask( - [label = task_runners.GetLabel() + std::string{".io"}]() { - Dart_SetThreadName(label.c_str()); - }); - } - - if (auto task_runner = task_runners.GetPlatformTaskRunner()) { - task_runner->PostTask( - [label = task_runners.GetLabel() + std::string{".platform"}]() { - Dart_SetThreadName(label.c_str()); - }); - } - - return true; -} - -bool DartIsolate::LoadLibraries() { - TRACE_EVENT0("flutter", "DartIsolate::LoadLibraries"); - if (phase_ != Phase::Initialized) { - return false; - } - - tonic::DartState::Scope scope(this); - - DartIO::InitForIsolate(); - - DartUI::InitForIsolate(); - - const bool is_service_isolate = Dart_IsServiceIsolate(isolate()); - - DartRuntimeHooks::Install(is_service_isolate - ? DartRuntimeHooks::SecondaryIsolate - : DartRuntimeHooks::MainIsolate, - GetAdvisoryScriptURI()); - - if (!is_service_isolate) { - class_library().add_provider( - "ui", std::make_unique(this, "dart:ui")); - } - - phase_ = Phase::LibrariesSetup; - return true; -} - -bool DartIsolate::PrepareForRunningFromPrecompiledCode() { - TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromPrecompiledCode"); - if (phase_ != Phase::LibrariesSetup) { - return false; - } - - if (!DartVM::IsRunningPrecompiledCode()) { - return false; - } - - tonic::DartState::Scope scope(this); - - if (Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - if (!MarkIsolateRunnable()) { - return false; - } - - phase_ = Phase::Ready; - return true; -} - -static bool LoadScriptSnapshot(std::unique_ptr mapping) { - if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), - mapping->GetSize()))) { - return false; - } - return true; -} - -static bool LoadKernelSnapshot(std::unique_ptr mapping) { - if (tonic::LogIfError(Dart_LoadScriptFromKernel(mapping->GetMapping(), - mapping->GetSize()))) { - return false; - } - - return true; -} - -static bool LoadSnapshot(std::unique_ptr mapping, - bool is_kernel) { - if (is_kernel) { - return LoadKernelSnapshot(std::move(mapping)); - } else { - return LoadScriptSnapshot(std::move(mapping)); - } - return false; -} - -FXL_WARN_UNUSED_RESULT -bool DartIsolate::PrepareForRunningFromSnapshot( - std::unique_ptr mapping) { - TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSnapshot"); - if (phase_ != Phase::LibrariesSetup) { - return false; - } - - if (DartVM::IsRunningPrecompiledCode()) { - return false; - } - - if (!mapping || mapping->GetSize() == 0) { - return false; - } - - tonic::DartState::Scope scope(this); - - if (!Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - if (!LoadSnapshot(std::move(mapping), vm_->GetPlatformKernel() != nullptr)) { - return false; - } - - if (Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - if (!MarkIsolateRunnable()) { - return false; - } - - phase_ = Phase::Ready; - return true; -} - -static bool FileNameIsDill(const std::string& name) { - const std::string suffix = ".dill"; - - if (name.size() < suffix.size()) { - return false; - } - - if (name.rfind(suffix, name.size()) == name.size() - suffix.size()) { - return true; - } - return false; -} - -bool DartIsolate::PrepareForRunningFromSource( - const std::string& main_source_file, - const std::string& packages) { - TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSource"); - if (phase_ != Phase::LibrariesSetup) { - return false; - } - - if (DartVM::IsRunningPrecompiledCode()) { - return false; - } - - if (main_source_file.empty()) { - return false; - } - - tonic::DartState::Scope scope(this); - - if (!Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - auto& loader = file_loader(); - - if (!packages.empty()) { - auto packages_absolute_path = files::AbsolutePath(packages); - FXL_DLOG(INFO) << "Loading from packages: " << packages_absolute_path; - if (!loader.LoadPackagesMap(packages_absolute_path)) { - return false; - } - } - - auto main_source_absolute_path = files::AbsolutePath(main_source_file); - FXL_DLOG(INFO) << "Loading from source: " << main_source_absolute_path; - - // The "source" file may be a ".dill" file. - if (FileNameIsDill(main_source_absolute_path)) { - auto mapping = - std::make_unique(main_source_absolute_path, false); - if (mapping == nullptr) { - return false; - } - if (!LoadKernelSnapshot(std::move(mapping))) { - return false; - } - } else { - if (tonic::LogIfError(loader.LoadScript(main_source_absolute_path))) { - return false; - } - } - - if (Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - if (!MarkIsolateRunnable()) { - return false; - } - - phase_ = Phase::Ready; - return true; -} - -bool DartIsolate::MarkIsolateRunnable() { - TRACE_EVENT0("flutter", "DartIsolate::MarkIsolateRunnable"); - if (phase_ != Phase::LibrariesSetup) { - return false; - } - - // This function may only be called from an active isolate scope. - if (Dart_CurrentIsolate() != isolate()) { - return false; - } - - // There must be no current isolate to mark an isolate as being runnable. - Dart_ExitIsolate(); - - if (!Dart_IsolateMakeRunnable(isolate())) { - // Failed. Restore the isolate. - Dart_EnterIsolate(isolate()); - return false; - } - // Success. Restore the isolate. - Dart_EnterIsolate(isolate()); - return true; -} - -FXL_WARN_UNUSED_RESULT -bool DartIsolate::Run(const std::string& entrypoint_name) { - TRACE_EVENT0("flutter", "DartIsolate::Run"); - if (phase_ != Phase::Ready) { - return false; - } - - tonic::DartState::Scope scope(this); - - Dart_Handle entrypoint = Dart_GetClosure( - Dart_RootLibrary(), tonic::ToDart(entrypoint_name.c_str())); - if (tonic::LogIfError(entrypoint)) { - return false; - } - - Dart_Handle isolate_lib = Dart_LookupLibrary(tonic::ToDart("dart:isolate")); - if (tonic::LogIfError(isolate_lib)) { - return false; - } - - Dart_Handle isolate_args[] = { - entrypoint, - Dart_Null(), - }; - - if (tonic::LogIfError(Dart_Invoke( - isolate_lib, tonic::ToDart("_startMainIsolate"), - sizeof(isolate_args) / sizeof(isolate_args[0]), isolate_args))) { - return false; - } - - phase_ = Phase::Running; - return true; -} - -bool DartIsolate::Shutdown() { - TRACE_EVENT0("flutter", "DartIsolate::Shutdown"); - // This call may be re-entrant since Dart_ShutdownIsolate can invoke the - // cleanup callback which deletes the embedder side object of the dart isolate - // (a.k.a. this). - if (phase_ == Phase::Shutdown) { - return false; - } - phase_ = Phase::Shutdown; - Dart_Isolate vm_isolate = isolate(); - // The isolate can be nullptr if this instance is the stub isolate data used - // during root isolate creation. - if (vm_isolate != nullptr) { - // We need to enter the isolate because Dart_ShutdownIsolate does not take - // the isolate to shutdown as a parameter. - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - Dart_EnterIsolate(vm_isolate); - Dart_ShutdownIsolate(); - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - } - return true; -} - -static Dart_Isolate DartCreateAndStartServiceIsolate( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - char** error) { - auto vm = DartVM::ForProcessIfInitialized(); - - if (!vm) { - *error = strdup( - "Could not resolve the VM when attempting to create the service " - "isolate."); - return nullptr; - } - - const auto& settings = vm->GetSettings(); - - if (!settings.enable_observatory) { - FXL_DLOG(INFO) << "Observatory is disabled."; - return nullptr; - } - - blink::TaskRunners null_task_runners( - "io.flutter." DART_VM_SERVICE_ISOLATE_NAME, nullptr, nullptr, nullptr, - nullptr); - - flags->load_vmservice_library = true; - - auto service_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - null_task_runners, // task runners - nullptr, // window - {}, // resource context - {}, // unref queue - advisory_script_uri == nullptr ? "" : advisory_script_uri, // script uri - advisory_script_entrypoint == nullptr - ? "" - : advisory_script_entrypoint, // script entrypoint - flags // flags - ); - - if (!service_isolate) { - *error = strdup("Could not create the service isolate."); - FXL_DLOG(ERROR) << *error; - return nullptr; - } - - // The engine never holds a strong reference to the VM service isolate. Since - // we are about to lose our last weak reference to it, start the VM service - // while we have this reference. - - const bool running_from_sources = - !DartVM::IsRunningPrecompiledCode() && vm->GetPlatformKernel() == nullptr; - - tonic::DartState::Scope scope(service_isolate.get()); - if (!DartServiceIsolate::Startup( - settings.ipv6 ? "::1" : "127.0.0.1", // server IP address - settings.observatory_port, // server observatory port - tonic::DartState::HandleLibraryTag, // embedder library tag handler - running_from_sources, // running from source code - false, // disable websocket origin check - error // error (out) - )) { - // Error is populated by call to startup. - FXL_DLOG(ERROR) << *error; - return nullptr; - } - - vm->GetServiceProtocol().ToggleHooks(true); - - return service_isolate->isolate(); -} - -// |Dart_IsolateCreateCallback| -Dart_Isolate DartIsolate::DartIsolateCreateCallback( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - DartIsolate* parent_embedder_isolate, - char** error) { - if (parent_embedder_isolate == nullptr && - strcmp(advisory_script_uri, DART_VM_SERVICE_ISOLATE_NAME) == 0) { - // The VM attempts to start the VM service for us on |Dart_Initialize|. In - // such a case, the callback data will be null and the script URI will be - // DART_VM_SERVICE_ISOLATE_NAME. In such cases, we just create the service - // isolate like normal but dont hold a reference to it at all. We also start - // this isolate since we will never again reference it from the engine. - return DartCreateAndStartServiceIsolate(advisory_script_uri, // - advisory_script_entrypoint, // - package_root, // - package_config, // - flags, // - error // - ); - } - - return CreateDartVMAndEmbedderObjectPair( - advisory_script_uri, // URI - advisory_script_entrypoint, // entrypoint - package_root, // package root - package_config, // package config - flags, // isolate flags - parent_embedder_isolate, // embedder data - false, // is root isolate - error // error - ) - .first; -} - -std::pair> -DartIsolate::CreateDartVMAndEmbedderObjectPair( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - DartIsolate* parent_embedder_isolate, - bool is_root_isolate, - char** error) { - TRACE_EVENT0("flutter", "DartIsolate::CreateDartVMAndEmbedderObjectPair"); - if (parent_embedder_isolate == nullptr || - parent_embedder_isolate->GetDartVM() == nullptr) { - *error = - strdup("Parent isolate did not have embedder specific callback data."); - FXL_DLOG(ERROR) << *error; - return {nullptr, {}}; - } - - const DartVM* vm = parent_embedder_isolate->GetDartVM(); - - // Create the native object on the embedder side. This object is deleted in - // the cleanup callback. - auto embedder_isolate = std::make_unique( - vm, // - parent_embedder_isolate->GetIsolateSnapshot(), // - parent_embedder_isolate->GetTaskRunners(), // - parent_embedder_isolate->GetResourceContext(), // - parent_embedder_isolate->GetSkiaUnrefQueue(), // - advisory_script_uri, // - advisory_script_entrypoint // - ); - - // Create the Dart VM isolate and give it the embedder object as the baton. - Dart_Isolate isolate = - vm->GetPlatformKernel() != nullptr - ? Dart_CreateIsolateFromKernel(advisory_script_uri, // - advisory_script_entrypoint, // - vm->GetPlatformKernel(), // - flags, // - embedder_isolate.get(), // - error // - ) - : Dart_CreateIsolate(advisory_script_uri, // - advisory_script_entrypoint, // - embedder_isolate->GetIsolateSnapshot() - ->GetData() - ->GetSnapshotPointer(), // - embedder_isolate->GetIsolateSnapshot() - ->GetInstructionsIfPresent(), // - flags, // - embedder_isolate.get(), // - error // - ); - - if (isolate == nullptr) { - FXL_DLOG(ERROR) << *error; - return {nullptr, {}}; - } - - if (!embedder_isolate->Initialize(isolate, is_root_isolate)) { - *error = strdup("Embedder could not initialize the Dart isolate."); - FXL_DLOG(ERROR) << *error; - return {nullptr, {}}; - } - - if (!embedder_isolate->LoadLibraries()) { - *error = - strdup("Embedder could not load libraries in the new Dart isolate."); - FXL_DLOG(ERROR) << *error; - return {nullptr, {}}; - } - - // The ownership of the embedder object is controlled by the Dart VM. So the - // only reference returned to the caller is weak. - return {isolate, embedder_isolate.release()->GetWeakIsolatePtr()}; -} - -// |Dart_IsolateShutdownCallback| -void DartIsolate::DartIsolateShutdownCallback(DartIsolate* embedder_isolate) { - if (!tonic::DartStickyError::IsSet()) { - return; - } - - tonic::DartApiScope api_scope; - FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) - << " exited with an error"; - Dart_Handle sticky_error = Dart_GetStickyError(); - FXL_CHECK(tonic::LogIfError(sticky_error)); -} - -// |Dart_IsolateCleanupCallback| -void DartIsolate::DartIsolateCleanupCallback(DartIsolate* embedder_isolate) { - delete embedder_isolate; -} - -fxl::RefPtr DartIsolate::GetIsolateSnapshot() const { - return isolate_snapshot_; -} - -fml::WeakPtr DartIsolate::GetWeakIsolatePtr() const { - return weak_prototype_; -} - -void DartIsolate::AddIsolateShutdownCallback(fxl::Closure closure) { - shutdown_callbacks_.emplace_back( - std::make_unique(std::move(closure))); -} - -} // namespace blink diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h deleted file mode 100644 index 13d573ebe333f..0000000000000 --- a/runtime/dart_isolate.h +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2017 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_RUNTIME_DART_ISOLATE_H_ -#define FLUTTER_RUNTIME_DART_ISOLATE_H_ - -#include -#include - -#include "flutter/common/task_runners.h" -#include "flutter/fml/mapping.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_snapshot.h" -#include "lib/fxl/compiler_specific.h" -#include "lib/fxl/macros.h" -#include "lib/tonic/dart_state.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace blink { -class DartVM; - -class DartIsolate : public UIDartState { - public: - enum class Phase { - Unknown, - Uninitialized, - Initialized, - LibrariesSetup, - Ready, - Running, - Shutdown, - }; - - // The root isolate of a Flutter application is special because it gets Window - // bindings. From the VM's perspective, this isolate is not special in any - // way. - static fml::WeakPtr CreateRootIsolate( - const DartVM* vm, - fxl::RefPtr isolate_snapshot, - TaskRunners task_runners, - std::unique_ptr window, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - std::string advisory_script_uri = "main.dart", - std::string advisory_script_entrypoint = "main", - Dart_IsolateFlags* flags = nullptr); - - DartIsolate(const DartVM* vm, - fxl::RefPtr isolate_snapshot, - TaskRunners task_runners, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint); - - ~DartIsolate() override; - - Phase GetPhase() const; - - FXL_WARN_UNUSED_RESULT - bool PrepareForRunningFromPrecompiledCode(); - - FXL_WARN_UNUSED_RESULT - bool PrepareForRunningFromSnapshot(std::unique_ptr snapshot); - - FXL_WARN_UNUSED_RESULT - bool PrepareForRunningFromSource(const std::string& main_source_file, - const std::string& packages); - - FXL_WARN_UNUSED_RESULT - bool Run(const std::string& entrypoint); - - FXL_WARN_UNUSED_RESULT - bool Shutdown(); - - void AddIsolateShutdownCallback(fxl::Closure closure); - - const DartVM* GetDartVM() const; - - fxl::RefPtr GetIsolateSnapshot() const; - - fml::WeakPtr GetWeakIsolatePtr() const; - - private: - class AutoFireClosure { - public: - AutoFireClosure(fxl::Closure closure) : closure_(std::move(closure)) {} - ~AutoFireClosure() { - if (closure_) { - closure_(); - } - } - - private: - fxl::Closure closure_; - FXL_DISALLOW_COPY_AND_ASSIGN(AutoFireClosure); - }; - friend class DartVM; - - const DartVM* vm_ = nullptr; - Phase phase_ = Phase::Unknown; - const fxl::RefPtr isolate_snapshot_; - std::vector> shutdown_callbacks_; - fml::WeakPtr weak_prototype_; - fml::WeakPtrFactory weak_factory_; - - FXL_WARN_UNUSED_RESULT - bool Initialize(Dart_Isolate isolate, bool is_root_isolate); - - FXL_WARN_UNUSED_RESULT - bool LoadLibraries(); - - bool UpdateThreadPoolNames() const; - - FXL_WARN_UNUSED_RESULT - bool MarkIsolateRunnable(); - - // |Dart_IsolateCreateCallback| - static Dart_Isolate DartIsolateCreateCallback( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - DartIsolate* embedder_isolate, - char** error); - - static std::pair /* embedder */> - CreateDartVMAndEmbedderObjectPair(const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - DartIsolate* parent_embedder_isolate, - bool is_root_isolate, - char** error); - - // |Dart_IsolateShutdownCallback| - static void DartIsolateShutdownCallback(DartIsolate* embedder_isolate); - - // |Dart_IsolateCleanupCallback| - static void DartIsolateCleanupCallback(DartIsolate* embedder_isolate); - - FXL_DISALLOW_COPY_AND_ASSIGN(DartIsolate); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_ISOLATE_H_ diff --git a/runtime/dart_isolate_unittests.cc b/runtime/dart_isolate_unittests.cc deleted file mode 100644 index d8f2e02382da1..0000000000000 --- a/runtime/dart_isolate_unittests.cc +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2017 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/thread.h" -#include "flutter/runtime/dart_isolate.h" -#include "flutter/runtime/dart_vm.h" -#include "flutter/testing/testing.h" -#include "flutter/testing/thread_test.h" - -#define CURRENT_TEST_NAME \ - std::string { \ - ::testing::UnitTest::GetInstance()->current_test_info()->name() \ - } - -namespace blink { - -using DartIsolateTest = ::testing::ThreadTest; - -TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) { - Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - auto vm = DartVM::ForProcess(settings); - ASSERT_TRUE(vm); - TaskRunners task_runners(CURRENT_TEST_NAME, // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner() // - ); - auto root_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - std::move(task_runners), // task runners - nullptr, // window - {}, // resource context - nullptr // unref qeueue - ); - ASSERT_TRUE(root_isolate); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); - ASSERT_TRUE(root_isolate->Shutdown()); -} - -TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) { - Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - auto vm = DartVM::ForProcess(settings); - ASSERT_TRUE(vm); - TaskRunners task_runners(CURRENT_TEST_NAME, // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner() // - ); - auto root_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - std::move(task_runners), // task runners - nullptr, // window - {}, // resource context - nullptr // unref qeueue - ); - ASSERT_TRUE(root_isolate); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); - ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( - testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); - ASSERT_TRUE(root_isolate->Shutdown()); -} - -TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) { - Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - auto vm = DartVM::ForProcess(settings); - ASSERT_TRUE(vm); - TaskRunners task_runners(CURRENT_TEST_NAME, // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner() // - ); - auto root_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - std::move(task_runners), // task runners - nullptr, // window - {}, // resource context - nullptr // unref qeueue - ); - ASSERT_TRUE(root_isolate); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); - ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( - testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); - ASSERT_TRUE(root_isolate->Run("simple_main")); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Running); - ASSERT_TRUE(root_isolate->Shutdown()); -} - -} // namespace blink diff --git a/runtime/dart_service_isolate.h b/runtime/dart_service_isolate.h index 59a02e2e9d495..9edd663feb6bd 100644 --- a/runtime/dart_service_isolate.h +++ b/runtime/dart_service_isolate.h @@ -13,6 +13,8 @@ namespace blink { class DartServiceIsolate { public: + static bool Bootstrap(); + static bool Startup(std::string server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc deleted file mode 100644 index 5d759257d1d4b..0000000000000 --- a/runtime/dart_snapshot.cc +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2017 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/runtime/dart_snapshot.h" - -#include - -#include "flutter/fml/native_library.h" -#include "flutter/fml/paths.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/dart_snapshot_buffer.h" -#include "flutter/runtime/dart_vm.h" - -namespace blink { - -const char* DartSnapshot::kVMDataSymbol = "kDartVmSnapshotData"; -const char* DartSnapshot::kVMInstructionsSymbol = "kDartVmSnapshotInstructions"; -const char* DartSnapshot::kIsolateDataSymbol = "kDartIsolateSnapshotData"; -const char* DartSnapshot::kIsolateInstructionsSymbol = - "kDartIsolateSnapshotInstructions"; - -static std::unique_ptr ResolveVMData( - const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = fml::paths::JoinPaths( - {settings.aot_snapshot_path, settings.aot_vm_snapshot_data_filename}); - if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), false /* executable */)) { - return source; - } - } - - auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); - return DartSnapshotBuffer::CreateWithSymbolInLibrary( - loaded_process, DartSnapshot::kVMDataSymbol); -} - -static std::unique_ptr ResolveVMInstructions( - const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = fml::paths::JoinPaths( - {settings.aot_snapshot_path, settings.aot_vm_snapshot_instr_filename}); - if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), true /* executable */)) { - return source; - } - } - - if (settings.application_library_path.size() > 0) { - auto library = - fml::NativeLibrary::Create(settings.application_library_path.c_str()); - if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( - library, DartSnapshot::kVMInstructionsSymbol)) { - return source; - } - } - - auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); - return DartSnapshotBuffer::CreateWithSymbolInLibrary( - loaded_process, DartSnapshot::kVMInstructionsSymbol); -} - -static std::unique_ptr ResolveIsolateData( - const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = - fml::paths::JoinPaths({settings.aot_snapshot_path, - settings.aot_isolate_snapshot_data_filename}); - if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), false /* executable */)) { - return source; - } - } - - auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); - return DartSnapshotBuffer::CreateWithSymbolInLibrary( - loaded_process, DartSnapshot::kIsolateDataSymbol); -} - -static std::unique_ptr ResolveIsolateInstructions( - const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = - fml::paths::JoinPaths({settings.aot_snapshot_path, - settings.aot_isolate_snapshot_instr_filename}); - if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), true /* executable */)) { - return source; - } - } - - if (settings.application_library_path.size() > 0) { - auto library = - fml::NativeLibrary::Create(settings.application_library_path.c_str()); - if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( - library, DartSnapshot::kIsolateInstructionsSymbol)) { - return source; - } - } - - auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); - return DartSnapshotBuffer::CreateWithSymbolInLibrary( - loaded_process, DartSnapshot::kIsolateInstructionsSymbol); -} - -fxl::RefPtr DartSnapshot::VMSnapshotFromSettings( - const Settings& settings) { - TRACE_EVENT0("flutter", "DartSnapshot::VMSnapshotFromSettings"); - auto snapshot = - fxl::MakeRefCounted(ResolveVMData(settings), // - ResolveVMInstructions(settings) // - ); - if (snapshot->IsValid()) { - return snapshot; - } - return nullptr; -} - -fxl::RefPtr DartSnapshot::IsolateSnapshotFromSettings( - const Settings& settings) { - TRACE_EVENT0("flutter", "DartSnapshot::IsolateSnapshotFromSettings"); - auto snapshot = - fxl::MakeRefCounted(ResolveIsolateData(settings), // - ResolveIsolateInstructions(settings) // - ); - if (snapshot->IsValid()) { - return snapshot; - } - return nullptr; -} - -DartSnapshot::DartSnapshot(std::unique_ptr data, - std::unique_ptr instructions) - : data_(std::move(data)), instructions_(std::move(instructions)) {} - -DartSnapshot::~DartSnapshot() = default; - -bool DartSnapshot::IsValid() const { - return static_cast(data_); -} - -bool DartSnapshot::IsValidForAOT() const { - return data_ && instructions_; -} - -const DartSnapshotBuffer* DartSnapshot::GetData() const { - return data_.get(); -} - -const DartSnapshotBuffer* DartSnapshot::GetInstructions() const { - return instructions_.get(); -} - -const uint8_t* DartSnapshot::GetInstructionsIfPresent() const { - return instructions_ ? instructions_->GetSnapshotPointer() : nullptr; -} - -} // namespace blink diff --git a/runtime/dart_snapshot.h b/runtime/dart_snapshot.h deleted file mode 100644 index 4f04765b4f5a9..0000000000000 --- a/runtime/dart_snapshot.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_H_ -#define FLUTTER_RUNTIME_DART_SNAPSHOT_H_ - -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/runtime/dart_snapshot_buffer.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" - -namespace blink { - -class DartSnapshot : public fxl::RefCountedThreadSafe { - public: - static const char* kVMDataSymbol; - static const char* kVMInstructionsSymbol; - static const char* kIsolateDataSymbol; - static const char* kIsolateInstructionsSymbol; - - static fxl::RefPtr VMSnapshotFromSettings( - const Settings& settings); - - static fxl::RefPtr IsolateSnapshotFromSettings( - const Settings& settings); - - bool IsValid() const; - - bool IsValidForAOT() const; - - const DartSnapshotBuffer* GetData() const; - - const DartSnapshotBuffer* GetInstructions() const; - - const uint8_t* GetInstructionsIfPresent() const; - - private: - std::unique_ptr data_; - std::unique_ptr instructions_; - - DartSnapshot(std::unique_ptr data, - std::unique_ptr instructions); - - ~DartSnapshot(); - - FRIEND_REF_COUNTED_THREAD_SAFE(DartSnapshot); - FRIEND_MAKE_REF_COUNTED(DartSnapshot); - FXL_DISALLOW_COPY_AND_ASSIGN(DartSnapshot); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_H_ diff --git a/runtime/dart_snapshot_buffer.cc b/runtime/dart_snapshot_buffer.cc deleted file mode 100644 index c39233ac8334a..0000000000000 --- a/runtime/dart_snapshot_buffer.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2017 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/runtime/dart_snapshot_buffer.h" - -#include - -#include "flutter/fml/mapping.h" - -namespace blink { - -class NativeLibrarySnapshotBuffer final : public DartSnapshotBuffer { - public: - NativeLibrarySnapshotBuffer(fxl::RefPtr library, - const char* symbol_name) - : library_(std::move(library)) { - if (library_) { - symbol_ = library_->ResolveSymbol(symbol_name); - } - } - - const uint8_t* GetSnapshotPointer() const override { return symbol_; } - - size_t GetSnapshotSize() const override { return 0; } - - private: - fxl::RefPtr library_; - const uint8_t* symbol_ = nullptr; - - FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrarySnapshotBuffer); -}; - -class FileSnapshotBuffer final : public DartSnapshotBuffer { - public: - FileSnapshotBuffer(const char* path, bool executable) - : mapping_(path, executable) { - if (mapping_.GetSize() > 0) { - symbol_ = mapping_.GetMapping(); - } - } - - const uint8_t* GetSnapshotPointer() const override { return symbol_; } - - size_t GetSnapshotSize() const override { return mapping_.GetSize(); } - - private: - fml::FileMapping mapping_; - const uint8_t* symbol_ = nullptr; - - FXL_DISALLOW_COPY_AND_ASSIGN(FileSnapshotBuffer); -}; - -std::unique_ptr -DartSnapshotBuffer::CreateWithSymbolInLibrary( - fxl::RefPtr library, - const char* symbol_name) { - auto source = std::make_unique( - std::move(library), symbol_name); - return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); -} - -std::unique_ptr -DartSnapshotBuffer::CreateWithContentsOfFile(const char* file_path, - bool executable) { - auto source = std::make_unique(file_path, executable); - return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); -} - -DartSnapshotBuffer::~DartSnapshotBuffer() = default; - -} // namespace blink diff --git a/runtime/dart_snapshot_buffer.h b/runtime/dart_snapshot_buffer.h deleted file mode 100644 index 675946c0ca63f..0000000000000 --- a/runtime/dart_snapshot_buffer.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_BUFFER_H_ -#define FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ - -#include - -#include "flutter/fml/native_library.h" -#include "lib/fxl/macros.h" - -namespace blink { - -class DartSnapshotBuffer { - public: - static std::unique_ptr CreateWithSymbolInLibrary( - fxl::RefPtr library, - const char* symbol_name); - - static std::unique_ptr CreateWithContentsOfFile( - const char* file_path, - bool executable); - - virtual ~DartSnapshotBuffer(); - - virtual const uint8_t* GetSnapshotPointer() const = 0; - - virtual size_t GetSnapshotSize() const = 0; -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc deleted file mode 100644 index bb46779078583..0000000000000 --- a/runtime/dart_vm.cc +++ /dev/null @@ -1,472 +0,0 @@ -// Copyright 2017 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/runtime/dart_vm.h" - -#include - -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/fml/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/runtime/dart_isolate.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/runtime/start_up.h" -#include "lib/fxl/arraysize.h" -#include "lib/fxl/compiler_specific.h" -#include "lib/fxl/files/file.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_class_provider.h" -#include "lib/tonic/dart_sticky_error.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/typed_data/uint8_list.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace dart { -namespace observatory { - -#if !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) - -// These two symbols are defined in |observatory_archive.cc| which is generated -// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. -// Both of these symbols will be part of the data segment and therefore are read -// only. -extern unsigned int observatory_assets_archive_len; -extern const uint8_t* observatory_assets_archive; - -#endif // !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != - // FLUTTER_RUNTIME_MODE_RELEASE) - -} // namespace observatory -} // namespace dart - -namespace blink { - -// Arguments passed to the Dart VM in all configurations. -static const char* kDartLanguageArgs[] = { - "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", - "--causal_async_stacks", "--limit-ints-to-64-bits", -}; - -static const char* kDartPrecompilationArgs[] = { - "--precompilation", -}; - -FXL_ALLOW_UNUSED_TYPE -static const char* kDartWriteProtectCodeArgs[] = { - "--no_write_protect_code", -}; - -static const char* kDartAssertArgs[] = { - // clang-format off - "--enable_asserts", - // clang-format on -}; - -static const char* kDartCheckedModeArgs[] = { - // clang-format off - "--enable_type_checks", - "--error_on_bad_type", - "--error_on_bad_override", - // clang-format on -}; - -static const char* kDartStrongModeArgs[] = { - // clang-format off - "--strong", - "--reify_generic_functions", - "--limit_ints_to_64_bits", - "--sync_async", - // clang-format on -}; - -static const char* kDartStartPausedArgs[]{ - "--pause_isolates_on_start", -}; - -static const char* kDartTraceStartupArgs[]{ - "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", -}; - -static const char* kDartEndlessTraceBufferArgs[]{ - "--timeline_recorder=endless", -}; - -static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { - "--systrace_timeline", - "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", -}; - -constexpr char kFileUriPrefix[] = "file://"; -constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; - -bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { - if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { - // Assume modified. - return true; - } - - const char* path = source_url + kFileUriPrefixLength; - struct stat info; - if (stat(path, &info) < 0) - return true; - - // If st_mtime is zero, it's more likely that the file system doesn't support - // mtime than that the file was actually modified in the 1970s. - if (!info.st_mtime) - return true; - - // It's very unclear what time bases we're with here. The Dart API doesn't - // document the time base for since_ms. Reading the code, the value varies by - // platform, with a typical source being something like gettimeofday. - // - // We add one to st_mtime because st_mtime has less precision than since_ms - // and we want to treat the file as modified if the since time is between - // ticks of the mtime. - fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); - fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); - - return mtime > since; -} - -void ThreadExitCallback() {} - -Dart_Handle GetVMServiceAssetsArchiveCallback() { -#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) - return nullptr; -#elif OS(FUCHSIA) - std::vector observatory_assets_archive; - if (!files::ReadFileToVector("pkg/data/observatory.tar", - &observatory_assets_archive)) { - FXL_LOG(ERROR) << "Fail to load Observatory archive"; - return nullptr; - } - return tonic::DartConverter::ToDart( - observatory_assets_archive.data(), observatory_assets_archive.size()); -#else - return tonic::DartConverter::ToDart( - ::dart::observatory::observatory_assets_archive, - ::dart::observatory::observatory_assets_archive_len); -#endif -} - -static const char kStdoutStreamId[] = "Stdout"; -static const char kStderrStreamId[] = "Stderr"; - -static bool ServiceStreamListenCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(true); - return true; - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(true); - return true; - } - return false; -} - -static void ServiceStreamCancelCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(false); - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(false); - } -} - -bool DartVM::IsRunningPrecompiledCode() { - return Dart_IsPrecompiledRuntime(); -} - -static std::vector ProfilingFlags(bool enable_profiling) { -// Disable Dart's built in profiler when building a debug build. This -// works around a race condition that would sometimes stop a crash's -// stack trace from being printed on Android. -#ifndef NDEBUG - enable_profiling = false; -#endif - - // We want to disable profiling by default because it overwhelms LLDB. But - // the VM enables the same by default. In either case, we have some profiling - // flags. - if (enable_profiling) { - return {// This is the default. But just be explicit. - "--profiler", - // This instructs the profiler to walk C++ frames, and to include - // them in the profile. - "--profile-vm"}; - } else { - return {"--no-profiler"}; - } -} - -void PushBackAll(std::vector* args, - const char** argv, - size_t argc) { - for (size_t i = 0; i < argc; ++i) { - args->push_back(argv[i]); - } -} - -static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { - info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; - dart::bin::GetIOEmbedderInformation(info); - info->name = "Flutter"; -} - -fxl::RefPtr DartVM::ForProcess(Settings settings) { - return ForProcess(settings, nullptr, nullptr); -} - -static std::once_flag gVMInitialization; -static fxl::RefPtr gVM; - -fxl::RefPtr DartVM::ForProcess( - Settings settings, - fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot) { - std::call_once(gVMInitialization, [settings, // - vm_snapshot, // - isolate_snapshot // - ]() mutable { - if (!vm_snapshot) { - vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings); - } - if (!isolate_snapshot) { - isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings); - } - gVM = fxl::MakeRefCounted(settings, // - std::move(vm_snapshot), // - std::move(isolate_snapshot) // - ); - }); - return gVM; -} - -fxl::RefPtr DartVM::ForProcessIfInitialized() { - return gVM; -} - -DartVM::DartVM(const Settings& settings, - fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot) - : settings_(settings), - vm_snapshot_(std::move(vm_snapshot)), - isolate_snapshot_(std::move(isolate_snapshot)), - platform_kernel_mapping_( - std::make_unique(settings.kernel_snapshot_path)), - weak_factory_(this) { - TRACE_EVENT0("flutter", "DartVMInitializer"); - FXL_DLOG(INFO) << "Attempting Dart VM launch for mode: " - << (IsRunningPrecompiledCode() ? "AOT" : "Interpreter"); - - FXL_DCHECK(vm_snapshot_ && vm_snapshot_->IsValid()) - << "VM snapshot must be valid."; - - FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid()) - << "Isolate snapshot must be valid."; - - if (platform_kernel_mapping_->GetSize() > 0) { - // The platform kernel mapping lifetime is managed by this instance of the - // DartVM and hence will exceed that of the PlatformKernel. So provide an - // empty release callback. - Dart_ReleaseBufferCallback empty = [](auto arg) {}; - platform_kernel_ = reinterpret_cast(Dart_ReadKernelBinary( - platform_kernel_mapping_->GetMapping(), // buffer - platform_kernel_mapping_->GetSize(), // buffer size - empty // buffer deleter - )); - } - - { - TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); - dart::bin::BootstrapDartIo(); - - if (!settings.temp_directory_path.empty()) { - dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); - } - } - - std::vector args; - - // Instruct the VM to ignore unrecognized flags. - // There is a lot of diversity in a lot of combinations when it - // comes to the arguments the VM supports. And, if the VM comes across a flag - // it does not recognize, it exits immediately. - args.push_back("--ignore-unrecognized-flags"); - - for (const auto& profiler_flag : - ProfilingFlags(settings.enable_dart_profiling)) { - args.push_back(profiler_flag); - } - - PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); - - if (IsRunningPrecompiledCode()) { - PushBackAll(&args, kDartPrecompilationArgs, - arraysize(kDartPrecompilationArgs)); - } - - // Enable checked mode if we are not running precompiled code. We run non- - // precompiled code only in the debug product mode. - bool use_checked_mode = !settings.dart_non_checked_mode; - -#if !OS(FUCHSIA) - if (IsRunningPrecompiledCode()) { - use_checked_mode = false; - } -#endif // !OS(FUCHSIA) - -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - // Debug mode uses the JIT, disable code page write protection to avoid - // memory page protection changes before and after every compilation. - PushBackAll(&args, kDartWriteProtectCodeArgs, - arraysize(kDartWriteProtectCodeArgs)); -#endif - - const bool isolate_snapshot_is_dart_2 = - Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); - - const bool is_preview_dart2 = - platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; - - if (is_preview_dart2) { - FXL_DLOG(INFO) << "Dart 2 is enabled."; - } else { - FXL_DLOG(INFO) << "Dart 2 is NOT enabled. Platform kernel: " - << static_cast(platform_kernel_) - << " Isolate Snapshot is Dart 2: " - << isolate_snapshot_is_dart_2; - } - if (is_preview_dart2) { - PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); - if (use_checked_mode) { - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - } - } else if (use_checked_mode) { - FXL_DLOG(INFO) << "Checked mode is ON"; - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); - } else { - FXL_DLOG(INFO) << "Is not Dart 2 and Checked mode is OFF"; - } - - if (settings.start_paused) { - PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); - } - - if (settings.endless_trace_buffer || settings.trace_startup) { - // If we are tracing startup, make sure the trace buffer is endless so we - // don't lose early traces. - PushBackAll(&args, kDartEndlessTraceBufferArgs, - arraysize(kDartEndlessTraceBufferArgs)); - } - - if (settings.trace_startup) { - PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); - } - -#if defined(OS_FUCHSIA) - PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); -#endif - - for (size_t i = 0; i < settings.dart_flags.size(); i++) - args.push_back(settings.dart_flags[i].c_str()); - - FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); - - DartUI::InitForGlobal(); - - { - TRACE_EVENT0("flutter", "Dart_Initialize"); - Dart_InitializeParams params = {}; - params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; - params.vm_snapshot_data = vm_snapshot_->GetData()->GetSnapshotPointer(); - params.vm_snapshot_instructions = vm_snapshot_->GetInstructionsIfPresent(); - params.create = reinterpret_cast( - DartIsolate::DartIsolateCreateCallback); - params.shutdown = reinterpret_cast( - DartIsolate::DartIsolateShutdownCallback); - params.cleanup = reinterpret_cast( - DartIsolate::DartIsolateCleanupCallback); - params.thread_exit = ThreadExitCallback; - params.get_service_assets = GetVMServiceAssetsArchiveCallback; - params.entropy_source = DartIO::EntropySource; - char* init_error = Dart_Initialize(¶ms); - if (init_error) { - FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; - ::free(init_error); - } - // Send the earliest available timestamp in the application lifecycle to - // timeline. The difference between this timestamp and the time we render - // the very first frame gives us a good idea about Flutter's startup time. - // Use a duration event so about:tracing will consider this event when - // deciding the earliest event to use as time 0. - if (blink::engine_main_enter_ts != 0) { - Dart_TimelineEvent("FlutterEngineMainEnter", // label - blink::engine_main_enter_ts, // timestamp0 - blink::engine_main_enter_ts, // timestamp1_or_async_id - Dart_Timeline_Event_Duration, // event type - 0, // argument_count - nullptr, // argument_names - nullptr // argument_values - ); - } - } - - // Allow streaming of stdout and stderr by the Dart vm. - Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, - &ServiceStreamCancelCallback); - - Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); -} - -DartVM::~DartVM() { - if (Dart_CurrentIsolate() != nullptr) { - Dart_ExitIsolate(); - } - char* result = Dart_Cleanup(); - if (result != nullptr) { - FXL_LOG(ERROR) << "Could not cleanly shut down the Dart VM. Message: \"" - << result << "\"."; - free(result); - } -} - -const Settings& DartVM::GetSettings() const { - return settings_; -} - -DartVM::PlatformKernel* DartVM::GetPlatformKernel() const { - return platform_kernel_; -} - -const DartSnapshot& DartVM::GetVMSnapshot() const { - return *vm_snapshot_.get(); -} - -fxl::RefPtr DartVM::GetIsolateSnapshot() const { - return isolate_snapshot_; -} - -ServiceProtocol& DartVM::GetServiceProtocol() { - return service_protocol_; -} - -fxl::WeakPtr DartVM::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -} // namespace blink diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h deleted file mode 100644 index e8feb9ba1de92..0000000000000 --- a/runtime/dart_vm.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2017 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_RUNTIME_DART_VM_H_ -#define FLUTTER_RUNTIME_DART_VM_H_ - -#include -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/runtime/dart_isolate.h" -#include "flutter/runtime/dart_snapshot.h" -#include "flutter/runtime/service_protocol.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" -#include "lib/fxl/memory/ref_ptr.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace blink { - -class DartVM : public fxl::RefCountedThreadSafe { - public: - class PlatformKernel; - - static fxl::RefPtr ForProcess(Settings settings); - - static fxl::RefPtr ForProcess( - Settings settings, - fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot); - - static fxl::RefPtr ForProcessIfInitialized(); - - static bool IsRunningPrecompiledCode(); - - const Settings& GetSettings() const; - - PlatformKernel* GetPlatformKernel() const; - - const DartSnapshot& GetVMSnapshot() const; - - fxl::RefPtr GetIsolateSnapshot() const; - - fxl::WeakPtr GetWeakPtr(); - - ServiceProtocol& GetServiceProtocol(); - - private: - const Settings settings_; - const fxl::RefPtr vm_snapshot_; - const fxl::RefPtr isolate_snapshot_; - std::unique_ptr platform_kernel_mapping_; - PlatformKernel* platform_kernel_ = nullptr; - ServiceProtocol service_protocol_; - fxl::WeakPtrFactory weak_factory_; - - DartVM(const Settings& settings, - fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot); - - ~DartVM(); - - FRIEND_REF_COUNTED_THREAD_SAFE(DartVM); - FRIEND_MAKE_REF_COUNTED(DartVM); - FXL_DISALLOW_COPY_AND_ASSIGN(DartVM); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_VM_H_ diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc deleted file mode 100644 index 5b2f5e6ee8299..0000000000000 --- a/runtime/dart_vm_unittests.cc +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 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/runtime/dart_vm.h" -#include "gtest/gtest.h" - -namespace blink { - -TEST(DartVM, SimpleInitialization) { - Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - auto vm = DartVM::ForProcess(settings); - ASSERT_TRUE(vm); - ASSERT_EQ(vm, DartVM::ForProcess(settings)); - ASSERT_FALSE(DartVM::IsRunningPrecompiledCode()); - ASSERT_EQ(vm->GetPlatformKernel(), nullptr); -} - -} // namespace blink diff --git a/runtime/fixtures/simple_main.dart b/runtime/fixtures/simple_main.dart deleted file mode 100644 index 552dfbe344902..0000000000000 --- a/runtime/fixtures/simple_main.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2016 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. - -void simple_main() { - print("Hello"); -} diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index d3e138c937f60..75796cd68697e 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -4,244 +4,192 @@ #include "flutter/runtime/runtime_controller.h" -#include "flutter/fml/message_loop.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "lib/tonic/dart_message_handler.h" +using tonic::DartState; + namespace blink { -RuntimeController::RuntimeController( - RuntimeDelegate& p_client, - const DartVM* p_vm, - TaskRunners p_task_runners, - fml::WeakPtr p_resource_context, - fxl::RefPtr p_unref_queue) - : RuntimeController(p_client, - p_vm, - std::move(p_task_runners), - std::move(p_resource_context), - std::move(p_unref_queue), - WindowData{/* default window data */}) {} - -RuntimeController::RuntimeController( - RuntimeDelegate& p_client, - const DartVM* p_vm, - TaskRunners p_task_runners, - fml::WeakPtr p_resource_context, - fxl::RefPtr p_unref_queue, - WindowData p_window_data) - : client_(p_client), - vm_(p_vm), - task_runners_(p_task_runners), - resource_context_(p_resource_context), - unref_queue_(p_unref_queue), - window_data_(std::move(p_window_data)), - root_isolate_( - DartIsolate::CreateRootIsolate(vm_, - vm_->GetIsolateSnapshot(), - task_runners_, - std::make_unique(this), - resource_context_, - unref_queue_)) { - root_isolate_->SetReturnCodeCallback([this](uint32_t code) { - root_isolate_return_code_ = {true, code}; - }); - if (auto window = GetWindowIfAvailable()) { - tonic::DartState::Scope scope(root_isolate_.get()); - window->DidCreateIsolate(); - if (!FlushRuntimeStateToIsolate()) { - FXL_DLOG(ERROR) << "Could not setup intial isolate state."; - } - } else { - FXL_DCHECK(false) << "RuntimeController created without window binding."; - } - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); -} - -RuntimeController::~RuntimeController() { - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - if (root_isolate_) { - root_isolate_->SetReturnCodeCallback(nullptr); - auto result = root_isolate_->Shutdown(); - if (!result) { - FXL_DLOG(ERROR) << "Could not shutdown the root isolate."; - } - root_isolate_ = {}; - } +std::unique_ptr RuntimeController::Create( + RuntimeDelegate* client) { + return std::unique_ptr(new RuntimeController(client)); } -std::unique_ptr RuntimeController::Clone() const { - return std::unique_ptr(new RuntimeController( - client_, // - vm_, // - task_runners_, // - resource_context_, // - unref_queue_, // - window_data_ // - )); -} +RuntimeController::RuntimeController(RuntimeDelegate* client) + : client_(client) {} -bool RuntimeController::FlushRuntimeStateToIsolate() { - return SetViewportMetrics(window_data_.viewport_metrics) && - SetLocale(window_data_.language_code, window_data_.country_code) && - SetSemanticsEnabled(window_data_.semantics_enabled); -} +RuntimeController::~RuntimeController() {} -bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { - window_data_.viewport_metrics = metrics; +void RuntimeController::CreateDartController( + const std::string& script_uri, + const uint8_t* isolate_snapshot_data, + const uint8_t* isolate_snapshot_instr, + int dirfd) { + FXL_DCHECK(!dart_controller_); - if (auto window = GetWindowIfAvailable()) { - window->UpdateWindowMetrics(metrics); - return true; - } - return false; -} + dart_controller_.reset(new DartController()); + dart_controller_->CreateIsolateFor( + script_uri, isolate_snapshot_data, isolate_snapshot_instr, + std::make_unique(this, std::make_unique(this), + dirfd)); -bool RuntimeController::SetLocale(const std::string& language_code, - const std::string& country_code) { - window_data_.language_code = language_code; - window_data_.country_code = country_code; + UIDartState* dart_state = dart_controller_->dart_state(); + DartState::Scope scope(dart_state); + dart_state->window()->DidCreateIsolate(); + client_->DidCreateMainIsolate(dart_state->isolate()); - if (auto window = GetWindowIfAvailable()) { - window->UpdateLocale(window_data_.language_code, window_data_.country_code); - return true; - } + Window* window = GetWindow(); + + window->UpdateLocale(language_code_, country_code_); - return false; + if (semantics_enabled_) + window->UpdateSemanticsEnabled(semantics_enabled_); } -bool RuntimeController::SetUserSettingsData(const std::string& data) { - window_data_.user_settings_data = data; +void RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { + GetWindow()->UpdateWindowMetrics(metrics); +} - if (auto window = GetWindowIfAvailable()) { - window->UpdateUserSettingsData(window_data_.user_settings_data); - return true; - } +void RuntimeController::SetLocale(const std::string& language_code, + const std::string& country_code) { + if (language_code_ == language_code && country_code_ == country_code) + return; - return false; + language_code_ = language_code; + country_code_ = country_code; + GetWindow()->UpdateLocale(language_code_, country_code_); } -bool RuntimeController::SetSemanticsEnabled(bool enabled) { - window_data_.semantics_enabled = enabled; - - if (auto window = GetWindowIfAvailable()) { - window->UpdateSemanticsEnabled(window_data_.semantics_enabled); - return true; - } +void RuntimeController::SetUserSettingsData(const std::string& data) { + if (user_settings_data_ == data) + return; + user_settings_data_ = data; + GetWindow()->UpdateUserSettingsData(user_settings_data_); +} - return false; +void RuntimeController::SetSemanticsEnabled(bool enabled) { + if (semantics_enabled_ == enabled) + return; + semantics_enabled_ = enabled; + GetWindow()->UpdateSemanticsEnabled(semantics_enabled_); } -bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) { - if (auto window = GetWindowIfAvailable()) { - window->BeginFrame(frame_time); - return true; - } - return false; +void RuntimeController::BeginFrame(fxl::TimePoint frame_time) { + GetWindow()->BeginFrame(frame_time); } -bool RuntimeController::NotifyIdle(int64_t deadline) { - if (!root_isolate_) { - return false; +void RuntimeController::NotifyIdle(int64_t deadline) { + UIDartState* dart_state = dart_controller_->dart_state(); + if (!dart_state) { + return; } - - tonic::DartState::Scope scope(root_isolate_.get()); + DartState::Scope scope(dart_state); Dart_NotifyIdle(deadline); - return true; } -bool RuntimeController::DispatchPlatformMessage( +void RuntimeController::DispatchPlatformMessage( fxl::RefPtr message) { - if (auto window = GetWindowIfAvailable()) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", - "mode", "basic"); - window->DispatchPlatformMessage(std::move(message)); - return true; - } - return false; + TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", "mode", + "basic"); + GetWindow()->DispatchPlatformMessage(std::move(message)); } -bool RuntimeController::DispatchPointerDataPacket( +void RuntimeController::DispatchPointerDataPacket( const PointerDataPacket& packet) { - if (auto window = GetWindowIfAvailable()) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", - "mode", "basic"); - window->DispatchPointerDataPacket(packet); - return true; - } - return false; + TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", + "mode", "basic"); + GetWindow()->DispatchPointerDataPacket(packet); } -bool RuntimeController::DispatchSemanticsAction(int32_t id, +void RuntimeController::DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args) { TRACE_EVENT1("flutter", "RuntimeController::DispatchSemanticsAction", "mode", "basic"); - if (auto window = GetWindowIfAvailable()) { - window->DispatchSemanticsAction(id, action, std::move(args)); - return true; - } - return false; + GetWindow()->DispatchSemanticsAction(id, action, std::move(args)); } -Window* RuntimeController::GetWindowIfAvailable() { - return root_isolate_ ? root_isolate_->window() : nullptr; +Window* RuntimeController::GetWindow() { + return dart_controller_->dart_state()->window(); } std::string RuntimeController::DefaultRouteName() { - return client_.DefaultRouteName(); + return client_->DefaultRouteName(); } void RuntimeController::ScheduleFrame() { - client_.ScheduleFrame(); + client_->ScheduleFrame(); } void RuntimeController::Render(Scene* scene) { - client_.Render(scene->takeLayerTree()); + client_->Render(scene->takeLayerTree()); } void RuntimeController::UpdateSemantics(SemanticsUpdate* update) { - if (window_data_.semantics_enabled) { - client_.UpdateSemantics(update->takeNodes()); - } + if (semantics_enabled_) + client_->UpdateSemantics(update->takeNodes()); } void RuntimeController::HandlePlatformMessage( fxl::RefPtr message) { - client_.HandlePlatformMessage(std::move(message)); + client_->HandlePlatformMessage(std::move(message)); +} + +void RuntimeController::DidCreateSecondaryIsolate(Dart_Isolate isolate) { + client_->DidCreateSecondaryIsolate(isolate); +} + +void RuntimeController::DidShutdownMainIsolate() { + client_->DidShutdownMainIsolate(); } Dart_Port RuntimeController::GetMainPort() { - return root_isolate_ ? root_isolate_->main_port() : ILLEGAL_PORT; + if (!dart_controller_) { + return ILLEGAL_PORT; + } + if (!dart_controller_->dart_state()) { + return ILLEGAL_PORT; + } + return dart_controller_->dart_state()->main_port(); } std::string RuntimeController::GetIsolateName() { - return root_isolate_ ? root_isolate_->debug_name() : ""; + if (!dart_controller_) { + return ""; + } + if (!dart_controller_->dart_state()) { + return ""; + } + return dart_controller_->dart_state()->debug_name(); } bool RuntimeController::HasLivePorts() { - if (!root_isolate_) { + if (!dart_controller_) { return false; } - tonic::DartState::Scope scope(root_isolate_.get()); + UIDartState* dart_state = dart_controller_->dart_state(); + if (!dart_state) { + return false; + } + DartState::Scope scope(dart_state); return Dart_HasLivePorts(); } tonic::DartErrorHandleType RuntimeController::GetLastError() { - return root_isolate_ ? root_isolate_->message_handler().isolate_last_error() - : tonic::kNoError; -} - -fml::WeakPtr RuntimeController::GetRootIsolate() { - return root_isolate_; -} - -std::pair RuntimeController::GetRootIsolateReturnCode() { - return root_isolate_return_code_; + if (!dart_controller_) { + return tonic::kNoError; + } + UIDartState* dart_state = dart_controller_->dart_state(); + if (!dart_state) { + return tonic::kNoError; + } + return dart_state->message_handler().isolate_last_error(); } } // namespace blink diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 326c517f31db2..628bc699395c0 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -7,109 +7,72 @@ #include -#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_vm.h" #include "lib/fxl/macros.h" namespace blink { +class DartController; +class DartLibraryProvider; class Scene; class RuntimeDelegate; class View; class Window; -class RuntimeController final : public WindowClient { +class RuntimeController : public WindowClient, public IsolateClient { public: - RuntimeController(RuntimeDelegate& client, - const DartVM* vm, - TaskRunners task_runners, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue); - + static std::unique_ptr Create(RuntimeDelegate* client); ~RuntimeController(); - std::unique_ptr Clone() const; - - bool SetViewportMetrics(const ViewportMetrics& metrics); + void CreateDartController(const std::string& script_uri, + const uint8_t* isolate_snapshot_data, + const uint8_t* isolate_snapshot_instr, + int dirfd = -1); + DartController* dart_controller() const { return dart_controller_.get(); } - bool SetLocale(const std::string& language_code, + void SetViewportMetrics(const ViewportMetrics& metrics); + void SetLocale(const std::string& language_code, const std::string& country_code); + void SetUserSettingsData(const std::string& data); + void SetSemanticsEnabled(bool enabled); - bool SetUserSettingsData(const std::string& data); - - bool SetSemanticsEnabled(bool enabled); - - bool BeginFrame(fxl::TimePoint frame_time); - - bool NotifyIdle(int64_t deadline); + void BeginFrame(fxl::TimePoint frame_time); + void NotifyIdle(int64_t deadline); - bool DispatchPlatformMessage(fxl::RefPtr message); - - bool DispatchPointerDataPacket(const PointerDataPacket& packet); - - bool DispatchSemanticsAction(int32_t id, + void DispatchPlatformMessage(fxl::RefPtr message); + void DispatchPointerDataPacket(const PointerDataPacket& packet); + void DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args); Dart_Port GetMainPort(); - std::string GetIsolateName(); - bool HasLivePorts(); - tonic::DartErrorHandleType GetLastError(); - fml::WeakPtr GetRootIsolate(); + private: + explicit RuntimeController(RuntimeDelegate* client); - std::pair GetRootIsolateReturnCode(); + Window* GetWindow(); - private: - struct WindowData { - ViewportMetrics viewport_metrics; - std::string language_code; - std::string country_code; - std::string user_settings_data = "{}"; - bool semantics_enabled = false; - }; - - RuntimeDelegate& client_; - const DartVM* vm_; - TaskRunners task_runners_; - fml::WeakPtr resource_context_; - fxl::RefPtr unref_queue_; - WindowData window_data_; - fml::WeakPtr root_isolate_; - std::pair root_isolate_return_code_ = {false, 0}; - - RuntimeController(RuntimeDelegate& client, - const DartVM* vm, - TaskRunners task_runners, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - WindowData data); - - Window* GetWindowIfAvailable(); - - bool FlushRuntimeStateToIsolate(); - - // |blink::WindowClient| std::string DefaultRouteName() override; - - // |blink::WindowClient| void ScheduleFrame() override; - - // |blink::WindowClient| void Render(Scene* scene) override; - - // |blink::WindowClient| void UpdateSemantics(SemanticsUpdate* update) override; - - // |blink::WindowClient| void HandlePlatformMessage(fxl::RefPtr message) override; + void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; + void DidShutdownMainIsolate() override; + + RuntimeDelegate* client_; + std::string language_code_; + std::string country_code_; + std::string user_settings_data_ = "{}"; + bool semantics_enabled_ = false; + std::unique_ptr dart_controller_; + FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeController); }; diff --git a/runtime/runtime_delegate.cc b/runtime/runtime_delegate.cc index 902672be06d8f..6ec55c4c2e6a0 100644 --- a/runtime/runtime_delegate.cc +++ b/runtime/runtime_delegate.cc @@ -6,6 +6,12 @@ namespace blink { -RuntimeDelegate::~RuntimeDelegate() = default; +RuntimeDelegate::~RuntimeDelegate() {} + +void RuntimeDelegate::DidCreateMainIsolate(Dart_Isolate isolate) {} + +void RuntimeDelegate::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} + +void RuntimeDelegate::DidShutdownMainIsolate() {} } // namespace blink diff --git a/runtime/runtime_delegate.h b/runtime/runtime_delegate.h index c6d6c0a92b2b4..36650fe7fb70b 100644 --- a/runtime/runtime_delegate.h +++ b/runtime/runtime_delegate.h @@ -18,15 +18,15 @@ namespace blink { class RuntimeDelegate { public: virtual std::string DefaultRouteName() = 0; - virtual void ScheduleFrame(bool regenerate_layer_tree = true) = 0; - virtual void Render(std::unique_ptr layer_tree) = 0; - virtual void UpdateSemantics(blink::SemanticsNodeUpdates update) = 0; - virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; + virtual void DidCreateMainIsolate(Dart_Isolate isolate); + virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate); + virtual void DidShutdownMainIsolate(); + protected: virtual ~RuntimeDelegate(); }; diff --git a/runtime/runtime_init.cc b/runtime/runtime_init.cc new file mode 100644 index 0000000000000..eda66e5495aed --- /dev/null +++ b/runtime/runtime_init.cc @@ -0,0 +1,35 @@ +// Copyright 2016 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. + +#include "flutter/runtime/runtime_init.h" + +#include "flutter/glue/trace_event.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/runtime/platform_impl.h" +#include "flutter/sky/engine/public/web/Sky.h" +#include "lib/fxl/logging.h" + +namespace blink { +namespace { + +PlatformImpl* g_platform_impl = nullptr; + +} // namespace + +void InitRuntime(const uint8_t* vm_snapshot_data, + const uint8_t* vm_snapshot_instructions, + const uint8_t* default_isolate_snapshot_data, + const uint8_t* default_isolate_snapshot_instructions, + const std::string& bundle_path) { + TRACE_EVENT0("flutter", "InitRuntime"); + + FXL_CHECK(!g_platform_impl); + g_platform_impl = new PlatformImpl(); + InitEngine(g_platform_impl); + InitDartVM(vm_snapshot_data, vm_snapshot_instructions, + default_isolate_snapshot_data, + default_isolate_snapshot_instructions, bundle_path); +} + +} // namespace blink diff --git a/runtime/runtime_init.h b/runtime/runtime_init.h new file mode 100644 index 0000000000000..515ae284e3460 --- /dev/null +++ b/runtime/runtime_init.h @@ -0,0 +1,21 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_RUNTIME_RUNTIME_INIT_H_ +#define FLUTTER_RUNTIME_RUNTIME_INIT_H_ + +#include +#include + +namespace blink { + +void InitRuntime(const uint8_t* vm_snapshot_data, + const uint8_t* vm_snapshot_instructions, + const uint8_t* default_isolate_snapshot_data, + const uint8_t* default_isolate_snapshot_instructions, + const std::string& bundle_path); + +} // namespace blink + +#endif // FLUTTER_RUNTIME_RUNTIME_INIT_H_ diff --git a/runtime/service_protocol.cc b/runtime/service_protocol.cc deleted file mode 100644 index 030901e54269d..0000000000000 --- a/runtime/service_protocol.cc +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2017 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 RAPIDJSON_HAS_STDSTRING 1 - -#include "flutter/runtime/service_protocol.h" - -#include - -#include -#include -#include -#include - -#include "lib/fxl/synchronization/waitable_event.h" -#include "rapidjson/stringbuffer.h" -#include "rapidjson/writer.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace blink { - -const fxl::StringView ServiceProtocol::kScreenshotExtensionName = - "_flutter.screenshot"; -const fxl::StringView ServiceProtocol::kScreenshotSkpExtensionName = - "_flutter.screenshotSkp"; -const fxl::StringView ServiceProtocol::kRunInViewExtensionName = - "_flutter.runInView"; -const fxl::StringView ServiceProtocol::kFlushUIThreadTasksExtensionName = - "_flutter.flushUIThreadTasks"; -const fxl::StringView ServiceProtocol::kSetAssetBundlePathExtensionName = - "_flutter.setAssetBundlePath"; - -static constexpr fxl::StringView kViewIdPrefx = "_flutterView/"; -static constexpr fxl::StringView kListViewsExtensionName = "_flutter.listViews"; - -ServiceProtocol::ServiceProtocol() - : endpoints_({ - // Private - kListViewsExtensionName, - - // Public - kScreenshotExtensionName, - kScreenshotSkpExtensionName, - kRunInViewExtensionName, - kFlushUIThreadTasksExtensionName, - kSetAssetBundlePathExtensionName, - }) {} - -ServiceProtocol::~ServiceProtocol() { - ToggleHooks(false); -} - -void ServiceProtocol::AddHandler(Handler* handler) { - std::lock_guard lock(handlers_mutex_); - handlers_.emplace(handler); -} - -void ServiceProtocol::RemoveHandler(Handler* handler) { - std::lock_guard lock(handlers_mutex_); - handlers_.erase(handler); -} - -void ServiceProtocol::ToggleHooks(bool set) { - for (const auto& endpoint : endpoints_) { - Dart_RegisterRootServiceRequestCallback( - endpoint.data(), // method - &ServiceProtocol::HandleMessage, // callback - set ? this : nullptr // user data - ); - } -} - -static void WriteServerErrorResponse(rapidjson::Document& document, - const char* message) { - document.SetObject(); - document.AddMember("code", -32000, document.GetAllocator()); - rapidjson::Value message_value; - message_value.SetString(message, document.GetAllocator()); - document.AddMember("message", message_value, document.GetAllocator()); -} - -bool ServiceProtocol::HandleMessage(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - Handler::ServiceProtocolMap params; - for (intptr_t i = 0; i < num_params; i++) { - params[fxl::StringView{param_keys[i]}] = fxl::StringView{param_values[i]}; - } - -#ifndef NDEBUG - FXL_DLOG(INFO) << "Service protcol method: " << method; - FXL_DLOG(INFO) << "Arguments: " << params.size(); - for (intptr_t i = 0; i < num_params; i++) { - FXL_DLOG(INFO) << " " << i + 1 << ": " << param_keys[i] << " = " - << param_values[i]; - } -#endif // NDEBUG - - rapidjson::Document document; - bool result = HandleMessage(fxl::StringView{method}, // - params, // - static_cast(user_data), // - document // - ); - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - *json_object = strdup(buffer.GetString()); - -#ifndef NDEBUG - FXL_DLOG(INFO) << "Response: " << *json_object; - FXL_DLOG(INFO) << "RPC Result: " << result; -#endif // NDEBUG - - return result; -} - -bool ServiceProtocol::HandleMessage(fxl::StringView method, - const Handler::ServiceProtocolMap& params, - ServiceProtocol* service_protocol, - rapidjson::Document& response) { - if (service_protocol == nullptr) { - WriteServerErrorResponse(response, "Service protocol unavailable."); - return false; - } - - return service_protocol->HandleMessage(method, params, response); -} - -FXL_WARN_UNUSED_RESULT -static bool HandleMessageOnHandler( - ServiceProtocol::Handler* handler, - fxl::StringView method, - const ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& document) { - FXL_DCHECK(handler); - fxl::AutoResetWaitableEvent latch; - bool result = false; - fml::TaskRunner::RunNowOrPostTask( - handler->GetServiceProtocolHandlerTaskRunner(method), - [&latch, // - &result, // - &handler, // - &method, // - ¶ms, // - &document // - ]() { - result = - handler->HandleServiceProtocolMessage(method, params, document); - latch.Signal(); - }); - latch.Wait(); - return result; -} - -bool ServiceProtocol::HandleMessage(fxl::StringView method, - const Handler::ServiceProtocolMap& params, - rapidjson::Document& response) const { - if (method == kListViewsExtensionName) { - // So far, this is the only built-in method that does not forward to the - // dynamic set of handlers. - return HandleListViewsMethod(response); - } - - std::lock_guard lock(handlers_mutex_); - - if (handlers_.size() == 0) { - WriteServerErrorResponse(response, - "There are no running service protocol handlers."); - return false; - } - - // Find the handler by its "viewId" in the params. - auto view_id_param_found = params.find(fxl::StringView{"viewId"}); - if (view_id_param_found != params.end()) { - auto handler = reinterpret_cast(std::stoull( - view_id_param_found->second.data() + kViewIdPrefx.size(), nullptr, 16)); - auto handler_found = handlers_.find(handler); - if (handler_found != handlers_.end()) { - return HandleMessageOnHandler(handler, method, params, response); - } - } - - // Handle legacy calls that do not specify a handler in their args. - // TODO(chinmaygarde): Deprecate these calls in the tools and remove these - // fallbacks. - if (method == kScreenshotExtensionName || - method == kScreenshotSkpExtensionName) { - return HandleMessageOnHandler(*handlers_.begin(), method, params, response); - } - - WriteServerErrorResponse( - response, - "Service protocol could not handle or find a handler for the " - "requested method."); - return false; -} - -static std::string CreateFlutterViewID(intptr_t handler) { - std::stringstream stream; - stream << kViewIdPrefx << "0x" << std::hex << handler; - return stream.str(); -} - -static std::string CreateIsolateID(int64_t isolate) { - std::stringstream stream; - stream << "isolates/" << isolate; - return stream.str(); -} - -void ServiceProtocol::Handler::Description::Write( - Handler* handler, - rapidjson::Value& view, - rapidjson::MemoryPoolAllocator<>& allocator) const { - view.SetObject(); - view.AddMember("type", "FlutterView", allocator); - view.AddMember("id", CreateFlutterViewID(reinterpret_cast(handler)), - allocator); - if (isolate_port != 0) { - rapidjson::Value isolate(rapidjson::Type::kObjectType); - { - isolate.AddMember("type", "@Isolate", allocator); - isolate.AddMember("fixedId", true, allocator); - isolate.AddMember("id", CreateIsolateID(isolate_port), allocator); - isolate.AddMember("name", isolate_name, allocator); - isolate.AddMember("number", isolate_port, allocator); - } - view.AddMember("isolate", isolate, allocator); - } -} - -bool ServiceProtocol::HandleListViewsMethod( - rapidjson::Document& response) const { - // Collect handler descriptions on their respective task runners. - std::lock_guard lock(handlers_mutex_); - std::vector> descriptions; - for (const auto& handler : handlers_) { - fxl::AutoResetWaitableEvent latch; - Handler::Description description; - - fml::TaskRunner::RunNowOrPostTask( - handler->GetServiceProtocolHandlerTaskRunner( - kListViewsExtensionName), // task runner - [&latch, // - &description, // - &handler // - ]() { - description = handler->GetServiceProtocolDescription(); - latch.Signal(); - }); - latch.Wait(); - descriptions.emplace_back(std::make_pair( - reinterpret_cast(handler), std::move(description))); - } - - auto& allocator = response.GetAllocator(); - - // Construct the response objects. - response.SetObject(); - response.AddMember("type", "FlutterViewList", allocator); - - rapidjson::Value viewsList(rapidjson::Type::kArrayType); - for (const auto& description : descriptions) { - rapidjson::Value view(rapidjson::Type::kObjectType); - description.second.Write(reinterpret_cast(description.first), - view, allocator); - viewsList.PushBack(view, allocator); - } - - response.AddMember("views", viewsList, allocator); - - return true; -} - -} // namespace blink diff --git a/runtime/service_protocol.h b/runtime/service_protocol.h deleted file mode 100644 index 056f7389ea79a..0000000000000 --- a/runtime/service_protocol.h +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2017 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_RUNTIME_SERVICE_PROTOCOL_H_ -#define FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ - -#include -#include -#include -#include - -#include "flutter/fml/task_runner.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/strings/string_view.h" -#include "lib/fxl/synchronization/thread_annotations.h" -#include "third_party/rapidjson/rapidjson/document.h" - -namespace blink { - -class ServiceProtocol { - public: - static const fxl::StringView kScreenshotExtensionName; - static const fxl::StringView kScreenshotSkpExtensionName; - static const fxl::StringView kRunInViewExtensionName; - static const fxl::StringView kFlushUIThreadTasksExtensionName; - static const fxl::StringView kSetAssetBundlePathExtensionName; - - class Handler { - public: - struct Description { - int64_t isolate_port = 0 /* illegal port by default. */; - std::string isolate_name; - - Description() {} - - Description(int64_t p_isolate_port, std::string p_isolate_name) - : isolate_port(p_isolate_port), - isolate_name(std::move(p_isolate_name)) {} - - void Write(Handler* handler, - rapidjson::Value& value, - rapidjson::MemoryPoolAllocator<>& allocator) const; - }; - - using ServiceProtocolMap = std::map; - - virtual fxl::RefPtr GetServiceProtocolHandlerTaskRunner( - fxl::StringView method) const = 0; - - virtual Description GetServiceProtocolDescription() const = 0; - - virtual bool HandleServiceProtocolMessage( - fxl::StringView method, // one if the extension names specified above. - const ServiceProtocolMap& params, - rapidjson::Document& response) = 0; - }; - - ServiceProtocol(); - - ~ServiceProtocol(); - - void ToggleHooks(bool set); - - void AddHandler(Handler* handler); - - void RemoveHandler(Handler* handler); - - private: - const std::set endpoints_; - mutable std::mutex handlers_mutex_; - std::set handlers_; - - FXL_WARN_UNUSED_RESULT - static bool HandleMessage(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - FXL_WARN_UNUSED_RESULT - static bool HandleMessage(fxl::StringView method, - const Handler::ServiceProtocolMap& params, - ServiceProtocol* service_protocol, - rapidjson::Document& response); - FXL_WARN_UNUSED_RESULT - bool HandleMessage(fxl::StringView method, - const Handler::ServiceProtocolMap& params, - rapidjson::Document& response) const; - - FXL_WARN_UNUSED_RESULT - bool HandleListViewsMethod(rapidjson::Document& response) const; - - FXL_DISALLOW_COPY_AND_ASSIGN(ServiceProtocol); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 25edcfa23bd85..f9e25a3c8d6d7 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("$flutter_root/testing/testing.gni") - # Template to generate a dart embedder resource.cc file. # Required invoker inputs: # String output (name of output file) @@ -63,18 +61,18 @@ source_set("common") { "animator.h", "engine.cc", "engine.h", - "io_manager.cc", - "io_manager.h", - "isolate_configuration.cc", - "isolate_configuration.h", + "null_platform_view.cc", + "null_platform_view.h", + "null_rasterizer.cc", + "null_rasterizer.h", "picture_serializer.cc", "picture_serializer.h", "platform_view.cc", "platform_view.h", + "platform_view_service_protocol.cc", + "platform_view_service_protocol.h", "rasterizer.cc", "rasterizer.h", - "run_configuration.cc", - "run_configuration.h", "shell.cc", "shell.h", "skia_event_tracer_impl.cc", @@ -83,8 +81,8 @@ source_set("common") { "surface.h", "switches.cc", "switches.h", - "thread_host.cc", - "thread_host.h", + "tracing_controller.cc", + "tracing_controller.h", "vsync_waiter.cc", "vsync_waiter.h", "vsync_waiter_fallback.cc", @@ -92,6 +90,8 @@ source_set("common") { ] deps = [ + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/platform:libdart_platform", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", @@ -99,13 +99,10 @@ source_set("common") { "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", - "$flutter_root/sky/engine/platform", "$flutter_root/sky/engine/wtf", "$flutter_root/synchronization", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/platform:libdart_platform", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", @@ -115,23 +112,7 @@ source_set("common") { "//topaz/lib/tonic", ] - public_configs = [ "$flutter_root:config" ] -} - -executable("shell_unittests") { - testonly = true - - sources = [ - "shell_unittests.cc", - ] - deps = [ - ":common", - "$flutter_root/fml", - "$flutter_root/lib/snapshot", - "$flutter_root/testing", - "//garnet/public/lib/fxl", - "//third_party/dart/runtime:libdart_jit", - "//third_party/skia", - "//topaz/lib/tonic", + public_configs = [ + "$flutter_root:config", ] } diff --git a/shell/common/animator.cc b/shell/common/animator.cc index 60177a18f89ab..d5679a0160a86 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -4,18 +4,19 @@ #include "flutter/shell/common/animator.h" -#include "flutter/glue/trace_event.h" +#include "flutter/common/threads.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/time/stopwatch.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -Animator::Animator(Delegate& delegate, - blink::TaskRunners task_runners, - std::unique_ptr waiter) - : delegate_(delegate), - task_runners_(std::move(task_runners)), - waiter_(std::move(waiter)), +Animator::Animator(fml::WeakPtr rasterizer, + VsyncWaiter* waiter, + Engine* engine) + : rasterizer_(rasterizer), + waiter_(waiter), + engine_(engine), last_begin_frame_time_(), dart_frame_deadline_(0), layer_tree_pipeline_(fxl::MakeRefCounted(2)), @@ -78,6 +79,7 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, // If we still don't have valid continuation, the pipeline is currently // full because the consumer is being too slow. Try again at the next // frame interval. + TRACE_EVENT_INSTANT0("flutter", "ConsumerSlowDefer"); RequestFrame(); return; } @@ -92,13 +94,13 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, { TRACE_EVENT2("flutter", "Framework Workload", "mode", "basic", "frame", FrameParity()); - delegate_.OnAnimatorBeginFrame(*this, last_begin_frame_time_); + engine_->BeginFrame(last_begin_frame_time_); } if (!frame_scheduled_) { // We don't have another frame pending, so we're waiting on user input // or I/O. Allow the Dart VM 100 ms. - delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_ + 100000); + engine_->NotifyIdle(dart_frame_deadline_ + 100000); } } @@ -118,7 +120,15 @@ void Animator::Render(std::unique_ptr layer_tree) { // Commit the pending continuation. producer_continuation_.Complete(std::move(layer_tree)); - delegate_.OnAnimatorDraw(*this, layer_tree_pipeline_); + blink::Threads::Gpu()->PostTask([ + rasterizer = rasterizer_, pipeline = layer_tree_pipeline_, + frame_id = FrameParity() + ]() { + if (!rasterizer.get()) + return; + TRACE_EVENT2("flutter", "GPU Workload", "mode", "basic", "frame", frame_id); + rasterizer->Draw(pipeline); + }); } bool Animator::CanReuseLastLayerTree() { @@ -127,7 +137,10 @@ bool Animator::CanReuseLastLayerTree() { void Animator::DrawLastLayerTree() { pending_frame_semaphore_.Signal(); - delegate_.OnAnimatorDrawLastLayerTree(*this); + blink::Threads::Gpu()->PostTask([rasterizer = rasterizer_]() { + if (rasterizer.get()) + rasterizer->DrawLastLayerTree(); + }); } void Animator::RequestFrame(bool regenerate_layer_tree) { @@ -151,31 +164,31 @@ void Animator::RequestFrame(bool regenerate_layer_tree) { // started an expensive operation right after posting this message however. // To support that, we need edge triggered wakes on VSync. - task_runners_.GetUITaskRunner()->PostTask([self = weak_factory_.GetWeakPtr(), - frame_number = frame_number_]() { - if (!self.get()) { - return; - } - TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", frame_number); - self->AwaitVSync(); - }); + blink::Threads::UI()->PostTask( + [ self = weak_factory_.GetWeakPtr(), frame_number = frame_number_ ]() { + if (!self.get()) { + return; + } + TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", + frame_number); + self->AwaitVSync(); + }); frame_scheduled_ = true; } void Animator::AwaitVSync() { - waiter_->AsyncWaitForVsync( - [self = weak_factory_.GetWeakPtr()](fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time) { - if (self) { - if (self->CanReuseLastLayerTree()) { - self->DrawLastLayerTree(); - } else { - self->BeginFrame(frame_start_time, frame_target_time); - } - } - }); + waiter_->AsyncWaitForVsync([self = weak_factory_.GetWeakPtr()]( + fxl::TimePoint frame_start_time, fxl::TimePoint frame_target_time) { + if (self) { + if (self->CanReuseLastLayerTree()) { + self->DrawLastLayerTree(); + } else { + self->BeginFrame(frame_start_time, frame_target_time); + } + } + }); - delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_); + engine_->NotifyIdle(dart_frame_deadline_); } } // namespace shell diff --git a/shell/common/animator.h b/shell/common/animator.h index 53b2ac6884158..bc2ee21441b29 100644 --- a/shell/common/animator.h +++ b/shell/common/animator.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_SHELL_COMMON_ANIMATOR_H_ #define FLUTTER_SHELL_COMMON_ANIMATOR_H_ -#include "flutter/common/task_runners.h" +#include "flutter/shell/common/engine.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/vsync_waiter.h" #include "flutter/synchronization/pipeline.h" @@ -16,29 +16,18 @@ namespace shell { -class Animator final { +class Animator { public: - class Delegate { - public: - virtual void OnAnimatorBeginFrame(const Animator& animator, - fxl::TimePoint frame_time) = 0; - - virtual void OnAnimatorNotifyIdle(const Animator& animator, - int64_t deadline) = 0; - - virtual void OnAnimatorDraw( - const Animator& animator, - fxl::RefPtr> pipeline) = 0; - - virtual void OnAnimatorDrawLastLayerTree(const Animator& animator) = 0; - }; - - Animator(Delegate& delegate, - blink::TaskRunners task_runners, - std::unique_ptr waiter); + Animator(fml::WeakPtr rasterizer, + VsyncWaiter* waiter, + Engine* engine); ~Animator(); + void set_rasterizer(fml::WeakPtr rasterizer) { + rasterizer_ = rasterizer; + } + void RequestFrame(bool regenerate_layer_tree = true); void Render(std::unique_ptr layer_tree); @@ -62,9 +51,9 @@ class Animator final { const char* FrameParity(); - Delegate& delegate_; - blink::TaskRunners task_runners_; - std::unique_ptr waiter_; + fml::WeakPtr rasterizer_; + VsyncWaiter* waiter_; + Engine* engine_; fxl::TimePoint last_begin_frame_time_; int64_t dart_frame_deadline_; @@ -78,7 +67,7 @@ class Animator final { bool dimension_change_pending_; SkISize last_layer_tree_size_; - fxl::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(Animator); }; diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 3d6fd496d3fa9..3629b729c29f7 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -4,20 +4,47 @@ #include "flutter/shell/common/engine.h" +#if OS(WIN) +#include +#include +#define access _access +#define R_OK 0x4 + +#ifndef S_ISDIR +#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#endif + +#ifndef S_ISREG +#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) +#endif + +#else +#include +#include +#include +#endif // OS(WIN) + +#include +#include #include #include +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/unzipper_provider.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/assets/asset_provider.h" #include "flutter/common/settings.h" +#include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/runtime/asset_font_selector.h" -#include "flutter/runtime/platform_impl.h" +#include "flutter/runtime/dart_controller.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/runtime/runtime_init.h" #include "flutter/runtime/test_font_selector.h" #include "flutter/shell/common/animator.h" #include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" #include "flutter/sky/engine/public/web/Sky.h" #include "lib/fxl/files/eintr_wrapper.h" #include "lib/fxl/files/file.h" @@ -28,208 +55,380 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" -#ifdef ERROR -#undef ERROR +namespace shell { +namespace { + +constexpr char kAssetChannel[] = "flutter/assets"; +constexpr char kLifecycleChannel[] = "flutter/lifecycle"; +constexpr char kNavigationChannel[] = "flutter/navigation"; +constexpr char kLocalizationChannel[] = "flutter/localization"; +constexpr char kSettingsChannel[] = "flutter/settings"; + +#if OS(WIN) +void FindAndReplaceInPlace(std::string& str, + const std::string& findStr, + const std::string& replaceStr) { + size_t pos = 0; + while ((pos = str.find(findStr, pos)) != std::string::npos) { + str.replace(pos, findStr.length(), replaceStr); + pos += replaceStr.length(); + } +} #endif -namespace shell { +std::string SanitizePath(const std::string& path) { +#if OS(WIN) + std::string sanitized = path; + FindAndReplaceInPlace(sanitized, "\\\\", "/"); + if ((sanitized.length() > 2) && (sanitized[1] == ':')) { + // Path begins with a drive letter. + sanitized = '/' + sanitized; + } + return sanitized; +#else + return path; +#endif +} -static constexpr char kAssetChannel[] = "flutter/assets"; -static constexpr char kLifecycleChannel[] = "flutter/lifecycle"; -static constexpr char kNavigationChannel[] = "flutter/navigation"; -static constexpr char kLocalizationChannel[] = "flutter/localization"; -static constexpr char kSettingsChannel[] = "flutter/settings"; - -Engine::Engine(Delegate& delegate, - const blink::DartVM& vm, - blink::TaskRunners task_runners, - blink::Settings settings, - std::unique_ptr animator, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue) - : delegate_(delegate), - settings_(std::move(settings)), - animator_(std::move(animator)), - legacy_sky_platform_(settings_.using_blink ? new blink::PlatformImpl() - : nullptr), - load_script_error_(tonic::kNoError), - activity_running_(false), - have_surface_(false), - weak_factory_(this) { - weak_prototype_ = weak_factory_.GetWeakPtr(); +bool PathExists(const std::string& path) { + return access(path.c_str(), R_OK) == 0; +} - if (legacy_sky_platform_) { - // TODO: Remove this legacy call along with the platform. This is what makes - // the engine unable to run from multiple threads in the legacy - // configuration. - blink::InitEngine(legacy_sky_platform_.get()); +std::string FindPackagesPath(const std::string& main_dart) { + std::string directory = files::GetDirectoryName(main_dart); + std::string packages_path = directory + "/.packages"; + if (!PathExists(packages_path)) { + directory = files::GetDirectoryName(directory); + packages_path = directory + "/.packages"; + if (!PathExists(packages_path)) + packages_path = std::string(); } + return packages_path; +} - // Runtime controller is initialized here because it takes a reference to this - // object as its delegate. The delegate may be called in the constructor and - // we want to be fully initilazed by that point. - runtime_controller_ = std::make_unique( - *this, // runtime delegate - &vm, // VM - std::move(task_runners), // task runners - std::move(resource_context), // resource context - std::move(unref_queue) // skia unref queue - ); +std::string GetScriptUriFromPath(const std::string& path) { + return "file://" + SanitizePath(path); } -Engine::~Engine() { - if (legacy_sky_platform_) { - blink::ShutdownEngine(/* legacy_sky_platform_ */); - } +} // namespace + +Engine::Engine(PlatformView* platform_view) + : platform_view_(platform_view->GetWeakPtr()), + animator_(std::make_unique( + platform_view->rasterizer().GetWeakRasterizerPtr(), + platform_view->GetVsyncWaiter(), + this)), + load_script_error_(tonic::kNoError), + user_settings_data_("{}"), + activity_running_(false), + have_surface_(false), + weak_factory_(this) {} + +Engine::~Engine() {} + +void Engine::set_rasterizer(fml::WeakPtr rasterizer) { + animator_->set_rasterizer(rasterizer); } -fml::WeakPtr Engine::GetWeakPtr() const { - return weak_prototype_; +fml::WeakPtr Engine::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); } -bool Engine::UpdateAssetManager( - fxl::RefPtr new_asset_manager) { - if (asset_manager_ == new_asset_manager) { - return false; +#if !FLUTTER_AOT +#elif OS(IOS) +#elif OS(ANDROID) +// TODO(bkonyi): do we even get here for Windows? +static const uint8_t* MemMapSnapshot(const std::string& aot_snapshot_path, + const std::string& default_file_name, + const std::string& settings_file_name, + bool executable) { + std::string asset_path; + if (settings_file_name.empty()) { + asset_path = aot_snapshot_path + "/" + default_file_name; + } else { + asset_path = aot_snapshot_path + "/" + settings_file_name; } - asset_manager_ = new_asset_manager; +#if OS(WIN) + HANDLE file_handle_ = + CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, + FILE_SHARE_READ, nullptr, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); - if (!asset_manager_) { - return false; + if (file_handle_ == INVALID_HANDLE_VALUE) { + return; } - if (settings_.using_blink) { - // Using blink as the text engine. - blink::FontFallbackList::SetUseTestFonts(settings_.use_test_fonts); - } else { - // Using libTXT as the text engine. - if (settings_.use_test_fonts) { - blink::FontCollection::ForProcess().RegisterTestFonts(); - } else { - blink::FontCollection::ForProcess().RegisterFonts(*asset_manager_.get()); - } + size_ = GetFileSize(file_handle_, nullptr); + if (size_ == INVALID_FILE_SIZE) { + size_ = 0; + return; } - return true; -} + int mapping_flags = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; + mapping_handle_ = CreateFileMapping(file_handle_, nullptr, mapping_flags, 0, + size_, nullptr); -bool Engine::Restart(RunConfiguration configuration) { - TRACE_EVENT0("flutter", "Engine::Restart"); - if (!configuration.IsValid()) { - FXL_LOG(ERROR) << "Engine run configuration was invalid."; - return false; - } - runtime_controller_ = runtime_controller_->Clone(); - UpdateAssetManager(nullptr); - return Run(std::move(configuration)); -} + CloseHandle(file_handle_); -bool Engine::Run(RunConfiguration configuration) { - if (!configuration.IsValid()) { - FXL_LOG(ERROR) << "Engine run configuration was invalid."; - return false; + if (mapping_handle_ == INVALID_HANDLE_VALUE) { + return; } - if (!PrepareAndLaunchIsolate(std::move(configuration))) { - return false; + int access_flags = FILE_MAP_READ; + if (executable) { + access_flags |= FILE_MAP_EXECUTE; } + auto mapping = MapViewOfFile(mapping_handle_, access_flags, 0, 0, size_); - auto isolate = runtime_controller_->GetRootIsolate(); + if (mapping == INVALID_HANDLE_VALUE) { + CloseHandle(mapping_handle_); + mapping_handle_ = INVALID_HANDLE_VALUE; + return; + } - bool isolate_running = - isolate && isolate->GetPhase() == blink::DartIsolate::Phase::Running; + void* symbol = static_cast(mapping); + if (symbol == NULL) { + return nullptr; + } +#else + struct stat info; + if (stat(asset_path.c_str(), &info) < 0) { + return nullptr; + } + int64_t asset_size = info.st_size; - if (isolate_running) { - tonic::DartState::Scope scope(isolate.get()); + fxl::UniqueFD fd(HANDLE_EINTR(open(asset_path.c_str(), O_RDONLY))); + if (fd.get() == -1) { + return nullptr; + } - if (settings_.root_isolate_create_callback) { - settings_.root_isolate_create_callback(); - } + int mmap_flags = PROT_READ; + if (executable) + mmap_flags |= PROT_EXEC; - if (settings_.root_isolate_shutdown_callback) { - isolate->AddIsolateShutdownCallback( - settings_.root_isolate_shutdown_callback); - } + void* symbol = mmap(NULL, asset_size, mmap_flags, MAP_PRIVATE, fd.get(), 0); + if (symbol == MAP_FAILED) { + return nullptr; + } +#endif + return reinterpret_cast(symbol); +} +#endif - // Blink uses a per isolate font selector. - if (settings_.using_blink) { - if (settings_.use_test_fonts) { - blink::TestFontSelector::Install(); - } else { - blink::AssetFontSelector::Install(asset_manager_); - } +static const uint8_t* default_isolate_snapshot_data = nullptr; +static const uint8_t* default_isolate_snapshot_instr = nullptr; + +void Engine::Init(const std::string& bundle_path) { + const uint8_t* vm_snapshot_data; + const uint8_t* vm_snapshot_instr; +#if !FLUTTER_AOT + vm_snapshot_data = ::kDartVmSnapshotData; + vm_snapshot_instr = ::kDartVmSnapshotInstructions; + default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; + default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; +#elif OS(IOS) + const char* kDartApplicationLibraryPath = "App.framework/App"; + const char* application_library_path = kDartApplicationLibraryPath; + const blink::Settings& settings = blink::Settings::Get(); + const std::string& application_library_path_setting = + settings.application_library_path; + if (!application_library_path_setting.empty()) { + application_library_path = application_library_path_setting.c_str(); + } + dlerror(); // clear previous errors on thread + void* library_handle = dlopen(application_library_path, RTLD_NOW); + const char* err = dlerror(); + if (err != nullptr) { + FXL_LOG(FATAL) << "dlopen failed: " << err; + } + vm_snapshot_data = reinterpret_cast( + dlsym(library_handle, "kDartVmSnapshotData")); + vm_snapshot_instr = reinterpret_cast( + dlsym(library_handle, "kDartVmSnapshotInstructions")); + default_isolate_snapshot_data = reinterpret_cast( + dlsym(library_handle, "kDartIsolateSnapshotData")); + default_isolate_snapshot_instr = reinterpret_cast( + dlsym(library_handle, "kDartIsolateSnapshotInstructions")); +#elif OS(ANDROID) || OS(WIN) + const blink::Settings& settings = blink::Settings::Get(); + const std::string& aot_shared_library_path = settings.aot_shared_library_path; + const std::string& aot_snapshot_path = settings.aot_snapshot_path; + + if (!aot_shared_library_path.empty()) { + FXL_CHECK(aot_snapshot_path.empty()); + dlerror(); // clear previous errors on thread + void* library_handle = dlopen(aot_shared_library_path.c_str(), RTLD_NOW); + const char* err = dlerror(); + if (err != nullptr) { + FXL_LOG(FATAL) << "dlopen failed: " << err; } + vm_snapshot_data = reinterpret_cast( + dlsym(library_handle, "_kDartVmSnapshotData")); + vm_snapshot_instr = reinterpret_cast( + dlsym(library_handle, "_kDartVmSnapshotInstructions")); + default_isolate_snapshot_data = reinterpret_cast( + dlsym(library_handle, "_kDartIsolateSnapshotData")); + default_isolate_snapshot_instr = reinterpret_cast( + dlsym(library_handle, "_kDartIsolateSnapshotInstructions")); + } else { + FXL_CHECK(!aot_snapshot_path.empty()); + vm_snapshot_data = + MemMapSnapshot(aot_snapshot_path, "vm_snapshot_data", + settings.aot_vm_snapshot_data_filename, false); + vm_snapshot_instr = + MemMapSnapshot(aot_snapshot_path, "vm_snapshot_instr", + settings.aot_vm_snapshot_instr_filename, true); + default_isolate_snapshot_data = + MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_data", + settings.aot_isolate_snapshot_data_filename, false); + default_isolate_snapshot_instr = + MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_instr", + settings.aot_isolate_snapshot_instr_filename, true); } - - return isolate_running; +#else +#error Unknown OS +#endif + blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, + default_isolate_snapshot_data, + default_isolate_snapshot_instr, bundle_path); } -bool Engine::PrepareAndLaunchIsolate(RunConfiguration configuration) { - TRACE_EVENT0("flutter", "Engine::PrepareAndLaunchIsolate"); +const std::string Engine::main_entrypoint_ = "main"; - UpdateAssetManager(configuration.GetAssetManager()); - - auto isolate_configuration = configuration.TakeIsolateConfiguration(); - - auto isolate = runtime_controller_->GetRootIsolate(); +void Engine::RunBundle(const std::string& bundle_path, + const std::string& entrypoint, + bool reuse_runtime_controller) { + TRACE_EVENT0("flutter", "Engine::RunBundle"); + ConfigureAssetBundle(bundle_path); + DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, + reuse_runtime_controller); +} - if (!isolate_configuration->PrepareIsolate(isolate)) { - FXL_DLOG(ERROR) << "Could not prepare to run the isolate."; - return false; +void Engine::DoRunBundle(const std::string& script_uri, + const std::string& entrypoint, + bool reuse_runtime_controller) { + ConfigureRuntime(script_uri, reuse_runtime_controller); + if (blink::IsRunningPrecompiledCode()) { + runtime_->dart_controller()->RunFromPrecompiledSnapshot(entrypoint); + } else { + std::vector kernel; + if (GetAssetAsBuffer(blink::kKernelAssetKey, &kernel)) { + runtime_->dart_controller()->RunFromKernel(kernel, entrypoint); + return; + } + std::vector snapshot; + if (!GetAssetAsBuffer(blink::kSnapshotAssetKey, &snapshot)) + return; + runtime_->dart_controller()->RunFromScriptSnapshot( + snapshot.data(), snapshot.size(), entrypoint); } +} - if (!isolate->Run(configuration.GetEntrypoint())) { - FXL_DLOG(ERROR) << "Could not run the isolate."; - return false; +// TODO(jsimmons): merge this with RunBundle +void Engine::RunBundleWithAssets( + fxl::RefPtr asset_provider, + const std::string& bundle_path, + const std::string& entrypoint, + bool reuse_runtime_controller) { + TRACE_EVENT0("flutter", "Engine::RunBundleWithAssets"); + asset_provider_ = asset_provider; + DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, + reuse_runtime_controller); +} + +void Engine::RunBundleAndSource(const std::string& bundle_path, + const std::string& main, + const std::string& packages, + bool reuse_runtime_controller) { + TRACE_EVENT0("flutter", "Engine::RunBundleAndSource"); + FXL_CHECK(!blink::IsRunningPrecompiledCode()) + << "Cannot run from source in a precompiled build."; + std::string packages_path = packages; + if (packages_path.empty()) + packages_path = FindPackagesPath(main); + + if (!bundle_path.empty()) + ConfigureAssetBundle(bundle_path); + + ConfigureRuntime(main, reuse_runtime_controller); + + if (blink::GetKernelPlatformBinary() != nullptr) { + std::vector kernel; + if (!files::ReadFileToVector(main, &kernel)) { + load_script_error_ = tonic::kUnknownErrorType; + } + load_script_error_ = runtime_->dart_controller()->RunFromKernel(kernel); + } else { + load_script_error_ = + runtime_->dart_controller()->RunFromSource(main, packages_path); } - - return true; } void Engine::BeginFrame(fxl::TimePoint frame_time) { TRACE_EVENT0("flutter", "Engine::BeginFrame"); - runtime_controller_->BeginFrame(frame_time); + if (runtime_) + runtime_->BeginFrame(frame_time); } void Engine::NotifyIdle(int64_t deadline) { TRACE_EVENT0("flutter", "Engine::NotifyIdle"); - runtime_controller_->NotifyIdle(deadline); + if (runtime_) + runtime_->NotifyIdle(deadline); +} + +void Engine::RunFromSource(const std::string& main, + const std::string& packages, + const std::string& bundle_path) { + RunBundleAndSource(bundle_path, main, packages); } -std::pair Engine::GetUIIsolateReturnCode() { - return runtime_controller_->GetRootIsolateReturnCode(); +void Engine::SetAssetBundlePath(const std::string& bundle_path) { + TRACE_EVENT0("flutter", "Engine::SetAssetBundlePath"); + ConfigureAssetBundle(bundle_path); } Dart_Port Engine::GetUIIsolateMainPort() { - return runtime_controller_->GetMainPort(); + if (!runtime_) + return ILLEGAL_PORT; + return runtime_->GetMainPort(); } std::string Engine::GetUIIsolateName() { - return runtime_controller_->GetIsolateName(); + if (!runtime_) { + return ""; + } + return runtime_->GetIsolateName(); } bool Engine::UIIsolateHasLivePorts() { - return runtime_controller_->HasLivePorts(); + if (!runtime_) + return false; + return runtime_->HasLivePorts(); } tonic::DartErrorHandleType Engine::GetUIIsolateLastError() { - return runtime_controller_->GetLastError(); + if (!runtime_) + return tonic::kNoError; + return runtime_->GetLastError(); } tonic::DartErrorHandleType Engine::GetLoadScriptError() { return load_script_error_; } -void Engine::OnOutputSurfaceCreated() { +void Engine::OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation) { + blink::Threads::Gpu()->PostTask(gpu_continuation); have_surface_ = true; StartAnimatorIfPossible(); - ScheduleFrame(); + if (runtime_) + ScheduleFrame(); } -void Engine::OnOutputSurfaceDestroyed() { +void Engine::OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation) { have_surface_ = false; StopAnimator(); + blink::Threads::Gpu()->PostTask(gpu_continuation); } void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { @@ -237,7 +436,8 @@ void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { viewport_metrics_.physical_height != metrics.physical_height || viewport_metrics_.physical_width != metrics.physical_width; viewport_metrics_ = metrics; - runtime_controller_->SetViewportMetrics(viewport_metrics_); + if (runtime_) + runtime_->SetViewportMetrics(viewport_metrics_); if (animator_) { if (dimensions_changed) animator_->SetDimensionChangePending(); @@ -259,7 +459,8 @@ void Engine::DispatchPlatformMessage( return; } - if (runtime_controller_->DispatchPlatformMessage(std::move(message))) { + if (runtime_) { + runtime_->DispatchPlatformMessage(std::move(message)); return; } @@ -292,6 +493,7 @@ bool Engine::HandleLifecyclePlatformMessage(blink::PlatformMessage* message) { bool Engine::HandleNavigationPlatformMessage( fxl::RefPtr message) { + FXL_DCHECK(!runtime_); const auto& data = message->data(); rapidjson::Document document; @@ -330,33 +532,99 @@ bool Engine::HandleLocalizationPlatformMessage( if (!language.IsString() || !country.IsString()) return false; - return runtime_controller_->SetLocale(language.GetString(), - country.GetString()); + language_code_ = language.GetString(); + country_code_ = country.GetString(); + if (runtime_) + runtime_->SetLocale(language_code_, country_code_); + return true; } void Engine::HandleSettingsPlatformMessage(blink::PlatformMessage* message) { const auto& data = message->data(); std::string jsonData(reinterpret_cast(data.data()), data.size()); - if (runtime_controller_->SetUserSettingsData(std::move(jsonData)) && - have_surface_) { - ScheduleFrame(); + user_settings_data_ = jsonData; + if (runtime_) { + runtime_->SetUserSettingsData(user_settings_data_); + if (have_surface_) + ScheduleFrame(); } } -void Engine::DispatchPointerDataPacket(const blink::PointerDataPacket& packet) { - runtime_controller_->DispatchPointerDataPacket(packet); +void Engine::DispatchPointerDataPacket(const PointerDataPacket& packet) { + if (runtime_) + runtime_->DispatchPointerDataPacket(packet); } void Engine::DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args) { - runtime_controller_->DispatchSemanticsAction(id, action, std::move(args)); + if (runtime_) + runtime_->DispatchSemanticsAction(id, action, std::move(args)); } void Engine::SetSemanticsEnabled(bool enabled) { - runtime_controller_->SetSemanticsEnabled(enabled); + semantics_enabled_ = enabled; + if (runtime_) + runtime_->SetSemanticsEnabled(semantics_enabled_); +} + +void Engine::ConfigureAssetBundle(const std::string& path) { + asset_provider_ = fxl::MakeRefCounted(path); + + struct stat stat_result = {}; + + // TODO(abarth): We should reset directory_asset_bundle_, but that might break + // custom font loading in hot reload. + + if (::stat(path.c_str(), &stat_result) != 0) { + FXL_LOG(INFO) << "Could not configure asset bundle at path: " << path; + return; + } + + std::string flx_path; + if (S_ISDIR(stat_result.st_mode)) { + flx_path = files::GetDirectoryName(path) + "/app.flx"; + } else if (S_ISREG(stat_result.st_mode)) { + flx_path = path; + } + + if (PathExists(flx_path)) { + asset_store_ = fxl::MakeRefCounted( + blink::GetUnzipperProviderForPath(flx_path)); + } +} + +void Engine::ConfigureRuntime(const std::string& script_uri, + bool reuse_runtime_controller) { + if (runtime_ && reuse_runtime_controller) { + return; + } + runtime_ = blink::RuntimeController::Create(this); + runtime_->CreateDartController(std::move(script_uri), + default_isolate_snapshot_data, + default_isolate_snapshot_instr); + runtime_->SetViewportMetrics(viewport_metrics_); + runtime_->SetLocale(language_code_, country_code_); + runtime_->SetUserSettingsData(user_settings_data_); + runtime_->SetSemanticsEnabled(semantics_enabled_); +} + +void Engine::DidCreateMainIsolate(Dart_Isolate isolate) { + if (blink::Settings::Get().use_test_fonts) { + blink::TestFontSelector::Install(); + if (!blink::Settings::Get().using_blink) + blink::FontCollection::ForProcess().RegisterTestFonts(); + } else if (asset_provider_) { + blink::AssetFontSelector::Install(asset_provider_); + if (!blink::Settings::Get().using_blink) { + blink::FontCollection::ForProcess().RegisterFontsFromAssetProvider( + asset_provider_); + } + } } +void Engine::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} + void Engine::StopAnimator() { animator_->Stop(); } @@ -391,34 +659,49 @@ void Engine::Render(std::unique_ptr layer_tree) { } void Engine::UpdateSemantics(blink::SemanticsNodeUpdates update) { - delegate_.OnEngineUpdateSemantics(*this, std::move(update)); + blink::Threads::Platform()->PostTask(fxl::MakeCopyable([ + platform_view = platform_view_.lock(), update = std::move(update) + ]() mutable { + if (platform_view) + platform_view->UpdateSemantics(std::move(update)); + })); } void Engine::HandlePlatformMessage( fxl::RefPtr message) { if (message->channel() == kAssetChannel) { HandleAssetPlatformMessage(std::move(message)); - } else { - delegate_.OnEngineHandlePlatformMessage(*this, std::move(message)); + return; } + blink::Threads::Platform()->PostTask([ + platform_view = platform_view_.lock(), message = std::move(message) + ]() mutable { + if (platform_view) + platform_view->HandlePlatformMessage(std::move(message)); + }); } void Engine::HandleAssetPlatformMessage( fxl::RefPtr message) { fxl::RefPtr response = message->response(); - if (!response) { + if (!response) return; - } const auto& data = message->data(); std::string asset_name(reinterpret_cast(data.data()), data.size()); - std::vector asset_data; - if (asset_manager_ && asset_manager_->GetAsBuffer(asset_name, &asset_data)) { + if (GetAssetAsBuffer(asset_name, &asset_data)) { response->Complete(std::move(asset_data)); } else { response->CompleteEmpty(); } } +bool Engine::GetAssetAsBuffer(const std::string& name, + std::vector* data) { + return ((asset_provider_ && + asset_provider_->GetAsBuffer(name, data)) || + (asset_store_ && asset_store_->GetAsBuffer(name, data))); +} + } // namespace shell diff --git a/shell/common/engine.h b/shell/common/engine.h index ede442ee3e8a4..a0c5183338a43 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -5,144 +5,131 @@ #ifndef SHELL_COMMON_ENGINE_H_ #define SHELL_COMMON_ENGINE_H_ -#include -#include - -#include "flutter/assets/asset_manager.h" -#include "flutter/common/task_runners.h" -#include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/assets/asset_provider.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/runtime/dart_vm.h" -#include "flutter/runtime/platform_impl.h" #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" -#include "flutter/shell/common/animator.h" #include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/run_configuration.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkPicture.h" +namespace blink { +class DirectoryAssetBundle; +class ZipAssetBundle; +} // namespace blink + namespace shell { +class PlatformView; +class Animator; +using PointerDataPacket = blink::PointerDataPacket; -class Engine final : public blink::RuntimeDelegate { +class Engine : public blink::RuntimeDelegate { public: - class Delegate { - public: - virtual void OnEngineUpdateSemantics( - const Engine& engine, - blink::SemanticsNodeUpdates update) = 0; - - virtual void OnEngineHandlePlatformMessage( - const Engine& engine, - fxl::RefPtr message) = 0; - }; - - Engine(Delegate& delegate, - const blink::DartVM& vm, - blink::TaskRunners task_runners, - blink::Settings settings, - std::unique_ptr animator, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue); + explicit Engine(PlatformView* platform_view); ~Engine() override; - fml::WeakPtr GetWeakPtr() const; + fml::WeakPtr GetWeakPtr(); - FXL_WARN_UNUSED_RESULT - bool Run(RunConfiguration configuration); + static void Init(const std::string& bundle_path); - // Used to "cold reload" a running application where the shell (along with the - // platform view and its rasterizer bindings) remains the same but the root - // isolate is torn down and restarted with the new configuration. Only used in - // the development workflow. - FXL_WARN_UNUSED_RESULT - bool Restart(RunConfiguration configuration); + void RunBundle(const std::string& bundle_path, + const std::string& entrypoint = main_entrypoint_, + bool reuse_runtime_controller = false); - bool UpdateAssetManager(fxl::RefPtr asset_manager); + // Uses the given provider to locate assets. + void RunBundleWithAssets(fxl::RefPtr asset_provider, + const std::string& bundle_path, + const std::string& entrypoint = main_entrypoint_, + bool reuse_runtime_controller = false); - void BeginFrame(fxl::TimePoint frame_time); + // Uses the given source code instead of looking inside the bundle for the + // source code. + void RunBundleAndSource(const std::string& bundle_path, + const std::string& main, + const std::string& packages, + bool reuse_runtime_controller = false); + void BeginFrame(fxl::TimePoint frame_time); void NotifyIdle(int64_t deadline); - Dart_Port GetUIIsolateMainPort(); + void RunFromSource(const std::string& main, + const std::string& packages, + const std::string& bundle); + void SetAssetBundlePath(const std::string& bundle_path); + Dart_Port GetUIIsolateMainPort(); std::string GetUIIsolateName(); - bool UIIsolateHasLivePorts(); - tonic::DartErrorHandleType GetUIIsolateLastError(); - tonic::DartErrorHandleType GetLoadScriptError(); - std::pair GetUIIsolateReturnCode(); - - void OnOutputSurfaceCreated(); - - void OnOutputSurfaceDestroyed(); - + void OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation); + void OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation); void SetViewportMetrics(const blink::ViewportMetrics& metrics); - void DispatchPlatformMessage(fxl::RefPtr message); - - void DispatchPointerDataPacket(const blink::PointerDataPacket& packet); - + void DispatchPointerDataPacket(const PointerDataPacket& packet); void DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args); - void SetSemanticsEnabled(bool enabled); - void ScheduleFrame(bool regenerate_layer_tree = true) override; - private: - Engine::Delegate& delegate_; - const blink::Settings settings_; - std::unique_ptr animator_; - std::unique_ptr runtime_controller_; - std::unique_ptr legacy_sky_platform_; - tonic::DartErrorHandleType load_script_error_; - std::string initial_route_; - blink::ViewportMetrics viewport_metrics_; - fxl::RefPtr asset_manager_; - bool activity_running_; - bool have_surface_; - fml::WeakPtr weak_prototype_; - fml::WeakPtrFactory weak_factory_; + void set_rasterizer(fml::WeakPtr rasterizer); - // |blink::RuntimeDelegate| + private: + // RuntimeDelegate methods: std::string DefaultRouteName() override; - - // |blink::RuntimeDelegate| void Render(std::unique_ptr layer_tree) override; - - // |blink::RuntimeDelegate| void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - // |blink::RuntimeDelegate| void HandlePlatformMessage( fxl::RefPtr message) override; + void DidCreateMainIsolate(Dart_Isolate isolate) override; + void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; void StopAnimator(); - void StartAnimatorIfPossible(); - bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message); + void DoRunBundle(const std::string& script_uri, + const std::string& entrypoint, + bool reuse_runtime_controller); + void ConfigureAssetBundle(const std::string& path); + void ConfigureRuntime(const std::string& script_uri, + bool reuse_runtime_controller = false); + + bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message); bool HandleNavigationPlatformMessage( fxl::RefPtr message); - bool HandleLocalizationPlatformMessage(blink::PlatformMessage* message); - void HandleSettingsPlatformMessage(blink::PlatformMessage* message); void HandleAssetPlatformMessage(fxl::RefPtr message); - bool GetAssetAsBuffer(const std::string& name, std::vector* data); - bool PrepareAndLaunchIsolate(RunConfiguration configuration); + static const std::string main_entrypoint_; + + fxl::RefPtr asset_provider_; + std::weak_ptr platform_view_; + std::unique_ptr animator_; + std::unique_ptr runtime_; + tonic::DartErrorHandleType load_script_error_; + std::string initial_route_; + blink::ViewportMetrics viewport_metrics_; + std::string language_code_; + std::string country_code_; + std::string user_settings_data_; + bool semantics_enabled_ = false; + // TODO(zarah): Remove usage of asset_store_ once app.flx is removed. + fxl::RefPtr asset_store_; + fxl::RefPtr directory_asset_bundle_; + // TODO(eseidel): This should move into an AnimatorStateMachine. + bool activity_running_; + bool have_surface_; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(Engine); }; diff --git a/shell/common/io_manager.cc b/shell/common/io_manager.cc deleted file mode 100644 index 4161422978fcf..0000000000000 --- a/shell/common/io_manager.cc +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2017 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/shell/common/io_manager.h" - -#include "flutter/fml/message_loop.h" -#include "third_party/skia/include/gpu/gl/GrGLInterface.h" - -namespace shell { - -sk_sp IOManager::CreateCompatibleResourceLoadingContext( - GrBackend backend) { - if (backend != GrBackend::kOpenGL_GrBackend) { - return nullptr; - } - - GrContextOptions options = {}; - - // There is currently a bug with doing GPU YUV to RGB conversions on the IO - // thread. The necessary work isn't being flushed or synchronized with the - // other threads correctly, so the textures end up blank. For now, suppress - // that feature, which will cause texture uploads to do CPU YUV conversion. - options.fDisableGpuYUVConversion = true; - - if (auto context = GrContext::MakeGL(GrGLMakeNativeInterface(), options)) { - // Do not cache textures created by the image decoder. These textures - // should be deleted when they are no longer referenced by an SkImage. - context->setResourceCacheLimits(0, 0); - return context; - } - - return nullptr; -} - -IOManager::IOManager(sk_sp resource_context, - fxl::RefPtr unref_queue_task_runner) - : resource_context_(std::move(resource_context)), - resource_context_weak_factory_( - resource_context_ ? std::make_unique>( - resource_context_.get()) - : nullptr), - unref_queue_(fxl::MakeRefCounted( - std::move(unref_queue_task_runner), - fxl::TimeDelta::FromMilliseconds(250))), - weak_factory_(this) { - if (!resource_context_) { - FXL_DLOG(WARNING) << "The IO manager was initialized without a resource " - "context. Async texture uploads will be disabled. " - "Expect performance degradation."; - } - - if (resource_context_weak_factory_) { - resource_context_weak_prototype_ = - resource_context_weak_factory_->GetWeakPtr(); - } -} - -IOManager::~IOManager() { - // Last chance to drain the IO queue as the platform side reference to the - // underlying OpenGL context may be going away. - unref_queue_->Drain(); -} - -fml::WeakPtr IOManager::GetResourceContext() const { - return resource_context_weak_prototype_; -} - -fxl::RefPtr IOManager::GetSkiaUnrefQueue() const { - return unref_queue_; -} - -} // namespace shell diff --git a/shell/common/io_manager.h b/shell/common/io_manager.h deleted file mode 100644 index 1077a28d0ae36..0000000000000 --- a/shell/common/io_manager.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2017 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_SHELL_COMMON_IO_MANAGER_H_ -#define FLUTTER_SHELL_COMMON_IO_MANAGER_H_ - -#include - -#include "flutter/flow/skia_gpu_object.h" -#include "flutter/fml/memory/weak_ptr.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "third_party/skia/include/gpu/GrContext.h" - -namespace shell { - -class IOManager { - public: - // Convenience methods for platforms to create a GrContext used to supply to - // the IOManager. The platforms may create the context themselves if they so - // desire. - static sk_sp CreateCompatibleResourceLoadingContext( - GrBackend backend); - - IOManager(sk_sp resource_context, - fxl::RefPtr unref_queue_task_runner); - - ~IOManager(); - - fml::WeakPtr GetResourceContext() const; - - fxl::RefPtr GetSkiaUnrefQueue() const; - - private: - // Resource context management. - sk_sp resource_context_; - fml::WeakPtr resource_context_weak_prototype_; - std::unique_ptr> - resource_context_weak_factory_; - - // Unref queue management. - fxl::RefPtr unref_queue_; - - fml::WeakPtrFactory weak_factory_; - - FXL_DISALLOW_COPY_AND_ASSIGN(IOManager); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_IO_MANAGER_H_ diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc deleted file mode 100644 index 0706ee5ab58df..0000000000000 --- a/shell/common/isolate_configuration.cc +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2018 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/shell/common/isolate_configuration.h" - -#include "flutter/runtime/dart_vm.h" - -namespace shell { - -IsolateConfiguration::IsolateConfiguration() = default; - -IsolateConfiguration::~IsolateConfiguration() = default; - -bool IsolateConfiguration::PrepareIsolate( - fml::WeakPtr isolate) { - if (!isolate) { - return false; - } - - if (isolate->GetPhase() != blink::DartIsolate::Phase::LibrariesSetup) { - FXL_DLOG(ERROR) - << "Isolate was in incorrect phase to be prepared for running."; - return false; - } - - return DoPrepareIsolate(*isolate); -} - -class PrecompiledIsolateConfiguration final : public IsolateConfiguration { - public: - PrecompiledIsolateConfiguration() = default; - - // |shell::IsolateConfiguration| - bool DoPrepareIsolate(blink::DartIsolate& isolate) override { - if (!blink::DartVM::IsRunningPrecompiledCode()) { - return false; - } - return isolate.PrepareForRunningFromPrecompiledCode(); - } - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(PrecompiledIsolateConfiguration); -}; - -class SnapshotIsolateConfiguration : public IsolateConfiguration { - public: - SnapshotIsolateConfiguration(std::unique_ptr snapshot) - : snapshot_(std::move(snapshot)) {} - - // |shell::IsolateConfiguration| - bool DoPrepareIsolate(blink::DartIsolate& isolate) override { - if (blink::DartVM::IsRunningPrecompiledCode()) { - return false; - } - return isolate.PrepareForRunningFromSnapshot(std::move(snapshot_)); - } - - private: - std::unique_ptr snapshot_; - - FXL_DISALLOW_COPY_AND_ASSIGN(SnapshotIsolateConfiguration); -}; - -class SourceIsolateConfiguration final : public IsolateConfiguration { - public: - SourceIsolateConfiguration(std::string main_path, std::string packages_path) - : main_path_(std::move(main_path)), - packages_path_(std::move(packages_path)) {} - - // |shell::IsolateConfiguration| - bool DoPrepareIsolate(blink::DartIsolate& isolate) override { - if (blink::DartVM::IsRunningPrecompiledCode()) { - return false; - } - return isolate.PrepareForRunningFromSource(std::move(main_path_), - std::move(packages_path_)); - } - - private: - std::string main_path_; - std::string packages_path_; - - FXL_DISALLOW_COPY_AND_ASSIGN(SourceIsolateConfiguration); -}; - -std::unique_ptr IsolateConfiguration::InferFromSettings( - const blink::Settings& settings, - fxl::RefPtr asset_manager) { - // Running in AOT mode. - if (blink::DartVM::IsRunningPrecompiledCode()) { - return CreateForPrecompiledCode(); - } - - // Run from sources. - { - const auto& main = settings.main_dart_file_path; - const auto& packages = settings.packages_file_path; - if (main.size() != 0 && packages.size() != 0) { - return CreateForSource(std::move(main), std::move(packages)); - } - } - - // Running from kernel snapshot. - { - std::vector kernel; - if (asset_manager && asset_manager->GetAsBuffer( - settings.application_kernel_asset, &kernel)) { - return CreateForSnapshot( - std::make_unique(std::move(kernel))); - } - } - - // Running from script snapshot. - { - std::vector script_snapshot; - if (asset_manager && asset_manager->GetAsBuffer( - settings.script_snapshot_path, &script_snapshot)) { - return CreateForSnapshot( - std::make_unique(std::move(script_snapshot))); - } - } - - return nullptr; -} - -std::unique_ptr -IsolateConfiguration::CreateForPrecompiledCode() { - return std::make_unique(); -} - -std::unique_ptr IsolateConfiguration::CreateForSnapshot( - std::unique_ptr snapshot) { - return std::make_unique(std::move(snapshot)); -} - -std::unique_ptr IsolateConfiguration::CreateForSource( - std::string main_path, - std::string packages_path) { - return std::make_unique(std::move(main_path), - std::move(packages_path)); -} - -} // namespace shell diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h deleted file mode 100644 index 82d06dac621b2..0000000000000 --- a/shell/common/isolate_configuration.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018 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_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ -#define FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ - -#include -#include - -#include "flutter/assets/asset_manager.h" -#include "flutter/assets/asset_resolver.h" -#include "flutter/common/settings.h" -#include "flutter/fml/mapping.h" -#include "flutter/fml/memory/weak_ptr.h" -#include "flutter/runtime/dart_isolate.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class IsolateConfiguration { - public: - static std::unique_ptr InferFromSettings( - const blink::Settings& settings, - fxl::RefPtr asset_manager); - - static std::unique_ptr CreateForPrecompiledCode(); - - static std::unique_ptr CreateForSnapshot( - std::unique_ptr snapshot); - - static std::unique_ptr CreateForSource( - std::string main_path, - std::string packages_path); - - IsolateConfiguration(); - - virtual ~IsolateConfiguration(); - - bool PrepareIsolate(fml::WeakPtr isolate); - - protected: - virtual bool DoPrepareIsolate(blink::DartIsolate& isolate) = 0; - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfiguration); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ diff --git a/shell/common/null_platform_view.cc b/shell/common/null_platform_view.cc new file mode 100644 index 0000000000000..49fdf5a935b80 --- /dev/null +++ b/shell/common/null_platform_view.cc @@ -0,0 +1,37 @@ +// Copyright 2017 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. + +#include "flutter/shell/common/null_platform_view.h" + +#include "flutter/shell/common/null_rasterizer.h" +#include "flutter/shell/common/shell.h" + +namespace shell { + +NullPlatformView::NullPlatformView() + : PlatformView(std::make_unique()), weak_factory_(this) {} + +void NullPlatformView::Attach() { + CreateEngine(); +} + +NullPlatformView::~NullPlatformView() = default; + +fxl::WeakPtr NullPlatformView::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +bool NullPlatformView::ResourceContextMakeCurrent() { + return false; +} + +// Hot-reload of the null platform view is not supported. +void NullPlatformView::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) {} + +void NullPlatformView::SetAssetBundlePath(const std::string& assets_directory) { +} + +} // namespace shell diff --git a/shell/common/null_platform_view.h b/shell/common/null_platform_view.h new file mode 100644 index 0000000000000..eb23d67b48a7c --- /dev/null +++ b/shell/common/null_platform_view.h @@ -0,0 +1,39 @@ +// Copyright 2017 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. + +#ifndef COMMON_NULL_PLATFORM_VIEW_H_ +#define COMMON_NULL_PLATFORM_VIEW_H_ + +#include "flutter/shell/common/platform_view.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace shell { + +class NullPlatformView : public PlatformView { + public: + NullPlatformView(); + + ~NullPlatformView(); + + fxl::WeakPtr GetWeakPtr(); + + virtual void Attach() override; + + bool ResourceContextMakeCurrent() override; + + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + void SetAssetBundlePath(const std::string& assets_directory) override; + + private: + fxl::WeakPtrFactory weak_factory_; + + FXL_DISALLOW_COPY_AND_ASSIGN(NullPlatformView); +}; + +} // namespace shell + +#endif // COMMON_NULL_PLATFORM_VIEW_H_ diff --git a/shell/common/null_rasterizer.cc b/shell/common/null_rasterizer.cc new file mode 100644 index 0000000000000..81efdd11d4970 --- /dev/null +++ b/shell/common/null_rasterizer.cc @@ -0,0 +1,67 @@ +// Copyright 2016 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. + +#include "flutter/shell/common/null_rasterizer.h" + +namespace shell { + +NullRasterizer::NullRasterizer() : weak_factory_(this) {} + +void NullRasterizer::Setup( + std::unique_ptr surface_or_null, + fxl::Closure rasterizer_continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) { + surface_ = std::move(surface_or_null); + rasterizer_continuation(); + setup_completion_event->Signal(); +} + +void NullRasterizer::Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) { + if (surface_) { + surface_.reset(); + } + teardown_completion_event->Signal(); +} + +fml::WeakPtr NullRasterizer::GetWeakRasterizerPtr() { + return weak_factory_.GetWeakPtr(); +} + +flow::LayerTree* NullRasterizer::GetLastLayerTree() { + return nullptr; +} + +void NullRasterizer::DrawLastLayerTree() { + // Null rasterizer. Nothing to do. +} + +flow::TextureRegistry& NullRasterizer::GetTextureRegistry() { + return *texture_registry_; +} + +void NullRasterizer::Clear(SkColor color, const SkISize& size) { + // Null rasterizer. Nothing to do. +} + +void NullRasterizer::Draw( + fxl::RefPtr> pipeline) { + FXL_ALLOW_UNUSED_LOCAL( + pipeline->Consume([](std::unique_ptr) { + // Drop the layer tree on the floor. We only need the pipeline empty so + // that frame requests are not deferred indefinitely due to + // backpressure. + })); +} + +void NullRasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { + // Null rasterizer. Nothing to do. +} + +void NullRasterizer::SetTextureRegistry( + flow::TextureRegistry* textureRegistry) { + texture_registry_ = textureRegistry; +} + +} // namespace shell diff --git a/shell/common/null_rasterizer.h b/shell/common/null_rasterizer.h new file mode 100644 index 0000000000000..8558a3c3accaa --- /dev/null +++ b/shell/common/null_rasterizer.h @@ -0,0 +1,51 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ +#define FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ + +#include "flutter/shell/common/rasterizer.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace shell { + +class NullRasterizer : public Rasterizer { + public: + NullRasterizer(); + + void Setup(std::unique_ptr surface_or_null, + fxl::Closure rasterizer_continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) override; + + void Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) override; + + void Clear(SkColor color, const SkISize& size) override; + + fml::WeakPtr GetWeakRasterizerPtr() override; + + flow::LayerTree* GetLastLayerTree() override; + + void DrawLastLayerTree() override; + + flow::TextureRegistry& GetTextureRegistry() override; + + void Draw(fxl::RefPtr> pipeline) override; + + void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; + + void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; + + private: + std::unique_ptr surface_; + fml::WeakPtrFactory weak_factory_; + flow::TextureRegistry* texture_registry_; + + FXL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index b2bfce051a5bf..2d5715a1733bd 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -6,74 +6,124 @@ #include +#include "flutter/common/threads.h" +#include "flutter/lib/ui/painting/resource_context.h" #include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/shell.h" #include "flutter/shell/common/vsync_waiter_fallback.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" namespace shell { -PlatformView::PlatformView(Delegate& delegate, blink::TaskRunners task_runners) - : delegate_(delegate), - task_runners_(std::move(task_runners)), - size_(SkISize::Make(0, 0)), - weak_factory_(this) { - weak_prototype_ = weak_factory_.GetWeakPtr(); +PlatformView::PlatformView(std::unique_ptr rasterizer) + : rasterizer_(std::move(rasterizer)), size_(SkISize::Make(0, 0)) { + rasterizer_->SetTextureRegistry(&texture_registry_); + Shell::Shared().AddPlatformView(this); } -PlatformView::~PlatformView() = default; +PlatformView::~PlatformView() { + Shell::Shared().RemovePlatformView(this); -std::unique_ptr PlatformView::CreateVSyncWaiter() { - FXL_DLOG(WARNING) - << "This platform does not provide a Vsync waiter implementation. A " - "simple timer based fallback is being used."; - return std::make_unique(task_runners_); + Rasterizer* rasterizer = rasterizer_.release(); + blink::Threads::Gpu()->PostTask([rasterizer]() { delete rasterizer; }); + + Engine* engine = engine_.release(); + blink::Threads::UI()->PostTask([engine]() { delete engine; }); } -void PlatformView::DispatchPlatformMessage( - fxl::RefPtr message) { - delegate_.OnPlatformViewDispatchPlatformMessage(*this, std::move(message)); +void PlatformView::SetRasterizer(std::unique_ptr rasterizer) { + Rasterizer* r = rasterizer_.release(); + blink::Threads::Gpu()->PostTask([r]() { delete r; }); + rasterizer_ = std::move(rasterizer); + rasterizer_->SetTextureRegistry(&texture_registry_); + engine_->set_rasterizer(rasterizer_->GetWeakRasterizerPtr()); } -void PlatformView::DispatchPointerDataPacket( - std::unique_ptr packet) { - delegate_.OnPlatformViewDispatchPointerDataPacket(*this, std::move(packet)); +void PlatformView::CreateEngine() { + engine_.reset(new Engine(this)); +} + +void PlatformView::DispatchPlatformMessage( + fxl::RefPtr message) { + blink::Threads::UI()->PostTask( + [engine = engine_->GetWeakPtr(), message = std::move(message)] { + if (engine) { + engine->DispatchPlatformMessage(message); + } + }); } void PlatformView::DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args) { - delegate_.OnPlatformViewDispatchSemanticsAction(*this, id, action, - std::move(args)); + blink::Threads::UI()->PostTask( + [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { + if (engine) { + engine->DispatchSemanticsAction( + id, static_cast(action), std::move(args)); + } + }); } void PlatformView::SetSemanticsEnabled(bool enabled) { - delegate_.OnPlatformViewSetSemanticsEnabled(*this, enabled); + blink::Threads::UI()->PostTask([engine = engine_->GetWeakPtr(), enabled] { + if (engine) + engine->SetSemanticsEnabled(enabled); + }); } -void PlatformView::SetViewportMetrics(const blink::ViewportMetrics& metrics) { - delegate_.OnPlatformViewSetViewportMetrics(*this, metrics); +void PlatformView::NotifyCreated(std::unique_ptr surface) { + NotifyCreated(std::move(surface), []() {}); } -void PlatformView::NotifyCreated() { - delegate_.OnPlatformViewCreated(*this, CreateRenderingSurface()); +void PlatformView::NotifyCreated(std::unique_ptr surface, + fxl::Closure caller_continuation) { + fxl::AutoResetWaitableEvent latch; + + auto ui_continuation = fxl::MakeCopyable([this, // + surface = std::move(surface), // + caller_continuation, // + &latch]() mutable { + auto gpu_continuation = fxl::MakeCopyable([this, // + surface = std::move(surface), // + caller_continuation, // + &latch]() mutable { + // Runs on the GPU Thread. So does the Caller Continuation. + rasterizer_->Setup(std::move(surface), caller_continuation, &latch); + }); + // Runs on the UI Thread. + engine_->OnOutputSurfaceCreated(std::move(gpu_continuation)); + }); + + // Runs on the Platform Thread. + blink::Threads::UI()->PostTask(std::move(ui_continuation)); + + latch.Wait(); } void PlatformView::NotifyDestroyed() { - delegate_.OnPlatformViewDestroyed(*this); + fxl::AutoResetWaitableEvent latch; + + auto engine_continuation = [this, &latch]() { + rasterizer_->Teardown(&latch); + }; + + blink::Threads::UI()->PostTask([this, engine_continuation]() { + engine_->OnOutputSurfaceDestroyed(engine_continuation); + }); + + latch.Wait(); } -sk_sp PlatformView::CreateResourceContext() const { - FXL_DLOG(WARNING) << "This platform does not setup the resource " - "context on the IO thread for async texture uploads."; - return nullptr; +std::weak_ptr PlatformView::GetWeakPtr() { + return shared_from_this(); } -fml::WeakPtr PlatformView::GetWeakPtr() const { - return weak_prototype_; +VsyncWaiter* PlatformView::GetVsyncWaiter() { + if (!vsync_waiter_) + vsync_waiter_ = std::make_unique(); + return vsync_waiter_.get(); } void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) {} @@ -85,31 +135,71 @@ void PlatformView::HandlePlatformMessage( } void PlatformView::RegisterTexture(std::shared_ptr texture) { - delegate_.OnPlatformViewRegisterTexture(*this, std::move(texture)); + ASSERT_IS_PLATFORM_THREAD + blink::Threads::Gpu()->PostTask([this, texture]() { + rasterizer_->GetTextureRegistry().RegisterTexture(texture); + }); } void PlatformView::UnregisterTexture(int64_t texture_id) { - delegate_.OnPlatformViewUnregisterTexture(*this, texture_id); + ASSERT_IS_PLATFORM_THREAD + blink::Threads::Gpu()->PostTask([this, texture_id]() { + rasterizer_->GetTextureRegistry().UnregisterTexture(texture_id); + }); } void PlatformView::MarkTextureFrameAvailable(int64_t texture_id) { - delegate_.OnPlatformViewMarkTextureFrameAvailable(*this, texture_id); + ASSERT_IS_PLATFORM_THREAD + blink::Threads::UI()->PostTask([this]() { engine_->ScheduleFrame(false); }); } -std::unique_ptr PlatformView::CreateRenderingSurface() { - // We have a default implementation because tests create a platform view but - // never a rendering surface. - FXL_DCHECK(false) << "This platform does not provide a rendering surface but " - "it was notified of surface rendering surface creation."; - return nullptr; +void PlatformView::SetupResourceContextOnIOThread() { + fxl::AutoResetWaitableEvent latch; + + blink::Threads::IO()->PostTask( + [this, &latch]() { SetupResourceContextOnIOThreadPerform(&latch); }); + + latch.Wait(); } -void PlatformView::SetNextFrameCallback(fxl::Closure closure) { - if (!closure) { +void PlatformView::SetupResourceContextOnIOThreadPerform( + fxl::AutoResetWaitableEvent* latch) { + std::unique_ptr resourceContext = + blink::ResourceContext::Acquire(); + if (resourceContext->Get() != nullptr) { + // The resource context was already setup. This could happen if platforms + // try to setup a context multiple times, or, if there are multiple platform + // views. In any case, there is nothing else to do. So just signal the + // latch. + latch->Signal(); return; } - delegate_.OnPlatformViewSetNextFrameCallback(*this, std::move(closure)); + bool current = ResourceContextMakeCurrent(); + + if (!current) { + FXL_DLOG(WARNING) + << "WARNING: Could not setup a context on the resource loader."; + latch->Signal(); + return; + } + + GrContextOptions options; + // There is currently a bug with doing GPU YUV to RGB conversions on the IO + // thread. The necessary work isn't being flushed or synchronized with the + // other threads correctly, so the textures end up blank. For now, suppress + // that feature, which will cause texture uploads to do CPU YUV conversion. + options.fDisableGpuYUVConversion = true; + + blink::ResourceContext::Set( + GrContext::MakeGL(GrGLMakeNativeInterface(), options)); + + // Do not cache textures created by the image decoder. These textures should + // be deleted when they are no longer referenced by an SkImage. + if (resourceContext->Get()) + resourceContext->Get()->setResourceCacheLimits(0, 0); + + latch->Signal(); } } // namespace shell diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 56179a6114777..66b1fcae10c79 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -7,104 +7,63 @@ #include -#include "flutter/common/task_runners.h" #include "flutter/flow/texture.h" -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/lib/ui/semantics/semantics_node.h" -#include "flutter/lib/ui/window/platform_message.h" -#include "flutter/lib/ui/window/pointer_data_packet.h" -#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/shell/common/engine.h" +#include "flutter/shell/common/shell.h" #include "flutter/shell/common/surface.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { -class Shell; +class Rasterizer; -class PlatformView { +class PlatformView : public std::enable_shared_from_this { public: - class Delegate { - public: - virtual void OnPlatformViewCreated(const PlatformView& view, - std::unique_ptr surface) = 0; - - virtual void OnPlatformViewDestroyed(const PlatformView& view) = 0; - - virtual void OnPlatformViewSetNextFrameCallback(const PlatformView& view, - fxl::Closure closure) = 0; - - virtual void OnPlatformViewSetViewportMetrics( - const PlatformView& view, - const blink::ViewportMetrics& metrics) = 0; - - virtual void OnPlatformViewDispatchPlatformMessage( - const PlatformView& view, - fxl::RefPtr message) = 0; - - virtual void OnPlatformViewDispatchPointerDataPacket( - const PlatformView& view, - std::unique_ptr packet) = 0; - - virtual void OnPlatformViewDispatchSemanticsAction( - const PlatformView& view, - int32_t id, - blink::SemanticsAction action, - std::vector args) = 0; - - virtual void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, - bool enabled) = 0; - - virtual void OnPlatformViewRegisterTexture( - const PlatformView& view, - std::shared_ptr texture) = 0; - - virtual void OnPlatformViewUnregisterTexture(const PlatformView& view, - int64_t texture_id) = 0; - - virtual void OnPlatformViewMarkTextureFrameAvailable( - const PlatformView& view, - int64_t texture_id) = 0; + struct SurfaceConfig { + uint8_t red_bits = 8; + uint8_t green_bits = 8; + uint8_t blue_bits = 8; + uint8_t alpha_bits = 8; + uint8_t depth_bits = 0; + uint8_t stencil_bits = 0; }; - explicit PlatformView(Delegate& delegate, blink::TaskRunners task_runners); + void SetupResourceContextOnIOThread(); virtual ~PlatformView(); - virtual std::unique_ptr CreateVSyncWaiter(); + virtual void Attach() = 0; void DispatchPlatformMessage(fxl::RefPtr message); - void DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args); + void SetSemanticsEnabled(bool enabled); - virtual void SetSemanticsEnabled(bool enabled); + void NotifyCreated(std::unique_ptr surface); - void SetViewportMetrics(const blink::ViewportMetrics& metrics); + void NotifyCreated(std::unique_ptr surface, + fxl::Closure continuation); - void NotifyCreated(); + void NotifyDestroyed(); - virtual void NotifyDestroyed(); + std::weak_ptr GetWeakPtr(); - // Unlike all other methods on the platform view, this one may be called on a - // non-platform task runner. - virtual sk_sp CreateResourceContext() const; + // The VsyncWaiter will live at least as long as the PlatformView. + virtual VsyncWaiter* GetVsyncWaiter(); - fml::WeakPtr GetWeakPtr() const; + virtual bool ResourceContextMakeCurrent() = 0; virtual void UpdateSemantics(blink::SemanticsNodeUpdates update); - virtual void HandlePlatformMessage( fxl::RefPtr message); - void SetNextFrameCallback(fxl::Closure closure); - - void DispatchPointerDataPacket( - std::unique_ptr packet); - // Called once per texture, on the platform thread. void RegisterTexture(std::shared_ptr texture); @@ -112,18 +71,34 @@ class PlatformView { void UnregisterTexture(int64_t texture_id); // Called once per texture update (e.g. video frame), on the platform thread. - void MarkTextureFrameAvailable(int64_t texture_id); + virtual void MarkTextureFrameAvailable(int64_t texture_id); + + void SetRasterizer(std::unique_ptr rasterizer); + + Rasterizer& rasterizer() { return *rasterizer_; } + Engine& engine() { return *engine_; } + + virtual void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) = 0; + + virtual void SetAssetBundlePath(const std::string& assets_directory) = 0; protected: - PlatformView::Delegate& delegate_; - const blink::TaskRunners task_runners_; + explicit PlatformView(std::unique_ptr rasterizer); + + void CreateEngine(); + + void SetupResourceContextOnIOThreadPerform( + fxl::AutoResetWaitableEvent* event); + + SurfaceConfig surface_config_; + std::unique_ptr rasterizer_; + flow::TextureRegistry texture_registry_; + std::unique_ptr engine_; std::unique_ptr vsync_waiter_; SkISize size_; - fml::WeakPtr weak_prototype_; - fml::WeakPtrFactory weak_factory_; - - virtual std::unique_ptr CreateRenderingSurface(); private: FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); diff --git a/shell/common/platform_view_service_protocol.cc b/shell/common/platform_view_service_protocol.cc new file mode 100644 index 0000000000000..8785c4812e202 --- /dev/null +++ b/shell/common/platform_view_service_protocol.cc @@ -0,0 +1,447 @@ +// Copyright 2016 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. + +#include "flutter/shell/common/platform_view_service_protocol.h" + +#include + +#include +#include + +#include "flutter/common/threads.h" +#include "flutter/shell/common/picture_serializer.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "third_party/skia/include/core/SkSurface.h" +#include "third_party/skia/src/utils/SkBase64.h" + +namespace shell { +namespace { + +constexpr char kViewIdPrefx[] = "_flutterView/"; +constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; + +static intptr_t KeyIndex(const char** param_keys, + intptr_t num_params, + const char* key) { + if (param_keys == NULL) { + return -1; + } + for (intptr_t i = 0; i < num_params; i++) { + if (strcmp(param_keys[i], key) == 0) { + return i; + } + } + return -1; +} + +static const char* ValueForKey(const char** param_keys, + const char** param_values, + intptr_t num_params, + const char* key) { + intptr_t index = KeyIndex(param_keys, num_params, key); + if (index < 0) { + return NULL; + } + return param_values[index]; +} + +static bool ErrorMissingParameter(const char** json_object, const char* name) { + const intptr_t kInvalidParams = -32602; + std::stringstream response; + response << "{\"code\":" << std::to_string(kInvalidParams) << ","; + response << "\"message\":\"Invalid params\","; + response << "\"data\": {\"details\": \"" << name << "\"}}"; + *json_object = strdup(response.str().c_str()); + return false; +} + +static bool ErrorBadParameter(const char** json_object, + const char* name, + const char* value) { + const intptr_t kInvalidParams = -32602; + std::stringstream response; + response << "{\"code\":" << std::to_string(kInvalidParams) << ","; + response << "\"message\":\"Invalid params\","; + response << "\"data\": {\"details\": \"parameter: " << name << " has a bad "; + response << "value: " << value << "\"}}"; + *json_object = strdup(response.str().c_str()); + return false; +} + +static bool ErrorUnknownView(const char** json_object, const char* view_id) { + const intptr_t kInvalidParams = -32602; + std::stringstream response; + response << "{\"code\":" << std::to_string(kInvalidParams) << ","; + response << "\"message\":\"Invalid params\","; + response << "\"data\": {\"details\": \"view not found: " << view_id << "\"}}"; + *json_object = strdup(response.str().c_str()); + return false; +} + +static bool ErrorServer(const char** json_object, const char* message) { + const intptr_t kServerError = -32000; + std::stringstream response; + response << "{\"code\":" << std::to_string(kServerError) << ","; + response << "\"message\":\"" << message << "\"}"; + *json_object = strdup(response.str().c_str()); + return false; +} + +static void AppendIsolateRef(std::stringstream* stream, + int64_t main_port, + const std::string name) { + *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; + *stream << main_port << "\",\"name\":\"" << name << "\","; + *stream << "\"number\":\"" << main_port << "\"}"; +} + +static void AppendFlutterView(std::stringstream* stream, + uintptr_t view_id, + int64_t isolate_id, + const std::string isolate_name) { + *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" + << std::hex << view_id << std::dec << "\""; + if (isolate_id != ILLEGAL_PORT) { + // Append the isolate (if it exists). + *stream << "," + << "\"isolate\":"; + AppendIsolateRef(stream, isolate_id, isolate_name); + } + *stream << "}"; +} + +} // namespace + +void PlatformViewServiceProtocol::RegisterHook(bool running_precompiled_code) { + // Listing of FlutterViews. + Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, + nullptr); + // Screenshot. + Dart_RegisterRootServiceRequestCallback(kScreenshotExtensionName, &Screenshot, + nullptr); + + // SkPicture Screenshot. + Dart_RegisterRootServiceRequestCallback(kScreenshotSkpExtensionName, + &ScreenshotSkp, nullptr); + + // The following set of service protocol extensions require debug build + if (running_precompiled_code) { + return; + } + Dart_RegisterRootServiceRequestCallback(kRunInViewExtensionName, &RunInView, + nullptr); + Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, + &SetAssetBundlePath, nullptr); + // [benchmark helper] Wait for the UI Thread to idle. + Dart_RegisterRootServiceRequestCallback(kFlushUIThreadTasksExtensionName, + &FlushUIThreadTasks, nullptr); +} + +const char* PlatformViewServiceProtocol::kRunInViewExtensionName = + "_flutter.runInView"; + +bool PlatformViewServiceProtocol::RunInView(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + const char* view_id = + ValueForKey(param_keys, param_values, num_params, "viewId"); + const char* asset_directory = + ValueForKey(param_keys, param_values, num_params, "assetDirectory"); + const char* main_script = + ValueForKey(param_keys, param_values, num_params, "mainScript"); + const char* packages_file = + ValueForKey(param_keys, param_values, num_params, "packagesFile"); + if (view_id == NULL) { + return ErrorMissingParameter(json_object, "viewId"); + } + if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { + return ErrorBadParameter(json_object, "viewId", view_id); + } + if (asset_directory == NULL) { + return ErrorMissingParameter(json_object, "assetDirectory"); + } + if (main_script == NULL) { + return ErrorMissingParameter(json_object, "mainScript"); + } + if (packages_file == NULL) { + return ErrorMissingParameter(json_object, "packagesFile"); + } + + // Convert the actual flutter view hex id into a number. + uintptr_t view_id_as_num = + std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); + + // Ask the Shell to run this script in the specified view. This will run a + // task on the UI thread before returning. + Shell& shell = Shell::Shared(); + bool view_existed = false; + Dart_Port main_port = ILLEGAL_PORT; + std::string isolate_name; + shell.RunInPlatformView(view_id_as_num, main_script, packages_file, + asset_directory, &view_existed, &main_port, + &isolate_name); + + if (!view_existed) { + // If the view did not exist this request has definitely failed. + return ErrorUnknownView(json_object, view_id); + } + + // The view existed and the isolate was created. Success. + std::stringstream response; + response << "{\"type\":\"Success\"," + << "\"view\":"; + AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); + response << "}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +const char* PlatformViewServiceProtocol::kListViewsExtensionName = + "_flutter.listViews"; + +bool PlatformViewServiceProtocol::ListViews(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + std::stringstream response; + response << "{\"type\":\"FlutterViewList\",\"views\":["; + bool prefix_comma = false; + Shell::Shared().IteratePlatformViews( + [&response, &prefix_comma](PlatformView* view) -> bool { + if (prefix_comma) { + response << ','; + } else { + prefix_comma = true; + } + AppendFlutterView(&response, reinterpret_cast(view), + view->engine().GetUIIsolateMainPort(), + view->engine().GetUIIsolateName()); + return true; + }); + response << "]}"; + // Copy the response. + *json_object = strdup(response.str().c_str()); + return true; +} + +const char* PlatformViewServiceProtocol::kScreenshotExtensionName = + "_flutter.screenshot"; + +static sk_sp EncodeBitmapAsPNG(const SkBitmap& bitmap) { + return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); +} + +static fml::WeakPtr GetRandomRasterizer() { + fml::WeakPtr rasterizer; + Shell::Shared().IteratePlatformViews( + [&rasterizer](PlatformView* view) -> bool { + rasterizer = view->rasterizer().GetWeakRasterizerPtr(); + // We just grab the first rasterizer so there is no need to iterate + // further. + return false; + }); + return rasterizer; +} + +bool PlatformViewServiceProtocol::Screenshot(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + fxl::AutoResetWaitableEvent latch; + SkBitmap bitmap; + blink::Threads::Gpu()->PostTask([&latch, &bitmap]() { + ScreenshotGpuTask(&bitmap); + latch.Signal(); + }); + + latch.Wait(); + + sk_sp png(EncodeBitmapAsPNG(bitmap)); + + if (!png) + return ErrorServer(json_object, "can not encode screenshot"); + + size_t b64_size = SkBase64::Encode(png->data(), png->size(), nullptr); + SkAutoTMalloc b64_data(b64_size); + SkBase64::Encode(png->data(), png->size(), b64_data.get()); + + std::stringstream response; + response << "{\"type\":\"Screenshot\"," + << "\"screenshot\":\"" << std::string{b64_data.get(), b64_size} + << "\"}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +void PlatformViewServiceProtocol::ScreenshotGpuTask(SkBitmap* bitmap) { + auto rasterizer = GetRandomRasterizer(); + + if (!rasterizer) + return; + + flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); + if (layer_tree == nullptr) + return; + + const SkISize& frame_size = layer_tree->frame_size(); + if (!bitmap->tryAllocN32Pixels(frame_size.width(), frame_size.height())) + return; + + sk_sp surface = SkSurface::MakeRasterDirect( + bitmap->info(), bitmap->getPixels(), bitmap->rowBytes()); + + flow::CompositorContext compositor_context(nullptr); + SkCanvas* canvas = surface->getCanvas(); + flow::CompositorContext::ScopedFrame frame = + compositor_context.AcquireFrame(nullptr, canvas, false); + + canvas->clear(SK_ColorBLACK); + layer_tree->Raster(frame); + canvas->flush(); +} + +const char* PlatformViewServiceProtocol::kScreenshotSkpExtensionName = + "_flutter.screenshotSkp"; + +bool PlatformViewServiceProtocol::ScreenshotSkp(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + fxl::AutoResetWaitableEvent latch; + sk_sp picture; + blink::Threads::Gpu()->PostTask([&latch, &picture]() { + picture = ScreenshotSkpGpuTask(); + latch.Signal(); + }); + + latch.Wait(); + + sk_sp skp_data = picture->serialize(); + + size_t b64_size = + SkBase64::Encode(skp_data->data(), skp_data->size(), nullptr); + SkAutoTMalloc b64_data(b64_size); + SkBase64::Encode(skp_data->data(), skp_data->size(), b64_data.get()); + + std::stringstream response; + response << "{\"type\":\"ScreenshotSkp\"," + << "\"skp\":\"" << std::string{b64_data.get(), b64_size} << "\"}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +sk_sp PlatformViewServiceProtocol::ScreenshotSkpGpuTask() { + auto rasterizer = GetRandomRasterizer(); + + if (!rasterizer) + return nullptr; + + flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); + if (layer_tree == nullptr) + return nullptr; + + SkPictureRecorder recorder; + recorder.beginRecording(SkRect::MakeWH(layer_tree->frame_size().width(), + layer_tree->frame_size().height())); + + flow::CompositorContext compositor_context(nullptr); + flow::CompositorContext::ScopedFrame frame = compositor_context.AcquireFrame( + nullptr, recorder.getRecordingCanvas(), false); + layer_tree->Raster(frame); + + return recorder.finishRecordingAsPicture(); +} + +const char* PlatformViewServiceProtocol::kFlushUIThreadTasksExtensionName = + "_flutter.flushUIThreadTasks"; + +// This API should not be invoked by production code. +// It can potentially starve the service isolate if the main isolate pauses +// at a breakpoint or is in an infinite loop. +// +// It should be invoked from the VM Service and and blocks it until UI thread +// tasks are processed. +bool PlatformViewServiceProtocol::FlushUIThreadTasks(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + fxl::AutoResetWaitableEvent latch; + blink::Threads::UI()->PostTask([&latch]() { + // This task is empty because we just need to synchronize this RPC with the + // UI Thread + latch.Signal(); + }); + + latch.Wait(); + + *json_object = strdup("{\"type\":\"Success\"}"); + return true; +} + +const char* PlatformViewServiceProtocol::kSetAssetBundlePathExtensionName = + "_flutter.setAssetBundlePath"; + +bool PlatformViewServiceProtocol::SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + const char* view_id = + ValueForKey(param_keys, param_values, num_params, "viewId"); + if (view_id == nullptr) { + return ErrorMissingParameter(json_object, "viewId"); + } + if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { + return ErrorBadParameter(json_object, "viewId", view_id); + } + const char* asset_directory = + ValueForKey(param_keys, param_values, num_params, "assetDirectory"); + if (asset_directory == nullptr) { + return ErrorMissingParameter(json_object, "assetDirectory"); + } + + // Convert the actual flutter view hex id into a number. + uintptr_t view_id_as_num = + std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); + + // Ask the Shell to update asset bundle path in the specified view. + // This will run a task on the UI thread before returning. + Shell& shell = Shell::Shared(); + bool view_existed = false; + Dart_Port main_port = ILLEGAL_PORT; + std::string isolate_name; + shell.SetAssetBundlePathInPlatformView(view_id_as_num, asset_directory, + &view_existed, &main_port, + &isolate_name); + + if (!view_existed) { + // If the view did not exist this request has definitely failed. + return ErrorUnknownView(json_object, view_id); + } + + // The view existed and the isolate was created. Success. + std::stringstream response; + response << "{\"type\":\"Success\"," + << "\"view\":"; + AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); + response << "}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +} // namespace shell diff --git a/shell/common/platform_view_service_protocol.h b/shell/common/platform_view_service_protocol.h new file mode 100644 index 0000000000000..b7f74b56a08ba --- /dev/null +++ b/shell/common/platform_view_service_protocol.h @@ -0,0 +1,85 @@ +// Copyright 2016 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. + +#ifndef SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ +#define SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ + +#include + +#include "flutter/shell/common/platform_view.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" +#include "third_party/skia/include/core/SkBitmap.h" + +namespace shell { + +class PlatformViewServiceProtocol { + public: + static void RegisterHook(bool running_precompiled_code); + + private: + static const char* kRunInViewExtensionName; + // It should be invoked from the VM Service and and blocks it until previous + // UI thread tasks are processed. + static bool RunInView(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + + static const char* kListViewsExtensionName; + static bool ListViews(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + + static const char* kScreenshotExtensionName; + // It should be invoked from the VM Service and and blocks it until previous + // GPU thread tasks are processed. + static bool Screenshot(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + static void ScreenshotGpuTask(SkBitmap* bitmap); + + static const char* kScreenshotSkpExtensionName; + static bool ScreenshotSkp(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + static sk_sp ScreenshotSkpGpuTask(); + + // This API should not be invoked by production code. + // It can potentially starve the service isolate if the main isolate pauses + // at a breakpoint or is in an infinite loop. + // + // It should be invoked from the VM Service and and blocks it until previous + // GPU thread tasks are processed. + static const char* kFlushUIThreadTasksExtensionName; + static bool FlushUIThreadTasks(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + + static const char* kSetAssetBundlePathExtensionName; + static bool SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); +}; + +} // namespace shell + +#endif // SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 5a519b3efea26..905ee6285c5d3 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -4,205 +4,8 @@ #include "flutter/shell/common/rasterizer.h" -#include - -#include "third_party/skia/include/core/SkEncodedImageFormat.h" -#include "third_party/skia/include/core/SkImageEncoder.h" -#include "third_party/skia/include/core/SkPictureRecorder.h" -#include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/src/utils/SkBase64.h" - namespace shell { -Rasterizer::Rasterizer(blink::TaskRunners task_runners) - : task_runners_(std::move(task_runners)), weak_factory_(this) { - weak_prototype_ = weak_factory_.GetWeakPtr(); -} - Rasterizer::~Rasterizer() = default; -fml::WeakPtr Rasterizer::GetWeakPtr() const { - return weak_prototype_; -} - -void Rasterizer::Setup(std::unique_ptr surface) { - surface_ = std::move(surface); -} - -void Rasterizer::Teardown() { - surface_.reset(); - last_layer_tree_.reset(); -} - -flow::TextureRegistry* Rasterizer::GetTextureRegistry() { - if (!surface_) { - return nullptr; - } - - return &(surface_->GetCompositorContext().texture_registry()); -} - -flow::LayerTree* Rasterizer::GetLastLayerTree() { - return last_layer_tree_.get(); -} - -void Rasterizer::DrawLastLayerTree() { - if (!last_layer_tree_ || !surface_) { - return; - } - DrawToSurface(*last_layer_tree_); -} - -void Rasterizer::Draw( - fxl::RefPtr> pipeline) { - TRACE_EVENT0("flutter", "GPURasterizer::Draw"); - - flutter::Pipeline::Consumer consumer = - std::bind(&Rasterizer::DoDraw, this, std::placeholders::_1); - - // Consume as many pipeline items as possible. But yield the event loop - // between successive tries. - switch (pipeline->Consume(consumer)) { - case flutter::PipelineConsumeResult::MoreAvailable: { - task_runners_.GetGPUTaskRunner()->PostTask( - [weak_this = weak_factory_.GetWeakPtr(), pipeline]() { - if (weak_this) { - weak_this->Draw(pipeline); - } - }); - break; - } - default: - break; - } -} - -void Rasterizer::DoDraw(std::unique_ptr layer_tree) { - if (!layer_tree || !surface_) { - return; - } - - if (DrawToSurface(*layer_tree)) { - last_layer_tree_ = std::move(layer_tree); - } -} - -bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) { - FXL_DCHECK(surface_); - - auto frame = surface_->AcquireFrame(layer_tree.frame_size()); - - if (frame == nullptr) { - return false; - } - - auto& compositor_context = surface_->GetCompositorContext(); - - // There is no way for the compositor to know how long the layer tree - // construction took. Fortunately, the layer tree does. Grab that time - // for instrumentation. - compositor_context.engine_time().SetLapTime(layer_tree.construction_time()); - - auto compositor_frame = compositor_context.AcquireFrame( - surface_->GetContext(), frame->SkiaCanvas(), true); - - if (compositor_frame && compositor_frame->Raster(layer_tree, false)) { - frame->Submit(); - FireNextFrameCallbackIfPresent(); - return true; - } - - return false; -} - -static sk_sp ScreenshotLayerTreeAsPicture(flow::LayerTree* tree) { - FXL_DCHECK(tree != nullptr); - SkPictureRecorder recorder; - recorder.beginRecording( - SkRect::MakeWH(tree->frame_size().width(), tree->frame_size().height())); - - flow::CompositorContext compositor_context; - auto frame = compositor_context.AcquireFrame( - nullptr, recorder.getRecordingCanvas(), false); - - frame->Raster(*tree, true); - - return recorder.finishRecordingAsPicture(); -} - -static sk_sp ScreenshotLayerTreeAsImage(flow::LayerTree* tree, - bool compressed) { - const SkISize& frame_size = tree->frame_size(); - SkBitmap bitmap; - if (!bitmap.tryAllocN32Pixels(frame_size.width(), frame_size.height())) { - return nullptr; - } - auto bitmap_surface = SkSurface::MakeRasterDirect( - bitmap.info(), bitmap.getPixels(), bitmap.rowBytes()); - flow::CompositorContext compositor_context; - auto canvas = bitmap_surface->getCanvas(); - auto frame = compositor_context.AcquireFrame(nullptr, canvas, false); - canvas->clear(SK_ColorBLACK); - frame->Raster(*tree, true); - canvas->flush(); - if (compressed) { - return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); - } else { - return SkData::MakeWithCopy(bitmap.getPixels(), bitmap.computeByteSize()); - } - return nullptr; -} - -Rasterizer::Screenshot Rasterizer::ScreenshotLastLayerTree( - Rasterizer::ScreenshotType type, - bool base64_encode) { - auto layer_tree = GetLastLayerTree(); - if (layer_tree == nullptr) { - FXL_DLOG(INFO) << "Last layer tree was null when screenshotting."; - return {}; - } - - sk_sp data = nullptr; - - switch (type) { - case ScreenshotType::SkiaPicture: - data = ScreenshotLayerTreeAsPicture(layer_tree)->serialize(); - break; - case ScreenshotType::UncompressedImage: - data = ScreenshotLayerTreeAsImage(layer_tree, false); - break; - case ScreenshotType::CompressedImage: - data = ScreenshotLayerTreeAsImage(layer_tree, true); - break; - } - - if (data == nullptr) { - FXL_DLOG(INFO) << "Sceenshot data was null."; - return {}; - } - - if (base64_encode) { - size_t b64_size = SkBase64::Encode(data->data(), data->size(), nullptr); - auto b64_data = SkData::MakeUninitialized(b64_size); - SkBase64::Encode(data->data(), data->size(), b64_data->writable_data()); - return Rasterizer::Screenshot{b64_data, layer_tree->frame_size()}; - } - - return Rasterizer::Screenshot{data, layer_tree->frame_size()}; -} - -void Rasterizer::SetNextFrameCallback(fxl::Closure callback) { - next_frame_callback_ = callback; -} - -void Rasterizer::FireNextFrameCallbackIfPresent() { - if (!next_frame_callback_) { - return; - } - // It is safe for the callback to set a new callback. - auto callback = next_frame_callback_; - next_frame_callback_ = nullptr; - callback(); -} - } // namespace shell diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 908717b74c168..6f45f49d8178a 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -7,7 +7,6 @@ #include -#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" @@ -17,64 +16,34 @@ namespace shell { -class Rasterizer final { +class Rasterizer { public: - Rasterizer(blink::TaskRunners task_runners); + virtual ~Rasterizer(); - ~Rasterizer(); + virtual void Setup(std::unique_ptr surface_or_null, + fxl::Closure rasterizer_continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) = 0; - void Setup(std::unique_ptr surface); + virtual void Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) = 0; - void Teardown(); + virtual void Clear(SkColor color, const SkISize& size) = 0; - fml::WeakPtr GetWeakPtr() const; + virtual fml::WeakPtr GetWeakRasterizerPtr() = 0; - flow::LayerTree* GetLastLayerTree(); + virtual flow::LayerTree* GetLastLayerTree() = 0; - void DrawLastLayerTree(); + virtual void DrawLastLayerTree() = 0; - flow::TextureRegistry* GetTextureRegistry(); + virtual flow::TextureRegistry& GetTextureRegistry() = 0; - void Draw(fxl::RefPtr> pipeline); + virtual void Draw( + fxl::RefPtr> pipeline) = 0; - enum class ScreenshotType { - SkiaPicture, - UncompressedImage, // In kN32_SkColorType format - CompressedImage, - }; + // Set a callback to be called once when the next frame is drawn. + virtual void AddNextFrameCallback(fxl::Closure nextFrameCallback) = 0; - struct Screenshot { - sk_sp data; - SkISize frame_size = SkISize::MakeEmpty(); - - Screenshot() {} - - Screenshot(sk_sp p_data, SkISize p_size) - : data(std::move(p_data)), frame_size(p_size) {} - }; - - Screenshot ScreenshotLastLayerTree(ScreenshotType type, bool base64_encode); - - // Sets a callback that will be executed after the next frame is submitted to - // the surface on the GPU task runner. - void SetNextFrameCallback(fxl::Closure callback); - - private: - blink::TaskRunners task_runners_; - std::unique_ptr surface_; - std::unique_ptr compositor_context_; - std::unique_ptr last_layer_tree_; - fxl::Closure next_frame_callback_; - fml::WeakPtr weak_prototype_; - fml::WeakPtrFactory weak_factory_; - - void DoDraw(std::unique_ptr layer_tree); - - bool DrawToSurface(flow::LayerTree& layer_tree); - - void FireNextFrameCallbackIfPresent(); - - FXL_DISALLOW_COPY_AND_ASSIGN(Rasterizer); + virtual void SetTextureRegistry(flow::TextureRegistry* textureRegistry) = 0; }; } // namespace shell diff --git a/shell/common/run_configuration.cc b/shell/common/run_configuration.cc deleted file mode 100644 index 7fb385fb4d9dc..0000000000000 --- a/shell/common/run_configuration.cc +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2017 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/shell/common/run_configuration.h" - -#include - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/fml/file.h" -#include "flutter/runtime/dart_vm.h" - -namespace shell { - -RunConfiguration RunConfiguration::InferFromSettings( - const blink::Settings& settings) { - auto asset_manager = fxl::MakeRefCounted(); - - asset_manager->PushBack(std::make_unique( - fml::Duplicate(settings.assets_dir))); - - asset_manager->PushBack( - std::make_unique(fml::OpenFile( - settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); - - asset_manager->PushBack( - std::make_unique(settings.flx_path)); - - return {IsolateConfiguration::InferFromSettings(settings, asset_manager), - asset_manager}; -} - -RunConfiguration::RunConfiguration( - std::unique_ptr configuration) - : RunConfiguration(std::move(configuration), - fxl::MakeRefCounted()) {} - -RunConfiguration::RunConfiguration( - std::unique_ptr configuration, - fxl::RefPtr asset_manager) - : isolate_configuration_(std::move(configuration)), - asset_manager_(std::move(asset_manager)) {} - -RunConfiguration::RunConfiguration(RunConfiguration&&) = default; - -RunConfiguration::~RunConfiguration() = default; - -bool RunConfiguration::IsValid() const { - return asset_manager_ && isolate_configuration_; -} - -bool RunConfiguration::AddAssetResolver( - std::unique_ptr resolver) { - if (!resolver || !resolver->IsValid()) { - return false; - } - - asset_manager_->PushBack(std::move(resolver)); - return true; -} - -void RunConfiguration::SetEntrypoint(std::string entrypoint) { - entrypoint_ = std::move(entrypoint); -} - -fxl::RefPtr RunConfiguration::GetAssetManager() const { - return asset_manager_; -} - -const std::string& RunConfiguration::GetEntrypoint() const { - return entrypoint_; -} - -std::unique_ptr -RunConfiguration::TakeIsolateConfiguration() { - return std::move(isolate_configuration_); -} - -} // namespace shell diff --git a/shell/common/run_configuration.h b/shell/common/run_configuration.h deleted file mode 100644 index 59aa07566685c..0000000000000 --- a/shell/common/run_configuration.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2017 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_SHELL_COMMON_RUN_CONFIGURATION_H_ -#define FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ - -#include -#include - -#include "flutter/assets/asset_manager.h" -#include "flutter/assets/asset_resolver.h" -#include "flutter/common/settings.h" -#include "flutter/fml/mapping.h" -#include "flutter/shell/common/isolate_configuration.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class RunConfiguration { - public: - static RunConfiguration InferFromSettings(const blink::Settings& settings); - - RunConfiguration(std::unique_ptr configuration); - - RunConfiguration(std::unique_ptr configuration, - fxl::RefPtr asset_manager); - - RunConfiguration(RunConfiguration&&); - - ~RunConfiguration(); - - bool IsValid() const; - - bool AddAssetResolver(std::unique_ptr resolver); - - void SetEntrypoint(std::string entrypoint); - - fxl::RefPtr GetAssetManager() const; - - const std::string& GetEntrypoint() const; - - std::unique_ptr TakeIsolateConfiguration(); - - private: - std::unique_ptr isolate_configuration_; - fxl::RefPtr asset_manager_; - std::string entrypoint_ = "main"; - - FXL_DISALLOW_COPY_AND_ASSIGN(RunConfiguration); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 53527a996bd76..14f8fee84bb5f 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -2,859 +2,362 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#define RAPIDJSON_HAS_STDSTRING 1 - #include "flutter/shell/common/shell.h" +#include #include #include #include -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/fml/file.h" +#include "flutter/common/settings.h" +#include "flutter/common/threads.h" #include "flutter/fml/icu_util.h" #include "flutter/fml/message_loop.h" -#include "flutter/glue/trace_event.h" -#include "flutter/runtime/dart_vm.h" +#include "flutter/fml/trace_event.h" +#include "flutter/runtime/dart_init.h" #include "flutter/shell/common/engine.h" +#include "flutter/shell/common/platform_view_service_protocol.h" #include "flutter/shell/common/skia_event_tracer_impl.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/logging.h" #include "third_party/dart/runtime/include/dart_tools_api.h" #include "third_party/skia/include/core/SkGraphics.h" namespace shell { +namespace { -std::unique_ptr Shell::CreateShellOnPlatformThread( - blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer) { - if (!task_runners.IsValid()) { - return nullptr; - } - - auto shell = std::unique_ptr(new Shell(task_runners, settings)); - - // Create the platform view on the platform thread (this thread). - auto platform_view = on_create_platform_view(*shell.get()); - if (!platform_view || !platform_view->GetWeakPtr()) { - return nullptr; - } - - // Ask the platform view for the vsync waiter. This will be used by the engine - // to create the animator. - auto vsync_waiter = platform_view->CreateVSyncWaiter(); - if (!vsync_waiter) { - return nullptr; - } - - // Create the IO manager on the IO thread. The IO manager must be initialized - // first because it has state that the other subsystems depend on. It must - // first be booted and the necessary references obtained to initialize the - // other subsystems. - fxl::AutoResetWaitableEvent io_latch; - std::unique_ptr io_manager; - fml::WeakPtr resource_context; - fxl::RefPtr unref_queue; - auto io_task_runner = shell->GetTaskRunners().GetIOTaskRunner(); - fml::TaskRunner::RunNowOrPostTask( - io_task_runner, - [&io_latch, // - &io_manager, // - &resource_context, // - &unref_queue, // - &platform_view, // - io_task_runner // - ]() { - io_manager = std::make_unique( - platform_view->CreateResourceContext(), io_task_runner); - resource_context = io_manager->GetResourceContext(); - unref_queue = io_manager->GetSkiaUnrefQueue(); - io_latch.Signal(); - }); - io_latch.Wait(); - - // Create the rasterizer on the GPU thread. - fxl::AutoResetWaitableEvent gpu_latch; - std::unique_ptr rasterizer; - fml::TaskRunner::RunNowOrPostTask( - task_runners.GetGPUTaskRunner(), [&gpu_latch, // - &rasterizer, // - on_create_rasterizer, // - shell = shell.get() // - ]() { - if (auto new_rasterizer = on_create_rasterizer(*shell)) { - rasterizer = std::move(new_rasterizer); - } - gpu_latch.Signal(); - }); - - // Create the engine on the UI thread. - fxl::AutoResetWaitableEvent ui_latch; - std::unique_ptr engine; - fml::TaskRunner::RunNowOrPostTask( - shell->GetTaskRunners().GetUITaskRunner(), - fxl::MakeCopyable([&ui_latch, // - &engine, // - shell = shell.get(), // - vsync_waiter = std::move(vsync_waiter), // - resource_context = std::move(resource_context), // - unref_queue = std::move(unref_queue) // - ]() mutable { - const auto& task_runners = shell->GetTaskRunners(); - - // The animator is owned by the UI thread but it gets its vsync pulses - // from the platform. - auto animator = std::make_unique(*shell, task_runners, - std::move(vsync_waiter)); - - engine = std::make_unique(*shell, // - shell->GetDartVM(), // - task_runners, // - shell->GetSettings(), // - std::move(animator), // - std::move(resource_context), // - std::move(unref_queue) // - ); - ui_latch.Signal(); - })); - - gpu_latch.Wait(); - ui_latch.Wait(); - // We are already on the platform thread. So there is no platform latch to - // wait on. - - if (!shell->Setup(std::move(platform_view), // - std::move(engine), // - std::move(rasterizer), // - std::move(io_manager)) // - ) { - return nullptr; - } - - return shell; -} - -std::unique_ptr Shell::Create( - blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer) { - if (!task_runners.IsValid() || !on_create_platform_view || - !on_create_rasterizer) { - return nullptr; - } - - fxl::AutoResetWaitableEvent latch; - std::unique_ptr shell; - fml::TaskRunner::RunNowOrPostTask( - task_runners.GetPlatformTaskRunner(), - [&latch, &shell, task_runners = std::move(task_runners), settings, - on_create_platform_view, on_create_rasterizer]() { - shell = CreateShellOnPlatformThread(std::move(task_runners), settings, - on_create_platform_view, - on_create_rasterizer); - latch.Signal(); - }); - latch.Wait(); - return shell; -} - -Shell::Shell(blink::TaskRunners task_runners, blink::Settings settings) - : task_runners_(std::move(task_runners)), - settings_(std::move(settings)), - vm_(blink::DartVM::ForProcess(settings_)) { - FXL_DCHECK(task_runners_.IsValid()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - if (settings_.icu_data_path.size() != 0) { - fml::icu::InitializeICU(settings_.icu_data_path); - } else { - FXL_DLOG(WARNING) << "Skipping ICU initialization in the shell."; - } - - if (settings_.trace_skia) { - InitSkiaEventTracer(settings_.trace_skia); - } +static Shell* g_shell = nullptr; - if (!settings_.skia_deterministic_rendering_on_cpu) { - SkGraphics::Init(); - } else { - FXL_DLOG(INFO) << "Skia deterministic rendering is enabled."; - } +template +bool GetSwitchValue(const fxl::CommandLine& command_line, + Switch sw, + T* result) { + std::string switch_string; - // Install service protocol handlers. - - service_protocol_handlers_[blink::ServiceProtocol::kScreenshotExtensionName - .ToString()] = { - task_runners_.GetGPUTaskRunner(), - std::bind(&Shell::OnServiceProtocolScreenshot, this, - std::placeholders::_1, std::placeholders::_2)}; - service_protocol_handlers_[blink::ServiceProtocol::kScreenshotSkpExtensionName - .ToString()] = { - task_runners_.GetGPUTaskRunner(), - std::bind(&Shell::OnServiceProtocolScreenshotSKP, this, - std::placeholders::_1, std::placeholders::_2)}; - service_protocol_handlers_[blink::ServiceProtocol::kRunInViewExtensionName - .ToString()] = { - task_runners_.GetUITaskRunner(), - std::bind(&Shell::OnServiceProtocolRunInView, this, std::placeholders::_1, - std::placeholders::_2)}; - service_protocol_handlers_ - [blink::ServiceProtocol::kFlushUIThreadTasksExtensionName.ToString()] = { - task_runners_.GetUITaskRunner(), - std::bind(&Shell::OnServiceProtocolFlushUIThreadTasks, this, - std::placeholders::_1, std::placeholders::_2)}; - service_protocol_handlers_ - [blink::ServiceProtocol::kSetAssetBundlePathExtensionName.ToString()] = { - task_runners_.GetUITaskRunner(), - std::bind(&Shell::OnServiceProtocolSetAssetBundlePath, this, - std::placeholders::_1, std::placeholders::_2)}; -} - -Shell::~Shell() { - if (auto vm = blink::DartVM::ForProcessIfInitialized()) { - vm->GetServiceProtocol().RemoveHandler(this); - } - - fxl::AutoResetWaitableEvent ui_latch, gpu_latch, platform_latch, io_latch; - - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetUITaskRunner(), - fxl::MakeCopyable([engine = std::move(engine_), &ui_latch]() mutable { - engine.reset(); - ui_latch.Signal(); - })); - ui_latch.Wait(); - - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetGPUTaskRunner(), - fxl::MakeCopyable( - [rasterizer = std::move(rasterizer_), &gpu_latch]() mutable { - rasterizer.reset(); - gpu_latch.Signal(); - })); - gpu_latch.Wait(); - - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetIOTaskRunner(), - fxl::MakeCopyable( - [io_manager = std::move(io_manager_), &io_latch]() mutable { - io_manager.reset(); - io_latch.Signal(); - })); - - io_latch.Wait(); - - // The platform view must go last because it may be holding onto platform side - // counterparts to resources owned by subsystems running on other threads. For - // example, the NSOpenGLContext on the Mac. - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetPlatformTaskRunner(), - fxl::MakeCopyable([platform_view = std::move(platform_view_), - &platform_latch]() mutable { - platform_view.reset(); - platform_latch.Signal(); - })); - platform_latch.Wait(); -} - -bool Shell::IsSetup() const { - return is_setup_; -} - -bool Shell::Setup(std::unique_ptr platform_view, - std::unique_ptr engine, - std::unique_ptr rasterizer, - std::unique_ptr io_manager) { - if (is_setup_) { + if (!command_line.GetOptionValue(FlagForSwitch(sw), &switch_string)) { return false; } - if (!platform_view || !engine || !rasterizer || !io_manager) { - return false; - } - - platform_view_ = std::move(platform_view); - engine_ = std::move(engine); - rasterizer_ = std::move(rasterizer); - io_manager_ = std::move(io_manager); - - is_setup_ = true; - - if (auto vm = blink::DartVM::ForProcessIfInitialized()) { - vm->GetServiceProtocol().AddHandler(this); + std::stringstream stream(switch_string); + T value = 0; + if (stream >> value) { + *result = value; + return true; } - return true; + return false; } -const blink::Settings& Shell::GetSettings() const { - return settings_; -} +} // namespace -const blink::TaskRunners& Shell::GetTaskRunners() const { - return task_runners_; -} +Shell::Shell(fxl::CommandLine command_line) + : command_line_(std::move(command_line)) { + FXL_DCHECK(!g_shell); -fml::WeakPtr Shell::GetRasterizer() { - FXL_DCHECK(is_setup_); - return rasterizer_->GetWeakPtr(); -} + gpu_thread_.reset(new fml::Thread("gpu_thread")); + ui_thread_.reset(new fml::Thread("ui_thread")); + io_thread_.reset(new fml::Thread("io_thread")); -fml::WeakPtr Shell::GetEngine() { - FXL_DCHECK(is_setup_); - return engine_->GetWeakPtr(); -} + // Since we are not using fml::Thread, we need to initialize the message loop + // manually. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::Threads threads(fml::MessageLoop::GetCurrent().GetTaskRunner(), + gpu_thread_->GetTaskRunner(), + ui_thread_->GetTaskRunner(), + io_thread_->GetTaskRunner()); + blink::Threads::Set(threads); -fml::WeakPtr Shell::GetPlatformView() { - FXL_DCHECK(is_setup_); - return platform_view_->GetWeakPtr(); -} + blink::Threads::Gpu()->PostTask([this]() { InitGpuThread(); }); + blink::Threads::UI()->PostTask([this]() { InitUIThread(); }); -const blink::DartVM& Shell::GetDartVM() const { - return *vm_; + blink::SetRegisterNativeServiceProtocolExtensionHook( + PlatformViewServiceProtocol::RegisterHook); } -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewCreated(const PlatformView& view, - std::unique_ptr surface) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); +Shell::~Shell() {} - // Note: - // This is a synchronous operation because certain platforms depend on - // setup/suspension of all activities that may be interacting with the GPU in - // a synchronous fashion. +void Shell::InitStandalone(fxl::CommandLine command_line, + std::string icu_data_path, + std::string application_library_path, + std::string bundle_path) { + TRACE_EVENT0("flutter", "Shell::InitStandalone"); - fxl::AutoResetWaitableEvent latch; - auto gpu_task = fxl::MakeCopyable([rasterizer = rasterizer_->GetWeakPtr(), // - surface = std::move(surface), // - &latch]() mutable { - if (rasterizer) { - rasterizer->Setup(std::move(surface)); - } - // Step 2: All done. Signal the latch that the platform thread is waiting - // on. - latch.Signal(); - }); + fml::icu::InitializeICU(icu_data_path); - auto ui_task = [engine = engine_->GetWeakPtr(), // - gpu_task_runner = task_runners_.GetGPUTaskRunner(), // - gpu_task // - ] { - if (engine) { - engine->OnOutputSurfaceCreated(); - } - // Step 1: Next, tell the GPU thread that it should create a surface for its - // rasterizer. - fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); - }; - - // Step 0: Post a task onto the UI thread to tell the engine that it has an - // output surface. - fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); - latch.Wait(); -} - -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewDestroyed(const PlatformView& view) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + if (!command_line.HasOption( + FlagForSwitch(Switch::SkiaDeterministicRendering))) + SkGraphics::Init(); - // Note: - // This is a synchronous operation because certain platforms depend on - // setup/suspension of all activities that may be interacting with the GPU in - // a synchronous fashion. + blink::Settings settings; + settings.application_library_path = application_library_path; - fxl::AutoResetWaitableEvent latch; + // Enable Observatory + settings.enable_observatory = + !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); - auto gpu_task = [rasterizer = rasterizer_->GetWeakPtr(), &latch]() { - if (rasterizer) { - rasterizer->Teardown(); + // Set Observatory Port + if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { + if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, + &settings.observatory_port)) { + FXL_LOG(INFO) + << "Observatory port specified was malformed. Will default to " + << settings.observatory_port; } - // Step 2: All done. Signal the latch that the platform thread is waiting - // on. - latch.Signal(); - }; - - auto ui_task = [engine = engine_->GetWeakPtr(), - gpu_task_runner = task_runners_.GetGPUTaskRunner(), - gpu_task]() { - if (engine) { - engine->OnOutputSurfaceDestroyed(); - } - // Step 1: Next, tell the GPU thread that its rasterizer should suspend - // access to the underlying surface. - fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); - }; - - // Step 0: Post a task onto the UI thread to tell the engine that its output - // surface is about to go away. - fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); - latch.Wait(); -} - -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewSetViewportMetrics( - const PlatformView& view, - const blink::ViewportMetrics& metrics) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetUITaskRunner()->PostTask( - [engine = engine_->GetWeakPtr(), metrics]() { - if (engine) { - engine->SetViewportMetrics(metrics); - } - }); -} - -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewDispatchPlatformMessage( - const PlatformView& view, - fxl::RefPtr message) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetUITaskRunner()->PostTask( - [engine = engine_->GetWeakPtr(), message = std::move(message)] { - if (engine) { - engine->DispatchPlatformMessage(std::move(message)); - } - }); -} + } -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewDispatchPointerDataPacket( - const PlatformView& view, - std::unique_ptr packet) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - task_runners_.GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [engine = engine_->GetWeakPtr(), packet = std::move(packet)] { - if (engine) { - engine->DispatchPointerDataPacket(*packet); - } - })); -} + // Checked mode overrides. + settings.dart_non_checked_mode = + command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewDispatchSemanticsAction(const PlatformView& view, - int32_t id, - blink::SemanticsAction action, - std::vector args) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetUITaskRunner()->PostTask( - [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { - if (engine) { - engine->DispatchSemanticsAction(id, action, std::move(args)); - } - }); -} + settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewSetSemanticsEnabled(const PlatformView& view, - bool enabled) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetUITaskRunner()->PostTask( - [engine = engine_->GetWeakPtr(), enabled] { - if (engine) { - engine->SetSemanticsEnabled(enabled); - } - }); -} + settings.start_paused = + command_line.HasOption(FlagForSwitch(Switch::StartPaused)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewRegisterTexture( - const PlatformView& view, - std::shared_ptr texture) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), texture] { - if (rasterizer) { - if (auto registry = rasterizer->GetTextureRegistry()) { - registry->RegisterTexture(texture); - } - } - }); -} + settings.enable_dart_profiling = + command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewUnregisterTexture(const PlatformView& view, - int64_t texture_id) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { - if (rasterizer) { - if (auto registry = rasterizer->GetTextureRegistry()) { - registry->UnregisterTexture(texture_id); - } - } - }); -} + settings.enable_software_rendering = + command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, - int64_t texture_id) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + settings.using_blink = + command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); - // Tell the rasterizer that one of its textures has a new frame available. - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { - auto registry = rasterizer->GetTextureRegistry(); + settings.endless_trace_buffer = + command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); - if (!registry) { - return; - } + settings.trace_startup = + command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); - auto texture = registry->GetTexture(texture_id); + command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), + &settings.aot_snapshot_path); - if (!texture) { - return; - } + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), + &settings.aot_vm_snapshot_data_filename); - texture->MarkNewFrameAvailable(); - }); + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), + &settings.aot_vm_snapshot_instr_filename); - // Schedule a new frame without having to rebuild the layer tree. - task_runners_.GetUITaskRunner()->PostTask([engine = engine_->GetWeakPtr()]() { - if (engine) { - engine->ScheduleFrame(false); - } - }); -} + command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), + &settings.aot_isolate_snapshot_data_filename); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewSetNextFrameCallback(const PlatformView& view, - fxl::Closure closure) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), closure = std::move(closure)]() { - if (rasterizer) { - rasterizer->SetNextFrameCallback(std::move(closure)); - } - }); -} + command_line.GetOptionValue(FlagForSwitch(Switch::AotSharedLibraryPath), + &settings.aot_shared_library_path); -// |shell::Animator::Delegate| -void Shell::OnAnimatorBeginFrame(const Animator& animator, - fxl::TimePoint frame_time) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + command_line.GetOptionValue( + FlagForSwitch(Switch::AotIsolateSnapshotInstructions), + &settings.aot_isolate_snapshot_instr_filename); - if (engine_) { - engine_->BeginFrame(frame_time); - } -} + command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), + &settings.temp_directory_path); -// |shell::Animator::Delegate| -void Shell::OnAnimatorNotifyIdle(const Animator& animator, int64_t deadline) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + settings.use_test_fonts = + command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); - if (engine_) { - engine_->NotifyIdle(deadline); + std::string all_dart_flags; + if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), + &all_dart_flags)) { + std::stringstream stream(all_dart_flags); + std::istream_iterator end; + for (std::istream_iterator it(stream); it != end; ++it) + settings.dart_flags.push_back(*it); } -} -// |shell::Animator::Delegate| -void Shell::OnAnimatorDraw( - const Animator& animator, - fxl::RefPtr> pipeline) { - FXL_DCHECK(is_setup_); - - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), - pipeline = std::move(pipeline)]() { - if (rasterizer) { - rasterizer->Draw(pipeline); - } - }); -} + command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); -// |shell::Animator::Delegate| -void Shell::OnAnimatorDrawLastLayerTree(const Animator& animator) { - FXL_DCHECK(is_setup_); + blink::Settings::Set(settings); - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr()]() { - if (rasterizer) { - rasterizer->DrawLastLayerTree(); - } - }); + Init(std::move(command_line), bundle_path); } -// |shell::Engine::Delegate| -void Shell::OnEngineUpdateSemantics(const Engine& engine, - blink::SemanticsNodeUpdates update) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); +void Shell::Init(fxl::CommandLine command_line, + const std::string& bundle_path) { +#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE + bool trace_skia = command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); + InitSkiaEventTracer(trace_skia); +#endif - task_runners_.GetPlatformTaskRunner()->PostTask( - [view = platform_view_->GetWeakPtr(), update = std::move(update)] { - if (view) { - view->UpdateSemantics(std::move(update)); - } - }); + FXL_DCHECK(!g_shell); + g_shell = new Shell(std::move(command_line)); + blink::Threads::UI()->PostTask( + [bundle_path]() { Engine::Init(bundle_path); }); } -// |shell::Engine::Delegate| -void Shell::OnEngineHandlePlatformMessage( - const Engine& engine, - fxl::RefPtr message) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetPlatformTaskRunner()->PostTask( - [view = platform_view_->GetWeakPtr(), message = std::move(message)]() { - if (view) { - view->HandlePlatformMessage(std::move(message)); - } - }); +Shell& Shell::Shared() { + FXL_DCHECK(g_shell); + return *g_shell; } -// |blink::ServiceProtocol::Handler| -fxl::RefPtr Shell::GetServiceProtocolHandlerTaskRunner( - fxl::StringView method) const { - FXL_DCHECK(is_setup_); - auto found = service_protocol_handlers_.find(method.ToString()); - if (found != service_protocol_handlers_.end()) { - return found->second.first; - } - return task_runners_.GetUITaskRunner(); +const fxl::CommandLine& Shell::GetCommandLine() const { + return command_line_; } -// |blink::ServiceProtocol::Handler| -bool Shell::HandleServiceProtocolMessage( - fxl::StringView method, // one if the extension names specified above. - const ServiceProtocolMap& params, - rapidjson::Document& response) { - auto found = service_protocol_handlers_.find(method.ToString()); - if (found != service_protocol_handlers_.end()) { - return found->second.second(params, response); - } - return false; +void Shell::InitGpuThread() { + gpu_thread_checker_.reset(new fxl::ThreadChecker()); } -// |blink::ServiceProtocol::Handler| -blink::ServiceProtocol::Handler::Description -Shell::GetServiceProtocolDescription() const { - return { - engine_->GetUIIsolateMainPort(), - engine_->GetUIIsolateName(), - }; +void Shell::InitUIThread() { + ui_thread_checker_.reset(new fxl::ThreadChecker()); } -static void ServiceProtocolParameterError(rapidjson::Document& response, - std::string parameter_name) { - auto& allocator = response.GetAllocator(); - response.SetObject(); - const int64_t kInvalidParams = -32602; - response.AddMember("code", kInvalidParams, allocator); - response.AddMember("message", "Invalid params", allocator); - { - rapidjson::Value details(rapidjson::kObjectType); - details.AddMember("details", parameter_name, allocator); - response.AddMember("data", details, allocator); +void Shell::AddPlatformView(PlatformView* platform_view) { + if (platform_view == nullptr) { + return; } + std::lock_guard lock(platform_views_mutex_); + platform_views_.insert(platform_view); } -// Service protocol handler -bool Shell::OnServiceProtocolScreenshot( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); - auto screenshot = rasterizer_->ScreenshotLastLayerTree( - Rasterizer::ScreenshotType::CompressedImage, true); - if (screenshot.data) { - response.SetObject(); - auto& allocator = response.GetAllocator(); - response.AddMember("type", "Screenshot", allocator); - rapidjson::Value image; - image.SetString(static_cast(screenshot.data->data()), - screenshot.data->size(), allocator); - response.AddMember("screenshot", image, allocator); - return true; +void Shell::RemovePlatformView(PlatformView* platform_view) { + if (platform_view == nullptr) { + return; } - ServiceProtocolParameterError(response, - "Could not capture image screenshot."); - return false; + std::lock_guard lock(platform_views_mutex_); + platform_views_.erase(platform_view); } -// Service protocol handler -bool Shell::OnServiceProtocolScreenshotSKP( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); - auto screenshot = rasterizer_->ScreenshotLastLayerTree( - Rasterizer::ScreenshotType::SkiaPicture, true); - if (screenshot.data) { - response.SetObject(); - auto& allocator = response.GetAllocator(); - response.AddMember("type", "ScreenshotSkp", allocator); - rapidjson::Value skp; - skp.SetString(static_cast(screenshot.data->data()), - screenshot.data->size(), allocator); - response.AddMember("skp", skp, allocator); - return true; +void Shell::IteratePlatformViews( + std::function iterator) const { + if (iterator == nullptr) { + return; } - ServiceProtocolParameterError(response, "Could not capture SKP screenshot."); - return false; -} - -// Service protocol handler -bool Shell::OnServiceProtocolRunInView( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - - if (params.count("mainScript") == 0) { - ServiceProtocolParameterError(response, - "'mainScript' parameter is missing."); - return false; - } - - if (params.count("packagesFile") == 0) { - ServiceProtocolParameterError(response, - "'packagesFile' parameter is missing."); - return false; - } - - if (params.count("assetDirectory") == 0) { - ServiceProtocolParameterError(response, - "'assetDirectory' parameter is missing."); - return false; - } - - RunConfiguration configuration(IsolateConfiguration::CreateForSource( - params.at("mainScript").ToString(), - params.at("packagesFile").ToString())); - - configuration.AddAssetResolver(std::make_unique( - fml::OpenFile(params.at("assetDirectory").ToString().c_str(), - fml::OpenPermission::kRead, true))); - - auto& allocator = response.GetAllocator(); - response.SetObject(); - if (engine_->Restart(std::move(configuration))) { - response.AddMember("type", "Success", allocator); - auto new_description = GetServiceProtocolDescription(); - rapidjson::Value view(rapidjson::kObjectType); - new_description.Write(this, view, allocator); - response.AddMember("view", view, allocator); - return true; - } else { - FXL_DLOG(ERROR) << "Could not run configuration in engine."; - response.AddMember("type", "Failure", allocator); - return false; + std::lock_guard lock(platform_views_mutex_); + for (PlatformView* view : platform_views_) { + if (!iterator(view)) { + return; + } } - - FXL_DCHECK(false); - return false; } -// Service protocol handler -bool Shell::OnServiceProtocolFlushUIThreadTasks( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - // This API should not be invoked by production code. - // It can potentially starve the service isolate if the main isolate pauses - // at a breakpoint or is in an infinite loop. - // - // It should be invoked from the VM Service and and blocks it until UI thread - // tasks are processed. - response.SetObject(); - response.AddMember("type", "Success", response.GetAllocator()); - return true; +void Shell::RunInPlatformView(uintptr_t view_id, + const char* main_script, + const char* packages_file, + const char* asset_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name) { + fxl::AutoResetWaitableEvent latch; + FXL_DCHECK(view_id != 0); + FXL_DCHECK(main_script); + FXL_DCHECK(packages_file); + FXL_DCHECK(asset_directory); + FXL_DCHECK(view_existed); + + blink::Threads::UI()->PostTask([this, view_id, main_script, packages_file, + asset_directory, view_existed, + dart_isolate_id, isolate_name, &latch]() { + RunInPlatformViewUIThread(view_id, main_script, packages_file, + asset_directory, view_existed, dart_isolate_id, + isolate_name, &latch); + }); + latch.Wait(); } -// Service protocol handler -bool Shell::OnServiceProtocolSetAssetBundlePath( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - - if (params.count("assetDirectory") == 0) { - ServiceProtocolParameterError(response, - "'assetDirectory' parameter is missing."); - return false; - } - - auto& allocator = response.GetAllocator(); - response.SetObject(); - - auto asset_manager = fxl::MakeRefCounted(); - - asset_manager->PushFront(std::make_unique( - fml::OpenFile(params.at("assetDirectory").ToString().c_str(), - fml::OpenPermission::kRead, true))); - - if (engine_->UpdateAssetManager(std::move(asset_manager))) { - response.AddMember("type", "Success", allocator); - auto new_description = GetServiceProtocolDescription(); - rapidjson::Value view(rapidjson::kObjectType); - new_description.Write(this, view, allocator); - response.AddMember("view", view, allocator); - return true; - } else { - FXL_DLOG(ERROR) << "Could not update asset directory."; - response.AddMember("type", "Failure", allocator); - return false; - } +void Shell::RunInPlatformViewUIThread(uintptr_t view_id, + const std::string& main, + const std::string& packages, + const std::string& assets_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name, + fxl::AutoResetWaitableEvent* latch) { + FXL_DCHECK(ui_thread_checker_ && + ui_thread_checker_->IsCreationThreadCurrent()); + + *view_existed = false; + + IteratePlatformViews( + [view_id, // argument +#if !defined(OS_WIN) + // Using std::move on const references inside lambda capture is + // not supported on Windows for some reason. + assets_directory = std::move(assets_directory), // argument + main = std::move(main), // argument + packages = std::move(packages), // argument +#else + assets_directory, // argument + main, // argument + packages, // argument +#endif + &view_existed, // out + &dart_isolate_id, // out + &isolate_name // out + ](PlatformView* view) -> bool { + if (reinterpret_cast(view) != view_id) { + // Keep looking. + return true; + } + *view_existed = true; + view->RunFromSource(assets_directory, main, packages); + *dart_isolate_id = view->engine().GetUIIsolateMainPort(); + *isolate_name = view->engine().GetUIIsolateName(); + // We found the requested view. Stop iterating over platform views. + return false; + }); - FXL_DCHECK(false); - return false; + latch->Signal(); } -Rasterizer::Screenshot Shell::Screenshot( - Rasterizer::ScreenshotType screenshot_type, - bool base64_encode) { - TRACE_EVENT0("flutter", "Shell::Screenshot"); +void Shell::SetAssetBundlePathInPlatformView(uintptr_t view_id, + const char* asset_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name) { fxl::AutoResetWaitableEvent latch; - Rasterizer::Screenshot screenshot; - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetGPUTaskRunner(), [&latch, // - rasterizer = GetRasterizer(), // - &screenshot, // - screenshot_type, // - base64_encode // - ]() { - if (rasterizer) { - screenshot = rasterizer->ScreenshotLastLayerTree(screenshot_type, - base64_encode); + FXL_DCHECK(view_id != 0); + FXL_DCHECK(asset_directory); + FXL_DCHECK(view_existed); + + blink::Threads::UI()->PostTask([this, view_id, asset_directory, view_existed, + dart_isolate_id, isolate_name, &latch]() { + SetAssetBundlePathInPlatformViewUIThread(view_id, asset_directory, + view_existed, dart_isolate_id, + isolate_name, &latch); + }); + latch.Wait(); +} + +void Shell::SetAssetBundlePathInPlatformViewUIThread( + uintptr_t view_id, + const std::string& assets_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name, + fxl::AutoResetWaitableEvent* latch) { + FXL_DCHECK(ui_thread_checker_ && + ui_thread_checker_->IsCreationThreadCurrent()); + + *view_existed = false; + + IteratePlatformViews( + [view_id, // argument +#if !defined(OS_WIN) + // Using std::move on const references inside lambda capture is + // not supported on Windows for some reason. + // TODO(https://github.com/flutter/flutter/issues/13908): + // Investigate the root cause of the difference. + assets_directory = std::move(assets_directory), // argument +#else + assets_directory, // argument +#endif + &view_existed, // out + &dart_isolate_id, // out + &isolate_name // out + ](PlatformView* view) -> bool { + if (reinterpret_cast(view) != view_id) { + // Keep looking. + return true; } - latch.Signal(); + *view_existed = true; + view->SetAssetBundlePath(assets_directory); + *dart_isolate_id = view->engine().GetUIIsolateMainPort(); + *isolate_name = view->engine().GetUIIsolateName(); + // We found the requested view. Stop iterating over + // platform views. + return false; }); - latch.Wait(); - return screenshot; + + latch->Signal(); } } // namespace shell diff --git a/shell/common/shell.h b/shell/common/shell.h index 02a642b0ba40f..92c315dcf2aa7 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -5,214 +5,96 @@ #ifndef SHELL_COMMON_SHELL_H_ #define SHELL_COMMON_SHELL_H_ -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" -#include "flutter/flow/texture.h" -#include "flutter/fml/memory/thread_checker.h" -#include "flutter/fml/memory/weak_ptr.h" +#include +#include + #include "flutter/fml/thread.h" -#include "flutter/lib/ui/semantics/semantics_node.h" -#include "flutter/lib/ui/window/platform_message.h" -#include "flutter/runtime/service_protocol.h" -#include "flutter/shell/common/animator.h" -#include "flutter/shell/common/engine.h" -#include "flutter/shell/common/io_manager.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/surface.h" +#include "flutter/shell/common/tracing_controller.h" +#include "lib/fxl/command_line.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" #include "lib/fxl/memory/weak_ptr.h" -#include "lib/fxl/strings/string_view.h" -#include "lib/fxl/synchronization/thread_annotations.h" #include "lib/fxl/synchronization/thread_checker.h" #include "lib/fxl/synchronization/waitable_event.h" +#include "lib/fxl/tasks/task_runner.h" namespace shell { -class Shell final : public PlatformView::Delegate, - public Animator::Delegate, - public Engine::Delegate, - public blink::ServiceProtocol::Handler { - public: - template - using CreateCallback = std::function(Shell&)>; - static std::unique_ptr Create( - blink::TaskRunners task_runners, - blink::Settings settings, - CreateCallback on_create_platform_view, - CreateCallback on_create_rasterizer); +class PlatformView; +class Shell { + public: ~Shell(); - const blink::Settings& GetSettings() const; + static void InitStandalone(fxl::CommandLine command_line, + std::string icu_data_path = "", + std::string application_library_path = "", + std::string bundle_path = ""); - const blink::TaskRunners& GetTaskRunners() const; + static Shell& Shared(); - fml::WeakPtr GetRasterizer(); + const fxl::CommandLine& GetCommandLine() const; - fml::WeakPtr GetEngine(); + void AddPlatformView(PlatformView* platform_view); - fml::WeakPtr GetPlatformView(); + void RemovePlatformView(PlatformView* platform_view); - const blink::DartVM& GetDartVM() const; + void IteratePlatformViews( + std::function iterator) const; - bool IsSetup() const; + // Attempt to run a script inside a flutter view indicated by |view_id|. + // Will set |view_existed| to true if the view was found and false otherwise. + void RunInPlatformView(uintptr_t view_id, + const char* main_script, + const char* packages_file, + const char* asset_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name); - Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, - bool base64_encode); + void SetAssetBundlePathInPlatformView(uintptr_t view_id, + const char* asset_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name); private: - using ServiceProtocolHandler = std::function; - - const blink::TaskRunners task_runners_; - const blink::Settings settings_; - fxl::RefPtr vm_; - std::unique_ptr platform_view_; // on platform task runner - std::unique_ptr engine_; // on UI task runner - std::unique_ptr rasterizer_; // on GPU task runner - std::unique_ptr io_manager_; // on IO task runner - - std::unordered_map, - ServiceProtocolHandler> // task-runner/function - // pair - > - service_protocol_handlers_; - bool is_setup_ = false; - - Shell(blink::TaskRunners task_runners, blink::Settings settings); - - static std::unique_ptr CreateShellOnPlatformThread( - blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer); - - bool Setup(std::unique_ptr platform_view, - std::unique_ptr engine, - std::unique_ptr rasterizer, - std::unique_ptr io_manager); - - // |shell::PlatformView::Delegate| - void OnPlatformViewCreated(const PlatformView& view, - std::unique_ptr surface) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewDestroyed(const PlatformView& view) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewSetViewportMetrics( - const PlatformView& view, - const blink::ViewportMetrics& metrics) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewDispatchPlatformMessage( - const PlatformView& view, - fxl::RefPtr message) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewDispatchPointerDataPacket( - const PlatformView& view, - std::unique_ptr packet) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewDispatchSemanticsAction( - const PlatformView& view, - int32_t id, - blink::SemanticsAction action, - std::vector args) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, - bool enabled) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewRegisterTexture( - const PlatformView& view, - std::shared_ptr texture) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewUnregisterTexture(const PlatformView& view, - int64_t texture_id) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, - int64_t texture_id) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewSetNextFrameCallback(const PlatformView& view, - fxl::Closure closure) override; - - // |shell::Animator::Delegate| - void OnAnimatorBeginFrame(const Animator& animator, - fxl::TimePoint frame_time) override; - - // |shell::Animator::Delegate| - void OnAnimatorNotifyIdle(const Animator& animator, - int64_t deadline) override; - - // |shell::Animator::Delegate| - void OnAnimatorDraw( - const Animator& animator, - fxl::RefPtr> pipeline) override; - - // |shell::Animator::Delegate| - void OnAnimatorDrawLastLayerTree(const Animator& animator) override; - - // |shell::Engine::Delegate| - void OnEngineUpdateSemantics(const Engine& engine, - blink::SemanticsNodeUpdates update) override; - - // |shell::Engine::Delegate| - void OnEngineHandlePlatformMessage( - const Engine& engine, - fxl::RefPtr message) override; - - // |blink::ServiceProtocol::Handler| - fxl::RefPtr GetServiceProtocolHandlerTaskRunner( - fxl::StringView method) const override; - - // |blink::ServiceProtocol::Handler| - bool HandleServiceProtocolMessage( - fxl::StringView method, // one if the extension names specified above. - const ServiceProtocolMap& params, - rapidjson::Document& response) override; - - // |blink::ServiceProtocol::Handler| - blink::ServiceProtocol::Handler::Description GetServiceProtocolDescription() - const override; - - // Service protocol handler - bool OnServiceProtocolScreenshot( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); - - // Service protocol handler - bool OnServiceProtocolScreenshotSKP( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); - - // Service protocol handler - bool OnServiceProtocolRunInView( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); - - // Service protocol handler - bool OnServiceProtocolFlushUIThreadTasks( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); - - // Service protocol handler - bool OnServiceProtocolSetAssetBundlePath( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); + fxl::CommandLine command_line_; + std::unique_ptr gpu_thread_; + std::unique_ptr ui_thread_; + std::unique_ptr io_thread_; + std::unique_ptr gpu_thread_checker_; + std::unique_ptr ui_thread_checker_; + TracingController tracing_controller_; + mutable std::mutex platform_views_mutex_; + std::unordered_set platform_views_; + + static void Init(fxl::CommandLine command_line, + const std::string& bundle_path); + + Shell(fxl::CommandLine command_line); + + void InitGpuThread(); + + void InitUIThread(); + + void RunInPlatformViewUIThread(uintptr_t view_id, + const std::string& main, + const std::string& packages, + const std::string& assets_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name, + fxl::AutoResetWaitableEvent* latch); + + void SetAssetBundlePathInPlatformViewUIThread( + uintptr_t view_id, + const std::string& main, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name, + fxl::AutoResetWaitableEvent* latch); FXL_DISALLOW_COPY_AND_ASSIGN(Shell); }; diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc deleted file mode 100644 index 67689341a1586..0000000000000 --- a/shell/common/shell_unittests.cc +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2017 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 -#include -#include - -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/thread_host.h" -#include "gtest/gtest.h" -#include "lib/fxl/synchronization/waitable_event.h" - -#define CURRENT_TEST_NAME \ - std::string { \ - ::testing::UnitTest::GetInstance()->current_test_info()->name() \ - } - -namespace shell { - -TEST(ShellTest, InitializeWithInvalidThreads) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - blink::TaskRunners task_runners("test", nullptr, nullptr, nullptr, nullptr); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_FALSE(shell); -} - -TEST(ShellTest, InitializeWithDifferentThreads) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", - ThreadHost::Type::Platform | ThreadHost::Type::GPU | - ThreadHost::Type::IO | ThreadHost::Type::UI); - blink::TaskRunners task_runners("test", - thread_host.platform_thread->GetTaskRunner(), - thread_host.gpu_thread->GetTaskRunner(), - thread_host.ui_thread->GetTaskRunner(), - thread_host.io_thread->GetTaskRunner()); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_TRUE(shell); -} - -TEST(ShellTest, InitializeWithSingleThread) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", - ThreadHost::Type::Platform); - auto task_runner = thread_host.platform_thread->GetTaskRunner(); - blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, - task_runner); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_TRUE(shell); -} - -TEST(ShellTest, InitializeWithSingleThreadWhichIsTheCallingThread) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - fml::MessageLoop::EnsureInitializedForCurrentThread(); - auto task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); - blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, - task_runner); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_TRUE(shell); -} - -TEST(ShellTest, InitializeWithMultipleThreadButCallingThreadAsPlatformThread) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - ThreadHost thread_host( - "io.flutter.test." + CURRENT_TEST_NAME + ".", - ThreadHost::Type::GPU | ThreadHost::Type::IO | ThreadHost::Type::UI); - fml::MessageLoop::EnsureInitializedForCurrentThread(); - blink::TaskRunners task_runners( - "test", fml::MessageLoop::GetCurrent().GetTaskRunner(), - thread_host.gpu_thread->GetTaskRunner(), - thread_host.ui_thread->GetTaskRunner(), - thread_host.io_thread->GetTaskRunner()); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_TRUE(shell); -} - -} // namespace shell diff --git a/shell/common/surface.cc b/shell/common/surface.cc index 228647e8b3512..01d288a5e5085 100644 --- a/shell/common/surface.cc +++ b/shell/common/surface.cc @@ -3,7 +3,6 @@ // found in the LICENSE file. #include "flutter/shell/common/surface.h" - #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" #include "third_party/skia/include/core/SkSurface.h" @@ -60,22 +59,27 @@ bool SurfaceFrame::PerformSubmit() { return false; } -Surface::Surface() : Surface(std::make_unique()) {} +Surface::Surface() : scale_(1.0) {} + +Surface::~Surface() = default; -Surface::Surface(std::unique_ptr compositor_context) - : compositor_context_(std::move(compositor_context)) { - FXL_DCHECK(compositor_context_); - // TODO: Get rid of these explicit calls and move the logic to the c/dtors of - // the compositor context. - compositor_context_->OnGrContextCreated(); +bool Surface::SupportsScaling() const { + return false; } -Surface::~Surface() { - compositor_context_->OnGrContextDestroyed(); +double Surface::GetScale() const { + return scale_; } -flow::CompositorContext& Surface::GetCompositorContext() { - return *compositor_context_; +void Surface::SetScale(double scale) { + static constexpr double kMaxScale = 1.0; + static constexpr double kMinScale = 0.25; + if (scale > kMaxScale) { + scale = kMaxScale; + } else if (scale < kMinScale) { + scale = kMinScale; + } + scale_ = scale; } } // namespace shell diff --git a/shell/common/surface.h b/shell/common/surface.h index 6133a7d519fff..906480237f416 100644 --- a/shell/common/surface.h +++ b/shell/common/surface.h @@ -7,7 +7,7 @@ #include -#include "flutter/flow/compositor_context.h" +#include "lib/fxl/compiler_specific.h" #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -45,8 +45,6 @@ class Surface { public: Surface(); - Surface(std::unique_ptr compositor_context); - virtual ~Surface(); virtual bool IsValid() = 0; @@ -55,12 +53,14 @@ class Surface { virtual GrContext* GetContext() = 0; - flow::CompositorContext& GetCompositorContext(); + virtual bool SupportsScaling() const; - private: - std::unique_ptr compositor_context_; + double GetScale() const; - FXL_DISALLOW_COPY_AND_ASSIGN(Surface); + void SetScale(double scale); + + private: + double scale_; }; } // namespace shell diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 82da6ee180af8..c1c82ff166ac1 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -5,7 +5,6 @@ #include #include #include -#include #include #include @@ -91,125 +90,4 @@ const fxl::StringView FlagForSwitch(Switch swtch) { return fxl::StringView(); } -template -static bool GetSwitchValue(const fxl::CommandLine& command_line, - shell::Switch sw, - T* result) { - std::string switch_string; - - if (!command_line.GetOptionValue(shell::FlagForSwitch(sw), &switch_string)) { - return false; - } - - std::stringstream stream(switch_string); - T value = 0; - if (stream >> value) { - *result = value; - return true; - } - - return false; -} - -blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { - blink::Settings settings = {}; - - // Enable Observatory - settings.enable_observatory = - !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); - - // Set Observatory Port - if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { - if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, - &settings.observatory_port)) { - FXL_LOG(INFO) - << "Observatory port specified was malformed. Will default to " - << settings.observatory_port; - } - } - - // Checked mode overrides. - settings.dart_non_checked_mode = - command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); - - settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); - - settings.start_paused = - command_line.HasOption(FlagForSwitch(Switch::StartPaused)); - - settings.enable_dart_profiling = - command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); - - settings.enable_software_rendering = - command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); - - settings.using_blink = - command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); - - settings.endless_trace_buffer = - command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); - - settings.trace_startup = - command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); - - settings.skia_deterministic_rendering_on_cpu = - command_line.HasOption(FlagForSwitch(Switch::SkiaDeterministicRendering)); - - command_line.GetOptionValue(FlagForSwitch(Switch::FLX), &settings.flx_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir), - &settings.assets_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::Snapshot), - &settings.script_snapshot_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::MainDartFile), - &settings.main_dart_file_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::Packages), - &settings.packages_file_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), - &settings.aot_snapshot_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), - &settings.aot_vm_snapshot_data_filename); - - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), - &settings.aot_vm_snapshot_instr_filename); - - command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), - &settings.aot_isolate_snapshot_data_filename); - - command_line.GetOptionValue( - FlagForSwitch(Switch::AotIsolateSnapshotInstructions), - &settings.aot_isolate_snapshot_instr_filename); - - command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), - &settings.temp_directory_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::ICUDataFilePath), - &settings.icu_data_path); - - settings.use_test_fonts = - command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); - - command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); - std::string all_dart_flags; - if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), - &all_dart_flags)) { - std::stringstream stream(all_dart_flags); - std::istream_iterator end; - for (std::istream_iterator it(stream); it != end; ++it) - settings.dart_flags.push_back(*it); - } - -#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - settings.trace_skia = - command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); -#endif - - return settings; -} - } // namespace shell diff --git a/shell/common/switches.h b/shell/common/switches.h index 6b67b1f6a1567..91778a78e92cc 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/common/settings.h" -#include "lib/fxl/command_line.h" #include "lib/fxl/strings/string_view.h" #ifndef SHELL_COMMON_SWITCHES_H_ @@ -25,29 +23,12 @@ namespace shell { DEF_SWITCHES_START DEF_SWITCH(AotSharedLibraryPath, "aot-shared-library-path", "Path to the *.so.") -DEF_SWITCH(AotSnapshotPath, - "aot-snapshot-path", - "Path to the directory containing the four files specified by " - "AotVmSnapshotData, AotVmSnapshotInstructions, " - "AotVmSnapshotInstructions and AotIsolateSnapshotInstructions.") -DEF_SWITCH(AotVmSnapshotData, - "vm-snapshot-data", - "The VM snapshot data that will be memory mapped as read-only. " - "AotSnapshotPath must be present.") -DEF_SWITCH(AotVmSnapshotInstructions, - "vm-snapshot-instr", - "The VM instructions snapshot that will be memory mapped as read " - "and executable. AotSnapshotPath must be present.") -DEF_SWITCH(AotIsolateSnapshotData, - "isolate-snapshot-data", - "The isolate snapshot data that will be memory mapped as read-only. " - "AotSnapshotPath must be present.") -DEF_SWITCH(AotIsolateSnapshotInstructions, - "isolate-snapshot-instr", - "The isolate instructions snapshot that will be memory mapped as " - "read and executable. AotSnapshotPath must be present.") +DEF_SWITCH(AotSnapshotPath, "aot-snapshot-path", "Path to the AOT snapshot.") +DEF_SWITCH(AotVmSnapshotData, "vm-snapshot-data", "") +DEF_SWITCH(AotVmSnapshotInstructions, "vm-snapshot-instr", "") +DEF_SWITCH(AotIsolateSnapshotData, "isolate-snapshot-data", "") +DEF_SWITCH(AotIsolateSnapshotInstructions, "isolate-snapshot-instr", "") DEF_SWITCH(CacheDirPath, "cache-dir-path", "Path to the cache directory.") -DEF_SWITCH(ICUDataFilePath, "icu-data-file-path", "Path to the ICU data file.") DEF_SWITCH(DartFlags, "dart-flags", "Flags passed directly to the Dart VM without being interpreted " @@ -92,6 +73,10 @@ DEF_SWITCH(FlutterAssetsDir, DEF_SWITCH(Help, "help", "Display this help text.") DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.") DEF_SWITCH(MainDartFile, "dart-main", "The path to the main Dart file.") +DEF_SWITCH(NonInteractive, + "non-interactive", + "Make the shell non-interactive. By default, the shell attempts " + "to setup a window and create an OpenGL context.") DEF_SWITCH(Packages, "packages", "Specify the path to the packages.") DEF_SWITCH(Snapshot, "snapshot-blob", "Specify the path to the snapshot blob") DEF_SWITCH(StartPaused, @@ -128,9 +113,7 @@ DEF_SWITCHES_END void PrintUsage(const std::string& executable_name); -const fxl::StringView FlagForSwitch(Switch swtch); - -blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line); +const fxl::StringView FlagForSwitch(Switch sw); } // namespace shell diff --git a/shell/common/thread_host.cc b/shell/common/thread_host.cc deleted file mode 100644 index f35594829d5d9..0000000000000 --- a/shell/common/thread_host.cc +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2017 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/shell/common/thread_host.h" - -namespace shell { - -ThreadHost::ThreadHost() = default; - -ThreadHost::ThreadHost(std::string name_prefix, uint64_t mask) { - if (mask & ThreadHost::Type::Platform) { - platform_thread = std::make_unique(name_prefix + ".platform"); - } - - if (mask & ThreadHost::Type::UI) { - ui_thread = std::make_unique(name_prefix + ".ui"); - } - - if (mask & ThreadHost::Type::GPU) { - gpu_thread = std::make_unique(name_prefix + ".gpu"); - } - - if (mask & ThreadHost::Type::IO) { - io_thread = std::make_unique(name_prefix + ".io"); - } -} - -ThreadHost::~ThreadHost() = default; - -void ThreadHost::Reset() { - platform_thread.reset(); - ui_thread.reset(); - gpu_thread.reset(); - io_thread.reset(); -} - -} // namespace shell diff --git a/shell/common/thread_host.h b/shell/common/thread_host.h deleted file mode 100644 index a688aa6a06a85..0000000000000 --- a/shell/common/thread_host.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2017 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_SHELL_COMMON_THREAD_HOST_H_ -#define FLUTTER_SHELL_COMMON_THREAD_HOST_H_ - -#include - -#include "flutter/fml/thread.h" -#include "lib/fxl/macros.h" - -namespace shell { - -struct ThreadHost { - enum Type { - Platform = 1 << 0, - UI = 1 << 1, - GPU = 1 << 2, - IO = 1 << 3, - }; - - std::unique_ptr platform_thread; - std::unique_ptr ui_thread; - std::unique_ptr gpu_thread; - std::unique_ptr io_thread; - - ThreadHost(); - - ThreadHost(ThreadHost&&) = default; - - ThreadHost& operator=(ThreadHost&&) = default; - - ThreadHost(std::string name_prefix, uint64_t type_mask); - - ~ThreadHost(); - - void Reset(); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_THREAD_HOST_H_ diff --git a/shell/common/tracing_controller.cc b/shell/common/tracing_controller.cc new file mode 100644 index 0000000000000..6fa8d9d5ee87f --- /dev/null +++ b/shell/common/tracing_controller.cc @@ -0,0 +1,51 @@ +// Copyright 2015 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. + +#include "flutter/shell/common/tracing_controller.h" + +#include + +#include "flutter/common/threads.h" +#include "flutter/fml/trace_event.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/shell/common/shell.h" +#include "lib/fxl/logging.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace shell { + +TracingController::TracingController() : tracing_active_(false) { + blink::SetEmbedderTracingCallbacks( + std::unique_ptr( + new blink::EmbedderTracingCallbacks([this]() { StartTracing(); }, + [this]() { StopTracing(); }))); +} + +TracingController::~TracingController() { + blink::SetEmbedderTracingCallbacks(nullptr); +} + +static void AddTraceMetadata() { + blink::Threads::Gpu()->PostTask([]() { Dart_SetThreadName("gpu_thread"); }); + blink::Threads::UI()->PostTask([]() { Dart_SetThreadName("ui_thread"); }); + blink::Threads::IO()->PostTask([]() { Dart_SetThreadName("io_thread"); }); + blink::Threads::Platform()->PostTask( + []() { Dart_SetThreadName("platform_thread"); }); +} + +void TracingController::StartTracing() { + if (tracing_active_) + return; + tracing_active_ = true; + AddTraceMetadata(); +} + +void TracingController::StopTracing() { + if (!tracing_active_) { + return; + } + tracing_active_ = false; +} + +} // namespace shell diff --git a/shell/common/tracing_controller.h b/shell/common/tracing_controller.h new file mode 100644 index 0000000000000..3f9e6f03ab14c --- /dev/null +++ b/shell/common/tracing_controller.h @@ -0,0 +1,34 @@ +// Copyright 2015 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. + +#ifndef SHELL_COMMON_TRACING_CONTROLLER_H_ +#define SHELL_COMMON_TRACING_CONTROLLER_H_ + +#include + +#include "lib/fxl/macros.h" + +namespace shell { + +class TracingController { + public: + TracingController(); + + ~TracingController(); + + void StartTracing(); + + void StopTracing(); + + bool tracing_active() const { return tracing_active_; } + + private: + bool tracing_active_; + + FXL_DISALLOW_COPY_AND_ASSIGN(TracingController); +}; + +} // namespace shell + +#endif // SHELL_COMMON_TRACING_CONTROLLER_H_ diff --git a/shell/common/vsync_waiter.cc b/shell/common/vsync_waiter.cc index ba2f21c389c11..5acc235b1f68d 100644 --- a/shell/common/vsync_waiter.cc +++ b/shell/common/vsync_waiter.cc @@ -4,45 +4,8 @@ #include "flutter/shell/common/vsync_waiter.h" -#include "flutter/fml/task_runner.h" -#include "flutter/fml/trace_event.h" - namespace shell { -VsyncWaiter::VsyncWaiter(blink::TaskRunners task_runners) - : task_runners_(std::move(task_runners)) {} - VsyncWaiter::~VsyncWaiter() = default; -void VsyncWaiter::AsyncWaitForVsync(Callback callback) { - { - std::lock_guard lock(callback_mutex_); - callback_ = std::move(callback); - } - AwaitVSync(); -} - -void VsyncWaiter::FireCallback(fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time) { - Callback callback; - - { - std::lock_guard lock(callback_mutex_); - callback = std::move(callback_); - } - - if (!callback) { - return; - } - - task_runners_.GetUITaskRunner()->PostTask( - [callback, frame_start_time, frame_target_time]() { - // Note: The tag name must be "VSYNC" (it is special) so that the - // "Highlight - // Vsync" checkbox in the timeline can be enabled. - TRACE_EVENT0("flutter", "VSYNC"); - callback(frame_start_time, frame_target_time); - }); -} - } // namespace shell diff --git a/shell/common/vsync_waiter.h b/shell/common/vsync_waiter.h index 82231fdf4f853..77319ed8b6966 100644 --- a/shell/common/vsync_waiter.h +++ b/shell/common/vsync_waiter.h @@ -6,10 +6,7 @@ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_H_ #include -#include -#include -#include "flutter/common/task_runners.h" #include "lib/fxl/time/time_point.h" namespace shell { @@ -19,23 +16,9 @@ class VsyncWaiter { using Callback = std::function; - virtual ~VsyncWaiter(); - - void AsyncWaitForVsync(Callback callback); - - protected: - const blink::TaskRunners task_runners_; - std::mutex callback_mutex_; - Callback callback_; - - VsyncWaiter(blink::TaskRunners task_runners); + virtual void AsyncWaitForVsync(Callback callback) = 0; - virtual void AwaitVSync() = 0; - - void FireCallback(fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time); - - FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiter); + virtual ~VsyncWaiter(); }; } // namespace shell diff --git a/shell/common/vsync_waiter_fallback.cc b/shell/common/vsync_waiter_fallback.cc index bcf061bb7615f..01c86cdedc6aa 100644 --- a/shell/common/vsync_waiter_fallback.cc +++ b/shell/common/vsync_waiter_fallback.cc @@ -4,6 +4,7 @@ #include "flutter/shell/common/vsync_waiter_fallback.h" +#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { @@ -20,25 +21,28 @@ fxl::TimePoint SnapToNextTick(fxl::TimePoint value, } // namespace -VsyncWaiterFallback::VsyncWaiterFallback(blink::TaskRunners task_runners) - : VsyncWaiter(std::move(task_runners)), - phase_(fxl::TimePoint::Now()), - weak_factory_(this) {} +VsyncWaiterFallback::VsyncWaiterFallback() + : phase_(fxl::TimePoint::Now()), weak_factory_(this) {} VsyncWaiterFallback::~VsyncWaiterFallback() = default; constexpr fxl::TimeDelta interval = fxl::TimeDelta::FromSecondsF(1.0 / 60.0); -void VsyncWaiterFallback::AwaitVSync() { +void VsyncWaiterFallback::AsyncWaitForVsync(Callback callback) { + FXL_DCHECK(!callback_); + callback_ = std::move(callback); + fxl::TimePoint now = fxl::TimePoint::Now(); fxl::TimePoint next = SnapToNextTick(now, phase_, interval); - task_runners_.GetUITaskRunner()->PostDelayedTask( + blink::Threads::UI()->PostDelayedTask( [self = weak_factory_.GetWeakPtr()] { - if (self) { - const auto frame_time = fxl::TimePoint::Now(); - self->FireCallback(frame_time, frame_time + interval); - } + if (!self) + return; + fxl::TimePoint frame_time = fxl::TimePoint::Now(); + Callback callback = std::move(self->callback_); + self->callback_ = Callback(); + callback(frame_time, frame_time + interval); }, next - now); } diff --git a/shell/common/vsync_waiter_fallback.h b/shell/common/vsync_waiter_fallback.h index d3cc8faaf6ce7..bfb7e118b1330 100644 --- a/shell/common/vsync_waiter_fallback.h +++ b/shell/common/vsync_waiter_fallback.h @@ -5,24 +5,25 @@ #ifndef FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" #include "lib/fxl/time/time_point.h" namespace shell { -class VsyncWaiterFallback final : public VsyncWaiter { +class VsyncWaiterFallback : public VsyncWaiter { public: - VsyncWaiterFallback(blink::TaskRunners task_runners); - + VsyncWaiterFallback(); ~VsyncWaiterFallback() override; + void AsyncWaitForVsync(Callback callback) override; + private: fxl::TimePoint phase_; - fxl::WeakPtrFactory weak_factory_; + Callback callback_; - void AwaitVSync() override; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback); }; diff --git a/shell/gpu/BUILD.gn b/shell/gpu/BUILD.gn index cd093e1238f7f..c050e120b0a10 100644 --- a/shell/gpu/BUILD.gn +++ b/shell/gpu/BUILD.gn @@ -6,17 +6,14 @@ import("$flutter_root/shell/config.gni") source_set("gpu") { sources = [ + "gpu_rasterizer.cc", + "gpu_rasterizer.h", + "gpu_surface_gl.cc", + "gpu_surface_gl.h", "gpu_surface_software.cc", "gpu_surface_software.h", ] - if (!is_fuchsia) { - sources += [ - "gpu_surface_gl.cc", - "gpu_surface_gl.h", - ] - } - if (shell_enable_vulkan) { sources += [ "gpu_surface_vulkan.cc", diff --git a/shell/gpu/gpu_rasterizer.cc b/shell/gpu/gpu_rasterizer.cc new file mode 100644 index 0000000000000..3424f989b3205 --- /dev/null +++ b/shell/gpu/gpu_rasterizer.cc @@ -0,0 +1,168 @@ +// Copyright 2015 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. + +#include "gpu_rasterizer.h" + +#include +#include + +#include "flutter/common/threads.h" +#include "flutter/glue/trace_event.h" +#include "flutter/shell/common/picture_serializer.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "third_party/skia/include/core/SkPicture.h" + +namespace shell { + +GPURasterizer::GPURasterizer(std::unique_ptr info) + : compositor_context_(std::move(info)), weak_factory_(this) {} + +GPURasterizer::~GPURasterizer() = default; + +fml::WeakPtr GPURasterizer::GetWeakRasterizerPtr() { + return weak_factory_.GetWeakPtr(); +} + +void GPURasterizer::Setup(std::unique_ptr surface, + fxl::Closure continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) { + surface_ = std::move(surface); + compositor_context_.OnGrContextCreated(); + + continuation(); + + setup_completion_event->Signal(); +} + +void GPURasterizer::Clear(SkColor color, const SkISize& size) { + if (surface_ == nullptr) { + return; + } + + auto frame = surface_->AcquireFrame(size); + + if (frame == nullptr) { + return; + } + + SkCanvas* canvas = frame->SkiaCanvas(); + + if (canvas == nullptr) { + return; + } + + canvas->clear(color); + + frame->Submit(); +} + +void GPURasterizer::Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) { + compositor_context_.OnGrContextDestroyed(); + if (surface_) { + surface_.reset(); + } + last_layer_tree_.reset(); + teardown_completion_event->Signal(); +} + +flow::LayerTree* GPURasterizer::GetLastLayerTree() { + return last_layer_tree_.get(); +} + +void GPURasterizer::DrawLastLayerTree() { + if (!last_layer_tree_ || !surface_) { + return; + } + DrawToSurface(*last_layer_tree_); +} + +flow::TextureRegistry& GPURasterizer::GetTextureRegistry() { + return compositor_context_.texture_registry(); +} + +void GPURasterizer::Draw( + fxl::RefPtr> pipeline) { + TRACE_EVENT0("flutter", "GPURasterizer::Draw"); + + flutter::Pipeline::Consumer consumer = + std::bind(&GPURasterizer::DoDraw, this, std::placeholders::_1); + + // Consume as many pipeline items as possible. But yield the event loop + // between successive tries. + switch (pipeline->Consume(consumer)) { + case flutter::PipelineConsumeResult::MoreAvailable: { + auto weak_this = weak_factory_.GetWeakPtr(); + blink::Threads::Gpu()->PostTask([weak_this, pipeline]() { + if (weak_this) { + weak_this->Draw(pipeline); + } + }); + break; + } + default: + break; + } +} + +void GPURasterizer::DoDraw(std::unique_ptr layer_tree) { + if (!layer_tree || !surface_) { + return; + } + + // There is no way for the compositor to know how long the layer tree + // construction took. Fortunately, the layer tree does. Grab that time + // for instrumentation. + compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); + + DrawToSurface(*layer_tree); + + NotifyNextFrameOnce(); + + last_layer_tree_ = std::move(layer_tree); +} + +void GPURasterizer::DrawToSurface(flow::LayerTree& layer_tree) { + auto frame = surface_->AcquireFrame(layer_tree.frame_size()); + + if (frame == nullptr) { + return; + } + + auto canvas = frame->SkiaCanvas(); + + if (canvas == nullptr) { + return; + } + + auto compositor_frame = + compositor_context_.AcquireFrame(surface_->GetContext(), canvas); + + canvas->clear(SK_ColorBLACK); + + layer_tree.Raster(compositor_frame); + + frame->Submit(); +} + +void GPURasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { + nextFrameCallback_ = nextFrameCallback; +} + +void GPURasterizer::NotifyNextFrameOnce() { + if (nextFrameCallback_) { + blink::Threads::Platform()->PostTask([callback = nextFrameCallback_] { + TRACE_EVENT0("flutter", "GPURasterizer::NotifyNextFrameOnce"); + callback(); + }); + nextFrameCallback_ = nullptr; + } +} + +void GPURasterizer::SetTextureRegistry(flow::TextureRegistry* textureRegistry) { + compositor_context_.SetTextureRegistry(textureRegistry); +} + +} // namespace shell diff --git a/shell/gpu/gpu_rasterizer.h b/shell/gpu/gpu_rasterizer.h new file mode 100644 index 0000000000000..ad16ee2c47989 --- /dev/null +++ b/shell/gpu/gpu_rasterizer.h @@ -0,0 +1,68 @@ +// Copyright 2015 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. + +#ifndef SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ +#define SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ + +#include "flutter/flow/compositor_context.h" +#include "flutter/shell/common/rasterizer.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/synchronization/waitable_event.h" + +namespace shell { + +class Surface; + +class GPURasterizer : public Rasterizer { + public: + GPURasterizer(std::unique_ptr info); + + ~GPURasterizer() override; + + void Setup(std::unique_ptr surface, + fxl::Closure continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) override; + + void Clear(SkColor color, const SkISize& size) override; + + void Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) override; + + fml::WeakPtr GetWeakRasterizerPtr() override; + + flow::LayerTree* GetLastLayerTree() override; + + void DrawLastLayerTree() override; + + flow::TextureRegistry& GetTextureRegistry() override; + + void Draw(fxl::RefPtr> pipeline) override; + + // Set a callback to be called once when the next frame is drawn. + void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; + + void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; + + private: + std::unique_ptr surface_; + flow::CompositorContext compositor_context_; + std::unique_ptr last_layer_tree_; + // A closure to be called when the underlaying surface presents a frame the + // next time. NULL if there is no callback or the callback was set back to + // NULL after being called. + fxl::Closure nextFrameCallback_; + fml::WeakPtrFactory weak_factory_; + + void DoDraw(std::unique_ptr layer_tree); + + void DrawToSurface(flow::LayerTree& layer_tree); + + void NotifyNextFrameOnce(); + + FXL_DISALLOW_COPY_AND_ASSIGN(GPURasterizer); +}; + +} // namespace shell + +#endif // SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 284a10e413b46..331fd188a9ed3 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -72,8 +72,6 @@ GPUSurfaceGL::~GPUSurfaceGL() { return; } - GetCompositorContext().OnGrContextDestroyed(); - onscreen_surface_ = nullptr; context_->releaseResourcesAndAbandonContext(); context_ = nullptr; @@ -212,11 +210,12 @@ std::unique_ptr GPUSurfaceGL::AcquireFrame(const SkISize& size) { return nullptr; } - SurfaceFrame::SubmitCallback submit_callback = [weak = weak_factory_ - .GetWeakPtr()]( - const SurfaceFrame& surface_frame, SkCanvas* canvas) { - return weak ? weak->PresentSurface(canvas) : false; - }; + auto weak_this = weak_factory_.GetWeakPtr(); + + SurfaceFrame::SubmitCallback submit_callback = + [weak_this](const SurfaceFrame& surface_frame, SkCanvas* canvas) { + return weak_this ? weak_this->PresentSurface(canvas) : false; + }; return std::make_unique(surface, submit_callback); } diff --git a/shell/gpu/gpu_surface_gl.h b/shell/gpu/gpu_surface_gl.h index abc9f46aee297..5cf092dae66c5 100644 --- a/shell/gpu/gpu_surface_gl.h +++ b/shell/gpu/gpu_surface_gl.h @@ -5,9 +5,10 @@ #ifndef SHELL_GPU_GPU_SURFACE_GL_H_ #define SHELL_GPU_GPU_SURFACE_GL_H_ +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" +#include "flutter/synchronization/debug_thread_checker.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { @@ -43,7 +44,7 @@ class GPUSurfaceGL : public Surface { sk_sp onscreen_surface_; sk_sp offscreen_surface_; bool valid_ = false; - fxl::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; bool CreateOrUpdateSurfaces(const SkISize& size); diff --git a/shell/gpu/gpu_surface_software.cc b/shell/gpu/gpu_surface_software.cc index ea8c827b22405..e340e605652dd 100644 --- a/shell/gpu/gpu_surface_software.cc +++ b/shell/gpu/gpu_surface_software.cc @@ -18,13 +18,20 @@ bool GPUSurfaceSoftware::IsValid() { return delegate_ != nullptr; } +bool GPUSurfaceSoftware::SupportsScaling() const { + return true; +} + std::unique_ptr GPUSurfaceSoftware::AcquireFrame( const SkISize& logical_size) { if (!IsValid()) { return nullptr; } - const auto size = SkISize::Make(logical_size.width(), logical_size.height()); + // Check if we need to support surface scaling. + const auto scale = SupportsScaling() ? GetScale() : 1.0; + const auto size = SkISize::Make(logical_size.width() * scale, + logical_size.height() * scale); sk_sp backing_store = delegate_->AcquireBackingStore(size); @@ -41,10 +48,12 @@ std::unique_ptr GPUSurfaceSoftware::AcquireFrame( // irrespective of surface scaling. SkCanvas* canvas = backing_store->getCanvas(); canvas->resetMatrix(); + canvas->scale(scale, scale); - SurfaceFrame::SubmitCallback on_submit = - [self = weak_factory_.GetWeakPtr()](const SurfaceFrame& surface_frame, - SkCanvas* canvas) -> bool { + SurfaceFrame::SubmitCallback + on_submit = [self = weak_factory_.GetWeakPtr()]( + const SurfaceFrame& surface_frame, SkCanvas* canvas) + ->bool { // If the surface itself went away, there is nothing more to do. if (!self || !self->IsValid() || canvas == nullptr) { return false; diff --git a/shell/gpu/gpu_surface_software.h b/shell/gpu/gpu_surface_software.h index 238754f312b80..f7312153db8bc 100644 --- a/shell/gpu/gpu_surface_software.h +++ b/shell/gpu/gpu_surface_software.h @@ -5,9 +5,9 @@ #ifndef FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkSurface.h" namespace shell { @@ -30,9 +30,12 @@ class GPUSurfaceSoftware : public Surface { GrContext* GetContext() override; + bool SupportsScaling() const override; + private: GPUSurfaceSoftwareDelegate* delegate_; - fxl::WeakPtrFactory weak_factory_; + + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceSoftware); }; diff --git a/shell/gpu/gpu_surface_vulkan.h b/shell/gpu/gpu_surface_vulkan.h index f1e25fbe987b8..eafed43a6296d 100644 --- a/shell/gpu/gpu_surface_vulkan.h +++ b/shell/gpu/gpu_surface_vulkan.h @@ -6,12 +6,11 @@ #define SHELL_GPU_GPU_SURFACE_VULKAN_H_ #include - +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" #include "flutter/vulkan/vulkan_native_surface.h" #include "flutter/vulkan/vulkan_window.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -30,7 +29,7 @@ class GPUSurfaceVulkan : public Surface { private: vulkan::VulkanWindow window_; - fxl::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan); }; diff --git a/shell/platform/BUILD.gn b/shell/platform/BUILD.gn index ae3b1003f22fe..4b1e1a9e0bfeb 100644 --- a/shell/platform/BUILD.gn +++ b/shell/platform/BUILD.gn @@ -13,11 +13,13 @@ group("platform") { ] } else if (is_linux) { deps = [ + "linux", "embedder", ] } else if (is_win) { - # There is no platform target on windows. Instead, only a tester is used. - deps = [] + deps = [ + "win" + ] } else { assert(false, "Unknown/Unsupported platform.") } diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 129c877faed0f..d9744ad890caa 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -17,25 +17,21 @@ shared_library("flutter_shell_native") { "android_context_gl.h", "android_environment_gl.cc", "android_environment_gl.h", - "android_external_texture_gl.cc", "android_external_texture_gl.h", + "android_external_texture_gl.cc", "android_native_window.cc", "android_native_window.h", - "android_shell_holder.cc", - "android_shell_holder.h", "android_surface.cc", "android_surface.h", "android_surface_gl.cc", "android_surface_gl.h", - "android_surface_software.cc", "android_surface_software.h", - "apk_asset_provider.cc", + "android_surface_software.cc", "apk_asset_provider.h", + "apk_asset_provider.cc", "flutter_main.cc", "flutter_main.h", "library_loader.cc", - "platform_message_response_android.cc", - "platform_message_response_android.h", "platform_view_android.cc", "platform_view_android.h", "platform_view_android_jni.cc", @@ -45,10 +41,10 @@ shared_library("flutter_shell_native") { ] deps = [ - "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", + "$flutter_root/assets", "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/shell/common", @@ -63,7 +59,9 @@ shared_library("flutter_shell_native") { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] defines = [] diff --git a/shell/platform/android/android_context_gl.cc b/shell/platform/android/android_context_gl.cc index 6338dc96908e1..f54629f8644b9 100644 --- a/shell/platform/android/android_context_gl.cc +++ b/shell/platform/android/android_context_gl.cc @@ -3,13 +3,9 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_context_gl.h" - #include - #include -#include "flutter/fml/trace_event.h" - namespace shell { template @@ -69,17 +65,19 @@ static EGLResult CreateContext(EGLDisplay display, return {context != EGL_NO_CONTEXT, context}; } -static EGLResult ChooseEGLConfiguration(EGLDisplay display) { +static EGLResult ChooseEGLConfiguration( + EGLDisplay display, + PlatformView::SurfaceConfig config) { EGLint attributes[] = { // clang-format off EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 0, - EGL_STENCIL_SIZE, 0, + EGL_RED_SIZE, config.red_bits, + EGL_GREEN_SIZE, config.green_bits, + EGL_BLUE_SIZE, config.blue_bits, + EGL_ALPHA_SIZE, config.alpha_bits, + EGL_DEPTH_SIZE, config.depth_bits, + EGL_STENCIL_SIZE, config.stencil_bits, EGL_NONE, // termination sentinel // clang-format on }; @@ -144,6 +142,7 @@ bool AndroidContextGL::CreatePBufferSurface() { } AndroidContextGL::AndroidContextGL(fxl::RefPtr env, + PlatformView::SurfaceConfig config, const AndroidContextGL* share_context) : environment_(env), window_(nullptr), @@ -159,7 +158,8 @@ AndroidContextGL::AndroidContextGL(fxl::RefPtr env, // Choose a valid configuration. - std::tie(success, config_) = ChooseEGLConfiguration(environment_->Display()); + std::tie(success, config_) = + ChooseEGLConfiguration(environment_->Display(), config); if (!success) { FXL_LOG(ERROR) << "Could not choose an EGL configuration."; diff --git a/shell/platform/android/android_context_gl.h b/shell/platform/android/android_context_gl.h index b29851b34564d..207f621c66bd1 100644 --- a/shell/platform/android/android_context_gl.h +++ b/shell/platform/android/android_context_gl.h @@ -44,6 +44,7 @@ class AndroidContextGL : public fxl::RefCountedThreadSafe { bool valid_; AndroidContextGL(fxl::RefPtr env, + PlatformView::SurfaceConfig config, const AndroidContextGL* share_context = nullptr); ~AndroidContextGL(); diff --git a/shell/platform/android/android_external_texture_gl.cc b/shell/platform/android/android_external_texture_gl.cc index 35db9cbbfdb95..02a40c22474a1 100644 --- a/shell/platform/android/android_external_texture_gl.cc +++ b/shell/platform/android/android_external_texture_gl.cc @@ -5,7 +5,7 @@ #include "flutter/shell/platform/android/android_external_texture_gl.h" #include - +#include "flutter/common/threads.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "third_party/skia/include/gpu/GrTexture.h" @@ -19,14 +19,17 @@ AndroidExternalTextureGL::AndroidExternalTextureGL( AndroidExternalTextureGL::~AndroidExternalTextureGL() = default; void AndroidExternalTextureGL::OnGrContextCreated() { + ASSERT_IS_GPU_THREAD; state_ = AttachmentState::uninitialized; } void AndroidExternalTextureGL::MarkNewFrameAvailable() { + ASSERT_IS_GPU_THREAD; new_frame_ready_ = true; } void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { + ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::detached) { return; } @@ -39,8 +42,7 @@ void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { Update(); new_frame_ready_ = false; } - GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, - GL_RGBA8_OES}; + GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, GL_RGBA8_OES}; GrBackendTexture backendTexture(1, 1, GrMipMapped::kNo, textureInfo); sk_sp image = SkImage::MakeFromTexture( canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, @@ -80,6 +82,7 @@ void AndroidExternalTextureGL::UpdateTransform() { } void AndroidExternalTextureGL::OnGrContextDestroyed() { + ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::attached) { Detach(); } diff --git a/shell/platform/android/android_external_texture_gl.h b/shell/platform/android/android_external_texture_gl.h index 67d6541d964c2..df890b91c827f 100644 --- a/shell/platform/android/android_external_texture_gl.h +++ b/shell/platform/android/android_external_texture_gl.h @@ -25,7 +25,8 @@ class AndroidExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; - void MarkNewFrameAvailable() override; + // Called on GPU thread. + void MarkNewFrameAvailable(); private: void Attach(jint textureName); diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc deleted file mode 100644 index 7dc454f1fb74a..0000000000000 --- a/shell/platform/android/android_shell_holder.cc +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2018 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/shell/platform/android/android_shell_holder.h" - -#include -#include - -#include -#include -#include - -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/platform/android/platform_view_android.h" -#include "lib/fxl/functional/make_copyable.h" - -namespace shell { - -AndroidShellHolder::AndroidShellHolder( - blink::Settings settings, - fml::jni::JavaObjectWeakGlobalRef java_object) - : settings_(std::move(settings)), java_object_(java_object) { - static size_t shell_count = 1; - auto thread_label = std::to_string(shell_count++); - - thread_host_ = {thread_label, ThreadHost::Type::UI | ThreadHost::Type::GPU | - ThreadHost::Type::IO}; - - fml::WeakPtr weak_platform_view; - Shell::CreateCallback on_create_platform_view = - [java_object, &weak_platform_view](Shell& shell) { - auto platform_view_android = std::make_unique( - shell, // delegate - shell.GetTaskRunners(), // task runners - java_object, // java object handle for JNI interop - shell.GetSettings() - .enable_software_rendering // use software rendering - ); - weak_platform_view = platform_view_android->GetWeakPtr(); - return platform_view_android; - }; - - Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - // The current thread will be used as the platform thread. Ensure that the - // message loop is initialized. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - blink::TaskRunners task_runners( - thread_label, // label - fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform - thread_host_.gpu_thread->GetTaskRunner(), // gpu - thread_host_.ui_thread->GetTaskRunner(), // ui - thread_host_.io_thread->GetTaskRunner() // io - ); - - shell_ = - Shell::Create(task_runners, // task runners - settings_, // settings - on_create_platform_view, // platform view create callback - on_create_rasterizer // rasterizer create callback - ); - - platform_view_ = weak_platform_view; - FXL_DCHECK(platform_view_); - - is_valid_ = shell_ != nullptr; - - if (is_valid_) { - task_runners.GetGPUTaskRunner()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); - task_runners.GetUITaskRunner()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); - } -} - -AndroidShellHolder::~AndroidShellHolder() = default; - -bool AndroidShellHolder::IsValid() const { - return is_valid_; -} - -const blink::Settings& AndroidShellHolder::GetSettings() const { - return settings_; -} - -void AndroidShellHolder::Launch(RunConfiguration config) { - if (!IsValid()) { - return; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = shell_->GetEngine(), // - config = std::move(config) // - ]() mutable { - if (engine) { - if (!engine->Run(std::move(config))) { - FXL_LOG(ERROR) << "Could not launch engine in configuration."; - } - } - })); -} - -void AndroidShellHolder::SetViewportMetrics( - const blink::ViewportMetrics& metrics) { - if (!IsValid()) { - return; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = shell_->GetEngine(), metrics]() { - if (engine) { - engine->SetViewportMetrics(metrics); - } - }); -} - -void AndroidShellHolder::DispatchPointerDataPacket( - std::unique_ptr packet) { - if (!IsValid()) { - return; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [engine = shell_->GetEngine(), packet = std::move(packet)] { - if (engine) { - engine->DispatchPointerDataPacket(*packet); - } - })); -} - -Rasterizer::Screenshot AndroidShellHolder::Screenshot( - Rasterizer::ScreenshotType type, - bool base64_encode) { - if (!IsValid()) { - return {nullptr, SkISize::MakeEmpty()}; - } - return shell_->Screenshot(type, base64_encode); -} - -fml::WeakPtr AndroidShellHolder::GetPlatformView() { - FXL_DCHECK(platform_view_); - return platform_view_; -} - -void AndroidShellHolder::UpdateAssetManager( - fxl::RefPtr asset_manager) { - if (!IsValid() || !asset_manager) { - return; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = shell_->GetEngine(), - asset_manager = std::move(asset_manager)]() { - if (engine) { - if (!engine->UpdateAssetManager(std::move(asset_manager))) { - FXL_DLOG(ERROR) << "Could not update asset asset manager."; - } - } - }); -} - -} // namespace shell diff --git a/shell/platform/android/android_shell_holder.h b/shell/platform/android/android_shell_holder.h deleted file mode 100644 index e0905f0f9e42e..0000000000000 --- a/shell/platform/android/android_shell_holder.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2018 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_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ -#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ - -#include - -#include "flutter/fml/platform/android/jni_weak_ref.h" -#include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/shell/common/run_configuration.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/thread_host.h" -#include "flutter/shell/platform/android/platform_view_android.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class AndroidShellHolder { - public: - AndroidShellHolder(blink::Settings settings, - fml::jni::JavaObjectWeakGlobalRef java_object); - - ~AndroidShellHolder(); - - bool IsValid() const; - - void Launch(RunConfiguration configuration); - - void SetViewportMetrics(const blink::ViewportMetrics& metrics); - - void DispatchPointerDataPacket( - std::unique_ptr packet); - - const blink::Settings& GetSettings() const; - - fml::WeakPtr GetPlatformView(); - - Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, - bool base64_encode); - - void UpdateAssetManager(fxl::RefPtr asset_manager); - - private: - const blink::Settings settings_; - const fml::jni::JavaObjectWeakGlobalRef java_object_; - fml::WeakPtr platform_view_; - ThreadHost thread_host_; - std::unique_ptr shell_; - bool is_valid_ = false; - - FXL_DISALLOW_COPY_AND_ASSIGN(AndroidShellHolder); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ diff --git a/shell/platform/android/android_surface.cc b/shell/platform/android/android_surface.cc index a8b41bacbf7c5..4dd08609da370 100644 --- a/shell/platform/android/android_surface.cc +++ b/shell/platform/android/android_surface.cc @@ -4,32 +4,8 @@ #include "flutter/shell/platform/android/android_surface.h" -#include - -#include "flutter/shell/platform/android/android_surface_gl.h" -#include "flutter/shell/platform/android/android_surface_software.h" -#if SHELL_ENABLE_VULKAN -#include "flutter/shell/platform/android/android_surface_vulkan.h" -#endif // SHELL_ENABLE_VULKAN - namespace shell { -std::unique_ptr AndroidSurface::Create( - bool use_software_rendering) { - if (use_software_rendering) { - auto software_surface = std::make_unique(); - return software_surface->IsValid() ? std::move(software_surface) : nullptr; - } -#if SHELL_ENABLE_VULKAN - auto vulkan_surface = std::make_unique(); - return vulkan_surface->IsValid() ? std::move(vulkan_surface) : nullptr; -#else // SHELL_ENABLE_VULKAN - auto gl_surface = std::make_unique(); - return gl_surface->IsOffscreenContextValid() ? std::move(gl_surface) - : nullptr; -#endif // SHELL_ENABLE_VULKAN -} - AndroidSurface::~AndroidSurface() = default; } // namespace shell diff --git a/shell/platform/android/android_surface.h b/shell/platform/android/android_surface.h index 858b07eb45d9f..2425a61e20707 100644 --- a/shell/platform/android/android_surface.h +++ b/shell/platform/android/android_surface.h @@ -19,8 +19,6 @@ namespace shell { class AndroidSurface { public: - static std::unique_ptr Create(bool use_software_rendering); - virtual ~AndroidSurface(); virtual bool IsValid() const = 0; @@ -29,11 +27,14 @@ class AndroidSurface { virtual std::unique_ptr CreateGPUSurface() = 0; + virtual SkISize OnScreenSurfaceSize() const = 0; + virtual bool OnScreenSurfaceResize(const SkISize& size) const = 0; virtual bool ResourceContextMakeCurrent() = 0; - virtual bool SetNativeWindow(fxl::RefPtr window) = 0; + virtual bool SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config = {}) = 0; }; } // namespace shell diff --git a/shell/platform/android/android_surface_gl.cc b/shell/platform/android/android_surface_gl.cc index 274b652a97b74..f30ac1272b043 100644 --- a/shell/platform/android/android_surface_gl.cc +++ b/shell/platform/android/android_surface_gl.cc @@ -6,12 +6,14 @@ #include +#include "flutter/common/threads.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_ptr.h" namespace shell { -static fxl::RefPtr GlobalResourceLoadingContext() { +static fxl::RefPtr GlobalResourceLoadingContext( + PlatformView::SurfaceConfig offscreen_config) { // AndroidSurfaceGL instances are only ever created on the platform thread. So // there is no need to lock here. @@ -27,7 +29,11 @@ static fxl::RefPtr GlobalResourceLoadingContext() { return nullptr; } - auto context = fxl::MakeRefCounted(environment); + // TODO(chinmaygarde): We should check that the configurations are stable + // across multiple invocations. + + auto context = + fxl::MakeRefCounted(environment, offscreen_config); if (!context->IsValid()) { return nullptr; @@ -37,9 +43,10 @@ static fxl::RefPtr GlobalResourceLoadingContext() { return global_context; } -AndroidSurfaceGL::AndroidSurfaceGL() { +AndroidSurfaceGL::AndroidSurfaceGL( + PlatformView::SurfaceConfig offscreen_config) { // Acquire the offscreen context. - offscreen_context_ = GlobalResourceLoadingContext(); + offscreen_context_ = GlobalResourceLoadingContext(offscreen_config); if (!offscreen_context_ || !offscreen_context_->IsValid()) { offscreen_context_ = nullptr; @@ -53,9 +60,14 @@ bool AndroidSurfaceGL::IsOffscreenContextValid() const { } void AndroidSurfaceGL::TeardownOnScreenContext() { - if (onscreen_context_) { - onscreen_context_->ClearCurrent(); - } + fxl::AutoResetWaitableEvent latch; + blink::Threads::Gpu()->PostTask([this, &latch]() { + if (IsValid()) { + GLContextClearCurrent(); + } + latch.Signal(); + }); + latch.Wait(); onscreen_context_ = nullptr; } @@ -72,6 +84,11 @@ std::unique_ptr AndroidSurfaceGL::CreateGPUSurface() { return surface->IsValid() ? std::move(surface) : nullptr; } +SkISize AndroidSurfaceGL::OnScreenSurfaceSize() const { + FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); + return onscreen_context_->GetSize(); +} + bool AndroidSurfaceGL::OnScreenSurfaceResize(const SkISize& size) const { FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->Resize(size); @@ -82,8 +99,8 @@ bool AndroidSurfaceGL::ResourceContextMakeCurrent() { return offscreen_context_->MakeCurrent(); } -bool AndroidSurfaceGL::SetNativeWindow( - fxl::RefPtr window) { +bool AndroidSurfaceGL::SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config) { // In any case, we want to get rid of our current onscreen context. onscreen_context_ = nullptr; @@ -95,7 +112,7 @@ bool AndroidSurfaceGL::SetNativeWindow( // Create the onscreen context. onscreen_context_ = fxl::MakeRefCounted( - offscreen_context_->Environment(), + offscreen_context_->Environment(), config, offscreen_context_.get() /* sharegroup */); if (!onscreen_context_->IsValid()) { diff --git a/shell/platform/android/android_surface_gl.h b/shell/platform/android/android_surface_gl.h index e26f2bf50d3a9..08aee081c8266 100644 --- a/shell/platform/android/android_surface_gl.h +++ b/shell/platform/android/android_surface_gl.h @@ -16,43 +16,35 @@ namespace shell { -class AndroidSurfaceGL final : public GPUSurfaceGLDelegate, - public AndroidSurface { +class AndroidSurfaceGL : public GPUSurfaceGLDelegate, public AndroidSurface { public: - AndroidSurfaceGL(); + explicit AndroidSurfaceGL(PlatformView::SurfaceConfig offscreen_config); ~AndroidSurfaceGL() override; - bool IsOffscreenContextValid() const; - - // |shell::AndroidSurface| bool IsValid() const override; - // |shell::AndroidSurface| + bool IsOffscreenContextValid() const; + std::unique_ptr CreateGPUSurface() override; - // |shell::AndroidSurface| void TeardownOnScreenContext() override; - // |shell::AndroidSurface| + SkISize OnScreenSurfaceSize() const override; + bool OnScreenSurfaceResize(const SkISize& size) const override; - // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - // |shell::AndroidSurface| - bool SetNativeWindow(fxl::RefPtr window) override; + bool SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config) override; - // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; - // |shell::GPUSurfaceGLDelegate| bool GLContextClearCurrent() override; - // |shell::GPUSurfaceGLDelegate| bool GLContextPresent() override; - // |shell::GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; private: diff --git a/shell/platform/android/android_surface_software.cc b/shell/platform/android/android_surface_software.cc index 4b1378802d9e4..68bf99b27ba56 100644 --- a/shell/platform/android/android_surface_software.cc +++ b/shell/platform/android/android_surface_software.cc @@ -3,14 +3,15 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_surface_software.h" +#include "flutter/common/threads.h" +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/fml/platform/android/scoped_java_ref.h" +#include "flutter/shell/platform/android/platform_view_android_jni.h" #include #include -#include "flutter/fml/platform/android/jni_weak_ref.h" -#include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/platform/android/platform_view_android_jni.h" #include "lib/fxl/logging.h" namespace shell { @@ -131,12 +132,17 @@ bool AndroidSurfaceSoftware::PresentBackingStore( void AndroidSurfaceSoftware::TeardownOnScreenContext() {} +SkISize AndroidSurfaceSoftware::OnScreenSurfaceSize() const { + return SkISize(); +} + bool AndroidSurfaceSoftware::OnScreenSurfaceResize(const SkISize& size) const { return true; } bool AndroidSurfaceSoftware::SetNativeWindow( - fxl::RefPtr window) { + fxl::RefPtr window, + PlatformView::SurfaceConfig config) { native_window_ = std::move(window); if (!(native_window_ && native_window_->IsValid())) return false; diff --git a/shell/platform/android/android_surface_software.h b/shell/platform/android/android_surface_software.h index 0f82fc5dfe154..76184b707cf74 100644 --- a/shell/platform/android/android_surface_software.h +++ b/shell/platform/android/android_surface_software.h @@ -13,39 +13,35 @@ namespace shell { -class AndroidSurfaceSoftware final : public AndroidSurface, - public GPUSurfaceSoftwareDelegate { +class AndroidSurfaceSoftware : public AndroidSurface, + public GPUSurfaceSoftwareDelegate { public: AndroidSurfaceSoftware(); ~AndroidSurfaceSoftware() override; - // |shell::AndroidSurface| bool IsValid() const override; - // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; - // |shell::AndroidSurface| - void TeardownOnScreenContext() override; + sk_sp AcquireBackingStore(const SkISize& size) override; - // |shell::AndroidSurface| - bool OnScreenSurfaceResize(const SkISize& size) const override; + bool PresentBackingStore(sk_sp backing_store) override; + + void TeardownOnScreenContext() override; - // |shell::AndroidSurface| - bool SetNativeWindow(fxl::RefPtr window) override; + SkISize OnScreenSurfaceSize() const override; - // |shell::GPUSurfaceSoftwareDelegate| - sk_sp AcquireBackingStore(const SkISize& size) override; + bool OnScreenSurfaceResize(const SkISize& size) const override; - // |shell::GPUSurfaceSoftwareDelegate| - bool PresentBackingStore(sk_sp backing_store) override; + bool SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config) override; private: sk_sp sk_surface_; + fxl::RefPtr native_window_; SkColorType target_color_type_; SkAlphaType target_alpha_type_; diff --git a/shell/platform/android/android_surface_vulkan.cc b/shell/platform/android/android_surface_vulkan.cc index e8817690188c2..ccacf538b8781 100644 --- a/shell/platform/android/android_surface_vulkan.cc +++ b/shell/platform/android/android_surface_vulkan.cc @@ -21,12 +21,10 @@ bool AndroidSurfaceVulkan::IsValid() const { return proc_table_->HasAcquiredMandatoryProcAddresses(); } -// |shell::AndroidSurface| void AndroidSurfaceVulkan::TeardownOnScreenContext() { - // Nothing to do. + // } -// |shell::AndroidSurface| std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { if (!IsValid()) { return nullptr; @@ -54,20 +52,21 @@ std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { return gpu_surface; } -// |shell::AndroidSurface| +SkISize AndroidSurfaceVulkan::OnScreenSurfaceSize() const { + return native_window_ ? native_window_->GetSize() : SkISize::Make(0, 0); +} + bool AndroidSurfaceVulkan::OnScreenSurfaceResize(const SkISize& size) const { return true; } -// |shell::AndroidSurface| bool AndroidSurfaceVulkan::ResourceContextMakeCurrent() { - FXL_DLOG(ERROR) << "The vulkan backend does not support resource contexts."; return false; } -// |shell::AndroidSurface| bool AndroidSurfaceVulkan::SetNativeWindow( - fxl::RefPtr window) { + fxl::RefPtr window, + PlatformView::SurfaceConfig config) { native_window_ = std::move(window); return native_window_ && native_window_->IsValid(); } diff --git a/shell/platform/android/android_surface_vulkan.h b/shell/platform/android/android_surface_vulkan.h index fd3f493d49790..f1ecf610c8584 100644 --- a/shell/platform/android/android_surface_vulkan.h +++ b/shell/platform/android/android_surface_vulkan.h @@ -20,23 +20,20 @@ class AndroidSurfaceVulkan : public AndroidSurface { ~AndroidSurfaceVulkan() override; - // |shell::AndroidSurface| bool IsValid() const override; - // |shell::AndroidSurface| + void TeardownOnScreenContext() override; + std::unique_ptr CreateGPUSurface() override; - // |shell::AndroidSurface| - void TeardownOnScreenContext() override; + SkISize OnScreenSurfaceSize() const override; - // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; - // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - // |shell::AndroidSurface| - bool SetNativeWindow(fxl::RefPtr window) override; + bool SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config) override; private: fxl::RefPtr proc_table_; diff --git a/shell/platform/android/apk_asset_provider.cc b/shell/platform/android/apk_asset_provider.cc index 4cf6da16dc64f..fdd4910a12f4c 100644 --- a/shell/platform/android/apk_asset_provider.cc +++ b/shell/platform/android/apk_asset_provider.cc @@ -7,41 +7,32 @@ namespace blink { -APKAssetProvider::APKAssetProvider(JNIEnv* env, - jobject jassetManager, - std::string directory) - : directory_(std::move(directory)) { - assetManager_ = AAssetManager_fromJava(env, jassetManager); -} - -APKAssetProvider::~APKAssetProvider() = default; - -bool APKAssetProvider::IsValid() const { - return true; -} - bool APKAssetProvider::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { + std::vector* data) { std::stringstream ss; ss << directory_.c_str() << "/" << asset_name; - AAsset* asset = - AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); + AAsset* asset = AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); if (!asset) { - return false; + return false; } uint8_t* buffer = (uint8_t*)AAsset_getBuffer(asset); if (!buffer) { FXL_LOG(ERROR) << "Got null trying to acquire buffer for asset:" << asset; - AAsset_close(asset); return false; } data->resize(AAsset_getLength(asset)); std::copy(buffer, buffer + data->size(), data->begin()); - AAsset_close(asset); return true; } +APKAssetProvider::~APKAssetProvider() {} + +APKAssetProvider::APKAssetProvider(JNIEnv* env, jobject jassetManager, std::string directory) + : directory_(std::move(directory)) { + assetManager_ = AAssetManager_fromJava(env, jassetManager); +} + } // namespace blink diff --git a/shell/platform/android/apk_asset_provider.h b/shell/platform/android/apk_asset_provider.h index 70ddbe454bc61..c40b1ed2a1866 100644 --- a/shell/platform/android/apk_asset_provider.h +++ b/shell/platform/android/apk_asset_provider.h @@ -5,35 +5,28 @@ #ifndef FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ #define FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ -#include #include +#include -#include "flutter/assets/asset_resolver.h" +#include "flutter/assets/asset_provider.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class APKAssetProvider final : public AssetResolver { +class APKAssetProvider + : public AssetProvider { public: - explicit APKAssetProvider(JNIEnv* env, - jobject assetManager, - std::string directory); + explicit APKAssetProvider(JNIEnv* env, jobject assetManager, std::string directory); virtual ~APKAssetProvider(); - private: - AAssetManager* assetManager_; - const std::string directory_; - - // |blink::AssetResolver| - bool IsValid() const override; - - // |blink::AssetResolver| virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + std::vector* data); - FXL_DISALLOW_COPY_AND_ASSIGN(APKAssetProvider); + private: + AAssetManager* assetManager_; + const std::string directory_; }; } // namespace blink -#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file +#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file diff --git a/shell/platform/android/flutter_main.cc b/shell/platform/android/flutter_main.cc index 08d97add93b87..6df346a128722 100644 --- a/shell/platform/android/flutter_main.cc +++ b/shell/platform/android/flutter_main.cc @@ -2,85 +2,38 @@ // 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/shell/platform/android/flutter_main.h" #include -#include "flutter/fml/message_loop.h" -#include "flutter/fml/paths.h" #include "flutter/fml/platform/android/jni_util.h" -#include "flutter/runtime/dart_vm.h" #include "flutter/runtime/start_up.h" #include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" #include "lib/fxl/arraysize.h" #include "lib/fxl/command_line.h" -#include "lib/fxl/files/file.h" #include "lib/fxl/macros.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -FlutterMain::FlutterMain(blink::Settings settings) - : settings_(std::move(settings)) {} - -FlutterMain::~FlutterMain() = default; - -static std::unique_ptr g_flutter_main; - -FlutterMain& FlutterMain::Get() { - FXL_CHECK(g_flutter_main) << "ensureInitializationComplete must have already " - "been called."; - return *g_flutter_main; -} - -const blink::Settings& FlutterMain::GetSettings() const { - return settings_; -} - -void FlutterMain::Init(JNIEnv* env, - jclass clazz, - jobject context, - jobjectArray jargs, - jstring bundlePath) { +static void Init(JNIEnv* env, + jclass clazz, + jobject context, + jobjectArray jargs, + jstring bundlePath) { + // Prepare command line arguments and initialize the shell. std::vector args; - args.push_back("flutter"); + args.push_back("flutter_tester"); for (auto& arg : fml::jni::StringArrayToVector(env, jargs)) { args.push_back(std::move(arg)); } - auto command_line = fxl::CommandLineFromIterators(args.begin(), args.end()); - - auto settings = SettingsFromCommandLine(command_line); - - settings.assets_path = fml::jni::JavaStringToString(env, bundlePath); - - if (!blink::DartVM::IsRunningPrecompiledCode()) { - // Check to see if the appropriate kernel files are present and configure - // settings accordingly. - auto platform_kernel_path = - fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); - auto application_kernel_path = - fml::paths::JoinPaths({settings.assets_path, "kernel_blob.bin"}); - - if (files::IsFile(platform_kernel_path) && - files::IsFile(application_kernel_path)) { - settings.kernel_snapshot_path = platform_kernel_path; - settings.application_kernel_asset = application_kernel_path; - } - } - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - // Not thread safe. Will be removed when FlutterMain is refactored to no - // longer be a singleton. - g_flutter_main.reset(new FlutterMain(std::move(settings))); + auto command_line = fxl::CommandLineFromIterators(args.begin(), args.end()); + std::string icu_data_path = + command_line.GetOptionValueWithDefault("icu-data-file-path", ""); + Shell::InitStandalone(std::move(command_line), std::move(icu_data_path), + /* application_library_path= */ "", + fml::jni::JavaStringToString(env, bundlePath)); } static void RecordStartTimestamp(JNIEnv* env, @@ -91,7 +44,7 @@ static void RecordStartTimestamp(JNIEnv* env, blink::engine_main_enter_ts = Dart_TimelineGetMicros() - initTimeMicros; } -bool FlutterMain::Register(JNIEnv* env) { +bool RegisterFlutterMain(JNIEnv* env) { static const JNINativeMethod methods[] = { { .name = "nativeInit", diff --git a/shell/platform/android/flutter_main.h b/shell/platform/android/flutter_main.h index 6c8717e9cebdb..f4f65c499f966 100644 --- a/shell/platform/android/flutter_main.h +++ b/shell/platform/android/flutter_main.h @@ -7,34 +7,9 @@ #include -#include "flutter/common/settings.h" -#include "lib/fxl/macros.h" - namespace shell { -class FlutterMain { - public: - ~FlutterMain(); - - static bool Register(JNIEnv* env); - - static FlutterMain& Get(); - - const blink::Settings& GetSettings() const; - - private: - const blink::Settings settings_; - - FlutterMain(blink::Settings settings); - - static void Init(JNIEnv* env, - jclass clazz, - jobject context, - jobjectArray jargs, - jstring bundlePath); - - FXL_DISALLOW_COPY_AND_ASSIGN(FlutterMain); -}; +bool RegisterFlutterMain(JNIEnv* env); } // namespace shell diff --git a/shell/platform/android/library_loader.cc b/shell/platform/android/library_loader.cc index 569825ce33e21..c51d0114282f6 100644 --- a/shell/platform/android/library_loader.cc +++ b/shell/platform/android/library_loader.cc @@ -16,7 +16,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { bool result = false; // Register FlutterMain. - result = shell::FlutterMain::Register(env); + result = shell::RegisterFlutterMain(env); FXL_CHECK(result); // Register PlatformView diff --git a/shell/platform/android/platform_message_response_android.cc b/shell/platform/android/platform_message_response_android.cc deleted file mode 100644 index 214080ec5bde3..0000000000000 --- a/shell/platform/android/platform_message_response_android.cc +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2018 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/shell/platform/android/platform_message_response_android.h" - -#include "flutter/shell/platform/android/platform_view_android_jni.h" -#include "lib/fxl/functional/make_copyable.h" - -namespace shell { - -PlatformMessageResponseAndroid::PlatformMessageResponseAndroid( - int response_id, - fml::jni::JavaObjectWeakGlobalRef weak_java_object, - fxl::RefPtr platform_task_runner) - : response_id_(response_id), - weak_java_object_(weak_java_object), - platform_task_runner_(std::move(platform_task_runner)) {} - -// |blink::PlatformMessageResponse| -void PlatformMessageResponseAndroid::Complete(std::vector data) { - platform_task_runner_->PostTask( - fxl::MakeCopyable([response = response_id_, // - weak_java_object = weak_java_object_, // - data = std::move(data) // - ]() { - // We are on the platform thread. Attempt to get the strong reference to - // the Java object. - auto env = fml::jni::AttachCurrentThread(); - auto java_object = weak_java_object.get(env); - - if (java_object.is_null()) { - // The Java object was collected before this message response got to - // it. Drop the response on the floor. - return; - } - - if (data.size() == 0) { - // If the data is empty, there is no reason to create a Java byte - // array. Make the response now with a nullptr now. - FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), - response, nullptr); - } - - // Convert the vector to a Java byte array. - fml::jni::ScopedJavaLocalRef data_array( - env, env->NewByteArray(data.size())); - env->SetByteArrayRegion(data_array.obj(), 0, data.size(), - reinterpret_cast(data.data())); - - // Make the response call into Java. - FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), - response, data_array.obj()); - })); -} - -// |blink::PlatformMessageResponse| -void PlatformMessageResponseAndroid::CompleteEmpty() { - Complete(std::vector{}); -} - -} // namespace shell diff --git a/shell/platform/android/platform_message_response_android.h b/shell/platform/android/platform_message_response_android.h deleted file mode 100644 index 2ee7f3336ac6d..0000000000000 --- a/shell/platform/android/platform_message_response_android.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 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_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ -#define FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ - -#include "flutter/fml/platform/android/jni_weak_ref.h" -#include "flutter/fml/task_runner.h" -#include "flutter/lib/ui/window/platform_message_response.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { - public: - // |blink::PlatformMessageResponse| - void Complete(std::vector data) override; - - // |blink::PlatformMessageResponse| - void CompleteEmpty() override; - - private: - PlatformMessageResponseAndroid( - int response_id, - fml::jni::JavaObjectWeakGlobalRef weak_java_object, - fxl::RefPtr platform_task_runner); - - int response_id_; - fml::jni::JavaObjectWeakGlobalRef weak_java_object_; - fxl::RefPtr platform_task_runner_; - - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageResponseAndroid); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 00d1e4b59e848..8f677045fb1f5 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -4,55 +4,288 @@ #include "flutter/shell/platform/android/platform_view_android.h" -#include +#include +#include +#include +#include + #include -#include "flutter/shell/common/io_manager.h" +#include "flutter/common/settings.h" +#include "flutter/common/threads.h" +#include "flutter/fml/platform/android/jni_util.h" +#include "flutter/fml/platform/android/scoped_java_ref.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/shell/common/null_rasterizer.h" +#include "flutter/shell/gpu/gpu_rasterizer.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" #include "flutter/shell/platform/android/android_surface_gl.h" -#include "flutter/shell/platform/android/platform_message_response_android.h" +#include "flutter/shell/platform/android/android_surface_software.h" +#include "flutter/shell/platform/android/apk_asset_provider.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "flutter/shell/platform/android/vsync_waiter_android.h" -#include "lib/fxl/synchronization/waitable_event.h" +#include "lib/fxl/functional/make_copyable.h" + +#if SHELL_ENABLE_VULKAN +#include "flutter/shell/platform/android/android_surface_vulkan.h" +#endif // SHELL_ENABLE_VULKAN namespace shell { -PlatformViewAndroid::PlatformViewAndroid( - PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - fml::jni::JavaObjectWeakGlobalRef java_object, - bool use_software_rendering) - : PlatformView(delegate, std::move(task_runners)), - java_object_(java_object), - android_surface_(AndroidSurface::Create(use_software_rendering)) { - FXL_CHECK(android_surface_) - << "Could not create an OpenGL, Vulkan or Software surface to setup " - "rendering."; +class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); + + public: + void Complete(std::vector data) override { + fxl::RefPtr self(this); + blink::Threads::Platform()->PostTask( + fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { + std::shared_ptr view = self->view_.lock(); + if (!view) + return; + static_cast(view.get()) + ->HandlePlatformMessageResponse(self->response_id_, + std::move(data)); + })); + } + + void CompleteEmpty() override { + fxl::RefPtr self(this); + blink::Threads::Platform()->PostTask(fxl::MakeCopyable([self]() mutable { + std::shared_ptr view = self->view_.lock(); + if (!view) + return; + static_cast(view.get()) + ->HandlePlatformMessageEmptyResponse(self->response_id_); + })); + } + + private: + PlatformMessageResponseAndroid(int response_id, + std::weak_ptr view) + : response_id_(response_id), view_(view) {} + + int response_id_; + std::weak_ptr view_; +}; + +static std::unique_ptr InitializePlatformSurfaceGL() { + const PlatformView::SurfaceConfig offscreen_config = { + .red_bits = 8, + .green_bits = 8, + .blue_bits = 8, + .alpha_bits = 8, + .depth_bits = 0, + .stencil_bits = 0, + }; + auto surface = std::make_unique(offscreen_config); + return surface->IsOffscreenContextValid() ? std::move(surface) : nullptr; +} + +static std::unique_ptr InitializePlatformSurfaceVulkan() { +#if SHELL_ENABLE_VULKAN + auto surface = std::make_unique(); + return surface->IsValid() ? std::move(surface) : nullptr; +#else // SHELL_ENABLE_VULKAN + return nullptr; +#endif // SHELL_ENABLE_VULKAN } +static std::unique_ptr InitializePlatformSurfaceSoftware() { + auto surface = std::make_unique(); + return surface->IsValid() ? std::move(surface) : nullptr; +} + +static std::unique_ptr InitializePlatformSurface() { + if (blink::Settings::Get().enable_software_rendering) { + if (auto surface = InitializePlatformSurfaceSoftware()) { + FXL_DLOG(INFO) << "Software surface initialized."; + return surface; + } + } + + if (auto surface = InitializePlatformSurfaceVulkan()) { + FXL_DLOG(INFO) << "Vulkan surface initialized."; + return surface; + } + + FXL_DLOG(INFO) + << "Could not initialize Vulkan surface. Falling back to OpenGL."; + + if (auto surface = InitializePlatformSurfaceGL()) { + FXL_DLOG(INFO) << "GL surface initialized."; + return surface; + } + + if (auto surface = InitializePlatformSurfaceSoftware()) { + FXL_DLOG(INFO) << "Software surface initialized."; + return surface; + } + + FXL_CHECK(false) + << "Could not initialize either the Vulkan, OpenGL, or Software" + "surface backends. Flutter requires a GPU to render."; + return nullptr; +} + +PlatformViewAndroid::PlatformViewAndroid() + : PlatformView(std::make_unique()), + android_surface_(InitializePlatformSurface()) {} + PlatformViewAndroid::~PlatformViewAndroid() = default; -void PlatformViewAndroid::NotifyCreated( - fxl::RefPtr native_window) { - InstallFirstFrameCallback(); - android_surface_->SetNativeWindow(native_window); - PlatformView::NotifyCreated(); +void PlatformViewAndroid::Attach() { + CreateEngine(); + + // Eagerly setup the IO thread context. We have already setup the surface. + SetupResourceContextOnIOThread(); + + UpdateThreadPriorities(); } -void PlatformViewAndroid::NotifyDestroyed() { - PlatformView::NotifyDestroyed(); - android_surface_->TeardownOnScreenContext(); +void PlatformViewAndroid::Detach() { + ReleaseSurface(); } -void PlatformViewAndroid::NotifyChanged(const SkISize& size) { - fxl::AutoResetWaitableEvent latch; - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetGPUTaskRunner(), // - [&latch, surface = android_surface_.get(), size]() { - surface->OnScreenSurfaceResize(size); - latch.Signal(); +void PlatformViewAndroid::SurfaceCreated(JNIEnv* env, + jobject jsurface, + jint backgroundColor) { + // Note: This frame ensures that any local references used by + // ANativeWindow_fromSurface are released immediately. This is needed as a + // workaround for https://code.google.com/p/android/issues/detail?id=68174 + fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); + + // We have a drawing surface, so swap in a non-Null rasterizer. + SetRasterizer(std::make_unique(nullptr)); + + rasterizer_->AddNextFrameCallback([this]() { + JNIEnv* env = fml::jni::AttachCurrentThread(); + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + if (!view.is_null()) { + FlutterViewOnFirstFrame(env, view.obj()); + } + }); + + auto native_window = fxl::MakeRefCounted( + ANativeWindow_fromSurface(env, jsurface)); + + if (!native_window->IsValid()) { + return; + } + + if (!android_surface_->SetNativeWindow(native_window)) { + return; + } + + std::unique_ptr gpu_surface = android_surface_->CreateGPUSurface(); + + if (gpu_surface == nullptr || !gpu_surface->IsValid()) { + return; + } + + NotifyCreated(std::move(gpu_surface), [ + this, backgroundColor, native_window_size = native_window->GetSize() + ] { rasterizer().Clear(backgroundColor, native_window_size); }); +} + +void PlatformViewAndroid::SurfaceChanged(jint width, jint height) { + blink::Threads::Gpu()->PostTask([this, width, height]() { + if (android_surface_) { + android_surface_->OnScreenSurfaceResize(SkISize::Make(width, height)); + } + }); +} + +void PlatformViewAndroid::UpdateThreadPriorities() { + blink::Threads::Gpu()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); + + blink::Threads::UI()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); +} + +void PlatformViewAndroid::SurfaceDestroyed() { + ReleaseSurface(); +} + +void PlatformViewAndroid::RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, + std::string snapshot_override, + std::string entrypoint, + bool reuse_runtime_controller, + jobject assetManager) { + // TODO(jsimmons): remove snapshot_override from the public FlutterView API + FXL_CHECK(snapshot_override.empty()) << "snapshot_override is obsolete"; + + // The flutter assets directory name is the last directory of the bundle_path + // and the path into the APK + size_t last_slash_idx = bundle_path.rfind("/", bundle_path.size()); + std::string flutter_assets_dir = bundle_path.substr( + last_slash_idx + 1, bundle_path.size() - last_slash_idx); + + fxl::RefPtr asset_provider = + fxl::MakeRefCounted(env, assetManager, + flutter_assets_dir); + blink::Threads::UI()->PostTask( + [engine = engine_->GetWeakPtr(), + asset_provider = std::move(asset_provider), + bundle_path = std::move(bundle_path), entrypoint = std::move(entrypoint), + reuse_runtime_controller = reuse_runtime_controller] { + if (engine) + engine->RunBundleWithAssets( + std::move(asset_provider), std::move(bundle_path), + std::move(entrypoint), reuse_runtime_controller); }); - latch.Wait(); +} + +void PlatformViewAndroid::RunBundleAndSource(std::string bundle_path, + std::string main, + std::string packages) { + blink::Threads::UI()->PostTask([ + engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path), + main = std::move(main), packages = std::move(packages) + ] { + if (engine) + engine->RunBundleAndSource(std::move(bundle_path), std::move(main), + std::move(packages)); + }); +} + +void PlatformViewAndroid::SetAssetBundlePathOnUI(std::string bundle_path) { + blink::Threads::UI()->PostTask( + [ engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path) ] { + if (engine) + engine->SetAssetBundlePath(std::move(bundle_path)); + }); +} + +void PlatformViewAndroid::SetViewportMetrics(jfloat device_pixel_ratio, + jint physical_width, + jint physical_height, + jint physical_padding_top, + jint physical_padding_right, + jint physical_padding_bottom, + jint physical_padding_left, + jint physical_view_inset_top, + jint physical_view_inset_right, + jint physical_view_inset_bottom, + jint physical_view_inset_left) { + blink::ViewportMetrics metrics; + metrics.device_pixel_ratio = device_pixel_ratio; + metrics.physical_width = physical_width; + metrics.physical_height = physical_height; + metrics.physical_padding_top = physical_padding_top; + metrics.physical_padding_right = physical_padding_right; + metrics.physical_padding_bottom = physical_padding_bottom; + metrics.physical_padding_left = physical_padding_left; + metrics.physical_view_inset_top = physical_view_inset_top; + metrics.physical_view_inset_right = physical_view_inset_right; + metrics.physical_view_inset_bottom = physical_view_inset_bottom; + metrics.physical_view_inset_left = physical_view_inset_left; + + blink::Threads::UI()->PostTask([ engine = engine_->GetWeakPtr(), metrics ] { + if (engine) + engine->SetViewportMetrics(metrics); + }); } void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, @@ -68,7 +301,7 @@ void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, java_object_, task_runners_.GetPlatformTaskRunner()); + response_id, GetWeakPtr()); } PlatformView::DispatchPlatformMessage( @@ -82,7 +315,7 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, java_object_, task_runners_.GetPlatformTaskRunner()); + response_id, GetWeakPtr()); } PlatformView::DispatchPlatformMessage( @@ -90,6 +323,20 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, std::move(response))); } +void PlatformViewAndroid::DispatchPointerDataPacket(JNIEnv* env, + jobject buffer, + jint position) { + uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); + + blink::Threads::UI()->PostTask(fxl::MakeCopyable([ + engine = engine_->GetWeakPtr(), + packet = std::make_unique(data, position) + ] { + if (engine.get()) + engine->DispatchPointerDataPacket(*packet); + })); +} + void PlatformViewAndroid::InvokePlatformMessageResponseCallback( JNIEnv* env, jint response_id, @@ -122,11 +369,10 @@ void PlatformViewAndroid::InvokePlatformMessageEmptyResponseCallback( message_response->CompleteEmpty(); } -// |shell::PlatformView| void PlatformViewAndroid::HandlePlatformMessage( fxl::RefPtr message) { JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = java_object_.get(env); + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); if (view.is_null()) return; @@ -156,6 +402,35 @@ void PlatformViewAndroid::HandlePlatformMessage( } } +void PlatformViewAndroid::HandlePlatformMessageResponse( + int response_id, + std::vector data) { + JNIEnv* env = fml::jni::AttachCurrentThread(); + + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + + if (view.is_null()) + return; + fml::jni::ScopedJavaLocalRef data_array( + env, env->NewByteArray(data.size())); + env->SetByteArrayRegion(data_array.obj(), 0, data.size(), + reinterpret_cast(data.data())); + + FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, + data_array.obj()); +} + +void PlatformViewAndroid::HandlePlatformMessageEmptyResponse(int response_id) { + JNIEnv* env = fml::jni::AttachCurrentThread(); + + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + + if (view.is_null()) + return; + FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, + nullptr); +} + void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, jint id, jint action, @@ -176,14 +451,35 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, id, static_cast(action), std::move(args_vector)); } -// |shell::PlatformView| -void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { +void PlatformViewAndroid::SetSemanticsEnabled(jboolean enabled) { + PlatformView::SetSemanticsEnabled(enabled); +} + +void PlatformViewAndroid::ReleaseSurface() { + NotifyDestroyed(); + android_surface_->TeardownOnScreenContext(); + SetRasterizer(std::make_unique()); +} + +VsyncWaiter* PlatformViewAndroid::GetVsyncWaiter() { + if (!vsync_waiter_) + vsync_waiter_ = std::make_unique(); + return vsync_waiter_.get(); +} + +bool PlatformViewAndroid::ResourceContextMakeCurrent() { + FXL_CHECK(android_surface_); + return android_surface_->ResourceContextMakeCurrent(); +} + +void PlatformViewAndroid::UpdateSemantics( + blink::SemanticsNodeUpdates update) { constexpr size_t kBytesPerNode = 36 * sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t); JNIEnv* env = fml::jni::AttachCurrentThread(); { - fml::jni::ScopedJavaLocalRef view = java_object_.get(env); + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); if (view.is_null()) return; @@ -264,6 +560,79 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { } } +void PlatformViewAndroid::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + JNIEnv* env = fml::jni::AttachCurrentThread(); + FXL_CHECK(env); + + { + fml::jni::ScopedJavaLocalRef local_flutter_view = + flutter_view_.get(env); + if (local_flutter_view.is_null()) { + // Collected. + return; + } + + // Grab the class of the flutter view. + jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); + FXL_CHECK(flutter_view_class); + + // Grab the runFromSource method id. + jmethodID run_from_source_method_id = env->GetMethodID( + flutter_view_class, "runFromSource", + "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); + FXL_CHECK(run_from_source_method_id); + + // Invoke runFromSource on the Android UI thread. + jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); + FXL_CHECK(java_assets_directory); + jstring java_main = env->NewStringUTF(main.c_str()); + FXL_CHECK(java_main); + jstring java_packages = env->NewStringUTF(packages.c_str()); + FXL_CHECK(java_packages); + env->CallVoidMethod(local_flutter_view.obj(), run_from_source_method_id, + java_assets_directory, java_main, java_packages); + } + + // Detaching from the VM deletes any stray local references. + fml::jni::DetachFromVM(); +} + +void PlatformViewAndroid::SetAssetBundlePath( + const std::string& assets_directory) { + JNIEnv* env = fml::jni::AttachCurrentThread(); + FXL_CHECK(env); + + { + fml::jni::ScopedJavaLocalRef local_flutter_view = + flutter_view_.get(env); + if (local_flutter_view.is_null()) { + // Collected. + return; + } + + // Grab the class of the flutter view. + jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); + FXL_CHECK(flutter_view_class); + + // Grab the setAssetBundlePath method id. + jmethodID method_id = env->GetMethodID( + flutter_view_class, "setAssetBundlePathOnUI", "(Ljava/lang/String;)V"); + FXL_CHECK(method_id); + + // Invoke setAssetBundlePath on the Android UI thread. + jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); + FXL_CHECK(java_assets_directory); + + env->CallVoidMethod(local_flutter_view.obj(), method_id, + java_assets_directory); + } + + // Detaching from the VM deletes any stray local references. + fml::jni::DetachFromVM(); +} + void PlatformViewAndroid::RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture) { @@ -271,56 +640,116 @@ void PlatformViewAndroid::RegisterExternalTexture( std::make_shared(texture_id, surface_texture)); } -// |shell::PlatformView| -std::unique_ptr PlatformViewAndroid::CreateVSyncWaiter() { - return std::make_unique(task_runners_); +void PlatformViewAndroid::MarkTextureFrameAvailable(int64_t texture_id) { + blink::Threads::Gpu()->PostTask([this, texture_id]() { + std::shared_ptr texture = + static_pointer_cast( + rasterizer_->GetTextureRegistry().GetTexture(texture_id)); + if (texture) { + texture->MarkNewFrameAvailable(); + } + }); + PlatformView::MarkTextureFrameAvailable(texture_id); } -// |shell::PlatformView| -std::unique_ptr PlatformViewAndroid::CreateRenderingSurface() { - return android_surface_->CreateGPUSurface(); -} +fml::jni::ScopedJavaLocalRef PlatformViewAndroid::GetBitmap( + JNIEnv* env) { + // Render the last frame to an array of pixels on the GPU thread. + // The pixels will be returned as a global JNI reference to an int array. + fxl::AutoResetWaitableEvent latch; + jobject pixels_ref = nullptr; + SkISize frame_size; + blink::Threads::Gpu()->PostTask([this, &latch, &pixels_ref, &frame_size]() { + GetBitmapGpuTask(&pixels_ref, &frame_size); + latch.Signal(); + }); -// |shell::PlatformView| -sk_sp PlatformViewAndroid::CreateResourceContext() const { - sk_sp resource_context; - if (android_surface_->ResourceContextMakeCurrent()) { - // TODO(chinmaygarde): Currently, this code depends on the fact that only - // the OpenGL surface will be able to make a resource context current. If - // this changes, this assumption breaks. Handle the same. - resource_context = IOManager::CreateCompatibleResourceLoadingContext( - GrBackend::kOpenGL_GrBackend); - } else { - FXL_DLOG(ERROR) << "Could not make the resource context current."; - } + latch.Wait(); - return resource_context; -} - -void PlatformViewAndroid::InstallFirstFrameCallback() { - // On Platform Task Runner. - SetNextFrameCallback( - [platform_view = GetWeakPtr(), - platform_task_runner = task_runners_.GetPlatformTaskRunner()]() { - // On GPU Task Runner. - platform_task_runner->PostTask([platform_view]() { - // Back on Platform Task Runner. - if (platform_view) { - reinterpret_cast(platform_view.get()) - ->FireFirstFrameCallback(); - } - }); - }); + // Convert the pixel array to an Android bitmap. + if (pixels_ref == nullptr) + return fml::jni::ScopedJavaLocalRef(); + + fml::jni::ScopedJavaGlobalRef pixels(env, pixels_ref); + + jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); + FXL_CHECK(bitmap_class); + + jmethodID create_bitmap = env->GetStaticMethodID( + bitmap_class, "createBitmap", + "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); + FXL_CHECK(create_bitmap); + + jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); + FXL_CHECK(bitmap_config_class); + + jmethodID bitmap_config_value_of = env->GetStaticMethodID( + bitmap_config_class, "valueOf", + "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); + FXL_CHECK(bitmap_config_value_of); + + jstring argb = env->NewStringUTF("ARGB_8888"); + FXL_CHECK(argb); + + jobject bitmap_config = env->CallStaticObjectMethod( + bitmap_config_class, bitmap_config_value_of, argb); + FXL_CHECK(bitmap_config); + + jobject bitmap = env->CallStaticObjectMethod( + bitmap_class, create_bitmap, pixels.obj(), frame_size.width(), + frame_size.height(), bitmap_config); + + return fml::jni::ScopedJavaLocalRef(env, bitmap); } -void PlatformViewAndroid::FireFirstFrameCallback() { - JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = java_object_.get(env); - if (view.is_null()) { - // The Java object died. +void PlatformViewAndroid::GetBitmapGpuTask(jobject* pixels_out, + SkISize* size_out) { + flow::LayerTree* layer_tree = rasterizer_->GetLastLayerTree(); + if (layer_tree == nullptr) return; + + JNIEnv* env = fml::jni::AttachCurrentThread(); + FXL_CHECK(env); + + const SkISize& frame_size = layer_tree->frame_size(); + jsize pixels_size = frame_size.width() * frame_size.height(); + jintArray pixels_array = env->NewIntArray(pixels_size); + FXL_CHECK(pixels_array); + + jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); + FXL_CHECK(pixels); + + SkImageInfo image_info = + SkImageInfo::Make(frame_size.width(), frame_size.height(), + kRGBA_8888_SkColorType, kPremul_SkAlphaType); + + sk_sp surface = SkSurface::MakeRasterDirect( + image_info, pixels, frame_size.width() * sizeof(jint)); + + flow::CompositorContext compositor_context(nullptr); + compositor_context.SetTextureRegistry(&texture_registry_); + SkCanvas* canvas = surface->getCanvas(); + flow::CompositorContext::ScopedFrame frame = + compositor_context.AcquireFrame(nullptr, canvas, false); + + canvas->clear(SK_ColorBLACK); + layer_tree->Raster(frame); + canvas->flush(); + + // Our configuration of Skia does not support rendering to the + // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. + // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). + for (int i = 0; i < pixels_size; i++) { + uint8_t* bytes = reinterpret_cast(pixels + i); + std::swap(bytes[0], bytes[2]); } - FlutterViewOnFirstFrame(fml::jni::AttachCurrentThread(), view.obj()); + + env->ReleaseIntArrayElements(pixels_array, pixels, 0); + + *pixels_out = env->NewGlobalRef(pixels_array); + *size_out = frame_size; + + fml::jni::DetachFromVM(); } } // namespace shell diff --git a/shell/platform/android/platform_view_android.h b/shell/platform/android/platform_view_android.h index 9976c443f4248..4779ea16ab4a7 100644 --- a/shell/platform/android/platform_view_android.h +++ b/shell/platform/android/platform_view_android.h @@ -20,23 +20,45 @@ namespace shell { -class PlatformViewAndroid final : public PlatformView { +class PlatformViewAndroid : public PlatformView { public: static bool Register(JNIEnv* env); - PlatformViewAndroid(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - fml::jni::JavaObjectWeakGlobalRef java_object, - bool use_software_rendering); + PlatformViewAndroid(); ~PlatformViewAndroid() override; - void NotifyCreated(fxl::RefPtr native_window); + virtual void Attach() override; - void NotifyChanged(const SkISize& size); + void Detach(); - // |shell::PlatformView| - void NotifyDestroyed() override; + void SurfaceCreated(JNIEnv* env, jobject jsurface, jint backgroundColor); + + void SurfaceChanged(jint width, jint height); + + void SurfaceDestroyed(); + + void RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, + std::string snapshot_override, + std::string entrypoint, + bool reuse_isolate, + jobject assetManager); + + void RunBundleAndSource(std::string bundle_path, + std::string main, + std::string packages); + + void SetViewportMetrics(jfloat device_pixel_ratio, + jint physical_width, + jint physical_height, + jint physical_padding_top, + jint physical_padding_right, + jint physical_padding_bottom, + jint physical_padding_left, + jint physical_view_inset_top, + jint physical_view_inset_right, + jint physical_view_inset_bottom, + jint physical_view_inset_left); void DispatchPlatformMessage(JNIEnv* env, std::string name, @@ -48,6 +70,8 @@ class PlatformViewAndroid final : public PlatformView { std::string name, jint response_id); + void DispatchPointerDataPacket(JNIEnv* env, jobject buffer, jint position); + void InvokePlatformMessageResponseCallback(JNIEnv* env, jint response_id, jobject java_response_data, @@ -62,37 +86,55 @@ class PlatformViewAndroid final : public PlatformView { jobject args, jint args_position); + void SetSemanticsEnabled(jboolean enabled); + + fml::jni::ScopedJavaLocalRef GetBitmap(JNIEnv* env); + + VsyncWaiter* GetVsyncWaiter() override; + + bool ResourceContextMakeCurrent() override; + + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + void HandlePlatformMessage( + fxl::RefPtr message) override; + + void HandlePlatformMessageResponse(int response_id, + std::vector data); + + void HandlePlatformMessageEmptyResponse(int response_id); + + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + + void SetAssetBundlePathOnUI(std::string bundle_path); + + void SetAssetBundlePath(const std::string& assets_directory) override; + void RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture); + void MarkTextureFrameAvailable(int64_t texture_id) override; + + void set_flutter_view(const fml::jni::JavaObjectWeakGlobalRef& flutter_view) { + flutter_view_ = flutter_view; + } + private: - const fml::jni::JavaObjectWeakGlobalRef java_object_; - const std::unique_ptr android_surface_; + std::unique_ptr android_surface_; + fml::jni::JavaObjectWeakGlobalRef flutter_view_; // We use id 0 to mean that no response is expected. int next_response_id_ = 1; std::unordered_map> pending_responses_; - // |shell::PlatformView| - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - // |shell::PlatformView| - void HandlePlatformMessage( - fxl::RefPtr message) override; - - // |shell::PlatformView| - std::unique_ptr CreateVSyncWaiter() override; - - // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; - - // |shell::PlatformView| - sk_sp CreateResourceContext() const override; + void UpdateThreadPriorities(); - void InstallFirstFrameCallback(); + void ReleaseSurface(); - void FireFirstFrameCallback(); + void GetBitmapGpuTask(jobject* pixels_out, SkISize* size_out); FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); }; diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index f75f54a896850..c819f3bfb5e41 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -4,26 +4,17 @@ #include "flutter/shell/platform/android/platform_view_android_jni.h" -#include - -#include - -#include "flutter/assets/directory_asset_bundle.h" #include "flutter/common/settings.h" -#include "flutter/fml/file.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/jni_weak_ref.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/runtime/dart_service_isolate.h" -#include "flutter/shell/common/run_configuration.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" -#include "flutter/shell/platform/android/android_shell_holder.h" -#include "flutter/shell/platform/android/apk_asset_provider.h" -#include "flutter/shell/platform/android/flutter_main.h" #include "lib/fxl/arraysize.h" +#include "lib/fxl/logging.h" -#define ANDROID_SHELL_HOLDER \ - (reinterpret_cast(shell_holder)) +#define PLATFORM_VIEW \ + (*reinterpret_cast*>(platform_view)) namespace shell { @@ -87,12 +78,14 @@ void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj) { static jmethodID g_attach_to_gl_context_method = nullptr; void SurfaceTextureAttachToGLContext(JNIEnv* env, jobject obj, jint textureId) { + ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_attach_to_gl_context_method, textureId); FXL_CHECK(CheckException(env)); } static jmethodID g_update_tex_image_method = nullptr; void SurfaceTextureUpdateTexImage(JNIEnv* env, jobject obj) { + ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_update_tex_image_method); FXL_CHECK(CheckException(env)); } @@ -101,12 +94,14 @@ static jmethodID g_get_transform_matrix_method = nullptr; void SurfaceTextureGetTransformMatrix(JNIEnv* env, jobject obj, jfloatArray result) { + ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_get_transform_matrix_method, result); FXL_CHECK(CheckException(env)); } static jmethodID g_detach_from_gl_context_method = nullptr; void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { + ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_detach_from_gl_context_method); FXL_CHECK(CheckException(env)); } @@ -114,22 +109,22 @@ void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { // Called By Java static jlong Attach(JNIEnv* env, jclass clazz, jobject flutterView) { - fml::jni::JavaObjectWeakGlobalRef java_object(env, flutterView); - auto shell_holder = std::make_unique( - FlutterMain::Get().GetSettings(), java_object); - if (shell_holder->IsValid()) { - return reinterpret_cast(shell_holder.release()); - } else { - return 0; - } + auto view = new PlatformViewAndroid(); + auto storage = new std::shared_ptr(view); + // Create a weak reference to the flutterView Java object so that we can make + // calls into it later. + view->Attach(); + view->set_flutter_view(fml::jni::JavaObjectWeakGlobalRef(env, flutterView)); + return reinterpret_cast(storage); } -static void Detach(JNIEnv* env, jobject jcaller, jlong shell_holder) { - // Nothing to do. +static void Detach(JNIEnv* env, jobject jcaller, jlong platform_view) { + PLATFORM_VIEW->Detach(); } -static void Destroy(JNIEnv* env, jobject jcaller, jlong shell_holder) { - delete ANDROID_SHELL_HOLDER; +static void Destroy(JNIEnv* env, jobject jcaller, jlong platform_view) { + PLATFORM_VIEW->Detach(); + delete &PLATFORM_VIEW; } static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { @@ -139,180 +134,67 @@ static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { static void SurfaceCreated(JNIEnv* env, jobject jcaller, - jlong shell_holder, - jobject jsurface, + jlong platform_view, + jobject surface, jint backgroundColor) { - // Note: This frame ensures that any local references used by - // ANativeWindow_fromSurface are released immediately. This is needed as a - // workaround for https://code.google.com/p/android/issues/detail?id=68174 - fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); - auto window = fxl::MakeRefCounted( - ANativeWindow_fromSurface(env, jsurface)); - ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyCreated(std::move(window)); + return PLATFORM_VIEW->SurfaceCreated(env, surface, backgroundColor); } static void SurfaceChanged(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jint width, jint height) { - ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyChanged( - SkISize::Make(width, height)); -} - -static void SurfaceDestroyed(JNIEnv* env, jobject jcaller, jlong shell_holder) { - ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyDestroyed(); -} - -std::unique_ptr CreateIsolateConfiguration( - const blink::AssetManager& asset_manager) { - if (blink::DartVM::IsRunningPrecompiledCode()) { - return IsolateConfiguration::CreateForPrecompiledCode(); - } - - const auto configuration_from_blob = - [&asset_manager](const std::string& snapshot_name) - -> std::unique_ptr { - std::vector blob; - if (asset_manager.GetAsBuffer(snapshot_name, &blob)) { - return IsolateConfiguration::CreateForSnapshot( - std::make_unique(std::move(blob))); - } - return nullptr; - }; - - if (auto kernel = configuration_from_blob("kernel_blob.bin")) { - return kernel; - } - - if (auto script = configuration_from_blob("snapshot_blob.bin")) { - return script; - } - - return nullptr; -} - -static void RunBundleAndSnapshot( - JNIEnv* env, - jobject jcaller, - jlong shell_holder, - jstring jbundlepath, - jstring /* snapshot override (unused) */, - jstring jEntrypoint, - jboolean /* reuse runtime controller (unused) */, - jobject jAssetManager) { - auto asset_manager = fxl::MakeRefCounted(); - - const auto bundlepath = fml::jni::JavaStringToString(env, jbundlepath); - - if (bundlepath.size() > 0) { - // If we got a bundle path, attempt to use that as a directory asset - // bundle. - asset_manager->PushBack(std::make_unique( - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true))); - - // Use the last path component of the bundle path to determine the - // directory in the APK assets. - const auto last_slash_index = bundlepath.rfind("/", bundlepath.size()); - if (last_slash_index != std::string::npos) { - auto apk_asset_dir = bundlepath.substr( - last_slash_index + 1, bundlepath.size() - last_slash_index); - - asset_manager->PushBack(std::make_unique( - env, // jni environment - jAssetManager, // asset manager - std::move(apk_asset_dir)) // apk asset dir - ); - } - } - - auto isolate_configuration = CreateIsolateConfiguration(*asset_manager); - - if (!isolate_configuration) { - FXL_DLOG(ERROR) - << "Isolate configuration could not be determined for engine launch."; - return; - } - - RunConfiguration config(std::move(isolate_configuration), - std::move(asset_manager)); - - { - auto entrypoint = fml::jni::JavaStringToString(env, jEntrypoint); - if (entrypoint.size() > 0) { - config.SetEntrypoint(std::move(entrypoint)); - } - } - - ANDROID_SHELL_HOLDER->Launch(std::move(config)); + return PLATFORM_VIEW->SurfaceChanged(width, height); +} + +static void SurfaceDestroyed(JNIEnv* env, + jobject jcaller, + jlong platform_view) { + return PLATFORM_VIEW->SurfaceDestroyed(); +} + +static void RunBundleAndSnapshot(JNIEnv* env, + jobject jcaller, + jlong platform_view, + jstring bundlePath, + jstring snapshotOverride, + jstring entrypoint, + jboolean reuse_runtime_controller, + jobject assetManager) { + return PLATFORM_VIEW->RunBundleAndSnapshot( + env, + fml::jni::JavaStringToString(env, bundlePath), // + fml::jni::JavaStringToString(env, snapshotOverride), // + fml::jni::JavaStringToString(env, entrypoint), // + reuse_runtime_controller, // + assetManager + ); } -static void RunBundleAndSource(JNIEnv* env, - jobject jcaller, - jlong shell_holder, - jstring jBundlePath, - jstring main, - jstring packages) { - auto asset_manager = fxl::MakeRefCounted(); - - const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); - - if (bundlepath.size() > 0) { - auto directory = - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); - asset_manager->PushBack( - std::make_unique(std::move(directory))); - } - - auto main_file_path = fml::jni::JavaStringToString(env, main); - auto packages_file_path = fml::jni::JavaStringToString(env, packages); - - auto config = - IsolateConfiguration::CreateForSource(main_file_path, packages_file_path); - - if (!config) { - return; - } - - RunConfiguration run_configuration(std::move(config), - std::move(asset_manager)); - - ANDROID_SHELL_HOLDER->Launch(std::move(run_configuration)); +void RunBundleAndSource(JNIEnv* env, + jobject jcaller, + jlong platform_view, + jstring bundlePath, + jstring main, + jstring packages) { + return PLATFORM_VIEW->RunBundleAndSource( + fml::jni::JavaStringToString(env, bundlePath), + fml::jni::JavaStringToString(env, main), + fml::jni::JavaStringToString(env, packages)); } void SetAssetBundlePathOnUI(JNIEnv* env, jobject jcaller, - jlong shell_holder, - jstring jBundlePath) { - const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); - - if (bundlepath.size() == 0) { - return; - } - - auto directory = - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); - - if (!directory.is_valid()) { - return; - } - - std::unique_ptr directory_asset_bundle = - std::make_unique(std::move(directory)); - - if (!directory_asset_bundle->IsValid()) { - return; - } - - auto asset_manager = fxl::MakeRefCounted(); - asset_manager->PushBack(std::move(directory_asset_bundle)); - - ANDROID_SHELL_HOLDER->UpdateAssetManager(std::move(asset_manager)); + jlong platform_view, + jstring bundlePath) { + return PLATFORM_VIEW->SetAssetBundlePathOnUI( + fml::jni::JavaStringToString(env, bundlePath)); } static void SetViewportMetrics(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jfloat devicePixelRatio, jint physicalWidth, jint physicalHeight, @@ -324,194 +206,115 @@ static void SetViewportMetrics(JNIEnv* env, jint physicalViewInsetRight, jint physicalViewInsetBottom, jint physicalViewInsetLeft) { - const blink::ViewportMetrics metrics = { - .device_pixel_ratio = devicePixelRatio, - .physical_width = physicalWidth, - .physical_height = physicalHeight, - .physical_padding_top = physicalPaddingTop, - .physical_padding_right = physicalPaddingRight, - .physical_padding_bottom = physicalPaddingBottom, - .physical_padding_left = physicalPaddingLeft, - .physical_view_inset_top = physicalViewInsetTop, - .physical_view_inset_right = physicalViewInsetRight, - .physical_view_inset_bottom = physicalViewInsetBottom, - .physical_view_inset_left = physicalViewInsetLeft, - }; - - ANDROID_SHELL_HOLDER->SetViewportMetrics(metrics); + return PLATFORM_VIEW->SetViewportMetrics(devicePixelRatio, // + physicalWidth, // + physicalHeight, // + physicalPaddingTop, // + physicalPaddingRight, // + physicalPaddingBottom, // + physicalPaddingLeft, // + physicalViewInsetTop, // + physicalViewInsetRight, // + physicalViewInsetBottom, // + physicalViewInsetLeft); } -static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) { - auto screenshot = ANDROID_SHELL_HOLDER->Screenshot( - Rasterizer::ScreenshotType::UncompressedImage, false); - if (screenshot.data == nullptr) { - return nullptr; - } - - const SkISize& frame_size = screenshot.frame_size; - jsize pixels_size = frame_size.width() * frame_size.height(); - jintArray pixels_array = env->NewIntArray(pixels_size); - FXL_CHECK(pixels_array); - - jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); - FXL_CHECK(pixels); - - auto pixels_src = static_cast(screenshot.data->data()); - - // Our configuration of Skia does not support rendering to the - // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. - // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). - for (int i = 0; i < pixels_size; i++) { - int32_t src_pixel = pixels_src[i]; - uint8_t* src_bytes = reinterpret_cast(&src_pixel); - std::swap(src_bytes[0], src_bytes[2]); - pixels[i] = src_pixel; - } - - env->ReleaseIntArrayElements(pixels_array, pixels, 0); - - jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); - FXL_CHECK(bitmap_class); - - jmethodID create_bitmap = env->GetStaticMethodID( - bitmap_class, "createBitmap", - "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); - FXL_CHECK(create_bitmap); - - jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); - FXL_CHECK(bitmap_config_class); - - jmethodID bitmap_config_value_of = env->GetStaticMethodID( - bitmap_config_class, "valueOf", - "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); - FXL_CHECK(bitmap_config_value_of); - - jstring argb = env->NewStringUTF("ARGB_8888"); - FXL_CHECK(argb); - - jobject bitmap_config = env->CallStaticObjectMethod( - bitmap_config_class, bitmap_config_value_of, argb); - FXL_CHECK(bitmap_config); - - return env->CallStaticObjectMethod(bitmap_class, create_bitmap, pixels_array, - frame_size.width(), frame_size.height(), - bitmap_config); +static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong platform_view) { + return PLATFORM_VIEW->GetBitmap(env).Release(); } static void DispatchPlatformMessage(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jstring channel, jobject message, jint position, jint responseId) { - ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPlatformMessage( - env, // - fml::jni::JavaStringToString(env, channel), // - message, // - position, // - responseId // - ); + return PLATFORM_VIEW->DispatchPlatformMessage( + env, fml::jni::JavaStringToString(env, channel), message, position, + responseId); } static void DispatchEmptyPlatformMessage(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jstring channel, jint responseId) { - ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchEmptyPlatformMessage( - env, // - fml::jni::JavaStringToString(env, channel), // - responseId // - ); + return PLATFORM_VIEW->DispatchEmptyPlatformMessage( + env, fml::jni::JavaStringToString(env, channel), responseId); } static void DispatchPointerDataPacket(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jobject buffer, jint position) { - uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); - auto packet = std::make_unique(data, position); - ANDROID_SHELL_HOLDER->DispatchPointerDataPacket(std::move(packet)); + return PLATFORM_VIEW->DispatchPointerDataPacket(env, buffer, position); } static void DispatchSemanticsAction(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jint id, jint action, jobject args, jint args_position) { - ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchSemanticsAction( - env, // - id, // - action, // - args, // - args_position // - ); + return PLATFORM_VIEW->DispatchSemanticsAction(env, id, action, args, + args_position); } static void SetSemanticsEnabled(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jboolean enabled) { - ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled); + return PLATFORM_VIEW->SetSemanticsEnabled(enabled); } static jboolean GetIsSoftwareRendering(JNIEnv* env, jobject jcaller) { - return FlutterMain::Get().GetSettings().enable_software_rendering; + return blink::Settings::Get().enable_software_rendering; } static void RegisterTexture(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jlong texture_id, jobject surface_texture) { - ANDROID_SHELL_HOLDER->GetPlatformView()->RegisterExternalTexture( - static_cast(texture_id), // - fml::jni::JavaObjectWeakGlobalRef(env, surface_texture) // - ); + PLATFORM_VIEW->RegisterExternalTexture( + static_cast(texture_id), + fml::jni::JavaObjectWeakGlobalRef(env, surface_texture)); } static void MarkTextureFrameAvailable(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jlong texture_id) { - ANDROID_SHELL_HOLDER->GetPlatformView()->MarkTextureFrameAvailable( + return PLATFORM_VIEW->MarkTextureFrameAvailable( static_cast(texture_id)); } static void UnregisterTexture(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jlong texture_id) { - ANDROID_SHELL_HOLDER->GetPlatformView()->UnregisterTexture( - static_cast(texture_id)); + PLATFORM_VIEW->UnregisterTexture(static_cast(texture_id)); } static void InvokePlatformMessageResponseCallback(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jint responseId, jobject message, jint position) { - ANDROID_SHELL_HOLDER->GetPlatformView() - ->InvokePlatformMessageResponseCallback(env, // - responseId, // - message, // - position // - ); + return PLATFORM_VIEW->InvokePlatformMessageResponseCallback( + env, responseId, message, position); } static void InvokePlatformMessageEmptyResponseCallback(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jint responseId) { - ANDROID_SHELL_HOLDER->GetPlatformView() - ->InvokePlatformMessageEmptyResponseCallback(env, // - responseId // - ); + return PLATFORM_VIEW->InvokePlatformMessageEmptyResponseCallback(env, + responseId); } bool PlatformViewAndroid::Register(JNIEnv* env) { @@ -550,8 +353,8 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { }, { .name = "nativeRunBundleAndSnapshot", - .signature = "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/" - "String;ZLandroid/content/res/AssetManager;)V", + .signature = + "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLandroid/content/res/AssetManager;)V", .fnPtr = reinterpret_cast(&shell::RunBundleAndSnapshot), }, { @@ -570,6 +373,11 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { .signature = "(J)V", .fnPtr = reinterpret_cast(&shell::Detach), }, + { + .name = "nativeDestroy", + .signature = "(J)V", + .fnPtr = reinterpret_cast(&shell::Destroy), + }, { .name = "nativeGetObservatoryUri", .signature = "()Ljava/lang/String;", diff --git a/shell/platform/android/vsync_waiter_android.cc b/shell/platform/android/vsync_waiter_android.cc index 052de023b9a12..29e1958dcc011 100644 --- a/shell/platform/android/vsync_waiter_android.cc +++ b/shell/platform/android/vsync_waiter_android.cc @@ -7,7 +7,7 @@ #include #include -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" @@ -16,49 +16,68 @@ namespace shell { -static jlong CreatePendingCallback(VsyncWaiter::Callback callback); - -static void ConsumePendingCallback(jlong java_baton, - fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time); - static fml::jni::ScopedJavaGlobalRef* g_vsync_waiter_class = nullptr; static jmethodID g_async_wait_for_vsync_method_ = nullptr; -VsyncWaiterAndroid::VsyncWaiterAndroid(blink::TaskRunners task_runners) - : VsyncWaiter(std::move(task_runners)) {} +VsyncWaiterAndroid::VsyncWaiterAndroid() : weak_factory_(this) {} VsyncWaiterAndroid::~VsyncWaiterAndroid() = default; -// |shell::VsyncWaiter| -void VsyncWaiterAndroid::AwaitVSync() { - auto java_baton = - CreatePendingCallback(std::bind(&VsyncWaiterAndroid::FireCallback, // - this, // - std::placeholders::_1, // - std::placeholders::_2 // - )); +void VsyncWaiterAndroid::AsyncWaitForVsync(Callback callback) { + FXL_DCHECK(!callback_); + callback_ = std::move(callback); + fml::WeakPtr* weak = + new fml::WeakPtr(); + *weak = weak_factory_.GetWeakPtr(); - task_runners_.GetPlatformTaskRunner()->PostTask([java_baton]() { + blink::Threads::Platform()->PostTask([weak] { JNIEnv* env = fml::jni::AttachCurrentThread(); - env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), // - g_async_wait_for_vsync_method_, // - java_baton // - ); + env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), + g_async_wait_for_vsync_method_, + reinterpret_cast(weak)); }); } +void VsyncWaiterAndroid::OnVsync(int64_t frameTimeNanos, + int64_t frameTargetTimeNanos) { + Callback callback = std::move(callback_); + callback_ = Callback(); + blink::Threads::UI()->PostTask( + [callback, frameTimeNanos, frameTargetTimeNanos] { + callback(fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTimeNanos)), + fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos))); + }); +} + static void OnNativeVsync(JNIEnv* env, jclass jcaller, jlong frameTimeNanos, jlong frameTargetTimeNanos, - jlong java_baton) { - auto frame_time = fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTimeNanos)); - auto target_time = fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos)); - - ConsumePendingCallback(java_baton, frame_time, target_time); + jlong cookie) { + // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight + // Vsync" checkbox in the timeline can be enabled. + // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 + // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE + TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); +#else + { + constexpr size_t num_chars = sizeof(jlong) * CHAR_BIT * 3.4 + 2; + char deadline[num_chars]; + sprintf(deadline, "%lld", frameTargetTimeNanos / 1000); // microseconds + TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); + } +#endif + fml::WeakPtr* weak = + reinterpret_cast*>(cookie); + VsyncWaiterAndroid* waiter = weak->get(); + delete weak; + if (waiter) { + waiter->OnVsync(static_cast(frameTimeNanos), + static_cast(frameTargetTimeNanos)); + } } bool VsyncWaiterAndroid::Register(JNIEnv* env) { @@ -86,27 +105,4 @@ bool VsyncWaiterAndroid::Register(JNIEnv* env) { return env->RegisterNatives(clazz, methods, arraysize(methods)) == 0; } -struct PendingCallbackData { - VsyncWaiter::Callback callback; - - PendingCallbackData(VsyncWaiter::Callback p_callback) - : callback(std::move(p_callback)) { - FXL_DCHECK(callback); - } -}; - -static jlong CreatePendingCallback(VsyncWaiter::Callback callback) { - // This delete for this new is balanced in the consume call. - auto data = new PendingCallbackData(std::move(callback)); - return reinterpret_cast(data); -} - -static void ConsumePendingCallback(jlong java_baton, - fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time) { - auto data = reinterpret_cast(java_baton); - data->callback(frame_start_time, frame_target_time); - delete data; -} - } // namespace shell diff --git a/shell/platform/android/vsync_waiter_android.h b/shell/platform/android/vsync_waiter_android.h index fd72a0a21f563..c73af4bfca6f0 100644 --- a/shell/platform/android/vsync_waiter_android.h +++ b/shell/platform/android/vsync_waiter_android.h @@ -12,17 +12,22 @@ namespace shell { -class VsyncWaiterAndroid final : public VsyncWaiter { +class VsyncWaiterAndroid : public VsyncWaiter { public: + VsyncWaiterAndroid(); + + ~VsyncWaiterAndroid() override; + static bool Register(JNIEnv* env); - VsyncWaiterAndroid(blink::TaskRunners task_runners); + void AsyncWaitForVsync(Callback callback) override; - ~VsyncWaiterAndroid() override; + void OnVsync(int64_t frameTimeNanos, int64_t frameTargetTimeNanos); private: - // |shell::VsyncWaiter| - void AwaitVSync() override; + Callback callback_; + fml::WeakPtr self_; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterAndroid); }; diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index c6f7acd6be76a..c971c443bcc30 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -6,8 +6,11 @@ assert(is_mac || is_ios) group("darwin") { if (is_mac) { + deps = [ + "desktop:shell_standalone", + ] if (!is_fuchsia_host) { - deps = [ + deps += [ "desktop:shell_application_bundle", ] } @@ -42,12 +45,15 @@ source_set("flutter_channels") { "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", + "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", "//third_party/skia", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] } executable("flutter_channels_unittests") { @@ -62,7 +68,7 @@ executable("flutter_channels_unittests") { deps = [ ":flutter_channels", - "$flutter_root/testing", "//third_party/dart/runtime:libdart_jit", + "$flutter_root/testing", ] } diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index a1023737973a7..e6fa86366b080 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -9,23 +9,28 @@ source_set("common") { sources = [ "buffer_conversions.h", "buffer_conversions.mm", - "command_line.h", - "command_line.mm", + "platform_mac.h", + "platform_mac.mm", + "process_info_mac.cc", + "process_info_mac.h", ] set_sources_assignment_filter(sources_assignment_filter) deps = [ + "//third_party/dart/runtime:dart_api", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", + "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:dart_api", "//third_party/skia", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] } diff --git a/shell/platform/darwin/common/command_line.h b/shell/platform/darwin/common/command_line.h deleted file mode 100644 index dfc995b90f378..0000000000000 --- a/shell/platform/darwin/common/command_line.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 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_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ - -#include "lib/fxl/command_line.h" -#include "lib/fxl/macros.h" - -namespace shell { - -fxl::CommandLine CommandLineFromNSProcessInfo(); - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ diff --git a/shell/platform/darwin/common/command_line.mm b/shell/platform/darwin/common/command_line.mm deleted file mode 100644 index bf8d4cc9d40f4..0000000000000 --- a/shell/platform/darwin/common/command_line.mm +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 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/shell/platform/darwin/common/command_line.h" - -#import - -namespace shell { - -fxl::CommandLine CommandLineFromNSProcessInfo() { - std::vector args_vector; - - for (NSString* arg in [NSProcessInfo processInfo].arguments) { - args_vector.emplace_back(arg.UTF8String); - } - - return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); -} - -} // namespace shell diff --git a/shell/platform/darwin/common/platform_mac.h b/shell/platform/darwin/common/platform_mac.h new file mode 100644 index 0000000000000..1989b25f11c43 --- /dev/null +++ b/shell/platform/darwin/common/platform_mac.h @@ -0,0 +1,20 @@ +// Copyright 2015 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. + +#ifndef SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ +#define SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ + +#include "flutter/shell/common/engine.h" + +namespace shell { + +void PlatformMacMain(std::string icu_data_path, + std::string application_library_path, + std::string bundle_path); + +bool AttemptLaunchFromCommandLineSwitches(Engine* engine); + +} // namespace shell + +#endif // SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ diff --git a/shell/platform/darwin/common/platform_mac.mm b/shell/platform/darwin/common/platform_mac.mm new file mode 100644 index 0000000000000..5af35a430beef --- /dev/null +++ b/shell/platform/darwin/common/platform_mac.mm @@ -0,0 +1,160 @@ +// Copyright 2015 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. + +#include "flutter/shell/platform/darwin/common/platform_mac.h" + +#include + +#include "flutter/common/threads.h" +#include "flutter/fml/trace_event.h" +#include "flutter/runtime/start_up.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/tracing_controller.h" +#include "flutter/sky/engine/wtf/MakeUnique.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/strings/string_view.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace shell { + +static fxl::CommandLine InitializedCommandLine() { + std::vector args_vector; + + for (NSString* arg in [NSProcessInfo processInfo].arguments) { + args_vector.emplace_back(arg.UTF8String); + } + + return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); +} + +class EmbedderState { + public: + EmbedderState(std::string icu_data_path, + std::string application_library_path, + std::string bundle_path) { + blink::engine_main_enter_ts = Dart_TimelineGetMicros(); + FXL_DCHECK([NSThread isMainThread]) + << "Embedder initialization must occur on the main platform thread"; + + auto command_line = InitializedCommandLine(); + + // This is about as early as tracing of any kind can start. Add an instant + // marker that can be used as a reference for startup. + TRACE_EVENT_INSTANT0("flutter", "main"); + + shell::Shell::InitStandalone(std::move(command_line), icu_data_path, application_library_path, + bundle_path); + } + + ~EmbedderState() {} + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderState); +}; + +void PlatformMacMain(std::string icu_data_path, + std::string application_library_path, + std::string bundle_path) { + static std::unique_ptr g_embedder; + static std::once_flag once_main; + + std::call_once(once_main, [&]() { + g_embedder = + WTF::MakeUnique(icu_data_path, application_library_path, bundle_path); + }); +} + +static bool FlagsValidForCommandLineLaunch(const std::string& bundle_path, + const std::string& main, + const std::string& packages) { + if (main.empty() || packages.empty() || bundle_path.empty()) { + return false; + } + + // Ensure that the paths exists. This catches cases where the user has + // successfully launched the application from the tooling but has since moved + // the source files on disk and is launching again directly. + + NSFileManager* manager = [NSFileManager defaultManager]; + + if (![manager fileExistsAtPath:@(main.c_str())]) { + return false; + } + + if (![manager fileExistsAtPath:@(packages.c_str())]) { + return false; + } + + if (![manager fileExistsAtPath:@(bundle_path.c_str())]) { + return false; + } + + return true; +} + +static std::string ResolveCommandLineLaunchFlag(const fxl::StringView name) { + const auto& command_line = shell::Shell::Shared().GetCommandLine(); + + std::string command_line_option; + if (command_line.GetOptionValue(name, &command_line_option)) { + return command_line_option; + } + + const char* saved_default = + [[NSUserDefaults standardUserDefaults] stringForKey:@(name.data())].UTF8String; + + if (saved_default != NULL) { + return saved_default; + } + + return ""; +} + +bool AttemptLaunchFromCommandLineSwitches(Engine* engine) { + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; + + const auto& command_line = shell::Shell::Shared().GetCommandLine(); + + if (command_line.HasOption(FlagForSwitch(Switch::FlutterAssetsDir)) || + command_line.HasOption(FlagForSwitch(Switch::MainDartFile)) || + command_line.HasOption(FlagForSwitch(Switch::Packages))) { + // The main dart file, Flutter assets directory and the package root must be + // specified in one go. We dont want to end up in a situation where we take + // one value from the command line and the others from user defaults. In + // case, any new flags are specified, forget about all the old ones. + [defaults removeObjectForKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; + [defaults removeObjectForKey:@(FlagForSwitch(Switch::MainDartFile).data())]; + [defaults removeObjectForKey:@(FlagForSwitch(Switch::Packages).data())]; + + [defaults synchronize]; + } + + std::string bundle_path = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::FlutterAssetsDir)); + std::string main = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::MainDartFile)); + std::string packages = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::Packages)); + + if (!FlagsValidForCommandLineLaunch(bundle_path, main, packages)) { + return false; + } + + // Save the newly resolved dart main file and the package root to user + // defaults so that the next time the user launches the application in the + // simulator without the tooling, the application boots up. + [defaults setObject:@(bundle_path.c_str()) + forKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; + [defaults setObject:@(main.c_str()) forKey:@(FlagForSwitch(Switch::MainDartFile).data())]; + [defaults setObject:@(packages.c_str()) forKey:@(FlagForSwitch(Switch::Packages).data())]; + + [defaults synchronize]; + + blink::Threads::UI()->PostTask([ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { + if (engine) + engine->RunBundleAndSource(bundle_path, main, packages); + }); + + return true; +} + +} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.cc b/shell/platform/darwin/common/process_info_mac.cc new file mode 100644 index 0000000000000..11f70f305a3e9 --- /dev/null +++ b/shell/platform/darwin/common/process_info_mac.cc @@ -0,0 +1,36 @@ +// Copyright 2016 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. + +#include "flutter/shell/platform/darwin/common/process_info_mac.h" + +namespace shell { + +ProcessInfoMac::ProcessInfoMac() = default; + +ProcessInfoMac::~ProcessInfoMac() = default; + +bool ProcessInfoMac::SampleNow() { + mach_msg_type_number_t size = MACH_TASK_BASIC_INFO_COUNT; + kern_return_t result = + task_info(mach_task_self(), // + MACH_TASK_BASIC_INFO, // + reinterpret_cast(&last_sample_), // + &size); + if (result == KERN_SUCCESS) { + return true; + } + + last_sample_ = {}; + return false; +} + +size_t ProcessInfoMac::GetVirtualMemorySize() { + return last_sample_.virtual_size; +} + +size_t ProcessInfoMac::GetResidentMemorySize() { + return last_sample_.resident_size; +} + +} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.h b/shell/platform/darwin/common/process_info_mac.h new file mode 100644 index 0000000000000..7edc8034173e0 --- /dev/null +++ b/shell/platform/darwin/common/process_info_mac.h @@ -0,0 +1,36 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ + +#include +#include +#include +#include "flutter/flow/process_info.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class ProcessInfoMac : public flow::ProcessInfo { + public: + ProcessInfoMac(); + + ~ProcessInfoMac(); + + bool SampleNow() override; + + size_t GetVirtualMemorySize() override; + + size_t GetResidentMemorySize() override; + + private: + struct mach_task_basic_info last_sample_; + + FXL_DISALLOW_COPY_AND_ASSIGN(ProcessInfoMac); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ diff --git a/shell/platform/darwin/desktop/BUILD.gn b/shell/platform/darwin/desktop/BUILD.gn index 5ec3298be4aa4..a9c05f85ef284 100644 --- a/shell/platform/darwin/desktop/BUILD.gn +++ b/shell/platform/darwin/desktop/BUILD.gn @@ -8,8 +8,10 @@ source_set("mac_desktop_platform") { visibility = [ ":*" ] sources = [ - "flutter_application_delegate.h", - "flutter_application_delegate.mm", + "flutter_app_delegate.h", + "flutter_app_delegate.m", + "flutter_application.h", + "flutter_application.mm", "flutter_window.h", "flutter_window.mm", "main_mac.mm", @@ -20,22 +22,32 @@ source_set("mac_desktop_platform") { ] deps = [ + "//third_party/dart/runtime:libdart_jit", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", + "$flutter_root/shell/testing", "$flutter_root/synchronization", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:libdart_jit", "//third_party/skia", - "//third_party/skia:gpu", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] +} + +executable("shell_standalone") { + output_name = "flutter_tester" + deps = [ + ":mac_desktop_platform", + ] } if (!is_fuchsia_host) { + import("//build/config/mac/rules.gni") resource_copy_mac("mac_desktop_resources") { diff --git a/shell/platform/darwin/desktop/Info.plist b/shell/platform/darwin/desktop/Info.plist index 048afb6dadca2..31d3f1240db6b 100644 --- a/shell/platform/darwin/desktop/Info.plist +++ b/shell/platform/darwin/desktop/Info.plist @@ -9,11 +9,11 @@ CFBundleIconFile CFBundleIdentifier - io.flutter.engine + io.flutter CFBundleInfoDictionaryVersion 6.0 CFBundleName - Flutter Engine + Flutter CFBundlePackageType APPL CFBundleShortVersionString @@ -26,7 +26,9 @@ 10.6 NSHumanReadableCopyright Copyright 2015 The Flutter Authors. All rights reserved. + NSMainNibFile + flutter_mac NSPrincipalClass - NSApplication + FlutterApplication diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.h b/shell/platform/darwin/desktop/flutter_app_delegate.h new file mode 100644 index 0000000000000..d6addcb17d0a4 --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_app_delegate.h @@ -0,0 +1,14 @@ +// Copyright 2015 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. + +#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ +#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ + +#import + +@interface FlutterAppDelegate : NSObject + +@end + +#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__) */ diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.m b/shell/platform/darwin/desktop/flutter_app_delegate.m new file mode 100644 index 0000000000000..7e2dfd68389f8 --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_app_delegate.m @@ -0,0 +1,15 @@ +// Copyright 2015 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 "flutter_app_delegate.h" + +@interface FlutterAppDelegate () + +@property(assign) IBOutlet NSWindow* window; + +@end + +@implementation FlutterAppDelegate + +@end diff --git a/shell/platform/darwin/desktop/flutter_application_delegate.h b/shell/platform/darwin/desktop/flutter_application.h similarity index 65% rename from shell/platform/darwin/desktop/flutter_application_delegate.h rename to shell/platform/darwin/desktop/flutter_application.h index 3995557b25e79..6a4167b5f273a 100644 --- a/shell/platform/darwin/desktop/flutter_application_delegate.h +++ b/shell/platform/darwin/desktop/flutter_application.h @@ -1,14 +1,13 @@ -// Copyright 2017 The Flutter Authors. All rights reserved. +// Copyright 2015 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. -#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ +#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ #import -@interface FlutterApplicationDelegate : NSObject - +@interface FlutterApplication : NSApplication @end -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ diff --git a/shell/platform/darwin/desktop/flutter_application.mm b/shell/platform/darwin/desktop/flutter_application.mm new file mode 100644 index 0000000000000..57b1c83ba069a --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_application.mm @@ -0,0 +1,8 @@ +// Copyright 2015 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. + +#include "flutter/shell/platform/darwin/desktop/flutter_application.h" + +@implementation FlutterApplication +@end diff --git a/shell/platform/darwin/desktop/flutter_application_delegate.mm b/shell/platform/darwin/desktop/flutter_application_delegate.mm deleted file mode 100644 index 03076b848b25f..0000000000000 --- a/shell/platform/darwin/desktop/flutter_application_delegate.mm +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2017 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/shell/platform/darwin/desktop/flutter_application_delegate.h" -#include "flutter/shell/platform/darwin/desktop/flutter_window.h" - -#include - -@implementation FlutterApplicationDelegate - -- (void)applicationWillFinishLaunching:(NSNotification*)notification { - [self configureMainMenuBar]; - [self onNewFlutterWindow:self]; -} - -- (void)configureMainMenuBar { - NSMenu* mainMenu = [[[NSMenu alloc] initWithTitle:@"MainMenu"] autorelease]; - - NSMenuItem* engineItem = - [[[NSMenuItem alloc] initWithTitle:@"Engine" action:NULL keyEquivalent:@""] autorelease]; - - NSMenu* engineMenu = [[[NSMenu alloc] initWithTitle:@"EngineMenu"] autorelease]; - - NSMenuItem* newEngineItem = [[[NSMenuItem alloc] initWithTitle:@"New Engine" - action:@selector(onNewFlutterWindow:) - keyEquivalent:@""] autorelease]; - newEngineItem.keyEquivalent = @"n"; - newEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; - - NSMenuItem* shutdownEngineItem = - [[[NSMenuItem alloc] initWithTitle:@"Shutdown Engine" - action:@selector(onShutdownFlutterWindow:) - keyEquivalent:@""] autorelease]; - shutdownEngineItem.keyEquivalent = @"w"; - shutdownEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; - - NSMenuItem* quitItem = [[[NSMenuItem alloc] initWithTitle:@"Quit" - action:@selector(onQuitFlutterApplication:) - keyEquivalent:@""] autorelease]; - quitItem.keyEquivalent = @"q"; - quitItem.keyEquivalentModifierMask = NSCommandKeyMask; - - [mainMenu addItem:engineItem]; - [engineItem setSubmenu:engineMenu]; - [engineMenu addItem:newEngineItem]; - [engineMenu addItem:shutdownEngineItem]; - [engineMenu addItem:quitItem]; - - [NSApplication sharedApplication].mainMenu = mainMenu; -} - -- (void)onNewFlutterWindow:(id)sender { - FlutterWindow* window = [[FlutterWindow alloc] init]; - [window setReleasedWhenClosed:YES]; - - NSWindow* currentKeyWindow = [NSApplication sharedApplication].keyWindow; - - if (currentKeyWindow == nil) { - [window center]; - } else { - [window center]; - NSPoint currentWindowFrameOrigin = window.frame.origin; - currentWindowFrameOrigin.x = currentKeyWindow.frame.origin.x + 20; - currentWindowFrameOrigin.y = currentKeyWindow.frame.origin.y - 20; - [window setFrameOrigin:currentWindowFrameOrigin]; - } - - [window makeKeyAndOrderFront:sender]; -} - -- (void)onShutdownFlutterWindow:(id)sender { - [[NSApplication sharedApplication].keyWindow close]; -} - -- (void)onQuitFlutterApplication:(id)sender { - exit(0); -} - -@end diff --git a/shell/platform/darwin/desktop/flutter_mac.xib b/shell/platform/darwin/desktop/flutter_mac.xib new file mode 100644 index 0000000000000..c02ab7912da5a --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_mac.xib @@ -0,0 +1,695 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shell/platform/darwin/desktop/flutter_window.h b/shell/platform/darwin/desktop/flutter_window.h index e07fe4eeb7520..851535ba38e9e 100644 --- a/shell/platform/darwin/desktop/flutter_window.h +++ b/shell/platform/darwin/desktop/flutter_window.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ -#define SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ +#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ +#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ #import @@ -11,4 +11,4 @@ @end -#endif // SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ +#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__) */ diff --git a/shell/platform/darwin/desktop/flutter_window.mm b/shell/platform/darwin/desktop/flutter_window.mm index 4c87200fb3856..ca080e9275742 100644 --- a/shell/platform/darwin/desktop/flutter_window.mm +++ b/shell/platform/darwin/desktop/flutter_window.mm @@ -2,25 +2,16 @@ // 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 - #import "flutter_window.h" -#include - -#include "flutter/common/task_runners.h" -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/common/thread_host.h" +#include "flutter/common/threads.h" #include "flutter/shell/gpu/gpu_surface_gl.h" -#include "flutter/shell/platform/darwin/common/command_line.h" #include "flutter/shell/platform/darwin/desktop/platform_view_mac.h" -#include "lib/fxl/functional/make_copyable.h" -@interface FlutterWindow () +@interface FlutterWindow () -@property(strong) NSOpenGLView* renderSurface; +@property(assign) IBOutlet NSOpenGLView* renderSurface; +@property(getter=isSurfaceSetup) BOOL surfaceSetup; @end @@ -46,130 +37,34 @@ @interface FlutterWindow () } @implementation FlutterWindow { - shell::ThreadHost _thread_host; - std::unique_ptr _shell; + std::shared_ptr _platformView; bool _mouseIsDown; } -- (instancetype)init { - self = - [super initWithContentRect:NSMakeRect(10.0, 10.0, 800.0, 600.0) - styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask - backing:NSBackingStoreBuffered - defer:YES]; - if (self) { - self.delegate = self; - [self setupRenderSurface]; - [self setupShell]; - [self updateWindowSize]; - } - - return self; -} - -- (void)setupRenderSurface { - NSOpenGLView* renderSurface = [[[NSOpenGLView alloc] init] autorelease]; - const NSOpenGLPixelFormatAttribute attrs[] = { - NSOpenGLPFADoubleBuffer, // - NSOpenGLPFAAllowOfflineRenderers, // - 0 // - }; - renderSurface.pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease]; - renderSurface.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; - renderSurface.frame = - NSMakeRect(0.0, 0.0, self.contentView.bounds.size.width, self.contentView.bounds.size.height); - [self.contentView addSubview:renderSurface]; - self.renderSurface = renderSurface; -} - -static std::string CreateThreadLabel() { - std::stringstream stream; - static int index = 1; - stream << "io.flutter." << index++; - return stream.str(); -} - -- (void)setupShell { - FXL_DCHECK(!_shell) << "The shell must not already be set."; +@synthesize renderSurface = _renderSurface; +@synthesize surfaceSetup = _surfaceSetup; - auto thread_label = CreateThreadLabel(); +- (void)awakeFromNib { + [super awakeFromNib]; - // Create the threads on which to run the shell. - _thread_host = {thread_label, shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::UI | - shell::ThreadHost::Type::IO}; + self.delegate = self; - // Grab the task runners for the newly created threads. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - blink::TaskRunners task_runners(thread_label, // label - fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform - _thread_host.gpu_thread->GetTaskRunner(), // GPU - _thread_host.ui_thread->GetTaskRunner(), // UI - _thread_host.io_thread->GetTaskRunner() // IO - ); - - // Figure out the settings from the command line arguments. - auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); - - if (settings.icu_data_path.size() == 0) { - settings.icu_data_path = - [[NSBundle mainBundle] pathForResource:@"icudtl.dat" ofType:@""].UTF8String; - } - - settings.using_blink = false; - - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - - // Setup the callback that will be run on the appropriate threads. - shell::Shell::CreateCallback on_create_platform_view = - [render_surface = self.renderSurface](shell::Shell& shell) { - return std::make_unique(shell, render_surface); - }; - - shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - // Finally, create the shell. - _shell = shell::Shell::Create(std::move(task_runners), settings, on_create_platform_view, - on_create_rasterizer); - - // Launch the engine with the inferred run configuration. - _shell->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [engine = _shell->GetEngine(), - config = shell::RunConfiguration::InferFromSettings(_shell->GetSettings())]() mutable { - if (engine) { - auto result = engine->Run(std::move(config)); - if (!result) { - FXL_LOG(ERROR) << "Could not launch the engine with configuration."; - } - } - })); - - [self notifySurfaceCreated]; + [self updateWindowSize]; } -- (void)notifySurfaceCreated { - if (!_shell || !_shell->IsSetup()) { - return; - } +- (void)setupPlatformView { + FXL_DCHECK(_platformView == nullptr) << "The platform view must not already be set."; - // Tell the platform view that it has a GL surface. - _shell->GetPlatformView()->NotifyCreated(); + _platformView = std::make_shared(self.renderSurface); + _platformView->Attach(); + _platformView->SetupResourceContextOnIOThread(); + _platformView->NotifyCreated(std::make_unique(_platformView.get())); } -- (void)notifySurfaceDestroyed { - if (!_shell || !_shell->IsSetup()) { - return; - } - - // Tell the platform view that its surface is about to be lost. - _shell->GetPlatformView()->NotifyDestroyed(); +// TODO(eseidel): This does not belong in flutter_window! +// Probably belongs in NSApplicationDelegate didFinishLaunching. +- (void)setupAndLoadDart { + _platformView->SetupAndLoadDart(); } - (void)windowDidResize:(NSNotification*)notification { @@ -177,28 +72,34 @@ - (void)windowDidResize:(NSNotification*)notification { } - (void)updateWindowSize { - if (!_shell) { - return; - } + [self setupSurfaceIfNecessary]; blink::ViewportMetrics metrics; auto size = self.renderSurface.frame.size; metrics.physical_width = size.width; metrics.physical_height = size.height; - _shell->GetTaskRunners().GetUITaskRunner()->PostTask([engine = _shell->GetEngine(), metrics]() { - if (engine) { + + blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), metrics ] { + if (engine.get()) { engine->SetViewportMetrics(metrics); } }); } -#pragma mark - Responder overrides - -- (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { - if (!_shell) { +- (void)setupSurfaceIfNecessary { + if (self.isSurfaceSetup) { return; } + self.surfaceSetup = YES; + + [self setupPlatformView]; + [self setupAndLoadDart]; +} + +#pragma mark - Responder overrides + +- (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { NSPoint location = [_renderSurface convertPoint:event.locationInWindow fromView:nil]; location.y = _renderSurface.frame.size.height - location.y; @@ -233,14 +134,13 @@ - (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { break; } - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = _shell->GetEngine(), pointer_data] { - if (engine) { - blink::PointerDataPacket packet(1); - packet.SetPointerData(0, pointer_data); - engine->DispatchPointerDataPacket(packet); - } - }); + blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), pointer_data ] { + if (engine.get()) { + blink::PointerDataPacket packet(1); + packet.SetPointerData(0, pointer_data); + engine->DispatchPointerDataPacket(packet); + } + }); } - (void)mouseDown:(NSEvent*)event { @@ -255,18 +155,11 @@ - (void)mouseUp:(NSEvent*)event { [self dispatchEvent:event phase:NSEventPhaseEnded]; } -- (void)reset { - [self notifySurfaceDestroyed]; - _shell.reset(); - _thread_host.Reset(); -} - -- (void)windowWillClose:(NSNotification*)notification { - [self reset]; -} - - (void)dealloc { - [self reset]; + if (_platformView) { + _platformView->NotifyDestroyed(); + } + [super dealloc]; } diff --git a/shell/platform/darwin/desktop/main_mac.mm b/shell/platform/darwin/desktop/main_mac.mm index edd08d0c8b783..808a5f63f1d14 100644 --- a/shell/platform/darwin/desktop/main_mac.mm +++ b/shell/platform/darwin/desktop/main_mac.mm @@ -7,20 +7,91 @@ #include #include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/desktop/flutter_application_delegate.h" +#include "flutter/shell/platform/darwin/common/platform_mac.h" +#include "flutter/shell/platform/darwin/desktop/flutter_application.h" +#include "flutter/shell/testing/test_runner.h" +#include "flutter/shell/testing/testing.h" #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" +#include "lib/tonic/dart_microtask_queue.h" -int main(int argc, const char* argv[]) { +// Exit codes used by the Dart command line tool. +const int kApiErrorExitCode = 253; +const int kCompilationErrorExitCode = 254; +const int kErrorExitCode = 255; + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver : public fml::TaskObserver { + public: + ScriptCompletionTaskObserver(fxl::RefPtr task_runner) + : main_task_runner_(std::move(task_runner)), + prev_live_(false), + last_error_(tonic::kNoError) {} + + void DidProcessTask() override { + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + shell::Engine& engine = test_runner.platform_view().engine(); + + if (engine.GetLoadScriptError() != tonic::kNoError) { + last_error_ = engine.GetLoadScriptError(); + main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); + return; + } + + bool live = engine.UIIsolateHasLivePorts(); + if (prev_live_ && !live) { + last_error_ = engine.GetUIIsolateLastError(); + main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + prev_live_ = live; + } + + tonic::DartErrorHandleType last_error() { return last_error_; } + + private: + fxl::RefPtr main_task_runner_; + bool prev_live_; + tonic::DartErrorHandleType last_error_; +}; + +int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { + switch (error) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } +} + +static fxl::CommandLine InitializedCommandLine() { std::vector args_vector; for (NSString* arg in [NSProcessInfo processInfo].arguments) { args_vector.emplace_back(arg.UTF8String); } - auto command_line = fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); + return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); +} + +int main(int argc, const char* argv[]) { + [FlutterApplication sharedApplication]; + + // Can't use shell::Shell::Shared().GetCommandLine() because it is initialized only + // in shell::PlatformMacMain call below. + auto command_line = InitializedCommandLine(); + + std::string bundle_path = ""; + command_line.GetOptionValue(FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); + + shell::PlatformMacMain("", "", bundle_path); // Print help. if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { @@ -28,7 +99,36 @@ int main(int argc, const char* argv[]) { return EXIT_SUCCESS; } - [NSApplication sharedApplication].delegate = - [[[FlutterApplicationDelegate alloc] init] autorelease]; - return NSApplicationMain(argc, argv); + // Decide between interactive and non-interactive modes. + if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::NonInteractive))) { + if (!shell::InitForTesting(std::move(command_line))) + return 1; + + // Note that this task observer must be added after the observer that drains + // the microtask queue. + ScriptCompletionTaskObserver task_observer(fml::MessageLoop::GetCurrent().GetTaskRunner()); + blink::Threads::UI()->PostTask( + [&task_observer] { fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); }); + + fml::MessageLoop::GetCurrent().Run(); + + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + tonic::DartErrorHandleType error = test_runner.platform_view().engine().GetLoadScriptError(); + if (error == tonic::kNoError) + error = task_observer.last_error(); + if (error == tonic::kNoError) { + fxl::AutoResetWaitableEvent latch; + blink::Threads::UI()->PostTask([&error, &latch] { + error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); + latch.Signal(); + }); + latch.Wait(); + } + + // The script has completed and the engine may not be in a clean state, + // so just stop the process. + exit(ConvertErrorTypeToExitCode(error)); + } else { + return NSApplicationMain(argc, argv); + } } diff --git a/shell/platform/darwin/desktop/platform_view_mac.h b/shell/platform/darwin/desktop/platform_view_mac.h index d4b19b94d1d99..501400b6803d4 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.h +++ b/shell/platform/darwin/desktop/platform_view_mac.h @@ -7,7 +7,6 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "lib/fxl/memory/weak_ptr.h" @@ -16,13 +15,15 @@ namespace shell { -class PlatformViewMac final : public PlatformView, public GPUSurfaceGLDelegate { +class PlatformViewMac : public PlatformView, public GPUSurfaceGLDelegate { public: - PlatformViewMac(Shell& shell, NSOpenGLView* gl_view); + PlatformViewMac(NSOpenGLView* gl_view); ~PlatformViewMac() override; - std::unique_ptr CreateVSyncWaiter() override; + virtual void Attach() override; + + void SetupAndLoadDart(); bool GLContextMakeCurrent() override; @@ -32,17 +33,27 @@ class PlatformViewMac final : public PlatformView, public GPUSurfaceGLDelegate { intptr_t GLContextFBO() const override; + VsyncWaiter* GetVsyncWaiter() override; + + bool ResourceContextMakeCurrent() override; + + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + + void SetAssetBundlePath(const std::string& assets_directory) override; + private: fml::scoped_nsobject opengl_view_; fml::scoped_nsobject resource_loading_context_; bool IsValid() const; - // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; + void SetupAndLoadFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages); - // |shell::PlatformView| - sk_sp CreateResourceContext() const override; + void SetAssetBundlePathOnUI(const std::string& assets_directory); FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewMac); }; diff --git a/shell/platform/darwin/desktop/platform_view_mac.mm b/shell/platform/darwin/desktop/platform_view_mac.mm index f25fa6945af23..42948386fbcd4 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.mm +++ b/shell/platform/darwin/desktop/platform_view_mac.mm @@ -7,26 +7,77 @@ #include #include +#include "flutter/common/threads.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/common/io_manager.h" -#include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/switches.h" +#include "flutter/shell/gpu/gpu_rasterizer.h" +#include "flutter/shell/platform/darwin/common/platform_mac.h" +#include "flutter/shell/platform/darwin/common/process_info_mac.h" #include "flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h" #include "lib/fxl/command_line.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewMac::PlatformViewMac(Shell& shell, NSOpenGLView* gl_view) - : PlatformView(shell, shell.GetTaskRunners()), +PlatformViewMac::PlatformViewMac(NSOpenGLView* gl_view) + : PlatformView(std::make_unique(std::make_unique())), opengl_view_([gl_view retain]), resource_loading_context_([[NSOpenGLContext alloc] initWithFormat:gl_view.pixelFormat shareContext:gl_view.openGLContext]) {} PlatformViewMac::~PlatformViewMac() = default; -std::unique_ptr PlatformViewMac::CreateVSyncWaiter() { - return std::make_unique(task_runners_); +void PlatformViewMac::Attach() { + CreateEngine(); +} + +void PlatformViewMac::SetupAndLoadDart() { + if (AttemptLaunchFromCommandLineSwitches(&engine())) { + // This attempts launching from a Flutter assets directory that does not + // contain a dart snapshot. + return; + } + + const auto& command_line = shell::Shell::Shared().GetCommandLine(); + + std::string bundle_path = + command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::FlutterAssetsDir), ""); + if (!bundle_path.empty()) { + blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), bundle_path ] { + if (engine) + engine->RunBundle(bundle_path); + }); + return; + } + + auto args = command_line.positional_args(); + if (args.size() > 0) { + std::string main = args[0]; + std::string packages = + command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::Packages), ""); + blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), main, packages ] { + if (engine) + engine->RunBundleAndSource(std::string(), main, packages); + }); + return; + } +} + +void PlatformViewMac::SetupAndLoadFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + blink::Threads::UI()->PostTask( + [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { + if (engine) + engine->RunBundleAndSource(assets_directory, main, packages); + }); +} + +void PlatformViewMac::SetAssetBundlePathOnUI(const std::string& assets_directory) { + blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { + if (engine) + engine->SetAssetBundlePath(assets_directory); + }); } intptr_t PlatformViewMac::GLContextFBO() const { @@ -64,9 +115,21 @@ return true; } -sk_sp PlatformViewMac::CreateResourceContext() const { - [resource_loading_context_.get() makeCurrentContext]; - return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); +VsyncWaiter* PlatformViewMac::GetVsyncWaiter() { + if (!vsync_waiter_) + vsync_waiter_ = std::make_unique(); + return vsync_waiter_.get(); +} + +bool PlatformViewMac::ResourceContextMakeCurrent() { + NSOpenGLContext* context = resource_loading_context_.get(); + + if (context == nullptr) { + return false; + } + + [context makeCurrentContext]; + return true; } bool PlatformViewMac::IsValid() const { @@ -83,8 +146,30 @@ return true; } -std::unique_ptr PlatformViewMac::CreateRenderingSurface() { - return std::make_unique(this); +void PlatformViewMac::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + auto latch = new fxl::ManualResetWaitableEvent(); + + dispatch_async(dispatch_get_main_queue(), ^{ + SetupAndLoadFromSource(assets_directory, main, packages); + latch->Signal(); + }); + + latch->Wait(); + delete latch; +} + +void PlatformViewMac::SetAssetBundlePath(const std::string& assets_directory) { + auto latch = new fxl::ManualResetWaitableEvent(); + + dispatch_async(dispatch_get_main_queue(), ^{ + SetAssetBundlePathOnUI(assets_directory); + latch->Signal(); + }); + + latch->Wait(); + delete latch; } } // namespace shell diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.cc b/shell/platform/darwin/desktop/vsync_waiter_mac.cc index 0ccadaf42754d..a28ff62edb918 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.cc +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.cc @@ -6,14 +6,14 @@ #include +#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { #define link_ (reinterpret_cast(opaque_)) -VsyncWaiterMac::VsyncWaiterMac(blink::TaskRunners task_runners) - : VsyncWaiter(std::move(task_runners)), opaque_(nullptr) { +VsyncWaiterMac::VsyncWaiterMac() : opaque_(nullptr) { // Create the link. CVDisplayLinkRef link = nullptr; CVDisplayLinkCreateWithActiveCGDisplays(&link); @@ -48,10 +48,18 @@ void VsyncWaiterMac::OnDisplayLink() { CVDisplayLinkStop(link_); - FireCallback(frame_start_time, frame_target_time); + auto callback = std::move(callback_); + callback_ = Callback(); + + blink::Threads::UI()->PostTask( + [callback, frame_start_time, frame_target_time] { + callback(frame_start_time, frame_target_time); + }); } -void VsyncWaiterMac::AwaitVSync() { +void VsyncWaiterMac::AsyncWaitForVsync(Callback callback) { + FXL_DCHECK(!callback_); + callback_ = std::move(callback); CVDisplayLinkStart(link_); } diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.h b/shell/platform/darwin/desktop/vsync_waiter_mac.h index 0ad929a509ea3..15f551f212901 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.h +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.h @@ -10,19 +10,19 @@ namespace shell { -class VsyncWaiterMac final : public VsyncWaiter { +class VsyncWaiterMac : public VsyncWaiter { public: - VsyncWaiterMac(blink::TaskRunners task_runners); + VsyncWaiterMac(); ~VsyncWaiterMac() override; + void AsyncWaitForVsync(Callback callback) override; + private: void* opaque_; - - void AwaitVSync() override; + Callback callback_; static void OnDisplayLink(void* context); - void OnDisplayLink(); FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterMac); diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 8946ee954c23a..310af79c2ed8e 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -40,6 +40,8 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterDartProject.mm", "framework/Source/FlutterDartProject_Internal.h", "framework/Source/FlutterHeadlessDartRunner.mm", + "framework/Source/FlutterDartSource.h", + "framework/Source/FlutterDartSource.mm", "framework/Source/FlutterNavigationController.mm", "framework/Source/FlutterPlatformPlugin.h", "framework/Source/FlutterPlatformPlugin.mm", @@ -51,15 +53,14 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterView.h", "framework/Source/FlutterView.mm", "framework/Source/FlutterViewController.mm", - "framework/Source/FlutterViewController_Internal.h", "framework/Source/accessibility_bridge.h", "framework/Source/accessibility_bridge.mm", "framework/Source/accessibility_text_entry.h", "framework/Source/accessibility_text_entry.mm", + "framework/Source/flutter_main_ios.h", + "framework/Source/flutter_main_ios.mm", "framework/Source/flutter_touch_mapper.h", "framework/Source/flutter_touch_mapper.mm", - "framework/Source/platform_message_response_darwin.h", - "framework/Source/platform_message_response_darwin.mm", "framework/Source/platform_message_router.h", "framework/Source/platform_message_router.mm", "framework/Source/vsync_waiter_ios.h", @@ -85,7 +86,6 @@ shared_library("create_flutter_framework_dylib") { "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/ui", - "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", @@ -95,10 +95,7 @@ shared_library("create_flutter_framework_dylib") { "//third_party/skia", ] if (flutter_runtime_mode == "debug") { - deps += [ - "$flutter_root/lib/snapshot", - "//third_party/dart/runtime:libdart_jit", - ] + deps += [ "//third_party/dart/runtime:libdart_jit" ] } else { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index 3c613c9fbad8f..d5f30d02664d9 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -2,121 +2,42 @@ // 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/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" -#include "flutter/common/task_runners.h" -#include "flutter/fml/message_loop.h" -#include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/runtime/dart_vm.h" +#include "flutter/common/threads.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/common/command_line.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" - -static const char* kScriptSnapshotFileName = "snapshot_blob.bin"; -static const char* kVMKernelSnapshotFileName = "platform.dill"; -static const char* kApplicationKernelSnapshotFileName = "kernel_blob.bin"; - -static blink::Settings DefaultSettingsForProcess() { - auto command_line = shell::CommandLineFromNSProcessInfo(); - - // Settings passed in explicitly via command line arguments take priority. - auto settings = shell::SettingsFromCommandLine(command_line); - - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - - // The command line arguments may not always be complete. If they aren't, attempt to fill in - // defaults. - - // Flutter ships the ICU data file in the the bundle of the engine. Look for it there. - if (settings.icu_data_path.size() == 0) { - NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; - NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; - if (icuDataPath.length > 0) { - settings.icu_data_path = icuDataPath.UTF8String; - } +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" +#include "lib/fxl/strings/string_view.h" +#include "third_party/dart/runtime/include/dart_api.h" + +static NSURL* URLForSwitch(const fxl::StringView name) { + const auto& cmd = shell::Shell::Shared().GetCommandLine(); + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; + + std::string switch_value; + if (cmd.GetOptionValue(name, &switch_value)) { + auto url = [NSURL fileURLWithPath:@(switch_value.c_str())]; + [defaults setURL:url forKey:@(name.data())]; + [defaults synchronize]; + return url; } - if (blink::DartVM::IsRunningPrecompiledCode()) { - // The application bundle could be specified in the Info.plist. - if (settings.application_library_path.size() == 0) { - NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; - NSString* libraryPath = [[NSBundle mainBundle] pathForResource:libraryName ofType:nil]; - if (libraryPath.length > 0) { - settings.application_library_path = - [NSBundle bundleWithPath:libraryPath].executablePath.UTF8String; - } - } - - // In case the application bundle is still not specified, look for the App.framework in the - // Frameworks directory. - if (settings.application_library_path.size() == 0) { - NSString* applicationFrameworkPath = - [[NSBundle mainBundle] pathForResource:@"Frameworks/App.framework" ofType:@""]; - if (applicationFrameworkPath.length > 0) { - settings.application_library_path = - [NSBundle bundleWithPath:applicationFrameworkPath].executablePath.UTF8String; - } - } - } + return [defaults URLForKey:@(name.data())]; +} - // Checks to see if the flutter assets directory is already present. - if (settings.assets_path.size() == 0) { - NSString* assetsPath = [[NSBundle mainBundle] pathForResource:@"flutter_assets" ofType:@""]; - - if (assetsPath.length > 0) { - settings.assets_path = assetsPath.UTF8String; - - if (!blink::DartVM::IsRunningPrecompiledCode()) { - // Looking for the various script and kernel snapshot buffers only makes sense if we have a - // VM that can use these buffers. - { - // Check if there is a script snapshot in the assets directory we could potentially use. - NSURL* scriptSnapshotURL = [NSURL URLWithString:@(kScriptSnapshotFileName) - relativeToURL:[NSURL fileURLWithPath:assetsPath]]; - if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotURL.path]) { - settings.script_snapshot_path = scriptSnapshotURL.path.UTF8String; - } - } - - { - // Check if there is a VM kernel snapshot in the assets directory we could potentially - // use. - NSURL* vmKernelSnapshotURL = [NSURL URLWithString:@(kVMKernelSnapshotFileName) - relativeToURL:[NSURL fileURLWithPath:assetsPath]]; - if ([[NSFileManager defaultManager] fileExistsAtPath:vmKernelSnapshotURL.path]) { - settings.kernel_snapshot_path = vmKernelSnapshotURL.path.UTF8String; - } - } - - { - // Check if there is an application kernel snapshot in the assets directory we could - // potentially use. - NSURL* applicationKernelSnapshotURL = - [NSURL URLWithString:@(kApplicationKernelSnapshotFileName) - relativeToURL:[NSURL fileURLWithPath:assetsPath]]; - if ([[NSFileManager defaultManager] fileExistsAtPath:applicationKernelSnapshotURL.path]) { - settings.application_kernel_asset = applicationKernelSnapshotURL.path.UTF8String; - } - } - } - } - } +@implementation FlutterDartProject { + NSBundle* _precompiledDartBundle; + FlutterDartSource* _dartSource; - return settings; + VMType _vmTypeRequirement; } -@implementation FlutterDartProject { - fml::scoped_nsobject _precompiledDartBundle; - blink::Settings _settings; ++ (void)initialize { + if (self == [FlutterDartProject class]) { + shell::FlutterMain(); + } } #pragma mark - Override base class designated initializers @@ -131,16 +52,9 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle { self = [super init]; if (self) { - _precompiledDartBundle.reset([bundle retain]); + _precompiledDartBundle = [bundle retain]; - _settings = DefaultSettingsForProcess(); - - if (bundle != nil) { - NSString* executablePath = _precompiledDartBundle.get().executablePath; - if ([[NSFileManager defaultManager] fileExistsAtPath:executablePath]) { - _settings.application_library_path = executablePath.UTF8String; - } - } + [self checkReadiness]; } return self; @@ -152,15 +66,11 @@ - (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _settings = DefaultSettingsForProcess(); + _dartSource = [[FlutterDartSource alloc] initWithDartMain:dartMainURL + packages:dartPackages + flutterAssets:flutterAssetsURL]; - if ([[NSFileManager defaultManager] fileExistsAtPath:dartMainURL.path]) { - _settings.main_dart_file_path = dartMainURL.path.UTF8String; - } - - if ([[NSFileManager defaultManager] fileExistsAtPath:dartPackages.path]) { - _settings.packages_file_path = dartPackages.path.UTF8String; - } + [self checkReadiness]; } return self; @@ -170,17 +80,10 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _settings = DefaultSettingsForProcess(); + _dartSource = + [[FlutterDartSource alloc] initWithFlutterAssetsWithScriptSnapshot:flutterAssetsURL]; - if ([[NSFileManager defaultManager] fileExistsAtPath:flutterAssetsURL.path]) { - _settings.assets_path = flutterAssetsURL.path.UTF8String; - - NSURL* scriptSnapshotPath = - [NSURL URLWithString:@(kScriptSnapshotFileName) relativeToURL:flutterAssetsURL]; - if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotPath.path]) { - _settings.script_snapshot_path = scriptSnapshotPath.path.UTF8String; - } - } + [self checkReadiness]; } return self; @@ -189,19 +92,56 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL #pragma mark - Convenience initializers - (instancetype)initFromDefaultSourceForConfiguration { - if (blink::DartVM::IsRunningPrecompiledCode()) { - return [self initWithPrecompiledDartBundle:nil]; + NSBundle* bundle = [NSBundle mainBundle]; + + if (Dart_IsPrecompiledRuntime()) { + // Load from an AOTC snapshot. + return [self initWithPrecompiledDartBundle:bundle]; } else { - return [self initWithFlutterAssets:nil dartMain:nil packages:nil]; + // Load directly from sources if the appropriate command line flags are + // specified. If not, try loading from a script snapshot in the framework + // bundle. + NSURL* flutterAssetsURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::FlutterAssetsDir)); + + if (flutterAssetsURL == nil) { + // If the URL was not specified on the command line, look inside the + // FlutterApplication bundle. + NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:bundle]; + if (flutterAssetsPath != nil) { + flutterAssetsURL = [NSURL fileURLWithPath:flutterAssetsPath isDirectory:NO]; + } + } + + if (flutterAssetsURL == nil) { + NSLog(@"Error: flutterAssets directory not present in bundle; unable to start app."); + [self release]; + return nil; + } + + NSURL* dartMainURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::MainDartFile)); + NSURL* dartPackagesURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::Packages)); + + return + [self initWithFlutterAssets:flutterAssetsURL dartMain:dartMainURL packages:dartPackagesURL]; } -} -- (const blink::Settings&)settings { - return _settings; + NSAssert(NO, @"Unreachable"); + [self release]; + return nil; } -- (shell::RunConfiguration)runConfiguration { - return shell::RunConfiguration::InferFromSettings(_settings); +#pragma mark - Common initialization tasks + +- (void)checkReadiness { + if (_precompiledDartBundle != nil) { + _vmTypeRequirement = VMTypePrecompilation; + return; + } + + if (_dartSource != nil) { + _vmTypeRequirement = VMTypeInterpreter; + return; + } } #pragma mark - Assets-related utilities @@ -221,7 +161,7 @@ + (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle { } + (NSString*)lookupKeyForAsset:(NSString*)asset { - NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName:[NSBundle mainBundle]]; + NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName: [NSBundle mainBundle]]; return [NSString stringWithFormat:@"%@/%@", flutterAssetsName, asset]; } @@ -229,4 +169,179 @@ + (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { return [self lookupKeyForAsset:[NSString stringWithFormat:@"packages/%@/%@", package, asset]]; } +#pragma mark - Launching the project in a preconfigured engine. + +static NSString* NSStringFromVMType(VMType type) { + switch (type) { + case VMTypeInvalid: + return @"Invalid"; + case VMTypeInterpreter: + return @"Interpreter"; + case VMTypePrecompilation: + return @"Precompilation"; + } + + return @"Unknown"; +} + +- (void)launchInEngine:(shell::Engine*)engine + withEntrypoint:(NSString*)entrypoint + embedderVMType:(VMType)embedderVMType + result:(LaunchResult)result { + if (_vmTypeRequirement == VMTypeInvalid) { + result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); + return; + } + + if (embedderVMType == VMTypeInvalid) { + result(NO, @"The embedder is invalid."); + return; + } + + if (_vmTypeRequirement != embedderVMType) { + NSString* message = + [NSString stringWithFormat: + @"Could not load the project because of differing project type. " + @"The project can run in '%@' but the embedder is configured as " + @"'%@'", + NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; + result(NO, message); + return; + } + + switch (_vmTypeRequirement) { + case VMTypeInterpreter: + [self runFromSourceInEngine:engine withEntrypoint:entrypoint result:result]; + return; + case VMTypePrecompilation: + [self runFromPrecompiledSourceInEngine:engine withEntrypoint:entrypoint result:result]; + return; + case VMTypeInvalid: + break; + } + + return result(NO, @"Internal error"); +} + +- (void)launchInEngine:(shell::Engine*)engine + embedderVMType:(VMType)embedderVMType + result:(LaunchResult)result { + if (_vmTypeRequirement == VMTypeInvalid) { + result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); + return; + } + + if (embedderVMType == VMTypeInvalid) { + result(NO, @"The embedder is invalid."); + return; + } + + if (_vmTypeRequirement != embedderVMType) { + NSString* message = + [NSString stringWithFormat: + @"Could not load the project because of differing project type. " + @"The project can run in '%@' but the embedder is configured as " + @"'%@'", + NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; + result(NO, message); + return; + } + + switch (_vmTypeRequirement) { + case VMTypeInterpreter: + [self runFromSourceInEngine:engine withEntrypoint:@"main" result:result]; + return; + case VMTypePrecompilation: + [self runFromPrecompiledSourceInEngine:engine withEntrypoint:@"main" result:result]; + return; + case VMTypeInvalid: + break; + } + + return result(NO, @"Internal error"); +} + +#pragma mark - Running from precompiled application bundles + +- (void)runFromPrecompiledSourceInEngine:(shell::Engine*)engine + withEntrypoint:(NSString*)entrypoint + result:(LaunchResult)result { + if (![_precompiledDartBundle load]) { + NSString* message = [NSString + stringWithFormat:@"Could not load the framework ('%@') containing precompiled code.", + _precompiledDartBundle.bundleIdentifier]; + result(NO, message); + return; + } + + NSString* path = [FlutterDartProject pathForFlutterAssetsFromBundle:_precompiledDartBundle]; + if (path.length == 0) { + NSString* message = [NSString stringWithFormat: + @"Could not find the 'flutter_assets' dir in " + @"the precompiled Dart bundle with ID '%@'", + _precompiledDartBundle.bundleIdentifier]; + result(NO, message); + return; + } + + std::string bundle_path = path.UTF8String; + blink::Threads::UI()->PostTask([ + engine = engine->GetWeakPtr(), bundle_path, entrypoint = std::string([entrypoint UTF8String]) + ] { + if (engine) + engine->RunBundle(bundle_path, entrypoint); + }); + + result(YES, @"Success"); +} + +#pragma mark - Running from source + +- (void)runFromSourceInEngine:(shell::Engine*)engine + withEntrypoint:(NSString*)entrypoint + result:(LaunchResult)result { + if (_dartSource == nil) { + result(NO, @"Dart source not specified."); + return; + } + + [_dartSource validate:^(BOOL success, NSString* message) { + if (!success) { + return result(NO, message); + } + + std::string bundle_path = _dartSource.flutterAssets.absoluteURL.path.UTF8String; + + if (_dartSource.assetsDirContainsScriptSnapshot) { + blink::Threads::UI()->PostTask([ + engine = engine->GetWeakPtr(), bundle_path, + entrypoint = std::string([entrypoint UTF8String]) + ] { + if (engine) + engine->RunBundle(bundle_path, entrypoint); + }); + } else { + std::string main = _dartSource.dartMain.absoluteURL.path.UTF8String; + std::string packages = _dartSource.packages.absoluteURL.path.UTF8String; + blink::Threads::UI()->PostTask( + [ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { + if (engine) + engine->RunBundleAndSource(bundle_path, main, packages); + }); + } + + result(YES, @"Success"); + }]; +} + +#pragma mark - Misc. + +- (void)dealloc { + [_precompiledDartBundle unload]; + [_precompiledDartBundle release]; + [_dartSource release]; + + [super dealloc]; +} + @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h index 7fe1fc364f328..75db7c4049dd9 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h @@ -5,15 +5,32 @@ #ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ -#include "flutter/common/settings.h" #include "flutter/shell/common/engine.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h" +enum VMType { + // An invalid VM configuration. + VMTypeInvalid = 0, + // VM can execute Dart code as an interpreter. + VMTypeInterpreter, + // VM can execute precompiled Dart code. + VMTypePrecompilation, +}; + +typedef void (^LaunchResult)(BOOL success, NSString* message); + @interface FlutterDartProject () -- (const blink::Settings&)settings; +- (void)launchInEngine:(shell::Engine*)engine + embedderVMType:(VMType)type + result:(LaunchResult)result; + +- (void)launchInEngine:(shell::Engine*)engine + withEntrypoint:(NSString*)entrypoint + embedderVMType:(VMType)type + result:(LaunchResult)result; -- (shell::RunConfiguration)runConfiguration; ++ (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle; @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h new file mode 100644 index 0000000000000..c3881ce065185 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h @@ -0,0 +1,30 @@ +// Copyright 2016 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. + +#ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ +#define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ + +#import + +typedef void (^ValidationResult)(BOOL result, NSString* message); + +@interface FlutterDartSource : NSObject + +@property(nonatomic, readonly) NSURL* dartMain; +@property(nonatomic, readonly) NSURL* packages; +@property(nonatomic, readonly) NSURL* flutterAssets; +@property(nonatomic, readonly) BOOL assetsDirContainsScriptSnapshot; + +- (instancetype)initWithDartMain:(NSURL*)dartMain + packages:(NSURL*)packages + flutterAssets:(NSURL*)flutterAssets NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets + NS_DESIGNATED_INITIALIZER; + +- (void)validate:(ValidationResult)result; + +@end + +#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm new file mode 100644 index 0000000000000..aecb4e5806b3a --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm @@ -0,0 +1,100 @@ +// Copyright 2016 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. + +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" + +@implementation FlutterDartSource + +@synthesize dartMain = _dartMain; +@synthesize packages = _packages; +@synthesize flutterAssets = _flutterAssets; +@synthesize assetsDirContainsScriptSnapshot = _assetsDirContainsScriptSnapshot; + +#pragma mark - Convenience Initializers + +- (instancetype)init { + return [self initWithDartMain:nil packages:nil flutterAssets:nil]; +} + +#pragma mark - Designated Initializers + +- (instancetype)initWithDartMain:(NSURL*)dartMain + packages:(NSURL*)packages + flutterAssets:(NSURL*)flutterAssets { + self = [super init]; + + if (self) { + _dartMain = [dartMain copy]; + _packages = [packages copy]; + _flutterAssets = [flutterAssets copy]; + + NSFileManager* fileManager = [NSFileManager defaultManager]; + + const BOOL dartMainExists = [fileManager fileExistsAtPath:dartMain.absoluteURL.path]; + const BOOL packagesExists = [fileManager fileExistsAtPath:packages.absoluteURL.path]; + + if (!dartMainExists || !packagesExists) { + // We cannot actually verify this without opening up the directory. This is + // just an assumption. + _assetsDirContainsScriptSnapshot = YES; + } + } + + return self; +} + +- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets { + self = [super init]; + + if (self) { + _flutterAssets = [flutterAssets copy]; + _assetsDirContainsScriptSnapshot = YES; + } + + return self; +} + +static BOOL CheckDartProjectURL(NSMutableString* log, NSURL* url, NSString* logLabel) { + if (url == nil) { + [log appendFormat:@"The %@ was not specified.\n", logLabel]; + return false; + } + + if (!url.isFileURL) { + [log appendFormat:@"The %@ must be a file URL.\n", logLabel]; + return false; + } + + if (![[NSFileManager defaultManager] fileExistsAtPath:url.absoluteURL.path]) { + [log appendFormat:@"No file found at '%@' when looking for the %@.\n", url, logLabel]; + return false; + } + + return true; +} + +- (void)validate:(ValidationResult)result { + NSMutableString* log = [[[NSMutableString alloc] init] autorelease]; + + BOOL isValid = YES; + + isValid &= CheckDartProjectURL(log, _flutterAssets, @"Flutter assets"); + + if (!_assetsDirContainsScriptSnapshot) { + isValid &= CheckDartProjectURL(log, _dartMain, @"Dart main"); + isValid &= CheckDartProjectURL(log, _packages, @"Dart packages"); + } + + result(isValid, log); +} + +- (void)dealloc { + [_dartMain release]; + [_packages release]; + [_flutterAssets release]; + + [super dealloc]; +} + +@end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm index dee11d08934a5..2143f362f7905 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm @@ -2,84 +2,38 @@ // 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 - #import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h" -#include #include -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/engine.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/run_configuration.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/common/thread_host.h" -#include "flutter/shell/platform/darwin/common/command_line.h" -#include "lib/fxl/functional/make_copyable.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" +#include "flutter/shell/common/null_platform_view.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" -static std::unique_ptr CreateHeadlessPlatformView(shell::Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); -} +@interface FlutterHeadlessDartRunner () +@end -static std::unique_ptr CreateHeadlessRasterizer(shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); +@implementation FlutterHeadlessDartRunner { + fml::scoped_nsprotocol _dartProject; + std::shared_ptr _platformView; } -@implementation FlutterHeadlessDartRunner { - shell::ThreadHost _threadHost; - std::unique_ptr _shell; +- (instancetype)init { + _dartProject.reset([[FlutterDartProject alloc] initFromDefaultSourceForConfiguration]); + _platformView = std::make_shared(); + _platformView->Attach(); + return self; } - (void)runWithEntrypoint:(NSString*)entrypoint { - if (_shell != nullptr || entrypoint.length == 0) { - FXL_LOG(ERROR) << "This headless dart runner was already used to run some code."; - return; - } - - const auto label = "io.flutter.headless"; - - // Create the threads to run the shell on. - _threadHost = { - label, // native thread label - shell::ThreadHost::Type::UI // managed threads to create - }; - - // Configure shell task runners. - auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); - auto single_task_runner = _threadHost.ui_thread->GetTaskRunner(); - blink::TaskRunners task_runners(label, // dart thread label - current_task_runner, // platform - single_task_runner, // gpu - single_task_runner, // ui - single_task_runner // io - ); - - auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); - - // Create the shell. This is a blocking operation. - _shell = shell::Shell::Create( - std::move(task_runners), // task runners - std::move(settings), // settings - std::bind(&CreateHeadlessPlatformView, std::placeholders::_1), // platform view creation - std::bind(&CreateHeadlessRasterizer, std::placeholders::_1) // rasterzier creation - ); - - if (_shell == nullptr) { - FXL_LOG(ERROR) << "Could not start a shell for the headless dart runner with entrypoint: " - << entrypoint.UTF8String; - return; - } - - // Override the default run configuration with the specified entrypoint. - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = _shell->GetEngine(), - config = shell::RunConfiguration::InferFromSettings(settings)]() mutable { - if (!engine || !engine->Run(std::move(config))) { - FXL_LOG(ERROR) << "Could not launch engine with configuration."; - } - })); + const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; + [_dartProject launchInEngine:&_platformView->engine() + withEntrypoint:entrypoint + embedderVMType:type + result:^(BOOL success, NSString* message) { + if (!success) + NSLog(@"%@", message); + }]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.h b/shell/platform/darwin/ios/framework/Source/FlutterView.h index 5e3d303401725..661940620c947 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.h @@ -7,14 +7,8 @@ #include -#include - -#include "flutter/shell/platform/darwin/ios/ios_surface.h" - @interface FlutterView : UIView -- (std::unique_ptr)createSurface; - @end #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 27e3d48c4cb50..7c382838c6f5c 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -5,41 +5,20 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/flow/layers/layer_tree.h" -#include "flutter/fml/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" -#include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" -#include "flutter/shell/platform/darwin/ios/ios_surface_software.h" #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" -@interface FlutterView () +@interface FlutterView () @end @implementation FlutterView -- (FlutterViewController*)flutterViewController { - // Find the first view controller in the responder chain and see if it is a FlutterViewController. - for (UIResponder* responder = self.nextResponder; responder != nil; - responder = responder.nextResponder) { - if ([responder isKindOfClass:[UIViewController class]]) { - if ([responder isKindOfClass:[FlutterViewController class]]) { - return reinterpret_cast(responder); - } else { - // Should only happen if a non-FlutterViewController tries to somehow (via dynamic class - // resolution or reparenting) set a FlutterView as its view. - return nil; - } - } - } - return nil; -} - - (void)layoutSubviews { if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { CAEAGLLayer* layer = reinterpret_cast(self.layer); @@ -61,24 +40,13 @@ + (Class)layerClass { #endif // TARGET_IPHONE_SIMULATOR } -- (std::unique_ptr)createSurface { - if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { - fml::scoped_nsobject eagl_layer( - reinterpret_cast([self.layer retain])); - return std::make_unique(std::move(eagl_layer)); - } else { - fml::scoped_nsobject layer(reinterpret_cast([self.layer retain])); - return std::make_unique(std::move(layer)); - } -} - - (BOOL)enableInputClicksWhenVisible { return YES; } -static void SnapshotRasterizer(fml::WeakPtr rasterizer, - CGContextRef context, - bool is_opaque) { +void SnapshotRasterizer(fml::WeakPtr rasterizer, + CGContextRef context, + bool is_opaque) { if (!rasterizer) { return; } @@ -109,11 +77,10 @@ static void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCanvas canvas(bitmap); - flow::CompositorContext compositor_context; - - if (auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */)) { - layer_tree->Preroll(*frame, true /* ignore raster cache */); - layer_tree->Paint(*frame); + { + flow::CompositorContext compositor_context(nullptr); + auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */); + layer_tree->Raster(frame, false /* ignore raster cache. */); } canvas.flush(); @@ -122,6 +89,41 @@ static void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCGDrawBitmap(context, bitmap, 0, 0); } +static fml::WeakPtr GetRandomRasterizer() { + fml::WeakPtr rasterizer; + shell::Shell::Shared().IteratePlatformViews([&rasterizer](shell::PlatformView* view) -> bool { + rasterizer = view->rasterizer().GetWeakRasterizerPtr(); + // We just grab the first rasterizer so there is no need to iterate + // further. + return false; + }); + return rasterizer; +} + +void SnapshotContents(CGContextRef context, bool is_opaque) { + // TODO(chinmaygarde): Currently, there is no way to get the rasterizer for + // a particular platform view from the shell. But, for now, we only have one + // platform view. So use that. Once we support multiple platform views, the + // shell will need to provide a way to get the rasterizer for a specific + // platform view. + SnapshotRasterizer(GetRandomRasterizer(), context, is_opaque); +} + +void SnapshotContentsSync(CGContextRef context, UIView* view) { + auto gpu_thread = blink::Threads::Gpu(); + + if (!gpu_thread) { + return; + } + + fxl::AutoResetWaitableEvent latch; + gpu_thread->PostTask([&latch, context, view]() { + SnapshotContents(context, [view isOpaque]); + latch.Signal(); + }); + latch.Wait(); +} + // Override the default CALayerDelegate method so that APIs that attempt to // screenshot the view display contents correctly. We cannot depend on // reading @@ -130,22 +132,7 @@ static void SnapshotRasterizer(fml::WeakPtr rasterizer, // 2: The call is made of the platform thread and not the GPU thread. // 3: There may be a software rasterizer. - (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { - TRACE_EVENT0("flutter", "SnapshotFlutterView"); - FlutterViewController* controller = [self flutterViewController]; - - if (controller == nil) { - return; - } - - auto& shell = [controller shell]; - - fxl::AutoResetWaitableEvent latch; - shell.GetTaskRunners().GetGPUTaskRunner()->PostTask( - [&latch, rasterizer = shell.GetRasterizer(), context, opaque = layer.opaque]() { - SnapshotRasterizer(std::move(rasterizer), context, opaque); - latch.Signal(); - }); - latch.Wait(); + SnapshotContentsSync(context, self); } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 17e9a4eff48f6..a467a5a8cf1a5 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -2,54 +2,90 @@ // 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 - -#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" +#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" #include -#include "flutter/fml/message_loop.h" +#include "flutter/common/threads.h" +#include "flutter/flow/texture.h" #include "flutter/fml/platform/darwin/platform_version.h" +#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/thread_host.h" +#include "flutter/lib/ui/painting/resource_context.h" +#include "flutter/shell/platform/darwin/common/buffer_conversions.h" +#include "flutter/shell/platform/darwin/common/platform_mac.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterCodecs.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" #include "flutter/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" +#include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" #include "flutter/shell/platform/darwin/ios/platform_view_ios.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/time/time_delta.h" + +namespace { + +typedef void (^PlatformMessageResponseCallback)(NSData*); + +class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); + + public: + void Complete(std::vector data) override { + fxl::RefPtr self(this); + blink::Threads::Platform()->PostTask( + fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { + self->callback_.get()(shell::GetNSDataFromVector(data)); + })); + } + + void CompleteEmpty() override { + fxl::RefPtr self(this); + blink::Threads::Platform()->PostTask( + fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); + } + + private: + explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback) + : callback_(callback, fml::OwnershipPolicy::Retain) {} -@interface FlutterViewController () + fml::ScopedBlock callback_; +}; + +} // namespace + +@interface FlutterViewController () @end @implementation FlutterViewController { - fml::scoped_nsobject _dartProject; - shell::ThreadHost _threadHost; - std::unique_ptr _shell; - - // Channels - fml::scoped_nsobject _platformPlugin; - fml::scoped_nsobject _textInputPlugin; - fml::scoped_nsobject _localizationChannel; - fml::scoped_nsobject _navigationChannel; - fml::scoped_nsobject _platformChannel; - fml::scoped_nsobject _textInputChannel; - fml::scoped_nsobject _lifecycleChannel; - fml::scoped_nsobject _systemChannel; - fml::scoped_nsobject _settingsChannel; - - // We keep a separate reference to this and create it ahead of time because we want to be able to - // setup a shell along with its platform view before the view has to appear. - fml::scoped_nsobject _flutterView; - fml::scoped_nsobject _launchView; + fml::scoped_nsprotocol _dartProject; UIInterfaceOrientationMask _orientationPreferences; UIStatusBarStyle _statusBarStyle; blink::ViewportMetrics _viewportMetrics; shell::TouchMapper _touchMapper; + std::shared_ptr _platformView; + fml::scoped_nsprotocol _platformPlugin; + fml::scoped_nsprotocol _textInputPlugin; + fml::scoped_nsprotocol _localizationChannel; + fml::scoped_nsprotocol _navigationChannel; + fml::scoped_nsprotocol _platformChannel; + fml::scoped_nsprotocol _textInputChannel; + fml::scoped_nsprotocol _lifecycleChannel; + fml::scoped_nsprotocol _systemChannel; + fml::scoped_nsprotocol _settingsChannel; + fml::scoped_nsprotocol _launchView; int64_t _nextTextureId; BOOL _initialized; + BOOL _connected; +} + ++ (void)initialize { + if (self == [FlutterViewController class]) { + shell::FlutterMain(); + } } #pragma mark - Manage and override all designated initializers @@ -89,92 +125,26 @@ - (void)performCommonViewControllerInitialization { _orientationPreferences = UIInterfaceOrientationMaskAll; _statusBarStyle = UIStatusBarStyleDefault; - - if ([self setupShell]) { - [self setupChannels]; - [self setupNotificationCenterObservers]; - } -} - -- (shell::Shell&)shell { - FXL_DCHECK(_shell); - return *_shell; -} - -- (fml::WeakPtr)iosPlatformView { - FXL_DCHECK(_shell); - return _shell->GetPlatformView(); -} - -- (BOOL)setupShell { - FXL_DCHECK(_shell == nullptr); - - static size_t shell_count = 1; - - auto threadLabel = [NSString stringWithFormat:@"io.flutter.%zu", shell_count++]; - - _threadHost = { - threadLabel.UTF8String, // label - shell::ThreadHost::Type::UI | shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::IO}; - - // The current thread will be used as the platform thread. Ensure that the message loop is - // initialized. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - blink::TaskRunners task_runners(threadLabel.UTF8String, // label - fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform - _threadHost.gpu_thread->GetTaskRunner(), // gpu - _threadHost.ui_thread->GetTaskRunner(), // ui - _threadHost.io_thread->GetTaskRunner() // io - ); - - _flutterView.reset([[FlutterView alloc] init]); - - // Lambda captures by pointers to ObjC objects are fine here because the create call is - // synchronous. - shell::Shell::CreateCallback on_create_platform_view = - [flutter_view_controller = self, flutter_view = _flutterView.get()](shell::Shell& shell) { - auto platform_view_ios = std::make_unique( - shell, // delegate - shell.GetTaskRunners(), // task runners - flutter_view_controller, // flutter view controller owner - flutter_view // flutter view owner - ); - return platform_view_ios; - }; - - shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - // Create the shell. - _shell = shell::Shell::Create(std::move(task_runners), // - [_dartProject settings], // - on_create_platform_view, // - on_create_rasterizer // - ); - - if (!_shell) { - FXL_LOG(ERROR) << "Could not setup a shell to run the Dart application."; - return false; - } - - // Launch the Dart application with the inferred run configuration. - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = _shell->GetEngine(), // - config = [_dartProject.get() runConfiguration] // - ]() mutable { - if (engine) { - auto result = engine->Run(std::move(config)); - if (!result) { - FXL_LOG(ERROR) << "Could not launch engine with configuration."; - } + _platformView = std::make_shared( + reinterpret_cast(self.view.layer), self); + + _platformView->Attach( + // First frame callback. + [self]() { + TRACE_EVENT0("flutter", "First Frame"); + if (_launchView) { + [UIView animateWithDuration:0.2 + animations:^{ + _launchView.get().alpha = 0; + } + completion:^(BOOL finished) { + [_launchView.get() removeFromSuperview]; + _launchView.reset(); + }]; } - })); - return true; -} + }); + _platformView->SetupResourceContextOnIOThread(); -- (void)setupChannels { _localizationChannel.reset([[FlutterMethodChannel alloc] initWithName:@"flutter/localization" binaryMessenger:self @@ -220,8 +190,9 @@ - (void)setupChannels { [_textInputChannel.get() setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { [_textInputPlugin.get() handleMethodCall:call result:result]; }]; - static_cast(_shell->GetPlatformView().get()) - ->SetTextInputPlugin(_textInputPlugin); + _platformView->SetTextInputPlugin(_textInputPlugin); + + [self setupNotificationCenterObservers]; } - (void)setupNotificationCenterObservers { @@ -290,24 +261,50 @@ - (void)setupNotificationCenterObservers { - (void)setInitialRoute:(NSString*)route { [_navigationChannel.get() invokeMethod:@"setInitialRoute" arguments:route]; } +#pragma mark - Initializing the engine + +- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { + exit(0); +} + +- (void)connectToEngineAndLoad { + if (_connected) + return; + _connected = YES; + + TRACE_EVENT0("flutter", "connectToEngineAndLoad"); + + // We ask the VM to check what it supports. + const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; + + [_dartProject launchInEngine:&_platformView->engine() + embedderVMType:type + result:^(BOOL success, NSString* message) { + if (!success) { + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Launch Error" + message:message + delegate:self + cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [alert show]; + [alert release]; + } + }]; +} #pragma mark - Loading the view - (void)loadView { - self.view = _flutterView.get(); + FlutterView* view = [[FlutterView alloc] init]; + + self.view = view; self.view.multipleTouchEnabled = YES; self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [self installLaunchViewIfNecessary]; -} - -#pragma mark - Managing launch views + [view release]; -- (void)installLaunchViewIfNecessary { // Show the launch screen view again on top of the FlutterView if available. // This launch screen view will be removed once the first Flutter frame is rendered. - [_launchView.get() removeFromSuperview]; - _launchView.reset(); NSString* launchStoryboardName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UILaunchStoryboardName"]; if (launchStoryboardName && !self.isBeingPresented && !self.isMovingToParentViewController) { @@ -322,57 +319,16 @@ - (void)installLaunchViewIfNecessary { } } -- (void)removeLaunchViewIfPresent { - if (!_launchView) { - return; - } - - [UIView animateWithDuration:0.2 - animations:^{ - _launchView.get().alpha = 0; - } - completion:^(BOOL finished) { - [_launchView.get() removeFromSuperview]; - _launchView.reset(); - }]; -} - -- (void)installLaunchViewCallback { - if (!_shell || !_launchView) { - return; - } - auto weak_platform_view = _shell->GetPlatformView(); - if (!weak_platform_view) { - return; - } - __unsafe_unretained auto weak_flutter_view_controller = self; - // This is on the platform thread. - weak_platform_view->SetNextFrameCallback( - [weak_platform_view, weak_flutter_view_controller, - task_runner = _shell->GetTaskRunners().GetPlatformTaskRunner()]() { - // This is on the GPU thread. - task_runner->PostTask([weak_platform_view, weak_flutter_view_controller]() { - // We check if the weak platform view is alive. If it is alive, then the view controller - // also has to be alive since the view controller owns the platform view via the shell - // association. Thus, we are not convinced that the unsafe unretained weak object is in - // fact alive. - if (weak_platform_view) { - [weak_flutter_view_controller removeLaunchViewIfPresent]; - } - }); - }); -} - #pragma mark - Surface creation and teardown updates - (void)surfaceUpdated:(BOOL)appeared { + FXL_CHECK(_platformView != nullptr); + // NotifyCreated/NotifyDestroyed are synchronous and require hops between the UI and GPU thread. if (appeared) { - [self installLaunchViewCallback]; - _shell->GetPlatformView()->NotifyCreated(); - + _platformView->NotifyCreated(); } else { - _shell->GetPlatformView()->NotifyDestroyed(); + _platformView->NotifyDestroyed(); } } @@ -380,6 +336,7 @@ - (void)surfaceUpdated:(BOOL)appeared { - (void)viewWillAppear:(BOOL)animated { TRACE_EVENT0("flutter", "viewWillAppear"); + [self connectToEngineAndLoad]; // Only recreate surface on subsequent appearances when viewport metrics are known. // First time surface creation is done on viewDidLayoutSubviews. if (_viewportMetrics.physical_width) @@ -434,6 +391,8 @@ - (void)applicationWillResignActive:(NSNotification*)notification { - (void)applicationDidEnterBackground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationDidEnterBackground"); [self surfaceUpdated:NO]; + // GrContext operations are blocked when the app is in the background. + blink::ResourceContext::Freeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.paused"]; } @@ -441,6 +400,7 @@ - (void)applicationWillEnterForeground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationWillEnterForeground"); if (_viewportMetrics.physical_width) [self surfaceUpdated:YES]; + blink::ResourceContext::Unfreeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.inactive"]; } @@ -587,11 +547,10 @@ - (void)dispatchTouches:(NSSet*)touches phase:(UITouchPhase)phase { packet->SetPointerData(i++, pointer_data); } - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = _shell->GetEngine(), packet = std::move(packet)] { - if (engine) { + blink::Threads::UI()->PostTask(fxl::MakeCopyable( + [ engine = _platformView->engine().GetWeakPtr(), packet = std::move(packet) ] { + if (engine.get()) engine->DispatchPointerDataPacket(*packet); - } })); } @@ -614,11 +573,13 @@ - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event { #pragma mark - Handle view resizing - (void)updateViewportMetrics { - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = _shell->GetEngine(), metrics = _viewportMetrics]() { - if (engine) { - engine->SetViewportMetrics(std::move(metrics)); + blink::Threads::UI()->PostTask( + [ weak_platform_view = _platformView->GetWeakPtr(), metrics = _viewportMetrics ] { + if (!weak_platform_view) { + return; } + weak_platform_view->UpdateSurfaceSize(); + weak_platform_view->engine().SetViewportMetrics(metrics); }); } @@ -748,7 +709,7 @@ - (void)onVoiceOverChanged:(NSNotification*)notification { #else bool enabled = UIAccessibilityIsVoiceOverRunning(); #endif - _shell->GetPlatformView()->SetSemanticsEnabled(enabled); + _platformView->ToggleAccessibility(self.view, enabled); } #pragma mark - Memory Notifications @@ -914,50 +875,46 @@ - (void)sendOnChannel:(NSString*)channel message:(NSData*)message binaryReply:(FlutterBinaryReply)callback { NSAssert(channel, @"The channel must not be null"); - fxl::RefPtr response = + fxl::RefPtr response = (callback == nil) ? nullptr - : fxl::MakeRefCounted( - ^(NSData* reply) { - callback(reply); - }, - _shell->GetTaskRunners().GetPlatformTaskRunner()); + : fxl::MakeRefCounted(^(NSData* reply) { + callback(reply); + }); fxl::RefPtr platformMessage = (message == nil) ? fxl::MakeRefCounted(channel.UTF8String, response) : fxl::MakeRefCounted( channel.UTF8String, shell::GetVectorFromNSData(message), response); - - _shell->GetPlatformView()->DispatchPlatformMessage(platformMessage); + _platformView->DispatchPlatformMessage(platformMessage); } - (void)setMessageHandlerOnChannel:(NSString*)channel binaryMessageHandler:(FlutterBinaryMessageHandler)handler { NSAssert(channel, @"The channel must not be null"); - [self iosPlatformView] -> GetPlatformMessageRouter().SetMessageHandler(channel.UTF8String, - handler); + _platformView->platform_message_router().SetMessageHandler(channel.UTF8String, handler); } #pragma mark - FlutterTextureRegistry - (int64_t)registerTexture:(NSObject*)texture { int64_t textureId = _nextTextureId++; - [self iosPlatformView] -> RegisterExternalTexture(textureId, texture); + _platformView->RegisterExternalTexture(textureId, texture); return textureId; } - (void)unregisterTexture:(int64_t)textureId { - _shell->GetPlatformView()->UnregisterTexture(textureId); + _platformView->UnregisterTexture(textureId); } - (void)textureFrameAvailable:(int64_t)textureId { - _shell->GetPlatformView()->MarkTextureFrameAvailable(textureId); + _platformView->MarkTextureFrameAvailable(textureId); } - (NSString*)lookupKeyForAsset:(NSString*)asset { - return [FlutterDartProject lookupKeyForAsset:asset]; + return [FlutterDartProject lookupKeyForAsset:asset]; } - (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { - return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; + return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h deleted file mode 100644 index 482379c8f17eb..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ - -#include "flutter/shell/common/shell.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" - -@interface FlutterViewController () - -- (shell::Shell&)shell; - -@end - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 6a545b95e4276..3f96f37a9c2db 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -427,7 +427,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { weak_factory_(this) { accessibility_channel_.reset([[FlutterBasicMessageChannel alloc] initWithName:@"flutter/accessibility" - binaryMessenger:platform_view->GetOwnerViewController() + binaryMessenger:platform_view->binary_messenger() codec:[FlutterStandardMessageCodec sharedInstance]]); [accessibility_channel_.get() setMessageHandler:^(id message, FlutterReply reply) { HandleEvent((NSDictionary*)message); @@ -440,7 +440,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { } UIView* AccessibilityBridge::textInputView() { - return [platform_view_->GetTextInputPlugin() textInputView]; + return [platform_view_->text_input_plugin() textInputView]; } void AccessibilityBridge::UpdateSemantics(blink::SemanticsNodeUpdates nodes) { diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h new file mode 100644 index 0000000000000..f2e54dd2c2806 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h @@ -0,0 +1,18 @@ +// Copyright 2017 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. + +#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ + +#include "lib/fxl/macros.h" + +namespace shell { + +/// Initializes the Flutter shell. This must be called before interacting with +/// the engine in any way. It is safe to call this method multiple times. +void FlutterMain(); + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm new file mode 100644 index 0000000000000..aa7ad5fd85727 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm @@ -0,0 +1,25 @@ +// Copyright 2017 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. + +#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" + +#include "flutter/shell/platform/darwin/common/platform_mac.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" + +namespace shell { + +void FlutterMain() { + NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; + NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; + NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; + + NSBundle* mainBundle = [NSBundle mainBundle]; + NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:mainBundle]; + + shell::PlatformMacMain(icuDataPath.UTF8String, libraryName != nil ? libraryName.UTF8String : "", + flutterAssetsPath.UTF8String); +} + +} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h deleted file mode 100644 index b861c5036e97d..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2018 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ - -#include - -#include "flutter/fml/platform/darwin/scoped_block.h" -#include "flutter/fml/task_runner.h" -#include "flutter/lib/ui/window/platform_message_response.h" -#include "flutter/shell/platform/darwin/common/buffer_conversions.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/macros.h" - -typedef void (^PlatformMessageResponseCallback)(NSData*); - -namespace shell { - -class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { - public: - void Complete(std::vector data) override { - fxl::RefPtr self(this); - platform_task_runner_->PostTask(fxl::MakeCopyable([self, data = std::move(data)]() mutable { - self->callback_.get()(shell::GetNSDataFromVector(data)); - })); - } - - void CompleteEmpty() override { - fxl::RefPtr self(this); - platform_task_runner_->PostTask( - fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); - } - - private: - explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback, - fxl::RefPtr platform_task_runner) - : callback_(callback, fml::OwnershipPolicy::Retain), - platform_task_runner_(std::move(platform_task_runner)) {} - - fml::ScopedBlock callback_; - fxl::RefPtr platform_task_runner_; - - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm deleted file mode 100644 index 8590b4e36942b..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2018 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/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" - -namespace shell { - -// - -} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.h b/shell/platform/darwin/ios/framework/Source/platform_message_router.h index d2488f82fe47c..cfa91c04771c3 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.h +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.h @@ -7,7 +7,6 @@ #include -#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterBinaryMessenger.h" #include "lib/fxl/memory/weak_ptr.h" @@ -19,13 +18,13 @@ class PlatformMessageRouter { PlatformMessageRouter(); ~PlatformMessageRouter(); - void HandlePlatformMessage(fxl::RefPtr message) const; + void HandlePlatformMessage(fxl::RefPtr message); void SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler); private: - std::unordered_map> + std::unordered_map message_handlers_; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter); diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm index 3ab75bff522f8..70625143b623e 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm @@ -14,8 +14,7 @@ PlatformMessageRouter::~PlatformMessageRouter() = default; -void PlatformMessageRouter::HandlePlatformMessage( - fxl::RefPtr message) const { +void PlatformMessageRouter::HandlePlatformMessage(fxl::RefPtr message) { fxl::RefPtr completer = message->response(); auto it = message_handlers_.find(message->channel()); if (it != message_handlers_.end()) { @@ -42,10 +41,14 @@ void PlatformMessageRouter::SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler) { - message_handlers_.erase(channel); - if (handler) { - message_handlers_[channel] = - fml::ScopedBlock{handler, fml::OwnershipPolicy::Retain}; + if (handler) + message_handlers_[channel] = [handler copy]; + else { + auto it = message_handlers_.find(channel); + if (it != message_handlers_.end()) { + [it->second release]; + message_handlers_.erase(it); + } } } diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h index 23aaf02510d6d..6a3362b215667 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h @@ -5,26 +5,27 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ -#include "flutter/fml/memory/weak_ptr.h" -#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" +#if __OBJC__ @class VSyncClient; +#else // __OBJC__ +class VSyncClient; +#endif // __OBJC__ namespace shell { -class VsyncWaiterIOS final : public VsyncWaiter { +class VsyncWaiterIOS : public VsyncWaiter { public: - VsyncWaiterIOS(blink::TaskRunners task_runners); - + VsyncWaiterIOS(); ~VsyncWaiterIOS() override; - private: - fml::scoped_nsobject client_; + void AsyncWaitForVsync(Callback callback) override; - // |shell::VsyncWaiter| - void AwaitVSync() override; + private: + Callback callback_; + VSyncClient* client_; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterIOS); }; diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm index 4589368acd3fb..78d6678189123 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm @@ -10,62 +10,29 @@ #include #include -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @interface VSyncClient : NSObject -- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner - callback:(shell::VsyncWaiter::Callback)callback; - -- (void)await; - -- (void)invalidate; - @end -namespace shell { - -VsyncWaiterIOS::VsyncWaiterIOS(blink::TaskRunners task_runners) - : VsyncWaiter(std::move(task_runners)), - client_([[VSyncClient alloc] initWithTaskRunner:task_runners_.GetUITaskRunner() - callback:std::bind(&VsyncWaiterIOS::FireCallback, - this, - std::placeholders::_1, - std::placeholders::_2)]) {} - -VsyncWaiterIOS::~VsyncWaiterIOS() { - // This way, we will get no more callbacks from the display link that holds a weak (non-nilling) - // reference to this C++ object. - [client_.get() invalidate]; -} - -void VsyncWaiterIOS::AwaitVSync() { - [client_.get() await]; -} - -} // namespace shell - @implementation VSyncClient { - shell::VsyncWaiter::Callback callback_; - fml::scoped_nsobject display_link_; + CADisplayLink* _displayLink; + shell::VsyncWaiter::Callback _pendingCallback; } -- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner - callback:(shell::VsyncWaiter::Callback)callback { +- (instancetype)init { self = [super init]; if (self) { - callback_ = std::move(callback); - display_link_ = fml::scoped_nsobject { - [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain] - }; - display_link_.get().paused = YES; - - task_runner->PostTask([client = [self retain]]() { - [client->display_link_.get() addToRunLoop:[NSRunLoop currentRunLoop] - forMode:NSRunLoopCommonModes]; + _displayLink = + [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain]; + _displayLink.paused = YES; + + blink::Threads::UI()->PostTask([client = [self retain]]() { + [client->_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; [client release]; }); } @@ -73,28 +40,68 @@ - (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner return self; } -- (void)await { - display_link_.get().paused = NO; +- (void)await:(shell::VsyncWaiter::Callback)callback { + FXL_DCHECK(!_pendingCallback); + _pendingCallback = std::move(callback); + _displayLink.paused = NO; } - (void)onDisplayLink:(CADisplayLink*)link { fxl::TimePoint frame_start_time = fxl::TimePoint::Now(); fxl::TimePoint frame_target_time = frame_start_time + fxl::TimeDelta::FromSecondsF(link.duration); - display_link_.get().paused = YES; - - callback_(frame_start_time, frame_target_time); -} - -- (void)invalidate { - // [CADisplayLink invalidate] is thread-safe. - [display_link_.get() invalidate]; + _displayLink.paused = YES; + + // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight + // Vsync" checkbox in the timeline can be enabled. + // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 + // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE + TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); +#else + { + fxl::TimeDelta delta = frame_target_time.ToEpochDelta(); + constexpr size_t num_chars = sizeof(int64_t) * CHAR_BIT * 3.4 + 2; + char deadline[num_chars]; + sprintf(deadline, "%lld", delta.ToMicroseconds()); + TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); + } +#endif + + // Note: Even though we know we are on the UI thread already (since the + // display link was scheduled on the UI thread in the contructor), we use + // the PostTask mechanism because the callback may have side-effects that need + // to be addressed via a task observer. Invoking the callback by itself + // bypasses such task observers. + // + // We are not using the PostTask for thread switching, but to make task + // observers work. + blink::Threads::UI()->PostTask([ + callback = _pendingCallback, frame_start_time, frame_target_time + ]() { callback(frame_start_time, frame_target_time); }); + + _pendingCallback = nullptr; } - (void)dealloc { - [self invalidate]; + [_displayLink invalidate]; + [_displayLink release]; [super dealloc]; } @end + +namespace shell { + +VsyncWaiterIOS::VsyncWaiterIOS() : client_([[VSyncClient alloc] init]) {} + +VsyncWaiterIOS::~VsyncWaiterIOS() { + [client_ release]; +} + +void VsyncWaiterIOS::AsyncWaitForVsync(Callback callback) { + [client_ await:callback]; +} + +} // namespace shell diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.h b/shell/platform/darwin/ios/ios_external_texture_gl.h index baedf298bd61d..a658fdf31628a 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.h +++ b/shell/platform/darwin/ios/ios_external_texture_gl.h @@ -25,8 +25,6 @@ class IOSExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; - virtual void MarkNewFrameAvailable() override; - private: NSObject* external_texture_; fml::CFRef cache_ref_; diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.mm b/shell/platform/darwin/ios/ios_external_texture_gl.mm index 0bd9a8ca3c7cb..2cc9721e7f09a 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.mm +++ b/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -4,10 +4,11 @@ #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" -#import +#include #import #import - +#include "flutter/common/threads.h" +#include "flutter/lib/ui/painting/resource_context.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" @@ -25,6 +26,7 @@ IOSExternalTextureGL::~IOSExternalTextureGL() = default; void IOSExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { + ASSERT_IS_GPU_THREAD; if (!cache_ref_) { CVOpenGLESTextureCacheRef cache; CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, @@ -55,8 +57,10 @@ return; } GrGLTextureInfo textureInfo = {CVOpenGLESTextureGetTarget(texture_ref_), - CVOpenGLESTextureGetName(texture_ref_), GL_RGBA8_OES}; - GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, textureInfo); + CVOpenGLESTextureGetName(texture_ref_), + GL_RGBA8_OES}; + GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, + textureInfo); sk_sp image = SkImage::MakeFromTexture(canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr); @@ -65,13 +69,14 @@ } } -void IOSExternalTextureGL::OnGrContextCreated() {} +void IOSExternalTextureGL::OnGrContextCreated() { + ASSERT_IS_GPU_THREAD +} void IOSExternalTextureGL::OnGrContextDestroyed() { + ASSERT_IS_GPU_THREAD texture_ref_.Reset(nullptr); cache_ref_.Reset(nullptr); } -void IOSExternalTextureGL::MarkNewFrameAvailable() {} - } // namespace shell diff --git a/shell/platform/darwin/ios/ios_gl_context.h b/shell/platform/darwin/ios/ios_gl_context.h index f42c1436461b1..89ad7e0347eac 100644 --- a/shell/platform/darwin/ios/ios_gl_context.h +++ b/shell/platform/darwin/ios/ios_gl_context.h @@ -18,7 +18,7 @@ namespace shell { class IOSGLContext { public: - IOSGLContext(fml::scoped_nsobject layer); + IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer); ~IOSGLContext(); diff --git a/shell/platform/darwin/ios/ios_gl_context.mm b/shell/platform/darwin/ios/ios_gl_context.mm index 77a124e64a291..de94018d0689e 100644 --- a/shell/platform/darwin/ios/ios_gl_context.mm +++ b/shell/platform/darwin/ios/ios_gl_context.mm @@ -3,17 +3,21 @@ // found in the LICENSE file. #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" - -#include - -#include "flutter/fml/trace_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" +#include + namespace shell { -IOSGLContext::IOSGLContext(fml::scoped_nsobject layer) - : layer_(std::move(layer)), +#define VERIFY(x) \ + if (!(x)) { \ + FXL_DLOG(ERROR) << "Failed: " #x; \ + return; \ + }; + +IOSGLContext::IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer) + : layer_([layer retain]), context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]), resource_context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:context_.get().sharegroup]), @@ -22,34 +26,34 @@ storage_size_width_(0), storage_size_height_(0), valid_(false) { - FXL_DCHECK(layer_ != nullptr); - FXL_DCHECK(context_ != nullptr); - FXL_DCHECK(resource_context_ != nullptr); + VERIFY(layer_ != nullptr); + VERIFY(context_ != nullptr); + VERIFY(resource_context_ != nullptr); bool context_current = [EAGLContext setCurrentContext:context_]; - FXL_DCHECK(context_current); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + VERIFY(context_current); + VERIFY(glGetError() == GL_NO_ERROR); // Generate the framebuffer glGenFramebuffers(1, &framebuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - FXL_DCHECK(framebuffer_ != GL_NONE); + VERIFY(glGetError() == GL_NO_ERROR); + VERIFY(framebuffer_ != GL_NONE); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + VERIFY(glGetError() == GL_NO_ERROR); // Setup color attachment glGenRenderbuffers(1, &colorbuffer_); - FXL_DCHECK(colorbuffer_ != GL_NONE); + VERIFY(colorbuffer_ != GL_NONE); glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + VERIFY(glGetError() == GL_NO_ERROR); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorbuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + VERIFY(glGetError() == GL_NO_ERROR); // TODO: // iOS displays are more variable than just P3 or sRGB. Reading the display @@ -135,12 +139,24 @@ return false; } - // Fetch the dimensions of the color buffer whose backing was just updated. - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &storage_size_width_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + GLint width = 0; + GLint height = 0; - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &storage_size_height_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + if (colorbuffer_ != GL_NONE) { + // Fetch the dimensions of the color buffer whose backing was just updated + // so that backing of the attachments can be updated + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width); + FXL_DCHECK(glGetError() == GL_NO_ERROR); + + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height); + FXL_DCHECK(glGetError() == GL_NO_ERROR); + + glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); + FXL_DCHECK(glGetError() == GL_NO_ERROR); + } + + storage_size_width_ = width; + storage_size_height_ = height; FXL_DCHECK(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); diff --git a/shell/platform/darwin/ios/ios_surface.h b/shell/platform/darwin/ios/ios_surface.h index b629c2709e3d1..c164fab15500e 100644 --- a/shell/platform/darwin/ios/ios_surface.h +++ b/shell/platform/darwin/ios/ios_surface.h @@ -5,17 +5,25 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ -#include - #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/surface.h" +#include "flutter/shell/common/platform_view.h" #include "lib/fxl/macros.h" +@class CALayer; + namespace shell { class IOSSurface { public: - IOSSurface(); + static std::unique_ptr Create( + PlatformView::SurfaceConfig surface_config, + CALayer* layer); + + IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer); + + CALayer* GetLayer() const; + + PlatformView::SurfaceConfig GetSurfaceConfig() const; virtual ~IOSSurface(); @@ -28,6 +36,9 @@ class IOSSurface { virtual std::unique_ptr CreateGPUSurface() = 0; public: + PlatformView::SurfaceConfig surface_config_; + fml::scoped_nsobject layer_; + FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurface); }; diff --git a/shell/platform/darwin/ios/ios_surface.mm b/shell/platform/darwin/ios/ios_surface.mm index b0b9cc3245183..91067838330f6 100644 --- a/shell/platform/darwin/ios/ios_surface.mm +++ b/shell/platform/darwin/ios/ios_surface.mm @@ -4,15 +4,40 @@ #include "flutter/shell/platform/darwin/ios/ios_surface.h" -#include - #include #include +#include + +@class CALayer; +@class CAEAGLLayer; namespace shell { -IOSSurface::IOSSurface() = default; +std::unique_ptr IOSSurface::Create(PlatformView::SurfaceConfig surface_config, + CALayer* layer) { + // Check if we can use OpenGL. + if ([layer isKindOfClass:[CAEAGLLayer class]]) { + return std::make_unique(surface_config, reinterpret_cast(layer)); + } + + // If we ever support the metal rendering API, a check for CAMetalLayer would + // go here. + + // Finally, fallback to software rendering. + return std::make_unique(surface_config, layer); +} + +IOSSurface::IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer) + : surface_config_(surface_config), layer_([layer retain]) {} IOSSurface::~IOSSurface() = default; +CALayer* IOSSurface::GetLayer() const { + return layer_; +} + +PlatformView::SurfaceConfig IOSSurface::GetSurfaceConfig() const { + return surface_config_; +} + } // namespace shell diff --git a/shell/platform/darwin/ios/ios_surface_gl.h b/shell/platform/darwin/ios/ios_surface_gl.h index 7486d343eb0fd..f7e43e2588984 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.h +++ b/shell/platform/darwin/ios/ios_surface_gl.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ -#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" @@ -17,7 +16,7 @@ namespace shell { class IOSSurfaceGL : public IOSSurface, public GPUSurfaceGLDelegate { public: - IOSSurfaceGL(fml::scoped_nsobject layer); + IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer); ~IOSSurfaceGL() override; diff --git a/shell/platform/darwin/ios/ios_surface_gl.mm b/shell/platform/darwin/ios/ios_surface_gl.mm index 253531c4800aa..60756d6094fc9 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/shell/platform/darwin/ios/ios_surface_gl.mm @@ -4,12 +4,13 @@ #include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" -#include "flutter/fml/trace_event.h" #include "flutter/shell/gpu/gpu_surface_gl.h" namespace shell { -IOSSurfaceGL::IOSSurfaceGL(fml::scoped_nsobject layer) : context_(std::move(layer)) {} +IOSSurfaceGL::IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer) + : IOSSurface(surface_config, reinterpret_cast(layer)), + context_(surface_config, layer) {} IOSSurfaceGL::~IOSSurfaceGL() = default; diff --git a/shell/platform/darwin/ios/ios_surface_software.h b/shell/platform/darwin/ios/ios_surface_software.h index e8fc332f06c8c..7e3f264b28ce6 100644 --- a/shell/platform/darwin/ios/ios_surface_software.h +++ b/shell/platform/darwin/ios/ios_surface_software.h @@ -5,19 +5,17 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ -#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_software.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/macros.h" -@class CALayer; - namespace shell { -class IOSSurfaceSoftware final : public IOSSurface, - public GPUSurfaceSoftwareDelegate { +class IOSSurfaceSoftware : public IOSSurface, + public GPUSurfaceSoftwareDelegate { public: - IOSSurfaceSoftware(fml::scoped_nsobject layer); + IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, + CALayer* layer); ~IOSSurfaceSoftware() override; @@ -34,7 +32,6 @@ class IOSSurfaceSoftware final : public IOSSurface, bool PresentBackingStore(sk_sp backing_store) override; private: - fml::scoped_nsobject layer_; sk_sp sk_surface_; FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware); diff --git a/shell/platform/darwin/ios/ios_surface_software.mm b/shell/platform/darwin/ios/ios_surface_software.mm index b09a5d9a2d8a3..9a4e90e45dfba 100644 --- a/shell/platform/darwin/ios/ios_surface_software.mm +++ b/shell/platform/darwin/ios/ios_surface_software.mm @@ -15,15 +15,15 @@ namespace shell { -IOSSurfaceSoftware::IOSSurfaceSoftware(fml::scoped_nsobject layer) - : layer_(std::move(layer)) { +IOSSurfaceSoftware::IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, CALayer* layer) + : IOSSurface(surface_config, layer) { UpdateStorageSizeIfNecessary(); } IOSSurfaceSoftware::~IOSSurfaceSoftware() = default; bool IOSSurfaceSoftware::IsValid() const { - return layer_; + return GetLayer() != nullptr; } bool IOSSurfaceSoftware::ResourceContextMakeCurrent() { @@ -120,7 +120,8 @@ return false; } - layer_.get().contents = reinterpret_cast(static_cast(pixmap_image)); + CALayer* layer = GetLayer(); + layer.contents = reinterpret_cast(static_cast(pixmap_image)); return true; } diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index e7849dda44641..dab19a0f9ce1a 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -8,66 +8,95 @@ #include #include "flutter/fml/memory/weak_ptr.h" -#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" #include "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h" #include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" +@class CALayer; +@class UIView; + namespace shell { -class PlatformViewIOS final : public PlatformView { +class PlatformViewIOS : public PlatformView { public: - explicit PlatformViewIOS(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - FlutterViewController* owner_controller_, - FlutterView* owner_view_); + explicit PlatformViewIOS(CALayer* layer, + NSObject* binaryMessenger); ~PlatformViewIOS() override; - PlatformMessageRouter& GetPlatformMessageRouter(); + void Attach() override; - FlutterViewController* GetOwnerViewController() const; + void Attach(fxl::Closure firstFrameCallback); - void RegisterExternalTexture(int64_t id, NSObject* texture); + void NotifyCreated(); - fml::scoped_nsprotocol GetTextInputPlugin() const; + void ToggleAccessibility(UIView* view, bool enabled); - void SetTextInputPlugin( - fml::scoped_nsprotocol plugin); + PlatformMessageRouter& platform_message_router() { + return platform_message_router_; + } - private: - FlutterViewController* owner_controller_; // weak reference. - FlutterView* owner_view_; // weak reference. - std::unique_ptr ios_surface_; - PlatformMessageRouter platform_message_router_; - std::unique_ptr accessibility_bridge_; - fml::scoped_nsprotocol text_input_plugin_; - fxl::Closure firstFrameCallback_; + fml::WeakPtr GetWeakPtr(); - // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; + void UpdateSurfaceSize(); - // |shell::PlatformView| - sk_sp CreateResourceContext() const override; + VsyncWaiter* GetVsyncWaiter() override; - // |shell::PlatformView| - void SetSemanticsEnabled(bool enabled) override; + bool ResourceContextMakeCurrent() override; - // |shell::PlatformView| void HandlePlatformMessage( fxl::RefPtr message) override; - // |shell::PlatformView| + void RegisterExternalTexture(int64_t id, NSObject* texture); + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - // |shell::PlatformView| - std::unique_ptr CreateVSyncWaiter() override; + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + + void SetAssetBundlePath(const std::string& assets_directory) override; + + /** + * Exposes the `FlutterTextInputPlugin` singleton for the + * `AccessibilityBridge` to be able to interact with the text entry system. + */ + fml::scoped_nsprotocol text_input_plugin() { + return text_input_plugin_; + } + + /** + * Sets the `FlutterTextInputPlugin` singleton returned by + * `text_input_plugin`. + */ + void SetTextInputPlugin( + fml::scoped_nsprotocol textInputPlugin) { + text_input_plugin_ = textInputPlugin; + } + + NSObject* binary_messenger() const { + return binary_messenger_; + } + + private: + std::unique_ptr ios_surface_; + PlatformMessageRouter platform_message_router_; + std::unique_ptr accessibility_bridge_; + fxl::Closure firstFrameCallback_; + fml::WeakPtrFactory weak_factory_; + NSObject* binary_messenger_; + fml::scoped_nsprotocol text_input_plugin_; + + void SetupAndLoadFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages); + + void SetAssetBundlePathOnUI(const std::string& assets_directory); FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewIOS); }; diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index 1fba8e5e026e5..19c5dd4e663a1 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -8,92 +8,135 @@ #include -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/gpu/gpu_rasterizer.h" +#include "flutter/shell/platform/darwin/common/process_info_mac.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewIOS::PlatformViewIOS(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - FlutterViewController* owner_controller, - FlutterView* owner_view) - : PlatformView(delegate, std::move(task_runners)), - owner_controller_(owner_controller), - owner_view_(owner_view), - ios_surface_(owner_view_.createSurface) { - FXL_DCHECK(ios_surface_ != nullptr); - FXL_DCHECK(owner_controller_ != nullptr); - FXL_DCHECK(owner_view_ != nullptr); -} +PlatformViewIOS::PlatformViewIOS(CALayer* layer, NSObject* binaryMessenger) + : PlatformView(std::make_unique(std::make_unique())), + ios_surface_(IOSSurface::Create(surface_config_, layer)), + weak_factory_(this), + binary_messenger_(binaryMessenger) {} PlatformViewIOS::~PlatformViewIOS() = default; -FlutterViewController* PlatformViewIOS::GetOwnerViewController() const { - return owner_controller_; +void PlatformViewIOS::Attach() { + Attach(NULL); } -PlatformMessageRouter& PlatformViewIOS::GetPlatformMessageRouter() { - return platform_message_router_; +void PlatformViewIOS::Attach(fxl::Closure firstFrameCallback) { + CreateEngine(); + + if (firstFrameCallback) { + firstFrameCallback_ = firstFrameCallback; + rasterizer_->AddNextFrameCallback([weakSelf = GetWeakPtr()] { + if (weakSelf) { + weakSelf->firstFrameCallback_(); + weakSelf->firstFrameCallback_ = nullptr; + } + }); + } } -void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, - NSObject* texture) { - RegisterTexture(std::make_shared(texture_id, texture)); +void PlatformViewIOS::NotifyCreated() { + PlatformView::NotifyCreated(ios_surface_->CreateGPUSurface()); +} + +void PlatformViewIOS::ToggleAccessibility(UIView* view, bool enabled) { + if (enabled) { + if (!accessibility_bridge_) { + accessibility_bridge_.reset(new shell::AccessibilityBridge(view, this)); + } + } else { + accessibility_bridge_ = nullptr; + } + SetSemanticsEnabled(enabled); } -// |shell::PlatformView| -std::unique_ptr PlatformViewIOS::CreateRenderingSurface() { - return ios_surface_->CreateGPUSurface(); +void PlatformViewIOS::SetupAndLoadFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + blink::Threads::UI()->PostTask( + [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { + if (engine) + engine->RunBundleAndSource(assets_directory, main, packages); + }); } -// |shell::PlatformView| -sk_sp PlatformViewIOS::CreateResourceContext() const { - if (!ios_surface_->ResourceContextMakeCurrent()) { - FXL_DLOG(INFO) << "Could not make resource context current on IO thread. Async texture uploads " - "will be disabled."; - return nullptr; - } +void PlatformViewIOS::SetAssetBundlePathOnUI(const std::string& assets_directory) { + blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { + if (engine) + engine->SetAssetBundlePath(assets_directory); + }); +} - return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); +fml::WeakPtr PlatformViewIOS::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); } -// |shell::PlatformView| -void PlatformViewIOS::SetSemanticsEnabled(bool enabled) { - if (enabled && !accessibility_bridge_) { - accessibility_bridge_ = std::make_unique(owner_view_, this); - } else { - accessibility_bridge_.reset(); +void PlatformViewIOS::UpdateSurfaceSize() { + blink::Threads::Gpu()->PostTask([self = GetWeakPtr()]() { + if (self && self->ios_surface_ != nullptr) { + self->ios_surface_->UpdateStorageSizeIfNecessary(); + } + }); +} + +VsyncWaiter* PlatformViewIOS::GetVsyncWaiter() { + if (!vsync_waiter_) { + vsync_waiter_ = std::make_unique(); } - PlatformView::SetSemanticsEnabled(enabled); + return vsync_waiter_.get(); +} + +bool PlatformViewIOS::ResourceContextMakeCurrent() { + return ios_surface_ != nullptr ? ios_surface_->ResourceContextMakeCurrent() : false; } -// |shell::PlatformView| void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update) { - if (accessibility_bridge_) { + if (accessibility_bridge_) accessibility_bridge_->UpdateSemantics(std::move(update)); - } } -// |shell::PlatformView| void PlatformViewIOS::HandlePlatformMessage(fxl::RefPtr message) { platform_message_router_.HandlePlatformMessage(std::move(message)); } -// |shell::PlatformView| -std::unique_ptr PlatformViewIOS::CreateVSyncWaiter() { - return std::make_unique(task_runners_); +void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, + NSObject* texture) { + RegisterTexture(std::make_shared(texture_id, texture)); } -fml::scoped_nsprotocol PlatformViewIOS::GetTextInputPlugin() const { - return text_input_plugin_; +void PlatformViewIOS::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + auto latch = new fxl::ManualResetWaitableEvent(); + + dispatch_async(dispatch_get_main_queue(), ^{ + SetupAndLoadFromSource(assets_directory, main, packages); + latch->Signal(); + }); + + latch->Wait(); + delete latch; } -void PlatformViewIOS::SetTextInputPlugin(fml::scoped_nsprotocol plugin) { - text_input_plugin_ = plugin; +void PlatformViewIOS::SetAssetBundlePath(const std::string& assets_directory) { + auto latch = new fxl::ManualResetWaitableEvent(); + + dispatch_async(dispatch_get_main_queue(), ^{ + SetAssetBundlePathOnUI(assets_directory); + latch->Signal(); + }); + + latch->Wait(); + delete latch; } } // namespace shell diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index b1e0b3e4f3b71..7ce6f7e8d5be1 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -4,21 +4,16 @@ import("$flutter_root/testing/testing.gni") -static_library("embedder") { - complete_static_lib = true - +source_set("embedder") { sources = [ "embedder.cc", "embedder.h", - "embedder_engine.cc", - "embedder_engine.h", "embedder_include.c", "platform_view_embedder.cc", "platform_view_embedder.h", ] deps = [ - "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", @@ -27,7 +22,6 @@ static_library("embedder") { "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", - "//third_party/skia:gpu", "//topaz/lib/tonic", ] diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index a7ee807934663..866413cbc077b 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -2,30 +2,14 @@ // 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 "lib/fxl/build_config.h" - -#if OS_WIN -#define FLUTTER_EXPORT __declspec(dllexport) -#else // OS_WIN #define FLUTTER_EXPORT __attribute__((visibility("default"))) -#endif // OS_WIN #include "flutter/shell/platform/embedder/embedder.h" #include - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/common/task_runners.h" -#include "flutter/fml/file.h" +#include "flutter/common/threads.h" #include "flutter/fml/message_loop.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/embedder/embedder.h" -#include "flutter/shell/platform/embedder/embedder_engine.h" #include "flutter/shell/platform/embedder/platform_view_embedder.h" -#include "lib/fxl/command_line.h" #include "lib/fxl/functional/make_copyable.h" #define SAFE_ACCESS(pointer, member, default_value) \ @@ -57,6 +41,21 @@ bool IsRendererValid(const FlutterRendererConfig* config) { return true; } +class PlatformViewHolder { + public: + PlatformViewHolder(std::shared_ptr ptr) + : platform_view_(std::move(ptr)) {} + + std::shared_ptr view() const { + return platform_view_; + } + + private: + std::shared_ptr platform_view_; + + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewHolder); +}; + struct _FlutterPlatformMessageResponseHandle { fxl::RefPtr message; }; @@ -66,7 +65,6 @@ FlutterResult FlutterEngineRun(size_t version, const FlutterProjectArgs* args, void* user_data, FlutterEngine* engine_out) { - // Step 0: Figure out arguments for shell creation. if (version != FLUTTER_ENGINE_VERSION) { return kInvalidLibraryVersion; } @@ -89,44 +87,51 @@ FlutterResult FlutterEngineRun(size_t version, return kInvalidArguments; } - auto make_current = [ptr = config->open_gl.make_current, - user_data]() -> bool { return ptr(user_data); }; + auto make_current = + [ ptr = config->open_gl.make_current, user_data ]()->bool { + return ptr(user_data); + }; - auto clear_current = [ptr = config->open_gl.clear_current, - user_data]() -> bool { return ptr(user_data); }; + auto clear_current = + [ ptr = config->open_gl.clear_current, user_data ]()->bool { + return ptr(user_data); + }; - auto present = [ptr = config->open_gl.present, user_data]() -> bool { + auto present = [ ptr = config->open_gl.present, user_data ]()->bool { return ptr(user_data); }; - auto fbo_callback = [ptr = config->open_gl.fbo_callback, - user_data]() -> intptr_t { return ptr(user_data); }; + auto fbo_callback = + [ ptr = config->open_gl.fbo_callback, user_data ]()->intptr_t { + return ptr(user_data); + }; shell::PlatformViewEmbedder::PlatformMessageResponseCallback platform_message_response_callback = nullptr; if (SAFE_ACCESS(args, platform_message_callback, nullptr) != nullptr) { platform_message_response_callback = - [ptr = args->platform_message_callback, - user_data](fxl::RefPtr message) { - auto handle = new FlutterPlatformMessageResponseHandle(); - const FlutterPlatformMessage incoming_message = { - .struct_size = sizeof(FlutterPlatformMessage), - .channel = message->channel().c_str(), - .message = message->data().data(), - .message_size = message->data().size(), - .response_handle = handle, - }; - handle->message = std::move(message); - return ptr(&incoming_message, user_data); - }; + [ ptr = args->platform_message_callback, + user_data ](fxl::RefPtr message) { + auto handle = new FlutterPlatformMessageResponseHandle(); + const FlutterPlatformMessage incoming_message = { + .struct_size = sizeof(FlutterPlatformMessage), + .channel = message->channel().c_str(), + .message = message->data().data(), + .message_size = message->data().size(), + .response_handle = handle, + }; + handle->message = std::move(message); + return ptr(&incoming_message, user_data); + }; } const FlutterOpenGLRendererConfig* open_gl_config = &config->open_gl; std::function make_resource_current_callback = nullptr; if (SAFE_ACCESS(open_gl_config, make_resource_current, nullptr) != nullptr) { - make_resource_current_callback = [ptr = - config->open_gl.make_resource_current, - user_data]() { return ptr(user_data); }; + make_resource_current_callback = + [ ptr = config->open_gl.make_resource_current, user_data ]() { + return ptr(user_data); + }; } std::string icu_data_path; @@ -142,33 +147,18 @@ FlutterResult FlutterEngineRun(size_t version, SAFE_ACCESS(args, command_line_argv, nullptr)); } - blink::Settings settings = shell::SettingsFromCommandLine(command_line); - settings.icu_data_path = icu_data_path; - settings.main_dart_file_path = args->main_path; - settings.packages_file_path = args->packages_path; - settings.assets_path = args->assets_path; - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - - // Create a thread host with the current thread as the platform thread and all - // other threads managed. - shell::ThreadHost thread_host("io.flutter", shell::ThreadHost::Type::GPU | - shell::ThreadHost::Type::IO | - shell::ThreadHost::Type::UI); - fml::MessageLoop::EnsureInitializedForCurrentThread(); - blink::TaskRunners task_runners( - "io.flutter", - fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform - thread_host.gpu_thread->GetTaskRunner(), // gpu - thread_host.ui_thread->GetTaskRunner(), // ui - thread_host.io_thread->GetTaskRunner() // io - ); - - shell::PlatformViewEmbedder::DispatchTable dispatch_table = { + static std::once_flag once_shell_initialization; + std::call_once(once_shell_initialization, [&]() { + fxl::CommandLine null_command_line; + shell::Shell::InitStandalone( + std::move(command_line), + icu_data_path, // icu data path default lookup. + "", // application library not supported in JIT mode. + args->assets_path + ); + }); + + shell::PlatformViewEmbedder::DispatchTable table = { .gl_make_current_callback = make_current, .gl_clear_current_callback = clear_current, .gl_present_callback = present, @@ -177,55 +167,31 @@ FlutterResult FlutterEngineRun(size_t version, .gl_make_resource_current_callback = make_resource_current_callback, }; - shell::Shell::CreateCallback on_create_platform_view = - [dispatch_table](shell::Shell& shell) { - return std::make_unique( - shell, // delegate - shell.GetTaskRunners(), // task runners - dispatch_table // embedder dispatch table - ); - }; - - shell::Shell::CreateCallback on_create_rasterizer = - [](shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - // Step 1: Create the engine. - auto embedder_engine = - std::make_unique(std::move(thread_host), // - std::move(task_runners), // - settings, // - on_create_platform_view, // - on_create_rasterizer // - ); - - if (!embedder_engine->IsValid()) { - return kInvalidArguments; - } - - // Step 2: Setup the rendering surface. - if (!embedder_engine->NotifyCreated()) { - return kInvalidArguments; - } - - // Step 3: Run the engine. - auto run_configuration = shell::RunConfiguration::InferFromSettings(settings); - - run_configuration.AddAssetResolver( - std::make_unique( - fml::Duplicate(settings.assets_dir))); + auto platform_view = std::make_shared(table); + platform_view->Attach(); + + std::string assets(args->assets_path); + std::string main(args->main_path); + std::string packages(args->packages_path); + + blink::Threads::UI()->PostTask([ + weak_engine = platform_view->engine().GetWeakPtr(), // + assets = std::move(assets), // + main = std::move(main), // + packages = std::move(packages) // + ] { + if (auto engine = weak_engine) { + if (main.empty()) { + engine->RunBundle(assets); + } else { + engine->RunBundleAndSource(assets, main, packages); + } + } + }); + + *engine_out = reinterpret_cast( + new PlatformViewHolder(std::move(platform_view))); - run_configuration.AddAssetResolver( - std::make_unique(fml::OpenFile( - settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); - - if (!embedder_engine->Run(std::move(run_configuration))) { - return kInvalidArguments; - } - - // Finally! Release the ownership of the embedder engine to the caller. - *engine_out = reinterpret_cast(embedder_engine.release()); return kSuccess; } @@ -233,9 +199,7 @@ FlutterResult FlutterEngineShutdown(FlutterEngine engine) { if (engine == nullptr) { return kInvalidArguments; } - auto embedder_engine = reinterpret_cast(engine); - embedder_engine->NotifyDestroyed(); - delete embedder_engine; + delete reinterpret_cast(engine); return kSuccess; } @@ -246,16 +210,21 @@ FlutterResult FlutterEngineSendWindowMetricsEvent( return kInvalidArguments; } + auto holder = reinterpret_cast(engine); + blink::ViewportMetrics metrics; metrics.physical_width = SAFE_ACCESS(flutter_metrics, width, 0.0); metrics.physical_height = SAFE_ACCESS(flutter_metrics, height, 0.0); metrics.device_pixel_ratio = SAFE_ACCESS(flutter_metrics, pixel_ratio, 1.0); - return reinterpret_cast(engine)->SetViewportMetrics( - std::move(metrics)) - ? kSuccess - : kInvalidArguments; + blink::Threads::UI()->PostTask( + [ weak_engine = holder->view()->engine().GetWeakPtr(), metrics ] { + if (auto engine = weak_engine) { + engine->SetViewportMetrics(metrics); + } + }); + return kSuccess; } inline blink::PointerData::Change ToPointerDataChange( @@ -298,10 +267,19 @@ FlutterResult FlutterEngineSendPointerEvent(FlutterEngine engine, reinterpret_cast(current) + current->struct_size); } - return reinterpret_cast(engine) - ->DispatchPointerDataPacket(std::move(packet)) - ? kSuccess - : kInvalidArguments; + blink::Threads::UI()->PostTask(fxl::MakeCopyable([ + weak_engine = reinterpret_cast(engine) + ->view() + ->engine() + .GetWeakPtr(), + packet = std::move(packet) + ] { + if (auto engine = weak_engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); + + return kSuccess; } FlutterResult FlutterEngineSendPlatformMessage( @@ -316,6 +294,8 @@ FlutterResult FlutterEngineSendPlatformMessage( return kInvalidArguments; } + auto holder = reinterpret_cast(engine); + auto message = fxl::MakeRefCounted( flutter_message->channel, std::vector( @@ -323,10 +303,13 @@ FlutterResult FlutterEngineSendPlatformMessage( flutter_message->message + flutter_message->message_size), nullptr); - return reinterpret_cast(engine)->SendPlatformMessage( - std::move(message)) - ? kSuccess - : kInvalidArguments; + blink::Threads::UI()->PostTask( + [ weak_engine = holder->view()->engine().GetWeakPtr(), message ] { + if (auto engine = weak_engine) { + engine->DispatchPlatformMessage(message); + } + }); + return kSuccess; } FlutterResult FlutterEngineSendPlatformMessageResponse( diff --git a/shell/platform/embedder/embedder_engine.cc b/shell/platform/embedder/embedder_engine.cc deleted file mode 100644 index 7416441d7902e..0000000000000 --- a/shell/platform/embedder/embedder_engine.cc +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2017 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/shell/platform/embedder/embedder_engine.h" - -#include "lib/fxl/functional/make_copyable.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace shell { - -EmbedderEngine::EmbedderEngine( - ThreadHost thread_host, - blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer) - : thread_host_(std::move(thread_host)), - shell_(Shell::Create(std::move(task_runners), - std::move(settings), - on_create_platform_view, - on_create_rasterizer)) { - is_valid_ = shell_ != nullptr; -} - -EmbedderEngine::~EmbedderEngine() = default; - -bool EmbedderEngine::IsValid() const { - return is_valid_; -} - -bool EmbedderEngine::NotifyCreated() { - if (!IsValid()) { - return false; - } - - shell_->GetPlatformView()->NotifyCreated(); - return true; -} - -bool EmbedderEngine::NotifyDestroyed() { - if (!IsValid()) { - return false; - } - - shell_->GetPlatformView()->NotifyDestroyed(); - return true; -} - -bool EmbedderEngine::Run(RunConfiguration run_configuration) { - if (!IsValid()) { - return false; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = shell_->GetEngine(), // engine - config = std::move(run_configuration) // config - ]() mutable { - if (engine) { - auto result = engine->Run(std::move(config)); - if (!result) { - FXL_LOG(ERROR) << "Could not launch the engine with configuration."; - } - } - })); - - return true; -} - -bool EmbedderEngine::SetViewportMetrics(blink::ViewportMetrics metrics) { - if (!IsValid()) { - return false; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = shell_->GetEngine(), metrics = std::move(metrics)]() { - if (engine) { - engine->SetViewportMetrics(std::move(metrics)); - } - }); - return true; -} - -bool EmbedderEngine::DispatchPointerDataPacket( - std::unique_ptr packet) { - if (!IsValid() || !packet) { - return false; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [engine = shell_->GetEngine(), packet = std::move(packet)] { - if (engine) { - engine->DispatchPointerDataPacket(*packet); - } - })); - - return true; -} - -bool EmbedderEngine::SendPlatformMessage( - fxl::RefPtr message) { - if (!IsValid() || !message) { - return false; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = shell_->GetEngine(), message] { - if (engine) { - engine->DispatchPlatformMessage(message); - } - }); - - return true; -} - -} // namespace shell diff --git a/shell/platform/embedder/embedder_engine.h b/shell/platform/embedder/embedder_engine.h deleted file mode 100644 index c01b86c2aac47..0000000000000 --- a/shell/platform/embedder/embedder_engine.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017 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_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ -#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ - -#include - -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/thread_host.h" -#include "flutter/shell/platform/embedder/embedder.h" -#include "lib/fxl/macros.h" - -namespace shell { - -// The object that is returned to the embedder as an opaque pointer to the -// instance of the Flutter engine. -class EmbedderEngine { - public: - EmbedderEngine(ThreadHost thread_host, blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer); - - ~EmbedderEngine(); - - bool NotifyCreated(); - - bool NotifyDestroyed(); - - bool Run(RunConfiguration run_configuration); - - bool IsValid() const; - - bool SetViewportMetrics(blink::ViewportMetrics metrics); - - bool DispatchPointerDataPacket( - std::unique_ptr packet); - - bool SendPlatformMessage(fxl::RefPtr message); - - private: - const ThreadHost thread_host_; - std::unique_ptr shell_; - bool is_valid_ = false; - - FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderEngine); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ diff --git a/shell/platform/embedder/platform_view_embedder.cc b/shell/platform/embedder/platform_view_embedder.cc index db1bea35c691e..46e0390770da4 100644 --- a/shell/platform/embedder/platform_view_embedder.cc +++ b/shell/platform/embedder/platform_view_embedder.cc @@ -3,18 +3,17 @@ // found in the LICENSE file. #include "flutter/shell/platform/embedder/platform_view_embedder.h" - -#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/gpu/gpu_rasterizer.h" namespace shell { -PlatformViewEmbedder::PlatformViewEmbedder(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - DispatchTable dispatch_table) - : PlatformView(delegate, std::move(task_runners)), +PlatformViewEmbedder::PlatformViewEmbedder(DispatchTable dispatch_table) + : PlatformView(std::make_unique(nullptr)), dispatch_table_(dispatch_table) {} -PlatformViewEmbedder::~PlatformViewEmbedder() = default; +PlatformViewEmbedder::~PlatformViewEmbedder() { + NotifyDestroyed(); +} bool PlatformViewEmbedder::GLContextMakeCurrent() { return dispatch_table_.gl_make_current_callback(); @@ -32,6 +31,33 @@ intptr_t PlatformViewEmbedder::GLContextFBO() const { return dispatch_table_.gl_fbo_callback(); } +void PlatformViewEmbedder::Attach() { + CreateEngine(); + NotifyCreated(std::make_unique(this)); + + if (dispatch_table_.gl_make_resource_current_callback != nullptr) { + SetupResourceContextOnIOThread(); + } +} + +bool PlatformViewEmbedder::ResourceContextMakeCurrent() { + if (dispatch_table_.gl_make_resource_current_callback == nullptr) { + return false; + } + return dispatch_table_.gl_make_resource_current_callback(); +} + +void PlatformViewEmbedder::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + FXL_LOG(INFO) << "Hot reloading is unsupported on this platform."; +} + +void PlatformViewEmbedder::SetAssetBundlePath( + const std::string& assets_directory) { + FXL_LOG(INFO) << "Set asset bundle path is unsupported on this platform."; +} + void PlatformViewEmbedder::HandlePlatformMessage( fxl::RefPtr message) { if (!message) { @@ -50,17 +76,4 @@ void PlatformViewEmbedder::HandlePlatformMessage( dispatch_table_.platform_message_response_callback(std::move(message)); } -std::unique_ptr PlatformViewEmbedder::CreateRenderingSurface() { - return std::make_unique(this); -} - -sk_sp PlatformViewEmbedder::CreateResourceContext() const { - auto callback = dispatch_table_.gl_make_resource_current_callback; - if (callback && callback()) { - return IOManager::CreateCompatibleResourceLoadingContext( - GrBackend::kOpenGL_GrBackend); - } - return nullptr; -} - } // namespace shell diff --git a/shell/platform/embedder/platform_view_embedder.h b/shell/platform/embedder/platform_view_embedder.h index a5b76dfaa07ba..c287fc5ac86f1 100644 --- a/shell/platform/embedder/platform_view_embedder.h +++ b/shell/platform/embedder/platform_view_embedder.h @@ -12,8 +12,7 @@ namespace shell { -class PlatformViewEmbedder final : public PlatformView, - public GPUSurfaceGLDelegate { +class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { public: using PlatformMessageResponseCallback = std::function)>; @@ -27,11 +26,9 @@ class PlatformViewEmbedder final : public PlatformView, std::function gl_make_resource_current_callback; // optional }; - PlatformViewEmbedder(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - DispatchTable dispatch_table); + PlatformViewEmbedder(DispatchTable dispatch_table); - ~PlatformViewEmbedder() override; + ~PlatformViewEmbedder(); // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; @@ -46,17 +43,25 @@ class PlatformViewEmbedder final : public PlatformView, intptr_t GLContextFBO() const override; // |shell::PlatformView| - void HandlePlatformMessage( - fxl::RefPtr message) override; + void Attach() override; - private: - DispatchTable dispatch_table_; + // |shell::PlatformView| + bool ResourceContextMakeCurrent() override; + + // |shell::PlatformView| + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; + void SetAssetBundlePath(const std::string& assets_directory) override; // |shell::PlatformView| - sk_sp CreateResourceContext() const override; + void HandlePlatformMessage( + fxl::RefPtr message) override; + + private: + DispatchTable dispatch_table_; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewEmbedder); }; diff --git a/shell/platform/linux/BUILD.gn b/shell/platform/linux/BUILD.gn new file mode 100644 index 0000000000000..6e9f1f596b09d --- /dev/null +++ b/shell/platform/linux/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright 2016 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. + +executable("linux") { + output_name = "flutter_tester" + + sources = [ + "main_linux.cc", + ] + + deps = [ + "//third_party/dart/runtime:libdart_jit", + "//third_party/dart/runtime/bin:embedded_dart_io", + "$flutter_root/common", + "$flutter_root/fml", + "$flutter_root/shell/common", + "$flutter_root/shell/testing", + "//garnet/public/lib/fxl", + "//third_party/skia", + "//topaz/lib/tonic", + ] +} diff --git a/shell/platform/linux/main_linux.cc b/shell/platform/linux/main_linux.cc new file mode 100644 index 0000000000000..a20d425ed1eed --- /dev/null +++ b/shell/platform/linux/main_linux.cc @@ -0,0 +1,142 @@ +// Copyright 2015 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. + +#include "flutter/common/threads.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/testing/test_runner.h" +#include "flutter/shell/testing/testing.h" +#include "flutter/sky/engine/public/web/Sky.h" +#include "lib/fxl/command_line.h" +#include "lib/tonic/dart_microtask_queue.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +namespace { + +// Exit codes used by the Dart command line tool. +const int kApiErrorExitCode = 253; +const int kCompilationErrorExitCode = 254; +const int kErrorExitCode = 255; + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver : public fml::TaskObserver { + public: + ScriptCompletionTaskObserver(fxl::RefPtr task_runner) + : main_task_runner_(std::move(task_runner)), + prev_live_(false), + last_error_(tonic::kNoError) {} + + void DidProcessTask() override { + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + shell::Engine& engine = test_runner.platform_view().engine(); + + if (engine.GetLoadScriptError() != tonic::kNoError) { + last_error_ = engine.GetLoadScriptError(); + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + return; + } + + bool live = engine.UIIsolateHasLivePorts(); + if (prev_live_ && !live) { + last_error_ = engine.GetUIIsolateLastError(); + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + prev_live_ = live; + } + + tonic::DartErrorHandleType last_error() { return last_error_; } + + private: + fxl::RefPtr main_task_runner_; + bool prev_live_; + tonic::DartErrorHandleType last_error_; +}; + +int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { + switch (error) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } +} + +void RunNonInteractive(fxl::CommandLine initial_command_line, + bool run_forever) { + // This is a platform thread (i.e not one created by fml::Thread), so perform + // one time initialization. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + std::string bundle_path = ""; + initial_command_line.GetOptionValue( + FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); + + shell::Shell::InitStandalone(initial_command_line, + /* icu_data_path= */ "", + /* application_library_path= */ "", bundle_path); + + // Note that this task observer must be added after the observer that drains + // the microtask queue. + ScriptCompletionTaskObserver task_observer( + fml::MessageLoop::GetCurrent().GetTaskRunner()); + if (!run_forever) { + blink::Threads::UI()->PostTask([&task_observer] { + fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); + }); + } + + if (!shell::InitForTesting(initial_command_line)) { + shell::PrintUsage("flutter_tester"); + exit(EXIT_FAILURE); + return; + } + + fml::MessageLoop::GetCurrent().Run(); + + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + tonic::DartErrorHandleType error = + test_runner.platform_view().engine().GetLoadScriptError(); + if (error == tonic::kNoError) + error = task_observer.last_error(); + if (error == tonic::kNoError) { + fxl::AutoResetWaitableEvent latch; + blink::Threads::UI()->PostTask([&error, &latch] { + error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); + latch.Signal(); + }); + latch.Wait(); + } + + // The script has completed and the engine may not be in a clean state, + // so just stop the process. + exit(ConvertErrorTypeToExitCode(error)); +} + +} // namespace + +int main(int argc, char* argv[]) { + dart::bin::SetExecutableName(argv[0]); + dart::bin::SetExecutableArguments(argc - 1, argv); + + auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); + + if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { + shell::PrintUsage("flutter_tester"); + return EXIT_SUCCESS; + } + + bool run_forever = + command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); + RunNonInteractive(std::move(command_line), run_forever); + return EXIT_SUCCESS; +} diff --git a/shell/platform/win/BUILD.gn b/shell/platform/win/BUILD.gn new file mode 100644 index 0000000000000..b4a2fe5033c18 --- /dev/null +++ b/shell/platform/win/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright 2016 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. + +executable("win") { + output_name = "flutter_tester" + + sources = [ + "main_win.cc", + ] + + deps = [ + "//flutter/common", + "//flutter/flow", + "//flutter/fml", + "//flutter/shell/common", + "//flutter/shell/testing", + "//flutter/sky/engine/wtf", + "//garnet/public/lib/fxl", + "//third_party/dart/runtime/bin:embedded_dart_io", + "//third_party/dart/runtime:libdart_jit", + "//third_party/skia", + "//topaz/lib/tonic", + ] + + libs = [ + "iphlpapi.lib", + "Rpcrt4.lib" + ] +} diff --git a/shell/platform/win/main_win.cc b/shell/platform/win/main_win.cc new file mode 100644 index 0000000000000..c31c88ca915cb --- /dev/null +++ b/shell/platform/win/main_win.cc @@ -0,0 +1,142 @@ +// Copyright 2015 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. + +#include + +#include "flutter/common/threads.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/testing/test_runner.h" +#include "flutter/shell/testing/testing.h" +#include "lib/fxl/command_line.h" +#include "lib/tonic/dart_microtask_queue.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +namespace { + +// Exit codes used by the Dart command line tool. +const int kApiErrorExitCode = 253; +const int kCompilationErrorExitCode = 254; +const int kErrorExitCode = 255; + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver : public fml::TaskObserver { + public: + ScriptCompletionTaskObserver(fxl::RefPtr task_runner) + : main_task_runner_(std::move(task_runner)), + prev_live_(false), + last_error_(tonic::kNoError) {} + + void DidProcessTask() override { + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + shell::Engine& engine = test_runner.platform_view().engine(); + + if (engine.GetLoadScriptError() != tonic::kNoError) { + last_error_ = engine.GetLoadScriptError(); + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + return; + } + + bool live = engine.UIIsolateHasLivePorts(); + if (prev_live_ && !live) { + last_error_ = engine.GetUIIsolateLastError(); + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + prev_live_ = live; + } + + tonic::DartErrorHandleType last_error() { return last_error_; } + + private: + fxl::RefPtr main_task_runner_; + bool prev_live_; + tonic::DartErrorHandleType last_error_; +}; + +int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { + switch (error) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } +} + +void RunNonInteractive(fxl::CommandLine initial_command_line, + bool run_forever) { + // This is a platform thread (i.e not one created by fml::Thread), so perform + // one time initialization. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + std::string bundle_path = ""; + initial_command_line.GetOptionValue( + FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); + + shell::Shell::InitStandalone(initial_command_line, + /* icu_data_path= */ "", + /* application_library_path= */ "", bundle_path); + + // Note that this task observer must be added after the observer that drains + // the microtask queue. + ScriptCompletionTaskObserver task_observer( + fml::MessageLoop::GetCurrent().GetTaskRunner()); + if (!run_forever) { + blink::Threads::UI()->PostTask([&task_observer] { + fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); + }); + } + + if (!shell::InitForTesting(initial_command_line)) { + shell::PrintUsage("flutter_tester"); + ::ExitProcess(EXIT_FAILURE); + return; + } + + fml::MessageLoop::GetCurrent().Run(); + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + tonic::DartErrorHandleType error = + test_runner.platform_view().engine().GetLoadScriptError(); + if (error == tonic::kNoError) + error = task_observer.last_error(); + if (error == tonic::kNoError) { + fxl::AutoResetWaitableEvent latch; + blink::Threads::UI()->PostTask([&error, &latch] { + error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); + latch.Signal(); + }); + latch.Wait(); + } + + // The script has completed and the engine may not be in a clean state, + // so just stop the process. + ::ExitProcess(ConvertErrorTypeToExitCode(error)); +} + +} // namespace + +int main(int argc, char* argv[]) { + dart::bin::SetExecutableName(argv[0]); + dart::bin::SetExecutableArguments(argc - 1, argv); + + auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); + + if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { + shell::PrintUsage("flutter_tester"); + return EXIT_SUCCESS; + } + + bool run_forever = + command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); + RunNonInteractive(std::move(command_line), run_forever); + return EXIT_SUCCESS; +} diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index f11a3a2d07501..659c241cc49b8 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -2,30 +2,24 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -executable("testing") { - testonly = true - - output_name = "flutter_tester" - - public_configs = [ "$flutter_root:config" ] - +source_set("testing") { sources = [ - "tester_main.cc", + "platform_view_test.cc", + "platform_view_test.h", + "test_runner.cc", + "test_runner.h", + "testing.cc", + "testing.h", ] deps = [ - "$flutter_root/assets", "$flutter_root/common", - "$flutter_root/fml", "$flutter_root/shell/common", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:libdart_jit", - "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", - "//topaz/lib/tonic", ] - if (is_linux) { - ldflags = [ "-rdynamic" ] - } + public_configs = [ + "$flutter_root:config", + ] } diff --git a/shell/testing/platform_view_test.cc b/shell/testing/platform_view_test.cc new file mode 100644 index 0000000000000..a59684d31bc94 --- /dev/null +++ b/shell/testing/platform_view_test.cc @@ -0,0 +1,32 @@ +// Copyright 2016 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. + +#include "flutter/shell/testing/platform_view_test.h" + +#include "flutter/shell/common/null_rasterizer.h" +#include "flutter/shell/common/shell.h" + +namespace shell { + +PlatformViewTest::PlatformViewTest() + : PlatformView(std::unique_ptr(new NullRasterizer())) {} + +void PlatformViewTest::Attach() { + CreateEngine(); +} + +PlatformViewTest::~PlatformViewTest() = default; + +bool PlatformViewTest::ResourceContextMakeCurrent() { + return false; +} + +void PlatformViewTest::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) {} + +void PlatformViewTest::SetAssetBundlePath(const std::string& assets_directory) { +} + +} // namespace shell diff --git a/shell/testing/platform_view_test.h b/shell/testing/platform_view_test.h new file mode 100644 index 0000000000000..3612d0363ab58 --- /dev/null +++ b/shell/testing/platform_view_test.h @@ -0,0 +1,38 @@ +// Copyright 2016 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. + +#ifndef SHELL_TESTING_PLATFORM_VIEW_TEST_H_ +#define SHELL_TESTING_PLATFORM_VIEW_TEST_H_ + +#include "flutter/shell/common/platform_view.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace shell { + +class Shell; + +class PlatformViewTest : public PlatformView { + public: + PlatformViewTest(); + + ~PlatformViewTest(); + + virtual void Attach() override; + + bool ResourceContextMakeCurrent() override; + + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + + void SetAssetBundlePath(const std::string& assets_directory) override; + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewTest); +}; + +} // namespace shell + +#endif // SHELL_TESTING_PLATFORM_VIEW_TEST_H_ diff --git a/shell/testing/test_runner.cc b/shell/testing/test_runner.cc new file mode 100644 index 0000000000000..838b04120c773 --- /dev/null +++ b/shell/testing/test_runner.cc @@ -0,0 +1,48 @@ +// Copyright 2014 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. + +#include "flutter/shell/testing/test_runner.h" + +#include + +#include "flutter/common/threads.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/testing/platform_view_test.h" + +namespace shell { + +TestRunner::TestRunner() + : platform_view_(std::make_shared()) { + platform_view_->Attach(); + blink::ViewportMetrics metrics; + metrics.device_pixel_ratio = 3.0; + metrics.physical_width = 2400; // 800 at 3x resolution + metrics.physical_height = 1800; // 600 at 3x resolution + + blink::Threads::UI()->PostTask( + [ engine = platform_view_->engine().GetWeakPtr(), metrics ] { + if (engine) + engine->SetViewportMetrics(metrics); + }); +} + +TestRunner::~TestRunner() = default; + +TestRunner& TestRunner::Shared() { + static TestRunner* g_test_runner = nullptr; + if (!g_test_runner) + g_test_runner = new TestRunner(); + return *g_test_runner; +} + +void TestRunner::Run(const TestDescriptor& test) { + blink::Threads::UI()->PostTask( + [ engine = platform_view_->engine().GetWeakPtr(), test ] { + if (engine) + engine->RunBundleAndSource(std::string(), test.path, test.packages); + }); +} + +} // namespace shell diff --git a/shell/testing/test_runner.h b/shell/testing/test_runner.h new file mode 100644 index 0000000000000..8f303d7eb7683 --- /dev/null +++ b/shell/testing/test_runner.h @@ -0,0 +1,42 @@ +// Copyright 2015 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. + +#ifndef SHELL_TESTING_TEST_RUNNER_H_ +#define SHELL_TESTING_TEST_RUNNER_H_ + +#include +#include + +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace shell { + +class PlatformView; + +class TestRunner { + public: + static TestRunner& Shared(); + + struct TestDescriptor { + std::string path; + std::string packages; + }; + + void Run(const TestDescriptor& test); + + PlatformView& platform_view() { return *platform_view_; } + + private: + TestRunner(); + ~TestRunner(); + + std::shared_ptr platform_view_; + + FXL_DISALLOW_COPY_AND_ASSIGN(TestRunner); +}; + +} // namespace shell + +#endif // SHELL_TESTING_TEST_RUNNER_H_ diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc deleted file mode 100644 index a9e7bafc74d93..0000000000000 --- a/shell/testing/tester_main.cc +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2018 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 - -#include "flutter/assets/asset_manager.h" -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/fml/file.h" -#include "flutter/fml/message_loop.h" -#include "flutter/fml/paths.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/common/thread_host.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace shell { - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver { - public: - ScriptCompletionTaskObserver(Shell& shell, - fxl::RefPtr main_task_runner, - bool run_forever) - : engine_(shell.GetEngine()), - main_task_runner_(std::move(main_task_runner)), - run_forever_(run_forever) {} - - int GetExitCodeForLastError() const { - // Exit codes used by the Dart command line tool. - const int kApiErrorExitCode = 253; - const int kCompilationErrorExitCode = 254; - const int kErrorExitCode = 255; - switch (last_error_) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } - } - - void DidProcessTask() { - if (engine_) { - last_error_ = engine_->GetUIIsolateLastError(); - if (engine_->UIIsolateHasLivePorts()) { - // The UI isolate still has live ports and is running. Nothing to do - // just yet. - return; - } - } - - if (run_forever_) { - // We need this script to run forever. We have already recorded the last - // error. Keep going. - return; - } - - if (!has_terminated) { - // Only try to terminate the loop once. - has_terminated = true; - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - } - - private: - fml::WeakPtr engine_; - fxl::RefPtr main_task_runner_; - bool run_forever_ = false; - tonic::DartErrorHandleType last_error_ = tonic::kUnknownErrorType; - bool has_terminated = false; - - FXL_DISALLOW_COPY_AND_ASSIGN(ScriptCompletionTaskObserver); -}; - -int RunTester(const blink::Settings& settings, bool run_forever) { - const auto thread_label = "io.flutter.test"; - - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); - - // Setup a single threaded test runner configuration. - const blink::TaskRunners task_runners(thread_label, // dart thread label - current_task_runner, // platform - current_task_runner, // gpu - current_task_runner, // ui - current_task_runner // io - ); - - Shell::CreateCallback on_create_platform_view = - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }; - - Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - auto shell = Shell::Create(task_runners, // - settings, // - on_create_platform_view, // - on_create_rasterizer // - ); - - if (!shell || !shell->IsSetup()) { - FXL_LOG(ERROR) << "Could not setup the shell."; - return EXIT_FAILURE; - } - - auto isolate_configuration = IsolateConfiguration::CreateForSource( - settings.main_dart_file_path, settings.packages_file_path); - - if (!isolate_configuration) { - FXL_LOG(ERROR) << "Could create isolate configuration."; - return EXIT_FAILURE; - } - - auto asset_manager = fxl::MakeRefCounted(); - asset_manager->PushBack(std::make_unique( - fml::Duplicate(settings.assets_dir))); - asset_manager->PushBack( - std::make_unique(fml::OpenFile( - settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); - - RunConfiguration run_configuration(std::move(isolate_configuration), - std::move(asset_manager)); - - // The script completion task observer that will be installed on the UI thread - // that watched if the engine has any live ports. - ScriptCompletionTaskObserver completion_observer( - *shell, // a valid shell - fml::MessageLoop::GetCurrent() - .GetTaskRunner(), // the message loop to terminate - run_forever // should the exit be ignored - ); - - bool engine_did_run = false; - - shell->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [&completion_observer, engine = shell->GetEngine(), - config = std::move(run_configuration), &engine_did_run]() mutable { - fml::MessageLoop::GetCurrent().AddTaskObserver( - reinterpret_cast(&completion_observer), - [&completion_observer]() { completion_observer.DidProcessTask(); }); - if (engine->Run(std::move(config))) { - engine_did_run = true; - - blink::ViewportMetrics metrics; - metrics.device_pixel_ratio = 3.0; - metrics.physical_width = 2400; // 800 at 3x resolution - metrics.physical_height = 1800; // 600 at 3x resolution - engine->SetViewportMetrics(metrics); - - } else { - FXL_DLOG(ERROR) << "Could not launch the engine with configuration."; - } - })); - - // Run the message loop and wait for the script to do its thing. - fml::MessageLoop::GetCurrent().Run(); - - // Cleanup the completion observer synchronously as it is living on the - // stack. - fxl::AutoResetWaitableEvent latch; - fml::TaskRunner::RunNowOrPostTask( - shell->GetTaskRunners().GetUITaskRunner(), - [&latch, &completion_observer] { - fml::MessageLoop::GetCurrent().RemoveTaskObserver( - reinterpret_cast(&completion_observer)); - latch.Signal(); - }); - latch.Wait(); - - if (!engine_did_run) { - // If the engine itself didn't have a chance to run, there is no point in - // asking it if there was an error. Signal a failure unconditionally. - return EXIT_FAILURE; - } - - return completion_observer.GetExitCodeForLastError(); -} - -} // namespace shell - -int main(int argc, char* argv[]) { - dart::bin::SetExecutableName(argv[0]); - dart::bin::SetExecutableArguments(argc - 1, argv); - - auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); - - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { - shell::PrintUsage("flutter_tester"); - return EXIT_SUCCESS; - } - - auto settings = shell::SettingsFromCommandLine(command_line); - if (command_line.positional_args().size() > 0) { - // The tester may not use the switch for the main dart file path. Specifying - // it as a positional argument instead. - settings.main_dart_file_path = command_line.positional_args()[0]; - } - - if (settings.main_dart_file_path.size() == 0) { - FXL_LOG(ERROR) << "Main dart file path not specified."; - return EXIT_FAILURE; - } - - settings.icu_data_path = "icudtl.dat"; - - settings.kernel_snapshot_path = - fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); - - // The tools that read logs get confused if there is a log tag specified. - settings.log_tag = ""; - - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - - return shell::RunTester( - settings, - command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever))); -} diff --git a/shell/testing/testing.cc b/shell/testing/testing.cc new file mode 100644 index 0000000000000..13a3ab5be3d93 --- /dev/null +++ b/shell/testing/testing.cc @@ -0,0 +1,24 @@ +// Copyright 2015 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. + +#include "flutter/shell/testing/testing.h" + +#include "flutter/shell/common/switches.h" +#include "flutter/shell/testing/test_runner.h" + +namespace shell { + +bool InitForTesting(const fxl::CommandLine& command_line) { + TestRunner::TestDescriptor test; + test.packages = command_line.GetOptionValueWithDefault( + FlagForSwitch(Switch::Packages), ""); + auto args = command_line.positional_args(); + if (args.empty()) + return false; + test.path = args[0]; + TestRunner::Shared().Run(test); + return true; +} + +} // namespace shell diff --git a/shell/testing/testing.h b/shell/testing/testing.h new file mode 100644 index 0000000000000..99f8b4fe983de --- /dev/null +++ b/shell/testing/testing.h @@ -0,0 +1,16 @@ +// Copyright 2015 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. + +#ifndef SHELL_TESTING_TESTING_H_ +#define SHELL_TESTING_TESTING_H_ + +#include "lib/fxl/command_line.h" + +namespace shell { + +bool InitForTesting(const fxl::CommandLine& command_line); + +} // namespace shell + +#endif // SHELL_TESTING_TESTING_H_ diff --git a/sky/engine/platform/SharedBuffer.cpp b/sky/engine/platform/SharedBuffer.cpp index bc94f22e97ce6..8577ab16f2938 100644 --- a/sky/engine/platform/SharedBuffer.cpp +++ b/sky/engine/platform/SharedBuffer.cpp @@ -26,6 +26,7 @@ #include "flutter/sky/engine/platform/SharedBuffer.h" +#include "flutter/common/threads.h" #include "flutter/sky/engine/public/platform/Platform.h" #include "flutter/sky/engine/wtf/unicode/UTF8.h" #include "flutter/sky/engine/wtf/unicode/Unicode.h" diff --git a/sky/engine/platform/fonts/FontFallbackList.cpp b/sky/engine/platform/fonts/FontFallbackList.cpp index 4786d65e0d7ad..177f161adaa7e 100644 --- a/sky/engine/platform/fonts/FontFallbackList.cpp +++ b/sky/engine/platform/fonts/FontFallbackList.cpp @@ -37,11 +37,6 @@ namespace blink { -bool gUseTestFonts = false; -void FontFallbackList::SetUseTestFonts(bool useTestFonts) { - gUseTestFonts = useTestFonts; -} - FontFallbackList::FontFallbackList() : m_pageZero(0), m_cachedPrimarySimpleFontData(0), @@ -50,8 +45,7 @@ FontFallbackList::FontFallbackList() m_familyIndex(0), m_generation(FontCache::fontCache()->generation()), m_pitch(UnknownPitch), - m_hasLoadingFallback(false), - m_useTestFonts(gUseTestFonts) {} + m_hasLoadingFallback(false) {} void FontFallbackList::invalidate(PassRefPtr fontSelector) { releaseFontData(); @@ -199,7 +193,7 @@ PassRefPtr FontFallbackList::getFontData( const FontFamily* currFamily = startFamily; while (currFamily && !result) { familyIndex++; - if (currFamily->family().length() || m_useTestFonts) { + if (currFamily->family().length() || Settings::Get().use_test_fonts) { if (m_fontSelector) result = m_fontSelector->getFontData(fontDescription, currFamily->family()); diff --git a/sky/engine/platform/fonts/FontFallbackList.h b/sky/engine/platform/fonts/FontFallbackList.h index 3331387968edc..fdac27e5013bd 100644 --- a/sky/engine/platform/fonts/FontFallbackList.h +++ b/sky/engine/platform/fonts/FontFallbackList.h @@ -103,8 +103,6 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { m_pageZero = node; } - static void SetUseTestFonts(bool useTestFonts); - private: FontFallbackList(); @@ -127,7 +125,6 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { unsigned short m_generation; mutable unsigned m_pitch : 3; // Pitch mutable bool m_hasLoadingFallback : 1; - bool m_useTestFonts = false; }; } // namespace blink diff --git a/sky/engine/web/Sky.cpp b/sky/engine/web/Sky.cpp index 52c6243743d7b..e90539e96cf87 100644 --- a/sky/engine/web/Sky.cpp +++ b/sky/engine/web/Sky.cpp @@ -53,6 +53,56 @@ namespace blink { +namespace { + +void didProcessTask() { + tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); + // FIXME: Report memory usage to dart? +} + +#if defined(OS_FUCHSIA) + +void addMessageLoopObservers() { + fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback(didProcessTask); +} + +void removeMessageLoopObservers() { + fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); +} + +#else // defined(OS_FUCHSIA) + +class RunMicrotasksTaskObserver : public fml::TaskObserver { + public: + RunMicrotasksTaskObserver() = default; + + ~RunMicrotasksTaskObserver() override = default; + + void DidProcessTask() override { didProcessTask(); } +}; + +// FIXME(chinmaygarde): The awkward use of the global here is be cause we cannot +// introduce the fml::TaskObserver subclass in common code because Fuchsia does +// not support the same. Unify the API and remove hack. +static RunMicrotasksTaskObserver* g_run_microtasks_task_observer = nullptr; + +void addMessageLoopObservers() { + g_run_microtasks_task_observer = new RunMicrotasksTaskObserver(); + fml::MessageLoop::GetCurrent().AddTaskObserver( + g_run_microtasks_task_observer); +} + +void removeMessageLoopObservers() { + fml::MessageLoop::GetCurrent().RemoveTaskObserver( + g_run_microtasks_task_observer); + delete g_run_microtasks_task_observer; + g_run_microtasks_task_observer = nullptr; +} + +#endif // defined(OS_FUCHSIA) + +} // namespace + // Make sure we are not re-initialized in the same address space. // Doing so may cause hard to reproduce crashes. static bool s_webKitInitialized = false; @@ -80,9 +130,15 @@ void InitEngine(Platform* platform) { // the initialization thread-safe, but given that so many code paths use // this, initializing this lazily probably doesn't buy us much. WTF::UTF8Encoding(); + + tonic::DartMicrotaskQueue::StartForCurrentThread(); + addMessageLoopObservers(); } void ShutdownEngine() { + removeMessageLoopObservers(); + tonic::DartMicrotaskQueue::GetForCurrentThread()->Destroy(); + // FIXME: Shutdown dart? CoreInitializer::shutdown(); diff --git a/synchronization/BUILD.gn b/synchronization/BUILD.gn index 9ee7680cc1160..977a571c8da30 100644 --- a/synchronization/BUILD.gn +++ b/synchronization/BUILD.gn @@ -4,13 +4,16 @@ source_set("synchronization") { sources = [ + "debug_thread_checker.h", "pipeline.cc", "pipeline.h", "semaphore.cc", "semaphore.h", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] public_deps = [ "$flutter_root/glue", diff --git a/synchronization/debug_thread_checker.h b/synchronization/debug_thread_checker.h new file mode 100644 index 0000000000000..69614eb89d217 --- /dev/null +++ b/synchronization/debug_thread_checker.h @@ -0,0 +1,25 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ +#define FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ + +#ifndef NDEBUG + +#include +#include "lib/fxl/synchronization/thread_checker.h" + +#define FLUTTER_THREAD_CHECKER_DECLARE(x) ::fxl::ThreadChecker x; + +#define FLUTTER_THREAD_CHECKER_CHECK(x) FXL_CHECK(x.IsCreationThreadCurrent()); + +#else // NDEBUG + +#define FLUTTER_THREAD_CHECKER_DECLARE(x) + +#define FLUTTER_THREAD_CHECKER_CHECK(x) + +#endif // NDEBUG + +#endif // FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ diff --git a/synchronization/semaphore.cc b/synchronization/semaphore.cc index 4dc5f6220e350..c6e0bdf9e2d53 100644 --- a/synchronization/semaphore.cc +++ b/synchronization/semaphore.cc @@ -15,12 +15,9 @@ namespace flutter { class PlatformSemaphore { public: explicit PlatformSemaphore(uint32_t count) - : _sem(dispatch_semaphore_create(count)), _initial(count) {} + : _sem(dispatch_semaphore_create(count)) {} ~PlatformSemaphore() { - for (uint32_t i = 0; i < _initial; ++i) { - Signal(); - } if (_sem != nullptr) { dispatch_release(reinterpret_cast(_sem)); _sem = nullptr; @@ -45,7 +42,6 @@ class PlatformSemaphore { private: dispatch_semaphore_t _sem; - const uint32_t _initial; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; diff --git a/testing/BUILD.gn b/testing/BUILD.gn index a65311bfaeb7c..3927e71cfc0e4 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -9,13 +9,9 @@ source_set("testing") { "$flutter_root/testing/run_all_unittests.cc", "$flutter_root/testing/testing.cc", "$flutter_root/testing/testing.h", - "$flutter_root/testing/thread_test.cc", - "$flutter_root/testing/thread_test.h", ] public_deps = [ - "$flutter_root/fml", - "//garnet/public/lib/fxl", "//third_party/googletest:gtest", ] diff --git a/testing/thread_test.cc b/testing/thread_test.cc deleted file mode 100644 index 1306f37678fbe..0000000000000 --- a/testing/thread_test.cc +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2017 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/testing/thread_test.h" - -namespace testing { - -void ThreadTest::SetUp() { - thread_ = std::make_unique(); - thread_task_runner_ = thread_->GetTaskRunner(); - - fml::MessageLoop::EnsureInitializedForCurrentThread(); - current_task_runner_ = fml::MessageLoop::GetCurrent().GetTaskRunner(); -} - -void ThreadTest::TearDown() { - thread_task_runner_ = nullptr; - thread_ = nullptr; - current_task_runner_ = nullptr; -} - -fxl::RefPtr ThreadTest::GetCurrentTaskRunner() { - return current_task_runner_; -} - -fxl::RefPtr ThreadTest::GetThreadTaskRunner() { - return thread_task_runner_; -} - -} // namespace testing diff --git a/testing/thread_test.h b/testing/thread_test.h deleted file mode 100644 index 511d09c978858..0000000000000 --- a/testing/thread_test.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 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_TESTING_THREAD_TEST_H_ -#define FLUTTER_TESTING_THREAD_TEST_H_ - -#include - -#include "flutter/fml/message_loop.h" -#include "flutter/fml/task_runner.h" -#include "flutter/fml/thread.h" -#include "gtest/gtest.h" -#include "lib/fxl/macros.h" - -namespace testing { - -class ThreadTest : public Test { - public: - fxl::RefPtr GetCurrentTaskRunner(); - - fxl::RefPtr GetThreadTaskRunner(); - - protected: - void SetUp() override; - - void TearDown() override; - - private: - std::unique_ptr thread_; - fxl::RefPtr thread_task_runner_; - fxl::RefPtr current_task_runner_; -}; - -} // namespace testing - -#endif // FLUTTER_TESTING_THREAD_TEST_H_ diff --git a/tools/gn b/tools/gn index b4b15f99f1d4f..ea7071ac0a474 100755 --- a/tools/gn +++ b/tools/gn @@ -232,10 +232,6 @@ def main(argv): # On the Mac, also generate Xcode projects for ease of editing. command.append('--ide=xcode') - if sys.platform.startswith('win'): - # On Windows, also generate Visual Studio project for ease of editing. - command.append('--ide=vs') - gn_args = to_command_line(to_gn_args(args)) out_dir = get_out_dir(args) print "gn gen --check in %s" % out_dir diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index b15c608425095..8749f6880dbf4 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -1059,10 +1059,14 @@ USED LICENSES: ==================================================================================================== LIBRARY: engine LIBRARY: txt -ORIGIN: ../../../flutter/content_handler/session_connection.cc + ../../../LICENSE +ORIGIN: ../../../flutter/content_handler/service_protocol_hooks.cc + ../../../LICENSE TYPE: LicenseType.bsd +FILE: ../../../flutter/content_handler/service_protocol_hooks.cc +FILE: ../../../flutter/content_handler/service_protocol_hooks.h FILE: ../../../flutter/content_handler/session_connection.cc FILE: ../../../flutter/content_handler/session_connection.h +FILE: ../../../flutter/content_handler/vulkan_rasterizer.cc +FILE: ../../../flutter/content_handler/vulkan_rasterizer.h FILE: ../../../flutter/content_handler/vulkan_surface_producer.cc FILE: ../../../flutter/content_handler/vulkan_surface_producer.h FILE: ../../../flutter/flow/debug_print.cc @@ -1122,6 +1126,7 @@ FILE: ../../../flutter/fml/platform/win/mapping_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.h FILE: ../../../flutter/fml/platform/win/paths_win.cc +FILE: ../../../flutter/fml/task_observer.h FILE: ../../../flutter/fml/task_runner.cc FILE: ../../../flutter/fml/task_runner.h FILE: ../../../flutter/fml/thread.cc @@ -1137,10 +1142,13 @@ FILE: ../../../flutter/lib/ui/painting/codec.cc FILE: ../../../flutter/lib/ui/painting/codec.h FILE: ../../../flutter/lib/ui/painting/frame_info.cc FILE: ../../../flutter/lib/ui/painting/frame_info.h +FILE: ../../../flutter/lib/ui/painting/utils.cc FILE: ../../../flutter/lib/ui/painting/vertices.cc FILE: ../../../flutter/lib/ui/painting/vertices.h FILE: ../../../flutter/lib/ui/text/font_collection.cc FILE: ../../../flutter/lib/ui/text/font_collection.h +FILE: ../../../flutter/shell/common/null_platform_view.cc +FILE: ../../../flutter/shell/common/null_platform_view.h FILE: ../../../flutter/shell/gpu/gpu_surface_software.cc FILE: ../../../flutter/shell/gpu/gpu_surface_software.h FILE: ../../../flutter/shell/platform/android/android_external_texture_gl.cc @@ -1187,6 +1195,8 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandar FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_standard_codec_unittest.mm FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.h FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -1553,6 +1563,7 @@ FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc FILE: ../../../flutter/shell/platform/android/apk_asset_provider.cc FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/JSONUtil.java FILE: ../../../flutter/shell/platform/darwin/desktop/Info.plist +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_mac.xib FILE: ../../../flutter/shell/platform/darwin/ios/framework/Flutter.podspec FILE: ../../../flutter/shell/platform/darwin/ios/framework/Info.plist FILE: ../../../flutter/shell/platform/darwin/ios/framework/module.modulemap @@ -1627,48 +1638,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/assets/asset_manager.cc + ../../../LICENSE +ORIGIN: ../../../flutter/assets/asset_provider.h + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/assets/asset_manager.cc -FILE: ../../../flutter/assets/asset_manager.h -FILE: ../../../flutter/assets/asset_resolver.h -FILE: ../../../flutter/common/task_runners.cc -FILE: ../../../flutter/common/task_runners.h -FILE: ../../../flutter/flow/layers/default_layer_builder.cc -FILE: ../../../flutter/flow/layers/default_layer_builder.h -FILE: ../../../flutter/flow/layers/layer_builder.cc -FILE: ../../../flutter/flow/layers/layer_builder.h -FILE: ../../../flutter/flow/skia_gpu_object.cc -FILE: ../../../flutter/flow/skia_gpu_object.h -FILE: ../../../flutter/runtime/dart_isolate.cc -FILE: ../../../flutter/runtime/dart_isolate.h -FILE: ../../../flutter/runtime/dart_isolate_unittests.cc -FILE: ../../../flutter/runtime/dart_snapshot.cc -FILE: ../../../flutter/runtime/dart_snapshot.h -FILE: ../../../flutter/runtime/dart_snapshot_buffer.cc -FILE: ../../../flutter/runtime/dart_snapshot_buffer.h -FILE: ../../../flutter/runtime/dart_vm.cc -FILE: ../../../flutter/runtime/dart_vm.h -FILE: ../../../flutter/runtime/dart_vm_unittests.cc -FILE: ../../../flutter/runtime/service_protocol.cc -FILE: ../../../flutter/runtime/service_protocol.h -FILE: ../../../flutter/shell/common/io_manager.cc -FILE: ../../../flutter/shell/common/io_manager.h -FILE: ../../../flutter/shell/common/run_configuration.cc -FILE: ../../../flutter/shell/common/run_configuration.h -FILE: ../../../flutter/shell/common/shell_unittests.cc -FILE: ../../../flutter/shell/common/thread_host.cc -FILE: ../../../flutter/shell/common/thread_host.h -FILE: ../../../flutter/shell/platform/darwin/common/command_line.h -FILE: ../../../flutter/shell/platform/darwin/common/command_line.mm -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.mm -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h -FILE: ../../../flutter/shell/platform/embedder/embedder.h -FILE: ../../../flutter/shell/platform/embedder/embedder_engine.cc -FILE: ../../../flutter/shell/platform/embedder/embedder_engine.h +FILE: ../../../flutter/assets/asset_provider.h +FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart +FILE: ../../../flutter/lib/ui/painting/image_encoding.cc +FILE: ../../../flutter/lib/ui/painting/image_encoding.h +FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm ---------------------------------------------------------------------------------------------------- -Copyright 2017 The Flutter Authors. All rights reserved. +Copyright 2018 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1703,10 +1683,23 @@ ORIGIN: ../../../flutter/assets/directory_asset_bundle.cc + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/assets/directory_asset_bundle.cc FILE: ../../../flutter/assets/directory_asset_bundle.h +FILE: ../../../flutter/assets/unzipper_provider.cc +FILE: ../../../flutter/assets/unzipper_provider.h FILE: ../../../flutter/assets/zip_asset_store.cc FILE: ../../../flutter/assets/zip_asset_store.h FILE: ../../../flutter/common/settings.cc FILE: ../../../flutter/common/settings.h +FILE: ../../../flutter/common/threads.cc +FILE: ../../../flutter/common/threads.h +FILE: ../../../flutter/content_handler/app.cc +FILE: ../../../flutter/content_handler/app.h +FILE: ../../../flutter/content_handler/application_controller_impl.cc +FILE: ../../../flutter/content_handler/application_controller_impl.h +FILE: ../../../flutter/content_handler/main.cc +FILE: ../../../flutter/content_handler/rasterizer.cc +FILE: ../../../flutter/content_handler/rasterizer.h +FILE: ../../../flutter/content_handler/runtime_holder.cc +FILE: ../../../flutter/content_handler/runtime_holder.h FILE: ../../../flutter/flow/export_node.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.h @@ -1714,6 +1707,7 @@ FILE: ../../../flutter/flow/layers/child_scene_layer.cc FILE: ../../../flutter/flow/layers/child_scene_layer.h FILE: ../../../flutter/flow/layers/shader_mask_layer.cc FILE: ../../../flutter/flow/layers/shader_mask_layer.h +FILE: ../../../flutter/flow/process_info.h FILE: ../../../flutter/flow/raster_cache.cc FILE: ../../../flutter/flow/raster_cache.h FILE: ../../../flutter/flow/scene_update_context.cc @@ -1724,6 +1718,9 @@ FILE: ../../../flutter/glue/stack_trace_fuchsia.cc FILE: ../../../flutter/glue/trace_event.h FILE: ../../../flutter/lib/ui/painting/image_filter.cc FILE: ../../../flutter/lib/ui/painting/image_filter.h +FILE: ../../../flutter/lib/ui/painting/resource_context.cc +FILE: ../../../flutter/lib/ui/painting/resource_context.h +FILE: ../../../flutter/lib/ui/painting/utils.h FILE: ../../../flutter/lib/ui/semantics.dart FILE: ../../../flutter/lib/ui/semantics/semantics_node.cc FILE: ../../../flutter/lib/ui/semantics/semantics_node.h @@ -1745,13 +1742,18 @@ FILE: ../../../flutter/runtime/asset_font_selector.cc FILE: ../../../flutter/runtime/asset_font_selector.h FILE: ../../../flutter/runtime/embedder_resources.cc FILE: ../../../flutter/runtime/embedder_resources.h -FILE: ../../../flutter/runtime/fixtures/simple_main.dart +FILE: ../../../flutter/runtime/runtime_init.cc +FILE: ../../../flutter/runtime/runtime_init.h FILE: ../../../flutter/runtime/start_up.cc FILE: ../../../flutter/runtime/start_up.h FILE: ../../../flutter/runtime/test_font_data.cc FILE: ../../../flutter/runtime/test_font_data.h FILE: ../../../flutter/runtime/test_font_selector.cc FILE: ../../../flutter/runtime/test_font_selector.h +FILE: ../../../flutter/shell/common/null_rasterizer.cc +FILE: ../../../flutter/shell/common/null_rasterizer.h +FILE: ../../../flutter/shell/common/platform_view_service_protocol.cc +FILE: ../../../flutter/shell/common/platform_view_service_protocol.h FILE: ../../../flutter/shell/common/skia_event_tracer_impl.h FILE: ../../../flutter/shell/common/surface.cc FILE: ../../../flutter/shell/common/surface.h @@ -1780,6 +1782,8 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/view/VsyncWaiter.java FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.cc FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.mm +FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.cc +FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.h FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h @@ -1788,6 +1792,8 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterMacros FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h @@ -1810,6 +1816,7 @@ FILE: ../../../flutter/sky/engine/platform/text/ICUError.cpp FILE: ../../../flutter/sky/engine/platform/text/ICUError.h FILE: ../../../flutter/sky/engine/platform/text/TextBox.h FILE: ../../../flutter/sky/packages/flutter_services/lib/empty.dart +FILE: ../../../flutter/synchronization/debug_thread_checker.h FILE: ../../../flutter/synchronization/pipeline.cc FILE: ../../../flutter/synchronization/pipeline.h FILE: ../../../flutter/synchronization/semaphore.cc @@ -1877,68 +1884,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/content_handler/application.cc + ../../../garnet/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../flutter/content_handler/application.cc -FILE: ../../../flutter/content_handler/application.h -FILE: ../../../flutter/content_handler/application_runner.cc -FILE: ../../../flutter/content_handler/application_runner.h -FILE: ../../../flutter/content_handler/compositor_context.cc -FILE: ../../../flutter/content_handler/compositor_context.h -FILE: ../../../flutter/content_handler/engine.cc -FILE: ../../../flutter/content_handler/engine.h -FILE: ../../../flutter/content_handler/isolate_configurator.cc -FILE: ../../../flutter/content_handler/isolate_configurator.h -FILE: ../../../flutter/content_handler/main.cc -FILE: ../../../flutter/content_handler/platform_view.cc -FILE: ../../../flutter/content_handler/platform_view.h -FILE: ../../../flutter/content_handler/surface.cc -FILE: ../../../flutter/content_handler/surface.h -FILE: ../../../flutter/content_handler/task_observers.cc -FILE: ../../../flutter/content_handler/task_observers.h -FILE: ../../../flutter/content_handler/unique_fdio_ns.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart + ../../../LICENSE +ORIGIN: ../../../flutter/flow/layers/default_layer_builder.cc + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart -FILE: ../../../flutter/lib/ui/painting/image_encoding.cc -FILE: ../../../flutter/lib/ui/painting/image_encoding.h -FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +FILE: ../../../flutter/flow/layers/default_layer_builder.cc +FILE: ../../../flutter/flow/layers/default_layer_builder.h +FILE: ../../../flutter/flow/layers/layer_builder.cc +FILE: ../../../flutter/flow/layers/layer_builder.h +FILE: ../../../flutter/shell/platform/embedder/embedder.h ---------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. +Copyright 2017 The Flutter Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -2003,62 +1957,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../flutter/fml/file.h -FILE: ../../../flutter/fml/macros.h -FILE: ../../../flutter/fml/mapping.cc -FILE: ../../../flutter/fml/native_library.h -FILE: ../../../flutter/fml/paths.cc -FILE: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc -FILE: ../../../flutter/fml/platform/posix/file_posix.cc -FILE: ../../../flutter/fml/platform/posix/native_library_posix.cc -FILE: ../../../flutter/fml/platform/win/file_win.cc -FILE: ../../../flutter/fml/platform/win/native_library_win.cc -FILE: ../../../flutter/fml/platform/win/wstring_conversion.h -FILE: ../../../flutter/fml/unique_fd.cc -FILE: ../../../flutter/fml/unique_fd.h -FILE: ../../../flutter/fml/unique_object.h -FILE: ../../../flutter/shell/common/isolate_configuration.cc -FILE: ../../../flutter/shell/common/isolate_configuration.h -FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc -FILE: ../../../flutter/shell/platform/android/android_shell_holder.h -FILE: ../../../flutter/shell/platform/android/platform_message_response_android.cc -FILE: ../../../flutter/shell/platform/android/platform_message_response_android.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: engine ORIGIN: ../../../flutter/lib/ui/painting/image.cc + ../../../LICENSE @@ -9975,6 +9873,10 @@ FILE: ../../../flutter/lib/ui/window.dart FILE: ../../../flutter/lib/ui/window/pointer_data.cc FILE: ../../../flutter/lib/ui/window/pointer_data_packet.cc FILE: ../../../flutter/lib/ui/window/window.cc +FILE: ../../../flutter/runtime/dart_controller.cc +FILE: ../../../flutter/runtime/dart_controller.h +FILE: ../../../flutter/runtime/dart_init.cc +FILE: ../../../flutter/runtime/dart_init.h FILE: ../../../flutter/runtime/dart_service_isolate.cc FILE: ../../../flutter/runtime/dart_service_isolate.h FILE: ../../../flutter/runtime/platform_impl.cc @@ -9994,9 +9896,13 @@ FILE: ../../../flutter/shell/common/rasterizer.cc FILE: ../../../flutter/shell/common/rasterizer.h FILE: ../../../flutter/shell/common/shell.cc FILE: ../../../flutter/shell/common/shell.h +FILE: ../../../flutter/shell/common/tracing_controller.cc +FILE: ../../../flutter/shell/common/tracing_controller.h FILE: ../../../flutter/shell/common/vsync_waiter.cc FILE: ../../../flutter/shell/common/vsync_waiter.h FILE: ../../../flutter/shell/common/vsync_waiter_fallback.h +FILE: ../../../flutter/shell/gpu/gpu_rasterizer.cc +FILE: ../../../flutter/shell/gpu/gpu_rasterizer.h FILE: ../../../flutter/shell/platform/android/AndroidManifest.xml FILE: ../../../flutter/shell/platform/android/flutter_main.cc FILE: ../../../flutter/shell/platform/android/flutter_main.h @@ -10009,6 +9915,12 @@ FILE: ../../../flutter/shell/platform/android/library_loader.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h +FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.h +FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.mm +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.h +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.m +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.h +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.mm FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.h FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.mm FILE: ../../../flutter/shell/platform/darwin/desktop/main_mac.mm @@ -10018,6 +9930,8 @@ FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.cc FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +FILE: ../../../flutter/shell/platform/linux/main_linux.cc +FILE: ../../../flutter/shell/platform/win/main_win.cc FILE: ../../../flutter/sky/engine/wtf/Allocator.h FILE: ../../../flutter/sky/engine/wtf/MakeUnique.h ---------------------------------------------------------------------------------------------------- @@ -10054,7 +9968,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: engine ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/fml/memory/thread_checker.h FILE: ../../../flutter/fml/memory/weak_ptr.h FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc FILE: ../../../flutter/fml/memory/weak_ptr_internal.h @@ -10088,4 +10001,4 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -Total license count: 218 +Total license count: 216 From 8cd27273351ea6e2fef0b3801fe759a8fbe4d162 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Tue, 10 Apr 2018 15:32:35 -0700 Subject: [PATCH 0080/1190] Revert "Roll dart to 7764e6962e22afcf4b58c4e3cef3147330f3c884. (#4960)" (#4965) This reverts commit 31c5bb4272f608c93802c60ad527742d16a93e6d as it breaks ios_debug_arm build https://build.chromium.org/p/client.flutter/builders/Mac%20Engine/builds/2573/steps/build%20ios_debug_arm/logs/stdio --- DEPS | 8 ++++---- tools/licenses/lib/main.dart | 1 - travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/DEPS b/DEPS index 30a88e2b6a355..aa3dc7026f0e5 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '7764e6962e22afcf4b58c4e3cef3147330f3c884', + 'dart_revision': 'ef926f98f525b085e1488be8c42b1c3f0a24c50d', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -46,7 +46,7 @@ vars = { 'dart_convert_tag': '2.0.1', 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', - 'dart_dart2js_info_tag': '0.5.6', + 'dart_dart2js_info_tag': '0.5.5+1', 'dart_dart_style_tag': '1.0.10', 'dart_dartdoc_tag': 'v0.18.1', 'dart_fixnum_tag': '0.10.5', @@ -60,7 +60,7 @@ vars = { 'dart_intl_tag': '0.15.2', 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.47', + 'dart_linter_tag': '0.1.46', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', @@ -76,7 +76,7 @@ vars = { 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', - 'dart_pub_semver_tag': '1.3.6', + 'dart_pub_semver_tag': '1.3.4', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index 2cf747123ed40..e75c6c171958e 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -1809,7 +1809,6 @@ class RepositorySkiaThirdPartyDirectory extends RepositoryGenericThirdPartyDirec bool shouldRecurse(fs.IoNode entry) { return entry.name != 'giflib' // contains nothing that ends up in the binary executable && entry.name != 'freetype' // we use our own version - && entry.name != 'freetype2' // we use our own version && entry.name != 'icu' // we use our own version && entry.name != 'libjpeg-turbo' // we use our own version && entry.name != 'libpng' // we use our own version diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7d9f7ce6b8916..a7c8651437843 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: bea26d7863b6f1cfa1d0c0ae3775bf93 +Signature: 5e7a29bc2be55a7311df8f5a7dff2d34 UNUSED LICENSES: From ed303c628fe4b322529f8cf01ecb38135a2bab73 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Tue, 10 Apr 2018 17:54:02 -0700 Subject: [PATCH 0081/1190] Roll dart sdk again. Previous roll required 23ae4fa098 revert. (#4966) * Roll dart sdk again. Previous roll required 23ae4fa098 revert. Changes since last roll: ``` 23ae4fa098 Revert "[VM] Reduce Smi size to 32 bit on 64 bit platforms" 6ab6d1eda9 Suppress fromRect its only available in DOMRect and not in ClientRect - will open bug to fix this issue. f4621b1898 [tests hot-reload] Remove obsolete crash entry in status file (issue #31660). f3cec061eb Capture type variables in global NSM stubs 2247843f48 Update checked-in SDKs to 2.0.0-dev.47.0 34be5de0c7 Fixed _DomRect class to map to both ClientRect and DOMRect for browser backward compat. 5c508ff785 Update more IdentifierContext type reference recovery 8054721512 Move DeclaredVariables to a better location 3851591642 [infra] Keep comments intact when updating status files. 7764e6962e Initial API to build analysis contexts (replaces ContextLocator.locateContexts) 5ea271bb01 Clean up documentation of implicit new/const insertions tests. cf93009caf Removed the magic const feature from implicit-creation.md bd39320b3b Recover from error on undefined continue label. 5d89a1ac32 Add tests for mixin application constructor forwarding. e6962790a1 Use import URIs when invalidating files 23c59bd819 Fix compare_failures 290cc58e71 Use actual receiver when error-wrapping a null-aware property get. 34763bc4c9 Reland "[VM] Introduction of type testing stubs - Part 1-4" a86b864fa9 Handle updated .packages in incremental compiler f555ae505a Trust type annotations in strong mode 0a4a3bed68 When cloning YieldStatement, copy the flags 91bbc798fa Skip abstract forwarding stubs 7689dc9e06 Bring in the latest pub_semver f71d204185 Fix expected type in substByContext 5e99872770 Improve missing/invalid type reference recovery 899dbe4dae Forward type arguments in one-shot interceptors. 1fd3011f47 dart2js: Add more whole-program information to dump-info 5e23c2843d Revert "[infra] Temporarily disable Windows SDK builder on CQ" 2471888d4a Serialize any MethodInvocation as possible const. b430570364 dart2js: handle constant casts with type variable substitutions 3575b810b3 Only add const in a constant context (issue 32819) 09f7d2aee5 dart2js: naive support for instantiations in constants - ignore the actual instantiation 4dd5e6e6ad js_runtime: fix _JsonMap keys list type 71ffe976a9 Correctly handle constant fields when computing constness (take 2) d58b0e2d44 [VM] Mark bigint test slow after small Smi change 1e997ee6b7 Revert "Reland "[VM] Introduction of type testing stubs - Part 1-4"" 00097adce0 Remove reference to deprecated setter cb065a116f [infra] Update checked-in SDK version to 2.0.0-dev.46.0 0e9a77a360 [VM] Reduce Smi size to 32 bit on 64 bit platforms 34bfefd508 [gardening] Update status file 969c0de335 Avoid crash on EOF error in file with Windows line encoding 8054409a02 Reland "[VM] Introduction of type testing stubs - Part 1-4" ``` * Update license hash --- DEPS | 8 ++++---- tools/licenses/lib/main.dart | 1 + travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index aa3dc7026f0e5..9801e0fc4de80 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'ef926f98f525b085e1488be8c42b1c3f0a24c50d', + 'dart_revision': '23ae4fa098a1c2011b72f5ad4d00383e1ac10a59', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -46,7 +46,7 @@ vars = { 'dart_convert_tag': '2.0.1', 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', - 'dart_dart2js_info_tag': '0.5.5+1', + 'dart_dart2js_info_tag': '0.5.6', 'dart_dart_style_tag': '1.0.10', 'dart_dartdoc_tag': 'v0.18.1', 'dart_fixnum_tag': '0.10.5', @@ -60,7 +60,7 @@ vars = { 'dart_intl_tag': '0.15.2', 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.46', + 'dart_linter_tag': '0.1.47', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', @@ -76,7 +76,7 @@ vars = { 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', - 'dart_pub_semver_tag': '1.3.4', + 'dart_pub_semver_tag': '1.3.6', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index e75c6c171958e..2cf747123ed40 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -1809,6 +1809,7 @@ class RepositorySkiaThirdPartyDirectory extends RepositoryGenericThirdPartyDirec bool shouldRecurse(fs.IoNode entry) { return entry.name != 'giflib' // contains nothing that ends up in the binary executable && entry.name != 'freetype' // we use our own version + && entry.name != 'freetype2' // we use our own version && entry.name != 'icu' // we use our own version && entry.name != 'libjpeg-turbo' // we use our own version && entry.name != 'libpng' // we use our own version diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a7c8651437843..470d479138d96 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5e7a29bc2be55a7311df8f5a7dff2d34 +Signature: f15f70e4cdde38e61887aa34721faf73 UNUSED LICENSES: From 4db7a00677f4ec7684ad8136e04a9ed7a8494bcd Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 11 Apr 2018 11:23:31 -0700 Subject: [PATCH 0082/1190] Roll Dart to 41264590256de42c68de406fc180e338efc9420d. (#4969) --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 9801e0fc4de80..1950566c2545e 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '23ae4fa098a1c2011b72f5ad4d00383e1ac10a59', + 'dart_revision': '41264590256de42c68de406fc180e338efc9420d', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 470d479138d96..437074fde9e09 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f15f70e4cdde38e61887aa34721faf73 +Signature: 51b000c3ae8a9d5678ad4183dbf86328 UNUSED LICENSES: @@ -6028,12 +6028,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h FILE: ../../../third_party/dart/sdk/lib/js/_js.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart From 44bff286dec9047d5602806b4a198dd7e44acffe Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 11 Apr 2018 14:52:28 -0400 Subject: [PATCH 0083/1190] Remove named field initialization of GrVkImageInfo (#4972) This syntax fails in conjunction with the new 6-argument constructor that's been added. Fields were already initialized in the correct order, so simply omit the field names. Once the constructor lands, this will switch to calling that. --- content_handler/vulkan_surface.cc | 12 ++++++------ vulkan/vulkan_swapchain.cc | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 47ac87e375e81..6d5df488542fe 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -270,12 +270,12 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp context, } const GrVkImageInfo image_info = { - .fImage = vk_image_, - .fAlloc = {vk_memory_, 0, memory_reqs.size, 0}, - .fImageTiling = image_create_info.tiling, - .fImageLayout = image_create_info.initialLayout, - .fFormat = image_create_info.format, - .fLevelCount = image_create_info.mipLevels, + vk_image_, // image + {vk_memory_, 0, memory_reqs.size, 0}, // alloc + image_create_info.tiling, // tiling + image_create_info.initialLayout, // layout + image_create_info.format, // format + image_create_info.mipLevels, // level count }; GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0, diff --git a/vulkan/vulkan_swapchain.cc b/vulkan/vulkan_swapchain.cc index 887cf0ad0dba2..b00c8afc873b0 100644 --- a/vulkan/vulkan_swapchain.cc +++ b/vulkan/vulkan_swapchain.cc @@ -223,12 +223,12 @@ sk_sp VulkanSwapchain::CreateSkiaSurface( } const GrVkImageInfo image_info = { - .fImage = image, - .fAlloc = GrVkAlloc(), - .fImageTiling = VK_IMAGE_TILING_OPTIMAL, - .fImageLayout = VK_IMAGE_LAYOUT_UNDEFINED, - .fFormat = surface_format_.format, - .fLevelCount = 1, + image, // image + GrVkAlloc(), // alloc + VK_IMAGE_TILING_OPTIMAL, // tiling + VK_IMAGE_LAYOUT_UNDEFINED, // layout + surface_format_.format, // format + 1, // level count }; // TODO(chinmaygarde): Setup the stencil buffer and the sampleCnt. From 13fd804ecf7ce47e8cc3003f5c4a966a1bc99541 Mon Sep 17 00:00:00 2001 From: Ravi Mistry Date: Wed, 11 Apr 2018 15:25:42 -0400 Subject: [PATCH 0084/1190] Roll src/third_party/skia/ 9874bf1bc..3462eb034 (167 commits) (#4973) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://skia.googlesource.com/skia.git/+log/9874bf1bcecd..3462eb0346de $ git log 9874bf1bc..3462eb034 --date=short --no-merges --format='%ad %ae %s' 2018-04-11 mtklein skcms→56f2a09 add sRGB profile and ApproximatelyEqualProfiles() 2018-04-11 liyuqian Add private fIsBadForDAA bit to SkPath 2018-04-11 robertphillips Add Vulkan to the DDL bots 2018-04-11 mtklein roll to particular targets 2018-04-11 benjaminwagner Switch to latest Windows Intel Skylake GPU driver. 2018-04-11 fmalita Fix SkTCopyOnFirstWrite copy semantics 2018-04-11 reed no need to tile draws that don't involve paths 2018-04-11 mtklein skcms→91a8958 Detect and canonicalize identity tables 2018-04-11 mtklein skcms→307ec0f remove a layer of nesting in skcms_Curve 2018-04-10 robertphillips Fix alpha threshold image filter GPU implementation 2018-04-10 egdaniel Remove guard around getBackendTexture/RenderTarget calls 2018-04-11 robertphillips Revert "Fix handling of MaskFilter matrices" 2018-04-10 angle-skia-autoroll Roll third_party/externals/angle2/ 0ce016c1b..785b20b7a (7 commits) 2018-04-10 fmalita Fix handling of MaskFilter matrices 2018-04-10 robertphillips Get ViaDDL working with Vulkan 2018-04-10 brianosman skcms→e753c6d disable -Wdouble-promotion 2018-04-10 egdaniel Move GrBackendRenderTarget over to new system of getting backed infos 2018-04-10 liyuqian Remove unused field fBitmapBytes 2018-04-10 egdaniel Add ctor to GrVkImageInfo. 2018-04-10 liyuqian Merge drawDevice and respect ctm for the paint 2018-04-10 mtklein skcms→dff16bc express ApproximateCurve error in input units 2018-04-10 csmartdalton ccpr: Clip quadratic hulls more efficiently 2018-04-10 mtklein allow rolling from anywhere 2018-04-10 jvanverth Add initial support for simple concave shadows. 2018-04-10 mtklein skcms→9ff49a5 use GaussNewton for 7-parameter approx 2018-04-06 liyuqian Do not use CTM for drawDevice or drawSprite 2018-04-10 csmartdalton ccpr: Improve CPU checks for collinear points 2018-04-10 csmartdalton ccpr: Remove fCurrAnchorPoint from GrCCGeometry 2018-04-10 mtklein give skcms rolls a helpful commit msg 2018-04-08 update-skps Update SKP version 2018-04-10 robertphillips Remove extra Vulkan submitCommandBuffer from deleteTestingOnlyBackendTexture 2018-04-10 mtklein hard-roll skcms into Skia 2018-04-10 egdaniel Update getBackendInfo calls on GrBackendTexture to support VkImageLayout better. 2018-04-10 caryclark one more path is rect bug 2018-04-09 caryclark fix path to rect when missing close verb 2018-04-09 benjaminwagner Omit skbug6653 on internal device. 2018-04-09 brianosman Remove SkDEBUGFAIL for non-invertible XYZ matrix 2018-04-09 angle-skia-autoroll Roll third_party/externals/angle2/ 6c59e4a15..0ce016c1b (2 commits) 2018-04-06 reed identify interesting cubic points 2018-04-09 mtklein use commonPaint for all raster pipeline 2018-04-06 benjaminwagner Upgrade Debian9 bots to 9.4. 2018-04-09 bsalomon Reland "Remove deprectated GrContext::MakeGL overloads that take raw ptr" 2018-04-09 skcms-skia-autoroll Roll third_party/externals/skcms/ 8a727815d..16a9cebff (1 commit) 2018-04-06 csmartdalton ccpr: Remove WindMethod from GrCCCoverageProcessor 2018-04-09 angle-skia-autoroll Roll third_party/externals/angle2/ 6c7ab7fe8..6c59e4a15 (3 commits) 2018-04-06 bsalomon Add canvas2D fast paths to new read/write pixels code paths. 2018-04-09 egdaniel Make sure GrBackendTextures are valid before starting to do things with them 2018-04-06 brianosman Remove code that was only used by the old debugger 2018-04-08 csmartdalton Implement Sk2f::Store2 2018-04-09 angle-skia-autoroll Roll third_party/externals/angle2/ 5ae64c94d..6c7ab7fe8 (1 commit) 2018-04-08 herb Revert "Remove all notion of transport from the API." 2018-04-07 angle-skia-autoroll Roll third_party/externals/angle2/ e547aac75..5ae64c94d (1 commit) 2018-04-05 halcanary SkPDF: smarter Jpeg when libjpeg-turbo is present 2018-04-07 angle-skia-autoroll Roll third_party/externals/angle2/ d2488aba5..e547aac75 (2 commits) 2018-04-06 herb Better layer tracking fidelity 2018-04-06 angle-skia-autoroll Roll third_party/externals/angle2/ b8e396609..d2488aba5 (2 commits) 2018-04-06 skcms-skia-autoroll Roll third_party/externals/skcms/ 24c91d143..8a727815d (1 commit) 2018-04-06 brianosman Remove scanlineOrder switch statements that always do the same thing 2018-04-06 reed detect if makeOffset failed 2018-04-05 csmartdalton vulkan: Fix an optimus-related failure with vkEnumeratePhysicalDevices 2018-04-06 egdaniel Make generated effects from sksl fp files not need SK_SUPPORT_GPU 2018-04-05 herb Remove all notion of transport from the API. 2018-04-04 halcanary SkRegion: Use less memory for SkRegion::Oper 2018-04-06 brianosman Remove old debugger (it no longer builds) 2018-04-06 liyuqian Revert "Exercise the threaded backend in test bots" 2018-04-06 egdaniel Remove unneeded SK_SUPPORT_GPU checks in gpu only files. 2018-04-06 halcanary Region Op Fuzzer 2018-04-05 csmartdalton ccpr: Make curve corners more seamless 2018-04-05 brianosman Remove SK_SUPPORT_LEGACY_BLURMASKFILTER 2018-04-06 bsalomon Add versions of MakeGL() that don't require include GrGLInterface.h in order to use the GrGLMakeNativeInterface 2018-04-06 egdaniel Don't use GrPixelConfig value as proxy for valid on GrBackendSurface. 2018-04-05 liyuqian Exercise the threaded backend in test bots 2018-04-06 angle-skia-autoroll Roll third_party/externals/angle2/ c3755fc56..b8e396609 (1 commit) 2018-04-06 update-docs Update markdown files 2018-04-05 angle-skia-autoroll Roll third_party/externals/angle2/ dd196e0bc..c3755fc56 (5 commits) 2018-04-05 caryclark remove SK_IGNORE_TO_STRING 2018-03-29 bungeman Distinguish between glyphs with empty path and no path. 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ 6959d4597..24c91d143 (1 commit) 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ d75edb2e3..6959d4597 (1 commit) 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ a7974d9f6..d75edb2e3 (1 commit) 2018-04-05 fmalita Clip SlideDir slides to their declared dimensions 2018-04-05 bungeman Mac to better serialize OTTO fonts. 2018-04-05 robertphillips Revert "Remove deprectated GrContext::MakeGL overloads that take raw ptr" 2018-04-05 bsalomon Remove SK_DISABLE_TEXTURE_OP_AA 2018-04-05 fmalita [viewer] Consolidate external slide loading 2018-04-05 liyuqian Flush before snap SkThreadedBMPDevice 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ 3cb9ba6ae..a7974d9f6 (3 commits) 2018-04-04 bryct Update 'Working in a Chromium repo' documentation. 2018-04-05 kjlubick Avoid nonsortable rects in drawRect/drawOval 2018-04-04 bsalomon Remove deprectated GrContext::MakeGL overloads that take raw ptr 2018-04-05 bsalomon Add maxTextureSize()/maxRenderTargetSize() to GrContext 2018-04-05 fmalita Viewer SVG support 2018-04-04 bungeman Via*::draw to finish before checking. 2018-04-05 reed replace size-alignment assert with round-down 2018-04-05 angle-skia-autoroll Roll third_party/externals/angle2/ bc54342bf..dd196e0bc (14 commits) 2018-04-05 skcms-skia-autoroll Roll third_party/externals/skcms/ d26d270c8..3cb9ba6ae (7 commits) 2018-04-02 halcanary SkPDF: implement xheight for type3 fonts 2018-04-05 robertphillips Add GrBackendTexture/RenderTarget accessors to SkSurface 2018-04-05 robertphillips Add SK_API to SkSurfaceCharacterization 2018-04-03 halcanary experimental/tools: minor code cleanup (...) Created with: roll-dep src/third_party/skia --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 440 +++++++++++--------- 2 files changed, 233 insertions(+), 209 deletions(-) diff --git a/DEPS b/DEPS index 1950566c2545e..f771a4be4088b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9874bf1bcecd0113087bd8a51cf838da0efa3bfe', + 'skia_revision': '3462eb0346de0ad645bae96246d57c98521f1ffc', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 437074fde9e09..39ab0840084d8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 51b000c3ae8a9d5678ad4183dbf86328 +Signature: 6055a1e4cf6a71341e15c8c10903dbed UNUSED LICENSES: @@ -111,6 +111,39 @@ and other provisions required by the GPL or the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the MPL, the GPL or the LGPL. ==================================================================================================== + +==================================================================================================== +ORIGIN: ../../../third_party/skia/third_party/skcms/LICENSE +TYPE: LicenseType.bsd +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USED LICENSES: @@ -13988,7 +14021,6 @@ FILE: ../../../third_party/skia/bench/StreamBench.cpp FILE: ../../../third_party/skia/bench/SwizzleBench.cpp FILE: ../../../third_party/skia/bench/TileImageFilterBench.cpp FILE: ../../../third_party/skia/bench/pack_int_uint16_t_Bench.cpp -FILE: ../../../third_party/skia/debugger/QT/SkRasterWidget.h FILE: ../../../third_party/skia/experimental/svg/model/SkPEG.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.h @@ -14033,7 +14065,6 @@ FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTransformableNode.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTypes.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.h -FILE: ../../../third_party/skia/experimental/tools/generate-unicode-test-txt FILE: ../../../third_party/skia/experimental/xps_to_png/xps_to_png.cs FILE: ../../../third_party/skia/fuzz/Fuzz.h FILE: ../../../third_party/skia/fuzz/FuzzGradients.cpp @@ -17162,6 +17193,197 @@ Exhibit B - “Incompatible With Secondary Licenses” Notice This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. ==================================================================================================== +==================================================================================================== +LIBRARY: skcms +LIBRARY: skia +ORIGIN: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp +FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h +FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp +FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.h +FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.cpp +FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.h +FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.cpp +FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.h +FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGClipEffect.cpp +FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGClipEffect.h +FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGMaskEffect.cpp +FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGMaskEffect.h +FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGOpacityEffect.cpp +FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGOpacityEffect.h +FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGGeometryTransform.cpp +FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGGeometryTransform.h +FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPlane.cpp +FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPlane.h +FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGText.cpp +FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGText.h +FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.cpp +FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.h +FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp +FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp +FILE: ../../../third_party/skia/fuzz/FuzzRegionOp.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathDeserialize.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionSetPath.cpp +FILE: ../../../third_party/skia/gm/hugepath.cpp +FILE: ../../../third_party/skia/gm/localmatrixshader.cpp +FILE: ../../../third_party/skia/gm/makeRasterImage.cpp +FILE: ../../../third_party/skia/gm/orientation.cpp +FILE: ../../../third_party/skia/gm/pathmeasure.cpp +FILE: ../../../third_party/skia/gm/polygonoffset.cpp +FILE: ../../../third_party/skia/gm/scaledemoji.cpp +FILE: ../../../third_party/skia/gm/shadermaskfilter.cpp +FILE: ../../../third_party/skia/gm/sharedcorners.cpp +FILE: ../../../third_party/skia/include/android/SkAnimatedImage.h +FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h +FILE: ../../../third_party/skia/include/core/SkCoverageMode.h +FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h +FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h +FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h +FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h +FILE: ../../../third_party/skia/include/private/SkSafe32.h +FILE: ../../../third_party/skia/infra/cts/run_testlab.go +FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp +FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp +FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp +FILE: ../../../third_party/skia/src/core/SkBlurPriv.h +FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_skcms.cpp +FILE: ../../../third_party/skia/src/core/SkCoverageModePriv.h +FILE: ../../../third_party/skia/src/core/SkCubicMap.cpp +FILE: ../../../third_party/skia/src/core/SkCubicMap.h +FILE: ../../../third_party/skia/src/core/SkDeferredDisplayList.cpp +FILE: ../../../third_party/skia/src/core/SkGlyph.cpp +FILE: ../../../third_party/skia/src/core/SkIPoint16.h +FILE: ../../../third_party/skia/src/core/SkMaskFilterBase.h +FILE: ../../../third_party/skia/src/core/SkPath_serial.cpp +FILE: ../../../third_party/skia/src/core/SkRRectPriv.h +FILE: ../../../third_party/skia/src/core/SkRectPriv.h +FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.cpp +FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.h +FILE: ../../../third_party/skia/src/core/SkSafeRange.h +FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp +FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp +FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h +FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp +FILE: ../../../third_party/skia/src/effects/SkTrimPE.h +FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp +FILE: ../../../third_party/skia/src/gpu/GrDDLContext.cpp +FILE: ../../../third_party/skia/src/gpu/GrDirectContext.cpp +FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h +FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp +FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h +FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h +FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp +FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp +FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h +FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.h +FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h +FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp +FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp +FILE: ../../../third_party/skia/src/opts/SkRasterPipeline_opts.h +FILE: ../../../third_party/skia/src/pdf/SkClusterator.cpp +FILE: ../../../third_party/skia/src/pdf/SkClusterator.h +FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.h +FILE: ../../../third_party/skia/src/sksl/SkSLJIT.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLJIT.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp +FILE: ../../../third_party/skia/third_party/skcms/skcms.c +FILE: ../../../third_party/skia/third_party/skcms/skcms.h +FILE: ../../../third_party/skia/third_party/skcms/src/GaussNewton.c +FILE: ../../../third_party/skia/third_party/skcms/src/GaussNewton.h +FILE: ../../../third_party/skia/third_party/skcms/src/ICCProfile.c +FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.c +FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.h +FILE: ../../../third_party/skia/third_party/skcms/src/Macros.h +FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.c +FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.h +FILE: ../../../third_party/skia/third_party/skcms/src/TF13.c +FILE: ../../../third_party/skia/third_party/skcms/src/TransferFunction.c +FILE: ../../../third_party/skia/third_party/skcms/src/TransferFunction.h +FILE: ../../../third_party/skia/third_party/skcms/src/Transform.c +FILE: ../../../third_party/skia/third_party/skcms/src/Transform.h +FILE: ../../../third_party/skia/third_party/skcms/src/Transform_inl.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/LICENSE @@ -17181,26 +17403,9 @@ FILE: ../../../third_party/skia/animations/redcross#1.jpg FILE: ../../../third_party/skia/animations/text#1.xml FILE: ../../../third_party/skia/bench/microbench.json FILE: ../../../third_party/skia/bench/skpbench.json -FILE: ../../../third_party/skia/debugger/QT/Icons/.qrc -FILE: ../../../third_party/skia/debugger/QT/Icons/blank.png -FILE: ../../../third_party/skia/debugger/QT/Icons/breakpoint.png -FILE: ../../../third_party/skia/debugger/QT/Icons/breakpoint_16x16.png -FILE: ../../../third_party/skia/debugger/QT/Icons/delete.png -FILE: ../../../third_party/skia/debugger/QT/Icons/inspector.png -FILE: ../../../third_party/skia/debugger/QT/Icons/next.png -FILE: ../../../third_party/skia/debugger/QT/Icons/pause.png -FILE: ../../../third_party/skia/debugger/QT/Icons/play.png -FILE: ../../../third_party/skia/debugger/QT/Icons/previous.png -FILE: ../../../third_party/skia/debugger/QT/Icons/profile.png -FILE: ../../../third_party/skia/debugger/QT/Icons/reload.png -FILE: ../../../third_party/skia/debugger/QT/Icons/rewind.png -FILE: ../../../third_party/skia/debugger/QT/Icons/skia.png -FILE: ../../../third_party/skia/debugger/QT/SkIcons.qrc -FILE: ../../../third_party/skia/debugger/QT/qrc_SkIcons.cpp FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh -FILE: ../../../third_party/skia/docs/SkIPoint16_Reference.bmh FILE: ../../../third_party/skia/docs/SkIPoint_Reference.bmh FILE: ../../../third_party/skia/docs/SkIRect_Reference.bmh FILE: ../../../third_party/skia/docs/SkImageInfo_Reference.bmh @@ -17246,6 +17451,7 @@ FILE: ../../../third_party/skia/infra/bots/assets/go/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_debug/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_release/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_sdk/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/mips64el_toolchain_linux/VERSION FILE: ../../../third_party/skia/infra/bots/assets/node/VERSION FILE: ../../../third_party/skia/infra/bots/assets/procdump_win/VERSION FILE: ../../../third_party/skia/infra/bots/assets/protoc/VERSION @@ -17305,12 +17511,14 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-arm64-Release-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Chromebook_GLES.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Mini.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-loongson3a-Release.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Debug-EmbededResouces.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json @@ -17349,6 +17557,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SafeStack.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu16-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_ProcDump.json @@ -18086,8 +18295,6 @@ FILE: ../../../third_party/skia/bench/RotatedRectBench.cpp FILE: ../../../third_party/skia/bench/SKPBench.cpp FILE: ../../../third_party/skia/bench/SKPBench.h FILE: ../../../third_party/skia/bench/nanobench.cpp -FILE: ../../../third_party/skia/debugger/QT/SkDrawCommandGeometryWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkDrawCommandGeometryWidget.h FILE: ../../../third_party/skia/dm/DMGpuSupport.h FILE: ../../../third_party/skia/dm/DMJsonWriter.cpp FILE: ../../../third_party/skia/dm/DMJsonWriter.h @@ -18345,22 +18552,6 @@ FILE: ../../../third_party/skia/bench/MorphologyBench.cpp FILE: ../../../third_party/skia/bench/RTreeBench.cpp FILE: ../../../third_party/skia/bench/RefCntBench.cpp FILE: ../../../third_party/skia/bench/TableBench.cpp -FILE: ../../../third_party/skia/debugger/QT/SkCanvasWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkCanvasWidget.h -FILE: ../../../third_party/skia/debugger/QT/SkDebuggerGUI.cpp -FILE: ../../../third_party/skia/debugger/QT/SkDebuggerGUI.h -FILE: ../../../third_party/skia/debugger/QT/SkGLWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkGLWidget.h -FILE: ../../../third_party/skia/debugger/QT/SkInspectorWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkInspectorWidget.h -FILE: ../../../third_party/skia/debugger/QT/SkListWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkListWidget.h -FILE: ../../../third_party/skia/debugger/QT/SkRasterWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkSettingsWidget.cpp -FILE: ../../../third_party/skia/debugger/QT/SkSettingsWidget.h -FILE: ../../../third_party/skia/debugger/SkDebugger.cpp -FILE: ../../../third_party/skia/debugger/SkDebugger.h -FILE: ../../../third_party/skia/debugger/debuggermain.cpp FILE: ../../../third_party/skia/gm/bigmatrix.cpp FILE: ../../../third_party/skia/gm/blurrect.cpp FILE: ../../../third_party/skia/gm/colorfilterimagefilter.cpp @@ -19302,6 +19493,7 @@ FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.h +FILE: ../../../third_party/skia/experimental/tools/gerrit-change-id-to-number FILE: ../../../third_party/skia/fuzz/FuzzCanvas.cpp FILE: ../../../third_party/skia/gm/alpha_image.cpp FILE: ../../../third_party/skia/gm/atlastext.cpp @@ -19469,7 +19661,6 @@ FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCTriangleShader.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.h FILE: ../../../third_party/skia/src/gpu/effects/GrAtlasedShaderHelpers.h @@ -19678,172 +19869,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.h -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGClipEffect.cpp -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGClipEffect.h -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGMaskEffect.cpp -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGMaskEffect.h -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGOpacityEffect.cpp -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGOpacityEffect.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGGeometryTransform.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGGeometryTransform.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPlane.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPlane.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGText.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGText.h -FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.cpp -FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.h -FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp -FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathDeserialize.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionSetPath.cpp -FILE: ../../../third_party/skia/gm/hugepath.cpp -FILE: ../../../third_party/skia/gm/makeRasterImage.cpp -FILE: ../../../third_party/skia/gm/orientation.cpp -FILE: ../../../third_party/skia/gm/pathmeasure.cpp -FILE: ../../../third_party/skia/gm/scaledemoji.cpp -FILE: ../../../third_party/skia/gm/shadermaskfilter.cpp -FILE: ../../../third_party/skia/gm/sharedcorners.cpp -FILE: ../../../third_party/skia/include/android/SkAnimatedImage.h -FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h -FILE: ../../../third_party/skia/include/core/SkCoverageMode.h -FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h -FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h -FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h -FILE: ../../../third_party/skia/include/private/SkSafe32.h -FILE: ../../../third_party/skia/infra/cts/run_testlab.go -FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp -FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp -FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp -FILE: ../../../third_party/skia/src/core/SkBlurPriv.h -FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_skcms.cpp -FILE: ../../../third_party/skia/src/core/SkCoverageModePriv.h -FILE: ../../../third_party/skia/src/core/SkCubicMap.cpp -FILE: ../../../third_party/skia/src/core/SkCubicMap.h -FILE: ../../../third_party/skia/src/core/SkDeferredDisplayList.cpp -FILE: ../../../third_party/skia/src/core/SkGlyph.cpp -FILE: ../../../third_party/skia/src/core/SkMaskFilterBase.h -FILE: ../../../third_party/skia/src/core/SkPath_serial.cpp -FILE: ../../../third_party/skia/src/core/SkRRectPriv.h -FILE: ../../../third_party/skia/src/core/SkRectPriv.h -FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.cpp -FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.h -FILE: ../../../third_party/skia/src/core/SkSafeRange.h -FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp -FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h -FILE: ../../../third_party/skia/src/effects/GrAlphaThresholdFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/effects/GrAlphaThresholdFragmentProcessor.fp -FILE: ../../../third_party/skia/src/effects/GrAlphaThresholdFragmentProcessor.h -FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkTrimPE.h -FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp -FILE: ../../../third_party/skia/src/gpu/GrDDLContext.cpp -FILE: ../../../third_party/skia/src/gpu/GrDirectContext.cpp -FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h -FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp -FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h -FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h -FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp -FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp -FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h -FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.h -FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h -FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h -FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp -FILE: ../../../third_party/skia/src/opts/SkRasterPipeline_opts.h -FILE: ../../../third_party/skia/src/pdf/SkClusterator.cpp -FILE: ../../../third_party/skia/src/pdf/SkClusterator.h -FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.h -FILE: ../../../third_party/skia/src/sksl/SkSLJIT.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLJIT.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2018 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/fuzz/FuzzDrawFunctions.cpp + ../../../third_party/skia/LICENSE @@ -19925,8 +19950,8 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzDrawFunctions.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzGradients.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImage.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJPEGEncoder.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullGLCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp @@ -20125,7 +20150,6 @@ FILE: ../../../third_party/skia/src/core/SkXfermode.cpp FILE: ../../../third_party/skia/src/core/SkXfermodePriv.h FILE: ../../../third_party/skia/src/effects/Sk1DPathEffect.cpp FILE: ../../../third_party/skia/src/effects/Sk2DPathEffect.cpp -FILE: ../../../third_party/skia/src/effects/SkBlurMaskFilter.cpp FILE: ../../../third_party/skia/src/effects/SkCornerPathEffect.cpp FILE: ../../../third_party/skia/src/effects/SkDashPathEffect.cpp FILE: ../../../third_party/skia/src/effects/SkDiscretePathEffect.cpp @@ -21918,4 +21942,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 317 +Total license count: 318 From a3327bff86800b3e654a2988fa7e6049edeb679c Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 11 Apr 2018 15:41:23 -0700 Subject: [PATCH 0085/1190] Re-land "Support multiple shells in a single process. (#4932)" (#4977) This reverts commit 9199b40f2a2a6e448cd251de44e020ec3b75002d. --- BUILD.gn | 74 +- DEPS | 2 +- assets/BUILD.gn | 12 +- assets/asset_manager.cc | 59 + assets/asset_manager.h | 47 + assets/asset_provider.h | 25 - assets/asset_resolver.h | 32 + assets/directory_asset_bundle.cc | 85 +- assets/directory_asset_bundle.h | 32 +- assets/unzipper_provider.cc | 21 - assets/unzipper_provider.h | 20 - assets/zip_asset_store.cc | 24 +- assets/zip_asset_store.h | 24 +- common/BUILD.gn | 5 +- common/settings.cc | 58 +- common/settings.h | 74 +- common/task_runners.cc | 48 + common/task_runners.h | 46 + common/threads.cc | 56 - common/threads.h | 48 - content_handler/BUILD.gn | 59 +- content_handler/README.md | 4 + content_handler/accessibility_bridge.cc | 15 +- content_handler/accessibility_bridge.h | 25 +- content_handler/app.cc | 174 --- content_handler/app.h | 64 - content_handler/application.cc | 313 +++++ content_handler/application.h | 97 ++ .../application_controller_impl.cc | 148 --- content_handler/application_controller_impl.h | 76 -- content_handler/application_runner.cc | 90 ++ content_handler/application_runner.h | 79 ++ content_handler/compositor_context.cc | 86 ++ content_handler/compositor_context.h | 39 + content_handler/engine.cc | 258 +++++ content_handler/engine.h | 63 + content_handler/fuchsia_font_manager.cc | 47 +- content_handler/fuchsia_font_manager.h | 2 +- content_handler/isolate_configurator.cc | 114 ++ content_handler/isolate_configurator.h | 55 + content_handler/main.cc | 20 +- content_handler/platform_view.cc | 551 +++++++++ content_handler/platform_view.h | 120 ++ content_handler/rasterizer.cc | 19 - content_handler/rasterizer.h | 35 - content_handler/runtime_holder.cc | 911 --------------- content_handler/runtime_holder.h | 152 --- content_handler/service_protocol_hooks.cc | 164 --- content_handler/service_protocol_hooks.h | 37 - content_handler/session_connection.cc | 108 +- content_handler/session_connection.h | 52 +- content_handler/surface.cc | 73 ++ content_handler/surface.h | 47 + content_handler/task_observers.cc | 43 + content_handler/task_observers.h | 16 + content_handler/unique_fdio_ns.h | 34 + content_handler/vulkan_rasterizer.cc | 117 -- content_handler/vulkan_rasterizer.h | 42 - content_handler/vulkan_surface.cc | 24 +- content_handler/vulkan_surface.h | 11 +- content_handler/vulkan_surface_pool.cc | 7 +- content_handler/vulkan_surface_pool.h | 9 +- content_handler/vulkan_surface_producer.cc | 9 +- content_handler/vulkan_surface_producer.h | 18 +- flow/BUILD.gn | 10 +- flow/compositor_context.cc | 26 +- flow/compositor_context.h | 44 +- flow/debug_print.cc | 5 + flow/debug_print.h | 9 +- flow/export_node.cc | 15 +- flow/export_node.h | 5 +- flow/layers/default_layer_builder.cc | 6 +- flow/layers/default_layer_builder.h | 2 +- flow/layers/layer.h | 4 - flow/layers/layer_builder.h | 3 +- flow/layers/layer_tree.cc | 55 +- flow/layers/layer_tree.h | 21 - flow/layers/performance_overlay_layer.cc | 33 - flow/layers/performance_overlay_layer.h | 2 - flow/layers/picture_layer.cc | 23 +- flow/layers/picture_layer.h | 13 +- flow/process_info.h | 31 - flow/raster_cache.cc | 33 +- flow/raster_cache.h | 6 - flow/raster_cache_key.h | 30 +- flow/scene_update_context.cc | 17 +- flow/skia_gpu_object.cc | 44 + flow/skia_gpu_object.h | 88 ++ flow/texture.cc | 6 +- flow/texture.h | 5 +- fml/BUILD.gn | 18 +- fml/file.h | 35 + fml/icu_util.cc | 17 +- fml/macros.h | 20 + fml/mapping.cc | 20 + fml/mapping.h | 37 +- fml/memory/thread_checker.h | 69 ++ fml/memory/weak_ptr.h | 43 +- fml/message_loop.cc | 10 +- fml/message_loop.h | 9 +- fml/message_loop_impl.cc | 43 +- fml/message_loop_impl.h | 8 +- fml/message_loop_unittests.cc | 24 +- fml/native_library.h | 52 + fml/paths.cc | 31 + fml/paths.h | 4 + fml/platform/android/message_loop_android.h | 6 +- .../darwin/resource_mapping_darwin.mm | 4 +- fml/platform/fuchsia/paths_fuchsia.cc | 15 + fml/platform/linux/message_loop_linux.h | 6 +- fml/platform/posix/file_posix.cc | 71 ++ fml/platform/posix/mapping_posix.cc | 18 +- fml/platform/posix/native_library_posix.cc | 60 + fml/platform/win/file_win.cc | 119 ++ fml/platform/win/mapping_win.cc | 59 +- fml/platform/win/native_library_win.cc | 51 + fml/platform/win/wstring_conversion.h | 25 + fml/task_observer.h | 21 - fml/task_runner.cc | 12 + fml/task_runner.h | 7 +- fml/thread.cc | 9 +- fml/thread.h | 6 +- fml/unique_fd.cc | 35 + fml/unique_fd.h | 60 + fml/unique_object.h | 137 +++ lib/snapshot/BUILD.gn | 54 +- lib/ui/BUILD.gn | 11 +- lib/ui/compositing/scene_builder.cc | 9 +- lib/ui/compositing/scene_host.cc | 6 +- lib/ui/dart_runtime_hooks.cc | 62 +- lib/ui/painting/codec.cc | 114 +- lib/ui/painting/codec.h | 7 +- lib/ui/painting/gradient.cc | 12 +- lib/ui/painting/image.cc | 14 +- lib/ui/painting/image.h | 17 +- lib/ui/painting/image_encoding.cc | 23 +- lib/ui/painting/image_shader.cc | 11 +- lib/ui/painting/picture.cc | 25 +- lib/ui/painting/picture.h | 9 +- lib/ui/painting/picture_recorder.cc | 5 +- lib/ui/painting/resource_context.cc | 51 - lib/ui/painting/resource_context.h | 60 - lib/ui/painting/shader.cc | 12 +- lib/ui/painting/shader.h | 13 +- lib/ui/painting/utils.cc | 46 - lib/ui/painting/utils.h | 38 - lib/ui/text/font_collection.cc | 14 +- lib/ui/text/font_collection.h | 7 +- lib/ui/text/paragraph.cc | 5 +- lib/ui/text/paragraph.h | 5 + lib/ui/text/paragraph_builder.cc | 27 +- lib/ui/text/paragraph_builder.h | 11 +- lib/ui/text/paragraph_impl_blink.cc | 4 +- lib/ui/text/paragraph_impl_blink.h | 5 + lib/ui/text/paragraph_impl_txt.cc | 2 +- lib/ui/ui_dart_state.cc | 93 +- lib/ui/ui_dart_state.h | 101 +- .../window/platform_message_response_dart.cc | 14 +- .../window/platform_message_response_dart.h | 6 +- lib/ui/window/viewport_metrics.h | 19 + lib/ui/window/window.cc | 5 +- lib/ui/window/window.h | 5 +- runtime/BUILD.gn | 60 +- runtime/asset_font_selector.cc | 38 +- runtime/asset_font_selector.h | 17 +- runtime/dart_controller.cc | 250 ---- runtime/dart_controller.h | 55 - runtime/dart_init.cc | 725 ------------ runtime/dart_init.h | 64 - runtime/dart_isolate.cc | 715 ++++++++++++ runtime/dart_isolate.h | 152 +++ runtime/dart_isolate_unittests.cc | 103 ++ runtime/dart_service_isolate.h | 2 - runtime/dart_snapshot.cc | 159 +++ runtime/dart_snapshot.h | 57 + runtime/dart_snapshot_buffer.cc | 72 ++ runtime/dart_snapshot_buffer.h | 34 + runtime/dart_vm.cc | 472 ++++++++ runtime/dart_vm.h | 75 ++ runtime/dart_vm_unittests.cc | 21 + runtime/fixtures/simple_main.dart | 7 + runtime/runtime_controller.cc | 276 +++-- runtime/runtime_controller.h | 99 +- runtime/runtime_delegate.cc | 8 +- runtime/runtime_delegate.h | 8 +- runtime/runtime_init.cc | 35 - runtime/runtime_init.h | 21 - runtime/service_protocol.cc | 279 +++++ runtime/service_protocol.h | 99 ++ shell/common/BUILD.gn | 43 +- shell/common/animator.cc | 75 +- shell/common/animator.h | 37 +- shell/common/engine.cc | 583 +++------- shell/common/engine.h | 153 +-- shell/common/io_manager.cc | 73 ++ shell/common/io_manager.h | 52 + shell/common/isolate_configuration.cc | 148 +++ shell/common/isolate_configuration.h | 51 + shell/common/null_platform_view.cc | 37 - shell/common/null_platform_view.h | 39 - shell/common/null_rasterizer.cc | 67 -- shell/common/null_rasterizer.h | 51 - shell/common/platform_view.cc | 182 +-- shell/common/platform_view.h | 119 +- .../common/platform_view_service_protocol.cc | 447 ------- shell/common/platform_view_service_protocol.h | 85 -- shell/common/rasterizer.cc | 197 ++++ shell/common/rasterizer.h | 65 +- shell/common/run_configuration.cc | 80 ++ shell/common/run_configuration.h | 56 + shell/common/shell.cc | 1029 ++++++++++++----- shell/common/shell.h | 254 ++-- shell/common/shell_unittests.cc | 133 +++ shell/common/surface.cc | 28 +- shell/common/surface.h | 14 +- shell/common/switches.cc | 122 ++ shell/common/switches.h | 37 +- shell/common/thread_host.cc | 38 + shell/common/thread_host.h | 43 + shell/common/tracing_controller.cc | 51 - shell/common/tracing_controller.h | 34 - shell/common/vsync_waiter.cc | 37 + shell/common/vsync_waiter.h | 21 +- shell/common/vsync_waiter_fallback.cc | 24 +- shell/common/vsync_waiter_fallback.h | 13 +- shell/gpu/BUILD.gn | 11 +- shell/gpu/gpu_rasterizer.cc | 168 --- shell/gpu/gpu_rasterizer.h | 68 -- shell/gpu/gpu_surface_gl.cc | 13 +- shell/gpu/gpu_surface_gl.h | 5 +- shell/gpu/gpu_surface_software.cc | 17 +- shell/gpu/gpu_surface_software.h | 7 +- shell/gpu/gpu_surface_vulkan.h | 5 +- shell/platform/BUILD.gn | 6 +- shell/platform/android/BUILD.gn | 16 +- shell/platform/android/android_context_gl.cc | 24 +- shell/platform/android/android_context_gl.h | 1 - .../android/android_external_texture_gl.cc | 9 +- .../android/android_external_texture_gl.h | 3 +- .../platform/android/android_shell_holder.cc | 169 +++ shell/platform/android/android_shell_holder.h | 59 + shell/platform/android/android_surface.cc | 24 + shell/platform/android/android_surface.h | 7 +- shell/platform/android/android_surface_gl.cc | 37 +- shell/platform/android/android_surface_gl.h | 24 +- .../android/android_surface_software.cc | 14 +- .../android/android_surface_software.h | 26 +- .../android/android_surface_vulkan.cc | 15 +- .../platform/android/android_surface_vulkan.h | 13 +- shell/platform/android/apk_asset_provider.cc | 29 +- shell/platform/android/apk_asset_provider.h | 27 +- shell/platform/android/flutter_main.cc | 75 +- shell/platform/android/flutter_main.h | 27 +- shell/platform/android/library_loader.cc | 2 +- .../platform_message_response_android.cc | 62 + .../platform_message_response_android.h | 39 + .../platform/android/platform_view_android.cc | 589 ++-------- .../platform/android/platform_view_android.h | 98 +- .../android/platform_view_android_jni.cc | 416 +++++-- .../platform/android/vsync_waiter_android.cc | 100 +- shell/platform/android/vsync_waiter_android.h | 15 +- shell/platform/darwin/BUILD.gn | 12 +- shell/platform/darwin/common/BUILD.gn | 13 +- shell/platform/darwin/common/command_line.h | 17 + shell/platform/darwin/common/command_line.mm | 21 + shell/platform/darwin/common/platform_mac.h | 20 - shell/platform/darwin/common/platform_mac.mm | 160 --- .../darwin/common/process_info_mac.cc | 36 - .../platform/darwin/common/process_info_mac.h | 36 - shell/platform/darwin/desktop/BUILD.gn | 22 +- shell/platform/darwin/desktop/Info.plist | 8 +- .../darwin/desktop/flutter_app_delegate.h | 14 - .../darwin/desktop/flutter_app_delegate.m | 15 - .../darwin/desktop/flutter_application.mm | 8 - ...ation.h => flutter_application_delegate.h} | 11 +- .../desktop/flutter_application_delegate.mm | 80 ++ shell/platform/darwin/desktop/flutter_mac.xib | 695 ----------- .../platform/darwin/desktop/flutter_window.h | 6 +- .../platform/darwin/desktop/flutter_window.mm | 201 +++- shell/platform/darwin/desktop/main_mac.mm | 112 +- .../darwin/desktop/platform_view_mac.h | 27 +- .../darwin/desktop/platform_view_mac.mm | 107 +- .../darwin/desktop/vsync_waiter_mac.cc | 16 +- .../darwin/desktop/vsync_waiter_mac.h | 10 +- shell/platform/darwin/ios/BUILD.gn | 13 +- .../framework/Source/FlutterDartProject.mm | 397 +++---- .../Source/FlutterDartProject_Internal.h | 23 +- .../ios/framework/Source/FlutterDartSource.h | 30 - .../ios/framework/Source/FlutterDartSource.mm | 100 -- .../Source/FlutterHeadlessDartRunner.mm | 88 +- .../darwin/ios/framework/Source/FlutterView.h | 6 + .../ios/framework/Source/FlutterView.mm | 103 +- .../framework/Source/FlutterViewController.mm | 337 +++--- .../Source/FlutterViewController_Internal.h | 17 + .../framework/Source/accessibility_bridge.mm | 4 +- .../ios/framework/Source/flutter_main_ios.h | 18 - .../ios/framework/Source/flutter_main_ios.mm | 25 - .../Source/platform_message_response_darwin.h | 50 + .../platform_message_response_darwin.mm | 11 + .../Source/platform_message_router.h | 5 +- .../Source/platform_message_router.mm | 15 +- .../ios/framework/Source/vsync_waiter_ios.h | 19 +- .../ios/framework/Source/vsync_waiter_ios.mm | 115 +- .../darwin/ios/ios_external_texture_gl.h | 2 + .../darwin/ios/ios_external_texture_gl.mm | 19 +- shell/platform/darwin/ios/ios_gl_context.h | 2 +- shell/platform/darwin/ios/ios_gl_context.mm | 60 +- shell/platform/darwin/ios/ios_surface.h | 19 +- shell/platform/darwin/ios/ios_surface.mm | 31 +- shell/platform/darwin/ios/ios_surface_gl.h | 3 +- shell/platform/darwin/ios/ios_surface_gl.mm | 5 +- .../darwin/ios/ios_surface_software.h | 11 +- .../darwin/ios/ios_surface_software.mm | 9 +- shell/platform/darwin/ios/platform_view_ios.h | 93 +- .../platform/darwin/ios/platform_view_ios.mm | 143 +-- shell/platform/embedder/BUILD.gn | 8 +- shell/platform/embedder/embedder.cc | 245 ++-- shell/platform/embedder/embedder_engine.cc | 119 ++ shell/platform/embedder/embedder_engine.h | 53 + .../embedder/platform_view_embedder.cc | 53 +- .../embedder/platform_view_embedder.h | 29 +- shell/platform/linux/BUILD.gn | 23 - shell/platform/linux/main_linux.cc | 142 --- shell/platform/win/BUILD.gn | 30 - shell/platform/win/main_win.cc | 142 --- shell/testing/BUILD.gn | 26 +- shell/testing/platform_view_test.cc | 32 - shell/testing/platform_view_test.h | 38 - shell/testing/test_runner.cc | 48 - shell/testing/test_runner.h | 42 - shell/testing/tester_main.cc | 243 ++++ shell/testing/testing.cc | 24 - shell/testing/testing.h | 16 - sky/engine/platform/SharedBuffer.cpp | 1 - .../platform/fonts/FontFallbackList.cpp | 10 +- sky/engine/platform/fonts/FontFallbackList.h | 3 + sky/engine/web/Sky.cpp | 56 - synchronization/BUILD.gn | 5 +- synchronization/debug_thread_checker.h | 25 - synchronization/semaphore.cc | 6 +- testing/BUILD.gn | 4 + testing/thread_test.cc | 33 + testing/thread_test.h | 37 + tools/gn | 4 + travis/licenses_golden/licenses_flutter | 233 ++-- 345 files changed, 12558 insertions(+), 11071 deletions(-) create mode 100644 assets/asset_manager.cc create mode 100644 assets/asset_manager.h delete mode 100644 assets/asset_provider.h create mode 100644 assets/asset_resolver.h delete mode 100644 assets/unzipper_provider.cc delete mode 100644 assets/unzipper_provider.h create mode 100644 common/task_runners.cc create mode 100644 common/task_runners.h delete mode 100644 common/threads.cc delete mode 100644 common/threads.h create mode 100644 content_handler/README.md delete mode 100644 content_handler/app.cc delete mode 100644 content_handler/app.h create mode 100644 content_handler/application.cc create mode 100644 content_handler/application.h delete mode 100644 content_handler/application_controller_impl.cc delete mode 100644 content_handler/application_controller_impl.h create mode 100644 content_handler/application_runner.cc create mode 100644 content_handler/application_runner.h create mode 100644 content_handler/compositor_context.cc create mode 100644 content_handler/compositor_context.h create mode 100644 content_handler/engine.cc create mode 100644 content_handler/engine.h create mode 100644 content_handler/isolate_configurator.cc create mode 100644 content_handler/isolate_configurator.h create mode 100644 content_handler/platform_view.cc create mode 100644 content_handler/platform_view.h delete mode 100644 content_handler/rasterizer.cc delete mode 100644 content_handler/rasterizer.h delete mode 100644 content_handler/runtime_holder.cc delete mode 100644 content_handler/runtime_holder.h delete mode 100644 content_handler/service_protocol_hooks.cc delete mode 100644 content_handler/service_protocol_hooks.h create mode 100644 content_handler/surface.cc create mode 100644 content_handler/surface.h create mode 100644 content_handler/task_observers.cc create mode 100644 content_handler/task_observers.h create mode 100644 content_handler/unique_fdio_ns.h delete mode 100644 content_handler/vulkan_rasterizer.cc delete mode 100644 content_handler/vulkan_rasterizer.h delete mode 100644 flow/process_info.h create mode 100644 flow/skia_gpu_object.cc create mode 100644 flow/skia_gpu_object.h create mode 100644 fml/file.h create mode 100644 fml/macros.h create mode 100644 fml/mapping.cc create mode 100644 fml/memory/thread_checker.h create mode 100644 fml/native_library.h create mode 100644 fml/paths.cc create mode 100644 fml/platform/fuchsia/paths_fuchsia.cc create mode 100644 fml/platform/posix/file_posix.cc create mode 100644 fml/platform/posix/native_library_posix.cc create mode 100644 fml/platform/win/file_win.cc create mode 100644 fml/platform/win/native_library_win.cc create mode 100644 fml/platform/win/wstring_conversion.h delete mode 100644 fml/task_observer.h create mode 100644 fml/unique_fd.cc create mode 100644 fml/unique_fd.h create mode 100644 fml/unique_object.h delete mode 100644 lib/ui/painting/resource_context.cc delete mode 100644 lib/ui/painting/resource_context.h delete mode 100644 lib/ui/painting/utils.cc delete mode 100644 lib/ui/painting/utils.h delete mode 100644 runtime/dart_controller.cc delete mode 100644 runtime/dart_controller.h delete mode 100644 runtime/dart_init.cc delete mode 100644 runtime/dart_init.h create mode 100644 runtime/dart_isolate.cc create mode 100644 runtime/dart_isolate.h create mode 100644 runtime/dart_isolate_unittests.cc create mode 100644 runtime/dart_snapshot.cc create mode 100644 runtime/dart_snapshot.h create mode 100644 runtime/dart_snapshot_buffer.cc create mode 100644 runtime/dart_snapshot_buffer.h create mode 100644 runtime/dart_vm.cc create mode 100644 runtime/dart_vm.h create mode 100644 runtime/dart_vm_unittests.cc create mode 100644 runtime/fixtures/simple_main.dart delete mode 100644 runtime/runtime_init.cc delete mode 100644 runtime/runtime_init.h create mode 100644 runtime/service_protocol.cc create mode 100644 runtime/service_protocol.h create mode 100644 shell/common/io_manager.cc create mode 100644 shell/common/io_manager.h create mode 100644 shell/common/isolate_configuration.cc create mode 100644 shell/common/isolate_configuration.h delete mode 100644 shell/common/null_platform_view.cc delete mode 100644 shell/common/null_platform_view.h delete mode 100644 shell/common/null_rasterizer.cc delete mode 100644 shell/common/null_rasterizer.h delete mode 100644 shell/common/platform_view_service_protocol.cc delete mode 100644 shell/common/platform_view_service_protocol.h create mode 100644 shell/common/run_configuration.cc create mode 100644 shell/common/run_configuration.h create mode 100644 shell/common/shell_unittests.cc create mode 100644 shell/common/thread_host.cc create mode 100644 shell/common/thread_host.h delete mode 100644 shell/common/tracing_controller.cc delete mode 100644 shell/common/tracing_controller.h delete mode 100644 shell/gpu/gpu_rasterizer.cc delete mode 100644 shell/gpu/gpu_rasterizer.h create mode 100644 shell/platform/android/android_shell_holder.cc create mode 100644 shell/platform/android/android_shell_holder.h create mode 100644 shell/platform/android/platform_message_response_android.cc create mode 100644 shell/platform/android/platform_message_response_android.h create mode 100644 shell/platform/darwin/common/command_line.h create mode 100644 shell/platform/darwin/common/command_line.mm delete mode 100644 shell/platform/darwin/common/platform_mac.h delete mode 100644 shell/platform/darwin/common/platform_mac.mm delete mode 100644 shell/platform/darwin/common/process_info_mac.cc delete mode 100644 shell/platform/darwin/common/process_info_mac.h delete mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.h delete mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.m delete mode 100644 shell/platform/darwin/desktop/flutter_application.mm rename shell/platform/darwin/desktop/{flutter_application.h => flutter_application_delegate.h} (65%) create mode 100644 shell/platform/darwin/desktop/flutter_application_delegate.mm delete mode 100644 shell/platform/darwin/desktop/flutter_mac.xib delete mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.h delete mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h delete mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.h delete mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm create mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h create mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm create mode 100644 shell/platform/embedder/embedder_engine.cc create mode 100644 shell/platform/embedder/embedder_engine.h delete mode 100644 shell/platform/linux/BUILD.gn delete mode 100644 shell/platform/linux/main_linux.cc delete mode 100644 shell/platform/win/BUILD.gn delete mode 100644 shell/platform/win/main_win.cc delete mode 100644 shell/testing/platform_view_test.cc delete mode 100644 shell/testing/platform_view_test.h delete mode 100644 shell/testing/test_runner.cc delete mode 100644 shell/testing/test_runner.h create mode 100644 shell/testing/tester_main.cc delete mode 100644 shell/testing/testing.cc delete mode 100644 shell/testing/testing.h delete mode 100644 synchronization/debug_thread_checker.h create mode 100644 testing/thread_test.cc create mode 100644 testing/thread_test.h diff --git a/BUILD.gn b/BUILD.gn index 24dda026c6245..b37b0b8d4054c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,14 +10,12 @@ group("flutter") { public_deps = [ "$flutter_root/lib/snapshot:generate_snapshot_bin", "$flutter_root/lib/snapshot:kernel_platform_files", + "$flutter_root/shell/testing", "$flutter_root/sky", - "$flutter_root/third_party/txt", ] if (flutter_runtime_mode != "debug") { - public_deps += [ - "$flutter_root/lib/snapshot:entry_points_json_files", - ] + public_deps += [ "$flutter_root/lib/snapshot:entry_points_json_files" ] } if (!is_fuchsia && !is_fuchsia_host) { @@ -45,20 +43,24 @@ group("flutter") { "$flutter_root/shell/platform/embedder:flutter_embedder_framework", ] } - if (!is_win) { - public_deps += [ - "$flutter_root/shell/platform/embedder:embedder_unittests", - "$flutter_root/shell/platform/embedder:flutter_engine", - ] - } + public_deps += [ "$flutter_root/flow:flow_unittests", "$flutter_root/fml:fml_unittests", + "$flutter_root/runtime:runtime_unittests", + "$flutter_root/shell/common:shell_unittests", "$flutter_root/sky/engine/wtf:wtf_unittests", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", "//garnet/public/lib/fxl:fxl_unittests", ] + + if (!is_win) { + public_deps += [ + "$flutter_root/shell/platform/embedder:embedder_unittests", + "$flutter_root/shell/platform/embedder:flutter_engine", + ] + } } } @@ -74,29 +76,23 @@ if (is_fuchsia) { "$flutter_root/content_handler:aot", ] if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] + deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] } binary = "flutter_aot_runner" if (flutter_runtime_mode != "release") { - resources = [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] + resources = [ { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + } ] } - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] + meta = [ { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + } ] } package("flutter_jit_runner") { @@ -104,29 +100,23 @@ if (is_fuchsia) { "$flutter_root/content_handler:jit", ] if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] + deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] } binary = "flutter_jit_runner" if (flutter_runtime_mode != "release") { - resources = [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] + resources = [ { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + } ] } - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] + meta = [ { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + } ] } } else { group("dist") { diff --git a/DEPS b/DEPS index f771a4be4088b..d7f022879b66c 100644 --- a/DEPS +++ b/DEPS @@ -115,7 +115,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '8dddd90bf943a8174913564353b30a3b11ee0f7a', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '3cf97e01cdbd4bb920fa3d40282a56c4b2d62a58', # Fuchsia compatibility # diff --git a/assets/BUILD.gn b/assets/BUILD.gn index c4901375ad810..28d7e569659f1 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -4,16 +4,18 @@ source_set("assets") { sources = [ - "asset_provider.h", + "asset_manager.cc", + "asset_manager.h", + "asset_resolver.h", "directory_asset_bundle.cc", "directory_asset_bundle.h", - "unzipper_provider.cc", - "unzipper_provider.h", "zip_asset_store.cc", "zip_asset_store.h", ] deps = [ + "$flutter_root/common", + "$flutter_root/fml", "$flutter_root/glue", "//garnet/public/lib/fxl", "//garnet/public/lib/zip", @@ -23,7 +25,5 @@ source_set("assets") { "//third_party/zlib:minizip", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc new file mode 100644 index 0000000000000..9833eee923257 --- /dev/null +++ b/assets/asset_manager.cc @@ -0,0 +1,59 @@ +// Copyright 2017 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/assets/asset_manager.h" + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/glue/trace_event.h" +#include "lib/fxl/files/path.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace blink { + +AssetManager::AssetManager() = default; + +AssetManager::~AssetManager() = default; + +void AssetManager::PushFront(std::unique_ptr resolver) { + if (resolver == nullptr || !resolver->IsValid()) { + return; + } + + resolvers_.push_front(std::move(resolver)); +} + +void AssetManager::PushBack(std::unique_ptr resolver) { + if (resolver == nullptr || !resolver->IsValid()) { + return; + } + + resolvers_.push_back(std::move(resolver)); +} + +// |blink::AssetResolver| +bool AssetManager::GetAsBuffer(const std::string& asset_name, + std::vector* data) const { + if (asset_name.size() == 0) { + return false; + } + TRACE_EVENT0("flutter", "AssetManager::GetAsBuffer"); + for (const auto& resolver : resolvers_) { + if (resolver->GetAsBuffer(asset_name, data)) { + return true; + } + } + FXL_DLOG(ERROR) << "Could not find asset: " << asset_name; + return false; +} + +// |blink::AssetResolver| +bool AssetManager::IsValid() const { + return resolvers_.size() > 0; +} + +} // namespace blink diff --git a/assets/asset_manager.h b/assets/asset_manager.h new file mode 100644 index 0000000000000..fc7f3ef05210e --- /dev/null +++ b/assets/asset_manager.h @@ -0,0 +1,47 @@ +// Copyright 2017 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_ASSETS_ASSET_MANAGER_H_ +#define FLUTTER_ASSETS_ASSET_MANAGER_H_ + +#include +#include +#include + +#include "flutter/assets/asset_resolver.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" + +namespace blink { + +class AssetManager final : public AssetResolver, + public fxl::RefCountedThreadSafe { + public: + void PushFront(std::unique_ptr resolver); + + void PushBack(std::unique_ptr resolver); + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; + + private: + std::deque> resolvers_; + + AssetManager(); + + ~AssetManager(); + + FXL_DISALLOW_COPY_AND_ASSIGN(AssetManager); + FRIEND_MAKE_REF_COUNTED(AssetManager); + FRIEND_REF_COUNTED_THREAD_SAFE(AssetManager); +}; + +} // namespace blink + +#endif // FLUTTER_ASSETS_ASSET_MANAGER_H_ diff --git a/assets/asset_provider.h b/assets/asset_provider.h deleted file mode 100644 index 68b7f5c2b7b9c..0000000000000 --- a/assets/asset_provider.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -#ifndef FLUTTER_ASSETS_ASSET_PROVIDER_H_ -#define FLUTTER_ASSETS_ASSET_PROVIDER_H_ - -#include -#include - -#include "lib/fxl/memory/ref_counted.h" - -namespace blink { - -class AssetProvider - : public fxl::RefCountedThreadSafe - { - public: - virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data) = 0; - virtual ~AssetProvider() = default; -}; - -} // namespace blink -#endif // FLUTTER_ASSETS_ASSET_PROVIDER_H diff --git a/assets/asset_resolver.h b/assets/asset_resolver.h new file mode 100644 index 0000000000000..6cfe27961a9f4 --- /dev/null +++ b/assets/asset_resolver.h @@ -0,0 +1,32 @@ +// Copyright 2017 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_ASSETS_ASSET_RESOLVER_H_ +#define FLUTTER_ASSETS_ASSET_RESOLVER_H_ + +#include +#include + +#include "lib/fxl/macros.h" + +namespace blink { + +class AssetResolver { + public: + AssetResolver() = default; + + virtual ~AssetResolver() = default; + + virtual bool IsValid() const = 0; + + virtual bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const = 0; + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(AssetResolver); +}; + +} // namespace blink + +#endif // FLUTTER_ASSETS_ASSET_RESOLVER_H_ diff --git a/assets/directory_asset_bundle.cc b/assets/directory_asset_bundle.cc index 43933079a81bd..8e5d4df2ab977 100644 --- a/assets/directory_asset_bundle.cc +++ b/assets/directory_asset_bundle.cc @@ -3,73 +3,54 @@ // found in the LICENSE file. #include "flutter/assets/directory_asset_bundle.h" -#include "lib/fxl/build_config.h" - -#include #include +#include "flutter/fml/file.h" +#include "flutter/fml/mapping.h" #include "lib/fxl/files/eintr_wrapper.h" -#include "lib/fxl/files/file.h" -#include "lib/fxl/files/path.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/portable_unistd.h" namespace blink { -bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, - std::vector* data) { - if (fd_.is_valid()) { -#if defined(OS_WIN) - // This code path is not valid in a Windows environment. - return false; -#else - fxl::UniqueFD asset_file(openat(fd_.get(), asset_name.c_str(), O_RDONLY)); - if (!asset_file.is_valid()) - return false; - - constexpr size_t kBufferSize = 1 << 16; - size_t offset = 0; - ssize_t bytes_read = 0; - do { - offset += bytes_read; - data->resize(offset + kBufferSize); - bytes_read = read(asset_file.get(), &(*data)[offset], kBufferSize); - } while (bytes_read > 0); +DirectoryAssetBundle::DirectoryAssetBundle(fml::UniqueFD descriptor) + : descriptor_(std::move(descriptor)) { + if (!fml::IsDirectory(descriptor_)) { + return; + } + is_valid_ = true; +} - if (bytes_read < 0) { - FXL_LOG(ERROR) << "Reading " << asset_name << " failed"; - data->clear(); - return false; - } +DirectoryAssetBundle::~DirectoryAssetBundle() = default; - data->resize(offset + bytes_read); - return true; -#endif - } - std::string asset_path = GetPathForAsset(asset_name); - if (asset_path.empty()) - return false; - return files::ReadFileToVector(asset_path, data); +// |blink::AssetResolver| +bool DirectoryAssetBundle::IsValid() const { + return is_valid_; } -DirectoryAssetBundle::~DirectoryAssetBundle() {} +// |blink::AssetResolver| +bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, + std::vector* data) const { + if (data == nullptr) { + return false; + } -DirectoryAssetBundle::DirectoryAssetBundle(std::string directory) - : directory_(std::move(directory)), fd_() {} + if (!is_valid_) { + FXL_DLOG(WARNING) << "Asset bundle was not valid."; + return false; + } -DirectoryAssetBundle::DirectoryAssetBundle(fxl::UniqueFD fd) - : fd_(std::move(fd)) {} + fml::FileMapping mapping( + fml::OpenFile(descriptor_, asset_name.c_str(), fml::OpenPermission::kRead, + false /* directory */), + false /* executable */); -std::string DirectoryAssetBundle::GetPathForAsset( - const std::string& asset_name) { - std::string asset_path = files::SimplifyPath(directory_ + "/" + asset_name); - if (asset_path.find(directory_) != 0u) { - FXL_LOG(ERROR) << "Asset name '" << asset_name - << "' attempted to traverse outside asset bundle."; - return std::string(); + if (mapping.GetMapping() == nullptr) { + return false; } - return asset_path; + + data->resize(mapping.GetSize()); + memmove(data->data(), mapping.GetMapping(), mapping.GetSize()); + return true; } } // namespace blink diff --git a/assets/directory_asset_bundle.h b/assets/directory_asset_bundle.h index c710a513796ae..b594e1357fbe2 100644 --- a/assets/directory_asset_bundle.h +++ b/assets/directory_asset_bundle.h @@ -5,31 +5,31 @@ #ifndef FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ #define FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ -#include -#include - -#include "flutter/assets/asset_provider.h" -#include "lib/fxl/files/unique_fd.h" +#include "flutter/assets/asset_resolver.h" +#include "flutter/fml/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class DirectoryAssetBundle - : public AssetProvider { +class DirectoryAssetBundle : public AssetResolver { public: - explicit DirectoryAssetBundle(std::string directory); - // Expects fd to be valid, otherwise the file descriptor is ignored. - explicit DirectoryAssetBundle(fxl::UniqueFD fd); - virtual ~DirectoryAssetBundle(); - - virtual bool GetAsBuffer(const std::string& asset_name, std::vector* data); + explicit DirectoryAssetBundle(fml::UniqueFD descriptor); - std::string GetPathForAsset(const std::string& asset_name); + ~DirectoryAssetBundle() override; private: - const std::string directory_; - fxl::UniqueFD fd_; + const fml::UniqueFD descriptor_; + bool is_valid_ = false; + + std::string GetPathForAsset(const std::string& asset_name) const; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); }; diff --git a/assets/unzipper_provider.cc b/assets/unzipper_provider.cc deleted file mode 100644 index 8ed023f9a20e9..0000000000000 --- a/assets/unzipper_provider.cc +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/assets/unzipper_provider.h" - -#include "lib/fxl/logging.h" -#include "third_party/zlib/contrib/minizip/unzip.h" - -namespace blink { - -UnzipperProvider GetUnzipperProviderForPath(std::string zip_path) { - return [zip_path]() { - zip::UniqueUnzipper unzipper(unzOpen2(zip_path.c_str(), nullptr)); - if (!unzipper.is_valid()) - FXL_LOG(ERROR) << "Unable to open zip file: " << zip_path; - return unzipper; - }; -} - -} // namespace blink diff --git a/assets/unzipper_provider.h b/assets/unzipper_provider.h deleted file mode 100644 index f0f8d9597dffd..0000000000000 --- a/assets/unzipper_provider.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_ASSETS_UNZIP_PROVIDER_H_ -#define FLUTTER_ASSETS_UNZIP_PROVIDER_H_ - -#include - -#include "lib/zip/unique_unzipper.h" - -namespace blink { - -using UnzipperProvider = std::function; - -UnzipperProvider GetUnzipperProviderForPath(std::string zip_path); - -} // namespace blink - -#endif // FLUTTER_ASSETS_UNZIP_PROVIDER_H_ diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index c8534fa10c216..1b9216bd34530 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -15,21 +15,28 @@ #include #include "flutter/glue/trace_event.h" -#include "lib/fxl/files/eintr_wrapper.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/zip/unique_unzipper.h" namespace blink { -ZipAssetStore::ZipAssetStore(UnzipperProvider unzipper_provider) - : unzipper_provider_(std::move(unzipper_provider)) { +ZipAssetStore::ZipAssetStore(std::string file_path) + : file_path_(std::move(file_path)) { BuildStatCache(); } ZipAssetStore::~ZipAssetStore() = default; +zip::UniqueUnzipper ZipAssetStore::CreateUnzipper() const { + return zip::UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)}; +} + +// |blink::AssetResolver| +bool ZipAssetStore::IsValid() const { + return stat_cache_.size() > 0; +} + +// |blink::AssetResolver| bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, - std::vector* data) { + std::vector* data) const { TRACE_EVENT0("flutter", "ZipAssetStore::GetAsBuffer"); auto found = stat_cache_.find(asset_name); @@ -37,7 +44,7 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, return false; } - auto unzipper = unzipper_provider_(); + auto unzipper = CreateUnzipper(); if (!unzipper.is_valid()) { return false; @@ -73,7 +80,8 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, void ZipAssetStore::BuildStatCache() { TRACE_EVENT0("flutter", "ZipAssetStore::BuildStatCache"); - auto unzipper = unzipper_provider_(); + + auto unzipper = CreateUnzipper(); if (!unzipper.is_valid()) { return; diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h index 1ffda483ba9b7..558678e25bc08 100644 --- a/assets/zip_asset_store.h +++ b/assets/zip_asset_store.h @@ -6,21 +6,20 @@ #define FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ #include -#include -#include "flutter/assets/unzipper_provider.h" +#include "flutter/assets/asset_resolver.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" +#include "lib/zip/unique_unzipper.h" #include "third_party/zlib/contrib/minizip/unzip.h" namespace blink { -class ZipAssetStore : public fxl::RefCountedThreadSafe { +class ZipAssetStore final : public AssetResolver { public: - explicit ZipAssetStore(UnzipperProvider unzipper_provider); - ~ZipAssetStore(); + ZipAssetStore(std::string file_path); - bool GetAsBuffer(const std::string& asset_name, std::vector* data); + ~ZipAssetStore() override; private: struct CacheEntry { @@ -30,11 +29,20 @@ class ZipAssetStore : public fxl::RefCountedThreadSafe { : file_pos(p_file_pos), uncompressed_size(p_uncompressed_size) {} }; - UnzipperProvider unzipper_provider_; - std::map stat_cache_; + std::string file_path_; + mutable std::map stat_cache_; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; void BuildStatCache(); + zip::UniqueUnzipper CreateUnzipper() const; + FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); }; diff --git a/common/BUILD.gn b/common/BUILD.gn index 53b71914d49d1..47cd7d3d62644 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -12,11 +12,12 @@ source_set("common") { sources = [ "settings.cc", "settings.h", - "threads.cc", - "threads.h", + "task_runners.cc", + "task_runners.h", ] deps = [ + "$flutter_root/fml", "//garnet/public/lib/fxl", ] diff --git a/common/settings.cc b/common/settings.cc index 0198f714cbaad..85523e1b9a29f 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -4,26 +4,50 @@ #include "flutter/common/settings.h" -#include - -#include "lib/fxl/logging.h" +#include namespace blink { -namespace { - -Settings* g_settings = nullptr; - -} // namespace - -const Settings& Settings::Get() { - FXL_CHECK(g_settings); - return *g_settings; -} -void Settings::Set(const Settings& settings) { - FXL_CHECK(!g_settings); - g_settings = new Settings(); - *g_settings = settings; +std::string Settings::ToString() const { + std::stringstream stream; + stream << "Settings: " << std::endl; + stream << "aot_snapshot_path: " << aot_snapshot_path << std::endl; + stream << "script_snapshot_path: " << script_snapshot_path << std::endl; + stream << "aot_vm_snapshot_data_filename: " << aot_vm_snapshot_data_filename + << std::endl; + stream << "aot_vm_snapshot_instr_filename: " << aot_vm_snapshot_instr_filename + << std::endl; + stream << "aot_isolate_snapshot_data_filename: " + << aot_isolate_snapshot_data_filename << std::endl; + stream << "aot_isolate_snapshot_instr_filename: " + << aot_isolate_snapshot_instr_filename << std::endl; + stream << "application_library_path: " << application_library_path + << std::endl; + stream << "main_dart_file_path: " << main_dart_file_path << std::endl; + stream << "packages_file_path: " << packages_file_path << std::endl; + stream << "temp_directory_path: " << temp_directory_path << std::endl; + stream << "dart_flags:" << std::endl; + for (const auto& dart_flag : dart_flags) { + stream << " " << dart_flag << std::endl; + } + stream << "start_paused: " << start_paused << std::endl; + stream << "trace_skia: " << trace_skia << std::endl; + stream << "trace_startup: " << trace_startup << std::endl; + stream << "endless_trace_buffer: " << endless_trace_buffer << std::endl; + stream << "enable_dart_profiling: " << enable_dart_profiling << std::endl; + stream << "dart_non_checked_mode: " << dart_non_checked_mode << std::endl; + stream << "enable_observatory: " << enable_observatory << std::endl; + stream << "observatory_port: " << observatory_port << std::endl; + stream << "ipv6: " << ipv6 << std::endl; + stream << "use_test_fonts: " << use_test_fonts << std::endl; + stream << "enable_software_rendering: " << enable_software_rendering + << std::endl; + stream << "using_blink: " << using_blink << std::endl; + stream << "log_tag: " << log_tag << std::endl; + stream << "icu_data_path: " << icu_data_path << std::endl; + stream << "assets_dir: " << assets_dir << std::endl; + stream << "assets_path: " << assets_path << std::endl; + return stream.str(); } } // namespace blink diff --git a/common/settings.h b/common/settings.h index 5bb5c6cbbea42..c6c3159766a37 100644 --- a/common/settings.h +++ b/common/settings.h @@ -5,40 +5,82 @@ #ifndef FLUTTER_COMMON_SETTINGS_H_ #define FLUTTER_COMMON_SETTINGS_H_ +#include #include +#include #include #include +#include "flutter/fml/unique_fd.h" +#include "lib/fxl/functional/closure.h" + namespace blink { +using TaskObserverAdd = + std::function; +using TaskObserverRemove = std::function; + struct Settings { - bool enable_observatory = false; - // Port on target will be auto selected by the OS. A message will be printed - // on the target with the port after it has been selected. - uint32_t observatory_port = 0; - bool ipv6 = false; - bool start_paused = false; - bool trace_startup = false; - bool endless_trace_buffer = false; - bool enable_dart_profiling = false; - bool use_test_fonts = false; - bool dart_non_checked_mode = false; - bool enable_software_rendering = false; - bool using_blink = true; - std::string aot_shared_library_path; + // VM settings + std::string script_snapshot_path; + std::string kernel_snapshot_path; + std::string aot_snapshot_path; std::string aot_vm_snapshot_data_filename; std::string aot_vm_snapshot_instr_filename; std::string aot_isolate_snapshot_data_filename; std::string aot_isolate_snapshot_instr_filename; + std::string application_library_path; + std::string application_kernel_asset; + + std::string main_dart_file_path; + std::string packages_file_path; + std::string temp_directory_path; std::vector dart_flags; + + // Isolate settings + bool start_paused = false; + bool trace_skia = false; + bool trace_startup = false; + bool endless_trace_buffer = false; + bool enable_dart_profiling = false; + bool dart_non_checked_mode = false; + + // Observatory settings + bool enable_observatory = false; + // Port on target will be auto selected by the OS. A message will be printed + // on the target with the port after it has been selected. + uint32_t observatory_port = 0; + bool ipv6 = false; + + // Font settings + bool use_test_fonts = false; + + // Engine settings + TaskObserverAdd task_observer_add; + TaskObserverRemove task_observer_remove; + // The main isolate is current when this callback is made. This is a good spot + // to perform native Dart bindings for libraries not built in. + fxl::Closure root_isolate_create_callback; + // The isolate is not current and may have already been destroyed when this + // call is made. + fxl::Closure root_isolate_shutdown_callback; + bool enable_software_rendering = false; + bool using_blink = false; + bool skia_deterministic_rendering_on_cpu = false; std::string log_tag = "flutter"; + std::string icu_data_path; + + // Assets settings + fml::UniqueFD::element_type assets_dir = + fml::UniqueFD::traits_type::InvalidValue(); + std::string assets_path; + std::string flx_path; - static const Settings& Get(); - static void Set(const Settings& settings); + std::string ToString() const; }; } // namespace blink diff --git a/common/task_runners.cc b/common/task_runners.cc new file mode 100644 index 0000000000000..1a09daec1815c --- /dev/null +++ b/common/task_runners.cc @@ -0,0 +1,48 @@ +// Copyright 2017 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/common/task_runners.h" + +#include + +namespace blink { + +TaskRunners::TaskRunners(std::string label, + fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io) + : label_(std::move(label)), + platform_(std::move(platform)), + gpu_(std::move(gpu)), + ui_(std::move(ui)), + io_(std::move(io)) {} + +TaskRunners::~TaskRunners() = default; + +const std::string& TaskRunners::GetLabel() const { + return label_; +} + +fxl::RefPtr TaskRunners::GetPlatformTaskRunner() const { + return platform_; +} + +fxl::RefPtr TaskRunners::GetUITaskRunner() const { + return ui_; +} + +fxl::RefPtr TaskRunners::GetIOTaskRunner() const { + return io_; +} + +fxl::RefPtr TaskRunners::GetGPUTaskRunner() const { + return gpu_; +} + +bool TaskRunners::IsValid() const { + return platform_ && gpu_ && ui_ && io_; +} + +} // namespace blink diff --git a/common/task_runners.h b/common/task_runners.h new file mode 100644 index 0000000000000..f41ae147ebad0 --- /dev/null +++ b/common/task_runners.h @@ -0,0 +1,46 @@ +// Copyright 2017 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 + +#include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" + +namespace blink { + +class TaskRunners { + public: + TaskRunners(std::string label, + fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io); + + ~TaskRunners(); + + const std::string& GetLabel() const; + + fxl::RefPtr GetPlatformTaskRunner() const; + + fxl::RefPtr GetUITaskRunner() const; + + fxl::RefPtr GetIOTaskRunner() const; + + fxl::RefPtr GetGPUTaskRunner() const; + + bool IsValid() const; + + private: + const std::string label_; + fxl::RefPtr platform_; + fxl::RefPtr gpu_; + fxl::RefPtr ui_; + fxl::RefPtr io_; +}; +} // namespace blink + +#endif // FLUTTER_COMMON_TASK_RUNNERS_H_ diff --git a/common/threads.cc b/common/threads.cc deleted file mode 100644 index 3634d8d7c8723..0000000000000 --- a/common/threads.cc +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/common/threads.h" - -#include - -namespace blink { -namespace { - -Threads* g_threads = nullptr; - -} // namespace - -Threads::Threads() {} - -Threads::Threads(fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io) - : platform_(std::move(platform)), - gpu_(std::move(gpu)), - ui_(std::move(ui)), - io_(std::move(io)) {} - -Threads::~Threads() {} - -const fxl::RefPtr& Threads::Platform() { - return Get().platform_; -} - -const fxl::RefPtr& Threads::Gpu() { - return Get().gpu_; -} - -const fxl::RefPtr& Threads::UI() { - return Get().ui_; -} - -const fxl::RefPtr& Threads::IO() { - return Get().io_; -} - -const Threads& Threads::Get() { - FXL_CHECK(g_threads); - return *g_threads; -} - -void Threads::Set(const Threads& threads) { - FXL_CHECK(!g_threads); - g_threads = new Threads(); - *g_threads = threads; -} - -} // namespace blink diff --git a/common/threads.h b/common/threads.h deleted file mode 100644 index 456a5eba8ad97..0000000000000 --- a/common/threads.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_COMMON_THREADS_H_ -#define FLUTTER_COMMON_THREADS_H_ - -#include "lib/fxl/tasks/task_runner.h" - -#define ASSERT_IS_PLATFORM_THREAD \ - FXL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread()); -#define ASSERT_IS_GPU_THREAD \ - FXL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread()); -#define ASSERT_IS_UI_THREAD \ - FXL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread()); -#define ASSERT_IS_IO_THREAD \ - FXL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread()); - -namespace blink { - -class Threads { - public: - Threads(); - Threads(fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io); - ~Threads(); - - static const fxl::RefPtr& Platform(); - static const fxl::RefPtr& Gpu(); - static const fxl::RefPtr& UI(); - static const fxl::RefPtr& IO(); - - static void Set(const Threads& settings); - - private: - static const Threads& Get(); - - fxl::RefPtr platform_; - fxl::RefPtr gpu_; - fxl::RefPtr ui_; - fxl::RefPtr io_; -}; - -} // namespace blink - -#endif // FLUTTER_COMMON_THREADS_H_ diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 6bc00b4e2786c..4778784baa643 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -20,23 +20,28 @@ template("flutter_content_handler") { sources = [ "accessibility_bridge.cc", "accessibility_bridge.h", - "app.cc", - "app.h", - "application_controller_impl.cc", - "application_controller_impl.h", + "application.cc", + "application.h", + "application_runner.cc", + "application_runner.h", + "compositor_context.cc", + "compositor_context.h", + "engine.cc", + "engine.h", "fuchsia_font_manager.cc", "fuchsia_font_manager.h", + "isolate_configurator.cc", + "isolate_configurator.h", "main.cc", - "rasterizer.cc", - "rasterizer.h", - "runtime_holder.cc", - "runtime_holder.h", - "service_protocol_hooks.cc", - "service_protocol_hooks.h", + "platform_view.cc", + "platform_view.h", "session_connection.cc", "session_connection.h", - "vulkan_rasterizer.cc", - "vulkan_rasterizer.h", + "surface.cc", + "surface.h", + "task_observers.cc", + "task_observers.h", + "unique_fdio_ns.h", "vulkan_surface.cc", "vulkan_surface.h", "vulkan_surface_pool.cc", @@ -45,18 +50,26 @@ template("flutter_content_handler") { "vulkan_surface_producer.h", ] + # The use of these dependencies is temporary and will be moved behind the + # embedder API. + flutter_deps = [ + "$flutter_root/assets", + "$flutter_root/common", + "$flutter_root/flow", + "$flutter_root/glue", + "$flutter_root/lib/ui", + "$flutter_root/runtime", + "$flutter_root/sky/engine/platform", + "$flutter_root/third_party/txt", + "$flutter_root/vulkan", + "$flutter_root/fml", + "$flutter_root/shell/common", + "$flutter_root/shell/gpu", + ] + deps = [ "//third_party/dart/runtime/bin:libdart_builtin", "//third_party/dart/runtime/platform:libdart_platform", - "$flutter_root/assets", - "$flutter_root/common", - "$flutter_root/flow", - "$flutter_root/glue", - "$flutter_root/lib/ui", - "$flutter_root/runtime", - "$flutter_root/sky/engine/platform", - "$flutter_root/third_party/txt", - "$flutter_root/vulkan", "//garnet/public/lib/app/cpp", "//garnet/public/lib/fsl", "//garnet/public/lib/fxl", @@ -73,8 +86,10 @@ template("flutter_content_handler") { "//topaz/lib/tonic", "//topaz/public/dart-pkg/fuchsia", "//topaz/public/lib/ui/flutter/sdk_ext", + "//third_party/skia:gpu", + "//third_party/zlib:minizip", "//zircon/public/lib/trace-provider", - ] + extra_deps + ] + extra_deps + flutter_deps # The flags below are needed so that Dart's CPU profiler can walk the # C++ stack. diff --git a/content_handler/README.md b/content_handler/README.md new file mode 100644 index 0000000000000..4461e808d1a47 --- /dev/null +++ b/content_handler/README.md @@ -0,0 +1,4 @@ +Flutter Application Runner +========================== + +Implements the `component::ApplicationRunner` FIDL interface to launch and run mutliple Flutter applications within the same process. diff --git a/content_handler/accessibility_bridge.cc b/content_handler/accessibility_bridge.cc index cb6f9b8e21155..f3d52f6cdbbb6 100644 --- a/content_handler/accessibility_bridge.cc +++ b/content_handler/accessibility_bridge.cc @@ -2,21 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/content_handler/accessibility_bridge.h" +#include "accessibility_bridge.h" #include -#include "flutter/lib/ui/semantics/semantics_node.h" #include "lib/app/cpp/application_context.h" -#include "lib/fxl/macros.h" +#include "lib/context/fidl/context_writer.fidl.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/stringbuffer.h" #include "third_party/rapidjson/rapidjson/writer.h" -namespace flutter_runner { +namespace flutter { -AccessibilityBridge::AccessibilityBridge(component::ApplicationContext* context) - : writer_(context->ConnectToEnvironmentService()) {} +AccessibilityBridge::AccessibilityBridge(maxwell::ContextWriterPtr writer) + : writer_(std::move(writer)) {} + +AccessibilityBridge::~AccessibilityBridge() = default; void AccessibilityBridge::UpdateSemantics( const blink::SemanticsNodeUpdates& update) { @@ -77,4 +78,4 @@ void AccessibilityBridge::EraseUnvisitedNodes( } } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h index 7ac54e754d9b6..dde8bfaa54c36 100644 --- a/content_handler/accessibility_bridge.h +++ b/content_handler/accessibility_bridge.h @@ -2,28 +2,32 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ -#define FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ +#pragma once #include #include "flutter/lib/ui/semantics/semantics_node.h" -#include "lib/app/cpp/application_context.h" -#include +#include "lib/context/fidl/context_writer.fidl.h" +#include "lib/fxl/macros.h" -namespace flutter_runner { +namespace flutter { // Maintain an up-to-date list of SemanticsNodes on screen, and communicate // with the Context Service. -class AccessibilityBridge { +class AccessibilityBridge final { public: - explicit AccessibilityBridge(component::ApplicationContext* context); + AccessibilityBridge(maxwell::ContextWriterPtr writer); + + ~AccessibilityBridge(); // Update the internal representation of the semantics nodes, and write the // semantics to Context Service. void UpdateSemantics(const blink::SemanticsNodeUpdates& update); private: + maxwell::ContextWriterPtr writer_; + std::map semantics_nodes_; + // Walk the semantics node tree starting at |id|, and store the id of each // visited child in |visited_nodes|. void UpdateVisitedForNodeAndChildren(const int id, @@ -33,10 +37,7 @@ class AccessibilityBridge { // |visited_nodes|. void EraseUnvisitedNodes(const std::vector& visited_nodes); - std::map semantics_nodes_; - modular::ContextWriterPtr writer_; + FXL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); }; -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ +} // namespace flutter diff --git a/content_handler/app.cc b/content_handler/app.cc deleted file mode 100644 index 1f1bde833d2f3..0000000000000 --- a/content_handler/app.cc +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/app.h" - -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" -#include "flutter/content_handler/fuchsia_font_manager.h" -#include "flutter/lib/ui/text/font_collection.h" -#include "flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" -#include "lib/icu_data/cpp/icu_data.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace flutter_runner { -namespace { - -static App* g_app = nullptr; - -void QuitMessageLoop() { - fsl::MessageLoop::GetCurrent()->QuitNow(); -} - -std::string GetLabelFromURL(const std::string& url) { - size_t last_slash = url.rfind('/'); - if (last_slash == std::string::npos || last_slash + 1 == url.length()) - return url; - return url.substr(last_slash + 1); -} - -} // namespace - -App::App() { - g_app = this; - context_ = component::ApplicationContext::CreateFromStartupInfo(); - - gpu_thread_ = std::make_unique(); - io_thread_ = std::make_unique(); - - auto gpu_thread_success = gpu_thread_->Run(); - auto io_thread_success = io_thread_->Run(); - - FXL_CHECK(gpu_thread_success) << "Must be able to create the GPU thread"; - FXL_CHECK(io_thread_success) << "Must be able to create the IO thread"; - - auto ui_task_runner = fsl::MessageLoop::GetCurrent()->task_runner(); - auto gpu_task_runner = gpu_thread_->TaskRunner(); - auto io_task_runner = io_thread_->TaskRunner(); - - // Notice that the Platform and UI threads are actually the same. - blink::Threads::Set(blink::Threads(ui_task_runner, // Platform - gpu_task_runner, // GPU - ui_task_runner, // UI - io_task_runner // IO - )); - - if (!icu_data::Initialize(context_.get())) { - FXL_LOG(ERROR) << "Could not initialize ICU data."; - } - - blink::Settings settings; - settings.enable_observatory = true; - blink::Settings::Set(settings); - - fonts::FontProviderPtr font_provider( - context_->ConnectToEnvironmentService()); - if (settings.using_blink) { - blink::SetFontProvider(std::move(font_provider)); - } else { - blink::FontCollection::ForProcess().GetFontCollection()-> - SetAssetFontManager( - sk_make_sp(std::move(font_provider))); - } - - context_->outgoing_services()->AddService( - [this](fidl::InterfaceRequest request) { - runner_bindings_.AddBinding(this, std::move(request)); - }); -} - -App::~App() { - icu_data::Release(); - blink::Threads::Gpu()->PostTask(QuitMessageLoop); - blink::Threads::IO()->PostTask(QuitMessageLoop); - g_app = nullptr; -} - -App& App::Shared() { - FXL_DCHECK(g_app); - return *g_app; -} - -void App::WaitForPlatformViewIds( - std::vector* platform_view_ids) { - fxl::AutoResetWaitableEvent latch; - - blink::Threads::UI()->PostTask([this, platform_view_ids, &latch]() { - WaitForPlatformViewsIdsUIThread(platform_view_ids, &latch); - }); - - latch.Wait(); -} - -void App::WaitForPlatformViewsIdsUIThread( - std::vector* platform_view_ids, - fxl::AutoResetWaitableEvent* latch) { - for (auto it = controllers_.begin(); it != controllers_.end(); it++) { - ApplicationControllerImpl* controller = it->first; - - if (!controller) { - continue; - } - - PlatformViewInfo info; - // TODO(zra): We should create real IDs for these instead of relying on the - // address of the controller. Maybe just use the UI Isolate main port? - info.view_id = reinterpret_cast(controller); - info.isolate_id = controller->GetUIIsolateMainPort(); - info.isolate_name = controller->GetUIIsolateName(); - platform_view_ids->push_back(info); - } - latch->Signal(); -} - -void App::StartApplication( - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) { - if (controllers_.empty()) { - // Name this process after the url of the first application being launched. - base_label_ = "flutter:" + GetLabelFromURL(startup_info.launch_info.url); - } - - std::unique_ptr impl = - std::make_unique(this, std::move(application), - std::move(startup_info), - std::move(controller)); - ApplicationControllerImpl* key = impl.get(); - controllers_.emplace(key, std::move(impl)); - - UpdateProcessLabel(); -} - -void App::Destroy(ApplicationControllerImpl* controller) { - auto it = controllers_.find(controller); - if (it == controllers_.end()) - return; - controllers_.erase(it); - UpdateProcessLabel(); -} - -void App::UpdateProcessLabel() { - std::string label; - if (controllers_.size() < 2) { - label = base_label_; - } else { - std::string suffix = " (+" + std::to_string(controllers_.size() - 1) + ")"; - if (base_label_.size() + suffix.size() <= ZX_MAX_NAME_LEN - 1) { - label = base_label_ + suffix; - } else { - label = base_label_.substr(0, ZX_MAX_NAME_LEN - 1 - suffix.size() - 3) + - "..." + suffix; - } - } - zx::process::self().set_property(ZX_PROP_NAME, label.c_str(), label.size()); -} - -} // namespace flutter_runner diff --git a/content_handler/app.h b/content_handler/app.h deleted file mode 100644 index dc8c49927d897..0000000000000 --- a/content_handler/app.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_APP_H_ -#define FLUTTER_CONTENT_HANDLER_APP_H_ - -#include -#include - -#include "flutter/content_handler/application_controller_impl.h" -#include "lib/app/cpp/application_context.h" -#include -#include "lib/fsl/threading/thread.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/synchronization/waitable_event.h" - -namespace flutter_runner { - -class App : public component::ApplicationRunner { - public: - App(); - ~App(); - - static App& Shared(); - - // |component::ApplicationRunner| implementation: - - void StartApplication( - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) override; - - void Destroy(ApplicationControllerImpl* controller); - - struct PlatformViewInfo { - uintptr_t view_id; - int64_t isolate_id; - std::string isolate_name; - }; - - void WaitForPlatformViewIds(std::vector* platform_view_ids); - - private: - void WaitForPlatformViewsIdsUIThread( - std::vector* platform_view_ids, - fxl::AutoResetWaitableEvent* latch); - void UpdateProcessLabel(); - - std::unique_ptr context_; - std::unique_ptr gpu_thread_; - std::unique_ptr io_thread_; - fidl::BindingSet runner_bindings_; - std::unordered_map> - controllers_; - std::string base_label_; - - FXL_DISALLOW_COPY_AND_ASSIGN(App); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_APP_H_ diff --git a/content_handler/application.cc b/content_handler/application.cc new file mode 100644 index 0000000000000..7dd2270d42317 --- /dev/null +++ b/content_handler/application.cc @@ -0,0 +1,313 @@ +// Copyright 2018 The Fuchsia 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 "application.h" + +#include +#include + +#include + +#include "flutter/shell/common/switches.h" +#include "lib/fsl/vmo/file.h" +#include "lib/fsl/vmo/vector.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "task_observers.h" + +namespace flutter { + +std::pair, std::unique_ptr> +Application::Create( + Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller) { + auto thread = std::make_unique(); + std::unique_ptr application; + + fxl::AutoResetWaitableEvent latch; + thread->TaskRunner()->PostTask([&]() mutable { + application.reset(new Application(delegate, // + std::move(package), // + std::move(startup_info), // + std::move(controller) // + )); + latch.Signal(); + }); + thread->Run(); + latch.Wait(); + return {std::move(thread), std::move(application)}; +} + +static std::string DebugLabelForURL(const std::string url) { + auto found = url.rfind("/"); + if (found == std::string::npos) { + return url; + } else { + return {url, found + 1}; + } +} + +Application::Application( + Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest + application_controller_request) + : delegate_(delegate), + debug_label_(DebugLabelForURL(startup_info->launch_info->url)), + application_controller_(this) { + application_controller_.set_error_handler([this]() { Kill(); }); + + FXL_DCHECK(fdio_ns_.is_valid()); + // ApplicationLaunchInfo::url non-optional. + auto& launch_info = startup_info->launch_info; + + // ApplicationLaunchInfo::arguments optional. + if (auto& arguments = launch_info->arguments) { + settings_ = shell::SettingsFromCommandLine( + fxl::CommandLineFromIterators(arguments->begin(), arguments->end())); + } + + // TODO: ApplicationLaunchInfo::out optional. + + // TODO: ApplicationLaunchInfo::err optional. + + // ApplicationLaunchInfo::service_request optional. + if (launch_info->directory_request) { + service_provider_bridge_.ServeDirectory( + std::move(launch_info->directory_request)); + } + + // ApplicationLaunchInfo::flat_namespace optional. + if (auto& flat_namespace = startup_info->flat_namespace) { + for (size_t i = 0; i < flat_namespace->paths->size(); ++i) { + const auto& path = flat_namespace->paths->at(i); + if (path == "/svc") { + continue; + } + + zx::channel dir = std::move(flat_namespace->directories->at(i)); + zx_handle_t dir_handle = dir.release(); + if (fdio_ns_bind(fdio_ns_.get(), path->data(), dir_handle) != ZX_OK) { + FXL_DLOG(ERROR) << "Could not bind path to namespace: " << path; + zx_handle_close(dir_handle); + } + } + } else { + FXL_DLOG(ERROR) << "There was no flat namespace."; + } + + application_directory_.reset(fdio_ns_opendir(fdio_ns_.get())); + FXL_DCHECK(application_directory_.is_valid()); + + application_assets_directory_.reset( + openat(application_directory_.get(), "pkg/data", O_RDONLY | O_DIRECTORY)); + + // TODO: ApplicationLaunchInfo::additional_services optional. + + // ApplicationPackage::data: This is legacy FLX data. Ensure that we dont have + // any. + FXL_DCHECK(!package->data) << "Legacy FLX data must not be supplied."; + + // All launch arguments have been read. Perform service binding and + // final settings configuration. The next call will be to create a view + // for this application. + + service_provider_bridge_.AddService( + std::bind(&Application::CreateShellForView, this, std::placeholders::_1)); + + component::ServiceProviderPtr outgoing_services; + outgoing_services_request_ = outgoing_services.NewRequest(); + service_provider_bridge_.set_backend(std::move(outgoing_services)); + + // Setup the application controller binding. + if (application_controller_request) { + application_controller_.Bind(std::move(application_controller_request)); + } + + application_context_ = + component::ApplicationContext::CreateFrom(std::move(startup_info)); + + settings_.enable_observatory = true; + + settings_.icu_data_path = ""; + + settings_.using_blink = false; + + settings_.assets_dir = application_assets_directory_.get(); + + settings_.script_snapshot_path = "snapshot_blob.bin"; + + settings_.log_tag = debug_label_ + std::string{"(flutter)"}; + +#ifndef NDEBUG + // Debug mode + settings_.dart_non_checked_mode = false; +#else // NDEBUG + // Release mode + settings_.dart_non_checked_mode = true; +#endif // NDEBUG + + settings_.task_observer_add = + std::bind(&CurrentMessageLoopAddAfterTaskObserver, std::placeholders::_1, + std::placeholders::_2); + + settings_.task_observer_remove = std::bind( + &CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1); + + AttemptVMLaunchWithCurrentSettings(settings_); +} + +Application::~Application() = default; + +void Application::AttemptVMLaunchWithCurrentSettings( + const blink::Settings& settings) const { + if (blink::DartVM::ForProcessIfInitialized()) { + return; + } + + if (!blink::DartVM::IsRunningPrecompiledCode()) { + // We will be initializing the VM lazily in this case. + return; + } + + fsl::SizedVmo dylib_vmo; + + if (!fsl::VmoFromFilenameAt( + application_assets_directory_.get() /* /pkg/data */, "libapp.so", + &dylib_vmo)) { + FXL_LOG(ERROR) << "Dylib containing VM and isolate snapshots does not " + "exist. Will not be able to launch VM."; + return; + } + + dlerror(); + + auto library_handle = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); + + if (library_handle == nullptr) { + FXL_LOG(ERROR) << "Could not open dylib: " << dlerror(); + return; + } + + auto lib = fxl::MakeRefCounted( + library_handle, // library handle + true // close the handle when done + ); + + auto symbol = [](const char* str) { + return std::string{"_"} + std::string{str}; + }; + + fxl::RefPtr vm_snapshot = + fxl::MakeRefCounted( + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kVMDataSymbol).c_str()), + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kVMInstructionsSymbol).c_str())); + + fxl::RefPtr isolate_snapshot = + fxl::MakeRefCounted( + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kIsolateDataSymbol).c_str()), + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, + symbol(blink::DartSnapshot::kIsolateInstructionsSymbol).c_str())); + + blink::DartVM::ForProcess(settings_, // + std::move(vm_snapshot), // + std::move(isolate_snapshot) // + ); + if (blink::DartVM::ForProcessIfInitialized()) { + FXL_DLOG(INFO) << "VM successfully initialized for AOT mode."; + } else { + FXL_LOG(ERROR) << "VM could not be initialized for AOT mode."; + } +} + +// |component::ApplicationController| +void Application::Kill() { + if (last_return_code_.first) { + for (auto wait_callback : wait_callbacks_) { + wait_callback(last_return_code_.second); + } + } + wait_callbacks_.clear(); + + delegate_.OnApplicationTerminate(this); + // WARNING: Don't do anything past this point as this instance may have been + // collected. +} + +// |component::ApplicationController| +void Application::Detach() { + application_controller_.set_error_handler(nullptr); +} + +// |component::ApplicationController| +void Application::Wait(const WaitCallback& callback) { + wait_callbacks_.emplace_back(std::move(callback)); +} + +// |flutter::Engine::Delegate| +void Application::OnEngineTerminate(const Engine* shell_holder) { + auto found = std::find_if(shell_holders_.begin(), shell_holders_.end(), + [shell_holder](const auto& holder) { + return holder.get() == shell_holder; + }); + + if (found == shell_holders_.end()) { + return; + } + + // We may launch multiple shell in this application. However, we will + // terminate when the last shell goes away. The error code return to the + // application controller will be the last isolate that had an error. + auto return_code = shell_holder->GetEngineReturnCode(); + if (return_code.first) { + last_return_code_ = return_code; + } + + shell_holders_.erase(found); + + if (shell_holders_.size() == 0) { + Kill(); + // WARNING: Don't do anything past this point because the delegate may have + // collected this instance via the termination callback. + } +} + +void Application::CreateShellForView( + f1dl::InterfaceRequest view_provider_request) { + shells_bindings_.AddBinding(this, std::move(view_provider_request)); +} + +// |mozart::ViewProvider| +void Application::CreateView( + f1dl::InterfaceRequest view_owner, + f1dl::InterfaceRequest) { + if (!application_context_) { + FXL_DLOG(ERROR) << "Application context was invalid when attempting to " + "create a shell for a view provider request."; + return; + } + + // This method may be called multiple times. Care must be taken to ensure that + // all arguments can be accessed or synthesized multiple times. + // TODO(chinmaygarde): Figure out how to re-create the outgoing service + // request handle. + shell_holders_.emplace(std::make_unique( + *this, // delegate + debug_label_, // thread label + *application_context_, // application context + settings_, // settings + std::move(view_owner), // view owner + fdio_ns_, // FDIO namespace + std::move(outgoing_services_request_) // outgoing request + )); +} + +} // namespace flutter diff --git a/content_handler/application.h b/content_handler/application.h new file mode 100644 index 0000000000000..e4f5da105cac8 --- /dev/null +++ b/content_handler/application.h @@ -0,0 +1,97 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include +#include +#include + +#include "engine.h" +#include "flutter/common/settings.h" +#include "lib/app/cpp/application_context.h" +#include "lib/app/fidl/application_controller.fidl.h" +#include "lib/fidl/cpp/bindings/binding_set.h" +#include "lib/fsl/threading/thread.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" +#include "lib/svc/cpp/service_provider_bridge.h" +#include "lib/ui/views/fidl/view_provider.fidl.h" +#include "unique_fdio_ns.h" + +namespace flutter { + +// Represents an instance of a Flutter application that contains one of more +// Flutter engine instances. +class Application final : public Engine::Delegate, + public component::ApplicationController, + public mozart::ViewProvider { + public: + class Delegate { + public: + virtual void OnApplicationTerminate(const Application* application) = 0; + }; + + // Creates a dedicated thread to run the application and constructions the + // application on it. The application can be accessed only on this thread. + // This is a synchronous operation. + static std::pair, std::unique_ptr> + Create(Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller); + + // Must be called on the same thread returned from the create call. The thread + // may be collected after. + ~Application(); + + private: + blink::Settings settings_; + Delegate& delegate_; + const std::string debug_label_; + UniqueFDIONS fdio_ns_ = UniqueFDIONSCreate(); + fxl::UniqueFD application_directory_; + fxl::UniqueFD application_assets_directory_; + f1dl::Binding application_controller_; + f1dl::InterfaceRequest outgoing_services_request_; + component::ServiceProviderBridge service_provider_bridge_; + std::unique_ptr application_context_; + f1dl::BindingSet shells_bindings_; + std::set> shell_holders_; + std::vector wait_callbacks_; + std::pair last_return_code_; + + Application( + Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller); + + // |component::ApplicationController| + void Kill() override; + + // |component::ApplicationController| + void Detach() override; + + // |component::ApplicationController| + void Wait(const WaitCallback& callback) override; + + // |mozart::ViewProvider| + void CreateView( + f1dl::InterfaceRequest view_owner, + f1dl::InterfaceRequest services) override; + + // |flutter::Engine::Delegate| + void OnEngineTerminate(const Engine* holder) override; + + void CreateShellForView( + f1dl::InterfaceRequest view_provider_request); + + void AttemptVMLaunchWithCurrentSettings( + const blink::Settings& settings) const; + + FXL_DISALLOW_COPY_AND_ASSIGN(Application); +}; + +} // namespace flutter diff --git a/content_handler/application_controller_impl.cc b/content_handler/application_controller_impl.cc deleted file mode 100644 index 9a1b449138a1b..0000000000000 --- a/content_handler/application_controller_impl.cc +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/application_controller_impl.h" - -#include - -#include -#include - -#include "flutter/content_handler/app.h" -#include "flutter/content_handler/runtime_holder.h" -#include "lib/app/cpp/connect.h" -#include "lib/fsl/vmo/vector.h" -#include "lib/fxl/logging.h" - -namespace flutter_runner { - -ApplicationControllerImpl::ApplicationControllerImpl( - App* app, - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) - : app_(app), binding_(this) { - if (controller.is_valid()) { - binding_.Bind(std::move(controller)); - binding_.set_error_handler([this] { - app_->Destroy(this); - // |this| has been deleted at this point. - }); - } - - std::vector bundle; - if (application.data) { - if (!fsl::VectorFromVmo(std::move(*application.data), &bundle)) { - FXL_LOG(ERROR) << "Failed to receive bundle."; - return; - } - } - - // TODO(jeffbrown): Decide what to do with command-line arguments and - // startup handles. - - if (startup_info.launch_info.directory_request.is_valid()) { - service_provider_bridge_.ServeDirectory( - std::move(startup_info.launch_info.directory_request)); - } - - service_provider_bridge_.AddService( - [this](fidl::InterfaceRequest request) { - view_provider_bindings_.AddBinding(this, std::move(request)); - }); - - component::ServiceProviderPtr service_provider; - auto request = service_provider.NewRequest(); - service_provider_bridge_.set_backend(std::move(service_provider)); - - fdio_ns_t* fdio_ns = SetupNamespace(&startup_info.flat_namespace); - if (fdio_ns == nullptr) { - FXL_LOG(ERROR) << "Failed to initialize namespace"; - return; - } - - url_ = startup_info.launch_info.url; - runtime_holder_.reset(new RuntimeHolder()); - runtime_holder_->SetMainIsolateShutdownCallback([this]() { Kill(); }); - runtime_holder_->Init( - fdio_ns, - component::ApplicationContext::CreateFrom(std::move(startup_info)), - std::move(request), std::move(bundle)); -} - -ApplicationControllerImpl::~ApplicationControllerImpl() = default; - -constexpr char kServiceRootPath[] = "/svc"; - -fdio_ns_t* ApplicationControllerImpl::SetupNamespace( - component::FlatNamespace* flat) { - fdio_ns_t* fdio_namespc; - zx_status_t status = fdio_ns_create(&fdio_namespc); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Failed to create namespace"; - return nullptr; - } - for (size_t i = 0; i < flat->paths->size(); ++i) { - if (flat->paths->at(i) == kServiceRootPath) { - // Ownership of /svc goes to the ApplicationContext created above. - continue; - } - zx::channel dir = std::move(flat->directories->at(i)); - zx_handle_t dir_handle = dir.release(); - const char* path = flat->paths->at(i)->data(); - status = fdio_ns_bind(fdio_namespc, path, dir_handle); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Failed to bind " << flat->paths->at(i) - << " to namespace"; - zx_handle_close(dir_handle); - fdio_ns_destroy(fdio_namespc); - return nullptr; - } - } - return fdio_namespc; -} - -void ApplicationControllerImpl::Kill() { - SendReturnCode(runtime_holder_->return_code()); - runtime_holder_.reset(); - app_->Destroy(this); - // |this| has been deleted at this point. -} - -void ApplicationControllerImpl::Detach() { - binding_.set_error_handler(fxl::Closure()); -} - -void ApplicationControllerImpl::Wait(WaitCallback callback) { - wait_callbacks_.push_back(std::move(callback)); -} - -void ApplicationControllerImpl::SendReturnCode(int32_t return_code) { - for (const auto& iter : wait_callbacks_) { - iter(return_code); - } - wait_callbacks_.clear(); -} - -void ApplicationControllerImpl::CreateView( - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services) { - runtime_holder_->CreateView(url_, std::move(view_owner_request), - std::move(services)); -} - -Dart_Port ApplicationControllerImpl::GetUIIsolateMainPort() { - if (!runtime_holder_) - return ILLEGAL_PORT; - return runtime_holder_->GetUIIsolateMainPort(); -} - -std::string ApplicationControllerImpl::GetUIIsolateName() { - if (!runtime_holder_) { - return ""; - } - return runtime_holder_->GetUIIsolateName(); -} - -} // namespace flutter_runner diff --git a/content_handler/application_controller_impl.h b/content_handler/application_controller_impl.h deleted file mode 100644 index 01700f2886ffb..0000000000000 --- a/content_handler/application_controller_impl.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ -#define FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ - -#include - -#include - -#include -#include -#include - -#include "lib/fidl/cpp/binding.h" -#include "lib/fidl/cpp/binding_set.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "lib/svc/cpp/service_provider_bridge.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace flutter_runner { -class App; -class RuntimeHolder; - -class ApplicationControllerImpl : public component::ApplicationController, - public views_v1::ViewProvider { - public: - ApplicationControllerImpl( - App* app, - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller); - - ~ApplicationControllerImpl() override; - - // |component::ApplicationController| implementation - - void Kill() override; - void Detach() override; - void Wait(WaitCallback callback) override; - - // |views_v1::ViewProvider| implementation - - void CreateView( - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services) override; - - Dart_Port GetUIIsolateMainPort(); - std::string GetUIIsolateName(); - - private: - void StartRuntimeIfReady(); - void SendReturnCode(int32_t return_code); - - fdio_ns_t* SetupNamespace(component::FlatNamespace* flat); - - App* app_; - fidl::Binding binding_; - - component::ServiceProviderBridge service_provider_bridge_; - - fidl::BindingSet view_provider_bindings_; - - std::string url_; - std::unique_ptr runtime_holder_; - - std::vector wait_callbacks_; - - FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationControllerImpl); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc new file mode 100644 index 0000000000000..2d77f43cbdd45 --- /dev/null +++ b/content_handler/application_runner.cc @@ -0,0 +1,90 @@ +// Copyright 2018 The Fuchsia 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 "application_runner.h" + +#include + +#include "flutter/lib/ui/text/font_collection.h" +#include "fuchsia_font_manager.h" +#include "lib/fonts/fidl/font_provider.fidl.h" +#include "lib/icu_data/cpp/icu_data.h" + +namespace flutter { + +ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) + : on_termination_callback_(std::move(on_termination_callback)), + host_context_(component::ApplicationContext::CreateFromStartupInfo()) { + SetupICU(); + + SetupGlobalFonts(); + + const std::string process_label = "flutter"; + zx::process::self().set_property(ZX_PROP_NAME, process_label.c_str(), + process_label.size()); + + host_context_->outgoing_services()->AddService( + std::bind(&ApplicationRunner::RegisterApplication, this, + std::placeholders::_1)); + + active_applications_bindings_.set_empty_set_handler( + [this]() { FireTerminationCallbackIfNecessary(); }); +} + +ApplicationRunner::~ApplicationRunner() { + host_context_->outgoing_services() + ->RemoveService(); +} + +void ApplicationRunner::RegisterApplication( + f1dl::InterfaceRequest request) { + active_applications_bindings_.AddBinding(this, std::move(request)); +} + +void ApplicationRunner::StartApplication( + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller) { + auto thread_application_pair = + Application::Create(*this, // delegate + std::move(package), // application pacakge + std::move(startup_info), // startup info + std::move(controller) // controller request + ); + active_applications_[thread_application_pair.second.get()] = + std::move(thread_application_pair); +} + +void ApplicationRunner::OnApplicationTerminate(const Application* application) { + active_applications_.erase(application); + FireTerminationCallbackIfNecessary(); +} + +void ApplicationRunner::SetupICU() { + if (!icu_data::Initialize(host_context_.get())) { + FXL_LOG(ERROR) << "Could not initialize ICU data."; + } +} + +void ApplicationRunner::SetupGlobalFonts() { + fonts::FontProviderPtr font_provider( + host_context_->ConnectToEnvironmentService()); + auto font_manager = + sk_make_sp(std::move(font_provider)); + blink::FontCollection::ForProcess() + .GetFontCollection() + ->SetDefaultFontManager(std::move(font_manager)); +} + +void ApplicationRunner::FireTerminationCallbackIfNecessary() { + // We have no reason to exist if: + // 1: No previously launched applications are running. + // 2: No bindings exist that may require launching more applications. + if (on_termination_callback_ && active_applications_.size() == 0 && + active_applications_bindings_.size() == 0) { + on_termination_callback_(); + } +} + +} // namespace flutter diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h new file mode 100644 index 0000000000000..fdf5b4420dc0f --- /dev/null +++ b/content_handler/application_runner.h @@ -0,0 +1,79 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include +#include + +#include "application.h" +#include "lib/app/cpp/application_context.h" +#include "lib/app/fidl/application_runner.fidl.h" +#include "lib/fidl/cpp/bindings/binding_set.h" +#include "lib/fsl/tasks/message_loop.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/macros.h" + +namespace flutter { + +// Publishes the |component::ApplicationRunner| service and runs applications on +// their own threads. +class ApplicationRunner final : public Application::Delegate, + public component::ApplicationRunner { + public: + ApplicationRunner(fxl::Closure on_termination_callback); + + ~ApplicationRunner(); + + private: + struct ActiveApplication { + std::unique_ptr thread; + std::unique_ptr application; + + ActiveApplication(std::pair, + std::unique_ptr> pair) + : thread(std::move(pair.first)), application(std::move(pair.second)) {} + + ActiveApplication() { + if (thread && application) { + thread->TaskRunner()->PostTask( + fxl::MakeCopyable([application = std::move(application)]() mutable { + application.reset(); + fsl::MessageLoop::GetCurrent()->PostQuitTask(); + })); + thread.reset(); // join + } + } + }; + + fxl::Closure on_termination_callback_; + std::unique_ptr host_context_; + f1dl::BindingSet active_applications_bindings_; + std::unordered_map + active_applications_; + + // |component::ApplicationRunner| + void StartApplication(component::ApplicationPackagePtr application, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest + controller) override; + + void RegisterApplication( + f1dl::InterfaceRequest request); + + void UnregisterApplication(const Application* application); + + // |Application::Delegate| + void OnApplicationTerminate(const Application* application) override; + + void SetupICU(); + + void SetupGlobalFonts(); + + void FireTerminationCallbackIfNecessary(); + + FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationRunner); +}; + +} // namespace flutter diff --git a/content_handler/compositor_context.cc b/content_handler/compositor_context.cc new file mode 100644 index 0000000000000..efad9ac2b9583 --- /dev/null +++ b/content_handler/compositor_context.cc @@ -0,0 +1,86 @@ +// Copyright 2018 The Fuchsia 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 "compositor_context.h" + +#include "flutter/flow/layers/layer_tree.h" +#include "flutter/glue/trace_event.h" + +namespace flutter { + +class ScopedFrame final : public flow::CompositorContext::ScopedFrame { + public: + ScopedFrame(flow::CompositorContext& context, + bool instrumentation_enabled, + SessionConnection& session_connection) + : flow::CompositorContext::ScopedFrame(context, + nullptr, + nullptr, + instrumentation_enabled), + session_connection_(session_connection) {} + + private: + SessionConnection& session_connection_; + + bool Raster(flow::LayerTree& layer_tree, bool ignore_raster_cache) override { + if (!session_connection_.has_metrics()) { + return true; + } + + { + // Preroll the Flutter layer tree. This allows Flutter to perform + // pre-paint optimizations. + TRACE_EVENT0("flutter", "Preroll"); + layer_tree.Preroll(*this, true /* ignore raster cache */); + } + + { + // Traverse the Flutter layer tree so that the necessary session ops to + // represent the frame are enqueued in the underlying session. + TRACE_EVENT0("flutter", "UpdateScene"); + layer_tree.UpdateScene(session_connection_.scene_update_context(), + session_connection_.root_node()); + } + + { + // Flush all pending session ops. + TRACE_EVENT0("flutter", "SessionPresent"); + session_connection_.Present(*this); + } + + return true; + } + + FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); +}; + +CompositorContext::CompositorContext( + const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback) + : debug_label_(std::move(debug_label)), + session_connection_(scenic, + debug_label_, + std::move(import_token), + std::move(session_metrics_did_change_callback), + std::move(session_error_callback)) {} + +CompositorContext::~CompositorContext() = default; + +std::unique_ptr +CompositorContext::AcquireFrame(GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled) { + // TODO: The AcquireFrame interface is too broad and must be refactored to get + // rid of the context and canvas arguments as those seem to be only used for + // colorspace correctness purposes on the mobile shells. + return std::make_unique(*this, // + instrumentation_enabled, // + session_connection_ // + ); +} + +} // namespace flutter diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h new file mode 100644 index 0000000000000..a6e5429c6072c --- /dev/null +++ b/content_handler/compositor_context.h @@ -0,0 +1,39 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "flutter/flow/compositor_context.h" +#include "garnet/public/lib/ui/scenic/fidl/scenic.fidl-common.h" +#include "lib/fxl/macros.h" +#include "session_connection.h" + +namespace flutter { + +// Holds composition specific state and bindings specific to composition on +// Fuchsia. +class CompositorContext final : public flow::CompositorContext { + public: + CompositorContext(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback); + + ~CompositorContext() override; + + private: + const std::string debug_label_; + SessionConnection session_connection_; + + // |flow::CompositorContext| + std::unique_ptr AcquireFrame( + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled) override; + + FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); +}; + +} // namespace flutter diff --git a/content_handler/engine.cc b/content_handler/engine.cc new file mode 100644 index 0000000000000..3349c09bdf1af --- /dev/null +++ b/content_handler/engine.cc @@ -0,0 +1,258 @@ +// Copyright 2018 The Fuchsia 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 "engine.h" + +#include + +#include "flutter/common/task_runners.h" +#include "flutter/fml/task_runner.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/run_configuration.h" +#include "lib/fsl/tasks/message_loop.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "platform_view.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace flutter { + +Engine::Engine(Delegate& delegate, + std::string thread_label, + component::ApplicationContext& application_context, + blink::Settings settings, + f1dl::InterfaceRequest view_owner, + const UniqueFDIONS& fdio_ns, + f1dl::InterfaceRequest + outgoing_services_request) + : delegate_(delegate), + thread_label_(std::move(thread_label)), + settings_(std::move(settings)), + weak_factory_(this) { + // Launch the threads that will be used to run the shell. These threads will + // be joined in the destructor. + for (auto& thread : host_threads_) { + thread.Run(); + } + + mozart::ViewManagerPtr view_manager; + application_context.ConnectToEnvironmentService(view_manager.NewRequest()); + + zx::eventpair import_token, export_token; + if (zx::eventpair::create(0u, &import_token, &export_token) != ZX_OK) { + FXL_DLOG(ERROR) << "Could not create event pair."; + return; + } + + // Setup the session connection. + ui::ScenicPtr scenic; + view_manager->GetScenic(scenic.NewRequest()); + + // Grab the parent environent services. The platform view may want to access + // some of these services. + component::ServiceProviderPtr parent_environment_service_provider; + application_context.environment()->GetServices( + parent_environment_service_provider.NewRequest()); + + // We need to manually schedule a frame when the session metrics change. + OnMetricsUpdate on_session_metrics_change_callback = std::bind( + &Engine::OnSessionMetricsDidChange, this, std::placeholders::_1); + + fxl::Closure on_session_error_callback = std::bind(&Engine::Terminate, this); + + // Grab the accessibilty context writer that can understand the semtics tree + // on the platform view. + maxwell::ContextWriterPtr accessibility_context_writer; + application_context.ConnectToEnvironmentService( + accessibility_context_writer.NewRequest()); + + // Setup the callback that will instantiate the platform view. + shell::Shell::CreateCallback on_create_platform_view = + fxl::MakeCopyable([debug_label = thread_label_, // + parent_environment_service_provider = + std::move(parent_environment_service_provider), // + view_manager = std::ref(view_manager), // + view_owner = std::move(view_owner), // + scenic = std::move(scenic), // + accessibility_context_writer = + std::move(accessibility_context_writer), // + export_token = std::move(export_token), // + import_token = std::move(import_token), // + on_session_metrics_change_callback, // + on_session_error_callback // + ](shell::Shell& shell) mutable { + return std::make_unique( + shell, // delegate + debug_label, // debug label + shell.GetTaskRunners(), // task runners + std::move(parent_environment_service_provider), // services + view_manager, // view manager + std::move(view_owner), // view owner + std::move(scenic), // scenic + std::move(export_token), // export token + std::move(import_token), // import token + std::move( + accessibility_context_writer), // accessibility context writer + std::move(on_session_metrics_change_callback), // metrics change + std::move(on_session_error_callback) // session_error + ); + }); + + // Setup the callback that will instantiate the rasterizer. + shell::Shell::CreateCallback on_create_rasterizer = + [](shell::Shell& shell) { + return std::make_unique( + shell.GetTaskRunners() // task runners + ); + }; + + // Get the task runners from the managed threads. The current thread will be + // used as the "platform" thread. + blink::TaskRunners task_runners( + thread_label_, // Dart thread labels + fsl::MessageLoop::GetCurrent()->task_runner(), // platform + host_threads_[0].TaskRunner(), // gpu + host_threads_[1].TaskRunner(), // ui + host_threads_[2].TaskRunner() // io + ); + + settings_.root_isolate_create_callback = + std::bind(&Engine::OnMainIsolateStart, this); + + settings_.root_isolate_shutdown_callback = + std::bind([weak = weak_factory_.GetWeakPtr(), + runner = task_runners.GetPlatformTaskRunner()]() { + runner->PostTask([weak = std::move(weak)] { + if (weak) { + weak->OnMainIsolateShutdown(); + } + }); + }); + + shell_ = shell::Shell::Create( + task_runners, // host task runners + settings_, // shell launch settings + on_create_platform_view, // platform view create callback + on_create_rasterizer // rasterizer create callback + ); + + if (!shell_) { + FXL_LOG(ERROR) << "Could not launch the shell with settings: " + << settings_.ToString(); + return; + } + + // Shell has been created. Before we run the engine, setup the isolate + // configurator. + { + PlatformView* platform_view = + static_cast(shell_->GetPlatformView().get()); + auto& view = platform_view->GetMozartView(); + component::ApplicationEnvironmentPtr application_environment; + application_context.ConnectToEnvironmentService( + application_environment.NewRequest()); + + isolate_configurator_ = std::make_unique( + fdio_ns, // + view, // + std::move(application_environment), // + std::move(outgoing_services_request) // + ); + } + + // This platform does not get a separate surface platform view creation + // notification. Fire one eagerly. + shell_->GetPlatformView()->NotifyCreated(); + + // Launch the engine in the appropriate configuration. + auto run_configuration = + shell::RunConfiguration::InferFromSettings(settings_); + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = shell_->GetEngine(), // + run_configuration = std::move(run_configuration) // + ]() mutable { + if (!engine || !engine->Run(std::move(run_configuration))) { + FXL_LOG(ERROR) << "Could not (re)launch the engine in configuration"; + } + })); + + UpdateNativeThreadLabelNames(); +} + +Engine::~Engine() { + for (const auto& thread : host_threads_) { + thread.TaskRunner()->PostTask( + []() { fsl::MessageLoop::GetCurrent()->PostQuitTask(); }); + } +} + +void Engine::UpdateNativeThreadLabelNames() const { + auto set_thread_name = [](fxl::RefPtr runner, + std::string prefix, std::string suffix) { + runner->PostTask([name = prefix + suffix]() { + zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); + }); + }; + auto runners = shell_->GetTaskRunners(); + set_thread_name(runners.GetPlatformTaskRunner(), thread_label_, ".platform"); + set_thread_name(runners.GetUITaskRunner(), thread_label_, ".ui"); + set_thread_name(runners.GetGPUTaskRunner(), thread_label_, ".gpu"); + set_thread_name(runners.GetIOTaskRunner(), thread_label_, ".io"); +} + +std::pair Engine::GetEngineReturnCode() const { + std::pair code(false, 0); + if (!shell_) { + return code; + } + fxl::AutoResetWaitableEvent latch; + fml::TaskRunner::RunNowOrPostTask( + shell_->GetTaskRunners().GetUITaskRunner(), + [&latch, &code, engine = shell_->GetEngine()]() { + if (engine) { + code = engine->GetUIIsolateReturnCode(); + } + latch.Signal(); + }); + latch.Wait(); + return code; +} + +void Engine::OnMainIsolateStart() { + if (!isolate_configurator_ || + !isolate_configurator_->ConfigureCurrentIsolate()) { + FXL_LOG(ERROR) << "Could not configure some native embedder bindings for a " + "new root isolate."; + } +} + +void Engine::OnMainIsolateShutdown() { + Terminate(); +} + +void Engine::Terminate() { + delegate_.OnEngineTerminate(this); + // Warning. Do not do anything after this point as the delegate may have + // collected this object. +} + +void Engine::OnSessionMetricsDidChange(double device_pixel_ratio) { + if (!shell_) { + return; + } + + shell_->GetTaskRunners().GetPlatformTaskRunner()->PostTask( + [platform_view = shell_->GetPlatformView(), device_pixel_ratio]() { + if (platform_view) { + reinterpret_cast(platform_view.get()) + ->UpdateViewportMetrics(device_pixel_ratio); + } + }); +} + +} // namespace flutter diff --git a/content_handler/engine.h b/content_handler/engine.h new file mode 100644 index 0000000000000..60c0ad7c2f80d --- /dev/null +++ b/content_handler/engine.h @@ -0,0 +1,63 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "flutter/shell/common/shell.h" +#include "isolate_configurator.h" +#include "lib/app/cpp/application_context.h" +#include "lib/fsl/threading/thread.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/ui/views/fidl/view_manager.fidl.h" + +namespace flutter { + +// Represents an instance of running Flutter engine along with the threads that +// host the same. +class Engine final { + public: + class Delegate { + public: + virtual void OnEngineTerminate(const Engine* holder) = 0; + }; + + Engine(Delegate& delegate, + std::string thread_label, + component::ApplicationContext& application_context, + blink::Settings settings, + f1dl::InterfaceRequest view_owner, + const UniqueFDIONS& fdio_ns, + f1dl::InterfaceRequest + outgoing_services_request); + + ~Engine(); + + // Returns the Dart return code for the root isolate if one is present. This + // call is thread safe and synchronous. This call must be made infrequently. + std::pair GetEngineReturnCode() const; + + private: + Delegate& delegate_; + const std::string thread_label_; + blink::Settings settings_; + std::array host_threads_; + std::unique_ptr isolate_configurator_; + std::unique_ptr shell_; + fxl::WeakPtrFactory weak_factory_; + + void OnMainIsolateStart(); + + void OnMainIsolateShutdown(); + + void Terminate(); + + void OnSessionMetricsDidChange(double device_pixel_ratio); + + void UpdateNativeThreadLabelNames() const; + + FXL_DISALLOW_COPY_AND_ASSIGN(Engine); +}; + +} // namespace flutter diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc index 4e409cae94f6a..877c931130eb4 100644 --- a/content_handler/fuchsia_font_manager.cc +++ b/content_handler/fuchsia_font_manager.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "flutter/content_handler/fuchsia_font_manager.h" +#include "fuchsia_font_manager.h" #include @@ -32,14 +32,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromBuffer(mem::Buffer data) { - if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || - data.size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { + if (!fsl::SizedVmo::IsSizeValid(vmo->vmo, vmo->size) || + vmo->size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = data.size; + uint64_t size = vmo->size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, vmo->vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -49,7 +49,7 @@ sk_sp MakeSkDataFromBuffer(mem::Buffer data) { fonts::FontSlant ToFontSlant(SkFontStyle::Slant slant) { return (slant == SkFontStyle::kItalic_Slant) ? fonts::FontSlant::ITALIC - : fonts::FontSlant::UPRIGHT; + : fonts::FontSlant::UPRIGHT; } } // anonymous namespace @@ -64,7 +64,8 @@ int FuchsiaFontManager::onCountFamilies() const { return 0; } -void FuchsiaFontManager::onGetFamilyName(int index, SkString* familyName) const { +void FuchsiaFontManager::onGetFamilyName(int index, + SkString* familyName) const { FXL_DCHECK(false); } @@ -87,12 +88,13 @@ SkFontStyleSet* FuchsiaFontManager::onMatchFamily( } SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( - const char family_name[], const SkFontStyle& style) const { - fonts::FontRequest request; - request.family = family_name; - request.weight = style.weight(); - request.width = style.width(); - request.slant = ToFontSlant(style.slant()); + const char family_name[], + const SkFontStyle& style) const { + auto request = fonts::FontRequest::New(); + request->family = family_name; + request->weight = style.weight(); + request->width = style.width(); + request->slant = ToFontSlant(style.slant()); fonts::FontResponsePtr response; font_provider_->GetFont( @@ -100,14 +102,13 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( [&response](fonts::FontResponsePtr r) { response = std::move(r); }); font_provider_.WaitForResponse(); - FXL_DCHECK(response) - << "Unable to contact the font provider. Did you run " - "Flutter in an environment that has a font manager?\n"; - - if (!response) + if (!response) { + FXL_DLOG(ERROR) << "Unable to contact the font provider. Did you run " + "Flutter in an environment that has a font manager?"; return nullptr; + } - sk_sp data = MakeSkDataFromBuffer(std::move(response->data.buffer)); + sk_sp data = MakeSkDataFromVMO(response->data->vmo); if (!data) return nullptr; @@ -127,13 +128,13 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyleCharacter( } SkTypeface* FuchsiaFontManager::onMatchFaceStyle(const SkTypeface*, - const SkFontStyle&) const { + const SkFontStyle&) const { FXL_DCHECK(false); return nullptr; } sk_sp FuchsiaFontManager::onMakeFromData(sk_sp, - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } @@ -153,7 +154,7 @@ sk_sp FuchsiaFontManager::onMakeFromStreamArgs( } sk_sp FuchsiaFontManager::onMakeFromFile(const char path[], - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } diff --git a/content_handler/fuchsia_font_manager.h b/content_handler/fuchsia_font_manager.h index e57d6ef76e72f..ecfb724b85878 100644 --- a/content_handler/fuchsia_font_manager.h +++ b/content_handler/fuchsia_font_manager.h @@ -26,7 +26,7 @@ namespace txt { -class FuchsiaFontManager : public SkFontMgr { +class FuchsiaFontManager final : public SkFontMgr { public: FuchsiaFontManager(fonts::FontProviderPtr provider); diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc new file mode 100644 index 0000000000000..d085bea698b95 --- /dev/null +++ b/content_handler/isolate_configurator.cc @@ -0,0 +1,114 @@ +// Copyright 2018 The Fuchsia 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 "isolate_configurator.h" + +#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" +#include "dart-pkg/zircon/sdk_ext/handle.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/ui/flutter/sdk_ext/src/natives.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace flutter { + +IsolateConfigurator::IsolateConfigurator( + const UniqueFDIONS& fdio_ns, + mozart::ViewPtr& view, + component::ApplicationEnvironmentPtr application_environment, + f1dl::InterfaceRequest + outgoing_services_request) + : fdio_ns_(fdio_ns), + view_(view), + application_environment_(std::move(application_environment)), + outgoing_services_request_(std::move(outgoing_services_request)) {} + +IsolateConfigurator::~IsolateConfigurator() = default; + +bool IsolateConfigurator::ConfigureCurrentIsolate() { + if (used_) { + return false; + } + used_ = true; + + BindFuchsia(); + BindZircon(); + BindDartIO(); + BindScenic(); + + return true; +} + +// |mozart::NativesDelegate| +mozart::View* IsolateConfigurator::GetMozartView() { + return view_.get(); +} + +void IsolateConfigurator::BindFuchsia() { + fuchsia::dart::Initialize(application_environment_.Unbind(), + std::move(outgoing_services_request_)); +} + +void IsolateConfigurator::BindZircon() { + // Tell dart:zircon about the FDIO namespace configured for this instance. + Dart_Handle zircon_lib = Dart_LookupLibrary(tonic::ToDart("dart:zircon")); + DART_CHECK_VALID(zircon_lib); + + Dart_Handle namespace_type = + Dart_GetType(zircon_lib, tonic::ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + DART_CHECK_VALID( + Dart_SetField(namespace_type, // + tonic::ToDart("_namespace"), // + tonic::ToDart(reinterpret_cast(fdio_ns_.get())))); +} + +void IsolateConfigurator::BindDartIO() { + // Grab the dart:io lib. + Dart_Handle io_lib = Dart_LookupLibrary(tonic::ToDart("dart:io")); + DART_CHECK_VALID(io_lib); + + // Disable dart:io exit() + Dart_Handle embedder_config_type = + Dart_GetType(io_lib, tonic::ToDart("_EmbedderConfig"), 0, nullptr); + DART_CHECK_VALID(embedder_config_type); + DART_CHECK_VALID(Dart_SetField(embedder_config_type, + tonic::ToDart("_mayExit"), Dart_False())); + + // Tell dart:io about the FDIO namespace configured for this instance. + Dart_Handle namespace_type = + Dart_GetType(io_lib, tonic::ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + Dart_Handle namespace_args[] = { + Dart_NewInteger(reinterpret_cast(fdio_ns_.get())), // + }; + DART_CHECK_VALID(namespace_args[0]); + DART_CHECK_VALID(Dart_Invoke(namespace_type, tonic::ToDart("_setupNamespace"), + 1, namespace_args)); +} + +void IsolateConfigurator::BindScenic() { + Dart_Handle mozart_internal = + Dart_LookupLibrary(tonic::ToDart("dart:mozart.internal")); + DART_CHECK_VALID(mozart_internal); + DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, // + mozart::NativeLookup, // + mozart::NativeSymbol) // + ); + DART_CHECK_VALID(Dart_SetField( + mozart_internal, // + tonic::ToDart("_context"), // + tonic::DartConverter::ToDart(reinterpret_cast( + static_cast(this))))); + mozart::ViewContainerPtr view_container; + view_->GetContainer(view_container.NewRequest()); + DART_CHECK_VALID( + Dart_SetField(mozart_internal, // + tonic::ToDart("_viewContainer"), // + tonic::ToDart(zircon::dart::Handle::Create( + view_container.Unbind().TakeChannel().release())))); +} + +} // namespace flutter diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h new file mode 100644 index 0000000000000..a5da083633ee7 --- /dev/null +++ b/content_handler/isolate_configurator.h @@ -0,0 +1,55 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "lib/app/fidl/application_environment.fidl.h" +#include "lib/fxl/macros.h" +#include "lib/ui/flutter/sdk_ext/src/natives.h" +#include "lib/ui/views/fidl/view_containers.fidl.h" +#include "lib/ui/views/fidl/views.fidl.h" +#include "unique_fdio_ns.h" + +namespace flutter { + +// Contains all the information necessary to configure a new root isolate. This +// is a single use item. The lifetime of this object must extend past that of +// the root isolate. +class IsolateConfigurator final : mozart::NativesDelegate { + public: + IsolateConfigurator( + const UniqueFDIONS& fdio_ns, + mozart::ViewPtr& view, + component::ApplicationEnvironmentPtr application_environment, + f1dl::InterfaceRequest + outgoing_services_request); + + ~IsolateConfigurator(); + + // Can be used only once and only on the UI thread with the newly created + // isolate already current. + bool ConfigureCurrentIsolate(); + + private: + bool used_ = false; + const UniqueFDIONS& fdio_ns_; + mozart::ViewPtr& view_; + component::ApplicationEnvironmentPtr application_environment_; + f1dl::InterfaceRequest outgoing_services_request_; + + // |mozart::NativesDelegate| + mozart::View* GetMozartView() override; + + void BindFuchsia(); + + void BindZircon(); + + void BindDartIO(); + + void BindScenic(); + + FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfigurator); +}; + +} // namespace flutter diff --git a/content_handler/main.cc b/content_handler/main.cc index d3eac3c81dcbf..15b8cede5b9b2 100644 --- a/content_handler/main.cc +++ b/content_handler/main.cc @@ -1,16 +1,26 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// Copyright 2018 The Fuchsia 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 +#include -#include "flutter/content_handler/app.h" +#include "application_runner.h" #include "lib/fsl/tasks/message_loop.h" -int main(int argc, const char** argv) { +int main(int argc, char const* argv[]) { fsl::MessageLoop loop; + trace::TraceProvider provider(loop.async()); - flutter_runner::App app; + FXL_DCHECK(provider.is_valid()) << "Trace provider must be valid."; + + FXL_LOG(INFO) << "Flutter application services initialized."; + flutter::ApplicationRunner runner([&loop]() { + loop.PostQuitTask(); + FXL_LOG(INFO) << "Flutter application services terminated. Good bye..."; + }); + loop.Run(); - return 0; + + return EXIT_SUCCESS; } diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc new file mode 100644 index 0000000000000..8ac41613e449b --- /dev/null +++ b/content_handler/platform_view.cc @@ -0,0 +1,551 @@ +// Copyright 2018 The Fuchsia 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 RAPIDJSON_HAS_STDSTRING 1 + +#include "platform_view.h" + +#include + +#include "flutter/lib/ui/window/pointer_data.h" +#include "lib/app/cpp/connect.h" +#include "third_party/rapidjson/rapidjson/document.h" +#include "third_party/rapidjson/rapidjson/stringbuffer.h" +#include "third_party/rapidjson/rapidjson/writer.h" + +namespace flutter { + +constexpr char kFlutterPlatformChannel[] = "flutter/platform"; +constexpr char kTextInputChannel[] = "flutter/textinput"; +constexpr char kKeyEventChannel[] = "flutter/keyevent"; + +PlatformView::PlatformView( + PlatformView::Delegate& delegate, + std::string debug_label, + blink::TaskRunners task_runners, + component::ServiceProviderPtr parent_environment_service_provider, + mozart::ViewManagerPtr& view_manager, + f1dl::InterfaceRequest view_owner, + ui::ScenicPtr scenic, + zx::eventpair export_token, + zx::eventpair import_token, + maxwell::ContextWriterPtr accessibility_context_writer, + OnMetricsUpdate on_session_metrics_did_change, + fxl::Closure session_error_callback) + : shell::PlatformView(delegate, std::move(task_runners)), + debug_label_(std::move(debug_label)), + view_listener_(this), + input_listener_(this), + ime_client_(this), + scenic_(std::move(scenic)), + accessibility_bridge_(std::move(accessibility_context_writer)), + surface_( + std::make_unique(scenic_, + debug_label_, + std::move(import_token), + std::move(on_session_metrics_did_change), + std::move(session_error_callback))) { + // Create the view. + view_manager->CreateView(view_.NewRequest(), // view + std::move(view_owner), // view owner + view_listener_.NewBinding(), // view listener + std::move(export_token), // export token + debug_label_ // diagnostic label + ); + + // Get the services from the created view. + component::ServiceProviderPtr service_provider; + view_->GetServiceProvider(service_provider.NewRequest()); + + // Get the input connection from the services of the view. + component::ConnectToService(service_provider.get(), + input_connection_.NewRequest()); + + // Set the input listener on the input connection. + input_connection_->SetEventListener(input_listener_.NewBinding()); + + // Access the clipboard. + component::ConnectToService(parent_environment_service_provider.get(), + clipboard_.NewRequest()); + + // Finally! Register the native platform message handlers. + RegisterPlatformMessageHandlers(); +} + +PlatformView::~PlatformView() = default; + +void PlatformView::RegisterPlatformMessageHandlers() { + platform_message_handlers_[kFlutterPlatformChannel] = + std::bind(&PlatformView::HandleFlutterPlatformChannelPlatformMessage, // + this, // + std::placeholders::_1); + platform_message_handlers_[kTextInputChannel] = + std::bind(&PlatformView::HandleFlutterTextInputChannelPlatformMessage, // + this, // + std::placeholders::_1); +} + +mozart::ViewPtr& PlatformView::GetMozartView() { + return view_; +} + +// |mozart::ViewListener| +void PlatformView::OnPropertiesChanged( + mozart::ViewPropertiesPtr properties, + const OnPropertiesChangedCallback& callback) { + UpdateViewportMetrics(properties->view_layout); + callback(); +} + +void PlatformView::UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout) { + if (!layout) { + return; + } + + metrics_.size.width = layout->size->width; + metrics_.size.height = layout->size->height; + + metrics_.padding.left = layout->inset->left; + metrics_.padding.top = layout->inset->top; + metrics_.padding.right = layout->inset->right; + metrics_.padding.bottom = layout->inset->bottom; + + FlushViewportMetrics(); +} + +void PlatformView::UpdateViewportMetrics(double pixel_ratio) { + metrics_.scale = pixel_ratio; + + FlushViewportMetrics(); +} + +void PlatformView::FlushViewportMetrics() { + const auto scale = metrics_.scale; + blink::ViewportMetrics metrics = { + .device_pixel_ratio = static_cast(scale), + + .physical_width = static_cast(metrics_.size.width * scale), + .physical_height = static_cast(metrics_.size.height * scale), + + .physical_padding_top = + static_cast(metrics_.padding.top * scale), + .physical_padding_right = + static_cast(metrics_.padding.right * scale), + .physical_padding_bottom = + static_cast(metrics_.padding.bottom * scale), + .physical_padding_left = + static_cast(metrics_.padding.left * scale), + + .physical_view_inset_top = + static_cast(metrics_.view_inset.top * scale), + .physical_view_inset_right = + static_cast(metrics_.view_inset.right * scale), + .physical_view_inset_bottom = + static_cast(metrics_.view_inset.bottom * scale), + .physical_view_inset_left = + static_cast(metrics_.view_inset.left * scale), + }; + + SetViewportMetrics(metrics); +} + +// |mozart::InputMethodEditorClient| +void PlatformView::DidUpdateState(mozart::TextInputStatePtr state, + mozart::InputEventPtr event) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + rapidjson::Value encoded_state(rapidjson::kObjectType); + encoded_state.AddMember("text", state->text.get(), allocator); + encoded_state.AddMember("selectionBase", state->selection->base, allocator); + encoded_state.AddMember("selectionExtent", state->selection->extent, + allocator); + switch (state->selection->affinity) { + case mozart::TextAffinity::UPSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.upstream"), + allocator); + break; + case mozart::TextAffinity::DOWNSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.downstream"), + allocator); + break; + } + encoded_state.AddMember("selectionIsDirectional", true, allocator); + encoded_state.AddMember("composingBase", state->composing->start, allocator); + encoded_state.AddMember("composingExtent", state->composing->end, allocator); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + args.PushBack(encoded_state, allocator); + + document.SetObject(); + document.AddMember("method", + rapidjson::Value("TextInputClient.updateEditingState"), + allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, // channel + std::vector(data, data + buffer.GetSize()), // message + nullptr) // response + ); +} + +// |mozart::InputMethodEditorClient| +void PlatformView::OnAction(mozart::InputMethodAction action) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + + // Done is currently the only text input action defined by Flutter. + args.PushBack("TextInputAction.done", allocator); + + document.SetObject(); + document.AddMember( + "method", rapidjson::Value("TextInputClient.performAction"), allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, // channel + std::vector(data, data + buffer.GetSize()), // message + nullptr) // response + ); +} + +// |mozart::InputListener| +void PlatformView::OnEvent(mozart::InputEventPtr event, + const OnEventCallback& callback) { + using Type = mozart::InputEvent::Tag; + switch (event->which()) { + case Type::POINTER: + callback(OnHandlePointerEvent(event->get_pointer())); + return; + case Type::KEYBOARD: + callback(OnHandleKeyboardEvent(event->get_keyboard())); + return; + case Type::FOCUS: + callback(OnHandleFocusEvent(event->get_focus())); + return; + case Type::__UNKNOWN__: + break; + } + + callback(false); +} + +static blink::PointerData::Change GetChangeFromPointerEventPhase( + mozart::PointerEvent::Phase phase) { + switch (phase) { + case mozart::PointerEvent::Phase::ADD: + return blink::PointerData::Change::kAdd; + case mozart::PointerEvent::Phase::HOVER: + return blink::PointerData::Change::kHover; + case mozart::PointerEvent::Phase::DOWN: + return blink::PointerData::Change::kDown; + case mozart::PointerEvent::Phase::MOVE: + return blink::PointerData::Change::kMove; + case mozart::PointerEvent::Phase::UP: + return blink::PointerData::Change::kUp; + case mozart::PointerEvent::Phase::REMOVE: + return blink::PointerData::Change::kRemove; + case mozart::PointerEvent::Phase::CANCEL: + return blink::PointerData::Change::kCancel; + default: + return blink::PointerData::Change::kCancel; + } +} + +static blink::PointerData::DeviceKind GetKindFromPointerType( + mozart::PointerEvent::Type type) { + switch (type) { + case mozart::PointerEvent::Type::TOUCH: + return blink::PointerData::DeviceKind::kTouch; + case mozart::PointerEvent::Type::MOUSE: + return blink::PointerData::DeviceKind::kMouse; + default: + return blink::PointerData::DeviceKind::kTouch; + } +} + +bool PlatformView::OnHandlePointerEvent( + const mozart::PointerEventPtr& pointer) { + blink::PointerData pointer_data; + pointer_data.time_stamp = pointer->event_time / 1000; + pointer_data.change = GetChangeFromPointerEventPhase(pointer->phase); + pointer_data.kind = GetKindFromPointerType(pointer->type); + pointer_data.device = pointer->pointer_id; + pointer_data.physical_x = pointer->x * metrics_.scale; + pointer_data.physical_y = pointer->y * metrics_.scale; + + switch (pointer_data.change) { + case blink::PointerData::Change::kDown: + down_pointers_.insert(pointer_data.device); + break; + case blink::PointerData::Change::kCancel: + case blink::PointerData::Change::kUp: + down_pointers_.erase(pointer_data.device); + break; + case blink::PointerData::Change::kMove: + if (down_pointers_.count(pointer_data.device) == 0) { + pointer_data.change = blink::PointerData::Change::kHover; + } + break; + case blink::PointerData::Change::kAdd: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received add event for down pointer."; + } + break; + case blink::PointerData::Change::kRemove: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received remove event for down pointer."; + } + break; + case blink::PointerData::Change::kHover: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received hover event for down pointer."; + } + break; + } + + auto packet = std::make_unique(1); + packet->SetPointerData(0, pointer_data); + DispatchPointerDataPacket(std::move(packet)); + return true; +} + +bool PlatformView::OnHandleKeyboardEvent( + const mozart::KeyboardEventPtr& keyboard) { + const char* type = nullptr; + if (keyboard->phase == mozart::KeyboardEvent::Phase::PRESSED) { + type = "keydown"; + } else if (keyboard->phase == mozart::KeyboardEvent::Phase::REPEAT) { + type = "keydown"; // TODO change this to keyrepeat + } else if (keyboard->phase == mozart::KeyboardEvent::Phase::RELEASED) { + type = "keyup"; + } + + if (type == nullptr) { + FXL_DLOG(ERROR) << "Unknown key event phase."; + return false; + } + + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + document.SetObject(); + document.AddMember("type", rapidjson::Value(type, strlen(type)), allocator); + document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); + document.AddMember("hidUsage", keyboard->hid_usage, allocator); + document.AddMember("codePoint", keyboard->code_point, allocator); + document.AddMember("modifiers", keyboard->modifiers, allocator); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + DispatchPlatformMessage(fxl::MakeRefCounted( + kKeyEventChannel, // channel + std::vector(data, data + buffer.GetSize()), // data + nullptr) // response + ); + + return true; +} + +bool PlatformView::OnHandleFocusEvent(const mozart::FocusEventPtr& focus) { + if (!focus->focused && current_text_input_client_ != 0) { + current_text_input_client_ = 0; + if (ime_) { + ime_->Hide(); + ime_ = nullptr; + } + if (ime_client_.is_bound()) { + ime_client_.Unbind(); + } + return true; + } + return false; +} + +// |shell::PlatformView| +std::unique_ptr PlatformView::CreateRenderingSurface() { + // This platform does not repeatly lose and gain a surface connection. So the + // surface is setup once during platform view setup and and returned to the + // shell on the initial (and only) |NotifyCreated| call. + return std::move(surface_); +} + +// |shell::PlatformView| +void PlatformView::HandlePlatformMessage( + fxl::RefPtr message) { + if (!message) { + return; + } + auto found = platform_message_handlers_.find(message->channel()); + if (found == platform_message_handlers_.end()) { + FXL_DLOG(ERROR) + << "Platform view received message on channel '" << message->channel() + << "' with no registed handler. And empty response will be generated. " + "Please implement the native message handler."; + PlatformView::HandlePlatformMessage(std::move(message)); + return; + } + found->second(std::move(message)); +} + +// |shell::PlatformView| +void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) { + accessibility_bridge_.UpdateSemantics(update); +} + +// Channel handler for kFlutterPlatformChannel +void PlatformView::HandleFlutterPlatformChannelPlatformMessage( + fxl::RefPtr message) { + FXL_DCHECK(message->channel() == kFlutterPlatformChannel); + const auto& data = message->data(); + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) { + return; + } + + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) { + return; + } + + fxl::RefPtr response = message->response(); + if (method->value == "Clipboard.setData") { + auto text = root["args"]["text"].GetString(); + clipboard_->Push(text); + response->CompleteEmpty(); + } else if (method->value == "Clipboard.getData") { + clipboard_->Peek([response](const f1dl::String& text) { + rapidjson::StringBuffer json_buffer; + rapidjson::Writer writer(json_buffer); + writer.StartArray(); + writer.StartObject(); + writer.Key("text"); + writer.String(text); + writer.EndObject(); + writer.EndArray(); + std::string result = json_buffer.GetString(); + response->Complete(std::vector{result.begin(), result.end()}); + }); + } else { + response->CompleteEmpty(); + } +} + +// Channel handler for kTextInputChannel +void PlatformView::HandleFlutterTextInputChannelPlatformMessage( + fxl::RefPtr message) { + FXL_DCHECK(message->channel() == kTextInputChannel); + const auto& data = message->data(); + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) { + return; + } + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) { + return; + } + + if (method->value == "TextInput.show") { + if (ime_) { + ime_->Show(); + } + } else if (method->value == "TextInput.hide") { + if (ime_) { + ime_->Hide(); + } + } else if (method->value == "TextInput.setClient") { + current_text_input_client_ = 0; + if (ime_client_.is_bound()) + ime_client_.Unbind(); + ime_ = nullptr; + + auto args = root.FindMember("args"); + if (args == root.MemberEnd() || !args->value.IsArray() || + args->value.Size() != 2) + return; + const auto& configuration = args->value[1]; + if (!configuration.IsObject()) { + return; + } + // TODO(abarth): Read the keyboard type from the configuration. + current_text_input_client_ = args->value[0].GetInt(); + mozart::TextInputStatePtr state = mozart::TextInputState::New(); + state->text = std::string(); + state->selection = mozart::TextSelection::New(); + state->composing = mozart::TextRange::New(); + input_connection_->GetInputMethodEditor( + mozart::KeyboardType::TEXT, mozart::InputMethodAction::DONE, + std::move(state), ime_client_.NewBinding(), ime_.NewRequest()); + } else if (method->value == "TextInput.setEditingState") { + if (ime_) { + auto args_it = root.FindMember("args"); + if (args_it == root.MemberEnd() || !args_it->value.IsObject()) { + return; + } + const auto& args = args_it->value; + mozart::TextInputStatePtr state = mozart::TextInputState::New(); + state->selection = mozart::TextSelection::New(); + state->composing = mozart::TextRange::New(); + // TODO(abarth): Deserialize state. + auto text = args.FindMember("text"); + if (text != args.MemberEnd() && text->value.IsString()) + state->text = text->value.GetString(); + auto selection_base = args.FindMember("selectionBase"); + if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) + state->selection->base = selection_base->value.GetInt(); + auto selection_extent = args.FindMember("selectionExtent"); + if (selection_extent != args.MemberEnd() && + selection_extent->value.IsInt()) + state->selection->extent = selection_extent->value.GetInt(); + auto selection_affinity = args.FindMember("selectionAffinity"); + if (selection_affinity != args.MemberEnd() && + selection_affinity->value.IsString() && + selection_affinity->value == "TextAffinity.upstream") + state->selection->affinity = mozart::TextAffinity::UPSTREAM; + else + state->selection->affinity = mozart::TextAffinity::DOWNSTREAM; + // We ignore selectionIsDirectional because that concept doesn't exist on + // Fuchsia. + auto composing_base = args.FindMember("composingBase"); + if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) + state->composing->start = composing_base->value.GetInt(); + auto composing_extent = args.FindMember("composingExtent"); + if (composing_extent != args.MemberEnd() && + composing_extent->value.IsInt()) + state->composing->end = composing_extent->value.GetInt(); + ime_->SetState(std::move(state)); + } + } else if (method->value == "TextInput.clearClient") { + current_text_input_client_ = 0; + if (ime_client_.is_bound()) + ime_client_.Unbind(); + ime_ = nullptr; + } else { + FXL_DLOG(ERROR) << "Unknown " << message->channel() << " method " + << method->value.GetString(); + } +} + +} // namespace flutter diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h new file mode 100644 index 0000000000000..9888d061352bb --- /dev/null +++ b/content_handler/platform_view.h @@ -0,0 +1,120 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include +#include + +#include "accessibility_bridge.h" +#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/shell/common/platform_view.h" +#include "lib/clipboard/fidl/clipboard.fidl.h" +#include "lib/fidl/cpp/bindings/binding.h" +#include "lib/fxl/macros.h" +#include "lib/ui/input/fidl/input_connection.fidl.h" +#include "lib/ui/views/fidl/view_manager.fidl.h" +#include "lib/ui/views/fidl/views.fidl.h" +#include "surface.h" + +namespace flutter { + +// The per engine component residing on the platform thread is responsible for +// all platform specific integrations. +class PlatformView final : public shell::PlatformView, + public mozart::ViewListener, + public mozart::InputMethodEditorClient, + public mozart::InputListener { + public: + PlatformView( + PlatformView::Delegate& delegate, + std::string debug_label, + blink::TaskRunners task_runners, + component::ServiceProviderPtr parent_environment_service_provider, + mozart::ViewManagerPtr& view_manager, + f1dl::InterfaceRequest view_owner, + ui::ScenicPtr scenic, + zx::eventpair export_token, + zx::eventpair import_token, + maxwell::ContextWriterPtr accessibility_context_writer, + OnMetricsUpdate on_session_metrics_did_change, + fxl::Closure session_error_callback); + + ~PlatformView(); + + void UpdateViewportMetrics(double pixel_ratio); + + mozart::ViewPtr& GetMozartView(); + + private: + const std::string debug_label_; + mozart::ViewPtr view_; + f1dl::Binding view_listener_; + mozart::InputConnectionPtr input_connection_; + f1dl::Binding input_listener_; + int current_text_input_client_ = 0; + f1dl::Binding ime_client_; + mozart::InputMethodEditorPtr ime_; + modular::ClipboardPtr clipboard_; + ui::ScenicPtr scenic_; + AccessibilityBridge accessibility_bridge_; + std::unique_ptr surface_; + blink::LogicalMetrics metrics_; + std::set down_pointers_; + std::map< + std::string /* channel */, + std::function /* message */)> /* handler */> + platform_message_handlers_; + + void RegisterPlatformMessageHandlers(); + + void UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout); + + void FlushViewportMetrics(); + + // |mozart::ViewListener| + void OnPropertiesChanged( + mozart::ViewPropertiesPtr properties, + const OnPropertiesChangedCallback& callback) override; + + // |mozart::InputMethodEditorClient| + void DidUpdateState(mozart::TextInputStatePtr state, + mozart::InputEventPtr event) override; + + // |mozart::InputMethodEditorClient| + void OnAction(mozart::InputMethodAction action) override; + + // |mozart::InputListener| + void OnEvent(mozart::InputEventPtr event, + const OnEventCallback& callback) override; + + bool OnHandlePointerEvent(const mozart::PointerEventPtr& pointer); + + bool OnHandleKeyboardEvent(const mozart::KeyboardEventPtr& keyboard); + + bool OnHandleFocusEvent(const mozart::FocusEventPtr& focus); + + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; + + // |shell::PlatformView| + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + // Channel handler for kFlutterPlatformChannel + void HandleFlutterPlatformChannelPlatformMessage( + fxl::RefPtr message); + + // Channel handler for kTextInputChannel + void HandleFlutterTextInputChannelPlatformMessage( + fxl::RefPtr message); + + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); +}; + +} // namespace flutter diff --git a/content_handler/rasterizer.cc b/content_handler/rasterizer.cc deleted file mode 100644 index b720809b17a45..0000000000000 --- a/content_handler/rasterizer.cc +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/rasterizer.h" -#include "flutter/content_handler/vulkan_rasterizer.h" - -namespace flutter_runner { - -Rasterizer::~Rasterizer() = default; - -std::unique_ptr Rasterizer::Create() { - auto vulkan_rasterizer = std::make_unique(); - FXL_CHECK(vulkan_rasterizer) - << "The vulkan rasterizer must be correctly initialized."; - return vulkan_rasterizer; -} - -} // namespace flutter_runner diff --git a/content_handler/rasterizer.h b/content_handler/rasterizer.h deleted file mode 100644 index 398f262a568cd..0000000000000 --- a/content_handler/rasterizer.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ -#define FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ - -#include - -#include - -#include "flutter/flow/layers/layer_tree.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" - -namespace flutter_runner { - -class Rasterizer { - public: - virtual ~Rasterizer(); - - static std::unique_ptr Create(); - - virtual void SetScene( - fidl::InterfaceHandle mozart, - zx::eventpair import_token, - fxl::Closure metrics_changed_callback) = 0; - - virtual void Draw(std::unique_ptr layer_tree, - fxl::Closure callback) = 0; -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ diff --git a/content_handler/runtime_holder.cc b/content_handler/runtime_holder.cc deleted file mode 100644 index 421731b9691d0..0000000000000 --- a/content_handler/runtime_holder.cc +++ /dev/null @@ -1,911 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/runtime_holder.h" - -#include -#include -#include -#include -#include - -#include "dart-pkg/zircon/sdk_ext/handle.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/common/threads.h" -#include "flutter/content_handler/accessibility_bridge.h" -#include "flutter/content_handler/rasterizer.h" -#include "flutter/content_handler/service_protocol_hooks.h" -#include "flutter/lib/snapshot/snapshot.h" -#include "flutter/lib/ui/window/pointer_data_packet.h" -#include "flutter/runtime/asset_font_selector.h" -#include "flutter/runtime/dart_controller.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/runtime_init.h" -#include "lib/app/cpp/connect.h" -#include "lib/fsl/vmo/vector.h" -#include "lib/fxl/files/path.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/zip/create_unzipper.h" -#include "third_party/dart/runtime/include/dart_api.h" -#include "third_party/rapidjson/rapidjson/document.h" -#include "third_party/rapidjson/rapidjson/stringbuffer.h" -#include "third_party/rapidjson/rapidjson/writer.h" - -using tonic::DartConverter; -using tonic::ToDart; - -namespace flutter_runner { -namespace { - -constexpr char kKernelKey[] = "kernel_blob.bin"; -constexpr char kSnapshotKey[] = "snapshot_blob.bin"; -constexpr char kDylibKey[] = "libapp.so"; -constexpr char kAssetChannel[] = "flutter/assets"; -constexpr char kKeyEventChannel[] = "flutter/keyevent"; -constexpr char kTextInputChannel[] = "flutter/textinput"; -constexpr char kFlutterPlatformChannel[] = "flutter/platform"; -constexpr char kFuchsiaPackageResourceDirectory[] = "pkg/data"; -constexpr char kDartPkgContentsKey[] = "dart-pkg/contents"; - -void SetThreadName(fxl::RefPtr runner, std::string name) { - runner->PostTask([name]() { - zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); - Dart_SetThreadName(name.c_str()); - }); -} - -blink::PointerData::Change GetChangeFromPointerEventPhase( - input::PointerEventPhase phase) { - switch (phase) { - case input::PointerEventPhase::ADD: - return blink::PointerData::Change::kAdd; - case input::PointerEventPhase::HOVER: - return blink::PointerData::Change::kHover; - case input::PointerEventPhase::DOWN: - return blink::PointerData::Change::kDown; - case input::PointerEventPhase::MOVE: - return blink::PointerData::Change::kMove; - case input::PointerEventPhase::UP: - return blink::PointerData::Change::kUp; - case input::PointerEventPhase::REMOVE: - return blink::PointerData::Change::kRemove; - case input::PointerEventPhase::CANCEL: - return blink::PointerData::Change::kCancel; - default: - return blink::PointerData::Change::kCancel; - } -} - -blink::PointerData::DeviceKind GetKindFromPointerType( - input::PointerEventType type) { - switch (type) { - case input::PointerEventType::TOUCH: - return blink::PointerData::DeviceKind::kTouch; - case input::PointerEventType::MOUSE: - return blink::PointerData::DeviceKind::kMouse; - default: - return blink::PointerData::DeviceKind::kTouch; - } -} - -} // namespace - -RuntimeHolder::RuntimeHolder() - : view_listener_binding_(this), - input_listener_binding_(this), - text_input_binding_(this), - weak_factory_(this) {} - -RuntimeHolder::~RuntimeHolder() { - blink::Threads::Gpu()->PostTask( - fxl::MakeCopyable([rasterizer = std::move(rasterizer_)](){ - // Deletes rasterizer. - })); -} - -void RuntimeHolder::Init( - fdio_ns_t* namespc, - std::unique_ptr context, - fidl::InterfaceRequest outgoing_services, - std::vector bundle) { - FXL_DCHECK(!rasterizer_); - rasterizer_ = Rasterizer::Create(); - FXL_DCHECK(rasterizer_); - - namespc_ = namespc; - dirfd_ = fdio_ns_opendir(namespc); - if (dirfd_ == -1) { - FXL_LOG(ERROR) << "Failed to get fd for namespace"; - return; - } - context_ = std::move(context); - outgoing_services_ = std::move(outgoing_services); - - context_->ConnectToEnvironmentService(view_manager_.NewRequest()); - - // TODO(zarah): remove bundle entirely once flx is removed. - InitRootBundle(std::move(bundle)); - - const uint8_t* vm_snapshot_data; - const uint8_t* vm_snapshot_instr; - const uint8_t* default_isolate_snapshot_data; - const uint8_t* default_isolate_snapshot_instr; - if (!Dart_IsPrecompiledRuntime()) { - vm_snapshot_data = ::kDartVmSnapshotData; - vm_snapshot_instr = ::kDartVmSnapshotInstructions; - default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; - default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; - } else { - std::vector dylib_blob; - if (!GetAssetAsBuffer(kDylibKey, &dylib_blob)) { - FXL_LOG(ERROR) << "Failed to extract app dylib"; - return; - } - - fsl::SizedVmo dylib_vmo; - if (!fsl::VmoFromVector(dylib_blob, &dylib_vmo)) { - FXL_LOG(ERROR) << "Failed to load app dylib"; - return; - } - - dlerror(); - dylib_handle_ = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); - if (dylib_handle_ == nullptr) { - FXL_LOG(ERROR) << "dlopen failed: " << dlerror(); - return; - } - vm_snapshot_data = reinterpret_cast( - dlsym(dylib_handle_, "_kDartVmSnapshotData")); - vm_snapshot_instr = reinterpret_cast( - dlsym(dylib_handle_, "_kDartVmSnapshotInstructions")); - default_isolate_snapshot_data = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); - default_isolate_snapshot_instr = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); - } - - // TODO(rmacnak): We should generate the AOT vm snapshot separately from - // each app so we can initialize before receiving the first app bundle. - static bool first_app = true; - if (first_app) { - first_app = false; - blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, - default_isolate_snapshot_data, - default_isolate_snapshot_instr, - /* bundle_path = */ ""); - - // This has to happen after the Dart runtime is initialized. - SetThreadName(blink::Threads::UI(), "ui"); - SetThreadName(blink::Threads::Gpu(), "gpu"); - SetThreadName(blink::Threads::IO(), "io"); - - blink::SetRegisterNativeServiceProtocolExtensionHook( - ServiceProtocolHooks::RegisterHooks); - } - - accessibility_bridge_ = std::make_unique(context_.get()); -} - -void RuntimeHolder::CreateView( - const std::string& script_uri, - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services) { - if (view_listener_binding_.is_bound()) { - // TODO(jeffbrown): Refactor this to support multiple view instances - // sharing the same underlying root bundle (but with different runtimes). - FXL_LOG(ERROR) << "The view has already been created."; - return; - } - - std::vector kernel; - std::vector snapshot; - bool maybe_running_from_source = false; - if (!Dart_IsPrecompiledRuntime()) { - if (!GetAssetAsBuffer(kKernelKey, &kernel) && - !GetAssetAsBuffer(kSnapshotKey, &snapshot)) { - maybe_running_from_source = true; - FXL_LOG(INFO) << "No kernel or snapshot in root bundle."; - } - } - - // Create the view. - zx::eventpair import_token, export_token; - zx_status_t status = zx::eventpair::create(0u, &import_token, &export_token); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Could not create an event pair."; - return; - } - views_v1::ViewListenerPtr view_listener; - view_listener_binding_.Bind(view_listener.NewRequest()); - view_manager_->CreateView(view_.NewRequest(), // view - std::move(view_owner_request), // view owner - std::move(view_listener), // view listener - std::move(export_token), // export token - script_uri // diagnostic label - ); - component::ServiceProviderPtr view_services; - view_->GetServiceProvider(view_services.NewRequest()); - - // Listen for input events. - ConnectToService(view_services.get(), input_connection_.NewRequest()); - input::InputListenerPtr input_listener; - input_listener_binding_.Bind(input_listener.NewRequest()); - input_connection_->SetEventListener(std::move(input_listener)); - - // Setup the session. - fidl::InterfaceHandle scenic; - view_manager_->GetScenic(scenic.NewRequest()); - - blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ - rasterizer = rasterizer_.get(), // - scenic = std::move(scenic), // - import_token = std::move(import_token), // - weak_runtime_holder = GetWeakPtr() - ]() mutable { - ASSERT_IS_GPU_THREAD; - rasterizer->SetScene( - std::move(scenic), std::move(import_token), - // TODO(MZ-222): Ideally we would immediately redraw the previous layer - // tree when the metrics change since there's no need to rerecord it. - // However, we want to make sure there's only one outstanding frame. - // We should improve the frame scheduling so that the rasterizer thread - // can self-schedule re-rasterization. - [weak_runtime_holder] { - // This is on the GPU thread thread. Post to the Platform/UI - // thread for the completion callback. - ASSERT_IS_GPU_THREAD; - blink::Threads::Platform()->PostTask([weak_runtime_holder]() { - // On the Platform/UI thread. - ASSERT_IS_UI_THREAD; - if (weak_runtime_holder) { - weak_runtime_holder->OnRedrawFrame(); - } - }); - }); - })); - runtime_ = blink::RuntimeController::Create(this); - - const uint8_t* isolate_snapshot_data; - const uint8_t* isolate_snapshot_instr; - if (!Dart_IsPrecompiledRuntime()) { - isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; - isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; - } else { - isolate_snapshot_data = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); - isolate_snapshot_instr = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); - } - runtime_->CreateDartController(script_uri, isolate_snapshot_data, - isolate_snapshot_instr, dirfd_); - - runtime_->SetViewportMetrics(viewport_metrics_); - - if (Dart_IsPrecompiledRuntime()) { - runtime_->dart_controller()->RunFromPrecompiledSnapshot(); - } else if (!kernel.empty()) { - runtime_->dart_controller()->RunFromKernel(std::move(kernel)); - } else if (maybe_running_from_source) { - std::vector data; - if (!GetAssetAsBuffer(kDartPkgContentsKey, &data)) { - FXL_LOG(ERROR) << "Contents file not found for " << script_uri; - return; - } - std::string package_name(data.begin(), data.end()); - std::string main_dart = "pkg/data/dart-pkg/" + package_name + "/lib/main.dart"; - FXL_LOG(INFO) << "Running from source with entrypoint: '" << main_dart - << "'"; - runtime_->dart_controller()->RunFromSource(main_dart, "pkg/data/dart-pkg/.packages"); - } else { - runtime_->dart_controller()->RunFromScriptSnapshot(snapshot.data(), - snapshot.size()); - } - - runtime_->dart_controller()->dart_state()->SetReturnCodeCallback( - [this](int32_t return_code) { return_code_ = return_code; }); -} - -Dart_Port RuntimeHolder::GetUIIsolateMainPort() { - if (!runtime_) - return ILLEGAL_PORT; - return runtime_->GetMainPort(); -} - -void RuntimeHolder::DidShutdownMainIsolate() { - if (main_isolate_shutdown_callback_) { - main_isolate_shutdown_callback_(); - } -} - -void RuntimeHolder::SetMainIsolateShutdownCallback( - std::function callback) { - main_isolate_shutdown_callback_ = callback; -} - -std::string RuntimeHolder::GetUIIsolateName() { - if (!runtime_) { - return ""; - } - return runtime_->GetIsolateName(); -} - -std::string RuntimeHolder::DefaultRouteName() { - return "/"; -} - -void RuntimeHolder::ScheduleFrame(bool regenerate_layer_tree) { - ASSERT_IS_UI_THREAD; - // TODO(mravn): We assume regenerate_layer_tree is true (and thus ignore - // that we may be able to reuse the current layer tree.) - if (!frame_scheduled_) { - frame_scheduled_ = true; - if (!frame_outstanding_) - PostBeginFrame(); - } -} - -void RuntimeHolder::Render(std::unique_ptr layer_tree) { - if (!frame_outstanding_ || frame_rendering_) { - // TODO(MZ-193): We probably shouldn't be discarding the layer tree here. - // But then, Flutter shouldn't be calling Render() if we didn't call - // BeginFrame(). - return; // Spurious. - } - - frame_rendering_ = true; - - layer_tree->set_construction_time(fxl::TimePoint::Now() - - last_begin_frame_time_); - layer_tree->set_frame_size(SkISize::Make(viewport_metrics_.physical_width, - viewport_metrics_.physical_height)); - layer_tree->set_device_pixel_ratio(viewport_metrics_.device_pixel_ratio); - - // We are on the Platform/UI thread. Post to the GPU thread to render. - ASSERT_IS_PLATFORM_THREAD; - blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ - rasterizer = rasterizer_.get(), // - layer_tree = std::move(layer_tree), // - weak_runtime_holder = GetWeakPtr() // - ]() mutable { - // On the GPU Thread. - ASSERT_IS_GPU_THREAD; - rasterizer->Draw(std::move(layer_tree), [weak_runtime_holder]() { - // This is on the GPU thread thread. Post to the Platform/UI thread - // for the completion callback. - ASSERT_IS_GPU_THREAD; - blink::Threads::Platform()->PostTask([weak_runtime_holder]() { - // On the Platform/UI thread. - ASSERT_IS_UI_THREAD; - if (weak_runtime_holder) { - weak_runtime_holder->frame_rendering_ = false; - weak_runtime_holder->OnFrameComplete(); - } - }); - }); - })); -} - -void RuntimeHolder::UpdateSemantics(blink::SemanticsNodeUpdates update) { - accessibility_bridge_->UpdateSemantics(update); -} - -void RuntimeHolder::HandlePlatformMessage( - fxl::RefPtr message) { - if (message->channel() == kAssetChannel) { - if (HandleAssetPlatformMessage(message.get())) - return; - } else if (message->channel() == kTextInputChannel) { - if (HandleTextInputPlatformMessage(message.get())) - return; - } else if (message->channel() == kFlutterPlatformChannel) { - if (HandleFlutterPlatformMessage(message.get())) - return; - } - if (auto response = message->response()) - response->CompleteEmpty(); -} - -void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) { - if (asset_provider_) { - blink::AssetFontSelector::Install(asset_provider_); - } else if (asset_store_) { - blink::AssetFontSelector::Install(asset_store_); - } - InitDartIoInternal(); - InitFuchsia(); - InitZircon(); - InitScenicInternal(); -} - -void RuntimeHolder::InitDartIoInternal() { - Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io")); - - // Set up the namespace. - Dart_Handle namespace_type = - Dart_GetType(io_lib, ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - Dart_Handle namespace_args[1]; - namespace_args[0] = Dart_NewInteger(reinterpret_cast(namespc_)); - DART_CHECK_VALID(namespace_args[0]); - DART_CHECK_VALID(Dart_Invoke(namespace_type, ToDart("_setupNamespace"), 1, - namespace_args)); - - // Disable dart:io exit() - Dart_Handle embedder_config_type = - Dart_GetType(io_lib, ToDart("_EmbedderConfig"), 0, nullptr); - DART_CHECK_VALID(embedder_config_type); - DART_CHECK_VALID( - Dart_SetField(embedder_config_type, ToDart("_mayExit"), Dart_False())); -} - -void RuntimeHolder::InitFuchsia() { - fidl::InterfaceHandle environment; - context_->ConnectToEnvironmentService(environment.NewRequest()); - fuchsia::dart::Initialize(std::move(environment), - std::move(outgoing_services_)); - - component::ServiceProviderPtr parent_env_service_provider; - context_->environment()->GetServices( - parent_env_service_provider.NewRequest()); - ConnectToService(parent_env_service_provider.get(), clipboard_.NewRequest()); -} - -void RuntimeHolder::InitZircon() { - Dart_Handle zircon_lib = Dart_LookupLibrary(ToDart("dart:zircon")); - DART_CHECK_VALID(zircon_lib); - - Dart_Handle namespace_type = - Dart_GetType(zircon_lib, ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - DART_CHECK_VALID(Dart_SetField(namespace_type, ToDart("_namespace"), - ToDart(reinterpret_cast(namespc_)))); -} - -void RuntimeHolder::InitScenicInternal() { - fidl::InterfaceHandle view_container; - view_->GetContainer(view_container.NewRequest()); - - Dart_Handle mozart_internal = - Dart_LookupLibrary(ToDart("dart:mozart.internal")); - - DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, mozart::NativeLookup, - mozart::NativeSymbol)); - - DART_CHECK_VALID( - Dart_SetField(mozart_internal, ToDart("_context"), - DartConverter::ToDart(reinterpret_cast( - static_cast(this))))); - - DART_CHECK_VALID(Dart_SetField(mozart_internal, ToDart("_viewContainer"), - ToDart(zircon::dart::Handle::Create( - view_container.TakeChannel().release())))); -} - -void RuntimeHolder::InitRootBundle(std::vector bundle) { - if (!bundle.empty()) { - root_bundle_data_ = std::move(bundle); - asset_store_ = fxl::MakeRefCounted( - GetUnzipperProviderForRootBundle()); - } else { - fxl::UniqueFD root_dir(fdio_ns_opendir(namespc_)); - if (!root_dir.is_valid()) { - FXL_LOG(ERROR) << "Unable to load root dir"; - return; - } - fxl::UniqueFD data_dir(openat(root_dir.get(), - kFuchsiaPackageResourceDirectory, - O_RDONLY | O_DIRECTORY)); - if (!data_dir.is_valid()) { - FXL_LOG(ERROR) << "Unable to load data dir"; - return; - } - asset_provider_ = - fxl::MakeRefCounted(std::move(data_dir)); - } -} - -views_v1::View* RuntimeHolder::GetMozartView() { - return view_.get(); -} - -bool RuntimeHolder::HandleAssetPlatformMessage( - blink::PlatformMessage* message) { - fxl::RefPtr response = message->response(); - if (!response) - return false; - const auto& data = message->data(); - std::string asset_name(reinterpret_cast(data.data()), - data.size()); - std::vector asset_data; - if (GetAssetAsBuffer(asset_name, &asset_data)) { - response->Complete(std::move(asset_data)); - } else { - response->CompleteEmpty(); - } - return true; -} - -bool RuntimeHolder::GetAssetAsBuffer(const std::string& name, - std::vector* data) { - return (asset_provider_ && - asset_provider_->GetAsBuffer(name, data)) || - (asset_store_ && asset_store_->GetAsBuffer(name, data)); -} - -bool RuntimeHolder::HandleFlutterPlatformMessage( - blink::PlatformMessage* message) { - const auto& data = message->data(); - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) { - return false; - } - - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) { - return false; - } - - fxl::RefPtr response = message->response(); - if (method->value == "Clipboard.setData") { - auto text = root["args"]["text"].GetString(); - clipboard_->Push(text); - response->CompleteEmpty(); - } else if (method->value == "Clipboard.getData") { - clipboard_->Peek([response](fidl::StringPtr text) { - rapidjson::StringBuffer json_buffer; - rapidjson::Writer writer(json_buffer); - writer.StartArray(); - writer.StartObject(); - writer.Key("text"); - writer.String(text.get()); - writer.EndObject(); - writer.EndArray(); - - std::string result = json_buffer.GetString(); - response->Complete(std::vector{result.begin(), result.end()}); - }); - } else { - response->CompleteEmpty(); - } - return true; -} - -bool RuntimeHolder::HandleTextInputPlatformMessage( - blink::PlatformMessage* message) { - const auto& data = message->data(); - - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) - return false; - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) - return false; - - if (method->value == "TextInput.show") { - if (input_method_editor_) { - input_method_editor_->Show(); - } - } else if (method->value == "TextInput.hide") { - if (input_method_editor_) { - input_method_editor_->Hide(); - } - } else if (method->value == "TextInput.setClient") { - current_text_input_client_ = 0; - if (text_input_binding_.is_bound()) - text_input_binding_.Unbind(); - input_method_editor_ = nullptr; - - auto args = root.FindMember("args"); - if (args == root.MemberEnd() || !args->value.IsArray() || - args->value.Size() != 2) - return false; - const auto& configuration = args->value[1]; - if (!configuration.IsObject()) - return false; - // TODO(abarth): Read the keyboard type form the configuration. - current_text_input_client_ = args->value[0].GetInt(); - input::TextInputState state; - state.text = std::string(); - input_connection_->GetInputMethodEditor( - input::KeyboardType::TEXT, input::InputMethodAction::DONE, - std::move(state), text_input_binding_.NewBinding(), - input_method_editor_.NewRequest()); - } else if (method->value == "TextInput.setEditingState") { - if (input_method_editor_) { - auto args_it = root.FindMember("args"); - if (args_it == root.MemberEnd() || !args_it->value.IsObject()) - return false; - const auto& args = args_it->value; - input::TextInputState state; - // TODO(abarth): Deserialize state. - auto text = args.FindMember("text"); - if (text != args.MemberEnd() && text->value.IsString()) - state.text = text->value.GetString(); - auto selection_base = args.FindMember("selectionBase"); - if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) - state.selection.base = selection_base->value.GetInt(); - auto selection_extent = args.FindMember("selectionExtent"); - if (selection_extent != args.MemberEnd() && - selection_extent->value.IsInt()) - state.selection.extent = selection_extent->value.GetInt(); - auto selection_affinity = args.FindMember("selectionAffinity"); - if (selection_affinity != args.MemberEnd() && - selection_affinity->value.IsString() && - selection_affinity->value == "TextAffinity.upstream") - state.selection.affinity = input::TextAffinity::UPSTREAM; - else - state.selection.affinity = input::TextAffinity::DOWNSTREAM; - // We ignore selectionIsDirectional because that concept doesn't exist on - // Fuchsia. - auto composing_base = args.FindMember("composingBase"); - if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) - state.composing.start = composing_base->value.GetInt(); - auto composing_extent = args.FindMember("composingExtent"); - if (composing_extent != args.MemberEnd() && - composing_extent->value.IsInt()) - state.composing.end = composing_extent->value.GetInt(); - input_method_editor_->SetState(std::move(state)); - } - } else if (method->value == "TextInput.clearClient") { - current_text_input_client_ = 0; - if (text_input_binding_.is_bound()) - text_input_binding_.Unbind(); - input_method_editor_ = nullptr; - } else { - FXL_DLOG(ERROR) << "Unknown " << kTextInputChannel << " method " - << method->value.GetString(); - } - - return false; -} - -blink::UnzipperProvider RuntimeHolder::GetUnzipperProviderForRootBundle() { - return [self = GetWeakPtr()]() { - if (!self) - return zip::UniqueUnzipper(); - return zip::CreateUnzipper(&self->root_bundle_data_); - }; -} - -void RuntimeHolder::OnEvent(input::InputEvent event, - OnEventCallback callback) { - bool handled = false; - if (event.is_pointer()) { - const input::PointerEvent& pointer = event.pointer(); - blink::PointerData pointer_data; - pointer_data.time_stamp = pointer.event_time / 1000; - pointer_data.change = GetChangeFromPointerEventPhase(pointer.phase); - pointer_data.kind = GetKindFromPointerType(pointer.type); - pointer_data.device = pointer.pointer_id; - pointer_data.physical_x = pointer.x * viewport_metrics_.device_pixel_ratio; - pointer_data.physical_y = pointer.y * viewport_metrics_.device_pixel_ratio; - // Buttons are single bit values starting with kMousePrimaryButton = 1. - pointer_data.buttons = static_cast(pointer.buttons); - - switch (pointer_data.change) { - case blink::PointerData::Change::kDown: - down_pointers_.insert(pointer_data.device); - break; - case blink::PointerData::Change::kCancel: - case blink::PointerData::Change::kUp: - down_pointers_.erase(pointer_data.device); - break; - case blink::PointerData::Change::kMove: - if (down_pointers_.count(pointer_data.device) == 0) - pointer_data.change = blink::PointerData::Change::kHover; - break; - case blink::PointerData::Change::kAdd: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received add event for down pointer."; - } - break; - case blink::PointerData::Change::kRemove: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received remove event for down pointer."; - } - break; - case blink::PointerData::Change::kHover: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received hover event for down pointer."; - } - break; - } - - blink::PointerDataPacket packet(1); - packet.SetPointerData(0, pointer_data); - runtime_->DispatchPointerDataPacket(packet); - - handled = true; - } else if (event.is_keyboard()) { - const input::KeyboardEvent& keyboard = event.keyboard(); - const char* type = nullptr; - if (keyboard.phase == input::KeyboardEventPhase::PRESSED) - type = "keydown"; - else if (keyboard.phase == input::KeyboardEventPhase::REPEAT) - type = "keydown"; // TODO change this to keyrepeat - else if (keyboard.phase == input::KeyboardEventPhase::RELEASED) - type = "keyup"; - - if (type) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - document.SetObject(); - document.AddMember("type", rapidjson::Value(type, strlen(type)), - allocator); - document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); - document.AddMember("hidUsage", keyboard.hid_usage, allocator); - document.AddMember("codePoint", keyboard.code_point, allocator); - document.AddMember("modifiers", keyboard.modifiers, allocator); - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = - reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage( - fxl::MakeRefCounted( - kKeyEventChannel, - std::vector(data, data + buffer.GetSize()), nullptr)); - handled = true; - } - } - callback(handled); -} - -void RuntimeHolder::OnPropertiesChanged( - views_v1::ViewProperties properties, - OnPropertiesChangedCallback callback) { - // Attempt to read the device pixel ratio. - float pixel_ratio = 1.f; - if (auto& metrics = properties.display_metrics) { - pixel_ratio = metrics->device_pixel_ratio; - } - - // Apply view property changes. - if (auto& layout = properties.view_layout) { - viewport_metrics_.physical_width = layout->size.width * pixel_ratio; - viewport_metrics_.physical_height = layout->size.height * pixel_ratio; - viewport_metrics_.physical_padding_top = layout->inset.top * pixel_ratio; - viewport_metrics_.physical_padding_right = - layout->inset.right * pixel_ratio; - viewport_metrics_.physical_padding_bottom = - layout->inset.bottom * pixel_ratio; - viewport_metrics_.physical_padding_left = layout->inset.left * pixel_ratio; - viewport_metrics_.device_pixel_ratio = pixel_ratio; - runtime_->SetViewportMetrics(viewport_metrics_); - } - - ScheduleFrame(); - - callback(); -} - -void RuntimeHolder::DidUpdateState(input::TextInputState state, - input::InputEventPtr event) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - - rapidjson::Value encoded_state(rapidjson::kObjectType); - encoded_state.AddMember("text", state.text.get(), allocator); - encoded_state.AddMember("selectionBase", state.selection.base, allocator); - encoded_state.AddMember("selectionExtent", state.selection.extent, - allocator); - switch (state.selection.affinity) { - case input::TextAffinity::UPSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.upstream"), - allocator); - break; - case input::TextAffinity::DOWNSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.downstream"), - allocator); - break; - } - encoded_state.AddMember("selectionIsDirectional", true, allocator); - encoded_state.AddMember("composingBase", state.composing.start, allocator); - encoded_state.AddMember("composingExtent", state.composing.end, allocator); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - args.PushBack(encoded_state, allocator); - - document.SetObject(); - document.AddMember("method", - rapidjson::Value("TextInputClient.updateEditingState"), - allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, std::vector(data, data + buffer.GetSize()), - nullptr)); -} - -void RuntimeHolder::OnAction(input::InputMethodAction action) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - - // Done is currently the only text input action defined by Flutter. - args.PushBack("TextInputAction.done", allocator); - - document.SetObject(); - document.AddMember( - "method", rapidjson::Value("TextInputClient.performAction"), allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, std::vector(data, data + buffer.GetSize()), - nullptr)); -} - -fxl::WeakPtr RuntimeHolder::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -void RuntimeHolder::PostBeginFrame() { - blink::Threads::Platform()->PostTask([weak_runtime_holder = GetWeakPtr()]() { - // On the Platform/UI thread. - ASSERT_IS_UI_THREAD; - if (weak_runtime_holder) { - weak_runtime_holder->BeginFrame(); - } - }); -} - -void RuntimeHolder::BeginFrame() { - ASSERT_IS_UI_THREAD - FXL_DCHECK(frame_scheduled_); - FXL_DCHECK(!frame_outstanding_); - frame_scheduled_ = false; - frame_outstanding_ = true; - int64_t dart_frame_start_micros = Dart_TimelineGetMicros(); - last_begin_frame_time_ = fxl::TimePoint::Now(); - runtime_->BeginFrame(last_begin_frame_time_); - - if (frame_scheduled_) { - // HACK(rmacnak): This assumes 16ms/frame; it should use the frame deadline - // once we have access to it. Compare shell/common/animator.cc. - runtime_->NotifyIdle(dart_frame_start_micros + 16000); - } else { - // We don't have another frame pending, so we're waiting on user input - // or I/O. Allow the Dart VM 100 ms. - runtime_->NotifyIdle(dart_frame_start_micros + 100000); - } -} - -void RuntimeHolder::OnFrameComplete() { - ASSERT_IS_UI_THREAD - FXL_DCHECK(frame_outstanding_); - frame_outstanding_ = false; - if (frame_scheduled_) - PostBeginFrame(); -} - -void RuntimeHolder::OnRedrawFrame() { - if (!frame_outstanding_) - ScheduleFrame(); -} - -} // namespace flutter_runner diff --git a/content_handler/runtime_holder.h b/content_handler/runtime_holder.h deleted file mode 100644 index b9d55d9f9bacc..0000000000000 --- a/content_handler/runtime_holder.h +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ -#define FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ - -#include -#include - -#include - -#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" -#include "flutter/assets/asset_provider.h" -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/unzipper_provider.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/content_handler/accessibility_bridge.h" -#include "flutter/flow/layers/layer_tree.h" -#include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/runtime/runtime_controller.h" -#include "flutter/runtime/runtime_delegate.h" -#include "lib/app/cpp/application_context.h" -#include -#include -#include -#include "lib/fidl/cpp/binding.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" -#include -#include -#include - -namespace flutter_runner { - -class Rasterizer; - -class RuntimeHolder : public blink::RuntimeDelegate, - public mozart::NativesDelegate, - public views_v1::ViewListener, - public input::InputListener, - public input::InputMethodEditorClient { - public: - RuntimeHolder(); - ~RuntimeHolder(); - - void Init(fdio_ns_t* namespc, - std::unique_ptr context, - fidl::InterfaceRequest outgoing_services, - std::vector bundle); - void CreateView(const std::string& script_uri, - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services); - - Dart_Port GetUIIsolateMainPort(); - std::string GetUIIsolateName(); - - int32_t return_code() { return return_code_; } - - void SetMainIsolateShutdownCallback(std::function callback); - - private: - // |blink::RuntimeDelegate| implementation: - std::string DefaultRouteName() override; - void ScheduleFrame(bool regenerate_layer_tree = true) override; - void Render(std::unique_ptr layer_tree) override; - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - void HandlePlatformMessage( - fxl::RefPtr message) override; - void DidCreateMainIsolate(Dart_Isolate isolate) override; - void DidShutdownMainIsolate() override; - - // |mozart::NativesDelegate| implementation: - views_v1::View* GetMozartView() override; - - // |input::InputListener| implementation: - void OnEvent(input::InputEvent event, - OnEventCallback callback) override; - - // |views_v1::ViewListener| implementation: - void OnPropertiesChanged( - views_v1::ViewProperties properties, - OnPropertiesChangedCallback callback) override; - - // |input::InputMethodEditorClient| implementation: - void DidUpdateState(input::TextInputState state, - input::InputEventPtr event) override; - void OnAction(input::InputMethodAction action) override; - - fxl::WeakPtr GetWeakPtr(); - - void InitRootBundle(std::vector bundle); - blink::UnzipperProvider GetUnzipperProviderForRootBundle(); - bool HandleAssetPlatformMessage(blink::PlatformMessage* message); - bool GetAssetAsBuffer(const std::string& name, std::vector* data); - bool HandleTextInputPlatformMessage(blink::PlatformMessage* message); - bool HandleFlutterPlatformMessage(blink::PlatformMessage* message); - - void InitDartIoInternal(); - void InitFuchsia(); - void InitZircon(); - void InitScenicInternal(); - - void PostBeginFrame(); - void BeginFrame(); - void OnFrameComplete(); - void OnRedrawFrame(); - void Invalidate(); - - fdio_ns_t* namespc_; - int dirfd_; - std::unique_ptr context_; - fidl::InterfaceRequest outgoing_services_; - std::vector root_bundle_data_; - // TODO(zarah): Remove asset_store_ when flx is completely removed - fxl::RefPtr asset_store_; - fxl::RefPtr asset_provider_; - void* dylib_handle_ = nullptr; - std::unique_ptr rasterizer_; - std::unique_ptr runtime_; - blink::ViewportMetrics viewport_metrics_; - views_v1::ViewManagerPtr view_manager_; - fidl::Binding view_listener_binding_; - fidl::Binding input_listener_binding_; - input::InputConnectionPtr input_connection_; - views_v1::ViewPtr view_; - std::unordered_set down_pointers_; - input::InputMethodEditorPtr input_method_editor_; - fidl::Binding text_input_binding_; - int current_text_input_client_ = 0; - fxl::TimePoint last_begin_frame_time_; - bool frame_outstanding_ = false; - bool frame_scheduled_ = false; - bool frame_rendering_ = false; - int32_t return_code_ = 0; - - fxl::WeakPtrFactory weak_factory_; - - std::unique_ptr accessibility_bridge_; - - std::function main_isolate_shutdown_callback_; - - modular::ClipboardPtr clipboard_; - - FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeHolder); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ diff --git a/content_handler/service_protocol_hooks.cc b/content_handler/service_protocol_hooks.cc deleted file mode 100644 index 9a91254f13488..0000000000000 --- a/content_handler/service_protocol_hooks.cc +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/content_handler/service_protocol_hooks.h" - -#include - -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/content_handler/app.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace flutter_runner { -namespace { - -constexpr char kViewIdPrefx[] = "_flutterView/"; -constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; - -static intptr_t KeyIndex(const char** param_keys, - intptr_t num_params, - const char* key) { - if (param_keys == NULL) { - return -1; - } - for (intptr_t i = 0; i < num_params; i++) { - if (strcmp(param_keys[i], key) == 0) { - return i; - } - } - return -1; -} - -static const char* ValueForKey(const char** param_keys, - const char** param_values, - intptr_t num_params, - const char* key) { - intptr_t index = KeyIndex(param_keys, num_params, key); - if (index < 0) { - return NULL; - } - return param_values[index]; -} - -static void AppendIsolateRef(std::stringstream* stream, - int64_t main_port, - const std::string name) { - *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; - *stream << main_port << "\",\"name\":\"" << name << "\","; - *stream << "\"number\":\"" << main_port << "\"}"; -} - -static void AppendFlutterView(std::stringstream* stream, - uintptr_t view_id, - int64_t isolate_id, - const std::string isolate_name) { - *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" - << std::hex << view_id << std::dec << "\""; - if (isolate_id != ILLEGAL_PORT) { - // Append the isolate (if it exists). - *stream << "," - << "\"isolate\":"; - AppendIsolateRef(stream, isolate_id, isolate_name); - } - *stream << "}"; -} - -} // namespace - -void ServiceProtocolHooks::RegisterHooks(bool running_precompiled_code) { - // Listing of FlutterViews. - Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, - nullptr); - - Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, - &SetAssetBundlePath, nullptr); -} - -const char* ServiceProtocolHooks::kListViewsExtensionName = - "_flutter.listViews"; - -bool ServiceProtocolHooks::ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - // Ask the App for the list of platform views. This will run a task on - // the UI thread before returning. - App& app = App::Shared(); - std::vector platform_views; - app.WaitForPlatformViewIds(&platform_views); - - std::stringstream response; - - response << "{\"type\":\"FlutterViewList\",\"views\":["; - bool prefix_comma = false; - for (auto it = platform_views.begin(); it != platform_views.end(); it++) { - uintptr_t view_id = it->view_id; - int64_t isolate_id = it->isolate_id; - const std::string& isolate_name = it->isolate_name; - if (!view_id) { - continue; - } - if (prefix_comma) { - response << ','; - } else { - prefix_comma = true; - } - AppendFlutterView(&response, view_id, isolate_id, isolate_name); - } - response << "]}"; - // Copy the response. - *json_object = strdup(response.str().c_str()); - return true; -} - -const char* ServiceProtocolHooks::kSetAssetBundlePathExtensionName = - "_flutter.setAssetBundlePath"; - -bool ServiceProtocolHooks::SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - const char* view_id_str = - ValueForKey(param_keys, param_values, num_params, "viewId"); - - // Ask the App for the list of platform views. This will run a task on - // the UI thread before returning. - App& app = App::Shared(); - std::vector platform_views; - app.WaitForPlatformViewIds(&platform_views); - - // Convert the actual flutter view hex id into a number. - uintptr_t view_id_as_num = - std::stoull((view_id_str + kViewIdPrefxLength), nullptr, 16); - - // The view existed and the isolate was created. Success. - std::stringstream response; - response << "{\"type\":\"Success\"," - << "\"view\":"; - for (auto it = platform_views.begin(); it != platform_views.end(); it++) { - uintptr_t view_id = it->view_id; - int64_t isolate_id = it->isolate_id; - const std::string& isolate_name = it->isolate_name; - if (!view_id || view_id != view_id_as_num) { - continue; - } - - // TODO(DX): Set up asset bundle path for the isolate. - - AppendFlutterView(&response, view_id, isolate_id, isolate_name); - break; - } - response << "}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -} // namespace flutter_runner diff --git a/content_handler/service_protocol_hooks.h b/content_handler/service_protocol_hooks.h deleted file mode 100644 index 479fb71471f1e..0000000000000 --- a/content_handler/service_protocol_hooks.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ -#define FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ - -#include "lib/fxl/synchronization/waitable_event.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace flutter_runner { - -class ServiceProtocolHooks { - public: - static void RegisterHooks(bool running_precompiled_code); - - private: - static const char* kListViewsExtensionName; - static bool ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kSetAssetBundlePathExtensionName; - static bool SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index b496ae37f40f2..870020abb670f 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -2,72 +2,69 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/content_handler/session_connection.h" -#include "lib/fidl/cpp/optional.h" +#include "session_connection.h" + #include "lib/ui/scenic/fidl_helpers.h" -namespace flutter_runner { +namespace flutter { -SessionConnection::SessionConnection(ui::ScenicPtr scenic, - zx::eventpair import_token) - : session_(scenic.get()), +SessionConnection::SessionConnection( + const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback) + : debug_label_(std::move(debug_label)), + session_(scenic.get()), root_node_(&session_), surface_producer_(std::make_unique(&session_)), - scene_update_context_(&session_, surface_producer_.get()) { - ASSERT_IS_GPU_THREAD; - - session_.set_error_handler( - std::bind(&SessionConnection::OnSessionError, this)); + scene_update_context_(&session_, surface_producer_.get()), + metrics_changed_callback_( + std::move(session_metrics_did_change_callback)) { + session_.set_error_handler(std::move(session_error_callback)); session_.set_event_handler(std::bind(&SessionConnection::OnSessionEvents, this, std::placeholders::_1)); root_node_.Bind(std::move(import_token)); - root_node_.SetEventMask(gfx::kMetricsEventMask); - session_.Present(0, [](images::PresentationInfo info) {}); - - present_callback_ = - std::bind(&SessionConnection::OnPresent, this, std::placeholders::_1); + root_node_.SetEventMask(ui::gfx::kMetricsEventMask); + session_.Present(0, [](ui::PresentationInfoPtr info) {}); } -SessionConnection::~SessionConnection() { - ASSERT_IS_GPU_THREAD; -} +SessionConnection::~SessionConnection() = default; -void SessionConnection::OnSessionError() { - ASSERT_IS_GPU_THREAD; - // TODO: Not this. - FXL_CHECK(false) << "Session connection was terminated."; -} +void SessionConnection::OnSessionEvents(f1dl::Array events) { + using Type = ui::gfx::Event::Tag; -void SessionConnection::OnSessionEvents(fidl::VectorPtr events) { - gfx::Metrics* new_metrics; - for (auto& event : *events) { - if (event.is_gfx() && event.gfx().is_metrics() && - event.gfx().metrics().node_id == root_node_.id()) { - new_metrics = &event.gfx().metrics().metrics; + for (auto& raw_event : *events) { + if (!raw_event->is_gfx()) { + continue; } - } - if (!new_metrics) - return; - scene_update_context_.set_metrics(fidl::MakeOptional(std::move(*new_metrics))); - - if (metrics_changed_callback_) - metrics_changed_callback_(); + auto& event = raw_event->get_gfx(); + + switch (event->which()) { + case Type::METRICS: { + if (event->get_metrics()->node_id == root_node_.id()) { + auto& metrics = event->get_metrics()->metrics; + double device_pixel_ratio = metrics->scale_x; + scene_update_context_.set_metrics(std::move(metrics)); + if (metrics_changed_callback_) { + metrics_changed_callback_(device_pixel_ratio); + } + } + } break; + default: + break; + } + } } -void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, - fxl::Closure on_present_callback) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(pending_on_present_callback_ == nullptr); - FXL_DCHECK(on_present_callback != nullptr); - pending_on_present_callback_ = on_present_callback; - +void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { // Flush all session ops. Paint tasks have not yet executed but those are // fenced. The compositor can start processing ops while we finalize paint // tasks. - session_.Present(0, // presentation_time. Placeholder for now. - present_callback_ // callback + session_.Present(0, // presentation_time. (placeholder). + [](ui::PresentationInfoPtr) {} // callback ); // Execute paint tasks and signal fences. @@ -77,22 +74,15 @@ void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, // book-keeping on buffer caches. surface_producer_->OnSurfacesPresented(std::move(surfaces_to_submit)); - // Prepare for the next frame. - EnqueueClearCommands(); -} - -void SessionConnection::OnPresent(images::PresentationInfo info) { - ASSERT_IS_GPU_THREAD; - auto callback = pending_on_present_callback_; - pending_on_present_callback_ = nullptr; - callback(); + // Prepare for the next frame. These ops won't be processed till the next + // present. + EnqueueClearOps(); } -void SessionConnection::EnqueueClearCommands() { - ASSERT_IS_GPU_THREAD; +void SessionConnection::EnqueueClearOps() { // We are going to be sending down a fresh node hierarchy every frame. So just - // enqueue a detach command on the imported root node. + // enqueue a detach op on the imported root node. session_.Enqueue(scenic_lib::NewDetachChildrenCommand(root_node_.id())); } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index a80ba3a2235d2..e4f39d314c98f 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -2,70 +2,62 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ -#define FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ +#pragma once #include -#include "flutter/common/threads.h" -#include "flutter/content_handler/vulkan_surface_producer.h" #include "flutter/flow/compositor_context.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fidl/cpp/interface_handle.h" +#include "lib/fidl/cpp/bindings/interface_handle.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" +#include "vulkan_surface_producer.h" -namespace flutter_runner { +namespace flutter { -class SessionConnection { +using OnMetricsUpdate = std::function; + +// The component residing on the GPU thread that is responsible for +// maintaining the Scenic session connection and presenting node updates. +class SessionConnection final { public: - SessionConnection(ui::ScenicPtr scenic, zx::eventpair import_token); + SessionConnection(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback); ~SessionConnection(); bool has_metrics() const { return scene_update_context_.has_metrics(); } - const gfx::MetricsPtr& metrics() const { + const ui::gfx::MetricsPtr& metrics() const { return scene_update_context_.metrics(); } - void set_metrics_changed_callback(fxl::Closure callback) { - metrics_changed_callback_ = std::move(callback); - } - flow::SceneUpdateContext& scene_update_context() { return scene_update_context_; } - scenic_lib::ImportNode& root_node() { - ASSERT_IS_GPU_THREAD; - return root_node_; - } + scenic_lib::ImportNode& root_node() { return root_node_; } - void Present(flow::CompositorContext::ScopedFrame& frame, - fxl::Closure on_present_callback); + void Present(flow::CompositorContext::ScopedFrame& frame); private: + const std::string debug_label_; scenic_lib::Session session_; scenic_lib::ImportNode root_node_; - scenic_lib::Session::PresentCallback present_callback_; - fxl::Closure pending_on_present_callback_; std::unique_ptr surface_producer_; flow::SceneUpdateContext scene_update_context_; - fxl::Closure metrics_changed_callback_; - - void OnSessionError(); - void OnSessionEvents(fidl::VectorPtr events); + OnMetricsUpdate metrics_changed_callback_; - void EnqueueClearCommands(); + void OnSessionEvents(f1dl::Array events); - void OnPresent(images::PresentationInfo info); + void EnqueueClearOps(); FXL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); }; -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ +} // namespace flutter diff --git a/content_handler/surface.cc b/content_handler/surface.cc new file mode 100644 index 0000000000000..8efe1975fbfdb --- /dev/null +++ b/content_handler/surface.cc @@ -0,0 +1,73 @@ +// Copyright 2018 The Fuchsia 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 "surface.h" + +#include +#include +#include +#include + +#include "lib/fxl/files/unique_fd.h" + +namespace flutter { + +Surface::Surface(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback) + : shell::Surface(std::make_unique( + scenic, + debug_label, + std::move(import_token), + std::move(session_metrics_did_change_callback), + std::move(session_error_callback))), + debug_label_(debug_label) {} + +Surface::~Surface() = default; + +// |shell::Surface| +bool Surface::IsValid() { + return valid_; +} + +// |shell::Surface| +std::unique_ptr Surface::AcquireFrame( + const SkISize& size) { + return std::make_unique( + nullptr, [](const shell::SurfaceFrame& surface_frame, SkCanvas* canvas) { + return true; + }); +} + +// |shell::Surface| +GrContext* Surface::GetContext() { + return nullptr; +} + +static zx_status_t DriverWatcher(int dirfd, + int event, + const char* fn, + void* cookie) { + if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { + return ZX_ERR_STOP; + } + return ZX_OK; +} + +bool Surface::CanConnectToDisplay() { + constexpr char kDisplayDriverClass[] = "/dev/class/display"; + fxl::UniqueFD fd(open(kDisplayDriverClass, O_DIRECTORY | O_RDONLY)); + if (fd.get() < 0) { + FXL_DLOG(ERROR) << "Failed to open " << kDisplayDriverClass; + return false; + } + + zx_status_t status = fdio_watch_directory( + fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(1)), nullptr); + return status == ZX_ERR_STOP; +} + +} // namespace flutter diff --git a/content_handler/surface.h b/content_handler/surface.h new file mode 100644 index 0000000000000..4ad27aaf540f3 --- /dev/null +++ b/content_handler/surface.h @@ -0,0 +1,47 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "compositor_context.h" +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/shell/common/surface.h" +#include "lib/fxl/macros.h" + +namespace flutter { + +// The interface between the Flutter rasterizer and the underlying platform. May +// be constructed on any thread but will be used by the engine only on the GPU +// thread. +class Surface final : public shell::Surface { + public: + Surface(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback); + + ~Surface() override; + + private: + const bool valid_ = CanConnectToDisplay(); + const std::string debug_label_; + std::unique_ptr compositor_context_; + + // |shell::Surface| + bool IsValid() override; + + // |shell::Surface| + std::unique_ptr AcquireFrame( + const SkISize& size) override; + + // |shell::Surface| + GrContext* GetContext() override; + + static bool CanConnectToDisplay(); + + FXL_DISALLOW_COPY_AND_ASSIGN(Surface); +}; + +} // namespace flutter diff --git a/content_handler/task_observers.cc b/content_handler/task_observers.cc new file mode 100644 index 0000000000000..f23265e7b1653 --- /dev/null +++ b/content_handler/task_observers.cc @@ -0,0 +1,43 @@ +// Copyright 2018 The Fuchsia 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 "task_observers.h" + +#include + +#include "lib/fsl/tasks/message_loop.h" + +namespace flutter { + +thread_local std::map tTaskObservers; + +static void ExecuteAfterTaskObservers() { + for (const auto& callback : tTaskObservers) { + callback.second(); + } +} + +void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, + fxl::Closure observer) { + if (!observer) { + return; + } + + if (tTaskObservers.size() == 0) { + fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback( + std::bind(&ExecuteAfterTaskObservers)); + } + + tTaskObservers[key] = observer; +} + +void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key) { + tTaskObservers.erase(key); + + if (tTaskObservers.size() == 0) { + fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); + } +} + +} // namespace flutter diff --git a/content_handler/task_observers.h b/content_handler/task_observers.h new file mode 100644 index 0000000000000..53f6b96222000 --- /dev/null +++ b/content_handler/task_observers.h @@ -0,0 +1,16 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "lib/fxl/functional/closure.h" + +namespace flutter { + +void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, + fxl::Closure observer); + +void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key); + +} // namespace flutter diff --git a/content_handler/unique_fdio_ns.h b/content_handler/unique_fdio_ns.h new file mode 100644 index 0000000000000..726137d729f85 --- /dev/null +++ b/content_handler/unique_fdio_ns.h @@ -0,0 +1,34 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "fdio/namespace.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/memory/unique_object.h" + +namespace flutter { + +struct UniqueFDIONSTraits { + static fdio_ns_t* InvalidValue() { return nullptr; } + + static bool IsValid(fdio_ns_t* ns) { return ns != InvalidValue(); } + + static void Free(fdio_ns_t* ns) { + auto status = fdio_ns_destroy(ns); + FXL_DCHECK(status == ZX_OK); + } +}; + +using UniqueFDIONS = fxl::UniqueObject; + +inline UniqueFDIONS UniqueFDIONSCreate() { + fdio_ns_t* ns = nullptr; + if (fdio_ns_create(&ns) == ZX_OK) { + return UniqueFDIONS{ns}; + } + return UniqueFDIONS{nullptr}; +} + +} // namespace flutter diff --git a/content_handler/vulkan_rasterizer.cc b/content_handler/vulkan_rasterizer.cc deleted file mode 100644 index 25f90c460ce3f..0000000000000 --- a/content_handler/vulkan_rasterizer.cc +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/content_handler/vulkan_rasterizer.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/glue/trace_event.h" -#include "lib/fxl/files/unique_fd.h" - -namespace flutter_runner { - -constexpr char kGpuDriverClass[] = "/dev/class/gpu"; - -static zx_status_t DriverWatcher(int dirfd, - int event, - const char* fn, - void* cookie) { - if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { - return ZX_ERR_STOP; - } - return ZX_OK; -} - -bool WaitForFirstGpuDriver() { - fxl::UniqueFD fd(open(kGpuDriverClass, O_DIRECTORY | O_RDONLY)); - if (fd.get() < 0) { - FXL_DLOG(ERROR) << "Failed to open " << kGpuDriverClass; - return false; - } - - zx_status_t status = fdio_watch_directory( - fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(5)), nullptr); - return status == ZX_ERR_STOP; -} - -VulkanRasterizer::VulkanRasterizer() : compositor_context_(nullptr) { - valid_ = WaitForFirstGpuDriver(); -} - -VulkanRasterizer::~VulkanRasterizer() = default; - -bool VulkanRasterizer::IsValid() const { - return valid_; -} - -void VulkanRasterizer::SetScene(fidl::InterfaceHandle scenic, - zx::eventpair import_token, - fxl::Closure metrics_changed_callback) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(valid_ && !session_connection_); - session_connection_ = std::make_unique( - scenic.Bind(), std::move(import_token)); - session_connection_->set_metrics_changed_callback( - std::move(metrics_changed_callback)); -} - -void VulkanRasterizer::Draw(std::unique_ptr layer_tree, - fxl::Closure callback) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(callback != nullptr); - - if (layer_tree == nullptr) { - FXL_LOG(ERROR) << "Layer tree was not valid."; - callback(); - return; - } - - if (!session_connection_) { - FXL_LOG(ERROR) << "Session was not valid."; - callback(); - return; - } - - if (!session_connection_->has_metrics()) { - // Still awaiting metrics. Will redraw when we get them. - callback(); - return; - } - - compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); - - flow::CompositorContext::ScopedFrame frame = compositor_context_.AcquireFrame( - nullptr, nullptr, true /* instrumentation enabled */); - { - // Preroll the Flutter layer tree. This allows Flutter to perform pre-paint - // optimizations. - TRACE_EVENT0("flutter", "Preroll"); - layer_tree->Preroll(frame, session_connection_->metrics().get()); - } - - { - // Traverse the Flutter layer tree so that the necessary session ops to - // represent the frame are enqueued in the underlying session. - TRACE_EVENT0("flutter", "UpdateScene"); - layer_tree->UpdateScene(session_connection_->scene_update_context(), - session_connection_->root_node()); - } - - { - // Flush all pending session ops. - TRACE_EVENT0("flutter", "SessionPresent"); - session_connection_->Present( - frame, [callback = std::move(callback)]() { callback(); }); - } -} - -} // namespace flutter_runner diff --git a/content_handler/vulkan_rasterizer.h b/content_handler/vulkan_rasterizer.h deleted file mode 100644 index c3ae211553f5a..0000000000000 --- a/content_handler/vulkan_rasterizer.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ -#define FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ - -#include - -#include "flutter/content_handler/rasterizer.h" -#include "flutter/content_handler/session_connection.h" -#include "flutter/flow/compositor_context.h" -#include "lib/fxl/macros.h" - -namespace flutter_runner { - -class VulkanRasterizer : public Rasterizer { - public: - VulkanRasterizer(); - - ~VulkanRasterizer() override; - - bool IsValid() const; - - void SetScene(fidl::InterfaceHandle scenic, - zx::eventpair import_token, - fxl::Closure metrics_changed_callback) override; - - void Draw(std::unique_ptr layer_tree, - fxl::Closure callback) override; - - private: - flow::CompositorContext compositor_context_; - std::unique_ptr session_connection_; - bool valid_; - - FXL_DISALLOW_COPY_AND_ASSIGN(VulkanRasterizer); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 6d5df488542fe..b6ad80fba4deb 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "vulkan_surface.h" + #include -#include "flutter/content_handler/vulkan_surface.h" -#include "flutter/common/threads.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter_runner { +namespace flutter { VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -22,8 +22,6 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, backend_context_(std::move(backend_context)), session_(session), wait_(this) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(session_); zx::vmo exported_vmo; @@ -55,7 +53,6 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, } VulkanSurface::~VulkanSurface() { - ASSERT_IS_GPU_THREAD; if (async_) { wait_.Cancel(async_); wait_.set_object(ZX_HANDLE_INVALID); @@ -325,7 +322,6 @@ bool VulkanSurface::PushSessionImageSetupOps(scenic_lib::Session* session, } scenic_lib::Image* VulkanSurface::GetImage() { - ASSERT_IS_GPU_THREAD; if (!valid_) { return 0; } @@ -333,7 +329,6 @@ scenic_lib::Image* VulkanSurface::GetImage() { } sk_sp VulkanSurface::GetSkiaSurface() const { - ASSERT_IS_GPU_THREAD; return valid_ ? sk_surface_ : nullptr; } @@ -358,7 +353,6 @@ bool VulkanSurface::FlushSessionAcquireAndReleaseEvents() { void VulkanSurface::SignalWritesFinished( std::function on_writes_committed) { - ASSERT_IS_GPU_THREAD; FXL_DCHECK(on_writes_committed); if (!valid_) { @@ -374,8 +368,6 @@ void VulkanSurface::SignalWritesFinished( } void VulkanSurface::Reset() { - ASSERT_IS_GPU_THREAD; - if (acquire_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK || release_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK) { valid_ = false; @@ -410,10 +402,10 @@ void VulkanSurface::Reset() { } } -async_wait_result_t VulkanSurface::OnHandleReady(async_t* async, - zx_status_t status, - const zx_packet_signal_t* signal) { - ASSERT_IS_GPU_THREAD; +async_wait_result_t VulkanSurface::OnHandleReady( + async_t* async, + zx_status_t status, + const zx_packet_signal_t* signal) { if (status != ZX_OK) return ASYNC_WAIT_FINISHED; FXL_DCHECK(signal->observed & ZX_EVENT_SIGNALED); @@ -421,4 +413,4 @@ async_wait_result_t VulkanSurface::OnHandleReady(async_t* async, return ASYNC_WAIT_AGAIN; } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface.h b/content_handler/vulkan_surface.h index 41a807af81f9c..7add6b05bb8cc 100644 --- a/content_handler/vulkan_surface.h +++ b/content_handler/vulkan_surface.h @@ -20,9 +20,10 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -namespace flutter_runner { +namespace flutter { -class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { +class VulkanSurface final + : public flow::SceneUpdateContext::SurfaceProducerSurface { public: VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -32,12 +33,16 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { ~VulkanSurface() override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| size_t AdvanceAndGetAge() override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| bool FlushSessionAcquireAndReleaseEvents() override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| bool IsValid() const override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| SkISize GetSize() const override; // Note: It is safe for the caller to collect the surface in the @@ -115,4 +120,4 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); }; -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_pool.cc b/content_handler/vulkan_surface_pool.cc index af23ef711b7ad..93d14c2ddbff7 100644 --- a/content_handler/vulkan_surface_pool.cc +++ b/content_handler/vulkan_surface_pool.cc @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "vulkan_surface_pool.h" + #include -#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter_runner { +namespace flutter { VulkanSurfacePool::VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -177,4 +178,4 @@ void VulkanSurfacePool::TraceStats() { trace_surfaces_reused_ = 0; } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_pool.h b/content_handler/vulkan_surface_pool.h index 52dd3ed6aa417..4900816762910 100644 --- a/content_handler/vulkan_surface_pool.h +++ b/content_handler/vulkan_surface_pool.h @@ -6,12 +6,13 @@ #include #include -#include "flutter/content_handler/vulkan_surface.h" + #include "lib/fxl/macros.h" +#include "vulkan_surface.h" -namespace flutter_runner { +namespace flutter { -class VulkanSurfacePool { +class VulkanSurfacePool final { public: static const size_t kMaxSurfacesOfSameSize = 3; static const size_t kMaxSurfaceAge = 3; @@ -74,4 +75,4 @@ class VulkanSurfacePool { FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfacePool); }; -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index 6f605c109b7df..ff8a9ab9d1f4a 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -2,17 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/content_handler/vulkan_surface_producer.h" +#include "vulkan_surface_producer.h" #include #include #include + #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" -namespace flutter_runner { +namespace flutter { VulkanSurfaceProducer::VulkanSurfaceProducer( scenic_lib::Session* mozart_session) { @@ -42,7 +43,7 @@ bool VulkanSurfaceProducer::Initialize(scenic_lib::Session* mozart_session) { VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, }; application_ = std::make_unique( - *vk_, "FlutterContentHandler", std::move(extensions)); + *vk_, "FlutterApplicationRunner", std::move(extensions)); if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) { // Make certain the application instance was created and it setup the @@ -200,4 +201,4 @@ void VulkanSurfaceProducer::SubmitSurface( surface_pool_->SubmitSurface(std::move(surface)); } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_producer.h b/content_handler/vulkan_surface_producer.h index 2338a8a6ba709..15c4419e8cde7 100644 --- a/content_handler/vulkan_surface_producer.h +++ b/content_handler/vulkan_surface_producer.h @@ -2,11 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ -#define FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +#pragma once -#include "flutter/content_handler/vulkan_surface.h" -#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/flow/scene_update_context.h" #include "flutter/vulkan/vulkan_application.h" #include "flutter/vulkan/vulkan_device.h" @@ -17,11 +14,14 @@ #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" +#include "vulkan_surface.h" +#include "vulkan_surface_pool.h" -namespace flutter_runner { +namespace flutter { -class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer, - public vulkan::VulkanProvider { +class VulkanSurfaceProducer final + : public flow::SceneUpdateContext::SurfaceProducer, + public vulkan::VulkanProvider { public: VulkanSurfaceProducer(scenic_lib::Session* mozart_session); @@ -74,6 +74,4 @@ class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer, FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfaceProducer); }; -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +} // namespace flutter diff --git a/flow/BUILD.gn b/flow/BUILD.gn index e6a6411a6c1da..07c5d4e5d4e7b 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -48,11 +48,12 @@ source_set("flow") { "matrix_decomposition.h", "paint_utils.cc", "paint_utils.h", - "process_info.h", "raster_cache.cc", "raster_cache.h", "raster_cache_key.cc", "raster_cache_key.h", + "skia_gpu_object.cc", + "skia_gpu_object.h", "texture.cc", "texture.h", ] @@ -61,12 +62,11 @@ source_set("flow") { "//garnet/public/lib/fxl", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] deps = [ "$flutter_root/common", + "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/synchronization", "//third_party/skia", @@ -103,8 +103,8 @@ executable("flow_unittests") { deps = [ ":flow", - "//third_party/dart/runtime:libdart_jit", # for tracing "$flutter_root/testing", + "//third_party/dart/runtime:libdart_jit", # for tracing "//third_party/skia", ] } diff --git a/flow/compositor_context.cc b/flow/compositor_context.cc index e0d17229e7981..53659103be9f1 100644 --- a/flow/compositor_context.cc +++ b/flow/compositor_context.cc @@ -4,12 +4,12 @@ #include "flutter/flow/compositor_context.h" +#include "flutter/flow/layers/layer_tree.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { -CompositorContext::CompositorContext(std::unique_ptr info) - : process_info_(std::move(info)) {} +CompositorContext::CompositorContext() = default; CompositorContext::~CompositorContext() = default; @@ -18,10 +18,6 @@ void CompositorContext::BeginFrame(ScopedFrame& frame, if (enable_instrumentation) { frame_count_.Increment(); frame_time_.Start(); - - if (process_info_ && process_info_->SampleNow()) { - memory_usage_.Add(process_info_->GetResidentMemorySize()); - } } } @@ -33,11 +29,12 @@ void CompositorContext::EndFrame(ScopedFrame& frame, } } -CompositorContext::ScopedFrame CompositorContext::AcquireFrame( +std::unique_ptr CompositorContext::AcquireFrame( GrContext* gr_context, SkCanvas* canvas, bool instrumentation_enabled) { - return ScopedFrame(*this, gr_context, canvas, instrumentation_enabled); + return std::make_unique(*this, gr_context, canvas, + instrumentation_enabled); } CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, @@ -51,18 +48,23 @@ CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, context_.BeginFrame(*this, instrumentation_enabled_); } -CompositorContext::ScopedFrame::ScopedFrame(ScopedFrame&& frame) = default; - CompositorContext::ScopedFrame::~ScopedFrame() { context_.EndFrame(*this, instrumentation_enabled_); } +bool CompositorContext::ScopedFrame::Raster(flow::LayerTree& layer_tree, + bool ignore_raster_cache) { + layer_tree.Preroll(*this, ignore_raster_cache); + layer_tree.Paint(*this); + return true; +} + void CompositorContext::OnGrContextCreated() { - texture_registry_->OnGrContextCreated(); + texture_registry_.OnGrContextCreated(); } void CompositorContext::OnGrContextDestroyed() { - texture_registry_->OnGrContextDestroyed(); + texture_registry_.OnGrContextDestroyed(); raster_cache_.Clear(); } diff --git a/flow/compositor_context.h b/flow/compositor_context.h index 2d310422747b7..14c2449dbecd0 100644 --- a/flow/compositor_context.h +++ b/flow/compositor_context.h @@ -9,7 +9,6 @@ #include #include "flutter/flow/instrumentation.h" -#include "flutter/flow/process_info.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" #include "lib/fxl/macros.h" @@ -18,19 +17,26 @@ namespace flow { +class LayerTree; + class CompositorContext { public: class ScopedFrame { public: + ScopedFrame(CompositorContext& context, + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled); + + virtual ~ScopedFrame(); + SkCanvas* canvas() { return canvas_; } CompositorContext& context() const { return context_; } GrContext* gr_context() const { return gr_context_; } - ScopedFrame(ScopedFrame&& frame); - - ~ScopedFrame(); + virtual bool Raster(LayerTree& layer_tree, bool ignore_raster_cache); private: CompositorContext& context_; @@ -38,23 +44,17 @@ class CompositorContext { SkCanvas* canvas_; const bool instrumentation_enabled_; - ScopedFrame(CompositorContext& context, - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled); - - friend class CompositorContext; - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); }; - CompositorContext(std::unique_ptr info); + CompositorContext(); - ~CompositorContext(); + virtual ~CompositorContext(); - ScopedFrame AcquireFrame(GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled = true); + virtual std::unique_ptr AcquireFrame( + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled); void OnGrContextCreated(); @@ -62,7 +62,7 @@ class CompositorContext { RasterCache& raster_cache() { return raster_cache_; } - TextureRegistry& texture_registry() { return *texture_registry_; } + TextureRegistry& texture_registry() { return texture_registry_; } const Counter& frame_count() const { return frame_count_; } @@ -70,20 +70,12 @@ class CompositorContext { Stopwatch& engine_time() { return engine_time_; } - const CounterValues& memory_usage() const { return memory_usage_; } - - void SetTextureRegistry(TextureRegistry* textureRegistry) { - texture_registry_ = textureRegistry; - } - private: RasterCache raster_cache_; - TextureRegistry* texture_registry_; - std::unique_ptr process_info_; + TextureRegistry texture_registry_; Counter frame_count_; Stopwatch frame_time_; Stopwatch engine_time_; - CounterValues memory_usage_; void BeginFrame(ScopedFrame& frame, bool enable_instrumentation); diff --git a/flow/debug_print.cc b/flow/debug_print.cc index 0aa5b4b3b7d2d..3311b9c2b43e3 100644 --- a/flow/debug_print.cc +++ b/flow/debug_print.cc @@ -80,3 +80,8 @@ std::ostream& operator<<(std::ostream& os, const flow::RasterCacheKey& k) { ; return os; } + +std::ostream& operator<<(std::ostream& os, const SkISize& size) { + os << size.width() << ", " << size.height(); + return os; +} diff --git a/flow/debug_print.h b/flow/debug_print.h index ca5973eeb0977..78a28fe38562d 100644 --- a/flow/debug_print.h +++ b/flow/debug_print.h @@ -15,14 +15,15 @@ #define DEF_PRINTER(x) std::ostream& operator<<(std::ostream&, const x&); -DEF_PRINTER(flow::RasterCacheKey); DEF_PRINTER(flow::MatrixDecomposition); +DEF_PRINTER(flow::RasterCacheKey); +DEF_PRINTER(SkISize); DEF_PRINTER(SkMatrix); DEF_PRINTER(SkMatrix44); -DEF_PRINTER(SkVector3); -DEF_PRINTER(SkVector4); +DEF_PRINTER(SkPoint); DEF_PRINTER(SkRect); DEF_PRINTER(SkRRect); -DEF_PRINTER(SkPoint); +DEF_PRINTER(SkVector3); +DEF_PRINTER(SkVector4); #endif // FLUTTER_FLOW_DEBUG_PRINT_H_ diff --git a/flow/export_node.cc b/flow/export_node.cc index a130c426a75bf..27ab34030ca42 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -4,28 +4,27 @@ #include "flutter/flow/export_node.h" -#include "flutter/common/threads.h" #include "lib/fxl/functional/make_copyable.h" namespace flow { ExportNodeHolder::ExportNodeHolder( + fxl::RefPtr gpu_task_runner, fxl::RefPtr export_token_handle) - : export_node_(std::make_unique(export_token_handle)) { - ASSERT_IS_UI_THREAD; + : gpu_task_runner_(std::move(gpu_task_runner)), + export_node_(std::make_unique(export_token_handle)) { + FXL_DCHECK(gpu_task_runner_); } void ExportNodeHolder::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { - ASSERT_IS_GPU_THREAD; export_node_->Bind(context, container, offset, hit_testable); } ExportNodeHolder::~ExportNodeHolder() { - ASSERT_IS_UI_THREAD; - blink::Threads::Gpu()->PostTask( + gpu_task_runner_->PostTask( fxl::MakeCopyable([export_node = std::move(export_node_)]() { export_node->Dispose(true); })); @@ -44,8 +43,6 @@ void ExportNode::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { - ASSERT_IS_GPU_THREAD; - if (export_token_) { // Happens first time we bind. node_.reset(new scenic_lib::EntityNode(container.session())); @@ -67,8 +64,6 @@ void ExportNode::Bind(SceneUpdateContext& context, } void ExportNode::Dispose(bool remove_from_scene_update_context) { - ASSERT_IS_GPU_THREAD; - // If scene_update_context_ is set, then we should still have a node left to // dereference. // If scene_update_context_ is null, then either: diff --git a/flow/export_node.h b/flow/export_node.h index 24f94fcebf20f..e6a11175e561e 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -15,6 +15,7 @@ #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/ui/scenic/client/resources.h" +#include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" namespace flow { @@ -24,7 +25,8 @@ namespace flow { // held by the ExportNode. class ExportNodeHolder : public fxl::RefCountedThreadSafe { public: - ExportNodeHolder(fxl::RefPtr export_token_handle); + ExportNodeHolder(fxl::RefPtr gpu_task_runner, + fxl::RefPtr export_token_handle); ~ExportNodeHolder(); // Calls Bind() on the wrapped ExportNode. @@ -36,6 +38,7 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { ExportNode* export_node() { return export_node_.get(); } private: + fxl::RefPtr gpu_task_runner_; std::unique_ptr export_node_; FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index a33b0eaa681b7..ca228a7d58f76 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -137,20 +137,20 @@ void DefaultLayerBuilder::PushPerformanceOverlay(uint64_t enabled_options, } void DefaultLayerBuilder::PushPicture(const SkPoint& offset, - sk_sp picture, + SkiaGPUObject picture, bool picture_is_complex, bool picture_will_change) { if (!current_layer_) { return; } - SkRect pictureRect = picture->cullRect(); + SkRect pictureRect = picture.get()->cullRect(); pictureRect.offset(offset.x(), offset.y()); if (!SkRect::Intersects(pictureRect, cull_rects_.top())) { return; } auto layer = std::make_unique(); layer->set_offset(offset); - layer->set_picture(picture); + layer->set_picture(std::move(picture)); layer->set_is_complex(picture_is_complex); layer->set_will_change(picture_will_change); current_layer_->Add(std::move(layer)); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index a62ec46714d21..cadd173ab5a84 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -59,7 +59,7 @@ class DefaultLayerBuilder final : public LayerBuilder { // |flow::LayerBuilder| void PushPicture(const SkPoint& offset, - sk_sp picture, + SkiaGPUObject picture, bool picture_is_complex, bool picture_will_change) override; diff --git a/flow/layers/layer.h b/flow/layers/layer.h index d0ef1990ab4f2..cf7ad71c36fae 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -44,9 +44,6 @@ class Layer { virtual ~Layer(); struct PrerollContext { -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics = nullptr; -#endif RasterCache* raster_cache; GrContext* gr_context; SkColorSpace* dst_color_space; @@ -59,7 +56,6 @@ class Layer { SkCanvas& canvas; const Stopwatch& frame_time; const Stopwatch& engine_time; - const CounterValues& memory_usage; TextureRegistry& texture_registry; const bool checkerboard_offscreen_layers; }; diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index 91ae13974a23b..a29e959514428 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -8,6 +8,7 @@ #include #include "flutter/flow/layers/layer.h" +#include "flutter/flow/skia_gpu_object.h" #include "garnet/public/lib/fxl/macros.h" #include "third_party/skia/include/core/SkBlendMode.h" #include "third_party/skia/include/core/SkColor.h" @@ -57,7 +58,7 @@ class LayerBuilder { const SkRect& rect) = 0; virtual void PushPicture(const SkPoint& offset, - sk_sp picture, + SkiaGPUObject picture, bool picture_is_complex, bool picture_will_change) = 0; diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index fde2fc4bf0866..d9fb374194688 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -17,43 +17,18 @@ LayerTree::LayerTree() LayerTree::~LayerTree() = default; -void LayerTree::Raster(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif - bool ignore_raster_cache) { -#if defined(OS_FUCHSIA) - FXL_DCHECK(metrics); -#endif - Preroll(frame, -#if defined(OS_FUCHSIA) - metrics, -#endif - ignore_raster_cache); - Paint(frame); -} - void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool ignore_raster_cache) { -#if defined(OS_FUCHSIA) - FXL_DCHECK(metrics); -#endif TRACE_EVENT0("flutter", "LayerTree::Preroll"); SkColorSpace* color_space = frame.canvas() ? frame.canvas()->imageInfo().colorSpace() : nullptr; frame.context().raster_cache().SetCheckboardCacheImages( checkerboard_raster_cache_images_); Layer::PrerollContext context = { -#if defined(OS_FUCHSIA) - metrics, -#endif - ignore_raster_cache ? nullptr : &frame.context().raster_cache(), - frame.gr_context(), - color_space, - SkRect::MakeEmpty(), + ignore_raster_cache ? nullptr : &frame.context().raster_cache(), + frame.gr_context(), + color_space, + SkRect::MakeEmpty(), }; root_layer_->Preroll(&context, SkMatrix::I()); @@ -63,9 +38,12 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, void LayerTree::UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container) { TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); - - SceneUpdateContext::Transform transform(context, 1.f / device_pixel_ratio_, - 1.f / device_pixel_ratio_, 1.f); + const auto& metrics = context.metrics(); + SceneUpdateContext::Transform transform(context, // context + 1.0f / metrics->scale_x, // X + 1.0f / metrics->scale_y, // Y + 1.0f / metrics->scale_z // Z + ); SceneUpdateContext::Frame frame( context, SkRRect::MakeRect( @@ -82,12 +60,13 @@ void LayerTree::UpdateScene(SceneUpdateContext& context, #endif void LayerTree::Paint(CompositorContext::ScopedFrame& frame) const { - Layer::PaintContext context = {*frame.canvas(), - frame.context().frame_time(), - frame.context().engine_time(), - frame.context().memory_usage(), - frame.context().texture_registry(), - checkerboard_offscreen_layers_}; + Layer::PaintContext context = { + *frame.canvas(), // + frame.context().frame_time(), // + frame.context().engine_time(), // + frame.context().texture_registry(), // + checkerboard_offscreen_layers_ // + }; TRACE_EVENT0("flutter", "LayerTree::Paint"); if (root_layer_->needs_painting()) diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 5ddebd088de9e..25a8e072cfa21 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -13,9 +13,6 @@ #include "flutter/flow/layers/layer.h" #include "lib/fxl/macros.h" #include "lib/fxl/time/time_delta.h" -#if defined(OS_FUCHSIA) -#include -#endif #include "third_party/skia/include/core/SkSize.h" namespace flow { @@ -26,24 +23,10 @@ class LayerTree { ~LayerTree(); - // Raster includes both Preroll and Paint. - void Raster(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif - bool ignore_raster_cache = false); - void Preroll(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool ignore_raster_cache = false); #if defined(OS_FUCHSIA) - void set_device_pixel_ratio(float device_pixel_ratio) { - device_pixel_ratio_ = device_pixel_ratio; - } - void UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container); #endif @@ -93,10 +76,6 @@ class LayerTree { bool checkerboard_raster_cache_images_; bool checkerboard_offscreen_layers_; -#if defined(OS_FUCHSIA) - float device_pixel_ratio_ = 1.f; -#endif - FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree); }; diff --git a/flow/layers/performance_overlay_layer.cc b/flow/layers/performance_overlay_layer.cc index cc55500115a08..7d871af33b94f 100644 --- a/flow/layers/performance_overlay_layer.cc +++ b/flow/layers/performance_overlay_layer.cc @@ -57,34 +57,6 @@ void VisualizeStopWatch(SkCanvas& canvas, } } -void VisualizeCounterValuesBytes(SkCanvas& canvas, - const CounterValues& counter_values, - SkScalar x, - SkScalar y, - SkScalar width, - SkScalar height, - bool show_graph, - bool show_labels, - const std::string& label_prefix) { - 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); - counter_values.Visualize(canvas, visualization_rect); - } - - auto current_usage = counter_values.GetCurrentValue(); - - if (show_labels && current_usage > 0) { - std::stringstream stream; - stream.setf(std::ios::fixed | std::ios::showpoint); - stream << std::setprecision(2); - stream << label_prefix << " " << current_usage * 1e-6 << " MB"; - DrawStatisticsText(canvas, stream.str(), x + label_x, y + height + label_y); - } -} - } // namespace PerformanceOverlayLayer::PerformanceOverlayLayer(uint64_t options) @@ -111,11 +83,6 @@ void PerformanceOverlayLayer::Paint(PaintContext& context) const { VisualizeStopWatch(context.canvas, context.engine_time, x, y + height, width, height - padding, options_ & kVisualizeEngineStatistics, options_ & kDisplayEngineStatistics, "UI"); - - VisualizeCounterValuesBytes( - context.canvas, context.memory_usage, x, y + (2 * height), width, - height - padding, options_ & kVisualizeMemoryStatistics, - options_ & kDisplayMemoryStatistics, "Memory (Resident)"); } } // namespace flow diff --git a/flow/layers/performance_overlay_layer.h b/flow/layers/performance_overlay_layer.h index e7c3ac530a02a..77448107147a4 100644 --- a/flow/layers/performance_overlay_layer.h +++ b/flow/layers/performance_overlay_layer.h @@ -14,8 +14,6 @@ const int kDisplayRasterizerStatistics = 1 << 0; const int kVisualizeRasterizerStatistics = 1 << 1; const int kDisplayEngineStatistics = 1 << 2; const int kVisualizeEngineStatistics = 1 << 3; -const int kDisplayMemoryStatistics = 1 << 4; -const int kVisualizeMemoryStatistics = 1 << 5; class PerformanceOverlayLayer : public Layer { public: diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index 4a99d7d07f75e..552ca0443bd80 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -4,39 +4,30 @@ #include "flutter/flow/layers/picture_layer.h" -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace flow { PictureLayer::PictureLayer() = default; -PictureLayer::~PictureLayer() { - // The picture may contain references to textures that are associated - // with the IO thread's context. - SkPicture* picture = picture_.release(); - if (picture) { - blink::Threads::IO()->PostTask([picture]() { picture->unref(); }); - } -} +PictureLayer::~PictureLayer() = default; void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { + SkPicture* sk_picture = picture(); + if (auto cache = context->raster_cache) { raster_cache_result_ = cache->GetPrerolledImage( - context->gr_context, picture_.get(), matrix, context->dst_color_space, -#if defined(OS_FUCHSIA) - context->metrics, -#endif + context->gr_context, sk_picture, matrix, context->dst_color_space, is_complex_, will_change_); } - SkRect bounds = picture_->cullRect().makeOffset(offset_.x(), offset_.y()); + SkRect bounds = sk_picture->cullRect().makeOffset(offset_.x(), offset_.y()); set_paint_bounds(bounds); } void PictureLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PictureLayer::Paint"); - FXL_DCHECK(picture_); + FXL_DCHECK(picture_.get()); FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); @@ -53,7 +44,7 @@ void PictureLayer::Paint(PaintContext& context) const { SkCanvas::kStrict_SrcRectConstraint // source constraint ); } else { - context.canvas.drawPicture(picture_.get()); + context.canvas.drawPicture(picture()); } } diff --git a/flow/layers/picture_layer.h b/flow/layers/picture_layer.h index 191ef9d7097a2..c67929b7cb455 100644 --- a/flow/layers/picture_layer.h +++ b/flow/layers/picture_layer.h @@ -5,8 +5,11 @@ #ifndef FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ #define FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ +#include + #include "flutter/flow/layers/layer.h" #include "flutter/flow/raster_cache.h" +#include "flutter/flow/skia_gpu_object.h" namespace flow { @@ -16,12 +19,14 @@ class PictureLayer : public Layer { ~PictureLayer() override; void set_offset(const SkPoint& offset) { offset_ = offset; } - void set_picture(sk_sp picture) { picture_ = std::move(picture); } + void set_picture(SkiaGPUObject picture) { + picture_ = std::move(picture); + } void set_is_complex(bool value) { is_complex_ = value; } void set_will_change(bool value) { will_change_ = value; } - SkPicture* picture() const { return picture_.get(); } + SkPicture* picture() const { return picture_.get().get(); } void Preroll(PrerollContext* frame, const SkMatrix& matrix) override; @@ -29,7 +34,9 @@ class PictureLayer : public Layer { private: SkPoint offset_; - sk_sp picture_; + // Even though pictures themselves are not GPU resources, they may reference + // images that have a reference to a GPU resource. + SkiaGPUObject picture_; bool is_complex_ = false; bool will_change_ = false; RasterCacheResult raster_cache_result_; diff --git a/flow/process_info.h b/flow/process_info.h deleted file mode 100644 index 6623fe7257396..0000000000000 --- a/flow/process_info.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_FLOW_PROCESS_INFO_H_ -#define FLUTTER_FLOW_PROCESS_INFO_H_ - -#include "lib/fxl/macros.h" - -namespace flow { - -/// The CompositorContext attempts to collect information from the process for -/// instrumentation purposes. The compositor does not have the platform -/// specific capabilities to collect this information on its own. The platform -/// can choose to provide this information however. -class ProcessInfo { - public: - virtual ~ProcessInfo() = default; - - virtual bool SampleNow() = 0; - - /// Virtual memory size in bytes. - virtual size_t GetVirtualMemorySize() = 0; - - /// Resident memory size in bytes. - virtual size_t GetResidentMemorySize() = 0; -}; - -} // namespace flow - -#endif // FLUTTER_FLOW_PROCESS_INFO_H_ diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index aa9fad0e281de..11a86729b489b 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -6,7 +6,6 @@ #include -#include "flutter/common/threads.h" #include "flutter/flow/paint_utils.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @@ -73,9 +72,6 @@ RasterCacheResult RasterizePicture(SkPicture* picture, GrContext* context, const MatrixDecomposition& matrix, SkColorSpace* dst_color_space, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool checkerboard) { TRACE_EVENT0("flutter", "RasterCachePopulate"); @@ -83,17 +79,9 @@ RasterCacheResult RasterizePicture(SkPicture* picture, const SkRect logical_rect = picture->cullRect(); -#if defined(OS_FUCHSIA) - float metrics_scale_x = metrics->scale_x; - float metrics_scale_y = metrics->scale_y; -#else - float metrics_scale_x = 1.f; - float metrics_scale_y = 1.f; -#endif - - const SkRect physical_rect = SkRect::MakeWH( - std::fabs(logical_rect.width() * metrics_scale_x * scale.x()), - std::fabs(logical_rect.height() * metrics_scale_y * scale.y())); + const SkRect physical_rect = + SkRect::MakeWH(std::fabs(logical_rect.width() * scale.x()), + std::fabs(logical_rect.height() * scale.y())); const SkImageInfo image_info = SkImageInfo::MakeN32Premul( std::ceil(physical_rect.width()), // physical width @@ -120,8 +108,7 @@ RasterCacheResult RasterizePicture(SkPicture* picture, } canvas->clear(SK_ColorTRANSPARENT); - canvas->scale(std::abs(scale.x() * metrics_scale_x), - std::abs(scale.y() * metrics_scale_y)); + canvas->scale(std::abs(scale.x()), std::abs(scale.y())); canvas->translate(-logical_rect.left(), -logical_rect.top()); canvas->drawPicture(picture); @@ -153,9 +140,6 @@ RasterCacheResult RasterCache::GetPrerolledImage( SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool is_complex, bool will_change) { if (!IsPictureWorthRasterizing(picture, will_change, is_complex)) { @@ -172,11 +156,7 @@ RasterCacheResult RasterCache::GetPrerolledImage( return {}; } - RasterCacheKey cache_key(*picture, -#if defined(OS_FUCHSIA) - metrics->scale_x, metrics->scale_y, -#endif - matrix); + RasterCacheKey cache_key(*picture, matrix); Entry& entry = cache_[cache_key]; entry.access_count = ClampSize(entry.access_count + 1, 0, threshold_); @@ -189,9 +169,6 @@ RasterCacheResult RasterCache::GetPrerolledImage( if (!entry.image.is_valid()) { entry.image = RasterizePicture(picture, context, matrix, dst_color_space, -#if defined(OS_FUCHSIA) - metrics, -#endif checkerboard_images_); } diff --git a/flow/raster_cache.h b/flow/raster_cache.h index 31201049b6119..3278eb355b030 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -12,9 +12,6 @@ #include "flutter/flow/raster_cache_key.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" -#if defined(OS_FUCHSIA) -#include -#endif #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -57,9 +54,6 @@ class RasterCache { SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool is_complex, bool will_change); diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index 83df52658c981..1f28ea5320d36 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -15,30 +15,15 @@ namespace flow { class RasterCacheKey { public: - RasterCacheKey(const SkPicture& picture, -#if defined(OS_FUCHSIA) - float metrics_scale_x, - float metrics_scale_y, -#endif - const MatrixDecomposition& matrix) + RasterCacheKey(const SkPicture& picture, const MatrixDecomposition& matrix) : picture_id_(picture.uniqueID()), -#if defined(OS_FUCHSIA) - metrics_scale_x_(metrics_scale_x), - metrics_scale_y_(metrics_scale_y), -#endif - scale_key_( - SkISize::Make(matrix.scale().x() * 1e3, matrix.scale().y() * 1e3)) { - } + scale_key_(SkISize::Make(matrix.scale().x() * 1e3, + matrix.scale().y() * 1e3)) {} uint32_t picture_id() const { return picture_id_; } const SkISize& scale_key() const { return scale_key_; } -#if defined(OS_FUCHSIA) - float metrics_scale_x() const { return metrics_scale_x_; } - float metrics_scale_y() const { return metrics_scale_y_; } -#endif - struct Hash { std::size_t operator()(RasterCacheKey const& key) const { return key.picture_id_; @@ -49,11 +34,6 @@ class RasterCacheKey { constexpr bool operator()(const RasterCacheKey& lhs, const RasterCacheKey& rhs) const { return lhs.picture_id_ == rhs.picture_id_ && -#if defined(OS_FUCHSIA) - lhs.metrics_scale_x_ == rhs.metrics_scale_x_ && - - lhs.metrics_scale_y_ == rhs.metrics_scale_y_ && -#endif lhs.scale_key_ == rhs.scale_key_; } }; @@ -63,10 +43,6 @@ class RasterCacheKey { private: uint32_t picture_id_; -#if defined(OS_FUCHSIA) - float metrics_scale_x_; - float metrics_scale_y_; -#endif SkISize scale_key_; }; diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index 83883c508b4df..b9d6801cc82ee 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -4,7 +4,6 @@ #include "flutter/flow/scene_update_context.h" -#include "flutter/common/threads.h" #include "flutter/flow/export_node.h" #include "flutter/flow/layers/layer.h" #include "flutter/flow/matrix_decomposition.h" @@ -19,9 +18,7 @@ SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session, } SceneUpdateContext::~SceneUpdateContext() { - ASSERT_IS_GPU_THREAD; - - // Release Scenic session resources for all ExportNodes. + // Release Mozart session resources for all ExportNodes. for (auto export_node : export_nodes_) { export_node->Dispose(false); } @@ -30,21 +27,16 @@ SceneUpdateContext::~SceneUpdateContext() { void SceneUpdateContext::AddChildScene(ExportNode* export_node, SkPoint offset, bool hit_testable) { - ASSERT_IS_GPU_THREAD; FXL_DCHECK(top_entity_); export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable); } void SceneUpdateContext::AddExportNode(ExportNode* export_node) { - ASSERT_IS_GPU_THREAD; - export_nodes_.insert(export_node); // Might already have been added. } void SceneUpdateContext::RemoveExportNode(ExportNode* export_node) { - ASSERT_IS_GPU_THREAD; - export_nodes_.erase(export_node); } @@ -195,12 +187,9 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { for (auto& task : paint_tasks_) { FXL_DCHECK(task.surface); SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas(); - Layer::PaintContext context = {*canvas, - frame.context().frame_time(), + Layer::PaintContext context = {*canvas, frame.context().frame_time(), frame.context().engine_time(), - frame.context().memory_usage(), - frame.context().texture_registry(), - false}; + frame.context().texture_registry(), false}; canvas->restoreToCount(1); canvas->save(); canvas->clear(task.background_color); diff --git a/flow/skia_gpu_object.cc b/flow/skia_gpu_object.cc new file mode 100644 index 0000000000000..ce2312f921580 --- /dev/null +++ b/flow/skia_gpu_object.cc @@ -0,0 +1,44 @@ +// Copyright 2017 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/skia_gpu_object.h" + +#include "flutter/fml/message_loop.h" + +namespace flow { + +SkiaUnrefQueue::SkiaUnrefQueue(fxl::RefPtr task_runner, + fxl::TimeDelta delay) + : task_runner_(std::move(task_runner)), + drain_delay_(delay), + drain_pending_(false) {} + +SkiaUnrefQueue::~SkiaUnrefQueue() { + Drain(); +} + +void SkiaUnrefQueue::Unref(SkRefCnt* object) { + std::lock_guard lock(mutex_); + objects_.push_back(object); + if (!drain_pending_) { + drain_pending_ = true; + task_runner_->PostDelayedTask( + [strong = fxl::Ref(this)]() { strong->Drain(); }, drain_delay_); + } +} + +void SkiaUnrefQueue::Drain() { + std::deque skia_objects; + { + std::lock_guard lock(mutex_); + objects_.swap(skia_objects); + drain_pending_ = false; + } + + for (SkRefCnt* skia_object : skia_objects) { + skia_object->unref(); + } +} + +} // namespace flow diff --git a/flow/skia_gpu_object.h b/flow/skia_gpu_object.h new file mode 100644 index 0000000000000..4711f80c6f4fd --- /dev/null +++ b/flow/skia_gpu_object.h @@ -0,0 +1,88 @@ +// Copyright 2017 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_FLOW_SKIA_GPU_OBJECT_H_ +#define FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ + +#include +#include + +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/task_runner.h" +#include "lib/fxl/memory/ref_ptr.h" +#include "third_party/skia/include/core/SkRefCnt.h" + +namespace flow { + +// A queue that holds Skia objects that must be destructed on the the given task +// runner. +class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { + public: + void Unref(SkRefCnt* object); + + // Usually, the drain is called automatically. However, during IO manager + // shutdown (when the platform side reference to the OpenGL context is about + // to go away), we may need to pre-emptively drain the unref queue. It is the + // responsibility of the caller to ensure that no further unrefs are queued + // after this call. + void Drain(); + + private: + const fxl::RefPtr task_runner_; + const fxl::TimeDelta drain_delay_; + std::mutex mutex_; + std::deque objects_; + bool drain_pending_; + + SkiaUnrefQueue(fxl::RefPtr task_runner, + fxl::TimeDelta delay); + + ~SkiaUnrefQueue(); + + FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); + FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); + FXL_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); +}; + +/// An object whose deallocation needs to be performed on an specific unref +/// queue. The template argument U need to have a call operator that returns +/// that unref queue. +template +class SkiaGPUObject { + public: + using SkiaObjectType = T; + + SkiaGPUObject() = default; + + SkiaGPUObject(sk_sp object, fxl::RefPtr queue) + : object_(std::move(object)), queue_(std::move(queue)) { + FXL_DCHECK(queue_ && object_); + } + + SkiaGPUObject(SkiaGPUObject&&) = default; + + ~SkiaGPUObject() { reset(); } + + SkiaGPUObject& operator=(SkiaGPUObject&&) = default; + + sk_sp get() const { return object_; } + + void reset() { + if (object_) { + queue_->Unref(object_.release()); + } + queue_ = nullptr; + FXL_DCHECK(object_ == nullptr); + } + + private: + sk_sp object_; + fxl::RefPtr queue_; + + FXL_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); +}; + +} // namespace flow + +#endif // FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ diff --git a/flow/texture.cc b/flow/texture.cc index 33a48af989477..d5cc3ae228aa7 100644 --- a/flow/texture.cc +++ b/flow/texture.cc @@ -11,36 +11,32 @@ TextureRegistry::TextureRegistry() = default; TextureRegistry::~TextureRegistry() = default; void TextureRegistry::RegisterTexture(std::shared_ptr texture) { - ASSERT_IS_GPU_THREAD mapping_[texture->Id()] = texture; } void TextureRegistry::UnregisterTexture(int64_t id) { - ASSERT_IS_GPU_THREAD mapping_.erase(id); } void TextureRegistry::OnGrContextCreated() { - ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextCreated(); } } void TextureRegistry::OnGrContextDestroyed() { - ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextDestroyed(); } } std::shared_ptr TextureRegistry::GetTexture(int64_t id) { - ASSERT_IS_GPU_THREAD auto it = mapping_.find(id); return it != mapping_.end() ? it->second : nullptr; } Texture::Texture(int64_t id) : id_(id) {} + Texture::~Texture() = default; } // namespace flow diff --git a/flow/texture.h b/flow/texture.h index a602a6b45b5b4..f5e4430834084 100644 --- a/flow/texture.h +++ b/flow/texture.h @@ -6,7 +6,7 @@ #define FLUTTER_FLOW_TEXTURE_H_ #include -#include "flutter/common/threads.h" + #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -29,6 +29,9 @@ class Texture { // Called from GPU thread. virtual void OnGrContextDestroyed() = 0; + // Called on GPU thread. + virtual void MarkNewFrameAvailable() = 0; + int64_t Id() { return id_; } private: diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 6dabcb446c912..ffbf949cc0957 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -4,9 +4,12 @@ source_set("fml") { sources = [ + "file.h", "icu_util.cc", "icu_util.h", + "mapping.cc", "mapping.h", + "memory/thread_checker.h", "memory/weak_ptr.h", "memory/weak_ptr_internal.cc", "memory/weak_ptr_internal.h", @@ -14,8 +17,9 @@ source_set("fml") { "message_loop.h", "message_loop_impl.cc", "message_loop_impl.h", + "native_library.h", + "paths.cc", "paths.h", - "task_observer.h", "task_runner.cc", "task_runner.h", "thread.cc", @@ -23,6 +27,9 @@ source_set("fml") { "thread_local.h", "trace_event.cc", "trace_event.h", + "unique_fd.cc", + "unique_fd.h", + "unique_object.h", ] deps = [ @@ -95,16 +102,25 @@ source_set("fml") { ] } + if (is_fuchsia) { + sources += [ "platform/fuchsia/paths_fuchsia.cc" ] + } + if (is_win) { sources += [ + "platform/win/file_win.cc", "platform/win/mapping_win.cc", "platform/win/message_loop_win.cc", "platform/win/message_loop_win.h", + "platform/win/native_library_win.cc", "platform/win/paths_win.cc", + "platform/win/wstring_conversion.h", ] } else { sources += [ + "platform/posix/file_posix.cc", "platform/posix/mapping_posix.cc", + "platform/posix/native_library_posix.cc", ] } } diff --git a/fml/file.h b/fml/file.h new file mode 100644 index 0000000000000..2327b2eef831e --- /dev/null +++ b/fml/file.h @@ -0,0 +1,35 @@ +// Copyright 2018 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_FILE_H_ +#define FLUTTER_FML_FILE_H_ + +#include "flutter/fml/unique_fd.h" +#include "lib/fxl/macros.h" + +namespace fml { + +enum class OpenPermission { + kRead = 1, + kWrite = 1 << 1, + kReadWrite = kRead | kWrite, + kExecute, +}; + +fml::UniqueFD OpenFile(const char* path, + OpenPermission permission, + bool is_directory = false); + +fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, + const char* path, + OpenPermission permission, + bool is_directory = false); + +fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor); + +bool IsDirectory(const fml::UniqueFD& directory); + +} // namespace fml + +#endif // FLUTTER_FML_FILE_H_ diff --git a/fml/icu_util.cc b/fml/icu_util.cc index 093dc3d02b1bc..0c0acd06dbbdf 100644 --- a/fml/icu_util.cc +++ b/fml/icu_util.cc @@ -22,8 +22,6 @@ static constexpr char kPathSeparator = '\\'; static constexpr char kPathSeparator = '/'; #endif -static constexpr char kIcuDataFileName[] = "icudtl.dat"; - class ICUContext { public: ICUContext(const std::string& icu_data_path) : valid_(false) { @@ -34,15 +32,15 @@ class ICUContext { bool SetupMapping(const std::string& icu_data_path) { // Check if the explicit path specified exists. - auto overriden_path_mapping = std::make_unique(icu_data_path); - if (overriden_path_mapping->GetSize() != 0) { - mapping_ = std::move(overriden_path_mapping); + auto path_mapping = std::make_unique(icu_data_path, false); + if (path_mapping->GetSize() != 0) { + mapping_ = std::move(path_mapping); return true; } // Check to see if the mapping is in the resources bundle. if (PlatformHasResourcesBundle()) { - auto resource = GetResourceMapping(kIcuDataFileName); + auto resource = GetResourceMapping(icu_data_path); if (resource != nullptr && resource->GetSize() != 0) { mapping_ = std::move(resource); return true; @@ -57,10 +55,8 @@ class ICUContext { return false; } - // FIXME(chinmaygarde): There is no Path::Join in FXL. So a non-portable - // version is used here. Patch FXL and update. auto file = std::make_unique( - directory.second + kPathSeparator + kIcuDataFileName); + directory.second + kPathSeparator + icu_data_path, false); if (file->GetSize() != 0) { mapping_ = std::move(file); return true; @@ -96,7 +92,8 @@ class ICUContext { void InitializeICUOnce(const std::string& icu_data_path) { static ICUContext* context = new ICUContext(icu_data_path); - FXL_CHECK(context->IsValid()) << "Must be able to initialize the ICU context"; + FXL_CHECK(context->IsValid()) + << "Must be able to initialize the ICU context. Tried: " << icu_data_path; } std::once_flag g_icu_init_flag; diff --git a/fml/macros.h b/fml/macros.h new file mode 100644 index 0000000000000..ba46b9dda4b4d --- /dev/null +++ b/fml/macros.h @@ -0,0 +1,20 @@ +// Copyright 2018 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_MACROS_H_ +#define FLUTTER_FML_MACROS_H_ + +#include "lib/fxl/macros.h" + +#ifndef FML_USED_ON_EMBEDDER + +#define FML_EMBEDDER_ONLY [[deprecated]] + +#else // FML_USED_ON_EMBEDDER + +#define FML_EMBEDDER_ONLY + +#endif // FML_USED_ON_EMBEDDER + +#endif // FLUTTER_FML_MACROS_H_ diff --git a/fml/mapping.cc b/fml/mapping.cc new file mode 100644 index 0000000000000..97d7905015f61 --- /dev/null +++ b/fml/mapping.cc @@ -0,0 +1,20 @@ +// Copyright 2018 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/mapping.h" + +namespace fml { + +DataMapping::DataMapping(std::vector data) : data_(std::move(data)) {} + +DataMapping::~DataMapping() = default; + +size_t DataMapping::GetSize() const { + return data_.size(); +} + +const uint8_t* DataMapping::GetMapping() const { + return data_.data(); +} +} // namespace fml diff --git a/fml/mapping.h b/fml/mapping.h index 8963b22a9c1f6..00e9685dd6b0c 100644 --- a/fml/mapping.h +++ b/fml/mapping.h @@ -7,14 +7,10 @@ #include #include +#include +#include "flutter/fml//unique_fd.h" #include "lib/fxl/build_config.h" - -#if OS_WIN -#include -#endif - -#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { @@ -39,12 +35,9 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name); class FileMapping : public Mapping { public: - FileMapping(const std::string& path); + FileMapping(const std::string& path, bool executable = false); -// fxl::UniqueFD isn't supported for Windows handles. -#if !OS_WIN - FileMapping(const fxl::UniqueFD& fd); -#endif + FileMapping(const fml::UniqueFD& fd, bool executable = false); ~FileMapping() override; @@ -53,16 +46,32 @@ class FileMapping : public Mapping { const uint8_t* GetMapping() const override; private: - size_t size_; - uint8_t* mapping_; + size_t size_ = 0; + uint8_t* mapping_ = nullptr; #if OS_WIN - HANDLE mapping_handle_; + fml::UniqueFD mapping_handle_; #endif FXL_DISALLOW_COPY_AND_ASSIGN(FileMapping); }; +class DataMapping : public Mapping { + public: + DataMapping(std::vector data); + + ~DataMapping() override; + + size_t GetSize() const override; + + const uint8_t* GetMapping() const override; + + private: + std::vector data_; + + FXL_DISALLOW_COPY_AND_ASSIGN(DataMapping); +}; + } // namespace fml #endif // FLUTTER_FML_MAPPING_H_ diff --git a/fml/memory/thread_checker.h b/fml/memory/thread_checker.h new file mode 100644 index 0000000000000..f22e9d1cfaf06 --- /dev/null +++ b/fml/memory/thread_checker.h @@ -0,0 +1,69 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// A class for checking that the current thread is/isn't the same as an initial +// thread. + +#ifndef FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ +#define FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ + +#include "lib/fxl/build_config.h" + +#if defined(OS_WIN) +#include +#else +#include +#endif + +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" + +namespace fml { + +// A simple class that records the identity of the thread that it was created +// on, and at later points can tell if the current thread is the same as its +// creation thread. This class is thread-safe. +// +// Note: Unlike Chromium's |base::ThreadChecker|, this is *not* Debug-only (so +// #ifdef it out if you want something Debug-only). (Rationale: Having a +// |CalledOnValidThread()| that lies in Release builds seems bad. Moreover, +// there's a small space cost to having even an empty class. ) +class ThreadChecker final { + public: +#if defined(OS_WIN) + ThreadChecker() : self_(GetCurrentThreadId()) {} + ~ThreadChecker() {} + + bool IsCreationThreadCurrent() const { return GetCurrentThreadId() == self_; } + + private: + DWORD self_; + +#else + ThreadChecker() : self_(pthread_self()) {} + ~ThreadChecker() {} + + // Returns true if the current thread is the thread this object was created + // on and false otherwise. + bool IsCreationThreadCurrent() const { + return !!pthread_equal(pthread_self(), self_); + } + + private: + pthread_t self_; +#endif +}; + +#ifndef NDEBUG +#define FML_DECLARE_THREAD_CHECKER(c) fml::ThreadChecker c +#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) \ + FXL_DCHECK((c).IsCreationThreadCurrent()) +#else +#define FML_DECLARE_THREAD_CHECKER(c) +#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) ((void)0) +#endif + +} // namespace fml + +#endif // FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ diff --git a/fml/memory/weak_ptr.h b/fml/memory/weak_ptr.h index 5b85c531966b2..2b369952d7306 100644 --- a/fml/memory/weak_ptr.h +++ b/fml/memory/weak_ptr.h @@ -10,12 +10,17 @@ #include +#include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr_internal.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_counted.h" namespace fml { +struct DebugThreadChecker { + FML_DECLARE_THREAD_CHECKER(checker); +}; + // Forward declaration, so |WeakPtr| can friend it. template class WeakPtrFactory; @@ -41,13 +46,17 @@ class WeakPtr { WeakPtr(const WeakPtr& r) = default; template - WeakPtr(const WeakPtr& r) : ptr_(r.ptr_), flag_(r.flag_) {} + WeakPtr(const WeakPtr& r) + : ptr_(static_cast(r.ptr_)), flag_(r.flag_), checker_(r.checker_) {} // Move constructor. WeakPtr(WeakPtr&& r) = default; template - WeakPtr(WeakPtr&& r) : ptr_(r.ptr_), flag_(std::move(r.flag_)) {} + WeakPtr(WeakPtr&& r) + : ptr_(static_cast(r.ptr_)), + flag_(std::move(r.flag_)), + checker_(r.checker_) {} ~WeakPtr() = default; @@ -65,16 +74,24 @@ class WeakPtr { // The following methods should only be called on the same thread as the // "originating" |WeakPtrFactory|. - explicit operator bool() const { return flag_ && flag_->is_valid(); } + explicit operator bool() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); + return flag_ && flag_->is_valid(); + } - T* get() const { return *this ? ptr_ : nullptr; } + T* get() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); + return *this ? ptr_ : nullptr; + } T& operator*() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return *get(); } T* operator->() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return get(); } @@ -85,11 +102,14 @@ class WeakPtr { friend class WeakPtrFactory; - explicit WeakPtr(T* ptr, fxl::RefPtr&& flag) - : ptr_(ptr), flag_(std::move(flag)) {} + explicit WeakPtr(T* ptr, + fxl::RefPtr&& flag, + DebugThreadChecker checker) + : ptr_(ptr), flag_(std::move(flag)), checker_(checker) {} T* ptr_; fxl::RefPtr flag_; + DebugThreadChecker checker_; // Copy/move construction/assignment supported. }; @@ -140,19 +160,22 @@ template class WeakPtrFactory { public: explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { FXL_DCHECK(ptr_); } + ~WeakPtrFactory() { InvalidateWeakPtrs(); } // Gets a new weak pointer, which will be valid until either // |InvalidateWeakPtrs()| is called or this object is destroyed. WeakPtr GetWeakPtr() { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) flag_ = fxl::MakeRefCounted(); - return WeakPtr(ptr_, flag_.Clone()); + return WeakPtr(ptr_, flag_.Clone(), checker_); } // Call this method to invalidate all existing weak pointers. (Note that // additional weak pointers can be produced even after this is called.) void InvalidateWeakPtrs() { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) return; flag_->Invalidate(); @@ -162,13 +185,17 @@ class WeakPtrFactory { // Call this method to determine if any weak pointers exist. (Note that a // "false" result is definitive, but a "true" result may not be if weak // pointers are held/reset/destroyed/reassigned on other threads.) - bool HasWeakPtrs() const { return flag_ && !flag_->HasOneRef(); } + bool HasWeakPtrs() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); + return flag_ && !flag_->HasOneRef(); + } private: // Note: See weak_ptr_internal.h for an explanation of why we store the // pointer here, instead of in the "flag". T* const ptr_; fxl::RefPtr flag_; + DebugThreadChecker checker_; FXL_DISALLOW_COPY_AND_ASSIGN(WeakPtrFactory); }; diff --git a/fml/message_loop.cc b/fml/message_loop.cc index 4765cfa76558f..44a0e307c1dd1 100644 --- a/fml/message_loop.cc +++ b/fml/message_loop.cc @@ -55,7 +55,7 @@ void MessageLoop::Terminate() { loop_->DoTerminate(); } -fxl::RefPtr MessageLoop::GetTaskRunner() const { +fxl::RefPtr MessageLoop::GetTaskRunner() const { return task_runner_; } @@ -63,12 +63,12 @@ fxl::RefPtr MessageLoop::GetLoopImpl() const { return loop_; } -void MessageLoop::AddTaskObserver(TaskObserver* observer) { - loop_->AddTaskObserver(observer); +void MessageLoop::AddTaskObserver(intptr_t key, fxl::Closure callback) { + loop_->AddTaskObserver(key, callback); } -void MessageLoop::RemoveTaskObserver(TaskObserver* observer) { - loop_->RemoveTaskObserver(observer); +void MessageLoop::RemoveTaskObserver(intptr_t key) { + loop_->RemoveTaskObserver(key); } void MessageLoop::RunExpiredTasksNow() { diff --git a/fml/message_loop.h b/fml/message_loop.h index 87773619ccc51..3bfb1c40c6df7 100644 --- a/fml/message_loop.h +++ b/fml/message_loop.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_MESSAGE_LOOP_H_ #define FLUTTER_FML_MESSAGE_LOOP_H_ -#include "flutter/fml/task_observer.h" +#include "flutter/fml/macros.h" #include "lib/fxl/macros.h" #include "lib/fxl/tasks/task_runner.h" @@ -16,6 +16,7 @@ class MessageLoopImpl; class MessageLoop { public: + FML_EMBEDDER_ONLY static MessageLoop& GetCurrent(); bool IsValid() const; @@ -24,11 +25,11 @@ class MessageLoop { void Terminate(); - void AddTaskObserver(TaskObserver* observer); + void AddTaskObserver(intptr_t key, fxl::Closure callback); - void RemoveTaskObserver(TaskObserver* observer); + void RemoveTaskObserver(intptr_t key); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; // Exposed for the embedder shell which allows clients to poll for events // instead of dedicating a thread to the message loop. diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index cec9b7e448f1a..df885f3792d5f 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -2,6 +2,8 @@ // 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 @@ -11,35 +13,29 @@ #include "lib/fxl/build_config.h" #if OS_MACOSX - #include "flutter/fml/platform/darwin/message_loop_darwin.h" -using PlatformMessageLoopImpl = fml::MessageLoopDarwin; - #elif OS_ANDROID - #include "flutter/fml/platform/android/message_loop_android.h" -using PlatformMessageLoopImpl = fml::MessageLoopAndroid; - #elif OS_LINUX - #include "flutter/fml/platform/linux/message_loop_linux.h" -using PlatformMessageLoopImpl = fml::MessageLoopLinux; - #elif OS_WIN - #include "flutter/fml/platform/win/message_loop_win.h" -using PlatformMessageLoopImpl = fml::MessageLoopWin; - -#else - -#error This platform does not have a message loop implementation. - #endif namespace fml { fxl::RefPtr MessageLoopImpl::Create() { - return fxl::MakeRefCounted<::PlatformMessageLoopImpl>(); +#if OS_MACOSX + return fxl::MakeRefCounted(); +#elif OS_ANDROID + return fxl::MakeRefCounted(); +#elif OS_LINUX + return fxl::MakeRefCounted(); +#elif OS_WIN + return fxl::MakeRefCounted(); +#else + return nullptr; +#endif } MessageLoopImpl::MessageLoopImpl() : order_(0), terminated_(false) {} @@ -55,20 +51,19 @@ void MessageLoopImpl::RunExpiredTasksNow() { RunExpiredTasks(); } -void MessageLoopImpl::AddTaskObserver(TaskObserver* observer) { - FXL_DCHECK(observer != nullptr); +void MessageLoopImpl::AddTaskObserver(intptr_t key, fxl::Closure callback) { + FXL_DCHECK(callback != nullptr); FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be added on the same thread as the " "loop."; - task_observers_.insert(observer); + task_observers_[key] = std::move(callback); } -void MessageLoopImpl::RemoveTaskObserver(TaskObserver* observer) { - FXL_DCHECK(observer != nullptr); +void MessageLoopImpl::RemoveTaskObserver(intptr_t key) { FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be removed from the same thread as " "the loop."; - task_observers_.erase(observer); + task_observers_.erase(key); } void MessageLoopImpl::DoRun() { @@ -144,7 +139,7 @@ void MessageLoopImpl::RunExpiredTasks() { for (const auto& invocation : invocations) { invocation(); for (const auto& observer : task_observers_) { - observer->DidProcessTask(); + observer.second(); } } } diff --git a/fml/message_loop_impl.h b/fml/message_loop_impl.h index bfdb2064cb264..478cbd1f1a0be 100644 --- a/fml/message_loop_impl.h +++ b/fml/message_loop_impl.h @@ -7,9 +7,9 @@ #include #include +#include #include #include -#include #include #include "flutter/fml/message_loop.h" @@ -34,9 +34,9 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { void PostTask(fxl::Closure task, fxl::TimePoint target_time); - void AddTaskObserver(TaskObserver* observer); + void AddTaskObserver(intptr_t key, fxl::Closure callback); - void RemoveTaskObserver(TaskObserver* observer); + void RemoveTaskObserver(intptr_t key); void DoRun(); @@ -71,7 +71,7 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { using DelayedTaskQueue = std:: priority_queue, DelayedTaskCompare>; - std::set task_observers_; + std::map task_observers_; std::mutex delayed_tasks_mutex_; DelayedTaskQueue delayed_tasks_; size_t order_; diff --git a/fml/message_loop_unittests.cc b/fml/message_loop_unittests.cc index 11ea72c3900eb..cd2acd308b46a 100644 --- a/fml/message_loop_unittests.cc +++ b/fml/message_loop_unittests.cc @@ -2,9 +2,12 @@ // 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 #include "flutter/fml/message_loop.h" +#include "flutter/fml/task_runner.h" #include "gtest/gtest.h" #include "lib/fxl/synchronization/waitable_event.h" @@ -244,22 +247,6 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) { ASSERT_EQ(checked, count); } -class CustomTaskObserver : public fml::TaskObserver { - public: - CustomTaskObserver(std::function lambda) : lambda_(lambda){}; - - ~CustomTaskObserver() override = default; - - void DidProcessTask() override { - if (lambda_) { - lambda_(); - } - }; - - private: - std::function lambda_; -}; - TEST(MessageLoop, TaskObserverFire) { bool started = false; bool terminated = false; @@ -269,8 +256,7 @@ TEST(MessageLoop, TaskObserverFire) { auto& loop = fml::MessageLoop::GetCurrent(); size_t task_count = 0; size_t obs_count = 0; - CustomTaskObserver obs( - PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }); + auto obs = PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }; for (size_t i = 0; i < count; i++) { loop.GetTaskRunner()->PostTask( PLATFORM_SPECIFIC_CAPTURE(&terminated, i, &task_count)() { @@ -282,7 +268,7 @@ TEST(MessageLoop, TaskObserverFire) { } }); } - loop.AddTaskObserver(&obs); + loop.AddTaskObserver(0, obs); loop.Run(); ASSERT_EQ(task_count, count); ASSERT_EQ(obs_count, count); diff --git a/fml/native_library.h b/fml/native_library.h new file mode 100644 index 0000000000000..7e48ed6d3a3ff --- /dev/null +++ b/fml/native_library.h @@ -0,0 +1,52 @@ +// Copyright 2018 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_NATIVE_LIBRARY_H_ +#define FLUTTER_FML_NATIVE_LIBRARY_H_ + +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" + +#if OS_WIN + +#include + +#endif // OS_WIN + +namespace fml { +class NativeLibrary : public fxl::RefCountedThreadSafe { + public: +#if OS_WIN + using Handle = HMODULE; +#else // OS_WIN + using Handle = void*; +#endif // OS_WIN + + static fxl::RefPtr Create(const char* path); + + static fxl::RefPtr CreateForCurrentProcess(); + + const uint8_t* ResolveSymbol(const char* symbol); + + private: + Handle handle_ = nullptr; + bool close_handle_ = true; + + NativeLibrary(const char* path); + + NativeLibrary(Handle handle, bool close_handle); + + ~NativeLibrary(); + + Handle GetHandle() const; + + FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrary); + FRIEND_REF_COUNTED_THREAD_SAFE(NativeLibrary); + FRIEND_MAKE_REF_COUNTED(NativeLibrary); +}; + +} // namespace fml + +#endif // FLUTTER_FML_NATIVE_LIBRARY_H_ diff --git a/fml/paths.cc b/fml/paths.cc new file mode 100644 index 0000000000000..9b06b6847f415 --- /dev/null +++ b/fml/paths.cc @@ -0,0 +1,31 @@ +// Copyright 2018 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/paths.h" + +#include "lib/fxl/build_config.h" + +namespace fml { +namespace paths { + +std::string JoinPaths(std::initializer_list components) { + std::stringstream stream; + size_t i = 0; + const size_t size = components.size(); + for (const auto& component : components) { + i++; + stream << component; + if (i != size) { +#if OS_WIN + stream << "\\"; +#else // OS_WIN + stream << "/"; +#endif // OS_WIN + } + } + return stream.str(); +} + +} // namespace paths +} // namespace fml diff --git a/fml/paths.h b/fml/paths.h index 8ec3b4b580476..0d4367654de4a 100644 --- a/fml/paths.h +++ b/fml/paths.h @@ -8,11 +8,15 @@ #include #include +#include "lib/fxl/strings/string_view.h" + namespace fml { namespace paths { std::pair GetExecutableDirectoryPath(); +std::string JoinPaths(std::initializer_list components); + } // namespace paths } // namespace fml diff --git a/fml/platform/android/message_loop_android.h b/fml/platform/android/message_loop_android.h index e6d04e8253401..19c1eafe79845 100644 --- a/fml/platform/android/message_loop_android.h +++ b/fml/platform/android/message_loop_android.h @@ -10,7 +10,7 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "lib/fxl/files/unique_fd.h" +#include "flutter/fml/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/unique_object.h" @@ -24,8 +24,8 @@ struct UniqueLooperTraits { class MessageLoopAndroid : public MessageLoopImpl { private: - fxl::UniqueObject looper_; - fxl::UniqueFD timer_fd_; + fml::UniqueObject looper_; + fml::UniqueFD timer_fd_; bool running_; MessageLoopAndroid(); diff --git a/fml/platform/darwin/resource_mapping_darwin.mm b/fml/platform/darwin/resource_mapping_darwin.mm index 5d1b9664e20bc..3ee100121ad0f 100644 --- a/fml/platform/darwin/resource_mapping_darwin.mm +++ b/fml/platform/darwin/resource_mapping_darwin.mm @@ -9,8 +9,8 @@ namespace fml { ResourceMappingDarwin::ResourceMappingDarwin(const std::string& resource) - : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String]) { -} + : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String], + false) {} ResourceMappingDarwin::~ResourceMappingDarwin() = default; diff --git a/fml/platform/fuchsia/paths_fuchsia.cc b/fml/platform/fuchsia/paths_fuchsia.cc new file mode 100644 index 0000000000000..20def9f34fae9 --- /dev/null +++ b/fml/platform/fuchsia/paths_fuchsia.cc @@ -0,0 +1,15 @@ +// Copyright 2018 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/paths.h" + +namespace fml { +namespace paths { + +std::pair GetExecutableDirectoryPath() { + return {false, ""}; +} + +} // namespace paths +} // namespace fml diff --git a/fml/platform/linux/message_loop_linux.h b/fml/platform/linux/message_loop_linux.h index 51dc690ce887b..ba5e902d4ac89 100644 --- a/fml/platform/linux/message_loop_linux.h +++ b/fml/platform/linux/message_loop_linux.h @@ -8,15 +8,15 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "lib/fxl/files/unique_fd.h" +#include "flutter/fml/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { class MessageLoopLinux : public MessageLoopImpl { private: - fxl::UniqueFD epoll_fd_; - fxl::UniqueFD timer_fd_; + fml::UniqueFD epoll_fd_; + fml::UniqueFD timer_fd_; bool running_; MessageLoopLinux(); diff --git a/fml/platform/posix/file_posix.cc b/fml/platform/posix/file_posix.cc new file mode 100644 index 0000000000000..028f49f4d183d --- /dev/null +++ b/fml/platform/posix/file_posix.cc @@ -0,0 +1,71 @@ +// Copyright 2018 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/file.h" + +#include +#include +#include + +#include "lib/fxl/files/eintr_wrapper.h" + +namespace fml { + +fml::UniqueFD OpenFile(const char* path, + OpenPermission permission, + bool is_directory) { + return OpenFile(fml::UniqueFD{AT_FDCWD}, path, permission, is_directory); +} + +fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, + const char* path, + OpenPermission permission, + bool is_directory) { + if (path == nullptr) { + return fml::UniqueFD{}; + } + + int flags = 0; + switch (permission) { + case OpenPermission::kRead: + flags = O_RDONLY; + break; + case OpenPermission::kWrite: + flags = O_WRONLY; + break; + case OpenPermission::kReadWrite: + flags = O_RDWR; + break; + case OpenPermission::kExecute: + flags = O_RDONLY; + break; + } + + if (is_directory) { + flags |= O_DIRECTORY; + } + + return fml::UniqueFD{ + HANDLE_EINTR(::openat(base_directory.get(), path, flags))}; +} + +fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { + return fml::UniqueFD{HANDLE_EINTR(::dup(descriptor))}; +} + +bool IsDirectory(const fml::UniqueFD& directory) { + if (!directory.is_valid()) { + return false; + } + + struct stat stat_result = {}; + + if (::fstat(directory.get(), &stat_result) != 0) { + return false; + } + + return S_ISDIR(stat_result.st_mode); +} + +} // namespace fml diff --git a/fml/platform/posix/mapping_posix.cc b/fml/platform/posix/mapping_posix.cc index 07f7edb074ab9..fc53d6a4f7fc9 100644 --- a/fml/platform/posix/mapping_posix.cc +++ b/fml/platform/posix/mapping_posix.cc @@ -11,6 +11,7 @@ #include +#include "flutter/fml/unique_fd.h" #include "lib/fxl/build_config.h" #include "lib/fxl/files/eintr_wrapper.h" @@ -39,11 +40,11 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path) - : FileMapping(fxl::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}) { -} +FileMapping::FileMapping(const std::string& path, bool executable) + : FileMapping(fml::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}, + executable) {} -FileMapping::FileMapping(const fxl::UniqueFD& handle) +FileMapping::FileMapping(const fml::UniqueFD& handle, bool executable) : size_(0), mapping_(nullptr) { if (!handle.is_valid()) { return; @@ -59,8 +60,13 @@ FileMapping::FileMapping(const fxl::UniqueFD& handle) return; } - auto mapping = ::mmap(nullptr, stat_buffer.st_size, PROT_READ, MAP_PRIVATE, - handle.get(), 0); + int flags = PROT_READ; + if (executable) { + flags |= PROT_EXEC; + } + + auto mapping = + ::mmap(nullptr, stat_buffer.st_size, flags, MAP_PRIVATE, handle.get(), 0); if (mapping == MAP_FAILED) { return; diff --git a/fml/platform/posix/native_library_posix.cc b/fml/platform/posix/native_library_posix.cc new file mode 100644 index 0000000000000..1255c38fc0821 --- /dev/null +++ b/fml/platform/posix/native_library_posix.cc @@ -0,0 +1,60 @@ +// Copyright 2018 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/native_library.h" + +#include +#include + +namespace fml { + +NativeLibrary::NativeLibrary(const char* path) { + ::dlerror(); + handle_ = ::dlopen(path, RTLD_NOW); + if (handle_ == nullptr) { + FXL_LOG(ERROR) << "Could not open library '" << path << "' due to error '" + << ::dlerror() << "'."; + } +} + +NativeLibrary::NativeLibrary(Handle handle, bool close_handle) + : handle_(handle), close_handle_(close_handle) {} + +NativeLibrary::~NativeLibrary() { + if (handle_ == nullptr) { + return; + } + + if (close_handle_) { + ::dlerror(); + if (::dlclose(handle_) != 0) { + handle_ = nullptr; + FXL_LOG(ERROR) << "Could not close library due to error '" << ::dlerror() + << "'."; + } + } +} + +NativeLibrary::Handle NativeLibrary::GetHandle() const { + return handle_; +} + +fxl::RefPtr NativeLibrary::Create(const char* path) { + auto library = fxl::AdoptRef(new NativeLibrary(path)); + return library->GetHandle() != nullptr ? library : nullptr; +} + +fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { + return fxl::AdoptRef(new NativeLibrary(RTLD_DEFAULT, false)); +} + +const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { + auto resolved_symbol = static_cast(::dlsym(handle_, symbol)); + if (resolved_symbol == nullptr) { + FXL_DLOG(ERROR) << "Could not resolve symbol in library: " << symbol; + } + return resolved_symbol; +} + +} // namespace fml diff --git a/fml/platform/win/file_win.cc b/fml/platform/win/file_win.cc new file mode 100644 index 0000000000000..3f5e90494b013 --- /dev/null +++ b/fml/platform/win/file_win.cc @@ -0,0 +1,119 @@ +// Copyright 2018 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/file.h" + +#include + +#include + +#include "flutter/fml/platform/win/wstring_conversion.h" + +namespace fml { + +fml::UniqueFD OpenFile(const std::wstring& path, + OpenPermission permission, + bool is_directory) { + if (path.size() == 0) { + return fml::UniqueFD{}; + } + + DWORD desired_access = 0; + + switch (permission) { + case OpenPermission::kRead: + desired_access = GENERIC_READ; + break; + case OpenPermission::kWrite: + desired_access = GENERIC_WRITE; + break; + case OpenPermission::kReadWrite: + desired_access = GENERIC_WRITE | GENERIC_READ; + break; + case OpenPermission::kExecute: + desired_access = GENERIC_READ | GENERIC_EXECUTE; + break; + } + + return fml::UniqueFD{::CreateFile( + path.c_str(), // lpFileName + desired_access, // dwDesiredAccess + FILE_SHARE_READ, // dwShareMode + 0, // lpSecurityAttributes + OPEN_EXISTING, // dwCreationDisposition + FILE_ATTRIBUTE_NORMAL, // dwFlagsAndAttributes + 0 // hTemplateFile + )}; +} + +fml::UniqueFD OpenFile(const char* path, + OpenPermission permission, + bool is_directory) { + return OpenFile(ConvertToWString(path), permission, is_directory); +} + +static std::wstring GetFullHandlePath(const fml::UniqueFD& handle) { + wchar_t buffer[MAX_PATH]; + + DWORD returned = ::GetFinalPathNameByHandle(handle.get(), buffer, MAX_PATH, + FILE_NAME_NORMALIZED); + if (returned == 0 || returned > MAX_PATH) { + return {}; + } + + return {buffer}; +} + +fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, + const char* path, + OpenPermission permission, + bool is_directory) { + // If the base directory is invalid or the path is absolute, use the generic + // open file variant. + if (!base_directory.is_valid()) { + return OpenFile(path, permission, is_directory); + } + + const auto wpath = ConvertToWString(path); + + if (!::PathIsRelative(wpath.c_str())) { + return OpenFile(path, permission, is_directory); + } + + std::wstringstream stream; + stream << GetFullHandlePath(base_directory) << "\\" << path; + return OpenFile(stream.str(), permission, is_directory); +} + +fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { + if (descriptor == INVALID_HANDLE_VALUE) { + return fml::UniqueFD{}; + } + + HANDLE duplicated = INVALID_HANDLE_VALUE; + + if (!::DuplicateHandle( + GetCurrentProcess(), // source process + descriptor, // source handle + GetCurrentProcess(), // target process + &duplicated, // target handle + 0, // desired access (ignored because DUPLICATE_SAME_ACCESS) + FALSE, // inheritable + DUPLICATE_SAME_ACCESS) // options + ) { + return fml::UniqueFD{}; + } + + return fml::UniqueFD{duplicated}; +} + +bool IsDirectory(const fml::UniqueFD& directory) { + BY_HANDLE_FILE_INFORMATION info; + if (!::GetFileInformationByHandle(directory.get(), &info)) { + return false; + } + return info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; +} + +} // namespace fml diff --git a/fml/platform/win/mapping_win.cc b/fml/platform/win/mapping_win.cc index fd404a14f37dc..9dd5dcf6f2249 100644 --- a/fml/platform/win/mapping_win.cc +++ b/fml/platform/win/mapping_win.cc @@ -5,13 +5,13 @@ #include "flutter/fml/mapping.h" #include +#include +#include #include -#include "lib/fxl/build_config.h" - -#include -#include +#include "flutter/fml/file.h" +#include "flutter/fml/platform/win/wstring_conversion.h" using PlatformResourceMapping = fml::FileMapping; @@ -29,47 +29,50 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path) - : size_(0), mapping_(nullptr) { - HANDLE file_handle_ = - CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, - FILE_SHARE_READ, nullptr, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); +FileMapping::FileMapping(const std::string& path, bool executable) + : FileMapping(OpenFile(path.c_str(), + executable ? OpenPermission::kExecute + : OpenPermission::kRead, + false), + executable) {} - if (file_handle_ == INVALID_HANDLE_VALUE) { +FileMapping::FileMapping(const fml::UniqueFD& fd, bool executable) + : size_(0), mapping_(nullptr) { + if (!fd.is_valid()) { return; } - size_ = GetFileSize(file_handle_, nullptr); - if (size_ == INVALID_FILE_SIZE) { - size_ = 0; - return; + if (auto size = ::GetFileSize(fd.get(), nullptr)) { + if (size > 0) { + size_ = size; + } else { + return; + } } - mapping_handle_ = CreateFileMapping(file_handle_, nullptr, PAGE_READONLY, 0, - size_, nullptr); + const DWORD protect = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; - CloseHandle(file_handle_); + mapping_handle_.reset(::CreateFileMapping(fd.get(), // hFile + nullptr, // lpAttributes + protect, // flProtect + 0, // dwMaximumSizeHigh + 0, // dwMaximumSizeLow + nullptr // lpName + )); - if (mapping_handle_ == INVALID_HANDLE_VALUE) { + if (!mapping_handle_.is_valid()) { return; } - auto mapping = MapViewOfFile(mapping_handle_, FILE_MAP_READ, 0, 0, size_); - - if (mapping == INVALID_HANDLE_VALUE) { - CloseHandle(mapping_handle_); - mapping_handle_ = INVALID_HANDLE_VALUE; - return; - } + const DWORD desired_access = executable ? FILE_MAP_ALL_ACCESS : FILE_MAP_READ; - mapping_ = static_cast(mapping); + mapping_ = reinterpret_cast( + MapViewOfFile(mapping_handle_.get(), desired_access, 0, 0, size_)); } FileMapping::~FileMapping() { if (mapping_ != nullptr) { UnmapViewOfFile(mapping_); - CloseHandle(mapping_handle_); } } diff --git a/fml/platform/win/native_library_win.cc b/fml/platform/win/native_library_win.cc new file mode 100644 index 0000000000000..6992f06f3e886 --- /dev/null +++ b/fml/platform/win/native_library_win.cc @@ -0,0 +1,51 @@ +// Copyright 2018 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/native_library.h" + +#include + +#include "flutter/fml/platform/win/wstring_conversion.h" + +namespace fml { + +NativeLibrary::NativeLibrary(const char* path) + : handle_(nullptr), close_handle_(true) { + if (path == nullptr) { + return; + } + + handle_ = ::LoadLibrary(ConvertToWString(path).c_str()); +} + +NativeLibrary::NativeLibrary(Handle handle, bool close_handle) + : handle_(handle), close_handle_(close_handle) {} + +NativeLibrary::~NativeLibrary() { + if (handle_ != nullptr && close_handle_) { + ::FreeLibrary(handle_); + } +} + +NativeLibrary::Handle NativeLibrary::GetHandle() const { + return handle_; +} + +fxl::RefPtr NativeLibrary::Create(const char* path) { + auto library = fxl::AdoptRef(new NativeLibrary(path)); + return library->GetHandle() != nullptr ? library : nullptr; +} + +fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { + return fxl::AdoptRef(new NativeLibrary(::GetModuleHandle(nullptr), false)); +} + +const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { + if (symbol == nullptr || handle_ == nullptr) { + return nullptr; + } + return reinterpret_cast(::GetProcAddress(handle_, symbol)); +} + +} // namespace fml diff --git a/fml/platform/win/wstring_conversion.h b/fml/platform/win/wstring_conversion.h new file mode 100644 index 0000000000000..0682dd84067bf --- /dev/null +++ b/fml/platform/win/wstring_conversion.h @@ -0,0 +1,25 @@ +// Copyright 2018 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_WIN_WSTRING_CONVERSION_H_ +#define FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ + +#include +#include +#include + +namespace fml { + +inline std::wstring ConvertToWString(const char* path) { + if (path == nullptr) { + return {}; + } + std::string path8(path); + std::wstring_convert, wchar_t> wchar_conv; + return wchar_conv.from_bytes(path8); +} + +} // namespace fml + +#endif // FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ diff --git a/fml/task_observer.h b/fml/task_observer.h deleted file mode 100644 index 21697cf022005..0000000000000 --- a/fml/task_observer.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_FML_TASK_OBSERVER_H_ -#define FLUTTER_FML_TASK_OBSERVER_H_ - -#include "lib/fxl/macros.h" - -namespace fml { - -class TaskObserver { - public: - virtual ~TaskObserver() = default; - - virtual void DidProcessTask() = 0; -}; - -} // namespace fml - -#endif // FLUTTER_FML_TASK_OBSERVER_H_ diff --git a/fml/task_runner.cc b/fml/task_runner.cc index 3d13674d78c11..95f91de8e9124 100644 --- a/fml/task_runner.cc +++ b/fml/task_runner.cc @@ -2,6 +2,8 @@ // 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/task_runner.h" #include @@ -38,4 +40,14 @@ bool TaskRunner::RunsTasksOnCurrentThread() { return MessageLoop::GetCurrent().GetLoopImpl() == loop_; } +void TaskRunner::RunNowOrPostTask(fxl::RefPtr runner, + fxl::Closure task) { + FXL_DCHECK(runner); + if (runner->RunsTasksOnCurrentThread()) { + task(); + } else { + runner->PostTask(std::move(task)); + } +} + } // namespace fml diff --git a/fml/task_runner.h b/fml/task_runner.h index 20ea85e4e521b..3b3d2de01639d 100644 --- a/fml/task_runner.h +++ b/fml/task_runner.h @@ -13,7 +13,7 @@ namespace fml { class MessageLoopImpl; -class TaskRunner : public fxl::TaskRunner { +class TaskRunner final : public fxl::TaskRunner { public: void PostTask(fxl::Closure task) override; @@ -23,12 +23,15 @@ class TaskRunner : public fxl::TaskRunner { bool RunsTasksOnCurrentThread() override; + static void RunNowOrPostTask(fxl::RefPtr runner, + fxl::Closure task); + private: fxl::RefPtr loop_; TaskRunner(fxl::RefPtr loop); - ~TaskRunner(); + ~TaskRunner() override; FRIEND_MAKE_REF_COUNTED(TaskRunner); FRIEND_REF_COUNTED_THREAD_SAFE(TaskRunner); diff --git a/fml/thread.cc b/fml/thread.cc index a1500bfef46a4..de4ee6dd368a8 100644 --- a/fml/thread.cc +++ b/fml/thread.cc @@ -2,6 +2,8 @@ // 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/thread.h" #include "lib/fxl/build_config.h" @@ -22,7 +24,7 @@ namespace fml { Thread::Thread(const std::string& name) : joined_(false) { fxl::AutoResetWaitableEvent latch; - fxl::RefPtr runner; + fxl::RefPtr runner; thread_ = std::make_unique([&latch, &runner, name]() -> void { SetCurrentThreadName(name); fml::MessageLoop::EnsureInitializedForCurrentThread(); @@ -39,7 +41,7 @@ Thread::~Thread() { Join(); } -fxl::RefPtr Thread::GetTaskRunner() const { +fxl::RefPtr Thread::GetTaskRunner() const { return task_runner_; } @@ -84,7 +86,8 @@ void Thread::SetCurrentThreadName(const std::string& name) { } __except (EXCEPTION_CONTINUE_EXECUTION) { } #else -#error Unsupported Platform + FXL_DLOG(INFO) << "Could not set the thread name to '" << name + << "' on this platform."; #endif } diff --git a/fml/thread.h b/fml/thread.h index 44062f1032116..542871f788845 100644 --- a/fml/thread.h +++ b/fml/thread.h @@ -9,8 +9,8 @@ #include #include +#include "flutter/fml/task_runner.h" #include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" namespace fml { @@ -20,13 +20,13 @@ class Thread { ~Thread(); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; void Join(); private: std::unique_ptr thread_; - fxl::RefPtr task_runner_; + fxl::RefPtr task_runner_; std::atomic_bool joined_; static void SetCurrentThreadName(const std::string& name); diff --git a/fml/unique_fd.cc b/fml/unique_fd.cc new file mode 100644 index 0000000000000..bab79f7a9b743 --- /dev/null +++ b/fml/unique_fd.cc @@ -0,0 +1,35 @@ +// Copyright 2018 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/unique_fd.h" + +#include "lib/fxl/files/eintr_wrapper.h" + +namespace fml { +namespace internal { + +#if OS_WIN + +namespace win { + +void UniqueFDTraits::Free(HANDLE fd) { + CloseHandle(fd); +} + +} // namespace win + +#else // OS_WIN + +namespace unix { + +void UniqueFDTraits::Free(int fd) { + IGNORE_EINTR(fd); +} + +} // namespace unix + +#endif // OS_WIN + +} // namespace internal +} // namespace fml diff --git a/fml/unique_fd.h b/fml/unique_fd.h new file mode 100644 index 0000000000000..9f2d796579d8c --- /dev/null +++ b/fml/unique_fd.h @@ -0,0 +1,60 @@ +// Copyright 2018 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_UNIQUE_FD_H_ +#define FLUTTER_FML_UNIQUE_FD_H_ + +#include "flutter/fml/unique_object.h" +#include "lib/fxl/build_config.h" + +#if OS_WIN + +#include + +#endif // OS_WIN + +namespace fml { +namespace internal { + +#if OS_WIN + +namespace win { + +struct UniqueFDTraits { + static HANDLE InvalidValue() { return INVALID_HANDLE_VALUE; } + static bool IsValid(HANDLE value) { return value != InvalidValue(); } + static void Free(HANDLE fd); +}; + +} // namespace win + +#else // OS_WIN + +namespace unix { + +struct UniqueFDTraits { + static int InvalidValue() { return -1; } + static bool IsValid(int value) { return value >= 0; } + static void Free(int fd); +}; + +} // namespace unix + +#endif // OS_WIN + +} // namespace internal + +#if OS_WIN + +using UniqueFD = UniqueObject; + +#else // OS_WIN + +using UniqueFD = UniqueObject; + +#endif // OS_WIN + +} // namespace fml + +#endif // FLUTTER_FML_UNIQUE_FD_H_ diff --git a/fml/unique_object.h b/fml/unique_object.h new file mode 100644 index 0000000000000..e2487a53881a9 --- /dev/null +++ b/fml/unique_object.h @@ -0,0 +1,137 @@ +// Copyright 2018 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_UNIQUE_OBJECT_H_ +#define FLUTTER_FML_UNIQUE_OBJECT_H_ + +#include + +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" + +namespace fml { + +// struct UniqueFooTraits { +// // This function should be fast an inline. +// static int InvalidValue() { return 0; } +// +// // This function should be fast an inline. +// static bool IsValid(const T& value) { return value != InvalidValue(); } +// +// // This free function will not be called if f == InvalidValue()! +// static void Free(int f) { ::FreeFoo(f); } +// }; + +template +class UniqueObject { + private: + // This must be first since it's used inline below. + // + // Use the empty base class optimization to allow us to have a Traits + // member, while avoiding any space overhead for it when Traits is an + // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good + // discussion of this technique. + struct Data : public Traits { + explicit Data(const T& in) : generic(in) {} + Data(const T& in, const Traits& other) : Traits(other), generic(in) {} + + T generic; + }; + + public: + using element_type = T; + using traits_type = Traits; + + UniqueObject() : data_(Traits::InvalidValue()) {} + explicit UniqueObject(const T& value) : data_(value) {} + + UniqueObject(const T& value, const Traits& traits) : data_(value, traits) {} + + UniqueObject(UniqueObject&& other) + : data_(other.release(), other.get_traits()) {} + + ~UniqueObject() { FreeIfNecessary(); } + + UniqueObject& operator=(UniqueObject&& other) { + reset(other.release()); + return *this; + } + + void reset(const T& value = Traits::InvalidValue()) { + FXL_CHECK(data_.generic == Traits::InvalidValue() || + data_.generic != value); + FreeIfNecessary(); + data_.generic = value; + } + + void swap(UniqueObject& other) { + // Standard swap idiom: 'using std::swap' ensures that std::swap is + // present in the overload set, but we call swap unqualified so that + // any more-specific overloads can be used, if available. + using std::swap; + swap(static_cast(data_), static_cast(other.data_)); + swap(data_.generic, other.data_.generic); + } + + // Release the object. The return value is the current object held by this + // object. After this operation, this object will hold an invalid value, and + // will not own the object any more. + T release() FXL_WARN_UNUSED_RESULT { + T old_generic = data_.generic; + data_.generic = Traits::InvalidValue(); + return old_generic; + } + + const T& get() const { return data_.generic; } + + bool is_valid() const { return Traits::IsValid(data_.generic); } + + bool operator==(const T& value) const { return data_.generic == value; } + + bool operator!=(const T& value) const { return data_.generic != value; } + + Traits& get_traits() { return data_; } + const Traits& get_traits() const { return data_; } + + private: + void FreeIfNecessary() { + if (data_.generic != Traits::InvalidValue()) { + data_.Free(data_.generic); + data_.generic = Traits::InvalidValue(); + } + } + + // Forbid comparison. If U != T, it totally doesn't make sense, and if U == + // T, it still doesn't make sense because you should never have the same + // object owned by two different UniqueObject. + template + bool operator==(const UniqueObject& p2) const = delete; + + template + bool operator!=(const UniqueObject& p2) const = delete; + + Data data_; + + FXL_DISALLOW_COPY_AND_ASSIGN(UniqueObject); +}; + +template +void swap(const UniqueObject& a, const UniqueObject& b) { + a.swap(b); +} + +template +bool operator==(const T& value, const UniqueObject& object) { + return value == object.get(); +} + +template +bool operator!=(const T& value, const UniqueObject& object) { + return !(value == object.get()); +} + +} // namespace fml + +#endif // FLUTTER_FML_UNIQUE_OBJECT_H_ diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 2b53ffc4d4f6d..8c568f4773c90 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -29,20 +29,40 @@ if (is_fuchsia) { # The sole purpose of this target is to generate a .packages file. sources = [] - infer_package_name = true + dot_packages_file = "$target_gen_dir/snapshot.packages" + outputs = [ + dot_packages_file, + ] + deps = [] + foreach(dep, dart_deps) { + deps += [ "$dep($dart_toolchain)" ] + } disable_analysis = true - deps = [ - "//topaz/public/dart/fuchsia", - "//topaz/public/dart/zircon", - ] + script = "//build/dart/gen_dot_packages.py" + args = [ + "--out", + rebase_path(dot_packages_file, root_build_dir), + "--source-dir", + rebase_path("."), + "--root-build-dir", + rebase_path(root_build_dir), + "--root-gen-dir", + rebase_path(dart_root_gen_dir), + "--package-name", + "snapshot_root", + "--depfile", + rebase_path(depfile), + "--deps", + ] + dart_deps } } action("generate_snapshot_bin") { if (is_fuchsia) { snapshot_dart = "snapshot_fuchsia.dart" + # TODO(rmacnak): Fuchsia cross builds use the wrong Dart target # architecture, and have added steps that depend on this error for # reasonable build times (e.g., invoking the analyzer). @@ -85,9 +105,9 @@ action("generate_snapshot_bin") { rebased_dart_ui_path = rebase_path(dart_ui_path) - gen_snapshot_dir = - get_label_info("//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", - "root_out_dir") + gen_snapshot_dir = get_label_info( + "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", + "root_out_dir") script = "//third_party/dart/runtime/tools/create_snapshot_bin.py" args = [ @@ -209,7 +229,7 @@ bin_to_assembly("isolate_snapshot_data_assembly") { ] input = "$target_gen_dir/isolate_snapshot.bin" output = "$target_gen_dir/isolate_snapshot_data.S" - symbol = "kDartIsolateCoreSnapshotData" + symbol = "kDartIsolateSnapshotData" executable = false } @@ -219,7 +239,7 @@ bin_to_assembly("isolate_snapshot_instructions_assembly") { ] input = "$target_gen_dir/isolate_snapshot_instructions.bin" output = "$target_gen_dir/isolate_snapshot_instructions.S" - symbol = "kDartIsolateCoreSnapshotInstructions" + symbol = "kDartIsolateSnapshotInstructions" executable = true } @@ -249,9 +269,9 @@ compile_platform("non_strong_platform") { ] args = [ - "--target=flutter", - "dart:core", - ] + "--target=flutter", + "dart:core", + ] } compile_platform("strong_platform") { @@ -265,10 +285,10 @@ compile_platform("strong_platform") { ] args = [ - "--target=flutter", - "--strong", - "dart:core" - ] + "--target=flutter", + "--strong", + "dart:core", + ] } group("kernel_platform_files") { diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 8b3be72d5973b..6a75cd22c8614 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -40,14 +40,10 @@ source_set("ui") { "painting/picture.h", "painting/picture_recorder.cc", "painting/picture_recorder.h", - "painting/resource_context.cc", - "painting/resource_context.h", "painting/rrect.cc", "painting/rrect.h", "painting/shader.cc", "painting/shader.h", - "painting/utils.cc", - "painting/utils.h", "painting/vertices.cc", "painting/vertices.h", "semantics/semantics_node.cc", @@ -87,19 +83,18 @@ source_set("ui") { "window/window.h", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] deps = [ - "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", + "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/runtime:test_font", "$flutter_root/sky/engine", "$flutter_root/third_party/txt", + "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", diff --git a/lib/ui/compositing/scene_builder.cc b/lib/ui/compositing/scene_builder.cc index 006826abbfdf6..60b911cb4ddec 100644 --- a/lib/ui/compositing/scene_builder.cc +++ b/lib/ui/compositing/scene_builder.cc @@ -120,10 +120,11 @@ void SceneBuilder::addPicture(double dx, double dy, Picture* picture, int hints) { - layer_builder_->PushPicture(SkPoint::Make(dx, dy), // - picture->picture(), // - !!(hints & 1), // picture is complex - !!(hints & 2) // picture will change + layer_builder_->PushPicture( + SkPoint::Make(dx, dy), // + UIDartState::CreateGPUObject(picture->picture()), // + !!(hints & 1), // picture is complex + !!(hints & 2) // picture will change ); } diff --git a/lib/ui/compositing/scene_host.cc b/lib/ui/compositing/scene_host.cc index c0e4c5332580a..f5e0cfb3547d8 100644 --- a/lib/ui/compositing/scene_host.cc +++ b/lib/ui/compositing/scene_host.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/compositing/scene_host.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" @@ -37,8 +38,9 @@ fxl::RefPtr SceneHost::create( } SceneHost::SceneHost(fxl::RefPtr export_token_handle) { - export_node_holder_ = - fxl::MakeRefCounted(export_token_handle); + export_node_holder_ = fxl::MakeRefCounted( + blink::UIDartState::Current()->GetTaskRunners().GetGPUTaskRunner(), + export_token_handle); } #else fxl::RefPtr SceneHost::create(Dart_Handle export_token_handle) { diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index edd51245b05db..32a244c9cb67d 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -8,7 +8,11 @@ #include #include +#include +#include + #include "flutter/common/settings.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/tonic/converter/dart_converter.h" @@ -141,17 +145,43 @@ void DartRuntimeHooks::Install(IsolateType isolate_type, // Implementation of native functions which are used for some // test/debug functionality in standalone dart mode. void Logger_PrintString(Dart_NativeArguments args) { - intptr_t length = 0; - uint8_t* chars = nullptr; - Dart_Handle str = Dart_GetNativeArgument(args, 0); - Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); - if (Dart_IsError(result)) { - Dart_PropagateError(result); - } else { + std::stringstream stream; + const auto& logger_prefix = UIDartState::Current()->logger_prefix(); + +#if !OS(ANDROID) + // Prepend all logs with the isolate debug name except on Android where that + // prefix is specified in the log tag. + if (logger_prefix.size() > 0) { + stream << logger_prefix << ": "; + } +#endif // !OS(ANDROID) + + // Append the log buffer obtained from Dart code. + { + Dart_Handle str = Dart_GetNativeArgument(args, 0); + uint8_t* chars = nullptr; + intptr_t length = 0; + Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); + if (Dart_IsError(result)) { + Dart_PropagateError(result); + return; + } + if (length > 0) { + stream << std::string{reinterpret_cast(chars), + static_cast(length)}; + } + } + + const auto log_string = stream.str(); + const char* chars = log_string.c_str(); + const size_t length = log_string.size(); + + // Log using platform specific mechanisms + { #if defined(OS_ANDROID) // Write to the logcat on Android. - const char* tag = Settings::Get().log_tag.c_str(); - __android_log_print(ANDROID_LOG_INFO, tag, "%.*s", (int)length, chars); + __android_log_print(ANDROID_LOG_INFO, logger_prefix.c_str(), "%.*s", + (int)length, chars); #elif defined(OS_IOS) // Write to syslog on iOS. // @@ -159,26 +189,22 @@ void Logger_PrintString(Dart_NativeArguments args) { // iOS logging APIs altogether. syslog(1 /* LOG_ALERT */, "%.*s", (int)length, chars); #else - // On Fuchsia and in flutter_tester (on both macOS and Linux), write - // directly to stdout. - fwrite(chars, 1, length, stdout); - fputs("\n", stdout); - fflush(stdout); + std::cout << log_string << std::endl; #endif } + if (dart::bin::ShouldCaptureStdout()) { // For now we report print output on the Stdout stream. uint8_t newline[] = {'\n'}; - Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length); + Dart_ServiceSendDataEvent("Stdout", "WriteEvent", + reinterpret_cast(chars), length); Dart_ServiceSendDataEvent("Stdout", "WriteEvent", newline, sizeof(newline)); } } void ScheduleMicrotask(Dart_NativeArguments args) { Dart_Handle closure = Dart_GetNativeArgument(args, 0); - if (LogIfError(closure) || !Dart_IsClosure(closure)) - return; - tonic::DartMicrotaskQueue::GetForCurrentThread()->ScheduleMicrotask(closure); + UIDartState::Current()->ScheduleMicrotask(closure); } } // namespace blink diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 3e47ba86d50a5..758a722b409e2 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -4,11 +4,11 @@ #include "flutter/lib/ui/painting/codec.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/frame_info.h" -#include "flutter/lib/ui/painting/resource_context.h" #include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/logging.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" #include "lib/tonic/dart_state.h" @@ -17,6 +17,10 @@ #include "third_party/skia/include/codec/SkCodec.h" #include "third_party/skia/include/core/SkPixelRef.h" +#ifdef ERROR +#undef ERROR +#endif + using tonic::DartInvoke; using tonic::DartPersistentValue; using tonic::ToDart; @@ -28,9 +32,9 @@ namespace { static constexpr const char* kInitCodecTraceTag = "InitCodec"; static constexpr const char* kCodecNextFrameTraceTag = "CodecNextFrame"; -void InvokeCodecCallback(fxl::RefPtr codec, - std::unique_ptr callback, - size_t trace_id) { +static void InvokeCodecCallback(fxl::RefPtr codec, + std::unique_ptr callback, + size_t trace_id) { tonic::DartState* dart_state = callback->dart_state().get(); if (!dart_state) { TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); @@ -45,7 +49,9 @@ void InvokeCodecCallback(fxl::RefPtr codec, TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); } -sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { +static sk_sp DecodeImage(fml::WeakPtr context, + sk_sp buffer, + size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("flutter", "DecodeImage"); @@ -53,13 +59,11 @@ sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { return nullptr; } - std::unique_ptr resourceContext = ResourceContext::Acquire(); - GrContext* context = resourceContext->Get(); if (context) { // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromEncoded(context, std::move(buffer), - false, dstColorSpace.get()); + return SkImage::MakeCrossContextFromEncoded( + context.get(), std::move(buffer), false, dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -68,7 +72,10 @@ sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { } } -fxl::RefPtr InitCodec(sk_sp buffer, size_t trace_id) { +fxl::RefPtr InitCodec(fml::WeakPtr context, + sk_sp buffer, + fxl::RefPtr unref_queue, + size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("blink", "InitCodec"); @@ -86,27 +93,31 @@ fxl::RefPtr InitCodec(sk_sp buffer, size_t trace_id) { if (skCodec->getFrameCount() > 1) { return fxl::MakeRefCounted(std::move(skCodec)); } - auto skImage = DecodeImage(buffer, trace_id); + auto skImage = DecodeImage(context, buffer, trace_id); if (!skImage) { FXL_LOG(ERROR) << "DecodeImage failed"; return nullptr; } auto image = CanvasImage::Create(); - image->set_image(skImage); + image->set_image({skImage, unref_queue}); auto frameInfo = fxl::MakeRefCounted(std::move(image), 0); return fxl::MakeRefCounted(std::move(frameInfo)); } void InitCodecAndInvokeCodecCallback( + fxl::RefPtr ui_task_runner, + fml::WeakPtr context, + fxl::RefPtr unref_queue, std::unique_ptr callback, sk_sp buffer, size_t trace_id) { - auto codec = InitCodec(std::move(buffer), trace_id); - Threads::UI()->PostTask(fxl::MakeCopyable([ - callback = std::move(callback), codec = std::move(codec), trace_id - ]() mutable { - InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); - })); + auto codec = + InitCodec(context, std::move(buffer), std::move(unref_queue), trace_id); + ui_task_runner->PostTask( + fxl::MakeCopyable([callback = std::move(callback), + codec = std::move(codec), trace_id]() mutable { + InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); + })); } void InstantiateImageCodec(Dart_NativeArguments args) { @@ -133,14 +144,20 @@ void InstantiateImageCodec(Dart_NativeArguments args) { auto buffer = SkData::MakeWithCopy(list.data(), list.num_elements()); - Threads::IO()->PostTask(fxl::MakeCopyable([ - callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - buffer = std::move(buffer), trace_id - ]() mutable { - InitCodecAndInvokeCodecCallback(std::move(callback), std::move(buffer), - trace_id); - })); + auto dart_state = UIDartState::Current(); + + const auto& task_runners = dart_state->GetTaskRunners(); + task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( + [callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + buffer = std::move(buffer), trace_id, + ui_task_runner = task_runners.GetUITaskRunner(), + context = dart_state->GetResourceContext(), + queue = UIDartState::Current()->GetSkiaUnrefQueue()]() mutable { + InitCodecAndInvokeCodecCallback(std::move(ui_task_runner), context, + std::move(queue), std::move(callback), + std::move(buffer), trace_id); + })); } bool copy_to(SkBitmap* dst, SkColorType dstColorType, const SkBitmap& src) { @@ -213,7 +230,8 @@ MultiFrameCodec::MultiFrameCodec(std::unique_ptr codec) nextFrameIndex_ = 0; } -sk_sp MultiFrameCodec::GetNextFrameImage() { +sk_sp MultiFrameCodec::GetNextFrameImage( + fml::WeakPtr resourceContext) { SkBitmap& bitmap = frameBitmaps_[nextFrameIndex_]; if (!bitmap.getPixels()) { // We haven't decoded this frame yet const SkImageInfo info = codec_->getInfo().makeColorType(kN32_SkColorType); @@ -245,15 +263,13 @@ sk_sp MultiFrameCodec::GetNextFrameImage() { } } - std::unique_ptr resourceContext = ResourceContext::Acquire(); - GrContext* context = resourceContext->Get(); - if (context) { + if (resourceContext) { SkPixmap pixmap(bitmap.info(), bitmap.pixelRef()->pixels(), bitmap.pixelRef()->rowBytes()); // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromPixmap(context, pixmap, false, - dstColorSpace.get()); + return SkImage::MakeCrossContextFromPixmap(resourceContext.get(), pixmap, + false, dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -264,19 +280,22 @@ sk_sp MultiFrameCodec::GetNextFrameImage() { void MultiFrameCodec::GetNextFrameAndInvokeCallback( std::unique_ptr callback, + fxl::RefPtr ui_task_runner, + fml::WeakPtr resourceContext, + fxl::RefPtr unref_queue, size_t trace_id) { fxl::RefPtr frameInfo = NULL; - sk_sp skImage = GetNextFrameImage(); + sk_sp skImage = GetNextFrameImage(resourceContext); if (skImage) { fxl::RefPtr image = CanvasImage::Create(); - image->set_image(skImage); + image->set_image({skImage, std::move(unref_queue)}); frameInfo = fxl::MakeRefCounted( std::move(image), frameInfos_[nextFrameIndex_].fDuration); } nextFrameIndex_ = (nextFrameIndex_ + 1) % frameInfos_.size(); - Threads::UI()->PostTask(fxl::MakeCopyable( - [ callback = std::move(callback), frameInfo, trace_id ]() mutable { + ui_task_runner->PostTask(fxl::MakeCopyable( + [callback = std::move(callback), frameInfo, trace_id]() mutable { InvokeNextFrameCallback(frameInfo, std::move(callback), trace_id); })); @@ -293,13 +312,20 @@ Dart_Handle MultiFrameCodec::getNextFrame(Dart_Handle callback_handle) { return ToDart("Callback must be a function"); } - Threads::IO()->PostTask(fxl::MakeCopyable([ - callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - this, trace_id - ]() mutable { - GetNextFrameAndInvokeCallback(std::move(callback), trace_id); - })); + auto dart_state = UIDartState::Current(); + + const auto& task_runners = dart_state->GetTaskRunners(); + + task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( + [callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + this, trace_id, ui_task_runner = task_runners.GetUITaskRunner(), + queue = UIDartState::Current()->GetSkiaUnrefQueue(), + context = dart_state->GetResourceContext()]() mutable { + GetNextFrameAndInvokeCallback(std::move(callback), + std::move(ui_task_runner), context, + std::move(queue), trace_id); + })); return Dart_Null(); } diff --git a/lib/ui/painting/codec.h b/lib/ui/painting/codec.h index 98e5bc56df375..9fdce1a8c1a33 100644 --- a/lib/ui/painting/codec.h +++ b/lib/ui/painting/codec.h @@ -43,11 +43,16 @@ class MultiFrameCodec : public Codec { private: MultiFrameCodec(std::unique_ptr codec); + ~MultiFrameCodec() {} - sk_sp GetNextFrameImage(); + sk_sp GetNextFrameImage(fml::WeakPtr resourceContext); + void GetNextFrameAndInvokeCallback( std::unique_ptr callback, + fxl::RefPtr ui_task_runner, + fml::WeakPtr resourceContext, + fxl::RefPtr unref_queue, size_t trace_id); const std::unique_ptr codec_; diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index f6bb864627740..52ccd63f3f5d3 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -48,10 +48,10 @@ void CanvasGradient::initLinear(const tonic::Float32List& end_points, static_assert(sizeof(SkColor) == sizeof(int32_t), "SkColor doesn't use int32_t."); - set_shader(SkGradientShader::MakeLinear( + set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeLinear( reinterpret_cast(end_points.data()), reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode)); + colors.num_elements(), tile_mode))); } void CanvasGradient::initRadial(double center_x, @@ -73,14 +73,14 @@ void CanvasGradient::initRadial(double center_x, sk_matrix = ToSkMatrix(matrix4); } - set_shader(SkGradientShader::MakeRadial( + set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeRadial( SkPoint::Make(center_x, center_y), radius, reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr)); + colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr))); } -CanvasGradient::CanvasGradient() : Shader(nullptr) {} +CanvasGradient::CanvasGradient() = default; -CanvasGradient::~CanvasGradient() {} +CanvasGradient::~CanvasGradient() = default; } // namespace blink diff --git a/lib/ui/painting/image.cc b/lib/ui/painting/image.cc index 42e733241c990..a1b9b45cdc863 100644 --- a/lib/ui/painting/image.cc +++ b/lib/ui/painting/image.cc @@ -4,9 +4,7 @@ #include "flutter/lib/ui/painting/image.h" -#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/image_encoding.h" -#include "flutter/lib/ui/painting/utils.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -30,13 +28,9 @@ void CanvasImage::RegisterNatives(tonic::DartLibraryNatives* natives) { natives->Register({FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -CanvasImage::CanvasImage() {} +CanvasImage::CanvasImage() = default; -CanvasImage::~CanvasImage() { - // Skia objects must be deleted on the IO thread so that any associated GL - // objects will be cleaned up through the IO thread's GL context. - SkiaUnrefOnIOThread(&image_); -} +CanvasImage::~CanvasImage() = default; Dart_Handle CanvasImage::toByteData(int format, int quality, @@ -49,8 +43,8 @@ void CanvasImage::dispose() { } size_t CanvasImage::GetAllocationSize() { - if (image_) { - return image_->width() * image_->height() * 4; + if (auto image = image_.get()) { + return image->width() * image->height() * 4; } else { return sizeof(CanvasImage); } diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index a7ed4298506f5..aeec2a0149c73 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -5,6 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_H_ #define FLUTTER_LIB_UI_PAINTING_IMAGE_H_ +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkImage.h" @@ -25,13 +27,18 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, return fxl::MakeRefCounted(); } - int width() { return image_->width(); } - int height() { return image_->height(); } + int width() { return image_.get()->width(); } + + int height() { return image_.get()->height(); } + Dart_Handle toByteData(int format, int quality, Dart_Handle callback); + void dispose(); - const sk_sp& image() const { return image_; } - void set_image(sk_sp image) { image_ = std::move(image); } + sk_sp image() const { return image_.get(); } + void set_image(flow::SkiaGPUObject image) { + image_ = std::move(image); + } virtual size_t GetAllocationSize() override; @@ -40,7 +47,7 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, private: CanvasImage(); - sk_sp image_; + flow::SkiaGPUObject image_; }; } // namespace blink diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index f356e955f6745..f010fce893d3e 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -4,13 +4,15 @@ #include "flutter/lib/ui/painting/image_encoding.h" -#include "flutter/common/threads.h" +#include +#include + +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/painting/image.h" -#include "flutter/lib/ui/painting/resource_context.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_persistent_value.h" -#include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_invoke.h" #include "lib/tonic/typed_data/uint8_list.h" #include "third_party/skia/include/core/SkEncodedImageFormat.h" @@ -52,10 +54,11 @@ void EncodeImageAndInvokeDataCallback( std::unique_ptr callback, sk_sp image, SkEncodedImageFormat format, - int quality) { + int quality, + fxl::RefPtr ui_task_runner) { sk_sp encoded = EncodeImage(std::move(image), format, quality); - Threads::UI()->PostTask( + ui_task_runner->PostTask( fxl::MakeCopyable([callback = std::move(callback), encoded]() mutable { InvokeDataCallback(std::move(callback), std::move(encoded)); })); @@ -101,10 +104,14 @@ Dart_Handle EncodeImage(CanvasImage* canvas_image, tonic::DartState::Current(), callback_handle); sk_sp image = canvas_image->image(); - Threads::IO()->PostTask(fxl::MakeCopyable( - [callback = std::move(callback), image, image_format, quality]() mutable { + const auto& task_runners = UIDartState::Current()->GetTaskRunners(); + + task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( + [callback = std::move(callback), image, image_format, quality, + ui_task_runner = task_runners.GetUITaskRunner()]() mutable { EncodeImageAndInvokeDataCallback(std::move(callback), std::move(image), - image_format, quality); + image_format, quality, + std::move(ui_task_runner)); })); return Dart_Null(); diff --git a/lib/ui/painting/image_shader.cc b/lib/ui/painting/image_shader.cc index 0fabd134c737c..a4ddbba0ea24b 100644 --- a/lib/ui/painting/image_shader.cc +++ b/lib/ui/painting/image_shader.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/painting/image_shader.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -37,15 +38,17 @@ void ImageShader::initWithImage(CanvasImage* image, SkShader::TileMode tmx, SkShader::TileMode tmy, const tonic::Float64List& matrix4) { - if (!image) + if (!image) { Dart_ThrowException( ToDart("ImageShader constructor called with non-genuine Image.")); + } SkMatrix sk_matrix = ToSkMatrix(matrix4); - set_shader(image->image()->makeShader(tmx, tmy, &sk_matrix)); + set_shader(UIDartState::CreateGPUObject( + image->image()->makeShader(tmx, tmy, &sk_matrix))); } -ImageShader::ImageShader() : Shader(nullptr) {} +ImageShader::ImageShader() = default; -ImageShader::~ImageShader() {} +ImageShader::~ImageShader() = default; } // namespace blink diff --git a/lib/ui/painting/picture.cc b/lib/ui/painting/picture.cc index 89ddbf5f41bb0..34f92b8c315fd 100644 --- a/lib/ui/painting/picture.cc +++ b/lib/ui/painting/picture.cc @@ -4,9 +4,8 @@ #include "flutter/lib/ui/painting/picture.h" -#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/canvas.h" -#include "flutter/lib/ui/painting/utils.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -23,24 +22,20 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Picture); DART_BIND_ALL(Picture, FOR_EACH_BINDING) -fxl::RefPtr Picture::Create(sk_sp picture) { +fxl::RefPtr Picture::Create(flow::SkiaGPUObject picture) { return fxl::MakeRefCounted(std::move(picture)); } -Picture::Picture(sk_sp picture) : picture_(std::move(picture)) {} +Picture::Picture(flow::SkiaGPUObject picture) + : picture_(std::move(picture)) {} -Picture::~Picture() { - // Skia objects must be deleted on the IO thread so that any associated GL - // objects will be cleaned up through the IO thread's GL context. - SkiaUnrefOnIOThread(&picture_); -} +Picture::~Picture() = default; fxl::RefPtr Picture::toImage(int width, int height) { fxl::RefPtr image = CanvasImage::Create(); - // TODO(abarth): We should pass in an SkColorSpace at some point. - image->set_image(SkImage::MakeFromPicture( - picture_, SkISize::Make(width, height), nullptr, nullptr, - SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB())); + image->set_image(UIDartState::CreateGPUObject(SkImage::MakeFromPicture( + picture_.get(), SkISize::Make(width, height), nullptr, nullptr, + SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()))); return image; } @@ -49,8 +44,8 @@ void Picture::dispose() { } size_t Picture::GetAllocationSize() { - if (picture_) { - return picture_->approximateBytesUsed(); + if (auto picture = picture_.get()) { + return picture->approximateBytesUsed(); } else { return sizeof(Picture); } diff --git a/lib/ui/painting/picture.h b/lib/ui/painting/picture.h index 4a26d01c08374..d916086b02f02 100644 --- a/lib/ui/painting/picture.h +++ b/lib/ui/painting/picture.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_PAINTING_PICTURE_H_ #define FLUTTER_LIB_UI_PAINTING_PICTURE_H_ +#include "flutter/flow/skia_gpu_object.h" #include "flutter/lib/ui/painting/image.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkPicture.h" @@ -23,9 +24,9 @@ class Picture : public fxl::RefCountedThreadSafe, public: ~Picture() override; - static fxl::RefPtr Create(sk_sp picture); + static fxl::RefPtr Create(flow::SkiaGPUObject picture); - const sk_sp& picture() const { return picture_; } + sk_sp picture() const { return picture_.get(); } fxl::RefPtr toImage(int width, int height); @@ -36,9 +37,9 @@ class Picture : public fxl::RefCountedThreadSafe, static void RegisterNatives(tonic::DartLibraryNatives* natives); private: - explicit Picture(sk_sp picture); + explicit Picture(flow::SkiaGPUObject picture); - sk_sp picture_; + flow::SkiaGPUObject picture_; }; } // namespace blink diff --git a/lib/ui/painting/picture_recorder.cc b/lib/ui/painting/picture_recorder.cc index adc73c0043920..e870e400a7230 100644 --- a/lib/ui/painting/picture_recorder.cc +++ b/lib/ui/painting/picture_recorder.cc @@ -50,8 +50,9 @@ SkCanvas* PictureRecorder::BeginRecording(SkRect bounds) { fxl::RefPtr PictureRecorder::endRecording() { if (!isRecording()) return nullptr; - fxl::RefPtr picture = - Picture::Create(picture_recorder_.finishRecordingAsPicture()); + + fxl::RefPtr picture = Picture::Create(UIDartState::CreateGPUObject( + picture_recorder_.finishRecordingAsPicture())); canvas_->Clear(); canvas_->ClearDartWrapper(); canvas_ = nullptr; diff --git a/lib/ui/painting/resource_context.cc b/lib/ui/painting/resource_context.cc deleted file mode 100644 index 1b9f71548c15f..0000000000000 --- a/lib/ui/painting/resource_context.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/lib/ui/painting/resource_context.h" - -#include - -#include "lib/fxl/logging.h" - -namespace blink { -namespace { - -static GrContext* g_context = nullptr; -static std::mutex g_mutex; -static volatile bool g_freeze = false; - -} // namespace - -ResourceContext::ResourceContext() { - g_mutex.lock(); -} - -ResourceContext::~ResourceContext() { - g_mutex.unlock(); -} - -void ResourceContext::Set(sk_sp context) { - FXL_DCHECK(!g_context); - g_context = context.release(); -} - -GrContext* ResourceContext::Get() { - return g_freeze ? nullptr : g_context; -} - -std::unique_ptr ResourceContext::Acquire() { - return std::make_unique(); -} - -void ResourceContext::Freeze() { - std::lock_guard lock(g_mutex); - g_freeze = true; -} - -void ResourceContext::Unfreeze() { - std::lock_guard lock(g_mutex); - g_freeze = false; -} - -} // namespace blink diff --git a/lib/ui/painting/resource_context.h b/lib/ui/painting/resource_context.h deleted file mode 100644 index 627b2053c2df9..0000000000000 --- a/lib/ui/painting/resource_context.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ -#define FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ - -#include "lib/fxl/macros.h" -#include "third_party/skia/include/gpu/GrContext.h" - -namespace blink { - -class ResourceContext { - public: - /** - * Globally set the GrContext singleton instance. - */ - static void Set(sk_sp context); - - /** - * Acquire a GrContext wrapping ResourceContext that's also an exclusive mutex - * on GrContext operations. - * - * Destructing the ResourceContext frees the mutex. - */ - static std::unique_ptr Acquire(); - - /** - * Synchronously signal a freeze on GrContext operations. - * - * ResourceContext instances will return nullptr on GrContext Get until - * unfrozen. - */ - static void Freeze(); - - /** - * Synchronously unfreeze GrContext operations. - * - * ResourceContext instances will continue to return the global GrContext - * instance on Get. - */ - static void Unfreeze(); - - ResourceContext(); - ~ResourceContext(); - - /** - * Returns global GrContext instance. May return null when operations are - * frozen. - * - * Happens on iOS when background operations on GrContext are forbidden. - */ - GrContext* Get(); - - FXL_DISALLOW_COPY_AND_ASSIGN(ResourceContext); -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ diff --git a/lib/ui/painting/shader.cc b/lib/ui/painting/shader.cc index d7d8ccf20aefc..7999b84dfcc29 100644 --- a/lib/ui/painting/shader.cc +++ b/lib/ui/painting/shader.cc @@ -4,19 +4,15 @@ #include "flutter/lib/ui/painting/shader.h" -#include "flutter/common/threads.h" -#include "flutter/lib/ui/painting/utils.h" +#include "flutter/lib/ui/ui_dart_state.h" namespace blink { IMPLEMENT_WRAPPERTYPEINFO(ui, Shader); -Shader::Shader(sk_sp shader) : shader_(shader) {} +Shader::Shader(flow::SkiaGPUObject shader) + : shader_(std::move(shader)) {} -Shader::~Shader() { - // Skia objects must be deleted on the IO thread so that any associated GL - // objects will be cleaned up through the IO thread's GL context. - SkiaUnrefOnIOThread(&shader_); -} +Shader::~Shader() = default; } // namespace blink diff --git a/lib/ui/painting/shader.h b/lib/ui/painting/shader.h index 9c0f3c601db56..205197250eb84 100644 --- a/lib/ui/painting/shader.h +++ b/lib/ui/painting/shader.h @@ -5,6 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_SHADER_H_ #define FLUTTER_LIB_UI_PAINTING_SHADER_H_ +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkShader.h" @@ -18,14 +20,17 @@ class Shader : public fxl::RefCountedThreadSafe, public: ~Shader() override; - const sk_sp& shader() { return shader_; } - void set_shader(sk_sp shader) { shader_ = std::move(shader); } + sk_sp shader() { return shader_.get(); } + + void set_shader(flow::SkiaGPUObject shader) { + shader_ = std::move(shader); + } protected: - Shader(sk_sp shader); + Shader(flow::SkiaGPUObject shader = {}); private: - sk_sp shader_; + flow::SkiaGPUObject shader_; }; } // namespace blink diff --git a/lib/ui/painting/utils.cc b/lib/ui/painting/utils.cc deleted file mode 100644 index b3f87135ac0a8..0000000000000 --- a/lib/ui/painting/utils.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/lib/ui/painting/utils.h" -#include "flutter/common/threads.h" - -namespace blink { - -namespace { - -constexpr fxl::TimeDelta kDrainDelay = fxl::TimeDelta::FromMilliseconds(250); - -} // anonymous namespace - -SkiaUnrefQueue::SkiaUnrefQueue() : drain_pending_(false) {} - -SkiaUnrefQueue SkiaUnrefQueue::instance_; - -SkiaUnrefQueue& SkiaUnrefQueue::Get() { - return instance_; -} - -void SkiaUnrefQueue::Unref(SkRefCnt* object) { - std::lock_guard lock(mutex_); - objects_.push_back(object); - if (!drain_pending_) { - drain_pending_ = true; - Threads::IO()->PostDelayedTask([this] { Drain(); }, kDrainDelay); - } -} - -void SkiaUnrefQueue::Drain() { - std::deque skia_objects; - { - std::lock_guard lock(mutex_); - objects_.swap(skia_objects); - drain_pending_ = false; - } - - for (SkRefCnt* skia_object : skia_objects) { - skia_object->unref(); - } -} - -} // namespace blink diff --git a/lib/ui/painting/utils.h b/lib/ui/painting/utils.h deleted file mode 100644 index 02782c67962bc..0000000000000 --- a/lib/ui/painting/utils.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 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. - -#include "third_party/skia/include/core/SkRefCnt.h" - -#include -#include - -namespace blink { - -// A queue that holds Skia objects that must be destructed on the IO thread. -class SkiaUnrefQueue { - public: - static SkiaUnrefQueue& Get(); - - void Unref(SkRefCnt* object); - - private: - SkiaUnrefQueue(); - void Drain(); - - static SkiaUnrefQueue instance_; - - std::mutex mutex_; - std::deque objects_; - bool drain_pending_; -}; - -template -void SkiaUnrefOnIOThread(sk_sp* sp) { - T* object = sp->release(); - if (object) { - SkiaUnrefQueue::Get().Unref(object); - } -} - -} // namespace blink diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index d6407f9ed42e1..248468cc9701d 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -34,15 +34,9 @@ std::shared_ptr FontCollection::GetFontCollection() const { return collection_; } -void FontCollection::RegisterFontsFromAssetProvider( - fxl::RefPtr asset_provider) { - - if (!asset_provider){ - return; - } - +void FontCollection::RegisterFonts(const AssetManager& asset_manager) { std::vector manifest_data; - if (!asset_provider->GetAsBuffer("FontManifest.json", &manifest_data)) { + if (!asset_manager.GetAsBuffer("FontManifest.json", &manifest_data)) { FXL_DLOG(WARNING) << "Could not find the font manifest in the asset store."; return; } @@ -92,8 +86,8 @@ void FontCollection::RegisterFontsFromAssetProvider( // TODO: Handle weights and styles. std::vector font_data; - if (asset_provider->GetAsBuffer(font_asset->value.GetString(), - &font_data)) { + if (asset_manager.GetAsBuffer(font_asset->value.GetString(), + &font_data)) { // The data must be copied because it needs to be moved into the // typeface as a stream. auto data = diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index fb393b1582b79..ea9c2f46a96a0 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -7,10 +7,10 @@ #include #include -#include "flutter/assets/asset_provider.h" + +#include "flutter/assets/asset_manager.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" -#include "txt/asset_data_provider.h" #include "txt/font_collection.h" namespace blink { @@ -21,7 +21,8 @@ class FontCollection { std::shared_ptr GetFontCollection() const; - void RegisterFontsFromAssetProvider(fxl::RefPtr asset_provider); + void RegisterFonts(const AssetManager& asset_manager); + void RegisterTestFonts(); private: diff --git a/lib/ui/text/paragraph.cc b/lib/ui/text/paragraph.cc index 858ccd01d4ef6..fd00f6f51b3a3 100644 --- a/lib/ui/text/paragraph.cc +++ b/lib/ui/text/paragraph.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" #include "flutter/sky/engine/core/rendering/RenderParagraph.h" #include "flutter/sky/engine/core/rendering/RenderText.h" @@ -53,7 +53,8 @@ Paragraph::Paragraph(std::unique_ptr paragraph) Paragraph::~Paragraph() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + destruction_task_runner_->PostTask( + [renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph.h b/lib/ui/text/paragraph.h index 1b2019373553a..b3a943209ab4c 100644 --- a/lib/ui/text/paragraph.h +++ b/lib/ui/text/paragraph.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/paragraph_impl_blink.h" @@ -66,6 +67,10 @@ class Paragraph : public fxl::RefCountedThreadSafe, explicit Paragraph(std::unique_ptr paragraph); + // TODO: This can be removed when the render view association for the legacy + // runtime is removed. + fxl::RefPtr destruction_task_runner_ = + UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index 44d05053ba342..b987e3fde6272 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph_builder.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/sky/engine/core/rendering/RenderInline.h" @@ -205,9 +205,11 @@ fxl::RefPtr ParagraphBuilder::create( double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale) { - return fxl::MakeRefCounted(encoded, fontFamily, fontSize, - lineHeight, ellipsis, locale); + const std::string& locale, + bool use_blink) { + return fxl::MakeRefCounted( + encoded, fontFamily, fontSize, lineHeight, ellipsis, locale, + UIDartState::Current()->use_blink()); } ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, @@ -215,8 +217,10 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale) { - if (!Settings::Get().using_blink) { + const std::string& locale, + bool use_blink) + : m_useBlink(use_blink) { + if (!m_useBlink) { int32_t mask = encoded[0]; txt::ParagraphStyle style; if (mask & psTextAlignMask) @@ -275,7 +279,8 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, ParagraphBuilder::~ParagraphBuilder() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + destruction_task_runner_->PostTask( + [renderView]() { renderView->destroy(); }); } } @@ -290,7 +295,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, int32_t mask = encoded[0]; - if (!Settings::Get().using_blink) { + if (!m_useBlink) { // Set to use the properties of the previous style if the property is not // explicitly given. txt::TextStyle style = m_paragraphBuilder->PeekStyle(); @@ -423,7 +428,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, } void ParagraphBuilder::pop() { - if (!Settings::Get().using_blink) { + if (!m_useBlink) { m_paragraphBuilder->Pop(); } else { // Blink Version. @@ -445,7 +450,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { if (error_code != U_BUFFER_OVERFLOW_ERROR) return tonic::ToDart("string is not well-formed UTF-16"); - if (!Settings::Get().using_blink) { + if (!m_useBlink) { m_paragraphBuilder->AddText(text); } else { // Blink Version. @@ -464,7 +469,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { fxl::RefPtr ParagraphBuilder::build() { m_currentRenderObject = nullptr; - if (!Settings::Get().using_blink) { + if (!m_useBlink) { return Paragraph::Create(m_paragraphBuilder->Build()); } else { return Paragraph::Create(m_renderView.release()); diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 37a1e9a3e74cf..1c38d98696def 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -32,7 +32,8 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale); + const std::string& locale, + bool use_blink); ~ParagraphBuilder() override; @@ -58,14 +59,20 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale); + const std::string& locale, + bool use_blink); void createRenderView(); + // TODO: This can be removed when the render view association for the legacy + // runtime is removed. + fxl::RefPtr destruction_task_runner_ = + UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; RenderObject* m_renderParagraph; RenderObject* m_currentRenderObject; std::unique_ptr m_paragraphBuilder; + bool m_useBlink; }; } // namespace blink diff --git a/lib/ui/text/paragraph_impl_blink.cc b/lib/ui/text/paragraph_impl_blink.cc index c7752c0a7c757..5c50f047afa33 100644 --- a/lib/ui/text/paragraph_impl_blink.cc +++ b/lib/ui/text/paragraph_impl_blink.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/text/paragraph_impl_blink.h" -#include "flutter/common/threads.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" @@ -30,7 +29,8 @@ ParagraphImplBlink::ParagraphImplBlink(PassOwnPtr renderView) ParagraphImplBlink::~ParagraphImplBlink() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + destruction_task_runner_->PostTask( + [renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph_impl_blink.h b/lib/ui/text/paragraph_impl_blink.h index 79d89ad471962..ebd80f8dd5382 100644 --- a/lib/ui/text/paragraph_impl_blink.h +++ b/lib/ui/text/paragraph_impl_blink.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/text_box.h" @@ -41,6 +42,10 @@ class ParagraphImplBlink : public ParagraphImpl { int absoluteOffsetForPosition(const PositionWithAffinity& position); + // TODO: This can be removed when the render view association for the legacy + // runtime is removed. + fxl::RefPtr destruction_task_runner_ = + UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_impl_txt.cc b/lib/ui/text/paragraph_impl_txt.cc index de8d8ff0b2fc3..28c6ea19a8157 100644 --- a/lib/ui/text/paragraph_impl_txt.cc +++ b/lib/ui/text/paragraph_impl_txt.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/text/paragraph_impl_txt.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "lib/fxl/logging.h" diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 3bdf21e6a1a93..8ef7ca98fd758 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/window.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" #include "lib/tonic/converter/dart_converter.h" @@ -12,34 +13,44 @@ using tonic::ToDart; namespace blink { -IsolateClient::~IsolateClient() {} - -UIDartState::UIDartState(IsolateClient* isolate_client, - std::unique_ptr window, - int dirfd) - : tonic::DartState(dirfd), - isolate_client_(isolate_client), - main_port_(ILLEGAL_PORT), - window_(std::move(window)) {} +UIDartState::UIDartState(TaskRunners task_runners, + TaskObserverAdd add_callback, + TaskObserverRemove remove_callback, + fml::WeakPtr resource_context, + fxl::RefPtr skia_unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, + std::string logger_prefix) + : task_runners_(std::move(task_runners)), + add_callback_(std::move(add_callback)), + remove_callback_(std::move(remove_callback)), + resource_context_(std::move(resource_context)), + advisory_script_uri_(std::move(advisory_script_uri)), + advisory_script_entrypoint_(std::move(advisory_script_entrypoint)), + logger_prefix_(std::move(logger_prefix)), + skia_unref_queue_(std::move(skia_unref_queue)), + weak_factory_(this) { + AddOrRemoveTaskObserver(true /* add */); +} UIDartState::~UIDartState() { - main_port_ = ILLEGAL_PORT; - // We've already destroyed the isolate. Revoke any weak ptrs held by - // DartPersistentValues so they don't try to enter the destroyed isolate to - // clean themselves up. - // TODO(abarth): Can we do this work in the base class? - weak_factory_.InvalidateWeakPtrs(); + AddOrRemoveTaskObserver(false /* remove */); } -UIDartState* UIDartState::CreateForChildIsolate() { - return new UIDartState(isolate_client_, nullptr); +const std::string& UIDartState::GetAdvisoryScriptURI() const { + return advisory_script_uri_; +} + +const std::string& UIDartState::GetAdvisoryScriptEntrypoint() const { + return advisory_script_entrypoint_; } void UIDartState::DidSetIsolate() { - FXL_DCHECK(!debug_name_prefix_.empty()); main_port_ = Dart_GetMainPortId(); std::ostringstream debug_name; - debug_name << debug_name_prefix_ << "$main-" << main_port_; + // main.dart$main-1234 + debug_name << advisory_script_uri_ << "$" << advisory_script_entrypoint_ + << "-" << main_port_; debug_name_ = debug_name.str(); } @@ -55,8 +66,48 @@ PassRefPtr UIDartState::font_selector() { return font_selector_; } -void UIDartState::set_debug_name_prefix(const std::string& debug_name_prefix) { - debug_name_prefix_ = debug_name_prefix; +void UIDartState::SetWindow(std::unique_ptr window) { + window_ = std::move(window); +} + +const TaskRunners& UIDartState::GetTaskRunners() const { + return task_runners_; +} + +fxl::RefPtr UIDartState::GetSkiaUnrefQueue() const { + return skia_unref_queue_; +} + +void UIDartState::ScheduleMicrotask(Dart_Handle closure) { + if (tonic::LogIfError(closure) || !Dart_IsClosure(closure)) { + return; + } + + microtask_queue_.ScheduleMicrotask(closure); +} + +void UIDartState::FlushMicrotasksNow() { + microtask_queue_.RunMicrotasks(); +} + +void UIDartState::AddOrRemoveTaskObserver(bool add) { + auto task_runner = task_runners_.GetUITaskRunner(); + if (!task_runner) { + // This may happen in case the isolate has no thread affinity (for example, + // the service isolate). + return; + } + FXL_DCHECK(add_callback_ && remove_callback_); + if (add) { + add_callback_(reinterpret_cast(this), + [this]() { this->FlushMicrotasksNow(); }); + } else { + remove_callback_(reinterpret_cast(this)); + } +} + +fml::WeakPtr UIDartState::GetResourceContext() const { + return resource_context_; } } // namespace blink diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index 0f7f9343d4958..a5c78c1671815 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -5,65 +5,106 @@ #ifndef FLUTTER_LIB_UI_UI_DART_STATE_H_ #define FLUTTER_LIB_UI_UI_DART_STATE_H_ +#include +#include #include +#include "flutter/common/settings.h" +#include "flutter/common/task_runners.h" +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/sky/engine/wtf/RefPtr.h" #include "lib/fxl/build_config.h" +#include "lib/tonic/dart_microtask_queue.h" #include "lib/tonic/dart_persistent_value.h" #include "lib/tonic/dart_state.h" #include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/skia/include/gpu/GrContext.h" namespace blink { class FontSelector; class Window; -class IsolateClient { - public: - virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate) = 0; - virtual void DidShutdownMainIsolate() = 0; - - protected: - virtual ~IsolateClient(); -}; - class UIDartState : public tonic::DartState { public: - UIDartState(IsolateClient* isolate_client, - std::unique_ptr window, - int dirfd = -1); - ~UIDartState() override; - static UIDartState* Current(); - UIDartState* CreateForChildIsolate(); - - IsolateClient* isolate_client() const { return isolate_client_; } - void set_isolate_client(IsolateClient* isolate_client) { - isolate_client_ = isolate_client; - } Dart_Port main_port() const { return main_port_; } + const std::string& debug_name() const { return debug_name_; } + + const std::string& logger_prefix() const { return logger_prefix_; } + Window* window() const { return window_.get(); } - void set_debug_name_prefix(const std::string& debug_name_prefix); void set_font_selector(PassRefPtr selector); + PassRefPtr font_selector(); - bool is_controller_state() const { return is_controller_state_; } - void set_is_controller_state(bool value) { is_controller_state_ = value; } - bool shutting_down() const { return shutting_down_; } - void set_shutting_down(bool value) { shutting_down_ = value; } + + bool use_blink() const { return use_blink_; } + + const TaskRunners& GetTaskRunners() const; + + void ScheduleMicrotask(Dart_Handle handle); + + void FlushMicrotasksNow(); + + fxl::RefPtr GetSkiaUnrefQueue() const; + + fml::WeakPtr GetResourceContext() const; + + template + static flow::SkiaGPUObject CreateGPUObject(sk_sp object) { + if (!object) { + return {}; + } + auto state = UIDartState::Current(); + FXL_DCHECK(state); + auto queue = state->GetSkiaUnrefQueue(); + return {std::move(object), std::move(queue)}; + }; + + protected: + UIDartState(TaskRunners task_runners, + TaskObserverAdd add_callback, + TaskObserverRemove remove_callback, + fml::WeakPtr resource_context, + fxl::RefPtr skia_unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, + std::string logger_prefix); + + ~UIDartState() override; + + void SetWindow(std::unique_ptr window); + + void set_use_blink(bool use_blink) { use_blink_ = use_blink; } + + const std::string& GetAdvisoryScriptURI() const; + + const std::string& GetAdvisoryScriptEntrypoint() const; private: void DidSetIsolate() override; - IsolateClient* isolate_client_; - Dart_Port main_port_; - std::string debug_name_prefix_; + const TaskRunners task_runners_; + const TaskObserverAdd add_callback_; + const TaskObserverRemove remove_callback_; + fml::WeakPtr resource_context_; + const std::string advisory_script_uri_; + const std::string advisory_script_entrypoint_; + const std::string logger_prefix_; + Dart_Port main_port_ = ILLEGAL_PORT; std::string debug_name_; std::unique_ptr window_; RefPtr font_selector_; - bool is_controller_state_; - bool shutting_down_ = false; + fxl::RefPtr skia_unref_queue_; + tonic::DartMicrotaskQueue microtask_queue_; + fml::WeakPtrFactory weak_factory_; + + void AddOrRemoveTaskObserver(bool add); + + bool use_blink_ = false; }; } // namespace blink diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index 065159b79713b..2cca2fd179888 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -6,7 +6,7 @@ #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/window/window.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_state.h" @@ -43,12 +43,14 @@ Dart_Handle WrapByteData(std::vector data) { } // anonymous namespace PlatformMessageResponseDart::PlatformMessageResponseDart( - tonic::DartPersistentValue callback) - : callback_(std::move(callback)) {} + tonic::DartPersistentValue callback, + fxl::RefPtr ui_task_runner) + : callback_(std::move(callback)), + ui_task_runner_(std::move(ui_task_runner)) {} PlatformMessageResponseDart::~PlatformMessageResponseDart() { if (!callback_.is_empty()) { - Threads::UI()->PostTask( + ui_task_runner_->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { callback.Clear(); })); @@ -60,7 +62,7 @@ void PlatformMessageResponseDart::Complete(std::vector data) { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - Threads::UI()->PostTask(fxl::MakeCopyable( + ui_task_runner_->PostTask(fxl::MakeCopyable( [ callback = std::move(callback_), data = std::move(data) ]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) @@ -77,7 +79,7 @@ void PlatformMessageResponseDart::CompleteEmpty() { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - Threads::UI()->PostTask( + ui_task_runner_->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) diff --git a/lib/ui/window/platform_message_response_dart.h b/lib/ui/window/platform_message_response_dart.h index 51c55a930014b..67bfb3d359691 100644 --- a/lib/ui/window/platform_message_response_dart.h +++ b/lib/ui/window/platform_message_response_dart.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ #define FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/platform_message_response.h" #include "lib/tonic/dart_persistent_value.h" @@ -19,10 +20,13 @@ class PlatformMessageResponseDart : public PlatformMessageResponse { void CompleteEmpty() override; protected: - explicit PlatformMessageResponseDart(tonic::DartPersistentValue callback); + explicit PlatformMessageResponseDart( + tonic::DartPersistentValue callback, + fxl::RefPtr ui_task_runner); ~PlatformMessageResponseDart() override; tonic::DartPersistentValue callback_; + fxl::RefPtr ui_task_runner_; }; } // namespace blink diff --git a/lib/ui/window/viewport_metrics.h b/lib/ui/window/viewport_metrics.h index 1e443ae8c1404..5085d06f42724 100644 --- a/lib/ui/window/viewport_metrics.h +++ b/lib/ui/window/viewport_metrics.h @@ -23,6 +23,25 @@ struct ViewportMetrics { int32_t physical_view_inset_left = 0; }; +struct LogicalSize { + double width = 0.0; + double height = 0.0; +}; + +struct LogicalInset { + double left = 0.0; + double top = 0.0; + double right = 0.0; + double bottom = 0.0; +}; + +struct LogicalMetrics { + LogicalSize size; + double scale = 1.0; + LogicalInset padding; + LogicalInset view_inset; +}; + } // namespace blink #endif // FLUTTER_LIB_UI_WINDOW_VIEWPORT_METRICS_H_ diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index e12e03f10d01f..4cce1cc5903b0 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -63,7 +63,8 @@ void SendPlatformMessage(Dart_Handle window, fxl::RefPtr response; if (!Dart_IsNull(callback)) { response = fxl::MakeRefCounted( - tonic::DartPersistentValue(dart_state, callback)); + tonic::DartPersistentValue(dart_state, callback), + dart_state->GetTaskRunners().GetUITaskRunner()); } if (Dart_IsNull(data.dart_handle())) { UIDartState::Current()->window()->client()->HandlePlatformMessage( @@ -254,7 +255,7 @@ void Window::BeginFrame(fxl::TimePoint frameTime) { Dart_NewInteger(microseconds), }); - tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); + UIDartState::Current()->FlushMicrotasksNow(); DartInvokeField(library_.value(), "_drawFrame", {}); } diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index ef0d7ef863a0e..2feeccb65f9cc 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -13,6 +13,7 @@ #include "flutter/lib/ui/window/viewport_metrics.h" #include "lib/fxl/time/time_point.h" #include "lib/tonic/dart_persistent_value.h" +#include "third_party/skia/include/gpu/GrContext.h" namespace tonic { class DartLibraryNatives; @@ -35,12 +36,14 @@ class WindowClient { virtual ~WindowClient(); }; -class Window { +class Window final { public: explicit Window(WindowClient* client); + ~Window(); WindowClient* client() const { return client_; } + const ViewportMetrics& viewport_metrics() { return viewport_metrics_; } void DidCreateIsolate(); diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index dea8a8906d031..455d7e228168f 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -4,6 +4,7 @@ import("//third_party/dart/runtime/bin/vmservice/vmservice_sources.gni") import("$flutter_root/common/config.gni") +import("$flutter_root/testing/testing.gni") action("gen_embedded_resources_cc") { script = "//third_party/dart/runtime/tools/create_resources.py" @@ -37,9 +38,7 @@ source_set("embedded_resources_cc") { deps = [ ":gen_embedded_resources_cc", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } source_set("test_font") { @@ -50,9 +49,7 @@ source_set("test_font") { deps = [ "//third_party/skia", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] defines = [] if (flutter_runtime_mode == "debug" || current_toolchain == host_toolchain) { # Though the test font data is small, we dont want to add to the binary size @@ -63,16 +60,19 @@ source_set("test_font") { } source_set("runtime") { - sources = [ "asset_font_selector.cc", "asset_font_selector.h", - "dart_controller.cc", - "dart_controller.h", - "dart_init.cc", - "dart_init.h", + "dart_isolate.cc", + "dart_isolate.h", "dart_service_isolate.cc", "dart_service_isolate.h", + "dart_snapshot.cc", + "dart_snapshot.h", + "dart_snapshot_buffer.cc", + "dart_snapshot_buffer.h", + "dart_vm.cc", + "dart_vm.h", "embedder_resources.cc", "embedder_resources.h", "platform_impl.cc", @@ -81,8 +81,8 @@ source_set("runtime") { "runtime_controller.h", "runtime_delegate.cc", "runtime_delegate.h", - "runtime_init.cc", - "runtime_init.h", + "service_protocol.cc", + "service_protocol.h", "start_up.cc", "start_up.h", "test_font_selector.cc", @@ -92,25 +92,24 @@ source_set("runtime") { deps = [ ":embedded_resources_cc", ":test_font", - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", + "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/io", "$flutter_root/lib/ui", "$flutter_root/sky/engine/platform", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//topaz/lib/tonic", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] # In AOT mode, precompiled snapshots contain the instruction buffer. # Generation of the same requires all application specific script code to be @@ -119,3 +118,28 @@ source_set("runtime") { deps += [ "$flutter_root/lib/snapshot" ] } } + +test_fixtures("runtime_fixtures") { + fixtures = [ "fixtures/simple_main.dart" ] +} + +executable("runtime_unittests") { + testonly = true + + sources = [ + "dart_isolate_unittests.cc", + "dart_vm_unittests.cc", + ] + + deps = [ + ":runtime", + ":runtime_fixtures", + "$flutter_root/fml", + "$flutter_root/lib/snapshot", + "$flutter_root/testing", + "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", + "//third_party/skia", + "//topaz/lib/tonic", + ] +} diff --git a/runtime/asset_font_selector.cc b/runtime/asset_font_selector.cc index abf4bf9874ddd..2a43f39e3a89b 100644 --- a/runtime/asset_font_selector.cc +++ b/runtime/asset_font_selector.cc @@ -80,27 +80,15 @@ struct FontMatcher { } // namespace -void AssetFontSelector::Install( - fxl::RefPtr asset_provider) { +void AssetFontSelector::Install(fxl::RefPtr asset_manager) { RefPtr font_selector = - adoptRef(new AssetFontSelector(std::move(asset_provider))); + adoptRef(new AssetFontSelector(std::move(asset_manager))); font_selector->parseFontManifest(); UIDartState::Current()->set_font_selector(font_selector); } -void AssetFontSelector::Install(fxl::RefPtr asset_store) { - RefPtr font_selector = - adoptRef(new AssetFontSelector(std::move(asset_store))); - font_selector->parseFontManifest(); - UIDartState::Current()->set_font_selector(font_selector); -} - -AssetFontSelector::AssetFontSelector( - fxl::RefPtr asset_provider) - : asset_provider_(std::move(asset_provider)) {} - -AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_store) - : asset_store_(std::move(asset_store)) {} +AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_manager) + : asset_manager_(std::move(asset_manager)) {} AssetFontSelector::~AssetFontSelector() {} @@ -118,12 +106,9 @@ AssetFontSelector::FlutterFontAttributes::~FlutterFontAttributes() {} void AssetFontSelector::parseFontManifest() { std::vector font_manifest_data; - if (!asset_provider_ || - !asset_provider_->GetAsBuffer(kFontManifestAssetPath, - &font_manifest_data)) { - if (!asset_store_ || - !asset_store_->GetAsBuffer(kFontManifestAssetPath, &font_manifest_data)) - return; + if (!asset_manager_->GetAsBuffer(kFontManifestAssetPath, + &font_manifest_data)) { + return; } rapidjson::Document document; @@ -239,13 +224,8 @@ sk_sp AssetFontSelector::getTypefaceAsset( } std::unique_ptr typeface_asset(new TypefaceAsset); - if (!asset_provider_ || !asset_provider_->GetAsBuffer( - asset_path, &typeface_asset->data)) { - if (!asset_store_ || - !asset_store_->GetAsBuffer(asset_path, &typeface_asset->data)) { - typeface_cache_.insert(std::make_pair(asset_path, nullptr)); - return nullptr; - } + if (!asset_manager_->GetAsBuffer(asset_path, &typeface_asset->data)) { + return nullptr; } sk_sp font_mgr(SkFontMgr::RefDefault()); diff --git a/runtime/asset_font_selector.h b/runtime/asset_font_selector.h index 921c0472dba78..8d7e946d89e7e 100644 --- a/runtime/asset_font_selector.h +++ b/runtime/asset_font_selector.h @@ -8,7 +8,7 @@ #include #include -#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/asset_manager.h" #include "flutter/assets/zip_asset_store.h" #include "flutter/sky/engine/platform/fonts/FontCacheKey.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" @@ -24,11 +24,7 @@ class AssetFontSelector : public FontSelector { ~AssetFontSelector() override; - static void Install(fxl::RefPtr asset_provider); - - // TODO(zarah): Remove this and related code using asset_store once flx is - // removed. - static void Install(fxl::RefPtr asset_store); + static void Install(fxl::RefPtr asset_manager); PassRefPtr getFontData(const FontDescription& font_description, const AtomicString& family_name) override; @@ -44,19 +40,14 @@ class AssetFontSelector : public FontSelector { private: struct TypefaceAsset; - explicit AssetFontSelector( - fxl::RefPtr asset_provider); - - explicit AssetFontSelector(fxl::RefPtr asset_store); + explicit AssetFontSelector(fxl::RefPtr asset_manager); void parseFontManifest(); sk_sp getTypefaceAsset(const FontDescription& font_description, const AtomicString& family_name); - fxl::RefPtr asset_provider_; - - fxl::RefPtr asset_store_; + fxl::RefPtr asset_manager_; HashMap> font_family_map_; diff --git a/runtime/dart_controller.cc b/runtime/dart_controller.cc deleted file mode 100644 index 84cfceeaecc10..0000000000000 --- a/runtime/dart_controller.cc +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/runtime/dart_controller.h" -#include "lib/fxl/build_config.h" - -#if defined(OS_WIN) -#include -#undef GetCurrentDirectory -#endif - -#include - -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" -#include "flutter/glue/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "lib/fxl/files/directory.h" -#include "lib/fxl/files/path.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_message_handler.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -using tonic::LogIfError; -using tonic::ToDart; - -namespace blink { -namespace { -#if defined(OS_WIN) - -std::string FindAndReplace(const std::string& str, - const std::string& findStr, - const std::string& replaceStr) { - std::string rStr = str; - size_t pos = 0; - while ((pos = rStr.find(findStr, pos)) != std::string::npos) { - rStr.replace(pos, findStr.length(), replaceStr); - pos += replaceStr.length(); - } - return rStr; -} - -std::string SanitizePath(const std::string& path) { - return FindAndReplace(path, "\\\\", "/"); -} - -std::string ResolvePath(std::string path) { - std::string sanitized = SanitizePath(path); - if ((sanitized.length() > 2) && (sanitized[1] == ':')) { - return sanitized; - } - return files::SimplifyPath(files::GetCurrentDirectory() + "/" + sanitized); -} - -#else // defined(OS_WIN) - -std::string SanitizePath(const std::string& path) { - return path; -} - -// TODO(abarth): Consider adding this to //garnet/public/lib/fxl. -std::string ResolvePath(std::string path) { - if (!path.empty() && path[0] == '/') - return path; - return files::SimplifyPath(files::GetCurrentDirectory() + "/" + path); -} - -#endif - -} // namespace - -DartController::DartController() : ui_dart_state_(nullptr) {} - -DartController::~DartController() { - if (ui_dart_state_) { - ui_dart_state_->set_isolate_client(nullptr); - - if (!ui_dart_state_->shutting_down()) { - // Don't use a tonic::DartIsolateScope here since we never exit the - // isolate. - Dart_EnterIsolate(ui_dart_state_->isolate()); - // Clear the message notify callback. - Dart_SetMessageNotifyCallback(nullptr); - Dart_ShutdownIsolate(); - } - } -} - -const std::string DartController::main_entrypoint_ = "main"; - -bool DartController::SendStartMessage(Dart_Handle root_library, - const std::string& entrypoint) { - if (LogIfError(root_library)) - return true; - - { - // Temporarily exit the isolate while we make it runnable. - Dart_Isolate isolate = dart_state()->isolate(); - FXL_DCHECK(Dart_CurrentIsolate() == isolate); - Dart_ExitIsolate(); - Dart_IsolateMakeRunnable(isolate); - Dart_EnterIsolate(isolate); - } - - // In order to support pausing the isolate at start, we indirectly invoke - // main by sending a message to the isolate. - - // Get the closure of main(). - Dart_Handle main_closure = Dart_GetClosure( - root_library, Dart_NewStringFromCString(entrypoint.c_str())); - if (LogIfError(main_closure)) - return true; - - // Grab the 'dart:isolate' library. - Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); - DART_CHECK_VALID(isolate_lib); - - // Send the start message containing the entry point by calling - // _startMainIsolate in dart:isolate. - const intptr_t kNumIsolateArgs = 2; - Dart_Handle isolate_args[kNumIsolateArgs]; - isolate_args[0] = main_closure; - isolate_args[1] = Dart_Null(); - Dart_Handle result = Dart_Invoke(isolate_lib, ToDart("_startMainIsolate"), - kNumIsolateArgs, isolate_args); - return LogIfError(result); -} - -tonic::DartErrorHandleType DartController::RunFromKernel( - const std::vector& kernel, - const std::string& entrypoint) { - tonic::DartState::Scope scope(dart_state()); - tonic::DartErrorHandleType error = tonic::kNoError; - if (Dart_IsNull(Dart_RootLibrary())) { - Dart_Handle result = Dart_LoadScriptFromKernel(kernel.data(), kernel.size()); - LogIfError(result); - error = tonic::GetErrorHandleType(result); - } - if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { - return tonic::kUnknownErrorType; - } - return error; -} - -tonic::DartErrorHandleType DartController::RunFromPrecompiledSnapshot( - const std::string& entrypoint) { - TRACE_EVENT0("flutter", "DartController::RunFromPrecompiledSnapshot"); - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - tonic::DartState::Scope scope(dart_state()); - if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { - return tonic::kUnknownErrorType; - } - return tonic::kNoError; -} - -tonic::DartErrorHandleType DartController::RunFromScriptSnapshot( - const uint8_t* buffer, - size_t size, - const std::string& entrypoint) { - tonic::DartState::Scope scope(dart_state()); - tonic::DartErrorHandleType error = tonic::kNoError; - if (Dart_IsNull(Dart_RootLibrary())) { - Dart_Handle result = Dart_LoadScriptFromSnapshot(buffer, size); - LogIfError(result); - error = tonic::GetErrorHandleType(result); - } - if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { - return tonic::kUnknownErrorType; - } - return error; -} - -tonic::DartErrorHandleType DartController::RunFromSource( - const std::string& main, - const std::string& packages) { - tonic::DartState::Scope scope(dart_state()); - tonic::DartErrorHandleType error = tonic::kNoError; - if (Dart_IsNull(Dart_RootLibrary())) { - tonic::FileLoader& loader = dart_state()->file_loader(); - if (!packages.empty() && !loader.LoadPackagesMap(ResolvePath(packages))) - FXL_LOG(WARNING) << "Failed to load package map: " << packages; - Dart_Handle result = loader.LoadScript(SanitizePath(main)); - LogIfError(result); - error = tonic::GetErrorHandleType(result); - } - if (SendStartMessage(Dart_RootLibrary())) { - return tonic::kCompilationErrorType; - } - return error; -} - -void DartController::CreateIsolateFor(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - std::unique_ptr state) { - char* error = nullptr; - - void* platform_kernel = GetKernelPlatformBinary(); - - Dart_Isolate isolate; - if (platform_kernel != nullptr) { - isolate = Dart_CreateIsolateFromKernel( - script_uri.c_str(), "main", platform_kernel, nullptr /* flags */, - static_cast(state.get()), &error); - } else { - isolate = - Dart_CreateIsolate(script_uri.c_str(), "main", isolate_snapshot_data, - isolate_snapshot_instr, nullptr, - static_cast(state.get()), &error); - } - FXL_CHECK(isolate) << error; - ui_dart_state_ = state.release(); - ui_dart_state_->set_is_controller_state(true); - dart_state()->message_handler().Initialize(blink::Threads::UI()); - - Dart_SetShouldPauseOnStart(Settings::Get().start_paused); - - ui_dart_state_->set_debug_name_prefix(script_uri); - ui_dart_state_->SetIsolate(isolate); - FXL_CHECK(!LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); - - { - tonic::DartApiScope dart_api_scope; - DartIO::InitForIsolate(); - DartUI::InitForIsolate(); - DartRuntimeHooks::Install(DartRuntimeHooks::MainIsolate, script_uri); - - std::unique_ptr ui_class_provider( - new tonic::DartClassProvider(dart_state(), "dart:ui")); - dart_state()->class_library().add_provider("ui", - std::move(ui_class_provider)); - } - Dart_ExitIsolate(); -} - -} // namespace blink diff --git a/runtime/dart_controller.h b/runtime/dart_controller.h deleted file mode 100644 index 4b11a8660b7e7..0000000000000 --- a/runtime/dart_controller.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2015 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. - -#ifndef FLUTTER_RUNTIME_DART_CONTROLLER_H_ -#define FLUTTER_RUNTIME_DART_CONTROLLER_H_ - -#include -#include - -#include "lib/fxl/macros.h" -#include "lib/tonic/logging/dart_error.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace blink { -class UIDartState; - -class DartController { - public: - DartController(); - ~DartController(); - - tonic::DartErrorHandleType RunFromKernel( - const std::vector& kernel, - const std::string& entrypoint = main_entrypoint_); - tonic::DartErrorHandleType RunFromPrecompiledSnapshot( - const std::string& entrypoint = main_entrypoint_); - tonic::DartErrorHandleType RunFromScriptSnapshot( - const uint8_t* buffer, - size_t size, - const std::string& entrypoint = main_entrypoint_); - tonic::DartErrorHandleType RunFromSource(const std::string& main, - const std::string& packages); - - void CreateIsolateFor(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - std::unique_ptr ui_dart_state); - - UIDartState* dart_state() const { return ui_dart_state_; } - - private: - bool SendStartMessage(Dart_Handle root_library, - const std::string& entrypoint = main_entrypoint_); - - static const std::string main_entrypoint_; - - // The DartState associated with the main isolate. - UIDartState* ui_dart_state_; - - FXL_DISALLOW_COPY_AND_ASSIGN(DartController); -}; -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_CONTROLLER_H_ diff --git a/runtime/dart_init.cc b/runtime/dart_init.cc deleted file mode 100644 index e3d88322a4882..0000000000000 --- a/runtime/dart_init.cc +++ /dev/null @@ -1,725 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/runtime/dart_init.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#include -#include -#include - -#if defined(OS_WIN) -#include -#include -#undef ERROR - -#define access _access -#define R_OK 0x4 - -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif - -#else -#include -#endif - -#include -#include -#include -#include - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/unzipper_provider.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/common/settings.h" -#include "flutter/glue/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/runtime/start_up.h" -#include "lib/fxl/arraysize.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/files/path.h" -#include "lib/fxl/files/file.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/dart_sticky_error.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" -#include "lib/tonic/typed_data/uint8_list.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" -#include "third_party/dart/runtime/include/dart_mirrors_api.h" - -using tonic::DartClassProvider; -using tonic::LogIfError; -using tonic::ToDart; - -namespace dart { -namespace observatory { - -#if !OS(FUCHSIA) && FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - -// These two symbols are defined in |observatory_archive.cc| which is generated -// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. -// Both of these symbols will be part of the data segment and therefore are read -// only. -extern unsigned int observatory_assets_archive_len; -extern const uint8_t* observatory_assets_archive; - -#endif // FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - -} // namespace observatory -} // namespace dart - -namespace blink { - -const char kKernelAssetKey[] = "kernel_blob.bin"; -const char kSnapshotAssetKey[] = "snapshot_blob.bin"; -const char kPlatformKernelAssetKey[] = "platform.dill"; - -namespace { - -// Arguments passed to the Dart VM in all configurations. -static const char* kDartLanguageArgs[] = { - "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", - "--causal_async_stacks", "--limit-ints-to-64-bits", -}; - -static const char* kDartPrecompilationArgs[] = { - "--precompilation", -}; - -static const char* kDartWriteProtectCodeArgs[] FXL_ALLOW_UNUSED_TYPE = { - "--no_write_protect_code", -}; - -static const char* kDartAssertArgs[] = { - // clang-format off - "--enable_asserts", - // clang-format on -}; - -static const char* kDartCheckedModeArgs[] = { - // clang-format off - "--enable_type_checks", - "--error_on_bad_type", - "--error_on_bad_override", - // clang-format on -}; - -static const char* kDartStrongModeArgs[] = { - // clang-format off - "--limit_ints_to_64_bits", - "--reify_generic_functions", - "--strong", - "--sync_async", - // clang-format on -}; - -static const char* kDartStartPausedArgs[]{ - "--pause_isolates_on_start", -}; - -static const char* kDartTraceStartupArgs[]{ - "--timeline_streams=Compiler,Dart,Embedder,GC", -}; - -static const char* kDartEndlessTraceBufferArgs[]{ - "--timeline_recorder=endless", -}; - -static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { - "--systrace_timeline", - "--timeline_streams=VM,Isolate,Compiler,Dart,GC", -}; - -constexpr char kFileUriPrefix[] = "file://"; -constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; - -static const uint8_t* g_default_isolate_snapshot_data = nullptr; -static const uint8_t* g_default_isolate_snapshot_instructions = nullptr; -static bool g_service_isolate_initialized = false; -static ServiceIsolateHook g_service_isolate_hook = nullptr; -static RegisterNativeServiceProtocolExtensionHook - g_register_native_service_protocol_extensions_hook = nullptr; - -// Kernel representation of core dart libraries(loaded from platform.dill). -// TODO(aam): This (and platform_data below) have to be released when engine -// gets torn down. At that point we could also call Dart_Cleanup to complete -// Dart VM cleanup. -static void* kernel_platform = nullptr; -// Bytes actually read from platform.dill that are referenced by kernel_platform -static std::vector platform_data; - -void IsolateShutdownCallback(void* callback_data) { - if (tonic::DartStickyError::IsSet()) { - tonic::DartApiScope api_scope; - FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) - << " exited with an error"; - Dart_Handle sticky_error = Dart_GetStickyError(); - FXL_CHECK(LogIfError(sticky_error)); - } - - UIDartState* dart_state = static_cast(callback_data); - // If the isolate that's shutting down is the main one, tell the higher layers - // of the stack. - if ((dart_state != NULL) && dart_state->is_controller_state()) { - dart_state->set_shutting_down(true); - if (dart_state->isolate_client()) { - dart_state->isolate_client()->DidShutdownMainIsolate(); - } - } -} - -// The cleanup callback frees the DartState object. -void IsolateCleanupCallback(void* callback_data) { - UIDartState* dart_state = static_cast(callback_data); - delete dart_state; -} - -bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { - if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { - // Assume modified. - return true; - } - - const char* path = source_url + kFileUriPrefixLength; - struct stat info; - if (stat(path, &info) < 0) - return true; - - // If st_mtime is zero, it's more likely that the file system doesn't support - // mtime than that the file was actually modified in the 1970s. - if (!info.st_mtime) - return true; - - // It's very unclear what time bases we're with here. The Dart API doesn't - // document the time base for since_ms. Reading the code, the value varies by - // platform, with a typical source being something like gettimeofday. - // - // We add one to st_mtime because st_mtime has less precision than since_ms - // and we want to treat the file as modified if the since time is between - // ticks of the mtime. - fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); - fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); - - return mtime > since; -} - -void ThreadExitCallback() {} - -bool IsServiceIsolateURL(const char* url_name) { - return url_name != nullptr && - std::string(url_name) == DART_VM_SERVICE_ISOLATE_NAME; -} - -static bool StringEndsWith(const std::string& string, - const std::string& ending) { - if (ending.size() > string.size()) - return false; - - return string.compare(string.size() - ending.size(), ending.size(), ending) == - 0; -} - -static void ReleaseFetchedBytes(uint8_t* buffer) { - free(buffer); -} - -Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, - Dart_IsolateFlags* flags, - char** error) { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - // No VM-service in release mode. - return nullptr; -#else // FLUTTER_RUNTIME_MODE - UIDartState* dart_state = new UIDartState(nullptr, nullptr); - - bool is_running_from_kernel = GetKernelPlatformBinary() != nullptr; - - flags->load_vmservice_library = true; - Dart_Isolate isolate = - is_running_from_kernel - ? Dart_CreateIsolateFromKernel( - script_uri, "main", kernel_platform, flags, - static_cast(dart_state), error) - : Dart_CreateIsolate( - script_uri, "main", g_default_isolate_snapshot_data, - g_default_isolate_snapshot_instructions, flags, - static_cast(dart_state), error); - - FXL_CHECK(isolate) << error; - dart_state->set_debug_name_prefix(script_uri); - dart_state->SetIsolate(isolate); - FXL_CHECK(Dart_IsServiceIsolate(isolate)); - FXL_CHECK(!LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); - { - tonic::DartApiScope dart_api_scope; - DartIO::InitForIsolate(); - DartUI::InitForIsolate(); - DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); - const Settings& settings = Settings::Get(); - if (settings.enable_observatory) { - std::string ip = settings.ipv6 ? "::1" : "127.0.0.1"; - const intptr_t port = settings.observatory_port; - const bool disable_websocket_origin_check = false; - const bool service_isolate_booted = DartServiceIsolate::Startup( - ip, port, tonic::DartState::HandleLibraryTag, - !IsRunningPrecompiledCode() && !is_running_from_kernel, - disable_websocket_origin_check, error); - FXL_CHECK(service_isolate_booted) << error; - } - - if (g_service_isolate_hook) - g_service_isolate_hook(IsRunningPrecompiledCode()); - } - Dart_ExitIsolate(); - - g_service_isolate_initialized = true; - // Register any native service protocol extensions. - if (g_register_native_service_protocol_extensions_hook) { - g_register_native_service_protocol_extensions_hook( - IsRunningPrecompiledCode()); - } - return isolate; -#endif // FLUTTER_RUNTIME_MODE -} - -static bool GetAssetAsBuffer( - const std::string& name, - std::vector* data, - fxl::RefPtr& directory_asset_bundle, - fxl::RefPtr& asset_store) { - return (directory_asset_bundle && - directory_asset_bundle->GetAsBuffer(name, data)) || - (asset_store && asset_store->GetAsBuffer(name, data)); -} - -Dart_Isolate IsolateCreateCallback(const char* script_uri, - const char* main, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - void* callback_data, - char** error) { - TRACE_EVENT0("flutter", __func__); - - if (IsServiceIsolateURL(script_uri)) { - return ServiceIsolateCreateCallback(script_uri, flags, error); - } - - std::string entry_uri = script_uri; - // Are we running from a Dart source file? - const bool running_from_source = StringEndsWith(entry_uri, ".dart"); - - std::vector kernel_data; - std::vector snapshot_data; - std::string entry_path; - if (!IsRunningPrecompiledCode()) { - // Check that the entry script URI starts with file:// - if (entry_uri.find(kFileUriPrefix) != 0u) { - *error = strdup("Isolates must use file:// URIs"); - return nullptr; - } - // Entry script path (file:// is stripped). - entry_path = std::string(script_uri + strlen(kFileUriPrefix)); - if (StringEndsWith(entry_path, ".dill")) { - // Load the kernel from the script URI. - if (!files::ReadFileToVector(entry_path, &kernel_data)) { - FXL_LOG(ERROR) << "Failed to load kernel"; - } - } else if (!running_from_source) { - // Attempt to copy the snapshot or kernel from the asset bundle. - const std::string& bundle_path = entry_path; - - struct stat stat_result = {}; - if (::stat(bundle_path.c_str(), &stat_result) == 0) { - fxl::RefPtr directory_asset_bundle; - // TODO(zarah): Remove usage of zip_asset_store once app.flx is removed. - fxl::RefPtr zip_asset_store; - // bundle_path is either the path to app.flx or the flutter assets - // directory. - std::string flx_path = bundle_path; - if (S_ISDIR(stat_result.st_mode)) { - directory_asset_bundle = - fxl::MakeRefCounted(bundle_path); - flx_path = files::GetDirectoryName(bundle_path) + "/app.flx"; - } - - if (access(flx_path.c_str(), R_OK) == 0) { - zip_asset_store = fxl::MakeRefCounted( - GetUnzipperProviderForPath(flx_path)); - } - GetAssetAsBuffer(kKernelAssetKey, &kernel_data, directory_asset_bundle, - zip_asset_store); - GetAssetAsBuffer(kSnapshotAssetKey, &snapshot_data, - directory_asset_bundle, zip_asset_store); - } - } - } - - UIDartState* parent_dart_state = static_cast(callback_data); - UIDartState* dart_state = parent_dart_state->CreateForChildIsolate(); - - Dart_Isolate isolate = - kernel_platform != nullptr - ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_platform, - nullptr /* flags */, dart_state, error) - : Dart_CreateIsolate(script_uri, main, - g_default_isolate_snapshot_data, - g_default_isolate_snapshot_instructions, nullptr, - dart_state, error); - FXL_CHECK(isolate) << error; - dart_state->set_debug_name_prefix(script_uri); - dart_state->SetIsolate(isolate); - FXL_CHECK(!LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); - - { - tonic::DartApiScope dart_api_scope; - DartIO::InitForIsolate(); - DartUI::InitForIsolate(); - DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); - - std::unique_ptr ui_class_provider( - new DartClassProvider(dart_state, "dart:ui")); - dart_state->class_library().add_provider("ui", - std::move(ui_class_provider)); - - if (!kernel_data.empty()) { - // We are running kernel code. - FXL_CHECK(!LogIfError(Dart_LoadScriptFromKernel(kernel_data.data(), - kernel_data.size()))); - } else if (!snapshot_data.empty()) { - // We are running from a script snapshot. - FXL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(), - snapshot_data.size()))); - } else if (running_from_source) { - // We are running from source. - // Forward the .packages configuration from the parent isolate to the - // child isolate. - tonic::FileLoader& parent_loader = parent_dart_state->file_loader(); - const std::string& packages = parent_loader.packages(); - tonic::FileLoader& loader = dart_state->file_loader(); - if (!packages.empty() && !loader.LoadPackagesMap(packages)) { - FXL_LOG(WARNING) << "Failed to load package map: " << packages; - } - // Load the script. - FXL_CHECK(!LogIfError(loader.LoadScript(entry_path))); - } - - dart_state->isolate_client()->DidCreateSecondaryIsolate(isolate); - } - - Dart_ExitIsolate(); - - FXL_CHECK(Dart_IsolateMakeRunnable(isolate)); - return isolate; -} - -Dart_Handle GetVMServiceAssetsArchiveCallback() { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - return nullptr; -#elif OS(FUCHSIA) - std::vector observatory_assets_archive; - if (!files::ReadFileToVector("pkg/data/observatory.tar", - &observatory_assets_archive)) { - FXL_LOG(ERROR) << "Fail to load Observatory archive"; - return nullptr; - } - return tonic::DartConverter::ToDart( - observatory_assets_archive.data(), - observatory_assets_archive.size()); -#else - return tonic::DartConverter::ToDart( - ::dart::observatory::observatory_assets_archive, - ::dart::observatory::observatory_assets_archive_len); -#endif -} - -static const char kStdoutStreamId[] = "Stdout"; -static const char kStderrStreamId[] = "Stderr"; - -static bool ServiceStreamListenCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(true); - return true; - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(true); - return true; - } - return false; -} - -static void ServiceStreamCancelCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(false); - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(false); - } -} - -} // namespace - -bool IsRunningPrecompiledCode() { - return Dart_IsPrecompiledRuntime(); -} - -EmbedderTracingCallbacks* g_tracing_callbacks = nullptr; - -EmbedderTracingCallbacks::EmbedderTracingCallbacks( - EmbedderTracingCallback start, - EmbedderTracingCallback stop) - : start_tracing_callback(start), stop_tracing_callback(stop) {} - -void SetEmbedderTracingCallbacks( - std::unique_ptr callbacks) { - g_tracing_callbacks = callbacks.release(); -} - -static void EmbedderTimelineStartRecording() { - if (g_tracing_callbacks) - g_tracing_callbacks->start_tracing_callback(); -} - -static void EmbedderTimelineStopRecording() { - if (g_tracing_callbacks) - g_tracing_callbacks->stop_tracing_callback(); -} - -static std::vector ProfilingFlags(bool enable_profiling) { -// Disable Dart's built in profiler when building a debug build. This -// works around a race condition that would sometimes stop a crash's -// stack trace from being printed on Android. -#ifndef NDEBUG - enable_profiling = false; -#endif - - // We want to disable profiling by default because it overwhelms LLDB. But - // the VM enables the same by default. In either case, we have some profiling - // flags. - if (enable_profiling) { - return { - // This is the default. But just be explicit. - "--profiler", - // This instructs the profiler to walk C++ frames, and to include - // them in the profile. - "--profile-vm"}; - } else { - return {"--no-profiler"}; - } -} - -void SetServiceIsolateHook(ServiceIsolateHook hook) { - FXL_CHECK(!g_service_isolate_initialized); - g_service_isolate_hook = hook; -} - -void SetRegisterNativeServiceProtocolExtensionHook( - RegisterNativeServiceProtocolExtensionHook hook) { - FXL_CHECK(!g_service_isolate_initialized); - g_register_native_service_protocol_extensions_hook = hook; -} - -void PushBackAll(std::vector* args, - const char** argv, - size_t argc) { - for (size_t i = 0; i < argc; ++i) { - args->push_back(argv[i]); - } -} - -static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { - info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; - dart::bin::GetIOEmbedderInformation(info); - info->name = "Flutter"; -} - -void* GetKernelPlatformBinary() { - return kernel_platform; -} - -void InitDartVM(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path) { - TRACE_EVENT0("flutter", __func__); - - g_default_isolate_snapshot_data = default_isolate_snapshot_data; - g_default_isolate_snapshot_instructions = - default_isolate_snapshot_instructions; - - const Settings& settings = Settings::Get(); - - { - TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); - dart::bin::BootstrapDartIo(); - - if (!settings.temp_directory_path.empty()) { - dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); - } - } - - std::vector args; - - // Instruct the VM to ignore unrecognized flags. - // There is a lot of diversity in a lot of combinations when it - // comes to the arguments the VM supports. And, if the VM comes across a flag - // it does not recognize, it exits immediately. - args.push_back("--ignore-unrecognized-flags"); - - for (const auto& profiler_flag : - ProfilingFlags(settings.enable_dart_profiling)) { - args.push_back(profiler_flag); - } - - PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); - - if (IsRunningPrecompiledCode()) { - PushBackAll(&args, kDartPrecompilationArgs, - arraysize(kDartPrecompilationArgs)); - } - -#if defined(OS_FUCHSIA) -#if defined(NDEBUG) - // Do not enable checked mode for Fuchsia release builds - // TODO(mikejurka): remove this once precompiled code is working on Fuchsia - const bool use_checked_mode = false; -#else // !defined(NDEBUG) - const bool use_checked_mode = true; -#endif // !defined(NDEBUG) -#else // !defined(OS_FUCHSIA) - // Enable checked mode if we are not running precompiled code. We run non- - // precompiled code only in the debug product mode. - const bool use_checked_mode = - !IsRunningPrecompiledCode() && !settings.dart_non_checked_mode; -#endif // !defined(OS_FUCHSIA) - -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - // Debug mode uses the JIT, disable code page write protection to avoid - // memory page protection changes before and after every compilation. - PushBackAll(&args, kDartWriteProtectCodeArgs, - arraysize(kDartWriteProtectCodeArgs)); -#endif - - if (settings.start_paused) - PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); - - if (settings.endless_trace_buffer || settings.trace_startup) { - // If we are tracing startup, make sure the trace buffer is endless so we - // don't lose early traces. - PushBackAll(&args, kDartEndlessTraceBufferArgs, - arraysize(kDartEndlessTraceBufferArgs)); - } - - if (settings.trace_startup) { - PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); - } - -#if defined(OS_FUCHSIA) - PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); -#endif - - if (!bundle_path.empty()) { - fxl::RefPtr directory_asset_bundle = - fxl::MakeRefCounted( - std::move(bundle_path)); - directory_asset_bundle->GetAsBuffer(kPlatformKernelAssetKey, - &platform_data); - if (!platform_data.empty()) { - uint8_t* kernel_buf = static_cast(malloc(platform_data.size())); - memcpy(kernel_buf, platform_data.data(), platform_data.size()); - kernel_platform = Dart_ReadKernelBinary(kernel_buf, platform_data.size(), - ReleaseFetchedBytes); - FXL_DCHECK(kernel_platform != nullptr); - } - } - if ((kernel_platform != nullptr) || - Dart_IsDart2Snapshot(g_default_isolate_snapshot_data)) { - // The presence of the kernel platform file or a snapshot that was generated - // for Dart2 indicates we are running in preview-dart-2 mode and in this - // mode enable strong mode options by default. - // Note: When we start using core snapshots instead of the platform file - // in the engine just sniffing the snapshot file should be sufficient. - PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); - // In addition if we are running in debug mode we also enable asserts. - if (use_checked_mode) { - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - } - } else if (use_checked_mode) { - // In non preview-dart-2 mode we enable checked mode and asserts if - // we are running in debug mode. - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); - } - - for (size_t i = 0; i < settings.dart_flags.size(); i++) - args.push_back(settings.dart_flags[i].c_str()); - - FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); - - DartUI::InitForGlobal(); - - // Setup embedder tracing hooks. To avoid data races, it is recommended that - // these hooks be installed before the DartInitialize, so do that setup now. - Dart_SetEmbedderTimelineCallbacks(&EmbedderTimelineStartRecording, - &EmbedderTimelineStopRecording); - - Dart_SetFileModifiedCallback(&DartFileModifiedCallback); - - { - TRACE_EVENT0("flutter", "Dart_Initialize"); - Dart_InitializeParams params = {}; - params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; - params.vm_snapshot_data = vm_snapshot_data; - params.vm_snapshot_instructions = vm_snapshot_instructions; - params.create = IsolateCreateCallback; - params.shutdown = IsolateShutdownCallback; - params.cleanup = IsolateCleanupCallback; - params.thread_exit = ThreadExitCallback; - params.get_service_assets = GetVMServiceAssetsArchiveCallback; - params.entropy_source = DartIO::EntropySource; - char* init_error = Dart_Initialize(¶ms); - if (init_error != nullptr) - FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; - free(init_error); - - // Send the earliest available timestamp in the application lifecycle to - // timeline. The difference between this timestamp and the time we render - // the very first frame gives us a good idea about Flutter's startup time. - // Use a duration event so about:tracing will consider this event when - // deciding the earliest event to use as time 0. - if (blink::engine_main_enter_ts != 0) { - Dart_TimelineEvent("FlutterEngineMainEnter", // label - blink::engine_main_enter_ts, // timestamp0 - blink::engine_main_enter_ts, // timestamp1_or_async_id - Dart_Timeline_Event_Duration, // event type - 0, // argument_count - nullptr, // argument_names - nullptr // argument_values - ); - } - } - - // Allow streaming of stdout and stderr by the Dart vm. - Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, - &ServiceStreamCancelCallback); - - Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); -} - -} // namespace blink diff --git a/runtime/dart_init.h b/runtime/dart_init.h deleted file mode 100644 index 99c8fe89137e3..0000000000000 --- a/runtime/dart_init.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2015 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. - -#ifndef FLUTTER_RUNTIME_DART_INIT_H_ -#define FLUTTER_RUNTIME_DART_INIT_H_ - -#include "lib/fxl/build_config.h" -#include "lib/fxl/functional/closure.h" -#include "third_party/dart/runtime/include/dart_api.h" - -#include -#include -#include - -namespace blink { - -// Name of the kernel blob asset within the asset directory. -extern const char kKernelAssetKey[]; - -// Name of the snapshot blob asset within the asset directory. -extern const char kSnapshotAssetKey[]; - -// Name of the platform kernel blob asset within the asset directory. -extern const char kPlatformKernelAssetKey[]; - -bool IsRunningPrecompiledCode(); - -using EmbedderTracingCallback = fxl::Closure; - -typedef void (*ServiceIsolateHook)(bool); -typedef void (*RegisterNativeServiceProtocolExtensionHook)(bool); - -struct EmbedderTracingCallbacks { - EmbedderTracingCallback start_tracing_callback; - EmbedderTracingCallback stop_tracing_callback; - - EmbedderTracingCallbacks(EmbedderTracingCallback start, - EmbedderTracingCallback stop); -}; - -void InitDartVM(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path); - -void* GetKernelPlatformBinary(); - -void SetEmbedderTracingCallbacks( - std::unique_ptr callbacks); - -// Provide a function that will be called during initialization of the -// service isolate. -void SetServiceIsolateHook(ServiceIsolateHook hook); - -// Provide a function that will be called to register native service protocol -// extensions. -void SetRegisterNativeServiceProtocolExtensionHook( - RegisterNativeServiceProtocolExtensionHook hook); - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_INIT_H_ diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc new file mode 100644 index 0000000000000..c5fd770b1b40c --- /dev/null +++ b/runtime/dart_isolate.cc @@ -0,0 +1,715 @@ +// Copyright 2017 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/runtime/dart_isolate.h" + +#include +#include + +#include "flutter/fml/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/runtime/dart_vm.h" +#include "lib/fxl/files/path.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_class_provider.h" +#include "lib/tonic/dart_message_handler.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/dart_sticky_error.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/scopes/dart_isolate_scope.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace blink { + +fml::WeakPtr DartIsolate::CreateRootIsolate( + const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + std::unique_ptr window, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, + Dart_IsolateFlags* flags) { + TRACE_EVENT0("flutter", "DartIsolate::CreateRootIsolate"); + Dart_Isolate vm_isolate = nullptr; + fml::WeakPtr embedder_isolate; + + char* error = nullptr; + + // Since this is the root isolate, we fake a parent embedder data object. We + // cannot use unique_ptr here because the destructor is private (since the + // isolate lifecycle is entirely managed by the VM). + auto root_embedder_data = std::make_unique( + vm, // VM + std::move(isolate_snapshot), // isolate snapshot + task_runners, // task runners + std::move(resource_context), // resource context + std::move(unref_queue), // skia unref queue + advisory_script_uri, // advisory URI + advisory_script_entrypoint // advisory entrypoint + ); + + std::tie(vm_isolate, embedder_isolate) = CreateDartVMAndEmbedderObjectPair( + advisory_script_uri.c_str(), // advisory script URI + advisory_script_entrypoint.c_str(), // advisory script entrypoint + nullptr, // package root + nullptr, // package config + flags, // flags + root_embedder_data.get(), // parent embedder data + true, // is root isolate + &error // error (out) + ); + + if (error != nullptr) { + free(error); + } + + if (vm_isolate == nullptr) { + return {}; + } + + if (embedder_isolate) { + // Only root isolates can interact with windows. + embedder_isolate->SetWindow(std::move(window)); + embedder_isolate->set_use_blink(vm->GetSettings().using_blink); + } + + return embedder_isolate; +} + +DartIsolate::DartIsolate(const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint) + : UIDartState(std::move(task_runners), + vm->GetSettings().task_observer_add, + vm->GetSettings().task_observer_remove, + std::move(resource_context), + std::move(unref_queue), + advisory_script_uri, + advisory_script_entrypoint, + vm->GetSettings().log_tag), + vm_(vm), + isolate_snapshot_(std::move(isolate_snapshot)), + weak_factory_(this) { + FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; + weak_prototype_ = weak_factory_.GetWeakPtr(); + + if (vm_ == nullptr) { + return; + } + + phase_ = Phase::Uninitialized; +} + +DartIsolate::~DartIsolate() = default; + +DartIsolate::Phase DartIsolate::GetPhase() const { + return phase_; +} + +const DartVM* DartIsolate::GetDartVM() const { + return vm_; +} + +bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { + TRACE_EVENT0("flutter", "DartIsolate::Initialize"); + if (phase_ != Phase::Uninitialized) { + return false; + } + + if (dart_isolate == nullptr) { + return false; + } + + if (Dart_CurrentIsolate() != dart_isolate) { + return false; + } + + if (Dart_IsolateData(dart_isolate) != this) { + return false; + } + + // After this point, isolate scopes can be safely used. + SetIsolate(dart_isolate); + + // We are entering a new scope (for the first time since initialization) and + // we want to restore the current scope to null when we exit out of this + // method. This balances the implicit Dart_EnterIsolate call made by + // Dart_CreateIsolate (which calls the Initialize). + Dart_ExitIsolate(); + + tonic::DartIsolateScope scope(isolate()); + + if (is_root_isolate) { + if (auto task_runner = GetTaskRunners().GetUITaskRunner()) { + // Isolates may not have any particular thread affinity. Only initialize + // the message handler if a task runner is explicitly specified. + message_handler().Initialize(task_runner); + } + } + + if (tonic::LogIfError( + Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))) { + return false; + } + + if (!UpdateThreadPoolNames()) { + return false; + } + + phase_ = Phase::Initialized; + return true; +} + +// Updating thread names here does not change the underlying OS thread names. +// Instead, this is just additional metadata for the Observatory to show the +// thread name of the isolate. +bool DartIsolate::UpdateThreadPoolNames() const { + // TODO(chinmaygarde): This implementation does not account for multiple + // shells sharing the same (or subset of) threads. + const auto& task_runners = GetTaskRunners(); + + if (auto task_runner = task_runners.GetGPUTaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".gpu"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + if (auto task_runner = task_runners.GetUITaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".ui"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + if (auto task_runner = task_runners.GetIOTaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".io"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + if (auto task_runner = task_runners.GetPlatformTaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".platform"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + return true; +} + +bool DartIsolate::LoadLibraries() { + TRACE_EVENT0("flutter", "DartIsolate::LoadLibraries"); + if (phase_ != Phase::Initialized) { + return false; + } + + tonic::DartState::Scope scope(this); + + DartIO::InitForIsolate(); + + DartUI::InitForIsolate(); + + const bool is_service_isolate = Dart_IsServiceIsolate(isolate()); + + DartRuntimeHooks::Install(is_service_isolate + ? DartRuntimeHooks::SecondaryIsolate + : DartRuntimeHooks::MainIsolate, + GetAdvisoryScriptURI()); + + if (!is_service_isolate) { + class_library().add_provider( + "ui", std::make_unique(this, "dart:ui")); + } + + phase_ = Phase::LibrariesSetup; + return true; +} + +bool DartIsolate::PrepareForRunningFromPrecompiledCode() { + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromPrecompiledCode"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + if (!DartVM::IsRunningPrecompiledCode()) { + return false; + } + + tonic::DartState::Scope scope(this); + + if (Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!MarkIsolateRunnable()) { + return false; + } + + phase_ = Phase::Ready; + return true; +} + +static bool LoadScriptSnapshot(std::unique_ptr mapping) { + if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), + mapping->GetSize()))) { + return false; + } + return true; +} + +static bool LoadKernelSnapshot(std::unique_ptr mapping) { + if (tonic::LogIfError(Dart_LoadScriptFromKernel(mapping->GetMapping(), + mapping->GetSize()))) { + return false; + } + + return true; +} + +static bool LoadSnapshot(std::unique_ptr mapping, + bool is_kernel) { + if (is_kernel) { + return LoadKernelSnapshot(std::move(mapping)); + } else { + return LoadScriptSnapshot(std::move(mapping)); + } + return false; +} + +FXL_WARN_UNUSED_RESULT +bool DartIsolate::PrepareForRunningFromSnapshot( + std::unique_ptr mapping) { + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSnapshot"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + if (DartVM::IsRunningPrecompiledCode()) { + return false; + } + + if (!mapping || mapping->GetSize() == 0) { + return false; + } + + tonic::DartState::Scope scope(this); + + if (!Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!LoadSnapshot(std::move(mapping), vm_->GetPlatformKernel() != nullptr)) { + return false; + } + + if (Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!MarkIsolateRunnable()) { + return false; + } + + phase_ = Phase::Ready; + return true; +} + +static bool FileNameIsDill(const std::string& name) { + const std::string suffix = ".dill"; + + if (name.size() < suffix.size()) { + return false; + } + + if (name.rfind(suffix, name.size()) == name.size() - suffix.size()) { + return true; + } + return false; +} + +bool DartIsolate::PrepareForRunningFromSource( + const std::string& main_source_file, + const std::string& packages) { + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSource"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + if (DartVM::IsRunningPrecompiledCode()) { + return false; + } + + if (main_source_file.empty()) { + return false; + } + + tonic::DartState::Scope scope(this); + + if (!Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + auto& loader = file_loader(); + + if (!packages.empty()) { + auto packages_absolute_path = files::AbsolutePath(packages); + FXL_DLOG(INFO) << "Loading from packages: " << packages_absolute_path; + if (!loader.LoadPackagesMap(packages_absolute_path)) { + return false; + } + } + + auto main_source_absolute_path = files::AbsolutePath(main_source_file); + FXL_DLOG(INFO) << "Loading from source: " << main_source_absolute_path; + + // The "source" file may be a ".dill" file. + if (FileNameIsDill(main_source_absolute_path)) { + auto mapping = + std::make_unique(main_source_absolute_path, false); + if (mapping == nullptr) { + return false; + } + if (!LoadKernelSnapshot(std::move(mapping))) { + return false; + } + } else { + if (tonic::LogIfError(loader.LoadScript(main_source_absolute_path))) { + return false; + } + } + + if (Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!MarkIsolateRunnable()) { + return false; + } + + phase_ = Phase::Ready; + return true; +} + +bool DartIsolate::MarkIsolateRunnable() { + TRACE_EVENT0("flutter", "DartIsolate::MarkIsolateRunnable"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + // This function may only be called from an active isolate scope. + if (Dart_CurrentIsolate() != isolate()) { + return false; + } + + // There must be no current isolate to mark an isolate as being runnable. + Dart_ExitIsolate(); + + if (!Dart_IsolateMakeRunnable(isolate())) { + // Failed. Restore the isolate. + Dart_EnterIsolate(isolate()); + return false; + } + // Success. Restore the isolate. + Dart_EnterIsolate(isolate()); + return true; +} + +FXL_WARN_UNUSED_RESULT +bool DartIsolate::Run(const std::string& entrypoint_name) { + TRACE_EVENT0("flutter", "DartIsolate::Run"); + if (phase_ != Phase::Ready) { + return false; + } + + tonic::DartState::Scope scope(this); + + Dart_Handle entrypoint = Dart_GetClosure( + Dart_RootLibrary(), tonic::ToDart(entrypoint_name.c_str())); + if (tonic::LogIfError(entrypoint)) { + return false; + } + + Dart_Handle isolate_lib = Dart_LookupLibrary(tonic::ToDart("dart:isolate")); + if (tonic::LogIfError(isolate_lib)) { + return false; + } + + Dart_Handle isolate_args[] = { + entrypoint, + Dart_Null(), + }; + + if (tonic::LogIfError(Dart_Invoke( + isolate_lib, tonic::ToDart("_startMainIsolate"), + sizeof(isolate_args) / sizeof(isolate_args[0]), isolate_args))) { + return false; + } + + phase_ = Phase::Running; + return true; +} + +bool DartIsolate::Shutdown() { + TRACE_EVENT0("flutter", "DartIsolate::Shutdown"); + // This call may be re-entrant since Dart_ShutdownIsolate can invoke the + // cleanup callback which deletes the embedder side object of the dart isolate + // (a.k.a. this). + if (phase_ == Phase::Shutdown) { + return false; + } + phase_ = Phase::Shutdown; + Dart_Isolate vm_isolate = isolate(); + // The isolate can be nullptr if this instance is the stub isolate data used + // during root isolate creation. + if (vm_isolate != nullptr) { + // We need to enter the isolate because Dart_ShutdownIsolate does not take + // the isolate to shutdown as a parameter. + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + Dart_EnterIsolate(vm_isolate); + Dart_ShutdownIsolate(); + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + } + return true; +} + +static Dart_Isolate DartCreateAndStartServiceIsolate( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + char** error) { + auto vm = DartVM::ForProcessIfInitialized(); + + if (!vm) { + *error = strdup( + "Could not resolve the VM when attempting to create the service " + "isolate."); + return nullptr; + } + + const auto& settings = vm->GetSettings(); + + if (!settings.enable_observatory) { + FXL_DLOG(INFO) << "Observatory is disabled."; + return nullptr; + } + + blink::TaskRunners null_task_runners( + "io.flutter." DART_VM_SERVICE_ISOLATE_NAME, nullptr, nullptr, nullptr, + nullptr); + + flags->load_vmservice_library = true; + + auto service_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + null_task_runners, // task runners + nullptr, // window + {}, // resource context + {}, // unref queue + advisory_script_uri == nullptr ? "" : advisory_script_uri, // script uri + advisory_script_entrypoint == nullptr + ? "" + : advisory_script_entrypoint, // script entrypoint + flags // flags + ); + + if (!service_isolate) { + *error = strdup("Could not create the service isolate."); + FXL_DLOG(ERROR) << *error; + return nullptr; + } + + // The engine never holds a strong reference to the VM service isolate. Since + // we are about to lose our last weak reference to it, start the VM service + // while we have this reference. + + const bool running_from_sources = + !DartVM::IsRunningPrecompiledCode() && vm->GetPlatformKernel() == nullptr; + + tonic::DartState::Scope scope(service_isolate.get()); + if (!DartServiceIsolate::Startup( + settings.ipv6 ? "::1" : "127.0.0.1", // server IP address + settings.observatory_port, // server observatory port + tonic::DartState::HandleLibraryTag, // embedder library tag handler + running_from_sources, // running from source code + false, // disable websocket origin check + error // error (out) + )) { + // Error is populated by call to startup. + FXL_DLOG(ERROR) << *error; + return nullptr; + } + + vm->GetServiceProtocol().ToggleHooks(true); + + return service_isolate->isolate(); +} + +// |Dart_IsolateCreateCallback| +Dart_Isolate DartIsolate::DartIsolateCreateCallback( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* parent_embedder_isolate, + char** error) { + if (parent_embedder_isolate == nullptr && + strcmp(advisory_script_uri, DART_VM_SERVICE_ISOLATE_NAME) == 0) { + // The VM attempts to start the VM service for us on |Dart_Initialize|. In + // such a case, the callback data will be null and the script URI will be + // DART_VM_SERVICE_ISOLATE_NAME. In such cases, we just create the service + // isolate like normal but dont hold a reference to it at all. We also start + // this isolate since we will never again reference it from the engine. + return DartCreateAndStartServiceIsolate(advisory_script_uri, // + advisory_script_entrypoint, // + package_root, // + package_config, // + flags, // + error // + ); + } + + return CreateDartVMAndEmbedderObjectPair( + advisory_script_uri, // URI + advisory_script_entrypoint, // entrypoint + package_root, // package root + package_config, // package config + flags, // isolate flags + parent_embedder_isolate, // embedder data + false, // is root isolate + error // error + ) + .first; +} + +std::pair> +DartIsolate::CreateDartVMAndEmbedderObjectPair( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* parent_embedder_isolate, + bool is_root_isolate, + char** error) { + TRACE_EVENT0("flutter", "DartIsolate::CreateDartVMAndEmbedderObjectPair"); + if (parent_embedder_isolate == nullptr || + parent_embedder_isolate->GetDartVM() == nullptr) { + *error = + strdup("Parent isolate did not have embedder specific callback data."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + const DartVM* vm = parent_embedder_isolate->GetDartVM(); + + // Create the native object on the embedder side. This object is deleted in + // the cleanup callback. + auto embedder_isolate = std::make_unique( + vm, // + parent_embedder_isolate->GetIsolateSnapshot(), // + parent_embedder_isolate->GetTaskRunners(), // + parent_embedder_isolate->GetResourceContext(), // + parent_embedder_isolate->GetSkiaUnrefQueue(), // + advisory_script_uri, // + advisory_script_entrypoint // + ); + + // Create the Dart VM isolate and give it the embedder object as the baton. + Dart_Isolate isolate = + vm->GetPlatformKernel() != nullptr + ? Dart_CreateIsolateFromKernel(advisory_script_uri, // + advisory_script_entrypoint, // + vm->GetPlatformKernel(), // + flags, // + embedder_isolate.get(), // + error // + ) + : Dart_CreateIsolate(advisory_script_uri, // + advisory_script_entrypoint, // + embedder_isolate->GetIsolateSnapshot() + ->GetData() + ->GetSnapshotPointer(), // + embedder_isolate->GetIsolateSnapshot() + ->GetInstructionsIfPresent(), // + flags, // + embedder_isolate.get(), // + error // + ); + + if (isolate == nullptr) { + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + if (!embedder_isolate->Initialize(isolate, is_root_isolate)) { + *error = strdup("Embedder could not initialize the Dart isolate."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + if (!embedder_isolate->LoadLibraries()) { + *error = + strdup("Embedder could not load libraries in the new Dart isolate."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + // The ownership of the embedder object is controlled by the Dart VM. So the + // only reference returned to the caller is weak. + return {isolate, embedder_isolate.release()->GetWeakIsolatePtr()}; +} + +// |Dart_IsolateShutdownCallback| +void DartIsolate::DartIsolateShutdownCallback(DartIsolate* embedder_isolate) { + if (!tonic::DartStickyError::IsSet()) { + return; + } + + tonic::DartApiScope api_scope; + FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) + << " exited with an error"; + Dart_Handle sticky_error = Dart_GetStickyError(); + FXL_CHECK(tonic::LogIfError(sticky_error)); +} + +// |Dart_IsolateCleanupCallback| +void DartIsolate::DartIsolateCleanupCallback(DartIsolate* embedder_isolate) { + delete embedder_isolate; +} + +fxl::RefPtr DartIsolate::GetIsolateSnapshot() const { + return isolate_snapshot_; +} + +fml::WeakPtr DartIsolate::GetWeakIsolatePtr() const { + return weak_prototype_; +} + +void DartIsolate::AddIsolateShutdownCallback(fxl::Closure closure) { + shutdown_callbacks_.emplace_back( + std::make_unique(std::move(closure))); +} + +} // namespace blink diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h new file mode 100644 index 0000000000000..13d573ebe333f --- /dev/null +++ b/runtime/dart_isolate.h @@ -0,0 +1,152 @@ +// Copyright 2017 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_RUNTIME_DART_ISOLATE_H_ +#define FLUTTER_RUNTIME_DART_ISOLATE_H_ + +#include +#include + +#include "flutter/common/task_runners.h" +#include "flutter/fml/mapping.h" +#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_snapshot.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" +#include "lib/tonic/dart_state.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace blink { +class DartVM; + +class DartIsolate : public UIDartState { + public: + enum class Phase { + Unknown, + Uninitialized, + Initialized, + LibrariesSetup, + Ready, + Running, + Shutdown, + }; + + // The root isolate of a Flutter application is special because it gets Window + // bindings. From the VM's perspective, this isolate is not special in any + // way. + static fml::WeakPtr CreateRootIsolate( + const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + std::unique_ptr window, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri = "main.dart", + std::string advisory_script_entrypoint = "main", + Dart_IsolateFlags* flags = nullptr); + + DartIsolate(const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint); + + ~DartIsolate() override; + + Phase GetPhase() const; + + FXL_WARN_UNUSED_RESULT + bool PrepareForRunningFromPrecompiledCode(); + + FXL_WARN_UNUSED_RESULT + bool PrepareForRunningFromSnapshot(std::unique_ptr snapshot); + + FXL_WARN_UNUSED_RESULT + bool PrepareForRunningFromSource(const std::string& main_source_file, + const std::string& packages); + + FXL_WARN_UNUSED_RESULT + bool Run(const std::string& entrypoint); + + FXL_WARN_UNUSED_RESULT + bool Shutdown(); + + void AddIsolateShutdownCallback(fxl::Closure closure); + + const DartVM* GetDartVM() const; + + fxl::RefPtr GetIsolateSnapshot() const; + + fml::WeakPtr GetWeakIsolatePtr() const; + + private: + class AutoFireClosure { + public: + AutoFireClosure(fxl::Closure closure) : closure_(std::move(closure)) {} + ~AutoFireClosure() { + if (closure_) { + closure_(); + } + } + + private: + fxl::Closure closure_; + FXL_DISALLOW_COPY_AND_ASSIGN(AutoFireClosure); + }; + friend class DartVM; + + const DartVM* vm_ = nullptr; + Phase phase_ = Phase::Unknown; + const fxl::RefPtr isolate_snapshot_; + std::vector> shutdown_callbacks_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + FXL_WARN_UNUSED_RESULT + bool Initialize(Dart_Isolate isolate, bool is_root_isolate); + + FXL_WARN_UNUSED_RESULT + bool LoadLibraries(); + + bool UpdateThreadPoolNames() const; + + FXL_WARN_UNUSED_RESULT + bool MarkIsolateRunnable(); + + // |Dart_IsolateCreateCallback| + static Dart_Isolate DartIsolateCreateCallback( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* embedder_isolate, + char** error); + + static std::pair /* embedder */> + CreateDartVMAndEmbedderObjectPair(const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* parent_embedder_isolate, + bool is_root_isolate, + char** error); + + // |Dart_IsolateShutdownCallback| + static void DartIsolateShutdownCallback(DartIsolate* embedder_isolate); + + // |Dart_IsolateCleanupCallback| + static void DartIsolateCleanupCallback(DartIsolate* embedder_isolate); + + FXL_DISALLOW_COPY_AND_ASSIGN(DartIsolate); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_ISOLATE_H_ diff --git a/runtime/dart_isolate_unittests.cc b/runtime/dart_isolate_unittests.cc new file mode 100644 index 0000000000000..d8f2e02382da1 --- /dev/null +++ b/runtime/dart_isolate_unittests.cc @@ -0,0 +1,103 @@ +// Copyright 2017 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/thread.h" +#include "flutter/runtime/dart_isolate.h" +#include "flutter/runtime/dart_vm.h" +#include "flutter/testing/testing.h" +#include "flutter/testing/thread_test.h" + +#define CURRENT_TEST_NAME \ + std::string { \ + ::testing::UnitTest::GetInstance()->current_test_info()->name() \ + } + +namespace blink { + +using DartIsolateTest = ::testing::ThreadTest; + +TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + TaskRunners task_runners(CURRENT_TEST_NAME, // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner() // + ); + auto root_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + std::move(task_runners), // task runners + nullptr, // window + {}, // resource context + nullptr // unref qeueue + ); + ASSERT_TRUE(root_isolate); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); + ASSERT_TRUE(root_isolate->Shutdown()); +} + +TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + TaskRunners task_runners(CURRENT_TEST_NAME, // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner() // + ); + auto root_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + std::move(task_runners), // task runners + nullptr, // window + {}, // resource context + nullptr // unref qeueue + ); + ASSERT_TRUE(root_isolate); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); + ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( + testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); + ASSERT_TRUE(root_isolate->Shutdown()); +} + +TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + TaskRunners task_runners(CURRENT_TEST_NAME, // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner() // + ); + auto root_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + std::move(task_runners), // task runners + nullptr, // window + {}, // resource context + nullptr // unref qeueue + ); + ASSERT_TRUE(root_isolate); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); + ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( + testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); + ASSERT_TRUE(root_isolate->Run("simple_main")); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Running); + ASSERT_TRUE(root_isolate->Shutdown()); +} + +} // namespace blink diff --git a/runtime/dart_service_isolate.h b/runtime/dart_service_isolate.h index 9edd663feb6bd..59a02e2e9d495 100644 --- a/runtime/dart_service_isolate.h +++ b/runtime/dart_service_isolate.h @@ -13,8 +13,6 @@ namespace blink { class DartServiceIsolate { public: - static bool Bootstrap(); - static bool Startup(std::string server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc new file mode 100644 index 0000000000000..5d759257d1d4b --- /dev/null +++ b/runtime/dart_snapshot.cc @@ -0,0 +1,159 @@ +// Copyright 2017 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/runtime/dart_snapshot.h" + +#include + +#include "flutter/fml/native_library.h" +#include "flutter/fml/paths.h" +#include "flutter/fml/trace_event.h" +#include "flutter/runtime/dart_snapshot_buffer.h" +#include "flutter/runtime/dart_vm.h" + +namespace blink { + +const char* DartSnapshot::kVMDataSymbol = "kDartVmSnapshotData"; +const char* DartSnapshot::kVMInstructionsSymbol = "kDartVmSnapshotInstructions"; +const char* DartSnapshot::kIsolateDataSymbol = "kDartIsolateSnapshotData"; +const char* DartSnapshot::kIsolateInstructionsSymbol = + "kDartIsolateSnapshotInstructions"; + +static std::unique_ptr ResolveVMData( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = fml::paths::JoinPaths( + {settings.aot_snapshot_path, settings.aot_vm_snapshot_data_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), false /* executable */)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kVMDataSymbol); +} + +static std::unique_ptr ResolveVMInstructions( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = fml::paths::JoinPaths( + {settings.aot_snapshot_path, settings.aot_vm_snapshot_instr_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), true /* executable */)) { + return source; + } + } + + if (settings.application_library_path.size() > 0) { + auto library = + fml::NativeLibrary::Create(settings.application_library_path.c_str()); + if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( + library, DartSnapshot::kVMInstructionsSymbol)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kVMInstructionsSymbol); +} + +static std::unique_ptr ResolveIsolateData( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = + fml::paths::JoinPaths({settings.aot_snapshot_path, + settings.aot_isolate_snapshot_data_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), false /* executable */)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kIsolateDataSymbol); +} + +static std::unique_ptr ResolveIsolateInstructions( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = + fml::paths::JoinPaths({settings.aot_snapshot_path, + settings.aot_isolate_snapshot_instr_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), true /* executable */)) { + return source; + } + } + + if (settings.application_library_path.size() > 0) { + auto library = + fml::NativeLibrary::Create(settings.application_library_path.c_str()); + if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( + library, DartSnapshot::kIsolateInstructionsSymbol)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kIsolateInstructionsSymbol); +} + +fxl::RefPtr DartSnapshot::VMSnapshotFromSettings( + const Settings& settings) { + TRACE_EVENT0("flutter", "DartSnapshot::VMSnapshotFromSettings"); + auto snapshot = + fxl::MakeRefCounted(ResolveVMData(settings), // + ResolveVMInstructions(settings) // + ); + if (snapshot->IsValid()) { + return snapshot; + } + return nullptr; +} + +fxl::RefPtr DartSnapshot::IsolateSnapshotFromSettings( + const Settings& settings) { + TRACE_EVENT0("flutter", "DartSnapshot::IsolateSnapshotFromSettings"); + auto snapshot = + fxl::MakeRefCounted(ResolveIsolateData(settings), // + ResolveIsolateInstructions(settings) // + ); + if (snapshot->IsValid()) { + return snapshot; + } + return nullptr; +} + +DartSnapshot::DartSnapshot(std::unique_ptr data, + std::unique_ptr instructions) + : data_(std::move(data)), instructions_(std::move(instructions)) {} + +DartSnapshot::~DartSnapshot() = default; + +bool DartSnapshot::IsValid() const { + return static_cast(data_); +} + +bool DartSnapshot::IsValidForAOT() const { + return data_ && instructions_; +} + +const DartSnapshotBuffer* DartSnapshot::GetData() const { + return data_.get(); +} + +const DartSnapshotBuffer* DartSnapshot::GetInstructions() const { + return instructions_.get(); +} + +const uint8_t* DartSnapshot::GetInstructionsIfPresent() const { + return instructions_ ? instructions_->GetSnapshotPointer() : nullptr; +} + +} // namespace blink diff --git a/runtime/dart_snapshot.h b/runtime/dart_snapshot.h new file mode 100644 index 0000000000000..4f04765b4f5a9 --- /dev/null +++ b/runtime/dart_snapshot.h @@ -0,0 +1,57 @@ +// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_H_ +#define FLUTTER_RUNTIME_DART_SNAPSHOT_H_ + +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/runtime/dart_snapshot_buffer.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" + +namespace blink { + +class DartSnapshot : public fxl::RefCountedThreadSafe { + public: + static const char* kVMDataSymbol; + static const char* kVMInstructionsSymbol; + static const char* kIsolateDataSymbol; + static const char* kIsolateInstructionsSymbol; + + static fxl::RefPtr VMSnapshotFromSettings( + const Settings& settings); + + static fxl::RefPtr IsolateSnapshotFromSettings( + const Settings& settings); + + bool IsValid() const; + + bool IsValidForAOT() const; + + const DartSnapshotBuffer* GetData() const; + + const DartSnapshotBuffer* GetInstructions() const; + + const uint8_t* GetInstructionsIfPresent() const; + + private: + std::unique_ptr data_; + std::unique_ptr instructions_; + + DartSnapshot(std::unique_ptr data, + std::unique_ptr instructions); + + ~DartSnapshot(); + + FRIEND_REF_COUNTED_THREAD_SAFE(DartSnapshot); + FRIEND_MAKE_REF_COUNTED(DartSnapshot); + FXL_DISALLOW_COPY_AND_ASSIGN(DartSnapshot); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_H_ diff --git a/runtime/dart_snapshot_buffer.cc b/runtime/dart_snapshot_buffer.cc new file mode 100644 index 0000000000000..c39233ac8334a --- /dev/null +++ b/runtime/dart_snapshot_buffer.cc @@ -0,0 +1,72 @@ +// Copyright 2017 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/runtime/dart_snapshot_buffer.h" + +#include + +#include "flutter/fml/mapping.h" + +namespace blink { + +class NativeLibrarySnapshotBuffer final : public DartSnapshotBuffer { + public: + NativeLibrarySnapshotBuffer(fxl::RefPtr library, + const char* symbol_name) + : library_(std::move(library)) { + if (library_) { + symbol_ = library_->ResolveSymbol(symbol_name); + } + } + + const uint8_t* GetSnapshotPointer() const override { return symbol_; } + + size_t GetSnapshotSize() const override { return 0; } + + private: + fxl::RefPtr library_; + const uint8_t* symbol_ = nullptr; + + FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrarySnapshotBuffer); +}; + +class FileSnapshotBuffer final : public DartSnapshotBuffer { + public: + FileSnapshotBuffer(const char* path, bool executable) + : mapping_(path, executable) { + if (mapping_.GetSize() > 0) { + symbol_ = mapping_.GetMapping(); + } + } + + const uint8_t* GetSnapshotPointer() const override { return symbol_; } + + size_t GetSnapshotSize() const override { return mapping_.GetSize(); } + + private: + fml::FileMapping mapping_; + const uint8_t* symbol_ = nullptr; + + FXL_DISALLOW_COPY_AND_ASSIGN(FileSnapshotBuffer); +}; + +std::unique_ptr +DartSnapshotBuffer::CreateWithSymbolInLibrary( + fxl::RefPtr library, + const char* symbol_name) { + auto source = std::make_unique( + std::move(library), symbol_name); + return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); +} + +std::unique_ptr +DartSnapshotBuffer::CreateWithContentsOfFile(const char* file_path, + bool executable) { + auto source = std::make_unique(file_path, executable); + return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); +} + +DartSnapshotBuffer::~DartSnapshotBuffer() = default; + +} // namespace blink diff --git a/runtime/dart_snapshot_buffer.h b/runtime/dart_snapshot_buffer.h new file mode 100644 index 0000000000000..675946c0ca63f --- /dev/null +++ b/runtime/dart_snapshot_buffer.h @@ -0,0 +1,34 @@ +// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_BUFFER_H_ +#define FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ + +#include + +#include "flutter/fml/native_library.h" +#include "lib/fxl/macros.h" + +namespace blink { + +class DartSnapshotBuffer { + public: + static std::unique_ptr CreateWithSymbolInLibrary( + fxl::RefPtr library, + const char* symbol_name); + + static std::unique_ptr CreateWithContentsOfFile( + const char* file_path, + bool executable); + + virtual ~DartSnapshotBuffer(); + + virtual const uint8_t* GetSnapshotPointer() const = 0; + + virtual size_t GetSnapshotSize() const = 0; +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc new file mode 100644 index 0000000000000..bb46779078583 --- /dev/null +++ b/runtime/dart_vm.cc @@ -0,0 +1,472 @@ +// Copyright 2017 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/runtime/dart_vm.h" + +#include + +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/fml/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/runtime/dart_isolate.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/runtime/start_up.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/files/file.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/time/time_delta.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_class_provider.h" +#include "lib/tonic/dart_sticky_error.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/typed_data/uint8_list.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace dart { +namespace observatory { + +#if !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) + +// These two symbols are defined in |observatory_archive.cc| which is generated +// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. +// Both of these symbols will be part of the data segment and therefore are read +// only. +extern unsigned int observatory_assets_archive_len; +extern const uint8_t* observatory_assets_archive; + +#endif // !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != + // FLUTTER_RUNTIME_MODE_RELEASE) + +} // namespace observatory +} // namespace dart + +namespace blink { + +// Arguments passed to the Dart VM in all configurations. +static const char* kDartLanguageArgs[] = { + "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", + "--causal_async_stacks", "--limit-ints-to-64-bits", +}; + +static const char* kDartPrecompilationArgs[] = { + "--precompilation", +}; + +FXL_ALLOW_UNUSED_TYPE +static const char* kDartWriteProtectCodeArgs[] = { + "--no_write_protect_code", +}; + +static const char* kDartAssertArgs[] = { + // clang-format off + "--enable_asserts", + // clang-format on +}; + +static const char* kDartCheckedModeArgs[] = { + // clang-format off + "--enable_type_checks", + "--error_on_bad_type", + "--error_on_bad_override", + // clang-format on +}; + +static const char* kDartStrongModeArgs[] = { + // clang-format off + "--strong", + "--reify_generic_functions", + "--limit_ints_to_64_bits", + "--sync_async", + // clang-format on +}; + +static const char* kDartStartPausedArgs[]{ + "--pause_isolates_on_start", +}; + +static const char* kDartTraceStartupArgs[]{ + "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", +}; + +static const char* kDartEndlessTraceBufferArgs[]{ + "--timeline_recorder=endless", +}; + +static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { + "--systrace_timeline", + "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", +}; + +constexpr char kFileUriPrefix[] = "file://"; +constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; + +bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { + if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { + // Assume modified. + return true; + } + + const char* path = source_url + kFileUriPrefixLength; + struct stat info; + if (stat(path, &info) < 0) + return true; + + // If st_mtime is zero, it's more likely that the file system doesn't support + // mtime than that the file was actually modified in the 1970s. + if (!info.st_mtime) + return true; + + // It's very unclear what time bases we're with here. The Dart API doesn't + // document the time base for since_ms. Reading the code, the value varies by + // platform, with a typical source being something like gettimeofday. + // + // We add one to st_mtime because st_mtime has less precision than since_ms + // and we want to treat the file as modified if the since time is between + // ticks of the mtime. + fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); + fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); + + return mtime > since; +} + +void ThreadExitCallback() {} + +Dart_Handle GetVMServiceAssetsArchiveCallback() { +#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) + return nullptr; +#elif OS(FUCHSIA) + std::vector observatory_assets_archive; + if (!files::ReadFileToVector("pkg/data/observatory.tar", + &observatory_assets_archive)) { + FXL_LOG(ERROR) << "Fail to load Observatory archive"; + return nullptr; + } + return tonic::DartConverter::ToDart( + observatory_assets_archive.data(), observatory_assets_archive.size()); +#else + return tonic::DartConverter::ToDart( + ::dart::observatory::observatory_assets_archive, + ::dart::observatory::observatory_assets_archive_len); +#endif +} + +static const char kStdoutStreamId[] = "Stdout"; +static const char kStderrStreamId[] = "Stderr"; + +static bool ServiceStreamListenCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(true); + return true; + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(true); + return true; + } + return false; +} + +static void ServiceStreamCancelCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(false); + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(false); + } +} + +bool DartVM::IsRunningPrecompiledCode() { + return Dart_IsPrecompiledRuntime(); +} + +static std::vector ProfilingFlags(bool enable_profiling) { +// Disable Dart's built in profiler when building a debug build. This +// works around a race condition that would sometimes stop a crash's +// stack trace from being printed on Android. +#ifndef NDEBUG + enable_profiling = false; +#endif + + // We want to disable profiling by default because it overwhelms LLDB. But + // the VM enables the same by default. In either case, we have some profiling + // flags. + if (enable_profiling) { + return {// This is the default. But just be explicit. + "--profiler", + // This instructs the profiler to walk C++ frames, and to include + // them in the profile. + "--profile-vm"}; + } else { + return {"--no-profiler"}; + } +} + +void PushBackAll(std::vector* args, + const char** argv, + size_t argc) { + for (size_t i = 0; i < argc; ++i) { + args->push_back(argv[i]); + } +} + +static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { + info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; + dart::bin::GetIOEmbedderInformation(info); + info->name = "Flutter"; +} + +fxl::RefPtr DartVM::ForProcess(Settings settings) { + return ForProcess(settings, nullptr, nullptr); +} + +static std::once_flag gVMInitialization; +static fxl::RefPtr gVM; + +fxl::RefPtr DartVM::ForProcess( + Settings settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot) { + std::call_once(gVMInitialization, [settings, // + vm_snapshot, // + isolate_snapshot // + ]() mutable { + if (!vm_snapshot) { + vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings); + } + if (!isolate_snapshot) { + isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings); + } + gVM = fxl::MakeRefCounted(settings, // + std::move(vm_snapshot), // + std::move(isolate_snapshot) // + ); + }); + return gVM; +} + +fxl::RefPtr DartVM::ForProcessIfInitialized() { + return gVM; +} + +DartVM::DartVM(const Settings& settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot) + : settings_(settings), + vm_snapshot_(std::move(vm_snapshot)), + isolate_snapshot_(std::move(isolate_snapshot)), + platform_kernel_mapping_( + std::make_unique(settings.kernel_snapshot_path)), + weak_factory_(this) { + TRACE_EVENT0("flutter", "DartVMInitializer"); + FXL_DLOG(INFO) << "Attempting Dart VM launch for mode: " + << (IsRunningPrecompiledCode() ? "AOT" : "Interpreter"); + + FXL_DCHECK(vm_snapshot_ && vm_snapshot_->IsValid()) + << "VM snapshot must be valid."; + + FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid()) + << "Isolate snapshot must be valid."; + + if (platform_kernel_mapping_->GetSize() > 0) { + // The platform kernel mapping lifetime is managed by this instance of the + // DartVM and hence will exceed that of the PlatformKernel. So provide an + // empty release callback. + Dart_ReleaseBufferCallback empty = [](auto arg) {}; + platform_kernel_ = reinterpret_cast(Dart_ReadKernelBinary( + platform_kernel_mapping_->GetMapping(), // buffer + platform_kernel_mapping_->GetSize(), // buffer size + empty // buffer deleter + )); + } + + { + TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); + dart::bin::BootstrapDartIo(); + + if (!settings.temp_directory_path.empty()) { + dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); + } + } + + std::vector args; + + // Instruct the VM to ignore unrecognized flags. + // There is a lot of diversity in a lot of combinations when it + // comes to the arguments the VM supports. And, if the VM comes across a flag + // it does not recognize, it exits immediately. + args.push_back("--ignore-unrecognized-flags"); + + for (const auto& profiler_flag : + ProfilingFlags(settings.enable_dart_profiling)) { + args.push_back(profiler_flag); + } + + PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); + + if (IsRunningPrecompiledCode()) { + PushBackAll(&args, kDartPrecompilationArgs, + arraysize(kDartPrecompilationArgs)); + } + + // Enable checked mode if we are not running precompiled code. We run non- + // precompiled code only in the debug product mode. + bool use_checked_mode = !settings.dart_non_checked_mode; + +#if !OS(FUCHSIA) + if (IsRunningPrecompiledCode()) { + use_checked_mode = false; + } +#endif // !OS(FUCHSIA) + +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + // Debug mode uses the JIT, disable code page write protection to avoid + // memory page protection changes before and after every compilation. + PushBackAll(&args, kDartWriteProtectCodeArgs, + arraysize(kDartWriteProtectCodeArgs)); +#endif + + const bool isolate_snapshot_is_dart_2 = + Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); + + const bool is_preview_dart2 = + platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; + + if (is_preview_dart2) { + FXL_DLOG(INFO) << "Dart 2 is enabled."; + } else { + FXL_DLOG(INFO) << "Dart 2 is NOT enabled. Platform kernel: " + << static_cast(platform_kernel_) + << " Isolate Snapshot is Dart 2: " + << isolate_snapshot_is_dart_2; + } + if (is_preview_dart2) { + PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); + if (use_checked_mode) { + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + } + } else if (use_checked_mode) { + FXL_DLOG(INFO) << "Checked mode is ON"; + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); + } else { + FXL_DLOG(INFO) << "Is not Dart 2 and Checked mode is OFF"; + } + + if (settings.start_paused) { + PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); + } + + if (settings.endless_trace_buffer || settings.trace_startup) { + // If we are tracing startup, make sure the trace buffer is endless so we + // don't lose early traces. + PushBackAll(&args, kDartEndlessTraceBufferArgs, + arraysize(kDartEndlessTraceBufferArgs)); + } + + if (settings.trace_startup) { + PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); + } + +#if defined(OS_FUCHSIA) + PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); +#endif + + for (size_t i = 0; i < settings.dart_flags.size(); i++) + args.push_back(settings.dart_flags[i].c_str()); + + FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); + + DartUI::InitForGlobal(); + + { + TRACE_EVENT0("flutter", "Dart_Initialize"); + Dart_InitializeParams params = {}; + params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; + params.vm_snapshot_data = vm_snapshot_->GetData()->GetSnapshotPointer(); + params.vm_snapshot_instructions = vm_snapshot_->GetInstructionsIfPresent(); + params.create = reinterpret_cast( + DartIsolate::DartIsolateCreateCallback); + params.shutdown = reinterpret_cast( + DartIsolate::DartIsolateShutdownCallback); + params.cleanup = reinterpret_cast( + DartIsolate::DartIsolateCleanupCallback); + params.thread_exit = ThreadExitCallback; + params.get_service_assets = GetVMServiceAssetsArchiveCallback; + params.entropy_source = DartIO::EntropySource; + char* init_error = Dart_Initialize(¶ms); + if (init_error) { + FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; + ::free(init_error); + } + // Send the earliest available timestamp in the application lifecycle to + // timeline. The difference between this timestamp and the time we render + // the very first frame gives us a good idea about Flutter's startup time. + // Use a duration event so about:tracing will consider this event when + // deciding the earliest event to use as time 0. + if (blink::engine_main_enter_ts != 0) { + Dart_TimelineEvent("FlutterEngineMainEnter", // label + blink::engine_main_enter_ts, // timestamp0 + blink::engine_main_enter_ts, // timestamp1_or_async_id + Dart_Timeline_Event_Duration, // event type + 0, // argument_count + nullptr, // argument_names + nullptr // argument_values + ); + } + } + + // Allow streaming of stdout and stderr by the Dart vm. + Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, + &ServiceStreamCancelCallback); + + Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); +} + +DartVM::~DartVM() { + if (Dart_CurrentIsolate() != nullptr) { + Dart_ExitIsolate(); + } + char* result = Dart_Cleanup(); + if (result != nullptr) { + FXL_LOG(ERROR) << "Could not cleanly shut down the Dart VM. Message: \"" + << result << "\"."; + free(result); + } +} + +const Settings& DartVM::GetSettings() const { + return settings_; +} + +DartVM::PlatformKernel* DartVM::GetPlatformKernel() const { + return platform_kernel_; +} + +const DartSnapshot& DartVM::GetVMSnapshot() const { + return *vm_snapshot_.get(); +} + +fxl::RefPtr DartVM::GetIsolateSnapshot() const { + return isolate_snapshot_; +} + +ServiceProtocol& DartVM::GetServiceProtocol() { + return service_protocol_; +} + +fxl::WeakPtr DartVM::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +} // namespace blink diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h new file mode 100644 index 0000000000000..e8feb9ba1de92 --- /dev/null +++ b/runtime/dart_vm.h @@ -0,0 +1,75 @@ +// Copyright 2017 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_RUNTIME_DART_VM_H_ +#define FLUTTER_RUNTIME_DART_VM_H_ + +#include +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/runtime/dart_isolate.h" +#include "flutter/runtime/dart_snapshot.h" +#include "flutter/runtime/service_protocol.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace blink { + +class DartVM : public fxl::RefCountedThreadSafe { + public: + class PlatformKernel; + + static fxl::RefPtr ForProcess(Settings settings); + + static fxl::RefPtr ForProcess( + Settings settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot); + + static fxl::RefPtr ForProcessIfInitialized(); + + static bool IsRunningPrecompiledCode(); + + const Settings& GetSettings() const; + + PlatformKernel* GetPlatformKernel() const; + + const DartSnapshot& GetVMSnapshot() const; + + fxl::RefPtr GetIsolateSnapshot() const; + + fxl::WeakPtr GetWeakPtr(); + + ServiceProtocol& GetServiceProtocol(); + + private: + const Settings settings_; + const fxl::RefPtr vm_snapshot_; + const fxl::RefPtr isolate_snapshot_; + std::unique_ptr platform_kernel_mapping_; + PlatformKernel* platform_kernel_ = nullptr; + ServiceProtocol service_protocol_; + fxl::WeakPtrFactory weak_factory_; + + DartVM(const Settings& settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot); + + ~DartVM(); + + FRIEND_REF_COUNTED_THREAD_SAFE(DartVM); + FRIEND_MAKE_REF_COUNTED(DartVM); + FXL_DISALLOW_COPY_AND_ASSIGN(DartVM); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_VM_H_ diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc new file mode 100644 index 0000000000000..5b2f5e6ee8299 --- /dev/null +++ b/runtime/dart_vm_unittests.cc @@ -0,0 +1,21 @@ +// Copyright 2017 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/runtime/dart_vm.h" +#include "gtest/gtest.h" + +namespace blink { + +TEST(DartVM, SimpleInitialization) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + ASSERT_EQ(vm, DartVM::ForProcess(settings)); + ASSERT_FALSE(DartVM::IsRunningPrecompiledCode()); + ASSERT_EQ(vm->GetPlatformKernel(), nullptr); +} + +} // namespace blink diff --git a/runtime/fixtures/simple_main.dart b/runtime/fixtures/simple_main.dart new file mode 100644 index 0000000000000..552dfbe344902 --- /dev/null +++ b/runtime/fixtures/simple_main.dart @@ -0,0 +1,7 @@ +// Copyright 2016 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. + +void simple_main() { + print("Hello"); +} diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 75796cd68697e..e7a8ab525329a 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -4,192 +4,248 @@ #include "flutter/runtime/runtime_controller.h" +#include "flutter/fml/message_loop.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "lib/tonic/dart_message_handler.h" -using tonic::DartState; +#ifdef ERROR +#undef ERROR +#endif namespace blink { -std::unique_ptr RuntimeController::Create( - RuntimeDelegate* client) { - return std::unique_ptr(new RuntimeController(client)); +RuntimeController::RuntimeController( + RuntimeDelegate& p_client, + const DartVM* p_vm, + TaskRunners p_task_runners, + fml::WeakPtr p_resource_context, + fxl::RefPtr p_unref_queue) + : RuntimeController(p_client, + p_vm, + std::move(p_task_runners), + std::move(p_resource_context), + std::move(p_unref_queue), + WindowData{/* default window data */}) {} + +RuntimeController::RuntimeController( + RuntimeDelegate& p_client, + const DartVM* p_vm, + TaskRunners p_task_runners, + fml::WeakPtr p_resource_context, + fxl::RefPtr p_unref_queue, + WindowData p_window_data) + : client_(p_client), + vm_(p_vm), + task_runners_(p_task_runners), + resource_context_(p_resource_context), + unref_queue_(p_unref_queue), + window_data_(std::move(p_window_data)), + root_isolate_( + DartIsolate::CreateRootIsolate(vm_, + vm_->GetIsolateSnapshot(), + task_runners_, + std::make_unique(this), + resource_context_, + unref_queue_)) { + root_isolate_->SetReturnCodeCallback([this](uint32_t code) { + root_isolate_return_code_ = {true, code}; + }); + if (auto window = GetWindowIfAvailable()) { + tonic::DartState::Scope scope(root_isolate_.get()); + window->DidCreateIsolate(); + if (!FlushRuntimeStateToIsolate()) { + FXL_DLOG(ERROR) << "Could not setup intial isolate state."; + } + } else { + FXL_DCHECK(false) << "RuntimeController created without window binding."; + } + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); +} + +RuntimeController::~RuntimeController() { + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + if (root_isolate_) { + root_isolate_->SetReturnCodeCallback(nullptr); + auto result = root_isolate_->Shutdown(); + if (!result) { + FXL_DLOG(ERROR) << "Could not shutdown the root isolate."; + } + root_isolate_ = {}; + } } -RuntimeController::RuntimeController(RuntimeDelegate* client) - : client_(client) {} - -RuntimeController::~RuntimeController() {} +std::unique_ptr RuntimeController::Clone() const { + return std::unique_ptr(new RuntimeController( + client_, // + vm_, // + task_runners_, // + resource_context_, // + unref_queue_, // + window_data_ // + )); +} -void RuntimeController::CreateDartController( - const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - int dirfd) { - FXL_DCHECK(!dart_controller_); +bool RuntimeController::FlushRuntimeStateToIsolate() { + return SetViewportMetrics(window_data_.viewport_metrics) && + SetLocale(window_data_.language_code, window_data_.country_code) && + SetSemanticsEnabled(window_data_.semantics_enabled); +} - dart_controller_.reset(new DartController()); - dart_controller_->CreateIsolateFor( - script_uri, isolate_snapshot_data, isolate_snapshot_instr, - std::make_unique(this, std::make_unique(this), - dirfd)); +bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { + window_data_.viewport_metrics = metrics; - UIDartState* dart_state = dart_controller_->dart_state(); - DartState::Scope scope(dart_state); - dart_state->window()->DidCreateIsolate(); - client_->DidCreateMainIsolate(dart_state->isolate()); + if (auto window = GetWindowIfAvailable()) { + window->UpdateWindowMetrics(metrics); + return true; + } + return false; +} - Window* window = GetWindow(); +bool RuntimeController::SetLocale(const std::string& language_code, + const std::string& country_code) { + window_data_.language_code = language_code; + window_data_.country_code = country_code; - window->UpdateLocale(language_code_, country_code_); + if (auto window = GetWindowIfAvailable()) { + window->UpdateLocale(window_data_.language_code, window_data_.country_code); + return true; + } - if (semantics_enabled_) - window->UpdateSemanticsEnabled(semantics_enabled_); + return false; } -void RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { - GetWindow()->UpdateWindowMetrics(metrics); -} +bool RuntimeController::SetUserSettingsData(const std::string& data) { + window_data_.user_settings_data = data; -void RuntimeController::SetLocale(const std::string& language_code, - const std::string& country_code) { - if (language_code_ == language_code && country_code_ == country_code) - return; + if (auto window = GetWindowIfAvailable()) { + window->UpdateUserSettingsData(window_data_.user_settings_data); + return true; + } - language_code_ = language_code; - country_code_ = country_code; - GetWindow()->UpdateLocale(language_code_, country_code_); + return false; } -void RuntimeController::SetUserSettingsData(const std::string& data) { - if (user_settings_data_ == data) - return; - user_settings_data_ = data; - GetWindow()->UpdateUserSettingsData(user_settings_data_); -} +bool RuntimeController::SetSemanticsEnabled(bool enabled) { + window_data_.semantics_enabled = enabled; + + if (auto window = GetWindowIfAvailable()) { + window->UpdateSemanticsEnabled(window_data_.semantics_enabled); + return true; + } -void RuntimeController::SetSemanticsEnabled(bool enabled) { - if (semantics_enabled_ == enabled) - return; - semantics_enabled_ = enabled; - GetWindow()->UpdateSemanticsEnabled(semantics_enabled_); + return false; } -void RuntimeController::BeginFrame(fxl::TimePoint frame_time) { - GetWindow()->BeginFrame(frame_time); +bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) { + if (auto window = GetWindowIfAvailable()) { + window->BeginFrame(frame_time); + return true; + } + return false; } -void RuntimeController::NotifyIdle(int64_t deadline) { - UIDartState* dart_state = dart_controller_->dart_state(); - if (!dart_state) { - return; +bool RuntimeController::NotifyIdle(int64_t deadline) { + if (!root_isolate_) { + return false; } - DartState::Scope scope(dart_state); + + tonic::DartState::Scope scope(root_isolate_.get()); Dart_NotifyIdle(deadline); + return true; } -void RuntimeController::DispatchPlatformMessage( +bool RuntimeController::DispatchPlatformMessage( fxl::RefPtr message) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", "mode", - "basic"); - GetWindow()->DispatchPlatformMessage(std::move(message)); + if (auto window = GetWindowIfAvailable()) { + TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", + "mode", "basic"); + window->DispatchPlatformMessage(std::move(message)); + return true; + } + return false; } -void RuntimeController::DispatchPointerDataPacket( +bool RuntimeController::DispatchPointerDataPacket( const PointerDataPacket& packet) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", - "mode", "basic"); - GetWindow()->DispatchPointerDataPacket(packet); + if (auto window = GetWindowIfAvailable()) { + TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", + "mode", "basic"); + window->DispatchPointerDataPacket(packet); + return true; + } + return false; } -void RuntimeController::DispatchSemanticsAction(int32_t id, +bool RuntimeController::DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args) { TRACE_EVENT1("flutter", "RuntimeController::DispatchSemanticsAction", "mode", "basic"); - GetWindow()->DispatchSemanticsAction(id, action, std::move(args)); + if (auto window = GetWindowIfAvailable()) { + window->DispatchSemanticsAction(id, action, std::move(args)); + return true; + } + return false; } -Window* RuntimeController::GetWindow() { - return dart_controller_->dart_state()->window(); +Window* RuntimeController::GetWindowIfAvailable() { + return root_isolate_ ? root_isolate_->window() : nullptr; } std::string RuntimeController::DefaultRouteName() { - return client_->DefaultRouteName(); + return client_.DefaultRouteName(); } void RuntimeController::ScheduleFrame() { - client_->ScheduleFrame(); + client_.ScheduleFrame(); } void RuntimeController::Render(Scene* scene) { - client_->Render(scene->takeLayerTree()); + client_.Render(scene->takeLayerTree()); } void RuntimeController::UpdateSemantics(SemanticsUpdate* update) { - if (semantics_enabled_) - client_->UpdateSemantics(update->takeNodes()); + if (window_data_.semantics_enabled) { + client_.UpdateSemantics(update->takeNodes()); + } } void RuntimeController::HandlePlatformMessage( fxl::RefPtr message) { - client_->HandlePlatformMessage(std::move(message)); -} - -void RuntimeController::DidCreateSecondaryIsolate(Dart_Isolate isolate) { - client_->DidCreateSecondaryIsolate(isolate); -} - -void RuntimeController::DidShutdownMainIsolate() { - client_->DidShutdownMainIsolate(); + client_.HandlePlatformMessage(std::move(message)); } Dart_Port RuntimeController::GetMainPort() { - if (!dart_controller_) { - return ILLEGAL_PORT; - } - if (!dart_controller_->dart_state()) { - return ILLEGAL_PORT; - } - return dart_controller_->dart_state()->main_port(); + return root_isolate_ ? root_isolate_->main_port() : ILLEGAL_PORT; } std::string RuntimeController::GetIsolateName() { - if (!dart_controller_) { - return ""; - } - if (!dart_controller_->dart_state()) { - return ""; - } - return dart_controller_->dart_state()->debug_name(); + return root_isolate_ ? root_isolate_->debug_name() : ""; } bool RuntimeController::HasLivePorts() { - if (!dart_controller_) { - return false; - } - UIDartState* dart_state = dart_controller_->dart_state(); - if (!dart_state) { + if (!root_isolate_) { return false; } - DartState::Scope scope(dart_state); + tonic::DartState::Scope scope(root_isolate_.get()); return Dart_HasLivePorts(); } tonic::DartErrorHandleType RuntimeController::GetLastError() { - if (!dart_controller_) { - return tonic::kNoError; - } - UIDartState* dart_state = dart_controller_->dart_state(); - if (!dart_state) { - return tonic::kNoError; - } - return dart_state->message_handler().isolate_last_error(); + return root_isolate_ ? root_isolate_->message_handler().isolate_last_error() + : tonic::kNoError; +} + +fml::WeakPtr RuntimeController::GetRootIsolate() { + return root_isolate_; +} + +std::pair RuntimeController::GetRootIsolateReturnCode() { + return root_isolate_return_code_; } } // namespace blink diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 628bc699395c0..326c517f31db2 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -7,71 +7,108 @@ #include +#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_vm.h" #include "lib/fxl/macros.h" namespace blink { -class DartController; -class DartLibraryProvider; class Scene; class RuntimeDelegate; class View; class Window; -class RuntimeController : public WindowClient, public IsolateClient { +class RuntimeController final : public WindowClient { public: - static std::unique_ptr Create(RuntimeDelegate* client); + RuntimeController(RuntimeDelegate& client, + const DartVM* vm, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue); + ~RuntimeController(); - void CreateDartController(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - int dirfd = -1); - DartController* dart_controller() const { return dart_controller_.get(); } + std::unique_ptr Clone() const; + + bool SetViewportMetrics(const ViewportMetrics& metrics); - void SetViewportMetrics(const ViewportMetrics& metrics); - void SetLocale(const std::string& language_code, + bool SetLocale(const std::string& language_code, const std::string& country_code); - void SetUserSettingsData(const std::string& data); - void SetSemanticsEnabled(bool enabled); - void BeginFrame(fxl::TimePoint frame_time); - void NotifyIdle(int64_t deadline); + bool SetUserSettingsData(const std::string& data); + + bool SetSemanticsEnabled(bool enabled); + + bool BeginFrame(fxl::TimePoint frame_time); + + bool NotifyIdle(int64_t deadline); - void DispatchPlatformMessage(fxl::RefPtr message); - void DispatchPointerDataPacket(const PointerDataPacket& packet); - void DispatchSemanticsAction(int32_t id, + bool DispatchPlatformMessage(fxl::RefPtr message); + + bool DispatchPointerDataPacket(const PointerDataPacket& packet); + + bool DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args); Dart_Port GetMainPort(); + std::string GetIsolateName(); + bool HasLivePorts(); + tonic::DartErrorHandleType GetLastError(); - private: - explicit RuntimeController(RuntimeDelegate* client); + fml::WeakPtr GetRootIsolate(); - Window* GetWindow(); + std::pair GetRootIsolateReturnCode(); + private: + struct WindowData { + ViewportMetrics viewport_metrics; + std::string language_code; + std::string country_code; + std::string user_settings_data = "{}"; + bool semantics_enabled = false; + }; + + RuntimeDelegate& client_; + const DartVM* vm_; + TaskRunners task_runners_; + fml::WeakPtr resource_context_; + fxl::RefPtr unref_queue_; + WindowData window_data_; + fml::WeakPtr root_isolate_; + std::pair root_isolate_return_code_ = {false, 0}; + + RuntimeController(RuntimeDelegate& client, + const DartVM* vm, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + WindowData data); + + Window* GetWindowIfAvailable(); + + bool FlushRuntimeStateToIsolate(); + + // |blink::WindowClient| std::string DefaultRouteName() override; + + // |blink::WindowClient| void ScheduleFrame() override; + + // |blink::WindowClient| void Render(Scene* scene) override; - void UpdateSemantics(SemanticsUpdate* update) override; - void HandlePlatformMessage(fxl::RefPtr message) override; - void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; - void DidShutdownMainIsolate() override; + // |blink::WindowClient| + void UpdateSemantics(SemanticsUpdate* update) override; - RuntimeDelegate* client_; - std::string language_code_; - std::string country_code_; - std::string user_settings_data_ = "{}"; - bool semantics_enabled_ = false; - std::unique_ptr dart_controller_; + // |blink::WindowClient| + void HandlePlatformMessage(fxl::RefPtr message) override; FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeController); }; diff --git a/runtime/runtime_delegate.cc b/runtime/runtime_delegate.cc index 6ec55c4c2e6a0..902672be06d8f 100644 --- a/runtime/runtime_delegate.cc +++ b/runtime/runtime_delegate.cc @@ -6,12 +6,6 @@ namespace blink { -RuntimeDelegate::~RuntimeDelegate() {} - -void RuntimeDelegate::DidCreateMainIsolate(Dart_Isolate isolate) {} - -void RuntimeDelegate::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} - -void RuntimeDelegate::DidShutdownMainIsolate() {} +RuntimeDelegate::~RuntimeDelegate() = default; } // namespace blink diff --git a/runtime/runtime_delegate.h b/runtime/runtime_delegate.h index 36650fe7fb70b..c6d6c0a92b2b4 100644 --- a/runtime/runtime_delegate.h +++ b/runtime/runtime_delegate.h @@ -18,14 +18,14 @@ namespace blink { class RuntimeDelegate { public: virtual std::string DefaultRouteName() = 0; + virtual void ScheduleFrame(bool regenerate_layer_tree = true) = 0; + virtual void Render(std::unique_ptr layer_tree) = 0; + virtual void UpdateSemantics(blink::SemanticsNodeUpdates update) = 0; - virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; - virtual void DidCreateMainIsolate(Dart_Isolate isolate); - virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate); - virtual void DidShutdownMainIsolate(); + virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; protected: virtual ~RuntimeDelegate(); diff --git a/runtime/runtime_init.cc b/runtime/runtime_init.cc deleted file mode 100644 index eda66e5495aed..0000000000000 --- a/runtime/runtime_init.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/runtime/runtime_init.h" - -#include "flutter/glue/trace_event.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/platform_impl.h" -#include "flutter/sky/engine/public/web/Sky.h" -#include "lib/fxl/logging.h" - -namespace blink { -namespace { - -PlatformImpl* g_platform_impl = nullptr; - -} // namespace - -void InitRuntime(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path) { - TRACE_EVENT0("flutter", "InitRuntime"); - - FXL_CHECK(!g_platform_impl); - g_platform_impl = new PlatformImpl(); - InitEngine(g_platform_impl); - InitDartVM(vm_snapshot_data, vm_snapshot_instructions, - default_isolate_snapshot_data, - default_isolate_snapshot_instructions, bundle_path); -} - -} // namespace blink diff --git a/runtime/runtime_init.h b/runtime/runtime_init.h deleted file mode 100644 index 515ae284e3460..0000000000000 --- a/runtime/runtime_init.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_RUNTIME_RUNTIME_INIT_H_ -#define FLUTTER_RUNTIME_RUNTIME_INIT_H_ - -#include -#include - -namespace blink { - -void InitRuntime(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path); - -} // namespace blink - -#endif // FLUTTER_RUNTIME_RUNTIME_INIT_H_ diff --git a/runtime/service_protocol.cc b/runtime/service_protocol.cc new file mode 100644 index 0000000000000..030901e54269d --- /dev/null +++ b/runtime/service_protocol.cc @@ -0,0 +1,279 @@ +// Copyright 2017 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 RAPIDJSON_HAS_STDSTRING 1 + +#include "flutter/runtime/service_protocol.h" + +#include + +#include +#include +#include +#include + +#include "lib/fxl/synchronization/waitable_event.h" +#include "rapidjson/stringbuffer.h" +#include "rapidjson/writer.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace blink { + +const fxl::StringView ServiceProtocol::kScreenshotExtensionName = + "_flutter.screenshot"; +const fxl::StringView ServiceProtocol::kScreenshotSkpExtensionName = + "_flutter.screenshotSkp"; +const fxl::StringView ServiceProtocol::kRunInViewExtensionName = + "_flutter.runInView"; +const fxl::StringView ServiceProtocol::kFlushUIThreadTasksExtensionName = + "_flutter.flushUIThreadTasks"; +const fxl::StringView ServiceProtocol::kSetAssetBundlePathExtensionName = + "_flutter.setAssetBundlePath"; + +static constexpr fxl::StringView kViewIdPrefx = "_flutterView/"; +static constexpr fxl::StringView kListViewsExtensionName = "_flutter.listViews"; + +ServiceProtocol::ServiceProtocol() + : endpoints_({ + // Private + kListViewsExtensionName, + + // Public + kScreenshotExtensionName, + kScreenshotSkpExtensionName, + kRunInViewExtensionName, + kFlushUIThreadTasksExtensionName, + kSetAssetBundlePathExtensionName, + }) {} + +ServiceProtocol::~ServiceProtocol() { + ToggleHooks(false); +} + +void ServiceProtocol::AddHandler(Handler* handler) { + std::lock_guard lock(handlers_mutex_); + handlers_.emplace(handler); +} + +void ServiceProtocol::RemoveHandler(Handler* handler) { + std::lock_guard lock(handlers_mutex_); + handlers_.erase(handler); +} + +void ServiceProtocol::ToggleHooks(bool set) { + for (const auto& endpoint : endpoints_) { + Dart_RegisterRootServiceRequestCallback( + endpoint.data(), // method + &ServiceProtocol::HandleMessage, // callback + set ? this : nullptr // user data + ); + } +} + +static void WriteServerErrorResponse(rapidjson::Document& document, + const char* message) { + document.SetObject(); + document.AddMember("code", -32000, document.GetAllocator()); + rapidjson::Value message_value; + message_value.SetString(message, document.GetAllocator()); + document.AddMember("message", message_value, document.GetAllocator()); +} + +bool ServiceProtocol::HandleMessage(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + Handler::ServiceProtocolMap params; + for (intptr_t i = 0; i < num_params; i++) { + params[fxl::StringView{param_keys[i]}] = fxl::StringView{param_values[i]}; + } + +#ifndef NDEBUG + FXL_DLOG(INFO) << "Service protcol method: " << method; + FXL_DLOG(INFO) << "Arguments: " << params.size(); + for (intptr_t i = 0; i < num_params; i++) { + FXL_DLOG(INFO) << " " << i + 1 << ": " << param_keys[i] << " = " + << param_values[i]; + } +#endif // NDEBUG + + rapidjson::Document document; + bool result = HandleMessage(fxl::StringView{method}, // + params, // + static_cast(user_data), // + document // + ); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + *json_object = strdup(buffer.GetString()); + +#ifndef NDEBUG + FXL_DLOG(INFO) << "Response: " << *json_object; + FXL_DLOG(INFO) << "RPC Result: " << result; +#endif // NDEBUG + + return result; +} + +bool ServiceProtocol::HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + ServiceProtocol* service_protocol, + rapidjson::Document& response) { + if (service_protocol == nullptr) { + WriteServerErrorResponse(response, "Service protocol unavailable."); + return false; + } + + return service_protocol->HandleMessage(method, params, response); +} + +FXL_WARN_UNUSED_RESULT +static bool HandleMessageOnHandler( + ServiceProtocol::Handler* handler, + fxl::StringView method, + const ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& document) { + FXL_DCHECK(handler); + fxl::AutoResetWaitableEvent latch; + bool result = false; + fml::TaskRunner::RunNowOrPostTask( + handler->GetServiceProtocolHandlerTaskRunner(method), + [&latch, // + &result, // + &handler, // + &method, // + ¶ms, // + &document // + ]() { + result = + handler->HandleServiceProtocolMessage(method, params, document); + latch.Signal(); + }); + latch.Wait(); + return result; +} + +bool ServiceProtocol::HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + rapidjson::Document& response) const { + if (method == kListViewsExtensionName) { + // So far, this is the only built-in method that does not forward to the + // dynamic set of handlers. + return HandleListViewsMethod(response); + } + + std::lock_guard lock(handlers_mutex_); + + if (handlers_.size() == 0) { + WriteServerErrorResponse(response, + "There are no running service protocol handlers."); + return false; + } + + // Find the handler by its "viewId" in the params. + auto view_id_param_found = params.find(fxl::StringView{"viewId"}); + if (view_id_param_found != params.end()) { + auto handler = reinterpret_cast(std::stoull( + view_id_param_found->second.data() + kViewIdPrefx.size(), nullptr, 16)); + auto handler_found = handlers_.find(handler); + if (handler_found != handlers_.end()) { + return HandleMessageOnHandler(handler, method, params, response); + } + } + + // Handle legacy calls that do not specify a handler in their args. + // TODO(chinmaygarde): Deprecate these calls in the tools and remove these + // fallbacks. + if (method == kScreenshotExtensionName || + method == kScreenshotSkpExtensionName) { + return HandleMessageOnHandler(*handlers_.begin(), method, params, response); + } + + WriteServerErrorResponse( + response, + "Service protocol could not handle or find a handler for the " + "requested method."); + return false; +} + +static std::string CreateFlutterViewID(intptr_t handler) { + std::stringstream stream; + stream << kViewIdPrefx << "0x" << std::hex << handler; + return stream.str(); +} + +static std::string CreateIsolateID(int64_t isolate) { + std::stringstream stream; + stream << "isolates/" << isolate; + return stream.str(); +} + +void ServiceProtocol::Handler::Description::Write( + Handler* handler, + rapidjson::Value& view, + rapidjson::MemoryPoolAllocator<>& allocator) const { + view.SetObject(); + view.AddMember("type", "FlutterView", allocator); + view.AddMember("id", CreateFlutterViewID(reinterpret_cast(handler)), + allocator); + if (isolate_port != 0) { + rapidjson::Value isolate(rapidjson::Type::kObjectType); + { + isolate.AddMember("type", "@Isolate", allocator); + isolate.AddMember("fixedId", true, allocator); + isolate.AddMember("id", CreateIsolateID(isolate_port), allocator); + isolate.AddMember("name", isolate_name, allocator); + isolate.AddMember("number", isolate_port, allocator); + } + view.AddMember("isolate", isolate, allocator); + } +} + +bool ServiceProtocol::HandleListViewsMethod( + rapidjson::Document& response) const { + // Collect handler descriptions on their respective task runners. + std::lock_guard lock(handlers_mutex_); + std::vector> descriptions; + for (const auto& handler : handlers_) { + fxl::AutoResetWaitableEvent latch; + Handler::Description description; + + fml::TaskRunner::RunNowOrPostTask( + handler->GetServiceProtocolHandlerTaskRunner( + kListViewsExtensionName), // task runner + [&latch, // + &description, // + &handler // + ]() { + description = handler->GetServiceProtocolDescription(); + latch.Signal(); + }); + latch.Wait(); + descriptions.emplace_back(std::make_pair( + reinterpret_cast(handler), std::move(description))); + } + + auto& allocator = response.GetAllocator(); + + // Construct the response objects. + response.SetObject(); + response.AddMember("type", "FlutterViewList", allocator); + + rapidjson::Value viewsList(rapidjson::Type::kArrayType); + for (const auto& description : descriptions) { + rapidjson::Value view(rapidjson::Type::kObjectType); + description.second.Write(reinterpret_cast(description.first), + view, allocator); + viewsList.PushBack(view, allocator); + } + + response.AddMember("views", viewsList, allocator); + + return true; +} + +} // namespace blink diff --git a/runtime/service_protocol.h b/runtime/service_protocol.h new file mode 100644 index 0000000000000..056f7389ea79a --- /dev/null +++ b/runtime/service_protocol.h @@ -0,0 +1,99 @@ +// Copyright 2017 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_RUNTIME_SERVICE_PROTOCOL_H_ +#define FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ + +#include +#include +#include +#include + +#include "flutter/fml/task_runner.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/strings/string_view.h" +#include "lib/fxl/synchronization/thread_annotations.h" +#include "third_party/rapidjson/rapidjson/document.h" + +namespace blink { + +class ServiceProtocol { + public: + static const fxl::StringView kScreenshotExtensionName; + static const fxl::StringView kScreenshotSkpExtensionName; + static const fxl::StringView kRunInViewExtensionName; + static const fxl::StringView kFlushUIThreadTasksExtensionName; + static const fxl::StringView kSetAssetBundlePathExtensionName; + + class Handler { + public: + struct Description { + int64_t isolate_port = 0 /* illegal port by default. */; + std::string isolate_name; + + Description() {} + + Description(int64_t p_isolate_port, std::string p_isolate_name) + : isolate_port(p_isolate_port), + isolate_name(std::move(p_isolate_name)) {} + + void Write(Handler* handler, + rapidjson::Value& value, + rapidjson::MemoryPoolAllocator<>& allocator) const; + }; + + using ServiceProtocolMap = std::map; + + virtual fxl::RefPtr GetServiceProtocolHandlerTaskRunner( + fxl::StringView method) const = 0; + + virtual Description GetServiceProtocolDescription() const = 0; + + virtual bool HandleServiceProtocolMessage( + fxl::StringView method, // one if the extension names specified above. + const ServiceProtocolMap& params, + rapidjson::Document& response) = 0; + }; + + ServiceProtocol(); + + ~ServiceProtocol(); + + void ToggleHooks(bool set); + + void AddHandler(Handler* handler); + + void RemoveHandler(Handler* handler); + + private: + const std::set endpoints_; + mutable std::mutex handlers_mutex_; + std::set handlers_; + + FXL_WARN_UNUSED_RESULT + static bool HandleMessage(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + FXL_WARN_UNUSED_RESULT + static bool HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + ServiceProtocol* service_protocol, + rapidjson::Document& response); + FXL_WARN_UNUSED_RESULT + bool HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + rapidjson::Document& response) const; + + FXL_WARN_UNUSED_RESULT + bool HandleListViewsMethod(rapidjson::Document& response) const; + + FXL_DISALLOW_COPY_AND_ASSIGN(ServiceProtocol); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index f9e25a3c8d6d7..25edcfa23bd85 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("$flutter_root/testing/testing.gni") + # Template to generate a dart embedder resource.cc file. # Required invoker inputs: # String output (name of output file) @@ -61,18 +63,18 @@ source_set("common") { "animator.h", "engine.cc", "engine.h", - "null_platform_view.cc", - "null_platform_view.h", - "null_rasterizer.cc", - "null_rasterizer.h", + "io_manager.cc", + "io_manager.h", + "isolate_configuration.cc", + "isolate_configuration.h", "picture_serializer.cc", "picture_serializer.h", "platform_view.cc", "platform_view.h", - "platform_view_service_protocol.cc", - "platform_view_service_protocol.h", "rasterizer.cc", "rasterizer.h", + "run_configuration.cc", + "run_configuration.h", "shell.cc", "shell.h", "skia_event_tracer_impl.cc", @@ -81,8 +83,8 @@ source_set("common") { "surface.h", "switches.cc", "switches.h", - "tracing_controller.cc", - "tracing_controller.h", + "thread_host.cc", + "thread_host.h", "vsync_waiter.cc", "vsync_waiter.h", "vsync_waiter_fallback.cc", @@ -90,8 +92,6 @@ source_set("common") { ] deps = [ - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/platform:libdart_platform", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", @@ -99,10 +99,13 @@ source_set("common") { "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", + "$flutter_root/sky/engine/platform", "$flutter_root/sky/engine/wtf", "$flutter_root/synchronization", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/platform:libdart_platform", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", @@ -112,7 +115,23 @@ source_set("common") { "//topaz/lib/tonic", ] - public_configs = [ - "$flutter_root:config", + public_configs = [ "$flutter_root:config" ] +} + +executable("shell_unittests") { + testonly = true + + sources = [ + "shell_unittests.cc", + ] + deps = [ + ":common", + "$flutter_root/fml", + "$flutter_root/lib/snapshot", + "$flutter_root/testing", + "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", + "//third_party/skia", + "//topaz/lib/tonic", ] } diff --git a/shell/common/animator.cc b/shell/common/animator.cc index d5679a0160a86..60177a18f89ab 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -4,19 +4,18 @@ #include "flutter/shell/common/animator.h" -#include "flutter/common/threads.h" -#include "flutter/fml/trace_event.h" +#include "flutter/glue/trace_event.h" #include "lib/fxl/time/stopwatch.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -Animator::Animator(fml::WeakPtr rasterizer, - VsyncWaiter* waiter, - Engine* engine) - : rasterizer_(rasterizer), - waiter_(waiter), - engine_(engine), +Animator::Animator(Delegate& delegate, + blink::TaskRunners task_runners, + std::unique_ptr waiter) + : delegate_(delegate), + task_runners_(std::move(task_runners)), + waiter_(std::move(waiter)), last_begin_frame_time_(), dart_frame_deadline_(0), layer_tree_pipeline_(fxl::MakeRefCounted(2)), @@ -79,7 +78,6 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, // If we still don't have valid continuation, the pipeline is currently // full because the consumer is being too slow. Try again at the next // frame interval. - TRACE_EVENT_INSTANT0("flutter", "ConsumerSlowDefer"); RequestFrame(); return; } @@ -94,13 +92,13 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, { TRACE_EVENT2("flutter", "Framework Workload", "mode", "basic", "frame", FrameParity()); - engine_->BeginFrame(last_begin_frame_time_); + delegate_.OnAnimatorBeginFrame(*this, last_begin_frame_time_); } if (!frame_scheduled_) { // We don't have another frame pending, so we're waiting on user input // or I/O. Allow the Dart VM 100 ms. - engine_->NotifyIdle(dart_frame_deadline_ + 100000); + delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_ + 100000); } } @@ -120,15 +118,7 @@ void Animator::Render(std::unique_ptr layer_tree) { // Commit the pending continuation. producer_continuation_.Complete(std::move(layer_tree)); - blink::Threads::Gpu()->PostTask([ - rasterizer = rasterizer_, pipeline = layer_tree_pipeline_, - frame_id = FrameParity() - ]() { - if (!rasterizer.get()) - return; - TRACE_EVENT2("flutter", "GPU Workload", "mode", "basic", "frame", frame_id); - rasterizer->Draw(pipeline); - }); + delegate_.OnAnimatorDraw(*this, layer_tree_pipeline_); } bool Animator::CanReuseLastLayerTree() { @@ -137,10 +127,7 @@ bool Animator::CanReuseLastLayerTree() { void Animator::DrawLastLayerTree() { pending_frame_semaphore_.Signal(); - blink::Threads::Gpu()->PostTask([rasterizer = rasterizer_]() { - if (rasterizer.get()) - rasterizer->DrawLastLayerTree(); - }); + delegate_.OnAnimatorDrawLastLayerTree(*this); } void Animator::RequestFrame(bool regenerate_layer_tree) { @@ -164,31 +151,31 @@ void Animator::RequestFrame(bool regenerate_layer_tree) { // started an expensive operation right after posting this message however. // To support that, we need edge triggered wakes on VSync. - blink::Threads::UI()->PostTask( - [ self = weak_factory_.GetWeakPtr(), frame_number = frame_number_ ]() { - if (!self.get()) { - return; - } - TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", - frame_number); - self->AwaitVSync(); - }); + task_runners_.GetUITaskRunner()->PostTask([self = weak_factory_.GetWeakPtr(), + frame_number = frame_number_]() { + if (!self.get()) { + return; + } + TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", frame_number); + self->AwaitVSync(); + }); frame_scheduled_ = true; } void Animator::AwaitVSync() { - waiter_->AsyncWaitForVsync([self = weak_factory_.GetWeakPtr()]( - fxl::TimePoint frame_start_time, fxl::TimePoint frame_target_time) { - if (self) { - if (self->CanReuseLastLayerTree()) { - self->DrawLastLayerTree(); - } else { - self->BeginFrame(frame_start_time, frame_target_time); - } - } - }); + waiter_->AsyncWaitForVsync( + [self = weak_factory_.GetWeakPtr()](fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { + if (self) { + if (self->CanReuseLastLayerTree()) { + self->DrawLastLayerTree(); + } else { + self->BeginFrame(frame_start_time, frame_target_time); + } + } + }); - engine_->NotifyIdle(dart_frame_deadline_); + delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_); } } // namespace shell diff --git a/shell/common/animator.h b/shell/common/animator.h index bc2ee21441b29..53b2ac6884158 100644 --- a/shell/common/animator.h +++ b/shell/common/animator.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_SHELL_COMMON_ANIMATOR_H_ #define FLUTTER_SHELL_COMMON_ANIMATOR_H_ -#include "flutter/shell/common/engine.h" +#include "flutter/common/task_runners.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/vsync_waiter.h" #include "flutter/synchronization/pipeline.h" @@ -16,17 +16,28 @@ namespace shell { -class Animator { +class Animator final { public: - Animator(fml::WeakPtr rasterizer, - VsyncWaiter* waiter, - Engine* engine); + class Delegate { + public: + virtual void OnAnimatorBeginFrame(const Animator& animator, + fxl::TimePoint frame_time) = 0; - ~Animator(); + virtual void OnAnimatorNotifyIdle(const Animator& animator, + int64_t deadline) = 0; + + virtual void OnAnimatorDraw( + const Animator& animator, + fxl::RefPtr> pipeline) = 0; + + virtual void OnAnimatorDrawLastLayerTree(const Animator& animator) = 0; + }; - void set_rasterizer(fml::WeakPtr rasterizer) { - rasterizer_ = rasterizer; - } + Animator(Delegate& delegate, + blink::TaskRunners task_runners, + std::unique_ptr waiter); + + ~Animator(); void RequestFrame(bool regenerate_layer_tree = true); @@ -51,9 +62,9 @@ class Animator { const char* FrameParity(); - fml::WeakPtr rasterizer_; - VsyncWaiter* waiter_; - Engine* engine_; + Delegate& delegate_; + blink::TaskRunners task_runners_; + std::unique_ptr waiter_; fxl::TimePoint last_begin_frame_time_; int64_t dart_frame_deadline_; @@ -67,7 +78,7 @@ class Animator { bool dimension_change_pending_; SkISize last_layer_tree_size_; - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(Animator); }; diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 3629b729c29f7..3d6fd496d3fa9 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -4,47 +4,20 @@ #include "flutter/shell/common/engine.h" -#if OS(WIN) -#include -#include -#define access _access -#define R_OK 0x4 - -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) -#endif - -#else -#include -#include -#include -#endif // OS(WIN) - -#include -#include #include #include -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/unzipper_provider.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/assets/asset_provider.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/runtime/asset_font_selector.h" -#include "flutter/runtime/dart_controller.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/runtime_init.h" +#include "flutter/runtime/platform_impl.h" #include "flutter/runtime/test_font_selector.h" #include "flutter/shell/common/animator.h" #include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" #include "flutter/sky/engine/public/web/Sky.h" #include "lib/fxl/files/eintr_wrapper.h" #include "lib/fxl/files/file.h" @@ -55,380 +28,208 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" -namespace shell { -namespace { - -constexpr char kAssetChannel[] = "flutter/assets"; -constexpr char kLifecycleChannel[] = "flutter/lifecycle"; -constexpr char kNavigationChannel[] = "flutter/navigation"; -constexpr char kLocalizationChannel[] = "flutter/localization"; -constexpr char kSettingsChannel[] = "flutter/settings"; - -#if OS(WIN) -void FindAndReplaceInPlace(std::string& str, - const std::string& findStr, - const std::string& replaceStr) { - size_t pos = 0; - while ((pos = str.find(findStr, pos)) != std::string::npos) { - str.replace(pos, findStr.length(), replaceStr); - pos += replaceStr.length(); - } -} -#endif - -std::string SanitizePath(const std::string& path) { -#if OS(WIN) - std::string sanitized = path; - FindAndReplaceInPlace(sanitized, "\\\\", "/"); - if ((sanitized.length() > 2) && (sanitized[1] == ':')) { - // Path begins with a drive letter. - sanitized = '/' + sanitized; - } - return sanitized; -#else - return path; +#ifdef ERROR +#undef ERROR #endif -} - -bool PathExists(const std::string& path) { - return access(path.c_str(), R_OK) == 0; -} - -std::string FindPackagesPath(const std::string& main_dart) { - std::string directory = files::GetDirectoryName(main_dart); - std::string packages_path = directory + "/.packages"; - if (!PathExists(packages_path)) { - directory = files::GetDirectoryName(directory); - packages_path = directory + "/.packages"; - if (!PathExists(packages_path)) - packages_path = std::string(); - } - return packages_path; -} -std::string GetScriptUriFromPath(const std::string& path) { - return "file://" + SanitizePath(path); -} - -} // namespace +namespace shell { -Engine::Engine(PlatformView* platform_view) - : platform_view_(platform_view->GetWeakPtr()), - animator_(std::make_unique( - platform_view->rasterizer().GetWeakRasterizerPtr(), - platform_view->GetVsyncWaiter(), - this)), +static constexpr char kAssetChannel[] = "flutter/assets"; +static constexpr char kLifecycleChannel[] = "flutter/lifecycle"; +static constexpr char kNavigationChannel[] = "flutter/navigation"; +static constexpr char kLocalizationChannel[] = "flutter/localization"; +static constexpr char kSettingsChannel[] = "flutter/settings"; + +Engine::Engine(Delegate& delegate, + const blink::DartVM& vm, + blink::TaskRunners task_runners, + blink::Settings settings, + std::unique_ptr animator, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue) + : delegate_(delegate), + settings_(std::move(settings)), + animator_(std::move(animator)), + legacy_sky_platform_(settings_.using_blink ? new blink::PlatformImpl() + : nullptr), load_script_error_(tonic::kNoError), - user_settings_data_("{}"), activity_running_(false), have_surface_(false), - weak_factory_(this) {} + weak_factory_(this) { + weak_prototype_ = weak_factory_.GetWeakPtr(); -Engine::~Engine() {} + if (legacy_sky_platform_) { + // TODO: Remove this legacy call along with the platform. This is what makes + // the engine unable to run from multiple threads in the legacy + // configuration. + blink::InitEngine(legacy_sky_platform_.get()); + } -void Engine::set_rasterizer(fml::WeakPtr rasterizer) { - animator_->set_rasterizer(rasterizer); + // Runtime controller is initialized here because it takes a reference to this + // object as its delegate. The delegate may be called in the constructor and + // we want to be fully initilazed by that point. + runtime_controller_ = std::make_unique( + *this, // runtime delegate + &vm, // VM + std::move(task_runners), // task runners + std::move(resource_context), // resource context + std::move(unref_queue) // skia unref queue + ); } -fml::WeakPtr Engine::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); +Engine::~Engine() { + if (legacy_sky_platform_) { + blink::ShutdownEngine(/* legacy_sky_platform_ */); + } } -#if !FLUTTER_AOT -#elif OS(IOS) -#elif OS(ANDROID) -// TODO(bkonyi): do we even get here for Windows? -static const uint8_t* MemMapSnapshot(const std::string& aot_snapshot_path, - const std::string& default_file_name, - const std::string& settings_file_name, - bool executable) { - std::string asset_path; - if (settings_file_name.empty()) { - asset_path = aot_snapshot_path + "/" + default_file_name; - } else { - asset_path = aot_snapshot_path + "/" + settings_file_name; +fml::WeakPtr Engine::GetWeakPtr() const { + return weak_prototype_; +} + +bool Engine::UpdateAssetManager( + fxl::RefPtr new_asset_manager) { + if (asset_manager_ == new_asset_manager) { + return false; } -#if OS(WIN) - HANDLE file_handle_ = - CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, - FILE_SHARE_READ, nullptr, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); + asset_manager_ = new_asset_manager; - if (file_handle_ == INVALID_HANDLE_VALUE) { - return; + if (!asset_manager_) { + return false; } - size_ = GetFileSize(file_handle_, nullptr); - if (size_ == INVALID_FILE_SIZE) { - size_ = 0; - return; + if (settings_.using_blink) { + // Using blink as the text engine. + blink::FontFallbackList::SetUseTestFonts(settings_.use_test_fonts); + } else { + // Using libTXT as the text engine. + if (settings_.use_test_fonts) { + blink::FontCollection::ForProcess().RegisterTestFonts(); + } else { + blink::FontCollection::ForProcess().RegisterFonts(*asset_manager_.get()); + } } - int mapping_flags = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; - mapping_handle_ = CreateFileMapping(file_handle_, nullptr, mapping_flags, 0, - size_, nullptr); - - CloseHandle(file_handle_); + return true; +} - if (mapping_handle_ == INVALID_HANDLE_VALUE) { - return; +bool Engine::Restart(RunConfiguration configuration) { + TRACE_EVENT0("flutter", "Engine::Restart"); + if (!configuration.IsValid()) { + FXL_LOG(ERROR) << "Engine run configuration was invalid."; + return false; } + runtime_controller_ = runtime_controller_->Clone(); + UpdateAssetManager(nullptr); + return Run(std::move(configuration)); +} - int access_flags = FILE_MAP_READ; - if (executable) { - access_flags |= FILE_MAP_EXECUTE; +bool Engine::Run(RunConfiguration configuration) { + if (!configuration.IsValid()) { + FXL_LOG(ERROR) << "Engine run configuration was invalid."; + return false; } - auto mapping = MapViewOfFile(mapping_handle_, access_flags, 0, 0, size_); - if (mapping == INVALID_HANDLE_VALUE) { - CloseHandle(mapping_handle_); - mapping_handle_ = INVALID_HANDLE_VALUE; - return; + if (!PrepareAndLaunchIsolate(std::move(configuration))) { + return false; } - void* symbol = static_cast(mapping); - if (symbol == NULL) { - return nullptr; - } -#else - struct stat info; - if (stat(asset_path.c_str(), &info) < 0) { - return nullptr; - } - int64_t asset_size = info.st_size; + auto isolate = runtime_controller_->GetRootIsolate(); - fxl::UniqueFD fd(HANDLE_EINTR(open(asset_path.c_str(), O_RDONLY))); - if (fd.get() == -1) { - return nullptr; - } + bool isolate_running = + isolate && isolate->GetPhase() == blink::DartIsolate::Phase::Running; - int mmap_flags = PROT_READ; - if (executable) - mmap_flags |= PROT_EXEC; + if (isolate_running) { + tonic::DartState::Scope scope(isolate.get()); - void* symbol = mmap(NULL, asset_size, mmap_flags, MAP_PRIVATE, fd.get(), 0); - if (symbol == MAP_FAILED) { - return nullptr; - } -#endif - return reinterpret_cast(symbol); -} -#endif + if (settings_.root_isolate_create_callback) { + settings_.root_isolate_create_callback(); + } -static const uint8_t* default_isolate_snapshot_data = nullptr; -static const uint8_t* default_isolate_snapshot_instr = nullptr; - -void Engine::Init(const std::string& bundle_path) { - const uint8_t* vm_snapshot_data; - const uint8_t* vm_snapshot_instr; -#if !FLUTTER_AOT - vm_snapshot_data = ::kDartVmSnapshotData; - vm_snapshot_instr = ::kDartVmSnapshotInstructions; - default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; - default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; -#elif OS(IOS) - const char* kDartApplicationLibraryPath = "App.framework/App"; - const char* application_library_path = kDartApplicationLibraryPath; - const blink::Settings& settings = blink::Settings::Get(); - const std::string& application_library_path_setting = - settings.application_library_path; - if (!application_library_path_setting.empty()) { - application_library_path = application_library_path_setting.c_str(); - } - dlerror(); // clear previous errors on thread - void* library_handle = dlopen(application_library_path, RTLD_NOW); - const char* err = dlerror(); - if (err != nullptr) { - FXL_LOG(FATAL) << "dlopen failed: " << err; - } - vm_snapshot_data = reinterpret_cast( - dlsym(library_handle, "kDartVmSnapshotData")); - vm_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "kDartVmSnapshotInstructions")); - default_isolate_snapshot_data = reinterpret_cast( - dlsym(library_handle, "kDartIsolateSnapshotData")); - default_isolate_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "kDartIsolateSnapshotInstructions")); -#elif OS(ANDROID) || OS(WIN) - const blink::Settings& settings = blink::Settings::Get(); - const std::string& aot_shared_library_path = settings.aot_shared_library_path; - const std::string& aot_snapshot_path = settings.aot_snapshot_path; - - if (!aot_shared_library_path.empty()) { - FXL_CHECK(aot_snapshot_path.empty()); - dlerror(); // clear previous errors on thread - void* library_handle = dlopen(aot_shared_library_path.c_str(), RTLD_NOW); - const char* err = dlerror(); - if (err != nullptr) { - FXL_LOG(FATAL) << "dlopen failed: " << err; + if (settings_.root_isolate_shutdown_callback) { + isolate->AddIsolateShutdownCallback( + settings_.root_isolate_shutdown_callback); + } + + // Blink uses a per isolate font selector. + if (settings_.using_blink) { + if (settings_.use_test_fonts) { + blink::TestFontSelector::Install(); + } else { + blink::AssetFontSelector::Install(asset_manager_); + } } - vm_snapshot_data = reinterpret_cast( - dlsym(library_handle, "_kDartVmSnapshotData")); - vm_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "_kDartVmSnapshotInstructions")); - default_isolate_snapshot_data = reinterpret_cast( - dlsym(library_handle, "_kDartIsolateSnapshotData")); - default_isolate_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "_kDartIsolateSnapshotInstructions")); - } else { - FXL_CHECK(!aot_snapshot_path.empty()); - vm_snapshot_data = - MemMapSnapshot(aot_snapshot_path, "vm_snapshot_data", - settings.aot_vm_snapshot_data_filename, false); - vm_snapshot_instr = - MemMapSnapshot(aot_snapshot_path, "vm_snapshot_instr", - settings.aot_vm_snapshot_instr_filename, true); - default_isolate_snapshot_data = - MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_data", - settings.aot_isolate_snapshot_data_filename, false); - default_isolate_snapshot_instr = - MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_instr", - settings.aot_isolate_snapshot_instr_filename, true); } -#else -#error Unknown OS -#endif - blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, - default_isolate_snapshot_data, - default_isolate_snapshot_instr, bundle_path); + + return isolate_running; } -const std::string Engine::main_entrypoint_ = "main"; +bool Engine::PrepareAndLaunchIsolate(RunConfiguration configuration) { + TRACE_EVENT0("flutter", "Engine::PrepareAndLaunchIsolate"); -void Engine::RunBundle(const std::string& bundle_path, - const std::string& entrypoint, - bool reuse_runtime_controller) { - TRACE_EVENT0("flutter", "Engine::RunBundle"); - ConfigureAssetBundle(bundle_path); - DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, - reuse_runtime_controller); -} + UpdateAssetManager(configuration.GetAssetManager()); -void Engine::DoRunBundle(const std::string& script_uri, - const std::string& entrypoint, - bool reuse_runtime_controller) { - ConfigureRuntime(script_uri, reuse_runtime_controller); - if (blink::IsRunningPrecompiledCode()) { - runtime_->dart_controller()->RunFromPrecompiledSnapshot(entrypoint); - } else { - std::vector kernel; - if (GetAssetAsBuffer(blink::kKernelAssetKey, &kernel)) { - runtime_->dart_controller()->RunFromKernel(kernel, entrypoint); - return; - } - std::vector snapshot; - if (!GetAssetAsBuffer(blink::kSnapshotAssetKey, &snapshot)) - return; - runtime_->dart_controller()->RunFromScriptSnapshot( - snapshot.data(), snapshot.size(), entrypoint); + auto isolate_configuration = configuration.TakeIsolateConfiguration(); + + auto isolate = runtime_controller_->GetRootIsolate(); + + if (!isolate_configuration->PrepareIsolate(isolate)) { + FXL_DLOG(ERROR) << "Could not prepare to run the isolate."; + return false; } -} -// TODO(jsimmons): merge this with RunBundle -void Engine::RunBundleWithAssets( - fxl::RefPtr asset_provider, - const std::string& bundle_path, - const std::string& entrypoint, - bool reuse_runtime_controller) { - TRACE_EVENT0("flutter", "Engine::RunBundleWithAssets"); - asset_provider_ = asset_provider; - DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, - reuse_runtime_controller); -} - -void Engine::RunBundleAndSource(const std::string& bundle_path, - const std::string& main, - const std::string& packages, - bool reuse_runtime_controller) { - TRACE_EVENT0("flutter", "Engine::RunBundleAndSource"); - FXL_CHECK(!blink::IsRunningPrecompiledCode()) - << "Cannot run from source in a precompiled build."; - std::string packages_path = packages; - if (packages_path.empty()) - packages_path = FindPackagesPath(main); - - if (!bundle_path.empty()) - ConfigureAssetBundle(bundle_path); - - ConfigureRuntime(main, reuse_runtime_controller); - - if (blink::GetKernelPlatformBinary() != nullptr) { - std::vector kernel; - if (!files::ReadFileToVector(main, &kernel)) { - load_script_error_ = tonic::kUnknownErrorType; - } - load_script_error_ = runtime_->dart_controller()->RunFromKernel(kernel); - } else { - load_script_error_ = - runtime_->dart_controller()->RunFromSource(main, packages_path); + if (!isolate->Run(configuration.GetEntrypoint())) { + FXL_DLOG(ERROR) << "Could not run the isolate."; + return false; } + + return true; } void Engine::BeginFrame(fxl::TimePoint frame_time) { TRACE_EVENT0("flutter", "Engine::BeginFrame"); - if (runtime_) - runtime_->BeginFrame(frame_time); + runtime_controller_->BeginFrame(frame_time); } void Engine::NotifyIdle(int64_t deadline) { TRACE_EVENT0("flutter", "Engine::NotifyIdle"); - if (runtime_) - runtime_->NotifyIdle(deadline); -} - -void Engine::RunFromSource(const std::string& main, - const std::string& packages, - const std::string& bundle_path) { - RunBundleAndSource(bundle_path, main, packages); + runtime_controller_->NotifyIdle(deadline); } -void Engine::SetAssetBundlePath(const std::string& bundle_path) { - TRACE_EVENT0("flutter", "Engine::SetAssetBundlePath"); - ConfigureAssetBundle(bundle_path); +std::pair Engine::GetUIIsolateReturnCode() { + return runtime_controller_->GetRootIsolateReturnCode(); } Dart_Port Engine::GetUIIsolateMainPort() { - if (!runtime_) - return ILLEGAL_PORT; - return runtime_->GetMainPort(); + return runtime_controller_->GetMainPort(); } std::string Engine::GetUIIsolateName() { - if (!runtime_) { - return ""; - } - return runtime_->GetIsolateName(); + return runtime_controller_->GetIsolateName(); } bool Engine::UIIsolateHasLivePorts() { - if (!runtime_) - return false; - return runtime_->HasLivePorts(); + return runtime_controller_->HasLivePorts(); } tonic::DartErrorHandleType Engine::GetUIIsolateLastError() { - if (!runtime_) - return tonic::kNoError; - return runtime_->GetLastError(); + return runtime_controller_->GetLastError(); } tonic::DartErrorHandleType Engine::GetLoadScriptError() { return load_script_error_; } -void Engine::OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation) { - blink::Threads::Gpu()->PostTask(gpu_continuation); +void Engine::OnOutputSurfaceCreated() { have_surface_ = true; StartAnimatorIfPossible(); - if (runtime_) - ScheduleFrame(); + ScheduleFrame(); } -void Engine::OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation) { +void Engine::OnOutputSurfaceDestroyed() { have_surface_ = false; StopAnimator(); - blink::Threads::Gpu()->PostTask(gpu_continuation); } void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { @@ -436,8 +237,7 @@ void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { viewport_metrics_.physical_height != metrics.physical_height || viewport_metrics_.physical_width != metrics.physical_width; viewport_metrics_ = metrics; - if (runtime_) - runtime_->SetViewportMetrics(viewport_metrics_); + runtime_controller_->SetViewportMetrics(viewport_metrics_); if (animator_) { if (dimensions_changed) animator_->SetDimensionChangePending(); @@ -459,8 +259,7 @@ void Engine::DispatchPlatformMessage( return; } - if (runtime_) { - runtime_->DispatchPlatformMessage(std::move(message)); + if (runtime_controller_->DispatchPlatformMessage(std::move(message))) { return; } @@ -493,7 +292,6 @@ bool Engine::HandleLifecyclePlatformMessage(blink::PlatformMessage* message) { bool Engine::HandleNavigationPlatformMessage( fxl::RefPtr message) { - FXL_DCHECK(!runtime_); const auto& data = message->data(); rapidjson::Document document; @@ -532,99 +330,33 @@ bool Engine::HandleLocalizationPlatformMessage( if (!language.IsString() || !country.IsString()) return false; - language_code_ = language.GetString(); - country_code_ = country.GetString(); - if (runtime_) - runtime_->SetLocale(language_code_, country_code_); - return true; + return runtime_controller_->SetLocale(language.GetString(), + country.GetString()); } void Engine::HandleSettingsPlatformMessage(blink::PlatformMessage* message) { const auto& data = message->data(); std::string jsonData(reinterpret_cast(data.data()), data.size()); - user_settings_data_ = jsonData; - if (runtime_) { - runtime_->SetUserSettingsData(user_settings_data_); - if (have_surface_) - ScheduleFrame(); + if (runtime_controller_->SetUserSettingsData(std::move(jsonData)) && + have_surface_) { + ScheduleFrame(); } } -void Engine::DispatchPointerDataPacket(const PointerDataPacket& packet) { - if (runtime_) - runtime_->DispatchPointerDataPacket(packet); +void Engine::DispatchPointerDataPacket(const blink::PointerDataPacket& packet) { + runtime_controller_->DispatchPointerDataPacket(packet); } void Engine::DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args) { - if (runtime_) - runtime_->DispatchSemanticsAction(id, action, std::move(args)); + runtime_controller_->DispatchSemanticsAction(id, action, std::move(args)); } void Engine::SetSemanticsEnabled(bool enabled) { - semantics_enabled_ = enabled; - if (runtime_) - runtime_->SetSemanticsEnabled(semantics_enabled_); -} - -void Engine::ConfigureAssetBundle(const std::string& path) { - asset_provider_ = fxl::MakeRefCounted(path); - - struct stat stat_result = {}; - - // TODO(abarth): We should reset directory_asset_bundle_, but that might break - // custom font loading in hot reload. - - if (::stat(path.c_str(), &stat_result) != 0) { - FXL_LOG(INFO) << "Could not configure asset bundle at path: " << path; - return; - } - - std::string flx_path; - if (S_ISDIR(stat_result.st_mode)) { - flx_path = files::GetDirectoryName(path) + "/app.flx"; - } else if (S_ISREG(stat_result.st_mode)) { - flx_path = path; - } - - if (PathExists(flx_path)) { - asset_store_ = fxl::MakeRefCounted( - blink::GetUnzipperProviderForPath(flx_path)); - } -} - -void Engine::ConfigureRuntime(const std::string& script_uri, - bool reuse_runtime_controller) { - if (runtime_ && reuse_runtime_controller) { - return; - } - runtime_ = blink::RuntimeController::Create(this); - runtime_->CreateDartController(std::move(script_uri), - default_isolate_snapshot_data, - default_isolate_snapshot_instr); - runtime_->SetViewportMetrics(viewport_metrics_); - runtime_->SetLocale(language_code_, country_code_); - runtime_->SetUserSettingsData(user_settings_data_); - runtime_->SetSemanticsEnabled(semantics_enabled_); -} - -void Engine::DidCreateMainIsolate(Dart_Isolate isolate) { - if (blink::Settings::Get().use_test_fonts) { - blink::TestFontSelector::Install(); - if (!blink::Settings::Get().using_blink) - blink::FontCollection::ForProcess().RegisterTestFonts(); - } else if (asset_provider_) { - blink::AssetFontSelector::Install(asset_provider_); - if (!blink::Settings::Get().using_blink) { - blink::FontCollection::ForProcess().RegisterFontsFromAssetProvider( - asset_provider_); - } - } + runtime_controller_->SetSemanticsEnabled(enabled); } -void Engine::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} - void Engine::StopAnimator() { animator_->Stop(); } @@ -659,49 +391,34 @@ void Engine::Render(std::unique_ptr layer_tree) { } void Engine::UpdateSemantics(blink::SemanticsNodeUpdates update) { - blink::Threads::Platform()->PostTask(fxl::MakeCopyable([ - platform_view = platform_view_.lock(), update = std::move(update) - ]() mutable { - if (platform_view) - platform_view->UpdateSemantics(std::move(update)); - })); + delegate_.OnEngineUpdateSemantics(*this, std::move(update)); } void Engine::HandlePlatformMessage( fxl::RefPtr message) { if (message->channel() == kAssetChannel) { HandleAssetPlatformMessage(std::move(message)); - return; + } else { + delegate_.OnEngineHandlePlatformMessage(*this, std::move(message)); } - blink::Threads::Platform()->PostTask([ - platform_view = platform_view_.lock(), message = std::move(message) - ]() mutable { - if (platform_view) - platform_view->HandlePlatformMessage(std::move(message)); - }); } void Engine::HandleAssetPlatformMessage( fxl::RefPtr message) { fxl::RefPtr response = message->response(); - if (!response) + if (!response) { return; + } const auto& data = message->data(); std::string asset_name(reinterpret_cast(data.data()), data.size()); + std::vector asset_data; - if (GetAssetAsBuffer(asset_name, &asset_data)) { + if (asset_manager_ && asset_manager_->GetAsBuffer(asset_name, &asset_data)) { response->Complete(std::move(asset_data)); } else { response->CompleteEmpty(); } } -bool Engine::GetAssetAsBuffer(const std::string& name, - std::vector* data) { - return ((asset_provider_ && - asset_provider_->GetAsBuffer(name, data)) || - (asset_store_ && asset_store_->GetAsBuffer(name, data))); -} - } // namespace shell diff --git a/shell/common/engine.h b/shell/common/engine.h index a0c5183338a43..ede442ee3e8a4 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -5,131 +5,144 @@ #ifndef SHELL_COMMON_ENGINE_H_ #define SHELL_COMMON_ENGINE_H_ -#include "flutter/assets/zip_asset_store.h" -#include "flutter/assets/asset_provider.h" +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "flutter/common/task_runners.h" +#include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/runtime/dart_vm.h" +#include "flutter/runtime/platform_impl.h" #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" +#include "flutter/shell/common/animator.h" #include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/run_configuration.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkPicture.h" -namespace blink { -class DirectoryAssetBundle; -class ZipAssetBundle; -} // namespace blink - namespace shell { -class PlatformView; -class Animator; -using PointerDataPacket = blink::PointerDataPacket; -class Engine : public blink::RuntimeDelegate { +class Engine final : public blink::RuntimeDelegate { public: - explicit Engine(PlatformView* platform_view); + class Delegate { + public: + virtual void OnEngineUpdateSemantics( + const Engine& engine, + blink::SemanticsNodeUpdates update) = 0; + + virtual void OnEngineHandlePlatformMessage( + const Engine& engine, + fxl::RefPtr message) = 0; + }; + + Engine(Delegate& delegate, + const blink::DartVM& vm, + blink::TaskRunners task_runners, + blink::Settings settings, + std::unique_ptr animator, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue); ~Engine() override; - fml::WeakPtr GetWeakPtr(); - - static void Init(const std::string& bundle_path); + fml::WeakPtr GetWeakPtr() const; - void RunBundle(const std::string& bundle_path, - const std::string& entrypoint = main_entrypoint_, - bool reuse_runtime_controller = false); + FXL_WARN_UNUSED_RESULT + bool Run(RunConfiguration configuration); - // Uses the given provider to locate assets. - void RunBundleWithAssets(fxl::RefPtr asset_provider, - const std::string& bundle_path, - const std::string& entrypoint = main_entrypoint_, - bool reuse_runtime_controller = false); + // Used to "cold reload" a running application where the shell (along with the + // platform view and its rasterizer bindings) remains the same but the root + // isolate is torn down and restarted with the new configuration. Only used in + // the development workflow. + FXL_WARN_UNUSED_RESULT + bool Restart(RunConfiguration configuration); - // Uses the given source code instead of looking inside the bundle for the - // source code. - void RunBundleAndSource(const std::string& bundle_path, - const std::string& main, - const std::string& packages, - bool reuse_runtime_controller = false); + bool UpdateAssetManager(fxl::RefPtr asset_manager); void BeginFrame(fxl::TimePoint frame_time); - void NotifyIdle(int64_t deadline); - void RunFromSource(const std::string& main, - const std::string& packages, - const std::string& bundle); - void SetAssetBundlePath(const std::string& bundle_path); + void NotifyIdle(int64_t deadline); Dart_Port GetUIIsolateMainPort(); + std::string GetUIIsolateName(); + bool UIIsolateHasLivePorts(); + tonic::DartErrorHandleType GetUIIsolateLastError(); + tonic::DartErrorHandleType GetLoadScriptError(); - void OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation); - void OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation); + std::pair GetUIIsolateReturnCode(); + + void OnOutputSurfaceCreated(); + + void OnOutputSurfaceDestroyed(); + void SetViewportMetrics(const blink::ViewportMetrics& metrics); + void DispatchPlatformMessage(fxl::RefPtr message); - void DispatchPointerDataPacket(const PointerDataPacket& packet); + + void DispatchPointerDataPacket(const blink::PointerDataPacket& packet); + void DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args); + void SetSemanticsEnabled(bool enabled); - void ScheduleFrame(bool regenerate_layer_tree = true) override; - void set_rasterizer(fml::WeakPtr rasterizer); + void ScheduleFrame(bool regenerate_layer_tree = true) override; private: - // RuntimeDelegate methods: + Engine::Delegate& delegate_; + const blink::Settings settings_; + std::unique_ptr animator_; + std::unique_ptr runtime_controller_; + std::unique_ptr legacy_sky_platform_; + tonic::DartErrorHandleType load_script_error_; + std::string initial_route_; + blink::ViewportMetrics viewport_metrics_; + fxl::RefPtr asset_manager_; + bool activity_running_; + bool have_surface_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + // |blink::RuntimeDelegate| std::string DefaultRouteName() override; + + // |blink::RuntimeDelegate| void Render(std::unique_ptr layer_tree) override; + + // |blink::RuntimeDelegate| void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + // |blink::RuntimeDelegate| void HandlePlatformMessage( fxl::RefPtr message) override; - void DidCreateMainIsolate(Dart_Isolate isolate) override; - void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; void StopAnimator(); - void StartAnimatorIfPossible(); - - void DoRunBundle(const std::string& script_uri, - const std::string& entrypoint, - bool reuse_runtime_controller); - void ConfigureAssetBundle(const std::string& path); - void ConfigureRuntime(const std::string& script_uri, - bool reuse_runtime_controller = false); + void StartAnimatorIfPossible(); bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message); + bool HandleNavigationPlatformMessage( fxl::RefPtr message); + bool HandleLocalizationPlatformMessage(blink::PlatformMessage* message); + void HandleSettingsPlatformMessage(blink::PlatformMessage* message); void HandleAssetPlatformMessage(fxl::RefPtr message); - bool GetAssetAsBuffer(const std::string& name, std::vector* data); - static const std::string main_entrypoint_; + bool GetAssetAsBuffer(const std::string& name, std::vector* data); - fxl::RefPtr asset_provider_; - std::weak_ptr platform_view_; - std::unique_ptr animator_; - std::unique_ptr runtime_; - tonic::DartErrorHandleType load_script_error_; - std::string initial_route_; - blink::ViewportMetrics viewport_metrics_; - std::string language_code_; - std::string country_code_; - std::string user_settings_data_; - bool semantics_enabled_ = false; - // TODO(zarah): Remove usage of asset_store_ once app.flx is removed. - fxl::RefPtr asset_store_; - fxl::RefPtr directory_asset_bundle_; - // TODO(eseidel): This should move into an AnimatorStateMachine. - bool activity_running_; - bool have_surface_; - fml::WeakPtrFactory weak_factory_; + bool PrepareAndLaunchIsolate(RunConfiguration configuration); FXL_DISALLOW_COPY_AND_ASSIGN(Engine); }; diff --git a/shell/common/io_manager.cc b/shell/common/io_manager.cc new file mode 100644 index 0000000000000..4161422978fcf --- /dev/null +++ b/shell/common/io_manager.cc @@ -0,0 +1,73 @@ +// Copyright 2017 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/shell/common/io_manager.h" + +#include "flutter/fml/message_loop.h" +#include "third_party/skia/include/gpu/gl/GrGLInterface.h" + +namespace shell { + +sk_sp IOManager::CreateCompatibleResourceLoadingContext( + GrBackend backend) { + if (backend != GrBackend::kOpenGL_GrBackend) { + return nullptr; + } + + GrContextOptions options = {}; + + // There is currently a bug with doing GPU YUV to RGB conversions on the IO + // thread. The necessary work isn't being flushed or synchronized with the + // other threads correctly, so the textures end up blank. For now, suppress + // that feature, which will cause texture uploads to do CPU YUV conversion. + options.fDisableGpuYUVConversion = true; + + if (auto context = GrContext::MakeGL(GrGLMakeNativeInterface(), options)) { + // Do not cache textures created by the image decoder. These textures + // should be deleted when they are no longer referenced by an SkImage. + context->setResourceCacheLimits(0, 0); + return context; + } + + return nullptr; +} + +IOManager::IOManager(sk_sp resource_context, + fxl::RefPtr unref_queue_task_runner) + : resource_context_(std::move(resource_context)), + resource_context_weak_factory_( + resource_context_ ? std::make_unique>( + resource_context_.get()) + : nullptr), + unref_queue_(fxl::MakeRefCounted( + std::move(unref_queue_task_runner), + fxl::TimeDelta::FromMilliseconds(250))), + weak_factory_(this) { + if (!resource_context_) { + FXL_DLOG(WARNING) << "The IO manager was initialized without a resource " + "context. Async texture uploads will be disabled. " + "Expect performance degradation."; + } + + if (resource_context_weak_factory_) { + resource_context_weak_prototype_ = + resource_context_weak_factory_->GetWeakPtr(); + } +} + +IOManager::~IOManager() { + // Last chance to drain the IO queue as the platform side reference to the + // underlying OpenGL context may be going away. + unref_queue_->Drain(); +} + +fml::WeakPtr IOManager::GetResourceContext() const { + return resource_context_weak_prototype_; +} + +fxl::RefPtr IOManager::GetSkiaUnrefQueue() const { + return unref_queue_; +} + +} // namespace shell diff --git a/shell/common/io_manager.h b/shell/common/io_manager.h new file mode 100644 index 0000000000000..1077a28d0ae36 --- /dev/null +++ b/shell/common/io_manager.h @@ -0,0 +1,52 @@ +// Copyright 2017 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_SHELL_COMMON_IO_MANAGER_H_ +#define FLUTTER_SHELL_COMMON_IO_MANAGER_H_ + +#include + +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/fml/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "third_party/skia/include/gpu/GrContext.h" + +namespace shell { + +class IOManager { + public: + // Convenience methods for platforms to create a GrContext used to supply to + // the IOManager. The platforms may create the context themselves if they so + // desire. + static sk_sp CreateCompatibleResourceLoadingContext( + GrBackend backend); + + IOManager(sk_sp resource_context, + fxl::RefPtr unref_queue_task_runner); + + ~IOManager(); + + fml::WeakPtr GetResourceContext() const; + + fxl::RefPtr GetSkiaUnrefQueue() const; + + private: + // Resource context management. + sk_sp resource_context_; + fml::WeakPtr resource_context_weak_prototype_; + std::unique_ptr> + resource_context_weak_factory_; + + // Unref queue management. + fxl::RefPtr unref_queue_; + + fml::WeakPtrFactory weak_factory_; + + FXL_DISALLOW_COPY_AND_ASSIGN(IOManager); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_IO_MANAGER_H_ diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc new file mode 100644 index 0000000000000..3c634022a348f --- /dev/null +++ b/shell/common/isolate_configuration.cc @@ -0,0 +1,148 @@ +// Copyright 2018 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/shell/common/isolate_configuration.h" + +#include "flutter/runtime/dart_vm.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace shell { + +IsolateConfiguration::IsolateConfiguration() = default; + +IsolateConfiguration::~IsolateConfiguration() = default; + +bool IsolateConfiguration::PrepareIsolate( + fml::WeakPtr isolate) { + if (!isolate) { + return false; + } + + if (isolate->GetPhase() != blink::DartIsolate::Phase::LibrariesSetup) { + FXL_DLOG(ERROR) + << "Isolate was in incorrect phase to be prepared for running."; + return false; + } + + return DoPrepareIsolate(*isolate); +} + +class PrecompiledIsolateConfiguration final : public IsolateConfiguration { + public: + PrecompiledIsolateConfiguration() = default; + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (!blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + return isolate.PrepareForRunningFromPrecompiledCode(); + } + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(PrecompiledIsolateConfiguration); +}; + +class SnapshotIsolateConfiguration : public IsolateConfiguration { + public: + SnapshotIsolateConfiguration(std::unique_ptr snapshot) + : snapshot_(std::move(snapshot)) {} + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + return isolate.PrepareForRunningFromSnapshot(std::move(snapshot_)); + } + + private: + std::unique_ptr snapshot_; + + FXL_DISALLOW_COPY_AND_ASSIGN(SnapshotIsolateConfiguration); +}; + +class SourceIsolateConfiguration final : public IsolateConfiguration { + public: + SourceIsolateConfiguration(std::string main_path, std::string packages_path) + : main_path_(std::move(main_path)), + packages_path_(std::move(packages_path)) {} + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + return isolate.PrepareForRunningFromSource(std::move(main_path_), + std::move(packages_path_)); + } + + private: + std::string main_path_; + std::string packages_path_; + + FXL_DISALLOW_COPY_AND_ASSIGN(SourceIsolateConfiguration); +}; + +std::unique_ptr IsolateConfiguration::InferFromSettings( + const blink::Settings& settings, + fxl::RefPtr asset_manager) { + // Running in AOT mode. + if (blink::DartVM::IsRunningPrecompiledCode()) { + return CreateForPrecompiledCode(); + } + + // Run from sources. + { + const auto& main = settings.main_dart_file_path; + const auto& packages = settings.packages_file_path; + if (main.size() != 0 && packages.size() != 0) { + return CreateForSource(std::move(main), std::move(packages)); + } + } + + // Running from kernel snapshot. + { + std::vector kernel; + if (asset_manager && asset_manager->GetAsBuffer( + settings.application_kernel_asset, &kernel)) { + return CreateForSnapshot( + std::make_unique(std::move(kernel))); + } + } + + // Running from script snapshot. + { + std::vector script_snapshot; + if (asset_manager && asset_manager->GetAsBuffer( + settings.script_snapshot_path, &script_snapshot)) { + return CreateForSnapshot( + std::make_unique(std::move(script_snapshot))); + } + } + + return nullptr; +} + +std::unique_ptr +IsolateConfiguration::CreateForPrecompiledCode() { + return std::make_unique(); +} + +std::unique_ptr IsolateConfiguration::CreateForSnapshot( + std::unique_ptr snapshot) { + return std::make_unique(std::move(snapshot)); +} + +std::unique_ptr IsolateConfiguration::CreateForSource( + std::string main_path, + std::string packages_path) { + return std::make_unique(std::move(main_path), + std::move(packages_path)); +} + +} // namespace shell diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h new file mode 100644 index 0000000000000..82d06dac621b2 --- /dev/null +++ b/shell/common/isolate_configuration.h @@ -0,0 +1,51 @@ +// Copyright 2018 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_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ +#define FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ + +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "flutter/assets/asset_resolver.h" +#include "flutter/common/settings.h" +#include "flutter/fml/mapping.h" +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/runtime/dart_isolate.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class IsolateConfiguration { + public: + static std::unique_ptr InferFromSettings( + const blink::Settings& settings, + fxl::RefPtr asset_manager); + + static std::unique_ptr CreateForPrecompiledCode(); + + static std::unique_ptr CreateForSnapshot( + std::unique_ptr snapshot); + + static std::unique_ptr CreateForSource( + std::string main_path, + std::string packages_path); + + IsolateConfiguration(); + + virtual ~IsolateConfiguration(); + + bool PrepareIsolate(fml::WeakPtr isolate); + + protected: + virtual bool DoPrepareIsolate(blink::DartIsolate& isolate) = 0; + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfiguration); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ diff --git a/shell/common/null_platform_view.cc b/shell/common/null_platform_view.cc deleted file mode 100644 index 49fdf5a935b80..0000000000000 --- a/shell/common/null_platform_view.cc +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/shell/common/null_platform_view.h" - -#include "flutter/shell/common/null_rasterizer.h" -#include "flutter/shell/common/shell.h" - -namespace shell { - -NullPlatformView::NullPlatformView() - : PlatformView(std::make_unique()), weak_factory_(this) {} - -void NullPlatformView::Attach() { - CreateEngine(); -} - -NullPlatformView::~NullPlatformView() = default; - -fxl::WeakPtr NullPlatformView::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -bool NullPlatformView::ResourceContextMakeCurrent() { - return false; -} - -// Hot-reload of the null platform view is not supported. -void NullPlatformView::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) {} - -void NullPlatformView::SetAssetBundlePath(const std::string& assets_directory) { -} - -} // namespace shell diff --git a/shell/common/null_platform_view.h b/shell/common/null_platform_view.h deleted file mode 100644 index eb23d67b48a7c..0000000000000 --- a/shell/common/null_platform_view.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 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. - -#ifndef COMMON_NULL_PLATFORM_VIEW_H_ -#define COMMON_NULL_PLATFORM_VIEW_H_ - -#include "flutter/shell/common/platform_view.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class NullPlatformView : public PlatformView { - public: - NullPlatformView(); - - ~NullPlatformView(); - - fxl::WeakPtr GetWeakPtr(); - - virtual void Attach() override; - - bool ResourceContextMakeCurrent() override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - void SetAssetBundlePath(const std::string& assets_directory) override; - - private: - fxl::WeakPtrFactory weak_factory_; - - FXL_DISALLOW_COPY_AND_ASSIGN(NullPlatformView); -}; - -} // namespace shell - -#endif // COMMON_NULL_PLATFORM_VIEW_H_ diff --git a/shell/common/null_rasterizer.cc b/shell/common/null_rasterizer.cc deleted file mode 100644 index 81efdd11d4970..0000000000000 --- a/shell/common/null_rasterizer.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/common/null_rasterizer.h" - -namespace shell { - -NullRasterizer::NullRasterizer() : weak_factory_(this) {} - -void NullRasterizer::Setup( - std::unique_ptr surface_or_null, - fxl::Closure rasterizer_continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) { - surface_ = std::move(surface_or_null); - rasterizer_continuation(); - setup_completion_event->Signal(); -} - -void NullRasterizer::Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) { - if (surface_) { - surface_.reset(); - } - teardown_completion_event->Signal(); -} - -fml::WeakPtr NullRasterizer::GetWeakRasterizerPtr() { - return weak_factory_.GetWeakPtr(); -} - -flow::LayerTree* NullRasterizer::GetLastLayerTree() { - return nullptr; -} - -void NullRasterizer::DrawLastLayerTree() { - // Null rasterizer. Nothing to do. -} - -flow::TextureRegistry& NullRasterizer::GetTextureRegistry() { - return *texture_registry_; -} - -void NullRasterizer::Clear(SkColor color, const SkISize& size) { - // Null rasterizer. Nothing to do. -} - -void NullRasterizer::Draw( - fxl::RefPtr> pipeline) { - FXL_ALLOW_UNUSED_LOCAL( - pipeline->Consume([](std::unique_ptr) { - // Drop the layer tree on the floor. We only need the pipeline empty so - // that frame requests are not deferred indefinitely due to - // backpressure. - })); -} - -void NullRasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { - // Null rasterizer. Nothing to do. -} - -void NullRasterizer::SetTextureRegistry( - flow::TextureRegistry* textureRegistry) { - texture_registry_ = textureRegistry; -} - -} // namespace shell diff --git a/shell/common/null_rasterizer.h b/shell/common/null_rasterizer.h deleted file mode 100644 index 8558a3c3accaa..0000000000000 --- a/shell/common/null_rasterizer.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ -#define FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ - -#include "flutter/shell/common/rasterizer.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class NullRasterizer : public Rasterizer { - public: - NullRasterizer(); - - void Setup(std::unique_ptr surface_or_null, - fxl::Closure rasterizer_continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) override; - - void Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) override; - - void Clear(SkColor color, const SkISize& size) override; - - fml::WeakPtr GetWeakRasterizerPtr() override; - - flow::LayerTree* GetLastLayerTree() override; - - void DrawLastLayerTree() override; - - flow::TextureRegistry& GetTextureRegistry() override; - - void Draw(fxl::RefPtr> pipeline) override; - - void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; - - void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; - - private: - std::unique_ptr surface_; - fml::WeakPtrFactory weak_factory_; - flow::TextureRegistry* texture_registry_; - - FXL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index 2d5715a1733bd..b2bfce051a5bf 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -6,124 +6,74 @@ #include -#include "flutter/common/threads.h" -#include "flutter/lib/ui/painting/resource_context.h" #include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" #include "flutter/shell/common/vsync_waiter_fallback.h" #include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" namespace shell { -PlatformView::PlatformView(std::unique_ptr rasterizer) - : rasterizer_(std::move(rasterizer)), size_(SkISize::Make(0, 0)) { - rasterizer_->SetTextureRegistry(&texture_registry_); - Shell::Shared().AddPlatformView(this); +PlatformView::PlatformView(Delegate& delegate, blink::TaskRunners task_runners) + : delegate_(delegate), + task_runners_(std::move(task_runners)), + size_(SkISize::Make(0, 0)), + weak_factory_(this) { + weak_prototype_ = weak_factory_.GetWeakPtr(); } -PlatformView::~PlatformView() { - Shell::Shared().RemovePlatformView(this); +PlatformView::~PlatformView() = default; - Rasterizer* rasterizer = rasterizer_.release(); - blink::Threads::Gpu()->PostTask([rasterizer]() { delete rasterizer; }); - - Engine* engine = engine_.release(); - blink::Threads::UI()->PostTask([engine]() { delete engine; }); -} - -void PlatformView::SetRasterizer(std::unique_ptr rasterizer) { - Rasterizer* r = rasterizer_.release(); - blink::Threads::Gpu()->PostTask([r]() { delete r; }); - rasterizer_ = std::move(rasterizer); - rasterizer_->SetTextureRegistry(&texture_registry_); - engine_->set_rasterizer(rasterizer_->GetWeakRasterizerPtr()); -} - -void PlatformView::CreateEngine() { - engine_.reset(new Engine(this)); +std::unique_ptr PlatformView::CreateVSyncWaiter() { + FXL_DLOG(WARNING) + << "This platform does not provide a Vsync waiter implementation. A " + "simple timer based fallback is being used."; + return std::make_unique(task_runners_); } void PlatformView::DispatchPlatformMessage( fxl::RefPtr message) { - blink::Threads::UI()->PostTask( - [engine = engine_->GetWeakPtr(), message = std::move(message)] { - if (engine) { - engine->DispatchPlatformMessage(message); - } - }); + delegate_.OnPlatformViewDispatchPlatformMessage(*this, std::move(message)); +} + +void PlatformView::DispatchPointerDataPacket( + std::unique_ptr packet) { + delegate_.OnPlatformViewDispatchPointerDataPacket(*this, std::move(packet)); } void PlatformView::DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args) { - blink::Threads::UI()->PostTask( - [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { - if (engine) { - engine->DispatchSemanticsAction( - id, static_cast(action), std::move(args)); - } - }); + delegate_.OnPlatformViewDispatchSemanticsAction(*this, id, action, + std::move(args)); } void PlatformView::SetSemanticsEnabled(bool enabled) { - blink::Threads::UI()->PostTask([engine = engine_->GetWeakPtr(), enabled] { - if (engine) - engine->SetSemanticsEnabled(enabled); - }); + delegate_.OnPlatformViewSetSemanticsEnabled(*this, enabled); } -void PlatformView::NotifyCreated(std::unique_ptr surface) { - NotifyCreated(std::move(surface), []() {}); +void PlatformView::SetViewportMetrics(const blink::ViewportMetrics& metrics) { + delegate_.OnPlatformViewSetViewportMetrics(*this, metrics); } -void PlatformView::NotifyCreated(std::unique_ptr surface, - fxl::Closure caller_continuation) { - fxl::AutoResetWaitableEvent latch; - - auto ui_continuation = fxl::MakeCopyable([this, // - surface = std::move(surface), // - caller_continuation, // - &latch]() mutable { - auto gpu_continuation = fxl::MakeCopyable([this, // - surface = std::move(surface), // - caller_continuation, // - &latch]() mutable { - // Runs on the GPU Thread. So does the Caller Continuation. - rasterizer_->Setup(std::move(surface), caller_continuation, &latch); - }); - // Runs on the UI Thread. - engine_->OnOutputSurfaceCreated(std::move(gpu_continuation)); - }); - - // Runs on the Platform Thread. - blink::Threads::UI()->PostTask(std::move(ui_continuation)); - - latch.Wait(); +void PlatformView::NotifyCreated() { + delegate_.OnPlatformViewCreated(*this, CreateRenderingSurface()); } void PlatformView::NotifyDestroyed() { - fxl::AutoResetWaitableEvent latch; - - auto engine_continuation = [this, &latch]() { - rasterizer_->Teardown(&latch); - }; - - blink::Threads::UI()->PostTask([this, engine_continuation]() { - engine_->OnOutputSurfaceDestroyed(engine_continuation); - }); - - latch.Wait(); + delegate_.OnPlatformViewDestroyed(*this); } -std::weak_ptr PlatformView::GetWeakPtr() { - return shared_from_this(); +sk_sp PlatformView::CreateResourceContext() const { + FXL_DLOG(WARNING) << "This platform does not setup the resource " + "context on the IO thread for async texture uploads."; + return nullptr; } -VsyncWaiter* PlatformView::GetVsyncWaiter() { - if (!vsync_waiter_) - vsync_waiter_ = std::make_unique(); - return vsync_waiter_.get(); +fml::WeakPtr PlatformView::GetWeakPtr() const { + return weak_prototype_; } void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) {} @@ -135,71 +85,31 @@ void PlatformView::HandlePlatformMessage( } void PlatformView::RegisterTexture(std::shared_ptr texture) { - ASSERT_IS_PLATFORM_THREAD - blink::Threads::Gpu()->PostTask([this, texture]() { - rasterizer_->GetTextureRegistry().RegisterTexture(texture); - }); + delegate_.OnPlatformViewRegisterTexture(*this, std::move(texture)); } void PlatformView::UnregisterTexture(int64_t texture_id) { - ASSERT_IS_PLATFORM_THREAD - blink::Threads::Gpu()->PostTask([this, texture_id]() { - rasterizer_->GetTextureRegistry().UnregisterTexture(texture_id); - }); + delegate_.OnPlatformViewUnregisterTexture(*this, texture_id); } void PlatformView::MarkTextureFrameAvailable(int64_t texture_id) { - ASSERT_IS_PLATFORM_THREAD - blink::Threads::UI()->PostTask([this]() { engine_->ScheduleFrame(false); }); + delegate_.OnPlatformViewMarkTextureFrameAvailable(*this, texture_id); } -void PlatformView::SetupResourceContextOnIOThread() { - fxl::AutoResetWaitableEvent latch; - - blink::Threads::IO()->PostTask( - [this, &latch]() { SetupResourceContextOnIOThreadPerform(&latch); }); - - latch.Wait(); +std::unique_ptr PlatformView::CreateRenderingSurface() { + // We have a default implementation because tests create a platform view but + // never a rendering surface. + FXL_DCHECK(false) << "This platform does not provide a rendering surface but " + "it was notified of surface rendering surface creation."; + return nullptr; } -void PlatformView::SetupResourceContextOnIOThreadPerform( - fxl::AutoResetWaitableEvent* latch) { - std::unique_ptr resourceContext = - blink::ResourceContext::Acquire(); - if (resourceContext->Get() != nullptr) { - // The resource context was already setup. This could happen if platforms - // try to setup a context multiple times, or, if there are multiple platform - // views. In any case, there is nothing else to do. So just signal the - // latch. - latch->Signal(); +void PlatformView::SetNextFrameCallback(fxl::Closure closure) { + if (!closure) { return; } - bool current = ResourceContextMakeCurrent(); - - if (!current) { - FXL_DLOG(WARNING) - << "WARNING: Could not setup a context on the resource loader."; - latch->Signal(); - return; - } - - GrContextOptions options; - // There is currently a bug with doing GPU YUV to RGB conversions on the IO - // thread. The necessary work isn't being flushed or synchronized with the - // other threads correctly, so the textures end up blank. For now, suppress - // that feature, which will cause texture uploads to do CPU YUV conversion. - options.fDisableGpuYUVConversion = true; - - blink::ResourceContext::Set( - GrContext::MakeGL(GrGLMakeNativeInterface(), options)); - - // Do not cache textures created by the image decoder. These textures should - // be deleted when they are no longer referenced by an SkImage. - if (resourceContext->Get()) - resourceContext->Get()->setResourceCacheLimits(0, 0); - - latch->Signal(); + delegate_.OnPlatformViewSetNextFrameCallback(*this, std::move(closure)); } } // namespace shell diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 66b1fcae10c79..56179a6114777 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -7,63 +7,104 @@ #include +#include "flutter/common/task_runners.h" #include "flutter/flow/texture.h" +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/lib/ui/semantics/semantics_node.h" -#include "flutter/shell/common/engine.h" -#include "flutter/shell/common/shell.h" +#include "flutter/lib/ui/window/platform_message.h" +#include "flutter/lib/ui/window/pointer_data_packet.h" +#include "flutter/lib/ui/window/viewport_metrics.h" #include "flutter/shell/common/surface.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { -class Rasterizer; +class Shell; -class PlatformView : public std::enable_shared_from_this { +class PlatformView { public: - struct SurfaceConfig { - uint8_t red_bits = 8; - uint8_t green_bits = 8; - uint8_t blue_bits = 8; - uint8_t alpha_bits = 8; - uint8_t depth_bits = 0; - uint8_t stencil_bits = 0; + class Delegate { + public: + virtual void OnPlatformViewCreated(const PlatformView& view, + std::unique_ptr surface) = 0; + + virtual void OnPlatformViewDestroyed(const PlatformView& view) = 0; + + virtual void OnPlatformViewSetNextFrameCallback(const PlatformView& view, + fxl::Closure closure) = 0; + + virtual void OnPlatformViewSetViewportMetrics( + const PlatformView& view, + const blink::ViewportMetrics& metrics) = 0; + + virtual void OnPlatformViewDispatchPlatformMessage( + const PlatformView& view, + fxl::RefPtr message) = 0; + + virtual void OnPlatformViewDispatchPointerDataPacket( + const PlatformView& view, + std::unique_ptr packet) = 0; + + virtual void OnPlatformViewDispatchSemanticsAction( + const PlatformView& view, + int32_t id, + blink::SemanticsAction action, + std::vector args) = 0; + + virtual void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, + bool enabled) = 0; + + virtual void OnPlatformViewRegisterTexture( + const PlatformView& view, + std::shared_ptr texture) = 0; + + virtual void OnPlatformViewUnregisterTexture(const PlatformView& view, + int64_t texture_id) = 0; + + virtual void OnPlatformViewMarkTextureFrameAvailable( + const PlatformView& view, + int64_t texture_id) = 0; }; - void SetupResourceContextOnIOThread(); + explicit PlatformView(Delegate& delegate, blink::TaskRunners task_runners); virtual ~PlatformView(); - virtual void Attach() = 0; + virtual std::unique_ptr CreateVSyncWaiter(); void DispatchPlatformMessage(fxl::RefPtr message); + void DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args); - void SetSemanticsEnabled(bool enabled); - void NotifyCreated(std::unique_ptr surface); + virtual void SetSemanticsEnabled(bool enabled); - void NotifyCreated(std::unique_ptr surface, - fxl::Closure continuation); + void SetViewportMetrics(const blink::ViewportMetrics& metrics); - void NotifyDestroyed(); + void NotifyCreated(); - std::weak_ptr GetWeakPtr(); + virtual void NotifyDestroyed(); - // The VsyncWaiter will live at least as long as the PlatformView. - virtual VsyncWaiter* GetVsyncWaiter(); + // Unlike all other methods on the platform view, this one may be called on a + // non-platform task runner. + virtual sk_sp CreateResourceContext() const; - virtual bool ResourceContextMakeCurrent() = 0; + fml::WeakPtr GetWeakPtr() const; virtual void UpdateSemantics(blink::SemanticsNodeUpdates update); + virtual void HandlePlatformMessage( fxl::RefPtr message); + void SetNextFrameCallback(fxl::Closure closure); + + void DispatchPointerDataPacket( + std::unique_ptr packet); + // Called once per texture, on the platform thread. void RegisterTexture(std::shared_ptr texture); @@ -71,34 +112,18 @@ class PlatformView : public std::enable_shared_from_this { void UnregisterTexture(int64_t texture_id); // Called once per texture update (e.g. video frame), on the platform thread. - virtual void MarkTextureFrameAvailable(int64_t texture_id); - - void SetRasterizer(std::unique_ptr rasterizer); - - Rasterizer& rasterizer() { return *rasterizer_; } - Engine& engine() { return *engine_; } - - virtual void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) = 0; - - virtual void SetAssetBundlePath(const std::string& assets_directory) = 0; + void MarkTextureFrameAvailable(int64_t texture_id); protected: - explicit PlatformView(std::unique_ptr rasterizer); - - void CreateEngine(); - - void SetupResourceContextOnIOThreadPerform( - fxl::AutoResetWaitableEvent* event); - - SurfaceConfig surface_config_; - std::unique_ptr rasterizer_; - flow::TextureRegistry texture_registry_; - std::unique_ptr engine_; + PlatformView::Delegate& delegate_; + const blink::TaskRunners task_runners_; std::unique_ptr vsync_waiter_; SkISize size_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + virtual std::unique_ptr CreateRenderingSurface(); private: FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); diff --git a/shell/common/platform_view_service_protocol.cc b/shell/common/platform_view_service_protocol.cc deleted file mode 100644 index 8785c4812e202..0000000000000 --- a/shell/common/platform_view_service_protocol.cc +++ /dev/null @@ -1,447 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/common/platform_view_service_protocol.h" - -#include - -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/shell/common/picture_serializer.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/shell.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/src/utils/SkBase64.h" - -namespace shell { -namespace { - -constexpr char kViewIdPrefx[] = "_flutterView/"; -constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; - -static intptr_t KeyIndex(const char** param_keys, - intptr_t num_params, - const char* key) { - if (param_keys == NULL) { - return -1; - } - for (intptr_t i = 0; i < num_params; i++) { - if (strcmp(param_keys[i], key) == 0) { - return i; - } - } - return -1; -} - -static const char* ValueForKey(const char** param_keys, - const char** param_values, - intptr_t num_params, - const char* key) { - intptr_t index = KeyIndex(param_keys, num_params, key); - if (index < 0) { - return NULL; - } - return param_values[index]; -} - -static bool ErrorMissingParameter(const char** json_object, const char* name) { - const intptr_t kInvalidParams = -32602; - std::stringstream response; - response << "{\"code\":" << std::to_string(kInvalidParams) << ","; - response << "\"message\":\"Invalid params\","; - response << "\"data\": {\"details\": \"" << name << "\"}}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static bool ErrorBadParameter(const char** json_object, - const char* name, - const char* value) { - const intptr_t kInvalidParams = -32602; - std::stringstream response; - response << "{\"code\":" << std::to_string(kInvalidParams) << ","; - response << "\"message\":\"Invalid params\","; - response << "\"data\": {\"details\": \"parameter: " << name << " has a bad "; - response << "value: " << value << "\"}}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static bool ErrorUnknownView(const char** json_object, const char* view_id) { - const intptr_t kInvalidParams = -32602; - std::stringstream response; - response << "{\"code\":" << std::to_string(kInvalidParams) << ","; - response << "\"message\":\"Invalid params\","; - response << "\"data\": {\"details\": \"view not found: " << view_id << "\"}}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static bool ErrorServer(const char** json_object, const char* message) { - const intptr_t kServerError = -32000; - std::stringstream response; - response << "{\"code\":" << std::to_string(kServerError) << ","; - response << "\"message\":\"" << message << "\"}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static void AppendIsolateRef(std::stringstream* stream, - int64_t main_port, - const std::string name) { - *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; - *stream << main_port << "\",\"name\":\"" << name << "\","; - *stream << "\"number\":\"" << main_port << "\"}"; -} - -static void AppendFlutterView(std::stringstream* stream, - uintptr_t view_id, - int64_t isolate_id, - const std::string isolate_name) { - *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" - << std::hex << view_id << std::dec << "\""; - if (isolate_id != ILLEGAL_PORT) { - // Append the isolate (if it exists). - *stream << "," - << "\"isolate\":"; - AppendIsolateRef(stream, isolate_id, isolate_name); - } - *stream << "}"; -} - -} // namespace - -void PlatformViewServiceProtocol::RegisterHook(bool running_precompiled_code) { - // Listing of FlutterViews. - Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, - nullptr); - // Screenshot. - Dart_RegisterRootServiceRequestCallback(kScreenshotExtensionName, &Screenshot, - nullptr); - - // SkPicture Screenshot. - Dart_RegisterRootServiceRequestCallback(kScreenshotSkpExtensionName, - &ScreenshotSkp, nullptr); - - // The following set of service protocol extensions require debug build - if (running_precompiled_code) { - return; - } - Dart_RegisterRootServiceRequestCallback(kRunInViewExtensionName, &RunInView, - nullptr); - Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, - &SetAssetBundlePath, nullptr); - // [benchmark helper] Wait for the UI Thread to idle. - Dart_RegisterRootServiceRequestCallback(kFlushUIThreadTasksExtensionName, - &FlushUIThreadTasks, nullptr); -} - -const char* PlatformViewServiceProtocol::kRunInViewExtensionName = - "_flutter.runInView"; - -bool PlatformViewServiceProtocol::RunInView(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - const char* view_id = - ValueForKey(param_keys, param_values, num_params, "viewId"); - const char* asset_directory = - ValueForKey(param_keys, param_values, num_params, "assetDirectory"); - const char* main_script = - ValueForKey(param_keys, param_values, num_params, "mainScript"); - const char* packages_file = - ValueForKey(param_keys, param_values, num_params, "packagesFile"); - if (view_id == NULL) { - return ErrorMissingParameter(json_object, "viewId"); - } - if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { - return ErrorBadParameter(json_object, "viewId", view_id); - } - if (asset_directory == NULL) { - return ErrorMissingParameter(json_object, "assetDirectory"); - } - if (main_script == NULL) { - return ErrorMissingParameter(json_object, "mainScript"); - } - if (packages_file == NULL) { - return ErrorMissingParameter(json_object, "packagesFile"); - } - - // Convert the actual flutter view hex id into a number. - uintptr_t view_id_as_num = - std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); - - // Ask the Shell to run this script in the specified view. This will run a - // task on the UI thread before returning. - Shell& shell = Shell::Shared(); - bool view_existed = false; - Dart_Port main_port = ILLEGAL_PORT; - std::string isolate_name; - shell.RunInPlatformView(view_id_as_num, main_script, packages_file, - asset_directory, &view_existed, &main_port, - &isolate_name); - - if (!view_existed) { - // If the view did not exist this request has definitely failed. - return ErrorUnknownView(json_object, view_id); - } - - // The view existed and the isolate was created. Success. - std::stringstream response; - response << "{\"type\":\"Success\"," - << "\"view\":"; - AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); - response << "}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -const char* PlatformViewServiceProtocol::kListViewsExtensionName = - "_flutter.listViews"; - -bool PlatformViewServiceProtocol::ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - std::stringstream response; - response << "{\"type\":\"FlutterViewList\",\"views\":["; - bool prefix_comma = false; - Shell::Shared().IteratePlatformViews( - [&response, &prefix_comma](PlatformView* view) -> bool { - if (prefix_comma) { - response << ','; - } else { - prefix_comma = true; - } - AppendFlutterView(&response, reinterpret_cast(view), - view->engine().GetUIIsolateMainPort(), - view->engine().GetUIIsolateName()); - return true; - }); - response << "]}"; - // Copy the response. - *json_object = strdup(response.str().c_str()); - return true; -} - -const char* PlatformViewServiceProtocol::kScreenshotExtensionName = - "_flutter.screenshot"; - -static sk_sp EncodeBitmapAsPNG(const SkBitmap& bitmap) { - return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); -} - -static fml::WeakPtr GetRandomRasterizer() { - fml::WeakPtr rasterizer; - Shell::Shared().IteratePlatformViews( - [&rasterizer](PlatformView* view) -> bool { - rasterizer = view->rasterizer().GetWeakRasterizerPtr(); - // We just grab the first rasterizer so there is no need to iterate - // further. - return false; - }); - return rasterizer; -} - -bool PlatformViewServiceProtocol::Screenshot(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - fxl::AutoResetWaitableEvent latch; - SkBitmap bitmap; - blink::Threads::Gpu()->PostTask([&latch, &bitmap]() { - ScreenshotGpuTask(&bitmap); - latch.Signal(); - }); - - latch.Wait(); - - sk_sp png(EncodeBitmapAsPNG(bitmap)); - - if (!png) - return ErrorServer(json_object, "can not encode screenshot"); - - size_t b64_size = SkBase64::Encode(png->data(), png->size(), nullptr); - SkAutoTMalloc b64_data(b64_size); - SkBase64::Encode(png->data(), png->size(), b64_data.get()); - - std::stringstream response; - response << "{\"type\":\"Screenshot\"," - << "\"screenshot\":\"" << std::string{b64_data.get(), b64_size} - << "\"}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -void PlatformViewServiceProtocol::ScreenshotGpuTask(SkBitmap* bitmap) { - auto rasterizer = GetRandomRasterizer(); - - if (!rasterizer) - return; - - flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); - if (layer_tree == nullptr) - return; - - const SkISize& frame_size = layer_tree->frame_size(); - if (!bitmap->tryAllocN32Pixels(frame_size.width(), frame_size.height())) - return; - - sk_sp surface = SkSurface::MakeRasterDirect( - bitmap->info(), bitmap->getPixels(), bitmap->rowBytes()); - - flow::CompositorContext compositor_context(nullptr); - SkCanvas* canvas = surface->getCanvas(); - flow::CompositorContext::ScopedFrame frame = - compositor_context.AcquireFrame(nullptr, canvas, false); - - canvas->clear(SK_ColorBLACK); - layer_tree->Raster(frame); - canvas->flush(); -} - -const char* PlatformViewServiceProtocol::kScreenshotSkpExtensionName = - "_flutter.screenshotSkp"; - -bool PlatformViewServiceProtocol::ScreenshotSkp(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - fxl::AutoResetWaitableEvent latch; - sk_sp picture; - blink::Threads::Gpu()->PostTask([&latch, &picture]() { - picture = ScreenshotSkpGpuTask(); - latch.Signal(); - }); - - latch.Wait(); - - sk_sp skp_data = picture->serialize(); - - size_t b64_size = - SkBase64::Encode(skp_data->data(), skp_data->size(), nullptr); - SkAutoTMalloc b64_data(b64_size); - SkBase64::Encode(skp_data->data(), skp_data->size(), b64_data.get()); - - std::stringstream response; - response << "{\"type\":\"ScreenshotSkp\"," - << "\"skp\":\"" << std::string{b64_data.get(), b64_size} << "\"}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -sk_sp PlatformViewServiceProtocol::ScreenshotSkpGpuTask() { - auto rasterizer = GetRandomRasterizer(); - - if (!rasterizer) - return nullptr; - - flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); - if (layer_tree == nullptr) - return nullptr; - - SkPictureRecorder recorder; - recorder.beginRecording(SkRect::MakeWH(layer_tree->frame_size().width(), - layer_tree->frame_size().height())); - - flow::CompositorContext compositor_context(nullptr); - flow::CompositorContext::ScopedFrame frame = compositor_context.AcquireFrame( - nullptr, recorder.getRecordingCanvas(), false); - layer_tree->Raster(frame); - - return recorder.finishRecordingAsPicture(); -} - -const char* PlatformViewServiceProtocol::kFlushUIThreadTasksExtensionName = - "_flutter.flushUIThreadTasks"; - -// This API should not be invoked by production code. -// It can potentially starve the service isolate if the main isolate pauses -// at a breakpoint or is in an infinite loop. -// -// It should be invoked from the VM Service and and blocks it until UI thread -// tasks are processed. -bool PlatformViewServiceProtocol::FlushUIThreadTasks(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&latch]() { - // This task is empty because we just need to synchronize this RPC with the - // UI Thread - latch.Signal(); - }); - - latch.Wait(); - - *json_object = strdup("{\"type\":\"Success\"}"); - return true; -} - -const char* PlatformViewServiceProtocol::kSetAssetBundlePathExtensionName = - "_flutter.setAssetBundlePath"; - -bool PlatformViewServiceProtocol::SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - const char* view_id = - ValueForKey(param_keys, param_values, num_params, "viewId"); - if (view_id == nullptr) { - return ErrorMissingParameter(json_object, "viewId"); - } - if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { - return ErrorBadParameter(json_object, "viewId", view_id); - } - const char* asset_directory = - ValueForKey(param_keys, param_values, num_params, "assetDirectory"); - if (asset_directory == nullptr) { - return ErrorMissingParameter(json_object, "assetDirectory"); - } - - // Convert the actual flutter view hex id into a number. - uintptr_t view_id_as_num = - std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); - - // Ask the Shell to update asset bundle path in the specified view. - // This will run a task on the UI thread before returning. - Shell& shell = Shell::Shared(); - bool view_existed = false; - Dart_Port main_port = ILLEGAL_PORT; - std::string isolate_name; - shell.SetAssetBundlePathInPlatformView(view_id_as_num, asset_directory, - &view_existed, &main_port, - &isolate_name); - - if (!view_existed) { - // If the view did not exist this request has definitely failed. - return ErrorUnknownView(json_object, view_id); - } - - // The view existed and the isolate was created. Success. - std::stringstream response; - response << "{\"type\":\"Success\"," - << "\"view\":"; - AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); - response << "}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -} // namespace shell diff --git a/shell/common/platform_view_service_protocol.h b/shell/common/platform_view_service_protocol.h deleted file mode 100644 index b7f74b56a08ba..0000000000000 --- a/shell/common/platform_view_service_protocol.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2016 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. - -#ifndef SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ -#define SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ - -#include - -#include "flutter/shell/common/platform_view.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" -#include "third_party/skia/include/core/SkBitmap.h" - -namespace shell { - -class PlatformViewServiceProtocol { - public: - static void RegisterHook(bool running_precompiled_code); - - private: - static const char* kRunInViewExtensionName; - // It should be invoked from the VM Service and and blocks it until previous - // UI thread tasks are processed. - static bool RunInView(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kListViewsExtensionName; - static bool ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kScreenshotExtensionName; - // It should be invoked from the VM Service and and blocks it until previous - // GPU thread tasks are processed. - static bool Screenshot(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - static void ScreenshotGpuTask(SkBitmap* bitmap); - - static const char* kScreenshotSkpExtensionName; - static bool ScreenshotSkp(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - static sk_sp ScreenshotSkpGpuTask(); - - // This API should not be invoked by production code. - // It can potentially starve the service isolate if the main isolate pauses - // at a breakpoint or is in an infinite loop. - // - // It should be invoked from the VM Service and and blocks it until previous - // GPU thread tasks are processed. - static const char* kFlushUIThreadTasksExtensionName; - static bool FlushUIThreadTasks(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kSetAssetBundlePathExtensionName; - static bool SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); -}; - -} // namespace shell - -#endif // SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 905ee6285c5d3..5a519b3efea26 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -4,8 +4,205 @@ #include "flutter/shell/common/rasterizer.h" +#include + +#include "third_party/skia/include/core/SkEncodedImageFormat.h" +#include "third_party/skia/include/core/SkImageEncoder.h" +#include "third_party/skia/include/core/SkPictureRecorder.h" +#include "third_party/skia/include/core/SkSurface.h" +#include "third_party/skia/src/utils/SkBase64.h" + namespace shell { +Rasterizer::Rasterizer(blink::TaskRunners task_runners) + : task_runners_(std::move(task_runners)), weak_factory_(this) { + weak_prototype_ = weak_factory_.GetWeakPtr(); +} + Rasterizer::~Rasterizer() = default; +fml::WeakPtr Rasterizer::GetWeakPtr() const { + return weak_prototype_; +} + +void Rasterizer::Setup(std::unique_ptr surface) { + surface_ = std::move(surface); +} + +void Rasterizer::Teardown() { + surface_.reset(); + last_layer_tree_.reset(); +} + +flow::TextureRegistry* Rasterizer::GetTextureRegistry() { + if (!surface_) { + return nullptr; + } + + return &(surface_->GetCompositorContext().texture_registry()); +} + +flow::LayerTree* Rasterizer::GetLastLayerTree() { + return last_layer_tree_.get(); +} + +void Rasterizer::DrawLastLayerTree() { + if (!last_layer_tree_ || !surface_) { + return; + } + DrawToSurface(*last_layer_tree_); +} + +void Rasterizer::Draw( + fxl::RefPtr> pipeline) { + TRACE_EVENT0("flutter", "GPURasterizer::Draw"); + + flutter::Pipeline::Consumer consumer = + std::bind(&Rasterizer::DoDraw, this, std::placeholders::_1); + + // Consume as many pipeline items as possible. But yield the event loop + // between successive tries. + switch (pipeline->Consume(consumer)) { + case flutter::PipelineConsumeResult::MoreAvailable: { + task_runners_.GetGPUTaskRunner()->PostTask( + [weak_this = weak_factory_.GetWeakPtr(), pipeline]() { + if (weak_this) { + weak_this->Draw(pipeline); + } + }); + break; + } + default: + break; + } +} + +void Rasterizer::DoDraw(std::unique_ptr layer_tree) { + if (!layer_tree || !surface_) { + return; + } + + if (DrawToSurface(*layer_tree)) { + last_layer_tree_ = std::move(layer_tree); + } +} + +bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) { + FXL_DCHECK(surface_); + + auto frame = surface_->AcquireFrame(layer_tree.frame_size()); + + if (frame == nullptr) { + return false; + } + + auto& compositor_context = surface_->GetCompositorContext(); + + // There is no way for the compositor to know how long the layer tree + // construction took. Fortunately, the layer tree does. Grab that time + // for instrumentation. + compositor_context.engine_time().SetLapTime(layer_tree.construction_time()); + + auto compositor_frame = compositor_context.AcquireFrame( + surface_->GetContext(), frame->SkiaCanvas(), true); + + if (compositor_frame && compositor_frame->Raster(layer_tree, false)) { + frame->Submit(); + FireNextFrameCallbackIfPresent(); + return true; + } + + return false; +} + +static sk_sp ScreenshotLayerTreeAsPicture(flow::LayerTree* tree) { + FXL_DCHECK(tree != nullptr); + SkPictureRecorder recorder; + recorder.beginRecording( + SkRect::MakeWH(tree->frame_size().width(), tree->frame_size().height())); + + flow::CompositorContext compositor_context; + auto frame = compositor_context.AcquireFrame( + nullptr, recorder.getRecordingCanvas(), false); + + frame->Raster(*tree, true); + + return recorder.finishRecordingAsPicture(); +} + +static sk_sp ScreenshotLayerTreeAsImage(flow::LayerTree* tree, + bool compressed) { + const SkISize& frame_size = tree->frame_size(); + SkBitmap bitmap; + if (!bitmap.tryAllocN32Pixels(frame_size.width(), frame_size.height())) { + return nullptr; + } + auto bitmap_surface = SkSurface::MakeRasterDirect( + bitmap.info(), bitmap.getPixels(), bitmap.rowBytes()); + flow::CompositorContext compositor_context; + auto canvas = bitmap_surface->getCanvas(); + auto frame = compositor_context.AcquireFrame(nullptr, canvas, false); + canvas->clear(SK_ColorBLACK); + frame->Raster(*tree, true); + canvas->flush(); + if (compressed) { + return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); + } else { + return SkData::MakeWithCopy(bitmap.getPixels(), bitmap.computeByteSize()); + } + return nullptr; +} + +Rasterizer::Screenshot Rasterizer::ScreenshotLastLayerTree( + Rasterizer::ScreenshotType type, + bool base64_encode) { + auto layer_tree = GetLastLayerTree(); + if (layer_tree == nullptr) { + FXL_DLOG(INFO) << "Last layer tree was null when screenshotting."; + return {}; + } + + sk_sp data = nullptr; + + switch (type) { + case ScreenshotType::SkiaPicture: + data = ScreenshotLayerTreeAsPicture(layer_tree)->serialize(); + break; + case ScreenshotType::UncompressedImage: + data = ScreenshotLayerTreeAsImage(layer_tree, false); + break; + case ScreenshotType::CompressedImage: + data = ScreenshotLayerTreeAsImage(layer_tree, true); + break; + } + + if (data == nullptr) { + FXL_DLOG(INFO) << "Sceenshot data was null."; + return {}; + } + + if (base64_encode) { + size_t b64_size = SkBase64::Encode(data->data(), data->size(), nullptr); + auto b64_data = SkData::MakeUninitialized(b64_size); + SkBase64::Encode(data->data(), data->size(), b64_data->writable_data()); + return Rasterizer::Screenshot{b64_data, layer_tree->frame_size()}; + } + + return Rasterizer::Screenshot{data, layer_tree->frame_size()}; +} + +void Rasterizer::SetNextFrameCallback(fxl::Closure callback) { + next_frame_callback_ = callback; +} + +void Rasterizer::FireNextFrameCallbackIfPresent() { + if (!next_frame_callback_) { + return; + } + // It is safe for the callback to set a new callback. + auto callback = next_frame_callback_; + next_frame_callback_ = nullptr; + callback(); +} + } // namespace shell diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 6f45f49d8178a..908717b74c168 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -7,6 +7,7 @@ #include +#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" @@ -16,34 +17,64 @@ namespace shell { -class Rasterizer { +class Rasterizer final { public: - virtual ~Rasterizer(); + Rasterizer(blink::TaskRunners task_runners); - virtual void Setup(std::unique_ptr surface_or_null, - fxl::Closure rasterizer_continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) = 0; + ~Rasterizer(); - virtual void Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) = 0; + void Setup(std::unique_ptr surface); - virtual void Clear(SkColor color, const SkISize& size) = 0; + void Teardown(); - virtual fml::WeakPtr GetWeakRasterizerPtr() = 0; + fml::WeakPtr GetWeakPtr() const; - virtual flow::LayerTree* GetLastLayerTree() = 0; + flow::LayerTree* GetLastLayerTree(); - virtual void DrawLastLayerTree() = 0; + void DrawLastLayerTree(); - virtual flow::TextureRegistry& GetTextureRegistry() = 0; + flow::TextureRegistry* GetTextureRegistry(); - virtual void Draw( - fxl::RefPtr> pipeline) = 0; + void Draw(fxl::RefPtr> pipeline); - // Set a callback to be called once when the next frame is drawn. - virtual void AddNextFrameCallback(fxl::Closure nextFrameCallback) = 0; + enum class ScreenshotType { + SkiaPicture, + UncompressedImage, // In kN32_SkColorType format + CompressedImage, + }; - virtual void SetTextureRegistry(flow::TextureRegistry* textureRegistry) = 0; + struct Screenshot { + sk_sp data; + SkISize frame_size = SkISize::MakeEmpty(); + + Screenshot() {} + + Screenshot(sk_sp p_data, SkISize p_size) + : data(std::move(p_data)), frame_size(p_size) {} + }; + + Screenshot ScreenshotLastLayerTree(ScreenshotType type, bool base64_encode); + + // Sets a callback that will be executed after the next frame is submitted to + // the surface on the GPU task runner. + void SetNextFrameCallback(fxl::Closure callback); + + private: + blink::TaskRunners task_runners_; + std::unique_ptr surface_; + std::unique_ptr compositor_context_; + std::unique_ptr last_layer_tree_; + fxl::Closure next_frame_callback_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + void DoDraw(std::unique_ptr layer_tree); + + bool DrawToSurface(flow::LayerTree& layer_tree); + + void FireNextFrameCallbackIfPresent(); + + FXL_DISALLOW_COPY_AND_ASSIGN(Rasterizer); }; } // namespace shell diff --git a/shell/common/run_configuration.cc b/shell/common/run_configuration.cc new file mode 100644 index 0000000000000..7fb385fb4d9dc --- /dev/null +++ b/shell/common/run_configuration.cc @@ -0,0 +1,80 @@ +// Copyright 2017 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/shell/common/run_configuration.h" + +#include + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/fml/file.h" +#include "flutter/runtime/dart_vm.h" + +namespace shell { + +RunConfiguration RunConfiguration::InferFromSettings( + const blink::Settings& settings) { + auto asset_manager = fxl::MakeRefCounted(); + + asset_manager->PushBack(std::make_unique( + fml::Duplicate(settings.assets_dir))); + + asset_manager->PushBack( + std::make_unique(fml::OpenFile( + settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); + + asset_manager->PushBack( + std::make_unique(settings.flx_path)); + + return {IsolateConfiguration::InferFromSettings(settings, asset_manager), + asset_manager}; +} + +RunConfiguration::RunConfiguration( + std::unique_ptr configuration) + : RunConfiguration(std::move(configuration), + fxl::MakeRefCounted()) {} + +RunConfiguration::RunConfiguration( + std::unique_ptr configuration, + fxl::RefPtr asset_manager) + : isolate_configuration_(std::move(configuration)), + asset_manager_(std::move(asset_manager)) {} + +RunConfiguration::RunConfiguration(RunConfiguration&&) = default; + +RunConfiguration::~RunConfiguration() = default; + +bool RunConfiguration::IsValid() const { + return asset_manager_ && isolate_configuration_; +} + +bool RunConfiguration::AddAssetResolver( + std::unique_ptr resolver) { + if (!resolver || !resolver->IsValid()) { + return false; + } + + asset_manager_->PushBack(std::move(resolver)); + return true; +} + +void RunConfiguration::SetEntrypoint(std::string entrypoint) { + entrypoint_ = std::move(entrypoint); +} + +fxl::RefPtr RunConfiguration::GetAssetManager() const { + return asset_manager_; +} + +const std::string& RunConfiguration::GetEntrypoint() const { + return entrypoint_; +} + +std::unique_ptr +RunConfiguration::TakeIsolateConfiguration() { + return std::move(isolate_configuration_); +} + +} // namespace shell diff --git a/shell/common/run_configuration.h b/shell/common/run_configuration.h new file mode 100644 index 0000000000000..59aa07566685c --- /dev/null +++ b/shell/common/run_configuration.h @@ -0,0 +1,56 @@ +// Copyright 2017 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_SHELL_COMMON_RUN_CONFIGURATION_H_ +#define FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ + +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "flutter/assets/asset_resolver.h" +#include "flutter/common/settings.h" +#include "flutter/fml/mapping.h" +#include "flutter/shell/common/isolate_configuration.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class RunConfiguration { + public: + static RunConfiguration InferFromSettings(const blink::Settings& settings); + + RunConfiguration(std::unique_ptr configuration); + + RunConfiguration(std::unique_ptr configuration, + fxl::RefPtr asset_manager); + + RunConfiguration(RunConfiguration&&); + + ~RunConfiguration(); + + bool IsValid() const; + + bool AddAssetResolver(std::unique_ptr resolver); + + void SetEntrypoint(std::string entrypoint); + + fxl::RefPtr GetAssetManager() const; + + const std::string& GetEntrypoint() const; + + std::unique_ptr TakeIsolateConfiguration(); + + private: + std::unique_ptr isolate_configuration_; + fxl::RefPtr asset_manager_; + std::string entrypoint_ = "main"; + + FXL_DISALLOW_COPY_AND_ASSIGN(RunConfiguration); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 14f8fee84bb5f..6bb051460eaef 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -2,362 +2,863 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#define RAPIDJSON_HAS_STDSTRING 1 + #include "flutter/shell/common/shell.h" -#include #include #include #include -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/fml/file.h" #include "flutter/fml/icu_util.h" #include "flutter/fml/message_loop.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/dart_init.h" +#include "flutter/glue/trace_event.h" +#include "flutter/runtime/dart_vm.h" #include "flutter/shell/common/engine.h" -#include "flutter/shell/common/platform_view_service_protocol.h" #include "flutter/shell/common/skia_event_tracer_impl.h" #include "flutter/shell/common/switches.h" +#include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/logging.h" #include "third_party/dart/runtime/include/dart_tools_api.h" #include "third_party/skia/include/core/SkGraphics.h" +#ifdef ERROR +#undef ERROR +#endif + namespace shell { -namespace { -static Shell* g_shell = nullptr; +std::unique_ptr Shell::CreateShellOnPlatformThread( + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) { + if (!task_runners.IsValid()) { + return nullptr; + } + + auto shell = std::unique_ptr(new Shell(task_runners, settings)); + + // Create the platform view on the platform thread (this thread). + auto platform_view = on_create_platform_view(*shell.get()); + if (!platform_view || !platform_view->GetWeakPtr()) { + return nullptr; + } + + // Ask the platform view for the vsync waiter. This will be used by the engine + // to create the animator. + auto vsync_waiter = platform_view->CreateVSyncWaiter(); + if (!vsync_waiter) { + return nullptr; + } + + // Create the IO manager on the IO thread. The IO manager must be initialized + // first because it has state that the other subsystems depend on. It must + // first be booted and the necessary references obtained to initialize the + // other subsystems. + fxl::AutoResetWaitableEvent io_latch; + std::unique_ptr io_manager; + fml::WeakPtr resource_context; + fxl::RefPtr unref_queue; + auto io_task_runner = shell->GetTaskRunners().GetIOTaskRunner(); + fml::TaskRunner::RunNowOrPostTask( + io_task_runner, + [&io_latch, // + &io_manager, // + &resource_context, // + &unref_queue, // + &platform_view, // + io_task_runner // + ]() { + io_manager = std::make_unique( + platform_view->CreateResourceContext(), io_task_runner); + resource_context = io_manager->GetResourceContext(); + unref_queue = io_manager->GetSkiaUnrefQueue(); + io_latch.Signal(); + }); + io_latch.Wait(); + + // Create the rasterizer on the GPU thread. + fxl::AutoResetWaitableEvent gpu_latch; + std::unique_ptr rasterizer; + fml::TaskRunner::RunNowOrPostTask( + task_runners.GetGPUTaskRunner(), [&gpu_latch, // + &rasterizer, // + on_create_rasterizer, // + shell = shell.get() // + ]() { + if (auto new_rasterizer = on_create_rasterizer(*shell)) { + rasterizer = std::move(new_rasterizer); + } + gpu_latch.Signal(); + }); + + // Create the engine on the UI thread. + fxl::AutoResetWaitableEvent ui_latch; + std::unique_ptr engine; + fml::TaskRunner::RunNowOrPostTask( + shell->GetTaskRunners().GetUITaskRunner(), + fxl::MakeCopyable([&ui_latch, // + &engine, // + shell = shell.get(), // + vsync_waiter = std::move(vsync_waiter), // + resource_context = std::move(resource_context), // + unref_queue = std::move(unref_queue) // + ]() mutable { + const auto& task_runners = shell->GetTaskRunners(); + + // The animator is owned by the UI thread but it gets its vsync pulses + // from the platform. + auto animator = std::make_unique(*shell, task_runners, + std::move(vsync_waiter)); + + engine = std::make_unique(*shell, // + shell->GetDartVM(), // + task_runners, // + shell->GetSettings(), // + std::move(animator), // + std::move(resource_context), // + std::move(unref_queue) // + ); + ui_latch.Signal(); + })); + + gpu_latch.Wait(); + ui_latch.Wait(); + // We are already on the platform thread. So there is no platform latch to + // wait on. + + if (!shell->Setup(std::move(platform_view), // + std::move(engine), // + std::move(rasterizer), // + std::move(io_manager)) // + ) { + return nullptr; + } -template -bool GetSwitchValue(const fxl::CommandLine& command_line, - Switch sw, - T* result) { - std::string switch_string; + return shell; +} + +std::unique_ptr Shell::Create( + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) { + if (!task_runners.IsValid() || !on_create_platform_view || + !on_create_rasterizer) { + return nullptr; + } - if (!command_line.GetOptionValue(FlagForSwitch(sw), &switch_string)) { + fxl::AutoResetWaitableEvent latch; + std::unique_ptr shell; + fml::TaskRunner::RunNowOrPostTask( + task_runners.GetPlatformTaskRunner(), + [&latch, &shell, task_runners = std::move(task_runners), settings, + on_create_platform_view, on_create_rasterizer]() { + shell = CreateShellOnPlatformThread(std::move(task_runners), settings, + on_create_platform_view, + on_create_rasterizer); + latch.Signal(); + }); + latch.Wait(); + return shell; +} + +Shell::Shell(blink::TaskRunners task_runners, blink::Settings settings) + : task_runners_(std::move(task_runners)), + settings_(std::move(settings)), + vm_(blink::DartVM::ForProcess(settings_)) { + FXL_DCHECK(task_runners_.IsValid()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + if (settings_.icu_data_path.size() != 0) { + fml::icu::InitializeICU(settings_.icu_data_path); + } else { + FXL_DLOG(WARNING) << "Skipping ICU initialization in the shell."; + } + + if (settings_.trace_skia) { + InitSkiaEventTracer(settings_.trace_skia); + } + + if (!settings_.skia_deterministic_rendering_on_cpu) { + SkGraphics::Init(); + } else { + FXL_DLOG(INFO) << "Skia deterministic rendering is enabled."; + } + + // Install service protocol handlers. + + service_protocol_handlers_[blink::ServiceProtocol::kScreenshotExtensionName + .ToString()] = { + task_runners_.GetGPUTaskRunner(), + std::bind(&Shell::OnServiceProtocolScreenshot, this, + std::placeholders::_1, std::placeholders::_2)}; + service_protocol_handlers_[blink::ServiceProtocol::kScreenshotSkpExtensionName + .ToString()] = { + task_runners_.GetGPUTaskRunner(), + std::bind(&Shell::OnServiceProtocolScreenshotSKP, this, + std::placeholders::_1, std::placeholders::_2)}; + service_protocol_handlers_[blink::ServiceProtocol::kRunInViewExtensionName + .ToString()] = { + task_runners_.GetUITaskRunner(), + std::bind(&Shell::OnServiceProtocolRunInView, this, std::placeholders::_1, + std::placeholders::_2)}; + service_protocol_handlers_ + [blink::ServiceProtocol::kFlushUIThreadTasksExtensionName.ToString()] = { + task_runners_.GetUITaskRunner(), + std::bind(&Shell::OnServiceProtocolFlushUIThreadTasks, this, + std::placeholders::_1, std::placeholders::_2)}; + service_protocol_handlers_ + [blink::ServiceProtocol::kSetAssetBundlePathExtensionName.ToString()] = { + task_runners_.GetUITaskRunner(), + std::bind(&Shell::OnServiceProtocolSetAssetBundlePath, this, + std::placeholders::_1, std::placeholders::_2)}; +} + +Shell::~Shell() { + if (auto vm = blink::DartVM::ForProcessIfInitialized()) { + vm->GetServiceProtocol().RemoveHandler(this); + } + + fxl::AutoResetWaitableEvent ui_latch, gpu_latch, platform_latch, io_latch; + + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetUITaskRunner(), + fxl::MakeCopyable([engine = std::move(engine_), &ui_latch]() mutable { + engine.reset(); + ui_latch.Signal(); + })); + ui_latch.Wait(); + + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetGPUTaskRunner(), + fxl::MakeCopyable( + [rasterizer = std::move(rasterizer_), &gpu_latch]() mutable { + rasterizer.reset(); + gpu_latch.Signal(); + })); + gpu_latch.Wait(); + + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetIOTaskRunner(), + fxl::MakeCopyable( + [io_manager = std::move(io_manager_), &io_latch]() mutable { + io_manager.reset(); + io_latch.Signal(); + })); + + io_latch.Wait(); + + // The platform view must go last because it may be holding onto platform side + // counterparts to resources owned by subsystems running on other threads. For + // example, the NSOpenGLContext on the Mac. + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetPlatformTaskRunner(), + fxl::MakeCopyable([platform_view = std::move(platform_view_), + &platform_latch]() mutable { + platform_view.reset(); + platform_latch.Signal(); + })); + platform_latch.Wait(); +} + +bool Shell::IsSetup() const { + return is_setup_; +} + +bool Shell::Setup(std::unique_ptr platform_view, + std::unique_ptr engine, + std::unique_ptr rasterizer, + std::unique_ptr io_manager) { + if (is_setup_) { return false; } - std::stringstream stream(switch_string); - T value = 0; - if (stream >> value) { - *result = value; - return true; + if (!platform_view || !engine || !rasterizer || !io_manager) { + return false; } - return false; + platform_view_ = std::move(platform_view); + engine_ = std::move(engine); + rasterizer_ = std::move(rasterizer); + io_manager_ = std::move(io_manager); + + is_setup_ = true; + + if (auto vm = blink::DartVM::ForProcessIfInitialized()) { + vm->GetServiceProtocol().AddHandler(this); + } + + return true; } -} // namespace +const blink::Settings& Shell::GetSettings() const { + return settings_; +} -Shell::Shell(fxl::CommandLine command_line) - : command_line_(std::move(command_line)) { - FXL_DCHECK(!g_shell); +const blink::TaskRunners& Shell::GetTaskRunners() const { + return task_runners_; +} - gpu_thread_.reset(new fml::Thread("gpu_thread")); - ui_thread_.reset(new fml::Thread("ui_thread")); - io_thread_.reset(new fml::Thread("io_thread")); +fml::WeakPtr Shell::GetRasterizer() { + FXL_DCHECK(is_setup_); + return rasterizer_->GetWeakPtr(); +} - // Since we are not using fml::Thread, we need to initialize the message loop - // manually. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - blink::Threads threads(fml::MessageLoop::GetCurrent().GetTaskRunner(), - gpu_thread_->GetTaskRunner(), - ui_thread_->GetTaskRunner(), - io_thread_->GetTaskRunner()); - blink::Threads::Set(threads); +fml::WeakPtr Shell::GetEngine() { + FXL_DCHECK(is_setup_); + return engine_->GetWeakPtr(); +} - blink::Threads::Gpu()->PostTask([this]() { InitGpuThread(); }); - blink::Threads::UI()->PostTask([this]() { InitUIThread(); }); +fml::WeakPtr Shell::GetPlatformView() { + FXL_DCHECK(is_setup_); + return platform_view_->GetWeakPtr(); +} - blink::SetRegisterNativeServiceProtocolExtensionHook( - PlatformViewServiceProtocol::RegisterHook); +const blink::DartVM& Shell::GetDartVM() const { + return *vm_; } -Shell::~Shell() {} +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewCreated(const PlatformView& view, + std::unique_ptr surface) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); -void Shell::InitStandalone(fxl::CommandLine command_line, - std::string icu_data_path, - std::string application_library_path, - std::string bundle_path) { - TRACE_EVENT0("flutter", "Shell::InitStandalone"); + // Note: + // This is a synchronous operation because certain platforms depend on + // setup/suspension of all activities that may be interacting with the GPU in + // a synchronous fashion. - fml::icu::InitializeICU(icu_data_path); + fxl::AutoResetWaitableEvent latch; + auto gpu_task = fxl::MakeCopyable([rasterizer = rasterizer_->GetWeakPtr(), // + surface = std::move(surface), // + &latch]() mutable { + if (rasterizer) { + rasterizer->Setup(std::move(surface)); + } + // Step 2: All done. Signal the latch that the platform thread is waiting + // on. + latch.Signal(); + }); - if (!command_line.HasOption( - FlagForSwitch(Switch::SkiaDeterministicRendering))) - SkGraphics::Init(); + auto ui_task = [engine = engine_->GetWeakPtr(), // + gpu_task_runner = task_runners_.GetGPUTaskRunner(), // + gpu_task // + ] { + if (engine) { + engine->OnOutputSurfaceCreated(); + } + // Step 1: Next, tell the GPU thread that it should create a surface for its + // rasterizer. + fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); + }; + + // Step 0: Post a task onto the UI thread to tell the engine that it has an + // output surface. + fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); + latch.Wait(); +} - blink::Settings settings; - settings.application_library_path = application_library_path; +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDestroyed(const PlatformView& view) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - // Enable Observatory - settings.enable_observatory = - !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); + // Note: + // This is a synchronous operation because certain platforms depend on + // setup/suspension of all activities that may be interacting with the GPU in + // a synchronous fashion. + + fxl::AutoResetWaitableEvent latch; - // Set Observatory Port - if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { - if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, - &settings.observatory_port)) { - FXL_LOG(INFO) - << "Observatory port specified was malformed. Will default to " - << settings.observatory_port; + auto gpu_task = [rasterizer = rasterizer_->GetWeakPtr(), &latch]() { + if (rasterizer) { + rasterizer->Teardown(); } - } + // Step 2: All done. Signal the latch that the platform thread is waiting + // on. + latch.Signal(); + }; + + auto ui_task = [engine = engine_->GetWeakPtr(), + gpu_task_runner = task_runners_.GetGPUTaskRunner(), + gpu_task]() { + if (engine) { + engine->OnOutputSurfaceDestroyed(); + } + // Step 1: Next, tell the GPU thread that its rasterizer should suspend + // access to the underlying surface. + fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); + }; + + // Step 0: Post a task onto the UI thread to tell the engine that its output + // surface is about to go away. + fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); + latch.Wait(); +} - // Checked mode overrides. - settings.dart_non_checked_mode = - command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewSetViewportMetrics( + const PlatformView& view, + const blink::ViewportMetrics& metrics) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), metrics]() { + if (engine) { + engine->SetViewportMetrics(metrics); + } + }); +} - settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDispatchPlatformMessage( + const PlatformView& view, + fxl::RefPtr message) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), message = std::move(message)] { + if (engine) { + engine->DispatchPlatformMessage(std::move(message)); + } + }); +} - settings.start_paused = - command_line.HasOption(FlagForSwitch(Switch::StartPaused)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDispatchPointerDataPacket( + const PlatformView& view, + std::unique_ptr packet) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + task_runners_.GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = engine_->GetWeakPtr(), packet = std::move(packet)] { + if (engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); +} - settings.enable_dart_profiling = - command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDispatchSemanticsAction(const PlatformView& view, + int32_t id, + blink::SemanticsAction action, + std::vector args) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { + if (engine) { + engine->DispatchSemanticsAction(id, action, std::move(args)); + } + }); +} - settings.enable_software_rendering = - command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewSetSemanticsEnabled(const PlatformView& view, + bool enabled) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), enabled] { + if (engine) { + engine->SetSemanticsEnabled(enabled); + } + }); +} - settings.using_blink = - command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewRegisterTexture( + const PlatformView& view, + std::shared_ptr texture) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), texture] { + if (rasterizer) { + if (auto registry = rasterizer->GetTextureRegistry()) { + registry->RegisterTexture(texture); + } + } + }); +} - settings.endless_trace_buffer = - command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewUnregisterTexture(const PlatformView& view, + int64_t texture_id) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { + if (rasterizer) { + if (auto registry = rasterizer->GetTextureRegistry()) { + registry->UnregisterTexture(texture_id); + } + } + }); +} - settings.trace_startup = - command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, + int64_t texture_id) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), - &settings.aot_snapshot_path); + // Tell the rasterizer that one of its textures has a new frame available. + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { + auto registry = rasterizer->GetTextureRegistry(); - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), - &settings.aot_vm_snapshot_data_filename); + if (!registry) { + return; + } - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), - &settings.aot_vm_snapshot_instr_filename); + auto texture = registry->GetTexture(texture_id); - command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), - &settings.aot_isolate_snapshot_data_filename); + if (!texture) { + return; + } - command_line.GetOptionValue(FlagForSwitch(Switch::AotSharedLibraryPath), - &settings.aot_shared_library_path); + texture->MarkNewFrameAvailable(); + }); - command_line.GetOptionValue( - FlagForSwitch(Switch::AotIsolateSnapshotInstructions), - &settings.aot_isolate_snapshot_instr_filename); + // Schedule a new frame without having to rebuild the layer tree. + task_runners_.GetUITaskRunner()->PostTask([engine = engine_->GetWeakPtr()]() { + if (engine) { + engine->ScheduleFrame(false); + } + }); +} - command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), - &settings.temp_directory_path); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewSetNextFrameCallback(const PlatformView& view, + fxl::Closure closure) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), closure = std::move(closure)]() { + if (rasterizer) { + rasterizer->SetNextFrameCallback(std::move(closure)); + } + }); +} - settings.use_test_fonts = - command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); +// |shell::Animator::Delegate| +void Shell::OnAnimatorBeginFrame(const Animator& animator, + fxl::TimePoint frame_time) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - std::string all_dart_flags; - if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), - &all_dart_flags)) { - std::stringstream stream(all_dart_flags); - std::istream_iterator end; - for (std::istream_iterator it(stream); it != end; ++it) - settings.dart_flags.push_back(*it); + if (engine_) { + engine_->BeginFrame(frame_time); } +} - command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); +// |shell::Animator::Delegate| +void Shell::OnAnimatorNotifyIdle(const Animator& animator, int64_t deadline) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - blink::Settings::Set(settings); + if (engine_) { + engine_->NotifyIdle(deadline); + } +} - Init(std::move(command_line), bundle_path); +// |shell::Animator::Delegate| +void Shell::OnAnimatorDraw( + const Animator& animator, + fxl::RefPtr> pipeline) { + FXL_DCHECK(is_setup_); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), + pipeline = std::move(pipeline)]() { + if (rasterizer) { + rasterizer->Draw(pipeline); + } + }); } -void Shell::Init(fxl::CommandLine command_line, - const std::string& bundle_path) { -#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - bool trace_skia = command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); - InitSkiaEventTracer(trace_skia); -#endif +// |shell::Animator::Delegate| +void Shell::OnAnimatorDrawLastLayerTree(const Animator& animator) { + FXL_DCHECK(is_setup_); - FXL_DCHECK(!g_shell); - g_shell = new Shell(std::move(command_line)); - blink::Threads::UI()->PostTask( - [bundle_path]() { Engine::Init(bundle_path); }); + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr()]() { + if (rasterizer) { + rasterizer->DrawLastLayerTree(); + } + }); } -Shell& Shell::Shared() { - FXL_DCHECK(g_shell); - return *g_shell; +// |shell::Engine::Delegate| +void Shell::OnEngineUpdateSemantics(const Engine& engine, + blink::SemanticsNodeUpdates update) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetPlatformTaskRunner()->PostTask( + [view = platform_view_->GetWeakPtr(), update = std::move(update)] { + if (view) { + view->UpdateSemantics(std::move(update)); + } + }); } -const fxl::CommandLine& Shell::GetCommandLine() const { - return command_line_; +// |shell::Engine::Delegate| +void Shell::OnEngineHandlePlatformMessage( + const Engine& engine, + fxl::RefPtr message) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetPlatformTaskRunner()->PostTask( + [view = platform_view_->GetWeakPtr(), message = std::move(message)]() { + if (view) { + view->HandlePlatformMessage(std::move(message)); + } + }); } -void Shell::InitGpuThread() { - gpu_thread_checker_.reset(new fxl::ThreadChecker()); +// |blink::ServiceProtocol::Handler| +fxl::RefPtr Shell::GetServiceProtocolHandlerTaskRunner( + fxl::StringView method) const { + FXL_DCHECK(is_setup_); + auto found = service_protocol_handlers_.find(method.ToString()); + if (found != service_protocol_handlers_.end()) { + return found->second.first; + } + return task_runners_.GetUITaskRunner(); } -void Shell::InitUIThread() { - ui_thread_checker_.reset(new fxl::ThreadChecker()); +// |blink::ServiceProtocol::Handler| +bool Shell::HandleServiceProtocolMessage( + fxl::StringView method, // one if the extension names specified above. + const ServiceProtocolMap& params, + rapidjson::Document& response) { + auto found = service_protocol_handlers_.find(method.ToString()); + if (found != service_protocol_handlers_.end()) { + return found->second.second(params, response); + } + return false; } -void Shell::AddPlatformView(PlatformView* platform_view) { - if (platform_view == nullptr) { - return; +// |blink::ServiceProtocol::Handler| +blink::ServiceProtocol::Handler::Description +Shell::GetServiceProtocolDescription() const { + return { + engine_->GetUIIsolateMainPort(), + engine_->GetUIIsolateName(), + }; +} + +static void ServiceProtocolParameterError(rapidjson::Document& response, + std::string parameter_name) { + auto& allocator = response.GetAllocator(); + response.SetObject(); + const int64_t kInvalidParams = -32602; + response.AddMember("code", kInvalidParams, allocator); + response.AddMember("message", "Invalid params", allocator); + { + rapidjson::Value details(rapidjson::kObjectType); + details.AddMember("details", parameter_name, allocator); + response.AddMember("data", details, allocator); } - std::lock_guard lock(platform_views_mutex_); - platform_views_.insert(platform_view); } -void Shell::RemovePlatformView(PlatformView* platform_view) { - if (platform_view == nullptr) { - return; +// Service protocol handler +bool Shell::OnServiceProtocolScreenshot( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); + auto screenshot = rasterizer_->ScreenshotLastLayerTree( + Rasterizer::ScreenshotType::CompressedImage, true); + if (screenshot.data) { + response.SetObject(); + auto& allocator = response.GetAllocator(); + response.AddMember("type", "Screenshot", allocator); + rapidjson::Value image; + image.SetString(static_cast(screenshot.data->data()), + screenshot.data->size(), allocator); + response.AddMember("screenshot", image, allocator); + return true; } - std::lock_guard lock(platform_views_mutex_); - platform_views_.erase(platform_view); + ServiceProtocolParameterError(response, + "Could not capture image screenshot."); + return false; } -void Shell::IteratePlatformViews( - std::function iterator) const { - if (iterator == nullptr) { - return; +// Service protocol handler +bool Shell::OnServiceProtocolScreenshotSKP( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); + auto screenshot = rasterizer_->ScreenshotLastLayerTree( + Rasterizer::ScreenshotType::SkiaPicture, true); + if (screenshot.data) { + response.SetObject(); + auto& allocator = response.GetAllocator(); + response.AddMember("type", "ScreenshotSkp", allocator); + rapidjson::Value skp; + skp.SetString(static_cast(screenshot.data->data()), + screenshot.data->size(), allocator); + response.AddMember("skp", skp, allocator); + return true; } - std::lock_guard lock(platform_views_mutex_); - for (PlatformView* view : platform_views_) { - if (!iterator(view)) { - return; - } + ServiceProtocolParameterError(response, "Could not capture SKP screenshot."); + return false; +} + +// Service protocol handler +bool Shell::OnServiceProtocolRunInView( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + + if (params.count("mainScript") == 0) { + ServiceProtocolParameterError(response, + "'mainScript' parameter is missing."); + return false; + } + + if (params.count("packagesFile") == 0) { + ServiceProtocolParameterError(response, + "'packagesFile' parameter is missing."); + return false; } + + if (params.count("assetDirectory") == 0) { + ServiceProtocolParameterError(response, + "'assetDirectory' parameter is missing."); + return false; + } + + RunConfiguration configuration(IsolateConfiguration::CreateForSource( + params.at("mainScript").ToString(), + params.at("packagesFile").ToString())); + + configuration.AddAssetResolver(std::make_unique( + fml::OpenFile(params.at("assetDirectory").ToString().c_str(), + fml::OpenPermission::kRead, true))); + + auto& allocator = response.GetAllocator(); + response.SetObject(); + if (engine_->Restart(std::move(configuration))) { + response.AddMember("type", "Success", allocator); + auto new_description = GetServiceProtocolDescription(); + rapidjson::Value view(rapidjson::kObjectType); + new_description.Write(this, view, allocator); + response.AddMember("view", view, allocator); + return true; + } else { + FXL_DLOG(ERROR) << "Could not run configuration in engine."; + response.AddMember("type", "Failure", allocator); + return false; + } + + FXL_DCHECK(false); + return false; } -void Shell::RunInPlatformView(uintptr_t view_id, - const char* main_script, - const char* packages_file, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name) { - fxl::AutoResetWaitableEvent latch; - FXL_DCHECK(view_id != 0); - FXL_DCHECK(main_script); - FXL_DCHECK(packages_file); - FXL_DCHECK(asset_directory); - FXL_DCHECK(view_existed); - - blink::Threads::UI()->PostTask([this, view_id, main_script, packages_file, - asset_directory, view_existed, - dart_isolate_id, isolate_name, &latch]() { - RunInPlatformViewUIThread(view_id, main_script, packages_file, - asset_directory, view_existed, dart_isolate_id, - isolate_name, &latch); - }); - latch.Wait(); +// Service protocol handler +bool Shell::OnServiceProtocolFlushUIThreadTasks( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + // This API should not be invoked by production code. + // It can potentially starve the service isolate if the main isolate pauses + // at a breakpoint or is in an infinite loop. + // + // It should be invoked from the VM Service and and blocks it until UI thread + // tasks are processed. + response.SetObject(); + response.AddMember("type", "Success", response.GetAllocator()); + return true; } -void Shell::RunInPlatformViewUIThread(uintptr_t view_id, - const std::string& main, - const std::string& packages, - const std::string& assets_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch) { - FXL_DCHECK(ui_thread_checker_ && - ui_thread_checker_->IsCreationThreadCurrent()); - - *view_existed = false; - - IteratePlatformViews( - [view_id, // argument -#if !defined(OS_WIN) - // Using std::move on const references inside lambda capture is - // not supported on Windows for some reason. - assets_directory = std::move(assets_directory), // argument - main = std::move(main), // argument - packages = std::move(packages), // argument -#else - assets_directory, // argument - main, // argument - packages, // argument -#endif - &view_existed, // out - &dart_isolate_id, // out - &isolate_name // out - ](PlatformView* view) -> bool { - if (reinterpret_cast(view) != view_id) { - // Keep looking. - return true; - } - *view_existed = true; - view->RunFromSource(assets_directory, main, packages); - *dart_isolate_id = view->engine().GetUIIsolateMainPort(); - *isolate_name = view->engine().GetUIIsolateName(); - // We found the requested view. Stop iterating over platform views. - return false; - }); +// Service protocol handler +bool Shell::OnServiceProtocolSetAssetBundlePath( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - latch->Signal(); -} + if (params.count("assetDirectory") == 0) { + ServiceProtocolParameterError(response, + "'assetDirectory' parameter is missing."); + return false; + } -void Shell::SetAssetBundlePathInPlatformView(uintptr_t view_id, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name) { - fxl::AutoResetWaitableEvent latch; - FXL_DCHECK(view_id != 0); - FXL_DCHECK(asset_directory); - FXL_DCHECK(view_existed); - - blink::Threads::UI()->PostTask([this, view_id, asset_directory, view_existed, - dart_isolate_id, isolate_name, &latch]() { - SetAssetBundlePathInPlatformViewUIThread(view_id, asset_directory, - view_existed, dart_isolate_id, - isolate_name, &latch); - }); - latch.Wait(); + auto& allocator = response.GetAllocator(); + response.SetObject(); + + auto asset_manager = fxl::MakeRefCounted(); + + asset_manager->PushFront(std::make_unique( + fml::OpenFile(params.at("assetDirectory").ToString().c_str(), + fml::OpenPermission::kRead, true))); + + if (engine_->UpdateAssetManager(std::move(asset_manager))) { + response.AddMember("type", "Success", allocator); + auto new_description = GetServiceProtocolDescription(); + rapidjson::Value view(rapidjson::kObjectType); + new_description.Write(this, view, allocator); + response.AddMember("view", view, allocator); + return true; + } else { + FXL_DLOG(ERROR) << "Could not update asset directory."; + response.AddMember("type", "Failure", allocator); + return false; + } + + FXL_DCHECK(false); + return false; } -void Shell::SetAssetBundlePathInPlatformViewUIThread( - uintptr_t view_id, - const std::string& assets_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch) { - FXL_DCHECK(ui_thread_checker_ && - ui_thread_checker_->IsCreationThreadCurrent()); - - *view_existed = false; - - IteratePlatformViews( - [view_id, // argument -#if !defined(OS_WIN) - // Using std::move on const references inside lambda capture is - // not supported on Windows for some reason. - // TODO(https://github.com/flutter/flutter/issues/13908): - // Investigate the root cause of the difference. - assets_directory = std::move(assets_directory), // argument -#else - assets_directory, // argument -#endif - &view_existed, // out - &dart_isolate_id, // out - &isolate_name // out - ](PlatformView* view) -> bool { - if (reinterpret_cast(view) != view_id) { - // Keep looking. - return true; +Rasterizer::Screenshot Shell::Screenshot( + Rasterizer::ScreenshotType screenshot_type, + bool base64_encode) { + TRACE_EVENT0("flutter", "Shell::Screenshot"); + fxl::AutoResetWaitableEvent latch; + Rasterizer::Screenshot screenshot; + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetGPUTaskRunner(), [&latch, // + rasterizer = GetRasterizer(), // + &screenshot, // + screenshot_type, // + base64_encode // + ]() { + if (rasterizer) { + screenshot = rasterizer->ScreenshotLastLayerTree(screenshot_type, + base64_encode); } - *view_existed = true; - view->SetAssetBundlePath(assets_directory); - *dart_isolate_id = view->engine().GetUIIsolateMainPort(); - *isolate_name = view->engine().GetUIIsolateName(); - // We found the requested view. Stop iterating over - // platform views. - return false; + latch.Signal(); }); - - latch->Signal(); + latch.Wait(); + return screenshot; } } // namespace shell diff --git a/shell/common/shell.h b/shell/common/shell.h index 92c315dcf2aa7..02a642b0ba40f 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -5,96 +5,214 @@ #ifndef SHELL_COMMON_SHELL_H_ #define SHELL_COMMON_SHELL_H_ -#include -#include - +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/common/task_runners.h" +#include "flutter/flow/texture.h" +#include "flutter/fml/memory/thread_checker.h" +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/thread.h" -#include "flutter/shell/common/tracing_controller.h" -#include "lib/fxl/command_line.h" +#include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/window/platform_message.h" +#include "flutter/runtime/service_protocol.h" +#include "flutter/shell/common/animator.h" +#include "flutter/shell/common/engine.h" +#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" #include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/strings/string_view.h" +#include "lib/fxl/synchronization/thread_annotations.h" #include "lib/fxl/synchronization/thread_checker.h" #include "lib/fxl/synchronization/waitable_event.h" -#include "lib/fxl/tasks/task_runner.h" namespace shell { -class PlatformView; - -class Shell { +class Shell final : public PlatformView::Delegate, + public Animator::Delegate, + public Engine::Delegate, + public blink::ServiceProtocol::Handler { public: + template + using CreateCallback = std::function(Shell&)>; + static std::unique_ptr Create( + blink::TaskRunners task_runners, + blink::Settings settings, + CreateCallback on_create_platform_view, + CreateCallback on_create_rasterizer); + ~Shell(); - static void InitStandalone(fxl::CommandLine command_line, - std::string icu_data_path = "", - std::string application_library_path = "", - std::string bundle_path = ""); + const blink::Settings& GetSettings() const; - static Shell& Shared(); + const blink::TaskRunners& GetTaskRunners() const; - const fxl::CommandLine& GetCommandLine() const; + fml::WeakPtr GetRasterizer(); - void AddPlatformView(PlatformView* platform_view); + fml::WeakPtr GetEngine(); - void RemovePlatformView(PlatformView* platform_view); + fml::WeakPtr GetPlatformView(); - void IteratePlatformViews( - std::function iterator) const; + const blink::DartVM& GetDartVM() const; - // Attempt to run a script inside a flutter view indicated by |view_id|. - // Will set |view_existed| to true if the view was found and false otherwise. - void RunInPlatformView(uintptr_t view_id, - const char* main_script, - const char* packages_file, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name); + bool IsSetup() const; - void SetAssetBundlePathInPlatformView(uintptr_t view_id, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name); + Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, + bool base64_encode); private: - fxl::CommandLine command_line_; - std::unique_ptr gpu_thread_; - std::unique_ptr ui_thread_; - std::unique_ptr io_thread_; - std::unique_ptr gpu_thread_checker_; - std::unique_ptr ui_thread_checker_; - TracingController tracing_controller_; - mutable std::mutex platform_views_mutex_; - std::unordered_set platform_views_; - - static void Init(fxl::CommandLine command_line, - const std::string& bundle_path); - - Shell(fxl::CommandLine command_line); - - void InitGpuThread(); - - void InitUIThread(); - - void RunInPlatformViewUIThread(uintptr_t view_id, - const std::string& main, - const std::string& packages, - const std::string& assets_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch); - - void SetAssetBundlePathInPlatformViewUIThread( - uintptr_t view_id, - const std::string& main, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch); + using ServiceProtocolHandler = std::function; + + const blink::TaskRunners task_runners_; + const blink::Settings settings_; + fxl::RefPtr vm_; + std::unique_ptr platform_view_; // on platform task runner + std::unique_ptr engine_; // on UI task runner + std::unique_ptr rasterizer_; // on GPU task runner + std::unique_ptr io_manager_; // on IO task runner + + std::unordered_map, + ServiceProtocolHandler> // task-runner/function + // pair + > + service_protocol_handlers_; + bool is_setup_ = false; + + Shell(blink::TaskRunners task_runners, blink::Settings settings); + + static std::unique_ptr CreateShellOnPlatformThread( + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer); + + bool Setup(std::unique_ptr platform_view, + std::unique_ptr engine, + std::unique_ptr rasterizer, + std::unique_ptr io_manager); + + // |shell::PlatformView::Delegate| + void OnPlatformViewCreated(const PlatformView& view, + std::unique_ptr surface) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDestroyed(const PlatformView& view) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewSetViewportMetrics( + const PlatformView& view, + const blink::ViewportMetrics& metrics) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDispatchPlatformMessage( + const PlatformView& view, + fxl::RefPtr message) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDispatchPointerDataPacket( + const PlatformView& view, + std::unique_ptr packet) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDispatchSemanticsAction( + const PlatformView& view, + int32_t id, + blink::SemanticsAction action, + std::vector args) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, + bool enabled) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewRegisterTexture( + const PlatformView& view, + std::shared_ptr texture) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewUnregisterTexture(const PlatformView& view, + int64_t texture_id) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, + int64_t texture_id) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewSetNextFrameCallback(const PlatformView& view, + fxl::Closure closure) override; + + // |shell::Animator::Delegate| + void OnAnimatorBeginFrame(const Animator& animator, + fxl::TimePoint frame_time) override; + + // |shell::Animator::Delegate| + void OnAnimatorNotifyIdle(const Animator& animator, + int64_t deadline) override; + + // |shell::Animator::Delegate| + void OnAnimatorDraw( + const Animator& animator, + fxl::RefPtr> pipeline) override; + + // |shell::Animator::Delegate| + void OnAnimatorDrawLastLayerTree(const Animator& animator) override; + + // |shell::Engine::Delegate| + void OnEngineUpdateSemantics(const Engine& engine, + blink::SemanticsNodeUpdates update) override; + + // |shell::Engine::Delegate| + void OnEngineHandlePlatformMessage( + const Engine& engine, + fxl::RefPtr message) override; + + // |blink::ServiceProtocol::Handler| + fxl::RefPtr GetServiceProtocolHandlerTaskRunner( + fxl::StringView method) const override; + + // |blink::ServiceProtocol::Handler| + bool HandleServiceProtocolMessage( + fxl::StringView method, // one if the extension names specified above. + const ServiceProtocolMap& params, + rapidjson::Document& response) override; + + // |blink::ServiceProtocol::Handler| + blink::ServiceProtocol::Handler::Description GetServiceProtocolDescription() + const override; + + // Service protocol handler + bool OnServiceProtocolScreenshot( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolScreenshotSKP( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolRunInView( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolFlushUIThreadTasks( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolSetAssetBundlePath( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); FXL_DISALLOW_COPY_AND_ASSIGN(Shell); }; diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc new file mode 100644 index 0000000000000..67689341a1586 --- /dev/null +++ b/shell/common/shell_unittests.cc @@ -0,0 +1,133 @@ +// Copyright 2017 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 +#include +#include + +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/thread_host.h" +#include "gtest/gtest.h" +#include "lib/fxl/synchronization/waitable_event.h" + +#define CURRENT_TEST_NAME \ + std::string { \ + ::testing::UnitTest::GetInstance()->current_test_info()->name() \ + } + +namespace shell { + +TEST(ShellTest, InitializeWithInvalidThreads) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + blink::TaskRunners task_runners("test", nullptr, nullptr, nullptr, nullptr); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_FALSE(shell); +} + +TEST(ShellTest, InitializeWithDifferentThreads) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", + ThreadHost::Type::Platform | ThreadHost::Type::GPU | + ThreadHost::Type::IO | ThreadHost::Type::UI); + blink::TaskRunners task_runners("test", + thread_host.platform_thread->GetTaskRunner(), + thread_host.gpu_thread->GetTaskRunner(), + thread_host.ui_thread->GetTaskRunner(), + thread_host.io_thread->GetTaskRunner()); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +TEST(ShellTest, InitializeWithSingleThread) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", + ThreadHost::Type::Platform); + auto task_runner = thread_host.platform_thread->GetTaskRunner(); + blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, + task_runner); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +TEST(ShellTest, InitializeWithSingleThreadWhichIsTheCallingThread) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + fml::MessageLoop::EnsureInitializedForCurrentThread(); + auto task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); + blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, + task_runner); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +TEST(ShellTest, InitializeWithMultipleThreadButCallingThreadAsPlatformThread) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + ThreadHost thread_host( + "io.flutter.test." + CURRENT_TEST_NAME + ".", + ThreadHost::Type::GPU | ThreadHost::Type::IO | ThreadHost::Type::UI); + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::TaskRunners task_runners( + "test", fml::MessageLoop::GetCurrent().GetTaskRunner(), + thread_host.gpu_thread->GetTaskRunner(), + thread_host.ui_thread->GetTaskRunner(), + thread_host.io_thread->GetTaskRunner()); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +} // namespace shell diff --git a/shell/common/surface.cc b/shell/common/surface.cc index 01d288a5e5085..228647e8b3512 100644 --- a/shell/common/surface.cc +++ b/shell/common/surface.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "flutter/shell/common/surface.h" + #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" #include "third_party/skia/include/core/SkSurface.h" @@ -59,27 +60,22 @@ bool SurfaceFrame::PerformSubmit() { return false; } -Surface::Surface() : scale_(1.0) {} - -Surface::~Surface() = default; +Surface::Surface() : Surface(std::make_unique()) {} -bool Surface::SupportsScaling() const { - return false; +Surface::Surface(std::unique_ptr compositor_context) + : compositor_context_(std::move(compositor_context)) { + FXL_DCHECK(compositor_context_); + // TODO: Get rid of these explicit calls and move the logic to the c/dtors of + // the compositor context. + compositor_context_->OnGrContextCreated(); } -double Surface::GetScale() const { - return scale_; +Surface::~Surface() { + compositor_context_->OnGrContextDestroyed(); } -void Surface::SetScale(double scale) { - static constexpr double kMaxScale = 1.0; - static constexpr double kMinScale = 0.25; - if (scale > kMaxScale) { - scale = kMaxScale; - } else if (scale < kMinScale) { - scale = kMinScale; - } - scale_ = scale; +flow::CompositorContext& Surface::GetCompositorContext() { + return *compositor_context_; } } // namespace shell diff --git a/shell/common/surface.h b/shell/common/surface.h index 906480237f416..6133a7d519fff 100644 --- a/shell/common/surface.h +++ b/shell/common/surface.h @@ -7,7 +7,7 @@ #include -#include "lib/fxl/compiler_specific.h" +#include "flutter/flow/compositor_context.h" #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -45,6 +45,8 @@ class Surface { public: Surface(); + Surface(std::unique_ptr compositor_context); + virtual ~Surface(); virtual bool IsValid() = 0; @@ -53,14 +55,12 @@ class Surface { virtual GrContext* GetContext() = 0; - virtual bool SupportsScaling() const; - - double GetScale() const; - - void SetScale(double scale); + flow::CompositorContext& GetCompositorContext(); private: - double scale_; + std::unique_ptr compositor_context_; + + FXL_DISALLOW_COPY_AND_ASSIGN(Surface); }; } // namespace shell diff --git a/shell/common/switches.cc b/shell/common/switches.cc index c1c82ff166ac1..82da6ee180af8 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -90,4 +91,125 @@ const fxl::StringView FlagForSwitch(Switch swtch) { return fxl::StringView(); } +template +static bool GetSwitchValue(const fxl::CommandLine& command_line, + shell::Switch sw, + T* result) { + std::string switch_string; + + if (!command_line.GetOptionValue(shell::FlagForSwitch(sw), &switch_string)) { + return false; + } + + std::stringstream stream(switch_string); + T value = 0; + if (stream >> value) { + *result = value; + return true; + } + + return false; +} + +blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { + blink::Settings settings = {}; + + // Enable Observatory + settings.enable_observatory = + !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); + + // Set Observatory Port + if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { + if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, + &settings.observatory_port)) { + FXL_LOG(INFO) + << "Observatory port specified was malformed. Will default to " + << settings.observatory_port; + } + } + + // Checked mode overrides. + settings.dart_non_checked_mode = + command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); + + settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); + + settings.start_paused = + command_line.HasOption(FlagForSwitch(Switch::StartPaused)); + + settings.enable_dart_profiling = + command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); + + settings.enable_software_rendering = + command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); + + settings.using_blink = + command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); + + settings.endless_trace_buffer = + command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); + + settings.trace_startup = + command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); + + settings.skia_deterministic_rendering_on_cpu = + command_line.HasOption(FlagForSwitch(Switch::SkiaDeterministicRendering)); + + command_line.GetOptionValue(FlagForSwitch(Switch::FLX), &settings.flx_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir), + &settings.assets_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::Snapshot), + &settings.script_snapshot_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::MainDartFile), + &settings.main_dart_file_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::Packages), + &settings.packages_file_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), + &settings.aot_snapshot_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), + &settings.aot_vm_snapshot_data_filename); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), + &settings.aot_vm_snapshot_instr_filename); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), + &settings.aot_isolate_snapshot_data_filename); + + command_line.GetOptionValue( + FlagForSwitch(Switch::AotIsolateSnapshotInstructions), + &settings.aot_isolate_snapshot_instr_filename); + + command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), + &settings.temp_directory_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::ICUDataFilePath), + &settings.icu_data_path); + + settings.use_test_fonts = + command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); + + command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); + std::string all_dart_flags; + if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), + &all_dart_flags)) { + std::stringstream stream(all_dart_flags); + std::istream_iterator end; + for (std::istream_iterator it(stream); it != end; ++it) + settings.dart_flags.push_back(*it); + } + +#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE + settings.trace_skia = + command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); +#endif + + return settings; +} + } // namespace shell diff --git a/shell/common/switches.h b/shell/common/switches.h index 91778a78e92cc..6b67b1f6a1567 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "flutter/common/settings.h" +#include "lib/fxl/command_line.h" #include "lib/fxl/strings/string_view.h" #ifndef SHELL_COMMON_SWITCHES_H_ @@ -23,12 +25,29 @@ namespace shell { DEF_SWITCHES_START DEF_SWITCH(AotSharedLibraryPath, "aot-shared-library-path", "Path to the *.so.") -DEF_SWITCH(AotSnapshotPath, "aot-snapshot-path", "Path to the AOT snapshot.") -DEF_SWITCH(AotVmSnapshotData, "vm-snapshot-data", "") -DEF_SWITCH(AotVmSnapshotInstructions, "vm-snapshot-instr", "") -DEF_SWITCH(AotIsolateSnapshotData, "isolate-snapshot-data", "") -DEF_SWITCH(AotIsolateSnapshotInstructions, "isolate-snapshot-instr", "") +DEF_SWITCH(AotSnapshotPath, + "aot-snapshot-path", + "Path to the directory containing the four files specified by " + "AotVmSnapshotData, AotVmSnapshotInstructions, " + "AotVmSnapshotInstructions and AotIsolateSnapshotInstructions.") +DEF_SWITCH(AotVmSnapshotData, + "vm-snapshot-data", + "The VM snapshot data that will be memory mapped as read-only. " + "AotSnapshotPath must be present.") +DEF_SWITCH(AotVmSnapshotInstructions, + "vm-snapshot-instr", + "The VM instructions snapshot that will be memory mapped as read " + "and executable. AotSnapshotPath must be present.") +DEF_SWITCH(AotIsolateSnapshotData, + "isolate-snapshot-data", + "The isolate snapshot data that will be memory mapped as read-only. " + "AotSnapshotPath must be present.") +DEF_SWITCH(AotIsolateSnapshotInstructions, + "isolate-snapshot-instr", + "The isolate instructions snapshot that will be memory mapped as " + "read and executable. AotSnapshotPath must be present.") DEF_SWITCH(CacheDirPath, "cache-dir-path", "Path to the cache directory.") +DEF_SWITCH(ICUDataFilePath, "icu-data-file-path", "Path to the ICU data file.") DEF_SWITCH(DartFlags, "dart-flags", "Flags passed directly to the Dart VM without being interpreted " @@ -73,10 +92,6 @@ DEF_SWITCH(FlutterAssetsDir, DEF_SWITCH(Help, "help", "Display this help text.") DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.") DEF_SWITCH(MainDartFile, "dart-main", "The path to the main Dart file.") -DEF_SWITCH(NonInteractive, - "non-interactive", - "Make the shell non-interactive. By default, the shell attempts " - "to setup a window and create an OpenGL context.") DEF_SWITCH(Packages, "packages", "Specify the path to the packages.") DEF_SWITCH(Snapshot, "snapshot-blob", "Specify the path to the snapshot blob") DEF_SWITCH(StartPaused, @@ -113,7 +128,9 @@ DEF_SWITCHES_END void PrintUsage(const std::string& executable_name); -const fxl::StringView FlagForSwitch(Switch sw); +const fxl::StringView FlagForSwitch(Switch swtch); + +blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line); } // namespace shell diff --git a/shell/common/thread_host.cc b/shell/common/thread_host.cc new file mode 100644 index 0000000000000..f35594829d5d9 --- /dev/null +++ b/shell/common/thread_host.cc @@ -0,0 +1,38 @@ +// Copyright 2017 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/shell/common/thread_host.h" + +namespace shell { + +ThreadHost::ThreadHost() = default; + +ThreadHost::ThreadHost(std::string name_prefix, uint64_t mask) { + if (mask & ThreadHost::Type::Platform) { + platform_thread = std::make_unique(name_prefix + ".platform"); + } + + if (mask & ThreadHost::Type::UI) { + ui_thread = std::make_unique(name_prefix + ".ui"); + } + + if (mask & ThreadHost::Type::GPU) { + gpu_thread = std::make_unique(name_prefix + ".gpu"); + } + + if (mask & ThreadHost::Type::IO) { + io_thread = std::make_unique(name_prefix + ".io"); + } +} + +ThreadHost::~ThreadHost() = default; + +void ThreadHost::Reset() { + platform_thread.reset(); + ui_thread.reset(); + gpu_thread.reset(); + io_thread.reset(); +} + +} // namespace shell diff --git a/shell/common/thread_host.h b/shell/common/thread_host.h new file mode 100644 index 0000000000000..a688aa6a06a85 --- /dev/null +++ b/shell/common/thread_host.h @@ -0,0 +1,43 @@ +// Copyright 2017 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_SHELL_COMMON_THREAD_HOST_H_ +#define FLUTTER_SHELL_COMMON_THREAD_HOST_H_ + +#include + +#include "flutter/fml/thread.h" +#include "lib/fxl/macros.h" + +namespace shell { + +struct ThreadHost { + enum Type { + Platform = 1 << 0, + UI = 1 << 1, + GPU = 1 << 2, + IO = 1 << 3, + }; + + std::unique_ptr platform_thread; + std::unique_ptr ui_thread; + std::unique_ptr gpu_thread; + std::unique_ptr io_thread; + + ThreadHost(); + + ThreadHost(ThreadHost&&) = default; + + ThreadHost& operator=(ThreadHost&&) = default; + + ThreadHost(std::string name_prefix, uint64_t type_mask); + + ~ThreadHost(); + + void Reset(); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_THREAD_HOST_H_ diff --git a/shell/common/tracing_controller.cc b/shell/common/tracing_controller.cc deleted file mode 100644 index 6fa8d9d5ee87f..0000000000000 --- a/shell/common/tracing_controller.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/common/tracing_controller.h" - -#include - -#include "flutter/common/threads.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/shell/common/shell.h" -#include "lib/fxl/logging.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace shell { - -TracingController::TracingController() : tracing_active_(false) { - blink::SetEmbedderTracingCallbacks( - std::unique_ptr( - new blink::EmbedderTracingCallbacks([this]() { StartTracing(); }, - [this]() { StopTracing(); }))); -} - -TracingController::~TracingController() { - blink::SetEmbedderTracingCallbacks(nullptr); -} - -static void AddTraceMetadata() { - blink::Threads::Gpu()->PostTask([]() { Dart_SetThreadName("gpu_thread"); }); - blink::Threads::UI()->PostTask([]() { Dart_SetThreadName("ui_thread"); }); - blink::Threads::IO()->PostTask([]() { Dart_SetThreadName("io_thread"); }); - blink::Threads::Platform()->PostTask( - []() { Dart_SetThreadName("platform_thread"); }); -} - -void TracingController::StartTracing() { - if (tracing_active_) - return; - tracing_active_ = true; - AddTraceMetadata(); -} - -void TracingController::StopTracing() { - if (!tracing_active_) { - return; - } - tracing_active_ = false; -} - -} // namespace shell diff --git a/shell/common/tracing_controller.h b/shell/common/tracing_controller.h deleted file mode 100644 index 3f9e6f03ab14c..0000000000000 --- a/shell/common/tracing_controller.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_COMMON_TRACING_CONTROLLER_H_ -#define SHELL_COMMON_TRACING_CONTROLLER_H_ - -#include - -#include "lib/fxl/macros.h" - -namespace shell { - -class TracingController { - public: - TracingController(); - - ~TracingController(); - - void StartTracing(); - - void StopTracing(); - - bool tracing_active() const { return tracing_active_; } - - private: - bool tracing_active_; - - FXL_DISALLOW_COPY_AND_ASSIGN(TracingController); -}; - -} // namespace shell - -#endif // SHELL_COMMON_TRACING_CONTROLLER_H_ diff --git a/shell/common/vsync_waiter.cc b/shell/common/vsync_waiter.cc index 5acc235b1f68d..ba2f21c389c11 100644 --- a/shell/common/vsync_waiter.cc +++ b/shell/common/vsync_waiter.cc @@ -4,8 +4,45 @@ #include "flutter/shell/common/vsync_waiter.h" +#include "flutter/fml/task_runner.h" +#include "flutter/fml/trace_event.h" + namespace shell { +VsyncWaiter::VsyncWaiter(blink::TaskRunners task_runners) + : task_runners_(std::move(task_runners)) {} + VsyncWaiter::~VsyncWaiter() = default; +void VsyncWaiter::AsyncWaitForVsync(Callback callback) { + { + std::lock_guard lock(callback_mutex_); + callback_ = std::move(callback); + } + AwaitVSync(); +} + +void VsyncWaiter::FireCallback(fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { + Callback callback; + + { + std::lock_guard lock(callback_mutex_); + callback = std::move(callback_); + } + + if (!callback) { + return; + } + + task_runners_.GetUITaskRunner()->PostTask( + [callback, frame_start_time, frame_target_time]() { + // Note: The tag name must be "VSYNC" (it is special) so that the + // "Highlight + // Vsync" checkbox in the timeline can be enabled. + TRACE_EVENT0("flutter", "VSYNC"); + callback(frame_start_time, frame_target_time); + }); +} + } // namespace shell diff --git a/shell/common/vsync_waiter.h b/shell/common/vsync_waiter.h index 77319ed8b6966..82231fdf4f853 100644 --- a/shell/common/vsync_waiter.h +++ b/shell/common/vsync_waiter.h @@ -6,7 +6,10 @@ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_H_ #include +#include +#include +#include "flutter/common/task_runners.h" #include "lib/fxl/time/time_point.h" namespace shell { @@ -16,9 +19,23 @@ class VsyncWaiter { using Callback = std::function; - virtual void AsyncWaitForVsync(Callback callback) = 0; - virtual ~VsyncWaiter(); + + void AsyncWaitForVsync(Callback callback); + + protected: + const blink::TaskRunners task_runners_; + std::mutex callback_mutex_; + Callback callback_; + + VsyncWaiter(blink::TaskRunners task_runners); + + virtual void AwaitVSync() = 0; + + void FireCallback(fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time); + + FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiter); }; } // namespace shell diff --git a/shell/common/vsync_waiter_fallback.cc b/shell/common/vsync_waiter_fallback.cc index 01c86cdedc6aa..bcf061bb7615f 100644 --- a/shell/common/vsync_waiter_fallback.cc +++ b/shell/common/vsync_waiter_fallback.cc @@ -4,7 +4,6 @@ #include "flutter/shell/common/vsync_waiter_fallback.h" -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { @@ -21,28 +20,25 @@ fxl::TimePoint SnapToNextTick(fxl::TimePoint value, } // namespace -VsyncWaiterFallback::VsyncWaiterFallback() - : phase_(fxl::TimePoint::Now()), weak_factory_(this) {} +VsyncWaiterFallback::VsyncWaiterFallback(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)), + phase_(fxl::TimePoint::Now()), + weak_factory_(this) {} VsyncWaiterFallback::~VsyncWaiterFallback() = default; constexpr fxl::TimeDelta interval = fxl::TimeDelta::FromSecondsF(1.0 / 60.0); -void VsyncWaiterFallback::AsyncWaitForVsync(Callback callback) { - FXL_DCHECK(!callback_); - callback_ = std::move(callback); - +void VsyncWaiterFallback::AwaitVSync() { fxl::TimePoint now = fxl::TimePoint::Now(); fxl::TimePoint next = SnapToNextTick(now, phase_, interval); - blink::Threads::UI()->PostDelayedTask( + task_runners_.GetUITaskRunner()->PostDelayedTask( [self = weak_factory_.GetWeakPtr()] { - if (!self) - return; - fxl::TimePoint frame_time = fxl::TimePoint::Now(); - Callback callback = std::move(self->callback_); - self->callback_ = Callback(); - callback(frame_time, frame_time + interval); + if (self) { + const auto frame_time = fxl::TimePoint::Now(); + self->FireCallback(frame_time, frame_time + interval); + } }, next - now); } diff --git a/shell/common/vsync_waiter_fallback.h b/shell/common/vsync_waiter_fallback.h index bfb7e118b1330..d3cc8faaf6ce7 100644 --- a/shell/common/vsync_waiter_fallback.h +++ b/shell/common/vsync_waiter_fallback.h @@ -5,25 +5,24 @@ #ifndef FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "lib/fxl/time/time_point.h" namespace shell { -class VsyncWaiterFallback : public VsyncWaiter { +class VsyncWaiterFallback final : public VsyncWaiter { public: - VsyncWaiterFallback(); - ~VsyncWaiterFallback() override; + VsyncWaiterFallback(blink::TaskRunners task_runners); - void AsyncWaitForVsync(Callback callback) override; + ~VsyncWaiterFallback() override; private: fxl::TimePoint phase_; - Callback callback_; + fxl::WeakPtrFactory weak_factory_; - fml::WeakPtrFactory weak_factory_; + void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback); }; diff --git a/shell/gpu/BUILD.gn b/shell/gpu/BUILD.gn index c050e120b0a10..cd093e1238f7f 100644 --- a/shell/gpu/BUILD.gn +++ b/shell/gpu/BUILD.gn @@ -6,14 +6,17 @@ import("$flutter_root/shell/config.gni") source_set("gpu") { sources = [ - "gpu_rasterizer.cc", - "gpu_rasterizer.h", - "gpu_surface_gl.cc", - "gpu_surface_gl.h", "gpu_surface_software.cc", "gpu_surface_software.h", ] + if (!is_fuchsia) { + sources += [ + "gpu_surface_gl.cc", + "gpu_surface_gl.h", + ] + } + if (shell_enable_vulkan) { sources += [ "gpu_surface_vulkan.cc", diff --git a/shell/gpu/gpu_rasterizer.cc b/shell/gpu/gpu_rasterizer.cc deleted file mode 100644 index 3424f989b3205..0000000000000 --- a/shell/gpu/gpu_rasterizer.cc +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2015 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. - -#include "gpu_rasterizer.h" - -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/glue/trace_event.h" -#include "flutter/shell/common/picture_serializer.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "third_party/skia/include/core/SkPicture.h" - -namespace shell { - -GPURasterizer::GPURasterizer(std::unique_ptr info) - : compositor_context_(std::move(info)), weak_factory_(this) {} - -GPURasterizer::~GPURasterizer() = default; - -fml::WeakPtr GPURasterizer::GetWeakRasterizerPtr() { - return weak_factory_.GetWeakPtr(); -} - -void GPURasterizer::Setup(std::unique_ptr surface, - fxl::Closure continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) { - surface_ = std::move(surface); - compositor_context_.OnGrContextCreated(); - - continuation(); - - setup_completion_event->Signal(); -} - -void GPURasterizer::Clear(SkColor color, const SkISize& size) { - if (surface_ == nullptr) { - return; - } - - auto frame = surface_->AcquireFrame(size); - - if (frame == nullptr) { - return; - } - - SkCanvas* canvas = frame->SkiaCanvas(); - - if (canvas == nullptr) { - return; - } - - canvas->clear(color); - - frame->Submit(); -} - -void GPURasterizer::Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) { - compositor_context_.OnGrContextDestroyed(); - if (surface_) { - surface_.reset(); - } - last_layer_tree_.reset(); - teardown_completion_event->Signal(); -} - -flow::LayerTree* GPURasterizer::GetLastLayerTree() { - return last_layer_tree_.get(); -} - -void GPURasterizer::DrawLastLayerTree() { - if (!last_layer_tree_ || !surface_) { - return; - } - DrawToSurface(*last_layer_tree_); -} - -flow::TextureRegistry& GPURasterizer::GetTextureRegistry() { - return compositor_context_.texture_registry(); -} - -void GPURasterizer::Draw( - fxl::RefPtr> pipeline) { - TRACE_EVENT0("flutter", "GPURasterizer::Draw"); - - flutter::Pipeline::Consumer consumer = - std::bind(&GPURasterizer::DoDraw, this, std::placeholders::_1); - - // Consume as many pipeline items as possible. But yield the event loop - // between successive tries. - switch (pipeline->Consume(consumer)) { - case flutter::PipelineConsumeResult::MoreAvailable: { - auto weak_this = weak_factory_.GetWeakPtr(); - blink::Threads::Gpu()->PostTask([weak_this, pipeline]() { - if (weak_this) { - weak_this->Draw(pipeline); - } - }); - break; - } - default: - break; - } -} - -void GPURasterizer::DoDraw(std::unique_ptr layer_tree) { - if (!layer_tree || !surface_) { - return; - } - - // There is no way for the compositor to know how long the layer tree - // construction took. Fortunately, the layer tree does. Grab that time - // for instrumentation. - compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); - - DrawToSurface(*layer_tree); - - NotifyNextFrameOnce(); - - last_layer_tree_ = std::move(layer_tree); -} - -void GPURasterizer::DrawToSurface(flow::LayerTree& layer_tree) { - auto frame = surface_->AcquireFrame(layer_tree.frame_size()); - - if (frame == nullptr) { - return; - } - - auto canvas = frame->SkiaCanvas(); - - if (canvas == nullptr) { - return; - } - - auto compositor_frame = - compositor_context_.AcquireFrame(surface_->GetContext(), canvas); - - canvas->clear(SK_ColorBLACK); - - layer_tree.Raster(compositor_frame); - - frame->Submit(); -} - -void GPURasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { - nextFrameCallback_ = nextFrameCallback; -} - -void GPURasterizer::NotifyNextFrameOnce() { - if (nextFrameCallback_) { - blink::Threads::Platform()->PostTask([callback = nextFrameCallback_] { - TRACE_EVENT0("flutter", "GPURasterizer::NotifyNextFrameOnce"); - callback(); - }); - nextFrameCallback_ = nullptr; - } -} - -void GPURasterizer::SetTextureRegistry(flow::TextureRegistry* textureRegistry) { - compositor_context_.SetTextureRegistry(textureRegistry); -} - -} // namespace shell diff --git a/shell/gpu/gpu_rasterizer.h b/shell/gpu/gpu_rasterizer.h deleted file mode 100644 index ad16ee2c47989..0000000000000 --- a/shell/gpu/gpu_rasterizer.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ -#define SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ - -#include "flutter/flow/compositor_context.h" -#include "flutter/shell/common/rasterizer.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/fxl/synchronization/waitable_event.h" - -namespace shell { - -class Surface; - -class GPURasterizer : public Rasterizer { - public: - GPURasterizer(std::unique_ptr info); - - ~GPURasterizer() override; - - void Setup(std::unique_ptr surface, - fxl::Closure continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) override; - - void Clear(SkColor color, const SkISize& size) override; - - void Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) override; - - fml::WeakPtr GetWeakRasterizerPtr() override; - - flow::LayerTree* GetLastLayerTree() override; - - void DrawLastLayerTree() override; - - flow::TextureRegistry& GetTextureRegistry() override; - - void Draw(fxl::RefPtr> pipeline) override; - - // Set a callback to be called once when the next frame is drawn. - void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; - - void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; - - private: - std::unique_ptr surface_; - flow::CompositorContext compositor_context_; - std::unique_ptr last_layer_tree_; - // A closure to be called when the underlaying surface presents a frame the - // next time. NULL if there is no callback or the callback was set back to - // NULL after being called. - fxl::Closure nextFrameCallback_; - fml::WeakPtrFactory weak_factory_; - - void DoDraw(std::unique_ptr layer_tree); - - void DrawToSurface(flow::LayerTree& layer_tree); - - void NotifyNextFrameOnce(); - - FXL_DISALLOW_COPY_AND_ASSIGN(GPURasterizer); -}; - -} // namespace shell - -#endif // SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 331fd188a9ed3..284a10e413b46 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -72,6 +72,8 @@ GPUSurfaceGL::~GPUSurfaceGL() { return; } + GetCompositorContext().OnGrContextDestroyed(); + onscreen_surface_ = nullptr; context_->releaseResourcesAndAbandonContext(); context_ = nullptr; @@ -210,12 +212,11 @@ std::unique_ptr GPUSurfaceGL::AcquireFrame(const SkISize& size) { return nullptr; } - auto weak_this = weak_factory_.GetWeakPtr(); - - SurfaceFrame::SubmitCallback submit_callback = - [weak_this](const SurfaceFrame& surface_frame, SkCanvas* canvas) { - return weak_this ? weak_this->PresentSurface(canvas) : false; - }; + SurfaceFrame::SubmitCallback submit_callback = [weak = weak_factory_ + .GetWeakPtr()]( + const SurfaceFrame& surface_frame, SkCanvas* canvas) { + return weak ? weak->PresentSurface(canvas) : false; + }; return std::make_unique(surface, submit_callback); } diff --git a/shell/gpu/gpu_surface_gl.h b/shell/gpu/gpu_surface_gl.h index 5cf092dae66c5..abc9f46aee297 100644 --- a/shell/gpu/gpu_surface_gl.h +++ b/shell/gpu/gpu_surface_gl.h @@ -5,10 +5,9 @@ #ifndef SHELL_GPU_GPU_SURFACE_GL_H_ #define SHELL_GPU_GPU_SURFACE_GL_H_ -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" -#include "flutter/synchronization/debug_thread_checker.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { @@ -44,7 +43,7 @@ class GPUSurfaceGL : public Surface { sk_sp onscreen_surface_; sk_sp offscreen_surface_; bool valid_ = false; - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; bool CreateOrUpdateSurfaces(const SkISize& size); diff --git a/shell/gpu/gpu_surface_software.cc b/shell/gpu/gpu_surface_software.cc index e340e605652dd..ea8c827b22405 100644 --- a/shell/gpu/gpu_surface_software.cc +++ b/shell/gpu/gpu_surface_software.cc @@ -18,20 +18,13 @@ bool GPUSurfaceSoftware::IsValid() { return delegate_ != nullptr; } -bool GPUSurfaceSoftware::SupportsScaling() const { - return true; -} - std::unique_ptr GPUSurfaceSoftware::AcquireFrame( const SkISize& logical_size) { if (!IsValid()) { return nullptr; } - // Check if we need to support surface scaling. - const auto scale = SupportsScaling() ? GetScale() : 1.0; - const auto size = SkISize::Make(logical_size.width() * scale, - logical_size.height() * scale); + const auto size = SkISize::Make(logical_size.width(), logical_size.height()); sk_sp backing_store = delegate_->AcquireBackingStore(size); @@ -48,12 +41,10 @@ std::unique_ptr GPUSurfaceSoftware::AcquireFrame( // irrespective of surface scaling. SkCanvas* canvas = backing_store->getCanvas(); canvas->resetMatrix(); - canvas->scale(scale, scale); - SurfaceFrame::SubmitCallback - on_submit = [self = weak_factory_.GetWeakPtr()]( - const SurfaceFrame& surface_frame, SkCanvas* canvas) - ->bool { + SurfaceFrame::SubmitCallback on_submit = + [self = weak_factory_.GetWeakPtr()](const SurfaceFrame& surface_frame, + SkCanvas* canvas) -> bool { // If the surface itself went away, there is nothing more to do. if (!self || !self->IsValid() || canvas == nullptr) { return false; diff --git a/shell/gpu/gpu_surface_software.h b/shell/gpu/gpu_surface_software.h index f7312153db8bc..238754f312b80 100644 --- a/shell/gpu/gpu_surface_software.h +++ b/shell/gpu/gpu_surface_software.h @@ -5,9 +5,9 @@ #ifndef FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkSurface.h" namespace shell { @@ -30,12 +30,9 @@ class GPUSurfaceSoftware : public Surface { GrContext* GetContext() override; - bool SupportsScaling() const override; - private: GPUSurfaceSoftwareDelegate* delegate_; - - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceSoftware); }; diff --git a/shell/gpu/gpu_surface_vulkan.h b/shell/gpu/gpu_surface_vulkan.h index eafed43a6296d..f1e25fbe987b8 100644 --- a/shell/gpu/gpu_surface_vulkan.h +++ b/shell/gpu/gpu_surface_vulkan.h @@ -6,11 +6,12 @@ #define SHELL_GPU_GPU_SURFACE_VULKAN_H_ #include -#include "flutter/fml/memory/weak_ptr.h" + #include "flutter/shell/common/surface.h" #include "flutter/vulkan/vulkan_native_surface.h" #include "flutter/vulkan/vulkan_window.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -29,7 +30,7 @@ class GPUSurfaceVulkan : public Surface { private: vulkan::VulkanWindow window_; - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan); }; diff --git a/shell/platform/BUILD.gn b/shell/platform/BUILD.gn index 4b1e1a9e0bfeb..ae3b1003f22fe 100644 --- a/shell/platform/BUILD.gn +++ b/shell/platform/BUILD.gn @@ -13,13 +13,11 @@ group("platform") { ] } else if (is_linux) { deps = [ - "linux", "embedder", ] } else if (is_win) { - deps = [ - "win" - ] + # There is no platform target on windows. Instead, only a tester is used. + deps = [] } else { assert(false, "Unknown/Unsupported platform.") } diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index d9744ad890caa..129c877faed0f 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -17,21 +17,25 @@ shared_library("flutter_shell_native") { "android_context_gl.h", "android_environment_gl.cc", "android_environment_gl.h", - "android_external_texture_gl.h", "android_external_texture_gl.cc", + "android_external_texture_gl.h", "android_native_window.cc", "android_native_window.h", + "android_shell_holder.cc", + "android_shell_holder.h", "android_surface.cc", "android_surface.h", "android_surface_gl.cc", "android_surface_gl.h", - "android_surface_software.h", "android_surface_software.cc", - "apk_asset_provider.h", + "android_surface_software.h", "apk_asset_provider.cc", + "apk_asset_provider.h", "flutter_main.cc", "flutter_main.h", "library_loader.cc", + "platform_message_response_android.cc", + "platform_message_response_android.h", "platform_view_android.cc", "platform_view_android.h", "platform_view_android_jni.cc", @@ -41,10 +45,10 @@ shared_library("flutter_shell_native") { ] deps = [ + "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/assets", "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/shell/common", @@ -59,9 +63,7 @@ shared_library("flutter_shell_native") { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] defines = [] diff --git a/shell/platform/android/android_context_gl.cc b/shell/platform/android/android_context_gl.cc index f54629f8644b9..6338dc96908e1 100644 --- a/shell/platform/android/android_context_gl.cc +++ b/shell/platform/android/android_context_gl.cc @@ -3,9 +3,13 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_context_gl.h" + #include + #include +#include "flutter/fml/trace_event.h" + namespace shell { template @@ -65,19 +69,17 @@ static EGLResult CreateContext(EGLDisplay display, return {context != EGL_NO_CONTEXT, context}; } -static EGLResult ChooseEGLConfiguration( - EGLDisplay display, - PlatformView::SurfaceConfig config) { +static EGLResult ChooseEGLConfiguration(EGLDisplay display) { EGLint attributes[] = { // clang-format off EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RED_SIZE, config.red_bits, - EGL_GREEN_SIZE, config.green_bits, - EGL_BLUE_SIZE, config.blue_bits, - EGL_ALPHA_SIZE, config.alpha_bits, - EGL_DEPTH_SIZE, config.depth_bits, - EGL_STENCIL_SIZE, config.stencil_bits, + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_ALPHA_SIZE, 8, + EGL_DEPTH_SIZE, 0, + EGL_STENCIL_SIZE, 0, EGL_NONE, // termination sentinel // clang-format on }; @@ -142,7 +144,6 @@ bool AndroidContextGL::CreatePBufferSurface() { } AndroidContextGL::AndroidContextGL(fxl::RefPtr env, - PlatformView::SurfaceConfig config, const AndroidContextGL* share_context) : environment_(env), window_(nullptr), @@ -158,8 +159,7 @@ AndroidContextGL::AndroidContextGL(fxl::RefPtr env, // Choose a valid configuration. - std::tie(success, config_) = - ChooseEGLConfiguration(environment_->Display(), config); + std::tie(success, config_) = ChooseEGLConfiguration(environment_->Display()); if (!success) { FXL_LOG(ERROR) << "Could not choose an EGL configuration."; diff --git a/shell/platform/android/android_context_gl.h b/shell/platform/android/android_context_gl.h index 207f621c66bd1..b29851b34564d 100644 --- a/shell/platform/android/android_context_gl.h +++ b/shell/platform/android/android_context_gl.h @@ -44,7 +44,6 @@ class AndroidContextGL : public fxl::RefCountedThreadSafe { bool valid_; AndroidContextGL(fxl::RefPtr env, - PlatformView::SurfaceConfig config, const AndroidContextGL* share_context = nullptr); ~AndroidContextGL(); diff --git a/shell/platform/android/android_external_texture_gl.cc b/shell/platform/android/android_external_texture_gl.cc index 02a40c22474a1..35db9cbbfdb95 100644 --- a/shell/platform/android/android_external_texture_gl.cc +++ b/shell/platform/android/android_external_texture_gl.cc @@ -5,7 +5,7 @@ #include "flutter/shell/platform/android/android_external_texture_gl.h" #include -#include "flutter/common/threads.h" + #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "third_party/skia/include/gpu/GrTexture.h" @@ -19,17 +19,14 @@ AndroidExternalTextureGL::AndroidExternalTextureGL( AndroidExternalTextureGL::~AndroidExternalTextureGL() = default; void AndroidExternalTextureGL::OnGrContextCreated() { - ASSERT_IS_GPU_THREAD; state_ = AttachmentState::uninitialized; } void AndroidExternalTextureGL::MarkNewFrameAvailable() { - ASSERT_IS_GPU_THREAD; new_frame_ready_ = true; } void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { - ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::detached) { return; } @@ -42,7 +39,8 @@ void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { Update(); new_frame_ready_ = false; } - GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, GL_RGBA8_OES}; + GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, + GL_RGBA8_OES}; GrBackendTexture backendTexture(1, 1, GrMipMapped::kNo, textureInfo); sk_sp image = SkImage::MakeFromTexture( canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, @@ -82,7 +80,6 @@ void AndroidExternalTextureGL::UpdateTransform() { } void AndroidExternalTextureGL::OnGrContextDestroyed() { - ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::attached) { Detach(); } diff --git a/shell/platform/android/android_external_texture_gl.h b/shell/platform/android/android_external_texture_gl.h index df890b91c827f..67d6541d964c2 100644 --- a/shell/platform/android/android_external_texture_gl.h +++ b/shell/platform/android/android_external_texture_gl.h @@ -25,8 +25,7 @@ class AndroidExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; - // Called on GPU thread. - void MarkNewFrameAvailable(); + void MarkNewFrameAvailable() override; private: void Attach(jint textureName); diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc new file mode 100644 index 0000000000000..7dc454f1fb74a --- /dev/null +++ b/shell/platform/android/android_shell_holder.cc @@ -0,0 +1,169 @@ +// Copyright 2018 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/shell/platform/android/android_shell_holder.h" + +#include +#include + +#include +#include +#include + +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/platform/android/platform_view_android.h" +#include "lib/fxl/functional/make_copyable.h" + +namespace shell { + +AndroidShellHolder::AndroidShellHolder( + blink::Settings settings, + fml::jni::JavaObjectWeakGlobalRef java_object) + : settings_(std::move(settings)), java_object_(java_object) { + static size_t shell_count = 1; + auto thread_label = std::to_string(shell_count++); + + thread_host_ = {thread_label, ThreadHost::Type::UI | ThreadHost::Type::GPU | + ThreadHost::Type::IO}; + + fml::WeakPtr weak_platform_view; + Shell::CreateCallback on_create_platform_view = + [java_object, &weak_platform_view](Shell& shell) { + auto platform_view_android = std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + java_object, // java object handle for JNI interop + shell.GetSettings() + .enable_software_rendering // use software rendering + ); + weak_platform_view = platform_view_android->GetWeakPtr(); + return platform_view_android; + }; + + Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // The current thread will be used as the platform thread. Ensure that the + // message loop is initialized. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + blink::TaskRunners task_runners( + thread_label, // label + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + thread_host_.gpu_thread->GetTaskRunner(), // gpu + thread_host_.ui_thread->GetTaskRunner(), // ui + thread_host_.io_thread->GetTaskRunner() // io + ); + + shell_ = + Shell::Create(task_runners, // task runners + settings_, // settings + on_create_platform_view, // platform view create callback + on_create_rasterizer // rasterizer create callback + ); + + platform_view_ = weak_platform_view; + FXL_DCHECK(platform_view_); + + is_valid_ = shell_ != nullptr; + + if (is_valid_) { + task_runners.GetGPUTaskRunner()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); + task_runners.GetUITaskRunner()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); + } +} + +AndroidShellHolder::~AndroidShellHolder() = default; + +bool AndroidShellHolder::IsValid() const { + return is_valid_; +} + +const blink::Settings& AndroidShellHolder::GetSettings() const { + return settings_; +} + +void AndroidShellHolder::Launch(RunConfiguration config) { + if (!IsValid()) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = shell_->GetEngine(), // + config = std::move(config) // + ]() mutable { + if (engine) { + if (!engine->Run(std::move(config))) { + FXL_LOG(ERROR) << "Could not launch engine in configuration."; + } + } + })); +} + +void AndroidShellHolder::SetViewportMetrics( + const blink::ViewportMetrics& metrics) { + if (!IsValid()) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), metrics]() { + if (engine) { + engine->SetViewportMetrics(metrics); + } + }); +} + +void AndroidShellHolder::DispatchPointerDataPacket( + std::unique_ptr packet) { + if (!IsValid()) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = shell_->GetEngine(), packet = std::move(packet)] { + if (engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); +} + +Rasterizer::Screenshot AndroidShellHolder::Screenshot( + Rasterizer::ScreenshotType type, + bool base64_encode) { + if (!IsValid()) { + return {nullptr, SkISize::MakeEmpty()}; + } + return shell_->Screenshot(type, base64_encode); +} + +fml::WeakPtr AndroidShellHolder::GetPlatformView() { + FXL_DCHECK(platform_view_); + return platform_view_; +} + +void AndroidShellHolder::UpdateAssetManager( + fxl::RefPtr asset_manager) { + if (!IsValid() || !asset_manager) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), + asset_manager = std::move(asset_manager)]() { + if (engine) { + if (!engine->UpdateAssetManager(std::move(asset_manager))) { + FXL_DLOG(ERROR) << "Could not update asset asset manager."; + } + } + }); +} + +} // namespace shell diff --git a/shell/platform/android/android_shell_holder.h b/shell/platform/android/android_shell_holder.h new file mode 100644 index 0000000000000..e0905f0f9e42e --- /dev/null +++ b/shell/platform/android/android_shell_holder.h @@ -0,0 +1,59 @@ +// Copyright 2018 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_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ + +#include + +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/shell/common/run_configuration.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/android/platform_view_android.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class AndroidShellHolder { + public: + AndroidShellHolder(blink::Settings settings, + fml::jni::JavaObjectWeakGlobalRef java_object); + + ~AndroidShellHolder(); + + bool IsValid() const; + + void Launch(RunConfiguration configuration); + + void SetViewportMetrics(const blink::ViewportMetrics& metrics); + + void DispatchPointerDataPacket( + std::unique_ptr packet); + + const blink::Settings& GetSettings() const; + + fml::WeakPtr GetPlatformView(); + + Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, + bool base64_encode); + + void UpdateAssetManager(fxl::RefPtr asset_manager); + + private: + const blink::Settings settings_; + const fml::jni::JavaObjectWeakGlobalRef java_object_; + fml::WeakPtr platform_view_; + ThreadHost thread_host_; + std::unique_ptr shell_; + bool is_valid_ = false; + + FXL_DISALLOW_COPY_AND_ASSIGN(AndroidShellHolder); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ diff --git a/shell/platform/android/android_surface.cc b/shell/platform/android/android_surface.cc index 4dd08609da370..a8b41bacbf7c5 100644 --- a/shell/platform/android/android_surface.cc +++ b/shell/platform/android/android_surface.cc @@ -4,8 +4,32 @@ #include "flutter/shell/platform/android/android_surface.h" +#include + +#include "flutter/shell/platform/android/android_surface_gl.h" +#include "flutter/shell/platform/android/android_surface_software.h" +#if SHELL_ENABLE_VULKAN +#include "flutter/shell/platform/android/android_surface_vulkan.h" +#endif // SHELL_ENABLE_VULKAN + namespace shell { +std::unique_ptr AndroidSurface::Create( + bool use_software_rendering) { + if (use_software_rendering) { + auto software_surface = std::make_unique(); + return software_surface->IsValid() ? std::move(software_surface) : nullptr; + } +#if SHELL_ENABLE_VULKAN + auto vulkan_surface = std::make_unique(); + return vulkan_surface->IsValid() ? std::move(vulkan_surface) : nullptr; +#else // SHELL_ENABLE_VULKAN + auto gl_surface = std::make_unique(); + return gl_surface->IsOffscreenContextValid() ? std::move(gl_surface) + : nullptr; +#endif // SHELL_ENABLE_VULKAN +} + AndroidSurface::~AndroidSurface() = default; } // namespace shell diff --git a/shell/platform/android/android_surface.h b/shell/platform/android/android_surface.h index 2425a61e20707..858b07eb45d9f 100644 --- a/shell/platform/android/android_surface.h +++ b/shell/platform/android/android_surface.h @@ -19,6 +19,8 @@ namespace shell { class AndroidSurface { public: + static std::unique_ptr Create(bool use_software_rendering); + virtual ~AndroidSurface(); virtual bool IsValid() const = 0; @@ -27,14 +29,11 @@ class AndroidSurface { virtual std::unique_ptr CreateGPUSurface() = 0; - virtual SkISize OnScreenSurfaceSize() const = 0; - virtual bool OnScreenSurfaceResize(const SkISize& size) const = 0; virtual bool ResourceContextMakeCurrent() = 0; - virtual bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config = {}) = 0; + virtual bool SetNativeWindow(fxl::RefPtr window) = 0; }; } // namespace shell diff --git a/shell/platform/android/android_surface_gl.cc b/shell/platform/android/android_surface_gl.cc index f30ac1272b043..274b652a97b74 100644 --- a/shell/platform/android/android_surface_gl.cc +++ b/shell/platform/android/android_surface_gl.cc @@ -6,14 +6,12 @@ #include -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_ptr.h" namespace shell { -static fxl::RefPtr GlobalResourceLoadingContext( - PlatformView::SurfaceConfig offscreen_config) { +static fxl::RefPtr GlobalResourceLoadingContext() { // AndroidSurfaceGL instances are only ever created on the platform thread. So // there is no need to lock here. @@ -29,11 +27,7 @@ static fxl::RefPtr GlobalResourceLoadingContext( return nullptr; } - // TODO(chinmaygarde): We should check that the configurations are stable - // across multiple invocations. - - auto context = - fxl::MakeRefCounted(environment, offscreen_config); + auto context = fxl::MakeRefCounted(environment); if (!context->IsValid()) { return nullptr; @@ -43,10 +37,9 @@ static fxl::RefPtr GlobalResourceLoadingContext( return global_context; } -AndroidSurfaceGL::AndroidSurfaceGL( - PlatformView::SurfaceConfig offscreen_config) { +AndroidSurfaceGL::AndroidSurfaceGL() { // Acquire the offscreen context. - offscreen_context_ = GlobalResourceLoadingContext(offscreen_config); + offscreen_context_ = GlobalResourceLoadingContext(); if (!offscreen_context_ || !offscreen_context_->IsValid()) { offscreen_context_ = nullptr; @@ -60,14 +53,9 @@ bool AndroidSurfaceGL::IsOffscreenContextValid() const { } void AndroidSurfaceGL::TeardownOnScreenContext() { - fxl::AutoResetWaitableEvent latch; - blink::Threads::Gpu()->PostTask([this, &latch]() { - if (IsValid()) { - GLContextClearCurrent(); - } - latch.Signal(); - }); - latch.Wait(); + if (onscreen_context_) { + onscreen_context_->ClearCurrent(); + } onscreen_context_ = nullptr; } @@ -84,11 +72,6 @@ std::unique_ptr AndroidSurfaceGL::CreateGPUSurface() { return surface->IsValid() ? std::move(surface) : nullptr; } -SkISize AndroidSurfaceGL::OnScreenSurfaceSize() const { - FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); - return onscreen_context_->GetSize(); -} - bool AndroidSurfaceGL::OnScreenSurfaceResize(const SkISize& size) const { FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->Resize(size); @@ -99,8 +82,8 @@ bool AndroidSurfaceGL::ResourceContextMakeCurrent() { return offscreen_context_->MakeCurrent(); } -bool AndroidSurfaceGL::SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) { +bool AndroidSurfaceGL::SetNativeWindow( + fxl::RefPtr window) { // In any case, we want to get rid of our current onscreen context. onscreen_context_ = nullptr; @@ -112,7 +95,7 @@ bool AndroidSurfaceGL::SetNativeWindow(fxl::RefPtr window, // Create the onscreen context. onscreen_context_ = fxl::MakeRefCounted( - offscreen_context_->Environment(), config, + offscreen_context_->Environment(), offscreen_context_.get() /* sharegroup */); if (!onscreen_context_->IsValid()) { diff --git a/shell/platform/android/android_surface_gl.h b/shell/platform/android/android_surface_gl.h index 08aee081c8266..e26f2bf50d3a9 100644 --- a/shell/platform/android/android_surface_gl.h +++ b/shell/platform/android/android_surface_gl.h @@ -16,35 +16,43 @@ namespace shell { -class AndroidSurfaceGL : public GPUSurfaceGLDelegate, public AndroidSurface { +class AndroidSurfaceGL final : public GPUSurfaceGLDelegate, + public AndroidSurface { public: - explicit AndroidSurfaceGL(PlatformView::SurfaceConfig offscreen_config); + AndroidSurfaceGL(); ~AndroidSurfaceGL() override; - bool IsValid() const override; - bool IsOffscreenContextValid() const; + // |shell::AndroidSurface| + bool IsValid() const override; + + // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; + // |shell::AndroidSurface| void TeardownOnScreenContext() override; - SkISize OnScreenSurfaceSize() const override; - + // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; + // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) override; + // |shell::AndroidSurface| + bool SetNativeWindow(fxl::RefPtr window) override; + // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; + // |shell::GPUSurfaceGLDelegate| bool GLContextClearCurrent() override; + // |shell::GPUSurfaceGLDelegate| bool GLContextPresent() override; + // |shell::GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; private: diff --git a/shell/platform/android/android_surface_software.cc b/shell/platform/android/android_surface_software.cc index 68bf99b27ba56..4b1378802d9e4 100644 --- a/shell/platform/android/android_surface_software.cc +++ b/shell/platform/android/android_surface_software.cc @@ -3,15 +3,14 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_surface_software.h" -#include "flutter/common/threads.h" -#include "flutter/fml/platform/android/jni_weak_ref.h" -#include "flutter/fml/platform/android/scoped_java_ref.h" -#include "flutter/shell/platform/android/platform_view_android_jni.h" #include #include +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" +#include "flutter/shell/platform/android/platform_view_android_jni.h" #include "lib/fxl/logging.h" namespace shell { @@ -132,17 +131,12 @@ bool AndroidSurfaceSoftware::PresentBackingStore( void AndroidSurfaceSoftware::TeardownOnScreenContext() {} -SkISize AndroidSurfaceSoftware::OnScreenSurfaceSize() const { - return SkISize(); -} - bool AndroidSurfaceSoftware::OnScreenSurfaceResize(const SkISize& size) const { return true; } bool AndroidSurfaceSoftware::SetNativeWindow( - fxl::RefPtr window, - PlatformView::SurfaceConfig config) { + fxl::RefPtr window) { native_window_ = std::move(window); if (!(native_window_ && native_window_->IsValid())) return false; diff --git a/shell/platform/android/android_surface_software.h b/shell/platform/android/android_surface_software.h index 76184b707cf74..0f82fc5dfe154 100644 --- a/shell/platform/android/android_surface_software.h +++ b/shell/platform/android/android_surface_software.h @@ -13,35 +13,39 @@ namespace shell { -class AndroidSurfaceSoftware : public AndroidSurface, - public GPUSurfaceSoftwareDelegate { +class AndroidSurfaceSoftware final : public AndroidSurface, + public GPUSurfaceSoftwareDelegate { public: AndroidSurfaceSoftware(); ~AndroidSurfaceSoftware() override; + // |shell::AndroidSurface| bool IsValid() const override; + // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; + // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; - sk_sp AcquireBackingStore(const SkISize& size) override; - - bool PresentBackingStore(sk_sp backing_store) override; - + // |shell::AndroidSurface| void TeardownOnScreenContext() override; - SkISize OnScreenSurfaceSize() const override; - + // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; - bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) override; + // |shell::AndroidSurface| + bool SetNativeWindow(fxl::RefPtr window) override; + + // |shell::GPUSurfaceSoftwareDelegate| + sk_sp AcquireBackingStore(const SkISize& size) override; + + // |shell::GPUSurfaceSoftwareDelegate| + bool PresentBackingStore(sk_sp backing_store) override; private: sk_sp sk_surface_; - fxl::RefPtr native_window_; SkColorType target_color_type_; SkAlphaType target_alpha_type_; diff --git a/shell/platform/android/android_surface_vulkan.cc b/shell/platform/android/android_surface_vulkan.cc index ccacf538b8781..e8817690188c2 100644 --- a/shell/platform/android/android_surface_vulkan.cc +++ b/shell/platform/android/android_surface_vulkan.cc @@ -21,10 +21,12 @@ bool AndroidSurfaceVulkan::IsValid() const { return proc_table_->HasAcquiredMandatoryProcAddresses(); } +// |shell::AndroidSurface| void AndroidSurfaceVulkan::TeardownOnScreenContext() { - // + // Nothing to do. } +// |shell::AndroidSurface| std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { if (!IsValid()) { return nullptr; @@ -52,21 +54,20 @@ std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { return gpu_surface; } -SkISize AndroidSurfaceVulkan::OnScreenSurfaceSize() const { - return native_window_ ? native_window_->GetSize() : SkISize::Make(0, 0); -} - +// |shell::AndroidSurface| bool AndroidSurfaceVulkan::OnScreenSurfaceResize(const SkISize& size) const { return true; } +// |shell::AndroidSurface| bool AndroidSurfaceVulkan::ResourceContextMakeCurrent() { + FXL_DLOG(ERROR) << "The vulkan backend does not support resource contexts."; return false; } +// |shell::AndroidSurface| bool AndroidSurfaceVulkan::SetNativeWindow( - fxl::RefPtr window, - PlatformView::SurfaceConfig config) { + fxl::RefPtr window) { native_window_ = std::move(window); return native_window_ && native_window_->IsValid(); } diff --git a/shell/platform/android/android_surface_vulkan.h b/shell/platform/android/android_surface_vulkan.h index f1ecf610c8584..fd3f493d49790 100644 --- a/shell/platform/android/android_surface_vulkan.h +++ b/shell/platform/android/android_surface_vulkan.h @@ -20,20 +20,23 @@ class AndroidSurfaceVulkan : public AndroidSurface { ~AndroidSurfaceVulkan() override; + // |shell::AndroidSurface| bool IsValid() const override; - void TeardownOnScreenContext() override; - + // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; - SkISize OnScreenSurfaceSize() const override; + // |shell::AndroidSurface| + void TeardownOnScreenContext() override; + // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; + // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) override; + // |shell::AndroidSurface| + bool SetNativeWindow(fxl::RefPtr window) override; private: fxl::RefPtr proc_table_; diff --git a/shell/platform/android/apk_asset_provider.cc b/shell/platform/android/apk_asset_provider.cc index fdd4910a12f4c..4cf6da16dc64f 100644 --- a/shell/platform/android/apk_asset_provider.cc +++ b/shell/platform/android/apk_asset_provider.cc @@ -7,32 +7,41 @@ namespace blink { +APKAssetProvider::APKAssetProvider(JNIEnv* env, + jobject jassetManager, + std::string directory) + : directory_(std::move(directory)) { + assetManager_ = AAssetManager_fromJava(env, jassetManager); +} + +APKAssetProvider::~APKAssetProvider() = default; + +bool APKAssetProvider::IsValid() const { + return true; +} + bool APKAssetProvider::GetAsBuffer(const std::string& asset_name, - std::vector* data) { + std::vector* data) const { std::stringstream ss; ss << directory_.c_str() << "/" << asset_name; - AAsset* asset = AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); + AAsset* asset = + AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); if (!asset) { - return false; + return false; } uint8_t* buffer = (uint8_t*)AAsset_getBuffer(asset); if (!buffer) { FXL_LOG(ERROR) << "Got null trying to acquire buffer for asset:" << asset; + AAsset_close(asset); return false; } data->resize(AAsset_getLength(asset)); std::copy(buffer, buffer + data->size(), data->begin()); + AAsset_close(asset); return true; } -APKAssetProvider::~APKAssetProvider() {} - -APKAssetProvider::APKAssetProvider(JNIEnv* env, jobject jassetManager, std::string directory) - : directory_(std::move(directory)) { - assetManager_ = AAssetManager_fromJava(env, jassetManager); -} - } // namespace blink diff --git a/shell/platform/android/apk_asset_provider.h b/shell/platform/android/apk_asset_provider.h index c40b1ed2a1866..70ddbe454bc61 100644 --- a/shell/platform/android/apk_asset_provider.h +++ b/shell/platform/android/apk_asset_provider.h @@ -5,28 +5,35 @@ #ifndef FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ #define FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ -#include #include +#include -#include "flutter/assets/asset_provider.h" +#include "flutter/assets/asset_resolver.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class APKAssetProvider - : public AssetProvider { +class APKAssetProvider final : public AssetResolver { public: - explicit APKAssetProvider(JNIEnv* env, jobject assetManager, std::string directory); + explicit APKAssetProvider(JNIEnv* env, + jobject assetManager, + std::string directory); virtual ~APKAssetProvider(); + private: + AAssetManager* assetManager_; + const std::string directory_; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data); + std::vector* data) const override; - private: - AAssetManager* assetManager_; - const std::string directory_; + FXL_DISALLOW_COPY_AND_ASSIGN(APKAssetProvider); }; } // namespace blink -#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file +#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file diff --git a/shell/platform/android/flutter_main.cc b/shell/platform/android/flutter_main.cc index 6df346a128722..08d97add93b87 100644 --- a/shell/platform/android/flutter_main.cc +++ b/shell/platform/android/flutter_main.cc @@ -2,38 +2,85 @@ // 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/shell/platform/android/flutter_main.h" #include +#include "flutter/fml/message_loop.h" +#include "flutter/fml/paths.h" #include "flutter/fml/platform/android/jni_util.h" +#include "flutter/runtime/dart_vm.h" #include "flutter/runtime/start_up.h" #include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" #include "lib/fxl/arraysize.h" #include "lib/fxl/command_line.h" +#include "lib/fxl/files/file.h" #include "lib/fxl/macros.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -static void Init(JNIEnv* env, - jclass clazz, - jobject context, - jobjectArray jargs, - jstring bundlePath) { - // Prepare command line arguments and initialize the shell. +FlutterMain::FlutterMain(blink::Settings settings) + : settings_(std::move(settings)) {} + +FlutterMain::~FlutterMain() = default; + +static std::unique_ptr g_flutter_main; + +FlutterMain& FlutterMain::Get() { + FXL_CHECK(g_flutter_main) << "ensureInitializationComplete must have already " + "been called."; + return *g_flutter_main; +} + +const blink::Settings& FlutterMain::GetSettings() const { + return settings_; +} + +void FlutterMain::Init(JNIEnv* env, + jclass clazz, + jobject context, + jobjectArray jargs, + jstring bundlePath) { std::vector args; - args.push_back("flutter_tester"); + args.push_back("flutter"); for (auto& arg : fml::jni::StringArrayToVector(env, jargs)) { args.push_back(std::move(arg)); } - auto command_line = fxl::CommandLineFromIterators(args.begin(), args.end()); - std::string icu_data_path = - command_line.GetOptionValueWithDefault("icu-data-file-path", ""); - Shell::InitStandalone(std::move(command_line), std::move(icu_data_path), - /* application_library_path= */ "", - fml::jni::JavaStringToString(env, bundlePath)); + + auto settings = SettingsFromCommandLine(command_line); + + settings.assets_path = fml::jni::JavaStringToString(env, bundlePath); + + if (!blink::DartVM::IsRunningPrecompiledCode()) { + // Check to see if the appropriate kernel files are present and configure + // settings accordingly. + auto platform_kernel_path = + fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); + auto application_kernel_path = + fml::paths::JoinPaths({settings.assets_path, "kernel_blob.bin"}); + + if (files::IsFile(platform_kernel_path) && + files::IsFile(application_kernel_path)) { + settings.kernel_snapshot_path = platform_kernel_path; + settings.application_kernel_asset = application_kernel_path; + } + } + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + // Not thread safe. Will be removed when FlutterMain is refactored to no + // longer be a singleton. + g_flutter_main.reset(new FlutterMain(std::move(settings))); } static void RecordStartTimestamp(JNIEnv* env, @@ -44,7 +91,7 @@ static void RecordStartTimestamp(JNIEnv* env, blink::engine_main_enter_ts = Dart_TimelineGetMicros() - initTimeMicros; } -bool RegisterFlutterMain(JNIEnv* env) { +bool FlutterMain::Register(JNIEnv* env) { static const JNINativeMethod methods[] = { { .name = "nativeInit", diff --git a/shell/platform/android/flutter_main.h b/shell/platform/android/flutter_main.h index f4f65c499f966..6c8717e9cebdb 100644 --- a/shell/platform/android/flutter_main.h +++ b/shell/platform/android/flutter_main.h @@ -7,9 +7,34 @@ #include +#include "flutter/common/settings.h" +#include "lib/fxl/macros.h" + namespace shell { -bool RegisterFlutterMain(JNIEnv* env); +class FlutterMain { + public: + ~FlutterMain(); + + static bool Register(JNIEnv* env); + + static FlutterMain& Get(); + + const blink::Settings& GetSettings() const; + + private: + const blink::Settings settings_; + + FlutterMain(blink::Settings settings); + + static void Init(JNIEnv* env, + jclass clazz, + jobject context, + jobjectArray jargs, + jstring bundlePath); + + FXL_DISALLOW_COPY_AND_ASSIGN(FlutterMain); +}; } // namespace shell diff --git a/shell/platform/android/library_loader.cc b/shell/platform/android/library_loader.cc index c51d0114282f6..569825ce33e21 100644 --- a/shell/platform/android/library_loader.cc +++ b/shell/platform/android/library_loader.cc @@ -16,7 +16,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { bool result = false; // Register FlutterMain. - result = shell::RegisterFlutterMain(env); + result = shell::FlutterMain::Register(env); FXL_CHECK(result); // Register PlatformView diff --git a/shell/platform/android/platform_message_response_android.cc b/shell/platform/android/platform_message_response_android.cc new file mode 100644 index 0000000000000..214080ec5bde3 --- /dev/null +++ b/shell/platform/android/platform_message_response_android.cc @@ -0,0 +1,62 @@ +// Copyright 2018 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/shell/platform/android/platform_message_response_android.h" + +#include "flutter/shell/platform/android/platform_view_android_jni.h" +#include "lib/fxl/functional/make_copyable.h" + +namespace shell { + +PlatformMessageResponseAndroid::PlatformMessageResponseAndroid( + int response_id, + fml::jni::JavaObjectWeakGlobalRef weak_java_object, + fxl::RefPtr platform_task_runner) + : response_id_(response_id), + weak_java_object_(weak_java_object), + platform_task_runner_(std::move(platform_task_runner)) {} + +// |blink::PlatformMessageResponse| +void PlatformMessageResponseAndroid::Complete(std::vector data) { + platform_task_runner_->PostTask( + fxl::MakeCopyable([response = response_id_, // + weak_java_object = weak_java_object_, // + data = std::move(data) // + ]() { + // We are on the platform thread. Attempt to get the strong reference to + // the Java object. + auto env = fml::jni::AttachCurrentThread(); + auto java_object = weak_java_object.get(env); + + if (java_object.is_null()) { + // The Java object was collected before this message response got to + // it. Drop the response on the floor. + return; + } + + if (data.size() == 0) { + // If the data is empty, there is no reason to create a Java byte + // array. Make the response now with a nullptr now. + FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), + response, nullptr); + } + + // Convert the vector to a Java byte array. + fml::jni::ScopedJavaLocalRef data_array( + env, env->NewByteArray(data.size())); + env->SetByteArrayRegion(data_array.obj(), 0, data.size(), + reinterpret_cast(data.data())); + + // Make the response call into Java. + FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), + response, data_array.obj()); + })); +} + +// |blink::PlatformMessageResponse| +void PlatformMessageResponseAndroid::CompleteEmpty() { + Complete(std::vector{}); +} + +} // namespace shell diff --git a/shell/platform/android/platform_message_response_android.h b/shell/platform/android/platform_message_response_android.h new file mode 100644 index 0000000000000..2ee7f3336ac6d --- /dev/null +++ b/shell/platform/android/platform_message_response_android.h @@ -0,0 +1,39 @@ +// Copyright 2018 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_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ + +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/fml/task_runner.h" +#include "flutter/lib/ui/window/platform_message_response.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { + public: + // |blink::PlatformMessageResponse| + void Complete(std::vector data) override; + + // |blink::PlatformMessageResponse| + void CompleteEmpty() override; + + private: + PlatformMessageResponseAndroid( + int response_id, + fml::jni::JavaObjectWeakGlobalRef weak_java_object, + fxl::RefPtr platform_task_runner); + + int response_id_; + fml::jni::JavaObjectWeakGlobalRef weak_java_object_; + fxl::RefPtr platform_task_runner_; + + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageResponseAndroid); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 8f677045fb1f5..00d1e4b59e848 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -4,288 +4,55 @@ #include "flutter/shell/platform/android/platform_view_android.h" -#include -#include -#include -#include - +#include #include -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" -#include "flutter/fml/platform/android/jni_util.h" -#include "flutter/fml/platform/android/scoped_java_ref.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/shell/common/null_rasterizer.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" +#include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" #include "flutter/shell/platform/android/android_surface_gl.h" -#include "flutter/shell/platform/android/android_surface_software.h" -#include "flutter/shell/platform/android/apk_asset_provider.h" +#include "flutter/shell/platform/android/platform_message_response_android.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "flutter/shell/platform/android/vsync_waiter_android.h" -#include "lib/fxl/functional/make_copyable.h" - -#if SHELL_ENABLE_VULKAN -#include "flutter/shell/platform/android/android_surface_vulkan.h" -#endif // SHELL_ENABLE_VULKAN +#include "lib/fxl/synchronization/waitable_event.h" namespace shell { -class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); - - public: - void Complete(std::vector data) override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask( - fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { - std::shared_ptr view = self->view_.lock(); - if (!view) - return; - static_cast(view.get()) - ->HandlePlatformMessageResponse(self->response_id_, - std::move(data)); - })); - } - - void CompleteEmpty() override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask(fxl::MakeCopyable([self]() mutable { - std::shared_ptr view = self->view_.lock(); - if (!view) - return; - static_cast(view.get()) - ->HandlePlatformMessageEmptyResponse(self->response_id_); - })); - } - - private: - PlatformMessageResponseAndroid(int response_id, - std::weak_ptr view) - : response_id_(response_id), view_(view) {} - - int response_id_; - std::weak_ptr view_; -}; - -static std::unique_ptr InitializePlatformSurfaceGL() { - const PlatformView::SurfaceConfig offscreen_config = { - .red_bits = 8, - .green_bits = 8, - .blue_bits = 8, - .alpha_bits = 8, - .depth_bits = 0, - .stencil_bits = 0, - }; - auto surface = std::make_unique(offscreen_config); - return surface->IsOffscreenContextValid() ? std::move(surface) : nullptr; -} - -static std::unique_ptr InitializePlatformSurfaceVulkan() { -#if SHELL_ENABLE_VULKAN - auto surface = std::make_unique(); - return surface->IsValid() ? std::move(surface) : nullptr; -#else // SHELL_ENABLE_VULKAN - return nullptr; -#endif // SHELL_ENABLE_VULKAN +PlatformViewAndroid::PlatformViewAndroid( + PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + fml::jni::JavaObjectWeakGlobalRef java_object, + bool use_software_rendering) + : PlatformView(delegate, std::move(task_runners)), + java_object_(java_object), + android_surface_(AndroidSurface::Create(use_software_rendering)) { + FXL_CHECK(android_surface_) + << "Could not create an OpenGL, Vulkan or Software surface to setup " + "rendering."; } -static std::unique_ptr InitializePlatformSurfaceSoftware() { - auto surface = std::make_unique(); - return surface->IsValid() ? std::move(surface) : nullptr; -} - -static std::unique_ptr InitializePlatformSurface() { - if (blink::Settings::Get().enable_software_rendering) { - if (auto surface = InitializePlatformSurfaceSoftware()) { - FXL_DLOG(INFO) << "Software surface initialized."; - return surface; - } - } - - if (auto surface = InitializePlatformSurfaceVulkan()) { - FXL_DLOG(INFO) << "Vulkan surface initialized."; - return surface; - } - - FXL_DLOG(INFO) - << "Could not initialize Vulkan surface. Falling back to OpenGL."; - - if (auto surface = InitializePlatformSurfaceGL()) { - FXL_DLOG(INFO) << "GL surface initialized."; - return surface; - } - - if (auto surface = InitializePlatformSurfaceSoftware()) { - FXL_DLOG(INFO) << "Software surface initialized."; - return surface; - } - - FXL_CHECK(false) - << "Could not initialize either the Vulkan, OpenGL, or Software" - "surface backends. Flutter requires a GPU to render."; - return nullptr; -} - -PlatformViewAndroid::PlatformViewAndroid() - : PlatformView(std::make_unique()), - android_surface_(InitializePlatformSurface()) {} - PlatformViewAndroid::~PlatformViewAndroid() = default; -void PlatformViewAndroid::Attach() { - CreateEngine(); - - // Eagerly setup the IO thread context. We have already setup the surface. - SetupResourceContextOnIOThread(); - - UpdateThreadPriorities(); +void PlatformViewAndroid::NotifyCreated( + fxl::RefPtr native_window) { + InstallFirstFrameCallback(); + android_surface_->SetNativeWindow(native_window); + PlatformView::NotifyCreated(); } -void PlatformViewAndroid::Detach() { - ReleaseSurface(); -} - -void PlatformViewAndroid::SurfaceCreated(JNIEnv* env, - jobject jsurface, - jint backgroundColor) { - // Note: This frame ensures that any local references used by - // ANativeWindow_fromSurface are released immediately. This is needed as a - // workaround for https://code.google.com/p/android/issues/detail?id=68174 - fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); - - // We have a drawing surface, so swap in a non-Null rasterizer. - SetRasterizer(std::make_unique(nullptr)); - - rasterizer_->AddNextFrameCallback([this]() { - JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - if (!view.is_null()) { - FlutterViewOnFirstFrame(env, view.obj()); - } - }); - - auto native_window = fxl::MakeRefCounted( - ANativeWindow_fromSurface(env, jsurface)); - - if (!native_window->IsValid()) { - return; - } - - if (!android_surface_->SetNativeWindow(native_window)) { - return; - } - - std::unique_ptr gpu_surface = android_surface_->CreateGPUSurface(); - - if (gpu_surface == nullptr || !gpu_surface->IsValid()) { - return; - } - - NotifyCreated(std::move(gpu_surface), [ - this, backgroundColor, native_window_size = native_window->GetSize() - ] { rasterizer().Clear(backgroundColor, native_window_size); }); -} - -void PlatformViewAndroid::SurfaceChanged(jint width, jint height) { - blink::Threads::Gpu()->PostTask([this, width, height]() { - if (android_surface_) { - android_surface_->OnScreenSurfaceResize(SkISize::Make(width, height)); - } - }); -} - -void PlatformViewAndroid::UpdateThreadPriorities() { - blink::Threads::Gpu()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); - - blink::Threads::UI()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); -} - -void PlatformViewAndroid::SurfaceDestroyed() { - ReleaseSurface(); -} - -void PlatformViewAndroid::RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, - std::string snapshot_override, - std::string entrypoint, - bool reuse_runtime_controller, - jobject assetManager) { - // TODO(jsimmons): remove snapshot_override from the public FlutterView API - FXL_CHECK(snapshot_override.empty()) << "snapshot_override is obsolete"; - - // The flutter assets directory name is the last directory of the bundle_path - // and the path into the APK - size_t last_slash_idx = bundle_path.rfind("/", bundle_path.size()); - std::string flutter_assets_dir = bundle_path.substr( - last_slash_idx + 1, bundle_path.size() - last_slash_idx); - - fxl::RefPtr asset_provider = - fxl::MakeRefCounted(env, assetManager, - flutter_assets_dir); - blink::Threads::UI()->PostTask( - [engine = engine_->GetWeakPtr(), - asset_provider = std::move(asset_provider), - bundle_path = std::move(bundle_path), entrypoint = std::move(entrypoint), - reuse_runtime_controller = reuse_runtime_controller] { - if (engine) - engine->RunBundleWithAssets( - std::move(asset_provider), std::move(bundle_path), - std::move(entrypoint), reuse_runtime_controller); - }); -} - -void PlatformViewAndroid::RunBundleAndSource(std::string bundle_path, - std::string main, - std::string packages) { - blink::Threads::UI()->PostTask([ - engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path), - main = std::move(main), packages = std::move(packages) - ] { - if (engine) - engine->RunBundleAndSource(std::move(bundle_path), std::move(main), - std::move(packages)); - }); +void PlatformViewAndroid::NotifyDestroyed() { + PlatformView::NotifyDestroyed(); + android_surface_->TeardownOnScreenContext(); } -void PlatformViewAndroid::SetAssetBundlePathOnUI(std::string bundle_path) { - blink::Threads::UI()->PostTask( - [ engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path) ] { - if (engine) - engine->SetAssetBundlePath(std::move(bundle_path)); +void PlatformViewAndroid::NotifyChanged(const SkISize& size) { + fxl::AutoResetWaitableEvent latch; + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetGPUTaskRunner(), // + [&latch, surface = android_surface_.get(), size]() { + surface->OnScreenSurfaceResize(size); + latch.Signal(); }); -} - -void PlatformViewAndroid::SetViewportMetrics(jfloat device_pixel_ratio, - jint physical_width, - jint physical_height, - jint physical_padding_top, - jint physical_padding_right, - jint physical_padding_bottom, - jint physical_padding_left, - jint physical_view_inset_top, - jint physical_view_inset_right, - jint physical_view_inset_bottom, - jint physical_view_inset_left) { - blink::ViewportMetrics metrics; - metrics.device_pixel_ratio = device_pixel_ratio; - metrics.physical_width = physical_width; - metrics.physical_height = physical_height; - metrics.physical_padding_top = physical_padding_top; - metrics.physical_padding_right = physical_padding_right; - metrics.physical_padding_bottom = physical_padding_bottom; - metrics.physical_padding_left = physical_padding_left; - metrics.physical_view_inset_top = physical_view_inset_top; - metrics.physical_view_inset_right = physical_view_inset_right; - metrics.physical_view_inset_bottom = physical_view_inset_bottom; - metrics.physical_view_inset_left = physical_view_inset_left; - - blink::Threads::UI()->PostTask([ engine = engine_->GetWeakPtr(), metrics ] { - if (engine) - engine->SetViewportMetrics(metrics); - }); + latch.Wait(); } void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, @@ -301,7 +68,7 @@ void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, GetWeakPtr()); + response_id, java_object_, task_runners_.GetPlatformTaskRunner()); } PlatformView::DispatchPlatformMessage( @@ -315,7 +82,7 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, GetWeakPtr()); + response_id, java_object_, task_runners_.GetPlatformTaskRunner()); } PlatformView::DispatchPlatformMessage( @@ -323,20 +90,6 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, std::move(response))); } -void PlatformViewAndroid::DispatchPointerDataPacket(JNIEnv* env, - jobject buffer, - jint position) { - uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); - - blink::Threads::UI()->PostTask(fxl::MakeCopyable([ - engine = engine_->GetWeakPtr(), - packet = std::make_unique(data, position) - ] { - if (engine.get()) - engine->DispatchPointerDataPacket(*packet); - })); -} - void PlatformViewAndroid::InvokePlatformMessageResponseCallback( JNIEnv* env, jint response_id, @@ -369,10 +122,11 @@ void PlatformViewAndroid::InvokePlatformMessageEmptyResponseCallback( message_response->CompleteEmpty(); } +// |shell::PlatformView| void PlatformViewAndroid::HandlePlatformMessage( fxl::RefPtr message) { JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + fml::jni::ScopedJavaLocalRef view = java_object_.get(env); if (view.is_null()) return; @@ -402,35 +156,6 @@ void PlatformViewAndroid::HandlePlatformMessage( } } -void PlatformViewAndroid::HandlePlatformMessageResponse( - int response_id, - std::vector data) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - - if (view.is_null()) - return; - fml::jni::ScopedJavaLocalRef data_array( - env, env->NewByteArray(data.size())); - env->SetByteArrayRegion(data_array.obj(), 0, data.size(), - reinterpret_cast(data.data())); - - FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, - data_array.obj()); -} - -void PlatformViewAndroid::HandlePlatformMessageEmptyResponse(int response_id) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - - if (view.is_null()) - return; - FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, - nullptr); -} - void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, jint id, jint action, @@ -451,35 +176,14 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, id, static_cast(action), std::move(args_vector)); } -void PlatformViewAndroid::SetSemanticsEnabled(jboolean enabled) { - PlatformView::SetSemanticsEnabled(enabled); -} - -void PlatformViewAndroid::ReleaseSurface() { - NotifyDestroyed(); - android_surface_->TeardownOnScreenContext(); - SetRasterizer(std::make_unique()); -} - -VsyncWaiter* PlatformViewAndroid::GetVsyncWaiter() { - if (!vsync_waiter_) - vsync_waiter_ = std::make_unique(); - return vsync_waiter_.get(); -} - -bool PlatformViewAndroid::ResourceContextMakeCurrent() { - FXL_CHECK(android_surface_); - return android_surface_->ResourceContextMakeCurrent(); -} - -void PlatformViewAndroid::UpdateSemantics( - blink::SemanticsNodeUpdates update) { +// |shell::PlatformView| +void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { constexpr size_t kBytesPerNode = 36 * sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t); JNIEnv* env = fml::jni::AttachCurrentThread(); { - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + fml::jni::ScopedJavaLocalRef view = java_object_.get(env); if (view.is_null()) return; @@ -560,79 +264,6 @@ void PlatformViewAndroid::UpdateSemantics( } } -void PlatformViewAndroid::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - FXL_CHECK(env); - - { - fml::jni::ScopedJavaLocalRef local_flutter_view = - flutter_view_.get(env); - if (local_flutter_view.is_null()) { - // Collected. - return; - } - - // Grab the class of the flutter view. - jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); - FXL_CHECK(flutter_view_class); - - // Grab the runFromSource method id. - jmethodID run_from_source_method_id = env->GetMethodID( - flutter_view_class, "runFromSource", - "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); - FXL_CHECK(run_from_source_method_id); - - // Invoke runFromSource on the Android UI thread. - jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); - FXL_CHECK(java_assets_directory); - jstring java_main = env->NewStringUTF(main.c_str()); - FXL_CHECK(java_main); - jstring java_packages = env->NewStringUTF(packages.c_str()); - FXL_CHECK(java_packages); - env->CallVoidMethod(local_flutter_view.obj(), run_from_source_method_id, - java_assets_directory, java_main, java_packages); - } - - // Detaching from the VM deletes any stray local references. - fml::jni::DetachFromVM(); -} - -void PlatformViewAndroid::SetAssetBundlePath( - const std::string& assets_directory) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - FXL_CHECK(env); - - { - fml::jni::ScopedJavaLocalRef local_flutter_view = - flutter_view_.get(env); - if (local_flutter_view.is_null()) { - // Collected. - return; - } - - // Grab the class of the flutter view. - jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); - FXL_CHECK(flutter_view_class); - - // Grab the setAssetBundlePath method id. - jmethodID method_id = env->GetMethodID( - flutter_view_class, "setAssetBundlePathOnUI", "(Ljava/lang/String;)V"); - FXL_CHECK(method_id); - - // Invoke setAssetBundlePath on the Android UI thread. - jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); - FXL_CHECK(java_assets_directory); - - env->CallVoidMethod(local_flutter_view.obj(), method_id, - java_assets_directory); - } - - // Detaching from the VM deletes any stray local references. - fml::jni::DetachFromVM(); -} - void PlatformViewAndroid::RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture) { @@ -640,116 +271,56 @@ void PlatformViewAndroid::RegisterExternalTexture( std::make_shared(texture_id, surface_texture)); } -void PlatformViewAndroid::MarkTextureFrameAvailable(int64_t texture_id) { - blink::Threads::Gpu()->PostTask([this, texture_id]() { - std::shared_ptr texture = - static_pointer_cast( - rasterizer_->GetTextureRegistry().GetTexture(texture_id)); - if (texture) { - texture->MarkNewFrameAvailable(); - } - }); - PlatformView::MarkTextureFrameAvailable(texture_id); +// |shell::PlatformView| +std::unique_ptr PlatformViewAndroid::CreateVSyncWaiter() { + return std::make_unique(task_runners_); } -fml::jni::ScopedJavaLocalRef PlatformViewAndroid::GetBitmap( - JNIEnv* env) { - // Render the last frame to an array of pixels on the GPU thread. - // The pixels will be returned as a global JNI reference to an int array. - fxl::AutoResetWaitableEvent latch; - jobject pixels_ref = nullptr; - SkISize frame_size; - blink::Threads::Gpu()->PostTask([this, &latch, &pixels_ref, &frame_size]() { - GetBitmapGpuTask(&pixels_ref, &frame_size); - latch.Signal(); - }); - - latch.Wait(); - - // Convert the pixel array to an Android bitmap. - if (pixels_ref == nullptr) - return fml::jni::ScopedJavaLocalRef(); - - fml::jni::ScopedJavaGlobalRef pixels(env, pixels_ref); - - jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); - FXL_CHECK(bitmap_class); - - jmethodID create_bitmap = env->GetStaticMethodID( - bitmap_class, "createBitmap", - "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); - FXL_CHECK(create_bitmap); - - jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); - FXL_CHECK(bitmap_config_class); - - jmethodID bitmap_config_value_of = env->GetStaticMethodID( - bitmap_config_class, "valueOf", - "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); - FXL_CHECK(bitmap_config_value_of); - - jstring argb = env->NewStringUTF("ARGB_8888"); - FXL_CHECK(argb); - - jobject bitmap_config = env->CallStaticObjectMethod( - bitmap_config_class, bitmap_config_value_of, argb); - FXL_CHECK(bitmap_config); +// |shell::PlatformView| +std::unique_ptr PlatformViewAndroid::CreateRenderingSurface() { + return android_surface_->CreateGPUSurface(); +} - jobject bitmap = env->CallStaticObjectMethod( - bitmap_class, create_bitmap, pixels.obj(), frame_size.width(), - frame_size.height(), bitmap_config); +// |shell::PlatformView| +sk_sp PlatformViewAndroid::CreateResourceContext() const { + sk_sp resource_context; + if (android_surface_->ResourceContextMakeCurrent()) { + // TODO(chinmaygarde): Currently, this code depends on the fact that only + // the OpenGL surface will be able to make a resource context current. If + // this changes, this assumption breaks. Handle the same. + resource_context = IOManager::CreateCompatibleResourceLoadingContext( + GrBackend::kOpenGL_GrBackend); + } else { + FXL_DLOG(ERROR) << "Could not make the resource context current."; + } - return fml::jni::ScopedJavaLocalRef(env, bitmap); + return resource_context; +} + +void PlatformViewAndroid::InstallFirstFrameCallback() { + // On Platform Task Runner. + SetNextFrameCallback( + [platform_view = GetWeakPtr(), + platform_task_runner = task_runners_.GetPlatformTaskRunner()]() { + // On GPU Task Runner. + platform_task_runner->PostTask([platform_view]() { + // Back on Platform Task Runner. + if (platform_view) { + reinterpret_cast(platform_view.get()) + ->FireFirstFrameCallback(); + } + }); + }); } -void PlatformViewAndroid::GetBitmapGpuTask(jobject* pixels_out, - SkISize* size_out) { - flow::LayerTree* layer_tree = rasterizer_->GetLastLayerTree(); - if (layer_tree == nullptr) - return; - +void PlatformViewAndroid::FireFirstFrameCallback() { JNIEnv* env = fml::jni::AttachCurrentThread(); - FXL_CHECK(env); - - const SkISize& frame_size = layer_tree->frame_size(); - jsize pixels_size = frame_size.width() * frame_size.height(); - jintArray pixels_array = env->NewIntArray(pixels_size); - FXL_CHECK(pixels_array); - - jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); - FXL_CHECK(pixels); - - SkImageInfo image_info = - SkImageInfo::Make(frame_size.width(), frame_size.height(), - kRGBA_8888_SkColorType, kPremul_SkAlphaType); - - sk_sp surface = SkSurface::MakeRasterDirect( - image_info, pixels, frame_size.width() * sizeof(jint)); - - flow::CompositorContext compositor_context(nullptr); - compositor_context.SetTextureRegistry(&texture_registry_); - SkCanvas* canvas = surface->getCanvas(); - flow::CompositorContext::ScopedFrame frame = - compositor_context.AcquireFrame(nullptr, canvas, false); - - canvas->clear(SK_ColorBLACK); - layer_tree->Raster(frame); - canvas->flush(); - - // Our configuration of Skia does not support rendering to the - // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. - // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). - for (int i = 0; i < pixels_size; i++) { - uint8_t* bytes = reinterpret_cast(pixels + i); - std::swap(bytes[0], bytes[2]); + fml::jni::ScopedJavaLocalRef view = java_object_.get(env); + if (view.is_null()) { + // The Java object died. + return; } - - env->ReleaseIntArrayElements(pixels_array, pixels, 0); - - *pixels_out = env->NewGlobalRef(pixels_array); - *size_out = frame_size; - - fml::jni::DetachFromVM(); + FlutterViewOnFirstFrame(fml::jni::AttachCurrentThread(), view.obj()); } } // namespace shell diff --git a/shell/platform/android/platform_view_android.h b/shell/platform/android/platform_view_android.h index 4779ea16ab4a7..9976c443f4248 100644 --- a/shell/platform/android/platform_view_android.h +++ b/shell/platform/android/platform_view_android.h @@ -20,45 +20,23 @@ namespace shell { -class PlatformViewAndroid : public PlatformView { +class PlatformViewAndroid final : public PlatformView { public: static bool Register(JNIEnv* env); - PlatformViewAndroid(); + PlatformViewAndroid(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + fml::jni::JavaObjectWeakGlobalRef java_object, + bool use_software_rendering); ~PlatformViewAndroid() override; - virtual void Attach() override; + void NotifyCreated(fxl::RefPtr native_window); - void Detach(); + void NotifyChanged(const SkISize& size); - void SurfaceCreated(JNIEnv* env, jobject jsurface, jint backgroundColor); - - void SurfaceChanged(jint width, jint height); - - void SurfaceDestroyed(); - - void RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, - std::string snapshot_override, - std::string entrypoint, - bool reuse_isolate, - jobject assetManager); - - void RunBundleAndSource(std::string bundle_path, - std::string main, - std::string packages); - - void SetViewportMetrics(jfloat device_pixel_ratio, - jint physical_width, - jint physical_height, - jint physical_padding_top, - jint physical_padding_right, - jint physical_padding_bottom, - jint physical_padding_left, - jint physical_view_inset_top, - jint physical_view_inset_right, - jint physical_view_inset_bottom, - jint physical_view_inset_left); + // |shell::PlatformView| + void NotifyDestroyed() override; void DispatchPlatformMessage(JNIEnv* env, std::string name, @@ -70,8 +48,6 @@ class PlatformViewAndroid : public PlatformView { std::string name, jint response_id); - void DispatchPointerDataPacket(JNIEnv* env, jobject buffer, jint position); - void InvokePlatformMessageResponseCallback(JNIEnv* env, jint response_id, jobject java_response_data, @@ -86,55 +62,37 @@ class PlatformViewAndroid : public PlatformView { jobject args, jint args_position); - void SetSemanticsEnabled(jboolean enabled); - - fml::jni::ScopedJavaLocalRef GetBitmap(JNIEnv* env); - - VsyncWaiter* GetVsyncWaiter() override; - - bool ResourceContextMakeCurrent() override; - - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - void HandlePlatformMessage( - fxl::RefPtr message) override; - - void HandlePlatformMessageResponse(int response_id, - std::vector data); - - void HandlePlatformMessageEmptyResponse(int response_id); - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - void SetAssetBundlePathOnUI(std::string bundle_path); - - void SetAssetBundlePath(const std::string& assets_directory) override; - void RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture); - void MarkTextureFrameAvailable(int64_t texture_id) override; - - void set_flutter_view(const fml::jni::JavaObjectWeakGlobalRef& flutter_view) { - flutter_view_ = flutter_view; - } - private: - std::unique_ptr android_surface_; - fml::jni::JavaObjectWeakGlobalRef flutter_view_; + const fml::jni::JavaObjectWeakGlobalRef java_object_; + const std::unique_ptr android_surface_; // We use id 0 to mean that no response is expected. int next_response_id_ = 1; std::unordered_map> pending_responses_; - void UpdateThreadPriorities(); + // |shell::PlatformView| + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; + + // |shell::PlatformView| + std::unique_ptr CreateVSyncWaiter() override; + + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; + + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; - void ReleaseSurface(); + void InstallFirstFrameCallback(); - void GetBitmapGpuTask(jobject* pixels_out, SkISize* size_out); + void FireFirstFrameCallback(); FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); }; diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index c819f3bfb5e41..f75f54a896850 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -4,17 +4,26 @@ #include "flutter/shell/platform/android/platform_view_android_jni.h" +#include + +#include + +#include "flutter/assets/directory_asset_bundle.h" #include "flutter/common/settings.h" +#include "flutter/fml/file.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/jni_weak_ref.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/runtime/dart_service_isolate.h" +#include "flutter/shell/common/run_configuration.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" +#include "flutter/shell/platform/android/android_shell_holder.h" +#include "flutter/shell/platform/android/apk_asset_provider.h" +#include "flutter/shell/platform/android/flutter_main.h" #include "lib/fxl/arraysize.h" -#include "lib/fxl/logging.h" -#define PLATFORM_VIEW \ - (*reinterpret_cast*>(platform_view)) +#define ANDROID_SHELL_HOLDER \ + (reinterpret_cast(shell_holder)) namespace shell { @@ -78,14 +87,12 @@ void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj) { static jmethodID g_attach_to_gl_context_method = nullptr; void SurfaceTextureAttachToGLContext(JNIEnv* env, jobject obj, jint textureId) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_attach_to_gl_context_method, textureId); FXL_CHECK(CheckException(env)); } static jmethodID g_update_tex_image_method = nullptr; void SurfaceTextureUpdateTexImage(JNIEnv* env, jobject obj) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_update_tex_image_method); FXL_CHECK(CheckException(env)); } @@ -94,14 +101,12 @@ static jmethodID g_get_transform_matrix_method = nullptr; void SurfaceTextureGetTransformMatrix(JNIEnv* env, jobject obj, jfloatArray result) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_get_transform_matrix_method, result); FXL_CHECK(CheckException(env)); } static jmethodID g_detach_from_gl_context_method = nullptr; void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_detach_from_gl_context_method); FXL_CHECK(CheckException(env)); } @@ -109,22 +114,22 @@ void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { // Called By Java static jlong Attach(JNIEnv* env, jclass clazz, jobject flutterView) { - auto view = new PlatformViewAndroid(); - auto storage = new std::shared_ptr(view); - // Create a weak reference to the flutterView Java object so that we can make - // calls into it later. - view->Attach(); - view->set_flutter_view(fml::jni::JavaObjectWeakGlobalRef(env, flutterView)); - return reinterpret_cast(storage); + fml::jni::JavaObjectWeakGlobalRef java_object(env, flutterView); + auto shell_holder = std::make_unique( + FlutterMain::Get().GetSettings(), java_object); + if (shell_holder->IsValid()) { + return reinterpret_cast(shell_holder.release()); + } else { + return 0; + } } -static void Detach(JNIEnv* env, jobject jcaller, jlong platform_view) { - PLATFORM_VIEW->Detach(); +static void Detach(JNIEnv* env, jobject jcaller, jlong shell_holder) { + // Nothing to do. } -static void Destroy(JNIEnv* env, jobject jcaller, jlong platform_view) { - PLATFORM_VIEW->Detach(); - delete &PLATFORM_VIEW; +static void Destroy(JNIEnv* env, jobject jcaller, jlong shell_holder) { + delete ANDROID_SHELL_HOLDER; } static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { @@ -134,67 +139,180 @@ static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { static void SurfaceCreated(JNIEnv* env, jobject jcaller, - jlong platform_view, - jobject surface, + jlong shell_holder, + jobject jsurface, jint backgroundColor) { - return PLATFORM_VIEW->SurfaceCreated(env, surface, backgroundColor); + // Note: This frame ensures that any local references used by + // ANativeWindow_fromSurface are released immediately. This is needed as a + // workaround for https://code.google.com/p/android/issues/detail?id=68174 + fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); + auto window = fxl::MakeRefCounted( + ANativeWindow_fromSurface(env, jsurface)); + ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyCreated(std::move(window)); } static void SurfaceChanged(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint width, jint height) { - return PLATFORM_VIEW->SurfaceChanged(width, height); -} - -static void SurfaceDestroyed(JNIEnv* env, - jobject jcaller, - jlong platform_view) { - return PLATFORM_VIEW->SurfaceDestroyed(); -} - -static void RunBundleAndSnapshot(JNIEnv* env, - jobject jcaller, - jlong platform_view, - jstring bundlePath, - jstring snapshotOverride, - jstring entrypoint, - jboolean reuse_runtime_controller, - jobject assetManager) { - return PLATFORM_VIEW->RunBundleAndSnapshot( - env, - fml::jni::JavaStringToString(env, bundlePath), // - fml::jni::JavaStringToString(env, snapshotOverride), // - fml::jni::JavaStringToString(env, entrypoint), // - reuse_runtime_controller, // - assetManager - ); + ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyChanged( + SkISize::Make(width, height)); } -void RunBundleAndSource(JNIEnv* env, - jobject jcaller, - jlong platform_view, - jstring bundlePath, - jstring main, - jstring packages) { - return PLATFORM_VIEW->RunBundleAndSource( - fml::jni::JavaStringToString(env, bundlePath), - fml::jni::JavaStringToString(env, main), - fml::jni::JavaStringToString(env, packages)); +static void SurfaceDestroyed(JNIEnv* env, jobject jcaller, jlong shell_holder) { + ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyDestroyed(); +} + +std::unique_ptr CreateIsolateConfiguration( + const blink::AssetManager& asset_manager) { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return IsolateConfiguration::CreateForPrecompiledCode(); + } + + const auto configuration_from_blob = + [&asset_manager](const std::string& snapshot_name) + -> std::unique_ptr { + std::vector blob; + if (asset_manager.GetAsBuffer(snapshot_name, &blob)) { + return IsolateConfiguration::CreateForSnapshot( + std::make_unique(std::move(blob))); + } + return nullptr; + }; + + if (auto kernel = configuration_from_blob("kernel_blob.bin")) { + return kernel; + } + + if (auto script = configuration_from_blob("snapshot_blob.bin")) { + return script; + } + + return nullptr; +} + +static void RunBundleAndSnapshot( + JNIEnv* env, + jobject jcaller, + jlong shell_holder, + jstring jbundlepath, + jstring /* snapshot override (unused) */, + jstring jEntrypoint, + jboolean /* reuse runtime controller (unused) */, + jobject jAssetManager) { + auto asset_manager = fxl::MakeRefCounted(); + + const auto bundlepath = fml::jni::JavaStringToString(env, jbundlepath); + + if (bundlepath.size() > 0) { + // If we got a bundle path, attempt to use that as a directory asset + // bundle. + asset_manager->PushBack(std::make_unique( + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true))); + + // Use the last path component of the bundle path to determine the + // directory in the APK assets. + const auto last_slash_index = bundlepath.rfind("/", bundlepath.size()); + if (last_slash_index != std::string::npos) { + auto apk_asset_dir = bundlepath.substr( + last_slash_index + 1, bundlepath.size() - last_slash_index); + + asset_manager->PushBack(std::make_unique( + env, // jni environment + jAssetManager, // asset manager + std::move(apk_asset_dir)) // apk asset dir + ); + } + } + + auto isolate_configuration = CreateIsolateConfiguration(*asset_manager); + + if (!isolate_configuration) { + FXL_DLOG(ERROR) + << "Isolate configuration could not be determined for engine launch."; + return; + } + + RunConfiguration config(std::move(isolate_configuration), + std::move(asset_manager)); + + { + auto entrypoint = fml::jni::JavaStringToString(env, jEntrypoint); + if (entrypoint.size() > 0) { + config.SetEntrypoint(std::move(entrypoint)); + } + } + + ANDROID_SHELL_HOLDER->Launch(std::move(config)); +} + +static void RunBundleAndSource(JNIEnv* env, + jobject jcaller, + jlong shell_holder, + jstring jBundlePath, + jstring main, + jstring packages) { + auto asset_manager = fxl::MakeRefCounted(); + + const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); + + if (bundlepath.size() > 0) { + auto directory = + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); + asset_manager->PushBack( + std::make_unique(std::move(directory))); + } + + auto main_file_path = fml::jni::JavaStringToString(env, main); + auto packages_file_path = fml::jni::JavaStringToString(env, packages); + + auto config = + IsolateConfiguration::CreateForSource(main_file_path, packages_file_path); + + if (!config) { + return; + } + + RunConfiguration run_configuration(std::move(config), + std::move(asset_manager)); + + ANDROID_SHELL_HOLDER->Launch(std::move(run_configuration)); } void SetAssetBundlePathOnUI(JNIEnv* env, jobject jcaller, - jlong platform_view, - jstring bundlePath) { - return PLATFORM_VIEW->SetAssetBundlePathOnUI( - fml::jni::JavaStringToString(env, bundlePath)); + jlong shell_holder, + jstring jBundlePath) { + const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); + + if (bundlepath.size() == 0) { + return; + } + + auto directory = + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); + + if (!directory.is_valid()) { + return; + } + + std::unique_ptr directory_asset_bundle = + std::make_unique(std::move(directory)); + + if (!directory_asset_bundle->IsValid()) { + return; + } + + auto asset_manager = fxl::MakeRefCounted(); + asset_manager->PushBack(std::move(directory_asset_bundle)); + + ANDROID_SHELL_HOLDER->UpdateAssetManager(std::move(asset_manager)); } static void SetViewportMetrics(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jfloat devicePixelRatio, jint physicalWidth, jint physicalHeight, @@ -206,115 +324,194 @@ static void SetViewportMetrics(JNIEnv* env, jint physicalViewInsetRight, jint physicalViewInsetBottom, jint physicalViewInsetLeft) { - return PLATFORM_VIEW->SetViewportMetrics(devicePixelRatio, // - physicalWidth, // - physicalHeight, // - physicalPaddingTop, // - physicalPaddingRight, // - physicalPaddingBottom, // - physicalPaddingLeft, // - physicalViewInsetTop, // - physicalViewInsetRight, // - physicalViewInsetBottom, // - physicalViewInsetLeft); + const blink::ViewportMetrics metrics = { + .device_pixel_ratio = devicePixelRatio, + .physical_width = physicalWidth, + .physical_height = physicalHeight, + .physical_padding_top = physicalPaddingTop, + .physical_padding_right = physicalPaddingRight, + .physical_padding_bottom = physicalPaddingBottom, + .physical_padding_left = physicalPaddingLeft, + .physical_view_inset_top = physicalViewInsetTop, + .physical_view_inset_right = physicalViewInsetRight, + .physical_view_inset_bottom = physicalViewInsetBottom, + .physical_view_inset_left = physicalViewInsetLeft, + }; + + ANDROID_SHELL_HOLDER->SetViewportMetrics(metrics); } -static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong platform_view) { - return PLATFORM_VIEW->GetBitmap(env).Release(); +static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) { + auto screenshot = ANDROID_SHELL_HOLDER->Screenshot( + Rasterizer::ScreenshotType::UncompressedImage, false); + if (screenshot.data == nullptr) { + return nullptr; + } + + const SkISize& frame_size = screenshot.frame_size; + jsize pixels_size = frame_size.width() * frame_size.height(); + jintArray pixels_array = env->NewIntArray(pixels_size); + FXL_CHECK(pixels_array); + + jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); + FXL_CHECK(pixels); + + auto pixels_src = static_cast(screenshot.data->data()); + + // Our configuration of Skia does not support rendering to the + // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. + // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). + for (int i = 0; i < pixels_size; i++) { + int32_t src_pixel = pixels_src[i]; + uint8_t* src_bytes = reinterpret_cast(&src_pixel); + std::swap(src_bytes[0], src_bytes[2]); + pixels[i] = src_pixel; + } + + env->ReleaseIntArrayElements(pixels_array, pixels, 0); + + jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); + FXL_CHECK(bitmap_class); + + jmethodID create_bitmap = env->GetStaticMethodID( + bitmap_class, "createBitmap", + "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); + FXL_CHECK(create_bitmap); + + jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); + FXL_CHECK(bitmap_config_class); + + jmethodID bitmap_config_value_of = env->GetStaticMethodID( + bitmap_config_class, "valueOf", + "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); + FXL_CHECK(bitmap_config_value_of); + + jstring argb = env->NewStringUTF("ARGB_8888"); + FXL_CHECK(argb); + + jobject bitmap_config = env->CallStaticObjectMethod( + bitmap_config_class, bitmap_config_value_of, argb); + FXL_CHECK(bitmap_config); + + return env->CallStaticObjectMethod(bitmap_class, create_bitmap, pixels_array, + frame_size.width(), frame_size.height(), + bitmap_config); } static void DispatchPlatformMessage(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jstring channel, jobject message, jint position, jint responseId) { - return PLATFORM_VIEW->DispatchPlatformMessage( - env, fml::jni::JavaStringToString(env, channel), message, position, - responseId); + ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPlatformMessage( + env, // + fml::jni::JavaStringToString(env, channel), // + message, // + position, // + responseId // + ); } static void DispatchEmptyPlatformMessage(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jstring channel, jint responseId) { - return PLATFORM_VIEW->DispatchEmptyPlatformMessage( - env, fml::jni::JavaStringToString(env, channel), responseId); + ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchEmptyPlatformMessage( + env, // + fml::jni::JavaStringToString(env, channel), // + responseId // + ); } static void DispatchPointerDataPacket(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jobject buffer, jint position) { - return PLATFORM_VIEW->DispatchPointerDataPacket(env, buffer, position); + uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); + auto packet = std::make_unique(data, position); + ANDROID_SHELL_HOLDER->DispatchPointerDataPacket(std::move(packet)); } static void DispatchSemanticsAction(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint id, jint action, jobject args, jint args_position) { - return PLATFORM_VIEW->DispatchSemanticsAction(env, id, action, args, - args_position); + ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchSemanticsAction( + env, // + id, // + action, // + args, // + args_position // + ); } static void SetSemanticsEnabled(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jboolean enabled) { - return PLATFORM_VIEW->SetSemanticsEnabled(enabled); + ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled); } static jboolean GetIsSoftwareRendering(JNIEnv* env, jobject jcaller) { - return blink::Settings::Get().enable_software_rendering; + return FlutterMain::Get().GetSettings().enable_software_rendering; } static void RegisterTexture(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jlong texture_id, jobject surface_texture) { - PLATFORM_VIEW->RegisterExternalTexture( - static_cast(texture_id), - fml::jni::JavaObjectWeakGlobalRef(env, surface_texture)); + ANDROID_SHELL_HOLDER->GetPlatformView()->RegisterExternalTexture( + static_cast(texture_id), // + fml::jni::JavaObjectWeakGlobalRef(env, surface_texture) // + ); } static void MarkTextureFrameAvailable(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jlong texture_id) { - return PLATFORM_VIEW->MarkTextureFrameAvailable( + ANDROID_SHELL_HOLDER->GetPlatformView()->MarkTextureFrameAvailable( static_cast(texture_id)); } static void UnregisterTexture(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jlong texture_id) { - PLATFORM_VIEW->UnregisterTexture(static_cast(texture_id)); + ANDROID_SHELL_HOLDER->GetPlatformView()->UnregisterTexture( + static_cast(texture_id)); } static void InvokePlatformMessageResponseCallback(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint responseId, jobject message, jint position) { - return PLATFORM_VIEW->InvokePlatformMessageResponseCallback( - env, responseId, message, position); + ANDROID_SHELL_HOLDER->GetPlatformView() + ->InvokePlatformMessageResponseCallback(env, // + responseId, // + message, // + position // + ); } static void InvokePlatformMessageEmptyResponseCallback(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint responseId) { - return PLATFORM_VIEW->InvokePlatformMessageEmptyResponseCallback(env, - responseId); + ANDROID_SHELL_HOLDER->GetPlatformView() + ->InvokePlatformMessageEmptyResponseCallback(env, // + responseId // + ); } bool PlatformViewAndroid::Register(JNIEnv* env) { @@ -353,8 +550,8 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { }, { .name = "nativeRunBundleAndSnapshot", - .signature = - "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLandroid/content/res/AssetManager;)V", + .signature = "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/" + "String;ZLandroid/content/res/AssetManager;)V", .fnPtr = reinterpret_cast(&shell::RunBundleAndSnapshot), }, { @@ -373,11 +570,6 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { .signature = "(J)V", .fnPtr = reinterpret_cast(&shell::Detach), }, - { - .name = "nativeDestroy", - .signature = "(J)V", - .fnPtr = reinterpret_cast(&shell::Destroy), - }, { .name = "nativeGetObservatoryUri", .signature = "()Ljava/lang/String;", diff --git a/shell/platform/android/vsync_waiter_android.cc b/shell/platform/android/vsync_waiter_android.cc index 29e1958dcc011..052de023b9a12 100644 --- a/shell/platform/android/vsync_waiter_android.cc +++ b/shell/platform/android/vsync_waiter_android.cc @@ -7,7 +7,7 @@ #include #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" @@ -16,68 +16,49 @@ namespace shell { +static jlong CreatePendingCallback(VsyncWaiter::Callback callback); + +static void ConsumePendingCallback(jlong java_baton, + fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time); + static fml::jni::ScopedJavaGlobalRef* g_vsync_waiter_class = nullptr; static jmethodID g_async_wait_for_vsync_method_ = nullptr; -VsyncWaiterAndroid::VsyncWaiterAndroid() : weak_factory_(this) {} +VsyncWaiterAndroid::VsyncWaiterAndroid(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)) {} VsyncWaiterAndroid::~VsyncWaiterAndroid() = default; -void VsyncWaiterAndroid::AsyncWaitForVsync(Callback callback) { - FXL_DCHECK(!callback_); - callback_ = std::move(callback); - fml::WeakPtr* weak = - new fml::WeakPtr(); - *weak = weak_factory_.GetWeakPtr(); +// |shell::VsyncWaiter| +void VsyncWaiterAndroid::AwaitVSync() { + auto java_baton = + CreatePendingCallback(std::bind(&VsyncWaiterAndroid::FireCallback, // + this, // + std::placeholders::_1, // + std::placeholders::_2 // + )); - blink::Threads::Platform()->PostTask([weak] { + task_runners_.GetPlatformTaskRunner()->PostTask([java_baton]() { JNIEnv* env = fml::jni::AttachCurrentThread(); - env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), - g_async_wait_for_vsync_method_, - reinterpret_cast(weak)); + env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), // + g_async_wait_for_vsync_method_, // + java_baton // + ); }); } -void VsyncWaiterAndroid::OnVsync(int64_t frameTimeNanos, - int64_t frameTargetTimeNanos) { - Callback callback = std::move(callback_); - callback_ = Callback(); - blink::Threads::UI()->PostTask( - [callback, frameTimeNanos, frameTargetTimeNanos] { - callback(fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTimeNanos)), - fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos))); - }); -} - static void OnNativeVsync(JNIEnv* env, jclass jcaller, jlong frameTimeNanos, jlong frameTargetTimeNanos, - jlong cookie) { - // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight - // Vsync" checkbox in the timeline can be enabled. - // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 - // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); -#else - { - constexpr size_t num_chars = sizeof(jlong) * CHAR_BIT * 3.4 + 2; - char deadline[num_chars]; - sprintf(deadline, "%lld", frameTargetTimeNanos / 1000); // microseconds - TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); - } -#endif - fml::WeakPtr* weak = - reinterpret_cast*>(cookie); - VsyncWaiterAndroid* waiter = weak->get(); - delete weak; - if (waiter) { - waiter->OnVsync(static_cast(frameTimeNanos), - static_cast(frameTargetTimeNanos)); - } + jlong java_baton) { + auto frame_time = fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTimeNanos)); + auto target_time = fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos)); + + ConsumePendingCallback(java_baton, frame_time, target_time); } bool VsyncWaiterAndroid::Register(JNIEnv* env) { @@ -105,4 +86,27 @@ bool VsyncWaiterAndroid::Register(JNIEnv* env) { return env->RegisterNatives(clazz, methods, arraysize(methods)) == 0; } +struct PendingCallbackData { + VsyncWaiter::Callback callback; + + PendingCallbackData(VsyncWaiter::Callback p_callback) + : callback(std::move(p_callback)) { + FXL_DCHECK(callback); + } +}; + +static jlong CreatePendingCallback(VsyncWaiter::Callback callback) { + // This delete for this new is balanced in the consume call. + auto data = new PendingCallbackData(std::move(callback)); + return reinterpret_cast(data); +} + +static void ConsumePendingCallback(jlong java_baton, + fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { + auto data = reinterpret_cast(java_baton); + data->callback(frame_start_time, frame_target_time); + delete data; +} + } // namespace shell diff --git a/shell/platform/android/vsync_waiter_android.h b/shell/platform/android/vsync_waiter_android.h index c73af4bfca6f0..fd72a0a21f563 100644 --- a/shell/platform/android/vsync_waiter_android.h +++ b/shell/platform/android/vsync_waiter_android.h @@ -12,22 +12,17 @@ namespace shell { -class VsyncWaiterAndroid : public VsyncWaiter { +class VsyncWaiterAndroid final : public VsyncWaiter { public: - VsyncWaiterAndroid(); - - ~VsyncWaiterAndroid() override; - static bool Register(JNIEnv* env); - void AsyncWaitForVsync(Callback callback) override; + VsyncWaiterAndroid(blink::TaskRunners task_runners); - void OnVsync(int64_t frameTimeNanos, int64_t frameTargetTimeNanos); + ~VsyncWaiterAndroid() override; private: - Callback callback_; - fml::WeakPtr self_; - fml::WeakPtrFactory weak_factory_; + // |shell::VsyncWaiter| + void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterAndroid); }; diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index c971c443bcc30..c6f7acd6be76a 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -6,11 +6,8 @@ assert(is_mac || is_ios) group("darwin") { if (is_mac) { - deps = [ - "desktop:shell_standalone", - ] if (!is_fuchsia_host) { - deps += [ + deps = [ "desktop:shell_application_bundle", ] } @@ -45,15 +42,12 @@ source_set("flutter_channels") { "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", - "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", "//third_party/skia", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } executable("flutter_channels_unittests") { @@ -68,7 +62,7 @@ executable("flutter_channels_unittests") { deps = [ ":flutter_channels", - "//third_party/dart/runtime:libdart_jit", "$flutter_root/testing", + "//third_party/dart/runtime:libdart_jit", ] } diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index e6fa86366b080..a1023737973a7 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -9,28 +9,23 @@ source_set("common") { sources = [ "buffer_conversions.h", "buffer_conversions.mm", - "platform_mac.h", - "platform_mac.mm", - "process_info_mac.cc", - "process_info_mac.h", + "command_line.h", + "command_line.mm", ] set_sources_assignment_filter(sources_assignment_filter) deps = [ - "//third_party/dart/runtime:dart_api", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", - "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:dart_api", "//third_party/skia", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } diff --git a/shell/platform/darwin/common/command_line.h b/shell/platform/darwin/common/command_line.h new file mode 100644 index 0000000000000..dfc995b90f378 --- /dev/null +++ b/shell/platform/darwin/common/command_line.h @@ -0,0 +1,17 @@ +// Copyright 2017 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_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ + +#include "lib/fxl/command_line.h" +#include "lib/fxl/macros.h" + +namespace shell { + +fxl::CommandLine CommandLineFromNSProcessInfo(); + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ diff --git a/shell/platform/darwin/common/command_line.mm b/shell/platform/darwin/common/command_line.mm new file mode 100644 index 0000000000000..bf8d4cc9d40f4 --- /dev/null +++ b/shell/platform/darwin/common/command_line.mm @@ -0,0 +1,21 @@ +// Copyright 2017 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/shell/platform/darwin/common/command_line.h" + +#import + +namespace shell { + +fxl::CommandLine CommandLineFromNSProcessInfo() { + std::vector args_vector; + + for (NSString* arg in [NSProcessInfo processInfo].arguments) { + args_vector.emplace_back(arg.UTF8String); + } + + return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); +} + +} // namespace shell diff --git a/shell/platform/darwin/common/platform_mac.h b/shell/platform/darwin/common/platform_mac.h deleted file mode 100644 index 1989b25f11c43..0000000000000 --- a/shell/platform/darwin/common/platform_mac.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ -#define SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ - -#include "flutter/shell/common/engine.h" - -namespace shell { - -void PlatformMacMain(std::string icu_data_path, - std::string application_library_path, - std::string bundle_path); - -bool AttemptLaunchFromCommandLineSwitches(Engine* engine); - -} // namespace shell - -#endif // SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ diff --git a/shell/platform/darwin/common/platform_mac.mm b/shell/platform/darwin/common/platform_mac.mm deleted file mode 100644 index 5af35a430beef..0000000000000 --- a/shell/platform/darwin/common/platform_mac.mm +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/platform/darwin/common/platform_mac.h" - -#include - -#include "flutter/common/threads.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/start_up.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/common/tracing_controller.h" -#include "flutter/sky/engine/wtf/MakeUnique.h" -#include "lib/fxl/command_line.h" -#include "lib/fxl/strings/string_view.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace shell { - -static fxl::CommandLine InitializedCommandLine() { - std::vector args_vector; - - for (NSString* arg in [NSProcessInfo processInfo].arguments) { - args_vector.emplace_back(arg.UTF8String); - } - - return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); -} - -class EmbedderState { - public: - EmbedderState(std::string icu_data_path, - std::string application_library_path, - std::string bundle_path) { - blink::engine_main_enter_ts = Dart_TimelineGetMicros(); - FXL_DCHECK([NSThread isMainThread]) - << "Embedder initialization must occur on the main platform thread"; - - auto command_line = InitializedCommandLine(); - - // This is about as early as tracing of any kind can start. Add an instant - // marker that can be used as a reference for startup. - TRACE_EVENT_INSTANT0("flutter", "main"); - - shell::Shell::InitStandalone(std::move(command_line), icu_data_path, application_library_path, - bundle_path); - } - - ~EmbedderState() {} - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderState); -}; - -void PlatformMacMain(std::string icu_data_path, - std::string application_library_path, - std::string bundle_path) { - static std::unique_ptr g_embedder; - static std::once_flag once_main; - - std::call_once(once_main, [&]() { - g_embedder = - WTF::MakeUnique(icu_data_path, application_library_path, bundle_path); - }); -} - -static bool FlagsValidForCommandLineLaunch(const std::string& bundle_path, - const std::string& main, - const std::string& packages) { - if (main.empty() || packages.empty() || bundle_path.empty()) { - return false; - } - - // Ensure that the paths exists. This catches cases where the user has - // successfully launched the application from the tooling but has since moved - // the source files on disk and is launching again directly. - - NSFileManager* manager = [NSFileManager defaultManager]; - - if (![manager fileExistsAtPath:@(main.c_str())]) { - return false; - } - - if (![manager fileExistsAtPath:@(packages.c_str())]) { - return false; - } - - if (![manager fileExistsAtPath:@(bundle_path.c_str())]) { - return false; - } - - return true; -} - -static std::string ResolveCommandLineLaunchFlag(const fxl::StringView name) { - const auto& command_line = shell::Shell::Shared().GetCommandLine(); - - std::string command_line_option; - if (command_line.GetOptionValue(name, &command_line_option)) { - return command_line_option; - } - - const char* saved_default = - [[NSUserDefaults standardUserDefaults] stringForKey:@(name.data())].UTF8String; - - if (saved_default != NULL) { - return saved_default; - } - - return ""; -} - -bool AttemptLaunchFromCommandLineSwitches(Engine* engine) { - NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - - const auto& command_line = shell::Shell::Shared().GetCommandLine(); - - if (command_line.HasOption(FlagForSwitch(Switch::FlutterAssetsDir)) || - command_line.HasOption(FlagForSwitch(Switch::MainDartFile)) || - command_line.HasOption(FlagForSwitch(Switch::Packages))) { - // The main dart file, Flutter assets directory and the package root must be - // specified in one go. We dont want to end up in a situation where we take - // one value from the command line and the others from user defaults. In - // case, any new flags are specified, forget about all the old ones. - [defaults removeObjectForKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; - [defaults removeObjectForKey:@(FlagForSwitch(Switch::MainDartFile).data())]; - [defaults removeObjectForKey:@(FlagForSwitch(Switch::Packages).data())]; - - [defaults synchronize]; - } - - std::string bundle_path = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::FlutterAssetsDir)); - std::string main = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::MainDartFile)); - std::string packages = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::Packages)); - - if (!FlagsValidForCommandLineLaunch(bundle_path, main, packages)) { - return false; - } - - // Save the newly resolved dart main file and the package root to user - // defaults so that the next time the user launches the application in the - // simulator without the tooling, the application boots up. - [defaults setObject:@(bundle_path.c_str()) - forKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; - [defaults setObject:@(main.c_str()) forKey:@(FlagForSwitch(Switch::MainDartFile).data())]; - [defaults setObject:@(packages.c_str()) forKey:@(FlagForSwitch(Switch::Packages).data())]; - - [defaults synchronize]; - - blink::Threads::UI()->PostTask([ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { - if (engine) - engine->RunBundleAndSource(bundle_path, main, packages); - }); - - return true; -} - -} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.cc b/shell/platform/darwin/common/process_info_mac.cc deleted file mode 100644 index 11f70f305a3e9..0000000000000 --- a/shell/platform/darwin/common/process_info_mac.cc +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/platform/darwin/common/process_info_mac.h" - -namespace shell { - -ProcessInfoMac::ProcessInfoMac() = default; - -ProcessInfoMac::~ProcessInfoMac() = default; - -bool ProcessInfoMac::SampleNow() { - mach_msg_type_number_t size = MACH_TASK_BASIC_INFO_COUNT; - kern_return_t result = - task_info(mach_task_self(), // - MACH_TASK_BASIC_INFO, // - reinterpret_cast(&last_sample_), // - &size); - if (result == KERN_SUCCESS) { - return true; - } - - last_sample_ = {}; - return false; -} - -size_t ProcessInfoMac::GetVirtualMemorySize() { - return last_sample_.virtual_size; -} - -size_t ProcessInfoMac::GetResidentMemorySize() { - return last_sample_.resident_size; -} - -} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.h b/shell/platform/darwin/common/process_info_mac.h deleted file mode 100644 index 7edc8034173e0..0000000000000 --- a/shell/platform/darwin/common/process_info_mac.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ - -#include -#include -#include -#include "flutter/flow/process_info.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class ProcessInfoMac : public flow::ProcessInfo { - public: - ProcessInfoMac(); - - ~ProcessInfoMac(); - - bool SampleNow() override; - - size_t GetVirtualMemorySize() override; - - size_t GetResidentMemorySize() override; - - private: - struct mach_task_basic_info last_sample_; - - FXL_DISALLOW_COPY_AND_ASSIGN(ProcessInfoMac); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ diff --git a/shell/platform/darwin/desktop/BUILD.gn b/shell/platform/darwin/desktop/BUILD.gn index a9c05f85ef284..5ec3298be4aa4 100644 --- a/shell/platform/darwin/desktop/BUILD.gn +++ b/shell/platform/darwin/desktop/BUILD.gn @@ -8,10 +8,8 @@ source_set("mac_desktop_platform") { visibility = [ ":*" ] sources = [ - "flutter_app_delegate.h", - "flutter_app_delegate.m", - "flutter_application.h", - "flutter_application.mm", + "flutter_application_delegate.h", + "flutter_application_delegate.mm", "flutter_window.h", "flutter_window.mm", "main_mac.mm", @@ -22,32 +20,22 @@ source_set("mac_desktop_platform") { ] deps = [ - "//third_party/dart/runtime:libdart_jit", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", - "$flutter_root/shell/testing", "$flutter_root/synchronization", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", "//third_party/skia", + "//third_party/skia:gpu", ] - public_configs = [ - "$flutter_root:config", - ] -} - -executable("shell_standalone") { - output_name = "flutter_tester" - deps = [ - ":mac_desktop_platform", - ] + public_configs = [ "$flutter_root:config" ] } if (!is_fuchsia_host) { - import("//build/config/mac/rules.gni") resource_copy_mac("mac_desktop_resources") { diff --git a/shell/platform/darwin/desktop/Info.plist b/shell/platform/darwin/desktop/Info.plist index 31d3f1240db6b..048afb6dadca2 100644 --- a/shell/platform/darwin/desktop/Info.plist +++ b/shell/platform/darwin/desktop/Info.plist @@ -9,11 +9,11 @@ CFBundleIconFile CFBundleIdentifier - io.flutter + io.flutter.engine CFBundleInfoDictionaryVersion 6.0 CFBundleName - Flutter + Flutter Engine CFBundlePackageType APPL CFBundleShortVersionString @@ -26,9 +26,7 @@ 10.6 NSHumanReadableCopyright Copyright 2015 The Flutter Authors. All rights reserved. - NSMainNibFile - flutter_mac NSPrincipalClass - FlutterApplication + NSApplication diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.h b/shell/platform/darwin/desktop/flutter_app_delegate.h deleted file mode 100644 index d6addcb17d0a4..0000000000000 --- a/shell/platform/darwin/desktop/flutter_app_delegate.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 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. - -#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ -#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ - -#import - -@interface FlutterAppDelegate : NSObject - -@end - -#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__) */ diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.m b/shell/platform/darwin/desktop/flutter_app_delegate.m deleted file mode 100644 index 7e2dfd68389f8..0000000000000 --- a/shell/platform/darwin/desktop/flutter_app_delegate.m +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2015 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 "flutter_app_delegate.h" - -@interface FlutterAppDelegate () - -@property(assign) IBOutlet NSWindow* window; - -@end - -@implementation FlutterAppDelegate - -@end diff --git a/shell/platform/darwin/desktop/flutter_application.mm b/shell/platform/darwin/desktop/flutter_application.mm deleted file mode 100644 index 57b1c83ba069a..0000000000000 --- a/shell/platform/darwin/desktop/flutter_application.mm +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/platform/darwin/desktop/flutter_application.h" - -@implementation FlutterApplication -@end diff --git a/shell/platform/darwin/desktop/flutter_application.h b/shell/platform/darwin/desktop/flutter_application_delegate.h similarity index 65% rename from shell/platform/darwin/desktop/flutter_application.h rename to shell/platform/darwin/desktop/flutter_application_delegate.h index 6a4167b5f273a..3995557b25e79 100644 --- a/shell/platform/darwin/desktop/flutter_application.h +++ b/shell/platform/darwin/desktop/flutter_application_delegate.h @@ -1,13 +1,14 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. +// Copyright 2017 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_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ +#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ #import -@interface FlutterApplication : NSApplication +@interface FlutterApplicationDelegate : NSObject + @end -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ diff --git a/shell/platform/darwin/desktop/flutter_application_delegate.mm b/shell/platform/darwin/desktop/flutter_application_delegate.mm new file mode 100644 index 0000000000000..03076b848b25f --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_application_delegate.mm @@ -0,0 +1,80 @@ +// Copyright 2017 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/shell/platform/darwin/desktop/flutter_application_delegate.h" +#include "flutter/shell/platform/darwin/desktop/flutter_window.h" + +#include + +@implementation FlutterApplicationDelegate + +- (void)applicationWillFinishLaunching:(NSNotification*)notification { + [self configureMainMenuBar]; + [self onNewFlutterWindow:self]; +} + +- (void)configureMainMenuBar { + NSMenu* mainMenu = [[[NSMenu alloc] initWithTitle:@"MainMenu"] autorelease]; + + NSMenuItem* engineItem = + [[[NSMenuItem alloc] initWithTitle:@"Engine" action:NULL keyEquivalent:@""] autorelease]; + + NSMenu* engineMenu = [[[NSMenu alloc] initWithTitle:@"EngineMenu"] autorelease]; + + NSMenuItem* newEngineItem = [[[NSMenuItem alloc] initWithTitle:@"New Engine" + action:@selector(onNewFlutterWindow:) + keyEquivalent:@""] autorelease]; + newEngineItem.keyEquivalent = @"n"; + newEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; + + NSMenuItem* shutdownEngineItem = + [[[NSMenuItem alloc] initWithTitle:@"Shutdown Engine" + action:@selector(onShutdownFlutterWindow:) + keyEquivalent:@""] autorelease]; + shutdownEngineItem.keyEquivalent = @"w"; + shutdownEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; + + NSMenuItem* quitItem = [[[NSMenuItem alloc] initWithTitle:@"Quit" + action:@selector(onQuitFlutterApplication:) + keyEquivalent:@""] autorelease]; + quitItem.keyEquivalent = @"q"; + quitItem.keyEquivalentModifierMask = NSCommandKeyMask; + + [mainMenu addItem:engineItem]; + [engineItem setSubmenu:engineMenu]; + [engineMenu addItem:newEngineItem]; + [engineMenu addItem:shutdownEngineItem]; + [engineMenu addItem:quitItem]; + + [NSApplication sharedApplication].mainMenu = mainMenu; +} + +- (void)onNewFlutterWindow:(id)sender { + FlutterWindow* window = [[FlutterWindow alloc] init]; + [window setReleasedWhenClosed:YES]; + + NSWindow* currentKeyWindow = [NSApplication sharedApplication].keyWindow; + + if (currentKeyWindow == nil) { + [window center]; + } else { + [window center]; + NSPoint currentWindowFrameOrigin = window.frame.origin; + currentWindowFrameOrigin.x = currentKeyWindow.frame.origin.x + 20; + currentWindowFrameOrigin.y = currentKeyWindow.frame.origin.y - 20; + [window setFrameOrigin:currentWindowFrameOrigin]; + } + + [window makeKeyAndOrderFront:sender]; +} + +- (void)onShutdownFlutterWindow:(id)sender { + [[NSApplication sharedApplication].keyWindow close]; +} + +- (void)onQuitFlutterApplication:(id)sender { + exit(0); +} + +@end diff --git a/shell/platform/darwin/desktop/flutter_mac.xib b/shell/platform/darwin/desktop/flutter_mac.xib deleted file mode 100644 index c02ab7912da5a..0000000000000 --- a/shell/platform/darwin/desktop/flutter_mac.xib +++ /dev/null @@ -1,695 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/shell/platform/darwin/desktop/flutter_window.h b/shell/platform/darwin/desktop/flutter_window.h index 851535ba38e9e..e07fe4eeb7520 100644 --- a/shell/platform/darwin/desktop/flutter_window.h +++ b/shell/platform/darwin/desktop/flutter_window.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ -#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ +#ifndef SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ +#define SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ #import @@ -11,4 +11,4 @@ @end -#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__) */ +#endif // SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ diff --git a/shell/platform/darwin/desktop/flutter_window.mm b/shell/platform/darwin/desktop/flutter_window.mm index ca080e9275742..4c87200fb3856 100644 --- a/shell/platform/darwin/desktop/flutter_window.mm +++ b/shell/platform/darwin/desktop/flutter_window.mm @@ -2,16 +2,25 @@ // 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 + #import "flutter_window.h" -#include "flutter/common/threads.h" +#include + +#include "flutter/common/task_runners.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/thread_host.h" #include "flutter/shell/gpu/gpu_surface_gl.h" +#include "flutter/shell/platform/darwin/common/command_line.h" #include "flutter/shell/platform/darwin/desktop/platform_view_mac.h" +#include "lib/fxl/functional/make_copyable.h" -@interface FlutterWindow () +@interface FlutterWindow () -@property(assign) IBOutlet NSOpenGLView* renderSurface; -@property(getter=isSurfaceSetup) BOOL surfaceSetup; +@property(strong) NSOpenGLView* renderSurface; @end @@ -37,34 +46,130 @@ @interface FlutterWindow () } @implementation FlutterWindow { - std::shared_ptr _platformView; + shell::ThreadHost _thread_host; + std::unique_ptr _shell; bool _mouseIsDown; } -@synthesize renderSurface = _renderSurface; -@synthesize surfaceSetup = _surfaceSetup; +- (instancetype)init { + self = + [super initWithContentRect:NSMakeRect(10.0, 10.0, 800.0, 600.0) + styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask + backing:NSBackingStoreBuffered + defer:YES]; + if (self) { + self.delegate = self; + [self setupRenderSurface]; + [self setupShell]; + [self updateWindowSize]; + } + + return self; +} + +- (void)setupRenderSurface { + NSOpenGLView* renderSurface = [[[NSOpenGLView alloc] init] autorelease]; + const NSOpenGLPixelFormatAttribute attrs[] = { + NSOpenGLPFADoubleBuffer, // + NSOpenGLPFAAllowOfflineRenderers, // + 0 // + }; + renderSurface.pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease]; + renderSurface.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + renderSurface.frame = + NSMakeRect(0.0, 0.0, self.contentView.bounds.size.width, self.contentView.bounds.size.height); + [self.contentView addSubview:renderSurface]; + self.renderSurface = renderSurface; +} -- (void)awakeFromNib { - [super awakeFromNib]; +static std::string CreateThreadLabel() { + std::stringstream stream; + static int index = 1; + stream << "io.flutter." << index++; + return stream.str(); +} - self.delegate = self; +- (void)setupShell { + FXL_DCHECK(!_shell) << "The shell must not already be set."; - [self updateWindowSize]; + auto thread_label = CreateThreadLabel(); + + // Create the threads on which to run the shell. + _thread_host = {thread_label, shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::UI | + shell::ThreadHost::Type::IO}; + + // Grab the task runners for the newly created threads. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::TaskRunners task_runners(thread_label, // label + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + _thread_host.gpu_thread->GetTaskRunner(), // GPU + _thread_host.ui_thread->GetTaskRunner(), // UI + _thread_host.io_thread->GetTaskRunner() // IO + ); + + // Figure out the settings from the command line arguments. + auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); + + if (settings.icu_data_path.size() == 0) { + settings.icu_data_path = + [[NSBundle mainBundle] pathForResource:@"icudtl.dat" ofType:@""].UTF8String; + } + + settings.using_blink = false; + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + // Setup the callback that will be run on the appropriate threads. + shell::Shell::CreateCallback on_create_platform_view = + [render_surface = self.renderSurface](shell::Shell& shell) { + return std::make_unique(shell, render_surface); + }; + + shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // Finally, create the shell. + _shell = shell::Shell::Create(std::move(task_runners), settings, on_create_platform_view, + on_create_rasterizer); + + // Launch the engine with the inferred run configuration. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = _shell->GetEngine(), + config = shell::RunConfiguration::InferFromSettings(_shell->GetSettings())]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch the engine with configuration."; + } + } + })); + + [self notifySurfaceCreated]; } -- (void)setupPlatformView { - FXL_DCHECK(_platformView == nullptr) << "The platform view must not already be set."; +- (void)notifySurfaceCreated { + if (!_shell || !_shell->IsSetup()) { + return; + } - _platformView = std::make_shared(self.renderSurface); - _platformView->Attach(); - _platformView->SetupResourceContextOnIOThread(); - _platformView->NotifyCreated(std::make_unique(_platformView.get())); + // Tell the platform view that it has a GL surface. + _shell->GetPlatformView()->NotifyCreated(); } -// TODO(eseidel): This does not belong in flutter_window! -// Probably belongs in NSApplicationDelegate didFinishLaunching. -- (void)setupAndLoadDart { - _platformView->SetupAndLoadDart(); +- (void)notifySurfaceDestroyed { + if (!_shell || !_shell->IsSetup()) { + return; + } + + // Tell the platform view that its surface is about to be lost. + _shell->GetPlatformView()->NotifyDestroyed(); } - (void)windowDidResize:(NSNotification*)notification { @@ -72,34 +177,28 @@ - (void)windowDidResize:(NSNotification*)notification { } - (void)updateWindowSize { - [self setupSurfaceIfNecessary]; + if (!_shell) { + return; + } blink::ViewportMetrics metrics; auto size = self.renderSurface.frame.size; metrics.physical_width = size.width; metrics.physical_height = size.height; - - blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), metrics ] { - if (engine.get()) { + _shell->GetTaskRunners().GetUITaskRunner()->PostTask([engine = _shell->GetEngine(), metrics]() { + if (engine) { engine->SetViewportMetrics(metrics); } }); } -- (void)setupSurfaceIfNecessary { - if (self.isSurfaceSetup) { - return; - } - - self.surfaceSetup = YES; - - [self setupPlatformView]; - [self setupAndLoadDart]; -} - #pragma mark - Responder overrides - (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { + if (!_shell) { + return; + } + NSPoint location = [_renderSurface convertPoint:event.locationInWindow fromView:nil]; location.y = _renderSurface.frame.size.height - location.y; @@ -134,13 +233,14 @@ - (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { break; } - blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), pointer_data ] { - if (engine.get()) { - blink::PointerDataPacket packet(1); - packet.SetPointerData(0, pointer_data); - engine->DispatchPointerDataPacket(packet); - } - }); + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = _shell->GetEngine(), pointer_data] { + if (engine) { + blink::PointerDataPacket packet(1); + packet.SetPointerData(0, pointer_data); + engine->DispatchPointerDataPacket(packet); + } + }); } - (void)mouseDown:(NSEvent*)event { @@ -155,11 +255,18 @@ - (void)mouseUp:(NSEvent*)event { [self dispatchEvent:event phase:NSEventPhaseEnded]; } -- (void)dealloc { - if (_platformView) { - _platformView->NotifyDestroyed(); - } +- (void)reset { + [self notifySurfaceDestroyed]; + _shell.reset(); + _thread_host.Reset(); +} +- (void)windowWillClose:(NSNotification*)notification { + [self reset]; +} + +- (void)dealloc { + [self reset]; [super dealloc]; } diff --git a/shell/platform/darwin/desktop/main_mac.mm b/shell/platform/darwin/desktop/main_mac.mm index 808a5f63f1d14..edd08d0c8b783 100644 --- a/shell/platform/darwin/desktop/main_mac.mm +++ b/shell/platform/darwin/desktop/main_mac.mm @@ -7,91 +7,20 @@ #include #include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/desktop/flutter_application.h" -#include "flutter/shell/testing/test_runner.h" -#include "flutter/shell/testing/testing.h" +#include "flutter/shell/platform/darwin/desktop/flutter_application_delegate.h" #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" -#include "lib/tonic/dart_microtask_queue.h" -// Exit codes used by the Dart command line tool. -const int kApiErrorExitCode = 253; -const int kCompilationErrorExitCode = 254; -const int kErrorExitCode = 255; - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver : public fml::TaskObserver { - public: - ScriptCompletionTaskObserver(fxl::RefPtr task_runner) - : main_task_runner_(std::move(task_runner)), - prev_live_(false), - last_error_(tonic::kNoError) {} - - void DidProcessTask() override { - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - shell::Engine& engine = test_runner.platform_view().engine(); - - if (engine.GetLoadScriptError() != tonic::kNoError) { - last_error_ = engine.GetLoadScriptError(); - main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); - return; - } - - bool live = engine.UIIsolateHasLivePorts(); - if (prev_live_ && !live) { - last_error_ = engine.GetUIIsolateLastError(); - main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - prev_live_ = live; - } - - tonic::DartErrorHandleType last_error() { return last_error_; } - - private: - fxl::RefPtr main_task_runner_; - bool prev_live_; - tonic::DartErrorHandleType last_error_; -}; - -int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { - switch (error) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } -} - -static fxl::CommandLine InitializedCommandLine() { +int main(int argc, const char* argv[]) { std::vector args_vector; for (NSString* arg in [NSProcessInfo processInfo].arguments) { args_vector.emplace_back(arg.UTF8String); } - return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); -} - -int main(int argc, const char* argv[]) { - [FlutterApplication sharedApplication]; - - // Can't use shell::Shell::Shared().GetCommandLine() because it is initialized only - // in shell::PlatformMacMain call below. - auto command_line = InitializedCommandLine(); - - std::string bundle_path = ""; - command_line.GetOptionValue(FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); - - shell::PlatformMacMain("", "", bundle_path); + auto command_line = fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); // Print help. if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { @@ -99,36 +28,7 @@ int main(int argc, const char* argv[]) { return EXIT_SUCCESS; } - // Decide between interactive and non-interactive modes. - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::NonInteractive))) { - if (!shell::InitForTesting(std::move(command_line))) - return 1; - - // Note that this task observer must be added after the observer that drains - // the microtask queue. - ScriptCompletionTaskObserver task_observer(fml::MessageLoop::GetCurrent().GetTaskRunner()); - blink::Threads::UI()->PostTask( - [&task_observer] { fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); }); - - fml::MessageLoop::GetCurrent().Run(); - - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - tonic::DartErrorHandleType error = test_runner.platform_view().engine().GetLoadScriptError(); - if (error == tonic::kNoError) - error = task_observer.last_error(); - if (error == tonic::kNoError) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&error, &latch] { - error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); - latch.Signal(); - }); - latch.Wait(); - } - - // The script has completed and the engine may not be in a clean state, - // so just stop the process. - exit(ConvertErrorTypeToExitCode(error)); - } else { - return NSApplicationMain(argc, argv); - } + [NSApplication sharedApplication].delegate = + [[[FlutterApplicationDelegate alloc] init] autorelease]; + return NSApplicationMain(argc, argv); } diff --git a/shell/platform/darwin/desktop/platform_view_mac.h b/shell/platform/darwin/desktop/platform_view_mac.h index 501400b6803d4..d4b19b94d1d99 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.h +++ b/shell/platform/darwin/desktop/platform_view_mac.h @@ -7,6 +7,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "lib/fxl/memory/weak_ptr.h" @@ -15,15 +16,13 @@ namespace shell { -class PlatformViewMac : public PlatformView, public GPUSurfaceGLDelegate { +class PlatformViewMac final : public PlatformView, public GPUSurfaceGLDelegate { public: - PlatformViewMac(NSOpenGLView* gl_view); + PlatformViewMac(Shell& shell, NSOpenGLView* gl_view); ~PlatformViewMac() override; - virtual void Attach() override; - - void SetupAndLoadDart(); + std::unique_ptr CreateVSyncWaiter() override; bool GLContextMakeCurrent() override; @@ -33,27 +32,17 @@ class PlatformViewMac : public PlatformView, public GPUSurfaceGLDelegate { intptr_t GLContextFBO() const override; - VsyncWaiter* GetVsyncWaiter() override; - - bool ResourceContextMakeCurrent() override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - void SetAssetBundlePath(const std::string& assets_directory) override; - private: fml::scoped_nsobject opengl_view_; fml::scoped_nsobject resource_loading_context_; bool IsValid() const; - void SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages); + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; - void SetAssetBundlePathOnUI(const std::string& assets_directory); + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewMac); }; diff --git a/shell/platform/darwin/desktop/platform_view_mac.mm b/shell/platform/darwin/desktop/platform_view_mac.mm index 42948386fbcd4..f25fa6945af23 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.mm +++ b/shell/platform/darwin/desktop/platform_view_mac.mm @@ -7,77 +7,26 @@ #include #include -#include "flutter/common/threads.h" #include "flutter/fml/trace_event.h" +#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/common/process_info_mac.h" #include "flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h" #include "lib/fxl/command_line.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewMac::PlatformViewMac(NSOpenGLView* gl_view) - : PlatformView(std::make_unique(std::make_unique())), +PlatformViewMac::PlatformViewMac(Shell& shell, NSOpenGLView* gl_view) + : PlatformView(shell, shell.GetTaskRunners()), opengl_view_([gl_view retain]), resource_loading_context_([[NSOpenGLContext alloc] initWithFormat:gl_view.pixelFormat shareContext:gl_view.openGLContext]) {} PlatformViewMac::~PlatformViewMac() = default; -void PlatformViewMac::Attach() { - CreateEngine(); -} - -void PlatformViewMac::SetupAndLoadDart() { - if (AttemptLaunchFromCommandLineSwitches(&engine())) { - // This attempts launching from a Flutter assets directory that does not - // contain a dart snapshot. - return; - } - - const auto& command_line = shell::Shell::Shared().GetCommandLine(); - - std::string bundle_path = - command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::FlutterAssetsDir), ""); - if (!bundle_path.empty()) { - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), bundle_path ] { - if (engine) - engine->RunBundle(bundle_path); - }); - return; - } - - auto args = command_line.positional_args(); - if (args.size() > 0) { - std::string main = args[0]; - std::string packages = - command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::Packages), ""); - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), main, packages ] { - if (engine) - engine->RunBundleAndSource(std::string(), main, packages); - }); - return; - } -} - -void PlatformViewMac::SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - blink::Threads::UI()->PostTask( - [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { - if (engine) - engine->RunBundleAndSource(assets_directory, main, packages); - }); -} - -void PlatformViewMac::SetAssetBundlePathOnUI(const std::string& assets_directory) { - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { - if (engine) - engine->SetAssetBundlePath(assets_directory); - }); +std::unique_ptr PlatformViewMac::CreateVSyncWaiter() { + return std::make_unique(task_runners_); } intptr_t PlatformViewMac::GLContextFBO() const { @@ -115,21 +64,9 @@ return true; } -VsyncWaiter* PlatformViewMac::GetVsyncWaiter() { - if (!vsync_waiter_) - vsync_waiter_ = std::make_unique(); - return vsync_waiter_.get(); -} - -bool PlatformViewMac::ResourceContextMakeCurrent() { - NSOpenGLContext* context = resource_loading_context_.get(); - - if (context == nullptr) { - return false; - } - - [context makeCurrentContext]; - return true; +sk_sp PlatformViewMac::CreateResourceContext() const { + [resource_loading_context_.get() makeCurrentContext]; + return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); } bool PlatformViewMac::IsValid() const { @@ -146,30 +83,8 @@ return true; } -void PlatformViewMac::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetupAndLoadFromSource(assets_directory, main, packages); - latch->Signal(); - }); - - latch->Wait(); - delete latch; -} - -void PlatformViewMac::SetAssetBundlePath(const std::string& assets_directory) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetAssetBundlePathOnUI(assets_directory); - latch->Signal(); - }); - - latch->Wait(); - delete latch; +std::unique_ptr PlatformViewMac::CreateRenderingSurface() { + return std::make_unique(this); } } // namespace shell diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.cc b/shell/platform/darwin/desktop/vsync_waiter_mac.cc index a28ff62edb918..0ccadaf42754d 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.cc +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.cc @@ -6,14 +6,14 @@ #include -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { #define link_ (reinterpret_cast(opaque_)) -VsyncWaiterMac::VsyncWaiterMac() : opaque_(nullptr) { +VsyncWaiterMac::VsyncWaiterMac(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)), opaque_(nullptr) { // Create the link. CVDisplayLinkRef link = nullptr; CVDisplayLinkCreateWithActiveCGDisplays(&link); @@ -48,18 +48,10 @@ void VsyncWaiterMac::OnDisplayLink() { CVDisplayLinkStop(link_); - auto callback = std::move(callback_); - callback_ = Callback(); - - blink::Threads::UI()->PostTask( - [callback, frame_start_time, frame_target_time] { - callback(frame_start_time, frame_target_time); - }); + FireCallback(frame_start_time, frame_target_time); } -void VsyncWaiterMac::AsyncWaitForVsync(Callback callback) { - FXL_DCHECK(!callback_); - callback_ = std::move(callback); +void VsyncWaiterMac::AwaitVSync() { CVDisplayLinkStart(link_); } diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.h b/shell/platform/darwin/desktop/vsync_waiter_mac.h index 15f551f212901..0ad929a509ea3 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.h +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.h @@ -10,19 +10,19 @@ namespace shell { -class VsyncWaiterMac : public VsyncWaiter { +class VsyncWaiterMac final : public VsyncWaiter { public: - VsyncWaiterMac(); + VsyncWaiterMac(blink::TaskRunners task_runners); ~VsyncWaiterMac() override; - void AsyncWaitForVsync(Callback callback) override; - private: void* opaque_; - Callback callback_; + + void AwaitVSync() override; static void OnDisplayLink(void* context); + void OnDisplayLink(); FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterMac); diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 310af79c2ed8e..8946ee954c23a 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -40,8 +40,6 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterDartProject.mm", "framework/Source/FlutterDartProject_Internal.h", "framework/Source/FlutterHeadlessDartRunner.mm", - "framework/Source/FlutterDartSource.h", - "framework/Source/FlutterDartSource.mm", "framework/Source/FlutterNavigationController.mm", "framework/Source/FlutterPlatformPlugin.h", "framework/Source/FlutterPlatformPlugin.mm", @@ -53,14 +51,15 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterView.h", "framework/Source/FlutterView.mm", "framework/Source/FlutterViewController.mm", + "framework/Source/FlutterViewController_Internal.h", "framework/Source/accessibility_bridge.h", "framework/Source/accessibility_bridge.mm", "framework/Source/accessibility_text_entry.h", "framework/Source/accessibility_text_entry.mm", - "framework/Source/flutter_main_ios.h", - "framework/Source/flutter_main_ios.mm", "framework/Source/flutter_touch_mapper.h", "framework/Source/flutter_touch_mapper.mm", + "framework/Source/platform_message_response_darwin.h", + "framework/Source/platform_message_response_darwin.mm", "framework/Source/platform_message_router.h", "framework/Source/platform_message_router.mm", "framework/Source/vsync_waiter_ios.h", @@ -86,6 +85,7 @@ shared_library("create_flutter_framework_dylib") { "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/ui", + "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", @@ -95,7 +95,10 @@ shared_library("create_flutter_framework_dylib") { "//third_party/skia", ] if (flutter_runtime_mode == "debug") { - deps += [ "//third_party/dart/runtime:libdart_jit" ] + deps += [ + "$flutter_root/lib/snapshot", + "//third_party/dart/runtime:libdart_jit", + ] } else { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index d5f30d02664d9..3c613c9fbad8f 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -2,42 +2,121 @@ // 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/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" +#include "flutter/fml/message_loop.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" +#include "flutter/runtime/dart_vm.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" -#include "lib/fxl/strings/string_view.h" -#include "third_party/dart/runtime/include/dart_api.h" - -static NSURL* URLForSwitch(const fxl::StringView name) { - const auto& cmd = shell::Shell::Shared().GetCommandLine(); - NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - - std::string switch_value; - if (cmd.GetOptionValue(name, &switch_value)) { - auto url = [NSURL fileURLWithPath:@(switch_value.c_str())]; - [defaults setURL:url forKey:@(name.data())]; - [defaults synchronize]; - return url; +#include "flutter/shell/platform/darwin/common/command_line.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" + +static const char* kScriptSnapshotFileName = "snapshot_blob.bin"; +static const char* kVMKernelSnapshotFileName = "platform.dill"; +static const char* kApplicationKernelSnapshotFileName = "kernel_blob.bin"; + +static blink::Settings DefaultSettingsForProcess() { + auto command_line = shell::CommandLineFromNSProcessInfo(); + + // Settings passed in explicitly via command line arguments take priority. + auto settings = shell::SettingsFromCommandLine(command_line); + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + // The command line arguments may not always be complete. If they aren't, attempt to fill in + // defaults. + + // Flutter ships the ICU data file in the the bundle of the engine. Look for it there. + if (settings.icu_data_path.size() == 0) { + NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; + NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; + if (icuDataPath.length > 0) { + settings.icu_data_path = icuDataPath.UTF8String; + } } - return [defaults URLForKey:@(name.data())]; -} + if (blink::DartVM::IsRunningPrecompiledCode()) { + // The application bundle could be specified in the Info.plist. + if (settings.application_library_path.size() == 0) { + NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; + NSString* libraryPath = [[NSBundle mainBundle] pathForResource:libraryName ofType:nil]; + if (libraryPath.length > 0) { + settings.application_library_path = + [NSBundle bundleWithPath:libraryPath].executablePath.UTF8String; + } + } -@implementation FlutterDartProject { - NSBundle* _precompiledDartBundle; - FlutterDartSource* _dartSource; + // In case the application bundle is still not specified, look for the App.framework in the + // Frameworks directory. + if (settings.application_library_path.size() == 0) { + NSString* applicationFrameworkPath = + [[NSBundle mainBundle] pathForResource:@"Frameworks/App.framework" ofType:@""]; + if (applicationFrameworkPath.length > 0) { + settings.application_library_path = + [NSBundle bundleWithPath:applicationFrameworkPath].executablePath.UTF8String; + } + } + } - VMType _vmTypeRequirement; + // Checks to see if the flutter assets directory is already present. + if (settings.assets_path.size() == 0) { + NSString* assetsPath = [[NSBundle mainBundle] pathForResource:@"flutter_assets" ofType:@""]; + + if (assetsPath.length > 0) { + settings.assets_path = assetsPath.UTF8String; + + if (!blink::DartVM::IsRunningPrecompiledCode()) { + // Looking for the various script and kernel snapshot buffers only makes sense if we have a + // VM that can use these buffers. + { + // Check if there is a script snapshot in the assets directory we could potentially use. + NSURL* scriptSnapshotURL = [NSURL URLWithString:@(kScriptSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotURL.path]) { + settings.script_snapshot_path = scriptSnapshotURL.path.UTF8String; + } + } + + { + // Check if there is a VM kernel snapshot in the assets directory we could potentially + // use. + NSURL* vmKernelSnapshotURL = [NSURL URLWithString:@(kVMKernelSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:vmKernelSnapshotURL.path]) { + settings.kernel_snapshot_path = vmKernelSnapshotURL.path.UTF8String; + } + } + + { + // Check if there is an application kernel snapshot in the assets directory we could + // potentially use. + NSURL* applicationKernelSnapshotURL = + [NSURL URLWithString:@(kApplicationKernelSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:applicationKernelSnapshotURL.path]) { + settings.application_kernel_asset = applicationKernelSnapshotURL.path.UTF8String; + } + } + } + } + } + + return settings; } -+ (void)initialize { - if (self == [FlutterDartProject class]) { - shell::FlutterMain(); - } +@implementation FlutterDartProject { + fml::scoped_nsobject _precompiledDartBundle; + blink::Settings _settings; } #pragma mark - Override base class designated initializers @@ -52,9 +131,16 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle { self = [super init]; if (self) { - _precompiledDartBundle = [bundle retain]; + _precompiledDartBundle.reset([bundle retain]); - [self checkReadiness]; + _settings = DefaultSettingsForProcess(); + + if (bundle != nil) { + NSString* executablePath = _precompiledDartBundle.get().executablePath; + if ([[NSFileManager defaultManager] fileExistsAtPath:executablePath]) { + _settings.application_library_path = executablePath.UTF8String; + } + } } return self; @@ -66,11 +152,15 @@ - (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _dartSource = [[FlutterDartSource alloc] initWithDartMain:dartMainURL - packages:dartPackages - flutterAssets:flutterAssetsURL]; + _settings = DefaultSettingsForProcess(); - [self checkReadiness]; + if ([[NSFileManager defaultManager] fileExistsAtPath:dartMainURL.path]) { + _settings.main_dart_file_path = dartMainURL.path.UTF8String; + } + + if ([[NSFileManager defaultManager] fileExistsAtPath:dartPackages.path]) { + _settings.packages_file_path = dartPackages.path.UTF8String; + } } return self; @@ -80,10 +170,17 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _dartSource = - [[FlutterDartSource alloc] initWithFlutterAssetsWithScriptSnapshot:flutterAssetsURL]; + _settings = DefaultSettingsForProcess(); - [self checkReadiness]; + if ([[NSFileManager defaultManager] fileExistsAtPath:flutterAssetsURL.path]) { + _settings.assets_path = flutterAssetsURL.path.UTF8String; + + NSURL* scriptSnapshotPath = + [NSURL URLWithString:@(kScriptSnapshotFileName) relativeToURL:flutterAssetsURL]; + if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotPath.path]) { + _settings.script_snapshot_path = scriptSnapshotPath.path.UTF8String; + } + } } return self; @@ -92,56 +189,19 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL #pragma mark - Convenience initializers - (instancetype)initFromDefaultSourceForConfiguration { - NSBundle* bundle = [NSBundle mainBundle]; - - if (Dart_IsPrecompiledRuntime()) { - // Load from an AOTC snapshot. - return [self initWithPrecompiledDartBundle:bundle]; + if (blink::DartVM::IsRunningPrecompiledCode()) { + return [self initWithPrecompiledDartBundle:nil]; } else { - // Load directly from sources if the appropriate command line flags are - // specified. If not, try loading from a script snapshot in the framework - // bundle. - NSURL* flutterAssetsURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::FlutterAssetsDir)); - - if (flutterAssetsURL == nil) { - // If the URL was not specified on the command line, look inside the - // FlutterApplication bundle. - NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:bundle]; - if (flutterAssetsPath != nil) { - flutterAssetsURL = [NSURL fileURLWithPath:flutterAssetsPath isDirectory:NO]; - } - } - - if (flutterAssetsURL == nil) { - NSLog(@"Error: flutterAssets directory not present in bundle; unable to start app."); - [self release]; - return nil; - } - - NSURL* dartMainURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::MainDartFile)); - NSURL* dartPackagesURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::Packages)); - - return - [self initWithFlutterAssets:flutterAssetsURL dartMain:dartMainURL packages:dartPackagesURL]; + return [self initWithFlutterAssets:nil dartMain:nil packages:nil]; } - - NSAssert(NO, @"Unreachable"); - [self release]; - return nil; } -#pragma mark - Common initialization tasks - -- (void)checkReadiness { - if (_precompiledDartBundle != nil) { - _vmTypeRequirement = VMTypePrecompilation; - return; - } +- (const blink::Settings&)settings { + return _settings; +} - if (_dartSource != nil) { - _vmTypeRequirement = VMTypeInterpreter; - return; - } +- (shell::RunConfiguration)runConfiguration { + return shell::RunConfiguration::InferFromSettings(_settings); } #pragma mark - Assets-related utilities @@ -161,7 +221,7 @@ + (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle { } + (NSString*)lookupKeyForAsset:(NSString*)asset { - NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName: [NSBundle mainBundle]]; + NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName:[NSBundle mainBundle]]; return [NSString stringWithFormat:@"%@/%@", flutterAssetsName, asset]; } @@ -169,179 +229,4 @@ + (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { return [self lookupKeyForAsset:[NSString stringWithFormat:@"packages/%@/%@", package, asset]]; } -#pragma mark - Launching the project in a preconfigured engine. - -static NSString* NSStringFromVMType(VMType type) { - switch (type) { - case VMTypeInvalid: - return @"Invalid"; - case VMTypeInterpreter: - return @"Interpreter"; - case VMTypePrecompilation: - return @"Precompilation"; - } - - return @"Unknown"; -} - -- (void)launchInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - embedderVMType:(VMType)embedderVMType - result:(LaunchResult)result { - if (_vmTypeRequirement == VMTypeInvalid) { - result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); - return; - } - - if (embedderVMType == VMTypeInvalid) { - result(NO, @"The embedder is invalid."); - return; - } - - if (_vmTypeRequirement != embedderVMType) { - NSString* message = - [NSString stringWithFormat: - @"Could not load the project because of differing project type. " - @"The project can run in '%@' but the embedder is configured as " - @"'%@'", - NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; - result(NO, message); - return; - } - - switch (_vmTypeRequirement) { - case VMTypeInterpreter: - [self runFromSourceInEngine:engine withEntrypoint:entrypoint result:result]; - return; - case VMTypePrecompilation: - [self runFromPrecompiledSourceInEngine:engine withEntrypoint:entrypoint result:result]; - return; - case VMTypeInvalid: - break; - } - - return result(NO, @"Internal error"); -} - -- (void)launchInEngine:(shell::Engine*)engine - embedderVMType:(VMType)embedderVMType - result:(LaunchResult)result { - if (_vmTypeRequirement == VMTypeInvalid) { - result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); - return; - } - - if (embedderVMType == VMTypeInvalid) { - result(NO, @"The embedder is invalid."); - return; - } - - if (_vmTypeRequirement != embedderVMType) { - NSString* message = - [NSString stringWithFormat: - @"Could not load the project because of differing project type. " - @"The project can run in '%@' but the embedder is configured as " - @"'%@'", - NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; - result(NO, message); - return; - } - - switch (_vmTypeRequirement) { - case VMTypeInterpreter: - [self runFromSourceInEngine:engine withEntrypoint:@"main" result:result]; - return; - case VMTypePrecompilation: - [self runFromPrecompiledSourceInEngine:engine withEntrypoint:@"main" result:result]; - return; - case VMTypeInvalid: - break; - } - - return result(NO, @"Internal error"); -} - -#pragma mark - Running from precompiled application bundles - -- (void)runFromPrecompiledSourceInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - result:(LaunchResult)result { - if (![_precompiledDartBundle load]) { - NSString* message = [NSString - stringWithFormat:@"Could not load the framework ('%@') containing precompiled code.", - _precompiledDartBundle.bundleIdentifier]; - result(NO, message); - return; - } - - NSString* path = [FlutterDartProject pathForFlutterAssetsFromBundle:_precompiledDartBundle]; - if (path.length == 0) { - NSString* message = [NSString stringWithFormat: - @"Could not find the 'flutter_assets' dir in " - @"the precompiled Dart bundle with ID '%@'", - _precompiledDartBundle.bundleIdentifier]; - result(NO, message); - return; - } - - std::string bundle_path = path.UTF8String; - blink::Threads::UI()->PostTask([ - engine = engine->GetWeakPtr(), bundle_path, entrypoint = std::string([entrypoint UTF8String]) - ] { - if (engine) - engine->RunBundle(bundle_path, entrypoint); - }); - - result(YES, @"Success"); -} - -#pragma mark - Running from source - -- (void)runFromSourceInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - result:(LaunchResult)result { - if (_dartSource == nil) { - result(NO, @"Dart source not specified."); - return; - } - - [_dartSource validate:^(BOOL success, NSString* message) { - if (!success) { - return result(NO, message); - } - - std::string bundle_path = _dartSource.flutterAssets.absoluteURL.path.UTF8String; - - if (_dartSource.assetsDirContainsScriptSnapshot) { - blink::Threads::UI()->PostTask([ - engine = engine->GetWeakPtr(), bundle_path, - entrypoint = std::string([entrypoint UTF8String]) - ] { - if (engine) - engine->RunBundle(bundle_path, entrypoint); - }); - } else { - std::string main = _dartSource.dartMain.absoluteURL.path.UTF8String; - std::string packages = _dartSource.packages.absoluteURL.path.UTF8String; - blink::Threads::UI()->PostTask( - [ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { - if (engine) - engine->RunBundleAndSource(bundle_path, main, packages); - }); - } - - result(YES, @"Success"); - }]; -} - -#pragma mark - Misc. - -- (void)dealloc { - [_precompiledDartBundle unload]; - [_precompiledDartBundle release]; - [_dartSource release]; - - [super dealloc]; -} - @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h index 75db7c4049dd9..7fe1fc364f328 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h @@ -5,32 +5,15 @@ #ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ +#include "flutter/common/settings.h" #include "flutter/shell/common/engine.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h" -enum VMType { - // An invalid VM configuration. - VMTypeInvalid = 0, - // VM can execute Dart code as an interpreter. - VMTypeInterpreter, - // VM can execute precompiled Dart code. - VMTypePrecompilation, -}; - -typedef void (^LaunchResult)(BOOL success, NSString* message); - @interface FlutterDartProject () -- (void)launchInEngine:(shell::Engine*)engine - embedderVMType:(VMType)type - result:(LaunchResult)result; - -- (void)launchInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - embedderVMType:(VMType)type - result:(LaunchResult)result; +- (const blink::Settings&)settings; -+ (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle; +- (shell::RunConfiguration)runConfiguration; @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h deleted file mode 100644 index c3881ce065185..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 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. - -#ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ -#define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ - -#import - -typedef void (^ValidationResult)(BOOL result, NSString* message); - -@interface FlutterDartSource : NSObject - -@property(nonatomic, readonly) NSURL* dartMain; -@property(nonatomic, readonly) NSURL* packages; -@property(nonatomic, readonly) NSURL* flutterAssets; -@property(nonatomic, readonly) BOOL assetsDirContainsScriptSnapshot; - -- (instancetype)initWithDartMain:(NSURL*)dartMain - packages:(NSURL*)packages - flutterAssets:(NSURL*)flutterAssets NS_DESIGNATED_INITIALIZER; - -- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets - NS_DESIGNATED_INITIALIZER; - -- (void)validate:(ValidationResult)result; - -@end - -#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm deleted file mode 100644 index aecb4e5806b3a..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" - -@implementation FlutterDartSource - -@synthesize dartMain = _dartMain; -@synthesize packages = _packages; -@synthesize flutterAssets = _flutterAssets; -@synthesize assetsDirContainsScriptSnapshot = _assetsDirContainsScriptSnapshot; - -#pragma mark - Convenience Initializers - -- (instancetype)init { - return [self initWithDartMain:nil packages:nil flutterAssets:nil]; -} - -#pragma mark - Designated Initializers - -- (instancetype)initWithDartMain:(NSURL*)dartMain - packages:(NSURL*)packages - flutterAssets:(NSURL*)flutterAssets { - self = [super init]; - - if (self) { - _dartMain = [dartMain copy]; - _packages = [packages copy]; - _flutterAssets = [flutterAssets copy]; - - NSFileManager* fileManager = [NSFileManager defaultManager]; - - const BOOL dartMainExists = [fileManager fileExistsAtPath:dartMain.absoluteURL.path]; - const BOOL packagesExists = [fileManager fileExistsAtPath:packages.absoluteURL.path]; - - if (!dartMainExists || !packagesExists) { - // We cannot actually verify this without opening up the directory. This is - // just an assumption. - _assetsDirContainsScriptSnapshot = YES; - } - } - - return self; -} - -- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets { - self = [super init]; - - if (self) { - _flutterAssets = [flutterAssets copy]; - _assetsDirContainsScriptSnapshot = YES; - } - - return self; -} - -static BOOL CheckDartProjectURL(NSMutableString* log, NSURL* url, NSString* logLabel) { - if (url == nil) { - [log appendFormat:@"The %@ was not specified.\n", logLabel]; - return false; - } - - if (!url.isFileURL) { - [log appendFormat:@"The %@ must be a file URL.\n", logLabel]; - return false; - } - - if (![[NSFileManager defaultManager] fileExistsAtPath:url.absoluteURL.path]) { - [log appendFormat:@"No file found at '%@' when looking for the %@.\n", url, logLabel]; - return false; - } - - return true; -} - -- (void)validate:(ValidationResult)result { - NSMutableString* log = [[[NSMutableString alloc] init] autorelease]; - - BOOL isValid = YES; - - isValid &= CheckDartProjectURL(log, _flutterAssets, @"Flutter assets"); - - if (!_assetsDirContainsScriptSnapshot) { - isValid &= CheckDartProjectURL(log, _dartMain, @"Dart main"); - isValid &= CheckDartProjectURL(log, _packages, @"Dart packages"); - } - - result(isValid, log); -} - -- (void)dealloc { - [_dartMain release]; - [_packages release]; - [_flutterAssets release]; - - [super dealloc]; -} - -@end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm index 2143f362f7905..dee11d08934a5 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm @@ -2,38 +2,84 @@ // 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 + #import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h" +#include #include -#include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/null_platform_view.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/engine.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/run_configuration.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/darwin/common/command_line.h" +#include "lib/fxl/functional/make_copyable.h" -@interface FlutterHeadlessDartRunner () -@end +static std::unique_ptr CreateHeadlessPlatformView(shell::Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); +} -@implementation FlutterHeadlessDartRunner { - fml::scoped_nsprotocol _dartProject; - std::shared_ptr _platformView; +static std::unique_ptr CreateHeadlessRasterizer(shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); } -- (instancetype)init { - _dartProject.reset([[FlutterDartProject alloc] initFromDefaultSourceForConfiguration]); - _platformView = std::make_shared(); - _platformView->Attach(); - return self; +@implementation FlutterHeadlessDartRunner { + shell::ThreadHost _threadHost; + std::unique_ptr _shell; } - (void)runWithEntrypoint:(NSString*)entrypoint { - const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; - [_dartProject launchInEngine:&_platformView->engine() - withEntrypoint:entrypoint - embedderVMType:type - result:^(BOOL success, NSString* message) { - if (!success) - NSLog(@"%@", message); - }]; + if (_shell != nullptr || entrypoint.length == 0) { + FXL_LOG(ERROR) << "This headless dart runner was already used to run some code."; + return; + } + + const auto label = "io.flutter.headless"; + + // Create the threads to run the shell on. + _threadHost = { + label, // native thread label + shell::ThreadHost::Type::UI // managed threads to create + }; + + // Configure shell task runners. + auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); + auto single_task_runner = _threadHost.ui_thread->GetTaskRunner(); + blink::TaskRunners task_runners(label, // dart thread label + current_task_runner, // platform + single_task_runner, // gpu + single_task_runner, // ui + single_task_runner // io + ); + + auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); + + // Create the shell. This is a blocking operation. + _shell = shell::Shell::Create( + std::move(task_runners), // task runners + std::move(settings), // settings + std::bind(&CreateHeadlessPlatformView, std::placeholders::_1), // platform view creation + std::bind(&CreateHeadlessRasterizer, std::placeholders::_1) // rasterzier creation + ); + + if (_shell == nullptr) { + FXL_LOG(ERROR) << "Could not start a shell for the headless dart runner with entrypoint: " + << entrypoint.UTF8String; + return; + } + + // Override the default run configuration with the specified entrypoint. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), + config = shell::RunConfiguration::InferFromSettings(settings)]() mutable { + if (!engine || !engine->Run(std::move(config))) { + FXL_LOG(ERROR) << "Could not launch engine with configuration."; + } + })); } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.h b/shell/platform/darwin/ios/framework/Source/FlutterView.h index 661940620c947..5e3d303401725 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.h @@ -7,8 +7,14 @@ #include +#include + +#include "flutter/shell/platform/darwin/ios/ios_surface.h" + @interface FlutterView : UIView +- (std::unique_ptr)createSurface; + @end #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 7c382838c6f5c..27e3d48c4cb50 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -5,20 +5,41 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" +#include "flutter/fml/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" +#include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" +#include "flutter/shell/platform/darwin/ios/ios_surface_software.h" #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" -@interface FlutterView () +@interface FlutterView () @end @implementation FlutterView +- (FlutterViewController*)flutterViewController { + // Find the first view controller in the responder chain and see if it is a FlutterViewController. + for (UIResponder* responder = self.nextResponder; responder != nil; + responder = responder.nextResponder) { + if ([responder isKindOfClass:[UIViewController class]]) { + if ([responder isKindOfClass:[FlutterViewController class]]) { + return reinterpret_cast(responder); + } else { + // Should only happen if a non-FlutterViewController tries to somehow (via dynamic class + // resolution or reparenting) set a FlutterView as its view. + return nil; + } + } + } + return nil; +} + - (void)layoutSubviews { if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { CAEAGLLayer* layer = reinterpret_cast(self.layer); @@ -40,13 +61,24 @@ + (Class)layerClass { #endif // TARGET_IPHONE_SIMULATOR } +- (std::unique_ptr)createSurface { + if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { + fml::scoped_nsobject eagl_layer( + reinterpret_cast([self.layer retain])); + return std::make_unique(std::move(eagl_layer)); + } else { + fml::scoped_nsobject layer(reinterpret_cast([self.layer retain])); + return std::make_unique(std::move(layer)); + } +} + - (BOOL)enableInputClicksWhenVisible { return YES; } -void SnapshotRasterizer(fml::WeakPtr rasterizer, - CGContextRef context, - bool is_opaque) { +static void SnapshotRasterizer(fml::WeakPtr rasterizer, + CGContextRef context, + bool is_opaque) { if (!rasterizer) { return; } @@ -77,10 +109,11 @@ void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCanvas canvas(bitmap); - { - flow::CompositorContext compositor_context(nullptr); - auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */); - layer_tree->Raster(frame, false /* ignore raster cache. */); + flow::CompositorContext compositor_context; + + if (auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */)) { + layer_tree->Preroll(*frame, true /* ignore raster cache */); + layer_tree->Paint(*frame); } canvas.flush(); @@ -89,41 +122,6 @@ void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCGDrawBitmap(context, bitmap, 0, 0); } -static fml::WeakPtr GetRandomRasterizer() { - fml::WeakPtr rasterizer; - shell::Shell::Shared().IteratePlatformViews([&rasterizer](shell::PlatformView* view) -> bool { - rasterizer = view->rasterizer().GetWeakRasterizerPtr(); - // We just grab the first rasterizer so there is no need to iterate - // further. - return false; - }); - return rasterizer; -} - -void SnapshotContents(CGContextRef context, bool is_opaque) { - // TODO(chinmaygarde): Currently, there is no way to get the rasterizer for - // a particular platform view from the shell. But, for now, we only have one - // platform view. So use that. Once we support multiple platform views, the - // shell will need to provide a way to get the rasterizer for a specific - // platform view. - SnapshotRasterizer(GetRandomRasterizer(), context, is_opaque); -} - -void SnapshotContentsSync(CGContextRef context, UIView* view) { - auto gpu_thread = blink::Threads::Gpu(); - - if (!gpu_thread) { - return; - } - - fxl::AutoResetWaitableEvent latch; - gpu_thread->PostTask([&latch, context, view]() { - SnapshotContents(context, [view isOpaque]); - latch.Signal(); - }); - latch.Wait(); -} - // Override the default CALayerDelegate method so that APIs that attempt to // screenshot the view display contents correctly. We cannot depend on // reading @@ -132,7 +130,22 @@ void SnapshotContentsSync(CGContextRef context, UIView* view) { // 2: The call is made of the platform thread and not the GPU thread. // 3: There may be a software rasterizer. - (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { - SnapshotContentsSync(context, self); + TRACE_EVENT0("flutter", "SnapshotFlutterView"); + FlutterViewController* controller = [self flutterViewController]; + + if (controller == nil) { + return; + } + + auto& shell = [controller shell]; + + fxl::AutoResetWaitableEvent latch; + shell.GetTaskRunners().GetGPUTaskRunner()->PostTask( + [&latch, rasterizer = shell.GetRasterizer(), context, opaque = layer.opaque]() { + SnapshotRasterizer(std::move(rasterizer), context, opaque); + latch.Signal(); + }); + latch.Wait(); } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index a467a5a8cf1a5..17e9a4eff48f6 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -2,90 +2,54 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#define FML_USED_ON_EMBEDDER + +#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" #include -#include "flutter/common/threads.h" -#include "flutter/flow/texture.h" +#include "flutter/fml/message_loop.h" #include "flutter/fml/platform/darwin/platform_version.h" -#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/lib/ui/painting/resource_context.h" -#include "flutter/shell/platform/darwin/common/buffer_conversions.h" -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterCodecs.h" +#include "flutter/shell/common/thread_host.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h" -#include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" #include "flutter/shell/platform/darwin/ios/platform_view_ios.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/time/time_delta.h" - -namespace { - -typedef void (^PlatformMessageResponseCallback)(NSData*); - -class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); - - public: - void Complete(std::vector data) override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask( - fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { - self->callback_.get()(shell::GetNSDataFromVector(data)); - })); - } - - void CompleteEmpty() override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask( - fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); - } - - private: - explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback) - : callback_(callback, fml::OwnershipPolicy::Retain) {} - fml::ScopedBlock callback_; -}; - -} // namespace - -@interface FlutterViewController () +@interface FlutterViewController () @end @implementation FlutterViewController { - fml::scoped_nsprotocol _dartProject; + fml::scoped_nsobject _dartProject; + shell::ThreadHost _threadHost; + std::unique_ptr _shell; + + // Channels + fml::scoped_nsobject _platformPlugin; + fml::scoped_nsobject _textInputPlugin; + fml::scoped_nsobject _localizationChannel; + fml::scoped_nsobject _navigationChannel; + fml::scoped_nsobject _platformChannel; + fml::scoped_nsobject _textInputChannel; + fml::scoped_nsobject _lifecycleChannel; + fml::scoped_nsobject _systemChannel; + fml::scoped_nsobject _settingsChannel; + + // We keep a separate reference to this and create it ahead of time because we want to be able to + // setup a shell along with its platform view before the view has to appear. + fml::scoped_nsobject _flutterView; + fml::scoped_nsobject _launchView; UIInterfaceOrientationMask _orientationPreferences; UIStatusBarStyle _statusBarStyle; blink::ViewportMetrics _viewportMetrics; shell::TouchMapper _touchMapper; - std::shared_ptr _platformView; - fml::scoped_nsprotocol _platformPlugin; - fml::scoped_nsprotocol _textInputPlugin; - fml::scoped_nsprotocol _localizationChannel; - fml::scoped_nsprotocol _navigationChannel; - fml::scoped_nsprotocol _platformChannel; - fml::scoped_nsprotocol _textInputChannel; - fml::scoped_nsprotocol _lifecycleChannel; - fml::scoped_nsprotocol _systemChannel; - fml::scoped_nsprotocol _settingsChannel; - fml::scoped_nsprotocol _launchView; int64_t _nextTextureId; BOOL _initialized; - BOOL _connected; -} - -+ (void)initialize { - if (self == [FlutterViewController class]) { - shell::FlutterMain(); - } } #pragma mark - Manage and override all designated initializers @@ -125,26 +89,92 @@ - (void)performCommonViewControllerInitialization { _orientationPreferences = UIInterfaceOrientationMaskAll; _statusBarStyle = UIStatusBarStyleDefault; - _platformView = std::make_shared( - reinterpret_cast(self.view.layer), self); - - _platformView->Attach( - // First frame callback. - [self]() { - TRACE_EVENT0("flutter", "First Frame"); - if (_launchView) { - [UIView animateWithDuration:0.2 - animations:^{ - _launchView.get().alpha = 0; - } - completion:^(BOOL finished) { - [_launchView.get() removeFromSuperview]; - _launchView.reset(); - }]; + + if ([self setupShell]) { + [self setupChannels]; + [self setupNotificationCenterObservers]; + } +} + +- (shell::Shell&)shell { + FXL_DCHECK(_shell); + return *_shell; +} + +- (fml::WeakPtr)iosPlatformView { + FXL_DCHECK(_shell); + return _shell->GetPlatformView(); +} + +- (BOOL)setupShell { + FXL_DCHECK(_shell == nullptr); + + static size_t shell_count = 1; + + auto threadLabel = [NSString stringWithFormat:@"io.flutter.%zu", shell_count++]; + + _threadHost = { + threadLabel.UTF8String, // label + shell::ThreadHost::Type::UI | shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::IO}; + + // The current thread will be used as the platform thread. Ensure that the message loop is + // initialized. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + blink::TaskRunners task_runners(threadLabel.UTF8String, // label + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + _threadHost.gpu_thread->GetTaskRunner(), // gpu + _threadHost.ui_thread->GetTaskRunner(), // ui + _threadHost.io_thread->GetTaskRunner() // io + ); + + _flutterView.reset([[FlutterView alloc] init]); + + // Lambda captures by pointers to ObjC objects are fine here because the create call is + // synchronous. + shell::Shell::CreateCallback on_create_platform_view = + [flutter_view_controller = self, flutter_view = _flutterView.get()](shell::Shell& shell) { + auto platform_view_ios = std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + flutter_view_controller, // flutter view controller owner + flutter_view // flutter view owner + ); + return platform_view_ios; + }; + + shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // Create the shell. + _shell = shell::Shell::Create(std::move(task_runners), // + [_dartProject settings], // + on_create_platform_view, // + on_create_rasterizer // + ); + + if (!_shell) { + FXL_LOG(ERROR) << "Could not setup a shell to run the Dart application."; + return false; + } + + // Launch the Dart application with the inferred run configuration. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), // + config = [_dartProject.get() runConfiguration] // + ]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch engine with configuration."; + } } - }); - _platformView->SetupResourceContextOnIOThread(); + })); + return true; +} +- (void)setupChannels { _localizationChannel.reset([[FlutterMethodChannel alloc] initWithName:@"flutter/localization" binaryMessenger:self @@ -190,9 +220,8 @@ - (void)performCommonViewControllerInitialization { [_textInputChannel.get() setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { [_textInputPlugin.get() handleMethodCall:call result:result]; }]; - _platformView->SetTextInputPlugin(_textInputPlugin); - - [self setupNotificationCenterObservers]; + static_cast(_shell->GetPlatformView().get()) + ->SetTextInputPlugin(_textInputPlugin); } - (void)setupNotificationCenterObservers { @@ -261,50 +290,24 @@ - (void)setupNotificationCenterObservers { - (void)setInitialRoute:(NSString*)route { [_navigationChannel.get() invokeMethod:@"setInitialRoute" arguments:route]; } -#pragma mark - Initializing the engine - -- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { - exit(0); -} - -- (void)connectToEngineAndLoad { - if (_connected) - return; - _connected = YES; - - TRACE_EVENT0("flutter", "connectToEngineAndLoad"); - - // We ask the VM to check what it supports. - const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; - - [_dartProject launchInEngine:&_platformView->engine() - embedderVMType:type - result:^(BOOL success, NSString* message) { - if (!success) { - UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Launch Error" - message:message - delegate:self - cancelButtonTitle:@"OK" - otherButtonTitles:nil]; - [alert show]; - [alert release]; - } - }]; -} #pragma mark - Loading the view - (void)loadView { - FlutterView* view = [[FlutterView alloc] init]; - - self.view = view; + self.view = _flutterView.get(); self.view.multipleTouchEnabled = YES; self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [view release]; + [self installLaunchViewIfNecessary]; +} + +#pragma mark - Managing launch views +- (void)installLaunchViewIfNecessary { // Show the launch screen view again on top of the FlutterView if available. // This launch screen view will be removed once the first Flutter frame is rendered. + [_launchView.get() removeFromSuperview]; + _launchView.reset(); NSString* launchStoryboardName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UILaunchStoryboardName"]; if (launchStoryboardName && !self.isBeingPresented && !self.isMovingToParentViewController) { @@ -319,16 +322,57 @@ - (void)loadView { } } +- (void)removeLaunchViewIfPresent { + if (!_launchView) { + return; + } + + [UIView animateWithDuration:0.2 + animations:^{ + _launchView.get().alpha = 0; + } + completion:^(BOOL finished) { + [_launchView.get() removeFromSuperview]; + _launchView.reset(); + }]; +} + +- (void)installLaunchViewCallback { + if (!_shell || !_launchView) { + return; + } + auto weak_platform_view = _shell->GetPlatformView(); + if (!weak_platform_view) { + return; + } + __unsafe_unretained auto weak_flutter_view_controller = self; + // This is on the platform thread. + weak_platform_view->SetNextFrameCallback( + [weak_platform_view, weak_flutter_view_controller, + task_runner = _shell->GetTaskRunners().GetPlatformTaskRunner()]() { + // This is on the GPU thread. + task_runner->PostTask([weak_platform_view, weak_flutter_view_controller]() { + // We check if the weak platform view is alive. If it is alive, then the view controller + // also has to be alive since the view controller owns the platform view via the shell + // association. Thus, we are not convinced that the unsafe unretained weak object is in + // fact alive. + if (weak_platform_view) { + [weak_flutter_view_controller removeLaunchViewIfPresent]; + } + }); + }); +} + #pragma mark - Surface creation and teardown updates - (void)surfaceUpdated:(BOOL)appeared { - FXL_CHECK(_platformView != nullptr); - // NotifyCreated/NotifyDestroyed are synchronous and require hops between the UI and GPU thread. if (appeared) { - _platformView->NotifyCreated(); + [self installLaunchViewCallback]; + _shell->GetPlatformView()->NotifyCreated(); + } else { - _platformView->NotifyDestroyed(); + _shell->GetPlatformView()->NotifyDestroyed(); } } @@ -336,7 +380,6 @@ - (void)surfaceUpdated:(BOOL)appeared { - (void)viewWillAppear:(BOOL)animated { TRACE_EVENT0("flutter", "viewWillAppear"); - [self connectToEngineAndLoad]; // Only recreate surface on subsequent appearances when viewport metrics are known. // First time surface creation is done on viewDidLayoutSubviews. if (_viewportMetrics.physical_width) @@ -391,8 +434,6 @@ - (void)applicationWillResignActive:(NSNotification*)notification { - (void)applicationDidEnterBackground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationDidEnterBackground"); [self surfaceUpdated:NO]; - // GrContext operations are blocked when the app is in the background. - blink::ResourceContext::Freeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.paused"]; } @@ -400,7 +441,6 @@ - (void)applicationWillEnterForeground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationWillEnterForeground"); if (_viewportMetrics.physical_width) [self surfaceUpdated:YES]; - blink::ResourceContext::Unfreeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.inactive"]; } @@ -547,10 +587,11 @@ - (void)dispatchTouches:(NSSet*)touches phase:(UITouchPhase)phase { packet->SetPointerData(i++, pointer_data); } - blink::Threads::UI()->PostTask(fxl::MakeCopyable( - [ engine = _platformView->engine().GetWeakPtr(), packet = std::move(packet) ] { - if (engine.get()) + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), packet = std::move(packet)] { + if (engine) { engine->DispatchPointerDataPacket(*packet); + } })); } @@ -573,13 +614,11 @@ - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event { #pragma mark - Handle view resizing - (void)updateViewportMetrics { - blink::Threads::UI()->PostTask( - [ weak_platform_view = _platformView->GetWeakPtr(), metrics = _viewportMetrics ] { - if (!weak_platform_view) { - return; + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = _shell->GetEngine(), metrics = _viewportMetrics]() { + if (engine) { + engine->SetViewportMetrics(std::move(metrics)); } - weak_platform_view->UpdateSurfaceSize(); - weak_platform_view->engine().SetViewportMetrics(metrics); }); } @@ -709,7 +748,7 @@ - (void)onVoiceOverChanged:(NSNotification*)notification { #else bool enabled = UIAccessibilityIsVoiceOverRunning(); #endif - _platformView->ToggleAccessibility(self.view, enabled); + _shell->GetPlatformView()->SetSemanticsEnabled(enabled); } #pragma mark - Memory Notifications @@ -875,46 +914,50 @@ - (void)sendOnChannel:(NSString*)channel message:(NSData*)message binaryReply:(FlutterBinaryReply)callback { NSAssert(channel, @"The channel must not be null"); - fxl::RefPtr response = + fxl::RefPtr response = (callback == nil) ? nullptr - : fxl::MakeRefCounted(^(NSData* reply) { - callback(reply); - }); + : fxl::MakeRefCounted( + ^(NSData* reply) { + callback(reply); + }, + _shell->GetTaskRunners().GetPlatformTaskRunner()); fxl::RefPtr platformMessage = (message == nil) ? fxl::MakeRefCounted(channel.UTF8String, response) : fxl::MakeRefCounted( channel.UTF8String, shell::GetVectorFromNSData(message), response); - _platformView->DispatchPlatformMessage(platformMessage); + + _shell->GetPlatformView()->DispatchPlatformMessage(platformMessage); } - (void)setMessageHandlerOnChannel:(NSString*)channel binaryMessageHandler:(FlutterBinaryMessageHandler)handler { NSAssert(channel, @"The channel must not be null"); - _platformView->platform_message_router().SetMessageHandler(channel.UTF8String, handler); + [self iosPlatformView] -> GetPlatformMessageRouter().SetMessageHandler(channel.UTF8String, + handler); } #pragma mark - FlutterTextureRegistry - (int64_t)registerTexture:(NSObject*)texture { int64_t textureId = _nextTextureId++; - _platformView->RegisterExternalTexture(textureId, texture); + [self iosPlatformView] -> RegisterExternalTexture(textureId, texture); return textureId; } - (void)unregisterTexture:(int64_t)textureId { - _platformView->UnregisterTexture(textureId); + _shell->GetPlatformView()->UnregisterTexture(textureId); } - (void)textureFrameAvailable:(int64_t)textureId { - _platformView->MarkTextureFrameAvailable(textureId); + _shell->GetPlatformView()->MarkTextureFrameAvailable(textureId); } - (NSString*)lookupKeyForAsset:(NSString*)asset { - return [FlutterDartProject lookupKeyForAsset:asset]; + return [FlutterDartProject lookupKeyForAsset:asset]; } - (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { - return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; + return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h new file mode 100644 index 0000000000000..482379c8f17eb --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h @@ -0,0 +1,17 @@ +// Copyright 2017 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ + +#include "flutter/shell/common/shell.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" + +@interface FlutterViewController () + +- (shell::Shell&)shell; + +@end + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 3f96f37a9c2db..6a545b95e4276 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -427,7 +427,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { weak_factory_(this) { accessibility_channel_.reset([[FlutterBasicMessageChannel alloc] initWithName:@"flutter/accessibility" - binaryMessenger:platform_view->binary_messenger() + binaryMessenger:platform_view->GetOwnerViewController() codec:[FlutterStandardMessageCodec sharedInstance]]); [accessibility_channel_.get() setMessageHandler:^(id message, FlutterReply reply) { HandleEvent((NSDictionary*)message); @@ -440,7 +440,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { } UIView* AccessibilityBridge::textInputView() { - return [platform_view_->text_input_plugin() textInputView]; + return [platform_view_->GetTextInputPlugin() textInputView]; } void AccessibilityBridge::UpdateSemantics(blink::SemanticsNodeUpdates nodes) { diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h deleted file mode 100644 index f2e54dd2c2806..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ - -#include "lib/fxl/macros.h" - -namespace shell { - -/// Initializes the Flutter shell. This must be called before interacting with -/// the engine in any way. It is safe to call this method multiple times. -void FlutterMain(); - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm deleted file mode 100644 index aa7ad5fd85727..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" - -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" - -namespace shell { - -void FlutterMain() { - NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; - NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; - NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; - - NSBundle* mainBundle = [NSBundle mainBundle]; - NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:mainBundle]; - - shell::PlatformMacMain(icuDataPath.UTF8String, libraryName != nil ? libraryName.UTF8String : "", - flutterAssetsPath.UTF8String); -} - -} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h new file mode 100644 index 0000000000000..b861c5036e97d --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h @@ -0,0 +1,50 @@ +// Copyright 2018 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ + +#include + +#include "flutter/fml/platform/darwin/scoped_block.h" +#include "flutter/fml/task_runner.h" +#include "flutter/lib/ui/window/platform_message_response.h" +#include "flutter/shell/platform/darwin/common/buffer_conversions.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/macros.h" + +typedef void (^PlatformMessageResponseCallback)(NSData*); + +namespace shell { + +class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { + public: + void Complete(std::vector data) override { + fxl::RefPtr self(this); + platform_task_runner_->PostTask(fxl::MakeCopyable([self, data = std::move(data)]() mutable { + self->callback_.get()(shell::GetNSDataFromVector(data)); + })); + } + + void CompleteEmpty() override { + fxl::RefPtr self(this); + platform_task_runner_->PostTask( + fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); + } + + private: + explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback, + fxl::RefPtr platform_task_runner) + : callback_(callback, fml::OwnershipPolicy::Retain), + platform_task_runner_(std::move(platform_task_runner)) {} + + fml::ScopedBlock callback_; + fxl::RefPtr platform_task_runner_; + + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm new file mode 100644 index 0000000000000..8590b4e36942b --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm @@ -0,0 +1,11 @@ +// Copyright 2018 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/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" + +namespace shell { + +// + +} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.h b/shell/platform/darwin/ios/framework/Source/platform_message_router.h index cfa91c04771c3..d2488f82fe47c 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.h +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.h @@ -7,6 +7,7 @@ #include +#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterBinaryMessenger.h" #include "lib/fxl/memory/weak_ptr.h" @@ -18,13 +19,13 @@ class PlatformMessageRouter { PlatformMessageRouter(); ~PlatformMessageRouter(); - void HandlePlatformMessage(fxl::RefPtr message); + void HandlePlatformMessage(fxl::RefPtr message) const; void SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler); private: - std::unordered_map + std::unordered_map> message_handlers_; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter); diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm index 70625143b623e..3ab75bff522f8 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm @@ -14,7 +14,8 @@ PlatformMessageRouter::~PlatformMessageRouter() = default; -void PlatformMessageRouter::HandlePlatformMessage(fxl::RefPtr message) { +void PlatformMessageRouter::HandlePlatformMessage( + fxl::RefPtr message) const { fxl::RefPtr completer = message->response(); auto it = message_handlers_.find(message->channel()); if (it != message_handlers_.end()) { @@ -41,14 +42,10 @@ void PlatformMessageRouter::SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler) { - if (handler) - message_handlers_[channel] = [handler copy]; - else { - auto it = message_handlers_.find(channel); - if (it != message_handlers_.end()) { - [it->second release]; - message_handlers_.erase(it); - } + message_handlers_.erase(channel); + if (handler) { + message_handlers_[channel] = + fml::ScopedBlock{handler, fml::OwnershipPolicy::Retain}; } } diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h index 6a3362b215667..23aaf02510d6d 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h @@ -5,27 +5,26 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" -#if __OBJC__ @class VSyncClient; -#else // __OBJC__ -class VSyncClient; -#endif // __OBJC__ namespace shell { -class VsyncWaiterIOS : public VsyncWaiter { +class VsyncWaiterIOS final : public VsyncWaiter { public: - VsyncWaiterIOS(); - ~VsyncWaiterIOS() override; + VsyncWaiterIOS(blink::TaskRunners task_runners); - void AsyncWaitForVsync(Callback callback) override; + ~VsyncWaiterIOS() override; private: - Callback callback_; - VSyncClient* client_; + fml::scoped_nsobject client_; + + // |shell::VsyncWaiter| + void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterIOS); }; diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm index 78d6678189123..4589368acd3fb 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm @@ -10,29 +10,62 @@ #include #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @interface VSyncClient : NSObject +- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner + callback:(shell::VsyncWaiter::Callback)callback; + +- (void)await; + +- (void)invalidate; + @end +namespace shell { + +VsyncWaiterIOS::VsyncWaiterIOS(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)), + client_([[VSyncClient alloc] initWithTaskRunner:task_runners_.GetUITaskRunner() + callback:std::bind(&VsyncWaiterIOS::FireCallback, + this, + std::placeholders::_1, + std::placeholders::_2)]) {} + +VsyncWaiterIOS::~VsyncWaiterIOS() { + // This way, we will get no more callbacks from the display link that holds a weak (non-nilling) + // reference to this C++ object. + [client_.get() invalidate]; +} + +void VsyncWaiterIOS::AwaitVSync() { + [client_.get() await]; +} + +} // namespace shell + @implementation VSyncClient { - CADisplayLink* _displayLink; - shell::VsyncWaiter::Callback _pendingCallback; + shell::VsyncWaiter::Callback callback_; + fml::scoped_nsobject display_link_; } -- (instancetype)init { +- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner + callback:(shell::VsyncWaiter::Callback)callback { self = [super init]; if (self) { - _displayLink = - [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain]; - _displayLink.paused = YES; - - blink::Threads::UI()->PostTask([client = [self retain]]() { - [client->_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; + callback_ = std::move(callback); + display_link_ = fml::scoped_nsobject { + [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain] + }; + display_link_.get().paused = YES; + + task_runner->PostTask([client = [self retain]]() { + [client->display_link_.get() addToRunLoop:[NSRunLoop currentRunLoop] + forMode:NSRunLoopCommonModes]; [client release]; }); } @@ -40,68 +73,28 @@ - (instancetype)init { return self; } -- (void)await:(shell::VsyncWaiter::Callback)callback { - FXL_DCHECK(!_pendingCallback); - _pendingCallback = std::move(callback); - _displayLink.paused = NO; +- (void)await { + display_link_.get().paused = NO; } - (void)onDisplayLink:(CADisplayLink*)link { fxl::TimePoint frame_start_time = fxl::TimePoint::Now(); fxl::TimePoint frame_target_time = frame_start_time + fxl::TimeDelta::FromSecondsF(link.duration); - _displayLink.paused = YES; - - // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight - // Vsync" checkbox in the timeline can be enabled. - // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 - // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); -#else - { - fxl::TimeDelta delta = frame_target_time.ToEpochDelta(); - constexpr size_t num_chars = sizeof(int64_t) * CHAR_BIT * 3.4 + 2; - char deadline[num_chars]; - sprintf(deadline, "%lld", delta.ToMicroseconds()); - TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); - } -#endif - - // Note: Even though we know we are on the UI thread already (since the - // display link was scheduled on the UI thread in the contructor), we use - // the PostTask mechanism because the callback may have side-effects that need - // to be addressed via a task observer. Invoking the callback by itself - // bypasses such task observers. - // - // We are not using the PostTask for thread switching, but to make task - // observers work. - blink::Threads::UI()->PostTask([ - callback = _pendingCallback, frame_start_time, frame_target_time - ]() { callback(frame_start_time, frame_target_time); }); - - _pendingCallback = nullptr; + display_link_.get().paused = YES; + + callback_(frame_start_time, frame_target_time); +} + +- (void)invalidate { + // [CADisplayLink invalidate] is thread-safe. + [display_link_.get() invalidate]; } - (void)dealloc { - [_displayLink invalidate]; - [_displayLink release]; + [self invalidate]; [super dealloc]; } @end - -namespace shell { - -VsyncWaiterIOS::VsyncWaiterIOS() : client_([[VSyncClient alloc] init]) {} - -VsyncWaiterIOS::~VsyncWaiterIOS() { - [client_ release]; -} - -void VsyncWaiterIOS::AsyncWaitForVsync(Callback callback) { - [client_ await:callback]; -} - -} // namespace shell diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.h b/shell/platform/darwin/ios/ios_external_texture_gl.h index a658fdf31628a..baedf298bd61d 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.h +++ b/shell/platform/darwin/ios/ios_external_texture_gl.h @@ -25,6 +25,8 @@ class IOSExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; + virtual void MarkNewFrameAvailable() override; + private: NSObject* external_texture_; fml::CFRef cache_ref_; diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.mm b/shell/platform/darwin/ios/ios_external_texture_gl.mm index 2cc9721e7f09a..0bd9a8ca3c7cb 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.mm +++ b/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -4,11 +4,10 @@ #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" -#include +#import #import #import -#include "flutter/common/threads.h" -#include "flutter/lib/ui/painting/resource_context.h" + #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" @@ -26,7 +25,6 @@ IOSExternalTextureGL::~IOSExternalTextureGL() = default; void IOSExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { - ASSERT_IS_GPU_THREAD; if (!cache_ref_) { CVOpenGLESTextureCacheRef cache; CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, @@ -57,10 +55,8 @@ return; } GrGLTextureInfo textureInfo = {CVOpenGLESTextureGetTarget(texture_ref_), - CVOpenGLESTextureGetName(texture_ref_), - GL_RGBA8_OES}; - GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, - textureInfo); + CVOpenGLESTextureGetName(texture_ref_), GL_RGBA8_OES}; + GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, textureInfo); sk_sp image = SkImage::MakeFromTexture(canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr); @@ -69,14 +65,13 @@ GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kN } } -void IOSExternalTextureGL::OnGrContextCreated() { - ASSERT_IS_GPU_THREAD -} +void IOSExternalTextureGL::OnGrContextCreated() {} void IOSExternalTextureGL::OnGrContextDestroyed() { - ASSERT_IS_GPU_THREAD texture_ref_.Reset(nullptr); cache_ref_.Reset(nullptr); } +void IOSExternalTextureGL::MarkNewFrameAvailable() {} + } // namespace shell diff --git a/shell/platform/darwin/ios/ios_gl_context.h b/shell/platform/darwin/ios/ios_gl_context.h index 89ad7e0347eac..f42c1436461b1 100644 --- a/shell/platform/darwin/ios/ios_gl_context.h +++ b/shell/platform/darwin/ios/ios_gl_context.h @@ -18,7 +18,7 @@ namespace shell { class IOSGLContext { public: - IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer); + IOSGLContext(fml::scoped_nsobject layer); ~IOSGLContext(); diff --git a/shell/platform/darwin/ios/ios_gl_context.mm b/shell/platform/darwin/ios/ios_gl_context.mm index de94018d0689e..77a124e64a291 100644 --- a/shell/platform/darwin/ios/ios_gl_context.mm +++ b/shell/platform/darwin/ios/ios_gl_context.mm @@ -3,21 +3,17 @@ // found in the LICENSE file. #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" -#include "third_party/skia/include/gpu/GrContextOptions.h" -#include "third_party/skia/include/gpu/gl/GrGLInterface.h" #include -namespace shell { +#include "flutter/fml/trace_event.h" +#include "third_party/skia/include/gpu/GrContextOptions.h" +#include "third_party/skia/include/gpu/gl/GrGLInterface.h" -#define VERIFY(x) \ - if (!(x)) { \ - FXL_DLOG(ERROR) << "Failed: " #x; \ - return; \ - }; +namespace shell { -IOSGLContext::IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer) - : layer_([layer retain]), +IOSGLContext::IOSGLContext(fml::scoped_nsobject layer) + : layer_(std::move(layer)), context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]), resource_context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:context_.get().sharegroup]), @@ -26,34 +22,34 @@ storage_size_width_(0), storage_size_height_(0), valid_(false) { - VERIFY(layer_ != nullptr); - VERIFY(context_ != nullptr); - VERIFY(resource_context_ != nullptr); + FXL_DCHECK(layer_ != nullptr); + FXL_DCHECK(context_ != nullptr); + FXL_DCHECK(resource_context_ != nullptr); bool context_current = [EAGLContext setCurrentContext:context_]; - VERIFY(context_current); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(context_current); + FXL_DCHECK(glGetError() == GL_NO_ERROR); // Generate the framebuffer glGenFramebuffers(1, &framebuffer_); - VERIFY(glGetError() == GL_NO_ERROR); - VERIFY(framebuffer_ != GL_NONE); + FXL_DCHECK(glGetError() == GL_NO_ERROR); + FXL_DCHECK(framebuffer_ != GL_NONE); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(glGetError() == GL_NO_ERROR); // Setup color attachment glGenRenderbuffers(1, &colorbuffer_); - VERIFY(colorbuffer_ != GL_NONE); + FXL_DCHECK(colorbuffer_ != GL_NONE); glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(glGetError() == GL_NO_ERROR); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorbuffer_); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(glGetError() == GL_NO_ERROR); // TODO: // iOS displays are more variable than just P3 or sRGB. Reading the display @@ -139,24 +135,12 @@ return false; } - GLint width = 0; - GLint height = 0; - - if (colorbuffer_ != GL_NONE) { - // Fetch the dimensions of the color buffer whose backing was just updated - // so that backing of the attachments can be updated - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - - glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - } + // Fetch the dimensions of the color buffer whose backing was just updated. + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &storage_size_width_); + FXL_DCHECK(glGetError() == GL_NO_ERROR); - storage_size_width_ = width; - storage_size_height_ = height; + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &storage_size_height_); + FXL_DCHECK(glGetError() == GL_NO_ERROR); FXL_DCHECK(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); diff --git a/shell/platform/darwin/ios/ios_surface.h b/shell/platform/darwin/ios/ios_surface.h index c164fab15500e..b629c2709e3d1 100644 --- a/shell/platform/darwin/ios/ios_surface.h +++ b/shell/platform/darwin/ios/ios_surface.h @@ -5,25 +5,17 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ +#include + #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/surface.h" #include "lib/fxl/macros.h" -@class CALayer; - namespace shell { class IOSSurface { public: - static std::unique_ptr Create( - PlatformView::SurfaceConfig surface_config, - CALayer* layer); - - IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer); - - CALayer* GetLayer() const; - - PlatformView::SurfaceConfig GetSurfaceConfig() const; + IOSSurface(); virtual ~IOSSurface(); @@ -36,9 +28,6 @@ class IOSSurface { virtual std::unique_ptr CreateGPUSurface() = 0; public: - PlatformView::SurfaceConfig surface_config_; - fml::scoped_nsobject layer_; - FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurface); }; diff --git a/shell/platform/darwin/ios/ios_surface.mm b/shell/platform/darwin/ios/ios_surface.mm index 91067838330f6..b0b9cc3245183 100644 --- a/shell/platform/darwin/ios/ios_surface.mm +++ b/shell/platform/darwin/ios/ios_surface.mm @@ -4,40 +4,15 @@ #include "flutter/shell/platform/darwin/ios/ios_surface.h" -#include -#include #include -@class CALayer; -@class CAEAGLLayer; +#include +#include namespace shell { -std::unique_ptr IOSSurface::Create(PlatformView::SurfaceConfig surface_config, - CALayer* layer) { - // Check if we can use OpenGL. - if ([layer isKindOfClass:[CAEAGLLayer class]]) { - return std::make_unique(surface_config, reinterpret_cast(layer)); - } - - // If we ever support the metal rendering API, a check for CAMetalLayer would - // go here. - - // Finally, fallback to software rendering. - return std::make_unique(surface_config, layer); -} - -IOSSurface::IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer) - : surface_config_(surface_config), layer_([layer retain]) {} +IOSSurface::IOSSurface() = default; IOSSurface::~IOSSurface() = default; -CALayer* IOSSurface::GetLayer() const { - return layer_; -} - -PlatformView::SurfaceConfig IOSSurface::GetSurfaceConfig() const { - return surface_config_; -} - } // namespace shell diff --git a/shell/platform/darwin/ios/ios_surface_gl.h b/shell/platform/darwin/ios/ios_surface_gl.h index f7e43e2588984..7486d343eb0fd 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.h +++ b/shell/platform/darwin/ios/ios_surface_gl.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" @@ -16,7 +17,7 @@ namespace shell { class IOSSurfaceGL : public IOSSurface, public GPUSurfaceGLDelegate { public: - IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer); + IOSSurfaceGL(fml::scoped_nsobject layer); ~IOSSurfaceGL() override; diff --git a/shell/platform/darwin/ios/ios_surface_gl.mm b/shell/platform/darwin/ios/ios_surface_gl.mm index 60756d6094fc9..253531c4800aa 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/shell/platform/darwin/ios/ios_surface_gl.mm @@ -4,13 +4,12 @@ #include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" +#include "flutter/fml/trace_event.h" #include "flutter/shell/gpu/gpu_surface_gl.h" namespace shell { -IOSSurfaceGL::IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer) - : IOSSurface(surface_config, reinterpret_cast(layer)), - context_(surface_config, layer) {} +IOSSurfaceGL::IOSSurfaceGL(fml::scoped_nsobject layer) : context_(std::move(layer)) {} IOSSurfaceGL::~IOSSurfaceGL() = default; diff --git a/shell/platform/darwin/ios/ios_surface_software.h b/shell/platform/darwin/ios/ios_surface_software.h index 7e3f264b28ce6..e8fc332f06c8c 100644 --- a/shell/platform/darwin/ios/ios_surface_software.h +++ b/shell/platform/darwin/ios/ios_surface_software.h @@ -5,17 +5,19 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_software.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/macros.h" +@class CALayer; + namespace shell { -class IOSSurfaceSoftware : public IOSSurface, - public GPUSurfaceSoftwareDelegate { +class IOSSurfaceSoftware final : public IOSSurface, + public GPUSurfaceSoftwareDelegate { public: - IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, - CALayer* layer); + IOSSurfaceSoftware(fml::scoped_nsobject layer); ~IOSSurfaceSoftware() override; @@ -32,6 +34,7 @@ class IOSSurfaceSoftware : public IOSSurface, bool PresentBackingStore(sk_sp backing_store) override; private: + fml::scoped_nsobject layer_; sk_sp sk_surface_; FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware); diff --git a/shell/platform/darwin/ios/ios_surface_software.mm b/shell/platform/darwin/ios/ios_surface_software.mm index 9a4e90e45dfba..b09a5d9a2d8a3 100644 --- a/shell/platform/darwin/ios/ios_surface_software.mm +++ b/shell/platform/darwin/ios/ios_surface_software.mm @@ -15,15 +15,15 @@ namespace shell { -IOSSurfaceSoftware::IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, CALayer* layer) - : IOSSurface(surface_config, layer) { +IOSSurfaceSoftware::IOSSurfaceSoftware(fml::scoped_nsobject layer) + : layer_(std::move(layer)) { UpdateStorageSizeIfNecessary(); } IOSSurfaceSoftware::~IOSSurfaceSoftware() = default; bool IOSSurfaceSoftware::IsValid() const { - return GetLayer() != nullptr; + return layer_; } bool IOSSurfaceSoftware::ResourceContextMakeCurrent() { @@ -120,8 +120,7 @@ return false; } - CALayer* layer = GetLayer(); - layer.contents = reinterpret_cast(static_cast(pixmap_image)); + layer_.get().contents = reinterpret_cast(static_cast(pixmap_image)); return true; } diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index dab19a0f9ce1a..e7849dda44641 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -8,95 +8,66 @@ #include #include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h" #include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" -@class CALayer; -@class UIView; - namespace shell { -class PlatformViewIOS : public PlatformView { +class PlatformViewIOS final : public PlatformView { public: - explicit PlatformViewIOS(CALayer* layer, - NSObject* binaryMessenger); + explicit PlatformViewIOS(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + FlutterViewController* owner_controller_, + FlutterView* owner_view_); ~PlatformViewIOS() override; - void Attach() override; - - void Attach(fxl::Closure firstFrameCallback); - - void NotifyCreated(); - - void ToggleAccessibility(UIView* view, bool enabled); - - PlatformMessageRouter& platform_message_router() { - return platform_message_router_; - } - - fml::WeakPtr GetWeakPtr(); - - void UpdateSurfaceSize(); + PlatformMessageRouter& GetPlatformMessageRouter(); - VsyncWaiter* GetVsyncWaiter() override; - - bool ResourceContextMakeCurrent() override; - - void HandlePlatformMessage( - fxl::RefPtr message) override; + FlutterViewController* GetOwnerViewController() const; void RegisterExternalTexture(int64_t id, NSObject* texture); - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; + fml::scoped_nsprotocol GetTextInputPlugin() const; - void SetAssetBundlePath(const std::string& assets_directory) override; - - /** - * Exposes the `FlutterTextInputPlugin` singleton for the - * `AccessibilityBridge` to be able to interact with the text entry system. - */ - fml::scoped_nsprotocol text_input_plugin() { - return text_input_plugin_; - } - - /** - * Sets the `FlutterTextInputPlugin` singleton returned by - * `text_input_plugin`. - */ void SetTextInputPlugin( - fml::scoped_nsprotocol textInputPlugin) { - text_input_plugin_ = textInputPlugin; - } - - NSObject* binary_messenger() const { - return binary_messenger_; - } + fml::scoped_nsprotocol plugin); private: + FlutterViewController* owner_controller_; // weak reference. + FlutterView* owner_view_; // weak reference. std::unique_ptr ios_surface_; PlatformMessageRouter platform_message_router_; std::unique_ptr accessibility_bridge_; - fxl::Closure firstFrameCallback_; - fml::WeakPtrFactory weak_factory_; - NSObject* binary_messenger_; fml::scoped_nsprotocol text_input_plugin_; + fxl::Closure firstFrameCallback_; + + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; - void SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages); + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; + + // |shell::PlatformView| + void SetSemanticsEnabled(bool enabled) override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; + + // |shell::PlatformView| + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - void SetAssetBundlePathOnUI(const std::string& assets_directory); + // |shell::PlatformView| + std::unique_ptr CreateVSyncWaiter() override; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewIOS); }; diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index 19c5dd4e663a1..1fba8e5e026e5 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -8,135 +8,92 @@ #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" -#include "flutter/shell/platform/darwin/common/process_info_mac.h" +#include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewIOS::PlatformViewIOS(CALayer* layer, NSObject* binaryMessenger) - : PlatformView(std::make_unique(std::make_unique())), - ios_surface_(IOSSurface::Create(surface_config_, layer)), - weak_factory_(this), - binary_messenger_(binaryMessenger) {} - -PlatformViewIOS::~PlatformViewIOS() = default; - -void PlatformViewIOS::Attach() { - Attach(NULL); +PlatformViewIOS::PlatformViewIOS(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + FlutterViewController* owner_controller, + FlutterView* owner_view) + : PlatformView(delegate, std::move(task_runners)), + owner_controller_(owner_controller), + owner_view_(owner_view), + ios_surface_(owner_view_.createSurface) { + FXL_DCHECK(ios_surface_ != nullptr); + FXL_DCHECK(owner_controller_ != nullptr); + FXL_DCHECK(owner_view_ != nullptr); } -void PlatformViewIOS::Attach(fxl::Closure firstFrameCallback) { - CreateEngine(); - - if (firstFrameCallback) { - firstFrameCallback_ = firstFrameCallback; - rasterizer_->AddNextFrameCallback([weakSelf = GetWeakPtr()] { - if (weakSelf) { - weakSelf->firstFrameCallback_(); - weakSelf->firstFrameCallback_ = nullptr; - } - }); - } -} +PlatformViewIOS::~PlatformViewIOS() = default; -void PlatformViewIOS::NotifyCreated() { - PlatformView::NotifyCreated(ios_surface_->CreateGPUSurface()); +FlutterViewController* PlatformViewIOS::GetOwnerViewController() const { + return owner_controller_; } -void PlatformViewIOS::ToggleAccessibility(UIView* view, bool enabled) { - if (enabled) { - if (!accessibility_bridge_) { - accessibility_bridge_.reset(new shell::AccessibilityBridge(view, this)); - } - } else { - accessibility_bridge_ = nullptr; - } - SetSemanticsEnabled(enabled); +PlatformMessageRouter& PlatformViewIOS::GetPlatformMessageRouter() { + return platform_message_router_; } -void PlatformViewIOS::SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - blink::Threads::UI()->PostTask( - [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { - if (engine) - engine->RunBundleAndSource(assets_directory, main, packages); - }); +void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, + NSObject* texture) { + RegisterTexture(std::make_shared(texture_id, texture)); } -void PlatformViewIOS::SetAssetBundlePathOnUI(const std::string& assets_directory) { - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { - if (engine) - engine->SetAssetBundlePath(assets_directory); - }); +// |shell::PlatformView| +std::unique_ptr PlatformViewIOS::CreateRenderingSurface() { + return ios_surface_->CreateGPUSurface(); } -fml::WeakPtr PlatformViewIOS::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} +// |shell::PlatformView| +sk_sp PlatformViewIOS::CreateResourceContext() const { + if (!ios_surface_->ResourceContextMakeCurrent()) { + FXL_DLOG(INFO) << "Could not make resource context current on IO thread. Async texture uploads " + "will be disabled."; + return nullptr; + } -void PlatformViewIOS::UpdateSurfaceSize() { - blink::Threads::Gpu()->PostTask([self = GetWeakPtr()]() { - if (self && self->ios_surface_ != nullptr) { - self->ios_surface_->UpdateStorageSizeIfNecessary(); - } - }); + return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); } -VsyncWaiter* PlatformViewIOS::GetVsyncWaiter() { - if (!vsync_waiter_) { - vsync_waiter_ = std::make_unique(); +// |shell::PlatformView| +void PlatformViewIOS::SetSemanticsEnabled(bool enabled) { + if (enabled && !accessibility_bridge_) { + accessibility_bridge_ = std::make_unique(owner_view_, this); + } else { + accessibility_bridge_.reset(); } - return vsync_waiter_.get(); -} - -bool PlatformViewIOS::ResourceContextMakeCurrent() { - return ios_surface_ != nullptr ? ios_surface_->ResourceContextMakeCurrent() : false; + PlatformView::SetSemanticsEnabled(enabled); } +// |shell::PlatformView| void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update) { - if (accessibility_bridge_) + if (accessibility_bridge_) { accessibility_bridge_->UpdateSemantics(std::move(update)); + } } +// |shell::PlatformView| void PlatformViewIOS::HandlePlatformMessage(fxl::RefPtr message) { platform_message_router_.HandlePlatformMessage(std::move(message)); } -void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, - NSObject* texture) { - RegisterTexture(std::make_shared(texture_id, texture)); +// |shell::PlatformView| +std::unique_ptr PlatformViewIOS::CreateVSyncWaiter() { + return std::make_unique(task_runners_); } -void PlatformViewIOS::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetupAndLoadFromSource(assets_directory, main, packages); - latch->Signal(); - }); - - latch->Wait(); - delete latch; +fml::scoped_nsprotocol PlatformViewIOS::GetTextInputPlugin() const { + return text_input_plugin_; } -void PlatformViewIOS::SetAssetBundlePath(const std::string& assets_directory) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetAssetBundlePathOnUI(assets_directory); - latch->Signal(); - }); - - latch->Wait(); - delete latch; +void PlatformViewIOS::SetTextInputPlugin(fml::scoped_nsprotocol plugin) { + text_input_plugin_ = plugin; } } // namespace shell diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 7ce6f7e8d5be1..b1e0b3e4f3b71 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -4,16 +4,21 @@ import("$flutter_root/testing/testing.gni") -source_set("embedder") { +static_library("embedder") { + complete_static_lib = true + sources = [ "embedder.cc", "embedder.h", + "embedder_engine.cc", + "embedder_engine.h", "embedder_include.c", "platform_view_embedder.cc", "platform_view_embedder.h", ] deps = [ + "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", @@ -22,6 +27,7 @@ source_set("embedder") { "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", + "//third_party/skia:gpu", "//topaz/lib/tonic", ] diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 866413cbc077b..a7ee807934663 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -2,14 +2,30 @@ // 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 "lib/fxl/build_config.h" + +#if OS_WIN +#define FLUTTER_EXPORT __declspec(dllexport) +#else // OS_WIN #define FLUTTER_EXPORT __attribute__((visibility("default"))) +#endif // OS_WIN #include "flutter/shell/platform/embedder/embedder.h" #include -#include "flutter/common/threads.h" + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/common/task_runners.h" +#include "flutter/fml/file.h" #include "flutter/fml/message_loop.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/platform/embedder/embedder.h" +#include "flutter/shell/platform/embedder/embedder_engine.h" #include "flutter/shell/platform/embedder/platform_view_embedder.h" +#include "lib/fxl/command_line.h" #include "lib/fxl/functional/make_copyable.h" #define SAFE_ACCESS(pointer, member, default_value) \ @@ -41,21 +57,6 @@ bool IsRendererValid(const FlutterRendererConfig* config) { return true; } -class PlatformViewHolder { - public: - PlatformViewHolder(std::shared_ptr ptr) - : platform_view_(std::move(ptr)) {} - - std::shared_ptr view() const { - return platform_view_; - } - - private: - std::shared_ptr platform_view_; - - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewHolder); -}; - struct _FlutterPlatformMessageResponseHandle { fxl::RefPtr message; }; @@ -65,6 +66,7 @@ FlutterResult FlutterEngineRun(size_t version, const FlutterProjectArgs* args, void* user_data, FlutterEngine* engine_out) { + // Step 0: Figure out arguments for shell creation. if (version != FLUTTER_ENGINE_VERSION) { return kInvalidLibraryVersion; } @@ -87,51 +89,44 @@ FlutterResult FlutterEngineRun(size_t version, return kInvalidArguments; } - auto make_current = - [ ptr = config->open_gl.make_current, user_data ]()->bool { - return ptr(user_data); - }; + auto make_current = [ptr = config->open_gl.make_current, + user_data]() -> bool { return ptr(user_data); }; - auto clear_current = - [ ptr = config->open_gl.clear_current, user_data ]()->bool { - return ptr(user_data); - }; + auto clear_current = [ptr = config->open_gl.clear_current, + user_data]() -> bool { return ptr(user_data); }; - auto present = [ ptr = config->open_gl.present, user_data ]()->bool { + auto present = [ptr = config->open_gl.present, user_data]() -> bool { return ptr(user_data); }; - auto fbo_callback = - [ ptr = config->open_gl.fbo_callback, user_data ]()->intptr_t { - return ptr(user_data); - }; + auto fbo_callback = [ptr = config->open_gl.fbo_callback, + user_data]() -> intptr_t { return ptr(user_data); }; shell::PlatformViewEmbedder::PlatformMessageResponseCallback platform_message_response_callback = nullptr; if (SAFE_ACCESS(args, platform_message_callback, nullptr) != nullptr) { platform_message_response_callback = - [ ptr = args->platform_message_callback, - user_data ](fxl::RefPtr message) { - auto handle = new FlutterPlatformMessageResponseHandle(); - const FlutterPlatformMessage incoming_message = { - .struct_size = sizeof(FlutterPlatformMessage), - .channel = message->channel().c_str(), - .message = message->data().data(), - .message_size = message->data().size(), - .response_handle = handle, - }; - handle->message = std::move(message); - return ptr(&incoming_message, user_data); - }; + [ptr = args->platform_message_callback, + user_data](fxl::RefPtr message) { + auto handle = new FlutterPlatformMessageResponseHandle(); + const FlutterPlatformMessage incoming_message = { + .struct_size = sizeof(FlutterPlatformMessage), + .channel = message->channel().c_str(), + .message = message->data().data(), + .message_size = message->data().size(), + .response_handle = handle, + }; + handle->message = std::move(message); + return ptr(&incoming_message, user_data); + }; } const FlutterOpenGLRendererConfig* open_gl_config = &config->open_gl; std::function make_resource_current_callback = nullptr; if (SAFE_ACCESS(open_gl_config, make_resource_current, nullptr) != nullptr) { - make_resource_current_callback = - [ ptr = config->open_gl.make_resource_current, user_data ]() { - return ptr(user_data); - }; + make_resource_current_callback = [ptr = + config->open_gl.make_resource_current, + user_data]() { return ptr(user_data); }; } std::string icu_data_path; @@ -147,18 +142,33 @@ FlutterResult FlutterEngineRun(size_t version, SAFE_ACCESS(args, command_line_argv, nullptr)); } - static std::once_flag once_shell_initialization; - std::call_once(once_shell_initialization, [&]() { - fxl::CommandLine null_command_line; - shell::Shell::InitStandalone( - std::move(command_line), - icu_data_path, // icu data path default lookup. - "", // application library not supported in JIT mode. - args->assets_path - ); - }); - - shell::PlatformViewEmbedder::DispatchTable table = { + blink::Settings settings = shell::SettingsFromCommandLine(command_line); + settings.icu_data_path = icu_data_path; + settings.main_dart_file_path = args->main_path; + settings.packages_file_path = args->packages_path; + settings.assets_path = args->assets_path; + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + // Create a thread host with the current thread as the platform thread and all + // other threads managed. + shell::ThreadHost thread_host("io.flutter", shell::ThreadHost::Type::GPU | + shell::ThreadHost::Type::IO | + shell::ThreadHost::Type::UI); + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::TaskRunners task_runners( + "io.flutter", + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + thread_host.gpu_thread->GetTaskRunner(), // gpu + thread_host.ui_thread->GetTaskRunner(), // ui + thread_host.io_thread->GetTaskRunner() // io + ); + + shell::PlatformViewEmbedder::DispatchTable dispatch_table = { .gl_make_current_callback = make_current, .gl_clear_current_callback = clear_current, .gl_present_callback = present, @@ -167,31 +177,55 @@ FlutterResult FlutterEngineRun(size_t version, .gl_make_resource_current_callback = make_resource_current_callback, }; - auto platform_view = std::make_shared(table); - platform_view->Attach(); - - std::string assets(args->assets_path); - std::string main(args->main_path); - std::string packages(args->packages_path); - - blink::Threads::UI()->PostTask([ - weak_engine = platform_view->engine().GetWeakPtr(), // - assets = std::move(assets), // - main = std::move(main), // - packages = std::move(packages) // - ] { - if (auto engine = weak_engine) { - if (main.empty()) { - engine->RunBundle(assets); - } else { - engine->RunBundleAndSource(assets, main, packages); - } - } - }); - - *engine_out = reinterpret_cast( - new PlatformViewHolder(std::move(platform_view))); + shell::Shell::CreateCallback on_create_platform_view = + [dispatch_table](shell::Shell& shell) { + return std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + dispatch_table // embedder dispatch table + ); + }; + + shell::Shell::CreateCallback on_create_rasterizer = + [](shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // Step 1: Create the engine. + auto embedder_engine = + std::make_unique(std::move(thread_host), // + std::move(task_runners), // + settings, // + on_create_platform_view, // + on_create_rasterizer // + ); + + if (!embedder_engine->IsValid()) { + return kInvalidArguments; + } + + // Step 2: Setup the rendering surface. + if (!embedder_engine->NotifyCreated()) { + return kInvalidArguments; + } + + // Step 3: Run the engine. + auto run_configuration = shell::RunConfiguration::InferFromSettings(settings); + + run_configuration.AddAssetResolver( + std::make_unique( + fml::Duplicate(settings.assets_dir))); + run_configuration.AddAssetResolver( + std::make_unique(fml::OpenFile( + settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); + + if (!embedder_engine->Run(std::move(run_configuration))) { + return kInvalidArguments; + } + + // Finally! Release the ownership of the embedder engine to the caller. + *engine_out = reinterpret_cast(embedder_engine.release()); return kSuccess; } @@ -199,7 +233,9 @@ FlutterResult FlutterEngineShutdown(FlutterEngine engine) { if (engine == nullptr) { return kInvalidArguments; } - delete reinterpret_cast(engine); + auto embedder_engine = reinterpret_cast(engine); + embedder_engine->NotifyDestroyed(); + delete embedder_engine; return kSuccess; } @@ -210,21 +246,16 @@ FlutterResult FlutterEngineSendWindowMetricsEvent( return kInvalidArguments; } - auto holder = reinterpret_cast(engine); - blink::ViewportMetrics metrics; metrics.physical_width = SAFE_ACCESS(flutter_metrics, width, 0.0); metrics.physical_height = SAFE_ACCESS(flutter_metrics, height, 0.0); metrics.device_pixel_ratio = SAFE_ACCESS(flutter_metrics, pixel_ratio, 1.0); - blink::Threads::UI()->PostTask( - [ weak_engine = holder->view()->engine().GetWeakPtr(), metrics ] { - if (auto engine = weak_engine) { - engine->SetViewportMetrics(metrics); - } - }); - return kSuccess; + return reinterpret_cast(engine)->SetViewportMetrics( + std::move(metrics)) + ? kSuccess + : kInvalidArguments; } inline blink::PointerData::Change ToPointerDataChange( @@ -267,19 +298,10 @@ FlutterResult FlutterEngineSendPointerEvent(FlutterEngine engine, reinterpret_cast(current) + current->struct_size); } - blink::Threads::UI()->PostTask(fxl::MakeCopyable([ - weak_engine = reinterpret_cast(engine) - ->view() - ->engine() - .GetWeakPtr(), - packet = std::move(packet) - ] { - if (auto engine = weak_engine) { - engine->DispatchPointerDataPacket(*packet); - } - })); - - return kSuccess; + return reinterpret_cast(engine) + ->DispatchPointerDataPacket(std::move(packet)) + ? kSuccess + : kInvalidArguments; } FlutterResult FlutterEngineSendPlatformMessage( @@ -294,8 +316,6 @@ FlutterResult FlutterEngineSendPlatformMessage( return kInvalidArguments; } - auto holder = reinterpret_cast(engine); - auto message = fxl::MakeRefCounted( flutter_message->channel, std::vector( @@ -303,13 +323,10 @@ FlutterResult FlutterEngineSendPlatformMessage( flutter_message->message + flutter_message->message_size), nullptr); - blink::Threads::UI()->PostTask( - [ weak_engine = holder->view()->engine().GetWeakPtr(), message ] { - if (auto engine = weak_engine) { - engine->DispatchPlatformMessage(message); - } - }); - return kSuccess; + return reinterpret_cast(engine)->SendPlatformMessage( + std::move(message)) + ? kSuccess + : kInvalidArguments; } FlutterResult FlutterEngineSendPlatformMessageResponse( diff --git a/shell/platform/embedder/embedder_engine.cc b/shell/platform/embedder/embedder_engine.cc new file mode 100644 index 0000000000000..7416441d7902e --- /dev/null +++ b/shell/platform/embedder/embedder_engine.cc @@ -0,0 +1,119 @@ +// Copyright 2017 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/shell/platform/embedder/embedder_engine.h" + +#include "lib/fxl/functional/make_copyable.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace shell { + +EmbedderEngine::EmbedderEngine( + ThreadHost thread_host, + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) + : thread_host_(std::move(thread_host)), + shell_(Shell::Create(std::move(task_runners), + std::move(settings), + on_create_platform_view, + on_create_rasterizer)) { + is_valid_ = shell_ != nullptr; +} + +EmbedderEngine::~EmbedderEngine() = default; + +bool EmbedderEngine::IsValid() const { + return is_valid_; +} + +bool EmbedderEngine::NotifyCreated() { + if (!IsValid()) { + return false; + } + + shell_->GetPlatformView()->NotifyCreated(); + return true; +} + +bool EmbedderEngine::NotifyDestroyed() { + if (!IsValid()) { + return false; + } + + shell_->GetPlatformView()->NotifyDestroyed(); + return true; +} + +bool EmbedderEngine::Run(RunConfiguration run_configuration) { + if (!IsValid()) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = shell_->GetEngine(), // engine + config = std::move(run_configuration) // config + ]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch the engine with configuration."; + } + } + })); + + return true; +} + +bool EmbedderEngine::SetViewportMetrics(blink::ViewportMetrics metrics) { + if (!IsValid()) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), metrics = std::move(metrics)]() { + if (engine) { + engine->SetViewportMetrics(std::move(metrics)); + } + }); + return true; +} + +bool EmbedderEngine::DispatchPointerDataPacket( + std::unique_ptr packet) { + if (!IsValid() || !packet) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = shell_->GetEngine(), packet = std::move(packet)] { + if (engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); + + return true; +} + +bool EmbedderEngine::SendPlatformMessage( + fxl::RefPtr message) { + if (!IsValid() || !message) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), message] { + if (engine) { + engine->DispatchPlatformMessage(message); + } + }); + + return true; +} + +} // namespace shell diff --git a/shell/platform/embedder/embedder_engine.h b/shell/platform/embedder/embedder_engine.h new file mode 100644 index 0000000000000..c01b86c2aac47 --- /dev/null +++ b/shell/platform/embedder/embedder_engine.h @@ -0,0 +1,53 @@ +// Copyright 2017 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_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ +#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ + +#include + +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/embedder/embedder.h" +#include "lib/fxl/macros.h" + +namespace shell { + +// The object that is returned to the embedder as an opaque pointer to the +// instance of the Flutter engine. +class EmbedderEngine { + public: + EmbedderEngine(ThreadHost thread_host, blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer); + + ~EmbedderEngine(); + + bool NotifyCreated(); + + bool NotifyDestroyed(); + + bool Run(RunConfiguration run_configuration); + + bool IsValid() const; + + bool SetViewportMetrics(blink::ViewportMetrics metrics); + + bool DispatchPointerDataPacket( + std::unique_ptr packet); + + bool SendPlatformMessage(fxl::RefPtr message); + + private: + const ThreadHost thread_host_; + std::unique_ptr shell_; + bool is_valid_ = false; + + FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderEngine); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ diff --git a/shell/platform/embedder/platform_view_embedder.cc b/shell/platform/embedder/platform_view_embedder.cc index 46e0390770da4..db1bea35c691e 100644 --- a/shell/platform/embedder/platform_view_embedder.cc +++ b/shell/platform/embedder/platform_view_embedder.cc @@ -3,17 +3,18 @@ // found in the LICENSE file. #include "flutter/shell/platform/embedder/platform_view_embedder.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" + +#include "flutter/shell/common/io_manager.h" namespace shell { -PlatformViewEmbedder::PlatformViewEmbedder(DispatchTable dispatch_table) - : PlatformView(std::make_unique(nullptr)), +PlatformViewEmbedder::PlatformViewEmbedder(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + DispatchTable dispatch_table) + : PlatformView(delegate, std::move(task_runners)), dispatch_table_(dispatch_table) {} -PlatformViewEmbedder::~PlatformViewEmbedder() { - NotifyDestroyed(); -} +PlatformViewEmbedder::~PlatformViewEmbedder() = default; bool PlatformViewEmbedder::GLContextMakeCurrent() { return dispatch_table_.gl_make_current_callback(); @@ -31,33 +32,6 @@ intptr_t PlatformViewEmbedder::GLContextFBO() const { return dispatch_table_.gl_fbo_callback(); } -void PlatformViewEmbedder::Attach() { - CreateEngine(); - NotifyCreated(std::make_unique(this)); - - if (dispatch_table_.gl_make_resource_current_callback != nullptr) { - SetupResourceContextOnIOThread(); - } -} - -bool PlatformViewEmbedder::ResourceContextMakeCurrent() { - if (dispatch_table_.gl_make_resource_current_callback == nullptr) { - return false; - } - return dispatch_table_.gl_make_resource_current_callback(); -} - -void PlatformViewEmbedder::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - FXL_LOG(INFO) << "Hot reloading is unsupported on this platform."; -} - -void PlatformViewEmbedder::SetAssetBundlePath( - const std::string& assets_directory) { - FXL_LOG(INFO) << "Set asset bundle path is unsupported on this platform."; -} - void PlatformViewEmbedder::HandlePlatformMessage( fxl::RefPtr message) { if (!message) { @@ -76,4 +50,17 @@ void PlatformViewEmbedder::HandlePlatformMessage( dispatch_table_.platform_message_response_callback(std::move(message)); } +std::unique_ptr PlatformViewEmbedder::CreateRenderingSurface() { + return std::make_unique(this); +} + +sk_sp PlatformViewEmbedder::CreateResourceContext() const { + auto callback = dispatch_table_.gl_make_resource_current_callback; + if (callback && callback()) { + return IOManager::CreateCompatibleResourceLoadingContext( + GrBackend::kOpenGL_GrBackend); + } + return nullptr; +} + } // namespace shell diff --git a/shell/platform/embedder/platform_view_embedder.h b/shell/platform/embedder/platform_view_embedder.h index c287fc5ac86f1..a5b76dfaa07ba 100644 --- a/shell/platform/embedder/platform_view_embedder.h +++ b/shell/platform/embedder/platform_view_embedder.h @@ -12,7 +12,8 @@ namespace shell { -class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { +class PlatformViewEmbedder final : public PlatformView, + public GPUSurfaceGLDelegate { public: using PlatformMessageResponseCallback = std::function)>; @@ -26,9 +27,11 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { std::function gl_make_resource_current_callback; // optional }; - PlatformViewEmbedder(DispatchTable dispatch_table); + PlatformViewEmbedder(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + DispatchTable dispatch_table); - ~PlatformViewEmbedder(); + ~PlatformViewEmbedder() override; // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; @@ -42,20 +45,6 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { // |shell::GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; - // |shell::PlatformView| - void Attach() override; - - // |shell::PlatformView| - bool ResourceContextMakeCurrent() override; - - // |shell::PlatformView| - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - // |shell::PlatformView| - void SetAssetBundlePath(const std::string& assets_directory) override; - // |shell::PlatformView| void HandlePlatformMessage( fxl::RefPtr message) override; @@ -63,6 +52,12 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { private: DispatchTable dispatch_table_; + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; + + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewEmbedder); }; diff --git a/shell/platform/linux/BUILD.gn b/shell/platform/linux/BUILD.gn deleted file mode 100644 index 6e9f1f596b09d..0000000000000 --- a/shell/platform/linux/BUILD.gn +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2016 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. - -executable("linux") { - output_name = "flutter_tester" - - sources = [ - "main_linux.cc", - ] - - deps = [ - "//third_party/dart/runtime:libdart_jit", - "//third_party/dart/runtime/bin:embedded_dart_io", - "$flutter_root/common", - "$flutter_root/fml", - "$flutter_root/shell/common", - "$flutter_root/shell/testing", - "//garnet/public/lib/fxl", - "//third_party/skia", - "//topaz/lib/tonic", - ] -} diff --git a/shell/platform/linux/main_linux.cc b/shell/platform/linux/main_linux.cc deleted file mode 100644 index a20d425ed1eed..0000000000000 --- a/shell/platform/linux/main_linux.cc +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/common/threads.h" -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/testing/test_runner.h" -#include "flutter/shell/testing/testing.h" -#include "flutter/sky/engine/public/web/Sky.h" -#include "lib/fxl/command_line.h" -#include "lib/tonic/dart_microtask_queue.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -namespace { - -// Exit codes used by the Dart command line tool. -const int kApiErrorExitCode = 253; -const int kCompilationErrorExitCode = 254; -const int kErrorExitCode = 255; - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver : public fml::TaskObserver { - public: - ScriptCompletionTaskObserver(fxl::RefPtr task_runner) - : main_task_runner_(std::move(task_runner)), - prev_live_(false), - last_error_(tonic::kNoError) {} - - void DidProcessTask() override { - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - shell::Engine& engine = test_runner.platform_view().engine(); - - if (engine.GetLoadScriptError() != tonic::kNoError) { - last_error_ = engine.GetLoadScriptError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - return; - } - - bool live = engine.UIIsolateHasLivePorts(); - if (prev_live_ && !live) { - last_error_ = engine.GetUIIsolateLastError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - prev_live_ = live; - } - - tonic::DartErrorHandleType last_error() { return last_error_; } - - private: - fxl::RefPtr main_task_runner_; - bool prev_live_; - tonic::DartErrorHandleType last_error_; -}; - -int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { - switch (error) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } -} - -void RunNonInteractive(fxl::CommandLine initial_command_line, - bool run_forever) { - // This is a platform thread (i.e not one created by fml::Thread), so perform - // one time initialization. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - std::string bundle_path = ""; - initial_command_line.GetOptionValue( - FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); - - shell::Shell::InitStandalone(initial_command_line, - /* icu_data_path= */ "", - /* application_library_path= */ "", bundle_path); - - // Note that this task observer must be added after the observer that drains - // the microtask queue. - ScriptCompletionTaskObserver task_observer( - fml::MessageLoop::GetCurrent().GetTaskRunner()); - if (!run_forever) { - blink::Threads::UI()->PostTask([&task_observer] { - fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); - }); - } - - if (!shell::InitForTesting(initial_command_line)) { - shell::PrintUsage("flutter_tester"); - exit(EXIT_FAILURE); - return; - } - - fml::MessageLoop::GetCurrent().Run(); - - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - tonic::DartErrorHandleType error = - test_runner.platform_view().engine().GetLoadScriptError(); - if (error == tonic::kNoError) - error = task_observer.last_error(); - if (error == tonic::kNoError) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&error, &latch] { - error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); - latch.Signal(); - }); - latch.Wait(); - } - - // The script has completed and the engine may not be in a clean state, - // so just stop the process. - exit(ConvertErrorTypeToExitCode(error)); -} - -} // namespace - -int main(int argc, char* argv[]) { - dart::bin::SetExecutableName(argv[0]); - dart::bin::SetExecutableArguments(argc - 1, argv); - - auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); - - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { - shell::PrintUsage("flutter_tester"); - return EXIT_SUCCESS; - } - - bool run_forever = - command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); - RunNonInteractive(std::move(command_line), run_forever); - return EXIT_SUCCESS; -} diff --git a/shell/platform/win/BUILD.gn b/shell/platform/win/BUILD.gn deleted file mode 100644 index b4a2fe5033c18..0000000000000 --- a/shell/platform/win/BUILD.gn +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2016 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. - -executable("win") { - output_name = "flutter_tester" - - sources = [ - "main_win.cc", - ] - - deps = [ - "//flutter/common", - "//flutter/flow", - "//flutter/fml", - "//flutter/shell/common", - "//flutter/shell/testing", - "//flutter/sky/engine/wtf", - "//garnet/public/lib/fxl", - "//third_party/dart/runtime/bin:embedded_dart_io", - "//third_party/dart/runtime:libdart_jit", - "//third_party/skia", - "//topaz/lib/tonic", - ] - - libs = [ - "iphlpapi.lib", - "Rpcrt4.lib" - ] -} diff --git a/shell/platform/win/main_win.cc b/shell/platform/win/main_win.cc deleted file mode 100644 index c31c88ca915cb..0000000000000 --- a/shell/platform/win/main_win.cc +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015 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. - -#include - -#include "flutter/common/threads.h" -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/testing/test_runner.h" -#include "flutter/shell/testing/testing.h" -#include "lib/fxl/command_line.h" -#include "lib/tonic/dart_microtask_queue.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -namespace { - -// Exit codes used by the Dart command line tool. -const int kApiErrorExitCode = 253; -const int kCompilationErrorExitCode = 254; -const int kErrorExitCode = 255; - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver : public fml::TaskObserver { - public: - ScriptCompletionTaskObserver(fxl::RefPtr task_runner) - : main_task_runner_(std::move(task_runner)), - prev_live_(false), - last_error_(tonic::kNoError) {} - - void DidProcessTask() override { - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - shell::Engine& engine = test_runner.platform_view().engine(); - - if (engine.GetLoadScriptError() != tonic::kNoError) { - last_error_ = engine.GetLoadScriptError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - return; - } - - bool live = engine.UIIsolateHasLivePorts(); - if (prev_live_ && !live) { - last_error_ = engine.GetUIIsolateLastError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - prev_live_ = live; - } - - tonic::DartErrorHandleType last_error() { return last_error_; } - - private: - fxl::RefPtr main_task_runner_; - bool prev_live_; - tonic::DartErrorHandleType last_error_; -}; - -int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { - switch (error) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } -} - -void RunNonInteractive(fxl::CommandLine initial_command_line, - bool run_forever) { - // This is a platform thread (i.e not one created by fml::Thread), so perform - // one time initialization. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - std::string bundle_path = ""; - initial_command_line.GetOptionValue( - FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); - - shell::Shell::InitStandalone(initial_command_line, - /* icu_data_path= */ "", - /* application_library_path= */ "", bundle_path); - - // Note that this task observer must be added after the observer that drains - // the microtask queue. - ScriptCompletionTaskObserver task_observer( - fml::MessageLoop::GetCurrent().GetTaskRunner()); - if (!run_forever) { - blink::Threads::UI()->PostTask([&task_observer] { - fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); - }); - } - - if (!shell::InitForTesting(initial_command_line)) { - shell::PrintUsage("flutter_tester"); - ::ExitProcess(EXIT_FAILURE); - return; - } - - fml::MessageLoop::GetCurrent().Run(); - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - tonic::DartErrorHandleType error = - test_runner.platform_view().engine().GetLoadScriptError(); - if (error == tonic::kNoError) - error = task_observer.last_error(); - if (error == tonic::kNoError) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&error, &latch] { - error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); - latch.Signal(); - }); - latch.Wait(); - } - - // The script has completed and the engine may not be in a clean state, - // so just stop the process. - ::ExitProcess(ConvertErrorTypeToExitCode(error)); -} - -} // namespace - -int main(int argc, char* argv[]) { - dart::bin::SetExecutableName(argv[0]); - dart::bin::SetExecutableArguments(argc - 1, argv); - - auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); - - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { - shell::PrintUsage("flutter_tester"); - return EXIT_SUCCESS; - } - - bool run_forever = - command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); - RunNonInteractive(std::move(command_line), run_forever); - return EXIT_SUCCESS; -} diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index 659c241cc49b8..f11a3a2d07501 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -2,24 +2,30 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -source_set("testing") { +executable("testing") { + testonly = true + + output_name = "flutter_tester" + + public_configs = [ "$flutter_root:config" ] + sources = [ - "platform_view_test.cc", - "platform_view_test.h", - "test_runner.cc", - "test_runner.h", - "testing.cc", - "testing.h", + "tester_main.cc", ] deps = [ + "$flutter_root/assets", "$flutter_root/common", + "$flutter_root/fml", "$flutter_root/shell/common", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", + "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", + "//topaz/lib/tonic", ] - public_configs = [ - "$flutter_root:config", - ] + if (is_linux) { + ldflags = [ "-rdynamic" ] + } } diff --git a/shell/testing/platform_view_test.cc b/shell/testing/platform_view_test.cc deleted file mode 100644 index a59684d31bc94..0000000000000 --- a/shell/testing/platform_view_test.cc +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/testing/platform_view_test.h" - -#include "flutter/shell/common/null_rasterizer.h" -#include "flutter/shell/common/shell.h" - -namespace shell { - -PlatformViewTest::PlatformViewTest() - : PlatformView(std::unique_ptr(new NullRasterizer())) {} - -void PlatformViewTest::Attach() { - CreateEngine(); -} - -PlatformViewTest::~PlatformViewTest() = default; - -bool PlatformViewTest::ResourceContextMakeCurrent() { - return false; -} - -void PlatformViewTest::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) {} - -void PlatformViewTest::SetAssetBundlePath(const std::string& assets_directory) { -} - -} // namespace shell diff --git a/shell/testing/platform_view_test.h b/shell/testing/platform_view_test.h deleted file mode 100644 index 3612d0363ab58..0000000000000 --- a/shell/testing/platform_view_test.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 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. - -#ifndef SHELL_TESTING_PLATFORM_VIEW_TEST_H_ -#define SHELL_TESTING_PLATFORM_VIEW_TEST_H_ - -#include "flutter/shell/common/platform_view.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class Shell; - -class PlatformViewTest : public PlatformView { - public: - PlatformViewTest(); - - ~PlatformViewTest(); - - virtual void Attach() override; - - bool ResourceContextMakeCurrent() override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - void SetAssetBundlePath(const std::string& assets_directory) override; - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewTest); -}; - -} // namespace shell - -#endif // SHELL_TESTING_PLATFORM_VIEW_TEST_H_ diff --git a/shell/testing/test_runner.cc b/shell/testing/test_runner.cc deleted file mode 100644 index 838b04120c773..0000000000000 --- a/shell/testing/test_runner.cc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/shell/testing/test_runner.h" - -#include - -#include "flutter/common/threads.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/testing/platform_view_test.h" - -namespace shell { - -TestRunner::TestRunner() - : platform_view_(std::make_shared()) { - platform_view_->Attach(); - blink::ViewportMetrics metrics; - metrics.device_pixel_ratio = 3.0; - metrics.physical_width = 2400; // 800 at 3x resolution - metrics.physical_height = 1800; // 600 at 3x resolution - - blink::Threads::UI()->PostTask( - [ engine = platform_view_->engine().GetWeakPtr(), metrics ] { - if (engine) - engine->SetViewportMetrics(metrics); - }); -} - -TestRunner::~TestRunner() = default; - -TestRunner& TestRunner::Shared() { - static TestRunner* g_test_runner = nullptr; - if (!g_test_runner) - g_test_runner = new TestRunner(); - return *g_test_runner; -} - -void TestRunner::Run(const TestDescriptor& test) { - blink::Threads::UI()->PostTask( - [ engine = platform_view_->engine().GetWeakPtr(), test ] { - if (engine) - engine->RunBundleAndSource(std::string(), test.path, test.packages); - }); -} - -} // namespace shell diff --git a/shell/testing/test_runner.h b/shell/testing/test_runner.h deleted file mode 100644 index 8f303d7eb7683..0000000000000 --- a/shell/testing/test_runner.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_TESTING_TEST_RUNNER_H_ -#define SHELL_TESTING_TEST_RUNNER_H_ - -#include -#include - -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class PlatformView; - -class TestRunner { - public: - static TestRunner& Shared(); - - struct TestDescriptor { - std::string path; - std::string packages; - }; - - void Run(const TestDescriptor& test); - - PlatformView& platform_view() { return *platform_view_; } - - private: - TestRunner(); - ~TestRunner(); - - std::shared_ptr platform_view_; - - FXL_DISALLOW_COPY_AND_ASSIGN(TestRunner); -}; - -} // namespace shell - -#endif // SHELL_TESTING_TEST_RUNNER_H_ diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc new file mode 100644 index 0000000000000..a9e7bafc74d93 --- /dev/null +++ b/shell/testing/tester_main.cc @@ -0,0 +1,243 @@ +// Copyright 2018 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 + +#include "flutter/assets/asset_manager.h" +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/fml/file.h" +#include "flutter/fml/message_loop.h" +#include "flutter/fml/paths.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/thread_host.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace shell { + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver { + public: + ScriptCompletionTaskObserver(Shell& shell, + fxl::RefPtr main_task_runner, + bool run_forever) + : engine_(shell.GetEngine()), + main_task_runner_(std::move(main_task_runner)), + run_forever_(run_forever) {} + + int GetExitCodeForLastError() const { + // Exit codes used by the Dart command line tool. + const int kApiErrorExitCode = 253; + const int kCompilationErrorExitCode = 254; + const int kErrorExitCode = 255; + switch (last_error_) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } + } + + void DidProcessTask() { + if (engine_) { + last_error_ = engine_->GetUIIsolateLastError(); + if (engine_->UIIsolateHasLivePorts()) { + // The UI isolate still has live ports and is running. Nothing to do + // just yet. + return; + } + } + + if (run_forever_) { + // We need this script to run forever. We have already recorded the last + // error. Keep going. + return; + } + + if (!has_terminated) { + // Only try to terminate the loop once. + has_terminated = true; + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + } + + private: + fml::WeakPtr engine_; + fxl::RefPtr main_task_runner_; + bool run_forever_ = false; + tonic::DartErrorHandleType last_error_ = tonic::kUnknownErrorType; + bool has_terminated = false; + + FXL_DISALLOW_COPY_AND_ASSIGN(ScriptCompletionTaskObserver); +}; + +int RunTester(const blink::Settings& settings, bool run_forever) { + const auto thread_label = "io.flutter.test"; + + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); + + // Setup a single threaded test runner configuration. + const blink::TaskRunners task_runners(thread_label, // dart thread label + current_task_runner, // platform + current_task_runner, // gpu + current_task_runner, // ui + current_task_runner // io + ); + + Shell::CreateCallback on_create_platform_view = + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }; + + Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + auto shell = Shell::Create(task_runners, // + settings, // + on_create_platform_view, // + on_create_rasterizer // + ); + + if (!shell || !shell->IsSetup()) { + FXL_LOG(ERROR) << "Could not setup the shell."; + return EXIT_FAILURE; + } + + auto isolate_configuration = IsolateConfiguration::CreateForSource( + settings.main_dart_file_path, settings.packages_file_path); + + if (!isolate_configuration) { + FXL_LOG(ERROR) << "Could create isolate configuration."; + return EXIT_FAILURE; + } + + auto asset_manager = fxl::MakeRefCounted(); + asset_manager->PushBack(std::make_unique( + fml::Duplicate(settings.assets_dir))); + asset_manager->PushBack( + std::make_unique(fml::OpenFile( + settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); + + RunConfiguration run_configuration(std::move(isolate_configuration), + std::move(asset_manager)); + + // The script completion task observer that will be installed on the UI thread + // that watched if the engine has any live ports. + ScriptCompletionTaskObserver completion_observer( + *shell, // a valid shell + fml::MessageLoop::GetCurrent() + .GetTaskRunner(), // the message loop to terminate + run_forever // should the exit be ignored + ); + + bool engine_did_run = false; + + shell->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [&completion_observer, engine = shell->GetEngine(), + config = std::move(run_configuration), &engine_did_run]() mutable { + fml::MessageLoop::GetCurrent().AddTaskObserver( + reinterpret_cast(&completion_observer), + [&completion_observer]() { completion_observer.DidProcessTask(); }); + if (engine->Run(std::move(config))) { + engine_did_run = true; + + blink::ViewportMetrics metrics; + metrics.device_pixel_ratio = 3.0; + metrics.physical_width = 2400; // 800 at 3x resolution + metrics.physical_height = 1800; // 600 at 3x resolution + engine->SetViewportMetrics(metrics); + + } else { + FXL_DLOG(ERROR) << "Could not launch the engine with configuration."; + } + })); + + // Run the message loop and wait for the script to do its thing. + fml::MessageLoop::GetCurrent().Run(); + + // Cleanup the completion observer synchronously as it is living on the + // stack. + fxl::AutoResetWaitableEvent latch; + fml::TaskRunner::RunNowOrPostTask( + shell->GetTaskRunners().GetUITaskRunner(), + [&latch, &completion_observer] { + fml::MessageLoop::GetCurrent().RemoveTaskObserver( + reinterpret_cast(&completion_observer)); + latch.Signal(); + }); + latch.Wait(); + + if (!engine_did_run) { + // If the engine itself didn't have a chance to run, there is no point in + // asking it if there was an error. Signal a failure unconditionally. + return EXIT_FAILURE; + } + + return completion_observer.GetExitCodeForLastError(); +} + +} // namespace shell + +int main(int argc, char* argv[]) { + dart::bin::SetExecutableName(argv[0]); + dart::bin::SetExecutableArguments(argc - 1, argv); + + auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); + + if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { + shell::PrintUsage("flutter_tester"); + return EXIT_SUCCESS; + } + + auto settings = shell::SettingsFromCommandLine(command_line); + if (command_line.positional_args().size() > 0) { + // The tester may not use the switch for the main dart file path. Specifying + // it as a positional argument instead. + settings.main_dart_file_path = command_line.positional_args()[0]; + } + + if (settings.main_dart_file_path.size() == 0) { + FXL_LOG(ERROR) << "Main dart file path not specified."; + return EXIT_FAILURE; + } + + settings.icu_data_path = "icudtl.dat"; + + settings.kernel_snapshot_path = + fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); + + // The tools that read logs get confused if there is a log tag specified. + settings.log_tag = ""; + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + return shell::RunTester( + settings, + command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever))); +} diff --git a/shell/testing/testing.cc b/shell/testing/testing.cc deleted file mode 100644 index 13a3ab5be3d93..0000000000000 --- a/shell/testing/testing.cc +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/testing/testing.h" - -#include "flutter/shell/common/switches.h" -#include "flutter/shell/testing/test_runner.h" - -namespace shell { - -bool InitForTesting(const fxl::CommandLine& command_line) { - TestRunner::TestDescriptor test; - test.packages = command_line.GetOptionValueWithDefault( - FlagForSwitch(Switch::Packages), ""); - auto args = command_line.positional_args(); - if (args.empty()) - return false; - test.path = args[0]; - TestRunner::Shared().Run(test); - return true; -} - -} // namespace shell diff --git a/shell/testing/testing.h b/shell/testing/testing.h deleted file mode 100644 index 99f8b4fe983de..0000000000000 --- a/shell/testing/testing.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_TESTING_TESTING_H_ -#define SHELL_TESTING_TESTING_H_ - -#include "lib/fxl/command_line.h" - -namespace shell { - -bool InitForTesting(const fxl::CommandLine& command_line); - -} // namespace shell - -#endif // SHELL_TESTING_TESTING_H_ diff --git a/sky/engine/platform/SharedBuffer.cpp b/sky/engine/platform/SharedBuffer.cpp index 8577ab16f2938..bc94f22e97ce6 100644 --- a/sky/engine/platform/SharedBuffer.cpp +++ b/sky/engine/platform/SharedBuffer.cpp @@ -26,7 +26,6 @@ #include "flutter/sky/engine/platform/SharedBuffer.h" -#include "flutter/common/threads.h" #include "flutter/sky/engine/public/platform/Platform.h" #include "flutter/sky/engine/wtf/unicode/UTF8.h" #include "flutter/sky/engine/wtf/unicode/Unicode.h" diff --git a/sky/engine/platform/fonts/FontFallbackList.cpp b/sky/engine/platform/fonts/FontFallbackList.cpp index 177f161adaa7e..4786d65e0d7ad 100644 --- a/sky/engine/platform/fonts/FontFallbackList.cpp +++ b/sky/engine/platform/fonts/FontFallbackList.cpp @@ -37,6 +37,11 @@ namespace blink { +bool gUseTestFonts = false; +void FontFallbackList::SetUseTestFonts(bool useTestFonts) { + gUseTestFonts = useTestFonts; +} + FontFallbackList::FontFallbackList() : m_pageZero(0), m_cachedPrimarySimpleFontData(0), @@ -45,7 +50,8 @@ FontFallbackList::FontFallbackList() m_familyIndex(0), m_generation(FontCache::fontCache()->generation()), m_pitch(UnknownPitch), - m_hasLoadingFallback(false) {} + m_hasLoadingFallback(false), + m_useTestFonts(gUseTestFonts) {} void FontFallbackList::invalidate(PassRefPtr fontSelector) { releaseFontData(); @@ -193,7 +199,7 @@ PassRefPtr FontFallbackList::getFontData( const FontFamily* currFamily = startFamily; while (currFamily && !result) { familyIndex++; - if (currFamily->family().length() || Settings::Get().use_test_fonts) { + if (currFamily->family().length() || m_useTestFonts) { if (m_fontSelector) result = m_fontSelector->getFontData(fontDescription, currFamily->family()); diff --git a/sky/engine/platform/fonts/FontFallbackList.h b/sky/engine/platform/fonts/FontFallbackList.h index fdac27e5013bd..3331387968edc 100644 --- a/sky/engine/platform/fonts/FontFallbackList.h +++ b/sky/engine/platform/fonts/FontFallbackList.h @@ -103,6 +103,8 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { m_pageZero = node; } + static void SetUseTestFonts(bool useTestFonts); + private: FontFallbackList(); @@ -125,6 +127,7 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { unsigned short m_generation; mutable unsigned m_pitch : 3; // Pitch mutable bool m_hasLoadingFallback : 1; + bool m_useTestFonts = false; }; } // namespace blink diff --git a/sky/engine/web/Sky.cpp b/sky/engine/web/Sky.cpp index e90539e96cf87..52c6243743d7b 100644 --- a/sky/engine/web/Sky.cpp +++ b/sky/engine/web/Sky.cpp @@ -53,56 +53,6 @@ namespace blink { -namespace { - -void didProcessTask() { - tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); - // FIXME: Report memory usage to dart? -} - -#if defined(OS_FUCHSIA) - -void addMessageLoopObservers() { - fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback(didProcessTask); -} - -void removeMessageLoopObservers() { - fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); -} - -#else // defined(OS_FUCHSIA) - -class RunMicrotasksTaskObserver : public fml::TaskObserver { - public: - RunMicrotasksTaskObserver() = default; - - ~RunMicrotasksTaskObserver() override = default; - - void DidProcessTask() override { didProcessTask(); } -}; - -// FIXME(chinmaygarde): The awkward use of the global here is be cause we cannot -// introduce the fml::TaskObserver subclass in common code because Fuchsia does -// not support the same. Unify the API and remove hack. -static RunMicrotasksTaskObserver* g_run_microtasks_task_observer = nullptr; - -void addMessageLoopObservers() { - g_run_microtasks_task_observer = new RunMicrotasksTaskObserver(); - fml::MessageLoop::GetCurrent().AddTaskObserver( - g_run_microtasks_task_observer); -} - -void removeMessageLoopObservers() { - fml::MessageLoop::GetCurrent().RemoveTaskObserver( - g_run_microtasks_task_observer); - delete g_run_microtasks_task_observer; - g_run_microtasks_task_observer = nullptr; -} - -#endif // defined(OS_FUCHSIA) - -} // namespace - // Make sure we are not re-initialized in the same address space. // Doing so may cause hard to reproduce crashes. static bool s_webKitInitialized = false; @@ -130,15 +80,9 @@ void InitEngine(Platform* platform) { // the initialization thread-safe, but given that so many code paths use // this, initializing this lazily probably doesn't buy us much. WTF::UTF8Encoding(); - - tonic::DartMicrotaskQueue::StartForCurrentThread(); - addMessageLoopObservers(); } void ShutdownEngine() { - removeMessageLoopObservers(); - tonic::DartMicrotaskQueue::GetForCurrentThread()->Destroy(); - // FIXME: Shutdown dart? CoreInitializer::shutdown(); diff --git a/synchronization/BUILD.gn b/synchronization/BUILD.gn index 977a571c8da30..9ee7680cc1160 100644 --- a/synchronization/BUILD.gn +++ b/synchronization/BUILD.gn @@ -4,16 +4,13 @@ source_set("synchronization") { sources = [ - "debug_thread_checker.h", "pipeline.cc", "pipeline.h", "semaphore.cc", "semaphore.h", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] public_deps = [ "$flutter_root/glue", diff --git a/synchronization/debug_thread_checker.h b/synchronization/debug_thread_checker.h deleted file mode 100644 index 69614eb89d217..0000000000000 --- a/synchronization/debug_thread_checker.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ -#define FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ - -#ifndef NDEBUG - -#include -#include "lib/fxl/synchronization/thread_checker.h" - -#define FLUTTER_THREAD_CHECKER_DECLARE(x) ::fxl::ThreadChecker x; - -#define FLUTTER_THREAD_CHECKER_CHECK(x) FXL_CHECK(x.IsCreationThreadCurrent()); - -#else // NDEBUG - -#define FLUTTER_THREAD_CHECKER_DECLARE(x) - -#define FLUTTER_THREAD_CHECKER_CHECK(x) - -#endif // NDEBUG - -#endif // FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ diff --git a/synchronization/semaphore.cc b/synchronization/semaphore.cc index c6e0bdf9e2d53..4dc5f6220e350 100644 --- a/synchronization/semaphore.cc +++ b/synchronization/semaphore.cc @@ -15,9 +15,12 @@ namespace flutter { class PlatformSemaphore { public: explicit PlatformSemaphore(uint32_t count) - : _sem(dispatch_semaphore_create(count)) {} + : _sem(dispatch_semaphore_create(count)), _initial(count) {} ~PlatformSemaphore() { + for (uint32_t i = 0; i < _initial; ++i) { + Signal(); + } if (_sem != nullptr) { dispatch_release(reinterpret_cast(_sem)); _sem = nullptr; @@ -42,6 +45,7 @@ class PlatformSemaphore { private: dispatch_semaphore_t _sem; + const uint32_t _initial; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; diff --git a/testing/BUILD.gn b/testing/BUILD.gn index 3927e71cfc0e4..a65311bfaeb7c 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -9,9 +9,13 @@ source_set("testing") { "$flutter_root/testing/run_all_unittests.cc", "$flutter_root/testing/testing.cc", "$flutter_root/testing/testing.h", + "$flutter_root/testing/thread_test.cc", + "$flutter_root/testing/thread_test.h", ] public_deps = [ + "$flutter_root/fml", + "//garnet/public/lib/fxl", "//third_party/googletest:gtest", ] diff --git a/testing/thread_test.cc b/testing/thread_test.cc new file mode 100644 index 0000000000000..1306f37678fbe --- /dev/null +++ b/testing/thread_test.cc @@ -0,0 +1,33 @@ +// Copyright 2017 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/testing/thread_test.h" + +namespace testing { + +void ThreadTest::SetUp() { + thread_ = std::make_unique(); + thread_task_runner_ = thread_->GetTaskRunner(); + + fml::MessageLoop::EnsureInitializedForCurrentThread(); + current_task_runner_ = fml::MessageLoop::GetCurrent().GetTaskRunner(); +} + +void ThreadTest::TearDown() { + thread_task_runner_ = nullptr; + thread_ = nullptr; + current_task_runner_ = nullptr; +} + +fxl::RefPtr ThreadTest::GetCurrentTaskRunner() { + return current_task_runner_; +} + +fxl::RefPtr ThreadTest::GetThreadTaskRunner() { + return thread_task_runner_; +} + +} // namespace testing diff --git a/testing/thread_test.h b/testing/thread_test.h new file mode 100644 index 0000000000000..511d09c978858 --- /dev/null +++ b/testing/thread_test.h @@ -0,0 +1,37 @@ +// Copyright 2017 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_TESTING_THREAD_TEST_H_ +#define FLUTTER_TESTING_THREAD_TEST_H_ + +#include + +#include "flutter/fml/message_loop.h" +#include "flutter/fml/task_runner.h" +#include "flutter/fml/thread.h" +#include "gtest/gtest.h" +#include "lib/fxl/macros.h" + +namespace testing { + +class ThreadTest : public Test { + public: + fxl::RefPtr GetCurrentTaskRunner(); + + fxl::RefPtr GetThreadTaskRunner(); + + protected: + void SetUp() override; + + void TearDown() override; + + private: + std::unique_ptr thread_; + fxl::RefPtr thread_task_runner_; + fxl::RefPtr current_task_runner_; +}; + +} // namespace testing + +#endif // FLUTTER_TESTING_THREAD_TEST_H_ diff --git a/tools/gn b/tools/gn index ea7071ac0a474..b4b15f99f1d4f 100755 --- a/tools/gn +++ b/tools/gn @@ -232,6 +232,10 @@ def main(argv): # On the Mac, also generate Xcode projects for ease of editing. command.append('--ide=xcode') + if sys.platform.startswith('win'): + # On Windows, also generate Visual Studio project for ease of editing. + command.append('--ide=vs') + gn_args = to_command_line(to_gn_args(args)) out_dir = get_out_dir(args) print "gn gen --check in %s" % out_dir diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 8749f6880dbf4..b15c608425095 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -1059,14 +1059,10 @@ USED LICENSES: ==================================================================================================== LIBRARY: engine LIBRARY: txt -ORIGIN: ../../../flutter/content_handler/service_protocol_hooks.cc + ../../../LICENSE +ORIGIN: ../../../flutter/content_handler/session_connection.cc + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/content_handler/service_protocol_hooks.cc -FILE: ../../../flutter/content_handler/service_protocol_hooks.h FILE: ../../../flutter/content_handler/session_connection.cc FILE: ../../../flutter/content_handler/session_connection.h -FILE: ../../../flutter/content_handler/vulkan_rasterizer.cc -FILE: ../../../flutter/content_handler/vulkan_rasterizer.h FILE: ../../../flutter/content_handler/vulkan_surface_producer.cc FILE: ../../../flutter/content_handler/vulkan_surface_producer.h FILE: ../../../flutter/flow/debug_print.cc @@ -1126,7 +1122,6 @@ FILE: ../../../flutter/fml/platform/win/mapping_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.h FILE: ../../../flutter/fml/platform/win/paths_win.cc -FILE: ../../../flutter/fml/task_observer.h FILE: ../../../flutter/fml/task_runner.cc FILE: ../../../flutter/fml/task_runner.h FILE: ../../../flutter/fml/thread.cc @@ -1142,13 +1137,10 @@ FILE: ../../../flutter/lib/ui/painting/codec.cc FILE: ../../../flutter/lib/ui/painting/codec.h FILE: ../../../flutter/lib/ui/painting/frame_info.cc FILE: ../../../flutter/lib/ui/painting/frame_info.h -FILE: ../../../flutter/lib/ui/painting/utils.cc FILE: ../../../flutter/lib/ui/painting/vertices.cc FILE: ../../../flutter/lib/ui/painting/vertices.h FILE: ../../../flutter/lib/ui/text/font_collection.cc FILE: ../../../flutter/lib/ui/text/font_collection.h -FILE: ../../../flutter/shell/common/null_platform_view.cc -FILE: ../../../flutter/shell/common/null_platform_view.h FILE: ../../../flutter/shell/gpu/gpu_surface_software.cc FILE: ../../../flutter/shell/gpu/gpu_surface_software.h FILE: ../../../flutter/shell/platform/android/android_external_texture_gl.cc @@ -1195,8 +1187,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandar FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_standard_codec_unittest.mm FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.h FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -1563,7 +1553,6 @@ FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc FILE: ../../../flutter/shell/platform/android/apk_asset_provider.cc FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/JSONUtil.java FILE: ../../../flutter/shell/platform/darwin/desktop/Info.plist -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_mac.xib FILE: ../../../flutter/shell/platform/darwin/ios/framework/Flutter.podspec FILE: ../../../flutter/shell/platform/darwin/ios/framework/Info.plist FILE: ../../../flutter/shell/platform/darwin/ios/framework/module.modulemap @@ -1638,17 +1627,48 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/assets/asset_provider.h + ../../../LICENSE +ORIGIN: ../../../flutter/assets/asset_manager.cc + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/assets/asset_provider.h -FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart -FILE: ../../../flutter/lib/ui/painting/image_encoding.cc -FILE: ../../../flutter/lib/ui/painting/image_encoding.h -FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +FILE: ../../../flutter/assets/asset_manager.cc +FILE: ../../../flutter/assets/asset_manager.h +FILE: ../../../flutter/assets/asset_resolver.h +FILE: ../../../flutter/common/task_runners.cc +FILE: ../../../flutter/common/task_runners.h +FILE: ../../../flutter/flow/layers/default_layer_builder.cc +FILE: ../../../flutter/flow/layers/default_layer_builder.h +FILE: ../../../flutter/flow/layers/layer_builder.cc +FILE: ../../../flutter/flow/layers/layer_builder.h +FILE: ../../../flutter/flow/skia_gpu_object.cc +FILE: ../../../flutter/flow/skia_gpu_object.h +FILE: ../../../flutter/runtime/dart_isolate.cc +FILE: ../../../flutter/runtime/dart_isolate.h +FILE: ../../../flutter/runtime/dart_isolate_unittests.cc +FILE: ../../../flutter/runtime/dart_snapshot.cc +FILE: ../../../flutter/runtime/dart_snapshot.h +FILE: ../../../flutter/runtime/dart_snapshot_buffer.cc +FILE: ../../../flutter/runtime/dart_snapshot_buffer.h +FILE: ../../../flutter/runtime/dart_vm.cc +FILE: ../../../flutter/runtime/dart_vm.h +FILE: ../../../flutter/runtime/dart_vm_unittests.cc +FILE: ../../../flutter/runtime/service_protocol.cc +FILE: ../../../flutter/runtime/service_protocol.h +FILE: ../../../flutter/shell/common/io_manager.cc +FILE: ../../../flutter/shell/common/io_manager.h +FILE: ../../../flutter/shell/common/run_configuration.cc +FILE: ../../../flutter/shell/common/run_configuration.h +FILE: ../../../flutter/shell/common/shell_unittests.cc +FILE: ../../../flutter/shell/common/thread_host.cc +FILE: ../../../flutter/shell/common/thread_host.h +FILE: ../../../flutter/shell/platform/darwin/common/command_line.h +FILE: ../../../flutter/shell/platform/darwin/common/command_line.mm +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.h +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.mm +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h +FILE: ../../../flutter/shell/platform/embedder/embedder.h +FILE: ../../../flutter/shell/platform/embedder/embedder_engine.cc +FILE: ../../../flutter/shell/platform/embedder/embedder_engine.h ---------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. +Copyright 2017 The Flutter Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1683,23 +1703,10 @@ ORIGIN: ../../../flutter/assets/directory_asset_bundle.cc + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/assets/directory_asset_bundle.cc FILE: ../../../flutter/assets/directory_asset_bundle.h -FILE: ../../../flutter/assets/unzipper_provider.cc -FILE: ../../../flutter/assets/unzipper_provider.h FILE: ../../../flutter/assets/zip_asset_store.cc FILE: ../../../flutter/assets/zip_asset_store.h FILE: ../../../flutter/common/settings.cc FILE: ../../../flutter/common/settings.h -FILE: ../../../flutter/common/threads.cc -FILE: ../../../flutter/common/threads.h -FILE: ../../../flutter/content_handler/app.cc -FILE: ../../../flutter/content_handler/app.h -FILE: ../../../flutter/content_handler/application_controller_impl.cc -FILE: ../../../flutter/content_handler/application_controller_impl.h -FILE: ../../../flutter/content_handler/main.cc -FILE: ../../../flutter/content_handler/rasterizer.cc -FILE: ../../../flutter/content_handler/rasterizer.h -FILE: ../../../flutter/content_handler/runtime_holder.cc -FILE: ../../../flutter/content_handler/runtime_holder.h FILE: ../../../flutter/flow/export_node.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.h @@ -1707,7 +1714,6 @@ FILE: ../../../flutter/flow/layers/child_scene_layer.cc FILE: ../../../flutter/flow/layers/child_scene_layer.h FILE: ../../../flutter/flow/layers/shader_mask_layer.cc FILE: ../../../flutter/flow/layers/shader_mask_layer.h -FILE: ../../../flutter/flow/process_info.h FILE: ../../../flutter/flow/raster_cache.cc FILE: ../../../flutter/flow/raster_cache.h FILE: ../../../flutter/flow/scene_update_context.cc @@ -1718,9 +1724,6 @@ FILE: ../../../flutter/glue/stack_trace_fuchsia.cc FILE: ../../../flutter/glue/trace_event.h FILE: ../../../flutter/lib/ui/painting/image_filter.cc FILE: ../../../flutter/lib/ui/painting/image_filter.h -FILE: ../../../flutter/lib/ui/painting/resource_context.cc -FILE: ../../../flutter/lib/ui/painting/resource_context.h -FILE: ../../../flutter/lib/ui/painting/utils.h FILE: ../../../flutter/lib/ui/semantics.dart FILE: ../../../flutter/lib/ui/semantics/semantics_node.cc FILE: ../../../flutter/lib/ui/semantics/semantics_node.h @@ -1742,18 +1745,13 @@ FILE: ../../../flutter/runtime/asset_font_selector.cc FILE: ../../../flutter/runtime/asset_font_selector.h FILE: ../../../flutter/runtime/embedder_resources.cc FILE: ../../../flutter/runtime/embedder_resources.h -FILE: ../../../flutter/runtime/runtime_init.cc -FILE: ../../../flutter/runtime/runtime_init.h +FILE: ../../../flutter/runtime/fixtures/simple_main.dart FILE: ../../../flutter/runtime/start_up.cc FILE: ../../../flutter/runtime/start_up.h FILE: ../../../flutter/runtime/test_font_data.cc FILE: ../../../flutter/runtime/test_font_data.h FILE: ../../../flutter/runtime/test_font_selector.cc FILE: ../../../flutter/runtime/test_font_selector.h -FILE: ../../../flutter/shell/common/null_rasterizer.cc -FILE: ../../../flutter/shell/common/null_rasterizer.h -FILE: ../../../flutter/shell/common/platform_view_service_protocol.cc -FILE: ../../../flutter/shell/common/platform_view_service_protocol.h FILE: ../../../flutter/shell/common/skia_event_tracer_impl.h FILE: ../../../flutter/shell/common/surface.cc FILE: ../../../flutter/shell/common/surface.h @@ -1782,8 +1780,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/view/VsyncWaiter.java FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.cc FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.mm -FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.cc -FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.h FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h @@ -1792,8 +1788,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterMacros FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h @@ -1816,7 +1810,6 @@ FILE: ../../../flutter/sky/engine/platform/text/ICUError.cpp FILE: ../../../flutter/sky/engine/platform/text/ICUError.h FILE: ../../../flutter/sky/engine/platform/text/TextBox.h FILE: ../../../flutter/sky/packages/flutter_services/lib/empty.dart -FILE: ../../../flutter/synchronization/debug_thread_checker.h FILE: ../../../flutter/synchronization/pipeline.cc FILE: ../../../flutter/synchronization/pipeline.h FILE: ../../../flutter/synchronization/semaphore.cc @@ -1884,15 +1877,68 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/flow/layers/default_layer_builder.cc + ../../../LICENSE +ORIGIN: ../../../flutter/content_handler/application.cc + ../../../garnet/LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/flow/layers/default_layer_builder.cc -FILE: ../../../flutter/flow/layers/default_layer_builder.h -FILE: ../../../flutter/flow/layers/layer_builder.cc -FILE: ../../../flutter/flow/layers/layer_builder.h -FILE: ../../../flutter/shell/platform/embedder/embedder.h +FILE: ../../../flutter/content_handler/application.cc +FILE: ../../../flutter/content_handler/application.h +FILE: ../../../flutter/content_handler/application_runner.cc +FILE: ../../../flutter/content_handler/application_runner.h +FILE: ../../../flutter/content_handler/compositor_context.cc +FILE: ../../../flutter/content_handler/compositor_context.h +FILE: ../../../flutter/content_handler/engine.cc +FILE: ../../../flutter/content_handler/engine.h +FILE: ../../../flutter/content_handler/isolate_configurator.cc +FILE: ../../../flutter/content_handler/isolate_configurator.h +FILE: ../../../flutter/content_handler/main.cc +FILE: ../../../flutter/content_handler/platform_view.cc +FILE: ../../../flutter/content_handler/platform_view.h +FILE: ../../../flutter/content_handler/surface.cc +FILE: ../../../flutter/content_handler/surface.h +FILE: ../../../flutter/content_handler/task_observers.cc +FILE: ../../../flutter/content_handler/task_observers.h +FILE: ../../../flutter/content_handler/unique_fdio_ns.h ---------------------------------------------------------------------------------------------------- -Copyright 2017 The Flutter Authors. All rights reserved. +Copyright 2018 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: engine +ORIGIN: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart +FILE: ../../../flutter/lib/ui/painting/image_encoding.cc +FILE: ../../../flutter/lib/ui/painting/image_encoding.h +FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1957,6 +2003,62 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: engine +ORIGIN: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../flutter/fml/file.h +FILE: ../../../flutter/fml/macros.h +FILE: ../../../flutter/fml/mapping.cc +FILE: ../../../flutter/fml/native_library.h +FILE: ../../../flutter/fml/paths.cc +FILE: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc +FILE: ../../../flutter/fml/platform/posix/file_posix.cc +FILE: ../../../flutter/fml/platform/posix/native_library_posix.cc +FILE: ../../../flutter/fml/platform/win/file_win.cc +FILE: ../../../flutter/fml/platform/win/native_library_win.cc +FILE: ../../../flutter/fml/platform/win/wstring_conversion.h +FILE: ../../../flutter/fml/unique_fd.cc +FILE: ../../../flutter/fml/unique_fd.h +FILE: ../../../flutter/fml/unique_object.h +FILE: ../../../flutter/shell/common/isolate_configuration.cc +FILE: ../../../flutter/shell/common/isolate_configuration.h +FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc +FILE: ../../../flutter/shell/platform/android/android_shell_holder.h +FILE: ../../../flutter/shell/platform/android/platform_message_response_android.cc +FILE: ../../../flutter/shell/platform/android/platform_message_response_android.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: engine ORIGIN: ../../../flutter/lib/ui/painting/image.cc + ../../../LICENSE @@ -9873,10 +9975,6 @@ FILE: ../../../flutter/lib/ui/window.dart FILE: ../../../flutter/lib/ui/window/pointer_data.cc FILE: ../../../flutter/lib/ui/window/pointer_data_packet.cc FILE: ../../../flutter/lib/ui/window/window.cc -FILE: ../../../flutter/runtime/dart_controller.cc -FILE: ../../../flutter/runtime/dart_controller.h -FILE: ../../../flutter/runtime/dart_init.cc -FILE: ../../../flutter/runtime/dart_init.h FILE: ../../../flutter/runtime/dart_service_isolate.cc FILE: ../../../flutter/runtime/dart_service_isolate.h FILE: ../../../flutter/runtime/platform_impl.cc @@ -9896,13 +9994,9 @@ FILE: ../../../flutter/shell/common/rasterizer.cc FILE: ../../../flutter/shell/common/rasterizer.h FILE: ../../../flutter/shell/common/shell.cc FILE: ../../../flutter/shell/common/shell.h -FILE: ../../../flutter/shell/common/tracing_controller.cc -FILE: ../../../flutter/shell/common/tracing_controller.h FILE: ../../../flutter/shell/common/vsync_waiter.cc FILE: ../../../flutter/shell/common/vsync_waiter.h FILE: ../../../flutter/shell/common/vsync_waiter_fallback.h -FILE: ../../../flutter/shell/gpu/gpu_rasterizer.cc -FILE: ../../../flutter/shell/gpu/gpu_rasterizer.h FILE: ../../../flutter/shell/platform/android/AndroidManifest.xml FILE: ../../../flutter/shell/platform/android/flutter_main.cc FILE: ../../../flutter/shell/platform/android/flutter_main.h @@ -9915,12 +10009,6 @@ FILE: ../../../flutter/shell/platform/android/library_loader.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h -FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.h -FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.mm -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.m -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.mm FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.h FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.mm FILE: ../../../flutter/shell/platform/darwin/desktop/main_mac.mm @@ -9930,8 +10018,6 @@ FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.cc FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm -FILE: ../../../flutter/shell/platform/linux/main_linux.cc -FILE: ../../../flutter/shell/platform/win/main_win.cc FILE: ../../../flutter/sky/engine/wtf/Allocator.h FILE: ../../../flutter/sky/engine/wtf/MakeUnique.h ---------------------------------------------------------------------------------------------------- @@ -9968,6 +10054,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: engine ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd +FILE: ../../../flutter/fml/memory/thread_checker.h FILE: ../../../flutter/fml/memory/weak_ptr.h FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc FILE: ../../../flutter/fml/memory/weak_ptr_internal.h @@ -10001,4 +10088,4 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -Total license count: 216 +Total license count: 218 From 723c7d01439da4261bc836075fb55651ce9e7f03 Mon Sep 17 00:00:00 2001 From: Vyacheslav Egorov Date: Thu, 12 Apr 2018 18:28:55 +0200 Subject: [PATCH 0086/1190] Revert "Re-land "Support multiple shells in a single process. (#4932)" (#4977)" (#4981) This reverts commit a3327bff86800b3e654a2988fa7e6049edeb679c. --- BUILD.gn | 74 +- DEPS | 2 +- assets/BUILD.gn | 12 +- assets/asset_manager.cc | 59 - assets/asset_manager.h | 47 - assets/asset_provider.h | 25 + assets/asset_resolver.h | 32 - assets/directory_asset_bundle.cc | 85 +- assets/directory_asset_bundle.h | 32 +- assets/unzipper_provider.cc | 21 + assets/unzipper_provider.h | 20 + assets/zip_asset_store.cc | 24 +- assets/zip_asset_store.h | 24 +- common/BUILD.gn | 5 +- common/settings.cc | 58 +- common/settings.h | 74 +- common/task_runners.cc | 48 - common/task_runners.h | 46 - common/threads.cc | 56 + common/threads.h | 48 + content_handler/BUILD.gn | 59 +- content_handler/README.md | 4 - content_handler/accessibility_bridge.cc | 15 +- content_handler/accessibility_bridge.h | 25 +- content_handler/app.cc | 174 +++ content_handler/app.h | 64 + content_handler/application.cc | 313 ----- content_handler/application.h | 97 -- .../application_controller_impl.cc | 148 +++ content_handler/application_controller_impl.h | 76 ++ content_handler/application_runner.cc | 90 -- content_handler/application_runner.h | 79 -- content_handler/compositor_context.cc | 86 -- content_handler/compositor_context.h | 39 - content_handler/engine.cc | 258 ----- content_handler/engine.h | 63 - content_handler/fuchsia_font_manager.cc | 47 +- content_handler/fuchsia_font_manager.h | 2 +- content_handler/isolate_configurator.cc | 114 -- content_handler/isolate_configurator.h | 55 - content_handler/main.cc | 20 +- content_handler/platform_view.cc | 551 --------- content_handler/platform_view.h | 120 -- content_handler/rasterizer.cc | 19 + content_handler/rasterizer.h | 35 + content_handler/runtime_holder.cc | 911 +++++++++++++++ content_handler/runtime_holder.h | 152 +++ content_handler/service_protocol_hooks.cc | 164 +++ content_handler/service_protocol_hooks.h | 37 + content_handler/session_connection.cc | 108 +- content_handler/session_connection.h | 52 +- content_handler/surface.cc | 73 -- content_handler/surface.h | 47 - content_handler/task_observers.cc | 43 - content_handler/task_observers.h | 16 - content_handler/unique_fdio_ns.h | 34 - content_handler/vulkan_rasterizer.cc | 117 ++ content_handler/vulkan_rasterizer.h | 42 + content_handler/vulkan_surface.cc | 24 +- content_handler/vulkan_surface.h | 11 +- content_handler/vulkan_surface_pool.cc | 7 +- content_handler/vulkan_surface_pool.h | 9 +- content_handler/vulkan_surface_producer.cc | 9 +- content_handler/vulkan_surface_producer.h | 18 +- flow/BUILD.gn | 10 +- flow/compositor_context.cc | 26 +- flow/compositor_context.h | 44 +- flow/debug_print.cc | 5 - flow/debug_print.h | 9 +- flow/export_node.cc | 15 +- flow/export_node.h | 5 +- flow/layers/default_layer_builder.cc | 6 +- flow/layers/default_layer_builder.h | 2 +- flow/layers/layer.h | 4 + flow/layers/layer_builder.h | 3 +- flow/layers/layer_tree.cc | 55 +- flow/layers/layer_tree.h | 21 + flow/layers/performance_overlay_layer.cc | 33 + flow/layers/performance_overlay_layer.h | 2 + flow/layers/picture_layer.cc | 23 +- flow/layers/picture_layer.h | 13 +- flow/process_info.h | 31 + flow/raster_cache.cc | 33 +- flow/raster_cache.h | 6 + flow/raster_cache_key.h | 30 +- flow/scene_update_context.cc | 17 +- flow/skia_gpu_object.cc | 44 - flow/skia_gpu_object.h | 88 -- flow/texture.cc | 6 +- flow/texture.h | 5 +- fml/BUILD.gn | 18 +- fml/file.h | 35 - fml/icu_util.cc | 17 +- fml/macros.h | 20 - fml/mapping.cc | 20 - fml/mapping.h | 37 +- fml/memory/thread_checker.h | 69 -- fml/memory/weak_ptr.h | 43 +- fml/message_loop.cc | 10 +- fml/message_loop.h | 9 +- fml/message_loop_impl.cc | 43 +- fml/message_loop_impl.h | 8 +- fml/message_loop_unittests.cc | 24 +- fml/native_library.h | 52 - fml/paths.cc | 31 - fml/paths.h | 4 - fml/platform/android/message_loop_android.h | 6 +- .../darwin/resource_mapping_darwin.mm | 4 +- fml/platform/fuchsia/paths_fuchsia.cc | 15 - fml/platform/linux/message_loop_linux.h | 6 +- fml/platform/posix/file_posix.cc | 71 -- fml/platform/posix/mapping_posix.cc | 18 +- fml/platform/posix/native_library_posix.cc | 60 - fml/platform/win/file_win.cc | 119 -- fml/platform/win/mapping_win.cc | 59 +- fml/platform/win/native_library_win.cc | 51 - fml/platform/win/wstring_conversion.h | 25 - fml/task_observer.h | 21 + fml/task_runner.cc | 12 - fml/task_runner.h | 7 +- fml/thread.cc | 9 +- fml/thread.h | 6 +- fml/unique_fd.cc | 35 - fml/unique_fd.h | 60 - fml/unique_object.h | 137 --- lib/snapshot/BUILD.gn | 54 +- lib/ui/BUILD.gn | 11 +- lib/ui/compositing/scene_builder.cc | 9 +- lib/ui/compositing/scene_host.cc | 6 +- lib/ui/dart_runtime_hooks.cc | 62 +- lib/ui/painting/codec.cc | 114 +- lib/ui/painting/codec.h | 7 +- lib/ui/painting/gradient.cc | 12 +- lib/ui/painting/image.cc | 14 +- lib/ui/painting/image.h | 17 +- lib/ui/painting/image_encoding.cc | 23 +- lib/ui/painting/image_shader.cc | 11 +- lib/ui/painting/picture.cc | 25 +- lib/ui/painting/picture.h | 9 +- lib/ui/painting/picture_recorder.cc | 5 +- lib/ui/painting/resource_context.cc | 51 + lib/ui/painting/resource_context.h | 60 + lib/ui/painting/shader.cc | 12 +- lib/ui/painting/shader.h | 13 +- lib/ui/painting/utils.cc | 46 + lib/ui/painting/utils.h | 38 + lib/ui/text/font_collection.cc | 14 +- lib/ui/text/font_collection.h | 7 +- lib/ui/text/paragraph.cc | 5 +- lib/ui/text/paragraph.h | 5 - lib/ui/text/paragraph_builder.cc | 27 +- lib/ui/text/paragraph_builder.h | 11 +- lib/ui/text/paragraph_impl_blink.cc | 4 +- lib/ui/text/paragraph_impl_blink.h | 5 - lib/ui/text/paragraph_impl_txt.cc | 2 +- lib/ui/ui_dart_state.cc | 93 +- lib/ui/ui_dart_state.h | 101 +- .../window/platform_message_response_dart.cc | 14 +- .../window/platform_message_response_dart.h | 6 +- lib/ui/window/viewport_metrics.h | 19 - lib/ui/window/window.cc | 5 +- lib/ui/window/window.h | 5 +- runtime/BUILD.gn | 60 +- runtime/asset_font_selector.cc | 38 +- runtime/asset_font_selector.h | 17 +- runtime/dart_controller.cc | 250 ++++ runtime/dart_controller.h | 55 + runtime/dart_init.cc | 725 ++++++++++++ runtime/dart_init.h | 64 + runtime/dart_isolate.cc | 715 ------------ runtime/dart_isolate.h | 152 --- runtime/dart_isolate_unittests.cc | 103 -- runtime/dart_service_isolate.h | 2 + runtime/dart_snapshot.cc | 159 --- runtime/dart_snapshot.h | 57 - runtime/dart_snapshot_buffer.cc | 72 -- runtime/dart_snapshot_buffer.h | 34 - runtime/dart_vm.cc | 472 -------- runtime/dart_vm.h | 75 -- runtime/dart_vm_unittests.cc | 21 - runtime/fixtures/simple_main.dart | 7 - runtime/runtime_controller.cc | 276 ++--- runtime/runtime_controller.h | 99 +- runtime/runtime_delegate.cc | 8 +- runtime/runtime_delegate.h | 8 +- runtime/runtime_init.cc | 35 + runtime/runtime_init.h | 21 + runtime/service_protocol.cc | 279 ----- runtime/service_protocol.h | 99 -- shell/common/BUILD.gn | 43 +- shell/common/animator.cc | 75 +- shell/common/animator.h | 37 +- shell/common/engine.cc | 583 +++++++--- shell/common/engine.h | 153 ++- shell/common/io_manager.cc | 73 -- shell/common/io_manager.h | 52 - shell/common/isolate_configuration.cc | 148 --- shell/common/isolate_configuration.h | 51 - shell/common/null_platform_view.cc | 37 + shell/common/null_platform_view.h | 39 + shell/common/null_rasterizer.cc | 67 ++ shell/common/null_rasterizer.h | 51 + shell/common/platform_view.cc | 182 ++- shell/common/platform_view.h | 119 +- .../common/platform_view_service_protocol.cc | 447 +++++++ shell/common/platform_view_service_protocol.h | 85 ++ shell/common/rasterizer.cc | 197 ---- shell/common/rasterizer.h | 65 +- shell/common/run_configuration.cc | 80 -- shell/common/run_configuration.h | 56 - shell/common/shell.cc | 1029 +++++------------ shell/common/shell.h | 254 ++-- shell/common/shell_unittests.cc | 133 --- shell/common/surface.cc | 28 +- shell/common/surface.h | 14 +- shell/common/switches.cc | 122 -- shell/common/switches.h | 37 +- shell/common/thread_host.cc | 38 - shell/common/thread_host.h | 43 - shell/common/tracing_controller.cc | 51 + shell/common/tracing_controller.h | 34 + shell/common/vsync_waiter.cc | 37 - shell/common/vsync_waiter.h | 21 +- shell/common/vsync_waiter_fallback.cc | 24 +- shell/common/vsync_waiter_fallback.h | 13 +- shell/gpu/BUILD.gn | 11 +- shell/gpu/gpu_rasterizer.cc | 168 +++ shell/gpu/gpu_rasterizer.h | 68 ++ shell/gpu/gpu_surface_gl.cc | 13 +- shell/gpu/gpu_surface_gl.h | 5 +- shell/gpu/gpu_surface_software.cc | 17 +- shell/gpu/gpu_surface_software.h | 7 +- shell/gpu/gpu_surface_vulkan.h | 5 +- shell/platform/BUILD.gn | 6 +- shell/platform/android/BUILD.gn | 16 +- shell/platform/android/android_context_gl.cc | 24 +- shell/platform/android/android_context_gl.h | 1 + .../android/android_external_texture_gl.cc | 9 +- .../android/android_external_texture_gl.h | 3 +- .../platform/android/android_shell_holder.cc | 169 --- shell/platform/android/android_shell_holder.h | 59 - shell/platform/android/android_surface.cc | 24 - shell/platform/android/android_surface.h | 7 +- shell/platform/android/android_surface_gl.cc | 37 +- shell/platform/android/android_surface_gl.h | 24 +- .../android/android_surface_software.cc | 14 +- .../android/android_surface_software.h | 26 +- .../android/android_surface_vulkan.cc | 15 +- .../platform/android/android_surface_vulkan.h | 13 +- shell/platform/android/apk_asset_provider.cc | 29 +- shell/platform/android/apk_asset_provider.h | 27 +- shell/platform/android/flutter_main.cc | 75 +- shell/platform/android/flutter_main.h | 27 +- shell/platform/android/library_loader.cc | 2 +- .../platform_message_response_android.cc | 62 - .../platform_message_response_android.h | 39 - .../platform/android/platform_view_android.cc | 589 ++++++++-- .../platform/android/platform_view_android.h | 98 +- .../android/platform_view_android_jni.cc | 416 ++----- .../platform/android/vsync_waiter_android.cc | 100 +- shell/platform/android/vsync_waiter_android.h | 15 +- shell/platform/darwin/BUILD.gn | 12 +- shell/platform/darwin/common/BUILD.gn | 13 +- shell/platform/darwin/common/command_line.h | 17 - shell/platform/darwin/common/command_line.mm | 21 - shell/platform/darwin/common/platform_mac.h | 20 + shell/platform/darwin/common/platform_mac.mm | 160 +++ .../darwin/common/process_info_mac.cc | 36 + .../platform/darwin/common/process_info_mac.h | 36 + shell/platform/darwin/desktop/BUILD.gn | 22 +- shell/platform/darwin/desktop/Info.plist | 8 +- .../darwin/desktop/flutter_app_delegate.h | 14 + .../darwin/desktop/flutter_app_delegate.m | 15 + ...ation_delegate.h => flutter_application.h} | 11 +- .../darwin/desktop/flutter_application.mm | 8 + .../desktop/flutter_application_delegate.mm | 80 -- shell/platform/darwin/desktop/flutter_mac.xib | 695 +++++++++++ .../platform/darwin/desktop/flutter_window.h | 6 +- .../platform/darwin/desktop/flutter_window.mm | 201 +--- shell/platform/darwin/desktop/main_mac.mm | 112 +- .../darwin/desktop/platform_view_mac.h | 27 +- .../darwin/desktop/platform_view_mac.mm | 107 +- .../darwin/desktop/vsync_waiter_mac.cc | 16 +- .../darwin/desktop/vsync_waiter_mac.h | 10 +- shell/platform/darwin/ios/BUILD.gn | 13 +- .../framework/Source/FlutterDartProject.mm | 397 ++++--- .../Source/FlutterDartProject_Internal.h | 23 +- .../ios/framework/Source/FlutterDartSource.h | 30 + .../ios/framework/Source/FlutterDartSource.mm | 100 ++ .../Source/FlutterHeadlessDartRunner.mm | 88 +- .../darwin/ios/framework/Source/FlutterView.h | 6 - .../ios/framework/Source/FlutterView.mm | 103 +- .../framework/Source/FlutterViewController.mm | 337 +++--- .../Source/FlutterViewController_Internal.h | 17 - .../framework/Source/accessibility_bridge.mm | 4 +- .../ios/framework/Source/flutter_main_ios.h | 18 + .../ios/framework/Source/flutter_main_ios.mm | 25 + .../Source/platform_message_response_darwin.h | 50 - .../platform_message_response_darwin.mm | 11 - .../Source/platform_message_router.h | 5 +- .../Source/platform_message_router.mm | 15 +- .../ios/framework/Source/vsync_waiter_ios.h | 19 +- .../ios/framework/Source/vsync_waiter_ios.mm | 115 +- .../darwin/ios/ios_external_texture_gl.h | 2 - .../darwin/ios/ios_external_texture_gl.mm | 19 +- shell/platform/darwin/ios/ios_gl_context.h | 2 +- shell/platform/darwin/ios/ios_gl_context.mm | 60 +- shell/platform/darwin/ios/ios_surface.h | 19 +- shell/platform/darwin/ios/ios_surface.mm | 31 +- shell/platform/darwin/ios/ios_surface_gl.h | 3 +- shell/platform/darwin/ios/ios_surface_gl.mm | 5 +- .../darwin/ios/ios_surface_software.h | 11 +- .../darwin/ios/ios_surface_software.mm | 9 +- shell/platform/darwin/ios/platform_view_ios.h | 93 +- .../platform/darwin/ios/platform_view_ios.mm | 143 ++- shell/platform/embedder/BUILD.gn | 8 +- shell/platform/embedder/embedder.cc | 245 ++-- shell/platform/embedder/embedder_engine.cc | 119 -- shell/platform/embedder/embedder_engine.h | 53 - .../embedder/platform_view_embedder.cc | 53 +- .../embedder/platform_view_embedder.h | 29 +- shell/platform/linux/BUILD.gn | 23 + shell/platform/linux/main_linux.cc | 142 +++ shell/platform/win/BUILD.gn | 30 + shell/platform/win/main_win.cc | 142 +++ shell/testing/BUILD.gn | 26 +- shell/testing/platform_view_test.cc | 32 + shell/testing/platform_view_test.h | 38 + shell/testing/test_runner.cc | 48 + shell/testing/test_runner.h | 42 + shell/testing/tester_main.cc | 243 ---- shell/testing/testing.cc | 24 + shell/testing/testing.h | 16 + sky/engine/platform/SharedBuffer.cpp | 1 + .../platform/fonts/FontFallbackList.cpp | 10 +- sky/engine/platform/fonts/FontFallbackList.h | 3 - sky/engine/web/Sky.cpp | 56 + synchronization/BUILD.gn | 5 +- synchronization/debug_thread_checker.h | 25 + synchronization/semaphore.cc | 6 +- testing/BUILD.gn | 4 - testing/thread_test.cc | 33 - testing/thread_test.h | 37 - tools/gn | 4 - travis/licenses_golden/licenses_flutter | 233 ++-- 345 files changed, 11071 insertions(+), 12558 deletions(-) delete mode 100644 assets/asset_manager.cc delete mode 100644 assets/asset_manager.h create mode 100644 assets/asset_provider.h delete mode 100644 assets/asset_resolver.h create mode 100644 assets/unzipper_provider.cc create mode 100644 assets/unzipper_provider.h delete mode 100644 common/task_runners.cc delete mode 100644 common/task_runners.h create mode 100644 common/threads.cc create mode 100644 common/threads.h delete mode 100644 content_handler/README.md create mode 100644 content_handler/app.cc create mode 100644 content_handler/app.h delete mode 100644 content_handler/application.cc delete mode 100644 content_handler/application.h create mode 100644 content_handler/application_controller_impl.cc create mode 100644 content_handler/application_controller_impl.h delete mode 100644 content_handler/application_runner.cc delete mode 100644 content_handler/application_runner.h delete mode 100644 content_handler/compositor_context.cc delete mode 100644 content_handler/compositor_context.h delete mode 100644 content_handler/engine.cc delete mode 100644 content_handler/engine.h delete mode 100644 content_handler/isolate_configurator.cc delete mode 100644 content_handler/isolate_configurator.h delete mode 100644 content_handler/platform_view.cc delete mode 100644 content_handler/platform_view.h create mode 100644 content_handler/rasterizer.cc create mode 100644 content_handler/rasterizer.h create mode 100644 content_handler/runtime_holder.cc create mode 100644 content_handler/runtime_holder.h create mode 100644 content_handler/service_protocol_hooks.cc create mode 100644 content_handler/service_protocol_hooks.h delete mode 100644 content_handler/surface.cc delete mode 100644 content_handler/surface.h delete mode 100644 content_handler/task_observers.cc delete mode 100644 content_handler/task_observers.h delete mode 100644 content_handler/unique_fdio_ns.h create mode 100644 content_handler/vulkan_rasterizer.cc create mode 100644 content_handler/vulkan_rasterizer.h create mode 100644 flow/process_info.h delete mode 100644 flow/skia_gpu_object.cc delete mode 100644 flow/skia_gpu_object.h delete mode 100644 fml/file.h delete mode 100644 fml/macros.h delete mode 100644 fml/mapping.cc delete mode 100644 fml/memory/thread_checker.h delete mode 100644 fml/native_library.h delete mode 100644 fml/paths.cc delete mode 100644 fml/platform/fuchsia/paths_fuchsia.cc delete mode 100644 fml/platform/posix/file_posix.cc delete mode 100644 fml/platform/posix/native_library_posix.cc delete mode 100644 fml/platform/win/file_win.cc delete mode 100644 fml/platform/win/native_library_win.cc delete mode 100644 fml/platform/win/wstring_conversion.h create mode 100644 fml/task_observer.h delete mode 100644 fml/unique_fd.cc delete mode 100644 fml/unique_fd.h delete mode 100644 fml/unique_object.h create mode 100644 lib/ui/painting/resource_context.cc create mode 100644 lib/ui/painting/resource_context.h create mode 100644 lib/ui/painting/utils.cc create mode 100644 lib/ui/painting/utils.h create mode 100644 runtime/dart_controller.cc create mode 100644 runtime/dart_controller.h create mode 100644 runtime/dart_init.cc create mode 100644 runtime/dart_init.h delete mode 100644 runtime/dart_isolate.cc delete mode 100644 runtime/dart_isolate.h delete mode 100644 runtime/dart_isolate_unittests.cc delete mode 100644 runtime/dart_snapshot.cc delete mode 100644 runtime/dart_snapshot.h delete mode 100644 runtime/dart_snapshot_buffer.cc delete mode 100644 runtime/dart_snapshot_buffer.h delete mode 100644 runtime/dart_vm.cc delete mode 100644 runtime/dart_vm.h delete mode 100644 runtime/dart_vm_unittests.cc delete mode 100644 runtime/fixtures/simple_main.dart create mode 100644 runtime/runtime_init.cc create mode 100644 runtime/runtime_init.h delete mode 100644 runtime/service_protocol.cc delete mode 100644 runtime/service_protocol.h delete mode 100644 shell/common/io_manager.cc delete mode 100644 shell/common/io_manager.h delete mode 100644 shell/common/isolate_configuration.cc delete mode 100644 shell/common/isolate_configuration.h create mode 100644 shell/common/null_platform_view.cc create mode 100644 shell/common/null_platform_view.h create mode 100644 shell/common/null_rasterizer.cc create mode 100644 shell/common/null_rasterizer.h create mode 100644 shell/common/platform_view_service_protocol.cc create mode 100644 shell/common/platform_view_service_protocol.h delete mode 100644 shell/common/run_configuration.cc delete mode 100644 shell/common/run_configuration.h delete mode 100644 shell/common/shell_unittests.cc delete mode 100644 shell/common/thread_host.cc delete mode 100644 shell/common/thread_host.h create mode 100644 shell/common/tracing_controller.cc create mode 100644 shell/common/tracing_controller.h create mode 100644 shell/gpu/gpu_rasterizer.cc create mode 100644 shell/gpu/gpu_rasterizer.h delete mode 100644 shell/platform/android/android_shell_holder.cc delete mode 100644 shell/platform/android/android_shell_holder.h delete mode 100644 shell/platform/android/platform_message_response_android.cc delete mode 100644 shell/platform/android/platform_message_response_android.h delete mode 100644 shell/platform/darwin/common/command_line.h delete mode 100644 shell/platform/darwin/common/command_line.mm create mode 100644 shell/platform/darwin/common/platform_mac.h create mode 100644 shell/platform/darwin/common/platform_mac.mm create mode 100644 shell/platform/darwin/common/process_info_mac.cc create mode 100644 shell/platform/darwin/common/process_info_mac.h create mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.h create mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.m rename shell/platform/darwin/desktop/{flutter_application_delegate.h => flutter_application.h} (65%) create mode 100644 shell/platform/darwin/desktop/flutter_application.mm delete mode 100644 shell/platform/darwin/desktop/flutter_application_delegate.mm create mode 100644 shell/platform/darwin/desktop/flutter_mac.xib create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.h create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm delete mode 100644 shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h create mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.h create mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm delete mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h delete mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm delete mode 100644 shell/platform/embedder/embedder_engine.cc delete mode 100644 shell/platform/embedder/embedder_engine.h create mode 100644 shell/platform/linux/BUILD.gn create mode 100644 shell/platform/linux/main_linux.cc create mode 100644 shell/platform/win/BUILD.gn create mode 100644 shell/platform/win/main_win.cc create mode 100644 shell/testing/platform_view_test.cc create mode 100644 shell/testing/platform_view_test.h create mode 100644 shell/testing/test_runner.cc create mode 100644 shell/testing/test_runner.h delete mode 100644 shell/testing/tester_main.cc create mode 100644 shell/testing/testing.cc create mode 100644 shell/testing/testing.h create mode 100644 synchronization/debug_thread_checker.h delete mode 100644 testing/thread_test.cc delete mode 100644 testing/thread_test.h diff --git a/BUILD.gn b/BUILD.gn index b37b0b8d4054c..24dda026c6245 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,12 +10,14 @@ group("flutter") { public_deps = [ "$flutter_root/lib/snapshot:generate_snapshot_bin", "$flutter_root/lib/snapshot:kernel_platform_files", - "$flutter_root/shell/testing", "$flutter_root/sky", + "$flutter_root/third_party/txt", ] if (flutter_runtime_mode != "debug") { - public_deps += [ "$flutter_root/lib/snapshot:entry_points_json_files" ] + public_deps += [ + "$flutter_root/lib/snapshot:entry_points_json_files", + ] } if (!is_fuchsia && !is_fuchsia_host) { @@ -43,24 +45,20 @@ group("flutter") { "$flutter_root/shell/platform/embedder:flutter_embedder_framework", ] } - + if (!is_win) { + public_deps += [ + "$flutter_root/shell/platform/embedder:embedder_unittests", + "$flutter_root/shell/platform/embedder:flutter_engine", + ] + } public_deps += [ "$flutter_root/flow:flow_unittests", "$flutter_root/fml:fml_unittests", - "$flutter_root/runtime:runtime_unittests", - "$flutter_root/shell/common:shell_unittests", "$flutter_root/sky/engine/wtf:wtf_unittests", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", "//garnet/public/lib/fxl:fxl_unittests", ] - - if (!is_win) { - public_deps += [ - "$flutter_root/shell/platform/embedder:embedder_unittests", - "$flutter_root/shell/platform/embedder:flutter_engine", - ] - } } } @@ -76,23 +74,29 @@ if (is_fuchsia) { "$flutter_root/content_handler:aot", ] if (flutter_runtime_mode != "release") { - deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] + deps += [ + "//third_party/dart/runtime/observatory:embedded_archive_observatory", + ] } binary = "flutter_aot_runner" if (flutter_runtime_mode != "release") { - resources = [ { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - } ] + resources = [ + { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + }, + ] } - meta = [ { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - } ] + meta = [ + { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + }, + ] } package("flutter_jit_runner") { @@ -100,23 +104,29 @@ if (is_fuchsia) { "$flutter_root/content_handler:jit", ] if (flutter_runtime_mode != "release") { - deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] + deps += [ + "//third_party/dart/runtime/observatory:embedded_archive_observatory", + ] } binary = "flutter_jit_runner" if (flutter_runtime_mode != "release") { - resources = [ { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - } ] + resources = [ + { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + }, + ] } - meta = [ { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - } ] + meta = [ + { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + }, + ] } } else { group("dist") { diff --git a/DEPS b/DEPS index d7f022879b66c..f771a4be4088b 100644 --- a/DEPS +++ b/DEPS @@ -115,7 +115,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '3cf97e01cdbd4bb920fa3d40282a56c4b2d62a58', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '8dddd90bf943a8174913564353b30a3b11ee0f7a', # Fuchsia compatibility # diff --git a/assets/BUILD.gn b/assets/BUILD.gn index 28d7e569659f1..c4901375ad810 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -4,18 +4,16 @@ source_set("assets") { sources = [ - "asset_manager.cc", - "asset_manager.h", - "asset_resolver.h", + "asset_provider.h", "directory_asset_bundle.cc", "directory_asset_bundle.h", + "unzipper_provider.cc", + "unzipper_provider.h", "zip_asset_store.cc", "zip_asset_store.h", ] deps = [ - "$flutter_root/common", - "$flutter_root/fml", "$flutter_root/glue", "//garnet/public/lib/fxl", "//garnet/public/lib/zip", @@ -25,5 +23,7 @@ source_set("assets") { "//third_party/zlib:minizip", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] } diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc deleted file mode 100644 index 9833eee923257..0000000000000 --- a/assets/asset_manager.cc +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2017 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/assets/asset_manager.h" - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/glue/trace_event.h" -#include "lib/fxl/files/path.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace blink { - -AssetManager::AssetManager() = default; - -AssetManager::~AssetManager() = default; - -void AssetManager::PushFront(std::unique_ptr resolver) { - if (resolver == nullptr || !resolver->IsValid()) { - return; - } - - resolvers_.push_front(std::move(resolver)); -} - -void AssetManager::PushBack(std::unique_ptr resolver) { - if (resolver == nullptr || !resolver->IsValid()) { - return; - } - - resolvers_.push_back(std::move(resolver)); -} - -// |blink::AssetResolver| -bool AssetManager::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { - if (asset_name.size() == 0) { - return false; - } - TRACE_EVENT0("flutter", "AssetManager::GetAsBuffer"); - for (const auto& resolver : resolvers_) { - if (resolver->GetAsBuffer(asset_name, data)) { - return true; - } - } - FXL_DLOG(ERROR) << "Could not find asset: " << asset_name; - return false; -} - -// |blink::AssetResolver| -bool AssetManager::IsValid() const { - return resolvers_.size() > 0; -} - -} // namespace blink diff --git a/assets/asset_manager.h b/assets/asset_manager.h deleted file mode 100644 index fc7f3ef05210e..0000000000000 --- a/assets/asset_manager.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2017 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_ASSETS_ASSET_MANAGER_H_ -#define FLUTTER_ASSETS_ASSET_MANAGER_H_ - -#include -#include -#include - -#include "flutter/assets/asset_resolver.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" - -namespace blink { - -class AssetManager final : public AssetResolver, - public fxl::RefCountedThreadSafe { - public: - void PushFront(std::unique_ptr resolver); - - void PushBack(std::unique_ptr resolver); - - // |blink::AssetResolver| - bool IsValid() const override; - - // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; - - private: - std::deque> resolvers_; - - AssetManager(); - - ~AssetManager(); - - FXL_DISALLOW_COPY_AND_ASSIGN(AssetManager); - FRIEND_MAKE_REF_COUNTED(AssetManager); - FRIEND_REF_COUNTED_THREAD_SAFE(AssetManager); -}; - -} // namespace blink - -#endif // FLUTTER_ASSETS_ASSET_MANAGER_H_ diff --git a/assets/asset_provider.h b/assets/asset_provider.h new file mode 100644 index 0000000000000..68b7f5c2b7b9c --- /dev/null +++ b/assets/asset_provider.h @@ -0,0 +1,25 @@ +// 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. + +#ifndef FLUTTER_ASSETS_ASSET_PROVIDER_H_ +#define FLUTTER_ASSETS_ASSET_PROVIDER_H_ + +#include +#include + +#include "lib/fxl/memory/ref_counted.h" + +namespace blink { + +class AssetProvider + : public fxl::RefCountedThreadSafe + { + public: + virtual bool GetAsBuffer(const std::string& asset_name, + std::vector* data) = 0; + virtual ~AssetProvider() = default; +}; + +} // namespace blink +#endif // FLUTTER_ASSETS_ASSET_PROVIDER_H diff --git a/assets/asset_resolver.h b/assets/asset_resolver.h deleted file mode 100644 index 6cfe27961a9f4..0000000000000 --- a/assets/asset_resolver.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2017 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_ASSETS_ASSET_RESOLVER_H_ -#define FLUTTER_ASSETS_ASSET_RESOLVER_H_ - -#include -#include - -#include "lib/fxl/macros.h" - -namespace blink { - -class AssetResolver { - public: - AssetResolver() = default; - - virtual ~AssetResolver() = default; - - virtual bool IsValid() const = 0; - - virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const = 0; - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(AssetResolver); -}; - -} // namespace blink - -#endif // FLUTTER_ASSETS_ASSET_RESOLVER_H_ diff --git a/assets/directory_asset_bundle.cc b/assets/directory_asset_bundle.cc index 8e5d4df2ab977..43933079a81bd 100644 --- a/assets/directory_asset_bundle.cc +++ b/assets/directory_asset_bundle.cc @@ -3,54 +3,73 @@ // found in the LICENSE file. #include "flutter/assets/directory_asset_bundle.h" +#include "lib/fxl/build_config.h" + +#include #include -#include "flutter/fml/file.h" -#include "flutter/fml/mapping.h" #include "lib/fxl/files/eintr_wrapper.h" +#include "lib/fxl/files/file.h" +#include "lib/fxl/files/path.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/portable_unistd.h" namespace blink { -DirectoryAssetBundle::DirectoryAssetBundle(fml::UniqueFD descriptor) - : descriptor_(std::move(descriptor)) { - if (!fml::IsDirectory(descriptor_)) { - return; - } - is_valid_ = true; -} +bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, + std::vector* data) { + if (fd_.is_valid()) { +#if defined(OS_WIN) + // This code path is not valid in a Windows environment. + return false; +#else + fxl::UniqueFD asset_file(openat(fd_.get(), asset_name.c_str(), O_RDONLY)); + if (!asset_file.is_valid()) + return false; -DirectoryAssetBundle::~DirectoryAssetBundle() = default; + constexpr size_t kBufferSize = 1 << 16; + size_t offset = 0; + ssize_t bytes_read = 0; + do { + offset += bytes_read; + data->resize(offset + kBufferSize); + bytes_read = read(asset_file.get(), &(*data)[offset], kBufferSize); + } while (bytes_read > 0); -// |blink::AssetResolver| -bool DirectoryAssetBundle::IsValid() const { - return is_valid_; -} + if (bytes_read < 0) { + FXL_LOG(ERROR) << "Reading " << asset_name << " failed"; + data->clear(); + return false; + } -// |blink::AssetResolver| -bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { - if (data == nullptr) { - return false; + data->resize(offset + bytes_read); + return true; +#endif } - - if (!is_valid_) { - FXL_DLOG(WARNING) << "Asset bundle was not valid."; + std::string asset_path = GetPathForAsset(asset_name); + if (asset_path.empty()) return false; - } + return files::ReadFileToVector(asset_path, data); +} - fml::FileMapping mapping( - fml::OpenFile(descriptor_, asset_name.c_str(), fml::OpenPermission::kRead, - false /* directory */), - false /* executable */); +DirectoryAssetBundle::~DirectoryAssetBundle() {} - if (mapping.GetMapping() == nullptr) { - return false; - } +DirectoryAssetBundle::DirectoryAssetBundle(std::string directory) + : directory_(std::move(directory)), fd_() {} + +DirectoryAssetBundle::DirectoryAssetBundle(fxl::UniqueFD fd) + : fd_(std::move(fd)) {} - data->resize(mapping.GetSize()); - memmove(data->data(), mapping.GetMapping(), mapping.GetSize()); - return true; +std::string DirectoryAssetBundle::GetPathForAsset( + const std::string& asset_name) { + std::string asset_path = files::SimplifyPath(directory_ + "/" + asset_name); + if (asset_path.find(directory_) != 0u) { + FXL_LOG(ERROR) << "Asset name '" << asset_name + << "' attempted to traverse outside asset bundle."; + return std::string(); + } + return asset_path; } } // namespace blink diff --git a/assets/directory_asset_bundle.h b/assets/directory_asset_bundle.h index b594e1357fbe2..c710a513796ae 100644 --- a/assets/directory_asset_bundle.h +++ b/assets/directory_asset_bundle.h @@ -5,31 +5,31 @@ #ifndef FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ #define FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ -#include "flutter/assets/asset_resolver.h" -#include "flutter/fml/unique_fd.h" +#include +#include + +#include "flutter/assets/asset_provider.h" +#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class DirectoryAssetBundle : public AssetResolver { +class DirectoryAssetBundle + : public AssetProvider { public: - explicit DirectoryAssetBundle(fml::UniqueFD descriptor); - - ~DirectoryAssetBundle() override; + explicit DirectoryAssetBundle(std::string directory); + // Expects fd to be valid, otherwise the file descriptor is ignored. + explicit DirectoryAssetBundle(fxl::UniqueFD fd); + virtual ~DirectoryAssetBundle(); - private: - const fml::UniqueFD descriptor_; - bool is_valid_ = false; + virtual bool GetAsBuffer(const std::string& asset_name, std::vector* data); - std::string GetPathForAsset(const std::string& asset_name) const; + std::string GetPathForAsset(const std::string& asset_name); - // |blink::AssetResolver| - bool IsValid() const override; - - // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + private: + const std::string directory_; + fxl::UniqueFD fd_; FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); }; diff --git a/assets/unzipper_provider.cc b/assets/unzipper_provider.cc new file mode 100644 index 0000000000000..8ed023f9a20e9 --- /dev/null +++ b/assets/unzipper_provider.cc @@ -0,0 +1,21 @@ +// Copyright 2016 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. + +#include "flutter/assets/unzipper_provider.h" + +#include "lib/fxl/logging.h" +#include "third_party/zlib/contrib/minizip/unzip.h" + +namespace blink { + +UnzipperProvider GetUnzipperProviderForPath(std::string zip_path) { + return [zip_path]() { + zip::UniqueUnzipper unzipper(unzOpen2(zip_path.c_str(), nullptr)); + if (!unzipper.is_valid()) + FXL_LOG(ERROR) << "Unable to open zip file: " << zip_path; + return unzipper; + }; +} + +} // namespace blink diff --git a/assets/unzipper_provider.h b/assets/unzipper_provider.h new file mode 100644 index 0000000000000..f0f8d9597dffd --- /dev/null +++ b/assets/unzipper_provider.h @@ -0,0 +1,20 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_ASSETS_UNZIP_PROVIDER_H_ +#define FLUTTER_ASSETS_UNZIP_PROVIDER_H_ + +#include + +#include "lib/zip/unique_unzipper.h" + +namespace blink { + +using UnzipperProvider = std::function; + +UnzipperProvider GetUnzipperProviderForPath(std::string zip_path); + +} // namespace blink + +#endif // FLUTTER_ASSETS_UNZIP_PROVIDER_H_ diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index 1b9216bd34530..c8534fa10c216 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -15,28 +15,21 @@ #include #include "flutter/glue/trace_event.h" +#include "lib/fxl/files/eintr_wrapper.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/zip/unique_unzipper.h" namespace blink { -ZipAssetStore::ZipAssetStore(std::string file_path) - : file_path_(std::move(file_path)) { +ZipAssetStore::ZipAssetStore(UnzipperProvider unzipper_provider) + : unzipper_provider_(std::move(unzipper_provider)) { BuildStatCache(); } ZipAssetStore::~ZipAssetStore() = default; -zip::UniqueUnzipper ZipAssetStore::CreateUnzipper() const { - return zip::UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)}; -} - -// |blink::AssetResolver| -bool ZipAssetStore::IsValid() const { - return stat_cache_.size() > 0; -} - -// |blink::AssetResolver| bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { + std::vector* data) { TRACE_EVENT0("flutter", "ZipAssetStore::GetAsBuffer"); auto found = stat_cache_.find(asset_name); @@ -44,7 +37,7 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, return false; } - auto unzipper = CreateUnzipper(); + auto unzipper = unzipper_provider_(); if (!unzipper.is_valid()) { return false; @@ -80,8 +73,7 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, void ZipAssetStore::BuildStatCache() { TRACE_EVENT0("flutter", "ZipAssetStore::BuildStatCache"); - - auto unzipper = CreateUnzipper(); + auto unzipper = unzipper_provider_(); if (!unzipper.is_valid()) { return; diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h index 558678e25bc08..1ffda483ba9b7 100644 --- a/assets/zip_asset_store.h +++ b/assets/zip_asset_store.h @@ -6,20 +6,21 @@ #define FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ #include +#include -#include "flutter/assets/asset_resolver.h" +#include "flutter/assets/unzipper_provider.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" -#include "lib/zip/unique_unzipper.h" #include "third_party/zlib/contrib/minizip/unzip.h" namespace blink { -class ZipAssetStore final : public AssetResolver { +class ZipAssetStore : public fxl::RefCountedThreadSafe { public: - ZipAssetStore(std::string file_path); + explicit ZipAssetStore(UnzipperProvider unzipper_provider); + ~ZipAssetStore(); - ~ZipAssetStore() override; + bool GetAsBuffer(const std::string& asset_name, std::vector* data); private: struct CacheEntry { @@ -29,20 +30,11 @@ class ZipAssetStore final : public AssetResolver { : file_pos(p_file_pos), uncompressed_size(p_uncompressed_size) {} }; - std::string file_path_; - mutable std::map stat_cache_; - - // |blink::AssetResolver| - bool IsValid() const override; - - // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + UnzipperProvider unzipper_provider_; + std::map stat_cache_; void BuildStatCache(); - zip::UniqueUnzipper CreateUnzipper() const; - FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); }; diff --git a/common/BUILD.gn b/common/BUILD.gn index 47cd7d3d62644..53b71914d49d1 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -12,12 +12,11 @@ source_set("common") { sources = [ "settings.cc", "settings.h", - "task_runners.cc", - "task_runners.h", + "threads.cc", + "threads.h", ] deps = [ - "$flutter_root/fml", "//garnet/public/lib/fxl", ] diff --git a/common/settings.cc b/common/settings.cc index 85523e1b9a29f..0198f714cbaad 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -4,50 +4,26 @@ #include "flutter/common/settings.h" -#include +#include + +#include "lib/fxl/logging.h" namespace blink { +namespace { + +Settings* g_settings = nullptr; + +} // namespace + +const Settings& Settings::Get() { + FXL_CHECK(g_settings); + return *g_settings; +} -std::string Settings::ToString() const { - std::stringstream stream; - stream << "Settings: " << std::endl; - stream << "aot_snapshot_path: " << aot_snapshot_path << std::endl; - stream << "script_snapshot_path: " << script_snapshot_path << std::endl; - stream << "aot_vm_snapshot_data_filename: " << aot_vm_snapshot_data_filename - << std::endl; - stream << "aot_vm_snapshot_instr_filename: " << aot_vm_snapshot_instr_filename - << std::endl; - stream << "aot_isolate_snapshot_data_filename: " - << aot_isolate_snapshot_data_filename << std::endl; - stream << "aot_isolate_snapshot_instr_filename: " - << aot_isolate_snapshot_instr_filename << std::endl; - stream << "application_library_path: " << application_library_path - << std::endl; - stream << "main_dart_file_path: " << main_dart_file_path << std::endl; - stream << "packages_file_path: " << packages_file_path << std::endl; - stream << "temp_directory_path: " << temp_directory_path << std::endl; - stream << "dart_flags:" << std::endl; - for (const auto& dart_flag : dart_flags) { - stream << " " << dart_flag << std::endl; - } - stream << "start_paused: " << start_paused << std::endl; - stream << "trace_skia: " << trace_skia << std::endl; - stream << "trace_startup: " << trace_startup << std::endl; - stream << "endless_trace_buffer: " << endless_trace_buffer << std::endl; - stream << "enable_dart_profiling: " << enable_dart_profiling << std::endl; - stream << "dart_non_checked_mode: " << dart_non_checked_mode << std::endl; - stream << "enable_observatory: " << enable_observatory << std::endl; - stream << "observatory_port: " << observatory_port << std::endl; - stream << "ipv6: " << ipv6 << std::endl; - stream << "use_test_fonts: " << use_test_fonts << std::endl; - stream << "enable_software_rendering: " << enable_software_rendering - << std::endl; - stream << "using_blink: " << using_blink << std::endl; - stream << "log_tag: " << log_tag << std::endl; - stream << "icu_data_path: " << icu_data_path << std::endl; - stream << "assets_dir: " << assets_dir << std::endl; - stream << "assets_path: " << assets_path << std::endl; - return stream.str(); +void Settings::Set(const Settings& settings) { + FXL_CHECK(!g_settings); + g_settings = new Settings(); + *g_settings = settings; } } // namespace blink diff --git a/common/settings.h b/common/settings.h index c6c3159766a37..5bb5c6cbbea42 100644 --- a/common/settings.h +++ b/common/settings.h @@ -5,82 +5,40 @@ #ifndef FLUTTER_COMMON_SETTINGS_H_ #define FLUTTER_COMMON_SETTINGS_H_ -#include #include -#include #include #include -#include "flutter/fml/unique_fd.h" -#include "lib/fxl/functional/closure.h" - namespace blink { -using TaskObserverAdd = - std::function; -using TaskObserverRemove = std::function; - struct Settings { - // VM settings - std::string script_snapshot_path; - std::string kernel_snapshot_path; - + bool enable_observatory = false; + // Port on target will be auto selected by the OS. A message will be printed + // on the target with the port after it has been selected. + uint32_t observatory_port = 0; + bool ipv6 = false; + bool start_paused = false; + bool trace_startup = false; + bool endless_trace_buffer = false; + bool enable_dart_profiling = false; + bool use_test_fonts = false; + bool dart_non_checked_mode = false; + bool enable_software_rendering = false; + bool using_blink = true; + std::string aot_shared_library_path; std::string aot_snapshot_path; std::string aot_vm_snapshot_data_filename; std::string aot_vm_snapshot_instr_filename; std::string aot_isolate_snapshot_data_filename; std::string aot_isolate_snapshot_instr_filename; - std::string application_library_path; - std::string application_kernel_asset; - - std::string main_dart_file_path; - std::string packages_file_path; - std::string temp_directory_path; std::vector dart_flags; - - // Isolate settings - bool start_paused = false; - bool trace_skia = false; - bool trace_startup = false; - bool endless_trace_buffer = false; - bool enable_dart_profiling = false; - bool dart_non_checked_mode = false; - - // Observatory settings - bool enable_observatory = false; - // Port on target will be auto selected by the OS. A message will be printed - // on the target with the port after it has been selected. - uint32_t observatory_port = 0; - bool ipv6 = false; - - // Font settings - bool use_test_fonts = false; - - // Engine settings - TaskObserverAdd task_observer_add; - TaskObserverRemove task_observer_remove; - // The main isolate is current when this callback is made. This is a good spot - // to perform native Dart bindings for libraries not built in. - fxl::Closure root_isolate_create_callback; - // The isolate is not current and may have already been destroyed when this - // call is made. - fxl::Closure root_isolate_shutdown_callback; - bool enable_software_rendering = false; - bool using_blink = false; - bool skia_deterministic_rendering_on_cpu = false; std::string log_tag = "flutter"; - std::string icu_data_path; - - // Assets settings - fml::UniqueFD::element_type assets_dir = - fml::UniqueFD::traits_type::InvalidValue(); - std::string assets_path; - std::string flx_path; - std::string ToString() const; + static const Settings& Get(); + static void Set(const Settings& settings); }; } // namespace blink diff --git a/common/task_runners.cc b/common/task_runners.cc deleted file mode 100644 index 1a09daec1815c..0000000000000 --- a/common/task_runners.cc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2017 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/common/task_runners.h" - -#include - -namespace blink { - -TaskRunners::TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io) - : label_(std::move(label)), - platform_(std::move(platform)), - gpu_(std::move(gpu)), - ui_(std::move(ui)), - io_(std::move(io)) {} - -TaskRunners::~TaskRunners() = default; - -const std::string& TaskRunners::GetLabel() const { - return label_; -} - -fxl::RefPtr TaskRunners::GetPlatformTaskRunner() const { - return platform_; -} - -fxl::RefPtr TaskRunners::GetUITaskRunner() const { - return ui_; -} - -fxl::RefPtr TaskRunners::GetIOTaskRunner() const { - return io_; -} - -fxl::RefPtr TaskRunners::GetGPUTaskRunner() const { - return gpu_; -} - -bool TaskRunners::IsValid() const { - return platform_ && gpu_ && ui_ && io_; -} - -} // namespace blink diff --git a/common/task_runners.h b/common/task_runners.h deleted file mode 100644 index f41ae147ebad0..0000000000000 --- a/common/task_runners.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2017 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 - -#include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" - -namespace blink { - -class TaskRunners { - public: - TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io); - - ~TaskRunners(); - - const std::string& GetLabel() const; - - fxl::RefPtr GetPlatformTaskRunner() const; - - fxl::RefPtr GetUITaskRunner() const; - - fxl::RefPtr GetIOTaskRunner() const; - - fxl::RefPtr GetGPUTaskRunner() const; - - bool IsValid() const; - - private: - const std::string label_; - fxl::RefPtr platform_; - fxl::RefPtr gpu_; - fxl::RefPtr ui_; - fxl::RefPtr io_; -}; -} // namespace blink - -#endif // FLUTTER_COMMON_TASK_RUNNERS_H_ diff --git a/common/threads.cc b/common/threads.cc new file mode 100644 index 0000000000000..3634d8d7c8723 --- /dev/null +++ b/common/threads.cc @@ -0,0 +1,56 @@ +// Copyright 2016 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. + +#include "flutter/common/threads.h" + +#include + +namespace blink { +namespace { + +Threads* g_threads = nullptr; + +} // namespace + +Threads::Threads() {} + +Threads::Threads(fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io) + : platform_(std::move(platform)), + gpu_(std::move(gpu)), + ui_(std::move(ui)), + io_(std::move(io)) {} + +Threads::~Threads() {} + +const fxl::RefPtr& Threads::Platform() { + return Get().platform_; +} + +const fxl::RefPtr& Threads::Gpu() { + return Get().gpu_; +} + +const fxl::RefPtr& Threads::UI() { + return Get().ui_; +} + +const fxl::RefPtr& Threads::IO() { + return Get().io_; +} + +const Threads& Threads::Get() { + FXL_CHECK(g_threads); + return *g_threads; +} + +void Threads::Set(const Threads& threads) { + FXL_CHECK(!g_threads); + g_threads = new Threads(); + *g_threads = threads; +} + +} // namespace blink diff --git a/common/threads.h b/common/threads.h new file mode 100644 index 0000000000000..456a5eba8ad97 --- /dev/null +++ b/common/threads.h @@ -0,0 +1,48 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_COMMON_THREADS_H_ +#define FLUTTER_COMMON_THREADS_H_ + +#include "lib/fxl/tasks/task_runner.h" + +#define ASSERT_IS_PLATFORM_THREAD \ + FXL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread()); +#define ASSERT_IS_GPU_THREAD \ + FXL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread()); +#define ASSERT_IS_UI_THREAD \ + FXL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread()); +#define ASSERT_IS_IO_THREAD \ + FXL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread()); + +namespace blink { + +class Threads { + public: + Threads(); + Threads(fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io); + ~Threads(); + + static const fxl::RefPtr& Platform(); + static const fxl::RefPtr& Gpu(); + static const fxl::RefPtr& UI(); + static const fxl::RefPtr& IO(); + + static void Set(const Threads& settings); + + private: + static const Threads& Get(); + + fxl::RefPtr platform_; + fxl::RefPtr gpu_; + fxl::RefPtr ui_; + fxl::RefPtr io_; +}; + +} // namespace blink + +#endif // FLUTTER_COMMON_THREADS_H_ diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 4778784baa643..6bc00b4e2786c 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -20,28 +20,23 @@ template("flutter_content_handler") { sources = [ "accessibility_bridge.cc", "accessibility_bridge.h", - "application.cc", - "application.h", - "application_runner.cc", - "application_runner.h", - "compositor_context.cc", - "compositor_context.h", - "engine.cc", - "engine.h", + "app.cc", + "app.h", + "application_controller_impl.cc", + "application_controller_impl.h", "fuchsia_font_manager.cc", "fuchsia_font_manager.h", - "isolate_configurator.cc", - "isolate_configurator.h", "main.cc", - "platform_view.cc", - "platform_view.h", + "rasterizer.cc", + "rasterizer.h", + "runtime_holder.cc", + "runtime_holder.h", + "service_protocol_hooks.cc", + "service_protocol_hooks.h", "session_connection.cc", "session_connection.h", - "surface.cc", - "surface.h", - "task_observers.cc", - "task_observers.h", - "unique_fdio_ns.h", + "vulkan_rasterizer.cc", + "vulkan_rasterizer.h", "vulkan_surface.cc", "vulkan_surface.h", "vulkan_surface_pool.cc", @@ -50,26 +45,18 @@ template("flutter_content_handler") { "vulkan_surface_producer.h", ] - # The use of these dependencies is temporary and will be moved behind the - # embedder API. - flutter_deps = [ - "$flutter_root/assets", - "$flutter_root/common", - "$flutter_root/flow", - "$flutter_root/glue", - "$flutter_root/lib/ui", - "$flutter_root/runtime", - "$flutter_root/sky/engine/platform", - "$flutter_root/third_party/txt", - "$flutter_root/vulkan", - "$flutter_root/fml", - "$flutter_root/shell/common", - "$flutter_root/shell/gpu", - ] - deps = [ "//third_party/dart/runtime/bin:libdart_builtin", "//third_party/dart/runtime/platform:libdart_platform", + "$flutter_root/assets", + "$flutter_root/common", + "$flutter_root/flow", + "$flutter_root/glue", + "$flutter_root/lib/ui", + "$flutter_root/runtime", + "$flutter_root/sky/engine/platform", + "$flutter_root/third_party/txt", + "$flutter_root/vulkan", "//garnet/public/lib/app/cpp", "//garnet/public/lib/fsl", "//garnet/public/lib/fxl", @@ -86,10 +73,8 @@ template("flutter_content_handler") { "//topaz/lib/tonic", "//topaz/public/dart-pkg/fuchsia", "//topaz/public/lib/ui/flutter/sdk_ext", - "//third_party/skia:gpu", - "//third_party/zlib:minizip", "//zircon/public/lib/trace-provider", - ] + extra_deps + flutter_deps + ] + extra_deps # The flags below are needed so that Dart's CPU profiler can walk the # C++ stack. diff --git a/content_handler/README.md b/content_handler/README.md deleted file mode 100644 index 4461e808d1a47..0000000000000 --- a/content_handler/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Flutter Application Runner -========================== - -Implements the `component::ApplicationRunner` FIDL interface to launch and run mutliple Flutter applications within the same process. diff --git a/content_handler/accessibility_bridge.cc b/content_handler/accessibility_bridge.cc index f3d52f6cdbbb6..cb6f9b8e21155 100644 --- a/content_handler/accessibility_bridge.cc +++ b/content_handler/accessibility_bridge.cc @@ -2,22 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "accessibility_bridge.h" +#include "flutter/content_handler/accessibility_bridge.h" #include +#include "flutter/lib/ui/semantics/semantics_node.h" #include "lib/app/cpp/application_context.h" -#include "lib/context/fidl/context_writer.fidl.h" +#include "lib/fxl/macros.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/stringbuffer.h" #include "third_party/rapidjson/rapidjson/writer.h" -namespace flutter { +namespace flutter_runner { -AccessibilityBridge::AccessibilityBridge(maxwell::ContextWriterPtr writer) - : writer_(std::move(writer)) {} - -AccessibilityBridge::~AccessibilityBridge() = default; +AccessibilityBridge::AccessibilityBridge(component::ApplicationContext* context) + : writer_(context->ConnectToEnvironmentService()) {} void AccessibilityBridge::UpdateSemantics( const blink::SemanticsNodeUpdates& update) { @@ -78,4 +77,4 @@ void AccessibilityBridge::EraseUnvisitedNodes( } } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h index dde8bfaa54c36..7ac54e754d9b6 100644 --- a/content_handler/accessibility_bridge.h +++ b/content_handler/accessibility_bridge.h @@ -2,32 +2,28 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ +#define FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ #include #include "flutter/lib/ui/semantics/semantics_node.h" -#include "lib/context/fidl/context_writer.fidl.h" -#include "lib/fxl/macros.h" +#include "lib/app/cpp/application_context.h" +#include -namespace flutter { +namespace flutter_runner { // Maintain an up-to-date list of SemanticsNodes on screen, and communicate // with the Context Service. -class AccessibilityBridge final { +class AccessibilityBridge { public: - AccessibilityBridge(maxwell::ContextWriterPtr writer); - - ~AccessibilityBridge(); + explicit AccessibilityBridge(component::ApplicationContext* context); // Update the internal representation of the semantics nodes, and write the // semantics to Context Service. void UpdateSemantics(const blink::SemanticsNodeUpdates& update); private: - maxwell::ContextWriterPtr writer_; - std::map semantics_nodes_; - // Walk the semantics node tree starting at |id|, and store the id of each // visited child in |visited_nodes|. void UpdateVisitedForNodeAndChildren(const int id, @@ -37,7 +33,10 @@ class AccessibilityBridge final { // |visited_nodes|. void EraseUnvisitedNodes(const std::vector& visited_nodes); - FXL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); + std::map semantics_nodes_; + modular::ContextWriterPtr writer_; }; -} // namespace flutter +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ diff --git a/content_handler/app.cc b/content_handler/app.cc new file mode 100644 index 0000000000000..1f1bde833d2f3 --- /dev/null +++ b/content_handler/app.cc @@ -0,0 +1,174 @@ +// Copyright 2016 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. + +#include "flutter/content_handler/app.h" + +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/common/threads.h" +#include "flutter/content_handler/fuchsia_font_manager.h" +#include "flutter/lib/ui/text/font_collection.h" +#include "flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h" +#include "lib/fsl/tasks/message_loop.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" +#include "lib/icu_data/cpp/icu_data.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace flutter_runner { +namespace { + +static App* g_app = nullptr; + +void QuitMessageLoop() { + fsl::MessageLoop::GetCurrent()->QuitNow(); +} + +std::string GetLabelFromURL(const std::string& url) { + size_t last_slash = url.rfind('/'); + if (last_slash == std::string::npos || last_slash + 1 == url.length()) + return url; + return url.substr(last_slash + 1); +} + +} // namespace + +App::App() { + g_app = this; + context_ = component::ApplicationContext::CreateFromStartupInfo(); + + gpu_thread_ = std::make_unique(); + io_thread_ = std::make_unique(); + + auto gpu_thread_success = gpu_thread_->Run(); + auto io_thread_success = io_thread_->Run(); + + FXL_CHECK(gpu_thread_success) << "Must be able to create the GPU thread"; + FXL_CHECK(io_thread_success) << "Must be able to create the IO thread"; + + auto ui_task_runner = fsl::MessageLoop::GetCurrent()->task_runner(); + auto gpu_task_runner = gpu_thread_->TaskRunner(); + auto io_task_runner = io_thread_->TaskRunner(); + + // Notice that the Platform and UI threads are actually the same. + blink::Threads::Set(blink::Threads(ui_task_runner, // Platform + gpu_task_runner, // GPU + ui_task_runner, // UI + io_task_runner // IO + )); + + if (!icu_data::Initialize(context_.get())) { + FXL_LOG(ERROR) << "Could not initialize ICU data."; + } + + blink::Settings settings; + settings.enable_observatory = true; + blink::Settings::Set(settings); + + fonts::FontProviderPtr font_provider( + context_->ConnectToEnvironmentService()); + if (settings.using_blink) { + blink::SetFontProvider(std::move(font_provider)); + } else { + blink::FontCollection::ForProcess().GetFontCollection()-> + SetAssetFontManager( + sk_make_sp(std::move(font_provider))); + } + + context_->outgoing_services()->AddService( + [this](fidl::InterfaceRequest request) { + runner_bindings_.AddBinding(this, std::move(request)); + }); +} + +App::~App() { + icu_data::Release(); + blink::Threads::Gpu()->PostTask(QuitMessageLoop); + blink::Threads::IO()->PostTask(QuitMessageLoop); + g_app = nullptr; +} + +App& App::Shared() { + FXL_DCHECK(g_app); + return *g_app; +} + +void App::WaitForPlatformViewIds( + std::vector* platform_view_ids) { + fxl::AutoResetWaitableEvent latch; + + blink::Threads::UI()->PostTask([this, platform_view_ids, &latch]() { + WaitForPlatformViewsIdsUIThread(platform_view_ids, &latch); + }); + + latch.Wait(); +} + +void App::WaitForPlatformViewsIdsUIThread( + std::vector* platform_view_ids, + fxl::AutoResetWaitableEvent* latch) { + for (auto it = controllers_.begin(); it != controllers_.end(); it++) { + ApplicationControllerImpl* controller = it->first; + + if (!controller) { + continue; + } + + PlatformViewInfo info; + // TODO(zra): We should create real IDs for these instead of relying on the + // address of the controller. Maybe just use the UI Isolate main port? + info.view_id = reinterpret_cast(controller); + info.isolate_id = controller->GetUIIsolateMainPort(); + info.isolate_name = controller->GetUIIsolateName(); + platform_view_ids->push_back(info); + } + latch->Signal(); +} + +void App::StartApplication( + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) { + if (controllers_.empty()) { + // Name this process after the url of the first application being launched. + base_label_ = "flutter:" + GetLabelFromURL(startup_info.launch_info.url); + } + + std::unique_ptr impl = + std::make_unique(this, std::move(application), + std::move(startup_info), + std::move(controller)); + ApplicationControllerImpl* key = impl.get(); + controllers_.emplace(key, std::move(impl)); + + UpdateProcessLabel(); +} + +void App::Destroy(ApplicationControllerImpl* controller) { + auto it = controllers_.find(controller); + if (it == controllers_.end()) + return; + controllers_.erase(it); + UpdateProcessLabel(); +} + +void App::UpdateProcessLabel() { + std::string label; + if (controllers_.size() < 2) { + label = base_label_; + } else { + std::string suffix = " (+" + std::to_string(controllers_.size() - 1) + ")"; + if (base_label_.size() + suffix.size() <= ZX_MAX_NAME_LEN - 1) { + label = base_label_ + suffix; + } else { + label = base_label_.substr(0, ZX_MAX_NAME_LEN - 1 - suffix.size() - 3) + + "..." + suffix; + } + } + zx::process::self().set_property(ZX_PROP_NAME, label.c_str(), label.size()); +} + +} // namespace flutter_runner diff --git a/content_handler/app.h b/content_handler/app.h new file mode 100644 index 0000000000000..dc8c49927d897 --- /dev/null +++ b/content_handler/app.h @@ -0,0 +1,64 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_CONTENT_HANDLER_APP_H_ +#define FLUTTER_CONTENT_HANDLER_APP_H_ + +#include +#include + +#include "flutter/content_handler/application_controller_impl.h" +#include "lib/app/cpp/application_context.h" +#include +#include "lib/fsl/threading/thread.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/synchronization/waitable_event.h" + +namespace flutter_runner { + +class App : public component::ApplicationRunner { + public: + App(); + ~App(); + + static App& Shared(); + + // |component::ApplicationRunner| implementation: + + void StartApplication( + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) override; + + void Destroy(ApplicationControllerImpl* controller); + + struct PlatformViewInfo { + uintptr_t view_id; + int64_t isolate_id; + std::string isolate_name; + }; + + void WaitForPlatformViewIds(std::vector* platform_view_ids); + + private: + void WaitForPlatformViewsIdsUIThread( + std::vector* platform_view_ids, + fxl::AutoResetWaitableEvent* latch); + void UpdateProcessLabel(); + + std::unique_ptr context_; + std::unique_ptr gpu_thread_; + std::unique_ptr io_thread_; + fidl::BindingSet runner_bindings_; + std::unordered_map> + controllers_; + std::string base_label_; + + FXL_DISALLOW_COPY_AND_ASSIGN(App); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_APP_H_ diff --git a/content_handler/application.cc b/content_handler/application.cc deleted file mode 100644 index 7dd2270d42317..0000000000000 --- a/content_handler/application.cc +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "application.h" - -#include -#include - -#include - -#include "flutter/shell/common/switches.h" -#include "lib/fsl/vmo/file.h" -#include "lib/fsl/vmo/vector.h" -#include "lib/fxl/command_line.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "task_observers.h" - -namespace flutter { - -std::pair, std::unique_ptr> -Application::Create( - Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller) { - auto thread = std::make_unique(); - std::unique_ptr application; - - fxl::AutoResetWaitableEvent latch; - thread->TaskRunner()->PostTask([&]() mutable { - application.reset(new Application(delegate, // - std::move(package), // - std::move(startup_info), // - std::move(controller) // - )); - latch.Signal(); - }); - thread->Run(); - latch.Wait(); - return {std::move(thread), std::move(application)}; -} - -static std::string DebugLabelForURL(const std::string url) { - auto found = url.rfind("/"); - if (found == std::string::npos) { - return url; - } else { - return {url, found + 1}; - } -} - -Application::Application( - Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest - application_controller_request) - : delegate_(delegate), - debug_label_(DebugLabelForURL(startup_info->launch_info->url)), - application_controller_(this) { - application_controller_.set_error_handler([this]() { Kill(); }); - - FXL_DCHECK(fdio_ns_.is_valid()); - // ApplicationLaunchInfo::url non-optional. - auto& launch_info = startup_info->launch_info; - - // ApplicationLaunchInfo::arguments optional. - if (auto& arguments = launch_info->arguments) { - settings_ = shell::SettingsFromCommandLine( - fxl::CommandLineFromIterators(arguments->begin(), arguments->end())); - } - - // TODO: ApplicationLaunchInfo::out optional. - - // TODO: ApplicationLaunchInfo::err optional. - - // ApplicationLaunchInfo::service_request optional. - if (launch_info->directory_request) { - service_provider_bridge_.ServeDirectory( - std::move(launch_info->directory_request)); - } - - // ApplicationLaunchInfo::flat_namespace optional. - if (auto& flat_namespace = startup_info->flat_namespace) { - for (size_t i = 0; i < flat_namespace->paths->size(); ++i) { - const auto& path = flat_namespace->paths->at(i); - if (path == "/svc") { - continue; - } - - zx::channel dir = std::move(flat_namespace->directories->at(i)); - zx_handle_t dir_handle = dir.release(); - if (fdio_ns_bind(fdio_ns_.get(), path->data(), dir_handle) != ZX_OK) { - FXL_DLOG(ERROR) << "Could not bind path to namespace: " << path; - zx_handle_close(dir_handle); - } - } - } else { - FXL_DLOG(ERROR) << "There was no flat namespace."; - } - - application_directory_.reset(fdio_ns_opendir(fdio_ns_.get())); - FXL_DCHECK(application_directory_.is_valid()); - - application_assets_directory_.reset( - openat(application_directory_.get(), "pkg/data", O_RDONLY | O_DIRECTORY)); - - // TODO: ApplicationLaunchInfo::additional_services optional. - - // ApplicationPackage::data: This is legacy FLX data. Ensure that we dont have - // any. - FXL_DCHECK(!package->data) << "Legacy FLX data must not be supplied."; - - // All launch arguments have been read. Perform service binding and - // final settings configuration. The next call will be to create a view - // for this application. - - service_provider_bridge_.AddService( - std::bind(&Application::CreateShellForView, this, std::placeholders::_1)); - - component::ServiceProviderPtr outgoing_services; - outgoing_services_request_ = outgoing_services.NewRequest(); - service_provider_bridge_.set_backend(std::move(outgoing_services)); - - // Setup the application controller binding. - if (application_controller_request) { - application_controller_.Bind(std::move(application_controller_request)); - } - - application_context_ = - component::ApplicationContext::CreateFrom(std::move(startup_info)); - - settings_.enable_observatory = true; - - settings_.icu_data_path = ""; - - settings_.using_blink = false; - - settings_.assets_dir = application_assets_directory_.get(); - - settings_.script_snapshot_path = "snapshot_blob.bin"; - - settings_.log_tag = debug_label_ + std::string{"(flutter)"}; - -#ifndef NDEBUG - // Debug mode - settings_.dart_non_checked_mode = false; -#else // NDEBUG - // Release mode - settings_.dart_non_checked_mode = true; -#endif // NDEBUG - - settings_.task_observer_add = - std::bind(&CurrentMessageLoopAddAfterTaskObserver, std::placeholders::_1, - std::placeholders::_2); - - settings_.task_observer_remove = std::bind( - &CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1); - - AttemptVMLaunchWithCurrentSettings(settings_); -} - -Application::~Application() = default; - -void Application::AttemptVMLaunchWithCurrentSettings( - const blink::Settings& settings) const { - if (blink::DartVM::ForProcessIfInitialized()) { - return; - } - - if (!blink::DartVM::IsRunningPrecompiledCode()) { - // We will be initializing the VM lazily in this case. - return; - } - - fsl::SizedVmo dylib_vmo; - - if (!fsl::VmoFromFilenameAt( - application_assets_directory_.get() /* /pkg/data */, "libapp.so", - &dylib_vmo)) { - FXL_LOG(ERROR) << "Dylib containing VM and isolate snapshots does not " - "exist. Will not be able to launch VM."; - return; - } - - dlerror(); - - auto library_handle = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); - - if (library_handle == nullptr) { - FXL_LOG(ERROR) << "Could not open dylib: " << dlerror(); - return; - } - - auto lib = fxl::MakeRefCounted( - library_handle, // library handle - true // close the handle when done - ); - - auto symbol = [](const char* str) { - return std::string{"_"} + std::string{str}; - }; - - fxl::RefPtr vm_snapshot = - fxl::MakeRefCounted( - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kVMDataSymbol).c_str()), - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kVMInstructionsSymbol).c_str())); - - fxl::RefPtr isolate_snapshot = - fxl::MakeRefCounted( - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kIsolateDataSymbol).c_str()), - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, - symbol(blink::DartSnapshot::kIsolateInstructionsSymbol).c_str())); - - blink::DartVM::ForProcess(settings_, // - std::move(vm_snapshot), // - std::move(isolate_snapshot) // - ); - if (blink::DartVM::ForProcessIfInitialized()) { - FXL_DLOG(INFO) << "VM successfully initialized for AOT mode."; - } else { - FXL_LOG(ERROR) << "VM could not be initialized for AOT mode."; - } -} - -// |component::ApplicationController| -void Application::Kill() { - if (last_return_code_.first) { - for (auto wait_callback : wait_callbacks_) { - wait_callback(last_return_code_.second); - } - } - wait_callbacks_.clear(); - - delegate_.OnApplicationTerminate(this); - // WARNING: Don't do anything past this point as this instance may have been - // collected. -} - -// |component::ApplicationController| -void Application::Detach() { - application_controller_.set_error_handler(nullptr); -} - -// |component::ApplicationController| -void Application::Wait(const WaitCallback& callback) { - wait_callbacks_.emplace_back(std::move(callback)); -} - -// |flutter::Engine::Delegate| -void Application::OnEngineTerminate(const Engine* shell_holder) { - auto found = std::find_if(shell_holders_.begin(), shell_holders_.end(), - [shell_holder](const auto& holder) { - return holder.get() == shell_holder; - }); - - if (found == shell_holders_.end()) { - return; - } - - // We may launch multiple shell in this application. However, we will - // terminate when the last shell goes away. The error code return to the - // application controller will be the last isolate that had an error. - auto return_code = shell_holder->GetEngineReturnCode(); - if (return_code.first) { - last_return_code_ = return_code; - } - - shell_holders_.erase(found); - - if (shell_holders_.size() == 0) { - Kill(); - // WARNING: Don't do anything past this point because the delegate may have - // collected this instance via the termination callback. - } -} - -void Application::CreateShellForView( - f1dl::InterfaceRequest view_provider_request) { - shells_bindings_.AddBinding(this, std::move(view_provider_request)); -} - -// |mozart::ViewProvider| -void Application::CreateView( - f1dl::InterfaceRequest view_owner, - f1dl::InterfaceRequest) { - if (!application_context_) { - FXL_DLOG(ERROR) << "Application context was invalid when attempting to " - "create a shell for a view provider request."; - return; - } - - // This method may be called multiple times. Care must be taken to ensure that - // all arguments can be accessed or synthesized multiple times. - // TODO(chinmaygarde): Figure out how to re-create the outgoing service - // request handle. - shell_holders_.emplace(std::make_unique( - *this, // delegate - debug_label_, // thread label - *application_context_, // application context - settings_, // settings - std::move(view_owner), // view owner - fdio_ns_, // FDIO namespace - std::move(outgoing_services_request_) // outgoing request - )); -} - -} // namespace flutter diff --git a/content_handler/application.h b/content_handler/application.h deleted file mode 100644 index e4f5da105cac8..0000000000000 --- a/content_handler/application.h +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include -#include - -#include "engine.h" -#include "flutter/common/settings.h" -#include "lib/app/cpp/application_context.h" -#include "lib/app/fidl/application_controller.fidl.h" -#include "lib/fidl/cpp/bindings/binding_set.h" -#include "lib/fsl/threading/thread.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" -#include "lib/svc/cpp/service_provider_bridge.h" -#include "lib/ui/views/fidl/view_provider.fidl.h" -#include "unique_fdio_ns.h" - -namespace flutter { - -// Represents an instance of a Flutter application that contains one of more -// Flutter engine instances. -class Application final : public Engine::Delegate, - public component::ApplicationController, - public mozart::ViewProvider { - public: - class Delegate { - public: - virtual void OnApplicationTerminate(const Application* application) = 0; - }; - - // Creates a dedicated thread to run the application and constructions the - // application on it. The application can be accessed only on this thread. - // This is a synchronous operation. - static std::pair, std::unique_ptr> - Create(Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller); - - // Must be called on the same thread returned from the create call. The thread - // may be collected after. - ~Application(); - - private: - blink::Settings settings_; - Delegate& delegate_; - const std::string debug_label_; - UniqueFDIONS fdio_ns_ = UniqueFDIONSCreate(); - fxl::UniqueFD application_directory_; - fxl::UniqueFD application_assets_directory_; - f1dl::Binding application_controller_; - f1dl::InterfaceRequest outgoing_services_request_; - component::ServiceProviderBridge service_provider_bridge_; - std::unique_ptr application_context_; - f1dl::BindingSet shells_bindings_; - std::set> shell_holders_; - std::vector wait_callbacks_; - std::pair last_return_code_; - - Application( - Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller); - - // |component::ApplicationController| - void Kill() override; - - // |component::ApplicationController| - void Detach() override; - - // |component::ApplicationController| - void Wait(const WaitCallback& callback) override; - - // |mozart::ViewProvider| - void CreateView( - f1dl::InterfaceRequest view_owner, - f1dl::InterfaceRequest services) override; - - // |flutter::Engine::Delegate| - void OnEngineTerminate(const Engine* holder) override; - - void CreateShellForView( - f1dl::InterfaceRequest view_provider_request); - - void AttemptVMLaunchWithCurrentSettings( - const blink::Settings& settings) const; - - FXL_DISALLOW_COPY_AND_ASSIGN(Application); -}; - -} // namespace flutter diff --git a/content_handler/application_controller_impl.cc b/content_handler/application_controller_impl.cc new file mode 100644 index 0000000000000..9a1b449138a1b --- /dev/null +++ b/content_handler/application_controller_impl.cc @@ -0,0 +1,148 @@ +// Copyright 2016 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. + +#include "flutter/content_handler/application_controller_impl.h" + +#include + +#include +#include + +#include "flutter/content_handler/app.h" +#include "flutter/content_handler/runtime_holder.h" +#include "lib/app/cpp/connect.h" +#include "lib/fsl/vmo/vector.h" +#include "lib/fxl/logging.h" + +namespace flutter_runner { + +ApplicationControllerImpl::ApplicationControllerImpl( + App* app, + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) + : app_(app), binding_(this) { + if (controller.is_valid()) { + binding_.Bind(std::move(controller)); + binding_.set_error_handler([this] { + app_->Destroy(this); + // |this| has been deleted at this point. + }); + } + + std::vector bundle; + if (application.data) { + if (!fsl::VectorFromVmo(std::move(*application.data), &bundle)) { + FXL_LOG(ERROR) << "Failed to receive bundle."; + return; + } + } + + // TODO(jeffbrown): Decide what to do with command-line arguments and + // startup handles. + + if (startup_info.launch_info.directory_request.is_valid()) { + service_provider_bridge_.ServeDirectory( + std::move(startup_info.launch_info.directory_request)); + } + + service_provider_bridge_.AddService( + [this](fidl::InterfaceRequest request) { + view_provider_bindings_.AddBinding(this, std::move(request)); + }); + + component::ServiceProviderPtr service_provider; + auto request = service_provider.NewRequest(); + service_provider_bridge_.set_backend(std::move(service_provider)); + + fdio_ns_t* fdio_ns = SetupNamespace(&startup_info.flat_namespace); + if (fdio_ns == nullptr) { + FXL_LOG(ERROR) << "Failed to initialize namespace"; + return; + } + + url_ = startup_info.launch_info.url; + runtime_holder_.reset(new RuntimeHolder()); + runtime_holder_->SetMainIsolateShutdownCallback([this]() { Kill(); }); + runtime_holder_->Init( + fdio_ns, + component::ApplicationContext::CreateFrom(std::move(startup_info)), + std::move(request), std::move(bundle)); +} + +ApplicationControllerImpl::~ApplicationControllerImpl() = default; + +constexpr char kServiceRootPath[] = "/svc"; + +fdio_ns_t* ApplicationControllerImpl::SetupNamespace( + component::FlatNamespace* flat) { + fdio_ns_t* fdio_namespc; + zx_status_t status = fdio_ns_create(&fdio_namespc); + if (status != ZX_OK) { + FXL_LOG(ERROR) << "Failed to create namespace"; + return nullptr; + } + for (size_t i = 0; i < flat->paths->size(); ++i) { + if (flat->paths->at(i) == kServiceRootPath) { + // Ownership of /svc goes to the ApplicationContext created above. + continue; + } + zx::channel dir = std::move(flat->directories->at(i)); + zx_handle_t dir_handle = dir.release(); + const char* path = flat->paths->at(i)->data(); + status = fdio_ns_bind(fdio_namespc, path, dir_handle); + if (status != ZX_OK) { + FXL_LOG(ERROR) << "Failed to bind " << flat->paths->at(i) + << " to namespace"; + zx_handle_close(dir_handle); + fdio_ns_destroy(fdio_namespc); + return nullptr; + } + } + return fdio_namespc; +} + +void ApplicationControllerImpl::Kill() { + SendReturnCode(runtime_holder_->return_code()); + runtime_holder_.reset(); + app_->Destroy(this); + // |this| has been deleted at this point. +} + +void ApplicationControllerImpl::Detach() { + binding_.set_error_handler(fxl::Closure()); +} + +void ApplicationControllerImpl::Wait(WaitCallback callback) { + wait_callbacks_.push_back(std::move(callback)); +} + +void ApplicationControllerImpl::SendReturnCode(int32_t return_code) { + for (const auto& iter : wait_callbacks_) { + iter(return_code); + } + wait_callbacks_.clear(); +} + +void ApplicationControllerImpl::CreateView( + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services) { + runtime_holder_->CreateView(url_, std::move(view_owner_request), + std::move(services)); +} + +Dart_Port ApplicationControllerImpl::GetUIIsolateMainPort() { + if (!runtime_holder_) + return ILLEGAL_PORT; + return runtime_holder_->GetUIIsolateMainPort(); +} + +std::string ApplicationControllerImpl::GetUIIsolateName() { + if (!runtime_holder_) { + return ""; + } + return runtime_holder_->GetUIIsolateName(); +} + +} // namespace flutter_runner diff --git a/content_handler/application_controller_impl.h b/content_handler/application_controller_impl.h new file mode 100644 index 0000000000000..01700f2886ffb --- /dev/null +++ b/content_handler/application_controller_impl.h @@ -0,0 +1,76 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ +#define FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ + +#include + +#include + +#include +#include +#include + +#include "lib/fidl/cpp/binding.h" +#include "lib/fidl/cpp/binding_set.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "lib/svc/cpp/service_provider_bridge.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace flutter_runner { +class App; +class RuntimeHolder; + +class ApplicationControllerImpl : public component::ApplicationController, + public views_v1::ViewProvider { + public: + ApplicationControllerImpl( + App* app, + component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller); + + ~ApplicationControllerImpl() override; + + // |component::ApplicationController| implementation + + void Kill() override; + void Detach() override; + void Wait(WaitCallback callback) override; + + // |views_v1::ViewProvider| implementation + + void CreateView( + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services) override; + + Dart_Port GetUIIsolateMainPort(); + std::string GetUIIsolateName(); + + private: + void StartRuntimeIfReady(); + void SendReturnCode(int32_t return_code); + + fdio_ns_t* SetupNamespace(component::FlatNamespace* flat); + + App* app_; + fidl::Binding binding_; + + component::ServiceProviderBridge service_provider_bridge_; + + fidl::BindingSet view_provider_bindings_; + + std::string url_; + std::unique_ptr runtime_holder_; + + std::vector wait_callbacks_; + + FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationControllerImpl); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc deleted file mode 100644 index 2d77f43cbdd45..0000000000000 --- a/content_handler/application_runner.cc +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "application_runner.h" - -#include - -#include "flutter/lib/ui/text/font_collection.h" -#include "fuchsia_font_manager.h" -#include "lib/fonts/fidl/font_provider.fidl.h" -#include "lib/icu_data/cpp/icu_data.h" - -namespace flutter { - -ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) - : on_termination_callback_(std::move(on_termination_callback)), - host_context_(component::ApplicationContext::CreateFromStartupInfo()) { - SetupICU(); - - SetupGlobalFonts(); - - const std::string process_label = "flutter"; - zx::process::self().set_property(ZX_PROP_NAME, process_label.c_str(), - process_label.size()); - - host_context_->outgoing_services()->AddService( - std::bind(&ApplicationRunner::RegisterApplication, this, - std::placeholders::_1)); - - active_applications_bindings_.set_empty_set_handler( - [this]() { FireTerminationCallbackIfNecessary(); }); -} - -ApplicationRunner::~ApplicationRunner() { - host_context_->outgoing_services() - ->RemoveService(); -} - -void ApplicationRunner::RegisterApplication( - f1dl::InterfaceRequest request) { - active_applications_bindings_.AddBinding(this, std::move(request)); -} - -void ApplicationRunner::StartApplication( - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller) { - auto thread_application_pair = - Application::Create(*this, // delegate - std::move(package), // application pacakge - std::move(startup_info), // startup info - std::move(controller) // controller request - ); - active_applications_[thread_application_pair.second.get()] = - std::move(thread_application_pair); -} - -void ApplicationRunner::OnApplicationTerminate(const Application* application) { - active_applications_.erase(application); - FireTerminationCallbackIfNecessary(); -} - -void ApplicationRunner::SetupICU() { - if (!icu_data::Initialize(host_context_.get())) { - FXL_LOG(ERROR) << "Could not initialize ICU data."; - } -} - -void ApplicationRunner::SetupGlobalFonts() { - fonts::FontProviderPtr font_provider( - host_context_->ConnectToEnvironmentService()); - auto font_manager = - sk_make_sp(std::move(font_provider)); - blink::FontCollection::ForProcess() - .GetFontCollection() - ->SetDefaultFontManager(std::move(font_manager)); -} - -void ApplicationRunner::FireTerminationCallbackIfNecessary() { - // We have no reason to exist if: - // 1: No previously launched applications are running. - // 2: No bindings exist that may require launching more applications. - if (on_termination_callback_ && active_applications_.size() == 0 && - active_applications_bindings_.size() == 0) { - on_termination_callback_(); - } -} - -} // namespace flutter diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h deleted file mode 100644 index fdf5b4420dc0f..0000000000000 --- a/content_handler/application_runner.h +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include - -#include "application.h" -#include "lib/app/cpp/application_context.h" -#include "lib/app/fidl/application_runner.fidl.h" -#include "lib/fidl/cpp/bindings/binding_set.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/macros.h" - -namespace flutter { - -// Publishes the |component::ApplicationRunner| service and runs applications on -// their own threads. -class ApplicationRunner final : public Application::Delegate, - public component::ApplicationRunner { - public: - ApplicationRunner(fxl::Closure on_termination_callback); - - ~ApplicationRunner(); - - private: - struct ActiveApplication { - std::unique_ptr thread; - std::unique_ptr application; - - ActiveApplication(std::pair, - std::unique_ptr> pair) - : thread(std::move(pair.first)), application(std::move(pair.second)) {} - - ActiveApplication() { - if (thread && application) { - thread->TaskRunner()->PostTask( - fxl::MakeCopyable([application = std::move(application)]() mutable { - application.reset(); - fsl::MessageLoop::GetCurrent()->PostQuitTask(); - })); - thread.reset(); // join - } - } - }; - - fxl::Closure on_termination_callback_; - std::unique_ptr host_context_; - f1dl::BindingSet active_applications_bindings_; - std::unordered_map - active_applications_; - - // |component::ApplicationRunner| - void StartApplication(component::ApplicationPackagePtr application, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest - controller) override; - - void RegisterApplication( - f1dl::InterfaceRequest request); - - void UnregisterApplication(const Application* application); - - // |Application::Delegate| - void OnApplicationTerminate(const Application* application) override; - - void SetupICU(); - - void SetupGlobalFonts(); - - void FireTerminationCallbackIfNecessary(); - - FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationRunner); -}; - -} // namespace flutter diff --git a/content_handler/compositor_context.cc b/content_handler/compositor_context.cc deleted file mode 100644 index efad9ac2b9583..0000000000000 --- a/content_handler/compositor_context.cc +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "compositor_context.h" - -#include "flutter/flow/layers/layer_tree.h" -#include "flutter/glue/trace_event.h" - -namespace flutter { - -class ScopedFrame final : public flow::CompositorContext::ScopedFrame { - public: - ScopedFrame(flow::CompositorContext& context, - bool instrumentation_enabled, - SessionConnection& session_connection) - : flow::CompositorContext::ScopedFrame(context, - nullptr, - nullptr, - instrumentation_enabled), - session_connection_(session_connection) {} - - private: - SessionConnection& session_connection_; - - bool Raster(flow::LayerTree& layer_tree, bool ignore_raster_cache) override { - if (!session_connection_.has_metrics()) { - return true; - } - - { - // Preroll the Flutter layer tree. This allows Flutter to perform - // pre-paint optimizations. - TRACE_EVENT0("flutter", "Preroll"); - layer_tree.Preroll(*this, true /* ignore raster cache */); - } - - { - // Traverse the Flutter layer tree so that the necessary session ops to - // represent the frame are enqueued in the underlying session. - TRACE_EVENT0("flutter", "UpdateScene"); - layer_tree.UpdateScene(session_connection_.scene_update_context(), - session_connection_.root_node()); - } - - { - // Flush all pending session ops. - TRACE_EVENT0("flutter", "SessionPresent"); - session_connection_.Present(*this); - } - - return true; - } - - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); -}; - -CompositorContext::CompositorContext( - const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback) - : debug_label_(std::move(debug_label)), - session_connection_(scenic, - debug_label_, - std::move(import_token), - std::move(session_metrics_did_change_callback), - std::move(session_error_callback)) {} - -CompositorContext::~CompositorContext() = default; - -std::unique_ptr -CompositorContext::AcquireFrame(GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled) { - // TODO: The AcquireFrame interface is too broad and must be refactored to get - // rid of the context and canvas arguments as those seem to be only used for - // colorspace correctness purposes on the mobile shells. - return std::make_unique(*this, // - instrumentation_enabled, // - session_connection_ // - ); -} - -} // namespace flutter diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h deleted file mode 100644 index a6e5429c6072c..0000000000000 --- a/content_handler/compositor_context.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "flutter/flow/compositor_context.h" -#include "garnet/public/lib/ui/scenic/fidl/scenic.fidl-common.h" -#include "lib/fxl/macros.h" -#include "session_connection.h" - -namespace flutter { - -// Holds composition specific state and bindings specific to composition on -// Fuchsia. -class CompositorContext final : public flow::CompositorContext { - public: - CompositorContext(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback); - - ~CompositorContext() override; - - private: - const std::string debug_label_; - SessionConnection session_connection_; - - // |flow::CompositorContext| - std::unique_ptr AcquireFrame( - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled) override; - - FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); -}; - -} // namespace flutter diff --git a/content_handler/engine.cc b/content_handler/engine.cc deleted file mode 100644 index 3349c09bdf1af..0000000000000 --- a/content_handler/engine.cc +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "engine.h" - -#include - -#include "flutter/common/task_runners.h" -#include "flutter/fml/task_runner.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/run_configuration.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "platform_view.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace flutter { - -Engine::Engine(Delegate& delegate, - std::string thread_label, - component::ApplicationContext& application_context, - blink::Settings settings, - f1dl::InterfaceRequest view_owner, - const UniqueFDIONS& fdio_ns, - f1dl::InterfaceRequest - outgoing_services_request) - : delegate_(delegate), - thread_label_(std::move(thread_label)), - settings_(std::move(settings)), - weak_factory_(this) { - // Launch the threads that will be used to run the shell. These threads will - // be joined in the destructor. - for (auto& thread : host_threads_) { - thread.Run(); - } - - mozart::ViewManagerPtr view_manager; - application_context.ConnectToEnvironmentService(view_manager.NewRequest()); - - zx::eventpair import_token, export_token; - if (zx::eventpair::create(0u, &import_token, &export_token) != ZX_OK) { - FXL_DLOG(ERROR) << "Could not create event pair."; - return; - } - - // Setup the session connection. - ui::ScenicPtr scenic; - view_manager->GetScenic(scenic.NewRequest()); - - // Grab the parent environent services. The platform view may want to access - // some of these services. - component::ServiceProviderPtr parent_environment_service_provider; - application_context.environment()->GetServices( - parent_environment_service_provider.NewRequest()); - - // We need to manually schedule a frame when the session metrics change. - OnMetricsUpdate on_session_metrics_change_callback = std::bind( - &Engine::OnSessionMetricsDidChange, this, std::placeholders::_1); - - fxl::Closure on_session_error_callback = std::bind(&Engine::Terminate, this); - - // Grab the accessibilty context writer that can understand the semtics tree - // on the platform view. - maxwell::ContextWriterPtr accessibility_context_writer; - application_context.ConnectToEnvironmentService( - accessibility_context_writer.NewRequest()); - - // Setup the callback that will instantiate the platform view. - shell::Shell::CreateCallback on_create_platform_view = - fxl::MakeCopyable([debug_label = thread_label_, // - parent_environment_service_provider = - std::move(parent_environment_service_provider), // - view_manager = std::ref(view_manager), // - view_owner = std::move(view_owner), // - scenic = std::move(scenic), // - accessibility_context_writer = - std::move(accessibility_context_writer), // - export_token = std::move(export_token), // - import_token = std::move(import_token), // - on_session_metrics_change_callback, // - on_session_error_callback // - ](shell::Shell& shell) mutable { - return std::make_unique( - shell, // delegate - debug_label, // debug label - shell.GetTaskRunners(), // task runners - std::move(parent_environment_service_provider), // services - view_manager, // view manager - std::move(view_owner), // view owner - std::move(scenic), // scenic - std::move(export_token), // export token - std::move(import_token), // import token - std::move( - accessibility_context_writer), // accessibility context writer - std::move(on_session_metrics_change_callback), // metrics change - std::move(on_session_error_callback) // session_error - ); - }); - - // Setup the callback that will instantiate the rasterizer. - shell::Shell::CreateCallback on_create_rasterizer = - [](shell::Shell& shell) { - return std::make_unique( - shell.GetTaskRunners() // task runners - ); - }; - - // Get the task runners from the managed threads. The current thread will be - // used as the "platform" thread. - blink::TaskRunners task_runners( - thread_label_, // Dart thread labels - fsl::MessageLoop::GetCurrent()->task_runner(), // platform - host_threads_[0].TaskRunner(), // gpu - host_threads_[1].TaskRunner(), // ui - host_threads_[2].TaskRunner() // io - ); - - settings_.root_isolate_create_callback = - std::bind(&Engine::OnMainIsolateStart, this); - - settings_.root_isolate_shutdown_callback = - std::bind([weak = weak_factory_.GetWeakPtr(), - runner = task_runners.GetPlatformTaskRunner()]() { - runner->PostTask([weak = std::move(weak)] { - if (weak) { - weak->OnMainIsolateShutdown(); - } - }); - }); - - shell_ = shell::Shell::Create( - task_runners, // host task runners - settings_, // shell launch settings - on_create_platform_view, // platform view create callback - on_create_rasterizer // rasterizer create callback - ); - - if (!shell_) { - FXL_LOG(ERROR) << "Could not launch the shell with settings: " - << settings_.ToString(); - return; - } - - // Shell has been created. Before we run the engine, setup the isolate - // configurator. - { - PlatformView* platform_view = - static_cast(shell_->GetPlatformView().get()); - auto& view = platform_view->GetMozartView(); - component::ApplicationEnvironmentPtr application_environment; - application_context.ConnectToEnvironmentService( - application_environment.NewRequest()); - - isolate_configurator_ = std::make_unique( - fdio_ns, // - view, // - std::move(application_environment), // - std::move(outgoing_services_request) // - ); - } - - // This platform does not get a separate surface platform view creation - // notification. Fire one eagerly. - shell_->GetPlatformView()->NotifyCreated(); - - // Launch the engine in the appropriate configuration. - auto run_configuration = - shell::RunConfiguration::InferFromSettings(settings_); - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = shell_->GetEngine(), // - run_configuration = std::move(run_configuration) // - ]() mutable { - if (!engine || !engine->Run(std::move(run_configuration))) { - FXL_LOG(ERROR) << "Could not (re)launch the engine in configuration"; - } - })); - - UpdateNativeThreadLabelNames(); -} - -Engine::~Engine() { - for (const auto& thread : host_threads_) { - thread.TaskRunner()->PostTask( - []() { fsl::MessageLoop::GetCurrent()->PostQuitTask(); }); - } -} - -void Engine::UpdateNativeThreadLabelNames() const { - auto set_thread_name = [](fxl::RefPtr runner, - std::string prefix, std::string suffix) { - runner->PostTask([name = prefix + suffix]() { - zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); - }); - }; - auto runners = shell_->GetTaskRunners(); - set_thread_name(runners.GetPlatformTaskRunner(), thread_label_, ".platform"); - set_thread_name(runners.GetUITaskRunner(), thread_label_, ".ui"); - set_thread_name(runners.GetGPUTaskRunner(), thread_label_, ".gpu"); - set_thread_name(runners.GetIOTaskRunner(), thread_label_, ".io"); -} - -std::pair Engine::GetEngineReturnCode() const { - std::pair code(false, 0); - if (!shell_) { - return code; - } - fxl::AutoResetWaitableEvent latch; - fml::TaskRunner::RunNowOrPostTask( - shell_->GetTaskRunners().GetUITaskRunner(), - [&latch, &code, engine = shell_->GetEngine()]() { - if (engine) { - code = engine->GetUIIsolateReturnCode(); - } - latch.Signal(); - }); - latch.Wait(); - return code; -} - -void Engine::OnMainIsolateStart() { - if (!isolate_configurator_ || - !isolate_configurator_->ConfigureCurrentIsolate()) { - FXL_LOG(ERROR) << "Could not configure some native embedder bindings for a " - "new root isolate."; - } -} - -void Engine::OnMainIsolateShutdown() { - Terminate(); -} - -void Engine::Terminate() { - delegate_.OnEngineTerminate(this); - // Warning. Do not do anything after this point as the delegate may have - // collected this object. -} - -void Engine::OnSessionMetricsDidChange(double device_pixel_ratio) { - if (!shell_) { - return; - } - - shell_->GetTaskRunners().GetPlatformTaskRunner()->PostTask( - [platform_view = shell_->GetPlatformView(), device_pixel_ratio]() { - if (platform_view) { - reinterpret_cast(platform_view.get()) - ->UpdateViewportMetrics(device_pixel_ratio); - } - }); -} - -} // namespace flutter diff --git a/content_handler/engine.h b/content_handler/engine.h deleted file mode 100644 index 60c0ad7c2f80d..0000000000000 --- a/content_handler/engine.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "flutter/shell/common/shell.h" -#include "isolate_configurator.h" -#include "lib/app/cpp/application_context.h" -#include "lib/fsl/threading/thread.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/ui/views/fidl/view_manager.fidl.h" - -namespace flutter { - -// Represents an instance of running Flutter engine along with the threads that -// host the same. -class Engine final { - public: - class Delegate { - public: - virtual void OnEngineTerminate(const Engine* holder) = 0; - }; - - Engine(Delegate& delegate, - std::string thread_label, - component::ApplicationContext& application_context, - blink::Settings settings, - f1dl::InterfaceRequest view_owner, - const UniqueFDIONS& fdio_ns, - f1dl::InterfaceRequest - outgoing_services_request); - - ~Engine(); - - // Returns the Dart return code for the root isolate if one is present. This - // call is thread safe and synchronous. This call must be made infrequently. - std::pair GetEngineReturnCode() const; - - private: - Delegate& delegate_; - const std::string thread_label_; - blink::Settings settings_; - std::array host_threads_; - std::unique_ptr isolate_configurator_; - std::unique_ptr shell_; - fxl::WeakPtrFactory weak_factory_; - - void OnMainIsolateStart(); - - void OnMainIsolateShutdown(); - - void Terminate(); - - void OnSessionMetricsDidChange(double device_pixel_ratio); - - void UpdateNativeThreadLabelNames() const; - - FXL_DISALLOW_COPY_AND_ASSIGN(Engine); -}; - -} // namespace flutter diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc index 877c931130eb4..4e409cae94f6a 100644 --- a/content_handler/fuchsia_font_manager.cc +++ b/content_handler/fuchsia_font_manager.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "fuchsia_font_manager.h" +#include "flutter/content_handler/fuchsia_font_manager.h" #include @@ -32,14 +32,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { - if (!fsl::SizedVmo::IsSizeValid(vmo->vmo, vmo->size) || - vmo->size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromBuffer(mem::Buffer data) { + if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || + data.size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = vmo->size; + uint64_t size = data.size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, vmo->vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -49,7 +49,7 @@ sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { fonts::FontSlant ToFontSlant(SkFontStyle::Slant slant) { return (slant == SkFontStyle::kItalic_Slant) ? fonts::FontSlant::ITALIC - : fonts::FontSlant::UPRIGHT; + : fonts::FontSlant::UPRIGHT; } } // anonymous namespace @@ -64,8 +64,7 @@ int FuchsiaFontManager::onCountFamilies() const { return 0; } -void FuchsiaFontManager::onGetFamilyName(int index, - SkString* familyName) const { +void FuchsiaFontManager::onGetFamilyName(int index, SkString* familyName) const { FXL_DCHECK(false); } @@ -88,13 +87,12 @@ SkFontStyleSet* FuchsiaFontManager::onMatchFamily( } SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( - const char family_name[], - const SkFontStyle& style) const { - auto request = fonts::FontRequest::New(); - request->family = family_name; - request->weight = style.weight(); - request->width = style.width(); - request->slant = ToFontSlant(style.slant()); + const char family_name[], const SkFontStyle& style) const { + fonts::FontRequest request; + request.family = family_name; + request.weight = style.weight(); + request.width = style.width(); + request.slant = ToFontSlant(style.slant()); fonts::FontResponsePtr response; font_provider_->GetFont( @@ -102,13 +100,14 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( [&response](fonts::FontResponsePtr r) { response = std::move(r); }); font_provider_.WaitForResponse(); - if (!response) { - FXL_DLOG(ERROR) << "Unable to contact the font provider. Did you run " - "Flutter in an environment that has a font manager?"; + FXL_DCHECK(response) + << "Unable to contact the font provider. Did you run " + "Flutter in an environment that has a font manager?\n"; + + if (!response) return nullptr; - } - sk_sp data = MakeSkDataFromVMO(response->data->vmo); + sk_sp data = MakeSkDataFromBuffer(std::move(response->data.buffer)); if (!data) return nullptr; @@ -128,13 +127,13 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyleCharacter( } SkTypeface* FuchsiaFontManager::onMatchFaceStyle(const SkTypeface*, - const SkFontStyle&) const { + const SkFontStyle&) const { FXL_DCHECK(false); return nullptr; } sk_sp FuchsiaFontManager::onMakeFromData(sk_sp, - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } @@ -154,7 +153,7 @@ sk_sp FuchsiaFontManager::onMakeFromStreamArgs( } sk_sp FuchsiaFontManager::onMakeFromFile(const char path[], - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } diff --git a/content_handler/fuchsia_font_manager.h b/content_handler/fuchsia_font_manager.h index ecfb724b85878..e57d6ef76e72f 100644 --- a/content_handler/fuchsia_font_manager.h +++ b/content_handler/fuchsia_font_manager.h @@ -26,7 +26,7 @@ namespace txt { -class FuchsiaFontManager final : public SkFontMgr { +class FuchsiaFontManager : public SkFontMgr { public: FuchsiaFontManager(fonts::FontProviderPtr provider); diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc deleted file mode 100644 index d085bea698b95..0000000000000 --- a/content_handler/isolate_configurator.cc +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "isolate_configurator.h" - -#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" -#include "dart-pkg/zircon/sdk_ext/handle.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace flutter { - -IsolateConfigurator::IsolateConfigurator( - const UniqueFDIONS& fdio_ns, - mozart::ViewPtr& view, - component::ApplicationEnvironmentPtr application_environment, - f1dl::InterfaceRequest - outgoing_services_request) - : fdio_ns_(fdio_ns), - view_(view), - application_environment_(std::move(application_environment)), - outgoing_services_request_(std::move(outgoing_services_request)) {} - -IsolateConfigurator::~IsolateConfigurator() = default; - -bool IsolateConfigurator::ConfigureCurrentIsolate() { - if (used_) { - return false; - } - used_ = true; - - BindFuchsia(); - BindZircon(); - BindDartIO(); - BindScenic(); - - return true; -} - -// |mozart::NativesDelegate| -mozart::View* IsolateConfigurator::GetMozartView() { - return view_.get(); -} - -void IsolateConfigurator::BindFuchsia() { - fuchsia::dart::Initialize(application_environment_.Unbind(), - std::move(outgoing_services_request_)); -} - -void IsolateConfigurator::BindZircon() { - // Tell dart:zircon about the FDIO namespace configured for this instance. - Dart_Handle zircon_lib = Dart_LookupLibrary(tonic::ToDart("dart:zircon")); - DART_CHECK_VALID(zircon_lib); - - Dart_Handle namespace_type = - Dart_GetType(zircon_lib, tonic::ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - DART_CHECK_VALID( - Dart_SetField(namespace_type, // - tonic::ToDart("_namespace"), // - tonic::ToDart(reinterpret_cast(fdio_ns_.get())))); -} - -void IsolateConfigurator::BindDartIO() { - // Grab the dart:io lib. - Dart_Handle io_lib = Dart_LookupLibrary(tonic::ToDart("dart:io")); - DART_CHECK_VALID(io_lib); - - // Disable dart:io exit() - Dart_Handle embedder_config_type = - Dart_GetType(io_lib, tonic::ToDart("_EmbedderConfig"), 0, nullptr); - DART_CHECK_VALID(embedder_config_type); - DART_CHECK_VALID(Dart_SetField(embedder_config_type, - tonic::ToDart("_mayExit"), Dart_False())); - - // Tell dart:io about the FDIO namespace configured for this instance. - Dart_Handle namespace_type = - Dart_GetType(io_lib, tonic::ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - Dart_Handle namespace_args[] = { - Dart_NewInteger(reinterpret_cast(fdio_ns_.get())), // - }; - DART_CHECK_VALID(namespace_args[0]); - DART_CHECK_VALID(Dart_Invoke(namespace_type, tonic::ToDart("_setupNamespace"), - 1, namespace_args)); -} - -void IsolateConfigurator::BindScenic() { - Dart_Handle mozart_internal = - Dart_LookupLibrary(tonic::ToDart("dart:mozart.internal")); - DART_CHECK_VALID(mozart_internal); - DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, // - mozart::NativeLookup, // - mozart::NativeSymbol) // - ); - DART_CHECK_VALID(Dart_SetField( - mozart_internal, // - tonic::ToDart("_context"), // - tonic::DartConverter::ToDart(reinterpret_cast( - static_cast(this))))); - mozart::ViewContainerPtr view_container; - view_->GetContainer(view_container.NewRequest()); - DART_CHECK_VALID( - Dart_SetField(mozart_internal, // - tonic::ToDart("_viewContainer"), // - tonic::ToDart(zircon::dart::Handle::Create( - view_container.Unbind().TakeChannel().release())))); -} - -} // namespace flutter diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h deleted file mode 100644 index a5da083633ee7..0000000000000 --- a/content_handler/isolate_configurator.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "lib/app/fidl/application_environment.fidl.h" -#include "lib/fxl/macros.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" -#include "lib/ui/views/fidl/view_containers.fidl.h" -#include "lib/ui/views/fidl/views.fidl.h" -#include "unique_fdio_ns.h" - -namespace flutter { - -// Contains all the information necessary to configure a new root isolate. This -// is a single use item. The lifetime of this object must extend past that of -// the root isolate. -class IsolateConfigurator final : mozart::NativesDelegate { - public: - IsolateConfigurator( - const UniqueFDIONS& fdio_ns, - mozart::ViewPtr& view, - component::ApplicationEnvironmentPtr application_environment, - f1dl::InterfaceRequest - outgoing_services_request); - - ~IsolateConfigurator(); - - // Can be used only once and only on the UI thread with the newly created - // isolate already current. - bool ConfigureCurrentIsolate(); - - private: - bool used_ = false; - const UniqueFDIONS& fdio_ns_; - mozart::ViewPtr& view_; - component::ApplicationEnvironmentPtr application_environment_; - f1dl::InterfaceRequest outgoing_services_request_; - - // |mozart::NativesDelegate| - mozart::View* GetMozartView() override; - - void BindFuchsia(); - - void BindZircon(); - - void BindDartIO(); - - void BindScenic(); - - FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfigurator); -}; - -} // namespace flutter diff --git a/content_handler/main.cc b/content_handler/main.cc index 15b8cede5b9b2..d3eac3c81dcbf 100644 --- a/content_handler/main.cc +++ b/content_handler/main.cc @@ -1,26 +1,16 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Copyright 2016 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. #include -#include -#include "application_runner.h" +#include "flutter/content_handler/app.h" #include "lib/fsl/tasks/message_loop.h" -int main(int argc, char const* argv[]) { +int main(int argc, const char** argv) { fsl::MessageLoop loop; - trace::TraceProvider provider(loop.async()); - FXL_DCHECK(provider.is_valid()) << "Trace provider must be valid."; - - FXL_LOG(INFO) << "Flutter application services initialized."; - flutter::ApplicationRunner runner([&loop]() { - loop.PostQuitTask(); - FXL_LOG(INFO) << "Flutter application services terminated. Good bye..."; - }); - + flutter_runner::App app; loop.Run(); - - return EXIT_SUCCESS; + return 0; } diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc deleted file mode 100644 index 8ac41613e449b..0000000000000 --- a/content_handler/platform_view.cc +++ /dev/null @@ -1,551 +0,0 @@ -// Copyright 2018 The Fuchsia 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 RAPIDJSON_HAS_STDSTRING 1 - -#include "platform_view.h" - -#include - -#include "flutter/lib/ui/window/pointer_data.h" -#include "lib/app/cpp/connect.h" -#include "third_party/rapidjson/rapidjson/document.h" -#include "third_party/rapidjson/rapidjson/stringbuffer.h" -#include "third_party/rapidjson/rapidjson/writer.h" - -namespace flutter { - -constexpr char kFlutterPlatformChannel[] = "flutter/platform"; -constexpr char kTextInputChannel[] = "flutter/textinput"; -constexpr char kKeyEventChannel[] = "flutter/keyevent"; - -PlatformView::PlatformView( - PlatformView::Delegate& delegate, - std::string debug_label, - blink::TaskRunners task_runners, - component::ServiceProviderPtr parent_environment_service_provider, - mozart::ViewManagerPtr& view_manager, - f1dl::InterfaceRequest view_owner, - ui::ScenicPtr scenic, - zx::eventpair export_token, - zx::eventpair import_token, - maxwell::ContextWriterPtr accessibility_context_writer, - OnMetricsUpdate on_session_metrics_did_change, - fxl::Closure session_error_callback) - : shell::PlatformView(delegate, std::move(task_runners)), - debug_label_(std::move(debug_label)), - view_listener_(this), - input_listener_(this), - ime_client_(this), - scenic_(std::move(scenic)), - accessibility_bridge_(std::move(accessibility_context_writer)), - surface_( - std::make_unique(scenic_, - debug_label_, - std::move(import_token), - std::move(on_session_metrics_did_change), - std::move(session_error_callback))) { - // Create the view. - view_manager->CreateView(view_.NewRequest(), // view - std::move(view_owner), // view owner - view_listener_.NewBinding(), // view listener - std::move(export_token), // export token - debug_label_ // diagnostic label - ); - - // Get the services from the created view. - component::ServiceProviderPtr service_provider; - view_->GetServiceProvider(service_provider.NewRequest()); - - // Get the input connection from the services of the view. - component::ConnectToService(service_provider.get(), - input_connection_.NewRequest()); - - // Set the input listener on the input connection. - input_connection_->SetEventListener(input_listener_.NewBinding()); - - // Access the clipboard. - component::ConnectToService(parent_environment_service_provider.get(), - clipboard_.NewRequest()); - - // Finally! Register the native platform message handlers. - RegisterPlatformMessageHandlers(); -} - -PlatformView::~PlatformView() = default; - -void PlatformView::RegisterPlatformMessageHandlers() { - platform_message_handlers_[kFlutterPlatformChannel] = - std::bind(&PlatformView::HandleFlutterPlatformChannelPlatformMessage, // - this, // - std::placeholders::_1); - platform_message_handlers_[kTextInputChannel] = - std::bind(&PlatformView::HandleFlutterTextInputChannelPlatformMessage, // - this, // - std::placeholders::_1); -} - -mozart::ViewPtr& PlatformView::GetMozartView() { - return view_; -} - -// |mozart::ViewListener| -void PlatformView::OnPropertiesChanged( - mozart::ViewPropertiesPtr properties, - const OnPropertiesChangedCallback& callback) { - UpdateViewportMetrics(properties->view_layout); - callback(); -} - -void PlatformView::UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout) { - if (!layout) { - return; - } - - metrics_.size.width = layout->size->width; - metrics_.size.height = layout->size->height; - - metrics_.padding.left = layout->inset->left; - metrics_.padding.top = layout->inset->top; - metrics_.padding.right = layout->inset->right; - metrics_.padding.bottom = layout->inset->bottom; - - FlushViewportMetrics(); -} - -void PlatformView::UpdateViewportMetrics(double pixel_ratio) { - metrics_.scale = pixel_ratio; - - FlushViewportMetrics(); -} - -void PlatformView::FlushViewportMetrics() { - const auto scale = metrics_.scale; - blink::ViewportMetrics metrics = { - .device_pixel_ratio = static_cast(scale), - - .physical_width = static_cast(metrics_.size.width * scale), - .physical_height = static_cast(metrics_.size.height * scale), - - .physical_padding_top = - static_cast(metrics_.padding.top * scale), - .physical_padding_right = - static_cast(metrics_.padding.right * scale), - .physical_padding_bottom = - static_cast(metrics_.padding.bottom * scale), - .physical_padding_left = - static_cast(metrics_.padding.left * scale), - - .physical_view_inset_top = - static_cast(metrics_.view_inset.top * scale), - .physical_view_inset_right = - static_cast(metrics_.view_inset.right * scale), - .physical_view_inset_bottom = - static_cast(metrics_.view_inset.bottom * scale), - .physical_view_inset_left = - static_cast(metrics_.view_inset.left * scale), - }; - - SetViewportMetrics(metrics); -} - -// |mozart::InputMethodEditorClient| -void PlatformView::DidUpdateState(mozart::TextInputStatePtr state, - mozart::InputEventPtr event) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - rapidjson::Value encoded_state(rapidjson::kObjectType); - encoded_state.AddMember("text", state->text.get(), allocator); - encoded_state.AddMember("selectionBase", state->selection->base, allocator); - encoded_state.AddMember("selectionExtent", state->selection->extent, - allocator); - switch (state->selection->affinity) { - case mozart::TextAffinity::UPSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.upstream"), - allocator); - break; - case mozart::TextAffinity::DOWNSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.downstream"), - allocator); - break; - } - encoded_state.AddMember("selectionIsDirectional", true, allocator); - encoded_state.AddMember("composingBase", state->composing->start, allocator); - encoded_state.AddMember("composingExtent", state->composing->end, allocator); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - args.PushBack(encoded_state, allocator); - - document.SetObject(); - document.AddMember("method", - rapidjson::Value("TextInputClient.updateEditingState"), - allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, // channel - std::vector(data, data + buffer.GetSize()), // message - nullptr) // response - ); -} - -// |mozart::InputMethodEditorClient| -void PlatformView::OnAction(mozart::InputMethodAction action) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - - // Done is currently the only text input action defined by Flutter. - args.PushBack("TextInputAction.done", allocator); - - document.SetObject(); - document.AddMember( - "method", rapidjson::Value("TextInputClient.performAction"), allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, // channel - std::vector(data, data + buffer.GetSize()), // message - nullptr) // response - ); -} - -// |mozart::InputListener| -void PlatformView::OnEvent(mozart::InputEventPtr event, - const OnEventCallback& callback) { - using Type = mozart::InputEvent::Tag; - switch (event->which()) { - case Type::POINTER: - callback(OnHandlePointerEvent(event->get_pointer())); - return; - case Type::KEYBOARD: - callback(OnHandleKeyboardEvent(event->get_keyboard())); - return; - case Type::FOCUS: - callback(OnHandleFocusEvent(event->get_focus())); - return; - case Type::__UNKNOWN__: - break; - } - - callback(false); -} - -static blink::PointerData::Change GetChangeFromPointerEventPhase( - mozart::PointerEvent::Phase phase) { - switch (phase) { - case mozart::PointerEvent::Phase::ADD: - return blink::PointerData::Change::kAdd; - case mozart::PointerEvent::Phase::HOVER: - return blink::PointerData::Change::kHover; - case mozart::PointerEvent::Phase::DOWN: - return blink::PointerData::Change::kDown; - case mozart::PointerEvent::Phase::MOVE: - return blink::PointerData::Change::kMove; - case mozart::PointerEvent::Phase::UP: - return blink::PointerData::Change::kUp; - case mozart::PointerEvent::Phase::REMOVE: - return blink::PointerData::Change::kRemove; - case mozart::PointerEvent::Phase::CANCEL: - return blink::PointerData::Change::kCancel; - default: - return blink::PointerData::Change::kCancel; - } -} - -static blink::PointerData::DeviceKind GetKindFromPointerType( - mozart::PointerEvent::Type type) { - switch (type) { - case mozart::PointerEvent::Type::TOUCH: - return blink::PointerData::DeviceKind::kTouch; - case mozart::PointerEvent::Type::MOUSE: - return blink::PointerData::DeviceKind::kMouse; - default: - return blink::PointerData::DeviceKind::kTouch; - } -} - -bool PlatformView::OnHandlePointerEvent( - const mozart::PointerEventPtr& pointer) { - blink::PointerData pointer_data; - pointer_data.time_stamp = pointer->event_time / 1000; - pointer_data.change = GetChangeFromPointerEventPhase(pointer->phase); - pointer_data.kind = GetKindFromPointerType(pointer->type); - pointer_data.device = pointer->pointer_id; - pointer_data.physical_x = pointer->x * metrics_.scale; - pointer_data.physical_y = pointer->y * metrics_.scale; - - switch (pointer_data.change) { - case blink::PointerData::Change::kDown: - down_pointers_.insert(pointer_data.device); - break; - case blink::PointerData::Change::kCancel: - case blink::PointerData::Change::kUp: - down_pointers_.erase(pointer_data.device); - break; - case blink::PointerData::Change::kMove: - if (down_pointers_.count(pointer_data.device) == 0) { - pointer_data.change = blink::PointerData::Change::kHover; - } - break; - case blink::PointerData::Change::kAdd: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received add event for down pointer."; - } - break; - case blink::PointerData::Change::kRemove: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received remove event for down pointer."; - } - break; - case blink::PointerData::Change::kHover: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received hover event for down pointer."; - } - break; - } - - auto packet = std::make_unique(1); - packet->SetPointerData(0, pointer_data); - DispatchPointerDataPacket(std::move(packet)); - return true; -} - -bool PlatformView::OnHandleKeyboardEvent( - const mozart::KeyboardEventPtr& keyboard) { - const char* type = nullptr; - if (keyboard->phase == mozart::KeyboardEvent::Phase::PRESSED) { - type = "keydown"; - } else if (keyboard->phase == mozart::KeyboardEvent::Phase::REPEAT) { - type = "keydown"; // TODO change this to keyrepeat - } else if (keyboard->phase == mozart::KeyboardEvent::Phase::RELEASED) { - type = "keyup"; - } - - if (type == nullptr) { - FXL_DLOG(ERROR) << "Unknown key event phase."; - return false; - } - - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - document.SetObject(); - document.AddMember("type", rapidjson::Value(type, strlen(type)), allocator); - document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); - document.AddMember("hidUsage", keyboard->hid_usage, allocator); - document.AddMember("codePoint", keyboard->code_point, allocator); - document.AddMember("modifiers", keyboard->modifiers, allocator); - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - DispatchPlatformMessage(fxl::MakeRefCounted( - kKeyEventChannel, // channel - std::vector(data, data + buffer.GetSize()), // data - nullptr) // response - ); - - return true; -} - -bool PlatformView::OnHandleFocusEvent(const mozart::FocusEventPtr& focus) { - if (!focus->focused && current_text_input_client_ != 0) { - current_text_input_client_ = 0; - if (ime_) { - ime_->Hide(); - ime_ = nullptr; - } - if (ime_client_.is_bound()) { - ime_client_.Unbind(); - } - return true; - } - return false; -} - -// |shell::PlatformView| -std::unique_ptr PlatformView::CreateRenderingSurface() { - // This platform does not repeatly lose and gain a surface connection. So the - // surface is setup once during platform view setup and and returned to the - // shell on the initial (and only) |NotifyCreated| call. - return std::move(surface_); -} - -// |shell::PlatformView| -void PlatformView::HandlePlatformMessage( - fxl::RefPtr message) { - if (!message) { - return; - } - auto found = platform_message_handlers_.find(message->channel()); - if (found == platform_message_handlers_.end()) { - FXL_DLOG(ERROR) - << "Platform view received message on channel '" << message->channel() - << "' with no registed handler. And empty response will be generated. " - "Please implement the native message handler."; - PlatformView::HandlePlatformMessage(std::move(message)); - return; - } - found->second(std::move(message)); -} - -// |shell::PlatformView| -void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) { - accessibility_bridge_.UpdateSemantics(update); -} - -// Channel handler for kFlutterPlatformChannel -void PlatformView::HandleFlutterPlatformChannelPlatformMessage( - fxl::RefPtr message) { - FXL_DCHECK(message->channel() == kFlutterPlatformChannel); - const auto& data = message->data(); - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) { - return; - } - - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) { - return; - } - - fxl::RefPtr response = message->response(); - if (method->value == "Clipboard.setData") { - auto text = root["args"]["text"].GetString(); - clipboard_->Push(text); - response->CompleteEmpty(); - } else if (method->value == "Clipboard.getData") { - clipboard_->Peek([response](const f1dl::String& text) { - rapidjson::StringBuffer json_buffer; - rapidjson::Writer writer(json_buffer); - writer.StartArray(); - writer.StartObject(); - writer.Key("text"); - writer.String(text); - writer.EndObject(); - writer.EndArray(); - std::string result = json_buffer.GetString(); - response->Complete(std::vector{result.begin(), result.end()}); - }); - } else { - response->CompleteEmpty(); - } -} - -// Channel handler for kTextInputChannel -void PlatformView::HandleFlutterTextInputChannelPlatformMessage( - fxl::RefPtr message) { - FXL_DCHECK(message->channel() == kTextInputChannel); - const auto& data = message->data(); - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) { - return; - } - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) { - return; - } - - if (method->value == "TextInput.show") { - if (ime_) { - ime_->Show(); - } - } else if (method->value == "TextInput.hide") { - if (ime_) { - ime_->Hide(); - } - } else if (method->value == "TextInput.setClient") { - current_text_input_client_ = 0; - if (ime_client_.is_bound()) - ime_client_.Unbind(); - ime_ = nullptr; - - auto args = root.FindMember("args"); - if (args == root.MemberEnd() || !args->value.IsArray() || - args->value.Size() != 2) - return; - const auto& configuration = args->value[1]; - if (!configuration.IsObject()) { - return; - } - // TODO(abarth): Read the keyboard type from the configuration. - current_text_input_client_ = args->value[0].GetInt(); - mozart::TextInputStatePtr state = mozart::TextInputState::New(); - state->text = std::string(); - state->selection = mozart::TextSelection::New(); - state->composing = mozart::TextRange::New(); - input_connection_->GetInputMethodEditor( - mozart::KeyboardType::TEXT, mozart::InputMethodAction::DONE, - std::move(state), ime_client_.NewBinding(), ime_.NewRequest()); - } else if (method->value == "TextInput.setEditingState") { - if (ime_) { - auto args_it = root.FindMember("args"); - if (args_it == root.MemberEnd() || !args_it->value.IsObject()) { - return; - } - const auto& args = args_it->value; - mozart::TextInputStatePtr state = mozart::TextInputState::New(); - state->selection = mozart::TextSelection::New(); - state->composing = mozart::TextRange::New(); - // TODO(abarth): Deserialize state. - auto text = args.FindMember("text"); - if (text != args.MemberEnd() && text->value.IsString()) - state->text = text->value.GetString(); - auto selection_base = args.FindMember("selectionBase"); - if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) - state->selection->base = selection_base->value.GetInt(); - auto selection_extent = args.FindMember("selectionExtent"); - if (selection_extent != args.MemberEnd() && - selection_extent->value.IsInt()) - state->selection->extent = selection_extent->value.GetInt(); - auto selection_affinity = args.FindMember("selectionAffinity"); - if (selection_affinity != args.MemberEnd() && - selection_affinity->value.IsString() && - selection_affinity->value == "TextAffinity.upstream") - state->selection->affinity = mozart::TextAffinity::UPSTREAM; - else - state->selection->affinity = mozart::TextAffinity::DOWNSTREAM; - // We ignore selectionIsDirectional because that concept doesn't exist on - // Fuchsia. - auto composing_base = args.FindMember("composingBase"); - if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) - state->composing->start = composing_base->value.GetInt(); - auto composing_extent = args.FindMember("composingExtent"); - if (composing_extent != args.MemberEnd() && - composing_extent->value.IsInt()) - state->composing->end = composing_extent->value.GetInt(); - ime_->SetState(std::move(state)); - } - } else if (method->value == "TextInput.clearClient") { - current_text_input_client_ = 0; - if (ime_client_.is_bound()) - ime_client_.Unbind(); - ime_ = nullptr; - } else { - FXL_DLOG(ERROR) << "Unknown " << message->channel() << " method " - << method->value.GetString(); - } -} - -} // namespace flutter diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h deleted file mode 100644 index 9888d061352bb..0000000000000 --- a/content_handler/platform_view.h +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include - -#include "accessibility_bridge.h" -#include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/shell/common/platform_view.h" -#include "lib/clipboard/fidl/clipboard.fidl.h" -#include "lib/fidl/cpp/bindings/binding.h" -#include "lib/fxl/macros.h" -#include "lib/ui/input/fidl/input_connection.fidl.h" -#include "lib/ui/views/fidl/view_manager.fidl.h" -#include "lib/ui/views/fidl/views.fidl.h" -#include "surface.h" - -namespace flutter { - -// The per engine component residing on the platform thread is responsible for -// all platform specific integrations. -class PlatformView final : public shell::PlatformView, - public mozart::ViewListener, - public mozart::InputMethodEditorClient, - public mozart::InputListener { - public: - PlatformView( - PlatformView::Delegate& delegate, - std::string debug_label, - blink::TaskRunners task_runners, - component::ServiceProviderPtr parent_environment_service_provider, - mozart::ViewManagerPtr& view_manager, - f1dl::InterfaceRequest view_owner, - ui::ScenicPtr scenic, - zx::eventpair export_token, - zx::eventpair import_token, - maxwell::ContextWriterPtr accessibility_context_writer, - OnMetricsUpdate on_session_metrics_did_change, - fxl::Closure session_error_callback); - - ~PlatformView(); - - void UpdateViewportMetrics(double pixel_ratio); - - mozart::ViewPtr& GetMozartView(); - - private: - const std::string debug_label_; - mozart::ViewPtr view_; - f1dl::Binding view_listener_; - mozart::InputConnectionPtr input_connection_; - f1dl::Binding input_listener_; - int current_text_input_client_ = 0; - f1dl::Binding ime_client_; - mozart::InputMethodEditorPtr ime_; - modular::ClipboardPtr clipboard_; - ui::ScenicPtr scenic_; - AccessibilityBridge accessibility_bridge_; - std::unique_ptr surface_; - blink::LogicalMetrics metrics_; - std::set down_pointers_; - std::map< - std::string /* channel */, - std::function /* message */)> /* handler */> - platform_message_handlers_; - - void RegisterPlatformMessageHandlers(); - - void UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout); - - void FlushViewportMetrics(); - - // |mozart::ViewListener| - void OnPropertiesChanged( - mozart::ViewPropertiesPtr properties, - const OnPropertiesChangedCallback& callback) override; - - // |mozart::InputMethodEditorClient| - void DidUpdateState(mozart::TextInputStatePtr state, - mozart::InputEventPtr event) override; - - // |mozart::InputMethodEditorClient| - void OnAction(mozart::InputMethodAction action) override; - - // |mozart::InputListener| - void OnEvent(mozart::InputEventPtr event, - const OnEventCallback& callback) override; - - bool OnHandlePointerEvent(const mozart::PointerEventPtr& pointer); - - bool OnHandleKeyboardEvent(const mozart::KeyboardEventPtr& keyboard); - - bool OnHandleFocusEvent(const mozart::FocusEventPtr& focus); - - // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; - - // |shell::PlatformView| - void HandlePlatformMessage( - fxl::RefPtr message) override; - - // |shell::PlatformView| - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - // Channel handler for kFlutterPlatformChannel - void HandleFlutterPlatformChannelPlatformMessage( - fxl::RefPtr message); - - // Channel handler for kTextInputChannel - void HandleFlutterTextInputChannelPlatformMessage( - fxl::RefPtr message); - - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); -}; - -} // namespace flutter diff --git a/content_handler/rasterizer.cc b/content_handler/rasterizer.cc new file mode 100644 index 0000000000000..b720809b17a45 --- /dev/null +++ b/content_handler/rasterizer.cc @@ -0,0 +1,19 @@ +// Copyright 2016 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. + +#include "flutter/content_handler/rasterizer.h" +#include "flutter/content_handler/vulkan_rasterizer.h" + +namespace flutter_runner { + +Rasterizer::~Rasterizer() = default; + +std::unique_ptr Rasterizer::Create() { + auto vulkan_rasterizer = std::make_unique(); + FXL_CHECK(vulkan_rasterizer) + << "The vulkan rasterizer must be correctly initialized."; + return vulkan_rasterizer; +} + +} // namespace flutter_runner diff --git a/content_handler/rasterizer.h b/content_handler/rasterizer.h new file mode 100644 index 0000000000000..398f262a568cd --- /dev/null +++ b/content_handler/rasterizer.h @@ -0,0 +1,35 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ +#define FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ + +#include + +#include + +#include "flutter/flow/layers/layer_tree.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" + +namespace flutter_runner { + +class Rasterizer { + public: + virtual ~Rasterizer(); + + static std::unique_ptr Create(); + + virtual void SetScene( + fidl::InterfaceHandle mozart, + zx::eventpair import_token, + fxl::Closure metrics_changed_callback) = 0; + + virtual void Draw(std::unique_ptr layer_tree, + fxl::Closure callback) = 0; +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ diff --git a/content_handler/runtime_holder.cc b/content_handler/runtime_holder.cc new file mode 100644 index 0000000000000..421731b9691d0 --- /dev/null +++ b/content_handler/runtime_holder.cc @@ -0,0 +1,911 @@ +// Copyright 2016 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. + +#include "flutter/content_handler/runtime_holder.h" + +#include +#include +#include +#include +#include + +#include "dart-pkg/zircon/sdk_ext/handle.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/common/threads.h" +#include "flutter/content_handler/accessibility_bridge.h" +#include "flutter/content_handler/rasterizer.h" +#include "flutter/content_handler/service_protocol_hooks.h" +#include "flutter/lib/snapshot/snapshot.h" +#include "flutter/lib/ui/window/pointer_data_packet.h" +#include "flutter/runtime/asset_font_selector.h" +#include "flutter/runtime/dart_controller.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/runtime/runtime_init.h" +#include "lib/app/cpp/connect.h" +#include "lib/fsl/vmo/vector.h" +#include "lib/fxl/files/path.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/time/time_delta.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/zip/create_unzipper.h" +#include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/rapidjson/rapidjson/document.h" +#include "third_party/rapidjson/rapidjson/stringbuffer.h" +#include "third_party/rapidjson/rapidjson/writer.h" + +using tonic::DartConverter; +using tonic::ToDart; + +namespace flutter_runner { +namespace { + +constexpr char kKernelKey[] = "kernel_blob.bin"; +constexpr char kSnapshotKey[] = "snapshot_blob.bin"; +constexpr char kDylibKey[] = "libapp.so"; +constexpr char kAssetChannel[] = "flutter/assets"; +constexpr char kKeyEventChannel[] = "flutter/keyevent"; +constexpr char kTextInputChannel[] = "flutter/textinput"; +constexpr char kFlutterPlatformChannel[] = "flutter/platform"; +constexpr char kFuchsiaPackageResourceDirectory[] = "pkg/data"; +constexpr char kDartPkgContentsKey[] = "dart-pkg/contents"; + +void SetThreadName(fxl::RefPtr runner, std::string name) { + runner->PostTask([name]() { + zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); + Dart_SetThreadName(name.c_str()); + }); +} + +blink::PointerData::Change GetChangeFromPointerEventPhase( + input::PointerEventPhase phase) { + switch (phase) { + case input::PointerEventPhase::ADD: + return blink::PointerData::Change::kAdd; + case input::PointerEventPhase::HOVER: + return blink::PointerData::Change::kHover; + case input::PointerEventPhase::DOWN: + return blink::PointerData::Change::kDown; + case input::PointerEventPhase::MOVE: + return blink::PointerData::Change::kMove; + case input::PointerEventPhase::UP: + return blink::PointerData::Change::kUp; + case input::PointerEventPhase::REMOVE: + return blink::PointerData::Change::kRemove; + case input::PointerEventPhase::CANCEL: + return blink::PointerData::Change::kCancel; + default: + return blink::PointerData::Change::kCancel; + } +} + +blink::PointerData::DeviceKind GetKindFromPointerType( + input::PointerEventType type) { + switch (type) { + case input::PointerEventType::TOUCH: + return blink::PointerData::DeviceKind::kTouch; + case input::PointerEventType::MOUSE: + return blink::PointerData::DeviceKind::kMouse; + default: + return blink::PointerData::DeviceKind::kTouch; + } +} + +} // namespace + +RuntimeHolder::RuntimeHolder() + : view_listener_binding_(this), + input_listener_binding_(this), + text_input_binding_(this), + weak_factory_(this) {} + +RuntimeHolder::~RuntimeHolder() { + blink::Threads::Gpu()->PostTask( + fxl::MakeCopyable([rasterizer = std::move(rasterizer_)](){ + // Deletes rasterizer. + })); +} + +void RuntimeHolder::Init( + fdio_ns_t* namespc, + std::unique_ptr context, + fidl::InterfaceRequest outgoing_services, + std::vector bundle) { + FXL_DCHECK(!rasterizer_); + rasterizer_ = Rasterizer::Create(); + FXL_DCHECK(rasterizer_); + + namespc_ = namespc; + dirfd_ = fdio_ns_opendir(namespc); + if (dirfd_ == -1) { + FXL_LOG(ERROR) << "Failed to get fd for namespace"; + return; + } + context_ = std::move(context); + outgoing_services_ = std::move(outgoing_services); + + context_->ConnectToEnvironmentService(view_manager_.NewRequest()); + + // TODO(zarah): remove bundle entirely once flx is removed. + InitRootBundle(std::move(bundle)); + + const uint8_t* vm_snapshot_data; + const uint8_t* vm_snapshot_instr; + const uint8_t* default_isolate_snapshot_data; + const uint8_t* default_isolate_snapshot_instr; + if (!Dart_IsPrecompiledRuntime()) { + vm_snapshot_data = ::kDartVmSnapshotData; + vm_snapshot_instr = ::kDartVmSnapshotInstructions; + default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; + default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; + } else { + std::vector dylib_blob; + if (!GetAssetAsBuffer(kDylibKey, &dylib_blob)) { + FXL_LOG(ERROR) << "Failed to extract app dylib"; + return; + } + + fsl::SizedVmo dylib_vmo; + if (!fsl::VmoFromVector(dylib_blob, &dylib_vmo)) { + FXL_LOG(ERROR) << "Failed to load app dylib"; + return; + } + + dlerror(); + dylib_handle_ = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); + if (dylib_handle_ == nullptr) { + FXL_LOG(ERROR) << "dlopen failed: " << dlerror(); + return; + } + vm_snapshot_data = reinterpret_cast( + dlsym(dylib_handle_, "_kDartVmSnapshotData")); + vm_snapshot_instr = reinterpret_cast( + dlsym(dylib_handle_, "_kDartVmSnapshotInstructions")); + default_isolate_snapshot_data = reinterpret_cast( + dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); + default_isolate_snapshot_instr = reinterpret_cast( + dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); + } + + // TODO(rmacnak): We should generate the AOT vm snapshot separately from + // each app so we can initialize before receiving the first app bundle. + static bool first_app = true; + if (first_app) { + first_app = false; + blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, + default_isolate_snapshot_data, + default_isolate_snapshot_instr, + /* bundle_path = */ ""); + + // This has to happen after the Dart runtime is initialized. + SetThreadName(blink::Threads::UI(), "ui"); + SetThreadName(blink::Threads::Gpu(), "gpu"); + SetThreadName(blink::Threads::IO(), "io"); + + blink::SetRegisterNativeServiceProtocolExtensionHook( + ServiceProtocolHooks::RegisterHooks); + } + + accessibility_bridge_ = std::make_unique(context_.get()); +} + +void RuntimeHolder::CreateView( + const std::string& script_uri, + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services) { + if (view_listener_binding_.is_bound()) { + // TODO(jeffbrown): Refactor this to support multiple view instances + // sharing the same underlying root bundle (but with different runtimes). + FXL_LOG(ERROR) << "The view has already been created."; + return; + } + + std::vector kernel; + std::vector snapshot; + bool maybe_running_from_source = false; + if (!Dart_IsPrecompiledRuntime()) { + if (!GetAssetAsBuffer(kKernelKey, &kernel) && + !GetAssetAsBuffer(kSnapshotKey, &snapshot)) { + maybe_running_from_source = true; + FXL_LOG(INFO) << "No kernel or snapshot in root bundle."; + } + } + + // Create the view. + zx::eventpair import_token, export_token; + zx_status_t status = zx::eventpair::create(0u, &import_token, &export_token); + if (status != ZX_OK) { + FXL_LOG(ERROR) << "Could not create an event pair."; + return; + } + views_v1::ViewListenerPtr view_listener; + view_listener_binding_.Bind(view_listener.NewRequest()); + view_manager_->CreateView(view_.NewRequest(), // view + std::move(view_owner_request), // view owner + std::move(view_listener), // view listener + std::move(export_token), // export token + script_uri // diagnostic label + ); + component::ServiceProviderPtr view_services; + view_->GetServiceProvider(view_services.NewRequest()); + + // Listen for input events. + ConnectToService(view_services.get(), input_connection_.NewRequest()); + input::InputListenerPtr input_listener; + input_listener_binding_.Bind(input_listener.NewRequest()); + input_connection_->SetEventListener(std::move(input_listener)); + + // Setup the session. + fidl::InterfaceHandle scenic; + view_manager_->GetScenic(scenic.NewRequest()); + + blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ + rasterizer = rasterizer_.get(), // + scenic = std::move(scenic), // + import_token = std::move(import_token), // + weak_runtime_holder = GetWeakPtr() + ]() mutable { + ASSERT_IS_GPU_THREAD; + rasterizer->SetScene( + std::move(scenic), std::move(import_token), + // TODO(MZ-222): Ideally we would immediately redraw the previous layer + // tree when the metrics change since there's no need to rerecord it. + // However, we want to make sure there's only one outstanding frame. + // We should improve the frame scheduling so that the rasterizer thread + // can self-schedule re-rasterization. + [weak_runtime_holder] { + // This is on the GPU thread thread. Post to the Platform/UI + // thread for the completion callback. + ASSERT_IS_GPU_THREAD; + blink::Threads::Platform()->PostTask([weak_runtime_holder]() { + // On the Platform/UI thread. + ASSERT_IS_UI_THREAD; + if (weak_runtime_holder) { + weak_runtime_holder->OnRedrawFrame(); + } + }); + }); + })); + runtime_ = blink::RuntimeController::Create(this); + + const uint8_t* isolate_snapshot_data; + const uint8_t* isolate_snapshot_instr; + if (!Dart_IsPrecompiledRuntime()) { + isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; + isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; + } else { + isolate_snapshot_data = reinterpret_cast( + dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); + isolate_snapshot_instr = reinterpret_cast( + dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); + } + runtime_->CreateDartController(script_uri, isolate_snapshot_data, + isolate_snapshot_instr, dirfd_); + + runtime_->SetViewportMetrics(viewport_metrics_); + + if (Dart_IsPrecompiledRuntime()) { + runtime_->dart_controller()->RunFromPrecompiledSnapshot(); + } else if (!kernel.empty()) { + runtime_->dart_controller()->RunFromKernel(std::move(kernel)); + } else if (maybe_running_from_source) { + std::vector data; + if (!GetAssetAsBuffer(kDartPkgContentsKey, &data)) { + FXL_LOG(ERROR) << "Contents file not found for " << script_uri; + return; + } + std::string package_name(data.begin(), data.end()); + std::string main_dart = "pkg/data/dart-pkg/" + package_name + "/lib/main.dart"; + FXL_LOG(INFO) << "Running from source with entrypoint: '" << main_dart + << "'"; + runtime_->dart_controller()->RunFromSource(main_dart, "pkg/data/dart-pkg/.packages"); + } else { + runtime_->dart_controller()->RunFromScriptSnapshot(snapshot.data(), + snapshot.size()); + } + + runtime_->dart_controller()->dart_state()->SetReturnCodeCallback( + [this](int32_t return_code) { return_code_ = return_code; }); +} + +Dart_Port RuntimeHolder::GetUIIsolateMainPort() { + if (!runtime_) + return ILLEGAL_PORT; + return runtime_->GetMainPort(); +} + +void RuntimeHolder::DidShutdownMainIsolate() { + if (main_isolate_shutdown_callback_) { + main_isolate_shutdown_callback_(); + } +} + +void RuntimeHolder::SetMainIsolateShutdownCallback( + std::function callback) { + main_isolate_shutdown_callback_ = callback; +} + +std::string RuntimeHolder::GetUIIsolateName() { + if (!runtime_) { + return ""; + } + return runtime_->GetIsolateName(); +} + +std::string RuntimeHolder::DefaultRouteName() { + return "/"; +} + +void RuntimeHolder::ScheduleFrame(bool regenerate_layer_tree) { + ASSERT_IS_UI_THREAD; + // TODO(mravn): We assume regenerate_layer_tree is true (and thus ignore + // that we may be able to reuse the current layer tree.) + if (!frame_scheduled_) { + frame_scheduled_ = true; + if (!frame_outstanding_) + PostBeginFrame(); + } +} + +void RuntimeHolder::Render(std::unique_ptr layer_tree) { + if (!frame_outstanding_ || frame_rendering_) { + // TODO(MZ-193): We probably shouldn't be discarding the layer tree here. + // But then, Flutter shouldn't be calling Render() if we didn't call + // BeginFrame(). + return; // Spurious. + } + + frame_rendering_ = true; + + layer_tree->set_construction_time(fxl::TimePoint::Now() - + last_begin_frame_time_); + layer_tree->set_frame_size(SkISize::Make(viewport_metrics_.physical_width, + viewport_metrics_.physical_height)); + layer_tree->set_device_pixel_ratio(viewport_metrics_.device_pixel_ratio); + + // We are on the Platform/UI thread. Post to the GPU thread to render. + ASSERT_IS_PLATFORM_THREAD; + blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ + rasterizer = rasterizer_.get(), // + layer_tree = std::move(layer_tree), // + weak_runtime_holder = GetWeakPtr() // + ]() mutable { + // On the GPU Thread. + ASSERT_IS_GPU_THREAD; + rasterizer->Draw(std::move(layer_tree), [weak_runtime_holder]() { + // This is on the GPU thread thread. Post to the Platform/UI thread + // for the completion callback. + ASSERT_IS_GPU_THREAD; + blink::Threads::Platform()->PostTask([weak_runtime_holder]() { + // On the Platform/UI thread. + ASSERT_IS_UI_THREAD; + if (weak_runtime_holder) { + weak_runtime_holder->frame_rendering_ = false; + weak_runtime_holder->OnFrameComplete(); + } + }); + }); + })); +} + +void RuntimeHolder::UpdateSemantics(blink::SemanticsNodeUpdates update) { + accessibility_bridge_->UpdateSemantics(update); +} + +void RuntimeHolder::HandlePlatformMessage( + fxl::RefPtr message) { + if (message->channel() == kAssetChannel) { + if (HandleAssetPlatformMessage(message.get())) + return; + } else if (message->channel() == kTextInputChannel) { + if (HandleTextInputPlatformMessage(message.get())) + return; + } else if (message->channel() == kFlutterPlatformChannel) { + if (HandleFlutterPlatformMessage(message.get())) + return; + } + if (auto response = message->response()) + response->CompleteEmpty(); +} + +void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) { + if (asset_provider_) { + blink::AssetFontSelector::Install(asset_provider_); + } else if (asset_store_) { + blink::AssetFontSelector::Install(asset_store_); + } + InitDartIoInternal(); + InitFuchsia(); + InitZircon(); + InitScenicInternal(); +} + +void RuntimeHolder::InitDartIoInternal() { + Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io")); + + // Set up the namespace. + Dart_Handle namespace_type = + Dart_GetType(io_lib, ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + Dart_Handle namespace_args[1]; + namespace_args[0] = Dart_NewInteger(reinterpret_cast(namespc_)); + DART_CHECK_VALID(namespace_args[0]); + DART_CHECK_VALID(Dart_Invoke(namespace_type, ToDart("_setupNamespace"), 1, + namespace_args)); + + // Disable dart:io exit() + Dart_Handle embedder_config_type = + Dart_GetType(io_lib, ToDart("_EmbedderConfig"), 0, nullptr); + DART_CHECK_VALID(embedder_config_type); + DART_CHECK_VALID( + Dart_SetField(embedder_config_type, ToDart("_mayExit"), Dart_False())); +} + +void RuntimeHolder::InitFuchsia() { + fidl::InterfaceHandle environment; + context_->ConnectToEnvironmentService(environment.NewRequest()); + fuchsia::dart::Initialize(std::move(environment), + std::move(outgoing_services_)); + + component::ServiceProviderPtr parent_env_service_provider; + context_->environment()->GetServices( + parent_env_service_provider.NewRequest()); + ConnectToService(parent_env_service_provider.get(), clipboard_.NewRequest()); +} + +void RuntimeHolder::InitZircon() { + Dart_Handle zircon_lib = Dart_LookupLibrary(ToDart("dart:zircon")); + DART_CHECK_VALID(zircon_lib); + + Dart_Handle namespace_type = + Dart_GetType(zircon_lib, ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + DART_CHECK_VALID(Dart_SetField(namespace_type, ToDart("_namespace"), + ToDart(reinterpret_cast(namespc_)))); +} + +void RuntimeHolder::InitScenicInternal() { + fidl::InterfaceHandle view_container; + view_->GetContainer(view_container.NewRequest()); + + Dart_Handle mozart_internal = + Dart_LookupLibrary(ToDart("dart:mozart.internal")); + + DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, mozart::NativeLookup, + mozart::NativeSymbol)); + + DART_CHECK_VALID( + Dart_SetField(mozart_internal, ToDart("_context"), + DartConverter::ToDart(reinterpret_cast( + static_cast(this))))); + + DART_CHECK_VALID(Dart_SetField(mozart_internal, ToDart("_viewContainer"), + ToDart(zircon::dart::Handle::Create( + view_container.TakeChannel().release())))); +} + +void RuntimeHolder::InitRootBundle(std::vector bundle) { + if (!bundle.empty()) { + root_bundle_data_ = std::move(bundle); + asset_store_ = fxl::MakeRefCounted( + GetUnzipperProviderForRootBundle()); + } else { + fxl::UniqueFD root_dir(fdio_ns_opendir(namespc_)); + if (!root_dir.is_valid()) { + FXL_LOG(ERROR) << "Unable to load root dir"; + return; + } + fxl::UniqueFD data_dir(openat(root_dir.get(), + kFuchsiaPackageResourceDirectory, + O_RDONLY | O_DIRECTORY)); + if (!data_dir.is_valid()) { + FXL_LOG(ERROR) << "Unable to load data dir"; + return; + } + asset_provider_ = + fxl::MakeRefCounted(std::move(data_dir)); + } +} + +views_v1::View* RuntimeHolder::GetMozartView() { + return view_.get(); +} + +bool RuntimeHolder::HandleAssetPlatformMessage( + blink::PlatformMessage* message) { + fxl::RefPtr response = message->response(); + if (!response) + return false; + const auto& data = message->data(); + std::string asset_name(reinterpret_cast(data.data()), + data.size()); + std::vector asset_data; + if (GetAssetAsBuffer(asset_name, &asset_data)) { + response->Complete(std::move(asset_data)); + } else { + response->CompleteEmpty(); + } + return true; +} + +bool RuntimeHolder::GetAssetAsBuffer(const std::string& name, + std::vector* data) { + return (asset_provider_ && + asset_provider_->GetAsBuffer(name, data)) || + (asset_store_ && asset_store_->GetAsBuffer(name, data)); +} + +bool RuntimeHolder::HandleFlutterPlatformMessage( + blink::PlatformMessage* message) { + const auto& data = message->data(); + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) { + return false; + } + + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) { + return false; + } + + fxl::RefPtr response = message->response(); + if (method->value == "Clipboard.setData") { + auto text = root["args"]["text"].GetString(); + clipboard_->Push(text); + response->CompleteEmpty(); + } else if (method->value == "Clipboard.getData") { + clipboard_->Peek([response](fidl::StringPtr text) { + rapidjson::StringBuffer json_buffer; + rapidjson::Writer writer(json_buffer); + writer.StartArray(); + writer.StartObject(); + writer.Key("text"); + writer.String(text.get()); + writer.EndObject(); + writer.EndArray(); + + std::string result = json_buffer.GetString(); + response->Complete(std::vector{result.begin(), result.end()}); + }); + } else { + response->CompleteEmpty(); + } + return true; +} + +bool RuntimeHolder::HandleTextInputPlatformMessage( + blink::PlatformMessage* message) { + const auto& data = message->data(); + + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) + return false; + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) + return false; + + if (method->value == "TextInput.show") { + if (input_method_editor_) { + input_method_editor_->Show(); + } + } else if (method->value == "TextInput.hide") { + if (input_method_editor_) { + input_method_editor_->Hide(); + } + } else if (method->value == "TextInput.setClient") { + current_text_input_client_ = 0; + if (text_input_binding_.is_bound()) + text_input_binding_.Unbind(); + input_method_editor_ = nullptr; + + auto args = root.FindMember("args"); + if (args == root.MemberEnd() || !args->value.IsArray() || + args->value.Size() != 2) + return false; + const auto& configuration = args->value[1]; + if (!configuration.IsObject()) + return false; + // TODO(abarth): Read the keyboard type form the configuration. + current_text_input_client_ = args->value[0].GetInt(); + input::TextInputState state; + state.text = std::string(); + input_connection_->GetInputMethodEditor( + input::KeyboardType::TEXT, input::InputMethodAction::DONE, + std::move(state), text_input_binding_.NewBinding(), + input_method_editor_.NewRequest()); + } else if (method->value == "TextInput.setEditingState") { + if (input_method_editor_) { + auto args_it = root.FindMember("args"); + if (args_it == root.MemberEnd() || !args_it->value.IsObject()) + return false; + const auto& args = args_it->value; + input::TextInputState state; + // TODO(abarth): Deserialize state. + auto text = args.FindMember("text"); + if (text != args.MemberEnd() && text->value.IsString()) + state.text = text->value.GetString(); + auto selection_base = args.FindMember("selectionBase"); + if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) + state.selection.base = selection_base->value.GetInt(); + auto selection_extent = args.FindMember("selectionExtent"); + if (selection_extent != args.MemberEnd() && + selection_extent->value.IsInt()) + state.selection.extent = selection_extent->value.GetInt(); + auto selection_affinity = args.FindMember("selectionAffinity"); + if (selection_affinity != args.MemberEnd() && + selection_affinity->value.IsString() && + selection_affinity->value == "TextAffinity.upstream") + state.selection.affinity = input::TextAffinity::UPSTREAM; + else + state.selection.affinity = input::TextAffinity::DOWNSTREAM; + // We ignore selectionIsDirectional because that concept doesn't exist on + // Fuchsia. + auto composing_base = args.FindMember("composingBase"); + if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) + state.composing.start = composing_base->value.GetInt(); + auto composing_extent = args.FindMember("composingExtent"); + if (composing_extent != args.MemberEnd() && + composing_extent->value.IsInt()) + state.composing.end = composing_extent->value.GetInt(); + input_method_editor_->SetState(std::move(state)); + } + } else if (method->value == "TextInput.clearClient") { + current_text_input_client_ = 0; + if (text_input_binding_.is_bound()) + text_input_binding_.Unbind(); + input_method_editor_ = nullptr; + } else { + FXL_DLOG(ERROR) << "Unknown " << kTextInputChannel << " method " + << method->value.GetString(); + } + + return false; +} + +blink::UnzipperProvider RuntimeHolder::GetUnzipperProviderForRootBundle() { + return [self = GetWeakPtr()]() { + if (!self) + return zip::UniqueUnzipper(); + return zip::CreateUnzipper(&self->root_bundle_data_); + }; +} + +void RuntimeHolder::OnEvent(input::InputEvent event, + OnEventCallback callback) { + bool handled = false; + if (event.is_pointer()) { + const input::PointerEvent& pointer = event.pointer(); + blink::PointerData pointer_data; + pointer_data.time_stamp = pointer.event_time / 1000; + pointer_data.change = GetChangeFromPointerEventPhase(pointer.phase); + pointer_data.kind = GetKindFromPointerType(pointer.type); + pointer_data.device = pointer.pointer_id; + pointer_data.physical_x = pointer.x * viewport_metrics_.device_pixel_ratio; + pointer_data.physical_y = pointer.y * viewport_metrics_.device_pixel_ratio; + // Buttons are single bit values starting with kMousePrimaryButton = 1. + pointer_data.buttons = static_cast(pointer.buttons); + + switch (pointer_data.change) { + case blink::PointerData::Change::kDown: + down_pointers_.insert(pointer_data.device); + break; + case blink::PointerData::Change::kCancel: + case blink::PointerData::Change::kUp: + down_pointers_.erase(pointer_data.device); + break; + case blink::PointerData::Change::kMove: + if (down_pointers_.count(pointer_data.device) == 0) + pointer_data.change = blink::PointerData::Change::kHover; + break; + case blink::PointerData::Change::kAdd: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received add event for down pointer."; + } + break; + case blink::PointerData::Change::kRemove: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received remove event for down pointer."; + } + break; + case blink::PointerData::Change::kHover: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received hover event for down pointer."; + } + break; + } + + blink::PointerDataPacket packet(1); + packet.SetPointerData(0, pointer_data); + runtime_->DispatchPointerDataPacket(packet); + + handled = true; + } else if (event.is_keyboard()) { + const input::KeyboardEvent& keyboard = event.keyboard(); + const char* type = nullptr; + if (keyboard.phase == input::KeyboardEventPhase::PRESSED) + type = "keydown"; + else if (keyboard.phase == input::KeyboardEventPhase::REPEAT) + type = "keydown"; // TODO change this to keyrepeat + else if (keyboard.phase == input::KeyboardEventPhase::RELEASED) + type = "keyup"; + + if (type) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + document.SetObject(); + document.AddMember("type", rapidjson::Value(type, strlen(type)), + allocator); + document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); + document.AddMember("hidUsage", keyboard.hid_usage, allocator); + document.AddMember("codePoint", keyboard.code_point, allocator); + document.AddMember("modifiers", keyboard.modifiers, allocator); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = + reinterpret_cast(buffer.GetString()); + runtime_->DispatchPlatformMessage( + fxl::MakeRefCounted( + kKeyEventChannel, + std::vector(data, data + buffer.GetSize()), nullptr)); + handled = true; + } + } + callback(handled); +} + +void RuntimeHolder::OnPropertiesChanged( + views_v1::ViewProperties properties, + OnPropertiesChangedCallback callback) { + // Attempt to read the device pixel ratio. + float pixel_ratio = 1.f; + if (auto& metrics = properties.display_metrics) { + pixel_ratio = metrics->device_pixel_ratio; + } + + // Apply view property changes. + if (auto& layout = properties.view_layout) { + viewport_metrics_.physical_width = layout->size.width * pixel_ratio; + viewport_metrics_.physical_height = layout->size.height * pixel_ratio; + viewport_metrics_.physical_padding_top = layout->inset.top * pixel_ratio; + viewport_metrics_.physical_padding_right = + layout->inset.right * pixel_ratio; + viewport_metrics_.physical_padding_bottom = + layout->inset.bottom * pixel_ratio; + viewport_metrics_.physical_padding_left = layout->inset.left * pixel_ratio; + viewport_metrics_.device_pixel_ratio = pixel_ratio; + runtime_->SetViewportMetrics(viewport_metrics_); + } + + ScheduleFrame(); + + callback(); +} + +void RuntimeHolder::DidUpdateState(input::TextInputState state, + input::InputEventPtr event) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + + rapidjson::Value encoded_state(rapidjson::kObjectType); + encoded_state.AddMember("text", state.text.get(), allocator); + encoded_state.AddMember("selectionBase", state.selection.base, allocator); + encoded_state.AddMember("selectionExtent", state.selection.extent, + allocator); + switch (state.selection.affinity) { + case input::TextAffinity::UPSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.upstream"), + allocator); + break; + case input::TextAffinity::DOWNSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.downstream"), + allocator); + break; + } + encoded_state.AddMember("selectionIsDirectional", true, allocator); + encoded_state.AddMember("composingBase", state.composing.start, allocator); + encoded_state.AddMember("composingExtent", state.composing.end, allocator); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + args.PushBack(encoded_state, allocator); + + document.SetObject(); + document.AddMember("method", + rapidjson::Value("TextInputClient.updateEditingState"), + allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, std::vector(data, data + buffer.GetSize()), + nullptr)); +} + +void RuntimeHolder::OnAction(input::InputMethodAction action) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + + // Done is currently the only text input action defined by Flutter. + args.PushBack("TextInputAction.done", allocator); + + document.SetObject(); + document.AddMember( + "method", rapidjson::Value("TextInputClient.performAction"), allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, std::vector(data, data + buffer.GetSize()), + nullptr)); +} + +fxl::WeakPtr RuntimeHolder::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +void RuntimeHolder::PostBeginFrame() { + blink::Threads::Platform()->PostTask([weak_runtime_holder = GetWeakPtr()]() { + // On the Platform/UI thread. + ASSERT_IS_UI_THREAD; + if (weak_runtime_holder) { + weak_runtime_holder->BeginFrame(); + } + }); +} + +void RuntimeHolder::BeginFrame() { + ASSERT_IS_UI_THREAD + FXL_DCHECK(frame_scheduled_); + FXL_DCHECK(!frame_outstanding_); + frame_scheduled_ = false; + frame_outstanding_ = true; + int64_t dart_frame_start_micros = Dart_TimelineGetMicros(); + last_begin_frame_time_ = fxl::TimePoint::Now(); + runtime_->BeginFrame(last_begin_frame_time_); + + if (frame_scheduled_) { + // HACK(rmacnak): This assumes 16ms/frame; it should use the frame deadline + // once we have access to it. Compare shell/common/animator.cc. + runtime_->NotifyIdle(dart_frame_start_micros + 16000); + } else { + // We don't have another frame pending, so we're waiting on user input + // or I/O. Allow the Dart VM 100 ms. + runtime_->NotifyIdle(dart_frame_start_micros + 100000); + } +} + +void RuntimeHolder::OnFrameComplete() { + ASSERT_IS_UI_THREAD + FXL_DCHECK(frame_outstanding_); + frame_outstanding_ = false; + if (frame_scheduled_) + PostBeginFrame(); +} + +void RuntimeHolder::OnRedrawFrame() { + if (!frame_outstanding_) + ScheduleFrame(); +} + +} // namespace flutter_runner diff --git a/content_handler/runtime_holder.h b/content_handler/runtime_holder.h new file mode 100644 index 0000000000000..b9d55d9f9bacc --- /dev/null +++ b/content_handler/runtime_holder.h @@ -0,0 +1,152 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ +#define FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ + +#include +#include + +#include + +#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" +#include "flutter/assets/asset_provider.h" +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/unzipper_provider.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/content_handler/accessibility_bridge.h" +#include "flutter/flow/layers/layer_tree.h" +#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/runtime/runtime_controller.h" +#include "flutter/runtime/runtime_delegate.h" +#include "lib/app/cpp/application_context.h" +#include +#include +#include +#include "lib/fidl/cpp/binding.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/ui/flutter/sdk_ext/src/natives.h" +#include +#include +#include + +namespace flutter_runner { + +class Rasterizer; + +class RuntimeHolder : public blink::RuntimeDelegate, + public mozart::NativesDelegate, + public views_v1::ViewListener, + public input::InputListener, + public input::InputMethodEditorClient { + public: + RuntimeHolder(); + ~RuntimeHolder(); + + void Init(fdio_ns_t* namespc, + std::unique_ptr context, + fidl::InterfaceRequest outgoing_services, + std::vector bundle); + void CreateView(const std::string& script_uri, + fidl::InterfaceRequest view_owner_request, + fidl::InterfaceRequest services); + + Dart_Port GetUIIsolateMainPort(); + std::string GetUIIsolateName(); + + int32_t return_code() { return return_code_; } + + void SetMainIsolateShutdownCallback(std::function callback); + + private: + // |blink::RuntimeDelegate| implementation: + std::string DefaultRouteName() override; + void ScheduleFrame(bool regenerate_layer_tree = true) override; + void Render(std::unique_ptr layer_tree) override; + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + void HandlePlatformMessage( + fxl::RefPtr message) override; + void DidCreateMainIsolate(Dart_Isolate isolate) override; + void DidShutdownMainIsolate() override; + + // |mozart::NativesDelegate| implementation: + views_v1::View* GetMozartView() override; + + // |input::InputListener| implementation: + void OnEvent(input::InputEvent event, + OnEventCallback callback) override; + + // |views_v1::ViewListener| implementation: + void OnPropertiesChanged( + views_v1::ViewProperties properties, + OnPropertiesChangedCallback callback) override; + + // |input::InputMethodEditorClient| implementation: + void DidUpdateState(input::TextInputState state, + input::InputEventPtr event) override; + void OnAction(input::InputMethodAction action) override; + + fxl::WeakPtr GetWeakPtr(); + + void InitRootBundle(std::vector bundle); + blink::UnzipperProvider GetUnzipperProviderForRootBundle(); + bool HandleAssetPlatformMessage(blink::PlatformMessage* message); + bool GetAssetAsBuffer(const std::string& name, std::vector* data); + bool HandleTextInputPlatformMessage(blink::PlatformMessage* message); + bool HandleFlutterPlatformMessage(blink::PlatformMessage* message); + + void InitDartIoInternal(); + void InitFuchsia(); + void InitZircon(); + void InitScenicInternal(); + + void PostBeginFrame(); + void BeginFrame(); + void OnFrameComplete(); + void OnRedrawFrame(); + void Invalidate(); + + fdio_ns_t* namespc_; + int dirfd_; + std::unique_ptr context_; + fidl::InterfaceRequest outgoing_services_; + std::vector root_bundle_data_; + // TODO(zarah): Remove asset_store_ when flx is completely removed + fxl::RefPtr asset_store_; + fxl::RefPtr asset_provider_; + void* dylib_handle_ = nullptr; + std::unique_ptr rasterizer_; + std::unique_ptr runtime_; + blink::ViewportMetrics viewport_metrics_; + views_v1::ViewManagerPtr view_manager_; + fidl::Binding view_listener_binding_; + fidl::Binding input_listener_binding_; + input::InputConnectionPtr input_connection_; + views_v1::ViewPtr view_; + std::unordered_set down_pointers_; + input::InputMethodEditorPtr input_method_editor_; + fidl::Binding text_input_binding_; + int current_text_input_client_ = 0; + fxl::TimePoint last_begin_frame_time_; + bool frame_outstanding_ = false; + bool frame_scheduled_ = false; + bool frame_rendering_ = false; + int32_t return_code_ = 0; + + fxl::WeakPtrFactory weak_factory_; + + std::unique_ptr accessibility_bridge_; + + std::function main_isolate_shutdown_callback_; + + modular::ClipboardPtr clipboard_; + + FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeHolder); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ diff --git a/content_handler/service_protocol_hooks.cc b/content_handler/service_protocol_hooks.cc new file mode 100644 index 0000000000000..9a91254f13488 --- /dev/null +++ b/content_handler/service_protocol_hooks.cc @@ -0,0 +1,164 @@ +// Copyright 2017 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. + +#include "flutter/content_handler/service_protocol_hooks.h" + +#include + +#include +#include + +#include "flutter/common/threads.h" +#include "flutter/content_handler/app.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace flutter_runner { +namespace { + +constexpr char kViewIdPrefx[] = "_flutterView/"; +constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; + +static intptr_t KeyIndex(const char** param_keys, + intptr_t num_params, + const char* key) { + if (param_keys == NULL) { + return -1; + } + for (intptr_t i = 0; i < num_params; i++) { + if (strcmp(param_keys[i], key) == 0) { + return i; + } + } + return -1; +} + +static const char* ValueForKey(const char** param_keys, + const char** param_values, + intptr_t num_params, + const char* key) { + intptr_t index = KeyIndex(param_keys, num_params, key); + if (index < 0) { + return NULL; + } + return param_values[index]; +} + +static void AppendIsolateRef(std::stringstream* stream, + int64_t main_port, + const std::string name) { + *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; + *stream << main_port << "\",\"name\":\"" << name << "\","; + *stream << "\"number\":\"" << main_port << "\"}"; +} + +static void AppendFlutterView(std::stringstream* stream, + uintptr_t view_id, + int64_t isolate_id, + const std::string isolate_name) { + *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" + << std::hex << view_id << std::dec << "\""; + if (isolate_id != ILLEGAL_PORT) { + // Append the isolate (if it exists). + *stream << "," + << "\"isolate\":"; + AppendIsolateRef(stream, isolate_id, isolate_name); + } + *stream << "}"; +} + +} // namespace + +void ServiceProtocolHooks::RegisterHooks(bool running_precompiled_code) { + // Listing of FlutterViews. + Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, + nullptr); + + Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, + &SetAssetBundlePath, nullptr); +} + +const char* ServiceProtocolHooks::kListViewsExtensionName = + "_flutter.listViews"; + +bool ServiceProtocolHooks::ListViews(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + // Ask the App for the list of platform views. This will run a task on + // the UI thread before returning. + App& app = App::Shared(); + std::vector platform_views; + app.WaitForPlatformViewIds(&platform_views); + + std::stringstream response; + + response << "{\"type\":\"FlutterViewList\",\"views\":["; + bool prefix_comma = false; + for (auto it = platform_views.begin(); it != platform_views.end(); it++) { + uintptr_t view_id = it->view_id; + int64_t isolate_id = it->isolate_id; + const std::string& isolate_name = it->isolate_name; + if (!view_id) { + continue; + } + if (prefix_comma) { + response << ','; + } else { + prefix_comma = true; + } + AppendFlutterView(&response, view_id, isolate_id, isolate_name); + } + response << "]}"; + // Copy the response. + *json_object = strdup(response.str().c_str()); + return true; +} + +const char* ServiceProtocolHooks::kSetAssetBundlePathExtensionName = + "_flutter.setAssetBundlePath"; + +bool ServiceProtocolHooks::SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + const char* view_id_str = + ValueForKey(param_keys, param_values, num_params, "viewId"); + + // Ask the App for the list of platform views. This will run a task on + // the UI thread before returning. + App& app = App::Shared(); + std::vector platform_views; + app.WaitForPlatformViewIds(&platform_views); + + // Convert the actual flutter view hex id into a number. + uintptr_t view_id_as_num = + std::stoull((view_id_str + kViewIdPrefxLength), nullptr, 16); + + // The view existed and the isolate was created. Success. + std::stringstream response; + response << "{\"type\":\"Success\"," + << "\"view\":"; + for (auto it = platform_views.begin(); it != platform_views.end(); it++) { + uintptr_t view_id = it->view_id; + int64_t isolate_id = it->isolate_id; + const std::string& isolate_name = it->isolate_name; + if (!view_id || view_id != view_id_as_num) { + continue; + } + + // TODO(DX): Set up asset bundle path for the isolate. + + AppendFlutterView(&response, view_id, isolate_id, isolate_name); + break; + } + response << "}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +} // namespace flutter_runner diff --git a/content_handler/service_protocol_hooks.h b/content_handler/service_protocol_hooks.h new file mode 100644 index 0000000000000..479fb71471f1e --- /dev/null +++ b/content_handler/service_protocol_hooks.h @@ -0,0 +1,37 @@ +// Copyright 2017 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. + +#ifndef FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ +#define FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ + +#include "lib/fxl/synchronization/waitable_event.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace flutter_runner { + +class ServiceProtocolHooks { + public: + static void RegisterHooks(bool running_precompiled_code); + + private: + static const char* kListViewsExtensionName; + static bool ListViews(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + + static const char* kSetAssetBundlePathExtensionName; + static bool SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index 870020abb670f..b496ae37f40f2 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -2,69 +2,72 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "session_connection.h" - +#include "flutter/content_handler/session_connection.h" +#include "lib/fidl/cpp/optional.h" #include "lib/ui/scenic/fidl_helpers.h" -namespace flutter { +namespace flutter_runner { -SessionConnection::SessionConnection( - const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback) - : debug_label_(std::move(debug_label)), - session_(scenic.get()), +SessionConnection::SessionConnection(ui::ScenicPtr scenic, + zx::eventpair import_token) + : session_(scenic.get()), root_node_(&session_), surface_producer_(std::make_unique(&session_)), - scene_update_context_(&session_, surface_producer_.get()), - metrics_changed_callback_( - std::move(session_metrics_did_change_callback)) { - session_.set_error_handler(std::move(session_error_callback)); + scene_update_context_(&session_, surface_producer_.get()) { + ASSERT_IS_GPU_THREAD; + + session_.set_error_handler( + std::bind(&SessionConnection::OnSessionError, this)); session_.set_event_handler(std::bind(&SessionConnection::OnSessionEvents, this, std::placeholders::_1)); root_node_.Bind(std::move(import_token)); - root_node_.SetEventMask(ui::gfx::kMetricsEventMask); - session_.Present(0, [](ui::PresentationInfoPtr info) {}); -} + root_node_.SetEventMask(gfx::kMetricsEventMask); + session_.Present(0, [](images::PresentationInfo info) {}); -SessionConnection::~SessionConnection() = default; + present_callback_ = + std::bind(&SessionConnection::OnPresent, this, std::placeholders::_1); +} -void SessionConnection::OnSessionEvents(f1dl::Array events) { - using Type = ui::gfx::Event::Tag; +SessionConnection::~SessionConnection() { + ASSERT_IS_GPU_THREAD; +} - for (auto& raw_event : *events) { - if (!raw_event->is_gfx()) { - continue; - } +void SessionConnection::OnSessionError() { + ASSERT_IS_GPU_THREAD; + // TODO: Not this. + FXL_CHECK(false) << "Session connection was terminated."; +} - auto& event = raw_event->get_gfx(); - - switch (event->which()) { - case Type::METRICS: { - if (event->get_metrics()->node_id == root_node_.id()) { - auto& metrics = event->get_metrics()->metrics; - double device_pixel_ratio = metrics->scale_x; - scene_update_context_.set_metrics(std::move(metrics)); - if (metrics_changed_callback_) { - metrics_changed_callback_(device_pixel_ratio); - } - } - } break; - default: - break; +void SessionConnection::OnSessionEvents(fidl::VectorPtr events) { + gfx::Metrics* new_metrics; + for (auto& event : *events) { + if (event.is_gfx() && event.gfx().is_metrics() && + event.gfx().metrics().node_id == root_node_.id()) { + new_metrics = &event.gfx().metrics().metrics; } } + if (!new_metrics) + return; + + scene_update_context_.set_metrics(fidl::MakeOptional(std::move(*new_metrics))); + + if (metrics_changed_callback_) + metrics_changed_callback_(); } -void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { +void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, + fxl::Closure on_present_callback) { + ASSERT_IS_GPU_THREAD; + FXL_DCHECK(pending_on_present_callback_ == nullptr); + FXL_DCHECK(on_present_callback != nullptr); + pending_on_present_callback_ = on_present_callback; + // Flush all session ops. Paint tasks have not yet executed but those are // fenced. The compositor can start processing ops while we finalize paint // tasks. - session_.Present(0, // presentation_time. (placeholder). - [](ui::PresentationInfoPtr) {} // callback + session_.Present(0, // presentation_time. Placeholder for now. + present_callback_ // callback ); // Execute paint tasks and signal fences. @@ -74,15 +77,22 @@ void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { // book-keeping on buffer caches. surface_producer_->OnSurfacesPresented(std::move(surfaces_to_submit)); - // Prepare for the next frame. These ops won't be processed till the next - // present. - EnqueueClearOps(); + // Prepare for the next frame. + EnqueueClearCommands(); +} + +void SessionConnection::OnPresent(images::PresentationInfo info) { + ASSERT_IS_GPU_THREAD; + auto callback = pending_on_present_callback_; + pending_on_present_callback_ = nullptr; + callback(); } -void SessionConnection::EnqueueClearOps() { +void SessionConnection::EnqueueClearCommands() { + ASSERT_IS_GPU_THREAD; // We are going to be sending down a fresh node hierarchy every frame. So just - // enqueue a detach op on the imported root node. + // enqueue a detach command on the imported root node. session_.Enqueue(scenic_lib::NewDetachChildrenCommand(root_node_.id())); } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index e4f39d314c98f..a80ba3a2235d2 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -2,62 +2,70 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ +#define FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ #include +#include "flutter/common/threads.h" +#include "flutter/content_handler/vulkan_surface_producer.h" #include "flutter/flow/compositor_context.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fidl/cpp/bindings/interface_handle.h" +#include "lib/fidl/cpp/interface_handle.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" -#include "vulkan_surface_producer.h" -namespace flutter { +namespace flutter_runner { -using OnMetricsUpdate = std::function; - -// The component residing on the GPU thread that is responsible for -// maintaining the Scenic session connection and presenting node updates. -class SessionConnection final { +class SessionConnection { public: - SessionConnection(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback); + SessionConnection(ui::ScenicPtr scenic, zx::eventpair import_token); ~SessionConnection(); bool has_metrics() const { return scene_update_context_.has_metrics(); } - const ui::gfx::MetricsPtr& metrics() const { + const gfx::MetricsPtr& metrics() const { return scene_update_context_.metrics(); } + void set_metrics_changed_callback(fxl::Closure callback) { + metrics_changed_callback_ = std::move(callback); + } + flow::SceneUpdateContext& scene_update_context() { return scene_update_context_; } - scenic_lib::ImportNode& root_node() { return root_node_; } + scenic_lib::ImportNode& root_node() { + ASSERT_IS_GPU_THREAD; + return root_node_; + } - void Present(flow::CompositorContext::ScopedFrame& frame); + void Present(flow::CompositorContext::ScopedFrame& frame, + fxl::Closure on_present_callback); private: - const std::string debug_label_; scenic_lib::Session session_; scenic_lib::ImportNode root_node_; + scenic_lib::Session::PresentCallback present_callback_; + fxl::Closure pending_on_present_callback_; std::unique_ptr surface_producer_; flow::SceneUpdateContext scene_update_context_; - OnMetricsUpdate metrics_changed_callback_; + fxl::Closure metrics_changed_callback_; + + void OnSessionError(); + void OnSessionEvents(fidl::VectorPtr events); - void OnSessionEvents(f1dl::Array events); + void EnqueueClearCommands(); - void EnqueueClearOps(); + void OnPresent(images::PresentationInfo info); FXL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); }; -} // namespace flutter +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ diff --git a/content_handler/surface.cc b/content_handler/surface.cc deleted file mode 100644 index 8efe1975fbfdb..0000000000000 --- a/content_handler/surface.cc +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "surface.h" - -#include -#include -#include -#include - -#include "lib/fxl/files/unique_fd.h" - -namespace flutter { - -Surface::Surface(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback) - : shell::Surface(std::make_unique( - scenic, - debug_label, - std::move(import_token), - std::move(session_metrics_did_change_callback), - std::move(session_error_callback))), - debug_label_(debug_label) {} - -Surface::~Surface() = default; - -// |shell::Surface| -bool Surface::IsValid() { - return valid_; -} - -// |shell::Surface| -std::unique_ptr Surface::AcquireFrame( - const SkISize& size) { - return std::make_unique( - nullptr, [](const shell::SurfaceFrame& surface_frame, SkCanvas* canvas) { - return true; - }); -} - -// |shell::Surface| -GrContext* Surface::GetContext() { - return nullptr; -} - -static zx_status_t DriverWatcher(int dirfd, - int event, - const char* fn, - void* cookie) { - if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { - return ZX_ERR_STOP; - } - return ZX_OK; -} - -bool Surface::CanConnectToDisplay() { - constexpr char kDisplayDriverClass[] = "/dev/class/display"; - fxl::UniqueFD fd(open(kDisplayDriverClass, O_DIRECTORY | O_RDONLY)); - if (fd.get() < 0) { - FXL_DLOG(ERROR) << "Failed to open " << kDisplayDriverClass; - return false; - } - - zx_status_t status = fdio_watch_directory( - fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(1)), nullptr); - return status == ZX_ERR_STOP; -} - -} // namespace flutter diff --git a/content_handler/surface.h b/content_handler/surface.h deleted file mode 100644 index 4ad27aaf540f3..0000000000000 --- a/content_handler/surface.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "compositor_context.h" -#include "flutter/fml/memory/weak_ptr.h" -#include "flutter/shell/common/surface.h" -#include "lib/fxl/macros.h" - -namespace flutter { - -// The interface between the Flutter rasterizer and the underlying platform. May -// be constructed on any thread but will be used by the engine only on the GPU -// thread. -class Surface final : public shell::Surface { - public: - Surface(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback); - - ~Surface() override; - - private: - const bool valid_ = CanConnectToDisplay(); - const std::string debug_label_; - std::unique_ptr compositor_context_; - - // |shell::Surface| - bool IsValid() override; - - // |shell::Surface| - std::unique_ptr AcquireFrame( - const SkISize& size) override; - - // |shell::Surface| - GrContext* GetContext() override; - - static bool CanConnectToDisplay(); - - FXL_DISALLOW_COPY_AND_ASSIGN(Surface); -}; - -} // namespace flutter diff --git a/content_handler/task_observers.cc b/content_handler/task_observers.cc deleted file mode 100644 index f23265e7b1653..0000000000000 --- a/content_handler/task_observers.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "task_observers.h" - -#include - -#include "lib/fsl/tasks/message_loop.h" - -namespace flutter { - -thread_local std::map tTaskObservers; - -static void ExecuteAfterTaskObservers() { - for (const auto& callback : tTaskObservers) { - callback.second(); - } -} - -void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, - fxl::Closure observer) { - if (!observer) { - return; - } - - if (tTaskObservers.size() == 0) { - fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback( - std::bind(&ExecuteAfterTaskObservers)); - } - - tTaskObservers[key] = observer; -} - -void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key) { - tTaskObservers.erase(key); - - if (tTaskObservers.size() == 0) { - fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); - } -} - -} // namespace flutter diff --git a/content_handler/task_observers.h b/content_handler/task_observers.h deleted file mode 100644 index 53f6b96222000..0000000000000 --- a/content_handler/task_observers.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "lib/fxl/functional/closure.h" - -namespace flutter { - -void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, - fxl::Closure observer); - -void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key); - -} // namespace flutter diff --git a/content_handler/unique_fdio_ns.h b/content_handler/unique_fdio_ns.h deleted file mode 100644 index 726137d729f85..0000000000000 --- a/content_handler/unique_fdio_ns.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "fdio/namespace.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/memory/unique_object.h" - -namespace flutter { - -struct UniqueFDIONSTraits { - static fdio_ns_t* InvalidValue() { return nullptr; } - - static bool IsValid(fdio_ns_t* ns) { return ns != InvalidValue(); } - - static void Free(fdio_ns_t* ns) { - auto status = fdio_ns_destroy(ns); - FXL_DCHECK(status == ZX_OK); - } -}; - -using UniqueFDIONS = fxl::UniqueObject; - -inline UniqueFDIONS UniqueFDIONSCreate() { - fdio_ns_t* ns = nullptr; - if (fdio_ns_create(&ns) == ZX_OK) { - return UniqueFDIONS{ns}; - } - return UniqueFDIONS{nullptr}; -} - -} // namespace flutter diff --git a/content_handler/vulkan_rasterizer.cc b/content_handler/vulkan_rasterizer.cc new file mode 100644 index 0000000000000..25f90c460ce3f --- /dev/null +++ b/content_handler/vulkan_rasterizer.cc @@ -0,0 +1,117 @@ +// Copyright 2017 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. + +#include "flutter/content_handler/vulkan_rasterizer.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "flutter/common/threads.h" +#include "flutter/glue/trace_event.h" +#include "lib/fxl/files/unique_fd.h" + +namespace flutter_runner { + +constexpr char kGpuDriverClass[] = "/dev/class/gpu"; + +static zx_status_t DriverWatcher(int dirfd, + int event, + const char* fn, + void* cookie) { + if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { + return ZX_ERR_STOP; + } + return ZX_OK; +} + +bool WaitForFirstGpuDriver() { + fxl::UniqueFD fd(open(kGpuDriverClass, O_DIRECTORY | O_RDONLY)); + if (fd.get() < 0) { + FXL_DLOG(ERROR) << "Failed to open " << kGpuDriverClass; + return false; + } + + zx_status_t status = fdio_watch_directory( + fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(5)), nullptr); + return status == ZX_ERR_STOP; +} + +VulkanRasterizer::VulkanRasterizer() : compositor_context_(nullptr) { + valid_ = WaitForFirstGpuDriver(); +} + +VulkanRasterizer::~VulkanRasterizer() = default; + +bool VulkanRasterizer::IsValid() const { + return valid_; +} + +void VulkanRasterizer::SetScene(fidl::InterfaceHandle scenic, + zx::eventpair import_token, + fxl::Closure metrics_changed_callback) { + ASSERT_IS_GPU_THREAD; + FXL_DCHECK(valid_ && !session_connection_); + session_connection_ = std::make_unique( + scenic.Bind(), std::move(import_token)); + session_connection_->set_metrics_changed_callback( + std::move(metrics_changed_callback)); +} + +void VulkanRasterizer::Draw(std::unique_ptr layer_tree, + fxl::Closure callback) { + ASSERT_IS_GPU_THREAD; + FXL_DCHECK(callback != nullptr); + + if (layer_tree == nullptr) { + FXL_LOG(ERROR) << "Layer tree was not valid."; + callback(); + return; + } + + if (!session_connection_) { + FXL_LOG(ERROR) << "Session was not valid."; + callback(); + return; + } + + if (!session_connection_->has_metrics()) { + // Still awaiting metrics. Will redraw when we get them. + callback(); + return; + } + + compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); + + flow::CompositorContext::ScopedFrame frame = compositor_context_.AcquireFrame( + nullptr, nullptr, true /* instrumentation enabled */); + { + // Preroll the Flutter layer tree. This allows Flutter to perform pre-paint + // optimizations. + TRACE_EVENT0("flutter", "Preroll"); + layer_tree->Preroll(frame, session_connection_->metrics().get()); + } + + { + // Traverse the Flutter layer tree so that the necessary session ops to + // represent the frame are enqueued in the underlying session. + TRACE_EVENT0("flutter", "UpdateScene"); + layer_tree->UpdateScene(session_connection_->scene_update_context(), + session_connection_->root_node()); + } + + { + // Flush all pending session ops. + TRACE_EVENT0("flutter", "SessionPresent"); + session_connection_->Present( + frame, [callback = std::move(callback)]() { callback(); }); + } +} + +} // namespace flutter_runner diff --git a/content_handler/vulkan_rasterizer.h b/content_handler/vulkan_rasterizer.h new file mode 100644 index 0000000000000..c3ae211553f5a --- /dev/null +++ b/content_handler/vulkan_rasterizer.h @@ -0,0 +1,42 @@ +// Copyright 2017 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. + +#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ +#define FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ + +#include + +#include "flutter/content_handler/rasterizer.h" +#include "flutter/content_handler/session_connection.h" +#include "flutter/flow/compositor_context.h" +#include "lib/fxl/macros.h" + +namespace flutter_runner { + +class VulkanRasterizer : public Rasterizer { + public: + VulkanRasterizer(); + + ~VulkanRasterizer() override; + + bool IsValid() const; + + void SetScene(fidl::InterfaceHandle scenic, + zx::eventpair import_token, + fxl::Closure metrics_changed_callback) override; + + void Draw(std::unique_ptr layer_tree, + fxl::Closure callback) override; + + private: + flow::CompositorContext compositor_context_; + std::unique_ptr session_connection_; + bool valid_; + + FXL_DISALLOW_COPY_AND_ASSIGN(VulkanRasterizer); +}; + +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index b6ad80fba4deb..6d5df488542fe 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "vulkan_surface.h" - #include +#include "flutter/content_handler/vulkan_surface.h" +#include "flutter/common/threads.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter { +namespace flutter_runner { VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -22,6 +22,8 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, backend_context_(std::move(backend_context)), session_(session), wait_(this) { + ASSERT_IS_GPU_THREAD; + FXL_DCHECK(session_); zx::vmo exported_vmo; @@ -53,6 +55,7 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, } VulkanSurface::~VulkanSurface() { + ASSERT_IS_GPU_THREAD; if (async_) { wait_.Cancel(async_); wait_.set_object(ZX_HANDLE_INVALID); @@ -322,6 +325,7 @@ bool VulkanSurface::PushSessionImageSetupOps(scenic_lib::Session* session, } scenic_lib::Image* VulkanSurface::GetImage() { + ASSERT_IS_GPU_THREAD; if (!valid_) { return 0; } @@ -329,6 +333,7 @@ scenic_lib::Image* VulkanSurface::GetImage() { } sk_sp VulkanSurface::GetSkiaSurface() const { + ASSERT_IS_GPU_THREAD; return valid_ ? sk_surface_ : nullptr; } @@ -353,6 +358,7 @@ bool VulkanSurface::FlushSessionAcquireAndReleaseEvents() { void VulkanSurface::SignalWritesFinished( std::function on_writes_committed) { + ASSERT_IS_GPU_THREAD; FXL_DCHECK(on_writes_committed); if (!valid_) { @@ -368,6 +374,8 @@ void VulkanSurface::SignalWritesFinished( } void VulkanSurface::Reset() { + ASSERT_IS_GPU_THREAD; + if (acquire_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK || release_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK) { valid_ = false; @@ -402,10 +410,10 @@ void VulkanSurface::Reset() { } } -async_wait_result_t VulkanSurface::OnHandleReady( - async_t* async, - zx_status_t status, - const zx_packet_signal_t* signal) { +async_wait_result_t VulkanSurface::OnHandleReady(async_t* async, + zx_status_t status, + const zx_packet_signal_t* signal) { + ASSERT_IS_GPU_THREAD; if (status != ZX_OK) return ASYNC_WAIT_FINISHED; FXL_DCHECK(signal->observed & ZX_EVENT_SIGNALED); @@ -413,4 +421,4 @@ async_wait_result_t VulkanSurface::OnHandleReady( return ASYNC_WAIT_AGAIN; } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface.h b/content_handler/vulkan_surface.h index 7add6b05bb8cc..41a807af81f9c 100644 --- a/content_handler/vulkan_surface.h +++ b/content_handler/vulkan_surface.h @@ -20,10 +20,9 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -namespace flutter { +namespace flutter_runner { -class VulkanSurface final - : public flow::SceneUpdateContext::SurfaceProducerSurface { +class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { public: VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -33,16 +32,12 @@ class VulkanSurface final ~VulkanSurface() override; - // |flow::SceneUpdateContext::SurfaceProducerSurface| size_t AdvanceAndGetAge() override; - // |flow::SceneUpdateContext::SurfaceProducerSurface| bool FlushSessionAcquireAndReleaseEvents() override; - // |flow::SceneUpdateContext::SurfaceProducerSurface| bool IsValid() const override; - // |flow::SceneUpdateContext::SurfaceProducerSurface| SkISize GetSize() const override; // Note: It is safe for the caller to collect the surface in the @@ -120,4 +115,4 @@ class VulkanSurface final FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); }; -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface_pool.cc b/content_handler/vulkan_surface_pool.cc index 93d14c2ddbff7..af23ef711b7ad 100644 --- a/content_handler/vulkan_surface_pool.cc +++ b/content_handler/vulkan_surface_pool.cc @@ -2,14 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "vulkan_surface_pool.h" - #include +#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter { +namespace flutter_runner { VulkanSurfacePool::VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -178,4 +177,4 @@ void VulkanSurfacePool::TraceStats() { trace_surfaces_reused_ = 0; } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface_pool.h b/content_handler/vulkan_surface_pool.h index 4900816762910..52dd3ed6aa417 100644 --- a/content_handler/vulkan_surface_pool.h +++ b/content_handler/vulkan_surface_pool.h @@ -6,13 +6,12 @@ #include #include - +#include "flutter/content_handler/vulkan_surface.h" #include "lib/fxl/macros.h" -#include "vulkan_surface.h" -namespace flutter { +namespace flutter_runner { -class VulkanSurfacePool final { +class VulkanSurfacePool { public: static const size_t kMaxSurfacesOfSameSize = 3; static const size_t kMaxSurfaceAge = 3; @@ -75,4 +74,4 @@ class VulkanSurfacePool final { FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfacePool); }; -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index ff8a9ab9d1f4a..6f605c109b7df 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -2,18 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "vulkan_surface_producer.h" +#include "flutter/content_handler/vulkan_surface_producer.h" #include #include #include - #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" -namespace flutter { +namespace flutter_runner { VulkanSurfaceProducer::VulkanSurfaceProducer( scenic_lib::Session* mozart_session) { @@ -43,7 +42,7 @@ bool VulkanSurfaceProducer::Initialize(scenic_lib::Session* mozart_session) { VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, }; application_ = std::make_unique( - *vk_, "FlutterApplicationRunner", std::move(extensions)); + *vk_, "FlutterContentHandler", std::move(extensions)); if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) { // Make certain the application instance was created and it setup the @@ -201,4 +200,4 @@ void VulkanSurfaceProducer::SubmitSurface( surface_pool_->SubmitSurface(std::move(surface)); } -} // namespace flutter +} // namespace flutter_runner diff --git a/content_handler/vulkan_surface_producer.h b/content_handler/vulkan_surface_producer.h index 15c4419e8cde7..2338a8a6ba709 100644 --- a/content_handler/vulkan_surface_producer.h +++ b/content_handler/vulkan_surface_producer.h @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#pragma once +#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +#define FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +#include "flutter/content_handler/vulkan_surface.h" +#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/flow/scene_update_context.h" #include "flutter/vulkan/vulkan_application.h" #include "flutter/vulkan/vulkan_device.h" @@ -14,14 +17,11 @@ #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -#include "vulkan_surface.h" -#include "vulkan_surface_pool.h" -namespace flutter { +namespace flutter_runner { -class VulkanSurfaceProducer final - : public flow::SceneUpdateContext::SurfaceProducer, - public vulkan::VulkanProvider { +class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer, + public vulkan::VulkanProvider { public: VulkanSurfaceProducer(scenic_lib::Session* mozart_session); @@ -74,4 +74,6 @@ class VulkanSurfaceProducer final FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfaceProducer); }; -} // namespace flutter +} // namespace flutter_runner + +#endif // FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ diff --git a/flow/BUILD.gn b/flow/BUILD.gn index 07c5d4e5d4e7b..e6a6411a6c1da 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -48,12 +48,11 @@ source_set("flow") { "matrix_decomposition.h", "paint_utils.cc", "paint_utils.h", + "process_info.h", "raster_cache.cc", "raster_cache.h", "raster_cache_key.cc", "raster_cache_key.h", - "skia_gpu_object.cc", - "skia_gpu_object.h", "texture.cc", "texture.h", ] @@ -62,11 +61,12 @@ source_set("flow") { "//garnet/public/lib/fxl", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] deps = [ "$flutter_root/common", - "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/synchronization", "//third_party/skia", @@ -103,8 +103,8 @@ executable("flow_unittests") { deps = [ ":flow", - "$flutter_root/testing", "//third_party/dart/runtime:libdart_jit", # for tracing + "$flutter_root/testing", "//third_party/skia", ] } diff --git a/flow/compositor_context.cc b/flow/compositor_context.cc index 53659103be9f1..e0d17229e7981 100644 --- a/flow/compositor_context.cc +++ b/flow/compositor_context.cc @@ -4,12 +4,12 @@ #include "flutter/flow/compositor_context.h" -#include "flutter/flow/layers/layer_tree.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { -CompositorContext::CompositorContext() = default; +CompositorContext::CompositorContext(std::unique_ptr info) + : process_info_(std::move(info)) {} CompositorContext::~CompositorContext() = default; @@ -18,6 +18,10 @@ void CompositorContext::BeginFrame(ScopedFrame& frame, if (enable_instrumentation) { frame_count_.Increment(); frame_time_.Start(); + + if (process_info_ && process_info_->SampleNow()) { + memory_usage_.Add(process_info_->GetResidentMemorySize()); + } } } @@ -29,12 +33,11 @@ void CompositorContext::EndFrame(ScopedFrame& frame, } } -std::unique_ptr CompositorContext::AcquireFrame( +CompositorContext::ScopedFrame CompositorContext::AcquireFrame( GrContext* gr_context, SkCanvas* canvas, bool instrumentation_enabled) { - return std::make_unique(*this, gr_context, canvas, - instrumentation_enabled); + return ScopedFrame(*this, gr_context, canvas, instrumentation_enabled); } CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, @@ -48,23 +51,18 @@ CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, context_.BeginFrame(*this, instrumentation_enabled_); } +CompositorContext::ScopedFrame::ScopedFrame(ScopedFrame&& frame) = default; + CompositorContext::ScopedFrame::~ScopedFrame() { context_.EndFrame(*this, instrumentation_enabled_); } -bool CompositorContext::ScopedFrame::Raster(flow::LayerTree& layer_tree, - bool ignore_raster_cache) { - layer_tree.Preroll(*this, ignore_raster_cache); - layer_tree.Paint(*this); - return true; -} - void CompositorContext::OnGrContextCreated() { - texture_registry_.OnGrContextCreated(); + texture_registry_->OnGrContextCreated(); } void CompositorContext::OnGrContextDestroyed() { - texture_registry_.OnGrContextDestroyed(); + texture_registry_->OnGrContextDestroyed(); raster_cache_.Clear(); } diff --git a/flow/compositor_context.h b/flow/compositor_context.h index 14c2449dbecd0..2d310422747b7 100644 --- a/flow/compositor_context.h +++ b/flow/compositor_context.h @@ -9,6 +9,7 @@ #include #include "flutter/flow/instrumentation.h" +#include "flutter/flow/process_info.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" #include "lib/fxl/macros.h" @@ -17,26 +18,19 @@ namespace flow { -class LayerTree; - class CompositorContext { public: class ScopedFrame { public: - ScopedFrame(CompositorContext& context, - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled); - - virtual ~ScopedFrame(); - SkCanvas* canvas() { return canvas_; } CompositorContext& context() const { return context_; } GrContext* gr_context() const { return gr_context_; } - virtual bool Raster(LayerTree& layer_tree, bool ignore_raster_cache); + ScopedFrame(ScopedFrame&& frame); + + ~ScopedFrame(); private: CompositorContext& context_; @@ -44,17 +38,23 @@ class CompositorContext { SkCanvas* canvas_; const bool instrumentation_enabled_; + ScopedFrame(CompositorContext& context, + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled); + + friend class CompositorContext; + FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); }; - CompositorContext(); + CompositorContext(std::unique_ptr info); - virtual ~CompositorContext(); + ~CompositorContext(); - virtual std::unique_ptr AcquireFrame( - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled); + ScopedFrame AcquireFrame(GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled = true); void OnGrContextCreated(); @@ -62,7 +62,7 @@ class CompositorContext { RasterCache& raster_cache() { return raster_cache_; } - TextureRegistry& texture_registry() { return texture_registry_; } + TextureRegistry& texture_registry() { return *texture_registry_; } const Counter& frame_count() const { return frame_count_; } @@ -70,12 +70,20 @@ class CompositorContext { Stopwatch& engine_time() { return engine_time_; } + const CounterValues& memory_usage() const { return memory_usage_; } + + void SetTextureRegistry(TextureRegistry* textureRegistry) { + texture_registry_ = textureRegistry; + } + private: RasterCache raster_cache_; - TextureRegistry texture_registry_; + TextureRegistry* texture_registry_; + std::unique_ptr process_info_; Counter frame_count_; Stopwatch frame_time_; Stopwatch engine_time_; + CounterValues memory_usage_; void BeginFrame(ScopedFrame& frame, bool enable_instrumentation); diff --git a/flow/debug_print.cc b/flow/debug_print.cc index 3311b9c2b43e3..0aa5b4b3b7d2d 100644 --- a/flow/debug_print.cc +++ b/flow/debug_print.cc @@ -80,8 +80,3 @@ std::ostream& operator<<(std::ostream& os, const flow::RasterCacheKey& k) { ; return os; } - -std::ostream& operator<<(std::ostream& os, const SkISize& size) { - os << size.width() << ", " << size.height(); - return os; -} diff --git a/flow/debug_print.h b/flow/debug_print.h index 78a28fe38562d..ca5973eeb0977 100644 --- a/flow/debug_print.h +++ b/flow/debug_print.h @@ -15,15 +15,14 @@ #define DEF_PRINTER(x) std::ostream& operator<<(std::ostream&, const x&); -DEF_PRINTER(flow::MatrixDecomposition); DEF_PRINTER(flow::RasterCacheKey); -DEF_PRINTER(SkISize); +DEF_PRINTER(flow::MatrixDecomposition); DEF_PRINTER(SkMatrix); DEF_PRINTER(SkMatrix44); -DEF_PRINTER(SkPoint); -DEF_PRINTER(SkRect); -DEF_PRINTER(SkRRect); DEF_PRINTER(SkVector3); DEF_PRINTER(SkVector4); +DEF_PRINTER(SkRect); +DEF_PRINTER(SkRRect); +DEF_PRINTER(SkPoint); #endif // FLUTTER_FLOW_DEBUG_PRINT_H_ diff --git a/flow/export_node.cc b/flow/export_node.cc index 27ab34030ca42..a130c426a75bf 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -4,27 +4,28 @@ #include "flutter/flow/export_node.h" +#include "flutter/common/threads.h" #include "lib/fxl/functional/make_copyable.h" namespace flow { ExportNodeHolder::ExportNodeHolder( - fxl::RefPtr gpu_task_runner, fxl::RefPtr export_token_handle) - : gpu_task_runner_(std::move(gpu_task_runner)), - export_node_(std::make_unique(export_token_handle)) { - FXL_DCHECK(gpu_task_runner_); + : export_node_(std::make_unique(export_token_handle)) { + ASSERT_IS_UI_THREAD; } void ExportNodeHolder::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { + ASSERT_IS_GPU_THREAD; export_node_->Bind(context, container, offset, hit_testable); } ExportNodeHolder::~ExportNodeHolder() { - gpu_task_runner_->PostTask( + ASSERT_IS_UI_THREAD; + blink::Threads::Gpu()->PostTask( fxl::MakeCopyable([export_node = std::move(export_node_)]() { export_node->Dispose(true); })); @@ -43,6 +44,8 @@ void ExportNode::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { + ASSERT_IS_GPU_THREAD; + if (export_token_) { // Happens first time we bind. node_.reset(new scenic_lib::EntityNode(container.session())); @@ -64,6 +67,8 @@ void ExportNode::Bind(SceneUpdateContext& context, } void ExportNode::Dispose(bool remove_from_scene_update_context) { + ASSERT_IS_GPU_THREAD; + // If scene_update_context_ is set, then we should still have a node left to // dereference. // If scene_update_context_ is null, then either: diff --git a/flow/export_node.h b/flow/export_node.h index e6a11175e561e..24f94fcebf20f 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -15,7 +15,6 @@ #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/ui/scenic/client/resources.h" -#include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" namespace flow { @@ -25,8 +24,7 @@ namespace flow { // held by the ExportNode. class ExportNodeHolder : public fxl::RefCountedThreadSafe { public: - ExportNodeHolder(fxl::RefPtr gpu_task_runner, - fxl::RefPtr export_token_handle); + ExportNodeHolder(fxl::RefPtr export_token_handle); ~ExportNodeHolder(); // Calls Bind() on the wrapped ExportNode. @@ -38,7 +36,6 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { ExportNode* export_node() { return export_node_.get(); } private: - fxl::RefPtr gpu_task_runner_; std::unique_ptr export_node_; FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index ca228a7d58f76..a33b0eaa681b7 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -137,20 +137,20 @@ void DefaultLayerBuilder::PushPerformanceOverlay(uint64_t enabled_options, } void DefaultLayerBuilder::PushPicture(const SkPoint& offset, - SkiaGPUObject picture, + sk_sp picture, bool picture_is_complex, bool picture_will_change) { if (!current_layer_) { return; } - SkRect pictureRect = picture.get()->cullRect(); + SkRect pictureRect = picture->cullRect(); pictureRect.offset(offset.x(), offset.y()); if (!SkRect::Intersects(pictureRect, cull_rects_.top())) { return; } auto layer = std::make_unique(); layer->set_offset(offset); - layer->set_picture(std::move(picture)); + layer->set_picture(picture); layer->set_is_complex(picture_is_complex); layer->set_will_change(picture_will_change); current_layer_->Add(std::move(layer)); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index cadd173ab5a84..a62ec46714d21 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -59,7 +59,7 @@ class DefaultLayerBuilder final : public LayerBuilder { // |flow::LayerBuilder| void PushPicture(const SkPoint& offset, - SkiaGPUObject picture, + sk_sp picture, bool picture_is_complex, bool picture_will_change) override; diff --git a/flow/layers/layer.h b/flow/layers/layer.h index cf7ad71c36fae..d0ef1990ab4f2 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -44,6 +44,9 @@ class Layer { virtual ~Layer(); struct PrerollContext { +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics = nullptr; +#endif RasterCache* raster_cache; GrContext* gr_context; SkColorSpace* dst_color_space; @@ -56,6 +59,7 @@ class Layer { SkCanvas& canvas; const Stopwatch& frame_time; const Stopwatch& engine_time; + const CounterValues& memory_usage; TextureRegistry& texture_registry; const bool checkerboard_offscreen_layers; }; diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index a29e959514428..91ae13974a23b 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -8,7 +8,6 @@ #include #include "flutter/flow/layers/layer.h" -#include "flutter/flow/skia_gpu_object.h" #include "garnet/public/lib/fxl/macros.h" #include "third_party/skia/include/core/SkBlendMode.h" #include "third_party/skia/include/core/SkColor.h" @@ -58,7 +57,7 @@ class LayerBuilder { const SkRect& rect) = 0; virtual void PushPicture(const SkPoint& offset, - SkiaGPUObject picture, + sk_sp picture, bool picture_is_complex, bool picture_will_change) = 0; diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index d9fb374194688..fde2fc4bf0866 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -17,18 +17,43 @@ LayerTree::LayerTree() LayerTree::~LayerTree() = default; +void LayerTree::Raster(CompositorContext::ScopedFrame& frame, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif + bool ignore_raster_cache) { +#if defined(OS_FUCHSIA) + FXL_DCHECK(metrics); +#endif + Preroll(frame, +#if defined(OS_FUCHSIA) + metrics, +#endif + ignore_raster_cache); + Paint(frame); +} + void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool ignore_raster_cache) { +#if defined(OS_FUCHSIA) + FXL_DCHECK(metrics); +#endif TRACE_EVENT0("flutter", "LayerTree::Preroll"); SkColorSpace* color_space = frame.canvas() ? frame.canvas()->imageInfo().colorSpace() : nullptr; frame.context().raster_cache().SetCheckboardCacheImages( checkerboard_raster_cache_images_); Layer::PrerollContext context = { - ignore_raster_cache ? nullptr : &frame.context().raster_cache(), - frame.gr_context(), - color_space, - SkRect::MakeEmpty(), +#if defined(OS_FUCHSIA) + metrics, +#endif + ignore_raster_cache ? nullptr : &frame.context().raster_cache(), + frame.gr_context(), + color_space, + SkRect::MakeEmpty(), }; root_layer_->Preroll(&context, SkMatrix::I()); @@ -38,12 +63,9 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, void LayerTree::UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container) { TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); - const auto& metrics = context.metrics(); - SceneUpdateContext::Transform transform(context, // context - 1.0f / metrics->scale_x, // X - 1.0f / metrics->scale_y, // Y - 1.0f / metrics->scale_z // Z - ); + + SceneUpdateContext::Transform transform(context, 1.f / device_pixel_ratio_, + 1.f / device_pixel_ratio_, 1.f); SceneUpdateContext::Frame frame( context, SkRRect::MakeRect( @@ -60,13 +82,12 @@ void LayerTree::UpdateScene(SceneUpdateContext& context, #endif void LayerTree::Paint(CompositorContext::ScopedFrame& frame) const { - Layer::PaintContext context = { - *frame.canvas(), // - frame.context().frame_time(), // - frame.context().engine_time(), // - frame.context().texture_registry(), // - checkerboard_offscreen_layers_ // - }; + Layer::PaintContext context = {*frame.canvas(), + frame.context().frame_time(), + frame.context().engine_time(), + frame.context().memory_usage(), + frame.context().texture_registry(), + checkerboard_offscreen_layers_}; TRACE_EVENT0("flutter", "LayerTree::Paint"); if (root_layer_->needs_painting()) diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 25a8e072cfa21..5ddebd088de9e 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -13,6 +13,9 @@ #include "flutter/flow/layers/layer.h" #include "lib/fxl/macros.h" #include "lib/fxl/time/time_delta.h" +#if defined(OS_FUCHSIA) +#include +#endif #include "third_party/skia/include/core/SkSize.h" namespace flow { @@ -23,10 +26,24 @@ class LayerTree { ~LayerTree(); + // Raster includes both Preroll and Paint. + void Raster(CompositorContext::ScopedFrame& frame, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif + bool ignore_raster_cache = false); + void Preroll(CompositorContext::ScopedFrame& frame, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool ignore_raster_cache = false); #if defined(OS_FUCHSIA) + void set_device_pixel_ratio(float device_pixel_ratio) { + device_pixel_ratio_ = device_pixel_ratio; + } + void UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container); #endif @@ -76,6 +93,10 @@ class LayerTree { bool checkerboard_raster_cache_images_; bool checkerboard_offscreen_layers_; +#if defined(OS_FUCHSIA) + float device_pixel_ratio_ = 1.f; +#endif + FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree); }; diff --git a/flow/layers/performance_overlay_layer.cc b/flow/layers/performance_overlay_layer.cc index 7d871af33b94f..cc55500115a08 100644 --- a/flow/layers/performance_overlay_layer.cc +++ b/flow/layers/performance_overlay_layer.cc @@ -57,6 +57,34 @@ void VisualizeStopWatch(SkCanvas& canvas, } } +void VisualizeCounterValuesBytes(SkCanvas& canvas, + const CounterValues& counter_values, + SkScalar x, + SkScalar y, + SkScalar width, + SkScalar height, + bool show_graph, + bool show_labels, + const std::string& label_prefix) { + 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); + counter_values.Visualize(canvas, visualization_rect); + } + + auto current_usage = counter_values.GetCurrentValue(); + + if (show_labels && current_usage > 0) { + std::stringstream stream; + stream.setf(std::ios::fixed | std::ios::showpoint); + stream << std::setprecision(2); + stream << label_prefix << " " << current_usage * 1e-6 << " MB"; + DrawStatisticsText(canvas, stream.str(), x + label_x, y + height + label_y); + } +} + } // namespace PerformanceOverlayLayer::PerformanceOverlayLayer(uint64_t options) @@ -83,6 +111,11 @@ void PerformanceOverlayLayer::Paint(PaintContext& context) const { VisualizeStopWatch(context.canvas, context.engine_time, x, y + height, width, height - padding, options_ & kVisualizeEngineStatistics, options_ & kDisplayEngineStatistics, "UI"); + + VisualizeCounterValuesBytes( + context.canvas, context.memory_usage, x, y + (2 * height), width, + height - padding, options_ & kVisualizeMemoryStatistics, + options_ & kDisplayMemoryStatistics, "Memory (Resident)"); } } // namespace flow diff --git a/flow/layers/performance_overlay_layer.h b/flow/layers/performance_overlay_layer.h index 77448107147a4..e7c3ac530a02a 100644 --- a/flow/layers/performance_overlay_layer.h +++ b/flow/layers/performance_overlay_layer.h @@ -14,6 +14,8 @@ const int kDisplayRasterizerStatistics = 1 << 0; const int kVisualizeRasterizerStatistics = 1 << 1; const int kDisplayEngineStatistics = 1 << 2; const int kVisualizeEngineStatistics = 1 << 3; +const int kDisplayMemoryStatistics = 1 << 4; +const int kVisualizeMemoryStatistics = 1 << 5; class PerformanceOverlayLayer : public Layer { public: diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index 552ca0443bd80..4a99d7d07f75e 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -4,30 +4,39 @@ #include "flutter/flow/layers/picture_layer.h" +#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace flow { PictureLayer::PictureLayer() = default; -PictureLayer::~PictureLayer() = default; +PictureLayer::~PictureLayer() { + // The picture may contain references to textures that are associated + // with the IO thread's context. + SkPicture* picture = picture_.release(); + if (picture) { + blink::Threads::IO()->PostTask([picture]() { picture->unref(); }); + } +} void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { - SkPicture* sk_picture = picture(); - if (auto cache = context->raster_cache) { raster_cache_result_ = cache->GetPrerolledImage( - context->gr_context, sk_picture, matrix, context->dst_color_space, + context->gr_context, picture_.get(), matrix, context->dst_color_space, +#if defined(OS_FUCHSIA) + context->metrics, +#endif is_complex_, will_change_); } - SkRect bounds = sk_picture->cullRect().makeOffset(offset_.x(), offset_.y()); + SkRect bounds = picture_->cullRect().makeOffset(offset_.x(), offset_.y()); set_paint_bounds(bounds); } void PictureLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PictureLayer::Paint"); - FXL_DCHECK(picture_.get()); + FXL_DCHECK(picture_); FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); @@ -44,7 +53,7 @@ void PictureLayer::Paint(PaintContext& context) const { SkCanvas::kStrict_SrcRectConstraint // source constraint ); } else { - context.canvas.drawPicture(picture()); + context.canvas.drawPicture(picture_.get()); } } diff --git a/flow/layers/picture_layer.h b/flow/layers/picture_layer.h index c67929b7cb455..191ef9d7097a2 100644 --- a/flow/layers/picture_layer.h +++ b/flow/layers/picture_layer.h @@ -5,11 +5,8 @@ #ifndef FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ #define FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ -#include - #include "flutter/flow/layers/layer.h" #include "flutter/flow/raster_cache.h" -#include "flutter/flow/skia_gpu_object.h" namespace flow { @@ -19,14 +16,12 @@ class PictureLayer : public Layer { ~PictureLayer() override; void set_offset(const SkPoint& offset) { offset_ = offset; } - void set_picture(SkiaGPUObject picture) { - picture_ = std::move(picture); - } + void set_picture(sk_sp picture) { picture_ = std::move(picture); } void set_is_complex(bool value) { is_complex_ = value; } void set_will_change(bool value) { will_change_ = value; } - SkPicture* picture() const { return picture_.get().get(); } + SkPicture* picture() const { return picture_.get(); } void Preroll(PrerollContext* frame, const SkMatrix& matrix) override; @@ -34,9 +29,7 @@ class PictureLayer : public Layer { private: SkPoint offset_; - // Even though pictures themselves are not GPU resources, they may reference - // images that have a reference to a GPU resource. - SkiaGPUObject picture_; + sk_sp picture_; bool is_complex_ = false; bool will_change_ = false; RasterCacheResult raster_cache_result_; diff --git a/flow/process_info.h b/flow/process_info.h new file mode 100644 index 0000000000000..6623fe7257396 --- /dev/null +++ b/flow/process_info.h @@ -0,0 +1,31 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_FLOW_PROCESS_INFO_H_ +#define FLUTTER_FLOW_PROCESS_INFO_H_ + +#include "lib/fxl/macros.h" + +namespace flow { + +/// The CompositorContext attempts to collect information from the process for +/// instrumentation purposes. The compositor does not have the platform +/// specific capabilities to collect this information on its own. The platform +/// can choose to provide this information however. +class ProcessInfo { + public: + virtual ~ProcessInfo() = default; + + virtual bool SampleNow() = 0; + + /// Virtual memory size in bytes. + virtual size_t GetVirtualMemorySize() = 0; + + /// Resident memory size in bytes. + virtual size_t GetResidentMemorySize() = 0; +}; + +} // namespace flow + +#endif // FLUTTER_FLOW_PROCESS_INFO_H_ diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 11a86729b489b..aa9fad0e281de 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -6,6 +6,7 @@ #include +#include "flutter/common/threads.h" #include "flutter/flow/paint_utils.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @@ -72,6 +73,9 @@ RasterCacheResult RasterizePicture(SkPicture* picture, GrContext* context, const MatrixDecomposition& matrix, SkColorSpace* dst_color_space, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool checkerboard) { TRACE_EVENT0("flutter", "RasterCachePopulate"); @@ -79,9 +83,17 @@ RasterCacheResult RasterizePicture(SkPicture* picture, const SkRect logical_rect = picture->cullRect(); - const SkRect physical_rect = - SkRect::MakeWH(std::fabs(logical_rect.width() * scale.x()), - std::fabs(logical_rect.height() * scale.y())); +#if defined(OS_FUCHSIA) + float metrics_scale_x = metrics->scale_x; + float metrics_scale_y = metrics->scale_y; +#else + float metrics_scale_x = 1.f; + float metrics_scale_y = 1.f; +#endif + + const SkRect physical_rect = SkRect::MakeWH( + std::fabs(logical_rect.width() * metrics_scale_x * scale.x()), + std::fabs(logical_rect.height() * metrics_scale_y * scale.y())); const SkImageInfo image_info = SkImageInfo::MakeN32Premul( std::ceil(physical_rect.width()), // physical width @@ -108,7 +120,8 @@ RasterCacheResult RasterizePicture(SkPicture* picture, } canvas->clear(SK_ColorTRANSPARENT); - canvas->scale(std::abs(scale.x()), std::abs(scale.y())); + canvas->scale(std::abs(scale.x() * metrics_scale_x), + std::abs(scale.y() * metrics_scale_y)); canvas->translate(-logical_rect.left(), -logical_rect.top()); canvas->drawPicture(picture); @@ -140,6 +153,9 @@ RasterCacheResult RasterCache::GetPrerolledImage( SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool is_complex, bool will_change) { if (!IsPictureWorthRasterizing(picture, will_change, is_complex)) { @@ -156,7 +172,11 @@ RasterCacheResult RasterCache::GetPrerolledImage( return {}; } - RasterCacheKey cache_key(*picture, matrix); + RasterCacheKey cache_key(*picture, +#if defined(OS_FUCHSIA) + metrics->scale_x, metrics->scale_y, +#endif + matrix); Entry& entry = cache_[cache_key]; entry.access_count = ClampSize(entry.access_count + 1, 0, threshold_); @@ -169,6 +189,9 @@ RasterCacheResult RasterCache::GetPrerolledImage( if (!entry.image.is_valid()) { entry.image = RasterizePicture(picture, context, matrix, dst_color_space, +#if defined(OS_FUCHSIA) + metrics, +#endif checkerboard_images_); } diff --git a/flow/raster_cache.h b/flow/raster_cache.h index 3278eb355b030..31201049b6119 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -12,6 +12,9 @@ #include "flutter/flow/raster_cache_key.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" +#if defined(OS_FUCHSIA) +#include +#endif #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -54,6 +57,9 @@ class RasterCache { SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, +#if defined(OS_FUCHSIA) + gfx::Metrics* metrics, +#endif bool is_complex, bool will_change); diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index 1f28ea5320d36..83df52658c981 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -15,15 +15,30 @@ namespace flow { class RasterCacheKey { public: - RasterCacheKey(const SkPicture& picture, const MatrixDecomposition& matrix) + RasterCacheKey(const SkPicture& picture, +#if defined(OS_FUCHSIA) + float metrics_scale_x, + float metrics_scale_y, +#endif + const MatrixDecomposition& matrix) : picture_id_(picture.uniqueID()), - scale_key_(SkISize::Make(matrix.scale().x() * 1e3, - matrix.scale().y() * 1e3)) {} +#if defined(OS_FUCHSIA) + metrics_scale_x_(metrics_scale_x), + metrics_scale_y_(metrics_scale_y), +#endif + scale_key_( + SkISize::Make(matrix.scale().x() * 1e3, matrix.scale().y() * 1e3)) { + } uint32_t picture_id() const { return picture_id_; } const SkISize& scale_key() const { return scale_key_; } +#if defined(OS_FUCHSIA) + float metrics_scale_x() const { return metrics_scale_x_; } + float metrics_scale_y() const { return metrics_scale_y_; } +#endif + struct Hash { std::size_t operator()(RasterCacheKey const& key) const { return key.picture_id_; @@ -34,6 +49,11 @@ class RasterCacheKey { constexpr bool operator()(const RasterCacheKey& lhs, const RasterCacheKey& rhs) const { return lhs.picture_id_ == rhs.picture_id_ && +#if defined(OS_FUCHSIA) + lhs.metrics_scale_x_ == rhs.metrics_scale_x_ && + + lhs.metrics_scale_y_ == rhs.metrics_scale_y_ && +#endif lhs.scale_key_ == rhs.scale_key_; } }; @@ -43,6 +63,10 @@ class RasterCacheKey { private: uint32_t picture_id_; +#if defined(OS_FUCHSIA) + float metrics_scale_x_; + float metrics_scale_y_; +#endif SkISize scale_key_; }; diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index b9d6801cc82ee..83883c508b4df 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -4,6 +4,7 @@ #include "flutter/flow/scene_update_context.h" +#include "flutter/common/threads.h" #include "flutter/flow/export_node.h" #include "flutter/flow/layers/layer.h" #include "flutter/flow/matrix_decomposition.h" @@ -18,7 +19,9 @@ SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session, } SceneUpdateContext::~SceneUpdateContext() { - // Release Mozart session resources for all ExportNodes. + ASSERT_IS_GPU_THREAD; + + // Release Scenic session resources for all ExportNodes. for (auto export_node : export_nodes_) { export_node->Dispose(false); } @@ -27,16 +30,21 @@ SceneUpdateContext::~SceneUpdateContext() { void SceneUpdateContext::AddChildScene(ExportNode* export_node, SkPoint offset, bool hit_testable) { + ASSERT_IS_GPU_THREAD; FXL_DCHECK(top_entity_); export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable); } void SceneUpdateContext::AddExportNode(ExportNode* export_node) { + ASSERT_IS_GPU_THREAD; + export_nodes_.insert(export_node); // Might already have been added. } void SceneUpdateContext::RemoveExportNode(ExportNode* export_node) { + ASSERT_IS_GPU_THREAD; + export_nodes_.erase(export_node); } @@ -187,9 +195,12 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { for (auto& task : paint_tasks_) { FXL_DCHECK(task.surface); SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas(); - Layer::PaintContext context = {*canvas, frame.context().frame_time(), + Layer::PaintContext context = {*canvas, + frame.context().frame_time(), frame.context().engine_time(), - frame.context().texture_registry(), false}; + frame.context().memory_usage(), + frame.context().texture_registry(), + false}; canvas->restoreToCount(1); canvas->save(); canvas->clear(task.background_color); diff --git a/flow/skia_gpu_object.cc b/flow/skia_gpu_object.cc deleted file mode 100644 index ce2312f921580..0000000000000 --- a/flow/skia_gpu_object.cc +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017 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/skia_gpu_object.h" - -#include "flutter/fml/message_loop.h" - -namespace flow { - -SkiaUnrefQueue::SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay) - : task_runner_(std::move(task_runner)), - drain_delay_(delay), - drain_pending_(false) {} - -SkiaUnrefQueue::~SkiaUnrefQueue() { - Drain(); -} - -void SkiaUnrefQueue::Unref(SkRefCnt* object) { - std::lock_guard lock(mutex_); - objects_.push_back(object); - if (!drain_pending_) { - drain_pending_ = true; - task_runner_->PostDelayedTask( - [strong = fxl::Ref(this)]() { strong->Drain(); }, drain_delay_); - } -} - -void SkiaUnrefQueue::Drain() { - std::deque skia_objects; - { - std::lock_guard lock(mutex_); - objects_.swap(skia_objects); - drain_pending_ = false; - } - - for (SkRefCnt* skia_object : skia_objects) { - skia_object->unref(); - } -} - -} // namespace flow diff --git a/flow/skia_gpu_object.h b/flow/skia_gpu_object.h deleted file mode 100644 index 4711f80c6f4fd..0000000000000 --- a/flow/skia_gpu_object.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2017 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_FLOW_SKIA_GPU_OBJECT_H_ -#define FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ - -#include -#include - -#include "flutter/fml/memory/weak_ptr.h" -#include "flutter/fml/task_runner.h" -#include "lib/fxl/memory/ref_ptr.h" -#include "third_party/skia/include/core/SkRefCnt.h" - -namespace flow { - -// A queue that holds Skia objects that must be destructed on the the given task -// runner. -class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { - public: - void Unref(SkRefCnt* object); - - // Usually, the drain is called automatically. However, during IO manager - // shutdown (when the platform side reference to the OpenGL context is about - // to go away), we may need to pre-emptively drain the unref queue. It is the - // responsibility of the caller to ensure that no further unrefs are queued - // after this call. - void Drain(); - - private: - const fxl::RefPtr task_runner_; - const fxl::TimeDelta drain_delay_; - std::mutex mutex_; - std::deque objects_; - bool drain_pending_; - - SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay); - - ~SkiaUnrefQueue(); - - FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); - FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); -}; - -/// An object whose deallocation needs to be performed on an specific unref -/// queue. The template argument U need to have a call operator that returns -/// that unref queue. -template -class SkiaGPUObject { - public: - using SkiaObjectType = T; - - SkiaGPUObject() = default; - - SkiaGPUObject(sk_sp object, fxl::RefPtr queue) - : object_(std::move(object)), queue_(std::move(queue)) { - FXL_DCHECK(queue_ && object_); - } - - SkiaGPUObject(SkiaGPUObject&&) = default; - - ~SkiaGPUObject() { reset(); } - - SkiaGPUObject& operator=(SkiaGPUObject&&) = default; - - sk_sp get() const { return object_; } - - void reset() { - if (object_) { - queue_->Unref(object_.release()); - } - queue_ = nullptr; - FXL_DCHECK(object_ == nullptr); - } - - private: - sk_sp object_; - fxl::RefPtr queue_; - - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); -}; - -} // namespace flow - -#endif // FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ diff --git a/flow/texture.cc b/flow/texture.cc index d5cc3ae228aa7..33a48af989477 100644 --- a/flow/texture.cc +++ b/flow/texture.cc @@ -11,32 +11,36 @@ TextureRegistry::TextureRegistry() = default; TextureRegistry::~TextureRegistry() = default; void TextureRegistry::RegisterTexture(std::shared_ptr texture) { + ASSERT_IS_GPU_THREAD mapping_[texture->Id()] = texture; } void TextureRegistry::UnregisterTexture(int64_t id) { + ASSERT_IS_GPU_THREAD mapping_.erase(id); } void TextureRegistry::OnGrContextCreated() { + ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextCreated(); } } void TextureRegistry::OnGrContextDestroyed() { + ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextDestroyed(); } } std::shared_ptr TextureRegistry::GetTexture(int64_t id) { + ASSERT_IS_GPU_THREAD auto it = mapping_.find(id); return it != mapping_.end() ? it->second : nullptr; } Texture::Texture(int64_t id) : id_(id) {} - Texture::~Texture() = default; } // namespace flow diff --git a/flow/texture.h b/flow/texture.h index f5e4430834084..a602a6b45b5b4 100644 --- a/flow/texture.h +++ b/flow/texture.h @@ -6,7 +6,7 @@ #define FLUTTER_FLOW_TEXTURE_H_ #include - +#include "flutter/common/threads.h" #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -29,9 +29,6 @@ class Texture { // Called from GPU thread. virtual void OnGrContextDestroyed() = 0; - // Called on GPU thread. - virtual void MarkNewFrameAvailable() = 0; - int64_t Id() { return id_; } private: diff --git a/fml/BUILD.gn b/fml/BUILD.gn index ffbf949cc0957..6dabcb446c912 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -4,12 +4,9 @@ source_set("fml") { sources = [ - "file.h", "icu_util.cc", "icu_util.h", - "mapping.cc", "mapping.h", - "memory/thread_checker.h", "memory/weak_ptr.h", "memory/weak_ptr_internal.cc", "memory/weak_ptr_internal.h", @@ -17,9 +14,8 @@ source_set("fml") { "message_loop.h", "message_loop_impl.cc", "message_loop_impl.h", - "native_library.h", - "paths.cc", "paths.h", + "task_observer.h", "task_runner.cc", "task_runner.h", "thread.cc", @@ -27,9 +23,6 @@ source_set("fml") { "thread_local.h", "trace_event.cc", "trace_event.h", - "unique_fd.cc", - "unique_fd.h", - "unique_object.h", ] deps = [ @@ -102,25 +95,16 @@ source_set("fml") { ] } - if (is_fuchsia) { - sources += [ "platform/fuchsia/paths_fuchsia.cc" ] - } - if (is_win) { sources += [ - "platform/win/file_win.cc", "platform/win/mapping_win.cc", "platform/win/message_loop_win.cc", "platform/win/message_loop_win.h", - "platform/win/native_library_win.cc", "platform/win/paths_win.cc", - "platform/win/wstring_conversion.h", ] } else { sources += [ - "platform/posix/file_posix.cc", "platform/posix/mapping_posix.cc", - "platform/posix/native_library_posix.cc", ] } } diff --git a/fml/file.h b/fml/file.h deleted file mode 100644 index 2327b2eef831e..0000000000000 --- a/fml/file.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2018 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_FILE_H_ -#define FLUTTER_FML_FILE_H_ - -#include "flutter/fml/unique_fd.h" -#include "lib/fxl/macros.h" - -namespace fml { - -enum class OpenPermission { - kRead = 1, - kWrite = 1 << 1, - kReadWrite = kRead | kWrite, - kExecute, -}; - -fml::UniqueFD OpenFile(const char* path, - OpenPermission permission, - bool is_directory = false); - -fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, - const char* path, - OpenPermission permission, - bool is_directory = false); - -fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor); - -bool IsDirectory(const fml::UniqueFD& directory); - -} // namespace fml - -#endif // FLUTTER_FML_FILE_H_ diff --git a/fml/icu_util.cc b/fml/icu_util.cc index 0c0acd06dbbdf..093dc3d02b1bc 100644 --- a/fml/icu_util.cc +++ b/fml/icu_util.cc @@ -22,6 +22,8 @@ static constexpr char kPathSeparator = '\\'; static constexpr char kPathSeparator = '/'; #endif +static constexpr char kIcuDataFileName[] = "icudtl.dat"; + class ICUContext { public: ICUContext(const std::string& icu_data_path) : valid_(false) { @@ -32,15 +34,15 @@ class ICUContext { bool SetupMapping(const std::string& icu_data_path) { // Check if the explicit path specified exists. - auto path_mapping = std::make_unique(icu_data_path, false); - if (path_mapping->GetSize() != 0) { - mapping_ = std::move(path_mapping); + auto overriden_path_mapping = std::make_unique(icu_data_path); + if (overriden_path_mapping->GetSize() != 0) { + mapping_ = std::move(overriden_path_mapping); return true; } // Check to see if the mapping is in the resources bundle. if (PlatformHasResourcesBundle()) { - auto resource = GetResourceMapping(icu_data_path); + auto resource = GetResourceMapping(kIcuDataFileName); if (resource != nullptr && resource->GetSize() != 0) { mapping_ = std::move(resource); return true; @@ -55,8 +57,10 @@ class ICUContext { return false; } + // FIXME(chinmaygarde): There is no Path::Join in FXL. So a non-portable + // version is used here. Patch FXL and update. auto file = std::make_unique( - directory.second + kPathSeparator + icu_data_path, false); + directory.second + kPathSeparator + kIcuDataFileName); if (file->GetSize() != 0) { mapping_ = std::move(file); return true; @@ -92,8 +96,7 @@ class ICUContext { void InitializeICUOnce(const std::string& icu_data_path) { static ICUContext* context = new ICUContext(icu_data_path); - FXL_CHECK(context->IsValid()) - << "Must be able to initialize the ICU context. Tried: " << icu_data_path; + FXL_CHECK(context->IsValid()) << "Must be able to initialize the ICU context"; } std::once_flag g_icu_init_flag; diff --git a/fml/macros.h b/fml/macros.h deleted file mode 100644 index ba46b9dda4b4d..0000000000000 --- a/fml/macros.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 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_MACROS_H_ -#define FLUTTER_FML_MACROS_H_ - -#include "lib/fxl/macros.h" - -#ifndef FML_USED_ON_EMBEDDER - -#define FML_EMBEDDER_ONLY [[deprecated]] - -#else // FML_USED_ON_EMBEDDER - -#define FML_EMBEDDER_ONLY - -#endif // FML_USED_ON_EMBEDDER - -#endif // FLUTTER_FML_MACROS_H_ diff --git a/fml/mapping.cc b/fml/mapping.cc deleted file mode 100644 index 97d7905015f61..0000000000000 --- a/fml/mapping.cc +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2018 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/mapping.h" - -namespace fml { - -DataMapping::DataMapping(std::vector data) : data_(std::move(data)) {} - -DataMapping::~DataMapping() = default; - -size_t DataMapping::GetSize() const { - return data_.size(); -} - -const uint8_t* DataMapping::GetMapping() const { - return data_.data(); -} -} // namespace fml diff --git a/fml/mapping.h b/fml/mapping.h index 00e9685dd6b0c..8963b22a9c1f6 100644 --- a/fml/mapping.h +++ b/fml/mapping.h @@ -7,10 +7,14 @@ #include #include -#include -#include "flutter/fml//unique_fd.h" #include "lib/fxl/build_config.h" + +#if OS_WIN +#include +#endif + +#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { @@ -35,9 +39,12 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name); class FileMapping : public Mapping { public: - FileMapping(const std::string& path, bool executable = false); + FileMapping(const std::string& path); - FileMapping(const fml::UniqueFD& fd, bool executable = false); +// fxl::UniqueFD isn't supported for Windows handles. +#if !OS_WIN + FileMapping(const fxl::UniqueFD& fd); +#endif ~FileMapping() override; @@ -46,32 +53,16 @@ class FileMapping : public Mapping { const uint8_t* GetMapping() const override; private: - size_t size_ = 0; - uint8_t* mapping_ = nullptr; + size_t size_; + uint8_t* mapping_; #if OS_WIN - fml::UniqueFD mapping_handle_; + HANDLE mapping_handle_; #endif FXL_DISALLOW_COPY_AND_ASSIGN(FileMapping); }; -class DataMapping : public Mapping { - public: - DataMapping(std::vector data); - - ~DataMapping() override; - - size_t GetSize() const override; - - const uint8_t* GetMapping() const override; - - private: - std::vector data_; - - FXL_DISALLOW_COPY_AND_ASSIGN(DataMapping); -}; - } // namespace fml #endif // FLUTTER_FML_MAPPING_H_ diff --git a/fml/memory/thread_checker.h b/fml/memory/thread_checker.h deleted file mode 100644 index f22e9d1cfaf06..0000000000000 --- a/fml/memory/thread_checker.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2016 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// A class for checking that the current thread is/isn't the same as an initial -// thread. - -#ifndef FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ -#define FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ - -#include "lib/fxl/build_config.h" - -#if defined(OS_WIN) -#include -#else -#include -#endif - -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" - -namespace fml { - -// A simple class that records the identity of the thread that it was created -// on, and at later points can tell if the current thread is the same as its -// creation thread. This class is thread-safe. -// -// Note: Unlike Chromium's |base::ThreadChecker|, this is *not* Debug-only (so -// #ifdef it out if you want something Debug-only). (Rationale: Having a -// |CalledOnValidThread()| that lies in Release builds seems bad. Moreover, -// there's a small space cost to having even an empty class. ) -class ThreadChecker final { - public: -#if defined(OS_WIN) - ThreadChecker() : self_(GetCurrentThreadId()) {} - ~ThreadChecker() {} - - bool IsCreationThreadCurrent() const { return GetCurrentThreadId() == self_; } - - private: - DWORD self_; - -#else - ThreadChecker() : self_(pthread_self()) {} - ~ThreadChecker() {} - - // Returns true if the current thread is the thread this object was created - // on and false otherwise. - bool IsCreationThreadCurrent() const { - return !!pthread_equal(pthread_self(), self_); - } - - private: - pthread_t self_; -#endif -}; - -#ifndef NDEBUG -#define FML_DECLARE_THREAD_CHECKER(c) fml::ThreadChecker c -#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) \ - FXL_DCHECK((c).IsCreationThreadCurrent()) -#else -#define FML_DECLARE_THREAD_CHECKER(c) -#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) ((void)0) -#endif - -} // namespace fml - -#endif // FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ diff --git a/fml/memory/weak_ptr.h b/fml/memory/weak_ptr.h index 2b369952d7306..5b85c531966b2 100644 --- a/fml/memory/weak_ptr.h +++ b/fml/memory/weak_ptr.h @@ -10,17 +10,12 @@ #include -#include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr_internal.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_counted.h" namespace fml { -struct DebugThreadChecker { - FML_DECLARE_THREAD_CHECKER(checker); -}; - // Forward declaration, so |WeakPtr| can friend it. template class WeakPtrFactory; @@ -46,17 +41,13 @@ class WeakPtr { WeakPtr(const WeakPtr& r) = default; template - WeakPtr(const WeakPtr& r) - : ptr_(static_cast(r.ptr_)), flag_(r.flag_), checker_(r.checker_) {} + WeakPtr(const WeakPtr& r) : ptr_(r.ptr_), flag_(r.flag_) {} // Move constructor. WeakPtr(WeakPtr&& r) = default; template - WeakPtr(WeakPtr&& r) - : ptr_(static_cast(r.ptr_)), - flag_(std::move(r.flag_)), - checker_(r.checker_) {} + WeakPtr(WeakPtr&& r) : ptr_(r.ptr_), flag_(std::move(r.flag_)) {} ~WeakPtr() = default; @@ -74,24 +65,16 @@ class WeakPtr { // The following methods should only be called on the same thread as the // "originating" |WeakPtrFactory|. - explicit operator bool() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - return flag_ && flag_->is_valid(); - } + explicit operator bool() const { return flag_ && flag_->is_valid(); } - T* get() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - return *this ? ptr_ : nullptr; - } + T* get() const { return *this ? ptr_ : nullptr; } T& operator*() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return *get(); } T* operator->() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return get(); } @@ -102,14 +85,11 @@ class WeakPtr { friend class WeakPtrFactory; - explicit WeakPtr(T* ptr, - fxl::RefPtr&& flag, - DebugThreadChecker checker) - : ptr_(ptr), flag_(std::move(flag)), checker_(checker) {} + explicit WeakPtr(T* ptr, fxl::RefPtr&& flag) + : ptr_(ptr), flag_(std::move(flag)) {} T* ptr_; fxl::RefPtr flag_; - DebugThreadChecker checker_; // Copy/move construction/assignment supported. }; @@ -160,22 +140,19 @@ template class WeakPtrFactory { public: explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { FXL_DCHECK(ptr_); } - ~WeakPtrFactory() { InvalidateWeakPtrs(); } // Gets a new weak pointer, which will be valid until either // |InvalidateWeakPtrs()| is called or this object is destroyed. WeakPtr GetWeakPtr() { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) flag_ = fxl::MakeRefCounted(); - return WeakPtr(ptr_, flag_.Clone(), checker_); + return WeakPtr(ptr_, flag_.Clone()); } // Call this method to invalidate all existing weak pointers. (Note that // additional weak pointers can be produced even after this is called.) void InvalidateWeakPtrs() { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) return; flag_->Invalidate(); @@ -185,17 +162,13 @@ class WeakPtrFactory { // Call this method to determine if any weak pointers exist. (Note that a // "false" result is definitive, but a "true" result may not be if weak // pointers are held/reset/destroyed/reassigned on other threads.) - bool HasWeakPtrs() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - return flag_ && !flag_->HasOneRef(); - } + bool HasWeakPtrs() const { return flag_ && !flag_->HasOneRef(); } private: // Note: See weak_ptr_internal.h for an explanation of why we store the // pointer here, instead of in the "flag". T* const ptr_; fxl::RefPtr flag_; - DebugThreadChecker checker_; FXL_DISALLOW_COPY_AND_ASSIGN(WeakPtrFactory); }; diff --git a/fml/message_loop.cc b/fml/message_loop.cc index 44a0e307c1dd1..4765cfa76558f 100644 --- a/fml/message_loop.cc +++ b/fml/message_loop.cc @@ -55,7 +55,7 @@ void MessageLoop::Terminate() { loop_->DoTerminate(); } -fxl::RefPtr MessageLoop::GetTaskRunner() const { +fxl::RefPtr MessageLoop::GetTaskRunner() const { return task_runner_; } @@ -63,12 +63,12 @@ fxl::RefPtr MessageLoop::GetLoopImpl() const { return loop_; } -void MessageLoop::AddTaskObserver(intptr_t key, fxl::Closure callback) { - loop_->AddTaskObserver(key, callback); +void MessageLoop::AddTaskObserver(TaskObserver* observer) { + loop_->AddTaskObserver(observer); } -void MessageLoop::RemoveTaskObserver(intptr_t key) { - loop_->RemoveTaskObserver(key); +void MessageLoop::RemoveTaskObserver(TaskObserver* observer) { + loop_->RemoveTaskObserver(observer); } void MessageLoop::RunExpiredTasksNow() { diff --git a/fml/message_loop.h b/fml/message_loop.h index 3bfb1c40c6df7..87773619ccc51 100644 --- a/fml/message_loop.h +++ b/fml/message_loop.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_MESSAGE_LOOP_H_ #define FLUTTER_FML_MESSAGE_LOOP_H_ -#include "flutter/fml/macros.h" +#include "flutter/fml/task_observer.h" #include "lib/fxl/macros.h" #include "lib/fxl/tasks/task_runner.h" @@ -16,7 +16,6 @@ class MessageLoopImpl; class MessageLoop { public: - FML_EMBEDDER_ONLY static MessageLoop& GetCurrent(); bool IsValid() const; @@ -25,11 +24,11 @@ class MessageLoop { void Terminate(); - void AddTaskObserver(intptr_t key, fxl::Closure callback); + void AddTaskObserver(TaskObserver* observer); - void RemoveTaskObserver(intptr_t key); + void RemoveTaskObserver(TaskObserver* observer); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; // Exposed for the embedder shell which allows clients to poll for events // instead of dedicating a thread to the message loop. diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index df885f3792d5f..cec9b7e448f1a 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -2,8 +2,6 @@ // 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 @@ -13,29 +11,35 @@ #include "lib/fxl/build_config.h" #if OS_MACOSX + #include "flutter/fml/platform/darwin/message_loop_darwin.h" +using PlatformMessageLoopImpl = fml::MessageLoopDarwin; + #elif OS_ANDROID + #include "flutter/fml/platform/android/message_loop_android.h" +using PlatformMessageLoopImpl = fml::MessageLoopAndroid; + #elif OS_LINUX + #include "flutter/fml/platform/linux/message_loop_linux.h" +using PlatformMessageLoopImpl = fml::MessageLoopLinux; + #elif OS_WIN + #include "flutter/fml/platform/win/message_loop_win.h" +using PlatformMessageLoopImpl = fml::MessageLoopWin; + +#else + +#error This platform does not have a message loop implementation. + #endif namespace fml { fxl::RefPtr MessageLoopImpl::Create() { -#if OS_MACOSX - return fxl::MakeRefCounted(); -#elif OS_ANDROID - return fxl::MakeRefCounted(); -#elif OS_LINUX - return fxl::MakeRefCounted(); -#elif OS_WIN - return fxl::MakeRefCounted(); -#else - return nullptr; -#endif + return fxl::MakeRefCounted<::PlatformMessageLoopImpl>(); } MessageLoopImpl::MessageLoopImpl() : order_(0), terminated_(false) {} @@ -51,19 +55,20 @@ void MessageLoopImpl::RunExpiredTasksNow() { RunExpiredTasks(); } -void MessageLoopImpl::AddTaskObserver(intptr_t key, fxl::Closure callback) { - FXL_DCHECK(callback != nullptr); +void MessageLoopImpl::AddTaskObserver(TaskObserver* observer) { + FXL_DCHECK(observer != nullptr); FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be added on the same thread as the " "loop."; - task_observers_[key] = std::move(callback); + task_observers_.insert(observer); } -void MessageLoopImpl::RemoveTaskObserver(intptr_t key) { +void MessageLoopImpl::RemoveTaskObserver(TaskObserver* observer) { + FXL_DCHECK(observer != nullptr); FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be removed from the same thread as " "the loop."; - task_observers_.erase(key); + task_observers_.erase(observer); } void MessageLoopImpl::DoRun() { @@ -139,7 +144,7 @@ void MessageLoopImpl::RunExpiredTasks() { for (const auto& invocation : invocations) { invocation(); for (const auto& observer : task_observers_) { - observer.second(); + observer->DidProcessTask(); } } } diff --git a/fml/message_loop_impl.h b/fml/message_loop_impl.h index 478cbd1f1a0be..bfdb2064cb264 100644 --- a/fml/message_loop_impl.h +++ b/fml/message_loop_impl.h @@ -7,9 +7,9 @@ #include #include -#include #include #include +#include #include #include "flutter/fml/message_loop.h" @@ -34,9 +34,9 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { void PostTask(fxl::Closure task, fxl::TimePoint target_time); - void AddTaskObserver(intptr_t key, fxl::Closure callback); + void AddTaskObserver(TaskObserver* observer); - void RemoveTaskObserver(intptr_t key); + void RemoveTaskObserver(TaskObserver* observer); void DoRun(); @@ -71,7 +71,7 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { using DelayedTaskQueue = std:: priority_queue, DelayedTaskCompare>; - std::map task_observers_; + std::set task_observers_; std::mutex delayed_tasks_mutex_; DelayedTaskQueue delayed_tasks_; size_t order_; diff --git a/fml/message_loop_unittests.cc b/fml/message_loop_unittests.cc index cd2acd308b46a..11ea72c3900eb 100644 --- a/fml/message_loop_unittests.cc +++ b/fml/message_loop_unittests.cc @@ -2,12 +2,9 @@ // 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 #include "flutter/fml/message_loop.h" -#include "flutter/fml/task_runner.h" #include "gtest/gtest.h" #include "lib/fxl/synchronization/waitable_event.h" @@ -247,6 +244,22 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) { ASSERT_EQ(checked, count); } +class CustomTaskObserver : public fml::TaskObserver { + public: + CustomTaskObserver(std::function lambda) : lambda_(lambda){}; + + ~CustomTaskObserver() override = default; + + void DidProcessTask() override { + if (lambda_) { + lambda_(); + } + }; + + private: + std::function lambda_; +}; + TEST(MessageLoop, TaskObserverFire) { bool started = false; bool terminated = false; @@ -256,7 +269,8 @@ TEST(MessageLoop, TaskObserverFire) { auto& loop = fml::MessageLoop::GetCurrent(); size_t task_count = 0; size_t obs_count = 0; - auto obs = PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }; + CustomTaskObserver obs( + PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }); for (size_t i = 0; i < count; i++) { loop.GetTaskRunner()->PostTask( PLATFORM_SPECIFIC_CAPTURE(&terminated, i, &task_count)() { @@ -268,7 +282,7 @@ TEST(MessageLoop, TaskObserverFire) { } }); } - loop.AddTaskObserver(0, obs); + loop.AddTaskObserver(&obs); loop.Run(); ASSERT_EQ(task_count, count); ASSERT_EQ(obs_count, count); diff --git a/fml/native_library.h b/fml/native_library.h deleted file mode 100644 index 7e48ed6d3a3ff..0000000000000 --- a/fml/native_library.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2018 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_NATIVE_LIBRARY_H_ -#define FLUTTER_FML_NATIVE_LIBRARY_H_ - -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" -#include "lib/fxl/memory/ref_ptr.h" - -#if OS_WIN - -#include - -#endif // OS_WIN - -namespace fml { -class NativeLibrary : public fxl::RefCountedThreadSafe { - public: -#if OS_WIN - using Handle = HMODULE; -#else // OS_WIN - using Handle = void*; -#endif // OS_WIN - - static fxl::RefPtr Create(const char* path); - - static fxl::RefPtr CreateForCurrentProcess(); - - const uint8_t* ResolveSymbol(const char* symbol); - - private: - Handle handle_ = nullptr; - bool close_handle_ = true; - - NativeLibrary(const char* path); - - NativeLibrary(Handle handle, bool close_handle); - - ~NativeLibrary(); - - Handle GetHandle() const; - - FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrary); - FRIEND_REF_COUNTED_THREAD_SAFE(NativeLibrary); - FRIEND_MAKE_REF_COUNTED(NativeLibrary); -}; - -} // namespace fml - -#endif // FLUTTER_FML_NATIVE_LIBRARY_H_ diff --git a/fml/paths.cc b/fml/paths.cc deleted file mode 100644 index 9b06b6847f415..0000000000000 --- a/fml/paths.cc +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 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/paths.h" - -#include "lib/fxl/build_config.h" - -namespace fml { -namespace paths { - -std::string JoinPaths(std::initializer_list components) { - std::stringstream stream; - size_t i = 0; - const size_t size = components.size(); - for (const auto& component : components) { - i++; - stream << component; - if (i != size) { -#if OS_WIN - stream << "\\"; -#else // OS_WIN - stream << "/"; -#endif // OS_WIN - } - } - return stream.str(); -} - -} // namespace paths -} // namespace fml diff --git a/fml/paths.h b/fml/paths.h index 0d4367654de4a..8ec3b4b580476 100644 --- a/fml/paths.h +++ b/fml/paths.h @@ -8,15 +8,11 @@ #include #include -#include "lib/fxl/strings/string_view.h" - namespace fml { namespace paths { std::pair GetExecutableDirectoryPath(); -std::string JoinPaths(std::initializer_list components); - } // namespace paths } // namespace fml diff --git a/fml/platform/android/message_loop_android.h b/fml/platform/android/message_loop_android.h index 19c1eafe79845..e6d04e8253401 100644 --- a/fml/platform/android/message_loop_android.h +++ b/fml/platform/android/message_loop_android.h @@ -10,7 +10,7 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "flutter/fml/unique_fd.h" +#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/unique_object.h" @@ -24,8 +24,8 @@ struct UniqueLooperTraits { class MessageLoopAndroid : public MessageLoopImpl { private: - fml::UniqueObject looper_; - fml::UniqueFD timer_fd_; + fxl::UniqueObject looper_; + fxl::UniqueFD timer_fd_; bool running_; MessageLoopAndroid(); diff --git a/fml/platform/darwin/resource_mapping_darwin.mm b/fml/platform/darwin/resource_mapping_darwin.mm index 3ee100121ad0f..5d1b9664e20bc 100644 --- a/fml/platform/darwin/resource_mapping_darwin.mm +++ b/fml/platform/darwin/resource_mapping_darwin.mm @@ -9,8 +9,8 @@ namespace fml { ResourceMappingDarwin::ResourceMappingDarwin(const std::string& resource) - : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String], - false) {} + : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String]) { +} ResourceMappingDarwin::~ResourceMappingDarwin() = default; diff --git a/fml/platform/fuchsia/paths_fuchsia.cc b/fml/platform/fuchsia/paths_fuchsia.cc deleted file mode 100644 index 20def9f34fae9..0000000000000 --- a/fml/platform/fuchsia/paths_fuchsia.cc +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018 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/paths.h" - -namespace fml { -namespace paths { - -std::pair GetExecutableDirectoryPath() { - return {false, ""}; -} - -} // namespace paths -} // namespace fml diff --git a/fml/platform/linux/message_loop_linux.h b/fml/platform/linux/message_loop_linux.h index ba5e902d4ac89..51dc690ce887b 100644 --- a/fml/platform/linux/message_loop_linux.h +++ b/fml/platform/linux/message_loop_linux.h @@ -8,15 +8,15 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "flutter/fml/unique_fd.h" +#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { class MessageLoopLinux : public MessageLoopImpl { private: - fml::UniqueFD epoll_fd_; - fml::UniqueFD timer_fd_; + fxl::UniqueFD epoll_fd_; + fxl::UniqueFD timer_fd_; bool running_; MessageLoopLinux(); diff --git a/fml/platform/posix/file_posix.cc b/fml/platform/posix/file_posix.cc deleted file mode 100644 index 028f49f4d183d..0000000000000 --- a/fml/platform/posix/file_posix.cc +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2018 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/file.h" - -#include -#include -#include - -#include "lib/fxl/files/eintr_wrapper.h" - -namespace fml { - -fml::UniqueFD OpenFile(const char* path, - OpenPermission permission, - bool is_directory) { - return OpenFile(fml::UniqueFD{AT_FDCWD}, path, permission, is_directory); -} - -fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, - const char* path, - OpenPermission permission, - bool is_directory) { - if (path == nullptr) { - return fml::UniqueFD{}; - } - - int flags = 0; - switch (permission) { - case OpenPermission::kRead: - flags = O_RDONLY; - break; - case OpenPermission::kWrite: - flags = O_WRONLY; - break; - case OpenPermission::kReadWrite: - flags = O_RDWR; - break; - case OpenPermission::kExecute: - flags = O_RDONLY; - break; - } - - if (is_directory) { - flags |= O_DIRECTORY; - } - - return fml::UniqueFD{ - HANDLE_EINTR(::openat(base_directory.get(), path, flags))}; -} - -fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { - return fml::UniqueFD{HANDLE_EINTR(::dup(descriptor))}; -} - -bool IsDirectory(const fml::UniqueFD& directory) { - if (!directory.is_valid()) { - return false; - } - - struct stat stat_result = {}; - - if (::fstat(directory.get(), &stat_result) != 0) { - return false; - } - - return S_ISDIR(stat_result.st_mode); -} - -} // namespace fml diff --git a/fml/platform/posix/mapping_posix.cc b/fml/platform/posix/mapping_posix.cc index fc53d6a4f7fc9..07f7edb074ab9 100644 --- a/fml/platform/posix/mapping_posix.cc +++ b/fml/platform/posix/mapping_posix.cc @@ -11,7 +11,6 @@ #include -#include "flutter/fml/unique_fd.h" #include "lib/fxl/build_config.h" #include "lib/fxl/files/eintr_wrapper.h" @@ -40,11 +39,11 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path, bool executable) - : FileMapping(fml::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}, - executable) {} +FileMapping::FileMapping(const std::string& path) + : FileMapping(fxl::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}) { +} -FileMapping::FileMapping(const fml::UniqueFD& handle, bool executable) +FileMapping::FileMapping(const fxl::UniqueFD& handle) : size_(0), mapping_(nullptr) { if (!handle.is_valid()) { return; @@ -60,13 +59,8 @@ FileMapping::FileMapping(const fml::UniqueFD& handle, bool executable) return; } - int flags = PROT_READ; - if (executable) { - flags |= PROT_EXEC; - } - - auto mapping = - ::mmap(nullptr, stat_buffer.st_size, flags, MAP_PRIVATE, handle.get(), 0); + auto mapping = ::mmap(nullptr, stat_buffer.st_size, PROT_READ, MAP_PRIVATE, + handle.get(), 0); if (mapping == MAP_FAILED) { return; diff --git a/fml/platform/posix/native_library_posix.cc b/fml/platform/posix/native_library_posix.cc deleted file mode 100644 index 1255c38fc0821..0000000000000 --- a/fml/platform/posix/native_library_posix.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2018 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/native_library.h" - -#include -#include - -namespace fml { - -NativeLibrary::NativeLibrary(const char* path) { - ::dlerror(); - handle_ = ::dlopen(path, RTLD_NOW); - if (handle_ == nullptr) { - FXL_LOG(ERROR) << "Could not open library '" << path << "' due to error '" - << ::dlerror() << "'."; - } -} - -NativeLibrary::NativeLibrary(Handle handle, bool close_handle) - : handle_(handle), close_handle_(close_handle) {} - -NativeLibrary::~NativeLibrary() { - if (handle_ == nullptr) { - return; - } - - if (close_handle_) { - ::dlerror(); - if (::dlclose(handle_) != 0) { - handle_ = nullptr; - FXL_LOG(ERROR) << "Could not close library due to error '" << ::dlerror() - << "'."; - } - } -} - -NativeLibrary::Handle NativeLibrary::GetHandle() const { - return handle_; -} - -fxl::RefPtr NativeLibrary::Create(const char* path) { - auto library = fxl::AdoptRef(new NativeLibrary(path)); - return library->GetHandle() != nullptr ? library : nullptr; -} - -fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { - return fxl::AdoptRef(new NativeLibrary(RTLD_DEFAULT, false)); -} - -const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { - auto resolved_symbol = static_cast(::dlsym(handle_, symbol)); - if (resolved_symbol == nullptr) { - FXL_DLOG(ERROR) << "Could not resolve symbol in library: " << symbol; - } - return resolved_symbol; -} - -} // namespace fml diff --git a/fml/platform/win/file_win.cc b/fml/platform/win/file_win.cc deleted file mode 100644 index 3f5e90494b013..0000000000000 --- a/fml/platform/win/file_win.cc +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2018 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/file.h" - -#include - -#include - -#include "flutter/fml/platform/win/wstring_conversion.h" - -namespace fml { - -fml::UniqueFD OpenFile(const std::wstring& path, - OpenPermission permission, - bool is_directory) { - if (path.size() == 0) { - return fml::UniqueFD{}; - } - - DWORD desired_access = 0; - - switch (permission) { - case OpenPermission::kRead: - desired_access = GENERIC_READ; - break; - case OpenPermission::kWrite: - desired_access = GENERIC_WRITE; - break; - case OpenPermission::kReadWrite: - desired_access = GENERIC_WRITE | GENERIC_READ; - break; - case OpenPermission::kExecute: - desired_access = GENERIC_READ | GENERIC_EXECUTE; - break; - } - - return fml::UniqueFD{::CreateFile( - path.c_str(), // lpFileName - desired_access, // dwDesiredAccess - FILE_SHARE_READ, // dwShareMode - 0, // lpSecurityAttributes - OPEN_EXISTING, // dwCreationDisposition - FILE_ATTRIBUTE_NORMAL, // dwFlagsAndAttributes - 0 // hTemplateFile - )}; -} - -fml::UniqueFD OpenFile(const char* path, - OpenPermission permission, - bool is_directory) { - return OpenFile(ConvertToWString(path), permission, is_directory); -} - -static std::wstring GetFullHandlePath(const fml::UniqueFD& handle) { - wchar_t buffer[MAX_PATH]; - - DWORD returned = ::GetFinalPathNameByHandle(handle.get(), buffer, MAX_PATH, - FILE_NAME_NORMALIZED); - if (returned == 0 || returned > MAX_PATH) { - return {}; - } - - return {buffer}; -} - -fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, - const char* path, - OpenPermission permission, - bool is_directory) { - // If the base directory is invalid or the path is absolute, use the generic - // open file variant. - if (!base_directory.is_valid()) { - return OpenFile(path, permission, is_directory); - } - - const auto wpath = ConvertToWString(path); - - if (!::PathIsRelative(wpath.c_str())) { - return OpenFile(path, permission, is_directory); - } - - std::wstringstream stream; - stream << GetFullHandlePath(base_directory) << "\\" << path; - return OpenFile(stream.str(), permission, is_directory); -} - -fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { - if (descriptor == INVALID_HANDLE_VALUE) { - return fml::UniqueFD{}; - } - - HANDLE duplicated = INVALID_HANDLE_VALUE; - - if (!::DuplicateHandle( - GetCurrentProcess(), // source process - descriptor, // source handle - GetCurrentProcess(), // target process - &duplicated, // target handle - 0, // desired access (ignored because DUPLICATE_SAME_ACCESS) - FALSE, // inheritable - DUPLICATE_SAME_ACCESS) // options - ) { - return fml::UniqueFD{}; - } - - return fml::UniqueFD{duplicated}; -} - -bool IsDirectory(const fml::UniqueFD& directory) { - BY_HANDLE_FILE_INFORMATION info; - if (!::GetFileInformationByHandle(directory.get(), &info)) { - return false; - } - return info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; -} - -} // namespace fml diff --git a/fml/platform/win/mapping_win.cc b/fml/platform/win/mapping_win.cc index 9dd5dcf6f2249..fd404a14f37dc 100644 --- a/fml/platform/win/mapping_win.cc +++ b/fml/platform/win/mapping_win.cc @@ -5,13 +5,13 @@ #include "flutter/fml/mapping.h" #include -#include -#include #include -#include "flutter/fml/file.h" -#include "flutter/fml/platform/win/wstring_conversion.h" +#include "lib/fxl/build_config.h" + +#include +#include using PlatformResourceMapping = fml::FileMapping; @@ -29,50 +29,47 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path, bool executable) - : FileMapping(OpenFile(path.c_str(), - executable ? OpenPermission::kExecute - : OpenPermission::kRead, - false), - executable) {} - -FileMapping::FileMapping(const fml::UniqueFD& fd, bool executable) +FileMapping::FileMapping(const std::string& path) : size_(0), mapping_(nullptr) { - if (!fd.is_valid()) { + HANDLE file_handle_ = + CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, + FILE_SHARE_READ, nullptr, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); + + if (file_handle_ == INVALID_HANDLE_VALUE) { return; } - if (auto size = ::GetFileSize(fd.get(), nullptr)) { - if (size > 0) { - size_ = size; - } else { - return; - } + size_ = GetFileSize(file_handle_, nullptr); + if (size_ == INVALID_FILE_SIZE) { + size_ = 0; + return; } - const DWORD protect = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; + mapping_handle_ = CreateFileMapping(file_handle_, nullptr, PAGE_READONLY, 0, + size_, nullptr); - mapping_handle_.reset(::CreateFileMapping(fd.get(), // hFile - nullptr, // lpAttributes - protect, // flProtect - 0, // dwMaximumSizeHigh - 0, // dwMaximumSizeLow - nullptr // lpName - )); + CloseHandle(file_handle_); - if (!mapping_handle_.is_valid()) { + if (mapping_handle_ == INVALID_HANDLE_VALUE) { return; } - const DWORD desired_access = executable ? FILE_MAP_ALL_ACCESS : FILE_MAP_READ; + auto mapping = MapViewOfFile(mapping_handle_, FILE_MAP_READ, 0, 0, size_); + + if (mapping == INVALID_HANDLE_VALUE) { + CloseHandle(mapping_handle_); + mapping_handle_ = INVALID_HANDLE_VALUE; + return; + } - mapping_ = reinterpret_cast( - MapViewOfFile(mapping_handle_.get(), desired_access, 0, 0, size_)); + mapping_ = static_cast(mapping); } FileMapping::~FileMapping() { if (mapping_ != nullptr) { UnmapViewOfFile(mapping_); + CloseHandle(mapping_handle_); } } diff --git a/fml/platform/win/native_library_win.cc b/fml/platform/win/native_library_win.cc deleted file mode 100644 index 6992f06f3e886..0000000000000 --- a/fml/platform/win/native_library_win.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018 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/native_library.h" - -#include - -#include "flutter/fml/platform/win/wstring_conversion.h" - -namespace fml { - -NativeLibrary::NativeLibrary(const char* path) - : handle_(nullptr), close_handle_(true) { - if (path == nullptr) { - return; - } - - handle_ = ::LoadLibrary(ConvertToWString(path).c_str()); -} - -NativeLibrary::NativeLibrary(Handle handle, bool close_handle) - : handle_(handle), close_handle_(close_handle) {} - -NativeLibrary::~NativeLibrary() { - if (handle_ != nullptr && close_handle_) { - ::FreeLibrary(handle_); - } -} - -NativeLibrary::Handle NativeLibrary::GetHandle() const { - return handle_; -} - -fxl::RefPtr NativeLibrary::Create(const char* path) { - auto library = fxl::AdoptRef(new NativeLibrary(path)); - return library->GetHandle() != nullptr ? library : nullptr; -} - -fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { - return fxl::AdoptRef(new NativeLibrary(::GetModuleHandle(nullptr), false)); -} - -const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { - if (symbol == nullptr || handle_ == nullptr) { - return nullptr; - } - return reinterpret_cast(::GetProcAddress(handle_, symbol)); -} - -} // namespace fml diff --git a/fml/platform/win/wstring_conversion.h b/fml/platform/win/wstring_conversion.h deleted file mode 100644 index 0682dd84067bf..0000000000000 --- a/fml/platform/win/wstring_conversion.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2018 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_WIN_WSTRING_CONVERSION_H_ -#define FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ - -#include -#include -#include - -namespace fml { - -inline std::wstring ConvertToWString(const char* path) { - if (path == nullptr) { - return {}; - } - std::string path8(path); - std::wstring_convert, wchar_t> wchar_conv; - return wchar_conv.from_bytes(path8); -} - -} // namespace fml - -#endif // FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ diff --git a/fml/task_observer.h b/fml/task_observer.h new file mode 100644 index 0000000000000..21697cf022005 --- /dev/null +++ b/fml/task_observer.h @@ -0,0 +1,21 @@ +// Copyright 2017 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. + +#ifndef FLUTTER_FML_TASK_OBSERVER_H_ +#define FLUTTER_FML_TASK_OBSERVER_H_ + +#include "lib/fxl/macros.h" + +namespace fml { + +class TaskObserver { + public: + virtual ~TaskObserver() = default; + + virtual void DidProcessTask() = 0; +}; + +} // namespace fml + +#endif // FLUTTER_FML_TASK_OBSERVER_H_ diff --git a/fml/task_runner.cc b/fml/task_runner.cc index 95f91de8e9124..3d13674d78c11 100644 --- a/fml/task_runner.cc +++ b/fml/task_runner.cc @@ -2,8 +2,6 @@ // 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/task_runner.h" #include @@ -40,14 +38,4 @@ bool TaskRunner::RunsTasksOnCurrentThread() { return MessageLoop::GetCurrent().GetLoopImpl() == loop_; } -void TaskRunner::RunNowOrPostTask(fxl::RefPtr runner, - fxl::Closure task) { - FXL_DCHECK(runner); - if (runner->RunsTasksOnCurrentThread()) { - task(); - } else { - runner->PostTask(std::move(task)); - } -} - } // namespace fml diff --git a/fml/task_runner.h b/fml/task_runner.h index 3b3d2de01639d..20ea85e4e521b 100644 --- a/fml/task_runner.h +++ b/fml/task_runner.h @@ -13,7 +13,7 @@ namespace fml { class MessageLoopImpl; -class TaskRunner final : public fxl::TaskRunner { +class TaskRunner : public fxl::TaskRunner { public: void PostTask(fxl::Closure task) override; @@ -23,15 +23,12 @@ class TaskRunner final : public fxl::TaskRunner { bool RunsTasksOnCurrentThread() override; - static void RunNowOrPostTask(fxl::RefPtr runner, - fxl::Closure task); - private: fxl::RefPtr loop_; TaskRunner(fxl::RefPtr loop); - ~TaskRunner() override; + ~TaskRunner(); FRIEND_MAKE_REF_COUNTED(TaskRunner); FRIEND_REF_COUNTED_THREAD_SAFE(TaskRunner); diff --git a/fml/thread.cc b/fml/thread.cc index de4ee6dd368a8..a1500bfef46a4 100644 --- a/fml/thread.cc +++ b/fml/thread.cc @@ -2,8 +2,6 @@ // 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/thread.h" #include "lib/fxl/build_config.h" @@ -24,7 +22,7 @@ namespace fml { Thread::Thread(const std::string& name) : joined_(false) { fxl::AutoResetWaitableEvent latch; - fxl::RefPtr runner; + fxl::RefPtr runner; thread_ = std::make_unique([&latch, &runner, name]() -> void { SetCurrentThreadName(name); fml::MessageLoop::EnsureInitializedForCurrentThread(); @@ -41,7 +39,7 @@ Thread::~Thread() { Join(); } -fxl::RefPtr Thread::GetTaskRunner() const { +fxl::RefPtr Thread::GetTaskRunner() const { return task_runner_; } @@ -86,8 +84,7 @@ void Thread::SetCurrentThreadName(const std::string& name) { } __except (EXCEPTION_CONTINUE_EXECUTION) { } #else - FXL_DLOG(INFO) << "Could not set the thread name to '" << name - << "' on this platform."; +#error Unsupported Platform #endif } diff --git a/fml/thread.h b/fml/thread.h index 542871f788845..44062f1032116 100644 --- a/fml/thread.h +++ b/fml/thread.h @@ -9,8 +9,8 @@ #include #include -#include "flutter/fml/task_runner.h" #include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" namespace fml { @@ -20,13 +20,13 @@ class Thread { ~Thread(); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; void Join(); private: std::unique_ptr thread_; - fxl::RefPtr task_runner_; + fxl::RefPtr task_runner_; std::atomic_bool joined_; static void SetCurrentThreadName(const std::string& name); diff --git a/fml/unique_fd.cc b/fml/unique_fd.cc deleted file mode 100644 index bab79f7a9b743..0000000000000 --- a/fml/unique_fd.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2018 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/unique_fd.h" - -#include "lib/fxl/files/eintr_wrapper.h" - -namespace fml { -namespace internal { - -#if OS_WIN - -namespace win { - -void UniqueFDTraits::Free(HANDLE fd) { - CloseHandle(fd); -} - -} // namespace win - -#else // OS_WIN - -namespace unix { - -void UniqueFDTraits::Free(int fd) { - IGNORE_EINTR(fd); -} - -} // namespace unix - -#endif // OS_WIN - -} // namespace internal -} // namespace fml diff --git a/fml/unique_fd.h b/fml/unique_fd.h deleted file mode 100644 index 9f2d796579d8c..0000000000000 --- a/fml/unique_fd.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2018 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_UNIQUE_FD_H_ -#define FLUTTER_FML_UNIQUE_FD_H_ - -#include "flutter/fml/unique_object.h" -#include "lib/fxl/build_config.h" - -#if OS_WIN - -#include - -#endif // OS_WIN - -namespace fml { -namespace internal { - -#if OS_WIN - -namespace win { - -struct UniqueFDTraits { - static HANDLE InvalidValue() { return INVALID_HANDLE_VALUE; } - static bool IsValid(HANDLE value) { return value != InvalidValue(); } - static void Free(HANDLE fd); -}; - -} // namespace win - -#else // OS_WIN - -namespace unix { - -struct UniqueFDTraits { - static int InvalidValue() { return -1; } - static bool IsValid(int value) { return value >= 0; } - static void Free(int fd); -}; - -} // namespace unix - -#endif // OS_WIN - -} // namespace internal - -#if OS_WIN - -using UniqueFD = UniqueObject; - -#else // OS_WIN - -using UniqueFD = UniqueObject; - -#endif // OS_WIN - -} // namespace fml - -#endif // FLUTTER_FML_UNIQUE_FD_H_ diff --git a/fml/unique_object.h b/fml/unique_object.h deleted file mode 100644 index e2487a53881a9..0000000000000 --- a/fml/unique_object.h +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2018 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_UNIQUE_OBJECT_H_ -#define FLUTTER_FML_UNIQUE_OBJECT_H_ - -#include - -#include "lib/fxl/compiler_specific.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" - -namespace fml { - -// struct UniqueFooTraits { -// // This function should be fast an inline. -// static int InvalidValue() { return 0; } -// -// // This function should be fast an inline. -// static bool IsValid(const T& value) { return value != InvalidValue(); } -// -// // This free function will not be called if f == InvalidValue()! -// static void Free(int f) { ::FreeFoo(f); } -// }; - -template -class UniqueObject { - private: - // This must be first since it's used inline below. - // - // Use the empty base class optimization to allow us to have a Traits - // member, while avoiding any space overhead for it when Traits is an - // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good - // discussion of this technique. - struct Data : public Traits { - explicit Data(const T& in) : generic(in) {} - Data(const T& in, const Traits& other) : Traits(other), generic(in) {} - - T generic; - }; - - public: - using element_type = T; - using traits_type = Traits; - - UniqueObject() : data_(Traits::InvalidValue()) {} - explicit UniqueObject(const T& value) : data_(value) {} - - UniqueObject(const T& value, const Traits& traits) : data_(value, traits) {} - - UniqueObject(UniqueObject&& other) - : data_(other.release(), other.get_traits()) {} - - ~UniqueObject() { FreeIfNecessary(); } - - UniqueObject& operator=(UniqueObject&& other) { - reset(other.release()); - return *this; - } - - void reset(const T& value = Traits::InvalidValue()) { - FXL_CHECK(data_.generic == Traits::InvalidValue() || - data_.generic != value); - FreeIfNecessary(); - data_.generic = value; - } - - void swap(UniqueObject& other) { - // Standard swap idiom: 'using std::swap' ensures that std::swap is - // present in the overload set, but we call swap unqualified so that - // any more-specific overloads can be used, if available. - using std::swap; - swap(static_cast(data_), static_cast(other.data_)); - swap(data_.generic, other.data_.generic); - } - - // Release the object. The return value is the current object held by this - // object. After this operation, this object will hold an invalid value, and - // will not own the object any more. - T release() FXL_WARN_UNUSED_RESULT { - T old_generic = data_.generic; - data_.generic = Traits::InvalidValue(); - return old_generic; - } - - const T& get() const { return data_.generic; } - - bool is_valid() const { return Traits::IsValid(data_.generic); } - - bool operator==(const T& value) const { return data_.generic == value; } - - bool operator!=(const T& value) const { return data_.generic != value; } - - Traits& get_traits() { return data_; } - const Traits& get_traits() const { return data_; } - - private: - void FreeIfNecessary() { - if (data_.generic != Traits::InvalidValue()) { - data_.Free(data_.generic); - data_.generic = Traits::InvalidValue(); - } - } - - // Forbid comparison. If U != T, it totally doesn't make sense, and if U == - // T, it still doesn't make sense because you should never have the same - // object owned by two different UniqueObject. - template - bool operator==(const UniqueObject& p2) const = delete; - - template - bool operator!=(const UniqueObject& p2) const = delete; - - Data data_; - - FXL_DISALLOW_COPY_AND_ASSIGN(UniqueObject); -}; - -template -void swap(const UniqueObject& a, const UniqueObject& b) { - a.swap(b); -} - -template -bool operator==(const T& value, const UniqueObject& object) { - return value == object.get(); -} - -template -bool operator!=(const T& value, const UniqueObject& object) { - return !(value == object.get()); -} - -} // namespace fml - -#endif // FLUTTER_FML_UNIQUE_OBJECT_H_ diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 8c568f4773c90..2b53ffc4d4f6d 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -29,40 +29,20 @@ if (is_fuchsia) { # The sole purpose of this target is to generate a .packages file. sources = [] - dot_packages_file = "$target_gen_dir/snapshot.packages" - outputs = [ - dot_packages_file, - ] - deps = [] - foreach(dep, dart_deps) { - deps += [ "$dep($dart_toolchain)" ] - } + infer_package_name = true disable_analysis = true - script = "//build/dart/gen_dot_packages.py" - args = [ - "--out", - rebase_path(dot_packages_file, root_build_dir), - "--source-dir", - rebase_path("."), - "--root-build-dir", - rebase_path(root_build_dir), - "--root-gen-dir", - rebase_path(dart_root_gen_dir), - "--package-name", - "snapshot_root", - "--depfile", - rebase_path(depfile), - "--deps", - ] + dart_deps + deps = [ + "//topaz/public/dart/fuchsia", + "//topaz/public/dart/zircon", + ] } } action("generate_snapshot_bin") { if (is_fuchsia) { snapshot_dart = "snapshot_fuchsia.dart" - # TODO(rmacnak): Fuchsia cross builds use the wrong Dart target # architecture, and have added steps that depend on this error for # reasonable build times (e.g., invoking the analyzer). @@ -105,9 +85,9 @@ action("generate_snapshot_bin") { rebased_dart_ui_path = rebase_path(dart_ui_path) - gen_snapshot_dir = get_label_info( - "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", - "root_out_dir") + gen_snapshot_dir = + get_label_info("//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", + "root_out_dir") script = "//third_party/dart/runtime/tools/create_snapshot_bin.py" args = [ @@ -229,7 +209,7 @@ bin_to_assembly("isolate_snapshot_data_assembly") { ] input = "$target_gen_dir/isolate_snapshot.bin" output = "$target_gen_dir/isolate_snapshot_data.S" - symbol = "kDartIsolateSnapshotData" + symbol = "kDartIsolateCoreSnapshotData" executable = false } @@ -239,7 +219,7 @@ bin_to_assembly("isolate_snapshot_instructions_assembly") { ] input = "$target_gen_dir/isolate_snapshot_instructions.bin" output = "$target_gen_dir/isolate_snapshot_instructions.S" - symbol = "kDartIsolateSnapshotInstructions" + symbol = "kDartIsolateCoreSnapshotInstructions" executable = true } @@ -269,9 +249,9 @@ compile_platform("non_strong_platform") { ] args = [ - "--target=flutter", - "dart:core", - ] + "--target=flutter", + "dart:core", + ] } compile_platform("strong_platform") { @@ -285,10 +265,10 @@ compile_platform("strong_platform") { ] args = [ - "--target=flutter", - "--strong", - "dart:core", - ] + "--target=flutter", + "--strong", + "dart:core" + ] } group("kernel_platform_files") { diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 6a75cd22c8614..8b3be72d5973b 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -40,10 +40,14 @@ source_set("ui") { "painting/picture.h", "painting/picture_recorder.cc", "painting/picture_recorder.h", + "painting/resource_context.cc", + "painting/resource_context.h", "painting/rrect.cc", "painting/rrect.h", "painting/shader.cc", "painting/shader.h", + "painting/utils.cc", + "painting/utils.h", "painting/vertices.cc", "painting/vertices.h", "semantics/semantics_node.cc", @@ -83,18 +87,19 @@ source_set("ui") { "window/window.h", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] deps = [ + "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", - "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/runtime:test_font", "$flutter_root/sky/engine", "$flutter_root/third_party/txt", - "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", diff --git a/lib/ui/compositing/scene_builder.cc b/lib/ui/compositing/scene_builder.cc index 60b911cb4ddec..006826abbfdf6 100644 --- a/lib/ui/compositing/scene_builder.cc +++ b/lib/ui/compositing/scene_builder.cc @@ -120,11 +120,10 @@ void SceneBuilder::addPicture(double dx, double dy, Picture* picture, int hints) { - layer_builder_->PushPicture( - SkPoint::Make(dx, dy), // - UIDartState::CreateGPUObject(picture->picture()), // - !!(hints & 1), // picture is complex - !!(hints & 2) // picture will change + layer_builder_->PushPicture(SkPoint::Make(dx, dy), // + picture->picture(), // + !!(hints & 1), // picture is complex + !!(hints & 2) // picture will change ); } diff --git a/lib/ui/compositing/scene_host.cc b/lib/ui/compositing/scene_host.cc index f5e0cfb3547d8..c0e4c5332580a 100644 --- a/lib/ui/compositing/scene_host.cc +++ b/lib/ui/compositing/scene_host.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/compositing/scene_host.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" @@ -38,9 +37,8 @@ fxl::RefPtr SceneHost::create( } SceneHost::SceneHost(fxl::RefPtr export_token_handle) { - export_node_holder_ = fxl::MakeRefCounted( - blink::UIDartState::Current()->GetTaskRunners().GetGPUTaskRunner(), - export_token_handle); + export_node_holder_ = + fxl::MakeRefCounted(export_token_handle); } #else fxl::RefPtr SceneHost::create(Dart_Handle export_token_handle) { diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index 32a244c9cb67d..edd51245b05db 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -8,11 +8,7 @@ #include #include -#include -#include - #include "flutter/common/settings.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/tonic/converter/dart_converter.h" @@ -145,43 +141,17 @@ void DartRuntimeHooks::Install(IsolateType isolate_type, // Implementation of native functions which are used for some // test/debug functionality in standalone dart mode. void Logger_PrintString(Dart_NativeArguments args) { - std::stringstream stream; - const auto& logger_prefix = UIDartState::Current()->logger_prefix(); - -#if !OS(ANDROID) - // Prepend all logs with the isolate debug name except on Android where that - // prefix is specified in the log tag. - if (logger_prefix.size() > 0) { - stream << logger_prefix << ": "; - } -#endif // !OS(ANDROID) - - // Append the log buffer obtained from Dart code. - { - Dart_Handle str = Dart_GetNativeArgument(args, 0); - uint8_t* chars = nullptr; - intptr_t length = 0; - Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); - if (Dart_IsError(result)) { - Dart_PropagateError(result); - return; - } - if (length > 0) { - stream << std::string{reinterpret_cast(chars), - static_cast(length)}; - } - } - - const auto log_string = stream.str(); - const char* chars = log_string.c_str(); - const size_t length = log_string.size(); - - // Log using platform specific mechanisms - { + intptr_t length = 0; + uint8_t* chars = nullptr; + Dart_Handle str = Dart_GetNativeArgument(args, 0); + Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); + if (Dart_IsError(result)) { + Dart_PropagateError(result); + } else { #if defined(OS_ANDROID) // Write to the logcat on Android. - __android_log_print(ANDROID_LOG_INFO, logger_prefix.c_str(), "%.*s", - (int)length, chars); + const char* tag = Settings::Get().log_tag.c_str(); + __android_log_print(ANDROID_LOG_INFO, tag, "%.*s", (int)length, chars); #elif defined(OS_IOS) // Write to syslog on iOS. // @@ -189,22 +159,26 @@ void Logger_PrintString(Dart_NativeArguments args) { // iOS logging APIs altogether. syslog(1 /* LOG_ALERT */, "%.*s", (int)length, chars); #else - std::cout << log_string << std::endl; + // On Fuchsia and in flutter_tester (on both macOS and Linux), write + // directly to stdout. + fwrite(chars, 1, length, stdout); + fputs("\n", stdout); + fflush(stdout); #endif } - if (dart::bin::ShouldCaptureStdout()) { // For now we report print output on the Stdout stream. uint8_t newline[] = {'\n'}; - Dart_ServiceSendDataEvent("Stdout", "WriteEvent", - reinterpret_cast(chars), length); + Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length); Dart_ServiceSendDataEvent("Stdout", "WriteEvent", newline, sizeof(newline)); } } void ScheduleMicrotask(Dart_NativeArguments args) { Dart_Handle closure = Dart_GetNativeArgument(args, 0); - UIDartState::Current()->ScheduleMicrotask(closure); + if (LogIfError(closure) || !Dart_IsClosure(closure)) + return; + tonic::DartMicrotaskQueue::GetForCurrentThread()->ScheduleMicrotask(closure); } } // namespace blink diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 758a722b409e2..3e47ba86d50a5 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -4,11 +4,11 @@ #include "flutter/lib/ui/painting/codec.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/frame_info.h" +#include "flutter/lib/ui/painting/resource_context.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/logging.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" #include "lib/tonic/dart_state.h" @@ -17,10 +17,6 @@ #include "third_party/skia/include/codec/SkCodec.h" #include "third_party/skia/include/core/SkPixelRef.h" -#ifdef ERROR -#undef ERROR -#endif - using tonic::DartInvoke; using tonic::DartPersistentValue; using tonic::ToDart; @@ -32,9 +28,9 @@ namespace { static constexpr const char* kInitCodecTraceTag = "InitCodec"; static constexpr const char* kCodecNextFrameTraceTag = "CodecNextFrame"; -static void InvokeCodecCallback(fxl::RefPtr codec, - std::unique_ptr callback, - size_t trace_id) { +void InvokeCodecCallback(fxl::RefPtr codec, + std::unique_ptr callback, + size_t trace_id) { tonic::DartState* dart_state = callback->dart_state().get(); if (!dart_state) { TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); @@ -49,9 +45,7 @@ static void InvokeCodecCallback(fxl::RefPtr codec, TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); } -static sk_sp DecodeImage(fml::WeakPtr context, - sk_sp buffer, - size_t trace_id) { +sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("flutter", "DecodeImage"); @@ -59,11 +53,13 @@ static sk_sp DecodeImage(fml::WeakPtr context, return nullptr; } + std::unique_ptr resourceContext = ResourceContext::Acquire(); + GrContext* context = resourceContext->Get(); if (context) { // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromEncoded( - context.get(), std::move(buffer), false, dstColorSpace.get()); + return SkImage::MakeCrossContextFromEncoded(context, std::move(buffer), + false, dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -72,10 +68,7 @@ static sk_sp DecodeImage(fml::WeakPtr context, } } -fxl::RefPtr InitCodec(fml::WeakPtr context, - sk_sp buffer, - fxl::RefPtr unref_queue, - size_t trace_id) { +fxl::RefPtr InitCodec(sk_sp buffer, size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("blink", "InitCodec"); @@ -93,31 +86,27 @@ fxl::RefPtr InitCodec(fml::WeakPtr context, if (skCodec->getFrameCount() > 1) { return fxl::MakeRefCounted(std::move(skCodec)); } - auto skImage = DecodeImage(context, buffer, trace_id); + auto skImage = DecodeImage(buffer, trace_id); if (!skImage) { FXL_LOG(ERROR) << "DecodeImage failed"; return nullptr; } auto image = CanvasImage::Create(); - image->set_image({skImage, unref_queue}); + image->set_image(skImage); auto frameInfo = fxl::MakeRefCounted(std::move(image), 0); return fxl::MakeRefCounted(std::move(frameInfo)); } void InitCodecAndInvokeCodecCallback( - fxl::RefPtr ui_task_runner, - fml::WeakPtr context, - fxl::RefPtr unref_queue, std::unique_ptr callback, sk_sp buffer, size_t trace_id) { - auto codec = - InitCodec(context, std::move(buffer), std::move(unref_queue), trace_id); - ui_task_runner->PostTask( - fxl::MakeCopyable([callback = std::move(callback), - codec = std::move(codec), trace_id]() mutable { - InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); - })); + auto codec = InitCodec(std::move(buffer), trace_id); + Threads::UI()->PostTask(fxl::MakeCopyable([ + callback = std::move(callback), codec = std::move(codec), trace_id + ]() mutable { + InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); + })); } void InstantiateImageCodec(Dart_NativeArguments args) { @@ -144,20 +133,14 @@ void InstantiateImageCodec(Dart_NativeArguments args) { auto buffer = SkData::MakeWithCopy(list.data(), list.num_elements()); - auto dart_state = UIDartState::Current(); - - const auto& task_runners = dart_state->GetTaskRunners(); - task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( - [callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - buffer = std::move(buffer), trace_id, - ui_task_runner = task_runners.GetUITaskRunner(), - context = dart_state->GetResourceContext(), - queue = UIDartState::Current()->GetSkiaUnrefQueue()]() mutable { - InitCodecAndInvokeCodecCallback(std::move(ui_task_runner), context, - std::move(queue), std::move(callback), - std::move(buffer), trace_id); - })); + Threads::IO()->PostTask(fxl::MakeCopyable([ + callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + buffer = std::move(buffer), trace_id + ]() mutable { + InitCodecAndInvokeCodecCallback(std::move(callback), std::move(buffer), + trace_id); + })); } bool copy_to(SkBitmap* dst, SkColorType dstColorType, const SkBitmap& src) { @@ -230,8 +213,7 @@ MultiFrameCodec::MultiFrameCodec(std::unique_ptr codec) nextFrameIndex_ = 0; } -sk_sp MultiFrameCodec::GetNextFrameImage( - fml::WeakPtr resourceContext) { +sk_sp MultiFrameCodec::GetNextFrameImage() { SkBitmap& bitmap = frameBitmaps_[nextFrameIndex_]; if (!bitmap.getPixels()) { // We haven't decoded this frame yet const SkImageInfo info = codec_->getInfo().makeColorType(kN32_SkColorType); @@ -263,13 +245,15 @@ sk_sp MultiFrameCodec::GetNextFrameImage( } } - if (resourceContext) { + std::unique_ptr resourceContext = ResourceContext::Acquire(); + GrContext* context = resourceContext->Get(); + if (context) { SkPixmap pixmap(bitmap.info(), bitmap.pixelRef()->pixels(), bitmap.pixelRef()->rowBytes()); // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromPixmap(resourceContext.get(), pixmap, - false, dstColorSpace.get()); + return SkImage::MakeCrossContextFromPixmap(context, pixmap, false, + dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -280,22 +264,19 @@ sk_sp MultiFrameCodec::GetNextFrameImage( void MultiFrameCodec::GetNextFrameAndInvokeCallback( std::unique_ptr callback, - fxl::RefPtr ui_task_runner, - fml::WeakPtr resourceContext, - fxl::RefPtr unref_queue, size_t trace_id) { fxl::RefPtr frameInfo = NULL; - sk_sp skImage = GetNextFrameImage(resourceContext); + sk_sp skImage = GetNextFrameImage(); if (skImage) { fxl::RefPtr image = CanvasImage::Create(); - image->set_image({skImage, std::move(unref_queue)}); + image->set_image(skImage); frameInfo = fxl::MakeRefCounted( std::move(image), frameInfos_[nextFrameIndex_].fDuration); } nextFrameIndex_ = (nextFrameIndex_ + 1) % frameInfos_.size(); - ui_task_runner->PostTask(fxl::MakeCopyable( - [callback = std::move(callback), frameInfo, trace_id]() mutable { + Threads::UI()->PostTask(fxl::MakeCopyable( + [ callback = std::move(callback), frameInfo, trace_id ]() mutable { InvokeNextFrameCallback(frameInfo, std::move(callback), trace_id); })); @@ -312,20 +293,13 @@ Dart_Handle MultiFrameCodec::getNextFrame(Dart_Handle callback_handle) { return ToDart("Callback must be a function"); } - auto dart_state = UIDartState::Current(); - - const auto& task_runners = dart_state->GetTaskRunners(); - - task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( - [callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - this, trace_id, ui_task_runner = task_runners.GetUITaskRunner(), - queue = UIDartState::Current()->GetSkiaUnrefQueue(), - context = dart_state->GetResourceContext()]() mutable { - GetNextFrameAndInvokeCallback(std::move(callback), - std::move(ui_task_runner), context, - std::move(queue), trace_id); - })); + Threads::IO()->PostTask(fxl::MakeCopyable([ + callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + this, trace_id + ]() mutable { + GetNextFrameAndInvokeCallback(std::move(callback), trace_id); + })); return Dart_Null(); } diff --git a/lib/ui/painting/codec.h b/lib/ui/painting/codec.h index 9fdce1a8c1a33..98e5bc56df375 100644 --- a/lib/ui/painting/codec.h +++ b/lib/ui/painting/codec.h @@ -43,16 +43,11 @@ class MultiFrameCodec : public Codec { private: MultiFrameCodec(std::unique_ptr codec); - ~MultiFrameCodec() {} - sk_sp GetNextFrameImage(fml::WeakPtr resourceContext); - + sk_sp GetNextFrameImage(); void GetNextFrameAndInvokeCallback( std::unique_ptr callback, - fxl::RefPtr ui_task_runner, - fml::WeakPtr resourceContext, - fxl::RefPtr unref_queue, size_t trace_id); const std::unique_ptr codec_; diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 52ccd63f3f5d3..f6bb864627740 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -48,10 +48,10 @@ void CanvasGradient::initLinear(const tonic::Float32List& end_points, static_assert(sizeof(SkColor) == sizeof(int32_t), "SkColor doesn't use int32_t."); - set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeLinear( + set_shader(SkGradientShader::MakeLinear( reinterpret_cast(end_points.data()), reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode))); + colors.num_elements(), tile_mode)); } void CanvasGradient::initRadial(double center_x, @@ -73,14 +73,14 @@ void CanvasGradient::initRadial(double center_x, sk_matrix = ToSkMatrix(matrix4); } - set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeRadial( + set_shader(SkGradientShader::MakeRadial( SkPoint::Make(center_x, center_y), radius, reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr))); + colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr)); } -CanvasGradient::CanvasGradient() = default; +CanvasGradient::CanvasGradient() : Shader(nullptr) {} -CanvasGradient::~CanvasGradient() = default; +CanvasGradient::~CanvasGradient() {} } // namespace blink diff --git a/lib/ui/painting/image.cc b/lib/ui/painting/image.cc index a1b9b45cdc863..42e733241c990 100644 --- a/lib/ui/painting/image.cc +++ b/lib/ui/painting/image.cc @@ -4,7 +4,9 @@ #include "flutter/lib/ui/painting/image.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/image_encoding.h" +#include "flutter/lib/ui/painting/utils.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -28,9 +30,13 @@ void CanvasImage::RegisterNatives(tonic::DartLibraryNatives* natives) { natives->Register({FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -CanvasImage::CanvasImage() = default; +CanvasImage::CanvasImage() {} -CanvasImage::~CanvasImage() = default; +CanvasImage::~CanvasImage() { + // Skia objects must be deleted on the IO thread so that any associated GL + // objects will be cleaned up through the IO thread's GL context. + SkiaUnrefOnIOThread(&image_); +} Dart_Handle CanvasImage::toByteData(int format, int quality, @@ -43,8 +49,8 @@ void CanvasImage::dispose() { } size_t CanvasImage::GetAllocationSize() { - if (auto image = image_.get()) { - return image->width() * image->height() * 4; + if (image_) { + return image_->width() * image_->height() * 4; } else { return sizeof(CanvasImage); } diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index aeec2a0149c73..a7ed4298506f5 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -5,8 +5,6 @@ #ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_H_ #define FLUTTER_LIB_UI_PAINTING_IMAGE_H_ -#include "flutter/flow/skia_gpu_object.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkImage.h" @@ -27,18 +25,13 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, return fxl::MakeRefCounted(); } - int width() { return image_.get()->width(); } - - int height() { return image_.get()->height(); } - + int width() { return image_->width(); } + int height() { return image_->height(); } Dart_Handle toByteData(int format, int quality, Dart_Handle callback); - void dispose(); - sk_sp image() const { return image_.get(); } - void set_image(flow::SkiaGPUObject image) { - image_ = std::move(image); - } + const sk_sp& image() const { return image_; } + void set_image(sk_sp image) { image_ = std::move(image); } virtual size_t GetAllocationSize() override; @@ -47,7 +40,7 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, private: CanvasImage(); - flow::SkiaGPUObject image_; + sk_sp image_; }; } // namespace blink diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index f010fce893d3e..f356e955f6745 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -4,15 +4,13 @@ #include "flutter/lib/ui/painting/image_encoding.h" -#include -#include - -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/image.h" -#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/painting/resource_context.h" #include "lib/fxl/build_config.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_persistent_value.h" +#include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_invoke.h" #include "lib/tonic/typed_data/uint8_list.h" #include "third_party/skia/include/core/SkEncodedImageFormat.h" @@ -54,11 +52,10 @@ void EncodeImageAndInvokeDataCallback( std::unique_ptr callback, sk_sp image, SkEncodedImageFormat format, - int quality, - fxl::RefPtr ui_task_runner) { + int quality) { sk_sp encoded = EncodeImage(std::move(image), format, quality); - ui_task_runner->PostTask( + Threads::UI()->PostTask( fxl::MakeCopyable([callback = std::move(callback), encoded]() mutable { InvokeDataCallback(std::move(callback), std::move(encoded)); })); @@ -104,14 +101,10 @@ Dart_Handle EncodeImage(CanvasImage* canvas_image, tonic::DartState::Current(), callback_handle); sk_sp image = canvas_image->image(); - const auto& task_runners = UIDartState::Current()->GetTaskRunners(); - - task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( - [callback = std::move(callback), image, image_format, quality, - ui_task_runner = task_runners.GetUITaskRunner()]() mutable { + Threads::IO()->PostTask(fxl::MakeCopyable( + [callback = std::move(callback), image, image_format, quality]() mutable { EncodeImageAndInvokeDataCallback(std::move(callback), std::move(image), - image_format, quality, - std::move(ui_task_runner)); + image_format, quality); })); return Dart_Null(); diff --git a/lib/ui/painting/image_shader.cc b/lib/ui/painting/image_shader.cc index a4ddbba0ea24b..0fabd134c737c 100644 --- a/lib/ui/painting/image_shader.cc +++ b/lib/ui/painting/image_shader.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/painting/image_shader.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -38,17 +37,15 @@ void ImageShader::initWithImage(CanvasImage* image, SkShader::TileMode tmx, SkShader::TileMode tmy, const tonic::Float64List& matrix4) { - if (!image) { + if (!image) Dart_ThrowException( ToDart("ImageShader constructor called with non-genuine Image.")); - } SkMatrix sk_matrix = ToSkMatrix(matrix4); - set_shader(UIDartState::CreateGPUObject( - image->image()->makeShader(tmx, tmy, &sk_matrix))); + set_shader(image->image()->makeShader(tmx, tmy, &sk_matrix)); } -ImageShader::ImageShader() = default; +ImageShader::ImageShader() : Shader(nullptr) {} -ImageShader::~ImageShader() = default; +ImageShader::~ImageShader() {} } // namespace blink diff --git a/lib/ui/painting/picture.cc b/lib/ui/painting/picture.cc index 34f92b8c315fd..89ddbf5f41bb0 100644 --- a/lib/ui/painting/picture.cc +++ b/lib/ui/painting/picture.cc @@ -4,8 +4,9 @@ #include "flutter/lib/ui/painting/picture.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/canvas.h" -#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/painting/utils.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -22,20 +23,24 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Picture); DART_BIND_ALL(Picture, FOR_EACH_BINDING) -fxl::RefPtr Picture::Create(flow::SkiaGPUObject picture) { +fxl::RefPtr Picture::Create(sk_sp picture) { return fxl::MakeRefCounted(std::move(picture)); } -Picture::Picture(flow::SkiaGPUObject picture) - : picture_(std::move(picture)) {} +Picture::Picture(sk_sp picture) : picture_(std::move(picture)) {} -Picture::~Picture() = default; +Picture::~Picture() { + // Skia objects must be deleted on the IO thread so that any associated GL + // objects will be cleaned up through the IO thread's GL context. + SkiaUnrefOnIOThread(&picture_); +} fxl::RefPtr Picture::toImage(int width, int height) { fxl::RefPtr image = CanvasImage::Create(); - image->set_image(UIDartState::CreateGPUObject(SkImage::MakeFromPicture( - picture_.get(), SkISize::Make(width, height), nullptr, nullptr, - SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()))); + // TODO(abarth): We should pass in an SkColorSpace at some point. + image->set_image(SkImage::MakeFromPicture( + picture_, SkISize::Make(width, height), nullptr, nullptr, + SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB())); return image; } @@ -44,8 +49,8 @@ void Picture::dispose() { } size_t Picture::GetAllocationSize() { - if (auto picture = picture_.get()) { - return picture->approximateBytesUsed(); + if (picture_) { + return picture_->approximateBytesUsed(); } else { return sizeof(Picture); } diff --git a/lib/ui/painting/picture.h b/lib/ui/painting/picture.h index d916086b02f02..4a26d01c08374 100644 --- a/lib/ui/painting/picture.h +++ b/lib/ui/painting/picture.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_LIB_UI_PAINTING_PICTURE_H_ #define FLUTTER_LIB_UI_PAINTING_PICTURE_H_ -#include "flutter/flow/skia_gpu_object.h" #include "flutter/lib/ui/painting/image.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkPicture.h" @@ -24,9 +23,9 @@ class Picture : public fxl::RefCountedThreadSafe, public: ~Picture() override; - static fxl::RefPtr Create(flow::SkiaGPUObject picture); + static fxl::RefPtr Create(sk_sp picture); - sk_sp picture() const { return picture_.get(); } + const sk_sp& picture() const { return picture_; } fxl::RefPtr toImage(int width, int height); @@ -37,9 +36,9 @@ class Picture : public fxl::RefCountedThreadSafe, static void RegisterNatives(tonic::DartLibraryNatives* natives); private: - explicit Picture(flow::SkiaGPUObject picture); + explicit Picture(sk_sp picture); - flow::SkiaGPUObject picture_; + sk_sp picture_; }; } // namespace blink diff --git a/lib/ui/painting/picture_recorder.cc b/lib/ui/painting/picture_recorder.cc index e870e400a7230..adc73c0043920 100644 --- a/lib/ui/painting/picture_recorder.cc +++ b/lib/ui/painting/picture_recorder.cc @@ -50,9 +50,8 @@ SkCanvas* PictureRecorder::BeginRecording(SkRect bounds) { fxl::RefPtr PictureRecorder::endRecording() { if (!isRecording()) return nullptr; - - fxl::RefPtr picture = Picture::Create(UIDartState::CreateGPUObject( - picture_recorder_.finishRecordingAsPicture())); + fxl::RefPtr picture = + Picture::Create(picture_recorder_.finishRecordingAsPicture()); canvas_->Clear(); canvas_->ClearDartWrapper(); canvas_ = nullptr; diff --git a/lib/ui/painting/resource_context.cc b/lib/ui/painting/resource_context.cc new file mode 100644 index 0000000000000..1b9f71548c15f --- /dev/null +++ b/lib/ui/painting/resource_context.cc @@ -0,0 +1,51 @@ +// Copyright 2016 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. + +#include "flutter/lib/ui/painting/resource_context.h" + +#include + +#include "lib/fxl/logging.h" + +namespace blink { +namespace { + +static GrContext* g_context = nullptr; +static std::mutex g_mutex; +static volatile bool g_freeze = false; + +} // namespace + +ResourceContext::ResourceContext() { + g_mutex.lock(); +} + +ResourceContext::~ResourceContext() { + g_mutex.unlock(); +} + +void ResourceContext::Set(sk_sp context) { + FXL_DCHECK(!g_context); + g_context = context.release(); +} + +GrContext* ResourceContext::Get() { + return g_freeze ? nullptr : g_context; +} + +std::unique_ptr ResourceContext::Acquire() { + return std::make_unique(); +} + +void ResourceContext::Freeze() { + std::lock_guard lock(g_mutex); + g_freeze = true; +} + +void ResourceContext::Unfreeze() { + std::lock_guard lock(g_mutex); + g_freeze = false; +} + +} // namespace blink diff --git a/lib/ui/painting/resource_context.h b/lib/ui/painting/resource_context.h new file mode 100644 index 0000000000000..627b2053c2df9 --- /dev/null +++ b/lib/ui/painting/resource_context.h @@ -0,0 +1,60 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ +#define FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ + +#include "lib/fxl/macros.h" +#include "third_party/skia/include/gpu/GrContext.h" + +namespace blink { + +class ResourceContext { + public: + /** + * Globally set the GrContext singleton instance. + */ + static void Set(sk_sp context); + + /** + * Acquire a GrContext wrapping ResourceContext that's also an exclusive mutex + * on GrContext operations. + * + * Destructing the ResourceContext frees the mutex. + */ + static std::unique_ptr Acquire(); + + /** + * Synchronously signal a freeze on GrContext operations. + * + * ResourceContext instances will return nullptr on GrContext Get until + * unfrozen. + */ + static void Freeze(); + + /** + * Synchronously unfreeze GrContext operations. + * + * ResourceContext instances will continue to return the global GrContext + * instance on Get. + */ + static void Unfreeze(); + + ResourceContext(); + ~ResourceContext(); + + /** + * Returns global GrContext instance. May return null when operations are + * frozen. + * + * Happens on iOS when background operations on GrContext are forbidden. + */ + GrContext* Get(); + + FXL_DISALLOW_COPY_AND_ASSIGN(ResourceContext); +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ diff --git a/lib/ui/painting/shader.cc b/lib/ui/painting/shader.cc index 7999b84dfcc29..d7d8ccf20aefc 100644 --- a/lib/ui/painting/shader.cc +++ b/lib/ui/painting/shader.cc @@ -4,15 +4,19 @@ #include "flutter/lib/ui/painting/shader.h" -#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/common/threads.h" +#include "flutter/lib/ui/painting/utils.h" namespace blink { IMPLEMENT_WRAPPERTYPEINFO(ui, Shader); -Shader::Shader(flow::SkiaGPUObject shader) - : shader_(std::move(shader)) {} +Shader::Shader(sk_sp shader) : shader_(shader) {} -Shader::~Shader() = default; +Shader::~Shader() { + // Skia objects must be deleted on the IO thread so that any associated GL + // objects will be cleaned up through the IO thread's GL context. + SkiaUnrefOnIOThread(&shader_); +} } // namespace blink diff --git a/lib/ui/painting/shader.h b/lib/ui/painting/shader.h index 205197250eb84..9c0f3c601db56 100644 --- a/lib/ui/painting/shader.h +++ b/lib/ui/painting/shader.h @@ -5,8 +5,6 @@ #ifndef FLUTTER_LIB_UI_PAINTING_SHADER_H_ #define FLUTTER_LIB_UI_PAINTING_SHADER_H_ -#include "flutter/flow/skia_gpu_object.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkShader.h" @@ -20,17 +18,14 @@ class Shader : public fxl::RefCountedThreadSafe, public: ~Shader() override; - sk_sp shader() { return shader_.get(); } - - void set_shader(flow::SkiaGPUObject shader) { - shader_ = std::move(shader); - } + const sk_sp& shader() { return shader_; } + void set_shader(sk_sp shader) { shader_ = std::move(shader); } protected: - Shader(flow::SkiaGPUObject shader = {}); + Shader(sk_sp shader); private: - flow::SkiaGPUObject shader_; + sk_sp shader_; }; } // namespace blink diff --git a/lib/ui/painting/utils.cc b/lib/ui/painting/utils.cc new file mode 100644 index 0000000000000..b3f87135ac0a8 --- /dev/null +++ b/lib/ui/painting/utils.cc @@ -0,0 +1,46 @@ +// Copyright 2017 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. + +#include "flutter/lib/ui/painting/utils.h" +#include "flutter/common/threads.h" + +namespace blink { + +namespace { + +constexpr fxl::TimeDelta kDrainDelay = fxl::TimeDelta::FromMilliseconds(250); + +} // anonymous namespace + +SkiaUnrefQueue::SkiaUnrefQueue() : drain_pending_(false) {} + +SkiaUnrefQueue SkiaUnrefQueue::instance_; + +SkiaUnrefQueue& SkiaUnrefQueue::Get() { + return instance_; +} + +void SkiaUnrefQueue::Unref(SkRefCnt* object) { + std::lock_guard lock(mutex_); + objects_.push_back(object); + if (!drain_pending_) { + drain_pending_ = true; + Threads::IO()->PostDelayedTask([this] { Drain(); }, kDrainDelay); + } +} + +void SkiaUnrefQueue::Drain() { + std::deque skia_objects; + { + std::lock_guard lock(mutex_); + objects_.swap(skia_objects); + drain_pending_ = false; + } + + for (SkRefCnt* skia_object : skia_objects) { + skia_object->unref(); + } +} + +} // namespace blink diff --git a/lib/ui/painting/utils.h b/lib/ui/painting/utils.h new file mode 100644 index 0000000000000..02782c67962bc --- /dev/null +++ b/lib/ui/painting/utils.h @@ -0,0 +1,38 @@ +// Copyright 2016 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. + +#include "third_party/skia/include/core/SkRefCnt.h" + +#include +#include + +namespace blink { + +// A queue that holds Skia objects that must be destructed on the IO thread. +class SkiaUnrefQueue { + public: + static SkiaUnrefQueue& Get(); + + void Unref(SkRefCnt* object); + + private: + SkiaUnrefQueue(); + void Drain(); + + static SkiaUnrefQueue instance_; + + std::mutex mutex_; + std::deque objects_; + bool drain_pending_; +}; + +template +void SkiaUnrefOnIOThread(sk_sp* sp) { + T* object = sp->release(); + if (object) { + SkiaUnrefQueue::Get().Unref(object); + } +} + +} // namespace blink diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index 248468cc9701d..d6407f9ed42e1 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -34,9 +34,15 @@ std::shared_ptr FontCollection::GetFontCollection() const { return collection_; } -void FontCollection::RegisterFonts(const AssetManager& asset_manager) { +void FontCollection::RegisterFontsFromAssetProvider( + fxl::RefPtr asset_provider) { + + if (!asset_provider){ + return; + } + std::vector manifest_data; - if (!asset_manager.GetAsBuffer("FontManifest.json", &manifest_data)) { + if (!asset_provider->GetAsBuffer("FontManifest.json", &manifest_data)) { FXL_DLOG(WARNING) << "Could not find the font manifest in the asset store."; return; } @@ -86,8 +92,8 @@ void FontCollection::RegisterFonts(const AssetManager& asset_manager) { // TODO: Handle weights and styles. std::vector font_data; - if (asset_manager.GetAsBuffer(font_asset->value.GetString(), - &font_data)) { + if (asset_provider->GetAsBuffer(font_asset->value.GetString(), + &font_data)) { // The data must be copied because it needs to be moved into the // typeface as a stream. auto data = diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index ea9c2f46a96a0..fb393b1582b79 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -7,10 +7,10 @@ #include #include - -#include "flutter/assets/asset_manager.h" +#include "flutter/assets/asset_provider.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" +#include "txt/asset_data_provider.h" #include "txt/font_collection.h" namespace blink { @@ -21,8 +21,7 @@ class FontCollection { std::shared_ptr GetFontCollection() const; - void RegisterFonts(const AssetManager& asset_manager); - + void RegisterFontsFromAssetProvider(fxl::RefPtr asset_provider); void RegisterTestFonts(); private: diff --git a/lib/ui/text/paragraph.cc b/lib/ui/text/paragraph.cc index fd00f6f51b3a3..858ccd01d4ef6 100644 --- a/lib/ui/text/paragraph.cc +++ b/lib/ui/text/paragraph.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph.h" #include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" #include "flutter/sky/engine/core/rendering/RenderParagraph.h" #include "flutter/sky/engine/core/rendering/RenderText.h" @@ -53,8 +53,7 @@ Paragraph::Paragraph(std::unique_ptr paragraph) Paragraph::~Paragraph() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - destruction_task_runner_->PostTask( - [renderView]() { renderView->destroy(); }); + Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph.h b/lib/ui/text/paragraph.h index b3a943209ab4c..1b2019373553a 100644 --- a/lib/ui/text/paragraph.h +++ b/lib/ui/text/paragraph.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ -#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/paragraph_impl_blink.h" @@ -67,10 +66,6 @@ class Paragraph : public fxl::RefCountedThreadSafe, explicit Paragraph(std::unique_ptr paragraph); - // TODO: This can be removed when the render view association for the legacy - // runtime is removed. - fxl::RefPtr destruction_task_runner_ = - UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index b987e3fde6272..44d05053ba342 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph_builder.h" #include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/sky/engine/core/rendering/RenderInline.h" @@ -205,11 +205,9 @@ fxl::RefPtr ParagraphBuilder::create( double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink) { - return fxl::MakeRefCounted( - encoded, fontFamily, fontSize, lineHeight, ellipsis, locale, - UIDartState::Current()->use_blink()); + const std::string& locale) { + return fxl::MakeRefCounted(encoded, fontFamily, fontSize, + lineHeight, ellipsis, locale); } ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, @@ -217,10 +215,8 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink) - : m_useBlink(use_blink) { - if (!m_useBlink) { + const std::string& locale) { + if (!Settings::Get().using_blink) { int32_t mask = encoded[0]; txt::ParagraphStyle style; if (mask & psTextAlignMask) @@ -279,8 +275,7 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, ParagraphBuilder::~ParagraphBuilder() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - destruction_task_runner_->PostTask( - [renderView]() { renderView->destroy(); }); + Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); } } @@ -295,7 +290,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, int32_t mask = encoded[0]; - if (!m_useBlink) { + if (!Settings::Get().using_blink) { // Set to use the properties of the previous style if the property is not // explicitly given. txt::TextStyle style = m_paragraphBuilder->PeekStyle(); @@ -428,7 +423,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, } void ParagraphBuilder::pop() { - if (!m_useBlink) { + if (!Settings::Get().using_blink) { m_paragraphBuilder->Pop(); } else { // Blink Version. @@ -450,7 +445,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { if (error_code != U_BUFFER_OVERFLOW_ERROR) return tonic::ToDart("string is not well-formed UTF-16"); - if (!m_useBlink) { + if (!Settings::Get().using_blink) { m_paragraphBuilder->AddText(text); } else { // Blink Version. @@ -469,7 +464,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { fxl::RefPtr ParagraphBuilder::build() { m_currentRenderObject = nullptr; - if (!m_useBlink) { + if (!Settings::Get().using_blink) { return Paragraph::Create(m_paragraphBuilder->Build()); } else { return Paragraph::Create(m_renderView.release()); diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 1c38d98696def..37a1e9a3e74cf 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -32,8 +32,7 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink); + const std::string& locale); ~ParagraphBuilder() override; @@ -59,20 +58,14 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink); + const std::string& locale); void createRenderView(); - // TODO: This can be removed when the render view association for the legacy - // runtime is removed. - fxl::RefPtr destruction_task_runner_ = - UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; RenderObject* m_renderParagraph; RenderObject* m_currentRenderObject; std::unique_ptr m_paragraphBuilder; - bool m_useBlink; }; } // namespace blink diff --git a/lib/ui/text/paragraph_impl_blink.cc b/lib/ui/text/paragraph_impl_blink.cc index 5c50f047afa33..c7752c0a7c757 100644 --- a/lib/ui/text/paragraph_impl_blink.cc +++ b/lib/ui/text/paragraph_impl_blink.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/text/paragraph_impl_blink.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" @@ -29,8 +30,7 @@ ParagraphImplBlink::ParagraphImplBlink(PassOwnPtr renderView) ParagraphImplBlink::~ParagraphImplBlink() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - destruction_task_runner_->PostTask( - [renderView]() { renderView->destroy(); }); + Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph_impl_blink.h b/lib/ui/text/paragraph_impl_blink.h index ebd80f8dd5382..79d89ad471962 100644 --- a/lib/ui/text/paragraph_impl_blink.h +++ b/lib/ui/text/paragraph_impl_blink.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ -#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/text_box.h" @@ -42,10 +41,6 @@ class ParagraphImplBlink : public ParagraphImpl { int absoluteOffsetForPosition(const PositionWithAffinity& position); - // TODO: This can be removed when the render view association for the legacy - // runtime is removed. - fxl::RefPtr destruction_task_runner_ = - UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_impl_txt.cc b/lib/ui/text/paragraph_impl_txt.cc index 28c6ea19a8157..de8d8ff0b2fc3 100644 --- a/lib/ui/text/paragraph_impl_txt.cc +++ b/lib/ui/text/paragraph_impl_txt.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/text/paragraph_impl_txt.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "lib/fxl/logging.h" diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 8ef7ca98fd758..3bdf21e6a1a93 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/window.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" #include "lib/tonic/converter/dart_converter.h" @@ -13,44 +12,34 @@ using tonic::ToDart; namespace blink { -UIDartState::UIDartState(TaskRunners task_runners, - TaskObserverAdd add_callback, - TaskObserverRemove remove_callback, - fml::WeakPtr resource_context, - fxl::RefPtr skia_unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint, - std::string logger_prefix) - : task_runners_(std::move(task_runners)), - add_callback_(std::move(add_callback)), - remove_callback_(std::move(remove_callback)), - resource_context_(std::move(resource_context)), - advisory_script_uri_(std::move(advisory_script_uri)), - advisory_script_entrypoint_(std::move(advisory_script_entrypoint)), - logger_prefix_(std::move(logger_prefix)), - skia_unref_queue_(std::move(skia_unref_queue)), - weak_factory_(this) { - AddOrRemoveTaskObserver(true /* add */); -} +IsolateClient::~IsolateClient() {} -UIDartState::~UIDartState() { - AddOrRemoveTaskObserver(false /* remove */); -} +UIDartState::UIDartState(IsolateClient* isolate_client, + std::unique_ptr window, + int dirfd) + : tonic::DartState(dirfd), + isolate_client_(isolate_client), + main_port_(ILLEGAL_PORT), + window_(std::move(window)) {} -const std::string& UIDartState::GetAdvisoryScriptURI() const { - return advisory_script_uri_; +UIDartState::~UIDartState() { + main_port_ = ILLEGAL_PORT; + // We've already destroyed the isolate. Revoke any weak ptrs held by + // DartPersistentValues so they don't try to enter the destroyed isolate to + // clean themselves up. + // TODO(abarth): Can we do this work in the base class? + weak_factory_.InvalidateWeakPtrs(); } -const std::string& UIDartState::GetAdvisoryScriptEntrypoint() const { - return advisory_script_entrypoint_; +UIDartState* UIDartState::CreateForChildIsolate() { + return new UIDartState(isolate_client_, nullptr); } void UIDartState::DidSetIsolate() { + FXL_DCHECK(!debug_name_prefix_.empty()); main_port_ = Dart_GetMainPortId(); std::ostringstream debug_name; - // main.dart$main-1234 - debug_name << advisory_script_uri_ << "$" << advisory_script_entrypoint_ - << "-" << main_port_; + debug_name << debug_name_prefix_ << "$main-" << main_port_; debug_name_ = debug_name.str(); } @@ -66,48 +55,8 @@ PassRefPtr UIDartState::font_selector() { return font_selector_; } -void UIDartState::SetWindow(std::unique_ptr window) { - window_ = std::move(window); -} - -const TaskRunners& UIDartState::GetTaskRunners() const { - return task_runners_; -} - -fxl::RefPtr UIDartState::GetSkiaUnrefQueue() const { - return skia_unref_queue_; -} - -void UIDartState::ScheduleMicrotask(Dart_Handle closure) { - if (tonic::LogIfError(closure) || !Dart_IsClosure(closure)) { - return; - } - - microtask_queue_.ScheduleMicrotask(closure); -} - -void UIDartState::FlushMicrotasksNow() { - microtask_queue_.RunMicrotasks(); -} - -void UIDartState::AddOrRemoveTaskObserver(bool add) { - auto task_runner = task_runners_.GetUITaskRunner(); - if (!task_runner) { - // This may happen in case the isolate has no thread affinity (for example, - // the service isolate). - return; - } - FXL_DCHECK(add_callback_ && remove_callback_); - if (add) { - add_callback_(reinterpret_cast(this), - [this]() { this->FlushMicrotasksNow(); }); - } else { - remove_callback_(reinterpret_cast(this)); - } -} - -fml::WeakPtr UIDartState::GetResourceContext() const { - return resource_context_; +void UIDartState::set_debug_name_prefix(const std::string& debug_name_prefix) { + debug_name_prefix_ = debug_name_prefix; } } // namespace blink diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index a5c78c1671815..0f7f9343d4958 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -5,106 +5,65 @@ #ifndef FLUTTER_LIB_UI_UI_DART_STATE_H_ #define FLUTTER_LIB_UI_UI_DART_STATE_H_ -#include -#include #include -#include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" -#include "flutter/flow/skia_gpu_object.h" -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/sky/engine/wtf/RefPtr.h" #include "lib/fxl/build_config.h" -#include "lib/tonic/dart_microtask_queue.h" #include "lib/tonic/dart_persistent_value.h" #include "lib/tonic/dart_state.h" #include "third_party/dart/runtime/include/dart_api.h" -#include "third_party/skia/include/gpu/GrContext.h" namespace blink { class FontSelector; class Window; +class IsolateClient { + public: + virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate) = 0; + virtual void DidShutdownMainIsolate() = 0; + + protected: + virtual ~IsolateClient(); +}; + class UIDartState : public tonic::DartState { public: + UIDartState(IsolateClient* isolate_client, + std::unique_ptr window, + int dirfd = -1); + ~UIDartState() override; + static UIDartState* Current(); - Dart_Port main_port() const { return main_port_; } + UIDartState* CreateForChildIsolate(); + IsolateClient* isolate_client() const { return isolate_client_; } + void set_isolate_client(IsolateClient* isolate_client) { + isolate_client_ = isolate_client; + } + Dart_Port main_port() const { return main_port_; } const std::string& debug_name() const { return debug_name_; } - - const std::string& logger_prefix() const { return logger_prefix_; } - Window* window() const { return window_.get(); } + void set_debug_name_prefix(const std::string& debug_name_prefix); void set_font_selector(PassRefPtr selector); - PassRefPtr font_selector(); - - bool use_blink() const { return use_blink_; } - - const TaskRunners& GetTaskRunners() const; - - void ScheduleMicrotask(Dart_Handle handle); - - void FlushMicrotasksNow(); - - fxl::RefPtr GetSkiaUnrefQueue() const; - - fml::WeakPtr GetResourceContext() const; - - template - static flow::SkiaGPUObject CreateGPUObject(sk_sp object) { - if (!object) { - return {}; - } - auto state = UIDartState::Current(); - FXL_DCHECK(state); - auto queue = state->GetSkiaUnrefQueue(); - return {std::move(object), std::move(queue)}; - }; - - protected: - UIDartState(TaskRunners task_runners, - TaskObserverAdd add_callback, - TaskObserverRemove remove_callback, - fml::WeakPtr resource_context, - fxl::RefPtr skia_unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint, - std::string logger_prefix); - - ~UIDartState() override; - - void SetWindow(std::unique_ptr window); - - void set_use_blink(bool use_blink) { use_blink_ = use_blink; } - - const std::string& GetAdvisoryScriptURI() const; - - const std::string& GetAdvisoryScriptEntrypoint() const; + bool is_controller_state() const { return is_controller_state_; } + void set_is_controller_state(bool value) { is_controller_state_ = value; } + bool shutting_down() const { return shutting_down_; } + void set_shutting_down(bool value) { shutting_down_ = value; } private: void DidSetIsolate() override; - const TaskRunners task_runners_; - const TaskObserverAdd add_callback_; - const TaskObserverRemove remove_callback_; - fml::WeakPtr resource_context_; - const std::string advisory_script_uri_; - const std::string advisory_script_entrypoint_; - const std::string logger_prefix_; - Dart_Port main_port_ = ILLEGAL_PORT; + IsolateClient* isolate_client_; + Dart_Port main_port_; + std::string debug_name_prefix_; std::string debug_name_; std::unique_ptr window_; RefPtr font_selector_; - fxl::RefPtr skia_unref_queue_; - tonic::DartMicrotaskQueue microtask_queue_; - fml::WeakPtrFactory weak_factory_; - - void AddOrRemoveTaskObserver(bool add); - - bool use_blink_ = false; + bool is_controller_state_; + bool shutting_down_ = false; }; } // namespace blink diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index 2cca2fd179888..065159b79713b 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -6,7 +6,7 @@ #include -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/lib/ui/window/window.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_state.h" @@ -43,14 +43,12 @@ Dart_Handle WrapByteData(std::vector data) { } // anonymous namespace PlatformMessageResponseDart::PlatformMessageResponseDart( - tonic::DartPersistentValue callback, - fxl::RefPtr ui_task_runner) - : callback_(std::move(callback)), - ui_task_runner_(std::move(ui_task_runner)) {} + tonic::DartPersistentValue callback) + : callback_(std::move(callback)) {} PlatformMessageResponseDart::~PlatformMessageResponseDart() { if (!callback_.is_empty()) { - ui_task_runner_->PostTask( + Threads::UI()->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { callback.Clear(); })); @@ -62,7 +60,7 @@ void PlatformMessageResponseDart::Complete(std::vector data) { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - ui_task_runner_->PostTask(fxl::MakeCopyable( + Threads::UI()->PostTask(fxl::MakeCopyable( [ callback = std::move(callback_), data = std::move(data) ]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) @@ -79,7 +77,7 @@ void PlatformMessageResponseDart::CompleteEmpty() { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - ui_task_runner_->PostTask( + Threads::UI()->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) diff --git a/lib/ui/window/platform_message_response_dart.h b/lib/ui/window/platform_message_response_dart.h index 67bfb3d359691..51c55a930014b 100644 --- a/lib/ui/window/platform_message_response_dart.h +++ b/lib/ui/window/platform_message_response_dart.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ #define FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ -#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/platform_message_response.h" #include "lib/tonic/dart_persistent_value.h" @@ -20,13 +19,10 @@ class PlatformMessageResponseDart : public PlatformMessageResponse { void CompleteEmpty() override; protected: - explicit PlatformMessageResponseDart( - tonic::DartPersistentValue callback, - fxl::RefPtr ui_task_runner); + explicit PlatformMessageResponseDart(tonic::DartPersistentValue callback); ~PlatformMessageResponseDart() override; tonic::DartPersistentValue callback_; - fxl::RefPtr ui_task_runner_; }; } // namespace blink diff --git a/lib/ui/window/viewport_metrics.h b/lib/ui/window/viewport_metrics.h index 5085d06f42724..1e443ae8c1404 100644 --- a/lib/ui/window/viewport_metrics.h +++ b/lib/ui/window/viewport_metrics.h @@ -23,25 +23,6 @@ struct ViewportMetrics { int32_t physical_view_inset_left = 0; }; -struct LogicalSize { - double width = 0.0; - double height = 0.0; -}; - -struct LogicalInset { - double left = 0.0; - double top = 0.0; - double right = 0.0; - double bottom = 0.0; -}; - -struct LogicalMetrics { - LogicalSize size; - double scale = 1.0; - LogicalInset padding; - LogicalInset view_inset; -}; - } // namespace blink #endif // FLUTTER_LIB_UI_WINDOW_VIEWPORT_METRICS_H_ diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 4cce1cc5903b0..e12e03f10d01f 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -63,8 +63,7 @@ void SendPlatformMessage(Dart_Handle window, fxl::RefPtr response; if (!Dart_IsNull(callback)) { response = fxl::MakeRefCounted( - tonic::DartPersistentValue(dart_state, callback), - dart_state->GetTaskRunners().GetUITaskRunner()); + tonic::DartPersistentValue(dart_state, callback)); } if (Dart_IsNull(data.dart_handle())) { UIDartState::Current()->window()->client()->HandlePlatformMessage( @@ -255,7 +254,7 @@ void Window::BeginFrame(fxl::TimePoint frameTime) { Dart_NewInteger(microseconds), }); - UIDartState::Current()->FlushMicrotasksNow(); + tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); DartInvokeField(library_.value(), "_drawFrame", {}); } diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index 2feeccb65f9cc..ef0d7ef863a0e 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -13,7 +13,6 @@ #include "flutter/lib/ui/window/viewport_metrics.h" #include "lib/fxl/time/time_point.h" #include "lib/tonic/dart_persistent_value.h" -#include "third_party/skia/include/gpu/GrContext.h" namespace tonic { class DartLibraryNatives; @@ -36,14 +35,12 @@ class WindowClient { virtual ~WindowClient(); }; -class Window final { +class Window { public: explicit Window(WindowClient* client); - ~Window(); WindowClient* client() const { return client_; } - const ViewportMetrics& viewport_metrics() { return viewport_metrics_; } void DidCreateIsolate(); diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 455d7e228168f..dea8a8906d031 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -4,7 +4,6 @@ import("//third_party/dart/runtime/bin/vmservice/vmservice_sources.gni") import("$flutter_root/common/config.gni") -import("$flutter_root/testing/testing.gni") action("gen_embedded_resources_cc") { script = "//third_party/dart/runtime/tools/create_resources.py" @@ -38,7 +37,9 @@ source_set("embedded_resources_cc") { deps = [ ":gen_embedded_resources_cc", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] } source_set("test_font") { @@ -49,7 +50,9 @@ source_set("test_font") { deps = [ "//third_party/skia", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] defines = [] if (flutter_runtime_mode == "debug" || current_toolchain == host_toolchain) { # Though the test font data is small, we dont want to add to the binary size @@ -60,19 +63,16 @@ source_set("test_font") { } source_set("runtime") { + sources = [ "asset_font_selector.cc", "asset_font_selector.h", - "dart_isolate.cc", - "dart_isolate.h", + "dart_controller.cc", + "dart_controller.h", + "dart_init.cc", + "dart_init.h", "dart_service_isolate.cc", "dart_service_isolate.h", - "dart_snapshot.cc", - "dart_snapshot.h", - "dart_snapshot_buffer.cc", - "dart_snapshot_buffer.h", - "dart_vm.cc", - "dart_vm.h", "embedder_resources.cc", "embedder_resources.h", "platform_impl.cc", @@ -81,8 +81,8 @@ source_set("runtime") { "runtime_controller.h", "runtime_delegate.cc", "runtime_delegate.h", - "service_protocol.cc", - "service_protocol.h", + "runtime_init.cc", + "runtime_init.h", "start_up.cc", "start_up.h", "test_font_selector.cc", @@ -92,24 +92,25 @@ source_set("runtime") { deps = [ ":embedded_resources_cc", ":test_font", + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", - "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/io", "$flutter_root/lib/ui", "$flutter_root/sky/engine/platform", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//topaz/lib/tonic", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] # In AOT mode, precompiled snapshots contain the instruction buffer. # Generation of the same requires all application specific script code to be @@ -118,28 +119,3 @@ source_set("runtime") { deps += [ "$flutter_root/lib/snapshot" ] } } - -test_fixtures("runtime_fixtures") { - fixtures = [ "fixtures/simple_main.dart" ] -} - -executable("runtime_unittests") { - testonly = true - - sources = [ - "dart_isolate_unittests.cc", - "dart_vm_unittests.cc", - ] - - deps = [ - ":runtime", - ":runtime_fixtures", - "$flutter_root/fml", - "$flutter_root/lib/snapshot", - "$flutter_root/testing", - "//garnet/public/lib/fxl", - "//third_party/dart/runtime:libdart_jit", - "//third_party/skia", - "//topaz/lib/tonic", - ] -} diff --git a/runtime/asset_font_selector.cc b/runtime/asset_font_selector.cc index 2a43f39e3a89b..abf4bf9874ddd 100644 --- a/runtime/asset_font_selector.cc +++ b/runtime/asset_font_selector.cc @@ -80,15 +80,27 @@ struct FontMatcher { } // namespace -void AssetFontSelector::Install(fxl::RefPtr asset_manager) { +void AssetFontSelector::Install( + fxl::RefPtr asset_provider) { RefPtr font_selector = - adoptRef(new AssetFontSelector(std::move(asset_manager))); + adoptRef(new AssetFontSelector(std::move(asset_provider))); font_selector->parseFontManifest(); UIDartState::Current()->set_font_selector(font_selector); } -AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_manager) - : asset_manager_(std::move(asset_manager)) {} +void AssetFontSelector::Install(fxl::RefPtr asset_store) { + RefPtr font_selector = + adoptRef(new AssetFontSelector(std::move(asset_store))); + font_selector->parseFontManifest(); + UIDartState::Current()->set_font_selector(font_selector); +} + +AssetFontSelector::AssetFontSelector( + fxl::RefPtr asset_provider) + : asset_provider_(std::move(asset_provider)) {} + +AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_store) + : asset_store_(std::move(asset_store)) {} AssetFontSelector::~AssetFontSelector() {} @@ -106,9 +118,12 @@ AssetFontSelector::FlutterFontAttributes::~FlutterFontAttributes() {} void AssetFontSelector::parseFontManifest() { std::vector font_manifest_data; - if (!asset_manager_->GetAsBuffer(kFontManifestAssetPath, - &font_manifest_data)) { - return; + if (!asset_provider_ || + !asset_provider_->GetAsBuffer(kFontManifestAssetPath, + &font_manifest_data)) { + if (!asset_store_ || + !asset_store_->GetAsBuffer(kFontManifestAssetPath, &font_manifest_data)) + return; } rapidjson::Document document; @@ -224,8 +239,13 @@ sk_sp AssetFontSelector::getTypefaceAsset( } std::unique_ptr typeface_asset(new TypefaceAsset); - if (!asset_manager_->GetAsBuffer(asset_path, &typeface_asset->data)) { - return nullptr; + if (!asset_provider_ || !asset_provider_->GetAsBuffer( + asset_path, &typeface_asset->data)) { + if (!asset_store_ || + !asset_store_->GetAsBuffer(asset_path, &typeface_asset->data)) { + typeface_cache_.insert(std::make_pair(asset_path, nullptr)); + return nullptr; + } } sk_sp font_mgr(SkFontMgr::RefDefault()); diff --git a/runtime/asset_font_selector.h b/runtime/asset_font_selector.h index 8d7e946d89e7e..921c0472dba78 100644 --- a/runtime/asset_font_selector.h +++ b/runtime/asset_font_selector.h @@ -8,7 +8,7 @@ #include #include -#include "flutter/assets/asset_manager.h" +#include "flutter/assets/directory_asset_bundle.h" #include "flutter/assets/zip_asset_store.h" #include "flutter/sky/engine/platform/fonts/FontCacheKey.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" @@ -24,7 +24,11 @@ class AssetFontSelector : public FontSelector { ~AssetFontSelector() override; - static void Install(fxl::RefPtr asset_manager); + static void Install(fxl::RefPtr asset_provider); + + // TODO(zarah): Remove this and related code using asset_store once flx is + // removed. + static void Install(fxl::RefPtr asset_store); PassRefPtr getFontData(const FontDescription& font_description, const AtomicString& family_name) override; @@ -40,14 +44,19 @@ class AssetFontSelector : public FontSelector { private: struct TypefaceAsset; - explicit AssetFontSelector(fxl::RefPtr asset_manager); + explicit AssetFontSelector( + fxl::RefPtr asset_provider); + + explicit AssetFontSelector(fxl::RefPtr asset_store); void parseFontManifest(); sk_sp getTypefaceAsset(const FontDescription& font_description, const AtomicString& family_name); - fxl::RefPtr asset_manager_; + fxl::RefPtr asset_provider_; + + fxl::RefPtr asset_store_; HashMap> font_family_map_; diff --git a/runtime/dart_controller.cc b/runtime/dart_controller.cc new file mode 100644 index 0000000000000..84cfceeaecc10 --- /dev/null +++ b/runtime/dart_controller.cc @@ -0,0 +1,250 @@ +// Copyright 2015 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. + +#include "flutter/runtime/dart_controller.h" +#include "lib/fxl/build_config.h" + +#if defined(OS_WIN) +#include +#undef GetCurrentDirectory +#endif + +#include + +#include "flutter/common/settings.h" +#include "flutter/common/threads.h" +#include "flutter/glue/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "lib/fxl/files/directory.h" +#include "lib/fxl/files/path.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_message_handler.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/dart_wrappable.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/tonic/logging/dart_invoke.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/scopes/dart_isolate_scope.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +using tonic::LogIfError; +using tonic::ToDart; + +namespace blink { +namespace { +#if defined(OS_WIN) + +std::string FindAndReplace(const std::string& str, + const std::string& findStr, + const std::string& replaceStr) { + std::string rStr = str; + size_t pos = 0; + while ((pos = rStr.find(findStr, pos)) != std::string::npos) { + rStr.replace(pos, findStr.length(), replaceStr); + pos += replaceStr.length(); + } + return rStr; +} + +std::string SanitizePath(const std::string& path) { + return FindAndReplace(path, "\\\\", "/"); +} + +std::string ResolvePath(std::string path) { + std::string sanitized = SanitizePath(path); + if ((sanitized.length() > 2) && (sanitized[1] == ':')) { + return sanitized; + } + return files::SimplifyPath(files::GetCurrentDirectory() + "/" + sanitized); +} + +#else // defined(OS_WIN) + +std::string SanitizePath(const std::string& path) { + return path; +} + +// TODO(abarth): Consider adding this to //garnet/public/lib/fxl. +std::string ResolvePath(std::string path) { + if (!path.empty() && path[0] == '/') + return path; + return files::SimplifyPath(files::GetCurrentDirectory() + "/" + path); +} + +#endif + +} // namespace + +DartController::DartController() : ui_dart_state_(nullptr) {} + +DartController::~DartController() { + if (ui_dart_state_) { + ui_dart_state_->set_isolate_client(nullptr); + + if (!ui_dart_state_->shutting_down()) { + // Don't use a tonic::DartIsolateScope here since we never exit the + // isolate. + Dart_EnterIsolate(ui_dart_state_->isolate()); + // Clear the message notify callback. + Dart_SetMessageNotifyCallback(nullptr); + Dart_ShutdownIsolate(); + } + } +} + +const std::string DartController::main_entrypoint_ = "main"; + +bool DartController::SendStartMessage(Dart_Handle root_library, + const std::string& entrypoint) { + if (LogIfError(root_library)) + return true; + + { + // Temporarily exit the isolate while we make it runnable. + Dart_Isolate isolate = dart_state()->isolate(); + FXL_DCHECK(Dart_CurrentIsolate() == isolate); + Dart_ExitIsolate(); + Dart_IsolateMakeRunnable(isolate); + Dart_EnterIsolate(isolate); + } + + // In order to support pausing the isolate at start, we indirectly invoke + // main by sending a message to the isolate. + + // Get the closure of main(). + Dart_Handle main_closure = Dart_GetClosure( + root_library, Dart_NewStringFromCString(entrypoint.c_str())); + if (LogIfError(main_closure)) + return true; + + // Grab the 'dart:isolate' library. + Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); + DART_CHECK_VALID(isolate_lib); + + // Send the start message containing the entry point by calling + // _startMainIsolate in dart:isolate. + const intptr_t kNumIsolateArgs = 2; + Dart_Handle isolate_args[kNumIsolateArgs]; + isolate_args[0] = main_closure; + isolate_args[1] = Dart_Null(); + Dart_Handle result = Dart_Invoke(isolate_lib, ToDart("_startMainIsolate"), + kNumIsolateArgs, isolate_args); + return LogIfError(result); +} + +tonic::DartErrorHandleType DartController::RunFromKernel( + const std::vector& kernel, + const std::string& entrypoint) { + tonic::DartState::Scope scope(dart_state()); + tonic::DartErrorHandleType error = tonic::kNoError; + if (Dart_IsNull(Dart_RootLibrary())) { + Dart_Handle result = Dart_LoadScriptFromKernel(kernel.data(), kernel.size()); + LogIfError(result); + error = tonic::GetErrorHandleType(result); + } + if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { + return tonic::kUnknownErrorType; + } + return error; +} + +tonic::DartErrorHandleType DartController::RunFromPrecompiledSnapshot( + const std::string& entrypoint) { + TRACE_EVENT0("flutter", "DartController::RunFromPrecompiledSnapshot"); + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + tonic::DartState::Scope scope(dart_state()); + if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { + return tonic::kUnknownErrorType; + } + return tonic::kNoError; +} + +tonic::DartErrorHandleType DartController::RunFromScriptSnapshot( + const uint8_t* buffer, + size_t size, + const std::string& entrypoint) { + tonic::DartState::Scope scope(dart_state()); + tonic::DartErrorHandleType error = tonic::kNoError; + if (Dart_IsNull(Dart_RootLibrary())) { + Dart_Handle result = Dart_LoadScriptFromSnapshot(buffer, size); + LogIfError(result); + error = tonic::GetErrorHandleType(result); + } + if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { + return tonic::kUnknownErrorType; + } + return error; +} + +tonic::DartErrorHandleType DartController::RunFromSource( + const std::string& main, + const std::string& packages) { + tonic::DartState::Scope scope(dart_state()); + tonic::DartErrorHandleType error = tonic::kNoError; + if (Dart_IsNull(Dart_RootLibrary())) { + tonic::FileLoader& loader = dart_state()->file_loader(); + if (!packages.empty() && !loader.LoadPackagesMap(ResolvePath(packages))) + FXL_LOG(WARNING) << "Failed to load package map: " << packages; + Dart_Handle result = loader.LoadScript(SanitizePath(main)); + LogIfError(result); + error = tonic::GetErrorHandleType(result); + } + if (SendStartMessage(Dart_RootLibrary())) { + return tonic::kCompilationErrorType; + } + return error; +} + +void DartController::CreateIsolateFor(const std::string& script_uri, + const uint8_t* isolate_snapshot_data, + const uint8_t* isolate_snapshot_instr, + std::unique_ptr state) { + char* error = nullptr; + + void* platform_kernel = GetKernelPlatformBinary(); + + Dart_Isolate isolate; + if (platform_kernel != nullptr) { + isolate = Dart_CreateIsolateFromKernel( + script_uri.c_str(), "main", platform_kernel, nullptr /* flags */, + static_cast(state.get()), &error); + } else { + isolate = + Dart_CreateIsolate(script_uri.c_str(), "main", isolate_snapshot_data, + isolate_snapshot_instr, nullptr, + static_cast(state.get()), &error); + } + FXL_CHECK(isolate) << error; + ui_dart_state_ = state.release(); + ui_dart_state_->set_is_controller_state(true); + dart_state()->message_handler().Initialize(blink::Threads::UI()); + + Dart_SetShouldPauseOnStart(Settings::Get().start_paused); + + ui_dart_state_->set_debug_name_prefix(script_uri); + ui_dart_state_->SetIsolate(isolate); + FXL_CHECK(!LogIfError( + Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); + + { + tonic::DartApiScope dart_api_scope; + DartIO::InitForIsolate(); + DartUI::InitForIsolate(); + DartRuntimeHooks::Install(DartRuntimeHooks::MainIsolate, script_uri); + + std::unique_ptr ui_class_provider( + new tonic::DartClassProvider(dart_state(), "dart:ui")); + dart_state()->class_library().add_provider("ui", + std::move(ui_class_provider)); + } + Dart_ExitIsolate(); +} + +} // namespace blink diff --git a/runtime/dart_controller.h b/runtime/dart_controller.h new file mode 100644 index 0000000000000..4b11a8660b7e7 --- /dev/null +++ b/runtime/dart_controller.h @@ -0,0 +1,55 @@ +// Copyright 2015 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. + +#ifndef FLUTTER_RUNTIME_DART_CONTROLLER_H_ +#define FLUTTER_RUNTIME_DART_CONTROLLER_H_ + +#include +#include + +#include "lib/fxl/macros.h" +#include "lib/tonic/logging/dart_error.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace blink { +class UIDartState; + +class DartController { + public: + DartController(); + ~DartController(); + + tonic::DartErrorHandleType RunFromKernel( + const std::vector& kernel, + const std::string& entrypoint = main_entrypoint_); + tonic::DartErrorHandleType RunFromPrecompiledSnapshot( + const std::string& entrypoint = main_entrypoint_); + tonic::DartErrorHandleType RunFromScriptSnapshot( + const uint8_t* buffer, + size_t size, + const std::string& entrypoint = main_entrypoint_); + tonic::DartErrorHandleType RunFromSource(const std::string& main, + const std::string& packages); + + void CreateIsolateFor(const std::string& script_uri, + const uint8_t* isolate_snapshot_data, + const uint8_t* isolate_snapshot_instr, + std::unique_ptr ui_dart_state); + + UIDartState* dart_state() const { return ui_dart_state_; } + + private: + bool SendStartMessage(Dart_Handle root_library, + const std::string& entrypoint = main_entrypoint_); + + static const std::string main_entrypoint_; + + // The DartState associated with the main isolate. + UIDartState* ui_dart_state_; + + FXL_DISALLOW_COPY_AND_ASSIGN(DartController); +}; +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_CONTROLLER_H_ diff --git a/runtime/dart_init.cc b/runtime/dart_init.cc new file mode 100644 index 0000000000000..e3d88322a4882 --- /dev/null +++ b/runtime/dart_init.cc @@ -0,0 +1,725 @@ +// Copyright 2015 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. + +#include "flutter/runtime/dart_init.h" +#include "flutter/sky/engine/wtf/OperatingSystem.h" + +#include +#include +#include + +#if defined(OS_WIN) +#include +#include +#undef ERROR + +#define access _access +#define R_OK 0x4 + +#ifndef S_ISDIR +#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#endif + +#else +#include +#endif + +#include +#include +#include +#include + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/unzipper_provider.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/common/settings.h" +#include "flutter/glue/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/runtime/start_up.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/files/path.h" +#include "lib/fxl/files/file.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/time/time_delta.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/dart_sticky_error.h" +#include "lib/tonic/dart_wrappable.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/tonic/logging/dart_invoke.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/scopes/dart_isolate_scope.h" +#include "lib/tonic/typed_data/uint8_list.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" +#include "third_party/dart/runtime/include/dart_mirrors_api.h" + +using tonic::DartClassProvider; +using tonic::LogIfError; +using tonic::ToDart; + +namespace dart { +namespace observatory { + +#if !OS(FUCHSIA) && FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE + +// These two symbols are defined in |observatory_archive.cc| which is generated +// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. +// Both of these symbols will be part of the data segment and therefore are read +// only. +extern unsigned int observatory_assets_archive_len; +extern const uint8_t* observatory_assets_archive; + +#endif // FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE + +} // namespace observatory +} // namespace dart + +namespace blink { + +const char kKernelAssetKey[] = "kernel_blob.bin"; +const char kSnapshotAssetKey[] = "snapshot_blob.bin"; +const char kPlatformKernelAssetKey[] = "platform.dill"; + +namespace { + +// Arguments passed to the Dart VM in all configurations. +static const char* kDartLanguageArgs[] = { + "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", + "--causal_async_stacks", "--limit-ints-to-64-bits", +}; + +static const char* kDartPrecompilationArgs[] = { + "--precompilation", +}; + +static const char* kDartWriteProtectCodeArgs[] FXL_ALLOW_UNUSED_TYPE = { + "--no_write_protect_code", +}; + +static const char* kDartAssertArgs[] = { + // clang-format off + "--enable_asserts", + // clang-format on +}; + +static const char* kDartCheckedModeArgs[] = { + // clang-format off + "--enable_type_checks", + "--error_on_bad_type", + "--error_on_bad_override", + // clang-format on +}; + +static const char* kDartStrongModeArgs[] = { + // clang-format off + "--limit_ints_to_64_bits", + "--reify_generic_functions", + "--strong", + "--sync_async", + // clang-format on +}; + +static const char* kDartStartPausedArgs[]{ + "--pause_isolates_on_start", +}; + +static const char* kDartTraceStartupArgs[]{ + "--timeline_streams=Compiler,Dart,Embedder,GC", +}; + +static const char* kDartEndlessTraceBufferArgs[]{ + "--timeline_recorder=endless", +}; + +static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { + "--systrace_timeline", + "--timeline_streams=VM,Isolate,Compiler,Dart,GC", +}; + +constexpr char kFileUriPrefix[] = "file://"; +constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; + +static const uint8_t* g_default_isolate_snapshot_data = nullptr; +static const uint8_t* g_default_isolate_snapshot_instructions = nullptr; +static bool g_service_isolate_initialized = false; +static ServiceIsolateHook g_service_isolate_hook = nullptr; +static RegisterNativeServiceProtocolExtensionHook + g_register_native_service_protocol_extensions_hook = nullptr; + +// Kernel representation of core dart libraries(loaded from platform.dill). +// TODO(aam): This (and platform_data below) have to be released when engine +// gets torn down. At that point we could also call Dart_Cleanup to complete +// Dart VM cleanup. +static void* kernel_platform = nullptr; +// Bytes actually read from platform.dill that are referenced by kernel_platform +static std::vector platform_data; + +void IsolateShutdownCallback(void* callback_data) { + if (tonic::DartStickyError::IsSet()) { + tonic::DartApiScope api_scope; + FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) + << " exited with an error"; + Dart_Handle sticky_error = Dart_GetStickyError(); + FXL_CHECK(LogIfError(sticky_error)); + } + + UIDartState* dart_state = static_cast(callback_data); + // If the isolate that's shutting down is the main one, tell the higher layers + // of the stack. + if ((dart_state != NULL) && dart_state->is_controller_state()) { + dart_state->set_shutting_down(true); + if (dart_state->isolate_client()) { + dart_state->isolate_client()->DidShutdownMainIsolate(); + } + } +} + +// The cleanup callback frees the DartState object. +void IsolateCleanupCallback(void* callback_data) { + UIDartState* dart_state = static_cast(callback_data); + delete dart_state; +} + +bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { + if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { + // Assume modified. + return true; + } + + const char* path = source_url + kFileUriPrefixLength; + struct stat info; + if (stat(path, &info) < 0) + return true; + + // If st_mtime is zero, it's more likely that the file system doesn't support + // mtime than that the file was actually modified in the 1970s. + if (!info.st_mtime) + return true; + + // It's very unclear what time bases we're with here. The Dart API doesn't + // document the time base for since_ms. Reading the code, the value varies by + // platform, with a typical source being something like gettimeofday. + // + // We add one to st_mtime because st_mtime has less precision than since_ms + // and we want to treat the file as modified if the since time is between + // ticks of the mtime. + fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); + fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); + + return mtime > since; +} + +void ThreadExitCallback() {} + +bool IsServiceIsolateURL(const char* url_name) { + return url_name != nullptr && + std::string(url_name) == DART_VM_SERVICE_ISOLATE_NAME; +} + +static bool StringEndsWith(const std::string& string, + const std::string& ending) { + if (ending.size() > string.size()) + return false; + + return string.compare(string.size() - ending.size(), ending.size(), ending) == + 0; +} + +static void ReleaseFetchedBytes(uint8_t* buffer) { + free(buffer); +} + +Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, + Dart_IsolateFlags* flags, + char** error) { +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE + // No VM-service in release mode. + return nullptr; +#else // FLUTTER_RUNTIME_MODE + UIDartState* dart_state = new UIDartState(nullptr, nullptr); + + bool is_running_from_kernel = GetKernelPlatformBinary() != nullptr; + + flags->load_vmservice_library = true; + Dart_Isolate isolate = + is_running_from_kernel + ? Dart_CreateIsolateFromKernel( + script_uri, "main", kernel_platform, flags, + static_cast(dart_state), error) + : Dart_CreateIsolate( + script_uri, "main", g_default_isolate_snapshot_data, + g_default_isolate_snapshot_instructions, flags, + static_cast(dart_state), error); + + FXL_CHECK(isolate) << error; + dart_state->set_debug_name_prefix(script_uri); + dart_state->SetIsolate(isolate); + FXL_CHECK(Dart_IsServiceIsolate(isolate)); + FXL_CHECK(!LogIfError( + Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); + { + tonic::DartApiScope dart_api_scope; + DartIO::InitForIsolate(); + DartUI::InitForIsolate(); + DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); + const Settings& settings = Settings::Get(); + if (settings.enable_observatory) { + std::string ip = settings.ipv6 ? "::1" : "127.0.0.1"; + const intptr_t port = settings.observatory_port; + const bool disable_websocket_origin_check = false; + const bool service_isolate_booted = DartServiceIsolate::Startup( + ip, port, tonic::DartState::HandleLibraryTag, + !IsRunningPrecompiledCode() && !is_running_from_kernel, + disable_websocket_origin_check, error); + FXL_CHECK(service_isolate_booted) << error; + } + + if (g_service_isolate_hook) + g_service_isolate_hook(IsRunningPrecompiledCode()); + } + Dart_ExitIsolate(); + + g_service_isolate_initialized = true; + // Register any native service protocol extensions. + if (g_register_native_service_protocol_extensions_hook) { + g_register_native_service_protocol_extensions_hook( + IsRunningPrecompiledCode()); + } + return isolate; +#endif // FLUTTER_RUNTIME_MODE +} + +static bool GetAssetAsBuffer( + const std::string& name, + std::vector* data, + fxl::RefPtr& directory_asset_bundle, + fxl::RefPtr& asset_store) { + return (directory_asset_bundle && + directory_asset_bundle->GetAsBuffer(name, data)) || + (asset_store && asset_store->GetAsBuffer(name, data)); +} + +Dart_Isolate IsolateCreateCallback(const char* script_uri, + const char* main, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + void* callback_data, + char** error) { + TRACE_EVENT0("flutter", __func__); + + if (IsServiceIsolateURL(script_uri)) { + return ServiceIsolateCreateCallback(script_uri, flags, error); + } + + std::string entry_uri = script_uri; + // Are we running from a Dart source file? + const bool running_from_source = StringEndsWith(entry_uri, ".dart"); + + std::vector kernel_data; + std::vector snapshot_data; + std::string entry_path; + if (!IsRunningPrecompiledCode()) { + // Check that the entry script URI starts with file:// + if (entry_uri.find(kFileUriPrefix) != 0u) { + *error = strdup("Isolates must use file:// URIs"); + return nullptr; + } + // Entry script path (file:// is stripped). + entry_path = std::string(script_uri + strlen(kFileUriPrefix)); + if (StringEndsWith(entry_path, ".dill")) { + // Load the kernel from the script URI. + if (!files::ReadFileToVector(entry_path, &kernel_data)) { + FXL_LOG(ERROR) << "Failed to load kernel"; + } + } else if (!running_from_source) { + // Attempt to copy the snapshot or kernel from the asset bundle. + const std::string& bundle_path = entry_path; + + struct stat stat_result = {}; + if (::stat(bundle_path.c_str(), &stat_result) == 0) { + fxl::RefPtr directory_asset_bundle; + // TODO(zarah): Remove usage of zip_asset_store once app.flx is removed. + fxl::RefPtr zip_asset_store; + // bundle_path is either the path to app.flx or the flutter assets + // directory. + std::string flx_path = bundle_path; + if (S_ISDIR(stat_result.st_mode)) { + directory_asset_bundle = + fxl::MakeRefCounted(bundle_path); + flx_path = files::GetDirectoryName(bundle_path) + "/app.flx"; + } + + if (access(flx_path.c_str(), R_OK) == 0) { + zip_asset_store = fxl::MakeRefCounted( + GetUnzipperProviderForPath(flx_path)); + } + GetAssetAsBuffer(kKernelAssetKey, &kernel_data, directory_asset_bundle, + zip_asset_store); + GetAssetAsBuffer(kSnapshotAssetKey, &snapshot_data, + directory_asset_bundle, zip_asset_store); + } + } + } + + UIDartState* parent_dart_state = static_cast(callback_data); + UIDartState* dart_state = parent_dart_state->CreateForChildIsolate(); + + Dart_Isolate isolate = + kernel_platform != nullptr + ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_platform, + nullptr /* flags */, dart_state, error) + : Dart_CreateIsolate(script_uri, main, + g_default_isolate_snapshot_data, + g_default_isolate_snapshot_instructions, nullptr, + dart_state, error); + FXL_CHECK(isolate) << error; + dart_state->set_debug_name_prefix(script_uri); + dart_state->SetIsolate(isolate); + FXL_CHECK(!LogIfError( + Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); + + { + tonic::DartApiScope dart_api_scope; + DartIO::InitForIsolate(); + DartUI::InitForIsolate(); + DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); + + std::unique_ptr ui_class_provider( + new DartClassProvider(dart_state, "dart:ui")); + dart_state->class_library().add_provider("ui", + std::move(ui_class_provider)); + + if (!kernel_data.empty()) { + // We are running kernel code. + FXL_CHECK(!LogIfError(Dart_LoadScriptFromKernel(kernel_data.data(), + kernel_data.size()))); + } else if (!snapshot_data.empty()) { + // We are running from a script snapshot. + FXL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(), + snapshot_data.size()))); + } else if (running_from_source) { + // We are running from source. + // Forward the .packages configuration from the parent isolate to the + // child isolate. + tonic::FileLoader& parent_loader = parent_dart_state->file_loader(); + const std::string& packages = parent_loader.packages(); + tonic::FileLoader& loader = dart_state->file_loader(); + if (!packages.empty() && !loader.LoadPackagesMap(packages)) { + FXL_LOG(WARNING) << "Failed to load package map: " << packages; + } + // Load the script. + FXL_CHECK(!LogIfError(loader.LoadScript(entry_path))); + } + + dart_state->isolate_client()->DidCreateSecondaryIsolate(isolate); + } + + Dart_ExitIsolate(); + + FXL_CHECK(Dart_IsolateMakeRunnable(isolate)); + return isolate; +} + +Dart_Handle GetVMServiceAssetsArchiveCallback() { +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE + return nullptr; +#elif OS(FUCHSIA) + std::vector observatory_assets_archive; + if (!files::ReadFileToVector("pkg/data/observatory.tar", + &observatory_assets_archive)) { + FXL_LOG(ERROR) << "Fail to load Observatory archive"; + return nullptr; + } + return tonic::DartConverter::ToDart( + observatory_assets_archive.data(), + observatory_assets_archive.size()); +#else + return tonic::DartConverter::ToDart( + ::dart::observatory::observatory_assets_archive, + ::dart::observatory::observatory_assets_archive_len); +#endif +} + +static const char kStdoutStreamId[] = "Stdout"; +static const char kStderrStreamId[] = "Stderr"; + +static bool ServiceStreamListenCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(true); + return true; + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(true); + return true; + } + return false; +} + +static void ServiceStreamCancelCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(false); + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(false); + } +} + +} // namespace + +bool IsRunningPrecompiledCode() { + return Dart_IsPrecompiledRuntime(); +} + +EmbedderTracingCallbacks* g_tracing_callbacks = nullptr; + +EmbedderTracingCallbacks::EmbedderTracingCallbacks( + EmbedderTracingCallback start, + EmbedderTracingCallback stop) + : start_tracing_callback(start), stop_tracing_callback(stop) {} + +void SetEmbedderTracingCallbacks( + std::unique_ptr callbacks) { + g_tracing_callbacks = callbacks.release(); +} + +static void EmbedderTimelineStartRecording() { + if (g_tracing_callbacks) + g_tracing_callbacks->start_tracing_callback(); +} + +static void EmbedderTimelineStopRecording() { + if (g_tracing_callbacks) + g_tracing_callbacks->stop_tracing_callback(); +} + +static std::vector ProfilingFlags(bool enable_profiling) { +// Disable Dart's built in profiler when building a debug build. This +// works around a race condition that would sometimes stop a crash's +// stack trace from being printed on Android. +#ifndef NDEBUG + enable_profiling = false; +#endif + + // We want to disable profiling by default because it overwhelms LLDB. But + // the VM enables the same by default. In either case, we have some profiling + // flags. + if (enable_profiling) { + return { + // This is the default. But just be explicit. + "--profiler", + // This instructs the profiler to walk C++ frames, and to include + // them in the profile. + "--profile-vm"}; + } else { + return {"--no-profiler"}; + } +} + +void SetServiceIsolateHook(ServiceIsolateHook hook) { + FXL_CHECK(!g_service_isolate_initialized); + g_service_isolate_hook = hook; +} + +void SetRegisterNativeServiceProtocolExtensionHook( + RegisterNativeServiceProtocolExtensionHook hook) { + FXL_CHECK(!g_service_isolate_initialized); + g_register_native_service_protocol_extensions_hook = hook; +} + +void PushBackAll(std::vector* args, + const char** argv, + size_t argc) { + for (size_t i = 0; i < argc; ++i) { + args->push_back(argv[i]); + } +} + +static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { + info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; + dart::bin::GetIOEmbedderInformation(info); + info->name = "Flutter"; +} + +void* GetKernelPlatformBinary() { + return kernel_platform; +} + +void InitDartVM(const uint8_t* vm_snapshot_data, + const uint8_t* vm_snapshot_instructions, + const uint8_t* default_isolate_snapshot_data, + const uint8_t* default_isolate_snapshot_instructions, + const std::string& bundle_path) { + TRACE_EVENT0("flutter", __func__); + + g_default_isolate_snapshot_data = default_isolate_snapshot_data; + g_default_isolate_snapshot_instructions = + default_isolate_snapshot_instructions; + + const Settings& settings = Settings::Get(); + + { + TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); + dart::bin::BootstrapDartIo(); + + if (!settings.temp_directory_path.empty()) { + dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); + } + } + + std::vector args; + + // Instruct the VM to ignore unrecognized flags. + // There is a lot of diversity in a lot of combinations when it + // comes to the arguments the VM supports. And, if the VM comes across a flag + // it does not recognize, it exits immediately. + args.push_back("--ignore-unrecognized-flags"); + + for (const auto& profiler_flag : + ProfilingFlags(settings.enable_dart_profiling)) { + args.push_back(profiler_flag); + } + + PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); + + if (IsRunningPrecompiledCode()) { + PushBackAll(&args, kDartPrecompilationArgs, + arraysize(kDartPrecompilationArgs)); + } + +#if defined(OS_FUCHSIA) +#if defined(NDEBUG) + // Do not enable checked mode for Fuchsia release builds + // TODO(mikejurka): remove this once precompiled code is working on Fuchsia + const bool use_checked_mode = false; +#else // !defined(NDEBUG) + const bool use_checked_mode = true; +#endif // !defined(NDEBUG) +#else // !defined(OS_FUCHSIA) + // Enable checked mode if we are not running precompiled code. We run non- + // precompiled code only in the debug product mode. + const bool use_checked_mode = + !IsRunningPrecompiledCode() && !settings.dart_non_checked_mode; +#endif // !defined(OS_FUCHSIA) + +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + // Debug mode uses the JIT, disable code page write protection to avoid + // memory page protection changes before and after every compilation. + PushBackAll(&args, kDartWriteProtectCodeArgs, + arraysize(kDartWriteProtectCodeArgs)); +#endif + + if (settings.start_paused) + PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); + + if (settings.endless_trace_buffer || settings.trace_startup) { + // If we are tracing startup, make sure the trace buffer is endless so we + // don't lose early traces. + PushBackAll(&args, kDartEndlessTraceBufferArgs, + arraysize(kDartEndlessTraceBufferArgs)); + } + + if (settings.trace_startup) { + PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); + } + +#if defined(OS_FUCHSIA) + PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); +#endif + + if (!bundle_path.empty()) { + fxl::RefPtr directory_asset_bundle = + fxl::MakeRefCounted( + std::move(bundle_path)); + directory_asset_bundle->GetAsBuffer(kPlatformKernelAssetKey, + &platform_data); + if (!platform_data.empty()) { + uint8_t* kernel_buf = static_cast(malloc(platform_data.size())); + memcpy(kernel_buf, platform_data.data(), platform_data.size()); + kernel_platform = Dart_ReadKernelBinary(kernel_buf, platform_data.size(), + ReleaseFetchedBytes); + FXL_DCHECK(kernel_platform != nullptr); + } + } + if ((kernel_platform != nullptr) || + Dart_IsDart2Snapshot(g_default_isolate_snapshot_data)) { + // The presence of the kernel platform file or a snapshot that was generated + // for Dart2 indicates we are running in preview-dart-2 mode and in this + // mode enable strong mode options by default. + // Note: When we start using core snapshots instead of the platform file + // in the engine just sniffing the snapshot file should be sufficient. + PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); + // In addition if we are running in debug mode we also enable asserts. + if (use_checked_mode) { + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + } + } else if (use_checked_mode) { + // In non preview-dart-2 mode we enable checked mode and asserts if + // we are running in debug mode. + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); + } + + for (size_t i = 0; i < settings.dart_flags.size(); i++) + args.push_back(settings.dart_flags[i].c_str()); + + FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); + + DartUI::InitForGlobal(); + + // Setup embedder tracing hooks. To avoid data races, it is recommended that + // these hooks be installed before the DartInitialize, so do that setup now. + Dart_SetEmbedderTimelineCallbacks(&EmbedderTimelineStartRecording, + &EmbedderTimelineStopRecording); + + Dart_SetFileModifiedCallback(&DartFileModifiedCallback); + + { + TRACE_EVENT0("flutter", "Dart_Initialize"); + Dart_InitializeParams params = {}; + params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; + params.vm_snapshot_data = vm_snapshot_data; + params.vm_snapshot_instructions = vm_snapshot_instructions; + params.create = IsolateCreateCallback; + params.shutdown = IsolateShutdownCallback; + params.cleanup = IsolateCleanupCallback; + params.thread_exit = ThreadExitCallback; + params.get_service_assets = GetVMServiceAssetsArchiveCallback; + params.entropy_source = DartIO::EntropySource; + char* init_error = Dart_Initialize(¶ms); + if (init_error != nullptr) + FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; + free(init_error); + + // Send the earliest available timestamp in the application lifecycle to + // timeline. The difference between this timestamp and the time we render + // the very first frame gives us a good idea about Flutter's startup time. + // Use a duration event so about:tracing will consider this event when + // deciding the earliest event to use as time 0. + if (blink::engine_main_enter_ts != 0) { + Dart_TimelineEvent("FlutterEngineMainEnter", // label + blink::engine_main_enter_ts, // timestamp0 + blink::engine_main_enter_ts, // timestamp1_or_async_id + Dart_Timeline_Event_Duration, // event type + 0, // argument_count + nullptr, // argument_names + nullptr // argument_values + ); + } + } + + // Allow streaming of stdout and stderr by the Dart vm. + Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, + &ServiceStreamCancelCallback); + + Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); +} + +} // namespace blink diff --git a/runtime/dart_init.h b/runtime/dart_init.h new file mode 100644 index 0000000000000..99c8fe89137e3 --- /dev/null +++ b/runtime/dart_init.h @@ -0,0 +1,64 @@ +// Copyright 2015 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. + +#ifndef FLUTTER_RUNTIME_DART_INIT_H_ +#define FLUTTER_RUNTIME_DART_INIT_H_ + +#include "lib/fxl/build_config.h" +#include "lib/fxl/functional/closure.h" +#include "third_party/dart/runtime/include/dart_api.h" + +#include +#include +#include + +namespace blink { + +// Name of the kernel blob asset within the asset directory. +extern const char kKernelAssetKey[]; + +// Name of the snapshot blob asset within the asset directory. +extern const char kSnapshotAssetKey[]; + +// Name of the platform kernel blob asset within the asset directory. +extern const char kPlatformKernelAssetKey[]; + +bool IsRunningPrecompiledCode(); + +using EmbedderTracingCallback = fxl::Closure; + +typedef void (*ServiceIsolateHook)(bool); +typedef void (*RegisterNativeServiceProtocolExtensionHook)(bool); + +struct EmbedderTracingCallbacks { + EmbedderTracingCallback start_tracing_callback; + EmbedderTracingCallback stop_tracing_callback; + + EmbedderTracingCallbacks(EmbedderTracingCallback start, + EmbedderTracingCallback stop); +}; + +void InitDartVM(const uint8_t* vm_snapshot_data, + const uint8_t* vm_snapshot_instructions, + const uint8_t* default_isolate_snapshot_data, + const uint8_t* default_isolate_snapshot_instructions, + const std::string& bundle_path); + +void* GetKernelPlatformBinary(); + +void SetEmbedderTracingCallbacks( + std::unique_ptr callbacks); + +// Provide a function that will be called during initialization of the +// service isolate. +void SetServiceIsolateHook(ServiceIsolateHook hook); + +// Provide a function that will be called to register native service protocol +// extensions. +void SetRegisterNativeServiceProtocolExtensionHook( + RegisterNativeServiceProtocolExtensionHook hook); + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_INIT_H_ diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc deleted file mode 100644 index c5fd770b1b40c..0000000000000 --- a/runtime/dart_isolate.cc +++ /dev/null @@ -1,715 +0,0 @@ -// Copyright 2017 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/runtime/dart_isolate.h" - -#include -#include - -#include "flutter/fml/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/runtime/dart_vm.h" -#include "lib/fxl/files/path.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_class_provider.h" -#include "lib/tonic/dart_message_handler.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/dart_sticky_error.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace blink { - -fml::WeakPtr DartIsolate::CreateRootIsolate( - const DartVM* vm, - fxl::RefPtr isolate_snapshot, - TaskRunners task_runners, - std::unique_ptr window, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint, - Dart_IsolateFlags* flags) { - TRACE_EVENT0("flutter", "DartIsolate::CreateRootIsolate"); - Dart_Isolate vm_isolate = nullptr; - fml::WeakPtr embedder_isolate; - - char* error = nullptr; - - // Since this is the root isolate, we fake a parent embedder data object. We - // cannot use unique_ptr here because the destructor is private (since the - // isolate lifecycle is entirely managed by the VM). - auto root_embedder_data = std::make_unique( - vm, // VM - std::move(isolate_snapshot), // isolate snapshot - task_runners, // task runners - std::move(resource_context), // resource context - std::move(unref_queue), // skia unref queue - advisory_script_uri, // advisory URI - advisory_script_entrypoint // advisory entrypoint - ); - - std::tie(vm_isolate, embedder_isolate) = CreateDartVMAndEmbedderObjectPair( - advisory_script_uri.c_str(), // advisory script URI - advisory_script_entrypoint.c_str(), // advisory script entrypoint - nullptr, // package root - nullptr, // package config - flags, // flags - root_embedder_data.get(), // parent embedder data - true, // is root isolate - &error // error (out) - ); - - if (error != nullptr) { - free(error); - } - - if (vm_isolate == nullptr) { - return {}; - } - - if (embedder_isolate) { - // Only root isolates can interact with windows. - embedder_isolate->SetWindow(std::move(window)); - embedder_isolate->set_use_blink(vm->GetSettings().using_blink); - } - - return embedder_isolate; -} - -DartIsolate::DartIsolate(const DartVM* vm, - fxl::RefPtr isolate_snapshot, - TaskRunners task_runners, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint) - : UIDartState(std::move(task_runners), - vm->GetSettings().task_observer_add, - vm->GetSettings().task_observer_remove, - std::move(resource_context), - std::move(unref_queue), - advisory_script_uri, - advisory_script_entrypoint, - vm->GetSettings().log_tag), - vm_(vm), - isolate_snapshot_(std::move(isolate_snapshot)), - weak_factory_(this) { - FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; - weak_prototype_ = weak_factory_.GetWeakPtr(); - - if (vm_ == nullptr) { - return; - } - - phase_ = Phase::Uninitialized; -} - -DartIsolate::~DartIsolate() = default; - -DartIsolate::Phase DartIsolate::GetPhase() const { - return phase_; -} - -const DartVM* DartIsolate::GetDartVM() const { - return vm_; -} - -bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { - TRACE_EVENT0("flutter", "DartIsolate::Initialize"); - if (phase_ != Phase::Uninitialized) { - return false; - } - - if (dart_isolate == nullptr) { - return false; - } - - if (Dart_CurrentIsolate() != dart_isolate) { - return false; - } - - if (Dart_IsolateData(dart_isolate) != this) { - return false; - } - - // After this point, isolate scopes can be safely used. - SetIsolate(dart_isolate); - - // We are entering a new scope (for the first time since initialization) and - // we want to restore the current scope to null when we exit out of this - // method. This balances the implicit Dart_EnterIsolate call made by - // Dart_CreateIsolate (which calls the Initialize). - Dart_ExitIsolate(); - - tonic::DartIsolateScope scope(isolate()); - - if (is_root_isolate) { - if (auto task_runner = GetTaskRunners().GetUITaskRunner()) { - // Isolates may not have any particular thread affinity. Only initialize - // the message handler if a task runner is explicitly specified. - message_handler().Initialize(task_runner); - } - } - - if (tonic::LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))) { - return false; - } - - if (!UpdateThreadPoolNames()) { - return false; - } - - phase_ = Phase::Initialized; - return true; -} - -// Updating thread names here does not change the underlying OS thread names. -// Instead, this is just additional metadata for the Observatory to show the -// thread name of the isolate. -bool DartIsolate::UpdateThreadPoolNames() const { - // TODO(chinmaygarde): This implementation does not account for multiple - // shells sharing the same (or subset of) threads. - const auto& task_runners = GetTaskRunners(); - - if (auto task_runner = task_runners.GetGPUTaskRunner()) { - task_runner->PostTask( - [label = task_runners.GetLabel() + std::string{".gpu"}]() { - Dart_SetThreadName(label.c_str()); - }); - } - - if (auto task_runner = task_runners.GetUITaskRunner()) { - task_runner->PostTask( - [label = task_runners.GetLabel() + std::string{".ui"}]() { - Dart_SetThreadName(label.c_str()); - }); - } - - if (auto task_runner = task_runners.GetIOTaskRunner()) { - task_runner->PostTask( - [label = task_runners.GetLabel() + std::string{".io"}]() { - Dart_SetThreadName(label.c_str()); - }); - } - - if (auto task_runner = task_runners.GetPlatformTaskRunner()) { - task_runner->PostTask( - [label = task_runners.GetLabel() + std::string{".platform"}]() { - Dart_SetThreadName(label.c_str()); - }); - } - - return true; -} - -bool DartIsolate::LoadLibraries() { - TRACE_EVENT0("flutter", "DartIsolate::LoadLibraries"); - if (phase_ != Phase::Initialized) { - return false; - } - - tonic::DartState::Scope scope(this); - - DartIO::InitForIsolate(); - - DartUI::InitForIsolate(); - - const bool is_service_isolate = Dart_IsServiceIsolate(isolate()); - - DartRuntimeHooks::Install(is_service_isolate - ? DartRuntimeHooks::SecondaryIsolate - : DartRuntimeHooks::MainIsolate, - GetAdvisoryScriptURI()); - - if (!is_service_isolate) { - class_library().add_provider( - "ui", std::make_unique(this, "dart:ui")); - } - - phase_ = Phase::LibrariesSetup; - return true; -} - -bool DartIsolate::PrepareForRunningFromPrecompiledCode() { - TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromPrecompiledCode"); - if (phase_ != Phase::LibrariesSetup) { - return false; - } - - if (!DartVM::IsRunningPrecompiledCode()) { - return false; - } - - tonic::DartState::Scope scope(this); - - if (Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - if (!MarkIsolateRunnable()) { - return false; - } - - phase_ = Phase::Ready; - return true; -} - -static bool LoadScriptSnapshot(std::unique_ptr mapping) { - if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), - mapping->GetSize()))) { - return false; - } - return true; -} - -static bool LoadKernelSnapshot(std::unique_ptr mapping) { - if (tonic::LogIfError(Dart_LoadScriptFromKernel(mapping->GetMapping(), - mapping->GetSize()))) { - return false; - } - - return true; -} - -static bool LoadSnapshot(std::unique_ptr mapping, - bool is_kernel) { - if (is_kernel) { - return LoadKernelSnapshot(std::move(mapping)); - } else { - return LoadScriptSnapshot(std::move(mapping)); - } - return false; -} - -FXL_WARN_UNUSED_RESULT -bool DartIsolate::PrepareForRunningFromSnapshot( - std::unique_ptr mapping) { - TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSnapshot"); - if (phase_ != Phase::LibrariesSetup) { - return false; - } - - if (DartVM::IsRunningPrecompiledCode()) { - return false; - } - - if (!mapping || mapping->GetSize() == 0) { - return false; - } - - tonic::DartState::Scope scope(this); - - if (!Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - if (!LoadSnapshot(std::move(mapping), vm_->GetPlatformKernel() != nullptr)) { - return false; - } - - if (Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - if (!MarkIsolateRunnable()) { - return false; - } - - phase_ = Phase::Ready; - return true; -} - -static bool FileNameIsDill(const std::string& name) { - const std::string suffix = ".dill"; - - if (name.size() < suffix.size()) { - return false; - } - - if (name.rfind(suffix, name.size()) == name.size() - suffix.size()) { - return true; - } - return false; -} - -bool DartIsolate::PrepareForRunningFromSource( - const std::string& main_source_file, - const std::string& packages) { - TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSource"); - if (phase_ != Phase::LibrariesSetup) { - return false; - } - - if (DartVM::IsRunningPrecompiledCode()) { - return false; - } - - if (main_source_file.empty()) { - return false; - } - - tonic::DartState::Scope scope(this); - - if (!Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - auto& loader = file_loader(); - - if (!packages.empty()) { - auto packages_absolute_path = files::AbsolutePath(packages); - FXL_DLOG(INFO) << "Loading from packages: " << packages_absolute_path; - if (!loader.LoadPackagesMap(packages_absolute_path)) { - return false; - } - } - - auto main_source_absolute_path = files::AbsolutePath(main_source_file); - FXL_DLOG(INFO) << "Loading from source: " << main_source_absolute_path; - - // The "source" file may be a ".dill" file. - if (FileNameIsDill(main_source_absolute_path)) { - auto mapping = - std::make_unique(main_source_absolute_path, false); - if (mapping == nullptr) { - return false; - } - if (!LoadKernelSnapshot(std::move(mapping))) { - return false; - } - } else { - if (tonic::LogIfError(loader.LoadScript(main_source_absolute_path))) { - return false; - } - } - - if (Dart_IsNull(Dart_RootLibrary())) { - return false; - } - - if (!MarkIsolateRunnable()) { - return false; - } - - phase_ = Phase::Ready; - return true; -} - -bool DartIsolate::MarkIsolateRunnable() { - TRACE_EVENT0("flutter", "DartIsolate::MarkIsolateRunnable"); - if (phase_ != Phase::LibrariesSetup) { - return false; - } - - // This function may only be called from an active isolate scope. - if (Dart_CurrentIsolate() != isolate()) { - return false; - } - - // There must be no current isolate to mark an isolate as being runnable. - Dart_ExitIsolate(); - - if (!Dart_IsolateMakeRunnable(isolate())) { - // Failed. Restore the isolate. - Dart_EnterIsolate(isolate()); - return false; - } - // Success. Restore the isolate. - Dart_EnterIsolate(isolate()); - return true; -} - -FXL_WARN_UNUSED_RESULT -bool DartIsolate::Run(const std::string& entrypoint_name) { - TRACE_EVENT0("flutter", "DartIsolate::Run"); - if (phase_ != Phase::Ready) { - return false; - } - - tonic::DartState::Scope scope(this); - - Dart_Handle entrypoint = Dart_GetClosure( - Dart_RootLibrary(), tonic::ToDart(entrypoint_name.c_str())); - if (tonic::LogIfError(entrypoint)) { - return false; - } - - Dart_Handle isolate_lib = Dart_LookupLibrary(tonic::ToDart("dart:isolate")); - if (tonic::LogIfError(isolate_lib)) { - return false; - } - - Dart_Handle isolate_args[] = { - entrypoint, - Dart_Null(), - }; - - if (tonic::LogIfError(Dart_Invoke( - isolate_lib, tonic::ToDart("_startMainIsolate"), - sizeof(isolate_args) / sizeof(isolate_args[0]), isolate_args))) { - return false; - } - - phase_ = Phase::Running; - return true; -} - -bool DartIsolate::Shutdown() { - TRACE_EVENT0("flutter", "DartIsolate::Shutdown"); - // This call may be re-entrant since Dart_ShutdownIsolate can invoke the - // cleanup callback which deletes the embedder side object of the dart isolate - // (a.k.a. this). - if (phase_ == Phase::Shutdown) { - return false; - } - phase_ = Phase::Shutdown; - Dart_Isolate vm_isolate = isolate(); - // The isolate can be nullptr if this instance is the stub isolate data used - // during root isolate creation. - if (vm_isolate != nullptr) { - // We need to enter the isolate because Dart_ShutdownIsolate does not take - // the isolate to shutdown as a parameter. - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - Dart_EnterIsolate(vm_isolate); - Dart_ShutdownIsolate(); - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - } - return true; -} - -static Dart_Isolate DartCreateAndStartServiceIsolate( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - char** error) { - auto vm = DartVM::ForProcessIfInitialized(); - - if (!vm) { - *error = strdup( - "Could not resolve the VM when attempting to create the service " - "isolate."); - return nullptr; - } - - const auto& settings = vm->GetSettings(); - - if (!settings.enable_observatory) { - FXL_DLOG(INFO) << "Observatory is disabled."; - return nullptr; - } - - blink::TaskRunners null_task_runners( - "io.flutter." DART_VM_SERVICE_ISOLATE_NAME, nullptr, nullptr, nullptr, - nullptr); - - flags->load_vmservice_library = true; - - auto service_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - null_task_runners, // task runners - nullptr, // window - {}, // resource context - {}, // unref queue - advisory_script_uri == nullptr ? "" : advisory_script_uri, // script uri - advisory_script_entrypoint == nullptr - ? "" - : advisory_script_entrypoint, // script entrypoint - flags // flags - ); - - if (!service_isolate) { - *error = strdup("Could not create the service isolate."); - FXL_DLOG(ERROR) << *error; - return nullptr; - } - - // The engine never holds a strong reference to the VM service isolate. Since - // we are about to lose our last weak reference to it, start the VM service - // while we have this reference. - - const bool running_from_sources = - !DartVM::IsRunningPrecompiledCode() && vm->GetPlatformKernel() == nullptr; - - tonic::DartState::Scope scope(service_isolate.get()); - if (!DartServiceIsolate::Startup( - settings.ipv6 ? "::1" : "127.0.0.1", // server IP address - settings.observatory_port, // server observatory port - tonic::DartState::HandleLibraryTag, // embedder library tag handler - running_from_sources, // running from source code - false, // disable websocket origin check - error // error (out) - )) { - // Error is populated by call to startup. - FXL_DLOG(ERROR) << *error; - return nullptr; - } - - vm->GetServiceProtocol().ToggleHooks(true); - - return service_isolate->isolate(); -} - -// |Dart_IsolateCreateCallback| -Dart_Isolate DartIsolate::DartIsolateCreateCallback( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - DartIsolate* parent_embedder_isolate, - char** error) { - if (parent_embedder_isolate == nullptr && - strcmp(advisory_script_uri, DART_VM_SERVICE_ISOLATE_NAME) == 0) { - // The VM attempts to start the VM service for us on |Dart_Initialize|. In - // such a case, the callback data will be null and the script URI will be - // DART_VM_SERVICE_ISOLATE_NAME. In such cases, we just create the service - // isolate like normal but dont hold a reference to it at all. We also start - // this isolate since we will never again reference it from the engine. - return DartCreateAndStartServiceIsolate(advisory_script_uri, // - advisory_script_entrypoint, // - package_root, // - package_config, // - flags, // - error // - ); - } - - return CreateDartVMAndEmbedderObjectPair( - advisory_script_uri, // URI - advisory_script_entrypoint, // entrypoint - package_root, // package root - package_config, // package config - flags, // isolate flags - parent_embedder_isolate, // embedder data - false, // is root isolate - error // error - ) - .first; -} - -std::pair> -DartIsolate::CreateDartVMAndEmbedderObjectPair( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - DartIsolate* parent_embedder_isolate, - bool is_root_isolate, - char** error) { - TRACE_EVENT0("flutter", "DartIsolate::CreateDartVMAndEmbedderObjectPair"); - if (parent_embedder_isolate == nullptr || - parent_embedder_isolate->GetDartVM() == nullptr) { - *error = - strdup("Parent isolate did not have embedder specific callback data."); - FXL_DLOG(ERROR) << *error; - return {nullptr, {}}; - } - - const DartVM* vm = parent_embedder_isolate->GetDartVM(); - - // Create the native object on the embedder side. This object is deleted in - // the cleanup callback. - auto embedder_isolate = std::make_unique( - vm, // - parent_embedder_isolate->GetIsolateSnapshot(), // - parent_embedder_isolate->GetTaskRunners(), // - parent_embedder_isolate->GetResourceContext(), // - parent_embedder_isolate->GetSkiaUnrefQueue(), // - advisory_script_uri, // - advisory_script_entrypoint // - ); - - // Create the Dart VM isolate and give it the embedder object as the baton. - Dart_Isolate isolate = - vm->GetPlatformKernel() != nullptr - ? Dart_CreateIsolateFromKernel(advisory_script_uri, // - advisory_script_entrypoint, // - vm->GetPlatformKernel(), // - flags, // - embedder_isolate.get(), // - error // - ) - : Dart_CreateIsolate(advisory_script_uri, // - advisory_script_entrypoint, // - embedder_isolate->GetIsolateSnapshot() - ->GetData() - ->GetSnapshotPointer(), // - embedder_isolate->GetIsolateSnapshot() - ->GetInstructionsIfPresent(), // - flags, // - embedder_isolate.get(), // - error // - ); - - if (isolate == nullptr) { - FXL_DLOG(ERROR) << *error; - return {nullptr, {}}; - } - - if (!embedder_isolate->Initialize(isolate, is_root_isolate)) { - *error = strdup("Embedder could not initialize the Dart isolate."); - FXL_DLOG(ERROR) << *error; - return {nullptr, {}}; - } - - if (!embedder_isolate->LoadLibraries()) { - *error = - strdup("Embedder could not load libraries in the new Dart isolate."); - FXL_DLOG(ERROR) << *error; - return {nullptr, {}}; - } - - // The ownership of the embedder object is controlled by the Dart VM. So the - // only reference returned to the caller is weak. - return {isolate, embedder_isolate.release()->GetWeakIsolatePtr()}; -} - -// |Dart_IsolateShutdownCallback| -void DartIsolate::DartIsolateShutdownCallback(DartIsolate* embedder_isolate) { - if (!tonic::DartStickyError::IsSet()) { - return; - } - - tonic::DartApiScope api_scope; - FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) - << " exited with an error"; - Dart_Handle sticky_error = Dart_GetStickyError(); - FXL_CHECK(tonic::LogIfError(sticky_error)); -} - -// |Dart_IsolateCleanupCallback| -void DartIsolate::DartIsolateCleanupCallback(DartIsolate* embedder_isolate) { - delete embedder_isolate; -} - -fxl::RefPtr DartIsolate::GetIsolateSnapshot() const { - return isolate_snapshot_; -} - -fml::WeakPtr DartIsolate::GetWeakIsolatePtr() const { - return weak_prototype_; -} - -void DartIsolate::AddIsolateShutdownCallback(fxl::Closure closure) { - shutdown_callbacks_.emplace_back( - std::make_unique(std::move(closure))); -} - -} // namespace blink diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h deleted file mode 100644 index 13d573ebe333f..0000000000000 --- a/runtime/dart_isolate.h +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2017 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_RUNTIME_DART_ISOLATE_H_ -#define FLUTTER_RUNTIME_DART_ISOLATE_H_ - -#include -#include - -#include "flutter/common/task_runners.h" -#include "flutter/fml/mapping.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_snapshot.h" -#include "lib/fxl/compiler_specific.h" -#include "lib/fxl/macros.h" -#include "lib/tonic/dart_state.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace blink { -class DartVM; - -class DartIsolate : public UIDartState { - public: - enum class Phase { - Unknown, - Uninitialized, - Initialized, - LibrariesSetup, - Ready, - Running, - Shutdown, - }; - - // The root isolate of a Flutter application is special because it gets Window - // bindings. From the VM's perspective, this isolate is not special in any - // way. - static fml::WeakPtr CreateRootIsolate( - const DartVM* vm, - fxl::RefPtr isolate_snapshot, - TaskRunners task_runners, - std::unique_ptr window, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - std::string advisory_script_uri = "main.dart", - std::string advisory_script_entrypoint = "main", - Dart_IsolateFlags* flags = nullptr); - - DartIsolate(const DartVM* vm, - fxl::RefPtr isolate_snapshot, - TaskRunners task_runners, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - std::string advisory_script_uri, - std::string advisory_script_entrypoint); - - ~DartIsolate() override; - - Phase GetPhase() const; - - FXL_WARN_UNUSED_RESULT - bool PrepareForRunningFromPrecompiledCode(); - - FXL_WARN_UNUSED_RESULT - bool PrepareForRunningFromSnapshot(std::unique_ptr snapshot); - - FXL_WARN_UNUSED_RESULT - bool PrepareForRunningFromSource(const std::string& main_source_file, - const std::string& packages); - - FXL_WARN_UNUSED_RESULT - bool Run(const std::string& entrypoint); - - FXL_WARN_UNUSED_RESULT - bool Shutdown(); - - void AddIsolateShutdownCallback(fxl::Closure closure); - - const DartVM* GetDartVM() const; - - fxl::RefPtr GetIsolateSnapshot() const; - - fml::WeakPtr GetWeakIsolatePtr() const; - - private: - class AutoFireClosure { - public: - AutoFireClosure(fxl::Closure closure) : closure_(std::move(closure)) {} - ~AutoFireClosure() { - if (closure_) { - closure_(); - } - } - - private: - fxl::Closure closure_; - FXL_DISALLOW_COPY_AND_ASSIGN(AutoFireClosure); - }; - friend class DartVM; - - const DartVM* vm_ = nullptr; - Phase phase_ = Phase::Unknown; - const fxl::RefPtr isolate_snapshot_; - std::vector> shutdown_callbacks_; - fml::WeakPtr weak_prototype_; - fml::WeakPtrFactory weak_factory_; - - FXL_WARN_UNUSED_RESULT - bool Initialize(Dart_Isolate isolate, bool is_root_isolate); - - FXL_WARN_UNUSED_RESULT - bool LoadLibraries(); - - bool UpdateThreadPoolNames() const; - - FXL_WARN_UNUSED_RESULT - bool MarkIsolateRunnable(); - - // |Dart_IsolateCreateCallback| - static Dart_Isolate DartIsolateCreateCallback( - const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - DartIsolate* embedder_isolate, - char** error); - - static std::pair /* embedder */> - CreateDartVMAndEmbedderObjectPair(const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - DartIsolate* parent_embedder_isolate, - bool is_root_isolate, - char** error); - - // |Dart_IsolateShutdownCallback| - static void DartIsolateShutdownCallback(DartIsolate* embedder_isolate); - - // |Dart_IsolateCleanupCallback| - static void DartIsolateCleanupCallback(DartIsolate* embedder_isolate); - - FXL_DISALLOW_COPY_AND_ASSIGN(DartIsolate); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_ISOLATE_H_ diff --git a/runtime/dart_isolate_unittests.cc b/runtime/dart_isolate_unittests.cc deleted file mode 100644 index d8f2e02382da1..0000000000000 --- a/runtime/dart_isolate_unittests.cc +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2017 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/thread.h" -#include "flutter/runtime/dart_isolate.h" -#include "flutter/runtime/dart_vm.h" -#include "flutter/testing/testing.h" -#include "flutter/testing/thread_test.h" - -#define CURRENT_TEST_NAME \ - std::string { \ - ::testing::UnitTest::GetInstance()->current_test_info()->name() \ - } - -namespace blink { - -using DartIsolateTest = ::testing::ThreadTest; - -TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) { - Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - auto vm = DartVM::ForProcess(settings); - ASSERT_TRUE(vm); - TaskRunners task_runners(CURRENT_TEST_NAME, // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner() // - ); - auto root_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - std::move(task_runners), // task runners - nullptr, // window - {}, // resource context - nullptr // unref qeueue - ); - ASSERT_TRUE(root_isolate); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); - ASSERT_TRUE(root_isolate->Shutdown()); -} - -TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) { - Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - auto vm = DartVM::ForProcess(settings); - ASSERT_TRUE(vm); - TaskRunners task_runners(CURRENT_TEST_NAME, // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner() // - ); - auto root_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - std::move(task_runners), // task runners - nullptr, // window - {}, // resource context - nullptr // unref qeueue - ); - ASSERT_TRUE(root_isolate); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); - ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( - testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); - ASSERT_TRUE(root_isolate->Shutdown()); -} - -TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) { - Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - auto vm = DartVM::ForProcess(settings); - ASSERT_TRUE(vm); - TaskRunners task_runners(CURRENT_TEST_NAME, // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner(), // - GetCurrentTaskRunner() // - ); - auto root_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - std::move(task_runners), // task runners - nullptr, // window - {}, // resource context - nullptr // unref qeueue - ); - ASSERT_TRUE(root_isolate); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); - ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( - testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); - ASSERT_TRUE(root_isolate->Run("simple_main")); - ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Running); - ASSERT_TRUE(root_isolate->Shutdown()); -} - -} // namespace blink diff --git a/runtime/dart_service_isolate.h b/runtime/dart_service_isolate.h index 59a02e2e9d495..9edd663feb6bd 100644 --- a/runtime/dart_service_isolate.h +++ b/runtime/dart_service_isolate.h @@ -13,6 +13,8 @@ namespace blink { class DartServiceIsolate { public: + static bool Bootstrap(); + static bool Startup(std::string server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc deleted file mode 100644 index 5d759257d1d4b..0000000000000 --- a/runtime/dart_snapshot.cc +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2017 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/runtime/dart_snapshot.h" - -#include - -#include "flutter/fml/native_library.h" -#include "flutter/fml/paths.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/dart_snapshot_buffer.h" -#include "flutter/runtime/dart_vm.h" - -namespace blink { - -const char* DartSnapshot::kVMDataSymbol = "kDartVmSnapshotData"; -const char* DartSnapshot::kVMInstructionsSymbol = "kDartVmSnapshotInstructions"; -const char* DartSnapshot::kIsolateDataSymbol = "kDartIsolateSnapshotData"; -const char* DartSnapshot::kIsolateInstructionsSymbol = - "kDartIsolateSnapshotInstructions"; - -static std::unique_ptr ResolveVMData( - const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = fml::paths::JoinPaths( - {settings.aot_snapshot_path, settings.aot_vm_snapshot_data_filename}); - if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), false /* executable */)) { - return source; - } - } - - auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); - return DartSnapshotBuffer::CreateWithSymbolInLibrary( - loaded_process, DartSnapshot::kVMDataSymbol); -} - -static std::unique_ptr ResolveVMInstructions( - const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = fml::paths::JoinPaths( - {settings.aot_snapshot_path, settings.aot_vm_snapshot_instr_filename}); - if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), true /* executable */)) { - return source; - } - } - - if (settings.application_library_path.size() > 0) { - auto library = - fml::NativeLibrary::Create(settings.application_library_path.c_str()); - if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( - library, DartSnapshot::kVMInstructionsSymbol)) { - return source; - } - } - - auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); - return DartSnapshotBuffer::CreateWithSymbolInLibrary( - loaded_process, DartSnapshot::kVMInstructionsSymbol); -} - -static std::unique_ptr ResolveIsolateData( - const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = - fml::paths::JoinPaths({settings.aot_snapshot_path, - settings.aot_isolate_snapshot_data_filename}); - if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), false /* executable */)) { - return source; - } - } - - auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); - return DartSnapshotBuffer::CreateWithSymbolInLibrary( - loaded_process, DartSnapshot::kIsolateDataSymbol); -} - -static std::unique_ptr ResolveIsolateInstructions( - const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = - fml::paths::JoinPaths({settings.aot_snapshot_path, - settings.aot_isolate_snapshot_instr_filename}); - if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), true /* executable */)) { - return source; - } - } - - if (settings.application_library_path.size() > 0) { - auto library = - fml::NativeLibrary::Create(settings.application_library_path.c_str()); - if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( - library, DartSnapshot::kIsolateInstructionsSymbol)) { - return source; - } - } - - auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); - return DartSnapshotBuffer::CreateWithSymbolInLibrary( - loaded_process, DartSnapshot::kIsolateInstructionsSymbol); -} - -fxl::RefPtr DartSnapshot::VMSnapshotFromSettings( - const Settings& settings) { - TRACE_EVENT0("flutter", "DartSnapshot::VMSnapshotFromSettings"); - auto snapshot = - fxl::MakeRefCounted(ResolveVMData(settings), // - ResolveVMInstructions(settings) // - ); - if (snapshot->IsValid()) { - return snapshot; - } - return nullptr; -} - -fxl::RefPtr DartSnapshot::IsolateSnapshotFromSettings( - const Settings& settings) { - TRACE_EVENT0("flutter", "DartSnapshot::IsolateSnapshotFromSettings"); - auto snapshot = - fxl::MakeRefCounted(ResolveIsolateData(settings), // - ResolveIsolateInstructions(settings) // - ); - if (snapshot->IsValid()) { - return snapshot; - } - return nullptr; -} - -DartSnapshot::DartSnapshot(std::unique_ptr data, - std::unique_ptr instructions) - : data_(std::move(data)), instructions_(std::move(instructions)) {} - -DartSnapshot::~DartSnapshot() = default; - -bool DartSnapshot::IsValid() const { - return static_cast(data_); -} - -bool DartSnapshot::IsValidForAOT() const { - return data_ && instructions_; -} - -const DartSnapshotBuffer* DartSnapshot::GetData() const { - return data_.get(); -} - -const DartSnapshotBuffer* DartSnapshot::GetInstructions() const { - return instructions_.get(); -} - -const uint8_t* DartSnapshot::GetInstructionsIfPresent() const { - return instructions_ ? instructions_->GetSnapshotPointer() : nullptr; -} - -} // namespace blink diff --git a/runtime/dart_snapshot.h b/runtime/dart_snapshot.h deleted file mode 100644 index 4f04765b4f5a9..0000000000000 --- a/runtime/dart_snapshot.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_H_ -#define FLUTTER_RUNTIME_DART_SNAPSHOT_H_ - -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/runtime/dart_snapshot_buffer.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" - -namespace blink { - -class DartSnapshot : public fxl::RefCountedThreadSafe { - public: - static const char* kVMDataSymbol; - static const char* kVMInstructionsSymbol; - static const char* kIsolateDataSymbol; - static const char* kIsolateInstructionsSymbol; - - static fxl::RefPtr VMSnapshotFromSettings( - const Settings& settings); - - static fxl::RefPtr IsolateSnapshotFromSettings( - const Settings& settings); - - bool IsValid() const; - - bool IsValidForAOT() const; - - const DartSnapshotBuffer* GetData() const; - - const DartSnapshotBuffer* GetInstructions() const; - - const uint8_t* GetInstructionsIfPresent() const; - - private: - std::unique_ptr data_; - std::unique_ptr instructions_; - - DartSnapshot(std::unique_ptr data, - std::unique_ptr instructions); - - ~DartSnapshot(); - - FRIEND_REF_COUNTED_THREAD_SAFE(DartSnapshot); - FRIEND_MAKE_REF_COUNTED(DartSnapshot); - FXL_DISALLOW_COPY_AND_ASSIGN(DartSnapshot); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_H_ diff --git a/runtime/dart_snapshot_buffer.cc b/runtime/dart_snapshot_buffer.cc deleted file mode 100644 index c39233ac8334a..0000000000000 --- a/runtime/dart_snapshot_buffer.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2017 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/runtime/dart_snapshot_buffer.h" - -#include - -#include "flutter/fml/mapping.h" - -namespace blink { - -class NativeLibrarySnapshotBuffer final : public DartSnapshotBuffer { - public: - NativeLibrarySnapshotBuffer(fxl::RefPtr library, - const char* symbol_name) - : library_(std::move(library)) { - if (library_) { - symbol_ = library_->ResolveSymbol(symbol_name); - } - } - - const uint8_t* GetSnapshotPointer() const override { return symbol_; } - - size_t GetSnapshotSize() const override { return 0; } - - private: - fxl::RefPtr library_; - const uint8_t* symbol_ = nullptr; - - FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrarySnapshotBuffer); -}; - -class FileSnapshotBuffer final : public DartSnapshotBuffer { - public: - FileSnapshotBuffer(const char* path, bool executable) - : mapping_(path, executable) { - if (mapping_.GetSize() > 0) { - symbol_ = mapping_.GetMapping(); - } - } - - const uint8_t* GetSnapshotPointer() const override { return symbol_; } - - size_t GetSnapshotSize() const override { return mapping_.GetSize(); } - - private: - fml::FileMapping mapping_; - const uint8_t* symbol_ = nullptr; - - FXL_DISALLOW_COPY_AND_ASSIGN(FileSnapshotBuffer); -}; - -std::unique_ptr -DartSnapshotBuffer::CreateWithSymbolInLibrary( - fxl::RefPtr library, - const char* symbol_name) { - auto source = std::make_unique( - std::move(library), symbol_name); - return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); -} - -std::unique_ptr -DartSnapshotBuffer::CreateWithContentsOfFile(const char* file_path, - bool executable) { - auto source = std::make_unique(file_path, executable); - return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); -} - -DartSnapshotBuffer::~DartSnapshotBuffer() = default; - -} // namespace blink diff --git a/runtime/dart_snapshot_buffer.h b/runtime/dart_snapshot_buffer.h deleted file mode 100644 index 675946c0ca63f..0000000000000 --- a/runtime/dart_snapshot_buffer.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_BUFFER_H_ -#define FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ - -#include - -#include "flutter/fml/native_library.h" -#include "lib/fxl/macros.h" - -namespace blink { - -class DartSnapshotBuffer { - public: - static std::unique_ptr CreateWithSymbolInLibrary( - fxl::RefPtr library, - const char* symbol_name); - - static std::unique_ptr CreateWithContentsOfFile( - const char* file_path, - bool executable); - - virtual ~DartSnapshotBuffer(); - - virtual const uint8_t* GetSnapshotPointer() const = 0; - - virtual size_t GetSnapshotSize() const = 0; -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc deleted file mode 100644 index bb46779078583..0000000000000 --- a/runtime/dart_vm.cc +++ /dev/null @@ -1,472 +0,0 @@ -// Copyright 2017 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/runtime/dart_vm.h" - -#include - -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/fml/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/runtime/dart_isolate.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/runtime/start_up.h" -#include "lib/fxl/arraysize.h" -#include "lib/fxl/compiler_specific.h" -#include "lib/fxl/files/file.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_class_provider.h" -#include "lib/tonic/dart_sticky_error.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/typed_data/uint8_list.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace dart { -namespace observatory { - -#if !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) - -// These two symbols are defined in |observatory_archive.cc| which is generated -// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. -// Both of these symbols will be part of the data segment and therefore are read -// only. -extern unsigned int observatory_assets_archive_len; -extern const uint8_t* observatory_assets_archive; - -#endif // !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != - // FLUTTER_RUNTIME_MODE_RELEASE) - -} // namespace observatory -} // namespace dart - -namespace blink { - -// Arguments passed to the Dart VM in all configurations. -static const char* kDartLanguageArgs[] = { - "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", - "--causal_async_stacks", "--limit-ints-to-64-bits", -}; - -static const char* kDartPrecompilationArgs[] = { - "--precompilation", -}; - -FXL_ALLOW_UNUSED_TYPE -static const char* kDartWriteProtectCodeArgs[] = { - "--no_write_protect_code", -}; - -static const char* kDartAssertArgs[] = { - // clang-format off - "--enable_asserts", - // clang-format on -}; - -static const char* kDartCheckedModeArgs[] = { - // clang-format off - "--enable_type_checks", - "--error_on_bad_type", - "--error_on_bad_override", - // clang-format on -}; - -static const char* kDartStrongModeArgs[] = { - // clang-format off - "--strong", - "--reify_generic_functions", - "--limit_ints_to_64_bits", - "--sync_async", - // clang-format on -}; - -static const char* kDartStartPausedArgs[]{ - "--pause_isolates_on_start", -}; - -static const char* kDartTraceStartupArgs[]{ - "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", -}; - -static const char* kDartEndlessTraceBufferArgs[]{ - "--timeline_recorder=endless", -}; - -static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { - "--systrace_timeline", - "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", -}; - -constexpr char kFileUriPrefix[] = "file://"; -constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; - -bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { - if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { - // Assume modified. - return true; - } - - const char* path = source_url + kFileUriPrefixLength; - struct stat info; - if (stat(path, &info) < 0) - return true; - - // If st_mtime is zero, it's more likely that the file system doesn't support - // mtime than that the file was actually modified in the 1970s. - if (!info.st_mtime) - return true; - - // It's very unclear what time bases we're with here. The Dart API doesn't - // document the time base for since_ms. Reading the code, the value varies by - // platform, with a typical source being something like gettimeofday. - // - // We add one to st_mtime because st_mtime has less precision than since_ms - // and we want to treat the file as modified if the since time is between - // ticks of the mtime. - fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); - fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); - - return mtime > since; -} - -void ThreadExitCallback() {} - -Dart_Handle GetVMServiceAssetsArchiveCallback() { -#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) - return nullptr; -#elif OS(FUCHSIA) - std::vector observatory_assets_archive; - if (!files::ReadFileToVector("pkg/data/observatory.tar", - &observatory_assets_archive)) { - FXL_LOG(ERROR) << "Fail to load Observatory archive"; - return nullptr; - } - return tonic::DartConverter::ToDart( - observatory_assets_archive.data(), observatory_assets_archive.size()); -#else - return tonic::DartConverter::ToDart( - ::dart::observatory::observatory_assets_archive, - ::dart::observatory::observatory_assets_archive_len); -#endif -} - -static const char kStdoutStreamId[] = "Stdout"; -static const char kStderrStreamId[] = "Stderr"; - -static bool ServiceStreamListenCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(true); - return true; - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(true); - return true; - } - return false; -} - -static void ServiceStreamCancelCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(false); - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(false); - } -} - -bool DartVM::IsRunningPrecompiledCode() { - return Dart_IsPrecompiledRuntime(); -} - -static std::vector ProfilingFlags(bool enable_profiling) { -// Disable Dart's built in profiler when building a debug build. This -// works around a race condition that would sometimes stop a crash's -// stack trace from being printed on Android. -#ifndef NDEBUG - enable_profiling = false; -#endif - - // We want to disable profiling by default because it overwhelms LLDB. But - // the VM enables the same by default. In either case, we have some profiling - // flags. - if (enable_profiling) { - return {// This is the default. But just be explicit. - "--profiler", - // This instructs the profiler to walk C++ frames, and to include - // them in the profile. - "--profile-vm"}; - } else { - return {"--no-profiler"}; - } -} - -void PushBackAll(std::vector* args, - const char** argv, - size_t argc) { - for (size_t i = 0; i < argc; ++i) { - args->push_back(argv[i]); - } -} - -static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { - info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; - dart::bin::GetIOEmbedderInformation(info); - info->name = "Flutter"; -} - -fxl::RefPtr DartVM::ForProcess(Settings settings) { - return ForProcess(settings, nullptr, nullptr); -} - -static std::once_flag gVMInitialization; -static fxl::RefPtr gVM; - -fxl::RefPtr DartVM::ForProcess( - Settings settings, - fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot) { - std::call_once(gVMInitialization, [settings, // - vm_snapshot, // - isolate_snapshot // - ]() mutable { - if (!vm_snapshot) { - vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings); - } - if (!isolate_snapshot) { - isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings); - } - gVM = fxl::MakeRefCounted(settings, // - std::move(vm_snapshot), // - std::move(isolate_snapshot) // - ); - }); - return gVM; -} - -fxl::RefPtr DartVM::ForProcessIfInitialized() { - return gVM; -} - -DartVM::DartVM(const Settings& settings, - fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot) - : settings_(settings), - vm_snapshot_(std::move(vm_snapshot)), - isolate_snapshot_(std::move(isolate_snapshot)), - platform_kernel_mapping_( - std::make_unique(settings.kernel_snapshot_path)), - weak_factory_(this) { - TRACE_EVENT0("flutter", "DartVMInitializer"); - FXL_DLOG(INFO) << "Attempting Dart VM launch for mode: " - << (IsRunningPrecompiledCode() ? "AOT" : "Interpreter"); - - FXL_DCHECK(vm_snapshot_ && vm_snapshot_->IsValid()) - << "VM snapshot must be valid."; - - FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid()) - << "Isolate snapshot must be valid."; - - if (platform_kernel_mapping_->GetSize() > 0) { - // The platform kernel mapping lifetime is managed by this instance of the - // DartVM and hence will exceed that of the PlatformKernel. So provide an - // empty release callback. - Dart_ReleaseBufferCallback empty = [](auto arg) {}; - platform_kernel_ = reinterpret_cast(Dart_ReadKernelBinary( - platform_kernel_mapping_->GetMapping(), // buffer - platform_kernel_mapping_->GetSize(), // buffer size - empty // buffer deleter - )); - } - - { - TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); - dart::bin::BootstrapDartIo(); - - if (!settings.temp_directory_path.empty()) { - dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); - } - } - - std::vector args; - - // Instruct the VM to ignore unrecognized flags. - // There is a lot of diversity in a lot of combinations when it - // comes to the arguments the VM supports. And, if the VM comes across a flag - // it does not recognize, it exits immediately. - args.push_back("--ignore-unrecognized-flags"); - - for (const auto& profiler_flag : - ProfilingFlags(settings.enable_dart_profiling)) { - args.push_back(profiler_flag); - } - - PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); - - if (IsRunningPrecompiledCode()) { - PushBackAll(&args, kDartPrecompilationArgs, - arraysize(kDartPrecompilationArgs)); - } - - // Enable checked mode if we are not running precompiled code. We run non- - // precompiled code only in the debug product mode. - bool use_checked_mode = !settings.dart_non_checked_mode; - -#if !OS(FUCHSIA) - if (IsRunningPrecompiledCode()) { - use_checked_mode = false; - } -#endif // !OS(FUCHSIA) - -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - // Debug mode uses the JIT, disable code page write protection to avoid - // memory page protection changes before and after every compilation. - PushBackAll(&args, kDartWriteProtectCodeArgs, - arraysize(kDartWriteProtectCodeArgs)); -#endif - - const bool isolate_snapshot_is_dart_2 = - Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); - - const bool is_preview_dart2 = - platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; - - if (is_preview_dart2) { - FXL_DLOG(INFO) << "Dart 2 is enabled."; - } else { - FXL_DLOG(INFO) << "Dart 2 is NOT enabled. Platform kernel: " - << static_cast(platform_kernel_) - << " Isolate Snapshot is Dart 2: " - << isolate_snapshot_is_dart_2; - } - if (is_preview_dart2) { - PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); - if (use_checked_mode) { - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - } - } else if (use_checked_mode) { - FXL_DLOG(INFO) << "Checked mode is ON"; - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); - } else { - FXL_DLOG(INFO) << "Is not Dart 2 and Checked mode is OFF"; - } - - if (settings.start_paused) { - PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); - } - - if (settings.endless_trace_buffer || settings.trace_startup) { - // If we are tracing startup, make sure the trace buffer is endless so we - // don't lose early traces. - PushBackAll(&args, kDartEndlessTraceBufferArgs, - arraysize(kDartEndlessTraceBufferArgs)); - } - - if (settings.trace_startup) { - PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); - } - -#if defined(OS_FUCHSIA) - PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); -#endif - - for (size_t i = 0; i < settings.dart_flags.size(); i++) - args.push_back(settings.dart_flags[i].c_str()); - - FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); - - DartUI::InitForGlobal(); - - { - TRACE_EVENT0("flutter", "Dart_Initialize"); - Dart_InitializeParams params = {}; - params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; - params.vm_snapshot_data = vm_snapshot_->GetData()->GetSnapshotPointer(); - params.vm_snapshot_instructions = vm_snapshot_->GetInstructionsIfPresent(); - params.create = reinterpret_cast( - DartIsolate::DartIsolateCreateCallback); - params.shutdown = reinterpret_cast( - DartIsolate::DartIsolateShutdownCallback); - params.cleanup = reinterpret_cast( - DartIsolate::DartIsolateCleanupCallback); - params.thread_exit = ThreadExitCallback; - params.get_service_assets = GetVMServiceAssetsArchiveCallback; - params.entropy_source = DartIO::EntropySource; - char* init_error = Dart_Initialize(¶ms); - if (init_error) { - FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; - ::free(init_error); - } - // Send the earliest available timestamp in the application lifecycle to - // timeline. The difference between this timestamp and the time we render - // the very first frame gives us a good idea about Flutter's startup time. - // Use a duration event so about:tracing will consider this event when - // deciding the earliest event to use as time 0. - if (blink::engine_main_enter_ts != 0) { - Dart_TimelineEvent("FlutterEngineMainEnter", // label - blink::engine_main_enter_ts, // timestamp0 - blink::engine_main_enter_ts, // timestamp1_or_async_id - Dart_Timeline_Event_Duration, // event type - 0, // argument_count - nullptr, // argument_names - nullptr // argument_values - ); - } - } - - // Allow streaming of stdout and stderr by the Dart vm. - Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, - &ServiceStreamCancelCallback); - - Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); -} - -DartVM::~DartVM() { - if (Dart_CurrentIsolate() != nullptr) { - Dart_ExitIsolate(); - } - char* result = Dart_Cleanup(); - if (result != nullptr) { - FXL_LOG(ERROR) << "Could not cleanly shut down the Dart VM. Message: \"" - << result << "\"."; - free(result); - } -} - -const Settings& DartVM::GetSettings() const { - return settings_; -} - -DartVM::PlatformKernel* DartVM::GetPlatformKernel() const { - return platform_kernel_; -} - -const DartSnapshot& DartVM::GetVMSnapshot() const { - return *vm_snapshot_.get(); -} - -fxl::RefPtr DartVM::GetIsolateSnapshot() const { - return isolate_snapshot_; -} - -ServiceProtocol& DartVM::GetServiceProtocol() { - return service_protocol_; -} - -fxl::WeakPtr DartVM::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -} // namespace blink diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h deleted file mode 100644 index e8feb9ba1de92..0000000000000 --- a/runtime/dart_vm.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2017 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_RUNTIME_DART_VM_H_ -#define FLUTTER_RUNTIME_DART_VM_H_ - -#include -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/runtime/dart_isolate.h" -#include "flutter/runtime/dart_snapshot.h" -#include "flutter/runtime/service_protocol.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" -#include "lib/fxl/memory/ref_ptr.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace blink { - -class DartVM : public fxl::RefCountedThreadSafe { - public: - class PlatformKernel; - - static fxl::RefPtr ForProcess(Settings settings); - - static fxl::RefPtr ForProcess( - Settings settings, - fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot); - - static fxl::RefPtr ForProcessIfInitialized(); - - static bool IsRunningPrecompiledCode(); - - const Settings& GetSettings() const; - - PlatformKernel* GetPlatformKernel() const; - - const DartSnapshot& GetVMSnapshot() const; - - fxl::RefPtr GetIsolateSnapshot() const; - - fxl::WeakPtr GetWeakPtr(); - - ServiceProtocol& GetServiceProtocol(); - - private: - const Settings settings_; - const fxl::RefPtr vm_snapshot_; - const fxl::RefPtr isolate_snapshot_; - std::unique_ptr platform_kernel_mapping_; - PlatformKernel* platform_kernel_ = nullptr; - ServiceProtocol service_protocol_; - fxl::WeakPtrFactory weak_factory_; - - DartVM(const Settings& settings, - fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot); - - ~DartVM(); - - FRIEND_REF_COUNTED_THREAD_SAFE(DartVM); - FRIEND_MAKE_REF_COUNTED(DartVM); - FXL_DISALLOW_COPY_AND_ASSIGN(DartVM); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_VM_H_ diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc deleted file mode 100644 index 5b2f5e6ee8299..0000000000000 --- a/runtime/dart_vm_unittests.cc +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 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/runtime/dart_vm.h" -#include "gtest/gtest.h" - -namespace blink { - -TEST(DartVM, SimpleInitialization) { - Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - auto vm = DartVM::ForProcess(settings); - ASSERT_TRUE(vm); - ASSERT_EQ(vm, DartVM::ForProcess(settings)); - ASSERT_FALSE(DartVM::IsRunningPrecompiledCode()); - ASSERT_EQ(vm->GetPlatformKernel(), nullptr); -} - -} // namespace blink diff --git a/runtime/fixtures/simple_main.dart b/runtime/fixtures/simple_main.dart deleted file mode 100644 index 552dfbe344902..0000000000000 --- a/runtime/fixtures/simple_main.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2016 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. - -void simple_main() { - print("Hello"); -} diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index e7a8ab525329a..75796cd68697e 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -4,248 +4,192 @@ #include "flutter/runtime/runtime_controller.h" -#include "flutter/fml/message_loop.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "lib/tonic/dart_message_handler.h" -#ifdef ERROR -#undef ERROR -#endif +using tonic::DartState; namespace blink { -RuntimeController::RuntimeController( - RuntimeDelegate& p_client, - const DartVM* p_vm, - TaskRunners p_task_runners, - fml::WeakPtr p_resource_context, - fxl::RefPtr p_unref_queue) - : RuntimeController(p_client, - p_vm, - std::move(p_task_runners), - std::move(p_resource_context), - std::move(p_unref_queue), - WindowData{/* default window data */}) {} - -RuntimeController::RuntimeController( - RuntimeDelegate& p_client, - const DartVM* p_vm, - TaskRunners p_task_runners, - fml::WeakPtr p_resource_context, - fxl::RefPtr p_unref_queue, - WindowData p_window_data) - : client_(p_client), - vm_(p_vm), - task_runners_(p_task_runners), - resource_context_(p_resource_context), - unref_queue_(p_unref_queue), - window_data_(std::move(p_window_data)), - root_isolate_( - DartIsolate::CreateRootIsolate(vm_, - vm_->GetIsolateSnapshot(), - task_runners_, - std::make_unique(this), - resource_context_, - unref_queue_)) { - root_isolate_->SetReturnCodeCallback([this](uint32_t code) { - root_isolate_return_code_ = {true, code}; - }); - if (auto window = GetWindowIfAvailable()) { - tonic::DartState::Scope scope(root_isolate_.get()); - window->DidCreateIsolate(); - if (!FlushRuntimeStateToIsolate()) { - FXL_DLOG(ERROR) << "Could not setup intial isolate state."; - } - } else { - FXL_DCHECK(false) << "RuntimeController created without window binding."; - } - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); -} - -RuntimeController::~RuntimeController() { - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - if (root_isolate_) { - root_isolate_->SetReturnCodeCallback(nullptr); - auto result = root_isolate_->Shutdown(); - if (!result) { - FXL_DLOG(ERROR) << "Could not shutdown the root isolate."; - } - root_isolate_ = {}; - } +std::unique_ptr RuntimeController::Create( + RuntimeDelegate* client) { + return std::unique_ptr(new RuntimeController(client)); } -std::unique_ptr RuntimeController::Clone() const { - return std::unique_ptr(new RuntimeController( - client_, // - vm_, // - task_runners_, // - resource_context_, // - unref_queue_, // - window_data_ // - )); -} +RuntimeController::RuntimeController(RuntimeDelegate* client) + : client_(client) {} -bool RuntimeController::FlushRuntimeStateToIsolate() { - return SetViewportMetrics(window_data_.viewport_metrics) && - SetLocale(window_data_.language_code, window_data_.country_code) && - SetSemanticsEnabled(window_data_.semantics_enabled); -} +RuntimeController::~RuntimeController() {} -bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { - window_data_.viewport_metrics = metrics; +void RuntimeController::CreateDartController( + const std::string& script_uri, + const uint8_t* isolate_snapshot_data, + const uint8_t* isolate_snapshot_instr, + int dirfd) { + FXL_DCHECK(!dart_controller_); - if (auto window = GetWindowIfAvailable()) { - window->UpdateWindowMetrics(metrics); - return true; - } - return false; -} + dart_controller_.reset(new DartController()); + dart_controller_->CreateIsolateFor( + script_uri, isolate_snapshot_data, isolate_snapshot_instr, + std::make_unique(this, std::make_unique(this), + dirfd)); -bool RuntimeController::SetLocale(const std::string& language_code, - const std::string& country_code) { - window_data_.language_code = language_code; - window_data_.country_code = country_code; + UIDartState* dart_state = dart_controller_->dart_state(); + DartState::Scope scope(dart_state); + dart_state->window()->DidCreateIsolate(); + client_->DidCreateMainIsolate(dart_state->isolate()); - if (auto window = GetWindowIfAvailable()) { - window->UpdateLocale(window_data_.language_code, window_data_.country_code); - return true; - } + Window* window = GetWindow(); - return false; + window->UpdateLocale(language_code_, country_code_); + + if (semantics_enabled_) + window->UpdateSemanticsEnabled(semantics_enabled_); } -bool RuntimeController::SetUserSettingsData(const std::string& data) { - window_data_.user_settings_data = data; +void RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { + GetWindow()->UpdateWindowMetrics(metrics); +} - if (auto window = GetWindowIfAvailable()) { - window->UpdateUserSettingsData(window_data_.user_settings_data); - return true; - } +void RuntimeController::SetLocale(const std::string& language_code, + const std::string& country_code) { + if (language_code_ == language_code && country_code_ == country_code) + return; - return false; + language_code_ = language_code; + country_code_ = country_code; + GetWindow()->UpdateLocale(language_code_, country_code_); } -bool RuntimeController::SetSemanticsEnabled(bool enabled) { - window_data_.semantics_enabled = enabled; - - if (auto window = GetWindowIfAvailable()) { - window->UpdateSemanticsEnabled(window_data_.semantics_enabled); - return true; - } +void RuntimeController::SetUserSettingsData(const std::string& data) { + if (user_settings_data_ == data) + return; + user_settings_data_ = data; + GetWindow()->UpdateUserSettingsData(user_settings_data_); +} - return false; +void RuntimeController::SetSemanticsEnabled(bool enabled) { + if (semantics_enabled_ == enabled) + return; + semantics_enabled_ = enabled; + GetWindow()->UpdateSemanticsEnabled(semantics_enabled_); } -bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) { - if (auto window = GetWindowIfAvailable()) { - window->BeginFrame(frame_time); - return true; - } - return false; +void RuntimeController::BeginFrame(fxl::TimePoint frame_time) { + GetWindow()->BeginFrame(frame_time); } -bool RuntimeController::NotifyIdle(int64_t deadline) { - if (!root_isolate_) { - return false; +void RuntimeController::NotifyIdle(int64_t deadline) { + UIDartState* dart_state = dart_controller_->dart_state(); + if (!dart_state) { + return; } - - tonic::DartState::Scope scope(root_isolate_.get()); + DartState::Scope scope(dart_state); Dart_NotifyIdle(deadline); - return true; } -bool RuntimeController::DispatchPlatformMessage( +void RuntimeController::DispatchPlatformMessage( fxl::RefPtr message) { - if (auto window = GetWindowIfAvailable()) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", - "mode", "basic"); - window->DispatchPlatformMessage(std::move(message)); - return true; - } - return false; + TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", "mode", + "basic"); + GetWindow()->DispatchPlatformMessage(std::move(message)); } -bool RuntimeController::DispatchPointerDataPacket( +void RuntimeController::DispatchPointerDataPacket( const PointerDataPacket& packet) { - if (auto window = GetWindowIfAvailable()) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", - "mode", "basic"); - window->DispatchPointerDataPacket(packet); - return true; - } - return false; + TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", + "mode", "basic"); + GetWindow()->DispatchPointerDataPacket(packet); } -bool RuntimeController::DispatchSemanticsAction(int32_t id, +void RuntimeController::DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args) { TRACE_EVENT1("flutter", "RuntimeController::DispatchSemanticsAction", "mode", "basic"); - if (auto window = GetWindowIfAvailable()) { - window->DispatchSemanticsAction(id, action, std::move(args)); - return true; - } - return false; + GetWindow()->DispatchSemanticsAction(id, action, std::move(args)); } -Window* RuntimeController::GetWindowIfAvailable() { - return root_isolate_ ? root_isolate_->window() : nullptr; +Window* RuntimeController::GetWindow() { + return dart_controller_->dart_state()->window(); } std::string RuntimeController::DefaultRouteName() { - return client_.DefaultRouteName(); + return client_->DefaultRouteName(); } void RuntimeController::ScheduleFrame() { - client_.ScheduleFrame(); + client_->ScheduleFrame(); } void RuntimeController::Render(Scene* scene) { - client_.Render(scene->takeLayerTree()); + client_->Render(scene->takeLayerTree()); } void RuntimeController::UpdateSemantics(SemanticsUpdate* update) { - if (window_data_.semantics_enabled) { - client_.UpdateSemantics(update->takeNodes()); - } + if (semantics_enabled_) + client_->UpdateSemantics(update->takeNodes()); } void RuntimeController::HandlePlatformMessage( fxl::RefPtr message) { - client_.HandlePlatformMessage(std::move(message)); + client_->HandlePlatformMessage(std::move(message)); +} + +void RuntimeController::DidCreateSecondaryIsolate(Dart_Isolate isolate) { + client_->DidCreateSecondaryIsolate(isolate); +} + +void RuntimeController::DidShutdownMainIsolate() { + client_->DidShutdownMainIsolate(); } Dart_Port RuntimeController::GetMainPort() { - return root_isolate_ ? root_isolate_->main_port() : ILLEGAL_PORT; + if (!dart_controller_) { + return ILLEGAL_PORT; + } + if (!dart_controller_->dart_state()) { + return ILLEGAL_PORT; + } + return dart_controller_->dart_state()->main_port(); } std::string RuntimeController::GetIsolateName() { - return root_isolate_ ? root_isolate_->debug_name() : ""; + if (!dart_controller_) { + return ""; + } + if (!dart_controller_->dart_state()) { + return ""; + } + return dart_controller_->dart_state()->debug_name(); } bool RuntimeController::HasLivePorts() { - if (!root_isolate_) { + if (!dart_controller_) { + return false; + } + UIDartState* dart_state = dart_controller_->dart_state(); + if (!dart_state) { return false; } - tonic::DartState::Scope scope(root_isolate_.get()); + DartState::Scope scope(dart_state); return Dart_HasLivePorts(); } tonic::DartErrorHandleType RuntimeController::GetLastError() { - return root_isolate_ ? root_isolate_->message_handler().isolate_last_error() - : tonic::kNoError; -} - -fml::WeakPtr RuntimeController::GetRootIsolate() { - return root_isolate_; -} - -std::pair RuntimeController::GetRootIsolateReturnCode() { - return root_isolate_return_code_; + if (!dart_controller_) { + return tonic::kNoError; + } + UIDartState* dart_state = dart_controller_->dart_state(); + if (!dart_state) { + return tonic::kNoError; + } + return dart_state->message_handler().isolate_last_error(); } } // namespace blink diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 326c517f31db2..628bc699395c0 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -7,109 +7,72 @@ #include -#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_vm.h" #include "lib/fxl/macros.h" namespace blink { +class DartController; +class DartLibraryProvider; class Scene; class RuntimeDelegate; class View; class Window; -class RuntimeController final : public WindowClient { +class RuntimeController : public WindowClient, public IsolateClient { public: - RuntimeController(RuntimeDelegate& client, - const DartVM* vm, - TaskRunners task_runners, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue); - + static std::unique_ptr Create(RuntimeDelegate* client); ~RuntimeController(); - std::unique_ptr Clone() const; - - bool SetViewportMetrics(const ViewportMetrics& metrics); + void CreateDartController(const std::string& script_uri, + const uint8_t* isolate_snapshot_data, + const uint8_t* isolate_snapshot_instr, + int dirfd = -1); + DartController* dart_controller() const { return dart_controller_.get(); } - bool SetLocale(const std::string& language_code, + void SetViewportMetrics(const ViewportMetrics& metrics); + void SetLocale(const std::string& language_code, const std::string& country_code); + void SetUserSettingsData(const std::string& data); + void SetSemanticsEnabled(bool enabled); - bool SetUserSettingsData(const std::string& data); - - bool SetSemanticsEnabled(bool enabled); - - bool BeginFrame(fxl::TimePoint frame_time); - - bool NotifyIdle(int64_t deadline); + void BeginFrame(fxl::TimePoint frame_time); + void NotifyIdle(int64_t deadline); - bool DispatchPlatformMessage(fxl::RefPtr message); - - bool DispatchPointerDataPacket(const PointerDataPacket& packet); - - bool DispatchSemanticsAction(int32_t id, + void DispatchPlatformMessage(fxl::RefPtr message); + void DispatchPointerDataPacket(const PointerDataPacket& packet); + void DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args); Dart_Port GetMainPort(); - std::string GetIsolateName(); - bool HasLivePorts(); - tonic::DartErrorHandleType GetLastError(); - fml::WeakPtr GetRootIsolate(); + private: + explicit RuntimeController(RuntimeDelegate* client); - std::pair GetRootIsolateReturnCode(); + Window* GetWindow(); - private: - struct WindowData { - ViewportMetrics viewport_metrics; - std::string language_code; - std::string country_code; - std::string user_settings_data = "{}"; - bool semantics_enabled = false; - }; - - RuntimeDelegate& client_; - const DartVM* vm_; - TaskRunners task_runners_; - fml::WeakPtr resource_context_; - fxl::RefPtr unref_queue_; - WindowData window_data_; - fml::WeakPtr root_isolate_; - std::pair root_isolate_return_code_ = {false, 0}; - - RuntimeController(RuntimeDelegate& client, - const DartVM* vm, - TaskRunners task_runners, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue, - WindowData data); - - Window* GetWindowIfAvailable(); - - bool FlushRuntimeStateToIsolate(); - - // |blink::WindowClient| std::string DefaultRouteName() override; - - // |blink::WindowClient| void ScheduleFrame() override; - - // |blink::WindowClient| void Render(Scene* scene) override; - - // |blink::WindowClient| void UpdateSemantics(SemanticsUpdate* update) override; - - // |blink::WindowClient| void HandlePlatformMessage(fxl::RefPtr message) override; + void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; + void DidShutdownMainIsolate() override; + + RuntimeDelegate* client_; + std::string language_code_; + std::string country_code_; + std::string user_settings_data_ = "{}"; + bool semantics_enabled_ = false; + std::unique_ptr dart_controller_; + FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeController); }; diff --git a/runtime/runtime_delegate.cc b/runtime/runtime_delegate.cc index 902672be06d8f..6ec55c4c2e6a0 100644 --- a/runtime/runtime_delegate.cc +++ b/runtime/runtime_delegate.cc @@ -6,6 +6,12 @@ namespace blink { -RuntimeDelegate::~RuntimeDelegate() = default; +RuntimeDelegate::~RuntimeDelegate() {} + +void RuntimeDelegate::DidCreateMainIsolate(Dart_Isolate isolate) {} + +void RuntimeDelegate::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} + +void RuntimeDelegate::DidShutdownMainIsolate() {} } // namespace blink diff --git a/runtime/runtime_delegate.h b/runtime/runtime_delegate.h index c6d6c0a92b2b4..36650fe7fb70b 100644 --- a/runtime/runtime_delegate.h +++ b/runtime/runtime_delegate.h @@ -18,15 +18,15 @@ namespace blink { class RuntimeDelegate { public: virtual std::string DefaultRouteName() = 0; - virtual void ScheduleFrame(bool regenerate_layer_tree = true) = 0; - virtual void Render(std::unique_ptr layer_tree) = 0; - virtual void UpdateSemantics(blink::SemanticsNodeUpdates update) = 0; - virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; + virtual void DidCreateMainIsolate(Dart_Isolate isolate); + virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate); + virtual void DidShutdownMainIsolate(); + protected: virtual ~RuntimeDelegate(); }; diff --git a/runtime/runtime_init.cc b/runtime/runtime_init.cc new file mode 100644 index 0000000000000..eda66e5495aed --- /dev/null +++ b/runtime/runtime_init.cc @@ -0,0 +1,35 @@ +// Copyright 2016 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. + +#include "flutter/runtime/runtime_init.h" + +#include "flutter/glue/trace_event.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/runtime/platform_impl.h" +#include "flutter/sky/engine/public/web/Sky.h" +#include "lib/fxl/logging.h" + +namespace blink { +namespace { + +PlatformImpl* g_platform_impl = nullptr; + +} // namespace + +void InitRuntime(const uint8_t* vm_snapshot_data, + const uint8_t* vm_snapshot_instructions, + const uint8_t* default_isolate_snapshot_data, + const uint8_t* default_isolate_snapshot_instructions, + const std::string& bundle_path) { + TRACE_EVENT0("flutter", "InitRuntime"); + + FXL_CHECK(!g_platform_impl); + g_platform_impl = new PlatformImpl(); + InitEngine(g_platform_impl); + InitDartVM(vm_snapshot_data, vm_snapshot_instructions, + default_isolate_snapshot_data, + default_isolate_snapshot_instructions, bundle_path); +} + +} // namespace blink diff --git a/runtime/runtime_init.h b/runtime/runtime_init.h new file mode 100644 index 0000000000000..515ae284e3460 --- /dev/null +++ b/runtime/runtime_init.h @@ -0,0 +1,21 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_RUNTIME_RUNTIME_INIT_H_ +#define FLUTTER_RUNTIME_RUNTIME_INIT_H_ + +#include +#include + +namespace blink { + +void InitRuntime(const uint8_t* vm_snapshot_data, + const uint8_t* vm_snapshot_instructions, + const uint8_t* default_isolate_snapshot_data, + const uint8_t* default_isolate_snapshot_instructions, + const std::string& bundle_path); + +} // namespace blink + +#endif // FLUTTER_RUNTIME_RUNTIME_INIT_H_ diff --git a/runtime/service_protocol.cc b/runtime/service_protocol.cc deleted file mode 100644 index 030901e54269d..0000000000000 --- a/runtime/service_protocol.cc +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2017 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 RAPIDJSON_HAS_STDSTRING 1 - -#include "flutter/runtime/service_protocol.h" - -#include - -#include -#include -#include -#include - -#include "lib/fxl/synchronization/waitable_event.h" -#include "rapidjson/stringbuffer.h" -#include "rapidjson/writer.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace blink { - -const fxl::StringView ServiceProtocol::kScreenshotExtensionName = - "_flutter.screenshot"; -const fxl::StringView ServiceProtocol::kScreenshotSkpExtensionName = - "_flutter.screenshotSkp"; -const fxl::StringView ServiceProtocol::kRunInViewExtensionName = - "_flutter.runInView"; -const fxl::StringView ServiceProtocol::kFlushUIThreadTasksExtensionName = - "_flutter.flushUIThreadTasks"; -const fxl::StringView ServiceProtocol::kSetAssetBundlePathExtensionName = - "_flutter.setAssetBundlePath"; - -static constexpr fxl::StringView kViewIdPrefx = "_flutterView/"; -static constexpr fxl::StringView kListViewsExtensionName = "_flutter.listViews"; - -ServiceProtocol::ServiceProtocol() - : endpoints_({ - // Private - kListViewsExtensionName, - - // Public - kScreenshotExtensionName, - kScreenshotSkpExtensionName, - kRunInViewExtensionName, - kFlushUIThreadTasksExtensionName, - kSetAssetBundlePathExtensionName, - }) {} - -ServiceProtocol::~ServiceProtocol() { - ToggleHooks(false); -} - -void ServiceProtocol::AddHandler(Handler* handler) { - std::lock_guard lock(handlers_mutex_); - handlers_.emplace(handler); -} - -void ServiceProtocol::RemoveHandler(Handler* handler) { - std::lock_guard lock(handlers_mutex_); - handlers_.erase(handler); -} - -void ServiceProtocol::ToggleHooks(bool set) { - for (const auto& endpoint : endpoints_) { - Dart_RegisterRootServiceRequestCallback( - endpoint.data(), // method - &ServiceProtocol::HandleMessage, // callback - set ? this : nullptr // user data - ); - } -} - -static void WriteServerErrorResponse(rapidjson::Document& document, - const char* message) { - document.SetObject(); - document.AddMember("code", -32000, document.GetAllocator()); - rapidjson::Value message_value; - message_value.SetString(message, document.GetAllocator()); - document.AddMember("message", message_value, document.GetAllocator()); -} - -bool ServiceProtocol::HandleMessage(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - Handler::ServiceProtocolMap params; - for (intptr_t i = 0; i < num_params; i++) { - params[fxl::StringView{param_keys[i]}] = fxl::StringView{param_values[i]}; - } - -#ifndef NDEBUG - FXL_DLOG(INFO) << "Service protcol method: " << method; - FXL_DLOG(INFO) << "Arguments: " << params.size(); - for (intptr_t i = 0; i < num_params; i++) { - FXL_DLOG(INFO) << " " << i + 1 << ": " << param_keys[i] << " = " - << param_values[i]; - } -#endif // NDEBUG - - rapidjson::Document document; - bool result = HandleMessage(fxl::StringView{method}, // - params, // - static_cast(user_data), // - document // - ); - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - *json_object = strdup(buffer.GetString()); - -#ifndef NDEBUG - FXL_DLOG(INFO) << "Response: " << *json_object; - FXL_DLOG(INFO) << "RPC Result: " << result; -#endif // NDEBUG - - return result; -} - -bool ServiceProtocol::HandleMessage(fxl::StringView method, - const Handler::ServiceProtocolMap& params, - ServiceProtocol* service_protocol, - rapidjson::Document& response) { - if (service_protocol == nullptr) { - WriteServerErrorResponse(response, "Service protocol unavailable."); - return false; - } - - return service_protocol->HandleMessage(method, params, response); -} - -FXL_WARN_UNUSED_RESULT -static bool HandleMessageOnHandler( - ServiceProtocol::Handler* handler, - fxl::StringView method, - const ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& document) { - FXL_DCHECK(handler); - fxl::AutoResetWaitableEvent latch; - bool result = false; - fml::TaskRunner::RunNowOrPostTask( - handler->GetServiceProtocolHandlerTaskRunner(method), - [&latch, // - &result, // - &handler, // - &method, // - ¶ms, // - &document // - ]() { - result = - handler->HandleServiceProtocolMessage(method, params, document); - latch.Signal(); - }); - latch.Wait(); - return result; -} - -bool ServiceProtocol::HandleMessage(fxl::StringView method, - const Handler::ServiceProtocolMap& params, - rapidjson::Document& response) const { - if (method == kListViewsExtensionName) { - // So far, this is the only built-in method that does not forward to the - // dynamic set of handlers. - return HandleListViewsMethod(response); - } - - std::lock_guard lock(handlers_mutex_); - - if (handlers_.size() == 0) { - WriteServerErrorResponse(response, - "There are no running service protocol handlers."); - return false; - } - - // Find the handler by its "viewId" in the params. - auto view_id_param_found = params.find(fxl::StringView{"viewId"}); - if (view_id_param_found != params.end()) { - auto handler = reinterpret_cast(std::stoull( - view_id_param_found->second.data() + kViewIdPrefx.size(), nullptr, 16)); - auto handler_found = handlers_.find(handler); - if (handler_found != handlers_.end()) { - return HandleMessageOnHandler(handler, method, params, response); - } - } - - // Handle legacy calls that do not specify a handler in their args. - // TODO(chinmaygarde): Deprecate these calls in the tools and remove these - // fallbacks. - if (method == kScreenshotExtensionName || - method == kScreenshotSkpExtensionName) { - return HandleMessageOnHandler(*handlers_.begin(), method, params, response); - } - - WriteServerErrorResponse( - response, - "Service protocol could not handle or find a handler for the " - "requested method."); - return false; -} - -static std::string CreateFlutterViewID(intptr_t handler) { - std::stringstream stream; - stream << kViewIdPrefx << "0x" << std::hex << handler; - return stream.str(); -} - -static std::string CreateIsolateID(int64_t isolate) { - std::stringstream stream; - stream << "isolates/" << isolate; - return stream.str(); -} - -void ServiceProtocol::Handler::Description::Write( - Handler* handler, - rapidjson::Value& view, - rapidjson::MemoryPoolAllocator<>& allocator) const { - view.SetObject(); - view.AddMember("type", "FlutterView", allocator); - view.AddMember("id", CreateFlutterViewID(reinterpret_cast(handler)), - allocator); - if (isolate_port != 0) { - rapidjson::Value isolate(rapidjson::Type::kObjectType); - { - isolate.AddMember("type", "@Isolate", allocator); - isolate.AddMember("fixedId", true, allocator); - isolate.AddMember("id", CreateIsolateID(isolate_port), allocator); - isolate.AddMember("name", isolate_name, allocator); - isolate.AddMember("number", isolate_port, allocator); - } - view.AddMember("isolate", isolate, allocator); - } -} - -bool ServiceProtocol::HandleListViewsMethod( - rapidjson::Document& response) const { - // Collect handler descriptions on their respective task runners. - std::lock_guard lock(handlers_mutex_); - std::vector> descriptions; - for (const auto& handler : handlers_) { - fxl::AutoResetWaitableEvent latch; - Handler::Description description; - - fml::TaskRunner::RunNowOrPostTask( - handler->GetServiceProtocolHandlerTaskRunner( - kListViewsExtensionName), // task runner - [&latch, // - &description, // - &handler // - ]() { - description = handler->GetServiceProtocolDescription(); - latch.Signal(); - }); - latch.Wait(); - descriptions.emplace_back(std::make_pair( - reinterpret_cast(handler), std::move(description))); - } - - auto& allocator = response.GetAllocator(); - - // Construct the response objects. - response.SetObject(); - response.AddMember("type", "FlutterViewList", allocator); - - rapidjson::Value viewsList(rapidjson::Type::kArrayType); - for (const auto& description : descriptions) { - rapidjson::Value view(rapidjson::Type::kObjectType); - description.second.Write(reinterpret_cast(description.first), - view, allocator); - viewsList.PushBack(view, allocator); - } - - response.AddMember("views", viewsList, allocator); - - return true; -} - -} // namespace blink diff --git a/runtime/service_protocol.h b/runtime/service_protocol.h deleted file mode 100644 index 056f7389ea79a..0000000000000 --- a/runtime/service_protocol.h +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2017 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_RUNTIME_SERVICE_PROTOCOL_H_ -#define FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ - -#include -#include -#include -#include - -#include "flutter/fml/task_runner.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/strings/string_view.h" -#include "lib/fxl/synchronization/thread_annotations.h" -#include "third_party/rapidjson/rapidjson/document.h" - -namespace blink { - -class ServiceProtocol { - public: - static const fxl::StringView kScreenshotExtensionName; - static const fxl::StringView kScreenshotSkpExtensionName; - static const fxl::StringView kRunInViewExtensionName; - static const fxl::StringView kFlushUIThreadTasksExtensionName; - static const fxl::StringView kSetAssetBundlePathExtensionName; - - class Handler { - public: - struct Description { - int64_t isolate_port = 0 /* illegal port by default. */; - std::string isolate_name; - - Description() {} - - Description(int64_t p_isolate_port, std::string p_isolate_name) - : isolate_port(p_isolate_port), - isolate_name(std::move(p_isolate_name)) {} - - void Write(Handler* handler, - rapidjson::Value& value, - rapidjson::MemoryPoolAllocator<>& allocator) const; - }; - - using ServiceProtocolMap = std::map; - - virtual fxl::RefPtr GetServiceProtocolHandlerTaskRunner( - fxl::StringView method) const = 0; - - virtual Description GetServiceProtocolDescription() const = 0; - - virtual bool HandleServiceProtocolMessage( - fxl::StringView method, // one if the extension names specified above. - const ServiceProtocolMap& params, - rapidjson::Document& response) = 0; - }; - - ServiceProtocol(); - - ~ServiceProtocol(); - - void ToggleHooks(bool set); - - void AddHandler(Handler* handler); - - void RemoveHandler(Handler* handler); - - private: - const std::set endpoints_; - mutable std::mutex handlers_mutex_; - std::set handlers_; - - FXL_WARN_UNUSED_RESULT - static bool HandleMessage(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - FXL_WARN_UNUSED_RESULT - static bool HandleMessage(fxl::StringView method, - const Handler::ServiceProtocolMap& params, - ServiceProtocol* service_protocol, - rapidjson::Document& response); - FXL_WARN_UNUSED_RESULT - bool HandleMessage(fxl::StringView method, - const Handler::ServiceProtocolMap& params, - rapidjson::Document& response) const; - - FXL_WARN_UNUSED_RESULT - bool HandleListViewsMethod(rapidjson::Document& response) const; - - FXL_DISALLOW_COPY_AND_ASSIGN(ServiceProtocol); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 25edcfa23bd85..f9e25a3c8d6d7 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -2,8 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("$flutter_root/testing/testing.gni") - # Template to generate a dart embedder resource.cc file. # Required invoker inputs: # String output (name of output file) @@ -63,18 +61,18 @@ source_set("common") { "animator.h", "engine.cc", "engine.h", - "io_manager.cc", - "io_manager.h", - "isolate_configuration.cc", - "isolate_configuration.h", + "null_platform_view.cc", + "null_platform_view.h", + "null_rasterizer.cc", + "null_rasterizer.h", "picture_serializer.cc", "picture_serializer.h", "platform_view.cc", "platform_view.h", + "platform_view_service_protocol.cc", + "platform_view_service_protocol.h", "rasterizer.cc", "rasterizer.h", - "run_configuration.cc", - "run_configuration.h", "shell.cc", "shell.h", "skia_event_tracer_impl.cc", @@ -83,8 +81,8 @@ source_set("common") { "surface.h", "switches.cc", "switches.h", - "thread_host.cc", - "thread_host.h", + "tracing_controller.cc", + "tracing_controller.h", "vsync_waiter.cc", "vsync_waiter.h", "vsync_waiter_fallback.cc", @@ -92,6 +90,8 @@ source_set("common") { ] deps = [ + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/platform:libdart_platform", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", @@ -99,13 +99,10 @@ source_set("common") { "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", - "$flutter_root/sky/engine/platform", "$flutter_root/sky/engine/wtf", "$flutter_root/synchronization", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/platform:libdart_platform", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", @@ -115,23 +112,7 @@ source_set("common") { "//topaz/lib/tonic", ] - public_configs = [ "$flutter_root:config" ] -} - -executable("shell_unittests") { - testonly = true - - sources = [ - "shell_unittests.cc", - ] - deps = [ - ":common", - "$flutter_root/fml", - "$flutter_root/lib/snapshot", - "$flutter_root/testing", - "//garnet/public/lib/fxl", - "//third_party/dart/runtime:libdart_jit", - "//third_party/skia", - "//topaz/lib/tonic", + public_configs = [ + "$flutter_root:config", ] } diff --git a/shell/common/animator.cc b/shell/common/animator.cc index 60177a18f89ab..d5679a0160a86 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -4,18 +4,19 @@ #include "flutter/shell/common/animator.h" -#include "flutter/glue/trace_event.h" +#include "flutter/common/threads.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/time/stopwatch.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -Animator::Animator(Delegate& delegate, - blink::TaskRunners task_runners, - std::unique_ptr waiter) - : delegate_(delegate), - task_runners_(std::move(task_runners)), - waiter_(std::move(waiter)), +Animator::Animator(fml::WeakPtr rasterizer, + VsyncWaiter* waiter, + Engine* engine) + : rasterizer_(rasterizer), + waiter_(waiter), + engine_(engine), last_begin_frame_time_(), dart_frame_deadline_(0), layer_tree_pipeline_(fxl::MakeRefCounted(2)), @@ -78,6 +79,7 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, // If we still don't have valid continuation, the pipeline is currently // full because the consumer is being too slow. Try again at the next // frame interval. + TRACE_EVENT_INSTANT0("flutter", "ConsumerSlowDefer"); RequestFrame(); return; } @@ -92,13 +94,13 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, { TRACE_EVENT2("flutter", "Framework Workload", "mode", "basic", "frame", FrameParity()); - delegate_.OnAnimatorBeginFrame(*this, last_begin_frame_time_); + engine_->BeginFrame(last_begin_frame_time_); } if (!frame_scheduled_) { // We don't have another frame pending, so we're waiting on user input // or I/O. Allow the Dart VM 100 ms. - delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_ + 100000); + engine_->NotifyIdle(dart_frame_deadline_ + 100000); } } @@ -118,7 +120,15 @@ void Animator::Render(std::unique_ptr layer_tree) { // Commit the pending continuation. producer_continuation_.Complete(std::move(layer_tree)); - delegate_.OnAnimatorDraw(*this, layer_tree_pipeline_); + blink::Threads::Gpu()->PostTask([ + rasterizer = rasterizer_, pipeline = layer_tree_pipeline_, + frame_id = FrameParity() + ]() { + if (!rasterizer.get()) + return; + TRACE_EVENT2("flutter", "GPU Workload", "mode", "basic", "frame", frame_id); + rasterizer->Draw(pipeline); + }); } bool Animator::CanReuseLastLayerTree() { @@ -127,7 +137,10 @@ bool Animator::CanReuseLastLayerTree() { void Animator::DrawLastLayerTree() { pending_frame_semaphore_.Signal(); - delegate_.OnAnimatorDrawLastLayerTree(*this); + blink::Threads::Gpu()->PostTask([rasterizer = rasterizer_]() { + if (rasterizer.get()) + rasterizer->DrawLastLayerTree(); + }); } void Animator::RequestFrame(bool regenerate_layer_tree) { @@ -151,31 +164,31 @@ void Animator::RequestFrame(bool regenerate_layer_tree) { // started an expensive operation right after posting this message however. // To support that, we need edge triggered wakes on VSync. - task_runners_.GetUITaskRunner()->PostTask([self = weak_factory_.GetWeakPtr(), - frame_number = frame_number_]() { - if (!self.get()) { - return; - } - TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", frame_number); - self->AwaitVSync(); - }); + blink::Threads::UI()->PostTask( + [ self = weak_factory_.GetWeakPtr(), frame_number = frame_number_ ]() { + if (!self.get()) { + return; + } + TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", + frame_number); + self->AwaitVSync(); + }); frame_scheduled_ = true; } void Animator::AwaitVSync() { - waiter_->AsyncWaitForVsync( - [self = weak_factory_.GetWeakPtr()](fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time) { - if (self) { - if (self->CanReuseLastLayerTree()) { - self->DrawLastLayerTree(); - } else { - self->BeginFrame(frame_start_time, frame_target_time); - } - } - }); + waiter_->AsyncWaitForVsync([self = weak_factory_.GetWeakPtr()]( + fxl::TimePoint frame_start_time, fxl::TimePoint frame_target_time) { + if (self) { + if (self->CanReuseLastLayerTree()) { + self->DrawLastLayerTree(); + } else { + self->BeginFrame(frame_start_time, frame_target_time); + } + } + }); - delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_); + engine_->NotifyIdle(dart_frame_deadline_); } } // namespace shell diff --git a/shell/common/animator.h b/shell/common/animator.h index 53b2ac6884158..bc2ee21441b29 100644 --- a/shell/common/animator.h +++ b/shell/common/animator.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_SHELL_COMMON_ANIMATOR_H_ #define FLUTTER_SHELL_COMMON_ANIMATOR_H_ -#include "flutter/common/task_runners.h" +#include "flutter/shell/common/engine.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/vsync_waiter.h" #include "flutter/synchronization/pipeline.h" @@ -16,29 +16,18 @@ namespace shell { -class Animator final { +class Animator { public: - class Delegate { - public: - virtual void OnAnimatorBeginFrame(const Animator& animator, - fxl::TimePoint frame_time) = 0; - - virtual void OnAnimatorNotifyIdle(const Animator& animator, - int64_t deadline) = 0; - - virtual void OnAnimatorDraw( - const Animator& animator, - fxl::RefPtr> pipeline) = 0; - - virtual void OnAnimatorDrawLastLayerTree(const Animator& animator) = 0; - }; - - Animator(Delegate& delegate, - blink::TaskRunners task_runners, - std::unique_ptr waiter); + Animator(fml::WeakPtr rasterizer, + VsyncWaiter* waiter, + Engine* engine); ~Animator(); + void set_rasterizer(fml::WeakPtr rasterizer) { + rasterizer_ = rasterizer; + } + void RequestFrame(bool regenerate_layer_tree = true); void Render(std::unique_ptr layer_tree); @@ -62,9 +51,9 @@ class Animator final { const char* FrameParity(); - Delegate& delegate_; - blink::TaskRunners task_runners_; - std::unique_ptr waiter_; + fml::WeakPtr rasterizer_; + VsyncWaiter* waiter_; + Engine* engine_; fxl::TimePoint last_begin_frame_time_; int64_t dart_frame_deadline_; @@ -78,7 +67,7 @@ class Animator final { bool dimension_change_pending_; SkISize last_layer_tree_size_; - fxl::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(Animator); }; diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 3d6fd496d3fa9..3629b729c29f7 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -4,20 +4,47 @@ #include "flutter/shell/common/engine.h" +#if OS(WIN) +#include +#include +#define access _access +#define R_OK 0x4 + +#ifndef S_ISDIR +#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) +#endif + +#ifndef S_ISREG +#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) +#endif + +#else +#include +#include +#include +#endif // OS(WIN) + +#include +#include #include #include +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/unzipper_provider.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/assets/asset_provider.h" #include "flutter/common/settings.h" +#include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/runtime/asset_font_selector.h" -#include "flutter/runtime/platform_impl.h" +#include "flutter/runtime/dart_controller.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/runtime/runtime_init.h" #include "flutter/runtime/test_font_selector.h" #include "flutter/shell/common/animator.h" #include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" #include "flutter/sky/engine/public/web/Sky.h" #include "lib/fxl/files/eintr_wrapper.h" #include "lib/fxl/files/file.h" @@ -28,208 +55,380 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" -#ifdef ERROR -#undef ERROR +namespace shell { +namespace { + +constexpr char kAssetChannel[] = "flutter/assets"; +constexpr char kLifecycleChannel[] = "flutter/lifecycle"; +constexpr char kNavigationChannel[] = "flutter/navigation"; +constexpr char kLocalizationChannel[] = "flutter/localization"; +constexpr char kSettingsChannel[] = "flutter/settings"; + +#if OS(WIN) +void FindAndReplaceInPlace(std::string& str, + const std::string& findStr, + const std::string& replaceStr) { + size_t pos = 0; + while ((pos = str.find(findStr, pos)) != std::string::npos) { + str.replace(pos, findStr.length(), replaceStr); + pos += replaceStr.length(); + } +} #endif -namespace shell { +std::string SanitizePath(const std::string& path) { +#if OS(WIN) + std::string sanitized = path; + FindAndReplaceInPlace(sanitized, "\\\\", "/"); + if ((sanitized.length() > 2) && (sanitized[1] == ':')) { + // Path begins with a drive letter. + sanitized = '/' + sanitized; + } + return sanitized; +#else + return path; +#endif +} -static constexpr char kAssetChannel[] = "flutter/assets"; -static constexpr char kLifecycleChannel[] = "flutter/lifecycle"; -static constexpr char kNavigationChannel[] = "flutter/navigation"; -static constexpr char kLocalizationChannel[] = "flutter/localization"; -static constexpr char kSettingsChannel[] = "flutter/settings"; - -Engine::Engine(Delegate& delegate, - const blink::DartVM& vm, - blink::TaskRunners task_runners, - blink::Settings settings, - std::unique_ptr animator, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue) - : delegate_(delegate), - settings_(std::move(settings)), - animator_(std::move(animator)), - legacy_sky_platform_(settings_.using_blink ? new blink::PlatformImpl() - : nullptr), - load_script_error_(tonic::kNoError), - activity_running_(false), - have_surface_(false), - weak_factory_(this) { - weak_prototype_ = weak_factory_.GetWeakPtr(); +bool PathExists(const std::string& path) { + return access(path.c_str(), R_OK) == 0; +} - if (legacy_sky_platform_) { - // TODO: Remove this legacy call along with the platform. This is what makes - // the engine unable to run from multiple threads in the legacy - // configuration. - blink::InitEngine(legacy_sky_platform_.get()); +std::string FindPackagesPath(const std::string& main_dart) { + std::string directory = files::GetDirectoryName(main_dart); + std::string packages_path = directory + "/.packages"; + if (!PathExists(packages_path)) { + directory = files::GetDirectoryName(directory); + packages_path = directory + "/.packages"; + if (!PathExists(packages_path)) + packages_path = std::string(); } + return packages_path; +} - // Runtime controller is initialized here because it takes a reference to this - // object as its delegate. The delegate may be called in the constructor and - // we want to be fully initilazed by that point. - runtime_controller_ = std::make_unique( - *this, // runtime delegate - &vm, // VM - std::move(task_runners), // task runners - std::move(resource_context), // resource context - std::move(unref_queue) // skia unref queue - ); +std::string GetScriptUriFromPath(const std::string& path) { + return "file://" + SanitizePath(path); } -Engine::~Engine() { - if (legacy_sky_platform_) { - blink::ShutdownEngine(/* legacy_sky_platform_ */); - } +} // namespace + +Engine::Engine(PlatformView* platform_view) + : platform_view_(platform_view->GetWeakPtr()), + animator_(std::make_unique( + platform_view->rasterizer().GetWeakRasterizerPtr(), + platform_view->GetVsyncWaiter(), + this)), + load_script_error_(tonic::kNoError), + user_settings_data_("{}"), + activity_running_(false), + have_surface_(false), + weak_factory_(this) {} + +Engine::~Engine() {} + +void Engine::set_rasterizer(fml::WeakPtr rasterizer) { + animator_->set_rasterizer(rasterizer); } -fml::WeakPtr Engine::GetWeakPtr() const { - return weak_prototype_; +fml::WeakPtr Engine::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); } -bool Engine::UpdateAssetManager( - fxl::RefPtr new_asset_manager) { - if (asset_manager_ == new_asset_manager) { - return false; +#if !FLUTTER_AOT +#elif OS(IOS) +#elif OS(ANDROID) +// TODO(bkonyi): do we even get here for Windows? +static const uint8_t* MemMapSnapshot(const std::string& aot_snapshot_path, + const std::string& default_file_name, + const std::string& settings_file_name, + bool executable) { + std::string asset_path; + if (settings_file_name.empty()) { + asset_path = aot_snapshot_path + "/" + default_file_name; + } else { + asset_path = aot_snapshot_path + "/" + settings_file_name; } - asset_manager_ = new_asset_manager; +#if OS(WIN) + HANDLE file_handle_ = + CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, + FILE_SHARE_READ, nullptr, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); - if (!asset_manager_) { - return false; + if (file_handle_ == INVALID_HANDLE_VALUE) { + return; } - if (settings_.using_blink) { - // Using blink as the text engine. - blink::FontFallbackList::SetUseTestFonts(settings_.use_test_fonts); - } else { - // Using libTXT as the text engine. - if (settings_.use_test_fonts) { - blink::FontCollection::ForProcess().RegisterTestFonts(); - } else { - blink::FontCollection::ForProcess().RegisterFonts(*asset_manager_.get()); - } + size_ = GetFileSize(file_handle_, nullptr); + if (size_ == INVALID_FILE_SIZE) { + size_ = 0; + return; } - return true; -} + int mapping_flags = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; + mapping_handle_ = CreateFileMapping(file_handle_, nullptr, mapping_flags, 0, + size_, nullptr); -bool Engine::Restart(RunConfiguration configuration) { - TRACE_EVENT0("flutter", "Engine::Restart"); - if (!configuration.IsValid()) { - FXL_LOG(ERROR) << "Engine run configuration was invalid."; - return false; - } - runtime_controller_ = runtime_controller_->Clone(); - UpdateAssetManager(nullptr); - return Run(std::move(configuration)); -} + CloseHandle(file_handle_); -bool Engine::Run(RunConfiguration configuration) { - if (!configuration.IsValid()) { - FXL_LOG(ERROR) << "Engine run configuration was invalid."; - return false; + if (mapping_handle_ == INVALID_HANDLE_VALUE) { + return; } - if (!PrepareAndLaunchIsolate(std::move(configuration))) { - return false; + int access_flags = FILE_MAP_READ; + if (executable) { + access_flags |= FILE_MAP_EXECUTE; } + auto mapping = MapViewOfFile(mapping_handle_, access_flags, 0, 0, size_); - auto isolate = runtime_controller_->GetRootIsolate(); + if (mapping == INVALID_HANDLE_VALUE) { + CloseHandle(mapping_handle_); + mapping_handle_ = INVALID_HANDLE_VALUE; + return; + } - bool isolate_running = - isolate && isolate->GetPhase() == blink::DartIsolate::Phase::Running; + void* symbol = static_cast(mapping); + if (symbol == NULL) { + return nullptr; + } +#else + struct stat info; + if (stat(asset_path.c_str(), &info) < 0) { + return nullptr; + } + int64_t asset_size = info.st_size; - if (isolate_running) { - tonic::DartState::Scope scope(isolate.get()); + fxl::UniqueFD fd(HANDLE_EINTR(open(asset_path.c_str(), O_RDONLY))); + if (fd.get() == -1) { + return nullptr; + } - if (settings_.root_isolate_create_callback) { - settings_.root_isolate_create_callback(); - } + int mmap_flags = PROT_READ; + if (executable) + mmap_flags |= PROT_EXEC; - if (settings_.root_isolate_shutdown_callback) { - isolate->AddIsolateShutdownCallback( - settings_.root_isolate_shutdown_callback); - } + void* symbol = mmap(NULL, asset_size, mmap_flags, MAP_PRIVATE, fd.get(), 0); + if (symbol == MAP_FAILED) { + return nullptr; + } +#endif + return reinterpret_cast(symbol); +} +#endif - // Blink uses a per isolate font selector. - if (settings_.using_blink) { - if (settings_.use_test_fonts) { - blink::TestFontSelector::Install(); - } else { - blink::AssetFontSelector::Install(asset_manager_); - } +static const uint8_t* default_isolate_snapshot_data = nullptr; +static const uint8_t* default_isolate_snapshot_instr = nullptr; + +void Engine::Init(const std::string& bundle_path) { + const uint8_t* vm_snapshot_data; + const uint8_t* vm_snapshot_instr; +#if !FLUTTER_AOT + vm_snapshot_data = ::kDartVmSnapshotData; + vm_snapshot_instr = ::kDartVmSnapshotInstructions; + default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; + default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; +#elif OS(IOS) + const char* kDartApplicationLibraryPath = "App.framework/App"; + const char* application_library_path = kDartApplicationLibraryPath; + const blink::Settings& settings = blink::Settings::Get(); + const std::string& application_library_path_setting = + settings.application_library_path; + if (!application_library_path_setting.empty()) { + application_library_path = application_library_path_setting.c_str(); + } + dlerror(); // clear previous errors on thread + void* library_handle = dlopen(application_library_path, RTLD_NOW); + const char* err = dlerror(); + if (err != nullptr) { + FXL_LOG(FATAL) << "dlopen failed: " << err; + } + vm_snapshot_data = reinterpret_cast( + dlsym(library_handle, "kDartVmSnapshotData")); + vm_snapshot_instr = reinterpret_cast( + dlsym(library_handle, "kDartVmSnapshotInstructions")); + default_isolate_snapshot_data = reinterpret_cast( + dlsym(library_handle, "kDartIsolateSnapshotData")); + default_isolate_snapshot_instr = reinterpret_cast( + dlsym(library_handle, "kDartIsolateSnapshotInstructions")); +#elif OS(ANDROID) || OS(WIN) + const blink::Settings& settings = blink::Settings::Get(); + const std::string& aot_shared_library_path = settings.aot_shared_library_path; + const std::string& aot_snapshot_path = settings.aot_snapshot_path; + + if (!aot_shared_library_path.empty()) { + FXL_CHECK(aot_snapshot_path.empty()); + dlerror(); // clear previous errors on thread + void* library_handle = dlopen(aot_shared_library_path.c_str(), RTLD_NOW); + const char* err = dlerror(); + if (err != nullptr) { + FXL_LOG(FATAL) << "dlopen failed: " << err; } + vm_snapshot_data = reinterpret_cast( + dlsym(library_handle, "_kDartVmSnapshotData")); + vm_snapshot_instr = reinterpret_cast( + dlsym(library_handle, "_kDartVmSnapshotInstructions")); + default_isolate_snapshot_data = reinterpret_cast( + dlsym(library_handle, "_kDartIsolateSnapshotData")); + default_isolate_snapshot_instr = reinterpret_cast( + dlsym(library_handle, "_kDartIsolateSnapshotInstructions")); + } else { + FXL_CHECK(!aot_snapshot_path.empty()); + vm_snapshot_data = + MemMapSnapshot(aot_snapshot_path, "vm_snapshot_data", + settings.aot_vm_snapshot_data_filename, false); + vm_snapshot_instr = + MemMapSnapshot(aot_snapshot_path, "vm_snapshot_instr", + settings.aot_vm_snapshot_instr_filename, true); + default_isolate_snapshot_data = + MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_data", + settings.aot_isolate_snapshot_data_filename, false); + default_isolate_snapshot_instr = + MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_instr", + settings.aot_isolate_snapshot_instr_filename, true); } - - return isolate_running; +#else +#error Unknown OS +#endif + blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, + default_isolate_snapshot_data, + default_isolate_snapshot_instr, bundle_path); } -bool Engine::PrepareAndLaunchIsolate(RunConfiguration configuration) { - TRACE_EVENT0("flutter", "Engine::PrepareAndLaunchIsolate"); +const std::string Engine::main_entrypoint_ = "main"; - UpdateAssetManager(configuration.GetAssetManager()); - - auto isolate_configuration = configuration.TakeIsolateConfiguration(); - - auto isolate = runtime_controller_->GetRootIsolate(); +void Engine::RunBundle(const std::string& bundle_path, + const std::string& entrypoint, + bool reuse_runtime_controller) { + TRACE_EVENT0("flutter", "Engine::RunBundle"); + ConfigureAssetBundle(bundle_path); + DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, + reuse_runtime_controller); +} - if (!isolate_configuration->PrepareIsolate(isolate)) { - FXL_DLOG(ERROR) << "Could not prepare to run the isolate."; - return false; +void Engine::DoRunBundle(const std::string& script_uri, + const std::string& entrypoint, + bool reuse_runtime_controller) { + ConfigureRuntime(script_uri, reuse_runtime_controller); + if (blink::IsRunningPrecompiledCode()) { + runtime_->dart_controller()->RunFromPrecompiledSnapshot(entrypoint); + } else { + std::vector kernel; + if (GetAssetAsBuffer(blink::kKernelAssetKey, &kernel)) { + runtime_->dart_controller()->RunFromKernel(kernel, entrypoint); + return; + } + std::vector snapshot; + if (!GetAssetAsBuffer(blink::kSnapshotAssetKey, &snapshot)) + return; + runtime_->dart_controller()->RunFromScriptSnapshot( + snapshot.data(), snapshot.size(), entrypoint); } +} - if (!isolate->Run(configuration.GetEntrypoint())) { - FXL_DLOG(ERROR) << "Could not run the isolate."; - return false; +// TODO(jsimmons): merge this with RunBundle +void Engine::RunBundleWithAssets( + fxl::RefPtr asset_provider, + const std::string& bundle_path, + const std::string& entrypoint, + bool reuse_runtime_controller) { + TRACE_EVENT0("flutter", "Engine::RunBundleWithAssets"); + asset_provider_ = asset_provider; + DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, + reuse_runtime_controller); +} + +void Engine::RunBundleAndSource(const std::string& bundle_path, + const std::string& main, + const std::string& packages, + bool reuse_runtime_controller) { + TRACE_EVENT0("flutter", "Engine::RunBundleAndSource"); + FXL_CHECK(!blink::IsRunningPrecompiledCode()) + << "Cannot run from source in a precompiled build."; + std::string packages_path = packages; + if (packages_path.empty()) + packages_path = FindPackagesPath(main); + + if (!bundle_path.empty()) + ConfigureAssetBundle(bundle_path); + + ConfigureRuntime(main, reuse_runtime_controller); + + if (blink::GetKernelPlatformBinary() != nullptr) { + std::vector kernel; + if (!files::ReadFileToVector(main, &kernel)) { + load_script_error_ = tonic::kUnknownErrorType; + } + load_script_error_ = runtime_->dart_controller()->RunFromKernel(kernel); + } else { + load_script_error_ = + runtime_->dart_controller()->RunFromSource(main, packages_path); } - - return true; } void Engine::BeginFrame(fxl::TimePoint frame_time) { TRACE_EVENT0("flutter", "Engine::BeginFrame"); - runtime_controller_->BeginFrame(frame_time); + if (runtime_) + runtime_->BeginFrame(frame_time); } void Engine::NotifyIdle(int64_t deadline) { TRACE_EVENT0("flutter", "Engine::NotifyIdle"); - runtime_controller_->NotifyIdle(deadline); + if (runtime_) + runtime_->NotifyIdle(deadline); +} + +void Engine::RunFromSource(const std::string& main, + const std::string& packages, + const std::string& bundle_path) { + RunBundleAndSource(bundle_path, main, packages); } -std::pair Engine::GetUIIsolateReturnCode() { - return runtime_controller_->GetRootIsolateReturnCode(); +void Engine::SetAssetBundlePath(const std::string& bundle_path) { + TRACE_EVENT0("flutter", "Engine::SetAssetBundlePath"); + ConfigureAssetBundle(bundle_path); } Dart_Port Engine::GetUIIsolateMainPort() { - return runtime_controller_->GetMainPort(); + if (!runtime_) + return ILLEGAL_PORT; + return runtime_->GetMainPort(); } std::string Engine::GetUIIsolateName() { - return runtime_controller_->GetIsolateName(); + if (!runtime_) { + return ""; + } + return runtime_->GetIsolateName(); } bool Engine::UIIsolateHasLivePorts() { - return runtime_controller_->HasLivePorts(); + if (!runtime_) + return false; + return runtime_->HasLivePorts(); } tonic::DartErrorHandleType Engine::GetUIIsolateLastError() { - return runtime_controller_->GetLastError(); + if (!runtime_) + return tonic::kNoError; + return runtime_->GetLastError(); } tonic::DartErrorHandleType Engine::GetLoadScriptError() { return load_script_error_; } -void Engine::OnOutputSurfaceCreated() { +void Engine::OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation) { + blink::Threads::Gpu()->PostTask(gpu_continuation); have_surface_ = true; StartAnimatorIfPossible(); - ScheduleFrame(); + if (runtime_) + ScheduleFrame(); } -void Engine::OnOutputSurfaceDestroyed() { +void Engine::OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation) { have_surface_ = false; StopAnimator(); + blink::Threads::Gpu()->PostTask(gpu_continuation); } void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { @@ -237,7 +436,8 @@ void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { viewport_metrics_.physical_height != metrics.physical_height || viewport_metrics_.physical_width != metrics.physical_width; viewport_metrics_ = metrics; - runtime_controller_->SetViewportMetrics(viewport_metrics_); + if (runtime_) + runtime_->SetViewportMetrics(viewport_metrics_); if (animator_) { if (dimensions_changed) animator_->SetDimensionChangePending(); @@ -259,7 +459,8 @@ void Engine::DispatchPlatformMessage( return; } - if (runtime_controller_->DispatchPlatformMessage(std::move(message))) { + if (runtime_) { + runtime_->DispatchPlatformMessage(std::move(message)); return; } @@ -292,6 +493,7 @@ bool Engine::HandleLifecyclePlatformMessage(blink::PlatformMessage* message) { bool Engine::HandleNavigationPlatformMessage( fxl::RefPtr message) { + FXL_DCHECK(!runtime_); const auto& data = message->data(); rapidjson::Document document; @@ -330,33 +532,99 @@ bool Engine::HandleLocalizationPlatformMessage( if (!language.IsString() || !country.IsString()) return false; - return runtime_controller_->SetLocale(language.GetString(), - country.GetString()); + language_code_ = language.GetString(); + country_code_ = country.GetString(); + if (runtime_) + runtime_->SetLocale(language_code_, country_code_); + return true; } void Engine::HandleSettingsPlatformMessage(blink::PlatformMessage* message) { const auto& data = message->data(); std::string jsonData(reinterpret_cast(data.data()), data.size()); - if (runtime_controller_->SetUserSettingsData(std::move(jsonData)) && - have_surface_) { - ScheduleFrame(); + user_settings_data_ = jsonData; + if (runtime_) { + runtime_->SetUserSettingsData(user_settings_data_); + if (have_surface_) + ScheduleFrame(); } } -void Engine::DispatchPointerDataPacket(const blink::PointerDataPacket& packet) { - runtime_controller_->DispatchPointerDataPacket(packet); +void Engine::DispatchPointerDataPacket(const PointerDataPacket& packet) { + if (runtime_) + runtime_->DispatchPointerDataPacket(packet); } void Engine::DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args) { - runtime_controller_->DispatchSemanticsAction(id, action, std::move(args)); + if (runtime_) + runtime_->DispatchSemanticsAction(id, action, std::move(args)); } void Engine::SetSemanticsEnabled(bool enabled) { - runtime_controller_->SetSemanticsEnabled(enabled); + semantics_enabled_ = enabled; + if (runtime_) + runtime_->SetSemanticsEnabled(semantics_enabled_); +} + +void Engine::ConfigureAssetBundle(const std::string& path) { + asset_provider_ = fxl::MakeRefCounted(path); + + struct stat stat_result = {}; + + // TODO(abarth): We should reset directory_asset_bundle_, but that might break + // custom font loading in hot reload. + + if (::stat(path.c_str(), &stat_result) != 0) { + FXL_LOG(INFO) << "Could not configure asset bundle at path: " << path; + return; + } + + std::string flx_path; + if (S_ISDIR(stat_result.st_mode)) { + flx_path = files::GetDirectoryName(path) + "/app.flx"; + } else if (S_ISREG(stat_result.st_mode)) { + flx_path = path; + } + + if (PathExists(flx_path)) { + asset_store_ = fxl::MakeRefCounted( + blink::GetUnzipperProviderForPath(flx_path)); + } +} + +void Engine::ConfigureRuntime(const std::string& script_uri, + bool reuse_runtime_controller) { + if (runtime_ && reuse_runtime_controller) { + return; + } + runtime_ = blink::RuntimeController::Create(this); + runtime_->CreateDartController(std::move(script_uri), + default_isolate_snapshot_data, + default_isolate_snapshot_instr); + runtime_->SetViewportMetrics(viewport_metrics_); + runtime_->SetLocale(language_code_, country_code_); + runtime_->SetUserSettingsData(user_settings_data_); + runtime_->SetSemanticsEnabled(semantics_enabled_); +} + +void Engine::DidCreateMainIsolate(Dart_Isolate isolate) { + if (blink::Settings::Get().use_test_fonts) { + blink::TestFontSelector::Install(); + if (!blink::Settings::Get().using_blink) + blink::FontCollection::ForProcess().RegisterTestFonts(); + } else if (asset_provider_) { + blink::AssetFontSelector::Install(asset_provider_); + if (!blink::Settings::Get().using_blink) { + blink::FontCollection::ForProcess().RegisterFontsFromAssetProvider( + asset_provider_); + } + } } +void Engine::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} + void Engine::StopAnimator() { animator_->Stop(); } @@ -391,34 +659,49 @@ void Engine::Render(std::unique_ptr layer_tree) { } void Engine::UpdateSemantics(blink::SemanticsNodeUpdates update) { - delegate_.OnEngineUpdateSemantics(*this, std::move(update)); + blink::Threads::Platform()->PostTask(fxl::MakeCopyable([ + platform_view = platform_view_.lock(), update = std::move(update) + ]() mutable { + if (platform_view) + platform_view->UpdateSemantics(std::move(update)); + })); } void Engine::HandlePlatformMessage( fxl::RefPtr message) { if (message->channel() == kAssetChannel) { HandleAssetPlatformMessage(std::move(message)); - } else { - delegate_.OnEngineHandlePlatformMessage(*this, std::move(message)); + return; } + blink::Threads::Platform()->PostTask([ + platform_view = platform_view_.lock(), message = std::move(message) + ]() mutable { + if (platform_view) + platform_view->HandlePlatformMessage(std::move(message)); + }); } void Engine::HandleAssetPlatformMessage( fxl::RefPtr message) { fxl::RefPtr response = message->response(); - if (!response) { + if (!response) return; - } const auto& data = message->data(); std::string asset_name(reinterpret_cast(data.data()), data.size()); - std::vector asset_data; - if (asset_manager_ && asset_manager_->GetAsBuffer(asset_name, &asset_data)) { + if (GetAssetAsBuffer(asset_name, &asset_data)) { response->Complete(std::move(asset_data)); } else { response->CompleteEmpty(); } } +bool Engine::GetAssetAsBuffer(const std::string& name, + std::vector* data) { + return ((asset_provider_ && + asset_provider_->GetAsBuffer(name, data)) || + (asset_store_ && asset_store_->GetAsBuffer(name, data))); +} + } // namespace shell diff --git a/shell/common/engine.h b/shell/common/engine.h index ede442ee3e8a4..a0c5183338a43 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -5,144 +5,131 @@ #ifndef SHELL_COMMON_ENGINE_H_ #define SHELL_COMMON_ENGINE_H_ -#include -#include - -#include "flutter/assets/asset_manager.h" -#include "flutter/common/task_runners.h" -#include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/assets/asset_provider.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/runtime/dart_vm.h" -#include "flutter/runtime/platform_impl.h" #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" -#include "flutter/shell/common/animator.h" #include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/run_configuration.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkPicture.h" +namespace blink { +class DirectoryAssetBundle; +class ZipAssetBundle; +} // namespace blink + namespace shell { +class PlatformView; +class Animator; +using PointerDataPacket = blink::PointerDataPacket; -class Engine final : public blink::RuntimeDelegate { +class Engine : public blink::RuntimeDelegate { public: - class Delegate { - public: - virtual void OnEngineUpdateSemantics( - const Engine& engine, - blink::SemanticsNodeUpdates update) = 0; - - virtual void OnEngineHandlePlatformMessage( - const Engine& engine, - fxl::RefPtr message) = 0; - }; - - Engine(Delegate& delegate, - const blink::DartVM& vm, - blink::TaskRunners task_runners, - blink::Settings settings, - std::unique_ptr animator, - fml::WeakPtr resource_context, - fxl::RefPtr unref_queue); + explicit Engine(PlatformView* platform_view); ~Engine() override; - fml::WeakPtr GetWeakPtr() const; + fml::WeakPtr GetWeakPtr(); - FXL_WARN_UNUSED_RESULT - bool Run(RunConfiguration configuration); + static void Init(const std::string& bundle_path); - // Used to "cold reload" a running application where the shell (along with the - // platform view and its rasterizer bindings) remains the same but the root - // isolate is torn down and restarted with the new configuration. Only used in - // the development workflow. - FXL_WARN_UNUSED_RESULT - bool Restart(RunConfiguration configuration); + void RunBundle(const std::string& bundle_path, + const std::string& entrypoint = main_entrypoint_, + bool reuse_runtime_controller = false); - bool UpdateAssetManager(fxl::RefPtr asset_manager); + // Uses the given provider to locate assets. + void RunBundleWithAssets(fxl::RefPtr asset_provider, + const std::string& bundle_path, + const std::string& entrypoint = main_entrypoint_, + bool reuse_runtime_controller = false); - void BeginFrame(fxl::TimePoint frame_time); + // Uses the given source code instead of looking inside the bundle for the + // source code. + void RunBundleAndSource(const std::string& bundle_path, + const std::string& main, + const std::string& packages, + bool reuse_runtime_controller = false); + void BeginFrame(fxl::TimePoint frame_time); void NotifyIdle(int64_t deadline); - Dart_Port GetUIIsolateMainPort(); + void RunFromSource(const std::string& main, + const std::string& packages, + const std::string& bundle); + void SetAssetBundlePath(const std::string& bundle_path); + Dart_Port GetUIIsolateMainPort(); std::string GetUIIsolateName(); - bool UIIsolateHasLivePorts(); - tonic::DartErrorHandleType GetUIIsolateLastError(); - tonic::DartErrorHandleType GetLoadScriptError(); - std::pair GetUIIsolateReturnCode(); - - void OnOutputSurfaceCreated(); - - void OnOutputSurfaceDestroyed(); - + void OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation); + void OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation); void SetViewportMetrics(const blink::ViewportMetrics& metrics); - void DispatchPlatformMessage(fxl::RefPtr message); - - void DispatchPointerDataPacket(const blink::PointerDataPacket& packet); - + void DispatchPointerDataPacket(const PointerDataPacket& packet); void DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args); - void SetSemanticsEnabled(bool enabled); - void ScheduleFrame(bool regenerate_layer_tree = true) override; - private: - Engine::Delegate& delegate_; - const blink::Settings settings_; - std::unique_ptr animator_; - std::unique_ptr runtime_controller_; - std::unique_ptr legacy_sky_platform_; - tonic::DartErrorHandleType load_script_error_; - std::string initial_route_; - blink::ViewportMetrics viewport_metrics_; - fxl::RefPtr asset_manager_; - bool activity_running_; - bool have_surface_; - fml::WeakPtr weak_prototype_; - fml::WeakPtrFactory weak_factory_; + void set_rasterizer(fml::WeakPtr rasterizer); - // |blink::RuntimeDelegate| + private: + // RuntimeDelegate methods: std::string DefaultRouteName() override; - - // |blink::RuntimeDelegate| void Render(std::unique_ptr layer_tree) override; - - // |blink::RuntimeDelegate| void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - // |blink::RuntimeDelegate| void HandlePlatformMessage( fxl::RefPtr message) override; + void DidCreateMainIsolate(Dart_Isolate isolate) override; + void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; void StopAnimator(); - void StartAnimatorIfPossible(); - bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message); + void DoRunBundle(const std::string& script_uri, + const std::string& entrypoint, + bool reuse_runtime_controller); + void ConfigureAssetBundle(const std::string& path); + void ConfigureRuntime(const std::string& script_uri, + bool reuse_runtime_controller = false); + + bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message); bool HandleNavigationPlatformMessage( fxl::RefPtr message); - bool HandleLocalizationPlatformMessage(blink::PlatformMessage* message); - void HandleSettingsPlatformMessage(blink::PlatformMessage* message); void HandleAssetPlatformMessage(fxl::RefPtr message); - bool GetAssetAsBuffer(const std::string& name, std::vector* data); - bool PrepareAndLaunchIsolate(RunConfiguration configuration); + static const std::string main_entrypoint_; + + fxl::RefPtr asset_provider_; + std::weak_ptr platform_view_; + std::unique_ptr animator_; + std::unique_ptr runtime_; + tonic::DartErrorHandleType load_script_error_; + std::string initial_route_; + blink::ViewportMetrics viewport_metrics_; + std::string language_code_; + std::string country_code_; + std::string user_settings_data_; + bool semantics_enabled_ = false; + // TODO(zarah): Remove usage of asset_store_ once app.flx is removed. + fxl::RefPtr asset_store_; + fxl::RefPtr directory_asset_bundle_; + // TODO(eseidel): This should move into an AnimatorStateMachine. + bool activity_running_; + bool have_surface_; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(Engine); }; diff --git a/shell/common/io_manager.cc b/shell/common/io_manager.cc deleted file mode 100644 index 4161422978fcf..0000000000000 --- a/shell/common/io_manager.cc +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2017 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/shell/common/io_manager.h" - -#include "flutter/fml/message_loop.h" -#include "third_party/skia/include/gpu/gl/GrGLInterface.h" - -namespace shell { - -sk_sp IOManager::CreateCompatibleResourceLoadingContext( - GrBackend backend) { - if (backend != GrBackend::kOpenGL_GrBackend) { - return nullptr; - } - - GrContextOptions options = {}; - - // There is currently a bug with doing GPU YUV to RGB conversions on the IO - // thread. The necessary work isn't being flushed or synchronized with the - // other threads correctly, so the textures end up blank. For now, suppress - // that feature, which will cause texture uploads to do CPU YUV conversion. - options.fDisableGpuYUVConversion = true; - - if (auto context = GrContext::MakeGL(GrGLMakeNativeInterface(), options)) { - // Do not cache textures created by the image decoder. These textures - // should be deleted when they are no longer referenced by an SkImage. - context->setResourceCacheLimits(0, 0); - return context; - } - - return nullptr; -} - -IOManager::IOManager(sk_sp resource_context, - fxl::RefPtr unref_queue_task_runner) - : resource_context_(std::move(resource_context)), - resource_context_weak_factory_( - resource_context_ ? std::make_unique>( - resource_context_.get()) - : nullptr), - unref_queue_(fxl::MakeRefCounted( - std::move(unref_queue_task_runner), - fxl::TimeDelta::FromMilliseconds(250))), - weak_factory_(this) { - if (!resource_context_) { - FXL_DLOG(WARNING) << "The IO manager was initialized without a resource " - "context. Async texture uploads will be disabled. " - "Expect performance degradation."; - } - - if (resource_context_weak_factory_) { - resource_context_weak_prototype_ = - resource_context_weak_factory_->GetWeakPtr(); - } -} - -IOManager::~IOManager() { - // Last chance to drain the IO queue as the platform side reference to the - // underlying OpenGL context may be going away. - unref_queue_->Drain(); -} - -fml::WeakPtr IOManager::GetResourceContext() const { - return resource_context_weak_prototype_; -} - -fxl::RefPtr IOManager::GetSkiaUnrefQueue() const { - return unref_queue_; -} - -} // namespace shell diff --git a/shell/common/io_manager.h b/shell/common/io_manager.h deleted file mode 100644 index 1077a28d0ae36..0000000000000 --- a/shell/common/io_manager.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2017 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_SHELL_COMMON_IO_MANAGER_H_ -#define FLUTTER_SHELL_COMMON_IO_MANAGER_H_ - -#include - -#include "flutter/flow/skia_gpu_object.h" -#include "flutter/fml/memory/weak_ptr.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "third_party/skia/include/gpu/GrContext.h" - -namespace shell { - -class IOManager { - public: - // Convenience methods for platforms to create a GrContext used to supply to - // the IOManager. The platforms may create the context themselves if they so - // desire. - static sk_sp CreateCompatibleResourceLoadingContext( - GrBackend backend); - - IOManager(sk_sp resource_context, - fxl::RefPtr unref_queue_task_runner); - - ~IOManager(); - - fml::WeakPtr GetResourceContext() const; - - fxl::RefPtr GetSkiaUnrefQueue() const; - - private: - // Resource context management. - sk_sp resource_context_; - fml::WeakPtr resource_context_weak_prototype_; - std::unique_ptr> - resource_context_weak_factory_; - - // Unref queue management. - fxl::RefPtr unref_queue_; - - fml::WeakPtrFactory weak_factory_; - - FXL_DISALLOW_COPY_AND_ASSIGN(IOManager); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_IO_MANAGER_H_ diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc deleted file mode 100644 index 3c634022a348f..0000000000000 --- a/shell/common/isolate_configuration.cc +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2018 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/shell/common/isolate_configuration.h" - -#include "flutter/runtime/dart_vm.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace shell { - -IsolateConfiguration::IsolateConfiguration() = default; - -IsolateConfiguration::~IsolateConfiguration() = default; - -bool IsolateConfiguration::PrepareIsolate( - fml::WeakPtr isolate) { - if (!isolate) { - return false; - } - - if (isolate->GetPhase() != blink::DartIsolate::Phase::LibrariesSetup) { - FXL_DLOG(ERROR) - << "Isolate was in incorrect phase to be prepared for running."; - return false; - } - - return DoPrepareIsolate(*isolate); -} - -class PrecompiledIsolateConfiguration final : public IsolateConfiguration { - public: - PrecompiledIsolateConfiguration() = default; - - // |shell::IsolateConfiguration| - bool DoPrepareIsolate(blink::DartIsolate& isolate) override { - if (!blink::DartVM::IsRunningPrecompiledCode()) { - return false; - } - return isolate.PrepareForRunningFromPrecompiledCode(); - } - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(PrecompiledIsolateConfiguration); -}; - -class SnapshotIsolateConfiguration : public IsolateConfiguration { - public: - SnapshotIsolateConfiguration(std::unique_ptr snapshot) - : snapshot_(std::move(snapshot)) {} - - // |shell::IsolateConfiguration| - bool DoPrepareIsolate(blink::DartIsolate& isolate) override { - if (blink::DartVM::IsRunningPrecompiledCode()) { - return false; - } - return isolate.PrepareForRunningFromSnapshot(std::move(snapshot_)); - } - - private: - std::unique_ptr snapshot_; - - FXL_DISALLOW_COPY_AND_ASSIGN(SnapshotIsolateConfiguration); -}; - -class SourceIsolateConfiguration final : public IsolateConfiguration { - public: - SourceIsolateConfiguration(std::string main_path, std::string packages_path) - : main_path_(std::move(main_path)), - packages_path_(std::move(packages_path)) {} - - // |shell::IsolateConfiguration| - bool DoPrepareIsolate(blink::DartIsolate& isolate) override { - if (blink::DartVM::IsRunningPrecompiledCode()) { - return false; - } - return isolate.PrepareForRunningFromSource(std::move(main_path_), - std::move(packages_path_)); - } - - private: - std::string main_path_; - std::string packages_path_; - - FXL_DISALLOW_COPY_AND_ASSIGN(SourceIsolateConfiguration); -}; - -std::unique_ptr IsolateConfiguration::InferFromSettings( - const blink::Settings& settings, - fxl::RefPtr asset_manager) { - // Running in AOT mode. - if (blink::DartVM::IsRunningPrecompiledCode()) { - return CreateForPrecompiledCode(); - } - - // Run from sources. - { - const auto& main = settings.main_dart_file_path; - const auto& packages = settings.packages_file_path; - if (main.size() != 0 && packages.size() != 0) { - return CreateForSource(std::move(main), std::move(packages)); - } - } - - // Running from kernel snapshot. - { - std::vector kernel; - if (asset_manager && asset_manager->GetAsBuffer( - settings.application_kernel_asset, &kernel)) { - return CreateForSnapshot( - std::make_unique(std::move(kernel))); - } - } - - // Running from script snapshot. - { - std::vector script_snapshot; - if (asset_manager && asset_manager->GetAsBuffer( - settings.script_snapshot_path, &script_snapshot)) { - return CreateForSnapshot( - std::make_unique(std::move(script_snapshot))); - } - } - - return nullptr; -} - -std::unique_ptr -IsolateConfiguration::CreateForPrecompiledCode() { - return std::make_unique(); -} - -std::unique_ptr IsolateConfiguration::CreateForSnapshot( - std::unique_ptr snapshot) { - return std::make_unique(std::move(snapshot)); -} - -std::unique_ptr IsolateConfiguration::CreateForSource( - std::string main_path, - std::string packages_path) { - return std::make_unique(std::move(main_path), - std::move(packages_path)); -} - -} // namespace shell diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h deleted file mode 100644 index 82d06dac621b2..0000000000000 --- a/shell/common/isolate_configuration.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018 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_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ -#define FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ - -#include -#include - -#include "flutter/assets/asset_manager.h" -#include "flutter/assets/asset_resolver.h" -#include "flutter/common/settings.h" -#include "flutter/fml/mapping.h" -#include "flutter/fml/memory/weak_ptr.h" -#include "flutter/runtime/dart_isolate.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class IsolateConfiguration { - public: - static std::unique_ptr InferFromSettings( - const blink::Settings& settings, - fxl::RefPtr asset_manager); - - static std::unique_ptr CreateForPrecompiledCode(); - - static std::unique_ptr CreateForSnapshot( - std::unique_ptr snapshot); - - static std::unique_ptr CreateForSource( - std::string main_path, - std::string packages_path); - - IsolateConfiguration(); - - virtual ~IsolateConfiguration(); - - bool PrepareIsolate(fml::WeakPtr isolate); - - protected: - virtual bool DoPrepareIsolate(blink::DartIsolate& isolate) = 0; - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfiguration); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ diff --git a/shell/common/null_platform_view.cc b/shell/common/null_platform_view.cc new file mode 100644 index 0000000000000..49fdf5a935b80 --- /dev/null +++ b/shell/common/null_platform_view.cc @@ -0,0 +1,37 @@ +// Copyright 2017 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. + +#include "flutter/shell/common/null_platform_view.h" + +#include "flutter/shell/common/null_rasterizer.h" +#include "flutter/shell/common/shell.h" + +namespace shell { + +NullPlatformView::NullPlatformView() + : PlatformView(std::make_unique()), weak_factory_(this) {} + +void NullPlatformView::Attach() { + CreateEngine(); +} + +NullPlatformView::~NullPlatformView() = default; + +fxl::WeakPtr NullPlatformView::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +bool NullPlatformView::ResourceContextMakeCurrent() { + return false; +} + +// Hot-reload of the null platform view is not supported. +void NullPlatformView::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) {} + +void NullPlatformView::SetAssetBundlePath(const std::string& assets_directory) { +} + +} // namespace shell diff --git a/shell/common/null_platform_view.h b/shell/common/null_platform_view.h new file mode 100644 index 0000000000000..eb23d67b48a7c --- /dev/null +++ b/shell/common/null_platform_view.h @@ -0,0 +1,39 @@ +// Copyright 2017 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. + +#ifndef COMMON_NULL_PLATFORM_VIEW_H_ +#define COMMON_NULL_PLATFORM_VIEW_H_ + +#include "flutter/shell/common/platform_view.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace shell { + +class NullPlatformView : public PlatformView { + public: + NullPlatformView(); + + ~NullPlatformView(); + + fxl::WeakPtr GetWeakPtr(); + + virtual void Attach() override; + + bool ResourceContextMakeCurrent() override; + + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + void SetAssetBundlePath(const std::string& assets_directory) override; + + private: + fxl::WeakPtrFactory weak_factory_; + + FXL_DISALLOW_COPY_AND_ASSIGN(NullPlatformView); +}; + +} // namespace shell + +#endif // COMMON_NULL_PLATFORM_VIEW_H_ diff --git a/shell/common/null_rasterizer.cc b/shell/common/null_rasterizer.cc new file mode 100644 index 0000000000000..81efdd11d4970 --- /dev/null +++ b/shell/common/null_rasterizer.cc @@ -0,0 +1,67 @@ +// Copyright 2016 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. + +#include "flutter/shell/common/null_rasterizer.h" + +namespace shell { + +NullRasterizer::NullRasterizer() : weak_factory_(this) {} + +void NullRasterizer::Setup( + std::unique_ptr surface_or_null, + fxl::Closure rasterizer_continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) { + surface_ = std::move(surface_or_null); + rasterizer_continuation(); + setup_completion_event->Signal(); +} + +void NullRasterizer::Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) { + if (surface_) { + surface_.reset(); + } + teardown_completion_event->Signal(); +} + +fml::WeakPtr NullRasterizer::GetWeakRasterizerPtr() { + return weak_factory_.GetWeakPtr(); +} + +flow::LayerTree* NullRasterizer::GetLastLayerTree() { + return nullptr; +} + +void NullRasterizer::DrawLastLayerTree() { + // Null rasterizer. Nothing to do. +} + +flow::TextureRegistry& NullRasterizer::GetTextureRegistry() { + return *texture_registry_; +} + +void NullRasterizer::Clear(SkColor color, const SkISize& size) { + // Null rasterizer. Nothing to do. +} + +void NullRasterizer::Draw( + fxl::RefPtr> pipeline) { + FXL_ALLOW_UNUSED_LOCAL( + pipeline->Consume([](std::unique_ptr) { + // Drop the layer tree on the floor. We only need the pipeline empty so + // that frame requests are not deferred indefinitely due to + // backpressure. + })); +} + +void NullRasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { + // Null rasterizer. Nothing to do. +} + +void NullRasterizer::SetTextureRegistry( + flow::TextureRegistry* textureRegistry) { + texture_registry_ = textureRegistry; +} + +} // namespace shell diff --git a/shell/common/null_rasterizer.h b/shell/common/null_rasterizer.h new file mode 100644 index 0000000000000..8558a3c3accaa --- /dev/null +++ b/shell/common/null_rasterizer.h @@ -0,0 +1,51 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ +#define FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ + +#include "flutter/shell/common/rasterizer.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace shell { + +class NullRasterizer : public Rasterizer { + public: + NullRasterizer(); + + void Setup(std::unique_ptr surface_or_null, + fxl::Closure rasterizer_continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) override; + + void Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) override; + + void Clear(SkColor color, const SkISize& size) override; + + fml::WeakPtr GetWeakRasterizerPtr() override; + + flow::LayerTree* GetLastLayerTree() override; + + void DrawLastLayerTree() override; + + flow::TextureRegistry& GetTextureRegistry() override; + + void Draw(fxl::RefPtr> pipeline) override; + + void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; + + void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; + + private: + std::unique_ptr surface_; + fml::WeakPtrFactory weak_factory_; + flow::TextureRegistry* texture_registry_; + + FXL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index b2bfce051a5bf..2d5715a1733bd 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -6,74 +6,124 @@ #include +#include "flutter/common/threads.h" +#include "flutter/lib/ui/painting/resource_context.h" #include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/shell.h" #include "flutter/shell/common/vsync_waiter_fallback.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" namespace shell { -PlatformView::PlatformView(Delegate& delegate, blink::TaskRunners task_runners) - : delegate_(delegate), - task_runners_(std::move(task_runners)), - size_(SkISize::Make(0, 0)), - weak_factory_(this) { - weak_prototype_ = weak_factory_.GetWeakPtr(); +PlatformView::PlatformView(std::unique_ptr rasterizer) + : rasterizer_(std::move(rasterizer)), size_(SkISize::Make(0, 0)) { + rasterizer_->SetTextureRegistry(&texture_registry_); + Shell::Shared().AddPlatformView(this); } -PlatformView::~PlatformView() = default; +PlatformView::~PlatformView() { + Shell::Shared().RemovePlatformView(this); -std::unique_ptr PlatformView::CreateVSyncWaiter() { - FXL_DLOG(WARNING) - << "This platform does not provide a Vsync waiter implementation. A " - "simple timer based fallback is being used."; - return std::make_unique(task_runners_); + Rasterizer* rasterizer = rasterizer_.release(); + blink::Threads::Gpu()->PostTask([rasterizer]() { delete rasterizer; }); + + Engine* engine = engine_.release(); + blink::Threads::UI()->PostTask([engine]() { delete engine; }); } -void PlatformView::DispatchPlatformMessage( - fxl::RefPtr message) { - delegate_.OnPlatformViewDispatchPlatformMessage(*this, std::move(message)); +void PlatformView::SetRasterizer(std::unique_ptr rasterizer) { + Rasterizer* r = rasterizer_.release(); + blink::Threads::Gpu()->PostTask([r]() { delete r; }); + rasterizer_ = std::move(rasterizer); + rasterizer_->SetTextureRegistry(&texture_registry_); + engine_->set_rasterizer(rasterizer_->GetWeakRasterizerPtr()); } -void PlatformView::DispatchPointerDataPacket( - std::unique_ptr packet) { - delegate_.OnPlatformViewDispatchPointerDataPacket(*this, std::move(packet)); +void PlatformView::CreateEngine() { + engine_.reset(new Engine(this)); +} + +void PlatformView::DispatchPlatformMessage( + fxl::RefPtr message) { + blink::Threads::UI()->PostTask( + [engine = engine_->GetWeakPtr(), message = std::move(message)] { + if (engine) { + engine->DispatchPlatformMessage(message); + } + }); } void PlatformView::DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args) { - delegate_.OnPlatformViewDispatchSemanticsAction(*this, id, action, - std::move(args)); + blink::Threads::UI()->PostTask( + [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { + if (engine) { + engine->DispatchSemanticsAction( + id, static_cast(action), std::move(args)); + } + }); } void PlatformView::SetSemanticsEnabled(bool enabled) { - delegate_.OnPlatformViewSetSemanticsEnabled(*this, enabled); + blink::Threads::UI()->PostTask([engine = engine_->GetWeakPtr(), enabled] { + if (engine) + engine->SetSemanticsEnabled(enabled); + }); } -void PlatformView::SetViewportMetrics(const blink::ViewportMetrics& metrics) { - delegate_.OnPlatformViewSetViewportMetrics(*this, metrics); +void PlatformView::NotifyCreated(std::unique_ptr surface) { + NotifyCreated(std::move(surface), []() {}); } -void PlatformView::NotifyCreated() { - delegate_.OnPlatformViewCreated(*this, CreateRenderingSurface()); +void PlatformView::NotifyCreated(std::unique_ptr surface, + fxl::Closure caller_continuation) { + fxl::AutoResetWaitableEvent latch; + + auto ui_continuation = fxl::MakeCopyable([this, // + surface = std::move(surface), // + caller_continuation, // + &latch]() mutable { + auto gpu_continuation = fxl::MakeCopyable([this, // + surface = std::move(surface), // + caller_continuation, // + &latch]() mutable { + // Runs on the GPU Thread. So does the Caller Continuation. + rasterizer_->Setup(std::move(surface), caller_continuation, &latch); + }); + // Runs on the UI Thread. + engine_->OnOutputSurfaceCreated(std::move(gpu_continuation)); + }); + + // Runs on the Platform Thread. + blink::Threads::UI()->PostTask(std::move(ui_continuation)); + + latch.Wait(); } void PlatformView::NotifyDestroyed() { - delegate_.OnPlatformViewDestroyed(*this); + fxl::AutoResetWaitableEvent latch; + + auto engine_continuation = [this, &latch]() { + rasterizer_->Teardown(&latch); + }; + + blink::Threads::UI()->PostTask([this, engine_continuation]() { + engine_->OnOutputSurfaceDestroyed(engine_continuation); + }); + + latch.Wait(); } -sk_sp PlatformView::CreateResourceContext() const { - FXL_DLOG(WARNING) << "This platform does not setup the resource " - "context on the IO thread for async texture uploads."; - return nullptr; +std::weak_ptr PlatformView::GetWeakPtr() { + return shared_from_this(); } -fml::WeakPtr PlatformView::GetWeakPtr() const { - return weak_prototype_; +VsyncWaiter* PlatformView::GetVsyncWaiter() { + if (!vsync_waiter_) + vsync_waiter_ = std::make_unique(); + return vsync_waiter_.get(); } void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) {} @@ -85,31 +135,71 @@ void PlatformView::HandlePlatformMessage( } void PlatformView::RegisterTexture(std::shared_ptr texture) { - delegate_.OnPlatformViewRegisterTexture(*this, std::move(texture)); + ASSERT_IS_PLATFORM_THREAD + blink::Threads::Gpu()->PostTask([this, texture]() { + rasterizer_->GetTextureRegistry().RegisterTexture(texture); + }); } void PlatformView::UnregisterTexture(int64_t texture_id) { - delegate_.OnPlatformViewUnregisterTexture(*this, texture_id); + ASSERT_IS_PLATFORM_THREAD + blink::Threads::Gpu()->PostTask([this, texture_id]() { + rasterizer_->GetTextureRegistry().UnregisterTexture(texture_id); + }); } void PlatformView::MarkTextureFrameAvailable(int64_t texture_id) { - delegate_.OnPlatformViewMarkTextureFrameAvailable(*this, texture_id); + ASSERT_IS_PLATFORM_THREAD + blink::Threads::UI()->PostTask([this]() { engine_->ScheduleFrame(false); }); } -std::unique_ptr PlatformView::CreateRenderingSurface() { - // We have a default implementation because tests create a platform view but - // never a rendering surface. - FXL_DCHECK(false) << "This platform does not provide a rendering surface but " - "it was notified of surface rendering surface creation."; - return nullptr; +void PlatformView::SetupResourceContextOnIOThread() { + fxl::AutoResetWaitableEvent latch; + + blink::Threads::IO()->PostTask( + [this, &latch]() { SetupResourceContextOnIOThreadPerform(&latch); }); + + latch.Wait(); } -void PlatformView::SetNextFrameCallback(fxl::Closure closure) { - if (!closure) { +void PlatformView::SetupResourceContextOnIOThreadPerform( + fxl::AutoResetWaitableEvent* latch) { + std::unique_ptr resourceContext = + blink::ResourceContext::Acquire(); + if (resourceContext->Get() != nullptr) { + // The resource context was already setup. This could happen if platforms + // try to setup a context multiple times, or, if there are multiple platform + // views. In any case, there is nothing else to do. So just signal the + // latch. + latch->Signal(); return; } - delegate_.OnPlatformViewSetNextFrameCallback(*this, std::move(closure)); + bool current = ResourceContextMakeCurrent(); + + if (!current) { + FXL_DLOG(WARNING) + << "WARNING: Could not setup a context on the resource loader."; + latch->Signal(); + return; + } + + GrContextOptions options; + // There is currently a bug with doing GPU YUV to RGB conversions on the IO + // thread. The necessary work isn't being flushed or synchronized with the + // other threads correctly, so the textures end up blank. For now, suppress + // that feature, which will cause texture uploads to do CPU YUV conversion. + options.fDisableGpuYUVConversion = true; + + blink::ResourceContext::Set( + GrContext::MakeGL(GrGLMakeNativeInterface(), options)); + + // Do not cache textures created by the image decoder. These textures should + // be deleted when they are no longer referenced by an SkImage. + if (resourceContext->Get()) + resourceContext->Get()->setResourceCacheLimits(0, 0); + + latch->Signal(); } } // namespace shell diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 56179a6114777..66b1fcae10c79 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -7,104 +7,63 @@ #include -#include "flutter/common/task_runners.h" #include "flutter/flow/texture.h" -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/lib/ui/semantics/semantics_node.h" -#include "flutter/lib/ui/window/platform_message.h" -#include "flutter/lib/ui/window/pointer_data_packet.h" -#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/shell/common/engine.h" +#include "flutter/shell/common/shell.h" #include "flutter/shell/common/surface.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { -class Shell; +class Rasterizer; -class PlatformView { +class PlatformView : public std::enable_shared_from_this { public: - class Delegate { - public: - virtual void OnPlatformViewCreated(const PlatformView& view, - std::unique_ptr surface) = 0; - - virtual void OnPlatformViewDestroyed(const PlatformView& view) = 0; - - virtual void OnPlatformViewSetNextFrameCallback(const PlatformView& view, - fxl::Closure closure) = 0; - - virtual void OnPlatformViewSetViewportMetrics( - const PlatformView& view, - const blink::ViewportMetrics& metrics) = 0; - - virtual void OnPlatformViewDispatchPlatformMessage( - const PlatformView& view, - fxl::RefPtr message) = 0; - - virtual void OnPlatformViewDispatchPointerDataPacket( - const PlatformView& view, - std::unique_ptr packet) = 0; - - virtual void OnPlatformViewDispatchSemanticsAction( - const PlatformView& view, - int32_t id, - blink::SemanticsAction action, - std::vector args) = 0; - - virtual void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, - bool enabled) = 0; - - virtual void OnPlatformViewRegisterTexture( - const PlatformView& view, - std::shared_ptr texture) = 0; - - virtual void OnPlatformViewUnregisterTexture(const PlatformView& view, - int64_t texture_id) = 0; - - virtual void OnPlatformViewMarkTextureFrameAvailable( - const PlatformView& view, - int64_t texture_id) = 0; + struct SurfaceConfig { + uint8_t red_bits = 8; + uint8_t green_bits = 8; + uint8_t blue_bits = 8; + uint8_t alpha_bits = 8; + uint8_t depth_bits = 0; + uint8_t stencil_bits = 0; }; - explicit PlatformView(Delegate& delegate, blink::TaskRunners task_runners); + void SetupResourceContextOnIOThread(); virtual ~PlatformView(); - virtual std::unique_ptr CreateVSyncWaiter(); + virtual void Attach() = 0; void DispatchPlatformMessage(fxl::RefPtr message); - void DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args); + void SetSemanticsEnabled(bool enabled); - virtual void SetSemanticsEnabled(bool enabled); + void NotifyCreated(std::unique_ptr surface); - void SetViewportMetrics(const blink::ViewportMetrics& metrics); + void NotifyCreated(std::unique_ptr surface, + fxl::Closure continuation); - void NotifyCreated(); + void NotifyDestroyed(); - virtual void NotifyDestroyed(); + std::weak_ptr GetWeakPtr(); - // Unlike all other methods on the platform view, this one may be called on a - // non-platform task runner. - virtual sk_sp CreateResourceContext() const; + // The VsyncWaiter will live at least as long as the PlatformView. + virtual VsyncWaiter* GetVsyncWaiter(); - fml::WeakPtr GetWeakPtr() const; + virtual bool ResourceContextMakeCurrent() = 0; virtual void UpdateSemantics(blink::SemanticsNodeUpdates update); - virtual void HandlePlatformMessage( fxl::RefPtr message); - void SetNextFrameCallback(fxl::Closure closure); - - void DispatchPointerDataPacket( - std::unique_ptr packet); - // Called once per texture, on the platform thread. void RegisterTexture(std::shared_ptr texture); @@ -112,18 +71,34 @@ class PlatformView { void UnregisterTexture(int64_t texture_id); // Called once per texture update (e.g. video frame), on the platform thread. - void MarkTextureFrameAvailable(int64_t texture_id); + virtual void MarkTextureFrameAvailable(int64_t texture_id); + + void SetRasterizer(std::unique_ptr rasterizer); + + Rasterizer& rasterizer() { return *rasterizer_; } + Engine& engine() { return *engine_; } + + virtual void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) = 0; + + virtual void SetAssetBundlePath(const std::string& assets_directory) = 0; protected: - PlatformView::Delegate& delegate_; - const blink::TaskRunners task_runners_; + explicit PlatformView(std::unique_ptr rasterizer); + + void CreateEngine(); + + void SetupResourceContextOnIOThreadPerform( + fxl::AutoResetWaitableEvent* event); + + SurfaceConfig surface_config_; + std::unique_ptr rasterizer_; + flow::TextureRegistry texture_registry_; + std::unique_ptr engine_; std::unique_ptr vsync_waiter_; SkISize size_; - fml::WeakPtr weak_prototype_; - fml::WeakPtrFactory weak_factory_; - - virtual std::unique_ptr CreateRenderingSurface(); private: FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); diff --git a/shell/common/platform_view_service_protocol.cc b/shell/common/platform_view_service_protocol.cc new file mode 100644 index 0000000000000..8785c4812e202 --- /dev/null +++ b/shell/common/platform_view_service_protocol.cc @@ -0,0 +1,447 @@ +// Copyright 2016 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. + +#include "flutter/shell/common/platform_view_service_protocol.h" + +#include + +#include +#include + +#include "flutter/common/threads.h" +#include "flutter/shell/common/picture_serializer.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "third_party/skia/include/core/SkSurface.h" +#include "third_party/skia/src/utils/SkBase64.h" + +namespace shell { +namespace { + +constexpr char kViewIdPrefx[] = "_flutterView/"; +constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; + +static intptr_t KeyIndex(const char** param_keys, + intptr_t num_params, + const char* key) { + if (param_keys == NULL) { + return -1; + } + for (intptr_t i = 0; i < num_params; i++) { + if (strcmp(param_keys[i], key) == 0) { + return i; + } + } + return -1; +} + +static const char* ValueForKey(const char** param_keys, + const char** param_values, + intptr_t num_params, + const char* key) { + intptr_t index = KeyIndex(param_keys, num_params, key); + if (index < 0) { + return NULL; + } + return param_values[index]; +} + +static bool ErrorMissingParameter(const char** json_object, const char* name) { + const intptr_t kInvalidParams = -32602; + std::stringstream response; + response << "{\"code\":" << std::to_string(kInvalidParams) << ","; + response << "\"message\":\"Invalid params\","; + response << "\"data\": {\"details\": \"" << name << "\"}}"; + *json_object = strdup(response.str().c_str()); + return false; +} + +static bool ErrorBadParameter(const char** json_object, + const char* name, + const char* value) { + const intptr_t kInvalidParams = -32602; + std::stringstream response; + response << "{\"code\":" << std::to_string(kInvalidParams) << ","; + response << "\"message\":\"Invalid params\","; + response << "\"data\": {\"details\": \"parameter: " << name << " has a bad "; + response << "value: " << value << "\"}}"; + *json_object = strdup(response.str().c_str()); + return false; +} + +static bool ErrorUnknownView(const char** json_object, const char* view_id) { + const intptr_t kInvalidParams = -32602; + std::stringstream response; + response << "{\"code\":" << std::to_string(kInvalidParams) << ","; + response << "\"message\":\"Invalid params\","; + response << "\"data\": {\"details\": \"view not found: " << view_id << "\"}}"; + *json_object = strdup(response.str().c_str()); + return false; +} + +static bool ErrorServer(const char** json_object, const char* message) { + const intptr_t kServerError = -32000; + std::stringstream response; + response << "{\"code\":" << std::to_string(kServerError) << ","; + response << "\"message\":\"" << message << "\"}"; + *json_object = strdup(response.str().c_str()); + return false; +} + +static void AppendIsolateRef(std::stringstream* stream, + int64_t main_port, + const std::string name) { + *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; + *stream << main_port << "\",\"name\":\"" << name << "\","; + *stream << "\"number\":\"" << main_port << "\"}"; +} + +static void AppendFlutterView(std::stringstream* stream, + uintptr_t view_id, + int64_t isolate_id, + const std::string isolate_name) { + *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" + << std::hex << view_id << std::dec << "\""; + if (isolate_id != ILLEGAL_PORT) { + // Append the isolate (if it exists). + *stream << "," + << "\"isolate\":"; + AppendIsolateRef(stream, isolate_id, isolate_name); + } + *stream << "}"; +} + +} // namespace + +void PlatformViewServiceProtocol::RegisterHook(bool running_precompiled_code) { + // Listing of FlutterViews. + Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, + nullptr); + // Screenshot. + Dart_RegisterRootServiceRequestCallback(kScreenshotExtensionName, &Screenshot, + nullptr); + + // SkPicture Screenshot. + Dart_RegisterRootServiceRequestCallback(kScreenshotSkpExtensionName, + &ScreenshotSkp, nullptr); + + // The following set of service protocol extensions require debug build + if (running_precompiled_code) { + return; + } + Dart_RegisterRootServiceRequestCallback(kRunInViewExtensionName, &RunInView, + nullptr); + Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, + &SetAssetBundlePath, nullptr); + // [benchmark helper] Wait for the UI Thread to idle. + Dart_RegisterRootServiceRequestCallback(kFlushUIThreadTasksExtensionName, + &FlushUIThreadTasks, nullptr); +} + +const char* PlatformViewServiceProtocol::kRunInViewExtensionName = + "_flutter.runInView"; + +bool PlatformViewServiceProtocol::RunInView(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + const char* view_id = + ValueForKey(param_keys, param_values, num_params, "viewId"); + const char* asset_directory = + ValueForKey(param_keys, param_values, num_params, "assetDirectory"); + const char* main_script = + ValueForKey(param_keys, param_values, num_params, "mainScript"); + const char* packages_file = + ValueForKey(param_keys, param_values, num_params, "packagesFile"); + if (view_id == NULL) { + return ErrorMissingParameter(json_object, "viewId"); + } + if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { + return ErrorBadParameter(json_object, "viewId", view_id); + } + if (asset_directory == NULL) { + return ErrorMissingParameter(json_object, "assetDirectory"); + } + if (main_script == NULL) { + return ErrorMissingParameter(json_object, "mainScript"); + } + if (packages_file == NULL) { + return ErrorMissingParameter(json_object, "packagesFile"); + } + + // Convert the actual flutter view hex id into a number. + uintptr_t view_id_as_num = + std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); + + // Ask the Shell to run this script in the specified view. This will run a + // task on the UI thread before returning. + Shell& shell = Shell::Shared(); + bool view_existed = false; + Dart_Port main_port = ILLEGAL_PORT; + std::string isolate_name; + shell.RunInPlatformView(view_id_as_num, main_script, packages_file, + asset_directory, &view_existed, &main_port, + &isolate_name); + + if (!view_existed) { + // If the view did not exist this request has definitely failed. + return ErrorUnknownView(json_object, view_id); + } + + // The view existed and the isolate was created. Success. + std::stringstream response; + response << "{\"type\":\"Success\"," + << "\"view\":"; + AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); + response << "}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +const char* PlatformViewServiceProtocol::kListViewsExtensionName = + "_flutter.listViews"; + +bool PlatformViewServiceProtocol::ListViews(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + std::stringstream response; + response << "{\"type\":\"FlutterViewList\",\"views\":["; + bool prefix_comma = false; + Shell::Shared().IteratePlatformViews( + [&response, &prefix_comma](PlatformView* view) -> bool { + if (prefix_comma) { + response << ','; + } else { + prefix_comma = true; + } + AppendFlutterView(&response, reinterpret_cast(view), + view->engine().GetUIIsolateMainPort(), + view->engine().GetUIIsolateName()); + return true; + }); + response << "]}"; + // Copy the response. + *json_object = strdup(response.str().c_str()); + return true; +} + +const char* PlatformViewServiceProtocol::kScreenshotExtensionName = + "_flutter.screenshot"; + +static sk_sp EncodeBitmapAsPNG(const SkBitmap& bitmap) { + return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); +} + +static fml::WeakPtr GetRandomRasterizer() { + fml::WeakPtr rasterizer; + Shell::Shared().IteratePlatformViews( + [&rasterizer](PlatformView* view) -> bool { + rasterizer = view->rasterizer().GetWeakRasterizerPtr(); + // We just grab the first rasterizer so there is no need to iterate + // further. + return false; + }); + return rasterizer; +} + +bool PlatformViewServiceProtocol::Screenshot(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + fxl::AutoResetWaitableEvent latch; + SkBitmap bitmap; + blink::Threads::Gpu()->PostTask([&latch, &bitmap]() { + ScreenshotGpuTask(&bitmap); + latch.Signal(); + }); + + latch.Wait(); + + sk_sp png(EncodeBitmapAsPNG(bitmap)); + + if (!png) + return ErrorServer(json_object, "can not encode screenshot"); + + size_t b64_size = SkBase64::Encode(png->data(), png->size(), nullptr); + SkAutoTMalloc b64_data(b64_size); + SkBase64::Encode(png->data(), png->size(), b64_data.get()); + + std::stringstream response; + response << "{\"type\":\"Screenshot\"," + << "\"screenshot\":\"" << std::string{b64_data.get(), b64_size} + << "\"}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +void PlatformViewServiceProtocol::ScreenshotGpuTask(SkBitmap* bitmap) { + auto rasterizer = GetRandomRasterizer(); + + if (!rasterizer) + return; + + flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); + if (layer_tree == nullptr) + return; + + const SkISize& frame_size = layer_tree->frame_size(); + if (!bitmap->tryAllocN32Pixels(frame_size.width(), frame_size.height())) + return; + + sk_sp surface = SkSurface::MakeRasterDirect( + bitmap->info(), bitmap->getPixels(), bitmap->rowBytes()); + + flow::CompositorContext compositor_context(nullptr); + SkCanvas* canvas = surface->getCanvas(); + flow::CompositorContext::ScopedFrame frame = + compositor_context.AcquireFrame(nullptr, canvas, false); + + canvas->clear(SK_ColorBLACK); + layer_tree->Raster(frame); + canvas->flush(); +} + +const char* PlatformViewServiceProtocol::kScreenshotSkpExtensionName = + "_flutter.screenshotSkp"; + +bool PlatformViewServiceProtocol::ScreenshotSkp(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + fxl::AutoResetWaitableEvent latch; + sk_sp picture; + blink::Threads::Gpu()->PostTask([&latch, &picture]() { + picture = ScreenshotSkpGpuTask(); + latch.Signal(); + }); + + latch.Wait(); + + sk_sp skp_data = picture->serialize(); + + size_t b64_size = + SkBase64::Encode(skp_data->data(), skp_data->size(), nullptr); + SkAutoTMalloc b64_data(b64_size); + SkBase64::Encode(skp_data->data(), skp_data->size(), b64_data.get()); + + std::stringstream response; + response << "{\"type\":\"ScreenshotSkp\"," + << "\"skp\":\"" << std::string{b64_data.get(), b64_size} << "\"}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +sk_sp PlatformViewServiceProtocol::ScreenshotSkpGpuTask() { + auto rasterizer = GetRandomRasterizer(); + + if (!rasterizer) + return nullptr; + + flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); + if (layer_tree == nullptr) + return nullptr; + + SkPictureRecorder recorder; + recorder.beginRecording(SkRect::MakeWH(layer_tree->frame_size().width(), + layer_tree->frame_size().height())); + + flow::CompositorContext compositor_context(nullptr); + flow::CompositorContext::ScopedFrame frame = compositor_context.AcquireFrame( + nullptr, recorder.getRecordingCanvas(), false); + layer_tree->Raster(frame); + + return recorder.finishRecordingAsPicture(); +} + +const char* PlatformViewServiceProtocol::kFlushUIThreadTasksExtensionName = + "_flutter.flushUIThreadTasks"; + +// This API should not be invoked by production code. +// It can potentially starve the service isolate if the main isolate pauses +// at a breakpoint or is in an infinite loop. +// +// It should be invoked from the VM Service and and blocks it until UI thread +// tasks are processed. +bool PlatformViewServiceProtocol::FlushUIThreadTasks(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + fxl::AutoResetWaitableEvent latch; + blink::Threads::UI()->PostTask([&latch]() { + // This task is empty because we just need to synchronize this RPC with the + // UI Thread + latch.Signal(); + }); + + latch.Wait(); + + *json_object = strdup("{\"type\":\"Success\"}"); + return true; +} + +const char* PlatformViewServiceProtocol::kSetAssetBundlePathExtensionName = + "_flutter.setAssetBundlePath"; + +bool PlatformViewServiceProtocol::SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + const char* view_id = + ValueForKey(param_keys, param_values, num_params, "viewId"); + if (view_id == nullptr) { + return ErrorMissingParameter(json_object, "viewId"); + } + if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { + return ErrorBadParameter(json_object, "viewId", view_id); + } + const char* asset_directory = + ValueForKey(param_keys, param_values, num_params, "assetDirectory"); + if (asset_directory == nullptr) { + return ErrorMissingParameter(json_object, "assetDirectory"); + } + + // Convert the actual flutter view hex id into a number. + uintptr_t view_id_as_num = + std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); + + // Ask the Shell to update asset bundle path in the specified view. + // This will run a task on the UI thread before returning. + Shell& shell = Shell::Shared(); + bool view_existed = false; + Dart_Port main_port = ILLEGAL_PORT; + std::string isolate_name; + shell.SetAssetBundlePathInPlatformView(view_id_as_num, asset_directory, + &view_existed, &main_port, + &isolate_name); + + if (!view_existed) { + // If the view did not exist this request has definitely failed. + return ErrorUnknownView(json_object, view_id); + } + + // The view existed and the isolate was created. Success. + std::stringstream response; + response << "{\"type\":\"Success\"," + << "\"view\":"; + AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); + response << "}"; + *json_object = strdup(response.str().c_str()); + return true; +} + +} // namespace shell diff --git a/shell/common/platform_view_service_protocol.h b/shell/common/platform_view_service_protocol.h new file mode 100644 index 0000000000000..b7f74b56a08ba --- /dev/null +++ b/shell/common/platform_view_service_protocol.h @@ -0,0 +1,85 @@ +// Copyright 2016 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. + +#ifndef SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ +#define SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ + +#include + +#include "flutter/shell/common/platform_view.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" +#include "third_party/skia/include/core/SkBitmap.h" + +namespace shell { + +class PlatformViewServiceProtocol { + public: + static void RegisterHook(bool running_precompiled_code); + + private: + static const char* kRunInViewExtensionName; + // It should be invoked from the VM Service and and blocks it until previous + // UI thread tasks are processed. + static bool RunInView(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + + static const char* kListViewsExtensionName; + static bool ListViews(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + + static const char* kScreenshotExtensionName; + // It should be invoked from the VM Service and and blocks it until previous + // GPU thread tasks are processed. + static bool Screenshot(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + static void ScreenshotGpuTask(SkBitmap* bitmap); + + static const char* kScreenshotSkpExtensionName; + static bool ScreenshotSkp(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + static sk_sp ScreenshotSkpGpuTask(); + + // This API should not be invoked by production code. + // It can potentially starve the service isolate if the main isolate pauses + // at a breakpoint or is in an infinite loop. + // + // It should be invoked from the VM Service and and blocks it until previous + // GPU thread tasks are processed. + static const char* kFlushUIThreadTasksExtensionName; + static bool FlushUIThreadTasks(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + + static const char* kSetAssetBundlePathExtensionName; + static bool SetAssetBundlePath(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); +}; + +} // namespace shell + +#endif // SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 5a519b3efea26..905ee6285c5d3 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -4,205 +4,8 @@ #include "flutter/shell/common/rasterizer.h" -#include - -#include "third_party/skia/include/core/SkEncodedImageFormat.h" -#include "third_party/skia/include/core/SkImageEncoder.h" -#include "third_party/skia/include/core/SkPictureRecorder.h" -#include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/src/utils/SkBase64.h" - namespace shell { -Rasterizer::Rasterizer(blink::TaskRunners task_runners) - : task_runners_(std::move(task_runners)), weak_factory_(this) { - weak_prototype_ = weak_factory_.GetWeakPtr(); -} - Rasterizer::~Rasterizer() = default; -fml::WeakPtr Rasterizer::GetWeakPtr() const { - return weak_prototype_; -} - -void Rasterizer::Setup(std::unique_ptr surface) { - surface_ = std::move(surface); -} - -void Rasterizer::Teardown() { - surface_.reset(); - last_layer_tree_.reset(); -} - -flow::TextureRegistry* Rasterizer::GetTextureRegistry() { - if (!surface_) { - return nullptr; - } - - return &(surface_->GetCompositorContext().texture_registry()); -} - -flow::LayerTree* Rasterizer::GetLastLayerTree() { - return last_layer_tree_.get(); -} - -void Rasterizer::DrawLastLayerTree() { - if (!last_layer_tree_ || !surface_) { - return; - } - DrawToSurface(*last_layer_tree_); -} - -void Rasterizer::Draw( - fxl::RefPtr> pipeline) { - TRACE_EVENT0("flutter", "GPURasterizer::Draw"); - - flutter::Pipeline::Consumer consumer = - std::bind(&Rasterizer::DoDraw, this, std::placeholders::_1); - - // Consume as many pipeline items as possible. But yield the event loop - // between successive tries. - switch (pipeline->Consume(consumer)) { - case flutter::PipelineConsumeResult::MoreAvailable: { - task_runners_.GetGPUTaskRunner()->PostTask( - [weak_this = weak_factory_.GetWeakPtr(), pipeline]() { - if (weak_this) { - weak_this->Draw(pipeline); - } - }); - break; - } - default: - break; - } -} - -void Rasterizer::DoDraw(std::unique_ptr layer_tree) { - if (!layer_tree || !surface_) { - return; - } - - if (DrawToSurface(*layer_tree)) { - last_layer_tree_ = std::move(layer_tree); - } -} - -bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) { - FXL_DCHECK(surface_); - - auto frame = surface_->AcquireFrame(layer_tree.frame_size()); - - if (frame == nullptr) { - return false; - } - - auto& compositor_context = surface_->GetCompositorContext(); - - // There is no way for the compositor to know how long the layer tree - // construction took. Fortunately, the layer tree does. Grab that time - // for instrumentation. - compositor_context.engine_time().SetLapTime(layer_tree.construction_time()); - - auto compositor_frame = compositor_context.AcquireFrame( - surface_->GetContext(), frame->SkiaCanvas(), true); - - if (compositor_frame && compositor_frame->Raster(layer_tree, false)) { - frame->Submit(); - FireNextFrameCallbackIfPresent(); - return true; - } - - return false; -} - -static sk_sp ScreenshotLayerTreeAsPicture(flow::LayerTree* tree) { - FXL_DCHECK(tree != nullptr); - SkPictureRecorder recorder; - recorder.beginRecording( - SkRect::MakeWH(tree->frame_size().width(), tree->frame_size().height())); - - flow::CompositorContext compositor_context; - auto frame = compositor_context.AcquireFrame( - nullptr, recorder.getRecordingCanvas(), false); - - frame->Raster(*tree, true); - - return recorder.finishRecordingAsPicture(); -} - -static sk_sp ScreenshotLayerTreeAsImage(flow::LayerTree* tree, - bool compressed) { - const SkISize& frame_size = tree->frame_size(); - SkBitmap bitmap; - if (!bitmap.tryAllocN32Pixels(frame_size.width(), frame_size.height())) { - return nullptr; - } - auto bitmap_surface = SkSurface::MakeRasterDirect( - bitmap.info(), bitmap.getPixels(), bitmap.rowBytes()); - flow::CompositorContext compositor_context; - auto canvas = bitmap_surface->getCanvas(); - auto frame = compositor_context.AcquireFrame(nullptr, canvas, false); - canvas->clear(SK_ColorBLACK); - frame->Raster(*tree, true); - canvas->flush(); - if (compressed) { - return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); - } else { - return SkData::MakeWithCopy(bitmap.getPixels(), bitmap.computeByteSize()); - } - return nullptr; -} - -Rasterizer::Screenshot Rasterizer::ScreenshotLastLayerTree( - Rasterizer::ScreenshotType type, - bool base64_encode) { - auto layer_tree = GetLastLayerTree(); - if (layer_tree == nullptr) { - FXL_DLOG(INFO) << "Last layer tree was null when screenshotting."; - return {}; - } - - sk_sp data = nullptr; - - switch (type) { - case ScreenshotType::SkiaPicture: - data = ScreenshotLayerTreeAsPicture(layer_tree)->serialize(); - break; - case ScreenshotType::UncompressedImage: - data = ScreenshotLayerTreeAsImage(layer_tree, false); - break; - case ScreenshotType::CompressedImage: - data = ScreenshotLayerTreeAsImage(layer_tree, true); - break; - } - - if (data == nullptr) { - FXL_DLOG(INFO) << "Sceenshot data was null."; - return {}; - } - - if (base64_encode) { - size_t b64_size = SkBase64::Encode(data->data(), data->size(), nullptr); - auto b64_data = SkData::MakeUninitialized(b64_size); - SkBase64::Encode(data->data(), data->size(), b64_data->writable_data()); - return Rasterizer::Screenshot{b64_data, layer_tree->frame_size()}; - } - - return Rasterizer::Screenshot{data, layer_tree->frame_size()}; -} - -void Rasterizer::SetNextFrameCallback(fxl::Closure callback) { - next_frame_callback_ = callback; -} - -void Rasterizer::FireNextFrameCallbackIfPresent() { - if (!next_frame_callback_) { - return; - } - // It is safe for the callback to set a new callback. - auto callback = next_frame_callback_; - next_frame_callback_ = nullptr; - callback(); -} - } // namespace shell diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 908717b74c168..6f45f49d8178a 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -7,7 +7,6 @@ #include -#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" @@ -17,64 +16,34 @@ namespace shell { -class Rasterizer final { +class Rasterizer { public: - Rasterizer(blink::TaskRunners task_runners); + virtual ~Rasterizer(); - ~Rasterizer(); + virtual void Setup(std::unique_ptr surface_or_null, + fxl::Closure rasterizer_continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) = 0; - void Setup(std::unique_ptr surface); + virtual void Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) = 0; - void Teardown(); + virtual void Clear(SkColor color, const SkISize& size) = 0; - fml::WeakPtr GetWeakPtr() const; + virtual fml::WeakPtr GetWeakRasterizerPtr() = 0; - flow::LayerTree* GetLastLayerTree(); + virtual flow::LayerTree* GetLastLayerTree() = 0; - void DrawLastLayerTree(); + virtual void DrawLastLayerTree() = 0; - flow::TextureRegistry* GetTextureRegistry(); + virtual flow::TextureRegistry& GetTextureRegistry() = 0; - void Draw(fxl::RefPtr> pipeline); + virtual void Draw( + fxl::RefPtr> pipeline) = 0; - enum class ScreenshotType { - SkiaPicture, - UncompressedImage, // In kN32_SkColorType format - CompressedImage, - }; + // Set a callback to be called once when the next frame is drawn. + virtual void AddNextFrameCallback(fxl::Closure nextFrameCallback) = 0; - struct Screenshot { - sk_sp data; - SkISize frame_size = SkISize::MakeEmpty(); - - Screenshot() {} - - Screenshot(sk_sp p_data, SkISize p_size) - : data(std::move(p_data)), frame_size(p_size) {} - }; - - Screenshot ScreenshotLastLayerTree(ScreenshotType type, bool base64_encode); - - // Sets a callback that will be executed after the next frame is submitted to - // the surface on the GPU task runner. - void SetNextFrameCallback(fxl::Closure callback); - - private: - blink::TaskRunners task_runners_; - std::unique_ptr surface_; - std::unique_ptr compositor_context_; - std::unique_ptr last_layer_tree_; - fxl::Closure next_frame_callback_; - fml::WeakPtr weak_prototype_; - fml::WeakPtrFactory weak_factory_; - - void DoDraw(std::unique_ptr layer_tree); - - bool DrawToSurface(flow::LayerTree& layer_tree); - - void FireNextFrameCallbackIfPresent(); - - FXL_DISALLOW_COPY_AND_ASSIGN(Rasterizer); + virtual void SetTextureRegistry(flow::TextureRegistry* textureRegistry) = 0; }; } // namespace shell diff --git a/shell/common/run_configuration.cc b/shell/common/run_configuration.cc deleted file mode 100644 index 7fb385fb4d9dc..0000000000000 --- a/shell/common/run_configuration.cc +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2017 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/shell/common/run_configuration.h" - -#include - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/fml/file.h" -#include "flutter/runtime/dart_vm.h" - -namespace shell { - -RunConfiguration RunConfiguration::InferFromSettings( - const blink::Settings& settings) { - auto asset_manager = fxl::MakeRefCounted(); - - asset_manager->PushBack(std::make_unique( - fml::Duplicate(settings.assets_dir))); - - asset_manager->PushBack( - std::make_unique(fml::OpenFile( - settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); - - asset_manager->PushBack( - std::make_unique(settings.flx_path)); - - return {IsolateConfiguration::InferFromSettings(settings, asset_manager), - asset_manager}; -} - -RunConfiguration::RunConfiguration( - std::unique_ptr configuration) - : RunConfiguration(std::move(configuration), - fxl::MakeRefCounted()) {} - -RunConfiguration::RunConfiguration( - std::unique_ptr configuration, - fxl::RefPtr asset_manager) - : isolate_configuration_(std::move(configuration)), - asset_manager_(std::move(asset_manager)) {} - -RunConfiguration::RunConfiguration(RunConfiguration&&) = default; - -RunConfiguration::~RunConfiguration() = default; - -bool RunConfiguration::IsValid() const { - return asset_manager_ && isolate_configuration_; -} - -bool RunConfiguration::AddAssetResolver( - std::unique_ptr resolver) { - if (!resolver || !resolver->IsValid()) { - return false; - } - - asset_manager_->PushBack(std::move(resolver)); - return true; -} - -void RunConfiguration::SetEntrypoint(std::string entrypoint) { - entrypoint_ = std::move(entrypoint); -} - -fxl::RefPtr RunConfiguration::GetAssetManager() const { - return asset_manager_; -} - -const std::string& RunConfiguration::GetEntrypoint() const { - return entrypoint_; -} - -std::unique_ptr -RunConfiguration::TakeIsolateConfiguration() { - return std::move(isolate_configuration_); -} - -} // namespace shell diff --git a/shell/common/run_configuration.h b/shell/common/run_configuration.h deleted file mode 100644 index 59aa07566685c..0000000000000 --- a/shell/common/run_configuration.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2017 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_SHELL_COMMON_RUN_CONFIGURATION_H_ -#define FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ - -#include -#include - -#include "flutter/assets/asset_manager.h" -#include "flutter/assets/asset_resolver.h" -#include "flutter/common/settings.h" -#include "flutter/fml/mapping.h" -#include "flutter/shell/common/isolate_configuration.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class RunConfiguration { - public: - static RunConfiguration InferFromSettings(const blink::Settings& settings); - - RunConfiguration(std::unique_ptr configuration); - - RunConfiguration(std::unique_ptr configuration, - fxl::RefPtr asset_manager); - - RunConfiguration(RunConfiguration&&); - - ~RunConfiguration(); - - bool IsValid() const; - - bool AddAssetResolver(std::unique_ptr resolver); - - void SetEntrypoint(std::string entrypoint); - - fxl::RefPtr GetAssetManager() const; - - const std::string& GetEntrypoint() const; - - std::unique_ptr TakeIsolateConfiguration(); - - private: - std::unique_ptr isolate_configuration_; - fxl::RefPtr asset_manager_; - std::string entrypoint_ = "main"; - - FXL_DISALLOW_COPY_AND_ASSIGN(RunConfiguration); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 6bb051460eaef..14f8fee84bb5f 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -2,863 +2,362 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#define RAPIDJSON_HAS_STDSTRING 1 - #include "flutter/shell/common/shell.h" +#include #include #include #include -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/fml/file.h" +#include "flutter/common/settings.h" +#include "flutter/common/threads.h" #include "flutter/fml/icu_util.h" #include "flutter/fml/message_loop.h" -#include "flutter/glue/trace_event.h" -#include "flutter/runtime/dart_vm.h" +#include "flutter/fml/trace_event.h" +#include "flutter/runtime/dart_init.h" #include "flutter/shell/common/engine.h" +#include "flutter/shell/common/platform_view_service_protocol.h" #include "flutter/shell/common/skia_event_tracer_impl.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/logging.h" #include "third_party/dart/runtime/include/dart_tools_api.h" #include "third_party/skia/include/core/SkGraphics.h" -#ifdef ERROR -#undef ERROR -#endif - namespace shell { +namespace { -std::unique_ptr Shell::CreateShellOnPlatformThread( - blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer) { - if (!task_runners.IsValid()) { - return nullptr; - } - - auto shell = std::unique_ptr(new Shell(task_runners, settings)); - - // Create the platform view on the platform thread (this thread). - auto platform_view = on_create_platform_view(*shell.get()); - if (!platform_view || !platform_view->GetWeakPtr()) { - return nullptr; - } - - // Ask the platform view for the vsync waiter. This will be used by the engine - // to create the animator. - auto vsync_waiter = platform_view->CreateVSyncWaiter(); - if (!vsync_waiter) { - return nullptr; - } - - // Create the IO manager on the IO thread. The IO manager must be initialized - // first because it has state that the other subsystems depend on. It must - // first be booted and the necessary references obtained to initialize the - // other subsystems. - fxl::AutoResetWaitableEvent io_latch; - std::unique_ptr io_manager; - fml::WeakPtr resource_context; - fxl::RefPtr unref_queue; - auto io_task_runner = shell->GetTaskRunners().GetIOTaskRunner(); - fml::TaskRunner::RunNowOrPostTask( - io_task_runner, - [&io_latch, // - &io_manager, // - &resource_context, // - &unref_queue, // - &platform_view, // - io_task_runner // - ]() { - io_manager = std::make_unique( - platform_view->CreateResourceContext(), io_task_runner); - resource_context = io_manager->GetResourceContext(); - unref_queue = io_manager->GetSkiaUnrefQueue(); - io_latch.Signal(); - }); - io_latch.Wait(); - - // Create the rasterizer on the GPU thread. - fxl::AutoResetWaitableEvent gpu_latch; - std::unique_ptr rasterizer; - fml::TaskRunner::RunNowOrPostTask( - task_runners.GetGPUTaskRunner(), [&gpu_latch, // - &rasterizer, // - on_create_rasterizer, // - shell = shell.get() // - ]() { - if (auto new_rasterizer = on_create_rasterizer(*shell)) { - rasterizer = std::move(new_rasterizer); - } - gpu_latch.Signal(); - }); - - // Create the engine on the UI thread. - fxl::AutoResetWaitableEvent ui_latch; - std::unique_ptr engine; - fml::TaskRunner::RunNowOrPostTask( - shell->GetTaskRunners().GetUITaskRunner(), - fxl::MakeCopyable([&ui_latch, // - &engine, // - shell = shell.get(), // - vsync_waiter = std::move(vsync_waiter), // - resource_context = std::move(resource_context), // - unref_queue = std::move(unref_queue) // - ]() mutable { - const auto& task_runners = shell->GetTaskRunners(); - - // The animator is owned by the UI thread but it gets its vsync pulses - // from the platform. - auto animator = std::make_unique(*shell, task_runners, - std::move(vsync_waiter)); - - engine = std::make_unique(*shell, // - shell->GetDartVM(), // - task_runners, // - shell->GetSettings(), // - std::move(animator), // - std::move(resource_context), // - std::move(unref_queue) // - ); - ui_latch.Signal(); - })); - - gpu_latch.Wait(); - ui_latch.Wait(); - // We are already on the platform thread. So there is no platform latch to - // wait on. - - if (!shell->Setup(std::move(platform_view), // - std::move(engine), // - std::move(rasterizer), // - std::move(io_manager)) // - ) { - return nullptr; - } - - return shell; -} - -std::unique_ptr Shell::Create( - blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer) { - if (!task_runners.IsValid() || !on_create_platform_view || - !on_create_rasterizer) { - return nullptr; - } - - fxl::AutoResetWaitableEvent latch; - std::unique_ptr shell; - fml::TaskRunner::RunNowOrPostTask( - task_runners.GetPlatformTaskRunner(), - [&latch, &shell, task_runners = std::move(task_runners), settings, - on_create_platform_view, on_create_rasterizer]() { - shell = CreateShellOnPlatformThread(std::move(task_runners), settings, - on_create_platform_view, - on_create_rasterizer); - latch.Signal(); - }); - latch.Wait(); - return shell; -} - -Shell::Shell(blink::TaskRunners task_runners, blink::Settings settings) - : task_runners_(std::move(task_runners)), - settings_(std::move(settings)), - vm_(blink::DartVM::ForProcess(settings_)) { - FXL_DCHECK(task_runners_.IsValid()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - if (settings_.icu_data_path.size() != 0) { - fml::icu::InitializeICU(settings_.icu_data_path); - } else { - FXL_DLOG(WARNING) << "Skipping ICU initialization in the shell."; - } - - if (settings_.trace_skia) { - InitSkiaEventTracer(settings_.trace_skia); - } - - if (!settings_.skia_deterministic_rendering_on_cpu) { - SkGraphics::Init(); - } else { - FXL_DLOG(INFO) << "Skia deterministic rendering is enabled."; - } - - // Install service protocol handlers. - - service_protocol_handlers_[blink::ServiceProtocol::kScreenshotExtensionName - .ToString()] = { - task_runners_.GetGPUTaskRunner(), - std::bind(&Shell::OnServiceProtocolScreenshot, this, - std::placeholders::_1, std::placeholders::_2)}; - service_protocol_handlers_[blink::ServiceProtocol::kScreenshotSkpExtensionName - .ToString()] = { - task_runners_.GetGPUTaskRunner(), - std::bind(&Shell::OnServiceProtocolScreenshotSKP, this, - std::placeholders::_1, std::placeholders::_2)}; - service_protocol_handlers_[blink::ServiceProtocol::kRunInViewExtensionName - .ToString()] = { - task_runners_.GetUITaskRunner(), - std::bind(&Shell::OnServiceProtocolRunInView, this, std::placeholders::_1, - std::placeholders::_2)}; - service_protocol_handlers_ - [blink::ServiceProtocol::kFlushUIThreadTasksExtensionName.ToString()] = { - task_runners_.GetUITaskRunner(), - std::bind(&Shell::OnServiceProtocolFlushUIThreadTasks, this, - std::placeholders::_1, std::placeholders::_2)}; - service_protocol_handlers_ - [blink::ServiceProtocol::kSetAssetBundlePathExtensionName.ToString()] = { - task_runners_.GetUITaskRunner(), - std::bind(&Shell::OnServiceProtocolSetAssetBundlePath, this, - std::placeholders::_1, std::placeholders::_2)}; -} - -Shell::~Shell() { - if (auto vm = blink::DartVM::ForProcessIfInitialized()) { - vm->GetServiceProtocol().RemoveHandler(this); - } - - fxl::AutoResetWaitableEvent ui_latch, gpu_latch, platform_latch, io_latch; - - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetUITaskRunner(), - fxl::MakeCopyable([engine = std::move(engine_), &ui_latch]() mutable { - engine.reset(); - ui_latch.Signal(); - })); - ui_latch.Wait(); - - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetGPUTaskRunner(), - fxl::MakeCopyable( - [rasterizer = std::move(rasterizer_), &gpu_latch]() mutable { - rasterizer.reset(); - gpu_latch.Signal(); - })); - gpu_latch.Wait(); - - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetIOTaskRunner(), - fxl::MakeCopyable( - [io_manager = std::move(io_manager_), &io_latch]() mutable { - io_manager.reset(); - io_latch.Signal(); - })); - - io_latch.Wait(); - - // The platform view must go last because it may be holding onto platform side - // counterparts to resources owned by subsystems running on other threads. For - // example, the NSOpenGLContext on the Mac. - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetPlatformTaskRunner(), - fxl::MakeCopyable([platform_view = std::move(platform_view_), - &platform_latch]() mutable { - platform_view.reset(); - platform_latch.Signal(); - })); - platform_latch.Wait(); -} - -bool Shell::IsSetup() const { - return is_setup_; -} +static Shell* g_shell = nullptr; -bool Shell::Setup(std::unique_ptr platform_view, - std::unique_ptr engine, - std::unique_ptr rasterizer, - std::unique_ptr io_manager) { - if (is_setup_) { - return false; - } +template +bool GetSwitchValue(const fxl::CommandLine& command_line, + Switch sw, + T* result) { + std::string switch_string; - if (!platform_view || !engine || !rasterizer || !io_manager) { + if (!command_line.GetOptionValue(FlagForSwitch(sw), &switch_string)) { return false; } - platform_view_ = std::move(platform_view); - engine_ = std::move(engine); - rasterizer_ = std::move(rasterizer); - io_manager_ = std::move(io_manager); - - is_setup_ = true; - - if (auto vm = blink::DartVM::ForProcessIfInitialized()) { - vm->GetServiceProtocol().AddHandler(this); + std::stringstream stream(switch_string); + T value = 0; + if (stream >> value) { + *result = value; + return true; } - return true; + return false; } -const blink::Settings& Shell::GetSettings() const { - return settings_; -} +} // namespace -const blink::TaskRunners& Shell::GetTaskRunners() const { - return task_runners_; -} +Shell::Shell(fxl::CommandLine command_line) + : command_line_(std::move(command_line)) { + FXL_DCHECK(!g_shell); -fml::WeakPtr Shell::GetRasterizer() { - FXL_DCHECK(is_setup_); - return rasterizer_->GetWeakPtr(); -} + gpu_thread_.reset(new fml::Thread("gpu_thread")); + ui_thread_.reset(new fml::Thread("ui_thread")); + io_thread_.reset(new fml::Thread("io_thread")); -fml::WeakPtr Shell::GetEngine() { - FXL_DCHECK(is_setup_); - return engine_->GetWeakPtr(); -} + // Since we are not using fml::Thread, we need to initialize the message loop + // manually. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::Threads threads(fml::MessageLoop::GetCurrent().GetTaskRunner(), + gpu_thread_->GetTaskRunner(), + ui_thread_->GetTaskRunner(), + io_thread_->GetTaskRunner()); + blink::Threads::Set(threads); -fml::WeakPtr Shell::GetPlatformView() { - FXL_DCHECK(is_setup_); - return platform_view_->GetWeakPtr(); -} + blink::Threads::Gpu()->PostTask([this]() { InitGpuThread(); }); + blink::Threads::UI()->PostTask([this]() { InitUIThread(); }); -const blink::DartVM& Shell::GetDartVM() const { - return *vm_; + blink::SetRegisterNativeServiceProtocolExtensionHook( + PlatformViewServiceProtocol::RegisterHook); } -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewCreated(const PlatformView& view, - std::unique_ptr surface) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - // Note: - // This is a synchronous operation because certain platforms depend on - // setup/suspension of all activities that may be interacting with the GPU in - // a synchronous fashion. +Shell::~Shell() {} - fxl::AutoResetWaitableEvent latch; - auto gpu_task = fxl::MakeCopyable([rasterizer = rasterizer_->GetWeakPtr(), // - surface = std::move(surface), // - &latch]() mutable { - if (rasterizer) { - rasterizer->Setup(std::move(surface)); - } - // Step 2: All done. Signal the latch that the platform thread is waiting - // on. - latch.Signal(); - }); +void Shell::InitStandalone(fxl::CommandLine command_line, + std::string icu_data_path, + std::string application_library_path, + std::string bundle_path) { + TRACE_EVENT0("flutter", "Shell::InitStandalone"); - auto ui_task = [engine = engine_->GetWeakPtr(), // - gpu_task_runner = task_runners_.GetGPUTaskRunner(), // - gpu_task // - ] { - if (engine) { - engine->OnOutputSurfaceCreated(); - } - // Step 1: Next, tell the GPU thread that it should create a surface for its - // rasterizer. - fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); - }; - - // Step 0: Post a task onto the UI thread to tell the engine that it has an - // output surface. - fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); - latch.Wait(); -} + fml::icu::InitializeICU(icu_data_path); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewDestroyed(const PlatformView& view) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + if (!command_line.HasOption( + FlagForSwitch(Switch::SkiaDeterministicRendering))) + SkGraphics::Init(); - // Note: - // This is a synchronous operation because certain platforms depend on - // setup/suspension of all activities that may be interacting with the GPU in - // a synchronous fashion. + blink::Settings settings; + settings.application_library_path = application_library_path; - fxl::AutoResetWaitableEvent latch; + // Enable Observatory + settings.enable_observatory = + !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); - auto gpu_task = [rasterizer = rasterizer_->GetWeakPtr(), &latch]() { - if (rasterizer) { - rasterizer->Teardown(); + // Set Observatory Port + if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { + if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, + &settings.observatory_port)) { + FXL_LOG(INFO) + << "Observatory port specified was malformed. Will default to " + << settings.observatory_port; } - // Step 2: All done. Signal the latch that the platform thread is waiting - // on. - latch.Signal(); - }; - - auto ui_task = [engine = engine_->GetWeakPtr(), - gpu_task_runner = task_runners_.GetGPUTaskRunner(), - gpu_task]() { - if (engine) { - engine->OnOutputSurfaceDestroyed(); - } - // Step 1: Next, tell the GPU thread that its rasterizer should suspend - // access to the underlying surface. - fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); - }; - - // Step 0: Post a task onto the UI thread to tell the engine that its output - // surface is about to go away. - fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); - latch.Wait(); -} + } -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewSetViewportMetrics( - const PlatformView& view, - const blink::ViewportMetrics& metrics) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetUITaskRunner()->PostTask( - [engine = engine_->GetWeakPtr(), metrics]() { - if (engine) { - engine->SetViewportMetrics(metrics); - } - }); -} + // Checked mode overrides. + settings.dart_non_checked_mode = + command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewDispatchPlatformMessage( - const PlatformView& view, - fxl::RefPtr message) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetUITaskRunner()->PostTask( - [engine = engine_->GetWeakPtr(), message = std::move(message)] { - if (engine) { - engine->DispatchPlatformMessage(std::move(message)); - } - }); -} + settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewDispatchPointerDataPacket( - const PlatformView& view, - std::unique_ptr packet) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - task_runners_.GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [engine = engine_->GetWeakPtr(), packet = std::move(packet)] { - if (engine) { - engine->DispatchPointerDataPacket(*packet); - } - })); -} + settings.start_paused = + command_line.HasOption(FlagForSwitch(Switch::StartPaused)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewDispatchSemanticsAction(const PlatformView& view, - int32_t id, - blink::SemanticsAction action, - std::vector args) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetUITaskRunner()->PostTask( - [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { - if (engine) { - engine->DispatchSemanticsAction(id, action, std::move(args)); - } - }); -} + settings.enable_dart_profiling = + command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewSetSemanticsEnabled(const PlatformView& view, - bool enabled) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetUITaskRunner()->PostTask( - [engine = engine_->GetWeakPtr(), enabled] { - if (engine) { - engine->SetSemanticsEnabled(enabled); - } - }); -} + settings.enable_software_rendering = + command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewRegisterTexture( - const PlatformView& view, - std::shared_ptr texture) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), texture] { - if (rasterizer) { - if (auto registry = rasterizer->GetTextureRegistry()) { - registry->RegisterTexture(texture); - } - } - }); -} + settings.using_blink = + command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewUnregisterTexture(const PlatformView& view, - int64_t texture_id) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { - if (rasterizer) { - if (auto registry = rasterizer->GetTextureRegistry()) { - registry->UnregisterTexture(texture_id); - } - } - }); -} + settings.endless_trace_buffer = + command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, - int64_t texture_id) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + settings.trace_startup = + command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); - // Tell the rasterizer that one of its textures has a new frame available. - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { - auto registry = rasterizer->GetTextureRegistry(); + command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), + &settings.aot_snapshot_path); - if (!registry) { - return; - } + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), + &settings.aot_vm_snapshot_data_filename); - auto texture = registry->GetTexture(texture_id); + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), + &settings.aot_vm_snapshot_instr_filename); - if (!texture) { - return; - } + command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), + &settings.aot_isolate_snapshot_data_filename); - texture->MarkNewFrameAvailable(); - }); + command_line.GetOptionValue(FlagForSwitch(Switch::AotSharedLibraryPath), + &settings.aot_shared_library_path); - // Schedule a new frame without having to rebuild the layer tree. - task_runners_.GetUITaskRunner()->PostTask([engine = engine_->GetWeakPtr()]() { - if (engine) { - engine->ScheduleFrame(false); - } - }); -} + command_line.GetOptionValue( + FlagForSwitch(Switch::AotIsolateSnapshotInstructions), + &settings.aot_isolate_snapshot_instr_filename); -// |shell::PlatformView::Delegate| -void Shell::OnPlatformViewSetNextFrameCallback(const PlatformView& view, - fxl::Closure closure) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), closure = std::move(closure)]() { - if (rasterizer) { - rasterizer->SetNextFrameCallback(std::move(closure)); - } - }); -} + command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), + &settings.temp_directory_path); -// |shell::Animator::Delegate| -void Shell::OnAnimatorBeginFrame(const Animator& animator, - fxl::TimePoint frame_time) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + settings.use_test_fonts = + command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); - if (engine_) { - engine_->BeginFrame(frame_time); + std::string all_dart_flags; + if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), + &all_dart_flags)) { + std::stringstream stream(all_dart_flags); + std::istream_iterator end; + for (std::istream_iterator it(stream); it != end; ++it) + settings.dart_flags.push_back(*it); } -} -// |shell::Animator::Delegate| -void Shell::OnAnimatorNotifyIdle(const Animator& animator, int64_t deadline) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); - if (engine_) { - engine_->NotifyIdle(deadline); - } -} + blink::Settings::Set(settings); -// |shell::Animator::Delegate| -void Shell::OnAnimatorDraw( - const Animator& animator, - fxl::RefPtr> pipeline) { - FXL_DCHECK(is_setup_); - - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr(), - pipeline = std::move(pipeline)]() { - if (rasterizer) { - rasterizer->Draw(pipeline); - } - }); + Init(std::move(command_line), bundle_path); } -// |shell::Animator::Delegate| -void Shell::OnAnimatorDrawLastLayerTree(const Animator& animator) { - FXL_DCHECK(is_setup_); - - task_runners_.GetGPUTaskRunner()->PostTask( - [rasterizer = rasterizer_->GetWeakPtr()]() { - if (rasterizer) { - rasterizer->DrawLastLayerTree(); - } - }); -} - -// |shell::Engine::Delegate| -void Shell::OnEngineUpdateSemantics(const Engine& engine, - blink::SemanticsNodeUpdates update) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); +void Shell::Init(fxl::CommandLine command_line, + const std::string& bundle_path) { +#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE + bool trace_skia = command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); + InitSkiaEventTracer(trace_skia); +#endif - task_runners_.GetPlatformTaskRunner()->PostTask( - [view = platform_view_->GetWeakPtr(), update = std::move(update)] { - if (view) { - view->UpdateSemantics(std::move(update)); - } - }); + FXL_DCHECK(!g_shell); + g_shell = new Shell(std::move(command_line)); + blink::Threads::UI()->PostTask( + [bundle_path]() { Engine::Init(bundle_path); }); } -// |shell::Engine::Delegate| -void Shell::OnEngineHandlePlatformMessage( - const Engine& engine, - fxl::RefPtr message) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetPlatformTaskRunner()->PostTask( - [view = platform_view_->GetWeakPtr(), message = std::move(message)]() { - if (view) { - view->HandlePlatformMessage(std::move(message)); - } - }); +Shell& Shell::Shared() { + FXL_DCHECK(g_shell); + return *g_shell; } -// |blink::ServiceProtocol::Handler| -fxl::RefPtr Shell::GetServiceProtocolHandlerTaskRunner( - fxl::StringView method) const { - FXL_DCHECK(is_setup_); - auto found = service_protocol_handlers_.find(method.ToString()); - if (found != service_protocol_handlers_.end()) { - return found->second.first; - } - return task_runners_.GetUITaskRunner(); +const fxl::CommandLine& Shell::GetCommandLine() const { + return command_line_; } -// |blink::ServiceProtocol::Handler| -bool Shell::HandleServiceProtocolMessage( - fxl::StringView method, // one if the extension names specified above. - const ServiceProtocolMap& params, - rapidjson::Document& response) { - auto found = service_protocol_handlers_.find(method.ToString()); - if (found != service_protocol_handlers_.end()) { - return found->second.second(params, response); - } - return false; +void Shell::InitGpuThread() { + gpu_thread_checker_.reset(new fxl::ThreadChecker()); } -// |blink::ServiceProtocol::Handler| -blink::ServiceProtocol::Handler::Description -Shell::GetServiceProtocolDescription() const { - return { - engine_->GetUIIsolateMainPort(), - engine_->GetUIIsolateName(), - }; +void Shell::InitUIThread() { + ui_thread_checker_.reset(new fxl::ThreadChecker()); } -static void ServiceProtocolParameterError(rapidjson::Document& response, - std::string parameter_name) { - auto& allocator = response.GetAllocator(); - response.SetObject(); - const int64_t kInvalidParams = -32602; - response.AddMember("code", kInvalidParams, allocator); - response.AddMember("message", "Invalid params", allocator); - { - rapidjson::Value details(rapidjson::kObjectType); - details.AddMember("details", parameter_name, allocator); - response.AddMember("data", details, allocator); +void Shell::AddPlatformView(PlatformView* platform_view) { + if (platform_view == nullptr) { + return; } + std::lock_guard lock(platform_views_mutex_); + platform_views_.insert(platform_view); } -// Service protocol handler -bool Shell::OnServiceProtocolScreenshot( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); - auto screenshot = rasterizer_->ScreenshotLastLayerTree( - Rasterizer::ScreenshotType::CompressedImage, true); - if (screenshot.data) { - response.SetObject(); - auto& allocator = response.GetAllocator(); - response.AddMember("type", "Screenshot", allocator); - rapidjson::Value image; - image.SetString(static_cast(screenshot.data->data()), - screenshot.data->size(), allocator); - response.AddMember("screenshot", image, allocator); - return true; +void Shell::RemovePlatformView(PlatformView* platform_view) { + if (platform_view == nullptr) { + return; } - ServiceProtocolParameterError(response, - "Could not capture image screenshot."); - return false; + std::lock_guard lock(platform_views_mutex_); + platform_views_.erase(platform_view); } -// Service protocol handler -bool Shell::OnServiceProtocolScreenshotSKP( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); - auto screenshot = rasterizer_->ScreenshotLastLayerTree( - Rasterizer::ScreenshotType::SkiaPicture, true); - if (screenshot.data) { - response.SetObject(); - auto& allocator = response.GetAllocator(); - response.AddMember("type", "ScreenshotSkp", allocator); - rapidjson::Value skp; - skp.SetString(static_cast(screenshot.data->data()), - screenshot.data->size(), allocator); - response.AddMember("skp", skp, allocator); - return true; +void Shell::IteratePlatformViews( + std::function iterator) const { + if (iterator == nullptr) { + return; } - ServiceProtocolParameterError(response, "Could not capture SKP screenshot."); - return false; -} - -// Service protocol handler -bool Shell::OnServiceProtocolRunInView( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - - if (params.count("mainScript") == 0) { - ServiceProtocolParameterError(response, - "'mainScript' parameter is missing."); - return false; - } - - if (params.count("packagesFile") == 0) { - ServiceProtocolParameterError(response, - "'packagesFile' parameter is missing."); - return false; - } - - if (params.count("assetDirectory") == 0) { - ServiceProtocolParameterError(response, - "'assetDirectory' parameter is missing."); - return false; - } - - RunConfiguration configuration(IsolateConfiguration::CreateForSource( - params.at("mainScript").ToString(), - params.at("packagesFile").ToString())); - - configuration.AddAssetResolver(std::make_unique( - fml::OpenFile(params.at("assetDirectory").ToString().c_str(), - fml::OpenPermission::kRead, true))); - - auto& allocator = response.GetAllocator(); - response.SetObject(); - if (engine_->Restart(std::move(configuration))) { - response.AddMember("type", "Success", allocator); - auto new_description = GetServiceProtocolDescription(); - rapidjson::Value view(rapidjson::kObjectType); - new_description.Write(this, view, allocator); - response.AddMember("view", view, allocator); - return true; - } else { - FXL_DLOG(ERROR) << "Could not run configuration in engine."; - response.AddMember("type", "Failure", allocator); - return false; + std::lock_guard lock(platform_views_mutex_); + for (PlatformView* view : platform_views_) { + if (!iterator(view)) { + return; + } } - - FXL_DCHECK(false); - return false; } -// Service protocol handler -bool Shell::OnServiceProtocolFlushUIThreadTasks( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - // This API should not be invoked by production code. - // It can potentially starve the service isolate if the main isolate pauses - // at a breakpoint or is in an infinite loop. - // - // It should be invoked from the VM Service and and blocks it until UI thread - // tasks are processed. - response.SetObject(); - response.AddMember("type", "Success", response.GetAllocator()); - return true; +void Shell::RunInPlatformView(uintptr_t view_id, + const char* main_script, + const char* packages_file, + const char* asset_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name) { + fxl::AutoResetWaitableEvent latch; + FXL_DCHECK(view_id != 0); + FXL_DCHECK(main_script); + FXL_DCHECK(packages_file); + FXL_DCHECK(asset_directory); + FXL_DCHECK(view_existed); + + blink::Threads::UI()->PostTask([this, view_id, main_script, packages_file, + asset_directory, view_existed, + dart_isolate_id, isolate_name, &latch]() { + RunInPlatformViewUIThread(view_id, main_script, packages_file, + asset_directory, view_existed, dart_isolate_id, + isolate_name, &latch); + }); + latch.Wait(); } -// Service protocol handler -bool Shell::OnServiceProtocolSetAssetBundlePath( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response) { - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - - if (params.count("assetDirectory") == 0) { - ServiceProtocolParameterError(response, - "'assetDirectory' parameter is missing."); - return false; - } - - auto& allocator = response.GetAllocator(); - response.SetObject(); - - auto asset_manager = fxl::MakeRefCounted(); - - asset_manager->PushFront(std::make_unique( - fml::OpenFile(params.at("assetDirectory").ToString().c_str(), - fml::OpenPermission::kRead, true))); - - if (engine_->UpdateAssetManager(std::move(asset_manager))) { - response.AddMember("type", "Success", allocator); - auto new_description = GetServiceProtocolDescription(); - rapidjson::Value view(rapidjson::kObjectType); - new_description.Write(this, view, allocator); - response.AddMember("view", view, allocator); - return true; - } else { - FXL_DLOG(ERROR) << "Could not update asset directory."; - response.AddMember("type", "Failure", allocator); - return false; - } +void Shell::RunInPlatformViewUIThread(uintptr_t view_id, + const std::string& main, + const std::string& packages, + const std::string& assets_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name, + fxl::AutoResetWaitableEvent* latch) { + FXL_DCHECK(ui_thread_checker_ && + ui_thread_checker_->IsCreationThreadCurrent()); + + *view_existed = false; + + IteratePlatformViews( + [view_id, // argument +#if !defined(OS_WIN) + // Using std::move on const references inside lambda capture is + // not supported on Windows for some reason. + assets_directory = std::move(assets_directory), // argument + main = std::move(main), // argument + packages = std::move(packages), // argument +#else + assets_directory, // argument + main, // argument + packages, // argument +#endif + &view_existed, // out + &dart_isolate_id, // out + &isolate_name // out + ](PlatformView* view) -> bool { + if (reinterpret_cast(view) != view_id) { + // Keep looking. + return true; + } + *view_existed = true; + view->RunFromSource(assets_directory, main, packages); + *dart_isolate_id = view->engine().GetUIIsolateMainPort(); + *isolate_name = view->engine().GetUIIsolateName(); + // We found the requested view. Stop iterating over platform views. + return false; + }); - FXL_DCHECK(false); - return false; + latch->Signal(); } -Rasterizer::Screenshot Shell::Screenshot( - Rasterizer::ScreenshotType screenshot_type, - bool base64_encode) { - TRACE_EVENT0("flutter", "Shell::Screenshot"); +void Shell::SetAssetBundlePathInPlatformView(uintptr_t view_id, + const char* asset_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name) { fxl::AutoResetWaitableEvent latch; - Rasterizer::Screenshot screenshot; - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetGPUTaskRunner(), [&latch, // - rasterizer = GetRasterizer(), // - &screenshot, // - screenshot_type, // - base64_encode // - ]() { - if (rasterizer) { - screenshot = rasterizer->ScreenshotLastLayerTree(screenshot_type, - base64_encode); + FXL_DCHECK(view_id != 0); + FXL_DCHECK(asset_directory); + FXL_DCHECK(view_existed); + + blink::Threads::UI()->PostTask([this, view_id, asset_directory, view_existed, + dart_isolate_id, isolate_name, &latch]() { + SetAssetBundlePathInPlatformViewUIThread(view_id, asset_directory, + view_existed, dart_isolate_id, + isolate_name, &latch); + }); + latch.Wait(); +} + +void Shell::SetAssetBundlePathInPlatformViewUIThread( + uintptr_t view_id, + const std::string& assets_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name, + fxl::AutoResetWaitableEvent* latch) { + FXL_DCHECK(ui_thread_checker_ && + ui_thread_checker_->IsCreationThreadCurrent()); + + *view_existed = false; + + IteratePlatformViews( + [view_id, // argument +#if !defined(OS_WIN) + // Using std::move on const references inside lambda capture is + // not supported on Windows for some reason. + // TODO(https://github.com/flutter/flutter/issues/13908): + // Investigate the root cause of the difference. + assets_directory = std::move(assets_directory), // argument +#else + assets_directory, // argument +#endif + &view_existed, // out + &dart_isolate_id, // out + &isolate_name // out + ](PlatformView* view) -> bool { + if (reinterpret_cast(view) != view_id) { + // Keep looking. + return true; } - latch.Signal(); + *view_existed = true; + view->SetAssetBundlePath(assets_directory); + *dart_isolate_id = view->engine().GetUIIsolateMainPort(); + *isolate_name = view->engine().GetUIIsolateName(); + // We found the requested view. Stop iterating over + // platform views. + return false; }); - latch.Wait(); - return screenshot; + + latch->Signal(); } } // namespace shell diff --git a/shell/common/shell.h b/shell/common/shell.h index 02a642b0ba40f..92c315dcf2aa7 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -5,214 +5,96 @@ #ifndef SHELL_COMMON_SHELL_H_ #define SHELL_COMMON_SHELL_H_ -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" -#include "flutter/flow/texture.h" -#include "flutter/fml/memory/thread_checker.h" -#include "flutter/fml/memory/weak_ptr.h" +#include +#include + #include "flutter/fml/thread.h" -#include "flutter/lib/ui/semantics/semantics_node.h" -#include "flutter/lib/ui/window/platform_message.h" -#include "flutter/runtime/service_protocol.h" -#include "flutter/shell/common/animator.h" -#include "flutter/shell/common/engine.h" -#include "flutter/shell/common/io_manager.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/surface.h" +#include "flutter/shell/common/tracing_controller.h" +#include "lib/fxl/command_line.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" #include "lib/fxl/memory/weak_ptr.h" -#include "lib/fxl/strings/string_view.h" -#include "lib/fxl/synchronization/thread_annotations.h" #include "lib/fxl/synchronization/thread_checker.h" #include "lib/fxl/synchronization/waitable_event.h" +#include "lib/fxl/tasks/task_runner.h" namespace shell { -class Shell final : public PlatformView::Delegate, - public Animator::Delegate, - public Engine::Delegate, - public blink::ServiceProtocol::Handler { - public: - template - using CreateCallback = std::function(Shell&)>; - static std::unique_ptr Create( - blink::TaskRunners task_runners, - blink::Settings settings, - CreateCallback on_create_platform_view, - CreateCallback on_create_rasterizer); +class PlatformView; +class Shell { + public: ~Shell(); - const blink::Settings& GetSettings() const; + static void InitStandalone(fxl::CommandLine command_line, + std::string icu_data_path = "", + std::string application_library_path = "", + std::string bundle_path = ""); - const blink::TaskRunners& GetTaskRunners() const; + static Shell& Shared(); - fml::WeakPtr GetRasterizer(); + const fxl::CommandLine& GetCommandLine() const; - fml::WeakPtr GetEngine(); + void AddPlatformView(PlatformView* platform_view); - fml::WeakPtr GetPlatformView(); + void RemovePlatformView(PlatformView* platform_view); - const blink::DartVM& GetDartVM() const; + void IteratePlatformViews( + std::function iterator) const; - bool IsSetup() const; + // Attempt to run a script inside a flutter view indicated by |view_id|. + // Will set |view_existed| to true if the view was found and false otherwise. + void RunInPlatformView(uintptr_t view_id, + const char* main_script, + const char* packages_file, + const char* asset_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name); - Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, - bool base64_encode); + void SetAssetBundlePathInPlatformView(uintptr_t view_id, + const char* asset_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name); private: - using ServiceProtocolHandler = std::function; - - const blink::TaskRunners task_runners_; - const blink::Settings settings_; - fxl::RefPtr vm_; - std::unique_ptr platform_view_; // on platform task runner - std::unique_ptr engine_; // on UI task runner - std::unique_ptr rasterizer_; // on GPU task runner - std::unique_ptr io_manager_; // on IO task runner - - std::unordered_map, - ServiceProtocolHandler> // task-runner/function - // pair - > - service_protocol_handlers_; - bool is_setup_ = false; - - Shell(blink::TaskRunners task_runners, blink::Settings settings); - - static std::unique_ptr CreateShellOnPlatformThread( - blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer); - - bool Setup(std::unique_ptr platform_view, - std::unique_ptr engine, - std::unique_ptr rasterizer, - std::unique_ptr io_manager); - - // |shell::PlatformView::Delegate| - void OnPlatformViewCreated(const PlatformView& view, - std::unique_ptr surface) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewDestroyed(const PlatformView& view) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewSetViewportMetrics( - const PlatformView& view, - const blink::ViewportMetrics& metrics) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewDispatchPlatformMessage( - const PlatformView& view, - fxl::RefPtr message) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewDispatchPointerDataPacket( - const PlatformView& view, - std::unique_ptr packet) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewDispatchSemanticsAction( - const PlatformView& view, - int32_t id, - blink::SemanticsAction action, - std::vector args) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, - bool enabled) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewRegisterTexture( - const PlatformView& view, - std::shared_ptr texture) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewUnregisterTexture(const PlatformView& view, - int64_t texture_id) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, - int64_t texture_id) override; - - // |shell::PlatformView::Delegate| - void OnPlatformViewSetNextFrameCallback(const PlatformView& view, - fxl::Closure closure) override; - - // |shell::Animator::Delegate| - void OnAnimatorBeginFrame(const Animator& animator, - fxl::TimePoint frame_time) override; - - // |shell::Animator::Delegate| - void OnAnimatorNotifyIdle(const Animator& animator, - int64_t deadline) override; - - // |shell::Animator::Delegate| - void OnAnimatorDraw( - const Animator& animator, - fxl::RefPtr> pipeline) override; - - // |shell::Animator::Delegate| - void OnAnimatorDrawLastLayerTree(const Animator& animator) override; - - // |shell::Engine::Delegate| - void OnEngineUpdateSemantics(const Engine& engine, - blink::SemanticsNodeUpdates update) override; - - // |shell::Engine::Delegate| - void OnEngineHandlePlatformMessage( - const Engine& engine, - fxl::RefPtr message) override; - - // |blink::ServiceProtocol::Handler| - fxl::RefPtr GetServiceProtocolHandlerTaskRunner( - fxl::StringView method) const override; - - // |blink::ServiceProtocol::Handler| - bool HandleServiceProtocolMessage( - fxl::StringView method, // one if the extension names specified above. - const ServiceProtocolMap& params, - rapidjson::Document& response) override; - - // |blink::ServiceProtocol::Handler| - blink::ServiceProtocol::Handler::Description GetServiceProtocolDescription() - const override; - - // Service protocol handler - bool OnServiceProtocolScreenshot( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); - - // Service protocol handler - bool OnServiceProtocolScreenshotSKP( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); - - // Service protocol handler - bool OnServiceProtocolRunInView( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); - - // Service protocol handler - bool OnServiceProtocolFlushUIThreadTasks( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); - - // Service protocol handler - bool OnServiceProtocolSetAssetBundlePath( - const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, - rapidjson::Document& response); + fxl::CommandLine command_line_; + std::unique_ptr gpu_thread_; + std::unique_ptr ui_thread_; + std::unique_ptr io_thread_; + std::unique_ptr gpu_thread_checker_; + std::unique_ptr ui_thread_checker_; + TracingController tracing_controller_; + mutable std::mutex platform_views_mutex_; + std::unordered_set platform_views_; + + static void Init(fxl::CommandLine command_line, + const std::string& bundle_path); + + Shell(fxl::CommandLine command_line); + + void InitGpuThread(); + + void InitUIThread(); + + void RunInPlatformViewUIThread(uintptr_t view_id, + const std::string& main, + const std::string& packages, + const std::string& assets_directory, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name, + fxl::AutoResetWaitableEvent* latch); + + void SetAssetBundlePathInPlatformViewUIThread( + uintptr_t view_id, + const std::string& main, + bool* view_existed, + int64_t* dart_isolate_id, + std::string* isolate_name, + fxl::AutoResetWaitableEvent* latch); FXL_DISALLOW_COPY_AND_ASSIGN(Shell); }; diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc deleted file mode 100644 index 67689341a1586..0000000000000 --- a/shell/common/shell_unittests.cc +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2017 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 -#include -#include - -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/thread_host.h" -#include "gtest/gtest.h" -#include "lib/fxl/synchronization/waitable_event.h" - -#define CURRENT_TEST_NAME \ - std::string { \ - ::testing::UnitTest::GetInstance()->current_test_info()->name() \ - } - -namespace shell { - -TEST(ShellTest, InitializeWithInvalidThreads) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - blink::TaskRunners task_runners("test", nullptr, nullptr, nullptr, nullptr); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_FALSE(shell); -} - -TEST(ShellTest, InitializeWithDifferentThreads) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", - ThreadHost::Type::Platform | ThreadHost::Type::GPU | - ThreadHost::Type::IO | ThreadHost::Type::UI); - blink::TaskRunners task_runners("test", - thread_host.platform_thread->GetTaskRunner(), - thread_host.gpu_thread->GetTaskRunner(), - thread_host.ui_thread->GetTaskRunner(), - thread_host.io_thread->GetTaskRunner()); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_TRUE(shell); -} - -TEST(ShellTest, InitializeWithSingleThread) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", - ThreadHost::Type::Platform); - auto task_runner = thread_host.platform_thread->GetTaskRunner(); - blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, - task_runner); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_TRUE(shell); -} - -TEST(ShellTest, InitializeWithSingleThreadWhichIsTheCallingThread) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - fml::MessageLoop::EnsureInitializedForCurrentThread(); - auto task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); - blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, - task_runner); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_TRUE(shell); -} - -TEST(ShellTest, InitializeWithMultipleThreadButCallingThreadAsPlatformThread) { - blink::Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; - ThreadHost thread_host( - "io.flutter.test." + CURRENT_TEST_NAME + ".", - ThreadHost::Type::GPU | ThreadHost::Type::IO | ThreadHost::Type::UI); - fml::MessageLoop::EnsureInitializedForCurrentThread(); - blink::TaskRunners task_runners( - "test", fml::MessageLoop::GetCurrent().GetTaskRunner(), - thread_host.gpu_thread->GetTaskRunner(), - thread_host.ui_thread->GetTaskRunner(), - thread_host.io_thread->GetTaskRunner()); - auto shell = Shell::Create( - std::move(task_runners), settings, - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }, - [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }); - ASSERT_TRUE(shell); -} - -} // namespace shell diff --git a/shell/common/surface.cc b/shell/common/surface.cc index 228647e8b3512..01d288a5e5085 100644 --- a/shell/common/surface.cc +++ b/shell/common/surface.cc @@ -3,7 +3,6 @@ // found in the LICENSE file. #include "flutter/shell/common/surface.h" - #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" #include "third_party/skia/include/core/SkSurface.h" @@ -60,22 +59,27 @@ bool SurfaceFrame::PerformSubmit() { return false; } -Surface::Surface() : Surface(std::make_unique()) {} +Surface::Surface() : scale_(1.0) {} + +Surface::~Surface() = default; -Surface::Surface(std::unique_ptr compositor_context) - : compositor_context_(std::move(compositor_context)) { - FXL_DCHECK(compositor_context_); - // TODO: Get rid of these explicit calls and move the logic to the c/dtors of - // the compositor context. - compositor_context_->OnGrContextCreated(); +bool Surface::SupportsScaling() const { + return false; } -Surface::~Surface() { - compositor_context_->OnGrContextDestroyed(); +double Surface::GetScale() const { + return scale_; } -flow::CompositorContext& Surface::GetCompositorContext() { - return *compositor_context_; +void Surface::SetScale(double scale) { + static constexpr double kMaxScale = 1.0; + static constexpr double kMinScale = 0.25; + if (scale > kMaxScale) { + scale = kMaxScale; + } else if (scale < kMinScale) { + scale = kMinScale; + } + scale_ = scale; } } // namespace shell diff --git a/shell/common/surface.h b/shell/common/surface.h index 6133a7d519fff..906480237f416 100644 --- a/shell/common/surface.h +++ b/shell/common/surface.h @@ -7,7 +7,7 @@ #include -#include "flutter/flow/compositor_context.h" +#include "lib/fxl/compiler_specific.h" #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -45,8 +45,6 @@ class Surface { public: Surface(); - Surface(std::unique_ptr compositor_context); - virtual ~Surface(); virtual bool IsValid() = 0; @@ -55,12 +53,14 @@ class Surface { virtual GrContext* GetContext() = 0; - flow::CompositorContext& GetCompositorContext(); + virtual bool SupportsScaling() const; - private: - std::unique_ptr compositor_context_; + double GetScale() const; - FXL_DISALLOW_COPY_AND_ASSIGN(Surface); + void SetScale(double scale); + + private: + double scale_; }; } // namespace shell diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 82da6ee180af8..c1c82ff166ac1 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -5,7 +5,6 @@ #include #include #include -#include #include #include @@ -91,125 +90,4 @@ const fxl::StringView FlagForSwitch(Switch swtch) { return fxl::StringView(); } -template -static bool GetSwitchValue(const fxl::CommandLine& command_line, - shell::Switch sw, - T* result) { - std::string switch_string; - - if (!command_line.GetOptionValue(shell::FlagForSwitch(sw), &switch_string)) { - return false; - } - - std::stringstream stream(switch_string); - T value = 0; - if (stream >> value) { - *result = value; - return true; - } - - return false; -} - -blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { - blink::Settings settings = {}; - - // Enable Observatory - settings.enable_observatory = - !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); - - // Set Observatory Port - if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { - if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, - &settings.observatory_port)) { - FXL_LOG(INFO) - << "Observatory port specified was malformed. Will default to " - << settings.observatory_port; - } - } - - // Checked mode overrides. - settings.dart_non_checked_mode = - command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); - - settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); - - settings.start_paused = - command_line.HasOption(FlagForSwitch(Switch::StartPaused)); - - settings.enable_dart_profiling = - command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); - - settings.enable_software_rendering = - command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); - - settings.using_blink = - command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); - - settings.endless_trace_buffer = - command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); - - settings.trace_startup = - command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); - - settings.skia_deterministic_rendering_on_cpu = - command_line.HasOption(FlagForSwitch(Switch::SkiaDeterministicRendering)); - - command_line.GetOptionValue(FlagForSwitch(Switch::FLX), &settings.flx_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir), - &settings.assets_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::Snapshot), - &settings.script_snapshot_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::MainDartFile), - &settings.main_dart_file_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::Packages), - &settings.packages_file_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), - &settings.aot_snapshot_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), - &settings.aot_vm_snapshot_data_filename); - - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), - &settings.aot_vm_snapshot_instr_filename); - - command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), - &settings.aot_isolate_snapshot_data_filename); - - command_line.GetOptionValue( - FlagForSwitch(Switch::AotIsolateSnapshotInstructions), - &settings.aot_isolate_snapshot_instr_filename); - - command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), - &settings.temp_directory_path); - - command_line.GetOptionValue(FlagForSwitch(Switch::ICUDataFilePath), - &settings.icu_data_path); - - settings.use_test_fonts = - command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); - - command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); - std::string all_dart_flags; - if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), - &all_dart_flags)) { - std::stringstream stream(all_dart_flags); - std::istream_iterator end; - for (std::istream_iterator it(stream); it != end; ++it) - settings.dart_flags.push_back(*it); - } - -#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - settings.trace_skia = - command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); -#endif - - return settings; -} - } // namespace shell diff --git a/shell/common/switches.h b/shell/common/switches.h index 6b67b1f6a1567..91778a78e92cc 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/common/settings.h" -#include "lib/fxl/command_line.h" #include "lib/fxl/strings/string_view.h" #ifndef SHELL_COMMON_SWITCHES_H_ @@ -25,29 +23,12 @@ namespace shell { DEF_SWITCHES_START DEF_SWITCH(AotSharedLibraryPath, "aot-shared-library-path", "Path to the *.so.") -DEF_SWITCH(AotSnapshotPath, - "aot-snapshot-path", - "Path to the directory containing the four files specified by " - "AotVmSnapshotData, AotVmSnapshotInstructions, " - "AotVmSnapshotInstructions and AotIsolateSnapshotInstructions.") -DEF_SWITCH(AotVmSnapshotData, - "vm-snapshot-data", - "The VM snapshot data that will be memory mapped as read-only. " - "AotSnapshotPath must be present.") -DEF_SWITCH(AotVmSnapshotInstructions, - "vm-snapshot-instr", - "The VM instructions snapshot that will be memory mapped as read " - "and executable. AotSnapshotPath must be present.") -DEF_SWITCH(AotIsolateSnapshotData, - "isolate-snapshot-data", - "The isolate snapshot data that will be memory mapped as read-only. " - "AotSnapshotPath must be present.") -DEF_SWITCH(AotIsolateSnapshotInstructions, - "isolate-snapshot-instr", - "The isolate instructions snapshot that will be memory mapped as " - "read and executable. AotSnapshotPath must be present.") +DEF_SWITCH(AotSnapshotPath, "aot-snapshot-path", "Path to the AOT snapshot.") +DEF_SWITCH(AotVmSnapshotData, "vm-snapshot-data", "") +DEF_SWITCH(AotVmSnapshotInstructions, "vm-snapshot-instr", "") +DEF_SWITCH(AotIsolateSnapshotData, "isolate-snapshot-data", "") +DEF_SWITCH(AotIsolateSnapshotInstructions, "isolate-snapshot-instr", "") DEF_SWITCH(CacheDirPath, "cache-dir-path", "Path to the cache directory.") -DEF_SWITCH(ICUDataFilePath, "icu-data-file-path", "Path to the ICU data file.") DEF_SWITCH(DartFlags, "dart-flags", "Flags passed directly to the Dart VM without being interpreted " @@ -92,6 +73,10 @@ DEF_SWITCH(FlutterAssetsDir, DEF_SWITCH(Help, "help", "Display this help text.") DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.") DEF_SWITCH(MainDartFile, "dart-main", "The path to the main Dart file.") +DEF_SWITCH(NonInteractive, + "non-interactive", + "Make the shell non-interactive. By default, the shell attempts " + "to setup a window and create an OpenGL context.") DEF_SWITCH(Packages, "packages", "Specify the path to the packages.") DEF_SWITCH(Snapshot, "snapshot-blob", "Specify the path to the snapshot blob") DEF_SWITCH(StartPaused, @@ -128,9 +113,7 @@ DEF_SWITCHES_END void PrintUsage(const std::string& executable_name); -const fxl::StringView FlagForSwitch(Switch swtch); - -blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line); +const fxl::StringView FlagForSwitch(Switch sw); } // namespace shell diff --git a/shell/common/thread_host.cc b/shell/common/thread_host.cc deleted file mode 100644 index f35594829d5d9..0000000000000 --- a/shell/common/thread_host.cc +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2017 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/shell/common/thread_host.h" - -namespace shell { - -ThreadHost::ThreadHost() = default; - -ThreadHost::ThreadHost(std::string name_prefix, uint64_t mask) { - if (mask & ThreadHost::Type::Platform) { - platform_thread = std::make_unique(name_prefix + ".platform"); - } - - if (mask & ThreadHost::Type::UI) { - ui_thread = std::make_unique(name_prefix + ".ui"); - } - - if (mask & ThreadHost::Type::GPU) { - gpu_thread = std::make_unique(name_prefix + ".gpu"); - } - - if (mask & ThreadHost::Type::IO) { - io_thread = std::make_unique(name_prefix + ".io"); - } -} - -ThreadHost::~ThreadHost() = default; - -void ThreadHost::Reset() { - platform_thread.reset(); - ui_thread.reset(); - gpu_thread.reset(); - io_thread.reset(); -} - -} // namespace shell diff --git a/shell/common/thread_host.h b/shell/common/thread_host.h deleted file mode 100644 index a688aa6a06a85..0000000000000 --- a/shell/common/thread_host.h +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2017 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_SHELL_COMMON_THREAD_HOST_H_ -#define FLUTTER_SHELL_COMMON_THREAD_HOST_H_ - -#include - -#include "flutter/fml/thread.h" -#include "lib/fxl/macros.h" - -namespace shell { - -struct ThreadHost { - enum Type { - Platform = 1 << 0, - UI = 1 << 1, - GPU = 1 << 2, - IO = 1 << 3, - }; - - std::unique_ptr platform_thread; - std::unique_ptr ui_thread; - std::unique_ptr gpu_thread; - std::unique_ptr io_thread; - - ThreadHost(); - - ThreadHost(ThreadHost&&) = default; - - ThreadHost& operator=(ThreadHost&&) = default; - - ThreadHost(std::string name_prefix, uint64_t type_mask); - - ~ThreadHost(); - - void Reset(); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_THREAD_HOST_H_ diff --git a/shell/common/tracing_controller.cc b/shell/common/tracing_controller.cc new file mode 100644 index 0000000000000..6fa8d9d5ee87f --- /dev/null +++ b/shell/common/tracing_controller.cc @@ -0,0 +1,51 @@ +// Copyright 2015 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. + +#include "flutter/shell/common/tracing_controller.h" + +#include + +#include "flutter/common/threads.h" +#include "flutter/fml/trace_event.h" +#include "flutter/runtime/dart_init.h" +#include "flutter/shell/common/shell.h" +#include "lib/fxl/logging.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace shell { + +TracingController::TracingController() : tracing_active_(false) { + blink::SetEmbedderTracingCallbacks( + std::unique_ptr( + new blink::EmbedderTracingCallbacks([this]() { StartTracing(); }, + [this]() { StopTracing(); }))); +} + +TracingController::~TracingController() { + blink::SetEmbedderTracingCallbacks(nullptr); +} + +static void AddTraceMetadata() { + blink::Threads::Gpu()->PostTask([]() { Dart_SetThreadName("gpu_thread"); }); + blink::Threads::UI()->PostTask([]() { Dart_SetThreadName("ui_thread"); }); + blink::Threads::IO()->PostTask([]() { Dart_SetThreadName("io_thread"); }); + blink::Threads::Platform()->PostTask( + []() { Dart_SetThreadName("platform_thread"); }); +} + +void TracingController::StartTracing() { + if (tracing_active_) + return; + tracing_active_ = true; + AddTraceMetadata(); +} + +void TracingController::StopTracing() { + if (!tracing_active_) { + return; + } + tracing_active_ = false; +} + +} // namespace shell diff --git a/shell/common/tracing_controller.h b/shell/common/tracing_controller.h new file mode 100644 index 0000000000000..3f9e6f03ab14c --- /dev/null +++ b/shell/common/tracing_controller.h @@ -0,0 +1,34 @@ +// Copyright 2015 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. + +#ifndef SHELL_COMMON_TRACING_CONTROLLER_H_ +#define SHELL_COMMON_TRACING_CONTROLLER_H_ + +#include + +#include "lib/fxl/macros.h" + +namespace shell { + +class TracingController { + public: + TracingController(); + + ~TracingController(); + + void StartTracing(); + + void StopTracing(); + + bool tracing_active() const { return tracing_active_; } + + private: + bool tracing_active_; + + FXL_DISALLOW_COPY_AND_ASSIGN(TracingController); +}; + +} // namespace shell + +#endif // SHELL_COMMON_TRACING_CONTROLLER_H_ diff --git a/shell/common/vsync_waiter.cc b/shell/common/vsync_waiter.cc index ba2f21c389c11..5acc235b1f68d 100644 --- a/shell/common/vsync_waiter.cc +++ b/shell/common/vsync_waiter.cc @@ -4,45 +4,8 @@ #include "flutter/shell/common/vsync_waiter.h" -#include "flutter/fml/task_runner.h" -#include "flutter/fml/trace_event.h" - namespace shell { -VsyncWaiter::VsyncWaiter(blink::TaskRunners task_runners) - : task_runners_(std::move(task_runners)) {} - VsyncWaiter::~VsyncWaiter() = default; -void VsyncWaiter::AsyncWaitForVsync(Callback callback) { - { - std::lock_guard lock(callback_mutex_); - callback_ = std::move(callback); - } - AwaitVSync(); -} - -void VsyncWaiter::FireCallback(fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time) { - Callback callback; - - { - std::lock_guard lock(callback_mutex_); - callback = std::move(callback_); - } - - if (!callback) { - return; - } - - task_runners_.GetUITaskRunner()->PostTask( - [callback, frame_start_time, frame_target_time]() { - // Note: The tag name must be "VSYNC" (it is special) so that the - // "Highlight - // Vsync" checkbox in the timeline can be enabled. - TRACE_EVENT0("flutter", "VSYNC"); - callback(frame_start_time, frame_target_time); - }); -} - } // namespace shell diff --git a/shell/common/vsync_waiter.h b/shell/common/vsync_waiter.h index 82231fdf4f853..77319ed8b6966 100644 --- a/shell/common/vsync_waiter.h +++ b/shell/common/vsync_waiter.h @@ -6,10 +6,7 @@ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_H_ #include -#include -#include -#include "flutter/common/task_runners.h" #include "lib/fxl/time/time_point.h" namespace shell { @@ -19,23 +16,9 @@ class VsyncWaiter { using Callback = std::function; - virtual ~VsyncWaiter(); - - void AsyncWaitForVsync(Callback callback); - - protected: - const blink::TaskRunners task_runners_; - std::mutex callback_mutex_; - Callback callback_; - - VsyncWaiter(blink::TaskRunners task_runners); + virtual void AsyncWaitForVsync(Callback callback) = 0; - virtual void AwaitVSync() = 0; - - void FireCallback(fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time); - - FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiter); + virtual ~VsyncWaiter(); }; } // namespace shell diff --git a/shell/common/vsync_waiter_fallback.cc b/shell/common/vsync_waiter_fallback.cc index bcf061bb7615f..01c86cdedc6aa 100644 --- a/shell/common/vsync_waiter_fallback.cc +++ b/shell/common/vsync_waiter_fallback.cc @@ -4,6 +4,7 @@ #include "flutter/shell/common/vsync_waiter_fallback.h" +#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { @@ -20,25 +21,28 @@ fxl::TimePoint SnapToNextTick(fxl::TimePoint value, } // namespace -VsyncWaiterFallback::VsyncWaiterFallback(blink::TaskRunners task_runners) - : VsyncWaiter(std::move(task_runners)), - phase_(fxl::TimePoint::Now()), - weak_factory_(this) {} +VsyncWaiterFallback::VsyncWaiterFallback() + : phase_(fxl::TimePoint::Now()), weak_factory_(this) {} VsyncWaiterFallback::~VsyncWaiterFallback() = default; constexpr fxl::TimeDelta interval = fxl::TimeDelta::FromSecondsF(1.0 / 60.0); -void VsyncWaiterFallback::AwaitVSync() { +void VsyncWaiterFallback::AsyncWaitForVsync(Callback callback) { + FXL_DCHECK(!callback_); + callback_ = std::move(callback); + fxl::TimePoint now = fxl::TimePoint::Now(); fxl::TimePoint next = SnapToNextTick(now, phase_, interval); - task_runners_.GetUITaskRunner()->PostDelayedTask( + blink::Threads::UI()->PostDelayedTask( [self = weak_factory_.GetWeakPtr()] { - if (self) { - const auto frame_time = fxl::TimePoint::Now(); - self->FireCallback(frame_time, frame_time + interval); - } + if (!self) + return; + fxl::TimePoint frame_time = fxl::TimePoint::Now(); + Callback callback = std::move(self->callback_); + self->callback_ = Callback(); + callback(frame_time, frame_time + interval); }, next - now); } diff --git a/shell/common/vsync_waiter_fallback.h b/shell/common/vsync_waiter_fallback.h index d3cc8faaf6ce7..bfb7e118b1330 100644 --- a/shell/common/vsync_waiter_fallback.h +++ b/shell/common/vsync_waiter_fallback.h @@ -5,24 +5,25 @@ #ifndef FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" #include "lib/fxl/time/time_point.h" namespace shell { -class VsyncWaiterFallback final : public VsyncWaiter { +class VsyncWaiterFallback : public VsyncWaiter { public: - VsyncWaiterFallback(blink::TaskRunners task_runners); - + VsyncWaiterFallback(); ~VsyncWaiterFallback() override; + void AsyncWaitForVsync(Callback callback) override; + private: fxl::TimePoint phase_; - fxl::WeakPtrFactory weak_factory_; + Callback callback_; - void AwaitVSync() override; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback); }; diff --git a/shell/gpu/BUILD.gn b/shell/gpu/BUILD.gn index cd093e1238f7f..c050e120b0a10 100644 --- a/shell/gpu/BUILD.gn +++ b/shell/gpu/BUILD.gn @@ -6,17 +6,14 @@ import("$flutter_root/shell/config.gni") source_set("gpu") { sources = [ + "gpu_rasterizer.cc", + "gpu_rasterizer.h", + "gpu_surface_gl.cc", + "gpu_surface_gl.h", "gpu_surface_software.cc", "gpu_surface_software.h", ] - if (!is_fuchsia) { - sources += [ - "gpu_surface_gl.cc", - "gpu_surface_gl.h", - ] - } - if (shell_enable_vulkan) { sources += [ "gpu_surface_vulkan.cc", diff --git a/shell/gpu/gpu_rasterizer.cc b/shell/gpu/gpu_rasterizer.cc new file mode 100644 index 0000000000000..3424f989b3205 --- /dev/null +++ b/shell/gpu/gpu_rasterizer.cc @@ -0,0 +1,168 @@ +// Copyright 2015 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. + +#include "gpu_rasterizer.h" + +#include +#include + +#include "flutter/common/threads.h" +#include "flutter/glue/trace_event.h" +#include "flutter/shell/common/picture_serializer.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "third_party/skia/include/core/SkPicture.h" + +namespace shell { + +GPURasterizer::GPURasterizer(std::unique_ptr info) + : compositor_context_(std::move(info)), weak_factory_(this) {} + +GPURasterizer::~GPURasterizer() = default; + +fml::WeakPtr GPURasterizer::GetWeakRasterizerPtr() { + return weak_factory_.GetWeakPtr(); +} + +void GPURasterizer::Setup(std::unique_ptr surface, + fxl::Closure continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) { + surface_ = std::move(surface); + compositor_context_.OnGrContextCreated(); + + continuation(); + + setup_completion_event->Signal(); +} + +void GPURasterizer::Clear(SkColor color, const SkISize& size) { + if (surface_ == nullptr) { + return; + } + + auto frame = surface_->AcquireFrame(size); + + if (frame == nullptr) { + return; + } + + SkCanvas* canvas = frame->SkiaCanvas(); + + if (canvas == nullptr) { + return; + } + + canvas->clear(color); + + frame->Submit(); +} + +void GPURasterizer::Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) { + compositor_context_.OnGrContextDestroyed(); + if (surface_) { + surface_.reset(); + } + last_layer_tree_.reset(); + teardown_completion_event->Signal(); +} + +flow::LayerTree* GPURasterizer::GetLastLayerTree() { + return last_layer_tree_.get(); +} + +void GPURasterizer::DrawLastLayerTree() { + if (!last_layer_tree_ || !surface_) { + return; + } + DrawToSurface(*last_layer_tree_); +} + +flow::TextureRegistry& GPURasterizer::GetTextureRegistry() { + return compositor_context_.texture_registry(); +} + +void GPURasterizer::Draw( + fxl::RefPtr> pipeline) { + TRACE_EVENT0("flutter", "GPURasterizer::Draw"); + + flutter::Pipeline::Consumer consumer = + std::bind(&GPURasterizer::DoDraw, this, std::placeholders::_1); + + // Consume as many pipeline items as possible. But yield the event loop + // between successive tries. + switch (pipeline->Consume(consumer)) { + case flutter::PipelineConsumeResult::MoreAvailable: { + auto weak_this = weak_factory_.GetWeakPtr(); + blink::Threads::Gpu()->PostTask([weak_this, pipeline]() { + if (weak_this) { + weak_this->Draw(pipeline); + } + }); + break; + } + default: + break; + } +} + +void GPURasterizer::DoDraw(std::unique_ptr layer_tree) { + if (!layer_tree || !surface_) { + return; + } + + // There is no way for the compositor to know how long the layer tree + // construction took. Fortunately, the layer tree does. Grab that time + // for instrumentation. + compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); + + DrawToSurface(*layer_tree); + + NotifyNextFrameOnce(); + + last_layer_tree_ = std::move(layer_tree); +} + +void GPURasterizer::DrawToSurface(flow::LayerTree& layer_tree) { + auto frame = surface_->AcquireFrame(layer_tree.frame_size()); + + if (frame == nullptr) { + return; + } + + auto canvas = frame->SkiaCanvas(); + + if (canvas == nullptr) { + return; + } + + auto compositor_frame = + compositor_context_.AcquireFrame(surface_->GetContext(), canvas); + + canvas->clear(SK_ColorBLACK); + + layer_tree.Raster(compositor_frame); + + frame->Submit(); +} + +void GPURasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { + nextFrameCallback_ = nextFrameCallback; +} + +void GPURasterizer::NotifyNextFrameOnce() { + if (nextFrameCallback_) { + blink::Threads::Platform()->PostTask([callback = nextFrameCallback_] { + TRACE_EVENT0("flutter", "GPURasterizer::NotifyNextFrameOnce"); + callback(); + }); + nextFrameCallback_ = nullptr; + } +} + +void GPURasterizer::SetTextureRegistry(flow::TextureRegistry* textureRegistry) { + compositor_context_.SetTextureRegistry(textureRegistry); +} + +} // namespace shell diff --git a/shell/gpu/gpu_rasterizer.h b/shell/gpu/gpu_rasterizer.h new file mode 100644 index 0000000000000..ad16ee2c47989 --- /dev/null +++ b/shell/gpu/gpu_rasterizer.h @@ -0,0 +1,68 @@ +// Copyright 2015 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. + +#ifndef SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ +#define SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ + +#include "flutter/flow/compositor_context.h" +#include "flutter/shell/common/rasterizer.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/synchronization/waitable_event.h" + +namespace shell { + +class Surface; + +class GPURasterizer : public Rasterizer { + public: + GPURasterizer(std::unique_ptr info); + + ~GPURasterizer() override; + + void Setup(std::unique_ptr surface, + fxl::Closure continuation, + fxl::AutoResetWaitableEvent* setup_completion_event) override; + + void Clear(SkColor color, const SkISize& size) override; + + void Teardown( + fxl::AutoResetWaitableEvent* teardown_completion_event) override; + + fml::WeakPtr GetWeakRasterizerPtr() override; + + flow::LayerTree* GetLastLayerTree() override; + + void DrawLastLayerTree() override; + + flow::TextureRegistry& GetTextureRegistry() override; + + void Draw(fxl::RefPtr> pipeline) override; + + // Set a callback to be called once when the next frame is drawn. + void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; + + void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; + + private: + std::unique_ptr surface_; + flow::CompositorContext compositor_context_; + std::unique_ptr last_layer_tree_; + // A closure to be called when the underlaying surface presents a frame the + // next time. NULL if there is no callback or the callback was set back to + // NULL after being called. + fxl::Closure nextFrameCallback_; + fml::WeakPtrFactory weak_factory_; + + void DoDraw(std::unique_ptr layer_tree); + + void DrawToSurface(flow::LayerTree& layer_tree); + + void NotifyNextFrameOnce(); + + FXL_DISALLOW_COPY_AND_ASSIGN(GPURasterizer); +}; + +} // namespace shell + +#endif // SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 284a10e413b46..331fd188a9ed3 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -72,8 +72,6 @@ GPUSurfaceGL::~GPUSurfaceGL() { return; } - GetCompositorContext().OnGrContextDestroyed(); - onscreen_surface_ = nullptr; context_->releaseResourcesAndAbandonContext(); context_ = nullptr; @@ -212,11 +210,12 @@ std::unique_ptr GPUSurfaceGL::AcquireFrame(const SkISize& size) { return nullptr; } - SurfaceFrame::SubmitCallback submit_callback = [weak = weak_factory_ - .GetWeakPtr()]( - const SurfaceFrame& surface_frame, SkCanvas* canvas) { - return weak ? weak->PresentSurface(canvas) : false; - }; + auto weak_this = weak_factory_.GetWeakPtr(); + + SurfaceFrame::SubmitCallback submit_callback = + [weak_this](const SurfaceFrame& surface_frame, SkCanvas* canvas) { + return weak_this ? weak_this->PresentSurface(canvas) : false; + }; return std::make_unique(surface, submit_callback); } diff --git a/shell/gpu/gpu_surface_gl.h b/shell/gpu/gpu_surface_gl.h index abc9f46aee297..5cf092dae66c5 100644 --- a/shell/gpu/gpu_surface_gl.h +++ b/shell/gpu/gpu_surface_gl.h @@ -5,9 +5,10 @@ #ifndef SHELL_GPU_GPU_SURFACE_GL_H_ #define SHELL_GPU_GPU_SURFACE_GL_H_ +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" +#include "flutter/synchronization/debug_thread_checker.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { @@ -43,7 +44,7 @@ class GPUSurfaceGL : public Surface { sk_sp onscreen_surface_; sk_sp offscreen_surface_; bool valid_ = false; - fxl::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; bool CreateOrUpdateSurfaces(const SkISize& size); diff --git a/shell/gpu/gpu_surface_software.cc b/shell/gpu/gpu_surface_software.cc index ea8c827b22405..e340e605652dd 100644 --- a/shell/gpu/gpu_surface_software.cc +++ b/shell/gpu/gpu_surface_software.cc @@ -18,13 +18,20 @@ bool GPUSurfaceSoftware::IsValid() { return delegate_ != nullptr; } +bool GPUSurfaceSoftware::SupportsScaling() const { + return true; +} + std::unique_ptr GPUSurfaceSoftware::AcquireFrame( const SkISize& logical_size) { if (!IsValid()) { return nullptr; } - const auto size = SkISize::Make(logical_size.width(), logical_size.height()); + // Check if we need to support surface scaling. + const auto scale = SupportsScaling() ? GetScale() : 1.0; + const auto size = SkISize::Make(logical_size.width() * scale, + logical_size.height() * scale); sk_sp backing_store = delegate_->AcquireBackingStore(size); @@ -41,10 +48,12 @@ std::unique_ptr GPUSurfaceSoftware::AcquireFrame( // irrespective of surface scaling. SkCanvas* canvas = backing_store->getCanvas(); canvas->resetMatrix(); + canvas->scale(scale, scale); - SurfaceFrame::SubmitCallback on_submit = - [self = weak_factory_.GetWeakPtr()](const SurfaceFrame& surface_frame, - SkCanvas* canvas) -> bool { + SurfaceFrame::SubmitCallback + on_submit = [self = weak_factory_.GetWeakPtr()]( + const SurfaceFrame& surface_frame, SkCanvas* canvas) + ->bool { // If the surface itself went away, there is nothing more to do. if (!self || !self->IsValid() || canvas == nullptr) { return false; diff --git a/shell/gpu/gpu_surface_software.h b/shell/gpu/gpu_surface_software.h index 238754f312b80..f7312153db8bc 100644 --- a/shell/gpu/gpu_surface_software.h +++ b/shell/gpu/gpu_surface_software.h @@ -5,9 +5,9 @@ #ifndef FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkSurface.h" namespace shell { @@ -30,9 +30,12 @@ class GPUSurfaceSoftware : public Surface { GrContext* GetContext() override; + bool SupportsScaling() const override; + private: GPUSurfaceSoftwareDelegate* delegate_; - fxl::WeakPtrFactory weak_factory_; + + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceSoftware); }; diff --git a/shell/gpu/gpu_surface_vulkan.h b/shell/gpu/gpu_surface_vulkan.h index f1e25fbe987b8..eafed43a6296d 100644 --- a/shell/gpu/gpu_surface_vulkan.h +++ b/shell/gpu/gpu_surface_vulkan.h @@ -6,12 +6,11 @@ #define SHELL_GPU_GPU_SURFACE_VULKAN_H_ #include - +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" #include "flutter/vulkan/vulkan_native_surface.h" #include "flutter/vulkan/vulkan_window.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -30,7 +29,7 @@ class GPUSurfaceVulkan : public Surface { private: vulkan::VulkanWindow window_; - fxl::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan); }; diff --git a/shell/platform/BUILD.gn b/shell/platform/BUILD.gn index ae3b1003f22fe..4b1e1a9e0bfeb 100644 --- a/shell/platform/BUILD.gn +++ b/shell/platform/BUILD.gn @@ -13,11 +13,13 @@ group("platform") { ] } else if (is_linux) { deps = [ + "linux", "embedder", ] } else if (is_win) { - # There is no platform target on windows. Instead, only a tester is used. - deps = [] + deps = [ + "win" + ] } else { assert(false, "Unknown/Unsupported platform.") } diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 129c877faed0f..d9744ad890caa 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -17,25 +17,21 @@ shared_library("flutter_shell_native") { "android_context_gl.h", "android_environment_gl.cc", "android_environment_gl.h", - "android_external_texture_gl.cc", "android_external_texture_gl.h", + "android_external_texture_gl.cc", "android_native_window.cc", "android_native_window.h", - "android_shell_holder.cc", - "android_shell_holder.h", "android_surface.cc", "android_surface.h", "android_surface_gl.cc", "android_surface_gl.h", - "android_surface_software.cc", "android_surface_software.h", - "apk_asset_provider.cc", + "android_surface_software.cc", "apk_asset_provider.h", + "apk_asset_provider.cc", "flutter_main.cc", "flutter_main.h", "library_loader.cc", - "platform_message_response_android.cc", - "platform_message_response_android.h", "platform_view_android.cc", "platform_view_android.h", "platform_view_android_jni.cc", @@ -45,10 +41,10 @@ shared_library("flutter_shell_native") { ] deps = [ - "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", + "$flutter_root/assets", "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/shell/common", @@ -63,7 +59,9 @@ shared_library("flutter_shell_native") { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] defines = [] diff --git a/shell/platform/android/android_context_gl.cc b/shell/platform/android/android_context_gl.cc index 6338dc96908e1..f54629f8644b9 100644 --- a/shell/platform/android/android_context_gl.cc +++ b/shell/platform/android/android_context_gl.cc @@ -3,13 +3,9 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_context_gl.h" - #include - #include -#include "flutter/fml/trace_event.h" - namespace shell { template @@ -69,17 +65,19 @@ static EGLResult CreateContext(EGLDisplay display, return {context != EGL_NO_CONTEXT, context}; } -static EGLResult ChooseEGLConfiguration(EGLDisplay display) { +static EGLResult ChooseEGLConfiguration( + EGLDisplay display, + PlatformView::SurfaceConfig config) { EGLint attributes[] = { // clang-format off EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 0, - EGL_STENCIL_SIZE, 0, + EGL_RED_SIZE, config.red_bits, + EGL_GREEN_SIZE, config.green_bits, + EGL_BLUE_SIZE, config.blue_bits, + EGL_ALPHA_SIZE, config.alpha_bits, + EGL_DEPTH_SIZE, config.depth_bits, + EGL_STENCIL_SIZE, config.stencil_bits, EGL_NONE, // termination sentinel // clang-format on }; @@ -144,6 +142,7 @@ bool AndroidContextGL::CreatePBufferSurface() { } AndroidContextGL::AndroidContextGL(fxl::RefPtr env, + PlatformView::SurfaceConfig config, const AndroidContextGL* share_context) : environment_(env), window_(nullptr), @@ -159,7 +158,8 @@ AndroidContextGL::AndroidContextGL(fxl::RefPtr env, // Choose a valid configuration. - std::tie(success, config_) = ChooseEGLConfiguration(environment_->Display()); + std::tie(success, config_) = + ChooseEGLConfiguration(environment_->Display(), config); if (!success) { FXL_LOG(ERROR) << "Could not choose an EGL configuration."; diff --git a/shell/platform/android/android_context_gl.h b/shell/platform/android/android_context_gl.h index b29851b34564d..207f621c66bd1 100644 --- a/shell/platform/android/android_context_gl.h +++ b/shell/platform/android/android_context_gl.h @@ -44,6 +44,7 @@ class AndroidContextGL : public fxl::RefCountedThreadSafe { bool valid_; AndroidContextGL(fxl::RefPtr env, + PlatformView::SurfaceConfig config, const AndroidContextGL* share_context = nullptr); ~AndroidContextGL(); diff --git a/shell/platform/android/android_external_texture_gl.cc b/shell/platform/android/android_external_texture_gl.cc index 35db9cbbfdb95..02a40c22474a1 100644 --- a/shell/platform/android/android_external_texture_gl.cc +++ b/shell/platform/android/android_external_texture_gl.cc @@ -5,7 +5,7 @@ #include "flutter/shell/platform/android/android_external_texture_gl.h" #include - +#include "flutter/common/threads.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "third_party/skia/include/gpu/GrTexture.h" @@ -19,14 +19,17 @@ AndroidExternalTextureGL::AndroidExternalTextureGL( AndroidExternalTextureGL::~AndroidExternalTextureGL() = default; void AndroidExternalTextureGL::OnGrContextCreated() { + ASSERT_IS_GPU_THREAD; state_ = AttachmentState::uninitialized; } void AndroidExternalTextureGL::MarkNewFrameAvailable() { + ASSERT_IS_GPU_THREAD; new_frame_ready_ = true; } void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { + ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::detached) { return; } @@ -39,8 +42,7 @@ void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { Update(); new_frame_ready_ = false; } - GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, - GL_RGBA8_OES}; + GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, GL_RGBA8_OES}; GrBackendTexture backendTexture(1, 1, GrMipMapped::kNo, textureInfo); sk_sp image = SkImage::MakeFromTexture( canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, @@ -80,6 +82,7 @@ void AndroidExternalTextureGL::UpdateTransform() { } void AndroidExternalTextureGL::OnGrContextDestroyed() { + ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::attached) { Detach(); } diff --git a/shell/platform/android/android_external_texture_gl.h b/shell/platform/android/android_external_texture_gl.h index 67d6541d964c2..df890b91c827f 100644 --- a/shell/platform/android/android_external_texture_gl.h +++ b/shell/platform/android/android_external_texture_gl.h @@ -25,7 +25,8 @@ class AndroidExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; - void MarkNewFrameAvailable() override; + // Called on GPU thread. + void MarkNewFrameAvailable(); private: void Attach(jint textureName); diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc deleted file mode 100644 index 7dc454f1fb74a..0000000000000 --- a/shell/platform/android/android_shell_holder.cc +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2018 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/shell/platform/android/android_shell_holder.h" - -#include -#include - -#include -#include -#include - -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/platform/android/platform_view_android.h" -#include "lib/fxl/functional/make_copyable.h" - -namespace shell { - -AndroidShellHolder::AndroidShellHolder( - blink::Settings settings, - fml::jni::JavaObjectWeakGlobalRef java_object) - : settings_(std::move(settings)), java_object_(java_object) { - static size_t shell_count = 1; - auto thread_label = std::to_string(shell_count++); - - thread_host_ = {thread_label, ThreadHost::Type::UI | ThreadHost::Type::GPU | - ThreadHost::Type::IO}; - - fml::WeakPtr weak_platform_view; - Shell::CreateCallback on_create_platform_view = - [java_object, &weak_platform_view](Shell& shell) { - auto platform_view_android = std::make_unique( - shell, // delegate - shell.GetTaskRunners(), // task runners - java_object, // java object handle for JNI interop - shell.GetSettings() - .enable_software_rendering // use software rendering - ); - weak_platform_view = platform_view_android->GetWeakPtr(); - return platform_view_android; - }; - - Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - // The current thread will be used as the platform thread. Ensure that the - // message loop is initialized. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - blink::TaskRunners task_runners( - thread_label, // label - fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform - thread_host_.gpu_thread->GetTaskRunner(), // gpu - thread_host_.ui_thread->GetTaskRunner(), // ui - thread_host_.io_thread->GetTaskRunner() // io - ); - - shell_ = - Shell::Create(task_runners, // task runners - settings_, // settings - on_create_platform_view, // platform view create callback - on_create_rasterizer // rasterizer create callback - ); - - platform_view_ = weak_platform_view; - FXL_DCHECK(platform_view_); - - is_valid_ = shell_ != nullptr; - - if (is_valid_) { - task_runners.GetGPUTaskRunner()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); - task_runners.GetUITaskRunner()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); - } -} - -AndroidShellHolder::~AndroidShellHolder() = default; - -bool AndroidShellHolder::IsValid() const { - return is_valid_; -} - -const blink::Settings& AndroidShellHolder::GetSettings() const { - return settings_; -} - -void AndroidShellHolder::Launch(RunConfiguration config) { - if (!IsValid()) { - return; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = shell_->GetEngine(), // - config = std::move(config) // - ]() mutable { - if (engine) { - if (!engine->Run(std::move(config))) { - FXL_LOG(ERROR) << "Could not launch engine in configuration."; - } - } - })); -} - -void AndroidShellHolder::SetViewportMetrics( - const blink::ViewportMetrics& metrics) { - if (!IsValid()) { - return; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = shell_->GetEngine(), metrics]() { - if (engine) { - engine->SetViewportMetrics(metrics); - } - }); -} - -void AndroidShellHolder::DispatchPointerDataPacket( - std::unique_ptr packet) { - if (!IsValid()) { - return; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [engine = shell_->GetEngine(), packet = std::move(packet)] { - if (engine) { - engine->DispatchPointerDataPacket(*packet); - } - })); -} - -Rasterizer::Screenshot AndroidShellHolder::Screenshot( - Rasterizer::ScreenshotType type, - bool base64_encode) { - if (!IsValid()) { - return {nullptr, SkISize::MakeEmpty()}; - } - return shell_->Screenshot(type, base64_encode); -} - -fml::WeakPtr AndroidShellHolder::GetPlatformView() { - FXL_DCHECK(platform_view_); - return platform_view_; -} - -void AndroidShellHolder::UpdateAssetManager( - fxl::RefPtr asset_manager) { - if (!IsValid() || !asset_manager) { - return; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = shell_->GetEngine(), - asset_manager = std::move(asset_manager)]() { - if (engine) { - if (!engine->UpdateAssetManager(std::move(asset_manager))) { - FXL_DLOG(ERROR) << "Could not update asset asset manager."; - } - } - }); -} - -} // namespace shell diff --git a/shell/platform/android/android_shell_holder.h b/shell/platform/android/android_shell_holder.h deleted file mode 100644 index e0905f0f9e42e..0000000000000 --- a/shell/platform/android/android_shell_holder.h +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2018 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_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ -#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ - -#include - -#include "flutter/fml/platform/android/jni_weak_ref.h" -#include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/shell/common/run_configuration.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/thread_host.h" -#include "flutter/shell/platform/android/platform_view_android.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class AndroidShellHolder { - public: - AndroidShellHolder(blink::Settings settings, - fml::jni::JavaObjectWeakGlobalRef java_object); - - ~AndroidShellHolder(); - - bool IsValid() const; - - void Launch(RunConfiguration configuration); - - void SetViewportMetrics(const blink::ViewportMetrics& metrics); - - void DispatchPointerDataPacket( - std::unique_ptr packet); - - const blink::Settings& GetSettings() const; - - fml::WeakPtr GetPlatformView(); - - Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, - bool base64_encode); - - void UpdateAssetManager(fxl::RefPtr asset_manager); - - private: - const blink::Settings settings_; - const fml::jni::JavaObjectWeakGlobalRef java_object_; - fml::WeakPtr platform_view_; - ThreadHost thread_host_; - std::unique_ptr shell_; - bool is_valid_ = false; - - FXL_DISALLOW_COPY_AND_ASSIGN(AndroidShellHolder); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ diff --git a/shell/platform/android/android_surface.cc b/shell/platform/android/android_surface.cc index a8b41bacbf7c5..4dd08609da370 100644 --- a/shell/platform/android/android_surface.cc +++ b/shell/platform/android/android_surface.cc @@ -4,32 +4,8 @@ #include "flutter/shell/platform/android/android_surface.h" -#include - -#include "flutter/shell/platform/android/android_surface_gl.h" -#include "flutter/shell/platform/android/android_surface_software.h" -#if SHELL_ENABLE_VULKAN -#include "flutter/shell/platform/android/android_surface_vulkan.h" -#endif // SHELL_ENABLE_VULKAN - namespace shell { -std::unique_ptr AndroidSurface::Create( - bool use_software_rendering) { - if (use_software_rendering) { - auto software_surface = std::make_unique(); - return software_surface->IsValid() ? std::move(software_surface) : nullptr; - } -#if SHELL_ENABLE_VULKAN - auto vulkan_surface = std::make_unique(); - return vulkan_surface->IsValid() ? std::move(vulkan_surface) : nullptr; -#else // SHELL_ENABLE_VULKAN - auto gl_surface = std::make_unique(); - return gl_surface->IsOffscreenContextValid() ? std::move(gl_surface) - : nullptr; -#endif // SHELL_ENABLE_VULKAN -} - AndroidSurface::~AndroidSurface() = default; } // namespace shell diff --git a/shell/platform/android/android_surface.h b/shell/platform/android/android_surface.h index 858b07eb45d9f..2425a61e20707 100644 --- a/shell/platform/android/android_surface.h +++ b/shell/platform/android/android_surface.h @@ -19,8 +19,6 @@ namespace shell { class AndroidSurface { public: - static std::unique_ptr Create(bool use_software_rendering); - virtual ~AndroidSurface(); virtual bool IsValid() const = 0; @@ -29,11 +27,14 @@ class AndroidSurface { virtual std::unique_ptr CreateGPUSurface() = 0; + virtual SkISize OnScreenSurfaceSize() const = 0; + virtual bool OnScreenSurfaceResize(const SkISize& size) const = 0; virtual bool ResourceContextMakeCurrent() = 0; - virtual bool SetNativeWindow(fxl::RefPtr window) = 0; + virtual bool SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config = {}) = 0; }; } // namespace shell diff --git a/shell/platform/android/android_surface_gl.cc b/shell/platform/android/android_surface_gl.cc index 274b652a97b74..f30ac1272b043 100644 --- a/shell/platform/android/android_surface_gl.cc +++ b/shell/platform/android/android_surface_gl.cc @@ -6,12 +6,14 @@ #include +#include "flutter/common/threads.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_ptr.h" namespace shell { -static fxl::RefPtr GlobalResourceLoadingContext() { +static fxl::RefPtr GlobalResourceLoadingContext( + PlatformView::SurfaceConfig offscreen_config) { // AndroidSurfaceGL instances are only ever created on the platform thread. So // there is no need to lock here. @@ -27,7 +29,11 @@ static fxl::RefPtr GlobalResourceLoadingContext() { return nullptr; } - auto context = fxl::MakeRefCounted(environment); + // TODO(chinmaygarde): We should check that the configurations are stable + // across multiple invocations. + + auto context = + fxl::MakeRefCounted(environment, offscreen_config); if (!context->IsValid()) { return nullptr; @@ -37,9 +43,10 @@ static fxl::RefPtr GlobalResourceLoadingContext() { return global_context; } -AndroidSurfaceGL::AndroidSurfaceGL() { +AndroidSurfaceGL::AndroidSurfaceGL( + PlatformView::SurfaceConfig offscreen_config) { // Acquire the offscreen context. - offscreen_context_ = GlobalResourceLoadingContext(); + offscreen_context_ = GlobalResourceLoadingContext(offscreen_config); if (!offscreen_context_ || !offscreen_context_->IsValid()) { offscreen_context_ = nullptr; @@ -53,9 +60,14 @@ bool AndroidSurfaceGL::IsOffscreenContextValid() const { } void AndroidSurfaceGL::TeardownOnScreenContext() { - if (onscreen_context_) { - onscreen_context_->ClearCurrent(); - } + fxl::AutoResetWaitableEvent latch; + blink::Threads::Gpu()->PostTask([this, &latch]() { + if (IsValid()) { + GLContextClearCurrent(); + } + latch.Signal(); + }); + latch.Wait(); onscreen_context_ = nullptr; } @@ -72,6 +84,11 @@ std::unique_ptr AndroidSurfaceGL::CreateGPUSurface() { return surface->IsValid() ? std::move(surface) : nullptr; } +SkISize AndroidSurfaceGL::OnScreenSurfaceSize() const { + FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); + return onscreen_context_->GetSize(); +} + bool AndroidSurfaceGL::OnScreenSurfaceResize(const SkISize& size) const { FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->Resize(size); @@ -82,8 +99,8 @@ bool AndroidSurfaceGL::ResourceContextMakeCurrent() { return offscreen_context_->MakeCurrent(); } -bool AndroidSurfaceGL::SetNativeWindow( - fxl::RefPtr window) { +bool AndroidSurfaceGL::SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config) { // In any case, we want to get rid of our current onscreen context. onscreen_context_ = nullptr; @@ -95,7 +112,7 @@ bool AndroidSurfaceGL::SetNativeWindow( // Create the onscreen context. onscreen_context_ = fxl::MakeRefCounted( - offscreen_context_->Environment(), + offscreen_context_->Environment(), config, offscreen_context_.get() /* sharegroup */); if (!onscreen_context_->IsValid()) { diff --git a/shell/platform/android/android_surface_gl.h b/shell/platform/android/android_surface_gl.h index e26f2bf50d3a9..08aee081c8266 100644 --- a/shell/platform/android/android_surface_gl.h +++ b/shell/platform/android/android_surface_gl.h @@ -16,43 +16,35 @@ namespace shell { -class AndroidSurfaceGL final : public GPUSurfaceGLDelegate, - public AndroidSurface { +class AndroidSurfaceGL : public GPUSurfaceGLDelegate, public AndroidSurface { public: - AndroidSurfaceGL(); + explicit AndroidSurfaceGL(PlatformView::SurfaceConfig offscreen_config); ~AndroidSurfaceGL() override; - bool IsOffscreenContextValid() const; - - // |shell::AndroidSurface| bool IsValid() const override; - // |shell::AndroidSurface| + bool IsOffscreenContextValid() const; + std::unique_ptr CreateGPUSurface() override; - // |shell::AndroidSurface| void TeardownOnScreenContext() override; - // |shell::AndroidSurface| + SkISize OnScreenSurfaceSize() const override; + bool OnScreenSurfaceResize(const SkISize& size) const override; - // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - // |shell::AndroidSurface| - bool SetNativeWindow(fxl::RefPtr window) override; + bool SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config) override; - // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; - // |shell::GPUSurfaceGLDelegate| bool GLContextClearCurrent() override; - // |shell::GPUSurfaceGLDelegate| bool GLContextPresent() override; - // |shell::GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; private: diff --git a/shell/platform/android/android_surface_software.cc b/shell/platform/android/android_surface_software.cc index 4b1378802d9e4..68bf99b27ba56 100644 --- a/shell/platform/android/android_surface_software.cc +++ b/shell/platform/android/android_surface_software.cc @@ -3,14 +3,15 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_surface_software.h" +#include "flutter/common/threads.h" +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/fml/platform/android/scoped_java_ref.h" +#include "flutter/shell/platform/android/platform_view_android_jni.h" #include #include -#include "flutter/fml/platform/android/jni_weak_ref.h" -#include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/platform/android/platform_view_android_jni.h" #include "lib/fxl/logging.h" namespace shell { @@ -131,12 +132,17 @@ bool AndroidSurfaceSoftware::PresentBackingStore( void AndroidSurfaceSoftware::TeardownOnScreenContext() {} +SkISize AndroidSurfaceSoftware::OnScreenSurfaceSize() const { + return SkISize(); +} + bool AndroidSurfaceSoftware::OnScreenSurfaceResize(const SkISize& size) const { return true; } bool AndroidSurfaceSoftware::SetNativeWindow( - fxl::RefPtr window) { + fxl::RefPtr window, + PlatformView::SurfaceConfig config) { native_window_ = std::move(window); if (!(native_window_ && native_window_->IsValid())) return false; diff --git a/shell/platform/android/android_surface_software.h b/shell/platform/android/android_surface_software.h index 0f82fc5dfe154..76184b707cf74 100644 --- a/shell/platform/android/android_surface_software.h +++ b/shell/platform/android/android_surface_software.h @@ -13,39 +13,35 @@ namespace shell { -class AndroidSurfaceSoftware final : public AndroidSurface, - public GPUSurfaceSoftwareDelegate { +class AndroidSurfaceSoftware : public AndroidSurface, + public GPUSurfaceSoftwareDelegate { public: AndroidSurfaceSoftware(); ~AndroidSurfaceSoftware() override; - // |shell::AndroidSurface| bool IsValid() const override; - // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; - // |shell::AndroidSurface| - void TeardownOnScreenContext() override; + sk_sp AcquireBackingStore(const SkISize& size) override; - // |shell::AndroidSurface| - bool OnScreenSurfaceResize(const SkISize& size) const override; + bool PresentBackingStore(sk_sp backing_store) override; + + void TeardownOnScreenContext() override; - // |shell::AndroidSurface| - bool SetNativeWindow(fxl::RefPtr window) override; + SkISize OnScreenSurfaceSize() const override; - // |shell::GPUSurfaceSoftwareDelegate| - sk_sp AcquireBackingStore(const SkISize& size) override; + bool OnScreenSurfaceResize(const SkISize& size) const override; - // |shell::GPUSurfaceSoftwareDelegate| - bool PresentBackingStore(sk_sp backing_store) override; + bool SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config) override; private: sk_sp sk_surface_; + fxl::RefPtr native_window_; SkColorType target_color_type_; SkAlphaType target_alpha_type_; diff --git a/shell/platform/android/android_surface_vulkan.cc b/shell/platform/android/android_surface_vulkan.cc index e8817690188c2..ccacf538b8781 100644 --- a/shell/platform/android/android_surface_vulkan.cc +++ b/shell/platform/android/android_surface_vulkan.cc @@ -21,12 +21,10 @@ bool AndroidSurfaceVulkan::IsValid() const { return proc_table_->HasAcquiredMandatoryProcAddresses(); } -// |shell::AndroidSurface| void AndroidSurfaceVulkan::TeardownOnScreenContext() { - // Nothing to do. + // } -// |shell::AndroidSurface| std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { if (!IsValid()) { return nullptr; @@ -54,20 +52,21 @@ std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { return gpu_surface; } -// |shell::AndroidSurface| +SkISize AndroidSurfaceVulkan::OnScreenSurfaceSize() const { + return native_window_ ? native_window_->GetSize() : SkISize::Make(0, 0); +} + bool AndroidSurfaceVulkan::OnScreenSurfaceResize(const SkISize& size) const { return true; } -// |shell::AndroidSurface| bool AndroidSurfaceVulkan::ResourceContextMakeCurrent() { - FXL_DLOG(ERROR) << "The vulkan backend does not support resource contexts."; return false; } -// |shell::AndroidSurface| bool AndroidSurfaceVulkan::SetNativeWindow( - fxl::RefPtr window) { + fxl::RefPtr window, + PlatformView::SurfaceConfig config) { native_window_ = std::move(window); return native_window_ && native_window_->IsValid(); } diff --git a/shell/platform/android/android_surface_vulkan.h b/shell/platform/android/android_surface_vulkan.h index fd3f493d49790..f1ecf610c8584 100644 --- a/shell/platform/android/android_surface_vulkan.h +++ b/shell/platform/android/android_surface_vulkan.h @@ -20,23 +20,20 @@ class AndroidSurfaceVulkan : public AndroidSurface { ~AndroidSurfaceVulkan() override; - // |shell::AndroidSurface| bool IsValid() const override; - // |shell::AndroidSurface| + void TeardownOnScreenContext() override; + std::unique_ptr CreateGPUSurface() override; - // |shell::AndroidSurface| - void TeardownOnScreenContext() override; + SkISize OnScreenSurfaceSize() const override; - // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; - // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - // |shell::AndroidSurface| - bool SetNativeWindow(fxl::RefPtr window) override; + bool SetNativeWindow(fxl::RefPtr window, + PlatformView::SurfaceConfig config) override; private: fxl::RefPtr proc_table_; diff --git a/shell/platform/android/apk_asset_provider.cc b/shell/platform/android/apk_asset_provider.cc index 4cf6da16dc64f..fdd4910a12f4c 100644 --- a/shell/platform/android/apk_asset_provider.cc +++ b/shell/platform/android/apk_asset_provider.cc @@ -7,41 +7,32 @@ namespace blink { -APKAssetProvider::APKAssetProvider(JNIEnv* env, - jobject jassetManager, - std::string directory) - : directory_(std::move(directory)) { - assetManager_ = AAssetManager_fromJava(env, jassetManager); -} - -APKAssetProvider::~APKAssetProvider() = default; - -bool APKAssetProvider::IsValid() const { - return true; -} - bool APKAssetProvider::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { + std::vector* data) { std::stringstream ss; ss << directory_.c_str() << "/" << asset_name; - AAsset* asset = - AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); + AAsset* asset = AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); if (!asset) { - return false; + return false; } uint8_t* buffer = (uint8_t*)AAsset_getBuffer(asset); if (!buffer) { FXL_LOG(ERROR) << "Got null trying to acquire buffer for asset:" << asset; - AAsset_close(asset); return false; } data->resize(AAsset_getLength(asset)); std::copy(buffer, buffer + data->size(), data->begin()); - AAsset_close(asset); return true; } +APKAssetProvider::~APKAssetProvider() {} + +APKAssetProvider::APKAssetProvider(JNIEnv* env, jobject jassetManager, std::string directory) + : directory_(std::move(directory)) { + assetManager_ = AAssetManager_fromJava(env, jassetManager); +} + } // namespace blink diff --git a/shell/platform/android/apk_asset_provider.h b/shell/platform/android/apk_asset_provider.h index 70ddbe454bc61..c40b1ed2a1866 100644 --- a/shell/platform/android/apk_asset_provider.h +++ b/shell/platform/android/apk_asset_provider.h @@ -5,35 +5,28 @@ #ifndef FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ #define FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ -#include #include +#include -#include "flutter/assets/asset_resolver.h" +#include "flutter/assets/asset_provider.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class APKAssetProvider final : public AssetResolver { +class APKAssetProvider + : public AssetProvider { public: - explicit APKAssetProvider(JNIEnv* env, - jobject assetManager, - std::string directory); + explicit APKAssetProvider(JNIEnv* env, jobject assetManager, std::string directory); virtual ~APKAssetProvider(); - private: - AAssetManager* assetManager_; - const std::string directory_; - - // |blink::AssetResolver| - bool IsValid() const override; - - // |blink::AssetResolver| virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + std::vector* data); - FXL_DISALLOW_COPY_AND_ASSIGN(APKAssetProvider); + private: + AAssetManager* assetManager_; + const std::string directory_; }; } // namespace blink -#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file +#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file diff --git a/shell/platform/android/flutter_main.cc b/shell/platform/android/flutter_main.cc index 08d97add93b87..6df346a128722 100644 --- a/shell/platform/android/flutter_main.cc +++ b/shell/platform/android/flutter_main.cc @@ -2,85 +2,38 @@ // 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/shell/platform/android/flutter_main.h" #include -#include "flutter/fml/message_loop.h" -#include "flutter/fml/paths.h" #include "flutter/fml/platform/android/jni_util.h" -#include "flutter/runtime/dart_vm.h" #include "flutter/runtime/start_up.h" #include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" #include "lib/fxl/arraysize.h" #include "lib/fxl/command_line.h" -#include "lib/fxl/files/file.h" #include "lib/fxl/macros.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -FlutterMain::FlutterMain(blink::Settings settings) - : settings_(std::move(settings)) {} - -FlutterMain::~FlutterMain() = default; - -static std::unique_ptr g_flutter_main; - -FlutterMain& FlutterMain::Get() { - FXL_CHECK(g_flutter_main) << "ensureInitializationComplete must have already " - "been called."; - return *g_flutter_main; -} - -const blink::Settings& FlutterMain::GetSettings() const { - return settings_; -} - -void FlutterMain::Init(JNIEnv* env, - jclass clazz, - jobject context, - jobjectArray jargs, - jstring bundlePath) { +static void Init(JNIEnv* env, + jclass clazz, + jobject context, + jobjectArray jargs, + jstring bundlePath) { + // Prepare command line arguments and initialize the shell. std::vector args; - args.push_back("flutter"); + args.push_back("flutter_tester"); for (auto& arg : fml::jni::StringArrayToVector(env, jargs)) { args.push_back(std::move(arg)); } - auto command_line = fxl::CommandLineFromIterators(args.begin(), args.end()); - - auto settings = SettingsFromCommandLine(command_line); - - settings.assets_path = fml::jni::JavaStringToString(env, bundlePath); - - if (!blink::DartVM::IsRunningPrecompiledCode()) { - // Check to see if the appropriate kernel files are present and configure - // settings accordingly. - auto platform_kernel_path = - fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); - auto application_kernel_path = - fml::paths::JoinPaths({settings.assets_path, "kernel_blob.bin"}); - - if (files::IsFile(platform_kernel_path) && - files::IsFile(application_kernel_path)) { - settings.kernel_snapshot_path = platform_kernel_path; - settings.application_kernel_asset = application_kernel_path; - } - } - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - // Not thread safe. Will be removed when FlutterMain is refactored to no - // longer be a singleton. - g_flutter_main.reset(new FlutterMain(std::move(settings))); + auto command_line = fxl::CommandLineFromIterators(args.begin(), args.end()); + std::string icu_data_path = + command_line.GetOptionValueWithDefault("icu-data-file-path", ""); + Shell::InitStandalone(std::move(command_line), std::move(icu_data_path), + /* application_library_path= */ "", + fml::jni::JavaStringToString(env, bundlePath)); } static void RecordStartTimestamp(JNIEnv* env, @@ -91,7 +44,7 @@ static void RecordStartTimestamp(JNIEnv* env, blink::engine_main_enter_ts = Dart_TimelineGetMicros() - initTimeMicros; } -bool FlutterMain::Register(JNIEnv* env) { +bool RegisterFlutterMain(JNIEnv* env) { static const JNINativeMethod methods[] = { { .name = "nativeInit", diff --git a/shell/platform/android/flutter_main.h b/shell/platform/android/flutter_main.h index 6c8717e9cebdb..f4f65c499f966 100644 --- a/shell/platform/android/flutter_main.h +++ b/shell/platform/android/flutter_main.h @@ -7,34 +7,9 @@ #include -#include "flutter/common/settings.h" -#include "lib/fxl/macros.h" - namespace shell { -class FlutterMain { - public: - ~FlutterMain(); - - static bool Register(JNIEnv* env); - - static FlutterMain& Get(); - - const blink::Settings& GetSettings() const; - - private: - const blink::Settings settings_; - - FlutterMain(blink::Settings settings); - - static void Init(JNIEnv* env, - jclass clazz, - jobject context, - jobjectArray jargs, - jstring bundlePath); - - FXL_DISALLOW_COPY_AND_ASSIGN(FlutterMain); -}; +bool RegisterFlutterMain(JNIEnv* env); } // namespace shell diff --git a/shell/platform/android/library_loader.cc b/shell/platform/android/library_loader.cc index 569825ce33e21..c51d0114282f6 100644 --- a/shell/platform/android/library_loader.cc +++ b/shell/platform/android/library_loader.cc @@ -16,7 +16,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { bool result = false; // Register FlutterMain. - result = shell::FlutterMain::Register(env); + result = shell::RegisterFlutterMain(env); FXL_CHECK(result); // Register PlatformView diff --git a/shell/platform/android/platform_message_response_android.cc b/shell/platform/android/platform_message_response_android.cc deleted file mode 100644 index 214080ec5bde3..0000000000000 --- a/shell/platform/android/platform_message_response_android.cc +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2018 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/shell/platform/android/platform_message_response_android.h" - -#include "flutter/shell/platform/android/platform_view_android_jni.h" -#include "lib/fxl/functional/make_copyable.h" - -namespace shell { - -PlatformMessageResponseAndroid::PlatformMessageResponseAndroid( - int response_id, - fml::jni::JavaObjectWeakGlobalRef weak_java_object, - fxl::RefPtr platform_task_runner) - : response_id_(response_id), - weak_java_object_(weak_java_object), - platform_task_runner_(std::move(platform_task_runner)) {} - -// |blink::PlatformMessageResponse| -void PlatformMessageResponseAndroid::Complete(std::vector data) { - platform_task_runner_->PostTask( - fxl::MakeCopyable([response = response_id_, // - weak_java_object = weak_java_object_, // - data = std::move(data) // - ]() { - // We are on the platform thread. Attempt to get the strong reference to - // the Java object. - auto env = fml::jni::AttachCurrentThread(); - auto java_object = weak_java_object.get(env); - - if (java_object.is_null()) { - // The Java object was collected before this message response got to - // it. Drop the response on the floor. - return; - } - - if (data.size() == 0) { - // If the data is empty, there is no reason to create a Java byte - // array. Make the response now with a nullptr now. - FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), - response, nullptr); - } - - // Convert the vector to a Java byte array. - fml::jni::ScopedJavaLocalRef data_array( - env, env->NewByteArray(data.size())); - env->SetByteArrayRegion(data_array.obj(), 0, data.size(), - reinterpret_cast(data.data())); - - // Make the response call into Java. - FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), - response, data_array.obj()); - })); -} - -// |blink::PlatformMessageResponse| -void PlatformMessageResponseAndroid::CompleteEmpty() { - Complete(std::vector{}); -} - -} // namespace shell diff --git a/shell/platform/android/platform_message_response_android.h b/shell/platform/android/platform_message_response_android.h deleted file mode 100644 index 2ee7f3336ac6d..0000000000000 --- a/shell/platform/android/platform_message_response_android.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2018 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_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ -#define FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ - -#include "flutter/fml/platform/android/jni_weak_ref.h" -#include "flutter/fml/task_runner.h" -#include "flutter/lib/ui/window/platform_message_response.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { - public: - // |blink::PlatformMessageResponse| - void Complete(std::vector data) override; - - // |blink::PlatformMessageResponse| - void CompleteEmpty() override; - - private: - PlatformMessageResponseAndroid( - int response_id, - fml::jni::JavaObjectWeakGlobalRef weak_java_object, - fxl::RefPtr platform_task_runner); - - int response_id_; - fml::jni::JavaObjectWeakGlobalRef weak_java_object_; - fxl::RefPtr platform_task_runner_; - - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageResponseAndroid); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 00d1e4b59e848..8f677045fb1f5 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -4,55 +4,288 @@ #include "flutter/shell/platform/android/platform_view_android.h" -#include +#include +#include +#include +#include + #include -#include "flutter/shell/common/io_manager.h" +#include "flutter/common/settings.h" +#include "flutter/common/threads.h" +#include "flutter/fml/platform/android/jni_util.h" +#include "flutter/fml/platform/android/scoped_java_ref.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/shell/common/null_rasterizer.h" +#include "flutter/shell/gpu/gpu_rasterizer.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" #include "flutter/shell/platform/android/android_surface_gl.h" -#include "flutter/shell/platform/android/platform_message_response_android.h" +#include "flutter/shell/platform/android/android_surface_software.h" +#include "flutter/shell/platform/android/apk_asset_provider.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "flutter/shell/platform/android/vsync_waiter_android.h" -#include "lib/fxl/synchronization/waitable_event.h" +#include "lib/fxl/functional/make_copyable.h" + +#if SHELL_ENABLE_VULKAN +#include "flutter/shell/platform/android/android_surface_vulkan.h" +#endif // SHELL_ENABLE_VULKAN namespace shell { -PlatformViewAndroid::PlatformViewAndroid( - PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - fml::jni::JavaObjectWeakGlobalRef java_object, - bool use_software_rendering) - : PlatformView(delegate, std::move(task_runners)), - java_object_(java_object), - android_surface_(AndroidSurface::Create(use_software_rendering)) { - FXL_CHECK(android_surface_) - << "Could not create an OpenGL, Vulkan or Software surface to setup " - "rendering."; +class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); + + public: + void Complete(std::vector data) override { + fxl::RefPtr self(this); + blink::Threads::Platform()->PostTask( + fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { + std::shared_ptr view = self->view_.lock(); + if (!view) + return; + static_cast(view.get()) + ->HandlePlatformMessageResponse(self->response_id_, + std::move(data)); + })); + } + + void CompleteEmpty() override { + fxl::RefPtr self(this); + blink::Threads::Platform()->PostTask(fxl::MakeCopyable([self]() mutable { + std::shared_ptr view = self->view_.lock(); + if (!view) + return; + static_cast(view.get()) + ->HandlePlatformMessageEmptyResponse(self->response_id_); + })); + } + + private: + PlatformMessageResponseAndroid(int response_id, + std::weak_ptr view) + : response_id_(response_id), view_(view) {} + + int response_id_; + std::weak_ptr view_; +}; + +static std::unique_ptr InitializePlatformSurfaceGL() { + const PlatformView::SurfaceConfig offscreen_config = { + .red_bits = 8, + .green_bits = 8, + .blue_bits = 8, + .alpha_bits = 8, + .depth_bits = 0, + .stencil_bits = 0, + }; + auto surface = std::make_unique(offscreen_config); + return surface->IsOffscreenContextValid() ? std::move(surface) : nullptr; +} + +static std::unique_ptr InitializePlatformSurfaceVulkan() { +#if SHELL_ENABLE_VULKAN + auto surface = std::make_unique(); + return surface->IsValid() ? std::move(surface) : nullptr; +#else // SHELL_ENABLE_VULKAN + return nullptr; +#endif // SHELL_ENABLE_VULKAN } +static std::unique_ptr InitializePlatformSurfaceSoftware() { + auto surface = std::make_unique(); + return surface->IsValid() ? std::move(surface) : nullptr; +} + +static std::unique_ptr InitializePlatformSurface() { + if (blink::Settings::Get().enable_software_rendering) { + if (auto surface = InitializePlatformSurfaceSoftware()) { + FXL_DLOG(INFO) << "Software surface initialized."; + return surface; + } + } + + if (auto surface = InitializePlatformSurfaceVulkan()) { + FXL_DLOG(INFO) << "Vulkan surface initialized."; + return surface; + } + + FXL_DLOG(INFO) + << "Could not initialize Vulkan surface. Falling back to OpenGL."; + + if (auto surface = InitializePlatformSurfaceGL()) { + FXL_DLOG(INFO) << "GL surface initialized."; + return surface; + } + + if (auto surface = InitializePlatformSurfaceSoftware()) { + FXL_DLOG(INFO) << "Software surface initialized."; + return surface; + } + + FXL_CHECK(false) + << "Could not initialize either the Vulkan, OpenGL, or Software" + "surface backends. Flutter requires a GPU to render."; + return nullptr; +} + +PlatformViewAndroid::PlatformViewAndroid() + : PlatformView(std::make_unique()), + android_surface_(InitializePlatformSurface()) {} + PlatformViewAndroid::~PlatformViewAndroid() = default; -void PlatformViewAndroid::NotifyCreated( - fxl::RefPtr native_window) { - InstallFirstFrameCallback(); - android_surface_->SetNativeWindow(native_window); - PlatformView::NotifyCreated(); +void PlatformViewAndroid::Attach() { + CreateEngine(); + + // Eagerly setup the IO thread context. We have already setup the surface. + SetupResourceContextOnIOThread(); + + UpdateThreadPriorities(); } -void PlatformViewAndroid::NotifyDestroyed() { - PlatformView::NotifyDestroyed(); - android_surface_->TeardownOnScreenContext(); +void PlatformViewAndroid::Detach() { + ReleaseSurface(); } -void PlatformViewAndroid::NotifyChanged(const SkISize& size) { - fxl::AutoResetWaitableEvent latch; - fml::TaskRunner::RunNowOrPostTask( - task_runners_.GetGPUTaskRunner(), // - [&latch, surface = android_surface_.get(), size]() { - surface->OnScreenSurfaceResize(size); - latch.Signal(); +void PlatformViewAndroid::SurfaceCreated(JNIEnv* env, + jobject jsurface, + jint backgroundColor) { + // Note: This frame ensures that any local references used by + // ANativeWindow_fromSurface are released immediately. This is needed as a + // workaround for https://code.google.com/p/android/issues/detail?id=68174 + fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); + + // We have a drawing surface, so swap in a non-Null rasterizer. + SetRasterizer(std::make_unique(nullptr)); + + rasterizer_->AddNextFrameCallback([this]() { + JNIEnv* env = fml::jni::AttachCurrentThread(); + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + if (!view.is_null()) { + FlutterViewOnFirstFrame(env, view.obj()); + } + }); + + auto native_window = fxl::MakeRefCounted( + ANativeWindow_fromSurface(env, jsurface)); + + if (!native_window->IsValid()) { + return; + } + + if (!android_surface_->SetNativeWindow(native_window)) { + return; + } + + std::unique_ptr gpu_surface = android_surface_->CreateGPUSurface(); + + if (gpu_surface == nullptr || !gpu_surface->IsValid()) { + return; + } + + NotifyCreated(std::move(gpu_surface), [ + this, backgroundColor, native_window_size = native_window->GetSize() + ] { rasterizer().Clear(backgroundColor, native_window_size); }); +} + +void PlatformViewAndroid::SurfaceChanged(jint width, jint height) { + blink::Threads::Gpu()->PostTask([this, width, height]() { + if (android_surface_) { + android_surface_->OnScreenSurfaceResize(SkISize::Make(width, height)); + } + }); +} + +void PlatformViewAndroid::UpdateThreadPriorities() { + blink::Threads::Gpu()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); + + blink::Threads::UI()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); +} + +void PlatformViewAndroid::SurfaceDestroyed() { + ReleaseSurface(); +} + +void PlatformViewAndroid::RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, + std::string snapshot_override, + std::string entrypoint, + bool reuse_runtime_controller, + jobject assetManager) { + // TODO(jsimmons): remove snapshot_override from the public FlutterView API + FXL_CHECK(snapshot_override.empty()) << "snapshot_override is obsolete"; + + // The flutter assets directory name is the last directory of the bundle_path + // and the path into the APK + size_t last_slash_idx = bundle_path.rfind("/", bundle_path.size()); + std::string flutter_assets_dir = bundle_path.substr( + last_slash_idx + 1, bundle_path.size() - last_slash_idx); + + fxl::RefPtr asset_provider = + fxl::MakeRefCounted(env, assetManager, + flutter_assets_dir); + blink::Threads::UI()->PostTask( + [engine = engine_->GetWeakPtr(), + asset_provider = std::move(asset_provider), + bundle_path = std::move(bundle_path), entrypoint = std::move(entrypoint), + reuse_runtime_controller = reuse_runtime_controller] { + if (engine) + engine->RunBundleWithAssets( + std::move(asset_provider), std::move(bundle_path), + std::move(entrypoint), reuse_runtime_controller); }); - latch.Wait(); +} + +void PlatformViewAndroid::RunBundleAndSource(std::string bundle_path, + std::string main, + std::string packages) { + blink::Threads::UI()->PostTask([ + engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path), + main = std::move(main), packages = std::move(packages) + ] { + if (engine) + engine->RunBundleAndSource(std::move(bundle_path), std::move(main), + std::move(packages)); + }); +} + +void PlatformViewAndroid::SetAssetBundlePathOnUI(std::string bundle_path) { + blink::Threads::UI()->PostTask( + [ engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path) ] { + if (engine) + engine->SetAssetBundlePath(std::move(bundle_path)); + }); +} + +void PlatformViewAndroid::SetViewportMetrics(jfloat device_pixel_ratio, + jint physical_width, + jint physical_height, + jint physical_padding_top, + jint physical_padding_right, + jint physical_padding_bottom, + jint physical_padding_left, + jint physical_view_inset_top, + jint physical_view_inset_right, + jint physical_view_inset_bottom, + jint physical_view_inset_left) { + blink::ViewportMetrics metrics; + metrics.device_pixel_ratio = device_pixel_ratio; + metrics.physical_width = physical_width; + metrics.physical_height = physical_height; + metrics.physical_padding_top = physical_padding_top; + metrics.physical_padding_right = physical_padding_right; + metrics.physical_padding_bottom = physical_padding_bottom; + metrics.physical_padding_left = physical_padding_left; + metrics.physical_view_inset_top = physical_view_inset_top; + metrics.physical_view_inset_right = physical_view_inset_right; + metrics.physical_view_inset_bottom = physical_view_inset_bottom; + metrics.physical_view_inset_left = physical_view_inset_left; + + blink::Threads::UI()->PostTask([ engine = engine_->GetWeakPtr(), metrics ] { + if (engine) + engine->SetViewportMetrics(metrics); + }); } void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, @@ -68,7 +301,7 @@ void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, java_object_, task_runners_.GetPlatformTaskRunner()); + response_id, GetWeakPtr()); } PlatformView::DispatchPlatformMessage( @@ -82,7 +315,7 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, java_object_, task_runners_.GetPlatformTaskRunner()); + response_id, GetWeakPtr()); } PlatformView::DispatchPlatformMessage( @@ -90,6 +323,20 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, std::move(response))); } +void PlatformViewAndroid::DispatchPointerDataPacket(JNIEnv* env, + jobject buffer, + jint position) { + uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); + + blink::Threads::UI()->PostTask(fxl::MakeCopyable([ + engine = engine_->GetWeakPtr(), + packet = std::make_unique(data, position) + ] { + if (engine.get()) + engine->DispatchPointerDataPacket(*packet); + })); +} + void PlatformViewAndroid::InvokePlatformMessageResponseCallback( JNIEnv* env, jint response_id, @@ -122,11 +369,10 @@ void PlatformViewAndroid::InvokePlatformMessageEmptyResponseCallback( message_response->CompleteEmpty(); } -// |shell::PlatformView| void PlatformViewAndroid::HandlePlatformMessage( fxl::RefPtr message) { JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = java_object_.get(env); + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); if (view.is_null()) return; @@ -156,6 +402,35 @@ void PlatformViewAndroid::HandlePlatformMessage( } } +void PlatformViewAndroid::HandlePlatformMessageResponse( + int response_id, + std::vector data) { + JNIEnv* env = fml::jni::AttachCurrentThread(); + + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + + if (view.is_null()) + return; + fml::jni::ScopedJavaLocalRef data_array( + env, env->NewByteArray(data.size())); + env->SetByteArrayRegion(data_array.obj(), 0, data.size(), + reinterpret_cast(data.data())); + + FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, + data_array.obj()); +} + +void PlatformViewAndroid::HandlePlatformMessageEmptyResponse(int response_id) { + JNIEnv* env = fml::jni::AttachCurrentThread(); + + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + + if (view.is_null()) + return; + FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, + nullptr); +} + void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, jint id, jint action, @@ -176,14 +451,35 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, id, static_cast(action), std::move(args_vector)); } -// |shell::PlatformView| -void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { +void PlatformViewAndroid::SetSemanticsEnabled(jboolean enabled) { + PlatformView::SetSemanticsEnabled(enabled); +} + +void PlatformViewAndroid::ReleaseSurface() { + NotifyDestroyed(); + android_surface_->TeardownOnScreenContext(); + SetRasterizer(std::make_unique()); +} + +VsyncWaiter* PlatformViewAndroid::GetVsyncWaiter() { + if (!vsync_waiter_) + vsync_waiter_ = std::make_unique(); + return vsync_waiter_.get(); +} + +bool PlatformViewAndroid::ResourceContextMakeCurrent() { + FXL_CHECK(android_surface_); + return android_surface_->ResourceContextMakeCurrent(); +} + +void PlatformViewAndroid::UpdateSemantics( + blink::SemanticsNodeUpdates update) { constexpr size_t kBytesPerNode = 36 * sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t); JNIEnv* env = fml::jni::AttachCurrentThread(); { - fml::jni::ScopedJavaLocalRef view = java_object_.get(env); + fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); if (view.is_null()) return; @@ -264,6 +560,79 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { } } +void PlatformViewAndroid::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + JNIEnv* env = fml::jni::AttachCurrentThread(); + FXL_CHECK(env); + + { + fml::jni::ScopedJavaLocalRef local_flutter_view = + flutter_view_.get(env); + if (local_flutter_view.is_null()) { + // Collected. + return; + } + + // Grab the class of the flutter view. + jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); + FXL_CHECK(flutter_view_class); + + // Grab the runFromSource method id. + jmethodID run_from_source_method_id = env->GetMethodID( + flutter_view_class, "runFromSource", + "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); + FXL_CHECK(run_from_source_method_id); + + // Invoke runFromSource on the Android UI thread. + jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); + FXL_CHECK(java_assets_directory); + jstring java_main = env->NewStringUTF(main.c_str()); + FXL_CHECK(java_main); + jstring java_packages = env->NewStringUTF(packages.c_str()); + FXL_CHECK(java_packages); + env->CallVoidMethod(local_flutter_view.obj(), run_from_source_method_id, + java_assets_directory, java_main, java_packages); + } + + // Detaching from the VM deletes any stray local references. + fml::jni::DetachFromVM(); +} + +void PlatformViewAndroid::SetAssetBundlePath( + const std::string& assets_directory) { + JNIEnv* env = fml::jni::AttachCurrentThread(); + FXL_CHECK(env); + + { + fml::jni::ScopedJavaLocalRef local_flutter_view = + flutter_view_.get(env); + if (local_flutter_view.is_null()) { + // Collected. + return; + } + + // Grab the class of the flutter view. + jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); + FXL_CHECK(flutter_view_class); + + // Grab the setAssetBundlePath method id. + jmethodID method_id = env->GetMethodID( + flutter_view_class, "setAssetBundlePathOnUI", "(Ljava/lang/String;)V"); + FXL_CHECK(method_id); + + // Invoke setAssetBundlePath on the Android UI thread. + jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); + FXL_CHECK(java_assets_directory); + + env->CallVoidMethod(local_flutter_view.obj(), method_id, + java_assets_directory); + } + + // Detaching from the VM deletes any stray local references. + fml::jni::DetachFromVM(); +} + void PlatformViewAndroid::RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture) { @@ -271,56 +640,116 @@ void PlatformViewAndroid::RegisterExternalTexture( std::make_shared(texture_id, surface_texture)); } -// |shell::PlatformView| -std::unique_ptr PlatformViewAndroid::CreateVSyncWaiter() { - return std::make_unique(task_runners_); +void PlatformViewAndroid::MarkTextureFrameAvailable(int64_t texture_id) { + blink::Threads::Gpu()->PostTask([this, texture_id]() { + std::shared_ptr texture = + static_pointer_cast( + rasterizer_->GetTextureRegistry().GetTexture(texture_id)); + if (texture) { + texture->MarkNewFrameAvailable(); + } + }); + PlatformView::MarkTextureFrameAvailable(texture_id); } -// |shell::PlatformView| -std::unique_ptr PlatformViewAndroid::CreateRenderingSurface() { - return android_surface_->CreateGPUSurface(); -} +fml::jni::ScopedJavaLocalRef PlatformViewAndroid::GetBitmap( + JNIEnv* env) { + // Render the last frame to an array of pixels on the GPU thread. + // The pixels will be returned as a global JNI reference to an int array. + fxl::AutoResetWaitableEvent latch; + jobject pixels_ref = nullptr; + SkISize frame_size; + blink::Threads::Gpu()->PostTask([this, &latch, &pixels_ref, &frame_size]() { + GetBitmapGpuTask(&pixels_ref, &frame_size); + latch.Signal(); + }); -// |shell::PlatformView| -sk_sp PlatformViewAndroid::CreateResourceContext() const { - sk_sp resource_context; - if (android_surface_->ResourceContextMakeCurrent()) { - // TODO(chinmaygarde): Currently, this code depends on the fact that only - // the OpenGL surface will be able to make a resource context current. If - // this changes, this assumption breaks. Handle the same. - resource_context = IOManager::CreateCompatibleResourceLoadingContext( - GrBackend::kOpenGL_GrBackend); - } else { - FXL_DLOG(ERROR) << "Could not make the resource context current."; - } + latch.Wait(); - return resource_context; -} - -void PlatformViewAndroid::InstallFirstFrameCallback() { - // On Platform Task Runner. - SetNextFrameCallback( - [platform_view = GetWeakPtr(), - platform_task_runner = task_runners_.GetPlatformTaskRunner()]() { - // On GPU Task Runner. - platform_task_runner->PostTask([platform_view]() { - // Back on Platform Task Runner. - if (platform_view) { - reinterpret_cast(platform_view.get()) - ->FireFirstFrameCallback(); - } - }); - }); + // Convert the pixel array to an Android bitmap. + if (pixels_ref == nullptr) + return fml::jni::ScopedJavaLocalRef(); + + fml::jni::ScopedJavaGlobalRef pixels(env, pixels_ref); + + jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); + FXL_CHECK(bitmap_class); + + jmethodID create_bitmap = env->GetStaticMethodID( + bitmap_class, "createBitmap", + "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); + FXL_CHECK(create_bitmap); + + jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); + FXL_CHECK(bitmap_config_class); + + jmethodID bitmap_config_value_of = env->GetStaticMethodID( + bitmap_config_class, "valueOf", + "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); + FXL_CHECK(bitmap_config_value_of); + + jstring argb = env->NewStringUTF("ARGB_8888"); + FXL_CHECK(argb); + + jobject bitmap_config = env->CallStaticObjectMethod( + bitmap_config_class, bitmap_config_value_of, argb); + FXL_CHECK(bitmap_config); + + jobject bitmap = env->CallStaticObjectMethod( + bitmap_class, create_bitmap, pixels.obj(), frame_size.width(), + frame_size.height(), bitmap_config); + + return fml::jni::ScopedJavaLocalRef(env, bitmap); } -void PlatformViewAndroid::FireFirstFrameCallback() { - JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = java_object_.get(env); - if (view.is_null()) { - // The Java object died. +void PlatformViewAndroid::GetBitmapGpuTask(jobject* pixels_out, + SkISize* size_out) { + flow::LayerTree* layer_tree = rasterizer_->GetLastLayerTree(); + if (layer_tree == nullptr) return; + + JNIEnv* env = fml::jni::AttachCurrentThread(); + FXL_CHECK(env); + + const SkISize& frame_size = layer_tree->frame_size(); + jsize pixels_size = frame_size.width() * frame_size.height(); + jintArray pixels_array = env->NewIntArray(pixels_size); + FXL_CHECK(pixels_array); + + jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); + FXL_CHECK(pixels); + + SkImageInfo image_info = + SkImageInfo::Make(frame_size.width(), frame_size.height(), + kRGBA_8888_SkColorType, kPremul_SkAlphaType); + + sk_sp surface = SkSurface::MakeRasterDirect( + image_info, pixels, frame_size.width() * sizeof(jint)); + + flow::CompositorContext compositor_context(nullptr); + compositor_context.SetTextureRegistry(&texture_registry_); + SkCanvas* canvas = surface->getCanvas(); + flow::CompositorContext::ScopedFrame frame = + compositor_context.AcquireFrame(nullptr, canvas, false); + + canvas->clear(SK_ColorBLACK); + layer_tree->Raster(frame); + canvas->flush(); + + // Our configuration of Skia does not support rendering to the + // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. + // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). + for (int i = 0; i < pixels_size; i++) { + uint8_t* bytes = reinterpret_cast(pixels + i); + std::swap(bytes[0], bytes[2]); } - FlutterViewOnFirstFrame(fml::jni::AttachCurrentThread(), view.obj()); + + env->ReleaseIntArrayElements(pixels_array, pixels, 0); + + *pixels_out = env->NewGlobalRef(pixels_array); + *size_out = frame_size; + + fml::jni::DetachFromVM(); } } // namespace shell diff --git a/shell/platform/android/platform_view_android.h b/shell/platform/android/platform_view_android.h index 9976c443f4248..4779ea16ab4a7 100644 --- a/shell/platform/android/platform_view_android.h +++ b/shell/platform/android/platform_view_android.h @@ -20,23 +20,45 @@ namespace shell { -class PlatformViewAndroid final : public PlatformView { +class PlatformViewAndroid : public PlatformView { public: static bool Register(JNIEnv* env); - PlatformViewAndroid(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - fml::jni::JavaObjectWeakGlobalRef java_object, - bool use_software_rendering); + PlatformViewAndroid(); ~PlatformViewAndroid() override; - void NotifyCreated(fxl::RefPtr native_window); + virtual void Attach() override; - void NotifyChanged(const SkISize& size); + void Detach(); - // |shell::PlatformView| - void NotifyDestroyed() override; + void SurfaceCreated(JNIEnv* env, jobject jsurface, jint backgroundColor); + + void SurfaceChanged(jint width, jint height); + + void SurfaceDestroyed(); + + void RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, + std::string snapshot_override, + std::string entrypoint, + bool reuse_isolate, + jobject assetManager); + + void RunBundleAndSource(std::string bundle_path, + std::string main, + std::string packages); + + void SetViewportMetrics(jfloat device_pixel_ratio, + jint physical_width, + jint physical_height, + jint physical_padding_top, + jint physical_padding_right, + jint physical_padding_bottom, + jint physical_padding_left, + jint physical_view_inset_top, + jint physical_view_inset_right, + jint physical_view_inset_bottom, + jint physical_view_inset_left); void DispatchPlatformMessage(JNIEnv* env, std::string name, @@ -48,6 +70,8 @@ class PlatformViewAndroid final : public PlatformView { std::string name, jint response_id); + void DispatchPointerDataPacket(JNIEnv* env, jobject buffer, jint position); + void InvokePlatformMessageResponseCallback(JNIEnv* env, jint response_id, jobject java_response_data, @@ -62,37 +86,55 @@ class PlatformViewAndroid final : public PlatformView { jobject args, jint args_position); + void SetSemanticsEnabled(jboolean enabled); + + fml::jni::ScopedJavaLocalRef GetBitmap(JNIEnv* env); + + VsyncWaiter* GetVsyncWaiter() override; + + bool ResourceContextMakeCurrent() override; + + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + void HandlePlatformMessage( + fxl::RefPtr message) override; + + void HandlePlatformMessageResponse(int response_id, + std::vector data); + + void HandlePlatformMessageEmptyResponse(int response_id); + + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + + void SetAssetBundlePathOnUI(std::string bundle_path); + + void SetAssetBundlePath(const std::string& assets_directory) override; + void RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture); + void MarkTextureFrameAvailable(int64_t texture_id) override; + + void set_flutter_view(const fml::jni::JavaObjectWeakGlobalRef& flutter_view) { + flutter_view_ = flutter_view; + } + private: - const fml::jni::JavaObjectWeakGlobalRef java_object_; - const std::unique_ptr android_surface_; + std::unique_ptr android_surface_; + fml::jni::JavaObjectWeakGlobalRef flutter_view_; // We use id 0 to mean that no response is expected. int next_response_id_ = 1; std::unordered_map> pending_responses_; - // |shell::PlatformView| - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - // |shell::PlatformView| - void HandlePlatformMessage( - fxl::RefPtr message) override; - - // |shell::PlatformView| - std::unique_ptr CreateVSyncWaiter() override; - - // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; - - // |shell::PlatformView| - sk_sp CreateResourceContext() const override; + void UpdateThreadPriorities(); - void InstallFirstFrameCallback(); + void ReleaseSurface(); - void FireFirstFrameCallback(); + void GetBitmapGpuTask(jobject* pixels_out, SkISize* size_out); FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); }; diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index f75f54a896850..c819f3bfb5e41 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -4,26 +4,17 @@ #include "flutter/shell/platform/android/platform_view_android_jni.h" -#include - -#include - -#include "flutter/assets/directory_asset_bundle.h" #include "flutter/common/settings.h" -#include "flutter/fml/file.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/jni_weak_ref.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/runtime/dart_service_isolate.h" -#include "flutter/shell/common/run_configuration.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" -#include "flutter/shell/platform/android/android_shell_holder.h" -#include "flutter/shell/platform/android/apk_asset_provider.h" -#include "flutter/shell/platform/android/flutter_main.h" #include "lib/fxl/arraysize.h" +#include "lib/fxl/logging.h" -#define ANDROID_SHELL_HOLDER \ - (reinterpret_cast(shell_holder)) +#define PLATFORM_VIEW \ + (*reinterpret_cast*>(platform_view)) namespace shell { @@ -87,12 +78,14 @@ void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj) { static jmethodID g_attach_to_gl_context_method = nullptr; void SurfaceTextureAttachToGLContext(JNIEnv* env, jobject obj, jint textureId) { + ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_attach_to_gl_context_method, textureId); FXL_CHECK(CheckException(env)); } static jmethodID g_update_tex_image_method = nullptr; void SurfaceTextureUpdateTexImage(JNIEnv* env, jobject obj) { + ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_update_tex_image_method); FXL_CHECK(CheckException(env)); } @@ -101,12 +94,14 @@ static jmethodID g_get_transform_matrix_method = nullptr; void SurfaceTextureGetTransformMatrix(JNIEnv* env, jobject obj, jfloatArray result) { + ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_get_transform_matrix_method, result); FXL_CHECK(CheckException(env)); } static jmethodID g_detach_from_gl_context_method = nullptr; void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { + ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_detach_from_gl_context_method); FXL_CHECK(CheckException(env)); } @@ -114,22 +109,22 @@ void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { // Called By Java static jlong Attach(JNIEnv* env, jclass clazz, jobject flutterView) { - fml::jni::JavaObjectWeakGlobalRef java_object(env, flutterView); - auto shell_holder = std::make_unique( - FlutterMain::Get().GetSettings(), java_object); - if (shell_holder->IsValid()) { - return reinterpret_cast(shell_holder.release()); - } else { - return 0; - } + auto view = new PlatformViewAndroid(); + auto storage = new std::shared_ptr(view); + // Create a weak reference to the flutterView Java object so that we can make + // calls into it later. + view->Attach(); + view->set_flutter_view(fml::jni::JavaObjectWeakGlobalRef(env, flutterView)); + return reinterpret_cast(storage); } -static void Detach(JNIEnv* env, jobject jcaller, jlong shell_holder) { - // Nothing to do. +static void Detach(JNIEnv* env, jobject jcaller, jlong platform_view) { + PLATFORM_VIEW->Detach(); } -static void Destroy(JNIEnv* env, jobject jcaller, jlong shell_holder) { - delete ANDROID_SHELL_HOLDER; +static void Destroy(JNIEnv* env, jobject jcaller, jlong platform_view) { + PLATFORM_VIEW->Detach(); + delete &PLATFORM_VIEW; } static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { @@ -139,180 +134,67 @@ static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { static void SurfaceCreated(JNIEnv* env, jobject jcaller, - jlong shell_holder, - jobject jsurface, + jlong platform_view, + jobject surface, jint backgroundColor) { - // Note: This frame ensures that any local references used by - // ANativeWindow_fromSurface are released immediately. This is needed as a - // workaround for https://code.google.com/p/android/issues/detail?id=68174 - fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); - auto window = fxl::MakeRefCounted( - ANativeWindow_fromSurface(env, jsurface)); - ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyCreated(std::move(window)); + return PLATFORM_VIEW->SurfaceCreated(env, surface, backgroundColor); } static void SurfaceChanged(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jint width, jint height) { - ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyChanged( - SkISize::Make(width, height)); -} - -static void SurfaceDestroyed(JNIEnv* env, jobject jcaller, jlong shell_holder) { - ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyDestroyed(); -} - -std::unique_ptr CreateIsolateConfiguration( - const blink::AssetManager& asset_manager) { - if (blink::DartVM::IsRunningPrecompiledCode()) { - return IsolateConfiguration::CreateForPrecompiledCode(); - } - - const auto configuration_from_blob = - [&asset_manager](const std::string& snapshot_name) - -> std::unique_ptr { - std::vector blob; - if (asset_manager.GetAsBuffer(snapshot_name, &blob)) { - return IsolateConfiguration::CreateForSnapshot( - std::make_unique(std::move(blob))); - } - return nullptr; - }; - - if (auto kernel = configuration_from_blob("kernel_blob.bin")) { - return kernel; - } - - if (auto script = configuration_from_blob("snapshot_blob.bin")) { - return script; - } - - return nullptr; -} - -static void RunBundleAndSnapshot( - JNIEnv* env, - jobject jcaller, - jlong shell_holder, - jstring jbundlepath, - jstring /* snapshot override (unused) */, - jstring jEntrypoint, - jboolean /* reuse runtime controller (unused) */, - jobject jAssetManager) { - auto asset_manager = fxl::MakeRefCounted(); - - const auto bundlepath = fml::jni::JavaStringToString(env, jbundlepath); - - if (bundlepath.size() > 0) { - // If we got a bundle path, attempt to use that as a directory asset - // bundle. - asset_manager->PushBack(std::make_unique( - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true))); - - // Use the last path component of the bundle path to determine the - // directory in the APK assets. - const auto last_slash_index = bundlepath.rfind("/", bundlepath.size()); - if (last_slash_index != std::string::npos) { - auto apk_asset_dir = bundlepath.substr( - last_slash_index + 1, bundlepath.size() - last_slash_index); - - asset_manager->PushBack(std::make_unique( - env, // jni environment - jAssetManager, // asset manager - std::move(apk_asset_dir)) // apk asset dir - ); - } - } - - auto isolate_configuration = CreateIsolateConfiguration(*asset_manager); - - if (!isolate_configuration) { - FXL_DLOG(ERROR) - << "Isolate configuration could not be determined for engine launch."; - return; - } - - RunConfiguration config(std::move(isolate_configuration), - std::move(asset_manager)); - - { - auto entrypoint = fml::jni::JavaStringToString(env, jEntrypoint); - if (entrypoint.size() > 0) { - config.SetEntrypoint(std::move(entrypoint)); - } - } - - ANDROID_SHELL_HOLDER->Launch(std::move(config)); + return PLATFORM_VIEW->SurfaceChanged(width, height); +} + +static void SurfaceDestroyed(JNIEnv* env, + jobject jcaller, + jlong platform_view) { + return PLATFORM_VIEW->SurfaceDestroyed(); +} + +static void RunBundleAndSnapshot(JNIEnv* env, + jobject jcaller, + jlong platform_view, + jstring bundlePath, + jstring snapshotOverride, + jstring entrypoint, + jboolean reuse_runtime_controller, + jobject assetManager) { + return PLATFORM_VIEW->RunBundleAndSnapshot( + env, + fml::jni::JavaStringToString(env, bundlePath), // + fml::jni::JavaStringToString(env, snapshotOverride), // + fml::jni::JavaStringToString(env, entrypoint), // + reuse_runtime_controller, // + assetManager + ); } -static void RunBundleAndSource(JNIEnv* env, - jobject jcaller, - jlong shell_holder, - jstring jBundlePath, - jstring main, - jstring packages) { - auto asset_manager = fxl::MakeRefCounted(); - - const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); - - if (bundlepath.size() > 0) { - auto directory = - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); - asset_manager->PushBack( - std::make_unique(std::move(directory))); - } - - auto main_file_path = fml::jni::JavaStringToString(env, main); - auto packages_file_path = fml::jni::JavaStringToString(env, packages); - - auto config = - IsolateConfiguration::CreateForSource(main_file_path, packages_file_path); - - if (!config) { - return; - } - - RunConfiguration run_configuration(std::move(config), - std::move(asset_manager)); - - ANDROID_SHELL_HOLDER->Launch(std::move(run_configuration)); +void RunBundleAndSource(JNIEnv* env, + jobject jcaller, + jlong platform_view, + jstring bundlePath, + jstring main, + jstring packages) { + return PLATFORM_VIEW->RunBundleAndSource( + fml::jni::JavaStringToString(env, bundlePath), + fml::jni::JavaStringToString(env, main), + fml::jni::JavaStringToString(env, packages)); } void SetAssetBundlePathOnUI(JNIEnv* env, jobject jcaller, - jlong shell_holder, - jstring jBundlePath) { - const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); - - if (bundlepath.size() == 0) { - return; - } - - auto directory = - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); - - if (!directory.is_valid()) { - return; - } - - std::unique_ptr directory_asset_bundle = - std::make_unique(std::move(directory)); - - if (!directory_asset_bundle->IsValid()) { - return; - } - - auto asset_manager = fxl::MakeRefCounted(); - asset_manager->PushBack(std::move(directory_asset_bundle)); - - ANDROID_SHELL_HOLDER->UpdateAssetManager(std::move(asset_manager)); + jlong platform_view, + jstring bundlePath) { + return PLATFORM_VIEW->SetAssetBundlePathOnUI( + fml::jni::JavaStringToString(env, bundlePath)); } static void SetViewportMetrics(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jfloat devicePixelRatio, jint physicalWidth, jint physicalHeight, @@ -324,194 +206,115 @@ static void SetViewportMetrics(JNIEnv* env, jint physicalViewInsetRight, jint physicalViewInsetBottom, jint physicalViewInsetLeft) { - const blink::ViewportMetrics metrics = { - .device_pixel_ratio = devicePixelRatio, - .physical_width = physicalWidth, - .physical_height = physicalHeight, - .physical_padding_top = physicalPaddingTop, - .physical_padding_right = physicalPaddingRight, - .physical_padding_bottom = physicalPaddingBottom, - .physical_padding_left = physicalPaddingLeft, - .physical_view_inset_top = physicalViewInsetTop, - .physical_view_inset_right = physicalViewInsetRight, - .physical_view_inset_bottom = physicalViewInsetBottom, - .physical_view_inset_left = physicalViewInsetLeft, - }; - - ANDROID_SHELL_HOLDER->SetViewportMetrics(metrics); + return PLATFORM_VIEW->SetViewportMetrics(devicePixelRatio, // + physicalWidth, // + physicalHeight, // + physicalPaddingTop, // + physicalPaddingRight, // + physicalPaddingBottom, // + physicalPaddingLeft, // + physicalViewInsetTop, // + physicalViewInsetRight, // + physicalViewInsetBottom, // + physicalViewInsetLeft); } -static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) { - auto screenshot = ANDROID_SHELL_HOLDER->Screenshot( - Rasterizer::ScreenshotType::UncompressedImage, false); - if (screenshot.data == nullptr) { - return nullptr; - } - - const SkISize& frame_size = screenshot.frame_size; - jsize pixels_size = frame_size.width() * frame_size.height(); - jintArray pixels_array = env->NewIntArray(pixels_size); - FXL_CHECK(pixels_array); - - jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); - FXL_CHECK(pixels); - - auto pixels_src = static_cast(screenshot.data->data()); - - // Our configuration of Skia does not support rendering to the - // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. - // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). - for (int i = 0; i < pixels_size; i++) { - int32_t src_pixel = pixels_src[i]; - uint8_t* src_bytes = reinterpret_cast(&src_pixel); - std::swap(src_bytes[0], src_bytes[2]); - pixels[i] = src_pixel; - } - - env->ReleaseIntArrayElements(pixels_array, pixels, 0); - - jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); - FXL_CHECK(bitmap_class); - - jmethodID create_bitmap = env->GetStaticMethodID( - bitmap_class, "createBitmap", - "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); - FXL_CHECK(create_bitmap); - - jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); - FXL_CHECK(bitmap_config_class); - - jmethodID bitmap_config_value_of = env->GetStaticMethodID( - bitmap_config_class, "valueOf", - "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); - FXL_CHECK(bitmap_config_value_of); - - jstring argb = env->NewStringUTF("ARGB_8888"); - FXL_CHECK(argb); - - jobject bitmap_config = env->CallStaticObjectMethod( - bitmap_config_class, bitmap_config_value_of, argb); - FXL_CHECK(bitmap_config); - - return env->CallStaticObjectMethod(bitmap_class, create_bitmap, pixels_array, - frame_size.width(), frame_size.height(), - bitmap_config); +static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong platform_view) { + return PLATFORM_VIEW->GetBitmap(env).Release(); } static void DispatchPlatformMessage(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jstring channel, jobject message, jint position, jint responseId) { - ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPlatformMessage( - env, // - fml::jni::JavaStringToString(env, channel), // - message, // - position, // - responseId // - ); + return PLATFORM_VIEW->DispatchPlatformMessage( + env, fml::jni::JavaStringToString(env, channel), message, position, + responseId); } static void DispatchEmptyPlatformMessage(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jstring channel, jint responseId) { - ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchEmptyPlatformMessage( - env, // - fml::jni::JavaStringToString(env, channel), // - responseId // - ); + return PLATFORM_VIEW->DispatchEmptyPlatformMessage( + env, fml::jni::JavaStringToString(env, channel), responseId); } static void DispatchPointerDataPacket(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jobject buffer, jint position) { - uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); - auto packet = std::make_unique(data, position); - ANDROID_SHELL_HOLDER->DispatchPointerDataPacket(std::move(packet)); + return PLATFORM_VIEW->DispatchPointerDataPacket(env, buffer, position); } static void DispatchSemanticsAction(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jint id, jint action, jobject args, jint args_position) { - ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchSemanticsAction( - env, // - id, // - action, // - args, // - args_position // - ); + return PLATFORM_VIEW->DispatchSemanticsAction(env, id, action, args, + args_position); } static void SetSemanticsEnabled(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jboolean enabled) { - ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled); + return PLATFORM_VIEW->SetSemanticsEnabled(enabled); } static jboolean GetIsSoftwareRendering(JNIEnv* env, jobject jcaller) { - return FlutterMain::Get().GetSettings().enable_software_rendering; + return blink::Settings::Get().enable_software_rendering; } static void RegisterTexture(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jlong texture_id, jobject surface_texture) { - ANDROID_SHELL_HOLDER->GetPlatformView()->RegisterExternalTexture( - static_cast(texture_id), // - fml::jni::JavaObjectWeakGlobalRef(env, surface_texture) // - ); + PLATFORM_VIEW->RegisterExternalTexture( + static_cast(texture_id), + fml::jni::JavaObjectWeakGlobalRef(env, surface_texture)); } static void MarkTextureFrameAvailable(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jlong texture_id) { - ANDROID_SHELL_HOLDER->GetPlatformView()->MarkTextureFrameAvailable( + return PLATFORM_VIEW->MarkTextureFrameAvailable( static_cast(texture_id)); } static void UnregisterTexture(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jlong texture_id) { - ANDROID_SHELL_HOLDER->GetPlatformView()->UnregisterTexture( - static_cast(texture_id)); + PLATFORM_VIEW->UnregisterTexture(static_cast(texture_id)); } static void InvokePlatformMessageResponseCallback(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jint responseId, jobject message, jint position) { - ANDROID_SHELL_HOLDER->GetPlatformView() - ->InvokePlatformMessageResponseCallback(env, // - responseId, // - message, // - position // - ); + return PLATFORM_VIEW->InvokePlatformMessageResponseCallback( + env, responseId, message, position); } static void InvokePlatformMessageEmptyResponseCallback(JNIEnv* env, jobject jcaller, - jlong shell_holder, + jlong platform_view, jint responseId) { - ANDROID_SHELL_HOLDER->GetPlatformView() - ->InvokePlatformMessageEmptyResponseCallback(env, // - responseId // - ); + return PLATFORM_VIEW->InvokePlatformMessageEmptyResponseCallback(env, + responseId); } bool PlatformViewAndroid::Register(JNIEnv* env) { @@ -550,8 +353,8 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { }, { .name = "nativeRunBundleAndSnapshot", - .signature = "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/" - "String;ZLandroid/content/res/AssetManager;)V", + .signature = + "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLandroid/content/res/AssetManager;)V", .fnPtr = reinterpret_cast(&shell::RunBundleAndSnapshot), }, { @@ -570,6 +373,11 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { .signature = "(J)V", .fnPtr = reinterpret_cast(&shell::Detach), }, + { + .name = "nativeDestroy", + .signature = "(J)V", + .fnPtr = reinterpret_cast(&shell::Destroy), + }, { .name = "nativeGetObservatoryUri", .signature = "()Ljava/lang/String;", diff --git a/shell/platform/android/vsync_waiter_android.cc b/shell/platform/android/vsync_waiter_android.cc index 052de023b9a12..29e1958dcc011 100644 --- a/shell/platform/android/vsync_waiter_android.cc +++ b/shell/platform/android/vsync_waiter_android.cc @@ -7,7 +7,7 @@ #include #include -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" @@ -16,49 +16,68 @@ namespace shell { -static jlong CreatePendingCallback(VsyncWaiter::Callback callback); - -static void ConsumePendingCallback(jlong java_baton, - fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time); - static fml::jni::ScopedJavaGlobalRef* g_vsync_waiter_class = nullptr; static jmethodID g_async_wait_for_vsync_method_ = nullptr; -VsyncWaiterAndroid::VsyncWaiterAndroid(blink::TaskRunners task_runners) - : VsyncWaiter(std::move(task_runners)) {} +VsyncWaiterAndroid::VsyncWaiterAndroid() : weak_factory_(this) {} VsyncWaiterAndroid::~VsyncWaiterAndroid() = default; -// |shell::VsyncWaiter| -void VsyncWaiterAndroid::AwaitVSync() { - auto java_baton = - CreatePendingCallback(std::bind(&VsyncWaiterAndroid::FireCallback, // - this, // - std::placeholders::_1, // - std::placeholders::_2 // - )); +void VsyncWaiterAndroid::AsyncWaitForVsync(Callback callback) { + FXL_DCHECK(!callback_); + callback_ = std::move(callback); + fml::WeakPtr* weak = + new fml::WeakPtr(); + *weak = weak_factory_.GetWeakPtr(); - task_runners_.GetPlatformTaskRunner()->PostTask([java_baton]() { + blink::Threads::Platform()->PostTask([weak] { JNIEnv* env = fml::jni::AttachCurrentThread(); - env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), // - g_async_wait_for_vsync_method_, // - java_baton // - ); + env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), + g_async_wait_for_vsync_method_, + reinterpret_cast(weak)); }); } +void VsyncWaiterAndroid::OnVsync(int64_t frameTimeNanos, + int64_t frameTargetTimeNanos) { + Callback callback = std::move(callback_); + callback_ = Callback(); + blink::Threads::UI()->PostTask( + [callback, frameTimeNanos, frameTargetTimeNanos] { + callback(fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTimeNanos)), + fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos))); + }); +} + static void OnNativeVsync(JNIEnv* env, jclass jcaller, jlong frameTimeNanos, jlong frameTargetTimeNanos, - jlong java_baton) { - auto frame_time = fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTimeNanos)); - auto target_time = fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos)); - - ConsumePendingCallback(java_baton, frame_time, target_time); + jlong cookie) { + // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight + // Vsync" checkbox in the timeline can be enabled. + // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 + // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE + TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); +#else + { + constexpr size_t num_chars = sizeof(jlong) * CHAR_BIT * 3.4 + 2; + char deadline[num_chars]; + sprintf(deadline, "%lld", frameTargetTimeNanos / 1000); // microseconds + TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); + } +#endif + fml::WeakPtr* weak = + reinterpret_cast*>(cookie); + VsyncWaiterAndroid* waiter = weak->get(); + delete weak; + if (waiter) { + waiter->OnVsync(static_cast(frameTimeNanos), + static_cast(frameTargetTimeNanos)); + } } bool VsyncWaiterAndroid::Register(JNIEnv* env) { @@ -86,27 +105,4 @@ bool VsyncWaiterAndroid::Register(JNIEnv* env) { return env->RegisterNatives(clazz, methods, arraysize(methods)) == 0; } -struct PendingCallbackData { - VsyncWaiter::Callback callback; - - PendingCallbackData(VsyncWaiter::Callback p_callback) - : callback(std::move(p_callback)) { - FXL_DCHECK(callback); - } -}; - -static jlong CreatePendingCallback(VsyncWaiter::Callback callback) { - // This delete for this new is balanced in the consume call. - auto data = new PendingCallbackData(std::move(callback)); - return reinterpret_cast(data); -} - -static void ConsumePendingCallback(jlong java_baton, - fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time) { - auto data = reinterpret_cast(java_baton); - data->callback(frame_start_time, frame_target_time); - delete data; -} - } // namespace shell diff --git a/shell/platform/android/vsync_waiter_android.h b/shell/platform/android/vsync_waiter_android.h index fd72a0a21f563..c73af4bfca6f0 100644 --- a/shell/platform/android/vsync_waiter_android.h +++ b/shell/platform/android/vsync_waiter_android.h @@ -12,17 +12,22 @@ namespace shell { -class VsyncWaiterAndroid final : public VsyncWaiter { +class VsyncWaiterAndroid : public VsyncWaiter { public: + VsyncWaiterAndroid(); + + ~VsyncWaiterAndroid() override; + static bool Register(JNIEnv* env); - VsyncWaiterAndroid(blink::TaskRunners task_runners); + void AsyncWaitForVsync(Callback callback) override; - ~VsyncWaiterAndroid() override; + void OnVsync(int64_t frameTimeNanos, int64_t frameTargetTimeNanos); private: - // |shell::VsyncWaiter| - void AwaitVSync() override; + Callback callback_; + fml::WeakPtr self_; + fml::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterAndroid); }; diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index c6f7acd6be76a..c971c443bcc30 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -6,8 +6,11 @@ assert(is_mac || is_ios) group("darwin") { if (is_mac) { + deps = [ + "desktop:shell_standalone", + ] if (!is_fuchsia_host) { - deps = [ + deps += [ "desktop:shell_application_bundle", ] } @@ -42,12 +45,15 @@ source_set("flutter_channels") { "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", + "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", "//third_party/skia", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] } executable("flutter_channels_unittests") { @@ -62,7 +68,7 @@ executable("flutter_channels_unittests") { deps = [ ":flutter_channels", - "$flutter_root/testing", "//third_party/dart/runtime:libdart_jit", + "$flutter_root/testing", ] } diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index a1023737973a7..e6fa86366b080 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -9,23 +9,28 @@ source_set("common") { sources = [ "buffer_conversions.h", "buffer_conversions.mm", - "command_line.h", - "command_line.mm", + "platform_mac.h", + "platform_mac.mm", + "process_info_mac.cc", + "process_info_mac.h", ] set_sources_assignment_filter(sources_assignment_filter) deps = [ + "//third_party/dart/runtime:dart_api", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", + "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:dart_api", "//third_party/skia", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] } diff --git a/shell/platform/darwin/common/command_line.h b/shell/platform/darwin/common/command_line.h deleted file mode 100644 index dfc995b90f378..0000000000000 --- a/shell/platform/darwin/common/command_line.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 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_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ - -#include "lib/fxl/command_line.h" -#include "lib/fxl/macros.h" - -namespace shell { - -fxl::CommandLine CommandLineFromNSProcessInfo(); - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ diff --git a/shell/platform/darwin/common/command_line.mm b/shell/platform/darwin/common/command_line.mm deleted file mode 100644 index bf8d4cc9d40f4..0000000000000 --- a/shell/platform/darwin/common/command_line.mm +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 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/shell/platform/darwin/common/command_line.h" - -#import - -namespace shell { - -fxl::CommandLine CommandLineFromNSProcessInfo() { - std::vector args_vector; - - for (NSString* arg in [NSProcessInfo processInfo].arguments) { - args_vector.emplace_back(arg.UTF8String); - } - - return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); -} - -} // namespace shell diff --git a/shell/platform/darwin/common/platform_mac.h b/shell/platform/darwin/common/platform_mac.h new file mode 100644 index 0000000000000..1989b25f11c43 --- /dev/null +++ b/shell/platform/darwin/common/platform_mac.h @@ -0,0 +1,20 @@ +// Copyright 2015 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. + +#ifndef SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ +#define SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ + +#include "flutter/shell/common/engine.h" + +namespace shell { + +void PlatformMacMain(std::string icu_data_path, + std::string application_library_path, + std::string bundle_path); + +bool AttemptLaunchFromCommandLineSwitches(Engine* engine); + +} // namespace shell + +#endif // SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ diff --git a/shell/platform/darwin/common/platform_mac.mm b/shell/platform/darwin/common/platform_mac.mm new file mode 100644 index 0000000000000..5af35a430beef --- /dev/null +++ b/shell/platform/darwin/common/platform_mac.mm @@ -0,0 +1,160 @@ +// Copyright 2015 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. + +#include "flutter/shell/platform/darwin/common/platform_mac.h" + +#include + +#include "flutter/common/threads.h" +#include "flutter/fml/trace_event.h" +#include "flutter/runtime/start_up.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/tracing_controller.h" +#include "flutter/sky/engine/wtf/MakeUnique.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/strings/string_view.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace shell { + +static fxl::CommandLine InitializedCommandLine() { + std::vector args_vector; + + for (NSString* arg in [NSProcessInfo processInfo].arguments) { + args_vector.emplace_back(arg.UTF8String); + } + + return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); +} + +class EmbedderState { + public: + EmbedderState(std::string icu_data_path, + std::string application_library_path, + std::string bundle_path) { + blink::engine_main_enter_ts = Dart_TimelineGetMicros(); + FXL_DCHECK([NSThread isMainThread]) + << "Embedder initialization must occur on the main platform thread"; + + auto command_line = InitializedCommandLine(); + + // This is about as early as tracing of any kind can start. Add an instant + // marker that can be used as a reference for startup. + TRACE_EVENT_INSTANT0("flutter", "main"); + + shell::Shell::InitStandalone(std::move(command_line), icu_data_path, application_library_path, + bundle_path); + } + + ~EmbedderState() {} + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderState); +}; + +void PlatformMacMain(std::string icu_data_path, + std::string application_library_path, + std::string bundle_path) { + static std::unique_ptr g_embedder; + static std::once_flag once_main; + + std::call_once(once_main, [&]() { + g_embedder = + WTF::MakeUnique(icu_data_path, application_library_path, bundle_path); + }); +} + +static bool FlagsValidForCommandLineLaunch(const std::string& bundle_path, + const std::string& main, + const std::string& packages) { + if (main.empty() || packages.empty() || bundle_path.empty()) { + return false; + } + + // Ensure that the paths exists. This catches cases where the user has + // successfully launched the application from the tooling but has since moved + // the source files on disk and is launching again directly. + + NSFileManager* manager = [NSFileManager defaultManager]; + + if (![manager fileExistsAtPath:@(main.c_str())]) { + return false; + } + + if (![manager fileExistsAtPath:@(packages.c_str())]) { + return false; + } + + if (![manager fileExistsAtPath:@(bundle_path.c_str())]) { + return false; + } + + return true; +} + +static std::string ResolveCommandLineLaunchFlag(const fxl::StringView name) { + const auto& command_line = shell::Shell::Shared().GetCommandLine(); + + std::string command_line_option; + if (command_line.GetOptionValue(name, &command_line_option)) { + return command_line_option; + } + + const char* saved_default = + [[NSUserDefaults standardUserDefaults] stringForKey:@(name.data())].UTF8String; + + if (saved_default != NULL) { + return saved_default; + } + + return ""; +} + +bool AttemptLaunchFromCommandLineSwitches(Engine* engine) { + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; + + const auto& command_line = shell::Shell::Shared().GetCommandLine(); + + if (command_line.HasOption(FlagForSwitch(Switch::FlutterAssetsDir)) || + command_line.HasOption(FlagForSwitch(Switch::MainDartFile)) || + command_line.HasOption(FlagForSwitch(Switch::Packages))) { + // The main dart file, Flutter assets directory and the package root must be + // specified in one go. We dont want to end up in a situation where we take + // one value from the command line and the others from user defaults. In + // case, any new flags are specified, forget about all the old ones. + [defaults removeObjectForKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; + [defaults removeObjectForKey:@(FlagForSwitch(Switch::MainDartFile).data())]; + [defaults removeObjectForKey:@(FlagForSwitch(Switch::Packages).data())]; + + [defaults synchronize]; + } + + std::string bundle_path = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::FlutterAssetsDir)); + std::string main = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::MainDartFile)); + std::string packages = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::Packages)); + + if (!FlagsValidForCommandLineLaunch(bundle_path, main, packages)) { + return false; + } + + // Save the newly resolved dart main file and the package root to user + // defaults so that the next time the user launches the application in the + // simulator without the tooling, the application boots up. + [defaults setObject:@(bundle_path.c_str()) + forKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; + [defaults setObject:@(main.c_str()) forKey:@(FlagForSwitch(Switch::MainDartFile).data())]; + [defaults setObject:@(packages.c_str()) forKey:@(FlagForSwitch(Switch::Packages).data())]; + + [defaults synchronize]; + + blink::Threads::UI()->PostTask([ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { + if (engine) + engine->RunBundleAndSource(bundle_path, main, packages); + }); + + return true; +} + +} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.cc b/shell/platform/darwin/common/process_info_mac.cc new file mode 100644 index 0000000000000..11f70f305a3e9 --- /dev/null +++ b/shell/platform/darwin/common/process_info_mac.cc @@ -0,0 +1,36 @@ +// Copyright 2016 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. + +#include "flutter/shell/platform/darwin/common/process_info_mac.h" + +namespace shell { + +ProcessInfoMac::ProcessInfoMac() = default; + +ProcessInfoMac::~ProcessInfoMac() = default; + +bool ProcessInfoMac::SampleNow() { + mach_msg_type_number_t size = MACH_TASK_BASIC_INFO_COUNT; + kern_return_t result = + task_info(mach_task_self(), // + MACH_TASK_BASIC_INFO, // + reinterpret_cast(&last_sample_), // + &size); + if (result == KERN_SUCCESS) { + return true; + } + + last_sample_ = {}; + return false; +} + +size_t ProcessInfoMac::GetVirtualMemorySize() { + return last_sample_.virtual_size; +} + +size_t ProcessInfoMac::GetResidentMemorySize() { + return last_sample_.resident_size; +} + +} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.h b/shell/platform/darwin/common/process_info_mac.h new file mode 100644 index 0000000000000..7edc8034173e0 --- /dev/null +++ b/shell/platform/darwin/common/process_info_mac.h @@ -0,0 +1,36 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ + +#include +#include +#include +#include "flutter/flow/process_info.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class ProcessInfoMac : public flow::ProcessInfo { + public: + ProcessInfoMac(); + + ~ProcessInfoMac(); + + bool SampleNow() override; + + size_t GetVirtualMemorySize() override; + + size_t GetResidentMemorySize() override; + + private: + struct mach_task_basic_info last_sample_; + + FXL_DISALLOW_COPY_AND_ASSIGN(ProcessInfoMac); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ diff --git a/shell/platform/darwin/desktop/BUILD.gn b/shell/platform/darwin/desktop/BUILD.gn index 5ec3298be4aa4..a9c05f85ef284 100644 --- a/shell/platform/darwin/desktop/BUILD.gn +++ b/shell/platform/darwin/desktop/BUILD.gn @@ -8,8 +8,10 @@ source_set("mac_desktop_platform") { visibility = [ ":*" ] sources = [ - "flutter_application_delegate.h", - "flutter_application_delegate.mm", + "flutter_app_delegate.h", + "flutter_app_delegate.m", + "flutter_application.h", + "flutter_application.mm", "flutter_window.h", "flutter_window.mm", "main_mac.mm", @@ -20,22 +22,32 @@ source_set("mac_desktop_platform") { ] deps = [ + "//third_party/dart/runtime:libdart_jit", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", + "$flutter_root/shell/testing", "$flutter_root/synchronization", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:libdart_jit", "//third_party/skia", - "//third_party/skia:gpu", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] +} + +executable("shell_standalone") { + output_name = "flutter_tester" + deps = [ + ":mac_desktop_platform", + ] } if (!is_fuchsia_host) { + import("//build/config/mac/rules.gni") resource_copy_mac("mac_desktop_resources") { diff --git a/shell/platform/darwin/desktop/Info.plist b/shell/platform/darwin/desktop/Info.plist index 048afb6dadca2..31d3f1240db6b 100644 --- a/shell/platform/darwin/desktop/Info.plist +++ b/shell/platform/darwin/desktop/Info.plist @@ -9,11 +9,11 @@ CFBundleIconFile CFBundleIdentifier - io.flutter.engine + io.flutter CFBundleInfoDictionaryVersion 6.0 CFBundleName - Flutter Engine + Flutter CFBundlePackageType APPL CFBundleShortVersionString @@ -26,7 +26,9 @@ 10.6 NSHumanReadableCopyright Copyright 2015 The Flutter Authors. All rights reserved. + NSMainNibFile + flutter_mac NSPrincipalClass - NSApplication + FlutterApplication diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.h b/shell/platform/darwin/desktop/flutter_app_delegate.h new file mode 100644 index 0000000000000..d6addcb17d0a4 --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_app_delegate.h @@ -0,0 +1,14 @@ +// Copyright 2015 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. + +#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ +#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ + +#import + +@interface FlutterAppDelegate : NSObject + +@end + +#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__) */ diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.m b/shell/platform/darwin/desktop/flutter_app_delegate.m new file mode 100644 index 0000000000000..7e2dfd68389f8 --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_app_delegate.m @@ -0,0 +1,15 @@ +// Copyright 2015 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 "flutter_app_delegate.h" + +@interface FlutterAppDelegate () + +@property(assign) IBOutlet NSWindow* window; + +@end + +@implementation FlutterAppDelegate + +@end diff --git a/shell/platform/darwin/desktop/flutter_application_delegate.h b/shell/platform/darwin/desktop/flutter_application.h similarity index 65% rename from shell/platform/darwin/desktop/flutter_application_delegate.h rename to shell/platform/darwin/desktop/flutter_application.h index 3995557b25e79..6a4167b5f273a 100644 --- a/shell/platform/darwin/desktop/flutter_application_delegate.h +++ b/shell/platform/darwin/desktop/flutter_application.h @@ -1,14 +1,13 @@ -// Copyright 2017 The Flutter Authors. All rights reserved. +// Copyright 2015 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. -#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ +#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ #import -@interface FlutterApplicationDelegate : NSObject - +@interface FlutterApplication : NSApplication @end -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ diff --git a/shell/platform/darwin/desktop/flutter_application.mm b/shell/platform/darwin/desktop/flutter_application.mm new file mode 100644 index 0000000000000..57b1c83ba069a --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_application.mm @@ -0,0 +1,8 @@ +// Copyright 2015 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. + +#include "flutter/shell/platform/darwin/desktop/flutter_application.h" + +@implementation FlutterApplication +@end diff --git a/shell/platform/darwin/desktop/flutter_application_delegate.mm b/shell/platform/darwin/desktop/flutter_application_delegate.mm deleted file mode 100644 index 03076b848b25f..0000000000000 --- a/shell/platform/darwin/desktop/flutter_application_delegate.mm +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2017 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/shell/platform/darwin/desktop/flutter_application_delegate.h" -#include "flutter/shell/platform/darwin/desktop/flutter_window.h" - -#include - -@implementation FlutterApplicationDelegate - -- (void)applicationWillFinishLaunching:(NSNotification*)notification { - [self configureMainMenuBar]; - [self onNewFlutterWindow:self]; -} - -- (void)configureMainMenuBar { - NSMenu* mainMenu = [[[NSMenu alloc] initWithTitle:@"MainMenu"] autorelease]; - - NSMenuItem* engineItem = - [[[NSMenuItem alloc] initWithTitle:@"Engine" action:NULL keyEquivalent:@""] autorelease]; - - NSMenu* engineMenu = [[[NSMenu alloc] initWithTitle:@"EngineMenu"] autorelease]; - - NSMenuItem* newEngineItem = [[[NSMenuItem alloc] initWithTitle:@"New Engine" - action:@selector(onNewFlutterWindow:) - keyEquivalent:@""] autorelease]; - newEngineItem.keyEquivalent = @"n"; - newEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; - - NSMenuItem* shutdownEngineItem = - [[[NSMenuItem alloc] initWithTitle:@"Shutdown Engine" - action:@selector(onShutdownFlutterWindow:) - keyEquivalent:@""] autorelease]; - shutdownEngineItem.keyEquivalent = @"w"; - shutdownEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; - - NSMenuItem* quitItem = [[[NSMenuItem alloc] initWithTitle:@"Quit" - action:@selector(onQuitFlutterApplication:) - keyEquivalent:@""] autorelease]; - quitItem.keyEquivalent = @"q"; - quitItem.keyEquivalentModifierMask = NSCommandKeyMask; - - [mainMenu addItem:engineItem]; - [engineItem setSubmenu:engineMenu]; - [engineMenu addItem:newEngineItem]; - [engineMenu addItem:shutdownEngineItem]; - [engineMenu addItem:quitItem]; - - [NSApplication sharedApplication].mainMenu = mainMenu; -} - -- (void)onNewFlutterWindow:(id)sender { - FlutterWindow* window = [[FlutterWindow alloc] init]; - [window setReleasedWhenClosed:YES]; - - NSWindow* currentKeyWindow = [NSApplication sharedApplication].keyWindow; - - if (currentKeyWindow == nil) { - [window center]; - } else { - [window center]; - NSPoint currentWindowFrameOrigin = window.frame.origin; - currentWindowFrameOrigin.x = currentKeyWindow.frame.origin.x + 20; - currentWindowFrameOrigin.y = currentKeyWindow.frame.origin.y - 20; - [window setFrameOrigin:currentWindowFrameOrigin]; - } - - [window makeKeyAndOrderFront:sender]; -} - -- (void)onShutdownFlutterWindow:(id)sender { - [[NSApplication sharedApplication].keyWindow close]; -} - -- (void)onQuitFlutterApplication:(id)sender { - exit(0); -} - -@end diff --git a/shell/platform/darwin/desktop/flutter_mac.xib b/shell/platform/darwin/desktop/flutter_mac.xib new file mode 100644 index 0000000000000..c02ab7912da5a --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_mac.xib @@ -0,0 +1,695 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/shell/platform/darwin/desktop/flutter_window.h b/shell/platform/darwin/desktop/flutter_window.h index e07fe4eeb7520..851535ba38e9e 100644 --- a/shell/platform/darwin/desktop/flutter_window.h +++ b/shell/platform/darwin/desktop/flutter_window.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ -#define SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ +#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ +#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ #import @@ -11,4 +11,4 @@ @end -#endif // SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ +#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__) */ diff --git a/shell/platform/darwin/desktop/flutter_window.mm b/shell/platform/darwin/desktop/flutter_window.mm index 4c87200fb3856..ca080e9275742 100644 --- a/shell/platform/darwin/desktop/flutter_window.mm +++ b/shell/platform/darwin/desktop/flutter_window.mm @@ -2,25 +2,16 @@ // 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 - #import "flutter_window.h" -#include - -#include "flutter/common/task_runners.h" -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/common/thread_host.h" +#include "flutter/common/threads.h" #include "flutter/shell/gpu/gpu_surface_gl.h" -#include "flutter/shell/platform/darwin/common/command_line.h" #include "flutter/shell/platform/darwin/desktop/platform_view_mac.h" -#include "lib/fxl/functional/make_copyable.h" -@interface FlutterWindow () +@interface FlutterWindow () -@property(strong) NSOpenGLView* renderSurface; +@property(assign) IBOutlet NSOpenGLView* renderSurface; +@property(getter=isSurfaceSetup) BOOL surfaceSetup; @end @@ -46,130 +37,34 @@ @interface FlutterWindow () } @implementation FlutterWindow { - shell::ThreadHost _thread_host; - std::unique_ptr _shell; + std::shared_ptr _platformView; bool _mouseIsDown; } -- (instancetype)init { - self = - [super initWithContentRect:NSMakeRect(10.0, 10.0, 800.0, 600.0) - styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask - backing:NSBackingStoreBuffered - defer:YES]; - if (self) { - self.delegate = self; - [self setupRenderSurface]; - [self setupShell]; - [self updateWindowSize]; - } - - return self; -} - -- (void)setupRenderSurface { - NSOpenGLView* renderSurface = [[[NSOpenGLView alloc] init] autorelease]; - const NSOpenGLPixelFormatAttribute attrs[] = { - NSOpenGLPFADoubleBuffer, // - NSOpenGLPFAAllowOfflineRenderers, // - 0 // - }; - renderSurface.pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease]; - renderSurface.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; - renderSurface.frame = - NSMakeRect(0.0, 0.0, self.contentView.bounds.size.width, self.contentView.bounds.size.height); - [self.contentView addSubview:renderSurface]; - self.renderSurface = renderSurface; -} - -static std::string CreateThreadLabel() { - std::stringstream stream; - static int index = 1; - stream << "io.flutter." << index++; - return stream.str(); -} - -- (void)setupShell { - FXL_DCHECK(!_shell) << "The shell must not already be set."; +@synthesize renderSurface = _renderSurface; +@synthesize surfaceSetup = _surfaceSetup; - auto thread_label = CreateThreadLabel(); +- (void)awakeFromNib { + [super awakeFromNib]; - // Create the threads on which to run the shell. - _thread_host = {thread_label, shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::UI | - shell::ThreadHost::Type::IO}; + self.delegate = self; - // Grab the task runners for the newly created threads. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - blink::TaskRunners task_runners(thread_label, // label - fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform - _thread_host.gpu_thread->GetTaskRunner(), // GPU - _thread_host.ui_thread->GetTaskRunner(), // UI - _thread_host.io_thread->GetTaskRunner() // IO - ); - - // Figure out the settings from the command line arguments. - auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); - - if (settings.icu_data_path.size() == 0) { - settings.icu_data_path = - [[NSBundle mainBundle] pathForResource:@"icudtl.dat" ofType:@""].UTF8String; - } - - settings.using_blink = false; - - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - - // Setup the callback that will be run on the appropriate threads. - shell::Shell::CreateCallback on_create_platform_view = - [render_surface = self.renderSurface](shell::Shell& shell) { - return std::make_unique(shell, render_surface); - }; - - shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - // Finally, create the shell. - _shell = shell::Shell::Create(std::move(task_runners), settings, on_create_platform_view, - on_create_rasterizer); - - // Launch the engine with the inferred run configuration. - _shell->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [engine = _shell->GetEngine(), - config = shell::RunConfiguration::InferFromSettings(_shell->GetSettings())]() mutable { - if (engine) { - auto result = engine->Run(std::move(config)); - if (!result) { - FXL_LOG(ERROR) << "Could not launch the engine with configuration."; - } - } - })); - - [self notifySurfaceCreated]; + [self updateWindowSize]; } -- (void)notifySurfaceCreated { - if (!_shell || !_shell->IsSetup()) { - return; - } +- (void)setupPlatformView { + FXL_DCHECK(_platformView == nullptr) << "The platform view must not already be set."; - // Tell the platform view that it has a GL surface. - _shell->GetPlatformView()->NotifyCreated(); + _platformView = std::make_shared(self.renderSurface); + _platformView->Attach(); + _platformView->SetupResourceContextOnIOThread(); + _platformView->NotifyCreated(std::make_unique(_platformView.get())); } -- (void)notifySurfaceDestroyed { - if (!_shell || !_shell->IsSetup()) { - return; - } - - // Tell the platform view that its surface is about to be lost. - _shell->GetPlatformView()->NotifyDestroyed(); +// TODO(eseidel): This does not belong in flutter_window! +// Probably belongs in NSApplicationDelegate didFinishLaunching. +- (void)setupAndLoadDart { + _platformView->SetupAndLoadDart(); } - (void)windowDidResize:(NSNotification*)notification { @@ -177,28 +72,34 @@ - (void)windowDidResize:(NSNotification*)notification { } - (void)updateWindowSize { - if (!_shell) { - return; - } + [self setupSurfaceIfNecessary]; blink::ViewportMetrics metrics; auto size = self.renderSurface.frame.size; metrics.physical_width = size.width; metrics.physical_height = size.height; - _shell->GetTaskRunners().GetUITaskRunner()->PostTask([engine = _shell->GetEngine(), metrics]() { - if (engine) { + + blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), metrics ] { + if (engine.get()) { engine->SetViewportMetrics(metrics); } }); } -#pragma mark - Responder overrides - -- (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { - if (!_shell) { +- (void)setupSurfaceIfNecessary { + if (self.isSurfaceSetup) { return; } + self.surfaceSetup = YES; + + [self setupPlatformView]; + [self setupAndLoadDart]; +} + +#pragma mark - Responder overrides + +- (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { NSPoint location = [_renderSurface convertPoint:event.locationInWindow fromView:nil]; location.y = _renderSurface.frame.size.height - location.y; @@ -233,14 +134,13 @@ - (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { break; } - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = _shell->GetEngine(), pointer_data] { - if (engine) { - blink::PointerDataPacket packet(1); - packet.SetPointerData(0, pointer_data); - engine->DispatchPointerDataPacket(packet); - } - }); + blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), pointer_data ] { + if (engine.get()) { + blink::PointerDataPacket packet(1); + packet.SetPointerData(0, pointer_data); + engine->DispatchPointerDataPacket(packet); + } + }); } - (void)mouseDown:(NSEvent*)event { @@ -255,18 +155,11 @@ - (void)mouseUp:(NSEvent*)event { [self dispatchEvent:event phase:NSEventPhaseEnded]; } -- (void)reset { - [self notifySurfaceDestroyed]; - _shell.reset(); - _thread_host.Reset(); -} - -- (void)windowWillClose:(NSNotification*)notification { - [self reset]; -} - - (void)dealloc { - [self reset]; + if (_platformView) { + _platformView->NotifyDestroyed(); + } + [super dealloc]; } diff --git a/shell/platform/darwin/desktop/main_mac.mm b/shell/platform/darwin/desktop/main_mac.mm index edd08d0c8b783..808a5f63f1d14 100644 --- a/shell/platform/darwin/desktop/main_mac.mm +++ b/shell/platform/darwin/desktop/main_mac.mm @@ -7,20 +7,91 @@ #include #include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/desktop/flutter_application_delegate.h" +#include "flutter/shell/platform/darwin/common/platform_mac.h" +#include "flutter/shell/platform/darwin/desktop/flutter_application.h" +#include "flutter/shell/testing/test_runner.h" +#include "flutter/shell/testing/testing.h" #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" +#include "lib/tonic/dart_microtask_queue.h" -int main(int argc, const char* argv[]) { +// Exit codes used by the Dart command line tool. +const int kApiErrorExitCode = 253; +const int kCompilationErrorExitCode = 254; +const int kErrorExitCode = 255; + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver : public fml::TaskObserver { + public: + ScriptCompletionTaskObserver(fxl::RefPtr task_runner) + : main_task_runner_(std::move(task_runner)), + prev_live_(false), + last_error_(tonic::kNoError) {} + + void DidProcessTask() override { + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + shell::Engine& engine = test_runner.platform_view().engine(); + + if (engine.GetLoadScriptError() != tonic::kNoError) { + last_error_ = engine.GetLoadScriptError(); + main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); + return; + } + + bool live = engine.UIIsolateHasLivePorts(); + if (prev_live_ && !live) { + last_error_ = engine.GetUIIsolateLastError(); + main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + prev_live_ = live; + } + + tonic::DartErrorHandleType last_error() { return last_error_; } + + private: + fxl::RefPtr main_task_runner_; + bool prev_live_; + tonic::DartErrorHandleType last_error_; +}; + +int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { + switch (error) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } +} + +static fxl::CommandLine InitializedCommandLine() { std::vector args_vector; for (NSString* arg in [NSProcessInfo processInfo].arguments) { args_vector.emplace_back(arg.UTF8String); } - auto command_line = fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); + return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); +} + +int main(int argc, const char* argv[]) { + [FlutterApplication sharedApplication]; + + // Can't use shell::Shell::Shared().GetCommandLine() because it is initialized only + // in shell::PlatformMacMain call below. + auto command_line = InitializedCommandLine(); + + std::string bundle_path = ""; + command_line.GetOptionValue(FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); + + shell::PlatformMacMain("", "", bundle_path); // Print help. if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { @@ -28,7 +99,36 @@ int main(int argc, const char* argv[]) { return EXIT_SUCCESS; } - [NSApplication sharedApplication].delegate = - [[[FlutterApplicationDelegate alloc] init] autorelease]; - return NSApplicationMain(argc, argv); + // Decide between interactive and non-interactive modes. + if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::NonInteractive))) { + if (!shell::InitForTesting(std::move(command_line))) + return 1; + + // Note that this task observer must be added after the observer that drains + // the microtask queue. + ScriptCompletionTaskObserver task_observer(fml::MessageLoop::GetCurrent().GetTaskRunner()); + blink::Threads::UI()->PostTask( + [&task_observer] { fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); }); + + fml::MessageLoop::GetCurrent().Run(); + + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + tonic::DartErrorHandleType error = test_runner.platform_view().engine().GetLoadScriptError(); + if (error == tonic::kNoError) + error = task_observer.last_error(); + if (error == tonic::kNoError) { + fxl::AutoResetWaitableEvent latch; + blink::Threads::UI()->PostTask([&error, &latch] { + error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); + latch.Signal(); + }); + latch.Wait(); + } + + // The script has completed and the engine may not be in a clean state, + // so just stop the process. + exit(ConvertErrorTypeToExitCode(error)); + } else { + return NSApplicationMain(argc, argv); + } } diff --git a/shell/platform/darwin/desktop/platform_view_mac.h b/shell/platform/darwin/desktop/platform_view_mac.h index d4b19b94d1d99..501400b6803d4 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.h +++ b/shell/platform/darwin/desktop/platform_view_mac.h @@ -7,7 +7,6 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "lib/fxl/memory/weak_ptr.h" @@ -16,13 +15,15 @@ namespace shell { -class PlatformViewMac final : public PlatformView, public GPUSurfaceGLDelegate { +class PlatformViewMac : public PlatformView, public GPUSurfaceGLDelegate { public: - PlatformViewMac(Shell& shell, NSOpenGLView* gl_view); + PlatformViewMac(NSOpenGLView* gl_view); ~PlatformViewMac() override; - std::unique_ptr CreateVSyncWaiter() override; + virtual void Attach() override; + + void SetupAndLoadDart(); bool GLContextMakeCurrent() override; @@ -32,17 +33,27 @@ class PlatformViewMac final : public PlatformView, public GPUSurfaceGLDelegate { intptr_t GLContextFBO() const override; + VsyncWaiter* GetVsyncWaiter() override; + + bool ResourceContextMakeCurrent() override; + + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + + void SetAssetBundlePath(const std::string& assets_directory) override; + private: fml::scoped_nsobject opengl_view_; fml::scoped_nsobject resource_loading_context_; bool IsValid() const; - // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; + void SetupAndLoadFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages); - // |shell::PlatformView| - sk_sp CreateResourceContext() const override; + void SetAssetBundlePathOnUI(const std::string& assets_directory); FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewMac); }; diff --git a/shell/platform/darwin/desktop/platform_view_mac.mm b/shell/platform/darwin/desktop/platform_view_mac.mm index f25fa6945af23..42948386fbcd4 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.mm +++ b/shell/platform/darwin/desktop/platform_view_mac.mm @@ -7,26 +7,77 @@ #include #include +#include "flutter/common/threads.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/common/io_manager.h" -#include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/switches.h" +#include "flutter/shell/gpu/gpu_rasterizer.h" +#include "flutter/shell/platform/darwin/common/platform_mac.h" +#include "flutter/shell/platform/darwin/common/process_info_mac.h" #include "flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h" #include "lib/fxl/command_line.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewMac::PlatformViewMac(Shell& shell, NSOpenGLView* gl_view) - : PlatformView(shell, shell.GetTaskRunners()), +PlatformViewMac::PlatformViewMac(NSOpenGLView* gl_view) + : PlatformView(std::make_unique(std::make_unique())), opengl_view_([gl_view retain]), resource_loading_context_([[NSOpenGLContext alloc] initWithFormat:gl_view.pixelFormat shareContext:gl_view.openGLContext]) {} PlatformViewMac::~PlatformViewMac() = default; -std::unique_ptr PlatformViewMac::CreateVSyncWaiter() { - return std::make_unique(task_runners_); +void PlatformViewMac::Attach() { + CreateEngine(); +} + +void PlatformViewMac::SetupAndLoadDart() { + if (AttemptLaunchFromCommandLineSwitches(&engine())) { + // This attempts launching from a Flutter assets directory that does not + // contain a dart snapshot. + return; + } + + const auto& command_line = shell::Shell::Shared().GetCommandLine(); + + std::string bundle_path = + command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::FlutterAssetsDir), ""); + if (!bundle_path.empty()) { + blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), bundle_path ] { + if (engine) + engine->RunBundle(bundle_path); + }); + return; + } + + auto args = command_line.positional_args(); + if (args.size() > 0) { + std::string main = args[0]; + std::string packages = + command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::Packages), ""); + blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), main, packages ] { + if (engine) + engine->RunBundleAndSource(std::string(), main, packages); + }); + return; + } +} + +void PlatformViewMac::SetupAndLoadFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + blink::Threads::UI()->PostTask( + [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { + if (engine) + engine->RunBundleAndSource(assets_directory, main, packages); + }); +} + +void PlatformViewMac::SetAssetBundlePathOnUI(const std::string& assets_directory) { + blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { + if (engine) + engine->SetAssetBundlePath(assets_directory); + }); } intptr_t PlatformViewMac::GLContextFBO() const { @@ -64,9 +115,21 @@ return true; } -sk_sp PlatformViewMac::CreateResourceContext() const { - [resource_loading_context_.get() makeCurrentContext]; - return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); +VsyncWaiter* PlatformViewMac::GetVsyncWaiter() { + if (!vsync_waiter_) + vsync_waiter_ = std::make_unique(); + return vsync_waiter_.get(); +} + +bool PlatformViewMac::ResourceContextMakeCurrent() { + NSOpenGLContext* context = resource_loading_context_.get(); + + if (context == nullptr) { + return false; + } + + [context makeCurrentContext]; + return true; } bool PlatformViewMac::IsValid() const { @@ -83,8 +146,30 @@ return true; } -std::unique_ptr PlatformViewMac::CreateRenderingSurface() { - return std::make_unique(this); +void PlatformViewMac::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + auto latch = new fxl::ManualResetWaitableEvent(); + + dispatch_async(dispatch_get_main_queue(), ^{ + SetupAndLoadFromSource(assets_directory, main, packages); + latch->Signal(); + }); + + latch->Wait(); + delete latch; +} + +void PlatformViewMac::SetAssetBundlePath(const std::string& assets_directory) { + auto latch = new fxl::ManualResetWaitableEvent(); + + dispatch_async(dispatch_get_main_queue(), ^{ + SetAssetBundlePathOnUI(assets_directory); + latch->Signal(); + }); + + latch->Wait(); + delete latch; } } // namespace shell diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.cc b/shell/platform/darwin/desktop/vsync_waiter_mac.cc index 0ccadaf42754d..a28ff62edb918 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.cc +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.cc @@ -6,14 +6,14 @@ #include +#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { #define link_ (reinterpret_cast(opaque_)) -VsyncWaiterMac::VsyncWaiterMac(blink::TaskRunners task_runners) - : VsyncWaiter(std::move(task_runners)), opaque_(nullptr) { +VsyncWaiterMac::VsyncWaiterMac() : opaque_(nullptr) { // Create the link. CVDisplayLinkRef link = nullptr; CVDisplayLinkCreateWithActiveCGDisplays(&link); @@ -48,10 +48,18 @@ void VsyncWaiterMac::OnDisplayLink() { CVDisplayLinkStop(link_); - FireCallback(frame_start_time, frame_target_time); + auto callback = std::move(callback_); + callback_ = Callback(); + + blink::Threads::UI()->PostTask( + [callback, frame_start_time, frame_target_time] { + callback(frame_start_time, frame_target_time); + }); } -void VsyncWaiterMac::AwaitVSync() { +void VsyncWaiterMac::AsyncWaitForVsync(Callback callback) { + FXL_DCHECK(!callback_); + callback_ = std::move(callback); CVDisplayLinkStart(link_); } diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.h b/shell/platform/darwin/desktop/vsync_waiter_mac.h index 0ad929a509ea3..15f551f212901 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.h +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.h @@ -10,19 +10,19 @@ namespace shell { -class VsyncWaiterMac final : public VsyncWaiter { +class VsyncWaiterMac : public VsyncWaiter { public: - VsyncWaiterMac(blink::TaskRunners task_runners); + VsyncWaiterMac(); ~VsyncWaiterMac() override; + void AsyncWaitForVsync(Callback callback) override; + private: void* opaque_; - - void AwaitVSync() override; + Callback callback_; static void OnDisplayLink(void* context); - void OnDisplayLink(); FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterMac); diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 8946ee954c23a..310af79c2ed8e 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -40,6 +40,8 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterDartProject.mm", "framework/Source/FlutterDartProject_Internal.h", "framework/Source/FlutterHeadlessDartRunner.mm", + "framework/Source/FlutterDartSource.h", + "framework/Source/FlutterDartSource.mm", "framework/Source/FlutterNavigationController.mm", "framework/Source/FlutterPlatformPlugin.h", "framework/Source/FlutterPlatformPlugin.mm", @@ -51,15 +53,14 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterView.h", "framework/Source/FlutterView.mm", "framework/Source/FlutterViewController.mm", - "framework/Source/FlutterViewController_Internal.h", "framework/Source/accessibility_bridge.h", "framework/Source/accessibility_bridge.mm", "framework/Source/accessibility_text_entry.h", "framework/Source/accessibility_text_entry.mm", + "framework/Source/flutter_main_ios.h", + "framework/Source/flutter_main_ios.mm", "framework/Source/flutter_touch_mapper.h", "framework/Source/flutter_touch_mapper.mm", - "framework/Source/platform_message_response_darwin.h", - "framework/Source/platform_message_response_darwin.mm", "framework/Source/platform_message_router.h", "framework/Source/platform_message_router.mm", "framework/Source/vsync_waiter_ios.h", @@ -85,7 +86,6 @@ shared_library("create_flutter_framework_dylib") { "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/ui", - "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", @@ -95,10 +95,7 @@ shared_library("create_flutter_framework_dylib") { "//third_party/skia", ] if (flutter_runtime_mode == "debug") { - deps += [ - "$flutter_root/lib/snapshot", - "//third_party/dart/runtime:libdart_jit", - ] + deps += [ "//third_party/dart/runtime:libdart_jit" ] } else { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index 3c613c9fbad8f..d5f30d02664d9 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -2,121 +2,42 @@ // 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/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" -#include "flutter/common/task_runners.h" -#include "flutter/fml/message_loop.h" -#include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/runtime/dart_vm.h" +#include "flutter/common/threads.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/common/command_line.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" - -static const char* kScriptSnapshotFileName = "snapshot_blob.bin"; -static const char* kVMKernelSnapshotFileName = "platform.dill"; -static const char* kApplicationKernelSnapshotFileName = "kernel_blob.bin"; - -static blink::Settings DefaultSettingsForProcess() { - auto command_line = shell::CommandLineFromNSProcessInfo(); - - // Settings passed in explicitly via command line arguments take priority. - auto settings = shell::SettingsFromCommandLine(command_line); - - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - - // The command line arguments may not always be complete. If they aren't, attempt to fill in - // defaults. - - // Flutter ships the ICU data file in the the bundle of the engine. Look for it there. - if (settings.icu_data_path.size() == 0) { - NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; - NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; - if (icuDataPath.length > 0) { - settings.icu_data_path = icuDataPath.UTF8String; - } +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" +#include "lib/fxl/strings/string_view.h" +#include "third_party/dart/runtime/include/dart_api.h" + +static NSURL* URLForSwitch(const fxl::StringView name) { + const auto& cmd = shell::Shell::Shared().GetCommandLine(); + NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; + + std::string switch_value; + if (cmd.GetOptionValue(name, &switch_value)) { + auto url = [NSURL fileURLWithPath:@(switch_value.c_str())]; + [defaults setURL:url forKey:@(name.data())]; + [defaults synchronize]; + return url; } - if (blink::DartVM::IsRunningPrecompiledCode()) { - // The application bundle could be specified in the Info.plist. - if (settings.application_library_path.size() == 0) { - NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; - NSString* libraryPath = [[NSBundle mainBundle] pathForResource:libraryName ofType:nil]; - if (libraryPath.length > 0) { - settings.application_library_path = - [NSBundle bundleWithPath:libraryPath].executablePath.UTF8String; - } - } - - // In case the application bundle is still not specified, look for the App.framework in the - // Frameworks directory. - if (settings.application_library_path.size() == 0) { - NSString* applicationFrameworkPath = - [[NSBundle mainBundle] pathForResource:@"Frameworks/App.framework" ofType:@""]; - if (applicationFrameworkPath.length > 0) { - settings.application_library_path = - [NSBundle bundleWithPath:applicationFrameworkPath].executablePath.UTF8String; - } - } - } + return [defaults URLForKey:@(name.data())]; +} - // Checks to see if the flutter assets directory is already present. - if (settings.assets_path.size() == 0) { - NSString* assetsPath = [[NSBundle mainBundle] pathForResource:@"flutter_assets" ofType:@""]; - - if (assetsPath.length > 0) { - settings.assets_path = assetsPath.UTF8String; - - if (!blink::DartVM::IsRunningPrecompiledCode()) { - // Looking for the various script and kernel snapshot buffers only makes sense if we have a - // VM that can use these buffers. - { - // Check if there is a script snapshot in the assets directory we could potentially use. - NSURL* scriptSnapshotURL = [NSURL URLWithString:@(kScriptSnapshotFileName) - relativeToURL:[NSURL fileURLWithPath:assetsPath]]; - if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotURL.path]) { - settings.script_snapshot_path = scriptSnapshotURL.path.UTF8String; - } - } - - { - // Check if there is a VM kernel snapshot in the assets directory we could potentially - // use. - NSURL* vmKernelSnapshotURL = [NSURL URLWithString:@(kVMKernelSnapshotFileName) - relativeToURL:[NSURL fileURLWithPath:assetsPath]]; - if ([[NSFileManager defaultManager] fileExistsAtPath:vmKernelSnapshotURL.path]) { - settings.kernel_snapshot_path = vmKernelSnapshotURL.path.UTF8String; - } - } - - { - // Check if there is an application kernel snapshot in the assets directory we could - // potentially use. - NSURL* applicationKernelSnapshotURL = - [NSURL URLWithString:@(kApplicationKernelSnapshotFileName) - relativeToURL:[NSURL fileURLWithPath:assetsPath]]; - if ([[NSFileManager defaultManager] fileExistsAtPath:applicationKernelSnapshotURL.path]) { - settings.application_kernel_asset = applicationKernelSnapshotURL.path.UTF8String; - } - } - } - } - } +@implementation FlutterDartProject { + NSBundle* _precompiledDartBundle; + FlutterDartSource* _dartSource; - return settings; + VMType _vmTypeRequirement; } -@implementation FlutterDartProject { - fml::scoped_nsobject _precompiledDartBundle; - blink::Settings _settings; ++ (void)initialize { + if (self == [FlutterDartProject class]) { + shell::FlutterMain(); + } } #pragma mark - Override base class designated initializers @@ -131,16 +52,9 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle { self = [super init]; if (self) { - _precompiledDartBundle.reset([bundle retain]); + _precompiledDartBundle = [bundle retain]; - _settings = DefaultSettingsForProcess(); - - if (bundle != nil) { - NSString* executablePath = _precompiledDartBundle.get().executablePath; - if ([[NSFileManager defaultManager] fileExistsAtPath:executablePath]) { - _settings.application_library_path = executablePath.UTF8String; - } - } + [self checkReadiness]; } return self; @@ -152,15 +66,11 @@ - (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _settings = DefaultSettingsForProcess(); + _dartSource = [[FlutterDartSource alloc] initWithDartMain:dartMainURL + packages:dartPackages + flutterAssets:flutterAssetsURL]; - if ([[NSFileManager defaultManager] fileExistsAtPath:dartMainURL.path]) { - _settings.main_dart_file_path = dartMainURL.path.UTF8String; - } - - if ([[NSFileManager defaultManager] fileExistsAtPath:dartPackages.path]) { - _settings.packages_file_path = dartPackages.path.UTF8String; - } + [self checkReadiness]; } return self; @@ -170,17 +80,10 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _settings = DefaultSettingsForProcess(); + _dartSource = + [[FlutterDartSource alloc] initWithFlutterAssetsWithScriptSnapshot:flutterAssetsURL]; - if ([[NSFileManager defaultManager] fileExistsAtPath:flutterAssetsURL.path]) { - _settings.assets_path = flutterAssetsURL.path.UTF8String; - - NSURL* scriptSnapshotPath = - [NSURL URLWithString:@(kScriptSnapshotFileName) relativeToURL:flutterAssetsURL]; - if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotPath.path]) { - _settings.script_snapshot_path = scriptSnapshotPath.path.UTF8String; - } - } + [self checkReadiness]; } return self; @@ -189,19 +92,56 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL #pragma mark - Convenience initializers - (instancetype)initFromDefaultSourceForConfiguration { - if (blink::DartVM::IsRunningPrecompiledCode()) { - return [self initWithPrecompiledDartBundle:nil]; + NSBundle* bundle = [NSBundle mainBundle]; + + if (Dart_IsPrecompiledRuntime()) { + // Load from an AOTC snapshot. + return [self initWithPrecompiledDartBundle:bundle]; } else { - return [self initWithFlutterAssets:nil dartMain:nil packages:nil]; + // Load directly from sources if the appropriate command line flags are + // specified. If not, try loading from a script snapshot in the framework + // bundle. + NSURL* flutterAssetsURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::FlutterAssetsDir)); + + if (flutterAssetsURL == nil) { + // If the URL was not specified on the command line, look inside the + // FlutterApplication bundle. + NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:bundle]; + if (flutterAssetsPath != nil) { + flutterAssetsURL = [NSURL fileURLWithPath:flutterAssetsPath isDirectory:NO]; + } + } + + if (flutterAssetsURL == nil) { + NSLog(@"Error: flutterAssets directory not present in bundle; unable to start app."); + [self release]; + return nil; + } + + NSURL* dartMainURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::MainDartFile)); + NSURL* dartPackagesURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::Packages)); + + return + [self initWithFlutterAssets:flutterAssetsURL dartMain:dartMainURL packages:dartPackagesURL]; } -} -- (const blink::Settings&)settings { - return _settings; + NSAssert(NO, @"Unreachable"); + [self release]; + return nil; } -- (shell::RunConfiguration)runConfiguration { - return shell::RunConfiguration::InferFromSettings(_settings); +#pragma mark - Common initialization tasks + +- (void)checkReadiness { + if (_precompiledDartBundle != nil) { + _vmTypeRequirement = VMTypePrecompilation; + return; + } + + if (_dartSource != nil) { + _vmTypeRequirement = VMTypeInterpreter; + return; + } } #pragma mark - Assets-related utilities @@ -221,7 +161,7 @@ + (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle { } + (NSString*)lookupKeyForAsset:(NSString*)asset { - NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName:[NSBundle mainBundle]]; + NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName: [NSBundle mainBundle]]; return [NSString stringWithFormat:@"%@/%@", flutterAssetsName, asset]; } @@ -229,4 +169,179 @@ + (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { return [self lookupKeyForAsset:[NSString stringWithFormat:@"packages/%@/%@", package, asset]]; } +#pragma mark - Launching the project in a preconfigured engine. + +static NSString* NSStringFromVMType(VMType type) { + switch (type) { + case VMTypeInvalid: + return @"Invalid"; + case VMTypeInterpreter: + return @"Interpreter"; + case VMTypePrecompilation: + return @"Precompilation"; + } + + return @"Unknown"; +} + +- (void)launchInEngine:(shell::Engine*)engine + withEntrypoint:(NSString*)entrypoint + embedderVMType:(VMType)embedderVMType + result:(LaunchResult)result { + if (_vmTypeRequirement == VMTypeInvalid) { + result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); + return; + } + + if (embedderVMType == VMTypeInvalid) { + result(NO, @"The embedder is invalid."); + return; + } + + if (_vmTypeRequirement != embedderVMType) { + NSString* message = + [NSString stringWithFormat: + @"Could not load the project because of differing project type. " + @"The project can run in '%@' but the embedder is configured as " + @"'%@'", + NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; + result(NO, message); + return; + } + + switch (_vmTypeRequirement) { + case VMTypeInterpreter: + [self runFromSourceInEngine:engine withEntrypoint:entrypoint result:result]; + return; + case VMTypePrecompilation: + [self runFromPrecompiledSourceInEngine:engine withEntrypoint:entrypoint result:result]; + return; + case VMTypeInvalid: + break; + } + + return result(NO, @"Internal error"); +} + +- (void)launchInEngine:(shell::Engine*)engine + embedderVMType:(VMType)embedderVMType + result:(LaunchResult)result { + if (_vmTypeRequirement == VMTypeInvalid) { + result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); + return; + } + + if (embedderVMType == VMTypeInvalid) { + result(NO, @"The embedder is invalid."); + return; + } + + if (_vmTypeRequirement != embedderVMType) { + NSString* message = + [NSString stringWithFormat: + @"Could not load the project because of differing project type. " + @"The project can run in '%@' but the embedder is configured as " + @"'%@'", + NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; + result(NO, message); + return; + } + + switch (_vmTypeRequirement) { + case VMTypeInterpreter: + [self runFromSourceInEngine:engine withEntrypoint:@"main" result:result]; + return; + case VMTypePrecompilation: + [self runFromPrecompiledSourceInEngine:engine withEntrypoint:@"main" result:result]; + return; + case VMTypeInvalid: + break; + } + + return result(NO, @"Internal error"); +} + +#pragma mark - Running from precompiled application bundles + +- (void)runFromPrecompiledSourceInEngine:(shell::Engine*)engine + withEntrypoint:(NSString*)entrypoint + result:(LaunchResult)result { + if (![_precompiledDartBundle load]) { + NSString* message = [NSString + stringWithFormat:@"Could not load the framework ('%@') containing precompiled code.", + _precompiledDartBundle.bundleIdentifier]; + result(NO, message); + return; + } + + NSString* path = [FlutterDartProject pathForFlutterAssetsFromBundle:_precompiledDartBundle]; + if (path.length == 0) { + NSString* message = [NSString stringWithFormat: + @"Could not find the 'flutter_assets' dir in " + @"the precompiled Dart bundle with ID '%@'", + _precompiledDartBundle.bundleIdentifier]; + result(NO, message); + return; + } + + std::string bundle_path = path.UTF8String; + blink::Threads::UI()->PostTask([ + engine = engine->GetWeakPtr(), bundle_path, entrypoint = std::string([entrypoint UTF8String]) + ] { + if (engine) + engine->RunBundle(bundle_path, entrypoint); + }); + + result(YES, @"Success"); +} + +#pragma mark - Running from source + +- (void)runFromSourceInEngine:(shell::Engine*)engine + withEntrypoint:(NSString*)entrypoint + result:(LaunchResult)result { + if (_dartSource == nil) { + result(NO, @"Dart source not specified."); + return; + } + + [_dartSource validate:^(BOOL success, NSString* message) { + if (!success) { + return result(NO, message); + } + + std::string bundle_path = _dartSource.flutterAssets.absoluteURL.path.UTF8String; + + if (_dartSource.assetsDirContainsScriptSnapshot) { + blink::Threads::UI()->PostTask([ + engine = engine->GetWeakPtr(), bundle_path, + entrypoint = std::string([entrypoint UTF8String]) + ] { + if (engine) + engine->RunBundle(bundle_path, entrypoint); + }); + } else { + std::string main = _dartSource.dartMain.absoluteURL.path.UTF8String; + std::string packages = _dartSource.packages.absoluteURL.path.UTF8String; + blink::Threads::UI()->PostTask( + [ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { + if (engine) + engine->RunBundleAndSource(bundle_path, main, packages); + }); + } + + result(YES, @"Success"); + }]; +} + +#pragma mark - Misc. + +- (void)dealloc { + [_precompiledDartBundle unload]; + [_precompiledDartBundle release]; + [_dartSource release]; + + [super dealloc]; +} + @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h index 7fe1fc364f328..75db7c4049dd9 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h @@ -5,15 +5,32 @@ #ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ -#include "flutter/common/settings.h" #include "flutter/shell/common/engine.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h" +enum VMType { + // An invalid VM configuration. + VMTypeInvalid = 0, + // VM can execute Dart code as an interpreter. + VMTypeInterpreter, + // VM can execute precompiled Dart code. + VMTypePrecompilation, +}; + +typedef void (^LaunchResult)(BOOL success, NSString* message); + @interface FlutterDartProject () -- (const blink::Settings&)settings; +- (void)launchInEngine:(shell::Engine*)engine + embedderVMType:(VMType)type + result:(LaunchResult)result; + +- (void)launchInEngine:(shell::Engine*)engine + withEntrypoint:(NSString*)entrypoint + embedderVMType:(VMType)type + result:(LaunchResult)result; -- (shell::RunConfiguration)runConfiguration; ++ (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle; @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h new file mode 100644 index 0000000000000..c3881ce065185 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h @@ -0,0 +1,30 @@ +// Copyright 2016 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. + +#ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ +#define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ + +#import + +typedef void (^ValidationResult)(BOOL result, NSString* message); + +@interface FlutterDartSource : NSObject + +@property(nonatomic, readonly) NSURL* dartMain; +@property(nonatomic, readonly) NSURL* packages; +@property(nonatomic, readonly) NSURL* flutterAssets; +@property(nonatomic, readonly) BOOL assetsDirContainsScriptSnapshot; + +- (instancetype)initWithDartMain:(NSURL*)dartMain + packages:(NSURL*)packages + flutterAssets:(NSURL*)flutterAssets NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets + NS_DESIGNATED_INITIALIZER; + +- (void)validate:(ValidationResult)result; + +@end + +#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm new file mode 100644 index 0000000000000..aecb4e5806b3a --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm @@ -0,0 +1,100 @@ +// Copyright 2016 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. + +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" + +@implementation FlutterDartSource + +@synthesize dartMain = _dartMain; +@synthesize packages = _packages; +@synthesize flutterAssets = _flutterAssets; +@synthesize assetsDirContainsScriptSnapshot = _assetsDirContainsScriptSnapshot; + +#pragma mark - Convenience Initializers + +- (instancetype)init { + return [self initWithDartMain:nil packages:nil flutterAssets:nil]; +} + +#pragma mark - Designated Initializers + +- (instancetype)initWithDartMain:(NSURL*)dartMain + packages:(NSURL*)packages + flutterAssets:(NSURL*)flutterAssets { + self = [super init]; + + if (self) { + _dartMain = [dartMain copy]; + _packages = [packages copy]; + _flutterAssets = [flutterAssets copy]; + + NSFileManager* fileManager = [NSFileManager defaultManager]; + + const BOOL dartMainExists = [fileManager fileExistsAtPath:dartMain.absoluteURL.path]; + const BOOL packagesExists = [fileManager fileExistsAtPath:packages.absoluteURL.path]; + + if (!dartMainExists || !packagesExists) { + // We cannot actually verify this without opening up the directory. This is + // just an assumption. + _assetsDirContainsScriptSnapshot = YES; + } + } + + return self; +} + +- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets { + self = [super init]; + + if (self) { + _flutterAssets = [flutterAssets copy]; + _assetsDirContainsScriptSnapshot = YES; + } + + return self; +} + +static BOOL CheckDartProjectURL(NSMutableString* log, NSURL* url, NSString* logLabel) { + if (url == nil) { + [log appendFormat:@"The %@ was not specified.\n", logLabel]; + return false; + } + + if (!url.isFileURL) { + [log appendFormat:@"The %@ must be a file URL.\n", logLabel]; + return false; + } + + if (![[NSFileManager defaultManager] fileExistsAtPath:url.absoluteURL.path]) { + [log appendFormat:@"No file found at '%@' when looking for the %@.\n", url, logLabel]; + return false; + } + + return true; +} + +- (void)validate:(ValidationResult)result { + NSMutableString* log = [[[NSMutableString alloc] init] autorelease]; + + BOOL isValid = YES; + + isValid &= CheckDartProjectURL(log, _flutterAssets, @"Flutter assets"); + + if (!_assetsDirContainsScriptSnapshot) { + isValid &= CheckDartProjectURL(log, _dartMain, @"Dart main"); + isValid &= CheckDartProjectURL(log, _packages, @"Dart packages"); + } + + result(isValid, log); +} + +- (void)dealloc { + [_dartMain release]; + [_packages release]; + [_flutterAssets release]; + + [super dealloc]; +} + +@end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm index dee11d08934a5..2143f362f7905 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm @@ -2,84 +2,38 @@ // 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 - #import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h" -#include #include -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/engine.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/run_configuration.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/common/thread_host.h" -#include "flutter/shell/platform/darwin/common/command_line.h" -#include "lib/fxl/functional/make_copyable.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" +#include "flutter/shell/common/null_platform_view.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" -static std::unique_ptr CreateHeadlessPlatformView(shell::Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); -} +@interface FlutterHeadlessDartRunner () +@end -static std::unique_ptr CreateHeadlessRasterizer(shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); +@implementation FlutterHeadlessDartRunner { + fml::scoped_nsprotocol _dartProject; + std::shared_ptr _platformView; } -@implementation FlutterHeadlessDartRunner { - shell::ThreadHost _threadHost; - std::unique_ptr _shell; +- (instancetype)init { + _dartProject.reset([[FlutterDartProject alloc] initFromDefaultSourceForConfiguration]); + _platformView = std::make_shared(); + _platformView->Attach(); + return self; } - (void)runWithEntrypoint:(NSString*)entrypoint { - if (_shell != nullptr || entrypoint.length == 0) { - FXL_LOG(ERROR) << "This headless dart runner was already used to run some code."; - return; - } - - const auto label = "io.flutter.headless"; - - // Create the threads to run the shell on. - _threadHost = { - label, // native thread label - shell::ThreadHost::Type::UI // managed threads to create - }; - - // Configure shell task runners. - auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); - auto single_task_runner = _threadHost.ui_thread->GetTaskRunner(); - blink::TaskRunners task_runners(label, // dart thread label - current_task_runner, // platform - single_task_runner, // gpu - single_task_runner, // ui - single_task_runner // io - ); - - auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); - - // Create the shell. This is a blocking operation. - _shell = shell::Shell::Create( - std::move(task_runners), // task runners - std::move(settings), // settings - std::bind(&CreateHeadlessPlatformView, std::placeholders::_1), // platform view creation - std::bind(&CreateHeadlessRasterizer, std::placeholders::_1) // rasterzier creation - ); - - if (_shell == nullptr) { - FXL_LOG(ERROR) << "Could not start a shell for the headless dart runner with entrypoint: " - << entrypoint.UTF8String; - return; - } - - // Override the default run configuration with the specified entrypoint. - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = _shell->GetEngine(), - config = shell::RunConfiguration::InferFromSettings(settings)]() mutable { - if (!engine || !engine->Run(std::move(config))) { - FXL_LOG(ERROR) << "Could not launch engine with configuration."; - } - })); + const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; + [_dartProject launchInEngine:&_platformView->engine() + withEntrypoint:entrypoint + embedderVMType:type + result:^(BOOL success, NSString* message) { + if (!success) + NSLog(@"%@", message); + }]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.h b/shell/platform/darwin/ios/framework/Source/FlutterView.h index 5e3d303401725..661940620c947 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.h @@ -7,14 +7,8 @@ #include -#include - -#include "flutter/shell/platform/darwin/ios/ios_surface.h" - @interface FlutterView : UIView -- (std::unique_ptr)createSurface; - @end #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 27e3d48c4cb50..7c382838c6f5c 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -5,41 +5,20 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/common/settings.h" -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/flow/layers/layer_tree.h" -#include "flutter/fml/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" -#include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" -#include "flutter/shell/platform/darwin/ios/ios_surface_software.h" #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" -@interface FlutterView () +@interface FlutterView () @end @implementation FlutterView -- (FlutterViewController*)flutterViewController { - // Find the first view controller in the responder chain and see if it is a FlutterViewController. - for (UIResponder* responder = self.nextResponder; responder != nil; - responder = responder.nextResponder) { - if ([responder isKindOfClass:[UIViewController class]]) { - if ([responder isKindOfClass:[FlutterViewController class]]) { - return reinterpret_cast(responder); - } else { - // Should only happen if a non-FlutterViewController tries to somehow (via dynamic class - // resolution or reparenting) set a FlutterView as its view. - return nil; - } - } - } - return nil; -} - - (void)layoutSubviews { if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { CAEAGLLayer* layer = reinterpret_cast(self.layer); @@ -61,24 +40,13 @@ + (Class)layerClass { #endif // TARGET_IPHONE_SIMULATOR } -- (std::unique_ptr)createSurface { - if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { - fml::scoped_nsobject eagl_layer( - reinterpret_cast([self.layer retain])); - return std::make_unique(std::move(eagl_layer)); - } else { - fml::scoped_nsobject layer(reinterpret_cast([self.layer retain])); - return std::make_unique(std::move(layer)); - } -} - - (BOOL)enableInputClicksWhenVisible { return YES; } -static void SnapshotRasterizer(fml::WeakPtr rasterizer, - CGContextRef context, - bool is_opaque) { +void SnapshotRasterizer(fml::WeakPtr rasterizer, + CGContextRef context, + bool is_opaque) { if (!rasterizer) { return; } @@ -109,11 +77,10 @@ static void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCanvas canvas(bitmap); - flow::CompositorContext compositor_context; - - if (auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */)) { - layer_tree->Preroll(*frame, true /* ignore raster cache */); - layer_tree->Paint(*frame); + { + flow::CompositorContext compositor_context(nullptr); + auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */); + layer_tree->Raster(frame, false /* ignore raster cache. */); } canvas.flush(); @@ -122,6 +89,41 @@ static void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCGDrawBitmap(context, bitmap, 0, 0); } +static fml::WeakPtr GetRandomRasterizer() { + fml::WeakPtr rasterizer; + shell::Shell::Shared().IteratePlatformViews([&rasterizer](shell::PlatformView* view) -> bool { + rasterizer = view->rasterizer().GetWeakRasterizerPtr(); + // We just grab the first rasterizer so there is no need to iterate + // further. + return false; + }); + return rasterizer; +} + +void SnapshotContents(CGContextRef context, bool is_opaque) { + // TODO(chinmaygarde): Currently, there is no way to get the rasterizer for + // a particular platform view from the shell. But, for now, we only have one + // platform view. So use that. Once we support multiple platform views, the + // shell will need to provide a way to get the rasterizer for a specific + // platform view. + SnapshotRasterizer(GetRandomRasterizer(), context, is_opaque); +} + +void SnapshotContentsSync(CGContextRef context, UIView* view) { + auto gpu_thread = blink::Threads::Gpu(); + + if (!gpu_thread) { + return; + } + + fxl::AutoResetWaitableEvent latch; + gpu_thread->PostTask([&latch, context, view]() { + SnapshotContents(context, [view isOpaque]); + latch.Signal(); + }); + latch.Wait(); +} + // Override the default CALayerDelegate method so that APIs that attempt to // screenshot the view display contents correctly. We cannot depend on // reading @@ -130,22 +132,7 @@ static void SnapshotRasterizer(fml::WeakPtr rasterizer, // 2: The call is made of the platform thread and not the GPU thread. // 3: There may be a software rasterizer. - (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { - TRACE_EVENT0("flutter", "SnapshotFlutterView"); - FlutterViewController* controller = [self flutterViewController]; - - if (controller == nil) { - return; - } - - auto& shell = [controller shell]; - - fxl::AutoResetWaitableEvent latch; - shell.GetTaskRunners().GetGPUTaskRunner()->PostTask( - [&latch, rasterizer = shell.GetRasterizer(), context, opaque = layer.opaque]() { - SnapshotRasterizer(std::move(rasterizer), context, opaque); - latch.Signal(); - }); - latch.Wait(); + SnapshotContentsSync(context, self); } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 17e9a4eff48f6..a467a5a8cf1a5 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -2,54 +2,90 @@ // 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 - -#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" +#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" #include -#include "flutter/fml/message_loop.h" +#include "flutter/common/threads.h" +#include "flutter/flow/texture.h" #include "flutter/fml/platform/darwin/platform_version.h" +#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/thread_host.h" +#include "flutter/lib/ui/painting/resource_context.h" +#include "flutter/shell/platform/darwin/common/buffer_conversions.h" +#include "flutter/shell/platform/darwin/common/platform_mac.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterCodecs.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" #include "flutter/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" +#include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" #include "flutter/shell/platform/darwin/ios/platform_view_ios.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/time/time_delta.h" + +namespace { + +typedef void (^PlatformMessageResponseCallback)(NSData*); + +class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); + + public: + void Complete(std::vector data) override { + fxl::RefPtr self(this); + blink::Threads::Platform()->PostTask( + fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { + self->callback_.get()(shell::GetNSDataFromVector(data)); + })); + } + + void CompleteEmpty() override { + fxl::RefPtr self(this); + blink::Threads::Platform()->PostTask( + fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); + } + + private: + explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback) + : callback_(callback, fml::OwnershipPolicy::Retain) {} -@interface FlutterViewController () + fml::ScopedBlock callback_; +}; + +} // namespace + +@interface FlutterViewController () @end @implementation FlutterViewController { - fml::scoped_nsobject _dartProject; - shell::ThreadHost _threadHost; - std::unique_ptr _shell; - - // Channels - fml::scoped_nsobject _platformPlugin; - fml::scoped_nsobject _textInputPlugin; - fml::scoped_nsobject _localizationChannel; - fml::scoped_nsobject _navigationChannel; - fml::scoped_nsobject _platformChannel; - fml::scoped_nsobject _textInputChannel; - fml::scoped_nsobject _lifecycleChannel; - fml::scoped_nsobject _systemChannel; - fml::scoped_nsobject _settingsChannel; - - // We keep a separate reference to this and create it ahead of time because we want to be able to - // setup a shell along with its platform view before the view has to appear. - fml::scoped_nsobject _flutterView; - fml::scoped_nsobject _launchView; + fml::scoped_nsprotocol _dartProject; UIInterfaceOrientationMask _orientationPreferences; UIStatusBarStyle _statusBarStyle; blink::ViewportMetrics _viewportMetrics; shell::TouchMapper _touchMapper; + std::shared_ptr _platformView; + fml::scoped_nsprotocol _platformPlugin; + fml::scoped_nsprotocol _textInputPlugin; + fml::scoped_nsprotocol _localizationChannel; + fml::scoped_nsprotocol _navigationChannel; + fml::scoped_nsprotocol _platformChannel; + fml::scoped_nsprotocol _textInputChannel; + fml::scoped_nsprotocol _lifecycleChannel; + fml::scoped_nsprotocol _systemChannel; + fml::scoped_nsprotocol _settingsChannel; + fml::scoped_nsprotocol _launchView; int64_t _nextTextureId; BOOL _initialized; + BOOL _connected; +} + ++ (void)initialize { + if (self == [FlutterViewController class]) { + shell::FlutterMain(); + } } #pragma mark - Manage and override all designated initializers @@ -89,92 +125,26 @@ - (void)performCommonViewControllerInitialization { _orientationPreferences = UIInterfaceOrientationMaskAll; _statusBarStyle = UIStatusBarStyleDefault; - - if ([self setupShell]) { - [self setupChannels]; - [self setupNotificationCenterObservers]; - } -} - -- (shell::Shell&)shell { - FXL_DCHECK(_shell); - return *_shell; -} - -- (fml::WeakPtr)iosPlatformView { - FXL_DCHECK(_shell); - return _shell->GetPlatformView(); -} - -- (BOOL)setupShell { - FXL_DCHECK(_shell == nullptr); - - static size_t shell_count = 1; - - auto threadLabel = [NSString stringWithFormat:@"io.flutter.%zu", shell_count++]; - - _threadHost = { - threadLabel.UTF8String, // label - shell::ThreadHost::Type::UI | shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::IO}; - - // The current thread will be used as the platform thread. Ensure that the message loop is - // initialized. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - blink::TaskRunners task_runners(threadLabel.UTF8String, // label - fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform - _threadHost.gpu_thread->GetTaskRunner(), // gpu - _threadHost.ui_thread->GetTaskRunner(), // ui - _threadHost.io_thread->GetTaskRunner() // io - ); - - _flutterView.reset([[FlutterView alloc] init]); - - // Lambda captures by pointers to ObjC objects are fine here because the create call is - // synchronous. - shell::Shell::CreateCallback on_create_platform_view = - [flutter_view_controller = self, flutter_view = _flutterView.get()](shell::Shell& shell) { - auto platform_view_ios = std::make_unique( - shell, // delegate - shell.GetTaskRunners(), // task runners - flutter_view_controller, // flutter view controller owner - flutter_view // flutter view owner - ); - return platform_view_ios; - }; - - shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - // Create the shell. - _shell = shell::Shell::Create(std::move(task_runners), // - [_dartProject settings], // - on_create_platform_view, // - on_create_rasterizer // - ); - - if (!_shell) { - FXL_LOG(ERROR) << "Could not setup a shell to run the Dart application."; - return false; - } - - // Launch the Dart application with the inferred run configuration. - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = _shell->GetEngine(), // - config = [_dartProject.get() runConfiguration] // - ]() mutable { - if (engine) { - auto result = engine->Run(std::move(config)); - if (!result) { - FXL_LOG(ERROR) << "Could not launch engine with configuration."; - } + _platformView = std::make_shared( + reinterpret_cast(self.view.layer), self); + + _platformView->Attach( + // First frame callback. + [self]() { + TRACE_EVENT0("flutter", "First Frame"); + if (_launchView) { + [UIView animateWithDuration:0.2 + animations:^{ + _launchView.get().alpha = 0; + } + completion:^(BOOL finished) { + [_launchView.get() removeFromSuperview]; + _launchView.reset(); + }]; } - })); - return true; -} + }); + _platformView->SetupResourceContextOnIOThread(); -- (void)setupChannels { _localizationChannel.reset([[FlutterMethodChannel alloc] initWithName:@"flutter/localization" binaryMessenger:self @@ -220,8 +190,9 @@ - (void)setupChannels { [_textInputChannel.get() setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { [_textInputPlugin.get() handleMethodCall:call result:result]; }]; - static_cast(_shell->GetPlatformView().get()) - ->SetTextInputPlugin(_textInputPlugin); + _platformView->SetTextInputPlugin(_textInputPlugin); + + [self setupNotificationCenterObservers]; } - (void)setupNotificationCenterObservers { @@ -290,24 +261,50 @@ - (void)setupNotificationCenterObservers { - (void)setInitialRoute:(NSString*)route { [_navigationChannel.get() invokeMethod:@"setInitialRoute" arguments:route]; } +#pragma mark - Initializing the engine + +- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { + exit(0); +} + +- (void)connectToEngineAndLoad { + if (_connected) + return; + _connected = YES; + + TRACE_EVENT0("flutter", "connectToEngineAndLoad"); + + // We ask the VM to check what it supports. + const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; + + [_dartProject launchInEngine:&_platformView->engine() + embedderVMType:type + result:^(BOOL success, NSString* message) { + if (!success) { + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Launch Error" + message:message + delegate:self + cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [alert show]; + [alert release]; + } + }]; +} #pragma mark - Loading the view - (void)loadView { - self.view = _flutterView.get(); + FlutterView* view = [[FlutterView alloc] init]; + + self.view = view; self.view.multipleTouchEnabled = YES; self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [self installLaunchViewIfNecessary]; -} - -#pragma mark - Managing launch views + [view release]; -- (void)installLaunchViewIfNecessary { // Show the launch screen view again on top of the FlutterView if available. // This launch screen view will be removed once the first Flutter frame is rendered. - [_launchView.get() removeFromSuperview]; - _launchView.reset(); NSString* launchStoryboardName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UILaunchStoryboardName"]; if (launchStoryboardName && !self.isBeingPresented && !self.isMovingToParentViewController) { @@ -322,57 +319,16 @@ - (void)installLaunchViewIfNecessary { } } -- (void)removeLaunchViewIfPresent { - if (!_launchView) { - return; - } - - [UIView animateWithDuration:0.2 - animations:^{ - _launchView.get().alpha = 0; - } - completion:^(BOOL finished) { - [_launchView.get() removeFromSuperview]; - _launchView.reset(); - }]; -} - -- (void)installLaunchViewCallback { - if (!_shell || !_launchView) { - return; - } - auto weak_platform_view = _shell->GetPlatformView(); - if (!weak_platform_view) { - return; - } - __unsafe_unretained auto weak_flutter_view_controller = self; - // This is on the platform thread. - weak_platform_view->SetNextFrameCallback( - [weak_platform_view, weak_flutter_view_controller, - task_runner = _shell->GetTaskRunners().GetPlatformTaskRunner()]() { - // This is on the GPU thread. - task_runner->PostTask([weak_platform_view, weak_flutter_view_controller]() { - // We check if the weak platform view is alive. If it is alive, then the view controller - // also has to be alive since the view controller owns the platform view via the shell - // association. Thus, we are not convinced that the unsafe unretained weak object is in - // fact alive. - if (weak_platform_view) { - [weak_flutter_view_controller removeLaunchViewIfPresent]; - } - }); - }); -} - #pragma mark - Surface creation and teardown updates - (void)surfaceUpdated:(BOOL)appeared { + FXL_CHECK(_platformView != nullptr); + // NotifyCreated/NotifyDestroyed are synchronous and require hops between the UI and GPU thread. if (appeared) { - [self installLaunchViewCallback]; - _shell->GetPlatformView()->NotifyCreated(); - + _platformView->NotifyCreated(); } else { - _shell->GetPlatformView()->NotifyDestroyed(); + _platformView->NotifyDestroyed(); } } @@ -380,6 +336,7 @@ - (void)surfaceUpdated:(BOOL)appeared { - (void)viewWillAppear:(BOOL)animated { TRACE_EVENT0("flutter", "viewWillAppear"); + [self connectToEngineAndLoad]; // Only recreate surface on subsequent appearances when viewport metrics are known. // First time surface creation is done on viewDidLayoutSubviews. if (_viewportMetrics.physical_width) @@ -434,6 +391,8 @@ - (void)applicationWillResignActive:(NSNotification*)notification { - (void)applicationDidEnterBackground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationDidEnterBackground"); [self surfaceUpdated:NO]; + // GrContext operations are blocked when the app is in the background. + blink::ResourceContext::Freeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.paused"]; } @@ -441,6 +400,7 @@ - (void)applicationWillEnterForeground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationWillEnterForeground"); if (_viewportMetrics.physical_width) [self surfaceUpdated:YES]; + blink::ResourceContext::Unfreeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.inactive"]; } @@ -587,11 +547,10 @@ - (void)dispatchTouches:(NSSet*)touches phase:(UITouchPhase)phase { packet->SetPointerData(i++, pointer_data); } - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = _shell->GetEngine(), packet = std::move(packet)] { - if (engine) { + blink::Threads::UI()->PostTask(fxl::MakeCopyable( + [ engine = _platformView->engine().GetWeakPtr(), packet = std::move(packet) ] { + if (engine.get()) engine->DispatchPointerDataPacket(*packet); - } })); } @@ -614,11 +573,13 @@ - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event { #pragma mark - Handle view resizing - (void)updateViewportMetrics { - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = _shell->GetEngine(), metrics = _viewportMetrics]() { - if (engine) { - engine->SetViewportMetrics(std::move(metrics)); + blink::Threads::UI()->PostTask( + [ weak_platform_view = _platformView->GetWeakPtr(), metrics = _viewportMetrics ] { + if (!weak_platform_view) { + return; } + weak_platform_view->UpdateSurfaceSize(); + weak_platform_view->engine().SetViewportMetrics(metrics); }); } @@ -748,7 +709,7 @@ - (void)onVoiceOverChanged:(NSNotification*)notification { #else bool enabled = UIAccessibilityIsVoiceOverRunning(); #endif - _shell->GetPlatformView()->SetSemanticsEnabled(enabled); + _platformView->ToggleAccessibility(self.view, enabled); } #pragma mark - Memory Notifications @@ -914,50 +875,46 @@ - (void)sendOnChannel:(NSString*)channel message:(NSData*)message binaryReply:(FlutterBinaryReply)callback { NSAssert(channel, @"The channel must not be null"); - fxl::RefPtr response = + fxl::RefPtr response = (callback == nil) ? nullptr - : fxl::MakeRefCounted( - ^(NSData* reply) { - callback(reply); - }, - _shell->GetTaskRunners().GetPlatformTaskRunner()); + : fxl::MakeRefCounted(^(NSData* reply) { + callback(reply); + }); fxl::RefPtr platformMessage = (message == nil) ? fxl::MakeRefCounted(channel.UTF8String, response) : fxl::MakeRefCounted( channel.UTF8String, shell::GetVectorFromNSData(message), response); - - _shell->GetPlatformView()->DispatchPlatformMessage(platformMessage); + _platformView->DispatchPlatformMessage(platformMessage); } - (void)setMessageHandlerOnChannel:(NSString*)channel binaryMessageHandler:(FlutterBinaryMessageHandler)handler { NSAssert(channel, @"The channel must not be null"); - [self iosPlatformView] -> GetPlatformMessageRouter().SetMessageHandler(channel.UTF8String, - handler); + _platformView->platform_message_router().SetMessageHandler(channel.UTF8String, handler); } #pragma mark - FlutterTextureRegistry - (int64_t)registerTexture:(NSObject*)texture { int64_t textureId = _nextTextureId++; - [self iosPlatformView] -> RegisterExternalTexture(textureId, texture); + _platformView->RegisterExternalTexture(textureId, texture); return textureId; } - (void)unregisterTexture:(int64_t)textureId { - _shell->GetPlatformView()->UnregisterTexture(textureId); + _platformView->UnregisterTexture(textureId); } - (void)textureFrameAvailable:(int64_t)textureId { - _shell->GetPlatformView()->MarkTextureFrameAvailable(textureId); + _platformView->MarkTextureFrameAvailable(textureId); } - (NSString*)lookupKeyForAsset:(NSString*)asset { - return [FlutterDartProject lookupKeyForAsset:asset]; + return [FlutterDartProject lookupKeyForAsset:asset]; } - (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { - return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; + return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h deleted file mode 100644 index 482379c8f17eb..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ - -#include "flutter/shell/common/shell.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" - -@interface FlutterViewController () - -- (shell::Shell&)shell; - -@end - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 6a545b95e4276..3f96f37a9c2db 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -427,7 +427,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { weak_factory_(this) { accessibility_channel_.reset([[FlutterBasicMessageChannel alloc] initWithName:@"flutter/accessibility" - binaryMessenger:platform_view->GetOwnerViewController() + binaryMessenger:platform_view->binary_messenger() codec:[FlutterStandardMessageCodec sharedInstance]]); [accessibility_channel_.get() setMessageHandler:^(id message, FlutterReply reply) { HandleEvent((NSDictionary*)message); @@ -440,7 +440,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { } UIView* AccessibilityBridge::textInputView() { - return [platform_view_->GetTextInputPlugin() textInputView]; + return [platform_view_->text_input_plugin() textInputView]; } void AccessibilityBridge::UpdateSemantics(blink::SemanticsNodeUpdates nodes) { diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h new file mode 100644 index 0000000000000..f2e54dd2c2806 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h @@ -0,0 +1,18 @@ +// Copyright 2017 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. + +#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ + +#include "lib/fxl/macros.h" + +namespace shell { + +/// Initializes the Flutter shell. This must be called before interacting with +/// the engine in any way. It is safe to call this method multiple times. +void FlutterMain(); + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm new file mode 100644 index 0000000000000..aa7ad5fd85727 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm @@ -0,0 +1,25 @@ +// Copyright 2017 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. + +#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" + +#include "flutter/shell/platform/darwin/common/platform_mac.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" + +namespace shell { + +void FlutterMain() { + NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; + NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; + NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; + + NSBundle* mainBundle = [NSBundle mainBundle]; + NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:mainBundle]; + + shell::PlatformMacMain(icuDataPath.UTF8String, libraryName != nil ? libraryName.UTF8String : "", + flutterAssetsPath.UTF8String); +} + +} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h deleted file mode 100644 index b861c5036e97d..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2018 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ - -#include - -#include "flutter/fml/platform/darwin/scoped_block.h" -#include "flutter/fml/task_runner.h" -#include "flutter/lib/ui/window/platform_message_response.h" -#include "flutter/shell/platform/darwin/common/buffer_conversions.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/macros.h" - -typedef void (^PlatformMessageResponseCallback)(NSData*); - -namespace shell { - -class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { - public: - void Complete(std::vector data) override { - fxl::RefPtr self(this); - platform_task_runner_->PostTask(fxl::MakeCopyable([self, data = std::move(data)]() mutable { - self->callback_.get()(shell::GetNSDataFromVector(data)); - })); - } - - void CompleteEmpty() override { - fxl::RefPtr self(this); - platform_task_runner_->PostTask( - fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); - } - - private: - explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback, - fxl::RefPtr platform_task_runner) - : callback_(callback, fml::OwnershipPolicy::Retain), - platform_task_runner_(std::move(platform_task_runner)) {} - - fml::ScopedBlock callback_; - fxl::RefPtr platform_task_runner_; - - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm deleted file mode 100644 index 8590b4e36942b..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2018 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/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" - -namespace shell { - -// - -} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.h b/shell/platform/darwin/ios/framework/Source/platform_message_router.h index d2488f82fe47c..cfa91c04771c3 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.h +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.h @@ -7,7 +7,6 @@ #include -#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterBinaryMessenger.h" #include "lib/fxl/memory/weak_ptr.h" @@ -19,13 +18,13 @@ class PlatformMessageRouter { PlatformMessageRouter(); ~PlatformMessageRouter(); - void HandlePlatformMessage(fxl::RefPtr message) const; + void HandlePlatformMessage(fxl::RefPtr message); void SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler); private: - std::unordered_map> + std::unordered_map message_handlers_; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter); diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm index 3ab75bff522f8..70625143b623e 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm @@ -14,8 +14,7 @@ PlatformMessageRouter::~PlatformMessageRouter() = default; -void PlatformMessageRouter::HandlePlatformMessage( - fxl::RefPtr message) const { +void PlatformMessageRouter::HandlePlatformMessage(fxl::RefPtr message) { fxl::RefPtr completer = message->response(); auto it = message_handlers_.find(message->channel()); if (it != message_handlers_.end()) { @@ -42,10 +41,14 @@ void PlatformMessageRouter::SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler) { - message_handlers_.erase(channel); - if (handler) { - message_handlers_[channel] = - fml::ScopedBlock{handler, fml::OwnershipPolicy::Retain}; + if (handler) + message_handlers_[channel] = [handler copy]; + else { + auto it = message_handlers_.find(channel); + if (it != message_handlers_.end()) { + [it->second release]; + message_handlers_.erase(it); + } } } diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h index 23aaf02510d6d..6a3362b215667 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h @@ -5,26 +5,27 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ -#include "flutter/fml/memory/weak_ptr.h" -#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" +#if __OBJC__ @class VSyncClient; +#else // __OBJC__ +class VSyncClient; +#endif // __OBJC__ namespace shell { -class VsyncWaiterIOS final : public VsyncWaiter { +class VsyncWaiterIOS : public VsyncWaiter { public: - VsyncWaiterIOS(blink::TaskRunners task_runners); - + VsyncWaiterIOS(); ~VsyncWaiterIOS() override; - private: - fml::scoped_nsobject client_; + void AsyncWaitForVsync(Callback callback) override; - // |shell::VsyncWaiter| - void AwaitVSync() override; + private: + Callback callback_; + VSyncClient* client_; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterIOS); }; diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm index 4589368acd3fb..78d6678189123 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm @@ -10,62 +10,29 @@ #include #include -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @interface VSyncClient : NSObject -- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner - callback:(shell::VsyncWaiter::Callback)callback; - -- (void)await; - -- (void)invalidate; - @end -namespace shell { - -VsyncWaiterIOS::VsyncWaiterIOS(blink::TaskRunners task_runners) - : VsyncWaiter(std::move(task_runners)), - client_([[VSyncClient alloc] initWithTaskRunner:task_runners_.GetUITaskRunner() - callback:std::bind(&VsyncWaiterIOS::FireCallback, - this, - std::placeholders::_1, - std::placeholders::_2)]) {} - -VsyncWaiterIOS::~VsyncWaiterIOS() { - // This way, we will get no more callbacks from the display link that holds a weak (non-nilling) - // reference to this C++ object. - [client_.get() invalidate]; -} - -void VsyncWaiterIOS::AwaitVSync() { - [client_.get() await]; -} - -} // namespace shell - @implementation VSyncClient { - shell::VsyncWaiter::Callback callback_; - fml::scoped_nsobject display_link_; + CADisplayLink* _displayLink; + shell::VsyncWaiter::Callback _pendingCallback; } -- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner - callback:(shell::VsyncWaiter::Callback)callback { +- (instancetype)init { self = [super init]; if (self) { - callback_ = std::move(callback); - display_link_ = fml::scoped_nsobject { - [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain] - }; - display_link_.get().paused = YES; - - task_runner->PostTask([client = [self retain]]() { - [client->display_link_.get() addToRunLoop:[NSRunLoop currentRunLoop] - forMode:NSRunLoopCommonModes]; + _displayLink = + [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain]; + _displayLink.paused = YES; + + blink::Threads::UI()->PostTask([client = [self retain]]() { + [client->_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; [client release]; }); } @@ -73,28 +40,68 @@ - (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner return self; } -- (void)await { - display_link_.get().paused = NO; +- (void)await:(shell::VsyncWaiter::Callback)callback { + FXL_DCHECK(!_pendingCallback); + _pendingCallback = std::move(callback); + _displayLink.paused = NO; } - (void)onDisplayLink:(CADisplayLink*)link { fxl::TimePoint frame_start_time = fxl::TimePoint::Now(); fxl::TimePoint frame_target_time = frame_start_time + fxl::TimeDelta::FromSecondsF(link.duration); - display_link_.get().paused = YES; - - callback_(frame_start_time, frame_target_time); -} - -- (void)invalidate { - // [CADisplayLink invalidate] is thread-safe. - [display_link_.get() invalidate]; + _displayLink.paused = YES; + + // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight + // Vsync" checkbox in the timeline can be enabled. + // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 + // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE + TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); +#else + { + fxl::TimeDelta delta = frame_target_time.ToEpochDelta(); + constexpr size_t num_chars = sizeof(int64_t) * CHAR_BIT * 3.4 + 2; + char deadline[num_chars]; + sprintf(deadline, "%lld", delta.ToMicroseconds()); + TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); + } +#endif + + // Note: Even though we know we are on the UI thread already (since the + // display link was scheduled on the UI thread in the contructor), we use + // the PostTask mechanism because the callback may have side-effects that need + // to be addressed via a task observer. Invoking the callback by itself + // bypasses such task observers. + // + // We are not using the PostTask for thread switching, but to make task + // observers work. + blink::Threads::UI()->PostTask([ + callback = _pendingCallback, frame_start_time, frame_target_time + ]() { callback(frame_start_time, frame_target_time); }); + + _pendingCallback = nullptr; } - (void)dealloc { - [self invalidate]; + [_displayLink invalidate]; + [_displayLink release]; [super dealloc]; } @end + +namespace shell { + +VsyncWaiterIOS::VsyncWaiterIOS() : client_([[VSyncClient alloc] init]) {} + +VsyncWaiterIOS::~VsyncWaiterIOS() { + [client_ release]; +} + +void VsyncWaiterIOS::AsyncWaitForVsync(Callback callback) { + [client_ await:callback]; +} + +} // namespace shell diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.h b/shell/platform/darwin/ios/ios_external_texture_gl.h index baedf298bd61d..a658fdf31628a 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.h +++ b/shell/platform/darwin/ios/ios_external_texture_gl.h @@ -25,8 +25,6 @@ class IOSExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; - virtual void MarkNewFrameAvailable() override; - private: NSObject* external_texture_; fml::CFRef cache_ref_; diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.mm b/shell/platform/darwin/ios/ios_external_texture_gl.mm index 0bd9a8ca3c7cb..2cc9721e7f09a 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.mm +++ b/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -4,10 +4,11 @@ #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" -#import +#include #import #import - +#include "flutter/common/threads.h" +#include "flutter/lib/ui/painting/resource_context.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" @@ -25,6 +26,7 @@ IOSExternalTextureGL::~IOSExternalTextureGL() = default; void IOSExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { + ASSERT_IS_GPU_THREAD; if (!cache_ref_) { CVOpenGLESTextureCacheRef cache; CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, @@ -55,8 +57,10 @@ return; } GrGLTextureInfo textureInfo = {CVOpenGLESTextureGetTarget(texture_ref_), - CVOpenGLESTextureGetName(texture_ref_), GL_RGBA8_OES}; - GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, textureInfo); + CVOpenGLESTextureGetName(texture_ref_), + GL_RGBA8_OES}; + GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, + textureInfo); sk_sp image = SkImage::MakeFromTexture(canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr); @@ -65,13 +69,14 @@ } } -void IOSExternalTextureGL::OnGrContextCreated() {} +void IOSExternalTextureGL::OnGrContextCreated() { + ASSERT_IS_GPU_THREAD +} void IOSExternalTextureGL::OnGrContextDestroyed() { + ASSERT_IS_GPU_THREAD texture_ref_.Reset(nullptr); cache_ref_.Reset(nullptr); } -void IOSExternalTextureGL::MarkNewFrameAvailable() {} - } // namespace shell diff --git a/shell/platform/darwin/ios/ios_gl_context.h b/shell/platform/darwin/ios/ios_gl_context.h index f42c1436461b1..89ad7e0347eac 100644 --- a/shell/platform/darwin/ios/ios_gl_context.h +++ b/shell/platform/darwin/ios/ios_gl_context.h @@ -18,7 +18,7 @@ namespace shell { class IOSGLContext { public: - IOSGLContext(fml::scoped_nsobject layer); + IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer); ~IOSGLContext(); diff --git a/shell/platform/darwin/ios/ios_gl_context.mm b/shell/platform/darwin/ios/ios_gl_context.mm index 77a124e64a291..de94018d0689e 100644 --- a/shell/platform/darwin/ios/ios_gl_context.mm +++ b/shell/platform/darwin/ios/ios_gl_context.mm @@ -3,17 +3,21 @@ // found in the LICENSE file. #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" - -#include - -#include "flutter/fml/trace_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" +#include + namespace shell { -IOSGLContext::IOSGLContext(fml::scoped_nsobject layer) - : layer_(std::move(layer)), +#define VERIFY(x) \ + if (!(x)) { \ + FXL_DLOG(ERROR) << "Failed: " #x; \ + return; \ + }; + +IOSGLContext::IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer) + : layer_([layer retain]), context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]), resource_context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:context_.get().sharegroup]), @@ -22,34 +26,34 @@ storage_size_width_(0), storage_size_height_(0), valid_(false) { - FXL_DCHECK(layer_ != nullptr); - FXL_DCHECK(context_ != nullptr); - FXL_DCHECK(resource_context_ != nullptr); + VERIFY(layer_ != nullptr); + VERIFY(context_ != nullptr); + VERIFY(resource_context_ != nullptr); bool context_current = [EAGLContext setCurrentContext:context_]; - FXL_DCHECK(context_current); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + VERIFY(context_current); + VERIFY(glGetError() == GL_NO_ERROR); // Generate the framebuffer glGenFramebuffers(1, &framebuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - FXL_DCHECK(framebuffer_ != GL_NONE); + VERIFY(glGetError() == GL_NO_ERROR); + VERIFY(framebuffer_ != GL_NONE); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + VERIFY(glGetError() == GL_NO_ERROR); // Setup color attachment glGenRenderbuffers(1, &colorbuffer_); - FXL_DCHECK(colorbuffer_ != GL_NONE); + VERIFY(colorbuffer_ != GL_NONE); glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + VERIFY(glGetError() == GL_NO_ERROR); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorbuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + VERIFY(glGetError() == GL_NO_ERROR); // TODO: // iOS displays are more variable than just P3 or sRGB. Reading the display @@ -135,12 +139,24 @@ return false; } - // Fetch the dimensions of the color buffer whose backing was just updated. - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &storage_size_width_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + GLint width = 0; + GLint height = 0; - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &storage_size_height_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); + if (colorbuffer_ != GL_NONE) { + // Fetch the dimensions of the color buffer whose backing was just updated + // so that backing of the attachments can be updated + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width); + FXL_DCHECK(glGetError() == GL_NO_ERROR); + + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height); + FXL_DCHECK(glGetError() == GL_NO_ERROR); + + glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); + FXL_DCHECK(glGetError() == GL_NO_ERROR); + } + + storage_size_width_ = width; + storage_size_height_ = height; FXL_DCHECK(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); diff --git a/shell/platform/darwin/ios/ios_surface.h b/shell/platform/darwin/ios/ios_surface.h index b629c2709e3d1..c164fab15500e 100644 --- a/shell/platform/darwin/ios/ios_surface.h +++ b/shell/platform/darwin/ios/ios_surface.h @@ -5,17 +5,25 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ -#include - #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/surface.h" +#include "flutter/shell/common/platform_view.h" #include "lib/fxl/macros.h" +@class CALayer; + namespace shell { class IOSSurface { public: - IOSSurface(); + static std::unique_ptr Create( + PlatformView::SurfaceConfig surface_config, + CALayer* layer); + + IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer); + + CALayer* GetLayer() const; + + PlatformView::SurfaceConfig GetSurfaceConfig() const; virtual ~IOSSurface(); @@ -28,6 +36,9 @@ class IOSSurface { virtual std::unique_ptr CreateGPUSurface() = 0; public: + PlatformView::SurfaceConfig surface_config_; + fml::scoped_nsobject layer_; + FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurface); }; diff --git a/shell/platform/darwin/ios/ios_surface.mm b/shell/platform/darwin/ios/ios_surface.mm index b0b9cc3245183..91067838330f6 100644 --- a/shell/platform/darwin/ios/ios_surface.mm +++ b/shell/platform/darwin/ios/ios_surface.mm @@ -4,15 +4,40 @@ #include "flutter/shell/platform/darwin/ios/ios_surface.h" -#include - #include #include +#include + +@class CALayer; +@class CAEAGLLayer; namespace shell { -IOSSurface::IOSSurface() = default; +std::unique_ptr IOSSurface::Create(PlatformView::SurfaceConfig surface_config, + CALayer* layer) { + // Check if we can use OpenGL. + if ([layer isKindOfClass:[CAEAGLLayer class]]) { + return std::make_unique(surface_config, reinterpret_cast(layer)); + } + + // If we ever support the metal rendering API, a check for CAMetalLayer would + // go here. + + // Finally, fallback to software rendering. + return std::make_unique(surface_config, layer); +} + +IOSSurface::IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer) + : surface_config_(surface_config), layer_([layer retain]) {} IOSSurface::~IOSSurface() = default; +CALayer* IOSSurface::GetLayer() const { + return layer_; +} + +PlatformView::SurfaceConfig IOSSurface::GetSurfaceConfig() const { + return surface_config_; +} + } // namespace shell diff --git a/shell/platform/darwin/ios/ios_surface_gl.h b/shell/platform/darwin/ios/ios_surface_gl.h index 7486d343eb0fd..f7e43e2588984 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.h +++ b/shell/platform/darwin/ios/ios_surface_gl.h @@ -5,7 +5,6 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ -#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" @@ -17,7 +16,7 @@ namespace shell { class IOSSurfaceGL : public IOSSurface, public GPUSurfaceGLDelegate { public: - IOSSurfaceGL(fml::scoped_nsobject layer); + IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer); ~IOSSurfaceGL() override; diff --git a/shell/platform/darwin/ios/ios_surface_gl.mm b/shell/platform/darwin/ios/ios_surface_gl.mm index 253531c4800aa..60756d6094fc9 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/shell/platform/darwin/ios/ios_surface_gl.mm @@ -4,12 +4,13 @@ #include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" -#include "flutter/fml/trace_event.h" #include "flutter/shell/gpu/gpu_surface_gl.h" namespace shell { -IOSSurfaceGL::IOSSurfaceGL(fml::scoped_nsobject layer) : context_(std::move(layer)) {} +IOSSurfaceGL::IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer) + : IOSSurface(surface_config, reinterpret_cast(layer)), + context_(surface_config, layer) {} IOSSurfaceGL::~IOSSurfaceGL() = default; diff --git a/shell/platform/darwin/ios/ios_surface_software.h b/shell/platform/darwin/ios/ios_surface_software.h index e8fc332f06c8c..7e3f264b28ce6 100644 --- a/shell/platform/darwin/ios/ios_surface_software.h +++ b/shell/platform/darwin/ios/ios_surface_software.h @@ -5,19 +5,17 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ -#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_software.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/macros.h" -@class CALayer; - namespace shell { -class IOSSurfaceSoftware final : public IOSSurface, - public GPUSurfaceSoftwareDelegate { +class IOSSurfaceSoftware : public IOSSurface, + public GPUSurfaceSoftwareDelegate { public: - IOSSurfaceSoftware(fml::scoped_nsobject layer); + IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, + CALayer* layer); ~IOSSurfaceSoftware() override; @@ -34,7 +32,6 @@ class IOSSurfaceSoftware final : public IOSSurface, bool PresentBackingStore(sk_sp backing_store) override; private: - fml::scoped_nsobject layer_; sk_sp sk_surface_; FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware); diff --git a/shell/platform/darwin/ios/ios_surface_software.mm b/shell/platform/darwin/ios/ios_surface_software.mm index b09a5d9a2d8a3..9a4e90e45dfba 100644 --- a/shell/platform/darwin/ios/ios_surface_software.mm +++ b/shell/platform/darwin/ios/ios_surface_software.mm @@ -15,15 +15,15 @@ namespace shell { -IOSSurfaceSoftware::IOSSurfaceSoftware(fml::scoped_nsobject layer) - : layer_(std::move(layer)) { +IOSSurfaceSoftware::IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, CALayer* layer) + : IOSSurface(surface_config, layer) { UpdateStorageSizeIfNecessary(); } IOSSurfaceSoftware::~IOSSurfaceSoftware() = default; bool IOSSurfaceSoftware::IsValid() const { - return layer_; + return GetLayer() != nullptr; } bool IOSSurfaceSoftware::ResourceContextMakeCurrent() { @@ -120,7 +120,8 @@ return false; } - layer_.get().contents = reinterpret_cast(static_cast(pixmap_image)); + CALayer* layer = GetLayer(); + layer.contents = reinterpret_cast(static_cast(pixmap_image)); return true; } diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index e7849dda44641..dab19a0f9ce1a 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -8,66 +8,95 @@ #include #include "flutter/fml/memory/weak_ptr.h" -#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" #include "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h" #include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" +@class CALayer; +@class UIView; + namespace shell { -class PlatformViewIOS final : public PlatformView { +class PlatformViewIOS : public PlatformView { public: - explicit PlatformViewIOS(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - FlutterViewController* owner_controller_, - FlutterView* owner_view_); + explicit PlatformViewIOS(CALayer* layer, + NSObject* binaryMessenger); ~PlatformViewIOS() override; - PlatformMessageRouter& GetPlatformMessageRouter(); + void Attach() override; - FlutterViewController* GetOwnerViewController() const; + void Attach(fxl::Closure firstFrameCallback); - void RegisterExternalTexture(int64_t id, NSObject* texture); + void NotifyCreated(); - fml::scoped_nsprotocol GetTextInputPlugin() const; + void ToggleAccessibility(UIView* view, bool enabled); - void SetTextInputPlugin( - fml::scoped_nsprotocol plugin); + PlatformMessageRouter& platform_message_router() { + return platform_message_router_; + } - private: - FlutterViewController* owner_controller_; // weak reference. - FlutterView* owner_view_; // weak reference. - std::unique_ptr ios_surface_; - PlatformMessageRouter platform_message_router_; - std::unique_ptr accessibility_bridge_; - fml::scoped_nsprotocol text_input_plugin_; - fxl::Closure firstFrameCallback_; + fml::WeakPtr GetWeakPtr(); - // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; + void UpdateSurfaceSize(); - // |shell::PlatformView| - sk_sp CreateResourceContext() const override; + VsyncWaiter* GetVsyncWaiter() override; - // |shell::PlatformView| - void SetSemanticsEnabled(bool enabled) override; + bool ResourceContextMakeCurrent() override; - // |shell::PlatformView| void HandlePlatformMessage( fxl::RefPtr message) override; - // |shell::PlatformView| + void RegisterExternalTexture(int64_t id, NSObject* texture); + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - // |shell::PlatformView| - std::unique_ptr CreateVSyncWaiter() override; + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + + void SetAssetBundlePath(const std::string& assets_directory) override; + + /** + * Exposes the `FlutterTextInputPlugin` singleton for the + * `AccessibilityBridge` to be able to interact with the text entry system. + */ + fml::scoped_nsprotocol text_input_plugin() { + return text_input_plugin_; + } + + /** + * Sets the `FlutterTextInputPlugin` singleton returned by + * `text_input_plugin`. + */ + void SetTextInputPlugin( + fml::scoped_nsprotocol textInputPlugin) { + text_input_plugin_ = textInputPlugin; + } + + NSObject* binary_messenger() const { + return binary_messenger_; + } + + private: + std::unique_ptr ios_surface_; + PlatformMessageRouter platform_message_router_; + std::unique_ptr accessibility_bridge_; + fxl::Closure firstFrameCallback_; + fml::WeakPtrFactory weak_factory_; + NSObject* binary_messenger_; + fml::scoped_nsprotocol text_input_plugin_; + + void SetupAndLoadFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages); + + void SetAssetBundlePathOnUI(const std::string& assets_directory); FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewIOS); }; diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index 1fba8e5e026e5..19c5dd4e663a1 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -8,92 +8,135 @@ #include -#include "flutter/common/task_runners.h" +#include "flutter/common/threads.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/gpu/gpu_rasterizer.h" +#include "flutter/shell/platform/darwin/common/process_info_mac.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewIOS::PlatformViewIOS(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - FlutterViewController* owner_controller, - FlutterView* owner_view) - : PlatformView(delegate, std::move(task_runners)), - owner_controller_(owner_controller), - owner_view_(owner_view), - ios_surface_(owner_view_.createSurface) { - FXL_DCHECK(ios_surface_ != nullptr); - FXL_DCHECK(owner_controller_ != nullptr); - FXL_DCHECK(owner_view_ != nullptr); -} +PlatformViewIOS::PlatformViewIOS(CALayer* layer, NSObject* binaryMessenger) + : PlatformView(std::make_unique(std::make_unique())), + ios_surface_(IOSSurface::Create(surface_config_, layer)), + weak_factory_(this), + binary_messenger_(binaryMessenger) {} PlatformViewIOS::~PlatformViewIOS() = default; -FlutterViewController* PlatformViewIOS::GetOwnerViewController() const { - return owner_controller_; +void PlatformViewIOS::Attach() { + Attach(NULL); } -PlatformMessageRouter& PlatformViewIOS::GetPlatformMessageRouter() { - return platform_message_router_; +void PlatformViewIOS::Attach(fxl::Closure firstFrameCallback) { + CreateEngine(); + + if (firstFrameCallback) { + firstFrameCallback_ = firstFrameCallback; + rasterizer_->AddNextFrameCallback([weakSelf = GetWeakPtr()] { + if (weakSelf) { + weakSelf->firstFrameCallback_(); + weakSelf->firstFrameCallback_ = nullptr; + } + }); + } } -void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, - NSObject* texture) { - RegisterTexture(std::make_shared(texture_id, texture)); +void PlatformViewIOS::NotifyCreated() { + PlatformView::NotifyCreated(ios_surface_->CreateGPUSurface()); +} + +void PlatformViewIOS::ToggleAccessibility(UIView* view, bool enabled) { + if (enabled) { + if (!accessibility_bridge_) { + accessibility_bridge_.reset(new shell::AccessibilityBridge(view, this)); + } + } else { + accessibility_bridge_ = nullptr; + } + SetSemanticsEnabled(enabled); } -// |shell::PlatformView| -std::unique_ptr PlatformViewIOS::CreateRenderingSurface() { - return ios_surface_->CreateGPUSurface(); +void PlatformViewIOS::SetupAndLoadFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + blink::Threads::UI()->PostTask( + [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { + if (engine) + engine->RunBundleAndSource(assets_directory, main, packages); + }); } -// |shell::PlatformView| -sk_sp PlatformViewIOS::CreateResourceContext() const { - if (!ios_surface_->ResourceContextMakeCurrent()) { - FXL_DLOG(INFO) << "Could not make resource context current on IO thread. Async texture uploads " - "will be disabled."; - return nullptr; - } +void PlatformViewIOS::SetAssetBundlePathOnUI(const std::string& assets_directory) { + blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { + if (engine) + engine->SetAssetBundlePath(assets_directory); + }); +} - return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); +fml::WeakPtr PlatformViewIOS::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); } -// |shell::PlatformView| -void PlatformViewIOS::SetSemanticsEnabled(bool enabled) { - if (enabled && !accessibility_bridge_) { - accessibility_bridge_ = std::make_unique(owner_view_, this); - } else { - accessibility_bridge_.reset(); +void PlatformViewIOS::UpdateSurfaceSize() { + blink::Threads::Gpu()->PostTask([self = GetWeakPtr()]() { + if (self && self->ios_surface_ != nullptr) { + self->ios_surface_->UpdateStorageSizeIfNecessary(); + } + }); +} + +VsyncWaiter* PlatformViewIOS::GetVsyncWaiter() { + if (!vsync_waiter_) { + vsync_waiter_ = std::make_unique(); } - PlatformView::SetSemanticsEnabled(enabled); + return vsync_waiter_.get(); +} + +bool PlatformViewIOS::ResourceContextMakeCurrent() { + return ios_surface_ != nullptr ? ios_surface_->ResourceContextMakeCurrent() : false; } -// |shell::PlatformView| void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update) { - if (accessibility_bridge_) { + if (accessibility_bridge_) accessibility_bridge_->UpdateSemantics(std::move(update)); - } } -// |shell::PlatformView| void PlatformViewIOS::HandlePlatformMessage(fxl::RefPtr message) { platform_message_router_.HandlePlatformMessage(std::move(message)); } -// |shell::PlatformView| -std::unique_ptr PlatformViewIOS::CreateVSyncWaiter() { - return std::make_unique(task_runners_); +void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, + NSObject* texture) { + RegisterTexture(std::make_shared(texture_id, texture)); } -fml::scoped_nsprotocol PlatformViewIOS::GetTextInputPlugin() const { - return text_input_plugin_; +void PlatformViewIOS::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + auto latch = new fxl::ManualResetWaitableEvent(); + + dispatch_async(dispatch_get_main_queue(), ^{ + SetupAndLoadFromSource(assets_directory, main, packages); + latch->Signal(); + }); + + latch->Wait(); + delete latch; } -void PlatformViewIOS::SetTextInputPlugin(fml::scoped_nsprotocol plugin) { - text_input_plugin_ = plugin; +void PlatformViewIOS::SetAssetBundlePath(const std::string& assets_directory) { + auto latch = new fxl::ManualResetWaitableEvent(); + + dispatch_async(dispatch_get_main_queue(), ^{ + SetAssetBundlePathOnUI(assets_directory); + latch->Signal(); + }); + + latch->Wait(); + delete latch; } } // namespace shell diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index b1e0b3e4f3b71..7ce6f7e8d5be1 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -4,21 +4,16 @@ import("$flutter_root/testing/testing.gni") -static_library("embedder") { - complete_static_lib = true - +source_set("embedder") { sources = [ "embedder.cc", "embedder.h", - "embedder_engine.cc", - "embedder_engine.h", "embedder_include.c", "platform_view_embedder.cc", "platform_view_embedder.h", ] deps = [ - "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", @@ -27,7 +22,6 @@ static_library("embedder") { "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", - "//third_party/skia:gpu", "//topaz/lib/tonic", ] diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index a7ee807934663..866413cbc077b 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -2,30 +2,14 @@ // 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 "lib/fxl/build_config.h" - -#if OS_WIN -#define FLUTTER_EXPORT __declspec(dllexport) -#else // OS_WIN #define FLUTTER_EXPORT __attribute__((visibility("default"))) -#endif // OS_WIN #include "flutter/shell/platform/embedder/embedder.h" #include - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/common/task_runners.h" -#include "flutter/fml/file.h" +#include "flutter/common/threads.h" #include "flutter/fml/message_loop.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/embedder/embedder.h" -#include "flutter/shell/platform/embedder/embedder_engine.h" #include "flutter/shell/platform/embedder/platform_view_embedder.h" -#include "lib/fxl/command_line.h" #include "lib/fxl/functional/make_copyable.h" #define SAFE_ACCESS(pointer, member, default_value) \ @@ -57,6 +41,21 @@ bool IsRendererValid(const FlutterRendererConfig* config) { return true; } +class PlatformViewHolder { + public: + PlatformViewHolder(std::shared_ptr ptr) + : platform_view_(std::move(ptr)) {} + + std::shared_ptr view() const { + return platform_view_; + } + + private: + std::shared_ptr platform_view_; + + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewHolder); +}; + struct _FlutterPlatformMessageResponseHandle { fxl::RefPtr message; }; @@ -66,7 +65,6 @@ FlutterResult FlutterEngineRun(size_t version, const FlutterProjectArgs* args, void* user_data, FlutterEngine* engine_out) { - // Step 0: Figure out arguments for shell creation. if (version != FLUTTER_ENGINE_VERSION) { return kInvalidLibraryVersion; } @@ -89,44 +87,51 @@ FlutterResult FlutterEngineRun(size_t version, return kInvalidArguments; } - auto make_current = [ptr = config->open_gl.make_current, - user_data]() -> bool { return ptr(user_data); }; + auto make_current = + [ ptr = config->open_gl.make_current, user_data ]()->bool { + return ptr(user_data); + }; - auto clear_current = [ptr = config->open_gl.clear_current, - user_data]() -> bool { return ptr(user_data); }; + auto clear_current = + [ ptr = config->open_gl.clear_current, user_data ]()->bool { + return ptr(user_data); + }; - auto present = [ptr = config->open_gl.present, user_data]() -> bool { + auto present = [ ptr = config->open_gl.present, user_data ]()->bool { return ptr(user_data); }; - auto fbo_callback = [ptr = config->open_gl.fbo_callback, - user_data]() -> intptr_t { return ptr(user_data); }; + auto fbo_callback = + [ ptr = config->open_gl.fbo_callback, user_data ]()->intptr_t { + return ptr(user_data); + }; shell::PlatformViewEmbedder::PlatformMessageResponseCallback platform_message_response_callback = nullptr; if (SAFE_ACCESS(args, platform_message_callback, nullptr) != nullptr) { platform_message_response_callback = - [ptr = args->platform_message_callback, - user_data](fxl::RefPtr message) { - auto handle = new FlutterPlatformMessageResponseHandle(); - const FlutterPlatformMessage incoming_message = { - .struct_size = sizeof(FlutterPlatformMessage), - .channel = message->channel().c_str(), - .message = message->data().data(), - .message_size = message->data().size(), - .response_handle = handle, - }; - handle->message = std::move(message); - return ptr(&incoming_message, user_data); - }; + [ ptr = args->platform_message_callback, + user_data ](fxl::RefPtr message) { + auto handle = new FlutterPlatformMessageResponseHandle(); + const FlutterPlatformMessage incoming_message = { + .struct_size = sizeof(FlutterPlatformMessage), + .channel = message->channel().c_str(), + .message = message->data().data(), + .message_size = message->data().size(), + .response_handle = handle, + }; + handle->message = std::move(message); + return ptr(&incoming_message, user_data); + }; } const FlutterOpenGLRendererConfig* open_gl_config = &config->open_gl; std::function make_resource_current_callback = nullptr; if (SAFE_ACCESS(open_gl_config, make_resource_current, nullptr) != nullptr) { - make_resource_current_callback = [ptr = - config->open_gl.make_resource_current, - user_data]() { return ptr(user_data); }; + make_resource_current_callback = + [ ptr = config->open_gl.make_resource_current, user_data ]() { + return ptr(user_data); + }; } std::string icu_data_path; @@ -142,33 +147,18 @@ FlutterResult FlutterEngineRun(size_t version, SAFE_ACCESS(args, command_line_argv, nullptr)); } - blink::Settings settings = shell::SettingsFromCommandLine(command_line); - settings.icu_data_path = icu_data_path; - settings.main_dart_file_path = args->main_path; - settings.packages_file_path = args->packages_path; - settings.assets_path = args->assets_path; - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - - // Create a thread host with the current thread as the platform thread and all - // other threads managed. - shell::ThreadHost thread_host("io.flutter", shell::ThreadHost::Type::GPU | - shell::ThreadHost::Type::IO | - shell::ThreadHost::Type::UI); - fml::MessageLoop::EnsureInitializedForCurrentThread(); - blink::TaskRunners task_runners( - "io.flutter", - fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform - thread_host.gpu_thread->GetTaskRunner(), // gpu - thread_host.ui_thread->GetTaskRunner(), // ui - thread_host.io_thread->GetTaskRunner() // io - ); - - shell::PlatformViewEmbedder::DispatchTable dispatch_table = { + static std::once_flag once_shell_initialization; + std::call_once(once_shell_initialization, [&]() { + fxl::CommandLine null_command_line; + shell::Shell::InitStandalone( + std::move(command_line), + icu_data_path, // icu data path default lookup. + "", // application library not supported in JIT mode. + args->assets_path + ); + }); + + shell::PlatformViewEmbedder::DispatchTable table = { .gl_make_current_callback = make_current, .gl_clear_current_callback = clear_current, .gl_present_callback = present, @@ -177,55 +167,31 @@ FlutterResult FlutterEngineRun(size_t version, .gl_make_resource_current_callback = make_resource_current_callback, }; - shell::Shell::CreateCallback on_create_platform_view = - [dispatch_table](shell::Shell& shell) { - return std::make_unique( - shell, // delegate - shell.GetTaskRunners(), // task runners - dispatch_table // embedder dispatch table - ); - }; - - shell::Shell::CreateCallback on_create_rasterizer = - [](shell::Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - // Step 1: Create the engine. - auto embedder_engine = - std::make_unique(std::move(thread_host), // - std::move(task_runners), // - settings, // - on_create_platform_view, // - on_create_rasterizer // - ); - - if (!embedder_engine->IsValid()) { - return kInvalidArguments; - } - - // Step 2: Setup the rendering surface. - if (!embedder_engine->NotifyCreated()) { - return kInvalidArguments; - } - - // Step 3: Run the engine. - auto run_configuration = shell::RunConfiguration::InferFromSettings(settings); - - run_configuration.AddAssetResolver( - std::make_unique( - fml::Duplicate(settings.assets_dir))); + auto platform_view = std::make_shared(table); + platform_view->Attach(); + + std::string assets(args->assets_path); + std::string main(args->main_path); + std::string packages(args->packages_path); + + blink::Threads::UI()->PostTask([ + weak_engine = platform_view->engine().GetWeakPtr(), // + assets = std::move(assets), // + main = std::move(main), // + packages = std::move(packages) // + ] { + if (auto engine = weak_engine) { + if (main.empty()) { + engine->RunBundle(assets); + } else { + engine->RunBundleAndSource(assets, main, packages); + } + } + }); + + *engine_out = reinterpret_cast( + new PlatformViewHolder(std::move(platform_view))); - run_configuration.AddAssetResolver( - std::make_unique(fml::OpenFile( - settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); - - if (!embedder_engine->Run(std::move(run_configuration))) { - return kInvalidArguments; - } - - // Finally! Release the ownership of the embedder engine to the caller. - *engine_out = reinterpret_cast(embedder_engine.release()); return kSuccess; } @@ -233,9 +199,7 @@ FlutterResult FlutterEngineShutdown(FlutterEngine engine) { if (engine == nullptr) { return kInvalidArguments; } - auto embedder_engine = reinterpret_cast(engine); - embedder_engine->NotifyDestroyed(); - delete embedder_engine; + delete reinterpret_cast(engine); return kSuccess; } @@ -246,16 +210,21 @@ FlutterResult FlutterEngineSendWindowMetricsEvent( return kInvalidArguments; } + auto holder = reinterpret_cast(engine); + blink::ViewportMetrics metrics; metrics.physical_width = SAFE_ACCESS(flutter_metrics, width, 0.0); metrics.physical_height = SAFE_ACCESS(flutter_metrics, height, 0.0); metrics.device_pixel_ratio = SAFE_ACCESS(flutter_metrics, pixel_ratio, 1.0); - return reinterpret_cast(engine)->SetViewportMetrics( - std::move(metrics)) - ? kSuccess - : kInvalidArguments; + blink::Threads::UI()->PostTask( + [ weak_engine = holder->view()->engine().GetWeakPtr(), metrics ] { + if (auto engine = weak_engine) { + engine->SetViewportMetrics(metrics); + } + }); + return kSuccess; } inline blink::PointerData::Change ToPointerDataChange( @@ -298,10 +267,19 @@ FlutterResult FlutterEngineSendPointerEvent(FlutterEngine engine, reinterpret_cast(current) + current->struct_size); } - return reinterpret_cast(engine) - ->DispatchPointerDataPacket(std::move(packet)) - ? kSuccess - : kInvalidArguments; + blink::Threads::UI()->PostTask(fxl::MakeCopyable([ + weak_engine = reinterpret_cast(engine) + ->view() + ->engine() + .GetWeakPtr(), + packet = std::move(packet) + ] { + if (auto engine = weak_engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); + + return kSuccess; } FlutterResult FlutterEngineSendPlatformMessage( @@ -316,6 +294,8 @@ FlutterResult FlutterEngineSendPlatformMessage( return kInvalidArguments; } + auto holder = reinterpret_cast(engine); + auto message = fxl::MakeRefCounted( flutter_message->channel, std::vector( @@ -323,10 +303,13 @@ FlutterResult FlutterEngineSendPlatformMessage( flutter_message->message + flutter_message->message_size), nullptr); - return reinterpret_cast(engine)->SendPlatformMessage( - std::move(message)) - ? kSuccess - : kInvalidArguments; + blink::Threads::UI()->PostTask( + [ weak_engine = holder->view()->engine().GetWeakPtr(), message ] { + if (auto engine = weak_engine) { + engine->DispatchPlatformMessage(message); + } + }); + return kSuccess; } FlutterResult FlutterEngineSendPlatformMessageResponse( diff --git a/shell/platform/embedder/embedder_engine.cc b/shell/platform/embedder/embedder_engine.cc deleted file mode 100644 index 7416441d7902e..0000000000000 --- a/shell/platform/embedder/embedder_engine.cc +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2017 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/shell/platform/embedder/embedder_engine.h" - -#include "lib/fxl/functional/make_copyable.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace shell { - -EmbedderEngine::EmbedderEngine( - ThreadHost thread_host, - blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer) - : thread_host_(std::move(thread_host)), - shell_(Shell::Create(std::move(task_runners), - std::move(settings), - on_create_platform_view, - on_create_rasterizer)) { - is_valid_ = shell_ != nullptr; -} - -EmbedderEngine::~EmbedderEngine() = default; - -bool EmbedderEngine::IsValid() const { - return is_valid_; -} - -bool EmbedderEngine::NotifyCreated() { - if (!IsValid()) { - return false; - } - - shell_->GetPlatformView()->NotifyCreated(); - return true; -} - -bool EmbedderEngine::NotifyDestroyed() { - if (!IsValid()) { - return false; - } - - shell_->GetPlatformView()->NotifyDestroyed(); - return true; -} - -bool EmbedderEngine::Run(RunConfiguration run_configuration) { - if (!IsValid()) { - return false; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = shell_->GetEngine(), // engine - config = std::move(run_configuration) // config - ]() mutable { - if (engine) { - auto result = engine->Run(std::move(config)); - if (!result) { - FXL_LOG(ERROR) << "Could not launch the engine with configuration."; - } - } - })); - - return true; -} - -bool EmbedderEngine::SetViewportMetrics(blink::ViewportMetrics metrics) { - if (!IsValid()) { - return false; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = shell_->GetEngine(), metrics = std::move(metrics)]() { - if (engine) { - engine->SetViewportMetrics(std::move(metrics)); - } - }); - return true; -} - -bool EmbedderEngine::DispatchPointerDataPacket( - std::unique_ptr packet) { - if (!IsValid() || !packet) { - return false; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [engine = shell_->GetEngine(), packet = std::move(packet)] { - if (engine) { - engine->DispatchPointerDataPacket(*packet); - } - })); - - return true; -} - -bool EmbedderEngine::SendPlatformMessage( - fxl::RefPtr message) { - if (!IsValid() || !message) { - return false; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = shell_->GetEngine(), message] { - if (engine) { - engine->DispatchPlatformMessage(message); - } - }); - - return true; -} - -} // namespace shell diff --git a/shell/platform/embedder/embedder_engine.h b/shell/platform/embedder/embedder_engine.h deleted file mode 100644 index c01b86c2aac47..0000000000000 --- a/shell/platform/embedder/embedder_engine.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017 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_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ -#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ - -#include - -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/thread_host.h" -#include "flutter/shell/platform/embedder/embedder.h" -#include "lib/fxl/macros.h" - -namespace shell { - -// The object that is returned to the embedder as an opaque pointer to the -// instance of the Flutter engine. -class EmbedderEngine { - public: - EmbedderEngine(ThreadHost thread_host, blink::TaskRunners task_runners, - blink::Settings settings, - Shell::CreateCallback on_create_platform_view, - Shell::CreateCallback on_create_rasterizer); - - ~EmbedderEngine(); - - bool NotifyCreated(); - - bool NotifyDestroyed(); - - bool Run(RunConfiguration run_configuration); - - bool IsValid() const; - - bool SetViewportMetrics(blink::ViewportMetrics metrics); - - bool DispatchPointerDataPacket( - std::unique_ptr packet); - - bool SendPlatformMessage(fxl::RefPtr message); - - private: - const ThreadHost thread_host_; - std::unique_ptr shell_; - bool is_valid_ = false; - - FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderEngine); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ diff --git a/shell/platform/embedder/platform_view_embedder.cc b/shell/platform/embedder/platform_view_embedder.cc index db1bea35c691e..46e0390770da4 100644 --- a/shell/platform/embedder/platform_view_embedder.cc +++ b/shell/platform/embedder/platform_view_embedder.cc @@ -3,18 +3,17 @@ // found in the LICENSE file. #include "flutter/shell/platform/embedder/platform_view_embedder.h" - -#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/gpu/gpu_rasterizer.h" namespace shell { -PlatformViewEmbedder::PlatformViewEmbedder(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - DispatchTable dispatch_table) - : PlatformView(delegate, std::move(task_runners)), +PlatformViewEmbedder::PlatformViewEmbedder(DispatchTable dispatch_table) + : PlatformView(std::make_unique(nullptr)), dispatch_table_(dispatch_table) {} -PlatformViewEmbedder::~PlatformViewEmbedder() = default; +PlatformViewEmbedder::~PlatformViewEmbedder() { + NotifyDestroyed(); +} bool PlatformViewEmbedder::GLContextMakeCurrent() { return dispatch_table_.gl_make_current_callback(); @@ -32,6 +31,33 @@ intptr_t PlatformViewEmbedder::GLContextFBO() const { return dispatch_table_.gl_fbo_callback(); } +void PlatformViewEmbedder::Attach() { + CreateEngine(); + NotifyCreated(std::make_unique(this)); + + if (dispatch_table_.gl_make_resource_current_callback != nullptr) { + SetupResourceContextOnIOThread(); + } +} + +bool PlatformViewEmbedder::ResourceContextMakeCurrent() { + if (dispatch_table_.gl_make_resource_current_callback == nullptr) { + return false; + } + return dispatch_table_.gl_make_resource_current_callback(); +} + +void PlatformViewEmbedder::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) { + FXL_LOG(INFO) << "Hot reloading is unsupported on this platform."; +} + +void PlatformViewEmbedder::SetAssetBundlePath( + const std::string& assets_directory) { + FXL_LOG(INFO) << "Set asset bundle path is unsupported on this platform."; +} + void PlatformViewEmbedder::HandlePlatformMessage( fxl::RefPtr message) { if (!message) { @@ -50,17 +76,4 @@ void PlatformViewEmbedder::HandlePlatformMessage( dispatch_table_.platform_message_response_callback(std::move(message)); } -std::unique_ptr PlatformViewEmbedder::CreateRenderingSurface() { - return std::make_unique(this); -} - -sk_sp PlatformViewEmbedder::CreateResourceContext() const { - auto callback = dispatch_table_.gl_make_resource_current_callback; - if (callback && callback()) { - return IOManager::CreateCompatibleResourceLoadingContext( - GrBackend::kOpenGL_GrBackend); - } - return nullptr; -} - } // namespace shell diff --git a/shell/platform/embedder/platform_view_embedder.h b/shell/platform/embedder/platform_view_embedder.h index a5b76dfaa07ba..c287fc5ac86f1 100644 --- a/shell/platform/embedder/platform_view_embedder.h +++ b/shell/platform/embedder/platform_view_embedder.h @@ -12,8 +12,7 @@ namespace shell { -class PlatformViewEmbedder final : public PlatformView, - public GPUSurfaceGLDelegate { +class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { public: using PlatformMessageResponseCallback = std::function)>; @@ -27,11 +26,9 @@ class PlatformViewEmbedder final : public PlatformView, std::function gl_make_resource_current_callback; // optional }; - PlatformViewEmbedder(PlatformView::Delegate& delegate, - blink::TaskRunners task_runners, - DispatchTable dispatch_table); + PlatformViewEmbedder(DispatchTable dispatch_table); - ~PlatformViewEmbedder() override; + ~PlatformViewEmbedder(); // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; @@ -46,17 +43,25 @@ class PlatformViewEmbedder final : public PlatformView, intptr_t GLContextFBO() const override; // |shell::PlatformView| - void HandlePlatformMessage( - fxl::RefPtr message) override; + void Attach() override; - private: - DispatchTable dispatch_table_; + // |shell::PlatformView| + bool ResourceContextMakeCurrent() override; + + // |shell::PlatformView| + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; + void SetAssetBundlePath(const std::string& assets_directory) override; // |shell::PlatformView| - sk_sp CreateResourceContext() const override; + void HandlePlatformMessage( + fxl::RefPtr message) override; + + private: + DispatchTable dispatch_table_; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewEmbedder); }; diff --git a/shell/platform/linux/BUILD.gn b/shell/platform/linux/BUILD.gn new file mode 100644 index 0000000000000..6e9f1f596b09d --- /dev/null +++ b/shell/platform/linux/BUILD.gn @@ -0,0 +1,23 @@ +# Copyright 2016 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. + +executable("linux") { + output_name = "flutter_tester" + + sources = [ + "main_linux.cc", + ] + + deps = [ + "//third_party/dart/runtime:libdart_jit", + "//third_party/dart/runtime/bin:embedded_dart_io", + "$flutter_root/common", + "$flutter_root/fml", + "$flutter_root/shell/common", + "$flutter_root/shell/testing", + "//garnet/public/lib/fxl", + "//third_party/skia", + "//topaz/lib/tonic", + ] +} diff --git a/shell/platform/linux/main_linux.cc b/shell/platform/linux/main_linux.cc new file mode 100644 index 0000000000000..a20d425ed1eed --- /dev/null +++ b/shell/platform/linux/main_linux.cc @@ -0,0 +1,142 @@ +// Copyright 2015 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. + +#include "flutter/common/threads.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/testing/test_runner.h" +#include "flutter/shell/testing/testing.h" +#include "flutter/sky/engine/public/web/Sky.h" +#include "lib/fxl/command_line.h" +#include "lib/tonic/dart_microtask_queue.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +namespace { + +// Exit codes used by the Dart command line tool. +const int kApiErrorExitCode = 253; +const int kCompilationErrorExitCode = 254; +const int kErrorExitCode = 255; + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver : public fml::TaskObserver { + public: + ScriptCompletionTaskObserver(fxl::RefPtr task_runner) + : main_task_runner_(std::move(task_runner)), + prev_live_(false), + last_error_(tonic::kNoError) {} + + void DidProcessTask() override { + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + shell::Engine& engine = test_runner.platform_view().engine(); + + if (engine.GetLoadScriptError() != tonic::kNoError) { + last_error_ = engine.GetLoadScriptError(); + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + return; + } + + bool live = engine.UIIsolateHasLivePorts(); + if (prev_live_ && !live) { + last_error_ = engine.GetUIIsolateLastError(); + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + prev_live_ = live; + } + + tonic::DartErrorHandleType last_error() { return last_error_; } + + private: + fxl::RefPtr main_task_runner_; + bool prev_live_; + tonic::DartErrorHandleType last_error_; +}; + +int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { + switch (error) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } +} + +void RunNonInteractive(fxl::CommandLine initial_command_line, + bool run_forever) { + // This is a platform thread (i.e not one created by fml::Thread), so perform + // one time initialization. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + std::string bundle_path = ""; + initial_command_line.GetOptionValue( + FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); + + shell::Shell::InitStandalone(initial_command_line, + /* icu_data_path= */ "", + /* application_library_path= */ "", bundle_path); + + // Note that this task observer must be added after the observer that drains + // the microtask queue. + ScriptCompletionTaskObserver task_observer( + fml::MessageLoop::GetCurrent().GetTaskRunner()); + if (!run_forever) { + blink::Threads::UI()->PostTask([&task_observer] { + fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); + }); + } + + if (!shell::InitForTesting(initial_command_line)) { + shell::PrintUsage("flutter_tester"); + exit(EXIT_FAILURE); + return; + } + + fml::MessageLoop::GetCurrent().Run(); + + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + tonic::DartErrorHandleType error = + test_runner.platform_view().engine().GetLoadScriptError(); + if (error == tonic::kNoError) + error = task_observer.last_error(); + if (error == tonic::kNoError) { + fxl::AutoResetWaitableEvent latch; + blink::Threads::UI()->PostTask([&error, &latch] { + error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); + latch.Signal(); + }); + latch.Wait(); + } + + // The script has completed and the engine may not be in a clean state, + // so just stop the process. + exit(ConvertErrorTypeToExitCode(error)); +} + +} // namespace + +int main(int argc, char* argv[]) { + dart::bin::SetExecutableName(argv[0]); + dart::bin::SetExecutableArguments(argc - 1, argv); + + auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); + + if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { + shell::PrintUsage("flutter_tester"); + return EXIT_SUCCESS; + } + + bool run_forever = + command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); + RunNonInteractive(std::move(command_line), run_forever); + return EXIT_SUCCESS; +} diff --git a/shell/platform/win/BUILD.gn b/shell/platform/win/BUILD.gn new file mode 100644 index 0000000000000..b4a2fe5033c18 --- /dev/null +++ b/shell/platform/win/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright 2016 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. + +executable("win") { + output_name = "flutter_tester" + + sources = [ + "main_win.cc", + ] + + deps = [ + "//flutter/common", + "//flutter/flow", + "//flutter/fml", + "//flutter/shell/common", + "//flutter/shell/testing", + "//flutter/sky/engine/wtf", + "//garnet/public/lib/fxl", + "//third_party/dart/runtime/bin:embedded_dart_io", + "//third_party/dart/runtime:libdart_jit", + "//third_party/skia", + "//topaz/lib/tonic", + ] + + libs = [ + "iphlpapi.lib", + "Rpcrt4.lib" + ] +} diff --git a/shell/platform/win/main_win.cc b/shell/platform/win/main_win.cc new file mode 100644 index 0000000000000..c31c88ca915cb --- /dev/null +++ b/shell/platform/win/main_win.cc @@ -0,0 +1,142 @@ +// Copyright 2015 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. + +#include + +#include "flutter/common/threads.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/testing/test_runner.h" +#include "flutter/shell/testing/testing.h" +#include "lib/fxl/command_line.h" +#include "lib/tonic/dart_microtask_queue.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +namespace { + +// Exit codes used by the Dart command line tool. +const int kApiErrorExitCode = 253; +const int kCompilationErrorExitCode = 254; +const int kErrorExitCode = 255; + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver : public fml::TaskObserver { + public: + ScriptCompletionTaskObserver(fxl::RefPtr task_runner) + : main_task_runner_(std::move(task_runner)), + prev_live_(false), + last_error_(tonic::kNoError) {} + + void DidProcessTask() override { + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + shell::Engine& engine = test_runner.platform_view().engine(); + + if (engine.GetLoadScriptError() != tonic::kNoError) { + last_error_ = engine.GetLoadScriptError(); + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + return; + } + + bool live = engine.UIIsolateHasLivePorts(); + if (prev_live_ && !live) { + last_error_ = engine.GetUIIsolateLastError(); + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + prev_live_ = live; + } + + tonic::DartErrorHandleType last_error() { return last_error_; } + + private: + fxl::RefPtr main_task_runner_; + bool prev_live_; + tonic::DartErrorHandleType last_error_; +}; + +int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { + switch (error) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } +} + +void RunNonInteractive(fxl::CommandLine initial_command_line, + bool run_forever) { + // This is a platform thread (i.e not one created by fml::Thread), so perform + // one time initialization. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + std::string bundle_path = ""; + initial_command_line.GetOptionValue( + FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); + + shell::Shell::InitStandalone(initial_command_line, + /* icu_data_path= */ "", + /* application_library_path= */ "", bundle_path); + + // Note that this task observer must be added after the observer that drains + // the microtask queue. + ScriptCompletionTaskObserver task_observer( + fml::MessageLoop::GetCurrent().GetTaskRunner()); + if (!run_forever) { + blink::Threads::UI()->PostTask([&task_observer] { + fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); + }); + } + + if (!shell::InitForTesting(initial_command_line)) { + shell::PrintUsage("flutter_tester"); + ::ExitProcess(EXIT_FAILURE); + return; + } + + fml::MessageLoop::GetCurrent().Run(); + shell::TestRunner& test_runner = shell::TestRunner::Shared(); + tonic::DartErrorHandleType error = + test_runner.platform_view().engine().GetLoadScriptError(); + if (error == tonic::kNoError) + error = task_observer.last_error(); + if (error == tonic::kNoError) { + fxl::AutoResetWaitableEvent latch; + blink::Threads::UI()->PostTask([&error, &latch] { + error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); + latch.Signal(); + }); + latch.Wait(); + } + + // The script has completed and the engine may not be in a clean state, + // so just stop the process. + ::ExitProcess(ConvertErrorTypeToExitCode(error)); +} + +} // namespace + +int main(int argc, char* argv[]) { + dart::bin::SetExecutableName(argv[0]); + dart::bin::SetExecutableArguments(argc - 1, argv); + + auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); + + if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { + shell::PrintUsage("flutter_tester"); + return EXIT_SUCCESS; + } + + bool run_forever = + command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); + RunNonInteractive(std::move(command_line), run_forever); + return EXIT_SUCCESS; +} diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index f11a3a2d07501..659c241cc49b8 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -2,30 +2,24 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -executable("testing") { - testonly = true - - output_name = "flutter_tester" - - public_configs = [ "$flutter_root:config" ] - +source_set("testing") { sources = [ - "tester_main.cc", + "platform_view_test.cc", + "platform_view_test.h", + "test_runner.cc", + "test_runner.h", + "testing.cc", + "testing.h", ] deps = [ - "$flutter_root/assets", "$flutter_root/common", - "$flutter_root/fml", "$flutter_root/shell/common", "//garnet/public/lib/fxl", - "//third_party/dart/runtime:libdart_jit", - "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", - "//topaz/lib/tonic", ] - if (is_linux) { - ldflags = [ "-rdynamic" ] - } + public_configs = [ + "$flutter_root:config", + ] } diff --git a/shell/testing/platform_view_test.cc b/shell/testing/platform_view_test.cc new file mode 100644 index 0000000000000..a59684d31bc94 --- /dev/null +++ b/shell/testing/platform_view_test.cc @@ -0,0 +1,32 @@ +// Copyright 2016 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. + +#include "flutter/shell/testing/platform_view_test.h" + +#include "flutter/shell/common/null_rasterizer.h" +#include "flutter/shell/common/shell.h" + +namespace shell { + +PlatformViewTest::PlatformViewTest() + : PlatformView(std::unique_ptr(new NullRasterizer())) {} + +void PlatformViewTest::Attach() { + CreateEngine(); +} + +PlatformViewTest::~PlatformViewTest() = default; + +bool PlatformViewTest::ResourceContextMakeCurrent() { + return false; +} + +void PlatformViewTest::RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) {} + +void PlatformViewTest::SetAssetBundlePath(const std::string& assets_directory) { +} + +} // namespace shell diff --git a/shell/testing/platform_view_test.h b/shell/testing/platform_view_test.h new file mode 100644 index 0000000000000..3612d0363ab58 --- /dev/null +++ b/shell/testing/platform_view_test.h @@ -0,0 +1,38 @@ +// Copyright 2016 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. + +#ifndef SHELL_TESTING_PLATFORM_VIEW_TEST_H_ +#define SHELL_TESTING_PLATFORM_VIEW_TEST_H_ + +#include "flutter/shell/common/platform_view.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace shell { + +class Shell; + +class PlatformViewTest : public PlatformView { + public: + PlatformViewTest(); + + ~PlatformViewTest(); + + virtual void Attach() override; + + bool ResourceContextMakeCurrent() override; + + void RunFromSource(const std::string& assets_directory, + const std::string& main, + const std::string& packages) override; + + void SetAssetBundlePath(const std::string& assets_directory) override; + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewTest); +}; + +} // namespace shell + +#endif // SHELL_TESTING_PLATFORM_VIEW_TEST_H_ diff --git a/shell/testing/test_runner.cc b/shell/testing/test_runner.cc new file mode 100644 index 0000000000000..838b04120c773 --- /dev/null +++ b/shell/testing/test_runner.cc @@ -0,0 +1,48 @@ +// Copyright 2014 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. + +#include "flutter/shell/testing/test_runner.h" + +#include + +#include "flutter/common/threads.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/testing/platform_view_test.h" + +namespace shell { + +TestRunner::TestRunner() + : platform_view_(std::make_shared()) { + platform_view_->Attach(); + blink::ViewportMetrics metrics; + metrics.device_pixel_ratio = 3.0; + metrics.physical_width = 2400; // 800 at 3x resolution + metrics.physical_height = 1800; // 600 at 3x resolution + + blink::Threads::UI()->PostTask( + [ engine = platform_view_->engine().GetWeakPtr(), metrics ] { + if (engine) + engine->SetViewportMetrics(metrics); + }); +} + +TestRunner::~TestRunner() = default; + +TestRunner& TestRunner::Shared() { + static TestRunner* g_test_runner = nullptr; + if (!g_test_runner) + g_test_runner = new TestRunner(); + return *g_test_runner; +} + +void TestRunner::Run(const TestDescriptor& test) { + blink::Threads::UI()->PostTask( + [ engine = platform_view_->engine().GetWeakPtr(), test ] { + if (engine) + engine->RunBundleAndSource(std::string(), test.path, test.packages); + }); +} + +} // namespace shell diff --git a/shell/testing/test_runner.h b/shell/testing/test_runner.h new file mode 100644 index 0000000000000..8f303d7eb7683 --- /dev/null +++ b/shell/testing/test_runner.h @@ -0,0 +1,42 @@ +// Copyright 2015 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. + +#ifndef SHELL_TESTING_TEST_RUNNER_H_ +#define SHELL_TESTING_TEST_RUNNER_H_ + +#include +#include + +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace shell { + +class PlatformView; + +class TestRunner { + public: + static TestRunner& Shared(); + + struct TestDescriptor { + std::string path; + std::string packages; + }; + + void Run(const TestDescriptor& test); + + PlatformView& platform_view() { return *platform_view_; } + + private: + TestRunner(); + ~TestRunner(); + + std::shared_ptr platform_view_; + + FXL_DISALLOW_COPY_AND_ASSIGN(TestRunner); +}; + +} // namespace shell + +#endif // SHELL_TESTING_TEST_RUNNER_H_ diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc deleted file mode 100644 index a9e7bafc74d93..0000000000000 --- a/shell/testing/tester_main.cc +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2018 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 - -#include "flutter/assets/asset_manager.h" -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/fml/file.h" -#include "flutter/fml/message_loop.h" -#include "flutter/fml/paths.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/common/thread_host.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -#ifdef ERROR -#undef ERROR -#endif - -namespace shell { - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver { - public: - ScriptCompletionTaskObserver(Shell& shell, - fxl::RefPtr main_task_runner, - bool run_forever) - : engine_(shell.GetEngine()), - main_task_runner_(std::move(main_task_runner)), - run_forever_(run_forever) {} - - int GetExitCodeForLastError() const { - // Exit codes used by the Dart command line tool. - const int kApiErrorExitCode = 253; - const int kCompilationErrorExitCode = 254; - const int kErrorExitCode = 255; - switch (last_error_) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } - } - - void DidProcessTask() { - if (engine_) { - last_error_ = engine_->GetUIIsolateLastError(); - if (engine_->UIIsolateHasLivePorts()) { - // The UI isolate still has live ports and is running. Nothing to do - // just yet. - return; - } - } - - if (run_forever_) { - // We need this script to run forever. We have already recorded the last - // error. Keep going. - return; - } - - if (!has_terminated) { - // Only try to terminate the loop once. - has_terminated = true; - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - } - - private: - fml::WeakPtr engine_; - fxl::RefPtr main_task_runner_; - bool run_forever_ = false; - tonic::DartErrorHandleType last_error_ = tonic::kUnknownErrorType; - bool has_terminated = false; - - FXL_DISALLOW_COPY_AND_ASSIGN(ScriptCompletionTaskObserver); -}; - -int RunTester(const blink::Settings& settings, bool run_forever) { - const auto thread_label = "io.flutter.test"; - - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); - - // Setup a single threaded test runner configuration. - const blink::TaskRunners task_runners(thread_label, // dart thread label - current_task_runner, // platform - current_task_runner, // gpu - current_task_runner, // ui - current_task_runner // io - ); - - Shell::CreateCallback on_create_platform_view = - [](Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); - }; - - Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { - return std::make_unique(shell.GetTaskRunners()); - }; - - auto shell = Shell::Create(task_runners, // - settings, // - on_create_platform_view, // - on_create_rasterizer // - ); - - if (!shell || !shell->IsSetup()) { - FXL_LOG(ERROR) << "Could not setup the shell."; - return EXIT_FAILURE; - } - - auto isolate_configuration = IsolateConfiguration::CreateForSource( - settings.main_dart_file_path, settings.packages_file_path); - - if (!isolate_configuration) { - FXL_LOG(ERROR) << "Could create isolate configuration."; - return EXIT_FAILURE; - } - - auto asset_manager = fxl::MakeRefCounted(); - asset_manager->PushBack(std::make_unique( - fml::Duplicate(settings.assets_dir))); - asset_manager->PushBack( - std::make_unique(fml::OpenFile( - settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); - - RunConfiguration run_configuration(std::move(isolate_configuration), - std::move(asset_manager)); - - // The script completion task observer that will be installed on the UI thread - // that watched if the engine has any live ports. - ScriptCompletionTaskObserver completion_observer( - *shell, // a valid shell - fml::MessageLoop::GetCurrent() - .GetTaskRunner(), // the message loop to terminate - run_forever // should the exit be ignored - ); - - bool engine_did_run = false; - - shell->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( - [&completion_observer, engine = shell->GetEngine(), - config = std::move(run_configuration), &engine_did_run]() mutable { - fml::MessageLoop::GetCurrent().AddTaskObserver( - reinterpret_cast(&completion_observer), - [&completion_observer]() { completion_observer.DidProcessTask(); }); - if (engine->Run(std::move(config))) { - engine_did_run = true; - - blink::ViewportMetrics metrics; - metrics.device_pixel_ratio = 3.0; - metrics.physical_width = 2400; // 800 at 3x resolution - metrics.physical_height = 1800; // 600 at 3x resolution - engine->SetViewportMetrics(metrics); - - } else { - FXL_DLOG(ERROR) << "Could not launch the engine with configuration."; - } - })); - - // Run the message loop and wait for the script to do its thing. - fml::MessageLoop::GetCurrent().Run(); - - // Cleanup the completion observer synchronously as it is living on the - // stack. - fxl::AutoResetWaitableEvent latch; - fml::TaskRunner::RunNowOrPostTask( - shell->GetTaskRunners().GetUITaskRunner(), - [&latch, &completion_observer] { - fml::MessageLoop::GetCurrent().RemoveTaskObserver( - reinterpret_cast(&completion_observer)); - latch.Signal(); - }); - latch.Wait(); - - if (!engine_did_run) { - // If the engine itself didn't have a chance to run, there is no point in - // asking it if there was an error. Signal a failure unconditionally. - return EXIT_FAILURE; - } - - return completion_observer.GetExitCodeForLastError(); -} - -} // namespace shell - -int main(int argc, char* argv[]) { - dart::bin::SetExecutableName(argv[0]); - dart::bin::SetExecutableArguments(argc - 1, argv); - - auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); - - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { - shell::PrintUsage("flutter_tester"); - return EXIT_SUCCESS; - } - - auto settings = shell::SettingsFromCommandLine(command_line); - if (command_line.positional_args().size() > 0) { - // The tester may not use the switch for the main dart file path. Specifying - // it as a positional argument instead. - settings.main_dart_file_path = command_line.positional_args()[0]; - } - - if (settings.main_dart_file_path.size() == 0) { - FXL_LOG(ERROR) << "Main dart file path not specified."; - return EXIT_FAILURE; - } - - settings.icu_data_path = "icudtl.dat"; - - settings.kernel_snapshot_path = - fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); - - // The tools that read logs get confused if there is a log tag specified. - settings.log_tag = ""; - - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { - fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); - }; - - settings.task_observer_remove = [](intptr_t key) { - fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); - }; - - return shell::RunTester( - settings, - command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever))); -} diff --git a/shell/testing/testing.cc b/shell/testing/testing.cc new file mode 100644 index 0000000000000..13a3ab5be3d93 --- /dev/null +++ b/shell/testing/testing.cc @@ -0,0 +1,24 @@ +// Copyright 2015 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. + +#include "flutter/shell/testing/testing.h" + +#include "flutter/shell/common/switches.h" +#include "flutter/shell/testing/test_runner.h" + +namespace shell { + +bool InitForTesting(const fxl::CommandLine& command_line) { + TestRunner::TestDescriptor test; + test.packages = command_line.GetOptionValueWithDefault( + FlagForSwitch(Switch::Packages), ""); + auto args = command_line.positional_args(); + if (args.empty()) + return false; + test.path = args[0]; + TestRunner::Shared().Run(test); + return true; +} + +} // namespace shell diff --git a/shell/testing/testing.h b/shell/testing/testing.h new file mode 100644 index 0000000000000..99f8b4fe983de --- /dev/null +++ b/shell/testing/testing.h @@ -0,0 +1,16 @@ +// Copyright 2015 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. + +#ifndef SHELL_TESTING_TESTING_H_ +#define SHELL_TESTING_TESTING_H_ + +#include "lib/fxl/command_line.h" + +namespace shell { + +bool InitForTesting(const fxl::CommandLine& command_line); + +} // namespace shell + +#endif // SHELL_TESTING_TESTING_H_ diff --git a/sky/engine/platform/SharedBuffer.cpp b/sky/engine/platform/SharedBuffer.cpp index bc94f22e97ce6..8577ab16f2938 100644 --- a/sky/engine/platform/SharedBuffer.cpp +++ b/sky/engine/platform/SharedBuffer.cpp @@ -26,6 +26,7 @@ #include "flutter/sky/engine/platform/SharedBuffer.h" +#include "flutter/common/threads.h" #include "flutter/sky/engine/public/platform/Platform.h" #include "flutter/sky/engine/wtf/unicode/UTF8.h" #include "flutter/sky/engine/wtf/unicode/Unicode.h" diff --git a/sky/engine/platform/fonts/FontFallbackList.cpp b/sky/engine/platform/fonts/FontFallbackList.cpp index 4786d65e0d7ad..177f161adaa7e 100644 --- a/sky/engine/platform/fonts/FontFallbackList.cpp +++ b/sky/engine/platform/fonts/FontFallbackList.cpp @@ -37,11 +37,6 @@ namespace blink { -bool gUseTestFonts = false; -void FontFallbackList::SetUseTestFonts(bool useTestFonts) { - gUseTestFonts = useTestFonts; -} - FontFallbackList::FontFallbackList() : m_pageZero(0), m_cachedPrimarySimpleFontData(0), @@ -50,8 +45,7 @@ FontFallbackList::FontFallbackList() m_familyIndex(0), m_generation(FontCache::fontCache()->generation()), m_pitch(UnknownPitch), - m_hasLoadingFallback(false), - m_useTestFonts(gUseTestFonts) {} + m_hasLoadingFallback(false) {} void FontFallbackList::invalidate(PassRefPtr fontSelector) { releaseFontData(); @@ -199,7 +193,7 @@ PassRefPtr FontFallbackList::getFontData( const FontFamily* currFamily = startFamily; while (currFamily && !result) { familyIndex++; - if (currFamily->family().length() || m_useTestFonts) { + if (currFamily->family().length() || Settings::Get().use_test_fonts) { if (m_fontSelector) result = m_fontSelector->getFontData(fontDescription, currFamily->family()); diff --git a/sky/engine/platform/fonts/FontFallbackList.h b/sky/engine/platform/fonts/FontFallbackList.h index 3331387968edc..fdac27e5013bd 100644 --- a/sky/engine/platform/fonts/FontFallbackList.h +++ b/sky/engine/platform/fonts/FontFallbackList.h @@ -103,8 +103,6 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { m_pageZero = node; } - static void SetUseTestFonts(bool useTestFonts); - private: FontFallbackList(); @@ -127,7 +125,6 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { unsigned short m_generation; mutable unsigned m_pitch : 3; // Pitch mutable bool m_hasLoadingFallback : 1; - bool m_useTestFonts = false; }; } // namespace blink diff --git a/sky/engine/web/Sky.cpp b/sky/engine/web/Sky.cpp index 52c6243743d7b..e90539e96cf87 100644 --- a/sky/engine/web/Sky.cpp +++ b/sky/engine/web/Sky.cpp @@ -53,6 +53,56 @@ namespace blink { +namespace { + +void didProcessTask() { + tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); + // FIXME: Report memory usage to dart? +} + +#if defined(OS_FUCHSIA) + +void addMessageLoopObservers() { + fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback(didProcessTask); +} + +void removeMessageLoopObservers() { + fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); +} + +#else // defined(OS_FUCHSIA) + +class RunMicrotasksTaskObserver : public fml::TaskObserver { + public: + RunMicrotasksTaskObserver() = default; + + ~RunMicrotasksTaskObserver() override = default; + + void DidProcessTask() override { didProcessTask(); } +}; + +// FIXME(chinmaygarde): The awkward use of the global here is be cause we cannot +// introduce the fml::TaskObserver subclass in common code because Fuchsia does +// not support the same. Unify the API and remove hack. +static RunMicrotasksTaskObserver* g_run_microtasks_task_observer = nullptr; + +void addMessageLoopObservers() { + g_run_microtasks_task_observer = new RunMicrotasksTaskObserver(); + fml::MessageLoop::GetCurrent().AddTaskObserver( + g_run_microtasks_task_observer); +} + +void removeMessageLoopObservers() { + fml::MessageLoop::GetCurrent().RemoveTaskObserver( + g_run_microtasks_task_observer); + delete g_run_microtasks_task_observer; + g_run_microtasks_task_observer = nullptr; +} + +#endif // defined(OS_FUCHSIA) + +} // namespace + // Make sure we are not re-initialized in the same address space. // Doing so may cause hard to reproduce crashes. static bool s_webKitInitialized = false; @@ -80,9 +130,15 @@ void InitEngine(Platform* platform) { // the initialization thread-safe, but given that so many code paths use // this, initializing this lazily probably doesn't buy us much. WTF::UTF8Encoding(); + + tonic::DartMicrotaskQueue::StartForCurrentThread(); + addMessageLoopObservers(); } void ShutdownEngine() { + removeMessageLoopObservers(); + tonic::DartMicrotaskQueue::GetForCurrentThread()->Destroy(); + // FIXME: Shutdown dart? CoreInitializer::shutdown(); diff --git a/synchronization/BUILD.gn b/synchronization/BUILD.gn index 9ee7680cc1160..977a571c8da30 100644 --- a/synchronization/BUILD.gn +++ b/synchronization/BUILD.gn @@ -4,13 +4,16 @@ source_set("synchronization") { sources = [ + "debug_thread_checker.h", "pipeline.cc", "pipeline.h", "semaphore.cc", "semaphore.h", ] - public_configs = [ "$flutter_root:config" ] + public_configs = [ + "$flutter_root:config", + ] public_deps = [ "$flutter_root/glue", diff --git a/synchronization/debug_thread_checker.h b/synchronization/debug_thread_checker.h new file mode 100644 index 0000000000000..69614eb89d217 --- /dev/null +++ b/synchronization/debug_thread_checker.h @@ -0,0 +1,25 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ +#define FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ + +#ifndef NDEBUG + +#include +#include "lib/fxl/synchronization/thread_checker.h" + +#define FLUTTER_THREAD_CHECKER_DECLARE(x) ::fxl::ThreadChecker x; + +#define FLUTTER_THREAD_CHECKER_CHECK(x) FXL_CHECK(x.IsCreationThreadCurrent()); + +#else // NDEBUG + +#define FLUTTER_THREAD_CHECKER_DECLARE(x) + +#define FLUTTER_THREAD_CHECKER_CHECK(x) + +#endif // NDEBUG + +#endif // FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ diff --git a/synchronization/semaphore.cc b/synchronization/semaphore.cc index 4dc5f6220e350..c6e0bdf9e2d53 100644 --- a/synchronization/semaphore.cc +++ b/synchronization/semaphore.cc @@ -15,12 +15,9 @@ namespace flutter { class PlatformSemaphore { public: explicit PlatformSemaphore(uint32_t count) - : _sem(dispatch_semaphore_create(count)), _initial(count) {} + : _sem(dispatch_semaphore_create(count)) {} ~PlatformSemaphore() { - for (uint32_t i = 0; i < _initial; ++i) { - Signal(); - } if (_sem != nullptr) { dispatch_release(reinterpret_cast(_sem)); _sem = nullptr; @@ -45,7 +42,6 @@ class PlatformSemaphore { private: dispatch_semaphore_t _sem; - const uint32_t _initial; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; diff --git a/testing/BUILD.gn b/testing/BUILD.gn index a65311bfaeb7c..3927e71cfc0e4 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -9,13 +9,9 @@ source_set("testing") { "$flutter_root/testing/run_all_unittests.cc", "$flutter_root/testing/testing.cc", "$flutter_root/testing/testing.h", - "$flutter_root/testing/thread_test.cc", - "$flutter_root/testing/thread_test.h", ] public_deps = [ - "$flutter_root/fml", - "//garnet/public/lib/fxl", "//third_party/googletest:gtest", ] diff --git a/testing/thread_test.cc b/testing/thread_test.cc deleted file mode 100644 index 1306f37678fbe..0000000000000 --- a/testing/thread_test.cc +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2017 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/testing/thread_test.h" - -namespace testing { - -void ThreadTest::SetUp() { - thread_ = std::make_unique(); - thread_task_runner_ = thread_->GetTaskRunner(); - - fml::MessageLoop::EnsureInitializedForCurrentThread(); - current_task_runner_ = fml::MessageLoop::GetCurrent().GetTaskRunner(); -} - -void ThreadTest::TearDown() { - thread_task_runner_ = nullptr; - thread_ = nullptr; - current_task_runner_ = nullptr; -} - -fxl::RefPtr ThreadTest::GetCurrentTaskRunner() { - return current_task_runner_; -} - -fxl::RefPtr ThreadTest::GetThreadTaskRunner() { - return thread_task_runner_; -} - -} // namespace testing diff --git a/testing/thread_test.h b/testing/thread_test.h deleted file mode 100644 index 511d09c978858..0000000000000 --- a/testing/thread_test.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 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_TESTING_THREAD_TEST_H_ -#define FLUTTER_TESTING_THREAD_TEST_H_ - -#include - -#include "flutter/fml/message_loop.h" -#include "flutter/fml/task_runner.h" -#include "flutter/fml/thread.h" -#include "gtest/gtest.h" -#include "lib/fxl/macros.h" - -namespace testing { - -class ThreadTest : public Test { - public: - fxl::RefPtr GetCurrentTaskRunner(); - - fxl::RefPtr GetThreadTaskRunner(); - - protected: - void SetUp() override; - - void TearDown() override; - - private: - std::unique_ptr thread_; - fxl::RefPtr thread_task_runner_; - fxl::RefPtr current_task_runner_; -}; - -} // namespace testing - -#endif // FLUTTER_TESTING_THREAD_TEST_H_ diff --git a/tools/gn b/tools/gn index b4b15f99f1d4f..ea7071ac0a474 100755 --- a/tools/gn +++ b/tools/gn @@ -232,10 +232,6 @@ def main(argv): # On the Mac, also generate Xcode projects for ease of editing. command.append('--ide=xcode') - if sys.platform.startswith('win'): - # On Windows, also generate Visual Studio project for ease of editing. - command.append('--ide=vs') - gn_args = to_command_line(to_gn_args(args)) out_dir = get_out_dir(args) print "gn gen --check in %s" % out_dir diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index b15c608425095..8749f6880dbf4 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -1059,10 +1059,14 @@ USED LICENSES: ==================================================================================================== LIBRARY: engine LIBRARY: txt -ORIGIN: ../../../flutter/content_handler/session_connection.cc + ../../../LICENSE +ORIGIN: ../../../flutter/content_handler/service_protocol_hooks.cc + ../../../LICENSE TYPE: LicenseType.bsd +FILE: ../../../flutter/content_handler/service_protocol_hooks.cc +FILE: ../../../flutter/content_handler/service_protocol_hooks.h FILE: ../../../flutter/content_handler/session_connection.cc FILE: ../../../flutter/content_handler/session_connection.h +FILE: ../../../flutter/content_handler/vulkan_rasterizer.cc +FILE: ../../../flutter/content_handler/vulkan_rasterizer.h FILE: ../../../flutter/content_handler/vulkan_surface_producer.cc FILE: ../../../flutter/content_handler/vulkan_surface_producer.h FILE: ../../../flutter/flow/debug_print.cc @@ -1122,6 +1126,7 @@ FILE: ../../../flutter/fml/platform/win/mapping_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.h FILE: ../../../flutter/fml/platform/win/paths_win.cc +FILE: ../../../flutter/fml/task_observer.h FILE: ../../../flutter/fml/task_runner.cc FILE: ../../../flutter/fml/task_runner.h FILE: ../../../flutter/fml/thread.cc @@ -1137,10 +1142,13 @@ FILE: ../../../flutter/lib/ui/painting/codec.cc FILE: ../../../flutter/lib/ui/painting/codec.h FILE: ../../../flutter/lib/ui/painting/frame_info.cc FILE: ../../../flutter/lib/ui/painting/frame_info.h +FILE: ../../../flutter/lib/ui/painting/utils.cc FILE: ../../../flutter/lib/ui/painting/vertices.cc FILE: ../../../flutter/lib/ui/painting/vertices.h FILE: ../../../flutter/lib/ui/text/font_collection.cc FILE: ../../../flutter/lib/ui/text/font_collection.h +FILE: ../../../flutter/shell/common/null_platform_view.cc +FILE: ../../../flutter/shell/common/null_platform_view.h FILE: ../../../flutter/shell/gpu/gpu_surface_software.cc FILE: ../../../flutter/shell/gpu/gpu_surface_software.h FILE: ../../../flutter/shell/platform/android/android_external_texture_gl.cc @@ -1187,6 +1195,8 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandar FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_standard_codec_unittest.mm FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.h FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -1553,6 +1563,7 @@ FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc FILE: ../../../flutter/shell/platform/android/apk_asset_provider.cc FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/JSONUtil.java FILE: ../../../flutter/shell/platform/darwin/desktop/Info.plist +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_mac.xib FILE: ../../../flutter/shell/platform/darwin/ios/framework/Flutter.podspec FILE: ../../../flutter/shell/platform/darwin/ios/framework/Info.plist FILE: ../../../flutter/shell/platform/darwin/ios/framework/module.modulemap @@ -1627,48 +1638,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/assets/asset_manager.cc + ../../../LICENSE +ORIGIN: ../../../flutter/assets/asset_provider.h + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/assets/asset_manager.cc -FILE: ../../../flutter/assets/asset_manager.h -FILE: ../../../flutter/assets/asset_resolver.h -FILE: ../../../flutter/common/task_runners.cc -FILE: ../../../flutter/common/task_runners.h -FILE: ../../../flutter/flow/layers/default_layer_builder.cc -FILE: ../../../flutter/flow/layers/default_layer_builder.h -FILE: ../../../flutter/flow/layers/layer_builder.cc -FILE: ../../../flutter/flow/layers/layer_builder.h -FILE: ../../../flutter/flow/skia_gpu_object.cc -FILE: ../../../flutter/flow/skia_gpu_object.h -FILE: ../../../flutter/runtime/dart_isolate.cc -FILE: ../../../flutter/runtime/dart_isolate.h -FILE: ../../../flutter/runtime/dart_isolate_unittests.cc -FILE: ../../../flutter/runtime/dart_snapshot.cc -FILE: ../../../flutter/runtime/dart_snapshot.h -FILE: ../../../flutter/runtime/dart_snapshot_buffer.cc -FILE: ../../../flutter/runtime/dart_snapshot_buffer.h -FILE: ../../../flutter/runtime/dart_vm.cc -FILE: ../../../flutter/runtime/dart_vm.h -FILE: ../../../flutter/runtime/dart_vm_unittests.cc -FILE: ../../../flutter/runtime/service_protocol.cc -FILE: ../../../flutter/runtime/service_protocol.h -FILE: ../../../flutter/shell/common/io_manager.cc -FILE: ../../../flutter/shell/common/io_manager.h -FILE: ../../../flutter/shell/common/run_configuration.cc -FILE: ../../../flutter/shell/common/run_configuration.h -FILE: ../../../flutter/shell/common/shell_unittests.cc -FILE: ../../../flutter/shell/common/thread_host.cc -FILE: ../../../flutter/shell/common/thread_host.h -FILE: ../../../flutter/shell/platform/darwin/common/command_line.h -FILE: ../../../flutter/shell/platform/darwin/common/command_line.mm -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.mm -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h -FILE: ../../../flutter/shell/platform/embedder/embedder.h -FILE: ../../../flutter/shell/platform/embedder/embedder_engine.cc -FILE: ../../../flutter/shell/platform/embedder/embedder_engine.h +FILE: ../../../flutter/assets/asset_provider.h +FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart +FILE: ../../../flutter/lib/ui/painting/image_encoding.cc +FILE: ../../../flutter/lib/ui/painting/image_encoding.h +FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm ---------------------------------------------------------------------------------------------------- -Copyright 2017 The Flutter Authors. All rights reserved. +Copyright 2018 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1703,10 +1683,23 @@ ORIGIN: ../../../flutter/assets/directory_asset_bundle.cc + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/assets/directory_asset_bundle.cc FILE: ../../../flutter/assets/directory_asset_bundle.h +FILE: ../../../flutter/assets/unzipper_provider.cc +FILE: ../../../flutter/assets/unzipper_provider.h FILE: ../../../flutter/assets/zip_asset_store.cc FILE: ../../../flutter/assets/zip_asset_store.h FILE: ../../../flutter/common/settings.cc FILE: ../../../flutter/common/settings.h +FILE: ../../../flutter/common/threads.cc +FILE: ../../../flutter/common/threads.h +FILE: ../../../flutter/content_handler/app.cc +FILE: ../../../flutter/content_handler/app.h +FILE: ../../../flutter/content_handler/application_controller_impl.cc +FILE: ../../../flutter/content_handler/application_controller_impl.h +FILE: ../../../flutter/content_handler/main.cc +FILE: ../../../flutter/content_handler/rasterizer.cc +FILE: ../../../flutter/content_handler/rasterizer.h +FILE: ../../../flutter/content_handler/runtime_holder.cc +FILE: ../../../flutter/content_handler/runtime_holder.h FILE: ../../../flutter/flow/export_node.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.h @@ -1714,6 +1707,7 @@ FILE: ../../../flutter/flow/layers/child_scene_layer.cc FILE: ../../../flutter/flow/layers/child_scene_layer.h FILE: ../../../flutter/flow/layers/shader_mask_layer.cc FILE: ../../../flutter/flow/layers/shader_mask_layer.h +FILE: ../../../flutter/flow/process_info.h FILE: ../../../flutter/flow/raster_cache.cc FILE: ../../../flutter/flow/raster_cache.h FILE: ../../../flutter/flow/scene_update_context.cc @@ -1724,6 +1718,9 @@ FILE: ../../../flutter/glue/stack_trace_fuchsia.cc FILE: ../../../flutter/glue/trace_event.h FILE: ../../../flutter/lib/ui/painting/image_filter.cc FILE: ../../../flutter/lib/ui/painting/image_filter.h +FILE: ../../../flutter/lib/ui/painting/resource_context.cc +FILE: ../../../flutter/lib/ui/painting/resource_context.h +FILE: ../../../flutter/lib/ui/painting/utils.h FILE: ../../../flutter/lib/ui/semantics.dart FILE: ../../../flutter/lib/ui/semantics/semantics_node.cc FILE: ../../../flutter/lib/ui/semantics/semantics_node.h @@ -1745,13 +1742,18 @@ FILE: ../../../flutter/runtime/asset_font_selector.cc FILE: ../../../flutter/runtime/asset_font_selector.h FILE: ../../../flutter/runtime/embedder_resources.cc FILE: ../../../flutter/runtime/embedder_resources.h -FILE: ../../../flutter/runtime/fixtures/simple_main.dart +FILE: ../../../flutter/runtime/runtime_init.cc +FILE: ../../../flutter/runtime/runtime_init.h FILE: ../../../flutter/runtime/start_up.cc FILE: ../../../flutter/runtime/start_up.h FILE: ../../../flutter/runtime/test_font_data.cc FILE: ../../../flutter/runtime/test_font_data.h FILE: ../../../flutter/runtime/test_font_selector.cc FILE: ../../../flutter/runtime/test_font_selector.h +FILE: ../../../flutter/shell/common/null_rasterizer.cc +FILE: ../../../flutter/shell/common/null_rasterizer.h +FILE: ../../../flutter/shell/common/platform_view_service_protocol.cc +FILE: ../../../flutter/shell/common/platform_view_service_protocol.h FILE: ../../../flutter/shell/common/skia_event_tracer_impl.h FILE: ../../../flutter/shell/common/surface.cc FILE: ../../../flutter/shell/common/surface.h @@ -1780,6 +1782,8 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/view/VsyncWaiter.java FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.cc FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.mm +FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.cc +FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.h FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h @@ -1788,6 +1792,8 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterMacros FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h @@ -1810,6 +1816,7 @@ FILE: ../../../flutter/sky/engine/platform/text/ICUError.cpp FILE: ../../../flutter/sky/engine/platform/text/ICUError.h FILE: ../../../flutter/sky/engine/platform/text/TextBox.h FILE: ../../../flutter/sky/packages/flutter_services/lib/empty.dart +FILE: ../../../flutter/synchronization/debug_thread_checker.h FILE: ../../../flutter/synchronization/pipeline.cc FILE: ../../../flutter/synchronization/pipeline.h FILE: ../../../flutter/synchronization/semaphore.cc @@ -1877,68 +1884,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/content_handler/application.cc + ../../../garnet/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../flutter/content_handler/application.cc -FILE: ../../../flutter/content_handler/application.h -FILE: ../../../flutter/content_handler/application_runner.cc -FILE: ../../../flutter/content_handler/application_runner.h -FILE: ../../../flutter/content_handler/compositor_context.cc -FILE: ../../../flutter/content_handler/compositor_context.h -FILE: ../../../flutter/content_handler/engine.cc -FILE: ../../../flutter/content_handler/engine.h -FILE: ../../../flutter/content_handler/isolate_configurator.cc -FILE: ../../../flutter/content_handler/isolate_configurator.h -FILE: ../../../flutter/content_handler/main.cc -FILE: ../../../flutter/content_handler/platform_view.cc -FILE: ../../../flutter/content_handler/platform_view.h -FILE: ../../../flutter/content_handler/surface.cc -FILE: ../../../flutter/content_handler/surface.h -FILE: ../../../flutter/content_handler/task_observers.cc -FILE: ../../../flutter/content_handler/task_observers.h -FILE: ../../../flutter/content_handler/unique_fdio_ns.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart + ../../../LICENSE +ORIGIN: ../../../flutter/flow/layers/default_layer_builder.cc + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart -FILE: ../../../flutter/lib/ui/painting/image_encoding.cc -FILE: ../../../flutter/lib/ui/painting/image_encoding.h -FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +FILE: ../../../flutter/flow/layers/default_layer_builder.cc +FILE: ../../../flutter/flow/layers/default_layer_builder.h +FILE: ../../../flutter/flow/layers/layer_builder.cc +FILE: ../../../flutter/flow/layers/layer_builder.h +FILE: ../../../flutter/shell/platform/embedder/embedder.h ---------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. +Copyright 2017 The Flutter Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -2003,62 +1957,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../flutter/fml/file.h -FILE: ../../../flutter/fml/macros.h -FILE: ../../../flutter/fml/mapping.cc -FILE: ../../../flutter/fml/native_library.h -FILE: ../../../flutter/fml/paths.cc -FILE: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc -FILE: ../../../flutter/fml/platform/posix/file_posix.cc -FILE: ../../../flutter/fml/platform/posix/native_library_posix.cc -FILE: ../../../flutter/fml/platform/win/file_win.cc -FILE: ../../../flutter/fml/platform/win/native_library_win.cc -FILE: ../../../flutter/fml/platform/win/wstring_conversion.h -FILE: ../../../flutter/fml/unique_fd.cc -FILE: ../../../flutter/fml/unique_fd.h -FILE: ../../../flutter/fml/unique_object.h -FILE: ../../../flutter/shell/common/isolate_configuration.cc -FILE: ../../../flutter/shell/common/isolate_configuration.h -FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc -FILE: ../../../flutter/shell/platform/android/android_shell_holder.h -FILE: ../../../flutter/shell/platform/android/platform_message_response_android.cc -FILE: ../../../flutter/shell/platform/android/platform_message_response_android.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: engine ORIGIN: ../../../flutter/lib/ui/painting/image.cc + ../../../LICENSE @@ -9975,6 +9873,10 @@ FILE: ../../../flutter/lib/ui/window.dart FILE: ../../../flutter/lib/ui/window/pointer_data.cc FILE: ../../../flutter/lib/ui/window/pointer_data_packet.cc FILE: ../../../flutter/lib/ui/window/window.cc +FILE: ../../../flutter/runtime/dart_controller.cc +FILE: ../../../flutter/runtime/dart_controller.h +FILE: ../../../flutter/runtime/dart_init.cc +FILE: ../../../flutter/runtime/dart_init.h FILE: ../../../flutter/runtime/dart_service_isolate.cc FILE: ../../../flutter/runtime/dart_service_isolate.h FILE: ../../../flutter/runtime/platform_impl.cc @@ -9994,9 +9896,13 @@ FILE: ../../../flutter/shell/common/rasterizer.cc FILE: ../../../flutter/shell/common/rasterizer.h FILE: ../../../flutter/shell/common/shell.cc FILE: ../../../flutter/shell/common/shell.h +FILE: ../../../flutter/shell/common/tracing_controller.cc +FILE: ../../../flutter/shell/common/tracing_controller.h FILE: ../../../flutter/shell/common/vsync_waiter.cc FILE: ../../../flutter/shell/common/vsync_waiter.h FILE: ../../../flutter/shell/common/vsync_waiter_fallback.h +FILE: ../../../flutter/shell/gpu/gpu_rasterizer.cc +FILE: ../../../flutter/shell/gpu/gpu_rasterizer.h FILE: ../../../flutter/shell/platform/android/AndroidManifest.xml FILE: ../../../flutter/shell/platform/android/flutter_main.cc FILE: ../../../flutter/shell/platform/android/flutter_main.h @@ -10009,6 +9915,12 @@ FILE: ../../../flutter/shell/platform/android/library_loader.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h +FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.h +FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.mm +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.h +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.m +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.h +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.mm FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.h FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.mm FILE: ../../../flutter/shell/platform/darwin/desktop/main_mac.mm @@ -10018,6 +9930,8 @@ FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.cc FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +FILE: ../../../flutter/shell/platform/linux/main_linux.cc +FILE: ../../../flutter/shell/platform/win/main_win.cc FILE: ../../../flutter/sky/engine/wtf/Allocator.h FILE: ../../../flutter/sky/engine/wtf/MakeUnique.h ---------------------------------------------------------------------------------------------------- @@ -10054,7 +9968,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: engine ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/fml/memory/thread_checker.h FILE: ../../../flutter/fml/memory/weak_ptr.h FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc FILE: ../../../flutter/fml/memory/weak_ptr_internal.h @@ -10088,4 +10001,4 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -Total license count: 218 +Total license count: 216 From 9eec9848e902b564a53fe23684a992ce9a32d5d9 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 12 Apr 2018 10:40:59 -0700 Subject: [PATCH 0087/1190] libtxt: improvements to glyph cluster handling and grapheme breaking (#4978) * Extend Minikin to record the cluster identifier corresponding to each glyph * Use the cluster values to determine the range of input code units that map to a glyph * Use Minikin's libraries to find boundaries between graphemes within a ligature Fixes https://github.com/flutter/flutter/issues/16151 --- third_party/txt/src/minikin/Layout.cpp | 13 ++- third_party/txt/src/minikin/Layout.h | 5 ++ third_party/txt/src/txt/paragraph.cc | 119 ++++++++++++++----------- third_party/txt/src/txt/paragraph.h | 1 - 4 files changed, 81 insertions(+), 57 deletions(-) diff --git a/third_party/txt/src/minikin/Layout.cpp b/third_party/txt/src/minikin/Layout.cpp index 17a80910f8c46..aacfc4d374442 100644 --- a/third_party/txt/src/minikin/Layout.cpp +++ b/third_party/txt/src/minikin/Layout.cpp @@ -1076,7 +1076,9 @@ void Layout::doLayoutRun(const uint16_t* buf, float xoff = HBFixedToFloat(positions[i].x_offset); float yoff = -HBFixedToFloat(positions[i].y_offset); xoff += yoff * ctx->paint.skewX; - LayoutGlyph glyph = {font_ix, glyph_ix, x + xoff, y + yoff}; + LayoutGlyph glyph = { + font_ix, glyph_ix, x + xoff, y + yoff, + static_cast(info[i].cluster - clusterOffset)}; mGlyphs.push_back(glyph); float xAdvance = HBFixedToFloat(positions[i].x_advance); if ((ctx->paint.paintFlags & LinearTextFlag) == 0) { @@ -1137,7 +1139,8 @@ void Layout::appendLayout(Layout* src, size_t start, float extraAdvance) { unsigned int glyph_id = srcGlyph.glyph_id; float x = x0 + srcGlyph.x; float y = srcGlyph.y; - LayoutGlyph glyph = {font_ix, glyph_id, x, y}; + LayoutGlyph glyph = {font_ix, glyph_id, x, y, + static_cast(srcGlyph.cluster + start)}; mGlyphs.push_back(glyph); } for (size_t i = 0; i < src->mAdvances.size(); i++) { @@ -1174,6 +1177,12 @@ unsigned int Layout::getGlyphId(int i) const { return glyph.glyph_id; } +// libtxt extension +unsigned int Layout::getGlyphCluster(int i) const { + const LayoutGlyph& glyph = mGlyphs[i]; + return glyph.cluster; +} + float Layout::getX(int i) const { const LayoutGlyph& glyph = mGlyphs[i]; return glyph.x; diff --git a/third_party/txt/src/minikin/Layout.h b/third_party/txt/src/minikin/Layout.h index 3b60ef6817d1b..fe06e73ad69c5 100644 --- a/third_party/txt/src/minikin/Layout.h +++ b/third_party/txt/src/minikin/Layout.h @@ -37,6 +37,10 @@ struct LayoutGlyph { unsigned int glyph_id; float x; float y; + + // libtxt extension: record the cluster (character index) that corresponds + // to this glyph + ssize_t cluster; }; // Internal state used during layout operation @@ -94,6 +98,7 @@ class Layout { const MinikinFont* getFont(int i) const; FontFakery getFakery(int i) const; unsigned int getGlyphId(int i) const; + uint32_t getGlyphCluster(int i) const; // libtxt extension float getX(int i) const; float getY(int i) const; diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index aec59771798e4..515013d6e11f1 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -29,6 +29,7 @@ #include "font_skia.h" #include "lib/fxl/logging.h" #include "minikin/FontLanguageListCache.h" +#include "minikin/GraphemeBreak.h" #include "minikin/HbFontCache.h" #include "minikin/LayoutUtils.h" #include "minikin/LineBreaker.h" @@ -409,14 +410,6 @@ void Paragraph::Layout(double width, bool force) { if (!ComputeBidiRuns(&bidi_runs)) return; - if (!grapheme_breaker_) { - UErrorCode icu_status = U_ZERO_ERROR; - grapheme_breaker_.reset( - icu::BreakIterator::createCharacterInstance(icu::Locale(), icu_status)); - if (!U_SUCCESS(icu_status)) - return; - } - SkPaint paint; paint.setAntiAlias(true); paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); @@ -537,14 +530,12 @@ void Paragraph::Layout(double width, bool force) { if (layout.nGlyphs() == 0) continue; + std::vector layout_advances(text_count); + layout.getAdvances(layout_advances.data()); + // Break the layout into blobs that share the same SkPaint parameters. std::vector> glyph_blobs = GetLayoutTypefaceRuns(layout); - grapheme_breaker_->setText( - icu::UnicodeString(false, text_ptr + text_start, text_count)); - if (run.is_rtl()) - grapheme_breaker_->last(); - double word_start_position = std::numeric_limits::quiet_NaN(); // Build a Skia text blob from each group of glyphs. @@ -556,58 +547,78 @@ void Paragraph::Layout(double width, bool force) { builder.allocRunPos(paint, glyph_blob.end - glyph_blob.start); for (size_t glyph_index = glyph_blob.start; - glyph_index < glyph_blob.end; ++glyph_index) { - size_t blob_index = glyph_index - glyph_blob.start; - blob_buffer.glyphs[blob_index] = layout.getGlyphId(glyph_index); - - size_t pos_index = blob_index * 2; - double glyph_x_offset = layout.getX(glyph_index) + justify_x_offset; - blob_buffer.pos[pos_index] = glyph_x_offset; - blob_buffer.pos[pos_index + 1] = layout.getY(glyph_index); - - // The glyph may be a ligature. Determine how many input characters - // are joined into this glyph. Note that each character may be - // encoded as multiple UTF-16 code units. - Range glyph_code_units; - std::vector subglyph_code_unit_counts; + glyph_index < glyph_blob.end;) { + size_t cluster_start_glyph_index = glyph_index; + uint32_t cluster = layout.getGlyphCluster(cluster_start_glyph_index); + double glyph_x_offset; + + // Add all the glyphs in this cluster to the text blob. + do { + size_t blob_index = glyph_index - glyph_blob.start; + blob_buffer.glyphs[blob_index] = layout.getGlyphId(glyph_index); + + size_t pos_index = blob_index * 2; + blob_buffer.pos[pos_index] = + layout.getX(glyph_index) + justify_x_offset; + blob_buffer.pos[pos_index + 1] = layout.getY(glyph_index); + + if (glyph_index == cluster_start_glyph_index) + glyph_x_offset = blob_buffer.pos[pos_index]; + + glyph_index++; + } while (glyph_index < glyph_blob.end && + layout.getGlyphCluster(glyph_index) == cluster); + + Range glyph_code_units(cluster, 0); + std::vector grapheme_code_unit_counts; if (run.is_rtl()) { - glyph_code_units.end = grapheme_breaker_->current(); - glyph_code_units.start = grapheme_breaker_->previous(); - if (glyph_code_units.start == icu::BreakIterator::DONE) - break; - subglyph_code_unit_counts.push_back(glyph_code_units.width()); + if (cluster_start_glyph_index > 0) { + glyph_code_units.end = + layout.getGlyphCluster(cluster_start_glyph_index - 1); + } else { + glyph_code_units.end = text_count; + } + grapheme_code_unit_counts.push_back(glyph_code_units.width()); } else { - glyph_code_units.start = grapheme_breaker_->current(); - glyph_code_units.end = grapheme_breaker_->next(); - if (glyph_code_units.end == icu::BreakIterator::DONE) - break; - subglyph_code_unit_counts.push_back(glyph_code_units.width()); - while (glyph_code_units.end < static_cast(text_count)) { - if (layout.getCharAdvance(glyph_code_units.end) != 0) - break; - if (grapheme_breaker_->next() == icu::BreakIterator::DONE) - break; - subglyph_code_unit_counts.push_back(grapheme_breaker_->current() - - glyph_code_units.end); - glyph_code_units.end = grapheme_breaker_->current(); + if (glyph_index < layout.nGlyphs()) { + glyph_code_units.end = layout.getGlyphCluster(glyph_index); + } else { + glyph_code_units.end = text_count; + } + + // The glyph may be a ligature. Determine how many graphemes are + // joined into this glyph and how many input code units map to + // each grapheme. + size_t code_unit_count = 1; + for (int32_t offset = glyph_code_units.start + 1; + offset < glyph_code_units.end; ++offset) { + if (minikin::GraphemeBreak::isGraphemeBreak( + layout_advances.data(), text_ptr, text_start, text_count, + offset)) { + grapheme_code_unit_counts.push_back(code_unit_count); + code_unit_count = 1; + } else { + code_unit_count++; + } } + grapheme_code_unit_counts.push_back(code_unit_count); } float glyph_advance = layout.getCharAdvance(glyph_code_units.start); - float subglyph_advance = - glyph_advance / subglyph_code_unit_counts.size(); + float grapheme_advance = + glyph_advance / grapheme_code_unit_counts.size(); glyph_positions.emplace_back(run_x_offset + glyph_x_offset, - subglyph_advance, + grapheme_advance, run.start() + glyph_code_units.start, - subglyph_code_unit_counts[0]); + grapheme_code_unit_counts[0]); - // Compute positions for the additional characters in the ligature. - for (size_t i = 1; i < subglyph_code_unit_counts.size(); ++i) { + // Compute positions for the additional graphemes in the ligature. + for (size_t i = 1; i < grapheme_code_unit_counts.size(); ++i) { glyph_positions.emplace_back( - glyph_positions.back().x_pos.end, subglyph_advance, + glyph_positions.back().x_pos.end, grapheme_advance, glyph_positions.back().code_units.start + - subglyph_code_unit_counts[i - 1], - subglyph_code_unit_counts[i]); + grapheme_code_unit_counts[i - 1], + grapheme_code_unit_counts[i]); } if (word_index < words.size() && diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index eabcc431b4486..4a40f89b387ae 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -184,7 +184,6 @@ class Paragraph { std::shared_ptr font_collection_; minikin::LineBreaker breaker_; - std::unique_ptr grapheme_breaker_; mutable std::unique_ptr word_breaker_; struct LineRange { From c83d1ef12df0cf8b11a6dda044f812f8cc6c16ef Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 12 Apr 2018 11:00:31 -0700 Subject: [PATCH 0088/1190] Do not pause rendering when android activity loses focus (#4848) * do not pause rendering when android view loses focus --- lib/ui/window.dart | 12 ++++++++---- .../android/io/flutter/app/FlutterActivity.java | 6 ++++++ .../io/flutter/app/FlutterActivityDelegate.java | 5 +++++ .../io/flutter/app/FlutterActivityEvents.java | 5 +++++ .../io/flutter/app/FlutterFragmentActivity.java | 7 +++++++ .../android/io/flutter/view/FlutterNativeView.java | 9 ++++++++- .../android/io/flutter/view/FlutterView.java | 4 ++-- 7 files changed, 41 insertions(+), 7 deletions(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index 26b7021929ed3..05bf0b73a9f81 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -47,10 +47,14 @@ enum AppLifecycleState { /// in the foreground inactive state. Apps transition to this state when in /// a phone call, responding to a TouchID request, when entering the app /// switcher or the control center, or when the UIViewController hosting the - /// Flutter app is transitioning. Apps in this state should assume that they - /// may be [paused] at any time. - /// - /// On Android, this state is currently unused. + /// Flutter app is transitioning. + /// + /// On Android, this corresponds to an app or the Flutter host view running + /// in the foreground inactive state. Apps transition to this state when + /// another activity is focused, such as a split-screen app, a phone call, + /// a picture-in-picture app, a system dialog, or another window. + /// + /// Apps in this state should assume that they may be [paused] at any time. inactive, /// The application is not currently visible to the user, not responding to diff --git a/shell/platform/android/io/flutter/app/FlutterActivity.java b/shell/platform/android/io/flutter/app/FlutterActivity.java index f01e85a1a2437..ab566c485a1e6 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterActivity.java @@ -99,6 +99,12 @@ public void onBackPressed() { super.onBackPressed(); } } + + @Override + protected void onStop() { + eventDelegate.onStop(); + super.onStop(); + } @Override protected void onPause() { diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index 9de35c4b480a7..1c880d7e46987 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -218,6 +218,11 @@ public void onResume() { } } + @Override + public void onStop() { + flutterView.onStop(); + } + @Override public void onPostResume() { if (flutterView != null) { diff --git a/shell/platform/android/io/flutter/app/FlutterActivityEvents.java b/shell/platform/android/io/flutter/app/FlutterActivityEvents.java index 98a3a1016c85f..8d8eb422aa338 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityEvents.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityEvents.java @@ -54,6 +54,11 @@ public interface FlutterActivityEvents */ void onDestroy(); + /** + * @see android.app.Activity#onStop() + */ + void onStop(); + /** * Invoked when the activity has detected the user's press of the back key. * diff --git a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java index cc8325df974e8..92ecb2226a4e4 100644 --- a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java @@ -98,6 +98,13 @@ public void onBackPressed() { } } + @Override + protected void onStop() { + eventDelegate.onStop(); + super.onStop(); + } + + @Override protected void onPause() { super.onPause(); diff --git a/shell/platform/android/io/flutter/view/FlutterNativeView.java b/shell/platform/android/io/flutter/view/FlutterNativeView.java index 034a86d09d91f..7b843878143f0 100644 --- a/shell/platform/android/io/flutter/view/FlutterNativeView.java +++ b/shell/platform/android/io/flutter/view/FlutterNativeView.java @@ -128,7 +128,14 @@ private void attach(FlutterNativeView view) { // Called by native to send us a platform message. private void handlePlatformMessage(final String channel, byte[] message, final int replyId) { - assertAttached(); + // The platform may not be attached immediately in certain cases where a new bundle is run - + // the native view is created in a separate thread. This mostly happens when the app restarts in dev + // mode when switching into split-screen mode. Preventing app restarts on layout and density + // changes will prevent this, and afterwards this can be changed back to an assert. + if (!isAttached()) { + Log.d(TAG, "PlatformView is not attached"); + return; + } BinaryMessageHandler handler = mMessageHandlers.get(channel); if (handler != null) { try { diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 6b8f6b47f6fd4..38b0df20b96c2 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -267,7 +267,7 @@ public void addActivityLifecycleListener(ActivityLifecycleListener listener) { } public void onPause() { - mFlutterLifecycleChannel.send("AppLifecycleState.paused"); + mFlutterLifecycleChannel.send("AppLifecycleState.inactive"); } public void onPostResume() { @@ -278,7 +278,7 @@ public void onPostResume() { } public void onStop() { - mFlutterLifecycleChannel.send("AppLifecycleState.suspending"); + mFlutterLifecycleChannel.send("AppLifecycleState.paused"); } public void onMemoryPressure() { From 69d9590e436ea425fe2da0c0fd02e5392aa47a90 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Thu, 12 Apr 2018 14:06:28 -0400 Subject: [PATCH 0089/1190] Update skia vulkan usages to use getBackendRenderTarget. (#4982) * Update vulkan_swampchain.cc to use getBackendRenderTarget. The use of getRenderTargetHandle on SkSurface is being removed so switch over to the new API of getBackendRenderTarget. * Update vulkan_swapchain.cc * Update vulkan_surface_producer.cc --- content_handler/vulkan_surface_producer.cc | 15 ++++++++++----- vulkan/vulkan_swapchain.cc | 13 ++++++------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index 6f605c109b7df..60ae4462890cf 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -149,17 +149,22 @@ bool VulkanSurfaceProducer::TransitionSurfacesToExternal( if (!command_buffer->Begin()) return false; - GrVkImageInfo* imageInfo; - vk_surface->GetSkiaSurface()->getRenderTargetHandle( - reinterpret_cast(&imageInfo), + GrBackendRenderTarget backendRT = vk_surface->GetSkiaSurface()->getBackendRenderTarget( SkSurface::kFlushRead_BackendHandleAccess); + if (!backendRT.isValid()) { + return false; + } + GrVkImageInfo imageInfo; + if(!backendRT.getVkImageInfo(&imageInfo)) { + return false; + } VkImageMemoryBarrier image_barrier = { .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .pNext = nullptr, .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, .dstAccessMask = 0, - .oldLayout = imageInfo->fImageLayout, + .oldLayout = imageInfo.fImageLayout, .newLayout = VK_IMAGE_LAYOUT_GENERAL, .srcQueueFamilyIndex = 0, .dstQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL_KHR, @@ -175,7 +180,7 @@ bool VulkanSurfaceProducer::TransitionSurfacesToExternal( 1, &image_barrier)) return false; - imageInfo->updateImageLayout(image_barrier.newLayout); + backendRT.setVkImageLayout(image_barrier.newLayout); if (!command_buffer->End()) return false; diff --git a/vulkan/vulkan_swapchain.cc b/vulkan/vulkan_swapchain.cc index b00c8afc873b0..cf1588314a51f 100644 --- a/vulkan/vulkan_swapchain.cc +++ b/vulkan/vulkan_swapchain.cc @@ -460,16 +460,15 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { FXL_DLOG(INFO) << "Could not access surface at the image index."; return error; } - - GrVkImageInfo* image_info = nullptr; - if (!surface->getRenderTargetHandle( - reinterpret_cast(&image_info), - SkSurface::kFlushRead_BackendHandleAccess)) { - FXL_DLOG(INFO) << "Could not get render target handle."; + + GrBackendRenderTarget backendRT = surface->getBackendRenderTarget( + SkSurface::kFlushRead_BackendHandleAccess); + if (!backendRT.isValid()) { + FXL_DLOG(INFO) << "Could not get backend render target."; return error; } + backendRT.setVkImageLayout(destination_image_layout); - image_info->updateImageLayout(destination_image_layout); current_image_index_ = next_image_index; return {AcquireStatus::Success, surface}; From 8a8f96559bad682719e112c9d78286ec1194f9f5 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 12 Apr 2018 11:12:02 -0700 Subject: [PATCH 0090/1190] Fix build on Windows (#4984) --- third_party/txt/src/minikin/Layout.cpp | 4 ++-- third_party/txt/src/minikin/Layout.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/txt/src/minikin/Layout.cpp b/third_party/txt/src/minikin/Layout.cpp index aacfc4d374442..6475cb2ebc509 100644 --- a/third_party/txt/src/minikin/Layout.cpp +++ b/third_party/txt/src/minikin/Layout.cpp @@ -1078,7 +1078,7 @@ void Layout::doLayoutRun(const uint16_t* buf, xoff += yoff * ctx->paint.skewX; LayoutGlyph glyph = { font_ix, glyph_ix, x + xoff, y + yoff, - static_cast(info[i].cluster - clusterOffset)}; + static_cast(info[i].cluster - clusterOffset)}; mGlyphs.push_back(glyph); float xAdvance = HBFixedToFloat(positions[i].x_advance); if ((ctx->paint.paintFlags & LinearTextFlag) == 0) { @@ -1140,7 +1140,7 @@ void Layout::appendLayout(Layout* src, size_t start, float extraAdvance) { float x = x0 + srcGlyph.x; float y = srcGlyph.y; LayoutGlyph glyph = {font_ix, glyph_id, x, y, - static_cast(srcGlyph.cluster + start)}; + static_cast(srcGlyph.cluster + start)}; mGlyphs.push_back(glyph); } for (size_t i = 0; i < src->mAdvances.size(); i++) { diff --git a/third_party/txt/src/minikin/Layout.h b/third_party/txt/src/minikin/Layout.h index fe06e73ad69c5..78cf7644ba39b 100644 --- a/third_party/txt/src/minikin/Layout.h +++ b/third_party/txt/src/minikin/Layout.h @@ -40,7 +40,7 @@ struct LayoutGlyph { // libtxt extension: record the cluster (character index) that corresponds // to this glyph - ssize_t cluster; + uint32_t cluster; }; // Internal state used during layout operation From 8a6e64a8ef09f1f1af207725b40022d8d7a9dcd7 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 12 Apr 2018 11:20:24 -0700 Subject: [PATCH 0091/1190] Revert "Do not pause rendering when android activity loses focus (#4848)" (#4985) This reverts commit c83d1ef12df0cf8b11a6dda044f812f8cc6c16ef. --- lib/ui/window.dart | 12 ++++-------- .../android/io/flutter/app/FlutterActivity.java | 6 ------ .../io/flutter/app/FlutterActivityDelegate.java | 5 ----- .../io/flutter/app/FlutterActivityEvents.java | 5 ----- .../io/flutter/app/FlutterFragmentActivity.java | 7 ------- .../android/io/flutter/view/FlutterNativeView.java | 9 +-------- .../android/io/flutter/view/FlutterView.java | 4 ++-- 7 files changed, 7 insertions(+), 41 deletions(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index 05bf0b73a9f81..26b7021929ed3 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -47,14 +47,10 @@ enum AppLifecycleState { /// in the foreground inactive state. Apps transition to this state when in /// a phone call, responding to a TouchID request, when entering the app /// switcher or the control center, or when the UIViewController hosting the - /// Flutter app is transitioning. - /// - /// On Android, this corresponds to an app or the Flutter host view running - /// in the foreground inactive state. Apps transition to this state when - /// another activity is focused, such as a split-screen app, a phone call, - /// a picture-in-picture app, a system dialog, or another window. - /// - /// Apps in this state should assume that they may be [paused] at any time. + /// Flutter app is transitioning. Apps in this state should assume that they + /// may be [paused] at any time. + /// + /// On Android, this state is currently unused. inactive, /// The application is not currently visible to the user, not responding to diff --git a/shell/platform/android/io/flutter/app/FlutterActivity.java b/shell/platform/android/io/flutter/app/FlutterActivity.java index ab566c485a1e6..f01e85a1a2437 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterActivity.java @@ -99,12 +99,6 @@ public void onBackPressed() { super.onBackPressed(); } } - - @Override - protected void onStop() { - eventDelegate.onStop(); - super.onStop(); - } @Override protected void onPause() { diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index 1c880d7e46987..9de35c4b480a7 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -218,11 +218,6 @@ public void onResume() { } } - @Override - public void onStop() { - flutterView.onStop(); - } - @Override public void onPostResume() { if (flutterView != null) { diff --git a/shell/platform/android/io/flutter/app/FlutterActivityEvents.java b/shell/platform/android/io/flutter/app/FlutterActivityEvents.java index 8d8eb422aa338..98a3a1016c85f 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityEvents.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityEvents.java @@ -54,11 +54,6 @@ public interface FlutterActivityEvents */ void onDestroy(); - /** - * @see android.app.Activity#onStop() - */ - void onStop(); - /** * Invoked when the activity has detected the user's press of the back key. * diff --git a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java index 92ecb2226a4e4..cc8325df974e8 100644 --- a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java @@ -98,13 +98,6 @@ public void onBackPressed() { } } - @Override - protected void onStop() { - eventDelegate.onStop(); - super.onStop(); - } - - @Override protected void onPause() { super.onPause(); diff --git a/shell/platform/android/io/flutter/view/FlutterNativeView.java b/shell/platform/android/io/flutter/view/FlutterNativeView.java index 7b843878143f0..034a86d09d91f 100644 --- a/shell/platform/android/io/flutter/view/FlutterNativeView.java +++ b/shell/platform/android/io/flutter/view/FlutterNativeView.java @@ -128,14 +128,7 @@ private void attach(FlutterNativeView view) { // Called by native to send us a platform message. private void handlePlatformMessage(final String channel, byte[] message, final int replyId) { - // The platform may not be attached immediately in certain cases where a new bundle is run - - // the native view is created in a separate thread. This mostly happens when the app restarts in dev - // mode when switching into split-screen mode. Preventing app restarts on layout and density - // changes will prevent this, and afterwards this can be changed back to an assert. - if (!isAttached()) { - Log.d(TAG, "PlatformView is not attached"); - return; - } + assertAttached(); BinaryMessageHandler handler = mMessageHandlers.get(channel); if (handler != null) { try { diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 38b0df20b96c2..6b8f6b47f6fd4 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -267,7 +267,7 @@ public void addActivityLifecycleListener(ActivityLifecycleListener listener) { } public void onPause() { - mFlutterLifecycleChannel.send("AppLifecycleState.inactive"); + mFlutterLifecycleChannel.send("AppLifecycleState.paused"); } public void onPostResume() { @@ -278,7 +278,7 @@ public void onPostResume() { } public void onStop() { - mFlutterLifecycleChannel.send("AppLifecycleState.paused"); + mFlutterLifecycleChannel.send("AppLifecycleState.suspending"); } public void onMemoryPressure() { From 76cb311d9c33720dcd19274228b39ecdbad8d9af Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 12 Apr 2018 11:23:10 -0700 Subject: [PATCH 0092/1190] Roll dart sdk to f76dad0adcf6766d73351354da653d6a793b5abc. (#4983) * Roll dart sdk to f76dad0adcf6766d73351354da653d6a793b5abc. Changes since last roll ``` f76dad0adc [frontend-server] Report error count on compile and recompile. 17fc446579 [vm/kernel/aot] Fix handling of calls via fields/getters in TFA 16a4ed7dc4 Remove an unused subclass of LineInfo c7e4a7d333 [ VM / CFE ] Added override to allowPlatformPrivateLibraryAccess in VmTarget for tests which need to import dart:_internal. 1e312819ca Ensure errors guard erroneous expressions. 0f3b9f302b [vm/compiler] Fix assertion in the constant propagator. 9995feba8e Adjusted status for ListMixin_class_A01_t02 03d7a9e55c Revert "[VM] Improve quality of codegen for crypto operations" 7cc4d76a30 Add tryParse alternatives to parseFunctions. 58a6bfd974 Improve identifier recovery in expressions 17d6d470a2 [VM] Remove experimental, unused, argument bits from argdesc and reduce prologue size 5909932d38 [vm/compiler] Canonicalize more intermediate constants in IL. df6055d876 Only bypass cache when .packages is invalidated 5aec8ad6fb Delete invalidated builder loaded from dill 82fed79ed1 [VM] Improve quality of codegen for crypto operations d27b98c513 [VM] Slightly better behaviour in out-of-memory situation b20bab56a0 [fuchsia] Update timezone service integration 430abca69a [ VM ] Removed unnecessary assignment to Function::null() when target was already NULL. 2ddc5495f8 Reduce DDC signature overhead 25702d355e [VM / frontend-server] Add ability to pass the 'sync-async' flag into the front end server so that 'flutter tools' can choose to turn it off or on. 8df4042b2d fix #32088, DDC calls nSM for signature mismatch d52a0419f6 [VM bigint] Fix digit array size calculation for _divRem result (fixes #32739). Add regression test to existing bigint test. a9c3dabb4c fix #32769, performance regression in Analyzer callable function support b3c94b5d52 Revert "Reland "[VM] Introduction of type testing stubs - Part 1-4"" 77116c14be Show isolate memory usage in the analysis server diagnostics page. a90a74cfd8 JSArray strong mode performance fixes cbdf102d0c Use interceptor for reading type arguments 9d4da03309 Roll dart2js_info to 0.5.6+2 a35bf88f9d Run pub upgrade on analyis plugins before (re)start. 1db1ac4863 Produce a single-file analyzer for Goma. 072bd1c88e Remove KernelLibraryBuilder proxies 12950e8170 Fix the windows bot and update a missed test cf8c76dc50 [vm/compiler] Restore old print-flow-graph behavior. a60d803913 [infra] Add --no-preview-dart-2 support for the analyzer to test.py ``` * Update license hash. No changes to the licenses. --- DEPS | 4 ++-- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index f771a4be4088b..a49534aa6b408 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '41264590256de42c68de406fc180e338efc9420d', + 'dart_revision': 'f76dad0adcf6766d73351354da653d6a793b5abc', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -46,7 +46,7 @@ vars = { 'dart_convert_tag': '2.0.1', 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', - 'dart_dart2js_info_tag': '0.5.6', + 'dart_dart2js_info_tag': '0.5.6+2', 'dart_dart_style_tag': '1.0.10', 'dart_dartdoc_tag': 'v0.18.1', 'dart_fixnum_tag': '0.10.5', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 39ab0840084d8..5bf06a622f762 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6055a1e4cf6a71341e15c8c10903dbed +Signature: 3140a324beedd4d57cf135c23e53b020 UNUSED LICENSES: From 1dd1264944306e9948a669a1fe0ff8bfad113bae Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Thu, 12 Apr 2018 12:56:29 -0700 Subject: [PATCH 0093/1190] [async] Adapt to libasync API changes. (#4980) --- content_handler/vulkan_surface.cc | 21 +++++++++------------ content_handler/vulkan_surface.h | 8 ++++---- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 6d5df488542fe..466f0a6e8d63a 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -44,8 +44,7 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, wait_.set_object(release_event_.get()); wait_.set_trigger(ZX_EVENT_SIGNALED); - async_ = async_get_default(); - wait_.Begin(async_); + wait_.Begin(async_get_default()); // Probably not necessary as the events should be in the unsignalled state // already. @@ -56,11 +55,8 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, VulkanSurface::~VulkanSurface() { ASSERT_IS_GPU_THREAD; - if (async_) { - wait_.Cancel(async_); - wait_.set_object(ZX_HANDLE_INVALID); - async_ = nullptr; - } + wait_.Cancel(); + wait_.set_object(ZX_HANDLE_INVALID); } bool VulkanSurface::IsValid() const { @@ -410,15 +406,16 @@ void VulkanSurface::Reset() { } } -async_wait_result_t VulkanSurface::OnHandleReady(async_t* async, - zx_status_t status, - const zx_packet_signal_t* signal) { +void VulkanSurface::OnHandleReady(async_t* async, + async::WaitBase* wait, + zx_status_t status, + const zx_packet_signal_t* signal) { ASSERT_IS_GPU_THREAD; if (status != ZX_OK) - return ASYNC_WAIT_FINISHED; + return; FXL_DCHECK(signal->observed & ZX_EVENT_SIGNALED); Reset(); - return ASYNC_WAIT_AGAIN; + wait->Begin(async); } } // namespace flutter_runner diff --git a/content_handler/vulkan_surface.h b/content_handler/vulkan_surface.h index 41a807af81f9c..c8e7d2c06d4dd 100644 --- a/content_handler/vulkan_surface.h +++ b/content_handler/vulkan_surface.h @@ -70,9 +70,10 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { } private: - async_wait_result_t OnHandleReady(async_t* async, - zx_status_t status, - const zx_packet_signal_t* signal); + void OnHandleReady(async_t* async, + async::WaitBase* wait, + zx_status_t status, + const zx_packet_signal_t* signal); bool AllocateDeviceMemory(sk_sp context, const SkISize& size, @@ -106,7 +107,6 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { vulkan::VulkanHandle acquire_semaphore_; std::unique_ptr command_buffer_; zx::event release_event_; - async_t* async_; async::WaitMethod wait_; std::function pending_on_writes_committed_; size_t age_ = 0; From b6d2dde92d50eb5b5bbf5ec6a6485d5ad98e5f22 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 12 Apr 2018 13:15:39 -0700 Subject: [PATCH 0094/1190] [fuchsia] Fix build (#4986) Add missing include. --- content_handler/vulkan_surface_producer.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index 60ae4462890cf..e75f49786cf0b 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -9,6 +9,7 @@ #include #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" +#include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" From 0c74fc93d993b37cfd2c3307a03ab889647c2a01 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 12 Apr 2018 14:25:40 -0700 Subject: [PATCH 0095/1190] [fuchsia] Fix use-after-free (#4987) We were trying to re-establish the wait after calling Reset(), but Reset() can result in the surface being destroyed. Now we re-establish the wait inside the Reset() machinery. --- content_handler/vulkan_surface.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 466f0a6e8d63a..bebbc84e899e0 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -44,10 +44,6 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, wait_.set_object(release_event_.get()); wait_.set_trigger(ZX_EVENT_SIGNALED); - wait_.Begin(async_get_default()); - - // Probably not necessary as the events should be in the unsignalled state - // already. Reset(); valid_ = true; @@ -398,6 +394,8 @@ void VulkanSurface::Reset() { FXL_DLOG(ERROR) << "failed to create acquire semaphore"; } + wait_.Begin(async_get_default()); + // It is safe for the caller to collect the surface in the callback. auto callback = pending_on_writes_committed_; pending_on_writes_committed_ = nullptr; @@ -415,7 +413,6 @@ void VulkanSurface::OnHandleReady(async_t* async, return; FXL_DCHECK(signal->observed & ZX_EVENT_SIGNALED); Reset(); - wait->Begin(async); } } // namespace flutter_runner From a530035bb2d88fbf669a7c8abddeca10ae738e62 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 12 Apr 2018 15:50:57 -0700 Subject: [PATCH 0096/1190] libtxt: fix leaks in Skia object reference counting (#4988) Fixes https://github.com/flutter/flutter/issues/16526 --- third_party/txt/src/txt/asset_data_provider.cc | 2 +- third_party/txt/src/txt/asset_font_style_set.cc | 4 ++-- third_party/txt/src/txt/font_collection.cc | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/third_party/txt/src/txt/asset_data_provider.cc b/third_party/txt/src/txt/asset_data_provider.cc index 6b1b841240609..fa35cc08539bb 100644 --- a/third_party/txt/src/txt/asset_data_provider.cc +++ b/third_party/txt/src/txt/asset_data_provider.cc @@ -37,7 +37,7 @@ AssetFontStyleSet* AssetDataProvider::MatchFamily( if (found == registered_families_.end()) { return nullptr; } - return &found->second; + return SkRef(&found->second); } void AssetDataProvider::RegisterTypeface(sk_sp typeface) { diff --git a/third_party/txt/src/txt/asset_font_style_set.cc b/third_party/txt/src/txt/asset_font_style_set.cc index 7b145d56617f8..c0ebcf78e2aba 100644 --- a/third_party/txt/src/txt/asset_font_style_set.cc +++ b/third_party/txt/src/txt/asset_font_style_set.cc @@ -31,7 +31,7 @@ SkTypeface* AssetFontStyleSet::createTypeface(int index) { if (index_cast >= typefaces_.size()) { return nullptr; } - return typefaces_[index_cast].get(); + return SkRef(typefaces_[index_cast].get()); } SkTypeface* AssetFontStyleSet::matchStyle(const SkFontStyle& pattern) { @@ -42,7 +42,7 @@ SkTypeface* AssetFontStyleSet::matchStyle(const SkFontStyle& pattern) { if (typeface->fontStyle() == pattern) return typeface.get(); - return typefaces_[0].get(); + return SkRef(typefaces_[0].get()); } } // namespace txt diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index c74b0d913c416..28ca6cd469295 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -100,7 +100,7 @@ FontCollection::GetMinikinFontCollectionForFamily(const std::string& family) { } for (sk_sp& manager : GetFontManagerOrder()) { - auto font_style_set = manager->matchFamily(family.c_str()); + sk_sp font_style_set(manager->matchFamily(family.c_str())); if (font_style_set == nullptr || font_style_set->count() == 0) { continue; } @@ -111,8 +111,8 @@ FontCollection::GetMinikinFontCollectionForFamily(const std::string& family) { for (int i = 0, style_count = font_style_set->count(); i < style_count; ++i) { // Create the skia typeface. - auto skia_typeface = - sk_ref_sp(font_style_set->createTypeface(i)); + sk_sp skia_typeface( + sk_sp(font_style_set->createTypeface(i))); if (skia_typeface == nullptr) { continue; } From b7358b33dbd61e124720165dd939fa49cbd0ecb6 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 12 Apr 2018 16:51:50 -0700 Subject: [PATCH 0097/1190] libtxt: cache font families that are remapped to the default font family (#4990) --- third_party/txt/src/txt/font_collection.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index 28ca6cd469295..05eebb4bf7ab3 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -156,7 +156,10 @@ FontCollection::GetMinikinFontCollectionForFamily(const std::string& family) { const auto default_font_family = GetDefaultFontFamily(); if (family != default_font_family) { - return GetMinikinFontCollectionForFamily(default_font_family); + std::shared_ptr default_collection = + GetMinikinFontCollectionForFamily(default_font_family); + font_collections_cache_[family] = default_collection; + return default_collection; } // No match found in any of our font managers. From 37e5df053024c1158b436ff0cd843116c25bdf14 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 13 Apr 2018 12:12:06 -0400 Subject: [PATCH 0098/1190] Remove only use of SkPaint::kGenA8FromLCD (#4994) Skia is removing SkPaint::kGenA8FromLCD (this information is now part of the SkPixelGeometry on SkSurface). This flag never appears to be mentioned anywhere else in the code and appears to be left over from being copied from blink (this code in blink used to set this flag conditionally). --- sky/engine/platform/fonts/win/FontPlatformDataWin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sky/engine/platform/fonts/win/FontPlatformDataWin.cpp b/sky/engine/platform/fonts/win/FontPlatformDataWin.cpp index 00e9db7f7541b..39f5d6bb05aa0 100644 --- a/sky/engine/platform/fonts/win/FontPlatformDataWin.cpp +++ b/sky/engine/platform/fonts/win/FontPlatformDataWin.cpp @@ -54,8 +54,7 @@ void FontPlatformData::setupPaint(SkPaint* paint, uint32_t textFlags = paintTextFlags(); uint32_t flags = paint->getFlags(); static const uint32_t textFlagsMask = SkPaint::kAntiAlias_Flag | - SkPaint::kLCDRenderText_Flag | - SkPaint::kGenA8FromLCD_Flag; + SkPaint::kLCDRenderText_Flag; flags &= ~textFlagsMask; if (ts <= kMaxSizeForEmbeddedBitmap) From 58e84c8bf0b6304649340e6eaad988602961d7f6 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 13 Apr 2018 13:48:15 -0700 Subject: [PATCH 0099/1190] Re-land "Support multiple shells in a single process. (#4932)" (#4998) * Re-land "Support multiple shells in a single process. (#4932)" This reverts commit 723c7d01439da4261bc836075fb55651ce9e7f03. --- BUILD.gn | 74 +- DEPS | 2 +- assets/BUILD.gn | 12 +- assets/asset_manager.cc | 59 + assets/asset_manager.h | 47 + assets/asset_provider.h | 25 - assets/asset_resolver.h | 32 + assets/directory_asset_bundle.cc | 85 +- assets/directory_asset_bundle.h | 32 +- assets/unzipper_provider.cc | 21 - assets/unzipper_provider.h | 20 - assets/zip_asset_store.cc | 24 +- assets/zip_asset_store.h | 24 +- common/BUILD.gn | 5 +- common/settings.cc | 58 +- common/settings.h | 74 +- common/task_runners.cc | 48 + common/task_runners.h | 46 + common/threads.cc | 56 - common/threads.h | 48 - content_handler/BUILD.gn | 59 +- content_handler/README.md | 4 + content_handler/accessibility_bridge.cc | 15 +- content_handler/accessibility_bridge.h | 25 +- content_handler/app.cc | 174 --- content_handler/app.h | 64 - content_handler/application.cc | 313 +++++ content_handler/application.h | 97 ++ .../application_controller_impl.cc | 148 --- content_handler/application_controller_impl.h | 76 -- content_handler/application_runner.cc | 90 ++ content_handler/application_runner.h | 79 ++ content_handler/compositor_context.cc | 86 ++ content_handler/compositor_context.h | 39 + content_handler/engine.cc | 258 ++++ content_handler/engine.h | 63 + content_handler/fuchsia_font_manager.cc | 47 +- content_handler/fuchsia_font_manager.h | 2 +- content_handler/isolate_configurator.cc | 114 ++ content_handler/isolate_configurator.h | 55 + content_handler/main.cc | 20 +- content_handler/platform_view.cc | 551 +++++++++ content_handler/platform_view.h | 120 ++ content_handler/rasterizer.cc | 19 - content_handler/rasterizer.h | 35 - content_handler/runtime_holder.cc | 911 -------------- content_handler/runtime_holder.h | 152 --- content_handler/service_protocol_hooks.cc | 164 --- content_handler/service_protocol_hooks.h | 37 - content_handler/session_connection.cc | 108 +- content_handler/session_connection.h | 52 +- content_handler/surface.cc | 73 ++ content_handler/surface.h | 47 + content_handler/task_observers.cc | 43 + content_handler/task_observers.h | 16 + content_handler/unique_fdio_ns.h | 34 + content_handler/vulkan_rasterizer.cc | 117 -- content_handler/vulkan_rasterizer.h | 42 - content_handler/vulkan_surface.cc | 32 +- content_handler/vulkan_surface.h | 11 +- content_handler/vulkan_surface_pool.cc | 7 +- content_handler/vulkan_surface_pool.h | 9 +- content_handler/vulkan_surface_producer.cc | 9 +- content_handler/vulkan_surface_producer.h | 18 +- flow/BUILD.gn | 10 +- flow/compositor_context.cc | 26 +- flow/compositor_context.h | 44 +- flow/debug_print.cc | 5 + flow/debug_print.h | 9 +- flow/export_node.cc | 15 +- flow/export_node.h | 5 +- flow/layers/default_layer_builder.cc | 6 +- flow/layers/default_layer_builder.h | 2 +- flow/layers/layer.h | 4 - flow/layers/layer_builder.h | 3 +- flow/layers/layer_tree.cc | 55 +- flow/layers/layer_tree.h | 21 - flow/layers/performance_overlay_layer.cc | 33 - flow/layers/performance_overlay_layer.h | 2 - flow/layers/picture_layer.cc | 23 +- flow/layers/picture_layer.h | 13 +- flow/process_info.h | 31 - flow/raster_cache.cc | 33 +- flow/raster_cache.h | 6 - flow/raster_cache_key.h | 30 +- flow/scene_update_context.cc | 17 +- flow/skia_gpu_object.cc | 44 + flow/skia_gpu_object.h | 88 ++ flow/texture.cc | 6 +- flow/texture.h | 5 +- fml/BUILD.gn | 18 +- fml/file.h | 35 + fml/icu_util.cc | 17 +- fml/macros.h | 20 + fml/mapping.cc | 20 + fml/mapping.h | 37 +- fml/memory/thread_checker.h | 69 ++ fml/memory/weak_ptr.h | 43 +- fml/message_loop.cc | 10 +- fml/message_loop.h | 9 +- fml/message_loop_impl.cc | 43 +- fml/message_loop_impl.h | 8 +- fml/message_loop_unittests.cc | 24 +- fml/native_library.h | 52 + fml/paths.cc | 31 + fml/paths.h | 4 + fml/platform/android/message_loop_android.h | 6 +- .../darwin/resource_mapping_darwin.mm | 4 +- fml/platform/fuchsia/paths_fuchsia.cc | 15 + fml/platform/linux/message_loop_linux.h | 6 +- fml/platform/posix/file_posix.cc | 71 ++ fml/platform/posix/mapping_posix.cc | 18 +- fml/platform/posix/native_library_posix.cc | 60 + fml/platform/win/file_win.cc | 119 ++ fml/platform/win/mapping_win.cc | 59 +- fml/platform/win/native_library_win.cc | 51 + fml/platform/win/wstring_conversion.h | 25 + fml/task_observer.h | 21 - fml/task_runner.cc | 12 + fml/task_runner.h | 7 +- fml/thread.cc | 9 +- fml/thread.h | 6 +- fml/unique_fd.cc | 35 + fml/unique_fd.h | 60 + fml/unique_object.h | 137 +++ lib/snapshot/BUILD.gn | 54 +- lib/ui/BUILD.gn | 11 +- lib/ui/compositing/scene_builder.cc | 9 +- lib/ui/compositing/scene_host.cc | 6 +- lib/ui/dart_runtime_hooks.cc | 62 +- lib/ui/painting/codec.cc | 114 +- lib/ui/painting/codec.h | 7 +- lib/ui/painting/gradient.cc | 12 +- lib/ui/painting/image.cc | 14 +- lib/ui/painting/image.h | 17 +- lib/ui/painting/image_encoding.cc | 23 +- lib/ui/painting/image_shader.cc | 11 +- lib/ui/painting/picture.cc | 25 +- lib/ui/painting/picture.h | 9 +- lib/ui/painting/picture_recorder.cc | 5 +- lib/ui/painting/resource_context.cc | 51 - lib/ui/painting/resource_context.h | 60 - lib/ui/painting/shader.cc | 12 +- lib/ui/painting/shader.h | 13 +- lib/ui/painting/utils.cc | 46 - lib/ui/painting/utils.h | 38 - lib/ui/text/font_collection.cc | 14 +- lib/ui/text/font_collection.h | 7 +- lib/ui/text/paragraph.cc | 5 +- lib/ui/text/paragraph.h | 5 + lib/ui/text/paragraph_builder.cc | 27 +- lib/ui/text/paragraph_builder.h | 11 +- lib/ui/text/paragraph_impl_blink.cc | 4 +- lib/ui/text/paragraph_impl_blink.h | 5 + lib/ui/text/paragraph_impl_txt.cc | 2 +- lib/ui/ui_dart_state.cc | 93 +- lib/ui/ui_dart_state.h | 101 +- .../window/platform_message_response_dart.cc | 14 +- .../window/platform_message_response_dart.h | 6 +- lib/ui/window/viewport_metrics.h | 19 + lib/ui/window/window.cc | 5 +- lib/ui/window/window.h | 5 +- runtime/BUILD.gn | 60 +- runtime/asset_font_selector.cc | 38 +- runtime/asset_font_selector.h | 17 +- runtime/dart_controller.cc | 250 ---- runtime/dart_controller.h | 55 - runtime/dart_init.cc | 725 ----------- runtime/dart_init.h | 64 - runtime/dart_isolate.cc | 690 +++++++++++ runtime/dart_isolate.h | 152 +++ runtime/dart_isolate_unittests.cc | 103 ++ runtime/dart_service_isolate.h | 2 - runtime/dart_snapshot.cc | 159 +++ runtime/dart_snapshot.h | 57 + runtime/dart_snapshot_buffer.cc | 72 ++ runtime/dart_snapshot_buffer.h | 34 + runtime/dart_vm.cc | 472 ++++++++ runtime/dart_vm.h | 75 ++ runtime/dart_vm_unittests.cc | 21 + runtime/fixtures/simple_main.dart | 7 + runtime/runtime_controller.cc | 276 +++-- runtime/runtime_controller.h | 99 +- runtime/runtime_delegate.cc | 8 +- runtime/runtime_delegate.h | 8 +- runtime/runtime_init.cc | 35 - runtime/runtime_init.h | 21 - runtime/service_protocol.cc | 279 +++++ runtime/service_protocol.h | 99 ++ shell/common/BUILD.gn | 43 +- shell/common/animator.cc | 75 +- shell/common/animator.h | 37 +- shell/common/engine.cc | 583 +++------ shell/common/engine.h | 153 +-- shell/common/io_manager.cc | 73 ++ shell/common/io_manager.h | 52 + shell/common/isolate_configuration.cc | 148 +++ shell/common/isolate_configuration.h | 51 + shell/common/null_platform_view.cc | 37 - shell/common/null_platform_view.h | 39 - shell/common/null_rasterizer.cc | 67 -- shell/common/null_rasterizer.h | 51 - shell/common/platform_view.cc | 182 +-- shell/common/platform_view.h | 119 +- .../common/platform_view_service_protocol.cc | 447 ------- shell/common/platform_view_service_protocol.h | 85 -- shell/common/rasterizer.cc | 197 +++ shell/common/rasterizer.h | 65 +- shell/common/run_configuration.cc | 80 ++ shell/common/run_configuration.h | 56 + shell/common/shell.cc | 1055 ++++++++++++----- shell/common/shell.h | 254 ++-- shell/common/shell_unittests.cc | 133 +++ shell/common/surface.cc | 28 +- shell/common/surface.h | 14 +- shell/common/switches.cc | 122 ++ shell/common/switches.h | 37 +- shell/common/thread_host.cc | 38 + shell/common/thread_host.h | 43 + shell/common/tracing_controller.cc | 51 - shell/common/tracing_controller.h | 34 - shell/common/vsync_waiter.cc | 37 + shell/common/vsync_waiter.h | 21 +- shell/common/vsync_waiter_fallback.cc | 24 +- shell/common/vsync_waiter_fallback.h | 13 +- shell/gpu/BUILD.gn | 11 +- shell/gpu/gpu_rasterizer.cc | 168 --- shell/gpu/gpu_rasterizer.h | 68 -- shell/gpu/gpu_surface_gl.cc | 13 +- shell/gpu/gpu_surface_gl.h | 5 +- shell/gpu/gpu_surface_software.cc | 17 +- shell/gpu/gpu_surface_software.h | 7 +- shell/gpu/gpu_surface_vulkan.h | 5 +- shell/platform/BUILD.gn | 6 +- shell/platform/android/BUILD.gn | 16 +- shell/platform/android/android_context_gl.cc | 24 +- shell/platform/android/android_context_gl.h | 1 - .../android/android_external_texture_gl.cc | 9 +- .../android/android_external_texture_gl.h | 3 +- .../platform/android/android_shell_holder.cc | 169 +++ shell/platform/android/android_shell_holder.h | 59 + shell/platform/android/android_surface.cc | 24 + shell/platform/android/android_surface.h | 7 +- shell/platform/android/android_surface_gl.cc | 37 +- shell/platform/android/android_surface_gl.h | 24 +- .../android/android_surface_software.cc | 14 +- .../android/android_surface_software.h | 26 +- .../android/android_surface_vulkan.cc | 15 +- .../platform/android/android_surface_vulkan.h | 13 +- shell/platform/android/apk_asset_provider.cc | 29 +- shell/platform/android/apk_asset_provider.h | 27 +- shell/platform/android/flutter_main.cc | 75 +- shell/platform/android/flutter_main.h | 27 +- shell/platform/android/library_loader.cc | 2 +- .../platform_message_response_android.cc | 62 + .../platform_message_response_android.h | 39 + .../platform/android/platform_view_android.cc | 589 ++------- .../platform/android/platform_view_android.h | 98 +- .../android/platform_view_android_jni.cc | 416 +++++-- .../platform/android/vsync_waiter_android.cc | 100 +- shell/platform/android/vsync_waiter_android.h | 15 +- shell/platform/darwin/BUILD.gn | 12 +- shell/platform/darwin/common/BUILD.gn | 13 +- shell/platform/darwin/common/command_line.h | 17 + shell/platform/darwin/common/command_line.mm | 21 + shell/platform/darwin/common/platform_mac.h | 20 - shell/platform/darwin/common/platform_mac.mm | 160 --- .../darwin/common/process_info_mac.cc | 36 - .../platform/darwin/common/process_info_mac.h | 36 - shell/platform/darwin/desktop/BUILD.gn | 22 +- shell/platform/darwin/desktop/Info.plist | 8 +- .../darwin/desktop/flutter_app_delegate.h | 14 - .../darwin/desktop/flutter_app_delegate.m | 15 - .../darwin/desktop/flutter_application.mm | 8 - ...ation.h => flutter_application_delegate.h} | 11 +- .../desktop/flutter_application_delegate.mm | 80 ++ shell/platform/darwin/desktop/flutter_mac.xib | 695 ----------- .../platform/darwin/desktop/flutter_window.h | 6 +- .../platform/darwin/desktop/flutter_window.mm | 201 +++- shell/platform/darwin/desktop/main_mac.mm | 112 +- .../darwin/desktop/platform_view_mac.h | 27 +- .../darwin/desktop/platform_view_mac.mm | 107 +- .../darwin/desktop/vsync_waiter_mac.cc | 16 +- .../darwin/desktop/vsync_waiter_mac.h | 10 +- shell/platform/darwin/ios/BUILD.gn | 13 +- .../framework/Source/FlutterDartProject.mm | 397 +++---- .../Source/FlutterDartProject_Internal.h | 23 +- .../ios/framework/Source/FlutterDartSource.h | 30 - .../ios/framework/Source/FlutterDartSource.mm | 100 -- .../Source/FlutterHeadlessDartRunner.mm | 88 +- .../darwin/ios/framework/Source/FlutterView.h | 6 + .../ios/framework/Source/FlutterView.mm | 103 +- .../framework/Source/FlutterViewController.mm | 337 +++--- .../Source/FlutterViewController_Internal.h | 17 + .../framework/Source/accessibility_bridge.mm | 4 +- .../ios/framework/Source/flutter_main_ios.h | 18 - .../ios/framework/Source/flutter_main_ios.mm | 25 - .../Source/platform_message_response_darwin.h | 50 + .../platform_message_response_darwin.mm | 11 + .../Source/platform_message_router.h | 5 +- .../Source/platform_message_router.mm | 15 +- .../ios/framework/Source/vsync_waiter_ios.h | 19 +- .../ios/framework/Source/vsync_waiter_ios.mm | 115 +- .../darwin/ios/ios_external_texture_gl.h | 2 + .../darwin/ios/ios_external_texture_gl.mm | 19 +- shell/platform/darwin/ios/ios_gl_context.h | 2 +- shell/platform/darwin/ios/ios_gl_context.mm | 60 +- shell/platform/darwin/ios/ios_surface.h | 19 +- shell/platform/darwin/ios/ios_surface.mm | 31 +- shell/platform/darwin/ios/ios_surface_gl.h | 3 +- shell/platform/darwin/ios/ios_surface_gl.mm | 5 +- .../darwin/ios/ios_surface_software.h | 11 +- .../darwin/ios/ios_surface_software.mm | 9 +- shell/platform/darwin/ios/platform_view_ios.h | 93 +- .../platform/darwin/ios/platform_view_ios.mm | 143 +-- shell/platform/embedder/BUILD.gn | 8 +- shell/platform/embedder/embedder.cc | 245 ++-- shell/platform/embedder/embedder_engine.cc | 119 ++ shell/platform/embedder/embedder_engine.h | 53 + .../embedder/platform_view_embedder.cc | 53 +- .../embedder/platform_view_embedder.h | 29 +- shell/platform/linux/BUILD.gn | 23 - shell/platform/linux/main_linux.cc | 142 --- shell/platform/win/BUILD.gn | 30 - shell/platform/win/main_win.cc | 142 --- shell/testing/BUILD.gn | 26 +- shell/testing/observatory/test.dart | 20 +- shell/testing/platform_view_test.cc | 32 - shell/testing/platform_view_test.h | 38 - shell/testing/test_runner.cc | 48 - shell/testing/test_runner.h | 42 - shell/testing/tester_main.cc | 250 ++++ shell/testing/testing.cc | 24 - shell/testing/testing.h | 16 - sky/engine/platform/SharedBuffer.cpp | 1 - .../platform/fonts/FontFallbackList.cpp | 10 +- sky/engine/platform/fonts/FontFallbackList.h | 3 + sky/engine/web/Sky.cpp | 56 - synchronization/BUILD.gn | 5 +- synchronization/debug_thread_checker.h | 25 - synchronization/semaphore.cc | 6 +- testing/BUILD.gn | 4 + testing/thread_test.cc | 33 + testing/thread_test.h | 37 + tools/gn | 4 + travis/licenses_golden/licenses_flutter | 233 ++-- 346 files changed, 12585 insertions(+), 11080 deletions(-) create mode 100644 assets/asset_manager.cc create mode 100644 assets/asset_manager.h delete mode 100644 assets/asset_provider.h create mode 100644 assets/asset_resolver.h delete mode 100644 assets/unzipper_provider.cc delete mode 100644 assets/unzipper_provider.h create mode 100644 common/task_runners.cc create mode 100644 common/task_runners.h delete mode 100644 common/threads.cc delete mode 100644 common/threads.h create mode 100644 content_handler/README.md delete mode 100644 content_handler/app.cc delete mode 100644 content_handler/app.h create mode 100644 content_handler/application.cc create mode 100644 content_handler/application.h delete mode 100644 content_handler/application_controller_impl.cc delete mode 100644 content_handler/application_controller_impl.h create mode 100644 content_handler/application_runner.cc create mode 100644 content_handler/application_runner.h create mode 100644 content_handler/compositor_context.cc create mode 100644 content_handler/compositor_context.h create mode 100644 content_handler/engine.cc create mode 100644 content_handler/engine.h create mode 100644 content_handler/isolate_configurator.cc create mode 100644 content_handler/isolate_configurator.h create mode 100644 content_handler/platform_view.cc create mode 100644 content_handler/platform_view.h delete mode 100644 content_handler/rasterizer.cc delete mode 100644 content_handler/rasterizer.h delete mode 100644 content_handler/runtime_holder.cc delete mode 100644 content_handler/runtime_holder.h delete mode 100644 content_handler/service_protocol_hooks.cc delete mode 100644 content_handler/service_protocol_hooks.h create mode 100644 content_handler/surface.cc create mode 100644 content_handler/surface.h create mode 100644 content_handler/task_observers.cc create mode 100644 content_handler/task_observers.h create mode 100644 content_handler/unique_fdio_ns.h delete mode 100644 content_handler/vulkan_rasterizer.cc delete mode 100644 content_handler/vulkan_rasterizer.h delete mode 100644 flow/process_info.h create mode 100644 flow/skia_gpu_object.cc create mode 100644 flow/skia_gpu_object.h create mode 100644 fml/file.h create mode 100644 fml/macros.h create mode 100644 fml/mapping.cc create mode 100644 fml/memory/thread_checker.h create mode 100644 fml/native_library.h create mode 100644 fml/paths.cc create mode 100644 fml/platform/fuchsia/paths_fuchsia.cc create mode 100644 fml/platform/posix/file_posix.cc create mode 100644 fml/platform/posix/native_library_posix.cc create mode 100644 fml/platform/win/file_win.cc create mode 100644 fml/platform/win/native_library_win.cc create mode 100644 fml/platform/win/wstring_conversion.h delete mode 100644 fml/task_observer.h create mode 100644 fml/unique_fd.cc create mode 100644 fml/unique_fd.h create mode 100644 fml/unique_object.h delete mode 100644 lib/ui/painting/resource_context.cc delete mode 100644 lib/ui/painting/resource_context.h delete mode 100644 lib/ui/painting/utils.cc delete mode 100644 lib/ui/painting/utils.h delete mode 100644 runtime/dart_controller.cc delete mode 100644 runtime/dart_controller.h delete mode 100644 runtime/dart_init.cc delete mode 100644 runtime/dart_init.h create mode 100644 runtime/dart_isolate.cc create mode 100644 runtime/dart_isolate.h create mode 100644 runtime/dart_isolate_unittests.cc create mode 100644 runtime/dart_snapshot.cc create mode 100644 runtime/dart_snapshot.h create mode 100644 runtime/dart_snapshot_buffer.cc create mode 100644 runtime/dart_snapshot_buffer.h create mode 100644 runtime/dart_vm.cc create mode 100644 runtime/dart_vm.h create mode 100644 runtime/dart_vm_unittests.cc create mode 100644 runtime/fixtures/simple_main.dart delete mode 100644 runtime/runtime_init.cc delete mode 100644 runtime/runtime_init.h create mode 100644 runtime/service_protocol.cc create mode 100644 runtime/service_protocol.h create mode 100644 shell/common/io_manager.cc create mode 100644 shell/common/io_manager.h create mode 100644 shell/common/isolate_configuration.cc create mode 100644 shell/common/isolate_configuration.h delete mode 100644 shell/common/null_platform_view.cc delete mode 100644 shell/common/null_platform_view.h delete mode 100644 shell/common/null_rasterizer.cc delete mode 100644 shell/common/null_rasterizer.h delete mode 100644 shell/common/platform_view_service_protocol.cc delete mode 100644 shell/common/platform_view_service_protocol.h create mode 100644 shell/common/run_configuration.cc create mode 100644 shell/common/run_configuration.h create mode 100644 shell/common/shell_unittests.cc create mode 100644 shell/common/thread_host.cc create mode 100644 shell/common/thread_host.h delete mode 100644 shell/common/tracing_controller.cc delete mode 100644 shell/common/tracing_controller.h delete mode 100644 shell/gpu/gpu_rasterizer.cc delete mode 100644 shell/gpu/gpu_rasterizer.h create mode 100644 shell/platform/android/android_shell_holder.cc create mode 100644 shell/platform/android/android_shell_holder.h create mode 100644 shell/platform/android/platform_message_response_android.cc create mode 100644 shell/platform/android/platform_message_response_android.h create mode 100644 shell/platform/darwin/common/command_line.h create mode 100644 shell/platform/darwin/common/command_line.mm delete mode 100644 shell/platform/darwin/common/platform_mac.h delete mode 100644 shell/platform/darwin/common/platform_mac.mm delete mode 100644 shell/platform/darwin/common/process_info_mac.cc delete mode 100644 shell/platform/darwin/common/process_info_mac.h delete mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.h delete mode 100644 shell/platform/darwin/desktop/flutter_app_delegate.m delete mode 100644 shell/platform/darwin/desktop/flutter_application.mm rename shell/platform/darwin/desktop/{flutter_application.h => flutter_application_delegate.h} (65%) create mode 100644 shell/platform/darwin/desktop/flutter_application_delegate.mm delete mode 100644 shell/platform/darwin/desktop/flutter_mac.xib delete mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.h delete mode 100644 shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h delete mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.h delete mode 100644 shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm create mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h create mode 100644 shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm create mode 100644 shell/platform/embedder/embedder_engine.cc create mode 100644 shell/platform/embedder/embedder_engine.h delete mode 100644 shell/platform/linux/BUILD.gn delete mode 100644 shell/platform/linux/main_linux.cc delete mode 100644 shell/platform/win/BUILD.gn delete mode 100644 shell/platform/win/main_win.cc delete mode 100644 shell/testing/platform_view_test.cc delete mode 100644 shell/testing/platform_view_test.h delete mode 100644 shell/testing/test_runner.cc delete mode 100644 shell/testing/test_runner.h create mode 100644 shell/testing/tester_main.cc delete mode 100644 shell/testing/testing.cc delete mode 100644 shell/testing/testing.h delete mode 100644 synchronization/debug_thread_checker.h create mode 100644 testing/thread_test.cc create mode 100644 testing/thread_test.h diff --git a/BUILD.gn b/BUILD.gn index 24dda026c6245..b37b0b8d4054c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,14 +10,12 @@ group("flutter") { public_deps = [ "$flutter_root/lib/snapshot:generate_snapshot_bin", "$flutter_root/lib/snapshot:kernel_platform_files", + "$flutter_root/shell/testing", "$flutter_root/sky", - "$flutter_root/third_party/txt", ] if (flutter_runtime_mode != "debug") { - public_deps += [ - "$flutter_root/lib/snapshot:entry_points_json_files", - ] + public_deps += [ "$flutter_root/lib/snapshot:entry_points_json_files" ] } if (!is_fuchsia && !is_fuchsia_host) { @@ -45,20 +43,24 @@ group("flutter") { "$flutter_root/shell/platform/embedder:flutter_embedder_framework", ] } - if (!is_win) { - public_deps += [ - "$flutter_root/shell/platform/embedder:embedder_unittests", - "$flutter_root/shell/platform/embedder:flutter_engine", - ] - } + public_deps += [ "$flutter_root/flow:flow_unittests", "$flutter_root/fml:fml_unittests", + "$flutter_root/runtime:runtime_unittests", + "$flutter_root/shell/common:shell_unittests", "$flutter_root/sky/engine/wtf:wtf_unittests", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", "//garnet/public/lib/fxl:fxl_unittests", ] + + if (!is_win) { + public_deps += [ + "$flutter_root/shell/platform/embedder:embedder_unittests", + "$flutter_root/shell/platform/embedder:flutter_engine", + ] + } } } @@ -74,29 +76,23 @@ if (is_fuchsia) { "$flutter_root/content_handler:aot", ] if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] + deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] } binary = "flutter_aot_runner" if (flutter_runtime_mode != "release") { - resources = [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] + resources = [ { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + } ] } - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] + meta = [ { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + } ] } package("flutter_jit_runner") { @@ -104,29 +100,23 @@ if (is_fuchsia) { "$flutter_root/content_handler:jit", ] if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] + deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] } binary = "flutter_jit_runner" if (flutter_runtime_mode != "release") { - resources = [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] + resources = [ { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + } ] } - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] + meta = [ { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + } ] } } else { group("dist") { diff --git a/DEPS b/DEPS index a49534aa6b408..4634616669906 100644 --- a/DEPS +++ b/DEPS @@ -115,7 +115,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '8dddd90bf943a8174913564353b30a3b11ee0f7a', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '3cf97e01cdbd4bb920fa3d40282a56c4b2d62a58', # Fuchsia compatibility # diff --git a/assets/BUILD.gn b/assets/BUILD.gn index c4901375ad810..28d7e569659f1 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -4,16 +4,18 @@ source_set("assets") { sources = [ - "asset_provider.h", + "asset_manager.cc", + "asset_manager.h", + "asset_resolver.h", "directory_asset_bundle.cc", "directory_asset_bundle.h", - "unzipper_provider.cc", - "unzipper_provider.h", "zip_asset_store.cc", "zip_asset_store.h", ] deps = [ + "$flutter_root/common", + "$flutter_root/fml", "$flutter_root/glue", "//garnet/public/lib/fxl", "//garnet/public/lib/zip", @@ -23,7 +25,5 @@ source_set("assets") { "//third_party/zlib:minizip", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc new file mode 100644 index 0000000000000..9833eee923257 --- /dev/null +++ b/assets/asset_manager.cc @@ -0,0 +1,59 @@ +// Copyright 2017 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/assets/asset_manager.h" + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/glue/trace_event.h" +#include "lib/fxl/files/path.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace blink { + +AssetManager::AssetManager() = default; + +AssetManager::~AssetManager() = default; + +void AssetManager::PushFront(std::unique_ptr resolver) { + if (resolver == nullptr || !resolver->IsValid()) { + return; + } + + resolvers_.push_front(std::move(resolver)); +} + +void AssetManager::PushBack(std::unique_ptr resolver) { + if (resolver == nullptr || !resolver->IsValid()) { + return; + } + + resolvers_.push_back(std::move(resolver)); +} + +// |blink::AssetResolver| +bool AssetManager::GetAsBuffer(const std::string& asset_name, + std::vector* data) const { + if (asset_name.size() == 0) { + return false; + } + TRACE_EVENT0("flutter", "AssetManager::GetAsBuffer"); + for (const auto& resolver : resolvers_) { + if (resolver->GetAsBuffer(asset_name, data)) { + return true; + } + } + FXL_DLOG(ERROR) << "Could not find asset: " << asset_name; + return false; +} + +// |blink::AssetResolver| +bool AssetManager::IsValid() const { + return resolvers_.size() > 0; +} + +} // namespace blink diff --git a/assets/asset_manager.h b/assets/asset_manager.h new file mode 100644 index 0000000000000..fc7f3ef05210e --- /dev/null +++ b/assets/asset_manager.h @@ -0,0 +1,47 @@ +// Copyright 2017 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_ASSETS_ASSET_MANAGER_H_ +#define FLUTTER_ASSETS_ASSET_MANAGER_H_ + +#include +#include +#include + +#include "flutter/assets/asset_resolver.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" + +namespace blink { + +class AssetManager final : public AssetResolver, + public fxl::RefCountedThreadSafe { + public: + void PushFront(std::unique_ptr resolver); + + void PushBack(std::unique_ptr resolver); + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; + + private: + std::deque> resolvers_; + + AssetManager(); + + ~AssetManager(); + + FXL_DISALLOW_COPY_AND_ASSIGN(AssetManager); + FRIEND_MAKE_REF_COUNTED(AssetManager); + FRIEND_REF_COUNTED_THREAD_SAFE(AssetManager); +}; + +} // namespace blink + +#endif // FLUTTER_ASSETS_ASSET_MANAGER_H_ diff --git a/assets/asset_provider.h b/assets/asset_provider.h deleted file mode 100644 index 68b7f5c2b7b9c..0000000000000 --- a/assets/asset_provider.h +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -#ifndef FLUTTER_ASSETS_ASSET_PROVIDER_H_ -#define FLUTTER_ASSETS_ASSET_PROVIDER_H_ - -#include -#include - -#include "lib/fxl/memory/ref_counted.h" - -namespace blink { - -class AssetProvider - : public fxl::RefCountedThreadSafe - { - public: - virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data) = 0; - virtual ~AssetProvider() = default; -}; - -} // namespace blink -#endif // FLUTTER_ASSETS_ASSET_PROVIDER_H diff --git a/assets/asset_resolver.h b/assets/asset_resolver.h new file mode 100644 index 0000000000000..6cfe27961a9f4 --- /dev/null +++ b/assets/asset_resolver.h @@ -0,0 +1,32 @@ +// Copyright 2017 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_ASSETS_ASSET_RESOLVER_H_ +#define FLUTTER_ASSETS_ASSET_RESOLVER_H_ + +#include +#include + +#include "lib/fxl/macros.h" + +namespace blink { + +class AssetResolver { + public: + AssetResolver() = default; + + virtual ~AssetResolver() = default; + + virtual bool IsValid() const = 0; + + virtual bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const = 0; + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(AssetResolver); +}; + +} // namespace blink + +#endif // FLUTTER_ASSETS_ASSET_RESOLVER_H_ diff --git a/assets/directory_asset_bundle.cc b/assets/directory_asset_bundle.cc index 43933079a81bd..8e5d4df2ab977 100644 --- a/assets/directory_asset_bundle.cc +++ b/assets/directory_asset_bundle.cc @@ -3,73 +3,54 @@ // found in the LICENSE file. #include "flutter/assets/directory_asset_bundle.h" -#include "lib/fxl/build_config.h" - -#include #include +#include "flutter/fml/file.h" +#include "flutter/fml/mapping.h" #include "lib/fxl/files/eintr_wrapper.h" -#include "lib/fxl/files/file.h" -#include "lib/fxl/files/path.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/portable_unistd.h" namespace blink { -bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, - std::vector* data) { - if (fd_.is_valid()) { -#if defined(OS_WIN) - // This code path is not valid in a Windows environment. - return false; -#else - fxl::UniqueFD asset_file(openat(fd_.get(), asset_name.c_str(), O_RDONLY)); - if (!asset_file.is_valid()) - return false; - - constexpr size_t kBufferSize = 1 << 16; - size_t offset = 0; - ssize_t bytes_read = 0; - do { - offset += bytes_read; - data->resize(offset + kBufferSize); - bytes_read = read(asset_file.get(), &(*data)[offset], kBufferSize); - } while (bytes_read > 0); +DirectoryAssetBundle::DirectoryAssetBundle(fml::UniqueFD descriptor) + : descriptor_(std::move(descriptor)) { + if (!fml::IsDirectory(descriptor_)) { + return; + } + is_valid_ = true; +} - if (bytes_read < 0) { - FXL_LOG(ERROR) << "Reading " << asset_name << " failed"; - data->clear(); - return false; - } +DirectoryAssetBundle::~DirectoryAssetBundle() = default; - data->resize(offset + bytes_read); - return true; -#endif - } - std::string asset_path = GetPathForAsset(asset_name); - if (asset_path.empty()) - return false; - return files::ReadFileToVector(asset_path, data); +// |blink::AssetResolver| +bool DirectoryAssetBundle::IsValid() const { + return is_valid_; } -DirectoryAssetBundle::~DirectoryAssetBundle() {} +// |blink::AssetResolver| +bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, + std::vector* data) const { + if (data == nullptr) { + return false; + } -DirectoryAssetBundle::DirectoryAssetBundle(std::string directory) - : directory_(std::move(directory)), fd_() {} + if (!is_valid_) { + FXL_DLOG(WARNING) << "Asset bundle was not valid."; + return false; + } -DirectoryAssetBundle::DirectoryAssetBundle(fxl::UniqueFD fd) - : fd_(std::move(fd)) {} + fml::FileMapping mapping( + fml::OpenFile(descriptor_, asset_name.c_str(), fml::OpenPermission::kRead, + false /* directory */), + false /* executable */); -std::string DirectoryAssetBundle::GetPathForAsset( - const std::string& asset_name) { - std::string asset_path = files::SimplifyPath(directory_ + "/" + asset_name); - if (asset_path.find(directory_) != 0u) { - FXL_LOG(ERROR) << "Asset name '" << asset_name - << "' attempted to traverse outside asset bundle."; - return std::string(); + if (mapping.GetMapping() == nullptr) { + return false; } - return asset_path; + + data->resize(mapping.GetSize()); + memmove(data->data(), mapping.GetMapping(), mapping.GetSize()); + return true; } } // namespace blink diff --git a/assets/directory_asset_bundle.h b/assets/directory_asset_bundle.h index c710a513796ae..b594e1357fbe2 100644 --- a/assets/directory_asset_bundle.h +++ b/assets/directory_asset_bundle.h @@ -5,31 +5,31 @@ #ifndef FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ #define FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ -#include -#include - -#include "flutter/assets/asset_provider.h" -#include "lib/fxl/files/unique_fd.h" +#include "flutter/assets/asset_resolver.h" +#include "flutter/fml/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class DirectoryAssetBundle - : public AssetProvider { +class DirectoryAssetBundle : public AssetResolver { public: - explicit DirectoryAssetBundle(std::string directory); - // Expects fd to be valid, otherwise the file descriptor is ignored. - explicit DirectoryAssetBundle(fxl::UniqueFD fd); - virtual ~DirectoryAssetBundle(); - - virtual bool GetAsBuffer(const std::string& asset_name, std::vector* data); + explicit DirectoryAssetBundle(fml::UniqueFD descriptor); - std::string GetPathForAsset(const std::string& asset_name); + ~DirectoryAssetBundle() override; private: - const std::string directory_; - fxl::UniqueFD fd_; + const fml::UniqueFD descriptor_; + bool is_valid_ = false; + + std::string GetPathForAsset(const std::string& asset_name) const; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); }; diff --git a/assets/unzipper_provider.cc b/assets/unzipper_provider.cc deleted file mode 100644 index 8ed023f9a20e9..0000000000000 --- a/assets/unzipper_provider.cc +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/assets/unzipper_provider.h" - -#include "lib/fxl/logging.h" -#include "third_party/zlib/contrib/minizip/unzip.h" - -namespace blink { - -UnzipperProvider GetUnzipperProviderForPath(std::string zip_path) { - return [zip_path]() { - zip::UniqueUnzipper unzipper(unzOpen2(zip_path.c_str(), nullptr)); - if (!unzipper.is_valid()) - FXL_LOG(ERROR) << "Unable to open zip file: " << zip_path; - return unzipper; - }; -} - -} // namespace blink diff --git a/assets/unzipper_provider.h b/assets/unzipper_provider.h deleted file mode 100644 index f0f8d9597dffd..0000000000000 --- a/assets/unzipper_provider.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_ASSETS_UNZIP_PROVIDER_H_ -#define FLUTTER_ASSETS_UNZIP_PROVIDER_H_ - -#include - -#include "lib/zip/unique_unzipper.h" - -namespace blink { - -using UnzipperProvider = std::function; - -UnzipperProvider GetUnzipperProviderForPath(std::string zip_path); - -} // namespace blink - -#endif // FLUTTER_ASSETS_UNZIP_PROVIDER_H_ diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index c8534fa10c216..1b9216bd34530 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -15,21 +15,28 @@ #include #include "flutter/glue/trace_event.h" -#include "lib/fxl/files/eintr_wrapper.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/zip/unique_unzipper.h" namespace blink { -ZipAssetStore::ZipAssetStore(UnzipperProvider unzipper_provider) - : unzipper_provider_(std::move(unzipper_provider)) { +ZipAssetStore::ZipAssetStore(std::string file_path) + : file_path_(std::move(file_path)) { BuildStatCache(); } ZipAssetStore::~ZipAssetStore() = default; +zip::UniqueUnzipper ZipAssetStore::CreateUnzipper() const { + return zip::UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)}; +} + +// |blink::AssetResolver| +bool ZipAssetStore::IsValid() const { + return stat_cache_.size() > 0; +} + +// |blink::AssetResolver| bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, - std::vector* data) { + std::vector* data) const { TRACE_EVENT0("flutter", "ZipAssetStore::GetAsBuffer"); auto found = stat_cache_.find(asset_name); @@ -37,7 +44,7 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, return false; } - auto unzipper = unzipper_provider_(); + auto unzipper = CreateUnzipper(); if (!unzipper.is_valid()) { return false; @@ -73,7 +80,8 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, void ZipAssetStore::BuildStatCache() { TRACE_EVENT0("flutter", "ZipAssetStore::BuildStatCache"); - auto unzipper = unzipper_provider_(); + + auto unzipper = CreateUnzipper(); if (!unzipper.is_valid()) { return; diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h index 1ffda483ba9b7..558678e25bc08 100644 --- a/assets/zip_asset_store.h +++ b/assets/zip_asset_store.h @@ -6,21 +6,20 @@ #define FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ #include -#include -#include "flutter/assets/unzipper_provider.h" +#include "flutter/assets/asset_resolver.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" +#include "lib/zip/unique_unzipper.h" #include "third_party/zlib/contrib/minizip/unzip.h" namespace blink { -class ZipAssetStore : public fxl::RefCountedThreadSafe { +class ZipAssetStore final : public AssetResolver { public: - explicit ZipAssetStore(UnzipperProvider unzipper_provider); - ~ZipAssetStore(); + ZipAssetStore(std::string file_path); - bool GetAsBuffer(const std::string& asset_name, std::vector* data); + ~ZipAssetStore() override; private: struct CacheEntry { @@ -30,11 +29,20 @@ class ZipAssetStore : public fxl::RefCountedThreadSafe { : file_pos(p_file_pos), uncompressed_size(p_uncompressed_size) {} }; - UnzipperProvider unzipper_provider_; - std::map stat_cache_; + std::string file_path_; + mutable std::map stat_cache_; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; void BuildStatCache(); + zip::UniqueUnzipper CreateUnzipper() const; + FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); }; diff --git a/common/BUILD.gn b/common/BUILD.gn index 53b71914d49d1..47cd7d3d62644 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -12,11 +12,12 @@ source_set("common") { sources = [ "settings.cc", "settings.h", - "threads.cc", - "threads.h", + "task_runners.cc", + "task_runners.h", ] deps = [ + "$flutter_root/fml", "//garnet/public/lib/fxl", ] diff --git a/common/settings.cc b/common/settings.cc index 0198f714cbaad..85523e1b9a29f 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -4,26 +4,50 @@ #include "flutter/common/settings.h" -#include - -#include "lib/fxl/logging.h" +#include namespace blink { -namespace { - -Settings* g_settings = nullptr; - -} // namespace - -const Settings& Settings::Get() { - FXL_CHECK(g_settings); - return *g_settings; -} -void Settings::Set(const Settings& settings) { - FXL_CHECK(!g_settings); - g_settings = new Settings(); - *g_settings = settings; +std::string Settings::ToString() const { + std::stringstream stream; + stream << "Settings: " << std::endl; + stream << "aot_snapshot_path: " << aot_snapshot_path << std::endl; + stream << "script_snapshot_path: " << script_snapshot_path << std::endl; + stream << "aot_vm_snapshot_data_filename: " << aot_vm_snapshot_data_filename + << std::endl; + stream << "aot_vm_snapshot_instr_filename: " << aot_vm_snapshot_instr_filename + << std::endl; + stream << "aot_isolate_snapshot_data_filename: " + << aot_isolate_snapshot_data_filename << std::endl; + stream << "aot_isolate_snapshot_instr_filename: " + << aot_isolate_snapshot_instr_filename << std::endl; + stream << "application_library_path: " << application_library_path + << std::endl; + stream << "main_dart_file_path: " << main_dart_file_path << std::endl; + stream << "packages_file_path: " << packages_file_path << std::endl; + stream << "temp_directory_path: " << temp_directory_path << std::endl; + stream << "dart_flags:" << std::endl; + for (const auto& dart_flag : dart_flags) { + stream << " " << dart_flag << std::endl; + } + stream << "start_paused: " << start_paused << std::endl; + stream << "trace_skia: " << trace_skia << std::endl; + stream << "trace_startup: " << trace_startup << std::endl; + stream << "endless_trace_buffer: " << endless_trace_buffer << std::endl; + stream << "enable_dart_profiling: " << enable_dart_profiling << std::endl; + stream << "dart_non_checked_mode: " << dart_non_checked_mode << std::endl; + stream << "enable_observatory: " << enable_observatory << std::endl; + stream << "observatory_port: " << observatory_port << std::endl; + stream << "ipv6: " << ipv6 << std::endl; + stream << "use_test_fonts: " << use_test_fonts << std::endl; + stream << "enable_software_rendering: " << enable_software_rendering + << std::endl; + stream << "using_blink: " << using_blink << std::endl; + stream << "log_tag: " << log_tag << std::endl; + stream << "icu_data_path: " << icu_data_path << std::endl; + stream << "assets_dir: " << assets_dir << std::endl; + stream << "assets_path: " << assets_path << std::endl; + return stream.str(); } } // namespace blink diff --git a/common/settings.h b/common/settings.h index 5bb5c6cbbea42..c6c3159766a37 100644 --- a/common/settings.h +++ b/common/settings.h @@ -5,40 +5,82 @@ #ifndef FLUTTER_COMMON_SETTINGS_H_ #define FLUTTER_COMMON_SETTINGS_H_ +#include #include +#include #include #include +#include "flutter/fml/unique_fd.h" +#include "lib/fxl/functional/closure.h" + namespace blink { +using TaskObserverAdd = + std::function; +using TaskObserverRemove = std::function; + struct Settings { - bool enable_observatory = false; - // Port on target will be auto selected by the OS. A message will be printed - // on the target with the port after it has been selected. - uint32_t observatory_port = 0; - bool ipv6 = false; - bool start_paused = false; - bool trace_startup = false; - bool endless_trace_buffer = false; - bool enable_dart_profiling = false; - bool use_test_fonts = false; - bool dart_non_checked_mode = false; - bool enable_software_rendering = false; - bool using_blink = true; - std::string aot_shared_library_path; + // VM settings + std::string script_snapshot_path; + std::string kernel_snapshot_path; + std::string aot_snapshot_path; std::string aot_vm_snapshot_data_filename; std::string aot_vm_snapshot_instr_filename; std::string aot_isolate_snapshot_data_filename; std::string aot_isolate_snapshot_instr_filename; + std::string application_library_path; + std::string application_kernel_asset; + + std::string main_dart_file_path; + std::string packages_file_path; + std::string temp_directory_path; std::vector dart_flags; + + // Isolate settings + bool start_paused = false; + bool trace_skia = false; + bool trace_startup = false; + bool endless_trace_buffer = false; + bool enable_dart_profiling = false; + bool dart_non_checked_mode = false; + + // Observatory settings + bool enable_observatory = false; + // Port on target will be auto selected by the OS. A message will be printed + // on the target with the port after it has been selected. + uint32_t observatory_port = 0; + bool ipv6 = false; + + // Font settings + bool use_test_fonts = false; + + // Engine settings + TaskObserverAdd task_observer_add; + TaskObserverRemove task_observer_remove; + // The main isolate is current when this callback is made. This is a good spot + // to perform native Dart bindings for libraries not built in. + fxl::Closure root_isolate_create_callback; + // The isolate is not current and may have already been destroyed when this + // call is made. + fxl::Closure root_isolate_shutdown_callback; + bool enable_software_rendering = false; + bool using_blink = false; + bool skia_deterministic_rendering_on_cpu = false; std::string log_tag = "flutter"; + std::string icu_data_path; + + // Assets settings + fml::UniqueFD::element_type assets_dir = + fml::UniqueFD::traits_type::InvalidValue(); + std::string assets_path; + std::string flx_path; - static const Settings& Get(); - static void Set(const Settings& settings); + std::string ToString() const; }; } // namespace blink diff --git a/common/task_runners.cc b/common/task_runners.cc new file mode 100644 index 0000000000000..1a09daec1815c --- /dev/null +++ b/common/task_runners.cc @@ -0,0 +1,48 @@ +// Copyright 2017 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/common/task_runners.h" + +#include + +namespace blink { + +TaskRunners::TaskRunners(std::string label, + fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io) + : label_(std::move(label)), + platform_(std::move(platform)), + gpu_(std::move(gpu)), + ui_(std::move(ui)), + io_(std::move(io)) {} + +TaskRunners::~TaskRunners() = default; + +const std::string& TaskRunners::GetLabel() const { + return label_; +} + +fxl::RefPtr TaskRunners::GetPlatformTaskRunner() const { + return platform_; +} + +fxl::RefPtr TaskRunners::GetUITaskRunner() const { + return ui_; +} + +fxl::RefPtr TaskRunners::GetIOTaskRunner() const { + return io_; +} + +fxl::RefPtr TaskRunners::GetGPUTaskRunner() const { + return gpu_; +} + +bool TaskRunners::IsValid() const { + return platform_ && gpu_ && ui_ && io_; +} + +} // namespace blink diff --git a/common/task_runners.h b/common/task_runners.h new file mode 100644 index 0000000000000..f41ae147ebad0 --- /dev/null +++ b/common/task_runners.h @@ -0,0 +1,46 @@ +// Copyright 2017 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 + +#include "lib/fxl/macros.h" +#include "lib/fxl/tasks/task_runner.h" + +namespace blink { + +class TaskRunners { + public: + TaskRunners(std::string label, + fxl::RefPtr platform, + fxl::RefPtr gpu, + fxl::RefPtr ui, + fxl::RefPtr io); + + ~TaskRunners(); + + const std::string& GetLabel() const; + + fxl::RefPtr GetPlatformTaskRunner() const; + + fxl::RefPtr GetUITaskRunner() const; + + fxl::RefPtr GetIOTaskRunner() const; + + fxl::RefPtr GetGPUTaskRunner() const; + + bool IsValid() const; + + private: + const std::string label_; + fxl::RefPtr platform_; + fxl::RefPtr gpu_; + fxl::RefPtr ui_; + fxl::RefPtr io_; +}; +} // namespace blink + +#endif // FLUTTER_COMMON_TASK_RUNNERS_H_ diff --git a/common/threads.cc b/common/threads.cc deleted file mode 100644 index 3634d8d7c8723..0000000000000 --- a/common/threads.cc +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/common/threads.h" - -#include - -namespace blink { -namespace { - -Threads* g_threads = nullptr; - -} // namespace - -Threads::Threads() {} - -Threads::Threads(fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io) - : platform_(std::move(platform)), - gpu_(std::move(gpu)), - ui_(std::move(ui)), - io_(std::move(io)) {} - -Threads::~Threads() {} - -const fxl::RefPtr& Threads::Platform() { - return Get().platform_; -} - -const fxl::RefPtr& Threads::Gpu() { - return Get().gpu_; -} - -const fxl::RefPtr& Threads::UI() { - return Get().ui_; -} - -const fxl::RefPtr& Threads::IO() { - return Get().io_; -} - -const Threads& Threads::Get() { - FXL_CHECK(g_threads); - return *g_threads; -} - -void Threads::Set(const Threads& threads) { - FXL_CHECK(!g_threads); - g_threads = new Threads(); - *g_threads = threads; -} - -} // namespace blink diff --git a/common/threads.h b/common/threads.h deleted file mode 100644 index 456a5eba8ad97..0000000000000 --- a/common/threads.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_COMMON_THREADS_H_ -#define FLUTTER_COMMON_THREADS_H_ - -#include "lib/fxl/tasks/task_runner.h" - -#define ASSERT_IS_PLATFORM_THREAD \ - FXL_DCHECK(::blink::Threads::Platform()->RunsTasksOnCurrentThread()); -#define ASSERT_IS_GPU_THREAD \ - FXL_DCHECK(::blink::Threads::Gpu()->RunsTasksOnCurrentThread()); -#define ASSERT_IS_UI_THREAD \ - FXL_DCHECK(::blink::Threads::UI()->RunsTasksOnCurrentThread()); -#define ASSERT_IS_IO_THREAD \ - FXL_DCHECK(::blink::Threads::IO()->RunsTasksOnCurrentThread()); - -namespace blink { - -class Threads { - public: - Threads(); - Threads(fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io); - ~Threads(); - - static const fxl::RefPtr& Platform(); - static const fxl::RefPtr& Gpu(); - static const fxl::RefPtr& UI(); - static const fxl::RefPtr& IO(); - - static void Set(const Threads& settings); - - private: - static const Threads& Get(); - - fxl::RefPtr platform_; - fxl::RefPtr gpu_; - fxl::RefPtr ui_; - fxl::RefPtr io_; -}; - -} // namespace blink - -#endif // FLUTTER_COMMON_THREADS_H_ diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 6bc00b4e2786c..4778784baa643 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -20,23 +20,28 @@ template("flutter_content_handler") { sources = [ "accessibility_bridge.cc", "accessibility_bridge.h", - "app.cc", - "app.h", - "application_controller_impl.cc", - "application_controller_impl.h", + "application.cc", + "application.h", + "application_runner.cc", + "application_runner.h", + "compositor_context.cc", + "compositor_context.h", + "engine.cc", + "engine.h", "fuchsia_font_manager.cc", "fuchsia_font_manager.h", + "isolate_configurator.cc", + "isolate_configurator.h", "main.cc", - "rasterizer.cc", - "rasterizer.h", - "runtime_holder.cc", - "runtime_holder.h", - "service_protocol_hooks.cc", - "service_protocol_hooks.h", + "platform_view.cc", + "platform_view.h", "session_connection.cc", "session_connection.h", - "vulkan_rasterizer.cc", - "vulkan_rasterizer.h", + "surface.cc", + "surface.h", + "task_observers.cc", + "task_observers.h", + "unique_fdio_ns.h", "vulkan_surface.cc", "vulkan_surface.h", "vulkan_surface_pool.cc", @@ -45,18 +50,26 @@ template("flutter_content_handler") { "vulkan_surface_producer.h", ] + # The use of these dependencies is temporary and will be moved behind the + # embedder API. + flutter_deps = [ + "$flutter_root/assets", + "$flutter_root/common", + "$flutter_root/flow", + "$flutter_root/glue", + "$flutter_root/lib/ui", + "$flutter_root/runtime", + "$flutter_root/sky/engine/platform", + "$flutter_root/third_party/txt", + "$flutter_root/vulkan", + "$flutter_root/fml", + "$flutter_root/shell/common", + "$flutter_root/shell/gpu", + ] + deps = [ "//third_party/dart/runtime/bin:libdart_builtin", "//third_party/dart/runtime/platform:libdart_platform", - "$flutter_root/assets", - "$flutter_root/common", - "$flutter_root/flow", - "$flutter_root/glue", - "$flutter_root/lib/ui", - "$flutter_root/runtime", - "$flutter_root/sky/engine/platform", - "$flutter_root/third_party/txt", - "$flutter_root/vulkan", "//garnet/public/lib/app/cpp", "//garnet/public/lib/fsl", "//garnet/public/lib/fxl", @@ -73,8 +86,10 @@ template("flutter_content_handler") { "//topaz/lib/tonic", "//topaz/public/dart-pkg/fuchsia", "//topaz/public/lib/ui/flutter/sdk_ext", + "//third_party/skia:gpu", + "//third_party/zlib:minizip", "//zircon/public/lib/trace-provider", - ] + extra_deps + ] + extra_deps + flutter_deps # The flags below are needed so that Dart's CPU profiler can walk the # C++ stack. diff --git a/content_handler/README.md b/content_handler/README.md new file mode 100644 index 0000000000000..4461e808d1a47 --- /dev/null +++ b/content_handler/README.md @@ -0,0 +1,4 @@ +Flutter Application Runner +========================== + +Implements the `component::ApplicationRunner` FIDL interface to launch and run mutliple Flutter applications within the same process. diff --git a/content_handler/accessibility_bridge.cc b/content_handler/accessibility_bridge.cc index cb6f9b8e21155..f3d52f6cdbbb6 100644 --- a/content_handler/accessibility_bridge.cc +++ b/content_handler/accessibility_bridge.cc @@ -2,21 +2,22 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/content_handler/accessibility_bridge.h" +#include "accessibility_bridge.h" #include -#include "flutter/lib/ui/semantics/semantics_node.h" #include "lib/app/cpp/application_context.h" -#include "lib/fxl/macros.h" +#include "lib/context/fidl/context_writer.fidl.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/stringbuffer.h" #include "third_party/rapidjson/rapidjson/writer.h" -namespace flutter_runner { +namespace flutter { -AccessibilityBridge::AccessibilityBridge(component::ApplicationContext* context) - : writer_(context->ConnectToEnvironmentService()) {} +AccessibilityBridge::AccessibilityBridge(maxwell::ContextWriterPtr writer) + : writer_(std::move(writer)) {} + +AccessibilityBridge::~AccessibilityBridge() = default; void AccessibilityBridge::UpdateSemantics( const blink::SemanticsNodeUpdates& update) { @@ -77,4 +78,4 @@ void AccessibilityBridge::EraseUnvisitedNodes( } } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h index 7ac54e754d9b6..dde8bfaa54c36 100644 --- a/content_handler/accessibility_bridge.h +++ b/content_handler/accessibility_bridge.h @@ -2,28 +2,32 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ -#define FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ +#pragma once #include #include "flutter/lib/ui/semantics/semantics_node.h" -#include "lib/app/cpp/application_context.h" -#include +#include "lib/context/fidl/context_writer.fidl.h" +#include "lib/fxl/macros.h" -namespace flutter_runner { +namespace flutter { // Maintain an up-to-date list of SemanticsNodes on screen, and communicate // with the Context Service. -class AccessibilityBridge { +class AccessibilityBridge final { public: - explicit AccessibilityBridge(component::ApplicationContext* context); + AccessibilityBridge(maxwell::ContextWriterPtr writer); + + ~AccessibilityBridge(); // Update the internal representation of the semantics nodes, and write the // semantics to Context Service. void UpdateSemantics(const blink::SemanticsNodeUpdates& update); private: + maxwell::ContextWriterPtr writer_; + std::map semantics_nodes_; + // Walk the semantics node tree starting at |id|, and store the id of each // visited child in |visited_nodes|. void UpdateVisitedForNodeAndChildren(const int id, @@ -33,10 +37,7 @@ class AccessibilityBridge { // |visited_nodes|. void EraseUnvisitedNodes(const std::vector& visited_nodes); - std::map semantics_nodes_; - modular::ContextWriterPtr writer_; + FXL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); }; -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_ACCESSIBILITY_BRIDGE_H_ +} // namespace flutter diff --git a/content_handler/app.cc b/content_handler/app.cc deleted file mode 100644 index 1f1bde833d2f3..0000000000000 --- a/content_handler/app.cc +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/app.h" - -#include -#include - -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" -#include "flutter/content_handler/fuchsia_font_manager.h" -#include "flutter/lib/ui/text/font_collection.h" -#include "flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" -#include "lib/icu_data/cpp/icu_data.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace flutter_runner { -namespace { - -static App* g_app = nullptr; - -void QuitMessageLoop() { - fsl::MessageLoop::GetCurrent()->QuitNow(); -} - -std::string GetLabelFromURL(const std::string& url) { - size_t last_slash = url.rfind('/'); - if (last_slash == std::string::npos || last_slash + 1 == url.length()) - return url; - return url.substr(last_slash + 1); -} - -} // namespace - -App::App() { - g_app = this; - context_ = component::ApplicationContext::CreateFromStartupInfo(); - - gpu_thread_ = std::make_unique(); - io_thread_ = std::make_unique(); - - auto gpu_thread_success = gpu_thread_->Run(); - auto io_thread_success = io_thread_->Run(); - - FXL_CHECK(gpu_thread_success) << "Must be able to create the GPU thread"; - FXL_CHECK(io_thread_success) << "Must be able to create the IO thread"; - - auto ui_task_runner = fsl::MessageLoop::GetCurrent()->task_runner(); - auto gpu_task_runner = gpu_thread_->TaskRunner(); - auto io_task_runner = io_thread_->TaskRunner(); - - // Notice that the Platform and UI threads are actually the same. - blink::Threads::Set(blink::Threads(ui_task_runner, // Platform - gpu_task_runner, // GPU - ui_task_runner, // UI - io_task_runner // IO - )); - - if (!icu_data::Initialize(context_.get())) { - FXL_LOG(ERROR) << "Could not initialize ICU data."; - } - - blink::Settings settings; - settings.enable_observatory = true; - blink::Settings::Set(settings); - - fonts::FontProviderPtr font_provider( - context_->ConnectToEnvironmentService()); - if (settings.using_blink) { - blink::SetFontProvider(std::move(font_provider)); - } else { - blink::FontCollection::ForProcess().GetFontCollection()-> - SetAssetFontManager( - sk_make_sp(std::move(font_provider))); - } - - context_->outgoing_services()->AddService( - [this](fidl::InterfaceRequest request) { - runner_bindings_.AddBinding(this, std::move(request)); - }); -} - -App::~App() { - icu_data::Release(); - blink::Threads::Gpu()->PostTask(QuitMessageLoop); - blink::Threads::IO()->PostTask(QuitMessageLoop); - g_app = nullptr; -} - -App& App::Shared() { - FXL_DCHECK(g_app); - return *g_app; -} - -void App::WaitForPlatformViewIds( - std::vector* platform_view_ids) { - fxl::AutoResetWaitableEvent latch; - - blink::Threads::UI()->PostTask([this, platform_view_ids, &latch]() { - WaitForPlatformViewsIdsUIThread(platform_view_ids, &latch); - }); - - latch.Wait(); -} - -void App::WaitForPlatformViewsIdsUIThread( - std::vector* platform_view_ids, - fxl::AutoResetWaitableEvent* latch) { - for (auto it = controllers_.begin(); it != controllers_.end(); it++) { - ApplicationControllerImpl* controller = it->first; - - if (!controller) { - continue; - } - - PlatformViewInfo info; - // TODO(zra): We should create real IDs for these instead of relying on the - // address of the controller. Maybe just use the UI Isolate main port? - info.view_id = reinterpret_cast(controller); - info.isolate_id = controller->GetUIIsolateMainPort(); - info.isolate_name = controller->GetUIIsolateName(); - platform_view_ids->push_back(info); - } - latch->Signal(); -} - -void App::StartApplication( - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) { - if (controllers_.empty()) { - // Name this process after the url of the first application being launched. - base_label_ = "flutter:" + GetLabelFromURL(startup_info.launch_info.url); - } - - std::unique_ptr impl = - std::make_unique(this, std::move(application), - std::move(startup_info), - std::move(controller)); - ApplicationControllerImpl* key = impl.get(); - controllers_.emplace(key, std::move(impl)); - - UpdateProcessLabel(); -} - -void App::Destroy(ApplicationControllerImpl* controller) { - auto it = controllers_.find(controller); - if (it == controllers_.end()) - return; - controllers_.erase(it); - UpdateProcessLabel(); -} - -void App::UpdateProcessLabel() { - std::string label; - if (controllers_.size() < 2) { - label = base_label_; - } else { - std::string suffix = " (+" + std::to_string(controllers_.size() - 1) + ")"; - if (base_label_.size() + suffix.size() <= ZX_MAX_NAME_LEN - 1) { - label = base_label_ + suffix; - } else { - label = base_label_.substr(0, ZX_MAX_NAME_LEN - 1 - suffix.size() - 3) + - "..." + suffix; - } - } - zx::process::self().set_property(ZX_PROP_NAME, label.c_str(), label.size()); -} - -} // namespace flutter_runner diff --git a/content_handler/app.h b/content_handler/app.h deleted file mode 100644 index dc8c49927d897..0000000000000 --- a/content_handler/app.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_APP_H_ -#define FLUTTER_CONTENT_HANDLER_APP_H_ - -#include -#include - -#include "flutter/content_handler/application_controller_impl.h" -#include "lib/app/cpp/application_context.h" -#include -#include "lib/fsl/threading/thread.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/synchronization/waitable_event.h" - -namespace flutter_runner { - -class App : public component::ApplicationRunner { - public: - App(); - ~App(); - - static App& Shared(); - - // |component::ApplicationRunner| implementation: - - void StartApplication( - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) override; - - void Destroy(ApplicationControllerImpl* controller); - - struct PlatformViewInfo { - uintptr_t view_id; - int64_t isolate_id; - std::string isolate_name; - }; - - void WaitForPlatformViewIds(std::vector* platform_view_ids); - - private: - void WaitForPlatformViewsIdsUIThread( - std::vector* platform_view_ids, - fxl::AutoResetWaitableEvent* latch); - void UpdateProcessLabel(); - - std::unique_ptr context_; - std::unique_ptr gpu_thread_; - std::unique_ptr io_thread_; - fidl::BindingSet runner_bindings_; - std::unordered_map> - controllers_; - std::string base_label_; - - FXL_DISALLOW_COPY_AND_ASSIGN(App); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_APP_H_ diff --git a/content_handler/application.cc b/content_handler/application.cc new file mode 100644 index 0000000000000..7dd2270d42317 --- /dev/null +++ b/content_handler/application.cc @@ -0,0 +1,313 @@ +// Copyright 2018 The Fuchsia 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 "application.h" + +#include +#include + +#include + +#include "flutter/shell/common/switches.h" +#include "lib/fsl/vmo/file.h" +#include "lib/fsl/vmo/vector.h" +#include "lib/fxl/command_line.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "task_observers.h" + +namespace flutter { + +std::pair, std::unique_ptr> +Application::Create( + Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller) { + auto thread = std::make_unique(); + std::unique_ptr application; + + fxl::AutoResetWaitableEvent latch; + thread->TaskRunner()->PostTask([&]() mutable { + application.reset(new Application(delegate, // + std::move(package), // + std::move(startup_info), // + std::move(controller) // + )); + latch.Signal(); + }); + thread->Run(); + latch.Wait(); + return {std::move(thread), std::move(application)}; +} + +static std::string DebugLabelForURL(const std::string url) { + auto found = url.rfind("/"); + if (found == std::string::npos) { + return url; + } else { + return {url, found + 1}; + } +} + +Application::Application( + Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest + application_controller_request) + : delegate_(delegate), + debug_label_(DebugLabelForURL(startup_info->launch_info->url)), + application_controller_(this) { + application_controller_.set_error_handler([this]() { Kill(); }); + + FXL_DCHECK(fdio_ns_.is_valid()); + // ApplicationLaunchInfo::url non-optional. + auto& launch_info = startup_info->launch_info; + + // ApplicationLaunchInfo::arguments optional. + if (auto& arguments = launch_info->arguments) { + settings_ = shell::SettingsFromCommandLine( + fxl::CommandLineFromIterators(arguments->begin(), arguments->end())); + } + + // TODO: ApplicationLaunchInfo::out optional. + + // TODO: ApplicationLaunchInfo::err optional. + + // ApplicationLaunchInfo::service_request optional. + if (launch_info->directory_request) { + service_provider_bridge_.ServeDirectory( + std::move(launch_info->directory_request)); + } + + // ApplicationLaunchInfo::flat_namespace optional. + if (auto& flat_namespace = startup_info->flat_namespace) { + for (size_t i = 0; i < flat_namespace->paths->size(); ++i) { + const auto& path = flat_namespace->paths->at(i); + if (path == "/svc") { + continue; + } + + zx::channel dir = std::move(flat_namespace->directories->at(i)); + zx_handle_t dir_handle = dir.release(); + if (fdio_ns_bind(fdio_ns_.get(), path->data(), dir_handle) != ZX_OK) { + FXL_DLOG(ERROR) << "Could not bind path to namespace: " << path; + zx_handle_close(dir_handle); + } + } + } else { + FXL_DLOG(ERROR) << "There was no flat namespace."; + } + + application_directory_.reset(fdio_ns_opendir(fdio_ns_.get())); + FXL_DCHECK(application_directory_.is_valid()); + + application_assets_directory_.reset( + openat(application_directory_.get(), "pkg/data", O_RDONLY | O_DIRECTORY)); + + // TODO: ApplicationLaunchInfo::additional_services optional. + + // ApplicationPackage::data: This is legacy FLX data. Ensure that we dont have + // any. + FXL_DCHECK(!package->data) << "Legacy FLX data must not be supplied."; + + // All launch arguments have been read. Perform service binding and + // final settings configuration. The next call will be to create a view + // for this application. + + service_provider_bridge_.AddService( + std::bind(&Application::CreateShellForView, this, std::placeholders::_1)); + + component::ServiceProviderPtr outgoing_services; + outgoing_services_request_ = outgoing_services.NewRequest(); + service_provider_bridge_.set_backend(std::move(outgoing_services)); + + // Setup the application controller binding. + if (application_controller_request) { + application_controller_.Bind(std::move(application_controller_request)); + } + + application_context_ = + component::ApplicationContext::CreateFrom(std::move(startup_info)); + + settings_.enable_observatory = true; + + settings_.icu_data_path = ""; + + settings_.using_blink = false; + + settings_.assets_dir = application_assets_directory_.get(); + + settings_.script_snapshot_path = "snapshot_blob.bin"; + + settings_.log_tag = debug_label_ + std::string{"(flutter)"}; + +#ifndef NDEBUG + // Debug mode + settings_.dart_non_checked_mode = false; +#else // NDEBUG + // Release mode + settings_.dart_non_checked_mode = true; +#endif // NDEBUG + + settings_.task_observer_add = + std::bind(&CurrentMessageLoopAddAfterTaskObserver, std::placeholders::_1, + std::placeholders::_2); + + settings_.task_observer_remove = std::bind( + &CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1); + + AttemptVMLaunchWithCurrentSettings(settings_); +} + +Application::~Application() = default; + +void Application::AttemptVMLaunchWithCurrentSettings( + const blink::Settings& settings) const { + if (blink::DartVM::ForProcessIfInitialized()) { + return; + } + + if (!blink::DartVM::IsRunningPrecompiledCode()) { + // We will be initializing the VM lazily in this case. + return; + } + + fsl::SizedVmo dylib_vmo; + + if (!fsl::VmoFromFilenameAt( + application_assets_directory_.get() /* /pkg/data */, "libapp.so", + &dylib_vmo)) { + FXL_LOG(ERROR) << "Dylib containing VM and isolate snapshots does not " + "exist. Will not be able to launch VM."; + return; + } + + dlerror(); + + auto library_handle = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); + + if (library_handle == nullptr) { + FXL_LOG(ERROR) << "Could not open dylib: " << dlerror(); + return; + } + + auto lib = fxl::MakeRefCounted( + library_handle, // library handle + true // close the handle when done + ); + + auto symbol = [](const char* str) { + return std::string{"_"} + std::string{str}; + }; + + fxl::RefPtr vm_snapshot = + fxl::MakeRefCounted( + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kVMDataSymbol).c_str()), + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kVMInstructionsSymbol).c_str())); + + fxl::RefPtr isolate_snapshot = + fxl::MakeRefCounted( + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kIsolateDataSymbol).c_str()), + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, + symbol(blink::DartSnapshot::kIsolateInstructionsSymbol).c_str())); + + blink::DartVM::ForProcess(settings_, // + std::move(vm_snapshot), // + std::move(isolate_snapshot) // + ); + if (blink::DartVM::ForProcessIfInitialized()) { + FXL_DLOG(INFO) << "VM successfully initialized for AOT mode."; + } else { + FXL_LOG(ERROR) << "VM could not be initialized for AOT mode."; + } +} + +// |component::ApplicationController| +void Application::Kill() { + if (last_return_code_.first) { + for (auto wait_callback : wait_callbacks_) { + wait_callback(last_return_code_.second); + } + } + wait_callbacks_.clear(); + + delegate_.OnApplicationTerminate(this); + // WARNING: Don't do anything past this point as this instance may have been + // collected. +} + +// |component::ApplicationController| +void Application::Detach() { + application_controller_.set_error_handler(nullptr); +} + +// |component::ApplicationController| +void Application::Wait(const WaitCallback& callback) { + wait_callbacks_.emplace_back(std::move(callback)); +} + +// |flutter::Engine::Delegate| +void Application::OnEngineTerminate(const Engine* shell_holder) { + auto found = std::find_if(shell_holders_.begin(), shell_holders_.end(), + [shell_holder](const auto& holder) { + return holder.get() == shell_holder; + }); + + if (found == shell_holders_.end()) { + return; + } + + // We may launch multiple shell in this application. However, we will + // terminate when the last shell goes away. The error code return to the + // application controller will be the last isolate that had an error. + auto return_code = shell_holder->GetEngineReturnCode(); + if (return_code.first) { + last_return_code_ = return_code; + } + + shell_holders_.erase(found); + + if (shell_holders_.size() == 0) { + Kill(); + // WARNING: Don't do anything past this point because the delegate may have + // collected this instance via the termination callback. + } +} + +void Application::CreateShellForView( + f1dl::InterfaceRequest view_provider_request) { + shells_bindings_.AddBinding(this, std::move(view_provider_request)); +} + +// |mozart::ViewProvider| +void Application::CreateView( + f1dl::InterfaceRequest view_owner, + f1dl::InterfaceRequest) { + if (!application_context_) { + FXL_DLOG(ERROR) << "Application context was invalid when attempting to " + "create a shell for a view provider request."; + return; + } + + // This method may be called multiple times. Care must be taken to ensure that + // all arguments can be accessed or synthesized multiple times. + // TODO(chinmaygarde): Figure out how to re-create the outgoing service + // request handle. + shell_holders_.emplace(std::make_unique( + *this, // delegate + debug_label_, // thread label + *application_context_, // application context + settings_, // settings + std::move(view_owner), // view owner + fdio_ns_, // FDIO namespace + std::move(outgoing_services_request_) // outgoing request + )); +} + +} // namespace flutter diff --git a/content_handler/application.h b/content_handler/application.h new file mode 100644 index 0000000000000..e4f5da105cac8 --- /dev/null +++ b/content_handler/application.h @@ -0,0 +1,97 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include +#include +#include + +#include "engine.h" +#include "flutter/common/settings.h" +#include "lib/app/cpp/application_context.h" +#include "lib/app/fidl/application_controller.fidl.h" +#include "lib/fidl/cpp/bindings/binding_set.h" +#include "lib/fsl/threading/thread.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" +#include "lib/svc/cpp/service_provider_bridge.h" +#include "lib/ui/views/fidl/view_provider.fidl.h" +#include "unique_fdio_ns.h" + +namespace flutter { + +// Represents an instance of a Flutter application that contains one of more +// Flutter engine instances. +class Application final : public Engine::Delegate, + public component::ApplicationController, + public mozart::ViewProvider { + public: + class Delegate { + public: + virtual void OnApplicationTerminate(const Application* application) = 0; + }; + + // Creates a dedicated thread to run the application and constructions the + // application on it. The application can be accessed only on this thread. + // This is a synchronous operation. + static std::pair, std::unique_ptr> + Create(Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller); + + // Must be called on the same thread returned from the create call. The thread + // may be collected after. + ~Application(); + + private: + blink::Settings settings_; + Delegate& delegate_; + const std::string debug_label_; + UniqueFDIONS fdio_ns_ = UniqueFDIONSCreate(); + fxl::UniqueFD application_directory_; + fxl::UniqueFD application_assets_directory_; + f1dl::Binding application_controller_; + f1dl::InterfaceRequest outgoing_services_request_; + component::ServiceProviderBridge service_provider_bridge_; + std::unique_ptr application_context_; + f1dl::BindingSet shells_bindings_; + std::set> shell_holders_; + std::vector wait_callbacks_; + std::pair last_return_code_; + + Application( + Application::Delegate& delegate, + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller); + + // |component::ApplicationController| + void Kill() override; + + // |component::ApplicationController| + void Detach() override; + + // |component::ApplicationController| + void Wait(const WaitCallback& callback) override; + + // |mozart::ViewProvider| + void CreateView( + f1dl::InterfaceRequest view_owner, + f1dl::InterfaceRequest services) override; + + // |flutter::Engine::Delegate| + void OnEngineTerminate(const Engine* holder) override; + + void CreateShellForView( + f1dl::InterfaceRequest view_provider_request); + + void AttemptVMLaunchWithCurrentSettings( + const blink::Settings& settings) const; + + FXL_DISALLOW_COPY_AND_ASSIGN(Application); +}; + +} // namespace flutter diff --git a/content_handler/application_controller_impl.cc b/content_handler/application_controller_impl.cc deleted file mode 100644 index 9a1b449138a1b..0000000000000 --- a/content_handler/application_controller_impl.cc +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/application_controller_impl.h" - -#include - -#include -#include - -#include "flutter/content_handler/app.h" -#include "flutter/content_handler/runtime_holder.h" -#include "lib/app/cpp/connect.h" -#include "lib/fsl/vmo/vector.h" -#include "lib/fxl/logging.h" - -namespace flutter_runner { - -ApplicationControllerImpl::ApplicationControllerImpl( - App* app, - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) - : app_(app), binding_(this) { - if (controller.is_valid()) { - binding_.Bind(std::move(controller)); - binding_.set_error_handler([this] { - app_->Destroy(this); - // |this| has been deleted at this point. - }); - } - - std::vector bundle; - if (application.data) { - if (!fsl::VectorFromVmo(std::move(*application.data), &bundle)) { - FXL_LOG(ERROR) << "Failed to receive bundle."; - return; - } - } - - // TODO(jeffbrown): Decide what to do with command-line arguments and - // startup handles. - - if (startup_info.launch_info.directory_request.is_valid()) { - service_provider_bridge_.ServeDirectory( - std::move(startup_info.launch_info.directory_request)); - } - - service_provider_bridge_.AddService( - [this](fidl::InterfaceRequest request) { - view_provider_bindings_.AddBinding(this, std::move(request)); - }); - - component::ServiceProviderPtr service_provider; - auto request = service_provider.NewRequest(); - service_provider_bridge_.set_backend(std::move(service_provider)); - - fdio_ns_t* fdio_ns = SetupNamespace(&startup_info.flat_namespace); - if (fdio_ns == nullptr) { - FXL_LOG(ERROR) << "Failed to initialize namespace"; - return; - } - - url_ = startup_info.launch_info.url; - runtime_holder_.reset(new RuntimeHolder()); - runtime_holder_->SetMainIsolateShutdownCallback([this]() { Kill(); }); - runtime_holder_->Init( - fdio_ns, - component::ApplicationContext::CreateFrom(std::move(startup_info)), - std::move(request), std::move(bundle)); -} - -ApplicationControllerImpl::~ApplicationControllerImpl() = default; - -constexpr char kServiceRootPath[] = "/svc"; - -fdio_ns_t* ApplicationControllerImpl::SetupNamespace( - component::FlatNamespace* flat) { - fdio_ns_t* fdio_namespc; - zx_status_t status = fdio_ns_create(&fdio_namespc); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Failed to create namespace"; - return nullptr; - } - for (size_t i = 0; i < flat->paths->size(); ++i) { - if (flat->paths->at(i) == kServiceRootPath) { - // Ownership of /svc goes to the ApplicationContext created above. - continue; - } - zx::channel dir = std::move(flat->directories->at(i)); - zx_handle_t dir_handle = dir.release(); - const char* path = flat->paths->at(i)->data(); - status = fdio_ns_bind(fdio_namespc, path, dir_handle); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Failed to bind " << flat->paths->at(i) - << " to namespace"; - zx_handle_close(dir_handle); - fdio_ns_destroy(fdio_namespc); - return nullptr; - } - } - return fdio_namespc; -} - -void ApplicationControllerImpl::Kill() { - SendReturnCode(runtime_holder_->return_code()); - runtime_holder_.reset(); - app_->Destroy(this); - // |this| has been deleted at this point. -} - -void ApplicationControllerImpl::Detach() { - binding_.set_error_handler(fxl::Closure()); -} - -void ApplicationControllerImpl::Wait(WaitCallback callback) { - wait_callbacks_.push_back(std::move(callback)); -} - -void ApplicationControllerImpl::SendReturnCode(int32_t return_code) { - for (const auto& iter : wait_callbacks_) { - iter(return_code); - } - wait_callbacks_.clear(); -} - -void ApplicationControllerImpl::CreateView( - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services) { - runtime_holder_->CreateView(url_, std::move(view_owner_request), - std::move(services)); -} - -Dart_Port ApplicationControllerImpl::GetUIIsolateMainPort() { - if (!runtime_holder_) - return ILLEGAL_PORT; - return runtime_holder_->GetUIIsolateMainPort(); -} - -std::string ApplicationControllerImpl::GetUIIsolateName() { - if (!runtime_holder_) { - return ""; - } - return runtime_holder_->GetUIIsolateName(); -} - -} // namespace flutter_runner diff --git a/content_handler/application_controller_impl.h b/content_handler/application_controller_impl.h deleted file mode 100644 index 01700f2886ffb..0000000000000 --- a/content_handler/application_controller_impl.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ -#define FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ - -#include - -#include - -#include -#include -#include - -#include "lib/fidl/cpp/binding.h" -#include "lib/fidl/cpp/binding_set.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "lib/svc/cpp/service_provider_bridge.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace flutter_runner { -class App; -class RuntimeHolder; - -class ApplicationControllerImpl : public component::ApplicationController, - public views_v1::ViewProvider { - public: - ApplicationControllerImpl( - App* app, - component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller); - - ~ApplicationControllerImpl() override; - - // |component::ApplicationController| implementation - - void Kill() override; - void Detach() override; - void Wait(WaitCallback callback) override; - - // |views_v1::ViewProvider| implementation - - void CreateView( - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services) override; - - Dart_Port GetUIIsolateMainPort(); - std::string GetUIIsolateName(); - - private: - void StartRuntimeIfReady(); - void SendReturnCode(int32_t return_code); - - fdio_ns_t* SetupNamespace(component::FlatNamespace* flat); - - App* app_; - fidl::Binding binding_; - - component::ServiceProviderBridge service_provider_bridge_; - - fidl::BindingSet view_provider_bindings_; - - std::string url_; - std::unique_ptr runtime_holder_; - - std::vector wait_callbacks_; - - FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationControllerImpl); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_ diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc new file mode 100644 index 0000000000000..2d77f43cbdd45 --- /dev/null +++ b/content_handler/application_runner.cc @@ -0,0 +1,90 @@ +// Copyright 2018 The Fuchsia 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 "application_runner.h" + +#include + +#include "flutter/lib/ui/text/font_collection.h" +#include "fuchsia_font_manager.h" +#include "lib/fonts/fidl/font_provider.fidl.h" +#include "lib/icu_data/cpp/icu_data.h" + +namespace flutter { + +ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) + : on_termination_callback_(std::move(on_termination_callback)), + host_context_(component::ApplicationContext::CreateFromStartupInfo()) { + SetupICU(); + + SetupGlobalFonts(); + + const std::string process_label = "flutter"; + zx::process::self().set_property(ZX_PROP_NAME, process_label.c_str(), + process_label.size()); + + host_context_->outgoing_services()->AddService( + std::bind(&ApplicationRunner::RegisterApplication, this, + std::placeholders::_1)); + + active_applications_bindings_.set_empty_set_handler( + [this]() { FireTerminationCallbackIfNecessary(); }); +} + +ApplicationRunner::~ApplicationRunner() { + host_context_->outgoing_services() + ->RemoveService(); +} + +void ApplicationRunner::RegisterApplication( + f1dl::InterfaceRequest request) { + active_applications_bindings_.AddBinding(this, std::move(request)); +} + +void ApplicationRunner::StartApplication( + component::ApplicationPackagePtr package, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest controller) { + auto thread_application_pair = + Application::Create(*this, // delegate + std::move(package), // application pacakge + std::move(startup_info), // startup info + std::move(controller) // controller request + ); + active_applications_[thread_application_pair.second.get()] = + std::move(thread_application_pair); +} + +void ApplicationRunner::OnApplicationTerminate(const Application* application) { + active_applications_.erase(application); + FireTerminationCallbackIfNecessary(); +} + +void ApplicationRunner::SetupICU() { + if (!icu_data::Initialize(host_context_.get())) { + FXL_LOG(ERROR) << "Could not initialize ICU data."; + } +} + +void ApplicationRunner::SetupGlobalFonts() { + fonts::FontProviderPtr font_provider( + host_context_->ConnectToEnvironmentService()); + auto font_manager = + sk_make_sp(std::move(font_provider)); + blink::FontCollection::ForProcess() + .GetFontCollection() + ->SetDefaultFontManager(std::move(font_manager)); +} + +void ApplicationRunner::FireTerminationCallbackIfNecessary() { + // We have no reason to exist if: + // 1: No previously launched applications are running. + // 2: No bindings exist that may require launching more applications. + if (on_termination_callback_ && active_applications_.size() == 0 && + active_applications_bindings_.size() == 0) { + on_termination_callback_(); + } +} + +} // namespace flutter diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h new file mode 100644 index 0000000000000..fdf5b4420dc0f --- /dev/null +++ b/content_handler/application_runner.h @@ -0,0 +1,79 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include +#include + +#include "application.h" +#include "lib/app/cpp/application_context.h" +#include "lib/app/fidl/application_runner.fidl.h" +#include "lib/fidl/cpp/bindings/binding_set.h" +#include "lib/fsl/tasks/message_loop.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/macros.h" + +namespace flutter { + +// Publishes the |component::ApplicationRunner| service and runs applications on +// their own threads. +class ApplicationRunner final : public Application::Delegate, + public component::ApplicationRunner { + public: + ApplicationRunner(fxl::Closure on_termination_callback); + + ~ApplicationRunner(); + + private: + struct ActiveApplication { + std::unique_ptr thread; + std::unique_ptr application; + + ActiveApplication(std::pair, + std::unique_ptr> pair) + : thread(std::move(pair.first)), application(std::move(pair.second)) {} + + ActiveApplication() { + if (thread && application) { + thread->TaskRunner()->PostTask( + fxl::MakeCopyable([application = std::move(application)]() mutable { + application.reset(); + fsl::MessageLoop::GetCurrent()->PostQuitTask(); + })); + thread.reset(); // join + } + } + }; + + fxl::Closure on_termination_callback_; + std::unique_ptr host_context_; + f1dl::BindingSet active_applications_bindings_; + std::unordered_map + active_applications_; + + // |component::ApplicationRunner| + void StartApplication(component::ApplicationPackagePtr application, + component::ApplicationStartupInfoPtr startup_info, + f1dl::InterfaceRequest + controller) override; + + void RegisterApplication( + f1dl::InterfaceRequest request); + + void UnregisterApplication(const Application* application); + + // |Application::Delegate| + void OnApplicationTerminate(const Application* application) override; + + void SetupICU(); + + void SetupGlobalFonts(); + + void FireTerminationCallbackIfNecessary(); + + FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationRunner); +}; + +} // namespace flutter diff --git a/content_handler/compositor_context.cc b/content_handler/compositor_context.cc new file mode 100644 index 0000000000000..efad9ac2b9583 --- /dev/null +++ b/content_handler/compositor_context.cc @@ -0,0 +1,86 @@ +// Copyright 2018 The Fuchsia 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 "compositor_context.h" + +#include "flutter/flow/layers/layer_tree.h" +#include "flutter/glue/trace_event.h" + +namespace flutter { + +class ScopedFrame final : public flow::CompositorContext::ScopedFrame { + public: + ScopedFrame(flow::CompositorContext& context, + bool instrumentation_enabled, + SessionConnection& session_connection) + : flow::CompositorContext::ScopedFrame(context, + nullptr, + nullptr, + instrumentation_enabled), + session_connection_(session_connection) {} + + private: + SessionConnection& session_connection_; + + bool Raster(flow::LayerTree& layer_tree, bool ignore_raster_cache) override { + if (!session_connection_.has_metrics()) { + return true; + } + + { + // Preroll the Flutter layer tree. This allows Flutter to perform + // pre-paint optimizations. + TRACE_EVENT0("flutter", "Preroll"); + layer_tree.Preroll(*this, true /* ignore raster cache */); + } + + { + // Traverse the Flutter layer tree so that the necessary session ops to + // represent the frame are enqueued in the underlying session. + TRACE_EVENT0("flutter", "UpdateScene"); + layer_tree.UpdateScene(session_connection_.scene_update_context(), + session_connection_.root_node()); + } + + { + // Flush all pending session ops. + TRACE_EVENT0("flutter", "SessionPresent"); + session_connection_.Present(*this); + } + + return true; + } + + FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); +}; + +CompositorContext::CompositorContext( + const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback) + : debug_label_(std::move(debug_label)), + session_connection_(scenic, + debug_label_, + std::move(import_token), + std::move(session_metrics_did_change_callback), + std::move(session_error_callback)) {} + +CompositorContext::~CompositorContext() = default; + +std::unique_ptr +CompositorContext::AcquireFrame(GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled) { + // TODO: The AcquireFrame interface is too broad and must be refactored to get + // rid of the context and canvas arguments as those seem to be only used for + // colorspace correctness purposes on the mobile shells. + return std::make_unique(*this, // + instrumentation_enabled, // + session_connection_ // + ); +} + +} // namespace flutter diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h new file mode 100644 index 0000000000000..a6e5429c6072c --- /dev/null +++ b/content_handler/compositor_context.h @@ -0,0 +1,39 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "flutter/flow/compositor_context.h" +#include "garnet/public/lib/ui/scenic/fidl/scenic.fidl-common.h" +#include "lib/fxl/macros.h" +#include "session_connection.h" + +namespace flutter { + +// Holds composition specific state and bindings specific to composition on +// Fuchsia. +class CompositorContext final : public flow::CompositorContext { + public: + CompositorContext(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback); + + ~CompositorContext() override; + + private: + const std::string debug_label_; + SessionConnection session_connection_; + + // |flow::CompositorContext| + std::unique_ptr AcquireFrame( + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled) override; + + FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); +}; + +} // namespace flutter diff --git a/content_handler/engine.cc b/content_handler/engine.cc new file mode 100644 index 0000000000000..3349c09bdf1af --- /dev/null +++ b/content_handler/engine.cc @@ -0,0 +1,258 @@ +// Copyright 2018 The Fuchsia 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 "engine.h" + +#include + +#include "flutter/common/task_runners.h" +#include "flutter/fml/task_runner.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/run_configuration.h" +#include "lib/fsl/tasks/message_loop.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "platform_view.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace flutter { + +Engine::Engine(Delegate& delegate, + std::string thread_label, + component::ApplicationContext& application_context, + blink::Settings settings, + f1dl::InterfaceRequest view_owner, + const UniqueFDIONS& fdio_ns, + f1dl::InterfaceRequest + outgoing_services_request) + : delegate_(delegate), + thread_label_(std::move(thread_label)), + settings_(std::move(settings)), + weak_factory_(this) { + // Launch the threads that will be used to run the shell. These threads will + // be joined in the destructor. + for (auto& thread : host_threads_) { + thread.Run(); + } + + mozart::ViewManagerPtr view_manager; + application_context.ConnectToEnvironmentService(view_manager.NewRequest()); + + zx::eventpair import_token, export_token; + if (zx::eventpair::create(0u, &import_token, &export_token) != ZX_OK) { + FXL_DLOG(ERROR) << "Could not create event pair."; + return; + } + + // Setup the session connection. + ui::ScenicPtr scenic; + view_manager->GetScenic(scenic.NewRequest()); + + // Grab the parent environent services. The platform view may want to access + // some of these services. + component::ServiceProviderPtr parent_environment_service_provider; + application_context.environment()->GetServices( + parent_environment_service_provider.NewRequest()); + + // We need to manually schedule a frame when the session metrics change. + OnMetricsUpdate on_session_metrics_change_callback = std::bind( + &Engine::OnSessionMetricsDidChange, this, std::placeholders::_1); + + fxl::Closure on_session_error_callback = std::bind(&Engine::Terminate, this); + + // Grab the accessibilty context writer that can understand the semtics tree + // on the platform view. + maxwell::ContextWriterPtr accessibility_context_writer; + application_context.ConnectToEnvironmentService( + accessibility_context_writer.NewRequest()); + + // Setup the callback that will instantiate the platform view. + shell::Shell::CreateCallback on_create_platform_view = + fxl::MakeCopyable([debug_label = thread_label_, // + parent_environment_service_provider = + std::move(parent_environment_service_provider), // + view_manager = std::ref(view_manager), // + view_owner = std::move(view_owner), // + scenic = std::move(scenic), // + accessibility_context_writer = + std::move(accessibility_context_writer), // + export_token = std::move(export_token), // + import_token = std::move(import_token), // + on_session_metrics_change_callback, // + on_session_error_callback // + ](shell::Shell& shell) mutable { + return std::make_unique( + shell, // delegate + debug_label, // debug label + shell.GetTaskRunners(), // task runners + std::move(parent_environment_service_provider), // services + view_manager, // view manager + std::move(view_owner), // view owner + std::move(scenic), // scenic + std::move(export_token), // export token + std::move(import_token), // import token + std::move( + accessibility_context_writer), // accessibility context writer + std::move(on_session_metrics_change_callback), // metrics change + std::move(on_session_error_callback) // session_error + ); + }); + + // Setup the callback that will instantiate the rasterizer. + shell::Shell::CreateCallback on_create_rasterizer = + [](shell::Shell& shell) { + return std::make_unique( + shell.GetTaskRunners() // task runners + ); + }; + + // Get the task runners from the managed threads. The current thread will be + // used as the "platform" thread. + blink::TaskRunners task_runners( + thread_label_, // Dart thread labels + fsl::MessageLoop::GetCurrent()->task_runner(), // platform + host_threads_[0].TaskRunner(), // gpu + host_threads_[1].TaskRunner(), // ui + host_threads_[2].TaskRunner() // io + ); + + settings_.root_isolate_create_callback = + std::bind(&Engine::OnMainIsolateStart, this); + + settings_.root_isolate_shutdown_callback = + std::bind([weak = weak_factory_.GetWeakPtr(), + runner = task_runners.GetPlatformTaskRunner()]() { + runner->PostTask([weak = std::move(weak)] { + if (weak) { + weak->OnMainIsolateShutdown(); + } + }); + }); + + shell_ = shell::Shell::Create( + task_runners, // host task runners + settings_, // shell launch settings + on_create_platform_view, // platform view create callback + on_create_rasterizer // rasterizer create callback + ); + + if (!shell_) { + FXL_LOG(ERROR) << "Could not launch the shell with settings: " + << settings_.ToString(); + return; + } + + // Shell has been created. Before we run the engine, setup the isolate + // configurator. + { + PlatformView* platform_view = + static_cast(shell_->GetPlatformView().get()); + auto& view = platform_view->GetMozartView(); + component::ApplicationEnvironmentPtr application_environment; + application_context.ConnectToEnvironmentService( + application_environment.NewRequest()); + + isolate_configurator_ = std::make_unique( + fdio_ns, // + view, // + std::move(application_environment), // + std::move(outgoing_services_request) // + ); + } + + // This platform does not get a separate surface platform view creation + // notification. Fire one eagerly. + shell_->GetPlatformView()->NotifyCreated(); + + // Launch the engine in the appropriate configuration. + auto run_configuration = + shell::RunConfiguration::InferFromSettings(settings_); + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = shell_->GetEngine(), // + run_configuration = std::move(run_configuration) // + ]() mutable { + if (!engine || !engine->Run(std::move(run_configuration))) { + FXL_LOG(ERROR) << "Could not (re)launch the engine in configuration"; + } + })); + + UpdateNativeThreadLabelNames(); +} + +Engine::~Engine() { + for (const auto& thread : host_threads_) { + thread.TaskRunner()->PostTask( + []() { fsl::MessageLoop::GetCurrent()->PostQuitTask(); }); + } +} + +void Engine::UpdateNativeThreadLabelNames() const { + auto set_thread_name = [](fxl::RefPtr runner, + std::string prefix, std::string suffix) { + runner->PostTask([name = prefix + suffix]() { + zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); + }); + }; + auto runners = shell_->GetTaskRunners(); + set_thread_name(runners.GetPlatformTaskRunner(), thread_label_, ".platform"); + set_thread_name(runners.GetUITaskRunner(), thread_label_, ".ui"); + set_thread_name(runners.GetGPUTaskRunner(), thread_label_, ".gpu"); + set_thread_name(runners.GetIOTaskRunner(), thread_label_, ".io"); +} + +std::pair Engine::GetEngineReturnCode() const { + std::pair code(false, 0); + if (!shell_) { + return code; + } + fxl::AutoResetWaitableEvent latch; + fml::TaskRunner::RunNowOrPostTask( + shell_->GetTaskRunners().GetUITaskRunner(), + [&latch, &code, engine = shell_->GetEngine()]() { + if (engine) { + code = engine->GetUIIsolateReturnCode(); + } + latch.Signal(); + }); + latch.Wait(); + return code; +} + +void Engine::OnMainIsolateStart() { + if (!isolate_configurator_ || + !isolate_configurator_->ConfigureCurrentIsolate()) { + FXL_LOG(ERROR) << "Could not configure some native embedder bindings for a " + "new root isolate."; + } +} + +void Engine::OnMainIsolateShutdown() { + Terminate(); +} + +void Engine::Terminate() { + delegate_.OnEngineTerminate(this); + // Warning. Do not do anything after this point as the delegate may have + // collected this object. +} + +void Engine::OnSessionMetricsDidChange(double device_pixel_ratio) { + if (!shell_) { + return; + } + + shell_->GetTaskRunners().GetPlatformTaskRunner()->PostTask( + [platform_view = shell_->GetPlatformView(), device_pixel_ratio]() { + if (platform_view) { + reinterpret_cast(platform_view.get()) + ->UpdateViewportMetrics(device_pixel_ratio); + } + }); +} + +} // namespace flutter diff --git a/content_handler/engine.h b/content_handler/engine.h new file mode 100644 index 0000000000000..60c0ad7c2f80d --- /dev/null +++ b/content_handler/engine.h @@ -0,0 +1,63 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "flutter/shell/common/shell.h" +#include "isolate_configurator.h" +#include "lib/app/cpp/application_context.h" +#include "lib/fsl/threading/thread.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "lib/ui/views/fidl/view_manager.fidl.h" + +namespace flutter { + +// Represents an instance of running Flutter engine along with the threads that +// host the same. +class Engine final { + public: + class Delegate { + public: + virtual void OnEngineTerminate(const Engine* holder) = 0; + }; + + Engine(Delegate& delegate, + std::string thread_label, + component::ApplicationContext& application_context, + blink::Settings settings, + f1dl::InterfaceRequest view_owner, + const UniqueFDIONS& fdio_ns, + f1dl::InterfaceRequest + outgoing_services_request); + + ~Engine(); + + // Returns the Dart return code for the root isolate if one is present. This + // call is thread safe and synchronous. This call must be made infrequently. + std::pair GetEngineReturnCode() const; + + private: + Delegate& delegate_; + const std::string thread_label_; + blink::Settings settings_; + std::array host_threads_; + std::unique_ptr isolate_configurator_; + std::unique_ptr shell_; + fxl::WeakPtrFactory weak_factory_; + + void OnMainIsolateStart(); + + void OnMainIsolateShutdown(); + + void Terminate(); + + void OnSessionMetricsDidChange(double device_pixel_ratio); + + void UpdateNativeThreadLabelNames() const; + + FXL_DISALLOW_COPY_AND_ASSIGN(Engine); +}; + +} // namespace flutter diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc index 4e409cae94f6a..877c931130eb4 100644 --- a/content_handler/fuchsia_font_manager.cc +++ b/content_handler/fuchsia_font_manager.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "flutter/content_handler/fuchsia_font_manager.h" +#include "fuchsia_font_manager.h" #include @@ -32,14 +32,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromBuffer(mem::Buffer data) { - if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || - data.size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { + if (!fsl::SizedVmo::IsSizeValid(vmo->vmo, vmo->size) || + vmo->size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = data.size; + uint64_t size = vmo->size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, vmo->vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -49,7 +49,7 @@ sk_sp MakeSkDataFromBuffer(mem::Buffer data) { fonts::FontSlant ToFontSlant(SkFontStyle::Slant slant) { return (slant == SkFontStyle::kItalic_Slant) ? fonts::FontSlant::ITALIC - : fonts::FontSlant::UPRIGHT; + : fonts::FontSlant::UPRIGHT; } } // anonymous namespace @@ -64,7 +64,8 @@ int FuchsiaFontManager::onCountFamilies() const { return 0; } -void FuchsiaFontManager::onGetFamilyName(int index, SkString* familyName) const { +void FuchsiaFontManager::onGetFamilyName(int index, + SkString* familyName) const { FXL_DCHECK(false); } @@ -87,12 +88,13 @@ SkFontStyleSet* FuchsiaFontManager::onMatchFamily( } SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( - const char family_name[], const SkFontStyle& style) const { - fonts::FontRequest request; - request.family = family_name; - request.weight = style.weight(); - request.width = style.width(); - request.slant = ToFontSlant(style.slant()); + const char family_name[], + const SkFontStyle& style) const { + auto request = fonts::FontRequest::New(); + request->family = family_name; + request->weight = style.weight(); + request->width = style.width(); + request->slant = ToFontSlant(style.slant()); fonts::FontResponsePtr response; font_provider_->GetFont( @@ -100,14 +102,13 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( [&response](fonts::FontResponsePtr r) { response = std::move(r); }); font_provider_.WaitForResponse(); - FXL_DCHECK(response) - << "Unable to contact the font provider. Did you run " - "Flutter in an environment that has a font manager?\n"; - - if (!response) + if (!response) { + FXL_DLOG(ERROR) << "Unable to contact the font provider. Did you run " + "Flutter in an environment that has a font manager?"; return nullptr; + } - sk_sp data = MakeSkDataFromBuffer(std::move(response->data.buffer)); + sk_sp data = MakeSkDataFromVMO(response->data->vmo); if (!data) return nullptr; @@ -127,13 +128,13 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyleCharacter( } SkTypeface* FuchsiaFontManager::onMatchFaceStyle(const SkTypeface*, - const SkFontStyle&) const { + const SkFontStyle&) const { FXL_DCHECK(false); return nullptr; } sk_sp FuchsiaFontManager::onMakeFromData(sk_sp, - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } @@ -153,7 +154,7 @@ sk_sp FuchsiaFontManager::onMakeFromStreamArgs( } sk_sp FuchsiaFontManager::onMakeFromFile(const char path[], - int ttcIndex) const { + int ttcIndex) const { FXL_DCHECK(false); return nullptr; } diff --git a/content_handler/fuchsia_font_manager.h b/content_handler/fuchsia_font_manager.h index e57d6ef76e72f..ecfb724b85878 100644 --- a/content_handler/fuchsia_font_manager.h +++ b/content_handler/fuchsia_font_manager.h @@ -26,7 +26,7 @@ namespace txt { -class FuchsiaFontManager : public SkFontMgr { +class FuchsiaFontManager final : public SkFontMgr { public: FuchsiaFontManager(fonts::FontProviderPtr provider); diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc new file mode 100644 index 0000000000000..d085bea698b95 --- /dev/null +++ b/content_handler/isolate_configurator.cc @@ -0,0 +1,114 @@ +// Copyright 2018 The Fuchsia 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 "isolate_configurator.h" + +#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" +#include "dart-pkg/zircon/sdk_ext/handle.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/ui/flutter/sdk_ext/src/natives.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace flutter { + +IsolateConfigurator::IsolateConfigurator( + const UniqueFDIONS& fdio_ns, + mozart::ViewPtr& view, + component::ApplicationEnvironmentPtr application_environment, + f1dl::InterfaceRequest + outgoing_services_request) + : fdio_ns_(fdio_ns), + view_(view), + application_environment_(std::move(application_environment)), + outgoing_services_request_(std::move(outgoing_services_request)) {} + +IsolateConfigurator::~IsolateConfigurator() = default; + +bool IsolateConfigurator::ConfigureCurrentIsolate() { + if (used_) { + return false; + } + used_ = true; + + BindFuchsia(); + BindZircon(); + BindDartIO(); + BindScenic(); + + return true; +} + +// |mozart::NativesDelegate| +mozart::View* IsolateConfigurator::GetMozartView() { + return view_.get(); +} + +void IsolateConfigurator::BindFuchsia() { + fuchsia::dart::Initialize(application_environment_.Unbind(), + std::move(outgoing_services_request_)); +} + +void IsolateConfigurator::BindZircon() { + // Tell dart:zircon about the FDIO namespace configured for this instance. + Dart_Handle zircon_lib = Dart_LookupLibrary(tonic::ToDart("dart:zircon")); + DART_CHECK_VALID(zircon_lib); + + Dart_Handle namespace_type = + Dart_GetType(zircon_lib, tonic::ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + DART_CHECK_VALID( + Dart_SetField(namespace_type, // + tonic::ToDart("_namespace"), // + tonic::ToDart(reinterpret_cast(fdio_ns_.get())))); +} + +void IsolateConfigurator::BindDartIO() { + // Grab the dart:io lib. + Dart_Handle io_lib = Dart_LookupLibrary(tonic::ToDart("dart:io")); + DART_CHECK_VALID(io_lib); + + // Disable dart:io exit() + Dart_Handle embedder_config_type = + Dart_GetType(io_lib, tonic::ToDart("_EmbedderConfig"), 0, nullptr); + DART_CHECK_VALID(embedder_config_type); + DART_CHECK_VALID(Dart_SetField(embedder_config_type, + tonic::ToDart("_mayExit"), Dart_False())); + + // Tell dart:io about the FDIO namespace configured for this instance. + Dart_Handle namespace_type = + Dart_GetType(io_lib, tonic::ToDart("_Namespace"), 0, nullptr); + DART_CHECK_VALID(namespace_type); + Dart_Handle namespace_args[] = { + Dart_NewInteger(reinterpret_cast(fdio_ns_.get())), // + }; + DART_CHECK_VALID(namespace_args[0]); + DART_CHECK_VALID(Dart_Invoke(namespace_type, tonic::ToDart("_setupNamespace"), + 1, namespace_args)); +} + +void IsolateConfigurator::BindScenic() { + Dart_Handle mozart_internal = + Dart_LookupLibrary(tonic::ToDart("dart:mozart.internal")); + DART_CHECK_VALID(mozart_internal); + DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, // + mozart::NativeLookup, // + mozart::NativeSymbol) // + ); + DART_CHECK_VALID(Dart_SetField( + mozart_internal, // + tonic::ToDart("_context"), // + tonic::DartConverter::ToDart(reinterpret_cast( + static_cast(this))))); + mozart::ViewContainerPtr view_container; + view_->GetContainer(view_container.NewRequest()); + DART_CHECK_VALID( + Dart_SetField(mozart_internal, // + tonic::ToDart("_viewContainer"), // + tonic::ToDart(zircon::dart::Handle::Create( + view_container.Unbind().TakeChannel().release())))); +} + +} // namespace flutter diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h new file mode 100644 index 0000000000000..a5da083633ee7 --- /dev/null +++ b/content_handler/isolate_configurator.h @@ -0,0 +1,55 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "lib/app/fidl/application_environment.fidl.h" +#include "lib/fxl/macros.h" +#include "lib/ui/flutter/sdk_ext/src/natives.h" +#include "lib/ui/views/fidl/view_containers.fidl.h" +#include "lib/ui/views/fidl/views.fidl.h" +#include "unique_fdio_ns.h" + +namespace flutter { + +// Contains all the information necessary to configure a new root isolate. This +// is a single use item. The lifetime of this object must extend past that of +// the root isolate. +class IsolateConfigurator final : mozart::NativesDelegate { + public: + IsolateConfigurator( + const UniqueFDIONS& fdio_ns, + mozart::ViewPtr& view, + component::ApplicationEnvironmentPtr application_environment, + f1dl::InterfaceRequest + outgoing_services_request); + + ~IsolateConfigurator(); + + // Can be used only once and only on the UI thread with the newly created + // isolate already current. + bool ConfigureCurrentIsolate(); + + private: + bool used_ = false; + const UniqueFDIONS& fdio_ns_; + mozart::ViewPtr& view_; + component::ApplicationEnvironmentPtr application_environment_; + f1dl::InterfaceRequest outgoing_services_request_; + + // |mozart::NativesDelegate| + mozart::View* GetMozartView() override; + + void BindFuchsia(); + + void BindZircon(); + + void BindDartIO(); + + void BindScenic(); + + FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfigurator); +}; + +} // namespace flutter diff --git a/content_handler/main.cc b/content_handler/main.cc index d3eac3c81dcbf..15b8cede5b9b2 100644 --- a/content_handler/main.cc +++ b/content_handler/main.cc @@ -1,16 +1,26 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. +// Copyright 2018 The Fuchsia 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 +#include -#include "flutter/content_handler/app.h" +#include "application_runner.h" #include "lib/fsl/tasks/message_loop.h" -int main(int argc, const char** argv) { +int main(int argc, char const* argv[]) { fsl::MessageLoop loop; + trace::TraceProvider provider(loop.async()); - flutter_runner::App app; + FXL_DCHECK(provider.is_valid()) << "Trace provider must be valid."; + + FXL_LOG(INFO) << "Flutter application services initialized."; + flutter::ApplicationRunner runner([&loop]() { + loop.PostQuitTask(); + FXL_LOG(INFO) << "Flutter application services terminated. Good bye..."; + }); + loop.Run(); - return 0; + + return EXIT_SUCCESS; } diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc new file mode 100644 index 0000000000000..8ac41613e449b --- /dev/null +++ b/content_handler/platform_view.cc @@ -0,0 +1,551 @@ +// Copyright 2018 The Fuchsia 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 RAPIDJSON_HAS_STDSTRING 1 + +#include "platform_view.h" + +#include + +#include "flutter/lib/ui/window/pointer_data.h" +#include "lib/app/cpp/connect.h" +#include "third_party/rapidjson/rapidjson/document.h" +#include "third_party/rapidjson/rapidjson/stringbuffer.h" +#include "third_party/rapidjson/rapidjson/writer.h" + +namespace flutter { + +constexpr char kFlutterPlatformChannel[] = "flutter/platform"; +constexpr char kTextInputChannel[] = "flutter/textinput"; +constexpr char kKeyEventChannel[] = "flutter/keyevent"; + +PlatformView::PlatformView( + PlatformView::Delegate& delegate, + std::string debug_label, + blink::TaskRunners task_runners, + component::ServiceProviderPtr parent_environment_service_provider, + mozart::ViewManagerPtr& view_manager, + f1dl::InterfaceRequest view_owner, + ui::ScenicPtr scenic, + zx::eventpair export_token, + zx::eventpair import_token, + maxwell::ContextWriterPtr accessibility_context_writer, + OnMetricsUpdate on_session_metrics_did_change, + fxl::Closure session_error_callback) + : shell::PlatformView(delegate, std::move(task_runners)), + debug_label_(std::move(debug_label)), + view_listener_(this), + input_listener_(this), + ime_client_(this), + scenic_(std::move(scenic)), + accessibility_bridge_(std::move(accessibility_context_writer)), + surface_( + std::make_unique(scenic_, + debug_label_, + std::move(import_token), + std::move(on_session_metrics_did_change), + std::move(session_error_callback))) { + // Create the view. + view_manager->CreateView(view_.NewRequest(), // view + std::move(view_owner), // view owner + view_listener_.NewBinding(), // view listener + std::move(export_token), // export token + debug_label_ // diagnostic label + ); + + // Get the services from the created view. + component::ServiceProviderPtr service_provider; + view_->GetServiceProvider(service_provider.NewRequest()); + + // Get the input connection from the services of the view. + component::ConnectToService(service_provider.get(), + input_connection_.NewRequest()); + + // Set the input listener on the input connection. + input_connection_->SetEventListener(input_listener_.NewBinding()); + + // Access the clipboard. + component::ConnectToService(parent_environment_service_provider.get(), + clipboard_.NewRequest()); + + // Finally! Register the native platform message handlers. + RegisterPlatformMessageHandlers(); +} + +PlatformView::~PlatformView() = default; + +void PlatformView::RegisterPlatformMessageHandlers() { + platform_message_handlers_[kFlutterPlatformChannel] = + std::bind(&PlatformView::HandleFlutterPlatformChannelPlatformMessage, // + this, // + std::placeholders::_1); + platform_message_handlers_[kTextInputChannel] = + std::bind(&PlatformView::HandleFlutterTextInputChannelPlatformMessage, // + this, // + std::placeholders::_1); +} + +mozart::ViewPtr& PlatformView::GetMozartView() { + return view_; +} + +// |mozart::ViewListener| +void PlatformView::OnPropertiesChanged( + mozart::ViewPropertiesPtr properties, + const OnPropertiesChangedCallback& callback) { + UpdateViewportMetrics(properties->view_layout); + callback(); +} + +void PlatformView::UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout) { + if (!layout) { + return; + } + + metrics_.size.width = layout->size->width; + metrics_.size.height = layout->size->height; + + metrics_.padding.left = layout->inset->left; + metrics_.padding.top = layout->inset->top; + metrics_.padding.right = layout->inset->right; + metrics_.padding.bottom = layout->inset->bottom; + + FlushViewportMetrics(); +} + +void PlatformView::UpdateViewportMetrics(double pixel_ratio) { + metrics_.scale = pixel_ratio; + + FlushViewportMetrics(); +} + +void PlatformView::FlushViewportMetrics() { + const auto scale = metrics_.scale; + blink::ViewportMetrics metrics = { + .device_pixel_ratio = static_cast(scale), + + .physical_width = static_cast(metrics_.size.width * scale), + .physical_height = static_cast(metrics_.size.height * scale), + + .physical_padding_top = + static_cast(metrics_.padding.top * scale), + .physical_padding_right = + static_cast(metrics_.padding.right * scale), + .physical_padding_bottom = + static_cast(metrics_.padding.bottom * scale), + .physical_padding_left = + static_cast(metrics_.padding.left * scale), + + .physical_view_inset_top = + static_cast(metrics_.view_inset.top * scale), + .physical_view_inset_right = + static_cast(metrics_.view_inset.right * scale), + .physical_view_inset_bottom = + static_cast(metrics_.view_inset.bottom * scale), + .physical_view_inset_left = + static_cast(metrics_.view_inset.left * scale), + }; + + SetViewportMetrics(metrics); +} + +// |mozart::InputMethodEditorClient| +void PlatformView::DidUpdateState(mozart::TextInputStatePtr state, + mozart::InputEventPtr event) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + rapidjson::Value encoded_state(rapidjson::kObjectType); + encoded_state.AddMember("text", state->text.get(), allocator); + encoded_state.AddMember("selectionBase", state->selection->base, allocator); + encoded_state.AddMember("selectionExtent", state->selection->extent, + allocator); + switch (state->selection->affinity) { + case mozart::TextAffinity::UPSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.upstream"), + allocator); + break; + case mozart::TextAffinity::DOWNSTREAM: + encoded_state.AddMember("selectionAffinity", + rapidjson::Value("TextAffinity.downstream"), + allocator); + break; + } + encoded_state.AddMember("selectionIsDirectional", true, allocator); + encoded_state.AddMember("composingBase", state->composing->start, allocator); + encoded_state.AddMember("composingExtent", state->composing->end, allocator); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + args.PushBack(encoded_state, allocator); + + document.SetObject(); + document.AddMember("method", + rapidjson::Value("TextInputClient.updateEditingState"), + allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, // channel + std::vector(data, data + buffer.GetSize()), // message + nullptr) // response + ); +} + +// |mozart::InputMethodEditorClient| +void PlatformView::OnAction(mozart::InputMethodAction action) { + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + + rapidjson::Value args(rapidjson::kArrayType); + args.PushBack(current_text_input_client_, allocator); + + // Done is currently the only text input action defined by Flutter. + args.PushBack("TextInputAction.done", allocator); + + document.SetObject(); + document.AddMember( + "method", rapidjson::Value("TextInputClient.performAction"), allocator); + document.AddMember("args", args, allocator); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + DispatchPlatformMessage(fxl::MakeRefCounted( + kTextInputChannel, // channel + std::vector(data, data + buffer.GetSize()), // message + nullptr) // response + ); +} + +// |mozart::InputListener| +void PlatformView::OnEvent(mozart::InputEventPtr event, + const OnEventCallback& callback) { + using Type = mozart::InputEvent::Tag; + switch (event->which()) { + case Type::POINTER: + callback(OnHandlePointerEvent(event->get_pointer())); + return; + case Type::KEYBOARD: + callback(OnHandleKeyboardEvent(event->get_keyboard())); + return; + case Type::FOCUS: + callback(OnHandleFocusEvent(event->get_focus())); + return; + case Type::__UNKNOWN__: + break; + } + + callback(false); +} + +static blink::PointerData::Change GetChangeFromPointerEventPhase( + mozart::PointerEvent::Phase phase) { + switch (phase) { + case mozart::PointerEvent::Phase::ADD: + return blink::PointerData::Change::kAdd; + case mozart::PointerEvent::Phase::HOVER: + return blink::PointerData::Change::kHover; + case mozart::PointerEvent::Phase::DOWN: + return blink::PointerData::Change::kDown; + case mozart::PointerEvent::Phase::MOVE: + return blink::PointerData::Change::kMove; + case mozart::PointerEvent::Phase::UP: + return blink::PointerData::Change::kUp; + case mozart::PointerEvent::Phase::REMOVE: + return blink::PointerData::Change::kRemove; + case mozart::PointerEvent::Phase::CANCEL: + return blink::PointerData::Change::kCancel; + default: + return blink::PointerData::Change::kCancel; + } +} + +static blink::PointerData::DeviceKind GetKindFromPointerType( + mozart::PointerEvent::Type type) { + switch (type) { + case mozart::PointerEvent::Type::TOUCH: + return blink::PointerData::DeviceKind::kTouch; + case mozart::PointerEvent::Type::MOUSE: + return blink::PointerData::DeviceKind::kMouse; + default: + return blink::PointerData::DeviceKind::kTouch; + } +} + +bool PlatformView::OnHandlePointerEvent( + const mozart::PointerEventPtr& pointer) { + blink::PointerData pointer_data; + pointer_data.time_stamp = pointer->event_time / 1000; + pointer_data.change = GetChangeFromPointerEventPhase(pointer->phase); + pointer_data.kind = GetKindFromPointerType(pointer->type); + pointer_data.device = pointer->pointer_id; + pointer_data.physical_x = pointer->x * metrics_.scale; + pointer_data.physical_y = pointer->y * metrics_.scale; + + switch (pointer_data.change) { + case blink::PointerData::Change::kDown: + down_pointers_.insert(pointer_data.device); + break; + case blink::PointerData::Change::kCancel: + case blink::PointerData::Change::kUp: + down_pointers_.erase(pointer_data.device); + break; + case blink::PointerData::Change::kMove: + if (down_pointers_.count(pointer_data.device) == 0) { + pointer_data.change = blink::PointerData::Change::kHover; + } + break; + case blink::PointerData::Change::kAdd: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received add event for down pointer."; + } + break; + case blink::PointerData::Change::kRemove: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received remove event for down pointer."; + } + break; + case blink::PointerData::Change::kHover: + if (down_pointers_.count(pointer_data.device) != 0) { + FXL_DLOG(ERROR) << "Received hover event for down pointer."; + } + break; + } + + auto packet = std::make_unique(1); + packet->SetPointerData(0, pointer_data); + DispatchPointerDataPacket(std::move(packet)); + return true; +} + +bool PlatformView::OnHandleKeyboardEvent( + const mozart::KeyboardEventPtr& keyboard) { + const char* type = nullptr; + if (keyboard->phase == mozart::KeyboardEvent::Phase::PRESSED) { + type = "keydown"; + } else if (keyboard->phase == mozart::KeyboardEvent::Phase::REPEAT) { + type = "keydown"; // TODO change this to keyrepeat + } else if (keyboard->phase == mozart::KeyboardEvent::Phase::RELEASED) { + type = "keyup"; + } + + if (type == nullptr) { + FXL_DLOG(ERROR) << "Unknown key event phase."; + return false; + } + + rapidjson::Document document; + auto& allocator = document.GetAllocator(); + document.SetObject(); + document.AddMember("type", rapidjson::Value(type, strlen(type)), allocator); + document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); + document.AddMember("hidUsage", keyboard->hid_usage, allocator); + document.AddMember("codePoint", keyboard->code_point, allocator); + document.AddMember("modifiers", keyboard->modifiers, allocator); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + + const uint8_t* data = reinterpret_cast(buffer.GetString()); + DispatchPlatformMessage(fxl::MakeRefCounted( + kKeyEventChannel, // channel + std::vector(data, data + buffer.GetSize()), // data + nullptr) // response + ); + + return true; +} + +bool PlatformView::OnHandleFocusEvent(const mozart::FocusEventPtr& focus) { + if (!focus->focused && current_text_input_client_ != 0) { + current_text_input_client_ = 0; + if (ime_) { + ime_->Hide(); + ime_ = nullptr; + } + if (ime_client_.is_bound()) { + ime_client_.Unbind(); + } + return true; + } + return false; +} + +// |shell::PlatformView| +std::unique_ptr PlatformView::CreateRenderingSurface() { + // This platform does not repeatly lose and gain a surface connection. So the + // surface is setup once during platform view setup and and returned to the + // shell on the initial (and only) |NotifyCreated| call. + return std::move(surface_); +} + +// |shell::PlatformView| +void PlatformView::HandlePlatformMessage( + fxl::RefPtr message) { + if (!message) { + return; + } + auto found = platform_message_handlers_.find(message->channel()); + if (found == platform_message_handlers_.end()) { + FXL_DLOG(ERROR) + << "Platform view received message on channel '" << message->channel() + << "' with no registed handler. And empty response will be generated. " + "Please implement the native message handler."; + PlatformView::HandlePlatformMessage(std::move(message)); + return; + } + found->second(std::move(message)); +} + +// |shell::PlatformView| +void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) { + accessibility_bridge_.UpdateSemantics(update); +} + +// Channel handler for kFlutterPlatformChannel +void PlatformView::HandleFlutterPlatformChannelPlatformMessage( + fxl::RefPtr message) { + FXL_DCHECK(message->channel() == kFlutterPlatformChannel); + const auto& data = message->data(); + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) { + return; + } + + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) { + return; + } + + fxl::RefPtr response = message->response(); + if (method->value == "Clipboard.setData") { + auto text = root["args"]["text"].GetString(); + clipboard_->Push(text); + response->CompleteEmpty(); + } else if (method->value == "Clipboard.getData") { + clipboard_->Peek([response](const f1dl::String& text) { + rapidjson::StringBuffer json_buffer; + rapidjson::Writer writer(json_buffer); + writer.StartArray(); + writer.StartObject(); + writer.Key("text"); + writer.String(text); + writer.EndObject(); + writer.EndArray(); + std::string result = json_buffer.GetString(); + response->Complete(std::vector{result.begin(), result.end()}); + }); + } else { + response->CompleteEmpty(); + } +} + +// Channel handler for kTextInputChannel +void PlatformView::HandleFlutterTextInputChannelPlatformMessage( + fxl::RefPtr message) { + FXL_DCHECK(message->channel() == kTextInputChannel); + const auto& data = message->data(); + rapidjson::Document document; + document.Parse(reinterpret_cast(data.data()), data.size()); + if (document.HasParseError() || !document.IsObject()) { + return; + } + auto root = document.GetObject(); + auto method = root.FindMember("method"); + if (method == root.MemberEnd() || !method->value.IsString()) { + return; + } + + if (method->value == "TextInput.show") { + if (ime_) { + ime_->Show(); + } + } else if (method->value == "TextInput.hide") { + if (ime_) { + ime_->Hide(); + } + } else if (method->value == "TextInput.setClient") { + current_text_input_client_ = 0; + if (ime_client_.is_bound()) + ime_client_.Unbind(); + ime_ = nullptr; + + auto args = root.FindMember("args"); + if (args == root.MemberEnd() || !args->value.IsArray() || + args->value.Size() != 2) + return; + const auto& configuration = args->value[1]; + if (!configuration.IsObject()) { + return; + } + // TODO(abarth): Read the keyboard type from the configuration. + current_text_input_client_ = args->value[0].GetInt(); + mozart::TextInputStatePtr state = mozart::TextInputState::New(); + state->text = std::string(); + state->selection = mozart::TextSelection::New(); + state->composing = mozart::TextRange::New(); + input_connection_->GetInputMethodEditor( + mozart::KeyboardType::TEXT, mozart::InputMethodAction::DONE, + std::move(state), ime_client_.NewBinding(), ime_.NewRequest()); + } else if (method->value == "TextInput.setEditingState") { + if (ime_) { + auto args_it = root.FindMember("args"); + if (args_it == root.MemberEnd() || !args_it->value.IsObject()) { + return; + } + const auto& args = args_it->value; + mozart::TextInputStatePtr state = mozart::TextInputState::New(); + state->selection = mozart::TextSelection::New(); + state->composing = mozart::TextRange::New(); + // TODO(abarth): Deserialize state. + auto text = args.FindMember("text"); + if (text != args.MemberEnd() && text->value.IsString()) + state->text = text->value.GetString(); + auto selection_base = args.FindMember("selectionBase"); + if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) + state->selection->base = selection_base->value.GetInt(); + auto selection_extent = args.FindMember("selectionExtent"); + if (selection_extent != args.MemberEnd() && + selection_extent->value.IsInt()) + state->selection->extent = selection_extent->value.GetInt(); + auto selection_affinity = args.FindMember("selectionAffinity"); + if (selection_affinity != args.MemberEnd() && + selection_affinity->value.IsString() && + selection_affinity->value == "TextAffinity.upstream") + state->selection->affinity = mozart::TextAffinity::UPSTREAM; + else + state->selection->affinity = mozart::TextAffinity::DOWNSTREAM; + // We ignore selectionIsDirectional because that concept doesn't exist on + // Fuchsia. + auto composing_base = args.FindMember("composingBase"); + if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) + state->composing->start = composing_base->value.GetInt(); + auto composing_extent = args.FindMember("composingExtent"); + if (composing_extent != args.MemberEnd() && + composing_extent->value.IsInt()) + state->composing->end = composing_extent->value.GetInt(); + ime_->SetState(std::move(state)); + } + } else if (method->value == "TextInput.clearClient") { + current_text_input_client_ = 0; + if (ime_client_.is_bound()) + ime_client_.Unbind(); + ime_ = nullptr; + } else { + FXL_DLOG(ERROR) << "Unknown " << message->channel() << " method " + << method->value.GetString(); + } +} + +} // namespace flutter diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h new file mode 100644 index 0000000000000..9888d061352bb --- /dev/null +++ b/content_handler/platform_view.h @@ -0,0 +1,120 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include +#include + +#include "accessibility_bridge.h" +#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/shell/common/platform_view.h" +#include "lib/clipboard/fidl/clipboard.fidl.h" +#include "lib/fidl/cpp/bindings/binding.h" +#include "lib/fxl/macros.h" +#include "lib/ui/input/fidl/input_connection.fidl.h" +#include "lib/ui/views/fidl/view_manager.fidl.h" +#include "lib/ui/views/fidl/views.fidl.h" +#include "surface.h" + +namespace flutter { + +// The per engine component residing on the platform thread is responsible for +// all platform specific integrations. +class PlatformView final : public shell::PlatformView, + public mozart::ViewListener, + public mozart::InputMethodEditorClient, + public mozart::InputListener { + public: + PlatformView( + PlatformView::Delegate& delegate, + std::string debug_label, + blink::TaskRunners task_runners, + component::ServiceProviderPtr parent_environment_service_provider, + mozart::ViewManagerPtr& view_manager, + f1dl::InterfaceRequest view_owner, + ui::ScenicPtr scenic, + zx::eventpair export_token, + zx::eventpair import_token, + maxwell::ContextWriterPtr accessibility_context_writer, + OnMetricsUpdate on_session_metrics_did_change, + fxl::Closure session_error_callback); + + ~PlatformView(); + + void UpdateViewportMetrics(double pixel_ratio); + + mozart::ViewPtr& GetMozartView(); + + private: + const std::string debug_label_; + mozart::ViewPtr view_; + f1dl::Binding view_listener_; + mozart::InputConnectionPtr input_connection_; + f1dl::Binding input_listener_; + int current_text_input_client_ = 0; + f1dl::Binding ime_client_; + mozart::InputMethodEditorPtr ime_; + modular::ClipboardPtr clipboard_; + ui::ScenicPtr scenic_; + AccessibilityBridge accessibility_bridge_; + std::unique_ptr surface_; + blink::LogicalMetrics metrics_; + std::set down_pointers_; + std::map< + std::string /* channel */, + std::function /* message */)> /* handler */> + platform_message_handlers_; + + void RegisterPlatformMessageHandlers(); + + void UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout); + + void FlushViewportMetrics(); + + // |mozart::ViewListener| + void OnPropertiesChanged( + mozart::ViewPropertiesPtr properties, + const OnPropertiesChangedCallback& callback) override; + + // |mozart::InputMethodEditorClient| + void DidUpdateState(mozart::TextInputStatePtr state, + mozart::InputEventPtr event) override; + + // |mozart::InputMethodEditorClient| + void OnAction(mozart::InputMethodAction action) override; + + // |mozart::InputListener| + void OnEvent(mozart::InputEventPtr event, + const OnEventCallback& callback) override; + + bool OnHandlePointerEvent(const mozart::PointerEventPtr& pointer); + + bool OnHandleKeyboardEvent(const mozart::KeyboardEventPtr& keyboard); + + bool OnHandleFocusEvent(const mozart::FocusEventPtr& focus); + + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; + + // |shell::PlatformView| + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + // Channel handler for kFlutterPlatformChannel + void HandleFlutterPlatformChannelPlatformMessage( + fxl::RefPtr message); + + // Channel handler for kTextInputChannel + void HandleFlutterTextInputChannelPlatformMessage( + fxl::RefPtr message); + + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); +}; + +} // namespace flutter diff --git a/content_handler/rasterizer.cc b/content_handler/rasterizer.cc deleted file mode 100644 index b720809b17a45..0000000000000 --- a/content_handler/rasterizer.cc +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/rasterizer.h" -#include "flutter/content_handler/vulkan_rasterizer.h" - -namespace flutter_runner { - -Rasterizer::~Rasterizer() = default; - -std::unique_ptr Rasterizer::Create() { - auto vulkan_rasterizer = std::make_unique(); - FXL_CHECK(vulkan_rasterizer) - << "The vulkan rasterizer must be correctly initialized."; - return vulkan_rasterizer; -} - -} // namespace flutter_runner diff --git a/content_handler/rasterizer.h b/content_handler/rasterizer.h deleted file mode 100644 index 398f262a568cd..0000000000000 --- a/content_handler/rasterizer.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ -#define FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ - -#include - -#include - -#include "flutter/flow/layers/layer_tree.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" - -namespace flutter_runner { - -class Rasterizer { - public: - virtual ~Rasterizer(); - - static std::unique_ptr Create(); - - virtual void SetScene( - fidl::InterfaceHandle mozart, - zx::eventpair import_token, - fxl::Closure metrics_changed_callback) = 0; - - virtual void Draw(std::unique_ptr layer_tree, - fxl::Closure callback) = 0; -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_RASTERIZER_H_ diff --git a/content_handler/runtime_holder.cc b/content_handler/runtime_holder.cc deleted file mode 100644 index 421731b9691d0..0000000000000 --- a/content_handler/runtime_holder.cc +++ /dev/null @@ -1,911 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/content_handler/runtime_holder.h" - -#include -#include -#include -#include -#include - -#include "dart-pkg/zircon/sdk_ext/handle.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/common/threads.h" -#include "flutter/content_handler/accessibility_bridge.h" -#include "flutter/content_handler/rasterizer.h" -#include "flutter/content_handler/service_protocol_hooks.h" -#include "flutter/lib/snapshot/snapshot.h" -#include "flutter/lib/ui/window/pointer_data_packet.h" -#include "flutter/runtime/asset_font_selector.h" -#include "flutter/runtime/dart_controller.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/runtime_init.h" -#include "lib/app/cpp/connect.h" -#include "lib/fsl/vmo/vector.h" -#include "lib/fxl/files/path.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/zip/create_unzipper.h" -#include "third_party/dart/runtime/include/dart_api.h" -#include "third_party/rapidjson/rapidjson/document.h" -#include "third_party/rapidjson/rapidjson/stringbuffer.h" -#include "third_party/rapidjson/rapidjson/writer.h" - -using tonic::DartConverter; -using tonic::ToDart; - -namespace flutter_runner { -namespace { - -constexpr char kKernelKey[] = "kernel_blob.bin"; -constexpr char kSnapshotKey[] = "snapshot_blob.bin"; -constexpr char kDylibKey[] = "libapp.so"; -constexpr char kAssetChannel[] = "flutter/assets"; -constexpr char kKeyEventChannel[] = "flutter/keyevent"; -constexpr char kTextInputChannel[] = "flutter/textinput"; -constexpr char kFlutterPlatformChannel[] = "flutter/platform"; -constexpr char kFuchsiaPackageResourceDirectory[] = "pkg/data"; -constexpr char kDartPkgContentsKey[] = "dart-pkg/contents"; - -void SetThreadName(fxl::RefPtr runner, std::string name) { - runner->PostTask([name]() { - zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); - Dart_SetThreadName(name.c_str()); - }); -} - -blink::PointerData::Change GetChangeFromPointerEventPhase( - input::PointerEventPhase phase) { - switch (phase) { - case input::PointerEventPhase::ADD: - return blink::PointerData::Change::kAdd; - case input::PointerEventPhase::HOVER: - return blink::PointerData::Change::kHover; - case input::PointerEventPhase::DOWN: - return blink::PointerData::Change::kDown; - case input::PointerEventPhase::MOVE: - return blink::PointerData::Change::kMove; - case input::PointerEventPhase::UP: - return blink::PointerData::Change::kUp; - case input::PointerEventPhase::REMOVE: - return blink::PointerData::Change::kRemove; - case input::PointerEventPhase::CANCEL: - return blink::PointerData::Change::kCancel; - default: - return blink::PointerData::Change::kCancel; - } -} - -blink::PointerData::DeviceKind GetKindFromPointerType( - input::PointerEventType type) { - switch (type) { - case input::PointerEventType::TOUCH: - return blink::PointerData::DeviceKind::kTouch; - case input::PointerEventType::MOUSE: - return blink::PointerData::DeviceKind::kMouse; - default: - return blink::PointerData::DeviceKind::kTouch; - } -} - -} // namespace - -RuntimeHolder::RuntimeHolder() - : view_listener_binding_(this), - input_listener_binding_(this), - text_input_binding_(this), - weak_factory_(this) {} - -RuntimeHolder::~RuntimeHolder() { - blink::Threads::Gpu()->PostTask( - fxl::MakeCopyable([rasterizer = std::move(rasterizer_)](){ - // Deletes rasterizer. - })); -} - -void RuntimeHolder::Init( - fdio_ns_t* namespc, - std::unique_ptr context, - fidl::InterfaceRequest outgoing_services, - std::vector bundle) { - FXL_DCHECK(!rasterizer_); - rasterizer_ = Rasterizer::Create(); - FXL_DCHECK(rasterizer_); - - namespc_ = namespc; - dirfd_ = fdio_ns_opendir(namespc); - if (dirfd_ == -1) { - FXL_LOG(ERROR) << "Failed to get fd for namespace"; - return; - } - context_ = std::move(context); - outgoing_services_ = std::move(outgoing_services); - - context_->ConnectToEnvironmentService(view_manager_.NewRequest()); - - // TODO(zarah): remove bundle entirely once flx is removed. - InitRootBundle(std::move(bundle)); - - const uint8_t* vm_snapshot_data; - const uint8_t* vm_snapshot_instr; - const uint8_t* default_isolate_snapshot_data; - const uint8_t* default_isolate_snapshot_instr; - if (!Dart_IsPrecompiledRuntime()) { - vm_snapshot_data = ::kDartVmSnapshotData; - vm_snapshot_instr = ::kDartVmSnapshotInstructions; - default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; - default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; - } else { - std::vector dylib_blob; - if (!GetAssetAsBuffer(kDylibKey, &dylib_blob)) { - FXL_LOG(ERROR) << "Failed to extract app dylib"; - return; - } - - fsl::SizedVmo dylib_vmo; - if (!fsl::VmoFromVector(dylib_blob, &dylib_vmo)) { - FXL_LOG(ERROR) << "Failed to load app dylib"; - return; - } - - dlerror(); - dylib_handle_ = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); - if (dylib_handle_ == nullptr) { - FXL_LOG(ERROR) << "dlopen failed: " << dlerror(); - return; - } - vm_snapshot_data = reinterpret_cast( - dlsym(dylib_handle_, "_kDartVmSnapshotData")); - vm_snapshot_instr = reinterpret_cast( - dlsym(dylib_handle_, "_kDartVmSnapshotInstructions")); - default_isolate_snapshot_data = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); - default_isolate_snapshot_instr = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); - } - - // TODO(rmacnak): We should generate the AOT vm snapshot separately from - // each app so we can initialize before receiving the first app bundle. - static bool first_app = true; - if (first_app) { - first_app = false; - blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, - default_isolate_snapshot_data, - default_isolate_snapshot_instr, - /* bundle_path = */ ""); - - // This has to happen after the Dart runtime is initialized. - SetThreadName(blink::Threads::UI(), "ui"); - SetThreadName(blink::Threads::Gpu(), "gpu"); - SetThreadName(blink::Threads::IO(), "io"); - - blink::SetRegisterNativeServiceProtocolExtensionHook( - ServiceProtocolHooks::RegisterHooks); - } - - accessibility_bridge_ = std::make_unique(context_.get()); -} - -void RuntimeHolder::CreateView( - const std::string& script_uri, - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services) { - if (view_listener_binding_.is_bound()) { - // TODO(jeffbrown): Refactor this to support multiple view instances - // sharing the same underlying root bundle (but with different runtimes). - FXL_LOG(ERROR) << "The view has already been created."; - return; - } - - std::vector kernel; - std::vector snapshot; - bool maybe_running_from_source = false; - if (!Dart_IsPrecompiledRuntime()) { - if (!GetAssetAsBuffer(kKernelKey, &kernel) && - !GetAssetAsBuffer(kSnapshotKey, &snapshot)) { - maybe_running_from_source = true; - FXL_LOG(INFO) << "No kernel or snapshot in root bundle."; - } - } - - // Create the view. - zx::eventpair import_token, export_token; - zx_status_t status = zx::eventpair::create(0u, &import_token, &export_token); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Could not create an event pair."; - return; - } - views_v1::ViewListenerPtr view_listener; - view_listener_binding_.Bind(view_listener.NewRequest()); - view_manager_->CreateView(view_.NewRequest(), // view - std::move(view_owner_request), // view owner - std::move(view_listener), // view listener - std::move(export_token), // export token - script_uri // diagnostic label - ); - component::ServiceProviderPtr view_services; - view_->GetServiceProvider(view_services.NewRequest()); - - // Listen for input events. - ConnectToService(view_services.get(), input_connection_.NewRequest()); - input::InputListenerPtr input_listener; - input_listener_binding_.Bind(input_listener.NewRequest()); - input_connection_->SetEventListener(std::move(input_listener)); - - // Setup the session. - fidl::InterfaceHandle scenic; - view_manager_->GetScenic(scenic.NewRequest()); - - blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ - rasterizer = rasterizer_.get(), // - scenic = std::move(scenic), // - import_token = std::move(import_token), // - weak_runtime_holder = GetWeakPtr() - ]() mutable { - ASSERT_IS_GPU_THREAD; - rasterizer->SetScene( - std::move(scenic), std::move(import_token), - // TODO(MZ-222): Ideally we would immediately redraw the previous layer - // tree when the metrics change since there's no need to rerecord it. - // However, we want to make sure there's only one outstanding frame. - // We should improve the frame scheduling so that the rasterizer thread - // can self-schedule re-rasterization. - [weak_runtime_holder] { - // This is on the GPU thread thread. Post to the Platform/UI - // thread for the completion callback. - ASSERT_IS_GPU_THREAD; - blink::Threads::Platform()->PostTask([weak_runtime_holder]() { - // On the Platform/UI thread. - ASSERT_IS_UI_THREAD; - if (weak_runtime_holder) { - weak_runtime_holder->OnRedrawFrame(); - } - }); - }); - })); - runtime_ = blink::RuntimeController::Create(this); - - const uint8_t* isolate_snapshot_data; - const uint8_t* isolate_snapshot_instr; - if (!Dart_IsPrecompiledRuntime()) { - isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; - isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; - } else { - isolate_snapshot_data = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotData")); - isolate_snapshot_instr = reinterpret_cast( - dlsym(dylib_handle_, "_kDartIsolateSnapshotInstructions")); - } - runtime_->CreateDartController(script_uri, isolate_snapshot_data, - isolate_snapshot_instr, dirfd_); - - runtime_->SetViewportMetrics(viewport_metrics_); - - if (Dart_IsPrecompiledRuntime()) { - runtime_->dart_controller()->RunFromPrecompiledSnapshot(); - } else if (!kernel.empty()) { - runtime_->dart_controller()->RunFromKernel(std::move(kernel)); - } else if (maybe_running_from_source) { - std::vector data; - if (!GetAssetAsBuffer(kDartPkgContentsKey, &data)) { - FXL_LOG(ERROR) << "Contents file not found for " << script_uri; - return; - } - std::string package_name(data.begin(), data.end()); - std::string main_dart = "pkg/data/dart-pkg/" + package_name + "/lib/main.dart"; - FXL_LOG(INFO) << "Running from source with entrypoint: '" << main_dart - << "'"; - runtime_->dart_controller()->RunFromSource(main_dart, "pkg/data/dart-pkg/.packages"); - } else { - runtime_->dart_controller()->RunFromScriptSnapshot(snapshot.data(), - snapshot.size()); - } - - runtime_->dart_controller()->dart_state()->SetReturnCodeCallback( - [this](int32_t return_code) { return_code_ = return_code; }); -} - -Dart_Port RuntimeHolder::GetUIIsolateMainPort() { - if (!runtime_) - return ILLEGAL_PORT; - return runtime_->GetMainPort(); -} - -void RuntimeHolder::DidShutdownMainIsolate() { - if (main_isolate_shutdown_callback_) { - main_isolate_shutdown_callback_(); - } -} - -void RuntimeHolder::SetMainIsolateShutdownCallback( - std::function callback) { - main_isolate_shutdown_callback_ = callback; -} - -std::string RuntimeHolder::GetUIIsolateName() { - if (!runtime_) { - return ""; - } - return runtime_->GetIsolateName(); -} - -std::string RuntimeHolder::DefaultRouteName() { - return "/"; -} - -void RuntimeHolder::ScheduleFrame(bool regenerate_layer_tree) { - ASSERT_IS_UI_THREAD; - // TODO(mravn): We assume regenerate_layer_tree is true (and thus ignore - // that we may be able to reuse the current layer tree.) - if (!frame_scheduled_) { - frame_scheduled_ = true; - if (!frame_outstanding_) - PostBeginFrame(); - } -} - -void RuntimeHolder::Render(std::unique_ptr layer_tree) { - if (!frame_outstanding_ || frame_rendering_) { - // TODO(MZ-193): We probably shouldn't be discarding the layer tree here. - // But then, Flutter shouldn't be calling Render() if we didn't call - // BeginFrame(). - return; // Spurious. - } - - frame_rendering_ = true; - - layer_tree->set_construction_time(fxl::TimePoint::Now() - - last_begin_frame_time_); - layer_tree->set_frame_size(SkISize::Make(viewport_metrics_.physical_width, - viewport_metrics_.physical_height)); - layer_tree->set_device_pixel_ratio(viewport_metrics_.device_pixel_ratio); - - // We are on the Platform/UI thread. Post to the GPU thread to render. - ASSERT_IS_PLATFORM_THREAD; - blink::Threads::Gpu()->PostTask(fxl::MakeCopyable([ - rasterizer = rasterizer_.get(), // - layer_tree = std::move(layer_tree), // - weak_runtime_holder = GetWeakPtr() // - ]() mutable { - // On the GPU Thread. - ASSERT_IS_GPU_THREAD; - rasterizer->Draw(std::move(layer_tree), [weak_runtime_holder]() { - // This is on the GPU thread thread. Post to the Platform/UI thread - // for the completion callback. - ASSERT_IS_GPU_THREAD; - blink::Threads::Platform()->PostTask([weak_runtime_holder]() { - // On the Platform/UI thread. - ASSERT_IS_UI_THREAD; - if (weak_runtime_holder) { - weak_runtime_holder->frame_rendering_ = false; - weak_runtime_holder->OnFrameComplete(); - } - }); - }); - })); -} - -void RuntimeHolder::UpdateSemantics(blink::SemanticsNodeUpdates update) { - accessibility_bridge_->UpdateSemantics(update); -} - -void RuntimeHolder::HandlePlatformMessage( - fxl::RefPtr message) { - if (message->channel() == kAssetChannel) { - if (HandleAssetPlatformMessage(message.get())) - return; - } else if (message->channel() == kTextInputChannel) { - if (HandleTextInputPlatformMessage(message.get())) - return; - } else if (message->channel() == kFlutterPlatformChannel) { - if (HandleFlutterPlatformMessage(message.get())) - return; - } - if (auto response = message->response()) - response->CompleteEmpty(); -} - -void RuntimeHolder::DidCreateMainIsolate(Dart_Isolate isolate) { - if (asset_provider_) { - blink::AssetFontSelector::Install(asset_provider_); - } else if (asset_store_) { - blink::AssetFontSelector::Install(asset_store_); - } - InitDartIoInternal(); - InitFuchsia(); - InitZircon(); - InitScenicInternal(); -} - -void RuntimeHolder::InitDartIoInternal() { - Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io")); - - // Set up the namespace. - Dart_Handle namespace_type = - Dart_GetType(io_lib, ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - Dart_Handle namespace_args[1]; - namespace_args[0] = Dart_NewInteger(reinterpret_cast(namespc_)); - DART_CHECK_VALID(namespace_args[0]); - DART_CHECK_VALID(Dart_Invoke(namespace_type, ToDart("_setupNamespace"), 1, - namespace_args)); - - // Disable dart:io exit() - Dart_Handle embedder_config_type = - Dart_GetType(io_lib, ToDart("_EmbedderConfig"), 0, nullptr); - DART_CHECK_VALID(embedder_config_type); - DART_CHECK_VALID( - Dart_SetField(embedder_config_type, ToDart("_mayExit"), Dart_False())); -} - -void RuntimeHolder::InitFuchsia() { - fidl::InterfaceHandle environment; - context_->ConnectToEnvironmentService(environment.NewRequest()); - fuchsia::dart::Initialize(std::move(environment), - std::move(outgoing_services_)); - - component::ServiceProviderPtr parent_env_service_provider; - context_->environment()->GetServices( - parent_env_service_provider.NewRequest()); - ConnectToService(parent_env_service_provider.get(), clipboard_.NewRequest()); -} - -void RuntimeHolder::InitZircon() { - Dart_Handle zircon_lib = Dart_LookupLibrary(ToDart("dart:zircon")); - DART_CHECK_VALID(zircon_lib); - - Dart_Handle namespace_type = - Dart_GetType(zircon_lib, ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - DART_CHECK_VALID(Dart_SetField(namespace_type, ToDart("_namespace"), - ToDart(reinterpret_cast(namespc_)))); -} - -void RuntimeHolder::InitScenicInternal() { - fidl::InterfaceHandle view_container; - view_->GetContainer(view_container.NewRequest()); - - Dart_Handle mozart_internal = - Dart_LookupLibrary(ToDart("dart:mozart.internal")); - - DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, mozart::NativeLookup, - mozart::NativeSymbol)); - - DART_CHECK_VALID( - Dart_SetField(mozart_internal, ToDart("_context"), - DartConverter::ToDart(reinterpret_cast( - static_cast(this))))); - - DART_CHECK_VALID(Dart_SetField(mozart_internal, ToDart("_viewContainer"), - ToDart(zircon::dart::Handle::Create( - view_container.TakeChannel().release())))); -} - -void RuntimeHolder::InitRootBundle(std::vector bundle) { - if (!bundle.empty()) { - root_bundle_data_ = std::move(bundle); - asset_store_ = fxl::MakeRefCounted( - GetUnzipperProviderForRootBundle()); - } else { - fxl::UniqueFD root_dir(fdio_ns_opendir(namespc_)); - if (!root_dir.is_valid()) { - FXL_LOG(ERROR) << "Unable to load root dir"; - return; - } - fxl::UniqueFD data_dir(openat(root_dir.get(), - kFuchsiaPackageResourceDirectory, - O_RDONLY | O_DIRECTORY)); - if (!data_dir.is_valid()) { - FXL_LOG(ERROR) << "Unable to load data dir"; - return; - } - asset_provider_ = - fxl::MakeRefCounted(std::move(data_dir)); - } -} - -views_v1::View* RuntimeHolder::GetMozartView() { - return view_.get(); -} - -bool RuntimeHolder::HandleAssetPlatformMessage( - blink::PlatformMessage* message) { - fxl::RefPtr response = message->response(); - if (!response) - return false; - const auto& data = message->data(); - std::string asset_name(reinterpret_cast(data.data()), - data.size()); - std::vector asset_data; - if (GetAssetAsBuffer(asset_name, &asset_data)) { - response->Complete(std::move(asset_data)); - } else { - response->CompleteEmpty(); - } - return true; -} - -bool RuntimeHolder::GetAssetAsBuffer(const std::string& name, - std::vector* data) { - return (asset_provider_ && - asset_provider_->GetAsBuffer(name, data)) || - (asset_store_ && asset_store_->GetAsBuffer(name, data)); -} - -bool RuntimeHolder::HandleFlutterPlatformMessage( - blink::PlatformMessage* message) { - const auto& data = message->data(); - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) { - return false; - } - - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) { - return false; - } - - fxl::RefPtr response = message->response(); - if (method->value == "Clipboard.setData") { - auto text = root["args"]["text"].GetString(); - clipboard_->Push(text); - response->CompleteEmpty(); - } else if (method->value == "Clipboard.getData") { - clipboard_->Peek([response](fidl::StringPtr text) { - rapidjson::StringBuffer json_buffer; - rapidjson::Writer writer(json_buffer); - writer.StartArray(); - writer.StartObject(); - writer.Key("text"); - writer.String(text.get()); - writer.EndObject(); - writer.EndArray(); - - std::string result = json_buffer.GetString(); - response->Complete(std::vector{result.begin(), result.end()}); - }); - } else { - response->CompleteEmpty(); - } - return true; -} - -bool RuntimeHolder::HandleTextInputPlatformMessage( - blink::PlatformMessage* message) { - const auto& data = message->data(); - - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) - return false; - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) - return false; - - if (method->value == "TextInput.show") { - if (input_method_editor_) { - input_method_editor_->Show(); - } - } else if (method->value == "TextInput.hide") { - if (input_method_editor_) { - input_method_editor_->Hide(); - } - } else if (method->value == "TextInput.setClient") { - current_text_input_client_ = 0; - if (text_input_binding_.is_bound()) - text_input_binding_.Unbind(); - input_method_editor_ = nullptr; - - auto args = root.FindMember("args"); - if (args == root.MemberEnd() || !args->value.IsArray() || - args->value.Size() != 2) - return false; - const auto& configuration = args->value[1]; - if (!configuration.IsObject()) - return false; - // TODO(abarth): Read the keyboard type form the configuration. - current_text_input_client_ = args->value[0].GetInt(); - input::TextInputState state; - state.text = std::string(); - input_connection_->GetInputMethodEditor( - input::KeyboardType::TEXT, input::InputMethodAction::DONE, - std::move(state), text_input_binding_.NewBinding(), - input_method_editor_.NewRequest()); - } else if (method->value == "TextInput.setEditingState") { - if (input_method_editor_) { - auto args_it = root.FindMember("args"); - if (args_it == root.MemberEnd() || !args_it->value.IsObject()) - return false; - const auto& args = args_it->value; - input::TextInputState state; - // TODO(abarth): Deserialize state. - auto text = args.FindMember("text"); - if (text != args.MemberEnd() && text->value.IsString()) - state.text = text->value.GetString(); - auto selection_base = args.FindMember("selectionBase"); - if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) - state.selection.base = selection_base->value.GetInt(); - auto selection_extent = args.FindMember("selectionExtent"); - if (selection_extent != args.MemberEnd() && - selection_extent->value.IsInt()) - state.selection.extent = selection_extent->value.GetInt(); - auto selection_affinity = args.FindMember("selectionAffinity"); - if (selection_affinity != args.MemberEnd() && - selection_affinity->value.IsString() && - selection_affinity->value == "TextAffinity.upstream") - state.selection.affinity = input::TextAffinity::UPSTREAM; - else - state.selection.affinity = input::TextAffinity::DOWNSTREAM; - // We ignore selectionIsDirectional because that concept doesn't exist on - // Fuchsia. - auto composing_base = args.FindMember("composingBase"); - if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) - state.composing.start = composing_base->value.GetInt(); - auto composing_extent = args.FindMember("composingExtent"); - if (composing_extent != args.MemberEnd() && - composing_extent->value.IsInt()) - state.composing.end = composing_extent->value.GetInt(); - input_method_editor_->SetState(std::move(state)); - } - } else if (method->value == "TextInput.clearClient") { - current_text_input_client_ = 0; - if (text_input_binding_.is_bound()) - text_input_binding_.Unbind(); - input_method_editor_ = nullptr; - } else { - FXL_DLOG(ERROR) << "Unknown " << kTextInputChannel << " method " - << method->value.GetString(); - } - - return false; -} - -blink::UnzipperProvider RuntimeHolder::GetUnzipperProviderForRootBundle() { - return [self = GetWeakPtr()]() { - if (!self) - return zip::UniqueUnzipper(); - return zip::CreateUnzipper(&self->root_bundle_data_); - }; -} - -void RuntimeHolder::OnEvent(input::InputEvent event, - OnEventCallback callback) { - bool handled = false; - if (event.is_pointer()) { - const input::PointerEvent& pointer = event.pointer(); - blink::PointerData pointer_data; - pointer_data.time_stamp = pointer.event_time / 1000; - pointer_data.change = GetChangeFromPointerEventPhase(pointer.phase); - pointer_data.kind = GetKindFromPointerType(pointer.type); - pointer_data.device = pointer.pointer_id; - pointer_data.physical_x = pointer.x * viewport_metrics_.device_pixel_ratio; - pointer_data.physical_y = pointer.y * viewport_metrics_.device_pixel_ratio; - // Buttons are single bit values starting with kMousePrimaryButton = 1. - pointer_data.buttons = static_cast(pointer.buttons); - - switch (pointer_data.change) { - case blink::PointerData::Change::kDown: - down_pointers_.insert(pointer_data.device); - break; - case blink::PointerData::Change::kCancel: - case blink::PointerData::Change::kUp: - down_pointers_.erase(pointer_data.device); - break; - case blink::PointerData::Change::kMove: - if (down_pointers_.count(pointer_data.device) == 0) - pointer_data.change = blink::PointerData::Change::kHover; - break; - case blink::PointerData::Change::kAdd: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received add event for down pointer."; - } - break; - case blink::PointerData::Change::kRemove: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received remove event for down pointer."; - } - break; - case blink::PointerData::Change::kHover: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received hover event for down pointer."; - } - break; - } - - blink::PointerDataPacket packet(1); - packet.SetPointerData(0, pointer_data); - runtime_->DispatchPointerDataPacket(packet); - - handled = true; - } else if (event.is_keyboard()) { - const input::KeyboardEvent& keyboard = event.keyboard(); - const char* type = nullptr; - if (keyboard.phase == input::KeyboardEventPhase::PRESSED) - type = "keydown"; - else if (keyboard.phase == input::KeyboardEventPhase::REPEAT) - type = "keydown"; // TODO change this to keyrepeat - else if (keyboard.phase == input::KeyboardEventPhase::RELEASED) - type = "keyup"; - - if (type) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - document.SetObject(); - document.AddMember("type", rapidjson::Value(type, strlen(type)), - allocator); - document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); - document.AddMember("hidUsage", keyboard.hid_usage, allocator); - document.AddMember("codePoint", keyboard.code_point, allocator); - document.AddMember("modifiers", keyboard.modifiers, allocator); - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = - reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage( - fxl::MakeRefCounted( - kKeyEventChannel, - std::vector(data, data + buffer.GetSize()), nullptr)); - handled = true; - } - } - callback(handled); -} - -void RuntimeHolder::OnPropertiesChanged( - views_v1::ViewProperties properties, - OnPropertiesChangedCallback callback) { - // Attempt to read the device pixel ratio. - float pixel_ratio = 1.f; - if (auto& metrics = properties.display_metrics) { - pixel_ratio = metrics->device_pixel_ratio; - } - - // Apply view property changes. - if (auto& layout = properties.view_layout) { - viewport_metrics_.physical_width = layout->size.width * pixel_ratio; - viewport_metrics_.physical_height = layout->size.height * pixel_ratio; - viewport_metrics_.physical_padding_top = layout->inset.top * pixel_ratio; - viewport_metrics_.physical_padding_right = - layout->inset.right * pixel_ratio; - viewport_metrics_.physical_padding_bottom = - layout->inset.bottom * pixel_ratio; - viewport_metrics_.physical_padding_left = layout->inset.left * pixel_ratio; - viewport_metrics_.device_pixel_ratio = pixel_ratio; - runtime_->SetViewportMetrics(viewport_metrics_); - } - - ScheduleFrame(); - - callback(); -} - -void RuntimeHolder::DidUpdateState(input::TextInputState state, - input::InputEventPtr event) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - - rapidjson::Value encoded_state(rapidjson::kObjectType); - encoded_state.AddMember("text", state.text.get(), allocator); - encoded_state.AddMember("selectionBase", state.selection.base, allocator); - encoded_state.AddMember("selectionExtent", state.selection.extent, - allocator); - switch (state.selection.affinity) { - case input::TextAffinity::UPSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.upstream"), - allocator); - break; - case input::TextAffinity::DOWNSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.downstream"), - allocator); - break; - } - encoded_state.AddMember("selectionIsDirectional", true, allocator); - encoded_state.AddMember("composingBase", state.composing.start, allocator); - encoded_state.AddMember("composingExtent", state.composing.end, allocator); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - args.PushBack(encoded_state, allocator); - - document.SetObject(); - document.AddMember("method", - rapidjson::Value("TextInputClient.updateEditingState"), - allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, std::vector(data, data + buffer.GetSize()), - nullptr)); -} - -void RuntimeHolder::OnAction(input::InputMethodAction action) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - - // Done is currently the only text input action defined by Flutter. - args.PushBack("TextInputAction.done", allocator); - - document.SetObject(); - document.AddMember( - "method", rapidjson::Value("TextInputClient.performAction"), allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - runtime_->DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, std::vector(data, data + buffer.GetSize()), - nullptr)); -} - -fxl::WeakPtr RuntimeHolder::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -void RuntimeHolder::PostBeginFrame() { - blink::Threads::Platform()->PostTask([weak_runtime_holder = GetWeakPtr()]() { - // On the Platform/UI thread. - ASSERT_IS_UI_THREAD; - if (weak_runtime_holder) { - weak_runtime_holder->BeginFrame(); - } - }); -} - -void RuntimeHolder::BeginFrame() { - ASSERT_IS_UI_THREAD - FXL_DCHECK(frame_scheduled_); - FXL_DCHECK(!frame_outstanding_); - frame_scheduled_ = false; - frame_outstanding_ = true; - int64_t dart_frame_start_micros = Dart_TimelineGetMicros(); - last_begin_frame_time_ = fxl::TimePoint::Now(); - runtime_->BeginFrame(last_begin_frame_time_); - - if (frame_scheduled_) { - // HACK(rmacnak): This assumes 16ms/frame; it should use the frame deadline - // once we have access to it. Compare shell/common/animator.cc. - runtime_->NotifyIdle(dart_frame_start_micros + 16000); - } else { - // We don't have another frame pending, so we're waiting on user input - // or I/O. Allow the Dart VM 100 ms. - runtime_->NotifyIdle(dart_frame_start_micros + 100000); - } -} - -void RuntimeHolder::OnFrameComplete() { - ASSERT_IS_UI_THREAD - FXL_DCHECK(frame_outstanding_); - frame_outstanding_ = false; - if (frame_scheduled_) - PostBeginFrame(); -} - -void RuntimeHolder::OnRedrawFrame() { - if (!frame_outstanding_) - ScheduleFrame(); -} - -} // namespace flutter_runner diff --git a/content_handler/runtime_holder.h b/content_handler/runtime_holder.h deleted file mode 100644 index b9d55d9f9bacc..0000000000000 --- a/content_handler/runtime_holder.h +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ -#define FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ - -#include -#include - -#include - -#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" -#include "flutter/assets/asset_provider.h" -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/unzipper_provider.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/content_handler/accessibility_bridge.h" -#include "flutter/flow/layers/layer_tree.h" -#include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/runtime/runtime_controller.h" -#include "flutter/runtime/runtime_delegate.h" -#include "lib/app/cpp/application_context.h" -#include -#include -#include -#include "lib/fidl/cpp/binding.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" -#include -#include -#include - -namespace flutter_runner { - -class Rasterizer; - -class RuntimeHolder : public blink::RuntimeDelegate, - public mozart::NativesDelegate, - public views_v1::ViewListener, - public input::InputListener, - public input::InputMethodEditorClient { - public: - RuntimeHolder(); - ~RuntimeHolder(); - - void Init(fdio_ns_t* namespc, - std::unique_ptr context, - fidl::InterfaceRequest outgoing_services, - std::vector bundle); - void CreateView(const std::string& script_uri, - fidl::InterfaceRequest view_owner_request, - fidl::InterfaceRequest services); - - Dart_Port GetUIIsolateMainPort(); - std::string GetUIIsolateName(); - - int32_t return_code() { return return_code_; } - - void SetMainIsolateShutdownCallback(std::function callback); - - private: - // |blink::RuntimeDelegate| implementation: - std::string DefaultRouteName() override; - void ScheduleFrame(bool regenerate_layer_tree = true) override; - void Render(std::unique_ptr layer_tree) override; - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - void HandlePlatformMessage( - fxl::RefPtr message) override; - void DidCreateMainIsolate(Dart_Isolate isolate) override; - void DidShutdownMainIsolate() override; - - // |mozart::NativesDelegate| implementation: - views_v1::View* GetMozartView() override; - - // |input::InputListener| implementation: - void OnEvent(input::InputEvent event, - OnEventCallback callback) override; - - // |views_v1::ViewListener| implementation: - void OnPropertiesChanged( - views_v1::ViewProperties properties, - OnPropertiesChangedCallback callback) override; - - // |input::InputMethodEditorClient| implementation: - void DidUpdateState(input::TextInputState state, - input::InputEventPtr event) override; - void OnAction(input::InputMethodAction action) override; - - fxl::WeakPtr GetWeakPtr(); - - void InitRootBundle(std::vector bundle); - blink::UnzipperProvider GetUnzipperProviderForRootBundle(); - bool HandleAssetPlatformMessage(blink::PlatformMessage* message); - bool GetAssetAsBuffer(const std::string& name, std::vector* data); - bool HandleTextInputPlatformMessage(blink::PlatformMessage* message); - bool HandleFlutterPlatformMessage(blink::PlatformMessage* message); - - void InitDartIoInternal(); - void InitFuchsia(); - void InitZircon(); - void InitScenicInternal(); - - void PostBeginFrame(); - void BeginFrame(); - void OnFrameComplete(); - void OnRedrawFrame(); - void Invalidate(); - - fdio_ns_t* namespc_; - int dirfd_; - std::unique_ptr context_; - fidl::InterfaceRequest outgoing_services_; - std::vector root_bundle_data_; - // TODO(zarah): Remove asset_store_ when flx is completely removed - fxl::RefPtr asset_store_; - fxl::RefPtr asset_provider_; - void* dylib_handle_ = nullptr; - std::unique_ptr rasterizer_; - std::unique_ptr runtime_; - blink::ViewportMetrics viewport_metrics_; - views_v1::ViewManagerPtr view_manager_; - fidl::Binding view_listener_binding_; - fidl::Binding input_listener_binding_; - input::InputConnectionPtr input_connection_; - views_v1::ViewPtr view_; - std::unordered_set down_pointers_; - input::InputMethodEditorPtr input_method_editor_; - fidl::Binding text_input_binding_; - int current_text_input_client_ = 0; - fxl::TimePoint last_begin_frame_time_; - bool frame_outstanding_ = false; - bool frame_scheduled_ = false; - bool frame_rendering_ = false; - int32_t return_code_ = 0; - - fxl::WeakPtrFactory weak_factory_; - - std::unique_ptr accessibility_bridge_; - - std::function main_isolate_shutdown_callback_; - - modular::ClipboardPtr clipboard_; - - FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeHolder); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_RUNTIME_HOLDER_H_ diff --git a/content_handler/service_protocol_hooks.cc b/content_handler/service_protocol_hooks.cc deleted file mode 100644 index 9a91254f13488..0000000000000 --- a/content_handler/service_protocol_hooks.cc +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/content_handler/service_protocol_hooks.h" - -#include - -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/content_handler/app.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace flutter_runner { -namespace { - -constexpr char kViewIdPrefx[] = "_flutterView/"; -constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; - -static intptr_t KeyIndex(const char** param_keys, - intptr_t num_params, - const char* key) { - if (param_keys == NULL) { - return -1; - } - for (intptr_t i = 0; i < num_params; i++) { - if (strcmp(param_keys[i], key) == 0) { - return i; - } - } - return -1; -} - -static const char* ValueForKey(const char** param_keys, - const char** param_values, - intptr_t num_params, - const char* key) { - intptr_t index = KeyIndex(param_keys, num_params, key); - if (index < 0) { - return NULL; - } - return param_values[index]; -} - -static void AppendIsolateRef(std::stringstream* stream, - int64_t main_port, - const std::string name) { - *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; - *stream << main_port << "\",\"name\":\"" << name << "\","; - *stream << "\"number\":\"" << main_port << "\"}"; -} - -static void AppendFlutterView(std::stringstream* stream, - uintptr_t view_id, - int64_t isolate_id, - const std::string isolate_name) { - *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" - << std::hex << view_id << std::dec << "\""; - if (isolate_id != ILLEGAL_PORT) { - // Append the isolate (if it exists). - *stream << "," - << "\"isolate\":"; - AppendIsolateRef(stream, isolate_id, isolate_name); - } - *stream << "}"; -} - -} // namespace - -void ServiceProtocolHooks::RegisterHooks(bool running_precompiled_code) { - // Listing of FlutterViews. - Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, - nullptr); - - Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, - &SetAssetBundlePath, nullptr); -} - -const char* ServiceProtocolHooks::kListViewsExtensionName = - "_flutter.listViews"; - -bool ServiceProtocolHooks::ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - // Ask the App for the list of platform views. This will run a task on - // the UI thread before returning. - App& app = App::Shared(); - std::vector platform_views; - app.WaitForPlatformViewIds(&platform_views); - - std::stringstream response; - - response << "{\"type\":\"FlutterViewList\",\"views\":["; - bool prefix_comma = false; - for (auto it = platform_views.begin(); it != platform_views.end(); it++) { - uintptr_t view_id = it->view_id; - int64_t isolate_id = it->isolate_id; - const std::string& isolate_name = it->isolate_name; - if (!view_id) { - continue; - } - if (prefix_comma) { - response << ','; - } else { - prefix_comma = true; - } - AppendFlutterView(&response, view_id, isolate_id, isolate_name); - } - response << "]}"; - // Copy the response. - *json_object = strdup(response.str().c_str()); - return true; -} - -const char* ServiceProtocolHooks::kSetAssetBundlePathExtensionName = - "_flutter.setAssetBundlePath"; - -bool ServiceProtocolHooks::SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - const char* view_id_str = - ValueForKey(param_keys, param_values, num_params, "viewId"); - - // Ask the App for the list of platform views. This will run a task on - // the UI thread before returning. - App& app = App::Shared(); - std::vector platform_views; - app.WaitForPlatformViewIds(&platform_views); - - // Convert the actual flutter view hex id into a number. - uintptr_t view_id_as_num = - std::stoull((view_id_str + kViewIdPrefxLength), nullptr, 16); - - // The view existed and the isolate was created. Success. - std::stringstream response; - response << "{\"type\":\"Success\"," - << "\"view\":"; - for (auto it = platform_views.begin(); it != platform_views.end(); it++) { - uintptr_t view_id = it->view_id; - int64_t isolate_id = it->isolate_id; - const std::string& isolate_name = it->isolate_name; - if (!view_id || view_id != view_id_as_num) { - continue; - } - - // TODO(DX): Set up asset bundle path for the isolate. - - AppendFlutterView(&response, view_id, isolate_id, isolate_name); - break; - } - response << "}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -} // namespace flutter_runner diff --git a/content_handler/service_protocol_hooks.h b/content_handler/service_protocol_hooks.h deleted file mode 100644 index 479fb71471f1e..0000000000000 --- a/content_handler/service_protocol_hooks.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ -#define FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ - -#include "lib/fxl/synchronization/waitable_event.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace flutter_runner { - -class ServiceProtocolHooks { - public: - static void RegisterHooks(bool running_precompiled_code); - - private: - static const char* kListViewsExtensionName; - static bool ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kSetAssetBundlePathExtensionName; - static bool SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_SERVICE_PROTOCOL_HOOKS_H_ diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index b496ae37f40f2..870020abb670f 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -2,72 +2,69 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/content_handler/session_connection.h" -#include "lib/fidl/cpp/optional.h" +#include "session_connection.h" + #include "lib/ui/scenic/fidl_helpers.h" -namespace flutter_runner { +namespace flutter { -SessionConnection::SessionConnection(ui::ScenicPtr scenic, - zx::eventpair import_token) - : session_(scenic.get()), +SessionConnection::SessionConnection( + const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback) + : debug_label_(std::move(debug_label)), + session_(scenic.get()), root_node_(&session_), surface_producer_(std::make_unique(&session_)), - scene_update_context_(&session_, surface_producer_.get()) { - ASSERT_IS_GPU_THREAD; - - session_.set_error_handler( - std::bind(&SessionConnection::OnSessionError, this)); + scene_update_context_(&session_, surface_producer_.get()), + metrics_changed_callback_( + std::move(session_metrics_did_change_callback)) { + session_.set_error_handler(std::move(session_error_callback)); session_.set_event_handler(std::bind(&SessionConnection::OnSessionEvents, this, std::placeholders::_1)); root_node_.Bind(std::move(import_token)); - root_node_.SetEventMask(gfx::kMetricsEventMask); - session_.Present(0, [](images::PresentationInfo info) {}); - - present_callback_ = - std::bind(&SessionConnection::OnPresent, this, std::placeholders::_1); + root_node_.SetEventMask(ui::gfx::kMetricsEventMask); + session_.Present(0, [](ui::PresentationInfoPtr info) {}); } -SessionConnection::~SessionConnection() { - ASSERT_IS_GPU_THREAD; -} +SessionConnection::~SessionConnection() = default; -void SessionConnection::OnSessionError() { - ASSERT_IS_GPU_THREAD; - // TODO: Not this. - FXL_CHECK(false) << "Session connection was terminated."; -} +void SessionConnection::OnSessionEvents(f1dl::Array events) { + using Type = ui::gfx::Event::Tag; -void SessionConnection::OnSessionEvents(fidl::VectorPtr events) { - gfx::Metrics* new_metrics; - for (auto& event : *events) { - if (event.is_gfx() && event.gfx().is_metrics() && - event.gfx().metrics().node_id == root_node_.id()) { - new_metrics = &event.gfx().metrics().metrics; + for (auto& raw_event : *events) { + if (!raw_event->is_gfx()) { + continue; } - } - if (!new_metrics) - return; - scene_update_context_.set_metrics(fidl::MakeOptional(std::move(*new_metrics))); - - if (metrics_changed_callback_) - metrics_changed_callback_(); + auto& event = raw_event->get_gfx(); + + switch (event->which()) { + case Type::METRICS: { + if (event->get_metrics()->node_id == root_node_.id()) { + auto& metrics = event->get_metrics()->metrics; + double device_pixel_ratio = metrics->scale_x; + scene_update_context_.set_metrics(std::move(metrics)); + if (metrics_changed_callback_) { + metrics_changed_callback_(device_pixel_ratio); + } + } + } break; + default: + break; + } + } } -void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, - fxl::Closure on_present_callback) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(pending_on_present_callback_ == nullptr); - FXL_DCHECK(on_present_callback != nullptr); - pending_on_present_callback_ = on_present_callback; - +void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { // Flush all session ops. Paint tasks have not yet executed but those are // fenced. The compositor can start processing ops while we finalize paint // tasks. - session_.Present(0, // presentation_time. Placeholder for now. - present_callback_ // callback + session_.Present(0, // presentation_time. (placeholder). + [](ui::PresentationInfoPtr) {} // callback ); // Execute paint tasks and signal fences. @@ -77,22 +74,15 @@ void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame, // book-keeping on buffer caches. surface_producer_->OnSurfacesPresented(std::move(surfaces_to_submit)); - // Prepare for the next frame. - EnqueueClearCommands(); -} - -void SessionConnection::OnPresent(images::PresentationInfo info) { - ASSERT_IS_GPU_THREAD; - auto callback = pending_on_present_callback_; - pending_on_present_callback_ = nullptr; - callback(); + // Prepare for the next frame. These ops won't be processed till the next + // present. + EnqueueClearOps(); } -void SessionConnection::EnqueueClearCommands() { - ASSERT_IS_GPU_THREAD; +void SessionConnection::EnqueueClearOps() { // We are going to be sending down a fresh node hierarchy every frame. So just - // enqueue a detach command on the imported root node. + // enqueue a detach op on the imported root node. session_.Enqueue(scenic_lib::NewDetachChildrenCommand(root_node_.id())); } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index a80ba3a2235d2..e4f39d314c98f 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -2,70 +2,62 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ -#define FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ +#pragma once #include -#include "flutter/common/threads.h" -#include "flutter/content_handler/vulkan_surface_producer.h" #include "flutter/flow/compositor_context.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fidl/cpp/interface_handle.h" +#include "lib/fidl/cpp/bindings/interface_handle.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" +#include "vulkan_surface_producer.h" -namespace flutter_runner { +namespace flutter { -class SessionConnection { +using OnMetricsUpdate = std::function; + +// The component residing on the GPU thread that is responsible for +// maintaining the Scenic session connection and presenting node updates. +class SessionConnection final { public: - SessionConnection(ui::ScenicPtr scenic, zx::eventpair import_token); + SessionConnection(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback); ~SessionConnection(); bool has_metrics() const { return scene_update_context_.has_metrics(); } - const gfx::MetricsPtr& metrics() const { + const ui::gfx::MetricsPtr& metrics() const { return scene_update_context_.metrics(); } - void set_metrics_changed_callback(fxl::Closure callback) { - metrics_changed_callback_ = std::move(callback); - } - flow::SceneUpdateContext& scene_update_context() { return scene_update_context_; } - scenic_lib::ImportNode& root_node() { - ASSERT_IS_GPU_THREAD; - return root_node_; - } + scenic_lib::ImportNode& root_node() { return root_node_; } - void Present(flow::CompositorContext::ScopedFrame& frame, - fxl::Closure on_present_callback); + void Present(flow::CompositorContext::ScopedFrame& frame); private: + const std::string debug_label_; scenic_lib::Session session_; scenic_lib::ImportNode root_node_; - scenic_lib::Session::PresentCallback present_callback_; - fxl::Closure pending_on_present_callback_; std::unique_ptr surface_producer_; flow::SceneUpdateContext scene_update_context_; - fxl::Closure metrics_changed_callback_; - - void OnSessionError(); - void OnSessionEvents(fidl::VectorPtr events); + OnMetricsUpdate metrics_changed_callback_; - void EnqueueClearCommands(); + void OnSessionEvents(f1dl::Array events); - void OnPresent(images::PresentationInfo info); + void EnqueueClearOps(); FXL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); }; -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_SESSION_CONNECTION_H_ +} // namespace flutter diff --git a/content_handler/surface.cc b/content_handler/surface.cc new file mode 100644 index 0000000000000..8efe1975fbfdb --- /dev/null +++ b/content_handler/surface.cc @@ -0,0 +1,73 @@ +// Copyright 2018 The Fuchsia 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 "surface.h" + +#include +#include +#include +#include + +#include "lib/fxl/files/unique_fd.h" + +namespace flutter { + +Surface::Surface(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback) + : shell::Surface(std::make_unique( + scenic, + debug_label, + std::move(import_token), + std::move(session_metrics_did_change_callback), + std::move(session_error_callback))), + debug_label_(debug_label) {} + +Surface::~Surface() = default; + +// |shell::Surface| +bool Surface::IsValid() { + return valid_; +} + +// |shell::Surface| +std::unique_ptr Surface::AcquireFrame( + const SkISize& size) { + return std::make_unique( + nullptr, [](const shell::SurfaceFrame& surface_frame, SkCanvas* canvas) { + return true; + }); +} + +// |shell::Surface| +GrContext* Surface::GetContext() { + return nullptr; +} + +static zx_status_t DriverWatcher(int dirfd, + int event, + const char* fn, + void* cookie) { + if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { + return ZX_ERR_STOP; + } + return ZX_OK; +} + +bool Surface::CanConnectToDisplay() { + constexpr char kDisplayDriverClass[] = "/dev/class/display"; + fxl::UniqueFD fd(open(kDisplayDriverClass, O_DIRECTORY | O_RDONLY)); + if (fd.get() < 0) { + FXL_DLOG(ERROR) << "Failed to open " << kDisplayDriverClass; + return false; + } + + zx_status_t status = fdio_watch_directory( + fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(1)), nullptr); + return status == ZX_ERR_STOP; +} + +} // namespace flutter diff --git a/content_handler/surface.h b/content_handler/surface.h new file mode 100644 index 0000000000000..4ad27aaf540f3 --- /dev/null +++ b/content_handler/surface.h @@ -0,0 +1,47 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "compositor_context.h" +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/shell/common/surface.h" +#include "lib/fxl/macros.h" + +namespace flutter { + +// The interface between the Flutter rasterizer and the underlying platform. May +// be constructed on any thread but will be used by the engine only on the GPU +// thread. +class Surface final : public shell::Surface { + public: + Surface(const ui::ScenicPtr& scenic, + std::string debug_label, + zx::eventpair import_token, + OnMetricsUpdate session_metrics_did_change_callback, + fxl::Closure session_error_callback); + + ~Surface() override; + + private: + const bool valid_ = CanConnectToDisplay(); + const std::string debug_label_; + std::unique_ptr compositor_context_; + + // |shell::Surface| + bool IsValid() override; + + // |shell::Surface| + std::unique_ptr AcquireFrame( + const SkISize& size) override; + + // |shell::Surface| + GrContext* GetContext() override; + + static bool CanConnectToDisplay(); + + FXL_DISALLOW_COPY_AND_ASSIGN(Surface); +}; + +} // namespace flutter diff --git a/content_handler/task_observers.cc b/content_handler/task_observers.cc new file mode 100644 index 0000000000000..f23265e7b1653 --- /dev/null +++ b/content_handler/task_observers.cc @@ -0,0 +1,43 @@ +// Copyright 2018 The Fuchsia 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 "task_observers.h" + +#include + +#include "lib/fsl/tasks/message_loop.h" + +namespace flutter { + +thread_local std::map tTaskObservers; + +static void ExecuteAfterTaskObservers() { + for (const auto& callback : tTaskObservers) { + callback.second(); + } +} + +void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, + fxl::Closure observer) { + if (!observer) { + return; + } + + if (tTaskObservers.size() == 0) { + fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback( + std::bind(&ExecuteAfterTaskObservers)); + } + + tTaskObservers[key] = observer; +} + +void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key) { + tTaskObservers.erase(key); + + if (tTaskObservers.size() == 0) { + fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); + } +} + +} // namespace flutter diff --git a/content_handler/task_observers.h b/content_handler/task_observers.h new file mode 100644 index 0000000000000..53f6b96222000 --- /dev/null +++ b/content_handler/task_observers.h @@ -0,0 +1,16 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "lib/fxl/functional/closure.h" + +namespace flutter { + +void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, + fxl::Closure observer); + +void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key); + +} // namespace flutter diff --git a/content_handler/unique_fdio_ns.h b/content_handler/unique_fdio_ns.h new file mode 100644 index 0000000000000..726137d729f85 --- /dev/null +++ b/content_handler/unique_fdio_ns.h @@ -0,0 +1,34 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "fdio/namespace.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/memory/unique_object.h" + +namespace flutter { + +struct UniqueFDIONSTraits { + static fdio_ns_t* InvalidValue() { return nullptr; } + + static bool IsValid(fdio_ns_t* ns) { return ns != InvalidValue(); } + + static void Free(fdio_ns_t* ns) { + auto status = fdio_ns_destroy(ns); + FXL_DCHECK(status == ZX_OK); + } +}; + +using UniqueFDIONS = fxl::UniqueObject; + +inline UniqueFDIONS UniqueFDIONSCreate() { + fdio_ns_t* ns = nullptr; + if (fdio_ns_create(&ns) == ZX_OK) { + return UniqueFDIONS{ns}; + } + return UniqueFDIONS{nullptr}; +} + +} // namespace flutter diff --git a/content_handler/vulkan_rasterizer.cc b/content_handler/vulkan_rasterizer.cc deleted file mode 100644 index 25f90c460ce3f..0000000000000 --- a/content_handler/vulkan_rasterizer.cc +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/content_handler/vulkan_rasterizer.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/glue/trace_event.h" -#include "lib/fxl/files/unique_fd.h" - -namespace flutter_runner { - -constexpr char kGpuDriverClass[] = "/dev/class/gpu"; - -static zx_status_t DriverWatcher(int dirfd, - int event, - const char* fn, - void* cookie) { - if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { - return ZX_ERR_STOP; - } - return ZX_OK; -} - -bool WaitForFirstGpuDriver() { - fxl::UniqueFD fd(open(kGpuDriverClass, O_DIRECTORY | O_RDONLY)); - if (fd.get() < 0) { - FXL_DLOG(ERROR) << "Failed to open " << kGpuDriverClass; - return false; - } - - zx_status_t status = fdio_watch_directory( - fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(5)), nullptr); - return status == ZX_ERR_STOP; -} - -VulkanRasterizer::VulkanRasterizer() : compositor_context_(nullptr) { - valid_ = WaitForFirstGpuDriver(); -} - -VulkanRasterizer::~VulkanRasterizer() = default; - -bool VulkanRasterizer::IsValid() const { - return valid_; -} - -void VulkanRasterizer::SetScene(fidl::InterfaceHandle scenic, - zx::eventpair import_token, - fxl::Closure metrics_changed_callback) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(valid_ && !session_connection_); - session_connection_ = std::make_unique( - scenic.Bind(), std::move(import_token)); - session_connection_->set_metrics_changed_callback( - std::move(metrics_changed_callback)); -} - -void VulkanRasterizer::Draw(std::unique_ptr layer_tree, - fxl::Closure callback) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(callback != nullptr); - - if (layer_tree == nullptr) { - FXL_LOG(ERROR) << "Layer tree was not valid."; - callback(); - return; - } - - if (!session_connection_) { - FXL_LOG(ERROR) << "Session was not valid."; - callback(); - return; - } - - if (!session_connection_->has_metrics()) { - // Still awaiting metrics. Will redraw when we get them. - callback(); - return; - } - - compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); - - flow::CompositorContext::ScopedFrame frame = compositor_context_.AcquireFrame( - nullptr, nullptr, true /* instrumentation enabled */); - { - // Preroll the Flutter layer tree. This allows Flutter to perform pre-paint - // optimizations. - TRACE_EVENT0("flutter", "Preroll"); - layer_tree->Preroll(frame, session_connection_->metrics().get()); - } - - { - // Traverse the Flutter layer tree so that the necessary session ops to - // represent the frame are enqueued in the underlying session. - TRACE_EVENT0("flutter", "UpdateScene"); - layer_tree->UpdateScene(session_connection_->scene_update_context(), - session_connection_->root_node()); - } - - { - // Flush all pending session ops. - TRACE_EVENT0("flutter", "SessionPresent"); - session_connection_->Present( - frame, [callback = std::move(callback)]() { callback(); }); - } -} - -} // namespace flutter_runner diff --git a/content_handler/vulkan_rasterizer.h b/content_handler/vulkan_rasterizer.h deleted file mode 100644 index c3ae211553f5a..0000000000000 --- a/content_handler/vulkan_rasterizer.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ -#define FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ - -#include - -#include "flutter/content_handler/rasterizer.h" -#include "flutter/content_handler/session_connection.h" -#include "flutter/flow/compositor_context.h" -#include "lib/fxl/macros.h" - -namespace flutter_runner { - -class VulkanRasterizer : public Rasterizer { - public: - VulkanRasterizer(); - - ~VulkanRasterizer() override; - - bool IsValid() const; - - void SetScene(fidl::InterfaceHandle scenic, - zx::eventpair import_token, - fxl::Closure metrics_changed_callback) override; - - void Draw(std::unique_ptr layer_tree, - fxl::Closure callback) override; - - private: - flow::CompositorContext compositor_context_; - std::unique_ptr session_connection_; - bool valid_; - - FXL_DISALLOW_COPY_AND_ASSIGN(VulkanRasterizer); -}; - -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_ diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index bebbc84e899e0..53d0fd2da63d9 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "vulkan_surface.h" + #include -#include "flutter/content_handler/vulkan_surface.h" -#include "flutter/common/threads.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter_runner { +namespace flutter { VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -22,8 +22,6 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, backend_context_(std::move(backend_context)), session_(session), wait_(this) { - ASSERT_IS_GPU_THREAD; - FXL_DCHECK(session_); zx::vmo exported_vmo; @@ -50,9 +48,11 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, } VulkanSurface::~VulkanSurface() { - ASSERT_IS_GPU_THREAD; - wait_.Cancel(); - wait_.set_object(ZX_HANDLE_INVALID); + if (async_) { + wait_.Cancel(async_); + wait_.set_object(ZX_HANDLE_INVALID); + async_ = nullptr; + } } bool VulkanSurface::IsValid() const { @@ -317,7 +317,6 @@ bool VulkanSurface::PushSessionImageSetupOps(scenic_lib::Session* session, } scenic_lib::Image* VulkanSurface::GetImage() { - ASSERT_IS_GPU_THREAD; if (!valid_) { return 0; } @@ -325,7 +324,6 @@ scenic_lib::Image* VulkanSurface::GetImage() { } sk_sp VulkanSurface::GetSkiaSurface() const { - ASSERT_IS_GPU_THREAD; return valid_ ? sk_surface_ : nullptr; } @@ -350,7 +348,6 @@ bool VulkanSurface::FlushSessionAcquireAndReleaseEvents() { void VulkanSurface::SignalWritesFinished( std::function on_writes_committed) { - ASSERT_IS_GPU_THREAD; FXL_DCHECK(on_writes_committed); if (!valid_) { @@ -366,8 +363,6 @@ void VulkanSurface::SignalWritesFinished( } void VulkanSurface::Reset() { - ASSERT_IS_GPU_THREAD; - if (acquire_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK || release_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK) { valid_ = false; @@ -404,15 +399,14 @@ void VulkanSurface::Reset() { } } -void VulkanSurface::OnHandleReady(async_t* async, - async::WaitBase* wait, - zx_status_t status, - const zx_packet_signal_t* signal) { - ASSERT_IS_GPU_THREAD; +async_wait_result_t VulkanSurface::OnHandleReady( + async_t* async, + zx_status_t status, + const zx_packet_signal_t* signal) { if (status != ZX_OK) return; FXL_DCHECK(signal->observed & ZX_EVENT_SIGNALED); Reset(); } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface.h b/content_handler/vulkan_surface.h index c8e7d2c06d4dd..c9156452aed98 100644 --- a/content_handler/vulkan_surface.h +++ b/content_handler/vulkan_surface.h @@ -20,9 +20,10 @@ #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -namespace flutter_runner { +namespace flutter { -class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { +class VulkanSurface final + : public flow::SceneUpdateContext::SurfaceProducerSurface { public: VulkanSurface(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -32,12 +33,16 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { ~VulkanSurface() override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| size_t AdvanceAndGetAge() override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| bool FlushSessionAcquireAndReleaseEvents() override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| bool IsValid() const override; + // |flow::SceneUpdateContext::SurfaceProducerSurface| SkISize GetSize() const override; // Note: It is safe for the caller to collect the surface in the @@ -115,4 +120,4 @@ class VulkanSurface : public flow::SceneUpdateContext::SurfaceProducerSurface { FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); }; -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_pool.cc b/content_handler/vulkan_surface_pool.cc index af23ef711b7ad..93d14c2ddbff7 100644 --- a/content_handler/vulkan_surface_pool.cc +++ b/content_handler/vulkan_surface_pool.cc @@ -2,13 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "vulkan_surface_pool.h" + #include -#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrContext.h" -namespace flutter_runner { +namespace flutter { VulkanSurfacePool::VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider, sk_sp context, @@ -177,4 +178,4 @@ void VulkanSurfacePool::TraceStats() { trace_surfaces_reused_ = 0; } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_pool.h b/content_handler/vulkan_surface_pool.h index 52dd3ed6aa417..4900816762910 100644 --- a/content_handler/vulkan_surface_pool.h +++ b/content_handler/vulkan_surface_pool.h @@ -6,12 +6,13 @@ #include #include -#include "flutter/content_handler/vulkan_surface.h" + #include "lib/fxl/macros.h" +#include "vulkan_surface.h" -namespace flutter_runner { +namespace flutter { -class VulkanSurfacePool { +class VulkanSurfacePool final { public: static const size_t kMaxSurfacesOfSameSize = 3; static const size_t kMaxSurfaceAge = 3; @@ -74,4 +75,4 @@ class VulkanSurfacePool { FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfacePool); }; -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index e75f49786cf0b..f29b0f1a8bdac 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -2,18 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "flutter/content_handler/vulkan_surface_producer.h" +#include "vulkan_surface_producer.h" #include #include #include + #include "flutter/glue/trace_event.h" #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContext.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" -namespace flutter_runner { +namespace flutter { VulkanSurfaceProducer::VulkanSurfaceProducer( scenic_lib::Session* mozart_session) { @@ -43,7 +44,7 @@ bool VulkanSurfaceProducer::Initialize(scenic_lib::Session* mozart_session) { VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, }; application_ = std::make_unique( - *vk_, "FlutterContentHandler", std::move(extensions)); + *vk_, "FlutterApplicationRunner", std::move(extensions)); if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) { // Make certain the application instance was created and it setup the @@ -206,4 +207,4 @@ void VulkanSurfaceProducer::SubmitSurface( surface_pool_->SubmitSurface(std::move(surface)); } -} // namespace flutter_runner +} // namespace flutter diff --git a/content_handler/vulkan_surface_producer.h b/content_handler/vulkan_surface_producer.h index 2338a8a6ba709..15c4419e8cde7 100644 --- a/content_handler/vulkan_surface_producer.h +++ b/content_handler/vulkan_surface_producer.h @@ -2,11 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ -#define FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +#pragma once -#include "flutter/content_handler/vulkan_surface.h" -#include "flutter/content_handler/vulkan_surface_pool.h" #include "flutter/flow/scene_update_context.h" #include "flutter/vulkan/vulkan_application.h" #include "flutter/vulkan/vulkan_device.h" @@ -17,11 +14,14 @@ #include "lib/ui/scenic/client/resources.h" #include "lib/ui/scenic/client/session.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" +#include "vulkan_surface.h" +#include "vulkan_surface_pool.h" -namespace flutter_runner { +namespace flutter { -class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer, - public vulkan::VulkanProvider { +class VulkanSurfaceProducer final + : public flow::SceneUpdateContext::SurfaceProducer, + public vulkan::VulkanProvider { public: VulkanSurfaceProducer(scenic_lib::Session* mozart_session); @@ -74,6 +74,4 @@ class VulkanSurfaceProducer : public flow::SceneUpdateContext::SurfaceProducer, FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfaceProducer); }; -} // namespace flutter_runner - -#endif // FLUTTER_CONTENT_HANDLER_VULKAN_SURFACE_PRODUCER_H_ +} // namespace flutter diff --git a/flow/BUILD.gn b/flow/BUILD.gn index e6a6411a6c1da..07c5d4e5d4e7b 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -48,11 +48,12 @@ source_set("flow") { "matrix_decomposition.h", "paint_utils.cc", "paint_utils.h", - "process_info.h", "raster_cache.cc", "raster_cache.h", "raster_cache_key.cc", "raster_cache_key.h", + "skia_gpu_object.cc", + "skia_gpu_object.h", "texture.cc", "texture.h", ] @@ -61,12 +62,11 @@ source_set("flow") { "//garnet/public/lib/fxl", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] deps = [ "$flutter_root/common", + "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/synchronization", "//third_party/skia", @@ -103,8 +103,8 @@ executable("flow_unittests") { deps = [ ":flow", - "//third_party/dart/runtime:libdart_jit", # for tracing "$flutter_root/testing", + "//third_party/dart/runtime:libdart_jit", # for tracing "//third_party/skia", ] } diff --git a/flow/compositor_context.cc b/flow/compositor_context.cc index e0d17229e7981..53659103be9f1 100644 --- a/flow/compositor_context.cc +++ b/flow/compositor_context.cc @@ -4,12 +4,12 @@ #include "flutter/flow/compositor_context.h" +#include "flutter/flow/layers/layer_tree.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { -CompositorContext::CompositorContext(std::unique_ptr info) - : process_info_(std::move(info)) {} +CompositorContext::CompositorContext() = default; CompositorContext::~CompositorContext() = default; @@ -18,10 +18,6 @@ void CompositorContext::BeginFrame(ScopedFrame& frame, if (enable_instrumentation) { frame_count_.Increment(); frame_time_.Start(); - - if (process_info_ && process_info_->SampleNow()) { - memory_usage_.Add(process_info_->GetResidentMemorySize()); - } } } @@ -33,11 +29,12 @@ void CompositorContext::EndFrame(ScopedFrame& frame, } } -CompositorContext::ScopedFrame CompositorContext::AcquireFrame( +std::unique_ptr CompositorContext::AcquireFrame( GrContext* gr_context, SkCanvas* canvas, bool instrumentation_enabled) { - return ScopedFrame(*this, gr_context, canvas, instrumentation_enabled); + return std::make_unique(*this, gr_context, canvas, + instrumentation_enabled); } CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, @@ -51,18 +48,23 @@ CompositorContext::ScopedFrame::ScopedFrame(CompositorContext& context, context_.BeginFrame(*this, instrumentation_enabled_); } -CompositorContext::ScopedFrame::ScopedFrame(ScopedFrame&& frame) = default; - CompositorContext::ScopedFrame::~ScopedFrame() { context_.EndFrame(*this, instrumentation_enabled_); } +bool CompositorContext::ScopedFrame::Raster(flow::LayerTree& layer_tree, + bool ignore_raster_cache) { + layer_tree.Preroll(*this, ignore_raster_cache); + layer_tree.Paint(*this); + return true; +} + void CompositorContext::OnGrContextCreated() { - texture_registry_->OnGrContextCreated(); + texture_registry_.OnGrContextCreated(); } void CompositorContext::OnGrContextDestroyed() { - texture_registry_->OnGrContextDestroyed(); + texture_registry_.OnGrContextDestroyed(); raster_cache_.Clear(); } diff --git a/flow/compositor_context.h b/flow/compositor_context.h index 2d310422747b7..14c2449dbecd0 100644 --- a/flow/compositor_context.h +++ b/flow/compositor_context.h @@ -9,7 +9,6 @@ #include #include "flutter/flow/instrumentation.h" -#include "flutter/flow/process_info.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" #include "lib/fxl/macros.h" @@ -18,19 +17,26 @@ namespace flow { +class LayerTree; + class CompositorContext { public: class ScopedFrame { public: + ScopedFrame(CompositorContext& context, + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled); + + virtual ~ScopedFrame(); + SkCanvas* canvas() { return canvas_; } CompositorContext& context() const { return context_; } GrContext* gr_context() const { return gr_context_; } - ScopedFrame(ScopedFrame&& frame); - - ~ScopedFrame(); + virtual bool Raster(LayerTree& layer_tree, bool ignore_raster_cache); private: CompositorContext& context_; @@ -38,23 +44,17 @@ class CompositorContext { SkCanvas* canvas_; const bool instrumentation_enabled_; - ScopedFrame(CompositorContext& context, - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled); - - friend class CompositorContext; - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); }; - CompositorContext(std::unique_ptr info); + CompositorContext(); - ~CompositorContext(); + virtual ~CompositorContext(); - ScopedFrame AcquireFrame(GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled = true); + virtual std::unique_ptr AcquireFrame( + GrContext* gr_context, + SkCanvas* canvas, + bool instrumentation_enabled); void OnGrContextCreated(); @@ -62,7 +62,7 @@ class CompositorContext { RasterCache& raster_cache() { return raster_cache_; } - TextureRegistry& texture_registry() { return *texture_registry_; } + TextureRegistry& texture_registry() { return texture_registry_; } const Counter& frame_count() const { return frame_count_; } @@ -70,20 +70,12 @@ class CompositorContext { Stopwatch& engine_time() { return engine_time_; } - const CounterValues& memory_usage() const { return memory_usage_; } - - void SetTextureRegistry(TextureRegistry* textureRegistry) { - texture_registry_ = textureRegistry; - } - private: RasterCache raster_cache_; - TextureRegistry* texture_registry_; - std::unique_ptr process_info_; + TextureRegistry texture_registry_; Counter frame_count_; Stopwatch frame_time_; Stopwatch engine_time_; - CounterValues memory_usage_; void BeginFrame(ScopedFrame& frame, bool enable_instrumentation); diff --git a/flow/debug_print.cc b/flow/debug_print.cc index 0aa5b4b3b7d2d..3311b9c2b43e3 100644 --- a/flow/debug_print.cc +++ b/flow/debug_print.cc @@ -80,3 +80,8 @@ std::ostream& operator<<(std::ostream& os, const flow::RasterCacheKey& k) { ; return os; } + +std::ostream& operator<<(std::ostream& os, const SkISize& size) { + os << size.width() << ", " << size.height(); + return os; +} diff --git a/flow/debug_print.h b/flow/debug_print.h index ca5973eeb0977..78a28fe38562d 100644 --- a/flow/debug_print.h +++ b/flow/debug_print.h @@ -15,14 +15,15 @@ #define DEF_PRINTER(x) std::ostream& operator<<(std::ostream&, const x&); -DEF_PRINTER(flow::RasterCacheKey); DEF_PRINTER(flow::MatrixDecomposition); +DEF_PRINTER(flow::RasterCacheKey); +DEF_PRINTER(SkISize); DEF_PRINTER(SkMatrix); DEF_PRINTER(SkMatrix44); -DEF_PRINTER(SkVector3); -DEF_PRINTER(SkVector4); +DEF_PRINTER(SkPoint); DEF_PRINTER(SkRect); DEF_PRINTER(SkRRect); -DEF_PRINTER(SkPoint); +DEF_PRINTER(SkVector3); +DEF_PRINTER(SkVector4); #endif // FLUTTER_FLOW_DEBUG_PRINT_H_ diff --git a/flow/export_node.cc b/flow/export_node.cc index a130c426a75bf..27ab34030ca42 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -4,28 +4,27 @@ #include "flutter/flow/export_node.h" -#include "flutter/common/threads.h" #include "lib/fxl/functional/make_copyable.h" namespace flow { ExportNodeHolder::ExportNodeHolder( + fxl::RefPtr gpu_task_runner, fxl::RefPtr export_token_handle) - : export_node_(std::make_unique(export_token_handle)) { - ASSERT_IS_UI_THREAD; + : gpu_task_runner_(std::move(gpu_task_runner)), + export_node_(std::make_unique(export_token_handle)) { + FXL_DCHECK(gpu_task_runner_); } void ExportNodeHolder::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { - ASSERT_IS_GPU_THREAD; export_node_->Bind(context, container, offset, hit_testable); } ExportNodeHolder::~ExportNodeHolder() { - ASSERT_IS_UI_THREAD; - blink::Threads::Gpu()->PostTask( + gpu_task_runner_->PostTask( fxl::MakeCopyable([export_node = std::move(export_node_)]() { export_node->Dispose(true); })); @@ -44,8 +43,6 @@ void ExportNode::Bind(SceneUpdateContext& context, scenic_lib::ContainerNode& container, const SkPoint& offset, bool hit_testable) { - ASSERT_IS_GPU_THREAD; - if (export_token_) { // Happens first time we bind. node_.reset(new scenic_lib::EntityNode(container.session())); @@ -67,8 +64,6 @@ void ExportNode::Bind(SceneUpdateContext& context, } void ExportNode::Dispose(bool remove_from_scene_update_context) { - ASSERT_IS_GPU_THREAD; - // If scene_update_context_ is set, then we should still have a node left to // dereference. // If scene_update_context_ is null, then either: diff --git a/flow/export_node.h b/flow/export_node.h index 24f94fcebf20f..e6a11175e561e 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -15,6 +15,7 @@ #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/ui/scenic/client/resources.h" +#include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" namespace flow { @@ -24,7 +25,8 @@ namespace flow { // held by the ExportNode. class ExportNodeHolder : public fxl::RefCountedThreadSafe { public: - ExportNodeHolder(fxl::RefPtr export_token_handle); + ExportNodeHolder(fxl::RefPtr gpu_task_runner, + fxl::RefPtr export_token_handle); ~ExportNodeHolder(); // Calls Bind() on the wrapped ExportNode. @@ -36,6 +38,7 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { ExportNode* export_node() { return export_node_.get(); } private: + fxl::RefPtr gpu_task_runner_; std::unique_ptr export_node_; FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index a33b0eaa681b7..ca228a7d58f76 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -137,20 +137,20 @@ void DefaultLayerBuilder::PushPerformanceOverlay(uint64_t enabled_options, } void DefaultLayerBuilder::PushPicture(const SkPoint& offset, - sk_sp picture, + SkiaGPUObject picture, bool picture_is_complex, bool picture_will_change) { if (!current_layer_) { return; } - SkRect pictureRect = picture->cullRect(); + SkRect pictureRect = picture.get()->cullRect(); pictureRect.offset(offset.x(), offset.y()); if (!SkRect::Intersects(pictureRect, cull_rects_.top())) { return; } auto layer = std::make_unique(); layer->set_offset(offset); - layer->set_picture(picture); + layer->set_picture(std::move(picture)); layer->set_is_complex(picture_is_complex); layer->set_will_change(picture_will_change); current_layer_->Add(std::move(layer)); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index a62ec46714d21..cadd173ab5a84 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -59,7 +59,7 @@ class DefaultLayerBuilder final : public LayerBuilder { // |flow::LayerBuilder| void PushPicture(const SkPoint& offset, - sk_sp picture, + SkiaGPUObject picture, bool picture_is_complex, bool picture_will_change) override; diff --git a/flow/layers/layer.h b/flow/layers/layer.h index d0ef1990ab4f2..cf7ad71c36fae 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -44,9 +44,6 @@ class Layer { virtual ~Layer(); struct PrerollContext { -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics = nullptr; -#endif RasterCache* raster_cache; GrContext* gr_context; SkColorSpace* dst_color_space; @@ -59,7 +56,6 @@ class Layer { SkCanvas& canvas; const Stopwatch& frame_time; const Stopwatch& engine_time; - const CounterValues& memory_usage; TextureRegistry& texture_registry; const bool checkerboard_offscreen_layers; }; diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index 91ae13974a23b..a29e959514428 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -8,6 +8,7 @@ #include #include "flutter/flow/layers/layer.h" +#include "flutter/flow/skia_gpu_object.h" #include "garnet/public/lib/fxl/macros.h" #include "third_party/skia/include/core/SkBlendMode.h" #include "third_party/skia/include/core/SkColor.h" @@ -57,7 +58,7 @@ class LayerBuilder { const SkRect& rect) = 0; virtual void PushPicture(const SkPoint& offset, - sk_sp picture, + SkiaGPUObject picture, bool picture_is_complex, bool picture_will_change) = 0; diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index fde2fc4bf0866..d9fb374194688 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -17,43 +17,18 @@ LayerTree::LayerTree() LayerTree::~LayerTree() = default; -void LayerTree::Raster(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif - bool ignore_raster_cache) { -#if defined(OS_FUCHSIA) - FXL_DCHECK(metrics); -#endif - Preroll(frame, -#if defined(OS_FUCHSIA) - metrics, -#endif - ignore_raster_cache); - Paint(frame); -} - void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool ignore_raster_cache) { -#if defined(OS_FUCHSIA) - FXL_DCHECK(metrics); -#endif TRACE_EVENT0("flutter", "LayerTree::Preroll"); SkColorSpace* color_space = frame.canvas() ? frame.canvas()->imageInfo().colorSpace() : nullptr; frame.context().raster_cache().SetCheckboardCacheImages( checkerboard_raster_cache_images_); Layer::PrerollContext context = { -#if defined(OS_FUCHSIA) - metrics, -#endif - ignore_raster_cache ? nullptr : &frame.context().raster_cache(), - frame.gr_context(), - color_space, - SkRect::MakeEmpty(), + ignore_raster_cache ? nullptr : &frame.context().raster_cache(), + frame.gr_context(), + color_space, + SkRect::MakeEmpty(), }; root_layer_->Preroll(&context, SkMatrix::I()); @@ -63,9 +38,12 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, void LayerTree::UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container) { TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); - - SceneUpdateContext::Transform transform(context, 1.f / device_pixel_ratio_, - 1.f / device_pixel_ratio_, 1.f); + const auto& metrics = context.metrics(); + SceneUpdateContext::Transform transform(context, // context + 1.0f / metrics->scale_x, // X + 1.0f / metrics->scale_y, // Y + 1.0f / metrics->scale_z // Z + ); SceneUpdateContext::Frame frame( context, SkRRect::MakeRect( @@ -82,12 +60,13 @@ void LayerTree::UpdateScene(SceneUpdateContext& context, #endif void LayerTree::Paint(CompositorContext::ScopedFrame& frame) const { - Layer::PaintContext context = {*frame.canvas(), - frame.context().frame_time(), - frame.context().engine_time(), - frame.context().memory_usage(), - frame.context().texture_registry(), - checkerboard_offscreen_layers_}; + Layer::PaintContext context = { + *frame.canvas(), // + frame.context().frame_time(), // + frame.context().engine_time(), // + frame.context().texture_registry(), // + checkerboard_offscreen_layers_ // + }; TRACE_EVENT0("flutter", "LayerTree::Paint"); if (root_layer_->needs_painting()) diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 5ddebd088de9e..25a8e072cfa21 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -13,9 +13,6 @@ #include "flutter/flow/layers/layer.h" #include "lib/fxl/macros.h" #include "lib/fxl/time/time_delta.h" -#if defined(OS_FUCHSIA) -#include -#endif #include "third_party/skia/include/core/SkSize.h" namespace flow { @@ -26,24 +23,10 @@ class LayerTree { ~LayerTree(); - // Raster includes both Preroll and Paint. - void Raster(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif - bool ignore_raster_cache = false); - void Preroll(CompositorContext::ScopedFrame& frame, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool ignore_raster_cache = false); #if defined(OS_FUCHSIA) - void set_device_pixel_ratio(float device_pixel_ratio) { - device_pixel_ratio_ = device_pixel_ratio; - } - void UpdateScene(SceneUpdateContext& context, scenic_lib::ContainerNode& container); #endif @@ -93,10 +76,6 @@ class LayerTree { bool checkerboard_raster_cache_images_; bool checkerboard_offscreen_layers_; -#if defined(OS_FUCHSIA) - float device_pixel_ratio_ = 1.f; -#endif - FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree); }; diff --git a/flow/layers/performance_overlay_layer.cc b/flow/layers/performance_overlay_layer.cc index cc55500115a08..7d871af33b94f 100644 --- a/flow/layers/performance_overlay_layer.cc +++ b/flow/layers/performance_overlay_layer.cc @@ -57,34 +57,6 @@ void VisualizeStopWatch(SkCanvas& canvas, } } -void VisualizeCounterValuesBytes(SkCanvas& canvas, - const CounterValues& counter_values, - SkScalar x, - SkScalar y, - SkScalar width, - SkScalar height, - bool show_graph, - bool show_labels, - const std::string& label_prefix) { - 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); - counter_values.Visualize(canvas, visualization_rect); - } - - auto current_usage = counter_values.GetCurrentValue(); - - if (show_labels && current_usage > 0) { - std::stringstream stream; - stream.setf(std::ios::fixed | std::ios::showpoint); - stream << std::setprecision(2); - stream << label_prefix << " " << current_usage * 1e-6 << " MB"; - DrawStatisticsText(canvas, stream.str(), x + label_x, y + height + label_y); - } -} - } // namespace PerformanceOverlayLayer::PerformanceOverlayLayer(uint64_t options) @@ -111,11 +83,6 @@ void PerformanceOverlayLayer::Paint(PaintContext& context) const { VisualizeStopWatch(context.canvas, context.engine_time, x, y + height, width, height - padding, options_ & kVisualizeEngineStatistics, options_ & kDisplayEngineStatistics, "UI"); - - VisualizeCounterValuesBytes( - context.canvas, context.memory_usage, x, y + (2 * height), width, - height - padding, options_ & kVisualizeMemoryStatistics, - options_ & kDisplayMemoryStatistics, "Memory (Resident)"); } } // namespace flow diff --git a/flow/layers/performance_overlay_layer.h b/flow/layers/performance_overlay_layer.h index e7c3ac530a02a..77448107147a4 100644 --- a/flow/layers/performance_overlay_layer.h +++ b/flow/layers/performance_overlay_layer.h @@ -14,8 +14,6 @@ const int kDisplayRasterizerStatistics = 1 << 0; const int kVisualizeRasterizerStatistics = 1 << 1; const int kDisplayEngineStatistics = 1 << 2; const int kVisualizeEngineStatistics = 1 << 3; -const int kDisplayMemoryStatistics = 1 << 4; -const int kVisualizeMemoryStatistics = 1 << 5; class PerformanceOverlayLayer : public Layer { public: diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index 4a99d7d07f75e..552ca0443bd80 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -4,39 +4,30 @@ #include "flutter/flow/layers/picture_layer.h" -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace flow { PictureLayer::PictureLayer() = default; -PictureLayer::~PictureLayer() { - // The picture may contain references to textures that are associated - // with the IO thread's context. - SkPicture* picture = picture_.release(); - if (picture) { - blink::Threads::IO()->PostTask([picture]() { picture->unref(); }); - } -} +PictureLayer::~PictureLayer() = default; void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { + SkPicture* sk_picture = picture(); + if (auto cache = context->raster_cache) { raster_cache_result_ = cache->GetPrerolledImage( - context->gr_context, picture_.get(), matrix, context->dst_color_space, -#if defined(OS_FUCHSIA) - context->metrics, -#endif + context->gr_context, sk_picture, matrix, context->dst_color_space, is_complex_, will_change_); } - SkRect bounds = picture_->cullRect().makeOffset(offset_.x(), offset_.y()); + SkRect bounds = sk_picture->cullRect().makeOffset(offset_.x(), offset_.y()); set_paint_bounds(bounds); } void PictureLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PictureLayer::Paint"); - FXL_DCHECK(picture_); + FXL_DCHECK(picture_.get()); FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); @@ -53,7 +44,7 @@ void PictureLayer::Paint(PaintContext& context) const { SkCanvas::kStrict_SrcRectConstraint // source constraint ); } else { - context.canvas.drawPicture(picture_.get()); + context.canvas.drawPicture(picture()); } } diff --git a/flow/layers/picture_layer.h b/flow/layers/picture_layer.h index 191ef9d7097a2..c67929b7cb455 100644 --- a/flow/layers/picture_layer.h +++ b/flow/layers/picture_layer.h @@ -5,8 +5,11 @@ #ifndef FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ #define FLUTTER_FLOW_LAYERS_PICTURE_LAYER_H_ +#include + #include "flutter/flow/layers/layer.h" #include "flutter/flow/raster_cache.h" +#include "flutter/flow/skia_gpu_object.h" namespace flow { @@ -16,12 +19,14 @@ class PictureLayer : public Layer { ~PictureLayer() override; void set_offset(const SkPoint& offset) { offset_ = offset; } - void set_picture(sk_sp picture) { picture_ = std::move(picture); } + void set_picture(SkiaGPUObject picture) { + picture_ = std::move(picture); + } void set_is_complex(bool value) { is_complex_ = value; } void set_will_change(bool value) { will_change_ = value; } - SkPicture* picture() const { return picture_.get(); } + SkPicture* picture() const { return picture_.get().get(); } void Preroll(PrerollContext* frame, const SkMatrix& matrix) override; @@ -29,7 +34,9 @@ class PictureLayer : public Layer { private: SkPoint offset_; - sk_sp picture_; + // Even though pictures themselves are not GPU resources, they may reference + // images that have a reference to a GPU resource. + SkiaGPUObject picture_; bool is_complex_ = false; bool will_change_ = false; RasterCacheResult raster_cache_result_; diff --git a/flow/process_info.h b/flow/process_info.h deleted file mode 100644 index 6623fe7257396..0000000000000 --- a/flow/process_info.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_FLOW_PROCESS_INFO_H_ -#define FLUTTER_FLOW_PROCESS_INFO_H_ - -#include "lib/fxl/macros.h" - -namespace flow { - -/// The CompositorContext attempts to collect information from the process for -/// instrumentation purposes. The compositor does not have the platform -/// specific capabilities to collect this information on its own. The platform -/// can choose to provide this information however. -class ProcessInfo { - public: - virtual ~ProcessInfo() = default; - - virtual bool SampleNow() = 0; - - /// Virtual memory size in bytes. - virtual size_t GetVirtualMemorySize() = 0; - - /// Resident memory size in bytes. - virtual size_t GetResidentMemorySize() = 0; -}; - -} // namespace flow - -#endif // FLUTTER_FLOW_PROCESS_INFO_H_ diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index aa9fad0e281de..11a86729b489b 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -6,7 +6,6 @@ #include -#include "flutter/common/threads.h" #include "flutter/flow/paint_utils.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @@ -73,9 +72,6 @@ RasterCacheResult RasterizePicture(SkPicture* picture, GrContext* context, const MatrixDecomposition& matrix, SkColorSpace* dst_color_space, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool checkerboard) { TRACE_EVENT0("flutter", "RasterCachePopulate"); @@ -83,17 +79,9 @@ RasterCacheResult RasterizePicture(SkPicture* picture, const SkRect logical_rect = picture->cullRect(); -#if defined(OS_FUCHSIA) - float metrics_scale_x = metrics->scale_x; - float metrics_scale_y = metrics->scale_y; -#else - float metrics_scale_x = 1.f; - float metrics_scale_y = 1.f; -#endif - - const SkRect physical_rect = SkRect::MakeWH( - std::fabs(logical_rect.width() * metrics_scale_x * scale.x()), - std::fabs(logical_rect.height() * metrics_scale_y * scale.y())); + const SkRect physical_rect = + SkRect::MakeWH(std::fabs(logical_rect.width() * scale.x()), + std::fabs(logical_rect.height() * scale.y())); const SkImageInfo image_info = SkImageInfo::MakeN32Premul( std::ceil(physical_rect.width()), // physical width @@ -120,8 +108,7 @@ RasterCacheResult RasterizePicture(SkPicture* picture, } canvas->clear(SK_ColorTRANSPARENT); - canvas->scale(std::abs(scale.x() * metrics_scale_x), - std::abs(scale.y() * metrics_scale_y)); + canvas->scale(std::abs(scale.x()), std::abs(scale.y())); canvas->translate(-logical_rect.left(), -logical_rect.top()); canvas->drawPicture(picture); @@ -153,9 +140,6 @@ RasterCacheResult RasterCache::GetPrerolledImage( SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool is_complex, bool will_change) { if (!IsPictureWorthRasterizing(picture, will_change, is_complex)) { @@ -172,11 +156,7 @@ RasterCacheResult RasterCache::GetPrerolledImage( return {}; } - RasterCacheKey cache_key(*picture, -#if defined(OS_FUCHSIA) - metrics->scale_x, metrics->scale_y, -#endif - matrix); + RasterCacheKey cache_key(*picture, matrix); Entry& entry = cache_[cache_key]; entry.access_count = ClampSize(entry.access_count + 1, 0, threshold_); @@ -189,9 +169,6 @@ RasterCacheResult RasterCache::GetPrerolledImage( if (!entry.image.is_valid()) { entry.image = RasterizePicture(picture, context, matrix, dst_color_space, -#if defined(OS_FUCHSIA) - metrics, -#endif checkerboard_images_); } diff --git a/flow/raster_cache.h b/flow/raster_cache.h index 31201049b6119..3278eb355b030 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -12,9 +12,6 @@ #include "flutter/flow/raster_cache_key.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" -#if defined(OS_FUCHSIA) -#include -#endif #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -57,9 +54,6 @@ class RasterCache { SkPicture* picture, const SkMatrix& transformation_matrix, SkColorSpace* dst_color_space, -#if defined(OS_FUCHSIA) - gfx::Metrics* metrics, -#endif bool is_complex, bool will_change); diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index 83df52658c981..1f28ea5320d36 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -15,30 +15,15 @@ namespace flow { class RasterCacheKey { public: - RasterCacheKey(const SkPicture& picture, -#if defined(OS_FUCHSIA) - float metrics_scale_x, - float metrics_scale_y, -#endif - const MatrixDecomposition& matrix) + RasterCacheKey(const SkPicture& picture, const MatrixDecomposition& matrix) : picture_id_(picture.uniqueID()), -#if defined(OS_FUCHSIA) - metrics_scale_x_(metrics_scale_x), - metrics_scale_y_(metrics_scale_y), -#endif - scale_key_( - SkISize::Make(matrix.scale().x() * 1e3, matrix.scale().y() * 1e3)) { - } + scale_key_(SkISize::Make(matrix.scale().x() * 1e3, + matrix.scale().y() * 1e3)) {} uint32_t picture_id() const { return picture_id_; } const SkISize& scale_key() const { return scale_key_; } -#if defined(OS_FUCHSIA) - float metrics_scale_x() const { return metrics_scale_x_; } - float metrics_scale_y() const { return metrics_scale_y_; } -#endif - struct Hash { std::size_t operator()(RasterCacheKey const& key) const { return key.picture_id_; @@ -49,11 +34,6 @@ class RasterCacheKey { constexpr bool operator()(const RasterCacheKey& lhs, const RasterCacheKey& rhs) const { return lhs.picture_id_ == rhs.picture_id_ && -#if defined(OS_FUCHSIA) - lhs.metrics_scale_x_ == rhs.metrics_scale_x_ && - - lhs.metrics_scale_y_ == rhs.metrics_scale_y_ && -#endif lhs.scale_key_ == rhs.scale_key_; } }; @@ -63,10 +43,6 @@ class RasterCacheKey { private: uint32_t picture_id_; -#if defined(OS_FUCHSIA) - float metrics_scale_x_; - float metrics_scale_y_; -#endif SkISize scale_key_; }; diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index 83883c508b4df..b9d6801cc82ee 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -4,7 +4,6 @@ #include "flutter/flow/scene_update_context.h" -#include "flutter/common/threads.h" #include "flutter/flow/export_node.h" #include "flutter/flow/layers/layer.h" #include "flutter/flow/matrix_decomposition.h" @@ -19,9 +18,7 @@ SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session, } SceneUpdateContext::~SceneUpdateContext() { - ASSERT_IS_GPU_THREAD; - - // Release Scenic session resources for all ExportNodes. + // Release Mozart session resources for all ExportNodes. for (auto export_node : export_nodes_) { export_node->Dispose(false); } @@ -30,21 +27,16 @@ SceneUpdateContext::~SceneUpdateContext() { void SceneUpdateContext::AddChildScene(ExportNode* export_node, SkPoint offset, bool hit_testable) { - ASSERT_IS_GPU_THREAD; FXL_DCHECK(top_entity_); export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable); } void SceneUpdateContext::AddExportNode(ExportNode* export_node) { - ASSERT_IS_GPU_THREAD; - export_nodes_.insert(export_node); // Might already have been added. } void SceneUpdateContext::RemoveExportNode(ExportNode* export_node) { - ASSERT_IS_GPU_THREAD; - export_nodes_.erase(export_node); } @@ -195,12 +187,9 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { for (auto& task : paint_tasks_) { FXL_DCHECK(task.surface); SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas(); - Layer::PaintContext context = {*canvas, - frame.context().frame_time(), + Layer::PaintContext context = {*canvas, frame.context().frame_time(), frame.context().engine_time(), - frame.context().memory_usage(), - frame.context().texture_registry(), - false}; + frame.context().texture_registry(), false}; canvas->restoreToCount(1); canvas->save(); canvas->clear(task.background_color); diff --git a/flow/skia_gpu_object.cc b/flow/skia_gpu_object.cc new file mode 100644 index 0000000000000..ce2312f921580 --- /dev/null +++ b/flow/skia_gpu_object.cc @@ -0,0 +1,44 @@ +// Copyright 2017 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/skia_gpu_object.h" + +#include "flutter/fml/message_loop.h" + +namespace flow { + +SkiaUnrefQueue::SkiaUnrefQueue(fxl::RefPtr task_runner, + fxl::TimeDelta delay) + : task_runner_(std::move(task_runner)), + drain_delay_(delay), + drain_pending_(false) {} + +SkiaUnrefQueue::~SkiaUnrefQueue() { + Drain(); +} + +void SkiaUnrefQueue::Unref(SkRefCnt* object) { + std::lock_guard lock(mutex_); + objects_.push_back(object); + if (!drain_pending_) { + drain_pending_ = true; + task_runner_->PostDelayedTask( + [strong = fxl::Ref(this)]() { strong->Drain(); }, drain_delay_); + } +} + +void SkiaUnrefQueue::Drain() { + std::deque skia_objects; + { + std::lock_guard lock(mutex_); + objects_.swap(skia_objects); + drain_pending_ = false; + } + + for (SkRefCnt* skia_object : skia_objects) { + skia_object->unref(); + } +} + +} // namespace flow diff --git a/flow/skia_gpu_object.h b/flow/skia_gpu_object.h new file mode 100644 index 0000000000000..4711f80c6f4fd --- /dev/null +++ b/flow/skia_gpu_object.h @@ -0,0 +1,88 @@ +// Copyright 2017 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_FLOW_SKIA_GPU_OBJECT_H_ +#define FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ + +#include +#include + +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/task_runner.h" +#include "lib/fxl/memory/ref_ptr.h" +#include "third_party/skia/include/core/SkRefCnt.h" + +namespace flow { + +// A queue that holds Skia objects that must be destructed on the the given task +// runner. +class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { + public: + void Unref(SkRefCnt* object); + + // Usually, the drain is called automatically. However, during IO manager + // shutdown (when the platform side reference to the OpenGL context is about + // to go away), we may need to pre-emptively drain the unref queue. It is the + // responsibility of the caller to ensure that no further unrefs are queued + // after this call. + void Drain(); + + private: + const fxl::RefPtr task_runner_; + const fxl::TimeDelta drain_delay_; + std::mutex mutex_; + std::deque objects_; + bool drain_pending_; + + SkiaUnrefQueue(fxl::RefPtr task_runner, + fxl::TimeDelta delay); + + ~SkiaUnrefQueue(); + + FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); + FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); + FXL_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); +}; + +/// An object whose deallocation needs to be performed on an specific unref +/// queue. The template argument U need to have a call operator that returns +/// that unref queue. +template +class SkiaGPUObject { + public: + using SkiaObjectType = T; + + SkiaGPUObject() = default; + + SkiaGPUObject(sk_sp object, fxl::RefPtr queue) + : object_(std::move(object)), queue_(std::move(queue)) { + FXL_DCHECK(queue_ && object_); + } + + SkiaGPUObject(SkiaGPUObject&&) = default; + + ~SkiaGPUObject() { reset(); } + + SkiaGPUObject& operator=(SkiaGPUObject&&) = default; + + sk_sp get() const { return object_; } + + void reset() { + if (object_) { + queue_->Unref(object_.release()); + } + queue_ = nullptr; + FXL_DCHECK(object_ == nullptr); + } + + private: + sk_sp object_; + fxl::RefPtr queue_; + + FXL_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); +}; + +} // namespace flow + +#endif // FLUTTER_FLOW_SKIA_GPU_OBJECT_H_ diff --git a/flow/texture.cc b/flow/texture.cc index 33a48af989477..d5cc3ae228aa7 100644 --- a/flow/texture.cc +++ b/flow/texture.cc @@ -11,36 +11,32 @@ TextureRegistry::TextureRegistry() = default; TextureRegistry::~TextureRegistry() = default; void TextureRegistry::RegisterTexture(std::shared_ptr texture) { - ASSERT_IS_GPU_THREAD mapping_[texture->Id()] = texture; } void TextureRegistry::UnregisterTexture(int64_t id) { - ASSERT_IS_GPU_THREAD mapping_.erase(id); } void TextureRegistry::OnGrContextCreated() { - ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextCreated(); } } void TextureRegistry::OnGrContextDestroyed() { - ASSERT_IS_GPU_THREAD; for (auto& it : mapping_) { it.second->OnGrContextDestroyed(); } } std::shared_ptr TextureRegistry::GetTexture(int64_t id) { - ASSERT_IS_GPU_THREAD auto it = mapping_.find(id); return it != mapping_.end() ? it->second : nullptr; } Texture::Texture(int64_t id) : id_(id) {} + Texture::~Texture() = default; } // namespace flow diff --git a/flow/texture.h b/flow/texture.h index a602a6b45b5b4..f5e4430834084 100644 --- a/flow/texture.h +++ b/flow/texture.h @@ -6,7 +6,7 @@ #define FLUTTER_FLOW_TEXTURE_H_ #include -#include "flutter/common/threads.h" + #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -29,6 +29,9 @@ class Texture { // Called from GPU thread. virtual void OnGrContextDestroyed() = 0; + // Called on GPU thread. + virtual void MarkNewFrameAvailable() = 0; + int64_t Id() { return id_; } private: diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 6dabcb446c912..ffbf949cc0957 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -4,9 +4,12 @@ source_set("fml") { sources = [ + "file.h", "icu_util.cc", "icu_util.h", + "mapping.cc", "mapping.h", + "memory/thread_checker.h", "memory/weak_ptr.h", "memory/weak_ptr_internal.cc", "memory/weak_ptr_internal.h", @@ -14,8 +17,9 @@ source_set("fml") { "message_loop.h", "message_loop_impl.cc", "message_loop_impl.h", + "native_library.h", + "paths.cc", "paths.h", - "task_observer.h", "task_runner.cc", "task_runner.h", "thread.cc", @@ -23,6 +27,9 @@ source_set("fml") { "thread_local.h", "trace_event.cc", "trace_event.h", + "unique_fd.cc", + "unique_fd.h", + "unique_object.h", ] deps = [ @@ -95,16 +102,25 @@ source_set("fml") { ] } + if (is_fuchsia) { + sources += [ "platform/fuchsia/paths_fuchsia.cc" ] + } + if (is_win) { sources += [ + "platform/win/file_win.cc", "platform/win/mapping_win.cc", "platform/win/message_loop_win.cc", "platform/win/message_loop_win.h", + "platform/win/native_library_win.cc", "platform/win/paths_win.cc", + "platform/win/wstring_conversion.h", ] } else { sources += [ + "platform/posix/file_posix.cc", "platform/posix/mapping_posix.cc", + "platform/posix/native_library_posix.cc", ] } } diff --git a/fml/file.h b/fml/file.h new file mode 100644 index 0000000000000..2327b2eef831e --- /dev/null +++ b/fml/file.h @@ -0,0 +1,35 @@ +// Copyright 2018 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_FILE_H_ +#define FLUTTER_FML_FILE_H_ + +#include "flutter/fml/unique_fd.h" +#include "lib/fxl/macros.h" + +namespace fml { + +enum class OpenPermission { + kRead = 1, + kWrite = 1 << 1, + kReadWrite = kRead | kWrite, + kExecute, +}; + +fml::UniqueFD OpenFile(const char* path, + OpenPermission permission, + bool is_directory = false); + +fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, + const char* path, + OpenPermission permission, + bool is_directory = false); + +fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor); + +bool IsDirectory(const fml::UniqueFD& directory); + +} // namespace fml + +#endif // FLUTTER_FML_FILE_H_ diff --git a/fml/icu_util.cc b/fml/icu_util.cc index 093dc3d02b1bc..0c0acd06dbbdf 100644 --- a/fml/icu_util.cc +++ b/fml/icu_util.cc @@ -22,8 +22,6 @@ static constexpr char kPathSeparator = '\\'; static constexpr char kPathSeparator = '/'; #endif -static constexpr char kIcuDataFileName[] = "icudtl.dat"; - class ICUContext { public: ICUContext(const std::string& icu_data_path) : valid_(false) { @@ -34,15 +32,15 @@ class ICUContext { bool SetupMapping(const std::string& icu_data_path) { // Check if the explicit path specified exists. - auto overriden_path_mapping = std::make_unique(icu_data_path); - if (overriden_path_mapping->GetSize() != 0) { - mapping_ = std::move(overriden_path_mapping); + auto path_mapping = std::make_unique(icu_data_path, false); + if (path_mapping->GetSize() != 0) { + mapping_ = std::move(path_mapping); return true; } // Check to see if the mapping is in the resources bundle. if (PlatformHasResourcesBundle()) { - auto resource = GetResourceMapping(kIcuDataFileName); + auto resource = GetResourceMapping(icu_data_path); if (resource != nullptr && resource->GetSize() != 0) { mapping_ = std::move(resource); return true; @@ -57,10 +55,8 @@ class ICUContext { return false; } - // FIXME(chinmaygarde): There is no Path::Join in FXL. So a non-portable - // version is used here. Patch FXL and update. auto file = std::make_unique( - directory.second + kPathSeparator + kIcuDataFileName); + directory.second + kPathSeparator + icu_data_path, false); if (file->GetSize() != 0) { mapping_ = std::move(file); return true; @@ -96,7 +92,8 @@ class ICUContext { void InitializeICUOnce(const std::string& icu_data_path) { static ICUContext* context = new ICUContext(icu_data_path); - FXL_CHECK(context->IsValid()) << "Must be able to initialize the ICU context"; + FXL_CHECK(context->IsValid()) + << "Must be able to initialize the ICU context. Tried: " << icu_data_path; } std::once_flag g_icu_init_flag; diff --git a/fml/macros.h b/fml/macros.h new file mode 100644 index 0000000000000..ba46b9dda4b4d --- /dev/null +++ b/fml/macros.h @@ -0,0 +1,20 @@ +// Copyright 2018 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_MACROS_H_ +#define FLUTTER_FML_MACROS_H_ + +#include "lib/fxl/macros.h" + +#ifndef FML_USED_ON_EMBEDDER + +#define FML_EMBEDDER_ONLY [[deprecated]] + +#else // FML_USED_ON_EMBEDDER + +#define FML_EMBEDDER_ONLY + +#endif // FML_USED_ON_EMBEDDER + +#endif // FLUTTER_FML_MACROS_H_ diff --git a/fml/mapping.cc b/fml/mapping.cc new file mode 100644 index 0000000000000..97d7905015f61 --- /dev/null +++ b/fml/mapping.cc @@ -0,0 +1,20 @@ +// Copyright 2018 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/mapping.h" + +namespace fml { + +DataMapping::DataMapping(std::vector data) : data_(std::move(data)) {} + +DataMapping::~DataMapping() = default; + +size_t DataMapping::GetSize() const { + return data_.size(); +} + +const uint8_t* DataMapping::GetMapping() const { + return data_.data(); +} +} // namespace fml diff --git a/fml/mapping.h b/fml/mapping.h index 8963b22a9c1f6..00e9685dd6b0c 100644 --- a/fml/mapping.h +++ b/fml/mapping.h @@ -7,14 +7,10 @@ #include #include +#include +#include "flutter/fml//unique_fd.h" #include "lib/fxl/build_config.h" - -#if OS_WIN -#include -#endif - -#include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { @@ -39,12 +35,9 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name); class FileMapping : public Mapping { public: - FileMapping(const std::string& path); + FileMapping(const std::string& path, bool executable = false); -// fxl::UniqueFD isn't supported for Windows handles. -#if !OS_WIN - FileMapping(const fxl::UniqueFD& fd); -#endif + FileMapping(const fml::UniqueFD& fd, bool executable = false); ~FileMapping() override; @@ -53,16 +46,32 @@ class FileMapping : public Mapping { const uint8_t* GetMapping() const override; private: - size_t size_; - uint8_t* mapping_; + size_t size_ = 0; + uint8_t* mapping_ = nullptr; #if OS_WIN - HANDLE mapping_handle_; + fml::UniqueFD mapping_handle_; #endif FXL_DISALLOW_COPY_AND_ASSIGN(FileMapping); }; +class DataMapping : public Mapping { + public: + DataMapping(std::vector data); + + ~DataMapping() override; + + size_t GetSize() const override; + + const uint8_t* GetMapping() const override; + + private: + std::vector data_; + + FXL_DISALLOW_COPY_AND_ASSIGN(DataMapping); +}; + } // namespace fml #endif // FLUTTER_FML_MAPPING_H_ diff --git a/fml/memory/thread_checker.h b/fml/memory/thread_checker.h new file mode 100644 index 0000000000000..f22e9d1cfaf06 --- /dev/null +++ b/fml/memory/thread_checker.h @@ -0,0 +1,69 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// A class for checking that the current thread is/isn't the same as an initial +// thread. + +#ifndef FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ +#define FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ + +#include "lib/fxl/build_config.h" + +#if defined(OS_WIN) +#include +#else +#include +#endif + +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" + +namespace fml { + +// A simple class that records the identity of the thread that it was created +// on, and at later points can tell if the current thread is the same as its +// creation thread. This class is thread-safe. +// +// Note: Unlike Chromium's |base::ThreadChecker|, this is *not* Debug-only (so +// #ifdef it out if you want something Debug-only). (Rationale: Having a +// |CalledOnValidThread()| that lies in Release builds seems bad. Moreover, +// there's a small space cost to having even an empty class. ) +class ThreadChecker final { + public: +#if defined(OS_WIN) + ThreadChecker() : self_(GetCurrentThreadId()) {} + ~ThreadChecker() {} + + bool IsCreationThreadCurrent() const { return GetCurrentThreadId() == self_; } + + private: + DWORD self_; + +#else + ThreadChecker() : self_(pthread_self()) {} + ~ThreadChecker() {} + + // Returns true if the current thread is the thread this object was created + // on and false otherwise. + bool IsCreationThreadCurrent() const { + return !!pthread_equal(pthread_self(), self_); + } + + private: + pthread_t self_; +#endif +}; + +#ifndef NDEBUG +#define FML_DECLARE_THREAD_CHECKER(c) fml::ThreadChecker c +#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) \ + FXL_DCHECK((c).IsCreationThreadCurrent()) +#else +#define FML_DECLARE_THREAD_CHECKER(c) +#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) ((void)0) +#endif + +} // namespace fml + +#endif // FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ diff --git a/fml/memory/weak_ptr.h b/fml/memory/weak_ptr.h index 5b85c531966b2..2b369952d7306 100644 --- a/fml/memory/weak_ptr.h +++ b/fml/memory/weak_ptr.h @@ -10,12 +10,17 @@ #include +#include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr_internal.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_counted.h" namespace fml { +struct DebugThreadChecker { + FML_DECLARE_THREAD_CHECKER(checker); +}; + // Forward declaration, so |WeakPtr| can friend it. template class WeakPtrFactory; @@ -41,13 +46,17 @@ class WeakPtr { WeakPtr(const WeakPtr& r) = default; template - WeakPtr(const WeakPtr& r) : ptr_(r.ptr_), flag_(r.flag_) {} + WeakPtr(const WeakPtr& r) + : ptr_(static_cast(r.ptr_)), flag_(r.flag_), checker_(r.checker_) {} // Move constructor. WeakPtr(WeakPtr&& r) = default; template - WeakPtr(WeakPtr&& r) : ptr_(r.ptr_), flag_(std::move(r.flag_)) {} + WeakPtr(WeakPtr&& r) + : ptr_(static_cast(r.ptr_)), + flag_(std::move(r.flag_)), + checker_(r.checker_) {} ~WeakPtr() = default; @@ -65,16 +74,24 @@ class WeakPtr { // The following methods should only be called on the same thread as the // "originating" |WeakPtrFactory|. - explicit operator bool() const { return flag_ && flag_->is_valid(); } + explicit operator bool() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); + return flag_ && flag_->is_valid(); + } - T* get() const { return *this ? ptr_ : nullptr; } + T* get() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); + return *this ? ptr_ : nullptr; + } T& operator*() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return *get(); } T* operator->() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); FXL_DCHECK(*this); return get(); } @@ -85,11 +102,14 @@ class WeakPtr { friend class WeakPtrFactory; - explicit WeakPtr(T* ptr, fxl::RefPtr&& flag) - : ptr_(ptr), flag_(std::move(flag)) {} + explicit WeakPtr(T* ptr, + fxl::RefPtr&& flag, + DebugThreadChecker checker) + : ptr_(ptr), flag_(std::move(flag)), checker_(checker) {} T* ptr_; fxl::RefPtr flag_; + DebugThreadChecker checker_; // Copy/move construction/assignment supported. }; @@ -140,19 +160,22 @@ template class WeakPtrFactory { public: explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { FXL_DCHECK(ptr_); } + ~WeakPtrFactory() { InvalidateWeakPtrs(); } // Gets a new weak pointer, which will be valid until either // |InvalidateWeakPtrs()| is called or this object is destroyed. WeakPtr GetWeakPtr() { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) flag_ = fxl::MakeRefCounted(); - return WeakPtr(ptr_, flag_.Clone()); + return WeakPtr(ptr_, flag_.Clone(), checker_); } // Call this method to invalidate all existing weak pointers. (Note that // additional weak pointers can be produced even after this is called.) void InvalidateWeakPtrs() { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); if (!flag_) return; flag_->Invalidate(); @@ -162,13 +185,17 @@ class WeakPtrFactory { // Call this method to determine if any weak pointers exist. (Note that a // "false" result is definitive, but a "true" result may not be if weak // pointers are held/reset/destroyed/reassigned on other threads.) - bool HasWeakPtrs() const { return flag_ && !flag_->HasOneRef(); } + bool HasWeakPtrs() const { + FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); + return flag_ && !flag_->HasOneRef(); + } private: // Note: See weak_ptr_internal.h for an explanation of why we store the // pointer here, instead of in the "flag". T* const ptr_; fxl::RefPtr flag_; + DebugThreadChecker checker_; FXL_DISALLOW_COPY_AND_ASSIGN(WeakPtrFactory); }; diff --git a/fml/message_loop.cc b/fml/message_loop.cc index 4765cfa76558f..44a0e307c1dd1 100644 --- a/fml/message_loop.cc +++ b/fml/message_loop.cc @@ -55,7 +55,7 @@ void MessageLoop::Terminate() { loop_->DoTerminate(); } -fxl::RefPtr MessageLoop::GetTaskRunner() const { +fxl::RefPtr MessageLoop::GetTaskRunner() const { return task_runner_; } @@ -63,12 +63,12 @@ fxl::RefPtr MessageLoop::GetLoopImpl() const { return loop_; } -void MessageLoop::AddTaskObserver(TaskObserver* observer) { - loop_->AddTaskObserver(observer); +void MessageLoop::AddTaskObserver(intptr_t key, fxl::Closure callback) { + loop_->AddTaskObserver(key, callback); } -void MessageLoop::RemoveTaskObserver(TaskObserver* observer) { - loop_->RemoveTaskObserver(observer); +void MessageLoop::RemoveTaskObserver(intptr_t key) { + loop_->RemoveTaskObserver(key); } void MessageLoop::RunExpiredTasksNow() { diff --git a/fml/message_loop.h b/fml/message_loop.h index 87773619ccc51..3bfb1c40c6df7 100644 --- a/fml/message_loop.h +++ b/fml/message_loop.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_MESSAGE_LOOP_H_ #define FLUTTER_FML_MESSAGE_LOOP_H_ -#include "flutter/fml/task_observer.h" +#include "flutter/fml/macros.h" #include "lib/fxl/macros.h" #include "lib/fxl/tasks/task_runner.h" @@ -16,6 +16,7 @@ class MessageLoopImpl; class MessageLoop { public: + FML_EMBEDDER_ONLY static MessageLoop& GetCurrent(); bool IsValid() const; @@ -24,11 +25,11 @@ class MessageLoop { void Terminate(); - void AddTaskObserver(TaskObserver* observer); + void AddTaskObserver(intptr_t key, fxl::Closure callback); - void RemoveTaskObserver(TaskObserver* observer); + void RemoveTaskObserver(intptr_t key); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; // Exposed for the embedder shell which allows clients to poll for events // instead of dedicating a thread to the message loop. diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index cec9b7e448f1a..df885f3792d5f 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -2,6 +2,8 @@ // 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 @@ -11,35 +13,29 @@ #include "lib/fxl/build_config.h" #if OS_MACOSX - #include "flutter/fml/platform/darwin/message_loop_darwin.h" -using PlatformMessageLoopImpl = fml::MessageLoopDarwin; - #elif OS_ANDROID - #include "flutter/fml/platform/android/message_loop_android.h" -using PlatformMessageLoopImpl = fml::MessageLoopAndroid; - #elif OS_LINUX - #include "flutter/fml/platform/linux/message_loop_linux.h" -using PlatformMessageLoopImpl = fml::MessageLoopLinux; - #elif OS_WIN - #include "flutter/fml/platform/win/message_loop_win.h" -using PlatformMessageLoopImpl = fml::MessageLoopWin; - -#else - -#error This platform does not have a message loop implementation. - #endif namespace fml { fxl::RefPtr MessageLoopImpl::Create() { - return fxl::MakeRefCounted<::PlatformMessageLoopImpl>(); +#if OS_MACOSX + return fxl::MakeRefCounted(); +#elif OS_ANDROID + return fxl::MakeRefCounted(); +#elif OS_LINUX + return fxl::MakeRefCounted(); +#elif OS_WIN + return fxl::MakeRefCounted(); +#else + return nullptr; +#endif } MessageLoopImpl::MessageLoopImpl() : order_(0), terminated_(false) {} @@ -55,20 +51,19 @@ void MessageLoopImpl::RunExpiredTasksNow() { RunExpiredTasks(); } -void MessageLoopImpl::AddTaskObserver(TaskObserver* observer) { - FXL_DCHECK(observer != nullptr); +void MessageLoopImpl::AddTaskObserver(intptr_t key, fxl::Closure callback) { + FXL_DCHECK(callback != nullptr); FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be added on the same thread as the " "loop."; - task_observers_.insert(observer); + task_observers_[key] = std::move(callback); } -void MessageLoopImpl::RemoveTaskObserver(TaskObserver* observer) { - FXL_DCHECK(observer != nullptr); +void MessageLoopImpl::RemoveTaskObserver(intptr_t key) { FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be removed from the same thread as " "the loop."; - task_observers_.erase(observer); + task_observers_.erase(key); } void MessageLoopImpl::DoRun() { @@ -144,7 +139,7 @@ void MessageLoopImpl::RunExpiredTasks() { for (const auto& invocation : invocations) { invocation(); for (const auto& observer : task_observers_) { - observer->DidProcessTask(); + observer.second(); } } } diff --git a/fml/message_loop_impl.h b/fml/message_loop_impl.h index bfdb2064cb264..478cbd1f1a0be 100644 --- a/fml/message_loop_impl.h +++ b/fml/message_loop_impl.h @@ -7,9 +7,9 @@ #include #include +#include #include #include -#include #include #include "flutter/fml/message_loop.h" @@ -34,9 +34,9 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { void PostTask(fxl::Closure task, fxl::TimePoint target_time); - void AddTaskObserver(TaskObserver* observer); + void AddTaskObserver(intptr_t key, fxl::Closure callback); - void RemoveTaskObserver(TaskObserver* observer); + void RemoveTaskObserver(intptr_t key); void DoRun(); @@ -71,7 +71,7 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { using DelayedTaskQueue = std:: priority_queue, DelayedTaskCompare>; - std::set task_observers_; + std::map task_observers_; std::mutex delayed_tasks_mutex_; DelayedTaskQueue delayed_tasks_; size_t order_; diff --git a/fml/message_loop_unittests.cc b/fml/message_loop_unittests.cc index 11ea72c3900eb..cd2acd308b46a 100644 --- a/fml/message_loop_unittests.cc +++ b/fml/message_loop_unittests.cc @@ -2,9 +2,12 @@ // 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 #include "flutter/fml/message_loop.h" +#include "flutter/fml/task_runner.h" #include "gtest/gtest.h" #include "lib/fxl/synchronization/waitable_event.h" @@ -244,22 +247,6 @@ TEST(MessageLoop, TIME_SENSITIVE(MultipleDelayedTasksWithDecreasingDeltas)) { ASSERT_EQ(checked, count); } -class CustomTaskObserver : public fml::TaskObserver { - public: - CustomTaskObserver(std::function lambda) : lambda_(lambda){}; - - ~CustomTaskObserver() override = default; - - void DidProcessTask() override { - if (lambda_) { - lambda_(); - } - }; - - private: - std::function lambda_; -}; - TEST(MessageLoop, TaskObserverFire) { bool started = false; bool terminated = false; @@ -269,8 +256,7 @@ TEST(MessageLoop, TaskObserverFire) { auto& loop = fml::MessageLoop::GetCurrent(); size_t task_count = 0; size_t obs_count = 0; - CustomTaskObserver obs( - PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }); + auto obs = PLATFORM_SPECIFIC_CAPTURE(&obs_count)() { obs_count++; }; for (size_t i = 0; i < count; i++) { loop.GetTaskRunner()->PostTask( PLATFORM_SPECIFIC_CAPTURE(&terminated, i, &task_count)() { @@ -282,7 +268,7 @@ TEST(MessageLoop, TaskObserverFire) { } }); } - loop.AddTaskObserver(&obs); + loop.AddTaskObserver(0, obs); loop.Run(); ASSERT_EQ(task_count, count); ASSERT_EQ(obs_count, count); diff --git a/fml/native_library.h b/fml/native_library.h new file mode 100644 index 0000000000000..7e48ed6d3a3ff --- /dev/null +++ b/fml/native_library.h @@ -0,0 +1,52 @@ +// Copyright 2018 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_NATIVE_LIBRARY_H_ +#define FLUTTER_FML_NATIVE_LIBRARY_H_ + +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" + +#if OS_WIN + +#include + +#endif // OS_WIN + +namespace fml { +class NativeLibrary : public fxl::RefCountedThreadSafe { + public: +#if OS_WIN + using Handle = HMODULE; +#else // OS_WIN + using Handle = void*; +#endif // OS_WIN + + static fxl::RefPtr Create(const char* path); + + static fxl::RefPtr CreateForCurrentProcess(); + + const uint8_t* ResolveSymbol(const char* symbol); + + private: + Handle handle_ = nullptr; + bool close_handle_ = true; + + NativeLibrary(const char* path); + + NativeLibrary(Handle handle, bool close_handle); + + ~NativeLibrary(); + + Handle GetHandle() const; + + FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrary); + FRIEND_REF_COUNTED_THREAD_SAFE(NativeLibrary); + FRIEND_MAKE_REF_COUNTED(NativeLibrary); +}; + +} // namespace fml + +#endif // FLUTTER_FML_NATIVE_LIBRARY_H_ diff --git a/fml/paths.cc b/fml/paths.cc new file mode 100644 index 0000000000000..9b06b6847f415 --- /dev/null +++ b/fml/paths.cc @@ -0,0 +1,31 @@ +// Copyright 2018 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/paths.h" + +#include "lib/fxl/build_config.h" + +namespace fml { +namespace paths { + +std::string JoinPaths(std::initializer_list components) { + std::stringstream stream; + size_t i = 0; + const size_t size = components.size(); + for (const auto& component : components) { + i++; + stream << component; + if (i != size) { +#if OS_WIN + stream << "\\"; +#else // OS_WIN + stream << "/"; +#endif // OS_WIN + } + } + return stream.str(); +} + +} // namespace paths +} // namespace fml diff --git a/fml/paths.h b/fml/paths.h index 8ec3b4b580476..0d4367654de4a 100644 --- a/fml/paths.h +++ b/fml/paths.h @@ -8,11 +8,15 @@ #include #include +#include "lib/fxl/strings/string_view.h" + namespace fml { namespace paths { std::pair GetExecutableDirectoryPath(); +std::string JoinPaths(std::initializer_list components); + } // namespace paths } // namespace fml diff --git a/fml/platform/android/message_loop_android.h b/fml/platform/android/message_loop_android.h index e6d04e8253401..19c1eafe79845 100644 --- a/fml/platform/android/message_loop_android.h +++ b/fml/platform/android/message_loop_android.h @@ -10,7 +10,7 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "lib/fxl/files/unique_fd.h" +#include "flutter/fml/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/unique_object.h" @@ -24,8 +24,8 @@ struct UniqueLooperTraits { class MessageLoopAndroid : public MessageLoopImpl { private: - fxl::UniqueObject looper_; - fxl::UniqueFD timer_fd_; + fml::UniqueObject looper_; + fml::UniqueFD timer_fd_; bool running_; MessageLoopAndroid(); diff --git a/fml/platform/darwin/resource_mapping_darwin.mm b/fml/platform/darwin/resource_mapping_darwin.mm index 5d1b9664e20bc..3ee100121ad0f 100644 --- a/fml/platform/darwin/resource_mapping_darwin.mm +++ b/fml/platform/darwin/resource_mapping_darwin.mm @@ -9,8 +9,8 @@ namespace fml { ResourceMappingDarwin::ResourceMappingDarwin(const std::string& resource) - : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String]) { -} + : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String], + false) {} ResourceMappingDarwin::~ResourceMappingDarwin() = default; diff --git a/fml/platform/fuchsia/paths_fuchsia.cc b/fml/platform/fuchsia/paths_fuchsia.cc new file mode 100644 index 0000000000000..20def9f34fae9 --- /dev/null +++ b/fml/platform/fuchsia/paths_fuchsia.cc @@ -0,0 +1,15 @@ +// Copyright 2018 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/paths.h" + +namespace fml { +namespace paths { + +std::pair GetExecutableDirectoryPath() { + return {false, ""}; +} + +} // namespace paths +} // namespace fml diff --git a/fml/platform/linux/message_loop_linux.h b/fml/platform/linux/message_loop_linux.h index 51dc690ce887b..ba5e902d4ac89 100644 --- a/fml/platform/linux/message_loop_linux.h +++ b/fml/platform/linux/message_loop_linux.h @@ -8,15 +8,15 @@ #include #include "flutter/fml/message_loop_impl.h" -#include "lib/fxl/files/unique_fd.h" +#include "flutter/fml/unique_fd.h" #include "lib/fxl/macros.h" namespace fml { class MessageLoopLinux : public MessageLoopImpl { private: - fxl::UniqueFD epoll_fd_; - fxl::UniqueFD timer_fd_; + fml::UniqueFD epoll_fd_; + fml::UniqueFD timer_fd_; bool running_; MessageLoopLinux(); diff --git a/fml/platform/posix/file_posix.cc b/fml/platform/posix/file_posix.cc new file mode 100644 index 0000000000000..028f49f4d183d --- /dev/null +++ b/fml/platform/posix/file_posix.cc @@ -0,0 +1,71 @@ +// Copyright 2018 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/file.h" + +#include +#include +#include + +#include "lib/fxl/files/eintr_wrapper.h" + +namespace fml { + +fml::UniqueFD OpenFile(const char* path, + OpenPermission permission, + bool is_directory) { + return OpenFile(fml::UniqueFD{AT_FDCWD}, path, permission, is_directory); +} + +fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, + const char* path, + OpenPermission permission, + bool is_directory) { + if (path == nullptr) { + return fml::UniqueFD{}; + } + + int flags = 0; + switch (permission) { + case OpenPermission::kRead: + flags = O_RDONLY; + break; + case OpenPermission::kWrite: + flags = O_WRONLY; + break; + case OpenPermission::kReadWrite: + flags = O_RDWR; + break; + case OpenPermission::kExecute: + flags = O_RDONLY; + break; + } + + if (is_directory) { + flags |= O_DIRECTORY; + } + + return fml::UniqueFD{ + HANDLE_EINTR(::openat(base_directory.get(), path, flags))}; +} + +fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { + return fml::UniqueFD{HANDLE_EINTR(::dup(descriptor))}; +} + +bool IsDirectory(const fml::UniqueFD& directory) { + if (!directory.is_valid()) { + return false; + } + + struct stat stat_result = {}; + + if (::fstat(directory.get(), &stat_result) != 0) { + return false; + } + + return S_ISDIR(stat_result.st_mode); +} + +} // namespace fml diff --git a/fml/platform/posix/mapping_posix.cc b/fml/platform/posix/mapping_posix.cc index 07f7edb074ab9..fc53d6a4f7fc9 100644 --- a/fml/platform/posix/mapping_posix.cc +++ b/fml/platform/posix/mapping_posix.cc @@ -11,6 +11,7 @@ #include +#include "flutter/fml/unique_fd.h" #include "lib/fxl/build_config.h" #include "lib/fxl/files/eintr_wrapper.h" @@ -39,11 +40,11 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path) - : FileMapping(fxl::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}) { -} +FileMapping::FileMapping(const std::string& path, bool executable) + : FileMapping(fml::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}, + executable) {} -FileMapping::FileMapping(const fxl::UniqueFD& handle) +FileMapping::FileMapping(const fml::UniqueFD& handle, bool executable) : size_(0), mapping_(nullptr) { if (!handle.is_valid()) { return; @@ -59,8 +60,13 @@ FileMapping::FileMapping(const fxl::UniqueFD& handle) return; } - auto mapping = ::mmap(nullptr, stat_buffer.st_size, PROT_READ, MAP_PRIVATE, - handle.get(), 0); + int flags = PROT_READ; + if (executable) { + flags |= PROT_EXEC; + } + + auto mapping = + ::mmap(nullptr, stat_buffer.st_size, flags, MAP_PRIVATE, handle.get(), 0); if (mapping == MAP_FAILED) { return; diff --git a/fml/platform/posix/native_library_posix.cc b/fml/platform/posix/native_library_posix.cc new file mode 100644 index 0000000000000..1255c38fc0821 --- /dev/null +++ b/fml/platform/posix/native_library_posix.cc @@ -0,0 +1,60 @@ +// Copyright 2018 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/native_library.h" + +#include +#include + +namespace fml { + +NativeLibrary::NativeLibrary(const char* path) { + ::dlerror(); + handle_ = ::dlopen(path, RTLD_NOW); + if (handle_ == nullptr) { + FXL_LOG(ERROR) << "Could not open library '" << path << "' due to error '" + << ::dlerror() << "'."; + } +} + +NativeLibrary::NativeLibrary(Handle handle, bool close_handle) + : handle_(handle), close_handle_(close_handle) {} + +NativeLibrary::~NativeLibrary() { + if (handle_ == nullptr) { + return; + } + + if (close_handle_) { + ::dlerror(); + if (::dlclose(handle_) != 0) { + handle_ = nullptr; + FXL_LOG(ERROR) << "Could not close library due to error '" << ::dlerror() + << "'."; + } + } +} + +NativeLibrary::Handle NativeLibrary::GetHandle() const { + return handle_; +} + +fxl::RefPtr NativeLibrary::Create(const char* path) { + auto library = fxl::AdoptRef(new NativeLibrary(path)); + return library->GetHandle() != nullptr ? library : nullptr; +} + +fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { + return fxl::AdoptRef(new NativeLibrary(RTLD_DEFAULT, false)); +} + +const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { + auto resolved_symbol = static_cast(::dlsym(handle_, symbol)); + if (resolved_symbol == nullptr) { + FXL_DLOG(ERROR) << "Could not resolve symbol in library: " << symbol; + } + return resolved_symbol; +} + +} // namespace fml diff --git a/fml/platform/win/file_win.cc b/fml/platform/win/file_win.cc new file mode 100644 index 0000000000000..3f5e90494b013 --- /dev/null +++ b/fml/platform/win/file_win.cc @@ -0,0 +1,119 @@ +// Copyright 2018 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/file.h" + +#include + +#include + +#include "flutter/fml/platform/win/wstring_conversion.h" + +namespace fml { + +fml::UniqueFD OpenFile(const std::wstring& path, + OpenPermission permission, + bool is_directory) { + if (path.size() == 0) { + return fml::UniqueFD{}; + } + + DWORD desired_access = 0; + + switch (permission) { + case OpenPermission::kRead: + desired_access = GENERIC_READ; + break; + case OpenPermission::kWrite: + desired_access = GENERIC_WRITE; + break; + case OpenPermission::kReadWrite: + desired_access = GENERIC_WRITE | GENERIC_READ; + break; + case OpenPermission::kExecute: + desired_access = GENERIC_READ | GENERIC_EXECUTE; + break; + } + + return fml::UniqueFD{::CreateFile( + path.c_str(), // lpFileName + desired_access, // dwDesiredAccess + FILE_SHARE_READ, // dwShareMode + 0, // lpSecurityAttributes + OPEN_EXISTING, // dwCreationDisposition + FILE_ATTRIBUTE_NORMAL, // dwFlagsAndAttributes + 0 // hTemplateFile + )}; +} + +fml::UniqueFD OpenFile(const char* path, + OpenPermission permission, + bool is_directory) { + return OpenFile(ConvertToWString(path), permission, is_directory); +} + +static std::wstring GetFullHandlePath(const fml::UniqueFD& handle) { + wchar_t buffer[MAX_PATH]; + + DWORD returned = ::GetFinalPathNameByHandle(handle.get(), buffer, MAX_PATH, + FILE_NAME_NORMALIZED); + if (returned == 0 || returned > MAX_PATH) { + return {}; + } + + return {buffer}; +} + +fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, + const char* path, + OpenPermission permission, + bool is_directory) { + // If the base directory is invalid or the path is absolute, use the generic + // open file variant. + if (!base_directory.is_valid()) { + return OpenFile(path, permission, is_directory); + } + + const auto wpath = ConvertToWString(path); + + if (!::PathIsRelative(wpath.c_str())) { + return OpenFile(path, permission, is_directory); + } + + std::wstringstream stream; + stream << GetFullHandlePath(base_directory) << "\\" << path; + return OpenFile(stream.str(), permission, is_directory); +} + +fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { + if (descriptor == INVALID_HANDLE_VALUE) { + return fml::UniqueFD{}; + } + + HANDLE duplicated = INVALID_HANDLE_VALUE; + + if (!::DuplicateHandle( + GetCurrentProcess(), // source process + descriptor, // source handle + GetCurrentProcess(), // target process + &duplicated, // target handle + 0, // desired access (ignored because DUPLICATE_SAME_ACCESS) + FALSE, // inheritable + DUPLICATE_SAME_ACCESS) // options + ) { + return fml::UniqueFD{}; + } + + return fml::UniqueFD{duplicated}; +} + +bool IsDirectory(const fml::UniqueFD& directory) { + BY_HANDLE_FILE_INFORMATION info; + if (!::GetFileInformationByHandle(directory.get(), &info)) { + return false; + } + return info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; +} + +} // namespace fml diff --git a/fml/platform/win/mapping_win.cc b/fml/platform/win/mapping_win.cc index fd404a14f37dc..9dd5dcf6f2249 100644 --- a/fml/platform/win/mapping_win.cc +++ b/fml/platform/win/mapping_win.cc @@ -5,13 +5,13 @@ #include "flutter/fml/mapping.h" #include +#include +#include #include -#include "lib/fxl/build_config.h" - -#include -#include +#include "flutter/fml/file.h" +#include "flutter/fml/platform/win/wstring_conversion.h" using PlatformResourceMapping = fml::FileMapping; @@ -29,47 +29,50 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { return std::make_unique(resource_name); } -FileMapping::FileMapping(const std::string& path) - : size_(0), mapping_(nullptr) { - HANDLE file_handle_ = - CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, - FILE_SHARE_READ, nullptr, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); +FileMapping::FileMapping(const std::string& path, bool executable) + : FileMapping(OpenFile(path.c_str(), + executable ? OpenPermission::kExecute + : OpenPermission::kRead, + false), + executable) {} - if (file_handle_ == INVALID_HANDLE_VALUE) { +FileMapping::FileMapping(const fml::UniqueFD& fd, bool executable) + : size_(0), mapping_(nullptr) { + if (!fd.is_valid()) { return; } - size_ = GetFileSize(file_handle_, nullptr); - if (size_ == INVALID_FILE_SIZE) { - size_ = 0; - return; + if (auto size = ::GetFileSize(fd.get(), nullptr)) { + if (size > 0) { + size_ = size; + } else { + return; + } } - mapping_handle_ = CreateFileMapping(file_handle_, nullptr, PAGE_READONLY, 0, - size_, nullptr); + const DWORD protect = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; - CloseHandle(file_handle_); + mapping_handle_.reset(::CreateFileMapping(fd.get(), // hFile + nullptr, // lpAttributes + protect, // flProtect + 0, // dwMaximumSizeHigh + 0, // dwMaximumSizeLow + nullptr // lpName + )); - if (mapping_handle_ == INVALID_HANDLE_VALUE) { + if (!mapping_handle_.is_valid()) { return; } - auto mapping = MapViewOfFile(mapping_handle_, FILE_MAP_READ, 0, 0, size_); - - if (mapping == INVALID_HANDLE_VALUE) { - CloseHandle(mapping_handle_); - mapping_handle_ = INVALID_HANDLE_VALUE; - return; - } + const DWORD desired_access = executable ? FILE_MAP_ALL_ACCESS : FILE_MAP_READ; - mapping_ = static_cast(mapping); + mapping_ = reinterpret_cast( + MapViewOfFile(mapping_handle_.get(), desired_access, 0, 0, size_)); } FileMapping::~FileMapping() { if (mapping_ != nullptr) { UnmapViewOfFile(mapping_); - CloseHandle(mapping_handle_); } } diff --git a/fml/platform/win/native_library_win.cc b/fml/platform/win/native_library_win.cc new file mode 100644 index 0000000000000..6992f06f3e886 --- /dev/null +++ b/fml/platform/win/native_library_win.cc @@ -0,0 +1,51 @@ +// Copyright 2018 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/native_library.h" + +#include + +#include "flutter/fml/platform/win/wstring_conversion.h" + +namespace fml { + +NativeLibrary::NativeLibrary(const char* path) + : handle_(nullptr), close_handle_(true) { + if (path == nullptr) { + return; + } + + handle_ = ::LoadLibrary(ConvertToWString(path).c_str()); +} + +NativeLibrary::NativeLibrary(Handle handle, bool close_handle) + : handle_(handle), close_handle_(close_handle) {} + +NativeLibrary::~NativeLibrary() { + if (handle_ != nullptr && close_handle_) { + ::FreeLibrary(handle_); + } +} + +NativeLibrary::Handle NativeLibrary::GetHandle() const { + return handle_; +} + +fxl::RefPtr NativeLibrary::Create(const char* path) { + auto library = fxl::AdoptRef(new NativeLibrary(path)); + return library->GetHandle() != nullptr ? library : nullptr; +} + +fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { + return fxl::AdoptRef(new NativeLibrary(::GetModuleHandle(nullptr), false)); +} + +const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { + if (symbol == nullptr || handle_ == nullptr) { + return nullptr; + } + return reinterpret_cast(::GetProcAddress(handle_, symbol)); +} + +} // namespace fml diff --git a/fml/platform/win/wstring_conversion.h b/fml/platform/win/wstring_conversion.h new file mode 100644 index 0000000000000..0682dd84067bf --- /dev/null +++ b/fml/platform/win/wstring_conversion.h @@ -0,0 +1,25 @@ +// Copyright 2018 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_WIN_WSTRING_CONVERSION_H_ +#define FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ + +#include +#include +#include + +namespace fml { + +inline std::wstring ConvertToWString(const char* path) { + if (path == nullptr) { + return {}; + } + std::string path8(path); + std::wstring_convert, wchar_t> wchar_conv; + return wchar_conv.from_bytes(path8); +} + +} // namespace fml + +#endif // FLUTTER_FML_PLATFORM_WIN_WSTRING_CONVERSION_H_ diff --git a/fml/task_observer.h b/fml/task_observer.h deleted file mode 100644 index 21697cf022005..0000000000000 --- a/fml/task_observer.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_FML_TASK_OBSERVER_H_ -#define FLUTTER_FML_TASK_OBSERVER_H_ - -#include "lib/fxl/macros.h" - -namespace fml { - -class TaskObserver { - public: - virtual ~TaskObserver() = default; - - virtual void DidProcessTask() = 0; -}; - -} // namespace fml - -#endif // FLUTTER_FML_TASK_OBSERVER_H_ diff --git a/fml/task_runner.cc b/fml/task_runner.cc index 3d13674d78c11..95f91de8e9124 100644 --- a/fml/task_runner.cc +++ b/fml/task_runner.cc @@ -2,6 +2,8 @@ // 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/task_runner.h" #include @@ -38,4 +40,14 @@ bool TaskRunner::RunsTasksOnCurrentThread() { return MessageLoop::GetCurrent().GetLoopImpl() == loop_; } +void TaskRunner::RunNowOrPostTask(fxl::RefPtr runner, + fxl::Closure task) { + FXL_DCHECK(runner); + if (runner->RunsTasksOnCurrentThread()) { + task(); + } else { + runner->PostTask(std::move(task)); + } +} + } // namespace fml diff --git a/fml/task_runner.h b/fml/task_runner.h index 20ea85e4e521b..3b3d2de01639d 100644 --- a/fml/task_runner.h +++ b/fml/task_runner.h @@ -13,7 +13,7 @@ namespace fml { class MessageLoopImpl; -class TaskRunner : public fxl::TaskRunner { +class TaskRunner final : public fxl::TaskRunner { public: void PostTask(fxl::Closure task) override; @@ -23,12 +23,15 @@ class TaskRunner : public fxl::TaskRunner { bool RunsTasksOnCurrentThread() override; + static void RunNowOrPostTask(fxl::RefPtr runner, + fxl::Closure task); + private: fxl::RefPtr loop_; TaskRunner(fxl::RefPtr loop); - ~TaskRunner(); + ~TaskRunner() override; FRIEND_MAKE_REF_COUNTED(TaskRunner); FRIEND_REF_COUNTED_THREAD_SAFE(TaskRunner); diff --git a/fml/thread.cc b/fml/thread.cc index a1500bfef46a4..de4ee6dd368a8 100644 --- a/fml/thread.cc +++ b/fml/thread.cc @@ -2,6 +2,8 @@ // 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/thread.h" #include "lib/fxl/build_config.h" @@ -22,7 +24,7 @@ namespace fml { Thread::Thread(const std::string& name) : joined_(false) { fxl::AutoResetWaitableEvent latch; - fxl::RefPtr runner; + fxl::RefPtr runner; thread_ = std::make_unique([&latch, &runner, name]() -> void { SetCurrentThreadName(name); fml::MessageLoop::EnsureInitializedForCurrentThread(); @@ -39,7 +41,7 @@ Thread::~Thread() { Join(); } -fxl::RefPtr Thread::GetTaskRunner() const { +fxl::RefPtr Thread::GetTaskRunner() const { return task_runner_; } @@ -84,7 +86,8 @@ void Thread::SetCurrentThreadName(const std::string& name) { } __except (EXCEPTION_CONTINUE_EXECUTION) { } #else -#error Unsupported Platform + FXL_DLOG(INFO) << "Could not set the thread name to '" << name + << "' on this platform."; #endif } diff --git a/fml/thread.h b/fml/thread.h index 44062f1032116..542871f788845 100644 --- a/fml/thread.h +++ b/fml/thread.h @@ -9,8 +9,8 @@ #include #include +#include "flutter/fml/task_runner.h" #include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" namespace fml { @@ -20,13 +20,13 @@ class Thread { ~Thread(); - fxl::RefPtr GetTaskRunner() const; + fxl::RefPtr GetTaskRunner() const; void Join(); private: std::unique_ptr thread_; - fxl::RefPtr task_runner_; + fxl::RefPtr task_runner_; std::atomic_bool joined_; static void SetCurrentThreadName(const std::string& name); diff --git a/fml/unique_fd.cc b/fml/unique_fd.cc new file mode 100644 index 0000000000000..bab79f7a9b743 --- /dev/null +++ b/fml/unique_fd.cc @@ -0,0 +1,35 @@ +// Copyright 2018 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/unique_fd.h" + +#include "lib/fxl/files/eintr_wrapper.h" + +namespace fml { +namespace internal { + +#if OS_WIN + +namespace win { + +void UniqueFDTraits::Free(HANDLE fd) { + CloseHandle(fd); +} + +} // namespace win + +#else // OS_WIN + +namespace unix { + +void UniqueFDTraits::Free(int fd) { + IGNORE_EINTR(fd); +} + +} // namespace unix + +#endif // OS_WIN + +} // namespace internal +} // namespace fml diff --git a/fml/unique_fd.h b/fml/unique_fd.h new file mode 100644 index 0000000000000..9f2d796579d8c --- /dev/null +++ b/fml/unique_fd.h @@ -0,0 +1,60 @@ +// Copyright 2018 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_UNIQUE_FD_H_ +#define FLUTTER_FML_UNIQUE_FD_H_ + +#include "flutter/fml/unique_object.h" +#include "lib/fxl/build_config.h" + +#if OS_WIN + +#include + +#endif // OS_WIN + +namespace fml { +namespace internal { + +#if OS_WIN + +namespace win { + +struct UniqueFDTraits { + static HANDLE InvalidValue() { return INVALID_HANDLE_VALUE; } + static bool IsValid(HANDLE value) { return value != InvalidValue(); } + static void Free(HANDLE fd); +}; + +} // namespace win + +#else // OS_WIN + +namespace unix { + +struct UniqueFDTraits { + static int InvalidValue() { return -1; } + static bool IsValid(int value) { return value >= 0; } + static void Free(int fd); +}; + +} // namespace unix + +#endif // OS_WIN + +} // namespace internal + +#if OS_WIN + +using UniqueFD = UniqueObject; + +#else // OS_WIN + +using UniqueFD = UniqueObject; + +#endif // OS_WIN + +} // namespace fml + +#endif // FLUTTER_FML_UNIQUE_FD_H_ diff --git a/fml/unique_object.h b/fml/unique_object.h new file mode 100644 index 0000000000000..e2487a53881a9 --- /dev/null +++ b/fml/unique_object.h @@ -0,0 +1,137 @@ +// Copyright 2018 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_UNIQUE_OBJECT_H_ +#define FLUTTER_FML_UNIQUE_OBJECT_H_ + +#include + +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/macros.h" + +namespace fml { + +// struct UniqueFooTraits { +// // This function should be fast an inline. +// static int InvalidValue() { return 0; } +// +// // This function should be fast an inline. +// static bool IsValid(const T& value) { return value != InvalidValue(); } +// +// // This free function will not be called if f == InvalidValue()! +// static void Free(int f) { ::FreeFoo(f); } +// }; + +template +class UniqueObject { + private: + // This must be first since it's used inline below. + // + // Use the empty base class optimization to allow us to have a Traits + // member, while avoiding any space overhead for it when Traits is an + // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good + // discussion of this technique. + struct Data : public Traits { + explicit Data(const T& in) : generic(in) {} + Data(const T& in, const Traits& other) : Traits(other), generic(in) {} + + T generic; + }; + + public: + using element_type = T; + using traits_type = Traits; + + UniqueObject() : data_(Traits::InvalidValue()) {} + explicit UniqueObject(const T& value) : data_(value) {} + + UniqueObject(const T& value, const Traits& traits) : data_(value, traits) {} + + UniqueObject(UniqueObject&& other) + : data_(other.release(), other.get_traits()) {} + + ~UniqueObject() { FreeIfNecessary(); } + + UniqueObject& operator=(UniqueObject&& other) { + reset(other.release()); + return *this; + } + + void reset(const T& value = Traits::InvalidValue()) { + FXL_CHECK(data_.generic == Traits::InvalidValue() || + data_.generic != value); + FreeIfNecessary(); + data_.generic = value; + } + + void swap(UniqueObject& other) { + // Standard swap idiom: 'using std::swap' ensures that std::swap is + // present in the overload set, but we call swap unqualified so that + // any more-specific overloads can be used, if available. + using std::swap; + swap(static_cast(data_), static_cast(other.data_)); + swap(data_.generic, other.data_.generic); + } + + // Release the object. The return value is the current object held by this + // object. After this operation, this object will hold an invalid value, and + // will not own the object any more. + T release() FXL_WARN_UNUSED_RESULT { + T old_generic = data_.generic; + data_.generic = Traits::InvalidValue(); + return old_generic; + } + + const T& get() const { return data_.generic; } + + bool is_valid() const { return Traits::IsValid(data_.generic); } + + bool operator==(const T& value) const { return data_.generic == value; } + + bool operator!=(const T& value) const { return data_.generic != value; } + + Traits& get_traits() { return data_; } + const Traits& get_traits() const { return data_; } + + private: + void FreeIfNecessary() { + if (data_.generic != Traits::InvalidValue()) { + data_.Free(data_.generic); + data_.generic = Traits::InvalidValue(); + } + } + + // Forbid comparison. If U != T, it totally doesn't make sense, and if U == + // T, it still doesn't make sense because you should never have the same + // object owned by two different UniqueObject. + template + bool operator==(const UniqueObject& p2) const = delete; + + template + bool operator!=(const UniqueObject& p2) const = delete; + + Data data_; + + FXL_DISALLOW_COPY_AND_ASSIGN(UniqueObject); +}; + +template +void swap(const UniqueObject& a, const UniqueObject& b) { + a.swap(b); +} + +template +bool operator==(const T& value, const UniqueObject& object) { + return value == object.get(); +} + +template +bool operator!=(const T& value, const UniqueObject& object) { + return !(value == object.get()); +} + +} // namespace fml + +#endif // FLUTTER_FML_UNIQUE_OBJECT_H_ diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 2b53ffc4d4f6d..8c568f4773c90 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -29,20 +29,40 @@ if (is_fuchsia) { # The sole purpose of this target is to generate a .packages file. sources = [] - infer_package_name = true + dot_packages_file = "$target_gen_dir/snapshot.packages" + outputs = [ + dot_packages_file, + ] + deps = [] + foreach(dep, dart_deps) { + deps += [ "$dep($dart_toolchain)" ] + } disable_analysis = true - deps = [ - "//topaz/public/dart/fuchsia", - "//topaz/public/dart/zircon", - ] + script = "//build/dart/gen_dot_packages.py" + args = [ + "--out", + rebase_path(dot_packages_file, root_build_dir), + "--source-dir", + rebase_path("."), + "--root-build-dir", + rebase_path(root_build_dir), + "--root-gen-dir", + rebase_path(dart_root_gen_dir), + "--package-name", + "snapshot_root", + "--depfile", + rebase_path(depfile), + "--deps", + ] + dart_deps } } action("generate_snapshot_bin") { if (is_fuchsia) { snapshot_dart = "snapshot_fuchsia.dart" + # TODO(rmacnak): Fuchsia cross builds use the wrong Dart target # architecture, and have added steps that depend on this error for # reasonable build times (e.g., invoking the analyzer). @@ -85,9 +105,9 @@ action("generate_snapshot_bin") { rebased_dart_ui_path = rebase_path(dart_ui_path) - gen_snapshot_dir = - get_label_info("//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", - "root_out_dir") + gen_snapshot_dir = get_label_info( + "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", + "root_out_dir") script = "//third_party/dart/runtime/tools/create_snapshot_bin.py" args = [ @@ -209,7 +229,7 @@ bin_to_assembly("isolate_snapshot_data_assembly") { ] input = "$target_gen_dir/isolate_snapshot.bin" output = "$target_gen_dir/isolate_snapshot_data.S" - symbol = "kDartIsolateCoreSnapshotData" + symbol = "kDartIsolateSnapshotData" executable = false } @@ -219,7 +239,7 @@ bin_to_assembly("isolate_snapshot_instructions_assembly") { ] input = "$target_gen_dir/isolate_snapshot_instructions.bin" output = "$target_gen_dir/isolate_snapshot_instructions.S" - symbol = "kDartIsolateCoreSnapshotInstructions" + symbol = "kDartIsolateSnapshotInstructions" executable = true } @@ -249,9 +269,9 @@ compile_platform("non_strong_platform") { ] args = [ - "--target=flutter", - "dart:core", - ] + "--target=flutter", + "dart:core", + ] } compile_platform("strong_platform") { @@ -265,10 +285,10 @@ compile_platform("strong_platform") { ] args = [ - "--target=flutter", - "--strong", - "dart:core" - ] + "--target=flutter", + "--strong", + "dart:core", + ] } group("kernel_platform_files") { diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 8b3be72d5973b..6a75cd22c8614 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -40,14 +40,10 @@ source_set("ui") { "painting/picture.h", "painting/picture_recorder.cc", "painting/picture_recorder.h", - "painting/resource_context.cc", - "painting/resource_context.h", "painting/rrect.cc", "painting/rrect.h", "painting/shader.cc", "painting/shader.h", - "painting/utils.cc", - "painting/utils.h", "painting/vertices.cc", "painting/vertices.h", "semantics/semantics_node.cc", @@ -87,19 +83,18 @@ source_set("ui") { "window/window.h", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] deps = [ - "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", + "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/runtime:test_font", "$flutter_root/sky/engine", "$flutter_root/third_party/txt", + "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", diff --git a/lib/ui/compositing/scene_builder.cc b/lib/ui/compositing/scene_builder.cc index 006826abbfdf6..60b911cb4ddec 100644 --- a/lib/ui/compositing/scene_builder.cc +++ b/lib/ui/compositing/scene_builder.cc @@ -120,10 +120,11 @@ void SceneBuilder::addPicture(double dx, double dy, Picture* picture, int hints) { - layer_builder_->PushPicture(SkPoint::Make(dx, dy), // - picture->picture(), // - !!(hints & 1), // picture is complex - !!(hints & 2) // picture will change + layer_builder_->PushPicture( + SkPoint::Make(dx, dy), // + UIDartState::CreateGPUObject(picture->picture()), // + !!(hints & 1), // picture is complex + !!(hints & 2) // picture will change ); } diff --git a/lib/ui/compositing/scene_host.cc b/lib/ui/compositing/scene_host.cc index c0e4c5332580a..f5e0cfb3547d8 100644 --- a/lib/ui/compositing/scene_host.cc +++ b/lib/ui/compositing/scene_host.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/compositing/scene_host.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" @@ -37,8 +38,9 @@ fxl::RefPtr SceneHost::create( } SceneHost::SceneHost(fxl::RefPtr export_token_handle) { - export_node_holder_ = - fxl::MakeRefCounted(export_token_handle); + export_node_holder_ = fxl::MakeRefCounted( + blink::UIDartState::Current()->GetTaskRunners().GetGPUTaskRunner(), + export_token_handle); } #else fxl::RefPtr SceneHost::create(Dart_Handle export_token_handle) { diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index edd51245b05db..32a244c9cb67d 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -8,7 +8,11 @@ #include #include +#include +#include + #include "flutter/common/settings.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/tonic/converter/dart_converter.h" @@ -141,17 +145,43 @@ void DartRuntimeHooks::Install(IsolateType isolate_type, // Implementation of native functions which are used for some // test/debug functionality in standalone dart mode. void Logger_PrintString(Dart_NativeArguments args) { - intptr_t length = 0; - uint8_t* chars = nullptr; - Dart_Handle str = Dart_GetNativeArgument(args, 0); - Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); - if (Dart_IsError(result)) { - Dart_PropagateError(result); - } else { + std::stringstream stream; + const auto& logger_prefix = UIDartState::Current()->logger_prefix(); + +#if !OS(ANDROID) + // Prepend all logs with the isolate debug name except on Android where that + // prefix is specified in the log tag. + if (logger_prefix.size() > 0) { + stream << logger_prefix << ": "; + } +#endif // !OS(ANDROID) + + // Append the log buffer obtained from Dart code. + { + Dart_Handle str = Dart_GetNativeArgument(args, 0); + uint8_t* chars = nullptr; + intptr_t length = 0; + Dart_Handle result = Dart_StringToUTF8(str, &chars, &length); + if (Dart_IsError(result)) { + Dart_PropagateError(result); + return; + } + if (length > 0) { + stream << std::string{reinterpret_cast(chars), + static_cast(length)}; + } + } + + const auto log_string = stream.str(); + const char* chars = log_string.c_str(); + const size_t length = log_string.size(); + + // Log using platform specific mechanisms + { #if defined(OS_ANDROID) // Write to the logcat on Android. - const char* tag = Settings::Get().log_tag.c_str(); - __android_log_print(ANDROID_LOG_INFO, tag, "%.*s", (int)length, chars); + __android_log_print(ANDROID_LOG_INFO, logger_prefix.c_str(), "%.*s", + (int)length, chars); #elif defined(OS_IOS) // Write to syslog on iOS. // @@ -159,26 +189,22 @@ void Logger_PrintString(Dart_NativeArguments args) { // iOS logging APIs altogether. syslog(1 /* LOG_ALERT */, "%.*s", (int)length, chars); #else - // On Fuchsia and in flutter_tester (on both macOS and Linux), write - // directly to stdout. - fwrite(chars, 1, length, stdout); - fputs("\n", stdout); - fflush(stdout); + std::cout << log_string << std::endl; #endif } + if (dart::bin::ShouldCaptureStdout()) { // For now we report print output on the Stdout stream. uint8_t newline[] = {'\n'}; - Dart_ServiceSendDataEvent("Stdout", "WriteEvent", chars, length); + Dart_ServiceSendDataEvent("Stdout", "WriteEvent", + reinterpret_cast(chars), length); Dart_ServiceSendDataEvent("Stdout", "WriteEvent", newline, sizeof(newline)); } } void ScheduleMicrotask(Dart_NativeArguments args) { Dart_Handle closure = Dart_GetNativeArgument(args, 0); - if (LogIfError(closure) || !Dart_IsClosure(closure)) - return; - tonic::DartMicrotaskQueue::GetForCurrentThread()->ScheduleMicrotask(closure); + UIDartState::Current()->ScheduleMicrotask(closure); } } // namespace blink diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 3e47ba86d50a5..758a722b409e2 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -4,11 +4,11 @@ #include "flutter/lib/ui/painting/codec.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/frame_info.h" -#include "flutter/lib/ui/painting/resource_context.h" #include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/logging.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" #include "lib/tonic/dart_state.h" @@ -17,6 +17,10 @@ #include "third_party/skia/include/codec/SkCodec.h" #include "third_party/skia/include/core/SkPixelRef.h" +#ifdef ERROR +#undef ERROR +#endif + using tonic::DartInvoke; using tonic::DartPersistentValue; using tonic::ToDart; @@ -28,9 +32,9 @@ namespace { static constexpr const char* kInitCodecTraceTag = "InitCodec"; static constexpr const char* kCodecNextFrameTraceTag = "CodecNextFrame"; -void InvokeCodecCallback(fxl::RefPtr codec, - std::unique_ptr callback, - size_t trace_id) { +static void InvokeCodecCallback(fxl::RefPtr codec, + std::unique_ptr callback, + size_t trace_id) { tonic::DartState* dart_state = callback->dart_state().get(); if (!dart_state) { TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); @@ -45,7 +49,9 @@ void InvokeCodecCallback(fxl::RefPtr codec, TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); } -sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { +static sk_sp DecodeImage(fml::WeakPtr context, + sk_sp buffer, + size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("flutter", "DecodeImage"); @@ -53,13 +59,11 @@ sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { return nullptr; } - std::unique_ptr resourceContext = ResourceContext::Acquire(); - GrContext* context = resourceContext->Get(); if (context) { // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromEncoded(context, std::move(buffer), - false, dstColorSpace.get()); + return SkImage::MakeCrossContextFromEncoded( + context.get(), std::move(buffer), false, dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -68,7 +72,10 @@ sk_sp DecodeImage(sk_sp buffer, size_t trace_id) { } } -fxl::RefPtr InitCodec(sk_sp buffer, size_t trace_id) { +fxl::RefPtr InitCodec(fml::WeakPtr context, + sk_sp buffer, + fxl::RefPtr unref_queue, + size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); TRACE_EVENT0("blink", "InitCodec"); @@ -86,27 +93,31 @@ fxl::RefPtr InitCodec(sk_sp buffer, size_t trace_id) { if (skCodec->getFrameCount() > 1) { return fxl::MakeRefCounted(std::move(skCodec)); } - auto skImage = DecodeImage(buffer, trace_id); + auto skImage = DecodeImage(context, buffer, trace_id); if (!skImage) { FXL_LOG(ERROR) << "DecodeImage failed"; return nullptr; } auto image = CanvasImage::Create(); - image->set_image(skImage); + image->set_image({skImage, unref_queue}); auto frameInfo = fxl::MakeRefCounted(std::move(image), 0); return fxl::MakeRefCounted(std::move(frameInfo)); } void InitCodecAndInvokeCodecCallback( + fxl::RefPtr ui_task_runner, + fml::WeakPtr context, + fxl::RefPtr unref_queue, std::unique_ptr callback, sk_sp buffer, size_t trace_id) { - auto codec = InitCodec(std::move(buffer), trace_id); - Threads::UI()->PostTask(fxl::MakeCopyable([ - callback = std::move(callback), codec = std::move(codec), trace_id - ]() mutable { - InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); - })); + auto codec = + InitCodec(context, std::move(buffer), std::move(unref_queue), trace_id); + ui_task_runner->PostTask( + fxl::MakeCopyable([callback = std::move(callback), + codec = std::move(codec), trace_id]() mutable { + InvokeCodecCallback(std::move(codec), std::move(callback), trace_id); + })); } void InstantiateImageCodec(Dart_NativeArguments args) { @@ -133,14 +144,20 @@ void InstantiateImageCodec(Dart_NativeArguments args) { auto buffer = SkData::MakeWithCopy(list.data(), list.num_elements()); - Threads::IO()->PostTask(fxl::MakeCopyable([ - callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - buffer = std::move(buffer), trace_id - ]() mutable { - InitCodecAndInvokeCodecCallback(std::move(callback), std::move(buffer), - trace_id); - })); + auto dart_state = UIDartState::Current(); + + const auto& task_runners = dart_state->GetTaskRunners(); + task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( + [callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + buffer = std::move(buffer), trace_id, + ui_task_runner = task_runners.GetUITaskRunner(), + context = dart_state->GetResourceContext(), + queue = UIDartState::Current()->GetSkiaUnrefQueue()]() mutable { + InitCodecAndInvokeCodecCallback(std::move(ui_task_runner), context, + std::move(queue), std::move(callback), + std::move(buffer), trace_id); + })); } bool copy_to(SkBitmap* dst, SkColorType dstColorType, const SkBitmap& src) { @@ -213,7 +230,8 @@ MultiFrameCodec::MultiFrameCodec(std::unique_ptr codec) nextFrameIndex_ = 0; } -sk_sp MultiFrameCodec::GetNextFrameImage() { +sk_sp MultiFrameCodec::GetNextFrameImage( + fml::WeakPtr resourceContext) { SkBitmap& bitmap = frameBitmaps_[nextFrameIndex_]; if (!bitmap.getPixels()) { // We haven't decoded this frame yet const SkImageInfo info = codec_->getInfo().makeColorType(kN32_SkColorType); @@ -245,15 +263,13 @@ sk_sp MultiFrameCodec::GetNextFrameImage() { } } - std::unique_ptr resourceContext = ResourceContext::Acquire(); - GrContext* context = resourceContext->Get(); - if (context) { + if (resourceContext) { SkPixmap pixmap(bitmap.info(), bitmap.pixelRef()->pixels(), bitmap.pixelRef()->rowBytes()); // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; - return SkImage::MakeCrossContextFromPixmap(context, pixmap, false, - dstColorSpace.get()); + return SkImage::MakeCrossContextFromPixmap(resourceContext.get(), pixmap, + false, dstColorSpace.get()); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background @@ -264,19 +280,22 @@ sk_sp MultiFrameCodec::GetNextFrameImage() { void MultiFrameCodec::GetNextFrameAndInvokeCallback( std::unique_ptr callback, + fxl::RefPtr ui_task_runner, + fml::WeakPtr resourceContext, + fxl::RefPtr unref_queue, size_t trace_id) { fxl::RefPtr frameInfo = NULL; - sk_sp skImage = GetNextFrameImage(); + sk_sp skImage = GetNextFrameImage(resourceContext); if (skImage) { fxl::RefPtr image = CanvasImage::Create(); - image->set_image(skImage); + image->set_image({skImage, std::move(unref_queue)}); frameInfo = fxl::MakeRefCounted( std::move(image), frameInfos_[nextFrameIndex_].fDuration); } nextFrameIndex_ = (nextFrameIndex_ + 1) % frameInfos_.size(); - Threads::UI()->PostTask(fxl::MakeCopyable( - [ callback = std::move(callback), frameInfo, trace_id ]() mutable { + ui_task_runner->PostTask(fxl::MakeCopyable( + [callback = std::move(callback), frameInfo, trace_id]() mutable { InvokeNextFrameCallback(frameInfo, std::move(callback), trace_id); })); @@ -293,13 +312,20 @@ Dart_Handle MultiFrameCodec::getNextFrame(Dart_Handle callback_handle) { return ToDart("Callback must be a function"); } - Threads::IO()->PostTask(fxl::MakeCopyable([ - callback = std::make_unique( - tonic::DartState::Current(), callback_handle), - this, trace_id - ]() mutable { - GetNextFrameAndInvokeCallback(std::move(callback), trace_id); - })); + auto dart_state = UIDartState::Current(); + + const auto& task_runners = dart_state->GetTaskRunners(); + + task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( + [callback = std::make_unique( + tonic::DartState::Current(), callback_handle), + this, trace_id, ui_task_runner = task_runners.GetUITaskRunner(), + queue = UIDartState::Current()->GetSkiaUnrefQueue(), + context = dart_state->GetResourceContext()]() mutable { + GetNextFrameAndInvokeCallback(std::move(callback), + std::move(ui_task_runner), context, + std::move(queue), trace_id); + })); return Dart_Null(); } diff --git a/lib/ui/painting/codec.h b/lib/ui/painting/codec.h index 98e5bc56df375..9fdce1a8c1a33 100644 --- a/lib/ui/painting/codec.h +++ b/lib/ui/painting/codec.h @@ -43,11 +43,16 @@ class MultiFrameCodec : public Codec { private: MultiFrameCodec(std::unique_ptr codec); + ~MultiFrameCodec() {} - sk_sp GetNextFrameImage(); + sk_sp GetNextFrameImage(fml::WeakPtr resourceContext); + void GetNextFrameAndInvokeCallback( std::unique_ptr callback, + fxl::RefPtr ui_task_runner, + fml::WeakPtr resourceContext, + fxl::RefPtr unref_queue, size_t trace_id); const std::unique_ptr codec_; diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index f6bb864627740..52ccd63f3f5d3 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -48,10 +48,10 @@ void CanvasGradient::initLinear(const tonic::Float32List& end_points, static_assert(sizeof(SkColor) == sizeof(int32_t), "SkColor doesn't use int32_t."); - set_shader(SkGradientShader::MakeLinear( + set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeLinear( reinterpret_cast(end_points.data()), reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode)); + colors.num_elements(), tile_mode))); } void CanvasGradient::initRadial(double center_x, @@ -73,14 +73,14 @@ void CanvasGradient::initRadial(double center_x, sk_matrix = ToSkMatrix(matrix4); } - set_shader(SkGradientShader::MakeRadial( + set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeRadial( SkPoint::Make(center_x, center_y), radius, reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr)); + colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr))); } -CanvasGradient::CanvasGradient() : Shader(nullptr) {} +CanvasGradient::CanvasGradient() = default; -CanvasGradient::~CanvasGradient() {} +CanvasGradient::~CanvasGradient() = default; } // namespace blink diff --git a/lib/ui/painting/image.cc b/lib/ui/painting/image.cc index 42e733241c990..a1b9b45cdc863 100644 --- a/lib/ui/painting/image.cc +++ b/lib/ui/painting/image.cc @@ -4,9 +4,7 @@ #include "flutter/lib/ui/painting/image.h" -#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/image_encoding.h" -#include "flutter/lib/ui/painting/utils.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -30,13 +28,9 @@ void CanvasImage::RegisterNatives(tonic::DartLibraryNatives* natives) { natives->Register({FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } -CanvasImage::CanvasImage() {} +CanvasImage::CanvasImage() = default; -CanvasImage::~CanvasImage() { - // Skia objects must be deleted on the IO thread so that any associated GL - // objects will be cleaned up through the IO thread's GL context. - SkiaUnrefOnIOThread(&image_); -} +CanvasImage::~CanvasImage() = default; Dart_Handle CanvasImage::toByteData(int format, int quality, @@ -49,8 +43,8 @@ void CanvasImage::dispose() { } size_t CanvasImage::GetAllocationSize() { - if (image_) { - return image_->width() * image_->height() * 4; + if (auto image = image_.get()) { + return image->width() * image->height() * 4; } else { return sizeof(CanvasImage); } diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index a7ed4298506f5..aeec2a0149c73 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -5,6 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_H_ #define FLUTTER_LIB_UI_PAINTING_IMAGE_H_ +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkImage.h" @@ -25,13 +27,18 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, return fxl::MakeRefCounted(); } - int width() { return image_->width(); } - int height() { return image_->height(); } + int width() { return image_.get()->width(); } + + int height() { return image_.get()->height(); } + Dart_Handle toByteData(int format, int quality, Dart_Handle callback); + void dispose(); - const sk_sp& image() const { return image_; } - void set_image(sk_sp image) { image_ = std::move(image); } + sk_sp image() const { return image_.get(); } + void set_image(flow::SkiaGPUObject image) { + image_ = std::move(image); + } virtual size_t GetAllocationSize() override; @@ -40,7 +47,7 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, private: CanvasImage(); - sk_sp image_; + flow::SkiaGPUObject image_; }; } // namespace blink diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index f356e955f6745..f010fce893d3e 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -4,13 +4,15 @@ #include "flutter/lib/ui/painting/image_encoding.h" -#include "flutter/common/threads.h" +#include +#include + +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/painting/image.h" -#include "flutter/lib/ui/painting/resource_context.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_persistent_value.h" -#include "lib/tonic/dart_state.h" #include "lib/tonic/logging/dart_invoke.h" #include "lib/tonic/typed_data/uint8_list.h" #include "third_party/skia/include/core/SkEncodedImageFormat.h" @@ -52,10 +54,11 @@ void EncodeImageAndInvokeDataCallback( std::unique_ptr callback, sk_sp image, SkEncodedImageFormat format, - int quality) { + int quality, + fxl::RefPtr ui_task_runner) { sk_sp encoded = EncodeImage(std::move(image), format, quality); - Threads::UI()->PostTask( + ui_task_runner->PostTask( fxl::MakeCopyable([callback = std::move(callback), encoded]() mutable { InvokeDataCallback(std::move(callback), std::move(encoded)); })); @@ -101,10 +104,14 @@ Dart_Handle EncodeImage(CanvasImage* canvas_image, tonic::DartState::Current(), callback_handle); sk_sp image = canvas_image->image(); - Threads::IO()->PostTask(fxl::MakeCopyable( - [callback = std::move(callback), image, image_format, quality]() mutable { + const auto& task_runners = UIDartState::Current()->GetTaskRunners(); + + task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( + [callback = std::move(callback), image, image_format, quality, + ui_task_runner = task_runners.GetUITaskRunner()]() mutable { EncodeImageAndInvokeDataCallback(std::move(callback), std::move(image), - image_format, quality); + image_format, quality, + std::move(ui_task_runner)); })); return Dart_Null(); diff --git a/lib/ui/painting/image_shader.cc b/lib/ui/painting/image_shader.cc index 0fabd134c737c..a4ddbba0ea24b 100644 --- a/lib/ui/painting/image_shader.cc +++ b/lib/ui/painting/image_shader.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/painting/image_shader.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -37,15 +38,17 @@ void ImageShader::initWithImage(CanvasImage* image, SkShader::TileMode tmx, SkShader::TileMode tmy, const tonic::Float64List& matrix4) { - if (!image) + if (!image) { Dart_ThrowException( ToDart("ImageShader constructor called with non-genuine Image.")); + } SkMatrix sk_matrix = ToSkMatrix(matrix4); - set_shader(image->image()->makeShader(tmx, tmy, &sk_matrix)); + set_shader(UIDartState::CreateGPUObject( + image->image()->makeShader(tmx, tmy, &sk_matrix))); } -ImageShader::ImageShader() : Shader(nullptr) {} +ImageShader::ImageShader() = default; -ImageShader::~ImageShader() {} +ImageShader::~ImageShader() = default; } // namespace blink diff --git a/lib/ui/painting/picture.cc b/lib/ui/painting/picture.cc index 89ddbf5f41bb0..34f92b8c315fd 100644 --- a/lib/ui/painting/picture.cc +++ b/lib/ui/painting/picture.cc @@ -4,9 +4,8 @@ #include "flutter/lib/ui/painting/picture.h" -#include "flutter/common/threads.h" #include "flutter/lib/ui/painting/canvas.h" -#include "flutter/lib/ui/painting/utils.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" @@ -23,24 +22,20 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Picture); DART_BIND_ALL(Picture, FOR_EACH_BINDING) -fxl::RefPtr Picture::Create(sk_sp picture) { +fxl::RefPtr Picture::Create(flow::SkiaGPUObject picture) { return fxl::MakeRefCounted(std::move(picture)); } -Picture::Picture(sk_sp picture) : picture_(std::move(picture)) {} +Picture::Picture(flow::SkiaGPUObject picture) + : picture_(std::move(picture)) {} -Picture::~Picture() { - // Skia objects must be deleted on the IO thread so that any associated GL - // objects will be cleaned up through the IO thread's GL context. - SkiaUnrefOnIOThread(&picture_); -} +Picture::~Picture() = default; fxl::RefPtr Picture::toImage(int width, int height) { fxl::RefPtr image = CanvasImage::Create(); - // TODO(abarth): We should pass in an SkColorSpace at some point. - image->set_image(SkImage::MakeFromPicture( - picture_, SkISize::Make(width, height), nullptr, nullptr, - SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB())); + image->set_image(UIDartState::CreateGPUObject(SkImage::MakeFromPicture( + picture_.get(), SkISize::Make(width, height), nullptr, nullptr, + SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()))); return image; } @@ -49,8 +44,8 @@ void Picture::dispose() { } size_t Picture::GetAllocationSize() { - if (picture_) { - return picture_->approximateBytesUsed(); + if (auto picture = picture_.get()) { + return picture->approximateBytesUsed(); } else { return sizeof(Picture); } diff --git a/lib/ui/painting/picture.h b/lib/ui/painting/picture.h index 4a26d01c08374..d916086b02f02 100644 --- a/lib/ui/painting/picture.h +++ b/lib/ui/painting/picture.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_PAINTING_PICTURE_H_ #define FLUTTER_LIB_UI_PAINTING_PICTURE_H_ +#include "flutter/flow/skia_gpu_object.h" #include "flutter/lib/ui/painting/image.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkPicture.h" @@ -23,9 +24,9 @@ class Picture : public fxl::RefCountedThreadSafe, public: ~Picture() override; - static fxl::RefPtr Create(sk_sp picture); + static fxl::RefPtr Create(flow::SkiaGPUObject picture); - const sk_sp& picture() const { return picture_; } + sk_sp picture() const { return picture_.get(); } fxl::RefPtr toImage(int width, int height); @@ -36,9 +37,9 @@ class Picture : public fxl::RefCountedThreadSafe, static void RegisterNatives(tonic::DartLibraryNatives* natives); private: - explicit Picture(sk_sp picture); + explicit Picture(flow::SkiaGPUObject picture); - sk_sp picture_; + flow::SkiaGPUObject picture_; }; } // namespace blink diff --git a/lib/ui/painting/picture_recorder.cc b/lib/ui/painting/picture_recorder.cc index adc73c0043920..e870e400a7230 100644 --- a/lib/ui/painting/picture_recorder.cc +++ b/lib/ui/painting/picture_recorder.cc @@ -50,8 +50,9 @@ SkCanvas* PictureRecorder::BeginRecording(SkRect bounds) { fxl::RefPtr PictureRecorder::endRecording() { if (!isRecording()) return nullptr; - fxl::RefPtr picture = - Picture::Create(picture_recorder_.finishRecordingAsPicture()); + + fxl::RefPtr picture = Picture::Create(UIDartState::CreateGPUObject( + picture_recorder_.finishRecordingAsPicture())); canvas_->Clear(); canvas_->ClearDartWrapper(); canvas_ = nullptr; diff --git a/lib/ui/painting/resource_context.cc b/lib/ui/painting/resource_context.cc deleted file mode 100644 index 1b9f71548c15f..0000000000000 --- a/lib/ui/painting/resource_context.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/lib/ui/painting/resource_context.h" - -#include - -#include "lib/fxl/logging.h" - -namespace blink { -namespace { - -static GrContext* g_context = nullptr; -static std::mutex g_mutex; -static volatile bool g_freeze = false; - -} // namespace - -ResourceContext::ResourceContext() { - g_mutex.lock(); -} - -ResourceContext::~ResourceContext() { - g_mutex.unlock(); -} - -void ResourceContext::Set(sk_sp context) { - FXL_DCHECK(!g_context); - g_context = context.release(); -} - -GrContext* ResourceContext::Get() { - return g_freeze ? nullptr : g_context; -} - -std::unique_ptr ResourceContext::Acquire() { - return std::make_unique(); -} - -void ResourceContext::Freeze() { - std::lock_guard lock(g_mutex); - g_freeze = true; -} - -void ResourceContext::Unfreeze() { - std::lock_guard lock(g_mutex); - g_freeze = false; -} - -} // namespace blink diff --git a/lib/ui/painting/resource_context.h b/lib/ui/painting/resource_context.h deleted file mode 100644 index 627b2053c2df9..0000000000000 --- a/lib/ui/painting/resource_context.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ -#define FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ - -#include "lib/fxl/macros.h" -#include "third_party/skia/include/gpu/GrContext.h" - -namespace blink { - -class ResourceContext { - public: - /** - * Globally set the GrContext singleton instance. - */ - static void Set(sk_sp context); - - /** - * Acquire a GrContext wrapping ResourceContext that's also an exclusive mutex - * on GrContext operations. - * - * Destructing the ResourceContext frees the mutex. - */ - static std::unique_ptr Acquire(); - - /** - * Synchronously signal a freeze on GrContext operations. - * - * ResourceContext instances will return nullptr on GrContext Get until - * unfrozen. - */ - static void Freeze(); - - /** - * Synchronously unfreeze GrContext operations. - * - * ResourceContext instances will continue to return the global GrContext - * instance on Get. - */ - static void Unfreeze(); - - ResourceContext(); - ~ResourceContext(); - - /** - * Returns global GrContext instance. May return null when operations are - * frozen. - * - * Happens on iOS when background operations on GrContext are forbidden. - */ - GrContext* Get(); - - FXL_DISALLOW_COPY_AND_ASSIGN(ResourceContext); -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_PAINTING_RESOURCE_CONTEXT_H_ diff --git a/lib/ui/painting/shader.cc b/lib/ui/painting/shader.cc index d7d8ccf20aefc..7999b84dfcc29 100644 --- a/lib/ui/painting/shader.cc +++ b/lib/ui/painting/shader.cc @@ -4,19 +4,15 @@ #include "flutter/lib/ui/painting/shader.h" -#include "flutter/common/threads.h" -#include "flutter/lib/ui/painting/utils.h" +#include "flutter/lib/ui/ui_dart_state.h" namespace blink { IMPLEMENT_WRAPPERTYPEINFO(ui, Shader); -Shader::Shader(sk_sp shader) : shader_(shader) {} +Shader::Shader(flow::SkiaGPUObject shader) + : shader_(std::move(shader)) {} -Shader::~Shader() { - // Skia objects must be deleted on the IO thread so that any associated GL - // objects will be cleaned up through the IO thread's GL context. - SkiaUnrefOnIOThread(&shader_); -} +Shader::~Shader() = default; } // namespace blink diff --git a/lib/ui/painting/shader.h b/lib/ui/painting/shader.h index 9c0f3c601db56..205197250eb84 100644 --- a/lib/ui/painting/shader.h +++ b/lib/ui/painting/shader.h @@ -5,6 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_SHADER_H_ #define FLUTTER_LIB_UI_PAINTING_SHADER_H_ +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkShader.h" @@ -18,14 +20,17 @@ class Shader : public fxl::RefCountedThreadSafe, public: ~Shader() override; - const sk_sp& shader() { return shader_; } - void set_shader(sk_sp shader) { shader_ = std::move(shader); } + sk_sp shader() { return shader_.get(); } + + void set_shader(flow::SkiaGPUObject shader) { + shader_ = std::move(shader); + } protected: - Shader(sk_sp shader); + Shader(flow::SkiaGPUObject shader = {}); private: - sk_sp shader_; + flow::SkiaGPUObject shader_; }; } // namespace blink diff --git a/lib/ui/painting/utils.cc b/lib/ui/painting/utils.cc deleted file mode 100644 index b3f87135ac0a8..0000000000000 --- a/lib/ui/painting/utils.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/lib/ui/painting/utils.h" -#include "flutter/common/threads.h" - -namespace blink { - -namespace { - -constexpr fxl::TimeDelta kDrainDelay = fxl::TimeDelta::FromMilliseconds(250); - -} // anonymous namespace - -SkiaUnrefQueue::SkiaUnrefQueue() : drain_pending_(false) {} - -SkiaUnrefQueue SkiaUnrefQueue::instance_; - -SkiaUnrefQueue& SkiaUnrefQueue::Get() { - return instance_; -} - -void SkiaUnrefQueue::Unref(SkRefCnt* object) { - std::lock_guard lock(mutex_); - objects_.push_back(object); - if (!drain_pending_) { - drain_pending_ = true; - Threads::IO()->PostDelayedTask([this] { Drain(); }, kDrainDelay); - } -} - -void SkiaUnrefQueue::Drain() { - std::deque skia_objects; - { - std::lock_guard lock(mutex_); - objects_.swap(skia_objects); - drain_pending_ = false; - } - - for (SkRefCnt* skia_object : skia_objects) { - skia_object->unref(); - } -} - -} // namespace blink diff --git a/lib/ui/painting/utils.h b/lib/ui/painting/utils.h deleted file mode 100644 index 02782c67962bc..0000000000000 --- a/lib/ui/painting/utils.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 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. - -#include "third_party/skia/include/core/SkRefCnt.h" - -#include -#include - -namespace blink { - -// A queue that holds Skia objects that must be destructed on the IO thread. -class SkiaUnrefQueue { - public: - static SkiaUnrefQueue& Get(); - - void Unref(SkRefCnt* object); - - private: - SkiaUnrefQueue(); - void Drain(); - - static SkiaUnrefQueue instance_; - - std::mutex mutex_; - std::deque objects_; - bool drain_pending_; -}; - -template -void SkiaUnrefOnIOThread(sk_sp* sp) { - T* object = sp->release(); - if (object) { - SkiaUnrefQueue::Get().Unref(object); - } -} - -} // namespace blink diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index d6407f9ed42e1..248468cc9701d 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -34,15 +34,9 @@ std::shared_ptr FontCollection::GetFontCollection() const { return collection_; } -void FontCollection::RegisterFontsFromAssetProvider( - fxl::RefPtr asset_provider) { - - if (!asset_provider){ - return; - } - +void FontCollection::RegisterFonts(const AssetManager& asset_manager) { std::vector manifest_data; - if (!asset_provider->GetAsBuffer("FontManifest.json", &manifest_data)) { + if (!asset_manager.GetAsBuffer("FontManifest.json", &manifest_data)) { FXL_DLOG(WARNING) << "Could not find the font manifest in the asset store."; return; } @@ -92,8 +86,8 @@ void FontCollection::RegisterFontsFromAssetProvider( // TODO: Handle weights and styles. std::vector font_data; - if (asset_provider->GetAsBuffer(font_asset->value.GetString(), - &font_data)) { + if (asset_manager.GetAsBuffer(font_asset->value.GetString(), + &font_data)) { // The data must be copied because it needs to be moved into the // typeface as a stream. auto data = diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index fb393b1582b79..ea9c2f46a96a0 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -7,10 +7,10 @@ #include #include -#include "flutter/assets/asset_provider.h" + +#include "flutter/assets/asset_manager.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" -#include "txt/asset_data_provider.h" #include "txt/font_collection.h" namespace blink { @@ -21,7 +21,8 @@ class FontCollection { std::shared_ptr GetFontCollection() const; - void RegisterFontsFromAssetProvider(fxl::RefPtr asset_provider); + void RegisterFonts(const AssetManager& asset_manager); + void RegisterTestFonts(); private: diff --git a/lib/ui/text/paragraph.cc b/lib/ui/text/paragraph.cc index 858ccd01d4ef6..fd00f6f51b3a3 100644 --- a/lib/ui/text/paragraph.cc +++ b/lib/ui/text/paragraph.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" #include "flutter/sky/engine/core/rendering/RenderParagraph.h" #include "flutter/sky/engine/core/rendering/RenderText.h" @@ -53,7 +53,8 @@ Paragraph::Paragraph(std::unique_ptr paragraph) Paragraph::~Paragraph() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + destruction_task_runner_->PostTask( + [renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph.h b/lib/ui/text/paragraph.h index 1b2019373553a..b3a943209ab4c 100644 --- a/lib/ui/text/paragraph.h +++ b/lib/ui/text/paragraph.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/paragraph_impl_blink.h" @@ -66,6 +67,10 @@ class Paragraph : public fxl::RefCountedThreadSafe, explicit Paragraph(std::unique_ptr paragraph); + // TODO: This can be removed when the render view association for the legacy + // runtime is removed. + fxl::RefPtr destruction_task_runner_ = + UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index 44d05053ba342..b987e3fde6272 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/text/paragraph_builder.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/sky/engine/core/rendering/RenderInline.h" @@ -205,9 +205,11 @@ fxl::RefPtr ParagraphBuilder::create( double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale) { - return fxl::MakeRefCounted(encoded, fontFamily, fontSize, - lineHeight, ellipsis, locale); + const std::string& locale, + bool use_blink) { + return fxl::MakeRefCounted( + encoded, fontFamily, fontSize, lineHeight, ellipsis, locale, + UIDartState::Current()->use_blink()); } ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, @@ -215,8 +217,10 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale) { - if (!Settings::Get().using_blink) { + const std::string& locale, + bool use_blink) + : m_useBlink(use_blink) { + if (!m_useBlink) { int32_t mask = encoded[0]; txt::ParagraphStyle style; if (mask & psTextAlignMask) @@ -275,7 +279,8 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, ParagraphBuilder::~ParagraphBuilder() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + destruction_task_runner_->PostTask( + [renderView]() { renderView->destroy(); }); } } @@ -290,7 +295,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, int32_t mask = encoded[0]; - if (!Settings::Get().using_blink) { + if (!m_useBlink) { // Set to use the properties of the previous style if the property is not // explicitly given. txt::TextStyle style = m_paragraphBuilder->PeekStyle(); @@ -423,7 +428,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, } void ParagraphBuilder::pop() { - if (!Settings::Get().using_blink) { + if (!m_useBlink) { m_paragraphBuilder->Pop(); } else { // Blink Version. @@ -445,7 +450,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { if (error_code != U_BUFFER_OVERFLOW_ERROR) return tonic::ToDart("string is not well-formed UTF-16"); - if (!Settings::Get().using_blink) { + if (!m_useBlink) { m_paragraphBuilder->AddText(text); } else { // Blink Version. @@ -464,7 +469,7 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { fxl::RefPtr ParagraphBuilder::build() { m_currentRenderObject = nullptr; - if (!Settings::Get().using_blink) { + if (!m_useBlink) { return Paragraph::Create(m_paragraphBuilder->Build()); } else { return Paragraph::Create(m_renderView.release()); diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 37a1e9a3e74cf..1c38d98696def 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -32,7 +32,8 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale); + const std::string& locale, + bool use_blink); ~ParagraphBuilder() override; @@ -58,14 +59,20 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale); + const std::string& locale, + bool use_blink); void createRenderView(); + // TODO: This can be removed when the render view association for the legacy + // runtime is removed. + fxl::RefPtr destruction_task_runner_ = + UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; RenderObject* m_renderParagraph; RenderObject* m_currentRenderObject; std::unique_ptr m_paragraphBuilder; + bool m_useBlink; }; } // namespace blink diff --git a/lib/ui/text/paragraph_impl_blink.cc b/lib/ui/text/paragraph_impl_blink.cc index c7752c0a7c757..5c50f047afa33 100644 --- a/lib/ui/text/paragraph_impl_blink.cc +++ b/lib/ui/text/paragraph_impl_blink.cc @@ -4,7 +4,6 @@ #include "flutter/lib/ui/text/paragraph_impl_blink.h" -#include "flutter/common/threads.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/sky/engine/core/rendering/PaintInfo.h" @@ -30,7 +29,8 @@ ParagraphImplBlink::ParagraphImplBlink(PassOwnPtr renderView) ParagraphImplBlink::~ParagraphImplBlink() { if (m_renderView) { RenderView* renderView = m_renderView.leakPtr(); - Threads::UI()->PostTask([renderView]() { renderView->destroy(); }); + destruction_task_runner_->PostTask( + [renderView]() { renderView->destroy(); }); } } diff --git a/lib/ui/text/paragraph_impl_blink.h b/lib/ui/text/paragraph_impl_blink.h index 79d89ad471962..ebd80f8dd5382 100644 --- a/lib/ui/text/paragraph_impl_blink.h +++ b/lib/ui/text/paragraph_impl_blink.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/text_box.h" @@ -41,6 +42,10 @@ class ParagraphImplBlink : public ParagraphImpl { int absoluteOffsetForPosition(const PositionWithAffinity& position); + // TODO: This can be removed when the render view association for the legacy + // runtime is removed. + fxl::RefPtr destruction_task_runner_ = + UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); OwnPtr m_renderView; }; diff --git a/lib/ui/text/paragraph_impl_txt.cc b/lib/ui/text/paragraph_impl_txt.cc index de8d8ff0b2fc3..28c6ea19a8157 100644 --- a/lib/ui/text/paragraph_impl_txt.cc +++ b/lib/ui/text/paragraph_impl_txt.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/text/paragraph_impl_txt.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "lib/fxl/logging.h" diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 3bdf21e6a1a93..8ef7ca98fd758 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/window.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" #include "lib/tonic/converter/dart_converter.h" @@ -12,34 +13,44 @@ using tonic::ToDart; namespace blink { -IsolateClient::~IsolateClient() {} - -UIDartState::UIDartState(IsolateClient* isolate_client, - std::unique_ptr window, - int dirfd) - : tonic::DartState(dirfd), - isolate_client_(isolate_client), - main_port_(ILLEGAL_PORT), - window_(std::move(window)) {} +UIDartState::UIDartState(TaskRunners task_runners, + TaskObserverAdd add_callback, + TaskObserverRemove remove_callback, + fml::WeakPtr resource_context, + fxl::RefPtr skia_unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, + std::string logger_prefix) + : task_runners_(std::move(task_runners)), + add_callback_(std::move(add_callback)), + remove_callback_(std::move(remove_callback)), + resource_context_(std::move(resource_context)), + advisory_script_uri_(std::move(advisory_script_uri)), + advisory_script_entrypoint_(std::move(advisory_script_entrypoint)), + logger_prefix_(std::move(logger_prefix)), + skia_unref_queue_(std::move(skia_unref_queue)), + weak_factory_(this) { + AddOrRemoveTaskObserver(true /* add */); +} UIDartState::~UIDartState() { - main_port_ = ILLEGAL_PORT; - // We've already destroyed the isolate. Revoke any weak ptrs held by - // DartPersistentValues so they don't try to enter the destroyed isolate to - // clean themselves up. - // TODO(abarth): Can we do this work in the base class? - weak_factory_.InvalidateWeakPtrs(); + AddOrRemoveTaskObserver(false /* remove */); } -UIDartState* UIDartState::CreateForChildIsolate() { - return new UIDartState(isolate_client_, nullptr); +const std::string& UIDartState::GetAdvisoryScriptURI() const { + return advisory_script_uri_; +} + +const std::string& UIDartState::GetAdvisoryScriptEntrypoint() const { + return advisory_script_entrypoint_; } void UIDartState::DidSetIsolate() { - FXL_DCHECK(!debug_name_prefix_.empty()); main_port_ = Dart_GetMainPortId(); std::ostringstream debug_name; - debug_name << debug_name_prefix_ << "$main-" << main_port_; + // main.dart$main-1234 + debug_name << advisory_script_uri_ << "$" << advisory_script_entrypoint_ + << "-" << main_port_; debug_name_ = debug_name.str(); } @@ -55,8 +66,48 @@ PassRefPtr UIDartState::font_selector() { return font_selector_; } -void UIDartState::set_debug_name_prefix(const std::string& debug_name_prefix) { - debug_name_prefix_ = debug_name_prefix; +void UIDartState::SetWindow(std::unique_ptr window) { + window_ = std::move(window); +} + +const TaskRunners& UIDartState::GetTaskRunners() const { + return task_runners_; +} + +fxl::RefPtr UIDartState::GetSkiaUnrefQueue() const { + return skia_unref_queue_; +} + +void UIDartState::ScheduleMicrotask(Dart_Handle closure) { + if (tonic::LogIfError(closure) || !Dart_IsClosure(closure)) { + return; + } + + microtask_queue_.ScheduleMicrotask(closure); +} + +void UIDartState::FlushMicrotasksNow() { + microtask_queue_.RunMicrotasks(); +} + +void UIDartState::AddOrRemoveTaskObserver(bool add) { + auto task_runner = task_runners_.GetUITaskRunner(); + if (!task_runner) { + // This may happen in case the isolate has no thread affinity (for example, + // the service isolate). + return; + } + FXL_DCHECK(add_callback_ && remove_callback_); + if (add) { + add_callback_(reinterpret_cast(this), + [this]() { this->FlushMicrotasksNow(); }); + } else { + remove_callback_(reinterpret_cast(this)); + } +} + +fml::WeakPtr UIDartState::GetResourceContext() const { + return resource_context_; } } // namespace blink diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index 0f7f9343d4958..a5c78c1671815 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -5,65 +5,106 @@ #ifndef FLUTTER_LIB_UI_UI_DART_STATE_H_ #define FLUTTER_LIB_UI_UI_DART_STATE_H_ +#include +#include #include +#include "flutter/common/settings.h" +#include "flutter/common/task_runners.h" +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/sky/engine/wtf/RefPtr.h" #include "lib/fxl/build_config.h" +#include "lib/tonic/dart_microtask_queue.h" #include "lib/tonic/dart_persistent_value.h" #include "lib/tonic/dart_state.h" #include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/skia/include/gpu/GrContext.h" namespace blink { class FontSelector; class Window; -class IsolateClient { - public: - virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate) = 0; - virtual void DidShutdownMainIsolate() = 0; - - protected: - virtual ~IsolateClient(); -}; - class UIDartState : public tonic::DartState { public: - UIDartState(IsolateClient* isolate_client, - std::unique_ptr window, - int dirfd = -1); - ~UIDartState() override; - static UIDartState* Current(); - UIDartState* CreateForChildIsolate(); - - IsolateClient* isolate_client() const { return isolate_client_; } - void set_isolate_client(IsolateClient* isolate_client) { - isolate_client_ = isolate_client; - } Dart_Port main_port() const { return main_port_; } + const std::string& debug_name() const { return debug_name_; } + + const std::string& logger_prefix() const { return logger_prefix_; } + Window* window() const { return window_.get(); } - void set_debug_name_prefix(const std::string& debug_name_prefix); void set_font_selector(PassRefPtr selector); + PassRefPtr font_selector(); - bool is_controller_state() const { return is_controller_state_; } - void set_is_controller_state(bool value) { is_controller_state_ = value; } - bool shutting_down() const { return shutting_down_; } - void set_shutting_down(bool value) { shutting_down_ = value; } + + bool use_blink() const { return use_blink_; } + + const TaskRunners& GetTaskRunners() const; + + void ScheduleMicrotask(Dart_Handle handle); + + void FlushMicrotasksNow(); + + fxl::RefPtr GetSkiaUnrefQueue() const; + + fml::WeakPtr GetResourceContext() const; + + template + static flow::SkiaGPUObject CreateGPUObject(sk_sp object) { + if (!object) { + return {}; + } + auto state = UIDartState::Current(); + FXL_DCHECK(state); + auto queue = state->GetSkiaUnrefQueue(); + return {std::move(object), std::move(queue)}; + }; + + protected: + UIDartState(TaskRunners task_runners, + TaskObserverAdd add_callback, + TaskObserverRemove remove_callback, + fml::WeakPtr resource_context, + fxl::RefPtr skia_unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, + std::string logger_prefix); + + ~UIDartState() override; + + void SetWindow(std::unique_ptr window); + + void set_use_blink(bool use_blink) { use_blink_ = use_blink; } + + const std::string& GetAdvisoryScriptURI() const; + + const std::string& GetAdvisoryScriptEntrypoint() const; private: void DidSetIsolate() override; - IsolateClient* isolate_client_; - Dart_Port main_port_; - std::string debug_name_prefix_; + const TaskRunners task_runners_; + const TaskObserverAdd add_callback_; + const TaskObserverRemove remove_callback_; + fml::WeakPtr resource_context_; + const std::string advisory_script_uri_; + const std::string advisory_script_entrypoint_; + const std::string logger_prefix_; + Dart_Port main_port_ = ILLEGAL_PORT; std::string debug_name_; std::unique_ptr window_; RefPtr font_selector_; - bool is_controller_state_; - bool shutting_down_ = false; + fxl::RefPtr skia_unref_queue_; + tonic::DartMicrotaskQueue microtask_queue_; + fml::WeakPtrFactory weak_factory_; + + void AddOrRemoveTaskObserver(bool add); + + bool use_blink_ = false; }; } // namespace blink diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index 065159b79713b..2cca2fd179888 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -6,7 +6,7 @@ #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/lib/ui/window/window.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/dart_state.h" @@ -43,12 +43,14 @@ Dart_Handle WrapByteData(std::vector data) { } // anonymous namespace PlatformMessageResponseDart::PlatformMessageResponseDart( - tonic::DartPersistentValue callback) - : callback_(std::move(callback)) {} + tonic::DartPersistentValue callback, + fxl::RefPtr ui_task_runner) + : callback_(std::move(callback)), + ui_task_runner_(std::move(ui_task_runner)) {} PlatformMessageResponseDart::~PlatformMessageResponseDart() { if (!callback_.is_empty()) { - Threads::UI()->PostTask( + ui_task_runner_->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { callback.Clear(); })); @@ -60,7 +62,7 @@ void PlatformMessageResponseDart::Complete(std::vector data) { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - Threads::UI()->PostTask(fxl::MakeCopyable( + ui_task_runner_->PostTask(fxl::MakeCopyable( [ callback = std::move(callback_), data = std::move(data) ]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) @@ -77,7 +79,7 @@ void PlatformMessageResponseDart::CompleteEmpty() { return; FXL_DCHECK(!is_complete_); is_complete_ = true; - Threads::UI()->PostTask( + ui_task_runner_->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { tonic::DartState* dart_state = callback.dart_state().get(); if (!dart_state) diff --git a/lib/ui/window/platform_message_response_dart.h b/lib/ui/window/platform_message_response_dart.h index 51c55a930014b..67bfb3d359691 100644 --- a/lib/ui/window/platform_message_response_dart.h +++ b/lib/ui/window/platform_message_response_dart.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ #define FLUTTER_LIB_UI_PLATFORM_PLATFORM_MESSAGE_RESPONSE_DART_H_ +#include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/platform_message_response.h" #include "lib/tonic/dart_persistent_value.h" @@ -19,10 +20,13 @@ class PlatformMessageResponseDart : public PlatformMessageResponse { void CompleteEmpty() override; protected: - explicit PlatformMessageResponseDart(tonic::DartPersistentValue callback); + explicit PlatformMessageResponseDart( + tonic::DartPersistentValue callback, + fxl::RefPtr ui_task_runner); ~PlatformMessageResponseDart() override; tonic::DartPersistentValue callback_; + fxl::RefPtr ui_task_runner_; }; } // namespace blink diff --git a/lib/ui/window/viewport_metrics.h b/lib/ui/window/viewport_metrics.h index 1e443ae8c1404..5085d06f42724 100644 --- a/lib/ui/window/viewport_metrics.h +++ b/lib/ui/window/viewport_metrics.h @@ -23,6 +23,25 @@ struct ViewportMetrics { int32_t physical_view_inset_left = 0; }; +struct LogicalSize { + double width = 0.0; + double height = 0.0; +}; + +struct LogicalInset { + double left = 0.0; + double top = 0.0; + double right = 0.0; + double bottom = 0.0; +}; + +struct LogicalMetrics { + LogicalSize size; + double scale = 1.0; + LogicalInset padding; + LogicalInset view_inset; +}; + } // namespace blink #endif // FLUTTER_LIB_UI_WINDOW_VIEWPORT_METRICS_H_ diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index e12e03f10d01f..4cce1cc5903b0 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -63,7 +63,8 @@ void SendPlatformMessage(Dart_Handle window, fxl::RefPtr response; if (!Dart_IsNull(callback)) { response = fxl::MakeRefCounted( - tonic::DartPersistentValue(dart_state, callback)); + tonic::DartPersistentValue(dart_state, callback), + dart_state->GetTaskRunners().GetUITaskRunner()); } if (Dart_IsNull(data.dart_handle())) { UIDartState::Current()->window()->client()->HandlePlatformMessage( @@ -254,7 +255,7 @@ void Window::BeginFrame(fxl::TimePoint frameTime) { Dart_NewInteger(microseconds), }); - tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); + UIDartState::Current()->FlushMicrotasksNow(); DartInvokeField(library_.value(), "_drawFrame", {}); } diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index ef0d7ef863a0e..2feeccb65f9cc 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -13,6 +13,7 @@ #include "flutter/lib/ui/window/viewport_metrics.h" #include "lib/fxl/time/time_point.h" #include "lib/tonic/dart_persistent_value.h" +#include "third_party/skia/include/gpu/GrContext.h" namespace tonic { class DartLibraryNatives; @@ -35,12 +36,14 @@ class WindowClient { virtual ~WindowClient(); }; -class Window { +class Window final { public: explicit Window(WindowClient* client); + ~Window(); WindowClient* client() const { return client_; } + const ViewportMetrics& viewport_metrics() { return viewport_metrics_; } void DidCreateIsolate(); diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index dea8a8906d031..455d7e228168f 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -4,6 +4,7 @@ import("//third_party/dart/runtime/bin/vmservice/vmservice_sources.gni") import("$flutter_root/common/config.gni") +import("$flutter_root/testing/testing.gni") action("gen_embedded_resources_cc") { script = "//third_party/dart/runtime/tools/create_resources.py" @@ -37,9 +38,7 @@ source_set("embedded_resources_cc") { deps = [ ":gen_embedded_resources_cc", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } source_set("test_font") { @@ -50,9 +49,7 @@ source_set("test_font") { deps = [ "//third_party/skia", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] defines = [] if (flutter_runtime_mode == "debug" || current_toolchain == host_toolchain) { # Though the test font data is small, we dont want to add to the binary size @@ -63,16 +60,19 @@ source_set("test_font") { } source_set("runtime") { - sources = [ "asset_font_selector.cc", "asset_font_selector.h", - "dart_controller.cc", - "dart_controller.h", - "dart_init.cc", - "dart_init.h", + "dart_isolate.cc", + "dart_isolate.h", "dart_service_isolate.cc", "dart_service_isolate.h", + "dart_snapshot.cc", + "dart_snapshot.h", + "dart_snapshot_buffer.cc", + "dart_snapshot_buffer.h", + "dart_vm.cc", + "dart_vm.h", "embedder_resources.cc", "embedder_resources.h", "platform_impl.cc", @@ -81,8 +81,8 @@ source_set("runtime") { "runtime_controller.h", "runtime_delegate.cc", "runtime_delegate.h", - "runtime_init.cc", - "runtime_init.h", + "service_protocol.cc", + "service_protocol.h", "start_up.cc", "start_up.h", "test_font_selector.cc", @@ -92,25 +92,24 @@ source_set("runtime") { deps = [ ":embedded_resources_cc", ":test_font", - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/bin:embedded_dart_io", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", + "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/io", "$flutter_root/lib/ui", "$flutter_root/sky/engine/platform", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//topaz/lib/tonic", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] # In AOT mode, precompiled snapshots contain the instruction buffer. # Generation of the same requires all application specific script code to be @@ -119,3 +118,28 @@ source_set("runtime") { deps += [ "$flutter_root/lib/snapshot" ] } } + +test_fixtures("runtime_fixtures") { + fixtures = [ "fixtures/simple_main.dart" ] +} + +executable("runtime_unittests") { + testonly = true + + sources = [ + "dart_isolate_unittests.cc", + "dart_vm_unittests.cc", + ] + + deps = [ + ":runtime", + ":runtime_fixtures", + "$flutter_root/fml", + "$flutter_root/lib/snapshot", + "$flutter_root/testing", + "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", + "//third_party/skia", + "//topaz/lib/tonic", + ] +} diff --git a/runtime/asset_font_selector.cc b/runtime/asset_font_selector.cc index abf4bf9874ddd..2a43f39e3a89b 100644 --- a/runtime/asset_font_selector.cc +++ b/runtime/asset_font_selector.cc @@ -80,27 +80,15 @@ struct FontMatcher { } // namespace -void AssetFontSelector::Install( - fxl::RefPtr asset_provider) { +void AssetFontSelector::Install(fxl::RefPtr asset_manager) { RefPtr font_selector = - adoptRef(new AssetFontSelector(std::move(asset_provider))); + adoptRef(new AssetFontSelector(std::move(asset_manager))); font_selector->parseFontManifest(); UIDartState::Current()->set_font_selector(font_selector); } -void AssetFontSelector::Install(fxl::RefPtr asset_store) { - RefPtr font_selector = - adoptRef(new AssetFontSelector(std::move(asset_store))); - font_selector->parseFontManifest(); - UIDartState::Current()->set_font_selector(font_selector); -} - -AssetFontSelector::AssetFontSelector( - fxl::RefPtr asset_provider) - : asset_provider_(std::move(asset_provider)) {} - -AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_store) - : asset_store_(std::move(asset_store)) {} +AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_manager) + : asset_manager_(std::move(asset_manager)) {} AssetFontSelector::~AssetFontSelector() {} @@ -118,12 +106,9 @@ AssetFontSelector::FlutterFontAttributes::~FlutterFontAttributes() {} void AssetFontSelector::parseFontManifest() { std::vector font_manifest_data; - if (!asset_provider_ || - !asset_provider_->GetAsBuffer(kFontManifestAssetPath, - &font_manifest_data)) { - if (!asset_store_ || - !asset_store_->GetAsBuffer(kFontManifestAssetPath, &font_manifest_data)) - return; + if (!asset_manager_->GetAsBuffer(kFontManifestAssetPath, + &font_manifest_data)) { + return; } rapidjson::Document document; @@ -239,13 +224,8 @@ sk_sp AssetFontSelector::getTypefaceAsset( } std::unique_ptr typeface_asset(new TypefaceAsset); - if (!asset_provider_ || !asset_provider_->GetAsBuffer( - asset_path, &typeface_asset->data)) { - if (!asset_store_ || - !asset_store_->GetAsBuffer(asset_path, &typeface_asset->data)) { - typeface_cache_.insert(std::make_pair(asset_path, nullptr)); - return nullptr; - } + if (!asset_manager_->GetAsBuffer(asset_path, &typeface_asset->data)) { + return nullptr; } sk_sp font_mgr(SkFontMgr::RefDefault()); diff --git a/runtime/asset_font_selector.h b/runtime/asset_font_selector.h index 921c0472dba78..8d7e946d89e7e 100644 --- a/runtime/asset_font_selector.h +++ b/runtime/asset_font_selector.h @@ -8,7 +8,7 @@ #include #include -#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/asset_manager.h" #include "flutter/assets/zip_asset_store.h" #include "flutter/sky/engine/platform/fonts/FontCacheKey.h" #include "flutter/sky/engine/platform/fonts/FontSelector.h" @@ -24,11 +24,7 @@ class AssetFontSelector : public FontSelector { ~AssetFontSelector() override; - static void Install(fxl::RefPtr asset_provider); - - // TODO(zarah): Remove this and related code using asset_store once flx is - // removed. - static void Install(fxl::RefPtr asset_store); + static void Install(fxl::RefPtr asset_manager); PassRefPtr getFontData(const FontDescription& font_description, const AtomicString& family_name) override; @@ -44,19 +40,14 @@ class AssetFontSelector : public FontSelector { private: struct TypefaceAsset; - explicit AssetFontSelector( - fxl::RefPtr asset_provider); - - explicit AssetFontSelector(fxl::RefPtr asset_store); + explicit AssetFontSelector(fxl::RefPtr asset_manager); void parseFontManifest(); sk_sp getTypefaceAsset(const FontDescription& font_description, const AtomicString& family_name); - fxl::RefPtr asset_provider_; - - fxl::RefPtr asset_store_; + fxl::RefPtr asset_manager_; HashMap> font_family_map_; diff --git a/runtime/dart_controller.cc b/runtime/dart_controller.cc deleted file mode 100644 index 84cfceeaecc10..0000000000000 --- a/runtime/dart_controller.cc +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/runtime/dart_controller.h" -#include "lib/fxl/build_config.h" - -#if defined(OS_WIN) -#include -#undef GetCurrentDirectory -#endif - -#include - -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" -#include "flutter/glue/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "lib/fxl/files/directory.h" -#include "lib/fxl/files/path.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_message_handler.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -using tonic::LogIfError; -using tonic::ToDart; - -namespace blink { -namespace { -#if defined(OS_WIN) - -std::string FindAndReplace(const std::string& str, - const std::string& findStr, - const std::string& replaceStr) { - std::string rStr = str; - size_t pos = 0; - while ((pos = rStr.find(findStr, pos)) != std::string::npos) { - rStr.replace(pos, findStr.length(), replaceStr); - pos += replaceStr.length(); - } - return rStr; -} - -std::string SanitizePath(const std::string& path) { - return FindAndReplace(path, "\\\\", "/"); -} - -std::string ResolvePath(std::string path) { - std::string sanitized = SanitizePath(path); - if ((sanitized.length() > 2) && (sanitized[1] == ':')) { - return sanitized; - } - return files::SimplifyPath(files::GetCurrentDirectory() + "/" + sanitized); -} - -#else // defined(OS_WIN) - -std::string SanitizePath(const std::string& path) { - return path; -} - -// TODO(abarth): Consider adding this to //garnet/public/lib/fxl. -std::string ResolvePath(std::string path) { - if (!path.empty() && path[0] == '/') - return path; - return files::SimplifyPath(files::GetCurrentDirectory() + "/" + path); -} - -#endif - -} // namespace - -DartController::DartController() : ui_dart_state_(nullptr) {} - -DartController::~DartController() { - if (ui_dart_state_) { - ui_dart_state_->set_isolate_client(nullptr); - - if (!ui_dart_state_->shutting_down()) { - // Don't use a tonic::DartIsolateScope here since we never exit the - // isolate. - Dart_EnterIsolate(ui_dart_state_->isolate()); - // Clear the message notify callback. - Dart_SetMessageNotifyCallback(nullptr); - Dart_ShutdownIsolate(); - } - } -} - -const std::string DartController::main_entrypoint_ = "main"; - -bool DartController::SendStartMessage(Dart_Handle root_library, - const std::string& entrypoint) { - if (LogIfError(root_library)) - return true; - - { - // Temporarily exit the isolate while we make it runnable. - Dart_Isolate isolate = dart_state()->isolate(); - FXL_DCHECK(Dart_CurrentIsolate() == isolate); - Dart_ExitIsolate(); - Dart_IsolateMakeRunnable(isolate); - Dart_EnterIsolate(isolate); - } - - // In order to support pausing the isolate at start, we indirectly invoke - // main by sending a message to the isolate. - - // Get the closure of main(). - Dart_Handle main_closure = Dart_GetClosure( - root_library, Dart_NewStringFromCString(entrypoint.c_str())); - if (LogIfError(main_closure)) - return true; - - // Grab the 'dart:isolate' library. - Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); - DART_CHECK_VALID(isolate_lib); - - // Send the start message containing the entry point by calling - // _startMainIsolate in dart:isolate. - const intptr_t kNumIsolateArgs = 2; - Dart_Handle isolate_args[kNumIsolateArgs]; - isolate_args[0] = main_closure; - isolate_args[1] = Dart_Null(); - Dart_Handle result = Dart_Invoke(isolate_lib, ToDart("_startMainIsolate"), - kNumIsolateArgs, isolate_args); - return LogIfError(result); -} - -tonic::DartErrorHandleType DartController::RunFromKernel( - const std::vector& kernel, - const std::string& entrypoint) { - tonic::DartState::Scope scope(dart_state()); - tonic::DartErrorHandleType error = tonic::kNoError; - if (Dart_IsNull(Dart_RootLibrary())) { - Dart_Handle result = Dart_LoadScriptFromKernel(kernel.data(), kernel.size()); - LogIfError(result); - error = tonic::GetErrorHandleType(result); - } - if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { - return tonic::kUnknownErrorType; - } - return error; -} - -tonic::DartErrorHandleType DartController::RunFromPrecompiledSnapshot( - const std::string& entrypoint) { - TRACE_EVENT0("flutter", "DartController::RunFromPrecompiledSnapshot"); - FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - tonic::DartState::Scope scope(dart_state()); - if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { - return tonic::kUnknownErrorType; - } - return tonic::kNoError; -} - -tonic::DartErrorHandleType DartController::RunFromScriptSnapshot( - const uint8_t* buffer, - size_t size, - const std::string& entrypoint) { - tonic::DartState::Scope scope(dart_state()); - tonic::DartErrorHandleType error = tonic::kNoError; - if (Dart_IsNull(Dart_RootLibrary())) { - Dart_Handle result = Dart_LoadScriptFromSnapshot(buffer, size); - LogIfError(result); - error = tonic::GetErrorHandleType(result); - } - if (SendStartMessage(Dart_RootLibrary(), entrypoint)) { - return tonic::kUnknownErrorType; - } - return error; -} - -tonic::DartErrorHandleType DartController::RunFromSource( - const std::string& main, - const std::string& packages) { - tonic::DartState::Scope scope(dart_state()); - tonic::DartErrorHandleType error = tonic::kNoError; - if (Dart_IsNull(Dart_RootLibrary())) { - tonic::FileLoader& loader = dart_state()->file_loader(); - if (!packages.empty() && !loader.LoadPackagesMap(ResolvePath(packages))) - FXL_LOG(WARNING) << "Failed to load package map: " << packages; - Dart_Handle result = loader.LoadScript(SanitizePath(main)); - LogIfError(result); - error = tonic::GetErrorHandleType(result); - } - if (SendStartMessage(Dart_RootLibrary())) { - return tonic::kCompilationErrorType; - } - return error; -} - -void DartController::CreateIsolateFor(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - std::unique_ptr state) { - char* error = nullptr; - - void* platform_kernel = GetKernelPlatformBinary(); - - Dart_Isolate isolate; - if (platform_kernel != nullptr) { - isolate = Dart_CreateIsolateFromKernel( - script_uri.c_str(), "main", platform_kernel, nullptr /* flags */, - static_cast(state.get()), &error); - } else { - isolate = - Dart_CreateIsolate(script_uri.c_str(), "main", isolate_snapshot_data, - isolate_snapshot_instr, nullptr, - static_cast(state.get()), &error); - } - FXL_CHECK(isolate) << error; - ui_dart_state_ = state.release(); - ui_dart_state_->set_is_controller_state(true); - dart_state()->message_handler().Initialize(blink::Threads::UI()); - - Dart_SetShouldPauseOnStart(Settings::Get().start_paused); - - ui_dart_state_->set_debug_name_prefix(script_uri); - ui_dart_state_->SetIsolate(isolate); - FXL_CHECK(!LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); - - { - tonic::DartApiScope dart_api_scope; - DartIO::InitForIsolate(); - DartUI::InitForIsolate(); - DartRuntimeHooks::Install(DartRuntimeHooks::MainIsolate, script_uri); - - std::unique_ptr ui_class_provider( - new tonic::DartClassProvider(dart_state(), "dart:ui")); - dart_state()->class_library().add_provider("ui", - std::move(ui_class_provider)); - } - Dart_ExitIsolate(); -} - -} // namespace blink diff --git a/runtime/dart_controller.h b/runtime/dart_controller.h deleted file mode 100644 index 4b11a8660b7e7..0000000000000 --- a/runtime/dart_controller.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2015 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. - -#ifndef FLUTTER_RUNTIME_DART_CONTROLLER_H_ -#define FLUTTER_RUNTIME_DART_CONTROLLER_H_ - -#include -#include - -#include "lib/fxl/macros.h" -#include "lib/tonic/logging/dart_error.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace blink { -class UIDartState; - -class DartController { - public: - DartController(); - ~DartController(); - - tonic::DartErrorHandleType RunFromKernel( - const std::vector& kernel, - const std::string& entrypoint = main_entrypoint_); - tonic::DartErrorHandleType RunFromPrecompiledSnapshot( - const std::string& entrypoint = main_entrypoint_); - tonic::DartErrorHandleType RunFromScriptSnapshot( - const uint8_t* buffer, - size_t size, - const std::string& entrypoint = main_entrypoint_); - tonic::DartErrorHandleType RunFromSource(const std::string& main, - const std::string& packages); - - void CreateIsolateFor(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - std::unique_ptr ui_dart_state); - - UIDartState* dart_state() const { return ui_dart_state_; } - - private: - bool SendStartMessage(Dart_Handle root_library, - const std::string& entrypoint = main_entrypoint_); - - static const std::string main_entrypoint_; - - // The DartState associated with the main isolate. - UIDartState* ui_dart_state_; - - FXL_DISALLOW_COPY_AND_ASSIGN(DartController); -}; -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_CONTROLLER_H_ diff --git a/runtime/dart_init.cc b/runtime/dart_init.cc deleted file mode 100644 index e3d88322a4882..0000000000000 --- a/runtime/dart_init.cc +++ /dev/null @@ -1,725 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/runtime/dart_init.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#include -#include -#include - -#if defined(OS_WIN) -#include -#include -#undef ERROR - -#define access _access -#define R_OK 0x4 - -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif - -#else -#include -#endif - -#include -#include -#include -#include - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/unzipper_provider.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/common/settings.h" -#include "flutter/glue/trace_event.h" -#include "flutter/lib/io/dart_io.h" -#include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/dart_ui.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/runtime/start_up.h" -#include "lib/fxl/arraysize.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/files/path.h" -#include "lib/fxl/files/file.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/dart_sticky_error.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" -#include "lib/tonic/typed_data/uint8_list.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" -#include "third_party/dart/runtime/include/dart_mirrors_api.h" - -using tonic::DartClassProvider; -using tonic::LogIfError; -using tonic::ToDart; - -namespace dart { -namespace observatory { - -#if !OS(FUCHSIA) && FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - -// These two symbols are defined in |observatory_archive.cc| which is generated -// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. -// Both of these symbols will be part of the data segment and therefore are read -// only. -extern unsigned int observatory_assets_archive_len; -extern const uint8_t* observatory_assets_archive; - -#endif // FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - -} // namespace observatory -} // namespace dart - -namespace blink { - -const char kKernelAssetKey[] = "kernel_blob.bin"; -const char kSnapshotAssetKey[] = "snapshot_blob.bin"; -const char kPlatformKernelAssetKey[] = "platform.dill"; - -namespace { - -// Arguments passed to the Dart VM in all configurations. -static const char* kDartLanguageArgs[] = { - "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", - "--causal_async_stacks", "--limit-ints-to-64-bits", -}; - -static const char* kDartPrecompilationArgs[] = { - "--precompilation", -}; - -static const char* kDartWriteProtectCodeArgs[] FXL_ALLOW_UNUSED_TYPE = { - "--no_write_protect_code", -}; - -static const char* kDartAssertArgs[] = { - // clang-format off - "--enable_asserts", - // clang-format on -}; - -static const char* kDartCheckedModeArgs[] = { - // clang-format off - "--enable_type_checks", - "--error_on_bad_type", - "--error_on_bad_override", - // clang-format on -}; - -static const char* kDartStrongModeArgs[] = { - // clang-format off - "--limit_ints_to_64_bits", - "--reify_generic_functions", - "--strong", - "--sync_async", - // clang-format on -}; - -static const char* kDartStartPausedArgs[]{ - "--pause_isolates_on_start", -}; - -static const char* kDartTraceStartupArgs[]{ - "--timeline_streams=Compiler,Dart,Embedder,GC", -}; - -static const char* kDartEndlessTraceBufferArgs[]{ - "--timeline_recorder=endless", -}; - -static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { - "--systrace_timeline", - "--timeline_streams=VM,Isolate,Compiler,Dart,GC", -}; - -constexpr char kFileUriPrefix[] = "file://"; -constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; - -static const uint8_t* g_default_isolate_snapshot_data = nullptr; -static const uint8_t* g_default_isolate_snapshot_instructions = nullptr; -static bool g_service_isolate_initialized = false; -static ServiceIsolateHook g_service_isolate_hook = nullptr; -static RegisterNativeServiceProtocolExtensionHook - g_register_native_service_protocol_extensions_hook = nullptr; - -// Kernel representation of core dart libraries(loaded from platform.dill). -// TODO(aam): This (and platform_data below) have to be released when engine -// gets torn down. At that point we could also call Dart_Cleanup to complete -// Dart VM cleanup. -static void* kernel_platform = nullptr; -// Bytes actually read from platform.dill that are referenced by kernel_platform -static std::vector platform_data; - -void IsolateShutdownCallback(void* callback_data) { - if (tonic::DartStickyError::IsSet()) { - tonic::DartApiScope api_scope; - FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) - << " exited with an error"; - Dart_Handle sticky_error = Dart_GetStickyError(); - FXL_CHECK(LogIfError(sticky_error)); - } - - UIDartState* dart_state = static_cast(callback_data); - // If the isolate that's shutting down is the main one, tell the higher layers - // of the stack. - if ((dart_state != NULL) && dart_state->is_controller_state()) { - dart_state->set_shutting_down(true); - if (dart_state->isolate_client()) { - dart_state->isolate_client()->DidShutdownMainIsolate(); - } - } -} - -// The cleanup callback frees the DartState object. -void IsolateCleanupCallback(void* callback_data) { - UIDartState* dart_state = static_cast(callback_data); - delete dart_state; -} - -bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { - if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { - // Assume modified. - return true; - } - - const char* path = source_url + kFileUriPrefixLength; - struct stat info; - if (stat(path, &info) < 0) - return true; - - // If st_mtime is zero, it's more likely that the file system doesn't support - // mtime than that the file was actually modified in the 1970s. - if (!info.st_mtime) - return true; - - // It's very unclear what time bases we're with here. The Dart API doesn't - // document the time base for since_ms. Reading the code, the value varies by - // platform, with a typical source being something like gettimeofday. - // - // We add one to st_mtime because st_mtime has less precision than since_ms - // and we want to treat the file as modified if the since time is between - // ticks of the mtime. - fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); - fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); - - return mtime > since; -} - -void ThreadExitCallback() {} - -bool IsServiceIsolateURL(const char* url_name) { - return url_name != nullptr && - std::string(url_name) == DART_VM_SERVICE_ISOLATE_NAME; -} - -static bool StringEndsWith(const std::string& string, - const std::string& ending) { - if (ending.size() > string.size()) - return false; - - return string.compare(string.size() - ending.size(), ending.size(), ending) == - 0; -} - -static void ReleaseFetchedBytes(uint8_t* buffer) { - free(buffer); -} - -Dart_Isolate ServiceIsolateCreateCallback(const char* script_uri, - Dart_IsolateFlags* flags, - char** error) { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - // No VM-service in release mode. - return nullptr; -#else // FLUTTER_RUNTIME_MODE - UIDartState* dart_state = new UIDartState(nullptr, nullptr); - - bool is_running_from_kernel = GetKernelPlatformBinary() != nullptr; - - flags->load_vmservice_library = true; - Dart_Isolate isolate = - is_running_from_kernel - ? Dart_CreateIsolateFromKernel( - script_uri, "main", kernel_platform, flags, - static_cast(dart_state), error) - : Dart_CreateIsolate( - script_uri, "main", g_default_isolate_snapshot_data, - g_default_isolate_snapshot_instructions, flags, - static_cast(dart_state), error); - - FXL_CHECK(isolate) << error; - dart_state->set_debug_name_prefix(script_uri); - dart_state->SetIsolate(isolate); - FXL_CHECK(Dart_IsServiceIsolate(isolate)); - FXL_CHECK(!LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); - { - tonic::DartApiScope dart_api_scope; - DartIO::InitForIsolate(); - DartUI::InitForIsolate(); - DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); - const Settings& settings = Settings::Get(); - if (settings.enable_observatory) { - std::string ip = settings.ipv6 ? "::1" : "127.0.0.1"; - const intptr_t port = settings.observatory_port; - const bool disable_websocket_origin_check = false; - const bool service_isolate_booted = DartServiceIsolate::Startup( - ip, port, tonic::DartState::HandleLibraryTag, - !IsRunningPrecompiledCode() && !is_running_from_kernel, - disable_websocket_origin_check, error); - FXL_CHECK(service_isolate_booted) << error; - } - - if (g_service_isolate_hook) - g_service_isolate_hook(IsRunningPrecompiledCode()); - } - Dart_ExitIsolate(); - - g_service_isolate_initialized = true; - // Register any native service protocol extensions. - if (g_register_native_service_protocol_extensions_hook) { - g_register_native_service_protocol_extensions_hook( - IsRunningPrecompiledCode()); - } - return isolate; -#endif // FLUTTER_RUNTIME_MODE -} - -static bool GetAssetAsBuffer( - const std::string& name, - std::vector* data, - fxl::RefPtr& directory_asset_bundle, - fxl::RefPtr& asset_store) { - return (directory_asset_bundle && - directory_asset_bundle->GetAsBuffer(name, data)) || - (asset_store && asset_store->GetAsBuffer(name, data)); -} - -Dart_Isolate IsolateCreateCallback(const char* script_uri, - const char* main, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - void* callback_data, - char** error) { - TRACE_EVENT0("flutter", __func__); - - if (IsServiceIsolateURL(script_uri)) { - return ServiceIsolateCreateCallback(script_uri, flags, error); - } - - std::string entry_uri = script_uri; - // Are we running from a Dart source file? - const bool running_from_source = StringEndsWith(entry_uri, ".dart"); - - std::vector kernel_data; - std::vector snapshot_data; - std::string entry_path; - if (!IsRunningPrecompiledCode()) { - // Check that the entry script URI starts with file:// - if (entry_uri.find(kFileUriPrefix) != 0u) { - *error = strdup("Isolates must use file:// URIs"); - return nullptr; - } - // Entry script path (file:// is stripped). - entry_path = std::string(script_uri + strlen(kFileUriPrefix)); - if (StringEndsWith(entry_path, ".dill")) { - // Load the kernel from the script URI. - if (!files::ReadFileToVector(entry_path, &kernel_data)) { - FXL_LOG(ERROR) << "Failed to load kernel"; - } - } else if (!running_from_source) { - // Attempt to copy the snapshot or kernel from the asset bundle. - const std::string& bundle_path = entry_path; - - struct stat stat_result = {}; - if (::stat(bundle_path.c_str(), &stat_result) == 0) { - fxl::RefPtr directory_asset_bundle; - // TODO(zarah): Remove usage of zip_asset_store once app.flx is removed. - fxl::RefPtr zip_asset_store; - // bundle_path is either the path to app.flx or the flutter assets - // directory. - std::string flx_path = bundle_path; - if (S_ISDIR(stat_result.st_mode)) { - directory_asset_bundle = - fxl::MakeRefCounted(bundle_path); - flx_path = files::GetDirectoryName(bundle_path) + "/app.flx"; - } - - if (access(flx_path.c_str(), R_OK) == 0) { - zip_asset_store = fxl::MakeRefCounted( - GetUnzipperProviderForPath(flx_path)); - } - GetAssetAsBuffer(kKernelAssetKey, &kernel_data, directory_asset_bundle, - zip_asset_store); - GetAssetAsBuffer(kSnapshotAssetKey, &snapshot_data, - directory_asset_bundle, zip_asset_store); - } - } - } - - UIDartState* parent_dart_state = static_cast(callback_data); - UIDartState* dart_state = parent_dart_state->CreateForChildIsolate(); - - Dart_Isolate isolate = - kernel_platform != nullptr - ? Dart_CreateIsolateFromKernel(script_uri, main, kernel_platform, - nullptr /* flags */, dart_state, error) - : Dart_CreateIsolate(script_uri, main, - g_default_isolate_snapshot_data, - g_default_isolate_snapshot_instructions, nullptr, - dart_state, error); - FXL_CHECK(isolate) << error; - dart_state->set_debug_name_prefix(script_uri); - dart_state->SetIsolate(isolate); - FXL_CHECK(!LogIfError( - Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))); - - { - tonic::DartApiScope dart_api_scope; - DartIO::InitForIsolate(); - DartUI::InitForIsolate(); - DartRuntimeHooks::Install(DartRuntimeHooks::SecondaryIsolate, script_uri); - - std::unique_ptr ui_class_provider( - new DartClassProvider(dart_state, "dart:ui")); - dart_state->class_library().add_provider("ui", - std::move(ui_class_provider)); - - if (!kernel_data.empty()) { - // We are running kernel code. - FXL_CHECK(!LogIfError(Dart_LoadScriptFromKernel(kernel_data.data(), - kernel_data.size()))); - } else if (!snapshot_data.empty()) { - // We are running from a script snapshot. - FXL_CHECK(!LogIfError(Dart_LoadScriptFromSnapshot(snapshot_data.data(), - snapshot_data.size()))); - } else if (running_from_source) { - // We are running from source. - // Forward the .packages configuration from the parent isolate to the - // child isolate. - tonic::FileLoader& parent_loader = parent_dart_state->file_loader(); - const std::string& packages = parent_loader.packages(); - tonic::FileLoader& loader = dart_state->file_loader(); - if (!packages.empty() && !loader.LoadPackagesMap(packages)) { - FXL_LOG(WARNING) << "Failed to load package map: " << packages; - } - // Load the script. - FXL_CHECK(!LogIfError(loader.LoadScript(entry_path))); - } - - dart_state->isolate_client()->DidCreateSecondaryIsolate(isolate); - } - - Dart_ExitIsolate(); - - FXL_CHECK(Dart_IsolateMakeRunnable(isolate)); - return isolate; -} - -Dart_Handle GetVMServiceAssetsArchiveCallback() { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - return nullptr; -#elif OS(FUCHSIA) - std::vector observatory_assets_archive; - if (!files::ReadFileToVector("pkg/data/observatory.tar", - &observatory_assets_archive)) { - FXL_LOG(ERROR) << "Fail to load Observatory archive"; - return nullptr; - } - return tonic::DartConverter::ToDart( - observatory_assets_archive.data(), - observatory_assets_archive.size()); -#else - return tonic::DartConverter::ToDart( - ::dart::observatory::observatory_assets_archive, - ::dart::observatory::observatory_assets_archive_len); -#endif -} - -static const char kStdoutStreamId[] = "Stdout"; -static const char kStderrStreamId[] = "Stderr"; - -static bool ServiceStreamListenCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(true); - return true; - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(true); - return true; - } - return false; -} - -static void ServiceStreamCancelCallback(const char* stream_id) { - if (strcmp(stream_id, kStdoutStreamId) == 0) { - dart::bin::SetCaptureStdout(false); - } else if (strcmp(stream_id, kStderrStreamId) == 0) { - dart::bin::SetCaptureStderr(false); - } -} - -} // namespace - -bool IsRunningPrecompiledCode() { - return Dart_IsPrecompiledRuntime(); -} - -EmbedderTracingCallbacks* g_tracing_callbacks = nullptr; - -EmbedderTracingCallbacks::EmbedderTracingCallbacks( - EmbedderTracingCallback start, - EmbedderTracingCallback stop) - : start_tracing_callback(start), stop_tracing_callback(stop) {} - -void SetEmbedderTracingCallbacks( - std::unique_ptr callbacks) { - g_tracing_callbacks = callbacks.release(); -} - -static void EmbedderTimelineStartRecording() { - if (g_tracing_callbacks) - g_tracing_callbacks->start_tracing_callback(); -} - -static void EmbedderTimelineStopRecording() { - if (g_tracing_callbacks) - g_tracing_callbacks->stop_tracing_callback(); -} - -static std::vector ProfilingFlags(bool enable_profiling) { -// Disable Dart's built in profiler when building a debug build. This -// works around a race condition that would sometimes stop a crash's -// stack trace from being printed on Android. -#ifndef NDEBUG - enable_profiling = false; -#endif - - // We want to disable profiling by default because it overwhelms LLDB. But - // the VM enables the same by default. In either case, we have some profiling - // flags. - if (enable_profiling) { - return { - // This is the default. But just be explicit. - "--profiler", - // This instructs the profiler to walk C++ frames, and to include - // them in the profile. - "--profile-vm"}; - } else { - return {"--no-profiler"}; - } -} - -void SetServiceIsolateHook(ServiceIsolateHook hook) { - FXL_CHECK(!g_service_isolate_initialized); - g_service_isolate_hook = hook; -} - -void SetRegisterNativeServiceProtocolExtensionHook( - RegisterNativeServiceProtocolExtensionHook hook) { - FXL_CHECK(!g_service_isolate_initialized); - g_register_native_service_protocol_extensions_hook = hook; -} - -void PushBackAll(std::vector* args, - const char** argv, - size_t argc) { - for (size_t i = 0; i < argc; ++i) { - args->push_back(argv[i]); - } -} - -static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { - info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; - dart::bin::GetIOEmbedderInformation(info); - info->name = "Flutter"; -} - -void* GetKernelPlatformBinary() { - return kernel_platform; -} - -void InitDartVM(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path) { - TRACE_EVENT0("flutter", __func__); - - g_default_isolate_snapshot_data = default_isolate_snapshot_data; - g_default_isolate_snapshot_instructions = - default_isolate_snapshot_instructions; - - const Settings& settings = Settings::Get(); - - { - TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); - dart::bin::BootstrapDartIo(); - - if (!settings.temp_directory_path.empty()) { - dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); - } - } - - std::vector args; - - // Instruct the VM to ignore unrecognized flags. - // There is a lot of diversity in a lot of combinations when it - // comes to the arguments the VM supports. And, if the VM comes across a flag - // it does not recognize, it exits immediately. - args.push_back("--ignore-unrecognized-flags"); - - for (const auto& profiler_flag : - ProfilingFlags(settings.enable_dart_profiling)) { - args.push_back(profiler_flag); - } - - PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); - - if (IsRunningPrecompiledCode()) { - PushBackAll(&args, kDartPrecompilationArgs, - arraysize(kDartPrecompilationArgs)); - } - -#if defined(OS_FUCHSIA) -#if defined(NDEBUG) - // Do not enable checked mode for Fuchsia release builds - // TODO(mikejurka): remove this once precompiled code is working on Fuchsia - const bool use_checked_mode = false; -#else // !defined(NDEBUG) - const bool use_checked_mode = true; -#endif // !defined(NDEBUG) -#else // !defined(OS_FUCHSIA) - // Enable checked mode if we are not running precompiled code. We run non- - // precompiled code only in the debug product mode. - const bool use_checked_mode = - !IsRunningPrecompiledCode() && !settings.dart_non_checked_mode; -#endif // !defined(OS_FUCHSIA) - -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - // Debug mode uses the JIT, disable code page write protection to avoid - // memory page protection changes before and after every compilation. - PushBackAll(&args, kDartWriteProtectCodeArgs, - arraysize(kDartWriteProtectCodeArgs)); -#endif - - if (settings.start_paused) - PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); - - if (settings.endless_trace_buffer || settings.trace_startup) { - // If we are tracing startup, make sure the trace buffer is endless so we - // don't lose early traces. - PushBackAll(&args, kDartEndlessTraceBufferArgs, - arraysize(kDartEndlessTraceBufferArgs)); - } - - if (settings.trace_startup) { - PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); - } - -#if defined(OS_FUCHSIA) - PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); -#endif - - if (!bundle_path.empty()) { - fxl::RefPtr directory_asset_bundle = - fxl::MakeRefCounted( - std::move(bundle_path)); - directory_asset_bundle->GetAsBuffer(kPlatformKernelAssetKey, - &platform_data); - if (!platform_data.empty()) { - uint8_t* kernel_buf = static_cast(malloc(platform_data.size())); - memcpy(kernel_buf, platform_data.data(), platform_data.size()); - kernel_platform = Dart_ReadKernelBinary(kernel_buf, platform_data.size(), - ReleaseFetchedBytes); - FXL_DCHECK(kernel_platform != nullptr); - } - } - if ((kernel_platform != nullptr) || - Dart_IsDart2Snapshot(g_default_isolate_snapshot_data)) { - // The presence of the kernel platform file or a snapshot that was generated - // for Dart2 indicates we are running in preview-dart-2 mode and in this - // mode enable strong mode options by default. - // Note: When we start using core snapshots instead of the platform file - // in the engine just sniffing the snapshot file should be sufficient. - PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); - // In addition if we are running in debug mode we also enable asserts. - if (use_checked_mode) { - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - } - } else if (use_checked_mode) { - // In non preview-dart-2 mode we enable checked mode and asserts if - // we are running in debug mode. - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); - } - - for (size_t i = 0; i < settings.dart_flags.size(); i++) - args.push_back(settings.dart_flags[i].c_str()); - - FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); - - DartUI::InitForGlobal(); - - // Setup embedder tracing hooks. To avoid data races, it is recommended that - // these hooks be installed before the DartInitialize, so do that setup now. - Dart_SetEmbedderTimelineCallbacks(&EmbedderTimelineStartRecording, - &EmbedderTimelineStopRecording); - - Dart_SetFileModifiedCallback(&DartFileModifiedCallback); - - { - TRACE_EVENT0("flutter", "Dart_Initialize"); - Dart_InitializeParams params = {}; - params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; - params.vm_snapshot_data = vm_snapshot_data; - params.vm_snapshot_instructions = vm_snapshot_instructions; - params.create = IsolateCreateCallback; - params.shutdown = IsolateShutdownCallback; - params.cleanup = IsolateCleanupCallback; - params.thread_exit = ThreadExitCallback; - params.get_service_assets = GetVMServiceAssetsArchiveCallback; - params.entropy_source = DartIO::EntropySource; - char* init_error = Dart_Initialize(¶ms); - if (init_error != nullptr) - FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; - free(init_error); - - // Send the earliest available timestamp in the application lifecycle to - // timeline. The difference between this timestamp and the time we render - // the very first frame gives us a good idea about Flutter's startup time. - // Use a duration event so about:tracing will consider this event when - // deciding the earliest event to use as time 0. - if (blink::engine_main_enter_ts != 0) { - Dart_TimelineEvent("FlutterEngineMainEnter", // label - blink::engine_main_enter_ts, // timestamp0 - blink::engine_main_enter_ts, // timestamp1_or_async_id - Dart_Timeline_Event_Duration, // event type - 0, // argument_count - nullptr, // argument_names - nullptr // argument_values - ); - } - } - - // Allow streaming of stdout and stderr by the Dart vm. - Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, - &ServiceStreamCancelCallback); - - Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); -} - -} // namespace blink diff --git a/runtime/dart_init.h b/runtime/dart_init.h deleted file mode 100644 index 99c8fe89137e3..0000000000000 --- a/runtime/dart_init.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2015 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. - -#ifndef FLUTTER_RUNTIME_DART_INIT_H_ -#define FLUTTER_RUNTIME_DART_INIT_H_ - -#include "lib/fxl/build_config.h" -#include "lib/fxl/functional/closure.h" -#include "third_party/dart/runtime/include/dart_api.h" - -#include -#include -#include - -namespace blink { - -// Name of the kernel blob asset within the asset directory. -extern const char kKernelAssetKey[]; - -// Name of the snapshot blob asset within the asset directory. -extern const char kSnapshotAssetKey[]; - -// Name of the platform kernel blob asset within the asset directory. -extern const char kPlatformKernelAssetKey[]; - -bool IsRunningPrecompiledCode(); - -using EmbedderTracingCallback = fxl::Closure; - -typedef void (*ServiceIsolateHook)(bool); -typedef void (*RegisterNativeServiceProtocolExtensionHook)(bool); - -struct EmbedderTracingCallbacks { - EmbedderTracingCallback start_tracing_callback; - EmbedderTracingCallback stop_tracing_callback; - - EmbedderTracingCallbacks(EmbedderTracingCallback start, - EmbedderTracingCallback stop); -}; - -void InitDartVM(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path); - -void* GetKernelPlatformBinary(); - -void SetEmbedderTracingCallbacks( - std::unique_ptr callbacks); - -// Provide a function that will be called during initialization of the -// service isolate. -void SetServiceIsolateHook(ServiceIsolateHook hook); - -// Provide a function that will be called to register native service protocol -// extensions. -void SetRegisterNativeServiceProtocolExtensionHook( - RegisterNativeServiceProtocolExtensionHook hook); - -} // namespace blink - -#endif // FLUTTER_RUNTIME_DART_INIT_H_ diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc new file mode 100644 index 0000000000000..6d69ab7fc5aeb --- /dev/null +++ b/runtime/dart_isolate.cc @@ -0,0 +1,690 @@ +// Copyright 2017 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/runtime/dart_isolate.h" + +#include +#include + +#include "flutter/fml/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/runtime/dart_vm.h" +#include "lib/fxl/files/path.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_class_provider.h" +#include "lib/tonic/dart_message_handler.h" +#include "lib/tonic/dart_state.h" +#include "lib/tonic/dart_sticky_error.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/scopes/dart_isolate_scope.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace blink { + +fml::WeakPtr DartIsolate::CreateRootIsolate( + const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + std::unique_ptr window, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, + Dart_IsolateFlags* flags) { + TRACE_EVENT0("flutter", "DartIsolate::CreateRootIsolate"); + Dart_Isolate vm_isolate = nullptr; + fml::WeakPtr embedder_isolate; + + char* error = nullptr; + + // Since this is the root isolate, we fake a parent embedder data object. We + // cannot use unique_ptr here because the destructor is private (since the + // isolate lifecycle is entirely managed by the VM). + auto root_embedder_data = std::make_unique( + vm, // VM + std::move(isolate_snapshot), // isolate snapshot + task_runners, // task runners + std::move(resource_context), // resource context + std::move(unref_queue), // skia unref queue + advisory_script_uri, // advisory URI + advisory_script_entrypoint // advisory entrypoint + ); + + std::tie(vm_isolate, embedder_isolate) = CreateDartVMAndEmbedderObjectPair( + advisory_script_uri.c_str(), // advisory script URI + advisory_script_entrypoint.c_str(), // advisory script entrypoint + nullptr, // package root + nullptr, // package config + flags, // flags + root_embedder_data.get(), // parent embedder data + true, // is root isolate + &error // error (out) + ); + + if (error != nullptr) { + free(error); + } + + if (vm_isolate == nullptr) { + return {}; + } + + if (embedder_isolate) { + // Only root isolates can interact with windows. + embedder_isolate->SetWindow(std::move(window)); + embedder_isolate->set_use_blink(vm->GetSettings().using_blink); + } + + return embedder_isolate; +} + +DartIsolate::DartIsolate(const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint) + : UIDartState(std::move(task_runners), + vm->GetSettings().task_observer_add, + vm->GetSettings().task_observer_remove, + std::move(resource_context), + std::move(unref_queue), + advisory_script_uri, + advisory_script_entrypoint, + vm->GetSettings().log_tag), + vm_(vm), + isolate_snapshot_(std::move(isolate_snapshot)), + weak_factory_(this) { + FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; + weak_prototype_ = weak_factory_.GetWeakPtr(); + + if (vm_ == nullptr) { + return; + } + + phase_ = Phase::Uninitialized; +} + +DartIsolate::~DartIsolate() = default; + +DartIsolate::Phase DartIsolate::GetPhase() const { + return phase_; +} + +const DartVM* DartIsolate::GetDartVM() const { + return vm_; +} + +bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { + TRACE_EVENT0("flutter", "DartIsolate::Initialize"); + if (phase_ != Phase::Uninitialized) { + return false; + } + + if (dart_isolate == nullptr) { + return false; + } + + if (Dart_CurrentIsolate() != dart_isolate) { + return false; + } + + if (Dart_IsolateData(dart_isolate) != this) { + return false; + } + + // After this point, isolate scopes can be safely used. + SetIsolate(dart_isolate); + + // We are entering a new scope (for the first time since initialization) and + // we want to restore the current scope to null when we exit out of this + // method. This balances the implicit Dart_EnterIsolate call made by + // Dart_CreateIsolate (which calls the Initialize). + Dart_ExitIsolate(); + + tonic::DartIsolateScope scope(isolate()); + + if (is_root_isolate) { + if (auto task_runner = GetTaskRunners().GetUITaskRunner()) { + // Isolates may not have any particular thread affinity. Only initialize + // the message handler if a task runner is explicitly specified. + message_handler().Initialize(task_runner); + } + } + + if (tonic::LogIfError( + Dart_SetLibraryTagHandler(tonic::DartState::HandleLibraryTag))) { + return false; + } + + if (!UpdateThreadPoolNames()) { + return false; + } + + phase_ = Phase::Initialized; + return true; +} + +// Updating thread names here does not change the underlying OS thread names. +// Instead, this is just additional metadata for the Observatory to show the +// thread name of the isolate. +bool DartIsolate::UpdateThreadPoolNames() const { + // TODO(chinmaygarde): This implementation does not account for multiple + // shells sharing the same (or subset of) threads. + const auto& task_runners = GetTaskRunners(); + + if (auto task_runner = task_runners.GetGPUTaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".gpu"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + if (auto task_runner = task_runners.GetUITaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".ui"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + if (auto task_runner = task_runners.GetIOTaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".io"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + if (auto task_runner = task_runners.GetPlatformTaskRunner()) { + task_runner->PostTask( + [label = task_runners.GetLabel() + std::string{".platform"}]() { + Dart_SetThreadName(label.c_str()); + }); + } + + return true; +} + +bool DartIsolate::LoadLibraries() { + TRACE_EVENT0("flutter", "DartIsolate::LoadLibraries"); + if (phase_ != Phase::Initialized) { + return false; + } + + tonic::DartState::Scope scope(this); + + DartIO::InitForIsolate(); + + DartUI::InitForIsolate(); + + const bool is_service_isolate = Dart_IsServiceIsolate(isolate()); + + DartRuntimeHooks::Install(is_service_isolate + ? DartRuntimeHooks::SecondaryIsolate + : DartRuntimeHooks::MainIsolate, + GetAdvisoryScriptURI()); + + if (!is_service_isolate) { + class_library().add_provider( + "ui", std::make_unique(this, "dart:ui")); + } + + phase_ = Phase::LibrariesSetup; + return true; +} + +bool DartIsolate::PrepareForRunningFromPrecompiledCode() { + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromPrecompiledCode"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + if (!DartVM::IsRunningPrecompiledCode()) { + return false; + } + + tonic::DartState::Scope scope(this); + + if (Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!MarkIsolateRunnable()) { + return false; + } + + phase_ = Phase::Ready; + return true; +} + +static bool LoadScriptSnapshot(std::unique_ptr mapping) { + if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), + mapping->GetSize()))) { + return false; + } + return true; +} + +static bool LoadKernelSnapshot(std::unique_ptr mapping) { + if (tonic::LogIfError(Dart_LoadScriptFromKernel(mapping->GetMapping(), + mapping->GetSize()))) { + return false; + } + + return true; +} + +static bool LoadSnapshot(std::unique_ptr mapping, + bool is_kernel) { + if (is_kernel) { + return LoadKernelSnapshot(std::move(mapping)); + } else { + return LoadScriptSnapshot(std::move(mapping)); + } + return false; +} + +FXL_WARN_UNUSED_RESULT +bool DartIsolate::PrepareForRunningFromSnapshot( + std::unique_ptr mapping) { + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSnapshot"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + if (DartVM::IsRunningPrecompiledCode()) { + return false; + } + + if (!mapping || mapping->GetSize() == 0) { + return false; + } + + tonic::DartState::Scope scope(this); + + if (!Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!LoadSnapshot(std::move(mapping), vm_->GetPlatformKernel() != nullptr)) { + return false; + } + + if (Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!MarkIsolateRunnable()) { + return false; + } + + phase_ = Phase::Ready; + return true; +} + +bool DartIsolate::PrepareForRunningFromSource( + const std::string& main_source_file, + const std::string& packages) { + TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSource"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + if (DartVM::IsRunningPrecompiledCode()) { + return false; + } + + if (main_source_file.empty()) { + return false; + } + + tonic::DartState::Scope scope(this); + + if (!Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + auto& loader = file_loader(); + + if (!packages.empty()) { + auto packages_absolute_path = files::AbsolutePath(packages); + FXL_DLOG(INFO) << "Loading from packages: " << packages_absolute_path; + if (!loader.LoadPackagesMap(packages_absolute_path)) { + return false; + } + } + + auto main_source_absolute_path = files::AbsolutePath(main_source_file); + FXL_DLOG(INFO) << "Loading from source: " << main_source_absolute_path; + + if (tonic::LogIfError(loader.LoadScript(main_source_absolute_path))) { + return false; + } + + if (Dart_IsNull(Dart_RootLibrary())) { + return false; + } + + if (!MarkIsolateRunnable()) { + return false; + } + + phase_ = Phase::Ready; + return true; +} + +bool DartIsolate::MarkIsolateRunnable() { + TRACE_EVENT0("flutter", "DartIsolate::MarkIsolateRunnable"); + if (phase_ != Phase::LibrariesSetup) { + return false; + } + + // This function may only be called from an active isolate scope. + if (Dart_CurrentIsolate() != isolate()) { + return false; + } + + // There must be no current isolate to mark an isolate as being runnable. + Dart_ExitIsolate(); + + if (!Dart_IsolateMakeRunnable(isolate())) { + // Failed. Restore the isolate. + Dart_EnterIsolate(isolate()); + return false; + } + // Success. Restore the isolate. + Dart_EnterIsolate(isolate()); + return true; +} + +FXL_WARN_UNUSED_RESULT +bool DartIsolate::Run(const std::string& entrypoint_name) { + TRACE_EVENT0("flutter", "DartIsolate::Run"); + if (phase_ != Phase::Ready) { + return false; + } + + tonic::DartState::Scope scope(this); + + Dart_Handle entrypoint = Dart_GetClosure( + Dart_RootLibrary(), tonic::ToDart(entrypoint_name.c_str())); + if (tonic::LogIfError(entrypoint)) { + return false; + } + + Dart_Handle isolate_lib = Dart_LookupLibrary(tonic::ToDart("dart:isolate")); + if (tonic::LogIfError(isolate_lib)) { + return false; + } + + Dart_Handle isolate_args[] = { + entrypoint, + Dart_Null(), + }; + + if (tonic::LogIfError(Dart_Invoke( + isolate_lib, tonic::ToDart("_startMainIsolate"), + sizeof(isolate_args) / sizeof(isolate_args[0]), isolate_args))) { + return false; + } + + phase_ = Phase::Running; + return true; +} + +bool DartIsolate::Shutdown() { + TRACE_EVENT0("flutter", "DartIsolate::Shutdown"); + // This call may be re-entrant since Dart_ShutdownIsolate can invoke the + // cleanup callback which deletes the embedder side object of the dart isolate + // (a.k.a. this). + if (phase_ == Phase::Shutdown) { + return false; + } + phase_ = Phase::Shutdown; + Dart_Isolate vm_isolate = isolate(); + // The isolate can be nullptr if this instance is the stub isolate data used + // during root isolate creation. + if (vm_isolate != nullptr) { + // We need to enter the isolate because Dart_ShutdownIsolate does not take + // the isolate to shutdown as a parameter. + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + Dart_EnterIsolate(vm_isolate); + Dart_ShutdownIsolate(); + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + } + return true; +} + +static Dart_Isolate DartCreateAndStartServiceIsolate( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + char** error) { + auto vm = DartVM::ForProcessIfInitialized(); + + if (!vm) { + *error = strdup( + "Could not resolve the VM when attempting to create the service " + "isolate."); + return nullptr; + } + + const auto& settings = vm->GetSettings(); + + if (!settings.enable_observatory) { + FXL_DLOG(INFO) << "Observatory is disabled."; + return nullptr; + } + + blink::TaskRunners null_task_runners( + "io.flutter." DART_VM_SERVICE_ISOLATE_NAME, nullptr, nullptr, nullptr, + nullptr); + + flags->load_vmservice_library = true; + + auto service_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + null_task_runners, // task runners + nullptr, // window + {}, // resource context + {}, // unref queue + advisory_script_uri == nullptr ? "" : advisory_script_uri, // script uri + advisory_script_entrypoint == nullptr + ? "" + : advisory_script_entrypoint, // script entrypoint + flags // flags + ); + + if (!service_isolate) { + *error = strdup("Could not create the service isolate."); + FXL_DLOG(ERROR) << *error; + return nullptr; + } + + // The engine never holds a strong reference to the VM service isolate. Since + // we are about to lose our last weak reference to it, start the VM service + // while we have this reference. + + const bool running_from_sources = + !DartVM::IsRunningPrecompiledCode() && vm->GetPlatformKernel() == nullptr; + + tonic::DartState::Scope scope(service_isolate.get()); + if (!DartServiceIsolate::Startup( + settings.ipv6 ? "::1" : "127.0.0.1", // server IP address + settings.observatory_port, // server observatory port + tonic::DartState::HandleLibraryTag, // embedder library tag handler + running_from_sources, // running from source code + false, // disable websocket origin check + error // error (out) + )) { + // Error is populated by call to startup. + FXL_DLOG(ERROR) << *error; + return nullptr; + } + + vm->GetServiceProtocol().ToggleHooks(true); + + return service_isolate->isolate(); +} + +// |Dart_IsolateCreateCallback| +Dart_Isolate DartIsolate::DartIsolateCreateCallback( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* parent_embedder_isolate, + char** error) { + if (parent_embedder_isolate == nullptr && + strcmp(advisory_script_uri, DART_VM_SERVICE_ISOLATE_NAME) == 0) { + // The VM attempts to start the VM service for us on |Dart_Initialize|. In + // such a case, the callback data will be null and the script URI will be + // DART_VM_SERVICE_ISOLATE_NAME. In such cases, we just create the service + // isolate like normal but dont hold a reference to it at all. We also start + // this isolate since we will never again reference it from the engine. + return DartCreateAndStartServiceIsolate(advisory_script_uri, // + advisory_script_entrypoint, // + package_root, // + package_config, // + flags, // + error // + ); + } + + return CreateDartVMAndEmbedderObjectPair( + advisory_script_uri, // URI + advisory_script_entrypoint, // entrypoint + package_root, // package root + package_config, // package config + flags, // isolate flags + parent_embedder_isolate, // embedder data + false, // is root isolate + error // error + ) + .first; +} + +std::pair> +DartIsolate::CreateDartVMAndEmbedderObjectPair( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* parent_embedder_isolate, + bool is_root_isolate, + char** error) { + TRACE_EVENT0("flutter", "DartIsolate::CreateDartVMAndEmbedderObjectPair"); + if (parent_embedder_isolate == nullptr || + parent_embedder_isolate->GetDartVM() == nullptr) { + *error = + strdup("Parent isolate did not have embedder specific callback data."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + const DartVM* vm = parent_embedder_isolate->GetDartVM(); + + // Create the native object on the embedder side. This object is deleted in + // the cleanup callback. + auto embedder_isolate = std::make_unique( + vm, // + parent_embedder_isolate->GetIsolateSnapshot(), // + parent_embedder_isolate->GetTaskRunners(), // + parent_embedder_isolate->GetResourceContext(), // + parent_embedder_isolate->GetSkiaUnrefQueue(), // + advisory_script_uri, // + advisory_script_entrypoint // + ); + + // Create the Dart VM isolate and give it the embedder object as the baton. + Dart_Isolate isolate = + vm->GetPlatformKernel() != nullptr + ? Dart_CreateIsolateFromKernel(advisory_script_uri, // + advisory_script_entrypoint, // + vm->GetPlatformKernel(), // + flags, // + embedder_isolate.get(), // + error // + ) + : Dart_CreateIsolate(advisory_script_uri, // + advisory_script_entrypoint, // + embedder_isolate->GetIsolateSnapshot() + ->GetData() + ->GetSnapshotPointer(), // + embedder_isolate->GetIsolateSnapshot() + ->GetInstructionsIfPresent(), // + flags, // + embedder_isolate.get(), // + error // + ); + + if (isolate == nullptr) { + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + if (!embedder_isolate->Initialize(isolate, is_root_isolate)) { + *error = strdup("Embedder could not initialize the Dart isolate."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + if (!embedder_isolate->LoadLibraries()) { + *error = + strdup("Embedder could not load libraries in the new Dart isolate."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + + // The ownership of the embedder object is controlled by the Dart VM. So the + // only reference returned to the caller is weak. + return {isolate, embedder_isolate.release()->GetWeakIsolatePtr()}; +} + +// |Dart_IsolateShutdownCallback| +void DartIsolate::DartIsolateShutdownCallback(DartIsolate* embedder_isolate) { + if (!tonic::DartStickyError::IsSet()) { + return; + } + + tonic::DartApiScope api_scope; + FXL_LOG(ERROR) << "Isolate " << tonic::StdStringFromDart(Dart_DebugName()) + << " exited with an error"; + Dart_Handle sticky_error = Dart_GetStickyError(); + FXL_CHECK(tonic::LogIfError(sticky_error)); +} + +// |Dart_IsolateCleanupCallback| +void DartIsolate::DartIsolateCleanupCallback(DartIsolate* embedder_isolate) { + delete embedder_isolate; +} + +fxl::RefPtr DartIsolate::GetIsolateSnapshot() const { + return isolate_snapshot_; +} + +fml::WeakPtr DartIsolate::GetWeakIsolatePtr() const { + return weak_prototype_; +} + +void DartIsolate::AddIsolateShutdownCallback(fxl::Closure closure) { + shutdown_callbacks_.emplace_back( + std::make_unique(std::move(closure))); +} + +} // namespace blink diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h new file mode 100644 index 0000000000000..13d573ebe333f --- /dev/null +++ b/runtime/dart_isolate.h @@ -0,0 +1,152 @@ +// Copyright 2017 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_RUNTIME_DART_ISOLATE_H_ +#define FLUTTER_RUNTIME_DART_ISOLATE_H_ + +#include +#include + +#include "flutter/common/task_runners.h" +#include "flutter/fml/mapping.h" +#include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_snapshot.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/macros.h" +#include "lib/tonic/dart_state.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace blink { +class DartVM; + +class DartIsolate : public UIDartState { + public: + enum class Phase { + Unknown, + Uninitialized, + Initialized, + LibrariesSetup, + Ready, + Running, + Shutdown, + }; + + // The root isolate of a Flutter application is special because it gets Window + // bindings. From the VM's perspective, this isolate is not special in any + // way. + static fml::WeakPtr CreateRootIsolate( + const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + std::unique_ptr window, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri = "main.dart", + std::string advisory_script_entrypoint = "main", + Dart_IsolateFlags* flags = nullptr); + + DartIsolate(const DartVM* vm, + fxl::RefPtr isolate_snapshot, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint); + + ~DartIsolate() override; + + Phase GetPhase() const; + + FXL_WARN_UNUSED_RESULT + bool PrepareForRunningFromPrecompiledCode(); + + FXL_WARN_UNUSED_RESULT + bool PrepareForRunningFromSnapshot(std::unique_ptr snapshot); + + FXL_WARN_UNUSED_RESULT + bool PrepareForRunningFromSource(const std::string& main_source_file, + const std::string& packages); + + FXL_WARN_UNUSED_RESULT + bool Run(const std::string& entrypoint); + + FXL_WARN_UNUSED_RESULT + bool Shutdown(); + + void AddIsolateShutdownCallback(fxl::Closure closure); + + const DartVM* GetDartVM() const; + + fxl::RefPtr GetIsolateSnapshot() const; + + fml::WeakPtr GetWeakIsolatePtr() const; + + private: + class AutoFireClosure { + public: + AutoFireClosure(fxl::Closure closure) : closure_(std::move(closure)) {} + ~AutoFireClosure() { + if (closure_) { + closure_(); + } + } + + private: + fxl::Closure closure_; + FXL_DISALLOW_COPY_AND_ASSIGN(AutoFireClosure); + }; + friend class DartVM; + + const DartVM* vm_ = nullptr; + Phase phase_ = Phase::Unknown; + const fxl::RefPtr isolate_snapshot_; + std::vector> shutdown_callbacks_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + FXL_WARN_UNUSED_RESULT + bool Initialize(Dart_Isolate isolate, bool is_root_isolate); + + FXL_WARN_UNUSED_RESULT + bool LoadLibraries(); + + bool UpdateThreadPoolNames() const; + + FXL_WARN_UNUSED_RESULT + bool MarkIsolateRunnable(); + + // |Dart_IsolateCreateCallback| + static Dart_Isolate DartIsolateCreateCallback( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* embedder_isolate, + char** error); + + static std::pair /* embedder */> + CreateDartVMAndEmbedderObjectPair(const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + DartIsolate* parent_embedder_isolate, + bool is_root_isolate, + char** error); + + // |Dart_IsolateShutdownCallback| + static void DartIsolateShutdownCallback(DartIsolate* embedder_isolate); + + // |Dart_IsolateCleanupCallback| + static void DartIsolateCleanupCallback(DartIsolate* embedder_isolate); + + FXL_DISALLOW_COPY_AND_ASSIGN(DartIsolate); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_ISOLATE_H_ diff --git a/runtime/dart_isolate_unittests.cc b/runtime/dart_isolate_unittests.cc new file mode 100644 index 0000000000000..d8f2e02382da1 --- /dev/null +++ b/runtime/dart_isolate_unittests.cc @@ -0,0 +1,103 @@ +// Copyright 2017 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/thread.h" +#include "flutter/runtime/dart_isolate.h" +#include "flutter/runtime/dart_vm.h" +#include "flutter/testing/testing.h" +#include "flutter/testing/thread_test.h" + +#define CURRENT_TEST_NAME \ + std::string { \ + ::testing::UnitTest::GetInstance()->current_test_info()->name() \ + } + +namespace blink { + +using DartIsolateTest = ::testing::ThreadTest; + +TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + TaskRunners task_runners(CURRENT_TEST_NAME, // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner() // + ); + auto root_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + std::move(task_runners), // task runners + nullptr, // window + {}, // resource context + nullptr // unref qeueue + ); + ASSERT_TRUE(root_isolate); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); + ASSERT_TRUE(root_isolate->Shutdown()); +} + +TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + TaskRunners task_runners(CURRENT_TEST_NAME, // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner() // + ); + auto root_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + std::move(task_runners), // task runners + nullptr, // window + {}, // resource context + nullptr // unref qeueue + ); + ASSERT_TRUE(root_isolate); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); + ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( + testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); + ASSERT_TRUE(root_isolate->Shutdown()); +} + +TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + TaskRunners task_runners(CURRENT_TEST_NAME, // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner(), // + GetCurrentTaskRunner() // + ); + auto root_isolate = DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + std::move(task_runners), // task runners + nullptr, // window + {}, // resource context + nullptr // unref qeueue + ); + ASSERT_TRUE(root_isolate); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); + ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( + testing::GetFixturesPath() + std::string{"/simple_main.dart"}, "")); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Ready); + ASSERT_TRUE(root_isolate->Run("simple_main")); + ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::Running); + ASSERT_TRUE(root_isolate->Shutdown()); +} + +} // namespace blink diff --git a/runtime/dart_service_isolate.h b/runtime/dart_service_isolate.h index 9edd663feb6bd..59a02e2e9d495 100644 --- a/runtime/dart_service_isolate.h +++ b/runtime/dart_service_isolate.h @@ -13,8 +13,6 @@ namespace blink { class DartServiceIsolate { public: - static bool Bootstrap(); - static bool Startup(std::string server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc new file mode 100644 index 0000000000000..5d759257d1d4b --- /dev/null +++ b/runtime/dart_snapshot.cc @@ -0,0 +1,159 @@ +// Copyright 2017 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/runtime/dart_snapshot.h" + +#include + +#include "flutter/fml/native_library.h" +#include "flutter/fml/paths.h" +#include "flutter/fml/trace_event.h" +#include "flutter/runtime/dart_snapshot_buffer.h" +#include "flutter/runtime/dart_vm.h" + +namespace blink { + +const char* DartSnapshot::kVMDataSymbol = "kDartVmSnapshotData"; +const char* DartSnapshot::kVMInstructionsSymbol = "kDartVmSnapshotInstructions"; +const char* DartSnapshot::kIsolateDataSymbol = "kDartIsolateSnapshotData"; +const char* DartSnapshot::kIsolateInstructionsSymbol = + "kDartIsolateSnapshotInstructions"; + +static std::unique_ptr ResolveVMData( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = fml::paths::JoinPaths( + {settings.aot_snapshot_path, settings.aot_vm_snapshot_data_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), false /* executable */)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kVMDataSymbol); +} + +static std::unique_ptr ResolveVMInstructions( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = fml::paths::JoinPaths( + {settings.aot_snapshot_path, settings.aot_vm_snapshot_instr_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), true /* executable */)) { + return source; + } + } + + if (settings.application_library_path.size() > 0) { + auto library = + fml::NativeLibrary::Create(settings.application_library_path.c_str()); + if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( + library, DartSnapshot::kVMInstructionsSymbol)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kVMInstructionsSymbol); +} + +static std::unique_ptr ResolveIsolateData( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = + fml::paths::JoinPaths({settings.aot_snapshot_path, + settings.aot_isolate_snapshot_data_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), false /* executable */)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kIsolateDataSymbol); +} + +static std::unique_ptr ResolveIsolateInstructions( + const Settings& settings) { + if (settings.aot_snapshot_path.size() > 0) { + auto path = + fml::paths::JoinPaths({settings.aot_snapshot_path, + settings.aot_isolate_snapshot_instr_filename}); + if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( + path.c_str(), true /* executable */)) { + return source; + } + } + + if (settings.application_library_path.size() > 0) { + auto library = + fml::NativeLibrary::Create(settings.application_library_path.c_str()); + if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( + library, DartSnapshot::kIsolateInstructionsSymbol)) { + return source; + } + } + + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); + return DartSnapshotBuffer::CreateWithSymbolInLibrary( + loaded_process, DartSnapshot::kIsolateInstructionsSymbol); +} + +fxl::RefPtr DartSnapshot::VMSnapshotFromSettings( + const Settings& settings) { + TRACE_EVENT0("flutter", "DartSnapshot::VMSnapshotFromSettings"); + auto snapshot = + fxl::MakeRefCounted(ResolveVMData(settings), // + ResolveVMInstructions(settings) // + ); + if (snapshot->IsValid()) { + return snapshot; + } + return nullptr; +} + +fxl::RefPtr DartSnapshot::IsolateSnapshotFromSettings( + const Settings& settings) { + TRACE_EVENT0("flutter", "DartSnapshot::IsolateSnapshotFromSettings"); + auto snapshot = + fxl::MakeRefCounted(ResolveIsolateData(settings), // + ResolveIsolateInstructions(settings) // + ); + if (snapshot->IsValid()) { + return snapshot; + } + return nullptr; +} + +DartSnapshot::DartSnapshot(std::unique_ptr data, + std::unique_ptr instructions) + : data_(std::move(data)), instructions_(std::move(instructions)) {} + +DartSnapshot::~DartSnapshot() = default; + +bool DartSnapshot::IsValid() const { + return static_cast(data_); +} + +bool DartSnapshot::IsValidForAOT() const { + return data_ && instructions_; +} + +const DartSnapshotBuffer* DartSnapshot::GetData() const { + return data_.get(); +} + +const DartSnapshotBuffer* DartSnapshot::GetInstructions() const { + return instructions_.get(); +} + +const uint8_t* DartSnapshot::GetInstructionsIfPresent() const { + return instructions_ ? instructions_->GetSnapshotPointer() : nullptr; +} + +} // namespace blink diff --git a/runtime/dart_snapshot.h b/runtime/dart_snapshot.h new file mode 100644 index 0000000000000..4f04765b4f5a9 --- /dev/null +++ b/runtime/dart_snapshot.h @@ -0,0 +1,57 @@ +// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_H_ +#define FLUTTER_RUNTIME_DART_SNAPSHOT_H_ + +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/runtime/dart_snapshot_buffer.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" + +namespace blink { + +class DartSnapshot : public fxl::RefCountedThreadSafe { + public: + static const char* kVMDataSymbol; + static const char* kVMInstructionsSymbol; + static const char* kIsolateDataSymbol; + static const char* kIsolateInstructionsSymbol; + + static fxl::RefPtr VMSnapshotFromSettings( + const Settings& settings); + + static fxl::RefPtr IsolateSnapshotFromSettings( + const Settings& settings); + + bool IsValid() const; + + bool IsValidForAOT() const; + + const DartSnapshotBuffer* GetData() const; + + const DartSnapshotBuffer* GetInstructions() const; + + const uint8_t* GetInstructionsIfPresent() const; + + private: + std::unique_ptr data_; + std::unique_ptr instructions_; + + DartSnapshot(std::unique_ptr data, + std::unique_ptr instructions); + + ~DartSnapshot(); + + FRIEND_REF_COUNTED_THREAD_SAFE(DartSnapshot); + FRIEND_MAKE_REF_COUNTED(DartSnapshot); + FXL_DISALLOW_COPY_AND_ASSIGN(DartSnapshot); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_H_ diff --git a/runtime/dart_snapshot_buffer.cc b/runtime/dart_snapshot_buffer.cc new file mode 100644 index 0000000000000..c39233ac8334a --- /dev/null +++ b/runtime/dart_snapshot_buffer.cc @@ -0,0 +1,72 @@ +// Copyright 2017 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/runtime/dart_snapshot_buffer.h" + +#include + +#include "flutter/fml/mapping.h" + +namespace blink { + +class NativeLibrarySnapshotBuffer final : public DartSnapshotBuffer { + public: + NativeLibrarySnapshotBuffer(fxl::RefPtr library, + const char* symbol_name) + : library_(std::move(library)) { + if (library_) { + symbol_ = library_->ResolveSymbol(symbol_name); + } + } + + const uint8_t* GetSnapshotPointer() const override { return symbol_; } + + size_t GetSnapshotSize() const override { return 0; } + + private: + fxl::RefPtr library_; + const uint8_t* symbol_ = nullptr; + + FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrarySnapshotBuffer); +}; + +class FileSnapshotBuffer final : public DartSnapshotBuffer { + public: + FileSnapshotBuffer(const char* path, bool executable) + : mapping_(path, executable) { + if (mapping_.GetSize() > 0) { + symbol_ = mapping_.GetMapping(); + } + } + + const uint8_t* GetSnapshotPointer() const override { return symbol_; } + + size_t GetSnapshotSize() const override { return mapping_.GetSize(); } + + private: + fml::FileMapping mapping_; + const uint8_t* symbol_ = nullptr; + + FXL_DISALLOW_COPY_AND_ASSIGN(FileSnapshotBuffer); +}; + +std::unique_ptr +DartSnapshotBuffer::CreateWithSymbolInLibrary( + fxl::RefPtr library, + const char* symbol_name) { + auto source = std::make_unique( + std::move(library), symbol_name); + return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); +} + +std::unique_ptr +DartSnapshotBuffer::CreateWithContentsOfFile(const char* file_path, + bool executable) { + auto source = std::make_unique(file_path, executable); + return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); +} + +DartSnapshotBuffer::~DartSnapshotBuffer() = default; + +} // namespace blink diff --git a/runtime/dart_snapshot_buffer.h b/runtime/dart_snapshot_buffer.h new file mode 100644 index 0000000000000..675946c0ca63f --- /dev/null +++ b/runtime/dart_snapshot_buffer.h @@ -0,0 +1,34 @@ +// Copyright 2017 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_RUNTIME_DART_SNAPSHOT_BUFFER_H_ +#define FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ + +#include + +#include "flutter/fml/native_library.h" +#include "lib/fxl/macros.h" + +namespace blink { + +class DartSnapshotBuffer { + public: + static std::unique_ptr CreateWithSymbolInLibrary( + fxl::RefPtr library, + const char* symbol_name); + + static std::unique_ptr CreateWithContentsOfFile( + const char* file_path, + bool executable); + + virtual ~DartSnapshotBuffer(); + + virtual const uint8_t* GetSnapshotPointer() const = 0; + + virtual size_t GetSnapshotSize() const = 0; +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_SNAPSHOT_BUFFER_H_ diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc new file mode 100644 index 0000000000000..bb46779078583 --- /dev/null +++ b/runtime/dart_vm.cc @@ -0,0 +1,472 @@ +// Copyright 2017 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/runtime/dart_vm.h" + +#include + +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/fml/trace_event.h" +#include "flutter/lib/io/dart_io.h" +#include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/dart_ui.h" +#include "flutter/runtime/dart_isolate.h" +#include "flutter/runtime/dart_service_isolate.h" +#include "flutter/runtime/start_up.h" +#include "lib/fxl/arraysize.h" +#include "lib/fxl/compiler_specific.h" +#include "lib/fxl/files/file.h" +#include "lib/fxl/logging.h" +#include "lib/fxl/time/time_delta.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_class_library.h" +#include "lib/tonic/dart_class_provider.h" +#include "lib/tonic/dart_sticky_error.h" +#include "lib/tonic/file_loader/file_loader.h" +#include "lib/tonic/logging/dart_error.h" +#include "lib/tonic/scopes/dart_api_scope.h" +#include "lib/tonic/typed_data/uint8_list.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace dart { +namespace observatory { + +#if !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) + +// These two symbols are defined in |observatory_archive.cc| which is generated +// by the |//third_party/dart/runtime/observatory:archive_observatory| rule. +// Both of these symbols will be part of the data segment and therefore are read +// only. +extern unsigned int observatory_assets_archive_len; +extern const uint8_t* observatory_assets_archive; + +#endif // !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != + // FLUTTER_RUNTIME_MODE_RELEASE) + +} // namespace observatory +} // namespace dart + +namespace blink { + +// Arguments passed to the Dart VM in all configurations. +static const char* kDartLanguageArgs[] = { + "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", + "--causal_async_stacks", "--limit-ints-to-64-bits", +}; + +static const char* kDartPrecompilationArgs[] = { + "--precompilation", +}; + +FXL_ALLOW_UNUSED_TYPE +static const char* kDartWriteProtectCodeArgs[] = { + "--no_write_protect_code", +}; + +static const char* kDartAssertArgs[] = { + // clang-format off + "--enable_asserts", + // clang-format on +}; + +static const char* kDartCheckedModeArgs[] = { + // clang-format off + "--enable_type_checks", + "--error_on_bad_type", + "--error_on_bad_override", + // clang-format on +}; + +static const char* kDartStrongModeArgs[] = { + // clang-format off + "--strong", + "--reify_generic_functions", + "--limit_ints_to_64_bits", + "--sync_async", + // clang-format on +}; + +static const char* kDartStartPausedArgs[]{ + "--pause_isolates_on_start", +}; + +static const char* kDartTraceStartupArgs[]{ + "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", +}; + +static const char* kDartEndlessTraceBufferArgs[]{ + "--timeline_recorder=endless", +}; + +static const char* kDartFuchsiaTraceArgs[] FXL_ALLOW_UNUSED_TYPE = { + "--systrace_timeline", + "--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM", +}; + +constexpr char kFileUriPrefix[] = "file://"; +constexpr size_t kFileUriPrefixLength = sizeof(kFileUriPrefix) - 1; + +bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { + if (strncmp(source_url, kFileUriPrefix, kFileUriPrefixLength) != 0u) { + // Assume modified. + return true; + } + + const char* path = source_url + kFileUriPrefixLength; + struct stat info; + if (stat(path, &info) < 0) + return true; + + // If st_mtime is zero, it's more likely that the file system doesn't support + // mtime than that the file was actually modified in the 1970s. + if (!info.st_mtime) + return true; + + // It's very unclear what time bases we're with here. The Dart API doesn't + // document the time base for since_ms. Reading the code, the value varies by + // platform, with a typical source being something like gettimeofday. + // + // We add one to st_mtime because st_mtime has less precision than since_ms + // and we want to treat the file as modified if the since time is between + // ticks of the mtime. + fxl::TimeDelta mtime = fxl::TimeDelta::FromSeconds(info.st_mtime + 1); + fxl::TimeDelta since = fxl::TimeDelta::FromMilliseconds(since_ms); + + return mtime > since; +} + +void ThreadExitCallback() {} + +Dart_Handle GetVMServiceAssetsArchiveCallback() { +#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) + return nullptr; +#elif OS(FUCHSIA) + std::vector observatory_assets_archive; + if (!files::ReadFileToVector("pkg/data/observatory.tar", + &observatory_assets_archive)) { + FXL_LOG(ERROR) << "Fail to load Observatory archive"; + return nullptr; + } + return tonic::DartConverter::ToDart( + observatory_assets_archive.data(), observatory_assets_archive.size()); +#else + return tonic::DartConverter::ToDart( + ::dart::observatory::observatory_assets_archive, + ::dart::observatory::observatory_assets_archive_len); +#endif +} + +static const char kStdoutStreamId[] = "Stdout"; +static const char kStderrStreamId[] = "Stderr"; + +static bool ServiceStreamListenCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(true); + return true; + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(true); + return true; + } + return false; +} + +static void ServiceStreamCancelCallback(const char* stream_id) { + if (strcmp(stream_id, kStdoutStreamId) == 0) { + dart::bin::SetCaptureStdout(false); + } else if (strcmp(stream_id, kStderrStreamId) == 0) { + dart::bin::SetCaptureStderr(false); + } +} + +bool DartVM::IsRunningPrecompiledCode() { + return Dart_IsPrecompiledRuntime(); +} + +static std::vector ProfilingFlags(bool enable_profiling) { +// Disable Dart's built in profiler when building a debug build. This +// works around a race condition that would sometimes stop a crash's +// stack trace from being printed on Android. +#ifndef NDEBUG + enable_profiling = false; +#endif + + // We want to disable profiling by default because it overwhelms LLDB. But + // the VM enables the same by default. In either case, we have some profiling + // flags. + if (enable_profiling) { + return {// This is the default. But just be explicit. + "--profiler", + // This instructs the profiler to walk C++ frames, and to include + // them in the profile. + "--profile-vm"}; + } else { + return {"--no-profiler"}; + } +} + +void PushBackAll(std::vector* args, + const char** argv, + size_t argc) { + for (size_t i = 0; i < argc; ++i) { + args->push_back(argv[i]); + } +} + +static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { + info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; + dart::bin::GetIOEmbedderInformation(info); + info->name = "Flutter"; +} + +fxl::RefPtr DartVM::ForProcess(Settings settings) { + return ForProcess(settings, nullptr, nullptr); +} + +static std::once_flag gVMInitialization; +static fxl::RefPtr gVM; + +fxl::RefPtr DartVM::ForProcess( + Settings settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot) { + std::call_once(gVMInitialization, [settings, // + vm_snapshot, // + isolate_snapshot // + ]() mutable { + if (!vm_snapshot) { + vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings); + } + if (!isolate_snapshot) { + isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings); + } + gVM = fxl::MakeRefCounted(settings, // + std::move(vm_snapshot), // + std::move(isolate_snapshot) // + ); + }); + return gVM; +} + +fxl::RefPtr DartVM::ForProcessIfInitialized() { + return gVM; +} + +DartVM::DartVM(const Settings& settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot) + : settings_(settings), + vm_snapshot_(std::move(vm_snapshot)), + isolate_snapshot_(std::move(isolate_snapshot)), + platform_kernel_mapping_( + std::make_unique(settings.kernel_snapshot_path)), + weak_factory_(this) { + TRACE_EVENT0("flutter", "DartVMInitializer"); + FXL_DLOG(INFO) << "Attempting Dart VM launch for mode: " + << (IsRunningPrecompiledCode() ? "AOT" : "Interpreter"); + + FXL_DCHECK(vm_snapshot_ && vm_snapshot_->IsValid()) + << "VM snapshot must be valid."; + + FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid()) + << "Isolate snapshot must be valid."; + + if (platform_kernel_mapping_->GetSize() > 0) { + // The platform kernel mapping lifetime is managed by this instance of the + // DartVM and hence will exceed that of the PlatformKernel. So provide an + // empty release callback. + Dart_ReleaseBufferCallback empty = [](auto arg) {}; + platform_kernel_ = reinterpret_cast(Dart_ReadKernelBinary( + platform_kernel_mapping_->GetMapping(), // buffer + platform_kernel_mapping_->GetSize(), // buffer size + empty // buffer deleter + )); + } + + { + TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); + dart::bin::BootstrapDartIo(); + + if (!settings.temp_directory_path.empty()) { + dart::bin::SetSystemTempDirectory(settings.temp_directory_path.c_str()); + } + } + + std::vector args; + + // Instruct the VM to ignore unrecognized flags. + // There is a lot of diversity in a lot of combinations when it + // comes to the arguments the VM supports. And, if the VM comes across a flag + // it does not recognize, it exits immediately. + args.push_back("--ignore-unrecognized-flags"); + + for (const auto& profiler_flag : + ProfilingFlags(settings.enable_dart_profiling)) { + args.push_back(profiler_flag); + } + + PushBackAll(&args, kDartLanguageArgs, arraysize(kDartLanguageArgs)); + + if (IsRunningPrecompiledCode()) { + PushBackAll(&args, kDartPrecompilationArgs, + arraysize(kDartPrecompilationArgs)); + } + + // Enable checked mode if we are not running precompiled code. We run non- + // precompiled code only in the debug product mode. + bool use_checked_mode = !settings.dart_non_checked_mode; + +#if !OS(FUCHSIA) + if (IsRunningPrecompiledCode()) { + use_checked_mode = false; + } +#endif // !OS(FUCHSIA) + +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + // Debug mode uses the JIT, disable code page write protection to avoid + // memory page protection changes before and after every compilation. + PushBackAll(&args, kDartWriteProtectCodeArgs, + arraysize(kDartWriteProtectCodeArgs)); +#endif + + const bool isolate_snapshot_is_dart_2 = + Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); + + const bool is_preview_dart2 = + platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; + + if (is_preview_dart2) { + FXL_DLOG(INFO) << "Dart 2 is enabled."; + } else { + FXL_DLOG(INFO) << "Dart 2 is NOT enabled. Platform kernel: " + << static_cast(platform_kernel_) + << " Isolate Snapshot is Dart 2: " + << isolate_snapshot_is_dart_2; + } + if (is_preview_dart2) { + PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); + if (use_checked_mode) { + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + } + } else if (use_checked_mode) { + FXL_DLOG(INFO) << "Checked mode is ON"; + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); + } else { + FXL_DLOG(INFO) << "Is not Dart 2 and Checked mode is OFF"; + } + + if (settings.start_paused) { + PushBackAll(&args, kDartStartPausedArgs, arraysize(kDartStartPausedArgs)); + } + + if (settings.endless_trace_buffer || settings.trace_startup) { + // If we are tracing startup, make sure the trace buffer is endless so we + // don't lose early traces. + PushBackAll(&args, kDartEndlessTraceBufferArgs, + arraysize(kDartEndlessTraceBufferArgs)); + } + + if (settings.trace_startup) { + PushBackAll(&args, kDartTraceStartupArgs, arraysize(kDartTraceStartupArgs)); + } + +#if defined(OS_FUCHSIA) + PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); +#endif + + for (size_t i = 0; i < settings.dart_flags.size(); i++) + args.push_back(settings.dart_flags[i].c_str()); + + FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); + + DartUI::InitForGlobal(); + + { + TRACE_EVENT0("flutter", "Dart_Initialize"); + Dart_InitializeParams params = {}; + params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION; + params.vm_snapshot_data = vm_snapshot_->GetData()->GetSnapshotPointer(); + params.vm_snapshot_instructions = vm_snapshot_->GetInstructionsIfPresent(); + params.create = reinterpret_cast( + DartIsolate::DartIsolateCreateCallback); + params.shutdown = reinterpret_cast( + DartIsolate::DartIsolateShutdownCallback); + params.cleanup = reinterpret_cast( + DartIsolate::DartIsolateCleanupCallback); + params.thread_exit = ThreadExitCallback; + params.get_service_assets = GetVMServiceAssetsArchiveCallback; + params.entropy_source = DartIO::EntropySource; + char* init_error = Dart_Initialize(¶ms); + if (init_error) { + FXL_LOG(FATAL) << "Error while initializing the Dart VM: " << init_error; + ::free(init_error); + } + // Send the earliest available timestamp in the application lifecycle to + // timeline. The difference between this timestamp and the time we render + // the very first frame gives us a good idea about Flutter's startup time. + // Use a duration event so about:tracing will consider this event when + // deciding the earliest event to use as time 0. + if (blink::engine_main_enter_ts != 0) { + Dart_TimelineEvent("FlutterEngineMainEnter", // label + blink::engine_main_enter_ts, // timestamp0 + blink::engine_main_enter_ts, // timestamp1_or_async_id + Dart_Timeline_Event_Duration, // event type + 0, // argument_count + nullptr, // argument_names + nullptr // argument_values + ); + } + } + + // Allow streaming of stdout and stderr by the Dart vm. + Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, + &ServiceStreamCancelCallback); + + Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); +} + +DartVM::~DartVM() { + if (Dart_CurrentIsolate() != nullptr) { + Dart_ExitIsolate(); + } + char* result = Dart_Cleanup(); + if (result != nullptr) { + FXL_LOG(ERROR) << "Could not cleanly shut down the Dart VM. Message: \"" + << result << "\"."; + free(result); + } +} + +const Settings& DartVM::GetSettings() const { + return settings_; +} + +DartVM::PlatformKernel* DartVM::GetPlatformKernel() const { + return platform_kernel_; +} + +const DartSnapshot& DartVM::GetVMSnapshot() const { + return *vm_snapshot_.get(); +} + +fxl::RefPtr DartVM::GetIsolateSnapshot() const { + return isolate_snapshot_; +} + +ServiceProtocol& DartVM::GetServiceProtocol() { + return service_protocol_; +} + +fxl::WeakPtr DartVM::GetWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +} // namespace blink diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h new file mode 100644 index 0000000000000..e8feb9ba1de92 --- /dev/null +++ b/runtime/dart_vm.h @@ -0,0 +1,75 @@ +// Copyright 2017 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_RUNTIME_DART_VM_H_ +#define FLUTTER_RUNTIME_DART_VM_H_ + +#include +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/runtime/dart_isolate.h" +#include "flutter/runtime/dart_snapshot.h" +#include "flutter/runtime/service_protocol.h" +#include "lib/fxl/build_config.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/fxl/memory/ref_ptr.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "third_party/dart/runtime/include/dart_api.h" + +namespace blink { + +class DartVM : public fxl::RefCountedThreadSafe { + public: + class PlatformKernel; + + static fxl::RefPtr ForProcess(Settings settings); + + static fxl::RefPtr ForProcess( + Settings settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot); + + static fxl::RefPtr ForProcessIfInitialized(); + + static bool IsRunningPrecompiledCode(); + + const Settings& GetSettings() const; + + PlatformKernel* GetPlatformKernel() const; + + const DartSnapshot& GetVMSnapshot() const; + + fxl::RefPtr GetIsolateSnapshot() const; + + fxl::WeakPtr GetWeakPtr(); + + ServiceProtocol& GetServiceProtocol(); + + private: + const Settings settings_; + const fxl::RefPtr vm_snapshot_; + const fxl::RefPtr isolate_snapshot_; + std::unique_ptr platform_kernel_mapping_; + PlatformKernel* platform_kernel_ = nullptr; + ServiceProtocol service_protocol_; + fxl::WeakPtrFactory weak_factory_; + + DartVM(const Settings& settings, + fxl::RefPtr vm_snapshot, + fxl::RefPtr isolate_snapshot); + + ~DartVM(); + + FRIEND_REF_COUNTED_THREAD_SAFE(DartVM); + FRIEND_MAKE_REF_COUNTED(DartVM); + FXL_DISALLOW_COPY_AND_ASSIGN(DartVM); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_DART_VM_H_ diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc new file mode 100644 index 0000000000000..5b2f5e6ee8299 --- /dev/null +++ b/runtime/dart_vm_unittests.cc @@ -0,0 +1,21 @@ +// Copyright 2017 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/runtime/dart_vm.h" +#include "gtest/gtest.h" + +namespace blink { + +TEST(DartVM, SimpleInitialization) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + ASSERT_TRUE(vm); + ASSERT_EQ(vm, DartVM::ForProcess(settings)); + ASSERT_FALSE(DartVM::IsRunningPrecompiledCode()); + ASSERT_EQ(vm->GetPlatformKernel(), nullptr); +} + +} // namespace blink diff --git a/runtime/fixtures/simple_main.dart b/runtime/fixtures/simple_main.dart new file mode 100644 index 0000000000000..552dfbe344902 --- /dev/null +++ b/runtime/fixtures/simple_main.dart @@ -0,0 +1,7 @@ +// Copyright 2016 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. + +void simple_main() { + print("Hello"); +} diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 75796cd68697e..e7a8ab525329a 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -4,192 +4,248 @@ #include "flutter/runtime/runtime_controller.h" +#include "flutter/fml/message_loop.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" -#include "flutter/runtime/dart_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "lib/tonic/dart_message_handler.h" -using tonic::DartState; +#ifdef ERROR +#undef ERROR +#endif namespace blink { -std::unique_ptr RuntimeController::Create( - RuntimeDelegate* client) { - return std::unique_ptr(new RuntimeController(client)); +RuntimeController::RuntimeController( + RuntimeDelegate& p_client, + const DartVM* p_vm, + TaskRunners p_task_runners, + fml::WeakPtr p_resource_context, + fxl::RefPtr p_unref_queue) + : RuntimeController(p_client, + p_vm, + std::move(p_task_runners), + std::move(p_resource_context), + std::move(p_unref_queue), + WindowData{/* default window data */}) {} + +RuntimeController::RuntimeController( + RuntimeDelegate& p_client, + const DartVM* p_vm, + TaskRunners p_task_runners, + fml::WeakPtr p_resource_context, + fxl::RefPtr p_unref_queue, + WindowData p_window_data) + : client_(p_client), + vm_(p_vm), + task_runners_(p_task_runners), + resource_context_(p_resource_context), + unref_queue_(p_unref_queue), + window_data_(std::move(p_window_data)), + root_isolate_( + DartIsolate::CreateRootIsolate(vm_, + vm_->GetIsolateSnapshot(), + task_runners_, + std::make_unique(this), + resource_context_, + unref_queue_)) { + root_isolate_->SetReturnCodeCallback([this](uint32_t code) { + root_isolate_return_code_ = {true, code}; + }); + if (auto window = GetWindowIfAvailable()) { + tonic::DartState::Scope scope(root_isolate_.get()); + window->DidCreateIsolate(); + if (!FlushRuntimeStateToIsolate()) { + FXL_DLOG(ERROR) << "Could not setup intial isolate state."; + } + } else { + FXL_DCHECK(false) << "RuntimeController created without window binding."; + } + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); +} + +RuntimeController::~RuntimeController() { + FXL_DCHECK(Dart_CurrentIsolate() == nullptr); + if (root_isolate_) { + root_isolate_->SetReturnCodeCallback(nullptr); + auto result = root_isolate_->Shutdown(); + if (!result) { + FXL_DLOG(ERROR) << "Could not shutdown the root isolate."; + } + root_isolate_ = {}; + } } -RuntimeController::RuntimeController(RuntimeDelegate* client) - : client_(client) {} - -RuntimeController::~RuntimeController() {} +std::unique_ptr RuntimeController::Clone() const { + return std::unique_ptr(new RuntimeController( + client_, // + vm_, // + task_runners_, // + resource_context_, // + unref_queue_, // + window_data_ // + )); +} -void RuntimeController::CreateDartController( - const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - int dirfd) { - FXL_DCHECK(!dart_controller_); +bool RuntimeController::FlushRuntimeStateToIsolate() { + return SetViewportMetrics(window_data_.viewport_metrics) && + SetLocale(window_data_.language_code, window_data_.country_code) && + SetSemanticsEnabled(window_data_.semantics_enabled); +} - dart_controller_.reset(new DartController()); - dart_controller_->CreateIsolateFor( - script_uri, isolate_snapshot_data, isolate_snapshot_instr, - std::make_unique(this, std::make_unique(this), - dirfd)); +bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { + window_data_.viewport_metrics = metrics; - UIDartState* dart_state = dart_controller_->dart_state(); - DartState::Scope scope(dart_state); - dart_state->window()->DidCreateIsolate(); - client_->DidCreateMainIsolate(dart_state->isolate()); + if (auto window = GetWindowIfAvailable()) { + window->UpdateWindowMetrics(metrics); + return true; + } + return false; +} - Window* window = GetWindow(); +bool RuntimeController::SetLocale(const std::string& language_code, + const std::string& country_code) { + window_data_.language_code = language_code; + window_data_.country_code = country_code; - window->UpdateLocale(language_code_, country_code_); + if (auto window = GetWindowIfAvailable()) { + window->UpdateLocale(window_data_.language_code, window_data_.country_code); + return true; + } - if (semantics_enabled_) - window->UpdateSemanticsEnabled(semantics_enabled_); + return false; } -void RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { - GetWindow()->UpdateWindowMetrics(metrics); -} +bool RuntimeController::SetUserSettingsData(const std::string& data) { + window_data_.user_settings_data = data; -void RuntimeController::SetLocale(const std::string& language_code, - const std::string& country_code) { - if (language_code_ == language_code && country_code_ == country_code) - return; + if (auto window = GetWindowIfAvailable()) { + window->UpdateUserSettingsData(window_data_.user_settings_data); + return true; + } - language_code_ = language_code; - country_code_ = country_code; - GetWindow()->UpdateLocale(language_code_, country_code_); + return false; } -void RuntimeController::SetUserSettingsData(const std::string& data) { - if (user_settings_data_ == data) - return; - user_settings_data_ = data; - GetWindow()->UpdateUserSettingsData(user_settings_data_); -} +bool RuntimeController::SetSemanticsEnabled(bool enabled) { + window_data_.semantics_enabled = enabled; + + if (auto window = GetWindowIfAvailable()) { + window->UpdateSemanticsEnabled(window_data_.semantics_enabled); + return true; + } -void RuntimeController::SetSemanticsEnabled(bool enabled) { - if (semantics_enabled_ == enabled) - return; - semantics_enabled_ = enabled; - GetWindow()->UpdateSemanticsEnabled(semantics_enabled_); + return false; } -void RuntimeController::BeginFrame(fxl::TimePoint frame_time) { - GetWindow()->BeginFrame(frame_time); +bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) { + if (auto window = GetWindowIfAvailable()) { + window->BeginFrame(frame_time); + return true; + } + return false; } -void RuntimeController::NotifyIdle(int64_t deadline) { - UIDartState* dart_state = dart_controller_->dart_state(); - if (!dart_state) { - return; +bool RuntimeController::NotifyIdle(int64_t deadline) { + if (!root_isolate_) { + return false; } - DartState::Scope scope(dart_state); + + tonic::DartState::Scope scope(root_isolate_.get()); Dart_NotifyIdle(deadline); + return true; } -void RuntimeController::DispatchPlatformMessage( +bool RuntimeController::DispatchPlatformMessage( fxl::RefPtr message) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", "mode", - "basic"); - GetWindow()->DispatchPlatformMessage(std::move(message)); + if (auto window = GetWindowIfAvailable()) { + TRACE_EVENT1("flutter", "RuntimeController::DispatchPlatformMessage", + "mode", "basic"); + window->DispatchPlatformMessage(std::move(message)); + return true; + } + return false; } -void RuntimeController::DispatchPointerDataPacket( +bool RuntimeController::DispatchPointerDataPacket( const PointerDataPacket& packet) { - TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", - "mode", "basic"); - GetWindow()->DispatchPointerDataPacket(packet); + if (auto window = GetWindowIfAvailable()) { + TRACE_EVENT1("flutter", "RuntimeController::DispatchPointerDataPacket", + "mode", "basic"); + window->DispatchPointerDataPacket(packet); + return true; + } + return false; } -void RuntimeController::DispatchSemanticsAction(int32_t id, +bool RuntimeController::DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args) { TRACE_EVENT1("flutter", "RuntimeController::DispatchSemanticsAction", "mode", "basic"); - GetWindow()->DispatchSemanticsAction(id, action, std::move(args)); + if (auto window = GetWindowIfAvailable()) { + window->DispatchSemanticsAction(id, action, std::move(args)); + return true; + } + return false; } -Window* RuntimeController::GetWindow() { - return dart_controller_->dart_state()->window(); +Window* RuntimeController::GetWindowIfAvailable() { + return root_isolate_ ? root_isolate_->window() : nullptr; } std::string RuntimeController::DefaultRouteName() { - return client_->DefaultRouteName(); + return client_.DefaultRouteName(); } void RuntimeController::ScheduleFrame() { - client_->ScheduleFrame(); + client_.ScheduleFrame(); } void RuntimeController::Render(Scene* scene) { - client_->Render(scene->takeLayerTree()); + client_.Render(scene->takeLayerTree()); } void RuntimeController::UpdateSemantics(SemanticsUpdate* update) { - if (semantics_enabled_) - client_->UpdateSemantics(update->takeNodes()); + if (window_data_.semantics_enabled) { + client_.UpdateSemantics(update->takeNodes()); + } } void RuntimeController::HandlePlatformMessage( fxl::RefPtr message) { - client_->HandlePlatformMessage(std::move(message)); -} - -void RuntimeController::DidCreateSecondaryIsolate(Dart_Isolate isolate) { - client_->DidCreateSecondaryIsolate(isolate); -} - -void RuntimeController::DidShutdownMainIsolate() { - client_->DidShutdownMainIsolate(); + client_.HandlePlatformMessage(std::move(message)); } Dart_Port RuntimeController::GetMainPort() { - if (!dart_controller_) { - return ILLEGAL_PORT; - } - if (!dart_controller_->dart_state()) { - return ILLEGAL_PORT; - } - return dart_controller_->dart_state()->main_port(); + return root_isolate_ ? root_isolate_->main_port() : ILLEGAL_PORT; } std::string RuntimeController::GetIsolateName() { - if (!dart_controller_) { - return ""; - } - if (!dart_controller_->dart_state()) { - return ""; - } - return dart_controller_->dart_state()->debug_name(); + return root_isolate_ ? root_isolate_->debug_name() : ""; } bool RuntimeController::HasLivePorts() { - if (!dart_controller_) { - return false; - } - UIDartState* dart_state = dart_controller_->dart_state(); - if (!dart_state) { + if (!root_isolate_) { return false; } - DartState::Scope scope(dart_state); + tonic::DartState::Scope scope(root_isolate_.get()); return Dart_HasLivePorts(); } tonic::DartErrorHandleType RuntimeController::GetLastError() { - if (!dart_controller_) { - return tonic::kNoError; - } - UIDartState* dart_state = dart_controller_->dart_state(); - if (!dart_state) { - return tonic::kNoError; - } - return dart_state->message_handler().isolate_last_error(); + return root_isolate_ ? root_isolate_->message_handler().isolate_last_error() + : tonic::kNoError; +} + +fml::WeakPtr RuntimeController::GetRootIsolate() { + return root_isolate_; +} + +std::pair RuntimeController::GetRootIsolateReturnCode() { + return root_isolate_return_code_; } } // namespace blink diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 628bc699395c0..326c517f31db2 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -7,71 +7,108 @@ #include +#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/window.h" +#include "flutter/runtime/dart_vm.h" #include "lib/fxl/macros.h" namespace blink { -class DartController; -class DartLibraryProvider; class Scene; class RuntimeDelegate; class View; class Window; -class RuntimeController : public WindowClient, public IsolateClient { +class RuntimeController final : public WindowClient { public: - static std::unique_ptr Create(RuntimeDelegate* client); + RuntimeController(RuntimeDelegate& client, + const DartVM* vm, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue); + ~RuntimeController(); - void CreateDartController(const std::string& script_uri, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instr, - int dirfd = -1); - DartController* dart_controller() const { return dart_controller_.get(); } + std::unique_ptr Clone() const; + + bool SetViewportMetrics(const ViewportMetrics& metrics); - void SetViewportMetrics(const ViewportMetrics& metrics); - void SetLocale(const std::string& language_code, + bool SetLocale(const std::string& language_code, const std::string& country_code); - void SetUserSettingsData(const std::string& data); - void SetSemanticsEnabled(bool enabled); - void BeginFrame(fxl::TimePoint frame_time); - void NotifyIdle(int64_t deadline); + bool SetUserSettingsData(const std::string& data); + + bool SetSemanticsEnabled(bool enabled); + + bool BeginFrame(fxl::TimePoint frame_time); + + bool NotifyIdle(int64_t deadline); - void DispatchPlatformMessage(fxl::RefPtr message); - void DispatchPointerDataPacket(const PointerDataPacket& packet); - void DispatchSemanticsAction(int32_t id, + bool DispatchPlatformMessage(fxl::RefPtr message); + + bool DispatchPointerDataPacket(const PointerDataPacket& packet); + + bool DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args); Dart_Port GetMainPort(); + std::string GetIsolateName(); + bool HasLivePorts(); + tonic::DartErrorHandleType GetLastError(); - private: - explicit RuntimeController(RuntimeDelegate* client); + fml::WeakPtr GetRootIsolate(); - Window* GetWindow(); + std::pair GetRootIsolateReturnCode(); + private: + struct WindowData { + ViewportMetrics viewport_metrics; + std::string language_code; + std::string country_code; + std::string user_settings_data = "{}"; + bool semantics_enabled = false; + }; + + RuntimeDelegate& client_; + const DartVM* vm_; + TaskRunners task_runners_; + fml::WeakPtr resource_context_; + fxl::RefPtr unref_queue_; + WindowData window_data_; + fml::WeakPtr root_isolate_; + std::pair root_isolate_return_code_ = {false, 0}; + + RuntimeController(RuntimeDelegate& client, + const DartVM* vm, + TaskRunners task_runners, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue, + WindowData data); + + Window* GetWindowIfAvailable(); + + bool FlushRuntimeStateToIsolate(); + + // |blink::WindowClient| std::string DefaultRouteName() override; + + // |blink::WindowClient| void ScheduleFrame() override; + + // |blink::WindowClient| void Render(Scene* scene) override; - void UpdateSemantics(SemanticsUpdate* update) override; - void HandlePlatformMessage(fxl::RefPtr message) override; - void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; - void DidShutdownMainIsolate() override; + // |blink::WindowClient| + void UpdateSemantics(SemanticsUpdate* update) override; - RuntimeDelegate* client_; - std::string language_code_; - std::string country_code_; - std::string user_settings_data_ = "{}"; - bool semantics_enabled_ = false; - std::unique_ptr dart_controller_; + // |blink::WindowClient| + void HandlePlatformMessage(fxl::RefPtr message) override; FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeController); }; diff --git a/runtime/runtime_delegate.cc b/runtime/runtime_delegate.cc index 6ec55c4c2e6a0..902672be06d8f 100644 --- a/runtime/runtime_delegate.cc +++ b/runtime/runtime_delegate.cc @@ -6,12 +6,6 @@ namespace blink { -RuntimeDelegate::~RuntimeDelegate() {} - -void RuntimeDelegate::DidCreateMainIsolate(Dart_Isolate isolate) {} - -void RuntimeDelegate::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} - -void RuntimeDelegate::DidShutdownMainIsolate() {} +RuntimeDelegate::~RuntimeDelegate() = default; } // namespace blink diff --git a/runtime/runtime_delegate.h b/runtime/runtime_delegate.h index 36650fe7fb70b..c6d6c0a92b2b4 100644 --- a/runtime/runtime_delegate.h +++ b/runtime/runtime_delegate.h @@ -18,14 +18,14 @@ namespace blink { class RuntimeDelegate { public: virtual std::string DefaultRouteName() = 0; + virtual void ScheduleFrame(bool regenerate_layer_tree = true) = 0; + virtual void Render(std::unique_ptr layer_tree) = 0; + virtual void UpdateSemantics(blink::SemanticsNodeUpdates update) = 0; - virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; - virtual void DidCreateMainIsolate(Dart_Isolate isolate); - virtual void DidCreateSecondaryIsolate(Dart_Isolate isolate); - virtual void DidShutdownMainIsolate(); + virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; protected: virtual ~RuntimeDelegate(); diff --git a/runtime/runtime_init.cc b/runtime/runtime_init.cc deleted file mode 100644 index eda66e5495aed..0000000000000 --- a/runtime/runtime_init.cc +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/runtime/runtime_init.h" - -#include "flutter/glue/trace_event.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/platform_impl.h" -#include "flutter/sky/engine/public/web/Sky.h" -#include "lib/fxl/logging.h" - -namespace blink { -namespace { - -PlatformImpl* g_platform_impl = nullptr; - -} // namespace - -void InitRuntime(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path) { - TRACE_EVENT0("flutter", "InitRuntime"); - - FXL_CHECK(!g_platform_impl); - g_platform_impl = new PlatformImpl(); - InitEngine(g_platform_impl); - InitDartVM(vm_snapshot_data, vm_snapshot_instructions, - default_isolate_snapshot_data, - default_isolate_snapshot_instructions, bundle_path); -} - -} // namespace blink diff --git a/runtime/runtime_init.h b/runtime/runtime_init.h deleted file mode 100644 index 515ae284e3460..0000000000000 --- a/runtime/runtime_init.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_RUNTIME_RUNTIME_INIT_H_ -#define FLUTTER_RUNTIME_RUNTIME_INIT_H_ - -#include -#include - -namespace blink { - -void InitRuntime(const uint8_t* vm_snapshot_data, - const uint8_t* vm_snapshot_instructions, - const uint8_t* default_isolate_snapshot_data, - const uint8_t* default_isolate_snapshot_instructions, - const std::string& bundle_path); - -} // namespace blink - -#endif // FLUTTER_RUNTIME_RUNTIME_INIT_H_ diff --git a/runtime/service_protocol.cc b/runtime/service_protocol.cc new file mode 100644 index 0000000000000..030901e54269d --- /dev/null +++ b/runtime/service_protocol.cc @@ -0,0 +1,279 @@ +// Copyright 2017 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 RAPIDJSON_HAS_STDSTRING 1 + +#include "flutter/runtime/service_protocol.h" + +#include + +#include +#include +#include +#include + +#include "lib/fxl/synchronization/waitable_event.h" +#include "rapidjson/stringbuffer.h" +#include "rapidjson/writer.h" +#include "third_party/dart/runtime/include/dart_tools_api.h" + +namespace blink { + +const fxl::StringView ServiceProtocol::kScreenshotExtensionName = + "_flutter.screenshot"; +const fxl::StringView ServiceProtocol::kScreenshotSkpExtensionName = + "_flutter.screenshotSkp"; +const fxl::StringView ServiceProtocol::kRunInViewExtensionName = + "_flutter.runInView"; +const fxl::StringView ServiceProtocol::kFlushUIThreadTasksExtensionName = + "_flutter.flushUIThreadTasks"; +const fxl::StringView ServiceProtocol::kSetAssetBundlePathExtensionName = + "_flutter.setAssetBundlePath"; + +static constexpr fxl::StringView kViewIdPrefx = "_flutterView/"; +static constexpr fxl::StringView kListViewsExtensionName = "_flutter.listViews"; + +ServiceProtocol::ServiceProtocol() + : endpoints_({ + // Private + kListViewsExtensionName, + + // Public + kScreenshotExtensionName, + kScreenshotSkpExtensionName, + kRunInViewExtensionName, + kFlushUIThreadTasksExtensionName, + kSetAssetBundlePathExtensionName, + }) {} + +ServiceProtocol::~ServiceProtocol() { + ToggleHooks(false); +} + +void ServiceProtocol::AddHandler(Handler* handler) { + std::lock_guard lock(handlers_mutex_); + handlers_.emplace(handler); +} + +void ServiceProtocol::RemoveHandler(Handler* handler) { + std::lock_guard lock(handlers_mutex_); + handlers_.erase(handler); +} + +void ServiceProtocol::ToggleHooks(bool set) { + for (const auto& endpoint : endpoints_) { + Dart_RegisterRootServiceRequestCallback( + endpoint.data(), // method + &ServiceProtocol::HandleMessage, // callback + set ? this : nullptr // user data + ); + } +} + +static void WriteServerErrorResponse(rapidjson::Document& document, + const char* message) { + document.SetObject(); + document.AddMember("code", -32000, document.GetAllocator()); + rapidjson::Value message_value; + message_value.SetString(message, document.GetAllocator()); + document.AddMember("message", message_value, document.GetAllocator()); +} + +bool ServiceProtocol::HandleMessage(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object) { + Handler::ServiceProtocolMap params; + for (intptr_t i = 0; i < num_params; i++) { + params[fxl::StringView{param_keys[i]}] = fxl::StringView{param_values[i]}; + } + +#ifndef NDEBUG + FXL_DLOG(INFO) << "Service protcol method: " << method; + FXL_DLOG(INFO) << "Arguments: " << params.size(); + for (intptr_t i = 0; i < num_params; i++) { + FXL_DLOG(INFO) << " " << i + 1 << ": " << param_keys[i] << " = " + << param_values[i]; + } +#endif // NDEBUG + + rapidjson::Document document; + bool result = HandleMessage(fxl::StringView{method}, // + params, // + static_cast(user_data), // + document // + ); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + document.Accept(writer); + *json_object = strdup(buffer.GetString()); + +#ifndef NDEBUG + FXL_DLOG(INFO) << "Response: " << *json_object; + FXL_DLOG(INFO) << "RPC Result: " << result; +#endif // NDEBUG + + return result; +} + +bool ServiceProtocol::HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + ServiceProtocol* service_protocol, + rapidjson::Document& response) { + if (service_protocol == nullptr) { + WriteServerErrorResponse(response, "Service protocol unavailable."); + return false; + } + + return service_protocol->HandleMessage(method, params, response); +} + +FXL_WARN_UNUSED_RESULT +static bool HandleMessageOnHandler( + ServiceProtocol::Handler* handler, + fxl::StringView method, + const ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& document) { + FXL_DCHECK(handler); + fxl::AutoResetWaitableEvent latch; + bool result = false; + fml::TaskRunner::RunNowOrPostTask( + handler->GetServiceProtocolHandlerTaskRunner(method), + [&latch, // + &result, // + &handler, // + &method, // + ¶ms, // + &document // + ]() { + result = + handler->HandleServiceProtocolMessage(method, params, document); + latch.Signal(); + }); + latch.Wait(); + return result; +} + +bool ServiceProtocol::HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + rapidjson::Document& response) const { + if (method == kListViewsExtensionName) { + // So far, this is the only built-in method that does not forward to the + // dynamic set of handlers. + return HandleListViewsMethod(response); + } + + std::lock_guard lock(handlers_mutex_); + + if (handlers_.size() == 0) { + WriteServerErrorResponse(response, + "There are no running service protocol handlers."); + return false; + } + + // Find the handler by its "viewId" in the params. + auto view_id_param_found = params.find(fxl::StringView{"viewId"}); + if (view_id_param_found != params.end()) { + auto handler = reinterpret_cast(std::stoull( + view_id_param_found->second.data() + kViewIdPrefx.size(), nullptr, 16)); + auto handler_found = handlers_.find(handler); + if (handler_found != handlers_.end()) { + return HandleMessageOnHandler(handler, method, params, response); + } + } + + // Handle legacy calls that do not specify a handler in their args. + // TODO(chinmaygarde): Deprecate these calls in the tools and remove these + // fallbacks. + if (method == kScreenshotExtensionName || + method == kScreenshotSkpExtensionName) { + return HandleMessageOnHandler(*handlers_.begin(), method, params, response); + } + + WriteServerErrorResponse( + response, + "Service protocol could not handle or find a handler for the " + "requested method."); + return false; +} + +static std::string CreateFlutterViewID(intptr_t handler) { + std::stringstream stream; + stream << kViewIdPrefx << "0x" << std::hex << handler; + return stream.str(); +} + +static std::string CreateIsolateID(int64_t isolate) { + std::stringstream stream; + stream << "isolates/" << isolate; + return stream.str(); +} + +void ServiceProtocol::Handler::Description::Write( + Handler* handler, + rapidjson::Value& view, + rapidjson::MemoryPoolAllocator<>& allocator) const { + view.SetObject(); + view.AddMember("type", "FlutterView", allocator); + view.AddMember("id", CreateFlutterViewID(reinterpret_cast(handler)), + allocator); + if (isolate_port != 0) { + rapidjson::Value isolate(rapidjson::Type::kObjectType); + { + isolate.AddMember("type", "@Isolate", allocator); + isolate.AddMember("fixedId", true, allocator); + isolate.AddMember("id", CreateIsolateID(isolate_port), allocator); + isolate.AddMember("name", isolate_name, allocator); + isolate.AddMember("number", isolate_port, allocator); + } + view.AddMember("isolate", isolate, allocator); + } +} + +bool ServiceProtocol::HandleListViewsMethod( + rapidjson::Document& response) const { + // Collect handler descriptions on their respective task runners. + std::lock_guard lock(handlers_mutex_); + std::vector> descriptions; + for (const auto& handler : handlers_) { + fxl::AutoResetWaitableEvent latch; + Handler::Description description; + + fml::TaskRunner::RunNowOrPostTask( + handler->GetServiceProtocolHandlerTaskRunner( + kListViewsExtensionName), // task runner + [&latch, // + &description, // + &handler // + ]() { + description = handler->GetServiceProtocolDescription(); + latch.Signal(); + }); + latch.Wait(); + descriptions.emplace_back(std::make_pair( + reinterpret_cast(handler), std::move(description))); + } + + auto& allocator = response.GetAllocator(); + + // Construct the response objects. + response.SetObject(); + response.AddMember("type", "FlutterViewList", allocator); + + rapidjson::Value viewsList(rapidjson::Type::kArrayType); + for (const auto& description : descriptions) { + rapidjson::Value view(rapidjson::Type::kObjectType); + description.second.Write(reinterpret_cast(description.first), + view, allocator); + viewsList.PushBack(view, allocator); + } + + response.AddMember("views", viewsList, allocator); + + return true; +} + +} // namespace blink diff --git a/runtime/service_protocol.h b/runtime/service_protocol.h new file mode 100644 index 0000000000000..056f7389ea79a --- /dev/null +++ b/runtime/service_protocol.h @@ -0,0 +1,99 @@ +// Copyright 2017 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_RUNTIME_SERVICE_PROTOCOL_H_ +#define FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ + +#include +#include +#include +#include + +#include "flutter/fml/task_runner.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/strings/string_view.h" +#include "lib/fxl/synchronization/thread_annotations.h" +#include "third_party/rapidjson/rapidjson/document.h" + +namespace blink { + +class ServiceProtocol { + public: + static const fxl::StringView kScreenshotExtensionName; + static const fxl::StringView kScreenshotSkpExtensionName; + static const fxl::StringView kRunInViewExtensionName; + static const fxl::StringView kFlushUIThreadTasksExtensionName; + static const fxl::StringView kSetAssetBundlePathExtensionName; + + class Handler { + public: + struct Description { + int64_t isolate_port = 0 /* illegal port by default. */; + std::string isolate_name; + + Description() {} + + Description(int64_t p_isolate_port, std::string p_isolate_name) + : isolate_port(p_isolate_port), + isolate_name(std::move(p_isolate_name)) {} + + void Write(Handler* handler, + rapidjson::Value& value, + rapidjson::MemoryPoolAllocator<>& allocator) const; + }; + + using ServiceProtocolMap = std::map; + + virtual fxl::RefPtr GetServiceProtocolHandlerTaskRunner( + fxl::StringView method) const = 0; + + virtual Description GetServiceProtocolDescription() const = 0; + + virtual bool HandleServiceProtocolMessage( + fxl::StringView method, // one if the extension names specified above. + const ServiceProtocolMap& params, + rapidjson::Document& response) = 0; + }; + + ServiceProtocol(); + + ~ServiceProtocol(); + + void ToggleHooks(bool set); + + void AddHandler(Handler* handler); + + void RemoveHandler(Handler* handler); + + private: + const std::set endpoints_; + mutable std::mutex handlers_mutex_; + std::set handlers_; + + FXL_WARN_UNUSED_RESULT + static bool HandleMessage(const char* method, + const char** param_keys, + const char** param_values, + intptr_t num_params, + void* user_data, + const char** json_object); + FXL_WARN_UNUSED_RESULT + static bool HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + ServiceProtocol* service_protocol, + rapidjson::Document& response); + FXL_WARN_UNUSED_RESULT + bool HandleMessage(fxl::StringView method, + const Handler::ServiceProtocolMap& params, + rapidjson::Document& response) const; + + FXL_WARN_UNUSED_RESULT + bool HandleListViewsMethod(rapidjson::Document& response) const; + + FXL_DISALLOW_COPY_AND_ASSIGN(ServiceProtocol); +}; + +} // namespace blink + +#endif // FLUTTER_RUNTIME_SERVICE_PROTOCOL_H_ diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index f9e25a3c8d6d7..25edcfa23bd85 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("$flutter_root/testing/testing.gni") + # Template to generate a dart embedder resource.cc file. # Required invoker inputs: # String output (name of output file) @@ -61,18 +63,18 @@ source_set("common") { "animator.h", "engine.cc", "engine.h", - "null_platform_view.cc", - "null_platform_view.h", - "null_rasterizer.cc", - "null_rasterizer.h", + "io_manager.cc", + "io_manager.h", + "isolate_configuration.cc", + "isolate_configuration.h", "picture_serializer.cc", "picture_serializer.h", "platform_view.cc", "platform_view.h", - "platform_view_service_protocol.cc", - "platform_view_service_protocol.h", "rasterizer.cc", "rasterizer.h", + "run_configuration.cc", + "run_configuration.h", "shell.cc", "shell.h", "skia_event_tracer_impl.cc", @@ -81,8 +83,8 @@ source_set("common") { "surface.h", "switches.cc", "switches.h", - "tracing_controller.cc", - "tracing_controller.h", + "thread_host.cc", + "thread_host.h", "vsync_waiter.cc", "vsync_waiter.h", "vsync_waiter_fallback.cc", @@ -90,8 +92,6 @@ source_set("common") { ] deps = [ - "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/platform:libdart_platform", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", @@ -99,10 +99,13 @@ source_set("common") { "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", + "$flutter_root/sky/engine/platform", "$flutter_root/sky/engine/wtf", "$flutter_root/synchronization", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/platform:libdart_platform", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", @@ -112,7 +115,23 @@ source_set("common") { "//topaz/lib/tonic", ] - public_configs = [ - "$flutter_root:config", + public_configs = [ "$flutter_root:config" ] +} + +executable("shell_unittests") { + testonly = true + + sources = [ + "shell_unittests.cc", + ] + deps = [ + ":common", + "$flutter_root/fml", + "$flutter_root/lib/snapshot", + "$flutter_root/testing", + "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", + "//third_party/skia", + "//topaz/lib/tonic", ] } diff --git a/shell/common/animator.cc b/shell/common/animator.cc index d5679a0160a86..60177a18f89ab 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -4,19 +4,18 @@ #include "flutter/shell/common/animator.h" -#include "flutter/common/threads.h" -#include "flutter/fml/trace_event.h" +#include "flutter/glue/trace_event.h" #include "lib/fxl/time/stopwatch.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -Animator::Animator(fml::WeakPtr rasterizer, - VsyncWaiter* waiter, - Engine* engine) - : rasterizer_(rasterizer), - waiter_(waiter), - engine_(engine), +Animator::Animator(Delegate& delegate, + blink::TaskRunners task_runners, + std::unique_ptr waiter) + : delegate_(delegate), + task_runners_(std::move(task_runners)), + waiter_(std::move(waiter)), last_begin_frame_time_(), dart_frame_deadline_(0), layer_tree_pipeline_(fxl::MakeRefCounted(2)), @@ -79,7 +78,6 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, // If we still don't have valid continuation, the pipeline is currently // full because the consumer is being too slow. Try again at the next // frame interval. - TRACE_EVENT_INSTANT0("flutter", "ConsumerSlowDefer"); RequestFrame(); return; } @@ -94,13 +92,13 @@ void Animator::BeginFrame(fxl::TimePoint frame_start_time, { TRACE_EVENT2("flutter", "Framework Workload", "mode", "basic", "frame", FrameParity()); - engine_->BeginFrame(last_begin_frame_time_); + delegate_.OnAnimatorBeginFrame(*this, last_begin_frame_time_); } if (!frame_scheduled_) { // We don't have another frame pending, so we're waiting on user input // or I/O. Allow the Dart VM 100 ms. - engine_->NotifyIdle(dart_frame_deadline_ + 100000); + delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_ + 100000); } } @@ -120,15 +118,7 @@ void Animator::Render(std::unique_ptr layer_tree) { // Commit the pending continuation. producer_continuation_.Complete(std::move(layer_tree)); - blink::Threads::Gpu()->PostTask([ - rasterizer = rasterizer_, pipeline = layer_tree_pipeline_, - frame_id = FrameParity() - ]() { - if (!rasterizer.get()) - return; - TRACE_EVENT2("flutter", "GPU Workload", "mode", "basic", "frame", frame_id); - rasterizer->Draw(pipeline); - }); + delegate_.OnAnimatorDraw(*this, layer_tree_pipeline_); } bool Animator::CanReuseLastLayerTree() { @@ -137,10 +127,7 @@ bool Animator::CanReuseLastLayerTree() { void Animator::DrawLastLayerTree() { pending_frame_semaphore_.Signal(); - blink::Threads::Gpu()->PostTask([rasterizer = rasterizer_]() { - if (rasterizer.get()) - rasterizer->DrawLastLayerTree(); - }); + delegate_.OnAnimatorDrawLastLayerTree(*this); } void Animator::RequestFrame(bool regenerate_layer_tree) { @@ -164,31 +151,31 @@ void Animator::RequestFrame(bool regenerate_layer_tree) { // started an expensive operation right after posting this message however. // To support that, we need edge triggered wakes on VSync. - blink::Threads::UI()->PostTask( - [ self = weak_factory_.GetWeakPtr(), frame_number = frame_number_ ]() { - if (!self.get()) { - return; - } - TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", - frame_number); - self->AwaitVSync(); - }); + task_runners_.GetUITaskRunner()->PostTask([self = weak_factory_.GetWeakPtr(), + frame_number = frame_number_]() { + if (!self.get()) { + return; + } + TRACE_EVENT_ASYNC_BEGIN0("flutter", "Frame Request Pending", frame_number); + self->AwaitVSync(); + }); frame_scheduled_ = true; } void Animator::AwaitVSync() { - waiter_->AsyncWaitForVsync([self = weak_factory_.GetWeakPtr()]( - fxl::TimePoint frame_start_time, fxl::TimePoint frame_target_time) { - if (self) { - if (self->CanReuseLastLayerTree()) { - self->DrawLastLayerTree(); - } else { - self->BeginFrame(frame_start_time, frame_target_time); - } - } - }); + waiter_->AsyncWaitForVsync( + [self = weak_factory_.GetWeakPtr()](fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { + if (self) { + if (self->CanReuseLastLayerTree()) { + self->DrawLastLayerTree(); + } else { + self->BeginFrame(frame_start_time, frame_target_time); + } + } + }); - engine_->NotifyIdle(dart_frame_deadline_); + delegate_.OnAnimatorNotifyIdle(*this, dart_frame_deadline_); } } // namespace shell diff --git a/shell/common/animator.h b/shell/common/animator.h index bc2ee21441b29..53b2ac6884158 100644 --- a/shell/common/animator.h +++ b/shell/common/animator.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_SHELL_COMMON_ANIMATOR_H_ #define FLUTTER_SHELL_COMMON_ANIMATOR_H_ -#include "flutter/shell/common/engine.h" +#include "flutter/common/task_runners.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/vsync_waiter.h" #include "flutter/synchronization/pipeline.h" @@ -16,17 +16,28 @@ namespace shell { -class Animator { +class Animator final { public: - Animator(fml::WeakPtr rasterizer, - VsyncWaiter* waiter, - Engine* engine); + class Delegate { + public: + virtual void OnAnimatorBeginFrame(const Animator& animator, + fxl::TimePoint frame_time) = 0; - ~Animator(); + virtual void OnAnimatorNotifyIdle(const Animator& animator, + int64_t deadline) = 0; + + virtual void OnAnimatorDraw( + const Animator& animator, + fxl::RefPtr> pipeline) = 0; + + virtual void OnAnimatorDrawLastLayerTree(const Animator& animator) = 0; + }; - void set_rasterizer(fml::WeakPtr rasterizer) { - rasterizer_ = rasterizer; - } + Animator(Delegate& delegate, + blink::TaskRunners task_runners, + std::unique_ptr waiter); + + ~Animator(); void RequestFrame(bool regenerate_layer_tree = true); @@ -51,9 +62,9 @@ class Animator { const char* FrameParity(); - fml::WeakPtr rasterizer_; - VsyncWaiter* waiter_; - Engine* engine_; + Delegate& delegate_; + blink::TaskRunners task_runners_; + std::unique_ptr waiter_; fxl::TimePoint last_begin_frame_time_; int64_t dart_frame_deadline_; @@ -67,7 +78,7 @@ class Animator { bool dimension_change_pending_; SkISize last_layer_tree_size_; - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(Animator); }; diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 3629b729c29f7..3d6fd496d3fa9 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -4,47 +4,20 @@ #include "flutter/shell/common/engine.h" -#if OS(WIN) -#include -#include -#define access _access -#define R_OK 0x4 - -#ifndef S_ISDIR -#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) -#endif - -#ifndef S_ISREG -#define S_ISREG(mode) (((mode)&S_IFMT) == S_IFREG) -#endif - -#else -#include -#include -#include -#endif // OS(WIN) - -#include -#include #include #include -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/unzipper_provider.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/assets/asset_provider.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" #include "flutter/glue/trace_event.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/runtime/asset_font_selector.h" -#include "flutter/runtime/dart_controller.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/runtime/runtime_init.h" +#include "flutter/runtime/platform_impl.h" #include "flutter/runtime/test_font_selector.h" #include "flutter/shell/common/animator.h" #include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" +#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" #include "flutter/sky/engine/public/web/Sky.h" #include "lib/fxl/files/eintr_wrapper.h" #include "lib/fxl/files/file.h" @@ -55,380 +28,208 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" -namespace shell { -namespace { - -constexpr char kAssetChannel[] = "flutter/assets"; -constexpr char kLifecycleChannel[] = "flutter/lifecycle"; -constexpr char kNavigationChannel[] = "flutter/navigation"; -constexpr char kLocalizationChannel[] = "flutter/localization"; -constexpr char kSettingsChannel[] = "flutter/settings"; - -#if OS(WIN) -void FindAndReplaceInPlace(std::string& str, - const std::string& findStr, - const std::string& replaceStr) { - size_t pos = 0; - while ((pos = str.find(findStr, pos)) != std::string::npos) { - str.replace(pos, findStr.length(), replaceStr); - pos += replaceStr.length(); - } -} -#endif - -std::string SanitizePath(const std::string& path) { -#if OS(WIN) - std::string sanitized = path; - FindAndReplaceInPlace(sanitized, "\\\\", "/"); - if ((sanitized.length() > 2) && (sanitized[1] == ':')) { - // Path begins with a drive letter. - sanitized = '/' + sanitized; - } - return sanitized; -#else - return path; +#ifdef ERROR +#undef ERROR #endif -} - -bool PathExists(const std::string& path) { - return access(path.c_str(), R_OK) == 0; -} - -std::string FindPackagesPath(const std::string& main_dart) { - std::string directory = files::GetDirectoryName(main_dart); - std::string packages_path = directory + "/.packages"; - if (!PathExists(packages_path)) { - directory = files::GetDirectoryName(directory); - packages_path = directory + "/.packages"; - if (!PathExists(packages_path)) - packages_path = std::string(); - } - return packages_path; -} -std::string GetScriptUriFromPath(const std::string& path) { - return "file://" + SanitizePath(path); -} - -} // namespace +namespace shell { -Engine::Engine(PlatformView* platform_view) - : platform_view_(platform_view->GetWeakPtr()), - animator_(std::make_unique( - platform_view->rasterizer().GetWeakRasterizerPtr(), - platform_view->GetVsyncWaiter(), - this)), +static constexpr char kAssetChannel[] = "flutter/assets"; +static constexpr char kLifecycleChannel[] = "flutter/lifecycle"; +static constexpr char kNavigationChannel[] = "flutter/navigation"; +static constexpr char kLocalizationChannel[] = "flutter/localization"; +static constexpr char kSettingsChannel[] = "flutter/settings"; + +Engine::Engine(Delegate& delegate, + const blink::DartVM& vm, + blink::TaskRunners task_runners, + blink::Settings settings, + std::unique_ptr animator, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue) + : delegate_(delegate), + settings_(std::move(settings)), + animator_(std::move(animator)), + legacy_sky_platform_(settings_.using_blink ? new blink::PlatformImpl() + : nullptr), load_script_error_(tonic::kNoError), - user_settings_data_("{}"), activity_running_(false), have_surface_(false), - weak_factory_(this) {} + weak_factory_(this) { + weak_prototype_ = weak_factory_.GetWeakPtr(); -Engine::~Engine() {} + if (legacy_sky_platform_) { + // TODO: Remove this legacy call along with the platform. This is what makes + // the engine unable to run from multiple threads in the legacy + // configuration. + blink::InitEngine(legacy_sky_platform_.get()); + } -void Engine::set_rasterizer(fml::WeakPtr rasterizer) { - animator_->set_rasterizer(rasterizer); + // Runtime controller is initialized here because it takes a reference to this + // object as its delegate. The delegate may be called in the constructor and + // we want to be fully initilazed by that point. + runtime_controller_ = std::make_unique( + *this, // runtime delegate + &vm, // VM + std::move(task_runners), // task runners + std::move(resource_context), // resource context + std::move(unref_queue) // skia unref queue + ); } -fml::WeakPtr Engine::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); +Engine::~Engine() { + if (legacy_sky_platform_) { + blink::ShutdownEngine(/* legacy_sky_platform_ */); + } } -#if !FLUTTER_AOT -#elif OS(IOS) -#elif OS(ANDROID) -// TODO(bkonyi): do we even get here for Windows? -static const uint8_t* MemMapSnapshot(const std::string& aot_snapshot_path, - const std::string& default_file_name, - const std::string& settings_file_name, - bool executable) { - std::string asset_path; - if (settings_file_name.empty()) { - asset_path = aot_snapshot_path + "/" + default_file_name; - } else { - asset_path = aot_snapshot_path + "/" + settings_file_name; +fml::WeakPtr Engine::GetWeakPtr() const { + return weak_prototype_; +} + +bool Engine::UpdateAssetManager( + fxl::RefPtr new_asset_manager) { + if (asset_manager_ == new_asset_manager) { + return false; } -#if OS(WIN) - HANDLE file_handle_ = - CreateFileA(reinterpret_cast(path.c_str()), GENERIC_READ, - FILE_SHARE_READ, nullptr, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, nullptr); + asset_manager_ = new_asset_manager; - if (file_handle_ == INVALID_HANDLE_VALUE) { - return; + if (!asset_manager_) { + return false; } - size_ = GetFileSize(file_handle_, nullptr); - if (size_ == INVALID_FILE_SIZE) { - size_ = 0; - return; + if (settings_.using_blink) { + // Using blink as the text engine. + blink::FontFallbackList::SetUseTestFonts(settings_.use_test_fonts); + } else { + // Using libTXT as the text engine. + if (settings_.use_test_fonts) { + blink::FontCollection::ForProcess().RegisterTestFonts(); + } else { + blink::FontCollection::ForProcess().RegisterFonts(*asset_manager_.get()); + } } - int mapping_flags = executable ? PAGE_EXECUTE_READ : PAGE_READONLY; - mapping_handle_ = CreateFileMapping(file_handle_, nullptr, mapping_flags, 0, - size_, nullptr); - - CloseHandle(file_handle_); + return true; +} - if (mapping_handle_ == INVALID_HANDLE_VALUE) { - return; +bool Engine::Restart(RunConfiguration configuration) { + TRACE_EVENT0("flutter", "Engine::Restart"); + if (!configuration.IsValid()) { + FXL_LOG(ERROR) << "Engine run configuration was invalid."; + return false; } + runtime_controller_ = runtime_controller_->Clone(); + UpdateAssetManager(nullptr); + return Run(std::move(configuration)); +} - int access_flags = FILE_MAP_READ; - if (executable) { - access_flags |= FILE_MAP_EXECUTE; +bool Engine::Run(RunConfiguration configuration) { + if (!configuration.IsValid()) { + FXL_LOG(ERROR) << "Engine run configuration was invalid."; + return false; } - auto mapping = MapViewOfFile(mapping_handle_, access_flags, 0, 0, size_); - if (mapping == INVALID_HANDLE_VALUE) { - CloseHandle(mapping_handle_); - mapping_handle_ = INVALID_HANDLE_VALUE; - return; + if (!PrepareAndLaunchIsolate(std::move(configuration))) { + return false; } - void* symbol = static_cast(mapping); - if (symbol == NULL) { - return nullptr; - } -#else - struct stat info; - if (stat(asset_path.c_str(), &info) < 0) { - return nullptr; - } - int64_t asset_size = info.st_size; + auto isolate = runtime_controller_->GetRootIsolate(); - fxl::UniqueFD fd(HANDLE_EINTR(open(asset_path.c_str(), O_RDONLY))); - if (fd.get() == -1) { - return nullptr; - } + bool isolate_running = + isolate && isolate->GetPhase() == blink::DartIsolate::Phase::Running; - int mmap_flags = PROT_READ; - if (executable) - mmap_flags |= PROT_EXEC; + if (isolate_running) { + tonic::DartState::Scope scope(isolate.get()); - void* symbol = mmap(NULL, asset_size, mmap_flags, MAP_PRIVATE, fd.get(), 0); - if (symbol == MAP_FAILED) { - return nullptr; - } -#endif - return reinterpret_cast(symbol); -} -#endif + if (settings_.root_isolate_create_callback) { + settings_.root_isolate_create_callback(); + } -static const uint8_t* default_isolate_snapshot_data = nullptr; -static const uint8_t* default_isolate_snapshot_instr = nullptr; - -void Engine::Init(const std::string& bundle_path) { - const uint8_t* vm_snapshot_data; - const uint8_t* vm_snapshot_instr; -#if !FLUTTER_AOT - vm_snapshot_data = ::kDartVmSnapshotData; - vm_snapshot_instr = ::kDartVmSnapshotInstructions; - default_isolate_snapshot_data = ::kDartIsolateCoreSnapshotData; - default_isolate_snapshot_instr = ::kDartIsolateCoreSnapshotInstructions; -#elif OS(IOS) - const char* kDartApplicationLibraryPath = "App.framework/App"; - const char* application_library_path = kDartApplicationLibraryPath; - const blink::Settings& settings = blink::Settings::Get(); - const std::string& application_library_path_setting = - settings.application_library_path; - if (!application_library_path_setting.empty()) { - application_library_path = application_library_path_setting.c_str(); - } - dlerror(); // clear previous errors on thread - void* library_handle = dlopen(application_library_path, RTLD_NOW); - const char* err = dlerror(); - if (err != nullptr) { - FXL_LOG(FATAL) << "dlopen failed: " << err; - } - vm_snapshot_data = reinterpret_cast( - dlsym(library_handle, "kDartVmSnapshotData")); - vm_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "kDartVmSnapshotInstructions")); - default_isolate_snapshot_data = reinterpret_cast( - dlsym(library_handle, "kDartIsolateSnapshotData")); - default_isolate_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "kDartIsolateSnapshotInstructions")); -#elif OS(ANDROID) || OS(WIN) - const blink::Settings& settings = blink::Settings::Get(); - const std::string& aot_shared_library_path = settings.aot_shared_library_path; - const std::string& aot_snapshot_path = settings.aot_snapshot_path; - - if (!aot_shared_library_path.empty()) { - FXL_CHECK(aot_snapshot_path.empty()); - dlerror(); // clear previous errors on thread - void* library_handle = dlopen(aot_shared_library_path.c_str(), RTLD_NOW); - const char* err = dlerror(); - if (err != nullptr) { - FXL_LOG(FATAL) << "dlopen failed: " << err; + if (settings_.root_isolate_shutdown_callback) { + isolate->AddIsolateShutdownCallback( + settings_.root_isolate_shutdown_callback); + } + + // Blink uses a per isolate font selector. + if (settings_.using_blink) { + if (settings_.use_test_fonts) { + blink::TestFontSelector::Install(); + } else { + blink::AssetFontSelector::Install(asset_manager_); + } } - vm_snapshot_data = reinterpret_cast( - dlsym(library_handle, "_kDartVmSnapshotData")); - vm_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "_kDartVmSnapshotInstructions")); - default_isolate_snapshot_data = reinterpret_cast( - dlsym(library_handle, "_kDartIsolateSnapshotData")); - default_isolate_snapshot_instr = reinterpret_cast( - dlsym(library_handle, "_kDartIsolateSnapshotInstructions")); - } else { - FXL_CHECK(!aot_snapshot_path.empty()); - vm_snapshot_data = - MemMapSnapshot(aot_snapshot_path, "vm_snapshot_data", - settings.aot_vm_snapshot_data_filename, false); - vm_snapshot_instr = - MemMapSnapshot(aot_snapshot_path, "vm_snapshot_instr", - settings.aot_vm_snapshot_instr_filename, true); - default_isolate_snapshot_data = - MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_data", - settings.aot_isolate_snapshot_data_filename, false); - default_isolate_snapshot_instr = - MemMapSnapshot(aot_snapshot_path, "isolate_snapshot_instr", - settings.aot_isolate_snapshot_instr_filename, true); } -#else -#error Unknown OS -#endif - blink::InitRuntime(vm_snapshot_data, vm_snapshot_instr, - default_isolate_snapshot_data, - default_isolate_snapshot_instr, bundle_path); + + return isolate_running; } -const std::string Engine::main_entrypoint_ = "main"; +bool Engine::PrepareAndLaunchIsolate(RunConfiguration configuration) { + TRACE_EVENT0("flutter", "Engine::PrepareAndLaunchIsolate"); -void Engine::RunBundle(const std::string& bundle_path, - const std::string& entrypoint, - bool reuse_runtime_controller) { - TRACE_EVENT0("flutter", "Engine::RunBundle"); - ConfigureAssetBundle(bundle_path); - DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, - reuse_runtime_controller); -} + UpdateAssetManager(configuration.GetAssetManager()); -void Engine::DoRunBundle(const std::string& script_uri, - const std::string& entrypoint, - bool reuse_runtime_controller) { - ConfigureRuntime(script_uri, reuse_runtime_controller); - if (blink::IsRunningPrecompiledCode()) { - runtime_->dart_controller()->RunFromPrecompiledSnapshot(entrypoint); - } else { - std::vector kernel; - if (GetAssetAsBuffer(blink::kKernelAssetKey, &kernel)) { - runtime_->dart_controller()->RunFromKernel(kernel, entrypoint); - return; - } - std::vector snapshot; - if (!GetAssetAsBuffer(blink::kSnapshotAssetKey, &snapshot)) - return; - runtime_->dart_controller()->RunFromScriptSnapshot( - snapshot.data(), snapshot.size(), entrypoint); + auto isolate_configuration = configuration.TakeIsolateConfiguration(); + + auto isolate = runtime_controller_->GetRootIsolate(); + + if (!isolate_configuration->PrepareIsolate(isolate)) { + FXL_DLOG(ERROR) << "Could not prepare to run the isolate."; + return false; } -} -// TODO(jsimmons): merge this with RunBundle -void Engine::RunBundleWithAssets( - fxl::RefPtr asset_provider, - const std::string& bundle_path, - const std::string& entrypoint, - bool reuse_runtime_controller) { - TRACE_EVENT0("flutter", "Engine::RunBundleWithAssets"); - asset_provider_ = asset_provider; - DoRunBundle(GetScriptUriFromPath(bundle_path), entrypoint, - reuse_runtime_controller); -} - -void Engine::RunBundleAndSource(const std::string& bundle_path, - const std::string& main, - const std::string& packages, - bool reuse_runtime_controller) { - TRACE_EVENT0("flutter", "Engine::RunBundleAndSource"); - FXL_CHECK(!blink::IsRunningPrecompiledCode()) - << "Cannot run from source in a precompiled build."; - std::string packages_path = packages; - if (packages_path.empty()) - packages_path = FindPackagesPath(main); - - if (!bundle_path.empty()) - ConfigureAssetBundle(bundle_path); - - ConfigureRuntime(main, reuse_runtime_controller); - - if (blink::GetKernelPlatformBinary() != nullptr) { - std::vector kernel; - if (!files::ReadFileToVector(main, &kernel)) { - load_script_error_ = tonic::kUnknownErrorType; - } - load_script_error_ = runtime_->dart_controller()->RunFromKernel(kernel); - } else { - load_script_error_ = - runtime_->dart_controller()->RunFromSource(main, packages_path); + if (!isolate->Run(configuration.GetEntrypoint())) { + FXL_DLOG(ERROR) << "Could not run the isolate."; + return false; } + + return true; } void Engine::BeginFrame(fxl::TimePoint frame_time) { TRACE_EVENT0("flutter", "Engine::BeginFrame"); - if (runtime_) - runtime_->BeginFrame(frame_time); + runtime_controller_->BeginFrame(frame_time); } void Engine::NotifyIdle(int64_t deadline) { TRACE_EVENT0("flutter", "Engine::NotifyIdle"); - if (runtime_) - runtime_->NotifyIdle(deadline); -} - -void Engine::RunFromSource(const std::string& main, - const std::string& packages, - const std::string& bundle_path) { - RunBundleAndSource(bundle_path, main, packages); + runtime_controller_->NotifyIdle(deadline); } -void Engine::SetAssetBundlePath(const std::string& bundle_path) { - TRACE_EVENT0("flutter", "Engine::SetAssetBundlePath"); - ConfigureAssetBundle(bundle_path); +std::pair Engine::GetUIIsolateReturnCode() { + return runtime_controller_->GetRootIsolateReturnCode(); } Dart_Port Engine::GetUIIsolateMainPort() { - if (!runtime_) - return ILLEGAL_PORT; - return runtime_->GetMainPort(); + return runtime_controller_->GetMainPort(); } std::string Engine::GetUIIsolateName() { - if (!runtime_) { - return ""; - } - return runtime_->GetIsolateName(); + return runtime_controller_->GetIsolateName(); } bool Engine::UIIsolateHasLivePorts() { - if (!runtime_) - return false; - return runtime_->HasLivePorts(); + return runtime_controller_->HasLivePorts(); } tonic::DartErrorHandleType Engine::GetUIIsolateLastError() { - if (!runtime_) - return tonic::kNoError; - return runtime_->GetLastError(); + return runtime_controller_->GetLastError(); } tonic::DartErrorHandleType Engine::GetLoadScriptError() { return load_script_error_; } -void Engine::OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation) { - blink::Threads::Gpu()->PostTask(gpu_continuation); +void Engine::OnOutputSurfaceCreated() { have_surface_ = true; StartAnimatorIfPossible(); - if (runtime_) - ScheduleFrame(); + ScheduleFrame(); } -void Engine::OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation) { +void Engine::OnOutputSurfaceDestroyed() { have_surface_ = false; StopAnimator(); - blink::Threads::Gpu()->PostTask(gpu_continuation); } void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { @@ -436,8 +237,7 @@ void Engine::SetViewportMetrics(const blink::ViewportMetrics& metrics) { viewport_metrics_.physical_height != metrics.physical_height || viewport_metrics_.physical_width != metrics.physical_width; viewport_metrics_ = metrics; - if (runtime_) - runtime_->SetViewportMetrics(viewport_metrics_); + runtime_controller_->SetViewportMetrics(viewport_metrics_); if (animator_) { if (dimensions_changed) animator_->SetDimensionChangePending(); @@ -459,8 +259,7 @@ void Engine::DispatchPlatformMessage( return; } - if (runtime_) { - runtime_->DispatchPlatformMessage(std::move(message)); + if (runtime_controller_->DispatchPlatformMessage(std::move(message))) { return; } @@ -493,7 +292,6 @@ bool Engine::HandleLifecyclePlatformMessage(blink::PlatformMessage* message) { bool Engine::HandleNavigationPlatformMessage( fxl::RefPtr message) { - FXL_DCHECK(!runtime_); const auto& data = message->data(); rapidjson::Document document; @@ -532,99 +330,33 @@ bool Engine::HandleLocalizationPlatformMessage( if (!language.IsString() || !country.IsString()) return false; - language_code_ = language.GetString(); - country_code_ = country.GetString(); - if (runtime_) - runtime_->SetLocale(language_code_, country_code_); - return true; + return runtime_controller_->SetLocale(language.GetString(), + country.GetString()); } void Engine::HandleSettingsPlatformMessage(blink::PlatformMessage* message) { const auto& data = message->data(); std::string jsonData(reinterpret_cast(data.data()), data.size()); - user_settings_data_ = jsonData; - if (runtime_) { - runtime_->SetUserSettingsData(user_settings_data_); - if (have_surface_) - ScheduleFrame(); + if (runtime_controller_->SetUserSettingsData(std::move(jsonData)) && + have_surface_) { + ScheduleFrame(); } } -void Engine::DispatchPointerDataPacket(const PointerDataPacket& packet) { - if (runtime_) - runtime_->DispatchPointerDataPacket(packet); +void Engine::DispatchPointerDataPacket(const blink::PointerDataPacket& packet) { + runtime_controller_->DispatchPointerDataPacket(packet); } void Engine::DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args) { - if (runtime_) - runtime_->DispatchSemanticsAction(id, action, std::move(args)); + runtime_controller_->DispatchSemanticsAction(id, action, std::move(args)); } void Engine::SetSemanticsEnabled(bool enabled) { - semantics_enabled_ = enabled; - if (runtime_) - runtime_->SetSemanticsEnabled(semantics_enabled_); -} - -void Engine::ConfigureAssetBundle(const std::string& path) { - asset_provider_ = fxl::MakeRefCounted(path); - - struct stat stat_result = {}; - - // TODO(abarth): We should reset directory_asset_bundle_, but that might break - // custom font loading in hot reload. - - if (::stat(path.c_str(), &stat_result) != 0) { - FXL_LOG(INFO) << "Could not configure asset bundle at path: " << path; - return; - } - - std::string flx_path; - if (S_ISDIR(stat_result.st_mode)) { - flx_path = files::GetDirectoryName(path) + "/app.flx"; - } else if (S_ISREG(stat_result.st_mode)) { - flx_path = path; - } - - if (PathExists(flx_path)) { - asset_store_ = fxl::MakeRefCounted( - blink::GetUnzipperProviderForPath(flx_path)); - } -} - -void Engine::ConfigureRuntime(const std::string& script_uri, - bool reuse_runtime_controller) { - if (runtime_ && reuse_runtime_controller) { - return; - } - runtime_ = blink::RuntimeController::Create(this); - runtime_->CreateDartController(std::move(script_uri), - default_isolate_snapshot_data, - default_isolate_snapshot_instr); - runtime_->SetViewportMetrics(viewport_metrics_); - runtime_->SetLocale(language_code_, country_code_); - runtime_->SetUserSettingsData(user_settings_data_); - runtime_->SetSemanticsEnabled(semantics_enabled_); -} - -void Engine::DidCreateMainIsolate(Dart_Isolate isolate) { - if (blink::Settings::Get().use_test_fonts) { - blink::TestFontSelector::Install(); - if (!blink::Settings::Get().using_blink) - blink::FontCollection::ForProcess().RegisterTestFonts(); - } else if (asset_provider_) { - blink::AssetFontSelector::Install(asset_provider_); - if (!blink::Settings::Get().using_blink) { - blink::FontCollection::ForProcess().RegisterFontsFromAssetProvider( - asset_provider_); - } - } + runtime_controller_->SetSemanticsEnabled(enabled); } -void Engine::DidCreateSecondaryIsolate(Dart_Isolate isolate) {} - void Engine::StopAnimator() { animator_->Stop(); } @@ -659,49 +391,34 @@ void Engine::Render(std::unique_ptr layer_tree) { } void Engine::UpdateSemantics(blink::SemanticsNodeUpdates update) { - blink::Threads::Platform()->PostTask(fxl::MakeCopyable([ - platform_view = platform_view_.lock(), update = std::move(update) - ]() mutable { - if (platform_view) - platform_view->UpdateSemantics(std::move(update)); - })); + delegate_.OnEngineUpdateSemantics(*this, std::move(update)); } void Engine::HandlePlatformMessage( fxl::RefPtr message) { if (message->channel() == kAssetChannel) { HandleAssetPlatformMessage(std::move(message)); - return; + } else { + delegate_.OnEngineHandlePlatformMessage(*this, std::move(message)); } - blink::Threads::Platform()->PostTask([ - platform_view = platform_view_.lock(), message = std::move(message) - ]() mutable { - if (platform_view) - platform_view->HandlePlatformMessage(std::move(message)); - }); } void Engine::HandleAssetPlatformMessage( fxl::RefPtr message) { fxl::RefPtr response = message->response(); - if (!response) + if (!response) { return; + } const auto& data = message->data(); std::string asset_name(reinterpret_cast(data.data()), data.size()); + std::vector asset_data; - if (GetAssetAsBuffer(asset_name, &asset_data)) { + if (asset_manager_ && asset_manager_->GetAsBuffer(asset_name, &asset_data)) { response->Complete(std::move(asset_data)); } else { response->CompleteEmpty(); } } -bool Engine::GetAssetAsBuffer(const std::string& name, - std::vector* data) { - return ((asset_provider_ && - asset_provider_->GetAsBuffer(name, data)) || - (asset_store_ && asset_store_->GetAsBuffer(name, data))); -} - } // namespace shell diff --git a/shell/common/engine.h b/shell/common/engine.h index a0c5183338a43..ede442ee3e8a4 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -5,131 +5,144 @@ #ifndef SHELL_COMMON_ENGINE_H_ #define SHELL_COMMON_ENGINE_H_ -#include "flutter/assets/zip_asset_store.h" -#include "flutter/assets/asset_provider.h" +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "flutter/common/task_runners.h" +#include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/runtime/dart_vm.h" +#include "flutter/runtime/platform_impl.h" #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" +#include "flutter/shell/common/animator.h" #include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/run_configuration.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkPicture.h" -namespace blink { -class DirectoryAssetBundle; -class ZipAssetBundle; -} // namespace blink - namespace shell { -class PlatformView; -class Animator; -using PointerDataPacket = blink::PointerDataPacket; -class Engine : public blink::RuntimeDelegate { +class Engine final : public blink::RuntimeDelegate { public: - explicit Engine(PlatformView* platform_view); + class Delegate { + public: + virtual void OnEngineUpdateSemantics( + const Engine& engine, + blink::SemanticsNodeUpdates update) = 0; + + virtual void OnEngineHandlePlatformMessage( + const Engine& engine, + fxl::RefPtr message) = 0; + }; + + Engine(Delegate& delegate, + const blink::DartVM& vm, + blink::TaskRunners task_runners, + blink::Settings settings, + std::unique_ptr animator, + fml::WeakPtr resource_context, + fxl::RefPtr unref_queue); ~Engine() override; - fml::WeakPtr GetWeakPtr(); - - static void Init(const std::string& bundle_path); + fml::WeakPtr GetWeakPtr() const; - void RunBundle(const std::string& bundle_path, - const std::string& entrypoint = main_entrypoint_, - bool reuse_runtime_controller = false); + FXL_WARN_UNUSED_RESULT + bool Run(RunConfiguration configuration); - // Uses the given provider to locate assets. - void RunBundleWithAssets(fxl::RefPtr asset_provider, - const std::string& bundle_path, - const std::string& entrypoint = main_entrypoint_, - bool reuse_runtime_controller = false); + // Used to "cold reload" a running application where the shell (along with the + // platform view and its rasterizer bindings) remains the same but the root + // isolate is torn down and restarted with the new configuration. Only used in + // the development workflow. + FXL_WARN_UNUSED_RESULT + bool Restart(RunConfiguration configuration); - // Uses the given source code instead of looking inside the bundle for the - // source code. - void RunBundleAndSource(const std::string& bundle_path, - const std::string& main, - const std::string& packages, - bool reuse_runtime_controller = false); + bool UpdateAssetManager(fxl::RefPtr asset_manager); void BeginFrame(fxl::TimePoint frame_time); - void NotifyIdle(int64_t deadline); - void RunFromSource(const std::string& main, - const std::string& packages, - const std::string& bundle); - void SetAssetBundlePath(const std::string& bundle_path); + void NotifyIdle(int64_t deadline); Dart_Port GetUIIsolateMainPort(); + std::string GetUIIsolateName(); + bool UIIsolateHasLivePorts(); + tonic::DartErrorHandleType GetUIIsolateLastError(); + tonic::DartErrorHandleType GetLoadScriptError(); - void OnOutputSurfaceCreated(const fxl::Closure& gpu_continuation); - void OnOutputSurfaceDestroyed(const fxl::Closure& gpu_continuation); + std::pair GetUIIsolateReturnCode(); + + void OnOutputSurfaceCreated(); + + void OnOutputSurfaceDestroyed(); + void SetViewportMetrics(const blink::ViewportMetrics& metrics); + void DispatchPlatformMessage(fxl::RefPtr message); - void DispatchPointerDataPacket(const PointerDataPacket& packet); + + void DispatchPointerDataPacket(const blink::PointerDataPacket& packet); + void DispatchSemanticsAction(int id, blink::SemanticsAction action, std::vector args); + void SetSemanticsEnabled(bool enabled); - void ScheduleFrame(bool regenerate_layer_tree = true) override; - void set_rasterizer(fml::WeakPtr rasterizer); + void ScheduleFrame(bool regenerate_layer_tree = true) override; private: - // RuntimeDelegate methods: + Engine::Delegate& delegate_; + const blink::Settings settings_; + std::unique_ptr animator_; + std::unique_ptr runtime_controller_; + std::unique_ptr legacy_sky_platform_; + tonic::DartErrorHandleType load_script_error_; + std::string initial_route_; + blink::ViewportMetrics viewport_metrics_; + fxl::RefPtr asset_manager_; + bool activity_running_; + bool have_surface_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + // |blink::RuntimeDelegate| std::string DefaultRouteName() override; + + // |blink::RuntimeDelegate| void Render(std::unique_ptr layer_tree) override; + + // |blink::RuntimeDelegate| void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + // |blink::RuntimeDelegate| void HandlePlatformMessage( fxl::RefPtr message) override; - void DidCreateMainIsolate(Dart_Isolate isolate) override; - void DidCreateSecondaryIsolate(Dart_Isolate isolate) override; void StopAnimator(); - void StartAnimatorIfPossible(); - - void DoRunBundle(const std::string& script_uri, - const std::string& entrypoint, - bool reuse_runtime_controller); - void ConfigureAssetBundle(const std::string& path); - void ConfigureRuntime(const std::string& script_uri, - bool reuse_runtime_controller = false); + void StartAnimatorIfPossible(); bool HandleLifecyclePlatformMessage(blink::PlatformMessage* message); + bool HandleNavigationPlatformMessage( fxl::RefPtr message); + bool HandleLocalizationPlatformMessage(blink::PlatformMessage* message); + void HandleSettingsPlatformMessage(blink::PlatformMessage* message); void HandleAssetPlatformMessage(fxl::RefPtr message); - bool GetAssetAsBuffer(const std::string& name, std::vector* data); - static const std::string main_entrypoint_; + bool GetAssetAsBuffer(const std::string& name, std::vector* data); - fxl::RefPtr asset_provider_; - std::weak_ptr platform_view_; - std::unique_ptr animator_; - std::unique_ptr runtime_; - tonic::DartErrorHandleType load_script_error_; - std::string initial_route_; - blink::ViewportMetrics viewport_metrics_; - std::string language_code_; - std::string country_code_; - std::string user_settings_data_; - bool semantics_enabled_ = false; - // TODO(zarah): Remove usage of asset_store_ once app.flx is removed. - fxl::RefPtr asset_store_; - fxl::RefPtr directory_asset_bundle_; - // TODO(eseidel): This should move into an AnimatorStateMachine. - bool activity_running_; - bool have_surface_; - fml::WeakPtrFactory weak_factory_; + bool PrepareAndLaunchIsolate(RunConfiguration configuration); FXL_DISALLOW_COPY_AND_ASSIGN(Engine); }; diff --git a/shell/common/io_manager.cc b/shell/common/io_manager.cc new file mode 100644 index 0000000000000..4161422978fcf --- /dev/null +++ b/shell/common/io_manager.cc @@ -0,0 +1,73 @@ +// Copyright 2017 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/shell/common/io_manager.h" + +#include "flutter/fml/message_loop.h" +#include "third_party/skia/include/gpu/gl/GrGLInterface.h" + +namespace shell { + +sk_sp IOManager::CreateCompatibleResourceLoadingContext( + GrBackend backend) { + if (backend != GrBackend::kOpenGL_GrBackend) { + return nullptr; + } + + GrContextOptions options = {}; + + // There is currently a bug with doing GPU YUV to RGB conversions on the IO + // thread. The necessary work isn't being flushed or synchronized with the + // other threads correctly, so the textures end up blank. For now, suppress + // that feature, which will cause texture uploads to do CPU YUV conversion. + options.fDisableGpuYUVConversion = true; + + if (auto context = GrContext::MakeGL(GrGLMakeNativeInterface(), options)) { + // Do not cache textures created by the image decoder. These textures + // should be deleted when they are no longer referenced by an SkImage. + context->setResourceCacheLimits(0, 0); + return context; + } + + return nullptr; +} + +IOManager::IOManager(sk_sp resource_context, + fxl::RefPtr unref_queue_task_runner) + : resource_context_(std::move(resource_context)), + resource_context_weak_factory_( + resource_context_ ? std::make_unique>( + resource_context_.get()) + : nullptr), + unref_queue_(fxl::MakeRefCounted( + std::move(unref_queue_task_runner), + fxl::TimeDelta::FromMilliseconds(250))), + weak_factory_(this) { + if (!resource_context_) { + FXL_DLOG(WARNING) << "The IO manager was initialized without a resource " + "context. Async texture uploads will be disabled. " + "Expect performance degradation."; + } + + if (resource_context_weak_factory_) { + resource_context_weak_prototype_ = + resource_context_weak_factory_->GetWeakPtr(); + } +} + +IOManager::~IOManager() { + // Last chance to drain the IO queue as the platform side reference to the + // underlying OpenGL context may be going away. + unref_queue_->Drain(); +} + +fml::WeakPtr IOManager::GetResourceContext() const { + return resource_context_weak_prototype_; +} + +fxl::RefPtr IOManager::GetSkiaUnrefQueue() const { + return unref_queue_; +} + +} // namespace shell diff --git a/shell/common/io_manager.h b/shell/common/io_manager.h new file mode 100644 index 0000000000000..1077a28d0ae36 --- /dev/null +++ b/shell/common/io_manager.h @@ -0,0 +1,52 @@ +// Copyright 2017 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_SHELL_COMMON_IO_MANAGER_H_ +#define FLUTTER_SHELL_COMMON_IO_MANAGER_H_ + +#include + +#include "flutter/flow/skia_gpu_object.h" +#include "flutter/fml/memory/weak_ptr.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" +#include "third_party/skia/include/gpu/GrContext.h" + +namespace shell { + +class IOManager { + public: + // Convenience methods for platforms to create a GrContext used to supply to + // the IOManager. The platforms may create the context themselves if they so + // desire. + static sk_sp CreateCompatibleResourceLoadingContext( + GrBackend backend); + + IOManager(sk_sp resource_context, + fxl::RefPtr unref_queue_task_runner); + + ~IOManager(); + + fml::WeakPtr GetResourceContext() const; + + fxl::RefPtr GetSkiaUnrefQueue() const; + + private: + // Resource context management. + sk_sp resource_context_; + fml::WeakPtr resource_context_weak_prototype_; + std::unique_ptr> + resource_context_weak_factory_; + + // Unref queue management. + fxl::RefPtr unref_queue_; + + fml::WeakPtrFactory weak_factory_; + + FXL_DISALLOW_COPY_AND_ASSIGN(IOManager); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_IO_MANAGER_H_ diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc new file mode 100644 index 0000000000000..3c634022a348f --- /dev/null +++ b/shell/common/isolate_configuration.cc @@ -0,0 +1,148 @@ +// Copyright 2018 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/shell/common/isolate_configuration.h" + +#include "flutter/runtime/dart_vm.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace shell { + +IsolateConfiguration::IsolateConfiguration() = default; + +IsolateConfiguration::~IsolateConfiguration() = default; + +bool IsolateConfiguration::PrepareIsolate( + fml::WeakPtr isolate) { + if (!isolate) { + return false; + } + + if (isolate->GetPhase() != blink::DartIsolate::Phase::LibrariesSetup) { + FXL_DLOG(ERROR) + << "Isolate was in incorrect phase to be prepared for running."; + return false; + } + + return DoPrepareIsolate(*isolate); +} + +class PrecompiledIsolateConfiguration final : public IsolateConfiguration { + public: + PrecompiledIsolateConfiguration() = default; + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (!blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + return isolate.PrepareForRunningFromPrecompiledCode(); + } + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(PrecompiledIsolateConfiguration); +}; + +class SnapshotIsolateConfiguration : public IsolateConfiguration { + public: + SnapshotIsolateConfiguration(std::unique_ptr snapshot) + : snapshot_(std::move(snapshot)) {} + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + return isolate.PrepareForRunningFromSnapshot(std::move(snapshot_)); + } + + private: + std::unique_ptr snapshot_; + + FXL_DISALLOW_COPY_AND_ASSIGN(SnapshotIsolateConfiguration); +}; + +class SourceIsolateConfiguration final : public IsolateConfiguration { + public: + SourceIsolateConfiguration(std::string main_path, std::string packages_path) + : main_path_(std::move(main_path)), + packages_path_(std::move(packages_path)) {} + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + return isolate.PrepareForRunningFromSource(std::move(main_path_), + std::move(packages_path_)); + } + + private: + std::string main_path_; + std::string packages_path_; + + FXL_DISALLOW_COPY_AND_ASSIGN(SourceIsolateConfiguration); +}; + +std::unique_ptr IsolateConfiguration::InferFromSettings( + const blink::Settings& settings, + fxl::RefPtr asset_manager) { + // Running in AOT mode. + if (blink::DartVM::IsRunningPrecompiledCode()) { + return CreateForPrecompiledCode(); + } + + // Run from sources. + { + const auto& main = settings.main_dart_file_path; + const auto& packages = settings.packages_file_path; + if (main.size() != 0 && packages.size() != 0) { + return CreateForSource(std::move(main), std::move(packages)); + } + } + + // Running from kernel snapshot. + { + std::vector kernel; + if (asset_manager && asset_manager->GetAsBuffer( + settings.application_kernel_asset, &kernel)) { + return CreateForSnapshot( + std::make_unique(std::move(kernel))); + } + } + + // Running from script snapshot. + { + std::vector script_snapshot; + if (asset_manager && asset_manager->GetAsBuffer( + settings.script_snapshot_path, &script_snapshot)) { + return CreateForSnapshot( + std::make_unique(std::move(script_snapshot))); + } + } + + return nullptr; +} + +std::unique_ptr +IsolateConfiguration::CreateForPrecompiledCode() { + return std::make_unique(); +} + +std::unique_ptr IsolateConfiguration::CreateForSnapshot( + std::unique_ptr snapshot) { + return std::make_unique(std::move(snapshot)); +} + +std::unique_ptr IsolateConfiguration::CreateForSource( + std::string main_path, + std::string packages_path) { + return std::make_unique(std::move(main_path), + std::move(packages_path)); +} + +} // namespace shell diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h new file mode 100644 index 0000000000000..82d06dac621b2 --- /dev/null +++ b/shell/common/isolate_configuration.h @@ -0,0 +1,51 @@ +// Copyright 2018 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_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ +#define FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ + +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "flutter/assets/asset_resolver.h" +#include "flutter/common/settings.h" +#include "flutter/fml/mapping.h" +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/runtime/dart_isolate.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class IsolateConfiguration { + public: + static std::unique_ptr InferFromSettings( + const blink::Settings& settings, + fxl::RefPtr asset_manager); + + static std::unique_ptr CreateForPrecompiledCode(); + + static std::unique_ptr CreateForSnapshot( + std::unique_ptr snapshot); + + static std::unique_ptr CreateForSource( + std::string main_path, + std::string packages_path); + + IsolateConfiguration(); + + virtual ~IsolateConfiguration(); + + bool PrepareIsolate(fml::WeakPtr isolate); + + protected: + virtual bool DoPrepareIsolate(blink::DartIsolate& isolate) = 0; + + private: + FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfiguration); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_ISOLATE_CONFIGURATION_H_ diff --git a/shell/common/null_platform_view.cc b/shell/common/null_platform_view.cc deleted file mode 100644 index 49fdf5a935b80..0000000000000 --- a/shell/common/null_platform_view.cc +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/shell/common/null_platform_view.h" - -#include "flutter/shell/common/null_rasterizer.h" -#include "flutter/shell/common/shell.h" - -namespace shell { - -NullPlatformView::NullPlatformView() - : PlatformView(std::make_unique()), weak_factory_(this) {} - -void NullPlatformView::Attach() { - CreateEngine(); -} - -NullPlatformView::~NullPlatformView() = default; - -fxl::WeakPtr NullPlatformView::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} - -bool NullPlatformView::ResourceContextMakeCurrent() { - return false; -} - -// Hot-reload of the null platform view is not supported. -void NullPlatformView::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) {} - -void NullPlatformView::SetAssetBundlePath(const std::string& assets_directory) { -} - -} // namespace shell diff --git a/shell/common/null_platform_view.h b/shell/common/null_platform_view.h deleted file mode 100644 index eb23d67b48a7c..0000000000000 --- a/shell/common/null_platform_view.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2017 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. - -#ifndef COMMON_NULL_PLATFORM_VIEW_H_ -#define COMMON_NULL_PLATFORM_VIEW_H_ - -#include "flutter/shell/common/platform_view.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class NullPlatformView : public PlatformView { - public: - NullPlatformView(); - - ~NullPlatformView(); - - fxl::WeakPtr GetWeakPtr(); - - virtual void Attach() override; - - bool ResourceContextMakeCurrent() override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - void SetAssetBundlePath(const std::string& assets_directory) override; - - private: - fxl::WeakPtrFactory weak_factory_; - - FXL_DISALLOW_COPY_AND_ASSIGN(NullPlatformView); -}; - -} // namespace shell - -#endif // COMMON_NULL_PLATFORM_VIEW_H_ diff --git a/shell/common/null_rasterizer.cc b/shell/common/null_rasterizer.cc deleted file mode 100644 index 81efdd11d4970..0000000000000 --- a/shell/common/null_rasterizer.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/common/null_rasterizer.h" - -namespace shell { - -NullRasterizer::NullRasterizer() : weak_factory_(this) {} - -void NullRasterizer::Setup( - std::unique_ptr surface_or_null, - fxl::Closure rasterizer_continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) { - surface_ = std::move(surface_or_null); - rasterizer_continuation(); - setup_completion_event->Signal(); -} - -void NullRasterizer::Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) { - if (surface_) { - surface_.reset(); - } - teardown_completion_event->Signal(); -} - -fml::WeakPtr NullRasterizer::GetWeakRasterizerPtr() { - return weak_factory_.GetWeakPtr(); -} - -flow::LayerTree* NullRasterizer::GetLastLayerTree() { - return nullptr; -} - -void NullRasterizer::DrawLastLayerTree() { - // Null rasterizer. Nothing to do. -} - -flow::TextureRegistry& NullRasterizer::GetTextureRegistry() { - return *texture_registry_; -} - -void NullRasterizer::Clear(SkColor color, const SkISize& size) { - // Null rasterizer. Nothing to do. -} - -void NullRasterizer::Draw( - fxl::RefPtr> pipeline) { - FXL_ALLOW_UNUSED_LOCAL( - pipeline->Consume([](std::unique_ptr) { - // Drop the layer tree on the floor. We only need the pipeline empty so - // that frame requests are not deferred indefinitely due to - // backpressure. - })); -} - -void NullRasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { - // Null rasterizer. Nothing to do. -} - -void NullRasterizer::SetTextureRegistry( - flow::TextureRegistry* textureRegistry) { - texture_registry_ = textureRegistry; -} - -} // namespace shell diff --git a/shell/common/null_rasterizer.h b/shell/common/null_rasterizer.h deleted file mode 100644 index 8558a3c3accaa..0000000000000 --- a/shell/common/null_rasterizer.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ -#define FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ - -#include "flutter/shell/common/rasterizer.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class NullRasterizer : public Rasterizer { - public: - NullRasterizer(); - - void Setup(std::unique_ptr surface_or_null, - fxl::Closure rasterizer_continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) override; - - void Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) override; - - void Clear(SkColor color, const SkISize& size) override; - - fml::WeakPtr GetWeakRasterizerPtr() override; - - flow::LayerTree* GetLastLayerTree() override; - - void DrawLastLayerTree() override; - - flow::TextureRegistry& GetTextureRegistry() override; - - void Draw(fxl::RefPtr> pipeline) override; - - void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; - - void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; - - private: - std::unique_ptr surface_; - fml::WeakPtrFactory weak_factory_; - flow::TextureRegistry* texture_registry_; - - FXL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_ diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index 2d5715a1733bd..b2bfce051a5bf 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -6,124 +6,74 @@ #include -#include "flutter/common/threads.h" -#include "flutter/lib/ui/painting/resource_context.h" #include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" #include "flutter/shell/common/vsync_waiter_fallback.h" #include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" namespace shell { -PlatformView::PlatformView(std::unique_ptr rasterizer) - : rasterizer_(std::move(rasterizer)), size_(SkISize::Make(0, 0)) { - rasterizer_->SetTextureRegistry(&texture_registry_); - Shell::Shared().AddPlatformView(this); +PlatformView::PlatformView(Delegate& delegate, blink::TaskRunners task_runners) + : delegate_(delegate), + task_runners_(std::move(task_runners)), + size_(SkISize::Make(0, 0)), + weak_factory_(this) { + weak_prototype_ = weak_factory_.GetWeakPtr(); } -PlatformView::~PlatformView() { - Shell::Shared().RemovePlatformView(this); +PlatformView::~PlatformView() = default; - Rasterizer* rasterizer = rasterizer_.release(); - blink::Threads::Gpu()->PostTask([rasterizer]() { delete rasterizer; }); - - Engine* engine = engine_.release(); - blink::Threads::UI()->PostTask([engine]() { delete engine; }); -} - -void PlatformView::SetRasterizer(std::unique_ptr rasterizer) { - Rasterizer* r = rasterizer_.release(); - blink::Threads::Gpu()->PostTask([r]() { delete r; }); - rasterizer_ = std::move(rasterizer); - rasterizer_->SetTextureRegistry(&texture_registry_); - engine_->set_rasterizer(rasterizer_->GetWeakRasterizerPtr()); -} - -void PlatformView::CreateEngine() { - engine_.reset(new Engine(this)); +std::unique_ptr PlatformView::CreateVSyncWaiter() { + FXL_DLOG(WARNING) + << "This platform does not provide a Vsync waiter implementation. A " + "simple timer based fallback is being used."; + return std::make_unique(task_runners_); } void PlatformView::DispatchPlatformMessage( fxl::RefPtr message) { - blink::Threads::UI()->PostTask( - [engine = engine_->GetWeakPtr(), message = std::move(message)] { - if (engine) { - engine->DispatchPlatformMessage(message); - } - }); + delegate_.OnPlatformViewDispatchPlatformMessage(*this, std::move(message)); +} + +void PlatformView::DispatchPointerDataPacket( + std::unique_ptr packet) { + delegate_.OnPlatformViewDispatchPointerDataPacket(*this, std::move(packet)); } void PlatformView::DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args) { - blink::Threads::UI()->PostTask( - [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { - if (engine) { - engine->DispatchSemanticsAction( - id, static_cast(action), std::move(args)); - } - }); + delegate_.OnPlatformViewDispatchSemanticsAction(*this, id, action, + std::move(args)); } void PlatformView::SetSemanticsEnabled(bool enabled) { - blink::Threads::UI()->PostTask([engine = engine_->GetWeakPtr(), enabled] { - if (engine) - engine->SetSemanticsEnabled(enabled); - }); + delegate_.OnPlatformViewSetSemanticsEnabled(*this, enabled); } -void PlatformView::NotifyCreated(std::unique_ptr surface) { - NotifyCreated(std::move(surface), []() {}); +void PlatformView::SetViewportMetrics(const blink::ViewportMetrics& metrics) { + delegate_.OnPlatformViewSetViewportMetrics(*this, metrics); } -void PlatformView::NotifyCreated(std::unique_ptr surface, - fxl::Closure caller_continuation) { - fxl::AutoResetWaitableEvent latch; - - auto ui_continuation = fxl::MakeCopyable([this, // - surface = std::move(surface), // - caller_continuation, // - &latch]() mutable { - auto gpu_continuation = fxl::MakeCopyable([this, // - surface = std::move(surface), // - caller_continuation, // - &latch]() mutable { - // Runs on the GPU Thread. So does the Caller Continuation. - rasterizer_->Setup(std::move(surface), caller_continuation, &latch); - }); - // Runs on the UI Thread. - engine_->OnOutputSurfaceCreated(std::move(gpu_continuation)); - }); - - // Runs on the Platform Thread. - blink::Threads::UI()->PostTask(std::move(ui_continuation)); - - latch.Wait(); +void PlatformView::NotifyCreated() { + delegate_.OnPlatformViewCreated(*this, CreateRenderingSurface()); } void PlatformView::NotifyDestroyed() { - fxl::AutoResetWaitableEvent latch; - - auto engine_continuation = [this, &latch]() { - rasterizer_->Teardown(&latch); - }; - - blink::Threads::UI()->PostTask([this, engine_continuation]() { - engine_->OnOutputSurfaceDestroyed(engine_continuation); - }); - - latch.Wait(); + delegate_.OnPlatformViewDestroyed(*this); } -std::weak_ptr PlatformView::GetWeakPtr() { - return shared_from_this(); +sk_sp PlatformView::CreateResourceContext() const { + FXL_DLOG(WARNING) << "This platform does not setup the resource " + "context on the IO thread for async texture uploads."; + return nullptr; } -VsyncWaiter* PlatformView::GetVsyncWaiter() { - if (!vsync_waiter_) - vsync_waiter_ = std::make_unique(); - return vsync_waiter_.get(); +fml::WeakPtr PlatformView::GetWeakPtr() const { + return weak_prototype_; } void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) {} @@ -135,71 +85,31 @@ void PlatformView::HandlePlatformMessage( } void PlatformView::RegisterTexture(std::shared_ptr texture) { - ASSERT_IS_PLATFORM_THREAD - blink::Threads::Gpu()->PostTask([this, texture]() { - rasterizer_->GetTextureRegistry().RegisterTexture(texture); - }); + delegate_.OnPlatformViewRegisterTexture(*this, std::move(texture)); } void PlatformView::UnregisterTexture(int64_t texture_id) { - ASSERT_IS_PLATFORM_THREAD - blink::Threads::Gpu()->PostTask([this, texture_id]() { - rasterizer_->GetTextureRegistry().UnregisterTexture(texture_id); - }); + delegate_.OnPlatformViewUnregisterTexture(*this, texture_id); } void PlatformView::MarkTextureFrameAvailable(int64_t texture_id) { - ASSERT_IS_PLATFORM_THREAD - blink::Threads::UI()->PostTask([this]() { engine_->ScheduleFrame(false); }); + delegate_.OnPlatformViewMarkTextureFrameAvailable(*this, texture_id); } -void PlatformView::SetupResourceContextOnIOThread() { - fxl::AutoResetWaitableEvent latch; - - blink::Threads::IO()->PostTask( - [this, &latch]() { SetupResourceContextOnIOThreadPerform(&latch); }); - - latch.Wait(); +std::unique_ptr PlatformView::CreateRenderingSurface() { + // We have a default implementation because tests create a platform view but + // never a rendering surface. + FXL_DCHECK(false) << "This platform does not provide a rendering surface but " + "it was notified of surface rendering surface creation."; + return nullptr; } -void PlatformView::SetupResourceContextOnIOThreadPerform( - fxl::AutoResetWaitableEvent* latch) { - std::unique_ptr resourceContext = - blink::ResourceContext::Acquire(); - if (resourceContext->Get() != nullptr) { - // The resource context was already setup. This could happen if platforms - // try to setup a context multiple times, or, if there are multiple platform - // views. In any case, there is nothing else to do. So just signal the - // latch. - latch->Signal(); +void PlatformView::SetNextFrameCallback(fxl::Closure closure) { + if (!closure) { return; } - bool current = ResourceContextMakeCurrent(); - - if (!current) { - FXL_DLOG(WARNING) - << "WARNING: Could not setup a context on the resource loader."; - latch->Signal(); - return; - } - - GrContextOptions options; - // There is currently a bug with doing GPU YUV to RGB conversions on the IO - // thread. The necessary work isn't being flushed or synchronized with the - // other threads correctly, so the textures end up blank. For now, suppress - // that feature, which will cause texture uploads to do CPU YUV conversion. - options.fDisableGpuYUVConversion = true; - - blink::ResourceContext::Set( - GrContext::MakeGL(GrGLMakeNativeInterface(), options)); - - // Do not cache textures created by the image decoder. These textures should - // be deleted when they are no longer referenced by an SkImage. - if (resourceContext->Get()) - resourceContext->Get()->setResourceCacheLimits(0, 0); - - latch->Signal(); + delegate_.OnPlatformViewSetNextFrameCallback(*this, std::move(closure)); } } // namespace shell diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 66b1fcae10c79..56179a6114777 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -7,63 +7,104 @@ #include +#include "flutter/common/task_runners.h" #include "flutter/flow/texture.h" +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/lib/ui/semantics/semantics_node.h" -#include "flutter/shell/common/engine.h" -#include "flutter/shell/common/shell.h" +#include "flutter/lib/ui/window/platform_message.h" +#include "flutter/lib/ui/window/pointer_data_packet.h" +#include "flutter/lib/ui/window/viewport_metrics.h" #include "flutter/shell/common/surface.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/core/SkSize.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { -class Rasterizer; +class Shell; -class PlatformView : public std::enable_shared_from_this { +class PlatformView { public: - struct SurfaceConfig { - uint8_t red_bits = 8; - uint8_t green_bits = 8; - uint8_t blue_bits = 8; - uint8_t alpha_bits = 8; - uint8_t depth_bits = 0; - uint8_t stencil_bits = 0; + class Delegate { + public: + virtual void OnPlatformViewCreated(const PlatformView& view, + std::unique_ptr surface) = 0; + + virtual void OnPlatformViewDestroyed(const PlatformView& view) = 0; + + virtual void OnPlatformViewSetNextFrameCallback(const PlatformView& view, + fxl::Closure closure) = 0; + + virtual void OnPlatformViewSetViewportMetrics( + const PlatformView& view, + const blink::ViewportMetrics& metrics) = 0; + + virtual void OnPlatformViewDispatchPlatformMessage( + const PlatformView& view, + fxl::RefPtr message) = 0; + + virtual void OnPlatformViewDispatchPointerDataPacket( + const PlatformView& view, + std::unique_ptr packet) = 0; + + virtual void OnPlatformViewDispatchSemanticsAction( + const PlatformView& view, + int32_t id, + blink::SemanticsAction action, + std::vector args) = 0; + + virtual void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, + bool enabled) = 0; + + virtual void OnPlatformViewRegisterTexture( + const PlatformView& view, + std::shared_ptr texture) = 0; + + virtual void OnPlatformViewUnregisterTexture(const PlatformView& view, + int64_t texture_id) = 0; + + virtual void OnPlatformViewMarkTextureFrameAvailable( + const PlatformView& view, + int64_t texture_id) = 0; }; - void SetupResourceContextOnIOThread(); + explicit PlatformView(Delegate& delegate, blink::TaskRunners task_runners); virtual ~PlatformView(); - virtual void Attach() = 0; + virtual std::unique_ptr CreateVSyncWaiter(); void DispatchPlatformMessage(fxl::RefPtr message); + void DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args); - void SetSemanticsEnabled(bool enabled); - void NotifyCreated(std::unique_ptr surface); + virtual void SetSemanticsEnabled(bool enabled); - void NotifyCreated(std::unique_ptr surface, - fxl::Closure continuation); + void SetViewportMetrics(const blink::ViewportMetrics& metrics); - void NotifyDestroyed(); + void NotifyCreated(); - std::weak_ptr GetWeakPtr(); + virtual void NotifyDestroyed(); - // The VsyncWaiter will live at least as long as the PlatformView. - virtual VsyncWaiter* GetVsyncWaiter(); + // Unlike all other methods on the platform view, this one may be called on a + // non-platform task runner. + virtual sk_sp CreateResourceContext() const; - virtual bool ResourceContextMakeCurrent() = 0; + fml::WeakPtr GetWeakPtr() const; virtual void UpdateSemantics(blink::SemanticsNodeUpdates update); + virtual void HandlePlatformMessage( fxl::RefPtr message); + void SetNextFrameCallback(fxl::Closure closure); + + void DispatchPointerDataPacket( + std::unique_ptr packet); + // Called once per texture, on the platform thread. void RegisterTexture(std::shared_ptr texture); @@ -71,34 +112,18 @@ class PlatformView : public std::enable_shared_from_this { void UnregisterTexture(int64_t texture_id); // Called once per texture update (e.g. video frame), on the platform thread. - virtual void MarkTextureFrameAvailable(int64_t texture_id); - - void SetRasterizer(std::unique_ptr rasterizer); - - Rasterizer& rasterizer() { return *rasterizer_; } - Engine& engine() { return *engine_; } - - virtual void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) = 0; - - virtual void SetAssetBundlePath(const std::string& assets_directory) = 0; + void MarkTextureFrameAvailable(int64_t texture_id); protected: - explicit PlatformView(std::unique_ptr rasterizer); - - void CreateEngine(); - - void SetupResourceContextOnIOThreadPerform( - fxl::AutoResetWaitableEvent* event); - - SurfaceConfig surface_config_; - std::unique_ptr rasterizer_; - flow::TextureRegistry texture_registry_; - std::unique_ptr engine_; + PlatformView::Delegate& delegate_; + const blink::TaskRunners task_runners_; std::unique_ptr vsync_waiter_; SkISize size_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + virtual std::unique_ptr CreateRenderingSurface(); private: FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); diff --git a/shell/common/platform_view_service_protocol.cc b/shell/common/platform_view_service_protocol.cc deleted file mode 100644 index 8785c4812e202..0000000000000 --- a/shell/common/platform_view_service_protocol.cc +++ /dev/null @@ -1,447 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/common/platform_view_service_protocol.h" - -#include - -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/shell/common/picture_serializer.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/shell.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/src/utils/SkBase64.h" - -namespace shell { -namespace { - -constexpr char kViewIdPrefx[] = "_flutterView/"; -constexpr size_t kViewIdPrefxLength = sizeof(kViewIdPrefx) - 1; - -static intptr_t KeyIndex(const char** param_keys, - intptr_t num_params, - const char* key) { - if (param_keys == NULL) { - return -1; - } - for (intptr_t i = 0; i < num_params; i++) { - if (strcmp(param_keys[i], key) == 0) { - return i; - } - } - return -1; -} - -static const char* ValueForKey(const char** param_keys, - const char** param_values, - intptr_t num_params, - const char* key) { - intptr_t index = KeyIndex(param_keys, num_params, key); - if (index < 0) { - return NULL; - } - return param_values[index]; -} - -static bool ErrorMissingParameter(const char** json_object, const char* name) { - const intptr_t kInvalidParams = -32602; - std::stringstream response; - response << "{\"code\":" << std::to_string(kInvalidParams) << ","; - response << "\"message\":\"Invalid params\","; - response << "\"data\": {\"details\": \"" << name << "\"}}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static bool ErrorBadParameter(const char** json_object, - const char* name, - const char* value) { - const intptr_t kInvalidParams = -32602; - std::stringstream response; - response << "{\"code\":" << std::to_string(kInvalidParams) << ","; - response << "\"message\":\"Invalid params\","; - response << "\"data\": {\"details\": \"parameter: " << name << " has a bad "; - response << "value: " << value << "\"}}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static bool ErrorUnknownView(const char** json_object, const char* view_id) { - const intptr_t kInvalidParams = -32602; - std::stringstream response; - response << "{\"code\":" << std::to_string(kInvalidParams) << ","; - response << "\"message\":\"Invalid params\","; - response << "\"data\": {\"details\": \"view not found: " << view_id << "\"}}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static bool ErrorServer(const char** json_object, const char* message) { - const intptr_t kServerError = -32000; - std::stringstream response; - response << "{\"code\":" << std::to_string(kServerError) << ","; - response << "\"message\":\"" << message << "\"}"; - *json_object = strdup(response.str().c_str()); - return false; -} - -static void AppendIsolateRef(std::stringstream* stream, - int64_t main_port, - const std::string name) { - *stream << "{\"type\":\"@Isolate\",\"fixedId\":true,\"id\":\"isolates/"; - *stream << main_port << "\",\"name\":\"" << name << "\","; - *stream << "\"number\":\"" << main_port << "\"}"; -} - -static void AppendFlutterView(std::stringstream* stream, - uintptr_t view_id, - int64_t isolate_id, - const std::string isolate_name) { - *stream << "{\"type\":\"FlutterView\", \"id\": \"" << kViewIdPrefx << "0x" - << std::hex << view_id << std::dec << "\""; - if (isolate_id != ILLEGAL_PORT) { - // Append the isolate (if it exists). - *stream << "," - << "\"isolate\":"; - AppendIsolateRef(stream, isolate_id, isolate_name); - } - *stream << "}"; -} - -} // namespace - -void PlatformViewServiceProtocol::RegisterHook(bool running_precompiled_code) { - // Listing of FlutterViews. - Dart_RegisterRootServiceRequestCallback(kListViewsExtensionName, &ListViews, - nullptr); - // Screenshot. - Dart_RegisterRootServiceRequestCallback(kScreenshotExtensionName, &Screenshot, - nullptr); - - // SkPicture Screenshot. - Dart_RegisterRootServiceRequestCallback(kScreenshotSkpExtensionName, - &ScreenshotSkp, nullptr); - - // The following set of service protocol extensions require debug build - if (running_precompiled_code) { - return; - } - Dart_RegisterRootServiceRequestCallback(kRunInViewExtensionName, &RunInView, - nullptr); - Dart_RegisterRootServiceRequestCallback(kSetAssetBundlePathExtensionName, - &SetAssetBundlePath, nullptr); - // [benchmark helper] Wait for the UI Thread to idle. - Dart_RegisterRootServiceRequestCallback(kFlushUIThreadTasksExtensionName, - &FlushUIThreadTasks, nullptr); -} - -const char* PlatformViewServiceProtocol::kRunInViewExtensionName = - "_flutter.runInView"; - -bool PlatformViewServiceProtocol::RunInView(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - const char* view_id = - ValueForKey(param_keys, param_values, num_params, "viewId"); - const char* asset_directory = - ValueForKey(param_keys, param_values, num_params, "assetDirectory"); - const char* main_script = - ValueForKey(param_keys, param_values, num_params, "mainScript"); - const char* packages_file = - ValueForKey(param_keys, param_values, num_params, "packagesFile"); - if (view_id == NULL) { - return ErrorMissingParameter(json_object, "viewId"); - } - if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { - return ErrorBadParameter(json_object, "viewId", view_id); - } - if (asset_directory == NULL) { - return ErrorMissingParameter(json_object, "assetDirectory"); - } - if (main_script == NULL) { - return ErrorMissingParameter(json_object, "mainScript"); - } - if (packages_file == NULL) { - return ErrorMissingParameter(json_object, "packagesFile"); - } - - // Convert the actual flutter view hex id into a number. - uintptr_t view_id_as_num = - std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); - - // Ask the Shell to run this script in the specified view. This will run a - // task on the UI thread before returning. - Shell& shell = Shell::Shared(); - bool view_existed = false; - Dart_Port main_port = ILLEGAL_PORT; - std::string isolate_name; - shell.RunInPlatformView(view_id_as_num, main_script, packages_file, - asset_directory, &view_existed, &main_port, - &isolate_name); - - if (!view_existed) { - // If the view did not exist this request has definitely failed. - return ErrorUnknownView(json_object, view_id); - } - - // The view existed and the isolate was created. Success. - std::stringstream response; - response << "{\"type\":\"Success\"," - << "\"view\":"; - AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); - response << "}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -const char* PlatformViewServiceProtocol::kListViewsExtensionName = - "_flutter.listViews"; - -bool PlatformViewServiceProtocol::ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - std::stringstream response; - response << "{\"type\":\"FlutterViewList\",\"views\":["; - bool prefix_comma = false; - Shell::Shared().IteratePlatformViews( - [&response, &prefix_comma](PlatformView* view) -> bool { - if (prefix_comma) { - response << ','; - } else { - prefix_comma = true; - } - AppendFlutterView(&response, reinterpret_cast(view), - view->engine().GetUIIsolateMainPort(), - view->engine().GetUIIsolateName()); - return true; - }); - response << "]}"; - // Copy the response. - *json_object = strdup(response.str().c_str()); - return true; -} - -const char* PlatformViewServiceProtocol::kScreenshotExtensionName = - "_flutter.screenshot"; - -static sk_sp EncodeBitmapAsPNG(const SkBitmap& bitmap) { - return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); -} - -static fml::WeakPtr GetRandomRasterizer() { - fml::WeakPtr rasterizer; - Shell::Shared().IteratePlatformViews( - [&rasterizer](PlatformView* view) -> bool { - rasterizer = view->rasterizer().GetWeakRasterizerPtr(); - // We just grab the first rasterizer so there is no need to iterate - // further. - return false; - }); - return rasterizer; -} - -bool PlatformViewServiceProtocol::Screenshot(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - fxl::AutoResetWaitableEvent latch; - SkBitmap bitmap; - blink::Threads::Gpu()->PostTask([&latch, &bitmap]() { - ScreenshotGpuTask(&bitmap); - latch.Signal(); - }); - - latch.Wait(); - - sk_sp png(EncodeBitmapAsPNG(bitmap)); - - if (!png) - return ErrorServer(json_object, "can not encode screenshot"); - - size_t b64_size = SkBase64::Encode(png->data(), png->size(), nullptr); - SkAutoTMalloc b64_data(b64_size); - SkBase64::Encode(png->data(), png->size(), b64_data.get()); - - std::stringstream response; - response << "{\"type\":\"Screenshot\"," - << "\"screenshot\":\"" << std::string{b64_data.get(), b64_size} - << "\"}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -void PlatformViewServiceProtocol::ScreenshotGpuTask(SkBitmap* bitmap) { - auto rasterizer = GetRandomRasterizer(); - - if (!rasterizer) - return; - - flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); - if (layer_tree == nullptr) - return; - - const SkISize& frame_size = layer_tree->frame_size(); - if (!bitmap->tryAllocN32Pixels(frame_size.width(), frame_size.height())) - return; - - sk_sp surface = SkSurface::MakeRasterDirect( - bitmap->info(), bitmap->getPixels(), bitmap->rowBytes()); - - flow::CompositorContext compositor_context(nullptr); - SkCanvas* canvas = surface->getCanvas(); - flow::CompositorContext::ScopedFrame frame = - compositor_context.AcquireFrame(nullptr, canvas, false); - - canvas->clear(SK_ColorBLACK); - layer_tree->Raster(frame); - canvas->flush(); -} - -const char* PlatformViewServiceProtocol::kScreenshotSkpExtensionName = - "_flutter.screenshotSkp"; - -bool PlatformViewServiceProtocol::ScreenshotSkp(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - fxl::AutoResetWaitableEvent latch; - sk_sp picture; - blink::Threads::Gpu()->PostTask([&latch, &picture]() { - picture = ScreenshotSkpGpuTask(); - latch.Signal(); - }); - - latch.Wait(); - - sk_sp skp_data = picture->serialize(); - - size_t b64_size = - SkBase64::Encode(skp_data->data(), skp_data->size(), nullptr); - SkAutoTMalloc b64_data(b64_size); - SkBase64::Encode(skp_data->data(), skp_data->size(), b64_data.get()); - - std::stringstream response; - response << "{\"type\":\"ScreenshotSkp\"," - << "\"skp\":\"" << std::string{b64_data.get(), b64_size} << "\"}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -sk_sp PlatformViewServiceProtocol::ScreenshotSkpGpuTask() { - auto rasterizer = GetRandomRasterizer(); - - if (!rasterizer) - return nullptr; - - flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); - if (layer_tree == nullptr) - return nullptr; - - SkPictureRecorder recorder; - recorder.beginRecording(SkRect::MakeWH(layer_tree->frame_size().width(), - layer_tree->frame_size().height())); - - flow::CompositorContext compositor_context(nullptr); - flow::CompositorContext::ScopedFrame frame = compositor_context.AcquireFrame( - nullptr, recorder.getRecordingCanvas(), false); - layer_tree->Raster(frame); - - return recorder.finishRecordingAsPicture(); -} - -const char* PlatformViewServiceProtocol::kFlushUIThreadTasksExtensionName = - "_flutter.flushUIThreadTasks"; - -// This API should not be invoked by production code. -// It can potentially starve the service isolate if the main isolate pauses -// at a breakpoint or is in an infinite loop. -// -// It should be invoked from the VM Service and and blocks it until UI thread -// tasks are processed. -bool PlatformViewServiceProtocol::FlushUIThreadTasks(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&latch]() { - // This task is empty because we just need to synchronize this RPC with the - // UI Thread - latch.Signal(); - }); - - latch.Wait(); - - *json_object = strdup("{\"type\":\"Success\"}"); - return true; -} - -const char* PlatformViewServiceProtocol::kSetAssetBundlePathExtensionName = - "_flutter.setAssetBundlePath"; - -bool PlatformViewServiceProtocol::SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object) { - const char* view_id = - ValueForKey(param_keys, param_values, num_params, "viewId"); - if (view_id == nullptr) { - return ErrorMissingParameter(json_object, "viewId"); - } - if (strncmp(view_id, kViewIdPrefx, kViewIdPrefxLength) != 0) { - return ErrorBadParameter(json_object, "viewId", view_id); - } - const char* asset_directory = - ValueForKey(param_keys, param_values, num_params, "assetDirectory"); - if (asset_directory == nullptr) { - return ErrorMissingParameter(json_object, "assetDirectory"); - } - - // Convert the actual flutter view hex id into a number. - uintptr_t view_id_as_num = - std::stoull((view_id + kViewIdPrefxLength), nullptr, 16); - - // Ask the Shell to update asset bundle path in the specified view. - // This will run a task on the UI thread before returning. - Shell& shell = Shell::Shared(); - bool view_existed = false; - Dart_Port main_port = ILLEGAL_PORT; - std::string isolate_name; - shell.SetAssetBundlePathInPlatformView(view_id_as_num, asset_directory, - &view_existed, &main_port, - &isolate_name); - - if (!view_existed) { - // If the view did not exist this request has definitely failed. - return ErrorUnknownView(json_object, view_id); - } - - // The view existed and the isolate was created. Success. - std::stringstream response; - response << "{\"type\":\"Success\"," - << "\"view\":"; - AppendFlutterView(&response, view_id_as_num, main_port, isolate_name); - response << "}"; - *json_object = strdup(response.str().c_str()); - return true; -} - -} // namespace shell diff --git a/shell/common/platform_view_service_protocol.h b/shell/common/platform_view_service_protocol.h deleted file mode 100644 index b7f74b56a08ba..0000000000000 --- a/shell/common/platform_view_service_protocol.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2016 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. - -#ifndef SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ -#define SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ - -#include - -#include "flutter/shell/common/platform_view.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" -#include "third_party/skia/include/core/SkBitmap.h" - -namespace shell { - -class PlatformViewServiceProtocol { - public: - static void RegisterHook(bool running_precompiled_code); - - private: - static const char* kRunInViewExtensionName; - // It should be invoked from the VM Service and and blocks it until previous - // UI thread tasks are processed. - static bool RunInView(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kListViewsExtensionName; - static bool ListViews(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kScreenshotExtensionName; - // It should be invoked from the VM Service and and blocks it until previous - // GPU thread tasks are processed. - static bool Screenshot(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - static void ScreenshotGpuTask(SkBitmap* bitmap); - - static const char* kScreenshotSkpExtensionName; - static bool ScreenshotSkp(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - static sk_sp ScreenshotSkpGpuTask(); - - // This API should not be invoked by production code. - // It can potentially starve the service isolate if the main isolate pauses - // at a breakpoint or is in an infinite loop. - // - // It should be invoked from the VM Service and and blocks it until previous - // GPU thread tasks are processed. - static const char* kFlushUIThreadTasksExtensionName; - static bool FlushUIThreadTasks(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - - static const char* kSetAssetBundlePathExtensionName; - static bool SetAssetBundlePath(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); -}; - -} // namespace shell - -#endif // SHELL_COMMON_VIEW_SERVICE_PROTOCOL_H_ diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 905ee6285c5d3..5a519b3efea26 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -4,8 +4,205 @@ #include "flutter/shell/common/rasterizer.h" +#include + +#include "third_party/skia/include/core/SkEncodedImageFormat.h" +#include "third_party/skia/include/core/SkImageEncoder.h" +#include "third_party/skia/include/core/SkPictureRecorder.h" +#include "third_party/skia/include/core/SkSurface.h" +#include "third_party/skia/src/utils/SkBase64.h" + namespace shell { +Rasterizer::Rasterizer(blink::TaskRunners task_runners) + : task_runners_(std::move(task_runners)), weak_factory_(this) { + weak_prototype_ = weak_factory_.GetWeakPtr(); +} + Rasterizer::~Rasterizer() = default; +fml::WeakPtr Rasterizer::GetWeakPtr() const { + return weak_prototype_; +} + +void Rasterizer::Setup(std::unique_ptr surface) { + surface_ = std::move(surface); +} + +void Rasterizer::Teardown() { + surface_.reset(); + last_layer_tree_.reset(); +} + +flow::TextureRegistry* Rasterizer::GetTextureRegistry() { + if (!surface_) { + return nullptr; + } + + return &(surface_->GetCompositorContext().texture_registry()); +} + +flow::LayerTree* Rasterizer::GetLastLayerTree() { + return last_layer_tree_.get(); +} + +void Rasterizer::DrawLastLayerTree() { + if (!last_layer_tree_ || !surface_) { + return; + } + DrawToSurface(*last_layer_tree_); +} + +void Rasterizer::Draw( + fxl::RefPtr> pipeline) { + TRACE_EVENT0("flutter", "GPURasterizer::Draw"); + + flutter::Pipeline::Consumer consumer = + std::bind(&Rasterizer::DoDraw, this, std::placeholders::_1); + + // Consume as many pipeline items as possible. But yield the event loop + // between successive tries. + switch (pipeline->Consume(consumer)) { + case flutter::PipelineConsumeResult::MoreAvailable: { + task_runners_.GetGPUTaskRunner()->PostTask( + [weak_this = weak_factory_.GetWeakPtr(), pipeline]() { + if (weak_this) { + weak_this->Draw(pipeline); + } + }); + break; + } + default: + break; + } +} + +void Rasterizer::DoDraw(std::unique_ptr layer_tree) { + if (!layer_tree || !surface_) { + return; + } + + if (DrawToSurface(*layer_tree)) { + last_layer_tree_ = std::move(layer_tree); + } +} + +bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) { + FXL_DCHECK(surface_); + + auto frame = surface_->AcquireFrame(layer_tree.frame_size()); + + if (frame == nullptr) { + return false; + } + + auto& compositor_context = surface_->GetCompositorContext(); + + // There is no way for the compositor to know how long the layer tree + // construction took. Fortunately, the layer tree does. Grab that time + // for instrumentation. + compositor_context.engine_time().SetLapTime(layer_tree.construction_time()); + + auto compositor_frame = compositor_context.AcquireFrame( + surface_->GetContext(), frame->SkiaCanvas(), true); + + if (compositor_frame && compositor_frame->Raster(layer_tree, false)) { + frame->Submit(); + FireNextFrameCallbackIfPresent(); + return true; + } + + return false; +} + +static sk_sp ScreenshotLayerTreeAsPicture(flow::LayerTree* tree) { + FXL_DCHECK(tree != nullptr); + SkPictureRecorder recorder; + recorder.beginRecording( + SkRect::MakeWH(tree->frame_size().width(), tree->frame_size().height())); + + flow::CompositorContext compositor_context; + auto frame = compositor_context.AcquireFrame( + nullptr, recorder.getRecordingCanvas(), false); + + frame->Raster(*tree, true); + + return recorder.finishRecordingAsPicture(); +} + +static sk_sp ScreenshotLayerTreeAsImage(flow::LayerTree* tree, + bool compressed) { + const SkISize& frame_size = tree->frame_size(); + SkBitmap bitmap; + if (!bitmap.tryAllocN32Pixels(frame_size.width(), frame_size.height())) { + return nullptr; + } + auto bitmap_surface = SkSurface::MakeRasterDirect( + bitmap.info(), bitmap.getPixels(), bitmap.rowBytes()); + flow::CompositorContext compositor_context; + auto canvas = bitmap_surface->getCanvas(); + auto frame = compositor_context.AcquireFrame(nullptr, canvas, false); + canvas->clear(SK_ColorBLACK); + frame->Raster(*tree, true); + canvas->flush(); + if (compressed) { + return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); + } else { + return SkData::MakeWithCopy(bitmap.getPixels(), bitmap.computeByteSize()); + } + return nullptr; +} + +Rasterizer::Screenshot Rasterizer::ScreenshotLastLayerTree( + Rasterizer::ScreenshotType type, + bool base64_encode) { + auto layer_tree = GetLastLayerTree(); + if (layer_tree == nullptr) { + FXL_DLOG(INFO) << "Last layer tree was null when screenshotting."; + return {}; + } + + sk_sp data = nullptr; + + switch (type) { + case ScreenshotType::SkiaPicture: + data = ScreenshotLayerTreeAsPicture(layer_tree)->serialize(); + break; + case ScreenshotType::UncompressedImage: + data = ScreenshotLayerTreeAsImage(layer_tree, false); + break; + case ScreenshotType::CompressedImage: + data = ScreenshotLayerTreeAsImage(layer_tree, true); + break; + } + + if (data == nullptr) { + FXL_DLOG(INFO) << "Sceenshot data was null."; + return {}; + } + + if (base64_encode) { + size_t b64_size = SkBase64::Encode(data->data(), data->size(), nullptr); + auto b64_data = SkData::MakeUninitialized(b64_size); + SkBase64::Encode(data->data(), data->size(), b64_data->writable_data()); + return Rasterizer::Screenshot{b64_data, layer_tree->frame_size()}; + } + + return Rasterizer::Screenshot{data, layer_tree->frame_size()}; +} + +void Rasterizer::SetNextFrameCallback(fxl::Closure callback) { + next_frame_callback_ = callback; +} + +void Rasterizer::FireNextFrameCallbackIfPresent() { + if (!next_frame_callback_) { + return; + } + // It is safe for the callback to set a new callback. + auto callback = next_frame_callback_; + next_frame_callback_ = nullptr; + callback(); +} + } // namespace shell diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 6f45f49d8178a..908717b74c168 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -7,6 +7,7 @@ #include +#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" @@ -16,34 +17,64 @@ namespace shell { -class Rasterizer { +class Rasterizer final { public: - virtual ~Rasterizer(); + Rasterizer(blink::TaskRunners task_runners); - virtual void Setup(std::unique_ptr surface_or_null, - fxl::Closure rasterizer_continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) = 0; + ~Rasterizer(); - virtual void Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) = 0; + void Setup(std::unique_ptr surface); - virtual void Clear(SkColor color, const SkISize& size) = 0; + void Teardown(); - virtual fml::WeakPtr GetWeakRasterizerPtr() = 0; + fml::WeakPtr GetWeakPtr() const; - virtual flow::LayerTree* GetLastLayerTree() = 0; + flow::LayerTree* GetLastLayerTree(); - virtual void DrawLastLayerTree() = 0; + void DrawLastLayerTree(); - virtual flow::TextureRegistry& GetTextureRegistry() = 0; + flow::TextureRegistry* GetTextureRegistry(); - virtual void Draw( - fxl::RefPtr> pipeline) = 0; + void Draw(fxl::RefPtr> pipeline); - // Set a callback to be called once when the next frame is drawn. - virtual void AddNextFrameCallback(fxl::Closure nextFrameCallback) = 0; + enum class ScreenshotType { + SkiaPicture, + UncompressedImage, // In kN32_SkColorType format + CompressedImage, + }; - virtual void SetTextureRegistry(flow::TextureRegistry* textureRegistry) = 0; + struct Screenshot { + sk_sp data; + SkISize frame_size = SkISize::MakeEmpty(); + + Screenshot() {} + + Screenshot(sk_sp p_data, SkISize p_size) + : data(std::move(p_data)), frame_size(p_size) {} + }; + + Screenshot ScreenshotLastLayerTree(ScreenshotType type, bool base64_encode); + + // Sets a callback that will be executed after the next frame is submitted to + // the surface on the GPU task runner. + void SetNextFrameCallback(fxl::Closure callback); + + private: + blink::TaskRunners task_runners_; + std::unique_ptr surface_; + std::unique_ptr compositor_context_; + std::unique_ptr last_layer_tree_; + fxl::Closure next_frame_callback_; + fml::WeakPtr weak_prototype_; + fml::WeakPtrFactory weak_factory_; + + void DoDraw(std::unique_ptr layer_tree); + + bool DrawToSurface(flow::LayerTree& layer_tree); + + void FireNextFrameCallbackIfPresent(); + + FXL_DISALLOW_COPY_AND_ASSIGN(Rasterizer); }; } // namespace shell diff --git a/shell/common/run_configuration.cc b/shell/common/run_configuration.cc new file mode 100644 index 0000000000000..7fb385fb4d9dc --- /dev/null +++ b/shell/common/run_configuration.cc @@ -0,0 +1,80 @@ +// Copyright 2017 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/shell/common/run_configuration.h" + +#include + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/zip_asset_store.h" +#include "flutter/fml/file.h" +#include "flutter/runtime/dart_vm.h" + +namespace shell { + +RunConfiguration RunConfiguration::InferFromSettings( + const blink::Settings& settings) { + auto asset_manager = fxl::MakeRefCounted(); + + asset_manager->PushBack(std::make_unique( + fml::Duplicate(settings.assets_dir))); + + asset_manager->PushBack( + std::make_unique(fml::OpenFile( + settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); + + asset_manager->PushBack( + std::make_unique(settings.flx_path)); + + return {IsolateConfiguration::InferFromSettings(settings, asset_manager), + asset_manager}; +} + +RunConfiguration::RunConfiguration( + std::unique_ptr configuration) + : RunConfiguration(std::move(configuration), + fxl::MakeRefCounted()) {} + +RunConfiguration::RunConfiguration( + std::unique_ptr configuration, + fxl::RefPtr asset_manager) + : isolate_configuration_(std::move(configuration)), + asset_manager_(std::move(asset_manager)) {} + +RunConfiguration::RunConfiguration(RunConfiguration&&) = default; + +RunConfiguration::~RunConfiguration() = default; + +bool RunConfiguration::IsValid() const { + return asset_manager_ && isolate_configuration_; +} + +bool RunConfiguration::AddAssetResolver( + std::unique_ptr resolver) { + if (!resolver || !resolver->IsValid()) { + return false; + } + + asset_manager_->PushBack(std::move(resolver)); + return true; +} + +void RunConfiguration::SetEntrypoint(std::string entrypoint) { + entrypoint_ = std::move(entrypoint); +} + +fxl::RefPtr RunConfiguration::GetAssetManager() const { + return asset_manager_; +} + +const std::string& RunConfiguration::GetEntrypoint() const { + return entrypoint_; +} + +std::unique_ptr +RunConfiguration::TakeIsolateConfiguration() { + return std::move(isolate_configuration_); +} + +} // namespace shell diff --git a/shell/common/run_configuration.h b/shell/common/run_configuration.h new file mode 100644 index 0000000000000..59aa07566685c --- /dev/null +++ b/shell/common/run_configuration.h @@ -0,0 +1,56 @@ +// Copyright 2017 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_SHELL_COMMON_RUN_CONFIGURATION_H_ +#define FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ + +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "flutter/assets/asset_resolver.h" +#include "flutter/common/settings.h" +#include "flutter/fml/mapping.h" +#include "flutter/shell/common/isolate_configuration.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class RunConfiguration { + public: + static RunConfiguration InferFromSettings(const blink::Settings& settings); + + RunConfiguration(std::unique_ptr configuration); + + RunConfiguration(std::unique_ptr configuration, + fxl::RefPtr asset_manager); + + RunConfiguration(RunConfiguration&&); + + ~RunConfiguration(); + + bool IsValid() const; + + bool AddAssetResolver(std::unique_ptr resolver); + + void SetEntrypoint(std::string entrypoint); + + fxl::RefPtr GetAssetManager() const; + + const std::string& GetEntrypoint() const; + + std::unique_ptr TakeIsolateConfiguration(); + + private: + std::unique_ptr isolate_configuration_; + fxl::RefPtr asset_manager_; + std::string entrypoint_ = "main"; + + FXL_DISALLOW_COPY_AND_ASSIGN(RunConfiguration); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_RUN_CONFIGURATION_H_ diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 14f8fee84bb5f..82591c6d499e2 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -2,362 +2,889 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#define RAPIDJSON_HAS_STDSTRING 1 + #include "flutter/shell/common/shell.h" -#include #include #include #include -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/fml/file.h" #include "flutter/fml/icu_util.h" #include "flutter/fml/message_loop.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/dart_init.h" +#include "flutter/glue/trace_event.h" +#include "flutter/runtime/dart_vm.h" #include "flutter/shell/common/engine.h" -#include "flutter/shell/common/platform_view_service_protocol.h" #include "flutter/shell/common/skia_event_tracer_impl.h" #include "flutter/shell/common/switches.h" +#include "flutter/shell/common/vsync_waiter.h" +#include "lib/fxl/files/path.h" #include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/logging.h" #include "third_party/dart/runtime/include/dart_tools_api.h" #include "third_party/skia/include/core/SkGraphics.h" +#ifdef ERROR +#undef ERROR +#endif + namespace shell { -namespace { -static Shell* g_shell = nullptr; +std::unique_ptr Shell::CreateShellOnPlatformThread( + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) { + if (!task_runners.IsValid()) { + return nullptr; + } + + auto shell = std::unique_ptr(new Shell(task_runners, settings)); -template -bool GetSwitchValue(const fxl::CommandLine& command_line, - Switch sw, - T* result) { - std::string switch_string; + // Create the platform view on the platform thread (this thread). + auto platform_view = on_create_platform_view(*shell.get()); + if (!platform_view || !platform_view->GetWeakPtr()) { + return nullptr; + } - if (!command_line.GetOptionValue(FlagForSwitch(sw), &switch_string)) { + // Ask the platform view for the vsync waiter. This will be used by the engine + // to create the animator. + auto vsync_waiter = platform_view->CreateVSyncWaiter(); + if (!vsync_waiter) { + return nullptr; + } + + // Create the IO manager on the IO thread. The IO manager must be initialized + // first because it has state that the other subsystems depend on. It must + // first be booted and the necessary references obtained to initialize the + // other subsystems. + fxl::AutoResetWaitableEvent io_latch; + std::unique_ptr io_manager; + fml::WeakPtr resource_context; + fxl::RefPtr unref_queue; + auto io_task_runner = shell->GetTaskRunners().GetIOTaskRunner(); + fml::TaskRunner::RunNowOrPostTask( + io_task_runner, + [&io_latch, // + &io_manager, // + &resource_context, // + &unref_queue, // + &platform_view, // + io_task_runner // + ]() { + io_manager = std::make_unique( + platform_view->CreateResourceContext(), io_task_runner); + resource_context = io_manager->GetResourceContext(); + unref_queue = io_manager->GetSkiaUnrefQueue(); + io_latch.Signal(); + }); + io_latch.Wait(); + + // Create the rasterizer on the GPU thread. + fxl::AutoResetWaitableEvent gpu_latch; + std::unique_ptr rasterizer; + fml::TaskRunner::RunNowOrPostTask( + task_runners.GetGPUTaskRunner(), [&gpu_latch, // + &rasterizer, // + on_create_rasterizer, // + shell = shell.get() // + ]() { + if (auto new_rasterizer = on_create_rasterizer(*shell)) { + rasterizer = std::move(new_rasterizer); + } + gpu_latch.Signal(); + }); + + // Create the engine on the UI thread. + fxl::AutoResetWaitableEvent ui_latch; + std::unique_ptr engine; + fml::TaskRunner::RunNowOrPostTask( + shell->GetTaskRunners().GetUITaskRunner(), + fxl::MakeCopyable([&ui_latch, // + &engine, // + shell = shell.get(), // + vsync_waiter = std::move(vsync_waiter), // + resource_context = std::move(resource_context), // + unref_queue = std::move(unref_queue) // + ]() mutable { + const auto& task_runners = shell->GetTaskRunners(); + + // The animator is owned by the UI thread but it gets its vsync pulses + // from the platform. + auto animator = std::make_unique(*shell, task_runners, + std::move(vsync_waiter)); + + engine = std::make_unique(*shell, // + shell->GetDartVM(), // + task_runners, // + shell->GetSettings(), // + std::move(animator), // + std::move(resource_context), // + std::move(unref_queue) // + ); + ui_latch.Signal(); + })); + + gpu_latch.Wait(); + ui_latch.Wait(); + // We are already on the platform thread. So there is no platform latch to + // wait on. + + if (!shell->Setup(std::move(platform_view), // + std::move(engine), // + std::move(rasterizer), // + std::move(io_manager)) // + ) { + return nullptr; + } + + return shell; +} + +std::unique_ptr Shell::Create( + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) { + if (!task_runners.IsValid() || !on_create_platform_view || + !on_create_rasterizer) { + return nullptr; + } + + fxl::AutoResetWaitableEvent latch; + std::unique_ptr shell; + fml::TaskRunner::RunNowOrPostTask( + task_runners.GetPlatformTaskRunner(), + [&latch, &shell, task_runners = std::move(task_runners), settings, + on_create_platform_view, on_create_rasterizer]() { + shell = CreateShellOnPlatformThread(std::move(task_runners), settings, + on_create_platform_view, + on_create_rasterizer); + latch.Signal(); + }); + latch.Wait(); + return shell; +} + +Shell::Shell(blink::TaskRunners task_runners, blink::Settings settings) + : task_runners_(std::move(task_runners)), + settings_(std::move(settings)), + vm_(blink::DartVM::ForProcess(settings_)) { + FXL_DCHECK(task_runners_.IsValid()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + if (settings_.icu_data_path.size() != 0) { + fml::icu::InitializeICU(settings_.icu_data_path); + } else { + FXL_DLOG(WARNING) << "Skipping ICU initialization in the shell."; + } + + if (settings_.trace_skia) { + InitSkiaEventTracer(settings_.trace_skia); + } + + if (!settings_.skia_deterministic_rendering_on_cpu) { + SkGraphics::Init(); + } else { + FXL_DLOG(INFO) << "Skia deterministic rendering is enabled."; + } + + // Install service protocol handlers. + + service_protocol_handlers_[blink::ServiceProtocol::kScreenshotExtensionName + .ToString()] = { + task_runners_.GetGPUTaskRunner(), + std::bind(&Shell::OnServiceProtocolScreenshot, this, + std::placeholders::_1, std::placeholders::_2)}; + service_protocol_handlers_[blink::ServiceProtocol::kScreenshotSkpExtensionName + .ToString()] = { + task_runners_.GetGPUTaskRunner(), + std::bind(&Shell::OnServiceProtocolScreenshotSKP, this, + std::placeholders::_1, std::placeholders::_2)}; + service_protocol_handlers_[blink::ServiceProtocol::kRunInViewExtensionName + .ToString()] = { + task_runners_.GetUITaskRunner(), + std::bind(&Shell::OnServiceProtocolRunInView, this, std::placeholders::_1, + std::placeholders::_2)}; + service_protocol_handlers_ + [blink::ServiceProtocol::kFlushUIThreadTasksExtensionName.ToString()] = { + task_runners_.GetUITaskRunner(), + std::bind(&Shell::OnServiceProtocolFlushUIThreadTasks, this, + std::placeholders::_1, std::placeholders::_2)}; + service_protocol_handlers_ + [blink::ServiceProtocol::kSetAssetBundlePathExtensionName.ToString()] = { + task_runners_.GetUITaskRunner(), + std::bind(&Shell::OnServiceProtocolSetAssetBundlePath, this, + std::placeholders::_1, std::placeholders::_2)}; +} + +Shell::~Shell() { + if (auto vm = blink::DartVM::ForProcessIfInitialized()) { + vm->GetServiceProtocol().RemoveHandler(this); + } + + fxl::AutoResetWaitableEvent ui_latch, gpu_latch, platform_latch, io_latch; + + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetUITaskRunner(), + fxl::MakeCopyable([engine = std::move(engine_), &ui_latch]() mutable { + engine.reset(); + ui_latch.Signal(); + })); + ui_latch.Wait(); + + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetGPUTaskRunner(), + fxl::MakeCopyable( + [rasterizer = std::move(rasterizer_), &gpu_latch]() mutable { + rasterizer.reset(); + gpu_latch.Signal(); + })); + gpu_latch.Wait(); + + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetIOTaskRunner(), + fxl::MakeCopyable( + [io_manager = std::move(io_manager_), &io_latch]() mutable { + io_manager.reset(); + io_latch.Signal(); + })); + + io_latch.Wait(); + + // The platform view must go last because it may be holding onto platform side + // counterparts to resources owned by subsystems running on other threads. For + // example, the NSOpenGLContext on the Mac. + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetPlatformTaskRunner(), + fxl::MakeCopyable([platform_view = std::move(platform_view_), + &platform_latch]() mutable { + platform_view.reset(); + platform_latch.Signal(); + })); + platform_latch.Wait(); +} + +bool Shell::IsSetup() const { + return is_setup_; +} + +bool Shell::Setup(std::unique_ptr platform_view, + std::unique_ptr engine, + std::unique_ptr rasterizer, + std::unique_ptr io_manager) { + if (is_setup_) { return false; } - std::stringstream stream(switch_string); - T value = 0; - if (stream >> value) { - *result = value; - return true; + if (!platform_view || !engine || !rasterizer || !io_manager) { + return false; } - return false; + platform_view_ = std::move(platform_view); + engine_ = std::move(engine); + rasterizer_ = std::move(rasterizer); + io_manager_ = std::move(io_manager); + + is_setup_ = true; + + if (auto vm = blink::DartVM::ForProcessIfInitialized()) { + vm->GetServiceProtocol().AddHandler(this); + } + + return true; } -} // namespace +const blink::Settings& Shell::GetSettings() const { + return settings_; +} -Shell::Shell(fxl::CommandLine command_line) - : command_line_(std::move(command_line)) { - FXL_DCHECK(!g_shell); +const blink::TaskRunners& Shell::GetTaskRunners() const { + return task_runners_; +} - gpu_thread_.reset(new fml::Thread("gpu_thread")); - ui_thread_.reset(new fml::Thread("ui_thread")); - io_thread_.reset(new fml::Thread("io_thread")); +fml::WeakPtr Shell::GetRasterizer() { + FXL_DCHECK(is_setup_); + return rasterizer_->GetWeakPtr(); +} - // Since we are not using fml::Thread, we need to initialize the message loop - // manually. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - blink::Threads threads(fml::MessageLoop::GetCurrent().GetTaskRunner(), - gpu_thread_->GetTaskRunner(), - ui_thread_->GetTaskRunner(), - io_thread_->GetTaskRunner()); - blink::Threads::Set(threads); +fml::WeakPtr Shell::GetEngine() { + FXL_DCHECK(is_setup_); + return engine_->GetWeakPtr(); +} - blink::Threads::Gpu()->PostTask([this]() { InitGpuThread(); }); - blink::Threads::UI()->PostTask([this]() { InitUIThread(); }); +fml::WeakPtr Shell::GetPlatformView() { + FXL_DCHECK(is_setup_); + return platform_view_->GetWeakPtr(); +} - blink::SetRegisterNativeServiceProtocolExtensionHook( - PlatformViewServiceProtocol::RegisterHook); +const blink::DartVM& Shell::GetDartVM() const { + return *vm_; } -Shell::~Shell() {} +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewCreated(const PlatformView& view, + std::unique_ptr surface) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); -void Shell::InitStandalone(fxl::CommandLine command_line, - std::string icu_data_path, - std::string application_library_path, - std::string bundle_path) { - TRACE_EVENT0("flutter", "Shell::InitStandalone"); + // Note: + // This is a synchronous operation because certain platforms depend on + // setup/suspension of all activities that may be interacting with the GPU in + // a synchronous fashion. - fml::icu::InitializeICU(icu_data_path); + fxl::AutoResetWaitableEvent latch; + auto gpu_task = fxl::MakeCopyable([rasterizer = rasterizer_->GetWeakPtr(), // + surface = std::move(surface), // + &latch]() mutable { + if (rasterizer) { + rasterizer->Setup(std::move(surface)); + } + // Step 2: All done. Signal the latch that the platform thread is waiting + // on. + latch.Signal(); + }); - if (!command_line.HasOption( - FlagForSwitch(Switch::SkiaDeterministicRendering))) - SkGraphics::Init(); + auto ui_task = [engine = engine_->GetWeakPtr(), // + gpu_task_runner = task_runners_.GetGPUTaskRunner(), // + gpu_task // + ] { + if (engine) { + engine->OnOutputSurfaceCreated(); + } + // Step 1: Next, tell the GPU thread that it should create a surface for its + // rasterizer. + fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); + }; + + // Step 0: Post a task onto the UI thread to tell the engine that it has an + // output surface. + fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); + latch.Wait(); +} - blink::Settings settings; - settings.application_library_path = application_library_path; +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDestroyed(const PlatformView& view) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - // Enable Observatory - settings.enable_observatory = - !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); + // Note: + // This is a synchronous operation because certain platforms depend on + // setup/suspension of all activities that may be interacting with the GPU in + // a synchronous fashion. - // Set Observatory Port - if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { - if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, - &settings.observatory_port)) { - FXL_LOG(INFO) - << "Observatory port specified was malformed. Will default to " - << settings.observatory_port; + fxl::AutoResetWaitableEvent latch; + + auto gpu_task = [rasterizer = rasterizer_->GetWeakPtr(), &latch]() { + if (rasterizer) { + rasterizer->Teardown(); } - } + // Step 2: All done. Signal the latch that the platform thread is waiting + // on. + latch.Signal(); + }; + + auto ui_task = [engine = engine_->GetWeakPtr(), + gpu_task_runner = task_runners_.GetGPUTaskRunner(), + gpu_task]() { + if (engine) { + engine->OnOutputSurfaceDestroyed(); + } + // Step 1: Next, tell the GPU thread that its rasterizer should suspend + // access to the underlying surface. + fml::TaskRunner::RunNowOrPostTask(gpu_task_runner, gpu_task); + }; + + // Step 0: Post a task onto the UI thread to tell the engine that its output + // surface is about to go away. + fml::TaskRunner::RunNowOrPostTask(task_runners_.GetUITaskRunner(), ui_task); + latch.Wait(); +} + +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewSetViewportMetrics( + const PlatformView& view, + const blink::ViewportMetrics& metrics) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), metrics]() { + if (engine) { + engine->SetViewportMetrics(metrics); + } + }); +} - // Checked mode overrides. - settings.dart_non_checked_mode = - command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDispatchPlatformMessage( + const PlatformView& view, + fxl::RefPtr message) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), message = std::move(message)] { + if (engine) { + engine->DispatchPlatformMessage(std::move(message)); + } + }); +} + +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDispatchPointerDataPacket( + const PlatformView& view, + std::unique_ptr packet) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + task_runners_.GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = engine_->GetWeakPtr(), packet = std::move(packet)] { + if (engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); +} - settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewDispatchSemanticsAction(const PlatformView& view, + int32_t id, + blink::SemanticsAction action, + std::vector args) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), id, action, args = std::move(args)] { + if (engine) { + engine->DispatchSemanticsAction(id, action, std::move(args)); + } + }); +} - settings.start_paused = - command_line.HasOption(FlagForSwitch(Switch::StartPaused)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewSetSemanticsEnabled(const PlatformView& view, + bool enabled) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), enabled] { + if (engine) { + engine->SetSemanticsEnabled(enabled); + } + }); +} - settings.enable_dart_profiling = - command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewRegisterTexture( + const PlatformView& view, + std::shared_ptr texture) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), texture] { + if (rasterizer) { + if (auto registry = rasterizer->GetTextureRegistry()) { + registry->RegisterTexture(texture); + } + } + }); +} - settings.enable_software_rendering = - command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewUnregisterTexture(const PlatformView& view, + int64_t texture_id) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { + if (rasterizer) { + if (auto registry = rasterizer->GetTextureRegistry()) { + registry->UnregisterTexture(texture_id); + } + } + }); +} - settings.using_blink = - command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, + int64_t texture_id) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - settings.endless_trace_buffer = - command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); + // Tell the rasterizer that one of its textures has a new frame available. + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), texture_id]() { + auto registry = rasterizer->GetTextureRegistry(); - settings.trace_startup = - command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); + if (!registry) { + return; + } - command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), - &settings.aot_snapshot_path); + auto texture = registry->GetTexture(texture_id); - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), - &settings.aot_vm_snapshot_data_filename); + if (!texture) { + return; + } - command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), - &settings.aot_vm_snapshot_instr_filename); + texture->MarkNewFrameAvailable(); + }); - command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), - &settings.aot_isolate_snapshot_data_filename); + // Schedule a new frame without having to rebuild the layer tree. + task_runners_.GetUITaskRunner()->PostTask([engine = engine_->GetWeakPtr()]() { + if (engine) { + engine->ScheduleFrame(false); + } + }); +} - command_line.GetOptionValue(FlagForSwitch(Switch::AotSharedLibraryPath), - &settings.aot_shared_library_path); +// |shell::PlatformView::Delegate| +void Shell::OnPlatformViewSetNextFrameCallback(const PlatformView& view, + fxl::Closure closure) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), closure = std::move(closure)]() { + if (rasterizer) { + rasterizer->SetNextFrameCallback(std::move(closure)); + } + }); +} - command_line.GetOptionValue( - FlagForSwitch(Switch::AotIsolateSnapshotInstructions), - &settings.aot_isolate_snapshot_instr_filename); +// |shell::Animator::Delegate| +void Shell::OnAnimatorBeginFrame(const Animator& animator, + fxl::TimePoint frame_time) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), - &settings.temp_directory_path); + if (engine_) { + engine_->BeginFrame(frame_time); + } +} - settings.use_test_fonts = - command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); +// |shell::Animator::Delegate| +void Shell::OnAnimatorNotifyIdle(const Animator& animator, int64_t deadline) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - std::string all_dart_flags; - if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), - &all_dart_flags)) { - std::stringstream stream(all_dart_flags); - std::istream_iterator end; - for (std::istream_iterator it(stream); it != end; ++it) - settings.dart_flags.push_back(*it); + if (engine_) { + engine_->NotifyIdle(deadline); } +} - command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); +// |shell::Animator::Delegate| +void Shell::OnAnimatorDraw( + const Animator& animator, + fxl::RefPtr> pipeline) { + FXL_DCHECK(is_setup_); + + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr(), + pipeline = std::move(pipeline)]() { + if (rasterizer) { + rasterizer->Draw(pipeline); + } + }); +} - blink::Settings::Set(settings); +// |shell::Animator::Delegate| +void Shell::OnAnimatorDrawLastLayerTree(const Animator& animator) { + FXL_DCHECK(is_setup_); - Init(std::move(command_line), bundle_path); + task_runners_.GetGPUTaskRunner()->PostTask( + [rasterizer = rasterizer_->GetWeakPtr()]() { + if (rasterizer) { + rasterizer->DrawLastLayerTree(); + } + }); } -void Shell::Init(fxl::CommandLine command_line, - const std::string& bundle_path) { -#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE - bool trace_skia = command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); - InitSkiaEventTracer(trace_skia); -#endif +// |shell::Engine::Delegate| +void Shell::OnEngineUpdateSemantics(const Engine& engine, + blink::SemanticsNodeUpdates update) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - FXL_DCHECK(!g_shell); - g_shell = new Shell(std::move(command_line)); - blink::Threads::UI()->PostTask( - [bundle_path]() { Engine::Init(bundle_path); }); + task_runners_.GetPlatformTaskRunner()->PostTask( + [view = platform_view_->GetWeakPtr(), update = std::move(update)] { + if (view) { + view->UpdateSemantics(std::move(update)); + } + }); } -Shell& Shell::Shared() { - FXL_DCHECK(g_shell); - return *g_shell; +// |shell::Engine::Delegate| +void Shell::OnEngineHandlePlatformMessage( + const Engine& engine, + fxl::RefPtr message) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetPlatformTaskRunner()->PostTask( + [view = platform_view_->GetWeakPtr(), message = std::move(message)]() { + if (view) { + view->HandlePlatformMessage(std::move(message)); + } + }); } -const fxl::CommandLine& Shell::GetCommandLine() const { - return command_line_; +// |blink::ServiceProtocol::Handler| +fxl::RefPtr Shell::GetServiceProtocolHandlerTaskRunner( + fxl::StringView method) const { + FXL_DCHECK(is_setup_); + auto found = service_protocol_handlers_.find(method.ToString()); + if (found != service_protocol_handlers_.end()) { + return found->second.first; + } + return task_runners_.GetUITaskRunner(); } -void Shell::InitGpuThread() { - gpu_thread_checker_.reset(new fxl::ThreadChecker()); +// |blink::ServiceProtocol::Handler| +bool Shell::HandleServiceProtocolMessage( + fxl::StringView method, // one if the extension names specified above. + const ServiceProtocolMap& params, + rapidjson::Document& response) { + auto found = service_protocol_handlers_.find(method.ToString()); + if (found != service_protocol_handlers_.end()) { + return found->second.second(params, response); + } + return false; } -void Shell::InitUIThread() { - ui_thread_checker_.reset(new fxl::ThreadChecker()); +// |blink::ServiceProtocol::Handler| +blink::ServiceProtocol::Handler::Description +Shell::GetServiceProtocolDescription() const { + return { + engine_->GetUIIsolateMainPort(), + engine_->GetUIIsolateName(), + }; } -void Shell::AddPlatformView(PlatformView* platform_view) { - if (platform_view == nullptr) { - return; +static void ServiceProtocolParameterError(rapidjson::Document& response, + std::string parameter_name) { + auto& allocator = response.GetAllocator(); + response.SetObject(); + const int64_t kInvalidParams = -32602; + response.AddMember("code", kInvalidParams, allocator); + response.AddMember("message", "Invalid params", allocator); + { + rapidjson::Value details(rapidjson::kObjectType); + details.AddMember("details", parameter_name, allocator); + response.AddMember("data", details, allocator); } - std::lock_guard lock(platform_views_mutex_); - platform_views_.insert(platform_view); } -void Shell::RemovePlatformView(PlatformView* platform_view) { - if (platform_view == nullptr) { - return; +// Service protocol handler +bool Shell::OnServiceProtocolScreenshot( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); + auto screenshot = rasterizer_->ScreenshotLastLayerTree( + Rasterizer::ScreenshotType::CompressedImage, true); + if (screenshot.data) { + response.SetObject(); + auto& allocator = response.GetAllocator(); + response.AddMember("type", "Screenshot", allocator); + rapidjson::Value image; + image.SetString(static_cast(screenshot.data->data()), + screenshot.data->size(), allocator); + response.AddMember("screenshot", image, allocator); + return true; } - std::lock_guard lock(platform_views_mutex_); - platform_views_.erase(platform_view); + ServiceProtocolParameterError(response, + "Could not capture image screenshot."); + return false; } -void Shell::IteratePlatformViews( - std::function iterator) const { - if (iterator == nullptr) { - return; - } - std::lock_guard lock(platform_views_mutex_); - for (PlatformView* view : platform_views_) { - if (!iterator(view)) { - return; - } +// Service protocol handler +bool Shell::OnServiceProtocolScreenshotSKP( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetGPUTaskRunner()->RunsTasksOnCurrentThread()); + auto screenshot = rasterizer_->ScreenshotLastLayerTree( + Rasterizer::ScreenshotType::SkiaPicture, true); + if (screenshot.data) { + response.SetObject(); + auto& allocator = response.GetAllocator(); + response.AddMember("type", "ScreenshotSkp", allocator); + rapidjson::Value skp; + skp.SetString(static_cast(screenshot.data->data()), + screenshot.data->size(), allocator); + response.AddMember("skp", skp, allocator); + return true; } + ServiceProtocolParameterError(response, "Could not capture SKP screenshot."); + return false; } -void Shell::RunInPlatformView(uintptr_t view_id, - const char* main_script, - const char* packages_file, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name) { - fxl::AutoResetWaitableEvent latch; - FXL_DCHECK(view_id != 0); - FXL_DCHECK(main_script); - FXL_DCHECK(packages_file); - FXL_DCHECK(asset_directory); - FXL_DCHECK(view_existed); - - blink::Threads::UI()->PostTask([this, view_id, main_script, packages_file, - asset_directory, view_existed, - dart_isolate_id, isolate_name, &latch]() { - RunInPlatformViewUIThread(view_id, main_script, packages_file, - asset_directory, view_existed, dart_isolate_id, - isolate_name, &latch); - }); - latch.Wait(); +static bool FileNameIsDill(const std::string& name) { + const std::string suffix = ".dill"; + + if (name.size() < suffix.size()) { + return false; + } + + if (name.rfind(suffix, name.size()) == name.size() - suffix.size()) { + return true; + } + return false; } -void Shell::RunInPlatformViewUIThread(uintptr_t view_id, - const std::string& main, - const std::string& packages, - const std::string& assets_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch) { - FXL_DCHECK(ui_thread_checker_ && - ui_thread_checker_->IsCreationThreadCurrent()); - - *view_existed = false; - - IteratePlatformViews( - [view_id, // argument -#if !defined(OS_WIN) - // Using std::move on const references inside lambda capture is - // not supported on Windows for some reason. - assets_directory = std::move(assets_directory), // argument - main = std::move(main), // argument - packages = std::move(packages), // argument -#else - assets_directory, // argument - main, // argument - packages, // argument -#endif - &view_existed, // out - &dart_isolate_id, // out - &isolate_name // out - ](PlatformView* view) -> bool { - if (reinterpret_cast(view) != view_id) { - // Keep looking. - return true; - } - *view_existed = true; - view->RunFromSource(assets_directory, main, packages); - *dart_isolate_id = view->engine().GetUIIsolateMainPort(); - *isolate_name = view->engine().GetUIIsolateName(); - // We found the requested view. Stop iterating over platform views. - return false; - }); +// Service protocol handler +bool Shell::OnServiceProtocolRunInView( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - latch->Signal(); + if (params.count("mainScript") == 0) { + ServiceProtocolParameterError(response, + "'mainScript' parameter is missing."); + return false; + } + + // TODO(chinmaygarde): In case of hot-reload from .dill files, the packages + // file is ignored. Currently, the tool is passing a junk packages file to + // pass this check. Update the service protocol interface and remove this + // workaround. + if (params.count("packagesFile") == 0) { + ServiceProtocolParameterError(response, + "'packagesFile' parameter is missing."); + return false; + } + + if (params.count("assetDirectory") == 0) { + ServiceProtocolParameterError(response, + "'assetDirectory' parameter is missing."); + return false; + } + + auto main_script_file = + files::AbsolutePath(params.at("mainScript").ToString()); + + auto isolate_configuration = + FileNameIsDill(main_script_file) + ? IsolateConfiguration::CreateForSnapshot( + std::make_unique(main_script_file, false)) + : IsolateConfiguration::CreateForSource( + main_script_file, params.at("packagesFile").ToString()); + + RunConfiguration configuration(std::move(isolate_configuration)); + + configuration.AddAssetResolver(std::make_unique( + fml::OpenFile(params.at("assetDirectory").ToString().c_str(), + fml::OpenPermission::kRead, true))); + + auto& allocator = response.GetAllocator(); + response.SetObject(); + if (engine_->Restart(std::move(configuration))) { + response.AddMember("type", "Success", allocator); + auto new_description = GetServiceProtocolDescription(); + rapidjson::Value view(rapidjson::kObjectType); + new_description.Write(this, view, allocator); + response.AddMember("view", view, allocator); + return true; + } else { + FXL_DLOG(ERROR) << "Could not run configuration in engine."; + response.AddMember("type", "Failure", allocator); + return false; + } + + FXL_DCHECK(false); + return false; } -void Shell::SetAssetBundlePathInPlatformView(uintptr_t view_id, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name) { - fxl::AutoResetWaitableEvent latch; - FXL_DCHECK(view_id != 0); - FXL_DCHECK(asset_directory); - FXL_DCHECK(view_existed); - - blink::Threads::UI()->PostTask([this, view_id, asset_directory, view_existed, - dart_isolate_id, isolate_name, &latch]() { - SetAssetBundlePathInPlatformViewUIThread(view_id, asset_directory, - view_existed, dart_isolate_id, - isolate_name, &latch); - }); - latch.Wait(); +// Service protocol handler +bool Shell::OnServiceProtocolFlushUIThreadTasks( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + // This API should not be invoked by production code. + // It can potentially starve the service isolate if the main isolate pauses + // at a breakpoint or is in an infinite loop. + // + // It should be invoked from the VM Service and and blocks it until UI thread + // tasks are processed. + response.SetObject(); + response.AddMember("type", "Success", response.GetAllocator()); + return true; } -void Shell::SetAssetBundlePathInPlatformViewUIThread( - uintptr_t view_id, - const std::string& assets_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch) { - FXL_DCHECK(ui_thread_checker_ && - ui_thread_checker_->IsCreationThreadCurrent()); - - *view_existed = false; - - IteratePlatformViews( - [view_id, // argument -#if !defined(OS_WIN) - // Using std::move on const references inside lambda capture is - // not supported on Windows for some reason. - // TODO(https://github.com/flutter/flutter/issues/13908): - // Investigate the root cause of the difference. - assets_directory = std::move(assets_directory), // argument -#else - assets_directory, // argument -#endif - &view_existed, // out - &dart_isolate_id, // out - &isolate_name // out - ](PlatformView* view) -> bool { - if (reinterpret_cast(view) != view_id) { - // Keep looking. - return true; +// Service protocol handler +bool Shell::OnServiceProtocolSetAssetBundlePath( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response) { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + + if (params.count("assetDirectory") == 0) { + ServiceProtocolParameterError(response, + "'assetDirectory' parameter is missing."); + return false; + } + + auto& allocator = response.GetAllocator(); + response.SetObject(); + + auto asset_manager = fxl::MakeRefCounted(); + + asset_manager->PushFront(std::make_unique( + fml::OpenFile(params.at("assetDirectory").ToString().c_str(), + fml::OpenPermission::kRead, true))); + + if (engine_->UpdateAssetManager(std::move(asset_manager))) { + response.AddMember("type", "Success", allocator); + auto new_description = GetServiceProtocolDescription(); + rapidjson::Value view(rapidjson::kObjectType); + new_description.Write(this, view, allocator); + response.AddMember("view", view, allocator); + return true; + } else { + FXL_DLOG(ERROR) << "Could not update asset directory."; + response.AddMember("type", "Failure", allocator); + return false; + } + + FXL_DCHECK(false); + return false; +} + +Rasterizer::Screenshot Shell::Screenshot( + Rasterizer::ScreenshotType screenshot_type, + bool base64_encode) { + TRACE_EVENT0("flutter", "Shell::Screenshot"); + fxl::AutoResetWaitableEvent latch; + Rasterizer::Screenshot screenshot; + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetGPUTaskRunner(), [&latch, // + rasterizer = GetRasterizer(), // + &screenshot, // + screenshot_type, // + base64_encode // + ]() { + if (rasterizer) { + screenshot = rasterizer->ScreenshotLastLayerTree(screenshot_type, + base64_encode); } - *view_existed = true; - view->SetAssetBundlePath(assets_directory); - *dart_isolate_id = view->engine().GetUIIsolateMainPort(); - *isolate_name = view->engine().GetUIIsolateName(); - // We found the requested view. Stop iterating over - // platform views. - return false; + latch.Signal(); }); - - latch->Signal(); + latch.Wait(); + return screenshot; } } // namespace shell diff --git a/shell/common/shell.h b/shell/common/shell.h index 92c315dcf2aa7..02a642b0ba40f 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -5,96 +5,214 @@ #ifndef SHELL_COMMON_SHELL_H_ #define SHELL_COMMON_SHELL_H_ -#include -#include - +#include +#include + +#include "flutter/common/settings.h" +#include "flutter/common/task_runners.h" +#include "flutter/flow/texture.h" +#include "flutter/fml/memory/thread_checker.h" +#include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/thread.h" -#include "flutter/shell/common/tracing_controller.h" -#include "lib/fxl/command_line.h" +#include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/window/platform_message.h" +#include "flutter/runtime/service_protocol.h" +#include "flutter/shell/common/animator.h" +#include "flutter/shell/common/engine.h" +#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_ptr.h" #include "lib/fxl/memory/weak_ptr.h" +#include "lib/fxl/strings/string_view.h" +#include "lib/fxl/synchronization/thread_annotations.h" #include "lib/fxl/synchronization/thread_checker.h" #include "lib/fxl/synchronization/waitable_event.h" -#include "lib/fxl/tasks/task_runner.h" namespace shell { -class PlatformView; - -class Shell { +class Shell final : public PlatformView::Delegate, + public Animator::Delegate, + public Engine::Delegate, + public blink::ServiceProtocol::Handler { public: + template + using CreateCallback = std::function(Shell&)>; + static std::unique_ptr Create( + blink::TaskRunners task_runners, + blink::Settings settings, + CreateCallback on_create_platform_view, + CreateCallback on_create_rasterizer); + ~Shell(); - static void InitStandalone(fxl::CommandLine command_line, - std::string icu_data_path = "", - std::string application_library_path = "", - std::string bundle_path = ""); + const blink::Settings& GetSettings() const; - static Shell& Shared(); + const blink::TaskRunners& GetTaskRunners() const; - const fxl::CommandLine& GetCommandLine() const; + fml::WeakPtr GetRasterizer(); - void AddPlatformView(PlatformView* platform_view); + fml::WeakPtr GetEngine(); - void RemovePlatformView(PlatformView* platform_view); + fml::WeakPtr GetPlatformView(); - void IteratePlatformViews( - std::function iterator) const; + const blink::DartVM& GetDartVM() const; - // Attempt to run a script inside a flutter view indicated by |view_id|. - // Will set |view_existed| to true if the view was found and false otherwise. - void RunInPlatformView(uintptr_t view_id, - const char* main_script, - const char* packages_file, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name); + bool IsSetup() const; - void SetAssetBundlePathInPlatformView(uintptr_t view_id, - const char* asset_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name); + Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, + bool base64_encode); private: - fxl::CommandLine command_line_; - std::unique_ptr gpu_thread_; - std::unique_ptr ui_thread_; - std::unique_ptr io_thread_; - std::unique_ptr gpu_thread_checker_; - std::unique_ptr ui_thread_checker_; - TracingController tracing_controller_; - mutable std::mutex platform_views_mutex_; - std::unordered_set platform_views_; - - static void Init(fxl::CommandLine command_line, - const std::string& bundle_path); - - Shell(fxl::CommandLine command_line); - - void InitGpuThread(); - - void InitUIThread(); - - void RunInPlatformViewUIThread(uintptr_t view_id, - const std::string& main, - const std::string& packages, - const std::string& assets_directory, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch); - - void SetAssetBundlePathInPlatformViewUIThread( - uintptr_t view_id, - const std::string& main, - bool* view_existed, - int64_t* dart_isolate_id, - std::string* isolate_name, - fxl::AutoResetWaitableEvent* latch); + using ServiceProtocolHandler = std::function; + + const blink::TaskRunners task_runners_; + const blink::Settings settings_; + fxl::RefPtr vm_; + std::unique_ptr platform_view_; // on platform task runner + std::unique_ptr engine_; // on UI task runner + std::unique_ptr rasterizer_; // on GPU task runner + std::unique_ptr io_manager_; // on IO task runner + + std::unordered_map, + ServiceProtocolHandler> // task-runner/function + // pair + > + service_protocol_handlers_; + bool is_setup_ = false; + + Shell(blink::TaskRunners task_runners, blink::Settings settings); + + static std::unique_ptr CreateShellOnPlatformThread( + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer); + + bool Setup(std::unique_ptr platform_view, + std::unique_ptr engine, + std::unique_ptr rasterizer, + std::unique_ptr io_manager); + + // |shell::PlatformView::Delegate| + void OnPlatformViewCreated(const PlatformView& view, + std::unique_ptr surface) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDestroyed(const PlatformView& view) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewSetViewportMetrics( + const PlatformView& view, + const blink::ViewportMetrics& metrics) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDispatchPlatformMessage( + const PlatformView& view, + fxl::RefPtr message) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDispatchPointerDataPacket( + const PlatformView& view, + std::unique_ptr packet) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewDispatchSemanticsAction( + const PlatformView& view, + int32_t id, + blink::SemanticsAction action, + std::vector args) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, + bool enabled) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewRegisterTexture( + const PlatformView& view, + std::shared_ptr texture) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewUnregisterTexture(const PlatformView& view, + int64_t texture_id) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewMarkTextureFrameAvailable(const PlatformView& view, + int64_t texture_id) override; + + // |shell::PlatformView::Delegate| + void OnPlatformViewSetNextFrameCallback(const PlatformView& view, + fxl::Closure closure) override; + + // |shell::Animator::Delegate| + void OnAnimatorBeginFrame(const Animator& animator, + fxl::TimePoint frame_time) override; + + // |shell::Animator::Delegate| + void OnAnimatorNotifyIdle(const Animator& animator, + int64_t deadline) override; + + // |shell::Animator::Delegate| + void OnAnimatorDraw( + const Animator& animator, + fxl::RefPtr> pipeline) override; + + // |shell::Animator::Delegate| + void OnAnimatorDrawLastLayerTree(const Animator& animator) override; + + // |shell::Engine::Delegate| + void OnEngineUpdateSemantics(const Engine& engine, + blink::SemanticsNodeUpdates update) override; + + // |shell::Engine::Delegate| + void OnEngineHandlePlatformMessage( + const Engine& engine, + fxl::RefPtr message) override; + + // |blink::ServiceProtocol::Handler| + fxl::RefPtr GetServiceProtocolHandlerTaskRunner( + fxl::StringView method) const override; + + // |blink::ServiceProtocol::Handler| + bool HandleServiceProtocolMessage( + fxl::StringView method, // one if the extension names specified above. + const ServiceProtocolMap& params, + rapidjson::Document& response) override; + + // |blink::ServiceProtocol::Handler| + blink::ServiceProtocol::Handler::Description GetServiceProtocolDescription() + const override; + + // Service protocol handler + bool OnServiceProtocolScreenshot( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolScreenshotSKP( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolRunInView( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolFlushUIThreadTasks( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); + + // Service protocol handler + bool OnServiceProtocolSetAssetBundlePath( + const blink::ServiceProtocol::Handler::ServiceProtocolMap& params, + rapidjson::Document& response); FXL_DISALLOW_COPY_AND_ASSIGN(Shell); }; diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc new file mode 100644 index 0000000000000..67689341a1586 --- /dev/null +++ b/shell/common/shell_unittests.cc @@ -0,0 +1,133 @@ +// Copyright 2017 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 +#include +#include + +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/thread_host.h" +#include "gtest/gtest.h" +#include "lib/fxl/synchronization/waitable_event.h" + +#define CURRENT_TEST_NAME \ + std::string { \ + ::testing::UnitTest::GetInstance()->current_test_info()->name() \ + } + +namespace shell { + +TEST(ShellTest, InitializeWithInvalidThreads) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + blink::TaskRunners task_runners("test", nullptr, nullptr, nullptr, nullptr); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_FALSE(shell); +} + +TEST(ShellTest, InitializeWithDifferentThreads) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", + ThreadHost::Type::Platform | ThreadHost::Type::GPU | + ThreadHost::Type::IO | ThreadHost::Type::UI); + blink::TaskRunners task_runners("test", + thread_host.platform_thread->GetTaskRunner(), + thread_host.gpu_thread->GetTaskRunner(), + thread_host.ui_thread->GetTaskRunner(), + thread_host.io_thread->GetTaskRunner()); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +TEST(ShellTest, InitializeWithSingleThread) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", + ThreadHost::Type::Platform); + auto task_runner = thread_host.platform_thread->GetTaskRunner(); + blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, + task_runner); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +TEST(ShellTest, InitializeWithSingleThreadWhichIsTheCallingThread) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + fml::MessageLoop::EnsureInitializedForCurrentThread(); + auto task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); + blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, + task_runner); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +TEST(ShellTest, InitializeWithMultipleThreadButCallingThreadAsPlatformThread) { + blink::Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + settings.using_blink = false; + ThreadHost thread_host( + "io.flutter.test." + CURRENT_TEST_NAME + ".", + ThreadHost::Type::GPU | ThreadHost::Type::IO | ThreadHost::Type::UI); + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::TaskRunners task_runners( + "test", fml::MessageLoop::GetCurrent().GetTaskRunner(), + thread_host.gpu_thread->GetTaskRunner(), + thread_host.ui_thread->GetTaskRunner(), + thread_host.io_thread->GetTaskRunner()); + auto shell = Shell::Create( + std::move(task_runners), settings, + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }, + [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }); + ASSERT_TRUE(shell); +} + +} // namespace shell diff --git a/shell/common/surface.cc b/shell/common/surface.cc index 01d288a5e5085..228647e8b3512 100644 --- a/shell/common/surface.cc +++ b/shell/common/surface.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "flutter/shell/common/surface.h" + #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" #include "third_party/skia/include/core/SkSurface.h" @@ -59,27 +60,22 @@ bool SurfaceFrame::PerformSubmit() { return false; } -Surface::Surface() : scale_(1.0) {} - -Surface::~Surface() = default; +Surface::Surface() : Surface(std::make_unique()) {} -bool Surface::SupportsScaling() const { - return false; +Surface::Surface(std::unique_ptr compositor_context) + : compositor_context_(std::move(compositor_context)) { + FXL_DCHECK(compositor_context_); + // TODO: Get rid of these explicit calls and move the logic to the c/dtors of + // the compositor context. + compositor_context_->OnGrContextCreated(); } -double Surface::GetScale() const { - return scale_; +Surface::~Surface() { + compositor_context_->OnGrContextDestroyed(); } -void Surface::SetScale(double scale) { - static constexpr double kMaxScale = 1.0; - static constexpr double kMinScale = 0.25; - if (scale > kMaxScale) { - scale = kMaxScale; - } else if (scale < kMinScale) { - scale = kMinScale; - } - scale_ = scale; +flow::CompositorContext& Surface::GetCompositorContext() { + return *compositor_context_; } } // namespace shell diff --git a/shell/common/surface.h b/shell/common/surface.h index 906480237f416..6133a7d519fff 100644 --- a/shell/common/surface.h +++ b/shell/common/surface.h @@ -7,7 +7,7 @@ #include -#include "lib/fxl/compiler_specific.h" +#include "flutter/flow/compositor_context.h" #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" @@ -45,6 +45,8 @@ class Surface { public: Surface(); + Surface(std::unique_ptr compositor_context); + virtual ~Surface(); virtual bool IsValid() = 0; @@ -53,14 +55,12 @@ class Surface { virtual GrContext* GetContext() = 0; - virtual bool SupportsScaling() const; - - double GetScale() const; - - void SetScale(double scale); + flow::CompositorContext& GetCompositorContext(); private: - double scale_; + std::unique_ptr compositor_context_; + + FXL_DISALLOW_COPY_AND_ASSIGN(Surface); }; } // namespace shell diff --git a/shell/common/switches.cc b/shell/common/switches.cc index c1c82ff166ac1..82da6ee180af8 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -90,4 +91,125 @@ const fxl::StringView FlagForSwitch(Switch swtch) { return fxl::StringView(); } +template +static bool GetSwitchValue(const fxl::CommandLine& command_line, + shell::Switch sw, + T* result) { + std::string switch_string; + + if (!command_line.GetOptionValue(shell::FlagForSwitch(sw), &switch_string)) { + return false; + } + + std::stringstream stream(switch_string); + T value = 0; + if (stream >> value) { + *result = value; + return true; + } + + return false; +} + +blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { + blink::Settings settings = {}; + + // Enable Observatory + settings.enable_observatory = + !command_line.HasOption(FlagForSwitch(Switch::DisableObservatory)); + + // Set Observatory Port + if (command_line.HasOption(FlagForSwitch(Switch::DeviceObservatoryPort))) { + if (!GetSwitchValue(command_line, Switch::DeviceObservatoryPort, + &settings.observatory_port)) { + FXL_LOG(INFO) + << "Observatory port specified was malformed. Will default to " + << settings.observatory_port; + } + } + + // Checked mode overrides. + settings.dart_non_checked_mode = + command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); + + settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); + + settings.start_paused = + command_line.HasOption(FlagForSwitch(Switch::StartPaused)); + + settings.enable_dart_profiling = + command_line.HasOption(FlagForSwitch(Switch::EnableDartProfiling)); + + settings.enable_software_rendering = + command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); + + settings.using_blink = + command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); + + settings.endless_trace_buffer = + command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); + + settings.trace_startup = + command_line.HasOption(FlagForSwitch(Switch::TraceStartup)); + + settings.skia_deterministic_rendering_on_cpu = + command_line.HasOption(FlagForSwitch(Switch::SkiaDeterministicRendering)); + + command_line.GetOptionValue(FlagForSwitch(Switch::FLX), &settings.flx_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir), + &settings.assets_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::Snapshot), + &settings.script_snapshot_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::MainDartFile), + &settings.main_dart_file_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::Packages), + &settings.packages_file_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), + &settings.aot_snapshot_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), + &settings.aot_vm_snapshot_data_filename); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), + &settings.aot_vm_snapshot_instr_filename); + + command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), + &settings.aot_isolate_snapshot_data_filename); + + command_line.GetOptionValue( + FlagForSwitch(Switch::AotIsolateSnapshotInstructions), + &settings.aot_isolate_snapshot_instr_filename); + + command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), + &settings.temp_directory_path); + + command_line.GetOptionValue(FlagForSwitch(Switch::ICUDataFilePath), + &settings.icu_data_path); + + settings.use_test_fonts = + command_line.HasOption(FlagForSwitch(Switch::UseTestFonts)); + + command_line.GetOptionValue(FlagForSwitch(Switch::LogTag), &settings.log_tag); + std::string all_dart_flags; + if (command_line.GetOptionValue(FlagForSwitch(Switch::DartFlags), + &all_dart_flags)) { + std::stringstream stream(all_dart_flags); + std::istream_iterator end; + for (std::istream_iterator it(stream); it != end; ++it) + settings.dart_flags.push_back(*it); + } + +#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE + settings.trace_skia = + command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); +#endif + + return settings; +} + } // namespace shell diff --git a/shell/common/switches.h b/shell/common/switches.h index 91778a78e92cc..6b67b1f6a1567 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "flutter/common/settings.h" +#include "lib/fxl/command_line.h" #include "lib/fxl/strings/string_view.h" #ifndef SHELL_COMMON_SWITCHES_H_ @@ -23,12 +25,29 @@ namespace shell { DEF_SWITCHES_START DEF_SWITCH(AotSharedLibraryPath, "aot-shared-library-path", "Path to the *.so.") -DEF_SWITCH(AotSnapshotPath, "aot-snapshot-path", "Path to the AOT snapshot.") -DEF_SWITCH(AotVmSnapshotData, "vm-snapshot-data", "") -DEF_SWITCH(AotVmSnapshotInstructions, "vm-snapshot-instr", "") -DEF_SWITCH(AotIsolateSnapshotData, "isolate-snapshot-data", "") -DEF_SWITCH(AotIsolateSnapshotInstructions, "isolate-snapshot-instr", "") +DEF_SWITCH(AotSnapshotPath, + "aot-snapshot-path", + "Path to the directory containing the four files specified by " + "AotVmSnapshotData, AotVmSnapshotInstructions, " + "AotVmSnapshotInstructions and AotIsolateSnapshotInstructions.") +DEF_SWITCH(AotVmSnapshotData, + "vm-snapshot-data", + "The VM snapshot data that will be memory mapped as read-only. " + "AotSnapshotPath must be present.") +DEF_SWITCH(AotVmSnapshotInstructions, + "vm-snapshot-instr", + "The VM instructions snapshot that will be memory mapped as read " + "and executable. AotSnapshotPath must be present.") +DEF_SWITCH(AotIsolateSnapshotData, + "isolate-snapshot-data", + "The isolate snapshot data that will be memory mapped as read-only. " + "AotSnapshotPath must be present.") +DEF_SWITCH(AotIsolateSnapshotInstructions, + "isolate-snapshot-instr", + "The isolate instructions snapshot that will be memory mapped as " + "read and executable. AotSnapshotPath must be present.") DEF_SWITCH(CacheDirPath, "cache-dir-path", "Path to the cache directory.") +DEF_SWITCH(ICUDataFilePath, "icu-data-file-path", "Path to the ICU data file.") DEF_SWITCH(DartFlags, "dart-flags", "Flags passed directly to the Dart VM without being interpreted " @@ -73,10 +92,6 @@ DEF_SWITCH(FlutterAssetsDir, DEF_SWITCH(Help, "help", "Display this help text.") DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.") DEF_SWITCH(MainDartFile, "dart-main", "The path to the main Dart file.") -DEF_SWITCH(NonInteractive, - "non-interactive", - "Make the shell non-interactive. By default, the shell attempts " - "to setup a window and create an OpenGL context.") DEF_SWITCH(Packages, "packages", "Specify the path to the packages.") DEF_SWITCH(Snapshot, "snapshot-blob", "Specify the path to the snapshot blob") DEF_SWITCH(StartPaused, @@ -113,7 +128,9 @@ DEF_SWITCHES_END void PrintUsage(const std::string& executable_name); -const fxl::StringView FlagForSwitch(Switch sw); +const fxl::StringView FlagForSwitch(Switch swtch); + +blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line); } // namespace shell diff --git a/shell/common/thread_host.cc b/shell/common/thread_host.cc new file mode 100644 index 0000000000000..f35594829d5d9 --- /dev/null +++ b/shell/common/thread_host.cc @@ -0,0 +1,38 @@ +// Copyright 2017 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/shell/common/thread_host.h" + +namespace shell { + +ThreadHost::ThreadHost() = default; + +ThreadHost::ThreadHost(std::string name_prefix, uint64_t mask) { + if (mask & ThreadHost::Type::Platform) { + platform_thread = std::make_unique(name_prefix + ".platform"); + } + + if (mask & ThreadHost::Type::UI) { + ui_thread = std::make_unique(name_prefix + ".ui"); + } + + if (mask & ThreadHost::Type::GPU) { + gpu_thread = std::make_unique(name_prefix + ".gpu"); + } + + if (mask & ThreadHost::Type::IO) { + io_thread = std::make_unique(name_prefix + ".io"); + } +} + +ThreadHost::~ThreadHost() = default; + +void ThreadHost::Reset() { + platform_thread.reset(); + ui_thread.reset(); + gpu_thread.reset(); + io_thread.reset(); +} + +} // namespace shell diff --git a/shell/common/thread_host.h b/shell/common/thread_host.h new file mode 100644 index 0000000000000..a688aa6a06a85 --- /dev/null +++ b/shell/common/thread_host.h @@ -0,0 +1,43 @@ +// Copyright 2017 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_SHELL_COMMON_THREAD_HOST_H_ +#define FLUTTER_SHELL_COMMON_THREAD_HOST_H_ + +#include + +#include "flutter/fml/thread.h" +#include "lib/fxl/macros.h" + +namespace shell { + +struct ThreadHost { + enum Type { + Platform = 1 << 0, + UI = 1 << 1, + GPU = 1 << 2, + IO = 1 << 3, + }; + + std::unique_ptr platform_thread; + std::unique_ptr ui_thread; + std::unique_ptr gpu_thread; + std::unique_ptr io_thread; + + ThreadHost(); + + ThreadHost(ThreadHost&&) = default; + + ThreadHost& operator=(ThreadHost&&) = default; + + ThreadHost(std::string name_prefix, uint64_t type_mask); + + ~ThreadHost(); + + void Reset(); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_COMMON_THREAD_HOST_H_ diff --git a/shell/common/tracing_controller.cc b/shell/common/tracing_controller.cc deleted file mode 100644 index 6fa8d9d5ee87f..0000000000000 --- a/shell/common/tracing_controller.cc +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/common/tracing_controller.h" - -#include - -#include "flutter/common/threads.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/dart_init.h" -#include "flutter/shell/common/shell.h" -#include "lib/fxl/logging.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace shell { - -TracingController::TracingController() : tracing_active_(false) { - blink::SetEmbedderTracingCallbacks( - std::unique_ptr( - new blink::EmbedderTracingCallbacks([this]() { StartTracing(); }, - [this]() { StopTracing(); }))); -} - -TracingController::~TracingController() { - blink::SetEmbedderTracingCallbacks(nullptr); -} - -static void AddTraceMetadata() { - blink::Threads::Gpu()->PostTask([]() { Dart_SetThreadName("gpu_thread"); }); - blink::Threads::UI()->PostTask([]() { Dart_SetThreadName("ui_thread"); }); - blink::Threads::IO()->PostTask([]() { Dart_SetThreadName("io_thread"); }); - blink::Threads::Platform()->PostTask( - []() { Dart_SetThreadName("platform_thread"); }); -} - -void TracingController::StartTracing() { - if (tracing_active_) - return; - tracing_active_ = true; - AddTraceMetadata(); -} - -void TracingController::StopTracing() { - if (!tracing_active_) { - return; - } - tracing_active_ = false; -} - -} // namespace shell diff --git a/shell/common/tracing_controller.h b/shell/common/tracing_controller.h deleted file mode 100644 index 3f9e6f03ab14c..0000000000000 --- a/shell/common/tracing_controller.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_COMMON_TRACING_CONTROLLER_H_ -#define SHELL_COMMON_TRACING_CONTROLLER_H_ - -#include - -#include "lib/fxl/macros.h" - -namespace shell { - -class TracingController { - public: - TracingController(); - - ~TracingController(); - - void StartTracing(); - - void StopTracing(); - - bool tracing_active() const { return tracing_active_; } - - private: - bool tracing_active_; - - FXL_DISALLOW_COPY_AND_ASSIGN(TracingController); -}; - -} // namespace shell - -#endif // SHELL_COMMON_TRACING_CONTROLLER_H_ diff --git a/shell/common/vsync_waiter.cc b/shell/common/vsync_waiter.cc index 5acc235b1f68d..ba2f21c389c11 100644 --- a/shell/common/vsync_waiter.cc +++ b/shell/common/vsync_waiter.cc @@ -4,8 +4,45 @@ #include "flutter/shell/common/vsync_waiter.h" +#include "flutter/fml/task_runner.h" +#include "flutter/fml/trace_event.h" + namespace shell { +VsyncWaiter::VsyncWaiter(blink::TaskRunners task_runners) + : task_runners_(std::move(task_runners)) {} + VsyncWaiter::~VsyncWaiter() = default; +void VsyncWaiter::AsyncWaitForVsync(Callback callback) { + { + std::lock_guard lock(callback_mutex_); + callback_ = std::move(callback); + } + AwaitVSync(); +} + +void VsyncWaiter::FireCallback(fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { + Callback callback; + + { + std::lock_guard lock(callback_mutex_); + callback = std::move(callback_); + } + + if (!callback) { + return; + } + + task_runners_.GetUITaskRunner()->PostTask( + [callback, frame_start_time, frame_target_time]() { + // Note: The tag name must be "VSYNC" (it is special) so that the + // "Highlight + // Vsync" checkbox in the timeline can be enabled. + TRACE_EVENT0("flutter", "VSYNC"); + callback(frame_start_time, frame_target_time); + }); +} + } // namespace shell diff --git a/shell/common/vsync_waiter.h b/shell/common/vsync_waiter.h index 77319ed8b6966..82231fdf4f853 100644 --- a/shell/common/vsync_waiter.h +++ b/shell/common/vsync_waiter.h @@ -6,7 +6,10 @@ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_H_ #include +#include +#include +#include "flutter/common/task_runners.h" #include "lib/fxl/time/time_point.h" namespace shell { @@ -16,9 +19,23 @@ class VsyncWaiter { using Callback = std::function; - virtual void AsyncWaitForVsync(Callback callback) = 0; - virtual ~VsyncWaiter(); + + void AsyncWaitForVsync(Callback callback); + + protected: + const blink::TaskRunners task_runners_; + std::mutex callback_mutex_; + Callback callback_; + + VsyncWaiter(blink::TaskRunners task_runners); + + virtual void AwaitVSync() = 0; + + void FireCallback(fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time); + + FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiter); }; } // namespace shell diff --git a/shell/common/vsync_waiter_fallback.cc b/shell/common/vsync_waiter_fallback.cc index 01c86cdedc6aa..bcf061bb7615f 100644 --- a/shell/common/vsync_waiter_fallback.cc +++ b/shell/common/vsync_waiter_fallback.cc @@ -4,7 +4,6 @@ #include "flutter/shell/common/vsync_waiter_fallback.h" -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { @@ -21,28 +20,25 @@ fxl::TimePoint SnapToNextTick(fxl::TimePoint value, } // namespace -VsyncWaiterFallback::VsyncWaiterFallback() - : phase_(fxl::TimePoint::Now()), weak_factory_(this) {} +VsyncWaiterFallback::VsyncWaiterFallback(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)), + phase_(fxl::TimePoint::Now()), + weak_factory_(this) {} VsyncWaiterFallback::~VsyncWaiterFallback() = default; constexpr fxl::TimeDelta interval = fxl::TimeDelta::FromSecondsF(1.0 / 60.0); -void VsyncWaiterFallback::AsyncWaitForVsync(Callback callback) { - FXL_DCHECK(!callback_); - callback_ = std::move(callback); - +void VsyncWaiterFallback::AwaitVSync() { fxl::TimePoint now = fxl::TimePoint::Now(); fxl::TimePoint next = SnapToNextTick(now, phase_, interval); - blink::Threads::UI()->PostDelayedTask( + task_runners_.GetUITaskRunner()->PostDelayedTask( [self = weak_factory_.GetWeakPtr()] { - if (!self) - return; - fxl::TimePoint frame_time = fxl::TimePoint::Now(); - Callback callback = std::move(self->callback_); - self->callback_ = Callback(); - callback(frame_time, frame_time + interval); + if (self) { + const auto frame_time = fxl::TimePoint::Now(); + self->FireCallback(frame_time, frame_time + interval); + } }, next - now); } diff --git a/shell/common/vsync_waiter_fallback.h b/shell/common/vsync_waiter_fallback.h index bfb7e118b1330..d3cc8faaf6ce7 100644 --- a/shell/common/vsync_waiter_fallback.h +++ b/shell/common/vsync_waiter_fallback.h @@ -5,25 +5,24 @@ #ifndef FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ #define FLUTTER_SHELL_COMMON_VSYNC_WAITER_FALLBACK_H_ -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "lib/fxl/time/time_point.h" namespace shell { -class VsyncWaiterFallback : public VsyncWaiter { +class VsyncWaiterFallback final : public VsyncWaiter { public: - VsyncWaiterFallback(); - ~VsyncWaiterFallback() override; + VsyncWaiterFallback(blink::TaskRunners task_runners); - void AsyncWaitForVsync(Callback callback) override; + ~VsyncWaiterFallback() override; private: fxl::TimePoint phase_; - Callback callback_; + fxl::WeakPtrFactory weak_factory_; - fml::WeakPtrFactory weak_factory_; + void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback); }; diff --git a/shell/gpu/BUILD.gn b/shell/gpu/BUILD.gn index c050e120b0a10..cd093e1238f7f 100644 --- a/shell/gpu/BUILD.gn +++ b/shell/gpu/BUILD.gn @@ -6,14 +6,17 @@ import("$flutter_root/shell/config.gni") source_set("gpu") { sources = [ - "gpu_rasterizer.cc", - "gpu_rasterizer.h", - "gpu_surface_gl.cc", - "gpu_surface_gl.h", "gpu_surface_software.cc", "gpu_surface_software.h", ] + if (!is_fuchsia) { + sources += [ + "gpu_surface_gl.cc", + "gpu_surface_gl.h", + ] + } + if (shell_enable_vulkan) { sources += [ "gpu_surface_vulkan.cc", diff --git a/shell/gpu/gpu_rasterizer.cc b/shell/gpu/gpu_rasterizer.cc deleted file mode 100644 index 3424f989b3205..0000000000000 --- a/shell/gpu/gpu_rasterizer.cc +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2015 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. - -#include "gpu_rasterizer.h" - -#include -#include - -#include "flutter/common/threads.h" -#include "flutter/glue/trace_event.h" -#include "flutter/shell/common/picture_serializer.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "third_party/skia/include/core/SkPicture.h" - -namespace shell { - -GPURasterizer::GPURasterizer(std::unique_ptr info) - : compositor_context_(std::move(info)), weak_factory_(this) {} - -GPURasterizer::~GPURasterizer() = default; - -fml::WeakPtr GPURasterizer::GetWeakRasterizerPtr() { - return weak_factory_.GetWeakPtr(); -} - -void GPURasterizer::Setup(std::unique_ptr surface, - fxl::Closure continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) { - surface_ = std::move(surface); - compositor_context_.OnGrContextCreated(); - - continuation(); - - setup_completion_event->Signal(); -} - -void GPURasterizer::Clear(SkColor color, const SkISize& size) { - if (surface_ == nullptr) { - return; - } - - auto frame = surface_->AcquireFrame(size); - - if (frame == nullptr) { - return; - } - - SkCanvas* canvas = frame->SkiaCanvas(); - - if (canvas == nullptr) { - return; - } - - canvas->clear(color); - - frame->Submit(); -} - -void GPURasterizer::Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) { - compositor_context_.OnGrContextDestroyed(); - if (surface_) { - surface_.reset(); - } - last_layer_tree_.reset(); - teardown_completion_event->Signal(); -} - -flow::LayerTree* GPURasterizer::GetLastLayerTree() { - return last_layer_tree_.get(); -} - -void GPURasterizer::DrawLastLayerTree() { - if (!last_layer_tree_ || !surface_) { - return; - } - DrawToSurface(*last_layer_tree_); -} - -flow::TextureRegistry& GPURasterizer::GetTextureRegistry() { - return compositor_context_.texture_registry(); -} - -void GPURasterizer::Draw( - fxl::RefPtr> pipeline) { - TRACE_EVENT0("flutter", "GPURasterizer::Draw"); - - flutter::Pipeline::Consumer consumer = - std::bind(&GPURasterizer::DoDraw, this, std::placeholders::_1); - - // Consume as many pipeline items as possible. But yield the event loop - // between successive tries. - switch (pipeline->Consume(consumer)) { - case flutter::PipelineConsumeResult::MoreAvailable: { - auto weak_this = weak_factory_.GetWeakPtr(); - blink::Threads::Gpu()->PostTask([weak_this, pipeline]() { - if (weak_this) { - weak_this->Draw(pipeline); - } - }); - break; - } - default: - break; - } -} - -void GPURasterizer::DoDraw(std::unique_ptr layer_tree) { - if (!layer_tree || !surface_) { - return; - } - - // There is no way for the compositor to know how long the layer tree - // construction took. Fortunately, the layer tree does. Grab that time - // for instrumentation. - compositor_context_.engine_time().SetLapTime(layer_tree->construction_time()); - - DrawToSurface(*layer_tree); - - NotifyNextFrameOnce(); - - last_layer_tree_ = std::move(layer_tree); -} - -void GPURasterizer::DrawToSurface(flow::LayerTree& layer_tree) { - auto frame = surface_->AcquireFrame(layer_tree.frame_size()); - - if (frame == nullptr) { - return; - } - - auto canvas = frame->SkiaCanvas(); - - if (canvas == nullptr) { - return; - } - - auto compositor_frame = - compositor_context_.AcquireFrame(surface_->GetContext(), canvas); - - canvas->clear(SK_ColorBLACK); - - layer_tree.Raster(compositor_frame); - - frame->Submit(); -} - -void GPURasterizer::AddNextFrameCallback(fxl::Closure nextFrameCallback) { - nextFrameCallback_ = nextFrameCallback; -} - -void GPURasterizer::NotifyNextFrameOnce() { - if (nextFrameCallback_) { - blink::Threads::Platform()->PostTask([callback = nextFrameCallback_] { - TRACE_EVENT0("flutter", "GPURasterizer::NotifyNextFrameOnce"); - callback(); - }); - nextFrameCallback_ = nullptr; - } -} - -void GPURasterizer::SetTextureRegistry(flow::TextureRegistry* textureRegistry) { - compositor_context_.SetTextureRegistry(textureRegistry); -} - -} // namespace shell diff --git a/shell/gpu/gpu_rasterizer.h b/shell/gpu/gpu_rasterizer.h deleted file mode 100644 index ad16ee2c47989..0000000000000 --- a/shell/gpu/gpu_rasterizer.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ -#define SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ - -#include "flutter/flow/compositor_context.h" -#include "flutter/shell/common/rasterizer.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/fxl/synchronization/waitable_event.h" - -namespace shell { - -class Surface; - -class GPURasterizer : public Rasterizer { - public: - GPURasterizer(std::unique_ptr info); - - ~GPURasterizer() override; - - void Setup(std::unique_ptr surface, - fxl::Closure continuation, - fxl::AutoResetWaitableEvent* setup_completion_event) override; - - void Clear(SkColor color, const SkISize& size) override; - - void Teardown( - fxl::AutoResetWaitableEvent* teardown_completion_event) override; - - fml::WeakPtr GetWeakRasterizerPtr() override; - - flow::LayerTree* GetLastLayerTree() override; - - void DrawLastLayerTree() override; - - flow::TextureRegistry& GetTextureRegistry() override; - - void Draw(fxl::RefPtr> pipeline) override; - - // Set a callback to be called once when the next frame is drawn. - void AddNextFrameCallback(fxl::Closure nextFrameCallback) override; - - void SetTextureRegistry(flow::TextureRegistry* textureRegistry) override; - - private: - std::unique_ptr surface_; - flow::CompositorContext compositor_context_; - std::unique_ptr last_layer_tree_; - // A closure to be called when the underlaying surface presents a frame the - // next time. NULL if there is no callback or the callback was set back to - // NULL after being called. - fxl::Closure nextFrameCallback_; - fml::WeakPtrFactory weak_factory_; - - void DoDraw(std::unique_ptr layer_tree); - - void DrawToSurface(flow::LayerTree& layer_tree); - - void NotifyNextFrameOnce(); - - FXL_DISALLOW_COPY_AND_ASSIGN(GPURasterizer); -}; - -} // namespace shell - -#endif // SHELL_GPU_DIRECT_GPU_RASTERIZER_H_ diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 331fd188a9ed3..284a10e413b46 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -72,6 +72,8 @@ GPUSurfaceGL::~GPUSurfaceGL() { return; } + GetCompositorContext().OnGrContextDestroyed(); + onscreen_surface_ = nullptr; context_->releaseResourcesAndAbandonContext(); context_ = nullptr; @@ -210,12 +212,11 @@ std::unique_ptr GPUSurfaceGL::AcquireFrame(const SkISize& size) { return nullptr; } - auto weak_this = weak_factory_.GetWeakPtr(); - - SurfaceFrame::SubmitCallback submit_callback = - [weak_this](const SurfaceFrame& surface_frame, SkCanvas* canvas) { - return weak_this ? weak_this->PresentSurface(canvas) : false; - }; + SurfaceFrame::SubmitCallback submit_callback = [weak = weak_factory_ + .GetWeakPtr()]( + const SurfaceFrame& surface_frame, SkCanvas* canvas) { + return weak ? weak->PresentSurface(canvas) : false; + }; return std::make_unique(surface, submit_callback); } diff --git a/shell/gpu/gpu_surface_gl.h b/shell/gpu/gpu_surface_gl.h index 5cf092dae66c5..abc9f46aee297 100644 --- a/shell/gpu/gpu_surface_gl.h +++ b/shell/gpu/gpu_surface_gl.h @@ -5,10 +5,9 @@ #ifndef SHELL_GPU_GPU_SURFACE_GL_H_ #define SHELL_GPU_GPU_SURFACE_GL_H_ -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" -#include "flutter/synchronization/debug_thread_checker.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/gpu/GrContext.h" namespace shell { @@ -44,7 +43,7 @@ class GPUSurfaceGL : public Surface { sk_sp onscreen_surface_; sk_sp offscreen_surface_; bool valid_ = false; - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; bool CreateOrUpdateSurfaces(const SkISize& size); diff --git a/shell/gpu/gpu_surface_software.cc b/shell/gpu/gpu_surface_software.cc index e340e605652dd..ea8c827b22405 100644 --- a/shell/gpu/gpu_surface_software.cc +++ b/shell/gpu/gpu_surface_software.cc @@ -18,20 +18,13 @@ bool GPUSurfaceSoftware::IsValid() { return delegate_ != nullptr; } -bool GPUSurfaceSoftware::SupportsScaling() const { - return true; -} - std::unique_ptr GPUSurfaceSoftware::AcquireFrame( const SkISize& logical_size) { if (!IsValid()) { return nullptr; } - // Check if we need to support surface scaling. - const auto scale = SupportsScaling() ? GetScale() : 1.0; - const auto size = SkISize::Make(logical_size.width() * scale, - logical_size.height() * scale); + const auto size = SkISize::Make(logical_size.width(), logical_size.height()); sk_sp backing_store = delegate_->AcquireBackingStore(size); @@ -48,12 +41,10 @@ std::unique_ptr GPUSurfaceSoftware::AcquireFrame( // irrespective of surface scaling. SkCanvas* canvas = backing_store->getCanvas(); canvas->resetMatrix(); - canvas->scale(scale, scale); - SurfaceFrame::SubmitCallback - on_submit = [self = weak_factory_.GetWeakPtr()]( - const SurfaceFrame& surface_frame, SkCanvas* canvas) - ->bool { + SurfaceFrame::SubmitCallback on_submit = + [self = weak_factory_.GetWeakPtr()](const SurfaceFrame& surface_frame, + SkCanvas* canvas) -> bool { // If the surface itself went away, there is nothing more to do. if (!self || !self->IsValid() || canvas == nullptr) { return false; diff --git a/shell/gpu/gpu_surface_software.h b/shell/gpu/gpu_surface_software.h index f7312153db8bc..238754f312b80 100644 --- a/shell/gpu/gpu_surface_software.h +++ b/shell/gpu/gpu_surface_software.h @@ -5,9 +5,9 @@ #ifndef FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_GPU_GPU_SURFACE_SOFTWARE_H_ -#include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" #include "third_party/skia/include/core/SkSurface.h" namespace shell { @@ -30,12 +30,9 @@ class GPUSurfaceSoftware : public Surface { GrContext* GetContext() override; - bool SupportsScaling() const override; - private: GPUSurfaceSoftwareDelegate* delegate_; - - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceSoftware); }; diff --git a/shell/gpu/gpu_surface_vulkan.h b/shell/gpu/gpu_surface_vulkan.h index eafed43a6296d..f1e25fbe987b8 100644 --- a/shell/gpu/gpu_surface_vulkan.h +++ b/shell/gpu/gpu_surface_vulkan.h @@ -6,11 +6,12 @@ #define SHELL_GPU_GPU_SURFACE_VULKAN_H_ #include -#include "flutter/fml/memory/weak_ptr.h" + #include "flutter/shell/common/surface.h" #include "flutter/vulkan/vulkan_native_surface.h" #include "flutter/vulkan/vulkan_window.h" #include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" namespace shell { @@ -29,7 +30,7 @@ class GPUSurfaceVulkan : public Surface { private: vulkan::VulkanWindow window_; - fml::WeakPtrFactory weak_factory_; + fxl::WeakPtrFactory weak_factory_; FXL_DISALLOW_COPY_AND_ASSIGN(GPUSurfaceVulkan); }; diff --git a/shell/platform/BUILD.gn b/shell/platform/BUILD.gn index 4b1e1a9e0bfeb..ae3b1003f22fe 100644 --- a/shell/platform/BUILD.gn +++ b/shell/platform/BUILD.gn @@ -13,13 +13,11 @@ group("platform") { ] } else if (is_linux) { deps = [ - "linux", "embedder", ] } else if (is_win) { - deps = [ - "win" - ] + # There is no platform target on windows. Instead, only a tester is used. + deps = [] } else { assert(false, "Unknown/Unsupported platform.") } diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index d9744ad890caa..129c877faed0f 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -17,21 +17,25 @@ shared_library("flutter_shell_native") { "android_context_gl.h", "android_environment_gl.cc", "android_environment_gl.h", - "android_external_texture_gl.h", "android_external_texture_gl.cc", + "android_external_texture_gl.h", "android_native_window.cc", "android_native_window.h", + "android_shell_holder.cc", + "android_shell_holder.h", "android_surface.cc", "android_surface.h", "android_surface_gl.cc", "android_surface_gl.h", - "android_surface_software.h", "android_surface_software.cc", - "apk_asset_provider.h", + "android_surface_software.h", "apk_asset_provider.cc", + "apk_asset_provider.h", "flutter_main.cc", "flutter_main.h", "library_loader.cc", + "platform_message_response_android.cc", + "platform_message_response_android.h", "platform_view_android.cc", "platform_view_android.h", "platform_view_android_jni.cc", @@ -41,10 +45,10 @@ shared_library("flutter_shell_native") { ] deps = [ + "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/assets", "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/shell/common", @@ -59,9 +63,7 @@ shared_library("flutter_shell_native") { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] defines = [] diff --git a/shell/platform/android/android_context_gl.cc b/shell/platform/android/android_context_gl.cc index f54629f8644b9..6338dc96908e1 100644 --- a/shell/platform/android/android_context_gl.cc +++ b/shell/platform/android/android_context_gl.cc @@ -3,9 +3,13 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_context_gl.h" + #include + #include +#include "flutter/fml/trace_event.h" + namespace shell { template @@ -65,19 +69,17 @@ static EGLResult CreateContext(EGLDisplay display, return {context != EGL_NO_CONTEXT, context}; } -static EGLResult ChooseEGLConfiguration( - EGLDisplay display, - PlatformView::SurfaceConfig config) { +static EGLResult ChooseEGLConfiguration(EGLDisplay display) { EGLint attributes[] = { // clang-format off EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RED_SIZE, config.red_bits, - EGL_GREEN_SIZE, config.green_bits, - EGL_BLUE_SIZE, config.blue_bits, - EGL_ALPHA_SIZE, config.alpha_bits, - EGL_DEPTH_SIZE, config.depth_bits, - EGL_STENCIL_SIZE, config.stencil_bits, + EGL_RED_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_BLUE_SIZE, 8, + EGL_ALPHA_SIZE, 8, + EGL_DEPTH_SIZE, 0, + EGL_STENCIL_SIZE, 0, EGL_NONE, // termination sentinel // clang-format on }; @@ -142,7 +144,6 @@ bool AndroidContextGL::CreatePBufferSurface() { } AndroidContextGL::AndroidContextGL(fxl::RefPtr env, - PlatformView::SurfaceConfig config, const AndroidContextGL* share_context) : environment_(env), window_(nullptr), @@ -158,8 +159,7 @@ AndroidContextGL::AndroidContextGL(fxl::RefPtr env, // Choose a valid configuration. - std::tie(success, config_) = - ChooseEGLConfiguration(environment_->Display(), config); + std::tie(success, config_) = ChooseEGLConfiguration(environment_->Display()); if (!success) { FXL_LOG(ERROR) << "Could not choose an EGL configuration."; diff --git a/shell/platform/android/android_context_gl.h b/shell/platform/android/android_context_gl.h index 207f621c66bd1..b29851b34564d 100644 --- a/shell/platform/android/android_context_gl.h +++ b/shell/platform/android/android_context_gl.h @@ -44,7 +44,6 @@ class AndroidContextGL : public fxl::RefCountedThreadSafe { bool valid_; AndroidContextGL(fxl::RefPtr env, - PlatformView::SurfaceConfig config, const AndroidContextGL* share_context = nullptr); ~AndroidContextGL(); diff --git a/shell/platform/android/android_external_texture_gl.cc b/shell/platform/android/android_external_texture_gl.cc index 02a40c22474a1..35db9cbbfdb95 100644 --- a/shell/platform/android/android_external_texture_gl.cc +++ b/shell/platform/android/android_external_texture_gl.cc @@ -5,7 +5,7 @@ #include "flutter/shell/platform/android/android_external_texture_gl.h" #include -#include "flutter/common/threads.h" + #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "third_party/skia/include/gpu/GrTexture.h" @@ -19,17 +19,14 @@ AndroidExternalTextureGL::AndroidExternalTextureGL( AndroidExternalTextureGL::~AndroidExternalTextureGL() = default; void AndroidExternalTextureGL::OnGrContextCreated() { - ASSERT_IS_GPU_THREAD; state_ = AttachmentState::uninitialized; } void AndroidExternalTextureGL::MarkNewFrameAvailable() { - ASSERT_IS_GPU_THREAD; new_frame_ready_ = true; } void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { - ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::detached) { return; } @@ -42,7 +39,8 @@ void AndroidExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { Update(); new_frame_ready_ = false; } - GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, GL_RGBA8_OES}; + GrGLTextureInfo textureInfo = {GL_TEXTURE_EXTERNAL_OES, texture_name_, + GL_RGBA8_OES}; GrBackendTexture backendTexture(1, 1, GrMipMapped::kNo, textureInfo); sk_sp image = SkImage::MakeFromTexture( canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, @@ -82,7 +80,6 @@ void AndroidExternalTextureGL::UpdateTransform() { } void AndroidExternalTextureGL::OnGrContextDestroyed() { - ASSERT_IS_GPU_THREAD; if (state_ == AttachmentState::attached) { Detach(); } diff --git a/shell/platform/android/android_external_texture_gl.h b/shell/platform/android/android_external_texture_gl.h index df890b91c827f..67d6541d964c2 100644 --- a/shell/platform/android/android_external_texture_gl.h +++ b/shell/platform/android/android_external_texture_gl.h @@ -25,8 +25,7 @@ class AndroidExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; - // Called on GPU thread. - void MarkNewFrameAvailable(); + void MarkNewFrameAvailable() override; private: void Attach(jint textureName); diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc new file mode 100644 index 0000000000000..7dc454f1fb74a --- /dev/null +++ b/shell/platform/android/android_shell_holder.cc @@ -0,0 +1,169 @@ +// Copyright 2018 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/shell/platform/android/android_shell_holder.h" + +#include +#include + +#include +#include +#include + +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/platform/android/platform_view_android.h" +#include "lib/fxl/functional/make_copyable.h" + +namespace shell { + +AndroidShellHolder::AndroidShellHolder( + blink::Settings settings, + fml::jni::JavaObjectWeakGlobalRef java_object) + : settings_(std::move(settings)), java_object_(java_object) { + static size_t shell_count = 1; + auto thread_label = std::to_string(shell_count++); + + thread_host_ = {thread_label, ThreadHost::Type::UI | ThreadHost::Type::GPU | + ThreadHost::Type::IO}; + + fml::WeakPtr weak_platform_view; + Shell::CreateCallback on_create_platform_view = + [java_object, &weak_platform_view](Shell& shell) { + auto platform_view_android = std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + java_object, // java object handle for JNI interop + shell.GetSettings() + .enable_software_rendering // use software rendering + ); + weak_platform_view = platform_view_android->GetWeakPtr(); + return platform_view_android; + }; + + Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // The current thread will be used as the platform thread. Ensure that the + // message loop is initialized. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + blink::TaskRunners task_runners( + thread_label, // label + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + thread_host_.gpu_thread->GetTaskRunner(), // gpu + thread_host_.ui_thread->GetTaskRunner(), // ui + thread_host_.io_thread->GetTaskRunner() // io + ); + + shell_ = + Shell::Create(task_runners, // task runners + settings_, // settings + on_create_platform_view, // platform view create callback + on_create_rasterizer // rasterizer create callback + ); + + platform_view_ = weak_platform_view; + FXL_DCHECK(platform_view_); + + is_valid_ = shell_ != nullptr; + + if (is_valid_) { + task_runners.GetGPUTaskRunner()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); + task_runners.GetUITaskRunner()->PostTask( + []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); + } +} + +AndroidShellHolder::~AndroidShellHolder() = default; + +bool AndroidShellHolder::IsValid() const { + return is_valid_; +} + +const blink::Settings& AndroidShellHolder::GetSettings() const { + return settings_; +} + +void AndroidShellHolder::Launch(RunConfiguration config) { + if (!IsValid()) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = shell_->GetEngine(), // + config = std::move(config) // + ]() mutable { + if (engine) { + if (!engine->Run(std::move(config))) { + FXL_LOG(ERROR) << "Could not launch engine in configuration."; + } + } + })); +} + +void AndroidShellHolder::SetViewportMetrics( + const blink::ViewportMetrics& metrics) { + if (!IsValid()) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), metrics]() { + if (engine) { + engine->SetViewportMetrics(metrics); + } + }); +} + +void AndroidShellHolder::DispatchPointerDataPacket( + std::unique_ptr packet) { + if (!IsValid()) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = shell_->GetEngine(), packet = std::move(packet)] { + if (engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); +} + +Rasterizer::Screenshot AndroidShellHolder::Screenshot( + Rasterizer::ScreenshotType type, + bool base64_encode) { + if (!IsValid()) { + return {nullptr, SkISize::MakeEmpty()}; + } + return shell_->Screenshot(type, base64_encode); +} + +fml::WeakPtr AndroidShellHolder::GetPlatformView() { + FXL_DCHECK(platform_view_); + return platform_view_; +} + +void AndroidShellHolder::UpdateAssetManager( + fxl::RefPtr asset_manager) { + if (!IsValid() || !asset_manager) { + return; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), + asset_manager = std::move(asset_manager)]() { + if (engine) { + if (!engine->UpdateAssetManager(std::move(asset_manager))) { + FXL_DLOG(ERROR) << "Could not update asset asset manager."; + } + } + }); +} + +} // namespace shell diff --git a/shell/platform/android/android_shell_holder.h b/shell/platform/android/android_shell_holder.h new file mode 100644 index 0000000000000..e0905f0f9e42e --- /dev/null +++ b/shell/platform/android/android_shell_holder.h @@ -0,0 +1,59 @@ +// Copyright 2018 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_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ + +#include + +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/lib/ui/window/viewport_metrics.h" +#include "flutter/shell/common/run_configuration.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/android/platform_view_android.h" +#include "lib/fxl/files/unique_fd.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class AndroidShellHolder { + public: + AndroidShellHolder(blink::Settings settings, + fml::jni::JavaObjectWeakGlobalRef java_object); + + ~AndroidShellHolder(); + + bool IsValid() const; + + void Launch(RunConfiguration configuration); + + void SetViewportMetrics(const blink::ViewportMetrics& metrics); + + void DispatchPointerDataPacket( + std::unique_ptr packet); + + const blink::Settings& GetSettings() const; + + fml::WeakPtr GetPlatformView(); + + Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, + bool base64_encode); + + void UpdateAssetManager(fxl::RefPtr asset_manager); + + private: + const blink::Settings settings_; + const fml::jni::JavaObjectWeakGlobalRef java_object_; + fml::WeakPtr platform_view_; + ThreadHost thread_host_; + std::unique_ptr shell_; + bool is_valid_ = false; + + FXL_DISALLOW_COPY_AND_ASSIGN(AndroidShellHolder); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SHELL_HOLDER_H_ diff --git a/shell/platform/android/android_surface.cc b/shell/platform/android/android_surface.cc index 4dd08609da370..a8b41bacbf7c5 100644 --- a/shell/platform/android/android_surface.cc +++ b/shell/platform/android/android_surface.cc @@ -4,8 +4,32 @@ #include "flutter/shell/platform/android/android_surface.h" +#include + +#include "flutter/shell/platform/android/android_surface_gl.h" +#include "flutter/shell/platform/android/android_surface_software.h" +#if SHELL_ENABLE_VULKAN +#include "flutter/shell/platform/android/android_surface_vulkan.h" +#endif // SHELL_ENABLE_VULKAN + namespace shell { +std::unique_ptr AndroidSurface::Create( + bool use_software_rendering) { + if (use_software_rendering) { + auto software_surface = std::make_unique(); + return software_surface->IsValid() ? std::move(software_surface) : nullptr; + } +#if SHELL_ENABLE_VULKAN + auto vulkan_surface = std::make_unique(); + return vulkan_surface->IsValid() ? std::move(vulkan_surface) : nullptr; +#else // SHELL_ENABLE_VULKAN + auto gl_surface = std::make_unique(); + return gl_surface->IsOffscreenContextValid() ? std::move(gl_surface) + : nullptr; +#endif // SHELL_ENABLE_VULKAN +} + AndroidSurface::~AndroidSurface() = default; } // namespace shell diff --git a/shell/platform/android/android_surface.h b/shell/platform/android/android_surface.h index 2425a61e20707..858b07eb45d9f 100644 --- a/shell/platform/android/android_surface.h +++ b/shell/platform/android/android_surface.h @@ -19,6 +19,8 @@ namespace shell { class AndroidSurface { public: + static std::unique_ptr Create(bool use_software_rendering); + virtual ~AndroidSurface(); virtual bool IsValid() const = 0; @@ -27,14 +29,11 @@ class AndroidSurface { virtual std::unique_ptr CreateGPUSurface() = 0; - virtual SkISize OnScreenSurfaceSize() const = 0; - virtual bool OnScreenSurfaceResize(const SkISize& size) const = 0; virtual bool ResourceContextMakeCurrent() = 0; - virtual bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config = {}) = 0; + virtual bool SetNativeWindow(fxl::RefPtr window) = 0; }; } // namespace shell diff --git a/shell/platform/android/android_surface_gl.cc b/shell/platform/android/android_surface_gl.cc index f30ac1272b043..274b652a97b74 100644 --- a/shell/platform/android/android_surface_gl.cc +++ b/shell/platform/android/android_surface_gl.cc @@ -6,14 +6,12 @@ #include -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" #include "lib/fxl/memory/ref_ptr.h" namespace shell { -static fxl::RefPtr GlobalResourceLoadingContext( - PlatformView::SurfaceConfig offscreen_config) { +static fxl::RefPtr GlobalResourceLoadingContext() { // AndroidSurfaceGL instances are only ever created on the platform thread. So // there is no need to lock here. @@ -29,11 +27,7 @@ static fxl::RefPtr GlobalResourceLoadingContext( return nullptr; } - // TODO(chinmaygarde): We should check that the configurations are stable - // across multiple invocations. - - auto context = - fxl::MakeRefCounted(environment, offscreen_config); + auto context = fxl::MakeRefCounted(environment); if (!context->IsValid()) { return nullptr; @@ -43,10 +37,9 @@ static fxl::RefPtr GlobalResourceLoadingContext( return global_context; } -AndroidSurfaceGL::AndroidSurfaceGL( - PlatformView::SurfaceConfig offscreen_config) { +AndroidSurfaceGL::AndroidSurfaceGL() { // Acquire the offscreen context. - offscreen_context_ = GlobalResourceLoadingContext(offscreen_config); + offscreen_context_ = GlobalResourceLoadingContext(); if (!offscreen_context_ || !offscreen_context_->IsValid()) { offscreen_context_ = nullptr; @@ -60,14 +53,9 @@ bool AndroidSurfaceGL::IsOffscreenContextValid() const { } void AndroidSurfaceGL::TeardownOnScreenContext() { - fxl::AutoResetWaitableEvent latch; - blink::Threads::Gpu()->PostTask([this, &latch]() { - if (IsValid()) { - GLContextClearCurrent(); - } - latch.Signal(); - }); - latch.Wait(); + if (onscreen_context_) { + onscreen_context_->ClearCurrent(); + } onscreen_context_ = nullptr; } @@ -84,11 +72,6 @@ std::unique_ptr AndroidSurfaceGL::CreateGPUSurface() { return surface->IsValid() ? std::move(surface) : nullptr; } -SkISize AndroidSurfaceGL::OnScreenSurfaceSize() const { - FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); - return onscreen_context_->GetSize(); -} - bool AndroidSurfaceGL::OnScreenSurfaceResize(const SkISize& size) const { FXL_DCHECK(onscreen_context_ && onscreen_context_->IsValid()); return onscreen_context_->Resize(size); @@ -99,8 +82,8 @@ bool AndroidSurfaceGL::ResourceContextMakeCurrent() { return offscreen_context_->MakeCurrent(); } -bool AndroidSurfaceGL::SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) { +bool AndroidSurfaceGL::SetNativeWindow( + fxl::RefPtr window) { // In any case, we want to get rid of our current onscreen context. onscreen_context_ = nullptr; @@ -112,7 +95,7 @@ bool AndroidSurfaceGL::SetNativeWindow(fxl::RefPtr window, // Create the onscreen context. onscreen_context_ = fxl::MakeRefCounted( - offscreen_context_->Environment(), config, + offscreen_context_->Environment(), offscreen_context_.get() /* sharegroup */); if (!onscreen_context_->IsValid()) { diff --git a/shell/platform/android/android_surface_gl.h b/shell/platform/android/android_surface_gl.h index 08aee081c8266..e26f2bf50d3a9 100644 --- a/shell/platform/android/android_surface_gl.h +++ b/shell/platform/android/android_surface_gl.h @@ -16,35 +16,43 @@ namespace shell { -class AndroidSurfaceGL : public GPUSurfaceGLDelegate, public AndroidSurface { +class AndroidSurfaceGL final : public GPUSurfaceGLDelegate, + public AndroidSurface { public: - explicit AndroidSurfaceGL(PlatformView::SurfaceConfig offscreen_config); + AndroidSurfaceGL(); ~AndroidSurfaceGL() override; - bool IsValid() const override; - bool IsOffscreenContextValid() const; + // |shell::AndroidSurface| + bool IsValid() const override; + + // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; + // |shell::AndroidSurface| void TeardownOnScreenContext() override; - SkISize OnScreenSurfaceSize() const override; - + // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; + // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) override; + // |shell::AndroidSurface| + bool SetNativeWindow(fxl::RefPtr window) override; + // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; + // |shell::GPUSurfaceGLDelegate| bool GLContextClearCurrent() override; + // |shell::GPUSurfaceGLDelegate| bool GLContextPresent() override; + // |shell::GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; private: diff --git a/shell/platform/android/android_surface_software.cc b/shell/platform/android/android_surface_software.cc index 68bf99b27ba56..4b1378802d9e4 100644 --- a/shell/platform/android/android_surface_software.cc +++ b/shell/platform/android/android_surface_software.cc @@ -3,15 +3,14 @@ // found in the LICENSE file. #include "flutter/shell/platform/android/android_surface_software.h" -#include "flutter/common/threads.h" -#include "flutter/fml/platform/android/jni_weak_ref.h" -#include "flutter/fml/platform/android/scoped_java_ref.h" -#include "flutter/shell/platform/android/platform_view_android_jni.h" #include #include +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" +#include "flutter/shell/platform/android/platform_view_android_jni.h" #include "lib/fxl/logging.h" namespace shell { @@ -132,17 +131,12 @@ bool AndroidSurfaceSoftware::PresentBackingStore( void AndroidSurfaceSoftware::TeardownOnScreenContext() {} -SkISize AndroidSurfaceSoftware::OnScreenSurfaceSize() const { - return SkISize(); -} - bool AndroidSurfaceSoftware::OnScreenSurfaceResize(const SkISize& size) const { return true; } bool AndroidSurfaceSoftware::SetNativeWindow( - fxl::RefPtr window, - PlatformView::SurfaceConfig config) { + fxl::RefPtr window) { native_window_ = std::move(window); if (!(native_window_ && native_window_->IsValid())) return false; diff --git a/shell/platform/android/android_surface_software.h b/shell/platform/android/android_surface_software.h index 76184b707cf74..0f82fc5dfe154 100644 --- a/shell/platform/android/android_surface_software.h +++ b/shell/platform/android/android_surface_software.h @@ -13,35 +13,39 @@ namespace shell { -class AndroidSurfaceSoftware : public AndroidSurface, - public GPUSurfaceSoftwareDelegate { +class AndroidSurfaceSoftware final : public AndroidSurface, + public GPUSurfaceSoftwareDelegate { public: AndroidSurfaceSoftware(); ~AndroidSurfaceSoftware() override; + // |shell::AndroidSurface| bool IsValid() const override; + // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; + // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; - sk_sp AcquireBackingStore(const SkISize& size) override; - - bool PresentBackingStore(sk_sp backing_store) override; - + // |shell::AndroidSurface| void TeardownOnScreenContext() override; - SkISize OnScreenSurfaceSize() const override; - + // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; - bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) override; + // |shell::AndroidSurface| + bool SetNativeWindow(fxl::RefPtr window) override; + + // |shell::GPUSurfaceSoftwareDelegate| + sk_sp AcquireBackingStore(const SkISize& size) override; + + // |shell::GPUSurfaceSoftwareDelegate| + bool PresentBackingStore(sk_sp backing_store) override; private: sk_sp sk_surface_; - fxl::RefPtr native_window_; SkColorType target_color_type_; SkAlphaType target_alpha_type_; diff --git a/shell/platform/android/android_surface_vulkan.cc b/shell/platform/android/android_surface_vulkan.cc index ccacf538b8781..e8817690188c2 100644 --- a/shell/platform/android/android_surface_vulkan.cc +++ b/shell/platform/android/android_surface_vulkan.cc @@ -21,10 +21,12 @@ bool AndroidSurfaceVulkan::IsValid() const { return proc_table_->HasAcquiredMandatoryProcAddresses(); } +// |shell::AndroidSurface| void AndroidSurfaceVulkan::TeardownOnScreenContext() { - // + // Nothing to do. } +// |shell::AndroidSurface| std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { if (!IsValid()) { return nullptr; @@ -52,21 +54,20 @@ std::unique_ptr AndroidSurfaceVulkan::CreateGPUSurface() { return gpu_surface; } -SkISize AndroidSurfaceVulkan::OnScreenSurfaceSize() const { - return native_window_ ? native_window_->GetSize() : SkISize::Make(0, 0); -} - +// |shell::AndroidSurface| bool AndroidSurfaceVulkan::OnScreenSurfaceResize(const SkISize& size) const { return true; } +// |shell::AndroidSurface| bool AndroidSurfaceVulkan::ResourceContextMakeCurrent() { + FXL_DLOG(ERROR) << "The vulkan backend does not support resource contexts."; return false; } +// |shell::AndroidSurface| bool AndroidSurfaceVulkan::SetNativeWindow( - fxl::RefPtr window, - PlatformView::SurfaceConfig config) { + fxl::RefPtr window) { native_window_ = std::move(window); return native_window_ && native_window_->IsValid(); } diff --git a/shell/platform/android/android_surface_vulkan.h b/shell/platform/android/android_surface_vulkan.h index f1ecf610c8584..fd3f493d49790 100644 --- a/shell/platform/android/android_surface_vulkan.h +++ b/shell/platform/android/android_surface_vulkan.h @@ -20,20 +20,23 @@ class AndroidSurfaceVulkan : public AndroidSurface { ~AndroidSurfaceVulkan() override; + // |shell::AndroidSurface| bool IsValid() const override; - void TeardownOnScreenContext() override; - + // |shell::AndroidSurface| std::unique_ptr CreateGPUSurface() override; - SkISize OnScreenSurfaceSize() const override; + // |shell::AndroidSurface| + void TeardownOnScreenContext() override; + // |shell::AndroidSurface| bool OnScreenSurfaceResize(const SkISize& size) const override; + // |shell::AndroidSurface| bool ResourceContextMakeCurrent() override; - bool SetNativeWindow(fxl::RefPtr window, - PlatformView::SurfaceConfig config) override; + // |shell::AndroidSurface| + bool SetNativeWindow(fxl::RefPtr window) override; private: fxl::RefPtr proc_table_; diff --git a/shell/platform/android/apk_asset_provider.cc b/shell/platform/android/apk_asset_provider.cc index fdd4910a12f4c..4cf6da16dc64f 100644 --- a/shell/platform/android/apk_asset_provider.cc +++ b/shell/platform/android/apk_asset_provider.cc @@ -7,32 +7,41 @@ namespace blink { +APKAssetProvider::APKAssetProvider(JNIEnv* env, + jobject jassetManager, + std::string directory) + : directory_(std::move(directory)) { + assetManager_ = AAssetManager_fromJava(env, jassetManager); +} + +APKAssetProvider::~APKAssetProvider() = default; + +bool APKAssetProvider::IsValid() const { + return true; +} + bool APKAssetProvider::GetAsBuffer(const std::string& asset_name, - std::vector* data) { + std::vector* data) const { std::stringstream ss; ss << directory_.c_str() << "/" << asset_name; - AAsset* asset = AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); + AAsset* asset = + AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); if (!asset) { - return false; + return false; } uint8_t* buffer = (uint8_t*)AAsset_getBuffer(asset); if (!buffer) { FXL_LOG(ERROR) << "Got null trying to acquire buffer for asset:" << asset; + AAsset_close(asset); return false; } data->resize(AAsset_getLength(asset)); std::copy(buffer, buffer + data->size(), data->begin()); + AAsset_close(asset); return true; } -APKAssetProvider::~APKAssetProvider() {} - -APKAssetProvider::APKAssetProvider(JNIEnv* env, jobject jassetManager, std::string directory) - : directory_(std::move(directory)) { - assetManager_ = AAssetManager_fromJava(env, jassetManager); -} - } // namespace blink diff --git a/shell/platform/android/apk_asset_provider.h b/shell/platform/android/apk_asset_provider.h index c40b1ed2a1866..70ddbe454bc61 100644 --- a/shell/platform/android/apk_asset_provider.h +++ b/shell/platform/android/apk_asset_provider.h @@ -5,28 +5,35 @@ #ifndef FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ #define FLUTTER_ASSETS_APK_ASSET_PROVIDER_H_ -#include #include +#include -#include "flutter/assets/asset_provider.h" +#include "flutter/assets/asset_resolver.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { -class APKAssetProvider - : public AssetProvider { +class APKAssetProvider final : public AssetResolver { public: - explicit APKAssetProvider(JNIEnv* env, jobject assetManager, std::string directory); + explicit APKAssetProvider(JNIEnv* env, + jobject assetManager, + std::string directory); virtual ~APKAssetProvider(); + private: + AAssetManager* assetManager_; + const std::string directory_; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data); + std::vector* data) const override; - private: - AAssetManager* assetManager_; - const std::string directory_; + FXL_DISALLOW_COPY_AND_ASSIGN(APKAssetProvider); }; } // namespace blink -#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file +#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file diff --git a/shell/platform/android/flutter_main.cc b/shell/platform/android/flutter_main.cc index 6df346a128722..08d97add93b87 100644 --- a/shell/platform/android/flutter_main.cc +++ b/shell/platform/android/flutter_main.cc @@ -2,38 +2,85 @@ // 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/shell/platform/android/flutter_main.h" #include +#include "flutter/fml/message_loop.h" +#include "flutter/fml/paths.h" #include "flutter/fml/platform/android/jni_util.h" +#include "flutter/runtime/dart_vm.h" #include "flutter/runtime/start_up.h" #include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" #include "lib/fxl/arraysize.h" #include "lib/fxl/command_line.h" +#include "lib/fxl/files/file.h" #include "lib/fxl/macros.h" #include "third_party/dart/runtime/include/dart_tools_api.h" namespace shell { -static void Init(JNIEnv* env, - jclass clazz, - jobject context, - jobjectArray jargs, - jstring bundlePath) { - // Prepare command line arguments and initialize the shell. +FlutterMain::FlutterMain(blink::Settings settings) + : settings_(std::move(settings)) {} + +FlutterMain::~FlutterMain() = default; + +static std::unique_ptr g_flutter_main; + +FlutterMain& FlutterMain::Get() { + FXL_CHECK(g_flutter_main) << "ensureInitializationComplete must have already " + "been called."; + return *g_flutter_main; +} + +const blink::Settings& FlutterMain::GetSettings() const { + return settings_; +} + +void FlutterMain::Init(JNIEnv* env, + jclass clazz, + jobject context, + jobjectArray jargs, + jstring bundlePath) { std::vector args; - args.push_back("flutter_tester"); + args.push_back("flutter"); for (auto& arg : fml::jni::StringArrayToVector(env, jargs)) { args.push_back(std::move(arg)); } - auto command_line = fxl::CommandLineFromIterators(args.begin(), args.end()); - std::string icu_data_path = - command_line.GetOptionValueWithDefault("icu-data-file-path", ""); - Shell::InitStandalone(std::move(command_line), std::move(icu_data_path), - /* application_library_path= */ "", - fml::jni::JavaStringToString(env, bundlePath)); + + auto settings = SettingsFromCommandLine(command_line); + + settings.assets_path = fml::jni::JavaStringToString(env, bundlePath); + + if (!blink::DartVM::IsRunningPrecompiledCode()) { + // Check to see if the appropriate kernel files are present and configure + // settings accordingly. + auto platform_kernel_path = + fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); + auto application_kernel_path = + fml::paths::JoinPaths({settings.assets_path, "kernel_blob.bin"}); + + if (files::IsFile(platform_kernel_path) && + files::IsFile(application_kernel_path)) { + settings.kernel_snapshot_path = platform_kernel_path; + settings.application_kernel_asset = application_kernel_path; + } + } + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + // Not thread safe. Will be removed when FlutterMain is refactored to no + // longer be a singleton. + g_flutter_main.reset(new FlutterMain(std::move(settings))); } static void RecordStartTimestamp(JNIEnv* env, @@ -44,7 +91,7 @@ static void RecordStartTimestamp(JNIEnv* env, blink::engine_main_enter_ts = Dart_TimelineGetMicros() - initTimeMicros; } -bool RegisterFlutterMain(JNIEnv* env) { +bool FlutterMain::Register(JNIEnv* env) { static const JNINativeMethod methods[] = { { .name = "nativeInit", diff --git a/shell/platform/android/flutter_main.h b/shell/platform/android/flutter_main.h index f4f65c499f966..6c8717e9cebdb 100644 --- a/shell/platform/android/flutter_main.h +++ b/shell/platform/android/flutter_main.h @@ -7,9 +7,34 @@ #include +#include "flutter/common/settings.h" +#include "lib/fxl/macros.h" + namespace shell { -bool RegisterFlutterMain(JNIEnv* env); +class FlutterMain { + public: + ~FlutterMain(); + + static bool Register(JNIEnv* env); + + static FlutterMain& Get(); + + const blink::Settings& GetSettings() const; + + private: + const blink::Settings settings_; + + FlutterMain(blink::Settings settings); + + static void Init(JNIEnv* env, + jclass clazz, + jobject context, + jobjectArray jargs, + jstring bundlePath); + + FXL_DISALLOW_COPY_AND_ASSIGN(FlutterMain); +}; } // namespace shell diff --git a/shell/platform/android/library_loader.cc b/shell/platform/android/library_loader.cc index c51d0114282f6..569825ce33e21 100644 --- a/shell/platform/android/library_loader.cc +++ b/shell/platform/android/library_loader.cc @@ -16,7 +16,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { bool result = false; // Register FlutterMain. - result = shell::RegisterFlutterMain(env); + result = shell::FlutterMain::Register(env); FXL_CHECK(result); // Register PlatformView diff --git a/shell/platform/android/platform_message_response_android.cc b/shell/platform/android/platform_message_response_android.cc new file mode 100644 index 0000000000000..214080ec5bde3 --- /dev/null +++ b/shell/platform/android/platform_message_response_android.cc @@ -0,0 +1,62 @@ +// Copyright 2018 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/shell/platform/android/platform_message_response_android.h" + +#include "flutter/shell/platform/android/platform_view_android_jni.h" +#include "lib/fxl/functional/make_copyable.h" + +namespace shell { + +PlatformMessageResponseAndroid::PlatformMessageResponseAndroid( + int response_id, + fml::jni::JavaObjectWeakGlobalRef weak_java_object, + fxl::RefPtr platform_task_runner) + : response_id_(response_id), + weak_java_object_(weak_java_object), + platform_task_runner_(std::move(platform_task_runner)) {} + +// |blink::PlatformMessageResponse| +void PlatformMessageResponseAndroid::Complete(std::vector data) { + platform_task_runner_->PostTask( + fxl::MakeCopyable([response = response_id_, // + weak_java_object = weak_java_object_, // + data = std::move(data) // + ]() { + // We are on the platform thread. Attempt to get the strong reference to + // the Java object. + auto env = fml::jni::AttachCurrentThread(); + auto java_object = weak_java_object.get(env); + + if (java_object.is_null()) { + // The Java object was collected before this message response got to + // it. Drop the response on the floor. + return; + } + + if (data.size() == 0) { + // If the data is empty, there is no reason to create a Java byte + // array. Make the response now with a nullptr now. + FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), + response, nullptr); + } + + // Convert the vector to a Java byte array. + fml::jni::ScopedJavaLocalRef data_array( + env, env->NewByteArray(data.size())); + env->SetByteArrayRegion(data_array.obj(), 0, data.size(), + reinterpret_cast(data.data())); + + // Make the response call into Java. + FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), + response, data_array.obj()); + })); +} + +// |blink::PlatformMessageResponse| +void PlatformMessageResponseAndroid::CompleteEmpty() { + Complete(std::vector{}); +} + +} // namespace shell diff --git a/shell/platform/android/platform_message_response_android.h b/shell/platform/android/platform_message_response_android.h new file mode 100644 index 0000000000000..2ee7f3336ac6d --- /dev/null +++ b/shell/platform/android/platform_message_response_android.h @@ -0,0 +1,39 @@ +// Copyright 2018 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_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ +#define FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ + +#include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/fml/task_runner.h" +#include "flutter/lib/ui/window/platform_message_response.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { + public: + // |blink::PlatformMessageResponse| + void Complete(std::vector data) override; + + // |blink::PlatformMessageResponse| + void CompleteEmpty() override; + + private: + PlatformMessageResponseAndroid( + int response_id, + fml::jni::JavaObjectWeakGlobalRef weak_java_object, + fxl::RefPtr platform_task_runner); + + int response_id_; + fml::jni::JavaObjectWeakGlobalRef weak_java_object_; + fxl::RefPtr platform_task_runner_; + + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageResponseAndroid); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_ANDROID_PLATFORM_MESSAGE_RESPONSE_ANDROID_H_ diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 8f677045fb1f5..00d1e4b59e848 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -4,288 +4,55 @@ #include "flutter/shell/platform/android/platform_view_android.h" -#include -#include -#include -#include - +#include #include -#include "flutter/common/settings.h" -#include "flutter/common/threads.h" -#include "flutter/fml/platform/android/jni_util.h" -#include "flutter/fml/platform/android/scoped_java_ref.h" -#include "flutter/runtime/dart_service_isolate.h" -#include "flutter/shell/common/null_rasterizer.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" +#include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" #include "flutter/shell/platform/android/android_surface_gl.h" -#include "flutter/shell/platform/android/android_surface_software.h" -#include "flutter/shell/platform/android/apk_asset_provider.h" +#include "flutter/shell/platform/android/platform_message_response_android.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "flutter/shell/platform/android/vsync_waiter_android.h" -#include "lib/fxl/functional/make_copyable.h" - -#if SHELL_ENABLE_VULKAN -#include "flutter/shell/platform/android/android_surface_vulkan.h" -#endif // SHELL_ENABLE_VULKAN +#include "lib/fxl/synchronization/waitable_event.h" namespace shell { -class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseAndroid); - - public: - void Complete(std::vector data) override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask( - fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { - std::shared_ptr view = self->view_.lock(); - if (!view) - return; - static_cast(view.get()) - ->HandlePlatformMessageResponse(self->response_id_, - std::move(data)); - })); - } - - void CompleteEmpty() override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask(fxl::MakeCopyable([self]() mutable { - std::shared_ptr view = self->view_.lock(); - if (!view) - return; - static_cast(view.get()) - ->HandlePlatformMessageEmptyResponse(self->response_id_); - })); - } - - private: - PlatformMessageResponseAndroid(int response_id, - std::weak_ptr view) - : response_id_(response_id), view_(view) {} - - int response_id_; - std::weak_ptr view_; -}; - -static std::unique_ptr InitializePlatformSurfaceGL() { - const PlatformView::SurfaceConfig offscreen_config = { - .red_bits = 8, - .green_bits = 8, - .blue_bits = 8, - .alpha_bits = 8, - .depth_bits = 0, - .stencil_bits = 0, - }; - auto surface = std::make_unique(offscreen_config); - return surface->IsOffscreenContextValid() ? std::move(surface) : nullptr; -} - -static std::unique_ptr InitializePlatformSurfaceVulkan() { -#if SHELL_ENABLE_VULKAN - auto surface = std::make_unique(); - return surface->IsValid() ? std::move(surface) : nullptr; -#else // SHELL_ENABLE_VULKAN - return nullptr; -#endif // SHELL_ENABLE_VULKAN +PlatformViewAndroid::PlatformViewAndroid( + PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + fml::jni::JavaObjectWeakGlobalRef java_object, + bool use_software_rendering) + : PlatformView(delegate, std::move(task_runners)), + java_object_(java_object), + android_surface_(AndroidSurface::Create(use_software_rendering)) { + FXL_CHECK(android_surface_) + << "Could not create an OpenGL, Vulkan or Software surface to setup " + "rendering."; } -static std::unique_ptr InitializePlatformSurfaceSoftware() { - auto surface = std::make_unique(); - return surface->IsValid() ? std::move(surface) : nullptr; -} - -static std::unique_ptr InitializePlatformSurface() { - if (blink::Settings::Get().enable_software_rendering) { - if (auto surface = InitializePlatformSurfaceSoftware()) { - FXL_DLOG(INFO) << "Software surface initialized."; - return surface; - } - } - - if (auto surface = InitializePlatformSurfaceVulkan()) { - FXL_DLOG(INFO) << "Vulkan surface initialized."; - return surface; - } - - FXL_DLOG(INFO) - << "Could not initialize Vulkan surface. Falling back to OpenGL."; - - if (auto surface = InitializePlatformSurfaceGL()) { - FXL_DLOG(INFO) << "GL surface initialized."; - return surface; - } - - if (auto surface = InitializePlatformSurfaceSoftware()) { - FXL_DLOG(INFO) << "Software surface initialized."; - return surface; - } - - FXL_CHECK(false) - << "Could not initialize either the Vulkan, OpenGL, or Software" - "surface backends. Flutter requires a GPU to render."; - return nullptr; -} - -PlatformViewAndroid::PlatformViewAndroid() - : PlatformView(std::make_unique()), - android_surface_(InitializePlatformSurface()) {} - PlatformViewAndroid::~PlatformViewAndroid() = default; -void PlatformViewAndroid::Attach() { - CreateEngine(); - - // Eagerly setup the IO thread context. We have already setup the surface. - SetupResourceContextOnIOThread(); - - UpdateThreadPriorities(); +void PlatformViewAndroid::NotifyCreated( + fxl::RefPtr native_window) { + InstallFirstFrameCallback(); + android_surface_->SetNativeWindow(native_window); + PlatformView::NotifyCreated(); } -void PlatformViewAndroid::Detach() { - ReleaseSurface(); -} - -void PlatformViewAndroid::SurfaceCreated(JNIEnv* env, - jobject jsurface, - jint backgroundColor) { - // Note: This frame ensures that any local references used by - // ANativeWindow_fromSurface are released immediately. This is needed as a - // workaround for https://code.google.com/p/android/issues/detail?id=68174 - fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); - - // We have a drawing surface, so swap in a non-Null rasterizer. - SetRasterizer(std::make_unique(nullptr)); - - rasterizer_->AddNextFrameCallback([this]() { - JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - if (!view.is_null()) { - FlutterViewOnFirstFrame(env, view.obj()); - } - }); - - auto native_window = fxl::MakeRefCounted( - ANativeWindow_fromSurface(env, jsurface)); - - if (!native_window->IsValid()) { - return; - } - - if (!android_surface_->SetNativeWindow(native_window)) { - return; - } - - std::unique_ptr gpu_surface = android_surface_->CreateGPUSurface(); - - if (gpu_surface == nullptr || !gpu_surface->IsValid()) { - return; - } - - NotifyCreated(std::move(gpu_surface), [ - this, backgroundColor, native_window_size = native_window->GetSize() - ] { rasterizer().Clear(backgroundColor, native_window_size); }); -} - -void PlatformViewAndroid::SurfaceChanged(jint width, jint height) { - blink::Threads::Gpu()->PostTask([this, width, height]() { - if (android_surface_) { - android_surface_->OnScreenSurfaceResize(SkISize::Make(width, height)); - } - }); -} - -void PlatformViewAndroid::UpdateThreadPriorities() { - blink::Threads::Gpu()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); - - blink::Threads::UI()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); -} - -void PlatformViewAndroid::SurfaceDestroyed() { - ReleaseSurface(); -} - -void PlatformViewAndroid::RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, - std::string snapshot_override, - std::string entrypoint, - bool reuse_runtime_controller, - jobject assetManager) { - // TODO(jsimmons): remove snapshot_override from the public FlutterView API - FXL_CHECK(snapshot_override.empty()) << "snapshot_override is obsolete"; - - // The flutter assets directory name is the last directory of the bundle_path - // and the path into the APK - size_t last_slash_idx = bundle_path.rfind("/", bundle_path.size()); - std::string flutter_assets_dir = bundle_path.substr( - last_slash_idx + 1, bundle_path.size() - last_slash_idx); - - fxl::RefPtr asset_provider = - fxl::MakeRefCounted(env, assetManager, - flutter_assets_dir); - blink::Threads::UI()->PostTask( - [engine = engine_->GetWeakPtr(), - asset_provider = std::move(asset_provider), - bundle_path = std::move(bundle_path), entrypoint = std::move(entrypoint), - reuse_runtime_controller = reuse_runtime_controller] { - if (engine) - engine->RunBundleWithAssets( - std::move(asset_provider), std::move(bundle_path), - std::move(entrypoint), reuse_runtime_controller); - }); -} - -void PlatformViewAndroid::RunBundleAndSource(std::string bundle_path, - std::string main, - std::string packages) { - blink::Threads::UI()->PostTask([ - engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path), - main = std::move(main), packages = std::move(packages) - ] { - if (engine) - engine->RunBundleAndSource(std::move(bundle_path), std::move(main), - std::move(packages)); - }); +void PlatformViewAndroid::NotifyDestroyed() { + PlatformView::NotifyDestroyed(); + android_surface_->TeardownOnScreenContext(); } -void PlatformViewAndroid::SetAssetBundlePathOnUI(std::string bundle_path) { - blink::Threads::UI()->PostTask( - [ engine = engine_->GetWeakPtr(), bundle_path = std::move(bundle_path) ] { - if (engine) - engine->SetAssetBundlePath(std::move(bundle_path)); +void PlatformViewAndroid::NotifyChanged(const SkISize& size) { + fxl::AutoResetWaitableEvent latch; + fml::TaskRunner::RunNowOrPostTask( + task_runners_.GetGPUTaskRunner(), // + [&latch, surface = android_surface_.get(), size]() { + surface->OnScreenSurfaceResize(size); + latch.Signal(); }); -} - -void PlatformViewAndroid::SetViewportMetrics(jfloat device_pixel_ratio, - jint physical_width, - jint physical_height, - jint physical_padding_top, - jint physical_padding_right, - jint physical_padding_bottom, - jint physical_padding_left, - jint physical_view_inset_top, - jint physical_view_inset_right, - jint physical_view_inset_bottom, - jint physical_view_inset_left) { - blink::ViewportMetrics metrics; - metrics.device_pixel_ratio = device_pixel_ratio; - metrics.physical_width = physical_width; - metrics.physical_height = physical_height; - metrics.physical_padding_top = physical_padding_top; - metrics.physical_padding_right = physical_padding_right; - metrics.physical_padding_bottom = physical_padding_bottom; - metrics.physical_padding_left = physical_padding_left; - metrics.physical_view_inset_top = physical_view_inset_top; - metrics.physical_view_inset_right = physical_view_inset_right; - metrics.physical_view_inset_bottom = physical_view_inset_bottom; - metrics.physical_view_inset_left = physical_view_inset_left; - - blink::Threads::UI()->PostTask([ engine = engine_->GetWeakPtr(), metrics ] { - if (engine) - engine->SetViewportMetrics(metrics); - }); + latch.Wait(); } void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, @@ -301,7 +68,7 @@ void PlatformViewAndroid::DispatchPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, GetWeakPtr()); + response_id, java_object_, task_runners_.GetPlatformTaskRunner()); } PlatformView::DispatchPlatformMessage( @@ -315,7 +82,7 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, fxl::RefPtr response; if (response_id) { response = fxl::MakeRefCounted( - response_id, GetWeakPtr()); + response_id, java_object_, task_runners_.GetPlatformTaskRunner()); } PlatformView::DispatchPlatformMessage( @@ -323,20 +90,6 @@ void PlatformViewAndroid::DispatchEmptyPlatformMessage(JNIEnv* env, std::move(response))); } -void PlatformViewAndroid::DispatchPointerDataPacket(JNIEnv* env, - jobject buffer, - jint position) { - uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); - - blink::Threads::UI()->PostTask(fxl::MakeCopyable([ - engine = engine_->GetWeakPtr(), - packet = std::make_unique(data, position) - ] { - if (engine.get()) - engine->DispatchPointerDataPacket(*packet); - })); -} - void PlatformViewAndroid::InvokePlatformMessageResponseCallback( JNIEnv* env, jint response_id, @@ -369,10 +122,11 @@ void PlatformViewAndroid::InvokePlatformMessageEmptyResponseCallback( message_response->CompleteEmpty(); } +// |shell::PlatformView| void PlatformViewAndroid::HandlePlatformMessage( fxl::RefPtr message) { JNIEnv* env = fml::jni::AttachCurrentThread(); - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + fml::jni::ScopedJavaLocalRef view = java_object_.get(env); if (view.is_null()) return; @@ -402,35 +156,6 @@ void PlatformViewAndroid::HandlePlatformMessage( } } -void PlatformViewAndroid::HandlePlatformMessageResponse( - int response_id, - std::vector data) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - - if (view.is_null()) - return; - fml::jni::ScopedJavaLocalRef data_array( - env, env->NewByteArray(data.size())); - env->SetByteArrayRegion(data_array.obj(), 0, data.size(), - reinterpret_cast(data.data())); - - FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, - data_array.obj()); -} - -void PlatformViewAndroid::HandlePlatformMessageEmptyResponse(int response_id) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); - - if (view.is_null()) - return; - FlutterViewHandlePlatformMessageResponse(env, view.obj(), response_id, - nullptr); -} - void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, jint id, jint action, @@ -451,35 +176,14 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, id, static_cast(action), std::move(args_vector)); } -void PlatformViewAndroid::SetSemanticsEnabled(jboolean enabled) { - PlatformView::SetSemanticsEnabled(enabled); -} - -void PlatformViewAndroid::ReleaseSurface() { - NotifyDestroyed(); - android_surface_->TeardownOnScreenContext(); - SetRasterizer(std::make_unique()); -} - -VsyncWaiter* PlatformViewAndroid::GetVsyncWaiter() { - if (!vsync_waiter_) - vsync_waiter_ = std::make_unique(); - return vsync_waiter_.get(); -} - -bool PlatformViewAndroid::ResourceContextMakeCurrent() { - FXL_CHECK(android_surface_); - return android_surface_->ResourceContextMakeCurrent(); -} - -void PlatformViewAndroid::UpdateSemantics( - blink::SemanticsNodeUpdates update) { +// |shell::PlatformView| +void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { constexpr size_t kBytesPerNode = 36 * sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t); JNIEnv* env = fml::jni::AttachCurrentThread(); { - fml::jni::ScopedJavaLocalRef view = flutter_view_.get(env); + fml::jni::ScopedJavaLocalRef view = java_object_.get(env); if (view.is_null()) return; @@ -560,79 +264,6 @@ void PlatformViewAndroid::UpdateSemantics( } } -void PlatformViewAndroid::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - FXL_CHECK(env); - - { - fml::jni::ScopedJavaLocalRef local_flutter_view = - flutter_view_.get(env); - if (local_flutter_view.is_null()) { - // Collected. - return; - } - - // Grab the class of the flutter view. - jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); - FXL_CHECK(flutter_view_class); - - // Grab the runFromSource method id. - jmethodID run_from_source_method_id = env->GetMethodID( - flutter_view_class, "runFromSource", - "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"); - FXL_CHECK(run_from_source_method_id); - - // Invoke runFromSource on the Android UI thread. - jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); - FXL_CHECK(java_assets_directory); - jstring java_main = env->NewStringUTF(main.c_str()); - FXL_CHECK(java_main); - jstring java_packages = env->NewStringUTF(packages.c_str()); - FXL_CHECK(java_packages); - env->CallVoidMethod(local_flutter_view.obj(), run_from_source_method_id, - java_assets_directory, java_main, java_packages); - } - - // Detaching from the VM deletes any stray local references. - fml::jni::DetachFromVM(); -} - -void PlatformViewAndroid::SetAssetBundlePath( - const std::string& assets_directory) { - JNIEnv* env = fml::jni::AttachCurrentThread(); - FXL_CHECK(env); - - { - fml::jni::ScopedJavaLocalRef local_flutter_view = - flutter_view_.get(env); - if (local_flutter_view.is_null()) { - // Collected. - return; - } - - // Grab the class of the flutter view. - jclass flutter_view_class = env->GetObjectClass(local_flutter_view.obj()); - FXL_CHECK(flutter_view_class); - - // Grab the setAssetBundlePath method id. - jmethodID method_id = env->GetMethodID( - flutter_view_class, "setAssetBundlePathOnUI", "(Ljava/lang/String;)V"); - FXL_CHECK(method_id); - - // Invoke setAssetBundlePath on the Android UI thread. - jstring java_assets_directory = env->NewStringUTF(assets_directory.c_str()); - FXL_CHECK(java_assets_directory); - - env->CallVoidMethod(local_flutter_view.obj(), method_id, - java_assets_directory); - } - - // Detaching from the VM deletes any stray local references. - fml::jni::DetachFromVM(); -} - void PlatformViewAndroid::RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture) { @@ -640,116 +271,56 @@ void PlatformViewAndroid::RegisterExternalTexture( std::make_shared(texture_id, surface_texture)); } -void PlatformViewAndroid::MarkTextureFrameAvailable(int64_t texture_id) { - blink::Threads::Gpu()->PostTask([this, texture_id]() { - std::shared_ptr texture = - static_pointer_cast( - rasterizer_->GetTextureRegistry().GetTexture(texture_id)); - if (texture) { - texture->MarkNewFrameAvailable(); - } - }); - PlatformView::MarkTextureFrameAvailable(texture_id); +// |shell::PlatformView| +std::unique_ptr PlatformViewAndroid::CreateVSyncWaiter() { + return std::make_unique(task_runners_); } -fml::jni::ScopedJavaLocalRef PlatformViewAndroid::GetBitmap( - JNIEnv* env) { - // Render the last frame to an array of pixels on the GPU thread. - // The pixels will be returned as a global JNI reference to an int array. - fxl::AutoResetWaitableEvent latch; - jobject pixels_ref = nullptr; - SkISize frame_size; - blink::Threads::Gpu()->PostTask([this, &latch, &pixels_ref, &frame_size]() { - GetBitmapGpuTask(&pixels_ref, &frame_size); - latch.Signal(); - }); - - latch.Wait(); - - // Convert the pixel array to an Android bitmap. - if (pixels_ref == nullptr) - return fml::jni::ScopedJavaLocalRef(); - - fml::jni::ScopedJavaGlobalRef pixels(env, pixels_ref); - - jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); - FXL_CHECK(bitmap_class); - - jmethodID create_bitmap = env->GetStaticMethodID( - bitmap_class, "createBitmap", - "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); - FXL_CHECK(create_bitmap); - - jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); - FXL_CHECK(bitmap_config_class); - - jmethodID bitmap_config_value_of = env->GetStaticMethodID( - bitmap_config_class, "valueOf", - "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); - FXL_CHECK(bitmap_config_value_of); - - jstring argb = env->NewStringUTF("ARGB_8888"); - FXL_CHECK(argb); - - jobject bitmap_config = env->CallStaticObjectMethod( - bitmap_config_class, bitmap_config_value_of, argb); - FXL_CHECK(bitmap_config); +// |shell::PlatformView| +std::unique_ptr PlatformViewAndroid::CreateRenderingSurface() { + return android_surface_->CreateGPUSurface(); +} - jobject bitmap = env->CallStaticObjectMethod( - bitmap_class, create_bitmap, pixels.obj(), frame_size.width(), - frame_size.height(), bitmap_config); +// |shell::PlatformView| +sk_sp PlatformViewAndroid::CreateResourceContext() const { + sk_sp resource_context; + if (android_surface_->ResourceContextMakeCurrent()) { + // TODO(chinmaygarde): Currently, this code depends on the fact that only + // the OpenGL surface will be able to make a resource context current. If + // this changes, this assumption breaks. Handle the same. + resource_context = IOManager::CreateCompatibleResourceLoadingContext( + GrBackend::kOpenGL_GrBackend); + } else { + FXL_DLOG(ERROR) << "Could not make the resource context current."; + } - return fml::jni::ScopedJavaLocalRef(env, bitmap); + return resource_context; +} + +void PlatformViewAndroid::InstallFirstFrameCallback() { + // On Platform Task Runner. + SetNextFrameCallback( + [platform_view = GetWeakPtr(), + platform_task_runner = task_runners_.GetPlatformTaskRunner()]() { + // On GPU Task Runner. + platform_task_runner->PostTask([platform_view]() { + // Back on Platform Task Runner. + if (platform_view) { + reinterpret_cast(platform_view.get()) + ->FireFirstFrameCallback(); + } + }); + }); } -void PlatformViewAndroid::GetBitmapGpuTask(jobject* pixels_out, - SkISize* size_out) { - flow::LayerTree* layer_tree = rasterizer_->GetLastLayerTree(); - if (layer_tree == nullptr) - return; - +void PlatformViewAndroid::FireFirstFrameCallback() { JNIEnv* env = fml::jni::AttachCurrentThread(); - FXL_CHECK(env); - - const SkISize& frame_size = layer_tree->frame_size(); - jsize pixels_size = frame_size.width() * frame_size.height(); - jintArray pixels_array = env->NewIntArray(pixels_size); - FXL_CHECK(pixels_array); - - jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); - FXL_CHECK(pixels); - - SkImageInfo image_info = - SkImageInfo::Make(frame_size.width(), frame_size.height(), - kRGBA_8888_SkColorType, kPremul_SkAlphaType); - - sk_sp surface = SkSurface::MakeRasterDirect( - image_info, pixels, frame_size.width() * sizeof(jint)); - - flow::CompositorContext compositor_context(nullptr); - compositor_context.SetTextureRegistry(&texture_registry_); - SkCanvas* canvas = surface->getCanvas(); - flow::CompositorContext::ScopedFrame frame = - compositor_context.AcquireFrame(nullptr, canvas, false); - - canvas->clear(SK_ColorBLACK); - layer_tree->Raster(frame); - canvas->flush(); - - // Our configuration of Skia does not support rendering to the - // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. - // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). - for (int i = 0; i < pixels_size; i++) { - uint8_t* bytes = reinterpret_cast(pixels + i); - std::swap(bytes[0], bytes[2]); + fml::jni::ScopedJavaLocalRef view = java_object_.get(env); + if (view.is_null()) { + // The Java object died. + return; } - - env->ReleaseIntArrayElements(pixels_array, pixels, 0); - - *pixels_out = env->NewGlobalRef(pixels_array); - *size_out = frame_size; - - fml::jni::DetachFromVM(); + FlutterViewOnFirstFrame(fml::jni::AttachCurrentThread(), view.obj()); } } // namespace shell diff --git a/shell/platform/android/platform_view_android.h b/shell/platform/android/platform_view_android.h index 4779ea16ab4a7..9976c443f4248 100644 --- a/shell/platform/android/platform_view_android.h +++ b/shell/platform/android/platform_view_android.h @@ -20,45 +20,23 @@ namespace shell { -class PlatformViewAndroid : public PlatformView { +class PlatformViewAndroid final : public PlatformView { public: static bool Register(JNIEnv* env); - PlatformViewAndroid(); + PlatformViewAndroid(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + fml::jni::JavaObjectWeakGlobalRef java_object, + bool use_software_rendering); ~PlatformViewAndroid() override; - virtual void Attach() override; + void NotifyCreated(fxl::RefPtr native_window); - void Detach(); + void NotifyChanged(const SkISize& size); - void SurfaceCreated(JNIEnv* env, jobject jsurface, jint backgroundColor); - - void SurfaceChanged(jint width, jint height); - - void SurfaceDestroyed(); - - void RunBundleAndSnapshot(JNIEnv* env, std::string bundle_path, - std::string snapshot_override, - std::string entrypoint, - bool reuse_isolate, - jobject assetManager); - - void RunBundleAndSource(std::string bundle_path, - std::string main, - std::string packages); - - void SetViewportMetrics(jfloat device_pixel_ratio, - jint physical_width, - jint physical_height, - jint physical_padding_top, - jint physical_padding_right, - jint physical_padding_bottom, - jint physical_padding_left, - jint physical_view_inset_top, - jint physical_view_inset_right, - jint physical_view_inset_bottom, - jint physical_view_inset_left); + // |shell::PlatformView| + void NotifyDestroyed() override; void DispatchPlatformMessage(JNIEnv* env, std::string name, @@ -70,8 +48,6 @@ class PlatformViewAndroid : public PlatformView { std::string name, jint response_id); - void DispatchPointerDataPacket(JNIEnv* env, jobject buffer, jint position); - void InvokePlatformMessageResponseCallback(JNIEnv* env, jint response_id, jobject java_response_data, @@ -86,55 +62,37 @@ class PlatformViewAndroid : public PlatformView { jobject args, jint args_position); - void SetSemanticsEnabled(jboolean enabled); - - fml::jni::ScopedJavaLocalRef GetBitmap(JNIEnv* env); - - VsyncWaiter* GetVsyncWaiter() override; - - bool ResourceContextMakeCurrent() override; - - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - void HandlePlatformMessage( - fxl::RefPtr message) override; - - void HandlePlatformMessageResponse(int response_id, - std::vector data); - - void HandlePlatformMessageEmptyResponse(int response_id); - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - void SetAssetBundlePathOnUI(std::string bundle_path); - - void SetAssetBundlePath(const std::string& assets_directory) override; - void RegisterExternalTexture( int64_t texture_id, const fml::jni::JavaObjectWeakGlobalRef& surface_texture); - void MarkTextureFrameAvailable(int64_t texture_id) override; - - void set_flutter_view(const fml::jni::JavaObjectWeakGlobalRef& flutter_view) { - flutter_view_ = flutter_view; - } - private: - std::unique_ptr android_surface_; - fml::jni::JavaObjectWeakGlobalRef flutter_view_; + const fml::jni::JavaObjectWeakGlobalRef java_object_; + const std::unique_ptr android_surface_; // We use id 0 to mean that no response is expected. int next_response_id_ = 1; std::unordered_map> pending_responses_; - void UpdateThreadPriorities(); + // |shell::PlatformView| + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; + + // |shell::PlatformView| + std::unique_ptr CreateVSyncWaiter() override; + + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; + + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; - void ReleaseSurface(); + void InstallFirstFrameCallback(); - void GetBitmapGpuTask(jobject* pixels_out, SkISize* size_out); + void FireFirstFrameCallback(); FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid); }; diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index c819f3bfb5e41..f75f54a896850 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -4,17 +4,26 @@ #include "flutter/shell/platform/android/platform_view_android_jni.h" +#include + +#include + +#include "flutter/assets/directory_asset_bundle.h" #include "flutter/common/settings.h" +#include "flutter/fml/file.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/jni_weak_ref.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/runtime/dart_service_isolate.h" +#include "flutter/shell/common/run_configuration.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" +#include "flutter/shell/platform/android/android_shell_holder.h" +#include "flutter/shell/platform/android/apk_asset_provider.h" +#include "flutter/shell/platform/android/flutter_main.h" #include "lib/fxl/arraysize.h" -#include "lib/fxl/logging.h" -#define PLATFORM_VIEW \ - (*reinterpret_cast*>(platform_view)) +#define ANDROID_SHELL_HOLDER \ + (reinterpret_cast(shell_holder)) namespace shell { @@ -78,14 +87,12 @@ void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj) { static jmethodID g_attach_to_gl_context_method = nullptr; void SurfaceTextureAttachToGLContext(JNIEnv* env, jobject obj, jint textureId) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_attach_to_gl_context_method, textureId); FXL_CHECK(CheckException(env)); } static jmethodID g_update_tex_image_method = nullptr; void SurfaceTextureUpdateTexImage(JNIEnv* env, jobject obj) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_update_tex_image_method); FXL_CHECK(CheckException(env)); } @@ -94,14 +101,12 @@ static jmethodID g_get_transform_matrix_method = nullptr; void SurfaceTextureGetTransformMatrix(JNIEnv* env, jobject obj, jfloatArray result) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_get_transform_matrix_method, result); FXL_CHECK(CheckException(env)); } static jmethodID g_detach_from_gl_context_method = nullptr; void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { - ASSERT_IS_GPU_THREAD; env->CallVoidMethod(obj, g_detach_from_gl_context_method); FXL_CHECK(CheckException(env)); } @@ -109,22 +114,22 @@ void SurfaceTextureDetachFromGLContext(JNIEnv* env, jobject obj) { // Called By Java static jlong Attach(JNIEnv* env, jclass clazz, jobject flutterView) { - auto view = new PlatformViewAndroid(); - auto storage = new std::shared_ptr(view); - // Create a weak reference to the flutterView Java object so that we can make - // calls into it later. - view->Attach(); - view->set_flutter_view(fml::jni::JavaObjectWeakGlobalRef(env, flutterView)); - return reinterpret_cast(storage); + fml::jni::JavaObjectWeakGlobalRef java_object(env, flutterView); + auto shell_holder = std::make_unique( + FlutterMain::Get().GetSettings(), java_object); + if (shell_holder->IsValid()) { + return reinterpret_cast(shell_holder.release()); + } else { + return 0; + } } -static void Detach(JNIEnv* env, jobject jcaller, jlong platform_view) { - PLATFORM_VIEW->Detach(); +static void Detach(JNIEnv* env, jobject jcaller, jlong shell_holder) { + // Nothing to do. } -static void Destroy(JNIEnv* env, jobject jcaller, jlong platform_view) { - PLATFORM_VIEW->Detach(); - delete &PLATFORM_VIEW; +static void Destroy(JNIEnv* env, jobject jcaller, jlong shell_holder) { + delete ANDROID_SHELL_HOLDER; } static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { @@ -134,67 +139,180 @@ static jstring GetObservatoryUri(JNIEnv* env, jclass clazz) { static void SurfaceCreated(JNIEnv* env, jobject jcaller, - jlong platform_view, - jobject surface, + jlong shell_holder, + jobject jsurface, jint backgroundColor) { - return PLATFORM_VIEW->SurfaceCreated(env, surface, backgroundColor); + // Note: This frame ensures that any local references used by + // ANativeWindow_fromSurface are released immediately. This is needed as a + // workaround for https://code.google.com/p/android/issues/detail?id=68174 + fml::jni::ScopedJavaLocalFrame scoped_local_reference_frame(env); + auto window = fxl::MakeRefCounted( + ANativeWindow_fromSurface(env, jsurface)); + ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyCreated(std::move(window)); } static void SurfaceChanged(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint width, jint height) { - return PLATFORM_VIEW->SurfaceChanged(width, height); -} - -static void SurfaceDestroyed(JNIEnv* env, - jobject jcaller, - jlong platform_view) { - return PLATFORM_VIEW->SurfaceDestroyed(); -} - -static void RunBundleAndSnapshot(JNIEnv* env, - jobject jcaller, - jlong platform_view, - jstring bundlePath, - jstring snapshotOverride, - jstring entrypoint, - jboolean reuse_runtime_controller, - jobject assetManager) { - return PLATFORM_VIEW->RunBundleAndSnapshot( - env, - fml::jni::JavaStringToString(env, bundlePath), // - fml::jni::JavaStringToString(env, snapshotOverride), // - fml::jni::JavaStringToString(env, entrypoint), // - reuse_runtime_controller, // - assetManager - ); + ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyChanged( + SkISize::Make(width, height)); } -void RunBundleAndSource(JNIEnv* env, - jobject jcaller, - jlong platform_view, - jstring bundlePath, - jstring main, - jstring packages) { - return PLATFORM_VIEW->RunBundleAndSource( - fml::jni::JavaStringToString(env, bundlePath), - fml::jni::JavaStringToString(env, main), - fml::jni::JavaStringToString(env, packages)); +static void SurfaceDestroyed(JNIEnv* env, jobject jcaller, jlong shell_holder) { + ANDROID_SHELL_HOLDER->GetPlatformView()->NotifyDestroyed(); +} + +std::unique_ptr CreateIsolateConfiguration( + const blink::AssetManager& asset_manager) { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return IsolateConfiguration::CreateForPrecompiledCode(); + } + + const auto configuration_from_blob = + [&asset_manager](const std::string& snapshot_name) + -> std::unique_ptr { + std::vector blob; + if (asset_manager.GetAsBuffer(snapshot_name, &blob)) { + return IsolateConfiguration::CreateForSnapshot( + std::make_unique(std::move(blob))); + } + return nullptr; + }; + + if (auto kernel = configuration_from_blob("kernel_blob.bin")) { + return kernel; + } + + if (auto script = configuration_from_blob("snapshot_blob.bin")) { + return script; + } + + return nullptr; +} + +static void RunBundleAndSnapshot( + JNIEnv* env, + jobject jcaller, + jlong shell_holder, + jstring jbundlepath, + jstring /* snapshot override (unused) */, + jstring jEntrypoint, + jboolean /* reuse runtime controller (unused) */, + jobject jAssetManager) { + auto asset_manager = fxl::MakeRefCounted(); + + const auto bundlepath = fml::jni::JavaStringToString(env, jbundlepath); + + if (bundlepath.size() > 0) { + // If we got a bundle path, attempt to use that as a directory asset + // bundle. + asset_manager->PushBack(std::make_unique( + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true))); + + // Use the last path component of the bundle path to determine the + // directory in the APK assets. + const auto last_slash_index = bundlepath.rfind("/", bundlepath.size()); + if (last_slash_index != std::string::npos) { + auto apk_asset_dir = bundlepath.substr( + last_slash_index + 1, bundlepath.size() - last_slash_index); + + asset_manager->PushBack(std::make_unique( + env, // jni environment + jAssetManager, // asset manager + std::move(apk_asset_dir)) // apk asset dir + ); + } + } + + auto isolate_configuration = CreateIsolateConfiguration(*asset_manager); + + if (!isolate_configuration) { + FXL_DLOG(ERROR) + << "Isolate configuration could not be determined for engine launch."; + return; + } + + RunConfiguration config(std::move(isolate_configuration), + std::move(asset_manager)); + + { + auto entrypoint = fml::jni::JavaStringToString(env, jEntrypoint); + if (entrypoint.size() > 0) { + config.SetEntrypoint(std::move(entrypoint)); + } + } + + ANDROID_SHELL_HOLDER->Launch(std::move(config)); +} + +static void RunBundleAndSource(JNIEnv* env, + jobject jcaller, + jlong shell_holder, + jstring jBundlePath, + jstring main, + jstring packages) { + auto asset_manager = fxl::MakeRefCounted(); + + const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); + + if (bundlepath.size() > 0) { + auto directory = + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); + asset_manager->PushBack( + std::make_unique(std::move(directory))); + } + + auto main_file_path = fml::jni::JavaStringToString(env, main); + auto packages_file_path = fml::jni::JavaStringToString(env, packages); + + auto config = + IsolateConfiguration::CreateForSource(main_file_path, packages_file_path); + + if (!config) { + return; + } + + RunConfiguration run_configuration(std::move(config), + std::move(asset_manager)); + + ANDROID_SHELL_HOLDER->Launch(std::move(run_configuration)); } void SetAssetBundlePathOnUI(JNIEnv* env, jobject jcaller, - jlong platform_view, - jstring bundlePath) { - return PLATFORM_VIEW->SetAssetBundlePathOnUI( - fml::jni::JavaStringToString(env, bundlePath)); + jlong shell_holder, + jstring jBundlePath) { + const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); + + if (bundlepath.size() == 0) { + return; + } + + auto directory = + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); + + if (!directory.is_valid()) { + return; + } + + std::unique_ptr directory_asset_bundle = + std::make_unique(std::move(directory)); + + if (!directory_asset_bundle->IsValid()) { + return; + } + + auto asset_manager = fxl::MakeRefCounted(); + asset_manager->PushBack(std::move(directory_asset_bundle)); + + ANDROID_SHELL_HOLDER->UpdateAssetManager(std::move(asset_manager)); } static void SetViewportMetrics(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jfloat devicePixelRatio, jint physicalWidth, jint physicalHeight, @@ -206,115 +324,194 @@ static void SetViewportMetrics(JNIEnv* env, jint physicalViewInsetRight, jint physicalViewInsetBottom, jint physicalViewInsetLeft) { - return PLATFORM_VIEW->SetViewportMetrics(devicePixelRatio, // - physicalWidth, // - physicalHeight, // - physicalPaddingTop, // - physicalPaddingRight, // - physicalPaddingBottom, // - physicalPaddingLeft, // - physicalViewInsetTop, // - physicalViewInsetRight, // - physicalViewInsetBottom, // - physicalViewInsetLeft); + const blink::ViewportMetrics metrics = { + .device_pixel_ratio = devicePixelRatio, + .physical_width = physicalWidth, + .physical_height = physicalHeight, + .physical_padding_top = physicalPaddingTop, + .physical_padding_right = physicalPaddingRight, + .physical_padding_bottom = physicalPaddingBottom, + .physical_padding_left = physicalPaddingLeft, + .physical_view_inset_top = physicalViewInsetTop, + .physical_view_inset_right = physicalViewInsetRight, + .physical_view_inset_bottom = physicalViewInsetBottom, + .physical_view_inset_left = physicalViewInsetLeft, + }; + + ANDROID_SHELL_HOLDER->SetViewportMetrics(metrics); } -static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong platform_view) { - return PLATFORM_VIEW->GetBitmap(env).Release(); +static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) { + auto screenshot = ANDROID_SHELL_HOLDER->Screenshot( + Rasterizer::ScreenshotType::UncompressedImage, false); + if (screenshot.data == nullptr) { + return nullptr; + } + + const SkISize& frame_size = screenshot.frame_size; + jsize pixels_size = frame_size.width() * frame_size.height(); + jintArray pixels_array = env->NewIntArray(pixels_size); + FXL_CHECK(pixels_array); + + jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); + FXL_CHECK(pixels); + + auto pixels_src = static_cast(screenshot.data->data()); + + // Our configuration of Skia does not support rendering to the + // BitmapConfig.ARGB_8888 format expected by android.graphics.Bitmap. + // Convert from kRGBA_8888 to kBGRA_8888 (equivalent to ARGB_8888). + for (int i = 0; i < pixels_size; i++) { + int32_t src_pixel = pixels_src[i]; + uint8_t* src_bytes = reinterpret_cast(&src_pixel); + std::swap(src_bytes[0], src_bytes[2]); + pixels[i] = src_pixel; + } + + env->ReleaseIntArrayElements(pixels_array, pixels, 0); + + jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); + FXL_CHECK(bitmap_class); + + jmethodID create_bitmap = env->GetStaticMethodID( + bitmap_class, "createBitmap", + "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); + FXL_CHECK(create_bitmap); + + jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); + FXL_CHECK(bitmap_config_class); + + jmethodID bitmap_config_value_of = env->GetStaticMethodID( + bitmap_config_class, "valueOf", + "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); + FXL_CHECK(bitmap_config_value_of); + + jstring argb = env->NewStringUTF("ARGB_8888"); + FXL_CHECK(argb); + + jobject bitmap_config = env->CallStaticObjectMethod( + bitmap_config_class, bitmap_config_value_of, argb); + FXL_CHECK(bitmap_config); + + return env->CallStaticObjectMethod(bitmap_class, create_bitmap, pixels_array, + frame_size.width(), frame_size.height(), + bitmap_config); } static void DispatchPlatformMessage(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jstring channel, jobject message, jint position, jint responseId) { - return PLATFORM_VIEW->DispatchPlatformMessage( - env, fml::jni::JavaStringToString(env, channel), message, position, - responseId); + ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchPlatformMessage( + env, // + fml::jni::JavaStringToString(env, channel), // + message, // + position, // + responseId // + ); } static void DispatchEmptyPlatformMessage(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jstring channel, jint responseId) { - return PLATFORM_VIEW->DispatchEmptyPlatformMessage( - env, fml::jni::JavaStringToString(env, channel), responseId); + ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchEmptyPlatformMessage( + env, // + fml::jni::JavaStringToString(env, channel), // + responseId // + ); } static void DispatchPointerDataPacket(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jobject buffer, jint position) { - return PLATFORM_VIEW->DispatchPointerDataPacket(env, buffer, position); + uint8_t* data = static_cast(env->GetDirectBufferAddress(buffer)); + auto packet = std::make_unique(data, position); + ANDROID_SHELL_HOLDER->DispatchPointerDataPacket(std::move(packet)); } static void DispatchSemanticsAction(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint id, jint action, jobject args, jint args_position) { - return PLATFORM_VIEW->DispatchSemanticsAction(env, id, action, args, - args_position); + ANDROID_SHELL_HOLDER->GetPlatformView()->DispatchSemanticsAction( + env, // + id, // + action, // + args, // + args_position // + ); } static void SetSemanticsEnabled(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jboolean enabled) { - return PLATFORM_VIEW->SetSemanticsEnabled(enabled); + ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled); } static jboolean GetIsSoftwareRendering(JNIEnv* env, jobject jcaller) { - return blink::Settings::Get().enable_software_rendering; + return FlutterMain::Get().GetSettings().enable_software_rendering; } static void RegisterTexture(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jlong texture_id, jobject surface_texture) { - PLATFORM_VIEW->RegisterExternalTexture( - static_cast(texture_id), - fml::jni::JavaObjectWeakGlobalRef(env, surface_texture)); + ANDROID_SHELL_HOLDER->GetPlatformView()->RegisterExternalTexture( + static_cast(texture_id), // + fml::jni::JavaObjectWeakGlobalRef(env, surface_texture) // + ); } static void MarkTextureFrameAvailable(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jlong texture_id) { - return PLATFORM_VIEW->MarkTextureFrameAvailable( + ANDROID_SHELL_HOLDER->GetPlatformView()->MarkTextureFrameAvailable( static_cast(texture_id)); } static void UnregisterTexture(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jlong texture_id) { - PLATFORM_VIEW->UnregisterTexture(static_cast(texture_id)); + ANDROID_SHELL_HOLDER->GetPlatformView()->UnregisterTexture( + static_cast(texture_id)); } static void InvokePlatformMessageResponseCallback(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint responseId, jobject message, jint position) { - return PLATFORM_VIEW->InvokePlatformMessageResponseCallback( - env, responseId, message, position); + ANDROID_SHELL_HOLDER->GetPlatformView() + ->InvokePlatformMessageResponseCallback(env, // + responseId, // + message, // + position // + ); } static void InvokePlatformMessageEmptyResponseCallback(JNIEnv* env, jobject jcaller, - jlong platform_view, + jlong shell_holder, jint responseId) { - return PLATFORM_VIEW->InvokePlatformMessageEmptyResponseCallback(env, - responseId); + ANDROID_SHELL_HOLDER->GetPlatformView() + ->InvokePlatformMessageEmptyResponseCallback(env, // + responseId // + ); } bool PlatformViewAndroid::Register(JNIEnv* env) { @@ -353,8 +550,8 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { }, { .name = "nativeRunBundleAndSnapshot", - .signature = - "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLandroid/content/res/AssetManager;)V", + .signature = "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/" + "String;ZLandroid/content/res/AssetManager;)V", .fnPtr = reinterpret_cast(&shell::RunBundleAndSnapshot), }, { @@ -373,11 +570,6 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { .signature = "(J)V", .fnPtr = reinterpret_cast(&shell::Detach), }, - { - .name = "nativeDestroy", - .signature = "(J)V", - .fnPtr = reinterpret_cast(&shell::Destroy), - }, { .name = "nativeGetObservatoryUri", .signature = "()Ljava/lang/String;", diff --git a/shell/platform/android/vsync_waiter_android.cc b/shell/platform/android/vsync_waiter_android.cc index 29e1958dcc011..052de023b9a12 100644 --- a/shell/platform/android/vsync_waiter_android.cc +++ b/shell/platform/android/vsync_waiter_android.cc @@ -7,7 +7,7 @@ #include #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/fml/platform/android/jni_util.h" #include "flutter/fml/platform/android/scoped_java_ref.h" #include "flutter/fml/trace_event.h" @@ -16,68 +16,49 @@ namespace shell { +static jlong CreatePendingCallback(VsyncWaiter::Callback callback); + +static void ConsumePendingCallback(jlong java_baton, + fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time); + static fml::jni::ScopedJavaGlobalRef* g_vsync_waiter_class = nullptr; static jmethodID g_async_wait_for_vsync_method_ = nullptr; -VsyncWaiterAndroid::VsyncWaiterAndroid() : weak_factory_(this) {} +VsyncWaiterAndroid::VsyncWaiterAndroid(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)) {} VsyncWaiterAndroid::~VsyncWaiterAndroid() = default; -void VsyncWaiterAndroid::AsyncWaitForVsync(Callback callback) { - FXL_DCHECK(!callback_); - callback_ = std::move(callback); - fml::WeakPtr* weak = - new fml::WeakPtr(); - *weak = weak_factory_.GetWeakPtr(); +// |shell::VsyncWaiter| +void VsyncWaiterAndroid::AwaitVSync() { + auto java_baton = + CreatePendingCallback(std::bind(&VsyncWaiterAndroid::FireCallback, // + this, // + std::placeholders::_1, // + std::placeholders::_2 // + )); - blink::Threads::Platform()->PostTask([weak] { + task_runners_.GetPlatformTaskRunner()->PostTask([java_baton]() { JNIEnv* env = fml::jni::AttachCurrentThread(); - env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), - g_async_wait_for_vsync_method_, - reinterpret_cast(weak)); + env->CallStaticVoidMethod(g_vsync_waiter_class->obj(), // + g_async_wait_for_vsync_method_, // + java_baton // + ); }); } -void VsyncWaiterAndroid::OnVsync(int64_t frameTimeNanos, - int64_t frameTargetTimeNanos) { - Callback callback = std::move(callback_); - callback_ = Callback(); - blink::Threads::UI()->PostTask( - [callback, frameTimeNanos, frameTargetTimeNanos] { - callback(fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTimeNanos)), - fxl::TimePoint::FromEpochDelta( - fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos))); - }); -} - static void OnNativeVsync(JNIEnv* env, jclass jcaller, jlong frameTimeNanos, jlong frameTargetTimeNanos, - jlong cookie) { - // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight - // Vsync" checkbox in the timeline can be enabled. - // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 - // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); -#else - { - constexpr size_t num_chars = sizeof(jlong) * CHAR_BIT * 3.4 + 2; - char deadline[num_chars]; - sprintf(deadline, "%lld", frameTargetTimeNanos / 1000); // microseconds - TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); - } -#endif - fml::WeakPtr* weak = - reinterpret_cast*>(cookie); - VsyncWaiterAndroid* waiter = weak->get(); - delete weak; - if (waiter) { - waiter->OnVsync(static_cast(frameTimeNanos), - static_cast(frameTargetTimeNanos)); - } + jlong java_baton) { + auto frame_time = fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTimeNanos)); + auto target_time = fxl::TimePoint::FromEpochDelta( + fxl::TimeDelta::FromNanoseconds(frameTargetTimeNanos)); + + ConsumePendingCallback(java_baton, frame_time, target_time); } bool VsyncWaiterAndroid::Register(JNIEnv* env) { @@ -105,4 +86,27 @@ bool VsyncWaiterAndroid::Register(JNIEnv* env) { return env->RegisterNatives(clazz, methods, arraysize(methods)) == 0; } +struct PendingCallbackData { + VsyncWaiter::Callback callback; + + PendingCallbackData(VsyncWaiter::Callback p_callback) + : callback(std::move(p_callback)) { + FXL_DCHECK(callback); + } +}; + +static jlong CreatePendingCallback(VsyncWaiter::Callback callback) { + // This delete for this new is balanced in the consume call. + auto data = new PendingCallbackData(std::move(callback)); + return reinterpret_cast(data); +} + +static void ConsumePendingCallback(jlong java_baton, + fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time) { + auto data = reinterpret_cast(java_baton); + data->callback(frame_start_time, frame_target_time); + delete data; +} + } // namespace shell diff --git a/shell/platform/android/vsync_waiter_android.h b/shell/platform/android/vsync_waiter_android.h index c73af4bfca6f0..fd72a0a21f563 100644 --- a/shell/platform/android/vsync_waiter_android.h +++ b/shell/platform/android/vsync_waiter_android.h @@ -12,22 +12,17 @@ namespace shell { -class VsyncWaiterAndroid : public VsyncWaiter { +class VsyncWaiterAndroid final : public VsyncWaiter { public: - VsyncWaiterAndroid(); - - ~VsyncWaiterAndroid() override; - static bool Register(JNIEnv* env); - void AsyncWaitForVsync(Callback callback) override; + VsyncWaiterAndroid(blink::TaskRunners task_runners); - void OnVsync(int64_t frameTimeNanos, int64_t frameTargetTimeNanos); + ~VsyncWaiterAndroid() override; private: - Callback callback_; - fml::WeakPtr self_; - fml::WeakPtrFactory weak_factory_; + // |shell::VsyncWaiter| + void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterAndroid); }; diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index c971c443bcc30..c6f7acd6be76a 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -6,11 +6,8 @@ assert(is_mac || is_ios) group("darwin") { if (is_mac) { - deps = [ - "desktop:shell_standalone", - ] if (!is_fuchsia_host) { - deps += [ + deps = [ "desktop:shell_application_bundle", ] } @@ -45,15 +42,12 @@ source_set("flutter_channels") { "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", - "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", "//third_party/skia", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } executable("flutter_channels_unittests") { @@ -68,7 +62,7 @@ executable("flutter_channels_unittests") { deps = [ ":flutter_channels", - "//third_party/dart/runtime:libdart_jit", "$flutter_root/testing", + "//third_party/dart/runtime:libdart_jit", ] } diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index e6fa86366b080..a1023737973a7 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -9,28 +9,23 @@ source_set("common") { sources = [ "buffer_conversions.h", "buffer_conversions.mm", - "platform_mac.h", - "platform_mac.mm", - "process_info_mac.cc", - "process_info_mac.h", + "command_line.h", + "command_line.mm", ] set_sources_assignment_filter(sources_assignment_filter) deps = [ - "//third_party/dart/runtime:dart_api", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", - "$flutter_root/shell/testing", "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:dart_api", "//third_party/skia", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] } diff --git a/shell/platform/darwin/common/command_line.h b/shell/platform/darwin/common/command_line.h new file mode 100644 index 0000000000000..dfc995b90f378 --- /dev/null +++ b/shell/platform/darwin/common/command_line.h @@ -0,0 +1,17 @@ +// Copyright 2017 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_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ + +#include "lib/fxl/command_line.h" +#include "lib/fxl/macros.h" + +namespace shell { + +fxl::CommandLine CommandLineFromNSProcessInfo(); + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_COMMAND_LINE_H_ diff --git a/shell/platform/darwin/common/command_line.mm b/shell/platform/darwin/common/command_line.mm new file mode 100644 index 0000000000000..bf8d4cc9d40f4 --- /dev/null +++ b/shell/platform/darwin/common/command_line.mm @@ -0,0 +1,21 @@ +// Copyright 2017 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/shell/platform/darwin/common/command_line.h" + +#import + +namespace shell { + +fxl::CommandLine CommandLineFromNSProcessInfo() { + std::vector args_vector; + + for (NSString* arg in [NSProcessInfo processInfo].arguments) { + args_vector.emplace_back(arg.UTF8String); + } + + return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); +} + +} // namespace shell diff --git a/shell/platform/darwin/common/platform_mac.h b/shell/platform/darwin/common/platform_mac.h deleted file mode 100644 index 1989b25f11c43..0000000000000 --- a/shell/platform/darwin/common/platform_mac.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ -#define SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ - -#include "flutter/shell/common/engine.h" - -namespace shell { - -void PlatformMacMain(std::string icu_data_path, - std::string application_library_path, - std::string bundle_path); - -bool AttemptLaunchFromCommandLineSwitches(Engine* engine); - -} // namespace shell - -#endif // SHELL_PLATFORM_MAC_PLATFORM_MAC_H_ diff --git a/shell/platform/darwin/common/platform_mac.mm b/shell/platform/darwin/common/platform_mac.mm deleted file mode 100644 index 5af35a430beef..0000000000000 --- a/shell/platform/darwin/common/platform_mac.mm +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/platform/darwin/common/platform_mac.h" - -#include - -#include "flutter/common/threads.h" -#include "flutter/fml/trace_event.h" -#include "flutter/runtime/start_up.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/common/tracing_controller.h" -#include "flutter/sky/engine/wtf/MakeUnique.h" -#include "lib/fxl/command_line.h" -#include "lib/fxl/strings/string_view.h" -#include "third_party/dart/runtime/include/dart_tools_api.h" - -namespace shell { - -static fxl::CommandLine InitializedCommandLine() { - std::vector args_vector; - - for (NSString* arg in [NSProcessInfo processInfo].arguments) { - args_vector.emplace_back(arg.UTF8String); - } - - return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); -} - -class EmbedderState { - public: - EmbedderState(std::string icu_data_path, - std::string application_library_path, - std::string bundle_path) { - blink::engine_main_enter_ts = Dart_TimelineGetMicros(); - FXL_DCHECK([NSThread isMainThread]) - << "Embedder initialization must occur on the main platform thread"; - - auto command_line = InitializedCommandLine(); - - // This is about as early as tracing of any kind can start. Add an instant - // marker that can be used as a reference for startup. - TRACE_EVENT_INSTANT0("flutter", "main"); - - shell::Shell::InitStandalone(std::move(command_line), icu_data_path, application_library_path, - bundle_path); - } - - ~EmbedderState() {} - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderState); -}; - -void PlatformMacMain(std::string icu_data_path, - std::string application_library_path, - std::string bundle_path) { - static std::unique_ptr g_embedder; - static std::once_flag once_main; - - std::call_once(once_main, [&]() { - g_embedder = - WTF::MakeUnique(icu_data_path, application_library_path, bundle_path); - }); -} - -static bool FlagsValidForCommandLineLaunch(const std::string& bundle_path, - const std::string& main, - const std::string& packages) { - if (main.empty() || packages.empty() || bundle_path.empty()) { - return false; - } - - // Ensure that the paths exists. This catches cases where the user has - // successfully launched the application from the tooling but has since moved - // the source files on disk and is launching again directly. - - NSFileManager* manager = [NSFileManager defaultManager]; - - if (![manager fileExistsAtPath:@(main.c_str())]) { - return false; - } - - if (![manager fileExistsAtPath:@(packages.c_str())]) { - return false; - } - - if (![manager fileExistsAtPath:@(bundle_path.c_str())]) { - return false; - } - - return true; -} - -static std::string ResolveCommandLineLaunchFlag(const fxl::StringView name) { - const auto& command_line = shell::Shell::Shared().GetCommandLine(); - - std::string command_line_option; - if (command_line.GetOptionValue(name, &command_line_option)) { - return command_line_option; - } - - const char* saved_default = - [[NSUserDefaults standardUserDefaults] stringForKey:@(name.data())].UTF8String; - - if (saved_default != NULL) { - return saved_default; - } - - return ""; -} - -bool AttemptLaunchFromCommandLineSwitches(Engine* engine) { - NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - - const auto& command_line = shell::Shell::Shared().GetCommandLine(); - - if (command_line.HasOption(FlagForSwitch(Switch::FlutterAssetsDir)) || - command_line.HasOption(FlagForSwitch(Switch::MainDartFile)) || - command_line.HasOption(FlagForSwitch(Switch::Packages))) { - // The main dart file, Flutter assets directory and the package root must be - // specified in one go. We dont want to end up in a situation where we take - // one value from the command line and the others from user defaults. In - // case, any new flags are specified, forget about all the old ones. - [defaults removeObjectForKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; - [defaults removeObjectForKey:@(FlagForSwitch(Switch::MainDartFile).data())]; - [defaults removeObjectForKey:@(FlagForSwitch(Switch::Packages).data())]; - - [defaults synchronize]; - } - - std::string bundle_path = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::FlutterAssetsDir)); - std::string main = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::MainDartFile)); - std::string packages = ResolveCommandLineLaunchFlag(FlagForSwitch(Switch::Packages)); - - if (!FlagsValidForCommandLineLaunch(bundle_path, main, packages)) { - return false; - } - - // Save the newly resolved dart main file and the package root to user - // defaults so that the next time the user launches the application in the - // simulator without the tooling, the application boots up. - [defaults setObject:@(bundle_path.c_str()) - forKey:@(FlagForSwitch(Switch::FlutterAssetsDir).data())]; - [defaults setObject:@(main.c_str()) forKey:@(FlagForSwitch(Switch::MainDartFile).data())]; - [defaults setObject:@(packages.c_str()) forKey:@(FlagForSwitch(Switch::Packages).data())]; - - [defaults synchronize]; - - blink::Threads::UI()->PostTask([ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { - if (engine) - engine->RunBundleAndSource(bundle_path, main, packages); - }); - - return true; -} - -} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.cc b/shell/platform/darwin/common/process_info_mac.cc deleted file mode 100644 index 11f70f305a3e9..0000000000000 --- a/shell/platform/darwin/common/process_info_mac.cc +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/platform/darwin/common/process_info_mac.h" - -namespace shell { - -ProcessInfoMac::ProcessInfoMac() = default; - -ProcessInfoMac::~ProcessInfoMac() = default; - -bool ProcessInfoMac::SampleNow() { - mach_msg_type_number_t size = MACH_TASK_BASIC_INFO_COUNT; - kern_return_t result = - task_info(mach_task_self(), // - MACH_TASK_BASIC_INFO, // - reinterpret_cast(&last_sample_), // - &size); - if (result == KERN_SUCCESS) { - return true; - } - - last_sample_ = {}; - return false; -} - -size_t ProcessInfoMac::GetVirtualMemorySize() { - return last_sample_.virtual_size; -} - -size_t ProcessInfoMac::GetResidentMemorySize() { - return last_sample_.resident_size; -} - -} // namespace shell diff --git a/shell/platform/darwin/common/process_info_mac.h b/shell/platform/darwin/common/process_info_mac.h deleted file mode 100644 index 7edc8034173e0..0000000000000 --- a/shell/platform/darwin/common/process_info_mac.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ - -#include -#include -#include -#include "flutter/flow/process_info.h" -#include "lib/fxl/macros.h" - -namespace shell { - -class ProcessInfoMac : public flow::ProcessInfo { - public: - ProcessInfoMac(); - - ~ProcessInfoMac(); - - bool SampleNow() override; - - size_t GetVirtualMemorySize() override; - - size_t GetResidentMemorySize() override; - - private: - struct mach_task_basic_info last_sample_; - - FXL_DISALLOW_COPY_AND_ASSIGN(ProcessInfoMac); -}; - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_PROCESS_INFO_MAC_H_ diff --git a/shell/platform/darwin/desktop/BUILD.gn b/shell/platform/darwin/desktop/BUILD.gn index a9c05f85ef284..5ec3298be4aa4 100644 --- a/shell/platform/darwin/desktop/BUILD.gn +++ b/shell/platform/darwin/desktop/BUILD.gn @@ -8,10 +8,8 @@ source_set("mac_desktop_platform") { visibility = [ ":*" ] sources = [ - "flutter_app_delegate.h", - "flutter_app_delegate.m", - "flutter_application.h", - "flutter_application.mm", + "flutter_application_delegate.h", + "flutter_application_delegate.mm", "flutter_window.h", "flutter_window.mm", "main_mac.mm", @@ -22,32 +20,22 @@ source_set("mac_desktop_platform") { ] deps = [ - "//third_party/dart/runtime:libdart_jit", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", - "$flutter_root/shell/testing", "$flutter_root/synchronization", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", "//third_party/skia", + "//third_party/skia:gpu", ] - public_configs = [ - "$flutter_root:config", - ] -} - -executable("shell_standalone") { - output_name = "flutter_tester" - deps = [ - ":mac_desktop_platform", - ] + public_configs = [ "$flutter_root:config" ] } if (!is_fuchsia_host) { - import("//build/config/mac/rules.gni") resource_copy_mac("mac_desktop_resources") { diff --git a/shell/platform/darwin/desktop/Info.plist b/shell/platform/darwin/desktop/Info.plist index 31d3f1240db6b..048afb6dadca2 100644 --- a/shell/platform/darwin/desktop/Info.plist +++ b/shell/platform/darwin/desktop/Info.plist @@ -9,11 +9,11 @@ CFBundleIconFile CFBundleIdentifier - io.flutter + io.flutter.engine CFBundleInfoDictionaryVersion 6.0 CFBundleName - Flutter + Flutter Engine CFBundlePackageType APPL CFBundleShortVersionString @@ -26,9 +26,7 @@ 10.6 NSHumanReadableCopyright Copyright 2015 The Flutter Authors. All rights reserved. - NSMainNibFile - flutter_mac NSPrincipalClass - FlutterApplication + NSApplication diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.h b/shell/platform/darwin/desktop/flutter_app_delegate.h deleted file mode 100644 index d6addcb17d0a4..0000000000000 --- a/shell/platform/darwin/desktop/flutter_app_delegate.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 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. - -#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ -#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__ - -#import - -@interface FlutterAppDelegate : NSObject - -@end - -#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APP_DELEGATE__) */ diff --git a/shell/platform/darwin/desktop/flutter_app_delegate.m b/shell/platform/darwin/desktop/flutter_app_delegate.m deleted file mode 100644 index 7e2dfd68389f8..0000000000000 --- a/shell/platform/darwin/desktop/flutter_app_delegate.m +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2015 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 "flutter_app_delegate.h" - -@interface FlutterAppDelegate () - -@property(assign) IBOutlet NSWindow* window; - -@end - -@implementation FlutterAppDelegate - -@end diff --git a/shell/platform/darwin/desktop/flutter_application.mm b/shell/platform/darwin/desktop/flutter_application.mm deleted file mode 100644 index 57b1c83ba069a..0000000000000 --- a/shell/platform/darwin/desktop/flutter_application.mm +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/platform/darwin/desktop/flutter_application.h" - -@implementation FlutterApplication -@end diff --git a/shell/platform/darwin/desktop/flutter_application.h b/shell/platform/darwin/desktop/flutter_application_delegate.h similarity index 65% rename from shell/platform/darwin/desktop/flutter_application.h rename to shell/platform/darwin/desktop/flutter_application_delegate.h index 6a4167b5f273a..3995557b25e79 100644 --- a/shell/platform/darwin/desktop/flutter_application.h +++ b/shell/platform/darwin/desktop/flutter_application_delegate.h @@ -1,13 +1,14 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. +// Copyright 2017 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_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ +#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ #import -@interface FlutterApplication : NSApplication +@interface FlutterApplicationDelegate : NSObject + @end -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_H_ +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_APPLICATION_DELEGATE_H_ diff --git a/shell/platform/darwin/desktop/flutter_application_delegate.mm b/shell/platform/darwin/desktop/flutter_application_delegate.mm new file mode 100644 index 0000000000000..03076b848b25f --- /dev/null +++ b/shell/platform/darwin/desktop/flutter_application_delegate.mm @@ -0,0 +1,80 @@ +// Copyright 2017 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/shell/platform/darwin/desktop/flutter_application_delegate.h" +#include "flutter/shell/platform/darwin/desktop/flutter_window.h" + +#include + +@implementation FlutterApplicationDelegate + +- (void)applicationWillFinishLaunching:(NSNotification*)notification { + [self configureMainMenuBar]; + [self onNewFlutterWindow:self]; +} + +- (void)configureMainMenuBar { + NSMenu* mainMenu = [[[NSMenu alloc] initWithTitle:@"MainMenu"] autorelease]; + + NSMenuItem* engineItem = + [[[NSMenuItem alloc] initWithTitle:@"Engine" action:NULL keyEquivalent:@""] autorelease]; + + NSMenu* engineMenu = [[[NSMenu alloc] initWithTitle:@"EngineMenu"] autorelease]; + + NSMenuItem* newEngineItem = [[[NSMenuItem alloc] initWithTitle:@"New Engine" + action:@selector(onNewFlutterWindow:) + keyEquivalent:@""] autorelease]; + newEngineItem.keyEquivalent = @"n"; + newEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; + + NSMenuItem* shutdownEngineItem = + [[[NSMenuItem alloc] initWithTitle:@"Shutdown Engine" + action:@selector(onShutdownFlutterWindow:) + keyEquivalent:@""] autorelease]; + shutdownEngineItem.keyEquivalent = @"w"; + shutdownEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; + + NSMenuItem* quitItem = [[[NSMenuItem alloc] initWithTitle:@"Quit" + action:@selector(onQuitFlutterApplication:) + keyEquivalent:@""] autorelease]; + quitItem.keyEquivalent = @"q"; + quitItem.keyEquivalentModifierMask = NSCommandKeyMask; + + [mainMenu addItem:engineItem]; + [engineItem setSubmenu:engineMenu]; + [engineMenu addItem:newEngineItem]; + [engineMenu addItem:shutdownEngineItem]; + [engineMenu addItem:quitItem]; + + [NSApplication sharedApplication].mainMenu = mainMenu; +} + +- (void)onNewFlutterWindow:(id)sender { + FlutterWindow* window = [[FlutterWindow alloc] init]; + [window setReleasedWhenClosed:YES]; + + NSWindow* currentKeyWindow = [NSApplication sharedApplication].keyWindow; + + if (currentKeyWindow == nil) { + [window center]; + } else { + [window center]; + NSPoint currentWindowFrameOrigin = window.frame.origin; + currentWindowFrameOrigin.x = currentKeyWindow.frame.origin.x + 20; + currentWindowFrameOrigin.y = currentKeyWindow.frame.origin.y - 20; + [window setFrameOrigin:currentWindowFrameOrigin]; + } + + [window makeKeyAndOrderFront:sender]; +} + +- (void)onShutdownFlutterWindow:(id)sender { + [[NSApplication sharedApplication].keyWindow close]; +} + +- (void)onQuitFlutterApplication:(id)sender { + exit(0); +} + +@end diff --git a/shell/platform/darwin/desktop/flutter_mac.xib b/shell/platform/darwin/desktop/flutter_mac.xib deleted file mode 100644 index c02ab7912da5a..0000000000000 --- a/shell/platform/darwin/desktop/flutter_mac.xib +++ /dev/null @@ -1,695 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/shell/platform/darwin/desktop/flutter_window.h b/shell/platform/darwin/desktop/flutter_window.h index 851535ba38e9e..e07fe4eeb7520 100644 --- a/shell/platform/darwin/desktop/flutter_window.h +++ b/shell/platform/darwin/desktop/flutter_window.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ -#define __SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__ +#ifndef SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ +#define SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ #import @@ -11,4 +11,4 @@ @end -#endif /* defined(__SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW__) */ +#endif // SHELL_PLATFORM_DARWIN_DESKTOP_FLUTTER_WINDOW_H_ diff --git a/shell/platform/darwin/desktop/flutter_window.mm b/shell/platform/darwin/desktop/flutter_window.mm index ca080e9275742..4c87200fb3856 100644 --- a/shell/platform/darwin/desktop/flutter_window.mm +++ b/shell/platform/darwin/desktop/flutter_window.mm @@ -2,16 +2,25 @@ // 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 + #import "flutter_window.h" -#include "flutter/common/threads.h" +#include + +#include "flutter/common/task_runners.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/thread_host.h" #include "flutter/shell/gpu/gpu_surface_gl.h" +#include "flutter/shell/platform/darwin/common/command_line.h" #include "flutter/shell/platform/darwin/desktop/platform_view_mac.h" +#include "lib/fxl/functional/make_copyable.h" -@interface FlutterWindow () +@interface FlutterWindow () -@property(assign) IBOutlet NSOpenGLView* renderSurface; -@property(getter=isSurfaceSetup) BOOL surfaceSetup; +@property(strong) NSOpenGLView* renderSurface; @end @@ -37,34 +46,130 @@ @interface FlutterWindow () } @implementation FlutterWindow { - std::shared_ptr _platformView; + shell::ThreadHost _thread_host; + std::unique_ptr _shell; bool _mouseIsDown; } -@synthesize renderSurface = _renderSurface; -@synthesize surfaceSetup = _surfaceSetup; +- (instancetype)init { + self = + [super initWithContentRect:NSMakeRect(10.0, 10.0, 800.0, 600.0) + styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask + backing:NSBackingStoreBuffered + defer:YES]; + if (self) { + self.delegate = self; + [self setupRenderSurface]; + [self setupShell]; + [self updateWindowSize]; + } + + return self; +} + +- (void)setupRenderSurface { + NSOpenGLView* renderSurface = [[[NSOpenGLView alloc] init] autorelease]; + const NSOpenGLPixelFormatAttribute attrs[] = { + NSOpenGLPFADoubleBuffer, // + NSOpenGLPFAAllowOfflineRenderers, // + 0 // + }; + renderSurface.pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attrs] autorelease]; + renderSurface.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + renderSurface.frame = + NSMakeRect(0.0, 0.0, self.contentView.bounds.size.width, self.contentView.bounds.size.height); + [self.contentView addSubview:renderSurface]; + self.renderSurface = renderSurface; +} -- (void)awakeFromNib { - [super awakeFromNib]; +static std::string CreateThreadLabel() { + std::stringstream stream; + static int index = 1; + stream << "io.flutter." << index++; + return stream.str(); +} - self.delegate = self; +- (void)setupShell { + FXL_DCHECK(!_shell) << "The shell must not already be set."; - [self updateWindowSize]; + auto thread_label = CreateThreadLabel(); + + // Create the threads on which to run the shell. + _thread_host = {thread_label, shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::UI | + shell::ThreadHost::Type::IO}; + + // Grab the task runners for the newly created threads. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::TaskRunners task_runners(thread_label, // label + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + _thread_host.gpu_thread->GetTaskRunner(), // GPU + _thread_host.ui_thread->GetTaskRunner(), // UI + _thread_host.io_thread->GetTaskRunner() // IO + ); + + // Figure out the settings from the command line arguments. + auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); + + if (settings.icu_data_path.size() == 0) { + settings.icu_data_path = + [[NSBundle mainBundle] pathForResource:@"icudtl.dat" ofType:@""].UTF8String; + } + + settings.using_blink = false; + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + // Setup the callback that will be run on the appropriate threads. + shell::Shell::CreateCallback on_create_platform_view = + [render_surface = self.renderSurface](shell::Shell& shell) { + return std::make_unique(shell, render_surface); + }; + + shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // Finally, create the shell. + _shell = shell::Shell::Create(std::move(task_runners), settings, on_create_platform_view, + on_create_rasterizer); + + // Launch the engine with the inferred run configuration. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = _shell->GetEngine(), + config = shell::RunConfiguration::InferFromSettings(_shell->GetSettings())]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch the engine with configuration."; + } + } + })); + + [self notifySurfaceCreated]; } -- (void)setupPlatformView { - FXL_DCHECK(_platformView == nullptr) << "The platform view must not already be set."; +- (void)notifySurfaceCreated { + if (!_shell || !_shell->IsSetup()) { + return; + } - _platformView = std::make_shared(self.renderSurface); - _platformView->Attach(); - _platformView->SetupResourceContextOnIOThread(); - _platformView->NotifyCreated(std::make_unique(_platformView.get())); + // Tell the platform view that it has a GL surface. + _shell->GetPlatformView()->NotifyCreated(); } -// TODO(eseidel): This does not belong in flutter_window! -// Probably belongs in NSApplicationDelegate didFinishLaunching. -- (void)setupAndLoadDart { - _platformView->SetupAndLoadDart(); +- (void)notifySurfaceDestroyed { + if (!_shell || !_shell->IsSetup()) { + return; + } + + // Tell the platform view that its surface is about to be lost. + _shell->GetPlatformView()->NotifyDestroyed(); } - (void)windowDidResize:(NSNotification*)notification { @@ -72,34 +177,28 @@ - (void)windowDidResize:(NSNotification*)notification { } - (void)updateWindowSize { - [self setupSurfaceIfNecessary]; + if (!_shell) { + return; + } blink::ViewportMetrics metrics; auto size = self.renderSurface.frame.size; metrics.physical_width = size.width; metrics.physical_height = size.height; - - blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), metrics ] { - if (engine.get()) { + _shell->GetTaskRunners().GetUITaskRunner()->PostTask([engine = _shell->GetEngine(), metrics]() { + if (engine) { engine->SetViewportMetrics(metrics); } }); } -- (void)setupSurfaceIfNecessary { - if (self.isSurfaceSetup) { - return; - } - - self.surfaceSetup = YES; - - [self setupPlatformView]; - [self setupAndLoadDart]; -} - #pragma mark - Responder overrides - (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { + if (!_shell) { + return; + } + NSPoint location = [_renderSurface convertPoint:event.locationInWindow fromView:nil]; location.y = _renderSurface.frame.size.height - location.y; @@ -134,13 +233,14 @@ - (void)dispatchEvent:(NSEvent*)event phase:(NSEventPhase)phase { break; } - blink::Threads::UI()->PostTask([ engine = _platformView->engine().GetWeakPtr(), pointer_data ] { - if (engine.get()) { - blink::PointerDataPacket packet(1); - packet.SetPointerData(0, pointer_data); - engine->DispatchPointerDataPacket(packet); - } - }); + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = _shell->GetEngine(), pointer_data] { + if (engine) { + blink::PointerDataPacket packet(1); + packet.SetPointerData(0, pointer_data); + engine->DispatchPointerDataPacket(packet); + } + }); } - (void)mouseDown:(NSEvent*)event { @@ -155,11 +255,18 @@ - (void)mouseUp:(NSEvent*)event { [self dispatchEvent:event phase:NSEventPhaseEnded]; } -- (void)dealloc { - if (_platformView) { - _platformView->NotifyDestroyed(); - } +- (void)reset { + [self notifySurfaceDestroyed]; + _shell.reset(); + _thread_host.Reset(); +} +- (void)windowWillClose:(NSNotification*)notification { + [self reset]; +} + +- (void)dealloc { + [self reset]; [super dealloc]; } diff --git a/shell/platform/darwin/desktop/main_mac.mm b/shell/platform/darwin/desktop/main_mac.mm index 808a5f63f1d14..edd08d0c8b783 100644 --- a/shell/platform/darwin/desktop/main_mac.mm +++ b/shell/platform/darwin/desktop/main_mac.mm @@ -7,91 +7,20 @@ #include #include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/desktop/flutter_application.h" -#include "flutter/shell/testing/test_runner.h" -#include "flutter/shell/testing/testing.h" +#include "flutter/shell/platform/darwin/desktop/flutter_application_delegate.h" #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" -#include "lib/tonic/dart_microtask_queue.h" -// Exit codes used by the Dart command line tool. -const int kApiErrorExitCode = 253; -const int kCompilationErrorExitCode = 254; -const int kErrorExitCode = 255; - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver : public fml::TaskObserver { - public: - ScriptCompletionTaskObserver(fxl::RefPtr task_runner) - : main_task_runner_(std::move(task_runner)), - prev_live_(false), - last_error_(tonic::kNoError) {} - - void DidProcessTask() override { - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - shell::Engine& engine = test_runner.platform_view().engine(); - - if (engine.GetLoadScriptError() != tonic::kNoError) { - last_error_ = engine.GetLoadScriptError(); - main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); - return; - } - - bool live = engine.UIIsolateHasLivePorts(); - if (prev_live_ && !live) { - last_error_ = engine.GetUIIsolateLastError(); - main_task_runner_->PostTask([]() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - prev_live_ = live; - } - - tonic::DartErrorHandleType last_error() { return last_error_; } - - private: - fxl::RefPtr main_task_runner_; - bool prev_live_; - tonic::DartErrorHandleType last_error_; -}; - -int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { - switch (error) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } -} - -static fxl::CommandLine InitializedCommandLine() { +int main(int argc, const char* argv[]) { std::vector args_vector; for (NSString* arg in [NSProcessInfo processInfo].arguments) { args_vector.emplace_back(arg.UTF8String); } - return fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); -} - -int main(int argc, const char* argv[]) { - [FlutterApplication sharedApplication]; - - // Can't use shell::Shell::Shared().GetCommandLine() because it is initialized only - // in shell::PlatformMacMain call below. - auto command_line = InitializedCommandLine(); - - std::string bundle_path = ""; - command_line.GetOptionValue(FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); - - shell::PlatformMacMain("", "", bundle_path); + auto command_line = fxl::CommandLineFromIterators(args_vector.begin(), args_vector.end()); // Print help. if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { @@ -99,36 +28,7 @@ int main(int argc, const char* argv[]) { return EXIT_SUCCESS; } - // Decide between interactive and non-interactive modes. - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::NonInteractive))) { - if (!shell::InitForTesting(std::move(command_line))) - return 1; - - // Note that this task observer must be added after the observer that drains - // the microtask queue. - ScriptCompletionTaskObserver task_observer(fml::MessageLoop::GetCurrent().GetTaskRunner()); - blink::Threads::UI()->PostTask( - [&task_observer] { fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); }); - - fml::MessageLoop::GetCurrent().Run(); - - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - tonic::DartErrorHandleType error = test_runner.platform_view().engine().GetLoadScriptError(); - if (error == tonic::kNoError) - error = task_observer.last_error(); - if (error == tonic::kNoError) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&error, &latch] { - error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); - latch.Signal(); - }); - latch.Wait(); - } - - // The script has completed and the engine may not be in a clean state, - // so just stop the process. - exit(ConvertErrorTypeToExitCode(error)); - } else { - return NSApplicationMain(argc, argv); - } + [NSApplication sharedApplication].delegate = + [[[FlutterApplicationDelegate alloc] init] autorelease]; + return NSApplicationMain(argc, argv); } diff --git a/shell/platform/darwin/desktop/platform_view_mac.h b/shell/platform/darwin/desktop/platform_view_mac.h index 501400b6803d4..d4b19b94d1d99 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.h +++ b/shell/platform/darwin/desktop/platform_view_mac.h @@ -7,6 +7,7 @@ #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/shell.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "lib/fxl/memory/weak_ptr.h" @@ -15,15 +16,13 @@ namespace shell { -class PlatformViewMac : public PlatformView, public GPUSurfaceGLDelegate { +class PlatformViewMac final : public PlatformView, public GPUSurfaceGLDelegate { public: - PlatformViewMac(NSOpenGLView* gl_view); + PlatformViewMac(Shell& shell, NSOpenGLView* gl_view); ~PlatformViewMac() override; - virtual void Attach() override; - - void SetupAndLoadDart(); + std::unique_ptr CreateVSyncWaiter() override; bool GLContextMakeCurrent() override; @@ -33,27 +32,17 @@ class PlatformViewMac : public PlatformView, public GPUSurfaceGLDelegate { intptr_t GLContextFBO() const override; - VsyncWaiter* GetVsyncWaiter() override; - - bool ResourceContextMakeCurrent() override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - void SetAssetBundlePath(const std::string& assets_directory) override; - private: fml::scoped_nsobject opengl_view_; fml::scoped_nsobject resource_loading_context_; bool IsValid() const; - void SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages); + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; - void SetAssetBundlePathOnUI(const std::string& assets_directory); + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewMac); }; diff --git a/shell/platform/darwin/desktop/platform_view_mac.mm b/shell/platform/darwin/desktop/platform_view_mac.mm index 42948386fbcd4..f25fa6945af23 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.mm +++ b/shell/platform/darwin/desktop/platform_view_mac.mm @@ -7,77 +7,26 @@ #include #include -#include "flutter/common/threads.h" #include "flutter/fml/trace_event.h" +#include "flutter/shell/common/io_manager.h" +#include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/common/process_info_mac.h" #include "flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h" #include "lib/fxl/command_line.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewMac::PlatformViewMac(NSOpenGLView* gl_view) - : PlatformView(std::make_unique(std::make_unique())), +PlatformViewMac::PlatformViewMac(Shell& shell, NSOpenGLView* gl_view) + : PlatformView(shell, shell.GetTaskRunners()), opengl_view_([gl_view retain]), resource_loading_context_([[NSOpenGLContext alloc] initWithFormat:gl_view.pixelFormat shareContext:gl_view.openGLContext]) {} PlatformViewMac::~PlatformViewMac() = default; -void PlatformViewMac::Attach() { - CreateEngine(); -} - -void PlatformViewMac::SetupAndLoadDart() { - if (AttemptLaunchFromCommandLineSwitches(&engine())) { - // This attempts launching from a Flutter assets directory that does not - // contain a dart snapshot. - return; - } - - const auto& command_line = shell::Shell::Shared().GetCommandLine(); - - std::string bundle_path = - command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::FlutterAssetsDir), ""); - if (!bundle_path.empty()) { - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), bundle_path ] { - if (engine) - engine->RunBundle(bundle_path); - }); - return; - } - - auto args = command_line.positional_args(); - if (args.size() > 0) { - std::string main = args[0]; - std::string packages = - command_line.GetOptionValueWithDefault(FlagForSwitch(Switch::Packages), ""); - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), main, packages ] { - if (engine) - engine->RunBundleAndSource(std::string(), main, packages); - }); - return; - } -} - -void PlatformViewMac::SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - blink::Threads::UI()->PostTask( - [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { - if (engine) - engine->RunBundleAndSource(assets_directory, main, packages); - }); -} - -void PlatformViewMac::SetAssetBundlePathOnUI(const std::string& assets_directory) { - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { - if (engine) - engine->SetAssetBundlePath(assets_directory); - }); +std::unique_ptr PlatformViewMac::CreateVSyncWaiter() { + return std::make_unique(task_runners_); } intptr_t PlatformViewMac::GLContextFBO() const { @@ -115,21 +64,9 @@ return true; } -VsyncWaiter* PlatformViewMac::GetVsyncWaiter() { - if (!vsync_waiter_) - vsync_waiter_ = std::make_unique(); - return vsync_waiter_.get(); -} - -bool PlatformViewMac::ResourceContextMakeCurrent() { - NSOpenGLContext* context = resource_loading_context_.get(); - - if (context == nullptr) { - return false; - } - - [context makeCurrentContext]; - return true; +sk_sp PlatformViewMac::CreateResourceContext() const { + [resource_loading_context_.get() makeCurrentContext]; + return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); } bool PlatformViewMac::IsValid() const { @@ -146,30 +83,8 @@ return true; } -void PlatformViewMac::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetupAndLoadFromSource(assets_directory, main, packages); - latch->Signal(); - }); - - latch->Wait(); - delete latch; -} - -void PlatformViewMac::SetAssetBundlePath(const std::string& assets_directory) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetAssetBundlePathOnUI(assets_directory); - latch->Signal(); - }); - - latch->Wait(); - delete latch; +std::unique_ptr PlatformViewMac::CreateRenderingSurface() { + return std::make_unique(this); } } // namespace shell diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.cc b/shell/platform/darwin/desktop/vsync_waiter_mac.cc index a28ff62edb918..0ccadaf42754d 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.cc +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.cc @@ -6,14 +6,14 @@ #include -#include "flutter/common/threads.h" #include "lib/fxl/logging.h" namespace shell { #define link_ (reinterpret_cast(opaque_)) -VsyncWaiterMac::VsyncWaiterMac() : opaque_(nullptr) { +VsyncWaiterMac::VsyncWaiterMac(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)), opaque_(nullptr) { // Create the link. CVDisplayLinkRef link = nullptr; CVDisplayLinkCreateWithActiveCGDisplays(&link); @@ -48,18 +48,10 @@ void VsyncWaiterMac::OnDisplayLink() { CVDisplayLinkStop(link_); - auto callback = std::move(callback_); - callback_ = Callback(); - - blink::Threads::UI()->PostTask( - [callback, frame_start_time, frame_target_time] { - callback(frame_start_time, frame_target_time); - }); + FireCallback(frame_start_time, frame_target_time); } -void VsyncWaiterMac::AsyncWaitForVsync(Callback callback) { - FXL_DCHECK(!callback_); - callback_ = std::move(callback); +void VsyncWaiterMac::AwaitVSync() { CVDisplayLinkStart(link_); } diff --git a/shell/platform/darwin/desktop/vsync_waiter_mac.h b/shell/platform/darwin/desktop/vsync_waiter_mac.h index 15f551f212901..0ad929a509ea3 100644 --- a/shell/platform/darwin/desktop/vsync_waiter_mac.h +++ b/shell/platform/darwin/desktop/vsync_waiter_mac.h @@ -10,19 +10,19 @@ namespace shell { -class VsyncWaiterMac : public VsyncWaiter { +class VsyncWaiterMac final : public VsyncWaiter { public: - VsyncWaiterMac(); + VsyncWaiterMac(blink::TaskRunners task_runners); ~VsyncWaiterMac() override; - void AsyncWaitForVsync(Callback callback) override; - private: void* opaque_; - Callback callback_; + + void AwaitVSync() override; static void OnDisplayLink(void* context); + void OnDisplayLink(); FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterMac); diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 310af79c2ed8e..8946ee954c23a 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -40,8 +40,6 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterDartProject.mm", "framework/Source/FlutterDartProject_Internal.h", "framework/Source/FlutterHeadlessDartRunner.mm", - "framework/Source/FlutterDartSource.h", - "framework/Source/FlutterDartSource.mm", "framework/Source/FlutterNavigationController.mm", "framework/Source/FlutterPlatformPlugin.h", "framework/Source/FlutterPlatformPlugin.mm", @@ -53,14 +51,15 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterView.h", "framework/Source/FlutterView.mm", "framework/Source/FlutterViewController.mm", + "framework/Source/FlutterViewController_Internal.h", "framework/Source/accessibility_bridge.h", "framework/Source/accessibility_bridge.mm", "framework/Source/accessibility_text_entry.h", "framework/Source/accessibility_text_entry.mm", - "framework/Source/flutter_main_ios.h", - "framework/Source/flutter_main_ios.mm", "framework/Source/flutter_touch_mapper.h", "framework/Source/flutter_touch_mapper.mm", + "framework/Source/platform_message_response_darwin.h", + "framework/Source/platform_message_response_darwin.mm", "framework/Source/platform_message_router.h", "framework/Source/platform_message_router.mm", "framework/Source/vsync_waiter_ios.h", @@ -86,6 +85,7 @@ shared_library("create_flutter_framework_dylib") { "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/lib/ui", + "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", @@ -95,7 +95,10 @@ shared_library("create_flutter_framework_dylib") { "//third_party/skia", ] if (flutter_runtime_mode == "debug") { - deps += [ "//third_party/dart/runtime:libdart_jit" ] + deps += [ + "$flutter_root/lib/snapshot", + "//third_party/dart/runtime:libdart_jit", + ] } else { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index d5f30d02664d9..3c613c9fbad8f 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -2,42 +2,121 @@ // 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/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" +#include "flutter/fml/message_loop.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" +#include "flutter/runtime/dart_vm.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" -#include "lib/fxl/strings/string_view.h" -#include "third_party/dart/runtime/include/dart_api.h" - -static NSURL* URLForSwitch(const fxl::StringView name) { - const auto& cmd = shell::Shell::Shared().GetCommandLine(); - NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - - std::string switch_value; - if (cmd.GetOptionValue(name, &switch_value)) { - auto url = [NSURL fileURLWithPath:@(switch_value.c_str())]; - [defaults setURL:url forKey:@(name.data())]; - [defaults synchronize]; - return url; +#include "flutter/shell/platform/darwin/common/command_line.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" + +static const char* kScriptSnapshotFileName = "snapshot_blob.bin"; +static const char* kVMKernelSnapshotFileName = "platform.dill"; +static const char* kApplicationKernelSnapshotFileName = "kernel_blob.bin"; + +static blink::Settings DefaultSettingsForProcess() { + auto command_line = shell::CommandLineFromNSProcessInfo(); + + // Settings passed in explicitly via command line arguments take priority. + auto settings = shell::SettingsFromCommandLine(command_line); + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + // The command line arguments may not always be complete. If they aren't, attempt to fill in + // defaults. + + // Flutter ships the ICU data file in the the bundle of the engine. Look for it there. + if (settings.icu_data_path.size() == 0) { + NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; + NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; + if (icuDataPath.length > 0) { + settings.icu_data_path = icuDataPath.UTF8String; + } } - return [defaults URLForKey:@(name.data())]; -} + if (blink::DartVM::IsRunningPrecompiledCode()) { + // The application bundle could be specified in the Info.plist. + if (settings.application_library_path.size() == 0) { + NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; + NSString* libraryPath = [[NSBundle mainBundle] pathForResource:libraryName ofType:nil]; + if (libraryPath.length > 0) { + settings.application_library_path = + [NSBundle bundleWithPath:libraryPath].executablePath.UTF8String; + } + } -@implementation FlutterDartProject { - NSBundle* _precompiledDartBundle; - FlutterDartSource* _dartSource; + // In case the application bundle is still not specified, look for the App.framework in the + // Frameworks directory. + if (settings.application_library_path.size() == 0) { + NSString* applicationFrameworkPath = + [[NSBundle mainBundle] pathForResource:@"Frameworks/App.framework" ofType:@""]; + if (applicationFrameworkPath.length > 0) { + settings.application_library_path = + [NSBundle bundleWithPath:applicationFrameworkPath].executablePath.UTF8String; + } + } + } - VMType _vmTypeRequirement; + // Checks to see if the flutter assets directory is already present. + if (settings.assets_path.size() == 0) { + NSString* assetsPath = [[NSBundle mainBundle] pathForResource:@"flutter_assets" ofType:@""]; + + if (assetsPath.length > 0) { + settings.assets_path = assetsPath.UTF8String; + + if (!blink::DartVM::IsRunningPrecompiledCode()) { + // Looking for the various script and kernel snapshot buffers only makes sense if we have a + // VM that can use these buffers. + { + // Check if there is a script snapshot in the assets directory we could potentially use. + NSURL* scriptSnapshotURL = [NSURL URLWithString:@(kScriptSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotURL.path]) { + settings.script_snapshot_path = scriptSnapshotURL.path.UTF8String; + } + } + + { + // Check if there is a VM kernel snapshot in the assets directory we could potentially + // use. + NSURL* vmKernelSnapshotURL = [NSURL URLWithString:@(kVMKernelSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:vmKernelSnapshotURL.path]) { + settings.kernel_snapshot_path = vmKernelSnapshotURL.path.UTF8String; + } + } + + { + // Check if there is an application kernel snapshot in the assets directory we could + // potentially use. + NSURL* applicationKernelSnapshotURL = + [NSURL URLWithString:@(kApplicationKernelSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:applicationKernelSnapshotURL.path]) { + settings.application_kernel_asset = applicationKernelSnapshotURL.path.UTF8String; + } + } + } + } + } + + return settings; } -+ (void)initialize { - if (self == [FlutterDartProject class]) { - shell::FlutterMain(); - } +@implementation FlutterDartProject { + fml::scoped_nsobject _precompiledDartBundle; + blink::Settings _settings; } #pragma mark - Override base class designated initializers @@ -52,9 +131,16 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle { self = [super init]; if (self) { - _precompiledDartBundle = [bundle retain]; + _precompiledDartBundle.reset([bundle retain]); - [self checkReadiness]; + _settings = DefaultSettingsForProcess(); + + if (bundle != nil) { + NSString* executablePath = _precompiledDartBundle.get().executablePath; + if ([[NSFileManager defaultManager] fileExistsAtPath:executablePath]) { + _settings.application_library_path = executablePath.UTF8String; + } + } } return self; @@ -66,11 +152,15 @@ - (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _dartSource = [[FlutterDartSource alloc] initWithDartMain:dartMainURL - packages:dartPackages - flutterAssets:flutterAssetsURL]; + _settings = DefaultSettingsForProcess(); - [self checkReadiness]; + if ([[NSFileManager defaultManager] fileExistsAtPath:dartMainURL.path]) { + _settings.main_dart_file_path = dartMainURL.path.UTF8String; + } + + if ([[NSFileManager defaultManager] fileExistsAtPath:dartPackages.path]) { + _settings.packages_file_path = dartPackages.path.UTF8String; + } } return self; @@ -80,10 +170,17 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL self = [super init]; if (self) { - _dartSource = - [[FlutterDartSource alloc] initWithFlutterAssetsWithScriptSnapshot:flutterAssetsURL]; + _settings = DefaultSettingsForProcess(); - [self checkReadiness]; + if ([[NSFileManager defaultManager] fileExistsAtPath:flutterAssetsURL.path]) { + _settings.assets_path = flutterAssetsURL.path.UTF8String; + + NSURL* scriptSnapshotPath = + [NSURL URLWithString:@(kScriptSnapshotFileName) relativeToURL:flutterAssetsURL]; + if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotPath.path]) { + _settings.script_snapshot_path = scriptSnapshotPath.path.UTF8String; + } + } } return self; @@ -92,56 +189,19 @@ - (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL #pragma mark - Convenience initializers - (instancetype)initFromDefaultSourceForConfiguration { - NSBundle* bundle = [NSBundle mainBundle]; - - if (Dart_IsPrecompiledRuntime()) { - // Load from an AOTC snapshot. - return [self initWithPrecompiledDartBundle:bundle]; + if (blink::DartVM::IsRunningPrecompiledCode()) { + return [self initWithPrecompiledDartBundle:nil]; } else { - // Load directly from sources if the appropriate command line flags are - // specified. If not, try loading from a script snapshot in the framework - // bundle. - NSURL* flutterAssetsURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::FlutterAssetsDir)); - - if (flutterAssetsURL == nil) { - // If the URL was not specified on the command line, look inside the - // FlutterApplication bundle. - NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:bundle]; - if (flutterAssetsPath != nil) { - flutterAssetsURL = [NSURL fileURLWithPath:flutterAssetsPath isDirectory:NO]; - } - } - - if (flutterAssetsURL == nil) { - NSLog(@"Error: flutterAssets directory not present in bundle; unable to start app."); - [self release]; - return nil; - } - - NSURL* dartMainURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::MainDartFile)); - NSURL* dartPackagesURL = URLForSwitch(shell::FlagForSwitch(shell::Switch::Packages)); - - return - [self initWithFlutterAssets:flutterAssetsURL dartMain:dartMainURL packages:dartPackagesURL]; + return [self initWithFlutterAssets:nil dartMain:nil packages:nil]; } - - NSAssert(NO, @"Unreachable"); - [self release]; - return nil; } -#pragma mark - Common initialization tasks - -- (void)checkReadiness { - if (_precompiledDartBundle != nil) { - _vmTypeRequirement = VMTypePrecompilation; - return; - } +- (const blink::Settings&)settings { + return _settings; +} - if (_dartSource != nil) { - _vmTypeRequirement = VMTypeInterpreter; - return; - } +- (shell::RunConfiguration)runConfiguration { + return shell::RunConfiguration::InferFromSettings(_settings); } #pragma mark - Assets-related utilities @@ -161,7 +221,7 @@ + (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle { } + (NSString*)lookupKeyForAsset:(NSString*)asset { - NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName: [NSBundle mainBundle]]; + NSString* flutterAssetsName = [FlutterDartProject flutterAssetsName:[NSBundle mainBundle]]; return [NSString stringWithFormat:@"%@/%@", flutterAssetsName, asset]; } @@ -169,179 +229,4 @@ + (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { return [self lookupKeyForAsset:[NSString stringWithFormat:@"packages/%@/%@", package, asset]]; } -#pragma mark - Launching the project in a preconfigured engine. - -static NSString* NSStringFromVMType(VMType type) { - switch (type) { - case VMTypeInvalid: - return @"Invalid"; - case VMTypeInterpreter: - return @"Interpreter"; - case VMTypePrecompilation: - return @"Precompilation"; - } - - return @"Unknown"; -} - -- (void)launchInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - embedderVMType:(VMType)embedderVMType - result:(LaunchResult)result { - if (_vmTypeRequirement == VMTypeInvalid) { - result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); - return; - } - - if (embedderVMType == VMTypeInvalid) { - result(NO, @"The embedder is invalid."); - return; - } - - if (_vmTypeRequirement != embedderVMType) { - NSString* message = - [NSString stringWithFormat: - @"Could not load the project because of differing project type. " - @"The project can run in '%@' but the embedder is configured as " - @"'%@'", - NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; - result(NO, message); - return; - } - - switch (_vmTypeRequirement) { - case VMTypeInterpreter: - [self runFromSourceInEngine:engine withEntrypoint:entrypoint result:result]; - return; - case VMTypePrecompilation: - [self runFromPrecompiledSourceInEngine:engine withEntrypoint:entrypoint result:result]; - return; - case VMTypeInvalid: - break; - } - - return result(NO, @"Internal error"); -} - -- (void)launchInEngine:(shell::Engine*)engine - embedderVMType:(VMType)embedderVMType - result:(LaunchResult)result { - if (_vmTypeRequirement == VMTypeInvalid) { - result(NO, @"The Dart project is invalid and cannot be loaded by any VM."); - return; - } - - if (embedderVMType == VMTypeInvalid) { - result(NO, @"The embedder is invalid."); - return; - } - - if (_vmTypeRequirement != embedderVMType) { - NSString* message = - [NSString stringWithFormat: - @"Could not load the project because of differing project type. " - @"The project can run in '%@' but the embedder is configured as " - @"'%@'", - NSStringFromVMType(_vmTypeRequirement), NSStringFromVMType(embedderVMType)]; - result(NO, message); - return; - } - - switch (_vmTypeRequirement) { - case VMTypeInterpreter: - [self runFromSourceInEngine:engine withEntrypoint:@"main" result:result]; - return; - case VMTypePrecompilation: - [self runFromPrecompiledSourceInEngine:engine withEntrypoint:@"main" result:result]; - return; - case VMTypeInvalid: - break; - } - - return result(NO, @"Internal error"); -} - -#pragma mark - Running from precompiled application bundles - -- (void)runFromPrecompiledSourceInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - result:(LaunchResult)result { - if (![_precompiledDartBundle load]) { - NSString* message = [NSString - stringWithFormat:@"Could not load the framework ('%@') containing precompiled code.", - _precompiledDartBundle.bundleIdentifier]; - result(NO, message); - return; - } - - NSString* path = [FlutterDartProject pathForFlutterAssetsFromBundle:_precompiledDartBundle]; - if (path.length == 0) { - NSString* message = [NSString stringWithFormat: - @"Could not find the 'flutter_assets' dir in " - @"the precompiled Dart bundle with ID '%@'", - _precompiledDartBundle.bundleIdentifier]; - result(NO, message); - return; - } - - std::string bundle_path = path.UTF8String; - blink::Threads::UI()->PostTask([ - engine = engine->GetWeakPtr(), bundle_path, entrypoint = std::string([entrypoint UTF8String]) - ] { - if (engine) - engine->RunBundle(bundle_path, entrypoint); - }); - - result(YES, @"Success"); -} - -#pragma mark - Running from source - -- (void)runFromSourceInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - result:(LaunchResult)result { - if (_dartSource == nil) { - result(NO, @"Dart source not specified."); - return; - } - - [_dartSource validate:^(BOOL success, NSString* message) { - if (!success) { - return result(NO, message); - } - - std::string bundle_path = _dartSource.flutterAssets.absoluteURL.path.UTF8String; - - if (_dartSource.assetsDirContainsScriptSnapshot) { - blink::Threads::UI()->PostTask([ - engine = engine->GetWeakPtr(), bundle_path, - entrypoint = std::string([entrypoint UTF8String]) - ] { - if (engine) - engine->RunBundle(bundle_path, entrypoint); - }); - } else { - std::string main = _dartSource.dartMain.absoluteURL.path.UTF8String; - std::string packages = _dartSource.packages.absoluteURL.path.UTF8String; - blink::Threads::UI()->PostTask( - [ engine = engine->GetWeakPtr(), bundle_path, main, packages ] { - if (engine) - engine->RunBundleAndSource(bundle_path, main, packages); - }); - } - - result(YES, @"Success"); - }]; -} - -#pragma mark - Misc. - -- (void)dealloc { - [_precompiledDartBundle unload]; - [_precompiledDartBundle release]; - [_dartSource release]; - - [super dealloc]; -} - @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h index 75db7c4049dd9..7fe1fc364f328 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h @@ -5,32 +5,15 @@ #ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ +#include "flutter/common/settings.h" #include "flutter/shell/common/engine.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h" -enum VMType { - // An invalid VM configuration. - VMTypeInvalid = 0, - // VM can execute Dart code as an interpreter. - VMTypeInterpreter, - // VM can execute precompiled Dart code. - VMTypePrecompilation, -}; - -typedef void (^LaunchResult)(BOOL success, NSString* message); - @interface FlutterDartProject () -- (void)launchInEngine:(shell::Engine*)engine - embedderVMType:(VMType)type - result:(LaunchResult)result; - -- (void)launchInEngine:(shell::Engine*)engine - withEntrypoint:(NSString*)entrypoint - embedderVMType:(VMType)type - result:(LaunchResult)result; +- (const blink::Settings&)settings; -+ (NSString*)pathForFlutterAssetsFromBundle:(NSBundle*)bundle; +- (shell::RunConfiguration)runConfiguration; @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h deleted file mode 100644 index c3881ce065185..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 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. - -#ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ -#define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ - -#import - -typedef void (^ValidationResult)(BOOL result, NSString* message); - -@interface FlutterDartSource : NSObject - -@property(nonatomic, readonly) NSURL* dartMain; -@property(nonatomic, readonly) NSURL* packages; -@property(nonatomic, readonly) NSURL* flutterAssets; -@property(nonatomic, readonly) BOOL assetsDirContainsScriptSnapshot; - -- (instancetype)initWithDartMain:(NSURL*)dartMain - packages:(NSURL*)packages - flutterAssets:(NSURL*)flutterAssets NS_DESIGNATED_INITIALIZER; - -- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets - NS_DESIGNATED_INITIALIZER; - -- (void)validate:(ValidationResult)result; - -@end - -#endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTSOURCE_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm deleted file mode 100644 index aecb4e5806b3a..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h" - -@implementation FlutterDartSource - -@synthesize dartMain = _dartMain; -@synthesize packages = _packages; -@synthesize flutterAssets = _flutterAssets; -@synthesize assetsDirContainsScriptSnapshot = _assetsDirContainsScriptSnapshot; - -#pragma mark - Convenience Initializers - -- (instancetype)init { - return [self initWithDartMain:nil packages:nil flutterAssets:nil]; -} - -#pragma mark - Designated Initializers - -- (instancetype)initWithDartMain:(NSURL*)dartMain - packages:(NSURL*)packages - flutterAssets:(NSURL*)flutterAssets { - self = [super init]; - - if (self) { - _dartMain = [dartMain copy]; - _packages = [packages copy]; - _flutterAssets = [flutterAssets copy]; - - NSFileManager* fileManager = [NSFileManager defaultManager]; - - const BOOL dartMainExists = [fileManager fileExistsAtPath:dartMain.absoluteURL.path]; - const BOOL packagesExists = [fileManager fileExistsAtPath:packages.absoluteURL.path]; - - if (!dartMainExists || !packagesExists) { - // We cannot actually verify this without opening up the directory. This is - // just an assumption. - _assetsDirContainsScriptSnapshot = YES; - } - } - - return self; -} - -- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssets { - self = [super init]; - - if (self) { - _flutterAssets = [flutterAssets copy]; - _assetsDirContainsScriptSnapshot = YES; - } - - return self; -} - -static BOOL CheckDartProjectURL(NSMutableString* log, NSURL* url, NSString* logLabel) { - if (url == nil) { - [log appendFormat:@"The %@ was not specified.\n", logLabel]; - return false; - } - - if (!url.isFileURL) { - [log appendFormat:@"The %@ must be a file URL.\n", logLabel]; - return false; - } - - if (![[NSFileManager defaultManager] fileExistsAtPath:url.absoluteURL.path]) { - [log appendFormat:@"No file found at '%@' when looking for the %@.\n", url, logLabel]; - return false; - } - - return true; -} - -- (void)validate:(ValidationResult)result { - NSMutableString* log = [[[NSMutableString alloc] init] autorelease]; - - BOOL isValid = YES; - - isValid &= CheckDartProjectURL(log, _flutterAssets, @"Flutter assets"); - - if (!_assetsDirContainsScriptSnapshot) { - isValid &= CheckDartProjectURL(log, _dartMain, @"Dart main"); - isValid &= CheckDartProjectURL(log, _packages, @"Dart packages"); - } - - result(isValid, log); -} - -- (void)dealloc { - [_dartMain release]; - [_packages release]; - [_flutterAssets release]; - - [super dealloc]; -} - -@end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm index 2143f362f7905..dee11d08934a5 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm @@ -2,38 +2,84 @@ // 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 + #import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h" +#include #include -#include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/null_platform_view.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" +#include "flutter/fml/message_loop.h" +#include "flutter/shell/common/engine.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/run_configuration.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/darwin/common/command_line.h" +#include "lib/fxl/functional/make_copyable.h" -@interface FlutterHeadlessDartRunner () -@end +static std::unique_ptr CreateHeadlessPlatformView(shell::Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); +} -@implementation FlutterHeadlessDartRunner { - fml::scoped_nsprotocol _dartProject; - std::shared_ptr _platformView; +static std::unique_ptr CreateHeadlessRasterizer(shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); } -- (instancetype)init { - _dartProject.reset([[FlutterDartProject alloc] initFromDefaultSourceForConfiguration]); - _platformView = std::make_shared(); - _platformView->Attach(); - return self; +@implementation FlutterHeadlessDartRunner { + shell::ThreadHost _threadHost; + std::unique_ptr _shell; } - (void)runWithEntrypoint:(NSString*)entrypoint { - const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; - [_dartProject launchInEngine:&_platformView->engine() - withEntrypoint:entrypoint - embedderVMType:type - result:^(BOOL success, NSString* message) { - if (!success) - NSLog(@"%@", message); - }]; + if (_shell != nullptr || entrypoint.length == 0) { + FXL_LOG(ERROR) << "This headless dart runner was already used to run some code."; + return; + } + + const auto label = "io.flutter.headless"; + + // Create the threads to run the shell on. + _threadHost = { + label, // native thread label + shell::ThreadHost::Type::UI // managed threads to create + }; + + // Configure shell task runners. + auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); + auto single_task_runner = _threadHost.ui_thread->GetTaskRunner(); + blink::TaskRunners task_runners(label, // dart thread label + current_task_runner, // platform + single_task_runner, // gpu + single_task_runner, // ui + single_task_runner // io + ); + + auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); + + // Create the shell. This is a blocking operation. + _shell = shell::Shell::Create( + std::move(task_runners), // task runners + std::move(settings), // settings + std::bind(&CreateHeadlessPlatformView, std::placeholders::_1), // platform view creation + std::bind(&CreateHeadlessRasterizer, std::placeholders::_1) // rasterzier creation + ); + + if (_shell == nullptr) { + FXL_LOG(ERROR) << "Could not start a shell for the headless dart runner with entrypoint: " + << entrypoint.UTF8String; + return; + } + + // Override the default run configuration with the specified entrypoint. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), + config = shell::RunConfiguration::InferFromSettings(settings)]() mutable { + if (!engine || !engine->Run(std::move(config))) { + FXL_LOG(ERROR) << "Could not launch engine with configuration."; + } + })); } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.h b/shell/platform/darwin/ios/framework/Source/FlutterView.h index 661940620c947..5e3d303401725 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.h @@ -7,8 +7,14 @@ #include +#include + +#include "flutter/shell/platform/darwin/ios/ios_surface.h" + @interface FlutterView : UIView +- (std::unique_ptr)createSurface; + @end #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTER_VIEW_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 7c382838c6f5c..27e3d48c4cb50 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -5,20 +5,41 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/common/settings.h" -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" +#include "flutter/fml/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" +#include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" +#include "flutter/shell/platform/darwin/ios/ios_surface_software.h" #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" -@interface FlutterView () +@interface FlutterView () @end @implementation FlutterView +- (FlutterViewController*)flutterViewController { + // Find the first view controller in the responder chain and see if it is a FlutterViewController. + for (UIResponder* responder = self.nextResponder; responder != nil; + responder = responder.nextResponder) { + if ([responder isKindOfClass:[UIViewController class]]) { + if ([responder isKindOfClass:[FlutterViewController class]]) { + return reinterpret_cast(responder); + } else { + // Should only happen if a non-FlutterViewController tries to somehow (via dynamic class + // resolution or reparenting) set a FlutterView as its view. + return nil; + } + } + } + return nil; +} + - (void)layoutSubviews { if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { CAEAGLLayer* layer = reinterpret_cast(self.layer); @@ -40,13 +61,24 @@ + (Class)layerClass { #endif // TARGET_IPHONE_SIMULATOR } +- (std::unique_ptr)createSurface { + if ([self.layer isKindOfClass:[CAEAGLLayer class]]) { + fml::scoped_nsobject eagl_layer( + reinterpret_cast([self.layer retain])); + return std::make_unique(std::move(eagl_layer)); + } else { + fml::scoped_nsobject layer(reinterpret_cast([self.layer retain])); + return std::make_unique(std::move(layer)); + } +} + - (BOOL)enableInputClicksWhenVisible { return YES; } -void SnapshotRasterizer(fml::WeakPtr rasterizer, - CGContextRef context, - bool is_opaque) { +static void SnapshotRasterizer(fml::WeakPtr rasterizer, + CGContextRef context, + bool is_opaque) { if (!rasterizer) { return; } @@ -77,10 +109,11 @@ void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCanvas canvas(bitmap); - { - flow::CompositorContext compositor_context(nullptr); - auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */); - layer_tree->Raster(frame, false /* ignore raster cache. */); + flow::CompositorContext compositor_context; + + if (auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */)) { + layer_tree->Preroll(*frame, true /* ignore raster cache */); + layer_tree->Paint(*frame); } canvas.flush(); @@ -89,41 +122,6 @@ void SnapshotRasterizer(fml::WeakPtr rasterizer, SkCGDrawBitmap(context, bitmap, 0, 0); } -static fml::WeakPtr GetRandomRasterizer() { - fml::WeakPtr rasterizer; - shell::Shell::Shared().IteratePlatformViews([&rasterizer](shell::PlatformView* view) -> bool { - rasterizer = view->rasterizer().GetWeakRasterizerPtr(); - // We just grab the first rasterizer so there is no need to iterate - // further. - return false; - }); - return rasterizer; -} - -void SnapshotContents(CGContextRef context, bool is_opaque) { - // TODO(chinmaygarde): Currently, there is no way to get the rasterizer for - // a particular platform view from the shell. But, for now, we only have one - // platform view. So use that. Once we support multiple platform views, the - // shell will need to provide a way to get the rasterizer for a specific - // platform view. - SnapshotRasterizer(GetRandomRasterizer(), context, is_opaque); -} - -void SnapshotContentsSync(CGContextRef context, UIView* view) { - auto gpu_thread = blink::Threads::Gpu(); - - if (!gpu_thread) { - return; - } - - fxl::AutoResetWaitableEvent latch; - gpu_thread->PostTask([&latch, context, view]() { - SnapshotContents(context, [view isOpaque]); - latch.Signal(); - }); - latch.Wait(); -} - // Override the default CALayerDelegate method so that APIs that attempt to // screenshot the view display contents correctly. We cannot depend on // reading @@ -132,7 +130,22 @@ void SnapshotContentsSync(CGContextRef context, UIView* view) { // 2: The call is made of the platform thread and not the GPU thread. // 3: There may be a software rasterizer. - (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { - SnapshotContentsSync(context, self); + TRACE_EVENT0("flutter", "SnapshotFlutterView"); + FlutterViewController* controller = [self flutterViewController]; + + if (controller == nil) { + return; + } + + auto& shell = [controller shell]; + + fxl::AutoResetWaitableEvent latch; + shell.GetTaskRunners().GetGPUTaskRunner()->PostTask( + [&latch, rasterizer = shell.GetRasterizer(), context, opaque = layer.opaque]() { + SnapshotRasterizer(std::move(rasterizer), context, opaque); + latch.Signal(); + }); + latch.Wait(); } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index a467a5a8cf1a5..17e9a4eff48f6 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -2,90 +2,54 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#define FML_USED_ON_EMBEDDER + +#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" #include -#include "flutter/common/threads.h" -#include "flutter/flow/texture.h" +#include "flutter/fml/message_loop.h" #include "flutter/fml/platform/darwin/platform_version.h" -#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/lib/ui/painting/resource_context.h" -#include "flutter/shell/platform/darwin/common/buffer_conversions.h" -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterCodecs.h" +#include "flutter/shell/common/thread_host.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/shell/platform/darwin/ios/framework/Source/flutter_touch_mapper.h" -#include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" #include "flutter/shell/platform/darwin/ios/platform_view_ios.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/time/time_delta.h" - -namespace { - -typedef void (^PlatformMessageResponseCallback)(NSData*); - -class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { - FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); - - public: - void Complete(std::vector data) override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask( - fxl::MakeCopyable([ self, data = std::move(data) ]() mutable { - self->callback_.get()(shell::GetNSDataFromVector(data)); - })); - } - - void CompleteEmpty() override { - fxl::RefPtr self(this); - blink::Threads::Platform()->PostTask( - fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); - } - - private: - explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback) - : callback_(callback, fml::OwnershipPolicy::Retain) {} - fml::ScopedBlock callback_; -}; - -} // namespace - -@interface FlutterViewController () +@interface FlutterViewController () @end @implementation FlutterViewController { - fml::scoped_nsprotocol _dartProject; + fml::scoped_nsobject _dartProject; + shell::ThreadHost _threadHost; + std::unique_ptr _shell; + + // Channels + fml::scoped_nsobject _platformPlugin; + fml::scoped_nsobject _textInputPlugin; + fml::scoped_nsobject _localizationChannel; + fml::scoped_nsobject _navigationChannel; + fml::scoped_nsobject _platformChannel; + fml::scoped_nsobject _textInputChannel; + fml::scoped_nsobject _lifecycleChannel; + fml::scoped_nsobject _systemChannel; + fml::scoped_nsobject _settingsChannel; + + // We keep a separate reference to this and create it ahead of time because we want to be able to + // setup a shell along with its platform view before the view has to appear. + fml::scoped_nsobject _flutterView; + fml::scoped_nsobject _launchView; UIInterfaceOrientationMask _orientationPreferences; UIStatusBarStyle _statusBarStyle; blink::ViewportMetrics _viewportMetrics; shell::TouchMapper _touchMapper; - std::shared_ptr _platformView; - fml::scoped_nsprotocol _platformPlugin; - fml::scoped_nsprotocol _textInputPlugin; - fml::scoped_nsprotocol _localizationChannel; - fml::scoped_nsprotocol _navigationChannel; - fml::scoped_nsprotocol _platformChannel; - fml::scoped_nsprotocol _textInputChannel; - fml::scoped_nsprotocol _lifecycleChannel; - fml::scoped_nsprotocol _systemChannel; - fml::scoped_nsprotocol _settingsChannel; - fml::scoped_nsprotocol _launchView; int64_t _nextTextureId; BOOL _initialized; - BOOL _connected; -} - -+ (void)initialize { - if (self == [FlutterViewController class]) { - shell::FlutterMain(); - } } #pragma mark - Manage and override all designated initializers @@ -125,26 +89,92 @@ - (void)performCommonViewControllerInitialization { _orientationPreferences = UIInterfaceOrientationMaskAll; _statusBarStyle = UIStatusBarStyleDefault; - _platformView = std::make_shared( - reinterpret_cast(self.view.layer), self); - - _platformView->Attach( - // First frame callback. - [self]() { - TRACE_EVENT0("flutter", "First Frame"); - if (_launchView) { - [UIView animateWithDuration:0.2 - animations:^{ - _launchView.get().alpha = 0; - } - completion:^(BOOL finished) { - [_launchView.get() removeFromSuperview]; - _launchView.reset(); - }]; + + if ([self setupShell]) { + [self setupChannels]; + [self setupNotificationCenterObservers]; + } +} + +- (shell::Shell&)shell { + FXL_DCHECK(_shell); + return *_shell; +} + +- (fml::WeakPtr)iosPlatformView { + FXL_DCHECK(_shell); + return _shell->GetPlatformView(); +} + +- (BOOL)setupShell { + FXL_DCHECK(_shell == nullptr); + + static size_t shell_count = 1; + + auto threadLabel = [NSString stringWithFormat:@"io.flutter.%zu", shell_count++]; + + _threadHost = { + threadLabel.UTF8String, // label + shell::ThreadHost::Type::UI | shell::ThreadHost::Type::GPU | shell::ThreadHost::Type::IO}; + + // The current thread will be used as the platform thread. Ensure that the message loop is + // initialized. + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + blink::TaskRunners task_runners(threadLabel.UTF8String, // label + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + _threadHost.gpu_thread->GetTaskRunner(), // gpu + _threadHost.ui_thread->GetTaskRunner(), // ui + _threadHost.io_thread->GetTaskRunner() // io + ); + + _flutterView.reset([[FlutterView alloc] init]); + + // Lambda captures by pointers to ObjC objects are fine here because the create call is + // synchronous. + shell::Shell::CreateCallback on_create_platform_view = + [flutter_view_controller = self, flutter_view = _flutterView.get()](shell::Shell& shell) { + auto platform_view_ios = std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + flutter_view_controller, // flutter view controller owner + flutter_view // flutter view owner + ); + return platform_view_ios; + }; + + shell::Shell::CreateCallback on_create_rasterizer = [](shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // Create the shell. + _shell = shell::Shell::Create(std::move(task_runners), // + [_dartProject settings], // + on_create_platform_view, // + on_create_rasterizer // + ); + + if (!_shell) { + FXL_LOG(ERROR) << "Could not setup a shell to run the Dart application."; + return false; + } + + // Launch the Dart application with the inferred run configuration. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), // + config = [_dartProject.get() runConfiguration] // + ]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch engine with configuration."; + } } - }); - _platformView->SetupResourceContextOnIOThread(); + })); + return true; +} +- (void)setupChannels { _localizationChannel.reset([[FlutterMethodChannel alloc] initWithName:@"flutter/localization" binaryMessenger:self @@ -190,9 +220,8 @@ - (void)performCommonViewControllerInitialization { [_textInputChannel.get() setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { [_textInputPlugin.get() handleMethodCall:call result:result]; }]; - _platformView->SetTextInputPlugin(_textInputPlugin); - - [self setupNotificationCenterObservers]; + static_cast(_shell->GetPlatformView().get()) + ->SetTextInputPlugin(_textInputPlugin); } - (void)setupNotificationCenterObservers { @@ -261,50 +290,24 @@ - (void)setupNotificationCenterObservers { - (void)setInitialRoute:(NSString*)route { [_navigationChannel.get() invokeMethod:@"setInitialRoute" arguments:route]; } -#pragma mark - Initializing the engine - -- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { - exit(0); -} - -- (void)connectToEngineAndLoad { - if (_connected) - return; - _connected = YES; - - TRACE_EVENT0("flutter", "connectToEngineAndLoad"); - - // We ask the VM to check what it supports. - const enum VMType type = Dart_IsPrecompiledRuntime() ? VMTypePrecompilation : VMTypeInterpreter; - - [_dartProject launchInEngine:&_platformView->engine() - embedderVMType:type - result:^(BOOL success, NSString* message) { - if (!success) { - UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Launch Error" - message:message - delegate:self - cancelButtonTitle:@"OK" - otherButtonTitles:nil]; - [alert show]; - [alert release]; - } - }]; -} #pragma mark - Loading the view - (void)loadView { - FlutterView* view = [[FlutterView alloc] init]; - - self.view = view; + self.view = _flutterView.get(); self.view.multipleTouchEnabled = YES; self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [view release]; + [self installLaunchViewIfNecessary]; +} + +#pragma mark - Managing launch views +- (void)installLaunchViewIfNecessary { // Show the launch screen view again on top of the FlutterView if available. // This launch screen view will be removed once the first Flutter frame is rendered. + [_launchView.get() removeFromSuperview]; + _launchView.reset(); NSString* launchStoryboardName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UILaunchStoryboardName"]; if (launchStoryboardName && !self.isBeingPresented && !self.isMovingToParentViewController) { @@ -319,16 +322,57 @@ - (void)loadView { } } +- (void)removeLaunchViewIfPresent { + if (!_launchView) { + return; + } + + [UIView animateWithDuration:0.2 + animations:^{ + _launchView.get().alpha = 0; + } + completion:^(BOOL finished) { + [_launchView.get() removeFromSuperview]; + _launchView.reset(); + }]; +} + +- (void)installLaunchViewCallback { + if (!_shell || !_launchView) { + return; + } + auto weak_platform_view = _shell->GetPlatformView(); + if (!weak_platform_view) { + return; + } + __unsafe_unretained auto weak_flutter_view_controller = self; + // This is on the platform thread. + weak_platform_view->SetNextFrameCallback( + [weak_platform_view, weak_flutter_view_controller, + task_runner = _shell->GetTaskRunners().GetPlatformTaskRunner()]() { + // This is on the GPU thread. + task_runner->PostTask([weak_platform_view, weak_flutter_view_controller]() { + // We check if the weak platform view is alive. If it is alive, then the view controller + // also has to be alive since the view controller owns the platform view via the shell + // association. Thus, we are not convinced that the unsafe unretained weak object is in + // fact alive. + if (weak_platform_view) { + [weak_flutter_view_controller removeLaunchViewIfPresent]; + } + }); + }); +} + #pragma mark - Surface creation and teardown updates - (void)surfaceUpdated:(BOOL)appeared { - FXL_CHECK(_platformView != nullptr); - // NotifyCreated/NotifyDestroyed are synchronous and require hops between the UI and GPU thread. if (appeared) { - _platformView->NotifyCreated(); + [self installLaunchViewCallback]; + _shell->GetPlatformView()->NotifyCreated(); + } else { - _platformView->NotifyDestroyed(); + _shell->GetPlatformView()->NotifyDestroyed(); } } @@ -336,7 +380,6 @@ - (void)surfaceUpdated:(BOOL)appeared { - (void)viewWillAppear:(BOOL)animated { TRACE_EVENT0("flutter", "viewWillAppear"); - [self connectToEngineAndLoad]; // Only recreate surface on subsequent appearances when viewport metrics are known. // First time surface creation is done on viewDidLayoutSubviews. if (_viewportMetrics.physical_width) @@ -391,8 +434,6 @@ - (void)applicationWillResignActive:(NSNotification*)notification { - (void)applicationDidEnterBackground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationDidEnterBackground"); [self surfaceUpdated:NO]; - // GrContext operations are blocked when the app is in the background. - blink::ResourceContext::Freeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.paused"]; } @@ -400,7 +441,6 @@ - (void)applicationWillEnterForeground:(NSNotification*)notification { TRACE_EVENT0("flutter", "applicationWillEnterForeground"); if (_viewportMetrics.physical_width) [self surfaceUpdated:YES]; - blink::ResourceContext::Unfreeze(); [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.inactive"]; } @@ -547,10 +587,11 @@ - (void)dispatchTouches:(NSSet*)touches phase:(UITouchPhase)phase { packet->SetPointerData(i++, pointer_data); } - blink::Threads::UI()->PostTask(fxl::MakeCopyable( - [ engine = _platformView->engine().GetWeakPtr(), packet = std::move(packet) ] { - if (engine.get()) + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), packet = std::move(packet)] { + if (engine) { engine->DispatchPointerDataPacket(*packet); + } })); } @@ -573,13 +614,11 @@ - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event { #pragma mark - Handle view resizing - (void)updateViewportMetrics { - blink::Threads::UI()->PostTask( - [ weak_platform_view = _platformView->GetWeakPtr(), metrics = _viewportMetrics ] { - if (!weak_platform_view) { - return; + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = _shell->GetEngine(), metrics = _viewportMetrics]() { + if (engine) { + engine->SetViewportMetrics(std::move(metrics)); } - weak_platform_view->UpdateSurfaceSize(); - weak_platform_view->engine().SetViewportMetrics(metrics); }); } @@ -709,7 +748,7 @@ - (void)onVoiceOverChanged:(NSNotification*)notification { #else bool enabled = UIAccessibilityIsVoiceOverRunning(); #endif - _platformView->ToggleAccessibility(self.view, enabled); + _shell->GetPlatformView()->SetSemanticsEnabled(enabled); } #pragma mark - Memory Notifications @@ -875,46 +914,50 @@ - (void)sendOnChannel:(NSString*)channel message:(NSData*)message binaryReply:(FlutterBinaryReply)callback { NSAssert(channel, @"The channel must not be null"); - fxl::RefPtr response = + fxl::RefPtr response = (callback == nil) ? nullptr - : fxl::MakeRefCounted(^(NSData* reply) { - callback(reply); - }); + : fxl::MakeRefCounted( + ^(NSData* reply) { + callback(reply); + }, + _shell->GetTaskRunners().GetPlatformTaskRunner()); fxl::RefPtr platformMessage = (message == nil) ? fxl::MakeRefCounted(channel.UTF8String, response) : fxl::MakeRefCounted( channel.UTF8String, shell::GetVectorFromNSData(message), response); - _platformView->DispatchPlatformMessage(platformMessage); + + _shell->GetPlatformView()->DispatchPlatformMessage(platformMessage); } - (void)setMessageHandlerOnChannel:(NSString*)channel binaryMessageHandler:(FlutterBinaryMessageHandler)handler { NSAssert(channel, @"The channel must not be null"); - _platformView->platform_message_router().SetMessageHandler(channel.UTF8String, handler); + [self iosPlatformView] -> GetPlatformMessageRouter().SetMessageHandler(channel.UTF8String, + handler); } #pragma mark - FlutterTextureRegistry - (int64_t)registerTexture:(NSObject*)texture { int64_t textureId = _nextTextureId++; - _platformView->RegisterExternalTexture(textureId, texture); + [self iosPlatformView] -> RegisterExternalTexture(textureId, texture); return textureId; } - (void)unregisterTexture:(int64_t)textureId { - _platformView->UnregisterTexture(textureId); + _shell->GetPlatformView()->UnregisterTexture(textureId); } - (void)textureFrameAvailable:(int64_t)textureId { - _platformView->MarkTextureFrameAvailable(textureId); + _shell->GetPlatformView()->MarkTextureFrameAvailable(textureId); } - (NSString*)lookupKeyForAsset:(NSString*)asset { - return [FlutterDartProject lookupKeyForAsset:asset]; + return [FlutterDartProject lookupKeyForAsset:asset]; } - (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { - return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; + return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h new file mode 100644 index 0000000000000..482379c8f17eb --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h @@ -0,0 +1,17 @@ +// Copyright 2017 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ + +#include "flutter/shell/common/shell.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" + +@interface FlutterViewController () + +- (shell::Shell&)shell; + +@end + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_ diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 3f96f37a9c2db..6a545b95e4276 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -427,7 +427,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { weak_factory_(this) { accessibility_channel_.reset([[FlutterBasicMessageChannel alloc] initWithName:@"flutter/accessibility" - binaryMessenger:platform_view->binary_messenger() + binaryMessenger:platform_view->GetOwnerViewController() codec:[FlutterStandardMessageCodec sharedInstance]]); [accessibility_channel_.get() setMessageHandler:^(id message, FlutterReply reply) { HandleEvent((NSDictionary*)message); @@ -440,7 +440,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { } UIView* AccessibilityBridge::textInputView() { - return [platform_view_->text_input_plugin() textInputView]; + return [platform_view_->GetTextInputPlugin() textInputView]; } void AccessibilityBridge::UpdateSemantics(blink::SemanticsNodeUpdates nodes) { diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h deleted file mode 100644 index f2e54dd2c2806..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ -#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ - -#include "lib/fxl/macros.h" - -namespace shell { - -/// Initializes the Flutter shell. This must be called before interacting with -/// the engine in any way. It is safe to call this method multiple times. -void FlutterMain(); - -} // namespace shell - -#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTER_MAIN_IOS_H_ diff --git a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm b/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm deleted file mode 100644 index aa7ad5fd85727..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h" - -#include "flutter/shell/platform/darwin/common/platform_mac.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" - -namespace shell { - -void FlutterMain() { - NSBundle* bundle = [NSBundle bundleForClass:[FlutterViewController class]]; - NSString* icuDataPath = [bundle pathForResource:@"icudtl" ofType:@"dat"]; - NSString* libraryName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTLibraryPath"]; - - NSBundle* mainBundle = [NSBundle mainBundle]; - NSString* flutterAssetsPath = [FlutterDartProject pathForFlutterAssetsFromBundle:mainBundle]; - - shell::PlatformMacMain(icuDataPath.UTF8String, libraryName != nil ? libraryName.UTF8String : "", - flutterAssetsPath.UTF8String); -} - -} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h new file mode 100644 index 0000000000000..b861c5036e97d --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h @@ -0,0 +1,50 @@ +// Copyright 2018 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_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ +#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ + +#include + +#include "flutter/fml/platform/darwin/scoped_block.h" +#include "flutter/fml/task_runner.h" +#include "flutter/lib/ui/window/platform_message_response.h" +#include "flutter/shell/platform/darwin/common/buffer_conversions.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/macros.h" + +typedef void (^PlatformMessageResponseCallback)(NSData*); + +namespace shell { + +class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { + public: + void Complete(std::vector data) override { + fxl::RefPtr self(this); + platform_task_runner_->PostTask(fxl::MakeCopyable([self, data = std::move(data)]() mutable { + self->callback_.get()(shell::GetNSDataFromVector(data)); + })); + } + + void CompleteEmpty() override { + fxl::RefPtr self(this); + platform_task_runner_->PostTask( + fxl::MakeCopyable([self]() mutable { self->callback_.get()(nil); })); + } + + private: + explicit PlatformMessageResponseDarwin(PlatformMessageResponseCallback callback, + fxl::RefPtr platform_task_runner) + : callback_(callback, fml::OwnershipPolicy::Retain), + platform_task_runner_(std::move(platform_task_runner)) {} + + fml::ScopedBlock callback_; + fxl::RefPtr platform_task_runner_; + + FRIEND_MAKE_REF_COUNTED(PlatformMessageResponseDarwin); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_PLATFORM_MESSAGE_RESPONSE_DARWIN_H_ diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm new file mode 100644 index 0000000000000..8590b4e36942b --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm @@ -0,0 +1,11 @@ +// Copyright 2018 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/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" + +namespace shell { + +// + +} // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.h b/shell/platform/darwin/ios/framework/Source/platform_message_router.h index cfa91c04771c3..d2488f82fe47c 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.h +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.h @@ -7,6 +7,7 @@ #include +#include "flutter/fml/platform/darwin/scoped_block.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterBinaryMessenger.h" #include "lib/fxl/memory/weak_ptr.h" @@ -18,13 +19,13 @@ class PlatformMessageRouter { PlatformMessageRouter(); ~PlatformMessageRouter(); - void HandlePlatformMessage(fxl::RefPtr message); + void HandlePlatformMessage(fxl::RefPtr message) const; void SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler); private: - std::unordered_map + std::unordered_map> message_handlers_; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformMessageRouter); diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm index 70625143b623e..3ab75bff522f8 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm @@ -14,7 +14,8 @@ PlatformMessageRouter::~PlatformMessageRouter() = default; -void PlatformMessageRouter::HandlePlatformMessage(fxl::RefPtr message) { +void PlatformMessageRouter::HandlePlatformMessage( + fxl::RefPtr message) const { fxl::RefPtr completer = message->response(); auto it = message_handlers_.find(message->channel()); if (it != message_handlers_.end()) { @@ -41,14 +42,10 @@ void PlatformMessageRouter::SetMessageHandler(const std::string& channel, FlutterBinaryMessageHandler handler) { - if (handler) - message_handlers_[channel] = [handler copy]; - else { - auto it = message_handlers_.find(channel); - if (it != message_handlers_.end()) { - [it->second release]; - message_handlers_.erase(it); - } + message_handlers_.erase(channel); + if (handler) { + message_handlers_[channel] = + fml::ScopedBlock{handler, fml::OwnershipPolicy::Retain}; } } diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h index 6a3362b215667..23aaf02510d6d 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h @@ -5,27 +5,26 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_VSYNC_WAITER_IOS_H_ +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" -#if __OBJC__ @class VSyncClient; -#else // __OBJC__ -class VSyncClient; -#endif // __OBJC__ namespace shell { -class VsyncWaiterIOS : public VsyncWaiter { +class VsyncWaiterIOS final : public VsyncWaiter { public: - VsyncWaiterIOS(); - ~VsyncWaiterIOS() override; + VsyncWaiterIOS(blink::TaskRunners task_runners); - void AsyncWaitForVsync(Callback callback) override; + ~VsyncWaiterIOS() override; private: - Callback callback_; - VSyncClient* client_; + fml::scoped_nsobject client_; + + // |shell::VsyncWaiter| + void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterIOS); }; diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm index 78d6678189123..4589368acd3fb 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm @@ -10,29 +10,62 @@ #include #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/logging.h" @interface VSyncClient : NSObject +- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner + callback:(shell::VsyncWaiter::Callback)callback; + +- (void)await; + +- (void)invalidate; + @end +namespace shell { + +VsyncWaiterIOS::VsyncWaiterIOS(blink::TaskRunners task_runners) + : VsyncWaiter(std::move(task_runners)), + client_([[VSyncClient alloc] initWithTaskRunner:task_runners_.GetUITaskRunner() + callback:std::bind(&VsyncWaiterIOS::FireCallback, + this, + std::placeholders::_1, + std::placeholders::_2)]) {} + +VsyncWaiterIOS::~VsyncWaiterIOS() { + // This way, we will get no more callbacks from the display link that holds a weak (non-nilling) + // reference to this C++ object. + [client_.get() invalidate]; +} + +void VsyncWaiterIOS::AwaitVSync() { + [client_.get() await]; +} + +} // namespace shell + @implementation VSyncClient { - CADisplayLink* _displayLink; - shell::VsyncWaiter::Callback _pendingCallback; + shell::VsyncWaiter::Callback callback_; + fml::scoped_nsobject display_link_; } -- (instancetype)init { +- (instancetype)initWithTaskRunner:(fxl::RefPtr)task_runner + callback:(shell::VsyncWaiter::Callback)callback { self = [super init]; if (self) { - _displayLink = - [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain]; - _displayLink.paused = YES; - - blink::Threads::UI()->PostTask([client = [self retain]]() { - [client->_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; + callback_ = std::move(callback); + display_link_ = fml::scoped_nsobject { + [[CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)] retain] + }; + display_link_.get().paused = YES; + + task_runner->PostTask([client = [self retain]]() { + [client->display_link_.get() addToRunLoop:[NSRunLoop currentRunLoop] + forMode:NSRunLoopCommonModes]; [client release]; }); } @@ -40,68 +73,28 @@ - (instancetype)init { return self; } -- (void)await:(shell::VsyncWaiter::Callback)callback { - FXL_DCHECK(!_pendingCallback); - _pendingCallback = std::move(callback); - _displayLink.paused = NO; +- (void)await { + display_link_.get().paused = NO; } - (void)onDisplayLink:(CADisplayLink*)link { fxl::TimePoint frame_start_time = fxl::TimePoint::Now(); fxl::TimePoint frame_target_time = frame_start_time + fxl::TimeDelta::FromSecondsF(link.duration); - _displayLink.paused = YES; - - // Note: The tag name must be "VSYNC" (it is special) so that the "Highlight - // Vsync" checkbox in the timeline can be enabled. - // See: https://github.com/catapult-project/catapult/blob/2091404475cbba9b786 - // 442979b6ec631305275a6/tracing/tracing/extras/vsync/vsync_auditor.html#L26 -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE - TRACE_EVENT1("flutter", "VSYNC", "mode", "basic"); -#else - { - fxl::TimeDelta delta = frame_target_time.ToEpochDelta(); - constexpr size_t num_chars = sizeof(int64_t) * CHAR_BIT * 3.4 + 2; - char deadline[num_chars]; - sprintf(deadline, "%lld", delta.ToMicroseconds()); - TRACE_EVENT2("flutter", "VSYNC", "mode", "basic", "deadline", deadline); - } -#endif - - // Note: Even though we know we are on the UI thread already (since the - // display link was scheduled on the UI thread in the contructor), we use - // the PostTask mechanism because the callback may have side-effects that need - // to be addressed via a task observer. Invoking the callback by itself - // bypasses such task observers. - // - // We are not using the PostTask for thread switching, but to make task - // observers work. - blink::Threads::UI()->PostTask([ - callback = _pendingCallback, frame_start_time, frame_target_time - ]() { callback(frame_start_time, frame_target_time); }); - - _pendingCallback = nullptr; + display_link_.get().paused = YES; + + callback_(frame_start_time, frame_target_time); +} + +- (void)invalidate { + // [CADisplayLink invalidate] is thread-safe. + [display_link_.get() invalidate]; } - (void)dealloc { - [_displayLink invalidate]; - [_displayLink release]; + [self invalidate]; [super dealloc]; } @end - -namespace shell { - -VsyncWaiterIOS::VsyncWaiterIOS() : client_([[VSyncClient alloc] init]) {} - -VsyncWaiterIOS::~VsyncWaiterIOS() { - [client_ release]; -} - -void VsyncWaiterIOS::AsyncWaitForVsync(Callback callback) { - [client_ await:callback]; -} - -} // namespace shell diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.h b/shell/platform/darwin/ios/ios_external_texture_gl.h index a658fdf31628a..baedf298bd61d 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.h +++ b/shell/platform/darwin/ios/ios_external_texture_gl.h @@ -25,6 +25,8 @@ class IOSExternalTextureGL : public flow::Texture { virtual void OnGrContextDestroyed() override; + virtual void MarkNewFrameAvailable() override; + private: NSObject* external_texture_; fml::CFRef cache_ref_; diff --git a/shell/platform/darwin/ios/ios_external_texture_gl.mm b/shell/platform/darwin/ios/ios_external_texture_gl.mm index 2cc9721e7f09a..0bd9a8ca3c7cb 100644 --- a/shell/platform/darwin/ios/ios_external_texture_gl.mm +++ b/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -4,11 +4,10 @@ #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" -#include +#import #import #import -#include "flutter/common/threads.h" -#include "flutter/lib/ui/painting/resource_context.h" + #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" @@ -26,7 +25,6 @@ IOSExternalTextureGL::~IOSExternalTextureGL() = default; void IOSExternalTextureGL::Paint(SkCanvas& canvas, const SkRect& bounds) { - ASSERT_IS_GPU_THREAD; if (!cache_ref_) { CVOpenGLESTextureCacheRef cache; CVReturn err = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, @@ -57,10 +55,8 @@ return; } GrGLTextureInfo textureInfo = {CVOpenGLESTextureGetTarget(texture_ref_), - CVOpenGLESTextureGetName(texture_ref_), - GL_RGBA8_OES}; - GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, - textureInfo); + CVOpenGLESTextureGetName(texture_ref_), GL_RGBA8_OES}; + GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kNo, textureInfo); sk_sp image = SkImage::MakeFromTexture(canvas.getGrContext(), backendTexture, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr); @@ -69,14 +65,13 @@ GrBackendTexture backendTexture(bounds.width(), bounds.height(), GrMipMapped::kN } } -void IOSExternalTextureGL::OnGrContextCreated() { - ASSERT_IS_GPU_THREAD -} +void IOSExternalTextureGL::OnGrContextCreated() {} void IOSExternalTextureGL::OnGrContextDestroyed() { - ASSERT_IS_GPU_THREAD texture_ref_.Reset(nullptr); cache_ref_.Reset(nullptr); } +void IOSExternalTextureGL::MarkNewFrameAvailable() {} + } // namespace shell diff --git a/shell/platform/darwin/ios/ios_gl_context.h b/shell/platform/darwin/ios/ios_gl_context.h index 89ad7e0347eac..f42c1436461b1 100644 --- a/shell/platform/darwin/ios/ios_gl_context.h +++ b/shell/platform/darwin/ios/ios_gl_context.h @@ -18,7 +18,7 @@ namespace shell { class IOSGLContext { public: - IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer); + IOSGLContext(fml::scoped_nsobject layer); ~IOSGLContext(); diff --git a/shell/platform/darwin/ios/ios_gl_context.mm b/shell/platform/darwin/ios/ios_gl_context.mm index de94018d0689e..77a124e64a291 100644 --- a/shell/platform/darwin/ios/ios_gl_context.mm +++ b/shell/platform/darwin/ios/ios_gl_context.mm @@ -3,21 +3,17 @@ // found in the LICENSE file. #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" -#include "third_party/skia/include/gpu/GrContextOptions.h" -#include "third_party/skia/include/gpu/gl/GrGLInterface.h" #include -namespace shell { +#include "flutter/fml/trace_event.h" +#include "third_party/skia/include/gpu/GrContextOptions.h" +#include "third_party/skia/include/gpu/gl/GrGLInterface.h" -#define VERIFY(x) \ - if (!(x)) { \ - FXL_DLOG(ERROR) << "Failed: " #x; \ - return; \ - }; +namespace shell { -IOSGLContext::IOSGLContext(PlatformView::SurfaceConfig config, CAEAGLLayer* layer) - : layer_([layer retain]), +IOSGLContext::IOSGLContext(fml::scoped_nsobject layer) + : layer_(std::move(layer)), context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]), resource_context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:context_.get().sharegroup]), @@ -26,34 +22,34 @@ storage_size_width_(0), storage_size_height_(0), valid_(false) { - VERIFY(layer_ != nullptr); - VERIFY(context_ != nullptr); - VERIFY(resource_context_ != nullptr); + FXL_DCHECK(layer_ != nullptr); + FXL_DCHECK(context_ != nullptr); + FXL_DCHECK(resource_context_ != nullptr); bool context_current = [EAGLContext setCurrentContext:context_]; - VERIFY(context_current); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(context_current); + FXL_DCHECK(glGetError() == GL_NO_ERROR); // Generate the framebuffer glGenFramebuffers(1, &framebuffer_); - VERIFY(glGetError() == GL_NO_ERROR); - VERIFY(framebuffer_ != GL_NONE); + FXL_DCHECK(glGetError() == GL_NO_ERROR); + FXL_DCHECK(framebuffer_ != GL_NONE); glBindFramebuffer(GL_FRAMEBUFFER, framebuffer_); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(glGetError() == GL_NO_ERROR); // Setup color attachment glGenRenderbuffers(1, &colorbuffer_); - VERIFY(colorbuffer_ != GL_NONE); + FXL_DCHECK(colorbuffer_ != GL_NONE); glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(glGetError() == GL_NO_ERROR); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorbuffer_); - VERIFY(glGetError() == GL_NO_ERROR); + FXL_DCHECK(glGetError() == GL_NO_ERROR); // TODO: // iOS displays are more variable than just P3 or sRGB. Reading the display @@ -139,24 +135,12 @@ return false; } - GLint width = 0; - GLint height = 0; - - if (colorbuffer_ != GL_NONE) { - // Fetch the dimensions of the color buffer whose backing was just updated - // so that backing of the attachments can be updated - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - - glBindRenderbuffer(GL_RENDERBUFFER, colorbuffer_); - FXL_DCHECK(glGetError() == GL_NO_ERROR); - } + // Fetch the dimensions of the color buffer whose backing was just updated. + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &storage_size_width_); + FXL_DCHECK(glGetError() == GL_NO_ERROR); - storage_size_width_ = width; - storage_size_height_ = height; + glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &storage_size_height_); + FXL_DCHECK(glGetError() == GL_NO_ERROR); FXL_DCHECK(glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); diff --git a/shell/platform/darwin/ios/ios_surface.h b/shell/platform/darwin/ios/ios_surface.h index c164fab15500e..b629c2709e3d1 100644 --- a/shell/platform/darwin/ios/ios_surface.h +++ b/shell/platform/darwin/ios/ios_surface.h @@ -5,25 +5,17 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_H_ +#include + #include "flutter/fml/platform/darwin/scoped_nsobject.h" -#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/surface.h" #include "lib/fxl/macros.h" -@class CALayer; - namespace shell { class IOSSurface { public: - static std::unique_ptr Create( - PlatformView::SurfaceConfig surface_config, - CALayer* layer); - - IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer); - - CALayer* GetLayer() const; - - PlatformView::SurfaceConfig GetSurfaceConfig() const; + IOSSurface(); virtual ~IOSSurface(); @@ -36,9 +28,6 @@ class IOSSurface { virtual std::unique_ptr CreateGPUSurface() = 0; public: - PlatformView::SurfaceConfig surface_config_; - fml::scoped_nsobject layer_; - FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurface); }; diff --git a/shell/platform/darwin/ios/ios_surface.mm b/shell/platform/darwin/ios/ios_surface.mm index 91067838330f6..b0b9cc3245183 100644 --- a/shell/platform/darwin/ios/ios_surface.mm +++ b/shell/platform/darwin/ios/ios_surface.mm @@ -4,40 +4,15 @@ #include "flutter/shell/platform/darwin/ios/ios_surface.h" -#include -#include #include -@class CALayer; -@class CAEAGLLayer; +#include +#include namespace shell { -std::unique_ptr IOSSurface::Create(PlatformView::SurfaceConfig surface_config, - CALayer* layer) { - // Check if we can use OpenGL. - if ([layer isKindOfClass:[CAEAGLLayer class]]) { - return std::make_unique(surface_config, reinterpret_cast(layer)); - } - - // If we ever support the metal rendering API, a check for CAMetalLayer would - // go here. - - // Finally, fallback to software rendering. - return std::make_unique(surface_config, layer); -} - -IOSSurface::IOSSurface(PlatformView::SurfaceConfig surface_config, CALayer* layer) - : surface_config_(surface_config), layer_([layer retain]) {} +IOSSurface::IOSSurface() = default; IOSSurface::~IOSSurface() = default; -CALayer* IOSSurface::GetLayer() const { - return layer_; -} - -PlatformView::SurfaceConfig IOSSurface::GetSurfaceConfig() const { - return surface_config_; -} - } // namespace shell diff --git a/shell/platform/darwin/ios/ios_surface_gl.h b/shell/platform/darwin/ios/ios_surface_gl.h index f7e43e2588984..7486d343eb0fd 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.h +++ b/shell/platform/darwin/ios/ios_surface_gl.h @@ -5,6 +5,7 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_GL_H_ +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_gl.h" #include "flutter/shell/platform/darwin/ios/ios_gl_context.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" @@ -16,7 +17,7 @@ namespace shell { class IOSSurfaceGL : public IOSSurface, public GPUSurfaceGLDelegate { public: - IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer); + IOSSurfaceGL(fml::scoped_nsobject layer); ~IOSSurfaceGL() override; diff --git a/shell/platform/darwin/ios/ios_surface_gl.mm b/shell/platform/darwin/ios/ios_surface_gl.mm index 60756d6094fc9..253531c4800aa 100644 --- a/shell/platform/darwin/ios/ios_surface_gl.mm +++ b/shell/platform/darwin/ios/ios_surface_gl.mm @@ -4,13 +4,12 @@ #include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" +#include "flutter/fml/trace_event.h" #include "flutter/shell/gpu/gpu_surface_gl.h" namespace shell { -IOSSurfaceGL::IOSSurfaceGL(PlatformView::SurfaceConfig surface_config, CAEAGLLayer* layer) - : IOSSurface(surface_config, reinterpret_cast(layer)), - context_(surface_config, layer) {} +IOSSurfaceGL::IOSSurfaceGL(fml::scoped_nsobject layer) : context_(std::move(layer)) {} IOSSurfaceGL::~IOSSurfaceGL() = default; diff --git a/shell/platform/darwin/ios/ios_surface_software.h b/shell/platform/darwin/ios/ios_surface_software.h index 7e3f264b28ce6..e8fc332f06c8c 100644 --- a/shell/platform/darwin/ios/ios_surface_software.h +++ b/shell/platform/darwin/ios/ios_surface_software.h @@ -5,17 +5,19 @@ #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ #define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_IOS_SURFACE_SOFTWARE_H_ +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/gpu/gpu_surface_software.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/macros.h" +@class CALayer; + namespace shell { -class IOSSurfaceSoftware : public IOSSurface, - public GPUSurfaceSoftwareDelegate { +class IOSSurfaceSoftware final : public IOSSurface, + public GPUSurfaceSoftwareDelegate { public: - IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, - CALayer* layer); + IOSSurfaceSoftware(fml::scoped_nsobject layer); ~IOSSurfaceSoftware() override; @@ -32,6 +34,7 @@ class IOSSurfaceSoftware : public IOSSurface, bool PresentBackingStore(sk_sp backing_store) override; private: + fml::scoped_nsobject layer_; sk_sp sk_surface_; FXL_DISALLOW_COPY_AND_ASSIGN(IOSSurfaceSoftware); diff --git a/shell/platform/darwin/ios/ios_surface_software.mm b/shell/platform/darwin/ios/ios_surface_software.mm index 9a4e90e45dfba..b09a5d9a2d8a3 100644 --- a/shell/platform/darwin/ios/ios_surface_software.mm +++ b/shell/platform/darwin/ios/ios_surface_software.mm @@ -15,15 +15,15 @@ namespace shell { -IOSSurfaceSoftware::IOSSurfaceSoftware(PlatformView::SurfaceConfig surface_config, CALayer* layer) - : IOSSurface(surface_config, layer) { +IOSSurfaceSoftware::IOSSurfaceSoftware(fml::scoped_nsobject layer) + : layer_(std::move(layer)) { UpdateStorageSizeIfNecessary(); } IOSSurfaceSoftware::~IOSSurfaceSoftware() = default; bool IOSSurfaceSoftware::IsValid() const { - return GetLayer() != nullptr; + return layer_; } bool IOSSurfaceSoftware::ResourceContextMakeCurrent() { @@ -120,8 +120,7 @@ return false; } - CALayer* layer = GetLayer(); - layer.contents = reinterpret_cast(static_cast(pixmap_image)); + layer_.get().contents = reinterpret_cast(static_cast(pixmap_image)); return true; } diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index dab19a0f9ce1a..e7849dda44641 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -8,95 +8,66 @@ #include #include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterTexture.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h" #include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" -@class CALayer; -@class UIView; - namespace shell { -class PlatformViewIOS : public PlatformView { +class PlatformViewIOS final : public PlatformView { public: - explicit PlatformViewIOS(CALayer* layer, - NSObject* binaryMessenger); + explicit PlatformViewIOS(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + FlutterViewController* owner_controller_, + FlutterView* owner_view_); ~PlatformViewIOS() override; - void Attach() override; - - void Attach(fxl::Closure firstFrameCallback); - - void NotifyCreated(); - - void ToggleAccessibility(UIView* view, bool enabled); - - PlatformMessageRouter& platform_message_router() { - return platform_message_router_; - } - - fml::WeakPtr GetWeakPtr(); - - void UpdateSurfaceSize(); + PlatformMessageRouter& GetPlatformMessageRouter(); - VsyncWaiter* GetVsyncWaiter() override; - - bool ResourceContextMakeCurrent() override; - - void HandlePlatformMessage( - fxl::RefPtr message) override; + FlutterViewController* GetOwnerViewController() const; void RegisterExternalTexture(int64_t id, NSObject* texture); - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; + fml::scoped_nsprotocol GetTextInputPlugin() const; - void SetAssetBundlePath(const std::string& assets_directory) override; - - /** - * Exposes the `FlutterTextInputPlugin` singleton for the - * `AccessibilityBridge` to be able to interact with the text entry system. - */ - fml::scoped_nsprotocol text_input_plugin() { - return text_input_plugin_; - } - - /** - * Sets the `FlutterTextInputPlugin` singleton returned by - * `text_input_plugin`. - */ void SetTextInputPlugin( - fml::scoped_nsprotocol textInputPlugin) { - text_input_plugin_ = textInputPlugin; - } - - NSObject* binary_messenger() const { - return binary_messenger_; - } + fml::scoped_nsprotocol plugin); private: + FlutterViewController* owner_controller_; // weak reference. + FlutterView* owner_view_; // weak reference. std::unique_ptr ios_surface_; PlatformMessageRouter platform_message_router_; std::unique_ptr accessibility_bridge_; - fxl::Closure firstFrameCallback_; - fml::WeakPtrFactory weak_factory_; - NSObject* binary_messenger_; fml::scoped_nsprotocol text_input_plugin_; + fxl::Closure firstFrameCallback_; + + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; - void SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages); + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; + + // |shell::PlatformView| + void SetSemanticsEnabled(bool enabled) override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; + + // |shell::PlatformView| + void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - void SetAssetBundlePathOnUI(const std::string& assets_directory); + // |shell::PlatformView| + std::unique_ptr CreateVSyncWaiter() override; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewIOS); }; diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index 19c5dd4e663a1..1fba8e5e026e5 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -8,135 +8,92 @@ #include -#include "flutter/common/threads.h" +#include "flutter/common/task_runners.h" #include "flutter/fml/trace_event.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" -#include "flutter/shell/platform/darwin/common/process_info_mac.h" +#include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" #include "lib/fxl/synchronization/waitable_event.h" namespace shell { -PlatformViewIOS::PlatformViewIOS(CALayer* layer, NSObject* binaryMessenger) - : PlatformView(std::make_unique(std::make_unique())), - ios_surface_(IOSSurface::Create(surface_config_, layer)), - weak_factory_(this), - binary_messenger_(binaryMessenger) {} - -PlatformViewIOS::~PlatformViewIOS() = default; - -void PlatformViewIOS::Attach() { - Attach(NULL); +PlatformViewIOS::PlatformViewIOS(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + FlutterViewController* owner_controller, + FlutterView* owner_view) + : PlatformView(delegate, std::move(task_runners)), + owner_controller_(owner_controller), + owner_view_(owner_view), + ios_surface_(owner_view_.createSurface) { + FXL_DCHECK(ios_surface_ != nullptr); + FXL_DCHECK(owner_controller_ != nullptr); + FXL_DCHECK(owner_view_ != nullptr); } -void PlatformViewIOS::Attach(fxl::Closure firstFrameCallback) { - CreateEngine(); - - if (firstFrameCallback) { - firstFrameCallback_ = firstFrameCallback; - rasterizer_->AddNextFrameCallback([weakSelf = GetWeakPtr()] { - if (weakSelf) { - weakSelf->firstFrameCallback_(); - weakSelf->firstFrameCallback_ = nullptr; - } - }); - } -} +PlatformViewIOS::~PlatformViewIOS() = default; -void PlatformViewIOS::NotifyCreated() { - PlatformView::NotifyCreated(ios_surface_->CreateGPUSurface()); +FlutterViewController* PlatformViewIOS::GetOwnerViewController() const { + return owner_controller_; } -void PlatformViewIOS::ToggleAccessibility(UIView* view, bool enabled) { - if (enabled) { - if (!accessibility_bridge_) { - accessibility_bridge_.reset(new shell::AccessibilityBridge(view, this)); - } - } else { - accessibility_bridge_ = nullptr; - } - SetSemanticsEnabled(enabled); +PlatformMessageRouter& PlatformViewIOS::GetPlatformMessageRouter() { + return platform_message_router_; } -void PlatformViewIOS::SetupAndLoadFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - blink::Threads::UI()->PostTask( - [ engine = engine().GetWeakPtr(), assets_directory, main, packages ] { - if (engine) - engine->RunBundleAndSource(assets_directory, main, packages); - }); +void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, + NSObject* texture) { + RegisterTexture(std::make_shared(texture_id, texture)); } -void PlatformViewIOS::SetAssetBundlePathOnUI(const std::string& assets_directory) { - blink::Threads::UI()->PostTask([ engine = engine().GetWeakPtr(), assets_directory ] { - if (engine) - engine->SetAssetBundlePath(assets_directory); - }); +// |shell::PlatformView| +std::unique_ptr PlatformViewIOS::CreateRenderingSurface() { + return ios_surface_->CreateGPUSurface(); } -fml::WeakPtr PlatformViewIOS::GetWeakPtr() { - return weak_factory_.GetWeakPtr(); -} +// |shell::PlatformView| +sk_sp PlatformViewIOS::CreateResourceContext() const { + if (!ios_surface_->ResourceContextMakeCurrent()) { + FXL_DLOG(INFO) << "Could not make resource context current on IO thread. Async texture uploads " + "will be disabled."; + return nullptr; + } -void PlatformViewIOS::UpdateSurfaceSize() { - blink::Threads::Gpu()->PostTask([self = GetWeakPtr()]() { - if (self && self->ios_surface_ != nullptr) { - self->ios_surface_->UpdateStorageSizeIfNecessary(); - } - }); + return IOManager::CreateCompatibleResourceLoadingContext(GrBackend::kOpenGL_GrBackend); } -VsyncWaiter* PlatformViewIOS::GetVsyncWaiter() { - if (!vsync_waiter_) { - vsync_waiter_ = std::make_unique(); +// |shell::PlatformView| +void PlatformViewIOS::SetSemanticsEnabled(bool enabled) { + if (enabled && !accessibility_bridge_) { + accessibility_bridge_ = std::make_unique(owner_view_, this); + } else { + accessibility_bridge_.reset(); } - return vsync_waiter_.get(); -} - -bool PlatformViewIOS::ResourceContextMakeCurrent() { - return ios_surface_ != nullptr ? ios_surface_->ResourceContextMakeCurrent() : false; + PlatformView::SetSemanticsEnabled(enabled); } +// |shell::PlatformView| void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update) { - if (accessibility_bridge_) + if (accessibility_bridge_) { accessibility_bridge_->UpdateSemantics(std::move(update)); + } } +// |shell::PlatformView| void PlatformViewIOS::HandlePlatformMessage(fxl::RefPtr message) { platform_message_router_.HandlePlatformMessage(std::move(message)); } -void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, - NSObject* texture) { - RegisterTexture(std::make_shared(texture_id, texture)); +// |shell::PlatformView| +std::unique_ptr PlatformViewIOS::CreateVSyncWaiter() { + return std::make_unique(task_runners_); } -void PlatformViewIOS::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetupAndLoadFromSource(assets_directory, main, packages); - latch->Signal(); - }); - - latch->Wait(); - delete latch; +fml::scoped_nsprotocol PlatformViewIOS::GetTextInputPlugin() const { + return text_input_plugin_; } -void PlatformViewIOS::SetAssetBundlePath(const std::string& assets_directory) { - auto latch = new fxl::ManualResetWaitableEvent(); - - dispatch_async(dispatch_get_main_queue(), ^{ - SetAssetBundlePathOnUI(assets_directory); - latch->Signal(); - }); - - latch->Wait(); - delete latch; +void PlatformViewIOS::SetTextInputPlugin(fml::scoped_nsprotocol plugin) { + text_input_plugin_ = plugin; } } // namespace shell diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 7ce6f7e8d5be1..b1e0b3e4f3b71 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -4,16 +4,21 @@ import("$flutter_root/testing/testing.gni") -source_set("embedder") { +static_library("embedder") { + complete_static_lib = true + sources = [ "embedder.cc", "embedder.h", + "embedder_engine.cc", + "embedder_engine.h", "embedder_include.c", "platform_view_embedder.cc", "platform_view_embedder.h", ] deps = [ + "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/shell/common", @@ -22,6 +27,7 @@ source_set("embedder") { "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", + "//third_party/skia:gpu", "//topaz/lib/tonic", ] diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 866413cbc077b..a7ee807934663 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -2,14 +2,30 @@ // 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 "lib/fxl/build_config.h" + +#if OS_WIN +#define FLUTTER_EXPORT __declspec(dllexport) +#else // OS_WIN #define FLUTTER_EXPORT __attribute__((visibility("default"))) +#endif // OS_WIN #include "flutter/shell/platform/embedder/embedder.h" #include -#include "flutter/common/threads.h" + +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/common/task_runners.h" +#include "flutter/fml/file.h" #include "flutter/fml/message_loop.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/platform/embedder/embedder.h" +#include "flutter/shell/platform/embedder/embedder_engine.h" #include "flutter/shell/platform/embedder/platform_view_embedder.h" +#include "lib/fxl/command_line.h" #include "lib/fxl/functional/make_copyable.h" #define SAFE_ACCESS(pointer, member, default_value) \ @@ -41,21 +57,6 @@ bool IsRendererValid(const FlutterRendererConfig* config) { return true; } -class PlatformViewHolder { - public: - PlatformViewHolder(std::shared_ptr ptr) - : platform_view_(std::move(ptr)) {} - - std::shared_ptr view() const { - return platform_view_; - } - - private: - std::shared_ptr platform_view_; - - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewHolder); -}; - struct _FlutterPlatformMessageResponseHandle { fxl::RefPtr message; }; @@ -65,6 +66,7 @@ FlutterResult FlutterEngineRun(size_t version, const FlutterProjectArgs* args, void* user_data, FlutterEngine* engine_out) { + // Step 0: Figure out arguments for shell creation. if (version != FLUTTER_ENGINE_VERSION) { return kInvalidLibraryVersion; } @@ -87,51 +89,44 @@ FlutterResult FlutterEngineRun(size_t version, return kInvalidArguments; } - auto make_current = - [ ptr = config->open_gl.make_current, user_data ]()->bool { - return ptr(user_data); - }; + auto make_current = [ptr = config->open_gl.make_current, + user_data]() -> bool { return ptr(user_data); }; - auto clear_current = - [ ptr = config->open_gl.clear_current, user_data ]()->bool { - return ptr(user_data); - }; + auto clear_current = [ptr = config->open_gl.clear_current, + user_data]() -> bool { return ptr(user_data); }; - auto present = [ ptr = config->open_gl.present, user_data ]()->bool { + auto present = [ptr = config->open_gl.present, user_data]() -> bool { return ptr(user_data); }; - auto fbo_callback = - [ ptr = config->open_gl.fbo_callback, user_data ]()->intptr_t { - return ptr(user_data); - }; + auto fbo_callback = [ptr = config->open_gl.fbo_callback, + user_data]() -> intptr_t { return ptr(user_data); }; shell::PlatformViewEmbedder::PlatformMessageResponseCallback platform_message_response_callback = nullptr; if (SAFE_ACCESS(args, platform_message_callback, nullptr) != nullptr) { platform_message_response_callback = - [ ptr = args->platform_message_callback, - user_data ](fxl::RefPtr message) { - auto handle = new FlutterPlatformMessageResponseHandle(); - const FlutterPlatformMessage incoming_message = { - .struct_size = sizeof(FlutterPlatformMessage), - .channel = message->channel().c_str(), - .message = message->data().data(), - .message_size = message->data().size(), - .response_handle = handle, - }; - handle->message = std::move(message); - return ptr(&incoming_message, user_data); - }; + [ptr = args->platform_message_callback, + user_data](fxl::RefPtr message) { + auto handle = new FlutterPlatformMessageResponseHandle(); + const FlutterPlatformMessage incoming_message = { + .struct_size = sizeof(FlutterPlatformMessage), + .channel = message->channel().c_str(), + .message = message->data().data(), + .message_size = message->data().size(), + .response_handle = handle, + }; + handle->message = std::move(message); + return ptr(&incoming_message, user_data); + }; } const FlutterOpenGLRendererConfig* open_gl_config = &config->open_gl; std::function make_resource_current_callback = nullptr; if (SAFE_ACCESS(open_gl_config, make_resource_current, nullptr) != nullptr) { - make_resource_current_callback = - [ ptr = config->open_gl.make_resource_current, user_data ]() { - return ptr(user_data); - }; + make_resource_current_callback = [ptr = + config->open_gl.make_resource_current, + user_data]() { return ptr(user_data); }; } std::string icu_data_path; @@ -147,18 +142,33 @@ FlutterResult FlutterEngineRun(size_t version, SAFE_ACCESS(args, command_line_argv, nullptr)); } - static std::once_flag once_shell_initialization; - std::call_once(once_shell_initialization, [&]() { - fxl::CommandLine null_command_line; - shell::Shell::InitStandalone( - std::move(command_line), - icu_data_path, // icu data path default lookup. - "", // application library not supported in JIT mode. - args->assets_path - ); - }); - - shell::PlatformViewEmbedder::DispatchTable table = { + blink::Settings settings = shell::SettingsFromCommandLine(command_line); + settings.icu_data_path = icu_data_path; + settings.main_dart_file_path = args->main_path; + settings.packages_file_path = args->packages_path; + settings.assets_path = args->assets_path; + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + // Create a thread host with the current thread as the platform thread and all + // other threads managed. + shell::ThreadHost thread_host("io.flutter", shell::ThreadHost::Type::GPU | + shell::ThreadHost::Type::IO | + shell::ThreadHost::Type::UI); + fml::MessageLoop::EnsureInitializedForCurrentThread(); + blink::TaskRunners task_runners( + "io.flutter", + fml::MessageLoop::GetCurrent().GetTaskRunner(), // platform + thread_host.gpu_thread->GetTaskRunner(), // gpu + thread_host.ui_thread->GetTaskRunner(), // ui + thread_host.io_thread->GetTaskRunner() // io + ); + + shell::PlatformViewEmbedder::DispatchTable dispatch_table = { .gl_make_current_callback = make_current, .gl_clear_current_callback = clear_current, .gl_present_callback = present, @@ -167,31 +177,55 @@ FlutterResult FlutterEngineRun(size_t version, .gl_make_resource_current_callback = make_resource_current_callback, }; - auto platform_view = std::make_shared(table); - platform_view->Attach(); - - std::string assets(args->assets_path); - std::string main(args->main_path); - std::string packages(args->packages_path); - - blink::Threads::UI()->PostTask([ - weak_engine = platform_view->engine().GetWeakPtr(), // - assets = std::move(assets), // - main = std::move(main), // - packages = std::move(packages) // - ] { - if (auto engine = weak_engine) { - if (main.empty()) { - engine->RunBundle(assets); - } else { - engine->RunBundleAndSource(assets, main, packages); - } - } - }); - - *engine_out = reinterpret_cast( - new PlatformViewHolder(std::move(platform_view))); + shell::Shell::CreateCallback on_create_platform_view = + [dispatch_table](shell::Shell& shell) { + return std::make_unique( + shell, // delegate + shell.GetTaskRunners(), // task runners + dispatch_table // embedder dispatch table + ); + }; + + shell::Shell::CreateCallback on_create_rasterizer = + [](shell::Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + // Step 1: Create the engine. + auto embedder_engine = + std::make_unique(std::move(thread_host), // + std::move(task_runners), // + settings, // + on_create_platform_view, // + on_create_rasterizer // + ); + + if (!embedder_engine->IsValid()) { + return kInvalidArguments; + } + + // Step 2: Setup the rendering surface. + if (!embedder_engine->NotifyCreated()) { + return kInvalidArguments; + } + + // Step 3: Run the engine. + auto run_configuration = shell::RunConfiguration::InferFromSettings(settings); + + run_configuration.AddAssetResolver( + std::make_unique( + fml::Duplicate(settings.assets_dir))); + run_configuration.AddAssetResolver( + std::make_unique(fml::OpenFile( + settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); + + if (!embedder_engine->Run(std::move(run_configuration))) { + return kInvalidArguments; + } + + // Finally! Release the ownership of the embedder engine to the caller. + *engine_out = reinterpret_cast(embedder_engine.release()); return kSuccess; } @@ -199,7 +233,9 @@ FlutterResult FlutterEngineShutdown(FlutterEngine engine) { if (engine == nullptr) { return kInvalidArguments; } - delete reinterpret_cast(engine); + auto embedder_engine = reinterpret_cast(engine); + embedder_engine->NotifyDestroyed(); + delete embedder_engine; return kSuccess; } @@ -210,21 +246,16 @@ FlutterResult FlutterEngineSendWindowMetricsEvent( return kInvalidArguments; } - auto holder = reinterpret_cast(engine); - blink::ViewportMetrics metrics; metrics.physical_width = SAFE_ACCESS(flutter_metrics, width, 0.0); metrics.physical_height = SAFE_ACCESS(flutter_metrics, height, 0.0); metrics.device_pixel_ratio = SAFE_ACCESS(flutter_metrics, pixel_ratio, 1.0); - blink::Threads::UI()->PostTask( - [ weak_engine = holder->view()->engine().GetWeakPtr(), metrics ] { - if (auto engine = weak_engine) { - engine->SetViewportMetrics(metrics); - } - }); - return kSuccess; + return reinterpret_cast(engine)->SetViewportMetrics( + std::move(metrics)) + ? kSuccess + : kInvalidArguments; } inline blink::PointerData::Change ToPointerDataChange( @@ -267,19 +298,10 @@ FlutterResult FlutterEngineSendPointerEvent(FlutterEngine engine, reinterpret_cast(current) + current->struct_size); } - blink::Threads::UI()->PostTask(fxl::MakeCopyable([ - weak_engine = reinterpret_cast(engine) - ->view() - ->engine() - .GetWeakPtr(), - packet = std::move(packet) - ] { - if (auto engine = weak_engine) { - engine->DispatchPointerDataPacket(*packet); - } - })); - - return kSuccess; + return reinterpret_cast(engine) + ->DispatchPointerDataPacket(std::move(packet)) + ? kSuccess + : kInvalidArguments; } FlutterResult FlutterEngineSendPlatformMessage( @@ -294,8 +316,6 @@ FlutterResult FlutterEngineSendPlatformMessage( return kInvalidArguments; } - auto holder = reinterpret_cast(engine); - auto message = fxl::MakeRefCounted( flutter_message->channel, std::vector( @@ -303,13 +323,10 @@ FlutterResult FlutterEngineSendPlatformMessage( flutter_message->message + flutter_message->message_size), nullptr); - blink::Threads::UI()->PostTask( - [ weak_engine = holder->view()->engine().GetWeakPtr(), message ] { - if (auto engine = weak_engine) { - engine->DispatchPlatformMessage(message); - } - }); - return kSuccess; + return reinterpret_cast(engine)->SendPlatformMessage( + std::move(message)) + ? kSuccess + : kInvalidArguments; } FlutterResult FlutterEngineSendPlatformMessageResponse( diff --git a/shell/platform/embedder/embedder_engine.cc b/shell/platform/embedder/embedder_engine.cc new file mode 100644 index 0000000000000..7416441d7902e --- /dev/null +++ b/shell/platform/embedder/embedder_engine.cc @@ -0,0 +1,119 @@ +// Copyright 2017 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/shell/platform/embedder/embedder_engine.h" + +#include "lib/fxl/functional/make_copyable.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace shell { + +EmbedderEngine::EmbedderEngine( + ThreadHost thread_host, + blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) + : thread_host_(std::move(thread_host)), + shell_(Shell::Create(std::move(task_runners), + std::move(settings), + on_create_platform_view, + on_create_rasterizer)) { + is_valid_ = shell_ != nullptr; +} + +EmbedderEngine::~EmbedderEngine() = default; + +bool EmbedderEngine::IsValid() const { + return is_valid_; +} + +bool EmbedderEngine::NotifyCreated() { + if (!IsValid()) { + return false; + } + + shell_->GetPlatformView()->NotifyCreated(); + return true; +} + +bool EmbedderEngine::NotifyDestroyed() { + if (!IsValid()) { + return false; + } + + shell_->GetPlatformView()->NotifyDestroyed(); + return true; +} + +bool EmbedderEngine::Run(RunConfiguration run_configuration) { + if (!IsValid()) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = shell_->GetEngine(), // engine + config = std::move(run_configuration) // config + ]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch the engine with configuration."; + } + } + })); + + return true; +} + +bool EmbedderEngine::SetViewportMetrics(blink::ViewportMetrics metrics) { + if (!IsValid()) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), metrics = std::move(metrics)]() { + if (engine) { + engine->SetViewportMetrics(std::move(metrics)); + } + }); + return true; +} + +bool EmbedderEngine::DispatchPointerDataPacket( + std::unique_ptr packet) { + if (!IsValid() || !packet) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask(fxl::MakeCopyable( + [engine = shell_->GetEngine(), packet = std::move(packet)] { + if (engine) { + engine->DispatchPointerDataPacket(*packet); + } + })); + + return true; +} + +bool EmbedderEngine::SendPlatformMessage( + fxl::RefPtr message) { + if (!IsValid() || !message) { + return false; + } + + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( + [engine = shell_->GetEngine(), message] { + if (engine) { + engine->DispatchPlatformMessage(message); + } + }); + + return true; +} + +} // namespace shell diff --git a/shell/platform/embedder/embedder_engine.h b/shell/platform/embedder/embedder_engine.h new file mode 100644 index 0000000000000..c01b86c2aac47 --- /dev/null +++ b/shell/platform/embedder/embedder_engine.h @@ -0,0 +1,53 @@ +// Copyright 2017 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_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ +#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ + +#include + +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/thread_host.h" +#include "flutter/shell/platform/embedder/embedder.h" +#include "lib/fxl/macros.h" + +namespace shell { + +// The object that is returned to the embedder as an opaque pointer to the +// instance of the Flutter engine. +class EmbedderEngine { + public: + EmbedderEngine(ThreadHost thread_host, blink::TaskRunners task_runners, + blink::Settings settings, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer); + + ~EmbedderEngine(); + + bool NotifyCreated(); + + bool NotifyDestroyed(); + + bool Run(RunConfiguration run_configuration); + + bool IsValid() const; + + bool SetViewportMetrics(blink::ViewportMetrics metrics); + + bool DispatchPointerDataPacket( + std::unique_ptr packet); + + bool SendPlatformMessage(fxl::RefPtr message); + + private: + const ThreadHost thread_host_; + std::unique_ptr shell_; + bool is_valid_ = false; + + FXL_DISALLOW_COPY_AND_ASSIGN(EmbedderEngine); +}; + +} // namespace shell + +#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_ diff --git a/shell/platform/embedder/platform_view_embedder.cc b/shell/platform/embedder/platform_view_embedder.cc index 46e0390770da4..db1bea35c691e 100644 --- a/shell/platform/embedder/platform_view_embedder.cc +++ b/shell/platform/embedder/platform_view_embedder.cc @@ -3,17 +3,18 @@ // found in the LICENSE file. #include "flutter/shell/platform/embedder/platform_view_embedder.h" -#include "flutter/shell/gpu/gpu_rasterizer.h" + +#include "flutter/shell/common/io_manager.h" namespace shell { -PlatformViewEmbedder::PlatformViewEmbedder(DispatchTable dispatch_table) - : PlatformView(std::make_unique(nullptr)), +PlatformViewEmbedder::PlatformViewEmbedder(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + DispatchTable dispatch_table) + : PlatformView(delegate, std::move(task_runners)), dispatch_table_(dispatch_table) {} -PlatformViewEmbedder::~PlatformViewEmbedder() { - NotifyDestroyed(); -} +PlatformViewEmbedder::~PlatformViewEmbedder() = default; bool PlatformViewEmbedder::GLContextMakeCurrent() { return dispatch_table_.gl_make_current_callback(); @@ -31,33 +32,6 @@ intptr_t PlatformViewEmbedder::GLContextFBO() const { return dispatch_table_.gl_fbo_callback(); } -void PlatformViewEmbedder::Attach() { - CreateEngine(); - NotifyCreated(std::make_unique(this)); - - if (dispatch_table_.gl_make_resource_current_callback != nullptr) { - SetupResourceContextOnIOThread(); - } -} - -bool PlatformViewEmbedder::ResourceContextMakeCurrent() { - if (dispatch_table_.gl_make_resource_current_callback == nullptr) { - return false; - } - return dispatch_table_.gl_make_resource_current_callback(); -} - -void PlatformViewEmbedder::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) { - FXL_LOG(INFO) << "Hot reloading is unsupported on this platform."; -} - -void PlatformViewEmbedder::SetAssetBundlePath( - const std::string& assets_directory) { - FXL_LOG(INFO) << "Set asset bundle path is unsupported on this platform."; -} - void PlatformViewEmbedder::HandlePlatformMessage( fxl::RefPtr message) { if (!message) { @@ -76,4 +50,17 @@ void PlatformViewEmbedder::HandlePlatformMessage( dispatch_table_.platform_message_response_callback(std::move(message)); } +std::unique_ptr PlatformViewEmbedder::CreateRenderingSurface() { + return std::make_unique(this); +} + +sk_sp PlatformViewEmbedder::CreateResourceContext() const { + auto callback = dispatch_table_.gl_make_resource_current_callback; + if (callback && callback()) { + return IOManager::CreateCompatibleResourceLoadingContext( + GrBackend::kOpenGL_GrBackend); + } + return nullptr; +} + } // namespace shell diff --git a/shell/platform/embedder/platform_view_embedder.h b/shell/platform/embedder/platform_view_embedder.h index c287fc5ac86f1..a5b76dfaa07ba 100644 --- a/shell/platform/embedder/platform_view_embedder.h +++ b/shell/platform/embedder/platform_view_embedder.h @@ -12,7 +12,8 @@ namespace shell { -class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { +class PlatformViewEmbedder final : public PlatformView, + public GPUSurfaceGLDelegate { public: using PlatformMessageResponseCallback = std::function)>; @@ -26,9 +27,11 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { std::function gl_make_resource_current_callback; // optional }; - PlatformViewEmbedder(DispatchTable dispatch_table); + PlatformViewEmbedder(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners, + DispatchTable dispatch_table); - ~PlatformViewEmbedder(); + ~PlatformViewEmbedder() override; // |shell::GPUSurfaceGLDelegate| bool GLContextMakeCurrent() override; @@ -42,20 +45,6 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { // |shell::GPUSurfaceGLDelegate| intptr_t GLContextFBO() const override; - // |shell::PlatformView| - void Attach() override; - - // |shell::PlatformView| - bool ResourceContextMakeCurrent() override; - - // |shell::PlatformView| - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - // |shell::PlatformView| - void SetAssetBundlePath(const std::string& assets_directory) override; - // |shell::PlatformView| void HandlePlatformMessage( fxl::RefPtr message) override; @@ -63,6 +52,12 @@ class PlatformViewEmbedder : public PlatformView, public GPUSurfaceGLDelegate { private: DispatchTable dispatch_table_; + // |shell::PlatformView| + std::unique_ptr CreateRenderingSurface() override; + + // |shell::PlatformView| + sk_sp CreateResourceContext() const override; + FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewEmbedder); }; diff --git a/shell/platform/linux/BUILD.gn b/shell/platform/linux/BUILD.gn deleted file mode 100644 index 6e9f1f596b09d..0000000000000 --- a/shell/platform/linux/BUILD.gn +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright 2016 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. - -executable("linux") { - output_name = "flutter_tester" - - sources = [ - "main_linux.cc", - ] - - deps = [ - "//third_party/dart/runtime:libdart_jit", - "//third_party/dart/runtime/bin:embedded_dart_io", - "$flutter_root/common", - "$flutter_root/fml", - "$flutter_root/shell/common", - "$flutter_root/shell/testing", - "//garnet/public/lib/fxl", - "//third_party/skia", - "//topaz/lib/tonic", - ] -} diff --git a/shell/platform/linux/main_linux.cc b/shell/platform/linux/main_linux.cc deleted file mode 100644 index a20d425ed1eed..0000000000000 --- a/shell/platform/linux/main_linux.cc +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/common/threads.h" -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/testing/test_runner.h" -#include "flutter/shell/testing/testing.h" -#include "flutter/sky/engine/public/web/Sky.h" -#include "lib/fxl/command_line.h" -#include "lib/tonic/dart_microtask_queue.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -namespace { - -// Exit codes used by the Dart command line tool. -const int kApiErrorExitCode = 253; -const int kCompilationErrorExitCode = 254; -const int kErrorExitCode = 255; - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver : public fml::TaskObserver { - public: - ScriptCompletionTaskObserver(fxl::RefPtr task_runner) - : main_task_runner_(std::move(task_runner)), - prev_live_(false), - last_error_(tonic::kNoError) {} - - void DidProcessTask() override { - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - shell::Engine& engine = test_runner.platform_view().engine(); - - if (engine.GetLoadScriptError() != tonic::kNoError) { - last_error_ = engine.GetLoadScriptError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - return; - } - - bool live = engine.UIIsolateHasLivePorts(); - if (prev_live_ && !live) { - last_error_ = engine.GetUIIsolateLastError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - prev_live_ = live; - } - - tonic::DartErrorHandleType last_error() { return last_error_; } - - private: - fxl::RefPtr main_task_runner_; - bool prev_live_; - tonic::DartErrorHandleType last_error_; -}; - -int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { - switch (error) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } -} - -void RunNonInteractive(fxl::CommandLine initial_command_line, - bool run_forever) { - // This is a platform thread (i.e not one created by fml::Thread), so perform - // one time initialization. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - std::string bundle_path = ""; - initial_command_line.GetOptionValue( - FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); - - shell::Shell::InitStandalone(initial_command_line, - /* icu_data_path= */ "", - /* application_library_path= */ "", bundle_path); - - // Note that this task observer must be added after the observer that drains - // the microtask queue. - ScriptCompletionTaskObserver task_observer( - fml::MessageLoop::GetCurrent().GetTaskRunner()); - if (!run_forever) { - blink::Threads::UI()->PostTask([&task_observer] { - fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); - }); - } - - if (!shell::InitForTesting(initial_command_line)) { - shell::PrintUsage("flutter_tester"); - exit(EXIT_FAILURE); - return; - } - - fml::MessageLoop::GetCurrent().Run(); - - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - tonic::DartErrorHandleType error = - test_runner.platform_view().engine().GetLoadScriptError(); - if (error == tonic::kNoError) - error = task_observer.last_error(); - if (error == tonic::kNoError) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&error, &latch] { - error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); - latch.Signal(); - }); - latch.Wait(); - } - - // The script has completed and the engine may not be in a clean state, - // so just stop the process. - exit(ConvertErrorTypeToExitCode(error)); -} - -} // namespace - -int main(int argc, char* argv[]) { - dart::bin::SetExecutableName(argv[0]); - dart::bin::SetExecutableArguments(argc - 1, argv); - - auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); - - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { - shell::PrintUsage("flutter_tester"); - return EXIT_SUCCESS; - } - - bool run_forever = - command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); - RunNonInteractive(std::move(command_line), run_forever); - return EXIT_SUCCESS; -} diff --git a/shell/platform/win/BUILD.gn b/shell/platform/win/BUILD.gn deleted file mode 100644 index b4a2fe5033c18..0000000000000 --- a/shell/platform/win/BUILD.gn +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2016 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. - -executable("win") { - output_name = "flutter_tester" - - sources = [ - "main_win.cc", - ] - - deps = [ - "//flutter/common", - "//flutter/flow", - "//flutter/fml", - "//flutter/shell/common", - "//flutter/shell/testing", - "//flutter/sky/engine/wtf", - "//garnet/public/lib/fxl", - "//third_party/dart/runtime/bin:embedded_dart_io", - "//third_party/dart/runtime:libdart_jit", - "//third_party/skia", - "//topaz/lib/tonic", - ] - - libs = [ - "iphlpapi.lib", - "Rpcrt4.lib" - ] -} diff --git a/shell/platform/win/main_win.cc b/shell/platform/win/main_win.cc deleted file mode 100644 index c31c88ca915cb..0000000000000 --- a/shell/platform/win/main_win.cc +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2015 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. - -#include - -#include "flutter/common/threads.h" -#include "flutter/fml/message_loop.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/common/switches.h" -#include "flutter/shell/testing/test_runner.h" -#include "flutter/shell/testing/testing.h" -#include "lib/fxl/command_line.h" -#include "lib/tonic/dart_microtask_queue.h" -#include "third_party/dart/runtime/bin/embedded_dart_io.h" - -namespace { - -// Exit codes used by the Dart command line tool. -const int kApiErrorExitCode = 253; -const int kCompilationErrorExitCode = 254; -const int kErrorExitCode = 255; - -// Checks whether the engine's main Dart isolate has no pending work. If so, -// then exit the given message loop. -class ScriptCompletionTaskObserver : public fml::TaskObserver { - public: - ScriptCompletionTaskObserver(fxl::RefPtr task_runner) - : main_task_runner_(std::move(task_runner)), - prev_live_(false), - last_error_(tonic::kNoError) {} - - void DidProcessTask() override { - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - shell::Engine& engine = test_runner.platform_view().engine(); - - if (engine.GetLoadScriptError() != tonic::kNoError) { - last_error_ = engine.GetLoadScriptError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - return; - } - - bool live = engine.UIIsolateHasLivePorts(); - if (prev_live_ && !live) { - last_error_ = engine.GetUIIsolateLastError(); - main_task_runner_->PostTask( - []() { fml::MessageLoop::GetCurrent().Terminate(); }); - } - prev_live_ = live; - } - - tonic::DartErrorHandleType last_error() { return last_error_; } - - private: - fxl::RefPtr main_task_runner_; - bool prev_live_; - tonic::DartErrorHandleType last_error_; -}; - -int ConvertErrorTypeToExitCode(tonic::DartErrorHandleType error) { - switch (error) { - case tonic::kCompilationErrorType: - return kCompilationErrorExitCode; - case tonic::kApiErrorType: - return kApiErrorExitCode; - case tonic::kUnknownErrorType: - return kErrorExitCode; - default: - return 0; - } -} - -void RunNonInteractive(fxl::CommandLine initial_command_line, - bool run_forever) { - // This is a platform thread (i.e not one created by fml::Thread), so perform - // one time initialization. - fml::MessageLoop::EnsureInitializedForCurrentThread(); - - std::string bundle_path = ""; - initial_command_line.GetOptionValue( - FlagForSwitch(shell::Switch::FlutterAssetsDir), &bundle_path); - - shell::Shell::InitStandalone(initial_command_line, - /* icu_data_path= */ "", - /* application_library_path= */ "", bundle_path); - - // Note that this task observer must be added after the observer that drains - // the microtask queue. - ScriptCompletionTaskObserver task_observer( - fml::MessageLoop::GetCurrent().GetTaskRunner()); - if (!run_forever) { - blink::Threads::UI()->PostTask([&task_observer] { - fml::MessageLoop::GetCurrent().AddTaskObserver(&task_observer); - }); - } - - if (!shell::InitForTesting(initial_command_line)) { - shell::PrintUsage("flutter_tester"); - ::ExitProcess(EXIT_FAILURE); - return; - } - - fml::MessageLoop::GetCurrent().Run(); - shell::TestRunner& test_runner = shell::TestRunner::Shared(); - tonic::DartErrorHandleType error = - test_runner.platform_view().engine().GetLoadScriptError(); - if (error == tonic::kNoError) - error = task_observer.last_error(); - if (error == tonic::kNoError) { - fxl::AutoResetWaitableEvent latch; - blink::Threads::UI()->PostTask([&error, &latch] { - error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError(); - latch.Signal(); - }); - latch.Wait(); - } - - // The script has completed and the engine may not be in a clean state, - // so just stop the process. - ::ExitProcess(ConvertErrorTypeToExitCode(error)); -} - -} // namespace - -int main(int argc, char* argv[]) { - dart::bin::SetExecutableName(argv[0]); - dart::bin::SetExecutableArguments(argc - 1, argv); - - auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); - - if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { - shell::PrintUsage("flutter_tester"); - return EXIT_SUCCESS; - } - - bool run_forever = - command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever)); - RunNonInteractive(std::move(command_line), run_forever); - return EXIT_SUCCESS; -} diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index 659c241cc49b8..f11a3a2d07501 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -2,24 +2,30 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -source_set("testing") { +executable("testing") { + testonly = true + + output_name = "flutter_tester" + + public_configs = [ "$flutter_root:config" ] + sources = [ - "platform_view_test.cc", - "platform_view_test.h", - "test_runner.cc", - "test_runner.h", - "testing.cc", - "testing.h", + "tester_main.cc", ] deps = [ + "$flutter_root/assets", "$flutter_root/common", + "$flutter_root/fml", "$flutter_root/shell/common", "//garnet/public/lib/fxl", + "//third_party/dart/runtime:libdart_jit", + "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", + "//topaz/lib/tonic", ] - public_configs = [ - "$flutter_root:config", - ] + if (is_linux) { + ldflags = [ "-rdynamic" ] + } } diff --git a/shell/testing/observatory/test.dart b/shell/testing/observatory/test.dart index 3a00383a48368..5786153ed8951 100644 --- a/shell/testing/observatory/test.dart +++ b/shell/testing/observatory/test.dart @@ -111,12 +111,20 @@ Future testStartPaused(Uri uri) async { } // Grab the isolate. - Map isolate = await serviceClient.invokeRPC('getIsolate', { - 'isolateId': isolateId, - }); - Expect.equals(isolate['type'], 'Isolate'); - // Verify that it is paused at start. - Expect.isNotNull(isolate['pauseEvent']); + Map isolate; + while(true) { + isolate = await serviceClient.invokeRPC('getIsolate', { + 'isolateId': isolateId, + }); + Expect.equals(isolate['type'], 'Isolate'); + // Verify that it is paused at start. + Expect.isNotNull(isolate['pauseEvent']); + if (isolate['pauseEvent']['kind'] != 'None') { + break; + } + } + + Expect.isNotNull(isolate); Expect.equals(isolate['pauseEvent']['kind'], 'PauseStart'); // Resume the isolate. diff --git a/shell/testing/platform_view_test.cc b/shell/testing/platform_view_test.cc deleted file mode 100644 index a59684d31bc94..0000000000000 --- a/shell/testing/platform_view_test.cc +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/shell/testing/platform_view_test.h" - -#include "flutter/shell/common/null_rasterizer.h" -#include "flutter/shell/common/shell.h" - -namespace shell { - -PlatformViewTest::PlatformViewTest() - : PlatformView(std::unique_ptr(new NullRasterizer())) {} - -void PlatformViewTest::Attach() { - CreateEngine(); -} - -PlatformViewTest::~PlatformViewTest() = default; - -bool PlatformViewTest::ResourceContextMakeCurrent() { - return false; -} - -void PlatformViewTest::RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) {} - -void PlatformViewTest::SetAssetBundlePath(const std::string& assets_directory) { -} - -} // namespace shell diff --git a/shell/testing/platform_view_test.h b/shell/testing/platform_view_test.h deleted file mode 100644 index 3612d0363ab58..0000000000000 --- a/shell/testing/platform_view_test.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2016 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. - -#ifndef SHELL_TESTING_PLATFORM_VIEW_TEST_H_ -#define SHELL_TESTING_PLATFORM_VIEW_TEST_H_ - -#include "flutter/shell/common/platform_view.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class Shell; - -class PlatformViewTest : public PlatformView { - public: - PlatformViewTest(); - - ~PlatformViewTest(); - - virtual void Attach() override; - - bool ResourceContextMakeCurrent() override; - - void RunFromSource(const std::string& assets_directory, - const std::string& main, - const std::string& packages) override; - - void SetAssetBundlePath(const std::string& assets_directory) override; - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformViewTest); -}; - -} // namespace shell - -#endif // SHELL_TESTING_PLATFORM_VIEW_TEST_H_ diff --git a/shell/testing/test_runner.cc b/shell/testing/test_runner.cc deleted file mode 100644 index 838b04120c773..0000000000000 --- a/shell/testing/test_runner.cc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/shell/testing/test_runner.h" - -#include - -#include "flutter/common/threads.h" -#include "flutter/shell/common/platform_view.h" -#include "flutter/shell/common/shell.h" -#include "flutter/shell/testing/platform_view_test.h" - -namespace shell { - -TestRunner::TestRunner() - : platform_view_(std::make_shared()) { - platform_view_->Attach(); - blink::ViewportMetrics metrics; - metrics.device_pixel_ratio = 3.0; - metrics.physical_width = 2400; // 800 at 3x resolution - metrics.physical_height = 1800; // 600 at 3x resolution - - blink::Threads::UI()->PostTask( - [ engine = platform_view_->engine().GetWeakPtr(), metrics ] { - if (engine) - engine->SetViewportMetrics(metrics); - }); -} - -TestRunner::~TestRunner() = default; - -TestRunner& TestRunner::Shared() { - static TestRunner* g_test_runner = nullptr; - if (!g_test_runner) - g_test_runner = new TestRunner(); - return *g_test_runner; -} - -void TestRunner::Run(const TestDescriptor& test) { - blink::Threads::UI()->PostTask( - [ engine = platform_view_->engine().GetWeakPtr(), test ] { - if (engine) - engine->RunBundleAndSource(std::string(), test.path, test.packages); - }); -} - -} // namespace shell diff --git a/shell/testing/test_runner.h b/shell/testing/test_runner.h deleted file mode 100644 index 8f303d7eb7683..0000000000000 --- a/shell/testing/test_runner.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_TESTING_TEST_RUNNER_H_ -#define SHELL_TESTING_TEST_RUNNER_H_ - -#include -#include - -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace shell { - -class PlatformView; - -class TestRunner { - public: - static TestRunner& Shared(); - - struct TestDescriptor { - std::string path; - std::string packages; - }; - - void Run(const TestDescriptor& test); - - PlatformView& platform_view() { return *platform_view_; } - - private: - TestRunner(); - ~TestRunner(); - - std::shared_ptr platform_view_; - - FXL_DISALLOW_COPY_AND_ASSIGN(TestRunner); -}; - -} // namespace shell - -#endif // SHELL_TESTING_TEST_RUNNER_H_ diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc new file mode 100644 index 0000000000000..a8afd325033bc --- /dev/null +++ b/shell/testing/tester_main.cc @@ -0,0 +1,250 @@ +// Copyright 2018 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 + +#include "flutter/assets/asset_manager.h" +#include "flutter/assets/directory_asset_bundle.h" +#include "flutter/fml/file.h" +#include "flutter/fml/message_loop.h" +#include "flutter/fml/paths.h" +#include "flutter/fml/task_runner.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/common/rasterizer.h" +#include "flutter/shell/common/shell.h" +#include "flutter/shell/common/switches.h" +#include "flutter/shell/common/thread_host.h" +#include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/synchronization/waitable_event.h" +#include "third_party/dart/runtime/bin/embedded_dart_io.h" + +#ifdef ERROR +#undef ERROR +#endif + +namespace shell { + +// Checks whether the engine's main Dart isolate has no pending work. If so, +// then exit the given message loop. +class ScriptCompletionTaskObserver { + public: + ScriptCompletionTaskObserver(Shell& shell, + fxl::RefPtr main_task_runner, + bool run_forever) + : engine_(shell.GetEngine()), + main_task_runner_(std::move(main_task_runner)), + run_forever_(run_forever) {} + + int GetExitCodeForLastError() const { + // Exit codes used by the Dart command line tool. + const int kApiErrorExitCode = 253; + const int kCompilationErrorExitCode = 254; + const int kErrorExitCode = 255; + switch (last_error_) { + case tonic::kCompilationErrorType: + return kCompilationErrorExitCode; + case tonic::kApiErrorType: + return kApiErrorExitCode; + case tonic::kUnknownErrorType: + return kErrorExitCode; + default: + return 0; + } + } + + void DidProcessTask() { + if (engine_) { + last_error_ = engine_->GetUIIsolateLastError(); + if (engine_->UIIsolateHasLivePorts()) { + // The UI isolate still has live ports and is running. Nothing to do + // just yet. + return; + } + } + + if (run_forever_) { + // We need this script to run forever. We have already recorded the last + // error. Keep going. + return; + } + + if (!has_terminated) { + // Only try to terminate the loop once. + has_terminated = true; + main_task_runner_->PostTask( + []() { fml::MessageLoop::GetCurrent().Terminate(); }); + } + } + + private: + fml::WeakPtr engine_; + fxl::RefPtr main_task_runner_; + bool run_forever_ = false; + tonic::DartErrorHandleType last_error_ = tonic::kUnknownErrorType; + bool has_terminated = false; + + FXL_DISALLOW_COPY_AND_ASSIGN(ScriptCompletionTaskObserver); +}; + +int RunTester(const blink::Settings& settings, bool run_forever) { + const auto thread_label = "io.flutter.test"; + + fml::MessageLoop::EnsureInitializedForCurrentThread(); + + auto current_task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); + + // Setup a single threaded test runner configuration. + const blink::TaskRunners task_runners(thread_label, // dart thread label + current_task_runner, // platform + current_task_runner, // gpu + current_task_runner, // ui + current_task_runner // io + ); + + Shell::CreateCallback on_create_platform_view = + [](Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); + }; + + Shell::CreateCallback on_create_rasterizer = [](Shell& shell) { + return std::make_unique(shell.GetTaskRunners()); + }; + + auto shell = Shell::Create(task_runners, // + settings, // + on_create_platform_view, // + on_create_rasterizer // + ); + + if (!shell || !shell->IsSetup()) { + FXL_LOG(ERROR) << "Could not setup the shell."; + return EXIT_FAILURE; + } + + auto isolate_configuration = IsolateConfiguration::CreateForSource( + settings.main_dart_file_path, settings.packages_file_path); + + if (!isolate_configuration) { + FXL_LOG(ERROR) << "Could create isolate configuration."; + return EXIT_FAILURE; + } + + auto asset_manager = fxl::MakeRefCounted(); + asset_manager->PushBack(std::make_unique( + fml::Duplicate(settings.assets_dir))); + asset_manager->PushBack( + std::make_unique(fml::OpenFile( + settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); + + RunConfiguration run_configuration(std::move(isolate_configuration), + std::move(asset_manager)); + + // The script completion task observer that will be installed on the UI thread + // that watched if the engine has any live ports. + ScriptCompletionTaskObserver completion_observer( + *shell, // a valid shell + fml::MessageLoop::GetCurrent() + .GetTaskRunner(), // the message loop to terminate + run_forever // should the exit be ignored + ); + + bool engine_did_run = false; + + fxl::AutoResetWaitableEvent sync_run_latch; + fml::TaskRunner::RunNowOrPostTask( + shell->GetTaskRunners().GetUITaskRunner(), + fxl::MakeCopyable([&sync_run_latch, &completion_observer, + engine = shell->GetEngine(), + config = std::move(run_configuration), + &engine_did_run]() mutable { + fml::MessageLoop::GetCurrent().AddTaskObserver( + reinterpret_cast(&completion_observer), + [&completion_observer]() { completion_observer.DidProcessTask(); }); + if (engine->Run(std::move(config))) { + engine_did_run = true; + + blink::ViewportMetrics metrics; + metrics.device_pixel_ratio = 3.0; + metrics.physical_width = 2400; // 800 at 3x resolution + metrics.physical_height = 1800; // 600 at 3x resolution + engine->SetViewportMetrics(metrics); + + } else { + FXL_DLOG(ERROR) << "Could not launch the engine with configuration."; + } + sync_run_latch.Signal(); + })); + sync_run_latch.Wait(); + + // Run the message loop and wait for the script to do its thing. + fml::MessageLoop::GetCurrent().Run(); + + // Cleanup the completion observer synchronously as it is living on the + // stack. + fxl::AutoResetWaitableEvent latch; + fml::TaskRunner::RunNowOrPostTask( + shell->GetTaskRunners().GetUITaskRunner(), + [&latch, &completion_observer] { + fml::MessageLoop::GetCurrent().RemoveTaskObserver( + reinterpret_cast(&completion_observer)); + latch.Signal(); + }); + latch.Wait(); + + if (!engine_did_run) { + // If the engine itself didn't have a chance to run, there is no point in + // asking it if there was an error. Signal a failure unconditionally. + return EXIT_FAILURE; + } + + return completion_observer.GetExitCodeForLastError(); +} + +} // namespace shell + +int main(int argc, char* argv[]) { + dart::bin::SetExecutableName(argv[0]); + dart::bin::SetExecutableArguments(argc - 1, argv); + + auto command_line = fxl::CommandLineFromArgcArgv(argc, argv); + + if (command_line.HasOption(shell::FlagForSwitch(shell::Switch::Help))) { + shell::PrintUsage("flutter_tester"); + return EXIT_SUCCESS; + } + + auto settings = shell::SettingsFromCommandLine(command_line); + if (command_line.positional_args().size() > 0) { + // The tester may not use the switch for the main dart file path. Specifying + // it as a positional argument instead. + settings.main_dart_file_path = command_line.positional_args()[0]; + } + + if (settings.main_dart_file_path.size() == 0) { + FXL_LOG(ERROR) << "Main dart file path not specified."; + return EXIT_FAILURE; + } + + settings.icu_data_path = "icudtl.dat"; + + settings.kernel_snapshot_path = + fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); + + // The tools that read logs get confused if there is a log tag specified. + settings.log_tag = ""; + + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { + fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); + }; + + settings.task_observer_remove = [](intptr_t key) { + fml::MessageLoop::GetCurrent().RemoveTaskObserver(key); + }; + + return shell::RunTester( + settings, + command_line.HasOption(shell::FlagForSwitch(shell::Switch::RunForever))); +} diff --git a/shell/testing/testing.cc b/shell/testing/testing.cc deleted file mode 100644 index 13a3ab5be3d93..0000000000000 --- a/shell/testing/testing.cc +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/shell/testing/testing.h" - -#include "flutter/shell/common/switches.h" -#include "flutter/shell/testing/test_runner.h" - -namespace shell { - -bool InitForTesting(const fxl::CommandLine& command_line) { - TestRunner::TestDescriptor test; - test.packages = command_line.GetOptionValueWithDefault( - FlagForSwitch(Switch::Packages), ""); - auto args = command_line.positional_args(); - if (args.empty()) - return false; - test.path = args[0]; - TestRunner::Shared().Run(test); - return true; -} - -} // namespace shell diff --git a/shell/testing/testing.h b/shell/testing/testing.h deleted file mode 100644 index 99f8b4fe983de..0000000000000 --- a/shell/testing/testing.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 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. - -#ifndef SHELL_TESTING_TESTING_H_ -#define SHELL_TESTING_TESTING_H_ - -#include "lib/fxl/command_line.h" - -namespace shell { - -bool InitForTesting(const fxl::CommandLine& command_line); - -} // namespace shell - -#endif // SHELL_TESTING_TESTING_H_ diff --git a/sky/engine/platform/SharedBuffer.cpp b/sky/engine/platform/SharedBuffer.cpp index 8577ab16f2938..bc94f22e97ce6 100644 --- a/sky/engine/platform/SharedBuffer.cpp +++ b/sky/engine/platform/SharedBuffer.cpp @@ -26,7 +26,6 @@ #include "flutter/sky/engine/platform/SharedBuffer.h" -#include "flutter/common/threads.h" #include "flutter/sky/engine/public/platform/Platform.h" #include "flutter/sky/engine/wtf/unicode/UTF8.h" #include "flutter/sky/engine/wtf/unicode/Unicode.h" diff --git a/sky/engine/platform/fonts/FontFallbackList.cpp b/sky/engine/platform/fonts/FontFallbackList.cpp index 177f161adaa7e..4786d65e0d7ad 100644 --- a/sky/engine/platform/fonts/FontFallbackList.cpp +++ b/sky/engine/platform/fonts/FontFallbackList.cpp @@ -37,6 +37,11 @@ namespace blink { +bool gUseTestFonts = false; +void FontFallbackList::SetUseTestFonts(bool useTestFonts) { + gUseTestFonts = useTestFonts; +} + FontFallbackList::FontFallbackList() : m_pageZero(0), m_cachedPrimarySimpleFontData(0), @@ -45,7 +50,8 @@ FontFallbackList::FontFallbackList() m_familyIndex(0), m_generation(FontCache::fontCache()->generation()), m_pitch(UnknownPitch), - m_hasLoadingFallback(false) {} + m_hasLoadingFallback(false), + m_useTestFonts(gUseTestFonts) {} void FontFallbackList::invalidate(PassRefPtr fontSelector) { releaseFontData(); @@ -193,7 +199,7 @@ PassRefPtr FontFallbackList::getFontData( const FontFamily* currFamily = startFamily; while (currFamily && !result) { familyIndex++; - if (currFamily->family().length() || Settings::Get().use_test_fonts) { + if (currFamily->family().length() || m_useTestFonts) { if (m_fontSelector) result = m_fontSelector->getFontData(fontDescription, currFamily->family()); diff --git a/sky/engine/platform/fonts/FontFallbackList.h b/sky/engine/platform/fonts/FontFallbackList.h index fdac27e5013bd..3331387968edc 100644 --- a/sky/engine/platform/fonts/FontFallbackList.h +++ b/sky/engine/platform/fonts/FontFallbackList.h @@ -103,6 +103,8 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { m_pageZero = node; } + static void SetUseTestFonts(bool useTestFonts); + private: FontFallbackList(); @@ -125,6 +127,7 @@ class PLATFORM_EXPORT FontFallbackList : public RefCounted { unsigned short m_generation; mutable unsigned m_pitch : 3; // Pitch mutable bool m_hasLoadingFallback : 1; + bool m_useTestFonts = false; }; } // namespace blink diff --git a/sky/engine/web/Sky.cpp b/sky/engine/web/Sky.cpp index e90539e96cf87..52c6243743d7b 100644 --- a/sky/engine/web/Sky.cpp +++ b/sky/engine/web/Sky.cpp @@ -53,56 +53,6 @@ namespace blink { -namespace { - -void didProcessTask() { - tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks(); - // FIXME: Report memory usage to dart? -} - -#if defined(OS_FUCHSIA) - -void addMessageLoopObservers() { - fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback(didProcessTask); -} - -void removeMessageLoopObservers() { - fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); -} - -#else // defined(OS_FUCHSIA) - -class RunMicrotasksTaskObserver : public fml::TaskObserver { - public: - RunMicrotasksTaskObserver() = default; - - ~RunMicrotasksTaskObserver() override = default; - - void DidProcessTask() override { didProcessTask(); } -}; - -// FIXME(chinmaygarde): The awkward use of the global here is be cause we cannot -// introduce the fml::TaskObserver subclass in common code because Fuchsia does -// not support the same. Unify the API and remove hack. -static RunMicrotasksTaskObserver* g_run_microtasks_task_observer = nullptr; - -void addMessageLoopObservers() { - g_run_microtasks_task_observer = new RunMicrotasksTaskObserver(); - fml::MessageLoop::GetCurrent().AddTaskObserver( - g_run_microtasks_task_observer); -} - -void removeMessageLoopObservers() { - fml::MessageLoop::GetCurrent().RemoveTaskObserver( - g_run_microtasks_task_observer); - delete g_run_microtasks_task_observer; - g_run_microtasks_task_observer = nullptr; -} - -#endif // defined(OS_FUCHSIA) - -} // namespace - // Make sure we are not re-initialized in the same address space. // Doing so may cause hard to reproduce crashes. static bool s_webKitInitialized = false; @@ -130,15 +80,9 @@ void InitEngine(Platform* platform) { // the initialization thread-safe, but given that so many code paths use // this, initializing this lazily probably doesn't buy us much. WTF::UTF8Encoding(); - - tonic::DartMicrotaskQueue::StartForCurrentThread(); - addMessageLoopObservers(); } void ShutdownEngine() { - removeMessageLoopObservers(); - tonic::DartMicrotaskQueue::GetForCurrentThread()->Destroy(); - // FIXME: Shutdown dart? CoreInitializer::shutdown(); diff --git a/synchronization/BUILD.gn b/synchronization/BUILD.gn index 977a571c8da30..9ee7680cc1160 100644 --- a/synchronization/BUILD.gn +++ b/synchronization/BUILD.gn @@ -4,16 +4,13 @@ source_set("synchronization") { sources = [ - "debug_thread_checker.h", "pipeline.cc", "pipeline.h", "semaphore.cc", "semaphore.h", ] - public_configs = [ - "$flutter_root:config", - ] + public_configs = [ "$flutter_root:config" ] public_deps = [ "$flutter_root/glue", diff --git a/synchronization/debug_thread_checker.h b/synchronization/debug_thread_checker.h deleted file mode 100644 index 69614eb89d217..0000000000000 --- a/synchronization/debug_thread_checker.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ -#define FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ - -#ifndef NDEBUG - -#include -#include "lib/fxl/synchronization/thread_checker.h" - -#define FLUTTER_THREAD_CHECKER_DECLARE(x) ::fxl::ThreadChecker x; - -#define FLUTTER_THREAD_CHECKER_CHECK(x) FXL_CHECK(x.IsCreationThreadCurrent()); - -#else // NDEBUG - -#define FLUTTER_THREAD_CHECKER_DECLARE(x) - -#define FLUTTER_THREAD_CHECKER_CHECK(x) - -#endif // NDEBUG - -#endif // FLUTTER_SYNCHRONIZATION_DEBUG_THREAD_CHECKER_H_ diff --git a/synchronization/semaphore.cc b/synchronization/semaphore.cc index c6e0bdf9e2d53..4dc5f6220e350 100644 --- a/synchronization/semaphore.cc +++ b/synchronization/semaphore.cc @@ -15,9 +15,12 @@ namespace flutter { class PlatformSemaphore { public: explicit PlatformSemaphore(uint32_t count) - : _sem(dispatch_semaphore_create(count)) {} + : _sem(dispatch_semaphore_create(count)), _initial(count) {} ~PlatformSemaphore() { + for (uint32_t i = 0; i < _initial; ++i) { + Signal(); + } if (_sem != nullptr) { dispatch_release(reinterpret_cast(_sem)); _sem = nullptr; @@ -42,6 +45,7 @@ class PlatformSemaphore { private: dispatch_semaphore_t _sem; + const uint32_t _initial; FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; diff --git a/testing/BUILD.gn b/testing/BUILD.gn index 3927e71cfc0e4..a65311bfaeb7c 100644 --- a/testing/BUILD.gn +++ b/testing/BUILD.gn @@ -9,9 +9,13 @@ source_set("testing") { "$flutter_root/testing/run_all_unittests.cc", "$flutter_root/testing/testing.cc", "$flutter_root/testing/testing.h", + "$flutter_root/testing/thread_test.cc", + "$flutter_root/testing/thread_test.h", ] public_deps = [ + "$flutter_root/fml", + "//garnet/public/lib/fxl", "//third_party/googletest:gtest", ] diff --git a/testing/thread_test.cc b/testing/thread_test.cc new file mode 100644 index 0000000000000..1306f37678fbe --- /dev/null +++ b/testing/thread_test.cc @@ -0,0 +1,33 @@ +// Copyright 2017 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/testing/thread_test.h" + +namespace testing { + +void ThreadTest::SetUp() { + thread_ = std::make_unique(); + thread_task_runner_ = thread_->GetTaskRunner(); + + fml::MessageLoop::EnsureInitializedForCurrentThread(); + current_task_runner_ = fml::MessageLoop::GetCurrent().GetTaskRunner(); +} + +void ThreadTest::TearDown() { + thread_task_runner_ = nullptr; + thread_ = nullptr; + current_task_runner_ = nullptr; +} + +fxl::RefPtr ThreadTest::GetCurrentTaskRunner() { + return current_task_runner_; +} + +fxl::RefPtr ThreadTest::GetThreadTaskRunner() { + return thread_task_runner_; +} + +} // namespace testing diff --git a/testing/thread_test.h b/testing/thread_test.h new file mode 100644 index 0000000000000..511d09c978858 --- /dev/null +++ b/testing/thread_test.h @@ -0,0 +1,37 @@ +// Copyright 2017 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_TESTING_THREAD_TEST_H_ +#define FLUTTER_TESTING_THREAD_TEST_H_ + +#include + +#include "flutter/fml/message_loop.h" +#include "flutter/fml/task_runner.h" +#include "flutter/fml/thread.h" +#include "gtest/gtest.h" +#include "lib/fxl/macros.h" + +namespace testing { + +class ThreadTest : public Test { + public: + fxl::RefPtr GetCurrentTaskRunner(); + + fxl::RefPtr GetThreadTaskRunner(); + + protected: + void SetUp() override; + + void TearDown() override; + + private: + std::unique_ptr thread_; + fxl::RefPtr thread_task_runner_; + fxl::RefPtr current_task_runner_; +}; + +} // namespace testing + +#endif // FLUTTER_TESTING_THREAD_TEST_H_ diff --git a/tools/gn b/tools/gn index ea7071ac0a474..b4b15f99f1d4f 100755 --- a/tools/gn +++ b/tools/gn @@ -232,6 +232,10 @@ def main(argv): # On the Mac, also generate Xcode projects for ease of editing. command.append('--ide=xcode') + if sys.platform.startswith('win'): + # On Windows, also generate Visual Studio project for ease of editing. + command.append('--ide=vs') + gn_args = to_command_line(to_gn_args(args)) out_dir = get_out_dir(args) print "gn gen --check in %s" % out_dir diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 8749f6880dbf4..b15c608425095 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -1059,14 +1059,10 @@ USED LICENSES: ==================================================================================================== LIBRARY: engine LIBRARY: txt -ORIGIN: ../../../flutter/content_handler/service_protocol_hooks.cc + ../../../LICENSE +ORIGIN: ../../../flutter/content_handler/session_connection.cc + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/content_handler/service_protocol_hooks.cc -FILE: ../../../flutter/content_handler/service_protocol_hooks.h FILE: ../../../flutter/content_handler/session_connection.cc FILE: ../../../flutter/content_handler/session_connection.h -FILE: ../../../flutter/content_handler/vulkan_rasterizer.cc -FILE: ../../../flutter/content_handler/vulkan_rasterizer.h FILE: ../../../flutter/content_handler/vulkan_surface_producer.cc FILE: ../../../flutter/content_handler/vulkan_surface_producer.h FILE: ../../../flutter/flow/debug_print.cc @@ -1126,7 +1122,6 @@ FILE: ../../../flutter/fml/platform/win/mapping_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.cc FILE: ../../../flutter/fml/platform/win/message_loop_win.h FILE: ../../../flutter/fml/platform/win/paths_win.cc -FILE: ../../../flutter/fml/task_observer.h FILE: ../../../flutter/fml/task_runner.cc FILE: ../../../flutter/fml/task_runner.h FILE: ../../../flutter/fml/thread.cc @@ -1142,13 +1137,10 @@ FILE: ../../../flutter/lib/ui/painting/codec.cc FILE: ../../../flutter/lib/ui/painting/codec.h FILE: ../../../flutter/lib/ui/painting/frame_info.cc FILE: ../../../flutter/lib/ui/painting/frame_info.h -FILE: ../../../flutter/lib/ui/painting/utils.cc FILE: ../../../flutter/lib/ui/painting/vertices.cc FILE: ../../../flutter/lib/ui/painting/vertices.h FILE: ../../../flutter/lib/ui/text/font_collection.cc FILE: ../../../flutter/lib/ui/text/font_collection.h -FILE: ../../../flutter/shell/common/null_platform_view.cc -FILE: ../../../flutter/shell/common/null_platform_view.h FILE: ../../../flutter/shell/gpu/gpu_surface_software.cc FILE: ../../../flutter/shell/gpu/gpu_surface_software.h FILE: ../../../flutter/shell/platform/android/android_external_texture_gl.cc @@ -1195,8 +1187,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandar FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterStandardCodec_Internal.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_codecs_unittest.mm -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_main_ios.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/flutter_standard_codec_unittest.mm FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.h FILE: ../../../flutter/shell/platform/darwin/ios/ios_external_texture_gl.mm @@ -1563,7 +1553,6 @@ FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc FILE: ../../../flutter/shell/platform/android/apk_asset_provider.cc FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/JSONUtil.java FILE: ../../../flutter/shell/platform/darwin/desktop/Info.plist -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_mac.xib FILE: ../../../flutter/shell/platform/darwin/ios/framework/Flutter.podspec FILE: ../../../flutter/shell/platform/darwin/ios/framework/Info.plist FILE: ../../../flutter/shell/platform/darwin/ios/framework/module.modulemap @@ -1638,17 +1627,48 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/assets/asset_provider.h + ../../../LICENSE +ORIGIN: ../../../flutter/assets/asset_manager.cc + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/assets/asset_provider.h -FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart -FILE: ../../../flutter/lib/ui/painting/image_encoding.cc -FILE: ../../../flutter/lib/ui/painting/image_encoding.h -FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +FILE: ../../../flutter/assets/asset_manager.cc +FILE: ../../../flutter/assets/asset_manager.h +FILE: ../../../flutter/assets/asset_resolver.h +FILE: ../../../flutter/common/task_runners.cc +FILE: ../../../flutter/common/task_runners.h +FILE: ../../../flutter/flow/layers/default_layer_builder.cc +FILE: ../../../flutter/flow/layers/default_layer_builder.h +FILE: ../../../flutter/flow/layers/layer_builder.cc +FILE: ../../../flutter/flow/layers/layer_builder.h +FILE: ../../../flutter/flow/skia_gpu_object.cc +FILE: ../../../flutter/flow/skia_gpu_object.h +FILE: ../../../flutter/runtime/dart_isolate.cc +FILE: ../../../flutter/runtime/dart_isolate.h +FILE: ../../../flutter/runtime/dart_isolate_unittests.cc +FILE: ../../../flutter/runtime/dart_snapshot.cc +FILE: ../../../flutter/runtime/dart_snapshot.h +FILE: ../../../flutter/runtime/dart_snapshot_buffer.cc +FILE: ../../../flutter/runtime/dart_snapshot_buffer.h +FILE: ../../../flutter/runtime/dart_vm.cc +FILE: ../../../flutter/runtime/dart_vm.h +FILE: ../../../flutter/runtime/dart_vm_unittests.cc +FILE: ../../../flutter/runtime/service_protocol.cc +FILE: ../../../flutter/runtime/service_protocol.h +FILE: ../../../flutter/shell/common/io_manager.cc +FILE: ../../../flutter/shell/common/io_manager.h +FILE: ../../../flutter/shell/common/run_configuration.cc +FILE: ../../../flutter/shell/common/run_configuration.h +FILE: ../../../flutter/shell/common/shell_unittests.cc +FILE: ../../../flutter/shell/common/thread_host.cc +FILE: ../../../flutter/shell/common/thread_host.h +FILE: ../../../flutter/shell/platform/darwin/common/command_line.h +FILE: ../../../flutter/shell/platform/darwin/common/command_line.mm +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.h +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application_delegate.mm +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h +FILE: ../../../flutter/shell/platform/embedder/embedder.h +FILE: ../../../flutter/shell/platform/embedder/embedder_engine.cc +FILE: ../../../flutter/shell/platform/embedder/embedder_engine.h ---------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. +Copyright 2017 The Flutter Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1683,23 +1703,10 @@ ORIGIN: ../../../flutter/assets/directory_asset_bundle.cc + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/assets/directory_asset_bundle.cc FILE: ../../../flutter/assets/directory_asset_bundle.h -FILE: ../../../flutter/assets/unzipper_provider.cc -FILE: ../../../flutter/assets/unzipper_provider.h FILE: ../../../flutter/assets/zip_asset_store.cc FILE: ../../../flutter/assets/zip_asset_store.h FILE: ../../../flutter/common/settings.cc FILE: ../../../flutter/common/settings.h -FILE: ../../../flutter/common/threads.cc -FILE: ../../../flutter/common/threads.h -FILE: ../../../flutter/content_handler/app.cc -FILE: ../../../flutter/content_handler/app.h -FILE: ../../../flutter/content_handler/application_controller_impl.cc -FILE: ../../../flutter/content_handler/application_controller_impl.h -FILE: ../../../flutter/content_handler/main.cc -FILE: ../../../flutter/content_handler/rasterizer.cc -FILE: ../../../flutter/content_handler/rasterizer.h -FILE: ../../../flutter/content_handler/runtime_holder.cc -FILE: ../../../flutter/content_handler/runtime_holder.h FILE: ../../../flutter/flow/export_node.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.cc FILE: ../../../flutter/flow/layers/backdrop_filter_layer.h @@ -1707,7 +1714,6 @@ FILE: ../../../flutter/flow/layers/child_scene_layer.cc FILE: ../../../flutter/flow/layers/child_scene_layer.h FILE: ../../../flutter/flow/layers/shader_mask_layer.cc FILE: ../../../flutter/flow/layers/shader_mask_layer.h -FILE: ../../../flutter/flow/process_info.h FILE: ../../../flutter/flow/raster_cache.cc FILE: ../../../flutter/flow/raster_cache.h FILE: ../../../flutter/flow/scene_update_context.cc @@ -1718,9 +1724,6 @@ FILE: ../../../flutter/glue/stack_trace_fuchsia.cc FILE: ../../../flutter/glue/trace_event.h FILE: ../../../flutter/lib/ui/painting/image_filter.cc FILE: ../../../flutter/lib/ui/painting/image_filter.h -FILE: ../../../flutter/lib/ui/painting/resource_context.cc -FILE: ../../../flutter/lib/ui/painting/resource_context.h -FILE: ../../../flutter/lib/ui/painting/utils.h FILE: ../../../flutter/lib/ui/semantics.dart FILE: ../../../flutter/lib/ui/semantics/semantics_node.cc FILE: ../../../flutter/lib/ui/semantics/semantics_node.h @@ -1742,18 +1745,13 @@ FILE: ../../../flutter/runtime/asset_font_selector.cc FILE: ../../../flutter/runtime/asset_font_selector.h FILE: ../../../flutter/runtime/embedder_resources.cc FILE: ../../../flutter/runtime/embedder_resources.h -FILE: ../../../flutter/runtime/runtime_init.cc -FILE: ../../../flutter/runtime/runtime_init.h +FILE: ../../../flutter/runtime/fixtures/simple_main.dart FILE: ../../../flutter/runtime/start_up.cc FILE: ../../../flutter/runtime/start_up.h FILE: ../../../flutter/runtime/test_font_data.cc FILE: ../../../flutter/runtime/test_font_data.h FILE: ../../../flutter/runtime/test_font_selector.cc FILE: ../../../flutter/runtime/test_font_selector.h -FILE: ../../../flutter/shell/common/null_rasterizer.cc -FILE: ../../../flutter/shell/common/null_rasterizer.h -FILE: ../../../flutter/shell/common/platform_view_service_protocol.cc -FILE: ../../../flutter/shell/common/platform_view_service_protocol.h FILE: ../../../flutter/shell/common/skia_event_tracer_impl.h FILE: ../../../flutter/shell/common/surface.cc FILE: ../../../flutter/shell/common/surface.h @@ -1782,8 +1780,6 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/view/VsyncWaiter.java FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.cc FILE: ../../../flutter/shell/platform/android/vsync_waiter_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.mm -FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.cc -FILE: ../../../flutter/shell/platform/darwin/common/process_info_mac.h FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/Flutter.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h @@ -1792,8 +1788,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterMacros FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterDartSource.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h @@ -1816,7 +1810,6 @@ FILE: ../../../flutter/sky/engine/platform/text/ICUError.cpp FILE: ../../../flutter/sky/engine/platform/text/ICUError.h FILE: ../../../flutter/sky/engine/platform/text/TextBox.h FILE: ../../../flutter/sky/packages/flutter_services/lib/empty.dart -FILE: ../../../flutter/synchronization/debug_thread_checker.h FILE: ../../../flutter/synchronization/pipeline.cc FILE: ../../../flutter/synchronization/pipeline.h FILE: ../../../flutter/synchronization/semaphore.cc @@ -1884,15 +1877,68 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../flutter/flow/layers/default_layer_builder.cc + ../../../LICENSE +ORIGIN: ../../../flutter/content_handler/application.cc + ../../../garnet/LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/flow/layers/default_layer_builder.cc -FILE: ../../../flutter/flow/layers/default_layer_builder.h -FILE: ../../../flutter/flow/layers/layer_builder.cc -FILE: ../../../flutter/flow/layers/layer_builder.h -FILE: ../../../flutter/shell/platform/embedder/embedder.h +FILE: ../../../flutter/content_handler/application.cc +FILE: ../../../flutter/content_handler/application.h +FILE: ../../../flutter/content_handler/application_runner.cc +FILE: ../../../flutter/content_handler/application_runner.h +FILE: ../../../flutter/content_handler/compositor_context.cc +FILE: ../../../flutter/content_handler/compositor_context.h +FILE: ../../../flutter/content_handler/engine.cc +FILE: ../../../flutter/content_handler/engine.h +FILE: ../../../flutter/content_handler/isolate_configurator.cc +FILE: ../../../flutter/content_handler/isolate_configurator.h +FILE: ../../../flutter/content_handler/main.cc +FILE: ../../../flutter/content_handler/platform_view.cc +FILE: ../../../flutter/content_handler/platform_view.h +FILE: ../../../flutter/content_handler/surface.cc +FILE: ../../../flutter/content_handler/surface.h +FILE: ../../../flutter/content_handler/task_observers.cc +FILE: ../../../flutter/content_handler/task_observers.h +FILE: ../../../flutter/content_handler/unique_fdio_ns.h ---------------------------------------------------------------------------------------------------- -Copyright 2017 The Flutter Authors. All rights reserved. +Copyright 2018 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: engine +ORIGIN: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart +FILE: ../../../flutter/lib/ui/painting/image_encoding.cc +FILE: ../../../flutter/lib/ui/painting/image_encoding.h +FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1957,6 +2003,62 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: engine +ORIGIN: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../flutter/fml/file.h +FILE: ../../../flutter/fml/macros.h +FILE: ../../../flutter/fml/mapping.cc +FILE: ../../../flutter/fml/native_library.h +FILE: ../../../flutter/fml/paths.cc +FILE: ../../../flutter/fml/platform/fuchsia/paths_fuchsia.cc +FILE: ../../../flutter/fml/platform/posix/file_posix.cc +FILE: ../../../flutter/fml/platform/posix/native_library_posix.cc +FILE: ../../../flutter/fml/platform/win/file_win.cc +FILE: ../../../flutter/fml/platform/win/native_library_win.cc +FILE: ../../../flutter/fml/platform/win/wstring_conversion.h +FILE: ../../../flutter/fml/unique_fd.cc +FILE: ../../../flutter/fml/unique_fd.h +FILE: ../../../flutter/fml/unique_object.h +FILE: ../../../flutter/shell/common/isolate_configuration.cc +FILE: ../../../flutter/shell/common/isolate_configuration.h +FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc +FILE: ../../../flutter/shell/platform/android/android_shell_holder.h +FILE: ../../../flutter/shell/platform/android/platform_message_response_android.cc +FILE: ../../../flutter/shell/platform/android/platform_message_response_android.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: engine ORIGIN: ../../../flutter/lib/ui/painting/image.cc + ../../../LICENSE @@ -9873,10 +9975,6 @@ FILE: ../../../flutter/lib/ui/window.dart FILE: ../../../flutter/lib/ui/window/pointer_data.cc FILE: ../../../flutter/lib/ui/window/pointer_data_packet.cc FILE: ../../../flutter/lib/ui/window/window.cc -FILE: ../../../flutter/runtime/dart_controller.cc -FILE: ../../../flutter/runtime/dart_controller.h -FILE: ../../../flutter/runtime/dart_init.cc -FILE: ../../../flutter/runtime/dart_init.h FILE: ../../../flutter/runtime/dart_service_isolate.cc FILE: ../../../flutter/runtime/dart_service_isolate.h FILE: ../../../flutter/runtime/platform_impl.cc @@ -9896,13 +9994,9 @@ FILE: ../../../flutter/shell/common/rasterizer.cc FILE: ../../../flutter/shell/common/rasterizer.h FILE: ../../../flutter/shell/common/shell.cc FILE: ../../../flutter/shell/common/shell.h -FILE: ../../../flutter/shell/common/tracing_controller.cc -FILE: ../../../flutter/shell/common/tracing_controller.h FILE: ../../../flutter/shell/common/vsync_waiter.cc FILE: ../../../flutter/shell/common/vsync_waiter.h FILE: ../../../flutter/shell/common/vsync_waiter_fallback.h -FILE: ../../../flutter/shell/gpu/gpu_rasterizer.cc -FILE: ../../../flutter/shell/gpu/gpu_rasterizer.h FILE: ../../../flutter/shell/platform/android/AndroidManifest.xml FILE: ../../../flutter/shell/platform/android/flutter_main.cc FILE: ../../../flutter/shell/platform/android/flutter_main.h @@ -9915,12 +10009,6 @@ FILE: ../../../flutter/shell/platform/android/library_loader.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.cc FILE: ../../../flutter/shell/platform/android/platform_view_android.h FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h -FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.h -FILE: ../../../flutter/shell/platform/darwin/common/platform_mac.mm -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_app_delegate.m -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_application.mm FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.h FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.mm FILE: ../../../flutter/shell/platform/darwin/desktop/main_mac.mm @@ -9930,8 +10018,6 @@ FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.cc FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm -FILE: ../../../flutter/shell/platform/linux/main_linux.cc -FILE: ../../../flutter/shell/platform/win/main_win.cc FILE: ../../../flutter/sky/engine/wtf/Allocator.h FILE: ../../../flutter/sky/engine/wtf/MakeUnique.h ---------------------------------------------------------------------------------------------------- @@ -9968,6 +10054,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: engine ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd +FILE: ../../../flutter/fml/memory/thread_checker.h FILE: ../../../flutter/fml/memory/weak_ptr.h FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc FILE: ../../../flutter/fml/memory/weak_ptr_internal.h @@ -10001,4 +10088,4 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -Total license count: 216 +Total license count: 218 From 4e0fbb6f017fa571d53b01b740375c3e8bd0cee9 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 13 Apr 2018 15:07:28 -0700 Subject: [PATCH 0100/1190] If the test specifies a .dill file, dont make the engine interpret is as source. (#5002) --- runtime/dart_vm.cc | 14 ++++++-------- shell/testing/tester_main.cc | 28 ++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index bb46779078583..e42f3e0e1401b 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -342,14 +342,12 @@ DartVM::DartVM(const Settings& settings, const bool is_preview_dart2 = platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; - if (is_preview_dart2) { - FXL_DLOG(INFO) << "Dart 2 is enabled."; - } else { - FXL_DLOG(INFO) << "Dart 2 is NOT enabled. Platform kernel: " - << static_cast(platform_kernel_) - << " Isolate Snapshot is Dart 2: " - << isolate_snapshot_is_dart_2; - } + FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? " is" : "is NOT") + << "enabled. Platform kernel: " + << static_cast(platform_kernel_) + << " Isolate Snapshot is Dart 2: " + << isolate_snapshot_is_dart_2; + if (is_preview_dart2) { PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); if (use_checked_mode) { diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc index a8afd325033bc..97af6dd847270 100644 --- a/shell/testing/tester_main.cc +++ b/shell/testing/tester_main.cc @@ -17,6 +17,7 @@ #include "flutter/shell/common/shell.h" #include "flutter/shell/common/switches.h" #include "flutter/shell/common/thread_host.h" +#include "lib/fxl/files/path.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/fxl/synchronization/waitable_event.h" #include "third_party/dart/runtime/bin/embedded_dart_io.h" @@ -89,6 +90,19 @@ class ScriptCompletionTaskObserver { FXL_DISALLOW_COPY_AND_ASSIGN(ScriptCompletionTaskObserver); }; +static bool FileNameIsDill(const std::string& name) { + const std::string suffix = ".dill"; + + if (name.size() < suffix.size()) { + return false; + } + + if (name.rfind(suffix, name.size()) == name.size() - suffix.size()) { + return true; + } + return false; +} + int RunTester(const blink::Settings& settings, bool run_forever) { const auto thread_label = "io.flutter.test"; @@ -124,8 +138,18 @@ int RunTester(const blink::Settings& settings, bool run_forever) { return EXIT_FAILURE; } - auto isolate_configuration = IsolateConfiguration::CreateForSource( - settings.main_dart_file_path, settings.packages_file_path); + if (settings.main_dart_file_path.empty()) { + FXL_LOG(ERROR) << "Main dart file not specified."; + return EXIT_FAILURE; + } + + auto isolate_configuration = + FileNameIsDill(settings.main_dart_file_path) + ? IsolateConfiguration::CreateForSnapshot( + std::make_unique( + files::AbsolutePath(settings.main_dart_file_path), false)) + : IsolateConfiguration::CreateForSource(settings.main_dart_file_path, + settings.packages_file_path); if (!isolate_configuration) { FXL_LOG(ERROR) << "Could create isolate configuration."; From c386418f129a5795c2d7ae2fa76f014614c69f68 Mon Sep 17 00:00:00 2001 From: Anatoly Pulyaevskiy Date: Fri, 13 Apr 2018 15:26:52 -0700 Subject: [PATCH 0101/1190] Promote line height in text style created from paragraph style (#4995) --- third_party/txt/src/txt/paragraph_style.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/txt/src/txt/paragraph_style.cc b/third_party/txt/src/txt/paragraph_style.cc index 362f138bb3056..5c00409782cdc 100644 --- a/third_party/txt/src/txt/paragraph_style.cc +++ b/third_party/txt/src/txt/paragraph_style.cc @@ -25,6 +25,7 @@ TextStyle ParagraphStyle::GetTextStyle() const { result.font_family = font_family; result.font_size = font_size; result.locale = locale; + result.height = line_height; return result; } From 0b9cef5a955f81d43db2b0562b73b392c5a65bc4 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 13 Apr 2018 15:46:54 -0700 Subject: [PATCH 0102/1190] Minor update to README (#5003) * Adds a docs directory with an architecture diagram from @chinmaygarde. * Excludes the flutter/docs directory from license script. --- README.md | 11 ++++++++--- docs/flutter_overview.svg | 1 + tools/licenses/lib/main.dart | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 docs/flutter_overview.svg diff --git a/README.md b/README.md index 763035baaee5c..e52c496b97518 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,14 @@ Flutter is a new way to build high-performance, cross-platform mobile apps. Flutter is optimized for today's, and tomorrow's, mobile devices. We are focused on low-latency input and high frame rates on Android and iOS. -The Flutter Engine is the runtime environment for hosting Flutter applications. -Most developers will interact with Flutter via the Flutter Framework and APIs, -which run inside the engine. +The Flutter Engine is a portable runtime for hosting +[Flutter](https://flutter.io) applications. It implements Flutter's core +libraries, including animation and graphics, file and network I/O, +accessibility support, plugin architecture, and a Dart runtime and compile +toolchain. Most developers wil interact with Flutter via the [Flutter +Framework](https://github.com/flutter/flutter), which provides a modern, +reactive framework, and a rich set of platform, layout and foundation widgets. + _Flutter is still under development and we continue to add features._ However, it is ready for use by early adopters who are willing to deal diff --git a/docs/flutter_overview.svg b/docs/flutter_overview.svg new file mode 100644 index 0000000000000..5955fcd2c9361 --- /dev/null +++ b/docs/flutter_overview.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index 2cf747123ed40..59443943a3683 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -2106,6 +2106,7 @@ class RepositoryFlutterDirectory extends RepositoryDirectory { bool shouldRecurse(fs.IoNode entry) { return entry.name != 'testing' && entry.name != 'tools' + && entry.name != 'docs' && entry.name != 'examples' && entry.name != 'build' && entry.name != 'travis' From 570231b7abfb00868853ffa9dffbb54f2486bb29 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 13 Apr 2018 16:17:38 -0700 Subject: [PATCH 0103/1190] Specify the packages file path when running engine dart tests. (#5005) --- runtime/dart_vm.cc | 2 +- testing/run_tests.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index e42f3e0e1401b..f58563f9aaf73 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -343,7 +343,7 @@ DartVM::DartVM(const Settings& settings, platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? " is" : "is NOT") - << "enabled. Platform kernel: " + << " enabled. Platform kernel: " << static_cast(platform_kernel_) << " Isolate Snapshot is Dart 2: " << isolate_snapshot_is_dart_2; diff --git a/testing/run_tests.sh b/testing/run_tests.sh index e84ce1c5509f1..73579c97160c3 100755 --- a/testing/run_tests.sh +++ b/testing/run_tests.sh @@ -16,8 +16,8 @@ popd ! out/host_debug_unopt/flutter_tester --disable-observatory --disable-diagnostic --non-interactive --enable-checked-mode --packages=flutter/testing/dart/.packages flutter/testing/fail_test.dart for TEST_SCRIPT in flutter/testing/dart/*.dart; do - out/host_debug_unopt/flutter_tester --disable-observatory --disable-diagnostic --non-interactive --enable-checked-mode $TEST_SCRIPT - out/host_debug_unopt/flutter_tester --disable-observatory --disable-diagnostic --non-interactive $TEST_SCRIPT + out/host_debug_unopt/flutter_tester --disable-observatory --disable-diagnostic --non-interactive --enable-checked-mode --packages=flutter/testing/dart/.packages $TEST_SCRIPT + out/host_debug_unopt/flutter_tester --disable-observatory --disable-diagnostic --non-interactive --packages=flutter/testing/dart/.packages $TEST_SCRIPT done pushd flutter From 91dee5981f6ed5fe4c06c37b1fd15d07255fbb17 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 13 Apr 2018 16:58:27 -0700 Subject: [PATCH 0104/1190] If the rasterizer has a valid surface context, use that to create a snapshotting render target. (#4979) --- shell/common/rasterizer.cc | 69 +++++++++--- .../ios/framework/Source/FlutterView.mm | 100 ++++++++---------- 2 files changed, 98 insertions(+), 71 deletions(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 5a519b3efea26..20f74cecb8591 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -10,6 +10,7 @@ #include "third_party/skia/include/core/SkImageEncoder.h" #include "third_party/skia/include/core/SkPictureRecorder.h" #include "third_party/skia/include/core/SkSurface.h" +#include "third_party/skia/include/core/SkSurfaceCharacterization.h" #include "third_party/skia/src/utils/SkBase64.h" namespace shell { @@ -130,27 +131,67 @@ static sk_sp ScreenshotLayerTreeAsPicture(flow::LayerTree* tree) { return recorder.finishRecordingAsPicture(); } +static sk_sp CreateSnapshotSurface(GrContext* surface_context, + const SkISize& size) { + const auto image_info = SkImageInfo::MakeN32Premul(size); + if (surface_context) { + // There is a rendering surface that may contain textures that are going to + // be referenced in the layer tree about to be drawn. + return SkSurface::MakeRenderTarget(surface_context, // + SkBudgeted::kNo, // + image_info // + ); + } + + // There is no rendering surface, assume no GPU textures are present and + // create a raster surface. + return SkSurface::MakeRaster(image_info); +} + static sk_sp ScreenshotLayerTreeAsImage(flow::LayerTree* tree, + GrContext* surface_context, bool compressed) { - const SkISize& frame_size = tree->frame_size(); - SkBitmap bitmap; - if (!bitmap.tryAllocN32Pixels(frame_size.width(), frame_size.height())) { + // Attempt to create a snapshot surface depending on whether we have access to + // a valid GPU rendering context. + auto snapshot_surface = + CreateSnapshotSurface(surface_context, tree->frame_size()); + if (snapshot_surface == nullptr) { return nullptr; } - auto bitmap_surface = SkSurface::MakeRasterDirect( - bitmap.info(), bitmap.getPixels(), bitmap.rowBytes()); + + // Draw the current layer tree into the snapshot surface. flow::CompositorContext compositor_context; - auto canvas = bitmap_surface->getCanvas(); - auto frame = compositor_context.AcquireFrame(nullptr, canvas, false); + auto canvas = snapshot_surface->getCanvas(); + auto frame = compositor_context.AcquireFrame(surface_context, canvas, false); canvas->clear(SK_ColorBLACK); frame->Raster(*tree, true); canvas->flush(); + + // Prepare an image from the surface, this image may potentially be on th GPU. + auto potentially_gpu_snapshot = snapshot_surface->makeImageSnapshot(); + if (!potentially_gpu_snapshot) { + return nullptr; + } + + // Copy the GPU image snapshot into CPU memory. + auto cpu_snapshot = potentially_gpu_snapshot->makeRasterImage(); + if (!cpu_snapshot) { + return nullptr; + } + + // If the caller want the pixels to be compressed, there is a Skia utilitiy to + // compress to PNG. Use that. if (compressed) { - return SkEncodeBitmap(bitmap, SkEncodedImageFormat::kPNG, 100); - } else { - return SkData::MakeWithCopy(bitmap.getPixels(), bitmap.computeByteSize()); + return cpu_snapshot->encodeToData(); + } + + // Copy it into a bitmap and return the same. + SkPixmap pixmap; + if (!cpu_snapshot->peekPixels(&pixmap)) { + return nullptr; } - return nullptr; + + return SkData::MakeWithCopy(pixmap.addr32(), pixmap.computeByteSize()); } Rasterizer::Screenshot Rasterizer::ScreenshotLastLayerTree( @@ -164,15 +205,17 @@ Rasterizer::Screenshot Rasterizer::ScreenshotLastLayerTree( sk_sp data = nullptr; + GrContext* surface_context = surface_ ? surface_->GetContext() : nullptr; + switch (type) { case ScreenshotType::SkiaPicture: data = ScreenshotLayerTreeAsPicture(layer_tree)->serialize(); break; case ScreenshotType::UncompressedImage: - data = ScreenshotLayerTreeAsImage(layer_tree, false); + data = ScreenshotLayerTreeAsImage(layer_tree, surface_context, false); break; case ScreenshotType::CompressedImage: - data = ScreenshotLayerTreeAsImage(layer_tree, true); + data = ScreenshotLayerTreeAsImage(layer_tree, surface_context, true); break; } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 27e3d48c4cb50..1f49acd7e66fd 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -7,6 +7,7 @@ #include "flutter/common/settings.h" #include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" +#include "flutter/fml/platform/darwin/cf_utils.h" #include "flutter/fml/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" @@ -76,61 +77,13 @@ - (BOOL)enableInputClicksWhenVisible { return YES; } -static void SnapshotRasterizer(fml::WeakPtr rasterizer, - CGContextRef context, - bool is_opaque) { - if (!rasterizer) { - return; - } +- (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { + TRACE_EVENT0("flutter", "SnapshotFlutterView"); - // Access the layer tree and assess the description of the backing store to - // create for this snapshot. - flow::LayerTree* layer_tree = rasterizer->GetLastLayerTree(); - if (layer_tree == nullptr) { - return; - } - auto size = layer_tree->frame_size(); - if (size.isEmpty()) { + if (layer != self.layer || context == nullptr) { return; } - auto info = SkImageInfo::MakeN32( - size.width(), size.height(), - is_opaque ? SkAlphaType::kOpaque_SkAlphaType : SkAlphaType::kPremul_SkAlphaType); - - // Create the backing store and prepare for use. - SkBitmap bitmap; - bitmap.setInfo(info); - if (!bitmap.tryAllocPixels()) { - return; - } - - // Create a canvas from the backing store and a single use compositor context - // to draw into the canvas. - - SkCanvas canvas(bitmap); - - flow::CompositorContext compositor_context; - - if (auto frame = compositor_context.AcquireFrame(nullptr, &canvas, false /* instrumentation */)) { - layer_tree->Preroll(*frame, true /* ignore raster cache */); - layer_tree->Paint(*frame); - } - - canvas.flush(); - // Draw the bitmap to the system provided snapshotting context. - SkCGDrawBitmap(context, bitmap, 0, 0); -} - -// Override the default CALayerDelegate method so that APIs that attempt to -// screenshot the view display contents correctly. We cannot depend on -// reading -// GPU pixels directly because: -// 1: We dont use retained backing on the CAEAGLLayer. -// 2: The call is made of the platform thread and not the GPU thread. -// 3: There may be a software rasterizer. -- (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { - TRACE_EVENT0("flutter", "SnapshotFlutterView"); FlutterViewController* controller = [self flutterViewController]; if (controller == nil) { @@ -139,13 +92,44 @@ - (void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context { auto& shell = [controller shell]; - fxl::AutoResetWaitableEvent latch; - shell.GetTaskRunners().GetGPUTaskRunner()->PostTask( - [&latch, rasterizer = shell.GetRasterizer(), context, opaque = layer.opaque]() { - SnapshotRasterizer(std::move(rasterizer), context, opaque); - latch.Signal(); - }); - latch.Wait(); + auto screenshot = shell.Screenshot(shell::Rasterizer::ScreenshotType::UncompressedImage, + false /* base64 encode */); + + if (!screenshot.data || screenshot.data->isEmpty() || screenshot.frame_size.isEmpty()) { + return; + } + + NSData* data = [NSData dataWithBytes:const_cast(screenshot.data->data()) + length:screenshot.data->size()]; + + fml::CFRef image_data_provider( + CGDataProviderCreateWithCFData(reinterpret_cast(data))); + + fml::CFRef colorspace(CGColorSpaceCreateDeviceRGB()); + + fml::CFRef image(CGImageCreate( + screenshot.frame_size.width(), // size_t width + screenshot.frame_size.height(), // size_t height + 8, // size_t bitsPerComponent + 32, // size_t bitsPerPixel, + 4 * screenshot.frame_size.width(), // size_t bytesPerRow + colorspace, // CGColorSpaceRef space + static_cast(kCGImageAlphaPremultipliedLast | + kCGBitmapByteOrder32Big), // CGBitmapInfo bitmapInfo + image_data_provider, // CGDataProviderRef provider + nullptr, // const CGFloat* decode + false, // bool shouldInterpolate + kCGRenderingIntentDefault // CGColorRenderingIntent intent + )); + + const CGRect frame_rect = + CGRectMake(0.0, 0.0, screenshot.frame_size.width(), screenshot.frame_size.height()); + + CGContextSaveGState(context); + CGContextTranslateCTM(context, 0.0, CGBitmapContextGetHeight(context)); + CGContextScaleCTM(context, 1.0, -1.0); + CGContextDrawImage(context, frame_rect, image); + CGContextRestoreGState(context); } @end From 0b7d6be9765a2ba34bb45c99cbfda817423b779c Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 13 Apr 2018 17:08:00 -0700 Subject: [PATCH 0105/1190] Re-land "do not pause rendering when android view loses focus" (#5004) * do not pause rendering when android view loses focus --- lib/ui/window.dart | 12 ++++++++---- .../android/io/flutter/app/FlutterActivity.java | 6 ++++++ .../io/flutter/app/FlutterActivityDelegate.java | 5 +++++ .../io/flutter/app/FlutterActivityEvents.java | 5 +++++ .../io/flutter/app/FlutterFragmentActivity.java | 6 ++++++ .../android/io/flutter/view/FlutterView.java | 4 ++-- 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index 26b7021929ed3..05bf0b73a9f81 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -47,10 +47,14 @@ enum AppLifecycleState { /// in the foreground inactive state. Apps transition to this state when in /// a phone call, responding to a TouchID request, when entering the app /// switcher or the control center, or when the UIViewController hosting the - /// Flutter app is transitioning. Apps in this state should assume that they - /// may be [paused] at any time. - /// - /// On Android, this state is currently unused. + /// Flutter app is transitioning. + /// + /// On Android, this corresponds to an app or the Flutter host view running + /// in the foreground inactive state. Apps transition to this state when + /// another activity is focused, such as a split-screen app, a phone call, + /// a picture-in-picture app, a system dialog, or another window. + /// + /// Apps in this state should assume that they may be [paused] at any time. inactive, /// The application is not currently visible to the user, not responding to diff --git a/shell/platform/android/io/flutter/app/FlutterActivity.java b/shell/platform/android/io/flutter/app/FlutterActivity.java index f01e85a1a2437..ab566c485a1e6 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterActivity.java @@ -99,6 +99,12 @@ public void onBackPressed() { super.onBackPressed(); } } + + @Override + protected void onStop() { + eventDelegate.onStop(); + super.onStop(); + } @Override protected void onPause() { diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index 9de35c4b480a7..1c880d7e46987 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -218,6 +218,11 @@ public void onResume() { } } + @Override + public void onStop() { + flutterView.onStop(); + } + @Override public void onPostResume() { if (flutterView != null) { diff --git a/shell/platform/android/io/flutter/app/FlutterActivityEvents.java b/shell/platform/android/io/flutter/app/FlutterActivityEvents.java index 98a3a1016c85f..8d8eb422aa338 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityEvents.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityEvents.java @@ -54,6 +54,11 @@ public interface FlutterActivityEvents */ void onDestroy(); + /** + * @see android.app.Activity#onStop() + */ + void onStop(); + /** * Invoked when the activity has detected the user's press of the back key. * diff --git a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java index cc8325df974e8..050c5cd23219a 100644 --- a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java @@ -98,6 +98,12 @@ public void onBackPressed() { } } + @Override + protected void onStop() { + eventDelegate.onStop(); + super.onStop(); + } + @Override protected void onPause() { super.onPause(); diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 6b8f6b47f6fd4..38b0df20b96c2 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -267,7 +267,7 @@ public void addActivityLifecycleListener(ActivityLifecycleListener listener) { } public void onPause() { - mFlutterLifecycleChannel.send("AppLifecycleState.paused"); + mFlutterLifecycleChannel.send("AppLifecycleState.inactive"); } public void onPostResume() { @@ -278,7 +278,7 @@ public void onPostResume() { } public void onStop() { - mFlutterLifecycleChannel.send("AppLifecycleState.suspending"); + mFlutterLifecycleChannel.send("AppLifecycleState.paused"); } public void onMemoryPressure() { From f4ebb180783fae8b9cf62e827b727fc98c5e279e Mon Sep 17 00:00:00 2001 From: Ravi Mistry Date: Sun, 15 Apr 2018 12:54:29 -0400 Subject: [PATCH 0106/1190] Roll src/third_party/skia/ 3462eb034..e669bdfad (54 commits) (#5007) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://skia.googlesource.com/skia.git/+log/3462eb0346de..e669bdfad6d5 $ git log 3462eb034..e669bdfad --date=short --no-merges --format='%ad %ae %s' 2018-04-14 angle-skia-autoroll Roll third_party/externals/angle2/ 983c429fa..152152618 (7 commits) 2018-04-13 ethannicholas fix sksl standalone build error 2018-04-13 borenet Blacklist check_small_sigma_offset on Chromecast 2018-04-13 reed remove unused virtual onNotifyPixelsChanged 2018-04-13 reed rewrite iterator to make msvc happy 2018-04-13 brianosman Support downscaling to max texture size when making cross-context images 2018-04-13 borenet Add a MSVS bot to the CQ 2018-04-13 liyuqian Clone the xpos array in drawPosText 2018-04-13 ethannicholas added sk_LastFragColor 2018-04-13 reed Revert "add test for degenerate canvas dimension" 2018-04-13 reed add test for degenerate canvas dimension 2018-04-13 robertphillips Don't try to readback from the GPU for small blur sigmas 2017-12-20 herb Make a GM for checking blur bounds. 2018-04-13 angle-skia-autoroll Roll third_party/externals/angle2/ cc1293775..983c429fa (1 commit) 2018-04-13 fmalita [skottie] Harden json string parsing 2018-04-13 caryclark path is rect bug number nine 2018-04-13 hcm Update Skia milestone to 68 2018-04-13 angle-skia-autoroll Roll third_party/externals/angle2/ ed8d5ec73..cc1293775 (1 commit) 2018-04-12 liyuqian Limit our IsBadForDAA for stroke width > 0 and <= 2 2018-04-12 csmartdalton ccpr: Actually blacklist ANGLE 2018-04-12 angle-skia-autoroll Roll third_party/externals/angle2/ 14f4817c4..ed8d5ec73 (8 commits) 2018-04-12 reed can't abort looper loop, as saveCount won't be balanced 2018-04-12 egdaniel Don't create lazy proxys if their width/height is greater than max tex size 2018-04-12 robertphillips Actually generate the gm images on the DDL1 bot 2018-04-12 caryclark son of path is rect bug 2018-04-12 ethannicholas workaround for buggy macOS GLSL shader compiler 2018-04-12 egdaniel Delete getRenderTargetHandle call on SkSurface. 2018-04-12 reed check for non-finite values output by clipper 2018-04-12 brianosman Fail fast when trying to make a texture that's too large 2018-04-12 djsollen Include shadow ops in the debugger. 2018-04-11 liyuqian Reland "Add private fIsBadForDAA bit to SkPath" 2018-04-12 reed add conservative bounds to raster tiling 2018-04-12 reed always clear the looper when we're unrolling it, to not confused devices 2018-04-11 robertphillips Disable CCPR and the small path renderer on DDL1 bot 2018-04-12 caryclark another rect is path fix 2018-04-11 robertphillips Add SK_SUPPORT_LEGACY_BACKEND_OBJECTS 2018-04-11 csmartdalton Implement Sk2f Load2 2018-04-11 csmartdalton ccpr: Blacklist ANGLE again 2018-04-11 robertphillips Allow SkImage_Gpu to fail some requests in DDL mode 2018-04-11 cwallez update_meta_config: Use new LUCI optional GPU trybot on Windows 2018-04-11 csmartdalton Implement Sk4f min/max 2018-04-11 liyuqian Remove obsolete comment 2018-04-11 benjaminwagner Upgrade PixelC and NexusPlayer OS. 2018-04-12 angle-skia-autoroll Roll third_party/externals/angle2/ 2dadd1d08..14f4817c4 (2 commits) 2018-04-11 caryclark fix bm gm 2018-04-12 mtklein skcms→1654786 concat gamut transform matrices together 2018-04-11 fmalita Reland "Fix handling of MaskFilter matrices" 2018-04-11 angle-skia-autoroll Roll third_party/externals/angle2/ 785b20b7a..2dadd1d08 (11 commits) 2018-04-11 benjaminwagner Upgrade Windows Skolo bots. 2018-04-11 reed remove unused/dumb methods from SkRect 2018-04-11 reed Clean-up paints for drawImage (etc.) to enforce that we always ignore stroking and patheffects. 2018-04-11 caryclark more path is rect bugs 2018-04-11 mtklein skcms→9334796 reject non-XYZ/Lab PCS profiles 2018-04-11 liyuqian Revert "Add private fIsBadForDAA bit to SkPath" Created with: roll-dep src/third_party/skia --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 1487 +++++++++---------- travis/licenses_golden/licenses_third_party | 5 +- 3 files changed, 713 insertions(+), 781 deletions(-) diff --git a/DEPS b/DEPS index 4634616669906..7c0ee5ac4d171 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3462eb0346de0ad645bae96246d57c98521f1ffc', + 'skia_revision': 'e669bdfad6d5f6011e539c0631ea76e392462fa7', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 77240f32c8ef4..5c65f720ed0a8 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -1,194 +1,5 @@ boringssl -27287883 - -OpenSSL License - - ==================================================================== - Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - - 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - - 5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - - THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - ==================================================================== - - This product includes cryptographic software written by Eric Young - (eay@cryptsoft.com). This product includes software written by Tim - Hudson (tjh@cryptsoft.com). - -Original SSLeay License - -* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -* All rights reserved. - -* This package is an SSL implementation written -* by Eric Young (eay@cryptsoft.com). -* The implementation was written so as to conform with Netscapes SSL. - -* This library is free for commercial and non-commercial use as long as -* the following conditions are aheared to. The following conditions -* apply to all code found in this distribution, be it the RC4, RSA, -* lhash, DES, etc., code; not just the SSL code. The SSL documentation -* included with this distribution is covered by the same copyright terms -* except that the holder is Tim Hudson (tjh@cryptsoft.com). - -* Copyright remains Eric Young's, and as such any Copyright notices in -* the code are not to be removed. -* If this package is used in a product, Eric Young should be given attribution -* as the author of the parts of the library used. -* This can be in the form of a textual message at program startup or -* in documentation (online or textual) provided with the package. - -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the copyright -* notice, this list of conditions and the following disclaimer. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* 3. All advertising materials mentioning features or use of this software -* must display the following acknowledgement: -* "This product includes cryptographic software written by -* Eric Young (eay@cryptsoft.com)" -* The word 'cryptographic' can be left out if the rouines from the library -* being used are not cryptographic related :-). -* 4. If you include any Windows specific code (or a derivative thereof) from -* the apps directory (application code) you must include an acknowledgement: -* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGE. - -* The licence and distribution terms for any publically available version or -* derivative of this code cannot be changed. i.e. this code cannot simply be -* copied and put under another distribution licence -* [including the GNU Public Licence.] - -ISC license used for completely new code in BoringSSL: - -/* Copyright (c) 2015, Google Inc. - - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Some files from Intel carry the following license: - -# Copyright (c) 2012, Intel Corporation - -# All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: - -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. - -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the -# distribution. - -# * Neither the name of the Intel Corporation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. - -# THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""AS IS"" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The code in third_party/fiat carries the MIT license: - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl - Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) All rights reserved. @@ -1970,40 +1781,6 @@ OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -Copyright (c) 2012, Intel Corporation - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. - -* Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""AS IS"" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - Copyright (c) 2013 The OpenSSL Project. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -2107,22 +1884,6 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- boringssl -Copyright (c) 2014, Intel Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - Copyright (c) 2015 The OpenSSL Project. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -2400,6 +2161,37 @@ OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl +Copyright 2003 Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + Copyright 2005 Nokia. All rights reserved. The portions of the attached software ("Contribution") is developed by @@ -2427,100 +2219,22 @@ OTHERWISE. -------------------------------------------------------------------------------- boringssl -Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2005, Google Inc. +All rights reserved. -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2016 Brian Smith. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -The MIT License (MIT) - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2003 Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -2535,9 +2249,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest -Copyright 2005, Google Inc. +Copyright 2006, Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -2567,9 +2280,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest -Copyright 2006, Google Inc. +Copyright 2007, Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -2599,39 +2311,15 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest - -Copyright 2007, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -gtest Copyright 2008 Google Inc. All Rights Reserved. @@ -2663,7 +2351,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2008, Google Inc. All rights reserved. @@ -2695,7 +2382,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2009 Google Inc. All Rights Reserved. @@ -2727,7 +2413,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2009 Google Inc. All Rights Reserved. @@ -2758,7 +2443,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2009, Google Inc. All rights reserved. @@ -2790,7 +2474,44 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest + +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2012, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2014, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl Copyright 2015, Google Inc. All rights reserved. @@ -2821,6 +2542,209 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- +boringssl + +Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2016 Brian Smith. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +OpenSSL License + + ==================================================================== + Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + + 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + + 5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + + THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ==================================================================== + + This product includes cryptographic software written by Eric Young + (eay@cryptsoft.com). This product includes software written by Tim + Hudson (tjh@cryptsoft.com). + +Original SSLeay License + +* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +* All rights reserved. + +* This package is an SSL implementation written +* by Eric Young (eay@cryptsoft.com). +* The implementation was written so as to conform with Netscapes SSL. + +* This library is free for commercial and non-commercial use as long as +* the following conditions are aheared to. The following conditions +* apply to all code found in this distribution, be it the RC4, RSA, +* lhash, DES, etc., code; not just the SSL code. The SSL documentation +* included with this distribution is covered by the same copyright terms +* except that the holder is Tim Hudson (tjh@cryptsoft.com). + +* Copyright remains Eric Young's, and as such any Copyright notices in +* the code are not to be removed. +* If this package is used in a product, Eric Young should be given attribution +* as the author of the parts of the library used. +* This can be in the form of a textual message at program startup or +* in documentation (online or textual) provided with the package. + +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* 1. Redistributions of source code must retain the copyright +* notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* 3. All advertising materials mentioning features or use of this software +* must display the following acknowledgement: +* "This product includes cryptographic software written by +* Eric Young (eay@cryptsoft.com)" +* The word 'cryptographic' can be left out if the rouines from the library +* being used are not cryptographic related :-). +* 4. If you include any Windows specific code (or a derivative thereof) from +* the apps directory (application code) you must include an acknowledgement: +* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +* SUCH DAMAGE. + +* The licence and distribution terms for any publically available version or +* derivative of this code cannot be changed. i.e. this code cannot simply be +* copied and put under another distribution licence +* [including the GNU Public Licence.] + +ISC license used for completely new code in BoringSSL: + +/* Copyright (c) 2015, Google Inc. + + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +The code in third_party/fiat carries the MIT license: + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +The MIT License (MIT) + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- colorama Copyright (c) 2010 Jonathan Hartley @@ -2943,7 +2867,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -2972,7 +2896,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3001,7 +2925,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3030,7 +2954,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright 2009 The Go Authors. All rights reserved. +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -3058,7 +2983,38 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright 2012, the Dart project authors. All rights reserved. +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -3084,10 +3040,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -observatory_pub_packages -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -3114,11 +3068,8 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2012, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -3146,7 +3097,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. dart observatory_pub_packages -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -8643,6 +8594,36 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +Copyright 2018 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 @@ -9119,220 +9100,11 @@ necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! --------------------------------------------------------------------------------- -engine -etc1 -observatory_pub_packages -skia -txt -vulkan - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! -------------------------------------------------------------------------------- engine garnet @@ -9484,6 +9256,38 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz + +Copyright 2018 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -10030,43 +9834,251 @@ necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. - , 1 April 1990 - Ty Coon, President of Vice + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +-------------------------------------------------------------------------------- +engine +icu +skia +topaz + +Copyright 2016 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +observatory_pub_packages +skia +txt +vulkan + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS -That's all there is to it! --------------------------------------------------------------------------------- -engine -icu -skia -topaz +APPENDIX: How to apply the Apache License to your work. -Copyright 2016 The Chromium Authors. All rights reserved. + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Copyright [yyyy] [name of copyright owner] - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. -------------------------------------------------------------------------------- engine topaz @@ -10845,37 +10857,6 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet -topaz - -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -14168,28 +14149,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- observatory_pub_packages -Copyright (c) 2006 Kirill Simonov - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -observatory_pub_packages - Copyright (c) 2006-2012 The Authors Contributors: @@ -14247,36 +14206,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- observatory_pub_packages -Copyright (c) 2012 The Polymer Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. @@ -14384,36 +14313,6 @@ met: -------------------------------------------------------------------------------- observatory_pub_packages -Copyright (c) 2014 The Polymer Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - Copyright (c) 2014, Michael Bostock and Google Inc. All rights reserved. @@ -14538,7 +14437,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- observatory_pub_packages -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2017, the Dart project authors. +Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -14569,7 +14469,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- observatory_pub_packages -Copyright 2013, the Dart project authors. All rights reserved. +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -14598,11 +14500,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- observatory_pub_packages -Copyright 2014 The Dart project authors. All rights reserved. - +Copyright 2013, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above @@ -14612,6 +14514,7 @@ met: * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -15333,6 +15236,37 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -------------------------------------------------------------------------------- +skcms +skia + +Copyright 2018 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- skia Copyright (C) 2006 Apple Computer, Inc. All rights reserved. @@ -16337,7 +16271,37 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- skia -Copyright 2018 Google Inc. +Copyright 2018 Google LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 Google, LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -17118,34 +17082,3 @@ freely, subject to the following restrictions: Jean-loup Gailly Mark Adler -------------------------------------------------------------------------------- -dart - -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- - diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5bf06a622f762..729eef0ad94e8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3140a324beedd4d57cf135c23e53b020 +Signature: 5ed1984ecfa631813666f1af34317dd8 UNUSED LICENSES: @@ -6069,8 +6069,6 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h FILE: ../../../third_party/dart/sdk/lib/js/_js.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart @@ -19500,6 +19498,7 @@ FILE: ../../../third_party/skia/gm/atlastext.cpp FILE: ../../../third_party/skia/gm/bitmaptiled.cpp FILE: ../../../third_party/skia/gm/blurignorexform.cpp FILE: ../../../third_party/skia/gm/blurimagevmask.cpp +FILE: ../../../third_party/skia/gm/blurpositioning.cpp FILE: ../../../third_party/skia/gm/blurtextsmallradii.cpp FILE: ../../../third_party/skia/gm/bug6643.cpp FILE: ../../../third_party/skia/gm/bug6783.cpp From 62aeab72c4ff8cb616cb1039aa14c191ecd4fc0c Mon Sep 17 00:00:00 2001 From: egdaniel Date: Mon, 16 Apr 2018 10:21:53 -0400 Subject: [PATCH 0107/1190] Call SkSurface::flush instead of getting a backend handle in vulkan_swapchain. (#5012) The old code called getBackendRenderTargetHandle() with a Read access to trigger the surface to flush, however the returned GrVkImageInfo was never used. This how process is equivalent to just calling flush on the surface so do that instead. --- vulkan/vulkan_swapchain.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/vulkan/vulkan_swapchain.cc b/vulkan/vulkan_swapchain.cc index cf1588314a51f..2eb6d6e1c7be2 100644 --- a/vulkan/vulkan_swapchain.cc +++ b/vulkan/vulkan_swapchain.cc @@ -486,15 +486,9 @@ bool VulkanSwapchain::Submit() { // --------------------------------------------------------------------------- // Step 0: - // Notify to Skia that we will read from its backend object. + // Make sure Skia has flushed all work for the surface to the gpu. // --------------------------------------------------------------------------- - GrVkImageInfo* image_info = nullptr; - if (!surface->getRenderTargetHandle( - reinterpret_cast(&image_info), - SkSurface::kFlushRead_BackendHandleAccess)) { - FXL_DLOG(INFO) << "Could not get render target handle."; - return false; - } + surface->flush(); // --------------------------------------------------------------------------- // Step 1: From d812a61727d304d131ccfa02b313835768457384 Mon Sep 17 00:00:00 2001 From: Ravi Mistry Date: Mon, 16 Apr 2018 13:36:56 -0400 Subject: [PATCH 0108/1190] Roll src/third_party/skia/ e669bdfad..276886160 (9 commits) (#5014) https://skia.googlesource.com/skia.git/+log/e669bdfad6d5..276886160ba9 $ git log e669bdfad..276886160 --date=short --no-merges --format='%ad %ae %s' 2018-04-16 borenet Revert "[infra] Run recipes through Kitchen" 2018-04-16 borenet [infra] Run recipes through Kitchen 2018-04-16 angle-skia-autoroll Roll third_party/externals/angle2/ 152152618..76b2c3852 (1 commit) 2018-04-15 rmistry Increase android compile timeout 2018-04-15 reed show flatness vectors in sample 2018-04-15 update-skps Update SKP version 2018-04-14 egdaniel Revert "Delete getRenderTargetHandle call on SkSurface." 2018-04-13 liyuqian Cumulate deltas even if they're out of the clip 2018-04-14 rmistry Reland "Whitespace change" Created with: roll-dep src/third_party/skia --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7c0ee5ac4d171..b76d268685531 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e669bdfad6d5f6011e539c0631ea76e392462fa7', + 'skia_revision': '276886160ba96748c901b7319ca8f876415269c6', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 729eef0ad94e8..c7a001683cbaf 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5ed1984ecfa631813666f1af34317dd8 +Signature: 11eed2d794a665c2ed961ab41d6006b7 UNUSED LICENSES: From 4eaf2c2feabf329bd6a040cf0470ca68bf8f5b14 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Mon, 16 Apr 2018 12:39:46 -0700 Subject: [PATCH 0109/1190] Return raw (unencoded) bytes in Image.toByteData() (#5008) Building image encoding into the engine bloated the binary size. This change will return raw bytes, and callers who use this functionality can take on the dependency on image encoding in their apps (via a Dart package or a platform plugin). Fixes https://github.com/flutter/flutter/issues/16537 --- lib/ui/painting.dart | 88 +++------------------------- lib/ui/painting/image.cc | 6 +- lib/ui/painting/image.h | 2 +- lib/ui/painting/image_encoding.cc | 91 ++++++++++++++++------------- lib/ui/painting/image_encoding.h | 6 +- testing/dart/encoding_test.dart | 94 +++++++++++++++++++----------- testing/dart/pubspec.yaml | 7 ++- testing/resources/4x4.png | Bin 0 -> 71 bytes testing/resources/square-80.jpg | Bin 928 -> 0 bytes testing/resources/square-80.webp | Bin 666 -> 0 bytes testing/resources/square.png | Bin 125 -> 0 bytes 11 files changed, 126 insertions(+), 168 deletions(-) create mode 100644 testing/resources/4x4.png delete mode 100644 testing/resources/square-80.jpg delete mode 100644 testing/resources/square-80.webp delete mode 100644 testing/resources/square.png diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 02c4b4986e194..96af472629912 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1196,80 +1196,6 @@ class Paint { } } -/// An encoding format to use with the [Image.toByteData]. -class EncodingFormat { - /// PNG format. - /// - /// A loss-less compression format for images. This format is well suited for - /// images with hard edges, such as screenshots or sprites, and images with - /// text. Transparency is supported. The PNG format supports images up to - /// 2,147,483,647 pixels in either dimension, though in practice available - /// memory provides a more immediate limitation on maximum image size. - /// - /// PNG images normally use the `.png` file extension and the `image/png` MIME - /// type. - /// - /// See also: - /// - /// * , the Wikipedia page on PNG. - /// * , the PNG standard. - const EncodingFormat.png() - : _format = _pngFormat, - _quality = 0; - - /// JPEG format. - /// - /// This format, strictly speaking called JFIF, is a lossy compression - /// graphics format that can handle images up to 65,535 pixels in either - /// dimension. The [quality] metric is a value in the range 0 to 100 that - /// controls the compression ratio. Values in the range of about 50 to 90 are - /// somewhat reasonable; values above 95 increase the file size with little - /// noticeable improvement to the quality, values below 50 drop the quality - /// substantially. - /// - /// This format is well suited for photographs. It is very poorly suited for - /// images with hard edges or text. It does not support transparency. - /// - /// JPEG images normally use the `.jpeg` file extension and the `image/jpeg` - /// MIME type. - /// - /// See also: - /// - /// * , the Wikipedia page on JPEG. - const EncodingFormat.jpeg({int quality = 80}) - : _format = _jpegFormat, - _quality = quality; - - /// WebP format. - /// - /// The WebP format supports both lossy and lossless compression; however, the - /// [Image.toByteData] method always uses lossy compression when [webp] is - /// specified. The [quality] metric is a value in the range 0 to 100 that - /// controls the compression ratio; higher values result in better quality but - /// larger file sizes, and vice versa. WebP images are limited to 16,383 - /// pixels in each direction (width and height). - /// - /// WebP images normally use the `.webp` file extension and the `image/webp` - /// MIME type. - /// - /// See also: - /// - /// * , the Wikipedia page on WebP. - const EncodingFormat.webp({int quality = 80}) - : _format = _webpFormat, - _quality = quality; - - final int _format; - final int _quality; - - // Be conservative with the formats we expose. It is easy to add new formats - // in future but difficult to remove. - // These values must be kept in sync with the logic in ToSkEncodedImageFormat. - static const int _jpegFormat = 0; - static const int _pngFormat = 1; - static const int _webpFormat = 2; -} - /// Opaque handle to raw decoded image data (pixels). /// /// To obtain an [Image] object, use [instantiateImageCodec]. @@ -1291,20 +1217,20 @@ class Image extends NativeFieldWrapperClass2 { /// Converts the [Image] object into a byte array. /// - /// The [format] is encoding format to be used. + /// The image bytes will be RGBA form, 8 bits per channel, row-primary. /// - /// Returns a future which complete with the binary image data (e.g a PNG or JPEG binary data) or - /// an error if encoding fails. - Future toByteData({EncodingFormat format: const EncodingFormat.jpeg()}) { + /// Returns a future that completes with the binary image data or an error + /// if encoding fails. + Future toByteData() { return _futurize((_Callback callback) { - return _toByteData(format._format, format._quality, (Uint8List encoded) { - callback(encoded.buffer.asByteData()); + return _toByteData((Uint8List encoded) { + callback(encoded?.buffer?.asByteData()); }); }); } /// Returns an error message on failure, null on success. - String _toByteData(int format, int quality, _Callback callback) native 'Image_toByteData'; + String _toByteData(_Callback callback) native 'Image_toByteData'; /// Release the resources used by this object. The object is no longer usable /// after this method is called. diff --git a/lib/ui/painting/image.cc b/lib/ui/painting/image.cc index a1b9b45cdc863..4704a9ae6600f 100644 --- a/lib/ui/painting/image.cc +++ b/lib/ui/painting/image.cc @@ -32,10 +32,8 @@ CanvasImage::CanvasImage() = default; CanvasImage::~CanvasImage() = default; -Dart_Handle CanvasImage::toByteData(int format, - int quality, - Dart_Handle callback) { - return EncodeImage(this, format, quality, callback); +Dart_Handle CanvasImage::toByteData(Dart_Handle callback) { + return GetImageBytes(this, callback); } void CanvasImage::dispose() { diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index aeec2a0149c73..3c6620fda25be 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -31,7 +31,7 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, int height() { return image_.get()->height(); } - Dart_Handle toByteData(int format, int quality, Dart_Handle callback); + Dart_Handle toByteData(Dart_Handle callback); void dispose(); diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index f010fce893d3e..952e77edda733 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -8,6 +8,7 @@ #include #include "flutter/common/task_runners.h" +#include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" @@ -17,6 +18,7 @@ #include "lib/tonic/typed_data/uint8_list.h" #include "third_party/skia/include/core/SkEncodedImageFormat.h" #include "third_party/skia/include/core/SkImage.h" +#include "third_party/skia/include/core/SkSurface.h" using tonic::DartInvoke; using tonic::DartPersistentValue; @@ -41,65 +43,70 @@ void InvokeDataCallback(std::unique_ptr callback, } } -sk_sp EncodeImage(sk_sp image, - SkEncodedImageFormat format, - int quality) { +sk_sp GetImageBytesAsRGBA(sk_sp image) { + TRACE_EVENT0("flutter", __FUNCTION__); + if (image == nullptr) { return nullptr; } - return image->encodeToData(format, quality); + + // Copy the GPU image snapshot into CPU memory. + auto cpu_snapshot = image->makeRasterImage(); + if (!cpu_snapshot) { + FXL_LOG(ERROR) << "Pixel copy failed."; + return nullptr; + } + + SkPixmap pixmap; + if (!cpu_snapshot->peekPixels(&pixmap)) { + FXL_LOG(ERROR) << "Pixel address is not available."; + return nullptr; + } + + if (pixmap.colorType() != kRGBA_8888_SkColorType) { + TRACE_EVENT0("flutter", "ConvertToRGBA"); + + // Convert the pixel data to N32 to adhere to our API contract. + const auto image_info = SkImageInfo::MakeN32Premul(image->width(), + image->height()); + auto surface = SkSurface::MakeRaster(image_info); + surface->writePixels(pixmap, 0, 0); + if (!surface->peekPixels(&pixmap)) { + FXL_LOG(ERROR) << "Pixel address is not available."; + return nullptr; + } + ASSERT(pixmap.colorType() == kRGBA_8888_SkColorType); + + const size_t pixmap_size = pixmap.computeByteSize(); + return SkData::MakeWithCopy(pixmap.addr32(), pixmap_size); + } else { + const size_t pixmap_size = pixmap.computeByteSize(); + return SkData::MakeWithCopy(pixmap.addr32(), pixmap_size); + } } -void EncodeImageAndInvokeDataCallback( +void GetImageBytesAndInvokeDataCallback( std::unique_ptr callback, sk_sp image, - SkEncodedImageFormat format, - int quality, fxl::RefPtr ui_task_runner) { - sk_sp encoded = EncodeImage(std::move(image), format, quality); + sk_sp buffer = GetImageBytesAsRGBA(std::move(image)); ui_task_runner->PostTask( - fxl::MakeCopyable([callback = std::move(callback), encoded]() mutable { - InvokeDataCallback(std::move(callback), std::move(encoded)); + fxl::MakeCopyable([callback = std::move(callback), buffer]() mutable { + InvokeDataCallback(std::move(callback), std::move(buffer)); })); } -SkEncodedImageFormat ToSkEncodedImageFormat(int format) { - // Map the formats exposed in flutter to formats supported in Skia. - // See: - // https://github.com/google/skia/blob/master/include/core/SkEncodedImageFormat.h - switch (format) { - case 0: - return SkEncodedImageFormat::kJPEG; - case 1: - return SkEncodedImageFormat::kPNG; - case 2: - return SkEncodedImageFormat::kWEBP; - default: - /* NOTREACHED */ - return SkEncodedImageFormat::kWEBP; - } -} - } // namespace -Dart_Handle EncodeImage(CanvasImage* canvas_image, - int format, - int quality, - Dart_Handle callback_handle) { +Dart_Handle GetImageBytes(CanvasImage* canvas_image, + Dart_Handle callback_handle) { if (!canvas_image) return ToDart("encode called with non-genuine Image."); if (!Dart_IsClosure(callback_handle)) return ToDart("Callback must be a function."); - SkEncodedImageFormat image_format = ToSkEncodedImageFormat(format); - - if (quality > 100) - quality = 100; - if (quality < 0) - quality = 0; - auto callback = std::make_unique( tonic::DartState::Current(), callback_handle); sk_sp image = canvas_image->image(); @@ -107,11 +114,11 @@ Dart_Handle EncodeImage(CanvasImage* canvas_image, const auto& task_runners = UIDartState::Current()->GetTaskRunners(); task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( - [callback = std::move(callback), image, image_format, quality, + [callback = std::move(callback), image, ui_task_runner = task_runners.GetUITaskRunner()]() mutable { - EncodeImageAndInvokeDataCallback(std::move(callback), std::move(image), - image_format, quality, - std::move(ui_task_runner)); + GetImageBytesAndInvokeDataCallback(std::move(callback), + std::move(image), + std::move(ui_task_runner)); })); return Dart_Null(); diff --git a/lib/ui/painting/image_encoding.h b/lib/ui/painting/image_encoding.h index a121d597ccefd..5081bc4ee5f95 100644 --- a/lib/ui/painting/image_encoding.h +++ b/lib/ui/painting/image_encoding.h @@ -11,10 +11,8 @@ namespace blink { class CanvasImage; -Dart_Handle EncodeImage(CanvasImage* canvas_image, - int format, - int quality, - Dart_Handle callback_handle); +Dart_Handle GetImageBytes(CanvasImage* canvas_image, + Dart_Handle callback_handle); } // namespace blink diff --git a/testing/dart/encoding_test.dart b/testing/dart/encoding_test.dart index 5fbbb4eb63909..22c0a284652d9 100644 --- a/testing/dart/encoding_test.dart +++ b/testing/dart/encoding_test.dart @@ -7,57 +7,81 @@ import 'dart:ui'; import 'dart:typed_data'; import 'dart:io'; -import 'package:test/test.dart'; +import 'package:flutter_test/flutter_test.dart'; import 'package:path/path.dart' as path; -void main() { - final Image testImage = createSquareTestImage(); +const int _kWidth = 10; +const int _kRadius = 2; - test('Encode with default arguments', () async { - ByteData data = await testImage.toByteData(); - List expected = readFile('square-80.jpg'); - expect(new Uint8List.view(data.buffer), expected); - }); +const Color _kBlack = const Color.fromRGBO(0, 0, 0, 1.0); +const Color _kGreen = const Color.fromRGBO(0, 255, 0, 1.0); - test('Encode JPEG', () async { - ByteData data = await testImage.toByteData( - format: new EncodingFormat.jpeg(quality: 80)); - List expected = readFile('square-80.jpg'); - expect(new Uint8List.view(data.buffer), expected); - }); - - test('Encode PNG', () async { - ByteData data = - await testImage.toByteData(format: new EncodingFormat.png()); - List expected = readFile('square.png'); - expect(new Uint8List.view(data.buffer), expected); - }); +void main() { + group('Image.toByteData', () { + test('Encode with default arguments', () async { + Image testImage = createSquareTestImage(); + ByteData data = await testImage.toByteData(); + expect(new Uint8List.view(data.buffer), getExpectedBytes()); + }); - test('Encode WEBP', () async { - ByteData data = await testImage.toByteData( - format: new EncodingFormat.webp(quality: 80)); - List expected = readFile('square-80.webp'); - expect(new Uint8List.view(data.buffer), expected); + test('Handles greyscale images', () async { + Uint8List png = await new File('../resources/4x4.png').readAsBytes(); + Completer completer = new Completer(); + decodeImageFromList(png, (Image image) => completer.complete(image)); + Image image = await completer.future; + ByteData data = await image.toByteData(); + Uint8List bytes = data.buffer.asUint8List(); + expect(bytes, hasLength(16)); + expect(bytes, [ + 255, 255, 255, 255, + 127, 127, 127, 255, + 127, 127, 127, 255, + 0, 0, 0, 255, + ]); + }); }); } Image createSquareTestImage() { + double width = _kWidth.toDouble(); + double radius = _kRadius.toDouble(); + double innerWidth = (_kWidth - 2 * _kRadius).toDouble(); + PictureRecorder recorder = new PictureRecorder(); - Canvas canvas = new Canvas(recorder, new Rect.fromLTWH(0.0, 0.0, 10.0, 10.0)); + Canvas canvas = + new Canvas(recorder, new Rect.fromLTWH(0.0, 0.0, width, width)); Paint black = new Paint() ..strokeWidth = 1.0 - ..color = const Color.fromRGBO(0, 0, 0, 1.0); + ..color = _kBlack; Paint green = new Paint() ..strokeWidth = 1.0 - ..color = const Color.fromRGBO(0, 255, 0, 1.0); + ..color = _kGreen; - canvas.drawRect(new Rect.fromLTWH(0.0, 0.0, 10.0, 10.0), black); - canvas.drawRect(new Rect.fromLTWH(2.0, 2.0, 6.0, 6.0), green); - return recorder.endRecording().toImage(10, 10); + canvas.drawRect(new Rect.fromLTWH(0.0, 0.0, width, width), black); + canvas.drawRect( + new Rect.fromLTWH(radius, radius, innerWidth, innerWidth), green); + return recorder.endRecording().toImage(_kWidth, _kWidth); } -List readFile(fileName) { - final file = new File(path.join('flutter', 'testing', 'resources', fileName)); - return file.readAsBytesSync(); +List getExpectedBytes() { + int bytesPerChannel = 4; + List result = new List(_kWidth * _kWidth * bytesPerChannel); + + fillWithColor(Color color, int min, int max) { + for (int i = min; i < max; i++) { + for (int j = min; j < max; j++) { + int offset = i * bytesPerChannel + j * _kWidth * bytesPerChannel; + result[offset] = color.red; + result[offset + 1] = color.green; + result[offset + 2] = color.blue; + result[offset + 3] = color.alpha; + } + } + } + + fillWithColor(_kBlack, 0, _kWidth); + fillWithColor(_kGreen, _kRadius, _kWidth - _kRadius); + + return result; } diff --git a/testing/dart/pubspec.yaml b/testing/dart/pubspec.yaml index 43f35ec12aaa3..2c79b49c89db5 100644 --- a/testing/dart/pubspec.yaml +++ b/testing/dart/pubspec.yaml @@ -1,3 +1,8 @@ name: engine_tests dependencies: - test: 0.12.15+4 + flutter: + sdk: flutter +dev_dependencies: + flutter_test: + sdk: flutter + path: any diff --git a/testing/resources/4x4.png b/testing/resources/4x4.png new file mode 100644 index 0000000000000000000000000000000000000000..21b295abc16c89cdc87d86c10625d94352bab3f2 GIT binary patch literal 71 zcmeAS@N?(olHy`uVBq!ia0vp^Od!kwBpAZ)2K@k1e4Z|jAsp9}|D8V&aGrsIO^~r^ S!p<+gAQhgjelF{r5}E)44-uRI literal 0 HcmV?d00001 diff --git a/testing/resources/square-80.jpg b/testing/resources/square-80.jpg deleted file mode 100644 index 1140c33bd39039758e39b057c1da6ea0746bee4e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 928 zcmex=dDF&IcpE-rwvvCu$szg+{F&cJY47mGY0A>d!iC?v=ksAd6>t&xtzPC{armlTu$)tmsSPcA3|vF`xcHn};aAiF>S zGB z4}|FqISi=`3JjhMc?`)6dO(&Dg8_pfgW3Pv49*N}EUav-ENpD7Z0zi899#liT%4R- zB7FQj0^%YP65=9aVp6iI@>0^uGGby1Itt2a>Y7@blJdF+x*7(m8k!m)Lm1iF*||8l zgt@qcHKfF(G)M;j4=@OFFmN$&F*7PLFbOg;3o`yc!XO4ryNoc;LufX3ptu4s9ka49 zBTF$dF#|mzD9kRTXb4mxilLE(6(}q($iT$N%!;Iuk(r4_P?15&Ffh^S|1Aa{prK5H z%z_N|46To=#qP}9^mz4?#oI%7Z{GEN$DD^pRraU~)+k97F!1VX3mo&yF%mLo`184O f^8GnkrJ}-_x2_p3OGJ$(bU=hK^z`&pY#GGK{>FgXJ0hDE6V3Gin0t^hfc_l?b?oJ93 zkx>dDF&IcpE-rwvvCxbR4BxIX07(Xh%eq+P2?=qgq!uRw6@38Wk|Lnx3=E7ZK(9f_TU#4ax>C;_TD0aBk_Py}M%0kUm!b4o#WfdI(G zJgIr1!9Y3!h-Dax8G;zx8JvJ@sscoK<}YSou=vKnz&sHlmNbQdVS6hBgTx(#n94#1 z27aK}wkrjRMTua?umDM>v@`~WPsf4F%}28J29*~C-V}>VJUX<4B-HR z8jh3>AYa|n#W6%;YH~_K!jJO~ED1_(g3Lg`J*V|_jGK_J3>TNAzopr06J_NxBvhE From c17a62909479a9611fc6ba295519a755f442b05b Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Mon, 16 Apr 2018 13:26:42 -0700 Subject: [PATCH 0110/1190] Breadcrumbs to the wiki (#5017) * Breadcrumbs to the wiki * Update README.md --- CONTRIBUTING.md | 3 ++- README.md | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 543b586063bc6..45af0eacee586 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -207,7 +207,8 @@ find . -mindepth 1 -maxdepth 1 -type d | xargs -n 1 sh -c 'ninja -C $0 || exit 2 Contributing code ----------------- -We gladly accept contributions via GitHub pull requests. +We gladly accept contributions via GitHub pull requests. See [the wiki](https://github.com/flutter/engine/wiki) for +information about the engine's architecture. To start working on a patch: diff --git a/README.md b/README.md index e52c496b97518..d38f7941de34a 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,9 @@ us [feedback](mailto:flutter-dev@googlegroups.com). - For information about contributing code to the engine itself, please see [CONTRIBUTING.md](CONTRIBUTING.md). + + - For information about the engine's architecture, please see + [the wiki](https://github.com/flutter/engine/wiki). Community --------- From d15dc76ea7cc46036b6ffbb97f139aaac194a2d7 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Mon, 16 Apr 2018 15:10:40 -0700 Subject: [PATCH 0111/1190] Fix broken Chromebot build (#5018) --- lib/ui/painting/image_encoding.cc | 4 ++++ testing/dart/.gitignore | 1 + testing/dart/encoding_test.dart | 7 ++++--- testing/dart/pubspec.yaml | 6 +----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index 952e77edda733..15d2d31c9ec75 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -24,6 +24,10 @@ using tonic::DartInvoke; using tonic::DartPersistentValue; using tonic::ToDart; +#ifdef ERROR +#undef ERROR +#endif + namespace blink { namespace { diff --git a/testing/dart/.gitignore b/testing/dart/.gitignore index 93d2a1eaede95..79f51c3d50b9f 100644 --- a/testing/dart/.gitignore +++ b/testing/dart/.gitignore @@ -1,2 +1,3 @@ +.dart_tool .packages pubspec.lock diff --git a/testing/dart/encoding_test.dart b/testing/dart/encoding_test.dart index 22c0a284652d9..27b71dc4787dc 100644 --- a/testing/dart/encoding_test.dart +++ b/testing/dart/encoding_test.dart @@ -7,8 +7,8 @@ import 'dart:ui'; import 'dart:typed_data'; import 'dart:io'; -import 'package:flutter_test/flutter_test.dart'; import 'package:path/path.dart' as path; +import 'package:test/test.dart'; const int _kWidth = 10; const int _kRadius = 2; @@ -24,8 +24,9 @@ void main() { expect(new Uint8List.view(data.buffer), getExpectedBytes()); }); - test('Handles greyscale images', () async { - Uint8List png = await new File('../resources/4x4.png').readAsBytes(); + test('Handles grayscale images', () async { + File grayscaleImage = new File(path.join('flutter', 'testing', 'resources', '4x4.png')); + Uint8List png = await grayscaleImage.readAsBytes(); Completer completer = new Completer(); decodeImageFromList(png, (Image image) => completer.complete(image)); Image image = await completer.future; diff --git a/testing/dart/pubspec.yaml b/testing/dart/pubspec.yaml index 2c79b49c89db5..4e8a7f05bb70a 100644 --- a/testing/dart/pubspec.yaml +++ b/testing/dart/pubspec.yaml @@ -1,8 +1,4 @@ name: engine_tests dependencies: - flutter: - sdk: flutter -dev_dependencies: - flutter_test: - sdk: flutter + test: any path: any From d6d4eec24c38bb06a9b1aef4e70c321d447ba762 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Mon, 16 Apr 2018 16:20:48 -0700 Subject: [PATCH 0112/1190] Fix broken Linux build (#5019) After we write the pixels in the correct format, the color type of the SkPixmap is still set to its previous value, so the existing assertion was failing. --- .gitignore | 1 + lib/ui/painting/image_encoding.cc | 1 - testing/dart/.gitignore | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b5f80bd40a3fe..2e1362f0aae0b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ .DS_Store .classpath .cproject +.dart_tool .gdb_history .checkstyle .gdbinit diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index 15d2d31c9ec75..c103d5d8271e4 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -79,7 +79,6 @@ sk_sp GetImageBytesAsRGBA(sk_sp image) { FXL_LOG(ERROR) << "Pixel address is not available."; return nullptr; } - ASSERT(pixmap.colorType() == kRGBA_8888_SkColorType); const size_t pixmap_size = pixmap.computeByteSize(); return SkData::MakeWithCopy(pixmap.addr32(), pixmap_size); diff --git a/testing/dart/.gitignore b/testing/dart/.gitignore index 79f51c3d50b9f..93d2a1eaede95 100644 --- a/testing/dart/.gitignore +++ b/testing/dart/.gitignore @@ -1,3 +1,2 @@ -.dart_tool .packages pubspec.lock From 9495a52d59ef7dd064a080b835cbc8f739fa2f0e Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 16 Apr 2018 16:41:45 -0700 Subject: [PATCH 0113/1190] On iOS, try to use ES3, then fall back to ES2. (#5006) --- shell/platform/darwin/ios/ios_gl_context.mm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/shell/platform/darwin/ios/ios_gl_context.mm b/shell/platform/darwin/ios/ios_gl_context.mm index 77a124e64a291..92647c5d54cf7 100644 --- a/shell/platform/darwin/ios/ios_gl_context.mm +++ b/shell/platform/darwin/ios/ios_gl_context.mm @@ -14,14 +14,21 @@ IOSGLContext::IOSGLContext(fml::scoped_nsobject layer) : layer_(std::move(layer)), - context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]), - resource_context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 - sharegroup:context_.get().sharegroup]), framebuffer_(GL_NONE), colorbuffer_(GL_NONE), storage_size_width_(0), storage_size_height_(0), valid_(false) { + context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]); + if (context_ != nullptr) { + resource_context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3 + sharegroup:context_.get().sharegroup]); + } else { + context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]); + resource_context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 + sharegroup:context_.get().sharegroup]); + } + FXL_DCHECK(layer_ != nullptr); FXL_DCHECK(context_ != nullptr); FXL_DCHECK(resource_context_ != nullptr); From 75851f085d92ccfc1346ec9d74b4d40864e423b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Crelier?= Date: Mon, 16 Apr 2018 17:25:39 -0700 Subject: [PATCH 0114/1190] Roll Dart to fe606f890b0a311da802c78b0af414a3c2087a79 (#5020) --- DEPS | 10 +++------- flutter_kernel_transformers/pubspec.yaml | 2 -- frontend_server/pubspec.yaml | 3 --- tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 4 +++- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/DEPS b/DEPS index b76d268685531..5eb80d20a03ad 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'f76dad0adcf6766d73351354da653d6a793b5abc', + 'dart_revision': 'fe606f890b0a311da802c78b0af414a3c2087a79', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -58,7 +58,6 @@ vars = { 'dart_http_tag': '0.11.3+16', 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', - 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', 'dart_linter_tag': '0.1.47', 'dart_logging_tag': '0.11.3+1', @@ -76,7 +75,7 @@ vars = { 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', - 'dart_pub_semver_tag': '1.3.6', + 'dart_pub_semver_tag': '1.3.7', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', @@ -115,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '3cf97e01cdbd4bb920fa3d40282a56c4b2d62a58', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '66676c9960264c96d1b424264a5966f8e2b40153', # Fuchsia compatibility # @@ -209,9 +208,6 @@ deps = { 'src/third_party/dart/third_party/pkg/dartdoc': Var('dart_git') + '/dartdoc.git' + '@' + Var('dart_dartdoc_tag'), - 'src/third_party/dart/third_party/pkg/isolate': - Var('dart_git') + '/isolate.git' + '@' + Var('dart_isolate_tag'), - 'src/third_party/dart/third_party/pkg/json_rpc_2': Var('dart_git') + '/json_rpc_2.git' + '@' + Var('dart_json_rpc_2_tag'), diff --git a/flutter_kernel_transformers/pubspec.yaml b/flutter_kernel_transformers/pubspec.yaml index 87d617b7afb46..0ef451c2cc92a 100644 --- a/flutter_kernel_transformers/pubspec.yaml +++ b/flutter_kernel_transformers/pubspec.yaml @@ -68,8 +68,6 @@ dependency_overrides: path: ../../third_party/dart/third_party/pkg/http_multi_server http_parser: path: ../../third_party/dart/third_party/pkg/http_parser - isolate: - path: ../../third_party/dart/third_party/pkg/isolate matcher: path: ../../third_party/dart/third_party/pkg/matcher mime: diff --git a/frontend_server/pubspec.yaml b/frontend_server/pubspec.yaml index f7b9ee1746406..bb33fa85093f2 100644 --- a/frontend_server/pubspec.yaml +++ b/frontend_server/pubspec.yaml @@ -35,7 +35,6 @@ dev_dependencies: http: any http_multi_server: any http_parser: any - isolate: any matcher: any mime: any mockito: any @@ -117,8 +116,6 @@ dependency_overrides: path: ../../third_party/dart/third_party/pkg/http_multi_server http_parser: path: ../../third_party/dart/third_party/pkg/http_parser - isolate: - path: ../../third_party/dart/third_party/pkg/isolate matcher: path: ../../third_party/dart/third_party/pkg/matcher mime: diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 26c6f128265d0..59d4c41a73ddd 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-edge.af1436931b93e755d38223c487d33a0a1f5eadf5" + dart: ">=1.21.0 <=2.0.0-dev.47.0" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c7a001683cbaf..ab98ca97dca3c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 11eed2d794a665c2ed961ab41d6006b7 +Signature: bb4a430cb851bf486943c666ca3c37e9 UNUSED LICENSES: @@ -6069,6 +6069,8 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h FILE: ../../../third_party/dart/sdk/lib/js/_js.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart From 98f6c2d573288c560ef7ecc6f1b621f4ca2d0718 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 16 Apr 2018 19:31:43 -0700 Subject: [PATCH 0115/1190] Fix shell launcher test (dart2 compliant and stop polling) (#5009) * Make test Dart2 compliant * Use service and debug events instead of polling to wait for isolate to start, run and resume. * Refactor into _onServiceEvent. Wait for 'paused' event instead of 'isolate runnable'. --- shell/testing/observatory/empty_main.dart | 2 +- shell/testing/observatory/launcher.dart | 19 ++- shell/testing/observatory/service_client.dart | 90 ++++++++--- shell/testing/observatory/test.dart | 142 +++++++++--------- 4 files changed, 147 insertions(+), 106 deletions(-) diff --git a/shell/testing/observatory/empty_main.dart b/shell/testing/observatory/empty_main.dart index bf3b7d4496935..0d653a819f728 100644 --- a/shell/testing/observatory/empty_main.dart +++ b/shell/testing/observatory/empty_main.dart @@ -2,5 +2,5 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -main() { +void main() { } diff --git a/shell/testing/observatory/launcher.dart b/shell/testing/observatory/launcher.dart index e3f6671cac33c..9a88555199538 100644 --- a/shell/testing/observatory/launcher.dart +++ b/shell/testing/observatory/launcher.dart @@ -9,24 +9,23 @@ import 'dart:convert'; import 'dart:io'; class ShellProcess { - final Completer _observatoryUriCompleter = new Completer(); + final Completer _observatoryUriCompleter = new Completer(); final Process _process; - ShellProcess(this._process) { - assert(_process != null); + ShellProcess(this._process) : assert(_process != null) { // Scan stdout and scrape the Observatory Uri. - _process.stdout.transform(UTF8.decoder) - .transform(new LineSplitter()).listen((line) { + _process.stdout.transform(utf8.decoder) + .transform(const LineSplitter()).listen((String line) { const String observatoryUriPrefix = 'Observatory listening on '; if (line.startsWith(observatoryUriPrefix)) { print(line); - Uri uri = Uri.parse(line.substring(observatoryUriPrefix.length)); + final Uri uri = Uri.parse(line.substring(observatoryUriPrefix.length)); _observatoryUriCompleter.complete(uri); } }); } - Future kill() async { + Future kill() async { if (_process == null) { return false; } @@ -39,7 +38,7 @@ class ShellProcess { } class ShellLauncher { - final List args = [ + final List args = [ '--observatory-port=0', '--non-interactive', '--run-forever', @@ -60,13 +59,13 @@ class ShellLauncher { Future launch() async { try { - List shellArguments = []; + final List shellArguments = []; if (startPaused) { shellArguments.add('--start-paused'); } shellArguments.addAll(args); print('Launching $shellExecutablePath $shellArguments'); - var process = await Process.start(shellExecutablePath, shellArguments); + final Process process = await Process.start(shellExecutablePath, shellArguments); return new ShellProcess(process); } catch (e) { print('Error launching shell: $e'); diff --git a/shell/testing/observatory/service_client.dart b/shell/testing/observatory/service_client.dart index 00b62e8df9162..1b107bb76a1a7 100644 --- a/shell/testing/observatory/service_client.dart +++ b/shell/testing/observatory/service_client.dart @@ -4,60 +4,100 @@ library observatory_sky_shell_service_client; - import 'dart:async'; import 'dart:convert'; +import 'dart:io'; + class ServiceClient { - ServiceClient(this.client) { + Completer isolateStartedId; + Completer isolatePausedId; + Completer isolateResumeId; + + ServiceClient(this.client, {this.isolateStartedId, this.isolatePausedId, + this.isolateResumeId}) { client.listen(_onData, onError: _onError, cancelOnError: true); } - Future invokeRPC(String method, [Map params]) async { - var key = _createKey(); - var request = JSON.encode({ + Future> invokeRPC(String method, [Map params]) async { + final String key = _createKey(); + final String request = json.encode({ 'jsonrpc': '2.0', 'method': method, - 'params': params == null ? {} : params, + 'params': params == null ? {} : params, 'id': key, }); client.add(request); - var completer = new Completer(); - _outstanding_requests[key] = completer; + final Completer> completer = new Completer>(); + _outstandingRequests[key] = completer; print('-> $key ($method)'); return completer.future; } String _createKey() { - var key = '$_id'; + final String key = '$_id'; _id++; return key; } - void _onData(String message) { - var response = JSON.decode(message); - var key = response['id']; - print('<- $key'); - var completer = _outstanding_requests.remove(key); - assert(completer != null); - var result = response['result']; - var error = response['error']; - if (error != null) { - assert(result == null); - completer.completeError(error); + void _onData(dynamic message) { + final Map response = json.decode(message); + final dynamic key = response['id']; + if (key != null) { + print('<- $key'); + final dynamic completer = _outstandingRequests.remove(key); + assert(completer != null); + final dynamic result = response['result']; + final dynamic error = response['error']; + if (error != null) { + assert(result == null); + completer.completeError(error); + } else { + assert(result != null); + completer.complete(result); + } } else { - assert(result != null); - completer.complete(result); + if (response['method'] == 'streamNotify') { + _onServiceEvent(response['params']); + } + } + } + + void _onServiceEvent(Map params) { + if (params == null) { + return; + } + final Map event = params['event']; + if (event == null || event['type'] != 'Event') { + return; + } + final dynamic isolateId = event['isolate']['id']; + switch (params['streamId']) { + case 'Isolate': + if (event['kind'] == 'IsolateStarted') { + isolateStartedId?.complete(isolateId); + } + break; + case 'Debug': + switch (event['kind']) { + case 'Resume': + isolateResumeId?.complete(isolateId); + break; + case 'PauseStart': + isolatePausedId?.complete(isolateId); + break; + } + break; } } - void _onError(error) { + void _onError(dynamic error) { print('WebSocket error: $error'); } final WebSocket client; - final Map _outstanding_requests = {}; - var _id = 1; + final Map> _outstandingRequests = >{}; + int _id = 1; } diff --git a/shell/testing/observatory/test.dart b/shell/testing/observatory/test.dart index 5786153ed8951..9d7d7f769e7fd 100644 --- a/shell/testing/observatory/test.dart +++ b/shell/testing/observatory/test.dart @@ -12,35 +12,35 @@ import 'launcher.dart'; import 'service_client.dart'; class Expect { - static equals(dynamic actual, dynamic expected) { + static void equals(dynamic actual, dynamic expected) { if (actual != expected) { throw 'Expected $actual == $expected'; } } - static contains(String needle, String haystack) { + static void contains(String needle, String haystack) { if (!haystack.contains(needle)) { throw 'Expected $haystack to contain $needle'; } } - static isTrue(bool tf) { + static void isTrue(bool tf) { if (tf != true) { - throw 'Expected $a to be true'; + throw 'Expected $tf to be true'; } } - static isFalse(bool tf) { + static void isFalse(bool tf) { if (tf != false) { - throw 'Expected $a to be false'; + throw 'Expected $tf to be false'; } } - static notExecuted() { + static void notExecuted() { throw 'Should not have hit'; } - static isNotNull(dynamic a) { + static void isNotNull(dynamic a) { if (a == null) { throw 'Expected $a to not be null'; } @@ -48,32 +48,32 @@ class Expect { } Future readResponse(HttpClientResponse response) { - var completer = new Completer(); - var contents = new StringBuffer(); - response.transform(UTF8.decoder).listen((String data) { + final Completer completer = new Completer(); + final StringBuffer contents = new StringBuffer(); + response.transform(utf8.decoder).listen((String data) { contents.write(data); }, onDone: () => completer.complete(contents.toString())); return completer.future; } // Test accessing the service protocol over http. -Future testHttpProtocolRequest(Uri uri) async { +Future testHttpProtocolRequest(Uri uri) async { uri = uri.replace(path: 'getVM'); - HttpClient client = new HttpClient(); - HttpClientRequest request = await client.getUrl(uri); - HttpClientResponse response = await request.close(); + final HttpClient client = new HttpClient(); + final HttpClientRequest request = await client.getUrl(uri); + final HttpClientResponse response = await request.close(); Expect.equals(response.statusCode, 200); - Map responseAsMap = JSON.decode(await readResponse(response)); - Expect.equals(responseAsMap['jsonrpc'], "2.0"); + final Map responseAsMap = json.decode(await readResponse(response)); + Expect.equals(responseAsMap['jsonrpc'], '2.0'); client.close(); } // Test accessing the service protocol over ws. -Future testWebSocketProtocolRequest(Uri uri) async { +Future testWebSocketProtocolRequest(Uri uri) async { uri = uri.replace(scheme: 'ws', path: 'ws'); - WebSocket webSocketClient = await WebSocket.connect(uri.toString()); - ServiceClient serviceClient = new ServiceClient(webSocketClient); - Map response = await serviceClient.invokeRPC('getVM'); + final WebSocket webSocketClient = await WebSocket.connect(uri.toString()); + final ServiceClient serviceClient = new ServiceClient(webSocketClient); + final Map response = await serviceClient.invokeRPC('getVM'); Expect.equals(response['type'], 'VM'); try { await serviceClient.invokeRPC('BART_SIMPSON'); @@ -85,83 +85,85 @@ Future testWebSocketProtocolRequest(Uri uri) async { } // Test accessing an Observatory UI asset. -Future testHttpAssetRequest(Uri uri) async { +Future testHttpAssetRequest(Uri uri) async { uri = uri.replace(path: 'third_party/trace_viewer_full.html'); - HttpClient client = new HttpClient(); - HttpClientRequest request = await client.getUrl(uri); - HttpClientResponse response = await request.close(); + final HttpClient client = new HttpClient(); + final HttpClientRequest request = await client.getUrl(uri); + final HttpClientResponse response = await request.close(); Expect.equals(response.statusCode, 200); - await response.drain(); + await response.drain>(); client.close(); } -Future testStartPaused(Uri uri) async { +Future testStartPaused(Uri uri) async { uri = uri.replace(scheme: 'ws', path: 'ws'); - WebSocket webSocketClient = await WebSocket.connect(uri.toString()); - ServiceClient serviceClient = new ServiceClient(webSocketClient); - - // Wait until we have the isolateId. + final WebSocket webSocketClient = await WebSocket.connect(uri.toString()); + final Completer isolateStartedId = new Completer(); + final Completer isolatePausedId = new Completer(); + final Completer isolateResumeId = new Completer(); + final ServiceClient serviceClient = new ServiceClient(webSocketClient, + isolateStartedId: isolateStartedId, + isolatePausedId: isolatePausedId, + isolateResumeId: isolateResumeId); + await serviceClient.invokeRPC('streamListen', { 'streamId': 'Isolate'}); + await serviceClient.invokeRPC('streamListen', { 'streamId': 'Debug'}); + + final Map response = await serviceClient.invokeRPC('getVM'); + Expect.equals(response['type'], 'VM'); String isolateId; - while (isolateId == null) { - Map response = await serviceClient.invokeRPC('getVM'); - Expect.equals(response['type'], 'VM'); - if (response['isolates'].length > 0) { - isolateId = response['isolates'][0]['id']; - } + if (response['isolates'].length > 0) { + isolateId = response['isolates'][0]['id']; + } else { + // Wait until isolate starts. + isolateId = await isolateStartedId.future; } // Grab the isolate. - Map isolate; - while(true) { - isolate = await serviceClient.invokeRPC('getIsolate', { + Map isolate = await serviceClient.invokeRPC('getIsolate', { + 'isolateId': isolateId, + }); + Expect.equals(isolate['type'], 'Isolate'); + Expect.isNotNull(isolate['pauseEvent']); + // If it is not runnable, wait until it becomes runnable. + if (isolate['pauseEvent']['kind'] == 'None') { + await isolatePausedId.future; + isolate = await serviceClient.invokeRPC('getIsolate', { 'isolateId': isolateId, }); - Expect.equals(isolate['type'], 'Isolate'); - // Verify that it is paused at start. - Expect.isNotNull(isolate['pauseEvent']); - if (isolate['pauseEvent']['kind'] != 'None') { - break; - } - } - - Expect.isNotNull(isolate); + } + // Verify that it is paused at start. Expect.equals(isolate['pauseEvent']['kind'], 'PauseStart'); // Resume the isolate. - await serviceClient.invokeRPC('resume', { + await serviceClient.invokeRPC('resume', { 'isolateId': isolateId, }); - // Wait until the isolate has resumed. - while (true) { - Map response = await serviceClient.invokeRPC('getIsolate', { - 'isolateId': isolateId, - }); - Expect.equals(response['type'], 'Isolate'); - Expect.isNotNull(response['pauseEvent']); - if (response['pauseEvent']['kind'] == 'Resume') { - break; - } - } + await isolateResumeId.future; + final Map resumedResponse = await serviceClient.invokeRPC( + 'getIsolate', {'isolateId': isolateId}); + Expect.equals(resumedResponse['type'], 'Isolate'); + Expect.isNotNull(resumedResponse['pauseEvent']); + Expect.equals(resumedResponse['pauseEvent']['kind'], 'Resume'); } -typedef Future TestFunction(Uri uri); +typedef Future TestFunction(Uri uri); -final List basicTests = [ +final List basicTests = [ testHttpProtocolRequest, testWebSocketProtocolRequest, testHttpAssetRequest ]; -final List startPausedTests = [ +final List startPausedTests = [ testStartPaused, ]; -bool runTests(ShellLauncher launcher, List tests) async { - ShellProcess process = await launcher.launch(); - Uri uri = await process.waitForObservatory(); +Future runTests(ShellLauncher launcher, List tests) async { + final ShellProcess process = await launcher.launch(); + final Uri uri = await process.waitForObservatory(); try { - for (var i = 0; i < tests.length; i++) { + for (int i = 0; i < tests.length; i++) { print('Executing test ${i+1}/${tests.length}'); await tests[i](uri); } @@ -173,7 +175,7 @@ bool runTests(ShellLauncher launcher, List tests) async { return exitCode == 0; } -main(List args) async { +Future main(List args) async { if (args.length < 2) { print('Usage: dart ${Platform.script} ' ' ...'); @@ -181,7 +183,7 @@ main(List args) async { } final String shellExecutablePath = args[0]; final String mainDartPath = args[1]; - final List extraArgs = args.length <= 2 ? [] : args.sublist(2); + final List extraArgs = args.length <= 2 ? [] : args.sublist(2); final ShellLauncher launcher = new ShellLauncher(shellExecutablePath, From 4b45a53ed5658b0acc5658af957f0c70e314041f Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 16 Apr 2018 21:34:11 -0700 Subject: [PATCH 0116/1190] Only make ERROR and FATAL log levels visible by default. (#5022) Adds the --verbose-logging flag to enable logging at all other severities. --- assets/asset_manager.cc | 2 +- common/settings.h | 1 + shell/common/shell.cc | 6 ++++++ shell/common/switches.cc | 3 +++ shell/common/switches.h | 5 +++++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc index 9833eee923257..fcbe71b11a9ff 100644 --- a/assets/asset_manager.cc +++ b/assets/asset_manager.cc @@ -47,7 +47,7 @@ bool AssetManager::GetAsBuffer(const std::string& asset_name, return true; } } - FXL_DLOG(ERROR) << "Could not find asset: " << asset_name; + FXL_DLOG(WARNING) << "Could not find asset: " << asset_name; return false; } diff --git a/common/settings.h b/common/settings.h index c6c3159766a37..ffb80131f029d 100644 --- a/common/settings.h +++ b/common/settings.h @@ -71,6 +71,7 @@ struct Settings { bool enable_software_rendering = false; bool using_blink = false; bool skia_deterministic_rendering_on_cpu = false; + bool verbose_logging = false; std::string log_tag = "flutter"; std::string icu_data_path; diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 82591c6d499e2..468ebaf99b9e0 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -23,6 +23,7 @@ #include "lib/fxl/files/path.h" #include "lib/fxl/files/unique_fd.h" #include "lib/fxl/functional/make_copyable.h" +#include "lib/fxl/log_settings.h" #include "lib/fxl/logging.h" #include "third_party/dart/runtime/include/dart_tools_api.h" #include "third_party/skia/include/core/SkGraphics.h" @@ -149,6 +150,11 @@ std::unique_ptr Shell::Create( blink::Settings settings, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer) { + fxl::LogSettings log_settings; + log_settings.min_log_level = + settings.verbose_logging ? fxl::LOG_INFO : fxl::LOG_ERROR; + fxl::SetLogSettings(log_settings); + if (!task_runners.IsValid() || !on_create_platform_view || !on_create_rasterizer) { return nullptr; diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 82da6ee180af8..f8883a2a3f471 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -155,6 +155,9 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { settings.skia_deterministic_rendering_on_cpu = command_line.HasOption(FlagForSwitch(Switch::SkiaDeterministicRendering)); + settings.verbose_logging = + command_line.HasOption(FlagForSwitch(Switch::VerboseLogging)); + command_line.GetOptionValue(FlagForSwitch(Switch::FLX), &settings.flx_path); command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir), diff --git a/shell/common/switches.h b/shell/common/switches.h index 6b67b1f6a1567..4f694d37475fa 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -113,6 +113,11 @@ DEF_SWITCH(UseTestFonts, "will make font resolution default to the Ahem test font on all " "platforms (See https://www.w3.org/Style/CSS/Test/Fonts/Ahem/). " "This option is only available on the desktop test shells.") +DEF_SWITCH(VerboseLogging, + "verbose-logging", + "By default, only errors are logged. This flag enabled logging at " + "all severity levels. This is NOT a per shell flag and affect log " + "levels for all shells in the process.") DEF_SWITCH(RunForever, "run-forever", "In non-interactive mode, keep the shell running after the Dart " From cf6ca32d9b879340cabb85fe0d74f9c338b180d7 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Mon, 16 Apr 2018 21:50:11 -0700 Subject: [PATCH 0117/1190] Revert "Roll Dart to fe606f890b0a311da802c78b0af414a3c2087a79" (#5023) This reverts commit 75851f085d92ccfc1346ec9d74b4d40864e423b0. --- DEPS | 10 +++++++--- flutter_kernel_transformers/pubspec.yaml | 2 ++ frontend_server/pubspec.yaml | 3 +++ tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 4 +--- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/DEPS b/DEPS index 5eb80d20a03ad..b76d268685531 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'fe606f890b0a311da802c78b0af414a3c2087a79', + 'dart_revision': 'f76dad0adcf6766d73351354da653d6a793b5abc', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -58,6 +58,7 @@ vars = { 'dart_http_tag': '0.11.3+16', 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', + 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', 'dart_linter_tag': '0.1.47', 'dart_logging_tag': '0.11.3+1', @@ -75,7 +76,7 @@ vars = { 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', - 'dart_pub_semver_tag': '1.3.7', + 'dart_pub_semver_tag': '1.3.6', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', @@ -114,7 +115,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '66676c9960264c96d1b424264a5966f8e2b40153', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '3cf97e01cdbd4bb920fa3d40282a56c4b2d62a58', # Fuchsia compatibility # @@ -208,6 +209,9 @@ deps = { 'src/third_party/dart/third_party/pkg/dartdoc': Var('dart_git') + '/dartdoc.git' + '@' + Var('dart_dartdoc_tag'), + 'src/third_party/dart/third_party/pkg/isolate': + Var('dart_git') + '/isolate.git' + '@' + Var('dart_isolate_tag'), + 'src/third_party/dart/third_party/pkg/json_rpc_2': Var('dart_git') + '/json_rpc_2.git' + '@' + Var('dart_json_rpc_2_tag'), diff --git a/flutter_kernel_transformers/pubspec.yaml b/flutter_kernel_transformers/pubspec.yaml index 0ef451c2cc92a..87d617b7afb46 100644 --- a/flutter_kernel_transformers/pubspec.yaml +++ b/flutter_kernel_transformers/pubspec.yaml @@ -68,6 +68,8 @@ dependency_overrides: path: ../../third_party/dart/third_party/pkg/http_multi_server http_parser: path: ../../third_party/dart/third_party/pkg/http_parser + isolate: + path: ../../third_party/dart/third_party/pkg/isolate matcher: path: ../../third_party/dart/third_party/pkg/matcher mime: diff --git a/frontend_server/pubspec.yaml b/frontend_server/pubspec.yaml index bb33fa85093f2..f7b9ee1746406 100644 --- a/frontend_server/pubspec.yaml +++ b/frontend_server/pubspec.yaml @@ -35,6 +35,7 @@ dev_dependencies: http: any http_multi_server: any http_parser: any + isolate: any matcher: any mime: any mockito: any @@ -116,6 +117,8 @@ dependency_overrides: path: ../../third_party/dart/third_party/pkg/http_multi_server http_parser: path: ../../third_party/dart/third_party/pkg/http_parser + isolate: + path: ../../third_party/dart/third_party/pkg/isolate matcher: path: ../../third_party/dart/third_party/pkg/matcher mime: diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 59d4c41a73ddd..26c6f128265d0 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-dev.47.0" + dart: ">=1.21.0 <=2.0.0-edge.af1436931b93e755d38223c487d33a0a1f5eadf5" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ab98ca97dca3c..c7a001683cbaf 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: bb4a430cb851bf486943c666ca3c37e9 +Signature: 11eed2d794a665c2ed961ab41d6006b7 UNUSED LICENSES: @@ -6069,8 +6069,6 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h FILE: ../../../third_party/dart/sdk/lib/js/_js.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart From 1bc0e1bb9a8db882a21086096cc2b1e0854312b7 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 16 Apr 2018 22:02:19 -0700 Subject: [PATCH 0118/1190] On windows, refer to Dart snapshot directly executable. (#5024) --- lib/snapshot/snapshot.h | 4 ++-- runtime/dart_snapshot.cc | 25 ++++++++++++++++++++----- runtime/dart_snapshot_buffer.cc | 22 ++++++++++++++++++++++ runtime/dart_snapshot_buffer.h | 3 +++ 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/lib/snapshot/snapshot.h b/lib/snapshot/snapshot.h index 3574207c979a0..2bb6f0a5d1650 100644 --- a/lib/snapshot/snapshot.h +++ b/lib/snapshot/snapshot.h @@ -9,6 +9,6 @@ extern "C" { extern const uint8_t kDartVmSnapshotData[]; extern const uint8_t kDartVmSnapshotInstructions[]; -extern const uint8_t kDartIsolateCoreSnapshotData[]; -extern const uint8_t kDartIsolateCoreSnapshotInstructions[]; +extern const uint8_t kDartIsolateSnapshotData[]; +extern const uint8_t kDartIsolateSnapshotInstructions[]; } diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc index 5d759257d1d4b..9a70d95c2f35d 100644 --- a/runtime/dart_snapshot.cc +++ b/runtime/dart_snapshot.cc @@ -9,6 +9,7 @@ #include "flutter/fml/native_library.h" #include "flutter/fml/paths.h" #include "flutter/fml/trace_event.h" +#include "flutter/lib/snapshot/snapshot.h" #include "flutter/runtime/dart_snapshot_buffer.h" #include "flutter/runtime/dart_vm.h" @@ -20,8 +21,7 @@ const char* DartSnapshot::kIsolateDataSymbol = "kDartIsolateSnapshotData"; const char* DartSnapshot::kIsolateInstructionsSymbol = "kDartIsolateSnapshotInstructions"; -static std::unique_ptr ResolveVMData( - const Settings& settings) { +std::unique_ptr ResolveVMData(const Settings& settings) { if (settings.aot_snapshot_path.size() > 0) { auto path = fml::paths::JoinPaths( {settings.aot_snapshot_path, settings.aot_vm_snapshot_data_filename}); @@ -36,7 +36,7 @@ static std::unique_ptr ResolveVMData( loaded_process, DartSnapshot::kVMDataSymbol); } -static std::unique_ptr ResolveVMInstructions( +std::unique_ptr ResolveVMInstructions( const Settings& settings) { if (settings.aot_snapshot_path.size() > 0) { auto path = fml::paths::JoinPaths( @@ -61,7 +61,7 @@ static std::unique_ptr ResolveVMInstructions( loaded_process, DartSnapshot::kVMInstructionsSymbol); } -static std::unique_ptr ResolveIsolateData( +std::unique_ptr ResolveIsolateData( const Settings& settings) { if (settings.aot_snapshot_path.size() > 0) { auto path = @@ -78,7 +78,7 @@ static std::unique_ptr ResolveIsolateData( loaded_process, DartSnapshot::kIsolateDataSymbol); } -static std::unique_ptr ResolveIsolateInstructions( +std::unique_ptr ResolveIsolateInstructions( const Settings& settings) { if (settings.aot_snapshot_path.size() > 0) { auto path = @@ -107,6 +107,12 @@ static std::unique_ptr ResolveIsolateInstructions( fxl::RefPtr DartSnapshot::VMSnapshotFromSettings( const Settings& settings) { TRACE_EVENT0("flutter", "DartSnapshot::VMSnapshotFromSettings"); +#if OS_WIN + return fxl::MakeRefCounted( + DartSnapshotBuffer::CreateWithUnmanagedAllocation(kDartVmSnapshotData), + DartSnapshotBuffer::CreateWithUnmanagedAllocation( + kDartVmSnapshotInstructions)); +#else // OS_WIN auto snapshot = fxl::MakeRefCounted(ResolveVMData(settings), // ResolveVMInstructions(settings) // @@ -115,11 +121,19 @@ fxl::RefPtr DartSnapshot::VMSnapshotFromSettings( return snapshot; } return nullptr; +#endif // OS_WIN } fxl::RefPtr DartSnapshot::IsolateSnapshotFromSettings( const Settings& settings) { TRACE_EVENT0("flutter", "DartSnapshot::IsolateSnapshotFromSettings"); +#if OS_WIN + return fxl::MakeRefCounted( + DartSnapshotBuffer::CreateWithUnmanagedAllocation( + kDartIsolateSnapshotData), + DartSnapshotBuffer::CreateWithUnmanagedAllocation( + kDartIsolateSnapshotInstructions)); +#else // OS_WIN auto snapshot = fxl::MakeRefCounted(ResolveIsolateData(settings), // ResolveIsolateInstructions(settings) // @@ -128,6 +142,7 @@ fxl::RefPtr DartSnapshot::IsolateSnapshotFromSettings( return snapshot; } return nullptr; +#endif } DartSnapshot::DartSnapshot(std::unique_ptr data, diff --git a/runtime/dart_snapshot_buffer.cc b/runtime/dart_snapshot_buffer.cc index c39233ac8334a..c18c80e35b884 100644 --- a/runtime/dart_snapshot_buffer.cc +++ b/runtime/dart_snapshot_buffer.cc @@ -51,6 +51,20 @@ class FileSnapshotBuffer final : public DartSnapshotBuffer { FXL_DISALLOW_COPY_AND_ASSIGN(FileSnapshotBuffer); }; +class UnmanagedAllocation final : public DartSnapshotBuffer { + public: + UnmanagedAllocation(const uint8_t* allocation) : allocation_(allocation) {} + + const uint8_t* GetSnapshotPointer() const override { return allocation_; } + + size_t GetSnapshotSize() const override { return 0; } + + private: + const uint8_t* allocation_; + + FXL_DISALLOW_COPY_AND_ASSIGN(UnmanagedAllocation); +}; + std::unique_ptr DartSnapshotBuffer::CreateWithSymbolInLibrary( fxl::RefPtr library, @@ -67,6 +81,14 @@ DartSnapshotBuffer::CreateWithContentsOfFile(const char* file_path, return source->GetSnapshotPointer() == nullptr ? nullptr : std::move(source); } +std::unique_ptr +DartSnapshotBuffer::CreateWithUnmanagedAllocation(const uint8_t* allocation) { + if (allocation == nullptr) { + return nullptr; + } + return std::make_unique(allocation); +} + DartSnapshotBuffer::~DartSnapshotBuffer() = default; } // namespace blink diff --git a/runtime/dart_snapshot_buffer.h b/runtime/dart_snapshot_buffer.h index 675946c0ca63f..8367b658dfdf0 100644 --- a/runtime/dart_snapshot_buffer.h +++ b/runtime/dart_snapshot_buffer.h @@ -22,6 +22,9 @@ class DartSnapshotBuffer { const char* file_path, bool executable); + static std::unique_ptr CreateWithUnmanagedAllocation( + const uint8_t* allocation); + virtual ~DartSnapshotBuffer(); virtual const uint8_t* GetSnapshotPointer() const = 0; From 3393c17901f61f19a75cb3329fa069c78c8eac45 Mon Sep 17 00:00:00 2001 From: Mikkel Nygaard Ravn Date: Tue, 17 Apr 2018 16:02:10 +0200 Subject: [PATCH 0119/1190] Fix Android platform channels (#5025) --- .../platform_message_response_android.cc | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/shell/platform/android/platform_message_response_android.cc b/shell/platform/android/platform_message_response_android.cc index 214080ec5bde3..b1bdc49147feb 100644 --- a/shell/platform/android/platform_message_response_android.cc +++ b/shell/platform/android/platform_message_response_android.cc @@ -35,13 +35,6 @@ void PlatformMessageResponseAndroid::Complete(std::vector data) { return; } - if (data.size() == 0) { - // If the data is empty, there is no reason to create a Java byte - // array. Make the response now with a nullptr now. - FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), - response, nullptr); - } - // Convert the vector to a Java byte array. fml::jni::ScopedJavaLocalRef data_array( env, env->NewByteArray(data.size())); @@ -56,7 +49,23 @@ void PlatformMessageResponseAndroid::Complete(std::vector data) { // |blink::PlatformMessageResponse| void PlatformMessageResponseAndroid::CompleteEmpty() { - Complete(std::vector{}); -} + platform_task_runner_->PostTask( + fxl::MakeCopyable([response = response_id_, // + weak_java_object = weak_java_object_ // + ]() { + // We are on the platform thread. Attempt to get the strong reference to + // the Java object. + auto env = fml::jni::AttachCurrentThread(); + auto java_object = weak_java_object.get(env); + if (java_object.is_null()) { + // The Java object was collected before this message response got to + // it. Drop the response on the floor. + return; + } + // Make the response call into Java. + FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), + response, nullptr); + })); +} } // namespace shell From e6545573202053b86881630281ac38bac40aa76f Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 17 Apr 2018 09:16:24 -0700 Subject: [PATCH 0120/1190] Enable 'Speak Screen' and 'Switch Control' for iOS (#5016) --- .../framework/Source/FlutterViewController.mm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 17e9a4eff48f6..2e13ffb738c1b 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -272,10 +272,20 @@ - (void)setupNotificationCenterObservers { object:nil]; [center addObserver:self - selector:@selector(onVoiceOverChanged:) + selector:@selector(onAccessibilityStatusChanged:) name:UIAccessibilityVoiceOverStatusChanged object:nil]; + [center addObserver:self + selector:@selector(onAccessibilityStatusChanged:) + name:UIAccessibilitySwitchControlStatusDidChangeNotification + object:nil]; + + [center addObserver:self + selector:@selector(onAccessibilityStatusChanged:) + name:UIAccessibilitySpeakScreenStatusDidChangeNotification + object:nil]; + [center addObserver:self selector:@selector(onMemoryWarning:) name:UIApplicationDidReceiveMemoryWarningNotification @@ -393,7 +403,7 @@ - (void)viewDidAppear:(BOOL)animated { TRACE_EVENT0("flutter", "viewDidAppear"); [self onLocaleUpdated:nil]; [self onUserSettingsChanged:nil]; - [self onVoiceOverChanged:nil]; + [self onAccessibilityStatusChanged:nil]; [_lifecycleChannel.get() sendMessage:@"AppLifecycleState.resumed"]; [super viewDidAppear:animated]; @@ -739,14 +749,15 @@ - (NSUInteger)supportedInterfaceOrientations { #pragma mark - Accessibility -- (void)onVoiceOverChanged:(NSNotification*)notification { +- (void)onAccessibilityStatusChanged:(NSNotification*)notification { #if TARGET_OS_SIMULATOR // There doesn't appear to be any way to determine whether the accessibility // inspector is enabled on the simulator. We conservatively always turn on the // accessibility bridge in the simulator. bool enabled = true; #else - bool enabled = UIAccessibilityIsVoiceOverRunning(); + bool enabled = UIAccessibilityIsVoiceOverRunning() || UIAccessibilityIsSwitchControlRunning() || + UIAccessibilityIsSpeakScreenEnabled(); #endif _shell->GetPlatformView()->SetSemanticsEnabled(enabled); } From ecaefd7a3a4ce41cf79fbc670091b48975d78824 Mon Sep 17 00:00:00 2001 From: Ravi Mistry Date: Tue, 17 Apr 2018 13:51:17 -0400 Subject: [PATCH 0121/1190] Roll src/third_party/skia/ 276886160..1cd6098d5 (50 commits) (#5026) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://skia.googlesource.com/skia.git/+log/276886160ba9..1cd6098d52a5 $ git log 276886160..1cd6098d5 --date=short --no-merges --format='%ad %ae %s' 2018-04-17 caryclark path is rect bug number twelve 2018-04-17 bungeman Add paint flags to viewer GUI. 2018-04-17 mtklein skcms→3be11ac refactor a bit 2018-04-17 liyuqian Revert "Fix the fat rect bug in the threaded backend" 2018-04-17 reed only recheck fNeedsTiling if we computed fSrcBounds 2018-04-17 brianosman Add SkColorSpace::Make, taking an skcms_ICCProfile 2018-04-16 mtklein Reland "low-hanging bilerp_clamp_8888 wins" 2018-04-17 mtklein skcms→38f22d2 name types in skcms.h 2018-04-17 herb Reorganize strike cache and glyph cache code 2018-04-16 liyuqian Fix the fat rect bug in the threaded backend 2018-04-17 caryclark yet another path is rect exploit 2018-04-17 angle-skia-autoroll Roll third_party/externals/angle2/ 08b9e046c..86de76b69 (1 commit) 2018-04-16 halcanary SkColorSetARGB in constants 2018-04-16 caryclark a more involved path is rect bug 2018-04-16 egdaniel Update our config fallback switch in GrContext. 2018-04-17 borenet Revert "Reland "[infra] Run recipes through Kitchen"" 2018-04-16 borenet Reland "[infra] Run recipes through Kitchen" 2018-04-17 angle-skia-autoroll Roll third_party/externals/angle2/ a4fa9c278..08b9e046c (6 commits) 2018-04-17 mtklein Revert "low-hanging bilerp_clamp_8888 wins" 2018-04-16 mtklein low-hanging bilerp_clamp_8888 wins 2018-04-16 csmartdalton Don't support GrCubicEffect if float != fp32 2018-04-13 bungeman Add pixel geometry and dft selection to viewer app. 2018-04-16 csmartdalton Revert "ccpr: Implement conics" 2018-04-16 csmartdalton ccpr: Implement conics 2018-04-16 reed show cubic error-vectors anchored on pt(s) of max deviation 2018-04-16 herb Rename SkGlyphCacheGlobals to SkStrikeCache 2018-04-16 csmartdalton Add glFlush workaround for instanced draws on Skylake 2018-04-13 bungeman Remove SkPaint::kGenA8FromLCD_Flag. 2018-04-16 kjlubick Fix many return-std-move-in-c++11 warnings 2018-04-16 fmalita Remove unused BW mask blitters 2018-04-16 mtklein disable -Wself-assign in Google3 2018-04-16 mtklein skcms→2667f0a Add skcms_BestSingleCurve utility 2018-04-16 reed optimize fast/simple case in raster tiling 2018-04-13 liyuqian Simplify the operation on atomic fIsFinishing 2018-04-13 liyuqian Let SkCoverageDeltaList store width and use it during blitting 2018-04-11 liyuqian SkBlitter is not thread safe; make one for each thread. 2018-04-12 liyuqian Snap the bitmap as it may be changed later 2018-04-16 halcanary SkPDF: use std::aligned_storage for typed union 2018-04-16 rmistry Some Chromium bots have been LUCIfied 2018-04-16 angle-skia-autoroll Roll third_party/externals/angle2/ 76b2c3852..a4fa9c278 (3 commits) 2018-04-16 egdaniel Don't allow ganesh to allocate mip maps for wrapped textures. 2018-04-10 bsalomon Draw stroked circles with round caps analytically. 2018-04-16 liyuqian Reland "Cumulate deltas even if they're out of the clip" 2018-04-16 caryclark document SkColor.h 2018-04-16 liyuqian Revert "Cumulate deltas even if they're out of the clip" 2018-04-15 csmartdalton ccpr: Normalize the cubic inflection function instead of its roots 2018-04-05 herb Remove all notion of transport from the API - V2. 2018-04-16 robertphillips Unblacklist fixed tests on DDL3 bots 2018-04-16 mtklein skcms→019d877 add a basic profiling mode to src/Transform.c 2018-04-16 bsalomon Make TestCase class in GrShapeTest heap allocate its GrShapes Created with: roll-dep src/third_party/skia --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index b76d268685531..fe941181988c3 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '276886160ba96748c901b7319ca8f876415269c6', + 'skia_revision': '1cd6098d52a531451f194437861cd7a548f825a7', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c7a001683cbaf..3706a26ac4a30 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 11eed2d794a665c2ed961ab41d6006b7 +Signature: 8f19b1dfcd43f6f21408c4a70e0d6eaf UNUSED LICENSES: @@ -17262,6 +17262,7 @@ FILE: ../../../third_party/skia/src/core/SkRectPriv.h FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.cpp FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.h FILE: ../../../third_party/skia/src/core/SkSafeRange.h +FILE: ../../../third_party/skia/src/core/SkStrikeCache.cpp FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h @@ -17346,6 +17347,7 @@ FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.h FILE: ../../../third_party/skia/third_party/skcms/src/Macros.h FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.c FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.h +FILE: ../../../third_party/skia/third_party/skcms/src/RandomBytes.h FILE: ../../../third_party/skia/third_party/skcms/src/TF13.c FILE: ../../../third_party/skia/third_party/skcms/src/TransferFunction.c FILE: ../../../third_party/skia/third_party/skcms/src/TransferFunction.h @@ -17404,6 +17406,8 @@ FILE: ../../../third_party/skia/bench/skpbench.json FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh +FILE: ../../../third_party/skia/docs/SkColor4f_Reference.bmh +FILE: ../../../third_party/skia/docs/SkColor_Reference.bmh FILE: ../../../third_party/skia/docs/SkIPoint_Reference.bmh FILE: ../../../third_party/skia/docs/SkIRect_Reference.bmh FILE: ../../../third_party/skia/docs/SkImageInfo_Reference.bmh @@ -20434,10 +20438,10 @@ FILE: ../../../third_party/skia/include/gpu/GrConfig.h FILE: ../../../third_party/skia/include/gpu/GrContext.h FILE: ../../../third_party/skia/include/gpu/GrTypes.h FILE: ../../../third_party/skia/include/private/GrColor.h -FILE: ../../../third_party/skia/src/core/SkGlyphCache_Globals.h FILE: ../../../third_party/skia/src/core/SkImageInfo.cpp FILE: ../../../third_party/skia/src/core/SkRasterClip.cpp FILE: ../../../third_party/skia/src/core/SkRasterClip.h +FILE: ../../../third_party/skia/src/core/SkStrikeCache.h FILE: ../../../third_party/skia/src/gpu/GrAllocator.h FILE: ../../../third_party/skia/src/gpu/GrBufferAllocPool.cpp FILE: ../../../third_party/skia/src/gpu/GrBufferAllocPool.h From 0c09bf03d1dcde1a6c8cfaa2102949abac7757cd Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 17 Apr 2018 12:07:00 -0700 Subject: [PATCH 0122/1190] In the service protocol, if no view is specified to flush tasks on, pick the first one. (#5028) --- runtime/service_protocol.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/service_protocol.cc b/runtime/service_protocol.cc index 030901e54269d..f2960d624dcb1 100644 --- a/runtime/service_protocol.cc +++ b/runtime/service_protocol.cc @@ -189,7 +189,8 @@ bool ServiceProtocol::HandleMessage(fxl::StringView method, // TODO(chinmaygarde): Deprecate these calls in the tools and remove these // fallbacks. if (method == kScreenshotExtensionName || - method == kScreenshotSkpExtensionName) { + method == kScreenshotSkpExtensionName || + method == kFlushUIThreadTasksExtensionName) { return HandleMessageOnHandler(*handlers_.begin(), method, params, response); } From 5c857ee5bdec4158e3efe79943504adcae72f10e Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 17 Apr 2018 16:02:06 -0700 Subject: [PATCH 0123/1190] Set the start timestamp in the contructor of the first shell. (#5030) --- shell/common/shell.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 468ebaf99b9e0..dd2940dccbf81 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -16,6 +16,7 @@ #include "flutter/fml/message_loop.h" #include "flutter/glue/trace_event.h" #include "flutter/runtime/dart_vm.h" +#include "flutter/runtime/start_up.h" #include "flutter/shell/common/engine.h" #include "flutter/shell/common/skia_event_tracer_impl.h" #include "flutter/shell/common/switches.h" @@ -145,11 +146,19 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( return shell; } +static void RecordStartupTimestamp() { + if (blink::engine_main_enter_ts == 0) { + blink::engine_main_enter_ts = Dart_TimelineGetMicros(); + } +} + std::unique_ptr Shell::Create( blink::TaskRunners task_runners, blink::Settings settings, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer) { + RecordStartupTimestamp(); + fxl::LogSettings log_settings; log_settings.min_log_level = settings.verbose_logging ? fxl::LOG_INFO : fxl::LOG_ERROR; From 00911b2a85ec309b5bf206a3df47d77c89a804e3 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 17 Apr 2018 17:10:17 -0700 Subject: [PATCH 0124/1190] Don't send platform messages to isolates that are not running. (#5031) Isolates may be launched and awaiting snapshot association. We don't want to send such isolates any messages before their "main" method is called. In such cases, the engine may intercept and store certain launch specific information. --- runtime/runtime_controller.cc | 7 +++++++ runtime/runtime_controller.h | 2 ++ shell/common/engine.cc | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index e7a8ab525329a..b7566a10a084c 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -78,6 +78,13 @@ RuntimeController::~RuntimeController() { } } +bool RuntimeController::IsRootIsolateRunning() const { + if (root_isolate_) { + return root_isolate_->GetPhase() == DartIsolate::Phase::Running; + } + return false; +} + std::unique_ptr RuntimeController::Clone() const { return std::unique_ptr(new RuntimeController( client_, // diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 326c517f31db2..fb01847a915ae 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -46,6 +46,8 @@ class RuntimeController final : public WindowClient { bool NotifyIdle(int64_t deadline); + bool IsRootIsolateRunning() const; + bool DispatchPlatformMessage(fxl::RefPtr message); bool DispatchPointerDataPacket(const PointerDataPacket& packet); diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 3d6fd496d3fa9..d1231b0d09961 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -259,7 +259,8 @@ void Engine::DispatchPlatformMessage( return; } - if (runtime_controller_->DispatchPlatformMessage(std::move(message))) { + if (runtime_controller_->IsRootIsolateRunning() && + runtime_controller_->DispatchPlatformMessage(std::move(message))) { return; } From 387945c5073aab1007394a70ef744ec15e309b8e Mon Sep 17 00:00:00 2001 From: xster Date: Tue, 17 Apr 2018 18:32:50 -0700 Subject: [PATCH 0125/1190] Correct ninja command instruction (#5032) giving -C twice silently only builds one directory --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45af0eacee586..9e5f9bb574f4e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,7 +97,7 @@ Run the following steps, from the `src` directory created in the steps above: * `gclient sync` to update your dependencies. * `./flutter/tools/gn --android --unoptimized` to prepare your build files for device-side executables (or `--android --android-cpu [x86|x64] --unoptimized` for x86/x64 emulators) . * `./flutter/tools/gn --unoptimized` to prepare the build files for host-side executables. -* `ninja -C out/android_debug_unopt -C out/host_debug_unopt` to build all executables (use `out/android_debug_unopt_x64` for x86/x64 emulators). +* `ninja -C out/android_debug_unopt && ninja -C out/host_debug_unopt` to build all executables (use `out/android_debug_unopt_x64` for x86/x64 emulators). * For Googlers, consider also using the option `-j 1000` to parallelize the build using Goma. This builds a debug-enabled ("unoptimized") binary configured to run Dart in @@ -143,7 +143,7 @@ to test the engine. * For a discussion on the various flags and modes, [read this discussion](https://github.com/flutter/flutter/wiki/Flutter's-modes). * This also produces an Xcode project for working with the engine source code at `out/ios_debug_unopt` * `./flutter/tools/gn --unoptimized` to prepare the build files for host-side executables. -* `ninja -C out/ios_debug_unopt -C out/host_debug_unopt` to build all artifacts (use `out/ios_debug_sim_unopt` for Simulator). +* `ninja -C out/ios_debug_unopt && ninja -C out/host_debug_unopt` to build all artifacts (use `out/ios_debug_sim_unopt` for Simulator). * For Googlers, consider also using the option `-j 1000` to parallelize the build using Goma. Once the artifacts are built, you can start using them in your application by following these steps: From d8eb659b15bea5ac4a38826fab2433d2732e733c Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 17 Apr 2018 18:45:58 -0700 Subject: [PATCH 0126/1190] Make the rasterizer own the compositor context. (#5034) This allows the texture registry to be accessed before render surface acquisition. --- shell/common/rasterizer.cc | 14 +++++--------- shell/common/rasterizer.h | 2 +- shell/common/surface.cc | 18 ++---------------- shell/common/surface.h | 6 ------ shell/gpu/gpu_surface_gl.cc | 2 -- 5 files changed, 8 insertions(+), 34 deletions(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 20f74cecb8591..186db591d3ac6 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -28,19 +28,17 @@ fml::WeakPtr Rasterizer::GetWeakPtr() const { void Rasterizer::Setup(std::unique_ptr surface) { surface_ = std::move(surface); + compositor_context_.OnGrContextCreated(); } void Rasterizer::Teardown() { + compositor_context_.OnGrContextDestroyed(); surface_.reset(); last_layer_tree_.reset(); } flow::TextureRegistry* Rasterizer::GetTextureRegistry() { - if (!surface_) { - return nullptr; - } - - return &(surface_->GetCompositorContext().texture_registry()); + return &compositor_context_.texture_registry(); } flow::LayerTree* Rasterizer::GetLastLayerTree() { @@ -97,14 +95,12 @@ bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) { return false; } - auto& compositor_context = surface_->GetCompositorContext(); - // There is no way for the compositor to know how long the layer tree // construction took. Fortunately, the layer tree does. Grab that time // for instrumentation. - compositor_context.engine_time().SetLapTime(layer_tree.construction_time()); + compositor_context_.engine_time().SetLapTime(layer_tree.construction_time()); - auto compositor_frame = compositor_context.AcquireFrame( + auto compositor_frame = compositor_context_.AcquireFrame( surface_->GetContext(), frame->SkiaCanvas(), true); if (compositor_frame && compositor_frame->Raster(layer_tree, false)) { diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 908717b74c168..e373b1138c742 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -62,7 +62,7 @@ class Rasterizer final { private: blink::TaskRunners task_runners_; std::unique_ptr surface_; - std::unique_ptr compositor_context_; + flow::CompositorContext compositor_context_; std::unique_ptr last_layer_tree_; fxl::Closure next_frame_callback_; fml::WeakPtr weak_prototype_; diff --git a/shell/common/surface.cc b/shell/common/surface.cc index 228647e8b3512..d9b620fbc633e 100644 --- a/shell/common/surface.cc +++ b/shell/common/surface.cc @@ -60,22 +60,8 @@ bool SurfaceFrame::PerformSubmit() { return false; } -Surface::Surface() : Surface(std::make_unique()) {} - -Surface::Surface(std::unique_ptr compositor_context) - : compositor_context_(std::move(compositor_context)) { - FXL_DCHECK(compositor_context_); - // TODO: Get rid of these explicit calls and move the logic to the c/dtors of - // the compositor context. - compositor_context_->OnGrContextCreated(); -} - -Surface::~Surface() { - compositor_context_->OnGrContextDestroyed(); -} +Surface::Surface() = default; -flow::CompositorContext& Surface::GetCompositorContext() { - return *compositor_context_; -} +Surface::~Surface() = default; } // namespace shell diff --git a/shell/common/surface.h b/shell/common/surface.h index 6133a7d519fff..8c3d242193c40 100644 --- a/shell/common/surface.h +++ b/shell/common/surface.h @@ -45,8 +45,6 @@ class Surface { public: Surface(); - Surface(std::unique_ptr compositor_context); - virtual ~Surface(); virtual bool IsValid() = 0; @@ -55,11 +53,7 @@ class Surface { virtual GrContext* GetContext() = 0; - flow::CompositorContext& GetCompositorContext(); - private: - std::unique_ptr compositor_context_; - FXL_DISALLOW_COPY_AND_ASSIGN(Surface); }; diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 284a10e413b46..11482e48f6099 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -72,8 +72,6 @@ GPUSurfaceGL::~GPUSurfaceGL() { return; } - GetCompositorContext().OnGrContextDestroyed(); - onscreen_surface_ = nullptr; context_->releaseResourcesAndAbandonContext(); context_ = nullptr; From 5822b6e578de7b6c6c0d802dd2b5b9d363e48c14 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 17 Apr 2018 19:04:52 -0700 Subject: [PATCH 0127/1190] Clear the canvas when attempting to render to the surface. (#5036) --- shell/common/rasterizer.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 186db591d3ac6..20fc88258024b 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -100,8 +100,14 @@ bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) { // for instrumentation. compositor_context_.engine_time().SetLapTime(layer_tree.construction_time()); - auto compositor_frame = compositor_context_.AcquireFrame( - surface_->GetContext(), frame->SkiaCanvas(), true); + auto canvas = frame->SkiaCanvas(); + + auto compositor_frame = + compositor_context_.AcquireFrame(surface_->GetContext(), canvas, true); + + if (canvas) { + canvas->clear(SK_ColorBLACK); + } if (compositor_frame && compositor_frame->Raster(layer_tree, false)) { frame->Submit(); From c73be7ada2e1066e2a6f04f0541406409c2bfa6b Mon Sep 17 00:00:00 2001 From: Siva Date: Wed, 18 Apr 2018 02:07:56 -0700 Subject: [PATCH 0128/1190] Roll Dart to version fe606f890b0a311da802c78b0af414a3c2087a79 (#5033) fe606f890b Revert [vm/compiler] Canonicalize more intermediate constants in IL. 54531ad4e7 Bring in the latest pub_semver 61b15fede8 [build] Remove unnecessary inputs from uses of application_snapshot. 9968728df1 Remove package:cli_util deps from package:analyzer. 0ca8b6e5be Improve recovery when "assert" is used in an expression 6de5da1f58 fix #32649, add an option to disable asserts in DDC/K afbaf0c4a6 Add 'Extract Widget' to getAvailableRefactorings(). d4a1896cfb Demote IMPORT_DUPLICATED_LIBRARY_NAMED to a warning f85480b4dd Add tests for CFE implementation of expression compilation. a865531f57 Remove two unused classes from the public API 3b7199fe63 [standalone] Only allow one outstanding load when running with --deterministic. 35fecb4a10 Issue 32896. Add isXYZ accessors to ParameterElementForLink_VariableSetter. 8df94f34fd Improve fasta parser await-for statement recovery dd897d35a2 Move the task API out of the public API c32e0e4bf3 [vm] Clear trailing bytes of objects that end up in snapshot images. 3a5fcf5a87 Upgrade the dep on package:isolate. 973a1a0219 Remove uses of upper-case constants in remaining SDK code. b3595d59b3 [VM] Revert small change in FlowGraphCompiler::EmitTestAndCallCheckCid 0cbd4b520a Address review comments from change 51120 5dd283e783 fix #32270, DDC tests can now work with preview-dart-2 ce2b0db370 Improve fasta parser "assert" recovery f8f5365a94 [vm/compiler] Fix sorting of instructions stats. 30655dcea0 [vm/aot] Treat Endian.host as a compile time constant. eeaea82b75 Update status on test that often times out 805c08d8bf Fix a run-time type issue when running in Dart 2 mode b1bc4ed2b5 Handle as in nested const constructors 823dfda5a5 Delete serialization, except for equivalence and helpers used in other tests. 7383cd46e0 Fix for issue 32872 86ba29265a Clean up the use of deprecated API in the analyzer_plugin package fbb60b786f Add generic bounds test to function_type_variable_test fd5f998796 [vm] Delta-encode offsets into ROData. 6fe7a86e7f Replace SourceFactory.resolveUri() with resolveRelativeUri() in resynthesizer. 2fb94418cd Mark mirrors test crashing. c2b338f1b7 Remove fuzzy arrow support from analyzer 9976cddcd7 Shared cache of FileState contents. b52931ff30 Revert "[vm/kernel] Fix non-canoncialized type arguments in partial instantiation." c214c43758 Make LineInfo a public class bd12c869ae [vm/kernel] Fix non-canoncialized type arguments in partial instantiation. 51a2f96a71 Always call writeAnnotationList to write annotations. 974a8ee21d Fix crash in named function expression 988de9c925 Thread forest object through calls 51f9d243e7 [VM] Mark type as finalized before calling the Canonicalize() method a8578eaf69 Clean up some imports in Fasta type inference e9616da13e Cleanup TypeInfo 3b414a277c Reland "[VM] Introduction of type testing stubs - Part 1-4" c5f69dff2d Include `call` on Closure in inference 826928e2ab Use _trust to test inference of --omit-implicit-checks 6802746ad7 Fixed a couple of typos in subtyping.md 782cfe04d1 fix #32756, DDC dynamic calls to generics will work with emit-metadata 8613938e33 fix DDK to track mock setters correctly. 92f1d0fab4 [gn] Allow single or double quotes in .config e2ee654cd1 Make a method in MempryResourceProvider private b0fafbd1f4 Clean up js_runtime parse/tryParse methods 5e1cb4d41b Make SourceRange part of analyzers public API 1ab4cee181 Add a benchmark for running flutter analyze --flutter-repo against flutter head. ff24a5ee6b fasta: make strong-mode inference aware of the type of LoadLibrary and CheckLibraryIsLoaded 6d7df88fa3 Delay computing file name sets until they are requested. b7cc1e7ce7 Fix stack overflow in RTI computation 6db4ea4ca5 [vm] Use unsigned varints when possible in the clustered snapshot. --- DEPS | 10 +++------- flutter_kernel_transformers/pubspec.yaml | 2 -- frontend_server/pubspec.yaml | 3 --- tools/licenses/pubspec.lock | 4 ++-- travis/licenses_golden/licenses_third_party | 4 +++- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/DEPS b/DEPS index fe941181988c3..cc9c44f24ac57 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'f76dad0adcf6766d73351354da653d6a793b5abc', + 'dart_revision': 'fe606f890b0a311da802c78b0af414a3c2087a79', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -58,7 +58,6 @@ vars = { 'dart_http_tag': '0.11.3+16', 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', - 'dart_isolate_tag': '1.1.0', 'dart_json_rpc_2_tag': '2.0.6', 'dart_linter_tag': '0.1.47', 'dart_logging_tag': '0.11.3+1', @@ -76,7 +75,7 @@ vars = { 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', - 'dart_pub_semver_tag': '1.3.6', + 'dart_pub_semver_tag': '1.3.7', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', @@ -115,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '3cf97e01cdbd4bb920fa3d40282a56c4b2d62a58', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '66676c9960264c96d1b424264a5966f8e2b40153', # Fuchsia compatibility # @@ -209,9 +208,6 @@ deps = { 'src/third_party/dart/third_party/pkg/dartdoc': Var('dart_git') + '/dartdoc.git' + '@' + Var('dart_dartdoc_tag'), - 'src/third_party/dart/third_party/pkg/isolate': - Var('dart_git') + '/isolate.git' + '@' + Var('dart_isolate_tag'), - 'src/third_party/dart/third_party/pkg/json_rpc_2': Var('dart_git') + '/json_rpc_2.git' + '@' + Var('dart_json_rpc_2_tag'), diff --git a/flutter_kernel_transformers/pubspec.yaml b/flutter_kernel_transformers/pubspec.yaml index 87d617b7afb46..0ef451c2cc92a 100644 --- a/flutter_kernel_transformers/pubspec.yaml +++ b/flutter_kernel_transformers/pubspec.yaml @@ -68,8 +68,6 @@ dependency_overrides: path: ../../third_party/dart/third_party/pkg/http_multi_server http_parser: path: ../../third_party/dart/third_party/pkg/http_parser - isolate: - path: ../../third_party/dart/third_party/pkg/isolate matcher: path: ../../third_party/dart/third_party/pkg/matcher mime: diff --git a/frontend_server/pubspec.yaml b/frontend_server/pubspec.yaml index f7b9ee1746406..bb33fa85093f2 100644 --- a/frontend_server/pubspec.yaml +++ b/frontend_server/pubspec.yaml @@ -35,7 +35,6 @@ dev_dependencies: http: any http_multi_server: any http_parser: any - isolate: any matcher: any mime: any mockito: any @@ -117,8 +116,6 @@ dependency_overrides: path: ../../third_party/dart/third_party/pkg/http_multi_server http_parser: path: ../../third_party/dart/third_party/pkg/http_parser - isolate: - path: ../../third_party/dart/third_party/pkg/isolate matcher: path: ../../third_party/dart/third_party/pkg/matcher mime: diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 26c6f128265d0..fec5d297e5a9d 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -1,5 +1,5 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See http://pub.dartlang.org/doc/glossary.html#lockfile packages: archive: dependency: "direct main" @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-edge.af1436931b93e755d38223c487d33a0a1f5eadf5" + dart: ">=1.21.0 <=2.0.0-dev.20.0" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3706a26ac4a30..3483b628c2cf2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8f19b1dfcd43f6f21408c4a70e0d6eaf +Signature: 41215836c65ba6b747e9e86edafa51cb UNUSED LICENSES: @@ -6069,6 +6069,8 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h FILE: ../../../third_party/dart/sdk/lib/js/_js.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart From a0804f37388cafa68a19611e34bd5ca8753f15b5 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 18 Apr 2018 11:07:16 -0700 Subject: [PATCH 0129/1190] Simplify weak pointer factories and allow vending weak pointers on multiple threads. (#5029) --- fml/memory/weak_ptr.h | 31 ++++++++----------------------- fml/memory/weak_ptr_unittest.cc | 31 ------------------------------- runtime/dart_isolate.cc | 3 +-- runtime/dart_isolate.h | 1 - shell/common/engine.cc | 4 +--- shell/common/engine.h | 1 - shell/common/io_manager.cc | 9 +++------ shell/common/io_manager.h | 1 - shell/common/platform_view.cc | 6 ++---- shell/common/platform_view.h | 1 - shell/common/rasterizer.cc | 6 ++---- shell/common/rasterizer.h | 1 - 12 files changed, 17 insertions(+), 78 deletions(-) diff --git a/fml/memory/weak_ptr.h b/fml/memory/weak_ptr.h index 2b369952d7306..946ab645e0a0d 100644 --- a/fml/memory/weak_ptr.h +++ b/fml/memory/weak_ptr.h @@ -159,35 +159,20 @@ class WeakPtr { template class WeakPtrFactory { public: - explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { FXL_DCHECK(ptr_); } - - ~WeakPtrFactory() { InvalidateWeakPtrs(); } - - // Gets a new weak pointer, which will be valid until either - // |InvalidateWeakPtrs()| is called or this object is destroyed. - WeakPtr GetWeakPtr() { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - if (!flag_) - flag_ = fxl::MakeRefCounted(); - return WeakPtr(ptr_, flag_.Clone(), checker_); + explicit WeakPtrFactory(T* ptr) + : ptr_(ptr), flag_(fxl::MakeRefCounted()) { + FXL_DCHECK(ptr_); } - // Call this method to invalidate all existing weak pointers. (Note that - // additional weak pointers can be produced even after this is called.) - void InvalidateWeakPtrs() { + ~WeakPtrFactory() { FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - if (!flag_) - return; flag_->Invalidate(); - flag_ = nullptr; } - // Call this method to determine if any weak pointers exist. (Note that a - // "false" result is definitive, but a "true" result may not be if weak - // pointers are held/reset/destroyed/reassigned on other threads.) - bool HasWeakPtrs() const { - FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - return flag_ && !flag_->HasOneRef(); + // Gets a new weak pointer, which will be valid until either + // |InvalidateWeakPtrs()| is called or this object is destroyed. + WeakPtr GetWeakPtr() const { + return WeakPtr(ptr_, flag_.Clone(), checker_); } private: diff --git a/fml/memory/weak_ptr_unittest.cc b/fml/memory/weak_ptr_unittest.cc index 2b6dbd035e78c..3e0ecdd834bbc 100644 --- a/fml/memory/weak_ptr_unittest.cc +++ b/fml/memory/weak_ptr_unittest.cc @@ -162,36 +162,5 @@ TEST(WeakPtrTest, UpcastMoveAssignment) { EXPECT_EQ(&data, ptr2.get()); } -TEST(WeakPtrTest, InvalidateWeakPtrs) { - int data = 0; - WeakPtrFactory factory(&data); - WeakPtr ptr = factory.GetWeakPtr(); - EXPECT_EQ(&data, ptr.get()); - EXPECT_TRUE(factory.HasWeakPtrs()); - factory.InvalidateWeakPtrs(); - EXPECT_EQ(nullptr, ptr.get()); - EXPECT_FALSE(factory.HasWeakPtrs()); - - // Test that the factory can create new weak pointers after a - // |InvalidateWeakPtrs()| call, and that they remain valid until the next - // |InvalidateWeakPtrs()| call. - WeakPtr ptr2 = factory.GetWeakPtr(); - EXPECT_EQ(&data, ptr2.get()); - EXPECT_TRUE(factory.HasWeakPtrs()); - factory.InvalidateWeakPtrs(); - EXPECT_EQ(nullptr, ptr2.get()); - EXPECT_FALSE(factory.HasWeakPtrs()); -} - -TEST(WeakPtrTest, HasWeakPtrs) { - int data = 0; - WeakPtrFactory factory(&data); - { - WeakPtr ptr = factory.GetWeakPtr(); - EXPECT_TRUE(factory.HasWeakPtrs()); - } - EXPECT_FALSE(factory.HasWeakPtrs()); -} - } // namespace } // namespace fml diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 6d69ab7fc5aeb..59093da140632 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -107,7 +107,6 @@ DartIsolate::DartIsolate(const DartVM* vm, isolate_snapshot_(std::move(isolate_snapshot)), weak_factory_(this) { FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; - weak_prototype_ = weak_factory_.GetWeakPtr(); if (vm_ == nullptr) { return; @@ -679,7 +678,7 @@ fxl::RefPtr DartIsolate::GetIsolateSnapshot() const { } fml::WeakPtr DartIsolate::GetWeakIsolatePtr() const { - return weak_prototype_; + return weak_factory_.GetWeakPtr(); } void DartIsolate::AddIsolateShutdownCallback(fxl::Closure closure) { diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index 13d573ebe333f..dd402b157c2ab 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -103,7 +103,6 @@ class DartIsolate : public UIDartState { Phase phase_ = Phase::Unknown; const fxl::RefPtr isolate_snapshot_; std::vector> shutdown_callbacks_; - fml::WeakPtr weak_prototype_; fml::WeakPtrFactory weak_factory_; FXL_WARN_UNUSED_RESULT diff --git a/shell/common/engine.cc b/shell/common/engine.cc index d1231b0d09961..43c2e4e5b7b32 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -56,8 +56,6 @@ Engine::Engine(Delegate& delegate, activity_running_(false), have_surface_(false), weak_factory_(this) { - weak_prototype_ = weak_factory_.GetWeakPtr(); - if (legacy_sky_platform_) { // TODO: Remove this legacy call along with the platform. This is what makes // the engine unable to run from multiple threads in the legacy @@ -84,7 +82,7 @@ Engine::~Engine() { } fml::WeakPtr Engine::GetWeakPtr() const { - return weak_prototype_; + return weak_factory_.GetWeakPtr(); } bool Engine::UpdateAssetManager( diff --git a/shell/common/engine.h b/shell/common/engine.h index ede442ee3e8a4..dfb2ac1191ef4 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -109,7 +109,6 @@ class Engine final : public blink::RuntimeDelegate { fxl::RefPtr asset_manager_; bool activity_running_; bool have_surface_; - fml::WeakPtr weak_prototype_; fml::WeakPtrFactory weak_factory_; // |blink::RuntimeDelegate| diff --git a/shell/common/io_manager.cc b/shell/common/io_manager.cc index 4161422978fcf..2b4523a46f11d 100644 --- a/shell/common/io_manager.cc +++ b/shell/common/io_manager.cc @@ -49,11 +49,6 @@ IOManager::IOManager(sk_sp resource_context, "context. Async texture uploads will be disabled. " "Expect performance degradation."; } - - if (resource_context_weak_factory_) { - resource_context_weak_prototype_ = - resource_context_weak_factory_->GetWeakPtr(); - } } IOManager::~IOManager() { @@ -63,7 +58,9 @@ IOManager::~IOManager() { } fml::WeakPtr IOManager::GetResourceContext() const { - return resource_context_weak_prototype_; + return resource_context_weak_factory_ + ? resource_context_weak_factory_->GetWeakPtr() + : fml::WeakPtr(); } fxl::RefPtr IOManager::GetSkiaUnrefQueue() const { diff --git a/shell/common/io_manager.h b/shell/common/io_manager.h index 1077a28d0ae36..42ea80f10e262 100644 --- a/shell/common/io_manager.h +++ b/shell/common/io_manager.h @@ -35,7 +35,6 @@ class IOManager { private: // Resource context management. sk_sp resource_context_; - fml::WeakPtr resource_context_weak_prototype_; std::unique_ptr> resource_context_weak_factory_; diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index b2bfce051a5bf..53cf7b736686b 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -20,9 +20,7 @@ PlatformView::PlatformView(Delegate& delegate, blink::TaskRunners task_runners) : delegate_(delegate), task_runners_(std::move(task_runners)), size_(SkISize::Make(0, 0)), - weak_factory_(this) { - weak_prototype_ = weak_factory_.GetWeakPtr(); -} + weak_factory_(this) {} PlatformView::~PlatformView() = default; @@ -73,7 +71,7 @@ sk_sp PlatformView::CreateResourceContext() const { } fml::WeakPtr PlatformView::GetWeakPtr() const { - return weak_prototype_; + return weak_factory_.GetWeakPtr(); } void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) {} diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 56179a6114777..3ae91b178c72d 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -120,7 +120,6 @@ class PlatformView { std::unique_ptr vsync_waiter_; SkISize size_; - fml::WeakPtr weak_prototype_; fml::WeakPtrFactory weak_factory_; virtual std::unique_ptr CreateRenderingSurface(); diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 20fc88258024b..e4f6871568791 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -16,14 +16,12 @@ namespace shell { Rasterizer::Rasterizer(blink::TaskRunners task_runners) - : task_runners_(std::move(task_runners)), weak_factory_(this) { - weak_prototype_ = weak_factory_.GetWeakPtr(); -} + : task_runners_(std::move(task_runners)), weak_factory_(this) {} Rasterizer::~Rasterizer() = default; fml::WeakPtr Rasterizer::GetWeakPtr() const { - return weak_prototype_; + return weak_factory_.GetWeakPtr(); } void Rasterizer::Setup(std::unique_ptr surface) { diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index e373b1138c742..79dda4ac9ceeb 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -65,7 +65,6 @@ class Rasterizer final { flow::CompositorContext compositor_context_; std::unique_ptr last_layer_tree_; fxl::Closure next_frame_callback_; - fml::WeakPtr weak_prototype_; fml::WeakPtrFactory weak_factory_; void DoDraw(std::unique_ptr layer_tree); From 8ed932c393db366c155a2be1aa5e33629c2a9037 Mon Sep 17 00:00:00 2001 From: Ravi Mistry Date: Wed, 18 Apr 2018 14:36:58 -0400 Subject: [PATCH 0130/1190] Roll src/third_party/skia/ 1cd6098d5..1ccaa6e05 (20 commits) (#5038) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://skia.googlesource.com/skia.git/+log/1cd6098d52a5..1ccaa6e05629 $ git log 1cd6098d5..1ccaa6e05 --date=short --no-merges --format='%ad %ae %s' 2018-04-18 mtklein skcms→b4e167a stricter TF13 matching 2018-04-18 mtklein skcms→589b15b add skcms_EnsureUsableAsDestination 2018-04-18 angle-skia-autoroll Roll third_party/externals/angle2/ c90d4d38c..5804dc8ea (2 commits) 2018-04-18 herb Simplify strike cache Node 2018-04-18 egdaniel Remove persp_shader gms from DDL blacklist 2018-04-18 angle-skia-autoroll Roll third_party/externals/angle2/ aed1b56aa..c90d4d38c (2 commits) 2018-04-17 bungeman Remove text flag filtering from SkBitmapDevice. 2018-04-17 angle-skia-autoroll Roll third_party/externals/angle2/ 86de76b69..aed1b56aa (5 commits) 2018-04-17 reed show sum of cubic errors 2018-04-17 robertphillips Add handling to ViaDDL for images that are too large to be uploaded in one go 2018-04-17 herb Move node information to SkStrikeCache 2018-04-17 bungeman IWYU for some more test files starting with 'C'. 2018-04-17 reed detect if we made an infinite rect 2018-04-17 borenet [infra] Support recursive configs in builder_name_schema 2018-04-16 egdaniel No long require copy as draw for vulkan wrapped resources. 2018-04-17 caryclark path is rect diag test is required 2018-04-17 mtklein SkStrikeDifferences::operator() -> add() 2018-04-17 reed avoid overflow by using tmp 64bits 2018-04-17 brianosman Move external texture extension logic into SkSL 2018-04-17 benjaminwagner [infra] Add service account override in gen_tasks.go. Created with: roll-dep src/third_party/skia --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index cc9c44f24ac57..23a8e666da519 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1cd6098d52a531451f194437861cd7a548f825a7', + 'skia_revision': '1ccaa6e056296db61eb1af2668a23995fe98e6b3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3483b628c2cf2..28182ad61cfcc 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 41215836c65ba6b747e9e86edafa51cb +Signature: 4b8007d0bcd3ca7de71293354c6ebc9b UNUSED LICENSES: @@ -17619,7 +17619,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Perf-Ubuntu14-GCC-GCE-CPU-AVX2-x86_64-Release-All-CT_BENCH_1k_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Upload-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-Coverage-All.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Upload-Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/win_test.json FILE: ../../../third_party/skia/infra/bots/recipes/android_compile.expected/android_compile_nontrybot.json FILE: ../../../third_party/skia/infra/bots/recipes/android_compile.expected/android_compile_trybot.json From 572c5844aa9d952fdad3dfe5635e9e401331183a Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 18 Apr 2018 12:12:39 -0700 Subject: [PATCH 0131/1190] Configure kernel paths in the embedder if the asset directory contains the kernel assets (#5039) "flutter build bundle" in Dart 2 mode now builds an assets directory containing the application and platform kernels along with the app's other assets. With this patch, embedders can run these bundles by setting FlutterProjectArgs.assets_path to the bundle directory. In this scenario, FlutterProjectArgs.main_path and packages_path will be ignored. --- shell/platform/embedder/embedder.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index a7ee807934663..8a68aacfaf4b6 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -20,12 +20,14 @@ #include "flutter/common/task_runners.h" #include "flutter/fml/file.h" #include "flutter/fml/message_loop.h" +#include "flutter/fml/paths.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/switches.h" #include "flutter/shell/platform/embedder/embedder.h" #include "flutter/shell/platform/embedder/embedder_engine.h" #include "flutter/shell/platform/embedder/platform_view_embedder.h" #include "lib/fxl/command_line.h" +#include "lib/fxl/files/file.h" #include "lib/fxl/functional/make_copyable.h" #define SAFE_ACCESS(pointer, member, default_value) \ @@ -144,9 +146,25 @@ FlutterResult FlutterEngineRun(size_t version, blink::Settings settings = shell::SettingsFromCommandLine(command_line); settings.icu_data_path = icu_data_path; - settings.main_dart_file_path = args->main_path; - settings.packages_file_path = args->packages_path; settings.assets_path = args->assets_path; + + // Check whether the assets path contains Dart 2 kernel assets. + const std::string kApplicationKernelSnapshotFileName = "kernel_blob.bin"; + std::string platform_kernel_path = + fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); + std::string application_kernel_path = fml::paths::JoinPaths( + {settings.assets_path, kApplicationKernelSnapshotFileName}); + if (files::IsFile(platform_kernel_path) && + files::IsFile(application_kernel_path)) { + // Run from a kernel snapshot. + settings.application_kernel_asset = kApplicationKernelSnapshotFileName; + settings.kernel_snapshot_path = platform_kernel_path; + } else { + // Run from a main Dart file. + settings.main_dart_file_path = args->main_path; + settings.packages_file_path = args->packages_path; + } + settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); }; From 8973c733a5e39a9fb89277f43586e8aab4e68632 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 18 Apr 2018 12:42:16 -0700 Subject: [PATCH 0132/1190] Implement Scene::toImage for creating a raster image representation of a scene. (#5021) --- flow/layers/layer_tree.cc | 44 +++++++++++- flow/layers/layer_tree.h | 3 + lib/ui/compositing.dart | 13 ++++ lib/ui/compositing/scene.cc | 136 +++++++++++++++++++++++++++++++++++- lib/ui/compositing/scene.h | 4 ++ 5 files changed, 196 insertions(+), 4 deletions(-) diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index d9fb374194688..67ec443dbd9bb 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -6,6 +6,7 @@ #include "flutter/flow/layers/layer.h" #include "flutter/glue/trace_event.h" +#include "third_party/skia/include/core/SkPictureRecorder.h" namespace flow { @@ -60,6 +61,7 @@ void LayerTree::UpdateScene(SceneUpdateContext& context, #endif void LayerTree::Paint(CompositorContext::ScopedFrame& frame) const { + TRACE_EVENT0("flutter", "LayerTree::Paint"); Layer::PaintContext context = { *frame.canvas(), // frame.context().frame_time(), // @@ -67,10 +69,50 @@ void LayerTree::Paint(CompositorContext::ScopedFrame& frame) const { frame.context().texture_registry(), // checkerboard_offscreen_layers_ // }; - TRACE_EVENT0("flutter", "LayerTree::Paint"); if (root_layer_->needs_painting()) root_layer_->Paint(context); } +sk_sp LayerTree::Flatten(const SkRect& bounds) { + TRACE_EVENT0("flutter", "LayerTree::Flatten"); + + SkPictureRecorder recorder; + auto canvas = recorder.beginRecording(bounds); + + if (!canvas) { + return nullptr; + } + + Layer::PrerollContext preroll_context{ + nullptr, // raster_cache (don't consult the cache) + nullptr, // gr_context (used for the raster cache) + nullptr, // SkColorSpace* dst_color_space + SkRect::MakeEmpty(), // SkRect child_paint_bounds + }; + + const Stopwatch unused_stopwatch; + TextureRegistry unused_texture_registry; + + Layer::PaintContext paint_context = { + *canvas, // canvas + unused_stopwatch, // frame time (dont care) + unused_stopwatch, // engine time (dont care) + unused_texture_registry, // texture registry (not supported) + false // checkerboard offscreen layers + }; + + // Even if we don't have a root layer, we still need to create an empty + // picture. + if (root_layer_) { + root_layer_->Preroll(&preroll_context, SkMatrix::I()); + // The needs painting flag may be set after the preroll. So check it after. + if (root_layer_->needs_painting()) { + root_layer_->Paint(paint_context); + } + } + + return recorder.finishRecordingAsPicture(); +} + } // namespace flow diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 25a8e072cfa21..548c99f0ce6b5 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -13,6 +13,7 @@ #include "flutter/flow/layers/layer.h" #include "lib/fxl/macros.h" #include "lib/fxl/time/time_delta.h" +#include "third_party/skia/include/core/SkPicture.h" #include "third_party/skia/include/core/SkSize.h" namespace flow { @@ -33,6 +34,8 @@ class LayerTree { void Paint(CompositorContext::ScopedFrame& frame) const; + sk_sp Flatten(const SkRect& bounds); + Layer* root_layer() const { return root_layer_.get(); } void set_root_layer(std::unique_ptr root_layer) { diff --git a/lib/ui/compositing.dart b/lib/ui/compositing.dart index 97e6c59e53d16..e0be1a66fdaf8 100644 --- a/lib/ui/compositing.dart +++ b/lib/ui/compositing.dart @@ -17,6 +17,19 @@ class Scene extends NativeFieldWrapperClass2 { /// To create a Scene object, use a [SceneBuilder]. Scene._(); + + /// Creates a raster image representation of the current state of the scene. + /// This is a slow operation that is performed on a background thread. + Future toImage(int width, int height) { + if (width <= 0 || height <= 0) + throw new Exception('Invalid image dimensions.'); + return _futurize( + (_Callback callback) => _toImage(width, height, callback) + ); + } + + String _toImage(int width, int height, _Callback callback) native 'Scene_toImage'; + /// Releases the resources used by this scene. /// /// After calling this function, the scene is cannot be used further. diff --git a/lib/ui/compositing/scene.cc b/lib/ui/compositing/scene.cc index 513d89f102e03..37514350b412f 100644 --- a/lib/ui/compositing/scene.cc +++ b/lib/ui/compositing/scene.cc @@ -4,18 +4,26 @@ #include "flutter/lib/ui/compositing/scene.h" +#include "flutter/fml/trace_event.h" +#include "flutter/lib/ui/painting/image.h" +#include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/converter/dart_converter.h" #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" -#include "third_party/skia/include/core/SkCanvas.h" -#include "third_party/skia/include/core/SkPictureRecorder.h" +#include "lib/tonic/dart_persistent_value.h" +#include "lib/tonic/dart_wrappable.h" +#include "lib/tonic/logging/dart_invoke.h" +#include "third_party/skia/include/core/SkImageInfo.h" +#include "third_party/skia/include/core/SkSurface.h" namespace blink { IMPLEMENT_WRAPPERTYPEINFO(ui, Scene); -#define FOR_EACH_BINDING(V) V(Scene, dispose) +#define FOR_EACH_BINDING(V) \ + V(Scene, toImage) \ + V(Scene, dispose) DART_BIND_ALL(Scene, FOR_EACH_BINDING) @@ -46,6 +54,128 @@ void Scene::dispose() { ClearDartWrapper(); } +static sk_sp CreateSceneSnapshot(GrContext* context, + sk_sp picture, + const SkSize& size) { + TRACE_EVENT0("flutter", "CreateSceneSnapshot"); + auto image_info = + SkImageInfo::MakeN32Premul(SkISize::Make(size.width(), size.height())); + + sk_sp surface; + + if (context) { + surface = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, image_info); + } + + if (!surface) { + surface = SkSurface::MakeRaster(image_info); + } + + if (!surface) { + return nullptr; + } + + auto canvas = surface->getCanvas(); + + if (!canvas) { + return nullptr; + } + + if (picture) { + canvas->drawPicture(picture.get()); + } + + auto snapshot = surface->makeImageSnapshot(); + + if (!snapshot) { + return nullptr; + } + + return snapshot->makeRasterImage(); +} + +Dart_Handle Scene::toImage(uint32_t width, + uint32_t height, + Dart_Handle raw_image_callback) { + TRACE_EVENT0("flutter", "Scene::toImage"); + if (Dart_IsNull(raw_image_callback) || !Dart_IsClosure(raw_image_callback)) { + return tonic::ToDart("Image callback was invalid"); + } + + if (!m_layerTree) { + return tonic::ToDart("Scene did not contain a layer tree."); + } + + if (width == 0 || height == 0) { + return tonic::ToDart("Image dimensions for scene were invalid."); + } + + auto dart_state = UIDartState::Current(); + + auto image_callback = std::make_unique( + dart_state, raw_image_callback); + + // We can't create an image on this task runner because we don't have a + // graphics context. Even if we did, it would be slow anyway. Also, this + // thread owns the sole reference to the layer tree. So we flatten the layer + // tree into a picture and use that as the thread transport mechanism. + + auto bounds_size = SkSize::Make(width, height); + auto picture = m_layerTree->Flatten(SkRect::MakeSize(bounds_size)); + if (!picture) { + // Already in Dart scope. + return tonic::ToDart("Could not flatten scene into a layer tree."); + } + + auto resource_context = dart_state->GetResourceContext(); + auto ui_task_runner = dart_state->GetTaskRunners().GetUITaskRunner(); + auto unref_queue = dart_state->GetSkiaUnrefQueue(); + + // The picture has been prepared on the UI thread. + dart_state->GetTaskRunners().GetIOTaskRunner()->PostTask( + fxl::MakeCopyable([picture = std::move(picture), // + bounds_size, // + resource_context = std::move(resource_context), // + ui_task_runner = std::move(ui_task_runner), // + image_callback = std::move(image_callback), // + unref_queue = std::move(unref_queue) // + ]() mutable { + // Snapshot the picture on the IO thread that contains an optional + // GrContext. + auto image = CreateSceneSnapshot(resource_context.get(), + std::move(picture), bounds_size); + + // Send the image back to the UI thread for submission back to the + // framework. + ui_task_runner->PostTask( + fxl::MakeCopyable([image = std::move(image), // + image_callback = std::move(image_callback), // + unref_queue = std::move(unref_queue) // + ]() mutable { + auto dart_state = image_callback->dart_state().get(); + if (!dart_state) { + // The root isolate could have died in the meantime. + return; + } + tonic::DartState::Scope scope(dart_state); + + if (!image) { + tonic::DartInvoke(image_callback->Get(), {Dart_Null()}); + return; + } + + auto dart_image = CanvasImage::Create(); + dart_image->set_image({std::move(image), std::move(unref_queue)}); + auto raw_dart_image = tonic::ToDart(std::move(dart_image)); + + // All done! + tonic::DartInvoke(image_callback->Get(), {raw_dart_image}); + })); + })); + + return Dart_Null(); +} + std::unique_ptr Scene::takeLayerTree() { return std::move(m_layerTree); } diff --git a/lib/ui/compositing/scene.h b/lib/ui/compositing/scene.h index 926fd9d83babd..92f4b5ae154f7 100644 --- a/lib/ui/compositing/scene.h +++ b/lib/ui/compositing/scene.h @@ -32,6 +32,10 @@ class Scene : public fxl::RefCountedThreadSafe, std::unique_ptr takeLayerTree(); + Dart_Handle toImage(uint32_t width, + uint32_t height, + Dart_Handle image_callback); + void dispose(); static void RegisterNatives(tonic::DartLibraryNatives* natives); From d4729abaf7c214d8b3378f7e2f71b0d4a6d69af1 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 18 Apr 2018 12:50:22 -0700 Subject: [PATCH 0133/1190] Update the embedder GN target to use a source set instead of a complete static library. (#5040) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creating a dylib from a “complete” static library does not propagate symbol visisbility definitions. I also got rid of the static library and used a source set instead because we don’t need to do the extra work for other targets. --- shell/platform/embedder/BUILD.gn | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index b1e0b3e4f3b71..1405cc119beee 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -4,9 +4,7 @@ import("$flutter_root/testing/testing.gni") -static_library("embedder") { - complete_static_lib = true - +source_set("embedder") { sources = [ "embedder.cc", "embedder.h", From 7a6b77999feab73c03a0c65a3371beaeb750cced Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 18 Apr 2018 13:02:19 -0700 Subject: [PATCH 0134/1190] Remove the weak pointer factory from the service isolate's DartIsolate object (#5041) The WeakPtrFactory must be deleted on the thread where it was created. However, the service isolate is created and destroyed on threads from the Dart thread pool, and the creating thread may not be the same as the destroying thread. --- lib/ui/ui_dart_state.cc | 3 +-- lib/ui/ui_dart_state.h | 1 - runtime/dart_isolate.cc | 52 ++++++++++++++++++++++++++--------------- runtime/dart_isolate.h | 12 +++++++++- 4 files changed, 45 insertions(+), 23 deletions(-) diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 8ef7ca98fd758..4f3de1b22f35a 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -28,8 +28,7 @@ UIDartState::UIDartState(TaskRunners task_runners, advisory_script_uri_(std::move(advisory_script_uri)), advisory_script_entrypoint_(std::move(advisory_script_entrypoint)), logger_prefix_(std::move(logger_prefix)), - skia_unref_queue_(std::move(skia_unref_queue)), - weak_factory_(this) { + skia_unref_queue_(std::move(skia_unref_queue)) { AddOrRemoveTaskObserver(true /* add */); } diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index a5c78c1671815..988b680befc9a 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -100,7 +100,6 @@ class UIDartState : public tonic::DartState { RefPtr font_selector_; fxl::RefPtr skia_unref_queue_; tonic::DartMicrotaskQueue microtask_queue_; - fml::WeakPtrFactory weak_factory_; void AddOrRemoveTaskObserver(bool add); diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 59093da140632..a02693c06a9b8 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -105,7 +105,7 @@ DartIsolate::DartIsolate(const DartVM* vm, vm->GetSettings().log_tag), vm_(vm), isolate_snapshot_(std::move(isolate_snapshot)), - weak_factory_(this) { + weak_factory_(std::make_unique>(this)) { FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; if (vm_ == nullptr) { @@ -464,7 +464,7 @@ bool DartIsolate::Shutdown() { return true; } -static Dart_Isolate DartCreateAndStartServiceIsolate( +Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( const char* advisory_script_uri, const char* advisory_script_entrypoint, const char* package_root, @@ -493,21 +493,23 @@ static Dart_Isolate DartCreateAndStartServiceIsolate( flags->load_vmservice_library = true; - auto service_isolate = DartIsolate::CreateRootIsolate( - vm.get(), // vm - vm->GetIsolateSnapshot(), // isolate snapshot - null_task_runners, // task runners - nullptr, // window - {}, // resource context - {}, // unref queue - advisory_script_uri == nullptr ? "" : advisory_script_uri, // script uri - advisory_script_entrypoint == nullptr - ? "" - : advisory_script_entrypoint, // script entrypoint - flags // flags - ); - - if (!service_isolate) { + fml::WeakPtr weak_service_isolate = + DartIsolate::CreateRootIsolate( + vm.get(), // vm + vm->GetIsolateSnapshot(), // isolate snapshot + null_task_runners, // task runners + nullptr, // window + {}, // resource context + {}, // unref queue + advisory_script_uri == nullptr ? "" + : advisory_script_uri, // script uri + advisory_script_entrypoint == nullptr + ? "" + : advisory_script_entrypoint, // script entrypoint + flags // flags + ); + + if (!weak_service_isolate) { *error = strdup("Could not create the service isolate."); FXL_DLOG(ERROR) << *error; return nullptr; @@ -516,11 +518,17 @@ static Dart_Isolate DartCreateAndStartServiceIsolate( // The engine never holds a strong reference to the VM service isolate. Since // we are about to lose our last weak reference to it, start the VM service // while we have this reference. + DartIsolate* service_isolate = weak_service_isolate.get(); + + // The service isolate is created and destroyed on arbitrary Dart pool threads + // and can not support a weak pointer factory that must be bound to a specific + // thread. + service_isolate->ResetWeakPtrFactory(); const bool running_from_sources = !DartVM::IsRunningPrecompiledCode() && vm->GetPlatformKernel() == nullptr; - tonic::DartState::Scope scope(service_isolate.get()); + tonic::DartState::Scope scope(service_isolate); if (!DartServiceIsolate::Startup( settings.ipv6 ? "::1" : "127.0.0.1", // server IP address settings.observatory_port, // server observatory port @@ -678,7 +686,13 @@ fxl::RefPtr DartIsolate::GetIsolateSnapshot() const { } fml::WeakPtr DartIsolate::GetWeakIsolatePtr() const { - return weak_factory_.GetWeakPtr(); + return weak_factory_ ? weak_factory_->GetWeakPtr() + : fml::WeakPtr(); +} + +void DartIsolate::ResetWeakPtrFactory() { + FXL_CHECK(weak_factory_); + weak_factory_.reset(); } void DartIsolate::AddIsolateShutdownCallback(fxl::Closure closure) { diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index dd402b157c2ab..b78324825f8a3 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -103,7 +103,7 @@ class DartIsolate : public UIDartState { Phase phase_ = Phase::Unknown; const fxl::RefPtr isolate_snapshot_; std::vector> shutdown_callbacks_; - fml::WeakPtrFactory weak_factory_; + std::unique_ptr> weak_factory_; FXL_WARN_UNUSED_RESULT bool Initialize(Dart_Isolate isolate, bool is_root_isolate); @@ -116,6 +116,8 @@ class DartIsolate : public UIDartState { FXL_WARN_UNUSED_RESULT bool MarkIsolateRunnable(); + void ResetWeakPtrFactory(); + // |Dart_IsolateCreateCallback| static Dart_Isolate DartIsolateCreateCallback( const char* advisory_script_uri, @@ -126,6 +128,14 @@ class DartIsolate : public UIDartState { DartIsolate* embedder_isolate, char** error); + static Dart_Isolate DartCreateAndStartServiceIsolate( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + char** error); + static std::pair /* embedder */> CreateDartVMAndEmbedderObjectPair(const char* advisory_script_uri, From 59d1366c91a402e4768385cce5b252736efd46a4 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 18 Apr 2018 16:28:24 -0700 Subject: [PATCH 0135/1190] =?UTF-8?q?Don=E2=80=99t=20build=20the=20host=20?= =?UTF-8?q?shell=20on=20target=20builds.=20(#5042)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BUILD.gn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn index b37b0b8d4054c..6560972bc58a5 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -10,10 +10,13 @@ group("flutter") { public_deps = [ "$flutter_root/lib/snapshot:generate_snapshot_bin", "$flutter_root/lib/snapshot:kernel_platform_files", - "$flutter_root/shell/testing", "$flutter_root/sky", ] + if (current_toolchain == host_toolchain) { + public_deps += [ "$flutter_root/shell/testing" ] + } + if (flutter_runtime_mode != "debug") { public_deps += [ "$flutter_root/lib/snapshot:entry_points_json_files" ] } From 22e138126f94ff20d5815c077e9845956afbfc64 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 18 Apr 2018 17:55:39 -0700 Subject: [PATCH 0136/1190] Allow runtime unit-test to perform dynamic symbol resolution for Dart snapshots. (#5044) --- runtime/BUILD.gn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 455d7e228168f..c607bfd1fae26 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -142,4 +142,8 @@ executable("runtime_unittests") { "//third_party/skia", "//topaz/lib/tonic", ] + + if (is_linux) { + ldflags = [ "-rdynamic" ] + } } From 388f019961c1545b5f919ab9e4a826fa96dadc5f Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 18 Apr 2018 21:00:00 -0400 Subject: [PATCH 0137/1190] Enable downscale of very large images when uploading on IO thread (#5011) --- lib/ui/painting/codec.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 758a722b409e2..c75ec5fef3074 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -63,7 +63,7 @@ static sk_sp DecodeImage(fml::WeakPtr context, // This indicates that we do not want a "linear blending" decode. sk_sp dstColorSpace = nullptr; return SkImage::MakeCrossContextFromEncoded( - context.get(), std::move(buffer), false, dstColorSpace.get()); + context.get(), std::move(buffer), false, dstColorSpace.get(), true); } else { // Defer decoding until time of draw later on the GPU thread. Can happen // when GL operations are currently forbidden such as in the background From b6ba69bae74093da0a40314dd46ce8682fdd6708 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 18 Apr 2018 18:04:52 -0700 Subject: [PATCH 0138/1190] libtxt: add boxes representing empty lines in GetRectsForRange (#5043) If the start/end range passed to GetRectsForRange includes lines of text that did not render any glyphs, then GetRectsForRange should add a placeholder for that line. In particular, the framework expects this so that it can position the cursor on an empty line when editing text. Fixes https://github.com/flutter/flutter/issues/16418 --- third_party/txt/src/txt/paragraph.cc | 47 ++++++++++++++++++++++------ third_party/txt/src/txt/paragraph.h | 8 +++-- 2 files changed, 43 insertions(+), 12 deletions(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index 515013d6e11f1..bab3028145dee 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -249,7 +249,7 @@ bool Paragraph::ComputeLineBreaks() { size_t block_size = block_end - block_start; if (block_size == 0) { - line_ranges_.emplace_back(block_start, block_start, true); + line_ranges_.emplace_back(block_start, block_end, block_end + 1, true); line_widths_.push_back(0); continue; } @@ -297,8 +297,13 @@ bool Paragraph::ComputeLineBreaks() { const int* breaks = breaker_.getBreaks(); for (size_t i = 0; i < breaks_count; ++i) { size_t break_start = (i > 0) ? breaks[i - 1] : 0; - line_ranges_.emplace_back(break_start + block_start, - breaks[i] + block_start, i == breaks_count - 1); + size_t line_start = break_start + block_start; + size_t line_end = breaks[i] + block_start; + bool hard_break = i == breaks_count - 1; + size_t line_end_including_newline = + (hard_break && line_end < text_.size()) ? line_end + 1 : line_end; + line_ranges_.emplace_back(line_start, line_end, + line_end_including_newline, hard_break); line_widths_.push_back(breaker_.getWidths()[i]); } @@ -437,9 +442,9 @@ void Paragraph::Layout(double width, bool force) { std::vector> words; double word_gap_width = 0; size_t word_index = 0; - bool justify_line = (paragraph_style_.text_align == TextAlign::justify && - line_number != line_limit - 1 && - !line_ranges_[line_number].hard_break); + bool justify_line = + (paragraph_style_.text_align == TextAlign::justify && + line_number != line_limit - 1 && !line_range.hard_break); FindWords(text_, line_range.start, line_range.end, &words); if (justify_line) { if (words.size() > 1) { @@ -986,7 +991,7 @@ void Paragraph::PaintDecorations(SkCanvas* canvas, const PaintRecord& record) { std::vector Paragraph::GetRectsForRange(size_t start, size_t end) const { - std::vector boxes; + std::map> line_boxes; for (const CodeUnitRun& run : code_unit_runs_) { if (run.code_units.start >= end) @@ -1014,10 +1019,34 @@ std::vector Paragraph::GetRectsForRange(size_t start, if (left == SK_ScalarMax || right == SK_ScalarMin) continue; } - boxes.emplace_back(SkRect::MakeLTRB(left, top, right, bottom), - run.direction); + line_boxes[run.line_number].emplace_back( + SkRect::MakeLTRB(left, top, right, bottom), run.direction); } + // Add empty rectangles representing any line within the range that did not + // render any glyphs. + for (size_t line_number = 0; line_number < line_ranges_.size(); ++line_number) { + const LineRange& line = line_ranges_[line_number]; + if (line.start >= end) + break; + if (line.end_including_newline <= start) + continue; + if (line_boxes.find(line_number) == line_boxes.end()) { + // If the range starts after the beginning of this line, then place the + // rectangle at the end of the line's width. This is intended to + // handle ranges encompassing the newline character at the end of a line. + SkScalar x = (start > line.start) ? line_widths_[line_number] : 0; + SkScalar top = (line_number > 0) ? line_heights_[line_number - 1] : 0; + SkScalar bottom = line_heights_[line_number]; + line_boxes[line_number].emplace_back( + SkRect::MakeLTRB(x, top, x, bottom), TextDirection::ltr); + } + } + + std::vector boxes; + for (const auto& kv : line_boxes) { + boxes.insert(boxes.end(), kv.second.begin(), kv.second.end()); + } return boxes; } diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index 4a40f89b387ae..3a3d9aa4883c1 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -63,8 +63,8 @@ class Paragraph { }; struct TextBox { - const SkRect rect; - const TextDirection direction; + SkRect rect; + TextDirection direction; TextBox(SkRect r, TextDirection d) : rect(r), direction(d) {} }; @@ -187,8 +187,10 @@ class Paragraph { mutable std::unique_ptr word_breaker_; struct LineRange { - LineRange(size_t s, size_t e, bool h) : start(s), end(e), hard_break(h) {} + LineRange(size_t s, size_t e, size_t ewn, bool h) + : start(s), end(e), end_including_newline(ewn), hard_break(h) {} size_t start, end; + size_t end_including_newline; bool hard_break; }; std::vector line_ranges_; From 3cc8d82895eaaddc52df166ceb0e5d7c3cc40588 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 18 Apr 2018 18:15:50 -0700 Subject: [PATCH 0139/1190] Fix more Linux unittest targets. (#5045) --- shell/common/BUILD.gn | 3 +++ shell/platform/embedder/BUILD.gn | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 25edcfa23bd85..49227bdfdc29d 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -134,4 +134,7 @@ executable("shell_unittests") { "//third_party/skia", "//topaz/lib/tonic", ] + if (is_linux) { + ldflags = [ "-rdynamic" ] + } } diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 1405cc119beee..5e04cfcd47abf 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -50,6 +50,10 @@ executable("embedder_unittests") { ":fixtures", "$flutter_root/testing", ] + + if (is_linux) { + ldflags = [ "-rdynamic" ] + } } shared_library("flutter_engine") { From 8e6c24f4040e69875f99119e5b09996620847f10 Mon Sep 17 00:00:00 2001 From: Ravi Mistry Date: Thu, 19 Apr 2018 13:03:35 -0400 Subject: [PATCH 0140/1190] Roll src/third_party/skia/ 1ccaa6e05..c4e384e5a (28 commits) (#5047) https://skia.googlesource.com/skia.git/+log/1ccaa6e05629..c4e384e5ad85 $ git log 1ccaa6e05..c4e384e5a --date=short --no-merges --format='%ad %ae %s' 2018-04-19 reed check if we fail to eval the conic in pathmeasure 2018-04-19 bungeman Remove unused parameters from internalGetPath. 2018-04-19 egdaniel When creating testing backendTexture take colorspace into account. 2018-04-19 kjlubick Fix Chromecast bots 2018-04-19 borenet [infra] gen_tasks: Pass internal hardware ID as a property 2018-04-18 herb Untangle strike cache and glyph cache 2018-04-19 mtklein disallow negative setReserve() calls 2018-04-19 mtklein rm SkTDArray::select() 2018-04-19 mtklein clean up setReserve() rule-bending 2018-04-18 scroggo Remove the limit on dng allocations 2018-04-19 scroggo Revert "Add stub gpu workaround generators" 2018-04-19 caryclark path is rect track corners 2018-04-17 borenet Reland "[infra] Run recipes through Kitchen" 2018-04-19 angle-skia-autoroll Roll third_party/externals/angle2/ aaa19de06..eeec3b14c (1 commit) 2018-04-18 angle-skia-autoroll Roll third_party/externals/angle2/ 5804dc8ea..aaa19de06 (9 commits) 2018-04-18 enne Add stub gpu workaround generators 2018-04-18 herb Move strike cache Find*() to strike cache 2018-04-18 liyuqian Remove SK_SUPPORT_LEGACY_PATH_DAA_BIT 2018-04-18 fmalita Prevent unnecessary/unbounded growth of SkTDynamicHash capacity 2018-04-18 bungeman DFT to draw A8 instead of incorrect vertical lcd. 2018-04-18 csmartdalton ccpr: Implement conics 2018-04-18 csmartdalton Always call endFlush on opLists that might survive a flush 2018-04-18 fmalita Convert A8 D32 mask blitters to Sk4px 2018-04-18 liyuqian Reland "Fix the fat rect bug in the threaded backend" 2018-04-18 halcanary SkQP: speed up tools/skqp/make_apk_list\ 2018-04-18 brianosman Support all destination profiles in SkColorSpaceXform_skcms 2018-04-17 brianosman With ES3, enable both ES2 and ES3 external image extensions 2018-04-18 caryclark fix path is rect flaw exposed by gold Created with: roll-dep src/third_party/skia --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 39 ++++----------------- 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/DEPS b/DEPS index 23a8e666da519..afb64d7d5be04 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1ccaa6e056296db61eb1af2668a23995fe98e6b3', + 'skia_revision': 'c4e384e5ad85250920cac6e8ee0e2a14b69d67e0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 28182ad61cfcc..b2cdd128882c2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4b8007d0bcd3ca7de71293354c6ebc9b +Signature: a3b93d6693661a99bccda168147b2ae6 UNUSED LICENSES: @@ -17196,8 +17196,9 @@ Exhibit B - “Incompatible With Secondary Licenses” Notice ==================================================================================================== LIBRARY: skcms LIBRARY: skia -ORIGIN: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp @@ -17280,6 +17281,8 @@ FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.h FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h @@ -17467,34 +17470,18 @@ FILE: ../../../third_party/skia/infra/bots/assets/win_ninja/VERSION FILE: ../../../third_party/skia/infra/bots/assets/win_toolchain/VERSION FILE: ../../../third_party/skia/infra/bots/assets/win_toolchain_2015/VERSION FILE: ../../../third_party/skia/infra/bots/assets/win_vulkan_sdk/VERSION -FILE: ../../../third_party/skia/infra/bots/bundle_recipes.isolate FILE: ../../../third_party/skia/infra/bots/calmbench.isolate FILE: ../../../third_party/skia/infra/bots/cfg.json -FILE: ../../../third_party/skia/infra/bots/compile_skia.isolate -FILE: ../../../third_party/skia/infra/bots/coverage_skia.isolate FILE: ../../../third_party/skia/infra/bots/ct/blacklists/get_images_from_skps_100k_c37e844a6f8708-eee762104c75bd.json FILE: ../../../third_party/skia/infra/bots/ct/blacklists/get_images_from_skps_100k_fad657e-276e633.json -FILE: ../../../third_party/skia/infra/bots/ct_skps_skia.isolate -FILE: ../../../third_party/skia/infra/bots/housekeeper_skia.isolate -FILE: ../../../third_party/skia/infra/bots/infra_skia.isolate +FILE: ../../../third_party/skia/infra/bots/empty.isolate FILE: ../../../third_party/skia/infra/bots/infrabots.isolate FILE: ../../../third_party/skia/infra/bots/ios_bin.isolate FILE: ../../../third_party/skia/infra/bots/isolate_android_sdk_linux.isolate FILE: ../../../third_party/skia/infra/bots/isolate_gcloud_linux.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_go_linux.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_ndk_linux.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_skimage.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_skp.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_svg.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_win_toolchain.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_win_vulkan_sdk.isolate +FILE: ../../../third_party/skia/infra/bots/isolate_go.isolate FILE: ../../../third_party/skia/infra/bots/jobs.json -FILE: ../../../third_party/skia/infra/bots/meta_config.isolate -FILE: ../../../third_party/skia/infra/bots/perf_skia.isolate FILE: ../../../third_party/skia/infra/bots/perf_skia_bundled.isolate -FILE: ../../../third_party/skia/infra/bots/perf_skia_bundled_unix.isolate -FILE: ../../../third_party/skia/infra/bots/perf_skia_bundled_win.isolate -FILE: ../../../third_party/skia/infra/bots/presubmit_skia.isolate FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json @@ -17630,7 +17617,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_fa FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_failed_upload.json FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/percommit_bookmaker.json FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/percommit_failed_validation.json -FILE: ../../../third_party/skia/infra/bots/recipes/bundle_recipes.expected/BundleRecipes.json FILE: ../../../third_party/skia/infra/bots/recipes/calmbench.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/calmbench.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/check_generated_files.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json @@ -17820,24 +17806,13 @@ FILE: ../../../third_party/skia/infra/bots/recipes/upload_skiaserve.expected/nor FILE: ../../../third_party/skia/infra/bots/recipes/upload_skiaserve.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/resources.isolate FILE: ../../../third_party/skia/infra/bots/skia_repo.isolate -FILE: ../../../third_party/skia/infra/bots/skpbench_skia.isolate FILE: ../../../third_party/skia/infra/bots/skpbench_skia_bundled.isolate -FILE: ../../../third_party/skia/infra/bots/skpbench_skia_bundled_unix.isolate -FILE: ../../../third_party/skia/infra/bots/skpbench_skia_bundled_win.isolate FILE: ../../../third_party/skia/infra/bots/swarm_recipe.isolate -FILE: ../../../third_party/skia/infra/bots/swarm_recipe_bundled_unix.isolate -FILE: ../../../third_party/skia/infra/bots/swarm_recipe_bundled_win.isolate FILE: ../../../third_party/skia/infra/bots/tasks.json -FILE: ../../../third_party/skia/infra/bots/test_skia.isolate FILE: ../../../third_party/skia/infra/bots/test_skia_bundled.isolate -FILE: ../../../third_party/skia/infra/bots/test_skia_bundled_unix.isolate -FILE: ../../../third_party/skia/infra/bots/test_skia_bundled_win.isolate FILE: ../../../third_party/skia/infra/bots/tools/luci-go/linux64/isolate.sha1 FILE: ../../../third_party/skia/infra/bots/tools/luci-go/mac64/isolate.sha1 FILE: ../../../third_party/skia/infra/bots/tools/luci-go/win64/isolate.exe.sha1 -FILE: ../../../third_party/skia/infra/bots/upload_coverage_results.isolate -FILE: ../../../third_party/skia/infra/bots/upload_dm_results.isolate -FILE: ../../../third_party/skia/infra/bots/upload_nano_results.isolate FILE: ../../../third_party/skia/infra/branch-config/cq.cfg FILE: ../../../third_party/skia/infra/config/recipes.cfg FILE: ../../../third_party/skia/infra/cts/whitelist_devices.json From 3405e23a32af4ea3655e5d1a78955066b2573331 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 19 Apr 2018 11:14:47 -0700 Subject: [PATCH 0141/1190] AccessibilityBridge support for edge triggered semantics (iOS + Android) (#4901) AccessibilityBridge support for edge triggered semantics (iOS + Android) --- lib/ui/semantics.dart | 46 ++++++++++ lib/ui/semantics/semantics_node.h | 3 + .../io/flutter/view/AccessibilityBridge.java | 84 +++++++++++++++++-- .../framework/Source/accessibility_bridge.h | 2 + .../framework/Source/accessibility_bridge.mm | 65 +++++++++++++- 5 files changed, 191 insertions(+), 9 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 719daf51139ae..f7426238cc088 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -225,6 +225,8 @@ class SemanticsFlag { static const int _kIsInMutuallyExclusiveGroupIndex = 1 << 8; static const int _kIsHeaderIndex = 1 << 9; static const int _kIsObscuredIndex = 1 << 10; + static const int _kScopesRouteIndex= 1 << 11; + static const int _kNamesRouteIndex = 1 << 12; const SemanticsFlag._(this.index); @@ -307,6 +309,44 @@ class SemanticsFlag { /// is a password or contains other sensitive information. static const SemanticsFlag isObscured = const SemanticsFlag._(_kIsObscuredIndex); + /// Whether the semantics node is the root of a subtree for which a route name + /// should be announced. + /// + /// When a node with this flag is removed from the semantics tree, the + /// framework will select the last in depth-first, paint order node with this + /// flag. When a node with this flag is added to the semantics tree, it is + /// selected automatically, unless there were multiple nodes with this flag + /// added. In this case, the last added node in depth-first, paint order + /// will be selected. + /// + /// From this selected node, the framework will search in depth-first, paint + /// order for the first node with a [namesRoute] flag and a non-null, + /// non-empty label. The [namesRoute] and [scopesRoute] flags may be on the + /// same node. The label of the found node will be announced as an edge + /// transition. If no non-empty, non-null label is found then: + /// + /// * VoiceOver will make a chime announcement. + /// * TalkBack will make no announcement + /// + /// Semantic nodes annotated with this flag are generally not a11y focusable. + /// + /// This is used in widgets such as Routes, Drawers, and Dialogs to + /// communicate significant changes in the visible screen. + static const SemanticsFlag scopesRoute = const SemanticsFlag._(_kScopesRouteIndex); + + /// Whether the semantics node label is the name of a visually distinct + /// route. + /// + /// This is used by certain widgets like Drawers and Dialogs, to indicate + /// that the node's semantic label can be used to announce an edge triggered + /// semantics update. + /// + /// Semantic nodes annotated with this flag will still recieve a11y focus. + /// + /// Updating this label within the same active route subtree will not cause + /// additional announcements. + static const SemanticsFlag namesRoute = const SemanticsFlag._(_kNamesRouteIndex); + /// The possible semantics flags. /// /// The map's key is the [index] of the flag and the value is the flag itself. @@ -322,6 +362,8 @@ class SemanticsFlag { _kIsInMutuallyExclusiveGroupIndex: isInMutuallyExclusiveGroup, _kIsHeaderIndex: isHeader, _kIsObscuredIndex: isObscured, + _kScopesRouteIndex: scopesRoute, + _kNamesRouteIndex: namesRoute, }; @override @@ -349,6 +391,10 @@ class SemanticsFlag { return 'SemanticsFlag.isHeader'; case _kIsObscuredIndex: return 'SemanticsFlag.isObscured'; + case _kScopesRouteIndex: + return 'SemanticsFlag.scopesRoute'; + case _kNamesRouteIndex: + return 'SemanticsFlag.namesRoute'; } return null; } diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index 30ea6423b94ad..b7cddefcc2cac 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -55,6 +55,9 @@ enum class SemanticsFlags : int32_t { kIsEnabled = 1 << 7, kIsInMutuallyExclusiveGroup = 1 << 8, kIsHeader = 1 << 9, + kIsObscured = 1 << 10, + kScopesRoute = 1 << 11, + kNamesRoute = 1 << 12, }; struct SemanticsNode { diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index a3318764acafb..09ac8f4e49415 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -38,6 +38,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMess private static final float SCROLL_EXTENT_FOR_INFINITY = 100000.0f; private static final float SCROLL_POSITION_CAP_FOR_INFINITY = 70000.0f; + private static final int ROOT_NODE_ID = 0; private Map mObjects; private final FlutterView mOwner; @@ -45,6 +46,8 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMess private SemanticsObject mA11yFocusedObject; private SemanticsObject mInputFocusedObject; private SemanticsObject mHoveredObject; + private int previousRouteId = ROOT_NODE_ID; + private List previousRoutes; private final BasicMessageChannel mFlutterAccessibilityChannel; @@ -85,7 +88,9 @@ enum Flag { IS_ENABLED(1 << 7), IS_IN_MUTUALLY_EXCLUSIVE_GROUP(1 << 8), IS_HEADER(1 << 9), - IS_OBSCURED(1 << 10); + IS_OBSCURED(1 << 10), + SCOPES_ROUTE(1 << 11), + NAMES_ROUTE(1 << 12); Flag(int value) { this.value = value; @@ -98,6 +103,7 @@ enum Flag { assert owner != null; mOwner = owner; mObjects = new HashMap(); + previousRoutes = new ArrayList<>(); mFlutterAccessibilityChannel = new BasicMessageChannel<>(owner, "flutter/accessibility", StandardMessageCodec.INSTANCE); } @@ -117,8 +123,8 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { if (virtualViewId == View.NO_ID) { AccessibilityNodeInfo result = AccessibilityNodeInfo.obtain(mOwner); mOwner.onInitializeAccessibilityNodeInfo(result); - if (mObjects.containsKey(0)) - result.addChild(mOwner, 0); + if (mObjects.containsKey(ROOT_NODE_ID)) + result.addChild(mOwner, ROOT_NODE_ID); return result; } @@ -177,10 +183,10 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { } if (object.parent != null) { - assert object.id > 0; + assert object.id > ROOT_NODE_ID; result.setParent(mOwner, object.parent.id); } else { - assert object.id == 0; + assert object.id == ROOT_NODE_ID; result.setParent(mOwner); } @@ -479,10 +485,32 @@ void updateSemantics(ByteBuffer buffer, String[] strings) { Set visitedObjects = new HashSet(); SemanticsObject rootObject = getRootObject(); + List newRoutes = new ArrayList<>(); if (rootObject != null) { final float[] identity = new float[16]; Matrix.setIdentityM(identity, 0); rootObject.updateRecursively(identity, visitedObjects, false); + rootObject.collectRoutes(newRoutes); + } + + // Dispatch a TYPE_WINDOW_STATE_CHANGED event if the most recent route id changed from the + // previously cached route id. + SemanticsObject lastAdded = null; + for (SemanticsObject semanticsObject : newRoutes) { + if (!previousRoutes.contains(semanticsObject.id)) { + lastAdded = semanticsObject; + } + } + if (lastAdded == null && newRoutes.size() > 0) { + lastAdded = newRoutes.get(newRoutes.size() - 1); + } + if (lastAdded != null && lastAdded.id != previousRouteId) { + previousRouteId = lastAdded.id; + createWindowChangeEvent(lastAdded); + } + previousRoutes.clear(); + for (SemanticsObject semanticsObject : newRoutes) { + previousRoutes.add(semanticsObject.id); } Iterator> it = mObjects.entrySet().iterator(); @@ -606,7 +634,7 @@ private AccessibilityEvent createTextChangedEvent(int id, String oldValue, Strin } private AccessibilityEvent obtainAccessibilityEvent(int virtualViewId, int eventType) { - assert virtualViewId != 0; + assert virtualViewId != ROOT_NODE_ID; AccessibilityEvent event = AccessibilityEvent.obtain(eventType); event.setPackageName(mOwner.getContext().getPackageName()); event.setSource(mOwner, virtualViewId); @@ -617,7 +645,7 @@ private void sendAccessibilityEvent(int virtualViewId, int eventType) { if (!mAccessibilityEnabled) { return; } - if (virtualViewId == 0) { + if (virtualViewId == ROOT_NODE_ID) { mOwner.sendAccessibilityEvent(eventType); } else { sendAccessibilityEvent(obtainAccessibilityEvent(virtualViewId, eventType)); @@ -648,6 +676,13 @@ public void onMessage(Object message, BasicMessageChannel.Reply reply) { } } + private void createWindowChangeEvent(SemanticsObject route) { + AccessibilityEvent e = obtainAccessibilityEvent(route.id, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); + String routeName = route.getRouteName(); + e.getText().add(routeName); + mOwner.getParent().requestSendAccessibilityEvent(mOwner, e); + } + private void willRemoveSemanticsObject(SemanticsObject object) { assert mObjects.containsKey(object.id); assert mObjects.get(object.id) == object; @@ -875,6 +910,11 @@ SemanticsObject hitTest(float[] point) { // TODO(goderbauer): This should be decided by the framework once we have more information // about focusability there. boolean isFocusable() { + // We enforce in the framework that no other useful semantics are merged with these + // nodes. + if (hasFlag(Flag.SCOPES_ROUTE)) { + return false; + } int scrollableActions = Action.SCROLL_RIGHT.value | Action.SCROLL_LEFT.value | Action.SCROLL_UP.value | Action.SCROLL_DOWN.value; return (actions & ~scrollableActions) != 0 @@ -884,6 +924,36 @@ boolean isFocusable() { || (hint != null && !hint.isEmpty()); } + void collectRoutes(List edges) { + if (hasFlag(Flag.SCOPES_ROUTE)) { + edges.add(this); + } + if (children != null) { + for (int i = 0; i < children.size(); ++i) { + children.get(i).collectRoutes(edges); + } + } + } + + String getRouteName() { + // Returns the first non-null and non-empty semantic label of a child + // with an NamesRoute flag. Otherwise returns null. + if (hasFlag(Flag.NAMES_ROUTE)) { + if (label != null && !label.isEmpty()) { + return label; + } + } + if (children != null) { + for (int i = 0; i < children.size(); ++i) { + String newName = children.get(i).getRouteName(); + if (newName != null && !newName.isEmpty()) { + return newName; + } + } + } + return null; + } + void updateRecursively(float[] ancestorTransform, Set visitedObjects, boolean forceUpdate) { visitedObjects.add(this); diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h index b6df5dac51ae4..ffe99c080324d 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h @@ -122,6 +122,8 @@ class AccessibilityBridge final { fml::scoped_nsobject> objects_; fml::scoped_nsprotocol accessibility_channel_; fml::WeakPtrFactory weak_factory_; + int32_t previous_route_id_; + std::vector previous_routes_; FXL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); }; diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 6a545b95e4276..3c2aa48661b9e 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -164,11 +164,45 @@ - (BOOL)isAccessibilityElement { // Note: hit detection will only apply to elements that report // -isAccessibilityElement of YES. The framework will continue scanning the // entire element tree looking for such a hit. + + // We enforce in the framework that no other useful semantics are merged with these nodes. + if ([self node].HasFlag(blink::SemanticsFlags::kScopesRoute)) + return false; return [self node].flags != 0 || ![self node].label.empty() || ![self node].value.empty() || ![self node].hint.empty() || ([self node].actions & ~blink::kScrollableSemanticsActions) != 0; } +- (void)collectRoutes:(NSMutableArray*)edges { + if ([self node].HasFlag(blink::SemanticsFlags::kScopesRoute)) + [edges addObject:self]; + if ([self hasChildren]) { + for (SemanticsObject* child in self.children) { + [child collectRoutes:edges]; + } + } +} + +- (NSString*)routeName { + // Returns the first non-null and non-empty semantic label of a child + // with an NamesRoute flag. Otherwise returns nil. + if ([self node].HasFlag(blink::SemanticsFlags::kNamesRoute)) { + NSString* newName = [self accessibilityLabel]; + if (newName != nil && [newName length] > 0) { + return newName; + } + } + if ([self hasChildren]) { + for (SemanticsObject* child in self.children) { + NSString* newName = [child routeName]; + if (newName != nil && [newName length] > 0) { + return newName; + } + } + } + return nil; +} + - (NSString*)accessibilityLabel { if ([self node].label.empty()) return nil; @@ -424,7 +458,9 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { : view_(view), platform_view_(platform_view), objects_([[NSMutableDictionary alloc] init]), - weak_factory_(this) { + weak_factory_(this), + previous_route_id_(0), + previous_routes_({}) { accessibility_channel_.reset([[FlutterBasicMessageChannel alloc] initWithName:@"flutter/accessibility" binaryMessenger:platform_view->GetOwnerViewController() @@ -492,10 +528,32 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { SemanticsObject* root = objects_.get()[@(kRootNodeId)]; + bool routeChanged = false; + SemanticsObject* lastAdded = nil; + if (root) { if (!view_.accessibilityElements) { view_.accessibilityElements = @[ [root accessibilityContainer] ]; } + NSMutableArray* newRoutes = [[[NSMutableArray alloc] init] autorelease]; + [root collectRoutes:newRoutes]; + for (SemanticsObject* route in newRoutes) { + if (std::find(previous_routes_.begin(), previous_routes_.end(), [route uid]) != previous_routes_.end()) { + lastAdded = route; + } + } + if (lastAdded == nil && [newRoutes count] > 0) { + int index = [newRoutes count] - 1; + lastAdded = [newRoutes objectAtIndex:index]; + } + if (lastAdded != nil && [lastAdded uid] != previous_route_id_) { + previous_route_id_ = [lastAdded uid]; + routeChanged = true; + } + previous_routes_.clear(); + for (SemanticsObject* route in newRoutes) { + previous_routes_.push_back([route uid]); + } } else { view_.accessibilityElements = nil; } @@ -507,7 +565,10 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { layoutChanged = layoutChanged || [doomed_uids count] > 0; - if (layoutChanged) { + if (routeChanged) { + NSString* routeName = [lastAdded routeName]; + UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, routeName); + } else if (layoutChanged) { // TODO(goderbauer): figure out which node to focus next. UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil); } From a23fa923c290816b1be7d5f0470bd875f0ac37c8 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 19 Apr 2018 12:01:46 -0700 Subject: [PATCH 0142/1190] Look for an assets path specification in the Info.plist. (#5049) --- .../darwin/ios/framework/Source/FlutterDartProject.mm | 6 +++++- .../ios/framework/Source/FlutterDartProject_Internal.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index 3c613c9fbad8f..402d7dfd33e98 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -70,7 +70,11 @@ // Checks to see if the flutter assets directory is already present. if (settings.assets_path.size() == 0) { - NSString* assetsPath = [[NSBundle mainBundle] pathForResource:@"flutter_assets" ofType:@""]; + // The kernel assets will not be present in the Flutter frameworks bundle since it is not user + // editable. Instead, look inside the main bundle. + NSBundle* bundle = [NSBundle mainBundle]; + NSString* assets_directory_name = [FlutterDartProject flutterAssetsName:bundle]; + NSString* assetsPath = [bundle pathForResource:assets_directory_name ofType:@""]; if (assetsPath.length > 0) { settings.assets_path = assetsPath.UTF8String; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h index 7fe1fc364f328..155f3c8ef4533 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h @@ -15,6 +15,8 @@ - (shell::RunConfiguration)runConfiguration; ++ (NSString*)flutterAssetsName:(NSBundle*)bundle; + @end #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_ From 637e921d6fc0c93df09c85fc58ce61c051b1f609 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 19 Apr 2018 13:32:00 -0700 Subject: [PATCH 0143/1190] Use the raster cache when rendering screenshots as bitmaps (#5050) This matches the behavior from before the shell refactoring. Fixes https://github.com/flutter/flutter/issues/16754 --- shell/common/rasterizer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index e4f6871568791..9c1b8efd7e1cd 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -164,7 +164,7 @@ static sk_sp ScreenshotLayerTreeAsImage(flow::LayerTree* tree, auto canvas = snapshot_surface->getCanvas(); auto frame = compositor_context.AcquireFrame(surface_context, canvas, false); canvas->clear(SK_ColorBLACK); - frame->Raster(*tree, true); + frame->Raster(*tree, false); canvas->flush(); // Prepare an image from the surface, this image may potentially be on th GPU. From adee351424f6b4d11b9ee87699dc5edf2d7f1e48 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 19 Apr 2018 16:12:22 -0700 Subject: [PATCH 0144/1190] Throw an error or return null if FlutterView.getBitmap fails (#5051) getBitmap had been doing FXL_CHECK assertions to check memory allocation failures and other errors. getBitmap will now return null to the caller instead. (The VM may throw OutOfMemoryError or other exceptions if JNI APIs fail) Fixes https://github.com/flutter/flutter/issues/16750 --- .../android/platform_view_android_jni.cc | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index f75f54a896850..9c16ebdd30cbf 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -351,10 +351,14 @@ static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) { const SkISize& frame_size = screenshot.frame_size; jsize pixels_size = frame_size.width() * frame_size.height(); jintArray pixels_array = env->NewIntArray(pixels_size); - FXL_CHECK(pixels_array); + if (pixels_array == nullptr) { + return nullptr; + } jint* pixels = env->GetIntArrayElements(pixels_array, nullptr); - FXL_CHECK(pixels); + if (pixels == nullptr) { + return nullptr; + } auto pixels_src = static_cast(screenshot.data->data()); @@ -371,27 +375,39 @@ static jobject GetBitmap(JNIEnv* env, jobject jcaller, jlong shell_holder) { env->ReleaseIntArrayElements(pixels_array, pixels, 0); jclass bitmap_class = env->FindClass("android/graphics/Bitmap"); - FXL_CHECK(bitmap_class); + if (bitmap_class == nullptr) { + return nullptr; + } jmethodID create_bitmap = env->GetStaticMethodID( bitmap_class, "createBitmap", "([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); - FXL_CHECK(create_bitmap); + if (create_bitmap == nullptr) { + return nullptr; + } jclass bitmap_config_class = env->FindClass("android/graphics/Bitmap$Config"); - FXL_CHECK(bitmap_config_class); + if (bitmap_config_class == nullptr) { + return nullptr; + } jmethodID bitmap_config_value_of = env->GetStaticMethodID( bitmap_config_class, "valueOf", "(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); - FXL_CHECK(bitmap_config_value_of); + if (bitmap_config_value_of == nullptr) { + return nullptr; + } jstring argb = env->NewStringUTF("ARGB_8888"); - FXL_CHECK(argb); + if (argb == nullptr) { + return nullptr; + } jobject bitmap_config = env->CallStaticObjectMethod( bitmap_config_class, bitmap_config_value_of, argb); - FXL_CHECK(bitmap_config); + if (bitmap_config == nullptr) { + return nullptr; + } return env->CallStaticObjectMethod(bitmap_class, create_bitmap, pixels_array, frame_size.width(), frame_size.height(), From 09d05a38912a3c1a906e95099cac9a7e14fae85f Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 19 Apr 2018 19:17:11 -0700 Subject: [PATCH 0145/1190] Prepare and run child isolates on a VM managed (i.e. no UI) task runner. (#5054) --- runtime/dart_isolate.cc | 86 ++++++++++++++++++++++++++++++----------- runtime/dart_isolate.h | 9 ++++- 2 files changed, 70 insertions(+), 25 deletions(-) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index a02693c06a9b8..fab6cacc2a26d 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -57,7 +57,9 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( std::move(resource_context), // resource context std::move(unref_queue), // skia unref queue advisory_script_uri, // advisory URI - advisory_script_entrypoint // advisory entrypoint + advisory_script_entrypoint, // advisory entrypoint + nullptr // child isolate preparer will be set when this isolate is + // prepared to run ); std::tie(vm_isolate, embedder_isolate) = CreateDartVMAndEmbedderObjectPair( @@ -85,6 +87,8 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( embedder_isolate->set_use_blink(vm->GetSettings().using_blink); } + root_embedder_data.release(); + return embedder_isolate; } @@ -94,7 +98,8 @@ DartIsolate::DartIsolate(const DartVM* vm, fml::WeakPtr resource_context, fxl::RefPtr unref_queue, std::string advisory_script_uri, - std::string advisory_script_entrypoint) + std::string advisory_script_entrypoint, + ChildIsolatePreparer child_isolate_preparer) : UIDartState(std::move(task_runners), vm->GetSettings().task_observer_add, vm->GetSettings().task_observer_remove, @@ -105,6 +110,7 @@ DartIsolate::DartIsolate(const DartVM* vm, vm->GetSettings().log_tag), vm_(vm), isolate_snapshot_(std::move(isolate_snapshot)), + child_isolate_preparer_(std::move(child_isolate_preparer)), weak_factory_(std::make_unique>(this)) { FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; @@ -262,11 +268,14 @@ bool DartIsolate::PrepareForRunningFromPrecompiledCode() { return false; } + child_isolate_preparer_ = [](DartIsolate* isolate) { + return isolate->PrepareForRunningFromPrecompiledCode(); + }; phase_ = Phase::Ready; return true; } -static bool LoadScriptSnapshot(std::unique_ptr mapping) { +static bool LoadScriptSnapshot(std::shared_ptr mapping) { if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), mapping->GetSize()))) { return false; @@ -274,7 +283,7 @@ static bool LoadScriptSnapshot(std::unique_ptr mapping) { return true; } -static bool LoadKernelSnapshot(std::unique_ptr mapping) { +static bool LoadKernelSnapshot(std::shared_ptr mapping) { if (tonic::LogIfError(Dart_LoadScriptFromKernel(mapping->GetMapping(), mapping->GetSize()))) { return false; @@ -283,7 +292,7 @@ static bool LoadKernelSnapshot(std::unique_ptr mapping) { return true; } -static bool LoadSnapshot(std::unique_ptr mapping, +static bool LoadSnapshot(std::shared_ptr mapping, bool is_kernel) { if (is_kernel) { return LoadKernelSnapshot(std::move(mapping)); @@ -295,7 +304,7 @@ static bool LoadSnapshot(std::unique_ptr mapping, FXL_WARN_UNUSED_RESULT bool DartIsolate::PrepareForRunningFromSnapshot( - std::unique_ptr mapping) { + std::shared_ptr mapping) { TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSnapshot"); if (phase_ != Phase::LibrariesSetup) { return false; @@ -315,7 +324,7 @@ bool DartIsolate::PrepareForRunningFromSnapshot( return false; } - if (!LoadSnapshot(std::move(mapping), vm_->GetPlatformKernel() != nullptr)) { + if (!LoadSnapshot(mapping, vm_->GetPlatformKernel() != nullptr)) { return false; } @@ -327,6 +336,9 @@ bool DartIsolate::PrepareForRunningFromSnapshot( return false; } + child_isolate_preparer_ = [mapping](DartIsolate* isolate) { + return isolate->PrepareForRunningFromSnapshot(mapping); + }; phase_ = Phase::Ready; return true; } @@ -378,6 +390,9 @@ bool DartIsolate::PrepareForRunningFromSource( return false; } + child_isolate_preparer_ = [main_source_file, packages](DartIsolate* isolate) { + return isolate->PrepareForRunningFromSource(main_source_file, packages); + }; phase_ = Phase::Ready; return true; } @@ -438,6 +453,7 @@ bool DartIsolate::Run(const std::string& entrypoint_name) { } phase_ = Phase::Running; + FXL_DLOG(INFO) << "New isolate is in the running state."; return true; } @@ -592,31 +608,39 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( const char* package_root, const char* package_config, Dart_IsolateFlags* flags, - DartIsolate* parent_embedder_isolate, + DartIsolate* p_parent_embedder_isolate, bool is_root_isolate, char** error) { TRACE_EVENT0("flutter", "DartIsolate::CreateDartVMAndEmbedderObjectPair"); - if (parent_embedder_isolate == nullptr || - parent_embedder_isolate->GetDartVM() == nullptr) { + + std::unique_ptr embedder_isolate{p_parent_embedder_isolate}; + + if (embedder_isolate == nullptr || embedder_isolate->GetDartVM() == nullptr) { *error = strdup("Parent isolate did not have embedder specific callback data."); FXL_DLOG(ERROR) << *error; return {nullptr, {}}; } - const DartVM* vm = parent_embedder_isolate->GetDartVM(); + const DartVM* vm = embedder_isolate->GetDartVM(); - // Create the native object on the embedder side. This object is deleted in - // the cleanup callback. - auto embedder_isolate = std::make_unique( - vm, // - parent_embedder_isolate->GetIsolateSnapshot(), // - parent_embedder_isolate->GetTaskRunners(), // - parent_embedder_isolate->GetResourceContext(), // - parent_embedder_isolate->GetSkiaUnrefQueue(), // - advisory_script_uri, // - advisory_script_entrypoint // - ); + if (!is_root_isolate) { + auto raw_embedder_isolate = embedder_isolate.release(); + + blink::TaskRunners null_task_runners(advisory_script_uri, nullptr, nullptr, + nullptr, nullptr); + + embedder_isolate = std::make_unique( + vm, // vm + raw_embedder_isolate->GetIsolateSnapshot(), // isolate_snapshot + null_task_runners, // task_runners + fml::WeakPtr{}, // resource_context + nullptr, // unref_queue + advisory_script_uri, // advisory_script_uri + advisory_script_entrypoint, // advisory_script_entrypoint + raw_embedder_isolate->child_isolate_preparer_ // child isolate preparer + ); + } // Create the Dart VM isolate and give it the embedder object as the baton. Dart_Isolate isolate = @@ -658,9 +682,25 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( return {nullptr, {}}; } + auto weak_embedder_isolate = embedder_isolate->GetWeakIsolatePtr(); + + // Root isolates will be setup by the engine and the service isolate (which is + // also a root isolate) by the utility routines in the VM. However, secondary + // isolates will be run by the VM if they are marked as runnable. + if (!is_root_isolate) { + FXL_DCHECK(embedder_isolate->child_isolate_preparer_); + if (!embedder_isolate->child_isolate_preparer_(embedder_isolate.get())) { + *error = strdup("Could not prepare the child isolate to run."); + FXL_DLOG(ERROR) << *error; + return {nullptr, {}}; + } + embedder_isolate->ResetWeakPtrFactory(); + } + // The ownership of the embedder object is controlled by the Dart VM. So the // only reference returned to the caller is weak. - return {isolate, embedder_isolate.release()->GetWeakIsolatePtr()}; + embedder_isolate.release(); + return {isolate, weak_embedder_isolate}; } // |Dart_IsolateShutdownCallback| diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index b78324825f8a3..749b7b7a4ec39 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -33,6 +33,8 @@ class DartIsolate : public UIDartState { Shutdown, }; + using ChildIsolatePreparer = std::function; + // The root isolate of a Flutter application is special because it gets Window // bindings. From the VM's perspective, this isolate is not special in any // way. @@ -53,7 +55,8 @@ class DartIsolate : public UIDartState { fml::WeakPtr resource_context, fxl::RefPtr unref_queue, std::string advisory_script_uri, - std::string advisory_script_entrypoint); + std::string advisory_script_entrypoint, + ChildIsolatePreparer child_isolate_preparer); ~DartIsolate() override; @@ -63,7 +66,8 @@ class DartIsolate : public UIDartState { bool PrepareForRunningFromPrecompiledCode(); FXL_WARN_UNUSED_RESULT - bool PrepareForRunningFromSnapshot(std::unique_ptr snapshot); + bool PrepareForRunningFromSnapshot( + std::shared_ptr snapshot); FXL_WARN_UNUSED_RESULT bool PrepareForRunningFromSource(const std::string& main_source_file, @@ -103,6 +107,7 @@ class DartIsolate : public UIDartState { Phase phase_ = Phase::Unknown; const fxl::RefPtr isolate_snapshot_; std::vector> shutdown_callbacks_; + ChildIsolatePreparer child_isolate_preparer_; std::unique_ptr> weak_factory_; FXL_WARN_UNUSED_RESULT From 17e3e6961e5293be713afcd41a828a67be77038c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 20 Apr 2018 13:16:21 -0400 Subject: [PATCH 0146/1190] Roll src/third_party/skia/ c4e384e5a..3d0e8507f (18 commits) (#5056) https://skia.googlesource.com/skia.git/+log/c4e384e5ad85..3d0e8507face $ git log c4e384e5a..3d0e8507f --date=short --no-merges --format='%ad %ae %s' 2018-04-20 robertphillips Prevent matrix stack from being corrupted if a rotated image filter is clipped out 2018-04-20 caryclark guard against NaN in path is rect 2018-04-19 fmalita Fix use-of-uninitialized-value in SkPictureShader::onMakeContext 2018-04-19 benjaminwagner Disable retries for Build, CT, and Calmbench tasks. 2018-04-20 angle-skia-autoroll Roll third_party/externals/angle2/ b0f917fa6..3ec304dba (1 commit) 2018-04-20 angle-skia-autoroll Roll third_party/externals/angle2/ e24032a2c..b0f917fa6 (3 commits) 2018-04-19 csmartdalton ccpr: Don't preempt the convex path renderer 2018-04-19 benjaminwagner Add more angle_gl_* configs for NVIDIA. 2018-04-19 jvanverth Remove ambient clamp hack for analytic shadows. 2018-04-19 brianosman Remove duplicate predefined configs 2018-04-18 csmartdalton ccpr: Clean up GrCCGeometry 2018-04-19 herb Adding pinning to the strike cache 2018-04-19 bsalomon Fix double counting of coverage in analytic round capped stroked circles. 2018-04-11 bungeman Document minimum OS requirements. 2018-04-19 angle-skia-autoroll Roll third_party/externals/angle2/ eeec3b14c..e24032a2c (2 commits) 2018-04-18 robertphillips rm SkRRectsGaussianEdgeMaskFilter 2018-04-19 borenet [skcms] Add version.sha1 2018-04-19 mtklein crash rather than overflow in SkTDArray Created with: roll-dep src/third_party/skia --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 30 ++++++++ travis/licenses_golden/licenses_third_party | 77 +++++++++++---------- 3 files changed, 70 insertions(+), 39 deletions(-) diff --git a/DEPS b/DEPS index afb64d7d5be04..091d535d1590e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c4e384e5ad85250920cac6e8ee0e2a14b69d67e0', + 'skia_revision': '3d0e8507face451a4b17698beb6ad0ea51b9ef1d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 5c65f720ed0a8..4205ee5b1b487 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -15237,6 +15237,36 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice defined by the Mozilla Public License, v. 2.0. -------------------------------------------------------------------------------- skcms + +Copyright (c) 2018 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skcms skia Copyright 2018 Google Inc. diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b2cdd128882c2..64257883a0a4a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a3b93d6693661a99bccda168147b2ae6 +Signature: f6b276036e543bc2ddf0a09253044a51 UNUSED LICENSES: @@ -111,39 +111,6 @@ and other provisions required by the GPL or the LGPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the MPL, the GPL or the LGPL. ==================================================================================================== - -==================================================================================================== -ORIGIN: ../../../third_party/skia/third_party/skcms/LICENSE -TYPE: LicenseType.bsd ----------------------------------------------------------------------------------------------------- -Copyright (c) 2018 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USED LICENSES: @@ -14104,7 +14071,6 @@ FILE: ../../../third_party/skia/gm/overdrawcolorfilter.cpp FILE: ../../../third_party/skia/gm/pathmaskcache.cpp FILE: ../../../third_party/skia/gm/readpixels.cpp FILE: ../../../third_party/skia/gm/rectangletexture.cpp -FILE: ../../../third_party/skia/gm/reveal.cpp FILE: ../../../third_party/skia/gm/rrectclipdrawpaint.cpp FILE: ../../../third_party/skia/gm/shapes.cpp FILE: ../../../third_party/skia/gm/showmiplevels.cpp @@ -14130,7 +14096,6 @@ FILE: ../../../third_party/skia/include/core/SkYUVSizeInfo.h FILE: ../../../third_party/skia/include/effects/SkArithmeticImageFilter.h FILE: ../../../third_party/skia/include/effects/SkOverdrawColorFilter.h FILE: ../../../third_party/skia/include/effects/SkPaintImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkRRectsGaussianEdgeMaskFilter.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkBackendContext.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkDefines.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkTypes.h @@ -14231,7 +14196,6 @@ FILE: ../../../third_party/skia/src/core/SkSwizzle.cpp FILE: ../../../third_party/skia/src/effects/SkArithmeticImageFilter.cpp FILE: ../../../third_party/skia/src/effects/SkOverdrawColorFilter.cpp FILE: ../../../third_party/skia/src/effects/SkPaintImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkRRectsGaussianEdgeMaskFilter.cpp FILE: ../../../third_party/skia/src/gpu/GrAppliedClip.h FILE: ../../../third_party/skia/src/gpu/GrAuditTrail.cpp FILE: ../../../third_party/skia/src/gpu/GrBitmapTextureMaker.cpp @@ -17196,8 +17160,9 @@ Exhibit B - “Incompatible With Secondary Licenses” Notice ==================================================================================================== LIBRARY: skcms LIBRARY: skia -ORIGIN: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/bench/GrCCGeometryBench.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h @@ -17389,6 +17354,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: skcms +ORIGIN: ../../../third_party/skia/third_party/skcms/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/third_party/skcms/version.sha1 +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/LICENSE @@ -17700,6 +17700,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu17-G FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Release-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Release-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Release-All-ANGLE.json From 995633ef4913371d4932fcf2c7d55daf68e6f791 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Fri, 20 Apr 2018 10:37:02 -0700 Subject: [PATCH 0147/1190] Add SemanticsFlag.isHidden (#5052) --- lib/ui/semantics.dart | 46 ++++++++++++++----- lib/ui/semantics/semantics_node.h | 1 + .../io/flutter/view/AccessibilityBridge.java | 13 ++++-- .../framework/Source/accessibility_bridge.mm | 18 ++++++-- 4 files changed, 59 insertions(+), 19 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index f7426238cc088..6040e7809e9b6 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -227,6 +227,7 @@ class SemanticsFlag { static const int _kIsObscuredIndex = 1 << 10; static const int _kScopesRouteIndex= 1 << 11; static const int _kNamesRouteIndex = 1 << 12; + static const int _kIsHiddenIndex = 1 << 13; const SemanticsFlag._(this.index); @@ -311,42 +312,60 @@ class SemanticsFlag { /// Whether the semantics node is the root of a subtree for which a route name /// should be announced. - /// - /// When a node with this flag is removed from the semantics tree, the + /// + /// When a node with this flag is removed from the semantics tree, the /// framework will select the last in depth-first, paint order node with this /// flag. When a node with this flag is added to the semantics tree, it is /// selected automatically, unless there were multiple nodes with this flag /// added. In this case, the last added node in depth-first, paint order /// will be selected. - /// + /// /// From this selected node, the framework will search in depth-first, paint - /// order for the first node with a [namesRoute] flag and a non-null, - /// non-empty label. The [namesRoute] and [scopesRoute] flags may be on the - /// same node. The label of the found node will be announced as an edge + /// order for the first node with a [namesRoute] flag and a non-null, + /// non-empty label. The [namesRoute] and [scopesRoute] flags may be on the + /// same node. The label of the found node will be announced as an edge /// transition. If no non-empty, non-null label is found then: - /// + /// /// * VoiceOver will make a chime announcement. /// * TalkBack will make no announcement /// /// Semantic nodes annotated with this flag are generally not a11y focusable. - /// - /// This is used in widgets such as Routes, Drawers, and Dialogs to + /// + /// This is used in widgets such as Routes, Drawers, and Dialogs to /// communicate significant changes in the visible screen. static const SemanticsFlag scopesRoute = const SemanticsFlag._(_kScopesRouteIndex); /// Whether the semantics node label is the name of a visually distinct /// route. - /// + /// /// This is used by certain widgets like Drawers and Dialogs, to indicate /// that the node's semantic label can be used to announce an edge triggered /// semantics update. /// /// Semantic nodes annotated with this flag will still recieve a11y focus. - /// - /// Updating this label within the same active route subtree will not cause + /// + /// Updating this label within the same active route subtree will not cause /// additional announcements. static const SemanticsFlag namesRoute = const SemanticsFlag._(_kNamesRouteIndex); + /// Whether the semantics node is considered hidden. + /// + /// Hidden elements are currently not visible on screen. They may be covered + /// by other elements or positioned outside of the visible area of a viewport. + /// + /// Hidden elements cannot gain accessibility focus though regular touch. The + /// only way they can be focused is by moving the focus to them via linear + /// navigation. + /// + /// Platforms are free to completely ignore hidden elements and new platforms + /// are encouraged to do so. + /// + /// Instead of marking an element as hidden it should usually be excluded from + /// the semantics tree altogether. Hidden elements are only included in the + /// semantics tree to work around platform limitations and they are mainly + /// used to implement accessibility scrolling on iOS. + static const SemanticsFlag isHidden = const SemanticsFlag._(_kIsHiddenIndex); + /// The possible semantics flags. /// /// The map's key is the [index] of the flag and the value is the flag itself. @@ -364,6 +383,7 @@ class SemanticsFlag { _kIsObscuredIndex: isObscured, _kScopesRouteIndex: scopesRoute, _kNamesRouteIndex: namesRoute, + _kIsHiddenIndex: isHidden, }; @override @@ -395,6 +415,8 @@ class SemanticsFlag { return 'SemanticsFlag.scopesRoute'; case _kNamesRouteIndex: return 'SemanticsFlag.namesRoute'; + case _kIsHiddenIndex: + return 'SemanticsFlag.isHidden'; } return null; } diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index b7cddefcc2cac..24a8486026301 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -58,6 +58,7 @@ enum class SemanticsFlags : int32_t { kIsObscured = 1 << 10, kScopesRoute = 1 << 11, kNamesRoute = 1 << 12, + kIsHidden = 1 << 13, }; struct SemanticsNode { diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 09ac8f4e49415..800d0785c958d 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -91,6 +91,7 @@ enum Flag { IS_OBSCURED(1 << 10), SCOPES_ROUTE(1 << 11), NAMES_ROUTE(1 << 12); + IS_HIDDEN(1 << 13); Flag(int value) { this.value = value; @@ -264,7 +265,9 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { if (object.children != null) { for (SemanticsObject child : object.children) { - result.addChild(mOwner, child.id); + if (!child.hasFlag(Flag.IS_HIDDEN)) { + result.addChild(mOwner, child.id); + } } } @@ -472,9 +475,10 @@ void updateSemantics(ByteBuffer buffer, String[] strings) { while (buffer.hasRemaining()) { int id = buffer.getInt(); SemanticsObject object = getOrCreateObject(id); - boolean hadCheckedState = object.hasFlag(Flag.HAS_CHECKED_STATE); - boolean wasChecked = object.hasFlag(Flag.IS_CHECKED); object.updateWith(buffer, strings); + if (object.hasFlag(Flag.IS_HIDDEN)) { + continue; + } if (object.hasFlag(Flag.IS_FOCUSED)) { mInputFocusedObject = object; } @@ -896,6 +900,9 @@ SemanticsObject hitTest(float[] point) { final float[] transformedPoint = new float[4]; for (int i = children.size() - 1; i >= 0; i -= 1) { final SemanticsObject child = children.get(i); + if (child.hasFlag(Flag.IS_HIDDEN)) { + continue; + } child.ensureInverseTransform(); Matrix.multiplyMV(transformedPoint, 0, child.inverseTransform, 0, point, 0); final SemanticsObject result = child.hitTest(transformedPoint); diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 3c2aa48661b9e..48b208a261c4a 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -168,8 +168,8 @@ - (BOOL)isAccessibilityElement { // We enforce in the framework that no other useful semantics are merged with these nodes. if ([self node].HasFlag(blink::SemanticsFlags::kScopesRoute)) return false; - return [self node].flags != 0 || ![self node].label.empty() || ![self node].value.empty() || - ![self node].hint.empty() || + return ([self node].flags != 0 && [self node].flags != static_cast(blink::SemanticsFlags::kIsHidden)) || + ![self node].label.empty() || ![self node].value.empty() || ![self node].hint.empty() || ([self node].actions & ~blink::kScrollableSemanticsActions) != 0; } @@ -222,6 +222,13 @@ - (NSString*)accessibilityValue { } - (CGRect)accessibilityFrame { + if ([self node].HasFlag(blink::SemanticsFlags::kIsHidden)) { + return [super accessibilityFrame]; + } + return [self globalRect]; +} + +- (CGRect) globalRect { SkMatrix44 globalTransform = [self node].transform; for (SemanticsObject* parent = [self parent]; parent; parent = parent.parent) { globalTransform = parent.node.transform * globalTransform; @@ -298,6 +305,9 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { #pragma mark UIAccessibilityFocus overrides - (void)accessibilityElementDidBecomeFocused { + if ([self node].HasFlag(blink::SemanticsFlags::kIsHidden)) { + [self bridge] -> DispatchSemanticsAction([self uid], blink::SemanticsAction::kShowOnScreen); + } if ([self node].HasAction(blink::SemanticsAction::kDidGainAccessibilityFocus)) { [self bridge] -> DispatchSemanticsAction([self uid], blink::SemanticsAction::kDidGainAccessibilityFocus); @@ -515,8 +525,8 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { for (SemanticsObject* object in childOrdersToUpdate) { [object.children sortUsingComparator:^(SemanticsObject* a, SemanticsObject* b) { // Should a go before b? - CGRect rectA = [a accessibilityFrame]; - CGRect rectB = [b accessibilityFrame]; + CGRect rectA = [a globalRect]; + CGRect rectB = [b globalRect]; CGFloat top = rectA.origin.y - rectB.origin.y; if (top == 0.0) return IntToComparisonResult(rectA.origin.x - rectB.origin.x < 0.0); From 944b7dceaedb1e3e0a188f3cf8e54a8996fbd546 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 20 Apr 2018 11:38:10 -0700 Subject: [PATCH 0148/1190] Prevent multiple calls to FlutterMain.startInitialization (#5058) See https://github.com/flutter/flutter/issues/16748 and https://github.com/flutter/flutter/issues/16456 --- .../android/io/flutter/view/FlutterMain.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/shell/platform/android/io/flutter/view/FlutterMain.java b/shell/platform/android/io/flutter/view/FlutterMain.java index d4a1c15de498c..54d34294d41d0 100644 --- a/shell/platform/android/io/flutter/view/FlutterMain.java +++ b/shell/platform/android/io/flutter/view/FlutterMain.java @@ -8,6 +8,7 @@ import android.content.pm.PackageManager; import android.content.res.AssetManager; import android.os.Bundle; +import android.os.Looper; import android.os.SystemClock; import android.util.Log; @@ -154,6 +155,14 @@ public static void startInitialization(Context applicationContext) { * @param settings Configuration settings. */ public static void startInitialization(Context applicationContext, Settings settings) { + if (Looper.myLooper() != Looper.getMainLooper()) { + throw new IllegalStateException("startInitialization must be called on the main thread"); + } + // Do not run startInitialization more than once. + if (sSettings != null) { + return; + } + sSettings = settings; long initStartTimestampMillis = SystemClock.uptimeMillis(); @@ -177,6 +186,9 @@ public static void startInitialization(Context applicationContext, Settings sett * @param args Flags sent to the Flutter runtime. */ public static void ensureInitializationComplete(Context applicationContext, String[] args) { + if (Looper.myLooper() != Looper.getMainLooper()) { + throw new IllegalStateException("ensureInitializationComplete must be called on the main thread"); + } if (sInitialized) { return; } From 232060828a1d4a9c3ee16b92f3af5f5a15041e32 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 20 Apr 2018 13:54:27 -0700 Subject: [PATCH 0149/1190] Fix syntax error in AccessibilityBridge (#5059) --- shell/platform/android/io/flutter/view/AccessibilityBridge.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 800d0785c958d..2d40893712360 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -90,7 +90,7 @@ enum Flag { IS_HEADER(1 << 9), IS_OBSCURED(1 << 10), SCOPES_ROUTE(1 << 11), - NAMES_ROUTE(1 << 12); + NAMES_ROUTE(1 << 12), IS_HIDDEN(1 << 13); Flag(int value) { From cb3376c5dedb71cec7a88b8a8904acc5dd6c6ba1 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Fri, 20 Apr 2018 19:47:27 -0700 Subject: [PATCH 0150/1190] Support different encodings in Image.toByteData() (#5060) Fixes https://github.com/flutter/flutter/issues/16635 --- lib/ui/painting.dart | 53 ++++++++-- lib/ui/painting/image.cc | 4 +- lib/ui/painting/image.h | 2 +- lib/ui/painting/image_encoding.cc | 52 ++++++---- lib/ui/painting/image_encoding.h | 5 +- testing/dart/encoding_test.dart | 154 +++++++++++++++++++----------- testing/resources/square.png | Bin 0 -> 125 bytes 7 files changed, 184 insertions(+), 86 deletions(-) create mode 100644 testing/resources/square.png diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 96af472629912..c08d3cf46fde4 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1196,6 +1196,38 @@ class Paint { } } +/// The format in which image bytes should be returned when using +/// [Image.toByteData]. +enum ImageByteFormat { + /// Raw RGBA format. + /// + /// Unencoded bytes, in RGBA row-primary form, 8 bits per channel. + rawRgba, + + /// Raw unmodified format. + /// + /// Unencoded bytes, in the image's existing format. For example, a grayscale + /// image may use a single 8-bit channel for each pixel. + rawUnmodified, + + /// PNG format. + /// + /// A loss-less compression format for images. This format is well suited for + /// images with hard edges, such as screenshots or sprites, and images with + /// text. Transparency is supported. The PNG format supports images up to + /// 2,147,483,647 pixels in either dimension, though in practice available + /// memory provides a more immediate limitation on maximum image size. + /// + /// PNG images normally use the `.png` file extension and the `image/png` MIME + /// type. + /// + /// See also: + /// + /// * , the Wikipedia page on PNG. + /// * , the PNG standard. + png, +} + /// Opaque handle to raw decoded image data (pixels). /// /// To obtain an [Image] object, use [instantiateImageCodec]. @@ -1217,20 +1249,21 @@ class Image extends NativeFieldWrapperClass2 { /// Converts the [Image] object into a byte array. /// - /// The image bytes will be RGBA form, 8 bits per channel, row-primary. + /// The [format] argument specifies the format in which the bytes will be + /// returned. /// /// Returns a future that completes with the binary image data or an error /// if encoding fails. - Future toByteData() { + Future toByteData({ImageByteFormat format: ImageByteFormat.rawRgba}) { return _futurize((_Callback callback) { - return _toByteData((Uint8List encoded) { + return _toByteData(format.index, (Uint8List encoded) { callback(encoded?.buffer?.asByteData()); }); }); } /// Returns an error message on failure, null on success. - String _toByteData(_Callback callback) native 'Image_toByteData'; + String _toByteData(int format, _Callback callback) native 'Image_toByteData'; /// Release the resources used by this object. The object is no longer usable /// after this method is called. @@ -1530,8 +1563,8 @@ class Path extends NativeFieldWrapperClass2 { /// Adds a new subpath that consists of a curve that forms the /// ellipse that fills the given rectangle. - /// - /// To add a circle, pass an appropriate rectangle as `oval`. [Rect.fromCircle] + /// + /// To add a circle, pass an appropriate rectangle as `oval`. [Rect.fromCircle] /// can be used to easily describe the circle's center [Offset] and radius. void addOval(Rect oval) { assert(_rectIsValid(oval)); @@ -1938,8 +1971,8 @@ class Gradient extends Shader { /// If `center`, `radius`, `colors`, or `tileMode` are null, or if `colors` or /// `colorStops` contain null values, this constructor will throw a /// [NoSuchMethodError]. - /// - /// If `matrix4` is provided, the gradient fill will be transformed by the + /// + /// If `matrix4` is provided, the gradient fill will be transformed by the /// specified 4x4 matrix relative to the local coordinate system. `matrix4` must /// be a column-major matrix packed into a list of 16 values. Gradient.radial( @@ -2917,11 +2950,11 @@ typedef String _Callbacker(_Callback callback); /// /// ```dart /// typedef void IntCallback(int result); -/// +/// /// String _doSomethingAndCallback(IntCallback callback) { /// new Timer(new Duration(seconds: 1), () { callback(1); }); /// } -/// +/// /// Future doSomething() { /// return _futurize(_doSomethingAndCallback); /// } diff --git a/lib/ui/painting/image.cc b/lib/ui/painting/image.cc index 4704a9ae6600f..ef45856230ff0 100644 --- a/lib/ui/painting/image.cc +++ b/lib/ui/painting/image.cc @@ -32,8 +32,8 @@ CanvasImage::CanvasImage() = default; CanvasImage::~CanvasImage() = default; -Dart_Handle CanvasImage::toByteData(Dart_Handle callback) { - return GetImageBytes(this, callback); +Dart_Handle CanvasImage::toByteData(int format, Dart_Handle callback) { + return EncodeImage(this, format, callback); } void CanvasImage::dispose() { diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index 3c6620fda25be..e92db979ed797 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -31,7 +31,7 @@ class CanvasImage final : public fxl::RefCountedThreadSafe, int height() { return image_.get()->height(); } - Dart_Handle toByteData(Dart_Handle callback); + Dart_Handle toByteData(int format, Dart_Handle callback); void dispose(); diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index c103d5d8271e4..6de40034d7071 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -31,6 +31,13 @@ using tonic::ToDart; namespace blink { namespace { +// This must be kept in sync with the enum in painting.dart +enum ImageByteFormat { + kRawRGBA, + kRawUnmodified, + kPNG, +}; + void InvokeDataCallback(std::unique_ptr callback, sk_sp buffer) { tonic::DartState* dart_state = callback->dart_state().get(); @@ -47,13 +54,17 @@ void InvokeDataCallback(std::unique_ptr callback, } } -sk_sp GetImageBytesAsRGBA(sk_sp image) { +sk_sp EncodeImage(sk_sp image, ImageByteFormat format) { TRACE_EVENT0("flutter", __FUNCTION__); if (image == nullptr) { return nullptr; } + if (format == kPNG) { + return image->encodeToData(SkEncodedImageFormat::kPNG, 0); + } + // Copy the GPU image snapshot into CPU memory. auto cpu_snapshot = image->makeRasterImage(); if (!cpu_snapshot) { @@ -67,6 +78,11 @@ sk_sp GetImageBytesAsRGBA(sk_sp image) { return nullptr; } + if (format == kRawUnmodified) { + return SkData::MakeWithCopy(pixmap.addr(), pixmap.computeByteSize()); + } + + ASSERT(format == kRawRGBA); if (pixmap.colorType() != kRGBA_8888_SkColorType) { TRACE_EVENT0("flutter", "ConvertToRGBA"); @@ -80,36 +96,38 @@ sk_sp GetImageBytesAsRGBA(sk_sp image) { return nullptr; } - const size_t pixmap_size = pixmap.computeByteSize(); - return SkData::MakeWithCopy(pixmap.addr32(), pixmap_size); + return SkData::MakeWithCopy(pixmap.addr32(), pixmap.computeByteSize()); } else { - const size_t pixmap_size = pixmap.computeByteSize(); - return SkData::MakeWithCopy(pixmap.addr32(), pixmap_size); + return SkData::MakeWithCopy(pixmap.addr32(), pixmap.computeByteSize()); } } -void GetImageBytesAndInvokeDataCallback( +void EncodeImageAndInvokeDataCallback( std::unique_ptr callback, sk_sp image, - fxl::RefPtr ui_task_runner) { - sk_sp buffer = GetImageBytesAsRGBA(std::move(image)); + fxl::RefPtr ui_task_runner, + ImageByteFormat format) { + sk_sp encoded = EncodeImage(std::move(image), format); ui_task_runner->PostTask( - fxl::MakeCopyable([callback = std::move(callback), buffer]() mutable { - InvokeDataCallback(std::move(callback), std::move(buffer)); + fxl::MakeCopyable([callback = std::move(callback), encoded]() mutable { + InvokeDataCallback(std::move(callback), std::move(encoded)); })); } } // namespace -Dart_Handle GetImageBytes(CanvasImage* canvas_image, - Dart_Handle callback_handle) { +Dart_Handle EncodeImage(CanvasImage* canvas_image, + int format, + Dart_Handle callback_handle) { if (!canvas_image) return ToDart("encode called with non-genuine Image."); if (!Dart_IsClosure(callback_handle)) return ToDart("Callback must be a function."); + ImageByteFormat image_format = static_cast(format); + auto callback = std::make_unique( tonic::DartState::Current(), callback_handle); sk_sp image = canvas_image->image(); @@ -118,10 +136,12 @@ Dart_Handle GetImageBytes(CanvasImage* canvas_image, task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( [callback = std::move(callback), image, - ui_task_runner = task_runners.GetUITaskRunner()]() mutable { - GetImageBytesAndInvokeDataCallback(std::move(callback), - std::move(image), - std::move(ui_task_runner)); + ui_task_runner = task_runners.GetUITaskRunner(), + image_format]() mutable { + EncodeImageAndInvokeDataCallback(std::move(callback), + std::move(image), + std::move(ui_task_runner), + image_format); })); return Dart_Null(); diff --git a/lib/ui/painting/image_encoding.h b/lib/ui/painting/image_encoding.h index 5081bc4ee5f95..2f7618db9854b 100644 --- a/lib/ui/painting/image_encoding.h +++ b/lib/ui/painting/image_encoding.h @@ -11,8 +11,9 @@ namespace blink { class CanvasImage; -Dart_Handle GetImageBytes(CanvasImage* canvas_image, - Dart_Handle callback_handle); +Dart_Handle EncodeImage(CanvasImage* canvas_image, + int format, + Dart_Handle callback_handle); } // namespace blink diff --git a/testing/dart/encoding_test.dart b/testing/dart/encoding_test.dart index 27b71dc4787dc..c8210d9b4e094 100644 --- a/testing/dart/encoding_test.dart +++ b/testing/dart/encoding_test.dart @@ -18,71 +18,115 @@ const Color _kGreen = const Color.fromRGBO(0, 255, 0, 1.0); void main() { group('Image.toByteData', () { - test('Encode with default arguments', () async { - Image testImage = createSquareTestImage(); - ByteData data = await testImage.toByteData(); - expect(new Uint8List.view(data.buffer), getExpectedBytes()); + group('RGBA format', () { + test('works with simple image', () async { + ByteData data = await Square4x4Image.image.toByteData(); + expect(new Uint8List.view(data.buffer), Square4x4Image.bytes); + }); + + test('converts grayscale images', () async { + Image image = await GrayscaleImage.load(); + ByteData data = await image.toByteData(); + Uint8List bytes = data.buffer.asUint8List(); + expect(bytes, hasLength(16)); + expect(bytes, GrayscaleImage.bytesAsRgba); + }); }); - test('Handles grayscale images', () async { - File grayscaleImage = new File(path.join('flutter', 'testing', 'resources', '4x4.png')); - Uint8List png = await grayscaleImage.readAsBytes(); - Completer completer = new Completer(); - decodeImageFromList(png, (Image image) => completer.complete(image)); - Image image = await completer.future; - ByteData data = await image.toByteData(); - Uint8List bytes = data.buffer.asUint8List(); - expect(bytes, hasLength(16)); - expect(bytes, [ - 255, 255, 255, 255, - 127, 127, 127, 255, - 127, 127, 127, 255, - 0, 0, 0, 255, - ]); + group('Unmodified format', () { + test('works with simple image', () async { + Image image = Square4x4Image.image; + ByteData data = await image.toByteData(format: ImageByteFormat.rawUnmodified); + expect(new Uint8List.view(data.buffer), Square4x4Image.bytes); + }); + + test('works with grayscale images', () async { + Image image = await GrayscaleImage.load(); + ByteData data = await image.toByteData(format: ImageByteFormat.rawUnmodified); + Uint8List bytes = data.buffer.asUint8List(); + expect(bytes, hasLength(4)); + expect(bytes, GrayscaleImage.bytesUnmodified); + }); + }); + + group('PNG format', () { + test('works with simple image', () async { + Image image = Square4x4Image.image; + ByteData data = await image.toByteData(format: ImageByteFormat.png); + List expected = await readFile('square.png'); + expect(new Uint8List.view(data.buffer), expected); + }); }); }); } -Image createSquareTestImage() { - double width = _kWidth.toDouble(); - double radius = _kRadius.toDouble(); - double innerWidth = (_kWidth - 2 * _kRadius).toDouble(); - - PictureRecorder recorder = new PictureRecorder(); - Canvas canvas = - new Canvas(recorder, new Rect.fromLTWH(0.0, 0.0, width, width)); - - Paint black = new Paint() - ..strokeWidth = 1.0 - ..color = _kBlack; - Paint green = new Paint() - ..strokeWidth = 1.0 - ..color = _kGreen; - - canvas.drawRect(new Rect.fromLTWH(0.0, 0.0, width, width), black); - canvas.drawRect( - new Rect.fromLTWH(radius, radius, innerWidth, innerWidth), green); - return recorder.endRecording().toImage(_kWidth, _kWidth); -} +class Square4x4Image { + static Image get image { + double width = _kWidth.toDouble(); + double radius = _kRadius.toDouble(); + double innerWidth = (_kWidth - 2 * _kRadius).toDouble(); + + PictureRecorder recorder = new PictureRecorder(); + Canvas canvas = + new Canvas(recorder, new Rect.fromLTWH(0.0, 0.0, width, width)); + + Paint black = new Paint() + ..strokeWidth = 1.0 + ..color = _kBlack; + Paint green = new Paint() + ..strokeWidth = 1.0 + ..color = _kGreen; + + canvas.drawRect(new Rect.fromLTWH(0.0, 0.0, width, width), black); + canvas.drawRect( + new Rect.fromLTWH(radius, radius, innerWidth, innerWidth), green); + return recorder.endRecording().toImage(_kWidth, _kWidth); + } -List getExpectedBytes() { - int bytesPerChannel = 4; - List result = new List(_kWidth * _kWidth * bytesPerChannel); - - fillWithColor(Color color, int min, int max) { - for (int i = min; i < max; i++) { - for (int j = min; j < max; j++) { - int offset = i * bytesPerChannel + j * _kWidth * bytesPerChannel; - result[offset] = color.red; - result[offset + 1] = color.green; - result[offset + 2] = color.blue; - result[offset + 3] = color.alpha; + static List get bytes { + int bytesPerChannel = 4; + List result = new List(_kWidth * _kWidth * bytesPerChannel); + + fillWithColor(Color color, int min, int max) { + for (int i = min; i < max; i++) { + for (int j = min; j < max; j++) { + int offset = i * bytesPerChannel + j * _kWidth * bytesPerChannel; + result[offset] = color.red; + result[offset + 1] = color.green; + result[offset + 2] = color.blue; + result[offset + 3] = color.alpha; + } } } + + fillWithColor(_kBlack, 0, _kWidth); + fillWithColor(_kGreen, _kRadius, _kWidth - _kRadius); + + return result; } +} - fillWithColor(_kBlack, 0, _kWidth); - fillWithColor(_kGreen, _kRadius, _kWidth - _kRadius); +class GrayscaleImage { + static Future load() async { + Uint8List bytes = await readFile('4x4.png'); + Completer completer = new Completer(); + decodeImageFromList(bytes, (Image image) => completer.complete(image)); + return await completer.future; + } + + static List get bytesAsRgba { + return [ + 255, 255, 255, 255, + 127, 127, 127, 255, + 127, 127, 127, 255, + 0, 0, 0, 255, + ]; + } + + static List get bytesUnmodified => [255, 127, 127, 0]; +} - return result; +Future readFile(fileName) async { + final file = new File(path.join('flutter', 'testing', 'resources', fileName)); + return await file.readAsBytes(); } diff --git a/testing/resources/square.png b/testing/resources/square.png new file mode 100644 index 0000000000000000000000000000000000000000..a042cece5516363a3d4c81eb781e5ced2456df80 GIT binary patch literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4F%}28J29*~C-V}>VJUX<4B-HR z8jh3>AYa|n#W6%;YH~_K!jJO~ED1_(g3Lg`J*V|_jGK_J3>TNAzopr06J_NxBvhE literal 0 HcmV?d00001 From 4691a0b23e0394ef60f43411dd71de9e12af2490 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Sat, 21 Apr 2018 20:50:03 -0700 Subject: [PATCH 0151/1190] Import intrusively ref counted shared pointers into FML. (#5062) --- fml/BUILD.gn | 8 + fml/build_config.h | 110 ++++ fml/compiler_specific.h | 79 +++ fml/eintr_wrapper.h | 60 ++ fml/file.h | 2 +- fml/icu_util.cc | 4 +- fml/icu_util.h | 2 +- fml/macros.h | 25 +- fml/mapping.h | 10 +- fml/memory/ref_counted.h | 136 ++++ fml/memory/ref_counted_internal.h | 107 +++ fml/memory/ref_counted_unittest.cc | 607 ++++++++++++++++++ fml/memory/ref_ptr.h | 250 ++++++++ fml/memory/ref_ptr_internal.h | 38 ++ fml/memory/thread_checker.h | 4 +- fml/memory/weak_ptr.h | 12 +- fml/memory/weak_ptr_internal.h | 8 +- fml/message_loop.h | 3 +- fml/message_loop_impl.cc | 2 +- fml/message_loop_impl.h | 4 +- fml/native_library.h | 4 +- fml/paths.cc | 2 +- fml/platform/android/jni_util.h | 2 +- fml/platform/android/message_loop_android.cc | 1 - fml/platform/android/message_loop_android.h | 4 +- fml/platform/android/scoped_java_ref.h | 8 +- fml/platform/darwin/cf_utils.h | 4 +- fml/platform/darwin/message_loop_darwin.h | 4 +- fml/platform/darwin/platform_version.h | 2 +- fml/platform/darwin/resource_mapping_darwin.h | 4 +- fml/platform/darwin/scoped_block.h | 4 +- fml/platform/darwin/scoped_nsobject.h | 8 +- fml/platform/linux/message_loop_linux.cc | 6 +- fml/platform/linux/message_loop_linux.h | 4 +- fml/platform/linux/timerfd.cc | 4 +- fml/platform/posix/file_posix.cc | 6 +- fml/platform/posix/mapping_posix.cc | 9 +- fml/platform/win/message_loop_win.h | 4 +- fml/task_runner.h | 4 +- fml/thread.cc | 2 +- fml/thread.h | 4 +- fml/thread_local.h | 10 +- fml/trace_event.h | 4 +- fml/unique_fd.cc | 4 +- fml/unique_fd.h | 2 +- fml/unique_object.h | 8 +- travis/licenses_golden/licenses_flutter | 8 + 47 files changed, 1511 insertions(+), 86 deletions(-) create mode 100644 fml/build_config.h create mode 100644 fml/compiler_specific.h create mode 100644 fml/eintr_wrapper.h create mode 100644 fml/memory/ref_counted.h create mode 100644 fml/memory/ref_counted_internal.h create mode 100644 fml/memory/ref_counted_unittest.cc create mode 100644 fml/memory/ref_ptr.h create mode 100644 fml/memory/ref_ptr_internal.h diff --git a/fml/BUILD.gn b/fml/BUILD.gn index ffbf949cc0957..5295af35ae27a 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -4,6 +4,9 @@ source_set("fml") { sources = [ + "build_config.h", + "compiler_specific.h", + "eintr_wrapper.h", "file.h", "icu_util.cc", "icu_util.h", @@ -13,6 +16,10 @@ source_set("fml") { "memory/weak_ptr.h", "memory/weak_ptr_internal.cc", "memory/weak_ptr_internal.h", + "memory/ref_counted.h", + "memory/ref_counted_internal.h", + "memory/ref_ptr.h", + "memory/ref_ptr_internal.h", "message_loop.cc", "message_loop.h", "message_loop_impl.cc", @@ -130,6 +137,7 @@ executable("fml_unittests") { sources = [ "memory/weak_ptr_unittest.cc", + "memory/ref_counted_unittest.cc", "message_loop_unittests.cc", "thread_local_unittests.cc", "thread_unittests.cc", diff --git a/fml/build_config.h b/fml/build_config.h new file mode 100644 index 0000000000000..ca9a91a382c7e --- /dev/null +++ b/fml/build_config.h @@ -0,0 +1,110 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file adds defines about the platform we're currently building on. +// Operating System: +// OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX) / +// OS_NACL (NACL_SFI or NACL_NONSFI) / OS_NACL_SFI / OS_NACL_NONSFI +// Compiler: +// COMPILER_MSVC / COMPILER_GCC +// Processor: +// ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64) +// ARCH_CPU_32_BITS / ARCH_CPU_64_BITS + +#ifndef FLUTTER_FML_BUILD_CONFIG_H_ +#define FLUTTER_FML_BUILD_CONFIG_H_ + +#if defined(__Fuchsia__) +#define OS_FUCHSIA 1 +#elif defined(ANDROID) +#define OS_ANDROID 1 +#elif defined(__APPLE__) +// only include TargetConditions after testing ANDROID as some android builds +// on mac don't have this header available and it's not needed unless the target +// is really mac/ios. +#include +#define OS_MACOSX 1 +#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +#define OS_IOS 1 +#endif // defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +#elif defined(__linux__) +#define OS_LINUX 1 +// include a system header to pull in features.h for glibc/uclibc macros. +#include +#if defined(__GLIBC__) && !defined(__UCLIBC__) +// we really are using glibc, not uClibc pretending to be glibc +#define LIBC_GLIBC 1 +#endif +#elif defined(_WIN32) +#define OS_WIN 1 +#elif defined(__FreeBSD__) +#define OS_FREEBSD 1 +#elif defined(__OpenBSD__) +#define OS_OPENBSD 1 +#elif defined(__sun) +#define OS_SOLARIS 1 +#elif defined(__QNXNTO__) +#define OS_QNX 1 +#else +#error Please add support for your platform in flutter/fml/build_config.h +#endif + +// For access to standard BSD features, use OS_BSD instead of a +// more specific macro. +#if defined(OS_FREEBSD) || defined(OS_OPENBSD) +#define OS_BSD 1 +#endif + +// For access to standard POSIXish features, use OS_POSIX instead of a +// more specific macro. +#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) || \ + defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) || \ + defined(OS_NACL) || defined(OS_QNX) +#define OS_POSIX 1 +#endif + +// Processor architecture detection. For more info on what's defined, see: +// http://msdn.microsoft.com/en-us/library/b0084kay.aspx +// http://www.agner.org/optimize/calling_conventions.pdf +// or with gcc, run: "echo | gcc -E -dM -" +#if defined(_M_X64) || defined(__x86_64__) +#define ARCH_CPU_X86_FAMILY 1 +#define ARCH_CPU_X86_64 1 +#define ARCH_CPU_64_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(_M_IX86) || defined(__i386__) +#define ARCH_CPU_X86_FAMILY 1 +#define ARCH_CPU_X86 1 +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__ARMEL__) +#define ARCH_CPU_ARM_FAMILY 1 +#define ARCH_CPU_ARMEL 1 +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__aarch64__) +#define ARCH_CPU_ARM_FAMILY 1 +#define ARCH_CPU_ARM64 1 +#define ARCH_CPU_64_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__pnacl__) +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__MIPSEL__) +#if defined(__LP64__) +#define ARCH_CPU_MIPS64_FAMILY 1 +#define ARCH_CPU_MIPS64EL 1 +#define ARCH_CPU_64_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#else +#define ARCH_CPU_MIPS_FAMILY 1 +#define ARCH_CPU_MIPSEL 1 +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#endif +#else +#error Please add support for your architecture in flutter/fml/build_config.h +#endif + +#endif // FLUTTER_FML_BUILD_CONFIG_H_ diff --git a/fml/compiler_specific.h b/fml/compiler_specific.h new file mode 100644 index 0000000000000..68fbefe1b9153 --- /dev/null +++ b/fml/compiler_specific.h @@ -0,0 +1,79 @@ +// Copyright 2016 The Fuchsia 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_COMPILER_SPECIFIC_H_ +#define FLUTTER_FML_COMPILER_SPECIFIC_H_ + +#if !defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER) +#error Unsupported compiler. +#endif + +// Annotate a variable indicating it's ok if the variable is not used. +// (Typically used to silence a compiler warning when the assignment +// is important for some other reason.) +// Use like: +// int x = ...; +// FML_ALLOW_UNUSED_LOCAL(x); +#define FML_ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0 + +// Annotate a typedef or function indicating it's ok if it's not used. +// Use like: +// typedef Foo Bar ALLOW_UNUSED_TYPE; +#if defined(__GNUC__) || defined(__clang__) +#define FML_ALLOW_UNUSED_TYPE __attribute__((unused)) +#else +#define FML_ALLOW_UNUSED_TYPE +#endif + +// Annotate a function indicating it should not be inlined. +// Use like: +// NOINLINE void DoStuff() { ... } +#if defined(__GNUC__) || defined(__clang__) +#define FML_NOINLINE __attribute__((noinline)) +#elif defined(_MSC_VER) +#define FML_NOINLINE __declspec(noinline) +#endif + +// Specify memory alignment for structs, classes, etc. +// Use like: +// class FML_ALIGNAS(16) MyClass { ... } +// FML_ALIGNAS(16) int array[4]; +#if defined(__GNUC__) || defined(__clang__) +#define FML_ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment))) +#elif defined(_MSC_VER) +#define FML_ALIGNAS(byte_alignment) __declspec(align(byte_alignment)) +#endif + +// Return the byte alignment of the given type (available at compile time). +// Use like: +// FML_ALIGNOF(int32) // this would be 4 +#if defined(__GNUC__) || defined(__clang__) +#define FML_ALIGNOF(type) __alignof__(type) +#elif defined(_MSC_VER) +#define FML_ALIGNOF(type) __alignof(type) +#endif + +// Annotate a function indicating the caller must examine the return value. +// Use like: +// int foo() FML_WARN_UNUSED_RESULT; +// To explicitly ignore a result, see |ignore_result()| in base/macros.h. +#if defined(__GNUC__) || defined(__clang__) +#define FML_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +#define FML_WARN_UNUSED_RESULT +#endif + +// Tell the compiler a function is using a printf-style format string. +// |format_param| is the one-based index of the format string parameter; +// |dots_param| is the one-based index of the "..." parameter. +// For v*printf functions (which take a va_list), pass 0 for dots_param. +// (This is undocumented but matches what the system C headers do.) +#if defined(__GNUC__) || defined(__clang__) +#define FML_PRINTF_FORMAT(format_param, dots_param) \ + __attribute__((format(printf, format_param, dots_param))) +#else +#define FML_PRINTF_FORMAT(format_param, dots_param) +#endif + +#endif // FLUTTER_FML_COMPILER_SPECIFIC_H_ diff --git a/fml/eintr_wrapper.h b/fml/eintr_wrapper.h new file mode 100644 index 0000000000000..66c8ae0cd0ea3 --- /dev/null +++ b/fml/eintr_wrapper.h @@ -0,0 +1,60 @@ +// Copyright 2016 The Fuchsia 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_EINTR_WRAPPER_H_ +#define FLUTTER_FML_EINTR_WRAPPER_H_ + +#include "flutter/fml/build_config.h" + +#include + +#if defined(OS_WIN) + +// Windows has no concept of EINTR. +#define FML_HANDLE_EINTR(x) (x) +#define FML_IGNORE_EINTR(x) (x) + +#else + +#if defined(NDEBUG) + +#define FML_HANDLE_EINTR(x) \ + ({ \ + decltype(x) eintr_wrapper_result; \ + do { \ + eintr_wrapper_result = (x); \ + } while (eintr_wrapper_result == -1 && errno == EINTR); \ + eintr_wrapper_result; \ + }) + +#else + +#define FML_HANDLE_EINTR(x) \ + ({ \ + int eintr_wrapper_counter = 0; \ + decltype(x) eintr_wrapper_result; \ + do { \ + eintr_wrapper_result = (x); \ + } while (eintr_wrapper_result == -1 && errno == EINTR && \ + eintr_wrapper_counter++ < 100); \ + eintr_wrapper_result; \ + }) + +#endif // NDEBUG + +#define FML_IGNORE_EINTR(x) \ + ({ \ + decltype(x) eintr_wrapper_result; \ + do { \ + eintr_wrapper_result = (x); \ + if (eintr_wrapper_result == -1 && errno == EINTR) { \ + eintr_wrapper_result = 0; \ + } \ + } while (0); \ + eintr_wrapper_result; \ + }) + +#endif // defined(OS_WIN) + +#endif // FLUTTER_FML_EINTR_WRAPPER_H_ diff --git a/fml/file.h b/fml/file.h index 2327b2eef831e..53da3b8ca759e 100644 --- a/fml/file.h +++ b/fml/file.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_FML_FILE_H_ #define FLUTTER_FML_FILE_H_ +#include "flutter/fml/macros.h" #include "flutter/fml/unique_fd.h" -#include "lib/fxl/macros.h" namespace fml { diff --git a/fml/icu_util.cc b/fml/icu_util.cc index 0c0acd06dbbdf..88ae64034a5c2 100644 --- a/fml/icu_util.cc +++ b/fml/icu_util.cc @@ -7,9 +7,9 @@ #include #include +#include "flutter/fml/build_config.h" #include "flutter/fml/mapping.h" #include "flutter/fml/paths.h" -#include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "third_party/icu/source/common/unicode/udata.h" @@ -87,7 +87,7 @@ class ICUContext { bool valid_; std::unique_ptr mapping_; - FXL_DISALLOW_COPY_AND_ASSIGN(ICUContext); + FML_DISALLOW_COPY_AND_ASSIGN(ICUContext); }; void InitializeICUOnce(const std::string& icu_data_path) { diff --git a/fml/icu_util.h b/fml/icu_util.h index 2d31e151139b2..1d20945ee015d 100644 --- a/fml/icu_util.h +++ b/fml/icu_util.h @@ -7,7 +7,7 @@ #include -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace fml { namespace icu { diff --git a/fml/macros.h b/fml/macros.h index ba46b9dda4b4d..0fb8079ef7421 100644 --- a/fml/macros.h +++ b/fml/macros.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_MACROS_H_ #define FLUTTER_FML_MACROS_H_ -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #ifndef FML_USED_ON_EMBEDDER @@ -17,4 +17,27 @@ #endif // FML_USED_ON_EMBEDDER +#define FML_DISALLOW_COPY(TypeName) TypeName(const TypeName&) = delete + +#define FML_DISALLOW_ASSIGN(TypeName) \ + TypeName& operator=(const TypeName&) = delete + +#define FML_DISALLOW_MOVE(TypeName) \ + TypeName(TypeName&&) = delete; \ + TypeName& operator=(TypeName&&) = delete + +#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&) = delete; \ + TypeName& operator=(const TypeName&) = delete + +#define FML_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName) \ + TypeName(const TypeName&) = delete; \ + TypeName(TypeName&&) = delete; \ + TypeName& operator=(const TypeName&) = delete; \ + TypeName& operator=(TypeName&&) = delete + +#define FML_DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ + TypeName() = delete; \ + FML_DISALLOW_COPY_ASSIGN_AND_MOVE(TypeName) + #endif // FLUTTER_FML_MACROS_H_ diff --git a/fml/mapping.h b/fml/mapping.h index 00e9685dd6b0c..1f10975906fb8 100644 --- a/fml/mapping.h +++ b/fml/mapping.h @@ -10,8 +10,8 @@ #include #include "flutter/fml//unique_fd.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/macros.h" namespace fml { @@ -26,7 +26,7 @@ class Mapping { virtual const uint8_t* GetMapping() const = 0; private: - FXL_DISALLOW_COPY_AND_ASSIGN(Mapping); + FML_DISALLOW_COPY_AND_ASSIGN(Mapping); }; bool PlatformHasResourcesBundle(); @@ -53,7 +53,7 @@ class FileMapping : public Mapping { fml::UniqueFD mapping_handle_; #endif - FXL_DISALLOW_COPY_AND_ASSIGN(FileMapping); + FML_DISALLOW_COPY_AND_ASSIGN(FileMapping); }; class DataMapping : public Mapping { @@ -69,7 +69,7 @@ class DataMapping : public Mapping { private: std::vector data_; - FXL_DISALLOW_COPY_AND_ASSIGN(DataMapping); + FML_DISALLOW_COPY_AND_ASSIGN(DataMapping); }; } // namespace fml diff --git a/fml/memory/ref_counted.h b/fml/memory/ref_counted.h new file mode 100644 index 0000000000000..4dc6fc5ee1456 --- /dev/null +++ b/fml/memory/ref_counted.h @@ -0,0 +1,136 @@ +// Copyright 2016 The Fuchsia 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()| *may* be made private (e.g., to avoid accidental deletion of objects +// while there are still references to them), |Foo| should friend +// |RefCountedThreadSafe|; use |FML_FRIEND_REF_COUNTED_THREAD_SAFE()| for +// this: +// +// class Foo : public RefCountedThreadSafe { +// ... +// 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 { +// ... +// public: +// inline static RefPtr Create() { return AdoptRef(new Foo()); } +// ... +// private: +// Foo(); +// ... +// }; +// +// Or, to allow |MakeRefCounted()| to be used, use +// |FML_FRIEND_MAKE_REF_COUNTED()|: +// +// class Foo : public RefCountedThreadSafe { +// ... +// 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 +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(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 + friend RefPtr 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 + +// If you want to keep your constructor(s) private and still want to use +// |MakeRefCounted()|, use this. (See the example above +// |RefCountedThreadSafe|.) +#define FML_FRIEND_MAKE_REF_COUNTED(T) \ + friend class ::fml::internal::MakeRefCountedHelper + +} // namespace fml + +#endif // FLUTTER_FML_MEMORY_REF_COUNTED_H_ diff --git a/fml/memory/ref_counted_internal.h b/fml/memory/ref_counted_internal.h new file mode 100644 index 0000000000000..bbe037d47c427 --- /dev/null +++ b/fml/memory/ref_counted_internal.h @@ -0,0 +1,107 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Internal implementation details for ref_counted.h. + +#ifndef FLUTTER_FML_MEMORY_REF_COUNTED_INTERNAL_H_ +#define FLUTTER_FML_MEMORY_REF_COUNTED_INTERNAL_H_ + +#include + +#include "flutter/fml/macros.h" +#include "lib/fxl/logging.h" + +namespace fml { +namespace internal { + +// See ref_counted.h for comments on the public methods. +class RefCountedThreadSafeBase { + public: + void AddRef() const { +#ifndef NDEBUG + FXL_DCHECK(!adoption_required_); + FXL_DCHECK(!destruction_started_); +#endif + ref_count_.fetch_add(1u, std::memory_order_relaxed); + } + + bool HasOneRef() const { + return ref_count_.load(std::memory_order_acquire) == 1u; + } + + void AssertHasOneRef() const { FXL_DCHECK(HasOneRef()); } + + protected: + RefCountedThreadSafeBase(); + ~RefCountedThreadSafeBase(); + + // Returns true if the object should self-delete. + bool Release() const { +#ifndef NDEBUG + FXL_DCHECK(!adoption_required_); + FXL_DCHECK(!destruction_started_); +#endif + FXL_DCHECK(ref_count_.load(std::memory_order_acquire) != 0u); + // TODO(vtl): We could add the following: + // if (ref_count_.load(std::memory_order_relaxed) == 1u) { + // #ifndef NDEBUG + // destruction_started_= true; + // #endif + // return true; + // } + // This would be correct. On ARM (an Nexus 4), in *single-threaded* tests, + // this seems to make the destruction case marginally faster (barely + // measurable), and while the non-destruction case remains about the same + // (possibly marginally slower, but my measurements aren't good enough to + // have any confidence in that). I should try multithreaded/multicore tests. + if (ref_count_.fetch_sub(1u, std::memory_order_release) == 1u) { + std::atomic_thread_fence(std::memory_order_acquire); +#ifndef NDEBUG + destruction_started_ = true; +#endif + return true; + } + return false; + } + +#ifndef NDEBUG + void Adopt() { + FXL_DCHECK(adoption_required_); + adoption_required_ = false; + } +#endif + + private: + mutable std::atomic_uint_fast32_t ref_count_; + +#ifndef NDEBUG + mutable bool adoption_required_; + mutable bool destruction_started_; +#endif + + FML_DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafeBase); +}; + +inline RefCountedThreadSafeBase::RefCountedThreadSafeBase() + : ref_count_(1u) +#ifndef NDEBUG + , + adoption_required_(true), + destruction_started_(false) +#endif +{ +} + +inline RefCountedThreadSafeBase::~RefCountedThreadSafeBase() { +#ifndef NDEBUG + FXL_DCHECK(!adoption_required_); + // Should only be destroyed as a result of |Release()|. + FXL_DCHECK(destruction_started_); +#endif +} + +} // namespace internal +} // namespace fml + +#endif // FLUTTER_FML_MEMORY_REF_COUNTED_INTERNAL_H_ diff --git a/fml/memory/ref_counted_unittest.cc b/fml/memory/ref_counted_unittest.cc new file mode 100644 index 0000000000000..40b7bd095d412 --- /dev/null +++ b/fml/memory/ref_counted_unittest.cc @@ -0,0 +1,607 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file tests both ref_counted.h and ref_ptr.h (which the former includes). +// TODO(vtl): Possibly we could separate these tests out better, since a lot of +// it is actually testing |RefPtr|. + +#include "flutter/fml/memory/ref_counted.h" + +#include "flutter/fml/macros.h" +#include "gtest/gtest.h" + +#if defined(__clang__) +#define ALLOW_PESSIMIZING_MOVE(code_line) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wpessimizing-move\"") code_line; \ + _Pragma("clang diagnostic pop") +#else +#define ALLOW_PESSIMIZING_MOVE(code_line) code_line; +#endif + +#if defined(__clang__) +#define ALLOW_SELF_MOVE(code_line) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wself-move\"") code_line; \ + _Pragma("clang diagnostic pop") +#else +#define ALLOW_SELF_MOVE(code_line) code_line; +#endif + +namespace fml { +namespace { + +class MyClass : public RefCountedThreadSafe { + protected: + MyClass(MyClass** created, bool* was_destroyed) + : was_destroyed_(was_destroyed) { + if (created) + *created = this; + } + virtual ~MyClass() { + if (was_destroyed_) + *was_destroyed_ = true; + } + + private: + FML_FRIEND_REF_COUNTED_THREAD_SAFE(MyClass); + FML_FRIEND_MAKE_REF_COUNTED(MyClass); + + bool* was_destroyed_; + + FML_DISALLOW_COPY_AND_ASSIGN(MyClass); +}; + +class MySubclass final : public MyClass { + private: + FML_FRIEND_REF_COUNTED_THREAD_SAFE(MySubclass); + FML_FRIEND_MAKE_REF_COUNTED(MySubclass); + + MySubclass(MySubclass** created, bool* was_destroyed) + : MyClass(nullptr, was_destroyed) { + if (created) + *created = this; + } + ~MySubclass() override {} + + FML_DISALLOW_COPY_AND_ASSIGN(MySubclass); +}; + +TEST(RefCountedTest, Constructors) { + bool was_destroyed; + + { + // Default. + RefPtr r; + EXPECT_TRUE(r.get() == nullptr); + EXPECT_FALSE(r); + } + + { + // Nullptr. + RefPtr r(nullptr); + EXPECT_TRUE(r.get() == nullptr); + EXPECT_FALSE(r); + } + + { + MyClass* created = nullptr; + was_destroyed = false; + // Adopt, then RVO. + RefPtr r(MakeRefCounted(&created, &was_destroyed)); + EXPECT_TRUE(created); + EXPECT_EQ(created, r.get()); + EXPECT_TRUE(r); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MyClass* created = nullptr; + was_destroyed = false; + // Adopt, then move. + ALLOW_PESSIMIZING_MOVE(RefPtr r( + std::move(MakeRefCounted(&created, &was_destroyed)))) + EXPECT_TRUE(created); + EXPECT_EQ(created, r.get()); + EXPECT_TRUE(r); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MyClass* created = nullptr; + was_destroyed = false; + RefPtr r1(MakeRefCounted(&created, &was_destroyed)); + // Copy. + RefPtr r2(r1); + EXPECT_TRUE(created); + EXPECT_EQ(created, r1.get()); + EXPECT_EQ(created, r2.get()); + EXPECT_TRUE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MyClass* created = nullptr; + was_destroyed = false; + RefPtr r1(MakeRefCounted(&created, &was_destroyed)); + // From raw pointer. + RefPtr r2(created); + EXPECT_TRUE(created); + EXPECT_EQ(created, r1.get()); + EXPECT_EQ(created, r2.get()); + EXPECT_TRUE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MySubclass* created = nullptr; + was_destroyed = false; + // Adopt, then "move". + RefPtr r(MakeRefCounted(&created, &was_destroyed)); + EXPECT_TRUE(created); + EXPECT_EQ(static_cast(created), r.get()); + EXPECT_TRUE(r); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MySubclass* created = nullptr; + was_destroyed = false; + // Adopt, then "move". + ALLOW_PESSIMIZING_MOVE(RefPtr r( + std::move(MakeRefCounted(&created, &was_destroyed)))) + EXPECT_TRUE(created); + EXPECT_EQ(static_cast(created), r.get()); + EXPECT_TRUE(r); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MySubclass* created = nullptr; + was_destroyed = false; + RefPtr r1(MakeRefCounted(&created, &was_destroyed)); + // "Copy". + RefPtr r2(r1); + EXPECT_TRUE(created); + EXPECT_EQ(static_cast(created), r1.get()); + EXPECT_EQ(static_cast(created), r2.get()); + EXPECT_TRUE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MySubclass* created = nullptr; + was_destroyed = false; + RefPtr r1(MakeRefCounted(&created, &was_destroyed)); + // From raw pointer. + RefPtr r2(created); + EXPECT_TRUE(created); + EXPECT_EQ(static_cast(created), r1.get()); + EXPECT_EQ(static_cast(created), r2.get()); + EXPECT_TRUE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); +} + +TEST(RefCountedTest, NullAssignmentToNull) { + RefPtr r1; + // No-op null assignment using |nullptr|. + r1 = nullptr; + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_FALSE(r1); + + RefPtr r2; + // No-op null assignment using copy constructor. + r1 = r2; + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_TRUE(r2.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_FALSE(r2); + + // No-op null assignment using move constructor. + r1 = std::move(r2); + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_TRUE(r2.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_FALSE(r2); + + RefPtr r3; + // No-op null assignment using "copy" constructor. + r1 = r3; + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_TRUE(r3.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_FALSE(r3); + + // No-op null assignment using "move" constructor. + r1 = std::move(r3); + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_TRUE(r3.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_FALSE(r3); +} + +TEST(RefCountedTest, NonNullAssignmentToNull) { + bool was_destroyed; + + { + MyClass* created = nullptr; + was_destroyed = false; + RefPtr r1(MakeRefCounted(&created, &was_destroyed)); + RefPtr r2; + // Copy assignment (to null ref pointer). + r2 = r1; + EXPECT_EQ(created, r1.get()); + EXPECT_EQ(created, r2.get()); + EXPECT_TRUE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MyClass* created = nullptr; + was_destroyed = false; + RefPtr r1(MakeRefCounted(&created, &was_destroyed)); + RefPtr r2; + // Move assignment (to null ref pointer). + r2 = std::move(r1); + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_EQ(created, r2.get()); + EXPECT_FALSE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MySubclass* created = nullptr; + was_destroyed = false; + RefPtr r1(MakeRefCounted(&created, &was_destroyed)); + RefPtr r2; + // "Copy" assignment (to null ref pointer). + r2 = r1; + EXPECT_EQ(created, r1.get()); + EXPECT_EQ(static_cast(created), r2.get()); + EXPECT_TRUE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MySubclass* created = nullptr; + was_destroyed = false; + RefPtr r1(MakeRefCounted(&created, &was_destroyed)); + RefPtr r2; + // "Move" assignment (to null ref pointer). + r2 = std::move(r1); + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_EQ(static_cast(created), r2.get()); + EXPECT_FALSE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); +} + +TEST(RefCountedTest, NullAssignmentToNonNull) { + bool was_destroyed = false; + RefPtr r1(MakeRefCounted(nullptr, &was_destroyed)); + // Null assignment (to non-null ref pointer) using |nullptr|. + r1 = nullptr; + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_TRUE(was_destroyed); + + was_destroyed = false; + r1 = MakeRefCounted(nullptr, &was_destroyed); + RefPtr r2; + // Null assignment (to non-null ref pointer) using copy constructor. + r1 = r2; + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_TRUE(r2.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_FALSE(r2); + EXPECT_TRUE(was_destroyed); + + was_destroyed = false; + r1 = MakeRefCounted(nullptr, &was_destroyed); + // Null assignment using move constructor. + r1 = std::move(r2); + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_TRUE(r2.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_FALSE(r2); + EXPECT_TRUE(was_destroyed); + + was_destroyed = false; + r1 = MakeRefCounted(nullptr, &was_destroyed); + RefPtr r3; + // Null assignment (to non-null ref pointer) using "copy" constructor. + r1 = r3; + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_TRUE(r3.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_FALSE(r3); + EXPECT_TRUE(was_destroyed); + + was_destroyed = false; + r1 = MakeRefCounted(nullptr, &was_destroyed); + // Null assignment (to non-null ref pointer) using "move" constructor. + r1 = std::move(r3); + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_TRUE(r3.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_FALSE(r3); + EXPECT_TRUE(was_destroyed); +} + +TEST(RefCountedTest, NonNullAssignmentToNonNull) { + bool was_destroyed1; + bool was_destroyed2; + + { + was_destroyed1 = false; + was_destroyed2 = false; + RefPtr r1(MakeRefCounted(nullptr, &was_destroyed1)); + RefPtr r2(MakeRefCounted(nullptr, &was_destroyed2)); + // Copy assignment (to non-null ref pointer). + r2 = r1; + EXPECT_EQ(r1.get(), r2.get()); + EXPECT_TRUE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed1); + EXPECT_TRUE(was_destroyed2); + } + EXPECT_TRUE(was_destroyed1); + + { + was_destroyed1 = false; + was_destroyed2 = false; + RefPtr r1(MakeRefCounted(nullptr, &was_destroyed1)); + RefPtr r2(MakeRefCounted(nullptr, &was_destroyed2)); + // Move assignment (to non-null ref pointer). + r2 = std::move(r1); + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_FALSE(r2.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed1); + EXPECT_TRUE(was_destroyed2); + } + EXPECT_TRUE(was_destroyed1); + + { + was_destroyed1 = false; + was_destroyed2 = false; + RefPtr r1(MakeRefCounted(nullptr, &was_destroyed1)); + RefPtr r2(MakeRefCounted(nullptr, &was_destroyed2)); + // "Copy" assignment (to non-null ref pointer). + r2 = r1; + EXPECT_EQ(r1.get(), r2.get()); + EXPECT_TRUE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed1); + EXPECT_TRUE(was_destroyed2); + } + EXPECT_TRUE(was_destroyed1); + + { + was_destroyed1 = false; + was_destroyed2 = false; + RefPtr r1(MakeRefCounted(nullptr, &was_destroyed1)); + RefPtr r2(MakeRefCounted(nullptr, &was_destroyed2)); + // Move assignment (to non-null ref pointer). + r2 = std::move(r1); + EXPECT_TRUE(r1.get() == nullptr); + EXPECT_FALSE(r2.get() == nullptr); + EXPECT_FALSE(r1); + EXPECT_TRUE(r2); + EXPECT_FALSE(was_destroyed1); + EXPECT_TRUE(was_destroyed2); + } + EXPECT_TRUE(was_destroyed1); +} + +TEST(RefCountedTest, SelfAssignment) { + bool was_destroyed; + + { + MyClass* created = nullptr; + was_destroyed = false; + RefPtr r(MakeRefCounted(&created, &was_destroyed)); + // Copy. + r = r; + EXPECT_EQ(created, r.get()); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); + + { + MyClass* created = nullptr; + was_destroyed = false; + RefPtr r(MakeRefCounted(&created, &was_destroyed)); + // Move. + ALLOW_SELF_MOVE(r = std::move(r)) + EXPECT_EQ(created, r.get()); + EXPECT_FALSE(was_destroyed); + } + EXPECT_TRUE(was_destroyed); +} + +TEST(RefCountedTest, Swap) { + MyClass* created1 = nullptr; + bool was_destroyed1 = false; + RefPtr r1(MakeRefCounted(&created1, &was_destroyed1)); + EXPECT_TRUE(created1); + EXPECT_EQ(created1, r1.get()); + + MyClass* created2 = nullptr; + bool was_destroyed2 = false; + RefPtr r2(MakeRefCounted(&created2, &was_destroyed2)); + EXPECT_TRUE(created2); + EXPECT_EQ(created2, r2.get()); + EXPECT_NE(created1, created2); + + r1.swap(r2); + EXPECT_EQ(created2, r1.get()); + EXPECT_EQ(created1, r2.get()); +} + +TEST(RefCountedTest, GetAndDereferenceOperators) { + // Note: We check here that .get(), operator*, and operator-> are const, but + // return non-const pointers/refs. + + MyClass* created = nullptr; + const RefPtr r(MakeRefCounted(&created, nullptr)); + MyClass* ptr = r.get(); // Assign to non-const pointer. + EXPECT_EQ(created, ptr); + ptr = r.operator->(); // Assign to non-const pointer. + EXPECT_EQ(created, ptr); + MyClass& ref = *r; // "Assign" to non-const reference. + EXPECT_EQ(created, &ref); +} + +// You can manually call |AddRef()| and |Release()| if you want. +TEST(RefCountedTest, AddRefRelease) { + MyClass* created = nullptr; + bool was_destroyed = false; + { + RefPtr r(MakeRefCounted(&created, &was_destroyed)); + EXPECT_EQ(created, r.get()); + created->AddRef(); + } + EXPECT_FALSE(was_destroyed); + created->Release(); + EXPECT_TRUE(was_destroyed); +} + +TEST(RefCountedTest, Mix) { + MySubclass* created = nullptr; + bool was_destroyed = false; + RefPtr r1(MakeRefCounted(&created, &was_destroyed)); + ASSERT_FALSE(was_destroyed); + EXPECT_TRUE(created->HasOneRef()); + created->AssertHasOneRef(); + + RefPtr r2 = r1; + ASSERT_FALSE(was_destroyed); + EXPECT_FALSE(created->HasOneRef()); + + r1 = nullptr; + ASSERT_FALSE(was_destroyed); + created->AssertHasOneRef(); + + { + RefPtr r3 = r2; + EXPECT_FALSE(created->HasOneRef()); + { + RefPtr r4(r3); + r2 = nullptr; + ASSERT_FALSE(was_destroyed); + EXPECT_FALSE(created->HasOneRef()); + } + ASSERT_FALSE(was_destroyed); + EXPECT_TRUE(created->HasOneRef()); + created->AssertHasOneRef(); + + r1 = RefPtr(static_cast(r3.get())); + ASSERT_FALSE(was_destroyed); + EXPECT_FALSE(created->HasOneRef()); + } + ASSERT_FALSE(was_destroyed); + EXPECT_TRUE(created->HasOneRef()); + created->AssertHasOneRef(); + + EXPECT_EQ(created, r1.get()); + + r1 = nullptr; + EXPECT_TRUE(was_destroyed); +} + +class MyPublicClass : public RefCountedThreadSafe { + public: + // Overloaded constructors work with |MakeRefCounted()|. + MyPublicClass() : has_num_(false), num_(0) {} + explicit MyPublicClass(int num) : has_num_(true), num_(num) {} + + ~MyPublicClass() {} + + bool has_num() const { return has_num_; } + int num() const { return num_; } + + private: + bool has_num_; + int num_; + + FML_DISALLOW_COPY_AND_ASSIGN(MyPublicClass); +}; + +// You can also just keep constructors and destructors public. Make sure that +// works (mostly that it compiles). +TEST(RefCountedTest, PublicCtorAndDtor) { + RefPtr r1 = MakeRefCounted(); + ASSERT_TRUE(r1); + EXPECT_FALSE(r1->has_num()); + + RefPtr r2 = MakeRefCounted(123); + ASSERT_TRUE(r2); + EXPECT_TRUE(r2->has_num()); + EXPECT_EQ(123, r2->num()); + EXPECT_NE(r1.get(), r2.get()); + + r1 = r2; + EXPECT_TRUE(r1->has_num()); + EXPECT_EQ(123, r1->num()); + EXPECT_EQ(r1.get(), r2.get()); + + r2 = nullptr; + EXPECT_FALSE(r2); + EXPECT_TRUE(r1->has_num()); + EXPECT_EQ(123, r1->num()); + + r1 = nullptr; + EXPECT_FALSE(r1); +} + +// The danger with having a public constructor or destructor is that certain +// things will compile. You should get some protection by assertions in Debug +// builds. +#ifndef NDEBUG +TEST(RefCountedTest, DebugChecks) { + { + MyPublicClass* p = new MyPublicClass(); + EXPECT_DEATH_IF_SUPPORTED(delete p, "!adoption_required_"); + } + + { + MyPublicClass* p = new MyPublicClass(); + EXPECT_DEATH_IF_SUPPORTED(RefPtr r(p), + "!adoption_required_"); + } + + { + RefPtr r(MakeRefCounted()); + EXPECT_DEATH_IF_SUPPORTED(delete r.get(), "destruction_started_"); + } +} +#endif + +// TODO(vtl): Add (threaded) stress tests. + +} // namespace +} // namespace fml diff --git a/fml/memory/ref_ptr.h b/fml/memory/ref_ptr.h new file mode 100644 index 0000000000000..098ea40920d68 --- /dev/null +++ b/fml/memory/ref_ptr.h @@ -0,0 +1,250 @@ +// Copyright 2016 The Fuchsia 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 smart pointer class for intrusively reference-counted objects. + +#ifndef FLUTTER_FML_MEMORY_REF_PTR_H_ +#define FLUTTER_FML_MEMORY_REF_PTR_H_ + +#include + +#include +#include + +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/ref_ptr_internal.h" +#include "lib/fxl/logging.h" + +namespace fml { + +// A smart pointer class for intrusively reference-counted objects (e.g., those +// subclassing |RefCountedThreadSafe| -- see ref_counted.h). +// +// Such objects require *adoption* to obtain the first |RefPtr|, which is +// accomplished using |AdoptRef| (see below). (This is due to such objects being +// constructed with a reference count of 1. The adoption requirement is +// enforced, at least in Debug builds, by assertions.) +// +// E.g., if |Foo| is an intrusively reference-counted class: +// +// // The |AdoptRef| may be put in a static factory method (e.g., if |Foo|'s +// // constructor is private). +// RefPtr my_foo_ptr(AdoptRef(new Foo())); +// +// // Now OK, since "my Foo" has been adopted ... +// RefPtr another_ptr_to_my_foo(my_foo_ptr.get()); +// +// // ... though this would preferable in this situation. +// RefPtr yet_another_ptr_to_my_foo(my_foo_ptr); +// +// Unlike Chromium's |scoped_refptr|, |RefPtr| is only explicitly constructible +// from a plain pointer (and not assignable). It is however implicitly +// constructible from |nullptr|. So: +// +// RefPtr foo(plain_ptr_to_adopted_foo); // OK. +// foo = plain_ptr_to_adopted_foo; // Not OK (doesn't compile). +// foo = RefPtr(plain_ptr_to_adopted_foo); // OK. +// foo = nullptr; // OK. +// +// And if we have |void MyFunction(RefPtr foo)|, calling it using +// |MyFunction(nullptr)| is also valid. +// +// Implementation note: For copy/move constructors/operator=s, we often have +// templated versions, so that the operation can be done on a |RefPtr|, where +// |U| is a subclass of |T|. However, we also have non-templated versions with +// |U = T|, since the templated versions don't count as copy/move +// constructors/operator=s for the purposes of causing the default copy +// constructor/operator= to be deleted. E.g., if we didn't declare any +// non-templated versions, we'd get the default copy constructor/operator= (we'd +// only not get the default move constructor/operator= by virtue of having a +// destructor)! (In fact, it'd suffice to only declare a non-templated move +// constructor or move operator=, which would cause the copy +// constructor/operator= to be deleted, but for clarity we include explicit +// non-templated versions of everything.) +template +class RefPtr final { + public: + RefPtr() : ptr_(nullptr) {} + RefPtr(std::nullptr_t) : ptr_(nullptr) {} + + // Explicit constructor from a plain pointer (to an object that must have + // already been adopted). (Note that in |T::T()|, references to |this| cannot + // be taken, since the object being constructed will not have been adopted + // yet.) + template + explicit RefPtr(U* p) : ptr_(p) { + if (ptr_) + ptr_->AddRef(); + } + + // Copy constructor. + RefPtr(const RefPtr& r) : ptr_(r.ptr_) { + if (ptr_) + ptr_->AddRef(); + } + + template + RefPtr(const RefPtr& r) : ptr_(r.ptr_) { + if (ptr_) + ptr_->AddRef(); + } + + // Move constructor. + RefPtr(RefPtr&& r) : ptr_(r.ptr_) { r.ptr_ = nullptr; } + + template + RefPtr(RefPtr&& r) : ptr_(r.ptr_) { + r.ptr_ = nullptr; + } + + // Destructor. + ~RefPtr() { + if (ptr_) + ptr_->Release(); + } + + T* get() const { return ptr_; } + + T& operator*() const { + FXL_DCHECK(ptr_); + return *ptr_; + } + + T* operator->() const { + FXL_DCHECK(ptr_); + return ptr_; + } + + // Copy assignment. + RefPtr& operator=(const RefPtr& r) { + // Call |AddRef()| first so self-assignments work. + if (r.ptr_) + r.ptr_->AddRef(); + T* old_ptr = ptr_; + ptr_ = r.ptr_; + if (old_ptr) + old_ptr->Release(); + return *this; + } + + template + RefPtr& operator=(const RefPtr& r) { + // Call |AddRef()| first so self-assignments work. + if (r.ptr_) + r.ptr_->AddRef(); + T* old_ptr = ptr_; + ptr_ = r.ptr_; + if (old_ptr) + old_ptr->Release(); + return *this; + } + + // Move assignment. + // Note: Like |std::shared_ptr|, we support self-move and move assignment is + // equivalent to |RefPtr(std::move(r)).swap(*this)|. + RefPtr& operator=(RefPtr&& r) { + RefPtr(std::move(r)).swap(*this); + return *this; + } + + template + RefPtr& operator=(RefPtr&& r) { + RefPtr(std::move(r)).swap(*this); + return *this; + } + + void swap(RefPtr& r) { + T* p = ptr_; + ptr_ = r.ptr_; + r.ptr_ = p; + } + + // Returns a new |RefPtr| with the same contents as this pointer. Useful + // when a function takes a |RefPtr&&| argument and the caller wants to + // retain its reference (rather than moving it). + RefPtr Clone() const { return *this; } + + explicit operator bool() const { return !!ptr_; } + + template + bool operator==(const RefPtr& rhs) const { + return ptr_ == rhs.ptr_; + } + + template + bool operator!=(const RefPtr& rhs) const { + return !operator==(rhs); + } + + template + bool operator<(const RefPtr& rhs) const { + return ptr_ < rhs.ptr_; + } + + private: + template + friend class RefPtr; + + friend RefPtr AdoptRef(T*); + + enum AdoptTag { ADOPT }; + RefPtr(T* ptr, AdoptTag) : ptr_(ptr) { FXL_DCHECK(ptr_); } + + T* ptr_; +}; + +// Adopts a newly-created |T|. Typically used in a static factory method, like: +// +// // static +// RefPtr Foo::Create() { +// return AdoptRef(new Foo()); +// } +template +inline RefPtr AdoptRef(T* ptr) { +#ifndef NDEBUG + ptr->Adopt(); +#endif + return RefPtr(ptr, RefPtr::ADOPT); +} + +// Constructs a |RefPtr| from a plain pointer (to an object that must +// have already been adoped). Avoids having to spell out the full type name. +// +// Foo* foo = ...; +// auto foo_ref = Ref(foo); +// +// (|foo_ref| will be of type |RefPtr|.) +template +inline RefPtr Ref(T* ptr) { + return RefPtr(ptr); +} + +// Creates an intrusively reference counted |T|, producing a |RefPtr| (and +// performing the required adoption). Use like: +// +// auto my_foo = MakeRefCounted(ctor_arg1, ctor_arg2); +// +// (|my_foo| will be of type |RefPtr|.) +template +RefPtr MakeRefCounted(Args&&... args) { + return internal::MakeRefCountedHelper::MakeRefCounted( + std::forward(args)...); +} + +} // namespace fml + +// Inject custom std::hash<> function object for |RefPtr|. +namespace std { +template +struct hash> { + using argument_type = fml::RefPtr; + using result_type = std::size_t; + + result_type operator()(const argument_type& ptr) const { + return std::hash()(ptr.get()); + } +}; +} // namespace std + +#endif // FLUTTER_FML_MEMORY_REF_PTR_H_ diff --git a/fml/memory/ref_ptr_internal.h b/fml/memory/ref_ptr_internal.h new file mode 100644 index 0000000000000..a72488cad6a86 --- /dev/null +++ b/fml/memory/ref_ptr_internal.h @@ -0,0 +1,38 @@ +// Copyright 2016 The Fuchsia 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_MEMORY_REF_PTR_INTERNAL_H_ +#define FLUTTER_FML_MEMORY_REF_PTR_INTERNAL_H_ + +#include + +#include "flutter/fml/macros.h" + +namespace fml { + +template +class RefPtr; + +template +RefPtr AdoptRef(T* ptr); + +namespace internal { + +// This is a wrapper class that can be friended for a particular |T|, if you +// want to make |T|'s constructor private, but still use |MakeRefCounted()| +// (below). (You can't friend partial specializations.) See |MakeRefCounted()| +// and |FML_FRIEND_MAKE_REF_COUNTED()|. +template +class MakeRefCountedHelper final { + public: + template + static RefPtr MakeRefCounted(Args&&... args) { + return AdoptRef(new T(std::forward(args)...)); + } +}; + +} // namespace internal +} // namespace fml + +#endif // FLUTTER_FML_MEMORY_REF_PTR_INTERNAL_H_ diff --git a/fml/memory/thread_checker.h b/fml/memory/thread_checker.h index f22e9d1cfaf06..23e55f3e4d546 100644 --- a/fml/memory/thread_checker.h +++ b/fml/memory/thread_checker.h @@ -8,7 +8,7 @@ #ifndef FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ #define FLUTTER_FML_MEMORY_THREAD_CHECKER_H_ -#include "lib/fxl/build_config.h" +#include "flutter/fml/build_config.h" #if defined(OS_WIN) #include @@ -16,8 +16,8 @@ #include #endif +#include "flutter/fml/macros.h" #include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" namespace fml { diff --git a/fml/memory/weak_ptr.h b/fml/memory/weak_ptr.h index 946ab645e0a0d..cf9485452e59a 100644 --- a/fml/memory/weak_ptr.h +++ b/fml/memory/weak_ptr.h @@ -10,10 +10,10 @@ #include +#include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr_internal.h" #include "lib/fxl/logging.h" -#include "lib/fxl/memory/ref_counted.h" namespace fml { @@ -103,12 +103,12 @@ class WeakPtr { friend class WeakPtrFactory; explicit WeakPtr(T* ptr, - fxl::RefPtr&& flag, + fml::RefPtr&& flag, DebugThreadChecker checker) : ptr_(ptr), flag_(std::move(flag)), checker_(checker) {} T* ptr_; - fxl::RefPtr flag_; + fml::RefPtr flag_; DebugThreadChecker checker_; // Copy/move construction/assignment supported. @@ -160,7 +160,7 @@ template class WeakPtrFactory { public: explicit WeakPtrFactory(T* ptr) - : ptr_(ptr), flag_(fxl::MakeRefCounted()) { + : ptr_(ptr), flag_(fml::MakeRefCounted()) { FXL_DCHECK(ptr_); } @@ -179,10 +179,10 @@ class WeakPtrFactory { // Note: See weak_ptr_internal.h for an explanation of why we store the // pointer here, instead of in the "flag". T* const ptr_; - fxl::RefPtr flag_; + fml::RefPtr flag_; DebugThreadChecker checker_; - FXL_DISALLOW_COPY_AND_ASSIGN(WeakPtrFactory); + FML_DISALLOW_COPY_AND_ASSIGN(WeakPtrFactory); }; } // namespace fml diff --git a/fml/memory/weak_ptr_internal.h b/fml/memory/weak_ptr_internal.h index 570bd90ddf20e..dca47f1a61295 100644 --- a/fml/memory/weak_ptr_internal.h +++ b/fml/memory/weak_ptr_internal.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_FML_MEMORY_WEAK_PTR_INTERNAL_H_ #define FLUTTER_FML_MEMORY_WEAK_PTR_INTERNAL_H_ -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/ref_counted.h" namespace fml { namespace internal { @@ -19,7 +19,7 @@ namespace internal { // This class in not thread-safe, though references may be released on any // thread (allowing weak pointers to be destroyed/reset/reassigned on any // thread). -class FXL_EXPORT WeakPtrFlag : public fxl::RefCountedThreadSafe { +class FXL_EXPORT WeakPtrFlag : public fml::RefCountedThreadSafe { public: WeakPtrFlag(); @@ -32,7 +32,7 @@ class FXL_EXPORT WeakPtrFlag : public fxl::RefCountedThreadSafe { private: bool is_valid_; - FXL_DISALLOW_COPY_AND_ASSIGN(WeakPtrFlag); + FML_DISALLOW_COPY_AND_ASSIGN(WeakPtrFlag); }; } // namespace internal diff --git a/fml/message_loop.h b/fml/message_loop.h index 3bfb1c40c6df7..9b2a28ccc4715 100644 --- a/fml/message_loop.h +++ b/fml/message_loop.h @@ -6,7 +6,6 @@ #define FLUTTER_FML_MESSAGE_LOOP_H_ #include "flutter/fml/macros.h" -#include "lib/fxl/macros.h" #include "lib/fxl/tasks/task_runner.h" namespace fml { @@ -52,7 +51,7 @@ class MessageLoop { fxl::RefPtr GetLoopImpl() const; - FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoop); + FML_DISALLOW_COPY_AND_ASSIGN(MessageLoop); }; } // namespace fml diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index df885f3792d5f..d5f8e4e17c2b7 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -9,8 +9,8 @@ #include #include +#include "flutter/fml/build_config.h" #include "flutter/fml/trace_event.h" -#include "lib/fxl/build_config.h" #if OS_MACOSX #include "flutter/fml/platform/darwin/message_loop_darwin.h" diff --git a/fml/message_loop_impl.h b/fml/message_loop_impl.h index 478cbd1f1a0be..9a513f238c7de 100644 --- a/fml/message_loop_impl.h +++ b/fml/message_loop_impl.h @@ -12,9 +12,9 @@ #include #include +#include "flutter/fml/macros.h" #include "flutter/fml/message_loop.h" #include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/fxl/time/time_point.h" @@ -81,7 +81,7 @@ class MessageLoopImpl : public fxl::RefCountedThreadSafe { void RunExpiredTasks(); - FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopImpl); + FML_DISALLOW_COPY_AND_ASSIGN(MessageLoopImpl); }; } // namespace fml diff --git a/fml/native_library.h b/fml/native_library.h index 7e48ed6d3a3ff..a52d01a3e09ad 100644 --- a/fml/native_library.h +++ b/fml/native_library.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_NATIVE_LIBRARY_H_ #define FLUTTER_FML_NATIVE_LIBRARY_H_ -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/fxl/memory/ref_ptr.h" @@ -42,7 +42,7 @@ class NativeLibrary : public fxl::RefCountedThreadSafe { Handle GetHandle() const; - FXL_DISALLOW_COPY_AND_ASSIGN(NativeLibrary); + FML_DISALLOW_COPY_AND_ASSIGN(NativeLibrary); FRIEND_REF_COUNTED_THREAD_SAFE(NativeLibrary); FRIEND_MAKE_REF_COUNTED(NativeLibrary); }; diff --git a/fml/paths.cc b/fml/paths.cc index 9b06b6847f415..20c94e62fef4d 100644 --- a/fml/paths.cc +++ b/fml/paths.cc @@ -4,7 +4,7 @@ #include "flutter/fml/paths.h" -#include "lib/fxl/build_config.h" +#include "flutter/fml/build_config.h" namespace fml { namespace paths { diff --git a/fml/platform/android/jni_util.h b/fml/platform/android/jni_util.h index f4ecfc266d271..bfd58ae0cdf20 100644 --- a/fml/platform/android/jni_util.h +++ b/fml/platform/android/jni_util.h @@ -9,8 +9,8 @@ #include +#include "flutter/fml/macros.h" #include "flutter/fml/platform/android/scoped_java_ref.h" -#include "lib/fxl/macros.h" namespace fml { namespace jni { diff --git a/fml/platform/android/message_loop_android.cc b/fml/platform/android/message_loop_android.cc index 0004d1e0429db..0720c5ef8a28b 100644 --- a/fml/platform/android/message_loop_android.cc +++ b/fml/platform/android/message_loop_android.cc @@ -8,7 +8,6 @@ #include #include "flutter/fml/platform/linux/timerfd.h" -#include "lib/fxl/files/eintr_wrapper.h" namespace fml { diff --git a/fml/platform/android/message_loop_android.h b/fml/platform/android/message_loop_android.h index 19c1eafe79845..3467f41f27098 100644 --- a/fml/platform/android/message_loop_android.h +++ b/fml/platform/android/message_loop_android.h @@ -9,9 +9,9 @@ #include +#include "flutter/fml/macros.h" #include "flutter/fml/message_loop_impl.h" #include "flutter/fml/unique_fd.h" -#include "lib/fxl/macros.h" #include "lib/fxl/memory/unique_object.h" namespace fml { @@ -42,7 +42,7 @@ class MessageLoopAndroid : public MessageLoopImpl { FRIEND_MAKE_REF_COUNTED(MessageLoopAndroid); FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopAndroid); - FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopAndroid); + FML_DISALLOW_COPY_AND_ASSIGN(MessageLoopAndroid); }; } // namespace fml diff --git a/fml/platform/android/scoped_java_ref.h b/fml/platform/android/scoped_java_ref.h index f98aebf51d8de..5bc9f1019b8f2 100644 --- a/fml/platform/android/scoped_java_ref.h +++ b/fml/platform/android/scoped_java_ref.h @@ -8,7 +8,7 @@ #include #include -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace fml { namespace jni { @@ -27,7 +27,7 @@ class ScopedJavaLocalFrame { // it's safe to cache the non-threadsafe JNIEnv* inside this object. JNIEnv* env_; - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedJavaLocalFrame); + FML_DISALLOW_COPY_AND_ASSIGN(ScopedJavaLocalFrame); }; // Forward declare the generic java reference template class. @@ -65,7 +65,7 @@ class JavaRef { private: jobject obj_; - FXL_DISALLOW_COPY_AND_ASSIGN(JavaRef); + FML_DISALLOW_COPY_AND_ASSIGN(JavaRef); }; // Generic base class for ScopedJavaLocalRef and ScopedJavaGlobalRef. Useful @@ -83,7 +83,7 @@ class JavaRef : public JavaRef { JavaRef(JNIEnv* env, T obj) : JavaRef(env, obj) {} private: - FXL_DISALLOW_COPY_AND_ASSIGN(JavaRef); + FML_DISALLOW_COPY_AND_ASSIGN(JavaRef); }; // Holds a local reference to a Java object. The local reference is scoped diff --git a/fml/platform/darwin/cf_utils.h b/fml/platform/darwin/cf_utils.h index b5a3d07441aa1..b8e64372e605c 100644 --- a/fml/platform/darwin/cf_utils.h +++ b/fml/platform/darwin/cf_utils.h @@ -7,7 +7,7 @@ #include -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace fml { @@ -43,7 +43,7 @@ class CFRef { private: T instance_; - FXL_DISALLOW_COPY_AND_ASSIGN(CFRef); + FML_DISALLOW_COPY_AND_ASSIGN(CFRef); }; } // namespace fml diff --git a/fml/platform/darwin/message_loop_darwin.h b/fml/platform/darwin/message_loop_darwin.h index 902aafd01291c..dde809860e24d 100644 --- a/fml/platform/darwin/message_loop_darwin.h +++ b/fml/platform/darwin/message_loop_darwin.h @@ -9,9 +9,9 @@ #include +#include "flutter/fml/macros.h" #include "flutter/fml/message_loop_impl.h" #include "flutter/fml/platform/darwin/cf_utils.h" -#include "lib/fxl/macros.h" namespace fml { @@ -35,7 +35,7 @@ class MessageLoopDarwin : public MessageLoopImpl { FRIEND_MAKE_REF_COUNTED(MessageLoopDarwin); FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopDarwin); - FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopDarwin); + FML_DISALLOW_COPY_AND_ASSIGN(MessageLoopDarwin); }; } // namespace fml diff --git a/fml/platform/darwin/platform_version.h b/fml/platform/darwin/platform_version.h index b92641655ed47..bec2ed7ed6346 100644 --- a/fml/platform/darwin/platform_version.h +++ b/fml/platform/darwin/platform_version.h @@ -6,7 +6,7 @@ #define FLUTTER_FML_PLATFORM_DARWIN_PLATFORM_VERSION_H_ #include -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace fml { diff --git a/fml/platform/darwin/resource_mapping_darwin.h b/fml/platform/darwin/resource_mapping_darwin.h index c3b939cea7c7d..4cbc158b900af 100644 --- a/fml/platform/darwin/resource_mapping_darwin.h +++ b/fml/platform/darwin/resource_mapping_darwin.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_ #define FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_ +#include "flutter/fml/macros.h" #include "flutter/fml/mapping.h" -#include "lib/fxl/macros.h" namespace fml { @@ -23,7 +23,7 @@ class ResourceMappingDarwin : public Mapping { private: FileMapping actual_; - FXL_DISALLOW_COPY_AND_ASSIGN(ResourceMappingDarwin); + FML_DISALLOW_COPY_AND_ASSIGN(ResourceMappingDarwin); }; } // namespace fml diff --git a/fml/platform/darwin/scoped_block.h b/fml/platform/darwin/scoped_block.h index e7a16e9d569ec..758bb0886da7c 100644 --- a/fml/platform/darwin/scoped_block.h +++ b/fml/platform/darwin/scoped_block.h @@ -7,7 +7,7 @@ #include -#include "lib/fxl/compiler_specific.h" +#include "flutter/fml/compiler_specific.h" namespace fml { @@ -72,7 +72,7 @@ class ScopedBlock { block_ = temp; } - B release() FXL_WARN_UNUSED_RESULT { + B release() FML_WARN_UNUSED_RESULT { B temp = block_; block_ = nullptr; return temp; diff --git a/fml/platform/darwin/scoped_nsobject.h b/fml/platform/darwin/scoped_nsobject.h index 91d60ae8f3697..525185fa6df0b 100644 --- a/fml/platform/darwin/scoped_nsobject.h +++ b/fml/platform/darwin/scoped_nsobject.h @@ -10,8 +10,8 @@ // singled out because it is most typically included from other header files. #import -#include "lib/fxl/compiler_specific.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/compiler_specific.h" +#include "flutter/fml/macros.h" @class NSAutoreleasePool; @@ -81,7 +81,7 @@ class scoped_nsprotocol { // scoped_nsprotocol<>::release() is like scoped_ptr<>::release. It is NOT a // wrapper for [object_ release]. To force a scoped_nsprotocol<> to call // [object_ release], use scoped_nsprotocol<>::reset(). - NST release() FXL_WARN_UNUSED_RESULT { + NST release() FML_WARN_UNUSED_RESULT { NST temp = object_; object_ = nil; return temp; @@ -155,7 +155,7 @@ template <> class scoped_nsobject { private: explicit scoped_nsobject(NSAutoreleasePool* object = nil); - FXL_DISALLOW_COPY_AND_ASSIGN(scoped_nsobject); + FML_DISALLOW_COPY_AND_ASSIGN(scoped_nsobject); }; } // namespace fml diff --git a/fml/platform/linux/message_loop_linux.cc b/fml/platform/linux/message_loop_linux.cc index e80e7f9d1495e..2868f137e5d71 100644 --- a/fml/platform/linux/message_loop_linux.cc +++ b/fml/platform/linux/message_loop_linux.cc @@ -7,15 +7,15 @@ #include #include +#include "flutter/fml/eintr_wrapper.h" #include "flutter/fml/platform/linux/timerfd.h" -#include "lib/fxl/files/eintr_wrapper.h" namespace fml { static constexpr int kClockType = CLOCK_MONOTONIC; MessageLoopLinux::MessageLoopLinux() - : epoll_fd_(HANDLE_EINTR(::epoll_create(1 /* unused */))), + : epoll_fd_(FML_HANDLE_EINTR(::epoll_create(1 /* unused */))), timer_fd_(::timerfd_create(kClockType, TFD_NONBLOCK | TFD_CLOEXEC)), running_(false) { FXL_CHECK(epoll_fd_.is_valid()); @@ -49,7 +49,7 @@ void MessageLoopLinux::Run() { while (running_) { struct epoll_event event = {}; - int epoll_result = HANDLE_EINTR( + int epoll_result = FML_HANDLE_EINTR( ::epoll_wait(epoll_fd_.get(), &event, 1, -1 /* timeout */)); // Errors are fatal. diff --git a/fml/platform/linux/message_loop_linux.h b/fml/platform/linux/message_loop_linux.h index ba5e902d4ac89..dc5b862da9aa2 100644 --- a/fml/platform/linux/message_loop_linux.h +++ b/fml/platform/linux/message_loop_linux.h @@ -7,9 +7,9 @@ #include +#include "flutter/fml/macros.h" #include "flutter/fml/message_loop_impl.h" #include "flutter/fml/unique_fd.h" -#include "lib/fxl/macros.h" namespace fml { @@ -35,7 +35,7 @@ class MessageLoopLinux : public MessageLoopImpl { FRIEND_MAKE_REF_COUNTED(MessageLoopLinux); FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopLinux); - FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopLinux); + FML_DISALLOW_COPY_AND_ASSIGN(MessageLoopLinux); }; } // namespace fml diff --git a/fml/platform/linux/timerfd.cc b/fml/platform/linux/timerfd.cc index 1aa6ebeb53aeb..871b963b5b601 100644 --- a/fml/platform/linux/timerfd.cc +++ b/fml/platform/linux/timerfd.cc @@ -7,7 +7,7 @@ #include #include -#include "lib/fxl/files/eintr_wrapper.h" +#include "flutter/fml/eintr_wrapper.h" #if FML_TIMERFD_AVAILABLE == 0 @@ -48,7 +48,7 @@ bool TimerRearm(int fd, fxl::TimePoint time_point) { bool TimerDrain(int fd) { // 8 bytes must be read from a signalled timer file descriptor when signalled. uint64_t fire_count = 0; - ssize_t size = HANDLE_EINTR(::read(fd, &fire_count, sizeof(uint64_t))); + ssize_t size = FML_HANDLE_EINTR(::read(fd, &fire_count, sizeof(uint64_t))); if (size != sizeof(uint64_t)) { return false; } diff --git a/fml/platform/posix/file_posix.cc b/fml/platform/posix/file_posix.cc index 028f49f4d183d..58167082ced10 100644 --- a/fml/platform/posix/file_posix.cc +++ b/fml/platform/posix/file_posix.cc @@ -8,7 +8,7 @@ #include #include -#include "lib/fxl/files/eintr_wrapper.h" +#include "flutter/fml/eintr_wrapper.h" namespace fml { @@ -47,11 +47,11 @@ fml::UniqueFD OpenFile(const fml::UniqueFD& base_directory, } return fml::UniqueFD{ - HANDLE_EINTR(::openat(base_directory.get(), path, flags))}; + FML_HANDLE_EINTR(::openat(base_directory.get(), path, flags))}; } fml::UniqueFD Duplicate(fml::UniqueFD::element_type descriptor) { - return fml::UniqueFD{HANDLE_EINTR(::dup(descriptor))}; + return fml::UniqueFD{FML_HANDLE_EINTR(::dup(descriptor))}; } bool IsDirectory(const fml::UniqueFD& directory) { diff --git a/fml/platform/posix/mapping_posix.cc b/fml/platform/posix/mapping_posix.cc index fc53d6a4f7fc9..b9f8fe5de98f0 100644 --- a/fml/platform/posix/mapping_posix.cc +++ b/fml/platform/posix/mapping_posix.cc @@ -11,9 +11,9 @@ #include +#include "flutter/fml/build_config.h" +#include "flutter/fml/eintr_wrapper.h" #include "flutter/fml/unique_fd.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/files/eintr_wrapper.h" #if OS_MACOSX @@ -41,8 +41,9 @@ std::unique_ptr GetResourceMapping(const std::string& resource_name) { } FileMapping::FileMapping(const std::string& path, bool executable) - : FileMapping(fml::UniqueFD{HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}, - executable) {} + : FileMapping( + fml::UniqueFD{FML_HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}, + executable) {} FileMapping::FileMapping(const fml::UniqueFD& handle, bool executable) : size_(0), mapping_(nullptr) { diff --git a/fml/platform/win/message_loop_win.h b/fml/platform/win/message_loop_win.h index 1b02ad6cc22d2..22836c68746b4 100644 --- a/fml/platform/win/message_loop_win.h +++ b/fml/platform/win/message_loop_win.h @@ -9,8 +9,8 @@ #include +#include "flutter/fml/macros.h" #include "flutter/fml/message_loop_impl.h" -#include "lib/fxl/macros.h" #include "lib/fxl/memory/unique_object.h" namespace fml { @@ -38,7 +38,7 @@ class MessageLoopWin : public MessageLoopImpl { FRIEND_MAKE_REF_COUNTED(MessageLoopWin); FRIEND_REF_COUNTED_THREAD_SAFE(MessageLoopWin); - FXL_DISALLOW_COPY_AND_ASSIGN(MessageLoopWin); + FML_DISALLOW_COPY_AND_ASSIGN(MessageLoopWin); }; } // namespace fml diff --git a/fml/task_runner.h b/fml/task_runner.h index 3b3d2de01639d..b4304ddd2fb17 100644 --- a/fml/task_runner.h +++ b/fml/task_runner.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FML_TASK_RUNNER_H_ #define FLUTTER_FML_TASK_RUNNER_H_ -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/fxl/tasks/task_runner.h" @@ -35,7 +35,7 @@ class TaskRunner final : public fxl::TaskRunner { FRIEND_MAKE_REF_COUNTED(TaskRunner); FRIEND_REF_COUNTED_THREAD_SAFE(TaskRunner); - FXL_DISALLOW_COPY_AND_ASSIGN(TaskRunner); + FML_DISALLOW_COPY_AND_ASSIGN(TaskRunner); }; } // namespace fml diff --git a/fml/thread.cc b/fml/thread.cc index de4ee6dd368a8..ea1060db03050 100644 --- a/fml/thread.cc +++ b/fml/thread.cc @@ -6,7 +6,7 @@ #include "flutter/fml/thread.h" -#include "lib/fxl/build_config.h" +#include "flutter/fml/build_config.h" #if defined(OS_WIN) #include diff --git a/fml/thread.h b/fml/thread.h index 542871f788845..494897413ef63 100644 --- a/fml/thread.h +++ b/fml/thread.h @@ -9,8 +9,8 @@ #include #include +#include "flutter/fml/macros.h" #include "flutter/fml/task_runner.h" -#include "lib/fxl/macros.h" namespace fml { @@ -31,7 +31,7 @@ class Thread { static void SetCurrentThreadName(const std::string& name); - FXL_DISALLOW_COPY_AND_ASSIGN(Thread); + FML_DISALLOW_COPY_AND_ASSIGN(Thread); }; } // namespace fml diff --git a/fml/thread_local.h b/fml/thread_local.h index c3c7295ef3e20..e450097abd6bb 100644 --- a/fml/thread_local.h +++ b/fml/thread_local.h @@ -7,9 +7,9 @@ #include -#include "lib/fxl/build_config.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/macros.h" #include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" #define FML_THREAD_LOCAL_PTHREADS OS_MACOSX || OS_LINUX || OS_ANDROID @@ -55,7 +55,7 @@ class ThreadLocal { ThreadLocalDestroyCallback destroy_; intptr_t value_; - FXL_DISALLOW_COPY_AND_ASSIGN(Box); + FML_DISALLOW_COPY_AND_ASSIGN(Box); }; static inline void ThreadLocalDestroy(void* value) { @@ -106,7 +106,7 @@ class ThreadLocal { pthread_key_t _key; ThreadLocalDestroyCallback destroy_; - FXL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal); + FML_DISALLOW_COPY_AND_ASSIGN(ThreadLocal); }; #else // FML_THREAD_LOCAL_PTHREADS @@ -144,7 +144,7 @@ class ThreadLocal { ThreadLocalDestroyCallback destroy_; intptr_t value_; - FXL_DISALLOW_COPY_AND_ASSIGN(ThreadLocal); + FML_DISALLOW_COPY_AND_ASSIGN(ThreadLocal); }; #endif // FML_THREAD_LOCAL_PTHREADS diff --git a/fml/trace_event.h b/fml/trace_event.h index 832d099ce38b0..775dea4e6b75e 100644 --- a/fml/trace_event.h +++ b/fml/trace_event.h @@ -9,7 +9,7 @@ #include #include -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #ifndef TRACE_EVENT_HIDE_MACROS @@ -115,7 +115,7 @@ class ScopedInstantEnd { private: const std::string label_; - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedInstantEnd); + FML_DISALLOW_COPY_AND_ASSIGN(ScopedInstantEnd); }; } // namespace tracing diff --git a/fml/unique_fd.cc b/fml/unique_fd.cc index bab79f7a9b743..90c3aaa21ef15 100644 --- a/fml/unique_fd.cc +++ b/fml/unique_fd.cc @@ -4,7 +4,7 @@ #include "flutter/fml/unique_fd.h" -#include "lib/fxl/files/eintr_wrapper.h" +#include "flutter/fml/eintr_wrapper.h" namespace fml { namespace internal { @@ -24,7 +24,7 @@ void UniqueFDTraits::Free(HANDLE fd) { namespace unix { void UniqueFDTraits::Free(int fd) { - IGNORE_EINTR(fd); + FML_IGNORE_EINTR(fd); } } // namespace unix diff --git a/fml/unique_fd.h b/fml/unique_fd.h index 9f2d796579d8c..48dd3544e43f5 100644 --- a/fml/unique_fd.h +++ b/fml/unique_fd.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_FML_UNIQUE_FD_H_ #define FLUTTER_FML_UNIQUE_FD_H_ +#include "flutter/fml/build_config.h" #include "flutter/fml/unique_object.h" -#include "lib/fxl/build_config.h" #if OS_WIN diff --git a/fml/unique_object.h b/fml/unique_object.h index e2487a53881a9..4feabe57d6e5a 100644 --- a/fml/unique_object.h +++ b/fml/unique_object.h @@ -7,9 +7,9 @@ #include -#include "lib/fxl/compiler_specific.h" +#include "flutter/fml/compiler_specific.h" +#include "flutter/fml/macros.h" #include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" namespace fml { @@ -78,7 +78,7 @@ class UniqueObject { // Release the object. The return value is the current object held by this // object. After this operation, this object will hold an invalid value, and // will not own the object any more. - T release() FXL_WARN_UNUSED_RESULT { + T release() FML_WARN_UNUSED_RESULT { T old_generic = data_.generic; data_.generic = Traits::InvalidValue(); return old_generic; @@ -114,7 +114,7 @@ class UniqueObject { Data data_; - FXL_DISALLOW_COPY_AND_ASSIGN(UniqueObject); + FML_DISALLOW_COPY_AND_ASSIGN(UniqueObject); }; template diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index b15c608425095..090275a17e7eb 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -10054,6 +10054,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: engine ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd +FILE: ../../../flutter/fml/build_config.h +FILE: ../../../flutter/fml/compiler_specific.h +FILE: ../../../flutter/fml/eintr_wrapper.h +FILE: ../../../flutter/fml/memory/ref_counted.h +FILE: ../../../flutter/fml/memory/ref_counted_internal.h +FILE: ../../../flutter/fml/memory/ref_counted_unittest.cc +FILE: ../../../flutter/fml/memory/ref_ptr.h +FILE: ../../../flutter/fml/memory/ref_ptr_internal.h FILE: ../../../flutter/fml/memory/thread_checker.h FILE: ../../../flutter/fml/memory/weak_ptr.h FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc From 29816a6607af3db2e02e4ceecb37134dbf276e39 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 23 Apr 2018 10:26:07 -0400 Subject: [PATCH 0152/1190] Roll src/third_party/skia/ 3d0e8507f..5209d7fce (14 commits) (#5061) https://skia.googlesource.com/skia.git/+log/3d0e8507face..5209d7fce35f $ git log 3d0e8507f..5209d7fce --date=short --no-merges --format='%ad %ae %s' 2018-04-20 bsalomon Fix starting location in GrRTC::drawOval when converting to GrShape 2018-04-20 bsalomon Analytic dashing of circles with single on/off intervals and butt caps. 2018-04-20 brianosman Fix argument names and documentation for SkMatrix44::set3x3() 2018-04-18 enne Reland "Add stub gpu workaround generators" 2018-04-20 robertphillips Add ability to dump opList info at flush-time 2018-04-20 benjaminwagner Fix Housekeeper-PerCommit-InfraTests 2018-04-20 scroggo Reduce threads used for DNG decodes on Android 2018-04-19 benjaminwagner Add SwiftShader Build jobs. 2018-04-19 benjaminwagner Add cmake_linux asset. 2018-04-20 egdaniel Add discard check when deciding if we should execute op list or not. 2018-04-20 robertphillips Remove another writePixels instance 2018-04-18 csmartdalton ccpr: Don't solve for cubic roots that are out of range 2018-04-19 benjaminwagner Add SwiftShader to DEPS. 2018-04-19 csmartdalton ccpr: Fix flatness and triangle-ness detection for conics Created with: roll-dep src/third_party/skia --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 1 + travis/licenses_golden/licenses_third_party | 43 ++++++++++++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 091d535d1590e..3f704b72a2105 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3d0e8507face451a4b17698beb6ad0ea51b9ef1d', + 'skia_revision': '5209d7fce35f4426be86de56aa4a1966c992e6f5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 4205ee5b1b487..60ab2b05c79bb 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -10081,6 +10081,7 @@ See the License for the specific language governing permissions and limitations under the License. -------------------------------------------------------------------------------- engine +skia topaz Copyright 2018 The Chromium Authors. All rights reserved. diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 64257883a0a4a..3c761431d5f76 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f6b276036e543bc2ddf0a09253044a51 +Signature: c777dad9be6d069deb9606cc1751cf4d UNUSED LICENSES: @@ -17239,6 +17239,8 @@ FILE: ../../../third_party/skia/src/effects/SkTrimPE.h FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp FILE: ../../../third_party/skia/src/gpu/GrDDLContext.cpp FILE: ../../../third_party/skia/src/gpu/GrDirectContext.cpp +FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.cpp +FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.h FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h @@ -17452,6 +17454,7 @@ FILE: ../../../third_party/skia/infra/bots/assets/chromebook_arm_gles/VERSION FILE: ../../../third_party/skia/infra/bots/assets/chromebook_x86_64_gles/VERSION FILE: ../../../third_party/skia/infra/bots/assets/clang_linux/VERSION FILE: ../../../third_party/skia/infra/bots/assets/clang_win/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/cmake_linux/VERSION FILE: ../../../third_party/skia/infra/bots/assets/emscripten_sdk/VERSION FILE: ../../../third_party/skia/infra/bots/assets/gcloud_linux/VERSION FILE: ../../../third_party/skia/infra/bots/assets/go/VERSION @@ -17507,6 +17510,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Mini.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-loongson3a-Release.json @@ -20914,6 +20918,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkaroundsAutogen.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp + ../../../third_party/skia/LICENSE @@ -21923,4 +21962,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 318 +Total license count: 319 From 3b84a4702457a5dbabb85ea0cb4796c24969f2dd Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 23 Apr 2018 12:16:15 -0700 Subject: [PATCH 0153/1190] Apply unaddressed comments in pull/5062 (#5065) --- fml/macros.h | 2 -- fml/mapping.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/fml/macros.h b/fml/macros.h index 0fb8079ef7421..79a5479bbf979 100644 --- a/fml/macros.h +++ b/fml/macros.h @@ -5,8 +5,6 @@ #ifndef FLUTTER_FML_MACROS_H_ #define FLUTTER_FML_MACROS_H_ -#include "flutter/fml/macros.h" - #ifndef FML_USED_ON_EMBEDDER #define FML_EMBEDDER_ONLY [[deprecated]] diff --git a/fml/mapping.h b/fml/mapping.h index 1f10975906fb8..465a66239ae68 100644 --- a/fml/mapping.h +++ b/fml/mapping.h @@ -9,9 +9,9 @@ #include #include -#include "flutter/fml//unique_fd.h" #include "flutter/fml/build_config.h" #include "flutter/fml/macros.h" +#include "flutter/fml/unique_fd.h" namespace fml { From 96af3b29e71914806f1dbd25cfb3db7a595a3f3b Mon Sep 17 00:00:00 2001 From: Yegor Date: Mon, 23 Apr 2018 13:17:25 -0700 Subject: [PATCH 0154/1190] ios: remove geometric order; it will be supplied by framework (#4937) --- .../framework/Source/accessibility_bridge.mm | 39 +------------------ 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 48b208a261c4a..cf086608c663f 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -40,15 +40,6 @@ return blink::SemanticsAction::kScrollUp; } -NSComparisonResult IntToComparisonResult(int32_t value) { - if (value > 0) - return (NSComparisonResult)NSOrderedDescending; - if (value < 0) - return (NSComparisonResult)NSOrderedAscending; - - return (NSComparisonResult)NSOrderedSame; -} - } // namespace /** @@ -490,9 +481,6 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { } void AccessibilityBridge::UpdateSemantics(blink::SemanticsNodeUpdates nodes) { - // Children are received in paint order (inverse hit testing order). We need to bring them into - // traversal order (top left to bottom right, with hit testing order as tie breaker). - NSMutableSet* childOrdersToUpdate = [[NSMutableSet alloc] init]; BOOL layoutChanged = NO; BOOL scrollOccured = NO; @@ -505,37 +493,14 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { const NSUInteger newChildCount = node.children.size(); NSMutableArray* newChildren = [[[NSMutableArray alloc] initWithCapacity:newChildCount] autorelease]; - for (NSUInteger i = 0; i < newChildCount; i++) { - [newChildren addObject:[NSNull null]]; - } - object.children = newChildren; for (NSUInteger i = 0; i < newChildCount; ++i) { SemanticsObject* child = GetOrCreateObject(node.children[i], nodes); child.parent = object; - // Reverting to get hit testing order (as tie breaker for sorting below). - newChildren[newChildCount - i - 1] = child; + [newChildren addObject:child]; } - - [childOrdersToUpdate addObject:object]; - if (object.parent) - [childOrdersToUpdate addObject:object.parent]; - } - - // Bring children into traversal order. - for (SemanticsObject* object in childOrdersToUpdate) { - [object.children sortUsingComparator:^(SemanticsObject* a, SemanticsObject* b) { - // Should a go before b? - CGRect rectA = [a globalRect]; - CGRect rectB = [b globalRect]; - CGFloat top = rectA.origin.y - rectB.origin.y; - if (top == 0.0) - return IntToComparisonResult(rectA.origin.x - rectB.origin.x < 0.0); - return IntToComparisonResult(top); - }]; + object.children = newChildren; } - [childOrdersToUpdate release]; - SemanticsObject* root = objects_.get()[@(kRootNodeId)]; bool routeChanged = false; From 2970c099f7b718528d8bd4fbfae84c73be9a4c20 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 23 Apr 2018 15:02:19 -0700 Subject: [PATCH 0155/1190] Use the default microtask scheduler on all isolates except the UI isolate (#5068) See https://github.com/flutter/flutter/issues/16846 --- lib/ui/dart_runtime_hooks.cc | 17 +++++++---------- lib/ui/dart_runtime_hooks.h | 7 +------ runtime/dart_isolate.cc | 8 +++----- runtime/dart_isolate.h | 2 +- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index 32a244c9cb67d..b1e64bcc0d13c 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -62,8 +62,7 @@ static Dart_Handle GetClosure(Dart_Handle builtin_library, const char* name) { return closure; } -static void InitDartInternal(Dart_Handle builtin_library, - DartRuntimeHooks::IsolateType isolate_type) { +static void InitDartInternal(Dart_Handle builtin_library, bool is_ui_isolate) { Dart_Handle print = GetClosure(builtin_library, "_getPrintClosure"); Dart_Handle internal_library = Dart_LookupLibrary(ToDart("dart:_internal")); @@ -71,7 +70,7 @@ static void InitDartInternal(Dart_Handle builtin_library, DART_CHECK_VALID( Dart_SetField(internal_library, ToDart("_printClosure"), print)); - if (isolate_type == DartRuntimeHooks::MainIsolate) { + if (is_ui_isolate) { // Call |_setupHooks| to configure |VMLibraryHooks|. Dart_Handle method_name = Dart_NewStringFromCString("_setupHooks"); DART_CHECK_VALID(Dart_Invoke(builtin_library, method_name, 0, NULL)) @@ -97,14 +96,12 @@ static void InitDartCore(Dart_Handle builtin, const std::string& script_uri) { Dart_SetField(core_library, ToDart("_uriBaseClosure"), get_base_url)); } -static void InitDartAsync(Dart_Handle builtin_library, - DartRuntimeHooks::IsolateType isolate_type) { +static void InitDartAsync(Dart_Handle builtin_library, bool is_ui_isolate) { Dart_Handle schedule_microtask; - if (isolate_type == DartRuntimeHooks::MainIsolate) { + if (is_ui_isolate) { schedule_microtask = GetClosure(builtin_library, "_getScheduleMicrotaskClosure"); } else { - FXL_CHECK(isolate_type == DartRuntimeHooks::SecondaryIsolate); Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); Dart_Handle method_name = Dart_NewStringFromCString("_getIsolateScheduleImmediateClosure"); @@ -132,13 +129,13 @@ static void InitDartIO(Dart_Handle builtin_library, Dart_SetField(platform_type, ToDart("_localeClosure"), locale_closure)); } -void DartRuntimeHooks::Install(IsolateType isolate_type, +void DartRuntimeHooks::Install(bool is_ui_isolate, const std::string& script_uri) { Dart_Handle builtin = Dart_LookupLibrary(ToDart("dart:ui")); DART_CHECK_VALID(builtin); - InitDartInternal(builtin, isolate_type); + InitDartInternal(builtin, is_ui_isolate); InitDartCore(builtin, script_uri); - InitDartAsync(builtin, isolate_type); + InitDartAsync(builtin, is_ui_isolate); InitDartIO(builtin, script_uri); } diff --git a/lib/ui/dart_runtime_hooks.h b/lib/ui/dart_runtime_hooks.h index cb5d16792922b..4574fa9f18314 100644 --- a/lib/ui/dart_runtime_hooks.h +++ b/lib/ui/dart_runtime_hooks.h @@ -13,12 +13,7 @@ namespace blink { class DartRuntimeHooks { public: - enum IsolateType { - MainIsolate, - SecondaryIsolate, - }; - - static void Install(IsolateType isolate_type, const std::string& script_uri); + static void Install(bool is_ui_isolate, const std::string& script_uri); static void RegisterNatives(tonic::DartLibraryNatives* natives); private: diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index fab6cacc2a26d..7190a0b98a599 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -220,7 +220,7 @@ bool DartIsolate::UpdateThreadPoolNames() const { return true; } -bool DartIsolate::LoadLibraries() { +bool DartIsolate::LoadLibraries(bool is_root_isolate) { TRACE_EVENT0("flutter", "DartIsolate::LoadLibraries"); if (phase_ != Phase::Initialized) { return false; @@ -234,9 +234,7 @@ bool DartIsolate::LoadLibraries() { const bool is_service_isolate = Dart_IsServiceIsolate(isolate()); - DartRuntimeHooks::Install(is_service_isolate - ? DartRuntimeHooks::SecondaryIsolate - : DartRuntimeHooks::MainIsolate, + DartRuntimeHooks::Install(is_root_isolate && !is_service_isolate, GetAdvisoryScriptURI()); if (!is_service_isolate) { @@ -675,7 +673,7 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( return {nullptr, {}}; } - if (!embedder_isolate->LoadLibraries()) { + if (!embedder_isolate->LoadLibraries(is_root_isolate)) { *error = strdup("Embedder could not load libraries in the new Dart isolate."); FXL_DLOG(ERROR) << *error; diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index 749b7b7a4ec39..60a8dcdcd6191 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -114,7 +114,7 @@ class DartIsolate : public UIDartState { bool Initialize(Dart_Isolate isolate, bool is_root_isolate); FXL_WARN_UNUSED_RESULT - bool LoadLibraries(); + bool LoadLibraries(bool is_root_isolate); bool UpdateThreadPoolNames() const; From ec611470b571c35156723a163fdcacd1f58b1809 Mon Sep 17 00:00:00 2001 From: Yegor Date: Mon, 23 Apr 2018 16:16:17 -0700 Subject: [PATCH 0156/1190] replace nextNodeId/previousNodeId with hitTestPosition (#5066) --- lib/ui/semantics.dart | 9 +++------ lib/ui/semantics/semantics_node.h | 3 +-- lib/ui/semantics/semantics_update_builder.cc | 6 ++---- lib/ui/semantics/semantics_update_builder.h | 3 +-- .../android/io/flutter/view/AccessibilityBridge.java | 10 +++------- shell/platform/android/platform_view_android.cc | 2 +- 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 6040e7809e9b6..09436ed7fae9f 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -488,8 +488,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { String increasedValue, String decreasedValue, TextDirection textDirection, - int nextNodeId, - int previousNodeId, + int hitTestPosition, Float64List transform, Int32List children, }) { @@ -513,8 +512,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { increasedValue, decreasedValue, textDirection != null ? textDirection.index + 1 : 0, - nextNodeId ?? -1, - previousNodeId ?? -1, + hitTestPosition, transform, children,); } @@ -537,8 +535,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { String increasedValue, String decreasedValue, int textDirection, - int nextNodeId, - int previousNodeId, + int hitTestPosition, Float64List transform, Int32List children, ) native 'SemanticsUpdateBuilder_updateNode'; diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index 24a8486026301..55f2771c90979 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -82,8 +82,7 @@ struct SemanticsNode { std::string increasedValue; std::string decreasedValue; int32_t textDirection = 0; // 0=unknown, 1=rtl, 2=ltr - int32_t nextNodeId = -1; - int32_t previousNodeId = -1; + int32_t hitTestPosition = -1; SkRect rect = SkRect::MakeEmpty(); SkMatrix44 transform = SkMatrix44(SkMatrix44::kIdentity_Constructor); diff --git a/lib/ui/semantics/semantics_update_builder.cc b/lib/ui/semantics/semantics_update_builder.cc index 3d2a7455f9b34..2ff5568ec1c49 100644 --- a/lib/ui/semantics/semantics_update_builder.cc +++ b/lib/ui/semantics/semantics_update_builder.cc @@ -52,8 +52,7 @@ void SemanticsUpdateBuilder::updateNode(int id, std::string increasedValue, std::string decreasedValue, int textDirection, - int nextNodeId, - int previousNodeId, + int hitTestPosition, const tonic::Float64List& transform, const tonic::Int32List& children) { SemanticsNode node; @@ -72,8 +71,7 @@ void SemanticsUpdateBuilder::updateNode(int id, node.increasedValue = increasedValue; node.decreasedValue = decreasedValue; node.textDirection = textDirection; - node.nextNodeId = nextNodeId; - node.previousNodeId = previousNodeId; + node.hitTestPosition = hitTestPosition; node.transform.setColMajord(transform.data()); node.children = std::vector( children.data(), children.data() + children.num_elements()); diff --git a/lib/ui/semantics/semantics_update_builder.h b/lib/ui/semantics/semantics_update_builder.h index 7c39ebf44b7d4..6f33330eaac4b 100644 --- a/lib/ui/semantics/semantics_update_builder.h +++ b/lib/ui/semantics/semantics_update_builder.h @@ -43,8 +43,7 @@ class SemanticsUpdateBuilder std::string increasedValue, std::string decreasedValue, int textDirection, - int nextNodeId, - int previousNodeId, + int hitTestPosition, const tonic::Float64List& transform, const tonic::Int32List& children); diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 2d40893712360..ecbb62dcebd9d 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -251,10 +251,6 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { result.setSelected(object.hasFlag(Flag.IS_SELECTED)); result.setText(object.getValueLabelHint()); - if (object.previousNodeId != -1 - && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) { - result.setTraversalAfter(mOwner, object.previousNodeId); - } // Accessibility Focus if (mA11yFocusedObject != null && mA11yFocusedObject.id == virtualViewId) { @@ -744,7 +740,7 @@ private class SemanticsObject { String decreasedValue; String hint; TextDirection textDirection; - int previousNodeId; + int hitTestPosition; boolean hadPreviousConfig = false; int previousFlags; @@ -797,7 +793,7 @@ boolean didScroll() { void log(String indent, boolean recursive) { Log.i(TAG, indent + "SemanticsObject id=" + id + " label=" + label + " actions=" + actions + " flags=" + flags + "\n" + indent + " +-- textDirection=" + textDirection + "\n"+ - indent + " +-- previousNodeId=" + previousNodeId + "\n"+ + indent + " +-- hitTestPosition=" + hitTestPosition + "\n"+ indent + " +-- rect.ltrb=(" + left + ", " + top + ", " + right + ", " + bottom + ")\n" + indent + " +-- transform=" + Arrays.toString(transform) + "\n"); if (children != null && recursive) { @@ -844,7 +840,7 @@ void updateWith(ByteBuffer buffer, String[] strings) { textDirection = TextDirection.fromInt(buffer.getInt()); - previousNodeId = buffer.getInt(); + hitTestPosition = buffer.getInt(); left = buffer.getFloat(); top = buffer.getFloat(); diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 00d1e4b59e848..8a241b0bfd26e 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -243,7 +243,7 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { strings.push_back(node.hint); } buffer_int32[position++] = node.textDirection; - buffer_int32[position++] = node.previousNodeId; + buffer_int32[position++] = node.hitTestPosition; buffer_float32[position++] = node.rect.left(); buffer_float32[position++] = node.rect.top(); buffer_float32[position++] = node.rect.right(); From 79b9ffb14b9d62a5916308b24b877f44a6fdd6da Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 23 Apr 2018 20:16:01 -0700 Subject: [PATCH 0157/1190] Fixup Fuchsia content handler post shell refactor. (#5072) --- content_handler/accessibility_bridge.cc | 3 +- content_handler/accessibility_bridge.h | 7 +- content_handler/application.cc | 76 ++++---- content_handler/application.h | 39 +++-- content_handler/application_runner.cc | 9 +- content_handler/application_runner.h | 15 +- content_handler/compositor_context.h | 3 +- content_handler/engine.cc | 42 +++-- content_handler/engine.h | 8 +- content_handler/fuchsia_font_manager.cc | 22 +-- content_handler/isolate_configurator.cc | 8 +- content_handler/isolate_configurator.h | 17 +- content_handler/platform_view.cc | 191 ++++++++++----------- content_handler/platform_view.h | 70 ++++---- content_handler/session_connection.cc | 30 ++-- content_handler/session_connection.h | 6 +- content_handler/surface.cc | 22 +-- content_handler/surface.h | 7 +- content_handler/vulkan_surface.cc | 29 ++-- content_handler/vulkan_surface_producer.cc | 7 +- fml/native_library.h | 4 + fml/platform/posix/native_library_posix.cc | 8 + fml/platform/win/native_library_win.cc | 8 + lib/snapshot/BUILD.gn | 38 ++-- lib/ui/compositing/scene.cc | 2 +- shell/common/rasterizer.cc | 22 ++- shell/common/rasterizer.h | 6 +- vulkan/vulkan_swapchain.cc | 14 +- 28 files changed, 350 insertions(+), 363 deletions(-) diff --git a/content_handler/accessibility_bridge.cc b/content_handler/accessibility_bridge.cc index f3d52f6cdbbb6..ecff416427da5 100644 --- a/content_handler/accessibility_bridge.cc +++ b/content_handler/accessibility_bridge.cc @@ -7,14 +7,13 @@ #include #include "lib/app/cpp/application_context.h" -#include "lib/context/fidl/context_writer.fidl.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/stringbuffer.h" #include "third_party/rapidjson/rapidjson/writer.h" namespace flutter { -AccessibilityBridge::AccessibilityBridge(maxwell::ContextWriterPtr writer) +AccessibilityBridge::AccessibilityBridge(modular::ContextWriterPtr writer) : writer_(std::move(writer)) {} AccessibilityBridge::~AccessibilityBridge() = default; diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h index dde8bfaa54c36..70a304fb545b9 100644 --- a/content_handler/accessibility_bridge.h +++ b/content_handler/accessibility_bridge.h @@ -6,8 +6,9 @@ #include +#include + #include "flutter/lib/ui/semantics/semantics_node.h" -#include "lib/context/fidl/context_writer.fidl.h" #include "lib/fxl/macros.h" namespace flutter { @@ -16,7 +17,7 @@ namespace flutter { // with the Context Service. class AccessibilityBridge final { public: - AccessibilityBridge(maxwell::ContextWriterPtr writer); + AccessibilityBridge(modular::ContextWriterPtr writer); ~AccessibilityBridge(); @@ -25,7 +26,7 @@ class AccessibilityBridge final { void UpdateSemantics(const blink::SemanticsNodeUpdates& update); private: - maxwell::ContextWriterPtr writer_; + modular::ContextWriterPtr writer_; std::map semantics_nodes_; // Walk the semantics node tree starting at |id|, and store the id of each diff --git a/content_handler/application.cc b/content_handler/application.cc index 7dd2270d42317..3f56ab911cb64 100644 --- a/content_handler/application.cc +++ b/content_handler/application.cc @@ -21,9 +21,9 @@ namespace flutter { std::pair, std::unique_ptr> Application::Create( Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller) { + component::ApplicationPackage package, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) { auto thread = std::make_unique(); std::unique_ptr application; @@ -52,52 +52,48 @@ static std::string DebugLabelForURL(const std::string url) { Application::Application( Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest + component::ApplicationPackage, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest application_controller_request) : delegate_(delegate), - debug_label_(DebugLabelForURL(startup_info->launch_info->url)), + debug_label_(DebugLabelForURL(startup_info.launch_info.url)), application_controller_(this) { application_controller_.set_error_handler([this]() { Kill(); }); FXL_DCHECK(fdio_ns_.is_valid()); // ApplicationLaunchInfo::url non-optional. - auto& launch_info = startup_info->launch_info; + auto& launch_info = startup_info.launch_info; // ApplicationLaunchInfo::arguments optional. - if (auto& arguments = launch_info->arguments) { + if (auto& arguments = launch_info.arguments) { settings_ = shell::SettingsFromCommandLine( fxl::CommandLineFromIterators(arguments->begin(), arguments->end())); } - // TODO: ApplicationLaunchInfo::out optional. + // TODO: ApplicationLaunchInfo::out. - // TODO: ApplicationLaunchInfo::err optional. + // TODO: ApplicationLaunchInfo::err. // ApplicationLaunchInfo::service_request optional. - if (launch_info->directory_request) { + if (launch_info.directory_request) { service_provider_bridge_.ServeDirectory( - std::move(launch_info->directory_request)); + std::move(launch_info.directory_request)); } // ApplicationLaunchInfo::flat_namespace optional. - if (auto& flat_namespace = startup_info->flat_namespace) { - for (size_t i = 0; i < flat_namespace->paths->size(); ++i) { - const auto& path = flat_namespace->paths->at(i); - if (path == "/svc") { - continue; - } - - zx::channel dir = std::move(flat_namespace->directories->at(i)); - zx_handle_t dir_handle = dir.release(); - if (fdio_ns_bind(fdio_ns_.get(), path->data(), dir_handle) != ZX_OK) { - FXL_DLOG(ERROR) << "Could not bind path to namespace: " << path; - zx_handle_close(dir_handle); - } + for (size_t i = 0; i < startup_info.flat_namespace.paths->size(); ++i) { + const auto& path = startup_info.flat_namespace.paths->at(i); + if (path == "/svc") { + continue; + } + + zx::channel dir = std::move(startup_info.flat_namespace.directories->at(i)); + zx_handle_t dir_handle = dir.release(); + if (fdio_ns_bind(fdio_ns_.get(), path->data(), dir_handle) != ZX_OK) { + FXL_DLOG(ERROR) << "Could not bind path to namespace: " << path; + zx_handle_close(dir_handle); } - } else { - FXL_DLOG(ERROR) << "There was no flat namespace."; } application_directory_.reset(fdio_ns_opendir(fdio_ns_.get())); @@ -108,15 +104,11 @@ Application::Application( // TODO: ApplicationLaunchInfo::additional_services optional. - // ApplicationPackage::data: This is legacy FLX data. Ensure that we dont have - // any. - FXL_DCHECK(!package->data) << "Legacy FLX data must not be supplied."; - // All launch arguments have been read. Perform service binding and // final settings configuration. The next call will be to create a view // for this application. - service_provider_bridge_.AddService( + service_provider_bridge_.AddService( std::bind(&Application::CreateShellForView, this, std::placeholders::_1)); component::ServiceProviderPtr outgoing_services; @@ -193,10 +185,10 @@ void Application::AttemptVMLaunchWithCurrentSettings( return; } - auto lib = fxl::MakeRefCounted( - library_handle, // library handle - true // close the handle when done - ); + auto lib = + fml::NativeLibrary::CreateWithHandle(library_handle, // library handle + true // close the handle when done + ); auto symbol = [](const char* str) { return std::string{"_"} + std::string{str}; @@ -248,7 +240,7 @@ void Application::Detach() { } // |component::ApplicationController| -void Application::Wait(const WaitCallback& callback) { +void Application::Wait(WaitCallback callback) { wait_callbacks_.emplace_back(std::move(callback)); } @@ -281,14 +273,14 @@ void Application::OnEngineTerminate(const Engine* shell_holder) { } void Application::CreateShellForView( - f1dl::InterfaceRequest view_provider_request) { + fidl::InterfaceRequest view_provider_request) { shells_bindings_.AddBinding(this, std::move(view_provider_request)); } -// |mozart::ViewProvider| +// |views_v1::ViewProvider| void Application::CreateView( - f1dl::InterfaceRequest view_owner, - f1dl::InterfaceRequest) { + fidl::InterfaceRequest view_owner, + fidl::InterfaceRequest) { if (!application_context_) { FXL_DLOG(ERROR) << "Application context was invalid when attempting to " "create a shell for a view provider request."; diff --git a/content_handler/application.h b/content_handler/application.h index e4f5da105cac8..eb06a4aad07fd 100644 --- a/content_handler/application.h +++ b/content_handler/application.h @@ -8,16 +8,19 @@ #include #include +#include +#include +#include + #include "engine.h" #include "flutter/common/settings.h" #include "lib/app/cpp/application_context.h" -#include "lib/app/fidl/application_controller.fidl.h" -#include "lib/fidl/cpp/bindings/binding_set.h" +#include "lib/fidl/cpp/binding_set.h" +#include "lib/fidl/cpp/interface_request.h" #include "lib/fsl/threading/thread.h" #include "lib/fxl/files/unique_fd.h" #include "lib/fxl/macros.h" #include "lib/svc/cpp/service_provider_bridge.h" -#include "lib/ui/views/fidl/view_provider.fidl.h" #include "unique_fdio_ns.h" namespace flutter { @@ -26,7 +29,7 @@ namespace flutter { // Flutter engine instances. class Application final : public Engine::Delegate, public component::ApplicationController, - public mozart::ViewProvider { + public views_v1::ViewProvider { public: class Delegate { public: @@ -38,9 +41,9 @@ class Application final : public Engine::Delegate, // This is a synchronous operation. static std::pair, std::unique_ptr> Create(Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller); + component::ApplicationPackage package, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller); // Must be called on the same thread returned from the create call. The thread // may be collected after. @@ -53,20 +56,20 @@ class Application final : public Engine::Delegate, UniqueFDIONS fdio_ns_ = UniqueFDIONSCreate(); fxl::UniqueFD application_directory_; fxl::UniqueFD application_assets_directory_; - f1dl::Binding application_controller_; - f1dl::InterfaceRequest outgoing_services_request_; + fidl::Binding application_controller_; + fidl::InterfaceRequest outgoing_services_request_; component::ServiceProviderBridge service_provider_bridge_; std::unique_ptr application_context_; - f1dl::BindingSet shells_bindings_; + fidl::BindingSet shells_bindings_; std::set> shell_holders_; std::vector wait_callbacks_; std::pair last_return_code_; Application( Application::Delegate& delegate, - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller); + component::ApplicationPackage package, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller); // |component::ApplicationController| void Kill() override; @@ -75,18 +78,18 @@ class Application final : public Engine::Delegate, void Detach() override; // |component::ApplicationController| - void Wait(const WaitCallback& callback) override; + void Wait(WaitCallback callback) override; - // |mozart::ViewProvider| + // |views_v1::ViewProvider| void CreateView( - f1dl::InterfaceRequest view_owner, - f1dl::InterfaceRequest services) override; + fidl::InterfaceRequest view_owner, + fidl::InterfaceRequest services) override; // |flutter::Engine::Delegate| void OnEngineTerminate(const Engine* holder) override; void CreateShellForView( - f1dl::InterfaceRequest view_provider_request); + fidl::InterfaceRequest view_provider_request); void AttemptVMLaunchWithCurrentSettings( const blink::Settings& settings) const; diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc index 2d77f43cbdd45..9a36fd1881c0e 100644 --- a/content_handler/application_runner.cc +++ b/content_handler/application_runner.cc @@ -8,7 +8,6 @@ #include "flutter/lib/ui/text/font_collection.h" #include "fuchsia_font_manager.h" -#include "lib/fonts/fidl/font_provider.fidl.h" #include "lib/icu_data/cpp/icu_data.h" namespace flutter { @@ -38,14 +37,14 @@ ApplicationRunner::~ApplicationRunner() { } void ApplicationRunner::RegisterApplication( - f1dl::InterfaceRequest request) { + fidl::InterfaceRequest request) { active_applications_bindings_.AddBinding(this, std::move(request)); } void ApplicationRunner::StartApplication( - component::ApplicationPackagePtr package, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest controller) { + component::ApplicationPackage package, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) { auto thread_application_pair = Application::Create(*this, // delegate std::move(package), // application pacakge diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h index fdf5b4420dc0f..bae56b79dad39 100644 --- a/content_handler/application_runner.h +++ b/content_handler/application_runner.h @@ -7,10 +7,11 @@ #include #include +#include + #include "application.h" #include "lib/app/cpp/application_context.h" -#include "lib/app/fidl/application_runner.fidl.h" -#include "lib/fidl/cpp/bindings/binding_set.h" +#include "lib/fidl/cpp/binding_set.h" #include "lib/fsl/tasks/message_loop.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/fxl/macros.h" @@ -49,18 +50,18 @@ class ApplicationRunner final : public Application::Delegate, fxl::Closure on_termination_callback_; std::unique_ptr host_context_; - f1dl::BindingSet active_applications_bindings_; + fidl::BindingSet active_applications_bindings_; std::unordered_map active_applications_; // |component::ApplicationRunner| - void StartApplication(component::ApplicationPackagePtr application, - component::ApplicationStartupInfoPtr startup_info, - f1dl::InterfaceRequest + void StartApplication(component::ApplicationPackage application, + component::ApplicationStartupInfo startup_info, + fidl::InterfaceRequest controller) override; void RegisterApplication( - f1dl::InterfaceRequest request); + fidl::InterfaceRequest request); void UnregisterApplication(const Application* application); diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h index a6e5429c6072c..d5bed1f267d96 100644 --- a/content_handler/compositor_context.h +++ b/content_handler/compositor_context.h @@ -4,8 +4,9 @@ #pragma once +#include + #include "flutter/flow/compositor_context.h" -#include "garnet/public/lib/ui/scenic/fidl/scenic.fidl-common.h" #include "lib/fxl/macros.h" #include "session_connection.h" diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 3349c09bdf1af..ebdaff84f3bd7 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -15,19 +15,15 @@ #include "lib/fxl/synchronization/waitable_event.h" #include "platform_view.h" -#ifdef ERROR -#undef ERROR -#endif - namespace flutter { Engine::Engine(Delegate& delegate, std::string thread_label, component::ApplicationContext& application_context, blink::Settings settings, - f1dl::InterfaceRequest view_owner, + fidl::InterfaceRequest view_owner, const UniqueFDIONS& fdio_ns, - f1dl::InterfaceRequest + fidl::InterfaceRequest outgoing_services_request) : delegate_(delegate), thread_label_(std::move(thread_label)), @@ -39,7 +35,7 @@ Engine::Engine(Delegate& delegate, thread.Run(); } - mozart::ViewManagerPtr view_manager; + views_v1::ViewManagerPtr view_manager; application_context.ConnectToEnvironmentService(view_manager.NewRequest()); zx::eventpair import_token, export_token; @@ -66,10 +62,21 @@ Engine::Engine(Delegate& delegate, // Grab the accessibilty context writer that can understand the semtics tree // on the platform view. - maxwell::ContextWriterPtr accessibility_context_writer; + modular::ContextWriterPtr accessibility_context_writer; application_context.ConnectToEnvironmentService( accessibility_context_writer.NewRequest()); + // Create the compositor context from the scenic pointer to create the + // rasterizer. + std::unique_ptr compositor_context = + std::make_unique( + scenic, // scenic + thread_label_, // debug label + std::move(import_token), // import token + on_session_metrics_change_callback, // session metrics did change + on_session_error_callback // session did encounter error + ); + // Setup the callback that will instantiate the platform view. shell::Shell::CreateCallback on_create_platform_view = fxl::MakeCopyable([debug_label = thread_label_, // @@ -80,10 +87,8 @@ Engine::Engine(Delegate& delegate, scenic = std::move(scenic), // accessibility_context_writer = std::move(accessibility_context_writer), // - export_token = std::move(export_token), // - import_token = std::move(import_token), // - on_session_metrics_change_callback, // - on_session_error_callback // + export_token = std::move(export_token) // + ](shell::Shell& shell) mutable { return std::make_unique( shell, // delegate @@ -94,21 +99,20 @@ Engine::Engine(Delegate& delegate, std::move(view_owner), // view owner std::move(scenic), // scenic std::move(export_token), // export token - std::move(import_token), // import token std::move( - accessibility_context_writer), // accessibility context writer - std::move(on_session_metrics_change_callback), // metrics change - std::move(on_session_error_callback) // session_error + accessibility_context_writer) // accessibility context writer ); }); // Setup the callback that will instantiate the rasterizer. shell::Shell::CreateCallback on_create_rasterizer = - [](shell::Shell& shell) { + fxl::MakeCopyable([compositor_context = std::move(compositor_context)]( + shell::Shell& shell) mutable { return std::make_unique( - shell.GetTaskRunners() // task runners + shell.GetTaskRunners(), // task runners + std::move(compositor_context) // compositor context ); - }; + }); // Get the task runners from the managed threads. The current thread will be // used as the "platform" thread. diff --git a/content_handler/engine.h b/content_handler/engine.h index 60c0ad7c2f80d..c881726cac5a2 100644 --- a/content_handler/engine.h +++ b/content_handler/engine.h @@ -4,13 +4,15 @@ #pragma once +#include +#include + #include "flutter/shell/common/shell.h" #include "isolate_configurator.h" #include "lib/app/cpp/application_context.h" #include "lib/fsl/threading/thread.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" -#include "lib/ui/views/fidl/view_manager.fidl.h" namespace flutter { @@ -27,9 +29,9 @@ class Engine final { std::string thread_label, component::ApplicationContext& application_context, blink::Settings settings, - f1dl::InterfaceRequest view_owner, + fidl::InterfaceRequest view_owner, const UniqueFDIONS& fdio_ns, - f1dl::InterfaceRequest + fidl::InterfaceRequest outgoing_services_request); ~Engine(); diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc index 877c931130eb4..c369e54400e10 100644 --- a/content_handler/fuchsia_font_manager.cc +++ b/content_handler/fuchsia_font_manager.cc @@ -32,14 +32,14 @@ void UnmapMemory(const void* buffer, void* context) { zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); } -sk_sp MakeSkDataFromVMO(const fsl::SizedVmoTransportPtr& vmo) { - if (!fsl::SizedVmo::IsSizeValid(vmo->vmo, vmo->size) || - vmo->size > std::numeric_limits::max()) { +sk_sp MakeSkDataFromBuffer(const mem::Buffer& data) { + if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || + data.size > std::numeric_limits::max()) { return nullptr; } - uint64_t size = vmo->size; + uint64_t size = data.size; uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, vmo->vmo, 0, size, + zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, ZX_VM_FLAG_PERM_READ, &buffer); if (status != ZX_OK) return nullptr; @@ -90,11 +90,11 @@ SkFontStyleSet* FuchsiaFontManager::onMatchFamily( SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( const char family_name[], const SkFontStyle& style) const { - auto request = fonts::FontRequest::New(); - request->family = family_name; - request->weight = style.weight(); - request->width = style.width(); - request->slant = ToFontSlant(style.slant()); + fonts::FontRequest request; + request.family = family_name; + request.weight = style.weight(); + request.width = style.width(); + request.slant = ToFontSlant(style.slant()); fonts::FontResponsePtr response; font_provider_->GetFont( @@ -108,7 +108,7 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( return nullptr; } - sk_sp data = MakeSkDataFromVMO(response->data->vmo); + sk_sp data = MakeSkDataFromBuffer(response->data.buffer); if (!data) return nullptr; diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc index d085bea698b95..99a9bee78e3e6 100644 --- a/content_handler/isolate_configurator.cc +++ b/content_handler/isolate_configurator.cc @@ -16,9 +16,9 @@ namespace flutter { IsolateConfigurator::IsolateConfigurator( const UniqueFDIONS& fdio_ns, - mozart::ViewPtr& view, + views_v1::ViewPtr& view, component::ApplicationEnvironmentPtr application_environment, - f1dl::InterfaceRequest + fidl::InterfaceRequest outgoing_services_request) : fdio_ns_(fdio_ns), view_(view), @@ -42,7 +42,7 @@ bool IsolateConfigurator::ConfigureCurrentIsolate() { } // |mozart::NativesDelegate| -mozart::View* IsolateConfigurator::GetMozartView() { +views_v1::View* IsolateConfigurator::GetMozartView() { return view_.get(); } @@ -102,7 +102,7 @@ void IsolateConfigurator::BindScenic() { tonic::ToDart("_context"), // tonic::DartConverter::ToDart(reinterpret_cast( static_cast(this))))); - mozart::ViewContainerPtr view_container; + views_v1::ViewContainerPtr view_container; view_->GetContainer(view_container.NewRequest()); DART_CHECK_VALID( Dart_SetField(mozart_internal, // diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h index a5da083633ee7..b7cc438418bc6 100644 --- a/content_handler/isolate_configurator.h +++ b/content_handler/isolate_configurator.h @@ -4,11 +4,12 @@ #pragma once -#include "lib/app/fidl/application_environment.fidl.h" +#include +#include +#include + #include "lib/fxl/macros.h" #include "lib/ui/flutter/sdk_ext/src/natives.h" -#include "lib/ui/views/fidl/view_containers.fidl.h" -#include "lib/ui/views/fidl/views.fidl.h" #include "unique_fdio_ns.h" namespace flutter { @@ -20,9 +21,9 @@ class IsolateConfigurator final : mozart::NativesDelegate { public: IsolateConfigurator( const UniqueFDIONS& fdio_ns, - mozart::ViewPtr& view, + views_v1::ViewPtr& view, component::ApplicationEnvironmentPtr application_environment, - f1dl::InterfaceRequest + fidl::InterfaceRequest outgoing_services_request); ~IsolateConfigurator(); @@ -34,12 +35,12 @@ class IsolateConfigurator final : mozart::NativesDelegate { private: bool used_ = false; const UniqueFDIONS& fdio_ns_; - mozart::ViewPtr& view_; + views_v1::ViewPtr& view_; component::ApplicationEnvironmentPtr application_environment_; - f1dl::InterfaceRequest outgoing_services_request_; + fidl::InterfaceRequest outgoing_services_request_; // |mozart::NativesDelegate| - mozart::View* GetMozartView() override; + views_v1::View* GetMozartView() override; void BindFuchsia(); diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc index 8ac41613e449b..00f46e4779234 100644 --- a/content_handler/platform_view.cc +++ b/content_handler/platform_view.cc @@ -25,14 +25,11 @@ PlatformView::PlatformView( std::string debug_label, blink::TaskRunners task_runners, component::ServiceProviderPtr parent_environment_service_provider, - mozart::ViewManagerPtr& view_manager, - f1dl::InterfaceRequest view_owner, + views_v1::ViewManagerPtr& view_manager, + fidl::InterfaceRequest view_owner, ui::ScenicPtr scenic, zx::eventpair export_token, - zx::eventpair import_token, - maxwell::ContextWriterPtr accessibility_context_writer, - OnMetricsUpdate on_session_metrics_did_change, - fxl::Closure session_error_callback) + modular::ContextWriterPtr accessibility_context_writer) : shell::PlatformView(delegate, std::move(task_runners)), debug_label_(std::move(debug_label)), view_listener_(this), @@ -40,12 +37,7 @@ PlatformView::PlatformView( ime_client_(this), scenic_(std::move(scenic)), accessibility_bridge_(std::move(accessibility_context_writer)), - surface_( - std::make_unique(scenic_, - debug_label_, - std::move(import_token), - std::move(on_session_metrics_did_change), - std::move(session_error_callback))) { + surface_(std::make_unique(debug_label_)) { // Create the view. view_manager->CreateView(view_.NewRequest(), // view std::move(view_owner), // view owner @@ -86,30 +78,26 @@ void PlatformView::RegisterPlatformMessageHandlers() { std::placeholders::_1); } -mozart::ViewPtr& PlatformView::GetMozartView() { +views_v1::ViewPtr& PlatformView::GetMozartView() { return view_; } -// |mozart::ViewListener| -void PlatformView::OnPropertiesChanged( - mozart::ViewPropertiesPtr properties, - const OnPropertiesChangedCallback& callback) { - UpdateViewportMetrics(properties->view_layout); +// |views_v1::ViewListener| +void PlatformView::OnPropertiesChanged(views_v1::ViewProperties properties, + OnPropertiesChangedCallback callback) { + if (properties.view_layout) { + UpdateViewportMetrics(*properties.view_layout); + } callback(); } -void PlatformView::UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout) { - if (!layout) { - return; - } - - metrics_.size.width = layout->size->width; - metrics_.size.height = layout->size->height; - - metrics_.padding.left = layout->inset->left; - metrics_.padding.top = layout->inset->top; - metrics_.padding.right = layout->inset->right; - metrics_.padding.bottom = layout->inset->bottom; +void PlatformView::UpdateViewportMetrics(const views_v1::ViewLayout& layout) { + metrics_.size.width = layout.size.width; + metrics_.size.height = layout.size.height; + metrics_.padding.left = layout.inset.left; + metrics_.padding.top = layout.inset.top; + metrics_.padding.right = layout.inset.right; + metrics_.padding.bottom = layout.inset.bottom; FlushViewportMetrics(); } @@ -150,31 +138,30 @@ void PlatformView::FlushViewportMetrics() { SetViewportMetrics(metrics); } -// |mozart::InputMethodEditorClient| -void PlatformView::DidUpdateState(mozart::TextInputStatePtr state, - mozart::InputEventPtr event) { +// |input::InputMethodEditorClient| +void PlatformView::DidUpdateState(input::TextInputState state, + std::unique_ptr) { rapidjson::Document document; auto& allocator = document.GetAllocator(); rapidjson::Value encoded_state(rapidjson::kObjectType); - encoded_state.AddMember("text", state->text.get(), allocator); - encoded_state.AddMember("selectionBase", state->selection->base, allocator); - encoded_state.AddMember("selectionExtent", state->selection->extent, - allocator); - switch (state->selection->affinity) { - case mozart::TextAffinity::UPSTREAM: + encoded_state.AddMember("text", state.text.get(), allocator); + encoded_state.AddMember("selectionBase", state.selection.base, allocator); + encoded_state.AddMember("selectionExtent", state.selection.extent, allocator); + switch (state.selection.affinity) { + case input::TextAffinity::UPSTREAM: encoded_state.AddMember("selectionAffinity", rapidjson::Value("TextAffinity.upstream"), allocator); break; - case mozart::TextAffinity::DOWNSTREAM: + case input::TextAffinity::DOWNSTREAM: encoded_state.AddMember("selectionAffinity", rapidjson::Value("TextAffinity.downstream"), allocator); break; } encoded_state.AddMember("selectionIsDirectional", true, allocator); - encoded_state.AddMember("composingBase", state->composing->start, allocator); - encoded_state.AddMember("composingExtent", state->composing->end, allocator); + encoded_state.AddMember("composingBase", state.composing.start, allocator); + encoded_state.AddMember("composingExtent", state.composing.end, allocator); rapidjson::Value args(rapidjson::kArrayType); args.PushBack(current_text_input_client_, allocator); @@ -198,8 +185,8 @@ void PlatformView::DidUpdateState(mozart::TextInputStatePtr state, ); } -// |mozart::InputMethodEditorClient| -void PlatformView::OnAction(mozart::InputMethodAction action) { +// |input::InputMethodEditorClient| +void PlatformView::OnAction(input::InputMethodAction action) { rapidjson::Document document; auto& allocator = document.GetAllocator(); @@ -226,21 +213,20 @@ void PlatformView::OnAction(mozart::InputMethodAction action) { ); } -// |mozart::InputListener| -void PlatformView::OnEvent(mozart::InputEventPtr event, - const OnEventCallback& callback) { - using Type = mozart::InputEvent::Tag; - switch (event->which()) { - case Type::POINTER: - callback(OnHandlePointerEvent(event->get_pointer())); +// |input::InputListener| +void PlatformView::OnEvent(input::InputEvent event, OnEventCallback callback) { + using Type = input::InputEvent::Tag; + switch (event.Which()) { + case Type::kPointer: + callback(OnHandlePointerEvent(event.pointer())); return; - case Type::KEYBOARD: - callback(OnHandleKeyboardEvent(event->get_keyboard())); + case Type::kKeyboard: + callback(OnHandleKeyboardEvent(event.keyboard())); return; - case Type::FOCUS: - callback(OnHandleFocusEvent(event->get_focus())); + case Type::kFocus: + callback(OnHandleFocusEvent(event.focus())); return; - case Type::__UNKNOWN__: + default: break; } @@ -248,21 +234,21 @@ void PlatformView::OnEvent(mozart::InputEventPtr event, } static blink::PointerData::Change GetChangeFromPointerEventPhase( - mozart::PointerEvent::Phase phase) { + input::PointerEventPhase phase) { switch (phase) { - case mozart::PointerEvent::Phase::ADD: + case input::PointerEventPhase::ADD: return blink::PointerData::Change::kAdd; - case mozart::PointerEvent::Phase::HOVER: + case input::PointerEventPhase::HOVER: return blink::PointerData::Change::kHover; - case mozart::PointerEvent::Phase::DOWN: + case input::PointerEventPhase::DOWN: return blink::PointerData::Change::kDown; - case mozart::PointerEvent::Phase::MOVE: + case input::PointerEventPhase::MOVE: return blink::PointerData::Change::kMove; - case mozart::PointerEvent::Phase::UP: + case input::PointerEventPhase::UP: return blink::PointerData::Change::kUp; - case mozart::PointerEvent::Phase::REMOVE: + case input::PointerEventPhase::REMOVE: return blink::PointerData::Change::kRemove; - case mozart::PointerEvent::Phase::CANCEL: + case input::PointerEventPhase::CANCEL: return blink::PointerData::Change::kCancel; default: return blink::PointerData::Change::kCancel; @@ -270,26 +256,27 @@ static blink::PointerData::Change GetChangeFromPointerEventPhase( } static blink::PointerData::DeviceKind GetKindFromPointerType( - mozart::PointerEvent::Type type) { + input::PointerEventType type) { switch (type) { - case mozart::PointerEvent::Type::TOUCH: + case input::PointerEventType::TOUCH: return blink::PointerData::DeviceKind::kTouch; - case mozart::PointerEvent::Type::MOUSE: + case input::PointerEventType::MOUSE: return blink::PointerData::DeviceKind::kMouse; default: return blink::PointerData::DeviceKind::kTouch; } } -bool PlatformView::OnHandlePointerEvent( - const mozart::PointerEventPtr& pointer) { +bool PlatformView::OnHandlePointerEvent(const input::PointerEvent& pointer) { blink::PointerData pointer_data; - pointer_data.time_stamp = pointer->event_time / 1000; - pointer_data.change = GetChangeFromPointerEventPhase(pointer->phase); - pointer_data.kind = GetKindFromPointerType(pointer->type); - pointer_data.device = pointer->pointer_id; - pointer_data.physical_x = pointer->x * metrics_.scale; - pointer_data.physical_y = pointer->y * metrics_.scale; + pointer_data.time_stamp = pointer.event_time / 1000; + pointer_data.change = GetChangeFromPointerEventPhase(pointer.phase); + pointer_data.kind = GetKindFromPointerType(pointer.type); + pointer_data.device = pointer.pointer_id; + pointer_data.physical_x = pointer.x * metrics_.scale; + pointer_data.physical_y = pointer.y * metrics_.scale; + // Buttons are single bit values starting with kMousePrimaryButton = 1. + pointer_data.buttons = static_cast(pointer.buttons); switch (pointer_data.change) { case blink::PointerData::Change::kDown: @@ -327,14 +314,13 @@ bool PlatformView::OnHandlePointerEvent( return true; } -bool PlatformView::OnHandleKeyboardEvent( - const mozart::KeyboardEventPtr& keyboard) { +bool PlatformView::OnHandleKeyboardEvent(const input::KeyboardEvent& keyboard) { const char* type = nullptr; - if (keyboard->phase == mozart::KeyboardEvent::Phase::PRESSED) { + if (keyboard.phase == input::KeyboardEventPhase::PRESSED) { type = "keydown"; - } else if (keyboard->phase == mozart::KeyboardEvent::Phase::REPEAT) { + } else if (keyboard.phase == input::KeyboardEventPhase::REPEAT) { type = "keydown"; // TODO change this to keyrepeat - } else if (keyboard->phase == mozart::KeyboardEvent::Phase::RELEASED) { + } else if (keyboard.phase == input::KeyboardEventPhase::RELEASED) { type = "keyup"; } @@ -348,9 +334,9 @@ bool PlatformView::OnHandleKeyboardEvent( document.SetObject(); document.AddMember("type", rapidjson::Value(type, strlen(type)), allocator); document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); - document.AddMember("hidUsage", keyboard->hid_usage, allocator); - document.AddMember("codePoint", keyboard->code_point, allocator); - document.AddMember("modifiers", keyboard->modifiers, allocator); + document.AddMember("hidUsage", keyboard.hid_usage, allocator); + document.AddMember("codePoint", keyboard.code_point, allocator); + document.AddMember("modifiers", keyboard.modifiers, allocator); rapidjson::StringBuffer buffer; rapidjson::Writer writer(buffer); document.Accept(writer); @@ -365,8 +351,8 @@ bool PlatformView::OnHandleKeyboardEvent( return true; } -bool PlatformView::OnHandleFocusEvent(const mozart::FocusEventPtr& focus) { - if (!focus->focused && current_text_input_client_ != 0) { +bool PlatformView::OnHandleFocusEvent(const input::FocusEvent& focus) { + if (!focus.focused && current_text_input_client_ != 0) { current_text_input_client_ = 0; if (ime_) { ime_->Hide(); @@ -434,13 +420,13 @@ void PlatformView::HandleFlutterPlatformChannelPlatformMessage( clipboard_->Push(text); response->CompleteEmpty(); } else if (method->value == "Clipboard.getData") { - clipboard_->Peek([response](const f1dl::String& text) { + clipboard_->Peek([response](fidl::StringPtr text) { rapidjson::StringBuffer json_buffer; rapidjson::Writer writer(json_buffer); writer.StartArray(); writer.StartObject(); writer.Key("text"); - writer.String(text); + writer.String(text.get()); writer.EndObject(); writer.EndArray(); std::string result = json_buffer.GetString(); @@ -491,13 +477,14 @@ void PlatformView::HandleFlutterTextInputChannelPlatformMessage( } // TODO(abarth): Read the keyboard type from the configuration. current_text_input_client_ = args->value[0].GetInt(); - mozart::TextInputStatePtr state = mozart::TextInputState::New(); - state->text = std::string(); - state->selection = mozart::TextSelection::New(); - state->composing = mozart::TextRange::New(); + input_connection_->GetInputMethodEditor( - mozart::KeyboardType::TEXT, mozart::InputMethodAction::DONE, - std::move(state), ime_client_.NewBinding(), ime_.NewRequest()); + input::KeyboardType::TEXT, // keyboard type + input::InputMethodAction::DONE, // input method action + input::TextInputState{}, // initial state + ime_client_.NewBinding(), // client + ime_.NewRequest() // editor + ); } else if (method->value == "TextInput.setEditingState") { if (ime_) { auto args_it = root.FindMember("args"); @@ -505,36 +492,34 @@ void PlatformView::HandleFlutterTextInputChannelPlatformMessage( return; } const auto& args = args_it->value; - mozart::TextInputStatePtr state = mozart::TextInputState::New(); - state->selection = mozart::TextSelection::New(); - state->composing = mozart::TextRange::New(); + input::TextInputState state; // TODO(abarth): Deserialize state. auto text = args.FindMember("text"); if (text != args.MemberEnd() && text->value.IsString()) - state->text = text->value.GetString(); + state.text = text->value.GetString(); auto selection_base = args.FindMember("selectionBase"); if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) - state->selection->base = selection_base->value.GetInt(); + state.selection.base = selection_base->value.GetInt(); auto selection_extent = args.FindMember("selectionExtent"); if (selection_extent != args.MemberEnd() && selection_extent->value.IsInt()) - state->selection->extent = selection_extent->value.GetInt(); + state.selection.extent = selection_extent->value.GetInt(); auto selection_affinity = args.FindMember("selectionAffinity"); if (selection_affinity != args.MemberEnd() && selection_affinity->value.IsString() && selection_affinity->value == "TextAffinity.upstream") - state->selection->affinity = mozart::TextAffinity::UPSTREAM; + state.selection.affinity = input::TextAffinity::UPSTREAM; else - state->selection->affinity = mozart::TextAffinity::DOWNSTREAM; + state.selection.affinity = input::TextAffinity::DOWNSTREAM; // We ignore selectionIsDirectional because that concept doesn't exist on // Fuchsia. auto composing_base = args.FindMember("composingBase"); if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) - state->composing->start = composing_base->value.GetInt(); + state.composing.start = composing_base->value.GetInt(); auto composing_extent = args.FindMember("composingExtent"); if (composing_extent != args.MemberEnd() && composing_extent->value.IsInt()) - state->composing->end = composing_extent->value.GetInt(); + state.composing.end = composing_extent->value.GetInt(); ime_->SetState(std::move(state)); } } else if (method->value == "TextInput.clearClient") { diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h index 9888d061352bb..44deee166374c 100644 --- a/content_handler/platform_view.h +++ b/content_handler/platform_view.h @@ -7,15 +7,16 @@ #include #include +#include +#include +#include +#include + #include "accessibility_bridge.h" #include "flutter/lib/ui/window/viewport_metrics.h" #include "flutter/shell/common/platform_view.h" -#include "lib/clipboard/fidl/clipboard.fidl.h" -#include "lib/fidl/cpp/bindings/binding.h" +#include "lib/fidl/cpp/binding.h" #include "lib/fxl/macros.h" -#include "lib/ui/input/fidl/input_connection.fidl.h" -#include "lib/ui/views/fidl/view_manager.fidl.h" -#include "lib/ui/views/fidl/views.fidl.h" #include "surface.h" namespace flutter { @@ -23,39 +24,36 @@ namespace flutter { // The per engine component residing on the platform thread is responsible for // all platform specific integrations. class PlatformView final : public shell::PlatformView, - public mozart::ViewListener, - public mozart::InputMethodEditorClient, - public mozart::InputListener { + public views_v1::ViewListener, + public input::InputMethodEditorClient, + public input::InputListener { public: PlatformView( PlatformView::Delegate& delegate, std::string debug_label, blink::TaskRunners task_runners, component::ServiceProviderPtr parent_environment_service_provider, - mozart::ViewManagerPtr& view_manager, - f1dl::InterfaceRequest view_owner, + views_v1::ViewManagerPtr& view_manager, + fidl::InterfaceRequest view_owner, ui::ScenicPtr scenic, zx::eventpair export_token, - zx::eventpair import_token, - maxwell::ContextWriterPtr accessibility_context_writer, - OnMetricsUpdate on_session_metrics_did_change, - fxl::Closure session_error_callback); + modular::ContextWriterPtr accessibility_context_writer); ~PlatformView(); void UpdateViewportMetrics(double pixel_ratio); - mozart::ViewPtr& GetMozartView(); + views_v1::ViewPtr& GetMozartView(); private: const std::string debug_label_; - mozart::ViewPtr view_; - f1dl::Binding view_listener_; - mozart::InputConnectionPtr input_connection_; - f1dl::Binding input_listener_; + views_v1::ViewPtr view_; + fidl::Binding view_listener_; + input::InputConnectionPtr input_connection_; + fidl::Binding input_listener_; int current_text_input_client_ = 0; - f1dl::Binding ime_client_; - mozart::InputMethodEditorPtr ime_; + fidl::Binding ime_client_; + input::InputMethodEditorPtr ime_; modular::ClipboardPtr clipboard_; ui::ScenicPtr scenic_; AccessibilityBridge accessibility_bridge_; @@ -70,31 +68,29 @@ class PlatformView final : public shell::PlatformView, void RegisterPlatformMessageHandlers(); - void UpdateViewportMetrics(const mozart::ViewLayoutPtr& layout); + void UpdateViewportMetrics(const views_v1::ViewLayout& layout); void FlushViewportMetrics(); - // |mozart::ViewListener| - void OnPropertiesChanged( - mozart::ViewPropertiesPtr properties, - const OnPropertiesChangedCallback& callback) override; + // |views_v1::ViewListener| + void OnPropertiesChanged(views_v1::ViewProperties properties, + OnPropertiesChangedCallback callback) override; - // |mozart::InputMethodEditorClient| - void DidUpdateState(mozart::TextInputStatePtr state, - mozart::InputEventPtr event) override; + // |input::InputMethodEditorClient| + void DidUpdateState(input::TextInputState state, + std::unique_ptr event) override; - // |mozart::InputMethodEditorClient| - void OnAction(mozart::InputMethodAction action) override; + // |input::InputMethodEditorClient| + void OnAction(input::InputMethodAction action) override; - // |mozart::InputListener| - void OnEvent(mozart::InputEventPtr event, - const OnEventCallback& callback) override; + // |input::InputListener| + void OnEvent(input::InputEvent event, OnEventCallback callback) override; - bool OnHandlePointerEvent(const mozart::PointerEventPtr& pointer); + bool OnHandlePointerEvent(const input::PointerEvent& pointer); - bool OnHandleKeyboardEvent(const mozart::KeyboardEventPtr& keyboard); + bool OnHandleKeyboardEvent(const input::KeyboardEvent& keyboard); - bool OnHandleFocusEvent(const mozart::FocusEventPtr& focus); + bool OnHandleFocusEvent(const input::FocusEvent& focus); // |shell::PlatformView| std::unique_ptr CreateRenderingSurface() override; diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index 870020abb670f..b1b6951f95799 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -4,6 +4,7 @@ #include "session_connection.h" +#include "lib/fidl/cpp/optional.h" #include "lib/ui/scenic/fidl_helpers.h" namespace flutter { @@ -26,28 +27,29 @@ SessionConnection::SessionConnection( this, std::placeholders::_1)); root_node_.Bind(std::move(import_token)); - root_node_.SetEventMask(ui::gfx::kMetricsEventMask); - session_.Present(0, [](ui::PresentationInfoPtr info) {}); + root_node_.SetEventMask(gfx::kMetricsEventMask); + session_.Present(0, [](auto) {}); } SessionConnection::~SessionConnection() = default; -void SessionConnection::OnSessionEvents(f1dl::Array events) { - using Type = ui::gfx::Event::Tag; +void SessionConnection::OnSessionEvents(fidl::VectorPtr events) { + using Type = gfx::Event::Tag; for (auto& raw_event : *events) { - if (!raw_event->is_gfx()) { + if (!raw_event.is_gfx()) { continue; } - auto& event = raw_event->get_gfx(); + auto& event = raw_event.gfx(); - switch (event->which()) { - case Type::METRICS: { - if (event->get_metrics()->node_id == root_node_.id()) { - auto& metrics = event->get_metrics()->metrics; - double device_pixel_ratio = metrics->scale_x; - scene_update_context_.set_metrics(std::move(metrics)); + switch (event.Which()) { + case Type::kMetrics: { + if (event.metrics().node_id == root_node_.id()) { + auto& metrics = event.metrics().metrics; + double device_pixel_ratio = metrics.scale_x; + scene_update_context_.set_metrics( + fidl::MakeOptional(std::move(metrics))); if (metrics_changed_callback_) { metrics_changed_callback_(device_pixel_ratio); } @@ -63,8 +65,8 @@ void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { // Flush all session ops. Paint tasks have not yet executed but those are // fenced. The compositor can start processing ops while we finalize paint // tasks. - session_.Present(0, // presentation_time. (placeholder). - [](ui::PresentationInfoPtr) {} // callback + session_.Present(0, // presentation_time. (placeholder). + [](auto) {} // callback ); // Execute paint tasks and signal fences. diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index e4f39d314c98f..3cd128b86724c 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -8,7 +8,7 @@ #include "flutter/flow/compositor_context.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fidl/cpp/bindings/interface_handle.h" +#include "lib/fidl/cpp/interface_handle.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" #include "lib/ui/scenic/client/resources.h" @@ -33,7 +33,7 @@ class SessionConnection final { bool has_metrics() const { return scene_update_context_.has_metrics(); } - const ui::gfx::MetricsPtr& metrics() const { + const gfx::MetricsPtr& metrics() const { return scene_update_context_.metrics(); } @@ -53,7 +53,7 @@ class SessionConnection final { flow::SceneUpdateContext scene_update_context_; OnMetricsUpdate metrics_changed_callback_; - void OnSessionEvents(f1dl::Array events); + void OnSessionEvents(fidl::VectorPtr events); void EnqueueClearOps(); diff --git a/content_handler/surface.cc b/content_handler/surface.cc index 8efe1975fbfdb..8f3699aa04da0 100644 --- a/content_handler/surface.cc +++ b/content_handler/surface.cc @@ -13,18 +13,8 @@ namespace flutter { -Surface::Surface(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback) - : shell::Surface(std::make_unique( - scenic, - debug_label, - std::move(import_token), - std::move(session_metrics_did_change_callback), - std::move(session_error_callback))), - debug_label_(debug_label) {} +Surface::Surface(std::string debug_label) + : debug_label_(std::move(debug_label)) {} Surface::~Surface() = default; @@ -58,15 +48,15 @@ static zx_status_t DriverWatcher(int dirfd, } bool Surface::CanConnectToDisplay() { - constexpr char kDisplayDriverClass[] = "/dev/class/display"; - fxl::UniqueFD fd(open(kDisplayDriverClass, O_DIRECTORY | O_RDONLY)); + constexpr char kGpuDriverClass[] = "/dev/class/gpu"; + fxl::UniqueFD fd(open(kGpuDriverClass, O_DIRECTORY | O_RDONLY)); if (fd.get() < 0) { - FXL_DLOG(ERROR) << "Failed to open " << kDisplayDriverClass; + FXL_DLOG(ERROR) << "Failed to open " << kGpuDriverClass; return false; } zx_status_t status = fdio_watch_directory( - fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(1)), nullptr); + fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(5)), nullptr); return status == ZX_ERR_STOP; } diff --git a/content_handler/surface.h b/content_handler/surface.h index 4ad27aaf540f3..99f4079f9c2df 100644 --- a/content_handler/surface.h +++ b/content_handler/surface.h @@ -16,18 +16,13 @@ namespace flutter { // thread. class Surface final : public shell::Surface { public: - Surface(const ui::ScenicPtr& scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback); + Surface(std::string debug_label); ~Surface() override; private: const bool valid_ = CanConnectToDisplay(); const std::string debug_label_; - std::unique_ptr compositor_context_; // |shell::Surface| bool IsValid() override; diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc index 53d0fd2da63d9..524fa385a6dc7 100644 --- a/content_handler/vulkan_surface.cc +++ b/content_handler/vulkan_surface.cc @@ -48,11 +48,8 @@ VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, } VulkanSurface::~VulkanSurface() { - if (async_) { - wait_.Cancel(async_); - wait_.set_object(ZX_HANDLE_INVALID); - async_ = nullptr; - } + wait_.Cancel(); + wait_.set_object(ZX_HANDLE_INVALID); } bool VulkanSurface::IsValid() const { @@ -192,10 +189,12 @@ bool VulkanSurface::AllocateDeviceMemory(sk_sp context, break; } } + VkExportMemoryAllocateInfoKHR export_allocate_info = { .sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, .pNext = nullptr, .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR}; + const VkMemoryAllocateInfo alloc_info = { .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, .pNext = &export_allocate_info, @@ -262,12 +261,12 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp context, } const GrVkImageInfo image_info = { - vk_image_, // image - {vk_memory_, 0, memory_reqs.size, 0}, // alloc - image_create_info.tiling, // tiling - image_create_info.initialLayout, // layout - image_create_info.format, // format - image_create_info.mipLevels, // level count + vk_image_, // image + {vk_memory_, 0, memory_reqs.size, 0}, // alloc + image_create_info.tiling, // tiling + image_create_info.initialLayout, // layout + image_create_info.format, // format + image_create_info.mipLevels, // level count }; GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0, @@ -399,10 +398,10 @@ void VulkanSurface::Reset() { } } -async_wait_result_t VulkanSurface::OnHandleReady( - async_t* async, - zx_status_t status, - const zx_packet_signal_t* signal) { +void VulkanSurface::OnHandleReady(async_t* async, + async::WaitBase* wait, + zx_status_t status, + const zx_packet_signal_t* signal) { if (status != ZX_OK) return; FXL_DCHECK(signal->observed & ZX_EVENT_SIGNALED); diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index f29b0f1a8bdac..d6bdfe372a776 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -151,13 +151,14 @@ bool VulkanSurfaceProducer::TransitionSurfacesToExternal( if (!command_buffer->Begin()) return false; - GrBackendRenderTarget backendRT = vk_surface->GetSkiaSurface()->getBackendRenderTarget( - SkSurface::kFlushRead_BackendHandleAccess); + GrBackendRenderTarget backendRT = + vk_surface->GetSkiaSurface()->getBackendRenderTarget( + SkSurface::kFlushRead_BackendHandleAccess); if (!backendRT.isValid()) { return false; } GrVkImageInfo imageInfo; - if(!backendRT.getVkImageInfo(&imageInfo)) { + if (!backendRT.getVkImageInfo(&imageInfo)) { return false; } diff --git a/fml/native_library.h b/fml/native_library.h index a52d01a3e09ad..a223802b8d5df 100644 --- a/fml/native_library.h +++ b/fml/native_library.h @@ -26,6 +26,10 @@ class NativeLibrary : public fxl::RefCountedThreadSafe { static fxl::RefPtr Create(const char* path); + static fxl::RefPtr CreateWithHandle( + Handle handle, + bool close_handle_when_done); + static fxl::RefPtr CreateForCurrentProcess(); const uint8_t* ResolveSymbol(const char* symbol); diff --git a/fml/platform/posix/native_library_posix.cc b/fml/platform/posix/native_library_posix.cc index 1255c38fc0821..934d1d1a7c611 100644 --- a/fml/platform/posix/native_library_posix.cc +++ b/fml/platform/posix/native_library_posix.cc @@ -45,6 +45,14 @@ fxl::RefPtr NativeLibrary::Create(const char* path) { return library->GetHandle() != nullptr ? library : nullptr; } +fxl::RefPtr NativeLibrary::CreateWithHandle( + Handle handle, + bool close_handle_when_done) { + auto library = + fxl::AdoptRef(new NativeLibrary(handle, close_handle_when_done)); + return library->GetHandle() != nullptr ? library : nullptr; +} + fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { return fxl::AdoptRef(new NativeLibrary(RTLD_DEFAULT, false)); } diff --git a/fml/platform/win/native_library_win.cc b/fml/platform/win/native_library_win.cc index 6992f06f3e886..55da45fcd1fc0 100644 --- a/fml/platform/win/native_library_win.cc +++ b/fml/platform/win/native_library_win.cc @@ -37,6 +37,14 @@ fxl::RefPtr NativeLibrary::Create(const char* path) { return library->GetHandle() != nullptr ? library : nullptr; } +fxl::RefPtr NativeLibrary::CreateWithHandle( + Handle handle, + bool close_handle_when_done) { + auto library = + fxl::AdoptRef(new NativeLibrary(handle, close_handle_when_done)); + return library->GetHandle() != nullptr ? library : nullptr; +} + fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { return fxl::AdoptRef(new NativeLibrary(::GetModuleHandle(nullptr), false)); } diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 8c568f4773c90..1f119da0a8f45 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -29,33 +29,14 @@ if (is_fuchsia) { # The sole purpose of this target is to generate a .packages file. sources = [] - dot_packages_file = "$target_gen_dir/snapshot.packages" - outputs = [ - dot_packages_file, - ] - deps = [] - foreach(dep, dart_deps) { - deps += [ "$dep($dart_toolchain)" ] - } + infer_package_name = true disable_analysis = true - script = "//build/dart/gen_dot_packages.py" - args = [ - "--out", - rebase_path(dot_packages_file, root_build_dir), - "--source-dir", - rebase_path("."), - "--root-build-dir", - rebase_path(root_build_dir), - "--root-gen-dir", - rebase_path(dart_root_gen_dir), - "--package-name", - "snapshot_root", - "--depfile", - rebase_path(depfile), - "--deps", - ] + dart_deps + deps = [ + "//topaz/public/dart/fuchsia", + "//topaz/public/dart/zircon", + ] } } @@ -148,10 +129,11 @@ action("generate_snapshot_bin") { } if (is_fuchsia) { - package_gen_dir = get_label_info(":bogus($dart_toolchain)", - "target_gen_dir") + package_gen_dir = + get_label_info(":bogus($dart_toolchain)", "target_gen_dir") package_file = "$package_gen_dir/generate_package_map.packages" - inputs += zircon_sdk_ext_files + mozart_dart_sdk_ext_files + [package_file] + inputs += + zircon_sdk_ext_files + mozart_dart_sdk_ext_files + [ package_file ] zircon_path = rebase_path(zircon_sdk_ext_lib) fuchsia_path = rebase_path(fuchsia_sdk_ext_lib) mozart_internal_path = rebase_path(mozart_dart_sdk_ext_lib) @@ -329,7 +311,7 @@ copy_entry_points_extra_json("entry_points_extra_json") { group("entry_points_json_files") { public_deps = [ - ":entry_points_json", ":entry_points_extra_json", + ":entry_points_json", ] } diff --git a/lib/ui/compositing/scene.cc b/lib/ui/compositing/scene.cc index 37514350b412f..69279c1375fcd 100644 --- a/lib/ui/compositing/scene.cc +++ b/lib/ui/compositing/scene.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/compositing/scene.h" -#include "flutter/fml/trace_event.h" +#include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/tonic/converter/dart_converter.h" diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 9c1b8efd7e1cd..db940ce9440a3 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -16,7 +16,17 @@ namespace shell { Rasterizer::Rasterizer(blink::TaskRunners task_runners) - : task_runners_(std::move(task_runners)), weak_factory_(this) {} + : Rasterizer(std::move(task_runners), + std::make_unique()) {} + +Rasterizer::Rasterizer( + blink::TaskRunners task_runners, + std::unique_ptr compositor_context) + : task_runners_(std::move(task_runners)), + compositor_context_(std::move(compositor_context)), + weak_factory_(this) { + FXL_DCHECK(compositor_context_); +} Rasterizer::~Rasterizer() = default; @@ -26,17 +36,17 @@ fml::WeakPtr Rasterizer::GetWeakPtr() const { void Rasterizer::Setup(std::unique_ptr surface) { surface_ = std::move(surface); - compositor_context_.OnGrContextCreated(); + compositor_context_->OnGrContextCreated(); } void Rasterizer::Teardown() { - compositor_context_.OnGrContextDestroyed(); + compositor_context_->OnGrContextDestroyed(); surface_.reset(); last_layer_tree_.reset(); } flow::TextureRegistry* Rasterizer::GetTextureRegistry() { - return &compositor_context_.texture_registry(); + return &compositor_context_->texture_registry(); } flow::LayerTree* Rasterizer::GetLastLayerTree() { @@ -96,12 +106,12 @@ bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) { // There is no way for the compositor to know how long the layer tree // construction took. Fortunately, the layer tree does. Grab that time // for instrumentation. - compositor_context_.engine_time().SetLapTime(layer_tree.construction_time()); + compositor_context_->engine_time().SetLapTime(layer_tree.construction_time()); auto canvas = frame->SkiaCanvas(); auto compositor_frame = - compositor_context_.AcquireFrame(surface_->GetContext(), canvas, true); + compositor_context_->AcquireFrame(surface_->GetContext(), canvas, true); if (canvas) { canvas->clear(SK_ColorBLACK); diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 79dda4ac9ceeb..873b817f8db0f 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -8,6 +8,7 @@ #include #include "flutter/common/task_runners.h" +#include "flutter/flow/compositor_context.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/surface.h" @@ -21,6 +22,9 @@ class Rasterizer final { public: Rasterizer(blink::TaskRunners task_runners); + Rasterizer(blink::TaskRunners task_runners, + std::unique_ptr compositor_context); + ~Rasterizer(); void Setup(std::unique_ptr surface); @@ -62,7 +66,7 @@ class Rasterizer final { private: blink::TaskRunners task_runners_; std::unique_ptr surface_; - flow::CompositorContext compositor_context_; + std::unique_ptr compositor_context_; std::unique_ptr last_layer_tree_; fxl::Closure next_frame_callback_; fml::WeakPtrFactory weak_factory_; diff --git a/vulkan/vulkan_swapchain.cc b/vulkan/vulkan_swapchain.cc index 2eb6d6e1c7be2..c59c16620fbfe 100644 --- a/vulkan/vulkan_swapchain.cc +++ b/vulkan/vulkan_swapchain.cc @@ -223,12 +223,12 @@ sk_sp VulkanSwapchain::CreateSkiaSurface( } const GrVkImageInfo image_info = { - image, // image - GrVkAlloc(), // alloc - VK_IMAGE_TILING_OPTIMAL, // tiling - VK_IMAGE_LAYOUT_UNDEFINED, // layout - surface_format_.format, // format - 1, // level count + image, // image + GrVkAlloc(), // alloc + VK_IMAGE_TILING_OPTIMAL, // tiling + VK_IMAGE_LAYOUT_UNDEFINED, // layout + surface_format_.format, // format + 1, // level count }; // TODO(chinmaygarde): Setup the stencil buffer and the sampleCnt. @@ -460,7 +460,7 @@ VulkanSwapchain::AcquireResult VulkanSwapchain::AcquireSurface() { FXL_DLOG(INFO) << "Could not access surface at the image index."; return error; } - + GrBackendRenderTarget backendRT = surface->getBackendRenderTarget( SkSurface::kFlushRead_BackendHandleAccess); if (!backendRT.isValid()) { From a20fd83039d7f32ade003fac3f7e280026910ac5 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Tue, 24 Apr 2018 09:33:52 -0700 Subject: [PATCH 0158/1190] [fuchsia] Remove dead package file generation from core snapshots. (#5071) --- lib/snapshot/BUILD.gn | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 1f119da0a8f45..bf4e1cf0235d5 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -24,22 +24,6 @@ copy("generate_dart_ui") { ] } -if (is_fuchsia) { - dart_library("generate_package_map") { - # The sole purpose of this target is to generate a .packages file. - sources = [] - - infer_package_name = true - - disable_analysis = true - - deps = [ - "//topaz/public/dart/fuchsia", - "//topaz/public/dart/zircon", - ] - } -} - action("generate_snapshot_bin") { if (is_fuchsia) { snapshot_dart = "snapshot_fuchsia.dart" @@ -68,7 +52,6 @@ action("generate_snapshot_bin") { snapshot_dart, ] + dart_ui_files if (is_fuchsia) { - deps += [ ":generate_package_map" ] inputs += [ "fuchsia_compilation_trace.txt" ] } @@ -129,11 +112,7 @@ action("generate_snapshot_bin") { } if (is_fuchsia) { - package_gen_dir = - get_label_info(":bogus($dart_toolchain)", "target_gen_dir") - package_file = "$package_gen_dir/generate_package_map.packages" - inputs += - zircon_sdk_ext_files + mozart_dart_sdk_ext_files + [ package_file ] + inputs += zircon_sdk_ext_files + mozart_dart_sdk_ext_files zircon_path = rebase_path(zircon_sdk_ext_lib) fuchsia_path = rebase_path(fuchsia_sdk_ext_lib) mozart_internal_path = rebase_path(mozart_dart_sdk_ext_lib) @@ -141,8 +120,6 @@ action("generate_snapshot_bin") { "--url_mapping=dart:zircon,$zircon_path", "--url_mapping=dart:fuchsia,$fuchsia_path", "--url_mapping=dart:mozart.internal,$mozart_internal_path", - "--packages", - rebase_path(package_file), "--load_compilation_trace", rebase_path("fuchsia_compilation_trace.txt"), ] From 3e20562a1dc67bb985b59d9ce20f58941bd7b487 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 24 Apr 2018 14:35:06 -0400 Subject: [PATCH 0159/1190] Roll src/third_party/skia/ 5209d7fce..2d2c1e32c (42 commits; 1 trivial rolls) (#5070) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index 3f704b72a2105..e99c0fdd6c83f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5209d7fce35f4426be86de56aa4a1966c992e6f5', + 'skia_revision': '2d2c1e32ce75bb85816716a9b14ed1cdbf971136', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3c761431d5f76..56134c4f06899 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c777dad9be6d069deb9606cc1751cf4d +Signature: ae48a97662b0948430ef3a0e95bf3730 UNUSED LICENSES: @@ -17550,6 +17550,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SafeStack.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json @@ -17748,6 +17749,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Debug-All.json @@ -17790,9 +17792,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_push.jso FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/internal_bot_1.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/internal_bot_2.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/update_meta_config.expected/Housekeeper-Nightly-UpdateMetaConfig.json -FILE: ../../../third_party/skia/infra/bots/recipes/update_meta_config.expected/failed_update.json -FILE: ../../../third_party/skia/infra/bots/recipes/update_meta_config.expected/trybot_test.json FILE: ../../../third_party/skia/infra/bots/recipes/upload_calmbench_results.expected/normal_bot.json FILE: ../../../third_party/skia/infra/bots/recipes/upload_calmbench_results.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/alternate_bucket.json From 0e95bb2c4a9227d130174481eb8ee6fa45d73a1f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 24 Apr 2018 18:02:07 -0400 Subject: [PATCH 0160/1190] Roll src/third_party/skia/ 2d2c1e32c..058f2e6ed (35 commits; 1 trivial rolls) (#5077) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index e99c0fdd6c83f..bf56b37d4558b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2d2c1e32ce75bb85816716a9b14ed1cdbf971136', + 'skia_revision': '058f2e6ed2921399879d987e3276f96e8c0cd70b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 56134c4f06899..fb1213bdfc73a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ae48a97662b0948430ef3a0e95bf3730 +Signature: f189cf14d77aade905e2e7bf9a892c1b UNUSED LICENSES: @@ -17196,6 +17196,7 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionSetPath.cpp FILE: ../../../third_party/skia/gm/hugepath.cpp FILE: ../../../third_party/skia/gm/localmatrixshader.cpp FILE: ../../../third_party/skia/gm/makeRasterImage.cpp +FILE: ../../../third_party/skia/gm/mandoline.cpp FILE: ../../../third_party/skia/gm/orientation.cpp FILE: ../../../third_party/skia/gm/pathmeasure.cpp FILE: ../../../third_party/skia/gm/polygonoffset.cpp @@ -17317,10 +17318,10 @@ FILE: ../../../third_party/skia/third_party/skcms/src/ICCProfile.c FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.c FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.h FILE: ../../../third_party/skia/third_party/skcms/src/Macros.h +FILE: ../../../third_party/skia/third_party/skcms/src/PolyTF.c FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.c FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.h FILE: ../../../third_party/skia/third_party/skcms/src/RandomBytes.h -FILE: ../../../third_party/skia/third_party/skcms/src/TF13.c FILE: ../../../third_party/skia/third_party/skcms/src/TransferFunction.c FILE: ../../../third_party/skia/third_party/skcms/src/TransferFunction.h FILE: ../../../third_party/skia/third_party/skcms/src/Transform.c From ac682632d7b050463e0461cbb416aaedbcba4bcf Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 24 Apr 2018 15:50:52 -0700 Subject: [PATCH 0161/1190] Hold a global reference to the AssetManager Java object backing the APKAssetProvider (#5078) Fixes https://github.com/flutter/flutter/issues/16222 --- shell/platform/android/apk_asset_provider.cc | 3 ++- shell/platform/android/apk_asset_provider.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/shell/platform/android/apk_asset_provider.cc b/shell/platform/android/apk_asset_provider.cc index 4cf6da16dc64f..268897ef5c58f 100644 --- a/shell/platform/android/apk_asset_provider.cc +++ b/shell/platform/android/apk_asset_provider.cc @@ -10,7 +10,8 @@ namespace blink { APKAssetProvider::APKAssetProvider(JNIEnv* env, jobject jassetManager, std::string directory) - : directory_(std::move(directory)) { + : java_asset_manager_(env, jassetManager), + directory_(std::move(directory)) { assetManager_ = AAssetManager_fromJava(env, jassetManager); } diff --git a/shell/platform/android/apk_asset_provider.h b/shell/platform/android/apk_asset_provider.h index 70ddbe454bc61..7c3f8e12a23b2 100644 --- a/shell/platform/android/apk_asset_provider.h +++ b/shell/platform/android/apk_asset_provider.h @@ -9,6 +9,7 @@ #include #include "flutter/assets/asset_resolver.h" +#include "flutter/fml/platform/android/scoped_java_ref.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { @@ -21,6 +22,7 @@ class APKAssetProvider final : public AssetResolver { virtual ~APKAssetProvider(); private: + fml::jni::ScopedJavaGlobalRef java_asset_manager_; AAssetManager* assetManager_; const std::string directory_; @@ -36,4 +38,4 @@ class APKAssetProvider final : public AssetResolver { } // namespace blink -#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file +#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H From f1234eb077ead40f0ab2c88b96d1089acb0c355e Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 24 Apr 2018 16:02:38 -0700 Subject: [PATCH 0162/1190] Add disabled failing test for floating point errors on matrix decomposition. (#5076) --- flow/matrix_decomposition_unittests.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/flow/matrix_decomposition_unittests.cc b/flow/matrix_decomposition_unittests.cc index 37a6322b240a1..df80090881512 100644 --- a/flow/matrix_decomposition_unittests.cc +++ b/flow/matrix_decomposition_unittests.cc @@ -93,3 +93,20 @@ TEST(MatrixDecomposition, Combination) { ASSERT_FLOAT_EQ(sine, decomposition.rotation().fData[2]); ASSERT_FLOAT_EQ(cos(rotation * 0.5), decomposition.rotation().fData[3]); } + +TEST(MatrixDecomposition, DISABLED_ScaleFloatError) { + SkMatrix44 matrix = SkMatrix44::I(); + + const auto scale = 1.7734375f; + matrix.setScale(scale, scale, 1.f); + + flow::MatrixDecomposition decomposition(matrix); + ASSERT_TRUE(decomposition.IsValid()); + + ASSERT_FLOAT_EQ(scale, decomposition.scale().fX); + ASSERT_FLOAT_EQ(scale, decomposition.scale().fY); + ASSERT_FLOAT_EQ(1.f, decomposition.scale().fZ); + ASSERT_FLOAT_EQ(0, decomposition.rotation().fData[0]); + ASSERT_FLOAT_EQ(0, decomposition.rotation().fData[1]); + ASSERT_FLOAT_EQ(0, decomposition.rotation().fData[2]); +} From 6a93ef1c707fb1fdea697a1c35bf68fc4e2986e3 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 24 Apr 2018 16:02:54 -0700 Subject: [PATCH 0163/1190] Call SkGraphics::Init earlier on Fuchsia. (#5079) --- content_handler/application_runner.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc index 9a36fd1881c0e..81ab98c7f8325 100644 --- a/content_handler/application_runner.cc +++ b/content_handler/application_runner.cc @@ -8,6 +8,7 @@ #include "flutter/lib/ui/text/font_collection.h" #include "fuchsia_font_manager.h" +#include "third_party/skia/include/core/SkGraphics.h" #include "lib/icu_data/cpp/icu_data.h" namespace flutter { @@ -15,6 +16,9 @@ namespace flutter { ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) : on_termination_callback_(std::move(on_termination_callback)), host_context_(component::ApplicationContext::CreateFromStartupInfo()) { + + SkGraphics::Init(); + SetupICU(); SetupGlobalFonts(); From 9859af123eb383ade52208a9db58ac39db84bfc2 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 24 Apr 2018 18:06:53 -0700 Subject: [PATCH 0164/1190] Roll dart to 29d6e963702fcbb0ed0d5ca67d6b5f977ac0c328 (#5083) Picks up a fix for math on 32bit ARM devices running iOS, required for https://github.com/flutter/flutter/issues/2089. --- DEPS | 2 +- tools/licenses/pubspec.lock | 4 ++-- travis/licenses_golden/licenses_third_party | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index bf56b37d4558b..eba5d368d4cd8 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'fe606f890b0a311da802c78b0af414a3c2087a79', + 'dart_revision': '29d6e963702fcbb0ed0d5ca67d6b5f977ac0c328', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index fec5d297e5a9d..8ddf5c5bc1fed 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -1,5 +1,5 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: archive: dependency: "direct main" @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-dev.20.0" + dart: ">=1.21.0 <=2.0.0-edge.c080951d45e79cd25df98036c4be835b284a269c" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fb1213bdfc73a..02fbe4c34f567 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f189cf14d77aade905e2e7bf9a892c1b +Signature: 79fed6bd28e4f174af857f8916603d49 UNUSED LICENSES: @@ -4359,6 +4359,7 @@ FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Def FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml FILE: ../../../third_party/dart/runtime/CPPLINT.cfg FILE: ../../../third_party/dart/runtime/observatory/.analysis_options +FILE: ../../../third_party/dart/runtime/observatory/dart2js.packages FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png From b08b15290ef3eee69da30dde87b2d3d0796ad695 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 24 Apr 2018 18:49:40 -0700 Subject: [PATCH 0165/1190] Revert "Roll dart to 29d6e963702fcbb0ed0d5ca67d6b5f977ac0c328 (#5083)" (#5085) This reverts commit 9859af123eb383ade52208a9db58ac39db84bfc2. --- DEPS | 2 +- tools/licenses/pubspec.lock | 4 ++-- travis/licenses_golden/licenses_third_party | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index eba5d368d4cd8..bf56b37d4558b 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '29d6e963702fcbb0ed0d5ca67d6b5f977ac0c328', + 'dart_revision': 'fe606f890b0a311da802c78b0af414a3c2087a79', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 8ddf5c5bc1fed..fec5d297e5a9d 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -1,5 +1,5 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See http://pub.dartlang.org/doc/glossary.html#lockfile packages: archive: dependency: "direct main" @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-edge.c080951d45e79cd25df98036c4be835b284a269c" + dart: ">=1.21.0 <=2.0.0-dev.20.0" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 02fbe4c34f567..fb1213bdfc73a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 79fed6bd28e4f174af857f8916603d49 +Signature: f189cf14d77aade905e2e7bf9a892c1b UNUSED LICENSES: @@ -4359,7 +4359,6 @@ FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Def FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml FILE: ../../../third_party/dart/runtime/CPPLINT.cfg FILE: ../../../third_party/dart/runtime/observatory/.analysis_options -FILE: ../../../third_party/dart/runtime/observatory/dart2js.packages FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png From dd34fd1787056aff204d406660c08b41abdfdb3c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Apr 2018 08:18:06 -0400 Subject: [PATCH 0166/1190] Roll src/third_party/skia/ 058f2e6ed..e1c37a7b8 (4 commits) (#5086) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index bf56b37d4558b..c554bc27b86b4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '058f2e6ed2921399879d987e3276f96e8c0cd70b', + 'skia_revision': 'e1c37a7b8f218ee89394afe61b12e3bb312564fd', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fb1213bdfc73a..7c5be9e1b13e4 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f189cf14d77aade905e2e7bf9a892c1b +Signature: 3e4a298565109437e2963dd4f36ddb99 UNUSED LICENSES: From ee2532f2d28b262b0555a95a11d78b3659eb9223 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Apr 2018 10:18:17 -0400 Subject: [PATCH 0167/1190] Roll src/third_party/skia/ e1c37a7b8..ec4e7358b (1 commit) (#5087) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c554bc27b86b4..2a548dbe3e500 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e1c37a7b8f218ee89394afe61b12e3bb312564fd', + 'skia_revision': 'ec4e7358ba6d5d68c32f0cdacfba454957960841', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7c5be9e1b13e4..e025bf05d766c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3e4a298565109437e2963dd4f36ddb99 +Signature: 9e599f510bdbd85ea2cb0acef424c2b4 UNUSED LICENSES: From cc72fc1c30e85a5339cc30c841f0ada5b8f6129f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Apr 2018 11:03:43 -0400 Subject: [PATCH 0168/1190] Roll src/third_party/skia/ ec4e7358b..77e95f706 (1 commit) (#5088) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2a548dbe3e500..ba23db8bcb9f1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ec4e7358ba6d5d68c32f0cdacfba454957960841', + 'skia_revision': '77e95f7067e3bbb4234965c8413f6f86e345bca6', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e025bf05d766c..faf71fa6d4485 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9e599f510bdbd85ea2cb0acef424c2b4 +Signature: 78a7c160dd2a69a8ea38cb8bd839dadb UNUSED LICENSES: From cb2092b3fde41aa5ab2451cc8c54c212155f2155 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 25 Apr 2018 10:03:19 -0700 Subject: [PATCH 0169/1190] Roll Dart to 8d4074175fb95cd4da810b4bf652a956449bac37 (#5089) --- DEPS | 4 ++-- tools/licenses/pubspec.lock | 4 ++-- travis/licenses_golden/licenses_third_party | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index ba23db8bcb9f1..9b00128a69b25 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'fe606f890b0a311da802c78b0af414a3c2087a79', + 'dart_revision': '8d4074175fb95cd4da810b4bf652a956449bac37', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -59,7 +59,7 @@ vars = { 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.47', + 'dart_linter_tag': '0.1.49', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index fec5d297e5a9d..8ddf5c5bc1fed 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -1,5 +1,5 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: archive: dependency: "direct main" @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-dev.20.0" + dart: ">=1.21.0 <=2.0.0-edge.c080951d45e79cd25df98036c4be835b284a269c" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index faf71fa6d4485..b30f16cbe62e3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 78a7c160dd2a69a8ea38cb8bd839dadb +Signature: 8833ca9e32a14087bf1856b68d4d3aaf UNUSED LICENSES: @@ -4359,6 +4359,7 @@ FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Def FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml FILE: ../../../third_party/dart/runtime/CPPLINT.cfg FILE: ../../../third_party/dart/runtime/observatory/.analysis_options +FILE: ../../../third_party/dart/runtime/observatory/dart2js.packages FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png From 8da9398ed3e3932466ca0777b6e4b644c9d3219c Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 25 Apr 2018 10:29:20 -0700 Subject: [PATCH 0170/1190] Throw an exception if a secondary isolate tries to send a platform message (#5069) Platform messages are only support in the UI isolate. Secondary isolates do not have a window that can receive incoming messages, and outgoing messages are not tagged with a destination isolate and thus will always be dispatched to the UI isolate. Fixes https://github.com/flutter/flutter/issues/16846 --- lib/ui/window.dart | 11 +++++++---- lib/ui/window/window.cc | 20 ++++++++++++++------ 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index 05bf0b73a9f81..e84cb267940d8 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -681,11 +681,14 @@ class Window { void sendPlatformMessage(String name, ByteData data, PlatformMessageResponseCallback callback) { - _sendPlatformMessage(name, _zonedPlatformMessageResponseCallback(callback), data); + final String error = + _sendPlatformMessage(name, _zonedPlatformMessageResponseCallback(callback), data); + if (error != null) + throw new Exception(error); } - void _sendPlatformMessage(String name, - PlatformMessageResponseCallback callback, - ByteData data) native 'Window_sendPlatformMessage'; + String _sendPlatformMessage(String name, + PlatformMessageResponseCallback callback, + ByteData data) native 'Window_sendPlatformMessage'; /// Called whenever this window receives a message from a platform-specific /// plugin. diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 4cce1cc5903b0..2d5d7a1569b8f 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -54,12 +54,18 @@ void UpdateSemantics(Dart_NativeArguments args) { UIDartState::Current()->window()->client()->UpdateSemantics(update); } -void SendPlatformMessage(Dart_Handle window, - const std::string& name, - Dart_Handle callback, - const tonic::DartByteData& data) { +Dart_Handle SendPlatformMessage(Dart_Handle window, + const std::string& name, + Dart_Handle callback, + const tonic::DartByteData& data) { UIDartState* dart_state = UIDartState::Current(); + if (!dart_state->window()) { + // Must release the TypedData buffer before allocating other Dart objects. + data.Release(); + return ToDart("Platform messages can only be sent from the main isolate"); + } + fxl::RefPtr response; if (!Dart_IsNull(callback)) { response = fxl::MakeRefCounted( @@ -67,16 +73,18 @@ void SendPlatformMessage(Dart_Handle window, dart_state->GetTaskRunners().GetUITaskRunner()); } if (Dart_IsNull(data.dart_handle())) { - UIDartState::Current()->window()->client()->HandlePlatformMessage( + dart_state->window()->client()->HandlePlatformMessage( fxl::MakeRefCounted(name, response)); } else { const uint8_t* buffer = static_cast(data.data()); - UIDartState::Current()->window()->client()->HandlePlatformMessage( + dart_state->window()->client()->HandlePlatformMessage( fxl::MakeRefCounted( name, std::vector(buffer, buffer + data.length_in_bytes()), response)); } + + return Dart_Null(); } void _SendPlatformMessage(Dart_NativeArguments args) { From cbec56a3de1e66357cff3c3766c918667af06f03 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Apr 2018 14:37:21 -0400 Subject: [PATCH 0171/1190] Roll src/third_party/skia/ 77e95f706..de5cffbc4 (14 commits) (#5090) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9b00128a69b25..1769ab51d30d0 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '77e95f7067e3bbb4234965c8413f6f86e345bca6', + 'skia_revision': 'de5cffbc48fce4decd1caf84d5a5e4fc0b5b48ed', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b30f16cbe62e3..17471645af493 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8833ca9e32a14087bf1856b68d4d3aaf +Signature: 93f68aa0f203ef531ba8a7c96b225e9d UNUSED LICENSES: From 78f8a0f45a94864394a6e50af63831e595ea0547 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 25 Apr 2018 13:31:13 -0700 Subject: [PATCH 0172/1190] [fuchsia] Changes for running Dart 2 on flutter_runner. (#5080) - Remove assumption that we're in Dart 2 mode only if there's a platform kernel. - Load core snapshots from the package instead of linking them in. --- BUILD.gn | 158 +++++++++++++++--- common/settings.cc | 11 +- common/settings.h | 11 +- content_handler/application.cc | 8 + runtime/BUILD.gn | 3 +- runtime/dart_isolate.cc | 14 +- runtime/dart_snapshot.cc | 28 ++-- runtime/dart_vm.cc | 4 +- shell/common/switches.cc | 27 ++- shell/platform/android/flutter_main.cc | 7 +- .../framework/Source/FlutterDartProject.mm | 2 +- shell/platform/embedder/embedder.cc | 9 +- shell/testing/tester_main.cc | 2 +- 13 files changed, 211 insertions(+), 73 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 6560972bc58a5..b5be7064e977d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -79,47 +79,165 @@ if (is_fuchsia) { "$flutter_root/content_handler:aot", ] if (flutter_runtime_mode != "release") { - deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] + deps += [ + "//third_party/dart/runtime/observatory:embedded_archive_observatory", + ] } binary = "flutter_aot_runner" if (flutter_runtime_mode != "release") { - resources = [ { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - } ] + resources = [ + { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + }, + ] } - meta = [ { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - } ] + meta = [ + { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + }, + ] + } + + package("flutter2_aot_runner") { + deps = [ + "$flutter_root/content_handler:aot", + ] + if (flutter_runtime_mode != "release") { + deps += [ + "//third_party/dart/runtime/observatory:embedded_archive_observatory", + ] + } + + binary = "flutter_aot_runner" + + if (flutter_runtime_mode != "release") { + resources = [ + { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + }, + ] + } + + meta = [ + { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + }, + ] } package("flutter_jit_runner") { + snapshot_label = "$flutter_root/lib/snapshot:generate_snapshot_bin" + snapshot_gen_dir = get_label_info(snapshot_label, "target_gen_dir") + + deps = [ + "$flutter_root/content_handler:jit", + snapshot_label, + ] + if (flutter_runtime_mode != "release") { + deps += [ + "//third_party/dart/runtime/observatory:embedded_archive_observatory", + ] + } + + binary = "flutter_jit_runner" + + resources = [ + { + path = rebase_path("$snapshot_gen_dir/vm_isolate_snapshot.bin") + dest = "vm_snapshot_data.bin" + }, + { + path = rebase_path("$snapshot_gen_dir/vm_snapshot_instructions.bin") + dest = "vm_snapshot_instructions.bin" + }, + { + path = rebase_path("$snapshot_gen_dir/isolate_snapshot.bin") + dest = "isolate_core_snapshot_data.bin" + }, + { + path = + rebase_path("$snapshot_gen_dir/isolate_snapshot_instructions.bin") + dest = "isolate_core_snapshot_instructions.bin" + }, + ] + if (flutter_runtime_mode != "release") { + resources += [ + { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + }, + ] + } + + meta = [ + { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + }, + ] + } + + package("flutter2_jit_runner") { + snapshot_label = "//topaz/runtime/flutter_runner/kernel:kernel_core_snapshot" + snapshot_gen_dir = get_label_info(snapshot_label, "target_gen_dir") + deps = [ "$flutter_root/content_handler:jit", + snapshot_label, ] if (flutter_runtime_mode != "release") { - deps += [ "//third_party/dart/runtime/observatory:embedded_archive_observatory" ] + deps += [ + "//third_party/dart/runtime/observatory:embedded_archive_observatory", + ] } binary = "flutter_jit_runner" + resources = [ + { + path = rebase_path("$snapshot_gen_dir/vm_isolate_snapshot.bin") + dest = "vm_snapshot_data.bin" + }, + { + path = rebase_path("$snapshot_gen_dir/vm_snapshot_instructions.bin") + dest = "vm_snapshot_instructions.bin" + }, + { + path = rebase_path("$snapshot_gen_dir/isolate_snapshot.bin") + dest = "isolate_core_snapshot_data.bin" + }, + { + path = + rebase_path("$snapshot_gen_dir/isolate_snapshot_instructions.bin") + dest = "isolate_core_snapshot_instructions.bin" + }, + ] if (flutter_runtime_mode != "release") { - resources = [ { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - } ] + resources += [ + { + path = rebase_path( + "$root_gen_dir/observatory/embedded_archive_observatory.tar") + dest = "observatory.tar" + }, + ] } - meta = [ { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - } ] + meta = [ + { + path = rebase_path("content_handler/meta/sandbox") + dest = "sandbox" + }, + ] } } else { group("dist") { diff --git a/common/settings.cc b/common/settings.cc index 85523e1b9a29f..e6a9f24ba7fea 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -11,16 +11,13 @@ namespace blink { std::string Settings::ToString() const { std::stringstream stream; stream << "Settings: " << std::endl; - stream << "aot_snapshot_path: " << aot_snapshot_path << std::endl; stream << "script_snapshot_path: " << script_snapshot_path << std::endl; - stream << "aot_vm_snapshot_data_filename: " << aot_vm_snapshot_data_filename + stream << "vm_snapshot_data_path: " << vm_snapshot_data_path << std::endl; + stream << "vm_snapshot_instr_path: " << vm_snapshot_instr_path << std::endl; + stream << "isolate_snapshot_data_path: " << isolate_snapshot_data_path << std::endl; - stream << "aot_vm_snapshot_instr_filename: " << aot_vm_snapshot_instr_filename + stream << "isolate_snapshot_instr_path: " << isolate_snapshot_instr_path << std::endl; - stream << "aot_isolate_snapshot_data_filename: " - << aot_isolate_snapshot_data_filename << std::endl; - stream << "aot_isolate_snapshot_instr_filename: " - << aot_isolate_snapshot_instr_filename << std::endl; stream << "application_library_path: " << application_library_path << std::endl; stream << "main_dart_file_path: " << main_dart_file_path << std::endl; diff --git a/common/settings.h b/common/settings.h index ffb80131f029d..4f035d39dba8e 100644 --- a/common/settings.h +++ b/common/settings.h @@ -24,13 +24,12 @@ using TaskObserverRemove = std::function; struct Settings { // VM settings std::string script_snapshot_path; - std::string kernel_snapshot_path; + std::string platform_kernel_path; - std::string aot_snapshot_path; - std::string aot_vm_snapshot_data_filename; - std::string aot_vm_snapshot_instr_filename; - std::string aot_isolate_snapshot_data_filename; - std::string aot_isolate_snapshot_instr_filename; + std::string vm_snapshot_data_path; + std::string vm_snapshot_instr_path; + std::string isolate_snapshot_data_path; + std::string isolate_snapshot_instr_path; std::string application_library_path; std::string application_kernel_asset; diff --git a/content_handler/application.cc b/content_handler/application.cc index 3f56ab911cb64..026b324d95773 100644 --- a/content_handler/application.cc +++ b/content_handler/application.cc @@ -123,6 +123,13 @@ Application::Application( application_context_ = component::ApplicationContext::CreateFrom(std::move(startup_info)); + settings_.vm_snapshot_data_path = "pkg/data/vm_snapshot_data.bin"; + settings_.vm_snapshot_instr_path = "pkg/data/vm_snapshot_instructions.bin"; + settings_.isolate_snapshot_data_path = + "pkg/data/isolate_core_snapshot_data.bin"; + settings_.isolate_snapshot_instr_path = + "pkg/data/isolate_core_snapshot_instructions.bin"; + settings_.enable_observatory = true; settings_.icu_data_path = ""; @@ -132,6 +139,7 @@ Application::Application( settings_.assets_dir = application_assets_directory_.get(); settings_.script_snapshot_path = "snapshot_blob.bin"; + settings_.application_kernel_asset = "kernel_blob.dill"; settings_.log_tag = debug_label_ + std::string{"(flutter)"}; diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index c607bfd1fae26..8ed7952eaa544 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -114,7 +114,8 @@ source_set("runtime") { # In AOT mode, precompiled snapshots contain the instruction buffer. # Generation of the same requires all application specific script code to be # specified up front. In such cases, there can be no generic snapshot. - if (!flutter_aot) { + # In Fuchsia, we load from a file instead of linking. + if (!flutter_aot && !is_fuchsia) { deps += [ "$flutter_root/lib/snapshot" ] } } diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 7190a0b98a599..05b34b979e166 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -23,6 +23,7 @@ #include "lib/tonic/file_loader/file_loader.h" #include "lib/tonic/scopes/dart_api_scope.h" #include "lib/tonic/scopes/dart_isolate_scope.h" +#include "third_party/dart/runtime/include/dart_api.h" #include "third_party/dart/runtime/include/dart_tools_api.h" #ifdef ERROR @@ -290,9 +291,8 @@ static bool LoadKernelSnapshot(std::shared_ptr mapping) { return true; } -static bool LoadSnapshot(std::shared_ptr mapping, - bool is_kernel) { - if (is_kernel) { +static bool LoadSnapshot(std::shared_ptr mapping) { + if (Dart_IsKernel(mapping->GetMapping(), mapping->GetSize())) { return LoadKernelSnapshot(std::move(mapping)); } else { return LoadScriptSnapshot(std::move(mapping)); @@ -322,7 +322,7 @@ bool DartIsolate::PrepareForRunningFromSnapshot( return false; } - if (!LoadSnapshot(mapping, vm_->GetPlatformKernel() != nullptr)) { + if (!LoadSnapshot(mapping)) { return false; } @@ -539,8 +539,12 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( // thread. service_isolate->ResetWeakPtrFactory(); + const bool isolate_snapshot_is_dart_2 = + Dart_IsDart2Snapshot(vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); + const bool is_preview_dart2 = + vm->GetPlatformKernel() != nullptr || isolate_snapshot_is_dart_2; const bool running_from_sources = - !DartVM::IsRunningPrecompiledCode() && vm->GetPlatformKernel() == nullptr; + !DartVM::IsRunningPrecompiledCode() && !is_preview_dart2; tonic::DartState::Scope scope(service_isolate); if (!DartServiceIsolate::Startup( diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc index 9a70d95c2f35d..4483ecd6c7404 100644 --- a/runtime/dart_snapshot.cc +++ b/runtime/dart_snapshot.cc @@ -22,11 +22,9 @@ const char* DartSnapshot::kIsolateInstructionsSymbol = "kDartIsolateSnapshotInstructions"; std::unique_ptr ResolveVMData(const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = fml::paths::JoinPaths( - {settings.aot_snapshot_path, settings.aot_vm_snapshot_data_filename}); + if (settings.vm_snapshot_data_path.size() > 0) { if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), false /* executable */)) { + settings.vm_snapshot_data_path.c_str(), false /* executable */)) { return source; } } @@ -38,11 +36,9 @@ std::unique_ptr ResolveVMData(const Settings& settings) { std::unique_ptr ResolveVMInstructions( const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = fml::paths::JoinPaths( - {settings.aot_snapshot_path, settings.aot_vm_snapshot_instr_filename}); + if (settings.vm_snapshot_instr_path.size() > 0) { if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), true /* executable */)) { + settings.vm_snapshot_instr_path.c_str(), true /* executable */)) { return source; } } @@ -63,12 +59,10 @@ std::unique_ptr ResolveVMInstructions( std::unique_ptr ResolveIsolateData( const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = - fml::paths::JoinPaths({settings.aot_snapshot_path, - settings.aot_isolate_snapshot_data_filename}); + if (settings.isolate_snapshot_data_path.size() > 0) { if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), false /* executable */)) { + settings.isolate_snapshot_data_path.c_str(), + false /* executable */)) { return source; } } @@ -80,12 +74,10 @@ std::unique_ptr ResolveIsolateData( std::unique_ptr ResolveIsolateInstructions( const Settings& settings) { - if (settings.aot_snapshot_path.size() > 0) { - auto path = - fml::paths::JoinPaths({settings.aot_snapshot_path, - settings.aot_isolate_snapshot_instr_filename}); + if (settings.isolate_snapshot_instr_path.size() > 0) { if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( - path.c_str(), true /* executable */)) { + settings.isolate_snapshot_instr_path.c_str(), + true /* executable */)) { return source; } } diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index f58563f9aaf73..7a3245bd4cf99 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -266,7 +266,7 @@ DartVM::DartVM(const Settings& settings, vm_snapshot_(std::move(vm_snapshot)), isolate_snapshot_(std::move(isolate_snapshot)), platform_kernel_mapping_( - std::make_unique(settings.kernel_snapshot_path)), + std::make_unique(settings.platform_kernel_path)), weak_factory_(this) { TRACE_EVENT0("flutter", "DartVMInitializer"); FXL_DLOG(INFO) << "Attempting Dart VM launch for mode: " @@ -342,7 +342,7 @@ DartVM::DartVM(const Settings& settings, const bool is_preview_dart2 = platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; - FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? " is" : "is NOT") + FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? "is" : "is NOT") << " enabled. Platform kernel: " << static_cast(platform_kernel_) << " Isolate Snapshot is Dart 2: " diff --git a/shell/common/switches.cc b/shell/common/switches.cc index f8883a2a3f471..bd12301c7ba4c 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -9,6 +9,7 @@ #include #include +#include "flutter/fml/paths.h" #include "lib/fxl/strings/string_view.h" // Include once for the default enum definition. @@ -172,21 +173,37 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { command_line.GetOptionValue(FlagForSwitch(Switch::Packages), &settings.packages_file_path); + std::string aot_snapshot_path; command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), - &settings.aot_snapshot_path); + &aot_snapshot_path); + std::string aot_vm_snapshot_data_filename; command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotData), - &settings.aot_vm_snapshot_data_filename); + &aot_vm_snapshot_data_filename); + std::string aot_vm_snapshot_instr_filename; command_line.GetOptionValue(FlagForSwitch(Switch::AotVmSnapshotInstructions), - &settings.aot_vm_snapshot_instr_filename); + &aot_vm_snapshot_instr_filename); + std::string aot_isolate_snapshot_data_filename; command_line.GetOptionValue(FlagForSwitch(Switch::AotIsolateSnapshotData), - &settings.aot_isolate_snapshot_data_filename); + &aot_isolate_snapshot_data_filename); + std::string aot_isolate_snapshot_instr_filename; command_line.GetOptionValue( FlagForSwitch(Switch::AotIsolateSnapshotInstructions), - &settings.aot_isolate_snapshot_instr_filename); + &aot_isolate_snapshot_instr_filename); + + if (aot_snapshot_path.size() > 0) { + settings.vm_snapshot_data_path = fml::paths::JoinPaths( + {aot_snapshot_path, aot_vm_snapshot_data_filename}); + settings.vm_snapshot_instr_path = fml::paths::JoinPaths( + {aot_snapshot_path, aot_vm_snapshot_instr_filename}); + settings.isolate_snapshot_data_path = fml::paths::JoinPaths( + {aot_snapshot_path, aot_isolate_snapshot_data_filename}); + settings.isolate_snapshot_instr_path = fml::paths::JoinPaths( + {aot_snapshot_path, aot_isolate_snapshot_instr_filename}); + } command_line.GetOptionValue(FlagForSwitch(Switch::CacheDirPath), &settings.temp_directory_path); diff --git a/shell/platform/android/flutter_main.cc b/shell/platform/android/flutter_main.cc index 08d97add93b87..1849c83984bce 100644 --- a/shell/platform/android/flutter_main.cc +++ b/shell/platform/android/flutter_main.cc @@ -64,10 +64,11 @@ void FlutterMain::Init(JNIEnv* env, auto application_kernel_path = fml::paths::JoinPaths({settings.assets_path, "kernel_blob.bin"}); - if (files::IsFile(platform_kernel_path) && - files::IsFile(application_kernel_path)) { - settings.kernel_snapshot_path = platform_kernel_path; + if (files::IsFile(application_kernel_path)) { settings.application_kernel_asset = application_kernel_path; + if (files::IsFile(platform_kernel_path)) { + settings.platform_kernel_path = platform_kernel_path; + } } } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index 402d7dfd33e98..b1410547e71bd 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -97,7 +97,7 @@ NSURL* vmKernelSnapshotURL = [NSURL URLWithString:@(kVMKernelSnapshotFileName) relativeToURL:[NSURL fileURLWithPath:assetsPath]]; if ([[NSFileManager defaultManager] fileExistsAtPath:vmKernelSnapshotURL.path]) { - settings.kernel_snapshot_path = vmKernelSnapshotURL.path.UTF8String; + settings.platform_kernel_path = vmKernelSnapshotURL.path.UTF8String; } } diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 8a68aacfaf4b6..5279f152b2c61 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -154,11 +154,12 @@ FlutterResult FlutterEngineRun(size_t version, fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); std::string application_kernel_path = fml::paths::JoinPaths( {settings.assets_path, kApplicationKernelSnapshotFileName}); - if (files::IsFile(platform_kernel_path) && - files::IsFile(application_kernel_path)) { + if (files::IsFile(application_kernel_path)) { // Run from a kernel snapshot. - settings.application_kernel_asset = kApplicationKernelSnapshotFileName; - settings.kernel_snapshot_path = platform_kernel_path; + settings.platform_kernel_path = platform_kernel_path; + if (files::IsFile(platform_kernel_path)) { + settings.application_kernel_asset = kApplicationKernelSnapshotFileName; + } } else { // Run from a main Dart file. settings.main_dart_file_path = args->main_path; diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc index 97af6dd847270..5258d80a8659d 100644 --- a/shell/testing/tester_main.cc +++ b/shell/testing/tester_main.cc @@ -254,7 +254,7 @@ int main(int argc, char* argv[]) { settings.icu_data_path = "icudtl.dat"; - settings.kernel_snapshot_path = + settings.platform_kernel_path = fml::paths::JoinPaths({settings.assets_path, "platform.dill"}); // The tools that read logs get confused if there is a log tag specified. From e44e1b49f3f3daaffe3e599a2998079f19e132fb Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Wed, 25 Apr 2018 13:35:01 -0700 Subject: [PATCH 0173/1190] Initial plugin support for background downloads + content fetching (#5082) * Added handleEventsForBackgroundURLSession and performFetchWithCompletionHandler handlers in FlutterAppDelegate to allow for plugins to perform background downloads and fetch small amounts of data opportunistically. --- .../ios/framework/Headers/FlutterPlugin.h | 22 +++++++++++-- .../framework/Source/FlutterAppDelegate.mm | 31 +++++++++++++++++-- 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index b6c964c6b32ec..646ffa30d74fd 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN Defines a set of optional callback methods and a method to set up the plugin and register it to be called by other application components. */ -@protocol FlutterPlugin +@protocol FlutterPlugin @required /** Registers this plugin. @@ -130,12 +130,28 @@ NS_ASSUME_NONNULL_BEGIN completionHandler:(void (^)(BOOL succeeded))completionHandler API_AVAILABLE(ios(9.0)); +/** + Called if this plugin has been registered for `UIApplicationDelegate` callbacks. + + - Returns: `YES` if this plugin handles the request. + */ +- (BOOL)application:(UIApplication*)application + handleEventsForBackgroundURLSession:(nonnull NSString*)identifier + completionHandler:(nonnull void (^)())completionHandler; + +/** + Called if this plugin has been registered for `UIApplicationDelegate` callbacks. + + - Returns: `YES` if this plugin handles the request. + */ +- (BOOL)application:(UIApplication*)application + performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; @end /** Registration context for a single `FlutterPlugin`. */ -@protocol FlutterPluginRegistrar +@protocol FlutterPluginRegistrar /** Returns a `FlutterBinaryMessenger` for creating Dart/iOS communication channels to be used by the plugin. @@ -211,7 +227,7 @@ NS_ASSUME_NONNULL_BEGIN Plugins are identified by unique string keys, typically the name of the plugin's main class. */ -@protocol FlutterPluginRegistry +@protocol FlutterPluginRegistry /** Returns a registrar for registering a plugin. diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index 7198b9082aa0f..a5132bf4ee4e0 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -11,7 +11,7 @@ @interface FlutterAppDelegate () @property(readonly, nonatomic) NSMutableDictionary* pluginPublications; @end -@interface FlutterAppDelegateRegistrar : NSObject +@interface FlutterAppDelegateRegistrar : NSObject - (instancetype)initWithPlugin:(NSString*)pluginKey appDelegate:(FlutterAppDelegate*)delegate; @end @@ -210,6 +210,31 @@ - (void)application:(UIApplication*)application } } +- (void)application:(UIApplication*)application + handleEventsForBackgroundURLSession:(nonnull NSString*)identifier + completionHandler:(nonnull void (^)())completionHandler { + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + handleEventsForBackgroundURLSession:identifier + completionHandler:completionHandler]) { + return; + } + } + } +} + +- (void)application:(UIApplication*)application + performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application performFetchWithCompletionHandler:completionHandler]) { + return; + } + } + } +} + // TODO(xster): move when doing https://github.com/flutter/flutter/issues/3671. - (NSObject*)binaryMessenger { UIViewController* rootViewController = _window.rootViewController; @@ -286,11 +311,11 @@ - (void)addApplicationDelegate:(NSObject*)delegate { } - (NSString*)lookupKeyForAsset:(NSString*)asset { - return [FlutterDartProject lookupKeyForAsset:asset]; + return [FlutterDartProject lookupKeyForAsset:asset]; } - (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { - return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; + return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } @end From df255b828c4df62108963e41523c24590266c1c8 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Apr 2018 18:06:21 -0400 Subject: [PATCH 0174/1190] Roll src/third_party/skia/ de5cffbc4..580aee2fa (16 commits) (#5092) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 1769ab51d30d0..3dd8034d3c8b8 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'de5cffbc48fce4decd1caf84d5a5e4fc0b5b48ed', + 'skia_revision': '580aee2fa4a57bf8208498fbc23acea04e16e092', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 17471645af493..66cf27affe5b8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 93f68aa0f203ef531ba8a7c96b225e9d +Signature: 0f3ad8fb5fdbb7e3515d3139f5201dd0 UNUSED LICENSES: @@ -14261,7 +14261,6 @@ FILE: ../../../third_party/skia/src/gpu/gl/glfw/GrGLMakeNativeInterface_glfw.cpp FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLColorSpaceXformHelper.h FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLProgramDataManager.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrMSAAPathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrPathStencilSettings.h FILE: ../../../third_party/skia/src/gpu/ops/GrRegionOp.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrRegionOp.h @@ -18190,7 +18189,6 @@ FILE: ../../../third_party/skia/src/gpu/ops/GrAAHairLinePathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrAAHairLinePathRenderer.h FILE: ../../../third_party/skia/src/gpu/ops/GrDefaultPathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrDefaultPathRenderer.h -FILE: ../../../third_party/skia/src/gpu/ops/GrMSAAPathRenderer.h FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_none.cpp FILE: ../../../third_party/skia/src/pdf/SkPDFConvertType1FontStream.cpp From c249b7026f1e952cc9f78df75d2c2e78f6f7cb79 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 25 Apr 2018 18:35:01 -0400 Subject: [PATCH 0175/1190] Path metrics/getBounds/combinations again (#4957) * add path measure * fix typo * getBound and addPathWithMatrix * Add myself to Authors, add PathOps * fix linting issues * update licenses_flutter to add new files * Use matrix4 instead of matrix3 for consistency/interop * put pubspec back * fix bug in getSegment * fix typo * Add return value for PathOp * refactoring from review * refactoring from review - still TBD on computeMetrics() * add doc * lint issue * fix computeMetrics, add Path.from * add missing wireup for clone * change PathMetrics to iterable, fix bug with angle on Tangent * prefer std::make_unique * cleanup docs * add path measure * fix typo * getBound and addPathWithMatrix * Add myself to Authors, add PathOps * fix linting issues * update licenses_flutter to add new files * Use matrix4 instead of matrix3 for consistency/interop * put pubspec back * fix bug in getSegment * fix typo * Add return value for PathOp * refactoring from review * refactoring from review - still TBD on computeMetrics() * add doc * lint issue * fix computeMetrics, add Path.from * add missing wireup for clone * change PathMetrics to iterable, fix bug with angle on Tangent * prefer std::make_unique * cleanup docs * fix iterator bug * remove unnecessary clone for computeMetrics * fix some doc issues * fix PathMeasure iterator, extendWithPath, isClosed, and pubspec.lock * get rid of orElse; use StateException * StateError, not StateException * doc improvements and nits * add unit tests, fix bugs found during testing * fix two uncommited doc changes * one more * change sign of tangent angle, update docs * update unit tests for inverted angle * update tangent to include vector * Doc fixes * Fix MSVC compilation and unit test --- lib/ui/BUILD.gn | 2 + lib/ui/dart_ui.cc | 2 + lib/ui/painting.dart | 306 +++++++++++++++++- lib/ui/painting/path.cc | 52 ++- lib/ui/painting/path.h | 18 ++ lib/ui/painting/path_measure.cc | 111 +++++++ lib/ui/painting/path_measure.h | 51 +++ lib/ui/ui.dart | 1 + testing/dart/path_test.dart | 202 ++++++++++++ .../dart/window_hooks_integration_test.dart | 3 + travis/licenses_golden/licenses_flutter | 2 + 11 files changed, 739 insertions(+), 11 deletions(-) create mode 100644 lib/ui/painting/path_measure.cc create mode 100644 lib/ui/painting/path_measure.h create mode 100644 testing/dart/path_test.dart diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 6a75cd22c8614..14d6d4c483e86 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -36,6 +36,8 @@ source_set("ui") { "painting/paint.h", "painting/path.cc", "painting/path.h", + "painting/path_measure.cc", + "painting/path_measure.h", "painting/picture.cc", "painting/picture.h", "painting/picture_recorder.cc", diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc index 59d083a191778..824152e28e8d0 100644 --- a/lib/ui/dart_ui.cc +++ b/lib/ui/dart_ui.cc @@ -15,6 +15,7 @@ #include "flutter/lib/ui/painting/image_filter.h" #include "flutter/lib/ui/painting/image_shader.h" #include "flutter/lib/ui/painting/path.h" +#include "flutter/lib/ui/painting/path_measure.h" #include "flutter/lib/ui/painting/picture.h" #include "flutter/lib/ui/painting/picture_recorder.h" #include "flutter/lib/ui/painting/vertices.h" @@ -53,6 +54,7 @@ void DartUI::InitForGlobal() { CanvasGradient::RegisterNatives(g_natives); CanvasImage::RegisterNatives(g_natives); CanvasPath::RegisterNatives(g_natives); + CanvasPathMeasure::RegisterNatives(g_natives); Codec::RegisterNatives(g_natives); DartRuntimeHooks::RegisterNatives(g_natives); FrameInfo::RegisterNatives(g_natives); diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index c08d3cf46fde4..561a8db64774d 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -39,6 +39,12 @@ bool _offsetIsValid(Offset offset) { return true; } +bool _matrix4IsValid(Float64List matrix4) { + assert(matrix4 != null, 'Matrix4 argument was null.'); + assert(matrix4.length == 16, 'Matrix4 must have 16 entries.'); + return true; +} + bool _radiusIsValid(Radius radius) { assert(radius != null, 'Radius argument was null.'); assert(!radius.x.isNaN && !radius.y.isNaN, 'Radius argument contained a NaN value.'); @@ -1390,6 +1396,62 @@ enum PathFillType { evenOdd, } +/// Strategies for combining paths. +/// +/// See also: +/// +/// * [Path.combine], which uses this enum to decide how to combine two paths. +// Must be kept in sync with SkPathOp +enum PathOperation { + /// Subtract the second path from the first path. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the result would be a crescent portion of the + /// first circle that was not overlapped by the second circle. + /// + /// See also: + /// + /// * [reverseDifference], which is the same but subtracting the first path + /// from the second. + difference, + /// Create a new path that is the intersection of the two paths, leaving the + /// overlapping pieces of the path. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the result would be only the overlapping portion + /// of the two circles. + /// + /// See also: + /// * [xor], which is the inverse of this operation + intersect, + /// Create a new path that is the union (inclusive-or) of the two paths. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the result would be a figure-eight like shape + /// matching the outter boundaries of both circles. + union, + /// Create a new path that is the exclusive-or of the two paths, leaving + /// everything but the overlapping pieces of the path. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the figure-eight like shape less the overlapping parts + /// + /// See also: + /// * [intersect], which is the inverse of this operation + xor, + /// Subtract the first path from the second path. + /// + /// For example, if the two paths are overlapping circles of equal diameter + /// but differing centers, the result would be a crescent portion of the + /// second circle that was not overlapped by the first circle. + /// + /// See also: + /// + /// * [difference], which is the same but subtracting the second path + /// from the frist. + reverseDifference, +} + /// A complex, one-dimensional subset of a plane. /// /// A path consists of a number of subpaths, and a _current point_. @@ -1412,6 +1474,15 @@ class Path extends NativeFieldWrapperClass2 { Path() { _constructor(); } void _constructor() native 'Path_constructor'; + /// Creates a copy of another [Path]. + /// + /// This copy is fast and does not require additional memory unless either + /// the `source` path or the path returned by this constructor are modified. + factory Path.from(Path source) { + return source._clone(); + } + Path _clone() native 'Path_clone'; + /// Determines how the interior of this path is calculated. /// /// Defaults to the non-zero winding rule, [PathFillType.nonZero]. @@ -1609,23 +1680,43 @@ class Path extends NativeFieldWrapperClass2 { } void _addRRect(Float32List rrect) native 'Path_addRRect'; - /// Adds a new subpath that consists of the given path offset by the given - /// offset. - void addPath(Path path, Offset offset) { + /// Adds a new subpath that consists of the given `path` offset by the given + /// `offset`. + /// + /// If `matrix4` is specified, the path will be transformed by this matrix + /// after the matrix is translated by the given offset. The matrix is a 4x4 + /// matrix stored in column major order. + void addPath(Path path, Offset offset, {Float64List matrix4}) { assert(path != null); // path is checked on the engine side assert(_offsetIsValid(offset)); - _addPath(path, offset.dx, offset.dy); + if (matrix4 != null) { + assert(_matrix4IsValid(matrix4)); + _addPathWithMatrix(path, offset.dx, offset.dy, matrix4); + } else { + _addPath(path, offset.dx, offset.dy); + } } void _addPath(Path path, double dx, double dy) native 'Path_addPath'; - + void _addPathWithMatrix(Path path, double dx, double dy, Float64List matrix) native 'Path_addPathWithMatrix'; + /// Adds the given path to this path by extending the current segment of this /// path with the the first segment of the given path. - void extendWithPath(Path path, Offset offset) { + /// + /// If `matrix4` is specified, the path will be transformed by this matrix + /// after the matrix is translated by the given `offset`. The matrix is a 4x4 + /// matrix stored in column major order. + void extendWithPath(Path path, Offset offset, {Float64List matrix4}) { assert(path != null); // path is checked on the engine side assert(_offsetIsValid(offset)); - _extendWithPath(path, offset.dx, offset.dy); + if (matrix4 != null) { + assert(_matrix4IsValid(matrix4)); + _extendWithPathAndMatrix(path, offset.dx, offset.dy, matrix4); + } else { + _extendWithPath(path, offset.dx, offset.dy); + } } void _extendWithPath(Path path, double dx, double dy) native 'Path_extendWithPath'; + void _extendWithPathAndMatrix(Path path, double dx, double dy, Float64List matrix) native 'Path_extendWithPathAndMatrix'; /// Closes the last subpath, as if a straight line had been drawn /// from the current point to the first point of the subpath. @@ -1660,12 +1751,207 @@ class Path extends NativeFieldWrapperClass2 { /// Returns a copy of the path with all the segments of every /// subpath transformed by the given matrix. Path transform(Float64List matrix4) { - assert(matrix4 != null); - if (matrix4.length != 16) - throw new ArgumentError('"matrix4" must have 16 entries.'); + assert(_matrix4IsValid(matrix4)); return _transform(matrix4); } Path _transform(Float64List matrix4) native 'Path_transform'; + + /// Computes the bounding rectangle for this path. + Rect getBounds() { + final Float32List rect = _getBounds(); + return new Rect.fromLTRB(rect[0], rect[1], rect[2], rect[3]); + } + Float32List _getBounds() native 'Path_getBounds'; + + /// Combines the two paths according to the manner specified by the given + /// `operation`. + /// + /// The resulting path will be constructed from non-overlapping contours. The + /// curve order is reduced where possible so that cubics may be turned into + /// quadratics, and quadratics maybe turned into lines. + static Path combine(PathOperation operation, Path path1, Path path2) { + assert(path1 != null); + assert(path2 != null); + final Path path = new Path(); + if (path._op(path1, path2, operation.index)) { + return path; + } + throw new StateError('Path.combine() failed. This may be due an invalid path; in particular, check for NaN values.'); + } + bool _op(Path path1, Path path2, int operation) native 'Path_op'; + + /// Creates a [PathMetrics] object for this path. + /// + /// If `forceClosed` is set to true, the contours of the path will be measured + /// as if they had been closed, even if they were not explicitly closed. + PathMetrics computeMetrics({bool forceClosed: false}) { + return new PathMetrics._(this, forceClosed); + } +} + +/// The geometric description of a tangent: the angle at a point. +/// +/// See also: +/// * [PathMetric.getTangentForOffset], which returns the tangent of an offset along a path. +class Tangent { + /// Creates a [Tangent] with the given values. + /// + /// The arguments must not be null. + const Tangent(this.position, this.vector) + : assert(position != null), + assert(vector != null); + + /// Creates a [Tangent] based on the angle rather than the vector. + /// + /// The [vector] is computed to be the unit vector at the given angle, interpreted + /// as clockwise radians from the x axis. + factory Tangent.fromAngle(Offset position, double angle) { + return new Tangent(position, new Offset(math.cos(angle), math.sin(angle))); + } + + /// Position of the tangent. + /// + /// When used with [PathMetric.getTangentForOffset], this represents the precise + /// position that the given offset along the path corresponds to. + final Offset position; + + /// The vector of the curve at [position]. + /// + /// When used with [PathMetric.getTangentForOffset], this is the vector of the + /// curve that is at the given offset along the path (i.e. the direction of the + /// curve at [position]). + final Offset vector; + + /// The direction of the curve at [position]. + /// + /// When used with [PathMetric.getTangentForOffset], this is the angle of the + /// curve that is the given offset along the path (i.e. the direction of the + /// curve at [position]). + /// + /// This value is in radians, with 0.0 meaning pointing along the x axis in + /// the positive x-axis direction, positive numbers pointing downward toward + /// the negative y-axis, i.e. in a clockwise direction, and negative numbers + /// pointing upward toward the positive y-axis, i.e. in a counter-clockwise + /// direction. + // flip the sign to be consistent with [Path.arcTo]'s `sweepAngle` + double get angle => -math.atan2(vector.dy, vector.dx); +} + +/// An iterable collection of [PathMetric] objects describing a [Path]. +/// +/// A [PathMetrics] object is created by using the [Path.computeMetrics] method, +/// and represents the path as it stood at the time of the call. Subsequent +/// modifications of the path do not affect the [PathMetrics] object. +/// +/// Each path metric corresponds to a segment, or contour, of a path. +/// +/// For example, a path consisting of a [Path.lineTo], a [Path.moveTo], and +/// another [Path.lineTo] will contain two contours and thus be represented by +/// two [PathMetric] objects. +/// +/// When iterating across a [PathMetrics]' contours, the [PathMetric] objects are only +/// valid until the next one is obtained. +class PathMetrics extends collection.IterableBase { + PathMetrics._(Path path, bool forceClosed) : + _iterator = new PathMetricIterator._(new PathMetric._(path, forceClosed)); + + final Iterator _iterator; + + @override + Iterator get iterator => _iterator; +} + +/// Tracks iteration from one segment of a path to the next for measurement. +class PathMetricIterator implements Iterator { + PathMetricIterator._(this._pathMetric); + + PathMetric _pathMetric; + bool _firstTime = true; + + @override + PathMetric get current => _firstTime ? null : _pathMetric; + + @override + bool moveNext() { + // PathMetric isn't a normal iterable - it's already initialized to its + // first Path. Should only call _moveNext when done with the first one. + if (_firstTime == true) { + _firstTime = false; + return true; + } else if (_pathMetric?._moveNext() == true) { + return true; + } + _pathMetric = null; + return false; + } +} + +/// Utilities for measuring a [Path] and extracting subpaths. +/// +/// Iterate over the object returned by [Path.computeMetrics] to obtain +/// [PathMetric] objects. +/// +/// Once created, metrics will only be valid while the iterator is at the given +/// contour. When the next contour's [PathMetric] is obtained, this object +/// becomes invalid. +class PathMetric extends NativeFieldWrapperClass2 { + /// Create a new empty [Path] object. + PathMetric._(Path path, bool forceClosed) { _constructor(path, forceClosed); } + void _constructor(Path path, bool forceClosed) native 'PathMeasure_constructor'; + + /// Return the total length of the current contour. + double get length native 'PathMeasure_getLength'; + + /// Computes the position of hte current contour at the given offset, and the + /// angle of the path at that point. + /// + /// For example, calling this method with a distance of 1.41 for a line from + /// 0.0,0.0 to 2.0,2.0 would give a point 1.0,1.0 and the angle 45 degrees + /// (but in radians). + /// + /// Returns null if the contour has zero [length]. + /// + /// The distance is clamped to the [length] of the current contour. + Tangent getTangentForOffset(double distance) { + final Float32List posTan = _getPosTan(distance); + // first entry == 0 indicates that Skia returned false + if (posTan[0] == 0.0) { + return null; + } else { + return new Tangent( + new Offset(posTan[1], posTan[2]), + new Offset(posTan[3], posTan[4]) + ); + } + } + Float32List _getPosTan(double distance) native 'PathMeasure_getPosTan'; + + /// Given a start and stop distance, return the intervening segment(s). + /// + /// `start` and `end` are pinned to legal values (0..[length]) + /// Returns null if the segment is 0 length or `start` > `stop`. + /// Begin the segment with a moveTo if `startWithMoveTo` is true. + Path extractPath(double start, double end, {bool startWithMoveTo: true}) native 'PathMeasure_getSegment'; + + /// Whether the contour is closed. + /// + /// Returns true if the contour ends with a call to [Path.close] (which may + /// have been implied when using [Path.addRect]) or if `forceClosed` was + /// specified as true in the call to [Path.computeMetrics]. Returns false + /// otherwise. + bool get isClosed native 'PathMeasure_isClosed'; + + // Move to the next contour in the path. + // + // A path can have a next contour if [Path.moveTo] was called after drawing began. + // Return true if one exists, or false. + // + // This is not exactly congruent with a regular [Iterator.moveNext]. + // Typically, [Iterator.moveNext] should be called before accessing the + // [Iterator.current]. In this case, the [PathMetric] is valid before + // calling `_moveNext` - `_moveNext` should be called after the first + // iteration is done instead of before. + bool _moveNext() native 'PathMeasure_nextContour'; } /// Styles to use for blurs in [MaskFilter] objects. diff --git a/lib/ui/painting/path.cc b/lib/ui/painting/path.cc index ee85ca2c69431..ffd9f4b7c5b02 100644 --- a/lib/ui/painting/path.cc +++ b/lib/ui/painting/path.cc @@ -38,6 +38,7 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Path); V(Path, contains) \ V(Path, cubicTo) \ V(Path, extendWithPath) \ + V(Path, extendWithPathAndMatrix) \ V(Path, getFillType) \ V(Path, lineTo) \ V(Path, moveTo) \ @@ -51,7 +52,11 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Path); V(Path, reset) \ V(Path, setFillType) \ V(Path, shift) \ - V(Path, transform) + V(Path, transform) \ + V(Path, getBounds) \ + V(Path, addPathWithMatrix) \ + V(Path, op) \ + V(Path, clone) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -207,6 +212,17 @@ void CanvasPath::addPath(CanvasPath* path, double dx, double dy) { path_.addPath(path->path(), dx, dy, SkPath::kAppend_AddPathMode); } +void CanvasPath::addPathWithMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { + if (!path) + Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); + + SkMatrix matrix = ToSkMatrix(matrix4); + matrix.setTranslateX(matrix.getTranslateX() + dx); + matrix.setTranslateY(matrix.getTranslateY() + dy); + path_.addPath(path->path(), matrix, SkPath::kAppend_AddPathMode); + matrix4.Release(); +} + void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) { if (!path) Dart_ThrowException( @@ -214,6 +230,17 @@ void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) { path_.addPath(path->path(), dx, dy, SkPath::kExtend_AddPathMode); } +void CanvasPath::extendWithPathAndMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { + if (!path) + Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); + + SkMatrix matrix = ToSkMatrix(matrix4); + matrix.setTranslateX(matrix.getTranslateX() + dx); + matrix.setTranslateY(matrix.getTranslateY() + dy); + path_.addPath(path->path(), matrix, SkPath::kExtend_AddPathMode); + matrix4.Release(); +} + void CanvasPath::close() { path_.close(); } @@ -239,4 +266,27 @@ fxl::RefPtr CanvasPath::transform(tonic::Float64List& matrix4) { return path; } +tonic::Float32List CanvasPath::getBounds() { + tonic::Float32List rect(Dart_NewTypedData(Dart_TypedData_kFloat32, 4)); + const SkRect& bounds = path_.getBounds(); + rect[0] = bounds.left(); + rect[1] = bounds.top(); + rect[2] = bounds.right(); + rect[3] = bounds.bottom(); + return rect; +} + + +bool CanvasPath::op(CanvasPath* path1, CanvasPath* path2, int operation) { + return Op(path1->path(), path2->path(), (SkPathOp)operation, &path_); +} + +fxl::RefPtr CanvasPath::clone() { + fxl::RefPtr path = CanvasPath::Create(); + // per Skia docs, this will create a fast copy + // data is shared until the source path or dest path are mutated + path->path_ = path_; + return path; +} + } // namespace blink diff --git a/lib/ui/painting/path.h b/lib/ui/painting/path.h index 900ca0e3f57ef..afe670b72ff20 100644 --- a/lib/ui/painting/path.h +++ b/lib/ui/painting/path.h @@ -10,6 +10,7 @@ #include "lib/tonic/typed_data/float32_list.h" #include "lib/tonic/typed_data/float64_list.h" #include "third_party/skia/include/core/SkPath.h" +#include "third_party/skia/include/pathops/SkPathOps.h" namespace tonic { class DartLibraryNatives; @@ -28,6 +29,12 @@ class CanvasPath : public fxl::RefCountedThreadSafe, return fxl::MakeRefCounted(); } + static fxl::RefPtr CreateFrom(const SkPath& src) { + fxl::RefPtr path = CanvasPath::Create(); + path->path_ = src; + return path; + } + int getFillType(); void setFillType(int fill_type); @@ -78,12 +85,23 @@ class CanvasPath : public fxl::RefCountedThreadSafe, void addPolygon(const tonic::Float32List& points, bool close); void addRRect(const RRect& rrect); void addPath(CanvasPath* path, double dx, double dy); + void addPathWithMatrix(CanvasPath* path, + double dx, + double dy, + tonic::Float64List& matrix4); void extendWithPath(CanvasPath* path, double dx, double dy); + void extendWithPathAndMatrix(CanvasPath* path, + double dx, + double dy, + tonic::Float64List& matrix4); void close(); void reset(); bool contains(double x, double y); fxl::RefPtr shift(double dx, double dy); fxl::RefPtr transform(tonic::Float64List& matrix4); + tonic::Float32List getBounds(); + bool op(CanvasPath* path1, CanvasPath* path2, int operation); + fxl::RefPtr clone(); const SkPath& path() const { return path_; } diff --git a/lib/ui/painting/path_measure.cc b/lib/ui/painting/path_measure.cc new file mode 100644 index 0000000000000..5bff424d7798d --- /dev/null +++ b/lib/ui/painting/path_measure.cc @@ -0,0 +1,111 @@ +// Copyright 2015 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. + +#include "flutter/lib/ui/painting/path_measure.h" + +#include + +#include "flutter/lib/ui/painting/matrix.h" +#include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_args.h" +#include "lib/tonic/dart_binding_macros.h" +#include "lib/tonic/dart_library_natives.h" + +using tonic::ToDart; + +namespace blink { + +typedef CanvasPathMeasure PathMeasure; + +static void PathMeasure_constructor(Dart_NativeArguments args) { + DartCallConstructor(&CanvasPathMeasure::Create, args); +} + +IMPLEMENT_WRAPPERTYPEINFO(ui, PathMeasure); + +#define FOR_EACH_BINDING(V) \ + V(PathMeasure, setPath) \ + V(PathMeasure, getLength) \ + V(PathMeasure, getPosTan) \ + V(PathMeasure, getSegment) \ + V(PathMeasure, isClosed) \ + V(PathMeasure, nextContour) + +FOR_EACH_BINDING(DART_NATIVE_CALLBACK) + +void CanvasPathMeasure::RegisterNatives(tonic::DartLibraryNatives* natives) { + natives->Register( + {{"PathMeasure_constructor", PathMeasure_constructor, 3, true}, + FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); +} + +fxl::RefPtr CanvasPathMeasure::Create(const CanvasPath* path, + bool forceClosed) { + fxl::RefPtr pathMeasure = + fxl::MakeRefCounted(); + if (path) { + const SkPath skPath = path->path(); + SkScalar resScale = 1; + pathMeasure->path_measure_ = + std::make_unique(skPath, forceClosed, resScale); + } else { + pathMeasure->path_measure_ = std::make_unique(); + } + return pathMeasure; +} + +CanvasPathMeasure::CanvasPathMeasure() {} + +CanvasPathMeasure::~CanvasPathMeasure() {} + +void CanvasPathMeasure::setPath(const CanvasPath* path, bool isClosed) { + const SkPath* skPath = &(path->path()); + path_measure_->setPath(skPath, isClosed); +} + +float CanvasPathMeasure::getLength() { + return path_measure_->getLength(); +} + +tonic::Float32List CanvasPathMeasure::getPosTan(float distance) { + SkPoint pos; + SkVector tan; + bool success = path_measure_->getPosTan(distance, &pos, &tan); + + tonic::Float32List posTan(Dart_NewTypedData(Dart_TypedData_kFloat32, 5)); + if (success) { + posTan[0] = 1; // dart code will check for this for success + posTan[1] = pos.x(); + posTan[2] = pos.y(); + posTan[3] = tan.x(); + posTan[4] = tan.y(); + } else { + posTan[0] = 0; // dart code will check for this for failure + } + + return posTan; +} + +fxl::RefPtr CanvasPathMeasure::getSegment(float startD, + float stopD, + bool startWithMoveTo) { + SkPath dst; + bool success = + path_measure_->getSegment(startD, stopD, &dst, startWithMoveTo); + if (!success) { + return CanvasPath::Create(); + } else { + return CanvasPath::CreateFrom(dst); + } +} + +bool CanvasPathMeasure::isClosed() { + return path_measure_->isClosed(); +} + +bool CanvasPathMeasure::nextContour() { + return path_measure_->nextContour(); +} + +} // namespace blink diff --git a/lib/ui/painting/path_measure.h b/lib/ui/painting/path_measure.h new file mode 100644 index 0000000000000..7862081a88ec1 --- /dev/null +++ b/lib/ui/painting/path_measure.h @@ -0,0 +1,51 @@ +// Copyright 2015 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. + +#ifndef FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ +#define FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ + +#include "flutter/lib/ui/painting/path.h" +#include "lib/tonic/dart_wrappable.h" +#include "lib/tonic/typed_data/float64_list.h" +#include "third_party/skia/include/core/SkPath.h" +#include "third_party/skia/include/core/SkPathMeasure.h" + +namespace tonic { +class DartLibraryNatives; +} // namespace tonic + +// Be sure that the client doesn't modify a path on us before Skia finishes +// See AOSP's reasoning in PathMeasure.cpp + +namespace blink { + +class CanvasPathMeasure : public fxl::RefCountedThreadSafe, + public tonic::DartWrappable { + DEFINE_WRAPPERTYPEINFO(); + FRIEND_MAKE_REF_COUNTED(CanvasPathMeasure); + + public: + ~CanvasPathMeasure() override; + static fxl::RefPtr Create(const CanvasPath* path, bool forceClosed); + + void setPath(const CanvasPath* path, bool isClosed); + float getLength(); + tonic::Float32List getPosTan(float distance); + fxl::RefPtr getSegment(float startD, float stopD, bool startWithMoveTo); + bool isClosed(); + bool nextContour(); + + static void RegisterNatives(tonic::DartLibraryNatives* natives); + + const SkPathMeasure& pathMeasure() const { return *path_measure_; } + + private: + CanvasPathMeasure(); + + std::unique_ptr path_measure_; +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index 5d6bc3ef21306..149cbde2101d4 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -13,6 +13,7 @@ library dart.ui; import 'dart:_internal' hide Symbol; import 'dart:async'; +import 'dart:collection' as collection; import 'dart:convert'; import 'dart:developer' as developer; import 'dart:math' as math; diff --git a/testing/dart/path_test.dart b/testing/dart/path_test.dart new file mode 100644 index 0000000000000..732f22304892b --- /dev/null +++ b/testing/dart/path_test.dart @@ -0,0 +1,202 @@ +// 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:typed_data' show Float64List; +import 'dart:ui'; + +import 'package:test/test.dart'; + +void main() { + test('path getBounds', () { + final Rect r = new Rect.fromLTRB(1.0, 3.0, 5.0, 7.0); + final Path p = new Path()..addRect(r); + expect(p.getBounds(), equals(r)); + p.lineTo(20.0, 15.0); + expect(p.getBounds(), equals(new Rect.fromLTRB(1.0, 3.0, 20.0, 15.0))); + }); + + test('path combine rect', () { + final Rect c1 = + new Rect.fromCircle(center: const Offset(10.0, 10.0), radius: 10.0); + final Rect c2 = + new Rect.fromCircle(center: const Offset(5.0, 5.0), radius: 10.0); + final Rect c1UnionC2 = c1.expandToInclude(c2); + final Rect c1IntersectC2 = c1.intersect(c2); + final Path pathCircle1 = new Path()..addRect(c1); + final Path pathCircle2 = new Path()..addRect(c2); + + final Path difference = + Path.combine(PathOperation.difference, pathCircle1, pathCircle2); + expect(difference.getBounds(), equals(c1)); + + final Path reverseDifference = + Path.combine(PathOperation.reverseDifference, pathCircle1, pathCircle2); + expect(reverseDifference.getBounds(), equals(c2)); + + final Path union = + Path.combine(PathOperation.union, pathCircle1, pathCircle2); + expect(union.getBounds(), equals(c1UnionC2)); + + final Path intersect = + Path.combine(PathOperation.intersect, pathCircle1, pathCircle2); + expect(intersect.getBounds(), equals(c1IntersectC2)); + + // the bounds on this will be the same as union - but would draw a missing inside piece. + final Path xor = Path.combine(PathOperation.xor, pathCircle1, pathCircle2); + expect(xor.getBounds(), equals(c1UnionC2)); + }); + + test('path combine oval', () { + final Rect c1 = + new Rect.fromCircle(center: const Offset(10.0, 10.0), radius: 10.0); + final Rect c2 = + new Rect.fromCircle(center: const Offset(5.0, 5.0), radius: 10.0); + final Rect c1UnionC2 = c1.expandToInclude(c2); + final Rect c1IntersectC2 = c1.intersect(c2); + final Path pathCircle1 = new Path()..addOval(c1); + final Path pathCircle2 = new Path()..addOval(c2); + + final Path difference = + Path.combine(PathOperation.difference, pathCircle1, pathCircle2); + + expect(difference.getBounds().top, closeTo(0.88, 0.01)); + + final Path reverseDifference = + Path.combine(PathOperation.reverseDifference, pathCircle1, pathCircle2); + expect(reverseDifference.getBounds().right, + closeTo(14.11, 0.01)); + + final Path union = + Path.combine(PathOperation.union, pathCircle1, pathCircle2); + expect(union.getBounds(), equals(c1UnionC2)); + + final Path intersect = + Path.combine(PathOperation.intersect, pathCircle1, pathCircle2); + expect(intersect.getBounds(), equals(c1IntersectC2)); + + // the bounds on this will be the same as union - but would draw a missing inside piece. + final Path xor = Path.combine(PathOperation.xor, pathCircle1, pathCircle2); + expect(xor.getBounds(), equals(c1UnionC2)); + }); + + test('path clone', () { + final Path p1 = new Path()..lineTo(20.0, 20.0); + final Path p2 = new Path.from(p1); + + expect(p1.getBounds(), equals(p2.getBounds())); + + p1.lineTo(10.0, 30.0); + expect(p1.getBounds().bottom, equals(p2.getBounds().bottom + 10)); + }); + + test('transformation tests', () { + final Rect bounds = new Rect.fromLTRB(0.0, 0.0, 10.0, 10.0); + final Path p = new Path()..addRect(bounds); + final Float64List scaleMatrix = new Float64List.fromList([ + 2.5, 0.0, 0.0, 0.0, // first col + 0.0, 0.5, 0.0, 0.0, // second col + 0.0, 0.0, 1.0, 0.0, // third col + 0.0, 0.0, 0.0, 1.0, // fourth col + ]); + + expect(p.getBounds(), equals(bounds)); + final Path pTransformed = p.transform(scaleMatrix); + + expect(pTransformed.getBounds(), + equals(new Rect.fromLTRB(0.0, 0.0, 10 * 2.5, 10 * 0.5))); + + final Path p2 = new Path()..lineTo(10.0, 10.0); + + p.addPath(p2, const Offset(10.0, 10.0)); + expect(p.getBounds(), equals(new Rect.fromLTRB(0.0, 0.0, 20.0, 20.0))); + + p.addPath(p2, const Offset(20.0, 20.0), matrix4: scaleMatrix); + expect(p.getBounds(), + equals(new Rect.fromLTRB(0.0, 0.0, 20 + (10 * 2.5), 20 + (10 * .5)))); + + p.extendWithPath(p2, const Offset(0.0, 0.0)); + expect(p.getBounds(), equals(new Rect.fromLTRB(0.0, 0.0, 45.0, 25.0))); + + p.extendWithPath(p2, const Offset(45.0, 25.0), matrix4: scaleMatrix); + expect(p.getBounds(), equals(new Rect.fromLTRB(0.0, 0.0, 70.0, 30.0))); + }); + + test('path metrics tests', () { + final Path simpleHorizontalLine = new Path()..lineTo(10.0, 0.0); + + // basic tests on horizontal line + final PathMetrics simpleHorizontalMetrics = + simpleHorizontalLine.computeMetrics(); + expect(simpleHorizontalMetrics.iterator.current, isNull); + expect(simpleHorizontalMetrics.iterator.moveNext(), isTrue); + expect(simpleHorizontalMetrics.iterator.current, isNotNull); + expect(simpleHorizontalMetrics.iterator.current.length, equals(10.0)); + expect(simpleHorizontalMetrics.iterator.current.isClosed, isFalse); + final Path simpleExtract = + simpleHorizontalMetrics.iterator.current.extractPath(1.0, 9.0); + expect(simpleExtract.getBounds(), + equals(new Rect.fromLTRB(1.0, 0.0, 9.0, 0.0))); + final Tangent posTan = + simpleHorizontalMetrics.iterator.current.getTangentForOffset(1.0); + expect(posTan, isNotNull); + expect(posTan.position, equals(const Offset(1.0, 0.0))); + expect(posTan.angle, equals(0.0)); + + expect(simpleHorizontalMetrics.iterator.moveNext(), isFalse); + expect(simpleHorizontalMetrics.iterator.current, isNull); + + // test with forceClosed + final PathMetrics simpleMetricsClosed = + simpleHorizontalLine.computeMetrics(forceClosed: true); + expect(simpleMetricsClosed.iterator.current, isNull); + expect(simpleMetricsClosed.iterator.moveNext(), isTrue); + expect(simpleMetricsClosed.iterator.current, isNotNull); + expect(simpleMetricsClosed.iterator.current.length, + equals(20.0)); // because we forced close + expect(simpleMetricsClosed.iterator.current.isClosed, isTrue); + final Path simpleExtract2 = + simpleMetricsClosed.iterator.current.extractPath(1.0, 9.0); + expect(simpleExtract2.getBounds(), + equals(new Rect.fromLTRB(1.0, 0.0, 9.0, 0.0))); + expect(simpleMetricsClosed.iterator.moveNext(), isFalse); + + // test getTangentForOffset with vertical line + final Path simpleVerticalLine = new Path()..lineTo(0.0, 10.0); + final PathMetrics simpleMetricsVertical = + simpleVerticalLine.computeMetrics()..iterator.moveNext(); + final Tangent posTanVertical = + simpleMetricsVertical.iterator.current.getTangentForOffset(5.0); + expect(posTanVertical.position, equals(const Offset(0.0, 5.0))); + expect(posTanVertical.angle, + closeTo(-1.5708, .0001)); // 90 degrees + + // test getTangentForOffset with diagonal line + final Path simpleDiagonalLine = new Path()..lineTo(10.0, 10.0); + final PathMetrics simpleMetricsDiagonal = + simpleDiagonalLine.computeMetrics()..iterator.moveNext(); + final double midPoint = simpleMetricsDiagonal.iterator.current.length / 2; + final Tangent posTanDiagonal = + simpleMetricsDiagonal.iterator.current.getTangentForOffset(midPoint); + expect(posTanDiagonal.position, equals(new Offset(5.0, 5.0))); + expect(posTanDiagonal.angle, + closeTo(-0.7853981633974483, .00001)); // ~45 degrees + + // test a multi-contour path + final Path multiContour = new Path() + ..lineTo(0.0, 10.0) + ..moveTo(10.0, 10.0) + ..lineTo(10.0, 15.0); + + final PathMetrics multiContourMetric = multiContour.computeMetrics(); + expect(multiContourMetric.iterator.current, isNull); + expect(multiContourMetric.iterator.moveNext(), isTrue); + expect(multiContourMetric.iterator.current, isNotNull); + expect(multiContourMetric.iterator.current.length, equals(10.0)); + expect(multiContourMetric.iterator.moveNext(), isTrue); + expect(multiContourMetric.iterator.current, isNotNull); + expect(multiContourMetric.iterator.current.length, equals(5.0)); + expect(multiContourMetric.iterator.moveNext(), isFalse); + expect(multiContourMetric.iterator.current, isNull); + }); +} diff --git a/testing/dart/window_hooks_integration_test.dart b/testing/dart/window_hooks_integration_test.dart index 767b329829165..5b5ff619a4375 100644 --- a/testing/dart/window_hooks_integration_test.dart +++ b/testing/dart/window_hooks_integration_test.dart @@ -9,6 +9,9 @@ import 'dart:developer' as developer; import 'dart:math' as math; import 'dart:nativewrappers'; +// this needs to be imported because painting.dart expects it this way +import 'dart:collection' as collection; + import 'package:test/test.dart'; // HACK: these parts are to get access to private functions tested here. diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 090275a17e7eb..0f131c42a50d7 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -9947,6 +9947,8 @@ FILE: ../../../flutter/lib/ui/painting/paint.cc FILE: ../../../flutter/lib/ui/painting/paint.h FILE: ../../../flutter/lib/ui/painting/path.cc FILE: ../../../flutter/lib/ui/painting/path.h +FILE: ../../../flutter/lib/ui/painting/path_measure.cc +FILE: ../../../flutter/lib/ui/painting/path_measure.h FILE: ../../../flutter/lib/ui/painting/picture.cc FILE: ../../../flutter/lib/ui/painting/picture.h FILE: ../../../flutter/lib/ui/painting/picture_recorder.cc From fb4926e65ea85e96122f99fef86bd566946d9ed0 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Apr 2018 21:36:21 -0400 Subject: [PATCH 0176/1190] Roll src/third_party/skia/ 580aee2fa..1366282bc (2 commits) (#5094) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3dd8034d3c8b8..c3126858b96cc 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '580aee2fa4a57bf8208498fbc23acea04e16e092', + 'skia_revision': '1366282bc2f2c9566e1ffa77bafb2ec4d8f190df', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 66cf27affe5b8..65166543a3d29 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0f3ad8fb5fdbb7e3515d3139f5201dd0 +Signature: aae49cee4c80014cbb4c7375ddcbd0d5 UNUSED LICENSES: From 82d461049cfc6753e1ca5a8d793b972f82bbd601 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Apr 2018 01:05:21 -0400 Subject: [PATCH 0177/1190] Roll src/third_party/skia/ 1366282bc..6b043cb9c (2 commits) (#5095) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c3126858b96cc..2b31e0d73c210 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1366282bc2f2c9566e1ffa77bafb2ec4d8f190df', + 'skia_revision': '6b043cb9cc1a45a9277d40c9f37b8021b77389b6', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 65166543a3d29..3aefc26abdcb1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: aae49cee4c80014cbb4c7375ddcbd0d5 +Signature: ab4de8632d9b724af007c75c127e506e UNUSED LICENSES: From a9180ca20ebfea6ee4618ff4def73aabd75a9b47 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Apr 2018 04:35:21 -0400 Subject: [PATCH 0178/1190] Roll src/third_party/skia/ 6b043cb9c..643ab1bf5 (3 commits; 3 trivial rolls) (#5097) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2b31e0d73c210..01c4dddde7953 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6b043cb9cc1a45a9277d40c9f37b8021b77389b6', + 'skia_revision': '643ab1bf5203025fe38e86f04987203e81e0e6f0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3aefc26abdcb1..aca16ccb8d89a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ab4de8632d9b724af007c75c127e506e +Signature: 2e70ccda2d0b7220cd6f0ef61e42ed78 UNUSED LICENSES: From 6e5112214ca96e0ec9abae8eca4182b7bbadd85f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Apr 2018 08:05:21 -0400 Subject: [PATCH 0179/1190] Roll src/third_party/skia/ 643ab1bf5..5c9369eb1 (1 commit; 1 trivial rolls) (#5098) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 01c4dddde7953..68541c48b43d1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '643ab1bf5203025fe38e86f04987203e81e0e6f0', + 'skia_revision': '5c9369eb14f567b0d6348b0d63c14d0a8d966c56', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index aca16ccb8d89a..42e35619393f1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2e70ccda2d0b7220cd6f0ef61e42ed78 +Signature: bc84e989b1ece3fcb57e369b4879fe53 UNUSED LICENSES: From 956f3eeca59768157946644d66e12de3b2c47dd2 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Apr 2018 11:34:21 -0400 Subject: [PATCH 0180/1190] Roll src/third_party/skia/ 5c9369eb1..c79e2d155 (7 commits) (#5099) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 68541c48b43d1..d28a1c5e0233f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5c9369eb14f567b0d6348b0d63c14d0a8d966c56', + 'skia_revision': 'c79e2d1551517093f49f3c77ca7dae19c8fe2651', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 42e35619393f1..0ca3913bd3847 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: bc84e989b1ece3fcb57e369b4879fe53 +Signature: 66de935f1944abf76ed7da2507a2cadd UNUSED LICENSES: From 895c965ce0e0bf313266852082cade45ce14738d Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 26 Apr 2018 08:43:28 -0700 Subject: [PATCH 0181/1190] Set file modified callback. (#5096) This fixes dart1 hot reload regression caused by 58e84c8bf. --- runtime/dart_vm.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 7a3245bd4cf99..fa827ef477f0f 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -387,6 +387,8 @@ DartVM::DartVM(const Settings& settings, DartUI::InitForGlobal(); + Dart_SetFileModifiedCallback(&DartFileModifiedCallback); + { TRACE_EVENT0("flutter", "Dart_Initialize"); Dart_InitializeParams params = {}; From 7617d2889b4fdb3bec5c128195efd38ccd782b83 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 26 Apr 2018 09:42:38 -0700 Subject: [PATCH 0182/1190] libtxt: post-process glyph positions in order to accurately right-justify text (#5093) Previously libtxt was applying right justification during line layout based on the line width returned by the Minikin line breaker. However, this width does not include the width of leading or trailing whitespace. So in a right justified line the starting offset of the first glyph would not account for the advance of the leading whitespace, resulting in text being clipped. This PR applies line justification after the glyphs are laid out and the full advance of the text is known. Fixes https://github.com/flutter/flutter/issues/16333 --- third_party/txt/src/txt/paragraph.cc | 48 ++++++++++++++++++++-------- third_party/txt/src/txt/paragraph.h | 4 ++- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index bab3028145dee..9e732f7164600 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -197,6 +197,11 @@ Paragraph::GlyphPosition::GlyphPosition(double x_start, : code_units(code_unit_index, code_unit_index + code_unit_width), x_pos(x_start, x_start + x_advance) {} +void Paragraph::GlyphPosition::Shift(double delta) { + x_pos.start += delta; + x_pos.end += delta; +} + Paragraph::GlyphLine::GlyphLine(std::vector&& p, size_t tcu) : positions(std::move(p)), total_code_units(tcu) {} @@ -465,7 +470,8 @@ void Paragraph::Layout(double width, bool force) { } std::vector line_glyph_positions; - double run_x_offset = GetLineXOffset(line_number); + std::vector line_code_unit_runs; + double run_x_offset = 0; double justify_x_offset = 0; std::vector paint_records; @@ -665,7 +671,7 @@ void Paragraph::Layout(double width, bool force) { [](const GlyphPosition& a, const GlyphPosition& b) { return a.code_units.start < b.code_units.start; }); - code_unit_runs_.emplace_back( + line_code_unit_runs.emplace_back( std::move(code_unit_positions), Range(run.start(), run.end()), Range(glyph_positions.front().x_pos.start, @@ -676,6 +682,27 @@ void Paragraph::Layout(double width, bool force) { run_x_offset += layout.getAdvance(); } + // Adjust the glyph positions based on the alignment of the line. + double line_x_offset = GetLineXOffset(line_number, run_x_offset); + if (line_x_offset) { + for (CodeUnitRun& code_unit_run : line_code_unit_runs) { + for (GlyphPosition& position : code_unit_run.positions) { + position.Shift(line_x_offset); + } + } + for (GlyphPosition& position : line_glyph_positions) { + position.Shift(line_x_offset); + } + } + + size_t next_line_start = (line_number < line_ranges_.size() - 1) + ? line_ranges_[line_number + 1].start + : text_.size(); + glyph_lines_.emplace_back(std::move(line_glyph_positions), + next_line_start - line_range.start); + code_unit_runs_.insert(code_unit_runs_.end(), line_code_unit_runs.begin(), + line_code_unit_runs.end()); + double max_line_spacing = 0; double max_descent = 0; auto update_line_metrics = [&](const SkPaint::FontMetrics& metrics, @@ -720,15 +747,9 @@ void Paragraph::Layout(double width, bool force) { for (PaintRecord& paint_record : paint_records) { paint_record.SetOffset( - SkPoint::Make(paint_record.offset().x(), y_offset)); + SkPoint::Make(paint_record.offset().x() + line_x_offset, y_offset)); records_.emplace_back(std::move(paint_record)); } - - size_t next_line_start = (line_number < line_ranges_.size() - 1) - ? line_ranges_[line_number + 1].start - : text_.size(); - glyph_lines_.emplace_back(std::move(line_glyph_positions), - next_line_start - line_range.start); } max_intrinsic_width_ = 0; @@ -755,8 +776,9 @@ void Paragraph::Layout(double width, bool force) { }); } -double Paragraph::GetLineXOffset(size_t line) { - if (line >= line_widths_.size() || isinf(width_)) +double Paragraph::GetLineXOffset(size_t line_number, + double line_total_advance) { + if (line_number >= line_widths_.size() || isinf(width_)) return 0; TextAlign align = paragraph_style_.text_align; @@ -765,9 +787,9 @@ double Paragraph::GetLineXOffset(size_t line) { if (align == TextAlign::right || (align == TextAlign::start && direction == TextDirection::rtl) || (align == TextAlign::end && direction == TextDirection::ltr)) { - return width_ - line_widths_[line]; + return width_ - line_total_advance; } else if (paragraph_style_.text_align == TextAlign::center) { - return (width_ - line_widths_[line]) / 2; + return (width_ - line_widths_[line_number]) / 2; } else { return 0; } diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index 3a3d9aa4883c1..f70d5828d516b 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -228,6 +228,8 @@ class Paragraph { double x_advance, size_t code_unit_index, size_t code_unit_width); + + void Shift(double delta); }; struct GlyphLine { @@ -298,7 +300,7 @@ class Paragraph { // Calculate the starting X offset of a line based on the line's width and // alignment. - double GetLineXOffset(size_t line); + double GetLineXOffset(size_t line_number, double line_total_advance); // Creates and draws the decorations onto the canvas. void PaintDecorations(SkCanvas* canvas, const PaintRecord& record); From ad9826cbbbc2254ec3b5dff2a6aaf390f04a3ee0 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Apr 2018 15:05:21 -0400 Subject: [PATCH 0183/1190] Roll src/third_party/skia/ c79e2d155..47ed6f10e (10 commits; 1 trivial rolls) (#5100) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DEPS b/DEPS index d28a1c5e0233f..876cfa2d1a7da 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c79e2d1551517093f49f3c77ca7dae19c8fe2651', + 'skia_revision': '47ed6f10ef1d6c29512f95e88a7e51456c4d8f87', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 0ca3913bd3847..cc3af80ef2913 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 66de935f1944abf76ed7da2507a2cadd +Signature: 1a691e792539ae2519d4e5329e9f4ce3 UNUSED LICENSES: @@ -17553,9 +17553,9 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SafeStack.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu16-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_ProcDump.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-All.json @@ -17696,12 +17696,12 @@ FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-GCC-Chorizo-GPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Release-All-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu16-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu16-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu16-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Release-All-ANGLE.json @@ -17752,6 +17752,10 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Release-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUCDE3815TYKHE-GPU-IntelBayTrail-x86_64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Debug-All.json @@ -17759,10 +17763,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang- FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookAir7.2-GPU-IntelHD6000-x86_64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Debug-All-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu16-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu16-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Release-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu16-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu16-Clang-NUCDE3815TYKHE-GPU-IntelBayTrail-x86_64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL1.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL3.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Vulkan_Coverage.json From 131349f839bb8425a547e3d0e5e88fcede224e1f Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 26 Apr 2018 13:41:03 -0700 Subject: [PATCH 0184/1190] Update flutter runner process name to reflect last running shell. (#5102) --- content_handler/application.cc | 4 +++ content_handler/application.h | 2 ++ content_handler/application_runner.cc | 47 ++++++++++++++++++++++++--- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/content_handler/application.cc b/content_handler/application.cc index 026b324d95773..2db01b31421cb 100644 --- a/content_handler/application.cc +++ b/content_handler/application.cc @@ -163,6 +163,10 @@ Application::Application( Application::~Application() = default; +const std::string& Application::GetDebugLabel() const { + return debug_label_; +} + void Application::AttemptVMLaunchWithCurrentSettings( const blink::Settings& settings) const { if (blink::DartVM::ForProcessIfInitialized()) { diff --git a/content_handler/application.h b/content_handler/application.h index eb06a4aad07fd..0499b8931659d 100644 --- a/content_handler/application.h +++ b/content_handler/application.h @@ -49,6 +49,8 @@ class Application final : public Engine::Delegate, // may be collected after. ~Application(); + const std::string& GetDebugLabel() const; + private: blink::Settings settings_; Delegate& delegate_; diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc index 81ab98c7f8325..4785169bd595d 100644 --- a/content_handler/application_runner.cc +++ b/content_handler/application_runner.cc @@ -4,28 +4,59 @@ #include "application_runner.h" +#include + +#include #include #include "flutter/lib/ui/text/font_collection.h" #include "fuchsia_font_manager.h" -#include "third_party/skia/include/core/SkGraphics.h" #include "lib/icu_data/cpp/icu_data.h" +#include "third_party/skia/include/core/SkGraphics.h" namespace flutter { +static void SetProcessName(const std::string& process_name) { + zx::process::self().set_property(ZX_PROP_NAME, process_name.c_str(), + process_name.size()); +} + +static void SetThreadName(const std::string& thread_name) { + zx::thread::self().set_property(ZX_PROP_NAME, thread_name.c_str(), + thread_name.size()); +} + +static void SetProcessName(const std::string& label, size_t app_count) { + // Format: "flutter.+" + // "flutter" in case of error. + + const std::string prefix = "flutter."; + const std::string suffix = + app_count == 0 ? "" : "+" + std::to_string(app_count); + + if ((prefix.size() + suffix.size()) > ZX_MAX_NAME_LEN) { + SetProcessName("flutter"); + return; + } + + auto truncated_label = + label.substr(0, ZX_MAX_NAME_LEN - 1 - (prefix.size() + suffix.size())); + + SetProcessName(prefix + truncated_label + suffix); +} + ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) : on_termination_callback_(std::move(on_termination_callback)), host_context_(component::ApplicationContext::CreateFromStartupInfo()) { - SkGraphics::Init(); SetupICU(); SetupGlobalFonts(); - const std::string process_label = "flutter"; - zx::process::self().set_property(ZX_PROP_NAME, process_label.c_str(), - process_label.size()); + SetProcessName("application_runner", 0); + + SetThreadName("io.flutter.application_runner"); host_context_->outgoing_services()->AddService( std::bind(&ApplicationRunner::RegisterApplication, this, @@ -55,6 +86,12 @@ void ApplicationRunner::StartApplication( std::move(startup_info), // startup info std::move(controller) // controller request ); + + // Update the process label so that "ps" will will list the last appication + // started by the runner plus the count of applications hosted by this runner. + SetProcessName(thread_application_pair.second->GetDebugLabel(), + active_applications_.size()); + active_applications_[thread_application_pair.second.get()] = std::move(thread_application_pair); } From 2ee36e2700c60ffd06a2010062ab0dabcd89a528 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 26 Apr 2018 14:40:04 -0700 Subject: [PATCH 0185/1190] Always enable verbose logging on fuchsia. (#5104) --- content_handler/engine.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content_handler/engine.cc b/content_handler/engine.cc index ebdaff84f3bd7..4a29cde426c42 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -124,6 +124,8 @@ Engine::Engine(Delegate& delegate, host_threads_[2].TaskRunner() // io ); + settings_.verbose_logging = true; + settings_.root_isolate_create_callback = std::bind(&Engine::OnMainIsolateStart, this); From e11905c6e5ac226fe388b51faacf36cdc2e96d2c Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 26 Apr 2018 15:03:47 -0700 Subject: [PATCH 0186/1190] Add tooltip method to Android AccessibilityBridge (#5103) --- .../android/io/flutter/view/AccessibilityBridge.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index ecbb62dcebd9d..b17e6d9e47889 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -671,6 +671,11 @@ public void onMessage(Object message, BasicMessageChannel.Reply reply) { case "announce": mOwner.announceForAccessibility((String) data.get("message")); break; + case "tooltip": { + AccessibilityEvent e = obtainAccessibilityEvent(ROOT_NODE_ID, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); + e.getText().add((String) data.get("message")); + mOwner.getParent().requestSendAccessibilityEvent(mOwner, e); + } default: assert false; } From a9a53d404bae80f8360adcf08043649d0a3bd63f Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 26 Apr 2018 15:31:43 -0700 Subject: [PATCH 0187/1190] Use the non-thread-hostile FontProviderSyncPtr for font resolution. (#5105) --- content_handler/application_runner.cc | 19 ++++++++++++------- content_handler/fuchsia_font_manager.cc | 9 ++------- content_handler/fuchsia_font_manager.h | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc index 4785169bd595d..9c8bb575e3fa4 100644 --- a/content_handler/application_runner.cc +++ b/content_handler/application_runner.cc @@ -108,13 +108,18 @@ void ApplicationRunner::SetupICU() { } void ApplicationRunner::SetupGlobalFonts() { - fonts::FontProviderPtr font_provider( - host_context_->ConnectToEnvironmentService()); - auto font_manager = - sk_make_sp(std::move(font_provider)); - blink::FontCollection::ForProcess() - .GetFontCollection() - ->SetDefaultFontManager(std::move(font_manager)); + // Fuchsia does not have per application (shell) fonts. Instead, all fonts + // must be obtained from the font provider. + auto process_font_collection = + blink::FontCollection::ForProcess().GetFontCollection(); + + // Connect to the system font provider. + fonts::FontProviderSyncPtr sync_font_provider; + host_context_->ConnectToEnvironmentService(sync_font_provider.NewRequest()); + + // Set the default font manager. + process_font_collection->SetDefaultFontManager( + sk_make_sp(std::move(sync_font_provider))); } void ApplicationRunner::FireTerminationCallbackIfNecessary() { diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc index c369e54400e10..a370997a579dc 100644 --- a/content_handler/fuchsia_font_manager.cc +++ b/content_handler/fuchsia_font_manager.cc @@ -54,7 +54,7 @@ fonts::FontSlant ToFontSlant(SkFontStyle::Slant slant) { } // anonymous namespace -FuchsiaFontManager::FuchsiaFontManager(fonts::FontProviderPtr provider) +FuchsiaFontManager::FuchsiaFontManager(fonts::FontProviderSyncPtr provider) : font_provider_(std::move(provider)) {} FuchsiaFontManager::~FuchsiaFontManager() = default; @@ -97,12 +97,7 @@ SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( request.slant = ToFontSlant(style.slant()); fonts::FontResponsePtr response; - font_provider_->GetFont( - std::move(request), - [&response](fonts::FontResponsePtr r) { response = std::move(r); }); - font_provider_.WaitForResponse(); - - if (!response) { + if (!font_provider_->GetFont(std::move(request), &response)) { FXL_DLOG(ERROR) << "Unable to contact the font provider. Did you run " "Flutter in an environment that has a font manager?"; return nullptr; diff --git a/content_handler/fuchsia_font_manager.h b/content_handler/fuchsia_font_manager.h index ecfb724b85878..974ed2c72a423 100644 --- a/content_handler/fuchsia_font_manager.h +++ b/content_handler/fuchsia_font_manager.h @@ -17,8 +17,8 @@ #ifndef TXT_FUCHSIA_FONT_MANAGER_H_ #define TXT_FUCHSIA_FONT_MANAGER_H_ -#include #include +#include #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" @@ -28,7 +28,7 @@ namespace txt { class FuchsiaFontManager final : public SkFontMgr { public: - FuchsiaFontManager(fonts::FontProviderPtr provider); + FuchsiaFontManager(fonts::FontProviderSyncPtr provider); ~FuchsiaFontManager() override; @@ -81,7 +81,7 @@ class FuchsiaFontManager final : public SkFontMgr { FXL_DISALLOW_COPY_AND_ASSIGN(FuchsiaFontManager); private: - mutable fonts::FontProviderPtr font_provider_; + mutable fonts::FontProviderSyncPtr font_provider_; }; } // namespace txt From bd3f2f7953c3ec397a5134e764dc8c6ad35bb120 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Apr 2018 18:34:21 -0400 Subject: [PATCH 0188/1190] Roll src/third_party/skia/ 47ed6f10e..a070ed7fc (21 commits; 1 trivial rolls) (#5106) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 876cfa2d1a7da..1d0f2b25f5fd0 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '47ed6f10ef1d6c29512f95e88a7e51456c4d8f87', + 'skia_revision': 'a070ed7fccd8bc9c5f314e1a4ac090c497862836', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index cc3af80ef2913..a2e31e709deb3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1a691e792539ae2519d4e5329e9f4ce3 +Signature: 271ce959a2f41a2441d97db11af6cbbb UNUSED LICENSES: @@ -17245,6 +17245,7 @@ FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.h FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h +FILE: ../../../third_party/skia/src/gpu/GrRenderTargetProxyPriv.h FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp From b6be9377c58c488afea042a1b0ed8910b158c319 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 26 Apr 2018 17:49:51 -0700 Subject: [PATCH 0189/1190] Create message response external typed data objects as Uint8Lists (#5101) PlatformMessageResponseDart will wrap large responses in Dart external typed data objects in order to avoid copying the data into a new buffer. Previously these objects were created with the Dart_TypedData_kByteData type. A weak persistent handle is then associated with the ByteData to provide a finalizer that deletes the raw buffer. However, the Dart VM could call finalizer on the ByteData even if references still existed to the Dart ByteBuffer object backing the ByteData. The ByteBuffer would then be referencing a deleted raw buffer. This PR prevents that scenario by creating a Dart_TypedData_kUint8 object, attaching the finalizer to that object, and then wrapping it in a ByteData. --- lib/ui/window.dart | 12 ++++++++---- lib/ui/window/platform_message_response_dart.cc | 4 ++-- lib/ui/window/window.cc | 12 ++++++++++-- lib/ui/window/window.h | 3 +++ 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index e84cb267940d8..95572ae910301 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -22,6 +22,10 @@ typedef void SemanticsActionCallback(int id, SemanticsAction action, ByteData ar /// [Window.onPlatformMessage]. typedef void PlatformMessageResponseCallback(ByteData data); +// The engine returns message responses as a Uint8List which is then wrapped +// in a ByteData. +typedef void _InternalPlatformMessageResponseCallback(Uint8List data); + /// Signature for [Window.onPlatformMessage]. typedef void PlatformMessageCallback(String name, ByteData data, PlatformMessageResponseCallback callback); @@ -687,7 +691,7 @@ class Window { throw new Exception(error); } String _sendPlatformMessage(String name, - PlatformMessageResponseCallback callback, + _InternalPlatformMessageResponseCallback callback, ByteData data) native 'Window_sendPlatformMessage'; /// Called whenever this window receives a message from a platform-specific @@ -717,15 +721,15 @@ class Window { /// Wraps the given [callback] in another callback that ensures that the /// original callback is called in the zone it was registered in. - static PlatformMessageResponseCallback _zonedPlatformMessageResponseCallback(PlatformMessageResponseCallback callback) { + static _InternalPlatformMessageResponseCallback _zonedPlatformMessageResponseCallback(PlatformMessageResponseCallback callback) { if (callback == null) return null; // Store the zone in which the callback is being registered. final Zone registrationZone = Zone.current; - return (ByteData data) { - registrationZone.runUnaryGuarded(callback, data); + return (Uint8List data) { + registrationZone.runUnaryGuarded(callback, data.buffer.asByteData()); }; } } diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index 2cca2fd179888..ce29e3dd67ec7 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -28,11 +28,11 @@ void MessageDataFinalizer(void* isolate_callback_data, Dart_Handle WrapByteData(std::vector data) { if (data.size() < kMessageCopyThreshold) { - return ToByteData(data); + return ToTypedData(Dart_TypedData_kUint8, data); } else { std::vector* heap_data = new std::vector(std::move(data)); Dart_Handle data_handle = Dart_NewExternalTypedData( - Dart_TypedData_kByteData, heap_data->data(), heap_data->size()); + Dart_TypedData_kUint8, heap_data->data(), heap_data->size()); DART_CHECK_VALID(data_handle); Dart_NewWeakPersistentHandle(data_handle, heap_data, heap_data->size(), MessageDataFinalizer); diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 2d5d7a1569b8f..129c57c00a24a 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -112,8 +112,16 @@ void _RespondToPlatformMessage(Dart_NativeArguments args) { } // namespace Dart_Handle ToByteData(const std::vector& buffer) { - Dart_Handle data_handle = - Dart_NewTypedData(Dart_TypedData_kByteData, buffer.size()); + return ToTypedData(Dart_TypedData_kByteData, buffer); +} + +Dart_Handle ToTypedData(Dart_TypedData_Type data_type, + const std::vector& buffer) { + FXL_DCHECK(data_type == Dart_TypedData_kByteData || + data_type == Dart_TypedData_kInt8 || + data_type == Dart_TypedData_kUint8); + + Dart_Handle data_handle = Dart_NewTypedData(data_type, buffer.size()); if (Dart_IsError(data_handle)) return data_handle; diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index 2feeccb65f9cc..54e1694746b5d 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -24,6 +24,9 @@ class Scene; Dart_Handle ToByteData(const std::vector& buffer); +Dart_Handle ToTypedData(Dart_TypedData_Type data_type, + const std::vector& buffer); + class WindowClient { public: virtual std::string DefaultRouteName() = 0; From 5b5d9207462323350a6c2dd988f32e3fa8c2527c Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 26 Apr 2018 18:40:53 -0700 Subject: [PATCH 0190/1190] Use interface handles for transferring ownership of channels across threads. (#5107) * Scenic is used on the GPU thread and is owned by the session connection held by the rasterizer. * The view container is used to initialize the mozart bindings on the UI thread. * Accessibility bridge is used on the platform thread. --- content_handler/accessibility_bridge.cc | 5 +++-- content_handler/accessibility_bridge.h | 2 +- content_handler/compositor_context.cc | 4 ++-- content_handler/compositor_context.h | 2 +- content_handler/engine.cc | 20 ++++++++++---------- content_handler/isolate_configurator.cc | 16 +++++++++------- content_handler/isolate_configurator.h | 7 ++++--- content_handler/platform_view.cc | 14 +++++++++----- content_handler/platform_view.h | 21 ++++++++++----------- content_handler/session_connection.cc | 5 +++-- content_handler/session_connection.h | 3 ++- 11 files changed, 54 insertions(+), 45 deletions(-) diff --git a/content_handler/accessibility_bridge.cc b/content_handler/accessibility_bridge.cc index ecff416427da5..706aab3d77cea 100644 --- a/content_handler/accessibility_bridge.cc +++ b/content_handler/accessibility_bridge.cc @@ -13,8 +13,9 @@ namespace flutter { -AccessibilityBridge::AccessibilityBridge(modular::ContextWriterPtr writer) - : writer_(std::move(writer)) {} +AccessibilityBridge::AccessibilityBridge( + fidl::InterfaceHandle writer) + : writer_(writer.Bind()) {} AccessibilityBridge::~AccessibilityBridge() = default; diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h index 70a304fb545b9..059baec0f5c99 100644 --- a/content_handler/accessibility_bridge.h +++ b/content_handler/accessibility_bridge.h @@ -17,7 +17,7 @@ namespace flutter { // with the Context Service. class AccessibilityBridge final { public: - AccessibilityBridge(modular::ContextWriterPtr writer); + AccessibilityBridge(fidl::InterfaceHandle writer); ~AccessibilityBridge(); diff --git a/content_handler/compositor_context.cc b/content_handler/compositor_context.cc index efad9ac2b9583..904ef4fad247c 100644 --- a/content_handler/compositor_context.cc +++ b/content_handler/compositor_context.cc @@ -56,13 +56,13 @@ class ScopedFrame final : public flow::CompositorContext::ScopedFrame { }; CompositorContext::CompositorContext( - const ui::ScenicPtr& scenic, + fidl::InterfaceHandle scenic, std::string debug_label, zx::eventpair import_token, OnMetricsUpdate session_metrics_did_change_callback, fxl::Closure session_error_callback) : debug_label_(std::move(debug_label)), - session_connection_(scenic, + session_connection_(std::move(scenic), debug_label_, std::move(import_token), std::move(session_metrics_did_change_callback), diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h index d5bed1f267d96..199c7a0139532 100644 --- a/content_handler/compositor_context.h +++ b/content_handler/compositor_context.h @@ -16,7 +16,7 @@ namespace flutter { // Fuchsia. class CompositorContext final : public flow::CompositorContext { public: - CompositorContext(const ui::ScenicPtr& scenic, + CompositorContext(fidl::InterfaceHandle scenic, std::string debug_label, zx::eventpair import_token, OnMetricsUpdate session_metrics_did_change_callback, diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 4a29cde426c42..0214782e6f8ce 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -45,12 +45,13 @@ Engine::Engine(Delegate& delegate, } // Setup the session connection. - ui::ScenicPtr scenic; + fidl::InterfaceHandle scenic; view_manager->GetScenic(scenic.NewRequest()); // Grab the parent environent services. The platform view may want to access // some of these services. - component::ServiceProviderPtr parent_environment_service_provider; + fidl::InterfaceHandle + parent_environment_service_provider; application_context.environment()->GetServices( parent_environment_service_provider.NewRequest()); @@ -62,7 +63,7 @@ Engine::Engine(Delegate& delegate, // Grab the accessibilty context writer that can understand the semtics tree // on the platform view. - modular::ContextWriterPtr accessibility_context_writer; + fidl::InterfaceHandle accessibility_context_writer; application_context.ConnectToEnvironmentService( accessibility_context_writer.NewRequest()); @@ -70,7 +71,7 @@ Engine::Engine(Delegate& delegate, // rasterizer. std::unique_ptr compositor_context = std::make_unique( - scenic, // scenic + std::move(scenic), // scenic thread_label_, // debug label std::move(import_token), // import token on_session_metrics_change_callback, // session metrics did change @@ -82,9 +83,8 @@ Engine::Engine(Delegate& delegate, fxl::MakeCopyable([debug_label = thread_label_, // parent_environment_service_provider = std::move(parent_environment_service_provider), // - view_manager = std::ref(view_manager), // + view_manager = view_manager.Unbind(), // view_owner = std::move(view_owner), // - scenic = std::move(scenic), // accessibility_context_writer = std::move(accessibility_context_writer), // export_token = std::move(export_token) // @@ -95,9 +95,8 @@ Engine::Engine(Delegate& delegate, debug_label, // debug label shell.GetTaskRunners(), // task runners std::move(parent_environment_service_provider), // services - view_manager, // view manager + std::move(view_manager), // view manager std::move(view_owner), // view owner - std::move(scenic), // scenic std::move(export_token), // export token std::move( accessibility_context_writer) // accessibility context writer @@ -158,13 +157,14 @@ Engine::Engine(Delegate& delegate, PlatformView* platform_view = static_cast(shell_->GetPlatformView().get()); auto& view = platform_view->GetMozartView(); + fidl::InterfaceHandle view_container; + view->GetContainer(view_container.NewRequest()); component::ApplicationEnvironmentPtr application_environment; application_context.ConnectToEnvironmentService( application_environment.NewRequest()); - isolate_configurator_ = std::make_unique( fdio_ns, // - view, // + std::move(view_container), // std::move(application_environment), // std::move(outgoing_services_request) // ); diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc index 99a9bee78e3e6..57ce22fef3365 100644 --- a/content_handler/isolate_configurator.cc +++ b/content_handler/isolate_configurator.cc @@ -16,12 +16,12 @@ namespace flutter { IsolateConfigurator::IsolateConfigurator( const UniqueFDIONS& fdio_ns, - views_v1::ViewPtr& view, + fidl::InterfaceHandle view_container, component::ApplicationEnvironmentPtr application_environment, fidl::InterfaceRequest outgoing_services_request) : fdio_ns_(fdio_ns), - view_(view), + view_container_(std::move(view_container)), application_environment_(std::move(application_environment)), outgoing_services_request_(std::move(outgoing_services_request)) {} @@ -42,8 +42,12 @@ bool IsolateConfigurator::ConfigureCurrentIsolate() { } // |mozart::NativesDelegate| -views_v1::View* IsolateConfigurator::GetMozartView() { - return view_.get(); +void IsolateConfigurator::OfferServiceProvider( + fidl::InterfaceHandle, + fidl::VectorPtr services) { + // TODO(chinmaygarde): Get the mozart view and forward this call to it on the + // right thread. This is currently used for the soft keyboard. + FXL_LOG(ERROR) << "IsolateConfigurator::OfferServiceProvider unimplemented."; } void IsolateConfigurator::BindFuchsia() { @@ -102,13 +106,11 @@ void IsolateConfigurator::BindScenic() { tonic::ToDart("_context"), // tonic::DartConverter::ToDart(reinterpret_cast( static_cast(this))))); - views_v1::ViewContainerPtr view_container; - view_->GetContainer(view_container.NewRequest()); DART_CHECK_VALID( Dart_SetField(mozart_internal, // tonic::ToDart("_viewContainer"), // tonic::ToDart(zircon::dart::Handle::Create( - view_container.Unbind().TakeChannel().release())))); + view_container_.TakeChannel().release())))); } } // namespace flutter diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h index b7cc438418bc6..1e27954dd313f 100644 --- a/content_handler/isolate_configurator.h +++ b/content_handler/isolate_configurator.h @@ -21,7 +21,7 @@ class IsolateConfigurator final : mozart::NativesDelegate { public: IsolateConfigurator( const UniqueFDIONS& fdio_ns, - views_v1::ViewPtr& view, + fidl::InterfaceHandle view_container, component::ApplicationEnvironmentPtr application_environment, fidl::InterfaceRequest outgoing_services_request); @@ -35,12 +35,13 @@ class IsolateConfigurator final : mozart::NativesDelegate { private: bool used_ = false; const UniqueFDIONS& fdio_ns_; - views_v1::ViewPtr& view_; + fidl::InterfaceHandle view_container_; component::ApplicationEnvironmentPtr application_environment_; fidl::InterfaceRequest outgoing_services_request_; // |mozart::NativesDelegate| - views_v1::View* GetMozartView() override; + void OfferServiceProvider(fidl::InterfaceHandle, + fidl::VectorPtr services); void BindFuchsia(); diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc index 00f46e4779234..8f768c05afae6 100644 --- a/content_handler/platform_view.cc +++ b/content_handler/platform_view.cc @@ -24,20 +24,21 @@ PlatformView::PlatformView( PlatformView::Delegate& delegate, std::string debug_label, blink::TaskRunners task_runners, - component::ServiceProviderPtr parent_environment_service_provider, - views_v1::ViewManagerPtr& view_manager, + fidl::InterfaceHandle + parent_environment_service_provider_handle, + fidl::InterfaceHandle view_manager_handle, fidl::InterfaceRequest view_owner, - ui::ScenicPtr scenic, zx::eventpair export_token, - modular::ContextWriterPtr accessibility_context_writer) + fidl::InterfaceHandle accessibility_context_writer) : shell::PlatformView(delegate, std::move(task_runners)), debug_label_(std::move(debug_label)), view_listener_(this), input_listener_(this), ime_client_(this), - scenic_(std::move(scenic)), accessibility_bridge_(std::move(accessibility_context_writer)), surface_(std::make_unique(debug_label_)) { + auto view_manager = view_manager_handle.Bind(); + // Create the view. view_manager->CreateView(view_.NewRequest(), // view std::move(view_owner), // view owner @@ -58,6 +59,8 @@ PlatformView::PlatformView( input_connection_->SetEventListener(input_listener_.NewBinding()); // Access the clipboard. + auto parent_environment_service_provider = + parent_environment_service_provider_handle.Bind(); component::ConnectToService(parent_environment_service_provider.get(), clipboard_.NewRequest()); @@ -79,6 +82,7 @@ void PlatformView::RegisterPlatformMessageHandlers() { } views_v1::ViewPtr& PlatformView::GetMozartView() { + FXL_DCHECK(view_.is_bound()); return view_; } diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h index 44deee166374c..62d9b54d7a394 100644 --- a/content_handler/platform_view.h +++ b/content_handler/platform_view.h @@ -28,16 +28,16 @@ class PlatformView final : public shell::PlatformView, public input::InputMethodEditorClient, public input::InputListener { public: - PlatformView( - PlatformView::Delegate& delegate, - std::string debug_label, - blink::TaskRunners task_runners, - component::ServiceProviderPtr parent_environment_service_provider, - views_v1::ViewManagerPtr& view_manager, - fidl::InterfaceRequest view_owner, - ui::ScenicPtr scenic, - zx::eventpair export_token, - modular::ContextWriterPtr accessibility_context_writer); + PlatformView(PlatformView::Delegate& delegate, + std::string debug_label, + blink::TaskRunners task_runners, + fidl::InterfaceHandle + parent_environment_service_provider, + fidl::InterfaceHandle view_manager, + fidl::InterfaceRequest view_owner, + zx::eventpair export_token, + fidl::InterfaceHandle + accessibility_context_writer); ~PlatformView(); @@ -55,7 +55,6 @@ class PlatformView final : public shell::PlatformView, fidl::Binding ime_client_; input::InputMethodEditorPtr ime_; modular::ClipboardPtr clipboard_; - ui::ScenicPtr scenic_; AccessibilityBridge accessibility_bridge_; std::unique_ptr surface_; blink::LogicalMetrics metrics_; diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index b1b6951f95799..ef43a2fd566c5 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -10,13 +10,14 @@ namespace flutter { SessionConnection::SessionConnection( - const ui::ScenicPtr& scenic, + fidl::InterfaceHandle scenic_handle, std::string debug_label, zx::eventpair import_token, OnMetricsUpdate session_metrics_did_change_callback, fxl::Closure session_error_callback) : debug_label_(std::move(debug_label)), - session_(scenic.get()), + scenic_(scenic_handle.Bind()), + session_(scenic_.get()), root_node_(&session_), surface_producer_(std::make_unique(&session_)), scene_update_context_(&session_, surface_producer_.get()), diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index 3cd128b86724c..43218820726e6 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -23,7 +23,7 @@ using OnMetricsUpdate = std::function; // maintaining the Scenic session connection and presenting node updates. class SessionConnection final { public: - SessionConnection(const ui::ScenicPtr& scenic, + SessionConnection(fidl::InterfaceHandle scenic, std::string debug_label, zx::eventpair import_token, OnMetricsUpdate session_metrics_did_change_callback, @@ -47,6 +47,7 @@ class SessionConnection final { private: const std::string debug_label_; + ui::ScenicPtr scenic_; scenic_lib::Session session_; scenic_lib::ImportNode root_node_; std::unique_ptr surface_producer_; From 31992cdba2abd63cde60dada626850965d742ae4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Apr 2018 22:03:21 -0400 Subject: [PATCH 0191/1190] Roll src/third_party/skia/ a070ed7fc..414be9b33 (4 commits; 1 trivial rolls) (#5108) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1d0f2b25f5fd0..e711c0febfda1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a070ed7fccd8bc9c5f314e1a4ac090c497862836', + 'skia_revision': '414be9b332f796e943db6e8a52dec86296a45e87', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a2e31e709deb3..f37753d5bc5b8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 271ce959a2f41a2441d97db11af6cbbb +Signature: cbfa470ac98e65e224bfef5018c51235 UNUSED LICENSES: From 017b32c97ecd0a5aa668c6abf809d251601719ad Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 27 Apr 2018 03:10:21 -0400 Subject: [PATCH 0192/1190] Roll src/third_party/skia/ 414be9b33..a886544a7 (1 commit) (#5109) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e711c0febfda1..9bd477e398401 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '414be9b332f796e943db6e8a52dec86296a45e87', + 'skia_revision': 'a886544a7bf727a8f0d75597df99474dcba97273', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f37753d5bc5b8..a9894dd42ae6a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: cbfa470ac98e65e224bfef5018c51235 +Signature: 9b4290fadae543debd54af179a8b17df UNUSED LICENSES: From f0c967e68483d15e64e4752cb26af8250d48567c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 27 Apr 2018 09:22:21 -0400 Subject: [PATCH 0193/1190] Roll src/third_party/skia/ a886544a7..82a334251 (1 commit) (#5110) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9bd477e398401..af33f35714dc4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a886544a7bf727a8f0d75597df99474dcba97273', + 'skia_revision': '82a33425166aacd0726bdd283c6de749420819a8', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a9894dd42ae6a..fd4593aacbb3c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9b4290fadae543debd54af179a8b17df +Signature: a7dd033a57643bc7eda05943be87c5fe UNUSED LICENSES: From 69b22553ee2bf539e4583842c814c2217a3859f8 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 27 Apr 2018 12:50:21 -0400 Subject: [PATCH 0194/1190] Roll src/third_party/skia/ 82a334251..cbdf5d5bf (4 commits) (#5111) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index af33f35714dc4..89f09f145c4ff 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '82a33425166aacd0726bdd283c6de749420819a8', + 'skia_revision': 'cbdf5d5bff66b04290409749ff4924bf12b11438', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fd4593aacbb3c..e2f41ee821b67 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a7dd033a57643bc7eda05943be87c5fe +Signature: 5433171f523e5dae35d19cc125a1f099 UNUSED LICENSES: From b28a35dde310690860d45f36757c61584372b325 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Fri, 27 Apr 2018 12:56:09 -0700 Subject: [PATCH 0195/1190] Roll dart to cd0c4e4fe1e5b69ac15c0a670f9dde2ee9733fc7. (#5113) * Roll dart to cd0c4e4fe1e5b69ac15c0a670f9dde2ee9733fc7. Changes since last roll: ``` cd0c4e4fe1 Kernel service just returns errors. Leaves printing to the VM. 010d8144bc Add missing copyright notice 70547d8197 Change linter subscriptions from functions to AstVisitor(s). 88a098c71c Improve fasta parser field name recovery bd76221d58 fix #31489, JS interop to `prototype` getter in dartdevk ca419a9251 dart2js status refresh da49615c2c Don't filter out references to constructors. cc968df178 [test] Fix analyzer warning in the recently added test 1c5d1a56e7 Clean up some hints 5a9a479a73 Fix #32966 too little stack overflow context to be useful 2786b9ff43 [vm/aot] Add detailed error messages and stack traces for null checks fbfe5691cb Change completionTarget.forOffset to accept & wrap dangling AstNodes. cb15b43c32 Add support for getting parse results synchronously e0ddab3c4c Fix bots after preview-dart2 was switched on by default. 88099ffcc3 Stop importing front_end into analyzer_plugin. 115850ca1d Revert "Clean up the use of deprecated API in the analyzer_plugin package" f95df2a26b [dartfmt] Bump dart:style to 1.0.11 c97d36c127 Add all concrete AST nodes for lints to subscribe. 1afe71c08a Enable preview-dart-2 as default for analyzer. 45e390003f [kernel] Report error for dangling node reference in metadata c1c90358a2 Record a missing file offset 16be5d1e33 [VM] Fix missing update of off-heap class sizes c8ad75d44a [VM] Make classes movable in sliding compactor c59b390806 Update status 93511d523c Track RTI for noSuchMethod f6db874416 fix some dartdevk behavior to match dartdevc in more cases c0015fe23f [gardening] Skip tests that are meaningless in AOT configuration. 9f7a247c33 Remove dangling pubspec.lock from pkg/dev_compiler/test/ 004ee9cd12 Fix how we use Comparable.compare, so we have a function with the appropriate type in JSArray.sort 30b53ceaab fix #30852, cyclic init errors in some cases in dartdevc 94f45c8876 Bring in the latest pub 328163bba9 [kernel] CloneVisitor should preserve isDefault on switch cases. 613c6d066c [vm][windows] Implement VirtualMemory::FreeSubSegment 7c6594c0bd fix #32302, friendlier `Type.toString()` in dartdevc e7848a8cda [vm/kernel] Avoid dangling references to DartTypes from constant pool d47203a71b Fix a crash in type inference 1030189d56 Add NodeLintRule and UnitLintRule that replace AstVisitor in lints. 9e9b50d19d Improve error messages for annotations involving undefined names (issue 27788) d7ff30c3e1 Add a missing call to greatestClosure c844011647 Don't skip pkg/kernel/test/metadata_test ``` * Update license hash. No changes to the licenses. --- DEPS | 6 +++--- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 89f09f145c4ff..c1619ee43cbe6 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '8d4074175fb95cd4da810b4bf652a956449bac37', + 'dart_revision': 'cd0c4e4fe1e5b69ac15c0a670f9dde2ee9733fc7', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -47,7 +47,7 @@ vars = { 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+2', - 'dart_dart_style_tag': '1.0.10', + 'dart_dart_style_tag': '1.0.11', 'dart_dartdoc_tag': 'v0.18.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', @@ -74,7 +74,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', + 'dart_pub_rev': '2e821bff00c00889afe5200e3a33f280ce942336', 'dart_pub_semver_tag': '1.3.7', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e2f41ee821b67..4d953d2bf5bfa 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5433171f523e5dae35d19cc125a1f099 +Signature: 73c6433a75e1b3fcb7afbe95d40895a4 UNUSED LICENSES: From cf026b098d15fb70a20b454dfcf28fdf0fc7c5f9 Mon Sep 17 00:00:00 2001 From: Yegor Date: Fri, 27 Apr 2018 13:47:26 -0700 Subject: [PATCH 0196/1190] Revert "Hold a global reference to the AssetManager Java object backing the APKAssetProvider (#5078)" (#5116) This reverts commit ac682632d7b050463e0461cbb416aaedbcba4bcf. It causes engine crashes in some Android Espresso tests. --- shell/platform/android/apk_asset_provider.cc | 3 +-- shell/platform/android/apk_asset_provider.h | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/shell/platform/android/apk_asset_provider.cc b/shell/platform/android/apk_asset_provider.cc index 268897ef5c58f..4cf6da16dc64f 100644 --- a/shell/platform/android/apk_asset_provider.cc +++ b/shell/platform/android/apk_asset_provider.cc @@ -10,8 +10,7 @@ namespace blink { APKAssetProvider::APKAssetProvider(JNIEnv* env, jobject jassetManager, std::string directory) - : java_asset_manager_(env, jassetManager), - directory_(std::move(directory)) { + : directory_(std::move(directory)) { assetManager_ = AAssetManager_fromJava(env, jassetManager); } diff --git a/shell/platform/android/apk_asset_provider.h b/shell/platform/android/apk_asset_provider.h index 7c3f8e12a23b2..70ddbe454bc61 100644 --- a/shell/platform/android/apk_asset_provider.h +++ b/shell/platform/android/apk_asset_provider.h @@ -9,7 +9,6 @@ #include #include "flutter/assets/asset_resolver.h" -#include "flutter/fml/platform/android/scoped_java_ref.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { @@ -22,7 +21,6 @@ class APKAssetProvider final : public AssetResolver { virtual ~APKAssetProvider(); private: - fml::jni::ScopedJavaGlobalRef java_asset_manager_; AAssetManager* assetManager_; const std::string directory_; @@ -38,4 +36,4 @@ class APKAssetProvider final : public AssetResolver { } // namespace blink -#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H +#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file From a386519882212c5b238932a1f0699f10fdeb258b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 27 Apr 2018 16:49:21 -0400 Subject: [PATCH 0197/1190] Roll src/third_party/skia/ cbdf5d5bf..cb3124813 (6 commits; 1 trivial rolls) (#5118) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c1619ee43cbe6..2cce4628a3104 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cbdf5d5bff66b04290409749ff4924bf12b11438', + 'skia_revision': 'cb31248132cc5ab08b0333b1ce0ab189dc69d155', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4d953d2bf5bfa..eef08b6a588bf 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 73c6433a75e1b3fcb7afbe95d40895a4 +Signature: 898e7f32ab813fa8fabcfc33460cea38 UNUSED LICENSES: @@ -17601,6 +17601,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming_client/examples/full.expected/basic.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Override.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json From 4d106f8520624fc8436fb8c87d813944027c79b5 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 27 Apr 2018 15:22:16 -0700 Subject: [PATCH 0198/1190] =?UTF-8?q?In=20case=20of=20empty=20Dart=20data?= =?UTF-8?q?=20responses,=20don=E2=80=99t=20call=20the=20buffer=20method=20?= =?UTF-8?q?on=20null.=20(#5114)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes regression introduced in https://github.com/flutter/engine/pull/5101. --- lib/ui/window.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index 95572ae910301..2228b1f42b6ce 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -729,7 +729,7 @@ class Window { final Zone registrationZone = Zone.current; return (Uint8List data) { - registrationZone.runUnaryGuarded(callback, data.buffer.asByteData()); + registrationZone.runUnaryGuarded(callback, data?.buffer?.asByteData()); }; } } From 8a5c92b22fd8b69764163d0d073df40af5f1815c Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 27 Apr 2018 16:26:16 -0700 Subject: [PATCH 0199/1190] Label threads before engine launch so early lifecycle crashes and logs have thread labels on them. (#5121) --- content_handler/engine.cc | 39 +++++++++++++++++++++++---------------- content_handler/engine.h | 2 -- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 0214782e6f8ce..1d2b0869cb8ee 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -17,6 +17,23 @@ namespace flutter { +static void UpdateNativeThreadLabelNames(const std::string& label, + const blink::TaskRunners& runners) { + auto set_thread_name = [](fxl::RefPtr runner, + std::string prefix, std::string suffix) { + if (!runner) { + return; + } + fml::TaskRunner::RunNowOrPostTask(runner, [name = prefix + suffix]() { + zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); + }); + }; + set_thread_name(runners.GetPlatformTaskRunner(), label, ".platform"); + set_thread_name(runners.GetUITaskRunner(), label, ".ui"); + set_thread_name(runners.GetGPUTaskRunner(), label, ".gpu"); + set_thread_name(runners.GetIOTaskRunner(), label, ".io"); +} + Engine::Engine(Delegate& delegate, std::string thread_label, component::ApplicationContext& application_context, @@ -123,6 +140,8 @@ Engine::Engine(Delegate& delegate, host_threads_[2].TaskRunner() // io ); + UpdateNativeThreadLabelNames(thread_label_, task_runners); + settings_.verbose_logging = true; settings_.root_isolate_create_callback = @@ -186,8 +205,6 @@ Engine::Engine(Delegate& delegate, FXL_LOG(ERROR) << "Could not (re)launch the engine in configuration"; } })); - - UpdateNativeThreadLabelNames(); } Engine::~Engine() { @@ -197,20 +214,6 @@ Engine::~Engine() { } } -void Engine::UpdateNativeThreadLabelNames() const { - auto set_thread_name = [](fxl::RefPtr runner, - std::string prefix, std::string suffix) { - runner->PostTask([name = prefix + suffix]() { - zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); - }); - }; - auto runners = shell_->GetTaskRunners(); - set_thread_name(runners.GetPlatformTaskRunner(), thread_label_, ".platform"); - set_thread_name(runners.GetUITaskRunner(), thread_label_, ".ui"); - set_thread_name(runners.GetGPUTaskRunner(), thread_label_, ".gpu"); - set_thread_name(runners.GetIOTaskRunner(), thread_label_, ".io"); -} - std::pair Engine::GetEngineReturnCode() const { std::pair code(false, 0); if (!shell_) { @@ -235,9 +238,13 @@ void Engine::OnMainIsolateStart() { FXL_LOG(ERROR) << "Could not configure some native embedder bindings for a " "new root isolate."; } + FXL_DLOG(INFO) << "Main isolate for engine '" << thread_label_ + << "' was started."; } void Engine::OnMainIsolateShutdown() { + FXL_DLOG(INFO) << "Main isolate for engine '" << thread_label_ + << "' shutting down."; Terminate(); } diff --git a/content_handler/engine.h b/content_handler/engine.h index c881726cac5a2..d0442dca30cca 100644 --- a/content_handler/engine.h +++ b/content_handler/engine.h @@ -57,8 +57,6 @@ class Engine final { void OnSessionMetricsDidChange(double device_pixel_ratio); - void UpdateNativeThreadLabelNames() const; - FXL_DISALLOW_COPY_AND_ASSIGN(Engine); }; From 5f1efe64ff2695c4381d136ca0cddf194180f4fa Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 27 Apr 2018 20:18:22 -0400 Subject: [PATCH 0200/1190] Roll src/third_party/skia/ cb3124813..275df2e87 (3 commits; 1 trivial rolls) (#5123) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2cce4628a3104..222b6ba2625c1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cb31248132cc5ab08b0333b1ce0ab189dc69d155', + 'skia_revision': '275df2e8730676c1e0ccc715a98868c6421bc5f4', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index eef08b6a588bf..19c93b4ede3bd 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 898e7f32ab813fa8fabcfc33460cea38 +Signature: fdd2f04ad0fef66ca19aa69f74bd4dbd UNUSED LICENSES: From fd1c484f8ecb038e8d3f5887ce51d5b486ac59c3 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 27 Apr 2018 18:40:56 -0700 Subject: [PATCH 0201/1190] Log errors on common interface channels and use interface handles for IsolateConfigurator. (#5124) --- content_handler/isolate_configurator.cc | 5 ++-- content_handler/isolate_configurator.h | 6 ++-- content_handler/platform_view.cc | 37 +++++++++++++++++-------- content_handler/platform_view.h | 3 ++ 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc index 57ce22fef3365..30de7fad85459 100644 --- a/content_handler/isolate_configurator.cc +++ b/content_handler/isolate_configurator.cc @@ -17,7 +17,8 @@ namespace flutter { IsolateConfigurator::IsolateConfigurator( const UniqueFDIONS& fdio_ns, fidl::InterfaceHandle view_container, - component::ApplicationEnvironmentPtr application_environment, + fidl::InterfaceHandle + application_environment, fidl::InterfaceRequest outgoing_services_request) : fdio_ns_(fdio_ns), @@ -51,7 +52,7 @@ void IsolateConfigurator::OfferServiceProvider( } void IsolateConfigurator::BindFuchsia() { - fuchsia::dart::Initialize(application_environment_.Unbind(), + fuchsia::dart::Initialize(std::move(application_environment_), std::move(outgoing_services_request_)); } diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h index 1e27954dd313f..b472448d57a72 100644 --- a/content_handler/isolate_configurator.h +++ b/content_handler/isolate_configurator.h @@ -22,7 +22,8 @@ class IsolateConfigurator final : mozart::NativesDelegate { IsolateConfigurator( const UniqueFDIONS& fdio_ns, fidl::InterfaceHandle view_container, - component::ApplicationEnvironmentPtr application_environment, + fidl::InterfaceHandle + application_environment, fidl::InterfaceRequest outgoing_services_request); @@ -36,7 +37,8 @@ class IsolateConfigurator final : mozart::NativesDelegate { bool used_ = false; const UniqueFDIONS& fdio_ns_; fidl::InterfaceHandle view_container_; - component::ApplicationEnvironmentPtr application_environment_; + fidl::InterfaceHandle + application_environment_; fidl::InterfaceRequest outgoing_services_request_; // |mozart::NativesDelegate| diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc index 8f768c05afae6..720aa5f3d5c79 100644 --- a/content_handler/platform_view.cc +++ b/content_handler/platform_view.cc @@ -20,6 +20,13 @@ constexpr char kFlutterPlatformChannel[] = "flutter/platform"; constexpr char kTextInputChannel[] = "flutter/textinput"; constexpr char kKeyEventChannel[] = "flutter/keyevent"; +template +void SetInterfaceErrorHandler(fidl::InterfacePtr& interface, + std::string name) { + interface.set_error_handler( + [name]() { FXL_DLOG(ERROR) << "Interface error on: " << name; }); +} + PlatformView::PlatformView( PlatformView::Delegate& delegate, std::string debug_label, @@ -32,36 +39,44 @@ PlatformView::PlatformView( fidl::InterfaceHandle accessibility_context_writer) : shell::PlatformView(delegate, std::move(task_runners)), debug_label_(std::move(debug_label)), + view_manager_(view_manager_handle.Bind()), view_listener_(this), input_listener_(this), ime_client_(this), accessibility_bridge_(std::move(accessibility_context_writer)), surface_(std::make_unique(debug_label_)) { - auto view_manager = view_manager_handle.Bind(); + // Register all error handlers. + SetInterfaceErrorHandler(view_manager_, "View Manager"); + SetInterfaceErrorHandler(view_, "View"); + SetInterfaceErrorHandler(input_connection_, "Input Connection"); + SetInterfaceErrorHandler(ime_, "Input Method Editor"); + SetInterfaceErrorHandler(clipboard_, "Clipboard"); + SetInterfaceErrorHandler(service_provider_, "Service Provider"); + SetInterfaceErrorHandler(parent_environment_service_provider_, + "Parent Environment Service Provider"); // Create the view. - view_manager->CreateView(view_.NewRequest(), // view - std::move(view_owner), // view owner - view_listener_.NewBinding(), // view listener - std::move(export_token), // export token - debug_label_ // diagnostic label + view_manager_->CreateView(view_.NewRequest(), // view + std::move(view_owner), // view owner + view_listener_.NewBinding(), // view listener + std::move(export_token), // export token + debug_label_ // diagnostic label ); // Get the services from the created view. - component::ServiceProviderPtr service_provider; - view_->GetServiceProvider(service_provider.NewRequest()); + view_->GetServiceProvider(service_provider_.NewRequest()); // Get the input connection from the services of the view. - component::ConnectToService(service_provider.get(), + component::ConnectToService(service_provider_.get(), input_connection_.NewRequest()); // Set the input listener on the input connection. input_connection_->SetEventListener(input_listener_.NewBinding()); // Access the clipboard. - auto parent_environment_service_provider = + parent_environment_service_provider_ = parent_environment_service_provider_handle.Bind(); - component::ConnectToService(parent_environment_service_provider.get(), + component::ConnectToService(parent_environment_service_provider_.get(), clipboard_.NewRequest()); // Finally! Register the native platform message handlers. diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h index 62d9b54d7a394..28ac6e4d107df 100644 --- a/content_handler/platform_view.h +++ b/content_handler/platform_view.h @@ -47,13 +47,16 @@ class PlatformView final : public shell::PlatformView, private: const std::string debug_label_; + views_v1::ViewManagerPtr view_manager_; views_v1::ViewPtr view_; + component::ServiceProviderPtr service_provider_; fidl::Binding view_listener_; input::InputConnectionPtr input_connection_; fidl::Binding input_listener_; int current_text_input_client_ = 0; fidl::Binding ime_client_; input::InputMethodEditorPtr ime_; + component::ServiceProviderPtr parent_environment_service_provider_; modular::ClipboardPtr clipboard_; AccessibilityBridge accessibility_bridge_; std::unique_ptr surface_; From 58d912c6cabff3c65b44094be79a37b560cca73e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 27 Apr 2018 23:47:21 -0400 Subject: [PATCH 0202/1190] Roll src/third_party/skia/ 275df2e87..7df62b559 (1 commit) (#5125) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 222b6ba2625c1..18357f0d6328d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '275df2e8730676c1e0ccc715a98868c6421bc5f4', + 'skia_revision': '7df62b559a657b661171d44ebf6c5ea2623fd737', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 19c93b4ede3bd..47d1d1da48008 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: fdd2f04ad0fef66ca19aa69f74bd4dbd +Signature: c5fc14055e8255dd5fd2c29dc34ce763 UNUSED LICENSES: From 613aae032f07b01b9ac2172529e51869431fe465 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Fri, 27 Apr 2018 21:30:13 -0700 Subject: [PATCH 0203/1190] Undo pub_rev update that seems to be breaking Flutter. (#5122) --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 18357f0d6328d..2215ca7df0a42 100644 --- a/DEPS +++ b/DEPS @@ -74,7 +74,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '2e821bff00c00889afe5200e3a33f280ce942336', + 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', 'dart_pub_semver_tag': '1.3.7', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', From b63399039ac3d88fda320dde5f1333345ce3256f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 28 Apr 2018 03:18:22 -0400 Subject: [PATCH 0204/1190] Roll src/third_party/skia/ 7df62b559..0f97bac4a (1 commit) (#5126) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2215ca7df0a42..1030393c29409 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7df62b559a657b661171d44ebf6c5ea2623fd737', + 'skia_revision': '0f97bac4a53f674fb1ca22c65411b0c890b89c7d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 47d1d1da48008..d708c365d89fc 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c5fc14055e8255dd5fd2c29dc34ce763 +Signature: aeae9238d5cae3a77ec84a75dcaed420 UNUSED LICENSES: From e16088340ad7fa06939673a885d1a001be55ac22 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 28 Apr 2018 11:07:21 -0400 Subject: [PATCH 0205/1190] Roll src/third_party/skia/ 0f97bac4a..5b6d4a354 (1 commit) (#5127) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1030393c29409..1af5c64418896 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0f97bac4a53f674fb1ca22c65411b0c890b89c7d', + 'skia_revision': '5b6d4a35467032fcac463f5e119c5170badc7521', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d708c365d89fc..c212076f5b282 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: aeae9238d5cae3a77ec84a75dcaed420 +Signature: 8b2a5e27d9a504749eb2853f53a6f7d4 UNUSED LICENSES: From 5893eedc461b3fb0c29e21611f8ac523a5f5e9e5 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 28 Apr 2018 17:00:21 -0400 Subject: [PATCH 0206/1190] Roll src/third_party/skia/ 5b6d4a354..cccafe8cf (1 commit) (#5128) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1af5c64418896..15d94f9cfe7b6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5b6d4a35467032fcac463f5e119c5170badc7521', + 'skia_revision': 'cccafe8cfd2366b60585c0b65531282abb7a1404', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c212076f5b282..031584b8d1936 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8b2a5e27d9a504749eb2853f53a6f7d4 +Signature: dc48f56b307bcf12655d222c2b0c59a3 UNUSED LICENSES: From 7e84154578e47c8d625a158592f1d0ba6e8739b9 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 29 Apr 2018 04:44:21 -0400 Subject: [PATCH 0207/1190] Roll src/third_party/skia/ cccafe8cf..efb4d08dd (1 commit) (#5129) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 15d94f9cfe7b6..e6e4449999f7f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cccafe8cfd2366b60585c0b65531282abb7a1404', + 'skia_revision': 'efb4d08dd43cd07e0e1d2f2d5819046259a5d340', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 031584b8d1936..a62417b6621da 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: dc48f56b307bcf12655d222c2b0c59a3 +Signature: 222f70bb22c6f10e3d0d44af45c881b9 UNUSED LICENSES: From fabed625267a1dbfe81e19e083a46de1255de09c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 30 Apr 2018 07:53:21 -0400 Subject: [PATCH 0208/1190] Roll src/third_party/skia/ efb4d08dd..58b90f7f1 (1 commit) (#5130) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index e6e4449999f7f..a6df285e4c450 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'efb4d08dd43cd07e0e1d2f2d5819046259a5d340', + 'skia_revision': '58b90f7f1757bd70b836c9daeb8f1cf6c2cd660b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From eecd777dd3b24c1ba21a9493e71a77753ebc6a05 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 30 Apr 2018 11:26:21 -0400 Subject: [PATCH 0209/1190] Roll src/third_party/skia/ 58b90f7f1..ba36572d1 (3 commits) (#5131) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a6df285e4c450..beb51c5f91fb6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '58b90f7f1757bd70b836c9daeb8f1cf6c2cd660b', + 'skia_revision': 'ba36572d1c681c50066be6a19542b12cb434c59b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a62417b6621da..247c52344ea59 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 222f70bb22c6f10e3d0d44af45c881b9 +Signature: 18e4a62b979a93d4c408618d8383a161 UNUSED LICENSES: From 5b4ab0dc80354d8e7044a837ebaccd1692687954 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 30 Apr 2018 10:44:01 -0700 Subject: [PATCH 0210/1190] Detach from JNI during shutdown of the UI thread on Android (#5120) The APKAssetProvider will hold a reference to its Java peer (see https://github.com/flutter/engine/commit/ac682632d7b050463e0461cbb416aaedbcba4bcf) After dropping this reference, the UI thread must detach from JNI before exiting. --- .../platform/android/android_shell_holder.cc | 20 ++++++++++++++++++- shell/platform/android/android_shell_holder.h | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index 7dc454f1fb74a..5ef505e77adfa 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -6,6 +6,7 @@ #include "flutter/shell/platform/android/android_shell_holder.h" +#include #include #include @@ -27,9 +28,18 @@ AndroidShellHolder::AndroidShellHolder( static size_t shell_count = 1; auto thread_label = std::to_string(shell_count++); + FXL_CHECK(pthread_key_create(&thread_destruct_key_, ThreadDestructCallback) == + 0); + thread_host_ = {thread_label, ThreadHost::Type::UI | ThreadHost::Type::GPU | ThreadHost::Type::IO}; + // Detach from JNI when the UI thread exits. + thread_host_.ui_thread->GetTaskRunner()->PostTask( + [key = thread_destruct_key_]() { + FXL_CHECK(pthread_setspecific(key, reinterpret_cast(1)) == 0); + }); + fml::WeakPtr weak_platform_view; Shell::CreateCallback on_create_platform_view = [java_object, &weak_platform_view](Shell& shell) { @@ -80,7 +90,15 @@ AndroidShellHolder::AndroidShellHolder( } } -AndroidShellHolder::~AndroidShellHolder() = default; +AndroidShellHolder::~AndroidShellHolder() { + shell_.reset(); + thread_host_.Reset(); + FXL_CHECK(pthread_key_delete(thread_destruct_key_) == 0); +} + +void AndroidShellHolder::ThreadDestructCallback(void* value) { + fml::jni::DetachFromVM(); +} bool AndroidShellHolder::IsValid() const { return is_valid_; diff --git a/shell/platform/android/android_shell_holder.h b/shell/platform/android/android_shell_holder.h index e0905f0f9e42e..4bf42a776dfb0 100644 --- a/shell/platform/android/android_shell_holder.h +++ b/shell/platform/android/android_shell_holder.h @@ -50,6 +50,9 @@ class AndroidShellHolder { ThreadHost thread_host_; std::unique_ptr shell_; bool is_valid_ = false; + pthread_key_t thread_destruct_key_; + + static void ThreadDestructCallback(void* value); FXL_DISALLOW_COPY_AND_ASSIGN(AndroidShellHolder); }; From 3ff144459cddda155967c183dce2d201a9dd73b7 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 30 Apr 2018 14:56:22 -0400 Subject: [PATCH 0211/1190] Roll src/third_party/skia/ ba36572d1..44a8c74e3 (6 commits) (#5134) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index beb51c5f91fb6..e78ccde31ea12 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ba36572d1c681c50066be6a19542b12cb434c59b', + 'skia_revision': '44a8c74e3554abf8ad8726312ceecfbce2cddb7a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 247c52344ea59..7e947cdf508d2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 18e4a62b979a93d4c408618d8383a161 +Signature: 4ee20ccd68bd898cbc841e690a6285f7 UNUSED LICENSES: From 7004e0654c537c79788ed02f125b9350ceff7cfe Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 30 Apr 2018 12:29:40 -0700 Subject: [PATCH 0212/1190] Re-land "Hold a global reference to the AssetManager Java object backing the APKAssetProvider" (#5132) Fixes https://github.com/flutter/flutter/issues/16222 --- shell/platform/android/apk_asset_provider.cc | 3 ++- shell/platform/android/apk_asset_provider.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/shell/platform/android/apk_asset_provider.cc b/shell/platform/android/apk_asset_provider.cc index 4cf6da16dc64f..268897ef5c58f 100644 --- a/shell/platform/android/apk_asset_provider.cc +++ b/shell/platform/android/apk_asset_provider.cc @@ -10,7 +10,8 @@ namespace blink { APKAssetProvider::APKAssetProvider(JNIEnv* env, jobject jassetManager, std::string directory) - : directory_(std::move(directory)) { + : java_asset_manager_(env, jassetManager), + directory_(std::move(directory)) { assetManager_ = AAssetManager_fromJava(env, jassetManager); } diff --git a/shell/platform/android/apk_asset_provider.h b/shell/platform/android/apk_asset_provider.h index 70ddbe454bc61..7c3f8e12a23b2 100644 --- a/shell/platform/android/apk_asset_provider.h +++ b/shell/platform/android/apk_asset_provider.h @@ -9,6 +9,7 @@ #include #include "flutter/assets/asset_resolver.h" +#include "flutter/fml/platform/android/scoped_java_ref.h" #include "lib/fxl/memory/ref_counted.h" namespace blink { @@ -21,6 +22,7 @@ class APKAssetProvider final : public AssetResolver { virtual ~APKAssetProvider(); private: + fml::jni::ScopedJavaGlobalRef java_asset_manager_; AAssetManager* assetManager_; const std::string directory_; @@ -36,4 +38,4 @@ class APKAssetProvider final : public AssetResolver { } // namespace blink -#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H \ No newline at end of file +#endif // FLUTTER_ASSETS_APK_ASSET_PROVIDER_H From bb9b84ffb8ed0980ec52f488649823e84c1c45d6 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Mon, 30 Apr 2018 13:57:32 -0700 Subject: [PATCH 0213/1190] Roll Dart to 0cc70c4a7c448078dd2aea8e45c56bc50fbbb31c. (#5133) --- DEPS | 2 +- runtime/dart_isolate.cc | 2 ++ travis/licenses_golden/licenses_third_party | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e78ccde31ea12..8cebddb9d99ee 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'cd0c4e4fe1e5b69ac15c0a670f9dde2ee9733fc7', + 'dart_revision': '0cc70c4a7c448078dd2aea8e45c56bc50fbbb31c', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 05b34b979e166..63c0a5350a923 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -661,6 +661,8 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( ->GetSnapshotPointer(), // embedder_isolate->GetIsolateSnapshot() ->GetInstructionsIfPresent(), // + nullptr, // + nullptr, // flags, // embedder_isolate.get(), // error // diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7e947cdf508d2..842828f84db00 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4ee20ccd68bd898cbc841e690a6285f7 +Signature: 316af4c9992c358f8828e78e0ad2855e UNUSED LICENSES: @@ -6037,6 +6037,7 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h +FILE: ../../../third_party/dart/runtime/vm/hash.h FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h FILE: ../../../third_party/dart/sdk/lib/js/_js.dart From cf91f89c8492a58bdab66792e86aed7884b7160a Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Mon, 30 Apr 2018 15:20:29 -0700 Subject: [PATCH 0214/1190] Adding Color.alphaBlend (#5119) This is helpful for some Material Design widgets, which are specified as a semi-transparent color over top of a "material". In some cases, the resulting alpha-blended color can be used instead of compositing an additional shape with an opacity. This new Color.alphaBlend function mimics the alpha blending function, and creates the resulting combined color. The optimization only works for solid color shapes that have the same geometry, of course. --- lib/ui/painting.dart | 77 ++++++++++++++++++++++++++---------- testing/dart/color_test.dart | 57 ++++++++++++++++++++++---- 2 files changed, 106 insertions(+), 28 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 561a8db64774d..83e7a859474c3 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -270,6 +270,41 @@ class Color { ); } + /// Combine the foreground color as a transparent color over top + /// of a background color, and return the resulting combined color. + /// + /// This uses standard alpha blending ("SRC over DST") rules to produce a + /// blended color from two colors. This can be used as a performance + /// enhancement when trying to avoid needless alpha blending compositing + /// operations for two things that are solid colors with the same shape, but + /// overlay each other: instead, just paint one with the combined color. + static Color alphaBlend(Color foreground, Color background) { + final int alpha = foreground.alpha; + if (alpha == 0x00) { // Foreground completely transparent. + return background; + } + final int invAlpha = 0xff - alpha; + int backAlpha = background.alpha; + if (backAlpha == 0xff) { // Opaque background case + return new Color.fromARGB( + 0xff, + (alpha * foreground.red + invAlpha * background.red) ~/ 0xff, + (alpha * foreground.green + invAlpha * background.green) ~/ 0xff, + (alpha * foreground.blue + invAlpha * background.blue) ~/ 0xff, + ); + } else { // General case + backAlpha = (backAlpha * invAlpha) ~/ 0xff; + final int outAlpha = alpha + backAlpha; + assert(outAlpha != 0x00); + return new Color.fromARGB( + outAlpha, + (foreground.red * alpha + background.red * backAlpha) ~/ outAlpha, + (foreground.green * alpha + background.green * backAlpha) ~/ outAlpha, + (foreground.blue * alpha + background.blue * backAlpha) ~/ outAlpha, + ); + } + } + @override bool operator ==(dynamic other) { if (identical(this, other)) @@ -316,7 +351,7 @@ class Color { /// The horizontal and vertical bars in these images show the red, green, and /// blue channels with varying opacity levels, then all three color channels /// together with those same varying opacity levels, then all three color -/// chanels set to zero with those varying opacity levels, then two bars showing +/// channels set to zero with those varying opacity levels, then two bars showing /// a red/green/blue repeating gradient, the first with full opacity and the /// second with partial opacity, and finally a bar with the three color channels /// set to zero but the opacity varying in a repeating gradient. @@ -513,7 +548,7 @@ enum BlendMode { /// /// See also: /// - /// * [screen], which does a similar computation but inversed. + /// * [screen], which does a similar computation but inverted. /// * [overlay], which combines [modulate] and [screen] to favor the /// destination image. /// * [hardLight], which combines [modulate] and [screen] to favor the @@ -525,13 +560,13 @@ enum BlendMode { /// Multiply the inverse of the components of the source and destination /// images, and inverse the result. /// - /// Inversing the components means that a fully saturated channel (opaque + /// Inverting the components means that a fully saturated channel (opaque /// white) is treated as the value 0.0, and values normally treated as 0.0 /// (black, transparent) are treated as 1.0. /// /// This is essentially the same as [modulate] blend mode, but with the values - /// of the colors inversed before the multiplication and the result being - /// inversed back before rendering. + /// of the colors inverted before the multiplication and the result being + /// inverted back before rendering. /// /// This can only result in the same or lighter colors (multiplying by black, /// 1.0, results in no change; multiplying by white, 0.0, results in white). @@ -544,7 +579,7 @@ enum BlendMode { /// /// See also: /// - /// * [modulate], which does a similar computation but without inversing the + /// * [modulate], which does a similar computation but without inverting the /// values. /// * [overlay], which combines [modulate] and [screen] to favor the /// destination image. @@ -558,9 +593,9 @@ enum BlendMode { /// Specifically, if the destination value is smaller, this multiplies it with /// the source value, whereas is the source value is smaller, it multiplies /// the inverse of the source value with the inverse of the destination value, - /// then inverses the result. + /// then inverts the result. /// - /// Inversing the components means that a fully saturated channel (opaque + /// Inverting the components means that a fully saturated channel (opaque /// white) is treated as the value 0.0, and values normally treated as 0.0 /// (black, transparent) are treated as 1.0. /// @@ -594,7 +629,7 @@ enum BlendMode { /// Divide the destination by the inverse of the source. /// - /// Inversing the components means that a fully saturated channel (opaque + /// Inverting the components means that a fully saturated channel (opaque /// white) is treated as the value 0.0, and values normally treated as 0.0 /// (black, transparent) are treated as 1.0. /// @@ -603,7 +638,7 @@ enum BlendMode { /// Divide the inverse of the destination by the the source, and inverse the result. /// - /// Inversing the components means that a fully saturated channel (opaque + /// Inverting the components means that a fully saturated channel (opaque /// white) is treated as the value 0.0, and values normally treated as 0.0 /// (black, transparent) are treated as 1.0. /// @@ -616,9 +651,9 @@ enum BlendMode { /// Specifically, if the source value is smaller, this multiplies it with the /// destination value, whereas is the destination value is smaller, it /// multiplies the inverse of the destination value with the inverse of the - /// source value, then inverses the result. + /// source value, then inverts the result. /// - /// Inversing the components means that a fully saturated channel (opaque + /// Inverting the components means that a fully saturated channel (opaque /// white) is treated as the value 0.0, and values normally treated as 0.0 /// (black, transparent) are treated as 1.0. /// @@ -635,7 +670,7 @@ enum BlendMode { /// Use [colorDodge] for source values below 0.5 and [colorBurn] for source /// values above 0.5. /// - /// This results in a similal but softer effect than [overlay]. + /// This results in a similar but softer effect than [overlay]. /// /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_softLight.png) /// @@ -646,7 +681,7 @@ enum BlendMode { /// Subtract the smaller value from the bigger value for each channel. /// - /// Compositing black has no effect; compositing white inverses the colors of + /// Compositing black has no effect; compositing white inverts the colors of /// the other image. /// /// The opacity of the output image is computed in the same way as for @@ -660,7 +695,7 @@ enum BlendMode { /// Subtract double the product of the two images from the sum of the two /// images. /// - /// Compositing black has no effect; compositing white inverses the colors of + /// Compositing black has no effect; compositing white inverts the colors of /// the other image. /// /// The opacity of the output image is computed in the same way as for @@ -1428,7 +1463,7 @@ enum PathOperation { /// /// For example, if the two paths are overlapping circles of equal diameter /// but differing centers, the result would be a figure-eight like shape - /// matching the outter boundaries of both circles. + /// matching the outer boundaries of both circles. union, /// Create a new path that is the exclusive-or of the two paths, leaving /// everything but the overlapping pieces of the path. @@ -1448,7 +1483,7 @@ enum PathOperation { /// See also: /// /// * [difference], which is the same but subtracting the second path - /// from the frist. + /// from the first. reverseDifference, } @@ -1522,7 +1557,7 @@ class Path extends NativeFieldWrapperClass2 { /// (x2,y2). void cubicTo(double x1, double y1, double x2, double y2, double x3, double y3) native 'Path_cubicTo'; - /// Adds a cubcic bezier segment that curves from the current point + /// Adds a cubic bezier segment that curves from the current point /// to the point at the offset (x3,y3) from the current point, using /// the control points at the offsets (x1,y1) and (x2,y2) from the /// current point. @@ -2503,7 +2538,7 @@ class Canvas extends NativeFieldWrapperClass2 { /// /// ## Using saveLayer with clips /// - /// When a rectanglular clip operation (from [clipRect]) is not axis-aligned + /// When a rectangular clip operation (from [clipRect]) is not axis-aligned /// with the raster buffer, or when the clip operation is not rectalinear (e.g. /// because it is a rounded rectangle clip created by [clipRRect] or an /// arbitrarily complicated path clip created by [clipPath]), the edge of the @@ -3227,8 +3262,8 @@ typedef String _Callbacker(_Callback callback); /// Converts a method that receives a value-returning callback to a method that /// returns a Future. /// -/// Return a [String] to cause an [Exception] to be sychnorously thrown with that -/// string as a message. +/// Return a [String] to cause an [Exception] to be synchronously thrown with +/// that string as a message. /// /// If the callback is called with null, the future completes with an error. /// diff --git a/testing/dart/color_test.dart b/testing/dart/color_test.dart index 7b39d5d7db86c..6bdccc7b72f6d 100644 --- a/testing/dart/color_test.dart +++ b/testing/dart/color_test.dart @@ -12,7 +12,7 @@ class NotAColor extends Color { void main() { test('color accessors should work', () { - Color foo = const Color(0x12345678); + final Color foo = const Color(0x12345678); expect(foo.alpha, equals(0x12)); expect(foo.red, equals(0x34)); expect(foo.green, equals(0x56)); @@ -20,16 +20,16 @@ void main() { }); test('paint set to black', () { - Color c = const Color(0x00000000); - Paint p = new Paint(); + final Color c = const Color(0x00000000); + final Paint p = new Paint(); p.color = c; expect(c.toString(), equals('Color(0x00000000)')); }); test('color created with out of bounds value', () { try { - Color c = const Color(0x100 << 24); - Paint p = new Paint(); + final Color c = const Color(0x100 << 24); + final Paint p = new Paint(); p.color = c; } catch (e) { expect(e != null, equals(true)); @@ -38,8 +38,8 @@ void main() { test('color created with wildly out of bounds value', () { try { - Color c = const Color(1 << 1000000); - Paint p = new Paint(); + final Color c = const Color(1 << 1000000); + final Paint p = new Paint(); p.color = c; } catch (e) { expect(e != null, equals(true)); @@ -78,6 +78,49 @@ void main() { ); }); + test('Color.alphaBlend', () { + expect( + Color.alphaBlend(const Color(0x00000000), const Color(0x00000000)), + const Color(0x00000000), + ); + expect( + Color.alphaBlend(const Color(0x00000000), const Color(0xFFFFFFFF)), + const Color(0xFFFFFFFF), + ); + expect( + Color.alphaBlend(const Color(0xFFFFFFFF), const Color(0x00000000)), + const Color(0xFFFFFFFF), + ); + expect( + Color.alphaBlend(const Color(0xFFFFFFFF), const Color(0xFFFFFFFF)), + const Color(0xFFFFFFFF), + ); + expect( + Color.alphaBlend(const Color(0x80FFFFFF), const Color(0xFF000000)), + const Color(0xFF808080), + ); + expect( + Color.alphaBlend(const Color(0x80808080), const Color(0xFFFFFFFF)), + const Color(0xFFBFBFBF), + ); + expect( + Color.alphaBlend(const Color(0x80808080), const Color(0xFF000000)), + const Color(0xFF404040), + ); + expect( + Color.alphaBlend(const Color(0x01020304), const Color(0xFF000000)), + const Color(0xFF000000), + ); + expect( + Color.alphaBlend(const Color(0x11223344), const Color(0xFF000000)), + const Color(0xFF020304), + ); + expect( + Color.alphaBlend(const Color(0x11223344), const Color(0x80000000)), + const Color(0x88040608), + ); + }); + test('compute gray luminance', () { // Each color component is at 20%. final Color lightGray = const Color(0xFF333333); From 918d87f0f144439825d45850f5882095afc098a3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 30 Apr 2018 18:27:21 -0400 Subject: [PATCH 0215/1190] Roll src/third_party/skia/ 44a8c74e3..0ce19fa0b (6 commits; 1 trivial rolls) (#5135) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 8cebddb9d99ee..97480c374f509 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '44a8c74e3554abf8ad8726312ceecfbce2cddb7a', + 'skia_revision': '0ce19fa0b19ddef781d01c03a329a41fdb934a8e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 842828f84db00..a6275960c362d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 316af4c9992c358f8828e78e0ad2855e +Signature: 0646f938b5c4b587224930f8d79b0dbb UNUSED LICENSES: From 33aaf6fc2f9185aff37683ceaa5c66ec4ea9f916 Mon Sep 17 00:00:00 2001 From: Victor Choueiri Date: Tue, 1 May 2018 01:58:53 +0300 Subject: [PATCH 0216/1190] Enable sweep gradients (#4950) * Enable sweep gradients * Use _matrix4IsValid * Add assert for startAngle < endAngle * Use radians for startAngle and endAngle * Update AUTHORS * Better assert on matrix4IsValid --- AUTHORS | 1 + lib/ui/painting.dart | 57 ++++++++++++++++++++++++++++++++++--- lib/ui/painting/gradient.cc | 30 ++++++++++++++++++- lib/ui/painting/gradient.h | 9 ++++++ 4 files changed, 92 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index 5fdf752a2e376..cfae1d6367c4e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,3 +8,4 @@ Jim Simon Ali Bitek Jacob Greenfield Dan Field +Victor Choueiri diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 83e7a859474c3..50b49647b1e9f 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2231,8 +2231,8 @@ Float32List _encodeTwoPoints(Offset pointA, Offset pointB) { /// A shader (as used by [Paint.shader]) that renders a color gradient. /// -/// There are two useful types of gradients, created by [new Gradient.linear] -/// and [new Gradient.radial]. +/// There are several types of gradients, represented by the various constructors +/// on this class. class Gradient extends Shader { void _constructor() native 'Gradient_constructor'; @@ -2306,9 +2306,8 @@ class Gradient extends Shader { ]) : assert(_offsetIsValid(center)), assert(colors != null), assert(tileMode != null), + assert(matrix4 == null || _matrix4IsValid(matrix4)), super._() { - if (matrix4 != null && matrix4.length != 16) - throw new ArgumentError('"matrix4" must have 16 entries.'); _validateColorStops(colors, colorStops); final Int32List colorsBuffer = _encodeColorList(colors); final Float32List colorStopsBuffer = colorStops == null ? null : new Float32List.fromList(colorStops); @@ -2317,6 +2316,56 @@ class Gradient extends Shader { } void _initRadial(double centerX, double centerY, double radius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initRadial'; + /// Creates a sweep gradient centered at `center` that starts at `startAngle` + /// and ends at `endAngle`. + /// + /// `startAngle` and `endAngle` should be provided in radians, with zero + /// radians being the horizontal line to the right of the `center` and with + /// positive angles going clockwise around the `center`. + /// + /// If `colorStops` is provided, `colorStops[i]` is a number from 0.0 to 1.0 + /// that specifies where `color[i]` begins in the gradient. If `colorStops` is + /// not provided, then only two stops, at 0.0 and 1.0, are implied (and + /// `color` must therefore only have two entries). + /// + /// The behavior before `startAngle` and after `endAngle` is described by the + /// `tileMode` argument. For details, see the [TileMode] enum. + /// + /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_clamp_sweep.png) + /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_sweep.png) + /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_sweep.png) + /// + /// If `center`, `colors`, `tileMode`, `startAngle`, or `endAngle` are null, + /// or if `colors` or `colorStops` contain null values, this constructor will + /// throw a [NoSuchMethodError]. + /// + /// If `matrix4` is provided, the gradient fill will be transformed by the + /// specified 4x4 matrix relative to the local coordinate system. `matrix4` must + /// be a column-major matrix packed into a list of 16 values. + Gradient.sweep( + Offset center, + List colors, [ + List colorStops, + TileMode tileMode = TileMode.clamp, + double startAngle = 0.0, + double endAngle = math.pi * 2, + Float64List matrix4, + ]) : assert(_offsetIsValid(center)), + assert(colors != null), + assert(tileMode != null), + assert(startAngle != null), + assert(endAngle != null), + assert(startAngle < endAngle), + assert(matrix4 == null || _matrix4IsValid(matrix4)), + super._() { + _validateColorStops(colors, colorStops); + final Int32List colorsBuffer = _encodeColorList(colors); + final Float32List colorStopsBuffer = colorStops == null ? null : new Float32List.fromList(colorStops); + _constructor(); + _initSweep(center.dx, center.dy, colorsBuffer, colorStopsBuffer, tileMode.index, startAngle, endAngle, matrix4); + } + void _initSweep(double centerX, double centerY, Int32List colors, Float32List colorStops, int tileMode, double startAngle, double endAngle, Float64List matrix) native 'Gradient_initSweep'; + static void _validateColorStops(List colors, List colorStops) { if (colorStops == null) { if (colors.length != 2) diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 52ccd63f3f5d3..702bed34280ac 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -22,7 +22,8 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Gradient); #define FOR_EACH_BINDING(V) \ V(Gradient, initLinear) \ - V(Gradient, initRadial) + V(Gradient, initRadial) \ + V(Gradient, initSweep) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -79,6 +80,33 @@ void CanvasGradient::initRadial(double center_x, colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr))); } +void CanvasGradient::initSweep(double center_x, + double center_y, + const tonic::Int32List& colors, + const tonic::Float32List& color_stops, + SkShader::TileMode tile_mode, + double start_angle, + double end_angle, + const tonic::Float64List& matrix4) { + FXL_DCHECK(colors.num_elements() == color_stops.num_elements() || + color_stops.data() == nullptr); + + static_assert(sizeof(SkColor) == sizeof(int32_t), + "SkColor doesn't use int32_t."); + + SkMatrix sk_matrix; + bool has_matrix = matrix4.data() != nullptr; + if (has_matrix) { + sk_matrix = ToSkMatrix(matrix4); + } + + set_shader(SkGradientShader::MakeSweep( + center_x, center_y, reinterpret_cast(colors.data()), + color_stops.data(), colors.num_elements(), tile_mode, + start_angle * 180.0 / M_PI, end_angle * 180.0 / M_PI, 0, + has_matrix ? &sk_matrix : nullptr)); +} + CanvasGradient::CanvasGradient() = default; CanvasGradient::~CanvasGradient() = default; diff --git a/lib/ui/painting/gradient.h b/lib/ui/painting/gradient.h index 5f0580b178648..178c17fe9b41c 100644 --- a/lib/ui/painting/gradient.h +++ b/lib/ui/painting/gradient.h @@ -43,6 +43,15 @@ class CanvasGradient : public Shader { SkShader::TileMode tile_mode, const tonic::Float64List& matrix4); + void initSweep(double center_x, + double center_y, + const tonic::Int32List& colors, + const tonic::Float32List& color_stops, + SkShader::TileMode tile_mode, + double start_angle, + double end_angle, + const tonic::Float64List& matrix4); + static void RegisterNatives(tonic::DartLibraryNatives* natives); private: From 110bce4fde39db26e8bbed587db35e8e19181bd8 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 30 Apr 2018 17:06:59 -0700 Subject: [PATCH 0217/1190] Use the GPU object constructor to create a gradient shader. (#5136) Fixes build break introduced in 33aaf6fc2f9185aff37683ceaa5c66ec4ea9f916. --- lib/ui/painting/gradient.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 702bed34280ac..95694ab516fd0 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -100,11 +100,11 @@ void CanvasGradient::initSweep(double center_x, sk_matrix = ToSkMatrix(matrix4); } - set_shader(SkGradientShader::MakeSweep( + set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeSweep( center_x, center_y, reinterpret_cast(colors.data()), color_stops.data(), colors.num_elements(), tile_mode, start_angle * 180.0 / M_PI, end_angle * 180.0 / M_PI, 0, - has_matrix ? &sk_matrix : nullptr)); + has_matrix ? &sk_matrix : nullptr))); } CanvasGradient::CanvasGradient() = default; From d48ba4c0349109c3b5c62e77cfe2d26e794aabcb Mon Sep 17 00:00:00 2001 From: xster Date: Mon, 30 Apr 2018 17:18:33 -0700 Subject: [PATCH 0218/1190] Increase the GPU thread priority and add error logging (#5117) --- .../platform/android/android_shell_holder.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index 5ef505e77adfa..1fe0854296c33 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -84,9 +84,24 @@ AndroidShellHolder::AndroidShellHolder( if (is_valid_) { task_runners.GetGPUTaskRunner()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -2); }); + []() { + // Android describes -8 as "most important display threads, for + // compositing the screen and retrieving input events". Conservatively + // set the GPU thread to slightly lower priority than it. + if (::setpriority(PRIO_PROCESS, gettid(), -5) != 0) { + // Defensive fallback. Depending on the OEM, it may not be possible + // to set priority to -5. + if (::setpriority(PRIO_PROCESS, gettid(), -2) != 0) { + FXL_LOG(ERROR) << "Failed to set GPU task runner priority"; + } + } + }); task_runners.GetUITaskRunner()->PostTask( - []() { ::setpriority(PRIO_PROCESS, gettid(), -1); }); + []() { + if (::setpriority(PRIO_PROCESS, gettid(), -1) != 0) { + FXL_LOG(ERROR) << "Failed to set UI task runner priority"; + } + }); } } From 89a8dffcb79275577f5564f31ceb9fc31e9feaa2 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 30 Apr 2018 21:56:21 -0400 Subject: [PATCH 0219/1190] Roll src/third_party/skia/ 0ce19fa0b..d5750b6b3 (3 commits; 1 trivial rolls) (#5138) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 97480c374f509..5a4c43dde8109 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0ce19fa0b19ddef781d01c03a329a41fdb934a8e', + 'skia_revision': 'd5750b6b33bfe9c6ced5a98d2782099ff620b07a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a6275960c362d..c1817186258e7 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0646f938b5c4b587224930f8d79b0dbb +Signature: c7b9097370b310ec29cdf041f059774d UNUSED LICENSES: From a8594324d465d874c591bb7626cbd24019001d58 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 30 Apr 2018 21:48:38 -0700 Subject: [PATCH 0220/1190] Roll buildroot to a69ebc4e1. (#5139) --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 5a4c43dde8109..16a15bd7f1ae5 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '66676c9960264c96d1b424264a5966f8e2b40153', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'a69ebc4e14e4dd7259ffdeaf6b161e3dfe2a3de9', # Fuchsia compatibility # From fb51bf280defbdd5595d0ba5e4f5a2cddee4d4b4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 1 May 2018 01:27:22 -0400 Subject: [PATCH 0221/1190] Roll src/third_party/skia/ d5750b6b3..c353ee211 (1 commit) (#5140) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 16a15bd7f1ae5..160a453193fa4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd5750b6b33bfe9c6ced5a98d2782099ff620b07a', + 'skia_revision': 'c353ee211fc99c0bf2035f9e77f87fd67b3c19c5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c1817186258e7..24455b2090c36 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c7b9097370b310ec29cdf041f059774d +Signature: 3f7527afde9ab6373c25970232933e88 UNUSED LICENSES: From f9165befd2de730f858bf127cb171a4ca959354f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 1 May 2018 08:28:44 -0400 Subject: [PATCH 0222/1190] Roll src/third_party/skia/ c353ee211..4912d903b (1 commit) (#5141) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 160a453193fa4..1ffd5da90fc91 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c353ee211fc99c0bf2035f9e77f87fd67b3c19c5', + 'skia_revision': '4912d903b9bf32b6b929c2291a0384b634ca3473', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 24455b2090c36..010dcceef5397 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3f7527afde9ab6373c25970232933e88 +Signature: 7526f0e4696c7a824c1b985317d9f69f UNUSED LICENSES: From 6f15a915c62ca1b07316e0bda35c823c0a3e2562 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 1 May 2018 11:58:44 -0400 Subject: [PATCH 0223/1190] Roll src/third_party/skia/ 4912d903b..dc3192b30 (7 commits) (#5142) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1ffd5da90fc91..b12a4d8769fe6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4912d903b9bf32b6b929c2291a0384b634ca3473', + 'skia_revision': 'dc3192b30a9e42aea8ff8d0c01ea585c79902704', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 010dcceef5397..ef881b57da08e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7526f0e4696c7a824c1b985317d9f69f +Signature: c1ceba4b426874919ff0d08583bd74a1 UNUSED LICENSES: @@ -17183,6 +17183,8 @@ FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGGeometryTransform FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGGeometryTransform.h FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPlane.cpp FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPlane.h +FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGRoundEffect.cpp +FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGRoundEffect.h FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGText.cpp FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGText.h FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.cpp From 2812ea3ed304eac01d89fe456cd5d45f658ce11c Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Tue, 1 May 2018 09:30:30 -0700 Subject: [PATCH 0224/1190] Define Uri.base as CWD to match the standalone Dart VM. (#5137) Bug: https://github.com/flutter/flutter/issues/17118 --- lib/ui/dart_runtime_hooks.cc | 6 +++--- lib/ui/natives.dart | 4 ---- runtime/dart_vm_entry_points.txt | 3 +-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index b1e64bcc0d13c..5041b87c164bc 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -88,9 +88,9 @@ static void InitDartInternal(Dart_Handle builtin_library, bool is_ui_isolate) { } static void InitDartCore(Dart_Handle builtin, const std::string& script_uri) { - DART_CHECK_VALID( - Dart_SetField(builtin, ToDart("_baseURL"), ToDart(script_uri))); - Dart_Handle get_base_url = GetClosure(builtin, "_getGetBaseURLClosure"); + Dart_Handle io_lib = Dart_LookupLibrary(ToDart("dart:io")); + Dart_Handle get_base_url = + Dart_Invoke(io_lib, ToDart("_getUriBaseClosure"), 0, NULL); Dart_Handle core_library = Dart_LookupLibrary(ToDart("dart:core")); DART_CHECK_VALID( Dart_SetField(core_library, ToDart("_uriBaseClosure"), get_base_url)); diff --git a/lib/ui/natives.dart b/lib/ui/natives.dart index 380a44d1d031e..b5123099ae392 100644 --- a/lib/ui/natives.dart +++ b/lib/ui/natives.dart @@ -37,15 +37,11 @@ void _setupHooks() { void _scheduleMicrotask(void callback()) native 'ScheduleMicrotask'; -String _baseURL; -Uri _getBaseURL() => Uri.parse(_baseURL); - // Required for gen_snapshot to work correctly. int _isolateId; Function _getPrintClosure() => _print; Function _getScheduleMicrotaskClosure() => _scheduleMicrotask; -Function _getGetBaseURLClosure() => _getBaseURL; // Though the "main" symbol is not included in any of the libraries imported // above, the builtin library will be included manually during VM setup. This diff --git a/runtime/dart_vm_entry_points.txt b/runtime/dart_vm_entry_points.txt index edfae90cf134f..008272e3f37e1 100644 --- a/runtime/dart_vm_entry_points.txt +++ b/runtime/dart_vm_entry_points.txt @@ -1,5 +1,6 @@ dart:_internal,::,_printClosure dart:async,::,_setScheduleImmediateClosure +dart:io,::,_getUriBaseClosure dart:io,::,_setupHooks dart:io,_Platform,_localeClosure dart:io,_Platform,set:_nativeScript @@ -11,8 +12,6 @@ dart:ui,::,_dispatchPlatformMessage dart:ui,::,_dispatchPointerDataPacket dart:ui,::,_dispatchSemanticsAction dart:ui,::,_drawFrame -dart:ui,::,_getGetBaseURLClosure -dart:ui,::,_baseURL dart:ui,::,_getLocaleClosure dart:ui,::,_getMainClosure dart:ui,::,_getPrintClosure From a58eabf14cea22298f0e18bcfa96f7772d914d03 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 1 May 2018 15:28:45 -0400 Subject: [PATCH 0225/1190] Roll src/third_party/skia/ dc3192b30..91368c9b9 (12 commits; 1 trivial rolls) (#5144) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b12a4d8769fe6..e8de64353ec50 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'dc3192b30a9e42aea8ff8d0c01ea585c79902704', + 'skia_revision': '91368c9b9b0c3071babb3352646f9795e0b828fd', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ef881b57da08e..b06ba0389b276 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c1ceba4b426874919ff0d08583bd74a1 +Signature: bfac9a8729a57762b4763a2562020f52 UNUSED LICENSES: From beb988c60d7de160700ef302b4d712d07fd30881 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 1 May 2018 18:58:45 -0400 Subject: [PATCH 0226/1190] Roll src/third_party/skia/ 91368c9b9..c86c5c014 (4 commits) (#5145) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index e8de64353ec50..521de2c5e6529 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '91368c9b9b0c3071babb3352646f9795e0b828fd', + 'skia_revision': 'c86c5c0144b85d0bc8ec791f9609ee2d4e7d835a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b06ba0389b276..4eed6018da2a8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: bfac9a8729a57762b4763a2562020f52 +Signature: d817d994a56938d75e1cb5ace14dc096 UNUSED LICENSES: @@ -20071,7 +20071,6 @@ FILE: ../../../third_party/skia/src/core/SkAlphaRuns.cpp FILE: ../../../third_party/skia/src/core/SkAnalyticEdge.cpp FILE: ../../../third_party/skia/src/core/SkAnalyticEdge.h FILE: ../../../third_party/skia/src/core/SkAntiRun.h -FILE: ../../../third_party/skia/src/core/SkAutoKern.h FILE: ../../../third_party/skia/src/core/SkBlitBWMaskTemplate.h FILE: ../../../third_party/skia/src/core/SkBlitter.cpp FILE: ../../../third_party/skia/src/core/SkBlitter.h From d5c1117170c1ecf1c31f11cd2edf20a06fcc6fa2 Mon Sep 17 00:00:00 2001 From: Yegor Date: Tue, 1 May 2018 17:45:38 -0700 Subject: [PATCH 0227/1190] Roll dart to 011676641a8b4b77bb372384c712709cbf037675 (#5146) * Roll Dart to 011676641a8b4b77bb372384c712709cbf037675. Reverts b6be9377c58c488afea042a1b0ed8910b158c319 and uses Dart_NewExternalTypedDataWithFinalizer. * update license goldens --- DEPS | 2 +- lib/ui/window.dart | 12 ++++-------- lib/ui/window/platform_message_response_dart.cc | 9 ++++----- lib/ui/window/window.cc | 12 ++---------- lib/ui/window/window.h | 3 --- tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 7 files changed, 13 insertions(+), 29 deletions(-) diff --git a/DEPS b/DEPS index 521de2c5e6529..140953d9fc463 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '0cc70c4a7c448078dd2aea8e45c56bc50fbbb31c', + 'dart_revision': '011676641a8b4b77bb372384c712709cbf037675', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/lib/ui/window.dart b/lib/ui/window.dart index 2228b1f42b6ce..e84cb267940d8 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -22,10 +22,6 @@ typedef void SemanticsActionCallback(int id, SemanticsAction action, ByteData ar /// [Window.onPlatformMessage]. typedef void PlatformMessageResponseCallback(ByteData data); -// The engine returns message responses as a Uint8List which is then wrapped -// in a ByteData. -typedef void _InternalPlatformMessageResponseCallback(Uint8List data); - /// Signature for [Window.onPlatformMessage]. typedef void PlatformMessageCallback(String name, ByteData data, PlatformMessageResponseCallback callback); @@ -691,7 +687,7 @@ class Window { throw new Exception(error); } String _sendPlatformMessage(String name, - _InternalPlatformMessageResponseCallback callback, + PlatformMessageResponseCallback callback, ByteData data) native 'Window_sendPlatformMessage'; /// Called whenever this window receives a message from a platform-specific @@ -721,15 +717,15 @@ class Window { /// Wraps the given [callback] in another callback that ensures that the /// original callback is called in the zone it was registered in. - static _InternalPlatformMessageResponseCallback _zonedPlatformMessageResponseCallback(PlatformMessageResponseCallback callback) { + static PlatformMessageResponseCallback _zonedPlatformMessageResponseCallback(PlatformMessageResponseCallback callback) { if (callback == null) return null; // Store the zone in which the callback is being registered. final Zone registrationZone = Zone.current; - return (Uint8List data) { - registrationZone.runUnaryGuarded(callback, data?.buffer?.asByteData()); + return (ByteData data) { + registrationZone.runUnaryGuarded(callback, data); }; } } diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index ce29e3dd67ec7..5d6af0ab87b83 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -28,14 +28,13 @@ void MessageDataFinalizer(void* isolate_callback_data, Dart_Handle WrapByteData(std::vector data) { if (data.size() < kMessageCopyThreshold) { - return ToTypedData(Dart_TypedData_kUint8, data); + return ToByteData(data); } else { std::vector* heap_data = new std::vector(std::move(data)); - Dart_Handle data_handle = Dart_NewExternalTypedData( - Dart_TypedData_kUint8, heap_data->data(), heap_data->size()); + Dart_Handle data_handle = Dart_NewExternalTypedDataWithFinalizer( + Dart_TypedData_kByteData, heap_data->data(), heap_data->size(), + heap_data, heap_data->size(), MessageDataFinalizer); DART_CHECK_VALID(data_handle); - Dart_NewWeakPersistentHandle(data_handle, heap_data, heap_data->size(), - MessageDataFinalizer); return data_handle; } } diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 129c57c00a24a..2d5d7a1569b8f 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -112,16 +112,8 @@ void _RespondToPlatformMessage(Dart_NativeArguments args) { } // namespace Dart_Handle ToByteData(const std::vector& buffer) { - return ToTypedData(Dart_TypedData_kByteData, buffer); -} - -Dart_Handle ToTypedData(Dart_TypedData_Type data_type, - const std::vector& buffer) { - FXL_DCHECK(data_type == Dart_TypedData_kByteData || - data_type == Dart_TypedData_kInt8 || - data_type == Dart_TypedData_kUint8); - - Dart_Handle data_handle = Dart_NewTypedData(data_type, buffer.size()); + Dart_Handle data_handle = + Dart_NewTypedData(Dart_TypedData_kByteData, buffer.size()); if (Dart_IsError(data_handle)) return data_handle; diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index 54e1694746b5d..2feeccb65f9cc 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -24,9 +24,6 @@ class Scene; Dart_Handle ToByteData(const std::vector& buffer); -Dart_Handle ToTypedData(Dart_TypedData_Type data_type, - const std::vector& buffer); - class WindowClient { public: virtual std::string DefaultRouteName() = 0; diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 8ddf5c5bc1fed..44dfbcc4a9821 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-edge.c080951d45e79cd25df98036c4be835b284a269c" + dart: ">=1.21.0 <=2.0.0-dev.50.0" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4eed6018da2a8..cb51ee4801138 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d817d994a56938d75e1cb5ace14dc096 +Signature: 9c979e243a76318a53f18a79498ab23f UNUSED LICENSES: From 4ec4b3870d0470441c05f0dda17c2df5e5b9a86b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 1 May 2018 22:29:21 -0400 Subject: [PATCH 0228/1190] Roll src/third_party/skia/ c86c5c014..ef4142a9b (2 commits) (#5147) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 140953d9fc463..6332e45518019 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c86c5c0144b85d0bc8ec791f9609ee2d4e7d835a', + 'skia_revision': 'ef4142a9bc5fb5fe3158139e18f41e7da867ff93', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index cb51ee4801138..8bc869d13c683 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9c979e243a76318a53f18a79498ab23f +Signature: 287153d173d49963acf94e1fae59275f UNUSED LICENSES: From 5da1716347e3674875bda3905cecc276381f23af Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 2 May 2018 05:53:22 -0400 Subject: [PATCH 0229/1190] Roll src/third_party/skia/ ef4142a9b..3fef39d94 (1 commit) (#5148) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 6332e45518019..42e587d4ef9c1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ef4142a9bc5fb5fe3158139e18f41e7da867ff93', + 'skia_revision': '3fef39d94d2a81e44289721dc332b6475de60d7f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8bc869d13c683..6e9c359ad8039 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 287153d173d49963acf94e1fae59275f +Signature: 3ff3574a46b0a2e8177066e00e721655 UNUSED LICENSES: From 0667cba310bc9c5c4196f2b8d39302bf77107906 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 2 May 2018 09:23:22 -0400 Subject: [PATCH 0230/1190] Roll src/third_party/skia/ 3fef39d94..2050565fe (2 commits) (#5150) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 42e587d4ef9c1..dfb06433f1eca 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3fef39d94d2a81e44289721dc332b6475de60d7f', + 'skia_revision': '2050565fe116008ad6df7533900f5f76dd5b9730', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 6e9c359ad8039..32cf146ba1225 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3ff3574a46b0a2e8177066e00e721655 +Signature: 0ab86d81405bfde58caf435e6851669d UNUSED LICENSES: From 77910baad422b68dd0681c668cf6024cb30c6a87 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 2 May 2018 12:59:22 -0400 Subject: [PATCH 0231/1190] Roll src/third_party/skia/ 2050565fe..f9ab22385 (11 commits) (#5151) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index dfb06433f1eca..e77a90299d63f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2050565fe116008ad6df7533900f5f76dd5b9730', + 'skia_revision': 'f9ab22385ead43ed921b41b9ed31c4032b75e698', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 32cf146ba1225..65c0e3c1b3e3d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0ab86d81405bfde58caf435e6851669d +Signature: afeb816b5770a41d4889e05efa7111e3 UNUSED LICENSES: From 8896bd35abd3d22e14432cede4163511e7060a27 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 2 May 2018 16:30:22 -0400 Subject: [PATCH 0232/1190] Roll src/third_party/skia/ f9ab22385..97b48a9c7 (11 commits; 1 trivial rolls) (#5154) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e77a90299d63f..357bcc43849f2 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f9ab22385ead43ed921b41b9ed31c4032b75e698', + 'skia_revision': '97b48a9c7cbf2e8a5f1faf081084ddf706b88ac1', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 65c0e3c1b3e3d..304122ba670ea 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: afeb816b5770a41d4889e05efa7111e3 +Signature: 99ec19b8cae7be2caa02f55c60f0094f UNUSED LICENSES: From 9b7cc44df1e8c87edc37b0380a8169595205d8da Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 2 May 2018 16:37:48 -0700 Subject: [PATCH 0233/1190] Dart bindings own the FDIO namespace. Release the engine side reference to the handle after bindings are setup. (#5156) --- content_handler/application.cc | 6 +++--- content_handler/engine.cc | 4 ++-- content_handler/engine.h | 2 +- content_handler/isolate_configurator.cc | 8 ++++++-- content_handler/isolate_configurator.h | 4 ++-- content_handler/main.cc | 4 ++-- content_handler/platform_view.cc | 2 +- content_handler/vulkan_surface_producer.cc | 2 +- 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/content_handler/application.cc b/content_handler/application.cc index 2db01b31421cb..cddd6b4b8a950 100644 --- a/content_handler/application.cc +++ b/content_handler/application.cc @@ -41,7 +41,7 @@ Application::Create( return {std::move(thread), std::move(application)}; } -static std::string DebugLabelForURL(const std::string url) { +static std::string DebugLabelForURL(const std::string& url) { auto found = url.rfind("/"); if (found == std::string::npos) { return url; @@ -302,14 +302,14 @@ void Application::CreateView( // This method may be called multiple times. Care must be taken to ensure that // all arguments can be accessed or synthesized multiple times. // TODO(chinmaygarde): Figure out how to re-create the outgoing service - // request handle. + // request handle and the FDIO namespace. shell_holders_.emplace(std::make_unique( *this, // delegate debug_label_, // thread label *application_context_, // application context settings_, // settings std::move(view_owner), // view owner - fdio_ns_, // FDIO namespace + std::move(fdio_ns_), // FDIO namespace std::move(outgoing_services_request_) // outgoing request )); } diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 1d2b0869cb8ee..a289177eec740 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -39,7 +39,7 @@ Engine::Engine(Delegate& delegate, component::ApplicationContext& application_context, blink::Settings settings, fidl::InterfaceRequest view_owner, - const UniqueFDIONS& fdio_ns, + UniqueFDIONS fdio_ns, fidl::InterfaceRequest outgoing_services_request) : delegate_(delegate), @@ -182,7 +182,7 @@ Engine::Engine(Delegate& delegate, application_context.ConnectToEnvironmentService( application_environment.NewRequest()); isolate_configurator_ = std::make_unique( - fdio_ns, // + std::move(fdio_ns), // std::move(view_container), // std::move(application_environment), // std::move(outgoing_services_request) // diff --git a/content_handler/engine.h b/content_handler/engine.h index d0442dca30cca..6e26a70e01f5c 100644 --- a/content_handler/engine.h +++ b/content_handler/engine.h @@ -30,7 +30,7 @@ class Engine final { component::ApplicationContext& application_context, blink::Settings settings, fidl::InterfaceRequest view_owner, - const UniqueFDIONS& fdio_ns, + UniqueFDIONS fdio_ns, fidl::InterfaceRequest outgoing_services_request); diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc index 30de7fad85459..9adc4569f7fba 100644 --- a/content_handler/isolate_configurator.cc +++ b/content_handler/isolate_configurator.cc @@ -15,13 +15,13 @@ namespace flutter { IsolateConfigurator::IsolateConfigurator( - const UniqueFDIONS& fdio_ns, + UniqueFDIONS fdio_ns, fidl::InterfaceHandle view_container, fidl::InterfaceHandle application_environment, fidl::InterfaceRequest outgoing_services_request) - : fdio_ns_(fdio_ns), + : fdio_ns_(std::move(fdio_ns)), view_container_(std::move(view_container)), application_environment_(std::move(application_environment)), outgoing_services_request_(std::move(outgoing_services_request)) {} @@ -39,6 +39,10 @@ bool IsolateConfigurator::ConfigureCurrentIsolate() { BindDartIO(); BindScenic(); + // This is now owned by the Dart bindings. So relinquish our ownership of the + // handle. + (void)fdio_ns_.release(); + return true; } diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h index b472448d57a72..c66c2351ca49c 100644 --- a/content_handler/isolate_configurator.h +++ b/content_handler/isolate_configurator.h @@ -20,7 +20,7 @@ namespace flutter { class IsolateConfigurator final : mozart::NativesDelegate { public: IsolateConfigurator( - const UniqueFDIONS& fdio_ns, + UniqueFDIONS fdio_ns, fidl::InterfaceHandle view_container, fidl::InterfaceHandle application_environment, @@ -35,7 +35,7 @@ class IsolateConfigurator final : mozart::NativesDelegate { private: bool used_ = false; - const UniqueFDIONS& fdio_ns_; + UniqueFDIONS fdio_ns_; fidl::InterfaceHandle view_container_; fidl::InterfaceHandle application_environment_; diff --git a/content_handler/main.cc b/content_handler/main.cc index 15b8cede5b9b2..b5fd671a3b35b 100644 --- a/content_handler/main.cc +++ b/content_handler/main.cc @@ -14,10 +14,10 @@ int main(int argc, char const* argv[]) { trace::TraceProvider provider(loop.async()); FXL_DCHECK(provider.is_valid()) << "Trace provider must be valid."; - FXL_LOG(INFO) << "Flutter application services initialized."; + FXL_DLOG(INFO) << "Flutter application services initialized."; flutter::ApplicationRunner runner([&loop]() { loop.PostQuitTask(); - FXL_LOG(INFO) << "Flutter application services terminated. Good bye..."; + FXL_DLOG(INFO) << "Flutter application services terminated. Good bye..."; }); loop.Run(); diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc index 720aa5f3d5c79..9ad2f292fb16d 100644 --- a/content_handler/platform_view.cc +++ b/content_handler/platform_view.cc @@ -24,7 +24,7 @@ template void SetInterfaceErrorHandler(fidl::InterfacePtr& interface, std::string name) { interface.set_error_handler( - [name]() { FXL_DLOG(ERROR) << "Interface error on: " << name; }); + [name]() { FXL_LOG(ERROR) << "Interface error on: " << name; }); } PlatformView::PlatformView( diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc index d6bdfe372a776..5c04a704e5b95 100644 --- a/content_handler/vulkan_surface_producer.cc +++ b/content_handler/vulkan_surface_producer.cc @@ -21,7 +21,7 @@ VulkanSurfaceProducer::VulkanSurfaceProducer( valid_ = Initialize(mozart_session); if (valid_) { - FXL_LOG(INFO) + FXL_DLOG(INFO) << "Flutter engine: Vulkan surface producer initialization: Successful"; } else { FXL_LOG(ERROR) From 862d13c6f15b3bc43d78e75261be7ff67157e903 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 2 May 2018 20:03:22 -0400 Subject: [PATCH 0234/1190] Roll src/third_party/skia/ 97b48a9c7..0caef298c (6 commits) (#5158) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 357bcc43849f2..5ab1ef68378a7 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '97b48a9c7cbf2e8a5f1faf081084ddf706b88ac1', + 'skia_revision': '0caef298c2ff935b622673e09cd542151dc2ecc0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 304122ba670ea..f57f2fbce4f33 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 99ec19b8cae7be2caa02f55c60f0094f +Signature: 759192b81fc370d3de4de0d021329916 UNUSED LICENSES: From 93b85ee68a7d0f5b58980b4150f07587b723336a Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 2 May 2018 17:24:29 -0700 Subject: [PATCH 0235/1190] Add Android accessibility bridge support for "longPress" and "tap" semantic events --- .../io/flutter/view/AccessibilityBridge.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index b17e6d9e47889..f88b0c31c1153 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -281,10 +281,6 @@ public boolean performAction(int virtualViewId, int action, Bundle arguments) { mOwner.dispatchSemanticsAction(virtualViewId, Action.TAP); return true; } - case AccessibilityNodeInfo.ACTION_LONG_CLICK: { - mOwner.dispatchSemanticsAction(virtualViewId, Action.LONG_PRESS); - return true; - } case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD: { if (object.hasAction(Action.SCROLL_UP)) { mOwner.dispatchSemanticsAction(virtualViewId, Action.SCROLL_UP); @@ -563,13 +559,6 @@ void updateSemantics(ByteBuffer buffer, String[] strings) { } sendAccessibilityEvent(event); } - if (mA11yFocusedObject != null && mA11yFocusedObject.id == object.id - && object.hadFlag(Flag.HAS_CHECKED_STATE) - && object.hasFlag(Flag.HAS_CHECKED_STATE) - && object.hadFlag(Flag.IS_CHECKED) != object.hasFlag(Flag.IS_CHECKED)) { - // Simulate a click so TalkBack announces the change in checked state. - sendAccessibilityEvent(object.id, AccessibilityEvent.TYPE_VIEW_CLICKED); - } if (mA11yFocusedObject != null && mA11yFocusedObject.id == object.id && !object.hadFlag(Flag.IS_SELECTED) && object.hasFlag(Flag.IS_SELECTED)) { AccessibilityEvent event = @@ -671,6 +660,22 @@ public void onMessage(Object message, BasicMessageChannel.Reply reply) { case "announce": mOwner.announceForAccessibility((String) data.get("message")); break; + case "longPress": { + Integer nodeId = (Integer) annotatedEvent.get("nodeId"); + if (nodeId == null) { + return; + } + sendAccessibilityEvent(nodeId, AccessibilityEvent.TYPE_VIEW_LONG_CLICKED); + break; + } + case "tap": { + Integer nodeId = (Integer) annotatedEvent.get("nodeId"); + if (nodeId == null) { + return; + } + sendAccessibilityEvent(nodeId, AccessibilityEvent.TYPE_VIEW_CLICKED); + break; + } case "tooltip": { AccessibilityEvent e = obtainAccessibilityEvent(ROOT_NODE_ID, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); e.getText().add((String) data.get("message")); From f5c7cb366a79ceb73d0901157bd572fb01287faa Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Wed, 2 May 2018 18:42:14 -0700 Subject: [PATCH 0236/1190] Roll dart to b298fc6d8f6a0e1aa841dbbdda26663d6012a79a. (#5155) * Roll dart to b298fc6d8f6a0e1aa841dbbdda26663d6012a79a. Changes since last roll: ``` b298fc6d8f Revert "[kernel] Change dill representation of doubles" 9a7e1f64a2 Revert "Revert "Fix incorrect handling of NSM forwarders and pull all logic into CFE."" cbca4006f8 fix #30907, add library constants for all SDK libraries 61c226b4ea Only create Goma's analyzer on Linux. 24dd9b4176 Revert "Fix incorrect handling of NSM forwarders and pull all logic into CFE." bed71b7776 Migrate and clean up the prefix negative tests. 1fcd896ed9 [VM] Avoid deadlock by allowing us to run kernel isolate from a script snapshot, fixes all dartk-sim* builders 0bc6e7217a Update expression compilation expectations. 9038b8f45f CFE support for compiling individual expressions in a context. 7d5025e814 Fix incorrect handling of NSM forwarders and pull all logic into CFE. e2247e5e00 Put the '@' outside the revision variables. 9381424204 Fix presubmit on Windows. Dart executable is not called .bat 2a8c3515b2 Avoid strong+checked mode: strong mode supersedes checked mode b7698dcbce Update status for Windows 8baa82413b [infra] Remove --no-preview-dart-2 flag from gardening tools 47e9039512 Don't encode strings up front; don't toString uris 4a0ac85cc3 Update co19 status ce7329849d Fix build breakages - use platform independent path specification is test so that it works on windows - skip test for precompiled and dartk builds as the test uses spawnUri which is not supported in these modes ee6351a147 [VM] Set up package config value when invoking the front end for compilation, this should fix issue 32950 "(Isolate.spawnUri() ignores packageConfig argument in Dart 2 mode.' d1286a367e Strong mode update for swarm fd27cc3435 Don't store bytes in the file cache. 73abd61304 Re-land "Clean up the use of deprecated API in the analyzer_plugin package". 607f4f5769 [vm] Get more helpful errors from Dart_SetVMFlags and Dart_MakeIsolateRunnable. f044637c8b [infra] Upgrade checked in SDKs to 2.0.0-dev.52.0 dcf10816aa [infra] Add script that updates checked in SDKs f8bea2a7e6 dart2js: Register inlined native methods for dump info 7fe8659613 dump-info: Use relative paths for library canonicalUri... dcf4886500 [frontend-server] Add verbose option. 5087ffa481 [release] Move DDC sync-async flip to correct section in the release notes fe7056ebaa [release] Update changelog for 2.0.0-dev.52.0 ``` * Pick up another revert to fix https://github.com/flutter/flutter/issues/17214 and few more dart commits landed since: ``` 4c9b712052 Revert "Don't encode strings up front; don't toString uris" a1fbf62742 [build] Place 'extern "C"' before __attribute__, as required by gcc. 258c5172df [vm] Remove dart_mirrors_api.h. 384c55c29e Update dartdoc & dependencies to v0.19.0. ``` * fix licenses --- DEPS | 8 ++++---- runtime/dart_isolate.cc | 5 ++++- runtime/dart_service_isolate.cc | 5 ++--- runtime/dart_vm.cc | 6 +++++- travis/licenses_golden/licenses_third_party | 4 +--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index 5ab1ef68378a7..dfb3033cf2e59 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '011676641a8b4b77bb372384c712709cbf037675', + 'dart_revision': '4c9b71205262699764c5db74e95bc9e702451f4e', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -47,8 +47,8 @@ vars = { 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+2', - 'dart_dart_style_tag': '1.0.11', - 'dart_dartdoc_tag': 'v0.18.1', + 'dart_dart_style_tag': '1.0.12', + 'dart_dartdoc_tag': 'v0.19.0', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', @@ -65,7 +65,7 @@ vars = { 'dart_matcher_tag': '0.12.1+4', 'dart_mime_tag': '0.9.6', 'dart_mockito_tag': 'a92db054fba18bc2d605be7670aee74b7cadc00a', - 'dart_mustache4dart_tag': 'v2.1.0', + 'dart_mustache4dart_tag': 'v2.1.1', 'dart_oauth2_tag': '1.1.0', 'dart_observatory_pub_packages_rev': 'd3a3aebefbd35aa30fe7bbc2889b772b398f7d7f', 'dart_package_config_tag': '1.0.3', diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 63c0a5350a923..2c4a11c92c82a 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -409,7 +409,10 @@ bool DartIsolate::MarkIsolateRunnable() { // There must be no current isolate to mark an isolate as being runnable. Dart_ExitIsolate(); - if (!Dart_IsolateMakeRunnable(isolate())) { + char* error = Dart_IsolateMakeRunnable(isolate()); + if (error) { + FXL_DLOG(ERROR) << error; + ::free(error); // Failed. Restore the isolate. Dart_EnterIsolate(isolate()); return false; diff --git a/runtime/dart_service_isolate.cc b/runtime/dart_service_isolate.cc index 54c0bf9722564..3239e4f437eca 100644 --- a/runtime/dart_service_isolate.cc +++ b/runtime/dart_service_isolate.cc @@ -137,11 +137,10 @@ bool DartServiceIsolate::Startup(std::string server_ip, // Make runnable. Dart_ExitScope(); Dart_ExitIsolate(); - bool retval = Dart_IsolateMakeRunnable(isolate); - if (!retval) { + *error = Dart_IsolateMakeRunnable(isolate); + if (*error) { Dart_EnterIsolate(isolate); Dart_ShutdownIsolate(); - *error = strdup("Invalid isolate state - Unable to make it runnable."); return false; } Dart_EnterIsolate(isolate); diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index fa827ef477f0f..15314d04b45ce 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -383,7 +383,11 @@ DartVM::DartVM(const Settings& settings, for (size_t i = 0; i < settings.dart_flags.size(); i++) args.push_back(settings.dart_flags[i].c_str()); - FXL_CHECK(Dart_SetVMFlags(args.size(), args.data())); + char* flags_error = Dart_SetVMFlags(args.size(), args.data()); + if (flags_error) { + FXL_LOG(FATAL) << "Error while setting Dart VM flags: " << flags_error; + ::free(flags_error); + } DartUI::InitForGlobal(); diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f57f2fbce4f33..f01e67874742d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 759192b81fc370d3de4de0d021329916 +Signature: 0bb9afe000319cd63fc59230bab57873 UNUSED LICENSES: @@ -5663,7 +5663,6 @@ FILE: ../../../third_party/dart/runtime/bin/vmservice/server.dart FILE: ../../../third_party/dart/runtime/bin/vmservice/vmservice_io.dart FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.cc FILE: ../../../third_party/dart/runtime/bin/vmservice_impl.h -FILE: ../../../third_party/dart/runtime/include/dart_mirrors_api.h FILE: ../../../third_party/dart/runtime/include/dart_native_api.h FILE: ../../../third_party/dart/runtime/lib/collection_patch.dart FILE: ../../../third_party/dart/runtime/lib/core_patch.dart @@ -5800,7 +5799,6 @@ FILE: ../../../third_party/dart/runtime/vm/isolate.cc FILE: ../../../third_party/dart/runtime/vm/isolate.h FILE: ../../../third_party/dart/runtime/vm/json_stream.cc FILE: ../../../third_party/dart/runtime/vm/json_stream.h -FILE: ../../../third_party/dart/runtime/vm/mirrors_api_impl.cc FILE: ../../../third_party/dart/runtime/vm/native_api_impl.cc FILE: ../../../third_party/dart/runtime/vm/native_symbol.h FILE: ../../../third_party/dart/runtime/vm/native_symbol_android.cc From 73b835c33035a256c94c37e4be56a0bec3b43c0a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 2 May 2018 23:32:22 -0400 Subject: [PATCH 0237/1190] Roll src/third_party/skia/ 0caef298c..20fa1e94a (1 commit) (#5159) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index dfb3033cf2e59..f718c864ff1a4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0caef298c2ff935b622673e09cd542151dc2ecc0', + 'skia_revision': '20fa1e94a0847e3db1567d468810f61a1b3dafb9', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f01e67874742d..88ed08a70b8f3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0bb9afe000319cd63fc59230bab57873 +Signature: 57bfee000ae8dd1b3e18e0ce5be64a62 UNUSED LICENSES: From ae0d3a553688bcc11fd367faf5675159585990a5 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Wed, 2 May 2018 23:16:22 -0700 Subject: [PATCH 0238/1190] Roll dart to 2765fcf2aecd3841d082fedaeafc00a73a965f8c. (#5160) This picks up revert to NSM handling. Changes since last roll: ``` 2765fcf2ae Revert "Revert "Revert "Fix incorrect handling of NSM forwarders and pull all logic into CFE.""" c129fde29a [frontend-server] Add a test for dep-file generation. f64ba0cadd Add @isTest and @isTestGroup to package:meta 3fcb85a545 Update passing test in status file. 05a7b6e05f Add some status entries for crashing tests related to issue https://github.com/dart-lang/sdk/issues/33029 4b1180a39d [VM] When --preview-dart-2 option is specified make the options '--snapshot_kind=script --snapshot=xyz' produce a kernel dill file which is the equivalent of a script snapshot in Dart2 world. 384a59595c Recognize synthetic catch-clause and unhandled exceptions. c448d35ee5 Update prefix test statuses on analyzer. ``` --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f718c864ff1a4..7052613ebb367 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '4c9b71205262699764c5db74e95bc9e702451f4e', + 'dart_revision': '2765fcf2aecd3841d082fedaeafc00a73a965f8c', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 88ed08a70b8f3..54d1a1c1e3cc2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 57bfee000ae8dd1b3e18e0ce5be64a62 +Signature: 2ea54a158c7d339350e9373e9c57bdec UNUSED LICENSES: From 7bbc6d99622071f250c5183e95468c36036915a1 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 3 May 2018 07:53:30 -0400 Subject: [PATCH 0239/1190] Roll src/third_party/skia/ 20fa1e94a..7f1b3157f (1 commit) (#5162) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7052613ebb367..a204fd46b9b18 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '20fa1e94a0847e3db1567d468810f61a1b3dafb9', + 'skia_revision': '7f1b3157f263f041b28c78ffd0c2dffd94afc404', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 54d1a1c1e3cc2..c8de71cf6c52e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2ea54a158c7d339350e9373e9c57bdec +Signature: 9ba133193adab25da28eec4f74f0d543 UNUSED LICENSES: From 26d24824bd3c7eb1d9a6df9df34baddda4444186 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 3 May 2018 11:25:31 -0400 Subject: [PATCH 0240/1190] Roll src/third_party/skia/ 7f1b3157f..2f62de01d (4 commits) (#5163) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a204fd46b9b18..2b26a32a7142f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7f1b3157f263f041b28c78ffd0c2dffd94afc404', + 'skia_revision': '2f62de01d3a703696dc1a51d2473a88be68a7574', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c8de71cf6c52e..ff39316531c42 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9ba133193adab25da28eec4f74f0d543 +Signature: c5c4c77ee1c32958817745c3e3aa2f56 UNUSED LICENSES: From 8a04028ff8c43672e556c1b7db9a65997d01bbe3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 3 May 2018 14:56:52 -0400 Subject: [PATCH 0241/1190] Roll src/third_party/skia/ 2f62de01d..0e6e651a9 (10 commits) (#5164) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2b26a32a7142f..3a739b5438888 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2f62de01d3a703696dc1a51d2473a88be68a7574', + 'skia_revision': '0e6e651a974a9bb879eac83f7b74490f350e1894', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ff39316531c42..b324a79228369 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c5c4c77ee1c32958817745c3e3aa2f56 +Signature: f8b0fa85dcfda661056db3508100fa23 UNUSED LICENSES: From f2db5dfd30f12407acab57f04acc8af7c6158891 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 3 May 2018 13:10:44 -0700 Subject: [PATCH 0242/1190] Enables system chrome customization on Android M/O and greater (#5112) --- .../plugin/platform/PlatformPlugin.java | 71 +++++++++++++++++-- .../framework/Source/FlutterPlatformPlugin.mm | 9 +-- 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index de4208e546142..1bdc187d54250 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java @@ -15,6 +15,8 @@ import android.view.HapticFeedbackConstants; import android.view.SoundEffectConstants; import android.view.View; +import android.view.Window; +import android.util.Log; import io.flutter.plugin.common.ActivityLifecycleListener; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; @@ -30,6 +32,7 @@ */ public class PlatformPlugin implements MethodCallHandler, ActivityLifecycleListener { private final Activity mActivity; + private JSONObject mCurrentTheme; public static final int DEFAULT_SYSTEM_UI = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; private static final String kTextPlainFormat = "text/plain"; @@ -60,7 +63,7 @@ public void onMethodCall(MethodCall call, Result result) { setSystemChromeEnabledSystemUIOverlays((JSONArray) arguments); result.success(null); } else if (method.equals("SystemChrome.setSystemUIOverlayStyle")) { - setSystemChromeSystemUIOverlayStyle((String) arguments); + setSystemChromeSystemUIOverlayStyle((JSONObject) arguments); result.success(null); } else if (method.equals("SystemNavigator.pop")) { popSystemNavigator(); @@ -218,14 +221,70 @@ private void setSystemChromeEnabledSystemUIOverlays(JSONArray overlays) throws J updateSystemUiOverlays(); } - private void updateSystemUiOverlays() { + private void updateSystemUiOverlays(){ mActivity.getWindow().getDecorView().setSystemUiVisibility(mEnabledOverlays); + if (mCurrentTheme != null) { + setSystemChromeSystemUIOverlayStyle(mCurrentTheme); + } } - private void setSystemChromeSystemUIOverlayStyle(String style) { - // You can change the navigation bar color (including translucent colors) - // in Android, but you can't change the color of the navigation buttons, - // so LIGHT vs DARK effectively isn't supported in Android. + private void setSystemChromeSystemUIOverlayStyle(JSONObject message) { + Window window = mActivity.getWindow(); + View view = window.getDecorView(); + int flags = view.getSystemUiVisibility(); + try { + // You can change the navigation bar color (including translucent colors) + // in Android, but you can't change the color of the navigation buttons until Android O. + // LIGHT vs DARK effectively isn't supported until then. + // Build.VERSION_CODES.O + if (Build.VERSION.SDK_INT >= 26) { + if (!message.isNull("systemNavigationBarIconBrightness")) { + String systemNavigationBarIconBrightness = message.getString("systemNavigationBarIconBrightness"); + switch (systemNavigationBarIconBrightness) { + case "Brightness.dark": + //View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR + flags |= 0x10; + break; + case "Brightness.light": + if ((flags & 0x10) == 0x10) { + flags ^= 0x10; + } + break; + } + } + if (!message.isNull("systemNavigationBarColor")) { + window.setNavigationBarColor(message.getInt("systemNavigationBarColor")); + } + } + // Build.VERSION_CODES.M + if (Build.VERSION.SDK_INT >= 23) { + if (!message.isNull("statusBarIconBrightness")) { + String statusBarIconBrightness = message.getString("statusBarIconBrightness"); + switch (statusBarIconBrightness) { + case "Brightness.dark": + // View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR + flags |= 0x2000; + break; + case "Brightness.light": + if ((flags & 0x2000) == 0x2000) { + flags ^= 0x2000; + } + break; + } + } + if (!message.isNull("statusBarColor")) { + window.setStatusBarColor(message.getInt("statusBarColor")); + } + } + if (!message.isNull("systemNavigationBarDividerColor")) { + // Not availible until Android P. + // window.setNavigationBarDividerColor(systemNavigationBarDividerColor); + } + view.setSystemUiVisibility(flags); + mCurrentTheme = message; + } catch (JSONException err) { + Log.i("PlatformPlugin", err.toString()); + } } private void popSystemNavigator() { diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index c312cac28b37b..51df7e1aec983 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -137,11 +137,12 @@ - (void)setSystemChromeEnabledSystemUIOverlays:(NSArray*)overlays { ![overlays containsObject:@"SystemUiOverlay.top"]; } -- (void)setSystemChromeSystemUIOverlayStyle:(NSString*)style { - UIStatusBarStyle statusBarStyle; - if ([style isEqualToString:@"SystemUiOverlayStyle.light"]) +- (void)setSystemChromeSystemUIOverlayStyle:(NSDictionary*)message { + NSString* style = message[@"statusBarBrightness"] + UIStatusBarStyle statusBarStyle + if ([style isEqualToString:@"Brightness.light"]) statusBarStyle = UIStatusBarStyleLightContent; - else if ([style isEqualToString:@"SystemUiOverlayStyle.dark"]) + else if ([style isEqualToString:@"Brightness.dark"]) statusBarStyle = UIStatusBarStyleDefault; else return; From 9e4c5d0e1f9daf0c46fdc7e5d1e81ce9c36b65c4 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 3 May 2018 15:05:50 -0700 Subject: [PATCH 0243/1190] Roll dart sdk to e6d7d67f4b35556805dd083fed15bf3ed41f7e33. (#5165) * Roll dart sdk to e6d7d67f4b35556805dd083fed15bf3ed41f7e33. Changes since last dart roll: ``` e6d7d67f4b Revert 4f18af12c7c6d53f02cf32cb9b5ea848b86e1d77 as it causes test breakages. 4877587346 [GN] Uses dart_action.gni instead of compiled_action.gni. 4b89ba24fb Meta CHANGELOG markdown cleanup. 3d688deba7 Bump analysis server version to 1.20.2 0dc81ae4eb Publish package:meta 1.1.5 7e54844fe7 [vm] Fix build for gcc 7.3.0. 9d10a6ad4a Issue 33034. Fix statement completion with missing condition right parenthesis. 3fd2d5fb05 [vm] Use compiler warnings to insist callers check for errors from Dart_Invoke*/Load*/Compile*. afb490adbc [dart:io] Provide modern Dart-styled constants 2929b71aa2 [kernel/vm] Address follow-up review comments for bytecode generation 73768a5342 General TypeInfo and IdentifierContext cleanup e93b2ee250 Improve typedef identifier recovery 46a9ed0617 Added example about calling a tear-off with a wrong-shape argument list 0c839cf3f8 [fasta] Add 'as' expressions to the Forest API 16f6ce2fee [release] Prepare changelog for 2.0.0-dev.53.0 d13bf49870 Check type-variable bounds on generic methods 794fe1e14f Add stacktrace tests for synchronous async fb779df11c [frontend-server] Disable depfile test on Windows. ``` * Adjust gn-scripts to accommodate 487758734695e7a701325b80178465ebbd0fafdd refactoring. --- DEPS | 2 +- lib/snapshot/BUILD.gn | 48 +++++++++++++++++++++ travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3a739b5438888..d75282b86a5dd 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '2765fcf2aecd3841d082fedaeafc00a73a965f8c', + 'dart_revision': 'e6d7d67f4b35556805dd083fed15bf3ed41f7e33', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index bf4e1cf0235d5..76089eb4b449f 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -3,6 +3,7 @@ # found in the LICENSE file. import("$flutter_root/lib/ui/dart_ui.gni") +import("//build/compiled_action.gni") import("//third_party/dart/utils/compile_platform.gni") import("//third_party/dart/utils/generate_entry_points_json.gni") @@ -257,6 +258,53 @@ group("kernel_platform_files") { ] } +# Template to generate entry points JSON file using gen_snapshot tool. +# List of entry points is generated as a by-product while doing precompilation. +# +# This template expects the following arguments: +# - input: Name of the input dart script for precompilation. +# - output: Name of the output entry points JSON file. +# - extra_args: Extra arguments to pass to dart_bootstrap (optional). +# - extra_inputs: Extra input dependencies (optional). +# +template("generate_entry_points_json_with_gen_snapshot") { + assert(defined(invoker.input), "Must define input dart script") + assert(defined(invoker.output), "Must define output json file") + extra_args = [] + if (defined(invoker.extra_args)) { + extra_args += invoker.extra_args + } + extra_inputs = [] + if (defined(invoker.extra_inputs)) { + extra_inputs += invoker.extra_inputs + } + compiled_action(target_name) { + # Printing precompiler entry points is folded into precompilation, so gen_snapshot is invoked + # with correct arguments to generate app-aot snapshot. + + input = invoker.input + output = invoker.output + + tool = "//third_party/dart/runtime/bin:gen_snapshot" + inputs = [ + input, + ] + extra_inputs + outputs = [ + output, + ] + args = [ + "--print-precompiler-entry-points=" + rebase_path(output), + "--snapshot-kind=app-aot-blobs", + "--vm_snapshot_data=" + rebase_path("$target_gen_dir/dummy.vm_data.snapshot"), + "--vm_snapshot_instructions=" + rebase_path("$target_gen_dir/dummy.vm_instr.snapshot"), + "--isolate_snapshot_data=" + rebase_path("$target_gen_dir/dummy.isolate_data.snapshot"), + "--isolate_snapshot_instructions=" + rebase_path("$target_gen_dir/dummy.isolate_instr.snapshot"), + ] + extra_args + [ + rebase_path(input), + ] + } +} + generate_entry_points_json_with_gen_snapshot("entry_points_json") { input = "$flutter_root/lib/snapshot/snapshot.dart" output = "$root_out_dir/dart_entry_points/entry_points.json" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b324a79228369..882fbc6dd962f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f8b0fa85dcfda661056db3508100fa23 +Signature: 77a39e3d3c589aa9c295c23e102794e6 UNUSED LICENSES: From c7477c910f8b99c0d7d3cbe362da6c6f979e0d28 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 3 May 2018 15:14:58 -0700 Subject: [PATCH 0244/1190] libtxt: exclude soft break whitespace from line widths for right justification (#5166) If a line has a soft break due to word wrap, the line width should not include the width of the whitespace characters within the soft break. --- third_party/txt/src/txt/paragraph.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index 9e732f7164600..38952cd0e00e4 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -787,7 +787,12 @@ double Paragraph::GetLineXOffset(size_t line_number, if (align == TextAlign::right || (align == TextAlign::start && direction == TextDirection::rtl) || (align == TextAlign::end && direction == TextDirection::ltr)) { - return width_ - line_total_advance; + // If this line has a soft break, then use the line width calculated by the + // line breaker because that width excludes the soft break's whitespace. + double text_width = line_ranges_[line_number].hard_break + ? line_total_advance + : line_widths_[line_number]; + return width_ - text_width; } else if (paragraph_style_.text_align == TextAlign::center) { return (width_ - line_widths_[line_number]) / 2; } else { From 3c583f81d9995aef3fdb0edb77d549a98f03ce63 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 3 May 2018 15:38:25 -0700 Subject: [PATCH 0245/1190] Revert "Enables system chrome customization on Android O and greater" (#5167) * Revert "Roll dart sdk to e6d7d67f4b35556805dd083fed15bf3ed41f7e33. (#5165)" This reverts commit 9e4c5d0e1f9daf0c46fdc7e5d1e81ce9c36b65c4. * Revert "Enables system chrome customization on Android M/O and greater (#5112)" This reverts commit f2db5dfd30f12407acab57f04acc8af7c6158891. --- .../plugin/platform/PlatformPlugin.java | 71 ++----------------- .../framework/Source/FlutterPlatformPlugin.mm | 9 ++- 2 files changed, 10 insertions(+), 70 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index 1bdc187d54250..de4208e546142 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java @@ -15,8 +15,6 @@ import android.view.HapticFeedbackConstants; import android.view.SoundEffectConstants; import android.view.View; -import android.view.Window; -import android.util.Log; import io.flutter.plugin.common.ActivityLifecycleListener; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; @@ -32,7 +30,6 @@ */ public class PlatformPlugin implements MethodCallHandler, ActivityLifecycleListener { private final Activity mActivity; - private JSONObject mCurrentTheme; public static final int DEFAULT_SYSTEM_UI = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; private static final String kTextPlainFormat = "text/plain"; @@ -63,7 +60,7 @@ public void onMethodCall(MethodCall call, Result result) { setSystemChromeEnabledSystemUIOverlays((JSONArray) arguments); result.success(null); } else if (method.equals("SystemChrome.setSystemUIOverlayStyle")) { - setSystemChromeSystemUIOverlayStyle((JSONObject) arguments); + setSystemChromeSystemUIOverlayStyle((String) arguments); result.success(null); } else if (method.equals("SystemNavigator.pop")) { popSystemNavigator(); @@ -221,70 +218,14 @@ private void setSystemChromeEnabledSystemUIOverlays(JSONArray overlays) throws J updateSystemUiOverlays(); } - private void updateSystemUiOverlays(){ + private void updateSystemUiOverlays() { mActivity.getWindow().getDecorView().setSystemUiVisibility(mEnabledOverlays); - if (mCurrentTheme != null) { - setSystemChromeSystemUIOverlayStyle(mCurrentTheme); - } } - private void setSystemChromeSystemUIOverlayStyle(JSONObject message) { - Window window = mActivity.getWindow(); - View view = window.getDecorView(); - int flags = view.getSystemUiVisibility(); - try { - // You can change the navigation bar color (including translucent colors) - // in Android, but you can't change the color of the navigation buttons until Android O. - // LIGHT vs DARK effectively isn't supported until then. - // Build.VERSION_CODES.O - if (Build.VERSION.SDK_INT >= 26) { - if (!message.isNull("systemNavigationBarIconBrightness")) { - String systemNavigationBarIconBrightness = message.getString("systemNavigationBarIconBrightness"); - switch (systemNavigationBarIconBrightness) { - case "Brightness.dark": - //View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR - flags |= 0x10; - break; - case "Brightness.light": - if ((flags & 0x10) == 0x10) { - flags ^= 0x10; - } - break; - } - } - if (!message.isNull("systemNavigationBarColor")) { - window.setNavigationBarColor(message.getInt("systemNavigationBarColor")); - } - } - // Build.VERSION_CODES.M - if (Build.VERSION.SDK_INT >= 23) { - if (!message.isNull("statusBarIconBrightness")) { - String statusBarIconBrightness = message.getString("statusBarIconBrightness"); - switch (statusBarIconBrightness) { - case "Brightness.dark": - // View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR - flags |= 0x2000; - break; - case "Brightness.light": - if ((flags & 0x2000) == 0x2000) { - flags ^= 0x2000; - } - break; - } - } - if (!message.isNull("statusBarColor")) { - window.setStatusBarColor(message.getInt("statusBarColor")); - } - } - if (!message.isNull("systemNavigationBarDividerColor")) { - // Not availible until Android P. - // window.setNavigationBarDividerColor(systemNavigationBarDividerColor); - } - view.setSystemUiVisibility(flags); - mCurrentTheme = message; - } catch (JSONException err) { - Log.i("PlatformPlugin", err.toString()); - } + private void setSystemChromeSystemUIOverlayStyle(String style) { + // You can change the navigation bar color (including translucent colors) + // in Android, but you can't change the color of the navigation buttons, + // so LIGHT vs DARK effectively isn't supported in Android. } private void popSystemNavigator() { diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index 51df7e1aec983..c312cac28b37b 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -137,12 +137,11 @@ - (void)setSystemChromeEnabledSystemUIOverlays:(NSArray*)overlays { ![overlays containsObject:@"SystemUiOverlay.top"]; } -- (void)setSystemChromeSystemUIOverlayStyle:(NSDictionary*)message { - NSString* style = message[@"statusBarBrightness"] - UIStatusBarStyle statusBarStyle - if ([style isEqualToString:@"Brightness.light"]) +- (void)setSystemChromeSystemUIOverlayStyle:(NSString*)style { + UIStatusBarStyle statusBarStyle; + if ([style isEqualToString:@"SystemUiOverlayStyle.light"]) statusBarStyle = UIStatusBarStyleLightContent; - else if ([style isEqualToString:@"Brightness.dark"]) + else if ([style isEqualToString:@"SystemUiOverlayStyle.dark"]) statusBarStyle = UIStatusBarStyleDefault; else return; From 9dd3eba64d6b8b3cea286051938c3a3d884ab03a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 3 May 2018 18:47:31 -0400 Subject: [PATCH 0246/1190] Roll src/third_party/skia/ 0e6e651a9..d8a189fca (9 commits) (#5169) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d75282b86a5dd..956a1bedf056d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0e6e651a974a9bb879eac83f7b74490f350e1894', + 'skia_revision': 'd8a189fca3cdfa064de75a280d5af34cc5026bbe', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 882fbc6dd962f..65b4f2c4d4558 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 77a39e3d3c589aa9c295c23e102794e6 +Signature: 7cc17682e6b6e0b68fc9c876eb587159 UNUSED LICENSES: From e976be13c51448f89107d082ec81e2b6731671fa Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Thu, 3 May 2018 16:44:44 -0700 Subject: [PATCH 0247/1190] Roll buildroot to cc6ecd00297daff80f94638cb137bce1f044fdb3. (#5170) --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 956a1bedf056d..ae8a560c88122 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'a69ebc4e14e4dd7259ffdeaf6b161e3dfe2a3de9', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'cc6ecd00297daff80f94638cb137bce1f044fdb3', # Fuchsia compatibility # From 3302c2ffcc6086cdcf70e72a3d22e335077f54d6 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 4 May 2018 07:32:30 -0400 Subject: [PATCH 0248/1190] Roll src/third_party/skia/ d8a189fca..5226b777e (2 commits; 1 trivial rolls) (#5172) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ae8a560c88122..9cbe65682748c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd8a189fca3cdfa064de75a280d5af34cc5026bbe', + 'skia_revision': '5226b777edeef1b8168c9cf7f4fb34a0fdc606a1', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 65b4f2c4d4558..d91d6d2ec9f4d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7cc17682e6b6e0b68fc9c876eb587159 +Signature: 74e81516618f30e45f76acc3d9cb9b68 UNUSED LICENSES: From d0c99220fd81757d5c8bda474d31baa8aa60046b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 4 May 2018 11:06:31 -0400 Subject: [PATCH 0249/1190] Roll src/third_party/skia/ 5226b777e..4824ed05a (7 commits; 1 trivial rolls) (#5174) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9cbe65682748c..95223f7f9cf06 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5226b777edeef1b8168c9cf7f4fb34a0fdc606a1', + 'skia_revision': '4824ed05ac126a4de5322f93e5af821d611b974d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d91d6d2ec9f4d..185879993cc77 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 74e81516618f30e45f76acc3d9cb9b68 +Signature: 48c518dee9548840b952d65c0b12d344 UNUSED LICENSES: @@ -17300,6 +17300,8 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h +FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp @@ -19942,6 +19944,7 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzSkottieJSON.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp ---------------------------------------------------------------------------------------------------- From f045500389577cbfbf274b4838d5fbd0133f0a67 Mon Sep 17 00:00:00 2001 From: cary-clark Date: Fri, 4 May 2018 13:44:44 -0400 Subject: [PATCH 0250/1190] rename obsolete SkColor.h macro (#5175) change SkColorSetARGBInline to SkColorSetARGB. SkColorSetARGBInline is deprecated and will be deleted from Skia. --- flow/paint_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/paint_utils.cc b/flow/paint_utils.cc index 2bf5b265d3904..e2ea306c913f5 100644 --- a/flow/paint_utils.cc +++ b/flow/paint_utils.cc @@ -38,7 +38,7 @@ void DrawCheckerboard(SkCanvas* canvas, const SkRect& rect) { canvas->clipRect(rect); auto checkerboard_color = - SkColorSetARGBInline(64, rand() % 256, rand() % 256, rand() % 256); + SkColorSetARGB(64, rand() % 256, rand() % 256, rand() % 256); DrawCheckerboard(canvas, checkerboard_color, 0x00000000, 12); canvas->restore(); From fccb32ab3af789c415c3a10e79c2affd90add040 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 4 May 2018 14:36:30 -0400 Subject: [PATCH 0251/1190] Roll src/third_party/skia/ 4824ed05a..bd66caa7a (8 commits) (#5176) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/DEPS b/DEPS index 95223f7f9cf06..8da2feafb5251 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4824ed05ac126a4de5322f93e5af821d611b974d', + 'skia_revision': 'bd66caa7ac38b68487778064eab10d76bc1d2e48', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 185879993cc77..06839e9441bba 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 48c518dee9548840b952d65c0b12d344 +Signature: eff403e0942aac3ffa7aaf9502175e7d UNUSED LICENSES: @@ -17499,7 +17499,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/no_persistent_checkout.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/test.json @@ -17523,8 +17522,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17608,7 +17605,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json @@ -17652,8 +17648,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Debug-NoGPU.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17667,7 +17661,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Cl FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/alternate_repo.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json From 320e420d7e1b9da7a16bcd39965c6975dc3f2cd2 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 4 May 2018 15:42:31 -0400 Subject: [PATCH 0252/1190] Roll src/third_party/skia/ bd66caa7a..e99a4b109 (10 commits) (#5178) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 8da2feafb5251..b1e105327747f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'bd66caa7ac38b68487778064eab10d76bc1d2e48', + 'skia_revision': 'e99a4b1099f70f33c310497df25e8ed849b056d9', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 06839e9441bba..7cfc265442a0a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: eff403e0942aac3ffa7aaf9502175e7d +Signature: 603f99debe1751f0bb3a517295ba7072 UNUSED LICENSES: @@ -17496,7 +17496,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/cross_repo_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/no_persistent_checkout.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/test.json From 13abe8772e8549373b8fea377f7475850cc40dec Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 4 May 2018 14:27:57 -0700 Subject: [PATCH 0253/1190] Use a view container handle instead of a reference to the view interface ptr when configuring an isolate. (#5179) --- content_handler/engine.cc | 10 +++++----- content_handler/platform_view.cc | 10 +++++++--- content_handler/platform_view.h | 3 ++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/content_handler/engine.cc b/content_handler/engine.cc index a289177eec740..04dd2183c46ac 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -173,14 +173,14 @@ Engine::Engine(Delegate& delegate, // Shell has been created. Before we run the engine, setup the isolate // configurator. { - PlatformView* platform_view = - static_cast(shell_->GetPlatformView().get()); - auto& view = platform_view->GetMozartView(); - fidl::InterfaceHandle view_container; - view->GetContainer(view_container.NewRequest()); + auto view_container = + static_cast(shell_->GetPlatformView().get()) + ->TakeViewContainer(); + component::ApplicationEnvironmentPtr application_environment; application_context.ConnectToEnvironmentService( application_environment.NewRequest()); + isolate_configurator_ = std::make_unique( std::move(fdio_ns), // std::move(view_container), // diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc index 9ad2f292fb16d..2531a60473583 100644 --- a/content_handler/platform_view.cc +++ b/content_handler/platform_view.cc @@ -66,6 +66,10 @@ PlatformView::PlatformView( // Get the services from the created view. view_->GetServiceProvider(service_provider_.NewRequest()); + // Get the view conatiner. This will need to be returned to the isolate + // configurator so that it can setup Mozart bindings later. + view_->GetContainer(view_container_.NewRequest()); + // Get the input connection from the services of the view. component::ConnectToService(service_provider_.get(), input_connection_.NewRequest()); @@ -96,9 +100,9 @@ void PlatformView::RegisterPlatformMessageHandlers() { std::placeholders::_1); } -views_v1::ViewPtr& PlatformView::GetMozartView() { - FXL_DCHECK(view_.is_bound()); - return view_; +fidl::InterfaceHandle +PlatformView::TakeViewContainer() { + return std::move(view_container_); } // |views_v1::ViewListener| diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h index 28ac6e4d107df..32bb83deda11d 100644 --- a/content_handler/platform_view.h +++ b/content_handler/platform_view.h @@ -43,12 +43,13 @@ class PlatformView final : public shell::PlatformView, void UpdateViewportMetrics(double pixel_ratio); - views_v1::ViewPtr& GetMozartView(); + fidl::InterfaceHandle TakeViewContainer(); private: const std::string debug_label_; views_v1::ViewManagerPtr view_manager_; views_v1::ViewPtr view_; + fidl::InterfaceHandle view_container_; component::ServiceProviderPtr service_provider_; fidl::Binding view_listener_; input::InputConnectionPtr input_connection_; From e1cd506187814874e6d5fbcd828cabd1cf78e6b6 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 4 May 2018 14:46:57 -0700 Subject: [PATCH 0254/1190] add onStart hook which places flutter in an inactive state (#5177) --- shell/platform/android/io/flutter/app/FlutterActivity.java | 6 ++++++ .../android/io/flutter/app/FlutterActivityDelegate.java | 7 +++++++ .../android/io/flutter/app/FlutterActivityEvents.java | 5 +++++ shell/platform/android/io/flutter/view/FlutterView.java | 4 ++++ 4 files changed, 22 insertions(+) diff --git a/shell/platform/android/io/flutter/app/FlutterActivity.java b/shell/platform/android/io/flutter/app/FlutterActivity.java index ab566c485a1e6..39886c0b06004 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterActivity.java @@ -81,6 +81,12 @@ protected void onCreate(Bundle savedInstanceState) { eventDelegate.onCreate(savedInstanceState); } + @Override + protected void onStart() { + super.onStart(); + eventDelegate.onStart(); + } + @Override protected void onResume() { super.onResume(); diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index 1c880d7e46987..8a41d8f4bfb62 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -206,6 +206,13 @@ public void onPause() { } } + @Override + public void onStart() { + if (flutterView != null) { + flutterView.onStart(); + } + } + @Override public void onResume() { Application app = (Application) activity.getApplicationContext(); diff --git a/shell/platform/android/io/flutter/app/FlutterActivityEvents.java b/shell/platform/android/io/flutter/app/FlutterActivityEvents.java index 8d8eb422aa338..a9a51d7a7bfcb 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityEvents.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityEvents.java @@ -39,6 +39,11 @@ public interface FlutterActivityEvents */ void onPause(); + /** + * @see android.app.Activity#onStart() + */ + void onStart(); + /** * @see android.app.Activity#onResume() */ diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 38b0df20b96c2..7734c29a0e31d 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -266,6 +266,10 @@ public void addActivityLifecycleListener(ActivityLifecycleListener listener) { mActivityLifecycleListeners.add(listener); } + public void onStart() { + mFlutterLifecycleChannel.send("AppLifecycleState.inactive"); + } + public void onPause() { mFlutterLifecycleChannel.send("AppLifecycleState.inactive"); } From 02bc5788f2a042c7a3483fe5e14ad1d762e3c0f9 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 4 May 2018 16:07:10 -0700 Subject: [PATCH 0255/1190] Use the rasterizer's compositor context and texture registry to capture screenshots (#5180) Fixes https://github.com/flutter/flutter/issues/16412 --- shell/common/rasterizer.cc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index db940ce9440a3..df545f1dd875f 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -126,13 +126,14 @@ bool Rasterizer::DrawToSurface(flow::LayerTree& layer_tree) { return false; } -static sk_sp ScreenshotLayerTreeAsPicture(flow::LayerTree* tree) { +static sk_sp ScreenshotLayerTreeAsPicture( + flow::LayerTree* tree, + flow::CompositorContext& compositor_context) { FXL_DCHECK(tree != nullptr); SkPictureRecorder recorder; recorder.beginRecording( SkRect::MakeWH(tree->frame_size().width(), tree->frame_size().height())); - flow::CompositorContext compositor_context; auto frame = compositor_context.AcquireFrame( nullptr, recorder.getRecordingCanvas(), false); @@ -158,9 +159,11 @@ static sk_sp CreateSnapshotSurface(GrContext* surface_context, return SkSurface::MakeRaster(image_info); } -static sk_sp ScreenshotLayerTreeAsImage(flow::LayerTree* tree, - GrContext* surface_context, - bool compressed) { +static sk_sp ScreenshotLayerTreeAsImage( + flow::LayerTree* tree, + flow::CompositorContext& compositor_context, + GrContext* surface_context, + bool compressed) { // Attempt to create a snapshot surface depending on whether we have access to // a valid GPU rendering context. auto snapshot_surface = @@ -170,7 +173,6 @@ static sk_sp ScreenshotLayerTreeAsImage(flow::LayerTree* tree, } // Draw the current layer tree into the snapshot surface. - flow::CompositorContext compositor_context; auto canvas = snapshot_surface->getCanvas(); auto frame = compositor_context.AcquireFrame(surface_context, canvas, false); canvas->clear(SK_ColorBLACK); @@ -219,13 +221,16 @@ Rasterizer::Screenshot Rasterizer::ScreenshotLastLayerTree( switch (type) { case ScreenshotType::SkiaPicture: - data = ScreenshotLayerTreeAsPicture(layer_tree)->serialize(); + data = ScreenshotLayerTreeAsPicture(layer_tree, *compositor_context_) + ->serialize(); break; case ScreenshotType::UncompressedImage: - data = ScreenshotLayerTreeAsImage(layer_tree, surface_context, false); + data = ScreenshotLayerTreeAsImage(layer_tree, *compositor_context_, + surface_context, false); break; case ScreenshotType::CompressedImage: - data = ScreenshotLayerTreeAsImage(layer_tree, surface_context, true); + data = ScreenshotLayerTreeAsImage(layer_tree, *compositor_context_, + surface_context, true); break; } From 4f8ea3a675ac6fe0e7595c29248a4cc823d5add0 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 4 May 2018 19:12:31 -0400 Subject: [PATCH 0256/1190] Roll src/third_party/skia/ e99a4b109..b58094aa2 (7 commits) (#5181) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index b1e105327747f..df7b183d80816 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e99a4b1099f70f33c310497df25e8ed849b056d9', + 'skia_revision': 'b58094aa2d45419f08d329a52f8220de65c19f33', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7cfc265442a0a..b36d7fd5c73f1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 603f99debe1751f0bb3a517295ba7072 +Signature: 3c18b73f359ed000bbec63b04444934b UNUSED LICENSES: @@ -17165,8 +17165,8 @@ FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.h +FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.cpp +FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.h FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.cpp FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.h FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.cpp From 087c5741bbbd55f493414c8e2be882cb3ea4e9a1 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 4 May 2018 22:41:52 -0400 Subject: [PATCH 0257/1190] Roll src/third_party/skia/ b58094aa2..3d5b83bf9 (2 commits; 1 trivial rolls) (#5183) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index df7b183d80816..0289d4053a73f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b58094aa2d45419f08d329a52f8220de65c19f33', + 'skia_revision': '3d5b83bf95333a0b31b08fb4a889fa7697c87c03', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b36d7fd5c73f1..9c5ac6d8a4d46 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3c18b73f359ed000bbec63b04444934b +Signature: f2f4f59a3a28e54a0786d4c5b3187650 UNUSED LICENSES: From 99b5408ab8687776d98891f55de9d24b4879b378 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 5 May 2018 02:09:31 -0400 Subject: [PATCH 0258/1190] Roll src/third_party/skia/ 3d5b83bf9..32d8f883b (1 commit; 1 trivial rolls) (#5184) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 0289d4053a73f..19fb25dfac803 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3d5b83bf95333a0b31b08fb4a889fa7697c87c03', + 'skia_revision': '32d8f883bd4e359ad8fac8c281d488f892d252de', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9c5ac6d8a4d46..b56a5e4e0dba7 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f2f4f59a3a28e54a0786d4c5b3187650 +Signature: 9ca513294e9e84d5f0168ffecfeef6e7 UNUSED LICENSES: From 6ba94bceb54a5e59c183e15b49b009c9a45033de Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 6 May 2018 10:20:30 -0400 Subject: [PATCH 0259/1190] Roll src/third_party/skia/ 32d8f883b..963d1ef8a (1 commit) (#5185) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 19fb25dfac803..28e079476a80d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '32d8f883bd4e359ad8fac8c281d488f892d252de', + 'skia_revision': '963d1ef8acad6861e1408bd60395a644f066c5be', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b56a5e4e0dba7..5e07e44144705 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9ca513294e9e84d5f0168ffecfeef6e7 +Signature: 6d274fa77c73518400120c7de9430fee UNUSED LICENSES: From 26554f164b6351d04e3d9328f763ab7f8b89792b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 6 May 2018 13:50:30 -0400 Subject: [PATCH 0260/1190] Roll src/third_party/skia/ 963d1ef8a..95e2b91d7 (1 commit) (#5186) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 28e079476a80d..dc86be79f5ac7 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '963d1ef8acad6861e1408bd60395a644f066c5be', + 'skia_revision': '95e2b91d76d60ae69588ca700211146aabddbe5a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5e07e44144705..d20b3d14c318f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6d274fa77c73518400120c7de9430fee +Signature: da936304d5b1125629fdd04fcb7bdc2c UNUSED LICENSES: From 3bb398ea9e60dbb323271e033a69d7039491a4d7 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 7 May 2018 09:48:31 -0400 Subject: [PATCH 0261/1190] Roll src/third_party/skia/ 95e2b91d7..2381add3e (1 commit) (#5187) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index dc86be79f5ac7..1ab873d3038af 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '95e2b91d76d60ae69588ca700211146aabddbe5a', + 'skia_revision': '2381add3ea636b74bbf7f1d9be9ae3ddd6793f1c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d20b3d14c318f..50379eabea146 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: da936304d5b1125629fdd04fcb7bdc2c +Signature: 88b80c6041e6a471331f5bb44cd23ee8 UNUSED LICENSES: From e341c63acdbfa055ed3ca9743dd5993bcc77da3b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 7 May 2018 13:18:31 -0400 Subject: [PATCH 0262/1190] Roll src/third_party/skia/ 2381add3e..a585f73bb (9 commits) (#5188) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1ab873d3038af..ec702a6e1fd19 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2381add3ea636b74bbf7f1d9be9ae3ddd6793f1c', + 'skia_revision': 'a585f73bbef8dec83fdc3951a1e9130a09bdcef1', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 50379eabea146..f4749e42a9249 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 88b80c6041e6a471331f5bb44cd23ee8 +Signature: 2f4a9463fc8fca068bd9adeead4f3bf3 UNUSED LICENSES: @@ -17745,6 +17745,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SwiftShader.json From 1ef62820b199141d085b6488e056e9ffe00c2949 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 7 May 2018 16:50:31 -0400 Subject: [PATCH 0263/1190] Roll src/third_party/skia/ a585f73bb..a8daee88d (15 commits; 1 trivial rolls) (#5189) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ec702a6e1fd19..9eca884650a40 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a585f73bbef8dec83fdc3951a1e9130a09bdcef1', + 'skia_revision': 'a8daee88d274e29f9d27f640843b33795f6df31e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f4749e42a9249..d2fa1b767435f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2f4a9463fc8fca068bd9adeead4f3bf3 +Signature: af8dbbe66fc4f24e00cd0a0d828dfbcd UNUSED LICENSES: @@ -17729,6 +17729,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-CPU-Snapdragon808-arm-Release-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json @@ -17738,6 +17739,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL1_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL3_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json From 57f53b98a482c6f7f921f06f974c4d199097bfa1 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 7 May 2018 15:45:59 -0700 Subject: [PATCH 0264/1190] Re-land Enables system chrome customization on Android O/N and greater (#5171) --- .../plugin/platform/PlatformPlugin.java | 67 +++++++++++++++++-- .../framework/Source/FlutterPlatformPlugin.mm | 7 +- 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index de4208e546142..d46b0ac74c45b 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java @@ -15,6 +15,8 @@ import android.view.HapticFeedbackConstants; import android.view.SoundEffectConstants; import android.view.View; +import android.view.Window; +import android.util.Log; import io.flutter.plugin.common.ActivityLifecycleListener; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; @@ -30,6 +32,7 @@ */ public class PlatformPlugin implements MethodCallHandler, ActivityLifecycleListener { private final Activity mActivity; + private JSONObject mCurrentTheme; public static final int DEFAULT_SYSTEM_UI = View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; private static final String kTextPlainFormat = "text/plain"; @@ -60,7 +63,7 @@ public void onMethodCall(MethodCall call, Result result) { setSystemChromeEnabledSystemUIOverlays((JSONArray) arguments); result.success(null); } else if (method.equals("SystemChrome.setSystemUIOverlayStyle")) { - setSystemChromeSystemUIOverlayStyle((String) arguments); + setSystemChromeSystemUIOverlayStyle((JSONObject) arguments); result.success(null); } else if (method.equals("SystemNavigator.pop")) { popSystemNavigator(); @@ -218,14 +221,66 @@ private void setSystemChromeEnabledSystemUIOverlays(JSONArray overlays) throws J updateSystemUiOverlays(); } - private void updateSystemUiOverlays() { + private void updateSystemUiOverlays(){ mActivity.getWindow().getDecorView().setSystemUiVisibility(mEnabledOverlays); + if (mCurrentTheme != null) { + setSystemChromeSystemUIOverlayStyle(mCurrentTheme); + } } - private void setSystemChromeSystemUIOverlayStyle(String style) { - // You can change the navigation bar color (including translucent colors) - // in Android, but you can't change the color of the navigation buttons, - // so LIGHT vs DARK effectively isn't supported in Android. + private void setSystemChromeSystemUIOverlayStyle(JSONObject message) { + Window window = mActivity.getWindow(); + View view = window.getDecorView(); + int flags = view.getSystemUiVisibility(); + try { + // You can change the navigation bar color (including translucent colors) + // in Android, but you can't change the color of the navigation buttons until Android O. + // LIGHT vs DARK effectively isn't supported until then. + // Build.VERSION_CODES.O + if (Build.VERSION.SDK_INT >= 26) { + if (!message.isNull("systemNavigationBarIconBrightness")) { + String systemNavigationBarIconBrightness = message.getString("systemNavigationBarIconBrightness"); + switch (systemNavigationBarIconBrightness) { + case "Brightness.dark": + //View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR + flags |= 0x10; + break; + case "Brightness.light": + flags &= ~0x10; + break; + } + } + if (!message.isNull("systemNavigationBarColor")) { + window.setNavigationBarColor(message.getInt("systemNavigationBarColor")); + } + } + // Build.VERSION_CODES.M + if (Build.VERSION.SDK_INT >= 23) { + if (!message.isNull("statusBarIconBrightness")) { + String statusBarIconBrightness = message.getString("statusBarIconBrightness"); + switch (statusBarIconBrightness) { + case "Brightness.dark": + // View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR + flags |= 0x2000; + break; + case "Brightness.light": + flags &= ~0x2000; + break; + } + } + if (!message.isNull("statusBarColor")) { + window.setStatusBarColor(message.getInt("statusBarColor")); + } + } + if (!message.isNull("systemNavigationBarDividerColor")) { + // Not availible until Android P. + // window.setNavigationBarDividerColor(systemNavigationBarDividerColor); + } + view.setSystemUiVisibility(flags); + mCurrentTheme = message; + } catch (JSONException err) { + Log.i("PlatformPlugin", err.toString()); + } } private void popSystemNavigator() { diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index c312cac28b37b..e0a803905ccb6 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -137,11 +137,12 @@ - (void)setSystemChromeEnabledSystemUIOverlays:(NSArray*)overlays { ![overlays containsObject:@"SystemUiOverlay.top"]; } -- (void)setSystemChromeSystemUIOverlayStyle:(NSString*)style { +- (void)setSystemChromeSystemUIOverlayStyle:(NSDictionary*)message { + NSString* style = message[@"statusBarBrightness"]; UIStatusBarStyle statusBarStyle; - if ([style isEqualToString:@"SystemUiOverlayStyle.light"]) + if ([style isEqualToString:@"Brightness.light"]) statusBarStyle = UIStatusBarStyleLightContent; - else if ([style isEqualToString:@"SystemUiOverlayStyle.dark"]) + else if ([style isEqualToString:@"Brightness.dark"]) statusBarStyle = UIStatusBarStyleDefault; else return; From 435028fdb7966ed86a47d5bc1a70a81bc6787c22 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 7 May 2018 17:12:03 -0700 Subject: [PATCH 0265/1190] libtxt: support fake italic text (#5191) The text skew value is based on Blink's implementation. Fixes https://github.com/flutter/flutter/issues/17351 --- third_party/txt/src/txt/paragraph.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index 38952cd0e00e4..378ea6c82a37c 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -48,11 +48,13 @@ namespace { class GlyphTypeface { public: GlyphTypeface(sk_sp typeface, minikin::FontFakery fakery) - : typeface_(std::move(typeface)), fake_bold_(fakery.isFakeBold()) {} + : typeface_(std::move(typeface)), + fake_bold_(fakery.isFakeBold()), + fake_italic_(fakery.isFakeItalic()) {} bool operator==(GlyphTypeface& other) { return other.typeface_.get() == typeface_.get() && - other.fake_bold_ == fake_bold_; + other.fake_bold_ == fake_bold_ && other.fake_italic_ == fake_italic_; } bool operator!=(GlyphTypeface& other) { return !(*this == other); } @@ -60,11 +62,13 @@ class GlyphTypeface { void apply(SkPaint& paint) { paint.setTypeface(typeface_); paint.setFakeBoldText(fake_bold_); + paint.setTextSkewX(fake_italic_ ? -SK_Scalar1 / 4 : 0); } private: sk_sp typeface_; bool fake_bold_; + bool fake_italic_; }; GlyphTypeface GetGlyphTypeface(const minikin::Layout& layout, size_t index) { From f6359e4111d37652409e2392fdb3cb72f1119c2a Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 7 May 2018 17:16:03 -0700 Subject: [PATCH 0266/1190] libtxt: exclude trailing whitespace from right-justified lines (#5190) If a line is right justified, then remove any trailing whitespace from the text range given to Minikin. Right justification shifts the line's glyphs by the layout advance computed by Minikin, and this advance should exclude whitespace so that the last visible character will be flush with the right margin. See https://github.com/flutter/flutter/issues/16333 --- third_party/txt/src/minikin/LineBreaker.cpp | 2 +- third_party/txt/src/minikin/LineBreaker.h | 2 + third_party/txt/src/txt/paragraph.cc | 48 ++++++++++++--------- third_party/txt/src/txt/paragraph.h | 11 +++-- third_party/txt/src/txt/paragraph_style.cc | 12 ++++++ third_party/txt/src/txt/paragraph_style.h | 3 ++ 6 files changed, 53 insertions(+), 25 deletions(-) diff --git a/third_party/txt/src/minikin/LineBreaker.cpp b/third_party/txt/src/minikin/LineBreaker.cpp index 0245e579b127f..adff2a1e7733b 100644 --- a/third_party/txt/src/minikin/LineBreaker.cpp +++ b/third_party/txt/src/minikin/LineBreaker.cpp @@ -107,7 +107,7 @@ void LineBreaker::setIndents(const std::vector& indents) { // end of line. It is the Unicode set: // [[:General_Category=Space_Separator:]-[:Line_Break=Glue:]], plus '\n'. Note: // all such characters are in the BMP, so it's ok to use code units for this. -static bool isLineEndSpace(uint16_t c) { +bool isLineEndSpace(uint16_t c) { return c == '\n' || c == ' ' || c == 0x1680 || (0x2000 <= c && c <= 0x200A && c != 0x2007) || c == 0x205F || c == 0x3000; diff --git a/third_party/txt/src/minikin/LineBreaker.h b/third_party/txt/src/minikin/LineBreaker.h index c4ba9b265a135..4789850bb92fe 100644 --- a/third_party/txt/src/minikin/LineBreaker.h +++ b/third_party/txt/src/minikin/LineBreaker.h @@ -49,6 +49,8 @@ enum HyphenationFrequency { kHyphenationFrequency_Full = 2 }; +bool isLineEndSpace(uint16_t c); + // TODO: want to generalize to be able to handle array of line widths class LineWidths { public: diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index 378ea6c82a37c..f75c4a0aeae5f 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -258,7 +258,8 @@ bool Paragraph::ComputeLineBreaks() { size_t block_size = block_end - block_start; if (block_size == 0) { - line_ranges_.emplace_back(block_start, block_end, block_end + 1, true); + line_ranges_.emplace_back(block_start, block_end, block_end, + block_end + 1, true); line_widths_.push_back(0); continue; } @@ -311,7 +312,14 @@ bool Paragraph::ComputeLineBreaks() { bool hard_break = i == breaks_count - 1; size_t line_end_including_newline = (hard_break && line_end < text_.size()) ? line_end + 1 : line_end; + size_t line_end_excluding_whitespace = line_end; + while ( + line_end_excluding_whitespace > 0 && + minikin::isLineEndSpace(text_[line_end_excluding_whitespace - 1])) { + line_end_excluding_whitespace--; + } line_ranges_.emplace_back(line_start, line_end, + line_end_excluding_whitespace, line_end_including_newline, hard_break); line_widths_.push_back(breaker_.getWidths()[i]); } @@ -462,13 +470,20 @@ void Paragraph::Layout(double width, bool force) { } } + // Exclude trailing whitespace from right-justified lines so the last + // visible character in the line will be flush with the right margin. + size_t line_end_index = + (paragraph_style_.effective_align() == TextAlign::right) + ? line_range.end_excluding_whitespace + : line_range.end; + // Find the runs comprising this line. std::vector line_runs; for (const BidiRun& bidi_run : bidi_runs) { - if (bidi_run.start() < line_range.end && + if (bidi_run.start() < line_end_index && bidi_run.end() > line_range.start) { line_runs.emplace_back(std::max(bidi_run.start(), line_range.start), - std::min(bidi_run.end(), line_range.end), + std::min(bidi_run.end(), line_end_index), bidi_run.direction(), bidi_run.style()); } } @@ -687,7 +702,7 @@ void Paragraph::Layout(double width, bool force) { } // Adjust the glyph positions based on the alignment of the line. - double line_x_offset = GetLineXOffset(line_number, run_x_offset); + double line_x_offset = GetLineXOffset(run_x_offset); if (line_x_offset) { for (CodeUnitRun& code_unit_run : line_code_unit_runs) { for (GlyphPosition& position : code_unit_run.positions) { @@ -780,25 +795,16 @@ void Paragraph::Layout(double width, bool force) { }); } -double Paragraph::GetLineXOffset(size_t line_number, - double line_total_advance) { - if (line_number >= line_widths_.size() || isinf(width_)) +double Paragraph::GetLineXOffset(double line_total_advance) { + if (isinf(width_)) return 0; - TextAlign align = paragraph_style_.text_align; - TextDirection direction = paragraph_style_.text_direction; - - if (align == TextAlign::right || - (align == TextAlign::start && direction == TextDirection::rtl) || - (align == TextAlign::end && direction == TextDirection::ltr)) { - // If this line has a soft break, then use the line width calculated by the - // line breaker because that width excludes the soft break's whitespace. - double text_width = line_ranges_[line_number].hard_break - ? line_total_advance - : line_widths_[line_number]; - return width_ - text_width; - } else if (paragraph_style_.text_align == TextAlign::center) { - return (width_ - line_widths_[line_number]) / 2; + TextAlign align = paragraph_style_.effective_align(); + + if (align == TextAlign::right) { + return width_ - line_total_advance; + } else if (align == TextAlign::center) { + return (width_ - line_total_advance) / 2; } else { return 0; } diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index f70d5828d516b..454cdc9aca47b 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -187,9 +187,14 @@ class Paragraph { mutable std::unique_ptr word_breaker_; struct LineRange { - LineRange(size_t s, size_t e, size_t ewn, bool h) - : start(s), end(e), end_including_newline(ewn), hard_break(h) {} + LineRange(size_t s, size_t e, size_t eew, size_t ein, bool h) + : start(s), + end(e), + end_excluding_whitespace(eew), + end_including_newline(ein), + hard_break(h) {} size_t start, end; + size_t end_excluding_whitespace; size_t end_including_newline; bool hard_break; }; @@ -300,7 +305,7 @@ class Paragraph { // Calculate the starting X offset of a line based on the line's width and // alignment. - double GetLineXOffset(size_t line_number, double line_total_advance); + double GetLineXOffset(double line_total_advance); // Creates and draws the decorations onto the canvas. void PaintDecorations(SkCanvas* canvas, const PaintRecord& record); diff --git a/third_party/txt/src/txt/paragraph_style.cc b/third_party/txt/src/txt/paragraph_style.cc index 5c00409782cdc..fbb89cbfccdec 100644 --- a/third_party/txt/src/txt/paragraph_style.cc +++ b/third_party/txt/src/txt/paragraph_style.cc @@ -37,4 +37,16 @@ bool ParagraphStyle::ellipsized() const { return !ellipsis.empty(); } +TextAlign ParagraphStyle::effective_align() const { + if (text_align == TextAlign::start) { + return (text_direction == TextDirection::ltr) ? TextAlign::left + : TextAlign::right; + } else if (text_align == TextAlign::end) { + return (text_direction == TextDirection::ltr) ? TextAlign::right + : TextAlign::left; + } else { + return text_align; + } +} + } // namespace txt diff --git a/third_party/txt/src/txt/paragraph_style.h b/third_party/txt/src/txt/paragraph_style.h index 13d32106c1df3..3b04269d8eaee 100644 --- a/third_party/txt/src/txt/paragraph_style.h +++ b/third_party/txt/src/txt/paragraph_style.h @@ -66,6 +66,9 @@ class ParagraphStyle { bool unlimited_lines() const; bool ellipsized() const; + + // Return a text alignment value that is not dependent on the text direction. + TextAlign effective_align() const; }; } // namespace txt From 20b286dd428a0d8dd0f87b7a03ab67fbf0da2836 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 7 May 2018 20:20:30 -0400 Subject: [PATCH 0267/1190] Roll src/third_party/skia/ a8daee88d..cea8e3d13 (3 commits) (#5192) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9eca884650a40..0ecd18445ddb4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a8daee88d274e29f9d27f640843b33795f6df31e', + 'skia_revision': 'cea8e3d1326df16f1eeb41233703bf469016025c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d2fa1b767435f..9dfe8714d5f62 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: af8dbbe66fc4f24e00cd0a0d828dfbcd +Signature: 81817026b7fb9bc1bb25cd5fb4c46dd7 UNUSED LICENSES: From d97b6d859a9c5043a555d0741fdeddbdb5d3023f Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 7 May 2018 17:28:31 -0700 Subject: [PATCH 0268/1190] Allow explicit specification of the isolate snapshot. (#5193) The mobile shells all use the same isolate snapshot. This is also the snapshot used by the service isolate. This works towards a world where the isolate snapshot is no longer a member variable of the DartVM instance. Instead, all snapshots must be specified in the run configuration. For now, the new `Shell::Create` overload will only be used by Fuchsia till I refactor `dart_vm.cc`. There are no API updates to the mobile shells. --- runtime/runtime_controller.cc | 7 ++++++- runtime/runtime_controller.h | 3 +++ shell/common/engine.cc | 2 ++ shell/common/engine.h | 1 + shell/common/shell.cc | 38 ++++++++++++++++++++++++++++++----- shell/common/shell.h | 13 ++++++++++++ 6 files changed, 58 insertions(+), 6 deletions(-) diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index b7566a10a084c..8f1d719915b3f 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -21,11 +21,13 @@ namespace blink { RuntimeController::RuntimeController( RuntimeDelegate& p_client, const DartVM* p_vm, + fxl::RefPtr p_isolate_snapshot, TaskRunners p_task_runners, fml::WeakPtr p_resource_context, fxl::RefPtr p_unref_queue) : RuntimeController(p_client, p_vm, + std::move(p_isolate_snapshot), std::move(p_task_runners), std::move(p_resource_context), std::move(p_unref_queue), @@ -34,19 +36,21 @@ RuntimeController::RuntimeController( RuntimeController::RuntimeController( RuntimeDelegate& p_client, const DartVM* p_vm, + fxl::RefPtr p_isolate_snapshot, TaskRunners p_task_runners, fml::WeakPtr p_resource_context, fxl::RefPtr p_unref_queue, WindowData p_window_data) : client_(p_client), vm_(p_vm), + isolate_snapshot_(std::move(p_isolate_snapshot)), task_runners_(p_task_runners), resource_context_(p_resource_context), unref_queue_(p_unref_queue), window_data_(std::move(p_window_data)), root_isolate_( DartIsolate::CreateRootIsolate(vm_, - vm_->GetIsolateSnapshot(), + isolate_snapshot_, task_runners_, std::make_unique(this), resource_context_, @@ -89,6 +93,7 @@ std::unique_ptr RuntimeController::Clone() const { return std::unique_ptr(new RuntimeController( client_, // vm_, // + isolate_snapshot_, // task_runners_, // resource_context_, // unref_queue_, // diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index fb01847a915ae..290282b2e6cde 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -25,6 +25,7 @@ class RuntimeController final : public WindowClient { public: RuntimeController(RuntimeDelegate& client, const DartVM* vm, + fxl::RefPtr isolate_snapshot, TaskRunners task_runners, fml::WeakPtr resource_context, fxl::RefPtr unref_queue); @@ -79,6 +80,7 @@ class RuntimeController final : public WindowClient { RuntimeDelegate& client_; const DartVM* vm_; + fxl::RefPtr isolate_snapshot_; TaskRunners task_runners_; fml::WeakPtr resource_context_; fxl::RefPtr unref_queue_; @@ -88,6 +90,7 @@ class RuntimeController final : public WindowClient { RuntimeController(RuntimeDelegate& client, const DartVM* vm, + fxl::RefPtr isolate_snapshot, TaskRunners task_runners, fml::WeakPtr resource_context, fxl::RefPtr unref_queue, diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 43c2e4e5b7b32..fc6221d8dd2b3 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -42,6 +42,7 @@ static constexpr char kSettingsChannel[] = "flutter/settings"; Engine::Engine(Delegate& delegate, const blink::DartVM& vm, + fxl::RefPtr isolate_snapshot, blink::TaskRunners task_runners, blink::Settings settings, std::unique_ptr animator, @@ -69,6 +70,7 @@ Engine::Engine(Delegate& delegate, runtime_controller_ = std::make_unique( *this, // runtime delegate &vm, // VM + std::move(isolate_snapshot), // isolate snapshot std::move(task_runners), // task runners std::move(resource_context), // resource context std::move(unref_queue) // skia unref queue diff --git a/shell/common/engine.h b/shell/common/engine.h index dfb2ac1191ef4..615f7793a0e18 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -41,6 +41,7 @@ class Engine final : public blink::RuntimeDelegate { Engine(Delegate& delegate, const blink::DartVM& vm, + fxl::RefPtr isolate_snapshot, blink::TaskRunners task_runners, blink::Settings settings, std::unique_ptr animator, diff --git a/shell/common/shell.cc b/shell/common/shell.cc index dd2940dccbf81..e508926a98b7a 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -38,6 +38,7 @@ namespace shell { std::unique_ptr Shell::CreateShellOnPlatformThread( blink::TaskRunners task_runners, blink::Settings settings, + fxl::RefPtr isolate_snapshot, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer) { if (!task_runners.IsValid()) { @@ -108,6 +109,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( fxl::MakeCopyable([&ui_latch, // &engine, // shell = shell.get(), // + isolate_snapshot = std::move(isolate_snapshot), // vsync_waiter = std::move(vsync_waiter), // resource_context = std::move(resource_context), // unref_queue = std::move(unref_queue) // @@ -121,6 +123,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( engine = std::make_unique(*shell, // shell->GetDartVM(), // + std::move(isolate_snapshot), // task_runners, // shell->GetSettings(), // std::move(animator), // @@ -157,6 +160,22 @@ std::unique_ptr Shell::Create( blink::Settings settings, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer) { + auto vm = blink::DartVM::ForProcess(settings); + FXL_CHECK(vm) << "Must be able to initialize the VM."; + return Shell::Create(std::move(task_runners), // + std::move(settings), // + vm->GetIsolateSnapshot(), // + std::move(on_create_platform_view), // + std::move(on_create_rasterizer) // + ); +} + +std::unique_ptr Shell::Create( + blink::TaskRunners task_runners, + blink::Settings settings, + fxl::RefPtr isolate_snapshot, + Shell::CreateCallback on_create_platform_view, + Shell::CreateCallback on_create_rasterizer) { RecordStartupTimestamp(); fxl::LogSettings log_settings; @@ -173,11 +192,20 @@ std::unique_ptr Shell::Create( std::unique_ptr shell; fml::TaskRunner::RunNowOrPostTask( task_runners.GetPlatformTaskRunner(), - [&latch, &shell, task_runners = std::move(task_runners), settings, - on_create_platform_view, on_create_rasterizer]() { - shell = CreateShellOnPlatformThread(std::move(task_runners), settings, - on_create_platform_view, - on_create_rasterizer); + [&latch, // + &shell, // + task_runners = std::move(task_runners), // + settings, // + isolate_snapshot = std::move(isolate_snapshot), // + on_create_platform_view, // + on_create_rasterizer // + ]() { + shell = CreateShellOnPlatformThread(std::move(task_runners), // + settings, // + std::move(isolate_snapshot), // + on_create_platform_view, // + on_create_rasterizer // + ); latch.Signal(); }); latch.Wait(); diff --git a/shell/common/shell.h b/shell/common/shell.h index 02a642b0ba40f..f1403d2fc55a9 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -41,9 +41,21 @@ class Shell final : public PlatformView::Delegate, public: template using CreateCallback = std::function(Shell&)>; + + // Create a shell with the given task runners and settings. The isolate + // snapshot will be shared with the snapshot of the service isolate. + static std::unique_ptr Create( + blink::TaskRunners task_runners, + blink::Settings settings, + CreateCallback on_create_platform_view, + CreateCallback on_create_rasterizer); + + // Creates a shell with the given task runners and settings. The isolate + // snapshot is specified upfront. static std::unique_ptr Create( blink::TaskRunners task_runners, blink::Settings settings, + fxl::RefPtr isolate_snapshot, CreateCallback on_create_platform_view, CreateCallback on_create_rasterizer); @@ -92,6 +104,7 @@ class Shell final : public PlatformView::Delegate, static std::unique_ptr CreateShellOnPlatformThread( blink::TaskRunners task_runners, blink::Settings settings, + fxl::RefPtr isolate_snapshot, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer); From eb5bbdac1738ae90be946bc2f7a35fc6e1017e09 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 7 May 2018 17:46:36 -0700 Subject: [PATCH 0269/1190] Specify a custom isolate snapshot per AOT shell launch. (#5194) --- content_handler/application.cc | 30 +++++++++++------------------- content_handler/application.h | 4 ++-- content_handler/engine.cc | 15 +++++++++++---- content_handler/engine.h | 1 + 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/content_handler/application.cc b/content_handler/application.cc index cddd6b4b8a950..68bbfdde3bb0c 100644 --- a/content_handler/application.cc +++ b/content_handler/application.cc @@ -168,11 +168,7 @@ const std::string& Application::GetDebugLabel() const { } void Application::AttemptVMLaunchWithCurrentSettings( - const blink::Settings& settings) const { - if (blink::DartVM::ForProcessIfInitialized()) { - return; - } - + const blink::Settings& settings) { if (!blink::DartVM::IsRunningPrecompiledCode()) { // We will be initializing the VM lazily in this case. return; @@ -213,17 +209,16 @@ void Application::AttemptVMLaunchWithCurrentSettings( blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( lib, symbol(blink::DartSnapshot::kVMInstructionsSymbol).c_str())); - fxl::RefPtr isolate_snapshot = - fxl::MakeRefCounted( - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kIsolateDataSymbol).c_str()), - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, - symbol(blink::DartSnapshot::kIsolateInstructionsSymbol).c_str())); + isolate_snapshot_ = fxl::MakeRefCounted( + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, symbol(blink::DartSnapshot::kIsolateDataSymbol).c_str()), + blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( + lib, + symbol(blink::DartSnapshot::kIsolateInstructionsSymbol).c_str())); - blink::DartVM::ForProcess(settings_, // - std::move(vm_snapshot), // - std::move(isolate_snapshot) // + blink::DartVM::ForProcess(settings_, // + std::move(vm_snapshot), // + isolate_snapshot_ // ); if (blink::DartVM::ForProcessIfInitialized()) { FXL_DLOG(INFO) << "VM successfully initialized for AOT mode."; @@ -299,15 +294,12 @@ void Application::CreateView( return; } - // This method may be called multiple times. Care must be taken to ensure that - // all arguments can be accessed or synthesized multiple times. - // TODO(chinmaygarde): Figure out how to re-create the outgoing service - // request handle and the FDIO namespace. shell_holders_.emplace(std::make_unique( *this, // delegate debug_label_, // thread label *application_context_, // application context settings_, // settings + std::move(isolate_snapshot_), // isolate snapshot std::move(view_owner), // view owner std::move(fdio_ns_), // FDIO namespace std::move(outgoing_services_request_) // outgoing request diff --git a/content_handler/application.h b/content_handler/application.h index 0499b8931659d..c2df2ff4b8ae2 100644 --- a/content_handler/application.h +++ b/content_handler/application.h @@ -63,6 +63,7 @@ class Application final : public Engine::Delegate, component::ServiceProviderBridge service_provider_bridge_; std::unique_ptr application_context_; fidl::BindingSet shells_bindings_; + fxl::RefPtr isolate_snapshot_; std::set> shell_holders_; std::vector wait_callbacks_; std::pair last_return_code_; @@ -93,8 +94,7 @@ class Application final : public Engine::Delegate, void CreateShellForView( fidl::InterfaceRequest view_provider_request); - void AttemptVMLaunchWithCurrentSettings( - const blink::Settings& settings) const; + void AttemptVMLaunchWithCurrentSettings(const blink::Settings& settings); FXL_DISALLOW_COPY_AND_ASSIGN(Application); }; diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 04dd2183c46ac..84ad434c9dd07 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -38,6 +38,7 @@ Engine::Engine(Delegate& delegate, std::string thread_label, component::ApplicationContext& application_context, blink::Settings settings, + fxl::RefPtr isolate_snapshot, fidl::InterfaceRequest view_owner, UniqueFDIONS fdio_ns, fidl::InterfaceRequest @@ -157,11 +158,17 @@ Engine::Engine(Delegate& delegate, }); }); + if (!isolate_snapshot) { + isolate_snapshot = + blink::DartVM::ForProcess(settings_)->GetIsolateSnapshot(); + } + shell_ = shell::Shell::Create( - task_runners, // host task runners - settings_, // shell launch settings - on_create_platform_view, // platform view create callback - on_create_rasterizer // rasterizer create callback + task_runners, // host task runners + settings_, // shell launch settings + std::move(isolate_snapshot), // isolate snapshot + on_create_platform_view, // platform view create callback + on_create_rasterizer // rasterizer create callback ); if (!shell_) { diff --git a/content_handler/engine.h b/content_handler/engine.h index 6e26a70e01f5c..cedae7456759a 100644 --- a/content_handler/engine.h +++ b/content_handler/engine.h @@ -29,6 +29,7 @@ class Engine final { std::string thread_label, component::ApplicationContext& application_context, blink::Settings settings, + fxl::RefPtr isolate_snapshot, fidl::InterfaceRequest view_owner, UniqueFDIONS fdio_ns, fidl::InterfaceRequest From 9110e895820682a91272f147ee2553557b1c24c1 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 7 May 2018 18:22:53 -0700 Subject: [PATCH 0270/1190] Expose View:OfferServiceProvider to UI thread components in a thread safe manner. (#5195) --- content_handler/engine.cc | 23 ++++++++++++++++++++++- content_handler/engine.h | 8 +++++++- content_handler/isolate_configurator.cc | 19 ++++++------------- content_handler/isolate_configurator.h | 10 +++------- content_handler/platform_view.cc | 6 ++++++ content_handler/platform_view.h | 4 ++++ 6 files changed, 48 insertions(+), 22 deletions(-) diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 84ad434c9dd07..0124e270647e4 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -241,7 +241,7 @@ std::pair Engine::GetEngineReturnCode() const { void Engine::OnMainIsolateStart() { if (!isolate_configurator_ || - !isolate_configurator_->ConfigureCurrentIsolate()) { + !isolate_configurator_->ConfigureCurrentIsolate(this)) { FXL_LOG(ERROR) << "Could not configure some native embedder bindings for a " "new root isolate."; } @@ -275,4 +275,25 @@ void Engine::OnSessionMetricsDidChange(double device_pixel_ratio) { }); } +// |mozart::NativesDelegate| +void Engine::OfferServiceProvider( + fidl::InterfaceHandle service_provider, + fidl::VectorPtr services) { + if (!shell_) { + return; + } + + shell_->GetTaskRunners().GetPlatformTaskRunner()->PostTask( + fxl::MakeCopyable([platform_view = shell_->GetPlatformView(), // + service_provider = std::move(service_provider), // + services = std::move(services) // + ]() mutable { + if (platform_view) { + reinterpret_cast(platform_view.get()) + ->OfferServiceProvider(std::move(service_provider), + std::move(services)); + } + })); +} + } // namespace flutter diff --git a/content_handler/engine.h b/content_handler/engine.h index cedae7456759a..679e88355735d 100644 --- a/content_handler/engine.h +++ b/content_handler/engine.h @@ -13,12 +13,13 @@ #include "lib/fsl/threading/thread.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/weak_ptr.h" +#include "lib/ui/flutter/sdk_ext/src/natives.h" namespace flutter { // Represents an instance of running Flutter engine along with the threads that // host the same. -class Engine final { +class Engine final : public mozart::NativesDelegate { public: class Delegate { public: @@ -58,6 +59,11 @@ class Engine final { void OnSessionMetricsDidChange(double device_pixel_ratio); + // |mozart::NativesDelegate| + void OfferServiceProvider( + fidl::InterfaceHandle service_provider, + fidl::VectorPtr services); + FXL_DISALLOW_COPY_AND_ASSIGN(Engine); }; diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc index 9adc4569f7fba..e03d6cfacb3bd 100644 --- a/content_handler/isolate_configurator.cc +++ b/content_handler/isolate_configurator.cc @@ -28,7 +28,8 @@ IsolateConfigurator::IsolateConfigurator( IsolateConfigurator::~IsolateConfigurator() = default; -bool IsolateConfigurator::ConfigureCurrentIsolate() { +bool IsolateConfigurator::ConfigureCurrentIsolate( + mozart::NativesDelegate* natives_delegate) { if (used_) { return false; } @@ -37,7 +38,7 @@ bool IsolateConfigurator::ConfigureCurrentIsolate() { BindFuchsia(); BindZircon(); BindDartIO(); - BindScenic(); + BindScenic(natives_delegate); // This is now owned by the Dart bindings. So relinquish our ownership of the // handle. @@ -46,15 +47,6 @@ bool IsolateConfigurator::ConfigureCurrentIsolate() { return true; } -// |mozart::NativesDelegate| -void IsolateConfigurator::OfferServiceProvider( - fidl::InterfaceHandle, - fidl::VectorPtr services) { - // TODO(chinmaygarde): Get the mozart view and forward this call to it on the - // right thread. This is currently used for the soft keyboard. - FXL_LOG(ERROR) << "IsolateConfigurator::OfferServiceProvider unimplemented."; -} - void IsolateConfigurator::BindFuchsia() { fuchsia::dart::Initialize(std::move(application_environment_), std::move(outgoing_services_request_)); @@ -98,7 +90,8 @@ void IsolateConfigurator::BindDartIO() { 1, namespace_args)); } -void IsolateConfigurator::BindScenic() { +void IsolateConfigurator::BindScenic( + mozart::NativesDelegate* natives_delegate) { Dart_Handle mozart_internal = Dart_LookupLibrary(tonic::ToDart("dart:mozart.internal")); DART_CHECK_VALID(mozart_internal); @@ -110,7 +103,7 @@ void IsolateConfigurator::BindScenic() { mozart_internal, // tonic::ToDart("_context"), // tonic::DartConverter::ToDart(reinterpret_cast( - static_cast(this))))); + static_cast(natives_delegate))))); DART_CHECK_VALID( Dart_SetField(mozart_internal, // tonic::ToDart("_viewContainer"), // diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h index c66c2351ca49c..dc6995185e4fd 100644 --- a/content_handler/isolate_configurator.h +++ b/content_handler/isolate_configurator.h @@ -17,7 +17,7 @@ namespace flutter { // Contains all the information necessary to configure a new root isolate. This // is a single use item. The lifetime of this object must extend past that of // the root isolate. -class IsolateConfigurator final : mozart::NativesDelegate { +class IsolateConfigurator final { public: IsolateConfigurator( UniqueFDIONS fdio_ns, @@ -31,7 +31,7 @@ class IsolateConfigurator final : mozart::NativesDelegate { // Can be used only once and only on the UI thread with the newly created // isolate already current. - bool ConfigureCurrentIsolate(); + bool ConfigureCurrentIsolate(mozart::NativesDelegate* natives_delegate); private: bool used_ = false; @@ -41,17 +41,13 @@ class IsolateConfigurator final : mozart::NativesDelegate { application_environment_; fidl::InterfaceRequest outgoing_services_request_; - // |mozart::NativesDelegate| - void OfferServiceProvider(fidl::InterfaceHandle, - fidl::VectorPtr services); - void BindFuchsia(); void BindZircon(); void BindDartIO(); - void BindScenic(); + void BindScenic(mozart::NativesDelegate* natives_delegate); FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfigurator); }; diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc index 2531a60473583..611c74f8cb71e 100644 --- a/content_handler/platform_view.cc +++ b/content_handler/platform_view.cc @@ -89,6 +89,12 @@ PlatformView::PlatformView( PlatformView::~PlatformView() = default; +void PlatformView::OfferServiceProvider( + fidl::InterfaceHandle service_provider, + fidl::VectorPtr services) { + view_->OfferServiceProvider(std::move(service_provider), std::move(services)); +} + void PlatformView::RegisterPlatformMessageHandlers() { platform_message_handlers_[kFlutterPlatformChannel] = std::bind(&PlatformView::HandleFlutterPlatformChannelPlatformMessage, // diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h index 32bb83deda11d..50a6544878564 100644 --- a/content_handler/platform_view.h +++ b/content_handler/platform_view.h @@ -45,6 +45,10 @@ class PlatformView final : public shell::PlatformView, fidl::InterfaceHandle TakeViewContainer(); + void OfferServiceProvider( + fidl::InterfaceHandle service_provider, + fidl::VectorPtr services); + private: const std::string debug_label_; views_v1::ViewManagerPtr view_manager_; From a0be8779ffea719307afe28461d9a19345145f6f Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 7 May 2018 18:45:43 -0700 Subject: [PATCH 0271/1190] Make thread names more descriptive. (#5196) The thread on which the runner services `CreateApplication` calls is now called `io.flutter.runner.`. Each application will launch four threads named `.`. `fx shell ps -T` is an easy way to tell which runners are hosting which applications. --- content_handler/application_runner.cc | 42 +++++++++------------------ 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc index 9c8bb575e3fa4..9dfac48e31f90 100644 --- a/content_handler/application_runner.cc +++ b/content_handler/application_runner.cc @@ -12,13 +12,21 @@ #include "flutter/lib/ui/text/font_collection.h" #include "fuchsia_font_manager.h" #include "lib/icu_data/cpp/icu_data.h" +#include "third_party/flutter/runtime/dart_vm.h" #include "third_party/skia/include/core/SkGraphics.h" namespace flutter { -static void SetProcessName(const std::string& process_name) { - zx::process::self().set_property(ZX_PROP_NAME, process_name.c_str(), - process_name.size()); +static void SetProcessName() { + std::stringstream stream; + stream << "io.flutter.runner."; + if (blink::DartVM::IsRunningPrecompiledCode()) { + stream << "aot"; + } else { + stream << "jit"; + } + const auto name = stream.str(); + zx::process::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); } static void SetThreadName(const std::string& thread_name) { @@ -26,25 +34,6 @@ static void SetThreadName(const std::string& thread_name) { thread_name.size()); } -static void SetProcessName(const std::string& label, size_t app_count) { - // Format: "flutter.+" - // "flutter" in case of error. - - const std::string prefix = "flutter."; - const std::string suffix = - app_count == 0 ? "" : "+" + std::to_string(app_count); - - if ((prefix.size() + suffix.size()) > ZX_MAX_NAME_LEN) { - SetProcessName("flutter"); - return; - } - - auto truncated_label = - label.substr(0, ZX_MAX_NAME_LEN - 1 - (prefix.size() + suffix.size())); - - SetProcessName(prefix + truncated_label + suffix); -} - ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) : on_termination_callback_(std::move(on_termination_callback)), host_context_(component::ApplicationContext::CreateFromStartupInfo()) { @@ -54,9 +43,9 @@ ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) SetupGlobalFonts(); - SetProcessName("application_runner", 0); + SetProcessName(); - SetThreadName("io.flutter.application_runner"); + SetThreadName("io.flutter.runner.main"); host_context_->outgoing_services()->AddService( std::bind(&ApplicationRunner::RegisterApplication, this, @@ -87,11 +76,6 @@ void ApplicationRunner::StartApplication( std::move(controller) // controller request ); - // Update the process label so that "ps" will will list the last appication - // started by the runner plus the count of applications hosted by this runner. - SetProcessName(thread_application_pair.second->GetDebugLabel(), - active_applications_.size()); - active_applications_[thread_application_pair.second.get()] = std::move(thread_application_pair); } From 5f08fca0b8b12368fad6be6cb2edfb78be3de8e0 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 7 May 2018 23:49:31 -0400 Subject: [PATCH 0272/1190] Roll src/third_party/skia/ cea8e3d13..6198f39ad (1 commit) (#5197) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 0ecd18445ddb4..e941c4f6fcb53 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cea8e3d1326df16f1eeb41233703bf469016025c', + 'skia_revision': '6198f39adc5cc935c10371d886aa995cc7d5dce3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9dfe8714d5f62..be4b8b82ceeb6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 81817026b7fb9bc1bb25cd5fb4c46dd7 +Signature: e364f64096bbae53a57e592c6e0bfee2 UNUSED LICENSES: From 31922239a90fde9c77f68598da25ef20c0057e55 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 8 May 2018 08:20:31 -0400 Subject: [PATCH 0273/1190] Roll src/third_party/skia/ 6198f39ad..e7df0bb90 (1 commit) (#5198) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e941c4f6fcb53..9bf644451dd1b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6198f39adc5cc935c10371d886aa995cc7d5dce3', + 'skia_revision': 'e7df0bb900ec266021bc6bf4477d533ce1b1f749', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index be4b8b82ceeb6..a48cd7ed50a65 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e364f64096bbae53a57e592c6e0bfee2 +Signature: b32985969f18a1ed3cf128250f2c4e84 UNUSED LICENSES: From 8450a003ee2c9f6488b796944088f1f520928cd0 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Tue, 8 May 2018 08:13:51 -0700 Subject: [PATCH 0274/1190] Roll Skia back to d8a189fca3cdfa064de75a280d5af34cc5026bbe (#5199) To try to isolate regressions identified in golden file testing --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/DEPS b/DEPS index 9bf644451dd1b..ae8a560c88122 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e7df0bb900ec266021bc6bf4477d533ce1b1f749', + 'skia_revision': 'd8a189fca3cdfa064de75a280d5af34cc5026bbe', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a48cd7ed50a65..65b4f2c4d4558 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b32985969f18a1ed3cf128250f2c4e84 +Signature: 7cc17682e6b6e0b68fc9c876eb587159 UNUSED LICENSES: @@ -17165,8 +17165,8 @@ FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.h +FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp +FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.h FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.cpp FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.h FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.cpp @@ -17300,8 +17300,6 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h -FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp @@ -17496,8 +17494,10 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/cross_repo_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/flutter_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/no_persistent_checkout.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/test.json @@ -17521,6 +17521,8 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17604,6 +17606,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json @@ -17647,6 +17650,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Debug-NoGPU.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17660,6 +17665,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Cl FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/alternate_repo.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/flutter_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json @@ -17729,7 +17735,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-CPU-Snapdragon808-arm-Release-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json @@ -17739,8 +17744,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL1_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL3_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json @@ -17748,7 +17751,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SwiftShader.json @@ -19940,7 +19942,6 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzSkottieJSON.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp ---------------------------------------------------------------------------------------------------- From 88989393aaa0c91982fe6eb875bcbd5498f72e24 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Tue, 8 May 2018 08:28:55 -0700 Subject: [PATCH 0275/1190] Roll Skia to e7df0bb900ec266021bc6bf4477d533ce1b1f749 (#5200) --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index ae8a560c88122..9bf644451dd1b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd8a189fca3cdfa064de75a280d5af34cc5026bbe', + 'skia_revision': 'e7df0bb900ec266021bc6bf4477d533ce1b1f749', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 65b4f2c4d4558..a48cd7ed50a65 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7cc17682e6b6e0b68fc9c876eb587159 +Signature: b32985969f18a1ed3cf128250f2c4e84 UNUSED LICENSES: @@ -17165,8 +17165,8 @@ FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.h +FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.cpp +FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.h FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.cpp FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.h FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.cpp @@ -17300,6 +17300,8 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h +FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp @@ -17494,10 +17496,8 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/cross_repo_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/no_persistent_checkout.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/test.json @@ -17521,8 +17521,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17606,7 +17604,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json @@ -17650,8 +17647,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Debug-NoGPU.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17665,7 +17660,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Cl FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/alternate_repo.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json @@ -17735,6 +17729,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-CPU-Snapdragon808-arm-Release-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json @@ -17744,6 +17739,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL1_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL3_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json @@ -17751,6 +17748,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SwiftShader.json @@ -19942,6 +19940,7 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzSkottieJSON.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp ---------------------------------------------------------------------------------------------------- From 2d608653e22aeb0679f933a6a48a5fd0ff0e51bd Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 8 May 2018 12:10:31 -0400 Subject: [PATCH 0276/1190] Roll src/third_party/skia/ e7df0bb90..d925f2d38 (4 commits) (#5202) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9bf644451dd1b..2c2f45f482dd6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e7df0bb900ec266021bc6bf4477d533ce1b1f749', + 'skia_revision': 'd925f2d38dff377b5ef8e3f71410237de80811aa', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a48cd7ed50a65..ad63a9f5551d2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b32985969f18a1ed3cf128250f2c4e84 +Signature: 0ce6d820ddffed32ef6dcd1b0c4d8d92 UNUSED LICENSES: From 61b5028195d9708d989c78d018a32b26d84522e1 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 8 May 2018 11:56:31 -0700 Subject: [PATCH 0277/1190] Read/apply settings that apply process wide before creating any shell components. (#5203) --- shell/common/shell.cc | 59 +++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/shell/common/shell.cc b/shell/common/shell.cc index e508926a98b7a..3359290f2198e 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -155,11 +155,47 @@ static void RecordStartupTimestamp() { } } +// Though there can be multiple shells, some settings apply to all components in +// the process. These have to be setup before the shell or any of its +// sub-components can be initialized. In a perfect world, this would be empty. +// TODO(chinmaygarde): The unfortunate side effect of this call is that settings +// that cause shell initialization failures will still lead to some of their +// settings being applied. +static void PerformInitializationTasks(const blink::Settings& settings) { + static std::once_flag gShellSettingsInitialization = {}; + std::call_once(gShellSettingsInitialization, [&settings] { + RecordStartupTimestamp(); + + fxl::LogSettings log_settings; + log_settings.min_log_level = + settings.verbose_logging ? fxl::LOG_INFO : fxl::LOG_ERROR; + fxl::SetLogSettings(log_settings); + + if (settings.trace_skia) { + InitSkiaEventTracer(settings.trace_skia); + } + + if (!settings.skia_deterministic_rendering_on_cpu) { + SkGraphics::Init(); + } else { + FXL_DLOG(INFO) << "Skia deterministic rendering is enabled."; + } + + if (settings.icu_data_path.size() != 0) { + fml::icu::InitializeICU(settings.icu_data_path); + } else { + FXL_DLOG(WARNING) << "Skipping ICU initialization in the shell."; + } + }); +} + std::unique_ptr Shell::Create( blink::TaskRunners task_runners, blink::Settings settings, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer) { + PerformInitializationTasks(settings); + auto vm = blink::DartVM::ForProcess(settings); FXL_CHECK(vm) << "Must be able to initialize the VM."; return Shell::Create(std::move(task_runners), // @@ -176,12 +212,7 @@ std::unique_ptr Shell::Create( fxl::RefPtr isolate_snapshot, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer) { - RecordStartupTimestamp(); - - fxl::LogSettings log_settings; - log_settings.min_log_level = - settings.verbose_logging ? fxl::LOG_INFO : fxl::LOG_ERROR; - fxl::SetLogSettings(log_settings); + PerformInitializationTasks(settings); if (!task_runners.IsValid() || !on_create_platform_view || !on_create_rasterizer) { @@ -219,22 +250,6 @@ Shell::Shell(blink::TaskRunners task_runners, blink::Settings settings) FXL_DCHECK(task_runners_.IsValid()); FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - if (settings_.icu_data_path.size() != 0) { - fml::icu::InitializeICU(settings_.icu_data_path); - } else { - FXL_DLOG(WARNING) << "Skipping ICU initialization in the shell."; - } - - if (settings_.trace_skia) { - InitSkiaEventTracer(settings_.trace_skia); - } - - if (!settings_.skia_deterministic_rendering_on_cpu) { - SkGraphics::Init(); - } else { - FXL_DLOG(INFO) << "Skia deterministic rendering is enabled."; - } - // Install service protocol handlers. service_protocol_handlers_[blink::ServiceProtocol::kScreenshotExtensionName From 5d4a38c1ee9a84cfe2de79e21e167877696ebba5 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 8 May 2018 15:42:31 -0400 Subject: [PATCH 0278/1190] Roll src/third_party/skia/ d925f2d38..efb84e673 (4 commits) (#5205) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2c2f45f482dd6..16c0596362b0d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd925f2d38dff377b5ef8e3f71410237de80811aa', + 'skia_revision': 'efb84e6734074defa325a27273c8c98903955f52', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ad63a9f5551d2..1c3427f26c40f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0ce6d820ddffed32ef6dcd1b0c4d8d92 +Signature: f547876d2dbbd8022cc9ed0de6872504 UNUSED LICENSES: From 2bc3b3ecf1c6b315d8c80395d287aa8cd5b0baa1 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Tue, 8 May 2018 12:49:51 -0700 Subject: [PATCH 0279/1190] Roll Skia back to d8a189fca3cdfa064de75a280d5af34cc5026bbe (#5204) Attempt #2 at isolating regressions --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/DEPS b/DEPS index 16c0596362b0d..ae8a560c88122 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'efb84e6734074defa325a27273c8c98903955f52', + 'skia_revision': 'd8a189fca3cdfa064de75a280d5af34cc5026bbe', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1c3427f26c40f..65b4f2c4d4558 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f547876d2dbbd8022cc9ed0de6872504 +Signature: 7cc17682e6b6e0b68fc9c876eb587159 UNUSED LICENSES: @@ -17165,8 +17165,8 @@ FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.h +FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp +FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.h FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.cpp FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.h FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.cpp @@ -17300,8 +17300,6 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h -FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp @@ -17496,8 +17494,10 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/cross_repo_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/flutter_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/no_persistent_checkout.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/test.json @@ -17521,6 +17521,8 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17604,6 +17606,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json @@ -17647,6 +17650,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Debug-NoGPU.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17660,6 +17665,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Cl FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/alternate_repo.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/flutter_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json @@ -17729,7 +17735,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-CPU-Snapdragon808-arm-Release-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json @@ -17739,8 +17744,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL1_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL3_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json @@ -17748,7 +17751,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SwiftShader.json @@ -19940,7 +19942,6 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzSkottieJSON.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp ---------------------------------------------------------------------------------------------------- From 11d6da3cd9b9449a0d56c068193f9a0addf89e33 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Tue, 8 May 2018 13:02:06 -0700 Subject: [PATCH 0280/1190] Restore Skia revision (#5206) --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index ae8a560c88122..16c0596362b0d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd8a189fca3cdfa064de75a280d5af34cc5026bbe', + 'skia_revision': 'efb84e6734074defa325a27273c8c98903955f52', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 65b4f2c4d4558..1c3427f26c40f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7cc17682e6b6e0b68fc9c876eb587159 +Signature: f547876d2dbbd8022cc9ed0de6872504 UNUSED LICENSES: @@ -17165,8 +17165,8 @@ FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieParser.h +FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.cpp +FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.h FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.cpp FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.h FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.cpp @@ -17300,6 +17300,8 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h +FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp @@ -17494,10 +17496,8 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/cross_repo_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/no_persistent_checkout.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/test.json @@ -17521,8 +17521,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17606,7 +17604,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json @@ -17650,8 +17647,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Debug-NoGPU.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-PDFium_SkiaPaths.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Shared.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -17665,7 +17660,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Cl FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/alternate_repo.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/pdfium_trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json @@ -17735,6 +17729,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-CPU-Snapdragon808-arm-Release-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json @@ -17744,6 +17739,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL1_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL3_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json @@ -17751,6 +17748,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SwiftShader.json @@ -19942,6 +19940,7 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzSkottieJSON.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp ---------------------------------------------------------------------------------------------------- From f64f64eee486a216b3ba516438915eff34b52fe3 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 8 May 2018 13:10:23 -0700 Subject: [PATCH 0281/1190] Tear down the shell before terminating message loops on host threads. (#5207) Shell teardown is synchronous. The shell was attempting to destroy components on a quitting message loop. The message loop implementation was executing such tasks on the calling thread which the shell does not consider thread safe. --- content_handler/engine.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 0124e270647e4..9cc528b9ad164 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -215,6 +215,7 @@ Engine::Engine(Delegate& delegate, } Engine::~Engine() { + shell_.reset(); for (const auto& thread : host_threads_) { thread.TaskRunner()->PostTask( []() { fsl::MessageLoop::GetCurrent()->PostQuitTask(); }); From eb4cbce160cdcb396f5bb9a7f3190c86f9722e7c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 8 May 2018 19:11:52 -0400 Subject: [PATCH 0282/1190] Roll src/third_party/skia/ efb84e673..8a8a14495 (3 commits) (#5208) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 16c0596362b0d..36d405070d3fa 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'efb84e6734074defa325a27273c8c98903955f52', + 'skia_revision': '8a8a1449526cce423d2e76fb69a8151f49135a5a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1c3427f26c40f..4411a4c4c68df 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f547876d2dbbd8022cc9ed0de6872504 +Signature: 210ee964c4a5e4ea4e6a61444fd44346 UNUSED LICENSES: From 4fa6be7cee26076a2559c5aaa2b8bebefcb855fb Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 8 May 2018 16:20:42 -0700 Subject: [PATCH 0283/1190] Fix channel encoding errors on the IME client. (#5209) --- content_handler/platform_view.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc index 611c74f8cb71e..e62f9e44ac855 100644 --- a/content_handler/platform_view.cc +++ b/content_handler/platform_view.cc @@ -507,10 +507,12 @@ void PlatformView::HandleFlutterTextInputChannelPlatformMessage( // TODO(abarth): Read the keyboard type from the configuration. current_text_input_client_ = args->value[0].GetInt(); + auto initial_text_input_state = input::TextInputState{}; + initial_text_input_state.text = ""; input_connection_->GetInputMethodEditor( input::KeyboardType::TEXT, // keyboard type input::InputMethodAction::DONE, // input method action - input::TextInputState{}, // initial state + initial_text_input_state, // initial state ime_client_.NewBinding(), // client ime_.NewRequest() // editor ); @@ -522,6 +524,7 @@ void PlatformView::HandleFlutterTextInputChannelPlatformMessage( } const auto& args = args_it->value; input::TextInputState state; + state.text = ""; // TODO(abarth): Deserialize state. auto text = args.FindMember("text"); if (text != args.MemberEnd() && text->value.IsString()) From a9de8216586142750a69d9ad28b60ad9fb5bdd12 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 8 May 2018 22:39:31 -0400 Subject: [PATCH 0284/1190] Roll src/third_party/skia/ 8a8a14495..499a9b210 (3 commits; 1 trivial rolls) (#5211) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 36d405070d3fa..f61e85a00cea5 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8a8a1449526cce423d2e76fb69a8151f49135a5a', + 'skia_revision': '499a9b21087eaa52e53db565f32ff77494c0c3cc', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4411a4c4c68df..aaa71d3db83f5 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 210ee964c4a5e4ea4e6a61444fd44346 +Signature: 4aa43a2d95d7ea50ffb31f904ca9896f UNUSED LICENSES: From ee6a718f97258a31c4f730b11438cac4ab65d38f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 9 May 2018 02:11:52 -0400 Subject: [PATCH 0285/1190] Roll src/third_party/skia/ 499a9b210..a2595f925 (1 commit) (#5212) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f61e85a00cea5..10d2e102fb1fb 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '499a9b21087eaa52e53db565f32ff77494c0c3cc', + 'skia_revision': 'a2595f925596aca234d4ac4e35da689ef13cc27c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index aaa71d3db83f5..c250ba079091e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4aa43a2d95d7ea50ffb31f904ca9896f +Signature: 4771329bcd50524efabf2914e0072361 UNUSED LICENSES: From 19af6717b50241f2bfa97b8fcd0949f548270a38 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 9 May 2018 10:57:56 -0400 Subject: [PATCH 0286/1190] Roll src/third_party/skia/ a2595f925..1c2bcd8b1 (1 commit) (#5213) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 10d2e102fb1fb..ea4cca9d599f3 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a2595f925596aca234d4ac4e35da689ef13cc27c', + 'skia_revision': '1c2bcd8b14e029a70e88b1e81acd29553cab0d1c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c250ba079091e..622c3f5779b73 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4771329bcd50524efabf2914e0072361 +Signature: 629b1b0d53c77901d254afba962b18a9 UNUSED LICENSES: From 2b9c280e241a6317e9b5e6e2d1eff645d53ef79f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 9 May 2018 14:16:56 -0400 Subject: [PATCH 0287/1190] Roll src/third_party/skia/ 1c2bcd8b1..cb8b5d110 (12 commits; 1 trivial rolls) (#5214) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ea4cca9d599f3..216099f2bab91 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1c2bcd8b14e029a70e88b1e81acd29553cab0d1c', + 'skia_revision': 'cb8b5d1101d0a1bf7c78f3d1fec73afbe470994c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 622c3f5779b73..3ca7d7a1021fb 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 629b1b0d53c77901d254afba962b18a9 +Signature: 0cb4c7cf78c21058a65189b52424a6c3 UNUSED LICENSES: From 11d50441a6bb97ccda3815a811de0883d490f869 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 9 May 2018 11:36:52 -0700 Subject: [PATCH 0288/1190] Provide an SkPaint that describes the background of a text style (#5153) Fixes https://github.com/flutter/flutter/issues/11961 --- lib/ui/painting/paint.cc | 70 ++++++++++++++-------------- lib/ui/painting/paint.h | 5 +- lib/ui/text.dart | 24 +++++++--- lib/ui/text/paragraph_builder.cc | 14 +++++- lib/ui/text/paragraph_builder.h | 5 +- third_party/txt/src/txt/paragraph.cc | 12 +++++ third_party/txt/src/txt/paragraph.h | 3 ++ third_party/txt/src/txt/text_style.h | 3 ++ 8 files changed, 93 insertions(+), 43 deletions(-) diff --git a/lib/ui/painting/paint.cc b/lib/ui/painting/paint.cc index b61a48c351fda..2bb02b18bfe70 100644 --- a/lib/ui/painting/paint.cc +++ b/lib/ui/painting/paint.cc @@ -12,9 +12,7 @@ #include "third_party/skia/include/core/SkShader.h" #include "third_party/skia/include/core/SkString.h" -using namespace blink; - -namespace tonic { +namespace blink { // Indices for 32bit values. constexpr int kIsAntiAliasIndex = 0; @@ -52,17 +50,10 @@ constexpr double kStrokeMiterLimitDefault = 4.0; // Must be kept in sync with the MaskFilter private constants in painting.dart. enum MaskFilterType { Null, Blur }; -Paint DartConverter::FromArguments(Dart_NativeArguments args, - int index, - Dart_Handle& exception) { - Dart_Handle paint_objects = Dart_GetNativeArgument(args, index); - FXL_DCHECK(!LogIfError(paint_objects)); - - Dart_Handle paint_data = Dart_GetNativeArgument(args, index + 1); - FXL_DCHECK(!LogIfError(paint_data)); - - Paint result; - SkPaint& paint = result.paint_; +Paint::Paint(Dart_Handle paint_objects, Dart_Handle paint_data) { + is_null_ = Dart_IsNull(paint_data); + if (is_null_) + return; if (!Dart_IsNull(paint_objects)) { FXL_DCHECK(Dart_IsList(paint_objects)); @@ -72,12 +63,12 @@ Paint DartConverter::FromArguments(Dart_NativeArguments args, FXL_CHECK(length == kObjectCount); Dart_Handle values[kObjectCount]; if (Dart_IsError(Dart_ListGetRange(paint_objects, 0, kObjectCount, values))) - return result; + return; Dart_Handle shader = values[kShaderIndex]; if (!Dart_IsNull(shader)) { - Shader* decoded = DartConverter::FromDart(shader); - paint.setShader(decoded->shader()); + Shader* decoded = tonic::DartConverter::FromDart(shader); + paint_.setShader(decoded->shader()); } } @@ -87,49 +78,49 @@ Paint DartConverter::FromArguments(Dart_NativeArguments args, const uint32_t* uint_data = static_cast(byte_data.data()); const float* float_data = static_cast(byte_data.data()); - paint.setAntiAlias(uint_data[kIsAntiAliasIndex] == 0); + paint_.setAntiAlias(uint_data[kIsAntiAliasIndex] == 0); uint32_t encoded_color = uint_data[kColorIndex]; if (encoded_color) { SkColor color = encoded_color ^ kColorDefault; - paint.setColor(color); + paint_.setColor(color); } uint32_t encoded_blend_mode = uint_data[kBlendModeIndex]; if (encoded_blend_mode) { uint32_t blend_mode = encoded_blend_mode ^ kBlendModeDefault; - paint.setBlendMode(static_cast(blend_mode)); + paint_.setBlendMode(static_cast(blend_mode)); } uint32_t style = uint_data[kStyleIndex]; if (style) - paint.setStyle(static_cast(style)); + paint_.setStyle(static_cast(style)); float stroke_width = float_data[kStrokeWidthIndex]; if (stroke_width != 0.0) - paint.setStrokeWidth(stroke_width); + paint_.setStrokeWidth(stroke_width); uint32_t stroke_cap = uint_data[kStrokeCapIndex]; if (stroke_cap) - paint.setStrokeCap(static_cast(stroke_cap)); + paint_.setStrokeCap(static_cast(stroke_cap)); uint32_t stroke_join = uint_data[kStrokeJoinIndex]; if (stroke_join) - paint.setStrokeJoin(static_cast(stroke_join)); + paint_.setStrokeJoin(static_cast(stroke_join)); float stroke_miter_limit = float_data[kStrokeMiterLimitIndex]; if (stroke_miter_limit != 0.0) - paint.setStrokeMiter(stroke_miter_limit + kStrokeMiterLimitDefault); + paint_.setStrokeMiter(stroke_miter_limit + kStrokeMiterLimitDefault); uint32_t filter_quality = uint_data[kFilterQualityIndex]; if (filter_quality) - paint.setFilterQuality(static_cast(filter_quality)); + paint_.setFilterQuality(static_cast(filter_quality)); if (uint_data[kColorFilterIndex]) { SkColor color = uint_data[kColorFilterColorIndex]; SkBlendMode blend_mode = static_cast(uint_data[kColorFilterBlendModeIndex]); - paint.setColorFilter(SkColorFilter::MakeModeFilter(color, blend_mode)); + paint_.setColorFilter(SkColorFilter::MakeModeFilter(color, blend_mode)); } switch (uint_data[kMaskFilterIndex]) { @@ -139,18 +130,29 @@ Paint DartConverter::FromArguments(Dart_NativeArguments args, SkBlurStyle blur_style = static_cast(uint_data[kMaskFilterBlurStyleIndex]); double sigma = float_data[kMaskFilterSigmaIndex]; - paint.setMaskFilter(SkMaskFilter::MakeBlur(blur_style, sigma)); + paint_.setMaskFilter(SkMaskFilter::MakeBlur(blur_style, sigma)); break; } +} + +} // namespace blink + +namespace tonic { + +blink::Paint DartConverter::FromArguments( + Dart_NativeArguments args, int index, Dart_Handle& exception) { + Dart_Handle paint_objects = Dart_GetNativeArgument(args, index); + FXL_DCHECK(!LogIfError(paint_objects)); + + Dart_Handle paint_data = Dart_GetNativeArgument(args, index + 1); + FXL_DCHECK(!LogIfError(paint_data)); - result.is_null_ = false; - return result; + return blink::Paint(paint_objects, paint_data); } -PaintData DartConverter::FromArguments(Dart_NativeArguments args, - int index, - Dart_Handle& exception) { - return PaintData(); +blink::PaintData DartConverter::FromArguments( + Dart_NativeArguments args, int index, Dart_Handle& exception) { + return blink::PaintData(); } } // namespace tonic diff --git a/lib/ui/painting/paint.h b/lib/ui/painting/paint.h index f107dd206f13c..29a0d359d2d37 100644 --- a/lib/ui/painting/paint.h +++ b/lib/ui/painting/paint.h @@ -12,13 +12,16 @@ namespace blink { class Paint { public: + Paint() = default; + Paint(Dart_Handle paint_objects, Dart_Handle paint_data); + const SkPaint* paint() const { return is_null_ ? nullptr : &paint_; } private: friend struct tonic::DartConverter; SkPaint paint_; - bool is_null_; + bool is_null_ = true; }; // The PaintData argument is a placeholder to receive encoded data for Paint diff --git a/lib/ui/text.dart b/lib/ui/text.dart index 7c42c878a9e55..ff623068acd6b 100644 --- a/lib/ui/text.dart +++ b/lib/ui/text.dart @@ -257,6 +257,7 @@ Int32List _encodeTextStyle( double wordSpacing, double height, Locale locale, + Paint background, ) { final Int32List result = new Int32List(8); if (color != null) { @@ -311,6 +312,10 @@ Int32List _encodeTextStyle( result[0] |= 1 << 13; // Passed separately to native. } + if (background != null) { + result[0] |= 1 << 14; + // Passed separately to native. + } return result; } @@ -331,6 +336,7 @@ class TextStyle { /// * `textBaseline`: The common baseline that should be aligned between this text span and its parent text span, or, for the root text spans, with the line box. /// * `height`: The height of this text span, as a multiple of the font size. /// * `locale`: The locale used to select region-specific glyphs. + /// * `background`: The paint drawn as a background for the text. TextStyle({ Color color, TextDecoration decoration, @@ -345,6 +351,7 @@ class TextStyle { double wordSpacing, double height, Locale locale, + Paint background, }) : _encoded = _encodeTextStyle( color, decoration, @@ -359,13 +366,15 @@ class TextStyle { wordSpacing, height, locale, + background, ), _fontFamily = fontFamily ?? '', _fontSize = fontSize, _letterSpacing = letterSpacing, _wordSpacing = wordSpacing, _height = height, - _locale = locale; + _locale = locale, + _background = background; final Int32List _encoded; final String _fontFamily; @@ -374,6 +383,7 @@ class TextStyle { final double _wordSpacing; final double _height; final Locale _locale; + final Paint _background; @override bool operator ==(dynamic other) { @@ -387,7 +397,8 @@ class TextStyle { _letterSpacing != typedOther._letterSpacing || _wordSpacing != typedOther._wordSpacing || _height != typedOther._height || - _locale != typedOther._locale) + _locale != typedOther._locale || + _background != typedOther._background) return false; for (int index = 0; index < _encoded.length; index += 1) { if (_encoded[index] != typedOther._encoded[index]) @@ -397,7 +408,7 @@ class TextStyle { } @override - int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _letterSpacing, _wordSpacing, _height, _locale); + int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _letterSpacing, _wordSpacing, _height, _locale, _background); @override String toString() { @@ -414,7 +425,8 @@ class TextStyle { 'letterSpacing: ${ _encoded[0] & 0x0400 == 0x0400 ? "${_letterSpacing}x" : "unspecified"}, ' 'wordSpacing: ${ _encoded[0] & 0x0800 == 0x0800 ? "${_wordSpacing}x" : "unspecified"}, ' 'height: ${ _encoded[0] & 0x1000 == 0x1000 ? "${_height}x" : "unspecified"}, ' - 'locale: ${ _encoded[0] & 0x2000 == 0x2000 ? _locale : "unspecified"}' + 'locale: ${ _encoded[0] & 0x2000 == 0x2000 ? _locale : "unspecified"}, ' + 'background: ${ _encoded[0] & 0x4000 == 0x4000 ? _background : "unspecified"}' ')'; } } @@ -1013,8 +1025,8 @@ class ParagraphBuilder extends NativeFieldWrapperClass2 { /// Applies the given style to the added text until [pop] is called. /// /// See [pop] for details. - void pushStyle(TextStyle style) => _pushStyle(style._encoded, style._fontFamily, style._fontSize, style._letterSpacing, style._wordSpacing, style._height, _encodeLocale(style._locale)); - void _pushStyle(Int32List encoded, String fontFamily, double fontSize, double letterSpacing, double wordSpacing, double height, String locale) native 'ParagraphBuilder_pushStyle'; + void pushStyle(TextStyle style) => _pushStyle(style._encoded, style._fontFamily, style._fontSize, style._letterSpacing, style._wordSpacing, style._height, _encodeLocale(style._locale), style._background?._objects, style._background?._data); + void _pushStyle(Int32List encoded, String fontFamily, double fontSize, double letterSpacing, double wordSpacing, double height, String locale, List backgroundObjects, ByteData backgroundData) native 'ParagraphBuilder_pushStyle'; static String _encodeLocale(Locale locale) => locale?.toString() ?? ''; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index b987e3fde6272..36cf84e027e99 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -42,6 +42,7 @@ const int tsLetterSpacingIndex = 10; const int tsWordSpacingIndex = 11; const int tsHeightIndex = 12; const int tsLocaleIndex = 13; +const int tsBackgroundIndex = 14; const int tsColorMask = 1 << tsColorIndex; const int tsTextDecorationMask = 1 << tsTextDecorationIndex; @@ -56,6 +57,7 @@ const int tsLetterSpacingMask = 1 << tsLetterSpacingIndex; const int tsWordSpacingMask = 1 << tsWordSpacingIndex; const int tsHeightMask = 1 << tsHeightIndex; const int tsLocaleMask = 1 << tsLocaleIndex; +const int tsBackgroundMask = 1 << tsBackgroundIndex; // ParagraphStyle @@ -290,7 +292,9 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, double letterSpacing, double wordSpacing, double height, - const std::string& locale) { + const std::string& locale, + Dart_Handle background_objects, + Dart_Handle background_data) { FXL_DCHECK(encoded.num_elements() == 8); int32_t mask = encoded[0]; @@ -351,6 +355,14 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, style.locale = locale; } + if (mask & tsBackgroundMask) { + Paint background(background_objects, background_data); + if (background.paint()) { + style.has_background = true; + style.background = *background.paint(); + } + } + m_paragraphBuilder->PushStyle(style); } else { // Blink Version. diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 1c38d98696def..9a600f064e0cd 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -6,6 +6,7 @@ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_BUILDER_H_ #include +#include "flutter/lib/ui/painting/paint.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/sky/engine/core/rendering/RenderObject.h" #include "flutter/sky/engine/wtf/OwnPtr.h" @@ -43,7 +44,9 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double letterSpacing, double wordSpacing, double height, - const std::string& locale); + const std::string& locale, + Dart_Handle background_objects, + Dart_Handle background_data); void pop(); diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index f75c4a0aeae5f..743abdac1d9d6 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -862,6 +862,7 @@ void Paragraph::Paint(SkCanvas* canvas, double x, double y) { for (const PaintRecord& record : records_) { paint.setColor(record.style().color); SkPoint offset = record.offset(); + PaintBackground(canvas, record); canvas->drawTextBlob(record.text(), offset.x(), offset.y(), paint); PaintDecorations(canvas, record); } @@ -1026,6 +1027,17 @@ void Paragraph::PaintDecorations(SkCanvas* canvas, const PaintRecord& record) { } } +void Paragraph::PaintBackground(SkCanvas* canvas, const PaintRecord& record) { + if (!record.style().has_background) + return; + + const SkPaint::FontMetrics& metrics = record.metrics(); + SkRect rect(SkRect::MakeLTRB(0, metrics.fAscent, + record.GetRunWidth(), metrics.fDescent)); + rect.offset(record.offset()); + canvas->drawRect(rect, record.style().background); +} + std::vector Paragraph::GetRectsForRange(size_t start, size_t end) const { std::map> line_boxes; diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index 454cdc9aca47b..894439abc5965 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -310,6 +310,9 @@ class Paragraph { // Creates and draws the decorations onto the canvas. void PaintDecorations(SkCanvas* canvas, const PaintRecord& record); + // Draws the background onto the canvas. + void PaintBackground(SkCanvas* canvas, const PaintRecord& record); + FXL_DISALLOW_COPY_AND_ASSIGN(Paragraph); }; diff --git a/third_party/txt/src/txt/text_style.h b/third_party/txt/src/txt/text_style.h index 0a57cc7c681a0..2b995132a36d7 100644 --- a/third_party/txt/src/txt/text_style.h +++ b/third_party/txt/src/txt/text_style.h @@ -24,6 +24,7 @@ #include "text_baseline.h" #include "text_decoration.h" #include "third_party/skia/include/core/SkColor.h" +#include "third_party/skia/include/core/SkPaint.h" namespace txt { @@ -46,6 +47,8 @@ class TextStyle { double word_spacing = 0.0; double height = 1.0; std::string locale; + bool has_background = false; + SkPaint background; TextStyle(); From 6a3d6542569c3668ba7f14e90beed4f7d58ab961 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 9 May 2018 11:42:44 -0700 Subject: [PATCH 0289/1190] libtxt: in GetRectsForRange, add placeholders only for newline characters (#5157) If the range passed to GetRectsForRange includes a newline character, then the framework expects to see a rectangle representing the newline so it knows where to position the cursor at the end of the line. If the range covers other non-printing characters but not the newline, then GetRectsForRange should not produce a rectangle for the line. --- third_party/txt/src/txt/paragraph.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index 743abdac1d9d6..d5b6124a3cf1d 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -1072,8 +1072,7 @@ std::vector Paragraph::GetRectsForRange(size_t start, SkRect::MakeLTRB(left, top, right, bottom), run.direction); } - // Add empty rectangles representing any line within the range that did not - // render any glyphs. + // Add empty rectangles representing any newline characters within the range. for (size_t line_number = 0; line_number < line_ranges_.size(); ++line_number) { const LineRange& line = line_ranges_[line_number]; if (line.start >= end) @@ -1081,14 +1080,14 @@ std::vector Paragraph::GetRectsForRange(size_t start, if (line.end_including_newline <= start) continue; if (line_boxes.find(line_number) == line_boxes.end()) { - // If the range starts after the beginning of this line, then place the - // rectangle at the end of the line's width. This is intended to - // handle ranges encompassing the newline character at the end of a line. - SkScalar x = (start > line.start) ? line_widths_[line_number] : 0; - SkScalar top = (line_number > 0) ? line_heights_[line_number - 1] : 0; - SkScalar bottom = line_heights_[line_number]; - line_boxes[line_number].emplace_back( - SkRect::MakeLTRB(x, top, x, bottom), TextDirection::ltr); + if (line.end != line.end_including_newline && + line.end >= start && line.end_including_newline <= end) { + SkScalar x = line_widths_[line_number]; + SkScalar top = (line_number > 0) ? line_heights_[line_number - 1] : 0; + SkScalar bottom = line_heights_[line_number]; + line_boxes[line_number].emplace_back( + SkRect::MakeLTRB(x, top, x, bottom), TextDirection::ltr); + } } } From 3327bca4aff539afb5ef7261407698be094a202f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 9 May 2018 16:22:18 -0400 Subject: [PATCH 0290/1190] Roll src/third_party/skia/ cb8b5d110..e0dc9432d (15 commits) (#5215) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 216099f2bab91..f07b9cdee6273 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cb8b5d1101d0a1bf7c78f3d1fec73afbe470994c', + 'skia_revision': 'e0dc9432d8836ec34a3ef90eabc39eadc3d1db90', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3ca7d7a1021fb..bcb860d6f8c9d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0cb4c7cf78c21058a65189b52424a6c3 +Signature: c1893321e39f99d7d6dcae1ab6433a4f UNUSED LICENSES: @@ -17251,8 +17251,14 @@ FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.h FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h From e9fb4761a69bf73fe316034394cfab05fa8ccdb1 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 9 May 2018 13:43:27 -0700 Subject: [PATCH 0291/1190] [fuchsia] Add dependencies needed to build the test shell. (#5216) --- shell/testing/BUILD.gn | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index f11a3a2d07501..36bc9acc452ed 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -21,10 +21,19 @@ executable("testing") { "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", + "//third_party/dart/runtime/bin:libdart_builtin", + "//third_party/dart/runtime/platform:libdart_platform", "//third_party/skia", "//topaz/lib/tonic", ] + if (is_fuchsia) { + deps += [ + "//garnet/public/lib/ui/scenic:client", + "//zircon/public/lib/trace-provider", + ] + } + if (is_linux) { ldflags = [ "-rdynamic" ] } From 6c8204f2fe0386a3a769cbecc6bc578cdccaec92 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 9 May 2018 15:39:23 -0700 Subject: [PATCH 0292/1190] Revert "Roll skia cb8b5d110..e0dc9432d (15 commits)" (#5217) --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index f07b9cdee6273..216099f2bab91 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e0dc9432d8836ec34a3ef90eabc39eadc3d1db90', + 'skia_revision': 'cb8b5d1101d0a1bf7c78f3d1fec73afbe470994c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index bcb860d6f8c9d..3ca7d7a1021fb 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c1893321e39f99d7d6dcae1ab6433a4f +Signature: 0cb4c7cf78c21058a65189b52424a6c3 UNUSED LICENSES: @@ -17251,14 +17251,8 @@ FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.h FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h From 3dff7eaeb53be826031344473641ebd77f99fe5a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 9 May 2018 22:25:56 -0400 Subject: [PATCH 0293/1190] Roll src/third_party/skia/ cb8b5d110..27c66e28e (22 commits; 2 trivial rolls) (#5219) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 216099f2bab91..bebf6087bd30a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cb8b5d1101d0a1bf7c78f3d1fec73afbe470994c', + 'skia_revision': '27c66e28e1d4347b9ffed56c40f1554c7698c544', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3ca7d7a1021fb..49161fbce2342 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0cb4c7cf78c21058a65189b52424a6c3 +Signature: dcdf8ba9c7cc1468fdd85832dfdf82ff UNUSED LICENSES: @@ -17251,8 +17251,14 @@ FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.h FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h From 1499adb48c3c005d22ab9ecb27b6dd0924380e49 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 10 May 2018 01:55:56 -0400 Subject: [PATCH 0294/1190] Roll src/third_party/skia/ 27c66e28e..baf831d07 (2 commits; 1 trivial rolls) (#5221) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index bebf6087bd30a..6f80caab63b91 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '27c66e28e1d4347b9ffed56c40f1554c7698c544', + 'skia_revision': 'baf831d074e7b5b5cf15aabf80ddf7d98c05a957', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 49161fbce2342..66e369964d2c7 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: dcdf8ba9c7cc1468fdd85832dfdf82ff +Signature: ecacee63ce32b6ae681b3b2befb4403b UNUSED LICENSES: From d2ba854650b0cd0a93bd6c33e08ebc5c17595341 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 10 May 2018 05:07:56 -0400 Subject: [PATCH 0295/1190] Roll src/third_party/skia/ baf831d07..d31b2f674 (1 commit) (#5222) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 6f80caab63b91..ac5901bf00453 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'baf831d074e7b5b5cf15aabf80ddf7d98c05a957', + 'skia_revision': 'd31b2f674acc24b44fe68cea872109d96da4c796', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 22bb40c780578c475ff4b68026eb1809bc873415 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 10 May 2018 09:24:56 -0400 Subject: [PATCH 0296/1190] Roll src/third_party/skia/ d31b2f674..21015b700 (1 commit) (#5223) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ac5901bf00453..bc777455b2a6f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd31b2f674acc24b44fe68cea872109d96da4c796', + 'skia_revision': '21015b7004248c46233f1678eeaba69223d68769', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 66e369964d2c7..96ac752ba4e3d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ecacee63ce32b6ae681b3b2befb4403b +Signature: de82347b6084efaaf376430153257032 UNUSED LICENSES: From cb1b9c5c42931acb3fbb551e20c1ca66c1910eef Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 10 May 2018 12:52:56 -0400 Subject: [PATCH 0297/1190] Roll src/third_party/skia/ 21015b700..f31fece65 (12 commits) (#5225) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 74 ++++++++++----------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/DEPS b/DEPS index bc777455b2a6f..b25e3d951d1b8 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '21015b7004248c46233f1678eeaba69223d68769', + 'skia_revision': 'f31fece6581a46b40403fc78c83c7eebe50816ba', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 96ac752ba4e3d..f57f2d2746a06 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: de82347b6084efaaf376430153257032 +Signature: ee1af487941cb16b5491caf536dd0d96 UNUSED LICENSES: @@ -17209,6 +17209,7 @@ FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h +FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h @@ -17242,7 +17243,6 @@ FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp FILE: ../../../third_party/skia/src/gpu/GrDDLContext.cpp FILE: ../../../third_party/skia/src/gpu/GrDirectContext.cpp FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.cpp -FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.h FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h @@ -20478,6 +20478,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/include/utils/SkEventTracer.h + ../../../third_party/skia/LICENSE @@ -20924,41 +20959,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkaroundsAutogen.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp + ../../../third_party/skia/LICENSE From 37e20af6a324cd4cfa1324b8c644712ef8224359 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 10 May 2018 11:13:36 -0700 Subject: [PATCH 0298/1190] Roll Dart to 779dc6eb85c1f2249803d017ffa785c85681ad1b (#5224) This roll includes the following Dart SDK commits: 779dc6eb85 Stop leaking file descriptors for HTTP clients b294e48bdf Hack to fix sort order 5951f1e4f1 Improve enum declaration identifier recovery 1860096702 Use correct type arguments for Forest. 6e15762556 Bump to linter 0.1.50 e5820f7e94 Place generator body in same unit as entry 41fcbd097c [VM runtime] Initial version of Kernel Bytecode interpreter in VM runtime. Not fully working yet, only x64, no gc, no frame walking, etc... a4772ea629 Refer to Expression and Statement via prefix 310745ca8b Add support for adding missing named parameters to constructors. e8c8557fcb Switch the fix for adding not named required/positional parameter to using _ExecutableParameters. fa071e8ecb Update AstBuildingForest tests bedf640eca Address review comments from previous CLs 2d95c54392 CHANGELOG for cast/retype changes 6efd3b3654 Refactor output code for generators e67222a92b [vm/compiler] Do not use call->ArgumentAt(0) to access receiver. 5afa2dca51 [dart:io] Fix ProcessStartMode.values a49fd95d59 [CHANGELOG] Update for dart:io constant rename 3ec1b929e3 Remove dependencies on isolates. 2ad715e706 [vm/hr] Directly compare type arguments count when validate hot reload. 8dbe716085 Remove the unused GenericCovariantInterface bit f61e1c0fb3 Mark metadata_test as failing on dart_precompiled 24224ced5b [VM] Update status file, test became much slower after strong-mode changes to mirrors implementation a8364e3412 Add missing method to FastaParserTestCase b5154dd01e Revert "[vm/kernel] Expression execution through Kernel. 2daa5610ac Add more issue numbers to fasta status file b25e12ddc6 [fasta] Remove BuiltTypeBuilder afd0a52a5a [vm/kernel] Expression execution through Kernel. 41eb5ddfdc Add some issue numbers to fasta status file df9af04061 Remove CompilerOptions.useKernel 972d4b0b1d Add frontendInternal key and external example to messages tests ee0a2cd8bc Restore type arguments on Forest a65dc90bd0 Improve error message for invalid characters fe3f87f192 [fasta] Reland "Handle annotations on formals and variables" 4c7926107e Remove support for --use-old-frontend option 039e8a1755 [vm/kernel] Enable kernel2kernel "constants" transformation in AOT mode (after running TFA) 2f781e46b0 Introduced support for metadata on enum values 862a894de6 Make `cast` do the same things as `retype`. b347839ee6 Remove impact_test 3adb731af3 Remove id equivalence test and ast id helpers d0112f4431 Remove old frontend equivalence tests 17e22dfcd3 Remove unneeded kernel tests and sourcemap old-frontend tests a0d3bef5fb [release] Prepare changelog for 2.0.0-dev.54.0 2f924e457e Revert "[infra] Temporarily remove windows builder from the CQ" fd9823ae9e Issue 21965. Add Quick Fix for adding missing named parameter. 964dae472c Issue 30577. Use AST to find position for the first directive. 74d03e7a75 Add a test that reproduces hot reload issue when class type arguments change. 3beb7fe860 Fix how we pass the type-parameter to StreamIterator in for-in cc034472bb Fix LineInfo.getOffsetOfLineAfter(). f2b137343c Do not run analyzer benchmarks in checked mode. 702aca4ab1 [vm] Address TODOs for warn on unused result. ac6ea06fd2 [dart:io] Switch ProcessStartMode back to an enum 0bab7e6bfa Issue 32765. Improve guess for type name identifier. b73541cffe Add a skeleton for Dart Folding ebcf5bec30 Update Analyzer/CFE type resolution test to use AstBuildingForest 316b10216f Fix Analyzer warning 1d8620044a Call computeTypeVar rather than parseTypeArguments when parsing expressions 8f6c6c2a8e Implement some missing override checking 2296f9d637 Run transformations on expression compilation. c9cd32fb58 Clean up Forest.literalList and Forest.literalMap 2ccafe7a54 [kernel] Change dill representation of doubles 51fa3f3b0c Decouple HNode from TypeMask d3c7df35b4 Revive AbstractValueDomain 03abbc73d2 CFE support for expression evaluation, refactored. 054559c5f3 Revert "CFE support for compiling individual expressions in a context." 95fab34cdf [infra] Temporarily remove windows builder from the CQ 4f586e265e [fasta] Update expectation files after CL 50941 9c6c3dcd89 [fasta] Store calculated bounds of type variables as their defaults 831a6ba598 Remove useOldFrontend testing from various tests 9bac9ee596 Remove useOldFrontend from compiler_helper 4b53f7e0d2 Remove useOldFrontend testing from TypeEnvironment 8e885f4393 Remove CompileMode 27ae11e4d8 Filter instantiation stubs 2e1c17e5c1 Revert "dump-info: Use relative paths for library canonicalUri..." e10f0717d2 fix test status for a few tests changed in 3002e47e 95c29e6fb0 First cut test for Analyzer/BodyBuilder integration test b017db1e8c [corelib_2 tests] Bigint computations are slow on simulated architectures. An added regression test for modPow increased computation time. 446668e95c Add required information for three more cases 3002e47e36 cleanup language_2 and corelib_2 tests that import dart:mirrors 4da831fd3a Latest pub_semver 179b31c157 Allow built-in identifiers for non-type entities, with a warning. 603d832371 Test for sync* checks d87642df9c fix #33036, dartdevk now uses CFE for patching its SDK 1b8a3b1045 Implement support for overridden elements that are declared in mixins. 6c301a4e32 Bring in the latest pub e62dd0157e [VM bigint] Fix padding length in Montgomery Reduction (fixes #32626). Add regression test to existing bigint test. 8515d74332 Add ImportElement.namespace and use it in completion. 410db09743 Do not convert the worker object in jsinterop, just like we do for window f62302b8ee Make extracted widgets follow Flutter style - const constructor and @required named parameters. d624b8580a Add DartEditBuilder.writeReference(). 2dd6aba0f4 Add the analyzer implementation of Forest 65d7bf8152 [vm] Align 64-bit atomic variables for 32-bit iOS. de59cdf498 [VM] Fix for issue 33027 (Fixes strong mode runtime error in _FileSystemWatcher 3192d0052c Start adding parameters needed by analyzer 86ccd4f790 Fix poor error messages on null dereference 92f50475b8 Issue 32849. Use export namespace for import prefix and combinator completions. 66412a28f2 Use %systemroot% instead of hardcoded 'C:\Windows' a06b1d96cb Revert "[VM] Reduce Smi size to 32 bit on 64 bit platforms" 89e43b4141 [fasta] Normalize type arguments as in Dart 1 when not in strong mode dffbbad8a5 [gardening] Fix analyzer warning on regress_33040_instantiation_test a6b6d6a608 [VM] Remove converted closure function code from the VM 56e47e6b2d Fix analyzer on #33040 regression test. 235b81d045 Remove MockCompiler b74bb147ce Remove use of MockCompiler from type_test_helper 3cd0a1f5e4 Remove old_frontend and mirrors tests add1e67295 Include generic type arguments in deferred load computation. 296ab86012 Revert "Add DartEditBuilder.writeTopLevelElementReference()." e9e0166375 Add regression test for #33040 772c9bb5f3 [vm/kernel] Re-land partial instantiation of local functions. 5618373690 Copy timers to jsshell.js preamble e5e83a29fb Revert "Add a fix for prefer_single_quotes" eb2fbf501f Add a fix for prefer_single_quotes f6a1f48450 Allow using pseudo keywords for names in refactorings. 332dc7f3e9 Issue 32935. Fix NPE in 'Make final' quick fix. 67d3e4e3a1 Use actual names of the @isTest of isTestGroup executable in outlines. 07ad1904f3 Sort declarations in type_system.dart and type_system_test.dart. 04e9f7da27 [vm/kernel/aot] Fix infinite looping in TFA (ensure convergence of analysis) 515a7acc0b [ VM / Dart 2 ] Updated status file entries for remaining DartAPI tests that are failing with issue numbers. b7a63c8d52 Use @isTest and @isTestGroup to understand executable element as a test/group. 5904247715 Fix a typo in socket.dart. 23a1534432 Add DartEditBuilder.writeTopLevelElementReference(). a989bac685 [frontend-server] Re-enable depfile test on Windows. 543d8775e3 Clarify that global/local/static functions can also be closurized 64754764b1 Update computeType to call computeTypeParamOrArg 94be474fee Generate cross buildfiles for armsimdbc and armsimdbc64. 31597f1cd7 [fasta] Add more nodes to the Forest API c8c994b26d Revert "Add some status entries for crashing tests related to issue" f35bb0379d [vm/kernel] Initialize function type args even when resuming from yield. 19cf8d1768 [vm] Rewrite Intrinsifier::InitializeState to be data driven. e434cb91e1 Mark some commonly failing flaky tests. 5a69552d34 [VM] Fix typo in 54d842a89c722b7c27762b96ba21fab55a2ad55a. 2f458c4c48 [vm] Reify more generics in the mirrors implementation to appease Dart 2. 54d842a89c [VM runtime] Explicitly specify length of parent type argument vector in native call Internal_prependTypeArguments to protect against vector reuse optimization. This is indirectly related to issue #33040. 50fbd1a3ed [GN] Fix dartanalyzer_aot target e5e4871a04 Simplify 'this' caching in constructors. 8f52be2282 Don't infer types when there's an irreconcilable type mismatch. dfa661d460 Add AnalysisSessionHelper.getTopLevelPropertyAccessor(). 58f41fd1b5 update issue21159_test for Dart 2, fixes #30701 --- DEPS | 8 ++++---- travis/licenses_golden/licenses_third_party | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/DEPS b/DEPS index b25e3d951d1b8..44691e7e79503 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'e6d7d67f4b35556805dd083fed15bf3ed41f7e33', + 'dart_revision': '779dc6eb85c1f2249803d017ffa785c85681ad1b', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -59,7 +59,7 @@ vars = { 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.49', + 'dart_linter_tag': '0.1.50', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', @@ -74,8 +74,8 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', - 'dart_pub_semver_tag': '1.3.7', + 'dart_pub_rev': 'c61b8a3a24a7b1f931bad24b1f663e2c9a4c4354', + 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f57f2d2746a06..91c15ad6b5f53 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ee1af487941cb16b5491caf536dd0d96 +Signature: 5db29e66257aa1c8a2ac53d069aeb153 UNUSED LICENSES: @@ -6027,15 +6027,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h +FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h FILE: ../../../third_party/dart/runtime/vm/hash.h +FILE: ../../../third_party/dart/runtime/vm/interpreter.cc +FILE: ../../../third_party/dart/runtime/vm/interpreter.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h FILE: ../../../third_party/dart/sdk/lib/js/_js.dart From fade83ce3ea68a89b726bc7881417f3c2713ceaa Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Thu, 10 May 2018 12:32:17 -0700 Subject: [PATCH 0299/1190] Bypass the raster cache when screenshotting (#5227) Fixes https://github.com/flutter/flutter/issues/17448 --- shell/common/rasterizer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index df545f1dd875f..6486d69aa8bbb 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -176,7 +176,7 @@ static sk_sp ScreenshotLayerTreeAsImage( auto canvas = snapshot_surface->getCanvas(); auto frame = compositor_context.AcquireFrame(surface_context, canvas, false); canvas->clear(SK_ColorBLACK); - frame->Raster(*tree, false); + frame->Raster(*tree, true); canvas->flush(); // Prepare an image from the surface, this image may potentially be on th GPU. From f2acd0adec76bc827d7e213f4224cf98c0b6de4e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 10 May 2018 16:20:55 -0400 Subject: [PATCH 0300/1190] Roll src/third_party/skia/ f31fece65..1d686a962 (10 commits) (#5228) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 77 ++++++++++----------- 2 files changed, 39 insertions(+), 40 deletions(-) diff --git a/DEPS b/DEPS index 44691e7e79503..81e83711646b0 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f31fece6581a46b40403fc78c83c7eebe50816ba', + 'skia_revision': '1d686a962c775a69b54f165a23c20c57e506023b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 91c15ad6b5f53..f0e33a3b9eef1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5db29e66257aa1c8a2ac53d069aeb153 +Signature: a21b2333b39745cc2457c3e4eb0801e3 UNUSED LICENSES: @@ -17215,7 +17215,6 @@ FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h -FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h @@ -17246,9 +17245,11 @@ FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp FILE: ../../../third_party/skia/src/effects/SkTrimPE.h FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp +FILE: ../../../third_party/skia/src/gpu/GrContextThreadSafeProxyPriv.h FILE: ../../../third_party/skia/src/gpu/GrDDLContext.cpp FILE: ../../../third_party/skia/src/gpu/GrDirectContext.cpp FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.cpp +FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.h FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h @@ -19589,8 +19590,6 @@ FILE: ../../../third_party/skia/src/core/SkClipStackDevice.h FILE: ../../../third_party/skia/src/core/SkColorSpaceXformCanvas.cpp FILE: ../../../third_party/skia/src/core/SkColorSpaceXformer.cpp FILE: ../../../third_party/skia/src/core/SkColorSpaceXformer.h -FILE: ../../../third_party/skia/src/core/SkColorSpace_New.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpace_New.h FILE: ../../../third_party/skia/src/core/SkCoverageDelta.cpp FILE: ../../../third_party/skia/src/core/SkCoverageDelta.h FILE: ../../../third_party/skia/src/core/SkDeferredDisplayListRecorder.cpp @@ -20484,41 +20483,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/include/utils/SkEventTracer.h + ../../../third_party/skia/LICENSE @@ -20965,6 +20929,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkaroundsAutogen.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp + ../../../third_party/skia/LICENSE From 4a4cff96d472416dd86778c8a91d318dc8f26664 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 10 May 2018 15:57:29 -0700 Subject: [PATCH 0301/1190] Remove Blink code (#5218) Fixes https://github.com/flutter/flutter/issues/12212 --- BUILD.gn | 1 - common/settings.cc | 1 - common/settings.h | 1 - content_handler/BUILD.gn | 1 - content_handler/application.cc | 2 - lib/ui/BUILD.gn | 4 +- lib/ui/dart_runtime_hooks.cc | 4 +- lib/ui/painting/image_encoding.cc | 2 +- lib/ui/text/paragraph.cc | 19 +- lib/ui/text/paragraph.h | 17 - lib/ui/text/paragraph_builder.cc | 399 +- lib/ui/text/paragraph_builder.h | 20 +- lib/ui/text/paragraph_impl_blink.cc | 180 - lib/ui/text/paragraph_impl_blink.h | 54 - lib/ui/text/paragraph_impl_txt.h | 1 - lib/ui/text/text_box.cc | 10 +- lib/ui/text/text_box.h | 18 +- lib/ui/ui_dart_state.cc | 9 - lib/ui/ui_dart_state.h | 12 - runtime/BUILD.gn | 13 +- runtime/asset_font_selector.cc | 258 - runtime/asset_font_selector.h | 68 - runtime/dart_isolate.cc | 1 - runtime/dart_vm.cc | 10 +- runtime/platform_impl.cc | 17 - runtime/platform_impl.h | 27 - runtime/test_font_selector.cc | 50 - runtime/test_font_selector.h | 42 - shell/common/BUILD.gn | 2 - shell/common/engine.cc | 42 +- shell/common/engine.h | 2 - shell/common/shell_unittests.cc | 5 - shell/common/switches.cc | 3 - shell/platform/darwin/BUILD.gn | 1 - shell/platform/darwin/common/BUILD.gn | 1 - .../platform/darwin/desktop/flutter_window.mm | 2 - shell/platform/darwin/ios/BUILD.gn | 4 +- sky/engine/BUILD.gn | 53 - sky/engine/core/BUILD.gn | 50 - sky/engine/core/Init.cpp | 56 - sky/engine/core/Init.h | 53 - sky/engine/core/LICENSE-APPLE | 21 - sky/engine/core/LICENSE-LGPL-2 | 481 - sky/engine/core/LICENSE-LGPL-2.1 | 502 - sky/engine/core/core.gni | 151 - .../core/editing/CompositionUnderline.h | 65 - .../CompositionUnderlineRangeFilter.cpp | 40 - .../editing/CompositionUnderlineRangeFilter.h | 77 - .../core/editing/PositionWithAffinity.cpp | 16 - .../core/editing/PositionWithAffinity.h | 46 - sky/engine/core/rendering/BidiRun.h | 60 - sky/engine/core/rendering/BidiRunForLine.cpp | 208 - sky/engine/core/rendering/BidiRunForLine.h | 45 - sky/engine/core/rendering/ClipPathOperation.h | 63 - sky/engine/core/rendering/ClipRect.cpp | 37 - sky/engine/core/rendering/ClipRect.h | 87 - sky/engine/core/rendering/ClipRects.h | 96 - sky/engine/core/rendering/ClipRectsCache.h | 51 - sky/engine/core/rendering/GapRects.h | 65 - sky/engine/core/rendering/HitTestLocation.cpp | 165 - sky/engine/core/rendering/HitTestLocation.h | 101 - sky/engine/core/rendering/HitTestRequest.h | 62 - sky/engine/core/rendering/HitTestResult.cpp | 94 - sky/engine/core/rendering/HitTestResult.h | 103 - .../rendering/HitTestingTransformState.cpp | 85 - .../core/rendering/HitTestingTransformState.h | 96 - sky/engine/core/rendering/InlineBox.cpp | 297 - sky/engine/core/rendering/InlineBox.h | 499 - sky/engine/core/rendering/InlineFlowBox.cpp | 1460 --- sky/engine/core/rendering/InlineFlowBox.h | 464 - sky/engine/core/rendering/InlineIterator.h | 781 -- sky/engine/core/rendering/InlineTextBox.cpp | 1270 --- sky/engine/core/rendering/InlineTextBox.h | 264 - sky/engine/core/rendering/LayerPaintingInfo.h | 69 - sky/engine/core/rendering/OrderIterator.cpp | 83 - sky/engine/core/rendering/OrderIterator.h | 82 - sky/engine/core/rendering/PaintInfo.h | 87 - .../core/rendering/PointerEventsHitRules.cpp | 116 - .../core/rendering/PointerEventsHitRules.h | 50 - sky/engine/core/rendering/RenderBlock.cpp | 1724 --- sky/engine/core/rendering/RenderBlock.h | 455 - sky/engine/core/rendering/RenderBox.cpp | 3339 ------ sky/engine/core/rendering/RenderBox.h | 825 -- .../core/rendering/RenderBoxModelObject.cpp | 2387 ----- .../core/rendering/RenderBoxModelObject.h | 431 - .../core/rendering/RenderFlexibleBox.cpp | 1437 --- sky/engine/core/rendering/RenderFlexibleBox.h | 217 - .../core/rendering/RenderGeometryMap.cpp | 355 - sky/engine/core/rendering/RenderGeometryMap.h | 122 - .../core/rendering/RenderGeometryMapStep.h | 70 - sky/engine/core/rendering/RenderInline.cpp | 756 -- sky/engine/core/rendering/RenderInline.h | 207 - sky/engine/core/rendering/RenderLayer.cpp | 536 - sky/engine/core/rendering/RenderLayer.h | 206 - .../core/rendering/RenderLayerClipper.cpp | 310 - .../core/rendering/RenderLayerClipper.h | 129 - .../rendering/RenderLayerStackingNode.cpp | 266 - .../core/rendering/RenderLayerStackingNode.h | 216 - .../RenderLayerStackingNodeIterator.cpp | 108 - .../RenderLayerStackingNodeIterator.h | 88 - .../core/rendering/RenderLineBoxList.cpp | 393 - sky/engine/core/rendering/RenderLineBoxList.h | 98 - sky/engine/core/rendering/RenderObject.cpp | 1703 --- sky/engine/core/rendering/RenderObject.h | 1009 -- .../core/rendering/RenderObjectChildList.cpp | 130 - .../core/rendering/RenderObjectChildList.h | 73 - .../core/rendering/RenderObjectInlines.h | 27 - sky/engine/core/rendering/RenderOverflow.h | 119 - .../core/rendering/RenderOverflowTest.cpp | 174 - sky/engine/core/rendering/RenderParagraph.cpp | 1862 ---- sky/engine/core/rendering/RenderParagraph.h | 176 - sky/engine/core/rendering/RenderReplaced.cpp | 507 - sky/engine/core/rendering/RenderReplaced.h | 110 - sky/engine/core/rendering/RenderText.cpp | 1650 --- sky/engine/core/rendering/RenderText.h | 277 - sky/engine/core/rendering/RenderTheme.cpp | 95 - sky/engine/core/rendering/RenderTheme.h | 81 - .../core/rendering/RenderTreeAsText.cpp | 218 - sky/engine/core/rendering/RenderTreeAsText.h | 86 - sky/engine/core/rendering/RenderView.cpp | 342 - sky/engine/core/rendering/RenderView.h | 133 - sky/engine/core/rendering/RootInlineBox.cpp | 804 -- sky/engine/core/rendering/RootInlineBox.h | 217 - sky/engine/core/rendering/ScrollAlignment.cpp | 161 - sky/engine/core/rendering/ScrollAlignment.h | 90 - .../core/rendering/SubtreeLayoutScope.cpp | 65 - .../core/rendering/SubtreeLayoutScope.h | 70 - .../core/rendering/TextRunConstructor.cpp | 184 - .../core/rendering/TextRunConstructor.h | 140 - .../core/rendering/VerticalPositionCache.h | 70 - sky/engine/core/rendering/break_lines.cpp | 345 - sky/engine/core/rendering/break_lines.h | 42 - .../core/rendering/line/BreakingContext.cpp | 72 - .../line/BreakingContextInlineHeaders.h | 943 -- .../core/rendering/line/LineBreaker.cpp | 114 - sky/engine/core/rendering/line/LineBreaker.h | 68 - sky/engine/core/rendering/line/LineInfo.h | 76 - .../core/rendering/line/LineLayoutState.h | 92 - sky/engine/core/rendering/line/LineWidth.cpp | 109 - sky/engine/core/rendering/line/LineWidth.h | 102 - .../core/rendering/line/RenderTextInfo.h | 44 - .../core/rendering/line/TrailingObjects.cpp | 83 - .../core/rendering/line/TrailingObjects.h | 96 - .../core/rendering/line/WordMeasurement.h | 48 - .../rendering/style/AppliedTextDecoration.cpp | 28 - .../rendering/style/AppliedTextDecoration.h | 41 - sky/engine/core/rendering/style/BorderData.h | 124 - sky/engine/core/rendering/style/BorderValue.h | 104 - .../rendering/style/CollapsedBorderValue.h | 80 - .../rendering/style/CounterDirectives.cpp | 40 - .../core/rendering/style/CounterDirectives.h | 104 - .../core/rendering/style/DataEquivalency.h | 34 - sky/engine/core/rendering/style/DataRef.h | 68 - sky/engine/core/rendering/style/FillLayer.cpp | 371 - sky/engine/core/rendering/style/FillLayer.h | 301 - .../core/rendering/style/OutlineValue.h | 63 - .../core/rendering/style/OutlineValueTest.cpp | 57 - .../core/rendering/style/RenderStyle.cpp | 1102 -- sky/engine/core/rendering/style/RenderStyle.h | 1745 --- .../rendering/style/RenderStyleConstants.h | 402 - .../core/rendering/style/ShadowData.cpp | 44 - sky/engine/core/rendering/style/ShadowData.h | 78 - .../core/rendering/style/ShadowList.cpp | 119 - sky/engine/core/rendering/style/ShadowList.h | 84 - sky/engine/core/rendering/style/ShapeValue.h | 100 - .../rendering/style/StyleBackgroundData.cpp | 49 - .../rendering/style/StyleBackgroundData.h | 68 - .../core/rendering/style/StyleBoxData.cpp | 70 - .../core/rendering/style/StyleBoxData.h | 91 - sky/engine/core/rendering/style/StyleColor.h | 71 - .../core/rendering/style/StyleDifference.h | 70 - .../core/rendering/style/StyleFilterData.cpp | 38 - .../core/rendering/style/StyleFilterData.h | 53 - .../rendering/style/StyleFlexibleBoxData.cpp | 54 - .../rendering/style/StyleFlexibleBoxData.h | 63 - sky/engine/core/rendering/style/StyleImage.h | 86 - .../rendering/style/StyleInheritedData.cpp | 50 - .../core/rendering/style/StyleInheritedData.h | 67 - .../style/StyleRareInheritedData.cpp | 148 - .../rendering/style/StyleRareInheritedData.h | 152 - .../style/StyleRareNonInheritedData.cpp | 153 - .../style/StyleRareNonInheritedData.h | 141 - .../rendering/style/StyleSurroundData.cpp | 40 - .../core/rendering/style/StyleSurroundData.h | 59 - .../rendering/style/StyleTransformData.cpp | 46 - .../core/rendering/style/StyleTransformData.h | 59 - .../core/rendering/style/StyleVisualData.cpp | 39 - .../core/rendering/style/StyleVisualData.h | 63 - sky/engine/platform/BUILD.gn | 325 - sky/engine/platform/CalculationValue.h | 70 - sky/engine/platform/Decimal.cpp | 997 -- sky/engine/platform/Decimal.h | 190 - sky/engine/platform/DecimalTest.cpp | 1166 -- sky/engine/platform/FloatConversion.h | 44 - sky/engine/platform/Language.cpp | 132 - sky/engine/platform/Language.h | 46 - sky/engine/platform/LayoutUnit.h | 707 -- sky/engine/platform/LayoutUnitTest.cpp | 266 - sky/engine/platform/Length.cpp | 210 - sky/engine/platform/Length.h | 332 - sky/engine/platform/LengthBox.cpp | 61 - sky/engine/platform/LengthBox.h | 86 - sky/engine/platform/LengthFunctions.cpp | 128 - sky/engine/platform/LengthFunctions.h | 49 - sky/engine/platform/LengthPoint.h | 63 - sky/engine/platform/LengthSize.h | 52 - sky/engine/platform/NotImplemented.h | 34 - sky/engine/platform/Partitions.cpp | 51 - sky/engine/platform/Partitions.h | 62 - sky/engine/platform/PlatformExport.h | 44 - sky/engine/platform/PurgeableVector.cpp | 253 - sky/engine/platform/PurgeableVector.h | 124 - sky/engine/platform/PurgeableVectorTest.cpp | 345 - sky/engine/platform/SharedBuffer.cpp | 370 - sky/engine/platform/SharedBuffer.h | 125 - .../platform/TestingPlatformSupport.cpp | 75 - sky/engine/platform/TestingPlatformSupport.h | 78 - .../platform/animation/AnimationUtilities.h | 84 - .../platform/animation/AnimationValue.h | 102 - .../platform/animation/KeyframeValueList.cpp | 50 - .../platform/animation/KeyframeValueList.h | 85 - .../platform/animation/TimingFunction.cpp | 225 - .../platform/animation/TimingFunction.h | 246 - .../platform/animation/TimingFunctionTest.cpp | 461 - sky/engine/platform/animation/UnitBezier.h | 158 - .../platform/animation/UnitBezierTest.cpp | 84 - sky/engine/platform/exported/Platform.cpp | 49 - sky/engine/platform/exported/WebCommon.cpp | 45 - .../platform/fonts/AlternateFontFamily.h | 116 - sky/engine/platform/fonts/Character.cpp | 366 - sky/engine/platform/fonts/Character.h | 96 - sky/engine/platform/fonts/CustomFontData.h | 68 - .../platform/fonts/FixedPitchFontType.h | 14 - sky/engine/platform/fonts/Font.cpp | 974 -- sky/engine/platform/fonts/Font.h | 279 - sky/engine/platform/fonts/FontBaseline.h | 35 - sky/engine/platform/fonts/FontCache.cpp | 320 - sky/engine/platform/fonts/FontCache.h | 232 - sky/engine/platform/fonts/FontCacheClient.h | 49 - sky/engine/platform/fonts/FontCacheEmpty.cpp | 40 - sky/engine/platform/fonts/FontCacheKey.h | 100 - sky/engine/platform/fonts/FontCacheTest.cpp | 41 - .../platform/fonts/FontCustomPlatformData.h | 73 - sky/engine/platform/fonts/FontData.cpp | 32 - sky/engine/platform/fonts/FontData.h | 83 - sky/engine/platform/fonts/FontDataCache.cpp | 157 - sky/engine/platform/fonts/FontDataCache.h | 100 - sky/engine/platform/fonts/FontDescription.cpp | 212 - sky/engine/platform/fonts/FontDescription.h | 319 - .../platform/fonts/FontDescriptionTest.cpp | 117 - .../platform/fonts/FontFaceCreationParams.h | 121 - .../platform/fonts/FontFallbackList.cpp | 252 - sky/engine/platform/fonts/FontFallbackList.h | 135 - sky/engine/platform/fonts/FontFamily.cpp | 45 - sky/engine/platform/fonts/FontFamily.h | 94 - sky/engine/platform/fonts/FontFamilyNames.in | 10 - .../platform/fonts/FontFeatureSettings.cpp | 39 - .../platform/fonts/FontFeatureSettings.h | 69 - sky/engine/platform/fonts/FontMetrics.h | 161 - sky/engine/platform/fonts/FontOrientation.h | 35 - .../platform/fonts/FontPlatformData.cpp | 168 - sky/engine/platform/fonts/FontPlatformData.h | 156 - .../platform/fonts/FontPlatformFeatures.h | 48 - sky/engine/platform/fonts/FontRenderStyle.h | 76 - sky/engine/platform/fonts/FontSelector.h | 53 - sky/engine/platform/fonts/FontSmoothingMode.h | 40 - sky/engine/platform/fonts/FontTest.cpp | 363 - sky/engine/platform/fonts/FontTraits.h | 109 - sky/engine/platform/fonts/FontWidthVariant.h | 48 - sky/engine/platform/fonts/Glyph.h | 39 - sky/engine/platform/fonts/GlyphBuffer.h | 115 - sky/engine/platform/fonts/GlyphMetricsMap.h | 131 - sky/engine/platform/fonts/GlyphPage.h | 218 - .../platform/fonts/GlyphPageTreeNode.cpp | 441 - sky/engine/platform/fonts/GlyphPageTreeNode.h | 148 - .../platform/fonts/GlyphPageTreeNodeTest.cpp | 248 - .../platform/fonts/Latin1TextIterator.h | 68 - .../platform/fonts/SegmentedFontData.cpp | 104 - sky/engine/platform/fonts/SegmentedFontData.h | 87 - sky/engine/platform/fonts/SimpleFontData.cpp | 272 - sky/engine/platform/fonts/SimpleFontData.h | 305 - sky/engine/platform/fonts/TextBlob.h | 19 - sky/engine/platform/fonts/TextRenderingMode.h | 40 - .../platform/fonts/TypesettingFeatures.h | 40 - sky/engine/platform/fonts/VDMXParser.cpp | 188 - sky/engine/platform/fonts/VDMXParser.h | 45 - sky/engine/platform/fonts/WidthCache.h | 220 - sky/engine/platform/fonts/WidthIterator.cpp | 282 - sky/engine/platform/fonts/WidthIterator.h | 116 - .../fonts/apple/FontPlatformDataApple.cpp | 76 - .../fonts/fuchsia/FontCacheFuchsia.cpp | 142 - .../platform/fonts/fuchsia/FontCacheFuchsia.h | 16 - .../platform/fonts/harfbuzz/FontHarfBuzz.cpp | 349 - .../platform/fonts/harfbuzz/HarfBuzzFace.cpp | 131 - .../platform/fonts/harfbuzz/HarfBuzzFace.h | 75 - .../fonts/harfbuzz/HarfBuzzFaceSkia.cpp | 271 - .../fonts/harfbuzz/HarfBuzzShaper.cpp | 1227 --- .../platform/fonts/harfbuzz/HarfBuzzShaper.h | 184 - .../platform/fonts/linux/FontCacheLinux.cpp | 264 - .../fonts/linux/FontPlatformDataLinux.cpp | 128 - .../platform/fonts/mobile/FontCacheMobile.cpp | 93 - .../fonts/mobile/FontCacheMobileTest.cpp | 28 - .../platform/fonts/opentype/OpenTypeTypes.h | 106 - .../fonts/opentype/OpenTypeVerticalData.cpp | 281 - .../fonts/opentype/OpenTypeVerticalData.h | 78 - .../platform/fonts/skia/FontCacheSkia.cpp | 262 - .../fonts/skia/FontCustomPlatformDataSkia.cpp | 77 - .../fonts/skia/FontPlatformDataSkia.cpp | 84 - .../fonts/skia/SimpleFontDataSkia.cpp | 315 - .../platform/fonts/win/FontCacheSkiaWin.cpp | 380 - .../platform/fonts/win/FontFallbackWin.cpp | 365 - .../platform/fonts/win/FontFallbackWin.h | 60 - .../fonts/win/FontPlatformDataWin.cpp | 146 - sky/engine/platform/geometry/FloatBox.h | 162 - sky/engine/platform/geometry/FloatBoxExtent.h | 105 - sky/engine/platform/geometry/FloatBoxTest.cpp | 122 - .../platform/geometry/FloatBoxTestHelpers.cpp | 90 - .../platform/geometry/FloatBoxTestHelpers.h | 48 - sky/engine/platform/geometry/FloatPoint.cpp | 117 - sky/engine/platform/geometry/FloatPoint.h | 203 - sky/engine/platform/geometry/FloatPoint3D.cpp | 38 - sky/engine/platform/geometry/FloatPoint3D.h | 148 - sky/engine/platform/geometry/FloatQuad.cpp | 239 - sky/engine/platform/geometry/FloatQuad.h | 162 - sky/engine/platform/geometry/FloatRect.cpp | 249 - sky/engine/platform/geometry/FloatRect.h | 238 - .../platform/geometry/FloatRoundedRect.cpp | 147 - .../platform/geometry/FloatRoundedRect.h | 153 - .../geometry/FloatRoundedRectTest.cpp | 189 - sky/engine/platform/geometry/FloatSize.cpp | 58 - sky/engine/platform/geometry/FloatSize.h | 162 - sky/engine/platform/geometry/IntPoint.h | 132 - sky/engine/platform/geometry/IntRect.cpp | 164 - sky/engine/platform/geometry/IntRect.h | 204 - sky/engine/platform/geometry/IntRectExtent.h | 91 - sky/engine/platform/geometry/IntSize.h | 132 - sky/engine/platform/geometry/IntSizeHash.h | 59 - .../platform/geometry/LayoutBoxExtent.cpp | 111 - .../platform/geometry/LayoutBoxExtent.h | 89 - sky/engine/platform/geometry/LayoutPoint.h | 180 - sky/engine/platform/geometry/LayoutRect.cpp | 150 - sky/engine/platform/geometry/LayoutRect.h | 260 - sky/engine/platform/geometry/LayoutSize.h | 172 - sky/engine/platform/geometry/Region.cpp | 635 -- sky/engine/platform/geometry/Region.h | 178 - sky/engine/platform/geometry/RegionTest.cpp | 386 - sky/engine/platform/geometry/RoundedRect.cpp | 234 - sky/engine/platform/geometry/RoundedRect.h | 140 - .../platform/geometry/RoundedRectTest.cpp | 77 - .../platform/geometry/TransformState.cpp | 223 - sky/engine/platform/geometry/TransformState.h | 126 - sky/engine/platform/graphics/Color.cpp | 411 - sky/engine/platform/graphics/Color.h | 178 - sky/engine/platform/graphics/ColorSpace.cpp | 109 - sky/engine/platform/graphics/ColorSpace.h | 56 - sky/engine/platform/graphics/DashArray.h | 35 - .../platform/graphics/DrawLooperBuilder.cpp | 112 - .../platform/graphics/DrawLooperBuilder.h | 81 - sky/engine/platform/graphics/FrameData.cpp | 47 - sky/engine/platform/graphics/FrameData.h | 68 - .../platform/graphics/GeneratedImage.cpp | 45 - sky/engine/platform/graphics/GeneratedImage.h | 70 - sky/engine/platform/graphics/Gradient.cpp | 271 - sky/engine/platform/graphics/Gradient.h | 158 - .../graphics/GradientGeneratedImage.cpp | 116 - .../graphics/GradientGeneratedImage.h | 72 - .../platform/graphics/GraphicsContext.cpp | 1580 --- .../platform/graphics/GraphicsContext.h | 633 -- .../graphics/GraphicsContextState.cpp | 234 - .../platform/graphics/GraphicsContextState.h | 193 - .../graphics/GraphicsContextStateSaver.h | 75 - .../platform/graphics/GraphicsTypes.cpp | 204 - sky/engine/platform/graphics/GraphicsTypes.h | 148 - sky/engine/platform/graphics/Image.cpp | 130 - sky/engine/platform/graphics/Image.h | 177 - sky/engine/platform/graphics/ImageFilter.cpp | 15 - sky/engine/platform/graphics/ImageFilter.h | 18 - .../platform/graphics/ImageObserver.cpp | 36 - sky/engine/platform/graphics/ImageObserver.h | 54 - .../platform/graphics/ImageOrientation.cpp | 61 - .../platform/graphics/ImageOrientation.h | 96 - sky/engine/platform/graphics/Path.cpp | 526 - sky/engine/platform/graphics/Path.h | 196 - .../platform/graphics/PathTraversalState.cpp | 234 - .../platform/graphics/PathTraversalState.h | 74 - sky/engine/platform/graphics/Pattern.cpp | 57 - sky/engine/platform/graphics/Pattern.h | 69 - .../platform/graphics/RegionTracker.cpp | 470 - sky/engine/platform/graphics/RegionTracker.h | 122 - sky/engine/platform/graphics/StrokeData.cpp | 113 - sky/engine/platform/graphics/StrokeData.h | 111 - .../platform/graphics/skia/SkSizeHash.h | 91 - .../platform/graphics/skia/SkiaUtils.cpp | 329 - sky/engine/platform/graphics/skia/SkiaUtils.h | 114 - sky/engine/platform/heap/Handle.h | 99 - sky/engine/platform/testing/RunAllTests.cpp | 49 - sky/engine/platform/text/BidiCharacterRun.cpp | 51 - sky/engine/platform/text/BidiCharacterRun.h | 89 - sky/engine/platform/text/BidiContext.cpp | 132 - sky/engine/platform/text/BidiContext.h | 104 - sky/engine/platform/text/BidiResolver.h | 1155 -- sky/engine/platform/text/BidiResolverTest.cpp | 304 - sky/engine/platform/text/BidiRunList.h | 243 - sky/engine/platform/text/BidiTestHarness.h | 268 - sky/engine/platform/text/BidiTextRun.cpp | 62 - sky/engine/platform/text/BidiTextRun.h | 49 - sky/engine/platform/text/ICUError.cpp | 30 - sky/engine/platform/text/ICUError.h | 44 - sky/engine/platform/text/LineEnding.cpp | 214 - sky/engine/platform/text/LineEnding.h | 62 - .../platform/text/LocaleToScriptMapping.cpp | 406 - .../platform/text/LocaleToScriptMapping.h | 47 - .../platform/text/NonCJKGlyphOrientation.h | 37 - .../text/SurrogatePairAwareTextIterator.cpp | 102 - .../text/SurrogatePairAwareTextIterator.h | 74 - sky/engine/platform/text/TextBoundaries.cpp | 110 - sky/engine/platform/text/TextBoundaries.h | 56 - sky/engine/platform/text/TextBox.h | 26 - .../platform/text/TextBreakIterator.cpp | 68 - sky/engine/platform/text/TextBreakIterator.h | 254 - .../platform/text/TextBreakIteratorICU.cpp | 947 -- .../text/TextBreakIteratorInternalICU.cpp | 46 - .../text/TextBreakIteratorInternalICU.h | 36 - sky/engine/platform/text/TextDecoration.h | 43 - sky/engine/platform/text/TextDirection.h | 41 - sky/engine/platform/text/TextPath.h | 44 - sky/engine/platform/text/TextRun.cpp | 58 - sky/engine/platform/text/TextRun.h | 338 - sky/engine/platform/text/TextRunIterator.h | 69 - sky/engine/platform/text/TextStream.cpp | 160 - sky/engine/platform/text/TextStream.h | 95 - sky/engine/platform/text/UnicodeBidi.h | 51 - sky/engine/platform/text/UnicodeRange.cpp | 451 - sky/engine/platform/text/UnicodeRange.h | 122 - sky/engine/platform/text/UnicodeUtilities.cpp | 427 - sky/engine/platform/text/UnicodeUtilities.h | 55 - .../platform/text/UnicodeUtilitiesTest.cpp | 249 - .../platform/transforms/AffineTransform.cpp | 358 - .../platform/transforms/AffineTransform.h | 181 - .../transforms/IdentityTransformOperation.h | 63 - .../InterpolatedTransformOperation.cpp | 76 - .../InterpolatedTransformOperation.h | 84 - .../transforms/Matrix3DTransformOperation.cpp | 55 - .../transforms/Matrix3DTransformOperation.h | 78 - .../transforms/MatrixTransformOperation.cpp | 53 - .../transforms/MatrixTransformOperation.h | 111 - .../PerspectiveTransformOperation.cpp | 65 - .../PerspectiveTransformOperation.h | 75 - .../transforms/RotateTransformOperation.cpp | 161 - .../transforms/RotateTransformOperation.h | 103 - .../transforms/ScaleTransformOperation.cpp | 57 - .../transforms/ScaleTransformOperation.h | 92 - .../transforms/SkewTransformOperation.cpp | 54 - .../transforms/SkewTransformOperation.h | 77 - .../platform/transforms/TransformOperation.h | 101 - .../transforms/TransformOperations.cpp | 418 - .../platform/transforms/TransformOperations.h | 100 - .../transforms/TransformOperationsTest.cpp | 508 - .../transforms/TransformationMatrix.cpp | 1589 --- .../transforms/TransformationMatrix.h | 416 - .../transforms/TransformationMatrixTest.cpp | 27 - .../TranslateTransformOperation.cpp | 58 - .../transforms/TranslateTransformOperation.h | 108 - sky/engine/public/BUILD.gn | 32 - sky/engine/public/platform/Platform.h | 70 - sky/engine/public/platform/WebBlendMode.h | 59 - sky/engine/public/platform/WebCommon.h | 97 - .../public/platform/WebDiscardableMemory.h | 75 - sky/engine/public/web/Sky.h | 51 - sky/engine/web/BUILD.gn | 30 - sky/engine/web/Sky.cpp | 93 - sky/engine/wtf/ASCIICType.h | 188 - sky/engine/wtf/AddressSpaceRandomization.cpp | 93 - sky/engine/wtf/AddressSpaceRandomization.h | 19 - sky/engine/wtf/Alignment.h | 93 - sky/engine/wtf/Allocator.h | 155 - sky/engine/wtf/Assertions.cpp | 227 - sky/engine/wtf/Assertions.h | 466 - sky/engine/wtf/Atomics.h | 240 - sky/engine/wtf/BUILD.gn | 273 - sky/engine/wtf/BitwiseOperations.h | 101 - sky/engine/wtf/ByteOrder.h | 44 - sky/engine/wtf/ByteSwap.h | 95 - sky/engine/wtf/CONTRIBUTORS.pthreads-win32 | 137 - sky/engine/wtf/CPU.h | 161 - sky/engine/wtf/CheckedArithmetic.h | 735 -- sky/engine/wtf/CheckedArithmeticTest.cpp | 221 - sky/engine/wtf/Compiler.h | 150 - sky/engine/wtf/DataLog.cpp | 107 - sky/engine/wtf/DataLog.h | 263 - sky/engine/wtf/DefaultAllocator.cpp | 45 - sky/engine/wtf/DefaultAllocator.h | 168 - sky/engine/wtf/Deque.h | 570 - sky/engine/wtf/DequeTest.cpp | 303 - sky/engine/wtf/DoubleBufferedDeque.h | 42 - sky/engine/wtf/DoubleBufferedDequeTest.cpp | 49 - sky/engine/wtf/DoublyLinkedList.h | 193 - sky/engine/wtf/DynamicAnnotations.cpp | 60 - sky/engine/wtf/DynamicAnnotations.h | 114 - sky/engine/wtf/EnumClass.h | 62 - sky/engine/wtf/FastAllocBase.h | 76 - sky/engine/wtf/FastMalloc.cpp | 81 - sky/engine/wtf/FastMalloc.h | 49 - sky/engine/wtf/FilePrintStream.cpp | 56 - sky/engine/wtf/FilePrintStream.h | 60 - sky/engine/wtf/Forward.h | 65 - sky/engine/wtf/GetPtr.h | 38 - sky/engine/wtf/HashCountedSet.h | 168 - sky/engine/wtf/HashFunctions.h | 370 - sky/engine/wtf/HashIterators.h | 265 - sky/engine/wtf/HashMap.h | 687 -- sky/engine/wtf/HashMapTest.cpp | 256 - sky/engine/wtf/HashSet.h | 304 - sky/engine/wtf/HashSetTest.cpp | 207 - sky/engine/wtf/HashTable.cpp | 70 - sky/engine/wtf/HashTable.h | 1751 --- sky/engine/wtf/HashTableDeletedValueType.h | 40 - sky/engine/wtf/HashTraits.h | 419 - sky/engine/wtf/HexNumber.h | 112 - sky/engine/wtf/InstanceCounter.cpp | 154 - sky/engine/wtf/InstanceCounter.h | 65 - sky/engine/wtf/LeakAnnotations.h | 86 - sky/engine/wtf/LinkedHashSet.h | 820 -- sky/engine/wtf/LinkedStack.h | 108 - sky/engine/wtf/ListHashSet.h | 1048 -- sky/engine/wtf/ListHashSetTest.cpp | 686 -- sky/engine/wtf/Locker.h | 51 - sky/engine/wtf/MainThread.cpp | 55 - sky/engine/wtf/MainThread.h | 49 - sky/engine/wtf/MakeUnique.h | 55 - sky/engine/wtf/MallocZoneSupport.h | 65 - sky/engine/wtf/MathExtras.h | 259 - sky/engine/wtf/MathExtrasTest.cpp | 195 - sky/engine/wtf/NonCopyingSort.h | 95 - sky/engine/wtf/Noncopyable.h | 31 - sky/engine/wtf/NotFound.h | 35 - sky/engine/wtf/NullPtr.h | 46 - sky/engine/wtf/OperatingSystem.h | 104 - sky/engine/wtf/OwnPtr.h | 266 - sky/engine/wtf/OwnPtrCommon.h | 71 - sky/engine/wtf/PageAllocator.cpp | 229 - sky/engine/wtf/PageAllocator.h | 106 - sky/engine/wtf/PartitionAlloc.cpp | 1051 -- sky/engine/wtf/PartitionAlloc.h | 714 -- sky/engine/wtf/PartitionAllocTest.cpp | 1289 --- sky/engine/wtf/PassOwnPtr.h | 192 - sky/engine/wtf/PassRefPtr.h | 231 - sky/engine/wtf/PassTraits.h | 66 - sky/engine/wtf/PrintStream.cpp | 101 - sky/engine/wtf/PrintStream.h | 428 - sky/engine/wtf/RawPtr.h | 138 - sky/engine/wtf/RefCounted.h | 182 - sky/engine/wtf/RefCountedLeakCounter.cpp | 91 - sky/engine/wtf/RefCountedLeakCounter.h | 48 - sky/engine/wtf/RefPtr.h | 259 - sky/engine/wtf/RefPtrTest.cpp | 32 - sky/engine/wtf/RefVector.h | 40 - sky/engine/wtf/SaturatedArithmetic.h | 112 - sky/engine/wtf/SaturatedArithmeticTest.cpp | 150 - sky/engine/wtf/SizeLimits.cpp | 99 - sky/engine/wtf/SpinLock.h | 59 - sky/engine/wtf/StaticConstructors.h | 39 - sky/engine/wtf/StdLibExtras.h | 150 - sky/engine/wtf/StreamBuffer.h | 109 - sky/engine/wtf/StringExtras.h | 120 - sky/engine/wtf/StringExtrasTest.cpp | 158 - sky/engine/wtf/StringHasher.h | 228 - sky/engine/wtf/StringHasherTest.cpp | 423 - sky/engine/wtf/TemporaryChange.h | 63 - sky/engine/wtf/TemporaryChangeTest.cpp | 45 - .../wtf/ThreadIdentifierDataPthreads.cpp | 97 - sky/engine/wtf/ThreadIdentifierDataPthreads.h | 81 - sky/engine/wtf/ThreadRestrictionVerifier.h | 83 - sky/engine/wtf/ThreadSafeRefCounted.h | 86 - sky/engine/wtf/ThreadSpecific.h | 281 - sky/engine/wtf/ThreadSpecificWin.cpp | 127 - sky/engine/wtf/Threading.h | 62 - sky/engine/wtf/ThreadingPrimitives.h | 148 - sky/engine/wtf/ThreadingPthreads.cpp | 261 - sky/engine/wtf/ThreadingWin.cpp | 220 - sky/engine/wtf/TypeTraits.cpp | 219 - sky/engine/wtf/TypeTraits.h | 410 - sky/engine/wtf/Vector.h | 1165 -- sky/engine/wtf/VectorTest.cpp | 289 - sky/engine/wtf/VectorTraits.h | 121 - sky/engine/wtf/WTF.cpp | 82 - sky/engine/wtf/WTF.h | 63 - sky/engine/wtf/WTFExport.h | 36 - sky/engine/wtf/WTFThreadData.cpp | 45 - sky/engine/wtf/WTFThreadData.h | 83 - .../wtf/allocator/PartitionAllocator.cpp | 36 - sky/engine/wtf/allocator/PartitionAllocator.h | 145 - sky/engine/wtf/allocator/Partitions.cpp | 250 - sky/engine/wtf/allocator/Partitions.h | 181 - sky/engine/wtf/asm/SaturatedArithmeticARM.h | 94 - sky/engine/wtf/dtoa.cpp | 1316 --- sky/engine/wtf/dtoa.h | 112 - sky/engine/wtf/dtoa/LICENSE | 26 - sky/engine/wtf/dtoa/README | 11 - sky/engine/wtf/dtoa/bignum-dtoa.cc | 680 -- sky/engine/wtf/dtoa/bignum-dtoa.h | 90 - sky/engine/wtf/dtoa/bignum.cc | 766 -- sky/engine/wtf/dtoa/bignum.h | 146 - sky/engine/wtf/dtoa/cached-powers.cc | 200 - sky/engine/wtf/dtoa/cached-powers.h | 66 - sky/engine/wtf/dtoa/diy-fp.cc | 60 - sky/engine/wtf/dtoa/diy-fp.h | 121 - sky/engine/wtf/dtoa/double-conversion.cc | 595 -- sky/engine/wtf/dtoa/double-conversion.h | 377 - sky/engine/wtf/dtoa/double.h | 249 - sky/engine/wtf/dtoa/fast-dtoa.cc | 732 -- sky/engine/wtf/dtoa/fast-dtoa.h | 88 - sky/engine/wtf/dtoa/fixed-dtoa.cc | 406 - sky/engine/wtf/dtoa/fixed-dtoa.h | 63 - sky/engine/wtf/dtoa/strtod.cc | 429 - sky/engine/wtf/dtoa/strtod.h | 45 - sky/engine/wtf/dtoa/utils.h | 264 - sky/engine/wtf/testing/RunAllTests.cpp | 40 - sky/engine/wtf/testing/WTFTestHelpers.cpp | 81 - sky/engine/wtf/testing/WTFTestHelpers.h | 44 - sky/engine/wtf/testing/WTFTestHelpersTest.cpp | 79 - sky/engine/wtf/text/ASCIIFastPath.h | 143 - sky/engine/wtf/text/AtomicString.cpp | 523 - sky/engine/wtf/text/AtomicString.h | 327 - sky/engine/wtf/text/AtomicStringHash.h | 72 - sky/engine/wtf/text/AtomicStringTest.cpp | 78 - sky/engine/wtf/text/CString.cpp | 122 - sky/engine/wtf/text/CString.h | 100 - sky/engine/wtf/text/CStringTest.cpp | 192 - .../wtf/text/IntegerToStringConversion.h | 125 - sky/engine/wtf/text/StringBuffer.h | 95 - sky/engine/wtf/text/StringBufferTest.cpp | 41 - sky/engine/wtf/text/StringBuilder.cpp | 408 - sky/engine/wtf/text/StringBuilder.h | 389 - sky/engine/wtf/text/StringBuilderTest.cpp | 325 - sky/engine/wtf/text/StringConcatenate.h | 385 - sky/engine/wtf/text/StringHash.h | 139 - sky/engine/wtf/text/StringImpl.cpp | 2218 ---- sky/engine/wtf/text/StringImpl.h | 836 -- sky/engine/wtf/text/StringImplTest.cpp | 37 - sky/engine/wtf/text/StringOperators.h | 139 - sky/engine/wtf/text/StringOperatorsTest.cpp | 184 - sky/engine/wtf/text/StringStatics.cpp | 79 - sky/engine/wtf/text/StringStatics.h | 48 - sky/engine/wtf/text/StringUTF8Adaptor.h | 84 - sky/engine/wtf/text/StringView.h | 93 - sky/engine/wtf/text/TextCodec.cpp | 58 - sky/engine/wtf/text/TextCodec.h | 117 - sky/engine/wtf/text/TextCodecASCIIFastPath.h | 77 - sky/engine/wtf/text/TextCodecICU.cpp | 593 -- sky/engine/wtf/text/TextCodecICU.h | 100 - sky/engine/wtf/text/TextCodecLatin1.cpp | 289 - sky/engine/wtf/text/TextCodecLatin1.h | 57 - sky/engine/wtf/text/TextCodecReplacement.cpp | 53 - sky/engine/wtf/text/TextCodecReplacement.h | 32 - .../wtf/text/TextCodecReplacementTest.cpp | 61 - sky/engine/wtf/text/TextCodecUTF16.cpp | 194 - sky/engine/wtf/text/TextCodecUTF16.h | 61 - sky/engine/wtf/text/TextCodecUTF8.cpp | 480 - sky/engine/wtf/text/TextCodecUTF8.h | 75 - sky/engine/wtf/text/TextCodecUTF8Test.cpp | 91 - sky/engine/wtf/text/TextCodecUserDefined.cpp | 131 - sky/engine/wtf/text/TextCodecUserDefined.h | 57 - sky/engine/wtf/text/TextEncoding.cpp | 218 - sky/engine/wtf/text/TextEncoding.h | 97 - sky/engine/wtf/text/TextEncodingRegistry.cpp | 311 - sky/engine/wtf/text/TextEncodingRegistry.h | 65 - sky/engine/wtf/text/TextPosition.cpp | 70 - sky/engine/wtf/text/TextPosition.h | 110 - sky/engine/wtf/text/WTFString.cpp | 1280 --- sky/engine/wtf/text/WTFString.h | 857 -- sky/engine/wtf/text/WTFStringTest.cpp | 357 - sky/engine/wtf/unicode/CharacterNames.h | 149 - sky/engine/wtf/unicode/Collator.h | 70 - sky/engine/wtf/unicode/UTF8.cpp | 529 - sky/engine/wtf/unicode/UTF8.h | 104 - sky/engine/wtf/unicode/Unicode.h | 35 - sky/engine/wtf/unicode/icu/CollatorICU.cpp | 131 - sky/engine/wtf/unicode/icu/UnicodeIcu.h | 226 - sky/packages/sky_engine/BUILD.gn | 1 - sky/packages/sky_engine/LICENSE | 9360 ++++------------- travis/licenses_golden/licenses_flutter | 8857 +--------------- 682 files changed, 1912 insertions(+), 157760 deletions(-) delete mode 100644 lib/ui/text/paragraph_impl_blink.cc delete mode 100644 lib/ui/text/paragraph_impl_blink.h delete mode 100644 runtime/asset_font_selector.cc delete mode 100644 runtime/asset_font_selector.h delete mode 100644 runtime/platform_impl.cc delete mode 100644 runtime/platform_impl.h delete mode 100644 runtime/test_font_selector.cc delete mode 100644 runtime/test_font_selector.h delete mode 100644 sky/engine/BUILD.gn delete mode 100644 sky/engine/core/BUILD.gn delete mode 100644 sky/engine/core/Init.cpp delete mode 100644 sky/engine/core/Init.h delete mode 100644 sky/engine/core/LICENSE-APPLE delete mode 100644 sky/engine/core/LICENSE-LGPL-2 delete mode 100644 sky/engine/core/LICENSE-LGPL-2.1 delete mode 100644 sky/engine/core/core.gni delete mode 100644 sky/engine/core/editing/CompositionUnderline.h delete mode 100644 sky/engine/core/editing/CompositionUnderlineRangeFilter.cpp delete mode 100644 sky/engine/core/editing/CompositionUnderlineRangeFilter.h delete mode 100644 sky/engine/core/editing/PositionWithAffinity.cpp delete mode 100644 sky/engine/core/editing/PositionWithAffinity.h delete mode 100644 sky/engine/core/rendering/BidiRun.h delete mode 100644 sky/engine/core/rendering/BidiRunForLine.cpp delete mode 100644 sky/engine/core/rendering/BidiRunForLine.h delete mode 100644 sky/engine/core/rendering/ClipPathOperation.h delete mode 100644 sky/engine/core/rendering/ClipRect.cpp delete mode 100644 sky/engine/core/rendering/ClipRect.h delete mode 100644 sky/engine/core/rendering/ClipRects.h delete mode 100644 sky/engine/core/rendering/ClipRectsCache.h delete mode 100644 sky/engine/core/rendering/GapRects.h delete mode 100644 sky/engine/core/rendering/HitTestLocation.cpp delete mode 100644 sky/engine/core/rendering/HitTestLocation.h delete mode 100644 sky/engine/core/rendering/HitTestRequest.h delete mode 100644 sky/engine/core/rendering/HitTestResult.cpp delete mode 100644 sky/engine/core/rendering/HitTestResult.h delete mode 100644 sky/engine/core/rendering/HitTestingTransformState.cpp delete mode 100644 sky/engine/core/rendering/HitTestingTransformState.h delete mode 100644 sky/engine/core/rendering/InlineBox.cpp delete mode 100644 sky/engine/core/rendering/InlineBox.h delete mode 100644 sky/engine/core/rendering/InlineFlowBox.cpp delete mode 100644 sky/engine/core/rendering/InlineFlowBox.h delete mode 100644 sky/engine/core/rendering/InlineIterator.h delete mode 100644 sky/engine/core/rendering/InlineTextBox.cpp delete mode 100644 sky/engine/core/rendering/InlineTextBox.h delete mode 100644 sky/engine/core/rendering/LayerPaintingInfo.h delete mode 100644 sky/engine/core/rendering/OrderIterator.cpp delete mode 100644 sky/engine/core/rendering/OrderIterator.h delete mode 100644 sky/engine/core/rendering/PaintInfo.h delete mode 100644 sky/engine/core/rendering/PointerEventsHitRules.cpp delete mode 100644 sky/engine/core/rendering/PointerEventsHitRules.h delete mode 100644 sky/engine/core/rendering/RenderBlock.cpp delete mode 100644 sky/engine/core/rendering/RenderBlock.h delete mode 100644 sky/engine/core/rendering/RenderBox.cpp delete mode 100644 sky/engine/core/rendering/RenderBox.h delete mode 100644 sky/engine/core/rendering/RenderBoxModelObject.cpp delete mode 100644 sky/engine/core/rendering/RenderBoxModelObject.h delete mode 100644 sky/engine/core/rendering/RenderFlexibleBox.cpp delete mode 100644 sky/engine/core/rendering/RenderFlexibleBox.h delete mode 100644 sky/engine/core/rendering/RenderGeometryMap.cpp delete mode 100644 sky/engine/core/rendering/RenderGeometryMap.h delete mode 100644 sky/engine/core/rendering/RenderGeometryMapStep.h delete mode 100644 sky/engine/core/rendering/RenderInline.cpp delete mode 100644 sky/engine/core/rendering/RenderInline.h delete mode 100644 sky/engine/core/rendering/RenderLayer.cpp delete mode 100644 sky/engine/core/rendering/RenderLayer.h delete mode 100644 sky/engine/core/rendering/RenderLayerClipper.cpp delete mode 100644 sky/engine/core/rendering/RenderLayerClipper.h delete mode 100644 sky/engine/core/rendering/RenderLayerStackingNode.cpp delete mode 100644 sky/engine/core/rendering/RenderLayerStackingNode.h delete mode 100644 sky/engine/core/rendering/RenderLayerStackingNodeIterator.cpp delete mode 100644 sky/engine/core/rendering/RenderLayerStackingNodeIterator.h delete mode 100644 sky/engine/core/rendering/RenderLineBoxList.cpp delete mode 100644 sky/engine/core/rendering/RenderLineBoxList.h delete mode 100644 sky/engine/core/rendering/RenderObject.cpp delete mode 100644 sky/engine/core/rendering/RenderObject.h delete mode 100644 sky/engine/core/rendering/RenderObjectChildList.cpp delete mode 100644 sky/engine/core/rendering/RenderObjectChildList.h delete mode 100644 sky/engine/core/rendering/RenderObjectInlines.h delete mode 100644 sky/engine/core/rendering/RenderOverflow.h delete mode 100644 sky/engine/core/rendering/RenderOverflowTest.cpp delete mode 100644 sky/engine/core/rendering/RenderParagraph.cpp delete mode 100644 sky/engine/core/rendering/RenderParagraph.h delete mode 100644 sky/engine/core/rendering/RenderReplaced.cpp delete mode 100644 sky/engine/core/rendering/RenderReplaced.h delete mode 100644 sky/engine/core/rendering/RenderText.cpp delete mode 100644 sky/engine/core/rendering/RenderText.h delete mode 100644 sky/engine/core/rendering/RenderTheme.cpp delete mode 100644 sky/engine/core/rendering/RenderTheme.h delete mode 100644 sky/engine/core/rendering/RenderTreeAsText.cpp delete mode 100644 sky/engine/core/rendering/RenderTreeAsText.h delete mode 100644 sky/engine/core/rendering/RenderView.cpp delete mode 100644 sky/engine/core/rendering/RenderView.h delete mode 100644 sky/engine/core/rendering/RootInlineBox.cpp delete mode 100644 sky/engine/core/rendering/RootInlineBox.h delete mode 100644 sky/engine/core/rendering/ScrollAlignment.cpp delete mode 100644 sky/engine/core/rendering/ScrollAlignment.h delete mode 100644 sky/engine/core/rendering/SubtreeLayoutScope.cpp delete mode 100644 sky/engine/core/rendering/SubtreeLayoutScope.h delete mode 100644 sky/engine/core/rendering/TextRunConstructor.cpp delete mode 100644 sky/engine/core/rendering/TextRunConstructor.h delete mode 100644 sky/engine/core/rendering/VerticalPositionCache.h delete mode 100644 sky/engine/core/rendering/break_lines.cpp delete mode 100644 sky/engine/core/rendering/break_lines.h delete mode 100644 sky/engine/core/rendering/line/BreakingContext.cpp delete mode 100644 sky/engine/core/rendering/line/BreakingContextInlineHeaders.h delete mode 100644 sky/engine/core/rendering/line/LineBreaker.cpp delete mode 100644 sky/engine/core/rendering/line/LineBreaker.h delete mode 100644 sky/engine/core/rendering/line/LineInfo.h delete mode 100644 sky/engine/core/rendering/line/LineLayoutState.h delete mode 100644 sky/engine/core/rendering/line/LineWidth.cpp delete mode 100644 sky/engine/core/rendering/line/LineWidth.h delete mode 100644 sky/engine/core/rendering/line/RenderTextInfo.h delete mode 100644 sky/engine/core/rendering/line/TrailingObjects.cpp delete mode 100644 sky/engine/core/rendering/line/TrailingObjects.h delete mode 100644 sky/engine/core/rendering/line/WordMeasurement.h delete mode 100644 sky/engine/core/rendering/style/AppliedTextDecoration.cpp delete mode 100644 sky/engine/core/rendering/style/AppliedTextDecoration.h delete mode 100644 sky/engine/core/rendering/style/BorderData.h delete mode 100644 sky/engine/core/rendering/style/BorderValue.h delete mode 100644 sky/engine/core/rendering/style/CollapsedBorderValue.h delete mode 100644 sky/engine/core/rendering/style/CounterDirectives.cpp delete mode 100644 sky/engine/core/rendering/style/CounterDirectives.h delete mode 100644 sky/engine/core/rendering/style/DataEquivalency.h delete mode 100644 sky/engine/core/rendering/style/DataRef.h delete mode 100644 sky/engine/core/rendering/style/FillLayer.cpp delete mode 100644 sky/engine/core/rendering/style/FillLayer.h delete mode 100644 sky/engine/core/rendering/style/OutlineValue.h delete mode 100644 sky/engine/core/rendering/style/OutlineValueTest.cpp delete mode 100644 sky/engine/core/rendering/style/RenderStyle.cpp delete mode 100644 sky/engine/core/rendering/style/RenderStyle.h delete mode 100644 sky/engine/core/rendering/style/RenderStyleConstants.h delete mode 100644 sky/engine/core/rendering/style/ShadowData.cpp delete mode 100644 sky/engine/core/rendering/style/ShadowData.h delete mode 100644 sky/engine/core/rendering/style/ShadowList.cpp delete mode 100644 sky/engine/core/rendering/style/ShadowList.h delete mode 100644 sky/engine/core/rendering/style/ShapeValue.h delete mode 100644 sky/engine/core/rendering/style/StyleBackgroundData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleBackgroundData.h delete mode 100644 sky/engine/core/rendering/style/StyleBoxData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleBoxData.h delete mode 100644 sky/engine/core/rendering/style/StyleColor.h delete mode 100644 sky/engine/core/rendering/style/StyleDifference.h delete mode 100644 sky/engine/core/rendering/style/StyleFilterData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleFilterData.h delete mode 100644 sky/engine/core/rendering/style/StyleFlexibleBoxData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleFlexibleBoxData.h delete mode 100644 sky/engine/core/rendering/style/StyleImage.h delete mode 100644 sky/engine/core/rendering/style/StyleInheritedData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleInheritedData.h delete mode 100644 sky/engine/core/rendering/style/StyleRareInheritedData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleRareInheritedData.h delete mode 100644 sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleRareNonInheritedData.h delete mode 100644 sky/engine/core/rendering/style/StyleSurroundData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleSurroundData.h delete mode 100644 sky/engine/core/rendering/style/StyleTransformData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleTransformData.h delete mode 100644 sky/engine/core/rendering/style/StyleVisualData.cpp delete mode 100644 sky/engine/core/rendering/style/StyleVisualData.h delete mode 100644 sky/engine/platform/BUILD.gn delete mode 100644 sky/engine/platform/CalculationValue.h delete mode 100644 sky/engine/platform/Decimal.cpp delete mode 100644 sky/engine/platform/Decimal.h delete mode 100644 sky/engine/platform/DecimalTest.cpp delete mode 100644 sky/engine/platform/FloatConversion.h delete mode 100644 sky/engine/platform/Language.cpp delete mode 100644 sky/engine/platform/Language.h delete mode 100644 sky/engine/platform/LayoutUnit.h delete mode 100644 sky/engine/platform/LayoutUnitTest.cpp delete mode 100644 sky/engine/platform/Length.cpp delete mode 100644 sky/engine/platform/Length.h delete mode 100644 sky/engine/platform/LengthBox.cpp delete mode 100644 sky/engine/platform/LengthBox.h delete mode 100644 sky/engine/platform/LengthFunctions.cpp delete mode 100644 sky/engine/platform/LengthFunctions.h delete mode 100644 sky/engine/platform/LengthPoint.h delete mode 100644 sky/engine/platform/LengthSize.h delete mode 100644 sky/engine/platform/NotImplemented.h delete mode 100644 sky/engine/platform/Partitions.cpp delete mode 100644 sky/engine/platform/Partitions.h delete mode 100644 sky/engine/platform/PlatformExport.h delete mode 100644 sky/engine/platform/PurgeableVector.cpp delete mode 100644 sky/engine/platform/PurgeableVector.h delete mode 100644 sky/engine/platform/PurgeableVectorTest.cpp delete mode 100644 sky/engine/platform/SharedBuffer.cpp delete mode 100644 sky/engine/platform/SharedBuffer.h delete mode 100644 sky/engine/platform/TestingPlatformSupport.cpp delete mode 100644 sky/engine/platform/TestingPlatformSupport.h delete mode 100644 sky/engine/platform/animation/AnimationUtilities.h delete mode 100644 sky/engine/platform/animation/AnimationValue.h delete mode 100644 sky/engine/platform/animation/KeyframeValueList.cpp delete mode 100644 sky/engine/platform/animation/KeyframeValueList.h delete mode 100644 sky/engine/platform/animation/TimingFunction.cpp delete mode 100644 sky/engine/platform/animation/TimingFunction.h delete mode 100644 sky/engine/platform/animation/TimingFunctionTest.cpp delete mode 100644 sky/engine/platform/animation/UnitBezier.h delete mode 100644 sky/engine/platform/animation/UnitBezierTest.cpp delete mode 100644 sky/engine/platform/exported/Platform.cpp delete mode 100644 sky/engine/platform/exported/WebCommon.cpp delete mode 100644 sky/engine/platform/fonts/AlternateFontFamily.h delete mode 100644 sky/engine/platform/fonts/Character.cpp delete mode 100644 sky/engine/platform/fonts/Character.h delete mode 100644 sky/engine/platform/fonts/CustomFontData.h delete mode 100644 sky/engine/platform/fonts/FixedPitchFontType.h delete mode 100644 sky/engine/platform/fonts/Font.cpp delete mode 100644 sky/engine/platform/fonts/Font.h delete mode 100644 sky/engine/platform/fonts/FontBaseline.h delete mode 100644 sky/engine/platform/fonts/FontCache.cpp delete mode 100644 sky/engine/platform/fonts/FontCache.h delete mode 100644 sky/engine/platform/fonts/FontCacheClient.h delete mode 100644 sky/engine/platform/fonts/FontCacheEmpty.cpp delete mode 100644 sky/engine/platform/fonts/FontCacheKey.h delete mode 100644 sky/engine/platform/fonts/FontCacheTest.cpp delete mode 100644 sky/engine/platform/fonts/FontCustomPlatformData.h delete mode 100644 sky/engine/platform/fonts/FontData.cpp delete mode 100644 sky/engine/platform/fonts/FontData.h delete mode 100644 sky/engine/platform/fonts/FontDataCache.cpp delete mode 100644 sky/engine/platform/fonts/FontDataCache.h delete mode 100644 sky/engine/platform/fonts/FontDescription.cpp delete mode 100644 sky/engine/platform/fonts/FontDescription.h delete mode 100644 sky/engine/platform/fonts/FontDescriptionTest.cpp delete mode 100644 sky/engine/platform/fonts/FontFaceCreationParams.h delete mode 100644 sky/engine/platform/fonts/FontFallbackList.cpp delete mode 100644 sky/engine/platform/fonts/FontFallbackList.h delete mode 100644 sky/engine/platform/fonts/FontFamily.cpp delete mode 100644 sky/engine/platform/fonts/FontFamily.h delete mode 100644 sky/engine/platform/fonts/FontFamilyNames.in delete mode 100644 sky/engine/platform/fonts/FontFeatureSettings.cpp delete mode 100644 sky/engine/platform/fonts/FontFeatureSettings.h delete mode 100644 sky/engine/platform/fonts/FontMetrics.h delete mode 100644 sky/engine/platform/fonts/FontOrientation.h delete mode 100644 sky/engine/platform/fonts/FontPlatformData.cpp delete mode 100644 sky/engine/platform/fonts/FontPlatformData.h delete mode 100644 sky/engine/platform/fonts/FontPlatformFeatures.h delete mode 100644 sky/engine/platform/fonts/FontRenderStyle.h delete mode 100644 sky/engine/platform/fonts/FontSelector.h delete mode 100644 sky/engine/platform/fonts/FontSmoothingMode.h delete mode 100644 sky/engine/platform/fonts/FontTest.cpp delete mode 100644 sky/engine/platform/fonts/FontTraits.h delete mode 100644 sky/engine/platform/fonts/FontWidthVariant.h delete mode 100644 sky/engine/platform/fonts/Glyph.h delete mode 100644 sky/engine/platform/fonts/GlyphBuffer.h delete mode 100644 sky/engine/platform/fonts/GlyphMetricsMap.h delete mode 100644 sky/engine/platform/fonts/GlyphPage.h delete mode 100644 sky/engine/platform/fonts/GlyphPageTreeNode.cpp delete mode 100644 sky/engine/platform/fonts/GlyphPageTreeNode.h delete mode 100644 sky/engine/platform/fonts/GlyphPageTreeNodeTest.cpp delete mode 100644 sky/engine/platform/fonts/Latin1TextIterator.h delete mode 100644 sky/engine/platform/fonts/SegmentedFontData.cpp delete mode 100644 sky/engine/platform/fonts/SegmentedFontData.h delete mode 100644 sky/engine/platform/fonts/SimpleFontData.cpp delete mode 100644 sky/engine/platform/fonts/SimpleFontData.h delete mode 100644 sky/engine/platform/fonts/TextBlob.h delete mode 100644 sky/engine/platform/fonts/TextRenderingMode.h delete mode 100644 sky/engine/platform/fonts/TypesettingFeatures.h delete mode 100644 sky/engine/platform/fonts/VDMXParser.cpp delete mode 100644 sky/engine/platform/fonts/VDMXParser.h delete mode 100644 sky/engine/platform/fonts/WidthCache.h delete mode 100644 sky/engine/platform/fonts/WidthIterator.cpp delete mode 100644 sky/engine/platform/fonts/WidthIterator.h delete mode 100644 sky/engine/platform/fonts/apple/FontPlatformDataApple.cpp delete mode 100644 sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp delete mode 100644 sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h delete mode 100644 sky/engine/platform/fonts/harfbuzz/FontHarfBuzz.cpp delete mode 100644 sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.cpp delete mode 100644 sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.h delete mode 100644 sky/engine/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp delete mode 100644 sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.cpp delete mode 100644 sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.h delete mode 100644 sky/engine/platform/fonts/linux/FontCacheLinux.cpp delete mode 100644 sky/engine/platform/fonts/linux/FontPlatformDataLinux.cpp delete mode 100644 sky/engine/platform/fonts/mobile/FontCacheMobile.cpp delete mode 100644 sky/engine/platform/fonts/mobile/FontCacheMobileTest.cpp delete mode 100644 sky/engine/platform/fonts/opentype/OpenTypeTypes.h delete mode 100644 sky/engine/platform/fonts/opentype/OpenTypeVerticalData.cpp delete mode 100644 sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h delete mode 100644 sky/engine/platform/fonts/skia/FontCacheSkia.cpp delete mode 100644 sky/engine/platform/fonts/skia/FontCustomPlatformDataSkia.cpp delete mode 100644 sky/engine/platform/fonts/skia/FontPlatformDataSkia.cpp delete mode 100644 sky/engine/platform/fonts/skia/SimpleFontDataSkia.cpp delete mode 100644 sky/engine/platform/fonts/win/FontCacheSkiaWin.cpp delete mode 100644 sky/engine/platform/fonts/win/FontFallbackWin.cpp delete mode 100644 sky/engine/platform/fonts/win/FontFallbackWin.h delete mode 100644 sky/engine/platform/fonts/win/FontPlatformDataWin.cpp delete mode 100644 sky/engine/platform/geometry/FloatBox.h delete mode 100644 sky/engine/platform/geometry/FloatBoxExtent.h delete mode 100644 sky/engine/platform/geometry/FloatBoxTest.cpp delete mode 100644 sky/engine/platform/geometry/FloatBoxTestHelpers.cpp delete mode 100644 sky/engine/platform/geometry/FloatBoxTestHelpers.h delete mode 100644 sky/engine/platform/geometry/FloatPoint.cpp delete mode 100644 sky/engine/platform/geometry/FloatPoint.h delete mode 100644 sky/engine/platform/geometry/FloatPoint3D.cpp delete mode 100644 sky/engine/platform/geometry/FloatPoint3D.h delete mode 100644 sky/engine/platform/geometry/FloatQuad.cpp delete mode 100644 sky/engine/platform/geometry/FloatQuad.h delete mode 100644 sky/engine/platform/geometry/FloatRect.cpp delete mode 100644 sky/engine/platform/geometry/FloatRect.h delete mode 100644 sky/engine/platform/geometry/FloatRoundedRect.cpp delete mode 100644 sky/engine/platform/geometry/FloatRoundedRect.h delete mode 100644 sky/engine/platform/geometry/FloatRoundedRectTest.cpp delete mode 100644 sky/engine/platform/geometry/FloatSize.cpp delete mode 100644 sky/engine/platform/geometry/FloatSize.h delete mode 100644 sky/engine/platform/geometry/IntPoint.h delete mode 100644 sky/engine/platform/geometry/IntRect.cpp delete mode 100644 sky/engine/platform/geometry/IntRect.h delete mode 100644 sky/engine/platform/geometry/IntRectExtent.h delete mode 100644 sky/engine/platform/geometry/IntSize.h delete mode 100644 sky/engine/platform/geometry/IntSizeHash.h delete mode 100644 sky/engine/platform/geometry/LayoutBoxExtent.cpp delete mode 100644 sky/engine/platform/geometry/LayoutBoxExtent.h delete mode 100644 sky/engine/platform/geometry/LayoutPoint.h delete mode 100644 sky/engine/platform/geometry/LayoutRect.cpp delete mode 100644 sky/engine/platform/geometry/LayoutRect.h delete mode 100644 sky/engine/platform/geometry/LayoutSize.h delete mode 100644 sky/engine/platform/geometry/Region.cpp delete mode 100644 sky/engine/platform/geometry/Region.h delete mode 100644 sky/engine/platform/geometry/RegionTest.cpp delete mode 100644 sky/engine/platform/geometry/RoundedRect.cpp delete mode 100644 sky/engine/platform/geometry/RoundedRect.h delete mode 100644 sky/engine/platform/geometry/RoundedRectTest.cpp delete mode 100644 sky/engine/platform/geometry/TransformState.cpp delete mode 100644 sky/engine/platform/geometry/TransformState.h delete mode 100644 sky/engine/platform/graphics/Color.cpp delete mode 100644 sky/engine/platform/graphics/Color.h delete mode 100644 sky/engine/platform/graphics/ColorSpace.cpp delete mode 100644 sky/engine/platform/graphics/ColorSpace.h delete mode 100644 sky/engine/platform/graphics/DashArray.h delete mode 100644 sky/engine/platform/graphics/DrawLooperBuilder.cpp delete mode 100644 sky/engine/platform/graphics/DrawLooperBuilder.h delete mode 100644 sky/engine/platform/graphics/FrameData.cpp delete mode 100644 sky/engine/platform/graphics/FrameData.h delete mode 100644 sky/engine/platform/graphics/GeneratedImage.cpp delete mode 100644 sky/engine/platform/graphics/GeneratedImage.h delete mode 100644 sky/engine/platform/graphics/Gradient.cpp delete mode 100644 sky/engine/platform/graphics/Gradient.h delete mode 100644 sky/engine/platform/graphics/GradientGeneratedImage.cpp delete mode 100644 sky/engine/platform/graphics/GradientGeneratedImage.h delete mode 100644 sky/engine/platform/graphics/GraphicsContext.cpp delete mode 100644 sky/engine/platform/graphics/GraphicsContext.h delete mode 100644 sky/engine/platform/graphics/GraphicsContextState.cpp delete mode 100644 sky/engine/platform/graphics/GraphicsContextState.h delete mode 100644 sky/engine/platform/graphics/GraphicsContextStateSaver.h delete mode 100644 sky/engine/platform/graphics/GraphicsTypes.cpp delete mode 100644 sky/engine/platform/graphics/GraphicsTypes.h delete mode 100644 sky/engine/platform/graphics/Image.cpp delete mode 100644 sky/engine/platform/graphics/Image.h delete mode 100644 sky/engine/platform/graphics/ImageFilter.cpp delete mode 100644 sky/engine/platform/graphics/ImageFilter.h delete mode 100644 sky/engine/platform/graphics/ImageObserver.cpp delete mode 100644 sky/engine/platform/graphics/ImageObserver.h delete mode 100644 sky/engine/platform/graphics/ImageOrientation.cpp delete mode 100644 sky/engine/platform/graphics/ImageOrientation.h delete mode 100644 sky/engine/platform/graphics/Path.cpp delete mode 100644 sky/engine/platform/graphics/Path.h delete mode 100644 sky/engine/platform/graphics/PathTraversalState.cpp delete mode 100644 sky/engine/platform/graphics/PathTraversalState.h delete mode 100644 sky/engine/platform/graphics/Pattern.cpp delete mode 100644 sky/engine/platform/graphics/Pattern.h delete mode 100644 sky/engine/platform/graphics/RegionTracker.cpp delete mode 100644 sky/engine/platform/graphics/RegionTracker.h delete mode 100644 sky/engine/platform/graphics/StrokeData.cpp delete mode 100644 sky/engine/platform/graphics/StrokeData.h delete mode 100644 sky/engine/platform/graphics/skia/SkSizeHash.h delete mode 100644 sky/engine/platform/graphics/skia/SkiaUtils.cpp delete mode 100644 sky/engine/platform/graphics/skia/SkiaUtils.h delete mode 100644 sky/engine/platform/heap/Handle.h delete mode 100644 sky/engine/platform/testing/RunAllTests.cpp delete mode 100644 sky/engine/platform/text/BidiCharacterRun.cpp delete mode 100644 sky/engine/platform/text/BidiCharacterRun.h delete mode 100644 sky/engine/platform/text/BidiContext.cpp delete mode 100644 sky/engine/platform/text/BidiContext.h delete mode 100644 sky/engine/platform/text/BidiResolver.h delete mode 100644 sky/engine/platform/text/BidiResolverTest.cpp delete mode 100644 sky/engine/platform/text/BidiRunList.h delete mode 100644 sky/engine/platform/text/BidiTestHarness.h delete mode 100644 sky/engine/platform/text/BidiTextRun.cpp delete mode 100644 sky/engine/platform/text/BidiTextRun.h delete mode 100644 sky/engine/platform/text/ICUError.cpp delete mode 100644 sky/engine/platform/text/ICUError.h delete mode 100644 sky/engine/platform/text/LineEnding.cpp delete mode 100644 sky/engine/platform/text/LineEnding.h delete mode 100644 sky/engine/platform/text/LocaleToScriptMapping.cpp delete mode 100644 sky/engine/platform/text/LocaleToScriptMapping.h delete mode 100644 sky/engine/platform/text/NonCJKGlyphOrientation.h delete mode 100644 sky/engine/platform/text/SurrogatePairAwareTextIterator.cpp delete mode 100644 sky/engine/platform/text/SurrogatePairAwareTextIterator.h delete mode 100644 sky/engine/platform/text/TextBoundaries.cpp delete mode 100644 sky/engine/platform/text/TextBoundaries.h delete mode 100644 sky/engine/platform/text/TextBox.h delete mode 100644 sky/engine/platform/text/TextBreakIterator.cpp delete mode 100644 sky/engine/platform/text/TextBreakIterator.h delete mode 100644 sky/engine/platform/text/TextBreakIteratorICU.cpp delete mode 100644 sky/engine/platform/text/TextBreakIteratorInternalICU.cpp delete mode 100644 sky/engine/platform/text/TextBreakIteratorInternalICU.h delete mode 100644 sky/engine/platform/text/TextDecoration.h delete mode 100644 sky/engine/platform/text/TextDirection.h delete mode 100644 sky/engine/platform/text/TextPath.h delete mode 100644 sky/engine/platform/text/TextRun.cpp delete mode 100644 sky/engine/platform/text/TextRun.h delete mode 100644 sky/engine/platform/text/TextRunIterator.h delete mode 100644 sky/engine/platform/text/TextStream.cpp delete mode 100644 sky/engine/platform/text/TextStream.h delete mode 100644 sky/engine/platform/text/UnicodeBidi.h delete mode 100644 sky/engine/platform/text/UnicodeRange.cpp delete mode 100644 sky/engine/platform/text/UnicodeRange.h delete mode 100644 sky/engine/platform/text/UnicodeUtilities.cpp delete mode 100644 sky/engine/platform/text/UnicodeUtilities.h delete mode 100644 sky/engine/platform/text/UnicodeUtilitiesTest.cpp delete mode 100644 sky/engine/platform/transforms/AffineTransform.cpp delete mode 100644 sky/engine/platform/transforms/AffineTransform.h delete mode 100644 sky/engine/platform/transforms/IdentityTransformOperation.h delete mode 100644 sky/engine/platform/transforms/InterpolatedTransformOperation.cpp delete mode 100644 sky/engine/platform/transforms/InterpolatedTransformOperation.h delete mode 100644 sky/engine/platform/transforms/Matrix3DTransformOperation.cpp delete mode 100644 sky/engine/platform/transforms/Matrix3DTransformOperation.h delete mode 100644 sky/engine/platform/transforms/MatrixTransformOperation.cpp delete mode 100644 sky/engine/platform/transforms/MatrixTransformOperation.h delete mode 100644 sky/engine/platform/transforms/PerspectiveTransformOperation.cpp delete mode 100644 sky/engine/platform/transforms/PerspectiveTransformOperation.h delete mode 100644 sky/engine/platform/transforms/RotateTransformOperation.cpp delete mode 100644 sky/engine/platform/transforms/RotateTransformOperation.h delete mode 100644 sky/engine/platform/transforms/ScaleTransformOperation.cpp delete mode 100644 sky/engine/platform/transforms/ScaleTransformOperation.h delete mode 100644 sky/engine/platform/transforms/SkewTransformOperation.cpp delete mode 100644 sky/engine/platform/transforms/SkewTransformOperation.h delete mode 100644 sky/engine/platform/transforms/TransformOperation.h delete mode 100644 sky/engine/platform/transforms/TransformOperations.cpp delete mode 100644 sky/engine/platform/transforms/TransformOperations.h delete mode 100644 sky/engine/platform/transforms/TransformOperationsTest.cpp delete mode 100644 sky/engine/platform/transforms/TransformationMatrix.cpp delete mode 100644 sky/engine/platform/transforms/TransformationMatrix.h delete mode 100644 sky/engine/platform/transforms/TransformationMatrixTest.cpp delete mode 100644 sky/engine/platform/transforms/TranslateTransformOperation.cpp delete mode 100644 sky/engine/platform/transforms/TranslateTransformOperation.h delete mode 100644 sky/engine/public/BUILD.gn delete mode 100644 sky/engine/public/platform/Platform.h delete mode 100644 sky/engine/public/platform/WebBlendMode.h delete mode 100644 sky/engine/public/platform/WebCommon.h delete mode 100644 sky/engine/public/platform/WebDiscardableMemory.h delete mode 100644 sky/engine/public/web/Sky.h delete mode 100644 sky/engine/web/BUILD.gn delete mode 100644 sky/engine/web/Sky.cpp delete mode 100644 sky/engine/wtf/ASCIICType.h delete mode 100644 sky/engine/wtf/AddressSpaceRandomization.cpp delete mode 100644 sky/engine/wtf/AddressSpaceRandomization.h delete mode 100644 sky/engine/wtf/Alignment.h delete mode 100644 sky/engine/wtf/Allocator.h delete mode 100644 sky/engine/wtf/Assertions.cpp delete mode 100644 sky/engine/wtf/Assertions.h delete mode 100644 sky/engine/wtf/Atomics.h delete mode 100644 sky/engine/wtf/BUILD.gn delete mode 100644 sky/engine/wtf/BitwiseOperations.h delete mode 100644 sky/engine/wtf/ByteOrder.h delete mode 100644 sky/engine/wtf/ByteSwap.h delete mode 100644 sky/engine/wtf/CONTRIBUTORS.pthreads-win32 delete mode 100644 sky/engine/wtf/CPU.h delete mode 100644 sky/engine/wtf/CheckedArithmetic.h delete mode 100644 sky/engine/wtf/CheckedArithmeticTest.cpp delete mode 100644 sky/engine/wtf/Compiler.h delete mode 100644 sky/engine/wtf/DataLog.cpp delete mode 100644 sky/engine/wtf/DataLog.h delete mode 100644 sky/engine/wtf/DefaultAllocator.cpp delete mode 100644 sky/engine/wtf/DefaultAllocator.h delete mode 100644 sky/engine/wtf/Deque.h delete mode 100644 sky/engine/wtf/DequeTest.cpp delete mode 100644 sky/engine/wtf/DoubleBufferedDeque.h delete mode 100644 sky/engine/wtf/DoubleBufferedDequeTest.cpp delete mode 100644 sky/engine/wtf/DoublyLinkedList.h delete mode 100644 sky/engine/wtf/DynamicAnnotations.cpp delete mode 100644 sky/engine/wtf/DynamicAnnotations.h delete mode 100644 sky/engine/wtf/EnumClass.h delete mode 100644 sky/engine/wtf/FastAllocBase.h delete mode 100644 sky/engine/wtf/FastMalloc.cpp delete mode 100644 sky/engine/wtf/FastMalloc.h delete mode 100644 sky/engine/wtf/FilePrintStream.cpp delete mode 100644 sky/engine/wtf/FilePrintStream.h delete mode 100644 sky/engine/wtf/Forward.h delete mode 100644 sky/engine/wtf/GetPtr.h delete mode 100644 sky/engine/wtf/HashCountedSet.h delete mode 100644 sky/engine/wtf/HashFunctions.h delete mode 100644 sky/engine/wtf/HashIterators.h delete mode 100644 sky/engine/wtf/HashMap.h delete mode 100644 sky/engine/wtf/HashMapTest.cpp delete mode 100644 sky/engine/wtf/HashSet.h delete mode 100644 sky/engine/wtf/HashSetTest.cpp delete mode 100644 sky/engine/wtf/HashTable.cpp delete mode 100644 sky/engine/wtf/HashTable.h delete mode 100644 sky/engine/wtf/HashTableDeletedValueType.h delete mode 100644 sky/engine/wtf/HashTraits.h delete mode 100644 sky/engine/wtf/HexNumber.h delete mode 100644 sky/engine/wtf/InstanceCounter.cpp delete mode 100644 sky/engine/wtf/InstanceCounter.h delete mode 100644 sky/engine/wtf/LeakAnnotations.h delete mode 100644 sky/engine/wtf/LinkedHashSet.h delete mode 100644 sky/engine/wtf/LinkedStack.h delete mode 100644 sky/engine/wtf/ListHashSet.h delete mode 100644 sky/engine/wtf/ListHashSetTest.cpp delete mode 100644 sky/engine/wtf/Locker.h delete mode 100644 sky/engine/wtf/MainThread.cpp delete mode 100644 sky/engine/wtf/MainThread.h delete mode 100644 sky/engine/wtf/MakeUnique.h delete mode 100644 sky/engine/wtf/MallocZoneSupport.h delete mode 100644 sky/engine/wtf/MathExtras.h delete mode 100644 sky/engine/wtf/MathExtrasTest.cpp delete mode 100644 sky/engine/wtf/NonCopyingSort.h delete mode 100644 sky/engine/wtf/Noncopyable.h delete mode 100644 sky/engine/wtf/NotFound.h delete mode 100644 sky/engine/wtf/NullPtr.h delete mode 100644 sky/engine/wtf/OperatingSystem.h delete mode 100644 sky/engine/wtf/OwnPtr.h delete mode 100644 sky/engine/wtf/OwnPtrCommon.h delete mode 100644 sky/engine/wtf/PageAllocator.cpp delete mode 100644 sky/engine/wtf/PageAllocator.h delete mode 100644 sky/engine/wtf/PartitionAlloc.cpp delete mode 100644 sky/engine/wtf/PartitionAlloc.h delete mode 100644 sky/engine/wtf/PartitionAllocTest.cpp delete mode 100644 sky/engine/wtf/PassOwnPtr.h delete mode 100644 sky/engine/wtf/PassRefPtr.h delete mode 100644 sky/engine/wtf/PassTraits.h delete mode 100644 sky/engine/wtf/PrintStream.cpp delete mode 100644 sky/engine/wtf/PrintStream.h delete mode 100644 sky/engine/wtf/RawPtr.h delete mode 100644 sky/engine/wtf/RefCounted.h delete mode 100644 sky/engine/wtf/RefCountedLeakCounter.cpp delete mode 100644 sky/engine/wtf/RefCountedLeakCounter.h delete mode 100644 sky/engine/wtf/RefPtr.h delete mode 100644 sky/engine/wtf/RefPtrTest.cpp delete mode 100644 sky/engine/wtf/RefVector.h delete mode 100644 sky/engine/wtf/SaturatedArithmetic.h delete mode 100644 sky/engine/wtf/SaturatedArithmeticTest.cpp delete mode 100644 sky/engine/wtf/SizeLimits.cpp delete mode 100644 sky/engine/wtf/SpinLock.h delete mode 100644 sky/engine/wtf/StaticConstructors.h delete mode 100644 sky/engine/wtf/StdLibExtras.h delete mode 100644 sky/engine/wtf/StreamBuffer.h delete mode 100644 sky/engine/wtf/StringExtras.h delete mode 100644 sky/engine/wtf/StringExtrasTest.cpp delete mode 100644 sky/engine/wtf/StringHasher.h delete mode 100644 sky/engine/wtf/StringHasherTest.cpp delete mode 100644 sky/engine/wtf/TemporaryChange.h delete mode 100644 sky/engine/wtf/TemporaryChangeTest.cpp delete mode 100644 sky/engine/wtf/ThreadIdentifierDataPthreads.cpp delete mode 100644 sky/engine/wtf/ThreadIdentifierDataPthreads.h delete mode 100644 sky/engine/wtf/ThreadRestrictionVerifier.h delete mode 100644 sky/engine/wtf/ThreadSafeRefCounted.h delete mode 100644 sky/engine/wtf/ThreadSpecific.h delete mode 100644 sky/engine/wtf/ThreadSpecificWin.cpp delete mode 100644 sky/engine/wtf/Threading.h delete mode 100644 sky/engine/wtf/ThreadingPrimitives.h delete mode 100644 sky/engine/wtf/ThreadingPthreads.cpp delete mode 100644 sky/engine/wtf/ThreadingWin.cpp delete mode 100644 sky/engine/wtf/TypeTraits.cpp delete mode 100644 sky/engine/wtf/TypeTraits.h delete mode 100644 sky/engine/wtf/Vector.h delete mode 100644 sky/engine/wtf/VectorTest.cpp delete mode 100644 sky/engine/wtf/VectorTraits.h delete mode 100644 sky/engine/wtf/WTF.cpp delete mode 100644 sky/engine/wtf/WTF.h delete mode 100644 sky/engine/wtf/WTFExport.h delete mode 100644 sky/engine/wtf/WTFThreadData.cpp delete mode 100644 sky/engine/wtf/WTFThreadData.h delete mode 100644 sky/engine/wtf/allocator/PartitionAllocator.cpp delete mode 100644 sky/engine/wtf/allocator/PartitionAllocator.h delete mode 100644 sky/engine/wtf/allocator/Partitions.cpp delete mode 100644 sky/engine/wtf/allocator/Partitions.h delete mode 100644 sky/engine/wtf/asm/SaturatedArithmeticARM.h delete mode 100644 sky/engine/wtf/dtoa.cpp delete mode 100644 sky/engine/wtf/dtoa.h delete mode 100644 sky/engine/wtf/dtoa/LICENSE delete mode 100644 sky/engine/wtf/dtoa/README delete mode 100644 sky/engine/wtf/dtoa/bignum-dtoa.cc delete mode 100644 sky/engine/wtf/dtoa/bignum-dtoa.h delete mode 100644 sky/engine/wtf/dtoa/bignum.cc delete mode 100644 sky/engine/wtf/dtoa/bignum.h delete mode 100644 sky/engine/wtf/dtoa/cached-powers.cc delete mode 100644 sky/engine/wtf/dtoa/cached-powers.h delete mode 100644 sky/engine/wtf/dtoa/diy-fp.cc delete mode 100644 sky/engine/wtf/dtoa/diy-fp.h delete mode 100644 sky/engine/wtf/dtoa/double-conversion.cc delete mode 100644 sky/engine/wtf/dtoa/double-conversion.h delete mode 100644 sky/engine/wtf/dtoa/double.h delete mode 100644 sky/engine/wtf/dtoa/fast-dtoa.cc delete mode 100644 sky/engine/wtf/dtoa/fast-dtoa.h delete mode 100644 sky/engine/wtf/dtoa/fixed-dtoa.cc delete mode 100644 sky/engine/wtf/dtoa/fixed-dtoa.h delete mode 100644 sky/engine/wtf/dtoa/strtod.cc delete mode 100644 sky/engine/wtf/dtoa/strtod.h delete mode 100644 sky/engine/wtf/dtoa/utils.h delete mode 100644 sky/engine/wtf/testing/RunAllTests.cpp delete mode 100644 sky/engine/wtf/testing/WTFTestHelpers.cpp delete mode 100644 sky/engine/wtf/testing/WTFTestHelpers.h delete mode 100644 sky/engine/wtf/testing/WTFTestHelpersTest.cpp delete mode 100644 sky/engine/wtf/text/ASCIIFastPath.h delete mode 100644 sky/engine/wtf/text/AtomicString.cpp delete mode 100644 sky/engine/wtf/text/AtomicString.h delete mode 100644 sky/engine/wtf/text/AtomicStringHash.h delete mode 100644 sky/engine/wtf/text/AtomicStringTest.cpp delete mode 100644 sky/engine/wtf/text/CString.cpp delete mode 100644 sky/engine/wtf/text/CString.h delete mode 100644 sky/engine/wtf/text/CStringTest.cpp delete mode 100644 sky/engine/wtf/text/IntegerToStringConversion.h delete mode 100644 sky/engine/wtf/text/StringBuffer.h delete mode 100644 sky/engine/wtf/text/StringBufferTest.cpp delete mode 100644 sky/engine/wtf/text/StringBuilder.cpp delete mode 100644 sky/engine/wtf/text/StringBuilder.h delete mode 100644 sky/engine/wtf/text/StringBuilderTest.cpp delete mode 100644 sky/engine/wtf/text/StringConcatenate.h delete mode 100644 sky/engine/wtf/text/StringHash.h delete mode 100644 sky/engine/wtf/text/StringImpl.cpp delete mode 100644 sky/engine/wtf/text/StringImpl.h delete mode 100644 sky/engine/wtf/text/StringImplTest.cpp delete mode 100644 sky/engine/wtf/text/StringOperators.h delete mode 100644 sky/engine/wtf/text/StringOperatorsTest.cpp delete mode 100644 sky/engine/wtf/text/StringStatics.cpp delete mode 100644 sky/engine/wtf/text/StringStatics.h delete mode 100644 sky/engine/wtf/text/StringUTF8Adaptor.h delete mode 100644 sky/engine/wtf/text/StringView.h delete mode 100644 sky/engine/wtf/text/TextCodec.cpp delete mode 100644 sky/engine/wtf/text/TextCodec.h delete mode 100644 sky/engine/wtf/text/TextCodecASCIIFastPath.h delete mode 100644 sky/engine/wtf/text/TextCodecICU.cpp delete mode 100644 sky/engine/wtf/text/TextCodecICU.h delete mode 100644 sky/engine/wtf/text/TextCodecLatin1.cpp delete mode 100644 sky/engine/wtf/text/TextCodecLatin1.h delete mode 100644 sky/engine/wtf/text/TextCodecReplacement.cpp delete mode 100644 sky/engine/wtf/text/TextCodecReplacement.h delete mode 100644 sky/engine/wtf/text/TextCodecReplacementTest.cpp delete mode 100644 sky/engine/wtf/text/TextCodecUTF16.cpp delete mode 100644 sky/engine/wtf/text/TextCodecUTF16.h delete mode 100644 sky/engine/wtf/text/TextCodecUTF8.cpp delete mode 100644 sky/engine/wtf/text/TextCodecUTF8.h delete mode 100644 sky/engine/wtf/text/TextCodecUTF8Test.cpp delete mode 100644 sky/engine/wtf/text/TextCodecUserDefined.cpp delete mode 100644 sky/engine/wtf/text/TextCodecUserDefined.h delete mode 100644 sky/engine/wtf/text/TextEncoding.cpp delete mode 100644 sky/engine/wtf/text/TextEncoding.h delete mode 100644 sky/engine/wtf/text/TextEncodingRegistry.cpp delete mode 100644 sky/engine/wtf/text/TextEncodingRegistry.h delete mode 100644 sky/engine/wtf/text/TextPosition.cpp delete mode 100644 sky/engine/wtf/text/TextPosition.h delete mode 100644 sky/engine/wtf/text/WTFString.cpp delete mode 100644 sky/engine/wtf/text/WTFString.h delete mode 100644 sky/engine/wtf/text/WTFStringTest.cpp delete mode 100644 sky/engine/wtf/unicode/CharacterNames.h delete mode 100644 sky/engine/wtf/unicode/Collator.h delete mode 100644 sky/engine/wtf/unicode/UTF8.cpp delete mode 100644 sky/engine/wtf/unicode/UTF8.h delete mode 100644 sky/engine/wtf/unicode/Unicode.h delete mode 100644 sky/engine/wtf/unicode/icu/CollatorICU.cpp delete mode 100644 sky/engine/wtf/unicode/icu/UnicodeIcu.h diff --git a/BUILD.gn b/BUILD.gn index b5be7064e977d..c69e3549a8347 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -52,7 +52,6 @@ group("flutter") { "$flutter_root/fml:fml_unittests", "$flutter_root/runtime:runtime_unittests", "$flutter_root/shell/common:shell_unittests", - "$flutter_root/sky/engine/wtf:wtf_unittests", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", "//garnet/public/lib/fxl:fxl_unittests", diff --git a/common/settings.cc b/common/settings.cc index e6a9f24ba7fea..8123b1d321ef6 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -39,7 +39,6 @@ std::string Settings::ToString() const { stream << "use_test_fonts: " << use_test_fonts << std::endl; stream << "enable_software_rendering: " << enable_software_rendering << std::endl; - stream << "using_blink: " << using_blink << std::endl; stream << "log_tag: " << log_tag << std::endl; stream << "icu_data_path: " << icu_data_path << std::endl; stream << "assets_dir: " << assets_dir << std::endl; diff --git a/common/settings.h b/common/settings.h index 4f035d39dba8e..7aa561f255f2f 100644 --- a/common/settings.h +++ b/common/settings.h @@ -68,7 +68,6 @@ struct Settings { // call is made. fxl::Closure root_isolate_shutdown_callback; bool enable_software_rendering = false; - bool using_blink = false; bool skia_deterministic_rendering_on_cpu = false; bool verbose_logging = false; std::string log_tag = "flutter"; diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 4778784baa643..c82083e4697da 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -59,7 +59,6 @@ template("flutter_content_handler") { "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", - "$flutter_root/sky/engine/platform", "$flutter_root/third_party/txt", "$flutter_root/vulkan", "$flutter_root/fml", diff --git a/content_handler/application.cc b/content_handler/application.cc index 68bbfdde3bb0c..cb712cefe86b0 100644 --- a/content_handler/application.cc +++ b/content_handler/application.cc @@ -134,8 +134,6 @@ Application::Application( settings_.icu_data_path = ""; - settings_.using_blink = false; - settings_.assets_dir = application_assets_directory_.get(); settings_.script_snapshot_path = "snapshot_blob.bin"; diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 14d6d4c483e86..592f985b8b7d8 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -62,8 +62,6 @@ source_set("ui") { "text/paragraph_builder.h", "text/paragraph_impl.cc", "text/paragraph_impl.h", - "text/paragraph_impl_blink.cc", - "text/paragraph_impl_blink.h", "text/paragraph_impl_txt.cc", "text/paragraph_impl_txt.h", "text/text_box.cc", @@ -94,11 +92,11 @@ source_set("ui") { "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/runtime:test_font", - "$flutter_root/sky/engine", "$flutter_root/third_party/txt", "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", + "//third_party/skia:effects", "//third_party/skia:gpu", "//topaz/lib/tonic", ] diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index 5041b87c164bc..2939e896cd044 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -145,13 +145,13 @@ void Logger_PrintString(Dart_NativeArguments args) { std::stringstream stream; const auto& logger_prefix = UIDartState::Current()->logger_prefix(); -#if !OS(ANDROID) +#if !OS_ANDROID // Prepend all logs with the isolate debug name except on Android where that // prefix is specified in the log tag. if (logger_prefix.size() > 0) { stream << logger_prefix << ": "; } -#endif // !OS(ANDROID) +#endif // !OS_ANDROID // Append the log buffer obtained from Dart code. { diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index 6de40034d7071..6db7fcf6791ec 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -82,7 +82,7 @@ sk_sp EncodeImage(sk_sp image, ImageByteFormat format) { return SkData::MakeWithCopy(pixmap.addr(), pixmap.computeByteSize()); } - ASSERT(format == kRawRGBA); + FXL_CHECK(format == kRawRGBA); if (pixmap.colorType() != kRGBA_8888_SkColorType) { TRACE_EVENT0("flutter", "ConvertToRGBA"); diff --git a/lib/ui/text/paragraph.cc b/lib/ui/text/paragraph.cc index fd00f6f51b3a3..22871b9947e93 100644 --- a/lib/ui/text/paragraph.cc +++ b/lib/ui/text/paragraph.cc @@ -6,14 +6,6 @@ #include "flutter/common/settings.h" #include "flutter/common/task_runners.h" -#include "flutter/sky/engine/core/rendering/PaintInfo.h" -#include "flutter/sky/engine/core/rendering/RenderParagraph.h" -#include "flutter/sky/engine/core/rendering/RenderText.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "flutter/sky/engine/platform/text/TextBoundaries.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" #include "lib/fxl/logging.h" #include "lib/fxl/tasks/task_runner.h" #include "lib/tonic/converter/dart_converter.h" @@ -43,20 +35,11 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Paragraph); DART_BIND_ALL(Paragraph, FOR_EACH_BINDING) -Paragraph::Paragraph(PassOwnPtr renderView) - : m_paragraphImpl(std::make_unique(renderView)) {} - Paragraph::Paragraph(std::unique_ptr paragraph) : m_paragraphImpl( std::make_unique(std::move(paragraph))) {} -Paragraph::~Paragraph() { - if (m_renderView) { - RenderView* renderView = m_renderView.leakPtr(); - destruction_task_runner_->PostTask( - [renderView]() { renderView->destroy(); }); - } -} +Paragraph::~Paragraph() = default; size_t Paragraph::GetAllocationSize() { // We don't have an accurate accounting of the paragraph's memory consumption, diff --git a/lib/ui/text/paragraph.h b/lib/ui/text/paragraph.h index b3a943209ab4c..473e9bb9dd11d 100644 --- a/lib/ui/text/paragraph.h +++ b/lib/ui/text/paragraph.h @@ -8,11 +8,8 @@ #include "flutter/fml/message_loop.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" -#include "flutter/lib/ui/text/paragraph_impl_blink.h" #include "flutter/lib/ui/text/paragraph_impl_txt.h" #include "flutter/lib/ui/text/text_box.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" #include "flutter/third_party/txt/src/txt/paragraph.h" #include "lib/tonic/dart_wrappable.h" @@ -28,10 +25,6 @@ class Paragraph : public fxl::RefCountedThreadSafe, FRIEND_MAKE_REF_COUNTED(Paragraph); public: - static fxl::RefPtr Create(PassOwnPtr renderView) { - return fxl::MakeRefCounted(renderView); - } - static fxl::RefPtr Create( std::unique_ptr paragraph) { return fxl::MakeRefCounted(std::move(paragraph)); @@ -54,8 +47,6 @@ class Paragraph : public fxl::RefCountedThreadSafe, Dart_Handle getPositionForOffset(double dx, double dy); Dart_Handle getWordBoundary(unsigned offset); - RenderView* renderView() const { return m_renderView.get(); } - virtual size_t GetAllocationSize() override; static void RegisterNatives(tonic::DartLibraryNatives* natives); @@ -63,15 +54,7 @@ class Paragraph : public fxl::RefCountedThreadSafe, private: std::unique_ptr m_paragraphImpl; - explicit Paragraph(PassOwnPtr renderView); - explicit Paragraph(std::unique_ptr paragraph); - - // TODO: This can be removed when the render view association for the legacy - // runtime is removed. - fxl::RefPtr destruction_task_runner_ = - UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); - OwnPtr m_renderView; }; } // namespace blink diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index 36cf84e027e99..926819eeac8aa 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -8,11 +8,6 @@ #include "flutter/common/task_runners.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/sky/engine/core/rendering/RenderInline.h" -#include "flutter/sky/engine/core/rendering/RenderParagraph.h" -#include "flutter/sky/engine/core/rendering/RenderText.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" -#include "flutter/sky/engine/platform/text/LocaleToScriptMapping.h" #include "flutter/third_party/txt/src/txt/font_style.h" #include "flutter/third_party/txt/src/txt/font_weight.h" #include "flutter/third_party/txt/src/txt/paragraph_style.h" @@ -23,6 +18,7 @@ #include "lib/tonic/dart_args.h" #include "lib/tonic/dart_binding_macros.h" #include "lib/tonic/dart_library_natives.h" +#include "third_party/icu/source/common/unicode/ustring.h" namespace blink { namespace { @@ -83,102 +79,6 @@ const int psLineHeightMask = 1 << psLineHeightIndex; const int psEllipsisMask = 1 << psEllipsisIndex; const int psLocaleMask = 1 << psLocaleIndex; -float getComputedSizeFromSpecifiedSize(float specifiedSize) { - if (specifiedSize < std::numeric_limits::epsilon()) - return 0.0f; - return specifiedSize; -} - -void createFontForDocument(RenderStyle* style) { - FontDescription fontDescription = FontDescription(); - fontDescription.setScript( - localeToScriptCodeForFontSelection(style->locale())); - - // Using 14px default to match Material Design English Body1: - // http://www.google.com/design/spec/style/typography.html#typography-typeface - const float defaultFontSize = 14.0; - - fontDescription.setSpecifiedSize(defaultFontSize); - fontDescription.setComputedSize(defaultFontSize); - - FontOrientation fontOrientation = Horizontal; - NonCJKGlyphOrientation glyphOrientation = NonCJKGlyphOrientationVerticalRight; - - fontDescription.setOrientation(fontOrientation); - fontDescription.setNonCJKGlyphOrientation(glyphOrientation); - style->setFontDescription(fontDescription); - style->font().update(UIDartState::Current()->font_selector()); -} - -PassRefPtr decodeParagraphStyle(RenderStyle* parentStyle, - tonic::Int32List& encoded, - const std::string& fontFamily, - double fontSize, - double lineHeight, - const std::u16string& ellipsis) { - FXL_DCHECK(encoded.num_elements() == 6); // also update text.dart - - RefPtr style = RenderStyle::create(); - style->inheritFrom(parentStyle); - style->setDisplay(PARAGRAPH); - - int32_t mask = encoded[0]; - - if (mask & psTextAlignMask) - style->setTextAlign(static_cast(encoded[psTextAlignIndex])); - - if (mask & psTextDirectionMask) - style->setDirection( - static_cast(encoded[psTextDirectionIndex])); - - if (mask & (psFontWeightMask | psFontStyleMask | psFontFamilyMask | - psFontSizeMask)) { - FontDescription fontDescription = style->fontDescription(); - - if (mask & psFontWeightMask) - fontDescription.setWeight( - static_cast(encoded[psFontWeightIndex])); - - if (mask & psFontStyleMask) - fontDescription.setStyle( - static_cast(encoded[psFontStyleIndex])); - - if (mask & psFontFamilyMask) { - FontFamily family; - family.setFamily(String::fromUTF8(fontFamily)); - fontDescription.setFamily(family); - } - - if (mask & psFontSizeMask) { - fontDescription.setSpecifiedSize(fontSize); - fontDescription.setIsAbsoluteSize(true); - fontDescription.setComputedSize( - getComputedSizeFromSpecifiedSize(fontSize)); - } - - style->setFontDescription(fontDescription); - style->font().update(UIDartState::Current()->font_selector()); - } - - if (mask & psLineHeightMask) - style->setLineHeight(Length(lineHeight * 100.0, Percent)); - - if (mask & psMaxLinesMask) - style->setMaxLines(encoded[psMaxLinesIndex]); - - if (mask & psEllipsisMask) { - style->setEllipsis( - AtomicString(reinterpret_cast(ellipsis.c_str()))); - } - - return style.release(); -} - -Color getColorFromARGB(int argb) { - return Color((argb & 0x00FF0000) >> 16, (argb & 0x0000FF00) >> 8, - (argb & 0x000000FF) >> 0, (argb & 0xFF000000) >> 24); -} - } // namespace static void ParagraphBuilder_constructor(Dart_NativeArguments args) { @@ -207,11 +107,9 @@ fxl::RefPtr ParagraphBuilder::create( double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink) { + const std::string& locale) { return fxl::MakeRefCounted( - encoded, fontFamily, fontSize, lineHeight, ellipsis, locale, - UIDartState::Current()->use_blink()); + encoded, fontFamily, fontSize, lineHeight, ellipsis, locale); } ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, @@ -219,72 +117,47 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink) - : m_useBlink(use_blink) { - if (!m_useBlink) { - int32_t mask = encoded[0]; - txt::ParagraphStyle style; - if (mask & psTextAlignMask) - style.text_align = txt::TextAlign(encoded[psTextAlignIndex]); - - if (mask & psTextDirectionMask) - style.text_direction = txt::TextDirection(encoded[psTextDirectionIndex]); - - if (mask & psFontWeightMask) - style.font_weight = - static_cast(encoded[psFontWeightIndex]); - - if (mask & psFontStyleMask) - style.font_style = static_cast(encoded[psFontStyleIndex]); - - if (mask & psFontFamilyMask) - style.font_family = fontFamily; + const std::string& locale) { + int32_t mask = encoded[0]; + txt::ParagraphStyle style; + if (mask & psTextAlignMask) + style.text_align = txt::TextAlign(encoded[psTextAlignIndex]); - if (mask & psFontSizeMask) - style.font_size = fontSize; + if (mask & psTextDirectionMask) + style.text_direction = txt::TextDirection(encoded[psTextDirectionIndex]); - if (mask & psLineHeightMask) - style.line_height = lineHeight; + if (mask & psFontWeightMask) + style.font_weight = + static_cast(encoded[psFontWeightIndex]); - if (mask & psMaxLinesMask) - style.max_lines = encoded[psMaxLinesIndex]; + if (mask & psFontStyleMask) + style.font_style = static_cast(encoded[psFontStyleIndex]); - if (mask & psEllipsisMask) { - style.ellipsis = ellipsis; - } + if (mask & psFontFamilyMask) + style.font_family = fontFamily; - if (mask & psLocaleMask) { - style.locale = locale; - } + if (mask & psFontSizeMask) + style.font_size = fontSize; - m_paragraphBuilder = std::make_unique( - style, blink::FontCollection::ForProcess().GetFontCollection()); - } else { - // Blink version. - createRenderView(); + if (mask & psLineHeightMask) + style.line_height = lineHeight; - RefPtr paragraphStyle = - decodeParagraphStyle(m_renderView->style(), encoded, fontFamily, - fontSize, lineHeight, ellipsis); - encoded.Release(); + if (mask & psMaxLinesMask) + style.max_lines = encoded[psMaxLinesIndex]; - m_renderParagraph = new RenderParagraph(); - m_renderParagraph->setStyle(paragraphStyle.release()); + if (mask & psEllipsisMask) { + style.ellipsis = ellipsis; + } - m_currentRenderObject = m_renderParagraph; - m_renderView->addChild(m_currentRenderObject); + if (mask & psLocaleMask) { + style.locale = locale; } + m_paragraphBuilder = std::make_unique( + style, blink::FontCollection::ForProcess().GetFontCollection()); } // namespace blink -ParagraphBuilder::~ParagraphBuilder() { - if (m_renderView) { - RenderView* renderView = m_renderView.leakPtr(); - destruction_task_runner_->PostTask( - [renderView]() { renderView->destroy(); }); - } -} +ParagraphBuilder::~ParagraphBuilder() = default; void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, const std::string& fontFamily, @@ -299,154 +172,74 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, int32_t mask = encoded[0]; - if (!m_useBlink) { - // Set to use the properties of the previous style if the property is not - // explicitly given. - txt::TextStyle style = m_paragraphBuilder->PeekStyle(); - - if (mask & tsColorMask) - style.color = encoded[tsColorIndex]; - - if (mask & tsTextDecorationMask) { - style.decoration = - static_cast(encoded[tsTextDecorationIndex]); - } - - if (mask & tsTextDecorationColorMask) - style.decoration_color = encoded[tsTextDecorationColorIndex]; - - if (mask & tsTextDecorationStyleMask) - style.decoration_style = static_cast( - encoded[tsTextDecorationStyleIndex]); - - if (mask & tsTextBaselineMask) { - // TODO(abarth): Implement TextBaseline. The CSS version of this - // property wasn't wired up either. - } - - if (mask & (tsFontWeightMask | tsFontStyleMask | tsFontFamilyMask | - tsFontSizeMask | tsLetterSpacingMask | tsWordSpacingMask)) { - if (mask & tsFontWeightMask) - style.font_weight = - static_cast(encoded[tsFontWeightIndex]); - - if (mask & tsFontStyleMask) - style.font_style = - static_cast(encoded[tsFontStyleIndex]); - - if (mask & tsFontFamilyMask) - style.font_family = fontFamily; - - if (mask & tsFontSizeMask) - style.font_size = fontSize; - - if (mask & tsLetterSpacingMask) - style.letter_spacing = letterSpacing; - - if (mask & tsWordSpacingMask) - style.word_spacing = wordSpacing; - } - - if (mask & tsHeightMask) { - style.height = height; - } - - if (mask & tsLocaleMask) { - style.locale = locale; - } - - if (mask & tsBackgroundMask) { - Paint background(background_objects, background_data); - if (background.paint()) { - style.has_background = true; - style.background = *background.paint(); - } - } - - m_paragraphBuilder->PushStyle(style); - } else { - // Blink Version. - RefPtr style = RenderStyle::create(); - style->inheritFrom(m_currentRenderObject->style()); + // Set to use the properties of the previous style if the property is not + // explicitly given. + txt::TextStyle style = m_paragraphBuilder->PeekStyle(); - if (mask & tsColorMask) - style->setColor(getColorFromARGB(encoded[tsColorIndex])); + if (mask & tsColorMask) + style.color = encoded[tsColorIndex]; - if (mask & tsTextDecorationMask) { - style->setTextDecoration( - static_cast(encoded[tsTextDecorationIndex])); - style->applyTextDecorations(); - } + if (mask & tsTextDecorationMask) { + style.decoration = + static_cast(encoded[tsTextDecorationIndex]); + } - if (mask & tsTextDecorationColorMask) - style->setTextDecorationColor( - StyleColor(getColorFromARGB(encoded[tsTextDecorationColorIndex]))); + if (mask & tsTextDecorationColorMask) + style.decoration_color = encoded[tsTextDecorationColorIndex]; - if (mask & tsTextDecorationStyleMask) - style->setTextDecorationStyle(static_cast( - encoded[tsTextDecorationStyleIndex])); + if (mask & tsTextDecorationStyleMask) + style.decoration_style = static_cast( + encoded[tsTextDecorationStyleIndex]); - if (mask & tsTextBaselineMask) { - // TODO(abarth): Implement TextBaseline. The CSS version of this - // property wasn't wired up either. - } + if (mask & tsTextBaselineMask) { + // TODO(abarth): Implement TextBaseline. The CSS version of this + // property wasn't wired up either. + } - if (mask & (tsFontWeightMask | tsFontStyleMask | tsFontFamilyMask | - tsFontSizeMask | tsLetterSpacingMask | tsWordSpacingMask)) { - FontDescription fontDescription = style->fontDescription(); + if (mask & (tsFontWeightMask | tsFontStyleMask | tsFontFamilyMask | + tsFontSizeMask | tsLetterSpacingMask | tsWordSpacingMask)) { + if (mask & tsFontWeightMask) + style.font_weight = + static_cast(encoded[tsFontWeightIndex]); - if (mask & tsFontWeightMask) - fontDescription.setWeight( - static_cast(encoded[tsFontWeightIndex])); + if (mask & tsFontStyleMask) + style.font_style = + static_cast(encoded[tsFontStyleIndex]); - if (mask & tsFontStyleMask) - fontDescription.setStyle( - static_cast(encoded[tsFontStyleIndex])); + if (mask & tsFontFamilyMask) + style.font_family = fontFamily; - if (mask & tsFontFamilyMask) { - FontFamily family; - family.setFamily(String::fromUTF8(fontFamily)); - fontDescription.setFamily(family); - } + if (mask & tsFontSizeMask) + style.font_size = fontSize; - if (mask & tsFontSizeMask) { - fontDescription.setSpecifiedSize(fontSize); - fontDescription.setIsAbsoluteSize(true); - fontDescription.setComputedSize( - getComputedSizeFromSpecifiedSize(fontSize)); - } + if (mask & tsLetterSpacingMask) + style.letter_spacing = letterSpacing; - if (mask & tsLetterSpacingMask) - fontDescription.setLetterSpacing(letterSpacing); + if (mask & tsWordSpacingMask) + style.word_spacing = wordSpacing; + } - if (mask & tsWordSpacingMask) - fontDescription.setWordSpacing(wordSpacing); + if (mask & tsHeightMask) { + style.height = height; + } - style->setFontDescription(fontDescription); - style->font().update(UIDartState::Current()->font_selector()); - } + if (mask & tsLocaleMask) { + style.locale = locale; + } - if (mask & tsHeightMask) { - style->setLineHeight(Length(height * 100.0, Percent)); + if (mask & tsBackgroundMask) { + Paint background(background_objects, background_data); + if (background.paint()) { + style.has_background = true; + style.background = *background.paint(); } - - encoded.Release(); - - RenderObject* span = new RenderInline(); - span->setStyle(style.release()); - m_currentRenderObject->addChild(span); - m_currentRenderObject = span; } + + m_paragraphBuilder->PushStyle(style); } void ParagraphBuilder::pop() { - if (!m_useBlink) { - m_paragraphBuilder->Pop(); - } else { - // Blink Version. - if (m_currentRenderObject) - m_currentRenderObject = m_currentRenderObject->parent(); - } + m_paragraphBuilder->Pop(); } Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { @@ -462,41 +255,13 @@ Dart_Handle ParagraphBuilder::addText(const std::u16string& text) { if (error_code != U_BUFFER_OVERFLOW_ERROR) return tonic::ToDart("string is not well-formed UTF-16"); - if (!m_useBlink) { - m_paragraphBuilder->AddText(text); - } else { - // Blink Version. - if (!m_currentRenderObject) - return tonic::ToDart("paragraph has already been built"); - RenderText* renderText = - new RenderText(String(text_ptr, text.size()).impl()); - RefPtr style = RenderStyle::create(); - style->inheritFrom(m_currentRenderObject->style()); - renderText->setStyle(style.release()); - m_currentRenderObject->addChild(renderText); - } + m_paragraphBuilder->AddText(text); return Dart_Null(); } fxl::RefPtr ParagraphBuilder::build() { - m_currentRenderObject = nullptr; - if (!m_useBlink) { - return Paragraph::Create(m_paragraphBuilder->Build()); - } else { - return Paragraph::Create(m_renderView.release()); - } -} - -void ParagraphBuilder::createRenderView() { - RefPtr style = RenderStyle::create(); - style->setRTLOrdering(LogicalOrder); - style->setZIndex(0); - style->setUserModify(READ_ONLY); - createFontForDocument(style.get()); - - m_renderView = adoptPtr(new RenderView()); - m_renderView->setStyle(style.release()); + return Paragraph::Create(m_paragraphBuilder->Build()); } } // namespace blink diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 9a600f064e0cd..fb8e368cc30ee 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -8,8 +8,6 @@ #include #include "flutter/lib/ui/painting/paint.h" #include "flutter/lib/ui/text/paragraph.h" -#include "flutter/sky/engine/core/rendering/RenderObject.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" #include "flutter/third_party/txt/src/txt/paragraph_builder.h" #include "lib/tonic/dart_wrappable.h" #include "lib/tonic/typed_data/int32_list.h" @@ -33,8 +31,7 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink); + const std::string& locale); ~ParagraphBuilder() override; @@ -62,20 +59,9 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double fontSize, double lineHeight, const std::u16string& ellipsis, - const std::string& locale, - bool use_blink); - - void createRenderView(); - - // TODO: This can be removed when the render view association for the legacy - // runtime is removed. - fxl::RefPtr destruction_task_runner_ = - UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); - OwnPtr m_renderView; - RenderObject* m_renderParagraph; - RenderObject* m_currentRenderObject; + const std::string& locale); + std::unique_ptr m_paragraphBuilder; - bool m_useBlink; }; } // namespace blink diff --git a/lib/ui/text/paragraph_impl_blink.cc b/lib/ui/text/paragraph_impl_blink.cc deleted file mode 100644 index 5c50f047afa33..0000000000000 --- a/lib/ui/text/paragraph_impl_blink.cc +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/lib/ui/text/paragraph_impl_blink.h" - -#include "flutter/lib/ui/text/paragraph.h" -#include "flutter/lib/ui/text/paragraph_impl.h" -#include "flutter/sky/engine/core/rendering/PaintInfo.h" -#include "flutter/sky/engine/core/rendering/RenderParagraph.h" -#include "flutter/sky/engine/core/rendering/RenderText.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "flutter/sky/engine/platform/text/TextBoundaries.h" -#include "lib/fxl/tasks/task_runner.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" - -using tonic::ToDart; - -namespace blink { - -ParagraphImplBlink::ParagraphImplBlink(PassOwnPtr renderView) - : m_renderView(renderView) {} - -ParagraphImplBlink::~ParagraphImplBlink() { - if (m_renderView) { - RenderView* renderView = m_renderView.leakPtr(); - destruction_task_runner_->PostTask( - [renderView]() { renderView->destroy(); }); - } -} - -double ParagraphImplBlink::width() { - return firstChildBox()->width(); -} - -double ParagraphImplBlink::height() { - return firstChildBox()->height(); -} - -double ParagraphImplBlink::minIntrinsicWidth() { - return firstChildBox()->minPreferredLogicalWidth(); -} - -double ParagraphImplBlink::maxIntrinsicWidth() { - return firstChildBox()->maxPreferredLogicalWidth(); -} - -double ParagraphImplBlink::alphabeticBaseline() { - return firstChildBox()->firstLineBoxBaseline( - FontBaselineOrAuto(AlphabeticBaseline)); -} - -double ParagraphImplBlink::ideographicBaseline() { - return firstChildBox()->firstLineBoxBaseline( - FontBaselineOrAuto(IdeographicBaseline)); -} - -bool ParagraphImplBlink::didExceedMaxLines() { - RenderBox* box = firstChildBox(); - ASSERT(box->isRenderParagraph()); - RenderParagraph* paragraph = static_cast(box); - return paragraph->didExceedMaxLines(); -} - -void ParagraphImplBlink::layout(double width) { - FontCachePurgePreventer fontCachePurgePreventer; - - int maxWidth = LayoutUnit(width); // Handles infinity properly. - m_renderView->setFrameViewSize(IntSize(maxWidth, intMaxForLayoutUnit)); - m_renderView->layout(); -} - -void ParagraphImplBlink::paint(Canvas* canvas, double x, double y) { - SkCanvas* skCanvas = canvas->canvas(); - if (!skCanvas) - return; - - FontCachePurgePreventer fontCachePurgePreventer; - - // Very simplified painting to allow painting an arbitrary (layer-less) - // subtree. - RenderBox* box = firstChildBox(); - skCanvas->translate(x, y); - - GraphicsContext context(skCanvas); - Vector layers; - LayoutRect bounds = box->absoluteBoundingBoxRect(); - FXL_DCHECK(bounds.x() == 0 && bounds.y() == 0); - PaintInfo paintInfo(&context, enclosingIntRect(bounds), box); - box->paint(paintInfo, LayoutPoint(), layers); - // Note we're ignoring any layers encountered. - // TODO(abarth): Remove the concept of RenderLayers. - - skCanvas->translate(-x, -y); -} - -std::vector ParagraphImplBlink::getRectsForRange(unsigned start, - unsigned end) { - if (end <= start || start == end) - return std::vector(); - - unsigned offset = 0; - std::vector boxes; - for (RenderObject* object = m_renderView.get(); object; - object = object->nextInPreOrder()) { - if (!object->isText()) - continue; - RenderText* text = toRenderText(object); - unsigned length = text->textLength(); - if (offset + length > start) { - unsigned startOffset = offset > start ? 0 : start - offset; - unsigned endOffset = end - offset; - text->appendAbsoluteTextBoxesForRange(boxes, startOffset, endOffset); - } - offset += length; - if (offset >= end) - break; - } - - return boxes; -} - -int ParagraphImplBlink::absoluteOffsetForPosition( - const PositionWithAffinity& position) { - FXL_DCHECK(position.renderer()); - unsigned offset = 0; - for (RenderObject* object = m_renderView.get(); object; - object = object->nextInPreOrder()) { - if (object == position.renderer()) - return offset + position.offset(); - if (object->isText()) { - RenderText* text = toRenderText(object); - offset += text->textLength(); - } - } - FXL_DCHECK(false); - return 0; -} - -Dart_Handle ParagraphImplBlink::getPositionForOffset(double dx, double dy) { - LayoutPoint point(dx, dy); - PositionWithAffinity position = m_renderView->positionForPoint(point); - Dart_Handle result = Dart_NewListOf(Dart_CoreType_Int, 2); - Dart_ListSetAt(result, 0, ToDart(absoluteOffsetForPosition(position))); - Dart_ListSetAt(result, 1, ToDart(static_cast(position.affinity()))); - return result; -} - -Dart_Handle ParagraphImplBlink::getWordBoundary(unsigned offset) { - String text; - int start = 0, end = 0; - - for (RenderObject* object = m_renderView.get(); object; - object = object->nextInPreOrder()) { - if (!object->isText()) - continue; - RenderText* renderText = toRenderText(object); - text.append(renderText->text()); - } - - TextBreakIterator* it = wordBreakIterator(text, 0, text.length()); - if (it) { - end = it->following(offset); - if (end < 0) - end = it->last(); - start = it->previous(); - } - - Dart_Handle result = Dart_NewListOf(Dart_CoreType_Int, 2); - Dart_ListSetAt(result, 0, ToDart(start)); - Dart_ListSetAt(result, 1, ToDart(end)); - return result; -} - -} // namespace blink diff --git a/lib/ui/text/paragraph_impl_blink.h b/lib/ui/text/paragraph_impl_blink.h deleted file mode 100644 index ebd80f8dd5382..0000000000000 --- a/lib/ui/text/paragraph_impl_blink.h +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2015 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. - -#ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ -#define FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ - -#include "flutter/fml/message_loop.h" -#include "flutter/lib/ui/painting/canvas.h" -#include "flutter/lib/ui/text/paragraph_impl.h" -#include "flutter/lib/ui/text/text_box.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/third_party/txt/src/txt/paragraph.h" - -namespace blink { - -class ParagraphImplBlink : public ParagraphImpl { - public: - ~ParagraphImplBlink() override; - - explicit ParagraphImplBlink(PassOwnPtr renderView); - - double width() override; - double height() override; - double minIntrinsicWidth() override; - double maxIntrinsicWidth() override; - double alphabeticBaseline() override; - double ideographicBaseline() override; - bool didExceedMaxLines() override; - - void layout(double width) override; - void paint(Canvas* canvas, double x, double y) override; - - std::vector getRectsForRange(unsigned start, unsigned end) override; - Dart_Handle getPositionForOffset(double dx, double dy) override; - Dart_Handle getWordBoundary(unsigned offset) override; - - RenderView* renderView() const { return m_renderView.get(); } - - private: - RenderBox* firstChildBox() const { return m_renderView->firstChildBox(); } - - int absoluteOffsetForPosition(const PositionWithAffinity& position); - - // TODO: This can be removed when the render view association for the legacy - // runtime is removed. - fxl::RefPtr destruction_task_runner_ = - UIDartState::Current()->GetTaskRunners().GetUITaskRunner(); - OwnPtr m_renderView; -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_BLINK_H_ diff --git a/lib/ui/text/paragraph_impl_txt.h b/lib/ui/text/paragraph_impl_txt.h index 65451c9386ff6..54f5dcff8127b 100644 --- a/lib/ui/text/paragraph_impl_txt.h +++ b/lib/ui/text/paragraph_impl_txt.h @@ -7,7 +7,6 @@ #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" -#include "flutter/lib/ui/text/paragraph_impl_blink.h" #include "flutter/lib/ui/text/text_box.h" #include "flutter/third_party/txt/src/txt/paragraph.h" diff --git a/lib/ui/text/text_box.cc b/lib/ui/text/text_box.cc index 4396b170b2e89..5c9c269351b4b 100644 --- a/lib/ui/text/text_box.cc +++ b/lib/ui/text/text_box.cc @@ -26,14 +26,12 @@ Dart_Handle GetTextBoxType() { } // anonymous namespace Dart_Handle DartConverter::ToDart(const TextBox& val) { - if (val.is_null) - return Dart_Null(); constexpr int argc = 5; Dart_Handle argv[argc] = { - tonic::ToDart(val.sk_rect.fLeft), - tonic::ToDart(val.sk_rect.fTop), - tonic::ToDart(val.sk_rect.fRight), - tonic::ToDart(val.sk_rect.fBottom), + tonic::ToDart(val.rect.fLeft), + tonic::ToDart(val.rect.fTop), + tonic::ToDart(val.rect.fRight), + tonic::ToDart(val.rect.fBottom), tonic::ToDart(static_cast(val.direction)), }; return Dart_New(GetTextBoxType(), tonic::ToDart("_"), argc, argv); diff --git a/lib/ui/text/text_box.h b/lib/ui/text/text_box.h index 586d4d51bc1a3..d7acd3e507fba 100644 --- a/lib/ui/text/text_box.h +++ b/lib/ui/text/text_box.h @@ -5,9 +5,25 @@ #ifndef FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ #define FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ -#include "flutter/sky/engine/platform/text/TextBox.h" #include "lib/tonic/converter/dart_converter.h" #include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/skia/include/core/SkRect.h" + +namespace blink { + +enum class TextDirection { + rtl, + ltr, +}; + +struct TextBox { + SkRect rect; + TextDirection direction; + + TextBox(SkRect r, TextDirection d) : rect(r), direction(d) {} +}; + +} // namespace blink namespace tonic { diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 4f3de1b22f35a..77830affdd561 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -6,7 +6,6 @@ #include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/window.h" -#include "flutter/sky/engine/platform/fonts/FontSelector.h" #include "lib/tonic/converter/dart_converter.h" using tonic::ToDart; @@ -57,14 +56,6 @@ UIDartState* UIDartState::Current() { return static_cast(DartState::Current()); } -void UIDartState::set_font_selector(PassRefPtr selector) { - font_selector_ = selector; -} - -PassRefPtr UIDartState::font_selector() { - return font_selector_; -} - void UIDartState::SetWindow(std::unique_ptr window) { window_ = std::move(window); } diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index 988b680befc9a..ef1832594d3c0 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -13,7 +13,6 @@ #include "flutter/common/task_runners.h" #include "flutter/flow/skia_gpu_object.h" #include "flutter/fml/memory/weak_ptr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" #include "lib/fxl/build_config.h" #include "lib/tonic/dart_microtask_queue.h" #include "lib/tonic/dart_persistent_value.h" @@ -37,12 +36,6 @@ class UIDartState : public tonic::DartState { Window* window() const { return window_.get(); } - void set_font_selector(PassRefPtr selector); - - PassRefPtr font_selector(); - - bool use_blink() const { return use_blink_; } - const TaskRunners& GetTaskRunners() const; void ScheduleMicrotask(Dart_Handle handle); @@ -78,8 +71,6 @@ class UIDartState : public tonic::DartState { void SetWindow(std::unique_ptr window); - void set_use_blink(bool use_blink) { use_blink_ = use_blink; } - const std::string& GetAdvisoryScriptURI() const; const std::string& GetAdvisoryScriptEntrypoint() const; @@ -97,13 +88,10 @@ class UIDartState : public tonic::DartState { Dart_Port main_port_ = ILLEGAL_PORT; std::string debug_name_; std::unique_ptr window_; - RefPtr font_selector_; fxl::RefPtr skia_unref_queue_; tonic::DartMicrotaskQueue microtask_queue_; void AddOrRemoveTaskObserver(bool add); - - bool use_blink_ = false; }; } // namespace blink diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 8ed7952eaa544..259f873cd5bae 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -61,8 +61,6 @@ source_set("test_font") { source_set("runtime") { sources = [ - "asset_font_selector.cc", - "asset_font_selector.h", "dart_isolate.cc", "dart_isolate.h", "dart_service_isolate.cc", @@ -75,8 +73,6 @@ source_set("runtime") { "dart_vm.h", "embedder_resources.cc", "embedder_resources.h", - "platform_impl.cc", - "platform_impl.h", "runtime_controller.cc", "runtime_controller.h", "runtime_delegate.cc", @@ -85,8 +81,6 @@ source_set("runtime") { "service_protocol.h", "start_up.cc", "start_up.h", - "test_font_selector.cc", - "test_font_selector.h", ] deps = [ @@ -99,7 +93,6 @@ source_set("runtime") { "$flutter_root/glue", "$flutter_root/lib/io", "$flutter_root/lib/ui", - "$flutter_root/sky/engine/platform", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", @@ -118,6 +111,12 @@ source_set("runtime") { if (!flutter_aot && !is_fuchsia) { deps += [ "$flutter_root/lib/snapshot" ] } + + if (flutter_runtime_mode != "release" && !is_fuchsia) { + # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia + # instead puts Observatory into the runner's package. + deps += [ "//third_party/dart/runtime/observatory:embedded_observatory_archive" ] + } } test_fixtures("runtime_fixtures") { diff --git a/runtime/asset_font_selector.cc b/runtime/asset_font_selector.cc deleted file mode 100644 index 2a43f39e3a89b..0000000000000 --- a/runtime/asset_font_selector.cc +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/runtime/asset_font_selector.h" - -#include "flutter/assets/directory_asset_bundle.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/sky/engine/platform/fonts/FontData.h" -#include "flutter/sky/engine/platform/fonts/FontFaceCreationParams.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "lib/fxl/arraysize.h" -#include "third_party/rapidjson/rapidjson/document.h" -#include "third_party/skia/include/core/SkStream.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/ports/SkFontMgr.h" - -namespace blink { - -// Style attributes of a Flutter font asset. -struct AssetFontSelector::FlutterFontAttributes { - FlutterFontAttributes(const std::string& path); - ~FlutterFontAttributes(); - std::string asset_path; - int weight; - FontStyle style; -}; - -// A Skia typeface along with a buffer holding the raw typeface asset data. -struct AssetFontSelector::TypefaceAsset { - TypefaceAsset(); - ~TypefaceAsset(); - sk_sp typeface; - std::vector data; -}; - -namespace { - -const char kFontManifestAssetPath[] = "FontManifest.json"; - -// Weight values corresponding to the members of the FontWeight enum. -const int kFontWeightValue[] = {100, 200, 300, 400, 500, 600, 700, 800, 900}; - -const int kFontWeightNormal = kFontWeightValue[FontWeight::FontWeightNormal]; - -int getFontWeightValue(FontWeight weight) { - size_t weight_index = weight; - return (weight_index < arraysize(kFontWeightValue)) - ? kFontWeightValue[weight_index] - : kFontWeightNormal; -} - -// Compares fonts within a family to determine which one most closely matches -// a FontDescription. -struct FontMatcher { - using FlutterFontAttributes = AssetFontSelector::FlutterFontAttributes; - - FontMatcher(const FontDescription& description) - : description_(description), - target_weight_(getFontWeightValue(description.weight())) {} - - bool operator()(const FlutterFontAttributes& font1, - const FlutterFontAttributes& font2) { - if (font1.style != font2.style) { - if (font1.style == description_.style()) - return true; - if (font2.style == description_.style()) - return false; - } - - int weight_delta1 = abs(font1.weight - target_weight_); - int weight_delta2 = abs(font2.weight - target_weight_); - return weight_delta1 < weight_delta2; - } - - private: - const FontDescription& description_; - int target_weight_; -}; - -} // namespace - -void AssetFontSelector::Install(fxl::RefPtr asset_manager) { - RefPtr font_selector = - adoptRef(new AssetFontSelector(std::move(asset_manager))); - font_selector->parseFontManifest(); - UIDartState::Current()->set_font_selector(font_selector); -} - -AssetFontSelector::AssetFontSelector(fxl::RefPtr asset_manager) - : asset_manager_(std::move(asset_manager)) {} - -AssetFontSelector::~AssetFontSelector() {} - -AssetFontSelector::TypefaceAsset::TypefaceAsset() {} - -AssetFontSelector::TypefaceAsset::~TypefaceAsset() {} - -AssetFontSelector::FlutterFontAttributes::FlutterFontAttributes( - const std::string& path) - : asset_path(path), - weight(kFontWeightNormal), - style(FontStyle::FontStyleNormal) {} - -AssetFontSelector::FlutterFontAttributes::~FlutterFontAttributes() {} - -void AssetFontSelector::parseFontManifest() { - std::vector font_manifest_data; - if (!asset_manager_->GetAsBuffer(kFontManifestAssetPath, - &font_manifest_data)) { - return; - } - - rapidjson::Document document; - document.Parse(reinterpret_cast(font_manifest_data.data()), - font_manifest_data.size()); - - if (document.HasParseError()) - return; - - if (!document.IsArray()) - return; - - for (auto& family : document.GetArray()) { - if (!family.IsObject()) - continue; - - auto family_name = family.FindMember("family"); - if (family_name == family.MemberEnd() || !family_name->value.IsString()) - continue; - - auto font_list = family.FindMember("fonts"); - if (font_list == family.MemberEnd() || !font_list->value.IsArray()) - continue; - - AtomicString family_key = - AtomicString::fromUTF8(family_name->value.GetString()); - auto set_result = - font_family_map_.set(family_key, std::vector()); - std::vector& family_assets = - set_result.storedValue->value; - - for (auto& list_entry : font_list->value.GetArray()) { - if (!list_entry.IsObject()) - continue; - - auto asset_path = list_entry.FindMember("asset"); - if (asset_path == list_entry.MemberEnd() || !asset_path->value.IsString()) - continue; - - FlutterFontAttributes attributes(asset_path->value.GetString()); - - auto weight = list_entry.FindMember("weight"); - if (weight != list_entry.MemberEnd() && weight->value.IsInt()) - attributes.weight = weight->value.GetInt(); - - auto style = list_entry.FindMember("style"); - if (style != list_entry.MemberEnd() && style->value.IsString()) { - if (std::string(style->value.GetString()) == "italic") - attributes.style = FontStyle::FontStyleItalic; - } - - family_assets.push_back(attributes); - } - } -} - -PassRefPtr AssetFontSelector::getFontData( - const FontDescription& font_description, - const AtomicString& family_name) { - FontFaceCreationParams creationParams(family_name); - FontCacheKey key = font_description.cacheKey(creationParams); - RefPtr font_data = font_platform_data_cache_.get(key); - - if (font_data == nullptr) { - sk_sp typeface = - getTypefaceAsset(font_description, family_name); - if (!typeface) - return nullptr; - - bool synthetic_bold = - (font_description.weight() >= FontWeight600 && !typeface->isBold()) || - font_description.isSyntheticBold(); - bool synthetic_italic = - (font_description.style() && !typeface->isItalic()) || - font_description.isSyntheticItalic(); - FontPlatformData platform_data(typeface, family_name.utf8().data(), - font_description.effectiveFontSize(), - synthetic_bold, synthetic_italic, - font_description.orientation(), - font_description.useSubpixelPositioning()); - - font_data = SimpleFontData::create(platform_data, CustomFontData::create()); - font_platform_data_cache_.set(key, font_data); - } - - return font_data; -} - -sk_sp AssetFontSelector::getTypefaceAsset( - const FontDescription& font_description, - const AtomicString& family_name) { - auto family_iter = font_family_map_.find(family_name); - if (family_iter == font_family_map_.end()) - return nullptr; - - const std::vector& fonts = family_iter->value; - if (fonts.empty()) - return nullptr; - - std::vector::const_iterator font_iter; - if (fonts.size() == 1) { - font_iter = fonts.begin(); - } else { - font_iter = std::min_element(fonts.begin(), fonts.end(), - FontMatcher(font_description)); - } - - const std::string& asset_path = font_iter->asset_path; - auto typeface_iter = typeface_cache_.find(asset_path); - if (typeface_iter != typeface_cache_.end()) { - const TypefaceAsset* cache_asset = typeface_iter->second.get(); - return cache_asset ? cache_asset->typeface : nullptr; - } - - std::unique_ptr typeface_asset(new TypefaceAsset); - if (!asset_manager_->GetAsBuffer(asset_path, &typeface_asset->data)) { - return nullptr; - } - - sk_sp font_mgr(SkFontMgr::RefDefault()); - std::unique_ptr typeface_stream = - std::make_unique(typeface_asset->data.data(), - typeface_asset->data.size()); - typeface_asset->typeface = - font_mgr->makeFromStream(std::move(typeface_stream)); - if (typeface_asset->typeface == nullptr) { - typeface_cache_.insert(std::make_pair(asset_path, nullptr)); - return nullptr; - } - - sk_sp result = typeface_asset->typeface; - typeface_cache_.insert(std::make_pair(asset_path, std::move(typeface_asset))); - - return result; -} - -void AssetFontSelector::willUseFontData(const FontDescription& font_description, - const AtomicString& family, - UChar32 character) {} - -unsigned AssetFontSelector::version() const { - return 0; -} - -void AssetFontSelector::fontCacheInvalidated() {} - -} // namespace blink diff --git a/runtime/asset_font_selector.h b/runtime/asset_font_selector.h deleted file mode 100644 index 8d7e946d89e7e..0000000000000 --- a/runtime/asset_font_selector.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_RUNTIME_ASSET_FONT_SELECTOR_H_ -#define FLUTTER_RUNTIME_ASSET_FONT_SELECTOR_H_ - -#include -#include - -#include "flutter/assets/asset_manager.h" -#include "flutter/assets/zip_asset_store.h" -#include "flutter/sky/engine/platform/fonts/FontCacheKey.h" -#include "flutter/sky/engine/platform/fonts/FontSelector.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" - -namespace blink { - -// A FontSelector implementation that resolves custon font names to assets -// loaded from the asset directory. -class AssetFontSelector : public FontSelector { - public: - struct FlutterFontAttributes; - - ~AssetFontSelector() override; - - static void Install(fxl::RefPtr asset_manager); - - PassRefPtr getFontData(const FontDescription& font_description, - const AtomicString& family_name) override; - - void willUseFontData(const FontDescription& font_description, - const AtomicString& family, - UChar32 character) override; - - unsigned version() const override; - - void fontCacheInvalidated() override; - - private: - struct TypefaceAsset; - - explicit AssetFontSelector(fxl::RefPtr asset_manager); - - void parseFontManifest(); - - sk_sp getTypefaceAsset(const FontDescription& font_description, - const AtomicString& family_name); - - fxl::RefPtr asset_manager_; - - HashMap> font_family_map_; - - std::unordered_map> - typeface_cache_; - - typedef HashMap, - FontCacheKeyHash, - FontCacheKeyTraits> - FontPlatformDataCache; - - FontPlatformDataCache font_platform_data_cache_; -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_ASSET_FONT_SELECTOR_H_ diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 2c4a11c92c82a..976e5d22a13f4 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -85,7 +85,6 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( if (embedder_isolate) { // Only root isolates can interact with windows. embedder_isolate->SetWindow(std::move(window)); - embedder_isolate->set_use_blink(vm->GetSettings().using_blink); } root_embedder_data.release(); diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 15314d04b45ce..378a642681189 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -39,7 +39,7 @@ namespace dart { namespace observatory { -#if !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) +#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) // These two symbols are defined in |observatory_archive.cc| which is generated // by the |//third_party/dart/runtime/observatory:archive_observatory| rule. @@ -48,7 +48,7 @@ namespace observatory { extern unsigned int observatory_assets_archive_len; extern const uint8_t* observatory_assets_archive; -#endif // !OS(FUCHSIA) && (FLUTTER_RUNTIME_MODE != +#endif // !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != // FLUTTER_RUNTIME_MODE_RELEASE) } // namespace observatory @@ -148,7 +148,7 @@ void ThreadExitCallback() {} Dart_Handle GetVMServiceAssetsArchiveCallback() { #if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) return nullptr; -#elif OS(FUCHSIA) +#elif OS_FUCHSIA std::vector observatory_assets_archive; if (!files::ReadFileToVector("pkg/data/observatory.tar", &observatory_assets_archive)) { @@ -323,11 +323,11 @@ DartVM::DartVM(const Settings& settings, // precompiled code only in the debug product mode. bool use_checked_mode = !settings.dart_non_checked_mode; -#if !OS(FUCHSIA) +#if !OS_FUCHSIA if (IsRunningPrecompiledCode()) { use_checked_mode = false; } -#endif // !OS(FUCHSIA) +#endif // !OS_FUCHSIA #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG // Debug mode uses the JIT, disable code page write protection to avoid diff --git a/runtime/platform_impl.cc b/runtime/platform_impl.cc deleted file mode 100644 index 88428730cf743..0000000000000 --- a/runtime/platform_impl.cc +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2015 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. - -#include "flutter/runtime/platform_impl.h" - -namespace blink { - -PlatformImpl::PlatformImpl() {} - -PlatformImpl::~PlatformImpl() {} - -std::string PlatformImpl::defaultLocale() { - return "en-US"; -} - -} // namespace blink diff --git a/runtime/platform_impl.h b/runtime/platform_impl.h deleted file mode 100644 index 280f72e3213eb..0000000000000 --- a/runtime/platform_impl.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 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. - -#ifndef FLUTTER_RUNTIME_PLATFORM_IMPL_H_ -#define FLUTTER_RUNTIME_PLATFORM_IMPL_H_ - -#include "flutter/sky/engine/public/platform/Platform.h" -#include "lib/fxl/macros.h" - -namespace blink { - -class PlatformImpl : public Platform { - public: - explicit PlatformImpl(); - ~PlatformImpl() override; - - // blink::Platform methods: - std::string defaultLocale() override; - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformImpl); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_PLATFORM_IMPL_H_ diff --git a/runtime/test_font_selector.cc b/runtime/test_font_selector.cc deleted file mode 100644 index 11c1814fc9d4a..0000000000000 --- a/runtime/test_font_selector.cc +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/runtime/test_font_selector.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "flutter/runtime/test_font_data.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" - -namespace blink { - -void TestFontSelector::Install() { - auto font_selector = adoptRef(new TestFontSelector()); - UIDartState::Current()->set_font_selector(font_selector); -} - -TestFontSelector::TestFontSelector() = default; - -TestFontSelector::~TestFontSelector() = default; - -PassRefPtr TestFontSelector::getFontData( - const FontDescription& fontDescription, - const AtomicString& familyName) { - if (!test_typeface_) { - test_typeface_ = SkTypeface::MakeFromStream(GetTestFontData().release()); - } - - bool syntheticBold = (fontDescription.weight() >= FontWeight600 || - fontDescription.isSyntheticBold()); - bool syntheticItalic = - (fontDescription.style() || fontDescription.isSyntheticItalic()); - FontPlatformData platform_data( - test_typeface_, GetTestFontFamilyName().c_str(), - fontDescription.effectiveFontSize(), syntheticBold, syntheticItalic, - fontDescription.orientation(), fontDescription.useSubpixelPositioning()); - - return SimpleFontData::create(platform_data, CustomFontData::create()); -} - -void TestFontSelector::willUseFontData(const FontDescription&, - const AtomicString& familyName, - UChar32) {} - -unsigned TestFontSelector::version() const { - return 0; -} - -void TestFontSelector::fontCacheInvalidated() {} - -} // namespace blink diff --git a/runtime/test_font_selector.h b/runtime/test_font_selector.h deleted file mode 100644 index 90ab55bfd04a1..0000000000000 --- a/runtime/test_font_selector.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_RUNTIME_TEST_FONT_SELECTOR_H_ -#define FLUTTER_RUNTIME_TEST_FONT_SELECTOR_H_ - -#include "flutter/sky/engine/platform/fonts/FontSelector.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "lib/fxl/macros.h" -#include "third_party/skia/include/core/SkTypeface.h" - -namespace blink { - -class TestFontSelector : public FontSelector { - public: - static void Install(); - - ~TestFontSelector() override; - - PassRefPtr getFontData(const FontDescription&, - const AtomicString& familyName) override; - - void willUseFontData(const FontDescription&, - const AtomicString& familyName, - UChar32) override; - - unsigned version() const override; - - void fontCacheInvalidated() override; - - private: - sk_sp test_typeface_; - - TestFontSelector(); - - FXL_DISALLOW_COPY_AND_ASSIGN(TestFontSelector); -}; - -} // namespace blink - -#endif // FLUTTER_RUNTIME_TEST_FONT_SELECTOR_H_ diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 49227bdfdc29d..5817d1616fc13 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -99,8 +99,6 @@ source_set("common") { "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", - "$flutter_root/sky/engine/platform", - "$flutter_root/sky/engine/wtf", "$flutter_root/synchronization", "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", diff --git a/shell/common/engine.cc b/shell/common/engine.cc index fc6221d8dd2b3..fc1714c4f4715 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -11,14 +11,9 @@ #include "flutter/glue/trace_event.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/lib/ui/text/font_collection.h" -#include "flutter/runtime/asset_font_selector.h" -#include "flutter/runtime/platform_impl.h" -#include "flutter/runtime/test_font_selector.h" #include "flutter/shell/common/animator.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/shell.h" -#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" -#include "flutter/sky/engine/public/web/Sky.h" #include "lib/fxl/files/eintr_wrapper.h" #include "lib/fxl/files/file.h" #include "lib/fxl/files/path.h" @@ -51,19 +46,10 @@ Engine::Engine(Delegate& delegate, : delegate_(delegate), settings_(std::move(settings)), animator_(std::move(animator)), - legacy_sky_platform_(settings_.using_blink ? new blink::PlatformImpl() - : nullptr), load_script_error_(tonic::kNoError), activity_running_(false), have_surface_(false), weak_factory_(this) { - if (legacy_sky_platform_) { - // TODO: Remove this legacy call along with the platform. This is what makes - // the engine unable to run from multiple threads in the legacy - // configuration. - blink::InitEngine(legacy_sky_platform_.get()); - } - // Runtime controller is initialized here because it takes a reference to this // object as its delegate. The delegate may be called in the constructor and // we want to be fully initilazed by that point. @@ -77,11 +63,7 @@ Engine::Engine(Delegate& delegate, ); } -Engine::~Engine() { - if (legacy_sky_platform_) { - blink::ShutdownEngine(/* legacy_sky_platform_ */); - } -} +Engine::~Engine() = default; fml::WeakPtr Engine::GetWeakPtr() const { return weak_factory_.GetWeakPtr(); @@ -99,16 +81,11 @@ bool Engine::UpdateAssetManager( return false; } - if (settings_.using_blink) { - // Using blink as the text engine. - blink::FontFallbackList::SetUseTestFonts(settings_.use_test_fonts); + // Using libTXT as the text engine. + if (settings_.use_test_fonts) { + blink::FontCollection::ForProcess().RegisterTestFonts(); } else { - // Using libTXT as the text engine. - if (settings_.use_test_fonts) { - blink::FontCollection::ForProcess().RegisterTestFonts(); - } else { - blink::FontCollection::ForProcess().RegisterFonts(*asset_manager_.get()); - } + blink::FontCollection::ForProcess().RegisterFonts(*asset_manager_.get()); } return true; @@ -151,15 +128,6 @@ bool Engine::Run(RunConfiguration configuration) { isolate->AddIsolateShutdownCallback( settings_.root_isolate_shutdown_callback); } - - // Blink uses a per isolate font selector. - if (settings_.using_blink) { - if (settings_.use_test_fonts) { - blink::TestFontSelector::Install(); - } else { - blink::AssetFontSelector::Install(asset_manager_); - } - } } return isolate_running; diff --git a/shell/common/engine.h b/shell/common/engine.h index 615f7793a0e18..edb1915a87a3a 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -14,7 +14,6 @@ #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/viewport_metrics.h" #include "flutter/runtime/dart_vm.h" -#include "flutter/runtime/platform_impl.h" #include "flutter/runtime/runtime_controller.h" #include "flutter/runtime/runtime_delegate.h" #include "flutter/shell/common/animator.h" @@ -103,7 +102,6 @@ class Engine final : public blink::RuntimeDelegate { const blink::Settings settings_; std::unique_ptr animator_; std::unique_ptr runtime_controller_; - std::unique_ptr legacy_sky_platform_; tonic::DartErrorHandleType load_script_error_; std::string initial_route_; blink::ViewportMetrics viewport_metrics_; diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index 67689341a1586..c68c76d802974 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -27,7 +27,6 @@ TEST(ShellTest, InitializeWithInvalidThreads) { blink::Settings settings = {}; settings.task_observer_add = [](intptr_t, fxl::Closure) {}; settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; blink::TaskRunners task_runners("test", nullptr, nullptr, nullptr, nullptr); auto shell = Shell::Create( std::move(task_runners), settings, @@ -44,7 +43,6 @@ TEST(ShellTest, InitializeWithDifferentThreads) { blink::Settings settings = {}; settings.task_observer_add = [](intptr_t, fxl::Closure) {}; settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", ThreadHost::Type::Platform | ThreadHost::Type::GPU | ThreadHost::Type::IO | ThreadHost::Type::UI); @@ -68,7 +66,6 @@ TEST(ShellTest, InitializeWithSingleThread) { blink::Settings settings = {}; settings.task_observer_add = [](intptr_t, fxl::Closure) {}; settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; ThreadHost thread_host("io.flutter.test." + CURRENT_TEST_NAME + ".", ThreadHost::Type::Platform); auto task_runner = thread_host.platform_thread->GetTaskRunner(); @@ -89,7 +86,6 @@ TEST(ShellTest, InitializeWithSingleThreadWhichIsTheCallingThread) { blink::Settings settings = {}; settings.task_observer_add = [](intptr_t, fxl::Closure) {}; settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; fml::MessageLoop::EnsureInitializedForCurrentThread(); auto task_runner = fml::MessageLoop::GetCurrent().GetTaskRunner(); blink::TaskRunners task_runners("test", task_runner, task_runner, task_runner, @@ -109,7 +105,6 @@ TEST(ShellTest, InitializeWithMultipleThreadButCallingThreadAsPlatformThread) { blink::Settings settings = {}; settings.task_observer_add = [](intptr_t, fxl::Closure) {}; settings.task_observer_remove = [](intptr_t) {}; - settings.using_blink = false; ThreadHost thread_host( "io.flutter.test." + CURRENT_TEST_NAME + ".", ThreadHost::Type::GPU | ThreadHost::Type::IO | ThreadHost::Type::UI); diff --git a/shell/common/switches.cc b/shell/common/switches.cc index bd12301c7ba4c..9e76882418346 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -144,9 +144,6 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { settings.enable_software_rendering = command_line.HasOption(FlagForSwitch(Switch::EnableSoftwareRendering)); - settings.using_blink = - command_line.HasOption(FlagForSwitch(Switch::EnableBlink)); - settings.endless_trace_buffer = command_line.HasOption(FlagForSwitch(Switch::EndlessTraceBuffer)); diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index c6f7acd6be76a..721733b96490b 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -42,7 +42,6 @@ source_set("flutter_channels") { "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", - "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", "//third_party/skia", ] diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index a1023737973a7..338b0479dee77 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -21,7 +21,6 @@ source_set("common") { "$flutter_root/runtime", "$flutter_root/shell/common", "$flutter_root/shell/gpu", - "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", "//third_party/skia", diff --git a/shell/platform/darwin/desktop/flutter_window.mm b/shell/platform/darwin/desktop/flutter_window.mm index 4c87200fb3856..097b71a560c76 100644 --- a/shell/platform/darwin/desktop/flutter_window.mm +++ b/shell/platform/darwin/desktop/flutter_window.mm @@ -115,8 +115,6 @@ - (void)setupShell { [[NSBundle mainBundle] pathForResource:@"icudtl.dat" ofType:@""].UTF8String; } - settings.using_blink = false; - settings.task_observer_add = [](intptr_t key, fxl::Closure callback) { fml::MessageLoop::GetCurrent().AddTaskObserver(key, std::move(callback)); }; diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 8946ee954c23a..19d2486a69fa4 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -81,6 +81,7 @@ shared_library("create_flutter_framework_dylib") { sources += _flutter_framework_headers deps = [ + "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", "$flutter_root/glue", @@ -89,10 +90,9 @@ shared_library("create_flutter_framework_dylib") { "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", - "$flutter_root/sky/engine/platform", - "$flutter_root/sky/engine/wtf", "//garnet/public/lib/fxl", "//third_party/skia", + "//third_party/skia:gpu", ] if (flutter_runtime_mode == "debug") { deps += [ diff --git a/sky/engine/BUILD.gn b/sky/engine/BUILD.gn deleted file mode 100644 index be0496160341c..0000000000000 --- a/sky/engine/BUILD.gn +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2014 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. - -# inside_blink ----------------------------------------------------------------- - -config("inside_blink") { - defines = [ - "BLINK_IMPLEMENTATION=1", - "INSIDE_BLINK", - ] -} - -# config ----------------------------------------------------------------------- - -config("config") { - include_dirs = [ - ".", - "$root_out_dir", - ] - - if (!is_win) { - cflags = [ "-Wno-inconsistent-missing-override" ] - } else { - defines = [ "_USE_MATH_DEFINES" ] - } - - if (is_fuchsia) { - # TODO(abarth): Remove once the kernel support unmapping memory properly. - defines = [ "MEMORY_TOOL_REPLACES_ALLOCATOR" ] - } -} - -# The follow configs apply to all targets except for unit tests, which rely on -# static initializers. -config("non_test_config") { - cflags = [] - - if (is_clang) { - cflags += [ "-Wglobal-constructors" ] - } -} - -group("engine") { - public_configs = [ ":config" ] - - public_deps = [ - "$flutter_root/sky/engine/core", - "$flutter_root/sky/engine/platform", - "$flutter_root/sky/engine/web", - "$flutter_root/sky/engine/wtf", - ] -} diff --git a/sky/engine/core/BUILD.gn b/sky/engine/core/BUILD.gn deleted file mode 100644 index 9244c25c90991..0000000000000 --- a/sky/engine/core/BUILD.gn +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2014 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("$flutter_root/common/config.gni") -import("$flutter_root/sky/engine/core/core.gni") - -visibility = [ - "$flutter_root/sky/engine/*", - "$flutter_root/sky/shell/*", -] - -static_library("core") { - output_name = "sky_core" - - deps = [ - "$flutter_root/assets", - "$flutter_root/sky/engine/platform", - ] - - if (flutter_runtime_mode != "release" && !is_fuchsia) { - # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia - # instead puts Observatory into the runner's package. - deps += [ "//third_party/dart/runtime/observatory:embedded_observatory_archive" ] - } - - configs += [ - "$flutter_root/sky/engine:config", - "$flutter_root/sky/engine:inside_blink", - ] - - public_configs = [ - "$flutter_root:config", - ] - - sources = sky_core_files - - public_deps = [ - "$flutter_root/common", - "$flutter_root/flow", - "$flutter_root/glue", - "$flutter_root/sky/engine/wtf", - "//garnet/public/lib/fxl", - "//third_party/libpng", - "//third_party/skia", - "//third_party/zlib", - "//topaz/lib/tonic", - ] - -} diff --git a/sky/engine/core/Init.cpp b/sky/engine/core/Init.cpp deleted file mode 100644 index 7ddd99626802e..0000000000000 --- a/sky/engine/core/Init.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/Init.h" - -#include "flutter/sky/engine/platform/Partitions.h" -#include "flutter/sky/engine/wtf/text/StringImpl.h" -#include "flutter/sky/engine/wtf/text/StringStatics.h" - -namespace blink { - -void CoreInitializer::init() { - ASSERT(!m_isInited); - m_isInited = true; - - // It would make logical sense to do this in WTF::initialize() but there are - // ordering dependencies, e.g. about "xmlns". - WTF::StringStatics::init(); - - Partitions::init(); - - StringImpl::freezeStaticStrings(); -} - -void CoreInitializer::shutdown() { - Partitions::shutdown(); -} - -} // namespace blink diff --git a/sky/engine/core/Init.h b/sky/engine/core/Init.h deleted file mode 100644 index f92f519d9d5e0..0000000000000 --- a/sky/engine/core/Init.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_INIT_H_ -#define SKY_ENGINE_CORE_INIT_H_ - -namespace blink { - -class CoreInitializer { - public: - CoreInitializer() : m_isInited(false) {} - // Should be called by clients before trying to create Frames. - virtual void init(); - - // FIXME: Why is this function static? - static void shutdown(); - - protected: - bool isInitialized() const { return m_isInited; } - - bool m_isInited; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_INIT_H_ diff --git a/sky/engine/core/LICENSE-APPLE b/sky/engine/core/LICENSE-APPLE deleted file mode 100644 index f29b41c3b2a31..0000000000000 --- a/sky/engine/core/LICENSE-APPLE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sky/engine/core/LICENSE-LGPL-2 b/sky/engine/core/LICENSE-LGPL-2 deleted file mode 100644 index c60d9b9c50b5a..0000000000000 --- a/sky/engine/core/LICENSE-LGPL-2 +++ /dev/null @@ -1,481 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/sky/engine/core/LICENSE-LGPL-2.1 b/sky/engine/core/LICENSE-LGPL-2.1 deleted file mode 100644 index b2787a69a0384..0000000000000 --- a/sky/engine/core/LICENSE-LGPL-2.1 +++ /dev/null @@ -1,502 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/sky/engine/core/core.gni b/sky/engine/core/core.gni deleted file mode 100644 index 797aa2d6692a6..0000000000000 --- a/sky/engine/core/core.gni +++ /dev/null @@ -1,151 +0,0 @@ -# Copyright 2014 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. - -sky_core_output_dir = "$root_gen_dir/sky/core" - -sky_core_files = [ - "Init.cpp", - "Init.h", - "editing/CompositionUnderline.h", - "editing/CompositionUnderlineRangeFilter.cpp", - "editing/CompositionUnderlineRangeFilter.h", - "editing/PositionWithAffinity.cpp", - "editing/PositionWithAffinity.h", - "rendering/BidiRun.h", - "rendering/BidiRunForLine.cpp", - "rendering/BidiRunForLine.h", - "rendering/ClipPathOperation.h", - "rendering/ClipRect.cpp", - "rendering/ClipRect.h", - "rendering/ClipRects.h", - "rendering/ClipRectsCache.h", - "rendering/GapRects.h", - "rendering/HitTestLocation.cpp", - "rendering/HitTestLocation.h", - "rendering/HitTestRequest.h", - "rendering/HitTestResult.cpp", - "rendering/HitTestResult.h", - "rendering/HitTestingTransformState.cpp", - "rendering/HitTestingTransformState.h", - "rendering/InlineBox.cpp", - "rendering/InlineBox.h", - "rendering/InlineFlowBox.cpp", - "rendering/InlineFlowBox.h", - "rendering/InlineIterator.h", - "rendering/InlineTextBox.cpp", - "rendering/InlineTextBox.h", - "rendering/LayerPaintingInfo.h", - "rendering/OrderIterator.cpp", - "rendering/OrderIterator.h", - "rendering/PaintInfo.h", - "rendering/PointerEventsHitRules.cpp", - "rendering/PointerEventsHitRules.h", - "rendering/RenderBlock.cpp", - "rendering/RenderBlock.h", - "rendering/RenderBox.cpp", - "rendering/RenderBox.h", - "rendering/RenderBoxModelObject.cpp", - "rendering/RenderBoxModelObject.h", - "rendering/RenderFlexibleBox.cpp", - "rendering/RenderFlexibleBox.h", - "rendering/RenderGeometryMap.cpp", - "rendering/RenderGeometryMap.h", - "rendering/RenderGeometryMapStep.h", - "rendering/RenderInline.cpp", - "rendering/RenderInline.h", - "rendering/RenderLayer.cpp", - "rendering/RenderLayer.h", - "rendering/RenderLayerClipper.cpp", - "rendering/RenderLayerClipper.h", - "rendering/RenderLayerStackingNode.cpp", - "rendering/RenderLayerStackingNode.h", - "rendering/RenderLayerStackingNodeIterator.cpp", - "rendering/RenderLayerStackingNodeIterator.h", - "rendering/RenderLineBoxList.cpp", - "rendering/RenderLineBoxList.h", - "rendering/RenderObject.cpp", - "rendering/RenderObject.h", - "rendering/RenderObjectChildList.cpp", - "rendering/RenderObjectChildList.h", - "rendering/RenderObjectInlines.h", - "rendering/RenderOverflow.h", - "rendering/RenderParagraph.cpp", - "rendering/RenderParagraph.h", - "rendering/RenderReplaced.cpp", - "rendering/RenderReplaced.h", - "rendering/RenderText.cpp", - "rendering/RenderText.h", - "rendering/RenderTheme.cpp", - "rendering/RenderTheme.h", - "rendering/RenderTreeAsText.cpp", - "rendering/RenderTreeAsText.h", - "rendering/RenderView.cpp", - "rendering/RenderView.h", - "rendering/RootInlineBox.cpp", - "rendering/RootInlineBox.h", - "rendering/ScrollAlignment.cpp", - "rendering/ScrollAlignment.h", - "rendering/SubtreeLayoutScope.cpp", - "rendering/SubtreeLayoutScope.h", - "rendering/TextRunConstructor.cpp", - "rendering/TextRunConstructor.h", - "rendering/VerticalPositionCache.h", - "rendering/break_lines.cpp", - "rendering/break_lines.h", - "rendering/line/BreakingContext.cpp", - "rendering/line/BreakingContextInlineHeaders.h", - "rendering/line/LineBreaker.cpp", - "rendering/line/LineBreaker.h", - "rendering/line/LineInfo.h", - "rendering/line/LineLayoutState.h", - "rendering/line/LineWidth.cpp", - "rendering/line/LineWidth.h", - "rendering/line/RenderTextInfo.h", - "rendering/line/TrailingObjects.cpp", - "rendering/line/TrailingObjects.h", - "rendering/line/WordMeasurement.h", - "rendering/style/AppliedTextDecoration.cpp", - "rendering/style/AppliedTextDecoration.h", - "rendering/style/BorderData.h", - "rendering/style/BorderValue.h", - "rendering/style/CollapsedBorderValue.h", - "rendering/style/CounterDirectives.cpp", - "rendering/style/CounterDirectives.h", - "rendering/style/DataEquivalency.h", - "rendering/style/DataRef.h", - "rendering/style/FillLayer.cpp", - "rendering/style/FillLayer.h", - "rendering/style/OutlineValue.h", - "rendering/style/RenderStyle.cpp", - "rendering/style/RenderStyle.h", - "rendering/style/RenderStyleConstants.h", - "rendering/style/ShadowData.cpp", - "rendering/style/ShadowData.h", - "rendering/style/ShadowList.cpp", - "rendering/style/ShadowList.h", - "rendering/style/ShapeValue.h", - "rendering/style/StyleBackgroundData.cpp", - "rendering/style/StyleBackgroundData.h", - "rendering/style/StyleBoxData.cpp", - "rendering/style/StyleBoxData.h", - "rendering/style/StyleColor.h", - "rendering/style/StyleDifference.h", - "rendering/style/StyleFilterData.cpp", - "rendering/style/StyleFilterData.h", - "rendering/style/StyleFlexibleBoxData.cpp", - "rendering/style/StyleFlexibleBoxData.h", - "rendering/style/StyleImage.h", - "rendering/style/StyleInheritedData.cpp", - "rendering/style/StyleInheritedData.h", - "rendering/style/StyleRareInheritedData.cpp", - "rendering/style/StyleRareInheritedData.h", - "rendering/style/StyleRareNonInheritedData.cpp", - "rendering/style/StyleRareNonInheritedData.h", - "rendering/style/StyleSurroundData.cpp", - "rendering/style/StyleSurroundData.h", - "rendering/style/StyleTransformData.cpp", - "rendering/style/StyleTransformData.h", - "rendering/style/StyleVisualData.cpp", - "rendering/style/StyleVisualData.h", -] diff --git a/sky/engine/core/editing/CompositionUnderline.h b/sky/engine/core/editing/CompositionUnderline.h deleted file mode 100644 index de6b8228f426d..0000000000000 --- a/sky/engine/core/editing/CompositionUnderline.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_EDITING_COMPOSITIONUNDERLINE_H_ -#define SKY_ENGINE_CORE_EDITING_COMPOSITIONUNDERLINE_H_ - -#include "flutter/sky/engine/platform/graphics/Color.h" - -namespace blink { - -struct CompositionUnderline { - CompositionUnderline() - : startOffset(0), - endOffset(0), - color(Color::transparent), - thick(false), - backgroundColor(Color::transparent) {} - - // FIXME(huangs): remove this constructor. - CompositionUnderline(unsigned s, unsigned e, const Color& c, bool t) - : startOffset(s), - endOffset(e), - color(c), - thick(t), - backgroundColor(Color::transparent) {} - - CompositionUnderline(unsigned s, - unsigned e, - const Color& c, - bool t, - const Color& bc) - : startOffset(s), endOffset(e), color(c), thick(t), backgroundColor(bc) {} - - unsigned startOffset; - unsigned endOffset; - Color color; - bool thick; - Color backgroundColor; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_EDITING_COMPOSITIONUNDERLINE_H_ diff --git a/sky/engine/core/editing/CompositionUnderlineRangeFilter.cpp b/sky/engine/core/editing/CompositionUnderlineRangeFilter.cpp deleted file mode 100644 index 46fe582a029d9..0000000000000 --- a/sky/engine/core/editing/CompositionUnderlineRangeFilter.cpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/core/editing/CompositionUnderlineRangeFilter.h" - -namespace blink { - -CompositionUnderlineRangeFilter::CompositionUnderlineRangeFilter( - const Vector& underlines, - size_t indexLo, - size_t indexHi) - : m_underlines(underlines), - m_indexLo(indexLo), - m_indexHi(indexHi), - m_theEnd(this, kNotFound) {} - -size_t CompositionUnderlineRangeFilter::seekValidIndex(size_t index) { - if (index == kNotFound) - return kNotFound; - - size_t numUnderlines = m_underlines.size(); - while (index < numUnderlines) { - const CompositionUnderline& underline = m_underlines[index]; - - if (underline.endOffset <= m_indexLo) { - // |underline| lies before the query range: keep on looking. - ++index; - } else if (underline.startOffset <= m_indexHi) { - // |underline| intersects with the query range: valid, so return. - return index; - } else { - // |underline| is completely after the query range: bail. - break; - } - } - return kNotFound; -} - -} // namespace blink diff --git a/sky/engine/core/editing/CompositionUnderlineRangeFilter.h b/sky/engine/core/editing/CompositionUnderlineRangeFilter.h deleted file mode 100644 index 01215cd292fb4..0000000000000 --- a/sky/engine/core/editing/CompositionUnderlineRangeFilter.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_CORE_EDITING_COMPOSITIONUNDERLINERANGEFILTER_H_ -#define SKY_ENGINE_CORE_EDITING_COMPOSITIONUNDERLINERANGEFILTER_H_ - -#include "flutter/sky/engine/core/editing/CompositionUnderline.h" -#include "flutter/sky/engine/wtf/NotFound.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -// A visitor class to yield elements of a sorted (by startOffset) list of -// underlines, visiting only elements that intersect with specified *inclusive* -// range [indexLo, indexHi]. -class CompositionUnderlineRangeFilter { - WTF_MAKE_NONCOPYABLE(CompositionUnderlineRangeFilter); - - public: - class ConstIterator { - public: - ConstIterator() : m_filter(nullptr), m_index(0) {} - const CompositionUnderline& operator*() { - ASSERT(m_index != kNotFound); - return m_filter->m_underlines[m_index]; - } - ConstIterator& operator++() { - if (m_index != kNotFound) - m_index = m_filter->seekValidIndex(m_index + 1); - return *this; - } - const CompositionUnderline* operator->() { - ASSERT(m_index != kNotFound); - return &m_filter->m_underlines[m_index]; - } - bool operator==(const ConstIterator& other) { - return other.m_index == m_index && other.m_filter == m_filter; - } - bool operator!=(const ConstIterator& other) { return !operator==(other); } - - private: - friend class CompositionUnderlineRangeFilter; - - ConstIterator(CompositionUnderlineRangeFilter* filter, size_t index) - : m_filter(filter), m_index(index) {} - CompositionUnderlineRangeFilter* m_filter; - size_t m_index; - }; - - CompositionUnderlineRangeFilter( - const Vector& underlines, - size_t indexLo, - size_t indexHi); - - ConstIterator begin() { return ConstIterator(this, seekValidIndex(0)); } - const ConstIterator& end() { return m_theEnd; } - - private: - friend class ConstIterator; - - // Returns |index| if |m_underlines[index]| intersects with range - // [m_indexLo, m_indexHi]. Otherwise returns the index of the next - // intersecting interval, or END if there are none left. - size_t seekValidIndex(size_t index); - - // Assume that elements of |m_underlines| are sorted by |.startOffset|. - const Vector& m_underlines; - // The "query range" is the inclusive range [m_indexLo, m_indexHi]. - const size_t m_indexLo; - const size_t m_indexHi; - const ConstIterator m_theEnd; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_EDITING_COMPOSITIONUNDERLINERANGEFILTER_H_ diff --git a/sky/engine/core/editing/PositionWithAffinity.cpp b/sky/engine/core/editing/PositionWithAffinity.cpp deleted file mode 100644 index f4cb5c76c6172..0000000000000 --- a/sky/engine/core/editing/PositionWithAffinity.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/core/editing/PositionWithAffinity.h" - -namespace blink { - -PositionWithAffinity::PositionWithAffinity(RenderObject* renderer, - int offset, - EAffinity affinity) - : m_renderer(renderer), m_offset(offset), m_affinity(affinity) {} - -PositionWithAffinity::~PositionWithAffinity() {} - -} // namespace blink diff --git a/sky/engine/core/editing/PositionWithAffinity.h b/sky/engine/core/editing/PositionWithAffinity.h deleted file mode 100644 index 1a4d251cdd79b..0000000000000 --- a/sky/engine/core/editing/PositionWithAffinity.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_CORE_EDITING_POSITIONWITHAFFINITY_H_ -#define SKY_ENGINE_CORE_EDITING_POSITIONWITHAFFINITY_H_ - -namespace blink { - -class RenderObject; - -enum EAffinity { UPSTREAM, DOWNSTREAM }; - -// VisiblePosition default affinity is downstream because -// the callers do not really care (they just want the -// deep position without regard to line position), and this -// is cheaper than UPSTREAM -#define VP_DEFAULT_AFFINITY DOWNSTREAM - -// Callers who do not know where on the line the position is, -// but would like UPSTREAM if at a line break or DOWNSTREAM -// otherwise, need a clear way to specify that. The -// constructors auto-correct UPSTREAM to DOWNSTREAM if the -// position is not at a line break. -#define VP_UPSTREAM_IF_POSSIBLE UPSTREAM - -class PositionWithAffinity { - public: - PositionWithAffinity(RenderObject* renderer, - int offset, - EAffinity = DOWNSTREAM); - ~PositionWithAffinity(); - - RenderObject* renderer() const { return m_renderer; } - int offset() const { return m_offset; } - EAffinity affinity() const { return m_affinity; } - - private: - RenderObject* m_renderer; - int m_offset; - EAffinity m_affinity; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_EDITING_POSITIONWITHAFFINITY_H_ diff --git a/sky/engine/core/rendering/BidiRun.h b/sky/engine/core/rendering/BidiRun.h deleted file mode 100644 index 37ee047ed16ed..0000000000000 --- a/sky/engine/core/rendering/BidiRun.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_BIDIRUN_H_ -#define SKY_ENGINE_CORE_RENDERING_BIDIRUN_H_ - -#include "flutter/sky/engine/core/rendering/RenderText.h" -#include "flutter/sky/engine/platform/text/BidiResolver.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" - -namespace blink { - -class BidiContext; -class InlineBox; - -struct BidiRun : BidiCharacterRun { - BidiRun(int start, - int stop, - RenderObject* object, - BidiContext* context, - WTF::Unicode::Direction dir) - : BidiCharacterRun(start, stop, context, dir), - m_object(object), - m_box(0) { - // Stored in base class to save space. - m_hasHyphen = false; - m_hasAddedEllipsis = false; - } - - BidiRun* next() { return static_cast(m_next); } - RenderObject* object() { return m_object; } - - public: - RenderObject* m_object; - InlineBox* m_box; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_BIDIRUN_H_ diff --git a/sky/engine/core/rendering/BidiRunForLine.cpp b/sky/engine/core/rendering/BidiRunForLine.cpp deleted file mode 100644 index 3dc4cc4b09bf2..0000000000000 --- a/sky/engine/core/rendering/BidiRunForLine.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. - * All right reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/BidiRunForLine.h" - -#include "flutter/sky/engine/core/rendering/InlineIterator.h" - -namespace blink { - -using namespace WTF::Unicode; - -static RenderObject* firstRenderObjectForDirectionalityDetermination( - RenderObject* root, - RenderObject* current = 0) { - RenderObject* next = current; - while (current) { - if (isIsolated(current->style()->unicodeBidi()) && - (current->isRenderInline() || current->isRenderBlock())) { - if (current != root) - current = 0; - else - current = next; - break; - } - current = current->parent(); - } - - if (!current) - current = root->slowFirstChild(); - - while (current) { - next = 0; - if (isIteratorTarget(current) && - !(current->isText() && - toRenderText(current)->isAllCollapsibleWhitespace())) - break; - - if (!isIteratorTarget(current) && - !isIsolated(current->style()->unicodeBidi())) - next = current->slowFirstChild(); - - if (!next) { - while (current && current != root) { - next = current->nextSibling(); - if (next) - break; - current = current->parent(); - } - } - - if (!next) - break; - - current = next; - } - - return current; -} - -TextDirection determinePlaintextDirectionality(RenderObject* root, - RenderObject* current, - unsigned pos) { - InlineIterator iter( - root, firstRenderObjectForDirectionalityDetermination(root, current), - pos); - InlineBidiResolver observer; - observer.setStatus(BidiStatus(root->style()->direction(), - isOverride(root->style()->unicodeBidi()))); - observer.setPositionIgnoringNestedIsolates(iter); - return observer.determineParagraphDirectionality(); -} - -// FIXME: This should be a BidiStatus constructor or create method. -static inline BidiStatus statusWithDirection(TextDirection textDirection, - bool isOverride) { - WTF::Unicode::Direction direction = - textDirection == LTR ? LeftToRight : RightToLeft; - RefPtr context = BidiContext::create( - textDirection == LTR ? 0 : 1, direction, isOverride, FromStyleOrDOM); - - // This copies BidiStatus and may churn the ref on BidiContext. - // I doubt it matters. - return BidiStatus(direction, direction, direction, context.release()); -} - -static inline void setupResolverToResumeInIsolate(InlineBidiResolver& resolver, - RenderObject* root, - RenderObject* startObject) { - if (root != startObject) { - RenderObject* parent = startObject->parent(); - setupResolverToResumeInIsolate(resolver, root, parent); - notifyObserverEnteredObject(&resolver, startObject); - } -} - -static void restoreIsolatedMidpointStates( - InlineBidiResolver& topResolver, - InlineBidiResolver& isolatedResolver) { - while (!isolatedResolver.isolatedRuns().isEmpty()) { - BidiRun* run = isolatedResolver.isolatedRuns().last(); - isolatedResolver.isolatedRuns().removeLast(); - topResolver.setMidpointStateForIsolatedRun( - run, isolatedResolver.midpointStateForIsolatedRun(run)); - } -} - -void constructBidiRunsForLine(InlineBidiResolver& topResolver, - BidiRunList& bidiRuns, - const InlineIterator& endOfLine, - VisualDirectionOverride override, - bool previousLineBrokeCleanly, - bool isNewUBAParagraph) { - // FIXME: We should pass a BidiRunList into createBidiRunsForLine instead - // of the resolver owning the runs. - ASSERT(&topResolver.runs() == &bidiRuns); - ASSERT(topResolver.position() != endOfLine); - RenderObject* currentRoot = topResolver.position().root(); - topResolver.createBidiRunsForLine(endOfLine, override, - previousLineBrokeCleanly); - - while (!topResolver.isolatedRuns().isEmpty()) { - // It does not matter which order we resolve the runs as long as we - // resolve them all. - BidiRun* isolatedRun = topResolver.isolatedRuns().last(); - topResolver.isolatedRuns().removeLast(); - - RenderObject* startObj = isolatedRun->object(); - - // Only inlines make sense with unicode-bidi: isolate (blocks are - // already isolated). - // FIXME: Because enterIsolate is not passed a RenderObject, we have to - // crawl up the tree to see which parent inline is the isolate. We could - // change enterIsolate to take a RenderObject and do this logic there, - // but that would be a layering violation for BidiResolver (which knows - // nothing about RenderObject). - RenderInline* isolatedInline = toRenderInline( - highestContainingIsolateWithinRoot(startObj, currentRoot)); - ASSERT(isolatedInline); - - InlineBidiResolver isolatedResolver; - LineMidpointState& isolatedLineMidpointState = - isolatedResolver.midpointState(); - isolatedLineMidpointState = - topResolver.midpointStateForIsolatedRun(isolatedRun); - EUnicodeBidi unicodeBidi = isolatedInline->style()->unicodeBidi(); - TextDirection direction; - if (unicodeBidi == Plaintext) { - direction = determinePlaintextDirectionality( - isolatedInline, isNewUBAParagraph ? startObj : 0); - } else { - ASSERT(unicodeBidi == Isolate || unicodeBidi == IsolateOverride); - direction = isolatedInline->style()->direction(); - } - isolatedResolver.setStatus( - statusWithDirection(direction, isOverride(unicodeBidi))); - - setupResolverToResumeInIsolate(isolatedResolver, isolatedInline, startObj); - - // The starting position is the beginning of the first run within the - // isolate that was identified during the earlier call to - // createBidiRunsForLine. This can be but is not necessarily the first - // run within the isolate. - InlineIterator iter = - InlineIterator(isolatedInline, startObj, isolatedRun->m_start); - isolatedResolver.setPositionIgnoringNestedIsolates(iter); - // We stop at the next end of line; we may re-enter this isolate in the - // next call to constructBidiRuns(). - // FIXME: What should end and previousLineBrokeCleanly be? - // rniwa says previousLineBrokeCleanly is just a WinIE hack and could - // always be false here? - isolatedResolver.createBidiRunsForLine(endOfLine, NoVisualOverride, - previousLineBrokeCleanly); - - ASSERT(isolatedResolver.runs().runCount()); - if (isolatedResolver.runs().runCount()) - bidiRuns.replaceRunWithRuns(isolatedRun, isolatedResolver.runs()); - - // If we encountered any nested isolate runs, just move them - // to the top resolver's list for later processing. - if (!isolatedResolver.isolatedRuns().isEmpty()) { - topResolver.isolatedRuns().appendVector(isolatedResolver.isolatedRuns()); - currentRoot = isolatedInline; - restoreIsolatedMidpointStates(topResolver, isolatedResolver); - } - } -} - -} // namespace blink diff --git a/sky/engine/core/rendering/BidiRunForLine.h b/sky/engine/core/rendering/BidiRunForLine.h deleted file mode 100644 index c039643562741..0000000000000 --- a/sky/engine/core/rendering/BidiRunForLine.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. - * All right reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_BIDIRUNFORLINE_H_ -#define SKY_ENGINE_CORE_RENDERING_BIDIRUNFORLINE_H_ - -#include "flutter/sky/engine/core/rendering/line/TrailingObjects.h" -#include "flutter/sky/engine/platform/text/BidiResolver.h" - -namespace blink { - -TextDirection determinePlaintextDirectionality(RenderObject* root, - RenderObject* current = 0, - unsigned pos = 0); - -void constructBidiRunsForLine(InlineBidiResolver&, - BidiRunList&, - const InlineIterator& endOfLine, - VisualDirectionOverride, - bool previousLineBrokeCleanly, - bool isNewUBAParagraph); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_BIDIRUNFORLINE_H_ diff --git a/sky/engine/core/rendering/ClipPathOperation.h b/sky/engine/core/rendering/ClipPathOperation.h deleted file mode 100644 index f8f36d34a5404..0000000000000 --- a/sky/engine/core/rendering/ClipPathOperation.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_CLIPPATHOPERATION_H_ -#define SKY_ENGINE_CORE_RENDERING_CLIPPATHOPERATION_H_ - -#include "flutter/sky/engine/platform/graphics/Path.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -class ClipPathOperation : public RefCounted { - public: - enum OperationType { REFERENCE, SHAPE }; - - virtual ~ClipPathOperation() {} - - virtual bool operator==(const ClipPathOperation&) const = 0; - bool operator!=(const ClipPathOperation& o) const { return !(*this == o); } - - OperationType type() const { return m_type; } - bool isSameType(const ClipPathOperation& o) const { - return o.type() == m_type; - } - - protected: - ClipPathOperation(OperationType type) : m_type(type) {} - - OperationType m_type; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_CLIPPATHOPERATION_H_ diff --git a/sky/engine/core/rendering/ClipRect.cpp b/sky/engine/core/rendering/ClipRect.cpp deleted file mode 100644 index 34284dcd9fbd4..0000000000000 --- a/sky/engine/core/rendering/ClipRect.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/ClipRect.h" - -#include "flutter/sky/engine/core/rendering/HitTestLocation.h" - -namespace blink { - -bool ClipRect::intersects(const HitTestLocation& hitTestLocation) const { - return hitTestLocation.intersects(m_rect); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/ClipRect.h b/sky/engine/core/rendering/ClipRect.h deleted file mode 100644 index 397d6da306df3..0000000000000 --- a/sky/engine/core/rendering/ClipRect.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_CLIPRECT_H_ -#define SKY_ENGINE_CORE_RENDERING_CLIPRECT_H_ - -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" - -namespace blink { - -class RenderLayer; -class HitTestLocation; - -class ClipRect { - public: - ClipRect() : m_hasRadius(false) {} - - ClipRect(const LayoutRect& rect) : m_rect(rect), m_hasRadius(false) {} - - const LayoutRect& rect() const { return m_rect; } - void setRect(const LayoutRect& rect) { m_rect = rect; } - - bool hasRadius() const { return m_hasRadius; } - void setHasRadius(bool hasRadius) { m_hasRadius = hasRadius; } - - bool operator==(const ClipRect& other) const { - return rect() == other.rect() && hasRadius() == other.hasRadius(); - } - bool operator!=(const ClipRect& other) const { - return rect() != other.rect() || hasRadius() != other.hasRadius(); - } - bool operator!=(const LayoutRect& otherRect) const { - return rect() != otherRect; - } - - void intersect(const LayoutRect& other) { m_rect.intersect(other); } - void intersect(const ClipRect& other) { - m_rect.intersect(other.rect()); - if (other.hasRadius()) - m_hasRadius = true; - } - void move(LayoutUnit x, LayoutUnit y) { m_rect.move(x, y); } - void move(const LayoutSize& size) { m_rect.move(size); } - void moveBy(const LayoutPoint& point) { m_rect.moveBy(point); } - - bool isEmpty() const { return m_rect.isEmpty(); } - bool intersects(const LayoutRect& rect) const { - return m_rect.intersects(rect); - } - bool intersects(const HitTestLocation&) const; - - private: - LayoutRect m_rect; - bool m_hasRadius; -}; - -inline ClipRect intersection(const ClipRect& a, const ClipRect& b) { - ClipRect c = a; - c.intersect(b); - return c; -} - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_CLIPRECT_H_ diff --git a/sky/engine/core/rendering/ClipRects.h b/sky/engine/core/rendering/ClipRects.h deleted file mode 100644 index 9f96d74986725..0000000000000 --- a/sky/engine/core/rendering/ClipRects.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_CLIPRECTS_H_ -#define SKY_ENGINE_CORE_RENDERING_CLIPRECTS_H_ - -#include "flutter/sky/engine/core/rendering/ClipRect.h" - -namespace blink { - -class ClipRects { - WTF_MAKE_FAST_ALLOCATED; - - public: - static PassRefPtr create() { return adoptRef(new ClipRects); } - - static PassRefPtr create(const ClipRects& other) { - return adoptRef(new ClipRects(other)); - } - - ClipRects() : m_refCnt(1), m_fixed(0) {} - - void reset(const LayoutRect& r) { - m_overflowClipRect = r; - m_posClipRect = r; - m_fixed = 0; - } - - const ClipRect& overflowClipRect() const { return m_overflowClipRect; } - void setOverflowClipRect(const ClipRect& r) { m_overflowClipRect = r; } - - const ClipRect& posClipRect() const { return m_posClipRect; } - void setPosClipRect(const ClipRect& r) { m_posClipRect = r; } - - bool fixed() const { return static_cast(m_fixed); } - void setFixed(bool fixed) { m_fixed = fixed ? 1 : 0; } - - void ref() { m_refCnt++; } - void deref() { - if (!--m_refCnt) - delete this; - } - - bool operator==(const ClipRects& other) const { - return m_overflowClipRect == other.overflowClipRect() && - m_posClipRect == other.posClipRect() && fixed() == other.fixed(); - } - - ClipRects& operator=(const ClipRects& other) { - m_overflowClipRect = other.overflowClipRect(); - m_posClipRect = other.posClipRect(); - m_fixed = other.fixed(); - return *this; - } - - private: - ClipRects(const LayoutRect& r) - : m_overflowClipRect(r), m_posClipRect(r), m_refCnt(1), m_fixed(0) {} - - ClipRects(const ClipRects& other) - : m_overflowClipRect(other.overflowClipRect()), - m_posClipRect(other.posClipRect()), - m_refCnt(1), - m_fixed(other.fixed()) {} - - ClipRect m_overflowClipRect; - ClipRect m_posClipRect; - unsigned m_refCnt : 31; - unsigned m_fixed : 1; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_CLIPRECTS_H_ diff --git a/sky/engine/core/rendering/ClipRectsCache.h b/sky/engine/core/rendering/ClipRectsCache.h deleted file mode 100644 index 6a0294b03d151..0000000000000 --- a/sky/engine/core/rendering/ClipRectsCache.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_CORE_RENDERING_CLIPRECTSCACHE_H_ -#define SKY_ENGINE_CORE_RENDERING_CLIPRECTSCACHE_H_ - -#include "flutter/sky/engine/core/rendering/ClipRects.h" - -namespace blink { - -enum ClipRectsCacheSlot { - // Relative to the ancestor treated as the root (e.g. transformed layer). Used - // for hit testing. - RootRelativeClipRects, - - // Relative to painting ancestor. Used for painting. - PaintingClipRects, - - NumberOfClipRectsCacheSlots, - UncachedClipRects, -}; - -class ClipRectsCache { - WTF_MAKE_FAST_ALLOCATED; - - public: - struct Entry { - Entry() : root(0) {} - - const RenderLayer* root; - RefPtr clipRects; - }; - - Entry& get(ClipRectsCacheSlot slot) { - ASSERT(slot < NumberOfClipRectsCacheSlots); - return m_entries[slot]; - } - - void clear(ClipRectsCacheSlot slot) { - ASSERT(slot < NumberOfClipRectsCacheSlots); - m_entries[slot] = Entry(); - } - - private: - Entry m_entries[NumberOfClipRectsCacheSlots]; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_CLIPRECTSCACHE_H_ diff --git a/sky/engine/core/rendering/GapRects.h b/sky/engine/core/rendering/GapRects.h deleted file mode 100644 index d1dd69aae377a..0000000000000 --- a/sky/engine/core/rendering/GapRects.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 2005, 2006 Apple Inc. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - - Some useful definitions needed for laying out elements -*/ - -#ifndef SKY_ENGINE_CORE_RENDERING_GAPRECTS_H_ -#define SKY_ENGINE_CORE_RENDERING_GAPRECTS_H_ - -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" - -namespace blink { - -struct GapRects { - const LayoutRect& left() const { return m_left; } - const LayoutRect& center() const { return m_center; } - const LayoutRect& right() const { return m_right; } - - void uniteLeft(const LayoutRect& r) { m_left.unite(r); } - void uniteCenter(const LayoutRect& r) { m_center.unite(r); } - void uniteRight(const LayoutRect& r) { m_right.unite(r); } - void unite(const GapRects& o) { - uniteLeft(o.left()); - uniteCenter(o.center()); - uniteRight(o.right()); - } - - operator LayoutRect() const { - LayoutRect result = m_left; - result.unite(m_center); - result.unite(m_right); - return result; - } - - bool operator==(const GapRects& other) { - return m_left == other.left() && m_center == other.center() && - m_right == other.right(); - } - bool operator!=(const GapRects& other) { return !(*this == other); } - - private: - LayoutRect m_left; - LayoutRect m_center; - LayoutRect m_right; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_GAPRECTS_H_ diff --git a/sky/engine/core/rendering/HitTestLocation.cpp b/sky/engine/core/rendering/HitTestLocation.cpp deleted file mode 100644 index b19d0a6886dba..0000000000000 --- a/sky/engine/core/rendering/HitTestLocation.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/HitTestLocation.h" - -namespace blink { - -HitTestLocation::HitTestLocation() - : m_isRectBased(false), m_isRectilinear(true) {} - -HitTestLocation::HitTestLocation(const LayoutPoint& point) - : m_point(point), - m_boundingBox(rectForPoint(point, 0, 0, 0, 0)), - m_transformedPoint(point), - m_transformedRect(m_boundingBox), - m_isRectBased(false), - m_isRectilinear(true) {} - -HitTestLocation::HitTestLocation(const FloatPoint& point) - : m_point(flooredLayoutPoint(point)), - m_boundingBox(rectForPoint(m_point, 0, 0, 0, 0)), - m_transformedPoint(point), - m_transformedRect(m_boundingBox), - m_isRectBased(false), - m_isRectilinear(true) {} - -HitTestLocation::HitTestLocation(const FloatPoint& point, const FloatQuad& quad) - : m_transformedPoint(point), m_transformedRect(quad), m_isRectBased(true) { - m_point = flooredLayoutPoint(point); - m_boundingBox = enclosingIntRect(quad.boundingBox()); - m_isRectilinear = quad.isRectilinear(); -} - -HitTestLocation::HitTestLocation(const LayoutPoint& centerPoint, - unsigned topPadding, - unsigned rightPadding, - unsigned bottomPadding, - unsigned leftPadding) - : m_point(centerPoint), - m_boundingBox(rectForPoint(centerPoint, - topPadding, - rightPadding, - bottomPadding, - leftPadding)), - m_transformedPoint(centerPoint), - m_isRectBased(topPadding || rightPadding || bottomPadding || leftPadding), - m_isRectilinear(true) { - m_transformedRect = FloatQuad(m_boundingBox); -} - -HitTestLocation::HitTestLocation(const HitTestLocation& other, - const LayoutSize& offset) - : m_point(other.m_point), - m_boundingBox(other.m_boundingBox), - m_transformedPoint(other.m_transformedPoint), - m_transformedRect(other.m_transformedRect), - m_isRectBased(other.m_isRectBased), - m_isRectilinear(other.m_isRectilinear) { - move(offset); -} - -HitTestLocation::HitTestLocation(const HitTestLocation& other) - : m_point(other.m_point), - m_boundingBox(other.m_boundingBox), - m_transformedPoint(other.m_transformedPoint), - m_transformedRect(other.m_transformedRect), - m_isRectBased(other.m_isRectBased), - m_isRectilinear(other.m_isRectilinear) {} - -HitTestLocation::~HitTestLocation() {} - -HitTestLocation& HitTestLocation::operator=(const HitTestLocation& other) { - m_point = other.m_point; - m_boundingBox = other.m_boundingBox; - m_transformedPoint = other.m_transformedPoint; - m_transformedRect = other.m_transformedRect; - m_isRectBased = other.m_isRectBased; - m_isRectilinear = other.m_isRectilinear; - - return *this; -} - -void HitTestLocation::move(const LayoutSize& offset) { - m_point.move(offset); - m_transformedPoint.move(offset); - m_transformedRect.move(offset); - m_boundingBox = enclosingIntRect(m_transformedRect.boundingBox()); -} - -template -bool HitTestLocation::intersectsRect(const RectType& rect) const { - // FIXME: When the hit test is not rect based we should use - // rect.contains(m_point). That does change some corner case tests though. - - // First check if rect even intersects our bounding box. - if (!rect.intersects(m_boundingBox)) - return false; - - // If the transformed rect is rectilinear the bounding box intersection was - // accurate. - if (m_isRectilinear) - return true; - - // If rect fully contains our bounding box, we are also sure of an - // intersection. - if (rect.contains(m_boundingBox)) - return true; - - // Otherwise we need to do a slower quad based intersection test. - return m_transformedRect.intersectsRect(rect); -} - -bool HitTestLocation::intersects(const LayoutRect& rect) const { - return intersectsRect(rect); -} - -bool HitTestLocation::intersects(const FloatRect& rect) const { - return intersectsRect(rect); -} - -bool HitTestLocation::intersects(const RoundedRect& rect) const { - return rect.intersectsQuad(m_transformedRect); -} - -bool HitTestLocation::containsPoint(const FloatPoint& point) const { - return m_transformedRect.containsPoint(point); -} - -IntRect HitTestLocation::rectForPoint(const LayoutPoint& point, - unsigned topPadding, - unsigned rightPadding, - unsigned bottomPadding, - unsigned leftPadding) { - IntPoint actualPoint(flooredIntPoint(point)); - actualPoint -= IntSize(leftPadding, topPadding); - - IntSize actualPadding(leftPadding + rightPadding, topPadding + bottomPadding); - // As IntRect is left inclusive and right exclusive (seeing - // IntRect::contains(x, y)), adding "1". - // FIXME: Remove this once non-rect based hit-detection stops using - // IntRect:intersects. - actualPadding += IntSize(1, 1); - - return IntRect(actualPoint, actualPadding); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/HitTestLocation.h b/sky/engine/core/rendering/HitTestLocation.h deleted file mode 100644 index 91f8d892a871f..0000000000000 --- a/sky/engine/core/rendering/HitTestLocation.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_HITTESTLOCATION_H_ -#define SKY_ENGINE_CORE_RENDERING_HITTESTLOCATION_H_ - -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" -#include "flutter/sky/engine/platform/geometry/RoundedRect.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/ListHashSet.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -class HitTestLocation { - public: - HitTestLocation(); - HitTestLocation(const LayoutPoint&); - HitTestLocation(const FloatPoint&); - HitTestLocation(const FloatPoint&, const FloatQuad&); - // Pass non-zero padding values to perform a rect-based hit test. - HitTestLocation(const LayoutPoint& centerPoint, - unsigned topPadding, - unsigned rightPadding, - unsigned bottomPadding, - unsigned leftPadding); - HitTestLocation(const HitTestLocation&, const LayoutSize& offset); - HitTestLocation(const HitTestLocation&); - ~HitTestLocation(); - HitTestLocation& operator=(const HitTestLocation&); - - const LayoutPoint& point() const { return m_point; } - IntPoint roundedPoint() const { return roundedIntPoint(m_point); } - - // Rect-based hit test related methods. - bool isRectBasedTest() const { return m_isRectBased; } - bool isRectilinear() const { return m_isRectilinear; } - IntRect boundingBox() const { return m_boundingBox; } - - static IntRect rectForPoint(const LayoutPoint&, - unsigned topPadding, - unsigned rightPadding, - unsigned bottomPadding, - unsigned leftPadding); - int topPadding() const { return roundedPoint().y() - m_boundingBox.y(); } - int rightPadding() const { - return m_boundingBox.maxX() - roundedPoint().x() - 1; - } - int bottomPadding() const { - return m_boundingBox.maxY() - roundedPoint().y() - 1; - } - int leftPadding() const { return roundedPoint().x() - m_boundingBox.x(); } - - bool intersects(const LayoutRect&) const; - bool intersects(const FloatRect&) const; - bool intersects(const RoundedRect&) const; - bool containsPoint(const FloatPoint&) const; - - const FloatPoint& transformedPoint() const { return m_transformedPoint; } - const FloatQuad& transformedRect() const { return m_transformedRect; } - - private: - template - bool intersectsRect(const RectType&) const; - void move(const LayoutSize& offset); - - // This is cached forms of the more accurate point and area below. - LayoutPoint m_point; - IntRect m_boundingBox; - - FloatPoint m_transformedPoint; - FloatQuad m_transformedRect; - - bool m_isRectBased; - bool m_isRectilinear; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_HITTESTLOCATION_H_ diff --git a/sky/engine/core/rendering/HitTestRequest.h b/sky/engine/core/rendering/HitTestRequest.h deleted file mode 100644 index d98e9829e7cb4..0000000000000 --- a/sky/engine/core/rendering/HitTestRequest.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_HITTESTREQUEST_H_ -#define SKY_ENGINE_CORE_RENDERING_HITTESTREQUEST_H_ - -namespace blink { - -class HitTestRequest { - public: - enum RequestType { - ReadOnly = 1 << 1, - Active = 1 << 2, - Move = 1 << 3, - Release = 1 << 4, - IgnoreClipping = 1 << 5, - SVGClipContent = 1 << 6, - IgnorePointerEventsNone = 1 << 8, - }; - - typedef unsigned HitTestRequestType; - - HitTestRequest(HitTestRequestType requestType) : m_requestType(requestType) {} - - bool readOnly() const { return m_requestType & ReadOnly; } - bool active() const { return m_requestType & Active; } - bool move() const { return m_requestType & Move; } - bool release() const { return m_requestType & Release; } - bool ignoreClipping() const { return m_requestType & IgnoreClipping; } - bool svgClipContent() const { return m_requestType & SVGClipContent; } - bool ignorePointerEventsNone() const { - return m_requestType & IgnorePointerEventsNone; - } - - HitTestRequestType type() const { return m_requestType; } - - private: - HitTestRequestType m_requestType; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_HITTESTREQUEST_H_ diff --git a/sky/engine/core/rendering/HitTestResult.cpp b/sky/engine/core/rendering/HitTestResult.cpp deleted file mode 100644 index 599e36ec983b3..0000000000000 --- a/sky/engine/core/rendering/HitTestResult.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2006, 2008, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/HitTestResult.h" - -#include "flutter/sky/engine/core/rendering/RenderBox.h" -#include "flutter/sky/engine/core/rendering/RenderObject.h" - -namespace blink { - -HitTestResult::HitTestResult() {} - -HitTestResult::HitTestResult(const LayoutPoint& point) - : m_hitTestLocation(point), m_pointInInnerNodeFrame(point) {} - -HitTestResult::HitTestResult(const LayoutPoint& centerPoint, - unsigned topPadding, - unsigned rightPadding, - unsigned bottomPadding, - unsigned leftPadding) - : m_hitTestLocation(centerPoint, - topPadding, - rightPadding, - bottomPadding, - leftPadding), - m_pointInInnerNodeFrame(centerPoint) {} - -HitTestResult::HitTestResult(const HitTestLocation& other) - : m_hitTestLocation(other), - m_pointInInnerNodeFrame(m_hitTestLocation.point()) {} - -HitTestResult::HitTestResult(const HitTestResult& other) - : m_hitTestLocation(other.m_hitTestLocation), - m_localPoint(other.localPoint()) {} - -HitTestResult::~HitTestResult() {} - -HitTestResult& HitTestResult::operator=(const HitTestResult& other) { - m_hitTestLocation = other.m_hitTestLocation; - m_pointInInnerNodeFrame = other.m_pointInInnerNodeFrame; - m_localPoint = other.localPoint(); - return *this; -} - -RenderObject* HitTestResult::renderer() const { - return 0; -} - -bool HitTestResult::isSelected() const { - return false; -} - -Image* HitTestResult::image() const { - return 0; -} - -IntRect HitTestResult::imageRect() const { - return IntRect(); -} - -bool HitTestResult::isMisspelled() const { - return false; -} - -// FIXME: This function needs a better name and may belong in a different class. -// It's not really isContentEditable(); it's more like -// needsEditingContextMenu(). In many ways, this function would make more sense -// in the ContextMenu class, except that WebElementDictionary hooks into it. -// Anyway, we should architect this better. -bool HitTestResult::isContentEditable() const { - return false; -} - -void HitTestResult::append(const HitTestResult& other) {} - -} // namespace blink diff --git a/sky/engine/core/rendering/HitTestResult.h b/sky/engine/core/rendering/HitTestResult.h deleted file mode 100644 index 3b05e45f18686..0000000000000 --- a/sky/engine/core/rendering/HitTestResult.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_HITTESTRESULT_H_ -#define SKY_ENGINE_CORE_RENDERING_HITTESTRESULT_H_ - -#include "flutter/sky/engine/core/rendering/HitTestLocation.h" -#include "flutter/sky/engine/core/rendering/HitTestRequest.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" -#include "flutter/sky/engine/platform/heap/Handle.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/ListHashSet.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -class Image; -class RenderObject; - -class HitTestResult { - DISALLOW_ALLOCATION(); - - public: - HitTestResult(); - HitTestResult(const LayoutPoint&); - // Pass non-negative padding values to perform a rect-based hit test. - HitTestResult(const LayoutPoint& centerPoint, - unsigned topPadding, - unsigned rightPadding, - unsigned bottomPadding, - unsigned leftPadding); - HitTestResult(const HitTestLocation&); - HitTestResult(const HitTestResult&); - ~HitTestResult(); - HitTestResult& operator=(const HitTestResult&); - - bool isOverWidget() const { return m_isOverWidget; } - - // Forwarded from HitTestLocation - bool isRectBasedTest() const { return m_hitTestLocation.isRectBasedTest(); } - - // The hit-tested point in the coordinates of the main frame. - const LayoutPoint& pointInMainFrame() const { - return m_hitTestLocation.point(); - } - IntPoint roundedPointInMainFrame() const { - return roundedIntPoint(pointInMainFrame()); - } - - // The hit-tested point in the coordinates of the inner node. - const LayoutPoint& localPoint() const { return m_localPoint; } - void setLocalPoint(const LayoutPoint& p) { m_localPoint = p; } - - RenderObject* renderer() const; - - const HitTestLocation& hitTestLocation() const { return m_hitTestLocation; } - - bool isSelected() const; - Image* image() const; - IntRect imageRect() const; - bool isMisspelled() const; - bool isContentEditable() const; - - void append(const HitTestResult&); - - private: - HitTestLocation m_hitTestLocation; - - // FIXME: Nothing changes this to a value different from m_hitTestLocation! - LayoutPoint m_pointInInnerNodeFrame; // The hit-tested point in innerNode - // frame coordinates. - LayoutPoint m_localPoint; // A point in the local coordinate space of - // m_innerNonSharedNode's renderer. Allows us to - // efficiently determine where inside the renderer - // we hit on subsequent operations. - bool m_isOverWidget; // Returns true if we are over a widget. -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_HITTESTRESULT_H_ diff --git a/sky/engine/core/rendering/HitTestingTransformState.cpp b/sky/engine/core/rendering/HitTestingTransformState.cpp deleted file mode 100644 index 42c3cd0f8cf59..0000000000000 --- a/sky/engine/core/rendering/HitTestingTransformState.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/HitTestingTransformState.h" - -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -namespace blink { - -void HitTestingTransformState::translate(int x, - int y, - TransformAccumulation accumulate) { - m_accumulatedTransform.translate(x, y); - if (accumulate == FlattenTransform) - flattenWithTransform(m_accumulatedTransform); - - m_accumulatingTransform = accumulate == AccumulateTransform; -} - -void HitTestingTransformState::applyTransform( - const TransformationMatrix& transformFromContainer, - TransformAccumulation accumulate) { - m_accumulatedTransform.multiply(transformFromContainer); - if (accumulate == FlattenTransform) - flattenWithTransform(m_accumulatedTransform); - - m_accumulatingTransform = accumulate == AccumulateTransform; -} - -void HitTestingTransformState::flatten() { - flattenWithTransform(m_accumulatedTransform); -} - -void HitTestingTransformState::flattenWithTransform( - const TransformationMatrix& t) { - TransformationMatrix inverseTransform = t.inverse(); - m_lastPlanarPoint = inverseTransform.projectPoint(m_lastPlanarPoint); - m_lastPlanarQuad = inverseTransform.projectQuad(m_lastPlanarQuad); - m_lastPlanarArea = inverseTransform.projectQuad(m_lastPlanarArea); - - m_accumulatedTransform.makeIdentity(); - m_accumulatingTransform = false; -} - -FloatPoint HitTestingTransformState::mappedPoint() const { - return m_accumulatedTransform.inverse().projectPoint(m_lastPlanarPoint); -} - -FloatQuad HitTestingTransformState::mappedQuad() const { - return m_accumulatedTransform.inverse().projectQuad(m_lastPlanarQuad); -} - -FloatQuad HitTestingTransformState::mappedArea() const { - return m_accumulatedTransform.inverse().projectQuad(m_lastPlanarArea); -} - -LayoutRect HitTestingTransformState::boundsOfMappedArea() const { - return m_accumulatedTransform.inverse().clampedBoundsOfProjectedQuad( - m_lastPlanarArea); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/HitTestingTransformState.h b/sky/engine/core/rendering/HitTestingTransformState.h deleted file mode 100644 index 89c5d7dbd9049..0000000000000 --- a/sky/engine/core/rendering/HitTestingTransformState.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_HITTESTINGTRANSFORMSTATE_H_ -#define SKY_ENGINE_CORE_RENDERING_HITTESTINGTRANSFORMSTATE_H_ - -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/IntSize.h" -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -// FIXME: Now that TransformState lazily creates its TransformationMatrix it -// takes up less space. So there's really no need for a ref counted version. So -// This class should be removed and replaced with TransformState. There are some -// minor differences (like the way translate() works slightly differently than -// move()) so care has to be taken when this is done. -class HitTestingTransformState : public RefCounted { - public: - static PassRefPtr create(const FloatPoint& p, - const FloatQuad& quad, - const FloatQuad& area) { - return adoptRef(new HitTestingTransformState(p, quad, area)); - } - - static PassRefPtr create( - const HitTestingTransformState& other) { - return adoptRef(new HitTestingTransformState(other)); - } - - enum TransformAccumulation { FlattenTransform, AccumulateTransform }; - void translate(int x, int y, TransformAccumulation); - void applyTransform(const TransformationMatrix& transformFromContainer, - TransformAccumulation); - - FloatPoint mappedPoint() const; - FloatQuad mappedQuad() const; - FloatQuad mappedArea() const; - LayoutRect boundsOfMappedArea() const; - void flatten(); - - FloatPoint m_lastPlanarPoint; - FloatQuad m_lastPlanarQuad; - FloatQuad m_lastPlanarArea; - TransformationMatrix m_accumulatedTransform; - bool m_accumulatingTransform; - - private: - HitTestingTransformState(const FloatPoint& p, - const FloatQuad& quad, - const FloatQuad& area) - : m_lastPlanarPoint(p), - m_lastPlanarQuad(quad), - m_lastPlanarArea(area), - m_accumulatingTransform(false) {} - - HitTestingTransformState(const HitTestingTransformState& other) - : RefCounted(), - m_lastPlanarPoint(other.m_lastPlanarPoint), - m_lastPlanarQuad(other.m_lastPlanarQuad), - m_lastPlanarArea(other.m_lastPlanarArea), - m_accumulatedTransform(other.m_accumulatedTransform), - m_accumulatingTransform(other.m_accumulatingTransform) {} - - void flattenWithTransform(const TransformationMatrix&); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_HITTESTINGTRANSFORMSTATE_H_ diff --git a/sky/engine/core/rendering/InlineBox.cpp b/sky/engine/core/rendering/InlineBox.cpp deleted file mode 100644 index 13b761d641ead..0000000000000 --- a/sky/engine/core/rendering/InlineBox.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "flutter/sky/engine/core/rendering/InlineBox.h" - -#include "flutter/sky/engine/core/rendering/InlineFlowBox.h" -#include "flutter/sky/engine/core/rendering/PaintInfo.h" -#include "flutter/sky/engine/core/rendering/RenderObjectInlines.h" -#include "flutter/sky/engine/core/rendering/RenderParagraph.h" -#include "flutter/sky/engine/core/rendering/RootInlineBox.h" -#include "flutter/sky/engine/platform/Partitions.h" -#include "flutter/sky/engine/platform/fonts/FontMetrics.h" - -#ifndef NDEBUG -#include -#endif - -namespace blink { - -struct SameSizeAsInlineBox { - virtual ~SameSizeAsInlineBox() {} - void* a[4]; - FloatPoint b; - float c; - uint32_t d : 32; -#if ENABLE(ASSERT) - bool f; -#endif -}; - -COMPILE_ASSERT(sizeof(InlineBox) == sizeof(SameSizeAsInlineBox), - InlineBox_size_guard); - -#if ENABLE(ASSERT) - -InlineBox::~InlineBox() { - if (!m_hasBadParent && m_parent) - m_parent->setHasBadChildList(); -} - -#endif - -void InlineBox::remove(MarkLineBoxes markLineBoxes) { - if (parent()) - parent()->removeChild(this, markLineBoxes); -} - -void* InlineBox::operator new(size_t sz) { - return partitionAlloc(Partitions::getRenderingPartition(), sz); -} - -void InlineBox::operator delete(void* ptr) { - partitionFree(ptr); -} - -#ifndef NDEBUG -const char* InlineBox::boxName() const { - return "InlineBox"; -} - -void InlineBox::showTreeForThis() const { - renderer().showTreeForThis(); -} - -void InlineBox::showLineTreeForThis() const { - renderer().containingBlock()->showLineTreeAndMark(this, "*"); -} - -void InlineBox::showLineTreeAndMark(const InlineBox* markedBox1, - const char* markedLabel1, - const InlineBox* markedBox2, - const char* markedLabel2, - const RenderObject* obj, - int depth) const { - int printedCharacters = 0; - if (this == markedBox1) - printedCharacters += fprintf(stderr, "%s", markedLabel1); - if (this == markedBox2) - printedCharacters += fprintf(stderr, "%s", markedLabel2); - if (&renderer() == obj) - printedCharacters += fprintf(stderr, "*"); - for (; printedCharacters < depth * 2; printedCharacters++) - fputc(' ', stderr); - - showBox(printedCharacters); -} - -void InlineBox::showBox(int printedCharacters) const { - printedCharacters += fprintf(stderr, "%s\t%p", boxName(), this); - for (; printedCharacters < showTreeCharacterOffset; printedCharacters++) - fputc(' ', stderr); - fprintf(stderr, "\t%s %p {pos=%g,%g size=%g,%g} baseline=%i/%i\n", - renderer().renderName(), &renderer(), x(), y(), width(), height(), - baselinePosition(AlphabeticBaseline), - baselinePosition(IdeographicBaseline)); -} -#endif - -float InlineBox::logicalHeight() const { - if (hasVirtualLogicalHeight()) - return virtualLogicalHeight(); - - if (renderer().isText()) - return m_bitfields.isText() - ? renderer().style(isFirstLineStyle())->fontMetrics().height() - : 0; - if (renderer().isBox() && parent()) - return toRenderBox(renderer()).height().toFloat(); - - ASSERT(isInlineFlowBox()); - RenderBoxModelObject* flowObject = boxModelObject(); - const FontMetrics& fontMetrics = - renderer().style(isFirstLineStyle())->fontMetrics(); - float result = fontMetrics.height(); - if (parent()) - result += flowObject->borderAndPaddingLogicalHeight(); - return result; -} - -int InlineBox::baselinePosition(FontBaseline baselineType) const { - return boxModelObject()->baselinePosition( - baselineType, m_bitfields.firstLine(), HorizontalLine, - PositionOnContainingLine); -} - -LayoutUnit InlineBox::lineHeight() const { - return boxModelObject()->lineHeight(m_bitfields.firstLine(), HorizontalLine, - PositionOnContainingLine); -} - -int InlineBox::caretMinOffset() const { - return renderer().caretMinOffset(); -} - -int InlineBox::caretMaxOffset() const { - return renderer().caretMaxOffset(); -} - -void InlineBox::dirtyLineBoxes() { - markDirty(); - for (InlineFlowBox* curr = parent(); curr && !curr->isDirty(); - curr = curr->parent()) - curr->markDirty(); -} - -void InlineBox::deleteLine() { - if (!m_bitfields.extracted() && renderer().isBox()) - toRenderBox(renderer()).setInlineBoxWrapper(0); - destroy(); -} - -void InlineBox::extractLine() { - m_bitfields.setExtracted(true); - if (renderer().isBox()) - toRenderBox(renderer()).setInlineBoxWrapper(0); -} - -void InlineBox::attachLine() { - m_bitfields.setExtracted(false); - if (renderer().isBox()) - toRenderBox(renderer()).setInlineBoxWrapper(this); -} - -void InlineBox::adjustPosition(float dx, float dy) { - m_topLeft.move(dx, dy); - - if (renderer().isReplaced()) - toRenderBox(renderer()).move(dx, dy); -} - -void InlineBox::paint(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - LayoutUnit /* lineTop */, - LayoutUnit /*lineBottom*/, - Vector& layers) { - renderer().paint(paintInfo, paintOffset, layers); -} - -bool InlineBox::nodeAtPoint(const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset, - LayoutUnit /* lineTop */, - LayoutUnit /*lineBottom*/) { - // Hit test all phases of replaced elements atomically, as though the replaced - // element established its own stacking context. (See Appendix E.2, - // section 6.4 on inline block/table elements in the CSS2.1 specification.) - LayoutPoint childPoint = accumulatedOffset; - return renderer().hitTest(request, result, locationInContainer, childPoint); -} - -const RootInlineBox& InlineBox::root() const { - if (m_parent) - return m_parent->root(); - ASSERT(isRootInlineBox()); - return static_cast(*this); -} - -RootInlineBox& InlineBox::root() { - if (m_parent) - return m_parent->root(); - ASSERT(isRootInlineBox()); - return static_cast(*this); -} - -bool InlineBox::nextOnLineExists() const { - if (!m_bitfields.determinedIfNextOnLineExists()) { - m_bitfields.setDeterminedIfNextOnLineExists(true); - - if (!parent()) - m_bitfields.setNextOnLineExists(false); - else if (nextOnLine()) - m_bitfields.setNextOnLineExists(true); - else - m_bitfields.setNextOnLineExists(parent()->nextOnLineExists()); - } - return m_bitfields.nextOnLineExists(); -} - -InlineBox* InlineBox::nextLeafChild() const { - InlineBox* leaf = 0; - for (InlineBox* box = nextOnLine(); box && !leaf; box = box->nextOnLine()) - leaf = box->isLeaf() ? box : toInlineFlowBox(box)->firstLeafChild(); - if (!leaf && parent()) - leaf = parent()->nextLeafChild(); - return leaf; -} - -InlineBox* InlineBox::prevLeafChild() const { - InlineBox* leaf = 0; - for (InlineBox* box = prevOnLine(); box && !leaf; box = box->prevOnLine()) - leaf = box->isLeaf() ? box : toInlineFlowBox(box)->lastLeafChild(); - if (!leaf && parent()) - leaf = parent()->prevLeafChild(); - return leaf; -} - -InlineBox* InlineBox::nextLeafChildIgnoringLineBreak() const { - InlineBox* leaf = nextLeafChild(); - if (leaf && leaf->isLineBreak()) - return 0; - return leaf; -} - -InlineBox* InlineBox::prevLeafChildIgnoringLineBreak() const { - InlineBox* leaf = prevLeafChild(); - if (leaf && leaf->isLineBreak()) - return 0; - return leaf; -} - -RenderObject::SelectionState InlineBox::selectionState() { - return renderer().selectionState(); -} - -void InlineBox::clearKnownToHaveNoOverflow() { - m_bitfields.setKnownToHaveNoOverflow(false); - if (parent() && parent()->knownToHaveNoOverflow()) - parent()->clearKnownToHaveNoOverflow(); -} - -FloatPoint InlineBox::locationIncludingFlipping() { - // FIXME(sky): remove - return FloatPoint(x(), y()); -} - -} // namespace blink - -#ifndef NDEBUG - -void showTree(const blink::InlineBox* b) { - if (b) - b->showTreeForThis(); -} - -void showLineTree(const blink::InlineBox* b) { - if (b) - b->showLineTreeForThis(); -} - -#endif diff --git a/sky/engine/core/rendering/InlineBox.h b/sky/engine/core/rendering/InlineBox.h deleted file mode 100644 index bc939a9f09cff..0000000000000 --- a/sky/engine/core/rendering/InlineBox.h +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All - * rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_INLINEBOX_H_ -#define SKY_ENGINE_CORE_RENDERING_INLINEBOX_H_ - -#include "flutter/sky/engine/core/rendering/RenderBoxModelObject.h" -#include "flutter/sky/engine/core/rendering/RenderObjectInlines.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" - -namespace blink { - -class HitTestRequest; -class HitTestResult; -class RootInlineBox; - -enum MarkLineBoxes { MarkLineBoxesDirty, DontMarkLineBoxes }; - -// InlineBox represents a rectangle that occurs on a line. It corresponds to -// some RenderObject (i.e., it represents a portion of that RenderObject). -class InlineBox { - WTF_MAKE_NONCOPYABLE(InlineBox); - - public: - InlineBox(RenderObject& obj) - : m_next(0), - m_prev(0), - m_parent(0), - m_renderer(obj), - m_logicalWidth(0) -#if ENABLE(ASSERT) - , - m_hasBadParent(false) -#endif - { - } - - InlineBox(RenderObject& obj, - FloatPoint topLeft, - float logicalWidth, - bool firstLine, - bool constructed, - bool dirty, - bool extracted, - InlineBox* next, - InlineBox* prev, - InlineFlowBox* parent) - : m_next(next), - m_prev(prev), - m_parent(parent), - m_renderer(obj), - m_topLeft(topLeft), - m_logicalWidth(logicalWidth), - m_bitfields(firstLine, constructed, dirty, extracted) -#if ENABLE(ASSERT) - , - m_hasBadParent(false) -#endif - { - } - - virtual ~InlineBox(); - - virtual void destroy() { delete this; } - - virtual void deleteLine(); - virtual void extractLine(); - virtual void attachLine(); - - virtual bool isLineBreak() const { return false; } - - virtual void adjustPosition(float dx, float dy); - void adjustLogicalPosition(float deltaLogicalLeft, float deltaLogicalTop) { - // FIXME(sky): Remove - adjustPosition(deltaLogicalLeft, deltaLogicalTop); - } - void adjustLineDirectionPosition(float delta) { adjustPosition(delta, 0); } - void adjustBlockDirectionPosition(float delta) { adjustPosition(0, delta); } - - virtual void paint(PaintInfo&, - const LayoutPoint&, - LayoutUnit lineTop, - LayoutUnit lineBottom, - Vector& layers); - virtual bool nodeAtPoint(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset, - LayoutUnit lineTop, - LayoutUnit lineBottom); - - // InlineBoxes are allocated out of the rendering partition. - void* operator new(size_t); - void operator delete(void*); - -#ifndef NDEBUG - void showTreeForThis() const; - void showLineTreeForThis() const; - - virtual void showBox(int = 0) const; - virtual void showLineTreeAndMark(const InlineBox* = 0, - const char* = 0, - const InlineBox* = 0, - const char* = 0, - const RenderObject* = 0, - int = 0) const; - virtual const char* boxName() const; -#endif - - bool isText() const { return m_bitfields.isText(); } - void setIsText(bool isText) { m_bitfields.setIsText(isText); } - - virtual bool isInlineFlowBox() const { return false; } - virtual bool isInlineTextBox() const { return false; } - virtual bool isRootInlineBox() const { return false; } - - virtual bool isSVGInlineTextBox() const { return false; } - virtual bool isSVGInlineFlowBox() const { return false; } - virtual bool isSVGRootInlineBox() const { return false; } - - bool hasVirtualLogicalHeight() const { - return m_bitfields.hasVirtualLogicalHeight(); - } - void setHasVirtualLogicalHeight() { - m_bitfields.setHasVirtualLogicalHeight(true); - } - virtual float virtualLogicalHeight() const { - ASSERT_NOT_REACHED(); - return 0; - } - - virtual FloatRect calculateBoundaries() const { - ASSERT_NOT_REACHED(); - return FloatRect(); - } - - bool isConstructed() { return m_bitfields.constructed(); } - virtual void setConstructed() { m_bitfields.setConstructed(true); } - - void setExtracted(bool extracted = true) { - m_bitfields.setExtracted(extracted); - } - - void setFirstLineStyleBit(bool firstLine) { - m_bitfields.setFirstLine(firstLine); - } - bool isFirstLineStyle() const { return m_bitfields.firstLine(); } - - void remove(MarkLineBoxes = MarkLineBoxesDirty); - - InlineBox* nextOnLine() const { return m_next; } - InlineBox* prevOnLine() const { return m_prev; } - void setNextOnLine(InlineBox* next) { - ASSERT(m_parent || !next); - m_next = next; - } - void setPrevOnLine(InlineBox* prev) { - ASSERT(m_parent || !prev); - m_prev = prev; - } - bool nextOnLineExists() const; - - virtual bool isLeaf() const { return true; } - - InlineBox* nextLeafChild() const; - InlineBox* prevLeafChild() const; - - // Helper functions for editing and hit-testing code. - // FIXME: These two functions should be moved to RenderedPosition once the - // code to convert between Position and inline box, offset pair is moved to - // RenderedPosition. - InlineBox* nextLeafChildIgnoringLineBreak() const; - InlineBox* prevLeafChildIgnoringLineBreak() const; - - RenderObject& renderer() const { return m_renderer; } - - InlineFlowBox* parent() const { - ASSERT(!m_hasBadParent); - return m_parent; - } - void setParent(InlineFlowBox* par) { m_parent = par; } - - const RootInlineBox& root() const; - RootInlineBox& root(); - - // x() is the left side of the box in the containing block's coordinate - // system. - void setX(float x) { m_topLeft.setX(x); } - float x() const { return m_topLeft.x(); } - float left() const { return m_topLeft.x(); } - - // y() is the top side of the box in the containing block's coordinate system. - void setY(float y) { m_topLeft.setY(y); } - float y() const { return m_topLeft.y(); } - float top() const { return m_topLeft.y(); } - - const FloatPoint& topLeft() const { return m_topLeft; } - - float width() const { return logicalWidth(); } - float height() const { - return hasVirtualLogicalHeight() ? virtualLogicalHeight() : logicalHeight(); - } - FloatSize size() const { return FloatSize(width(), height()); } - float right() const { return left() + width(); } - float bottom() const { return top() + height(); } - - // The logicalLeft position is the left edge of the line box in a horizontal - // line and the top edge in a vertical line. - float logicalLeft() const { return m_topLeft.x(); } - float logicalRight() const { return logicalLeft() + logicalWidth(); } - void setLogicalLeft(float left) { - // FIXME(sky): Remove - setX(left); - } - int pixelSnappedLogicalLeft() const { return logicalLeft(); } - int pixelSnappedLogicalRight() const { return ceilf(logicalRight()); } - int pixelSnappedLogicalTop() const { return logicalTop(); } - int pixelSnappedLogicalBottom() const { return ceilf(logicalBottom()); } - - // The logicalTop[ position is the top edge of the line box in a horizontal - // line and the left edge in a vertical line. - float logicalTop() const { return m_topLeft.y(); } - float logicalBottom() const { return logicalTop() + logicalHeight(); } - void setLogicalTop(float top) { setY(top); } - - // The logical width is our extent in the line's overall inline direction, - // i.e., width for horizontal text and height for vertical text. - void setLogicalWidth(float w) { m_logicalWidth = w; } - float logicalWidth() const { return m_logicalWidth; } - - // The logical height is our extent in the block flow direction, i.e., height - // for horizontal text and width for vertical text. - float logicalHeight() const; - - FloatRect logicalFrameRect() const { - return FloatRect(m_topLeft.x(), m_topLeft.y(), m_logicalWidth, - logicalHeight()); - } - - virtual int baselinePosition(FontBaseline baselineType) const; - virtual LayoutUnit lineHeight() const; - - virtual int caretMinOffset() const; - virtual int caretMaxOffset() const; - - unsigned char bidiLevel() const { return m_bitfields.bidiEmbeddingLevel(); } - void setBidiLevel(unsigned char level) { - m_bitfields.setBidiEmbeddingLevel(level); - } - TextDirection direction() const { return bidiLevel() % 2 ? RTL : LTR; } - bool isLeftToRightDirection() const { return direction() == LTR; } - int caretLeftmostOffset() const { - return isLeftToRightDirection() ? caretMinOffset() : caretMaxOffset(); - } - int caretRightmostOffset() const { - return isLeftToRightDirection() ? caretMaxOffset() : caretMinOffset(); - } - - virtual void clearTruncation() {} - - bool isDirty() const { return m_bitfields.dirty(); } - virtual void markDirty() { m_bitfields.setDirty(true); } - - virtual void dirtyLineBoxes(); - - virtual RenderObject::SelectionState selectionState(); - -#if ENABLE(ASSERT) - void setHasBadParent(); -#endif - - int expansion() const { return m_bitfields.expansion(); } - - bool visibleToHitTestRequest(const HitTestRequest& request) const { - return renderer().visibleToHitTestRequest(request); - } - - EVerticalAlign verticalAlign() const { - return renderer().style(m_bitfields.firstLine())->verticalAlign(); - } - - // Use with caution! The type is not checked! - RenderBoxModelObject* boxModelObject() const { - if (!renderer().isText()) - return toRenderBoxModelObject(&renderer()); - return 0; - } - - FloatPoint locationIncludingFlipping(); - - bool knownToHaveNoOverflow() const { - return m_bitfields.knownToHaveNoOverflow(); - } - void clearKnownToHaveNoOverflow(); - - bool dirOverride() const { return m_bitfields.dirOverride(); } - void setDirOverride(bool dirOverride) { - m_bitfields.setDirOverride(dirOverride); - } - -#define ADD_BOOLEAN_BITFIELD(name, Name) \ - private: \ - unsigned m_##name : 1; \ - \ - public: \ - bool name() const { return m_##name; } \ - void set##Name(bool name) { m_##name = name; } - - class InlineBoxBitfields { - public: - InlineBoxBitfields(bool firstLine = false, - bool constructed = false, - bool dirty = false, - bool extracted = false) - : m_firstLine(firstLine), - m_constructed(constructed), - m_bidiEmbeddingLevel(0), - m_dirty(dirty), - m_extracted(extracted), - m_hasVirtualLogicalHeight(false), - m_endsWithBreak(false), - m_hasSelectedChildrenOrCanHaveLeadingExpansion(false), - m_knownToHaveNoOverflow(true), - m_hasEllipsisBoxOrHyphen(false), - m_dirOverride(false), - m_isText(false), - m_hasAddedEllipsis(false), - m_determinedIfNextOnLineExists(false), - m_nextOnLineExists(false), - m_expansion(0) {} - - // Some of these bits are actually for subclasses and moved here to compact - // the structures. for this class - ADD_BOOLEAN_BITFIELD(firstLine, FirstLine); - ADD_BOOLEAN_BITFIELD(constructed, Constructed); - - private: - unsigned - m_bidiEmbeddingLevel : 6; // The maximium bidi level is 62: - // http://unicode.org/reports/tr9/#Explicit_Levels_and_Directions - - public: - unsigned char bidiEmbeddingLevel() const { return m_bidiEmbeddingLevel; } - void setBidiEmbeddingLevel(unsigned char bidiEmbeddingLevel) { - m_bidiEmbeddingLevel = bidiEmbeddingLevel; - } - - ADD_BOOLEAN_BITFIELD(dirty, Dirty); - ADD_BOOLEAN_BITFIELD(extracted, Extracted); - ADD_BOOLEAN_BITFIELD(hasVirtualLogicalHeight, HasVirtualLogicalHeight); - // for RootInlineBox - ADD_BOOLEAN_BITFIELD(endsWithBreak, - EndsWithBreak); // Whether the line ends with a
. - // shared between RootInlineBox and InlineTextBox - ADD_BOOLEAN_BITFIELD(hasSelectedChildrenOrCanHaveLeadingExpansion, - HasSelectedChildrenOrCanHaveLeadingExpansion); - ADD_BOOLEAN_BITFIELD(knownToHaveNoOverflow, KnownToHaveNoOverflow); - ADD_BOOLEAN_BITFIELD(hasEllipsisBoxOrHyphen, HasEllipsisBoxOrHyphen); - // for InlineTextBox - ADD_BOOLEAN_BITFIELD(dirOverride, DirOverride); - ADD_BOOLEAN_BITFIELD(isText, IsText); // Whether or not this object - // represents text with a non-zero - // height. Includes non-image list - // markers, text boxes. - ADD_BOOLEAN_BITFIELD(hasAddedEllipsis, HasAddedEllipsis) - - private: - mutable unsigned m_determinedIfNextOnLineExists : 1; - - public: - bool determinedIfNextOnLineExists() const { - return m_determinedIfNextOnLineExists; - } - void setDeterminedIfNextOnLineExists( - bool determinedIfNextOnLineExists) const { - m_determinedIfNextOnLineExists = determinedIfNextOnLineExists; - } - - private: - mutable unsigned m_nextOnLineExists : 1; - - public: - bool nextOnLineExists() const { return m_nextOnLineExists; } - void setNextOnLineExists(bool nextOnLineExists) const { - m_nextOnLineExists = nextOnLineExists; - } - - private: - signed m_expansion : 12; // for justified text - - public: - signed expansion() const { return m_expansion; } - void setExpansion(signed expansion) { m_expansion = expansion; } - }; -#undef ADD_BOOLEAN_BITFIELD - - private: - InlineBox* m_next; // The next element on the same line as us. - InlineBox* m_prev; // The previous element on the same line as us. - - InlineFlowBox* m_parent; // The box that contains us. - RenderObject& m_renderer; - - protected: - // For RootInlineBox - bool endsWithBreak() const { return m_bitfields.endsWithBreak(); } - void setEndsWithBreak(bool endsWithBreak) { - m_bitfields.setEndsWithBreak(endsWithBreak); - } - bool hasEllipsisBox() const { return m_bitfields.hasEllipsisBoxOrHyphen(); } - bool hasSelectedChildren() const { - return m_bitfields.hasSelectedChildrenOrCanHaveLeadingExpansion(); - } - void setHasSelectedChildren(bool hasSelectedChildren) { - m_bitfields.setHasSelectedChildrenOrCanHaveLeadingExpansion( - hasSelectedChildren); - } - void setHasEllipsisBox(bool hasEllipsisBox) { - m_bitfields.setHasEllipsisBoxOrHyphen(hasEllipsisBox); - } - - // For InlineTextBox - bool hasHyphen() const { return m_bitfields.hasEllipsisBoxOrHyphen(); } - void setHasHyphen(bool hasHyphen) { - m_bitfields.setHasEllipsisBoxOrHyphen(hasHyphen); - } - bool canHaveLeadingExpansion() const { - return m_bitfields.hasSelectedChildrenOrCanHaveLeadingExpansion(); - } - void setCanHaveLeadingExpansion(bool canHaveLeadingExpansion) { - m_bitfields.setHasSelectedChildrenOrCanHaveLeadingExpansion( - canHaveLeadingExpansion); - } - signed expansion() { return m_bitfields.expansion(); } - void setExpansion(signed expansion) { m_bitfields.setExpansion(expansion); } - bool hasAddedEllipsis() const { return m_bitfields.hasAddedEllipsis(); } - void setHasAddedEllipsis(bool hasAddedEllipsis) { - m_bitfields.setHasAddedEllipsis(hasAddedEllipsis); - } - - // For InlineFlowBox and InlineTextBox - bool extracted() const { return m_bitfields.extracted(); } - - FloatPoint m_topLeft; - float m_logicalWidth; - - private: - InlineBoxBitfields m_bitfields; - -#if ENABLE(ASSERT) - bool m_hasBadParent; -#endif -}; - -#if !ENABLE(ASSERT) -inline InlineBox::~InlineBox() {} -#endif - -#if ENABLE(ASSERT) -inline void InlineBox::setHasBadParent() { - m_hasBadParent = true; -} -#endif - -#define DEFINE_INLINE_BOX_TYPE_CASTS(typeName) \ - DEFINE_TYPE_CASTS(typeName, InlineBox, box, box->is##typeName(), \ - box.is##typeName()) - -// Allow equality comparisons of InlineBox's by reference or pointer, -// interchangeably. -DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(InlineBox) - -} // namespace blink - -#ifndef NDEBUG -// Outside the WebCore namespace for ease of invocation from gdb. -void showTree(const blink::InlineBox*); -void showLineTree(const blink::InlineBox*); -#endif - -#endif // SKY_ENGINE_CORE_RENDERING_INLINEBOX_H_ diff --git a/sky/engine/core/rendering/InlineFlowBox.cpp b/sky/engine/core/rendering/InlineFlowBox.cpp deleted file mode 100644 index 38394949549aa..0000000000000 --- a/sky/engine/core/rendering/InlineFlowBox.cpp +++ /dev/null @@ -1,1460 +0,0 @@ -/* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "flutter/sky/engine/core/rendering/InlineFlowBox.h" - -#include "flutter/sky/engine/core/rendering/HitTestResult.h" -#include "flutter/sky/engine/core/rendering/InlineTextBox.h" -#include "flutter/sky/engine/core/rendering/RenderBlock.h" -#include "flutter/sky/engine/core/rendering/RenderInline.h" -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderObjectInlines.h" -#include "flutter/sky/engine/core/rendering/RenderParagraph.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/core/rendering/RootInlineBox.h" -#include "flutter/sky/engine/platform/fonts/Font.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h" - -#include - -namespace blink { - -struct SameSizeAsInlineFlowBox : public InlineBox { - void* pointers[5]; - uint32_t bitfields : 23; -}; - -COMPILE_ASSERT(sizeof(InlineFlowBox) == sizeof(SameSizeAsInlineFlowBox), - InlineFlowBox_should_stay_small); - -#if ENABLE(ASSERT) - -InlineFlowBox::~InlineFlowBox() { - if (!m_hasBadChildList) - for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) - child->setHasBadParent(); -} - -#endif - -LayoutUnit InlineFlowBox::getFlowSpacingLogicalWidth() { - LayoutUnit totWidth = - marginBorderPaddingLogicalLeft() + marginBorderPaddingLogicalRight(); - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - if (curr->isInlineFlowBox()) - totWidth += toInlineFlowBox(curr)->getFlowSpacingLogicalWidth(); - } - return totWidth; -} - -IntRect InlineFlowBox::roundedFrameRect() const { - // Begin by snapping the x and y coordinates to the nearest pixel. - int snappedX = lroundf(x()); - int snappedY = lroundf(y()); - - int snappedMaxX = lroundf(x() + width()); - int snappedMaxY = lroundf(y() + height()); - - return IntRect(snappedX, snappedY, snappedMaxX - snappedX, - snappedMaxY - snappedY); -} - -static void setHasTextDescendantsOnAncestors(InlineFlowBox* box) { - while (box && !box->hasTextDescendants()) { - box->setHasTextDescendants(); - box = box->parent(); - } -} - -static bool hasSelfPaintingLayer(InlineBox* box) { - RenderObject& renderer = box->renderer(); - if (renderer.isBox()) - return toRenderBox(renderer).hasSelfPaintingLayer(); - return false; -} - -void InlineFlowBox::addToLine(InlineBox* child) { - ASSERT(!child->parent()); - ASSERT(!child->nextOnLine()); - ASSERT(!child->prevOnLine()); - checkConsistency(); - - child->setParent(this); - if (!m_firstChild) { - m_firstChild = child; - m_lastChild = child; - } else { - m_lastChild->setNextOnLine(child); - child->setPrevOnLine(m_lastChild); - m_lastChild = child; - } - child->setFirstLineStyleBit(isFirstLineStyle()); - if (child->isText()) { - if (child->renderer().parent() == renderer()) - m_hasTextChildren = true; - setHasTextDescendantsOnAncestors(this); - } else if (child->isInlineFlowBox()) { - if (toInlineFlowBox(child)->hasTextDescendants()) - setHasTextDescendantsOnAncestors(this); - } - - if (descendantsHaveSameLineHeightAndBaseline() && - !child->renderer().isOutOfFlowPositioned()) { - RenderStyle* parentStyle = renderer().style(isFirstLineStyle()); - RenderStyle* childStyle = child->renderer().style(isFirstLineStyle()); - bool shouldClearDescendantsHaveSameLineHeightAndBaseline = false; - if (child->renderer().isReplaced()) - shouldClearDescendantsHaveSameLineHeightAndBaseline = true; - else if (child->isText()) { - if (child->renderer().parent() != renderer()) { - if (!parentStyle->font() - .fontMetrics() - .hasIdenticalAscentDescentAndLineGap( - childStyle->font().fontMetrics()) || - parentStyle->lineHeight() != childStyle->lineHeight() || - (parentStyle->verticalAlign() != BASELINE && !isRootInlineBox()) || - childStyle->verticalAlign() != BASELINE) - shouldClearDescendantsHaveSameLineHeightAndBaseline = true; - } - if (childStyle->textEmphasisMark() != TextEmphasisMarkNone) - shouldClearDescendantsHaveSameLineHeightAndBaseline = true; - } else { - ASSERT(isInlineFlowBox()); - InlineFlowBox* childFlowBox = toInlineFlowBox(child); - // Check the child's bit, and then also check for differences in font, - // line-height, vertical-align - if (!childFlowBox->descendantsHaveSameLineHeightAndBaseline() || - !parentStyle->font() - .fontMetrics() - .hasIdenticalAscentDescentAndLineGap( - childStyle->font().fontMetrics()) || - parentStyle->lineHeight() != childStyle->lineHeight() || - (parentStyle->verticalAlign() != BASELINE && !isRootInlineBox()) || - childStyle->verticalAlign() != BASELINE || childStyle->hasBorder() || - childStyle->hasPadding()) - shouldClearDescendantsHaveSameLineHeightAndBaseline = true; - } - - if (shouldClearDescendantsHaveSameLineHeightAndBaseline) - clearDescendantsHaveSameLineHeightAndBaseline(); - } - - if (!child->renderer().isOutOfFlowPositioned()) { - if (child->isText()) { - RenderStyle* childStyle = child->renderer().style(isFirstLineStyle()); - if (childStyle->letterSpacing() < 0 || childStyle->textShadow() || - childStyle->textEmphasisMark() != TextEmphasisMarkNone || - childStyle->textStrokeWidth()) - child->clearKnownToHaveNoOverflow(); - } else if (child->renderer().isReplaced()) { - RenderBox& box = toRenderBox(child->renderer()); - if (box.hasRenderOverflow() || box.hasSelfPaintingLayer()) - child->clearKnownToHaveNoOverflow(); - } else if (child->renderer().style(isFirstLineStyle())->boxShadow() || - hasSelfPaintingLayer(child) || - child->renderer().style(isFirstLineStyle())->hasOutline()) { - child->clearKnownToHaveNoOverflow(); - } - - if (knownToHaveNoOverflow() && child->isInlineFlowBox() && - !toInlineFlowBox(child)->knownToHaveNoOverflow()) - clearKnownToHaveNoOverflow(); - } - - checkConsistency(); -} - -void InlineFlowBox::removeChild(InlineBox* child, MarkLineBoxes markDirty) { - checkConsistency(); - - if (markDirty == MarkLineBoxesDirty && !isDirty()) - dirtyLineBoxes(); - - root().childRemoved(child); - - if (child == m_firstChild) - m_firstChild = child->nextOnLine(); - if (child == m_lastChild) - m_lastChild = child->prevOnLine(); - if (child->nextOnLine()) - child->nextOnLine()->setPrevOnLine(child->prevOnLine()); - if (child->prevOnLine()) - child->prevOnLine()->setNextOnLine(child->nextOnLine()); - - child->setParent(0); - - checkConsistency(); -} - -void InlineFlowBox::deleteLine() { - InlineBox* child = firstChild(); - InlineBox* next = 0; - while (child) { - ASSERT(this == child->parent()); - next = child->nextOnLine(); -#if ENABLE(ASSERT) - child->setParent(0); -#endif - child->deleteLine(); - child = next; - } -#if ENABLE(ASSERT) - m_firstChild = 0; - m_lastChild = 0; -#endif - - removeLineBoxFromRenderObject(); - destroy(); -} - -void InlineFlowBox::removeLineBoxFromRenderObject() { - rendererLineBoxes()->removeLineBox(this); -} - -void InlineFlowBox::extractLine() { - if (!extracted()) - extractLineBoxFromRenderObject(); - for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) - child->extractLine(); -} - -void InlineFlowBox::extractLineBoxFromRenderObject() { - rendererLineBoxes()->extractLineBox(this); -} - -void InlineFlowBox::attachLine() { - if (extracted()) - attachLineBoxToRenderObject(); - for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) - child->attachLine(); -} - -void InlineFlowBox::attachLineBoxToRenderObject() { - rendererLineBoxes()->attachLineBox(this); -} - -void InlineFlowBox::adjustPosition(float dx, float dy) { - InlineBox::adjustPosition(dx, dy); - for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) - child->adjustPosition(dx, dy); - if (m_overflow) - m_overflow->move(dx, dy); // FIXME: Rounding error here since overflow was - // pixel snapped, but nobody other than list - // markers passes non-integral values here. -} - -RenderLineBoxList* InlineFlowBox::rendererLineBoxes() const { - return toRenderInline(renderer()).lineBoxes(); -} - -static inline bool isLastChildForRenderer(RenderObject* ancestor, - RenderObject* child) { - if (!child) - return false; - - if (child == ancestor) - return true; - - RenderObject* curr = child; - RenderObject* parent = curr->parent(); - while (parent && (!parent->isRenderBlock() || parent->isInline())) { - if (parent->slowLastChild() != curr) - return false; - if (parent == ancestor) - return true; - - curr = parent; - parent = curr->parent(); - } - - return true; -} - -static bool isAnsectorAndWithinBlock(RenderObject* ancestor, - RenderObject* child) { - RenderObject* object = child; - while (object && (!object->isRenderBlock() || object->isInline())) { - if (object == ancestor) - return true; - object = object->parent(); - } - return false; -} - -void InlineFlowBox::determineSpacingForFlowBoxes( - bool lastLine, - bool isLogicallyLastRunWrapped, - RenderObject* logicallyLastRunRenderer) { - // All boxes start off open. They will not apply any margins/border/padding - // on any side. - bool includeLeftEdge = false; - bool includeRightEdge = false; - - // The root inline box never has borders/margins/padding. - if (parent()) { - bool ltr = renderer().style()->isLeftToRightDirection(); - - // Check to see if all initial lines are unconstructed. If so, then - // we know the inline began on this line. - RenderLineBoxList* lineBoxList = rendererLineBoxes(); - if (!lineBoxList->firstLineBox()->isConstructed()) { - if (renderer().style()->boxDecorationBreak() == DCLONE) - includeLeftEdge = includeRightEdge = true; - else if (ltr && lineBoxList->firstLineBox() == this) - includeLeftEdge = true; - else if (!ltr && lineBoxList->lastLineBox() == this) - includeRightEdge = true; - } - - if (!lineBoxList->lastLineBox()->isConstructed()) { - bool isLastObjectOnLine = - !isAnsectorAndWithinBlock(&renderer(), logicallyLastRunRenderer) || - (isLastChildForRenderer(&renderer(), logicallyLastRunRenderer) && - !isLogicallyLastRunWrapped); - - // We include the border under these conditions: - // (1) The next line was not created, or it is constructed. We check the - // previous line for rtl. (2) The logicallyLastRun is not a descendant of - // this renderer. (3) The logicallyLastRun is a descendant of this - // renderer, but it is the last child of this renderer and it does not - // wrap to the next line. (4) The decoration break is set to clone - // therefore there will be borders on every sides. - if (renderer().style()->boxDecorationBreak() == DCLONE) - includeLeftEdge = includeRightEdge = true; - else if (ltr) { - if (!nextLineBox() && (lastLine || isLastObjectOnLine)) - includeRightEdge = true; - } else { - if ((!prevLineBox() || prevLineBox()->isConstructed()) && - (lastLine || isLastObjectOnLine)) - includeLeftEdge = true; - } - } - } - - setEdges(includeLeftEdge, includeRightEdge); - - // Recur into our children. - for (InlineBox* currChild = firstChild(); currChild; - currChild = currChild->nextOnLine()) { - if (currChild->isInlineFlowBox()) { - InlineFlowBox* currFlow = toInlineFlowBox(currChild); - currFlow->determineSpacingForFlowBoxes( - lastLine, isLogicallyLastRunWrapped, logicallyLastRunRenderer); - } - } -} - -float InlineFlowBox::placeBoxesInInlineDirection(float logicalLeft, - bool& needsWordSpacing) { - // Set our x position. - beginPlacingBoxRangesInInlineDirection(logicalLeft); - - float startLogicalLeft = logicalLeft; - logicalLeft += borderLogicalLeft() + paddingLogicalLeft(); - - float minLogicalLeft = startLogicalLeft; - float maxLogicalRight = logicalLeft; - - placeBoxRangeInInlineDirection(firstChild(), 0, logicalLeft, minLogicalLeft, - maxLogicalRight, needsWordSpacing); - - logicalLeft += borderLogicalRight() + paddingLogicalRight(); - endPlacingBoxRangesInInlineDirection(startLogicalLeft, logicalLeft, - minLogicalLeft, maxLogicalRight); - return logicalLeft; -} - -float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, - InlineBox* lastChild, - float& logicalLeft, - float& minLogicalLeft, - float& maxLogicalRight, - bool& needsWordSpacing) { - for (InlineBox* curr = firstChild; curr && curr != lastChild; - curr = curr->nextOnLine()) { - if (curr->renderer().isText()) { - InlineTextBox* text = toInlineTextBox(curr); - RenderText& rt = text->renderer(); - if (rt.textLength()) { - if (needsWordSpacing && isSpaceOrNewline(rt.characterAt(text->start()))) - logicalLeft += rt.style(isFirstLineStyle()) - ->font() - .fontDescription() - .wordSpacing(); - needsWordSpacing = !isSpaceOrNewline(rt.characterAt(text->end())); - } - text->setLogicalLeft(logicalLeft); - if (knownToHaveNoOverflow()) - minLogicalLeft = std::min(logicalLeft, minLogicalLeft); - logicalLeft += text->logicalWidth(); - if (knownToHaveNoOverflow()) - maxLogicalRight = std::max(logicalLeft, maxLogicalRight); - } else { - if (curr->renderer().isOutOfFlowPositioned()) { - if (curr->renderer().parent()->style()->isLeftToRightDirection()) { - curr->setLogicalLeft(logicalLeft); - } else { - // Our offset that we cache needs to be from the edge of the right - // border box and not the left border box. We have to subtract |x| - // from the width of the block (which can be obtained from the root - // line box). - curr->setLogicalLeft(root().block().logicalWidth() - logicalLeft); - } - continue; // The positioned object has no effect on the width. - } - if (curr->renderer().isRenderInline()) { - InlineFlowBox* flow = toInlineFlowBox(curr); - logicalLeft += flow->marginLogicalLeft(); - if (knownToHaveNoOverflow()) - minLogicalLeft = std::min(logicalLeft, minLogicalLeft); - logicalLeft = - flow->placeBoxesInInlineDirection(logicalLeft, needsWordSpacing); - if (knownToHaveNoOverflow()) - maxLogicalRight = std::max(logicalLeft, maxLogicalRight); - logicalLeft += flow->marginLogicalRight(); - } else { - // The box can have a different writing-mode than the overall line, so - // this is a bit complicated. Just get all the physical margin and - // overflow values by hand based off |isVertical|. - LayoutUnit logicalLeftMargin = curr->boxModelObject()->marginLeft(); - LayoutUnit logicalRightMargin = curr->boxModelObject()->marginRight(); - - logicalLeft += logicalLeftMargin; - curr->setLogicalLeft(logicalLeft); - if (knownToHaveNoOverflow()) - minLogicalLeft = std::min(logicalLeft, minLogicalLeft); - logicalLeft += curr->logicalWidth(); - if (knownToHaveNoOverflow()) - maxLogicalRight = std::max(logicalLeft, maxLogicalRight); - logicalLeft += logicalRightMargin; - // If we encounter any space after this inline block then ensure it is - // treated as the space between two words. - needsWordSpacing = true; - } - } - } - return logicalLeft; -} - -void InlineFlowBox::adjustMaxAscentAndDescent(int& maxAscent, - int& maxDescent, - int maxPositionTop, - int maxPositionBottom) { - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - // The computed lineheight needs to be extended for the - // positioned elements - if (curr->renderer().isOutOfFlowPositioned()) - continue; // Positioned placeholders don't affect calculations. - if (curr->verticalAlign() == TOP || curr->verticalAlign() == BOTTOM) { - int lineHeight = curr->lineHeight(); - if (curr->verticalAlign() == TOP) { - if (maxAscent + maxDescent < lineHeight) - maxDescent = lineHeight - maxAscent; - } else { - if (maxAscent + maxDescent < lineHeight) - maxAscent = lineHeight - maxDescent; - } - - if (maxAscent + maxDescent >= std::max(maxPositionTop, maxPositionBottom)) - break; - } - - if (curr->isInlineFlowBox()) - toInlineFlowBox(curr)->adjustMaxAscentAndDescent( - maxAscent, maxDescent, maxPositionTop, maxPositionBottom); - } -} - -void InlineFlowBox::computeLogicalBoxHeights( - RootInlineBox* rootBox, - LayoutUnit& maxPositionTop, - LayoutUnit& maxPositionBottom, - int& maxAscent, - int& maxDescent, - bool& setMaxAscent, - bool& setMaxDescent, - bool strictMode, - GlyphOverflowAndFallbackFontsMap& textBoxDataMap, - FontBaseline baselineType, - VerticalPositionCache& verticalPositionCache) { - // The primary purpose of this function is to compute the maximal ascent and - // descent values for a line. These values are computed based off the block's - // line-box-contain property, which indicates what parts of descendant boxes - // have to fit within the line. - // - // The maxAscent value represents the distance of the highest point of any box - // (typically including line-height) from the root box's baseline. The - // maxDescent value represents the distance of the lowest point of any box - // (also typically including line-height) from the root box baseline. These - // values can be negative. - // - // A secondary purpose of this function is to store the offset of every box's - // baseline from the root box's baseline. This information is cached in the - // logicalTop() of every box. We're effectively just using the logicalTop() as - // scratch space. - // - // Because a box can be positioned such that it ends up fully above or fully - // below the root line box, we only consider it to affect the maxAscent and - // maxDescent values if some part of the box (EXCLUDING leading) is above (for - // ascent) or below (for descent) the root box's baseline. - bool affectsAscent = false; - bool affectsDescent = false; - bool checkChildren = !descendantsHaveSameLineHeightAndBaseline(); - - if (isRootInlineBox()) { - // Examine our root box. - int ascent = 0; - int descent = 0; - rootBox->ascentAndDescentForBox(rootBox, textBoxDataMap, ascent, descent, - affectsAscent, affectsDescent); - if (strictMode || hasTextChildren() || - (!checkChildren && hasTextDescendants())) { - if (maxAscent < ascent || !setMaxAscent) { - maxAscent = ascent; - setMaxAscent = true; - } - if (maxDescent < descent || !setMaxDescent) { - maxDescent = descent; - setMaxDescent = true; - } - } - } - - if (!checkChildren) - return; - - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - if (curr->renderer().isOutOfFlowPositioned()) - continue; // Positioned placeholders don't affect calculations. - - InlineFlowBox* inlineFlowBox = - curr->isInlineFlowBox() ? toInlineFlowBox(curr) : 0; - - bool affectsAscent = false; - bool affectsDescent = false; - - // The verticalPositionForBox function returns the distance between the - // child box's baseline and the root box's baseline. The value is negative - // if the child box's baseline is above the root box's baseline, and it is - // positive if the child box's baseline is below the root box's baseline. - curr->setLogicalTop( - rootBox->verticalPositionForBox(curr, verticalPositionCache).toFloat()); - - int ascent = 0; - int descent = 0; - rootBox->ascentAndDescentForBox(curr, textBoxDataMap, ascent, descent, - affectsAscent, affectsDescent); - - LayoutUnit boxHeight = ascent + descent; - if (curr->verticalAlign() == TOP) { - if (maxPositionTop < boxHeight) - maxPositionTop = boxHeight; - } else if (curr->verticalAlign() == BOTTOM) { - if (maxPositionBottom < boxHeight) - maxPositionBottom = boxHeight; - } else if (!inlineFlowBox || strictMode || - inlineFlowBox->hasTextChildren() || - (inlineFlowBox->descendantsHaveSameLineHeightAndBaseline() && - inlineFlowBox->hasTextDescendants()) || - inlineFlowBox->boxModelObject() - ->hasInlineDirectionBordersOrPadding()) { - // Note that these values can be negative. Even though we only affect the - // maxAscent and maxDescent values if our box (excluding line-height) was - // above (for ascent) or below (for descent) the root baseline, once you - // factor in line-height the final box can end up being fully above or - // fully below the root box's baseline! This is ok, but what it means is - // that ascent and descent (including leading), can end up being negative. - // The setMaxAscent and setMaxDescent booleans are used to ensure that - // we're willing to initially set maxAscent/Descent to negative values. - ascent -= curr->logicalTop(); - descent += curr->logicalTop(); - if (affectsAscent && (maxAscent < ascent || !setMaxAscent)) { - maxAscent = ascent; - setMaxAscent = true; - } - - if (affectsDescent && (maxDescent < descent || !setMaxDescent)) { - maxDescent = descent; - setMaxDescent = true; - } - } - - if (inlineFlowBox) - inlineFlowBox->computeLogicalBoxHeights( - rootBox, maxPositionTop, maxPositionBottom, maxAscent, maxDescent, - setMaxAscent, setMaxDescent, strictMode, textBoxDataMap, baselineType, - verticalPositionCache); - } -} - -void InlineFlowBox::placeBoxesInBlockDirection( - LayoutUnit top, - LayoutUnit maxHeight, - int maxAscent, - bool strictMode, - LayoutUnit& lineTop, - LayoutUnit& lineBottom, - LayoutUnit& selectionBottom, - bool& setLineTop, - LayoutUnit& lineTopIncludingMargins, - LayoutUnit& lineBottomIncludingMargins, - bool& hasAnnotationsBefore, - bool& hasAnnotationsAfter, - FontBaseline baselineType) { - bool isRootBox = isRootInlineBox(); - if (isRootBox) { - const FontMetrics& fontMetrics = - renderer().style(isFirstLineStyle())->fontMetrics(); - // RootInlineBoxes are always placed on at pixel boundaries in their logical - // y direction. Not doing so results in incorrect rendering of text - // decorations, most notably underlines. - setLogicalTop( - roundToInt(top + maxAscent - fontMetrics.ascent(baselineType))); - } - - LayoutUnit adjustmentForChildrenWithSameLineHeightAndBaseline = 0; - if (descendantsHaveSameLineHeightAndBaseline()) { - adjustmentForChildrenWithSameLineHeightAndBaseline = logicalTop(); - if (parent()) - adjustmentForChildrenWithSameLineHeightAndBaseline += - (boxModelObject()->borderBefore() + - boxModelObject()->paddingBefore()); - } - - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - if (curr->renderer().isOutOfFlowPositioned()) - continue; // Positioned placeholders don't affect calculations. - - if (descendantsHaveSameLineHeightAndBaseline()) { - curr->adjustBlockDirectionPosition( - adjustmentForChildrenWithSameLineHeightAndBaseline.toFloat()); - continue; - } - - InlineFlowBox* inlineFlowBox = - curr->isInlineFlowBox() ? toInlineFlowBox(curr) : 0; - bool childAffectsTopBottomPos = true; - if (curr->verticalAlign() == TOP) - curr->setLogicalTop(top.toFloat()); - else if (curr->verticalAlign() == BOTTOM) - curr->setLogicalTop((top + maxHeight - curr->lineHeight()).toFloat()); - else { - if (!strictMode && inlineFlowBox && !inlineFlowBox->hasTextChildren() && - !curr->boxModelObject()->hasInlineDirectionBordersOrPadding() && - !(inlineFlowBox->descendantsHaveSameLineHeightAndBaseline() && - inlineFlowBox->hasTextDescendants())) - childAffectsTopBottomPos = false; - LayoutUnit posAdjust = maxAscent - curr->baselinePosition(baselineType); - curr->setLogicalTop(curr->logicalTop() + top + posAdjust); - } - - LayoutUnit newLogicalTop = curr->logicalTop(); - LayoutUnit newLogicalTopIncludingMargins = newLogicalTop; - LayoutUnit boxHeight = curr->logicalHeight(); - LayoutUnit boxHeightIncludingMargins = boxHeight; - LayoutUnit borderPaddingHeight = 0; - if (curr->isText() || curr->isInlineFlowBox()) { - const FontMetrics& fontMetrics = - curr->renderer().style(isFirstLineStyle())->fontMetrics(); - newLogicalTop += curr->baselinePosition(baselineType) - - fontMetrics.ascent(baselineType); - if (curr->isInlineFlowBox()) { - RenderBoxModelObject& boxObject = - toRenderBoxModelObject(curr->renderer()); - newLogicalTop -= boxObject.borderTop() + boxObject.paddingTop(); - borderPaddingHeight = boxObject.borderAndPaddingLogicalHeight(); - } - newLogicalTopIncludingMargins = newLogicalTop; - } else { - RenderBox& box = toRenderBox(curr->renderer()); - newLogicalTopIncludingMargins = newLogicalTop; - LayoutUnit overSideMargin = box.marginTop(); - LayoutUnit underSideMargin = box.marginBottom(); - newLogicalTop += overSideMargin; - boxHeightIncludingMargins += overSideMargin + underSideMargin; - } - - curr->setLogicalTop(newLogicalTop.toFloat()); - - if (childAffectsTopBottomPos) { - if (curr->isInlineTextBox()) { - TextEmphasisPosition emphasisMarkPosition; - if (toInlineTextBox(curr)->getEmphasisMarkPosition( - curr->renderer().style(isFirstLineStyle()), - emphasisMarkPosition)) { - bool emphasisMarkIsOver = - emphasisMarkPosition == TextEmphasisPositionOver; - if (emphasisMarkIsOver) - hasAnnotationsBefore = true; - else - hasAnnotationsAfter = true; - } - } - - if (!setLineTop) { - setLineTop = true; - lineTop = newLogicalTop; - lineTopIncludingMargins = - std::min(lineTop, newLogicalTopIncludingMargins); - } else { - lineTop = std::min(lineTop, newLogicalTop); - lineTopIncludingMargins = std::min( - lineTop, - std::min(lineTopIncludingMargins, newLogicalTopIncludingMargins)); - } - selectionBottom = std::max( - selectionBottom, newLogicalTop + boxHeight - borderPaddingHeight); - lineBottom = std::max(lineBottom, newLogicalTop + boxHeight); - lineBottomIncludingMargins = std::max( - lineBottom, - std::max(lineBottomIncludingMargins, - newLogicalTopIncludingMargins + boxHeightIncludingMargins)); - } - - // Adjust boxes to use their real box y/height and not the logical height - // (as dictated by line-height). - if (inlineFlowBox) - inlineFlowBox->placeBoxesInBlockDirection( - top, maxHeight, maxAscent, strictMode, lineTop, lineBottom, - selectionBottom, setLineTop, lineTopIncludingMargins, - lineBottomIncludingMargins, hasAnnotationsBefore, hasAnnotationsAfter, - baselineType); - } - - if (isRootBox) { - if (strictMode || hasTextChildren() || - (descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) { - if (!setLineTop) { - setLineTop = true; - lineTop = pixelSnappedLogicalTop(); - lineTopIncludingMargins = lineTop; - } else { - lineTop = std::min(lineTop, pixelSnappedLogicalTop()); - lineTopIncludingMargins = std::min(lineTop, lineTopIncludingMargins); - } - selectionBottom = - std::max(selectionBottom, pixelSnappedLogicalBottom()); - lineBottom = - std::max(lineBottom, pixelSnappedLogicalBottom()); - lineBottomIncludingMargins = - std::max(lineBottom, lineBottomIncludingMargins); - } - } -} - -void InlineFlowBox::computeMaxLogicalTop(float& maxLogicalTop) const { - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - if (curr->renderer().isOutOfFlowPositioned()) - continue; // Positioned placeholders don't affect calculations. - - if (descendantsHaveSameLineHeightAndBaseline()) - continue; - - maxLogicalTop = std::max(maxLogicalTop, curr->y()); - float localMaxLogicalTop = 0; - if (curr->isInlineFlowBox()) - toInlineFlowBox(curr)->computeMaxLogicalTop(localMaxLogicalTop); - maxLogicalTop = std::max(maxLogicalTop, localMaxLogicalTop); - } -} - -void InlineFlowBox::flipLinesInBlockDirection(LayoutUnit lineTop, - LayoutUnit lineBottom) { - // Flip the box on the line such that the top is now relative to the - // lineBottom instead of the lineTop. - setLogicalTop(lineBottom - (logicalTop() - lineTop) - logicalHeight()); - - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - if (curr->renderer().isOutOfFlowPositioned()) - continue; // Positioned placeholders aren't affected here. - - if (curr->isInlineFlowBox()) - toInlineFlowBox(curr)->flipLinesInBlockDirection(lineTop, lineBottom); - else - curr->setLogicalTop(lineBottom - (curr->logicalTop() - lineTop) - - curr->logicalHeight()); - } -} - -inline void InlineFlowBox::addBoxShadowVisualOverflow( - LayoutRect& logicalVisualOverflow) { - // box-shadow on root line boxes is applying to the block and not to the - // lines. - if (!parent()) - return; - - RenderStyle* style = renderer().style(isFirstLineStyle()); - if (!style->boxShadow()) - return; - - LayoutUnit boxShadowLogicalTop; - LayoutUnit boxShadowLogicalBottom; - style->getBoxShadowBlockDirectionExtent(boxShadowLogicalTop, - boxShadowLogicalBottom); - - // Similar to how glyph overflow works, if our lines are flipped, then it's - // actually the opposite shadow that applies, since the line is "upside down" - // in terms of block coordinates. - LayoutUnit shadowLogicalTop = boxShadowLogicalTop; - LayoutUnit shadowLogicalBottom = boxShadowLogicalBottom; - - LayoutUnit logicalTopVisualOverflow = std::min( - pixelSnappedLogicalTop() + shadowLogicalTop, logicalVisualOverflow.y()); - LayoutUnit logicalBottomVisualOverflow = - std::max(pixelSnappedLogicalBottom() + shadowLogicalBottom, - logicalVisualOverflow.maxY()); - - LayoutUnit boxShadowLogicalLeft; - LayoutUnit boxShadowLogicalRight; - style->getBoxShadowInlineDirectionExtent(boxShadowLogicalLeft, - boxShadowLogicalRight); - - LayoutUnit logicalLeftVisualOverflow = - std::min(pixelSnappedLogicalLeft() + boxShadowLogicalLeft, - logicalVisualOverflow.x()); - LayoutUnit logicalRightVisualOverflow = - std::max(pixelSnappedLogicalRight() + boxShadowLogicalRight, - logicalVisualOverflow.maxX()); - - logicalVisualOverflow = - LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow, - logicalRightVisualOverflow - logicalLeftVisualOverflow, - logicalBottomVisualOverflow - logicalTopVisualOverflow); -} - -inline void InlineFlowBox::addBorderOutsetVisualOverflow( - LayoutRect& logicalVisualOverflow) { - return; -} - -inline void InlineFlowBox::addOutlineVisualOverflow( - LayoutRect& logicalVisualOverflow) { - // Outline on root line boxes is applied to the block and not to the lines. - if (!parent()) - return; - - RenderStyle* style = renderer().style(isFirstLineStyle()); - if (!style->hasOutline()) - return; - - logicalVisualOverflow.inflate(style->outlineSize()); -} - -inline void InlineFlowBox::addTextBoxVisualOverflow( - InlineTextBox* textBox, - GlyphOverflowAndFallbackFontsMap& textBoxDataMap, - LayoutRect& logicalVisualOverflow) { - if (textBox->knownToHaveNoOverflow()) - return; - - RenderStyle* style = textBox->renderer().style(isFirstLineStyle()); - - GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.find(textBox); - GlyphOverflow* glyphOverflow = - it == textBoxDataMap.end() ? 0 : &it->value.second; - - int topGlyphEdge = glyphOverflow ? glyphOverflow->top : 0; - int bottomGlyphEdge = glyphOverflow ? glyphOverflow->bottom : 0; - int leftGlyphEdge = glyphOverflow ? glyphOverflow->left : 0; - int rightGlyphEdge = glyphOverflow ? glyphOverflow->right : 0; - - int strokeOverflow = static_cast(ceilf(style->textStrokeWidth() / 2.0f)); - int topGlyphOverflow = -strokeOverflow - topGlyphEdge; - int bottomGlyphOverflow = strokeOverflow + bottomGlyphEdge; - int leftGlyphOverflow = -strokeOverflow - leftGlyphEdge; - int rightGlyphOverflow = strokeOverflow + rightGlyphEdge; - - TextEmphasisPosition emphasisMarkPosition; - if (style->textEmphasisMark() != TextEmphasisMarkNone && - textBox->getEmphasisMarkPosition(style, emphasisMarkPosition)) { - int emphasisMarkHeight = - style->font().emphasisMarkHeight(style->textEmphasisMarkString()); - if (emphasisMarkPosition == TextEmphasisPositionOver) - topGlyphOverflow = std::min(topGlyphOverflow, -emphasisMarkHeight); - else - bottomGlyphOverflow = std::max(bottomGlyphOverflow, emphasisMarkHeight); - } - - // If letter-spacing is negative, we should factor that into right layout - // overflow. (Even in RTL, letter-spacing is applied to the right, so this is - // not an issue with left overflow. - rightGlyphOverflow -= - std::min(0, (int)style->font().fontDescription().letterSpacing()); - - LayoutUnit textShadowLogicalTop; - LayoutUnit textShadowLogicalBottom; - style->getTextShadowBlockDirectionExtent(textShadowLogicalTop, - textShadowLogicalBottom); - - LayoutUnit childOverflowLogicalTop = std::min( - textShadowLogicalTop + topGlyphOverflow, topGlyphOverflow); - LayoutUnit childOverflowLogicalBottom = std::max( - textShadowLogicalBottom + bottomGlyphOverflow, bottomGlyphOverflow); - - LayoutUnit textShadowLogicalLeft; - LayoutUnit textShadowLogicalRight; - style->getTextShadowInlineDirectionExtent(textShadowLogicalLeft, - textShadowLogicalRight); - - LayoutUnit childOverflowLogicalLeft = std::min( - textShadowLogicalLeft + leftGlyphOverflow, leftGlyphOverflow); - LayoutUnit childOverflowLogicalRight = std::max( - textShadowLogicalRight + rightGlyphOverflow, rightGlyphOverflow); - - LayoutUnit logicalTopVisualOverflow = - std::min(textBox->pixelSnappedLogicalTop() + childOverflowLogicalTop, - logicalVisualOverflow.y()); - LayoutUnit logicalBottomVisualOverflow = std::max( - textBox->pixelSnappedLogicalBottom() + childOverflowLogicalBottom, - logicalVisualOverflow.maxY()); - LayoutUnit logicalLeftVisualOverflow = - std::min(textBox->pixelSnappedLogicalLeft() + childOverflowLogicalLeft, - logicalVisualOverflow.x()); - LayoutUnit logicalRightVisualOverflow = - std::max(textBox->pixelSnappedLogicalRight() + childOverflowLogicalRight, - logicalVisualOverflow.maxX()); - - logicalVisualOverflow = - LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow, - logicalRightVisualOverflow - logicalLeftVisualOverflow, - logicalBottomVisualOverflow - logicalTopVisualOverflow); - - textBox->setLogicalOverflowRect(logicalVisualOverflow); -} - -inline void InlineFlowBox::addReplacedChildOverflow( - const InlineBox* inlineBox, - LayoutRect& logicalLayoutOverflow, - LayoutRect& logicalVisualOverflow) { - RenderBox& box = toRenderBox(inlineBox->renderer()); - - // Visual overflow only propagates if the box doesn't have a self-painting - // layer. This rectangle does not include transforms or relative positioning - // (since those objects always have self-painting layers), but it does need to - // be adjusted for writing-mode differences. - if (!box.hasSelfPaintingLayer()) { - LayoutRect childLogicalVisualOverflow = box.visualOverflowRect(); - childLogicalVisualOverflow.move(inlineBox->logicalLeft(), - inlineBox->logicalTop()); - logicalVisualOverflow.unite(childLogicalVisualOverflow); - } - - // Layout overflow internal to the child box only propagates if the child box - // doesn't have overflow clip set. Otherwise the child border box propagates - // as layout overflow. This rectangle must include transforms and relative - // positioning and be adjusted for writing-mode differences. - LayoutRect childLogicalLayoutOverflow = - box.layoutOverflowRectForPropagation(); - childLogicalLayoutOverflow.move(inlineBox->logicalLeft(), - inlineBox->logicalTop()); - logicalLayoutOverflow.unite(childLogicalLayoutOverflow); -} - -void InlineFlowBox::computeOverflow( - LayoutUnit lineTop, - LayoutUnit lineBottom, - GlyphOverflowAndFallbackFontsMap& textBoxDataMap) { - // If we know we have no overflow, we can just bail. - if (knownToHaveNoOverflow()) { - ASSERT(!m_overflow); - return; - } - - if (m_overflow) - m_overflow.clear(); - - // Visual overflow just includes overflow for stuff we need to issues paint - // invalidations for ourselves. Self-painting layers are ignored. Layout - // overflow is used to determine scrolling extent, so it still includes child - // layers and also factors in transforms, relative positioning, etc. - LayoutRect logicalLayoutOverflow(enclosingLayoutRect( - logicalFrameRectIncludingLineHeight(lineTop, lineBottom))); - LayoutRect logicalVisualOverflow(logicalLayoutOverflow); - - addBoxShadowVisualOverflow(logicalVisualOverflow); - addBorderOutsetVisualOverflow(logicalVisualOverflow); - addOutlineVisualOverflow(logicalVisualOverflow); - - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - if (curr->renderer().isOutOfFlowPositioned()) - continue; // Positioned placeholders don't affect calculations. - - if (curr->renderer().isText()) { - InlineTextBox* text = toInlineTextBox(curr); - LayoutRect textBoxOverflow(enclosingLayoutRect(text->logicalFrameRect())); - addTextBoxVisualOverflow(text, textBoxDataMap, textBoxOverflow); - logicalVisualOverflow.unite(textBoxOverflow); - } else if (curr->renderer().isRenderInline()) { - InlineFlowBox* flow = toInlineFlowBox(curr); - flow->computeOverflow(lineTop, lineBottom, textBoxDataMap); - if (!hasSelfPaintingLayer(flow)) - logicalVisualOverflow.unite( - flow->logicalVisualOverflowRect(lineTop, lineBottom)); - LayoutRect childLayoutOverflow = - flow->logicalLayoutOverflowRect(lineTop, lineBottom); - childLayoutOverflow.move( - flow->boxModelObject()->relativePositionLogicalOffset()); - logicalLayoutOverflow.unite(childLayoutOverflow); - } else { - addReplacedChildOverflow(curr, logicalLayoutOverflow, - logicalVisualOverflow); - } - } - - setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow, - lineTop, lineBottom); -} - -void InlineFlowBox::setLayoutOverflow(const LayoutRect& rect, - const LayoutRect& frameBox) { - if (frameBox.contains(rect) || rect.isEmpty()) - return; - - if (!m_overflow) - m_overflow = adoptPtr(new RenderOverflow(frameBox, frameBox)); - - m_overflow->setLayoutOverflow(rect); -} - -void InlineFlowBox::setVisualOverflow(const LayoutRect& rect, - const LayoutRect& frameBox) { - if (frameBox.contains(rect) || rect.isEmpty()) - return; - - if (!m_overflow) - m_overflow = adoptPtr(new RenderOverflow(frameBox, frameBox)); - - m_overflow->setVisualOverflow(rect); -} - -void InlineFlowBox::setOverflowFromLogicalRects( - const LayoutRect& logicalLayoutOverflow, - const LayoutRect& logicalVisualOverflow, - LayoutUnit lineTop, - LayoutUnit lineBottom) { - LayoutRect frameBox = - enclosingLayoutRect(frameRectIncludingLineHeight(lineTop, lineBottom)); - setLayoutOverflow(logicalLayoutOverflow, frameBox); - setVisualOverflow(logicalVisualOverflow, frameBox); -} - -bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset, - LayoutUnit lineTop, - LayoutUnit lineBottom) { - LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); - overflowRect.moveBy(accumulatedOffset); - if (!locationInContainer.intersects(overflowRect)) - return false; - - // Check children first. - // We need to account for culled inline parents of the hit-tested nodes, so - // that they may also get included in area-based hit-tests. - RenderObject* culledParent = 0; - for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) { - if (curr->renderer().isText() || !hasSelfPaintingLayer(curr)) { - RenderObject* newParent = 0; - // Culled parents are only relevant for area-based hit-tests, so ignore it - // in point-based ones. - if (locationInContainer.isRectBasedTest()) { - newParent = curr->renderer().parent(); - if (newParent == renderer()) - newParent = 0; - } - // Check the culled parent after all its children have been checked, to do - // this we wait until we are about to test an element with a different - // parent. - if (newParent != culledParent) { - if (!newParent || !newParent->isDescendantOf(culledParent)) { - while (culledParent && culledParent != renderer() && - culledParent != newParent) { - if (culledParent->isRenderInline() && - toRenderInline(culledParent) - ->hitTestCulledInline(request, result, locationInContainer, - accumulatedOffset)) - return true; - culledParent = culledParent->parent(); - } - } - culledParent = newParent; - } - if (curr->nodeAtPoint(request, result, locationInContainer, - accumulatedOffset, lineTop, lineBottom)) { - renderer().updateHitTestResult( - result, - locationInContainer.point() - toLayoutSize(accumulatedOffset)); - return true; - } - } - } - // Check any culled ancestor of the final children tested. - while (culledParent && culledParent != renderer()) { - if (culledParent->isRenderInline() && - toRenderInline(culledParent) - ->hitTestCulledInline(request, result, locationInContainer, - accumulatedOffset)) - return true; - culledParent = culledParent->parent(); - } - - // Now check ourselves. Pixel snap hit testing. - // Move x/y to our coordinates. - LayoutRect rect(roundedFrameRect()); - rect.moveBy(accumulatedOffset); - - return false; -} - -void InlineFlowBox::paint(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - LayoutUnit lineTop, - LayoutUnit lineBottom, - Vector& layers) { - LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); - overflowRect.moveBy(paintOffset); - - if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) - return; - - paintBoxDecorationBackground(paintInfo, paintOffset); - - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - if (curr->renderer().isText() || !hasSelfPaintingLayer(curr)) - curr->paint(paintInfo, paintOffset, lineTop, lineBottom, layers); - } -} - -void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, - const Color& c, - const FillLayer& fillLayer, - const LayoutRect& rect) { - if (fillLayer.next()) - paintFillLayers(paintInfo, c, *fillLayer.next(), rect); - paintFillLayer(paintInfo, c, fillLayer, rect); -} - -bool InlineFlowBox::boxShadowCanBeAppliedToBackground( - const FillLayer& lastBackgroundLayer) const { - // The checks here match how paintFillLayer() decides whether to clip (if it - // does, the shadow would be clipped out, so it has to be drawn separately). - StyleImage* image = lastBackgroundLayer.image(); - bool hasFillImage = image && image->canRender(renderer()); - return (!hasFillImage && !renderer().style()->hasBorderRadius()) || - (!prevLineBox() && !nextLineBox()) || !parent(); -} - -void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, - const Color& c, - const FillLayer& fillLayer, - const LayoutRect& rect) { - StyleImage* img = fillLayer.image(); - bool hasFillImage = img && img->canRender(renderer()); - if ((!hasFillImage && !renderer().style()->hasBorderRadius()) || - (!prevLineBox() && !nextLineBox()) || !parent()) { - boxModelObject()->paintFillLayerExtended( - paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size()); - } else if (renderer().style()->boxDecorationBreak() == DCLONE) { - GraphicsContextStateSaver stateSaver(*paintInfo.context); - paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), width(), height())); - boxModelObject()->paintFillLayerExtended( - paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size()); - } else { - // We have a fill image that spans multiple lines. - // We need to adjust tx and ty by the width of all previous lines. - // Think of background painting on inlines as though you had one long line, - // a single continuous strip. Even though that strip has been broken up - // across multiple lines, you still paint it as though you had one single - // line. This means each line has to pick up the background where the - // previous line left off. - LayoutUnit logicalOffsetOnLine = 0; - LayoutUnit totalLogicalWidth; - if (renderer().style()->direction() == LTR) { - for (InlineFlowBox* curr = prevLineBox(); curr; - curr = curr->prevLineBox()) - logicalOffsetOnLine += curr->logicalWidth(); - totalLogicalWidth = logicalOffsetOnLine; - for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) - totalLogicalWidth += curr->logicalWidth(); - } else { - for (InlineFlowBox* curr = nextLineBox(); curr; - curr = curr->nextLineBox()) - logicalOffsetOnLine += curr->logicalWidth(); - totalLogicalWidth = logicalOffsetOnLine; - for (InlineFlowBox* curr = this; curr; curr = curr->prevLineBox()) - totalLogicalWidth += curr->logicalWidth(); - } - LayoutUnit stripX = rect.x() - logicalOffsetOnLine; - LayoutUnit stripY = rect.y(); - LayoutUnit stripWidth = totalLogicalWidth; - LayoutUnit stripHeight = static_cast(height()); - - GraphicsContextStateSaver stateSaver(*paintInfo.context); - paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), width(), height())); - boxModelObject()->paintFillLayerExtended( - paintInfo, c, fillLayer, - LayoutRect(stripX, stripY, stripWidth, stripHeight), - BackgroundBleedNone, this, rect.size()); - } -} - -void InlineFlowBox::paintBoxShadow(const PaintInfo& info, - RenderStyle* s, - ShadowStyle shadowStyle, - const LayoutRect& paintRect) { - if ((!prevLineBox() && !nextLineBox()) || !parent()) - boxModelObject()->paintBoxShadow(info, paintRect, s, shadowStyle); - else { - // FIXME: We can do better here in the multi-line case. We want to push a - // clip so that the shadow doesn't protrude incorrectly at the edges, and we - // want to possibly include shadows cast from the previous/following lines - boxModelObject()->paintBoxShadow(info, paintRect, s, shadowStyle, - includeLogicalLeftEdge(), - includeLogicalRightEdge()); - } -} - -void InlineFlowBox::paintBoxDecorationBackground( - PaintInfo& paintInfo, - const LayoutPoint& paintOffset) { - // You can use p::first-line to specify a background. If so, the root line - // boxes for a line may actually have to paint a background. - RenderStyle* styleToUse = renderer().style(isFirstLineStyle()); - bool shouldPaintBoxDecorationBackground; - if (parent()) - shouldPaintBoxDecorationBackground = - renderer().hasBoxDecorationBackground(); - else - shouldPaintBoxDecorationBackground = - isFirstLineStyle() && styleToUse != renderer().style(); - - if (!shouldPaintBoxDecorationBackground) - return; - - // Pixel snap background/border painting. - LayoutRect frameRect = roundedFrameRect(); - - // Move x/y to our coordinates. - LayoutRect localRect(frameRect); - LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); - - LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size()); - - // Shadow comes first and is behind the background and border. - if (!boxModelObject()->boxShadowShouldBeAppliedToBackground( - BackgroundBleedNone, this)) - paintBoxShadow(paintInfo, styleToUse, Normal, paintRect); - - Color backgroundColor = - styleToUse->resolveColor(styleToUse->backgroundColor()); - paintFillLayers(paintInfo, backgroundColor, styleToUse->backgroundLayers(), - paintRect); - paintBoxShadow(paintInfo, styleToUse, Inset, paintRect); - - // :first-line cannot be used to put borders on a line. Always paint borders - // with our non-first-line style. - if (parent() && renderer().style()->hasBorder()) { - boxModelObject()->paintBorder(paintInfo, paintRect, - renderer().style(isFirstLineStyle()), - BackgroundBleedNone, includeLogicalLeftEdge(), - includeLogicalRightEdge()); - } -} - -InlineBox* InlineFlowBox::firstLeafChild() const { - InlineBox* leaf = 0; - for (InlineBox* child = firstChild(); child && !leaf; - child = child->nextOnLine()) - leaf = child->isLeaf() ? child : toInlineFlowBox(child)->firstLeafChild(); - return leaf; -} - -InlineBox* InlineFlowBox::lastLeafChild() const { - InlineBox* leaf = 0; - for (InlineBox* child = lastChild(); child && !leaf; - child = child->prevOnLine()) - leaf = child->isLeaf() ? child : toInlineFlowBox(child)->lastLeafChild(); - return leaf; -} - -RenderObject::SelectionState InlineFlowBox::selectionState() { - return RenderObject::SelectionNone; -} - -void InlineFlowBox::clearTruncation() { - for (InlineBox* box = firstChild(); box; box = box->nextOnLine()) - box->clearTruncation(); -} - -LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment( - LayoutUnit allowedPosition) const { - LayoutUnit result = 0; - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - if (curr->renderer().isOutOfFlowPositioned()) - continue; // Positioned placeholders don't affect calculations. - - if (curr->isInlineFlowBox()) - result = std::max(result, - toInlineFlowBox(curr)->computeOverAnnotationAdjustment( - allowedPosition)); - - if (curr->isInlineTextBox()) { - RenderStyle* style = curr->renderer().style(isFirstLineStyle()); - TextEmphasisPosition emphasisMarkPosition; - if (style->textEmphasisMark() != TextEmphasisMarkNone && - toInlineTextBox(curr)->getEmphasisMarkPosition( - style, emphasisMarkPosition) && - emphasisMarkPosition == TextEmphasisPositionOver) { - int topOfEmphasisMark = - curr->logicalTop() - - style->font().emphasisMarkHeight(style->textEmphasisMarkString()); - result = std::max(result, allowedPosition - topOfEmphasisMark); - } - } - } - return result; -} - -LayoutUnit InlineFlowBox::computeUnderAnnotationAdjustment( - LayoutUnit allowedPosition) const { - LayoutUnit result = 0; - for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { - if (curr->renderer().isOutOfFlowPositioned()) - continue; // Positioned placeholders don't affect calculations. - - if (curr->isInlineFlowBox()) - result = std::max(result, - toInlineFlowBox(curr)->computeUnderAnnotationAdjustment( - allowedPosition)); - - if (curr->isInlineTextBox()) { - RenderStyle* style = curr->renderer().style(isFirstLineStyle()); - if (style->textEmphasisMark() != TextEmphasisMarkNone && - style->textEmphasisPosition() == TextEmphasisPositionUnder) { - LayoutUnit bottomOfEmphasisMark = - curr->logicalBottom() + - style->font().emphasisMarkHeight(style->textEmphasisMarkString()); - result = std::max(result, bottomOfEmphasisMark - allowedPosition); - } - } - } - return result; -} - -void InlineFlowBox::collectLeafBoxesInLogicalOrder( - Vector& leafBoxesInLogicalOrder, - CustomInlineBoxRangeReverse customReverseImplementation, - void* userData) const { - InlineBox* leaf = firstLeafChild(); - - // FIXME: The reordering code is a copy of parts from - // BidiResolver::createBidiRunsForLine, operating directly on InlineBoxes, - // instead of BidiRuns. Investigate on how this code could possibly be shared. - unsigned char minLevel = 128; - unsigned char maxLevel = 0; - - // First find highest and lowest levels, and initialize - // leafBoxesInLogicalOrder with the leaf boxes in visual order. - for (; leaf; leaf = leaf->nextLeafChild()) { - minLevel = std::min(minLevel, leaf->bidiLevel()); - maxLevel = std::max(maxLevel, leaf->bidiLevel()); - leafBoxesInLogicalOrder.append(leaf); - } - - if (renderer().style()->rtlOrdering() == VisualOrder) - return; - - // Reverse of reordering of the line (L2 according to Bidi spec): - // L2. From the highest level found in the text to the lowest odd level on - // each line, reverse any contiguous sequence of characters that are at that - // level or higher. - - // Reversing the reordering of the line is only done up to the lowest odd - // level. - if (!(minLevel % 2)) - ++minLevel; - - Vector::iterator end = leafBoxesInLogicalOrder.end(); - while (minLevel <= maxLevel) { - Vector::iterator it = leafBoxesInLogicalOrder.begin(); - while (it != end) { - while (it != end) { - if ((*it)->bidiLevel() >= minLevel) - break; - ++it; - } - Vector::iterator first = it; - while (it != end) { - if ((*it)->bidiLevel() < minLevel) - break; - ++it; - } - Vector::iterator last = it; - if (customReverseImplementation) { - ASSERT(userData); - (*customReverseImplementation)(userData, first, last); - } else - std::reverse(first, last); - } - ++minLevel; - } -} - -#ifndef NDEBUG - -const char* InlineFlowBox::boxName() const { - return "InlineFlowBox"; -} - -void InlineFlowBox::showLineTreeAndMark(const InlineBox* markedBox1, - const char* markedLabel1, - const InlineBox* markedBox2, - const char* markedLabel2, - const RenderObject* obj, - int depth) const { - InlineBox::showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, - markedLabel2, obj, depth); - for (const InlineBox* box = firstChild(); box; box = box->nextOnLine()) - box->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLabel2, - obj, depth + 1); -} - -#endif - -#if ENABLE(ASSERT) -void InlineFlowBox::checkConsistency() const { -#ifdef CHECK_CONSISTENCY - ASSERT(!m_hasBadChildList); - const InlineBox* prev = 0; - for (const InlineBox* child = m_firstChild; child; - child = child->nextOnLine()) { - ASSERT(child->parent() == this); - ASSERT(child->prevOnLine() == prev); - prev = child; - } - ASSERT(prev == m_lastChild); -#endif -} - -#endif - -} // namespace blink diff --git a/sky/engine/core/rendering/InlineFlowBox.h b/sky/engine/core/rendering/InlineFlowBox.h deleted file mode 100644 index 728cb2bf3efcd..0000000000000 --- a/sky/engine/core/rendering/InlineFlowBox.h +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_INLINEFLOWBOX_H_ -#define SKY_ENGINE_CORE_RENDERING_INLINEFLOWBOX_H_ - -#include "flutter/sky/engine/core/rendering/InlineBox.h" -#include "flutter/sky/engine/core/rendering/RenderObjectInlines.h" -#include "flutter/sky/engine/core/rendering/RenderOverflow.h" -#include "flutter/sky/engine/core/rendering/style/ShadowData.h" - -namespace blink { - -class HitTestRequest; -class HitTestResult; -class InlineTextBox; -class RenderLineBoxList; -class SimpleFontData; -class VerticalPositionCache; - -struct GlyphOverflow; - -typedef HashMap, GlyphOverflow>> - GlyphOverflowAndFallbackFontsMap; - -class InlineFlowBox : public InlineBox { - public: - InlineFlowBox(RenderObject& obj) - : InlineBox(obj), - m_firstChild(0), - m_lastChild(0), - m_prevLineBox(0), - m_nextLineBox(0), - m_includeLogicalLeftEdge(false), - m_includeLogicalRightEdge(false), - m_descendantsHaveSameLineHeightAndBaseline(true), - m_baselineType(AlphabeticBaseline), - m_hasAnnotationsBefore(false), - m_hasAnnotationsAfter(false), - m_lineBreakBidiStatusEor(WTF::Unicode::LeftToRight), - m_lineBreakBidiStatusLastStrong(WTF::Unicode::LeftToRight), - m_lineBreakBidiStatusLast(WTF::Unicode::LeftToRight) -#if ENABLE(ASSERT) - , - m_hasBadChildList(false) -#endif - { - // Internet Explorer and Firefox always create a marker for list items, even - // when the list-style-type is none. We do not make a marker in the - // list-style-type: none case, since it is wasteful to do so. However, in - // order to match other browsers we have to pretend like an invisible marker - // exists. The side effect of having an invisible marker is that the quirks - // mode behavior of shrinking lines with no text children must not apply. - // This change also means that gaps will exist between image bullet list - // items. Even when the list bullet is an image, the line is still - // considered to be immune from the quirk. - m_hasTextChildren = false; - m_hasTextDescendants = m_hasTextChildren; - } - -#if ENABLE(ASSERT) - virtual ~InlineFlowBox(); -#endif - -#ifndef NDEBUG - virtual void showLineTreeAndMark(const InlineBox* = 0, - const char* = 0, - const InlineBox* = 0, - const char* = 0, - const RenderObject* = 0, - int = 0) const override; - virtual const char* boxName() const override; -#endif - - InlineFlowBox* prevLineBox() const { return m_prevLineBox; } - InlineFlowBox* nextLineBox() const { return m_nextLineBox; } - void setNextLineBox(InlineFlowBox* n) { m_nextLineBox = n; } - void setPreviousLineBox(InlineFlowBox* p) { m_prevLineBox = p; } - - InlineBox* firstChild() const { - checkConsistency(); - return m_firstChild; - } - InlineBox* lastChild() const { - checkConsistency(); - return m_lastChild; - } - - virtual bool isLeaf() const override final { return false; } - - InlineBox* firstLeafChild() const; - InlineBox* lastLeafChild() const; - - typedef void (*CustomInlineBoxRangeReverse)( - void* userData, - Vector::iterator first, - Vector::iterator last); - void collectLeafBoxesInLogicalOrder( - Vector&, - CustomInlineBoxRangeReverse customReverseImplementation = 0, - void* userData = 0) const; - - virtual void setConstructed() override final { - InlineBox::setConstructed(); - for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) - child->setConstructed(); - } - - void addToLine(InlineBox* child); - virtual void deleteLine() override final; - virtual void extractLine() override final; - virtual void attachLine() override final; - virtual void adjustPosition(float dx, float dy) override; - - virtual void extractLineBoxFromRenderObject(); - virtual void attachLineBoxToRenderObject(); - virtual void removeLineBoxFromRenderObject(); - - virtual void clearTruncation() override; - - IntRect roundedFrameRect() const; - - virtual void paint(PaintInfo&, - const LayoutPoint&, - LayoutUnit lineTop, - LayoutUnit lineBottom, - Vector& layers) override; - virtual bool nodeAtPoint(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset, - LayoutUnit lineTop, - LayoutUnit lineBottom) override; - - bool boxShadowCanBeAppliedToBackground(const FillLayer&) const; - - virtual RenderLineBoxList* rendererLineBoxes() const; - - // logicalLeft = left in a horizontal line and top in a vertical line. - LayoutUnit marginBorderPaddingLogicalLeft() const { - return marginLogicalLeft() + borderLogicalLeft() + paddingLogicalLeft(); - } - LayoutUnit marginBorderPaddingLogicalRight() const { - return marginLogicalRight() + borderLogicalRight() + paddingLogicalRight(); - } - LayoutUnit marginLogicalLeft() const { - if (!includeLogicalLeftEdge()) - return 0; - return boxModelObject()->marginLeft(); - } - LayoutUnit marginLogicalRight() const { - if (!includeLogicalRightEdge()) - return 0; - return boxModelObject()->marginRight(); - } - int borderLogicalLeft() const { - if (!includeLogicalLeftEdge()) - return 0; - return renderer().style(isFirstLineStyle())->borderLeftWidth(); - } - int borderLogicalRight() const { - if (!includeLogicalRightEdge()) - return 0; - return renderer().style(isFirstLineStyle())->borderRightWidth(); - } - int paddingLogicalLeft() const { - if (!includeLogicalLeftEdge()) - return 0; - return boxModelObject()->paddingLeft(); - } - int paddingLogicalRight() const { - if (!includeLogicalRightEdge()) - return 0; - return boxModelObject()->paddingRight(); - } - - bool includeLogicalLeftEdge() const { return m_includeLogicalLeftEdge; } - bool includeLogicalRightEdge() const { return m_includeLogicalRightEdge; } - void setEdges(bool includeLeft, bool includeRight) { - m_includeLogicalLeftEdge = includeLeft; - m_includeLogicalRightEdge = includeRight; - } - - // Helper functions used during line construction and placement. - void determineSpacingForFlowBoxes(bool lastLine, - bool isLogicallyLastRunWrapped, - RenderObject* logicallyLastRunRenderer); - LayoutUnit getFlowSpacingLogicalWidth(); - float placeBoxesInInlineDirection(float logicalLeft, bool& needsWordSpacing); - float placeBoxRangeInInlineDirection(InlineBox* firstChild, - InlineBox* lastChild, - float& logicalLeft, - float& minLogicalLeft, - float& maxLogicalRight, - bool& needsWordSpacing); - void beginPlacingBoxRangesInInlineDirection(float logicalLeft) { - setLogicalLeft(logicalLeft); - } - void endPlacingBoxRangesInInlineDirection(float logicalLeft, - float logicalRight, - float minLogicalLeft, - float maxLogicalRight) { - setLogicalWidth(logicalRight - logicalLeft); - if (knownToHaveNoOverflow() && - (minLogicalLeft < logicalLeft || maxLogicalRight > logicalRight)) - clearKnownToHaveNoOverflow(); - } - - void computeLogicalBoxHeights(RootInlineBox*, - LayoutUnit& maxPositionTop, - LayoutUnit& maxPositionBottom, - int& maxAscent, - int& maxDescent, - bool& setMaxAscent, - bool& setMaxDescent, - bool strictMode, - GlyphOverflowAndFallbackFontsMap&, - FontBaseline, - VerticalPositionCache&); - void adjustMaxAscentAndDescent(int& maxAscent, - int& maxDescent, - int maxPositionTop, - int maxPositionBottom); - void placeBoxesInBlockDirection(LayoutUnit logicalTop, - LayoutUnit maxHeight, - int maxAscent, - bool strictMode, - LayoutUnit& lineTop, - LayoutUnit& lineBottom, - LayoutUnit& selectionBottom, - bool& setLineTop, - LayoutUnit& lineTopIncludingMargins, - LayoutUnit& lineBottomIncludingMargins, - bool& hasAnnotationsBefore, - bool& hasAnnotationsAfter, - FontBaseline); - void flipLinesInBlockDirection(LayoutUnit lineTop, LayoutUnit lineBottom); - - LayoutUnit computeOverAnnotationAdjustment(LayoutUnit allowedPosition) const; - LayoutUnit computeUnderAnnotationAdjustment(LayoutUnit allowedPosition) const; - - void computeOverflow(LayoutUnit lineTop, - LayoutUnit lineBottom, - GlyphOverflowAndFallbackFontsMap&); - - void removeChild(InlineBox* child, MarkLineBoxes); - - virtual RenderObject::SelectionState selectionState() override; - - bool hasTextChildren() const { return m_hasTextChildren; } - bool hasTextDescendants() const { return m_hasTextDescendants; } - void setHasTextChildren() { - m_hasTextChildren = true; - setHasTextDescendants(); - } - void setHasTextDescendants() { m_hasTextDescendants = true; } - - void checkConsistency() const; - void setHasBadChildList(); - - // Line visual and layout overflow are in the coordinate space of the block. - // This means that they aren't purely physical directions. For horizontal-tb - // and vertical-lr they will match physical directions, but for horizontal-bt - // and vertical-rl, the top/bottom and left/right respectively are flipped - // when compared to their physical counterparts. For example minX is on the - // left in vertical-lr, but it is on the right in vertical-rl. - LayoutRect layoutOverflowRect(LayoutUnit lineTop, - LayoutUnit lineBottom) const { - return m_overflow ? m_overflow->layoutOverflowRect() - : enclosingLayoutRect( - frameRectIncludingLineHeight(lineTop, lineBottom)); - } - LayoutUnit logicalLefxlayoutOverflow() const { - return m_overflow ? m_overflow->layoutOverflowRect().x() - : static_cast(logicalLeft()); - } - LayoutUnit logicalRightLayoutOverflow() const { - return m_overflow ? m_overflow->layoutOverflowRect().maxX() - : static_cast(ceilf(logicalRight())); - } - LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const { - if (m_overflow) - return m_overflow->layoutOverflowRect().y(); - return lineTop; - } - LayoutUnit logicalBottomLayoutOverflow(LayoutUnit lineBottom) const { - if (m_overflow) - return m_overflow->layoutOverflowRect().maxY(); - return lineBottom; - } - LayoutRect logicalLayoutOverflowRect(LayoutUnit lineTop, - LayoutUnit lineBottom) const { - // FIXME(sky): Remove - return layoutOverflowRect(lineTop, lineBottom); - } - - LayoutRect visualOverflowRect(LayoutUnit lineTop, - LayoutUnit lineBottom) const { - return m_overflow ? m_overflow->visualOverflowRect() - : enclosingLayoutRect( - frameRectIncludingLineHeight(lineTop, lineBottom)); - } - LayoutUnit logicalLeftVisualOverflow() const { - return m_overflow ? m_overflow->visualOverflowRect().x() - : static_cast(logicalLeft()); - } - LayoutUnit logicalRightVisualOverflow() const { - return m_overflow ? m_overflow->visualOverflowRect().maxX() - : static_cast(ceilf(logicalRight())); - } - LayoutUnit logicalTopVisualOverflow(LayoutUnit lineTop) const { - if (m_overflow) - return m_overflow->visualOverflowRect().y(); - return lineTop; - } - LayoutUnit logicalBottomVisualOverflow(LayoutUnit lineBottom) const { - if (m_overflow) - return m_overflow->visualOverflowRect().maxY(); - return lineBottom; - } - LayoutRect logicalVisualOverflowRect(LayoutUnit lineTop, - LayoutUnit lineBottom) const { - return visualOverflowRect(lineTop, lineBottom); - } - - void setOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, - const LayoutRect& logicalVisualOverflow, - LayoutUnit lineTop, - LayoutUnit lineBottom); - - FloatRect frameRectIncludingLineHeight(LayoutUnit lineTop, - LayoutUnit lineBottom) const { - return FloatRect(m_topLeft.x(), lineTop.toFloat(), width(), - (lineBottom - lineTop).toFloat()); - } - - FloatRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, - LayoutUnit lineBottom) const { - return FloatRect(logicalLeft(), lineTop.toFloat(), logicalWidth(), - (lineBottom - lineTop).toFloat()); - } - - bool descendantsHaveSameLineHeightAndBaseline() const { - return m_descendantsHaveSameLineHeightAndBaseline; - } - void clearDescendantsHaveSameLineHeightAndBaseline() { - m_descendantsHaveSameLineHeightAndBaseline = false; - if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline()) - parent()->clearDescendantsHaveSameLineHeightAndBaseline(); - } - - private: - void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&); - void paintFillLayers(const PaintInfo&, - const Color&, - const FillLayer&, - const LayoutRect&); - void paintFillLayer(const PaintInfo&, - const Color&, - const FillLayer&, - const LayoutRect&); - void paintBoxShadow(const PaintInfo&, - RenderStyle*, - ShadowStyle, - const LayoutRect&); - - void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); - void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); - void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); - void addTextBoxVisualOverflow(InlineTextBox*, - GlyphOverflowAndFallbackFontsMap&, - LayoutRect& logicalVisualOverflow); - void addReplacedChildOverflow(const InlineBox*, - LayoutRect& logicalLayoutOverflow, - LayoutRect& logicalVisualOverflow); - - void setLayoutOverflow(const LayoutRect&, const LayoutRect&); - void setVisualOverflow(const LayoutRect&, const LayoutRect&); - - protected: - OwnPtr m_overflow; - - virtual bool isInlineFlowBox() const override final { return true; } - - InlineBox* m_firstChild; - InlineBox* m_lastChild; - - InlineFlowBox* - m_prevLineBox; // The previous box that also uses our RenderObject - InlineFlowBox* m_nextLineBox; // The next box that also uses our RenderObject - - // Maximum logicalTop among all children of an InlineFlowBox. Used to - // calculate the offset for TextUnderlinePositionUnder. - void computeMaxLogicalTop(float& maxLogicalTop) const; - - private: - unsigned m_includeLogicalLeftEdge : 1; - unsigned m_includeLogicalRightEdge : 1; - unsigned m_hasTextChildren : 1; - unsigned m_hasTextDescendants : 1; - unsigned m_descendantsHaveSameLineHeightAndBaseline : 1; - - protected: - // The following members are only used by RootInlineBox but moved here to keep - // the bits packed. - - // Whether or not this line uses alphabetic or ideographic baselines by - // default. - unsigned m_baselineType : 1; // FontBaseline - - // If the line contains any ruby runs, then this will be true. - unsigned m_hasAnnotationsBefore : 1; - unsigned m_hasAnnotationsAfter : 1; - - unsigned m_lineBreakBidiStatusEor : 5; // WTF::Unicode::Direction - unsigned m_lineBreakBidiStatusLastStrong : 5; // WTF::Unicode::Direction - unsigned m_lineBreakBidiStatusLast : 5; // WTF::Unicode::Direction - - // End of RootInlineBox-specific members. - -#if ENABLE(ASSERT) - private: - unsigned m_hasBadChildList : 1; -#endif -}; - -DEFINE_INLINE_BOX_TYPE_CASTS(InlineFlowBox); - -#if !ENABLE(ASSERT) -inline void InlineFlowBox::checkConsistency() const {} -#endif - -inline void InlineFlowBox::setHasBadChildList() { -#if ENABLE(ASSERT) - m_hasBadChildList = true; -#endif -} - -} // namespace blink - -#ifndef NDEBUG -// Outside the WebCore namespace for ease of invocation from gdb. -void showTree(const blink::InlineFlowBox*); -#endif - -#endif // SKY_ENGINE_CORE_RENDERING_INLINEFLOWBOX_H_ diff --git a/sky/engine/core/rendering/InlineIterator.h b/sky/engine/core/rendering/InlineIterator.h deleted file mode 100644 index 0311e8873d466..0000000000000 --- a/sky/engine/core/rendering/InlineIterator.h +++ /dev/null @@ -1,781 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 Apple Inc. - * All right reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_INLINEITERATOR_H_ -#define SKY_ENGINE_CORE_RENDERING_INLINEITERATOR_H_ - -#include "flutter/sky/engine/core/rendering/BidiRun.h" -#include "flutter/sky/engine/core/rendering/RenderInline.h" -#include "flutter/sky/engine/core/rendering/RenderParagraph.h" -#include "flutter/sky/engine/core/rendering/RenderText.h" -#include "flutter/sky/engine/core/rendering/line/TrailingObjects.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" - -namespace blink { - -// This class is used to RenderInline subtrees, stepping by character within the -// text children. InlineIterator will use bidiNext to find the next RenderText -// optionally notifying a BidiResolver every time it steps into/out of a -// RenderInline. -class InlineIterator { - public: - enum IncrementRule { - FastIncrementInIsolatedRenderer, - FastIncrementInTextNode - }; - - InlineIterator() - : m_root(0), m_obj(0), m_nextBreakablePosition(-1), m_pos(0) {} - - InlineIterator(RenderObject* root, RenderObject* o, unsigned p) - : m_root(root), m_obj(o), m_nextBreakablePosition(-1), m_pos(p) {} - - void clear() { moveTo(0, 0); } - - void moveToStartOf(RenderObject* object) { moveTo(object, 0); } - - void moveTo(RenderObject* object, unsigned offset, int nextBreak = -1) { - m_obj = object; - m_pos = offset; - m_nextBreakablePosition = nextBreak; - } - - RenderObject* object() const { return m_obj; } - void setObject(RenderObject* object) { m_obj = object; } - - int nextBreakablePosition() const { return m_nextBreakablePosition; } - void setNextBreakablePosition(int position) { - m_nextBreakablePosition = position; - } - - unsigned offset() const { return m_pos; } - void setOffset(unsigned position) { m_pos = position; } - RenderObject* root() const { return m_root; } - - void fastIncrementInTextNode(); - void increment(InlineBidiResolver* = 0, - IncrementRule = FastIncrementInTextNode); - bool atEnd() const; - - inline bool atTextParagraphSeparator() const { - return m_obj && m_obj->preservesNewline() && m_obj->isText() && - toRenderText(m_obj)->textLength() && - toRenderText(m_obj)->characterAt(m_pos) == '\n'; - } - - inline bool atParagraphSeparator() const { - return atTextParagraphSeparator(); - } - - UChar characterAt(unsigned) const; - UChar current() const; - UChar previousInSameNode() const; - ALWAYS_INLINE WTF::Unicode::Direction direction() const; - - private: - RenderObject* m_root; - RenderObject* m_obj; - - int m_nextBreakablePosition; - unsigned m_pos; -}; - -inline bool operator==(const InlineIterator& it1, const InlineIterator& it2) { - return it1.offset() == it2.offset() && it1.object() == it2.object(); -} - -inline bool operator!=(const InlineIterator& it1, const InlineIterator& it2) { - return it1.offset() != it2.offset() || it1.object() != it2.object(); -} - -static inline WTF::Unicode::Direction embedCharFromDirection( - TextDirection dir, - EUnicodeBidi unicodeBidi) { - using namespace WTF::Unicode; - if (unicodeBidi == Embed) - return dir == RTL ? RightToLeftEmbedding : LeftToRightEmbedding; - return dir == RTL ? RightToLeftOverride : LeftToRightOverride; -} - -template -static inline void notifyObserverEnteredObject(Observer* observer, - RenderObject* object) { - if (!observer || !object || !object->isRenderInline()) - return; - - RenderStyle* style = object->style(); - EUnicodeBidi unicodeBidi = style->unicodeBidi(); - if (unicodeBidi == UBNormal) { - // http://dev.w3.org/csswg/css3-writing-modes/#unicode-bidi - // "The element does not open an additional level of embedding with respect - // to the bidirectional algorithm." Thus we ignore any possible dir= - // attribute on the span. - return; - } - if (isIsolated(unicodeBidi)) { - // Make sure that explicit embeddings are committed before we enter the - // isolated content. - observer->commitExplicitEmbedding(observer->runs()); - observer->enterIsolate(); - // Embedding/Override characters implied by dir= will be handled when - // we process the isolated span, not when laying out the "parent" run. - return; - } - - if (!observer->inIsolate()) - observer->embed(embedCharFromDirection(style->direction(), unicodeBidi), - FromStyleOrDOM); -} - -template -static inline void notifyObserverWillExitObject(Observer* observer, - RenderObject* object) { - if (!observer || !object || !object->isRenderInline()) - return; - - EUnicodeBidi unicodeBidi = object->style()->unicodeBidi(); - if (unicodeBidi == UBNormal) - return; // Nothing to do for unicode-bidi: normal - if (isIsolated(unicodeBidi)) { - observer->exitIsolate(); - return; - } - - // Otherwise we pop any embed/override character we added when we opened this - // tag. - if (!observer->inIsolate()) - observer->embed(WTF::Unicode::PopDirectionalFormat, FromStyleOrDOM); -} - -static inline bool isIteratorTarget(RenderObject* object) { - ASSERT(object); // The iterator will of course return 0, but its not an - // expected argument to this function. - return object->isText() || object->isOutOfFlowPositioned() || - object->isReplaced(); -} - -// This enum is only used for bidiNextShared() -enum EmptyInlineBehavior { - SkipEmptyInlines, - IncludeEmptyInlines, -}; - -static bool isEmptyInline(RenderObject* object) { - if (!object->isRenderInline()) - return false; - - for (RenderObject* curr = toRenderInline(object)->firstChild(); curr; - curr = curr->nextSibling()) { - if (curr->isFloatingOrOutOfFlowPositioned()) - continue; - if (curr->isText() && toRenderText(curr)->isAllCollapsibleWhitespace()) - continue; - - if (!isEmptyInline(curr)) - return false; - } - return true; -} - -// FIXME: This function is misleadingly named. It has little to do with bidi. -// This function will iterate over inlines within a block, optionally notifying -// a bidi resolver as it enters/exits inlines (so it can push/pop embedding -// levels). -template -static inline RenderObject* bidiNextShared( - RenderObject* root, - RenderObject* current, - Observer* observer = 0, - EmptyInlineBehavior emptyInlineBehavior = SkipEmptyInlines, - bool* endOfInlinePtr = 0) { - RenderObject* next = 0; - // oldEndOfInline denotes if when we last stopped iterating if we were at the - // end of an inline. - bool oldEndOfInline = endOfInlinePtr ? *endOfInlinePtr : false; - bool endOfInline = false; - - while (current) { - next = 0; - if (!oldEndOfInline && !isIteratorTarget(current)) { - next = current->slowFirstChild(); - notifyObserverEnteredObject(observer, next); - } - - // We hit this when either current has no children, or when current is not a - // renderer we care about. - if (!next) { - // If it is a renderer we care about, and we're doing our inline-walk, - // return it. - if (emptyInlineBehavior == IncludeEmptyInlines && !oldEndOfInline && - current->isRenderInline()) { - next = current; - endOfInline = true; - break; - } - - while (current && current != root) { - notifyObserverWillExitObject(observer, current); - - next = current->nextSibling(); - if (next) { - notifyObserverEnteredObject(observer, next); - break; - } - - current = current->parent(); - if (emptyInlineBehavior == IncludeEmptyInlines && current && - current != root && current->isRenderInline()) { - next = current; - endOfInline = true; - break; - } - } - } - - if (!next) - break; - - if (isIteratorTarget(next) || - ((emptyInlineBehavior == IncludeEmptyInlines || - isEmptyInline(next)) // Always return EMPTY inlines. - && next->isRenderInline())) - break; - current = next; - } - - if (endOfInlinePtr) - *endOfInlinePtr = endOfInline; - - return next; -} - -template -static inline RenderObject* bidiNextSkippingEmptyInlines(RenderObject* root, - RenderObject* current, - Observer* observer) { - // The SkipEmptyInlines callers never care about endOfInlinePtr. - return bidiNextShared(root, current, observer, SkipEmptyInlines); -} - -// This makes callers cleaner as they don't have to specify a type for the -// observer when not providing one. -static inline RenderObject* bidiNextSkippingEmptyInlines( - RenderObject* root, - RenderObject* current) { - InlineBidiResolver* observer = 0; - return bidiNextSkippingEmptyInlines(root, current, observer); -} - -static inline RenderObject* bidiNextIncludingEmptyInlines( - RenderObject* root, - RenderObject* current, - bool* endOfInlinePtr = 0) { - InlineBidiResolver* observer = - 0; // Callers who include empty inlines, never use an observer. - return bidiNextShared(root, current, observer, IncludeEmptyInlines, - endOfInlinePtr); -} - -static inline RenderObject* bidiFirstSkippingEmptyInlines( - RenderParagraph* root, - BidiRunList& runs, - InlineBidiResolver* resolver = 0) { - RenderObject* o = root->firstChild(); - if (!o) - return 0; - - if (o->isRenderInline()) { - notifyObserverEnteredObject(resolver, o); - if (!isEmptyInline(o)) - o = bidiNextSkippingEmptyInlines(root, o, resolver); - else { - // Never skip empty inlines. - if (resolver) - resolver->commitExplicitEmbedding(runs); - return o; - } - } - - // FIXME: Unify this with the bidiNext call above. - if (o && !isIteratorTarget(o)) - o = bidiNextSkippingEmptyInlines(root, o, resolver); - - if (resolver) - resolver->commitExplicitEmbedding(runs); - return o; -} - -// FIXME: This method needs to be renamed when bidiNext finds a good name. -static inline RenderObject* bidiFirstIncludingEmptyInlines(RenderBlock* root) { - RenderObject* o = root->firstChild(); - // If either there are no children to walk, or the first one is correct - // then just return it. - if (!o || o->isRenderInline() || isIteratorTarget(o)) - return o; - - return bidiNextIncludingEmptyInlines(root, o); -} - -inline void InlineIterator::fastIncrementInTextNode() { - ASSERT(m_obj); - ASSERT(m_obj->isText()); - ASSERT(m_pos <= toRenderText(m_obj)->textLength()); - if (m_pos < INT_MAX) - m_pos++; -} - -// FIXME: This is used by RenderParagraph for simplified layout, and has nothing -// to do with bidi it shouldn't use functions called bidiFirst and bidiNext. -class InlineWalker { - public: - InlineWalker(RenderBlock* root) - : m_root(root), m_current(0), m_atEndOfInline(false) { - // FIXME: This class should be taught how to do the SkipEmptyInlines - // codepath as well. - m_current = bidiFirstIncludingEmptyInlines(m_root); - } - - RenderBlock* root() { return m_root; } - RenderObject* current() { return m_current; } - - bool atEndOfInline() { return m_atEndOfInline; } - bool atEnd() const { return !m_current; } - - RenderObject* advance() { - // FIXME: Support SkipEmptyInlines and observer parameters. - m_current = - bidiNextIncludingEmptyInlines(m_root, m_current, &m_atEndOfInline); - return m_current; - } - - private: - RenderBlock* m_root; - RenderObject* m_current; - bool m_atEndOfInline; -}; - -static inline bool endOfLineHasIsolatedObjectAncestor( - const InlineIterator& isolatedIterator, - const InlineIterator& ancestorItertor) { - if (!isolatedIterator.object() || - !isIsolated(isolatedIterator.object()->style()->unicodeBidi())) - return false; - - RenderObject* innerIsolatedObject = isolatedIterator.object(); - while (innerIsolatedObject && - innerIsolatedObject != isolatedIterator.root()) { - if (innerIsolatedObject == ancestorItertor.object()) - return true; - innerIsolatedObject = innerIsolatedObject->parent(); - } - return false; -} - -inline void InlineIterator::increment(InlineBidiResolver* resolver, - IncrementRule rule) { - if (!m_obj) - return; - - if (rule == FastIncrementInIsolatedRenderer && resolver && - resolver->inIsolate() && - !endOfLineHasIsolatedObjectAncestor(resolver->endOfLine(), - resolver->position())) { - moveTo(bidiNextSkippingEmptyInlines(m_root, m_obj, resolver), 0); - return; - } - - if (m_obj->isText()) { - fastIncrementInTextNode(); - if (m_pos < toRenderText(m_obj)->textLength()) - return; - } - // bidiNext can return 0, so use moveTo instead of moveToStartOf - moveTo(bidiNextSkippingEmptyInlines(m_root, m_obj, resolver), 0); -} - -inline bool InlineIterator::atEnd() const { - return !m_obj; -} - -inline UChar InlineIterator::characterAt(unsigned index) const { - if (!m_obj || !m_obj->isText()) - return 0; - - return toRenderText(m_obj)->characterAt(index); -} - -inline UChar InlineIterator::current() const { - return characterAt(m_pos); -} - -inline UChar InlineIterator::previousInSameNode() const { - if (!m_pos) - return 0; - - return characterAt(m_pos - 1); -} - -ALWAYS_INLINE WTF::Unicode::Direction InlineIterator::direction() const { - if (UChar c = current()) - return WTF::Unicode::direction(c); - - return WTF::Unicode::OtherNeutral; -} - -template <> -inline void InlineBidiResolver::increment() { - m_current.increment(this, InlineIterator::FastIncrementInIsolatedRenderer); -} - -template <> -inline bool InlineBidiResolver::isEndOfLine(const InlineIterator& end) { - bool inEndOfLine = m_current == end || m_current.atEnd() || - (inIsolate() && m_current.object() == end.object()); - if (inIsolate() && inEndOfLine) { - m_current.moveTo(m_current.object(), end.offset(), - m_current.nextBreakablePosition()); - m_last = m_current; - updateStatusLastFromCurrentDirection(WTF::Unicode::OtherNeutral); - } - return inEndOfLine; -} - -static inline bool isCollapsibleSpace(UChar character, RenderText* renderer) { - if (character == ' ' || character == '\t' || character == softHyphen) - return true; - if (character == '\n') - return !renderer->style()->preserveNewline(); - return false; -} - -template -static inline int findFirstTrailingSpace(RenderText* lastText, - const CharacterType* characters, - int start, - int stop) { - int firstSpace = stop; - while (firstSpace > start) { - UChar current = characters[firstSpace - 1]; - if (!isCollapsibleSpace(current, lastText)) - break; - firstSpace--; - } - - return firstSpace; -} - -template <> -inline int InlineBidiResolver::findFirstTrailingSpaceAtRun(BidiRun* run) { - ASSERT(run); - RenderObject* lastObject = run->m_object; - if (!lastObject->isText()) - return run->m_stop; - - RenderText* lastText = toRenderText(lastObject); - int firstSpace; - if (lastText->is8Bit()) - firstSpace = findFirstTrailingSpace(lastText, lastText->characters8(), - run->start(), run->stop()); - else - firstSpace = findFirstTrailingSpace(lastText, lastText->characters16(), - run->start(), run->stop()); - return firstSpace; -} - -template <> -inline BidiRun* InlineBidiResolver::addTrailingRun( - BidiRunList& runs, - int start, - int stop, - BidiRun* run, - BidiContext* context, - TextDirection direction) const { - BidiRun* newTrailingRun = new BidiRun(start, stop, run->m_object, context, - WTF::Unicode::OtherNeutral); - if (direction == LTR) - runs.addRun(newTrailingRun); - else - runs.prependRun(newTrailingRun); - - return newTrailingRun; -} - -template <> -inline bool InlineBidiResolver::needsToApplyL1Rule(BidiRunList& runs) { - if (!runs.logicallyLastRun()->m_object->style()->breakOnlyAfterWhiteSpace() || - !runs.logicallyLastRun()->m_object->style()->autoWrap()) - return false; - return true; -} - -static inline bool isIsolatedInline(RenderObject* object) { - ASSERT(object); - return object->isRenderInline() && isIsolated(object->style()->unicodeBidi()); -} - -static inline RenderObject* highestContainingIsolateWithinRoot( - RenderObject* object, - RenderObject* root) { - ASSERT(object); - RenderObject* containingIsolateObj = 0; - while (object && object != root) { - if (isIsolatedInline(object)) - containingIsolateObj = object; - - object = object->parent(); - } - return containingIsolateObj; -} - -static inline unsigned numberOfIsolateAncestors(const InlineIterator& iter) { - RenderObject* object = iter.object(); - if (!object) - return 0; - unsigned count = 0; - while (object && object != iter.root()) { - if (isIsolatedInline(object)) - count++; - object = object->parent(); - } - return count; -} - -// FIXME: This belongs on InlineBidiResolver, except it's a template -// specialization of BidiResolver which knows nothing about RenderObjects. -static inline BidiRun* addPlaceholderRunForIsolatedInline( - InlineBidiResolver& resolver, - RenderObject* obj, - unsigned pos) { - ASSERT(obj); - BidiRun* isolatedRun = - new BidiRun(pos, pos, obj, resolver.context(), resolver.dir()); - resolver.runs().addRun(isolatedRun); - // FIXME: isolatedRuns() could be a hash of object->run and then we could - // cheaply ASSERT here that we didn't create multiple objects for the same - // inline. - resolver.isolatedRuns().append(isolatedRun); - return isolatedRun; -} - -static inline BidiRun* createRun(int start, - int end, - RenderObject* obj, - InlineBidiResolver& resolver) { - return new BidiRun(start, end, obj, resolver.context(), resolver.dir()); -} - -enum AppendRunBehavior { AppendingFakeRun, AppendingRunsForObject }; - -class IsolateTracker { - public: - explicit IsolateTracker(BidiRunList& runs, - unsigned nestedIsolateCount) - : m_nestedIsolateCount(nestedIsolateCount), - m_haveAddedFakeRunForRootIsolate(false), - m_runs(runs) {} - - void setMidpointStateForRootIsolate(const LineMidpointState& midpointState) { - m_midpointStateForRootIsolate = midpointState; - } - - void enterIsolate() { m_nestedIsolateCount++; } - void exitIsolate() { - ASSERT(m_nestedIsolateCount >= 1); - m_nestedIsolateCount--; - if (!inIsolate()) - m_haveAddedFakeRunForRootIsolate = false; - } - bool inIsolate() const { return m_nestedIsolateCount; } - - // We don't care if we encounter bidi directional overrides. - void embed(WTF::Unicode::Direction, BidiEmbeddingSource) {} - void commitExplicitEmbedding(BidiRunList&) {} - BidiRunList& runs() { return m_runs; } - - void addFakeRunIfNecessary(RenderObject* obj, - unsigned pos, - unsigned end, - InlineBidiResolver& resolver) { - // We only need to add a fake run for a given isolated span once during each - // call to createBidiRunsForLine. We'll be called for every span inside the - // isolated span so we just ignore subsequent calls. We also avoid creating - // a fake run until we hit a child that warrants one, e.g. we skip floats. - if (RenderParagraph::shouldSkipCreatingRunsForObject(obj)) - return; - if (!m_haveAddedFakeRunForRootIsolate) { - BidiRun* run = addPlaceholderRunForIsolatedInline(resolver, obj, pos); - resolver.setMidpointStateForIsolatedRun(run, - m_midpointStateForRootIsolate); - m_haveAddedFakeRunForRootIsolate = true; - } - // obj and pos together denote a single position in the inline, from which - // the parsing of the isolate will start. We don't need to mark the end of - // the run because this is implicit: it is either endOfLine or the end of - // the isolate, when we call createBidiRunsForLine it will stop at whichever - // comes first. - } - - private: - unsigned m_nestedIsolateCount; - bool m_haveAddedFakeRunForRootIsolate; - LineMidpointState m_midpointStateForRootIsolate; - BidiRunList& m_runs; -}; - -static void inline appendRunObjectIfNecessary(RenderObject* obj, - unsigned start, - unsigned end, - InlineBidiResolver& resolver, - AppendRunBehavior behavior, - IsolateTracker& tracker) { - if (behavior == AppendingFakeRun) - tracker.addFakeRunIfNecessary(obj, start, end, resolver); - else - resolver.runs().addRun(createRun(start, end, obj, resolver)); -} - -static void adjustMidpointsAndAppendRunsForObjectIfNeeded( - RenderObject* obj, - unsigned start, - unsigned end, - InlineBidiResolver& resolver, - AppendRunBehavior behavior, - IsolateTracker& tracker) { - if (start > end || RenderParagraph::shouldSkipCreatingRunsForObject(obj)) - return; - - LineMidpointState& lineMidpointState = resolver.midpointState(); - bool haveNextMidpoint = - (lineMidpointState.currentMidpoint() < lineMidpointState.numMidpoints()); - InlineIterator nextMidpoint; - if (haveNextMidpoint) - nextMidpoint = - lineMidpointState.midpoints()[lineMidpointState.currentMidpoint()]; - if (lineMidpointState.betweenMidpoints()) { - if (!(haveNextMidpoint && nextMidpoint.object() == obj)) - return; - // This is a new start point. Stop ignoring objects and - // adjust our start. - lineMidpointState.setBetweenMidpoints(false); - start = nextMidpoint.offset(); - lineMidpointState.incrementCurrentMidpoint(); - if (start < end) - return adjustMidpointsAndAppendRunsForObjectIfNeeded( - obj, start, end, resolver, behavior, tracker); - } else { - if (!haveNextMidpoint || (obj != nextMidpoint.object())) { - appendRunObjectIfNecessary(obj, start, end, resolver, behavior, tracker); - return; - } - - // An end midpoint has been encountered within our object. We - // need to go ahead and append a run with our endpoint. - if (nextMidpoint.offset() + 1 <= end) { - lineMidpointState.setBetweenMidpoints(true); - lineMidpointState.incrementCurrentMidpoint(); - if (nextMidpoint.offset() != UINT_MAX) { // UINT_MAX means stop at the - // object and don't nclude any - // of it. - if (nextMidpoint.offset() + 1 > start) - appendRunObjectIfNecessary(obj, start, nextMidpoint.offset() + 1, - resolver, behavior, tracker); - return adjustMidpointsAndAppendRunsForObjectIfNeeded( - obj, nextMidpoint.offset() + 1, end, resolver, behavior, tracker); - } - } else { - appendRunObjectIfNecessary(obj, start, end, resolver, behavior, tracker); - } - } -} - -static inline void addFakeRunIfNecessary(RenderObject* obj, - unsigned start, - unsigned end, - InlineBidiResolver& resolver, - IsolateTracker& tracker) { - tracker.setMidpointStateForRootIsolate(resolver.midpointState()); - adjustMidpointsAndAppendRunsForObjectIfNeeded( - obj, start, obj->length(), resolver, AppendingFakeRun, tracker); -} - -template <> -inline void InlineBidiResolver::appendRun(BidiRunList& runs) { - if (!m_emptyRun && !m_eor.atEnd() && !m_reachedEndOfLine) { - // Keep track of when we enter/leave "unicode-bidi: isolate" inlines. - // Initialize our state depending on if we're starting in the middle of such - // an inline. - // FIXME: Could this initialize from this->inIsolate() instead of walking up - // the render tree? - IsolateTracker isolateTracker(runs, numberOfIsolateAncestors(m_sor)); - int start = m_sor.offset(); - RenderObject* obj = m_sor.object(); - while (obj && obj != m_eor.object() && - obj != m_endOfRunAtEndOfLine.object()) { - if (isolateTracker.inIsolate()) - addFakeRunIfNecessary(obj, start, obj->length(), *this, isolateTracker); - else - adjustMidpointsAndAppendRunsForObjectIfNeeded( - obj, start, obj->length(), *this, AppendingRunsForObject, - isolateTracker); - // FIXME: start/obj should be an InlineIterator instead of two separate - // variables. - start = 0; - obj = bidiNextSkippingEmptyInlines(m_sor.root(), obj, &isolateTracker); - } - bool isEndOfLine = obj == m_endOfLine.object() && !m_endOfLine.offset(); - if (obj && !isEndOfLine) { - unsigned pos = obj == m_eor.object() ? m_eor.offset() : INT_MAX; - if (obj == m_endOfRunAtEndOfLine.object() && - m_endOfRunAtEndOfLine.offset() <= pos) { - m_reachedEndOfLine = true; - pos = m_endOfRunAtEndOfLine.offset(); - } - // It's OK to add runs for zero-length RenderObjects, just don't make the - // run larger than it should be - int end = obj->length() ? pos + 1 : 0; - if (isolateTracker.inIsolate()) - addFakeRunIfNecessary(obj, start, end, *this, isolateTracker); - else - adjustMidpointsAndAppendRunsForObjectIfNeeded( - obj, start, end, *this, AppendingRunsForObject, isolateTracker); - } - - if (isEndOfLine) - m_reachedEndOfLine = true; - // If isolateTrack is inIsolate, the next |start of run| can not be the - // current isolated renderer. - if (isolateTracker.inIsolate()) - m_eor.moveTo(bidiNextSkippingEmptyInlines(m_eor.root(), m_eor.object()), - 0); - else - m_eor.increment(); - m_sor = m_eor; - } - - m_direction = WTF::Unicode::OtherNeutral; - m_status.eor = WTF::Unicode::OtherNeutral; -} - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_INLINEITERATOR_H_ diff --git a/sky/engine/core/rendering/InlineTextBox.cpp b/sky/engine/core/rendering/InlineTextBox.cpp deleted file mode 100644 index e2df5206846b9..0000000000000 --- a/sky/engine/core/rendering/InlineTextBox.cpp +++ /dev/null @@ -1,1270 +0,0 @@ -/* - * (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All - * rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/InlineTextBox.h" - -#include "flutter/sky/engine/core/editing/CompositionUnderline.h" -#include "flutter/sky/engine/core/editing/CompositionUnderlineRangeFilter.h" -#include "flutter/sky/engine/core/rendering/HitTestResult.h" -#include "flutter/sky/engine/core/rendering/PaintInfo.h" -#include "flutter/sky/engine/core/rendering/RenderBlock.h" -#include "flutter/sky/engine/core/rendering/RenderTheme.h" -#include "flutter/sky/engine/core/rendering/style/ShadowList.h" -#include "flutter/sky/engine/platform/animation/UnitBezier.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/fonts/GlyphBuffer.h" -#include "flutter/sky/engine/platform/fonts/WidthIterator.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" - -#include - -namespace blink { - -struct SameSizeAsInlineTextBox : public InlineBox { - unsigned variables[1]; - unsigned short variables2[2]; - void* pointers[3]; -}; - -COMPILE_ASSERT(sizeof(InlineTextBox) == sizeof(SameSizeAsInlineTextBox), - InlineTextBox_should_stay_small); - -typedef WTF::HashMap InlineTextBoxOverflowMap; -static InlineTextBoxOverflowMap* gTextBoxesWithOverflow; - -void InlineTextBox::destroy() { - if (!knownToHaveNoOverflow() && gTextBoxesWithOverflow) - gTextBoxesWithOverflow->remove(this); - InlineBox::destroy(); -} - -void InlineTextBox::markDirty() { - m_len = 0; - m_start = 0; - InlineBox::markDirty(); -} - -LayoutRect InlineTextBox::logicalOverflowRect() const { - if (knownToHaveNoOverflow() || !gTextBoxesWithOverflow) - return enclosingIntRect(logicalFrameRect()); - return gTextBoxesWithOverflow->get(this); -} - -void InlineTextBox::setLogicalOverflowRect(const LayoutRect& rect) { - ASSERT(!knownToHaveNoOverflow()); - if (!gTextBoxesWithOverflow) - gTextBoxesWithOverflow = new InlineTextBoxOverflowMap; - gTextBoxesWithOverflow->add(this, rect); -} - -int InlineTextBox::baselinePosition(FontBaseline baselineType) const { - if (!isText() || !parent()) - return 0; - if (parent()->renderer() == renderer().parent()) - return parent()->baselinePosition(baselineType); - return toRenderBoxModelObject(renderer().parent()) - ->baselinePosition(baselineType, isFirstLineStyle(), HorizontalLine, - PositionOnContainingLine); -} - -LayoutUnit InlineTextBox::lineHeight() const { - if (!isText() || !renderer().parent()) - return 0; - if (parent()->renderer() == renderer().parent()) - return parent()->lineHeight(); - return toRenderBoxModelObject(renderer().parent()) - ->lineHeight(isFirstLineStyle(), HorizontalLine, - PositionOnContainingLine); -} - -LayoutUnit InlineTextBox::selectionTop() { - return root().selectionTop(); -} - -LayoutUnit InlineTextBox::selectionBottom() { - return root().selectionBottom(); -} - -LayoutUnit InlineTextBox::selectionHeight() { - return root().selectionHeight(); -} - -bool InlineTextBox::isSelected(int startPos, int endPos) const { - int sPos = std::max(startPos - m_start, 0); - // The position after a hard line break is considered to be past its end. - // See the corresponding code in InlineTextBox::selectionState. - int ePos = std::min(endPos - m_start, int(m_len) + (isLineBreak() ? 0 : 1)); - return (sPos < ePos); -} - -RenderObject::SelectionState InlineTextBox::selectionState() { - RenderObject::SelectionState state = renderer().selectionState(); - if (state == RenderObject::SelectionStart || - state == RenderObject::SelectionEnd || - state == RenderObject::SelectionBoth) { - int startPos, endPos; - renderer().selectionStartEnd(startPos, endPos); - // The position after a hard line break is considered to be past its end. - // See the corresponding code in InlineTextBox::isSelected. - int lastSelectable = start() + len() - (isLineBreak() ? 1 : 0); - - // FIXME: Remove -webkit-line-break: LineBreakAfterWhiteSpace. - int endOfLineAdjustmentForCSSLineBreak = - renderer().style()->lineBreak() == LineBreakAfterWhiteSpace ? -1 : 0; - bool start = - (state != RenderObject::SelectionEnd && startPos >= m_start && - startPos <= m_start + m_len + endOfLineAdjustmentForCSSLineBreak); - bool end = (state != RenderObject::SelectionStart && endPos > m_start && - endPos <= lastSelectable); - if (start && end) - state = RenderObject::SelectionBoth; - else if (start) - state = RenderObject::SelectionStart; - else if (end) - state = RenderObject::SelectionEnd; - else if ((state == RenderObject::SelectionEnd || startPos < m_start) && - (state == RenderObject::SelectionStart || endPos > lastSelectable)) - state = RenderObject::SelectionInside; - else if (state == RenderObject::SelectionBoth) - state = RenderObject::SelectionNone; - } - - return state; -} - -LayoutRect InlineTextBox::localSelectionRect(int startPos, int endPos) { - int sPos = std::max(startPos - m_start, 0); - int ePos = std::min(endPos - m_start, (int)m_len); - - if (sPos > ePos) - return LayoutRect(); - - FontCachePurgePreventer fontCachePurgePreventer; - - LayoutUnit selTop = selectionTop(); - LayoutUnit selHeight = selectionHeight(); - RenderStyle* styleToUse = renderer().style(isFirstLineStyle()); - const Font& font = styleToUse->font(); - - StringBuilder charactersWithHyphen; - bool respectHyphen = ePos == m_len && hasHyphen(); - TextRun textRun = constructTextRun(styleToUse, font, - respectHyphen ? &charactersWithHyphen : 0); - - FloatPoint startingPoint = FloatPoint(logicalLeft(), selTop.toFloat()); - LayoutRect r; - if (sPos || ePos != static_cast(m_len)) - r = enclosingIntRect(font.selectionRectForText(textRun, startingPoint, - selHeight, sPos, ePos)); - else // Avoid computing the font width when the entire line box is selected - // as an optimization. - r = enclosingIntRect(FloatRect( - startingPoint, FloatSize(m_logicalWidth, selHeight.toFloat()))); - - LayoutUnit logicalWidth = r.width(); - if (r.x() > logicalRight()) - logicalWidth = 0; - else if (r.maxX() > logicalRight()) - logicalWidth = logicalRight() - r.x(); - - LayoutPoint topPoint = LayoutPoint(r.x(), selTop); - return LayoutRect(topPoint, LayoutSize(logicalWidth, selHeight)); -} - -void InlineTextBox::deleteLine() { - renderer().removeTextBox(this); - destroy(); -} - -void InlineTextBox::extractLine() { - if (extracted()) - return; - - renderer().extractTextBox(this); -} - -void InlineTextBox::attachLine() { - if (!extracted()) - return; - - renderer().attachTextBox(this); -} - -bool InlineTextBox::isLineBreak() const { - return renderer().style()->preserveNewline() && len() == 1 && - (*renderer().text().impl())[start()] == '\n'; -} - -bool InlineTextBox::nodeAtPoint(const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset, - LayoutUnit /* lineTop */, - LayoutUnit /*lineBottom*/) { - if (isLineBreak()) - return false; - - FloatPoint boxOrigin = locationIncludingFlipping(); - boxOrigin.moveBy(accumulatedOffset); - FloatRect rect(boxOrigin, size()); - if (m_truncation != cFullTruncation && visibleToHitTestRequest(request) && - locationInContainer.intersects(rect)) { - renderer().updateHitTestResult( - result, locationInContainer.point() - toLayoutSize(accumulatedOffset)); - return true; - } - return false; -} - -bool InlineTextBox::getEmphasisMarkPosition( - RenderStyle* style, - TextEmphasisPosition& emphasisPosition) const { - if (style->textEmphasisMark() == TextEmphasisMarkNone) - return false; - // FIXME(sky): remove this function, it was for ruby. - emphasisPosition = style->textEmphasisPosition(); - return true; -} - -namespace { - -struct TextPaintingStyle { - Color fillColor; - Color strokeColor; - Color emphasisMarkColor; - float strokeWidth; - const ShadowList* shadow; - - bool operator==(const TextPaintingStyle& other) { - return fillColor == other.fillColor && strokeColor == other.strokeColor && - emphasisMarkColor == other.emphasisMarkColor && - strokeWidth == other.strokeWidth && shadow == other.shadow; - } - bool operator!=(const TextPaintingStyle& other) { return !(*this == other); } -}; - -TextPaintingStyle textPaintingStyle(RenderText& renderer, RenderStyle* style) { - TextPaintingStyle textStyle; - textStyle.fillColor = style->resolveColor(style->textFillColor()); - textStyle.strokeColor = style->resolveColor(style->textStrokeColor()); - textStyle.emphasisMarkColor = style->resolveColor(style->textEmphasisColor()); - textStyle.strokeWidth = style->textStrokeWidth(); - textStyle.shadow = style->textShadow(); - return textStyle; -} - -TextPaintingStyle selectionPaintingStyle(RenderText& renderer, - bool haveSelection, - const TextPaintingStyle& textStyle) { - TextPaintingStyle selectionStyle = textStyle; - - if (haveSelection) { - selectionStyle.fillColor = renderer.selectionForegroundColor(); - selectionStyle.emphasisMarkColor = renderer.selectionEmphasisMarkColor(); - } - - return selectionStyle; -} - -void updateGraphicsContext(GraphicsContext* context, - const TextPaintingStyle& textStyle, - GraphicsContextStateSaver& stateSaver) { - TextDrawingModeFlags mode = context->textDrawingMode(); - if (textStyle.strokeWidth > 0) { - TextDrawingModeFlags newMode = mode | TextModeStroke; - if (mode != newMode) { - if (!stateSaver.saved()) - stateSaver.save(); - context->setTextDrawingMode(newMode); - mode = newMode; - } - } - - if (mode & TextModeFill && textStyle.fillColor != context->fillColor()) - context->setFillColor(textStyle.fillColor); - - if (mode & TextModeStroke) { - if (textStyle.strokeColor != context->strokeColor()) - context->setStrokeColor(textStyle.strokeColor); - if (textStyle.strokeWidth != context->strokeThickness()) - context->setStrokeThickness(textStyle.strokeWidth); - } - - if (textStyle.shadow) { - if (!stateSaver.saved()) - stateSaver.save(); - context->setDrawLooper(textStyle.shadow->createDrawLooper( - DrawLooperBuilder::ShadowIgnoresAlpha)); - } -} - -void paintText(GraphicsContext* context, - const Font& font, - const TextRun& textRun, - const AtomicString& emphasisMark, - int emphasisMarkOffset, - int startOffset, - int endOffset, - int truncationPoint, - const FloatPoint& textOrigin, - const FloatRect& boxRect, - TextBlobPtr* cachedTextBlob = 0) { - TextRunPaintInfo textRunPaintInfo(textRun); - textRunPaintInfo.bounds = boxRect; - if (startOffset <= endOffset) { - textRunPaintInfo.from = startOffset; - textRunPaintInfo.to = endOffset; - // FIXME: We should be able to use cachedTextBlob in more cases. - textRunPaintInfo.cachedTextBlob = cachedTextBlob; - if (emphasisMark.isEmpty()) - context->drawText(font, textRunPaintInfo, textOrigin); - else - context->drawEmphasisMarks(font, textRunPaintInfo, emphasisMark, - textOrigin + IntSize(0, emphasisMarkOffset)); - } else { - if (endOffset > 0) { - textRunPaintInfo.from = 0; - textRunPaintInfo.to = endOffset; - if (emphasisMark.isEmpty()) - context->drawText(font, textRunPaintInfo, textOrigin); - else - context->drawEmphasisMarks(font, textRunPaintInfo, emphasisMark, - textOrigin + IntSize(0, emphasisMarkOffset)); - } - if (startOffset < truncationPoint) { - textRunPaintInfo.from = startOffset; - textRunPaintInfo.to = truncationPoint; - if (emphasisMark.isEmpty()) - context->drawText(font, textRunPaintInfo, textOrigin); - else - context->drawEmphasisMarks(font, textRunPaintInfo, emphasisMark, - textOrigin + IntSize(0, emphasisMarkOffset)); - } - } -} - -inline void paintEmphasisMark(GraphicsContext* context, - const AtomicString& emphasisMark, - int emphasisMarkOffset, - int startOffset, - int endOffset, - int paintRunLength, - const Font& font, - const TextRun& textRun, - const FloatPoint& textOrigin, - const FloatRect& boxRect) { - ASSERT(!emphasisMark.isEmpty()); - paintText(context, font, textRun, emphasisMark, emphasisMarkOffset, - startOffset, endOffset, paintRunLength, textOrigin, boxRect); -} - -void paintTextWithEmphasisMark(GraphicsContext* context, - const Font& font, - const TextPaintingStyle& textStyle, - const TextRun& textRun, - const AtomicString& emphasisMark, - int emphasisMarkOffset, - int startOffset, - int endOffset, - int length, - const FloatPoint& textOrigin, - const FloatRect& boxRect, - TextBlobPtr* cachedTextBlob = 0) { - GraphicsContextStateSaver stateSaver(*context, false); - updateGraphicsContext(context, textStyle, stateSaver); - paintText(context, font, textRun, nullAtom, 0, startOffset, endOffset, length, - textOrigin, boxRect, cachedTextBlob); - - if (!emphasisMark.isEmpty()) { - if (textStyle.emphasisMarkColor != textStyle.fillColor) - context->setFillColor(textStyle.emphasisMarkColor); - paintEmphasisMark(context, emphasisMark, emphasisMarkOffset, startOffset, - endOffset, length, font, textRun, textOrigin, boxRect); - } -} - -} // namespace - -void InlineTextBox::paint(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - LayoutUnit /*lineTop*/, - LayoutUnit /*lineBottom*/, - Vector& layers) { - if (isLineBreak() || m_truncation == cFullTruncation || !m_len) - return; - - LayoutRect logicalVisualOverflow = logicalOverflowRect(); - LayoutUnit logicalStart = logicalVisualOverflow.x() + paintOffset.x(); - LayoutUnit logicalExtent = logicalVisualOverflow.width(); - - LayoutUnit paintEnd = paintInfo.rect.maxX(); - LayoutUnit paintStart = paintInfo.rect.x(); - - // When subpixel font scaling is enabled text runs are positioned at - // subpixel boundaries on the x-axis and thus there is no reason to - // snap the x value. We still round the y-axis to ensure consistent - // line heights. - LayoutPoint adjustedPaintOffset = - LayoutPoint(paintOffset.x(), paintOffset.y().round()); - - if (logicalStart >= paintEnd || logicalStart + logicalExtent <= paintStart) - return; - - if (m_truncation != cNoTruncation) { - if (renderer().containingBlock()->style()->isLeftToRightDirection() != - isLeftToRightDirection()) { - // Make the visible fragment of text hug the edge closest to the rest of - // the run by moving the origin at which we start drawing text. e.g. In - // the case of LTR text truncated in an RTL Context, the correct behavior - // is: |Hello|CBA| -> |...He|CBA| In order to draw the fragment "He" - // aligned to the right edge of it's box, we need to start drawing farther - // to the right. NOTE: WebKit's behavior differs from that of IE which - // appears to just overlay the ellipsis on top of the truncated string - // i.e. |Hello|CBA| -> |...lo|CBA| - LayoutUnit widthOfVisibleText = renderer().width( - m_start, m_truncation, textPos(), - isLeftToRightDirection() ? LTR : RTL, isFirstLineStyle()); - LayoutUnit widthOfHiddenText = m_logicalWidth - widthOfVisibleText; - // FIXME: The hit testing logic also needs to take this translation into - // account. - LayoutSize truncationOffset( - isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText, 0); - adjustedPaintOffset.move(truncationOffset); - } - } - - GraphicsContext* context = paintInfo.context; - RenderStyle* styleToUse = renderer().style(isFirstLineStyle()); - - FloatPoint boxOrigin = locationIncludingFlipping(); - boxOrigin.move(adjustedPaintOffset.x().toFloat(), - adjustedPaintOffset.y().toFloat()); - FloatRect boxRect(boxOrigin, LayoutSize(logicalWidth(), logicalHeight())); - - bool haveSelection = selectionState() != RenderObject::SelectionNone; - - // Determine text colors. - TextPaintingStyle textStyle = textPaintingStyle(renderer(), styleToUse); - TextPaintingStyle selectionStyle = - selectionPaintingStyle(renderer(), haveSelection, textStyle); - bool paintSelectedTextSeparately = textStyle != selectionStyle; - - // Set our font. - const Font& font = styleToUse->font(); - - FloatPoint textOrigin = - FloatPoint(boxOrigin.x(), boxOrigin.y() + font.fontMetrics().ascent()); - - // 1. Paint backgrounds behind text if needed. Examples of such backgrounds - // include selection. - if (haveSelection) - paintSelection(context, boxOrigin, styleToUse, font, - selectionStyle.fillColor); - - // 2. Now paint the foreground, including text and decorations like - // underline/overline (in quirks mode only). - int length = m_len; - int maximumLength; - StringView string = renderer().text().createView(); - if (static_cast(length) != string.length() || m_start) - string.narrow(m_start, length); - maximumLength = renderer().textLength() - m_start; - - StringBuilder charactersWithEllipsis; - if (hasAddedEllipsis()) { - const AtomicString& ellipsis = - renderer().containingBlock()->style()->ellipsis(); - charactersWithEllipsis.reserveCapacity(string.length() + ellipsis.length()); - charactersWithEllipsis.append(string); - charactersWithEllipsis.append(ellipsis); - string = charactersWithEllipsis.toString().createView(); - maximumLength = string.length(); - } - - StringBuilder charactersWithHyphen; - TextRun textRun = constructTextRun(styleToUse, font, string, maximumLength, - hasHyphen() ? &charactersWithHyphen : 0); - if (hasHyphen() || hasAddedEllipsis()) - length = textRun.length(); - - int sPos = 0; - int ePos = 0; - if (paintSelectedTextSeparately) - selectionStartEnd(sPos, ePos); - - bool respectHyphen = ePos == m_len && hasHyphen(); - if (respectHyphen) - ePos = textRun.length(); - - if (m_truncation != cNoTruncation) { - sPos = std::min(sPos, m_truncation); - ePos = std::min(ePos, m_truncation); - length = m_truncation; - } - - int emphasisMarkOffset = 0; - TextEmphasisPosition emphasisMarkPosition; - bool hasTextEmphasis = - getEmphasisMarkPosition(styleToUse, emphasisMarkPosition); - const AtomicString& emphasisMark = - hasTextEmphasis ? styleToUse->textEmphasisMarkString() : nullAtom; - if (!emphasisMark.isEmpty()) - emphasisMarkOffset = emphasisMarkPosition == TextEmphasisPositionOver - ? -font.fontMetrics().ascent() - - font.emphasisMarkDescent(emphasisMark) - : font.fontMetrics().descent() + - font.emphasisMarkAscent(emphasisMark); - - // FIXME: Truncate right-to-left text correctly. - int startOffset = 0; - int endOffset = length; - if (paintSelectedTextSeparately && ePos > sPos) { - startOffset = ePos; - endOffset = sPos; - } - // FIXME: This cache should probably ultimately be held somewhere else. - // A hashmap is convenient to avoid a memory hit when the - // RuntimeEnabledFeature is off. - bool textBlobIsCacheable = startOffset == 0 && endOffset == length; - TextBlobPtr* cachedTextBlob = - textBlobIsCacheable ? &m_cachedTextBlob : nullptr; - paintTextWithEmphasisMark(context, font, textStyle, textRun, emphasisMark, - emphasisMarkOffset, startOffset, endOffset, length, - textOrigin, boxRect, cachedTextBlob); - - if (paintSelectedTextSeparately && sPos < ePos) { - // paint only the text that is selected - bool textBlobIsCacheable = sPos == 0 && ePos == length; - TextBlobPtr* cachedTextBlob = - textBlobIsCacheable ? &m_cachedTextBlob : nullptr; - paintTextWithEmphasisMark(context, font, selectionStyle, textRun, - emphasisMark, emphasisMarkOffset, sPos, ePos, - length, textOrigin, boxRect, cachedTextBlob); - } - - // Paint decorations - TextDecoration textDecorations = styleToUse->textDecorationsInEffect(); - if (textDecorations != TextDecorationNone) { - GraphicsContextStateSaver stateSaver(*context, false); - updateGraphicsContext(context, textStyle, stateSaver); - paintDecoration(context, boxOrigin, textDecorations); - } -} - -void InlineTextBox::selectionStartEnd(int& sPos, int& ePos) { - int startPos, endPos; - if (renderer().selectionState() == RenderObject::SelectionInside) { - startPos = 0; - endPos = renderer().textLength(); - } else { - renderer().selectionStartEnd(startPos, endPos); - if (renderer().selectionState() == RenderObject::SelectionStart) - endPos = renderer().textLength(); - else if (renderer().selectionState() == RenderObject::SelectionEnd) - startPos = 0; - } - - sPos = std::max(startPos - m_start, 0); - ePos = std::min(endPos - m_start, (int)m_len); -} - -void InlineTextBox::paintSelection(GraphicsContext* context, - const FloatPoint& boxOrigin, - RenderStyle* style, - const Font& font, - Color textColor) { - // See if we have a selection to paint at all. - int sPos, ePos; - selectionStartEnd(sPos, ePos); - if (sPos >= ePos) - return; - - Color c = renderer().selectionBackgroundColor(); - if (!c.alpha()) - return; - - // If the text color ends up being the same as the selection background, - // invert the selection background. - if (textColor == c) - c = Color(0xff - c.red(), 0xff - c.green(), 0xff - c.blue()); - - // If the text is truncated, let the thing being painted in the truncation - // draw its own highlight. - int length = m_truncation != cNoTruncation ? m_truncation : m_len; - StringView string = renderer().text().createView(); - - if (string.length() != static_cast(length) || m_start) - string.narrow(m_start, length); - - StringBuilder charactersWithHyphen; - bool respectHyphen = ePos == length && hasHyphen(); - TextRun textRun = - constructTextRun(style, font, string, renderer().textLength() - m_start, - respectHyphen ? &charactersWithHyphen : 0); - if (respectHyphen) - ePos = textRun.length(); - - LayoutUnit selectionBottom = root().selectionBottom(); - LayoutUnit selectionTop = root().selectionTopAdjustedForPrecedingBlock(); - - int deltaY = roundToInt(logicalTop() - selectionTop); - int selHeight = std::max(0, roundToInt(selectionBottom - selectionTop)); - - FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); - FloatRect clipRect(localOrigin, FloatSize(m_logicalWidth, selHeight)); - - GraphicsContextStateSaver stateSaver(*context); - context->clip(clipRect); - context->drawHighlightForText(font, textRun, localOrigin, selHeight, c, sPos, - ePos); -} - -unsigned InlineTextBox::underlinePaintStart( - const CompositionUnderline& underline) { - return std::max(static_cast(m_start), underline.startOffset); -} - -unsigned InlineTextBox::underlinePaintEnd( - const CompositionUnderline& underline) { - unsigned paintEnd = std::min( - end() + 1, - underline.endOffset); // end() points at the last char, not past it. - if (m_truncation != cNoTruncation) - paintEnd = - std::min(paintEnd, static_cast(m_start + m_truncation)); - return paintEnd; -} - -void InlineTextBox::paintSingleCompositionBackgroundRun( - GraphicsContext* context, - const FloatPoint& boxOrigin, - RenderStyle* style, - const Font& font, - Color backgroundColor, - int startPos, - int endPos) { - int sPos = std::max(startPos - m_start, 0); - int ePos = std::min(endPos - m_start, static_cast(m_len)); - if (sPos >= ePos) - return; - - int deltaY = logicalTop() - selectionTop(); - int selHeight = selectionHeight(); - FloatPoint localOrigin(boxOrigin.x(), boxOrigin.y() - deltaY); - context->drawHighlightForText(font, constructTextRun(style, font), - localOrigin, selHeight, backgroundColor, sPos, - ePos); -} - -static StrokeStyle textDecorationStyleToStrokeStyle( - TextDecorationStyle decorationStyle) { - StrokeStyle strokeStyle = SolidStroke; - switch (decorationStyle) { - case TextDecorationStyleSolid: - strokeStyle = SolidStroke; - break; - case TextDecorationStyleDouble: - strokeStyle = DoubleStroke; - break; - case TextDecorationStyleDotted: - strokeStyle = DottedStroke; - break; - case TextDecorationStyleDashed: - strokeStyle = DashedStroke; - break; - case TextDecorationStyleWavy: - strokeStyle = WavyStroke; - break; - } - - return strokeStyle; -} - -static int computeUnderlineOffset(const TextUnderlinePosition underlinePosition, - const FontMetrics& fontMetrics, - const InlineTextBox* inlineTextBox, - const float textDecorationThickness) { - // Compute the gap between the font and the underline. Use at least one - // pixel gap, if underline is thick then use a bigger gap. - int gap = 0; - - // Underline position of zero means draw underline on Baseline Position, - // in Blink we need at least 1-pixel gap to adding following check. - // Positive underline Position means underline should be drawn above baselin e - // and negative value means drawing below baseline, negating the value as in - // Blink downward Y-increases. - - if (fontMetrics.underlinePosition()) - gap = -fontMetrics.underlinePosition(); - else - gap = std::max(1, ceilf(textDecorationThickness / 2.f)); - - // FIXME: We support only horizontal text for now. - switch (underlinePosition) { - case TextUnderlinePositionAuto: - return fontMetrics.ascent() + - gap; // Position underline near the alphabetic baseline. - case TextUnderlinePositionUnder: { - // Position underline relative to the under edge of the lowest element's - // content box. - const float offset = - inlineTextBox->root().maxLogicalTop() - inlineTextBox->logicalTop(); - if (offset > 0) - return inlineTextBox->logicalHeight() + gap + offset; - return inlineTextBox->logicalHeight() + gap; - } - } - - ASSERT_NOT_REACHED(); - return fontMetrics.ascent() + gap; -} - -struct CurveAlongX { - static inline float x(const FloatPoint& p) { return p.x(); } - static inline float y(const FloatPoint& p) { return p.y(); } - static inline FloatPoint p(float x, float y) { return FloatPoint(x, y); } - static inline void setX(FloatPoint& p, double x) { p.setX(x); } -}; - -struct CurveAlongY { - static inline float x(const FloatPoint& p) { return p.y(); } - static inline float y(const FloatPoint& p) { return p.x(); } - static inline FloatPoint p(float x, float y) { return FloatPoint(y, x); } - static inline void setX(FloatPoint& p, double x) { p.setY(x); } -}; - -/* - * Draw one cubic Bezier curve and repeat the same pattern along the - * the decoration's axis. The start point (p1), controlPoint1, - * controlPoint2 and end point (p2) of the Bezier curve form a diamond - * shape, as follows (the four points marked +): - * - * step - * |-----------| - * - * controlPoint1 - * + - * - * - * . . - * . . - * . . - * (x1, y1) p1 + . + p2 (x2, y2) - <--- Decoration's axis - * . . | - * . . | - * . . | controlPointDistance - * | - * | - * + - - * controlPoint2 - * - * |-----------| - * step - * - * strokeWavyTextDecorationInternal() takes two points, p1 and p2. - * These must be axis-aligned. If they are horizontally-aligned, - * specialize it with CurveAlongX; if they are vertically aligned, - * specialize it with CurveAlongY. The function is written as if it - * was doing everything along the X axis; CurveAlongY just flips the - * coordinates around. - */ -template -static void strokeWavyTextDecorationInternal(GraphicsContext* context, - FloatPoint p1, - FloatPoint p2, - float strokeThickness) { - ASSERT(Curve::y(p1) == - Curve::y(p2)); // verify that this is indeed axis-aligned - - context->adjustLineToPixelBoundaries(p1, p2, strokeThickness, - context->strokeStyle()); - - Path path; - path.moveTo(p1); - - float controlPointDistance = 2 * strokeThickness; - float step = controlPointDistance; - - float yAxis = Curve::y(p1); - float x1; - float x2; - - if (Curve::x(p1) < Curve::x(p2)) { - x1 = Curve::x(p1); - x2 = Curve::x(p2); - } else { - x1 = Curve::x(p2); - x2 = Curve::x(p1); - } - - FloatPoint controlPoint1 = Curve::p(0, yAxis + controlPointDistance); - FloatPoint controlPoint2 = Curve::p(0, yAxis - controlPointDistance); - - float x; - for (x = x1; x + 2 * step <= x2;) { - Curve::setX(controlPoint1, x + step); - Curve::setX(controlPoint2, x + step); - x += 2 * step; - path.addBezierCurveTo(controlPoint1, controlPoint2, Curve::p(x, yAxis)); - } - - if (x < x2) { - Curve::setX(controlPoint1, x + step); - Curve::setX(controlPoint2, x + step); - float xScale = 1.0 / (2 * step); - float yScale = 1.0 / (2 * controlPointDistance); - OwnPtr bezier = - adoptPtr(new UnitBezier((Curve::x(controlPoint1) - x) * xScale, - (Curve::y(controlPoint1) - yAxis) * yScale, - (Curve::x(controlPoint2) - x) * xScale, - (Curve::y(controlPoint2) - yAxis) * yScale)); - float t = bezier->solveCurveX((x2 - x) / (2.0 * step), - std::numeric_limits::epsilon()); - // following math based on http://stackoverflow.com/a/879213 - float u1 = 1.0 - t; - float qxb = x * u1 * u1 + Curve::x(controlPoint1) * 2 * t * u1 + - Curve::x(controlPoint2) * t * t; - float qxd = Curve::x(controlPoint1) * u1 * u1 + - Curve::x(controlPoint2) * 2 * t * u1 + (x + step) * t * t; - float qyb = yAxis * u1 * u1 + Curve::y(controlPoint1) * 2 * t * u1 + - Curve::y(controlPoint2) * t * t; - float qyd = Curve::y(controlPoint1) * u1 * u1 + - Curve::y(controlPoint2) * 2 * t * u1 + yAxis * t * t; - float xb = x * u1 + Curve::x(controlPoint1) * t; - float yb = yAxis * u1 + Curve::y(controlPoint1) * t; - float xc = qxb; - float xd = qxb * u1 + qxd * t; - float yc = qyb; - float yd = qyb * u1 + qyd * t; - path.addBezierCurveTo(Curve::p(xb, yb), Curve::p(xc, yc), Curve::p(xd, yd)); - } - - context->setShouldAntialias(true); - context->strokePath(path); -} - -static void strokeWavyTextDecoration(GraphicsContext* context, - FloatPoint p1, - FloatPoint p2, - float strokeThickness) { - if (p1.y() == p2.y()) // horizontal line - strokeWavyTextDecorationInternal(context, p1, p2, - strokeThickness); - else // vertical line - strokeWavyTextDecorationInternal(context, p1, p2, - strokeThickness); -} - -static bool shouldSetDecorationAntialias(TextDecorationStyle decorationStyle) { - return decorationStyle == TextDecorationStyleDotted || - decorationStyle == TextDecorationStyleDashed; -} - -static bool shouldSetDecorationAntialias(TextDecorationStyle underline, - TextDecorationStyle overline, - TextDecorationStyle linethrough) { - return shouldSetDecorationAntialias(underline) || - shouldSetDecorationAntialias(overline) || - shouldSetDecorationAntialias(linethrough); -} - -static void paintAppliedDecoration( - GraphicsContext* context, - FloatPoint start, - float width, - float doubleOffset, - int wavyOffsetFactor, - RenderObject::AppliedTextDecoration decoration, - float thickness, - bool antialiasDecoration) { - context->setStrokeStyle(textDecorationStyleToStrokeStyle(decoration.style)); - context->setStrokeColor(decoration.color); - - switch (decoration.style) { - case TextDecorationStyleWavy: - strokeWavyTextDecoration( - context, start + FloatPoint(0, doubleOffset * wavyOffsetFactor), - start + FloatPoint(width, doubleOffset * wavyOffsetFactor), - thickness); - break; - case TextDecorationStyleDotted: - case TextDecorationStyleDashed: - context->setShouldAntialias(antialiasDecoration); - // Fall through - default: - context->drawLineForText(start, width); - - if (decoration.style == TextDecorationStyleDouble) - context->drawLineForText(start + FloatPoint(0, doubleOffset), width); - } -} - -void InlineTextBox::paintDecoration(GraphicsContext* context, - const FloatPoint& boxOrigin, - TextDecoration deco) { - GraphicsContextStateSaver stateSaver(*context); - - if (m_truncation == cFullTruncation) - return; - - FloatPoint localOrigin = boxOrigin; - - float width = m_logicalWidth; - if (m_truncation != cNoTruncation) { - width = renderer().width(m_start, m_truncation, textPos(), - isLeftToRightDirection() ? LTR : RTL, - isFirstLineStyle()); - if (!isLeftToRightDirection()) - localOrigin.move(m_logicalWidth - width, 0); - } - - // Get the text decoration colors. - RenderObject::AppliedTextDecoration underline, overline, linethrough; - renderer().getTextDecorations(deco, underline, overline, linethrough, true); - if (isFirstLineStyle()) - renderer().getTextDecorations(deco, underline, overline, linethrough, true, - true); - - // Use a special function for underlines to get the positioning exactly right. - - RenderStyle* styleToUse = renderer().style(isFirstLineStyle()); - int baseline = styleToUse->fontMetrics().ascent(); - - // Set the thick of the line to be 10% (or something else ?)of the computed - // font size and not less than 1px. - - // Update Underline thickness, in case we have Faulty Font Metrics calculating - // underline thickness by old method. - float textDecorationThickness = - styleToUse->fontMetrics() - .underlineThickness(); // TODO(ianh): Make this author-controllable - int fontHeightInt = (int)(styleToUse->fontMetrics().floatHeight() + 0.5); - if ((textDecorationThickness == 0.f) || - (textDecorationThickness >= (fontHeightInt >> 1))) - textDecorationThickness = - std::max(1.f, styleToUse->computedFontSize() / 10.f); - - context->setStrokeThickness(textDecorationThickness); - - bool antialiasDecoration = - shouldSetDecorationAntialias(overline.style, underline.style, - linethrough.style) && - RenderBoxModelObject::shouldAntialiasLines(context); - - // Offset between lines - always non-zero, so lines never cross each other. - float doubleOffset = textDecorationThickness + 1.f; - - if (deco & TextDecorationUnderline) { - const int underlineOffset = computeUnderlineOffset( - styleToUse->textUnderlinePosition(), styleToUse->fontMetrics(), this, - textDecorationThickness); - paintAppliedDecoration(context, - localOrigin + FloatPoint(0, underlineOffset), width, - doubleOffset, 1, underline, textDecorationThickness, - antialiasDecoration); - } - if (deco & TextDecorationOverline) { - paintAppliedDecoration(context, localOrigin, width, -doubleOffset, 1, - overline, textDecorationThickness, - antialiasDecoration); - } - if (deco & TextDecorationLineThrough) { - const float lineThroughOffset = 2 * baseline / 3; - paintAppliedDecoration(context, - localOrigin + FloatPoint(0, lineThroughOffset), - width, doubleOffset, 0, linethrough, - textDecorationThickness, antialiasDecoration); - } -} - -void InlineTextBox::paintCompositionBackgrounds(GraphicsContext* pt, - const FloatPoint& boxOrigin, - RenderStyle* style, - const Font& font, - bool useCustomUnderlines) { - ASSERT_NOT_REACHED(); // TODO(ianh): this is unused right now, but we should - // probably expose it if it's useful - if (useCustomUnderlines) { - // Paint custom background highlights for compositions. - Vector underlines; // TODO(ianh): if we expose this - // function, provide a way to let - // authors set this - CompositionUnderlineRangeFilter filter(underlines, start(), end()); - for (CompositionUnderlineRangeFilter::ConstIterator it = filter.begin(); - it != filter.end(); ++it) { - if (it->backgroundColor == Color::transparent) - continue; - paintSingleCompositionBackgroundRun( - pt, boxOrigin, style, font, it->backgroundColor, - underlinePaintStart(*it), underlinePaintEnd(*it)); - } - - } else { - unsigned start = 0; // TODO(ianh): if we expose this function, provide a - // way to let authors set this - unsigned end = 0; // TODO(ianh): if we expose this function, provide a way - // to let authors set this - paintSingleCompositionBackgroundRun( - pt, boxOrigin, style, font, - RenderTheme::theme().platformDefaultCompositionBackgroundColor(), start, - end); - } -} - -void InlineTextBox::paintCompositionUnderline( - GraphicsContext* ctx, - const FloatPoint& boxOrigin, - const CompositionUnderline& underline) { - if (m_truncation == cFullTruncation) - return; - - unsigned paintStart = underlinePaintStart(underline); - unsigned paintEnd = underlinePaintEnd(underline); - - // start of line to draw, relative to paintOffset. - float start = paintStart == static_cast(m_start) - ? 0 - : renderer().width(m_start, paintStart - m_start, textPos(), - isLeftToRightDirection() ? LTR : RTL, - isFirstLineStyle()); - // how much line to draw - float width = (paintStart == static_cast(m_start) && - paintEnd == static_cast(end()) + 1) - ? m_logicalWidth - : renderer().width(paintStart, paintEnd - paintStart, - textPos() + start, - isLeftToRightDirection() ? LTR : RTL, - isFirstLineStyle()); - - // Thick marked text underlines are 2px thick as long as there is room for the - // 2px line under the baseline. All other marked text underlines are 1px - // thick. If there's not enough space the underline will touch or overlap - // characters. - int lineThickness = 1; - int baseline = renderer().style(isFirstLineStyle())->fontMetrics().ascent(); - if (underline.thick && logicalHeight() - baseline >= 2) - lineThickness = 2; - - // We need to have some space between underlines of subsequent clauses, - // because some input methods do not use different underline styles for those. - // We make each line shorter, which has a harmless side effect of shortening - // the first and last clauses, too. - start += 1; - width -= 2; - - ctx->setStrokeColor(underline.color); - ctx->setStrokeThickness(lineThickness); - ctx->drawLineForText( - FloatPoint(boxOrigin.x() + start, - boxOrigin.y() + logicalHeight() - lineThickness), - width); -} - -int InlineTextBox::caretMinOffset() const { - return m_start; -} - -int InlineTextBox::caretMaxOffset() const { - return m_start + m_len; -} - -float InlineTextBox::textPos() const { - // When computing the width of a text run, - // RenderParagraph::computeInlineDirectionPositionsForLine() doesn't include - // the actual offset from the containing block edge in its measurement. - // textPos() should be consistent so the text are rendered in the same width. - if (logicalLeft() == 0) - return 0; - return logicalLeft() - root().logicalLeft(); -} - -int InlineTextBox::offsetForPosition(float lineOffset, - bool includePartialGlyphs) const { - if (isLineBreak()) - return 0; - - if (lineOffset - logicalLeft() > logicalWidth()) - return isLeftToRightDirection() ? len() : 0; - if (lineOffset - logicalLeft() < 0) - return isLeftToRightDirection() ? 0 : len(); - - FontCachePurgePreventer fontCachePurgePreventer; - - RenderText& text = renderer(); - RenderStyle* style = text.style(isFirstLineStyle()); - const Font& font = style->font(); - return font.offsetForPosition(constructTextRun(style, font), - lineOffset - logicalLeft(), - includePartialGlyphs); -} - -float InlineTextBox::positionForOffset(int offset) const { - ASSERT(offset >= m_start); - ASSERT(offset <= m_start + m_len); - - if (isLineBreak()) - return logicalLeft(); - - FontCachePurgePreventer fontCachePurgePreventer; - - RenderText& text = renderer(); - RenderStyle* styleToUse = text.style(isFirstLineStyle()); - ASSERT(styleToUse); - const Font& font = styleToUse->font(); - int from = !isLeftToRightDirection() ? offset - m_start : 0; - int to = !isLeftToRightDirection() ? m_len : offset - m_start; - // FIXME: Do we need to add rightBearing here? - return font - .selectionRectForText(constructTextRun(styleToUse, font), - IntPoint(logicalLeft(), 0), 0, from, to) - .maxX(); -} - -bool InlineTextBox::containsCaretOffset(int offset) const { - // Offsets before the box are never "in". - if (offset < m_start) - return false; - - int pastEnd = m_start + m_len; - - // Offsets inside the box (not at either edge) are always "in". - if (offset < pastEnd) - return true; - - // Offsets outside the box are always "out". - if (offset > pastEnd) - return false; - - // Offsets at the end are "out" for line breaks (they are on the next line). - if (isLineBreak()) - return false; - - // Offsets at the end are "in" for normal boxes (but the caller has to check - // affinity). - return true; -} - -void InlineTextBox::characterWidths(Vector& widths) const { - FontCachePurgePreventer fontCachePurgePreventer; - - RenderStyle* styleToUse = renderer().style(isFirstLineStyle()); - const Font& font = styleToUse->font(); - - TextRun textRun = constructTextRun(styleToUse, font); - - GlyphBuffer glyphBuffer; - WidthIterator it(&font, textRun); - float lastWidth = 0; - widths.resize(m_len); - for (unsigned i = 0; i < m_len; i++) { - it.advance(i + 1, &glyphBuffer); - widths[i] = it.m_runWidthSoFar - lastWidth; - lastWidth = it.m_runWidthSoFar; - } -} - -TextRun InlineTextBox::constructTextRun( - RenderStyle* style, - const Font& font, - StringBuilder* charactersWithHyphen) const { - ASSERT(style); - ASSERT(renderer().text()); - - StringView string = renderer().text().createView(); - unsigned startPos = start(); - unsigned length = len(); - - if (string.length() != length || startPos) - string.narrow(startPos, length); - - return constructTextRun(style, font, string, - renderer().textLength() - startPos, - charactersWithHyphen); -} - -TextRun InlineTextBox::constructTextRun( - RenderStyle* style, - const Font& font, - StringView string, - int maximumLength, - StringBuilder* charactersWithHyphen) const { - ASSERT(style); - - if (charactersWithHyphen) { - const AtomicString& hyphenString = style->hyphenString(); - charactersWithHyphen->reserveCapacity(string.length() + - hyphenString.length()); - charactersWithHyphen->append(string); - charactersWithHyphen->append(hyphenString); - string = charactersWithHyphen->toString().createView(); - maximumLength = string.length(); - } - - ASSERT(maximumLength >= static_cast(string.length())); - - TextRun run(string, textPos(), expansion(), expansionBehavior(), direction(), - dirOverride() || style->rtlOrdering() == VisualOrder, - !renderer().canUseSimpleFontCodePath()); - run.setTabSize(!style->collapseWhiteSpace(), style->tabSize()); - run.setCharacterScanForCodePath(!renderer().canUseSimpleFontCodePath()); - // Propagate the maximum length of the characters buffer to the TextRun, even - // when we're only processing a substring. - run.setCharactersLength(maximumLength); - ASSERT(run.charactersLength() >= run.length()); - return run; -} - -TextRun InlineTextBox::constructTextRunForInspector(RenderStyle* style, - const Font& font) const { - return InlineTextBox::constructTextRun(style, font); -} - -#ifndef NDEBUG - -const char* InlineTextBox::boxName() const { - return "InlineTextBox"; -} - -void InlineTextBox::showBox(int printedCharacters) const { - const RenderText& obj = renderer(); - String value = obj.text(); - value = value.substring(start(), len()); - value.replaceWithLiteral('\\', "\\\\"); - value.replaceWithLiteral('\n', "\\n"); - printedCharacters += fprintf(stderr, "%s\t%p", boxName(), this); - for (; printedCharacters < showTreeCharacterOffset; printedCharacters++) - fputc(' ', stderr); - printedCharacters = fprintf(stderr, "\t%s %p", obj.renderName(), &obj); - const int rendererCharacterOffset = 24; - for (; printedCharacters < rendererCharacterOffset; printedCharacters++) - fputc(' ', stderr); - fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), - value.utf8().data()); -} - -#endif - -} // namespace blink diff --git a/sky/engine/core/rendering/InlineTextBox.h b/sky/engine/core/rendering/InlineTextBox.h deleted file mode 100644 index 89d0f19f567f5..0000000000000 --- a/sky/engine/core/rendering/InlineTextBox.h +++ /dev/null @@ -1,264 +0,0 @@ -/* - * (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2005, 2006, 2009, 2010, 2011 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_INLINETEXTBOX_H_ -#define SKY_ENGINE_CORE_RENDERING_INLINETEXTBOX_H_ - -#include "flutter/sky/engine/core/editing/CompositionUnderline.h" -#include "flutter/sky/engine/core/rendering/InlineBox.h" -#include "flutter/sky/engine/core/rendering/RenderText.h" -#include "flutter/sky/engine/platform/text/TextRun.h" -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" -#include "flutter/sky/engine/wtf/Forward.h" - -namespace blink { - -struct CompositionUnderline; -class DocumentMarker; -class GraphicsContext; - -const unsigned short cNoTruncation = USHRT_MAX; -const unsigned short cFullTruncation = USHRT_MAX - 1; - -class InlineTextBox : public InlineBox { - public: - InlineTextBox(RenderObject& obj) - : InlineBox(obj), - m_prevTextBox(0), - m_nextTextBox(0), - m_start(0), - m_len(0), - m_truncation(cNoTruncation) {} - - RenderText& renderer() const { return toRenderText(InlineBox::renderer()); } - - virtual void destroy() override final; - - InlineTextBox* prevTextBox() const { return m_prevTextBox; } - InlineTextBox* nextTextBox() const { return m_nextTextBox; } - void setNextTextBox(InlineTextBox* n) { m_nextTextBox = n; } - void setPreviousTextBox(InlineTextBox* p) { m_prevTextBox = p; } - - // FIXME: These accessors should ASSERT(!isDirty()). See - // https://bugs.webkit.org/show_bug.cgi?id=97264 - unsigned start() const { return m_start; } - unsigned end() const { return m_len ? m_start + m_len - 1 : m_start; } - unsigned len() const { return m_len; } - - void setStart(unsigned start) { m_start = start; } - void setLen(unsigned len) { m_len = len; } - - void offsetRun(int d) { - ASSERT(!isDirty()); - m_start += d; - } - - unsigned short truncation() { return m_truncation; } - - virtual void markDirty() override final; - - using InlineBox::canHaveLeadingExpansion; - using InlineBox::hasHyphen; - using InlineBox::setCanHaveLeadingExpansion; - using InlineBox::setHasAddedEllipsis; - using InlineBox::setHasHyphen; - - static inline bool compareByStart(const InlineTextBox* first, - const InlineTextBox* second) { - return first->start() < second->start(); - } - - virtual int baselinePosition(FontBaseline) const override final; - virtual LayoutUnit lineHeight() const override final; - - bool getEmphasisMarkPosition(RenderStyle*, TextEmphasisPosition&) const; - - LayoutRect logicalOverflowRect() const; - void setLogicalOverflowRect(const LayoutRect&); - LayoutUnit logicalTopVisualOverflow() const { - return logicalOverflowRect().y(); - } - LayoutUnit logicalBottomVisualOverflow() const { - return logicalOverflowRect().maxY(); - } - -#ifndef NDEBUG - virtual void showBox(int = 0) const override; - virtual const char* boxName() const override; -#endif - - enum RotationDirection { Counterclockwise, Clockwise }; - static AffineTransform rotation(const FloatRect& boxRect, RotationDirection); - - private: - LayoutUnit selectionTop(); - LayoutUnit selectionBottom(); - LayoutUnit selectionHeight(); - - // charactersWithHyphen, if provided, must not be destroyed before the - // TextRun. - TextRun constructTextRun(RenderStyle*, - const Font&, - StringBuilder* charactersWithHyphen = 0) const; - TextRun constructTextRun(RenderStyle*, - const Font&, - StringView, - int maximumLength, - StringBuilder* charactersWithHyphen = 0) const; - - public: - TextRun constructTextRunForInspector(RenderStyle*, const Font&) const; - virtual FloatRect calculateBoundaries() const override { - return FloatRect(x(), y(), width(), height()); - } - - virtual LayoutRect localSelectionRect(int startPos, int endPos); - bool isSelected(int startPos, int endPos) const; - void selectionStartEnd(int& sPos, int& ePos); - - protected: - virtual void paint(PaintInfo&, - const LayoutPoint&, - LayoutUnit lineTop, - LayoutUnit lineBottom, - Vector& layers) override; - virtual bool nodeAtPoint(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset, - LayoutUnit lineTop, - LayoutUnit lineBottom) override; - - private: - virtual void deleteLine() override final; - virtual void extractLine() override final; - virtual void attachLine() override final; - - public: - virtual RenderObject::SelectionState selectionState() override final; - - private: - virtual void clearTruncation() override final { - m_truncation = cNoTruncation; - } - - public: - virtual bool isLineBreak() const override final; - - void setExpansion(int newExpansion) { - m_logicalWidth -= expansion(); - InlineBox::setExpansion(newExpansion); - m_logicalWidth += newExpansion; - } - - private: - virtual bool isInlineTextBox() const override final { return true; } - - public: - virtual int caretMinOffset() const override final; - virtual int caretMaxOffset() const override final; - - private: - float textPos() const; // returns the x position relative to the left start - // of the text line. - - public: - virtual int offsetForPosition(float x, - bool includePartialGlyphs = true) const; - virtual float positionForOffset(int offset) const; - - bool containsCaretOffset( - int offset) const; // false for offset after line break - - // Fills a vector with the pixel width of each character. - void characterWidths(Vector&) const; - - private: - InlineTextBox* - m_prevTextBox; // The previous box that also uses our RenderObject - InlineTextBox* m_nextTextBox; // The next box that also uses our RenderObject - TextBlobPtr m_cachedTextBlob; - - int m_start; - unsigned short m_len; - - unsigned short m_truncation; // Where to truncate when text overflow is - // applied. We use special constants to denote - // no truncation (the whole run paints) and full - // truncation (nothing paints at all). - - unsigned underlinePaintStart(const CompositionUnderline&); - unsigned underlinePaintEnd(const CompositionUnderline&); - - protected: - void paintSingleCompositionBackgroundRun(GraphicsContext*, - const FloatPoint& boxOrigin, - RenderStyle*, - const Font&, - Color backgroundColor, - int startPos, - int endPos); - void paintCompositionBackgrounds(GraphicsContext*, - const FloatPoint& boxOrigin, - RenderStyle*, - const Font&, - bool useCustomUnderlines); - void paintCompositionUnderline(GraphicsContext*, - const FloatPoint& boxOrigin, - const CompositionUnderline&); - - private: - void paintDecoration(GraphicsContext*, - const FloatPoint& boxOrigin, - TextDecoration); - void paintSelection(GraphicsContext*, - const FloatPoint& boxOrigin, - RenderStyle*, - const Font&, - Color textColor); - - TextRun::ExpansionBehavior expansionBehavior() const { - return (canHaveLeadingExpansion() ? TextRun::AllowLeadingExpansion - : TextRun::ForbidLeadingExpansion) | - (expansion() && nextLeafChild() ? TextRun::AllowTrailingExpansion - : TextRun::ForbidTrailingExpansion); - } -}; - -DEFINE_INLINE_BOX_TYPE_CASTS(InlineTextBox); - -void alignSelectionRectToDevicePixels(FloatRect&); - -inline AffineTransform InlineTextBox::rotation( - const FloatRect& boxRect, - RotationDirection rotationDirection) { - return rotationDirection == Clockwise - ? AffineTransform(0, 1, -1, 0, boxRect.x() + boxRect.maxY(), - boxRect.maxY() - boxRect.x()) - : AffineTransform(0, -1, 1, 0, boxRect.x() - boxRect.maxY(), - boxRect.x() + boxRect.maxY()); -} - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_INLINETEXTBOX_H_ diff --git a/sky/engine/core/rendering/LayerPaintingInfo.h b/sky/engine/core/rendering/LayerPaintingInfo.h deleted file mode 100644 index 898b3ba3c63a3..0000000000000 --- a/sky/engine/core/rendering/LayerPaintingInfo.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * Other contributors: - * Robert O'Callahan - * David Baron - * Christian Biesinger - * Randall Jesup - * Roland Mainz - * Josh Soref - * Boris Zbarsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_LAYERPAINTINGINFO_H_ -#define SKY_ENGINE_CORE_RENDERING_LAYERPAINTINGINFO_H_ - -#include "flutter/sky/engine/core/rendering/PaintInfo.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" - -namespace blink { - -class RenderLayer; - -struct LayerPaintingInfo { - LayerPaintingInfo(RenderLayer* inRootLayer, - const LayoutRect& inDirtyRect, - const LayoutSize& inSubPixelAccumulation) - : rootLayer(inRootLayer), - paintDirtyRect(inDirtyRect), - subPixelAccumulation(inSubPixelAccumulation) {} - RenderLayer* rootLayer; - LayoutRect paintDirtyRect; // relative to rootLayer; - LayoutSize subPixelAccumulation; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_LAYERPAINTINGINFO_H_ diff --git a/sky/engine/core/rendering/OrderIterator.cpp b/sky/engine/core/rendering/OrderIterator.cpp deleted file mode 100644 index 8b49c151279b6..0000000000000 --- a/sky/engine/core/rendering/OrderIterator.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/OrderIterator.h" - -#include "flutter/sky/engine/core/rendering/RenderBox.h" - -namespace blink { - -OrderIterator::OrderIterator(const RenderBox* containerBox) - : m_containerBox(containerBox), m_currentChild(0), m_isReset(false) {} - -RenderBox* OrderIterator::first() { - reset(); - return next(); -} - -RenderBox* OrderIterator::next() { - do { - if (!m_currentChild) { - if (m_orderValuesIterator == m_orderValues.end()) - return 0; - - if (!m_isReset) { - ++m_orderValuesIterator; - if (m_orderValuesIterator == m_orderValues.end()) - return 0; - } else { - m_isReset = false; - } - - m_currentChild = m_containerBox->firstChildBox(); - } else { - m_currentChild = m_currentChild->nextSiblingBox(); - } - } while (!m_currentChild || - m_currentChild->style()->order() != *m_orderValuesIterator); - - return m_currentChild; -} - -void OrderIterator::reset() { - m_currentChild = 0; - m_orderValuesIterator = m_orderValues.begin(); - m_isReset = true; -} - -OrderIteratorPopulator::~OrderIteratorPopulator() { - m_iterator.reset(); -} - -void OrderIteratorPopulator::collectChild(const RenderBox* child) { - m_iterator.m_orderValues.insert(child->style()->order()); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/OrderIterator.h b/sky/engine/core/rendering/OrderIterator.h deleted file mode 100644 index 354dfeefd1aca..0000000000000 --- a/sky/engine/core/rendering/OrderIterator.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_ORDERITERATOR_H_ -#define SKY_ENGINE_CORE_RENDERING_ORDERITERATOR_H_ - -#include -#include "flutter/sky/engine/wtf/Noncopyable.h" - -namespace blink { - -class RenderBox; - -class OrderIterator { - WTF_MAKE_NONCOPYABLE(OrderIterator); - - public: - friend class OrderIteratorPopulator; - - OrderIterator(const RenderBox*); - - RenderBox* currentChild() const { return m_currentChild; } - RenderBox* first(); - RenderBox* next(); - void reset(); - - private: - const RenderBox* m_containerBox; - - RenderBox* m_currentChild; - - typedef std::set OrderValues; - OrderValues m_orderValues; - OrderValues::const_iterator m_orderValuesIterator; - bool m_isReset; -}; - -class OrderIteratorPopulator { - public: - explicit OrderIteratorPopulator(OrderIterator& iterator) - : m_iterator(iterator) { - m_iterator.m_orderValues.clear(); - } - - ~OrderIteratorPopulator(); - - void collectChild(const RenderBox*); - - private: - OrderIterator& m_iterator; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_ORDERITERATOR_H_ diff --git a/sky/engine/core/rendering/PaintInfo.h b/sky/engine/core/rendering/PaintInfo.h deleted file mode 100644 index 9b2e5508005ea..0000000000000 --- a/sky/engine/core/rendering/PaintInfo.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. - * All rights reserved. - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ -#define SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ - -#include -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/ListHashSet.h" - -namespace blink { - -class RenderBox; -class RenderInline; -class RenderObject; - -/* - * Paint the object and its children, clipped by (x|y|w|h). - * (tx|ty) is the calculated position of the parent - */ -struct PaintInfo { - PaintInfo(GraphicsContext* newContext, - const IntRect& newRect, - const RenderBox* newPaintContainer) - : context(newContext), - rect(newRect), - m_paintContainer(newPaintContainer) {} - - void applyTransform(const AffineTransform& localToAncestorTransform, - bool identityStatusUnknown = true) { - if (identityStatusUnknown && localToAncestorTransform.isIdentity()) - return; - - context->concatCTM(localToAncestorTransform); - - if (rect == infiniteRect()) - return; - - if (localToAncestorTransform.isInvertible()) - rect = localToAncestorTransform.inverse().mapRect(rect); - else - rect.setSize(IntSize(0, 0)); - } - - static IntRect infiniteRect() { return IntRect(LayoutRect::infiniteRect()); } - const RenderBox* paintContainer() const { return m_paintContainer; } - - // FIXME: Introduce setters/getters at some point. Requires a lot of changes - // throughout rendering/. - GraphicsContext* context; - IntRect rect; - - private: - const RenderBox* m_paintContainer; // the layer object that originates the - // current painting -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_PAINTINFO_H_ diff --git a/sky/engine/core/rendering/PointerEventsHitRules.cpp b/sky/engine/core/rendering/PointerEventsHitRules.cpp deleted file mode 100644 index 695441829149c..0000000000000 --- a/sky/engine/core/rendering/PointerEventsHitRules.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - Copyright (C) 2007 Rob Buis - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - aint with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "flutter/sky/engine/core/rendering/PointerEventsHitRules.h" - -namespace blink { - -PointerEventsHitRules::PointerEventsHitRules(EHitTesting hitTesting, - const HitTestRequest& request, - EPointerEvents pointerEvents) - : requireVisible(false), - requireFill(false), - requireStroke(false), - canHitStroke(false), - canHitFill(false), - canHitBoundingBox(false) { - if (request.svgClipContent()) - pointerEvents = PE_FILL; - - if (hitTesting == SVG_GEOMETRY_HITTESTING) { - switch (pointerEvents) { - case PE_BOUNDINGBOX: - canHitBoundingBox = true; - break; - case PE_VISIBLE_PAINTED: - case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content - requireFill = true; - requireStroke = true; - case PE_VISIBLE: - requireVisible = true; - canHitFill = true; - canHitStroke = true; - break; - case PE_VISIBLE_FILL: - requireVisible = true; - canHitFill = true; - break; - case PE_VISIBLE_STROKE: - requireVisible = true; - canHitStroke = true; - break; - case PE_PAINTED: - requireFill = true; - requireStroke = true; - case PE_ALL: - canHitFill = true; - canHitStroke = true; - break; - case PE_FILL: - canHitFill = true; - break; - case PE_STROKE: - canHitStroke = true; - break; - case PE_NONE: - // nothing to do here, defaults are all false. - break; - } - } else { - switch (pointerEvents) { - case PE_BOUNDINGBOX: - canHitBoundingBox = true; - break; - case PE_VISIBLE_PAINTED: - case PE_AUTO: // "auto" is like "visiblePainted" when in SVG content - requireVisible = true; - requireFill = true; - requireStroke = true; - canHitFill = true; - canHitStroke = true; - break; - case PE_VISIBLE_FILL: - case PE_VISIBLE_STROKE: - case PE_VISIBLE: - requireVisible = true; - canHitFill = true; - canHitStroke = true; - break; - case PE_PAINTED: - requireFill = true; - requireStroke = true; - canHitFill = true; - canHitStroke = true; - break; - case PE_FILL: - case PE_STROKE: - case PE_ALL: - canHitFill = true; - canHitStroke = true; - break; - case PE_NONE: - // nothing to do here, defaults are all false. - break; - } - } -} - -} // namespace blink - -// vim:ts=4:noet diff --git a/sky/engine/core/rendering/PointerEventsHitRules.h b/sky/engine/core/rendering/PointerEventsHitRules.h deleted file mode 100644 index 65347917495d9..0000000000000 --- a/sky/engine/core/rendering/PointerEventsHitRules.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2007 Rob Buis - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - aint with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef SKY_ENGINE_CORE_RENDERING_POINTEREVENTSHITRULES_H_ -#define SKY_ENGINE_CORE_RENDERING_POINTEREVENTSHITRULES_H_ - -#include "flutter/sky/engine/core/rendering/HitTestRequest.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" - -namespace blink { - -class PointerEventsHitRules { - public: - enum EHitTesting { - SVG_IMAGE_HITTESTING, - SVG_GEOMETRY_HITTESTING, - SVG_TEXT_HITTESTING - }; - - PointerEventsHitRules(EHitTesting, const HitTestRequest&, EPointerEvents); - - bool requireVisible; - bool requireFill; - bool requireStroke; - bool canHitStroke; - bool canHitFill; - bool canHitBoundingBox; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_POINTEREVENTSHITRULES_H_ - -// vim:ts=4:noet diff --git a/sky/engine/core/rendering/RenderBlock.cpp b/sky/engine/core/rendering/RenderBlock.cpp deleted file mode 100644 index 0d9bc30869495..0000000000000 --- a/sky/engine/core/rendering/RenderBlock.cpp +++ /dev/null @@ -1,1724 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2007 David Smith (catfish.man@gmail.com) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. - * All rights reserved. - * Copyright (C) Research In Motion Limited 2010. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "flutter/sky/engine/core/rendering/RenderBlock.h" - -#include "flutter/sky/engine/core/rendering/HitTestLocation.h" -#include "flutter/sky/engine/core/rendering/HitTestResult.h" -#include "flutter/sky/engine/core/rendering/InlineIterator.h" -#include "flutter/sky/engine/core/rendering/InlineTextBox.h" -#include "flutter/sky/engine/core/rendering/PaintInfo.h" -#include "flutter/sky/engine/core/rendering/RenderFlexibleBox.h" -#include "flutter/sky/engine/core/rendering/RenderInline.h" -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderObjectInlines.h" -#include "flutter/sky/engine/core/rendering/RenderParagraph.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/TransformState.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/TemporaryChange.h" - -using namespace WTF; -using namespace Unicode; - -namespace blink { - -struct SameSizeAsRenderBlock : public RenderBox { - RenderObjectChildList children; - RenderLineBoxList lineBoxes; - int pageLogicalOffset; - uint32_t bitfields; -}; - -COMPILE_ASSERT(sizeof(RenderBlock) == sizeof(SameSizeAsRenderBlock), - RenderBlock_should_stay_small); - -static TrackedDescendantsMap* gPositionedDescendantsMap = 0; -static TrackedDescendantsMap* gPercentHeightDescendantsMap = 0; - -static TrackedContainerMap* gPositionedContainerMap = 0; -static TrackedContainerMap* gPercentHeightContainerMap = 0; - -RenderBlock::RenderBlock() - : m_hasMarginBeforeQuirk(false), - m_hasMarginAfterQuirk(false), - m_beingDestroyed(false), - m_hasBorderOrPaddingLogicalWidthChanged(false) {} - -static void removeBlockFromDescendantAndContainerMaps( - RenderBlock* block, - TrackedDescendantsMap*& descendantMap, - TrackedContainerMap*& containerMap) { - if (OwnPtr descendantSet = - descendantMap->take(block)) { - TrackedRendererListHashSet::iterator end = descendantSet->end(); - for (TrackedRendererListHashSet::iterator descendant = - descendantSet->begin(); - descendant != end; ++descendant) { - TrackedContainerMap::iterator it = containerMap->find(*descendant); - ASSERT(it != containerMap->end()); - if (it == containerMap->end()) - continue; - HashSet* containerSet = it->value.get(); - ASSERT(containerSet->contains(block)); - containerSet->remove(block); - if (containerSet->isEmpty()) - containerMap->remove(it); - } - } -} - -void RenderBlock::removeFromGlobalMaps() { - if (gPercentHeightDescendantsMap) - removeBlockFromDescendantAndContainerMaps( - this, gPercentHeightDescendantsMap, gPercentHeightContainerMap); - if (gPositionedDescendantsMap) - removeBlockFromDescendantAndContainerMaps(this, gPositionedDescendantsMap, - gPositionedContainerMap); -} - -RenderBlock::~RenderBlock() { -#if !ENABLE(OILPAN) - removeFromGlobalMaps(); -#endif -} - -void RenderBlock::destroy() { - RenderBox::destroy(); -#if ENABLE(OILPAN) - removeFromGlobalMaps(); -#endif -} - -void RenderBlock::willBeDestroyed() { - // Mark as being destroyed to avoid trouble with merges in removeChild(). - m_beingDestroyed = true; - - // Make sure to destroy anonymous children first while they are still - // connected to the rest of the tree, so that they will properly dirty line - // boxes that they are removed from. Effects that do :before/:after only on - // hover could crash otherwise. - children()->destroyLeftoverChildren(); - - if (!documentBeingDestroyed()) { - if (!firstLineBox() && parent()) - parent()->dirtyLinesFromChangedChild(this); - } - - m_lineBoxes.deleteLineBoxes(); - - RenderBox::willBeDestroyed(); -} - -void RenderBlock::styleWillChange(StyleDifference diff, - const RenderStyle& newStyle) { - RenderStyle* oldStyle = style(); - - setReplaced(newStyle.isDisplayInlineType()); - - if (oldStyle && parent()) { - bool oldStyleIsContainer = oldStyle->position() != StaticPosition || - oldStyle->hasTransformRelatedProperty(); - bool newStyleIsContainer = newStyle.position() != StaticPosition || - newStyle.hasTransformRelatedProperty(); - - if (oldStyleIsContainer && !newStyleIsContainer) { - // Clear our positioned objects list. Our absolutely positioned - // descendants will be inserted into our containing block's positioned - // objects list during layout. - removePositionedObjects(0, NewContainingBlock); - } else if (!oldStyleIsContainer && newStyleIsContainer) { - // Remove our absolutely positioned descendants from their current - // containing block. They will be inserted into our positioned objects - // list during layout. - RenderObject* cb = parent(); - while (cb && - (cb->style()->position() == StaticPosition || - (cb->isInline() && !cb->isReplaced())) && - !cb->isRenderView()) { - cb = cb->parent(); - } - - if (cb->isRenderBlock()) - toRenderBlock(cb)->removePositionedObjects(this, NewContainingBlock); - } - } - - RenderBox::styleWillChange(diff, newStyle); -} - -static bool borderOrPaddingLogicalWidthChanged(const RenderStyle* oldStyle, - const RenderStyle* newStyle) { - return oldStyle->borderLeftWidth() != newStyle->borderLeftWidth() || - oldStyle->borderRightWidth() != newStyle->borderRightWidth() || - oldStyle->paddingLeft() != newStyle->paddingLeft() || - oldStyle->paddingRight() != newStyle->paddingRight(); -} - -void RenderBlock::styleDidChange(StyleDifference diff, - const RenderStyle* oldStyle) { - RenderBox::styleDidChange(diff, oldStyle); - - // It's possible for our border/padding to change, but for the overall logical - // width of the block to end up being the same. We keep track of this change - // so in layoutBlock, we can know to set relayoutChildren=true. - m_hasBorderOrPaddingLogicalWidthChanged = - oldStyle && diff.needsFullLayout() && needsLayout() && - borderOrPaddingLogicalWidthChanged(oldStyle, style()); -} - -void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild) { - ASSERT(isRenderParagraph() || !newChild->isInline()); - RenderBox::addChild(newChild, beforeChild); -} - -void RenderBlock::deleteLineBoxTree() { - ASSERT(!m_lineBoxes.firstLineBox()); -} - -void RenderBlock::removeChild(RenderObject* oldChild) { - RenderBox::removeChild(oldChild); - - // No need to waste time deleting the line box tree if we're getting - // destroyed. - if (documentBeingDestroyed()) - return; - - // If this was our last child be sure to clear out our line boxes. - if (!firstChild() && isRenderParagraph()) - deleteLineBoxTree(); -} - -bool RenderBlock::widthAvailableToChildrenHasChanged() { - bool widthAvailableToChildrenHasChanged = - m_hasBorderOrPaddingLogicalWidthChanged; - m_hasBorderOrPaddingLogicalWidthChanged = false; - - // If we use border-box sizing, have percentage padding, and our parent has - // changed width then the width available to our children has changed even - // though our own width has remained the same. - widthAvailableToChildrenHasChanged |= - style()->boxSizing() == BORDER_BOX && needsPreferredWidthsRecalculation(); - - return widthAvailableToChildrenHasChanged; -} - -bool RenderBlock::updateLogicalWidthAndColumnWidth() { - LayoutUnit oldWidth = logicalWidth(); - updateLogicalWidth(); - return oldWidth != logicalWidth() || widthAvailableToChildrenHasChanged(); -} - -void RenderBlock::addOverflowFromChildren() { - for (RenderBox* child = firstChildBox(); child; - child = child->nextSiblingBox()) { - if (!child->isFloatingOrOutOfFlowPositioned()) - addOverflowFromChild(child); - } -} - -void RenderBlock::computeOverflow(LayoutUnit oldClientAfterEdge, bool) { - m_overflow.clear(); - - // Add overflow from children. - addOverflowFromChildren(); - - // Add in the overflow from positioned objects. - addOverflowFromPositionedObjects(); - - if (hasOverflowClip()) { - // When we have overflow clip, propagate the original spillout since it will - // include collapsed bottom margins and bottom padding. Set the axis we - // don't care about to be 1, since we want this overflow to always be - // considered reachable. - LayoutRect clientRect(paddingBoxRect()); - LayoutRect rectToApply; - rectToApply = LayoutRect( - clientRect.x(), clientRect.y(), 1, - std::max(0, oldClientAfterEdge - clientRect.y())); - addLayoutOverflow(rectToApply); - if (hasRenderOverflow()) - m_overflow->setLayoutClientAfterEdge(oldClientAfterEdge); - } - - addVisualEffectOverflow(); -} - -void RenderBlock::addOverflowFromPositionedObjects() { - TrackedRendererListHashSet* positionedDescendants = positionedObjects(); - if (!positionedDescendants) - return; - - RenderBox* positionedObject; - TrackedRendererListHashSet::iterator end = positionedDescendants->end(); - for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(); - it != end; ++it) { - positionedObject = *it; - addOverflowFromChild(positionedObject, LayoutSize(positionedObject->x(), - positionedObject->y())); - } -} - -void RenderBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, - RenderBox* child) { - // FIXME: Technically percentage height objects only need a relayout if their - // percentage isn't going to be turned into an auto value. Add a method to - // determine this, so that we can avoid the relayout. - if (relayoutChildren || - (child->hasRelativeLogicalHeight() && !isRenderView())) - child->setChildNeedsLayout(MarkOnlyThis); - - // If relayoutChildren is set and the child has percentage padding or an - // embedded content box, we also need to invalidate the childs pref widths. - if (relayoutChildren && child->needsPreferredWidthsRecalculation()) - child->setPreferredLogicalWidthsDirty(MarkOnlyThis); -} - -void RenderBlock::simplifiedNormalFlowLayout() { - for (RenderBox* box = firstChildBox(); box; box = box->nextSiblingBox()) { - if (!box->isOutOfFlowPositioned()) - box->layoutIfNeeded(); - } -} - -bool RenderBlock::simplifiedLayout() { - // Check if we need to do a full layout. - if (normalChildNeedsLayout() || selfNeedsLayout()) - return false; - - // Check that we actually need to do a simplified layout. - if (!posChildNeedsLayout() && - !(needsSimplifiedNormalFlowLayout() || needsPositionedMovementLayout())) - return false; - - if (needsPositionedMovementLayout() && - !tryLayoutDoingPositionedMovementOnly()) - return false; - - // Lay out positioned descendants or objects that just need to recompute - // overflow. - if (needsSimplifiedNormalFlowLayout()) - simplifiedNormalFlowLayout(); - - if (posChildNeedsLayout() || needsPositionedMovementLayout()) - layoutPositionedObjects(false, needsPositionedMovementLayout() - ? ForcedLayoutAfterContainingBlockMoved - : DefaultLayout); - - // Recompute our overflow information. - // FIXME: We could do better here by computing a temporary overflow object - // from layoutPositionedObjects and only updating our overflow if we either - // used to have overflow or if the new temporary object has overflow. For now - // just always recompute overflow. This is no worse performance-wise than the - // old code that called rightmostPosition and lowestPosition on every relayout - // so it's not a regression. computeOverflow expects the bottom edge before we - // clamp our height. Since this information isn't available during - // simplifiedLayout, we cache the value in m_overflow. - LayoutUnit oldClientAfterEdge = hasRenderOverflow() - ? m_overflow->layoutClientAfterEdge() - : clientLogicalBottom(); - computeOverflow(oldClientAfterEdge, true); - - updateLayerTransformAfterLayout(); - - clearNeedsLayout(); - return true; -} - -LayoutUnit RenderBlock::marginIntrinsicLogicalWidthForChild( - RenderBox* child) const { - // A margin has three types: fixed, percentage, and auto (variable). - // Auto and percentage margins become 0 when computing min/max width. - // Fixed margins can be added in as is. - Length marginLeft = child->style()->marginStartUsing(style()); - Length marginRight = child->style()->marginEndUsing(style()); - LayoutUnit margin = 0; - if (marginLeft.isFixed()) - margin += marginLeft.value(); - if (marginRight.isFixed()) - margin += marginRight.value(); - return margin; -} - -void RenderBlock::layoutPositionedObjects(bool relayoutChildren, - PositionedLayoutBehavior info) { - TrackedRendererListHashSet* positionedDescendants = positionedObjects(); - if (!positionedDescendants) - return; - - RenderBox* r; - TrackedRendererListHashSet::iterator end = positionedDescendants->end(); - for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(); - it != end; ++it) { - r = *it; - - // If relayoutChildren is set and the child has percentage padding or an - // embedded content box, we also need to invalidate the childs pref widths. - if (relayoutChildren && r->needsPreferredWidthsRecalculation()) - r->setPreferredLogicalWidthsDirty(MarkOnlyThis); - - if (info == ForcedLayoutAfterContainingBlockMoved) - r->setNeedsPositionedMovementLayout(); - - r->layoutIfNeeded(); - } -} - -void RenderBlock::markPositionedObjectsForLayout() { - if (TrackedRendererListHashSet* positionedDescendants = positionedObjects()) { - TrackedRendererListHashSet::iterator end = positionedDescendants->end(); - for (TrackedRendererListHashSet::iterator it = - positionedDescendants->begin(); - it != end; ++it) - (*it)->setChildNeedsLayout(); - } -} - -void RenderBlock::paint(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - Vector& layers) { - LayoutPoint adjustedPaintOffset = paintOffset + location(); - - LayoutRect overflowBox = visualOverflowRect(); - overflowBox.moveBy(adjustedPaintOffset); - if (!overflowBox.intersects(paintInfo.rect)) - return; - - // There are some cases where not all clipped visual overflow is accounted - // for. - // FIXME: reduce the number of such cases. - ContentsClipBehavior contentsClipBehavior = ForceContentsClip; - if (hasOverflowClip() && !shouldPaintSelectionGaps()) - contentsClipBehavior = SkipContentsClipIfPossible; - - bool pushedClip = - pushContentsClip(paintInfo, adjustedPaintOffset, contentsClipBehavior); - paintObject(paintInfo, adjustedPaintOffset, layers); - if (pushedClip) - popContentsClip(paintInfo, adjustedPaintOffset); -} - -void RenderBlock::paintChildren(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - Vector& layers) { - for (RenderBox* child = firstChildBox(); child; - child = child->nextSiblingBox()) { - if (child->hasSelfPaintingLayer()) - layers.append(child); - else - child->paint(paintInfo, paintOffset, layers); - } -} - -void RenderBlock::paintObject(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - Vector& layers) { - if (hasBoxDecorationBackground()) - paintBoxDecorationBackground(paintInfo, paintOffset); - - paintChildren(paintInfo, paintOffset, layers); - paintSelection( - paintInfo, - paintOffset); // Fill in gaps in selection on lines and between blocks. -} - -bool RenderBlock::shouldPaintSelectionGaps() const { - return selectionState() != SelectionNone && isSelectionRoot(); -} - -bool RenderBlock::isSelectionRoot() const { - return false; -} - -void RenderBlock::paintSelection(PaintInfo& paintInfo, - const LayoutPoint& paintOffset) { - if (shouldPaintSelectionGaps()) { - LayoutUnit lastTop = 0; - LayoutUnit lastLeft = logicalLeftSelectionOffset(this, lastTop); - LayoutUnit lastRight = logicalRightSelectionOffset(this, lastTop); - GraphicsContextStateSaver stateSaver(*paintInfo.context); - - // TODO(ojan): In sky, we don't use the return value, but we - // need this in order to actually paint selection gaps. - // We should rename it appropriately. - selectionGaps(this, paintOffset, LayoutSize(), lastTop, lastLeft, lastRight, - &paintInfo); - } -} - -static void clipOutPositionedObjects( - const PaintInfo* paintInfo, - const LayoutPoint& offset, - TrackedRendererListHashSet* positionedObjects) { - if (!positionedObjects) - return; - - TrackedRendererListHashSet::const_iterator end = positionedObjects->end(); - for (TrackedRendererListHashSet::const_iterator it = - positionedObjects->begin(); - it != end; ++it) { - RenderBox* r = *it; - paintInfo->context->clipOut(IntRect( - offset.x() + r->x(), offset.y() + r->y(), r->width(), r->height())); - } -} - -LayoutUnit RenderBlock::blockDirectionOffset( - const LayoutSize& offsetFromBlock) const { - // FIXME(sky): Remove - return offsetFromBlock.height(); -} - -LayoutUnit RenderBlock::inlineDirectionOffset( - const LayoutSize& offsetFromBlock) const { - // FIXME(sky): Remove - return offsetFromBlock.width(); -} - -LayoutRect RenderBlock::logicalRectToPhysicalRect( - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutRect& logicalRect) { - LayoutRect result = logicalRect; - result.moveBy(rootBlockPhysicalPosition); - return result; -} - -GapRects RenderBlock::selectionGaps( - RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - LayoutUnit& lastLogicalTop, - LayoutUnit& lastLogicalLeft, - LayoutUnit& lastLogicalRight, - const PaintInfo* paintInfo) { - // IMPORTANT: Callers of this method that intend for painting to happen need - // to do a save/restore. Clip out floating and positioned objects when - // painting selection gaps. - if (paintInfo) { - // Note that we don't clip out overflow for positioned objects. We just - // stick to the border box. - LayoutRect blockRect(offsetFromRootBlock.width(), - offsetFromRootBlock.height(), width(), height()); - blockRect.moveBy(rootBlockPhysicalPosition); - clipOutPositionedObjects(paintInfo, blockRect.location(), - positionedObjects()); - } - - // FIXME: overflow: auto/scroll regions need more math here, since painting in - // the border box is different from painting in the padding box (one is - // scrolled, the other is fixed). - GapRects result; - if (!isRenderParagraph()) // FIXME: Make multi-column selection gap filling - // work someday. - return result; - - if (hasTransform()) { - // FIXME: We should learn how to gap fill multiple columns and transforms - // eventually. - lastLogicalTop = - rootBlock->blockDirectionOffset(offsetFromRootBlock) + logicalHeight(); - lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, logicalHeight()); - lastLogicalRight = logicalRightSelectionOffset(rootBlock, logicalHeight()); - return result; - } - - if (isRenderParagraph()) - result = toRenderParagraph(this)->inlineSelectionGaps( - rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, - lastLogicalTop, lastLogicalLeft, lastLogicalRight, paintInfo); - else - result = blockSelectionGaps(rootBlock, rootBlockPhysicalPosition, - offsetFromRootBlock, lastLogicalTop, - lastLogicalLeft, lastLogicalRight, paintInfo); - - // Go ahead and fill the vertical gap all the way to the bottom of our block - // if the selection extends past our block. - if (rootBlock == this && - (selectionState() != SelectionBoth && selectionState() != SelectionEnd)) - result.uniteCenter(blockSelectionGap(rootBlock, rootBlockPhysicalPosition, - offsetFromRootBlock, lastLogicalTop, - lastLogicalLeft, lastLogicalRight, - logicalHeight(), paintInfo)); - return result; -} - -GapRects RenderBlock::blockSelectionGaps( - RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - LayoutUnit& lastLogicalTop, - LayoutUnit& lastLogicalLeft, - LayoutUnit& lastLogicalRight, - const PaintInfo* paintInfo) { - GapRects result; - - // Go ahead and jump right to the first block child that contains some - // selected objects. - RenderBox* curr; - for (curr = firstChildBox(); curr && curr->selectionState() == SelectionNone; - curr = curr->nextSiblingBox()) { - } - - for (bool sawSelectionEnd = false; curr && !sawSelectionEnd; - curr = curr->nextSiblingBox()) { - SelectionState childState = curr->selectionState(); - if (childState == SelectionBoth || childState == SelectionEnd) - sawSelectionEnd = true; - - if (curr->isFloatingOrOutOfFlowPositioned()) - continue; // We must be a normal flow object in order to even be - // considered. - - bool paintsOwnSelection = curr->shouldPaintSelectionGaps(); - bool fillBlockGaps = paintsOwnSelection || (curr->canBeSelectionLeaf() && - childState != SelectionNone); - if (fillBlockGaps) { - // We need to fill the vertical gap above this object. - if (childState == SelectionEnd || childState == SelectionInside) - // Fill the gap above the object. - result.uniteCenter(blockSelectionGap( - rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, - lastLogicalTop, lastLogicalLeft, lastLogicalRight, - curr->logicalTop(), paintInfo)); - - // Only fill side gaps for objects that paint their own selection if we - // know for sure the selection is going to extend all the way *past* our - // object. We know this if the selection did not end inside our object. - if (paintsOwnSelection && - (childState == SelectionStart || sawSelectionEnd)) - childState = SelectionNone; - - // Fill side gaps on this object based off its state. - bool leftGap, rightGap; - getSelectionGapInfo(childState, leftGap, rightGap); - - if (leftGap) - result.uniteLeft(logicalLeftSelectionGap( - rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, this, - curr->logicalLeft(), curr->logicalTop(), curr->logicalHeight(), - paintInfo)); - if (rightGap) - result.uniteRight(logicalRightSelectionGap( - rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, this, - curr->logicalRight(), curr->logicalTop(), curr->logicalHeight(), - paintInfo)); - - // Update lastLogicalTop to be just underneath the object. - // lastLogicalLeft and lastLogicalRight extend as far as they can without - // bumping into floating or positioned objects. Ideally they will go - // right up to the border of the root selection block. - lastLogicalTop = rootBlock->blockDirectionOffset(offsetFromRootBlock) + - curr->logicalBottom(); - lastLogicalLeft = - logicalLeftSelectionOffset(rootBlock, curr->logicalBottom()); - lastLogicalRight = - logicalRightSelectionOffset(rootBlock, curr->logicalBottom()); - } else if (childState != SelectionNone) - // We must be a block that has some selected object inside it. Go ahead - // and recur. - result.unite(toRenderBlock(curr)->selectionGaps( - rootBlock, rootBlockPhysicalPosition, - LayoutSize(offsetFromRootBlock.width() + curr->x(), - offsetFromRootBlock.height() + curr->y()), - lastLogicalTop, lastLogicalLeft, lastLogicalRight, paintInfo)); - } - return result; -} - -IntRect alignSelectionRectToDevicePixels(LayoutRect& rect) { - LayoutUnit roundedX = rect.x().round(); - return IntRect(roundedX, rect.y().round(), (rect.maxX() - roundedX).round(), - snapSizeToPixel(rect.height(), rect.y())); -} - -LayoutRect RenderBlock::blockSelectionGap( - RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - LayoutUnit lastLogicalTop, - LayoutUnit lastLogicalLeft, - LayoutUnit lastLogicalRight, - LayoutUnit logicalBottom, - const PaintInfo* paintInfo) { - LayoutUnit logicalTop = lastLogicalTop; - LayoutUnit logicalHeight = - rootBlock->blockDirectionOffset(offsetFromRootBlock) + logicalBottom - - logicalTop; - if (logicalHeight <= 0) - return LayoutRect(); - - // Get the selection offsets for the bottom of the gap - LayoutUnit logicalLeft = std::max( - lastLogicalLeft, logicalLeftSelectionOffset(rootBlock, logicalBottom)); - LayoutUnit logicalRight = std::min( - lastLogicalRight, logicalRightSelectionOffset(rootBlock, logicalBottom)); - LayoutUnit logicalWidth = logicalRight - logicalLeft; - if (logicalWidth <= 0) - return LayoutRect(); - - LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect( - rootBlockPhysicalPosition, - LayoutRect(logicalLeft, logicalTop, logicalWidth, logicalHeight)); - if (paintInfo) - paintInfo->context->fillRect(alignSelectionRectToDevicePixels(gapRect), - selectionBackgroundColor()); - return gapRect; -} - -LayoutRect RenderBlock::logicalLeftSelectionGap( - RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - RenderObject* selObj, - LayoutUnit logicalLeft, - LayoutUnit logicalTop, - LayoutUnit logicalHeight, - const PaintInfo* paintInfo) { - LayoutUnit rootBlockLogicalTop = - rootBlock->blockDirectionOffset(offsetFromRootBlock) + logicalTop; - LayoutUnit rootBlockLogicalLeft = std::max( - logicalLeftSelectionOffset(rootBlock, logicalTop), - logicalLeftSelectionOffset(rootBlock, logicalTop + logicalHeight)); - LayoutUnit rootBlockLogicalRight = std::min( - rootBlock->inlineDirectionOffset(offsetFromRootBlock) + logicalLeft, - std::min( - logicalRightSelectionOffset(rootBlock, logicalTop), - logicalRightSelectionOffset(rootBlock, logicalTop + logicalHeight))); - LayoutUnit rootBlockLogicalWidth = - rootBlockLogicalRight - rootBlockLogicalLeft; - if (rootBlockLogicalWidth <= 0) - return LayoutRect(); - - LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect( - rootBlockPhysicalPosition, - LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, - rootBlockLogicalWidth, logicalHeight)); - if (paintInfo) - paintInfo->context->fillRect(alignSelectionRectToDevicePixels(gapRect), - selObj->selectionBackgroundColor()); - return gapRect; -} - -LayoutRect RenderBlock::logicalRightSelectionGap( - RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - RenderObject* selObj, - LayoutUnit logicalRight, - LayoutUnit logicalTop, - LayoutUnit logicalHeight, - const PaintInfo* paintInfo) { - LayoutUnit rootBlockLogicalTop = - rootBlock->blockDirectionOffset(offsetFromRootBlock) + logicalTop; - LayoutUnit rootBlockLogicalLeft = std::max( - rootBlock->inlineDirectionOffset(offsetFromRootBlock) + logicalRight, - max(logicalLeftSelectionOffset(rootBlock, logicalTop), - logicalLeftSelectionOffset(rootBlock, logicalTop + logicalHeight))); - LayoutUnit rootBlockLogicalRight = std::min( - logicalRightSelectionOffset(rootBlock, logicalTop), - logicalRightSelectionOffset(rootBlock, logicalTop + logicalHeight)); - LayoutUnit rootBlockLogicalWidth = - rootBlockLogicalRight - rootBlockLogicalLeft; - if (rootBlockLogicalWidth <= 0) - return LayoutRect(); - - LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect( - rootBlockPhysicalPosition, - LayoutRect(rootBlockLogicalLeft, rootBlockLogicalTop, - rootBlockLogicalWidth, logicalHeight)); - if (paintInfo) - paintInfo->context->fillRect(alignSelectionRectToDevicePixels(gapRect), - selObj->selectionBackgroundColor()); - return gapRect; -} - -void RenderBlock::getSelectionGapInfo(SelectionState state, - bool& leftGap, - bool& rightGap) { - bool ltr = style()->isLeftToRightDirection(); - leftGap = (state == RenderObject::SelectionInside) || - (state == RenderObject::SelectionEnd && ltr) || - (state == RenderObject::SelectionStart && !ltr); - rightGap = (state == RenderObject::SelectionInside) || - (state == RenderObject::SelectionStart && ltr) || - (state == RenderObject::SelectionEnd && !ltr); -} - -LayoutUnit RenderBlock::logicalLeftSelectionOffset(RenderBlock* rootBlock, - LayoutUnit position) { - // The border can potentially be further extended by our containingBlock(). - if (rootBlock != this) - return containingBlock()->logicalLeftSelectionOffset( - rootBlock, position + logicalTop()); - return logicalLeftOffsetForContent(); -} - -LayoutUnit RenderBlock::logicalRightSelectionOffset(RenderBlock* rootBlock, - LayoutUnit position) { - // The border can potentially be further extended by our containingBlock(). - if (rootBlock != this) - return containingBlock()->logicalRightSelectionOffset( - rootBlock, position + logicalTop()); - return logicalRightOffsetForContent(); -} - -RenderBlock* RenderBlock::blockBeforeWithinSelectionRoot( - LayoutSize& offset) const { - if (isSelectionRoot()) - return 0; - - const RenderObject* object = this; - RenderObject* sibling; - do { - sibling = object->previousSibling(); - while (sibling && (!sibling->isRenderBlock() || - toRenderBlock(sibling)->isSelectionRoot())) - sibling = sibling->previousSibling(); - - offset -= LayoutSize(toRenderBlock(object)->logicalLeft(), - toRenderBlock(object)->logicalTop()); - object = object->parent(); - } while (!sibling && object && object->isRenderBlock() && - !toRenderBlock(object)->isSelectionRoot()); - - if (!sibling) - return 0; - - RenderBlock* beforeBlock = toRenderBlock(sibling); - - offset += LayoutSize(beforeBlock->logicalLeft(), beforeBlock->logicalTop()); - - RenderObject* child = beforeBlock->lastChild(); - while (child && child->isRenderBlock()) { - beforeBlock = toRenderBlock(child); - offset += LayoutSize(beforeBlock->logicalLeft(), beforeBlock->logicalTop()); - child = beforeBlock->lastChild(); - } - return beforeBlock; -} - -void RenderBlock::setSelectionState(SelectionState state) { - RenderBox::setSelectionState(state); - - if (inlineBoxWrapper() && canUpdateSelectionOnRootLineBoxes()) - inlineBoxWrapper()->root().setHasSelectedChildren(state != SelectionNone); -} - -void RenderBlock::insertIntoTrackedRendererMaps( - RenderBox* descendant, - TrackedDescendantsMap*& descendantsMap, - TrackedContainerMap*& containerMap) { - if (!descendantsMap) { - descendantsMap = new TrackedDescendantsMap; - containerMap = new TrackedContainerMap; - } - - TrackedRendererListHashSet* descendantSet = descendantsMap->get(this); - if (!descendantSet) { - descendantSet = new TrackedRendererListHashSet; - descendantsMap->set(this, adoptPtr(descendantSet)); - } - bool added = descendantSet->add(descendant).isNewEntry; - if (!added) { - ASSERT(containerMap->get(descendant)); - ASSERT(containerMap->get(descendant)->contains(this)); - return; - } - - HashSet* containerSet = containerMap->get(descendant); - if (!containerSet) { - containerSet = new HashSet; - containerMap->set(descendant, adoptPtr(containerSet)); - } - ASSERT(!containerSet->contains(this)); - containerSet->add(this); -} - -void RenderBlock::removeFromTrackedRendererMaps( - RenderBox* descendant, - TrackedDescendantsMap*& descendantsMap, - TrackedContainerMap*& containerMap) { - if (!descendantsMap) - return; - - OwnPtr> containerSet = containerMap->take(descendant); - if (!containerSet) - return; - - HashSet::iterator end = containerSet->end(); - for (HashSet::iterator it = containerSet->begin(); it != end; - ++it) { - RenderBlock* container = *it; - - // FIXME: Disabling this assert temporarily until we fix the layout - // bugs associated with positioned objects not properly cleared from - // their ancestor chain before being moved. See webkit bug 93766. - // ASSERT(descendant->isDescendantOf(container)); - - TrackedDescendantsMap::iterator descendantsMapIterator = - descendantsMap->find(container); - ASSERT(descendantsMapIterator != descendantsMap->end()); - if (descendantsMapIterator == descendantsMap->end()) - continue; - TrackedRendererListHashSet* descendantSet = - descendantsMapIterator->value.get(); - ASSERT(descendantSet->contains(descendant)); - descendantSet->remove(descendant); - if (descendantSet->isEmpty()) - descendantsMap->remove(descendantsMapIterator); - } -} - -TrackedRendererListHashSet* RenderBlock::positionedObjects() const { - if (gPositionedDescendantsMap) - return gPositionedDescendantsMap->get(this); - return 0; -} - -void RenderBlock::insertPositionedObject(RenderBox* o) { - insertIntoTrackedRendererMaps(o, gPositionedDescendantsMap, - gPositionedContainerMap); -} - -void RenderBlock::removePositionedObject(RenderBox* o) { - removeFromTrackedRendererMaps(o, gPositionedDescendantsMap, - gPositionedContainerMap); -} - -void RenderBlock::removePositionedObjects( - RenderBlock* o, - ContainingBlockState containingBlockState) { - TrackedRendererListHashSet* positionedDescendants = positionedObjects(); - if (!positionedDescendants) - return; - - RenderBox* r; - - TrackedRendererListHashSet::iterator end = positionedDescendants->end(); - - Vector deadObjects; - - for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(); - it != end; ++it) { - r = *it; - if (!o || r->isDescendantOf(o)) { - if (containingBlockState == NewContainingBlock) - r->setChildNeedsLayout(MarkOnlyThis); - - // It is parent blocks job to add positioned child to positioned objects - // list of its containing block Parent layout needs to be invalidated to - // ensure this happens. - RenderObject* p = r->parent(); - while (p && !p->isRenderBlock()) - p = p->parent(); - if (p) - p->setChildNeedsLayout(); - - deadObjects.append(r); - } - } - - for (unsigned i = 0; i < deadObjects.size(); i++) - removePositionedObject(deadObjects.at(i)); -} - -void RenderBlock::addPercentHeightDescendant(RenderBox* descendant) { - insertIntoTrackedRendererMaps(descendant, gPercentHeightDescendantsMap, - gPercentHeightContainerMap); -} - -void RenderBlock::removePercentHeightDescendant(RenderBox* descendant) { - removeFromTrackedRendererMaps(descendant, gPercentHeightDescendantsMap, - gPercentHeightContainerMap); -} - -TrackedRendererListHashSet* RenderBlock::percentHeightDescendants() const { - return gPercentHeightDescendantsMap ? gPercentHeightDescendantsMap->get(this) - : 0; -} - -bool RenderBlock::hasPercentHeightContainerMap() { - return gPercentHeightContainerMap; -} - -bool RenderBlock::hasPercentHeightDescendant(RenderBox* descendant) { - // We don't null check gPercentHeightContainerMap since the caller - // already ensures this and we need to call this function on every - // descendant in clearPercentHeightDescendantsFrom(). - ASSERT(gPercentHeightContainerMap); - return gPercentHeightContainerMap->contains(descendant); -} - -void RenderBlock::dirtyForLayoutFromPercentageHeightDescendants( - SubtreeLayoutScope& layoutScope) { - if (!gPercentHeightDescendantsMap) - return; - - TrackedRendererListHashSet* descendants = - gPercentHeightDescendantsMap->get(this); - if (!descendants) - return; - - TrackedRendererListHashSet::iterator end = descendants->end(); - for (TrackedRendererListHashSet::iterator it = descendants->begin(); - it != end; ++it) { - RenderBox* box = *it; - while (box != this) { - if (box->normalChildNeedsLayout()) - break; - layoutScope.setChildNeedsLayout(box); - box = box->containingBlock(); - ASSERT(box); - if (!box) - break; - } - } -} - -void RenderBlock::removePercentHeightDescendantIfNeeded(RenderBox* descendant) { - // We query the map directly, rather than looking at style's - // logicalHeight()/logicalMinHeight()/logicalMaxHeight() since those - // can change with writing mode/directional changes. - if (!hasPercentHeightContainerMap()) - return; - - if (!hasPercentHeightDescendant(descendant)) - return; - - removePercentHeightDescendant(descendant); -} - -void RenderBlock::clearPercentHeightDescendantsFrom(RenderBox* parent) { - ASSERT(gPercentHeightContainerMap); - for (RenderObject* curr = parent->slowFirstChild(); curr; - curr = curr->nextInPreOrder(parent)) { - if (!curr->isBox()) - continue; - - RenderBox* box = toRenderBox(curr); - if (!hasPercentHeightDescendant(box)) - continue; - - removePercentHeightDescendant(box); - } -} - -LayoutUnit RenderBlock::textIndentOffset() const { - LayoutUnit cw = 0; - if (style()->textIndent().isPercent()) - cw = containingBlock()->availableLogicalWidth(); - return minimumValueForLength(style()->textIndent(), cw); -} - -bool RenderBlock::nodeAtPoint(const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) { - LayoutPoint adjustedLocation(accumulatedOffset + location()); - LayoutSize localOffset = toLayoutSize(adjustedLocation); - - if (!isRenderView()) { - // Check if we need to do anything at all. - // If we have clipping, then we can't have any spillout. - LayoutRect overflowBox = - hasOverflowClip() ? borderBoxRect() : visualOverflowRect(); - overflowBox.moveBy(adjustedLocation); - if (!locationInContainer.intersects(overflowBox)) - return false; - } - - if (style()->clipPath()) { - switch (style()->clipPath()->type()) { - case ClipPathOperation::SHAPE: - break; - case ClipPathOperation::REFERENCE: - break; - } - } - - // If we have clipping, then we can't have any spillout. - bool useOverflowClip = hasOverflowClip() && !hasSelfPaintingLayer(); - bool checkChildren = !useOverflowClip; - if (!checkChildren) { - LayoutRect clipRect = overflowClipRect(adjustedLocation); - if (style()->hasBorderRadius()) - checkChildren = locationInContainer.intersects( - style()->getRoundedBorderFor(clipRect)); - else - checkChildren = locationInContainer.intersects(clipRect); - } - if (checkChildren) { - if (hitTestContents(request, result, locationInContainer, - toLayoutPoint(localOffset))) { - updateHitTestResult(result, locationInContainer.point() - localOffset); - return true; - } - } - - // Check if the point is outside radii. - if (style()->hasBorderRadius()) { - LayoutRect borderRect = borderBoxRect(); - borderRect.moveBy(adjustedLocation); - RoundedRect border = style()->getRoundedBorderFor(borderRect); - if (!locationInContainer.intersects(border)) - return false; - } - - // Now hit test our background - LayoutRect boundsRect(adjustedLocation, size()); - if (visibleToHitTestRequest(request) && - locationInContainer.intersects(boundsRect)) { - updateHitTestResult(result, locationInContainer.point() - localOffset); - return true; - } - - return false; -} - -bool RenderBlock::hitTestContents(const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) { - for (RenderBox* child = lastChildBox(); child; - child = child->previousSiblingBox()) { - if (!child->hasSelfPaintingLayer() && - child->nodeAtPoint(request, result, locationInContainer, - accumulatedOffset)) - return true; - } - - return false; -} - -static PositionWithAffinity positionForPointInChild( - RenderBox* child, - const LayoutPoint& pointInParentCoordinates) { - LayoutPoint childLocation = child->location(); - - // FIXME: This is wrong if the child's writing-mode is different from the - // parent's. - LayoutPoint pointInChildCoordinates( - toLayoutPoint(pointInParentCoordinates - childLocation)); - return child->positionForPoint(pointInChildCoordinates); -} - -PositionWithAffinity RenderBlock::positionForPointWithInlineChildren( - const LayoutPoint& pointInLogicalContents) { - ASSERT(isRenderParagraph()); - - if (!firstRootBox()) - return createPositionWithAffinity(0, DOWNSTREAM); - - // look for the closest line box in the root box which is at the passed-in y - // coordinate - InlineBox* closestBox = 0; - RootInlineBox* firstRootBoxWithChildren = 0; - RootInlineBox* lastRootBoxWithChildren = 0; - for (RootInlineBox* root = firstRootBox(); root; root = root->nextRootBox()) { - if (!root->firstLeafChild()) - continue; - if (!firstRootBoxWithChildren) - firstRootBoxWithChildren = root; - - lastRootBoxWithChildren = root; - - // check if this root line box is located at this y coordinate - if (pointInLogicalContents.y() < root->selectionBottom()) { - closestBox = root->closestLeafChildForLogicalLeftPosition( - pointInLogicalContents.x()); - if (closestBox) - break; - } - } - - if (!closestBox && lastRootBoxWithChildren) { - // y coordinate is below last root line box, pretend we hit it - closestBox = - lastRootBoxWithChildren->closestLeafChildForLogicalLeftPosition( - pointInLogicalContents.x()); - } - - if (closestBox) { - // pass the box a top position that is inside it - LayoutPoint point(pointInLogicalContents.x(), - closestBox->root().blockDirectionPointInLine()); - if (closestBox->renderer().isReplaced()) - return positionForPointInChild(&toRenderBox(closestBox->renderer()), - point); - return closestBox->renderer().positionForPoint(point); - } - - // Can't reach this. We have a root line box, but it has no kids. - // FIXME: This should ASSERT_NOT_REACHED(), but clicking on placeholder text - // seems to hit this code path. - return createPositionWithAffinity(0, DOWNSTREAM); -} - -static inline bool isChildHitTestCandidate(RenderBox* box) { - return box->height() && !box->isFloatingOrOutOfFlowPositioned(); -} - -PositionWithAffinity RenderBlock::positionForPoint(const LayoutPoint& point) { - if (isReplaced()) { - // FIXME: This seems wrong when the object's writing-mode doesn't match the - // line's writing-mode. - LayoutUnit pointLogicalLeft = point.x(); - LayoutUnit pointLogicalTop = point.y(); - - if (pointLogicalLeft < 0) - return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); - if (pointLogicalLeft >= logicalWidth()) - return createPositionWithAffinity(caretMaxOffset(), DOWNSTREAM); - if (pointLogicalTop < 0) - return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); - if (pointLogicalTop >= logicalHeight()) - return createPositionWithAffinity(caretMaxOffset(), DOWNSTREAM); - } - - LayoutPoint pointInContents = point; - LayoutPoint pointInLogicalContents(pointInContents); - - if (isRenderParagraph()) - return positionForPointWithInlineChildren(pointInLogicalContents); - - RenderBox* lastCandidateBox = lastChildBox(); - while (lastCandidateBox && !isChildHitTestCandidate(lastCandidateBox)) - lastCandidateBox = lastCandidateBox->previousSiblingBox(); - - if (lastCandidateBox) { - if (pointInLogicalContents.y() > logicalTopForChild(lastCandidateBox) || - (pointInLogicalContents.y() == logicalTopForChild(lastCandidateBox))) - return positionForPointInChild(lastCandidateBox, pointInContents); - - for (RenderBox* childBox = firstChildBox(); childBox; - childBox = childBox->nextSiblingBox()) { - if (!isChildHitTestCandidate(childBox)) - continue; - LayoutUnit childLogicalBottom = - logicalTopForChild(childBox) + logicalHeightForChild(childBox); - // We hit child if our click is above the bottom of its padding box (like - // IE6/7 and FF3). - if (isChildHitTestCandidate(childBox) && - (pointInLogicalContents.y() < childLogicalBottom)) - return positionForPointInChild(childBox, pointInContents); - } - } - - // We only get here if there are no hit test candidate children below the - // click. - return RenderBox::positionForPoint(point); -} - -LayoutUnit RenderBlock::availableLogicalWidth() const { - return RenderBox::availableLogicalWidth(); -} - -void RenderBlock::computePreferredLogicalWidths() { - ASSERT(preferredLogicalWidthsDirty()); - - m_minPreferredLogicalWidth = 0; - m_maxPreferredLogicalWidth = 0; - - // FIXME: The isFixed() calls here should probably be checking for isSpecified - // since you should be able to use percentage, calc or viewport relative - // values for width. - RenderStyle* styleToUse = style(); - if (styleToUse->logicalWidth().isFixed() && - styleToUse->logicalWidth().value() >= 0) - m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = - adjustContentBoxLogicalWidthForBoxSizing( - styleToUse->logicalWidth().value()); - else - computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, - m_maxPreferredLogicalWidth); - - if (styleToUse->logicalMinWidth().isFixed() && - styleToUse->logicalMinWidth().value() > 0) { - m_maxPreferredLogicalWidth = std::max( - m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( - styleToUse->logicalMinWidth().value())); - m_minPreferredLogicalWidth = std::max( - m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( - styleToUse->logicalMinWidth().value())); - } - - if (styleToUse->logicalMaxWidth().isFixed()) { - m_maxPreferredLogicalWidth = std::min( - m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( - styleToUse->logicalMaxWidth().value())); - m_minPreferredLogicalWidth = std::min( - m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( - styleToUse->logicalMaxWidth().value())); - } - - LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth(); - m_minPreferredLogicalWidth += borderAndPadding; - m_maxPreferredLogicalWidth += borderAndPadding; - - clearPreferredLogicalWidthsDirty(); -} - -void RenderBlock::computeIntrinsicLogicalWidths( - LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const { - RenderStyle* styleToUse = style(); - bool nowrap = styleToUse->whiteSpace() == NOWRAP; - - RenderObject* child = firstChild(); - while (child) { - // Positioned children don't affect the min/max width - if (child->isOutOfFlowPositioned()) { - child = child->nextSibling(); - continue; - } - - RefPtr childStyle = child->style(); - - // A margin basically has three types: fixed, percentage, and auto - // (variable). Auto and percentage margins simply become 0 when computing - // min/max width. Fixed margins can be added in as is. - Length startMarginLength = childStyle->marginStartUsing(styleToUse); - Length endMarginLength = childStyle->marginEndUsing(styleToUse); - LayoutUnit margin = 0; - LayoutUnit marginStart = 0; - LayoutUnit marginEnd = 0; - if (startMarginLength.isFixed()) - marginStart += startMarginLength.value(); - if (endMarginLength.isFixed()) - marginEnd += endMarginLength.value(); - margin = marginStart + marginEnd; - - LayoutUnit childMinPreferredLogicalWidth = - child->minPreferredLogicalWidth(); - LayoutUnit childMaxPreferredLogicalWidth = - child->maxPreferredLogicalWidth(); - - LayoutUnit w = childMinPreferredLogicalWidth + margin; - minLogicalWidth = std::max(w, minLogicalWidth); - - // IE ignores tables for calculation of nowrap. Makes some sense. - if (nowrap) - maxLogicalWidth = std::max(w, maxLogicalWidth); - - w = childMaxPreferredLogicalWidth + margin; - - maxLogicalWidth = std::max(w, maxLogicalWidth); - - child = child->nextSibling(); - } - - // Always make sure these values are non-negative. - minLogicalWidth = std::max(0, minLogicalWidth); - maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); -} - -bool RenderBlock::hasLineIfEmpty() const { - return false; -} - -LayoutUnit RenderBlock::lineHeight(bool firstLine, - LineDirectionMode direction, - LinePositionMode linePositionMode) const { - // Inline blocks are replaced elements. Otherwise, just pass off to - // the base class. If we're being queried as though we're the root line - // box, then the fact that we're an inline-block is irrelevant, and we behave - // just like a block. - if (isReplaced() && linePositionMode == PositionOnContainingLine) - return RenderBox::lineHeight(firstLine, direction, linePositionMode); - return style()->computedLineHeight(); -} - -int RenderBlock::beforeMarginInLineDirection( - LineDirectionMode direction) const { - return direction == HorizontalLine ? marginTop() : marginRight(); -} - -int RenderBlock::baselinePosition(FontBaseline baselineType, - bool firstLine, - LineDirectionMode direction, - LinePositionMode linePositionMode) const { - // Inline blocks are replaced elements. Otherwise, just pass off to - // the base class. If we're being queried as though we're the root line - // box, then the fact that we're an inline-block is irrelevant, and we behave - // just like a block. - if (isInline() && linePositionMode == PositionOnContainingLine) { - // CSS2.1 states that the baseline of an inline block is the baseline of the - // last line box in the normal flow. We make an exception for marquees, - // since their baselines are meaningless (the content inside them moves). - // This matches WinIE as well, which just bottom-aligns them. We also give - // up on finding a baseline if we have a vertical scrollbar, or if we are - // scrolled vertically (e.g., an overflow:hidden block that has had - // scrollTop moved). - int baselinePos = inlineBlockBaseline(direction); - if (baselinePos != -1) - return beforeMarginInLineDirection(direction) + baselinePos; - - return RenderBox::baselinePosition(baselineType, firstLine, direction, - linePositionMode); - } - - // If we're not replaced, we'll only get called with - // PositionOfInteriorLineBoxes. Note that inline-block counts as replaced - // here. - ASSERT(linePositionMode == PositionOfInteriorLineBoxes); - - const FontMetrics& fontMetrics = style(firstLine)->fontMetrics(); - return fontMetrics.ascent(baselineType) + - (lineHeight(firstLine, direction, linePositionMode) - - fontMetrics.height()) / - 2; -} - -LayoutUnit RenderBlock::minLineHeightForReplacedRenderer( - bool isFirstLine, - LayoutUnit replacedHeight) const { - if (!(style(isFirstLine)->lineBoxContain() & LineBoxContainBlock)) - return 0; - - return std::max( - replacedHeight, - lineHeight(isFirstLine, HorizontalLine, PositionOfInteriorLineBoxes)); -} - -int RenderBlock::firstLineBoxBaseline(FontBaselineOrAuto baselineType) const { - for (RenderBox* curr = firstChildBox(); curr; curr = curr->nextSiblingBox()) { - if (!curr->isFloatingOrOutOfFlowPositioned()) { - int result = curr->firstLineBoxBaseline(baselineType); - if (result != -1) - return curr->logicalTop() + - result; // Translate to our coordinate space. - } - } - - return -1; -} - -int RenderBlock::inlineBlockBaseline(LineDirectionMode direction) const { - if (!style()->isOverflowVisible()) { - // We are not calling RenderBox::baselinePosition here because the caller - // should add the margin-top/margin-right, not us. - return direction == HorizontalLine ? height() + m_marginBox.bottom() - : width() + m_marginBox.left(); - } - - return lastLineBoxBaseline(direction); -} - -int RenderBlock::lastLineBoxBaseline(LineDirectionMode lineDirection) const { - bool haveNormalFlowChild = false; - for (RenderBox* curr = lastChildBox(); curr; - curr = curr->previousSiblingBox()) { - if (!curr->isFloatingOrOutOfFlowPositioned()) { - haveNormalFlowChild = true; - int result = curr->inlineBlockBaseline(lineDirection); - if (result != -1) - return curr->logicalTop() + - result; // Translate to our coordinate space. - } - } - if (!haveNormalFlowChild && hasLineIfEmpty()) { - const FontMetrics& fontMetrics = firstLineStyle()->fontMetrics(); - return fontMetrics.ascent() + - (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - - fontMetrics.height()) / - 2 + - (lineDirection == HorizontalLine ? borderTop() + paddingTop() - : borderRight() + paddingRight()); - } - - return -1; -} - -RenderBlock* RenderBlock::firstLineBlock() const { - RenderBlock* firstLineBlock = const_cast(this); - bool hasPseudo = false; - while (true) { - // FIXME(sky): Remove all this. - hasPseudo = false; - if (hasPseudo) - break; - RenderObject* parentBlock = firstLineBlock->parent(); - if (firstLineBlock->isReplaced() || !parentBlock || - !parentBlock->isRenderParagraph()) - break; - ASSERT_WITH_SECURITY_IMPLICATION(parentBlock->isRenderBlock()); - if (toRenderParagraph(parentBlock)->firstChild() != firstLineBlock) - break; - firstLineBlock = toRenderBlock(parentBlock); - } - - if (!hasPseudo) - return 0; - - return firstLineBlock; -} - -// Helper methods for obtaining the last line, computing line counts and heights -// for line counts (crawling into blocks). -static bool shouldCheckLines(RenderObject* obj) { - return !obj->isFloatingOrOutOfFlowPositioned() && obj->isRenderBlock() && - obj->style()->height().isAuto(); -} - -RootInlineBox* RenderBlock::lineAtIndex(int i) const { - ASSERT(i >= 0); - - for (RenderObject* child = firstChild(); child; - child = child->nextSibling()) { - if (!shouldCheckLines(child)) - continue; - if (RootInlineBox* box = toRenderBlock(child)->lineAtIndex(i)) - return box; - } - - return 0; -} - -int RenderBlock::lineCount(const RootInlineBox* stopRootInlineBox, - bool* found) const { - int count = 0; - for (RenderObject* obj = firstChild(); obj; obj = obj->nextSibling()) { - if (shouldCheckLines(obj)) { - bool recursiveFound = false; - count += - toRenderBlock(obj)->lineCount(stopRootInlineBox, &recursiveFound); - if (recursiveFound) { - if (found) - *found = true; - break; - } - } - } - - return count; -} - -void RenderBlock::clearTruncation() { - for (RenderObject* obj = firstChild(); obj; obj = obj->nextSibling()) { - if (shouldCheckLines(obj)) - toRenderBlock(obj)->clearTruncation(); - } -} - -void RenderBlock::absoluteQuads(Vector& quads) const { - quads.append(RenderBox::localToAbsoluteQuad( - FloatRect(0, 0, width().toFloat(), height().toFloat()), 0 /* mode */)); -} - -void RenderBlock::updateHitTestResult(HitTestResult& result, - const LayoutPoint& point) {} - -LayoutRect RenderBlock::localCaretRect(InlineBox* inlineBox, - int caretOffset, - LayoutUnit* extraWidthToEndOfLine) { - // Do the normal calculation in most cases. - if (firstChild()) - return RenderBox::localCaretRect(inlineBox, caretOffset, - extraWidthToEndOfLine); - - LayoutRect caretRect = - localCaretRectForEmptyElement(width(), textIndentOffset()); - - if (extraWidthToEndOfLine) - *extraWidthToEndOfLine = width() - caretRect.maxX(); - - return caretRect; -} - -void RenderBlock::addFocusRingRects(Vector& rects, - const LayoutPoint& additionalOffset, - const RenderBox* paintContainer) const { - if (width() && height()) - rects.append(pixelSnappedIntRect(additionalOffset, size())); - - if (!hasOverflowClip()) { - for (RootInlineBox* curr = firstRootBox(); curr; - curr = curr->nextRootBox()) { - LayoutUnit top = std::max(curr->lineTop(), curr->top()); - LayoutUnit bottom = std::min(curr->lineBottom(), - curr->top() + curr->height()); - LayoutRect rect(additionalOffset.x() + curr->x(), - additionalOffset.y() + top, curr->width(), bottom - top); - if (!rect.isEmpty()) - rects.append(pixelSnappedIntRect(rect)); - } - - addChildFocusRingRects(rects, additionalOffset, paintContainer); - } -} - -LayoutUnit RenderBlock::marginBeforeForChild(const RenderBox* child) const { - // FIXME(sky): Remove - return child->marginBefore(); -} - -LayoutUnit RenderBlock::marginAfterForChild(const RenderBox* child) const { - // FIXME(sky): Remove - return child->marginAfter(); -} - -bool RenderBlock::hasMarginBeforeQuirk(const RenderBox* child) const { - return child->isRenderBlock() ? toRenderBlock(child)->hasMarginBeforeQuirk() - : child->style()->hasMarginBeforeQuirk(); -} - -bool RenderBlock::hasMarginAfterQuirk(const RenderBox* child) const { - return child->isRenderBlock() ? toRenderBlock(child)->hasMarginAfterQuirk() - : child->style()->hasMarginAfterQuirk(); -} - -const char* RenderBlock::renderName() const { - if (isInlineBlock()) - return "RenderBlock (inline-block)"; - if (isOutOfFlowPositioned()) - return "RenderBlock (positioned)"; - return "RenderBlock"; -} - -static bool recalcNormalFlowChildOverflowIfNeeded(RenderObject* renderer) { - if (renderer->isOutOfFlowPositioned() || - !renderer->needsOverflowRecalcAfterStyleChange()) - return false; - - ASSERT(renderer->isRenderBlock()); - return toRenderBlock(renderer)->recalcOverflowAfterStyleChange(); -} - -bool RenderBlock::recalcChildOverflowAfterStyleChange() { - ASSERT(childNeedsOverflowRecalcAfterStyleChange()); - setChildNeedsOverflowRecalcAfterStyleChange(false); - - bool childrenOverflowChanged = false; - - if (isRenderParagraph()) { - ListHashSet lineBoxes; - for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) { - RenderObject* renderer = walker.current(); - if (recalcNormalFlowChildOverflowIfNeeded(renderer)) { - childrenOverflowChanged = true; - if (InlineBox* inlineBoxWrapper = - toRenderBlock(renderer)->inlineBoxWrapper()) - lineBoxes.add(&inlineBoxWrapper->root()); - } - } - - // FIXME: Glyph overflow will get lost in this case, but not really a big - // deal. - GlyphOverflowAndFallbackFontsMap textBoxDataMap; - for (ListHashSet::const_iterator it = lineBoxes.begin(); - it != lineBoxes.end(); ++it) { - RootInlineBox* box = *it; - box->computeOverflow(box->lineTop(), box->lineBottom(), textBoxDataMap); - } - } else { - for (RenderBox* box = firstChildBox(); box; box = box->nextSiblingBox()) { - if (recalcNormalFlowChildOverflowIfNeeded(box)) - childrenOverflowChanged = true; - } - } - - TrackedRendererListHashSet* positionedDescendants = positionedObjects(); - if (!positionedDescendants) - return childrenOverflowChanged; - - TrackedRendererListHashSet::iterator end = positionedDescendants->end(); - for (TrackedRendererListHashSet::iterator it = positionedDescendants->begin(); - it != end; ++it) { - RenderBox* box = *it; - - if (!box->needsOverflowRecalcAfterStyleChange()) - continue; - RenderBlock* block = toRenderBlock(box); - if (!block->recalcOverflowAfterStyleChange()) - continue; - - childrenOverflowChanged = true; - } - return childrenOverflowChanged; -} - -bool RenderBlock::recalcOverflowAfterStyleChange() { - ASSERT(needsOverflowRecalcAfterStyleChange()); - - bool childrenOverflowChanged = false; - if (childNeedsOverflowRecalcAfterStyleChange()) - childrenOverflowChanged = recalcChildOverflowAfterStyleChange(); - - if (!selfNeedsOverflowRecalcAfterStyleChange() && !childrenOverflowChanged) - return false; - - setSelfNeedsOverflowRecalcAfterStyleChange(false); - // If the current block needs layout, overflow will be recalculated during - // layout time anyway. We can safely exit here. - if (needsLayout()) - return false; - - LayoutUnit oldClientAfterEdge = hasRenderOverflow() - ? m_overflow->layoutClientAfterEdge() - : clientLogicalBottom(); - computeOverflow(oldClientAfterEdge, true); - - return !hasOverflowClip(); -} - -#if ENABLE(ASSERT) -void RenderBlock::checkPositionedObjectsNeedLayout() { - if (!gPositionedDescendantsMap) - return; - - if (TrackedRendererListHashSet* positionedDescendantSet = - positionedObjects()) { - TrackedRendererListHashSet::const_iterator end = - positionedDescendantSet->end(); - for (TrackedRendererListHashSet::const_iterator it = - positionedDescendantSet->begin(); - it != end; ++it) { - RenderBox* currBox = *it; - ASSERT(!currBox->needsLayout()); - } - } -} - -#endif - -#ifndef NDEBUG - -void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, - const char* markedLabel1, - const InlineBox* markedBox2, - const char* markedLabel2, - const RenderObject* obj) const { - showRenderObject(); - for (const RootInlineBox* root = firstRootBox(); root; - root = root->nextRootBox()) - root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, - markedLabel2, obj, 1); -} - -#endif - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderBlock.h b/sky/engine/core/rendering/RenderBlock.h deleted file mode 100644 index a1f6ca67fffa0..0000000000000 --- a/sky/engine/core/rendering/RenderBlock.h +++ /dev/null @@ -1,455 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2007 David Smith (catfish.man@gmail.com) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All - * rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERBLOCK_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERBLOCK_H_ - -#include "flutter/sky/engine/core/rendering/GapRects.h" -#include "flutter/sky/engine/core/rendering/RenderBox.h" -#include "flutter/sky/engine/core/rendering/RenderLineBoxList.h" -#include "flutter/sky/engine/core/rendering/RootInlineBox.h" -#include "flutter/sky/engine/core/rendering/style/ShapeValue.h" -#include "flutter/sky/engine/platform/text/TextBreakIterator.h" -#include "flutter/sky/engine/platform/text/TextRun.h" -#include "flutter/sky/engine/wtf/ListHashSet.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" - -namespace blink { - -class LineInfo; -class LineLayoutState; -struct PaintInfo; -class RenderInline; -class RenderText; -class WordMeasurement; - -template -class BidiRunList; -typedef WTF::ListHashSet TrackedRendererListHashSet; -typedef WTF::HashMap> - TrackedDescendantsMap; -typedef WTF::HashMap>> - TrackedContainerMap; -typedef Vector WordMeasurements; - -enum ContainingBlockState { NewContainingBlock, SameContainingBlock }; - -class RenderBlock : public RenderBox { - public: - virtual void destroy() override; - friend class LineLayoutState; - - protected: - explicit RenderBlock(); - virtual ~RenderBlock(); - - public: - RenderObject* firstChild() const { - ASSERT(children() == virtualChildren()); - return children()->firstChild(); - } - RenderObject* lastChild() const { - ASSERT(children() == virtualChildren()); - return children()->lastChild(); - } - - // If you have a RenderBlock, use firstChild or lastChild instead. - void slowFirstChild() const = delete; - void slowLastChild() const = delete; - - const RenderObjectChildList* children() const { return &m_children; } - RenderObjectChildList* children() { return &m_children; } - - bool beingDestroyed() const { return m_beingDestroyed; } - - // These two functions are overridden for inline-block. - virtual LayoutUnit lineHeight( - bool firstLine, - LineDirectionMode, - LinePositionMode = PositionOnContainingLine) const override final; - virtual int baselinePosition( - FontBaseline, - bool firstLine, - LineDirectionMode, - LinePositionMode = PositionOnContainingLine) const override; - - LayoutUnit minLineHeightForReplacedRenderer(bool isFirstLine, - LayoutUnit replacedHeight) const; - - protected: - RenderLineBoxList* lineBoxes() { return &m_lineBoxes; } - - InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } - InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } - - RootInlineBox* firstRootBox() const { - return static_cast(firstLineBox()); - } - RootInlineBox* lastRootBox() const { - return static_cast(lastLineBox()); - } - - public: - // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to - // RenderParagraph - virtual void deleteLineBoxTree(); - - virtual void addChild(RenderObject* newChild, - RenderObject* beforeChild = 0) override; - virtual void removeChild(RenderObject*) override; - - void insertPositionedObject(RenderBox*); - static void removePositionedObject(RenderBox*); - void removePositionedObjects(RenderBlock*, - ContainingBlockState = SameContainingBlock); - - TrackedRendererListHashSet* positionedObjects() const; - bool hasPositionedObjects() const { - TrackedRendererListHashSet* objects = positionedObjects(); - return objects && !objects->isEmpty(); - } - - void addPercentHeightDescendant(RenderBox*); - static void removePercentHeightDescendant(RenderBox*); - static bool hasPercentHeightContainerMap(); - static bool hasPercentHeightDescendant(RenderBox*); - static void clearPercentHeightDescendantsFrom(RenderBox*); - static void removePercentHeightDescendantIfNeeded(RenderBox*); - - TrackedRendererListHashSet* percentHeightDescendants() const; - bool hasPercentHeightDescendants() const { - TrackedRendererListHashSet* descendants = percentHeightDescendants(); - return descendants && !descendants->isEmpty(); - } - - void setHasMarginBeforeQuirk(bool b) { m_hasMarginBeforeQuirk = b; } - void setHasMarginAfterQuirk(bool b) { m_hasMarginAfterQuirk = b; } - - bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; } - bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; } - - bool hasMarginBeforeQuirk(const RenderBox* child) const; - bool hasMarginAfterQuirk(const RenderBox* child) const; - - void markPositionedObjectsForLayout(); - - LayoutUnit textIndentOffset() const; - - virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override; - - // Block flows subclass availableWidth to handle multi column layout - // (shrinking the width available to children when laying out.) - virtual LayoutUnit availableLogicalWidth() const override final; - - LayoutUnit blockDirectionOffset(const LayoutSize& offsetFromBlock) const; - LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const; - - virtual bool shouldPaintSelectionGaps() const override final; - LayoutRect logicalLeftSelectionGap( - RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - RenderObject* selObj, - LayoutUnit logicalLeft, - LayoutUnit logicalTop, - LayoutUnit logicalHeight, - const PaintInfo*); - LayoutRect logicalRightSelectionGap( - RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - RenderObject* selObj, - LayoutUnit logicalRight, - LayoutUnit logicalTop, - LayoutUnit logicalHeight, - const PaintInfo*); - void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap); - RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; - - virtual void setSelectionState(SelectionState) override; - - LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, - const LayoutRect& logicalRect); - - // Helper methods for computing line counts and heights for line counts. - virtual RootInlineBox* lineAtIndex(int) const; - virtual int lineCount(const RootInlineBox* = 0, bool* = 0) const; - void clearTruncation(); - - // Accessors for logical width/height and margins in the containing block's - // block-flow direction. - LayoutUnit logicalWidthForChild(const RenderBox* child) const { - return child->width(); - } - LayoutUnit logicalHeightForChild(const RenderBox* child) const { - return child->height(); - } - LayoutSize logicalSizeForChild(const RenderBox* child) const { - return child->size(); - } - LayoutUnit logicalTopForChild(const RenderBox* child) const { - return child->y(); - } - LayoutUnit marginBeforeForChild(const RenderBoxModelObject* child) const { - return child->marginBefore(style()); - } - LayoutUnit marginAfterForChild(const RenderBoxModelObject* child) const { - return child->marginAfter(style()); - } - LayoutUnit marginStartForChild(const RenderBoxModelObject* child) const { - return child->marginStart(style()); - } - LayoutUnit marginEndForChild(const RenderBoxModelObject* child) const { - return child->marginEnd(style()); - } - void setMarginStartForChild(RenderBox* child, LayoutUnit value) const { - child->setMarginStart(value, style()); - } - void setMarginEndForChild(RenderBox* child, LayoutUnit value) const { - child->setMarginEnd(value, style()); - } - void setMarginBeforeForChild(RenderBox* child, LayoutUnit value) const { - child->setMarginBefore(value, style()); - } - void setMarginAfterForChild(RenderBox* child, LayoutUnit value) const { - child->setMarginAfter(value, style()); - } - LayoutUnit marginBeforeForChild(const RenderBox* child) const; - LayoutUnit marginAfterForChild(const RenderBox* child) const; - - virtual bool nodeAtPoint(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) override; - - LayoutUnit availableLogicalWidthForContent() const { - return max( - 0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); - } - LayoutUnit logicalLeftOffsetForContent() const { - return borderLeft() + paddingLeft(); - } - LayoutUnit logicalRightOffsetForContent() const { - return logicalLeftOffsetForContent() + availableLogicalWidth(); - } - LayoutUnit startOffsetForContent() const { - return style()->isLeftToRightDirection() - ? logicalLeftOffsetForContent() - : logicalWidth() - logicalRightOffsetForContent(); - } - LayoutUnit endOffsetForContent() const { - return !style()->isLeftToRightDirection() - ? logicalLeftOffsetForContent() - : logicalWidth() - logicalRightOffsetForContent(); - } - -#if ENABLE(ASSERT) - void checkPositionedObjectsNeedLayout(); -#endif -#ifndef NDEBUG - void showLineTreeAndMark(const InlineBox* = 0, - const char* = 0, - const InlineBox* = 0, - const char* = 0, - const RenderObject* = 0) const; -#endif - - bool recalcChildOverflowAfterStyleChange(); - bool recalcOverflowAfterStyleChange(); - - protected: - virtual void willBeDestroyed() override; - - void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&); - - enum PositionedLayoutBehavior { - DefaultLayout, - ForcedLayoutAfterContainingBlockMoved - }; - - void layoutPositionedObjects(bool relayoutChildren, - PositionedLayoutBehavior = DefaultLayout); - - LayoutUnit marginIntrinsicLogicalWidthForChild(RenderBox* child) const; - - int beforeMarginInLineDirection(LineDirectionMode) const; - - virtual void paint(PaintInfo&, - const LayoutPoint&, - Vector& layers) override; - void paintObject(PaintInfo&, const LayoutPoint&, Vector& layers); - virtual void paintChildren(PaintInfo&, - const LayoutPoint&, - Vector& layers); - - virtual void adjustInlineDirectionLineBounds( - unsigned /* expansionOpportunityCount */, - float& /* logicalLeft */, - float& /* logicalWidth */) const {} - - virtual void computeIntrinsicLogicalWidths( - LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const override; - virtual void computePreferredLogicalWidths() override; - - virtual int firstLineBoxBaseline( - FontBaselineOrAuto baselineType) const override; - virtual int inlineBlockBaseline(LineDirectionMode) const override; - virtual int lastLineBoxBaseline(LineDirectionMode) const; - - virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) override; - - virtual void styleWillChange(StyleDifference, - const RenderStyle& newStyle) override; - virtual void styleDidChange(StyleDifference, - const RenderStyle* oldStyle) override; - - virtual bool hasLineIfEmpty() const; - - bool simplifiedLayout(); - virtual void simplifiedNormalFlowLayout(); - - public: - virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false); - - protected: - virtual void addOverflowFromChildren(); - void addOverflowFromPositionedObjects(); - - virtual void addFocusRingRects( - Vector&, - const LayoutPoint& additionalOffset, - const RenderBox* paintContainer = 0) const override; - - void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox*); - - virtual bool isInlineBlock() const override final { - return isInline() && isReplaced(); - } - - virtual bool hitTestContents(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset); - - private: - virtual RenderObjectChildList* virtualChildren() override final { - return children(); - } - virtual const RenderObjectChildList* virtualChildren() const override final { - return children(); - } - - virtual const char* renderName() const override; - - virtual bool isRenderBlock() const override final { return true; } - - virtual void dirtyLinesFromChangedChild(RenderObject* child) override final { - m_lineBoxes.dirtyLinesFromChangedChild(this, child); - } - - void insertIntoTrackedRendererMaps(RenderBox* descendant, - TrackedDescendantsMap*&, - TrackedContainerMap*&); - static void removeFromTrackedRendererMaps(RenderBox* descendant, - TrackedDescendantsMap*&, - TrackedContainerMap*&); - - void paintSelection(PaintInfo&, const LayoutPoint&); - - // Obtains the nearest enclosing block (including this block) that contributes - // a first-line style to our inline children. - virtual RenderBlock* firstLineBlock() const override; - - bool isSelectionRoot() const; - GapRects selectionGaps(RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - LayoutUnit& lastLogicalTop, - LayoutUnit& lastLogicalLeft, - LayoutUnit& lastLogicalRight, - const PaintInfo* = 0); - GapRects blockSelectionGaps(RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - LayoutUnit& lastLogicalTop, - LayoutUnit& lastLogicalLeft, - LayoutUnit& lastLogicalRight, - const PaintInfo*); - LayoutRect blockSelectionGap(RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - LayoutUnit lastLogicalTop, - LayoutUnit lastLogicalLeft, - LayoutUnit lastLogicalRight, - LayoutUnit logicalBottom, - const PaintInfo*); - virtual LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, - LayoutUnit position); - virtual LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, - LayoutUnit position); - - virtual void absoluteQuads(Vector&) const override; - - virtual LayoutRect localCaretRect( - InlineBox*, - int caretOffset, - LayoutUnit* extraWidthToEndOfLine = 0) override final; - - PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); - - void removeFromGlobalMaps(); - bool widthAvailableToChildrenHasChanged(); - - protected: - bool updateLogicalWidthAndColumnWidth(); - - RenderObjectChildList m_children; - RenderLineBoxList m_lineBoxes; // All of the root line boxes created for this - // block flow. For example, - //
Hello
world.
will have two - // total lines for the
. - - LayoutUnit m_pageLogicalOffset; - - unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put - // in RenderBlockRareData since they are - // set too frequently. - unsigned m_hasMarginAfterQuirk : 1; - unsigned m_beingDestroyed : 1; - unsigned m_hasBorderOrPaddingLogicalWidthChanged : 1; - - // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out - // of RenderBlock - friend class LineBreaker; - - // FIXME: This is temporary as we move code that accesses block flow - // member variables out of RenderBlock and into RenderParagraph. - friend class RenderParagraph; -}; - -DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERBLOCK_H_ diff --git a/sky/engine/core/rendering/RenderBox.cpp b/sky/engine/core/rendering/RenderBox.cpp deleted file mode 100644 index cf9feb1cc29fd..0000000000000 --- a/sky/engine/core/rendering/RenderBox.cpp +++ /dev/null @@ -1,3339 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) - * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) - * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. - * All rights reserved. - * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/RenderBox.h" - -#include -#include -#include "flutter/sky/engine/core/rendering/HitTestResult.h" -#include "flutter/sky/engine/core/rendering/HitTestingTransformState.h" -#include "flutter/sky/engine/core/rendering/PaintInfo.h" -#include "flutter/sky/engine/core/rendering/RenderFlexibleBox.h" -#include "flutter/sky/engine/core/rendering/RenderGeometryMap.h" -#include "flutter/sky/engine/core/rendering/RenderInline.h" -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/platform/LengthFunctions.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/TransformState.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h" - -namespace blink { - -RenderBox::RenderBox() - : m_intrinsicContentLogicalHeight(-1), - m_minPreferredLogicalWidth(-1), - m_maxPreferredLogicalWidth(-1) { - setIsBox(); -} - -void RenderBox::willBeDestroyed() { - clearOverrideSize(); - RenderBlock::removePercentHeightDescendantIfNeeded(this); - RenderBoxModelObject::willBeDestroyed(); - destroyLayer(); -} - -void RenderBox::destroyLayer() { - setHasLayer(false); - m_layer = nullptr; -} - -void RenderBox::createLayer(LayerType type) { - ASSERT(!m_layer); - m_layer = adoptPtr(new RenderLayer(this, type)); - setHasLayer(true); - m_layer->insertOnlyThisLayer(); -} - -bool RenderBox::hasSelfPaintingLayer() const { - return m_layer && m_layer->isSelfPaintingLayer(); -} - -void RenderBox::removeFloatingOrPositionedChildFromBlockLists() { - ASSERT(isFloatingOrOutOfFlowPositioned()); - - if (documentBeingDestroyed()) - return; - - if (isOutOfFlowPositioned()) - RenderBlock::removePositionedObject(this); -} - -void RenderBox::styleWillChange(StyleDifference diff, - const RenderStyle& newStyle) { - RenderStyle* oldStyle = style(); - if (oldStyle && parent()) { - // When a layout hint happens and an object's position style changes, we - // have to do a layout to dirty the render tree using the old position value - // now. - if (diff.needsFullLayout() && oldStyle->position() != newStyle.position()) { - markContainingBlocksForLayout(); - if (newStyle.hasOutOfFlowPosition()) - parent()->setChildNeedsLayout(); - } - - if (oldStyle->hasAutoClip() != newStyle.hasAutoClip() || - oldStyle->clip() != newStyle.clip()) - layer()->clipper().clearClipRectsIncludingDescendants(); - } - - RenderBoxModelObject::styleWillChange(diff, newStyle); -} - -void RenderBox::styleDidChange(StyleDifference diff, - const RenderStyle* oldStyle) { - bool hadTransform = hasTransform(); - - RenderObject::styleDidChange(diff, oldStyle); - updateFromStyle(); - - LayerType type = layerTypeRequired(); - if (type != NoLayer) { - if (!layer()) { - createLayer(type); - if (parent() && !needsLayout()) { - // FIXME: We should call a specialized version of this function. - layer()->updateLayerPositionsAfterLayout(); - } - } - } else if (layer() && layer()->parent()) { - setHasTransform(false); // Either a transform wasn't specified or the - // object doesn't support transforms, so just null - // out the bit. - layer() - ->removeOnlyThisLayer(); // calls destroyLayer() which clears m_layer - if (hadTransform) - setNeedsLayoutAndPrefWidthsRecalc(); - } - - if (layer()) { - // FIXME: Ideally we shouldn't need this setter but we can't easily infer an - // overflow-only layer from the style. - layer()->setLayerType(type); - layer()->styleChanged(diff, oldStyle); - } - - updateTransform(oldStyle); - - if (needsLayout() && oldStyle) - RenderBlock::removePercentHeightDescendantIfNeeded(this); -} - -void RenderBox::updateTransformationMatrix() { - if (m_transform) { - m_transform->makeIdentity(); - style()->applyTransform(*m_transform, pixelSnappedBorderBoxRect().size(), - RenderStyle::IncludeTransformOrigin); - // FIXME(sky): We shouldn't need to do this once Skia has 4x4 matrix - // support. Until then, 3d transforms don't work right. - m_transform->makeAffine(); - } -} - -void RenderBox::updateTransform(const RenderStyle* oldStyle) { - if (oldStyle && style()->transformDataEquivalent(*oldStyle)) - return; - - // hasTransform() on the renderer is also true when there is transform-style: - // preserve-3d or perspective set, so check style too. - bool localHasTransform = hasTransform() && style()->hasTransform(); - bool had3DTransform = has3DTransform(); - - bool hadTransform = m_transform; - if (localHasTransform != hadTransform) { - if (localHasTransform) - m_transform = adoptPtr(new TransformationMatrix); - else - m_transform.clear(); - - // Layers with transforms act as clip rects roots, so clear the cached clip - // rects here. - if (layer()) - layer()->clipper().clearClipRectsIncludingDescendants(); - } - - updateTransformationMatrix(); - - if (layer() && had3DTransform != has3DTransform()) - layer()->dirty3DTransformedDescendantStatus(); -} - -// TODO(ojan): Inline this into styleDidChange, -void RenderBox::updateFromStyle() { - RenderStyle* styleToUse = style(); - - setHasBoxDecorationBackground(hasBackground() || styleToUse->hasBorder() || - styleToUse->boxShadow()); - setInline(styleToUse->isDisplayInlineType()); - setPositionState(styleToUse->position()); - - if (isRenderView()) { - // TODO(ojan): Merge this into the same call above. - setHasBoxDecorationBackground(true); - } else if (isRenderBlock()) { - // TODO(esprehn): Why do we not want to set this on the RenderView? - setHasOverflowClip(!styleToUse->isOverflowVisible()); - } - - setHasTransform(styleToUse->hasTransformRelatedProperty()); -} - -void RenderBox::layout() { - ASSERT(needsLayout()); - - RenderObject* child = slowFirstChild(); - if (!child) { - clearNeedsLayout(); - return; - } - - while (child) { - child->layoutIfNeeded(); - ASSERT(!child->needsLayout()); - child = child->nextSibling(); - } - clearNeedsLayout(); -} - -// More IE extensions. clientWidth and clientHeight represent the interior of -// an object excluding border and scrollbar. -LayoutUnit RenderBox::clientWidth() const { - return width() - borderLeft() - borderRight(); -} - -LayoutUnit RenderBox::clientHeight() const { - return height() - borderTop() - borderBottom(); -} - -int RenderBox::pixelSnappedClientWidth() const { - return snapSizeToPixel(clientWidth(), x() + clientLeft()); -} - -int RenderBox::pixelSnappedClientHeight() const { - return snapSizeToPixel(clientHeight(), y() + clientTop()); -} - -int RenderBox::pixelSnappedOffsetWidth() const { - return snapSizeToPixel(offsetWidth(), x() + clientLeft()); -} - -int RenderBox::pixelSnappedOffsetHeight() const { - return snapSizeToPixel(offsetHeight(), y() + clientTop()); -} - -void RenderBox::absoluteQuads(Vector& quads) const { - quads.append(localToAbsoluteQuad( - FloatRect(0, 0, width().toFloat(), height().toFloat()), 0 /* mode */)); -} - -void RenderBox::updateLayerTransformAfterLayout() { - // Transform-origin depends on box size, so we need to update the transform - // after layout. - updateTransformationMatrix(); -} - -LayoutUnit RenderBox::constrainLogicalWidthByMinMax(LayoutUnit logicalWidth, - LayoutUnit availableWidth, - RenderBlock* cb) const { - RenderStyle* styleToUse = style(); - if (!styleToUse->logicalMaxWidth().isMaxSizeNone()) - logicalWidth = std::min( - logicalWidth, - computeLogicalWidthUsing(MaxSize, styleToUse->logicalMaxWidth(), - availableWidth, cb)); - return std::max(logicalWidth, computeLogicalWidthUsing( - MinSize, styleToUse->logicalMinWidth(), - availableWidth, cb)); -} - -LayoutUnit RenderBox::constrainLogicalHeightByMinMax( - LayoutUnit logicalHeight, - LayoutUnit intrinsicContentHeight) const { - RenderStyle* styleToUse = style(); - if (!styleToUse->logicalMaxHeight().isMaxSizeNone()) { - LayoutUnit maxH = computeLogicalHeightUsing(styleToUse->logicalMaxHeight(), - intrinsicContentHeight); - if (maxH != -1) - logicalHeight = std::min(logicalHeight, maxH); - } - return std::max(logicalHeight, - computeLogicalHeightUsing(styleToUse->logicalMinHeight(), - intrinsicContentHeight)); -} - -LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax( - LayoutUnit logicalHeight, - LayoutUnit intrinsicContentHeight) const { - RenderStyle* styleToUse = style(); - if (!styleToUse->logicalMaxHeight().isMaxSizeNone()) { - LayoutUnit maxH = computeContentLogicalHeight( - styleToUse->logicalMaxHeight(), intrinsicContentHeight); - if (maxH != -1) - logicalHeight = std::min(logicalHeight, maxH); - } - return std::max(logicalHeight, - computeContentLogicalHeight(styleToUse->logicalMinHeight(), - intrinsicContentHeight)); -} - -IntRect RenderBox::absoluteContentBox() const { - // This is wrong with transforms and flipped writing modes. - IntRect rect = pixelSnappedIntRect(contentBoxRect()); - FloatPoint absPos = localToAbsolute(); - rect.move(absPos.x(), absPos.y()); - return rect; -} - -FloatQuad RenderBox::absoluteContentQuad() const { - LayoutRect rect = contentBoxRect(); - return localToAbsoluteQuad(FloatRect(rect)); -} - -FloatPoint RenderBox::perspectiveOrigin() const { - if (!hasTransform()) - return FloatPoint(); - - const LayoutRect borderBox = borderBoxRect(); - return FloatPoint(floatValueForLength(style()->perspectiveOriginX(), - borderBox.width().toFloat()), - floatValueForLength(style()->perspectiveOriginY(), - borderBox.height().toFloat())); -} - -void RenderBox::addFocusRingRects(Vector& rects, - const LayoutPoint& additionalOffset, - const RenderBox*) const { - if (!size().isEmpty()) - rects.append(pixelSnappedIntRect(additionalOffset, size())); -} - -bool RenderBox::needsPreferredWidthsRecalculation() const { - return style()->paddingStart().isPercent() || - style()->paddingEnd().isPercent(); -} - -void RenderBox::computeIntrinsicLogicalWidths( - LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const { - minLogicalWidth = minPreferredLogicalWidth() - borderAndPaddingLogicalWidth(); - maxLogicalWidth = maxPreferredLogicalWidth() - borderAndPaddingLogicalWidth(); -} - -LayoutUnit RenderBox::minPreferredLogicalWidth() const { - if (preferredLogicalWidthsDirty()) { -#if ENABLE(ASSERT) - SetLayoutNeededForbiddenScope layoutForbiddenScope( - const_cast(*this)); -#endif - const_cast(this)->computePreferredLogicalWidths(); - } - - return m_minPreferredLogicalWidth; -} - -LayoutUnit RenderBox::maxPreferredLogicalWidth() const { - if (preferredLogicalWidthsDirty()) { -#if ENABLE(ASSERT) - SetLayoutNeededForbiddenScope layoutForbiddenScope( - const_cast(*this)); -#endif - const_cast(this)->computePreferredLogicalWidths(); - } - - return m_maxPreferredLogicalWidth; -} - -void RenderBox::setMinPreferredLogicalWidth(LayoutUnit width) { - m_minPreferredLogicalWidth = width; -} - -void RenderBox::setMaxPreferredLogicalWidth(LayoutUnit width) { - m_maxPreferredLogicalWidth = width; -} - -bool RenderBox::hasOverrideHeight() const { - return m_rareData && m_rareData->m_overrideLogicalContentHeight != -1; -} - -bool RenderBox::hasOverrideWidth() const { - return m_rareData && m_rareData->m_overrideLogicalContentWidth != -1; -} - -void RenderBox::setOverrideLogicalContentHeight(LayoutUnit height) { - ASSERT(height >= 0); - ensureRareData().m_overrideLogicalContentHeight = height; -} - -void RenderBox::setOverrideLogicalContentWidth(LayoutUnit width) { - ASSERT(width >= 0); - ensureRareData().m_overrideLogicalContentWidth = width; -} - -void RenderBox::clearOverrideLogicalContentHeight() { - if (m_rareData) - m_rareData->m_overrideLogicalContentHeight = -1; -} - -void RenderBox::clearOverrideLogicalContentWidth() { - if (m_rareData) - m_rareData->m_overrideLogicalContentWidth = -1; -} - -void RenderBox::clearOverrideSize() { - clearOverrideLogicalContentHeight(); - clearOverrideLogicalContentWidth(); -} - -LayoutUnit RenderBox::overrideLogicalContentWidth() const { - ASSERT(hasOverrideWidth()); - return m_rareData->m_overrideLogicalContentWidth; -} - -LayoutUnit RenderBox::overrideLogicalContentHeight() const { - ASSERT(hasOverrideHeight()); - return m_rareData->m_overrideLogicalContentHeight; -} - -LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing( - LayoutUnit width) const { - LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth(); - if (style()->boxSizing() == CONTENT_BOX) - return width + bordersPlusPadding; - return std::max(width, bordersPlusPadding); -} - -LayoutUnit RenderBox::adjustBorderBoxLogicalHeightForBoxSizing( - LayoutUnit height) const { - LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight(); - if (style()->boxSizing() == CONTENT_BOX) - return height + bordersPlusPadding; - return std::max(height, bordersPlusPadding); -} - -LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing( - LayoutUnit width) const { - if (style()->boxSizing() == BORDER_BOX) - width -= borderAndPaddingLogicalWidth(); - return std::max(0, width); -} - -LayoutUnit RenderBox::adjustContentBoxLogicalHeightForBoxSizing( - LayoutUnit height) const { - if (style()->boxSizing() == BORDER_BOX) - height -= borderAndPaddingLogicalHeight(); - return std::max(0, height); -} - -bool RenderBox::nodeAtPoint(const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) { - LayoutPoint adjustedLocation = accumulatedOffset + location(); - - // Check kids first. - for (RenderObject* child = slowLastChild(); child; - child = child->previousSibling()) { - if ((!child->hasLayer() || - !toRenderBox(child)->layer()->isSelfPaintingLayer()) && - child->nodeAtPoint(request, result, locationInContainer, - adjustedLocation)) { - updateHitTestResult( - result, locationInContainer.point() - toLayoutSize(adjustedLocation)); - return true; - } - } - - // Check our bounds next. - LayoutRect boundsRect = borderBoxRect(); - boundsRect.moveBy(adjustedLocation); - if (visibleToHitTestRequest(request) && - locationInContainer.intersects(boundsRect)) { - updateHitTestResult( - result, locationInContainer.point() - toLayoutSize(adjustedLocation)); - return true; - } - - return false; -} - -PassRefPtr RenderBox::createLocalTransformState( - RenderLayer* rootLayer, - RenderLayer* containerLayer, - const LayoutRect& hitTestRect, - const HitTestLocation& hitTestLocation, - const HitTestingTransformState* containerTransformState) const { - RefPtr transformState; - LayoutPoint offset; - if (containerTransformState) { - // If we're already computing transform state, then it's relative to the - // container (which we know is non-null). - transformState = HitTestingTransformState::create(*containerTransformState); - layer()->convertToLayerCoords(containerLayer, offset); - } else { - // If this is the first time we need to make transform state, then base it - // off of hitTestLocation, which is relative to rootLayer. - transformState = HitTestingTransformState::create( - hitTestLocation.transformedPoint(), hitTestLocation.transformedRect(), - FloatQuad(hitTestRect)); - layer()->convertToLayerCoords(rootLayer, offset); - } - - RenderObject* containerRenderer = - containerLayer ? containerLayer->renderer() : 0; - if (shouldUseTransformFromContainer(containerRenderer)) { - TransformationMatrix containerTransform; - getTransformFromContainer(containerRenderer, toLayoutSize(offset), - containerTransform); - transformState->applyTransform( - containerTransform, HitTestingTransformState::AccumulateTransform); - } else { - transformState->translate(offset.x(), offset.y(), - HitTestingTransformState::AccumulateTransform); - } - - return transformState; -} - -// Compute the z-offset of the point in the transformState. -// This is effectively projecting a ray normal to the plane of ancestor, finding -// where that ray intersects target, and computing the z delta between those two -// points. -static double computeZOffset(const HitTestingTransformState& transformState) { - // We got an affine transform, so no z-offset - if (transformState.m_accumulatedTransform.isAffine()) - return 0; - - // Flatten the point into the target plane - FloatPoint targetPoint = transformState.mappedPoint(); - - // Now map the point back through the transform, which computes Z. - FloatPoint3D backmappedPoint = - transformState.m_accumulatedTransform.mapPoint(FloatPoint3D(targetPoint)); - return backmappedPoint.z(); -} - -static bool isHitCandidate(bool canDepthSort, - double* zOffset, - const HitTestingTransformState* transformState) { - // The hit layer is depth-sorting with other layers, so just say that it was - // hit. - if (canDepthSort) - return true; - - // We need to look at z-depth to decide if this layer was hit. - if (zOffset) { - ASSERT(transformState); - // This is actually computing our z, but that's OK because the hitLayer is - // coplanar with us. - double childZOffset = computeZOffset(*transformState); - if (childZOffset > *zOffset) { - *zOffset = childZOffset; - return true; - } - return false; - } - - return true; -} - -static inline bool forwardCompareZIndex(RenderBox* first, RenderBox* second) { - return first->style()->zIndex() < second->style()->zIndex(); -} - -// hitTestLocation and hitTestRect are relative to rootLayer. -// A 'flattening' layer is one preserves3D() == false. -// transformState.m_accumulatedTransform holds the transform from the containing -// flattening layer. transformState.m_lastPlanarPoint is the hitTestLocation in -// the plane of the containing flattening layer. transformState.m_lastPlanarQuad -// is the hitTestRect as a quad in the plane of the containing flattening layer. -// -// If zOffset is non-null (which indicates that the caller wants z offset -// information), -// *zOffset on return is the z offset of the hit point relative to the -// containing flattening layer. -bool RenderBox::hitTestLayer(RenderLayer* rootLayer, - RenderLayer* containerLayer, - const HitTestRequest& request, - HitTestResult& result, - const LayoutRect& hitTestRect, - const HitTestLocation& hitTestLocation, - const HitTestingTransformState* transformState, - double* zOffset) { - ASSERT(layer()->isSelfPaintingLayer()); - - // The natural thing would be to keep HitTestingTransformState on the stack, - // but it's big, so we heap-allocate. - RefPtr localTransformState; - - LayoutRect localHitTestRect = hitTestRect; - HitTestLocation localHitTestLocation = hitTestLocation; - - // We need transform state for the first time, or to offset the container - // state, or to accumulate the new transform. - if (transform() || transformState || layer()->has3DTransformedDescendant() || - style()->preserves3D()) - localTransformState = - createLocalTransformState(rootLayer, containerLayer, localHitTestRect, - localHitTestLocation, transformState); - - // Apply a transform if we have one. - if (transform()) { - // The RenderView cannot have transforms. - ASSERT(parent()); - // Make sure the parent's clip rects have been calculated. - ClipRect clipRect = layer()->clipper().backgroundClipRect( - ClipRectsContext(rootLayer, RootRelativeClipRects)); - // Go ahead and test the enclosing clip now. - if (!clipRect.intersects(localHitTestLocation)) - return 0; - - // If the transform can't be inverted, then don't hit test this layer at - // all. - if (!localTransformState->m_accumulatedTransform.isInvertible()) - return 0; - - // Compute the point and the hit test rect in the coords of this layer by - // using the values from the transformState, which store the point and quad - // in the coords of the last flattened layer, and the accumulated transform - // which lets up map through preserve-3d layers. - // - // We can't just map hitTestLocation and hitTestRect because they may have - // been flattened (losing z) by our container. - FloatPoint localPoint = localTransformState->mappedPoint(); - FloatQuad localPointQuad = localTransformState->mappedQuad(); - localHitTestRect = localTransformState->boundsOfMappedArea(); - if (localHitTestLocation.isRectBasedTest()) - localHitTestLocation = HitTestLocation(localPoint, localPointQuad); - else - localHitTestLocation = HitTestLocation(localPoint); - - // Now do a hit test with the root layer shifted to be us. - rootLayer = layer(); - } - - // Ensure our lists and 3d status are up-to-date. - layer()->stackingNode()->updateLayerListsIfNeeded(); - layer()->update3DTransformedDescendantStatus(); - - RefPtr unflattenedTransformState = - localTransformState; - if (localTransformState && !style()->preserves3D()) { - // Keep a copy of the pre-flattening state, for computing z-offsets for the - // container - unflattenedTransformState = - HitTestingTransformState::create(*localTransformState); - // This layer is flattening, so flatten the state passed to descendants. - localTransformState->flatten(); - } - - // The following are used for keeping track of the z-depth of the hit point of - // 3d-transformed descendants. - double localZOffset = -std::numeric_limits::infinity(); - double* zOffsetForDescendantsPtr = 0; - double* zOffsetForContentsPtr = 0; - - bool depthSortDescendants = false; - if (style()->preserves3D()) { - depthSortDescendants = true; - // Our layers can depth-test with our container, so share the z depth - // pointer with the container, if it passed one down. - zOffsetForDescendantsPtr = zOffset ? zOffset : &localZOffset; - zOffsetForContentsPtr = zOffset ? zOffset : &localZOffset; - } else if (zOffset) { - zOffsetForDescendantsPtr = 0; - // Container needs us to give back a z offset for the hit layer. - zOffsetForContentsPtr = zOffset; - } - - Vector layers; - collectSelfPaintingLayers(layers); - // Hit testing needs to walk in the backwards direction from paint. - // Forward compare and then reverse instead of just reverse comparing - // so that elements with the same z-index are walked in reverse tree order. - std::stable_sort(layers.begin(), layers.end(), forwardCompareZIndex); - layers.reverse(); - - bool hitLayer = false; - for (auto& currentLayer : layers) { - HitTestResult tempResult(result.hitTestLocation()); - bool localHitLayer = currentLayer->hitTestLayer( - rootLayer, layer(), request, tempResult, localHitTestRect, - localHitTestLocation, localTransformState.get(), - zOffsetForDescendantsPtr); - - // If it a rect-based test, we can safely append the temporary result since - // it might had hit nodes but not necesserily had hitLayer set. - if (result.isRectBasedTest()) - result.append(tempResult); - - if (localHitLayer && isHitCandidate(depthSortDescendants, zOffset, - unflattenedTransformState.get())) { - hitLayer = localHitLayer; - if (!result.isRectBasedTest()) - result = tempResult; - if (!depthSortDescendants) - return true; - } - } - - LayoutRect layerBounds; - ClipRect contentRect; - ClipRectsContext clipRectsContext(rootLayer, RootRelativeClipRects); - layer()->clipper().calculateRects(clipRectsContext, localHitTestRect, - layerBounds, contentRect); - - // Next we want to see if the mouse pos is inside the child RenderObjects of - // the layer. - if (contentRect.intersects(localHitTestLocation)) { - // Hit test with a temporary HitTestResult, because we only want to commit - // to 'result' if we know we're frontmost. - HitTestResult tempResult(result.hitTestLocation()); - if (hitTestNonLayerDescendants(request, tempResult, layerBounds, - localHitTestLocation) && - isHitCandidate(false, zOffsetForContentsPtr, - unflattenedTransformState.get())) { - if (result.isRectBasedTest()) - result.append(tempResult); - else - result = tempResult; - if (!depthSortDescendants) - return true; - // Foreground can depth-sort with descendant layers, so keep this as a - // candidate. - hitLayer = true; - } else if (result.isRectBasedTest()) { - result.append(tempResult); - } - } - - return hitLayer; -} - -bool RenderBox::hitTestNonLayerDescendants( - const HitTestRequest& request, - HitTestResult& result, - const LayoutRect& layerBounds, - const HitTestLocation& hitTestLocation) { - return hitTest(request, result, hitTestLocation, - toLayoutPoint(layerBounds.location() - location())); -} - -// --------------------- painting stuff ------------------------------- - -void RenderBox::paintLayer(GraphicsContext* context, - const LayerPaintingInfo& paintingInfo) { - // If this layer is totally invisible then there is nothing to paint. - // TODO(ojan): Return false from isSelfPainting and then ASSERT(!opacity()) - // here. - if (!opacity()) - return; - - if (!transform()) { - paintLayerContents(context, paintingInfo); - return; - } - - // The RenderView can't be transformed in Sky. - ASSERT(layer()->parent()); - - // If the transform can't be inverted, then don't paint anything. - if (!transform()->isInvertible()) - return; - - // Make sure the parent's clip rects have been calculated. - ClipRectsContext clipRectsContext(paintingInfo.rootLayer, PaintingClipRects); - ClipRect clipRect = layer()->clipper().backgroundClipRect(clipRectsContext); - clipRect.intersect(paintingInfo.paintDirtyRect); - - // Push the parent coordinate space's clip. - layer()->parent()->clipToRect(paintingInfo, context, clipRect); - - // This involves subtracting out the position of the layer in our current - // coordinate space, but preserving the accumulated error for sub-pixel - // layout. - LayoutPoint delta; - layer()->convertToLayerCoords(paintingInfo.rootLayer, delta); - TransformationMatrix localTransform(*transform()); - IntPoint roundedDelta = roundedIntPoint(delta); - localTransform.translateRight(roundedDelta.x(), roundedDelta.y()); - LayoutSize adjustedSubPixelAccumulation = - paintingInfo.subPixelAccumulation + (delta - roundedDelta); - - // Apply the transform. - GraphicsContextStateSaver stateSaver(*context, false); - if (!localTransform.isIdentity()) { - stateSaver.save(); - context->concatCTM(localTransform.toAffineTransform()); - } - - // Now do a paint with the root layer shifted to be us. - LayerPaintingInfo transformedPaintingInfo( - layer(), - enclosingIntRect( - localTransform.inverse().mapRect(paintingInfo.paintDirtyRect)), - adjustedSubPixelAccumulation); - paintLayerContents(context, transformedPaintingInfo); - - // Restore the clip. - layer()->parent()->restoreClip(context, paintingInfo.paintDirtyRect, - clipRect); -} - -static LayoutRect transparencyClipBox(const RenderLayer*, - const RenderLayer* rootLayer, - const LayoutSize& subPixelAccumulation); - -static void expandClipRectForDescendantsAndReflection( - LayoutRect& clipRect, - const RenderLayer* layer, - const RenderLayer* rootLayer, - const LayoutSize& subPixelAccumulation) { - // Note: we don't have to walk z-order lists since transparent elements always - // establish a stacking container. This means we can just walk the layer tree - // directly. - for (RenderLayer* curr = layer->firstChild(); curr; - curr = curr->nextSibling()) - clipRect.unite(transparencyClipBox(curr, rootLayer, subPixelAccumulation)); -} - -static LayoutRect transparencyClipBox(const RenderLayer* layer, - const RenderLayer* rootLayer, - const LayoutSize& subPixelAccumulation) { - // FIXME: Although this function completely ignores CSS-imposed clipping, we - // did already intersect with the paintDirtyRect, and that should cut down on - // the amount we have to paint. Still it would be better to respect clips. - - if (rootLayer != layer && layer->renderer()->transform()) { - // The best we can do here is to use enclosed bounding boxes to establish a - // "fuzzy" enough clip to encompass the transformed layer and all of its - // children. - const RenderLayer* rootLayerForTransform = rootLayer; - LayoutPoint delta; - layer->convertToLayerCoords(rootLayerForTransform, delta); - - delta.move(subPixelAccumulation); - IntPoint pixelSnappedDelta = roundedIntPoint(delta); - TransformationMatrix transform; - transform.translate(pixelSnappedDelta.x(), pixelSnappedDelta.y()); - transform = transform * *layer->renderer()->transform(); - - // We don't use fragment boxes when collecting a transformed layer's - // bounding box, since it always paints unfragmented.y - LayoutRect clipRect = layer->physicalBoundingBox(layer); - expandClipRectForDescendantsAndReflection(clipRect, layer, layer, - subPixelAccumulation); - LayoutRect result = transform.mapRect(clipRect); - return result; - } - - LayoutRect clipRect = layer->physicalBoundingBox(rootLayer); - expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, - subPixelAccumulation); - clipRect.move(subPixelAccumulation); - return clipRect; -} - -void RenderBox::paintLayerContents(GraphicsContext* context, - const LayerPaintingInfo& paintingInfo) { - float deviceScaleFactor = 1.0f; - context->setDeviceScaleFactor(deviceScaleFactor); - - LayoutPoint offsetFromRoot; - layer()->convertToLayerCoords(paintingInfo.rootLayer, offsetFromRoot); - - LayerPaintingInfo localPaintingInfo(paintingInfo); - - LayoutRect layerBounds; - ClipRect contentRect; - ClipRectsContext clipRectsContext(localPaintingInfo.rootLayer, - PaintingClipRects, - localPaintingInfo.subPixelAccumulation); - layer()->clipper().calculateRects(clipRectsContext, - localPaintingInfo.paintDirtyRect, - layerBounds, contentRect, &offsetFromRoot); - - if (!layer()->intersectsDamageRect(layerBounds, contentRect.rect(), - localPaintingInfo.rootLayer, - &offsetFromRoot)) - return; - - LayoutRect rootRelativeBounds; - - // Apply clip-path to context. - GraphicsContextStateSaver clipStateSaver(*context, false); - - // Clip-path, like border radius, must not be applied to the contents of a - // composited-scrolling container. It must, however, still be applied to the - // mask layer, so that the compositor can properly mask the scrolling contents - // and scrollbars. - if (hasClipPath()) { - ASSERT(style()->clipPath()); - if (style()->clipPath()->type() == ClipPathOperation::SHAPE) { - // Removed. - } - } - - if (isTransparent()) { - context->save(); - LayoutRect clipRect = intersection( - paintingInfo.paintDirtyRect, - transparencyClipBox(layer(), localPaintingInfo.rootLayer, - localPaintingInfo.subPixelAccumulation)); - context->clip(clipRect); - context->beginTransparencyLayer(opacity()); - } - - layer()->clipToRect(localPaintingInfo, context, contentRect); - - LayoutPoint layerLocation = toPoint(layerBounds.location() - location() + - localPaintingInfo.subPixelAccumulation); - - Vector layers; - PaintInfo paintInfo(context, pixelSnappedIntRect(contentRect.rect()), - localPaintingInfo.rootLayer->renderer()); - paint(paintInfo, layerLocation, layers); - - std::stable_sort(layers.begin(), layers.end(), forwardCompareZIndex); - for (auto& box : layers) { - box->paintLayer(context, paintingInfo); - } - - layer()->restoreClip(context, localPaintingInfo.paintDirtyRect, contentRect); - - if (isTransparent()) { - context->endLayer(); - context->restore(); - } -} - -void RenderBox::paint(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - Vector& layers) { - LayoutPoint adjustedPaintOffset = paintOffset + location(); - for (RenderObject* child = slowFirstChild(); child; - child = child->nextSibling()) - child->paint(paintInfo, adjustedPaintOffset, layers); -} - -BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance( - GraphicsContext* context, - const BoxDecorationData& boxDecorationData) const { - if (!boxDecorationData.hasBackground || !boxDecorationData.hasBorder || - !style()->hasBorderRadius()) - return BackgroundBleedNone; - - // FIXME: See crbug.com/382491. getCTM does not accurately reflect the scale - // at the time content is rasterized, and should not be relied on to make - // decisions about bleeding. - AffineTransform ctm = context->getCTM(); - FloatSize contextScaling(static_cast(ctm.xScale()), - static_cast(ctm.yScale())); - - // Because RoundedRect uses IntRect internally the inset applied by the - // BackgroundBleedShrinkBackground strategy cannot be less than one integer - // layout coordinate, even with subpixel layout enabled. To take that into - // account, we clamp the contextScaling to 1.0 for the following test so - // that borderObscuresBackgroundEdge can only return true if the border - // widths are greater than 2 in both layout coordinates and screen - // coordinates. - // This precaution will become obsolete if RoundedRect is ever promoted to - // a sub-pixel representation. - if (contextScaling.width() > 1) - contextScaling.setWidth(1); - if (contextScaling.height() > 1) - contextScaling.setHeight(1); - - if (borderObscuresBackgroundEdge(contextScaling)) - return BackgroundBleedShrinkBackground; - if (borderObscuresBackground() && backgroundHasOpaqueTopLayer()) - return BackgroundBleedBackgroundOverBorder; - - return BackgroundBleedClipBackground; -} - -void RenderBox::paintBoxDecorationBackground(PaintInfo& paintInfo, - const LayoutPoint& paintOffset) { - LayoutRect paintRect = borderBoxRect(); - paintRect.moveBy(paintOffset); - paintBoxDecorationBackgroundWithRect(paintInfo, paintOffset, paintRect); -} - -void RenderBox::paintBoxDecorationBackgroundWithRect( - PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - const LayoutRect& paintRect) { - RenderStyle* style = this->style(); - BoxDecorationData boxDecorationData(*style); - BackgroundBleedAvoidance bleedAvoidance = - determineBackgroundBleedAvoidance(paintInfo.context, boxDecorationData); - - // FIXME: Should eventually give the theme control over whether the box shadow - // should paint, since controls could have custom shadows of their own. - if (!boxShadowShouldBeAppliedToBackground(bleedAvoidance)) - paintBoxShadow(paintInfo, paintRect, style, Normal); - - GraphicsContextStateSaver stateSaver(*paintInfo.context, false); - if (bleedAvoidance == BackgroundBleedClipBackground) { - stateSaver.save(); - RoundedRect border = style->getRoundedBorderFor(paintRect); - paintInfo.context->clipRoundedRect(border); - } - - if (bleedAvoidance == BackgroundBleedBackgroundOverBorder) - paintBorder(paintInfo, paintRect, style, bleedAvoidance); - - paintBackground(paintInfo, paintRect, boxDecorationData.backgroundColor, - bleedAvoidance); - paintBoxShadow(paintInfo, paintRect, style, Inset); - - // The theme will tell us whether or not we should also paint the CSS border. - if (boxDecorationData.hasBorder && - bleedAvoidance != BackgroundBleedBackgroundOverBorder) - paintBorder(paintInfo, paintRect, style, bleedAvoidance); -} - -void RenderBox::paintBackground(const PaintInfo& paintInfo, - const LayoutRect& paintRect, - const Color& backgroundColor, - BackgroundBleedAvoidance bleedAvoidance) { - paintFillLayers(paintInfo, backgroundColor, style()->backgroundLayers(), - paintRect, bleedAvoidance); -} - -bool RenderBox::backgroundHasOpaqueTopLayer() const { - const FillLayer& fillLayer = style()->backgroundLayers(); - if (fillLayer.clip() != BorderFillBox) - return false; - - if (fillLayer.hasOpaqueImage(this) && fillLayer.hasRepeatXY() && - fillLayer.image()->canRender(*this)) - return true; - - // If there is only one layer and no image, check whether the background color - // is opaque - if (!fillLayer.next() && !fillLayer.hasImage()) { - Color bgColor = style()->resolveColor(style()->backgroundColor()); - if (bgColor.alpha() == 255) - return true; - } - - return false; -} - -void RenderBox::paintFillLayers(const PaintInfo& paintInfo, - const Color& c, - const FillLayer& fillLayer, - const LayoutRect& rect, - BackgroundBleedAvoidance bleedAvoidance, - RenderObject* backgroundObject) { - Vector layers; - const FillLayer* curLayer = &fillLayer; - bool shouldDrawBackgroundInSeparateBuffer = false; - while (curLayer) { - layers.append(curLayer); - // Stop traversal when an opaque layer is encountered. - // FIXME : It would be possible for the following occlusion culling test to - // be more aggressive on layers with no repeat by testing whether the image - // covers the layout rect. Testing that here would imply duplicating a lot - // of calculations that are currently done in - // RenderBoxModelObject::paintFillLayerExtended. A more efficient solution - // might be to move the layer recursion into paintFillLayerExtended, or to - // compute the layer geometry here and pass it down. - - if (!shouldDrawBackgroundInSeparateBuffer && - curLayer->blendMode() != WebBlendModeNormal) - shouldDrawBackgroundInSeparateBuffer = true; - - // The clipOccludesNextLayers condition must be evaluated first to avoid - // short-circuiting. - if (curLayer->clipOccludesNextLayers(curLayer == &fillLayer) && - curLayer->hasOpaqueImage(this) && curLayer->image()->canRender(*this) && - curLayer->hasRepeatXY() && - curLayer->blendMode() == WebBlendModeNormal && - !boxShadowShouldBeAppliedToBackground(bleedAvoidance)) - break; - curLayer = curLayer->next(); - } - - GraphicsContext* context = paintInfo.context; - if (!context) - shouldDrawBackgroundInSeparateBuffer = false; - - // FIXME(sky): Propagate this constant. - bool skipBaseColor = false; - if (shouldDrawBackgroundInSeparateBuffer) - context->beginTransparencyLayer(1); - - Vector::const_reverse_iterator topLayer = layers.rend(); - for (Vector::const_reverse_iterator it = layers.rbegin(); - it != topLayer; ++it) - paintFillLayer(paintInfo, c, **it, rect, bleedAvoidance, backgroundObject, - skipBaseColor); - - if (shouldDrawBackgroundInSeparateBuffer) - context->endLayer(); -} - -void RenderBox::paintFillLayer(const PaintInfo& paintInfo, - const Color& c, - const FillLayer& fillLayer, - const LayoutRect& rect, - BackgroundBleedAvoidance bleedAvoidance, - RenderObject* backgroundObject, - bool skipBaseColor) { - paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, - LayoutSize(), backgroundObject, skipBaseColor); -} - -bool RenderBox::pushContentsClip(PaintInfo& paintInfo, - const LayoutPoint& accumulatedOffset, - ContentsClipBehavior contentsClipBehavior) { - bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); - if (!isOverflowClip) - return false; - - LayoutRect clipRect = overflowClipRect(accumulatedOffset); - RoundedRect clipRoundedRect(0, 0, 0, 0); - bool hasBorderRadius = style()->hasBorderRadius(); - if (hasBorderRadius) - clipRoundedRect = style()->getRoundedInnerBorderFor( - LayoutRect(accumulatedOffset, size())); - - if (contentsClipBehavior == SkipContentsClipIfPossible) { - LayoutRect contentsVisualOverflow = contentsVisualOverflowRect(); - if (contentsVisualOverflow.isEmpty()) - return false; - - LayoutRect conservativeClipRect = clipRect; - if (hasBorderRadius) - conservativeClipRect.intersect(clipRoundedRect.radiusCenterRect()); - conservativeClipRect.moveBy(-accumulatedOffset); - if (conservativeClipRect.contains(contentsVisualOverflow)) - return false; - } - - paintInfo.context->save(); - if (hasBorderRadius) - paintInfo.context->clipRoundedRect(clipRoundedRect); - paintInfo.context->clip(pixelSnappedIntRect(clipRect)); - return true; -} - -void RenderBox::popContentsClip(PaintInfo& paintInfo, - const LayoutPoint& accumulatedOffset) { - ASSERT(hasOverflowClip() && !layer()->isSelfPaintingLayer()); - paintInfo.context->restore(); -} - -LayoutRect RenderBox::overflowClipRect(const LayoutPoint& location) { - LayoutRect clipRect = borderBoxRect(); - clipRect.setLocation(location + clipRect.location() + - LayoutSize(borderLeft(), borderTop())); - clipRect.setSize(clipRect.size() - LayoutSize(borderLeft() + borderRight(), - borderTop() + borderBottom())); - return clipRect; -} - -LayoutRect RenderBox::clipRect(const LayoutPoint& location) { - LayoutRect borderBoxRect = this->borderBoxRect(); - LayoutRect clipRect = - LayoutRect(borderBoxRect.location() + location, borderBoxRect.size()); - - if (!style()->clipLeft().isAuto()) { - LayoutUnit c = valueForLength(style()->clipLeft(), borderBoxRect.width()); - clipRect.move(c, 0); - clipRect.contract(c, 0); - } - - if (!style()->clipRight().isAuto()) - clipRect.contract(width() - valueForLength(style()->clipRight(), width()), - 0); - - if (!style()->clipTop().isAuto()) { - LayoutUnit c = valueForLength(style()->clipTop(), borderBoxRect.height()); - clipRect.move(0, c); - clipRect.contract(0, c); - } - - if (!style()->clipBottom().isAuto()) - clipRect.contract( - 0, height() - valueForLength(style()->clipBottom(), height())); - - return clipRect; -} - -LayoutUnit RenderBox::containingBlockLogicalHeightForContent( - AvailableLogicalHeightType heightType) const { - return containingBlock()->availableLogicalHeight(heightType); -} - -void RenderBox::mapLocalToContainer(const RenderBox* paintInvalidationContainer, - TransformState& transformState, - MapCoordinatesFlags mode) const { - if (paintInvalidationContainer == this) - return; - - bool containerSkipped; - RenderObject* o = container(paintInvalidationContainer, &containerSkipped); - if (!o) - return; - - LayoutSize containerOffset = - offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint())); - - bool preserve3D = mode & UseTransforms && - (o->style()->preserves3D() || style()->preserves3D()); - if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { - TransformationMatrix t; - getTransformFromContainer(o, containerOffset, t); - transformState.applyTransform(t, preserve3D - ? TransformState::AccumulateTransform - : TransformState::FlattenTransform); - } else - transformState.move(containerOffset.width(), containerOffset.height(), - preserve3D ? TransformState::AccumulateTransform - : TransformState::FlattenTransform); - - if (containerSkipped) { - // There can't be a transform between paintInvalidationContainer and o, - // because transforms create containers, so it should be safe to just - // subtract the delta between the paintInvalidationContainer and o. - LayoutSize containerOffset = - paintInvalidationContainer->offsetFromAncestorContainer(o); - transformState.move(-containerOffset.width(), -containerOffset.height(), - preserve3D ? TransformState::AccumulateTransform - : TransformState::FlattenTransform); - return; - } - - mode &= ~ApplyContainerFlip; - - o->mapLocalToContainer(paintInvalidationContainer, transformState, mode); -} - -LayoutSize RenderBox::offsetFromContainer(const RenderObject* o, - const LayoutPoint& point, - bool* offsetDependsOnPoint) const { - ASSERT(o == container()); - if (!isInline() || isReplaced()) - return locationOffset(); - return LayoutSize(); -} - -InlineBox* RenderBox::createInlineBox() { - return new InlineBox(*this); -} - -void RenderBox::dirtyLineBoxes(bool fullLayout) { - if (inlineBoxWrapper()) { - if (fullLayout) { - inlineBoxWrapper()->destroy(); - ASSERT(m_rareData); - m_rareData->m_inlineBoxWrapper = 0; - } else { - inlineBoxWrapper()->dirtyLineBoxes(); - } - } -} - -void RenderBox::positionLineBox(InlineBox* box) { - if (isOutOfFlowPositioned()) { - box->remove(DontMarkLineBoxes); - box->destroy(); - } else if (isReplaced()) { - setLocation(roundedLayoutPoint(box->topLeft())); - setInlineBoxWrapper(box); - } -} - -void RenderBox::deleteLineBoxWrapper() { - if (inlineBoxWrapper()) { - if (!documentBeingDestroyed()) - inlineBoxWrapper()->remove(); - inlineBoxWrapper()->destroy(); - ASSERT(m_rareData); - m_rareData->m_inlineBoxWrapper = 0; - } -} - -void RenderBox::updateLogicalWidth() { - LogicalExtentComputedValues computedValues; - computeLogicalWidth(computedValues); - - setLogicalWidth(computedValues.m_extent); - setLogicalLeft(computedValues.m_position); - setMarginStart(computedValues.m_margins.m_start); - setMarginEnd(computedValues.m_margins.m_end); -} - -void RenderBox::computeLogicalWidth( - LogicalExtentComputedValues& computedValues) const { - computedValues.m_extent = logicalWidth(); - computedValues.m_position = logicalLeft(); - computedValues.m_margins.m_start = marginStart(); - computedValues.m_margins.m_end = marginEnd(); - - if (isOutOfFlowPositioned()) { - // FIXME: This calculation is not patched for block-flow yet. - // https://bugs.webkit.org/show_bug.cgi?id=46500 - computePositionedLogicalWidth(computedValues); - return; - } - - if (hasOverrideWidth()) { - computedValues.m_extent = - overrideLogicalContentWidth() + borderAndPaddingLogicalWidth(); - return; - } - - bool treatAsReplaced = shouldComputeSizeAsReplaced(); - - RenderStyle* styleToUse = style(); - Length logicalWidthLength = treatAsReplaced - ? Length(computeReplacedLogicalWidth(), Fixed) - : styleToUse->logicalWidth(); - - RenderBlock* cb = containingBlock(); - LayoutUnit containerLogicalWidth = - std::max(0, containingBlockLogicalWidthForContent()); - - if (isInline() && !isInlineBlock()) { - // just calculate margins - computedValues.m_margins.m_start = - minimumValueForLength(styleToUse->marginStart(), containerLogicalWidth); - computedValues.m_margins.m_end = - minimumValueForLength(styleToUse->marginEnd(), containerLogicalWidth); - if (treatAsReplaced) - computedValues.m_extent = - std::max(floatValueForLength(logicalWidthLength, 0) + - borderAndPaddingLogicalWidth(), - minPreferredLogicalWidth()); - return; - } - - // Width calculations - if (treatAsReplaced) - computedValues.m_extent = - logicalWidthLength.value() + borderAndPaddingLogicalWidth(); - else { - LayoutUnit preferredWidth = computeLogicalWidthUsing( - MainOrPreferredSize, styleToUse->logicalWidth(), containerLogicalWidth, - cb); - computedValues.m_extent = constrainLogicalWidthByMinMax( - preferredWidth, containerLogicalWidth, cb); - } - - // Margin calculations. - computeMarginsForDirection( - InlineDirection, cb, containerLogicalWidth, computedValues.m_extent, - computedValues.m_margins.m_start, computedValues.m_margins.m_end, - style()->marginStart(), style()->marginEnd()); - - if (containerLogicalWidth && - containerLogicalWidth != - (computedValues.m_extent + computedValues.m_margins.m_start + - computedValues.m_margins.m_end) && - !isInline() && !cb->isFlexibleBox()) { - LayoutUnit newMargin = containerLogicalWidth - computedValues.m_extent - - cb->marginStartForChild(this); - bool hasInvertedDirection = cb->style()->isLeftToRightDirection() != - style()->isLeftToRightDirection(); - if (hasInvertedDirection) - computedValues.m_margins.m_start = newMargin; - else - computedValues.m_margins.m_end = newMargin; - } -} - -LayoutUnit RenderBox::fillAvailableMeasure( - LayoutUnit availableLogicalWidth) const { - LayoutUnit marginStart = - minimumValueForLength(style()->marginStart(), availableLogicalWidth); - LayoutUnit marginEnd = - minimumValueForLength(style()->marginEnd(), availableLogicalWidth); - return availableLogicalWidth - marginStart - marginEnd; -} - -LayoutUnit RenderBox::computeIntrinsicLogicalWidthUsing( - const Length& logicalWidthLength, - LayoutUnit availableLogicalWidth, - LayoutUnit borderAndPadding) const { - if (logicalWidthLength.type() == FillAvailable) - return fillAvailableMeasure(availableLogicalWidth); - - LayoutUnit minLogicalWidth = 0; - LayoutUnit maxLogicalWidth = 0; - computeIntrinsicLogicalWidths(minLogicalWidth, maxLogicalWidth); - - if (logicalWidthLength.type() == MinContent) - return minLogicalWidth + borderAndPadding; - - if (logicalWidthLength.type() == MaxContent) - return maxLogicalWidth + borderAndPadding; - - if (logicalWidthLength.type() == FitContent) { - minLogicalWidth += borderAndPadding; - maxLogicalWidth += borderAndPadding; - return std::max( - minLogicalWidth, - std::min(maxLogicalWidth, fillAvailableMeasure(availableLogicalWidth))); - } - - ASSERT_NOT_REACHED(); - return 0; -} - -LayoutUnit RenderBox::computeLogicalWidthUsing(SizeType widthType, - const Length& logicalWidth, - LayoutUnit availableLogicalWidth, - const RenderBlock* cb) const { - if (!logicalWidth.isIntrinsicOrAuto()) { - // FIXME: If the containing block flow is perpendicular to our direction we - // need to use the available logical height instead. - return adjustBorderBoxLogicalWidthForBoxSizing( - valueForLength(logicalWidth, availableLogicalWidth)); - } - - if (logicalWidth.isIntrinsic()) - return computeIntrinsicLogicalWidthUsing( - logicalWidth, availableLogicalWidth, borderAndPaddingLogicalWidth()); - - LayoutUnit logicalWidthResult = fillAvailableMeasure(availableLogicalWidth); - - if (widthType == MainOrPreferredSize && - sizesLogicalWidthToFitContent(logicalWidth)) - return std::max(minPreferredLogicalWidth(), - std::min(maxPreferredLogicalWidth(), logicalWidthResult)); - return logicalWidthResult; -} - -static bool columnFlexItemHasStretchAlignment(const RenderObject* flexitem) { - RenderObject* parent = flexitem->parent(); - // auto margins mean we don't stretch. Note that this function will only be - // used for widths, so we don't have to check marginBefore/marginAfter. - ASSERT(parent->style()->isColumnFlexDirection()); - if (flexitem->style()->marginStart().isAuto() || - flexitem->style()->marginEnd().isAuto()) - return false; - return flexitem->style()->alignSelf() == ItemPositionStretch || - (flexitem->style()->alignSelf() == ItemPositionAuto && - parent->style()->alignItems() == ItemPositionStretch); -} - -bool RenderBox::sizesLogicalWidthToFitContent( - const Length& logicalWidth) const { - if (isInlineBlock()) - return true; - - if (logicalWidth.type() == Intrinsic) - return true; - - // Flexible box items should shrink wrap, so we lay them out at their - // intrinsic widths. In the case of columns that have a stretch alignment, we - // go ahead and layout at the stretched size to avoid an extra layout when - // applying alignment. - if (parent()->isFlexibleBox()) { - // For multiline columns, we need to apply align-content first, so we can't - // stretch now. - if (!parent()->style()->isColumnFlexDirection() || - parent()->style()->flexWrap() != FlexNoWrap) - return true; - if (!columnFlexItemHasStretchAlignment(this)) - return true; - } - - return false; -} - -void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, - const RenderBlock* containingBlock, - LayoutUnit containerWidth, - LayoutUnit childWidth, - LayoutUnit& marginStart, - LayoutUnit& marginEnd, - Length marginStartLength, - Length marginEndLength) const { - if (flowDirection == BlockDirection || isInline()) { - // Margins are calculated with respect to the logical width of - // the containing block (8.3) - // Inline blocks/tables and floats don't have their margins increased. - marginStart = minimumValueForLength(marginStartLength, containerWidth); - marginEnd = minimumValueForLength(marginEndLength, containerWidth); - return; - } - - if (containingBlock->isFlexibleBox()) { - // We need to let flexbox handle the margin adjustment - otherwise, flexbox - // will think we're wider than we actually are and calculate line sizes - // wrong. See also http://dev.w3.org/csswg/css-flexbox/#auto-margins - if (marginStartLength.isAuto()) - marginStartLength.setValue(0); - if (marginEndLength.isAuto()) - marginEndLength.setValue(0); - } - - LayoutUnit marginStartWidth = - minimumValueForLength(marginStartLength, containerWidth); - LayoutUnit marginEndWidth = - minimumValueForLength(marginEndLength, containerWidth); - - // CSS 2.1 (10.3.3): "If 'width' is not 'auto' and 'border-left-width' + - // 'padding-left' + 'width' + 'padding-right' + 'border-right-width' (plus any - // of 'margin-left' or 'margin-right' that are not 'auto') is larger than the - // width of the containing block, then any 'auto' values for 'margin-left' or - // 'margin-right' are, for the following rules, treated as zero. - LayoutUnit marginBoxWidth = - childWidth + (!style()->width().isAuto() - ? marginStartWidth + marginEndWidth - : LayoutUnit()); - - // CSS 2.1: "If both 'margin-left' and 'margin-right' are 'auto', their used - // values are equal. This horizontally centers the element with respect to the - // edges of the containing block." - if (marginStartLength.isAuto() && marginEndLength.isAuto() && - marginBoxWidth < containerWidth) { - // Other browsers center the margin box for align=center elements so we - // match them here. - LayoutUnit centeredMarginBoxStart = std::max( - 0, - (containerWidth - childWidth - marginStartWidth - marginEndWidth) / 2); - marginStart = centeredMarginBoxStart + marginStartWidth; - marginEnd = containerWidth - childWidth - marginStart + marginEndWidth; - return; - } - - // CSS 2.1: "If there is exactly one value specified as 'auto', its used value - // follows from the equality." - if (marginEndLength.isAuto() && marginBoxWidth < containerWidth) { - marginStart = marginStartWidth; - marginEnd = containerWidth - childWidth - marginStart; - return; - } - - if (marginStartLength.isAuto() && marginBoxWidth < containerWidth) { - marginEnd = marginEndWidth; - marginStart = containerWidth - childWidth - marginEnd; - return; - } - - // Either no auto margins, or our margin box width is >= the container width, - // auto margins will just turn into 0. - marginStart = marginStartWidth; - marginEnd = marginEndWidth; -} - -void RenderBox::updateLogicalHeight() { - m_intrinsicContentLogicalHeight = contentLogicalHeight(); - - LogicalExtentComputedValues computedValues; - computeLogicalHeight(logicalHeight(), logicalTop(), computedValues); - - setLogicalHeight(computedValues.m_extent); - setLogicalTop(computedValues.m_position); - setMarginBefore(computedValues.m_margins.m_before); - setMarginAfter(computedValues.m_margins.m_after); -} - -void RenderBox::computeLogicalHeight( - LayoutUnit logicalHeight, - LayoutUnit logicalTop, - LogicalExtentComputedValues& computedValues) const { - computedValues.m_extent = logicalHeight; - computedValues.m_position = logicalTop; - - // Cell height is managed by the table and inline non-replaced elements do not - // support a height property. - if (isInline() && !isReplaced()) - return; - - Length h; - if (isOutOfFlowPositioned()) - computePositionedLogicalHeight(computedValues); - else { - RenderBlock* cb = containingBlock(); - - // If we are perpendicular to our containing block then we need to resolve - // our block-start and block-end margins so that if they are 'auto' we are - // centred or aligned within the inline flow containing block: this is done - // by computing the margins as though they are inline. Note that as this is - // the 'sizing phase' we are using our own writing mode rather than the - // containing block's. We use the containing block's writing mode when - // figuring out the block-direction margins for positioning in - // |computeAndSetBlockDirectionMargins| (i.e. margin collapsing etc.). See - // http://www.w3.org/TR/2014/CR-css-writing-modes-3-20140320/#orthogonal-flows - // FIXME(sky): Remove MarginDirection enum. - MarginDirection flowDirection = BlockDirection; - - bool treatAsReplaced = shouldComputeSizeAsReplaced(); - bool checkMinMaxHeight = false; - - // The parent box is flexing us, so it has increased or decreased our - // height. We have to grab our cached flexible height. - // FIXME: Account for block-flow in flexible boxes. - // https://bugs.webkit.org/show_bug.cgi?id=46418 - if (hasOverrideHeight() && parent()->isFlexibleBox()) - h = Length(overrideLogicalContentHeight(), Fixed); - else if (treatAsReplaced) - h = Length(computeReplacedLogicalHeight(), Fixed); - else { - h = style()->logicalHeight(); - checkMinMaxHeight = true; - } - - LayoutUnit heightResult; - if (checkMinMaxHeight) { - heightResult = computeLogicalHeightUsing( - style()->logicalHeight(), - computedValues.m_extent - borderAndPaddingLogicalHeight()); - if (heightResult == -1) - heightResult = computedValues.m_extent; - heightResult = constrainLogicalHeightByMinMax( - heightResult, - computedValues.m_extent - borderAndPaddingLogicalHeight()); - } else { - // The only times we don't check min/max height are when a fixed length - // has been given as an override. Just use that. The value has already - // been adjusted for box-sizing. - ASSERT(h.isFixed()); - heightResult = h.value() + borderAndPaddingLogicalHeight(); - } - - computedValues.m_extent = heightResult; - computeMarginsForDirection( - flowDirection, cb, containingBlockLogicalWidthForContent(), - computedValues.m_extent, computedValues.m_margins.m_before, - computedValues.m_margins.m_after, style()->marginBefore(), - style()->marginAfter()); - } -} - -LayoutUnit RenderBox::computeLogicalHeightUsing( - const Length& height, - LayoutUnit intrinsicContentHeight) const { - LayoutUnit logicalHeight = - computeContentLogicalHeightUsing(height, intrinsicContentHeight); - if (logicalHeight != -1) - logicalHeight = adjustBorderBoxLogicalHeightForBoxSizing(logicalHeight); - return logicalHeight; -} - -LayoutUnit RenderBox::computeContentLogicalHeight( - const Length& height, - LayoutUnit intrinsicContentHeight) const { - LayoutUnit heightIncludingScrollbar = - computeContentLogicalHeightUsing(height, intrinsicContentHeight); - if (heightIncludingScrollbar == -1) - return -1; - return std::max( - 0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar)); -} - -LayoutUnit RenderBox::computeIntrinsicLogicalContentHeightUsing( - const Length& logicalHeightLength, - LayoutUnit intrinsicContentHeight, - LayoutUnit borderAndPadding) const { - // FIXME(cbiesinger): The css-sizing spec is considering changing what - // min-content/max-content should resolve to. If that happens, this code will - // have to change. - if (logicalHeightLength.isMinContent() || - logicalHeightLength.isMaxContent() || - logicalHeightLength.isFitContent()) { - if (isReplaced()) - return intrinsicSize().height(); - if (m_intrinsicContentLogicalHeight != -1) - return m_intrinsicContentLogicalHeight; - return intrinsicContentHeight; - } - if (logicalHeightLength.isFillAvailable()) - return containingBlock()->availableLogicalHeight( - ExcludeMarginBorderPadding) - - borderAndPadding; - ASSERT_NOT_REACHED(); - return 0; -} - -LayoutUnit RenderBox::computeContentLogicalHeightUsing( - const Length& height, - LayoutUnit intrinsicContentHeight) const { - // FIXME(cbiesinger): The css-sizing spec is considering changing what - // min-content/max-content should resolve to. If that happens, this code will - // have to change. - if (height.isIntrinsic()) { - if (intrinsicContentHeight == -1) - return -1; // Intrinsic height isn't available. - return computeIntrinsicLogicalContentHeightUsing( - height, intrinsicContentHeight, borderAndPaddingLogicalHeight()); - } - if (height.isFixed()) - return height.value(); - return -1; -} - -// FIXME(sky): Remove -bool RenderBox::skipContainingBlockForPercentHeightCalculation( - const RenderBox* containingBlock) const { - return false; -} - -LayoutUnit RenderBox::computeReplacedLogicalWidth( - ShouldComputePreferred shouldComputePreferred) const { - return computeReplacedLogicalWidthRespectingMinMaxWidth( - computeReplacedLogicalWidthUsing(style()->logicalWidth()), - shouldComputePreferred); -} - -LayoutUnit RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth( - LayoutUnit logicalWidth, - ShouldComputePreferred shouldComputePreferred) const { - LayoutUnit minLogicalWidth = - (shouldComputePreferred == ComputePreferred && - style()->logicalMinWidth().isPercent()) || - style()->logicalMinWidth().isMaxSizeNone() - ? logicalWidth - : computeReplacedLogicalWidthUsing(style()->logicalMinWidth()); - LayoutUnit maxLogicalWidth = - (shouldComputePreferred == ComputePreferred && - style()->logicalMaxWidth().isPercent()) || - style()->logicalMaxWidth().isMaxSizeNone() - ? logicalWidth - : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth()); - return std::max(minLogicalWidth, std::min(logicalWidth, maxLogicalWidth)); -} - -LayoutUnit RenderBox::computeReplacedLogicalWidthUsing( - const Length& logicalWidth) const { - switch (logicalWidth.type()) { - case Fixed: - return adjustContentBoxLogicalWidthForBoxSizing(logicalWidth.value()); - case MinContent: - case MaxContent: { - // MinContent/MaxContent don't need the availableLogicalWidth argument. - LayoutUnit availableLogicalWidth = 0; - return computeIntrinsicLogicalWidthUsing(logicalWidth, - availableLogicalWidth, - borderAndPaddingLogicalWidth()) - - borderAndPaddingLogicalWidth(); - } - case FitContent: - case FillAvailable: - case Percent: - case Calculated: { - // FIXME: containingBlockLogicalWidthForContent() is wrong if the replaced - // element's block-flow is perpendicular to the containing block's - // block-flow. https://bugs.webkit.org/show_bug.cgi?id=46496 - const LayoutUnit cw = isOutOfFlowPositioned() - ? containingBlockLogicalWidthForPositioned( - toRenderBoxModelObject(container())) - : containingBlockLogicalWidthForContent(); - Length containerLogicalWidth = containingBlock()->style()->logicalWidth(); - // FIXME: Handle cases when containing block width is calculated or - // viewport percent. https://bugs.webkit.org/show_bug.cgi?id=91071 - if (logicalWidth.isIntrinsic()) - return computeIntrinsicLogicalWidthUsing( - logicalWidth, cw, borderAndPaddingLogicalWidth()) - - borderAndPaddingLogicalWidth(); - if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || - containerLogicalWidth.isPercent()))) - return adjustContentBoxLogicalWidthForBoxSizing( - minimumValueForLength(logicalWidth, cw)); - return 0; - } - case Intrinsic: - case MinIntrinsic: - case Auto: - case MaxSizeNone: - return intrinsicLogicalWidth(); - case DeviceWidth: - case DeviceHeight: - break; - } - - ASSERT_NOT_REACHED(); - return 0; -} - -LayoutUnit RenderBox::computeReplacedLogicalHeight() const { - return computeReplacedLogicalHeightRespectingMinMaxHeight( - computeReplacedLogicalHeightUsing(style()->logicalHeight())); -} - -bool RenderBox::logicalHeightComputesAsNone(SizeType sizeType) const { - ASSERT(sizeType == MinSize || sizeType == MaxSize); - Length logicalHeight = sizeType == MinSize ? style()->logicalMinHeight() - : style()->logicalMaxHeight(); - Length initialLogicalHeight = sizeType == MinSize - ? RenderStyle::initialMinSize() - : RenderStyle::initialMaxSize(); - - if (logicalHeight == initialLogicalHeight) - return true; - - if (!logicalHeight.isPercent() || isOutOfFlowPositioned()) - return false; - - return containingBlock()->hasAutoHeightOrContainingBlockWithAutoHeight(); -} - -LayoutUnit RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight( - LayoutUnit logicalHeight) const { - // If the height of the containing block is not specified explicitly (i.e., it - // depends on content height), and this element is not absolutely positioned, - // the percentage value is treated as '0' (for 'min-height') or 'none' (for - // 'max-height'). - LayoutUnit minLogicalHeight; - if (!logicalHeightComputesAsNone(MinSize)) - minLogicalHeight = - computeReplacedLogicalHeightUsing(style()->logicalMinHeight()); - LayoutUnit maxLogicalHeight = logicalHeight; - if (!logicalHeightComputesAsNone(MaxSize)) - maxLogicalHeight = - computeReplacedLogicalHeightUsing(style()->logicalMaxHeight()); - return std::max(minLogicalHeight, std::min(logicalHeight, maxLogicalHeight)); -} - -LayoutUnit RenderBox::computeReplacedLogicalHeightUsing( - const Length& logicalHeight) const { - switch (logicalHeight.type()) { - case Fixed: - return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value()); - case Percent: - case Calculated: { - RenderObject* cb = - isOutOfFlowPositioned() ? container() : containingBlock(); - if (cb->isRenderBlock()) - toRenderBlock(cb)->addPercentHeightDescendant( - const_cast(this)); - - // FIXME: This calculation is not patched for block-flow yet. - // https://bugs.webkit.org/show_bug.cgi?id=46500 - if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() && - !(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) { - ASSERT_WITH_SECURITY_IMPLICATION(cb->isRenderBlock()); - RenderBlock* block = toRenderBlock(cb); - LogicalExtentComputedValues computedValues; - block->computeLogicalHeight(block->logicalHeight(), 0, computedValues); - LayoutUnit newContentHeight = - computedValues.m_extent - block->borderAndPaddingLogicalHeight(); - LayoutUnit newHeight = - block->adjustContentBoxLogicalHeightForBoxSizing(newContentHeight); - return adjustContentBoxLogicalHeightForBoxSizing( - valueForLength(logicalHeight, newHeight)); - } - - // FIXME: availableLogicalHeight() is wrong if the replaced element's - // block-flow is perpendicular to the containing block's block-flow. - // https://bugs.webkit.org/show_bug.cgi?id=46496 - LayoutUnit availableHeight; - if (isOutOfFlowPositioned()) - availableHeight = containingBlockLogicalHeightForPositioned( - toRenderBoxModelObject(cb)); - else { - availableHeight = - containingBlockLogicalHeightForContent(IncludeMarginBorderPadding); - // It is necessary to use the border-box to match WinIE's broken - // box model. This is essential for sizing inside - // table cells using percentage heights. - // FIXME: This needs to be made block-flow-aware. If the cell and image - // are perpendicular block-flows, this isn't right. - // https://bugs.webkit.org/show_bug.cgi?id=46997 - while (cb && !cb->isRenderView() && - (cb->style()->logicalHeight().isAuto() || - cb->style()->logicalHeight().isPercent())) { - toRenderBlock(cb)->addPercentHeightDescendant( - const_cast(this)); - cb = cb->containingBlock(); - } - } - return adjustContentBoxLogicalHeightForBoxSizing( - valueForLength(logicalHeight, availableHeight)); - } - case MinContent: - case MaxContent: - case FitContent: - case FillAvailable: - return adjustContentBoxLogicalHeightForBoxSizing( - computeIntrinsicLogicalContentHeightUsing(logicalHeight, - intrinsicLogicalHeight(), - borderAndPaddingHeight())); - default: - return intrinsicLogicalHeight(); - } -} - -LayoutUnit RenderBox::availableLogicalHeight( - AvailableLogicalHeightType heightType) const { - // http://www.w3.org/TR/CSS2/visudet.html#propdef-height - We are interested - // in the content height. - return constrainContentBoxLogicalHeightByMinMax( - availableLogicalHeightUsing(style()->logicalHeight(), heightType), -1); -} - -LayoutUnit RenderBox::availableLogicalHeightUsing( - const Length& h, - AvailableLogicalHeightType heightType) const { - if (isRenderView()) { - ASSERT_NOT_REACHED(); - return LayoutUnit(); - } - - if (h.isPercent() && isOutOfFlowPositioned()) { - // FIXME: This is wrong if the containingBlock has a perpendicular writing - // mode. - LayoutUnit availableHeight = - containingBlockLogicalHeightForPositioned(containingBlock()); - return adjustContentBoxLogicalHeightForBoxSizing( - valueForLength(h, availableHeight)); - } - - LayoutUnit heightIncludingScrollbar = computeContentLogicalHeightUsing(h, -1); - if (heightIncludingScrollbar != -1) - return std::max( - 0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar)); - - // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical - // writing-mode. https://bugs.webkit.org/show_bug.cgi?id=46500 - if (isRenderBlock() && isOutOfFlowPositioned() && - style()->height().isAuto() && - !(style()->top().isAuto() || style()->bottom().isAuto())) { - RenderBlock* block = const_cast(toRenderBlock(this)); - LogicalExtentComputedValues computedValues; - block->computeLogicalHeight(block->logicalHeight(), 0, computedValues); - LayoutUnit newContentHeight = - computedValues.m_extent - block->borderAndPaddingLogicalHeight(); - return adjustContentBoxLogicalHeightForBoxSizing(newContentHeight); - } - - // FIXME: This is wrong if the containingBlock has a perpendicular writing - // mode. - LayoutUnit availableHeight = - containingBlockLogicalHeightForContent(heightType); - if (heightType == ExcludeMarginBorderPadding) { - // FIXME: Margin collapsing hasn't happened yet, so this incorrectly removes - // collapsed margins. - availableHeight -= - marginBefore() + marginAfter() + borderAndPaddingLogicalHeight(); - } - return availableHeight; -} - -void RenderBox::computeAndSetBlockDirectionMargins( - const RenderBlock* containingBlock) { - LayoutUnit marginBefore; - LayoutUnit marginAfter; - computeMarginsForDirection( - BlockDirection, containingBlock, containingBlockLogicalWidthForContent(), - logicalHeight(), marginBefore, marginAfter, - style()->marginBeforeUsing(containingBlock->style()), - style()->marginAfterUsing(containingBlock->style())); - // Note that in this 'positioning phase' of the layout we are using the - // containing block's writing mode rather than our own when calculating - // margins. See - // http://www.w3.org/TR/2014/CR-css-writing-modes-3-20140320/#orthogonal-flows - containingBlock->setMarginBeforeForChild(this, marginBefore); - containingBlock->setMarginAfterForChild(this, marginAfter); -} - -LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned( - const RenderBoxModelObject* containingBlock) const { - ASSERT(containingBlock->isBox()); - return toRenderBox(containingBlock)->clientLogicalWidth(); -} - -LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned( - const RenderBoxModelObject* containingBlock) const { - ASSERT(containingBlock->isBox()); - const RenderBlock* cb = containingBlock->isRenderBlock() - ? toRenderBlock(containingBlock) - : containingBlock->containingBlock(); - return cb->clientLogicalHeight(); -} - -static void computePositionedStaticDistance(Length& leftOrTop, - Length& rightOrBottom) { - if (!leftOrTop.isAuto() || !rightOrBottom.isAuto()) - return; - leftOrTop.setValue(Fixed, 0); -} - -void RenderBox::computePositionedLogicalWidth( - LogicalExtentComputedValues& computedValues) const { - if (isReplaced()) { - computePositionedLogicalWidthReplaced(computedValues); - return; - } - - // QUESTIONS - // FIXME 1: Should we still deal with these the cases of 'left' or 'right' - // having the type 'static' in determining whether to calculate the static - // distance? NOTE: 'static' is not a legal value for 'left' or 'right' as of - // CSS 2.1. - - // FIXME 2: Can perhaps optimize out cases when max-width/min-width are - // greater than or less than the computed width(). Be careful of box-sizing - // and percentage issues. - - // The following is based off of the W3C Working Draft from April 11, 2006 of - // CSS 2.1: Section 10.3.7 "Absolutely positioned, non-replaced elements" - // - // (block-style-comments in this function and in - // computePositionedLogicalWidthUsing() correspond to text from the spec) - - // We don't use containingBlock(), since we may be positioned by an enclosing - // relative positioned inline. - const RenderBoxModelObject* containerBlock = - toRenderBoxModelObject(container()); - - const LayoutUnit containerLogicalWidth = - containingBlockLogicalWidthForPositioned(containerBlock); - - // Use the container block's direction except when calculating the static - // distance This conforms with the reference results for - // abspos-replaced-width-margin-000.htm of the CSS 2.1 test suite - TextDirection containerDirection = containerBlock->style()->direction(); - - const LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth(); - const Length marginLogicalLeft = style()->marginLeft(); - const Length marginLogicalRight = style()->marginRight(); - - Length logicalLeftLength = style()->logicalLeft(); - Length logicalRightLength = style()->logicalRight(); - - /*---------------------------------------------------------------------------*\ - * For the purposes of this section and the next, the term "static position" - * (of an element) refers, roughly, to the position an element would have had - * in the normal flow. More precisely: - * - * * The static position for 'left' is the distance from the left edge of the - * containing block to the left margin edge of a hypothetical box that would - * have been the first box of the element if its 'position' property had - * been 'static' and 'float' had been 'none'. The value is negative if the - * hypothetical box is to the left of the containing block. - * * The static position for 'right' is the distance from the right edge of - the - * containing block to the right margin edge of the same hypothetical box as - * above. The value is positive if the hypothetical box is to the left of - the - * containing block's edge. - * - * But rather than actually calculating the dimensions of that hypothetical - box, - * user agents are free to make a guess at its probable position. - * - * For the purposes of calculating the static position, the containing block - of - * fixed positioned elements is the initial containing block instead of the - * viewport, and all scrollable boxes should be assumed to be scrolled to - their - * origin. - \*---------------------------------------------------------------------------*/ - - // see FIXME 1 - // Calculate the static distance if needed. - computePositionedStaticDistance(logicalLeftLength, logicalRightLength); - - // Calculate constraint equation values for 'width' case. - computePositionedLogicalWidthUsing(style()->logicalWidth(), containerBlock, - containerDirection, containerLogicalWidth, - bordersPlusPadding, logicalLeftLength, - logicalRightLength, marginLogicalLeft, - marginLogicalRight, computedValues); - - // Calculate constraint equation values for 'max-width' case. - if (!style()->logicalMaxWidth().isMaxSizeNone()) { - LogicalExtentComputedValues maxValues; - - computePositionedLogicalWidthUsing( - style()->logicalMaxWidth(), containerBlock, containerDirection, - containerLogicalWidth, bordersPlusPadding, logicalLeftLength, - logicalRightLength, marginLogicalLeft, marginLogicalRight, maxValues); - - if (computedValues.m_extent > maxValues.m_extent) { - computedValues.m_extent = maxValues.m_extent; - computedValues.m_position = maxValues.m_position; - computedValues.m_margins.m_start = maxValues.m_margins.m_start; - computedValues.m_margins.m_end = maxValues.m_margins.m_end; - } - } - - // Calculate constraint equation values for 'min-width' case. - if (!style()->logicalMinWidth().isZero() || - style()->logicalMinWidth().isIntrinsic()) { - LogicalExtentComputedValues minValues; - - computePositionedLogicalWidthUsing( - style()->logicalMinWidth(), containerBlock, containerDirection, - containerLogicalWidth, bordersPlusPadding, logicalLeftLength, - logicalRightLength, marginLogicalLeft, marginLogicalRight, minValues); - - if (computedValues.m_extent < minValues.m_extent) { - computedValues.m_extent = minValues.m_extent; - computedValues.m_position = minValues.m_position; - computedValues.m_margins.m_start = minValues.m_margins.m_start; - computedValues.m_margins.m_end = minValues.m_margins.m_end; - } - } - - computedValues.m_extent += bordersPlusPadding; -} - -static void computeLogicalLeftPositionedOffset( - LayoutUnit& logicalLeftPos, - const RenderBox* child, - LayoutUnit logicalWidthValue, - const RenderBoxModelObject* containerBlock, - LayoutUnit containerLogicalWidth) { - // FIXME(sky): Remove - logicalLeftPos += containerBlock->borderLeft(); -} - -void RenderBox::shrinkToFitWidth( - const LayoutUnit availableSpace, - const LayoutUnit logicalLeftValue, - const LayoutUnit bordersPlusPadding, - LogicalExtentComputedValues& computedValues) const { - // FIXME: would it be better to have shrink-to-fit in one step? - LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding; - LayoutUnit preferredMinWidth = - minPreferredLogicalWidth() - bordersPlusPadding; - LayoutUnit availableWidth = availableSpace - logicalLeftValue; - computedValues.m_extent = - std::min(std::max(preferredMinWidth, availableWidth), preferredWidth); -} - -void RenderBox::computePositionedLogicalWidthUsing( - Length logicalWidth, - const RenderBoxModelObject* containerBlock, - TextDirection containerDirection, - LayoutUnit containerLogicalWidth, - LayoutUnit bordersPlusPadding, - const Length& logicalLeft, - const Length& logicalRight, - const Length& marginLogicalLeft, - const Length& marginLogicalRight, - LogicalExtentComputedValues& computedValues) const { - if (logicalWidth.isIntrinsic()) - logicalWidth = - Length(computeIntrinsicLogicalWidthUsing( - logicalWidth, containerLogicalWidth, bordersPlusPadding) - - bordersPlusPadding, - Fixed); - - // 'left' and 'right' cannot both be 'auto' because one would of been - // converted to the static position already - ASSERT(!(logicalLeft.isAuto() && logicalRight.isAuto())); - - LayoutUnit logicalLeftValue = 0; - - const LayoutUnit containerRelativeLogicalWidth = - containingBlockLogicalWidthForPositioned(containerBlock); - - bool logicalWidthIsAuto = logicalWidth.isIntrinsicOrAuto(); - bool logicalLeftIsAuto = logicalLeft.isAuto(); - bool logicalRightIsAuto = logicalRight.isAuto(); - LayoutUnit& marginLogicalLeftValue = style()->isLeftToRightDirection() - ? computedValues.m_margins.m_start - : computedValues.m_margins.m_end; - LayoutUnit& marginLogicalRightValue = style()->isLeftToRightDirection() - ? computedValues.m_margins.m_end - : computedValues.m_margins.m_start; - if (!logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) { - /*-----------------------------------------------------------------------*\ - * If none of the three is 'auto': If both 'margin-left' and 'margin- - * right' are 'auto', solve the equation under the extra constraint that - * the two margins get equal values, unless this would make them negative, - * in which case when direction of the containing block is 'ltr' ('rtl'), - * set 'margin-left' ('margin-right') to zero and solve for 'margin-right' - * ('margin-left'). If one of 'margin-left' or 'margin-right' is 'auto', - * solve the equation for that value. If the values are over-constrained, - * ignore the value for 'left' (in case the 'direction' property of the - * containing block is 'rtl') or 'right' (in case 'direction' is 'ltr') - * and solve for that value. - \*-----------------------------------------------------------------------*/ - // NOTE: It is not necessary to solve for 'right' in the over constrained - // case because the value is not used for any further calculations. - - logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); - computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing( - valueForLength(logicalWidth, containerLogicalWidth)); - - const LayoutUnit availableSpace = - containerLogicalWidth - - (logicalLeftValue + computedValues.m_extent + - valueForLength(logicalRight, containerLogicalWidth) + - bordersPlusPadding); - - // Margins are now the only unknown - if (marginLogicalLeft.isAuto() && marginLogicalRight.isAuto()) { - // Both margins auto, solve for equality - if (availableSpace >= 0) { - marginLogicalLeftValue = availableSpace / 2; // split the difference - marginLogicalRightValue = - availableSpace - - marginLogicalLeftValue; // account for odd valued differences - } else { - // Use the containing block's direction rather than the parent block's - // per CSS 2.1 reference test abspos-non-replaced-width-margin-000. - if (containerDirection == LTR) { - marginLogicalLeftValue = 0; - marginLogicalRightValue = availableSpace; // will be negative - } else { - marginLogicalLeftValue = availableSpace; // will be negative - marginLogicalRightValue = 0; - } - } - } else if (marginLogicalLeft.isAuto()) { - // Solve for left margin - marginLogicalRightValue = - valueForLength(marginLogicalRight, containerRelativeLogicalWidth); - marginLogicalLeftValue = availableSpace - marginLogicalRightValue; - } else if (marginLogicalRight.isAuto()) { - // Solve for right margin - marginLogicalLeftValue = - valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); - marginLogicalRightValue = availableSpace - marginLogicalLeftValue; - } else { - // Over-constrained, solve for left if direction is RTL - marginLogicalLeftValue = - valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); - marginLogicalRightValue = - valueForLength(marginLogicalRight, containerRelativeLogicalWidth); - - // Use the containing block's direction rather than the parent block's - // per CSS 2.1 reference test abspos-non-replaced-width-margin-000. - if (containerDirection == RTL) - logicalLeftValue = (availableSpace + logicalLeftValue) - - marginLogicalLeftValue - marginLogicalRightValue; - } - } else { - /*--------------------------------------------------------------------*\ - * Otherwise, set 'auto' values for 'margin-left' and 'margin-right' - * to 0, and pick the one of the following six rules that applies. - * - * 1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the - * width is shrink-to-fit. Then solve for 'left' - * - * OMIT RULE 2 AS IT SHOULD NEVER BE HIT - * ------------------------------------------------------------------ - * 2. 'left' and 'right' are 'auto' and 'width' is not 'auto', then if - * the 'direction' property of the containing block is 'ltr' set - * 'left' to the static position, otherwise set 'right' to the - * static position. Then solve for 'left' (if 'direction is 'rtl') - * or 'right' (if 'direction' is 'ltr'). - * ------------------------------------------------------------------ - * - * 3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the - * width is shrink-to-fit . Then solve for 'right' - * 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve - * for 'left' - * 5. 'width' is 'auto', 'left' and 'right' are not 'auto', then solve - * for 'width' - * 6. 'right' is 'auto', 'left' and 'width' are not 'auto', then solve - * for 'right' - * - * Calculation of the shrink-to-fit width is similar to calculating the - * width of a table cell using the automatic table layout algorithm. - * Roughly: calculate the preferred width by formatting the content - * without breaking lines other than where explicit line breaks occur, - * and also calculate the preferred minimum width, e.g., by trying all - * possible line breaks. CSS 2.1 does not define the exact algorithm. - * Thirdly, calculate the available width: this is found by solving - * for 'width' after setting 'left' (in case 1) or 'right' (in case 3) - * to 0. - * - * Then the shrink-to-fit width is: - * min(max(preferred minimum width, available width), preferred width). - \*--------------------------------------------------------------------*/ - // NOTE: For rules 3 and 6 it is not necessary to solve for 'right' - // because the value is not used for any further calculations. - - // Calculate margins, 'auto' margins are ignored. - marginLogicalLeftValue = - minimumValueForLength(marginLogicalLeft, containerRelativeLogicalWidth); - marginLogicalRightValue = minimumValueForLength( - marginLogicalRight, containerRelativeLogicalWidth); - - const LayoutUnit availableSpace = - containerLogicalWidth - - (marginLogicalLeftValue + marginLogicalRightValue + bordersPlusPadding); - - // FIXME: Is there a faster way to find the correct case? - // Use rule/case that applies. - if (logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) { - // RULE 1: (use shrink-to-fit for width, and solve of left) - LayoutUnit logicalRightValue = - valueForLength(logicalRight, containerLogicalWidth); - - // FIXME: would it be better to have shrink-to-fit in one step? - LayoutUnit preferredWidth = - maxPreferredLogicalWidth() - bordersPlusPadding; - LayoutUnit preferredMinWidth = - minPreferredLogicalWidth() - bordersPlusPadding; - LayoutUnit availableWidth = availableSpace - logicalRightValue; - computedValues.m_extent = - std::min(std::max(preferredMinWidth, availableWidth), preferredWidth); - logicalLeftValue = - availableSpace - (computedValues.m_extent + logicalRightValue); - } else if (!logicalLeftIsAuto && logicalWidthIsAuto && logicalRightIsAuto) { - // RULE 3: (use shrink-to-fit for width, and no need solve of right) - logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); - - shrinkToFitWidth(availableSpace, logicalLeftValue, bordersPlusPadding, - computedValues); - } else if (logicalLeftIsAuto && !logicalWidthIsAuto && - !logicalRightIsAuto) { - // RULE 4: (solve for left) - computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing( - valueForLength(logicalWidth, containerLogicalWidth)); - logicalLeftValue = availableSpace - - (computedValues.m_extent + - valueForLength(logicalRight, containerLogicalWidth)); - } else if (!logicalLeftIsAuto && logicalWidthIsAuto && - !logicalRightIsAuto) { - // RULE 5: (solve for width) - logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); - computedValues.m_extent = - availableSpace - - (logicalLeftValue + - valueForLength(logicalRight, containerLogicalWidth)); - } else if (!logicalLeftIsAuto && !logicalWidthIsAuto && - logicalRightIsAuto) { - // RULE 6: (no need solve for right) - logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); - computedValues.m_extent = adjustContentBoxLogicalWidthForBoxSizing( - valueForLength(logicalWidth, containerLogicalWidth)); - } - } - - // Use computed values to calculate the horizontal position. - - // FIXME: This hack is needed to calculate the logical left position for a - // 'rtl' relatively positioned, inline because right now, it is using the - // logical left position of the first line box when really it should use the - // last line box. When this is fixed elsewhere, this block should be removed. - if (containerBlock->isRenderInline() && - !containerBlock->style()->isLeftToRightDirection()) { - const RenderInline* flow = toRenderInline(containerBlock); - InlineFlowBox* firstLine = flow->firstLineBox(); - InlineFlowBox* lastLine = flow->lastLineBox(); - if (firstLine && lastLine && firstLine != lastLine) { - computedValues.m_position = - logicalLeftValue + marginLogicalLeftValue + - lastLine->borderLogicalLeft() + - (lastLine->logicalLeft() - firstLine->logicalLeft()); - return; - } - } - - computedValues.m_position = logicalLeftValue + marginLogicalLeftValue; - computeLogicalLeftPositionedOffset(computedValues.m_position, this, - computedValues.m_extent, containerBlock, - containerLogicalWidth); -} - -void RenderBox::computePositionedLogicalHeight( - LogicalExtentComputedValues& computedValues) const { - if (isReplaced()) { - computePositionedLogicalHeightReplaced(computedValues); - return; - } - - // The following is based off of the W3C Working Draft from April 11, 2006 of - // CSS 2.1: Section 10.6.4 "Absolutely positioned, non-replaced elements" - // - // (block-style-comments in this function and in - // computePositionedLogicalHeightUsing() correspond to text from the spec) - - // We don't use containingBlock(), since we may be positioned by an enclosing - // relpositioned inline. - const RenderBoxModelObject* containerBlock = - toRenderBoxModelObject(container()); - - const LayoutUnit containerLogicalHeight = - containingBlockLogicalHeightForPositioned(containerBlock); - - RenderStyle* styleToUse = style(); - const LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight(); - const Length marginBefore = styleToUse->marginBefore(); - const Length marginAfter = styleToUse->marginAfter(); - Length logicalTopLength = styleToUse->logicalTop(); - Length logicalBottomLength = styleToUse->logicalBottom(); - - /*---------------------------------------------------------------------------*\ - * For the purposes of this section and the next, the term "static position" - * (of an element) refers, roughly, to the position an element would have had - * in the normal flow. More precisely, the static position for 'top' is the - * distance from the top edge of the containing block to the top margin edge - * of a hypothetical box that would have been the first box of the element if - * its 'position' property had been 'static' and 'float' had been 'none'. The - * value is negative if the hypothetical box is above the containing block. - * - * But rather than actually calculating the dimensions of that hypothetical - * box, user agents are free to make a guess at its probable position. - * - * For the purposes of calculating the static position, the containing block - * of fixed positioned elements is the initial containing block instead of - * the viewport. - \*---------------------------------------------------------------------------*/ - - // see FIXME 1 - // Calculate the static distance if needed. - computePositionedStaticDistance(logicalTopLength, logicalBottomLength); - - // Calculate constraint equation values for 'height' case. - LayoutUnit logicalHeight = computedValues.m_extent; - computePositionedLogicalHeightUsing( - styleToUse->logicalHeight(), containerBlock, containerLogicalHeight, - bordersPlusPadding, logicalHeight, logicalTopLength, logicalBottomLength, - marginBefore, marginAfter, computedValues); - - // Avoid doing any work in the common case (where the values of min-height and - // max-height are their defaults). see FIXME 2 - - // Calculate constraint equation values for 'max-height' case. - if (!styleToUse->logicalMaxHeight().isMaxSizeNone()) { - LogicalExtentComputedValues maxValues; - - computePositionedLogicalHeightUsing( - styleToUse->logicalMaxHeight(), containerBlock, containerLogicalHeight, - bordersPlusPadding, logicalHeight, logicalTopLength, - logicalBottomLength, marginBefore, marginAfter, maxValues); - - if (computedValues.m_extent > maxValues.m_extent) { - computedValues.m_extent = maxValues.m_extent; - computedValues.m_position = maxValues.m_position; - computedValues.m_margins.m_before = maxValues.m_margins.m_before; - computedValues.m_margins.m_after = maxValues.m_margins.m_after; - } - } - - // Calculate constraint equation values for 'min-height' case. - if (!styleToUse->logicalMinHeight().isZero() || - styleToUse->logicalMinHeight().isIntrinsic()) { - LogicalExtentComputedValues minValues; - - computePositionedLogicalHeightUsing( - styleToUse->logicalMinHeight(), containerBlock, containerLogicalHeight, - bordersPlusPadding, logicalHeight, logicalTopLength, - logicalBottomLength, marginBefore, marginAfter, minValues); - - if (computedValues.m_extent < minValues.m_extent) { - computedValues.m_extent = minValues.m_extent; - computedValues.m_position = minValues.m_position; - computedValues.m_margins.m_before = minValues.m_margins.m_before; - computedValues.m_margins.m_after = minValues.m_margins.m_after; - } - } - - // Set final height value. - computedValues.m_extent += bordersPlusPadding; -} - -static void computeLogicalTopPositionedOffset( - LayoutUnit& logicalTopPos, - const RenderBox* child, - LayoutUnit logicalHeightValue, - const RenderBoxModelObject* containerBlock, - LayoutUnit containerLogicalHeight) { - // FIXME(sky): Remove - logicalTopPos += containerBlock->borderTop(); -} - -void RenderBox::computePositionedLogicalHeightUsing( - Length logicalHeightLength, - const RenderBoxModelObject* containerBlock, - LayoutUnit containerLogicalHeight, - LayoutUnit bordersPlusPadding, - LayoutUnit logicalHeight, - const Length& logicalTop, - const Length& logicalBottom, - const Length& marginBefore, - const Length& marginAfter, - LogicalExtentComputedValues& computedValues) const { - // 'top' and 'bottom' cannot both be 'auto' because 'top would of been - // converted to the static position in computePositionedLogicalHeight() - ASSERT(!(logicalTop.isAuto() && logicalBottom.isAuto())); - - LayoutUnit logicalHeightValue; - LayoutUnit contentLogicalHeight = logicalHeight - bordersPlusPadding; - - const LayoutUnit containerRelativeLogicalWidth = - containingBlockLogicalWidthForPositioned(containerBlock); - - LayoutUnit logicalTopValue = 0; - - bool logicalHeightIsAuto = logicalHeightLength.isAuto(); - bool logicalTopIsAuto = logicalTop.isAuto(); - bool logicalBottomIsAuto = logicalBottom.isAuto(); - - LayoutUnit resolvedLogicalHeight; - if (logicalHeightLength.isIntrinsic()) - resolvedLogicalHeight = computeIntrinsicLogicalContentHeightUsing( - logicalHeightLength, contentLogicalHeight, bordersPlusPadding); - else - resolvedLogicalHeight = adjustContentBoxLogicalHeightForBoxSizing( - valueForLength(logicalHeightLength, containerLogicalHeight)); - - if (!logicalTopIsAuto && !logicalHeightIsAuto && !logicalBottomIsAuto) { - /*-----------------------------------------------------------------------*\ - * If none of the three are 'auto': If both 'margin-top' and 'margin- - * bottom' are 'auto', solve the equation under the extra constraint that - * the two margins get equal values. If one of 'margin-top' or 'margin- - * bottom' is 'auto', solve the equation for that value. If the values - * are over-constrained, ignore the value for 'bottom' and solve for that - * value. - \*-----------------------------------------------------------------------*/ - // NOTE: It is not necessary to solve for 'bottom' in the over constrained - // case because the value is not used for any further calculations. - - logicalHeightValue = resolvedLogicalHeight; - logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); - - const LayoutUnit availableSpace = - containerLogicalHeight - - (logicalTopValue + logicalHeightValue + - valueForLength(logicalBottom, containerLogicalHeight) + - bordersPlusPadding); - - // Margins are now the only unknown - if (marginBefore.isAuto() && marginAfter.isAuto()) { - // Both margins auto, solve for equality - // NOTE: This may result in negative values. - computedValues.m_margins.m_before = - availableSpace / 2; // split the difference - computedValues.m_margins.m_after = - availableSpace - computedValues.m_margins - .m_before; // account for odd valued differences - } else if (marginBefore.isAuto()) { - // Solve for top margin - computedValues.m_margins.m_after = - valueForLength(marginAfter, containerRelativeLogicalWidth); - computedValues.m_margins.m_before = - availableSpace - computedValues.m_margins.m_after; - } else if (marginAfter.isAuto()) { - // Solve for bottom margin - computedValues.m_margins.m_before = - valueForLength(marginBefore, containerRelativeLogicalWidth); - computedValues.m_margins.m_after = - availableSpace - computedValues.m_margins.m_before; - } else { - // Over-constrained, (no need solve for bottom) - computedValues.m_margins.m_before = - valueForLength(marginBefore, containerRelativeLogicalWidth); - computedValues.m_margins.m_after = - valueForLength(marginAfter, containerRelativeLogicalWidth); - } - } else { - /*--------------------------------------------------------------------*\ - * Otherwise, set 'auto' values for 'margin-top' and 'margin-bottom' - * to 0, and pick the one of the following six rules that applies. - * - * 1. 'top' and 'height' are 'auto' and 'bottom' is not 'auto', then - * the height is based on the content, and solve for 'top'. - * - * OMIT RULE 2 AS IT SHOULD NEVER BE HIT - * ------------------------------------------------------------------ - * 2. 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then - * set 'top' to the static position, and solve for 'bottom'. - * ------------------------------------------------------------------ - * - * 3. 'height' and 'bottom' are 'auto' and 'top' is not 'auto', then - * the height is based on the content, and solve for 'bottom'. - * 4. 'top' is 'auto', 'height' and 'bottom' are not 'auto', and - * solve for 'top'. - * 5. 'height' is 'auto', 'top' and 'bottom' are not 'auto', and - * solve for 'height'. - * 6. 'bottom' is 'auto', 'top' and 'height' are not 'auto', and - * solve for 'bottom'. - \*--------------------------------------------------------------------*/ - // NOTE: For rules 3 and 6 it is not necessary to solve for 'bottom' - // because the value is not used for any further calculations. - - // Calculate margins, 'auto' margins are ignored. - computedValues.m_margins.m_before = - minimumValueForLength(marginBefore, containerRelativeLogicalWidth); - computedValues.m_margins.m_after = - minimumValueForLength(marginAfter, containerRelativeLogicalWidth); - - const LayoutUnit availableSpace = - containerLogicalHeight - - (computedValues.m_margins.m_before + computedValues.m_margins.m_after + - bordersPlusPadding); - - // Use rule/case that applies. - if (logicalTopIsAuto && logicalHeightIsAuto && !logicalBottomIsAuto) { - // RULE 1: (height is content based, solve of top) - logicalHeightValue = contentLogicalHeight; - logicalTopValue = availableSpace - - (logicalHeightValue + - valueForLength(logicalBottom, containerLogicalHeight)); - } else if (!logicalTopIsAuto && logicalHeightIsAuto && - logicalBottomIsAuto) { - // RULE 3: (height is content based, no need solve of bottom) - logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); - logicalHeightValue = contentLogicalHeight; - } else if (logicalTopIsAuto && !logicalHeightIsAuto && - !logicalBottomIsAuto) { - // RULE 4: (solve of top) - logicalHeightValue = resolvedLogicalHeight; - logicalTopValue = availableSpace - - (logicalHeightValue + - valueForLength(logicalBottom, containerLogicalHeight)); - } else if (!logicalTopIsAuto && logicalHeightIsAuto && - !logicalBottomIsAuto) { - // RULE 5: (solve of height) - logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); - logicalHeightValue = std::max( - 0, availableSpace - - (logicalTopValue + - valueForLength(logicalBottom, containerLogicalHeight))); - } else if (!logicalTopIsAuto && !logicalHeightIsAuto && - logicalBottomIsAuto) { - // RULE 6: (no need solve of bottom) - logicalHeightValue = resolvedLogicalHeight; - logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); - } - } - computedValues.m_extent = logicalHeightValue; - - // Use computed values to calculate the vertical position. - computedValues.m_position = - logicalTopValue + computedValues.m_margins.m_before; - computeLogicalTopPositionedOffset(computedValues.m_position, this, - logicalHeightValue, containerBlock, - containerLogicalHeight); -} - -void RenderBox::computePositionedLogicalWidthReplaced( - LogicalExtentComputedValues& computedValues) const { - // The following is based off of the W3C Working Draft from April 11, 2006 of - // CSS 2.1: Section 10.3.8 "Absolutely positioned, replaced elements" - // - // (block-style-comments in this function correspond to text from the spec and - // the numbers correspond to numbers in spec) - - // We don't use containingBlock(), since we may be positioned by an enclosing - // relative positioned inline. - const RenderBoxModelObject* containerBlock = - toRenderBoxModelObject(container()); - - const LayoutUnit containerLogicalWidth = - containingBlockLogicalWidthForPositioned(containerBlock); - const LayoutUnit containerRelativeLogicalWidth = - containingBlockLogicalWidthForPositioned(containerBlock); - - // To match WinIE, in quirks mode use the parent's 'direction' property - // instead of the the container block's. - TextDirection containerDirection = containerBlock->style()->direction(); - - // Variables to solve. - Length logicalLeft = style()->logicalLeft(); - Length logicalRight = style()->logicalRight(); - Length marginLogicalLeft = style()->marginLeft(); - Length marginLogicalRight = style()->marginRight(); - LayoutUnit& marginLogicalLeftAlias = style()->isLeftToRightDirection() - ? computedValues.m_margins.m_start - : computedValues.m_margins.m_end; - LayoutUnit& marginLogicalRightAlias = style()->isLeftToRightDirection() - ? computedValues.m_margins.m_end - : computedValues.m_margins.m_start; - - /*-----------------------------------------------------------------------*\ - * 1. The used value of 'width' is determined as for inline replaced - * elements. - \*-----------------------------------------------------------------------*/ - // NOTE: This value of width is final in that the min/max width calculations - // are dealt with in computeReplacedWidth(). This means that the steps to - // produce correct max/min in the non-replaced version, are not necessary. - computedValues.m_extent = - computeReplacedLogicalWidth() + borderAndPaddingLogicalWidth(); - - const LayoutUnit availableSpace = - containerLogicalWidth - computedValues.m_extent; - - /*-----------------------------------------------------------------------*\ - * 2. If both 'left' and 'right' have the value 'auto', then if 'direction' - * of the containing block is 'ltr', set 'left' to the static position; - * else if 'direction' is 'rtl', set 'right' to the static position. - \*-----------------------------------------------------------------------*/ - // see FIXME 1 - computePositionedStaticDistance(logicalLeft, logicalRight); - - /*-----------------------------------------------------------------------*\ - * 3. If 'left' or 'right' are 'auto', replace any 'auto' on 'margin-left' - * or 'margin-right' with '0'. - \*-----------------------------------------------------------------------*/ - if (logicalLeft.isAuto() || logicalRight.isAuto()) { - if (marginLogicalLeft.isAuto()) - marginLogicalLeft.setValue(Fixed, 0); - if (marginLogicalRight.isAuto()) - marginLogicalRight.setValue(Fixed, 0); - } - - /*-----------------------------------------------------------------------*\ - * 4. If at this point both 'margin-left' and 'margin-right' are still - * 'auto', solve the equation under the extra constraint that the two - * margins must get equal values, unless this would make them negative, - * in which case when the direction of the containing block is 'ltr' - * ('rtl'), set 'margin-left' ('margin-right') to zero and solve for - * 'margin-right' ('margin-left'). - \*-----------------------------------------------------------------------*/ - LayoutUnit logicalLeftValue = 0; - LayoutUnit logicalRightValue = 0; - - if (marginLogicalLeft.isAuto() && marginLogicalRight.isAuto()) { - // 'left' and 'right' cannot be 'auto' due to step 3 - ASSERT(!(logicalLeft.isAuto() && logicalRight.isAuto())); - - logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); - logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); - - LayoutUnit difference = - availableSpace - (logicalLeftValue + logicalRightValue); - if (difference > 0) { - marginLogicalLeftAlias = difference / 2; // split the difference - marginLogicalRightAlias = - difference - - marginLogicalLeftAlias; // account for odd valued differences - } else { - // Use the containing block's direction rather than the parent block's - // per CSS 2.1 reference test abspos-replaced-width-margin-000. - if (containerDirection == LTR) { - marginLogicalLeftAlias = 0; - marginLogicalRightAlias = difference; // will be negative - } else { - marginLogicalLeftAlias = difference; // will be negative - marginLogicalRightAlias = 0; - } - } - - /*-----------------------------------------------------------------------*\ - * 5. If at this point there is an 'auto' left, solve the equation for - * that value. - \*-----------------------------------------------------------------------*/ - } else if (logicalLeft.isAuto()) { - marginLogicalLeftAlias = - valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); - marginLogicalRightAlias = - valueForLength(marginLogicalRight, containerRelativeLogicalWidth); - logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); - - // Solve for 'left' - logicalLeftValue = - availableSpace - - (logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias); - } else if (logicalRight.isAuto()) { - marginLogicalLeftAlias = - valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); - marginLogicalRightAlias = - valueForLength(marginLogicalRight, containerRelativeLogicalWidth); - logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); - - // Solve for 'right' - logicalRightValue = - availableSpace - - (logicalLeftValue + marginLogicalLeftAlias + marginLogicalRightAlias); - } else if (marginLogicalLeft.isAuto()) { - marginLogicalRightAlias = - valueForLength(marginLogicalRight, containerRelativeLogicalWidth); - logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); - logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); - - // Solve for 'margin-left' - marginLogicalLeftAlias = - availableSpace - - (logicalLeftValue + logicalRightValue + marginLogicalRightAlias); - } else if (marginLogicalRight.isAuto()) { - marginLogicalLeftAlias = - valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); - logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); - logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); - - // Solve for 'margin-right' - marginLogicalRightAlias = - availableSpace - - (logicalLeftValue + logicalRightValue + marginLogicalLeftAlias); - } else { - // Nothing is 'auto', just calculate the values. - marginLogicalLeftAlias = - valueForLength(marginLogicalLeft, containerRelativeLogicalWidth); - marginLogicalRightAlias = - valueForLength(marginLogicalRight, containerRelativeLogicalWidth); - logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); - logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); - // If the containing block is right-to-left, then push the left position as - // far to the right as possible - if (containerDirection == RTL) { - int totalLogicalWidth = computedValues.m_extent + logicalLeftValue + - logicalRightValue + marginLogicalLeftAlias + - marginLogicalRightAlias; - logicalLeftValue = - containerLogicalWidth - (totalLogicalWidth - logicalLeftValue); - } - } - - /*-----------------------------------------------------------------------*\ - * 6. If at this point the values are over-constrained, ignore the value - * for either 'left' (in case the 'direction' property of the - * containing block is 'rtl') or 'right' (in case 'direction' is - * 'ltr') and solve for that value. - \*-----------------------------------------------------------------------*/ - // NOTE: Constraints imposed by the width of the containing block and its - // content have already been accounted for above. - - // FIXME: Deal with differing writing modes here. Our offset needs to be in - // the containing block's coordinate space, so that can make the result here - // rather complicated to compute. - - // Use computed values to calculate the horizontal position. - - // FIXME: This hack is needed to calculate the logical left position for a - // 'rtl' relatively positioned, inline containing block because right now, it - // is using the logical left position of the first line box when really it - // should use the last line box. When this is fixed elsewhere, this block - // should be removed. - if (containerBlock->isRenderInline() && - !containerBlock->style()->isLeftToRightDirection()) { - const RenderInline* flow = toRenderInline(containerBlock); - InlineFlowBox* firstLine = flow->firstLineBox(); - InlineFlowBox* lastLine = flow->lastLineBox(); - if (firstLine && lastLine && firstLine != lastLine) { - computedValues.m_position = - logicalLeftValue + marginLogicalLeftAlias + - lastLine->borderLogicalLeft() + - (lastLine->logicalLeft() - firstLine->logicalLeft()); - return; - } - } - - LayoutUnit logicalLeftPos = logicalLeftValue + marginLogicalLeftAlias; - computeLogicalLeftPositionedOffset(logicalLeftPos, this, - computedValues.m_extent, containerBlock, - containerLogicalWidth); - computedValues.m_position = logicalLeftPos; -} - -void RenderBox::computePositionedLogicalHeightReplaced( - LogicalExtentComputedValues& computedValues) const { - // The following is based off of the W3C Working Draft from April 11, 2006 of - // CSS 2.1: Section 10.6.5 "Absolutely positioned, replaced elements" - // - // (block-style-comments in this function correspond to text from the spec and - // the numbers correspond to numbers in spec) - - // We don't use containingBlock(), since we may be positioned by an enclosing - // relpositioned inline. - const RenderBoxModelObject* containerBlock = - toRenderBoxModelObject(container()); - - const LayoutUnit containerLogicalHeight = - containingBlockLogicalHeightForPositioned(containerBlock); - const LayoutUnit containerRelativeLogicalWidth = - containingBlockLogicalWidthForPositioned(containerBlock); - - // Variables to solve. - Length marginBefore = style()->marginBefore(); - Length marginAfter = style()->marginAfter(); - LayoutUnit& marginBeforeAlias = computedValues.m_margins.m_before; - LayoutUnit& marginAfterAlias = computedValues.m_margins.m_after; - - Length logicalTop = style()->logicalTop(); - Length logicalBottom = style()->logicalBottom(); - - /*-----------------------------------------------------------------------*\ - * 1. The used value of 'height' is determined as for inline replaced - * elements. - \*-----------------------------------------------------------------------*/ - // NOTE: This value of height is final in that the min/max height calculations - // are dealt with in computeReplacedHeight(). This means that the steps to - // produce correct max/min in the non-replaced version, are not necessary. - computedValues.m_extent = - computeReplacedLogicalHeight() + borderAndPaddingLogicalHeight(); - const LayoutUnit availableSpace = - containerLogicalHeight - computedValues.m_extent; - - /*-----------------------------------------------------------------------*\ - * 2. If both 'top' and 'bottom' have the value 'auto', replace 'top' - * with the element's static position. - \*-----------------------------------------------------------------------*/ - // see FIXME 1 - computePositionedStaticDistance(logicalTop, logicalBottom); - - /*-----------------------------------------------------------------------*\ - * 3. If 'bottom' is 'auto', replace any 'auto' on 'margin-top' or - * 'margin-bottom' with '0'. - \*-----------------------------------------------------------------------*/ - // FIXME: The spec. says that this step should only be taken when bottom is - // auto, but if only top is auto, this makes step 4 impossible. - if (logicalTop.isAuto() || logicalBottom.isAuto()) { - if (marginBefore.isAuto()) - marginBefore.setValue(Fixed, 0); - if (marginAfter.isAuto()) - marginAfter.setValue(Fixed, 0); - } - - /*-----------------------------------------------------------------------*\ - * 4. If at this point both 'margin-top' and 'margin-bottom' are still - * 'auto', solve the equation under the extra constraint that the two - * margins must get equal values. - \*-----------------------------------------------------------------------*/ - LayoutUnit logicalTopValue = 0; - LayoutUnit logicalBottomValue = 0; - - if (marginBefore.isAuto() && marginAfter.isAuto()) { - // 'top' and 'bottom' cannot be 'auto' due to step 2 and 3 combined. - ASSERT(!(logicalTop.isAuto() || logicalBottom.isAuto())); - - logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); - logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight); - - LayoutUnit difference = - availableSpace - (logicalTopValue + logicalBottomValue); - // NOTE: This may result in negative values. - marginBeforeAlias = difference / 2; // split the difference - marginAfterAlias = - difference - marginBeforeAlias; // account for odd valued differences - - /*-----------------------------------------------------------------------*\ - * 5. If at this point there is only one 'auto' left, solve the equation - * for that value. - \*-----------------------------------------------------------------------*/ - } else if (logicalTop.isAuto()) { - marginBeforeAlias = - valueForLength(marginBefore, containerRelativeLogicalWidth); - marginAfterAlias = - valueForLength(marginAfter, containerRelativeLogicalWidth); - logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight); - - // Solve for 'top' - logicalTopValue = availableSpace - (logicalBottomValue + marginBeforeAlias + - marginAfterAlias); - } else if (logicalBottom.isAuto()) { - marginBeforeAlias = - valueForLength(marginBefore, containerRelativeLogicalWidth); - marginAfterAlias = - valueForLength(marginAfter, containerRelativeLogicalWidth); - logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); - - // Solve for 'bottom' - // NOTE: It is not necessary to solve for 'bottom' because we don't ever - // use the value. - } else if (marginBefore.isAuto()) { - marginAfterAlias = - valueForLength(marginAfter, containerRelativeLogicalWidth); - logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); - logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight); - - // Solve for 'margin-top' - marginBeforeAlias = availableSpace - (logicalTopValue + logicalBottomValue + - marginAfterAlias); - } else if (marginAfter.isAuto()) { - marginBeforeAlias = - valueForLength(marginBefore, containerRelativeLogicalWidth); - logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); - logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight); - - // Solve for 'margin-bottom' - marginAfterAlias = availableSpace - (logicalTopValue + logicalBottomValue + - marginBeforeAlias); - } else { - // Nothing is 'auto', just calculate the values. - marginBeforeAlias = - valueForLength(marginBefore, containerRelativeLogicalWidth); - marginAfterAlias = - valueForLength(marginAfter, containerRelativeLogicalWidth); - logicalTopValue = valueForLength(logicalTop, containerLogicalHeight); - // NOTE: It is not necessary to solve for 'bottom' because we don't ever - // use the value. - } - - /*-----------------------------------------------------------------------*\ - * 6. If at this point the values are over-constrained, ignore the value - * for 'bottom' and solve for that value. - \*-----------------------------------------------------------------------*/ - // NOTE: It is not necessary to do this step because we don't end up using - // the value of 'bottom' regardless of whether the values are over-constrained - // or not. - - // Use computed values to calculate the vertical position. - LayoutUnit logicalTopPos = logicalTopValue + marginBeforeAlias; - computeLogicalTopPositionedOffset(logicalTopPos, this, - computedValues.m_extent, containerBlock, - containerLogicalHeight); - computedValues.m_position = logicalTopPos; -} - -LayoutRect RenderBox::localCaretRect(InlineBox* box, - int caretOffset, - LayoutUnit* extraWidthToEndOfLine) { - // VisiblePositions at offsets inside containers either a) refer to the - // positions before/after those containers (tables and select elements) or b) - // refer to the position inside an empty block. They never refer to children. - // FIXME: Paint the carets inside empty blocks differently than the carets - // before/after elements. - - LayoutRect rect(location(), LayoutSize(caretWidth, height())); - bool ltr = - box ? box->isLeftToRightDirection() : style()->isLeftToRightDirection(); - - if ((!caretOffset) ^ ltr) - rect.move(LayoutSize(width() - caretWidth, 0)); - - if (box) { - RootInlineBox& rootBox = box->root(); - LayoutUnit top = rootBox.lineTop(); - rect.setY(top); - rect.setHeight(rootBox.lineBottom() - top); - } - - // If height of box is smaller than font height, use the latter one, - // otherwise the caret might become invisible. - // - // Also, if the box is not a replaced element, always use the font height. - // This prevents the "big caret" bug described in: - // Deleting all content in a document can result in - // giant tall-as-window insertion point - // - // FIXME: ignoring :first-line, missing good reason to take care of - LayoutUnit fontHeight = style()->fontMetrics().height(); - if (fontHeight > rect.height() || !isReplaced()) - rect.setHeight(fontHeight); - - if (extraWidthToEndOfLine) - *extraWidthToEndOfLine = x() + width() - rect.maxX(); - - // Move to local coords - rect.moveBy(-location()); - - return rect; -} - -PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point) { - // no children...return this render object's element, if there is one, and - // offset 0 - RenderObject* firstChild = slowFirstChild(); - if (!firstChild) - return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); - - // Pass off to the closest child. - LayoutUnit minDist = LayoutUnit::max(); - RenderBox* closestRenderer = 0; - LayoutPoint adjustedPoint = point; - - for (RenderObject* renderObject = firstChild; renderObject; - renderObject = renderObject->nextSibling()) { - if (!renderObject->slowFirstChild() && !renderObject->isInline() && - !renderObject->isRenderParagraph()) - continue; - - if (!renderObject->isBox()) - continue; - - RenderBox* renderer = toRenderBox(renderObject); - - LayoutUnit top = - renderer->borderTop() + renderer->paddingTop() + renderer->y(); - LayoutUnit bottom = top + renderer->contentHeight(); - LayoutUnit left = - renderer->borderLeft() + renderer->paddingLeft() + renderer->x(); - LayoutUnit right = left + renderer->contentWidth(); - - if (point.x() <= right && point.x() >= left && point.y() <= top && - point.y() >= bottom) - return renderer->positionForPoint(point - renderer->locationOffset()); - - // Find the distance from (x, y) to the box. Split the space around the box - // into 8 pieces and use a different compare depending on which piece (x, y) - // is in. - LayoutPoint cmp; - if (point.x() > right) { - if (point.y() < top) - cmp = LayoutPoint(right, top); - else if (point.y() > bottom) - cmp = LayoutPoint(right, bottom); - else - cmp = LayoutPoint(right, point.y()); - } else if (point.x() < left) { - if (point.y() < top) - cmp = LayoutPoint(left, top); - else if (point.y() > bottom) - cmp = LayoutPoint(left, bottom); - else - cmp = LayoutPoint(left, point.y()); - } else { - if (point.y() < top) - cmp = LayoutPoint(point.x(), top); - else - cmp = LayoutPoint(point.x(), bottom); - } - - LayoutSize difference = cmp - point; - - LayoutUnit dist = difference.width() * difference.width() + - difference.height() * difference.height(); - if (dist < minDist) { - closestRenderer = renderer; - minDist = dist; - } - } - - if (closestRenderer) - return closestRenderer->positionForPoint(adjustedPoint - - closestRenderer->locationOffset()); - return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); -} - -void RenderBox::addVisualEffectOverflow() { - if (!style()->hasVisualOverflowingEffect()) - return; - - // Add in the final overflow with shadows, outsets and outline combined. - LayoutRect visualEffectOverflow = borderBoxRect(); - visualEffectOverflow.expand(computeVisualEffectOverflowExtent()); - addVisualOverflow(visualEffectOverflow); -} - -LayoutBoxExtent RenderBox::computeVisualEffectOverflowExtent() const { - ASSERT(style()->hasVisualOverflowingEffect()); - - LayoutUnit top; - LayoutUnit right; - LayoutUnit bottom; - LayoutUnit left; - - if (style()->boxShadow()) { - style()->getBoxShadowExtent(top, right, bottom, left); - - // Box shadow extent's top and left are negative when extend to left and top - // direction, respectively. Negate to make them positive. - top = -top; - left = -left; - } - - if (style()->hasOutline()) { - if (style()->outlineStyleIsAuto()) { - // The result focus ring rects are in coordinates of this object's border - // box. - Vector focusRingRects; - addFocusRingRects(focusRingRects, LayoutPoint(), this); - IntRect rect = unionRect(focusRingRects); - - int outlineSize = GraphicsContext::focusRingOutsetExtent( - style()->outlineOffset(), style()->outlineWidth()); - top = std::max(top, -rect.y() + outlineSize); - right = std::max(right, rect.maxX() - width() + outlineSize); - bottom = - std::max(bottom, rect.maxY() - height() + outlineSize); - left = std::max(left, -rect.x() + outlineSize); - } else { - LayoutUnit outlineSize = style()->outlineSize(); - top = std::max(top, outlineSize); - right = std::max(right, outlineSize); - bottom = std::max(bottom, outlineSize); - left = std::max(left, outlineSize); - } - } - - return LayoutBoxExtent(top, right, bottom, left); -} - -void RenderBox::addOverflowFromChild(RenderBox* child, - const LayoutSize& delta) { - // Only propagate layout overflow from the child if the child isn't clipping - // its overflow. If it is, then its overflow is internal to it, and we don't - // care about it. layoutOverflowRectForPropagation takes care of this and - // just propagates the border box rect instead. - LayoutRect childLayoutOverflowRect = - child->layoutOverflowRectForPropagation(); - childLayoutOverflowRect.move(delta); - addLayoutOverflow(childLayoutOverflowRect); - - // Add in visual overflow from the child. Even if the child clips its - // overflow, it may still have visual overflow of its own set from box shadows - // or reflections. It is unnecessary to propagate this overflow if we are - // clipping our own overflow. - if (child->hasSelfPaintingLayer()) - return; - LayoutRect childVisualOverflowRect = child->visualOverflowRect(); - childVisualOverflowRect.move(delta); - addContentsVisualOverflow(childVisualOverflowRect); -} - -void RenderBox::addLayoutOverflow(const LayoutRect& rect) { - LayoutRect clientBox = paddingBoxRect(); - if (clientBox.contains(rect) || rect.isEmpty()) - return; - - // For overflow clip objects, we don't want to propagate overflow into - // unreachable areas. - LayoutRect overflowRect(rect); - if (hasOverflowClip() || isRenderView()) { - // Overflow is in the block's coordinate space and thus is flipped for - // horizontal-bt and vertical-rl writing modes. At this stage that is - // actually a simplification, since we can treat horizontal-tb/bt as the - // same and vertical-lr/rl as the same. - bool hasTopOverflow = false; - bool hasLeftOverflow = !style()->isLeftToRightDirection(); - if (isFlexibleBox() && style()->isReverseFlexDirection()) { - RenderFlexibleBox* flexibleBox = toRenderFlexibleBox(this); - if (flexibleBox->isHorizontalFlow()) - hasLeftOverflow = true; - else - hasTopOverflow = true; - } - - if (!hasTopOverflow) - overflowRect.shiftYEdgeTo(std::max(overflowRect.y(), clientBox.y())); - else - overflowRect.shiftMaxYEdgeTo( - std::min(overflowRect.maxY(), clientBox.maxY())); - if (!hasLeftOverflow) - overflowRect.shiftXEdgeTo(std::max(overflowRect.x(), clientBox.x())); - else - overflowRect.shiftMaxXEdgeTo( - std::min(overflowRect.maxX(), clientBox.maxX())); - - // Now re-test with the adjusted rectangle and see if it has become - // unreachable or fully contained. - if (clientBox.contains(overflowRect) || overflowRect.isEmpty()) - return; - } - - if (!m_overflow) - m_overflow = adoptPtr(new RenderOverflow(clientBox, borderBoxRect())); - - m_overflow->addLayoutOverflow(overflowRect); -} - -void RenderBox::addVisualOverflow(const LayoutRect& rect) { - LayoutRect borderBox = borderBoxRect(); - if (borderBox.contains(rect) || rect.isEmpty()) - return; - - if (!m_overflow) - m_overflow = adoptPtr(new RenderOverflow(paddingBoxRect(), borderBox)); - - m_overflow->addVisualOverflow(rect); -} - -void RenderBox::addContentsVisualOverflow(const LayoutRect& rect) { - if (!hasOverflowClip()) { - addVisualOverflow(rect); - return; - } - - if (!m_overflow) - m_overflow = - adoptPtr(new RenderOverflow(paddingBoxRect(), borderBoxRect())); - m_overflow->addContentsVisualOverflow(rect); -} - -void RenderBox::clearLayoutOverflow() { - if (!m_overflow) - return; - - if (!hasVisualOverflow() && contentsVisualOverflowRect().isEmpty()) { - clearAllOverflows(); - return; - } - - m_overflow->setLayoutOverflow(paddingBoxRect()); -} - -LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, - LineDirectionMode direction, - LinePositionMode /*linePositionMode*/) const { - if (isReplaced()) - return direction == HorizontalLine - ? m_marginBox.top() + height() + m_marginBox.bottom() - : m_marginBox.right() + width() + m_marginBox.left(); - return 0; -} - -int RenderBox::baselinePosition(FontBaseline baselineType, - bool /*firstLine*/, - LineDirectionMode direction, - LinePositionMode linePositionMode) const { - ASSERT(linePositionMode == PositionOnContainingLine); - if (isReplaced()) { - int result = direction == HorizontalLine - ? m_marginBox.top() + height() + m_marginBox.bottom() - : m_marginBox.right() + width() + m_marginBox.left(); - if (baselineType == AlphabeticBaseline) - return result; - return result - result / 2; - } - return 0; -} - -RenderLayer* RenderBox::enclosingFloatPaintingLayer() const { - const RenderObject* curr = this; - while (curr) { - RenderLayer* layer = - curr->hasLayer() && curr->isBox() ? toRenderBox(curr)->layer() : 0; - if (layer && layer->isSelfPaintingLayer()) - return layer; - curr = curr->parent(); - } - return 0; -} - -LayoutRect RenderBox::layoutOverflowRectForPropagation() const { - // Only propagate interior layout overflow if we don't clip it. - LayoutRect rect = borderBoxRect(); - rect.expand(LayoutSize(LayoutUnit(), marginAfter())); - - if (!hasOverflowClip()) - rect.unite(layoutOverflowRect()); - - if (transform()) - rect = transform()->mapRect(rect); - - return rect; -} - -LayoutUnit RenderBox::offsetLeft() const { - return adjustedPositionRelativeToOffsetParent(location()).x(); -} - -LayoutUnit RenderBox::offsetTop() const { - return adjustedPositionRelativeToOffsetParent(location()).y(); -} - -bool RenderBox::hasRelativeLogicalHeight() const { - return style()->logicalHeight().isPercent() || - style()->logicalMinHeight().isPercent() || - style()->logicalMaxHeight().isPercent(); -} - -RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) { - backgroundColor = style.resolveColor(style.backgroundColor()); - hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); - ASSERT(hasBackground == style.hasBackground()); - hasBorder = style.hasBorder(); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderBox.h b/sky/engine/core/rendering/RenderBox.h deleted file mode 100644 index 52e9a6999311b..0000000000000 --- a/sky/engine/core/rendering/RenderBox.h +++ /dev/null @@ -1,825 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_ - -#include "flutter/sky/engine/core/rendering/RenderBoxModelObject.h" -#include "flutter/sky/engine/core/rendering/RenderOverflow.h" - -namespace blink { - -struct LayerPaintingInfo; -struct PaintInfo; -class HitTestingTransformState; -class TransformationMatrix; - -enum SizeType { MainOrPreferredSize, MinSize, MaxSize }; -enum AvailableLogicalHeightType { - ExcludeMarginBorderPadding, - IncludeMarginBorderPadding -}; -enum MarginDirection { BlockDirection, InlineDirection }; - -enum ShouldComputePreferred { ComputeActual, ComputePreferred }; - -enum ContentsClipBehavior { ForceContentsClip, SkipContentsClipIfPossible }; - -struct RenderBoxRareData { - WTF_MAKE_NONCOPYABLE(RenderBoxRareData); - WTF_MAKE_FAST_ALLOCATED; - - public: - RenderBoxRareData() - : m_inlineBoxWrapper(0), - m_overrideLogicalContentHeight(-1), - m_overrideLogicalContentWidth(-1) {} - - // For inline replaced elements, the inline box that owns us. - InlineBox* m_inlineBoxWrapper; - LayoutUnit m_overrideLogicalContentHeight; - LayoutUnit m_overrideLogicalContentWidth; -}; - -enum LayerType { - NoLayer, - NormalLayer, - // An overflow clip layer is required for bookkeeping purposes, - // but does not force a layer to be self painting. - OverflowClipLayer, -}; - -struct FontBaselineOrAuto { - FontBaselineOrAuto() : m_auto(true), m_baseline(AlphabeticBaseline) {} - FontBaselineOrAuto(FontBaseline baseline) - : m_auto(false), m_baseline(baseline) {} - bool m_auto; - FontBaseline m_baseline; -}; - -class RenderBox : public RenderBoxModelObject { - public: - explicit RenderBox(); - - // hasAutoZIndex only returns true if the element is positioned or a flex-item - // since position:static elements that are not flex-items get their z-index - // coerced to auto. - virtual LayerType layerTypeRequired() const { - if (isPositioned() || createsGroup() || hasClipPath() || hasTransform() || - !style()->hasAutoZIndex()) - return NormalLayer; - if (hasOverflowClip()) - return OverflowClipLayer; - return NoLayer; - } - - void destroyLayer(); - void createLayer(LayerType); - bool hasSelfPaintingLayer() const; - RenderLayer* layer() const { return m_layer.get(); } - - // Use this with caution! No type checking is done! - RenderBox* firstChildBox() const; - RenderBox* lastChildBox() const; - - LayoutUnit x() const { return m_frameRect.x(); } - LayoutUnit y() const { return m_frameRect.y(); } - LayoutUnit width() const { return m_frameRect.width(); } - LayoutUnit height() const { return m_frameRect.height(); } - - int pixelSnappedWidth() const { return m_frameRect.pixelSnappedWidth(); } - int pixelSnappedHeight() const { return m_frameRect.pixelSnappedHeight(); } - - // These represent your location relative to your container as a physical - // offset. In layout related methods you almost always want the logical - // location (e.g. x() and y()). - LayoutUnit top() const { return location().y(); } - LayoutUnit left() const { return location().x(); } - - void setX(LayoutUnit x) { m_frameRect.setX(x); } - void setY(LayoutUnit y) { m_frameRect.setY(y); } - void setWidth(LayoutUnit width) { m_frameRect.setWidth(width); } - void setHeight(LayoutUnit height) { m_frameRect.setHeight(height); } - - LayoutUnit logicalLeft() const { return x(); } - LayoutUnit logicalRight() const { return logicalLeft() + logicalWidth(); } - LayoutUnit logicalTop() const { return y(); } - LayoutUnit logicalBottom() const { return logicalTop() + logicalHeight(); } - LayoutUnit logicalWidth() const { return width(); } - LayoutUnit logicalHeight() const { return height(); } - - LayoutUnit constrainLogicalWidthByMinMax(LayoutUnit, - LayoutUnit, - RenderBlock*) const; - LayoutUnit constrainLogicalHeightByMinMax( - LayoutUnit logicalHeight, - LayoutUnit intrinsicContentHeight) const; - LayoutUnit constrainContentBoxLogicalHeightByMinMax( - LayoutUnit logicalHeight, - LayoutUnit intrinsicContentHeight) const; - - int pixelSnappedLogicalHeight() const { return pixelSnappedHeight(); } - int pixelSnappedLogicalWidth() const { return pixelSnappedWidth(); } - - void setLogicalLeft(LayoutUnit left) { setX(left); } - void setLogicalTop(LayoutUnit top) { setY(top); } - void setLogicalLocation(const LayoutPoint& location) { - setLocation(location); - } - void setLogicalWidth(LayoutUnit size) { setWidth(size); } - void setLogicalHeight(LayoutUnit size) { setHeight(size); } - void setLogicalSize(const LayoutSize& size) { setSize(size); } - - LayoutPoint location() const { return m_frameRect.location(); } - LayoutSize locationOffset() const { return LayoutSize(x(), y()); } - LayoutSize size() const { return m_frameRect.size(); } - IntSize pixelSnappedSize() const { return m_frameRect.pixelSnappedSize(); } - - void setLocation(const LayoutPoint& location) { - m_frameRect.setLocation(location); - } - - void setSize(const LayoutSize& size) { m_frameRect.setSize(size); } - void move(LayoutUnit dx, LayoutUnit dy) { m_frameRect.move(dx, dy); } - - LayoutRect frameRect() const { return m_frameRect; } - IntRect pixelSnappedFrameRect() const { - return pixelSnappedIntRect(m_frameRect); - } - void setFrameRect(const LayoutRect& rect) { m_frameRect = rect; } - - LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); } - LayoutRect paddingBoxRect() const { - return LayoutRect(borderLeft(), borderTop(), clientWidth(), clientHeight()); - } - IntRect pixelSnappedBorderBoxRect() const { - return IntRect(IntPoint(), m_frameRect.pixelSnappedSize()); - } - virtual IntRect borderBoundingBox() const override final { - return pixelSnappedBorderBoxRect(); - } - - // The content area of the box (excludes padding - and intrinsic padding for - // table cells, etc... - and border). - LayoutRect contentBoxRect() const { - return LayoutRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), - contentWidth(), contentHeight()); - } - // The content box in absolute coords. Ignores transforms. - IntRect absoluteContentBox() const; - // The content box converted to absolute coords (taking transforms into - // account). - FloatQuad absoluteContentQuad() const; - - FloatPoint perspectiveOrigin() const; - - // This returns the content area of the box (excluding padding and border). - // The only difference with contentBoxRect is that computedCSSContentBoxRect - // does include the intrinsic padding in the content box as this is what some - // callers expect (like getComputedStyle). - LayoutRect computedCSSContentBoxRect() const { - return LayoutRect( - borderLeft() + computedCSSPaddingLeft(), - borderTop() + computedCSSPaddingTop(), - clientWidth() - computedCSSPaddingLeft() - computedCSSPaddingRight(), - clientHeight() - computedCSSPaddingTop() - computedCSSPaddingBottom()); - } - - virtual void addFocusRingRects( - Vector&, - const LayoutPoint& additionalOffset, - const RenderBox* paintContainer = 0) const override; - - // Use this with caution! No type checking is done! - RenderBox* previousSiblingBox() const; - RenderBox* nextSiblingBox() const; - RenderBox* parentBox() const; - - // Visual and layout overflow are in the coordinate space of the box. This - // means that they aren't purely physical directions. For horizontal-tb and - // vertical-lr they will match physical directions, but for horizontal-bt and - // vertical-rl, the top/bottom and left/right respectively are flipped when - // compared to their physical counterparts. For example minX is on the left - // in vertical-lr, but it is on the right in vertical-rl. - LayoutRect layoutOverflowRect() const { - return m_overflow ? m_overflow->layoutOverflowRect() : paddingBoxRect(); - } - IntRect pixelSnappedLayoutOverflowRect() const { - return pixelSnappedIntRect(layoutOverflowRect()); - } - LayoutSize maxLayoutOverflow() const { - return LayoutSize(layoutOverflowRect().maxX(), layoutOverflowRect().maxY()); - } - LayoutUnit logicalLefxlayoutOverflow() const { - return layoutOverflowRect().x(); - } - LayoutUnit logicalRightLayoutOverflow() const { - return layoutOverflowRect().maxX(); - } - - virtual LayoutRect visualOverflowRect() const { - return m_overflow ? m_overflow->visualOverflowRect() : borderBoxRect(); - } - LayoutUnit logicalLeftVisualOverflow() const { - return visualOverflowRect().x(); - } - LayoutUnit logicalRightVisualOverflow() const { - return visualOverflowRect().maxX(); - } - - LayoutRect contentsVisualOverflowRect() const { - return m_overflow ? m_overflow->contentsVisualOverflowRect() : LayoutRect(); - } - - void addLayoutOverflow(const LayoutRect&); - void addVisualOverflow(const LayoutRect&); - - // Clipped by the contents clip, if one exists. - void addContentsVisualOverflow(const LayoutRect&); - - void addVisualEffectOverflow(); - LayoutBoxExtent computeVisualEffectOverflowExtent() const; - void addOverflowFromChild(RenderBox* child) { - addOverflowFromChild(child, child->locationOffset()); - } - void addOverflowFromChild(RenderBox* child, const LayoutSize& delta); - void clearLayoutOverflow(); - void clearAllOverflows() { m_overflow.clear(); } - - void updateLayerTransformAfterLayout(); - - // This transform has the transform-origin baked in. - TransformationMatrix* transform() const { return m_transform.get(); } - bool has3DTransform() const { - return m_transform && !m_transform->isAffine(); - } - - LayoutUnit contentWidth() const { - return clientWidth() - paddingLeft() - paddingRight(); - } - LayoutUnit contentHeight() const { - return clientHeight() - paddingTop() - paddingBottom(); - } - LayoutUnit contentLogicalWidth() const { return contentWidth(); } - LayoutUnit contentLogicalHeight() const { return contentHeight(); } - - // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines - // (RenderFlow) to return the remaining width on a given line (and the height - // of a single line). - virtual LayoutUnit offsetWidth() const override { return width(); } - virtual LayoutUnit offsetHeight() const override { return height(); } - - virtual int pixelSnappedOffsetWidth() const override final; - virtual int pixelSnappedOffsetHeight() const override final; - - // More IE extensions. clientWidth and clientHeight represent the interior of - // an object excluding border and scrollbar. clientLeft/Top are just the - // borderLeftWidth and borderTopWidth. - LayoutUnit clientLeft() const { return borderLeft(); } - LayoutUnit clientTop() const { return borderTop(); } - LayoutUnit clientWidth() const; - LayoutUnit clientHeight() const; - LayoutUnit clientLogicalWidth() const { return clientWidth(); } - LayoutUnit clientLogicalHeight() const { return clientHeight(); } - LayoutUnit clientLogicalBottom() const { - return borderBefore() + clientLogicalHeight(); - } - LayoutRect clientBoxRect() const { - return LayoutRect(clientLeft(), clientTop(), clientWidth(), clientHeight()); - } - - int pixelSnappedClientWidth() const; - int pixelSnappedClientHeight() const; - - virtual LayoutUnit marginTop() const override { return m_marginBox.top(); } - virtual LayoutUnit marginBottom() const override { - return m_marginBox.bottom(); - } - virtual LayoutUnit marginLeft() const override { return m_marginBox.left(); } - virtual LayoutUnit marginRight() const override { - return m_marginBox.right(); - } - void setMarginTop(LayoutUnit margin) { m_marginBox.setTop(margin); } - void setMarginBottom(LayoutUnit margin) { m_marginBox.setBottom(margin); } - void setMarginLeft(LayoutUnit margin) { m_marginBox.setLeft(margin); } - void setMarginRight(LayoutUnit margin) { m_marginBox.setRight(margin); } - - LayoutUnit marginLogicalLeft() const { return m_marginBox.logicalLeft(); } - LayoutUnit marginLogicalRight() const { return m_marginBox.logicalRight(); } - - virtual LayoutUnit marginBefore( - const RenderStyle* overrideStyle = 0) const override final { - return m_marginBox.before(); - } - virtual LayoutUnit marginAfter( - const RenderStyle* overrideStyle = 0) const override final { - return m_marginBox.after(); - } - virtual LayoutUnit marginStart( - const RenderStyle* overrideStyle = 0) const override final { - const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); - return m_marginBox.start(styleToUse->direction()); - } - virtual LayoutUnit marginEnd( - const RenderStyle* overrideStyle = 0) const override final { - const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); - return m_marginBox.end(styleToUse->direction()); - } - void setMarginBefore(LayoutUnit value, const RenderStyle* overrideStyle = 0) { - m_marginBox.setBefore(value); - } - void setMarginAfter(LayoutUnit value, const RenderStyle* overrideStyle = 0) { - m_marginBox.setAfter(value); - } - void setMarginStart(LayoutUnit value, const RenderStyle* overrideStyle = 0) { - const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); - m_marginBox.setStart(styleToUse->direction(), value); - } - void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0) { - const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); - m_marginBox.setEnd(styleToUse->direction(), value); - } - - virtual void absoluteQuads(Vector&) const override; - - bool hitTestLayer(RenderLayer* rootLayer, - RenderLayer* containerLayer, - const HitTestRequest& request, - HitTestResult& result, - const LayoutRect& hitTestRect, - const HitTestLocation& hitTestLocation, - const HitTestingTransformState* transformState = 0, - double* zOffset = 0); - - void paintLayer(GraphicsContext*, const LayerPaintingInfo&); - - virtual void layout() override; - virtual void paint(PaintInfo&, - const LayoutPoint&, - Vector& layers) override; - virtual bool nodeAtPoint(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) override; - - virtual LayoutUnit minPreferredLogicalWidth() const override; - virtual LayoutUnit maxPreferredLogicalWidth() const override; - - void setMinPreferredLogicalWidth(LayoutUnit); - void setMaxPreferredLogicalWidth(LayoutUnit); - - // FIXME: We should rename these back to overrideLogicalHeight/Width and have - // them store the border-box height/width like the regular height/width - // accessors on RenderBox. Right now, these are different than - // contentHeight/contentWidth because they still include the scrollbar - // height/width. - LayoutUnit overrideLogicalContentWidth() const; - LayoutUnit overrideLogicalContentHeight() const; - bool hasOverrideHeight() const; - bool hasOverrideWidth() const; - void setOverrideLogicalContentHeight(LayoutUnit); - void setOverrideLogicalContentWidth(LayoutUnit); - void clearOverrideSize(); - void clearOverrideLogicalContentHeight(); - void clearOverrideLogicalContentWidth(); - - virtual LayoutSize offsetFromContainer( - const RenderObject*, - const LayoutPoint&, - bool* offsetDependsOnPoint = 0) const override; - - LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const; - LayoutUnit adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height) const; - LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const; - LayoutUnit adjustContentBoxLogicalHeightForBoxSizing(LayoutUnit height) const; - - struct ComputedMarginValues { - ComputedMarginValues() {} - - LayoutUnit m_before; - LayoutUnit m_after; - LayoutUnit m_start; - LayoutUnit m_end; - }; - struct LogicalExtentComputedValues { - LogicalExtentComputedValues() {} - - LayoutUnit m_extent; - LayoutUnit m_position; - ComputedMarginValues m_margins; - }; - // Resolve auto margins in the chosen direction of the containing block so - // that objects can be pushed to the start, middle or end of the containing - // block. - void computeMarginsForDirection(MarginDirection forDirection, - const RenderBlock* containingBlock, - LayoutUnit containerWidth, - LayoutUnit childWidth, - LayoutUnit& marginStart, - LayoutUnit& marginEnd, - Length marginStartLength, - Length marginStartEnd) const; - - // Used to resolve margins in the containing block's block-flow direction. - void computeAndSetBlockDirectionMargins(const RenderBlock* containingBlock); - - void positionLineBox(InlineBox*); - - virtual InlineBox* createInlineBox(); - void dirtyLineBoxes(bool fullLayout); - - // For inline replaced elements, this function returns the inline box that - // owns us. Enables the replaced RenderObject to quickly determine what line - // it is contained on and to easily iterate over structures on the line. - InlineBox* inlineBoxWrapper() const { - return m_rareData ? m_rareData->m_inlineBoxWrapper : 0; - } - void setInlineBoxWrapper(InlineBox*); - void deleteLineBoxWrapper(); - - LayoutUnit containingBlockLogicalHeightForContent( - AvailableLogicalHeightType) const; - - virtual void updateLogicalWidth(); - virtual void updateLogicalHeight(); - virtual void computeLogicalHeight(LayoutUnit logicalHeight, - LayoutUnit logicalTop, - LogicalExtentComputedValues&) const; - - void computeLogicalWidth(LogicalExtentComputedValues&) const; - - virtual LayoutSize intrinsicSize() const { return LayoutSize(); } - LayoutUnit intrinsicLogicalWidth() const { return intrinsicSize().width(); } - LayoutUnit intrinsicLogicalHeight() const { return intrinsicSize().height(); } - virtual LayoutUnit intrinsicContentLogicalHeight() const { - return m_intrinsicContentLogicalHeight; - } - - // Whether or not the element shrinks to its intrinsic width (rather than - // filling the width of a containing block). HTML4 buttons, s, legends, and floating/compact elements do this. - bool sizesLogicalWidthToFitContent(const Length& logicalWidth) const; - - LayoutUnit computeLogicalWidthUsing(SizeType, - const Length& logicalWidth, - LayoutUnit availableLogicalWidth, - const RenderBlock* containingBlock) const; - LayoutUnit computeLogicalHeightUsing(const Length& height, - LayoutUnit intrinsicContentHeight) const; - LayoutUnit computeContentLogicalHeight( - const Length& height, - LayoutUnit intrinsicContentHeight) const; - LayoutUnit computeContentLogicalHeightUsing( - const Length& height, - LayoutUnit intrinsicContentHeight) const; - LayoutUnit computeReplacedLogicalWidthUsing(const Length& width) const; - LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth( - LayoutUnit logicalWidth, - ShouldComputePreferred = ComputeActual) const; - LayoutUnit computeReplacedLogicalHeightUsing(const Length& height) const; - LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight( - LayoutUnit logicalHeight) const; - - virtual LayoutUnit computeReplacedLogicalWidth( - ShouldComputePreferred = ComputeActual) const; - virtual LayoutUnit computeReplacedLogicalHeight() const; - - // Block flows subclass availableWidth/Height to handle multi column layout - // (shrinking the width/height available to children when laying out.) - virtual LayoutUnit availableLogicalWidth() const { - return contentLogicalWidth(); - } - virtual LayoutUnit availableLogicalHeight(AvailableLogicalHeightType) const; - LayoutUnit availableLogicalHeightUsing(const Length&, - AvailableLogicalHeightType) const; - - // There are a few cases where we need to refer specifically to the available - // physical width and available physical height. Relative positioning is one - // of those cases, since left/top offsets are physical. - LayoutUnit availableWidth() const { return availableLogicalWidth(); } - LayoutUnit availableHeight() const { - return availableLogicalHeight(IncludeMarginBorderPadding); - } - - virtual LayoutRect localCaretRect( - InlineBox*, - int caretOffset, - LayoutUnit* extraWidthToEndOfLine = 0) override; - - virtual LayoutRect overflowClipRect(const LayoutPoint& location); - LayoutRect clipRect(const LayoutPoint& location); - bool pushContentsClip(PaintInfo&, - const LayoutPoint& accumulatedOffset, - ContentsClipBehavior); - void popContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset); - - virtual void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&); - - // Called when a positioned object moves but doesn't necessarily change size. - // A simplified layout is attempted that just updates the object's position. - // If the size does change, the object remains dirty. - bool tryLayoutDoingPositionedMovementOnly() { - LayoutUnit oldWidth = width(); - updateLogicalWidth(); - // If we shrink to fit our width may have changed, so we still need full - // layout. - if (oldWidth != width()) - return false; - updateLogicalHeight(); - return true; - } - - virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override; - - void removeFloatingOrPositionedChildFromBlockLists(); - - RenderLayer* enclosingFloatPaintingLayer() const; - - virtual int firstLineBoxBaseline(FontBaselineOrAuto baselineType) const { - return -1; - } - virtual int inlineBlockBaseline(LineDirectionMode) const { - return -1; - } // Returns -1 if we should skip this box when computing the baseline of an - // inline-block. - - bool isFlexItem() const { - return !isInline() && !isFloatingOrOutOfFlowPositioned() && parent() && - parent()->isFlexibleBox(); - } - - virtual LayoutUnit lineHeight( - bool firstLine, - LineDirectionMode, - LinePositionMode = PositionOnContainingLine) const override; - virtual int baselinePosition( - FontBaseline, - bool firstLine, - LineDirectionMode, - LinePositionMode = PositionOnContainingLine) const override; - - virtual LayoutUnit offsetLeft() const override; - virtual LayoutUnit offsetTop() const override; - - LayoutRect layoutOverflowRectForPropagation() const; - - bool hasRenderOverflow() const { return m_overflow; } - bool hasVisualOverflow() const { - return m_overflow && - !borderBoxRect().contains(m_overflow->visualOverflowRect()); - } - - virtual bool needsPreferredWidthsRecalculation() const; - virtual void computeIntrinsicRatioInformation( - FloatSize& /* intrinsicSize */, - double& /* intrinsicRatio */) const {} - - virtual bool hasRelativeLogicalHeight() const; - - bool hasSameDirectionAs(const RenderBox* object) const { - return style()->direction() == object->style()->direction(); - } - - protected: - virtual void willBeDestroyed() override; - - virtual void styleWillChange(StyleDifference, - const RenderStyle& newStyle) override; - virtual void styleDidChange(StyleDifference, - const RenderStyle* oldStyle) override; - - void paintBackground(const PaintInfo&, - const LayoutRect&, - const Color& backgroundColor, - BackgroundBleedAvoidance = BackgroundBleedNone); - void paintFillLayer(const PaintInfo&, - const Color&, - const FillLayer&, - const LayoutRect&, - BackgroundBleedAvoidance, - RenderObject* backgroundObject, - bool skipBaseColor = false); - void paintFillLayers(const PaintInfo&, - const Color&, - const FillLayer&, - const LayoutRect&, - BackgroundBleedAvoidance = BackgroundBleedNone, - RenderObject* backgroundObject = 0); - void paintBoxDecorationBackgroundWithRect(PaintInfo&, - const LayoutPoint&, - const LayoutRect&); - - // Information extracted from RenderStyle for box painting. - // These are always needed during box painting and recomputing them takes - // time. - struct BoxDecorationData { - BoxDecorationData(const RenderStyle&); - - Color backgroundColor; - bool hasBackground; - bool hasBorder; - }; - - BackgroundBleedAvoidance determineBackgroundBleedAvoidance( - GraphicsContext*, - const BoxDecorationData&) const; - bool backgroundHasOpaqueTopLayer() const; - - void computePositionedLogicalWidth(LogicalExtentComputedValues&) const; - - LayoutUnit computeIntrinsicLogicalWidthUsing( - const Length& logicalWidthLength, - LayoutUnit availableLogicalWidth, - LayoutUnit borderAndPadding) const; - LayoutUnit computeIntrinsicLogicalContentHeightUsing( - const Length& logicalHeightLength, - LayoutUnit intrinsicContentHeight, - LayoutUnit borderAndPadding) const; - - virtual bool shouldComputeSizeAsReplaced() const { - return isReplaced() && !isInlineBlock(); - } - - virtual void mapLocalToContainer( - const RenderBox* paintInvalidationContainer, - TransformState&, - MapCoordinatesFlags = ApplyContainerFlip) const override; - - void updateIntrinsicContentLogicalHeight( - LayoutUnit intrinsicContentLogicalHeight) const { - m_intrinsicContentLogicalHeight = intrinsicContentLogicalHeight; - } - - private: - void updateTransformationMatrix(); - void updateTransform(const RenderStyle* oldStyle); - void updateFromStyle(); - - PassRefPtr createLocalTransformState( - RenderLayer* rootLayer, - RenderLayer* containerLayer, - const LayoutRect& hitTestRect, - const HitTestLocation& hitTestLocation, - const HitTestingTransformState* containerTransformState) const; - bool hitTestNonLayerDescendants(const HitTestRequest& request, - HitTestResult& result, - const LayoutRect& layerBounds, - const HitTestLocation& hitTestLocation); - - void paintLayerContents(GraphicsContext*, const LayerPaintingInfo&); - - void shrinkToFitWidth(const LayoutUnit availableSpace, - const LayoutUnit logicalLeftValue, - const LayoutUnit bordersPlusPadding, - LogicalExtentComputedValues&) const; - - bool skipContainingBlockForPercentHeightCalculation( - const RenderBox* containingBlock) const; - - LayoutUnit containingBlockLogicalWidthForPositioned( - const RenderBoxModelObject* containingBlock) const; - LayoutUnit containingBlockLogicalHeightForPositioned( - const RenderBoxModelObject* containingBlock) const; - - void computePositionedLogicalHeight(LogicalExtentComputedValues&) const; - void computePositionedLogicalWidthUsing( - Length logicalWidth, - const RenderBoxModelObject* containerBlock, - TextDirection containerDirection, - LayoutUnit containerLogicalWidth, - LayoutUnit bordersPlusPadding, - const Length& logicalLeft, - const Length& logicalRight, - const Length& marginLogicalLeft, - const Length& marginLogicalRight, - LogicalExtentComputedValues&) const; - void computePositionedLogicalHeightUsing( - Length logicalHeightLength, - const RenderBoxModelObject* containerBlock, - LayoutUnit containerLogicalHeight, - LayoutUnit bordersPlusPadding, - LayoutUnit logicalHeight, - const Length& logicalTop, - const Length& logicalBottom, - const Length& marginLogicalTop, - const Length& marginLogicalBottom, - LogicalExtentComputedValues&) const; - - void computePositionedLogicalHeightReplaced( - LogicalExtentComputedValues&) const; - void computePositionedLogicalWidthReplaced( - LogicalExtentComputedValues&) const; - - LayoutUnit fillAvailableMeasure(LayoutUnit availableLogicalWidth) const; - - virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const; - - // This function calculates the minimum and maximum preferred widths for an - // object. These values are used in shrink-to-fit layout systems. These - // include tables, positioned objects, floats and flexible boxes. - virtual void computePreferredLogicalWidths() { - clearPreferredLogicalWidthsDirty(); - } - - RenderBoxRareData& ensureRareData() { - if (!m_rareData) - m_rareData = adoptPtr(new RenderBoxRareData()); - return *m_rareData.get(); - } - - bool logicalHeightComputesAsNone(SizeType) const; - - bool isBox() const = - delete; // This will catch anyone doing an unnecessary check. - - // The width/height of the contents + borders + padding. The x/y location is - // relative to our container (which is not always our parent). - LayoutRect m_frameRect; - - // Our intrinsic height, used for min-height: min-content etc. Maintained by - // updateLogicalHeight. This is logicalHeight() before it is clamped to - // min/max. - mutable LayoutUnit m_intrinsicContentLogicalHeight; - - protected: - LayoutBoxExtent m_marginBox; - - // The preferred logical width of the element if it were to break its lines at - // every possible opportunity. - LayoutUnit m_minPreferredLogicalWidth; - - // The preferred logical width of the element if it never breaks any lines at - // all. - LayoutUnit m_maxPreferredLogicalWidth; - - // Our overflow information. - OwnPtr m_overflow; - - // TODO(ojan): Move these two into RenderBoxRareData. - OwnPtr m_transform; - - private: - OwnPtr m_layer; - OwnPtr m_rareData; -}; - -DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBox, isBox()); - -inline RenderBox* RenderBox::previousSiblingBox() const { - return toRenderBox(previousSibling()); -} - -inline RenderBox* RenderBox::nextSiblingBox() const { - return toRenderBox(nextSibling()); -} - -inline RenderBox* RenderBox::parentBox() const { - return toRenderBox(parent()); -} - -inline RenderBox* RenderBox::firstChildBox() const { - return toRenderBox(slowFirstChild()); -} - -inline RenderBox* RenderBox::lastChildBox() const { - return toRenderBox(slowLastChild()); -} - -inline void RenderBox::setInlineBoxWrapper(InlineBox* boxWrapper) { - if (boxWrapper) { - ASSERT(!inlineBoxWrapper()); - // m_inlineBoxWrapper should already be 0. Deleting it is a safeguard - // against security issues. Otherwise, there will two line box wrappers - // keeping the reference to this renderer, and only one will be notified - // when the renderer is getting destroyed. The second line box wrapper will - // keep a stale reference. - if (UNLIKELY(inlineBoxWrapper() != 0)) - deleteLineBoxWrapper(); - } - - ensureRareData().m_inlineBoxWrapper = boxWrapper; -} - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERBOX_H_ diff --git a/sky/engine/core/rendering/RenderBoxModelObject.cpp b/sky/engine/core/rendering/RenderBoxModelObject.cpp deleted file mode 100644 index 99d93b2990538..0000000000000 --- a/sky/engine/core/rendering/RenderBoxModelObject.cpp +++ /dev/null @@ -1,2387 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) - * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) - * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/RenderBoxModelObject.h" - -#include "flutter/sky/engine/core/rendering/RenderBlock.h" -#include "flutter/sky/engine/core/rendering/RenderGeometryMap.h" -#include "flutter/sky/engine/core/rendering/RenderInline.h" -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderObjectInlines.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/core/rendering/style/ShadowList.h" -#include "flutter/sky/engine/platform/LengthFunctions.h" -#include "flutter/sky/engine/platform/geometry/TransformState.h" -#include "flutter/sky/engine/platform/graphics/DrawLooperBuilder.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h" -#include "flutter/sky/engine/platform/graphics/Path.h" - -namespace blink { - -void RenderBoxModelObject::setSelectionState(SelectionState state) { - if (state == SelectionInside && selectionState() != SelectionNone) - return; - - if ((state == SelectionStart && selectionState() == SelectionEnd) || - (state == SelectionEnd && selectionState() == SelectionStart)) - RenderObject::setSelectionState(SelectionBoth); - else - RenderObject::setSelectionState(state); - - // FIXME: We should consider whether it is OK propagating to ancestor - // RenderInlines. This is a workaround for http://webkit.org/b/32123 The - // containing block can be null in case of an orphaned tree. - RenderBlock* containingBlock = this->containingBlock(); - if (containingBlock && !containingBlock->isRenderView()) - containingBlock->setSelectionState(state); -} - -RenderBoxModelObject::RenderBoxModelObject() {} - -RenderBoxModelObject::~RenderBoxModelObject() {} - -bool RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight() - const { - Length logicalHeightLength = style()->logicalHeight(); - if (logicalHeightLength.isAuto()) - return true; - - // For percentage heights: The percentage is calculated with respect to the - // height of the generated box's containing block. If the height of the - // containing block is not specified explicitly (i.e., it depends on content - // height), and this element is not absolutely positioned, the value computes - // to 'auto'. - // FIXME(sky): We might want to make height: 100% be sensible. - if (!logicalHeightLength.isPercent() || isOutOfFlowPositioned()) - return false; - - RenderBlock* cb = containingBlock(); - - // Match RenderBox::availableLogicalHeightUsing by special casing - // the render view. The available height is taken from the frame. - if (cb->isRenderView()) - return false; - - if (cb->isOutOfFlowPositioned() && !cb->style()->logicalTop().isAuto() && - !cb->style()->logicalBottom().isAuto()) - return false; - - // If the height of the containing block computes to 'auto', then it hasn't - // been 'specified explicitly'. - return cb->hasAutoHeightOrContainingBlockWithAutoHeight(); -} - -LayoutSize RenderBoxModelObject::relativePositionOffset() const { - LayoutSize offset; - - RenderBlock* containingBlock = this->containingBlock(); - - // Objects that shrink to avoid floats normally use available line width when - // computing containing block width. However in the case of relative - // positioning using percentages, we can't do this. The offset should always - // be resolved using the available width of the containing block. Therefore - // we don't use containingBlockLogicalWidthForContent() here, but instead - // explicitly call availableWidth on our containing block. - if (!style()->left().isAuto()) { - if (!style()->right().isAuto() && - !containingBlock->style()->isLeftToRightDirection()) - offset.setWidth( - -valueForLength(style()->right(), containingBlock->availableWidth())); - else - offset.expand( - valueForLength(style()->left(), containingBlock->availableWidth()), - 0); - } else if (!style()->right().isAuto()) { - offset.expand( - -valueForLength(style()->right(), containingBlock->availableWidth()), - 0); - } - - // If the containing block of a relatively positioned element does not - // specify a height, a percentage top or bottom offset should be resolved as - // auto. An exception to this is if the containing block has the WinIE quirk - // where and assume the size of the viewport. In this case, - // calculate the percent offset based on this height. - // See . - if (!style()->top().isAuto() && - (!containingBlock->hasAutoHeightOrContainingBlockWithAutoHeight() || - !style()->top().isPercent())) - offset.expand( - 0, valueForLength(style()->top(), containingBlock->availableHeight())); - - else if (!style()->bottom().isAuto() && - (!containingBlock->hasAutoHeightOrContainingBlockWithAutoHeight() || - !style()->bottom().isPercent())) - offset.expand(0, -valueForLength(style()->bottom(), - containingBlock->availableHeight())); - - return offset; -} - -LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent( - const LayoutPoint& startPoint) const { - if (!parent()) - return LayoutPoint(); - - return startPoint; -} - -LayoutUnit RenderBoxModelObject::offsetLeft() const { - // Note that RenderInline and RenderBox override this to pass a different - // startPoint to adjustedPositionRelativeToOffsetParent. - return adjustedPositionRelativeToOffsetParent(LayoutPoint()).x(); -} - -LayoutUnit RenderBoxModelObject::offsetTop() const { - // Note that RenderInline and RenderBox override this to pass a different - // startPoint to adjustedPositionRelativeToOffsetParent. - return adjustedPositionRelativeToOffsetParent(LayoutPoint()).y(); -} - -int RenderBoxModelObject::pixelSnappedOffsetWidth() const { - return snapSizeToPixel(offsetWidth(), offsetLeft()); -} - -int RenderBoxModelObject::pixelSnappedOffsetHeight() const { - return snapSizeToPixel(offsetHeight(), offsetTop()); -} - -LayoutUnit RenderBoxModelObject::computedCSSPadding( - const Length& padding) const { - LayoutUnit w = 0; - if (padding.isPercent()) - w = containingBlockLogicalWidthForContent(); - return minimumValueForLength(padding, w); -} - -RoundedRect RenderBoxModelObject::getBackgroundRoundedRect( - const LayoutRect& borderRect, - InlineFlowBox* box, - LayoutUnit inlineBoxWidth, - LayoutUnit inlineBoxHeight, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) const { - RoundedRect border = style()->getRoundedBorderFor( - borderRect, includeLogicalLeftEdge, includeLogicalRightEdge); - if (box && (box->nextLineBox() || box->prevLineBox())) { - RoundedRect segmentBorder = style()->getRoundedBorderFor( - LayoutRect(0, 0, inlineBoxWidth, inlineBoxHeight), - includeLogicalLeftEdge, includeLogicalRightEdge); - border.setRadii(segmentBorder.radii()); - } - - return border; -} - -void RenderBoxModelObject::clipRoundedInnerRect(GraphicsContext* context, - const LayoutRect& rect, - const RoundedRect& clipRect) { - if (clipRect.isRenderable()) - context->clipRoundedRect(clipRect); - else { - // We create a rounded rect for each of the corners and clip it, while - // making sure we clip opposing corners together. - if (!clipRect.radii().topLeft().isEmpty() || - !clipRect.radii().bottomRight().isEmpty()) { - IntRect topCorner(clipRect.rect().x(), clipRect.rect().y(), - rect.maxX() - clipRect.rect().x(), - rect.maxY() - clipRect.rect().y()); - RoundedRect::Radii topCornerRadii; - topCornerRadii.setTopLeft(clipRect.radii().topLeft()); - context->clipRoundedRect(RoundedRect(topCorner, topCornerRadii)); - - IntRect bottomCorner(rect.x(), rect.y(), - clipRect.rect().maxX() - rect.x(), - clipRect.rect().maxY() - rect.y()); - RoundedRect::Radii bottomCornerRadii; - bottomCornerRadii.setBottomRight(clipRect.radii().bottomRight()); - context->clipRoundedRect(RoundedRect(bottomCorner, bottomCornerRadii)); - } - - if (!clipRect.radii().topRight().isEmpty() || - !clipRect.radii().bottomLeft().isEmpty()) { - IntRect topCorner(rect.x(), clipRect.rect().y(), - clipRect.rect().maxX() - rect.x(), - rect.maxY() - clipRect.rect().y()); - RoundedRect::Radii topCornerRadii; - topCornerRadii.setTopRight(clipRect.radii().topRight()); - context->clipRoundedRect(RoundedRect(topCorner, topCornerRadii)); - - IntRect bottomCorner(clipRect.rect().x(), rect.y(), - rect.maxX() - clipRect.rect().x(), - clipRect.rect().maxY() - rect.y()); - RoundedRect::Radii bottomCornerRadii; - bottomCornerRadii.setBottomLeft(clipRect.radii().bottomLeft()); - context->clipRoundedRect(RoundedRect(bottomCorner, bottomCornerRadii)); - } - } -} - -// FIXME: See crbug.com/382491. The use of getCTM in this context is incorrect -// because the matrix returned does not include scales applied at raster time, -// such as the device zoom. -static LayoutRect shrinkRectByOnePixel(GraphicsContext* context, - const LayoutRect& rect) { - LayoutRect shrunkRect = rect; - AffineTransform transform = context->getCTM(); - shrunkRect.inflateX(-static_cast(ceil(1 / transform.xScale()))); - shrunkRect.inflateY(-static_cast(ceil(1 / transform.yScale()))); - return shrunkRect; -} - -LayoutRect RenderBoxModelObject::borderInnerRectAdjustedForBleedAvoidance( - GraphicsContext* context, - const LayoutRect& rect, - BackgroundBleedAvoidance bleedAvoidance) const { - // We shrink the rectangle by one pixel on each side to make it fully overlap - // the anti-aliased background border - return (bleedAvoidance == BackgroundBleedBackgroundOverBorder) - ? shrinkRectByOnePixel(context, rect) - : rect; -} - -RoundedRect -RenderBoxModelObject::backgroundRoundedRectAdjustedForBleedAvoidance( - GraphicsContext* context, - const LayoutRect& borderRect, - BackgroundBleedAvoidance bleedAvoidance, - InlineFlowBox* box, - const LayoutSize& boxSize, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) const { - if (bleedAvoidance == BackgroundBleedShrinkBackground) { - // We shrink the rectangle by one pixel on each side because the bleed is - // one pixel maximum. - return getBackgroundRoundedRect( - shrinkRectByOnePixel(context, borderRect), box, boxSize.width(), - boxSize.height(), includeLogicalLeftEdge, includeLogicalRightEdge); - } - if (bleedAvoidance == BackgroundBleedBackgroundOverBorder) - return style()->getRoundedInnerBorderFor(borderRect, includeLogicalLeftEdge, - includeLogicalRightEdge); - - return getBackgroundRoundedRect(borderRect, box, boxSize.width(), - boxSize.height(), includeLogicalLeftEdge, - includeLogicalRightEdge); -} - -static void applyBoxShadowForBackground(GraphicsContext* context, - const RenderObject* renderer) { - const ShadowList* shadowList = renderer->style()->boxShadow(); - ASSERT(shadowList); - for (size_t i = shadowList->shadows().size(); i--;) { - const ShadowData& boxShadow = shadowList->shadows()[i]; - if (boxShadow.style() != Normal) - continue; - FloatSize shadowOffset(boxShadow.x(), boxShadow.y()); - context->setShadow(shadowOffset, boxShadow.blur(), boxShadow.color(), - DrawLooperBuilder::ShadowRespectsTransforms, - DrawLooperBuilder::ShadowIgnoresAlpha); - return; - } -} - -void RenderBoxModelObject::paintFillLayerExtended( - const PaintInfo& paintInfo, - const Color& color, - const FillLayer& bgLayer, - const LayoutRect& rect, - BackgroundBleedAvoidance bleedAvoidance, - InlineFlowBox* box, - const LayoutSize& boxSize, - RenderObject* backgroundObject, - bool skipBaseColor) { - GraphicsContext* context = paintInfo.context; - if (rect.isEmpty()) - return; - - bool includeLeftEdge = box ? box->includeLogicalLeftEdge() : true; - bool includeRightEdge = box ? box->includeLogicalRightEdge() : true; - - bool hasRoundedBorder = - style()->hasBorderRadius() && (includeLeftEdge || includeRightEdge); - bool clippedWithLocalScrolling = - hasOverflowClip() && bgLayer.attachment() == LocalBackgroundAttachment; - bool isBorderFill = bgLayer.clip() == BorderFillBox; - bool isBottomLayer = !bgLayer.next(); - - Color bgColor = color; - StyleImage* bgImage = bgLayer.image(); - bool shouldPaintBackgroundImage = bgImage && bgImage->canRender(*this); - - bool colorVisible = bgColor.alpha(); - - // Fast path for drawing simple color backgrounds. - if (!clippedWithLocalScrolling && !shouldPaintBackgroundImage && - isBorderFill && isBottomLayer) { - if (!colorVisible) - return; - - bool boxShadowShouldBeAppliedToBackground = - this->boxShadowShouldBeAppliedToBackground(bleedAvoidance, box); - GraphicsContextStateSaver shadowStateSaver( - *context, boxShadowShouldBeAppliedToBackground); - if (boxShadowShouldBeAppliedToBackground) - applyBoxShadowForBackground(context, this); - - if (hasRoundedBorder && bleedAvoidance != BackgroundBleedClipBackground) { - RoundedRect border = backgroundRoundedRectAdjustedForBleedAvoidance( - context, rect, bleedAvoidance, box, boxSize, includeLeftEdge, - includeRightEdge); - if (border.isRenderable()) - context->fillRoundedRect(border, bgColor); - else { - context->save(); - clipRoundedInnerRect(context, rect, border); - context->fillRect(border.rect(), bgColor); - context->restore(); - } - } else { - context->fillRect(pixelSnappedIntRect(rect), bgColor); - } - - return; - } - - // BorderFillBox radius clipping is taken care of by - // BackgroundBleedClipBackground - bool clipToBorderRadius = - hasRoundedBorder && - !(isBorderFill && bleedAvoidance == BackgroundBleedClipBackground); - GraphicsContextStateSaver clipToBorderStateSaver(*context, - clipToBorderRadius); - if (clipToBorderRadius) { - RoundedRect border = isBorderFill - ? backgroundRoundedRectAdjustedForBleedAvoidance( - context, rect, bleedAvoidance, box, boxSize, - includeLeftEdge, includeRightEdge) - : getBackgroundRoundedRect( - rect, box, boxSize.width(), boxSize.height(), - includeLeftEdge, includeRightEdge); - - // Clip to the padding or content boxes as necessary. - if (bgLayer.clip() == ContentFillBox) { - border = style()->getRoundedInnerBorderFor( - border.rect(), paddingTop() + borderTop(), - paddingBottom() + borderBottom(), paddingLeft() + borderLeft(), - paddingRight() + borderRight(), includeLeftEdge, includeRightEdge); - } else if (bgLayer.clip() == PaddingFillBox) - border = style()->getRoundedInnerBorderFor(border.rect(), includeLeftEdge, - includeRightEdge); - - clipRoundedInnerRect(context, rect, border); - } - - int bLeft = includeLeftEdge ? borderLeft() : 0; - int bRight = includeRightEdge ? borderRight() : 0; - LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : LayoutUnit(); - LayoutUnit pRight = includeRightEdge ? paddingRight() : LayoutUnit(); - - GraphicsContextStateSaver clipWithScrollingStateSaver( - *context, clippedWithLocalScrolling); - LayoutRect scrolledPaintRect = rect; - if (clippedWithLocalScrolling) { - // Clip to the overflow area. - RenderBox* thisBox = toRenderBox(this); - context->clip(thisBox->overflowClipRect(rect.location())); - - // Adjust the paint rect to reflect a scrolled content box with borders at - // the ends. - scrolledPaintRect.setWidth(bLeft + thisBox->clientWidth() + bRight); - scrolledPaintRect.setHeight(borderTop() + thisBox->clientHeight() + - borderBottom()); - } - - GraphicsContextStateSaver backgroundClipStateSaver(*context, false); - - switch (bgLayer.clip()) { - case PaddingFillBox: - case ContentFillBox: { - if (clipToBorderRadius) - break; - - // Clip to the padding or content boxes as necessary. - bool includePadding = bgLayer.clip() == ContentFillBox; - LayoutRect clipRect = LayoutRect( - scrolledPaintRect.x() + bLeft + - (includePadding ? pLeft : LayoutUnit()), - scrolledPaintRect.y() + borderTop() + - (includePadding ? paddingTop() : LayoutUnit()), - scrolledPaintRect.width() - bLeft - bRight - - (includePadding ? pLeft + pRight : LayoutUnit()), - scrolledPaintRect.height() - borderTop() - borderBottom() - - (includePadding ? paddingTop() + paddingBottom() : LayoutUnit())); - backgroundClipStateSaver.save(); - context->clip(clipRect); - - break; - } - case BorderFillBox: - break; - default: - ASSERT_NOT_REACHED(); - break; - } - - // Paint the color first underneath all images, culled if background image - // occludes it. - // FIXME: In the bgLayer->hasFiniteBounds() case, we could improve the culling - // test by verifying whether the background image covers the entire layout - // rect. - if (isBottomLayer) { - IntRect backgroundRect(pixelSnappedIntRect(scrolledPaintRect)); - bool boxShadowShouldBeAppliedToBackground = - this->boxShadowShouldBeAppliedToBackground(bleedAvoidance, box); - if (boxShadowShouldBeAppliedToBackground || !shouldPaintBackgroundImage || - !bgLayer.hasOpaqueImage(this) || !bgLayer.hasRepeatXY()) { - if (!boxShadowShouldBeAppliedToBackground) - backgroundRect.intersect(paintInfo.rect); - - GraphicsContextStateSaver shadowStateSaver( - *context, boxShadowShouldBeAppliedToBackground); - if (boxShadowShouldBeAppliedToBackground) - applyBoxShadowForBackground(context, this); - - if (bgColor.alpha()) - context->fillRect(backgroundRect, bgColor, - context->compositeOperation()); - } - } -} - -static inline int resolveWidthForRatio(int height, - const FloatSize& intrinsicRatio) { - return ceilf(height * intrinsicRatio.width() / intrinsicRatio.height()); -} - -static inline int resolveHeightForRatio(int width, - const FloatSize& intrinsicRatio) { - return ceilf(width * intrinsicRatio.height() / intrinsicRatio.width()); -} - -static inline IntSize resolveAgainstIntrinsicWidthOrHeightAndRatio( - const IntSize& size, - const FloatSize& intrinsicRatio, - int useWidth, - int useHeight) { - if (intrinsicRatio.isEmpty()) { - if (useWidth) - return IntSize(useWidth, size.height()); - return IntSize(size.width(), useHeight); - } - - if (useWidth) - return IntSize(useWidth, resolveHeightForRatio(useWidth, intrinsicRatio)); - return IntSize(resolveWidthForRatio(useHeight, intrinsicRatio), useHeight); -} - -static inline IntSize resolveAgainstIntrinsicRatio( - const IntSize& size, - const FloatSize& intrinsicRatio) { - // Two possible solutions: (size.width(), solutionHeight) or (solutionWidth, - // size.height()) - // "... must be assumed to be the largest dimensions..." = easiest answer: the - // rect with the largest surface area. - - int solutionWidth = resolveWidthForRatio(size.height(), intrinsicRatio); - int solutionHeight = resolveHeightForRatio(size.width(), intrinsicRatio); - if (solutionWidth <= size.width()) { - if (solutionHeight <= size.height()) { - // If both solutions fit, choose the one covering the larger area. - int areaOne = solutionWidth * size.height(); - int areaTwo = size.width() * solutionHeight; - if (areaOne < areaTwo) - return IntSize(size.width(), solutionHeight); - return IntSize(solutionWidth, size.height()); - } - - // Only the first solution fits. - return IntSize(solutionWidth, size.height()); - } - - // Only the second solution fits, assert that. - ASSERT(solutionHeight <= size.height()); - return IntSize(size.width(), solutionHeight); -} - -IntSize RenderBoxModelObject::calculateImageIntrinsicDimensions( - StyleImage* image, - const IntSize& positioningAreaSize) const { - // A generated image without a fixed size, will always return the container - // size as intrinsic size. - if (image->isGeneratedImage() && image->usesImageContainerSize()) - return IntSize(positioningAreaSize.width(), positioningAreaSize.height()); - - Length intrinsicWidth; - Length intrinsicHeight; - FloatSize intrinsicRatio; - image->computeIntrinsicDimensions(this, intrinsicWidth, intrinsicHeight, - intrinsicRatio); - - ASSERT(!intrinsicWidth.isPercent()); - ASSERT(!intrinsicHeight.isPercent()); - - IntSize resolvedSize(intrinsicWidth.value(), intrinsicHeight.value()); - IntSize minimumSize(resolvedSize.width() > 0 ? 1 : 0, - resolvedSize.height() > 0 ? 1 : 0); - resolvedSize.clampToMinimumSize(minimumSize); - - if (!resolvedSize.isEmpty()) - return resolvedSize; - - // If the image has one of either an intrinsic width or an intrinsic height: - // * and an intrinsic aspect ratio, then the missing dimension is calculated - // from the given dimension and the ratio. - // * and no intrinsic aspect ratio, then the missing dimension is assumed to - // be the size of the rectangle that - // establishes the coordinate system for the 'background-position' property. - if (resolvedSize.width() > 0 || resolvedSize.height() > 0) - return resolveAgainstIntrinsicWidthOrHeightAndRatio( - positioningAreaSize, intrinsicRatio, resolvedSize.width(), - resolvedSize.height()); - - // If the image has no intrinsic dimensions and has an intrinsic ratio the - // dimensions must be assumed to be the largest dimensions at that ratio such - // that neither dimension exceeds the dimensions of the rectangle that - // establishes the coordinate system for the 'background-position' property. - if (!intrinsicRatio.isEmpty()) - return resolveAgainstIntrinsicRatio(positioningAreaSize, intrinsicRatio); - - // If the image has no intrinsic ratio either, then the dimensions must be - // assumed to be the rectangle that establishes the coordinate system for the - // 'background-position' property. - return positioningAreaSize; -} - -static inline void applySubPixelHeuristicForTileSize( - LayoutSize& tileSize, - const IntSize& positioningAreaSize) { - tileSize.setWidth(positioningAreaSize.width() - tileSize.width() <= 1 - ? tileSize.width().ceil() - : tileSize.width().floor()); - tileSize.setHeight(positioningAreaSize.height() - tileSize.height() <= 1 - ? tileSize.height().ceil() - : tileSize.height().floor()); -} - -IntSize RenderBoxModelObject::calculateFillTileSize( - const FillLayer& fillLayer, - const IntSize& positioningAreaSize) const { - StyleImage* image = fillLayer.image(); - EFillSizeType type = fillLayer.size().type; - - IntSize imageIntrinsicSize = - calculateImageIntrinsicDimensions(image, positioningAreaSize); - imageIntrinsicSize.scale(1 / image->imageScaleFactor(), - 1 / image->imageScaleFactor()); - switch (type) { - case SizeLength: { - LayoutSize tileSize = positioningAreaSize; - - Length layerWidth = fillLayer.size().size.width(); - Length layerHeight = fillLayer.size().size.height(); - - if (layerWidth.isFixed()) - tileSize.setWidth(layerWidth.value()); - else if (layerWidth.isPercent()) - tileSize.setWidth( - valueForLength(layerWidth, positioningAreaSize.width())); - - if (layerHeight.isFixed()) - tileSize.setHeight(layerHeight.value()); - else if (layerHeight.isPercent()) - tileSize.setHeight( - valueForLength(layerHeight, positioningAreaSize.height())); - - applySubPixelHeuristicForTileSize(tileSize, positioningAreaSize); - - // If one of the values is auto we have to use the appropriate - // scale to maintain our aspect ratio. - if (layerWidth.isAuto() && !layerHeight.isAuto()) { - if (imageIntrinsicSize.height()) - tileSize.setWidth(imageIntrinsicSize.width() * tileSize.height() / - imageIntrinsicSize.height()); - } else if (!layerWidth.isAuto() && layerHeight.isAuto()) { - if (imageIntrinsicSize.width()) - tileSize.setHeight(imageIntrinsicSize.height() * tileSize.width() / - imageIntrinsicSize.width()); - } else if (layerWidth.isAuto() && layerHeight.isAuto()) { - // If both width and height are auto, use the image's intrinsic size. - tileSize = imageIntrinsicSize; - } - - tileSize.clampNegativeToZero(); - return flooredIntSize(tileSize); - } - case SizeNone: { - // If both values are ‘auto’ then the intrinsic width and/or height of the - // image should be used, if any. - if (!imageIntrinsicSize.isEmpty()) - return imageIntrinsicSize; - - // If the image has neither an intrinsic width nor an intrinsic height, - // its size is determined as for ‘contain’. - type = Contain; - } - case Contain: - case Cover: { - float horizontalScaleFactor = - imageIntrinsicSize.width() - ? static_cast(positioningAreaSize.width()) / - imageIntrinsicSize.width() - : 1; - float verticalScaleFactor = - imageIntrinsicSize.height() - ? static_cast(positioningAreaSize.height()) / - imageIntrinsicSize.height() - : 1; - float scaleFactor = - type == Contain - ? std::min(horizontalScaleFactor, verticalScaleFactor) - : std::max(horizontalScaleFactor, verticalScaleFactor); - return IntSize( - std::max(1l, lround(imageIntrinsicSize.width() * scaleFactor)), - std::max(1l, lround(imageIntrinsicSize.height() * scaleFactor))); - } - } - - ASSERT_NOT_REACHED(); - return IntSize(); -} - -void RenderBoxModelObject::BackgroundImageGeometry::setNoRepeatX(int xOffset) { - m_destRect.move(std::max(xOffset, 0), 0); - m_phase.setX(-std::min(xOffset, 0)); - m_destRect.setWidth(m_tileSize.width() + std::min(xOffset, 0)); -} -void RenderBoxModelObject::BackgroundImageGeometry::setNoRepeatY(int yOffset) { - m_destRect.move(0, std::max(yOffset, 0)); - m_phase.setY(-std::min(yOffset, 0)); - m_destRect.setHeight(m_tileSize.height() + std::min(yOffset, 0)); -} - -void RenderBoxModelObject::BackgroundImageGeometry::useFixedAttachment( - const IntPoint& attachmentPoint) { - IntPoint alignedPoint = attachmentPoint; - m_phase.move(std::max(alignedPoint.x() - m_destRect.x(), 0), - std::max(alignedPoint.y() - m_destRect.y(), 0)); -} - -void RenderBoxModelObject::BackgroundImageGeometry::clip( - const IntRect& clipRect) { - m_destRect.intersect(clipRect); -} - -IntPoint RenderBoxModelObject::BackgroundImageGeometry::relativePhase() const { - IntPoint phase = m_phase; - phase += m_destRect.location() - m_destOrigin; - return phase; -} - -class BorderEdge { - public: - BorderEdge(int edgeWidth, - const Color& edgeColor, - EBorderStyle edgeStyle, - bool edgeIsTransparent, - bool edgeIsPresent = true) - : width(edgeWidth), - color(edgeColor), - style(edgeStyle), - isTransparent(edgeIsTransparent), - isPresent(edgeIsPresent) { - if (style == DOUBLE && edgeWidth < 3) - style = SOLID; - } - - BorderEdge() - : width(0), style(BHIDDEN), isTransparent(false), isPresent(false) {} - - bool hasVisibleColorAndStyle() const { - return style > BHIDDEN && !isTransparent; - } - bool shouldRender() const { - return isPresent && width && hasVisibleColorAndStyle(); - } - bool presentButInvisible() const { - return usedWidth() && !hasVisibleColorAndStyle(); - } - bool obscuresBackgroundEdge(float scale) const { - if (!isPresent || isTransparent || (width * scale) < 2 || - color.hasAlpha() || style == BHIDDEN) - return false; - - if (style == DOTTED || style == DASHED) - return false; - - if (style == DOUBLE) - return width >= 5 * scale; // The outer band needs to be >= 2px wide at - // unit scale. - - return true; - } - bool obscuresBackground() const { - if (!isPresent || isTransparent || color.hasAlpha() || style == BHIDDEN) - return false; - - if (style == DOTTED || style == DASHED || style == DOUBLE) - return false; - - return true; - } - - int usedWidth() const { return isPresent ? width : 0; } - - void getDoubleBorderStripeWidths(int& outerWidth, int& innerWidth) const { - int fullWidth = usedWidth(); - outerWidth = fullWidth / 3; - innerWidth = fullWidth * 2 / 3; - - // We need certain integer rounding results - if (fullWidth % 3 == 2) - outerWidth += 1; - - if (fullWidth % 3 == 1) - innerWidth += 1; - } - - int width; - Color color; - EBorderStyle style; - bool isTransparent; - bool isPresent; -}; - -static bool allCornersClippedOut(const RoundedRect& border, - const LayoutRect& clipRect) { - LayoutRect boundingRect = border.rect(); - if (clipRect.contains(boundingRect)) - return false; - - RoundedRect::Radii radii = border.radii(); - - LayoutRect topLeftRect(boundingRect.location(), radii.topLeft()); - if (clipRect.intersects(topLeftRect)) - return false; - - LayoutRect topRightRect(boundingRect.location(), radii.topRight()); - topRightRect.setX(boundingRect.maxX() - topRightRect.width()); - if (clipRect.intersects(topRightRect)) - return false; - - LayoutRect bottomLeftRect(boundingRect.location(), radii.bottomLeft()); - bottomLeftRect.setY(boundingRect.maxY() - bottomLeftRect.height()); - if (clipRect.intersects(bottomLeftRect)) - return false; - - LayoutRect bottomRightRect(boundingRect.location(), radii.bottomRight()); - bottomRightRect.setX(boundingRect.maxX() - bottomRightRect.width()); - bottomRightRect.setY(boundingRect.maxY() - bottomRightRect.height()); - if (clipRect.intersects(bottomRightRect)) - return false; - - return true; -} - -static bool borderWillArcInnerEdge(const LayoutSize& firstRadius, - const FloatSize& secondRadius) { - return !firstRadius.isZero() || !secondRadius.isZero(); -} - -enum BorderEdgeFlag { - TopBorderEdge = 1 << BSTop, - RightBorderEdge = 1 << BSRight, - BottomBorderEdge = 1 << BSBottom, - LeftBorderEdge = 1 << BSLeft, - AllBorderEdges = - TopBorderEdge | BottomBorderEdge | LeftBorderEdge | RightBorderEdge -}; - -static inline BorderEdgeFlag edgeFlagForSide(BoxSide side) { - return static_cast(1 << side); -} - -static inline bool includesEdge(BorderEdgeFlags flags, BoxSide side) { - return flags & edgeFlagForSide(side); -} - -static inline bool includesAdjacentEdges(BorderEdgeFlags flags) { - return (flags & (TopBorderEdge | RightBorderEdge)) == - (TopBorderEdge | RightBorderEdge) || - (flags & (RightBorderEdge | BottomBorderEdge)) == - (RightBorderEdge | BottomBorderEdge) || - (flags & (BottomBorderEdge | LeftBorderEdge)) == - (BottomBorderEdge | LeftBorderEdge) || - (flags & (LeftBorderEdge | TopBorderEdge)) == - (LeftBorderEdge | TopBorderEdge); -} - -inline bool edgesShareColor(const BorderEdge& firstEdge, - const BorderEdge& secondEdge) { - return firstEdge.color == secondEdge.color; -} - -inline bool styleRequiresClipPolygon(EBorderStyle style) { - return style == DOTTED || style == DASHED; // These are drawn with a stroke, - // so we have to clip to get - // corner miters. -} - -static bool borderStyleFillsBorderArea(EBorderStyle style) { - return !(style == DOTTED || style == DASHED || style == DOUBLE); -} - -static bool borderStyleHasInnerDetail(EBorderStyle style) { - return style == GROOVE || style == RIDGE || style == DOUBLE; -} - -static bool borderStyleIsDottedOrDashed(EBorderStyle style) { - return style == DOTTED || style == DASHED; -} - -// OUTSET darkens the bottom and right (and maybe lightens the top and left) -// INSET darkens the top and left (and maybe lightens the bottom and right) -static inline bool borderStyleHasUnmatchedColorsAtCorner(EBorderStyle style, - BoxSide side, - BoxSide adjacentSide) { - // These styles match at the top/left and bottom/right. - if (style == INSET || style == GROOVE || style == RIDGE || style == OUTSET) { - const BorderEdgeFlags topRightFlags = - edgeFlagForSide(BSTop) | edgeFlagForSide(BSRight); - const BorderEdgeFlags bottomLeftFlags = - edgeFlagForSide(BSBottom) | edgeFlagForSide(BSLeft); - - BorderEdgeFlags flags = - edgeFlagForSide(side) | edgeFlagForSide(adjacentSide); - return flags == topRightFlags || flags == bottomLeftFlags; - } - return false; -} - -static inline bool colorsMatchAtCorner(BoxSide side, - BoxSide adjacentSide, - const BorderEdge edges[]) { - if (edges[side].shouldRender() != edges[adjacentSide].shouldRender()) - return false; - - if (!edgesShareColor(edges[side], edges[adjacentSide])) - return false; - - return !borderStyleHasUnmatchedColorsAtCorner(edges[side].style, side, - adjacentSide); -} - -static inline bool colorNeedsAntiAliasAtCorner(BoxSide side, - BoxSide adjacentSide, - const BorderEdge edges[]) { - if (!edges[side].color.hasAlpha()) - return false; - - if (edges[side].shouldRender() != edges[adjacentSide].shouldRender()) - return false; - - if (!edgesShareColor(edges[side], edges[adjacentSide])) - return true; - - return borderStyleHasUnmatchedColorsAtCorner(edges[side].style, side, - adjacentSide); -} - -// This assumes that we draw in order: top, bottom, left, right. -static inline bool willBeOverdrawn(BoxSide side, - BoxSide adjacentSide, - const BorderEdge edges[]) { - switch (side) { - case BSTop: - case BSBottom: - if (edges[adjacentSide].presentButInvisible()) - return false; - - if (!edgesShareColor(edges[side], edges[adjacentSide]) && - edges[adjacentSide].color.hasAlpha()) - return false; - - if (!borderStyleFillsBorderArea(edges[adjacentSide].style)) - return false; - - return true; - - case BSLeft: - case BSRight: - // These draw last, so are never overdrawn. - return false; - } - return false; -} - -static inline bool borderStylesRequireMitre(BoxSide side, - BoxSide adjacentSide, - EBorderStyle style, - EBorderStyle adjacentStyle) { - if (style == DOUBLE || adjacentStyle == DOUBLE || adjacentStyle == GROOVE || - adjacentStyle == RIDGE) - return true; - - if (borderStyleIsDottedOrDashed(style) != - borderStyleIsDottedOrDashed(adjacentStyle)) - return true; - - if (style != adjacentStyle) - return true; - - return borderStyleHasUnmatchedColorsAtCorner(style, side, adjacentSide); -} - -static bool joinRequiresMitre(BoxSide side, - BoxSide adjacentSide, - const BorderEdge edges[], - bool allowOverdraw) { - if ((edges[side].isTransparent && edges[adjacentSide].isTransparent) || - !edges[adjacentSide].isPresent) - return false; - - if (allowOverdraw && willBeOverdrawn(side, adjacentSide, edges)) - return false; - - if (!edgesShareColor(edges[side], edges[adjacentSide])) - return true; - - if (borderStylesRequireMitre(side, adjacentSide, edges[side].style, - edges[adjacentSide].style)) - return true; - - return false; -} - -void RenderBoxModelObject::paintOneBorderSide( - GraphicsContext* graphicsContext, - const RenderStyle* style, - const RoundedRect& outerBorder, - const RoundedRect& innerBorder, - const IntRect& sideRect, - BoxSide side, - BoxSide adjacentSide1, - BoxSide adjacentSide2, - const BorderEdge edges[], - const Path* path, - BackgroundBleedAvoidance bleedAvoidance, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge, - bool antialias, - const Color* overrideColor) { - const BorderEdge& edgeToRender = edges[side]; - ASSERT(edgeToRender.width); - const BorderEdge& adjacentEdge1 = edges[adjacentSide1]; - const BorderEdge& adjacentEdge2 = edges[adjacentSide2]; - - bool mitreAdjacentSide1 = - joinRequiresMitre(side, adjacentSide1, edges, !antialias); - bool mitreAdjacentSide2 = - joinRequiresMitre(side, adjacentSide2, edges, !antialias); - - bool adjacentSide1StylesMatch = - colorsMatchAtCorner(side, adjacentSide1, edges); - bool adjacentSide2StylesMatch = - colorsMatchAtCorner(side, adjacentSide2, edges); - - const Color& colorToPaint = - overrideColor ? *overrideColor : edgeToRender.color; - - if (path) { - GraphicsContextStateSaver stateSaver(*graphicsContext); - if (innerBorder.isRenderable()) - clipBorderSidePolygon(graphicsContext, outerBorder, innerBorder, side, - adjacentSide1StylesMatch, adjacentSide2StylesMatch); - else - clipBorderSideForComplexInnerPath(graphicsContext, outerBorder, - innerBorder, side, edges); - float thickness = std::max( - std::max(edgeToRender.width, adjacentEdge1.width), adjacentEdge2.width); - drawBoxSideFromPath(graphicsContext, outerBorder.rect(), *path, edges, - edgeToRender.width, thickness, side, style, - colorToPaint, edgeToRender.style, bleedAvoidance, - includeLogicalLeftEdge, includeLogicalRightEdge); - } else { - bool clipForStyle = styleRequiresClipPolygon(edgeToRender.style) && - (mitreAdjacentSide1 || mitreAdjacentSide2); - bool clipAdjacentSide1 = - colorNeedsAntiAliasAtCorner(side, adjacentSide1, edges) && - mitreAdjacentSide1; - bool clipAdjacentSide2 = - colorNeedsAntiAliasAtCorner(side, adjacentSide2, edges) && - mitreAdjacentSide2; - bool shouldClip = clipForStyle || clipAdjacentSide1 || clipAdjacentSide2; - - GraphicsContextStateSaver clipStateSaver(*graphicsContext, shouldClip); - if (shouldClip) { - bool aliasAdjacentSide1 = - clipAdjacentSide1 || (clipForStyle && mitreAdjacentSide1); - bool aliasAdjacentSide2 = - clipAdjacentSide2 || (clipForStyle && mitreAdjacentSide2); - clipBorderSidePolygon(graphicsContext, outerBorder, innerBorder, side, - !aliasAdjacentSide1, !aliasAdjacentSide2); - // Since we clipped, no need to draw with a mitre. - mitreAdjacentSide1 = false; - mitreAdjacentSide2 = false; - } - - drawLineForBoxSide(graphicsContext, sideRect.x(), sideRect.y(), - sideRect.maxX(), sideRect.maxY(), side, colorToPaint, - edgeToRender.style, - mitreAdjacentSide1 ? adjacentEdge1.width : 0, - mitreAdjacentSide2 ? adjacentEdge2.width : 0, antialias); - } -} - -static IntRect calculateSideRect(const RoundedRect& outerBorder, - const BorderEdge edges[], - int side) { - IntRect sideRect = outerBorder.rect(); - int width = edges[side].width; - - if (side == BSTop) - sideRect.setHeight(width); - else if (side == BSBottom) - sideRect.shiftYEdgeTo(sideRect.maxY() - width); - else if (side == BSLeft) - sideRect.setWidth(width); - else - sideRect.shiftXEdgeTo(sideRect.maxX() - width); - - return sideRect; -} - -void RenderBoxModelObject::paintBorderSides( - GraphicsContext* graphicsContext, - const RenderStyle* style, - const RoundedRect& outerBorder, - const RoundedRect& innerBorder, - const IntPoint& innerBorderAdjustment, - const BorderEdge edges[], - BorderEdgeFlags edgeSet, - BackgroundBleedAvoidance bleedAvoidance, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge, - bool antialias, - const Color* overrideColor) { - bool renderRadii = outerBorder.isRounded(); - - Path roundedPath; - if (renderRadii) - roundedPath.addRoundedRect(outerBorder); - - // The inner border adjustment for bleed avoidance mode - // BackgroundBleedBackgroundOverBorder is only applied to sideRect, which is - // okay since BackgroundBleedBackgroundOverBorder is only to be used for solid - // borders and the shape of the border painted by drawBoxSideFromPath only - // depends on sideRect when painting solid borders. - - if (edges[BSTop].shouldRender() && includesEdge(edgeSet, BSTop)) { - IntRect sideRect = outerBorder.rect(); - sideRect.setHeight(edges[BSTop].width + innerBorderAdjustment.y()); - - bool usePath = - renderRadii && (borderStyleHasInnerDetail(edges[BSTop].style) || - borderWillArcInnerEdge(innerBorder.radii().topLeft(), - innerBorder.radii().topRight())); - paintOneBorderSide(graphicsContext, style, outerBorder, innerBorder, - sideRect, BSTop, BSLeft, BSRight, edges, - usePath ? &roundedPath : 0, bleedAvoidance, - includeLogicalLeftEdge, includeLogicalRightEdge, - antialias, overrideColor); - } - - if (edges[BSBottom].shouldRender() && includesEdge(edgeSet, BSBottom)) { - IntRect sideRect = outerBorder.rect(); - sideRect.shiftYEdgeTo(sideRect.maxY() - edges[BSBottom].width - - innerBorderAdjustment.y()); - - bool usePath = renderRadii && - (borderStyleHasInnerDetail(edges[BSBottom].style) || - borderWillArcInnerEdge(innerBorder.radii().bottomLeft(), - innerBorder.radii().bottomRight())); - paintOneBorderSide(graphicsContext, style, outerBorder, innerBorder, - sideRect, BSBottom, BSLeft, BSRight, edges, - usePath ? &roundedPath : 0, bleedAvoidance, - includeLogicalLeftEdge, includeLogicalRightEdge, - antialias, overrideColor); - } - - if (edges[BSLeft].shouldRender() && includesEdge(edgeSet, BSLeft)) { - IntRect sideRect = outerBorder.rect(); - sideRect.setWidth(edges[BSLeft].width + innerBorderAdjustment.x()); - - bool usePath = - renderRadii && (borderStyleHasInnerDetail(edges[BSLeft].style) || - borderWillArcInnerEdge(innerBorder.radii().bottomLeft(), - innerBorder.radii().topLeft())); - paintOneBorderSide(graphicsContext, style, outerBorder, innerBorder, - sideRect, BSLeft, BSTop, BSBottom, edges, - usePath ? &roundedPath : 0, bleedAvoidance, - includeLogicalLeftEdge, includeLogicalRightEdge, - antialias, overrideColor); - } - - if (edges[BSRight].shouldRender() && includesEdge(edgeSet, BSRight)) { - IntRect sideRect = outerBorder.rect(); - sideRect.shiftXEdgeTo(sideRect.maxX() - edges[BSRight].width - - innerBorderAdjustment.x()); - - bool usePath = renderRadii && - (borderStyleHasInnerDetail(edges[BSRight].style) || - borderWillArcInnerEdge(innerBorder.radii().bottomRight(), - innerBorder.radii().topRight())); - paintOneBorderSide(graphicsContext, style, outerBorder, innerBorder, - sideRect, BSRight, BSTop, BSBottom, edges, - usePath ? &roundedPath : 0, bleedAvoidance, - includeLogicalLeftEdge, includeLogicalRightEdge, - antialias, overrideColor); - } -} - -void RenderBoxModelObject::paintTranslucentBorderSides( - GraphicsContext* graphicsContext, - const RenderStyle* style, - const RoundedRect& outerBorder, - const RoundedRect& innerBorder, - const IntPoint& innerBorderAdjustment, - const BorderEdge edges[], - BorderEdgeFlags edgesToDraw, - BackgroundBleedAvoidance bleedAvoidance, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge, - bool antialias) { - // willBeOverdrawn assumes that we draw in order: top, bottom, left, right. - // This is different from BoxSide enum order. - static const BoxSide paintOrder[] = {BSTop, BSBottom, BSLeft, BSRight}; - - while (edgesToDraw) { - // Find undrawn edges sharing a color. - Color commonColor; - - BorderEdgeFlags commonColorEdgeSet = 0; - for (size_t i = 0; i < sizeof(paintOrder) / sizeof(paintOrder[0]); ++i) { - BoxSide currSide = paintOrder[i]; - if (!includesEdge(edgesToDraw, currSide)) - continue; - - bool includeEdge; - if (!commonColorEdgeSet) { - commonColor = edges[currSide].color; - includeEdge = true; - } else - includeEdge = edges[currSide].color == commonColor; - - if (includeEdge) - commonColorEdgeSet |= edgeFlagForSide(currSide); - } - - bool useTransparencyLayer = - includesAdjacentEdges(commonColorEdgeSet) && commonColor.hasAlpha(); - if (useTransparencyLayer) { - graphicsContext->beginTransparencyLayer( - static_cast(commonColor.alpha()) / 255); - commonColor = - Color(commonColor.red(), commonColor.green(), commonColor.blue()); - } - - paintBorderSides(graphicsContext, style, outerBorder, innerBorder, - innerBorderAdjustment, edges, commonColorEdgeSet, - bleedAvoidance, includeLogicalLeftEdge, - includeLogicalRightEdge, antialias, &commonColor); - - if (useTransparencyLayer) - graphicsContext->endLayer(); - - edgesToDraw &= ~commonColorEdgeSet; - } -} - -void RenderBoxModelObject::paintBorder(const PaintInfo& info, - const LayoutRect& rect, - const RenderStyle* style, - BackgroundBleedAvoidance bleedAvoidance, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) { - GraphicsContext* graphicsContext = info.context; - - BorderEdge edges[4]; - getBorderEdgeInfo(edges, style, includeLogicalLeftEdge, - includeLogicalRightEdge); - RoundedRect outerBorder = style->getRoundedBorderFor( - rect, includeLogicalLeftEdge, includeLogicalRightEdge); - RoundedRect innerBorder = style->getRoundedInnerBorderFor( - borderInnerRectAdjustedForBleedAvoidance(graphicsContext, rect, - bleedAvoidance), - includeLogicalLeftEdge, includeLogicalRightEdge); - - if (outerBorder.rect().isEmpty()) - return; - - bool haveAlphaColor = false; - bool haveAllSolidEdges = true; - bool haveAllDoubleEdges = true; - int numEdgesVisible = 4; - bool allEdgesShareColor = true; - bool allEdgesShareWidth = true; - int firstVisibleEdge = -1; - BorderEdgeFlags edgesToDraw = 0; - - for (int i = BSTop; i <= BSLeft; ++i) { - const BorderEdge& currEdge = edges[i]; - - if (edges[i].shouldRender()) - edgesToDraw |= edgeFlagForSide(static_cast(i)); - - if (currEdge.presentButInvisible()) { - --numEdgesVisible; - allEdgesShareColor = false; - allEdgesShareWidth = false; - continue; - } - - if (!currEdge.shouldRender()) { - --numEdgesVisible; - continue; - } - - if (firstVisibleEdge == -1) { - firstVisibleEdge = i; - } else { - if (currEdge.color != edges[firstVisibleEdge].color) - allEdgesShareColor = false; - if (currEdge.width != edges[firstVisibleEdge].width) - allEdgesShareWidth = false; - } - - if (currEdge.color.hasAlpha()) - haveAlphaColor = true; - - if (currEdge.style != SOLID) - haveAllSolidEdges = false; - - if (currEdge.style != DOUBLE) - haveAllDoubleEdges = false; - } - - // If no corner intersects the clip region, we can pretend outerBorder is - // rectangular to improve performance. - if (haveAllSolidEdges && outerBorder.isRounded() && - allCornersClippedOut(outerBorder, info.rect)) - outerBorder.setRadii(RoundedRect::Radii()); - - // isRenderable() check avoids issue described in - // https://bugs.webkit.org/show_bug.cgi?id=38787 - if ((haveAllSolidEdges || haveAllDoubleEdges) && allEdgesShareColor && - innerBorder.isRenderable()) { - // Fast path for drawing all solid edges and all unrounded double edges - - if (numEdgesVisible == 4 && (outerBorder.isRounded() || haveAlphaColor) && - (haveAllSolidEdges || - (!outerBorder.isRounded() && !innerBorder.isRounded()))) { - Path path; - - if (outerBorder.isRounded() && allEdgesShareWidth) { - // Very fast path for single stroked round rect with circular corners - - graphicsContext->fillBetweenRoundedRects(outerBorder, innerBorder, - edges[firstVisibleEdge].color); - return; - } - if (outerBorder.isRounded() && - bleedAvoidance != BackgroundBleedClipBackground) - path.addRoundedRect(outerBorder); - else - path.addRect(outerBorder.rect()); - - if (haveAllDoubleEdges) { - IntRect innerThirdRect = outerBorder.rect(); - IntRect outerThirdRect = outerBorder.rect(); - for (int side = BSTop; side <= BSLeft; ++side) { - int outerWidth; - int innerWidth; - edges[side].getDoubleBorderStripeWidths(outerWidth, innerWidth); - - if (side == BSTop) { - innerThirdRect.shiftYEdgeTo(innerThirdRect.y() + innerWidth); - outerThirdRect.shiftYEdgeTo(outerThirdRect.y() + outerWidth); - } else if (side == BSBottom) { - innerThirdRect.setHeight(innerThirdRect.height() - innerWidth); - outerThirdRect.setHeight(outerThirdRect.height() - outerWidth); - } else if (side == BSLeft) { - innerThirdRect.shiftXEdgeTo(innerThirdRect.x() + innerWidth); - outerThirdRect.shiftXEdgeTo(outerThirdRect.x() + outerWidth); - } else { - innerThirdRect.setWidth(innerThirdRect.width() - innerWidth); - outerThirdRect.setWidth(outerThirdRect.width() - outerWidth); - } - } - - RoundedRect outerThird = outerBorder; - RoundedRect innerThird = innerBorder; - innerThird.setRect(innerThirdRect); - outerThird.setRect(outerThirdRect); - - if (outerThird.isRounded() && - bleedAvoidance != BackgroundBleedClipBackground) - path.addRoundedRect(outerThird); - else - path.addRect(outerThird.rect()); - - if (innerThird.isRounded() && - bleedAvoidance != BackgroundBleedClipBackground) - path.addRoundedRect(innerThird); - else - path.addRect(innerThird.rect()); - } - - if (innerBorder.isRounded()) - path.addRoundedRect(innerBorder); - else - path.addRect(innerBorder.rect()); - - graphicsContext->setFillRule(RULE_EVENODD); - graphicsContext->setFillColor(edges[firstVisibleEdge].color); - graphicsContext->fillPath(path); - return; - } - // Avoid creating transparent layers - if (haveAllSolidEdges && numEdgesVisible != 4 && !outerBorder.isRounded() && - haveAlphaColor) { - Path path; - - for (int i = BSTop; i <= BSLeft; ++i) { - const BorderEdge& currEdge = edges[i]; - if (currEdge.shouldRender()) { - IntRect sideRect = calculateSideRect(outerBorder, edges, i); - path.addRect(sideRect); - } - } - - graphicsContext->setFillRule(RULE_NONZERO); - graphicsContext->setFillColor(edges[firstVisibleEdge].color); - graphicsContext->fillPath(path); - return; - } - } - - bool clipToOuterBorder = outerBorder.isRounded(); - GraphicsContextStateSaver stateSaver(*graphicsContext, clipToOuterBorder); - if (clipToOuterBorder) { - // Clip to the inner and outer radii rects. - if (bleedAvoidance != BackgroundBleedClipBackground) - graphicsContext->clipRoundedRect(outerBorder); - // isRenderable() check avoids issue described in - // https://bugs.webkit.org/show_bug.cgi?id=38787 The inside will be clipped - // out later (in clipBorderSideForComplexInnerPath) - if (innerBorder.isRenderable() && !innerBorder.isEmpty()) - graphicsContext->clipOutRoundedRect(innerBorder); - } - - // If only one edge visible antialiasing doesn't create seams - bool antialias = - shouldAntialiasLines(graphicsContext) || numEdgesVisible == 1; - RoundedRect unadjustedInnerBorder = - (bleedAvoidance == BackgroundBleedBackgroundOverBorder) - ? style->getRoundedInnerBorderFor(rect, includeLogicalLeftEdge, - includeLogicalRightEdge) - : innerBorder; - IntPoint innerBorderAdjustment( - innerBorder.rect().x() - unadjustedInnerBorder.rect().x(), - innerBorder.rect().y() - unadjustedInnerBorder.rect().y()); - if (haveAlphaColor) - paintTranslucentBorderSides( - graphicsContext, style, outerBorder, unadjustedInnerBorder, - innerBorderAdjustment, edges, edgesToDraw, bleedAvoidance, - includeLogicalLeftEdge, includeLogicalRightEdge, antialias); - else - paintBorderSides(graphicsContext, style, outerBorder, unadjustedInnerBorder, - innerBorderAdjustment, edges, edgesToDraw, bleedAvoidance, - includeLogicalLeftEdge, includeLogicalRightEdge, - antialias); -} - -void RenderBoxModelObject::drawBoxSideFromPath( - GraphicsContext* graphicsContext, - const LayoutRect& borderRect, - const Path& borderPath, - const BorderEdge edges[], - float thickness, - float drawThickness, - BoxSide side, - const RenderStyle* style, - Color color, - EBorderStyle borderStyle, - BackgroundBleedAvoidance bleedAvoidance, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) { - if (thickness <= 0) - return; - - if (borderStyle == DOUBLE && thickness < 3) - borderStyle = SOLID; - - switch (borderStyle) { - case BNONE: - case BHIDDEN: - return; - case DOTTED: - case DASHED: { - graphicsContext->setStrokeColor(color); - - // The stroke is doubled here because the provided path is the - // outside edge of the border so half the stroke is clipped off. - // The extra multiplier is so that the clipping mask can antialias - // the edges to prevent jaggies. - graphicsContext->setStrokeThickness(drawThickness * 2 * 1.1f); - graphicsContext->setStrokeStyle(borderStyle == DASHED ? DashedStroke - : DottedStroke); - - // If the number of dashes that fit in the path is odd and non-integral - // then we will have an awkwardly-sized dash at the end of the path. To - // try to avoid that here, we simply make the whitespace dashes ever so - // slightly bigger. - // FIXME: This could be even better if we tried to manipulate the dash - // offset and possibly the gapLength to get the corners dash-symmetrical. - float dashLength = thickness * ((borderStyle == DASHED) ? 3.0f : 1.0f); - float gapLength = dashLength; - float numberOfDashes = borderPath.length() / dashLength; - // Don't try to show dashes if we have less than 2 dashes + 2 gaps. - // FIXME: should do this test per side. - if (numberOfDashes >= 4) { - bool evenNumberOfFullDashes = !((int)numberOfDashes % 2); - bool integralNumberOfDashes = !(numberOfDashes - (int)numberOfDashes); - if (!evenNumberOfFullDashes && !integralNumberOfDashes) { - float numberOfGaps = numberOfDashes / 2; - gapLength += (dashLength / numberOfGaps); - } - - DashArray lineDash; - lineDash.append(dashLength); - lineDash.append(gapLength); - graphicsContext->setLineDash(lineDash, dashLength); - } - - // FIXME: stroking the border path causes issues with tight corners: - // https://bugs.webkit.org/show_bug.cgi?id=58711 - // Also, to get the best appearance we should stroke a path between the - // two borders. - graphicsContext->strokePath(borderPath); - return; - } - case DOUBLE: { - // Get the inner border rects for both the outer border line and the inner - // border line - int outerBorderTopWidth; - int innerBorderTopWidth; - edges[BSTop].getDoubleBorderStripeWidths(outerBorderTopWidth, - innerBorderTopWidth); - - int outerBorderRightWidth; - int innerBorderRightWidth; - edges[BSRight].getDoubleBorderStripeWidths(outerBorderRightWidth, - innerBorderRightWidth); - - int outerBorderBottomWidth; - int innerBorderBottomWidth; - edges[BSBottom].getDoubleBorderStripeWidths(outerBorderBottomWidth, - innerBorderBottomWidth); - - int outerBorderLeftWidth; - int innerBorderLeftWidth; - edges[BSLeft].getDoubleBorderStripeWidths(outerBorderLeftWidth, - innerBorderLeftWidth); - - // Draw inner border line - { - GraphicsContextStateSaver stateSaver(*graphicsContext); - RoundedRect innerClip = style->getRoundedInnerBorderFor( - borderRect, innerBorderTopWidth, innerBorderBottomWidth, - innerBorderLeftWidth, innerBorderRightWidth, includeLogicalLeftEdge, - includeLogicalRightEdge); - - graphicsContext->clipRoundedRect(innerClip); - drawBoxSideFromPath(graphicsContext, borderRect, borderPath, edges, - thickness, drawThickness, side, style, color, SOLID, - bleedAvoidance, includeLogicalLeftEdge, - includeLogicalRightEdge); - } - - // Draw outer border line - { - GraphicsContextStateSaver stateSaver(*graphicsContext); - LayoutRect outerRect = borderRect; - if (bleedAvoidance == BackgroundBleedClipBackground) { - outerRect.inflate(1); - ++outerBorderTopWidth; - ++outerBorderBottomWidth; - ++outerBorderLeftWidth; - ++outerBorderRightWidth; - } - - RoundedRect outerClip = style->getRoundedInnerBorderFor( - outerRect, outerBorderTopWidth, outerBorderBottomWidth, - outerBorderLeftWidth, outerBorderRightWidth, includeLogicalLeftEdge, - includeLogicalRightEdge); - graphicsContext->clipOutRoundedRect(outerClip); - drawBoxSideFromPath(graphicsContext, borderRect, borderPath, edges, - thickness, drawThickness, side, style, color, SOLID, - bleedAvoidance, includeLogicalLeftEdge, - includeLogicalRightEdge); - } - return; - } - case RIDGE: - case GROOVE: { - EBorderStyle s1; - EBorderStyle s2; - if (borderStyle == GROOVE) { - s1 = INSET; - s2 = OUTSET; - } else { - s1 = OUTSET; - s2 = INSET; - } - - // Paint full border - drawBoxSideFromPath(graphicsContext, borderRect, borderPath, edges, - thickness, drawThickness, side, style, color, s1, - bleedAvoidance, includeLogicalLeftEdge, - includeLogicalRightEdge); - - // Paint inner only - GraphicsContextStateSaver stateSaver(*graphicsContext); - LayoutUnit topWidth = edges[BSTop].usedWidth() / 2; - LayoutUnit bottomWidth = edges[BSBottom].usedWidth() / 2; - LayoutUnit leftWidth = edges[BSLeft].usedWidth() / 2; - LayoutUnit rightWidth = edges[BSRight].usedWidth() / 2; - - RoundedRect clipRect = style->getRoundedInnerBorderFor( - borderRect, topWidth, bottomWidth, leftWidth, rightWidth, - includeLogicalLeftEdge, includeLogicalRightEdge); - - graphicsContext->clipRoundedRect(clipRect); - drawBoxSideFromPath(graphicsContext, borderRect, borderPath, edges, - thickness, drawThickness, side, style, color, s2, - bleedAvoidance, includeLogicalLeftEdge, - includeLogicalRightEdge); - return; - } - case INSET: - if (side == BSTop || side == BSLeft) - color = color.dark(); - break; - case OUTSET: - if (side == BSBottom || side == BSRight) - color = color.dark(); - break; - default: - break; - } - - graphicsContext->setStrokeStyle(NoStroke); - graphicsContext->setFillColor(color); - graphicsContext->drawRect(pixelSnappedIntRect(borderRect)); -} - -void RenderBoxModelObject::clipBorderSidePolygon( - GraphicsContext* graphicsContext, - const RoundedRect& outerBorder, - const RoundedRect& innerBorder, - BoxSide side, - bool firstEdgeMatches, - bool secondEdgeMatches) { - FloatPoint quad[4]; - - const LayoutRect& outerRect = outerBorder.rect(); - const LayoutRect& innerRect = innerBorder.rect(); - - FloatPoint centerPoint( - innerRect.location().x().toFloat() + innerRect.width().toFloat() / 2, - innerRect.location().y().toFloat() + innerRect.height().toFloat() / 2); - - // For each side, create a quad that encompasses all parts of that side that - // may draw, including areas inside the innerBorder. - // - // 0----------------3 - // 0 \ / 0 - // |\ 1----------- 2 /| - // | 1 1 | - // | | | | - // | | | | - // | 2 2 | - // |/ 1------------2 \| - // 3 / \ 3 - // 0----------------3 - // - switch (side) { - case BSTop: - quad[0] = outerRect.minXMinYCorner(); - quad[1] = innerRect.minXMinYCorner(); - quad[2] = innerRect.maxXMinYCorner(); - quad[3] = outerRect.maxXMinYCorner(); - - if (!innerBorder.radii().topLeft().isZero()) { - findIntersection( - quad[0], quad[1], - FloatPoint(quad[1].x() + innerBorder.radii().topLeft().width(), - quad[1].y()), - FloatPoint(quad[1].x(), - quad[1].y() + innerBorder.radii().topLeft().height()), - quad[1]); - } - - if (!innerBorder.radii().topRight().isZero()) { - findIntersection( - quad[3], quad[2], - FloatPoint(quad[2].x() - innerBorder.radii().topRight().width(), - quad[2].y()), - FloatPoint(quad[2].x(), - quad[2].y() + innerBorder.radii().topRight().height()), - quad[2]); - } - break; - - case BSLeft: - quad[0] = outerRect.minXMinYCorner(); - quad[1] = innerRect.minXMinYCorner(); - quad[2] = innerRect.minXMaxYCorner(); - quad[3] = outerRect.minXMaxYCorner(); - - if (!innerBorder.radii().topLeft().isZero()) { - findIntersection( - quad[0], quad[1], - FloatPoint(quad[1].x() + innerBorder.radii().topLeft().width(), - quad[1].y()), - FloatPoint(quad[1].x(), - quad[1].y() + innerBorder.radii().topLeft().height()), - quad[1]); - } - - if (!innerBorder.radii().bottomLeft().isZero()) { - findIntersection( - quad[3], quad[2], - FloatPoint(quad[2].x() + innerBorder.radii().bottomLeft().width(), - quad[2].y()), - FloatPoint(quad[2].x(), - quad[2].y() - innerBorder.radii().bottomLeft().height()), - quad[2]); - } - break; - - case BSBottom: - quad[0] = outerRect.minXMaxYCorner(); - quad[1] = innerRect.minXMaxYCorner(); - quad[2] = innerRect.maxXMaxYCorner(); - quad[3] = outerRect.maxXMaxYCorner(); - - if (!innerBorder.radii().bottomLeft().isZero()) { - findIntersection( - quad[0], quad[1], - FloatPoint(quad[1].x() + innerBorder.radii().bottomLeft().width(), - quad[1].y()), - FloatPoint(quad[1].x(), - quad[1].y() - innerBorder.radii().bottomLeft().height()), - quad[1]); - } - - if (!innerBorder.radii().bottomRight().isZero()) { - findIntersection( - quad[3], quad[2], - FloatPoint(quad[2].x() - innerBorder.radii().bottomRight().width(), - quad[2].y()), - FloatPoint( - quad[2].x(), - quad[2].y() - innerBorder.radii().bottomRight().height()), - quad[2]); - } - break; - - case BSRight: - quad[0] = outerRect.maxXMinYCorner(); - quad[1] = innerRect.maxXMinYCorner(); - quad[2] = innerRect.maxXMaxYCorner(); - quad[3] = outerRect.maxXMaxYCorner(); - - if (!innerBorder.radii().topRight().isZero()) { - findIntersection( - quad[0], quad[1], - FloatPoint(quad[1].x() - innerBorder.radii().topRight().width(), - quad[1].y()), - FloatPoint(quad[1].x(), - quad[1].y() + innerBorder.radii().topRight().height()), - quad[1]); - } - - if (!innerBorder.radii().bottomRight().isZero()) { - findIntersection( - quad[3], quad[2], - FloatPoint(quad[2].x() - innerBorder.radii().bottomRight().width(), - quad[2].y()), - FloatPoint( - quad[2].x(), - quad[2].y() - innerBorder.radii().bottomRight().height()), - quad[2]); - } - break; - } - - // If the border matches both of its adjacent sides, don't anti-alias the - // clip, and if neither side matches, anti-alias the clip. - if (firstEdgeMatches == secondEdgeMatches) { - graphicsContext->clipConvexPolygon(4, quad, !firstEdgeMatches); - return; - } - - // If antialiasing settings for the first edge and second edge is different, - // they have to be addressed separately. We do this by breaking the quad into - // two parallelograms, made by moving quad[1] and quad[2]. - float ax = quad[1].x() - quad[0].x(); - float ay = quad[1].y() - quad[0].y(); - float bx = quad[2].x() - quad[1].x(); - float by = quad[2].y() - quad[1].y(); - float cx = quad[3].x() - quad[2].x(); - float cy = quad[3].y() - quad[2].y(); - - const static float kEpsilon = 1e-2f; - float r1, r2; - if (fabsf(bx) < kEpsilon && fabsf(by) < kEpsilon) { - // The quad was actually a triangle. - r1 = r2 = 1.0f; - } else { - // Extend parallelogram a bit to hide calculation error - const static float kExtendFill = 1e-2f; - - r1 = (-ax * by + ay * bx) / (cx * by - cy * bx) + kExtendFill; - r2 = (-cx * by + cy * bx) / (ax * by - ay * bx) + kExtendFill; - } - - FloatPoint firstQuad[4]; - firstQuad[0] = quad[0]; - firstQuad[1] = quad[1]; - firstQuad[2] = FloatPoint(quad[3].x() + r2 * ax, quad[3].y() + r2 * ay); - firstQuad[3] = quad[3]; - graphicsContext->clipConvexPolygon(4, firstQuad, !firstEdgeMatches); - - FloatPoint secondQuad[4]; - secondQuad[0] = quad[0]; - secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); - secondQuad[2] = quad[2]; - secondQuad[3] = quad[3]; - graphicsContext->clipConvexPolygon(4, secondQuad, !secondEdgeMatches); -} - -static IntRect calculateSideRectIncludingInner(const RoundedRect& outerBorder, - const BorderEdge edges[], - BoxSide side) { - IntRect sideRect = outerBorder.rect(); - int width; - - switch (side) { - case BSTop: - width = sideRect.height() - edges[BSBottom].width; - sideRect.setHeight(width); - break; - case BSBottom: - width = sideRect.height() - edges[BSTop].width; - sideRect.shiftYEdgeTo(sideRect.maxY() - width); - break; - case BSLeft: - width = sideRect.width() - edges[BSRight].width; - sideRect.setWidth(width); - break; - case BSRight: - width = sideRect.width() - edges[BSLeft].width; - sideRect.shiftXEdgeTo(sideRect.maxX() - width); - break; - } - - return sideRect; -} - -static RoundedRect calculateAdjustedInnerBorder(const RoundedRect& innerBorder, - BoxSide side) { - // Expand the inner border as necessary to make it a rounded rect (i.e. radii - // contained within each edge). This function relies on the fact we only get - // radii not contained within each edge if one of the radii for an edge is - // zero, so we can shift the arc towards the zero radius corner. - RoundedRect::Radii newRadii = innerBorder.radii(); - IntRect newRect = innerBorder.rect(); - - float overshoot; - float maxRadii; - - switch (side) { - case BSTop: - overshoot = newRadii.topLeft().width() + newRadii.topRight().width() - - newRect.width(); - if (overshoot > 0) { - ASSERT(!(newRadii.topLeft().width() && newRadii.topRight().width())); - newRect.setWidth(newRect.width() + overshoot); - if (!newRadii.topLeft().width()) - newRect.move(-overshoot, 0); - } - newRadii.setBottomLeft(IntSize(0, 0)); - newRadii.setBottomRight(IntSize(0, 0)); - maxRadii = - std::max(newRadii.topLeft().height(), newRadii.topRight().height()); - if (maxRadii > newRect.height()) - newRect.setHeight(maxRadii); - break; - - case BSBottom: - overshoot = newRadii.bottomLeft().width() + - newRadii.bottomRight().width() - newRect.width(); - if (overshoot > 0) { - ASSERT( - !(newRadii.bottomLeft().width() && newRadii.bottomRight().width())); - newRect.setWidth(newRect.width() + overshoot); - if (!newRadii.bottomLeft().width()) - newRect.move(-overshoot, 0); - } - newRadii.setTopLeft(IntSize(0, 0)); - newRadii.setTopRight(IntSize(0, 0)); - maxRadii = std::max(newRadii.bottomLeft().height(), - newRadii.bottomRight().height()); - if (maxRadii > newRect.height()) { - newRect.move(0, newRect.height() - maxRadii); - newRect.setHeight(maxRadii); - } - break; - - case BSLeft: - overshoot = newRadii.topLeft().height() + newRadii.bottomLeft().height() - - newRect.height(); - if (overshoot > 0) { - ASSERT( - !(newRadii.topLeft().height() && newRadii.bottomLeft().height())); - newRect.setHeight(newRect.height() + overshoot); - if (!newRadii.topLeft().height()) - newRect.move(0, -overshoot); - } - newRadii.setTopRight(IntSize(0, 0)); - newRadii.setBottomRight(IntSize(0, 0)); - maxRadii = - std::max(newRadii.topLeft().width(), newRadii.bottomLeft().width()); - if (maxRadii > newRect.width()) - newRect.setWidth(maxRadii); - break; - - case BSRight: - overshoot = newRadii.topRight().height() + - newRadii.bottomRight().height() - newRect.height(); - if (overshoot > 0) { - ASSERT( - !(newRadii.topRight().height() && newRadii.bottomRight().height())); - newRect.setHeight(newRect.height() + overshoot); - if (!newRadii.topRight().height()) - newRect.move(0, -overshoot); - } - newRadii.setTopLeft(IntSize(0, 0)); - newRadii.setBottomLeft(IntSize(0, 0)); - maxRadii = - std::max(newRadii.topRight().width(), newRadii.bottomRight().width()); - if (maxRadii > newRect.width()) { - newRect.move(newRect.width() - maxRadii, 0); - newRect.setWidth(maxRadii); - } - break; - } - - return RoundedRect(newRect, newRadii); -} - -void RenderBoxModelObject::clipBorderSideForComplexInnerPath( - GraphicsContext* graphicsContext, - const RoundedRect& outerBorder, - const RoundedRect& innerBorder, - BoxSide side, - const class BorderEdge edges[]) { - graphicsContext->clip( - calculateSideRectIncludingInner(outerBorder, edges, side)); - RoundedRect adjustedInnerRect = - calculateAdjustedInnerBorder(innerBorder, side); - if (!adjustedInnerRect.isEmpty()) - graphicsContext->clipOutRoundedRect(adjustedInnerRect); -} - -void RenderBoxModelObject::getBorderEdgeInfo( - BorderEdge edges[], - const RenderStyle* style, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) const { - edges[BSTop] = BorderEdge( - style->borderTopWidth(), style->resolveColor(style->borderTopColor()), - style->borderTopStyle(), style->borderTopIsTransparent(), true); - - edges[BSRight] = BorderEdge( - style->borderRightWidth(), style->resolveColor(style->borderRightColor()), - style->borderRightStyle(), style->borderRightIsTransparent(), - includeLogicalRightEdge); - - edges[BSBottom] = BorderEdge(style->borderBottomWidth(), - style->resolveColor(style->borderBottomColor()), - style->borderBottomStyle(), - style->borderBottomIsTransparent(), true); - - edges[BSLeft] = BorderEdge( - style->borderLeftWidth(), style->resolveColor(style->borderLeftColor()), - style->borderLeftStyle(), style->borderLeftIsTransparent(), - includeLogicalLeftEdge); -} - -bool RenderBoxModelObject::borderObscuresBackgroundEdge( - const FloatSize& contextScale) const { - BorderEdge edges[4]; - getBorderEdgeInfo(edges, style()); - - for (int i = BSTop; i <= BSLeft; ++i) { - const BorderEdge& currEdge = edges[i]; - // FIXME: for vertical text - float axisScale = (i == BSTop || i == BSBottom) ? contextScale.height() - : contextScale.width(); - if (!currEdge.obscuresBackgroundEdge(axisScale)) - return false; - } - - return true; -} - -bool RenderBoxModelObject::borderObscuresBackground() const { - if (!style()->hasBorder()) - return false; - - BorderEdge edges[4]; - getBorderEdgeInfo(edges, style()); - - for (int i = BSTop; i <= BSLeft; ++i) { - const BorderEdge& currEdge = edges[i]; - if (!currEdge.obscuresBackground()) - return false; - } - - return true; -} - -bool RenderBoxModelObject::boxShadowShouldBeAppliedToBackground( - BackgroundBleedAvoidance bleedAvoidance, - InlineFlowBox* inlineFlowBox) const { - if (bleedAvoidance != BackgroundBleedNone) - return false; - - const ShadowList* shadowList = style()->boxShadow(); - if (!shadowList) - return false; - - bool hasOneNormalBoxShadow = false; - size_t shadowCount = shadowList->shadows().size(); - for (size_t i = 0; i < shadowCount; ++i) { - const ShadowData& currentShadow = shadowList->shadows()[i]; - if (currentShadow.style() != Normal) - continue; - - if (hasOneNormalBoxShadow) - return false; - hasOneNormalBoxShadow = true; - - if (currentShadow.spread()) - return false; - } - - if (!hasOneNormalBoxShadow) - return false; - - Color backgroundColor = style()->resolveColor(style()->backgroundColor()); - if (backgroundColor.hasAlpha()) - return false; - - const FillLayer* lastBackgroundLayer = &style()->backgroundLayers(); - for (const FillLayer* next = lastBackgroundLayer->next(); next; - next = lastBackgroundLayer->next()) - lastBackgroundLayer = next; - - if (lastBackgroundLayer->clip() != BorderFillBox) - return false; - - if (lastBackgroundLayer->image() && style()->hasBorderRadius()) - return false; - - if (inlineFlowBox && - !inlineFlowBox->boxShadowCanBeAppliedToBackground(*lastBackgroundLayer)) - return false; - - if (hasOverflowClip() && - lastBackgroundLayer->attachment() == LocalBackgroundAttachment) - return false; - - return true; -} - -void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, - const LayoutRect& paintRect, - const RenderStyle* s, - ShadowStyle shadowStyle, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) { - // FIXME: Deal with border-image. Would be great to use border-image as a - // mask. - GraphicsContext* context = info.context; - if (!s->boxShadow()) - return; - - RoundedRect border = - (shadowStyle == Inset) - ? s->getRoundedInnerBorderFor(paintRect, includeLogicalLeftEdge, - includeLogicalRightEdge) - : s->getRoundedBorderFor(paintRect, includeLogicalLeftEdge, - includeLogicalRightEdge); - - bool hasBorderRadius = s->hasBorderRadius(); - bool hasOpaqueBackground = - s->resolveColor(s->backgroundColor()).alpha() == 255; - - GraphicsContextStateSaver stateSaver(*context, false); - - const ShadowList* shadowList = s->boxShadow(); - for (size_t i = shadowList->shadows().size(); i--;) { - const ShadowData& shadow = shadowList->shadows()[i]; - if (shadow.style() != shadowStyle) - continue; - - FloatSize shadowOffset(shadow.x(), shadow.y()); - float shadowBlur = shadow.blur(); - float shadowSpread = shadow.spread(); - - if (shadowOffset.isZero() && !shadowBlur && !shadowSpread) - continue; - - const Color& shadowColor = shadow.color(); - - if (shadow.style() == Normal) { - FloatRect fillRect = border.rect(); - fillRect.inflate(shadowSpread); - if (fillRect.isEmpty()) - continue; - - FloatRect shadowRect(border.rect()); - shadowRect.inflate(shadowBlur + shadowSpread); - shadowRect.move(shadowOffset); - - // Save the state and clip, if not already done. - // The clip does not depend on any shadow-specific properties. - if (!stateSaver.saved()) { - stateSaver.save(); - if (hasBorderRadius) { - RoundedRect rectToClipOut = border; - - // If the box is opaque, it is unnecessary to clip it out. However, - // doing so saves time when painting the shadow. On the other hand, it - // introduces subpixel gaps along the corners. Those are avoided by - // insetting the clipping path by one pixel. - if (hasOpaqueBackground) - rectToClipOut.inflateWithRadii(-1); - - if (!rectToClipOut.isEmpty()) { - context->clipOutRoundedRect(rectToClipOut); - } - } else { - // This IntRect is correct even with fractional shadows, because it is - // used for the rectangle of the box itself, which is always - // pixel-aligned. - IntRect rectToClipOut = border.rect(); - - // If the box is opaque, it is unnecessary to clip it out. However, - // doing so saves time when painting the shadow. On the other hand, it - // introduces subpixel gaps along the edges if they are not - // pixel-aligned. Those are avoided by insetting the clipping path by - // one pixel. - if (hasOpaqueBackground) { - // FIXME: The function to decide on the policy based on the - // transform should be a named function. - // FIXME: It's not clear if this check is right. What about integral - // scale factors? - AffineTransform transform = context->getCTM(); - if (transform.a() != 1 || - (transform.d() != 1 && transform.d() != -1) || transform.b() || - transform.c()) - rectToClipOut.inflate(-1); - } - - if (!rectToClipOut.isEmpty()) { - context->clipOut(rectToClipOut); - } - } - } - - // Draw only the shadow. - OwnPtr drawLooperBuilder = DrawLooperBuilder::create(); - drawLooperBuilder->addShadow(shadowOffset, shadowBlur, shadowColor, - DrawLooperBuilder::ShadowRespectsTransforms, - DrawLooperBuilder::ShadowIgnoresAlpha); - context->setDrawLooper(drawLooperBuilder.release()); - - if (hasBorderRadius) { - RoundedRect influenceRect(pixelSnappedIntRect(LayoutRect(shadowRect)), - border.radii()); - influenceRect.expandRadii(2 * shadowBlur + shadowSpread); - if (allCornersClippedOut(influenceRect, info.rect)) - context->fillRect(fillRect, Color::black); - else { - // TODO: support non-integer shadows - crbug.com/334829 - RoundedRect roundedFillRect = border; - roundedFillRect.inflate(shadowSpread); - - roundedFillRect.expandRadii(shadowSpread); - if (!roundedFillRect.isRenderable()) - roundedFillRect.adjustRadii(); - context->fillRoundedRect(roundedFillRect, Color::black); - } - } else { - context->fillRect(fillRect, Color::black); - } - } else { - // The inset shadow case. - GraphicsContext::Edges clippedEdges = GraphicsContext::NoEdge; - if (!includeLogicalLeftEdge) { - clippedEdges |= GraphicsContext::LeftEdge; - } - if (!includeLogicalRightEdge) { - clippedEdges |= GraphicsContext::RightEdge; - } - // TODO: support non-integer shadows - crbug.com/334828 - context->drawInnerShadow(border, shadowColor, - flooredIntSize(shadowOffset), shadowBlur, - shadowSpread, clippedEdges); - } - } -} - -LayoutUnit RenderBoxModelObject::containingBlockLogicalWidthForContent() const { - return containingBlock()->availableLogicalWidth(); -} - -LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement( - LayoutUnit width, - LayoutUnit textIndentOffset) { - ASSERT(!slowFirstChild()); - - // FIXME: This does not take into account either :first-line or :first-letter - // However, as soon as some content is entered, the line boxes will be - // constructed and this kludge is not called any more. So only the caret size - // of an empty :first-line'd block is wrong. I think we can live with that. - RenderStyle* currentStyle = firstLineStyle(); - - enum CaretAlignment { alignLeft, alignRight, alignCenter }; - - CaretAlignment alignment = alignLeft; - - switch (currentStyle->textAlign()) { - case LEFT: - break; - case CENTER: - alignment = alignCenter; - break; - case RIGHT: - alignment = alignRight; - break; - case JUSTIFY: - case TASTART: - if (!currentStyle->isLeftToRightDirection()) - alignment = alignRight; - break; - case TAEND: - if (currentStyle->isLeftToRightDirection()) - alignment = alignRight; - break; - } - - LayoutUnit x = borderLeft() + paddingLeft(); - LayoutUnit maxX = width - borderRight() - paddingRight(); - - switch (alignment) { - case alignLeft: - if (currentStyle->isLeftToRightDirection()) - x += textIndentOffset; - break; - case alignCenter: - x = (x + maxX) / 2; - if (currentStyle->isLeftToRightDirection()) - x += textIndentOffset / 2; - else - x -= textIndentOffset / 2; - break; - case alignRight: - x = maxX - caretWidth; - if (!currentStyle->isLeftToRightDirection()) - x -= textIndentOffset; - break; - } - x = std::min(x, std::max(maxX - caretWidth, 0)); - - LayoutUnit height = style()->fontMetrics().height(); - LayoutUnit verticalSpace = - lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes) - height; - LayoutUnit y = paddingTop() + borderTop() + (verticalSpace / 2); - return LayoutRect(x, y, caretWidth, height); -} - -bool RenderBoxModelObject::shouldAntialiasLines(GraphicsContext* context) { - // FIXME: We may want to not antialias when scaled by an integral value, - // and we may want to antialias when translated by a non-integral value. - // FIXME: See crbug.com/382491. getCTM does not include scale factors applied - // at raster time, such as device zoom. - return !context->getCTM().isIdentityOrTranslationOrFlipped(); -} - -void RenderBoxModelObject::mapAbsoluteToLocalPoint( - MapCoordinatesFlags mode, - TransformState& transformState) const { - RenderObject* o = container(); - if (!o) - return; - - o->mapAbsoluteToLocalPoint(mode, transformState); - - LayoutSize containerOffset = offsetFromContainer(o, LayoutPoint()); - - bool preserve3D = mode & UseTransforms && - (o->style()->preserves3D() || style()->preserves3D()); - if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { - TransformationMatrix t; - getTransformFromContainer(o, containerOffset, t); - transformState.applyTransform(t, preserve3D - ? TransformState::AccumulateTransform - : TransformState::FlattenTransform); - } else - transformState.move(containerOffset.width(), containerOffset.height(), - preserve3D ? TransformState::AccumulateTransform - : TransformState::FlattenTransform); -} - -const RenderObject* RenderBoxModelObject::pushMappingToContainer( - const RenderBox* ancestorToStopAt, - RenderGeometryMap& geometryMap) const { - ASSERT(ancestorToStopAt != this); - - bool ancestorSkipped; - RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped); - if (!container) - return 0; - - bool isInline = isRenderInline(); - bool hasTransform = !isInline && isBox() && toRenderBox(this)->transform(); - - LayoutSize adjustmentForSkippedAncestor; - if (ancestorSkipped) { - // There can't be a transform between paintInvalidationContainer and o, - // because transforms create containers, so it should be safe to just - // subtract the delta between the ancestor and o. - adjustmentForSkippedAncestor = - -ancestorToStopAt->offsetFromAncestorContainer(container); - } - - bool offsetDependsOnPoint = false; - LayoutSize containerOffset = - offsetFromContainer(container, LayoutPoint(), &offsetDependsOnPoint); - - bool preserve3D = container->style()->preserves3D() || style()->preserves3D(); - if (shouldUseTransformFromContainer(container)) { - TransformationMatrix t; - getTransformFromContainer(container, containerOffset, t); - t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), - adjustmentForSkippedAncestor.height().toFloat()); - geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, hasTransform); - } else { - containerOffset += adjustmentForSkippedAncestor; - geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint, - hasTransform); - } - - return ancestorSkipped ? ancestorToStopAt : container; -} - -void RenderBoxModelObject::collectSelfPaintingLayers( - Vector& layers) { - for (RenderObject* child = slowFirstChild(); child; - child = child->nextSibling()) { - if (child->isBox()) { - RenderBox* childBox = toRenderBox(child); - if (childBox->hasSelfPaintingLayer()) - layers.append(childBox); - else - childBox->collectSelfPaintingLayers(layers); - } else if (child->isBoxModelObject()) { - toRenderBoxModelObject(child)->collectSelfPaintingLayers(layers); - } - } -} - -void RenderBoxModelObject::moveChildTo(RenderBoxModelObject* toBoxModelObject, - RenderObject* child, - RenderObject* beforeChild, - bool fullRemoveInsert) { - // We assume that callers have cleared their positioned objects list for child - // moves (!fullRemoveInsert) so the positioned renderer maps don't become - // stale. It would be too slow to do the map lookup on each call. - ASSERT(!fullRemoveInsert || !isRenderBlock() || - !toRenderBlock(this)->hasPositionedObjects()); - - ASSERT(this == child->parent()); - ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); - if (fullRemoveInsert && (toBoxModelObject->isRenderBlock() || - toBoxModelObject->isRenderInline())) { - // Takes care of adding the new child correctly if toBlock and fromBlock - // have different kind of children (block vs inline). - toBoxModelObject->addChild(virtualChildren()->removeChildNode(this, child), - beforeChild); - } else - toBoxModelObject->virtualChildren()->insertChildNode( - toBoxModelObject, - virtualChildren()->removeChildNode(this, child, fullRemoveInsert), - beforeChild, fullRemoveInsert); -} - -void RenderBoxModelObject::moveAllChildrenTo( - RenderBoxModelObject* toBoxModelObject, - RenderObject* beforeChild, - bool fullRemoveInsert) { - // This condition is rarely hit since this function is usually called on - // anonymous blocks which can no longer carry positioned objects (see r120761) - // or when fullRemoveInsert is false. - if (fullRemoveInsert && isRenderBlock()) { - RenderBlock* block = toRenderBlock(this); - block->removePositionedObjects(0); - } - - ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); - for (RenderObject* child = slowFirstChild(); child;) { - // Save our next sibling as moveChildTo will clear it. - RenderObject* nextSibling = child->nextSibling(); - moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); - child = nextSibling; - } -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderBoxModelObject.h b/sky/engine/core/rendering/RenderBoxModelObject.h deleted file mode 100644 index cb907d8b4c35b..0000000000000 --- a/sky/engine/core/rendering/RenderBoxModelObject.h +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERBOXMODELOBJECT_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERBOXMODELOBJECT_H_ - -#include "flutter/sky/engine/core/rendering/RenderObject.h" -#include "flutter/sky/engine/core/rendering/style/ShadowData.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" - -namespace blink { - -// Modes for some of the line-related functions. -enum LinePositionMode { PositionOnContainingLine, PositionOfInteriorLineBoxes }; -// FIXME(sky): Remove this enum -enum LineDirectionMode { HorizontalLine }; -typedef unsigned BorderEdgeFlags; - -enum BackgroundBleedAvoidance { - BackgroundBleedNone, - BackgroundBleedShrinkBackground, - BackgroundBleedClipBackground, - BackgroundBleedBackgroundOverBorder -}; - -enum ContentChangeType { CanvasChanged, CanvasContextChanged }; - -// This class is the base for all objects that adhere to the CSS box model as -// described at http://www.w3.org/TR/CSS21/box.html - -class RenderBoxModelObject : public RenderObject { - public: - RenderBoxModelObject(); - virtual ~RenderBoxModelObject(); - - LayoutSize relativePositionOffset() const; - LayoutSize relativePositionLogicalOffset() const { - return relativePositionOffset(); - } - - // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines - // (RenderFlow) to return the remaining width on a given line (and the height - // of a single line). - virtual LayoutUnit offsetLeft() const; - virtual LayoutUnit offsetTop() const; - virtual LayoutUnit offsetWidth() const = 0; - virtual LayoutUnit offsetHeight() const = 0; - - int pixelSnappedOffsetLeft() const { return roundToInt(offsetLeft()); } - int pixelSnappedOffsetTop() const { return roundToInt(offsetTop()); } - virtual int pixelSnappedOffsetWidth() const; - virtual int pixelSnappedOffsetHeight() const; - - // This will work on inlines to return the bounding box of all of the lines' - // border boxes. - virtual IntRect borderBoundingBox() const = 0; - - // These return the CSS computed padding values. - LayoutUnit computedCSSPaddingTop() const { - return computedCSSPadding(style()->paddingTop()); - } - LayoutUnit computedCSSPaddingBottom() const { - return computedCSSPadding(style()->paddingBottom()); - } - LayoutUnit computedCSSPaddingLeft() const { - return computedCSSPadding(style()->paddingLeft()); - } - LayoutUnit computedCSSPaddingRight() const { - return computedCSSPadding(style()->paddingRight()); - } - LayoutUnit computedCSSPaddingBefore() const { - return computedCSSPadding(style()->paddingBefore()); - } - LayoutUnit computedCSSPaddingAfter() const { - return computedCSSPadding(style()->paddingAfter()); - } - LayoutUnit computedCSSPaddingStart() const { - return computedCSSPadding(style()->paddingStart()); - } - LayoutUnit computedCSSPaddingEnd() const { - return computedCSSPadding(style()->paddingEnd()); - } - - // These functions are used during layout. Table cells - // override them to include some extra intrinsic padding. - virtual LayoutUnit paddingTop() const { return computedCSSPaddingTop(); } - virtual LayoutUnit paddingBottom() const { - return computedCSSPaddingBottom(); - } - virtual LayoutUnit paddingLeft() const { return computedCSSPaddingLeft(); } - virtual LayoutUnit paddingRight() const { return computedCSSPaddingRight(); } - virtual LayoutUnit paddingBefore() const { - return computedCSSPaddingBefore(); - } - virtual LayoutUnit paddingAfter() const { return computedCSSPaddingAfter(); } - virtual LayoutUnit paddingStart() const { return computedCSSPaddingStart(); } - virtual LayoutUnit paddingEnd() const { return computedCSSPaddingEnd(); } - - virtual int borderTop() const { return style()->borderTopWidth(); } - virtual int borderBottom() const { return style()->borderBottomWidth(); } - virtual int borderLeft() const { return style()->borderLeftWidth(); } - virtual int borderRight() const { return style()->borderRightWidth(); } - virtual int borderBefore() const { return style()->borderBeforeWidth(); } - virtual int borderAfter() const { return style()->borderAfterWidth(); } - virtual int borderStart() const { return style()->borderStartWidth(); } - virtual int borderEnd() const { return style()->borderEndWidth(); } - - int borderWidth() const { return borderLeft() + borderRight(); } - int borderHeight() const { return borderTop() + borderBottom(); } - - LayoutUnit borderAndPaddingStart() const { - return borderStart() + paddingStart(); - } - LayoutUnit borderAndPaddingBefore() const { - return borderBefore() + paddingBefore(); - } - LayoutUnit borderAndPaddingAfter() const { - return borderAfter() + paddingAfter(); - } - - LayoutUnit borderAndPaddingHeight() const { - return borderTop() + borderBottom() + paddingTop() + paddingBottom(); - } - LayoutUnit borderAndPaddingWidth() const { - return borderLeft() + borderRight() + paddingLeft() + paddingRight(); - } - LayoutUnit borderAndPaddingLogicalHeight() const { - return borderAndPaddingBefore() + borderAndPaddingAfter(); - } - LayoutUnit borderAndPaddingLogicalWidth() const { - return borderStart() + borderEnd() + paddingStart() + paddingEnd(); - } - LayoutUnit borderAndPaddingLogicalLeft() const { - return borderLeft() + paddingLeft(); - } - - LayoutUnit borderLogicalLeft() const { return borderLeft(); } - LayoutUnit borderLogicalRight() const { return borderRight(); } - LayoutUnit borderLogicalWidth() const { return borderStart() + borderEnd(); } - LayoutUnit borderLogicalHeight() const { - return borderBefore() + borderAfter(); - } - - LayoutUnit paddingLogicalLeft() const { return paddingLeft(); } - LayoutUnit paddingLogicalRight() const { return paddingRight(); } - LayoutUnit paddingLogicalWidth() const { - return paddingStart() + paddingEnd(); - } - LayoutUnit paddingLogicalHeight() const { - return paddingBefore() + paddingAfter(); - } - - virtual LayoutUnit marginTop() const = 0; - virtual LayoutUnit marginBottom() const = 0; - virtual LayoutUnit marginLeft() const = 0; - virtual LayoutUnit marginRight() const = 0; - virtual LayoutUnit marginBefore(const RenderStyle* otherStyle = 0) const = 0; - virtual LayoutUnit marginAfter(const RenderStyle* otherStyle = 0) const = 0; - virtual LayoutUnit marginStart(const RenderStyle* otherStyle = 0) const = 0; - virtual LayoutUnit marginEnd(const RenderStyle* otherStyle = 0) const = 0; - LayoutUnit marginHeight() const { return marginTop() + marginBottom(); } - LayoutUnit marginWidth() const { return marginLeft() + marginRight(); } - LayoutUnit marginLogicalHeight() const { - return marginBefore() + marginAfter(); - } - LayoutUnit marginLogicalWidth() const { return marginStart() + marginEnd(); } - - bool hasInlineDirectionBordersPaddingOrMargin() const { - return hasInlineDirectionBordersOrPadding() || marginStart() || marginEnd(); - } - bool hasInlineDirectionBordersOrPadding() const { - return borderStart() || borderEnd() || paddingStart() || paddingEnd(); - } - - LayoutUnit containingBlockLogicalWidthForContent() const; - - void paintBorder(const PaintInfo&, - const LayoutRect&, - const RenderStyle*, - BackgroundBleedAvoidance = BackgroundBleedNone, - bool includeLogicalLeftEdge = true, - bool includeLogicalRightEdge = true); - void paintBoxShadow(const PaintInfo&, - const LayoutRect&, - const RenderStyle*, - ShadowStyle, - bool includeLogicalLeftEdge = true, - bool includeLogicalRightEdge = true); - void paintFillLayerExtended(const PaintInfo&, - const Color&, - const FillLayer&, - const LayoutRect&, - BackgroundBleedAvoidance, - InlineFlowBox* = 0, - const LayoutSize& = LayoutSize(), - RenderObject* backgroundObject = 0, - bool skipBaseColor = false); - - bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, - InlineFlowBox* = 0) const; - - // Overridden by subclasses to determine line height and baseline position. - virtual LayoutUnit lineHeight( - bool firstLine, - LineDirectionMode, - LinePositionMode = PositionOnContainingLine) const = 0; - virtual int baselinePosition( - FontBaseline, - bool firstLine, - LineDirectionMode, - LinePositionMode = PositionOnContainingLine) const = 0; - - virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, - TransformState&) const override; - virtual const RenderObject* pushMappingToContainer( - const RenderBox* ancestorToStopAt, - RenderGeometryMap&) const override; - - void collectSelfPaintingLayers(Vector& layers); - - virtual void setSelectionState(SelectionState) override; - - protected: - class BackgroundImageGeometry { - public: - BackgroundImageGeometry() : m_hasNonLocalGeometry(false) {} - - IntPoint destOrigin() const { return m_destOrigin; } - void setDestOrigin(const IntPoint& destOrigin) { - m_destOrigin = destOrigin; - } - - IntRect destRect() const { return m_destRect; } - void setDestRect(const IntRect& destRect) { m_destRect = destRect; } - - // Returns the phase relative to the destination rectangle. - IntPoint relativePhase() const; - - IntPoint phase() const { return m_phase; } - void setPhase(const IntPoint& phase) { m_phase = phase; } - - IntSize tileSize() const { return m_tileSize; } - void setTileSize(const IntSize& tileSize) { m_tileSize = tileSize; } - - // Space-size represents extra width and height that may be added to - // the image if used as a pattern with repeat: space - IntSize spaceSize() const { return m_repeatSpacing; } - void setSpaceSize(const IntSize& repeatSpacing) { - m_repeatSpacing = repeatSpacing; - } - - void setPhaseX(int x) { m_phase.setX(x); } - void setPhaseY(int y) { m_phase.setY(y); } - - void setNoRepeatX(int xOffset); - void setNoRepeatY(int yOffset); - - void useFixedAttachment(const IntPoint& attachmentPoint); - - void clip(const IntRect&); - - void setHasNonLocalGeometry(bool hasNonLocalGeometry = true) { - m_hasNonLocalGeometry = hasNonLocalGeometry; - } - bool hasNonLocalGeometry() const { return m_hasNonLocalGeometry; } - - private: - IntRect m_destRect; - IntPoint m_destOrigin; - IntPoint m_phase; - IntSize m_tileSize; - IntSize m_repeatSpacing; - bool m_hasNonLocalGeometry; // Has background-attachment: fixed. Implies - // that we can't always cheaply compute - // destRect. - }; - - LayoutPoint adjustedPositionRelativeToOffsetParent(const LayoutPoint&) const; - - void getBorderEdgeInfo(class BorderEdge[], - const RenderStyle*, - bool includeLogicalLeftEdge = true, - bool includeLogicalRightEdge = true) const; - bool borderObscuresBackgroundEdge(const FloatSize& contextScale) const; - bool borderObscuresBackground() const; - RoundedRect backgroundRoundedRectAdjustedForBleedAvoidance( - GraphicsContext*, - const LayoutRect&, - BackgroundBleedAvoidance, - InlineFlowBox*, - const LayoutSize&, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) const; - LayoutRect borderInnerRectAdjustedForBleedAvoidance( - GraphicsContext*, - const LayoutRect&, - BackgroundBleedAvoidance) const; - - LayoutRect localCaretRectForEmptyElement(LayoutUnit width, - LayoutUnit textIndentOffset); - - static void clipRoundedInnerRect(GraphicsContext*, - const LayoutRect&, - const RoundedRect& clipRect); - - bool hasAutoHeightOrContainingBlockWithAutoHeight() const; - - void paintRootBackgroundColor(const PaintInfo&, - const LayoutRect&, - const Color&); - - public: - static bool shouldAntialiasLines(GraphicsContext*); - - // These functions are only used internally to manipulate the render tree - // structure via remove/insert/appendChildNode. - void moveChildTo(RenderBoxModelObject* toBoxModelObject, - RenderObject* child, - RenderObject* beforeChild, - bool fullRemoveInsert); - void moveAllChildrenTo(RenderBoxModelObject* toBoxModelObject, - RenderObject* beforeChild, - bool fullRemoveInsert); - - IntSize calculateImageIntrinsicDimensions( - StyleImage*, - const IntSize& scaledPositioningAreaSize) const; - - private: - LayoutUnit computedCSSPadding(const Length&) const; - virtual bool isBoxModelObject() const override final { return true; } - - IntSize calculateFillTileSize(const FillLayer&, - const IntSize& scaledPositioningAreaSize) const; - - RoundedRect getBackgroundRoundedRect(const LayoutRect&, - InlineFlowBox*, - LayoutUnit inlineBoxWidth, - LayoutUnit inlineBoxHeight, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) const; - - void clipBorderSidePolygon(GraphicsContext*, - const RoundedRect& outerBorder, - const RoundedRect& innerBorder, - BoxSide, - bool firstEdgeMatches, - bool secondEdgeMatches); - void clipBorderSideForComplexInnerPath(GraphicsContext*, - const RoundedRect&, - const RoundedRect&, - BoxSide, - const class BorderEdge[]); - void paintOneBorderSide(GraphicsContext*, - const RenderStyle*, - const RoundedRect& outerBorder, - const RoundedRect& innerBorder, - const IntRect& sideRect, - BoxSide, - BoxSide adjacentSide1, - BoxSide adjacentSide2, - const class BorderEdge[], - const Path*, - BackgroundBleedAvoidance, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge, - bool antialias, - const Color* overrideColor = 0); - void paintTranslucentBorderSides(GraphicsContext*, - const RenderStyle*, - const RoundedRect& outerBorder, - const RoundedRect& innerBorder, - const IntPoint& innerBorderAdjustment, - const class BorderEdge[], - BorderEdgeFlags, - BackgroundBleedAvoidance, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge, - bool antialias = false); - void paintBorderSides(GraphicsContext*, - const RenderStyle*, - const RoundedRect& outerBorder, - const RoundedRect& innerBorder, - const IntPoint& innerBorderAdjustment, - const class BorderEdge[], - BorderEdgeFlags, - BackgroundBleedAvoidance, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge, - bool antialias = false, - const Color* overrideColor = 0); - void drawBoxSideFromPath(GraphicsContext*, - const LayoutRect&, - const Path&, - const class BorderEdge[], - float thickness, - float drawThickness, - BoxSide, - const RenderStyle*, - Color, - EBorderStyle, - BackgroundBleedAvoidance, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge); -}; - -DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBoxModelObject, isBoxModelObject()); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERBOXMODELOBJECT_H_ diff --git a/sky/engine/core/rendering/RenderFlexibleBox.cpp b/sky/engine/core/rendering/RenderFlexibleBox.cpp deleted file mode 100644 index 0460166083916..0000000000000 --- a/sky/engine/core/rendering/RenderFlexibleBox.cpp +++ /dev/null @@ -1,1437 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/RenderFlexibleBox.h" - -#include -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/platform/LengthFunctions.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -struct RenderFlexibleBox::LineContext { - LineContext(LayoutUnit crossAxisOffset, - LayoutUnit crossAxisExtent, - size_t numberOfChildren, - LayoutUnit maxAscent) - : crossAxisOffset(crossAxisOffset), - crossAxisExtent(crossAxisExtent), - numberOfChildren(numberOfChildren), - maxAscent(maxAscent) {} - - LayoutUnit crossAxisOffset; - LayoutUnit crossAxisExtent; - size_t numberOfChildren; - LayoutUnit maxAscent; -}; - -struct RenderFlexibleBox::Violation { - Violation(RenderBox* child, LayoutUnit childSize) - : child(child), childSize(childSize) {} - - RenderBox* child; - LayoutUnit childSize; -}; - -RenderFlexibleBox::RenderFlexibleBox() - : m_orderIterator(this), m_numberOfInFlowChildrenOnFirstLine(-1) {} - -RenderFlexibleBox::~RenderFlexibleBox() {} - -const char* RenderFlexibleBox::renderName() const { - return "RenderFlexibleBox"; -} - -void RenderFlexibleBox::computeIntrinsicLogicalWidths( - LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const { - // FIXME: We're ignoring flex-basis here and we shouldn't. We can't start - // honoring it though until the flex shorthand stops setting it to 0. See - // https://bugs.webkit.org/show_bug.cgi?id=116117 and http://crbug.com/240765. - for (RenderBox* child = firstChildBox(); child; - child = child->nextSiblingBox()) { - if (child->isOutOfFlowPositioned()) - continue; - - LayoutUnit margin = marginIntrinsicLogicalWidthForChild(child); - LayoutUnit minPreferredLogicalWidth = child->minPreferredLogicalWidth(); - LayoutUnit maxPreferredLogicalWidth = child->maxPreferredLogicalWidth(); - minPreferredLogicalWidth += margin; - maxPreferredLogicalWidth += margin; - if (!isColumnFlow()) { - maxLogicalWidth += maxPreferredLogicalWidth; - if (isMultiline()) { - // For multiline, the min preferred width is if you put a break between - // each item. - minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalWidth); - } else - minLogicalWidth += minPreferredLogicalWidth; - } else { - minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth); - maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth); - } - } - - maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); -} - -static int synthesizedBaselineFromContentBox(const RenderBox* box, - LineDirectionMode direction) { - return direction == HorizontalLine - ? box->borderTop() + box->paddingTop() + box->contentHeight() - : box->borderRight() + box->paddingRight() + box->contentWidth(); -} - -int RenderFlexibleBox::baselinePosition(FontBaseline, - bool, - LineDirectionMode direction, - LinePositionMode mode) const { - ASSERT(mode == PositionOnContainingLine); - int baseline = firstLineBoxBaseline(FontBaselineOrAuto()); - if (baseline == -1) - baseline = synthesizedBaselineFromContentBox(this, direction); - - return beforeMarginInLineDirection(direction) + baseline; -} - -int RenderFlexibleBox::firstLineBoxBaseline( - FontBaselineOrAuto baselineType) const { - if (m_numberOfInFlowChildrenOnFirstLine <= 0) - return -1; - RenderBox* baselineChild = 0; - int childNumber = 0; - for (RenderBox* child = m_orderIterator.first(); child; - child = m_orderIterator.next()) { - if (child->isOutOfFlowPositioned()) - continue; - if (alignmentForChild(child) == ItemPositionBaseline && - !hasAutoMarginsInCrossAxis(child)) { - baselineChild = child; - break; - } - if (!baselineChild) - baselineChild = child; - - ++childNumber; - if (childNumber == m_numberOfInFlowChildrenOnFirstLine) - break; - } - - if (!baselineChild) - return -1; - - if (!isColumnFlow() && hasOrthogonalFlow(baselineChild)) - return crossAxisExtentForChild(baselineChild) + baselineChild->logicalTop(); - if (isColumnFlow() && !hasOrthogonalFlow(baselineChild)) - return mainAxisExtentForChild(baselineChild) + baselineChild->logicalTop(); - - int baseline = baselineChild->firstLineBoxBaseline(baselineType); - if (baseline == -1) { - // FIXME: We should pass |direction| into firstLineBoxBaseline and stop - // bailing out if we're a writing mode root. This would also fix some cases - // where the flexbox is orthogonal to its container. - LineDirectionMode direction = HorizontalLine; - return synthesizedBaselineFromContentBox(baselineChild, direction) + - baselineChild->logicalTop(); - } - - return baseline + baselineChild->logicalTop(); -} - -int RenderFlexibleBox::inlineBlockBaseline(LineDirectionMode direction) const { - int baseline = firstLineBoxBaseline(FontBaselineOrAuto()); - if (baseline != -1) - return baseline; - - int marginAscent = direction == HorizontalLine ? marginTop() : marginRight(); - return synthesizedBaselineFromContentBox(this, direction) + marginAscent; -} - -static ItemPosition resolveAlignment(const RenderStyle* parentStyle, - const RenderStyle* childStyle) { - ItemPosition align = childStyle->alignSelf(); - if (align == ItemPositionAuto) - align = (parentStyle->alignItems() == ItemPositionAuto) - ? ItemPositionStretch - : parentStyle->alignItems(); - return align; -} - -void RenderFlexibleBox::removeChild(RenderObject* child) { - RenderBlock::removeChild(child); - m_intrinsicSizeAlongMainAxis.remove(child); -} - -void RenderFlexibleBox::styleDidChange(StyleDifference diff, - const RenderStyle* oldStyle) { - RenderBlock::styleDidChange(diff, oldStyle); - - if (oldStyle && oldStyle->alignItems() == ItemPositionStretch && - diff.needsFullLayout()) { - // Flex items that were previously stretching need to be relayed out so we - // can compute new available cross axis space. This is only necessary for - // stretching since other alignment values don't change the size of the box. - for (RenderBox* child = firstChildBox(); child; - child = child->nextSiblingBox()) { - ItemPosition previousAlignment = - resolveAlignment(oldStyle, child->style()); - if (previousAlignment == ItemPositionStretch && - previousAlignment != resolveAlignment(style(), child->style())) - child->setChildNeedsLayout(MarkOnlyThis); - } - } -} - -void RenderFlexibleBox::layout() { - ASSERT(needsLayout()); - - if (simplifiedLayout()) - return; - - bool relayoutChildren = updateLogicalWidthAndColumnWidth(); - LayoutUnit previousHeight = logicalHeight(); - setLogicalHeight(borderAndPaddingLogicalHeight()); - - m_numberOfInFlowChildrenOnFirstLine = -1; - - prepareOrderIteratorAndMargins(); - - ChildFrameRects oldChildRects; - appendChildFrameRects(oldChildRects); - - layoutFlexItems(relayoutChildren); - - if (logicalHeight() != previousHeight) - relayoutChildren = true; - - layoutPositionedObjects(relayoutChildren); - - // FIXME: css3/flexbox/repaint-rtl-column.html seems to issue paint - // invalidations for more overflow than it needs to. - computeOverflow(clientLogicalBottomAfterRepositioning()); - - updateLayerTransformAfterLayout(); - - clearNeedsLayout(); -} - -void RenderFlexibleBox::appendChildFrameRects( - ChildFrameRects& childFrameRects) { - for (RenderBox* child = m_orderIterator.first(); child; - child = m_orderIterator.next()) { - if (!child->isOutOfFlowPositioned()) - childFrameRects.append(child->frameRect()); - } -} - -void RenderFlexibleBox::paintChildren(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - Vector& layers) { - for (RenderBox* child = m_orderIterator.first(); child; - child = m_orderIterator.next()) { - if (child->hasSelfPaintingLayer()) - layers.append(child); - else - child->paint(paintInfo, paintOffset, layers); - } -} - -void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems( - Vector& lineContexts) { - LayoutUnit crossAxisStartEdge = - lineContexts.isEmpty() ? LayoutUnit() : lineContexts[0].crossAxisOffset; - alignFlexLines(lineContexts); - - alignChildren(lineContexts); - - if (style()->flexWrap() == FlexWrapReverse) - flipForWrapReverse(lineContexts, crossAxisStartEdge); - - // direction:rtl + flex-direction:column means the cross-axis direction is - // flipped. - flipForRightToLeftColumn(); -} - -LayoutUnit RenderFlexibleBox::clientLogicalBottomAfterRepositioning() { - LayoutUnit maxChildLogicalBottom = 0; - for (RenderBox* child = firstChildBox(); child; - child = child->nextSiblingBox()) { - if (child->isOutOfFlowPositioned()) - continue; - LayoutUnit childLogicalBottom = logicalTopForChild(child) + - logicalHeightForChild(child) + - marginAfterForChild(child); - maxChildLogicalBottom = std::max(maxChildLogicalBottom, childLogicalBottom); - } - return std::max(clientLogicalBottom(), - maxChildLogicalBottom + paddingAfter()); -} - -bool RenderFlexibleBox::hasOrthogonalFlow(RenderBox* child) const { - // FIXME: If the child is a flexbox, then we need to check isHorizontalFlow. - return !isHorizontalFlow(); -} - -bool RenderFlexibleBox::isColumnFlow() const { - return style()->isColumnFlexDirection(); -} - -bool RenderFlexibleBox::isHorizontalFlow() const { - return !isColumnFlow(); -} - -bool RenderFlexibleBox::isLeftToRightFlow() const { - if (isColumnFlow()) - return true; - return style()->isLeftToRightDirection() ^ - (style()->flexDirection() == FlowRowReverse); -} - -bool RenderFlexibleBox::isMultiline() const { - return style()->flexWrap() != FlexNoWrap; -} - -Length RenderFlexibleBox::flexBasisForChild(RenderBox* child) const { - Length flexLength = child->style()->flexBasis(); - if (flexLength.isAuto()) - flexLength = - isHorizontalFlow() ? child->style()->width() : child->style()->height(); - return flexLength; -} - -LayoutUnit RenderFlexibleBox::crossAxisExtentForChild(RenderBox* child) const { - return isHorizontalFlow() ? child->height() : child->width(); -} - -static inline LayoutUnit constrainedChildIntrinsicContentLogicalHeight( - RenderBox* child) { - LayoutUnit childIntrinsicContentLogicalHeight = - child->intrinsicContentLogicalHeight(); - return child->constrainLogicalHeightByMinMax( - childIntrinsicContentLogicalHeight + - child->borderAndPaddingLogicalHeight(), - childIntrinsicContentLogicalHeight); -} - -LayoutUnit RenderFlexibleBox::childIntrinsicHeight(RenderBox* child) const { - if (needToStretchChildLogicalHeight(child)) - return constrainedChildIntrinsicContentLogicalHeight(child); - return child->height(); -} - -LayoutUnit RenderFlexibleBox::childIntrinsicWidth(RenderBox* child) const { - // FIXME(sky): Remove - return child->width(); -} - -LayoutUnit RenderFlexibleBox::crossAxisIntrinsicExtentForChild( - RenderBox* child) const { - return isHorizontalFlow() ? childIntrinsicHeight(child) - : childIntrinsicWidth(child); -} - -LayoutUnit RenderFlexibleBox::mainAxisExtentForChild(RenderBox* child) const { - return isHorizontalFlow() ? child->width() : child->height(); -} - -LayoutUnit RenderFlexibleBox::crossAxisExtent() const { - return isHorizontalFlow() ? height() : width(); -} - -LayoutUnit RenderFlexibleBox::mainAxisExtent() const { - return isHorizontalFlow() ? width() : height(); -} - -LayoutUnit RenderFlexibleBox::crossAxisContentExtent() const { - return isHorizontalFlow() ? contentHeight() : contentWidth(); -} - -LayoutUnit RenderFlexibleBox::mainAxisContentExtent( - LayoutUnit contentLogicalHeight) { - if (isColumnFlow()) { - LogicalExtentComputedValues computedValues; - LayoutUnit borderPaddingAndScrollbar = borderAndPaddingLogicalHeight(); - LayoutUnit borderBoxLogicalHeight = - contentLogicalHeight + borderPaddingAndScrollbar; - computeLogicalHeight(borderBoxLogicalHeight, logicalTop(), computedValues); - if (computedValues.m_extent == LayoutUnit::max()) - return computedValues.m_extent; - return std::max(LayoutUnit(0), - computedValues.m_extent - borderPaddingAndScrollbar); - } - return contentLogicalWidth(); -} - -LayoutUnit RenderFlexibleBox::computeMainAxisExtentForChild( - RenderBox* child, - SizeType sizeType, - const Length& size) { - // FIXME: This is wrong for orthogonal flows. It should use the flexbox's - // writing-mode, not the child's in order to figure out the logical - // height/width. - if (isColumnFlow()) { - // We don't have to check for "auto" here - computeContentLogicalHeight will - // just return -1 for that case anyway. - if (size.isIntrinsic()) - child->layoutIfNeeded(); - return child->computeContentLogicalHeight( - size, child->logicalHeight() - child->borderAndPaddingLogicalHeight()); - } - return child->computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(), - this) - - child->borderAndPaddingLogicalWidth(); -} - -LayoutUnit RenderFlexibleBox::flowAwareBorderStart() const { - if (isHorizontalFlow()) - return isLeftToRightFlow() ? borderLeft() : borderRight(); - return isLeftToRightFlow() ? borderTop() : borderBottom(); -} - -LayoutUnit RenderFlexibleBox::flowAwareBorderEnd() const { - if (isHorizontalFlow()) - return isLeftToRightFlow() ? borderRight() : borderLeft(); - return isLeftToRightFlow() ? borderBottom() : borderTop(); -} - -LayoutUnit RenderFlexibleBox::flowAwareBorderBefore() const { - return isHorizontalFlow() ? borderTop() : borderLeft(); -} - -LayoutUnit RenderFlexibleBox::flowAwareBorderAfter() const { - return isHorizontalFlow() ? borderBottom() : borderRight(); -} - -LayoutUnit RenderFlexibleBox::flowAwarePaddingStart() const { - if (isHorizontalFlow()) - return isLeftToRightFlow() ? paddingLeft() : paddingRight(); - return isLeftToRightFlow() ? paddingTop() : paddingBottom(); -} - -LayoutUnit RenderFlexibleBox::flowAwarePaddingEnd() const { - if (isHorizontalFlow()) - return isLeftToRightFlow() ? paddingRight() : paddingLeft(); - return isLeftToRightFlow() ? paddingBottom() : paddingTop(); -} - -LayoutUnit RenderFlexibleBox::flowAwarePaddingBefore() const { - return isHorizontalFlow() ? paddingTop() : paddingLeft(); -} - -LayoutUnit RenderFlexibleBox::flowAwarePaddingAfter() const { - return isHorizontalFlow() ? paddingBottom() : paddingRight(); -} - -LayoutUnit RenderFlexibleBox::flowAwareMarginStartForChild( - RenderBox* child) const { - if (isHorizontalFlow()) - return isLeftToRightFlow() ? child->marginLeft() : child->marginRight(); - return isLeftToRightFlow() ? child->marginTop() : child->marginBottom(); -} - -LayoutUnit RenderFlexibleBox::flowAwareMarginEndForChild( - RenderBox* child) const { - if (isHorizontalFlow()) - return isLeftToRightFlow() ? child->marginRight() : child->marginLeft(); - return isLeftToRightFlow() ? child->marginBottom() : child->marginTop(); -} - -LayoutUnit RenderFlexibleBox::flowAwareMarginBeforeForChild( - RenderBox* child) const { - return isHorizontalFlow() ? child->marginTop() : child->marginLeft(); -} - -LayoutUnit RenderFlexibleBox::crossAxisMarginExtentForChild( - RenderBox* child) const { - return isHorizontalFlow() ? child->marginHeight() : child->marginWidth(); -} - -LayoutPoint RenderFlexibleBox::flowAwareLocationForChild( - RenderBox* child) const { - return isHorizontalFlow() ? child->location() - : child->location().transposedPoint(); -} - -void RenderFlexibleBox::setFlowAwareLocationForChild( - RenderBox* child, - const LayoutPoint& location) { - if (isHorizontalFlow()) - child->setLocation(location); - else - child->setLocation(location.transposedPoint()); -} - -LayoutUnit RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild( - RenderBox* child) const { - return isHorizontalFlow() ? child->borderAndPaddingWidth() - : child->borderAndPaddingHeight(); -} - -static inline bool preferredMainAxisExtentDependsOnLayout( - const Length& flexBasis, - bool hasInfiniteLineLength) { - return flexBasis.isAuto() || (flexBasis.isPercent() && hasInfiniteLineLength); -} - -bool RenderFlexibleBox::childPreferredMainAxisContentExtentRequiresLayout( - RenderBox* child, - bool hasInfiniteLineLength) const { - return preferredMainAxisExtentDependsOnLayout(flexBasisForChild(child), - hasInfiniteLineLength) && - hasOrthogonalFlow(child); -} - -LayoutUnit RenderFlexibleBox::preferredMainAxisContentExtentForChild( - RenderBox* child, - bool hasInfiniteLineLength, - bool relayoutChildren) { - child->clearOverrideSize(); - - Length flexBasis = flexBasisForChild(child); - if (preferredMainAxisExtentDependsOnLayout(flexBasis, - hasInfiniteLineLength)) { - LayoutUnit mainAxisExtent; - if (hasOrthogonalFlow(child)) { - if (child->needsLayout() || relayoutChildren) { - m_intrinsicSizeAlongMainAxis.remove(child); - child->forceChildLayout(); - m_intrinsicSizeAlongMainAxis.set(child, child->logicalHeight()); - } - ASSERT(m_intrinsicSizeAlongMainAxis.contains(child)); - mainAxisExtent = m_intrinsicSizeAlongMainAxis.get(child); - } else { - mainAxisExtent = child->maxPreferredLogicalWidth(); - } - ASSERT(mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child) >= 0); - return mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child); - } - return std::max(LayoutUnit(0), computeMainAxisExtentForChild( - child, MainOrPreferredSize, flexBasis)); -} - -void RenderFlexibleBox::layoutFlexItems(bool relayoutChildren) { - Vector lineContexts; - OrderedFlexItemList orderedChildren; - LayoutUnit sumFlexBaseSize; - double totalFlexGrow; - double totalWeightedFlexShrink; - LayoutUnit sumHypotheticalMainSize; - - Vector childSizes; - - m_orderIterator.first(); - LayoutUnit crossAxisOffset = - flowAwareBorderBefore() + flowAwarePaddingBefore(); - bool hasInfiniteLineLength = false; - while (computeNextFlexLine(orderedChildren, sumFlexBaseSize, totalFlexGrow, - totalWeightedFlexShrink, sumHypotheticalMainSize, - hasInfiniteLineLength, relayoutChildren)) { - LayoutUnit containerMainInnerSize = - mainAxisContentExtent(sumHypotheticalMainSize); - LayoutUnit availableFreeSpace = containerMainInnerSize - sumFlexBaseSize; - FlexSign flexSign = (sumHypotheticalMainSize < containerMainInnerSize) - ? PositiveFlexibility - : NegativeFlexibility; - InflexibleFlexItemSize inflexibleItems; - childSizes.reserveCapacity(orderedChildren.size()); - while (!resolveFlexibleLengths(flexSign, orderedChildren, - availableFreeSpace, totalFlexGrow, - totalWeightedFlexShrink, inflexibleItems, - childSizes, hasInfiniteLineLength)) { - ASSERT(totalFlexGrow >= 0 && totalWeightedFlexShrink >= 0); - ASSERT(inflexibleItems.size() > 0); - } - - layoutAndPlaceChildren(crossAxisOffset, orderedChildren, childSizes, - availableFreeSpace, relayoutChildren, lineContexts, - hasInfiniteLineLength); - } - if (hasLineIfEmpty()) { - // Even if computeNextFlexLine returns true, the flexbox might not have - // a line because all our children might be out of flow positioned. - // Instead of just checking if we have a line, make sure the flexbox - // has at least a line's worth of height to cover this case. - LayoutUnit minHeight = - borderAndPaddingLogicalHeight() + - lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes); - if (height() < minHeight) - setLogicalHeight(minHeight); - } - - updateLogicalHeight(); - repositionLogicalHeightDependentFlexItems(lineContexts); -} - -LayoutUnit RenderFlexibleBox::autoMarginOffsetInMainAxis( - const OrderedFlexItemList& children, - LayoutUnit& availableFreeSpace) { - if (availableFreeSpace <= 0) - return 0; - - int numberOfAutoMargins = 0; - bool isHorizontal = isHorizontalFlow(); - for (size_t i = 0; i < children.size(); ++i) { - RenderBox* child = children[i]; - if (child->isOutOfFlowPositioned()) - continue; - if (isHorizontal) { - if (child->style()->marginLeft().isAuto()) - ++numberOfAutoMargins; - if (child->style()->marginRight().isAuto()) - ++numberOfAutoMargins; - } else { - if (child->style()->marginTop().isAuto()) - ++numberOfAutoMargins; - if (child->style()->marginBottom().isAuto()) - ++numberOfAutoMargins; - } - } - if (!numberOfAutoMargins) - return 0; - - LayoutUnit sizeOfAutoMargin = availableFreeSpace / numberOfAutoMargins; - availableFreeSpace = 0; - return sizeOfAutoMargin; -} - -void RenderFlexibleBox::updateAutoMarginsInMainAxis( - RenderBox* child, - LayoutUnit autoMarginOffset) { - ASSERT(autoMarginOffset >= 0); - - if (isHorizontalFlow()) { - if (child->style()->marginLeft().isAuto()) - child->setMarginLeft(autoMarginOffset); - if (child->style()->marginRight().isAuto()) - child->setMarginRight(autoMarginOffset); - } else { - if (child->style()->marginTop().isAuto()) - child->setMarginTop(autoMarginOffset); - if (child->style()->marginBottom().isAuto()) - child->setMarginBottom(autoMarginOffset); - } -} - -bool RenderFlexibleBox::hasAutoMarginsInCrossAxis(RenderBox* child) const { - if (isHorizontalFlow()) - return child->style()->marginTop().isAuto() || - child->style()->marginBottom().isAuto(); - return child->style()->marginLeft().isAuto() || - child->style()->marginRight().isAuto(); -} - -LayoutUnit RenderFlexibleBox::availableAlignmentSpaceForChild( - LayoutUnit lineCrossAxisExtent, - RenderBox* child) { - ASSERT(!child->isOutOfFlowPositioned()); - LayoutUnit childCrossExtent = - crossAxisMarginExtentForChild(child) + crossAxisExtentForChild(child); - return lineCrossAxisExtent - childCrossExtent; -} - -LayoutUnit RenderFlexibleBox::availableAlignmentSpaceForChildBeforeStretching( - LayoutUnit lineCrossAxisExtent, - RenderBox* child) { - ASSERT(!child->isOutOfFlowPositioned()); - LayoutUnit childCrossExtent = crossAxisMarginExtentForChild(child) + - crossAxisIntrinsicExtentForChild(child); - return lineCrossAxisExtent - childCrossExtent; -} - -bool RenderFlexibleBox::updateAutoMarginsInCrossAxis( - RenderBox* child, - LayoutUnit availableAlignmentSpace) { - ASSERT(!child->isOutOfFlowPositioned()); - ASSERT(availableAlignmentSpace >= 0); - - bool isHorizontal = isHorizontalFlow(); - Length topOrLeft = - isHorizontal ? child->style()->marginTop() : child->style()->marginLeft(); - Length bottomOrRight = isHorizontal ? child->style()->marginBottom() - : child->style()->marginRight(); - if (topOrLeft.isAuto() && bottomOrRight.isAuto()) { - adjustAlignmentForChild(child, availableAlignmentSpace / 2); - if (isHorizontal) { - child->setMarginTop(availableAlignmentSpace / 2); - child->setMarginBottom(availableAlignmentSpace / 2); - } else { - child->setMarginLeft(availableAlignmentSpace / 2); - child->setMarginRight(availableAlignmentSpace / 2); - } - return true; - } - bool shouldAdjustTopOrLeft = true; - if (isColumnFlow() && !child->style()->isLeftToRightDirection()) { - // For column flows, only make this adjustment if topOrLeft corresponds to - // the "before" margin, so that flipForRightToLeftColumn will do the right - // thing. - shouldAdjustTopOrLeft = false; - } - - if (topOrLeft.isAuto()) { - if (shouldAdjustTopOrLeft) - adjustAlignmentForChild(child, availableAlignmentSpace); - - if (isHorizontal) - child->setMarginTop(availableAlignmentSpace); - else - child->setMarginLeft(availableAlignmentSpace); - return true; - } - if (bottomOrRight.isAuto()) { - if (!shouldAdjustTopOrLeft) - adjustAlignmentForChild(child, availableAlignmentSpace); - - if (isHorizontal) - child->setMarginBottom(availableAlignmentSpace); - else - child->setMarginRight(availableAlignmentSpace); - return true; - } - return false; -} - -LayoutUnit RenderFlexibleBox::marginBoxAscentForChild(RenderBox* child) { - LayoutUnit ascent = child->firstLineBoxBaseline(FontBaselineOrAuto()); - if (ascent == -1) - ascent = crossAxisExtentForChild(child); - return ascent + flowAwareMarginBeforeForChild(child); -} - -LayoutUnit RenderFlexibleBox::computeChildMarginValue(Length margin) { - // When resolving the margins, we use the content size for resolving percent - // and calc (for percents in calc expressions) margins. Fortunately, percent - // margins are always computed with respect to the block's width, even for - // margin-top and margin-bottom. - LayoutUnit availableSize = contentLogicalWidth(); - return minimumValueForLength(margin, availableSize); -} - -void RenderFlexibleBox::prepareOrderIteratorAndMargins() { - OrderIteratorPopulator populator(m_orderIterator); - - for (RenderBox* child = firstChildBox(); child; - child = child->nextSiblingBox()) { - populator.collectChild(child); - - if (child->isOutOfFlowPositioned()) - continue; - - // Before running the flex algorithm, 'auto' has a margin of 0. - // Also, if we're not auto sizing, we don't do a layout that computes the - // start/end margins. - if (isHorizontalFlow()) { - child->setMarginLeft( - computeChildMarginValue(child->style()->marginLeft())); - child->setMarginRight( - computeChildMarginValue(child->style()->marginRight())); - } else { - child->setMarginTop(computeChildMarginValue(child->style()->marginTop())); - child->setMarginBottom( - computeChildMarginValue(child->style()->marginBottom())); - } - } -} - -LayoutUnit RenderFlexibleBox::adjustChildSizeForMinAndMax( - RenderBox* child, - LayoutUnit childSize) { - Length max = isHorizontalFlow() ? child->style()->maxWidth() - : child->style()->maxHeight(); - if (max.isSpecifiedOrIntrinsic()) { - LayoutUnit maxExtent = computeMainAxisExtentForChild(child, MaxSize, max); - if (maxExtent != -1 && childSize > maxExtent) - childSize = maxExtent; - } - - Length min = isHorizontalFlow() ? child->style()->minWidth() - : child->style()->minHeight(); - LayoutUnit minExtent = 0; - if (min.isSpecifiedOrIntrinsic()) - minExtent = computeMainAxisExtentForChild(child, MinSize, min); - return std::max(childSize, minExtent); -} - -bool RenderFlexibleBox::computeNextFlexLine( - OrderedFlexItemList& orderedChildren, - LayoutUnit& sumFlexBaseSize, - double& totalFlexGrow, - double& totalWeightedFlexShrink, - LayoutUnit& sumHypotheticalMainSize, - bool& hasInfiniteLineLength, - bool relayoutChildren) { - orderedChildren.clear(); - sumFlexBaseSize = 0; - totalFlexGrow = totalWeightedFlexShrink = 0; - sumHypotheticalMainSize = 0; - - if (!m_orderIterator.currentChild()) - return false; - - LayoutUnit lineBreakLength = mainAxisContentExtent(LayoutUnit::max()); - hasInfiniteLineLength = lineBreakLength == LayoutUnit::max(); - - bool lineHasInFlowItem = false; - - for (RenderBox* child = m_orderIterator.currentChild(); child; - child = m_orderIterator.next()) { - if (child->isOutOfFlowPositioned()) { - orderedChildren.append(child); - continue; - } - - LayoutUnit childMainAxisExtent = preferredMainAxisContentExtentForChild( - child, hasInfiniteLineLength, relayoutChildren); - LayoutUnit childMainAxisMarginBorderPadding = - mainAxisBorderAndPaddingExtentForChild(child) + - (isHorizontalFlow() ? child->marginWidth() : child->marginHeight()); - LayoutUnit childFlexBaseSize = - childMainAxisExtent + childMainAxisMarginBorderPadding; - - LayoutUnit childMinMaxAppliedMainAxisExtent = - adjustChildSizeForMinAndMax(child, childMainAxisExtent); - LayoutUnit childHypotheticalMainSize = - childMinMaxAppliedMainAxisExtent + childMainAxisMarginBorderPadding; - - if (isMultiline() && - sumHypotheticalMainSize + childHypotheticalMainSize > lineBreakLength && - lineHasInFlowItem) - break; - orderedChildren.append(child); - lineHasInFlowItem = true; - sumFlexBaseSize += childFlexBaseSize; - totalFlexGrow += child->style()->flexGrow(); - totalWeightedFlexShrink += - child->style()->flexShrink() * childMainAxisExtent; - sumHypotheticalMainSize += childHypotheticalMainSize; - } - return true; -} - -void RenderFlexibleBox::freezeViolations( - const Vector& violations, - LayoutUnit& availableFreeSpace, - double& totalFlexGrow, - double& totalWeightedFlexShrink, - InflexibleFlexItemSize& inflexibleItems, - bool hasInfiniteLineLength) { - for (size_t i = 0; i < violations.size(); ++i) { - RenderBox* child = violations[i].child; - LayoutUnit childSize = violations[i].childSize; - LayoutUnit preferredChildSize = - preferredMainAxisContentExtentForChild(child, hasInfiniteLineLength); - availableFreeSpace -= childSize - preferredChildSize; - totalFlexGrow -= child->style()->flexGrow(); - totalWeightedFlexShrink -= - child->style()->flexShrink() * preferredChildSize; - inflexibleItems.set(child, childSize); - } -} - -// Returns true if we successfully ran the algorithm and sized the flex items. -bool RenderFlexibleBox::resolveFlexibleLengths( - FlexSign flexSign, - const OrderedFlexItemList& children, - LayoutUnit& availableFreeSpace, - double& totalFlexGrow, - double& totalWeightedFlexShrink, - InflexibleFlexItemSize& inflexibleItems, - Vector& childSizes, - bool hasInfiniteLineLength) { - childSizes.resize(0); - LayoutUnit totalViolation = 0; - LayoutUnit usedFreeSpace = 0; - Vector minViolations; - Vector maxViolations; - for (size_t i = 0; i < children.size(); ++i) { - RenderBox* child = children[i]; - if (child->isOutOfFlowPositioned()) { - childSizes.append(0); - continue; - } - - if (inflexibleItems.contains(child)) - childSizes.append(inflexibleItems.get(child)); - else { - LayoutUnit preferredChildSize = - preferredMainAxisContentExtentForChild(child, hasInfiniteLineLength); - LayoutUnit childSize = preferredChildSize; - double extraSpace = 0; - if (availableFreeSpace > 0 && totalFlexGrow > 0 && - flexSign == PositiveFlexibility && std::isfinite(totalFlexGrow)) - extraSpace = - availableFreeSpace * child->style()->flexGrow() / totalFlexGrow; - else if (availableFreeSpace < 0 && totalWeightedFlexShrink > 0 && - flexSign == NegativeFlexibility && - std::isfinite(totalWeightedFlexShrink)) - extraSpace = availableFreeSpace * child->style()->flexShrink() * - preferredChildSize / totalWeightedFlexShrink; - if (std::isfinite(extraSpace)) - childSize += LayoutUnit::fromFloatRound(extraSpace); - - LayoutUnit adjustedChildSize = - adjustChildSizeForMinAndMax(child, childSize); - childSizes.append(adjustedChildSize); - usedFreeSpace += adjustedChildSize - preferredChildSize; - - LayoutUnit violation = adjustedChildSize - childSize; - if (violation > 0) - minViolations.append(Violation(child, adjustedChildSize)); - else if (violation < 0) - maxViolations.append(Violation(child, adjustedChildSize)); - totalViolation += violation; - } - } - - if (totalViolation) - freezeViolations(totalViolation < 0 ? maxViolations : minViolations, - availableFreeSpace, totalFlexGrow, totalWeightedFlexShrink, - inflexibleItems, hasInfiniteLineLength); - else - availableFreeSpace -= usedFreeSpace; - - return !totalViolation; -} - -static LayoutUnit initialJustifyContentOffset(LayoutUnit availableFreeSpace, - EJustifyContent justifyContent, - unsigned numberOfChildren) { - if (justifyContent == JustifyFlexEnd) - return availableFreeSpace; - if (justifyContent == JustifyCenter) - return availableFreeSpace / 2; - if (justifyContent == JustifySpaceAround) { - if (availableFreeSpace > 0 && numberOfChildren) - return availableFreeSpace / (2 * numberOfChildren); - else - return availableFreeSpace / 2; - } - return 0; -} - -static LayoutUnit justifyContentSpaceBetweenChildren( - LayoutUnit availableFreeSpace, - EJustifyContent justifyContent, - unsigned numberOfChildren) { - if (availableFreeSpace > 0 && numberOfChildren > 1) { - if (justifyContent == JustifySpaceBetween) - return availableFreeSpace / (numberOfChildren - 1); - if (justifyContent == JustifySpaceAround) - return availableFreeSpace / numberOfChildren; - } - return 0; -} - -void RenderFlexibleBox::setLogicalOverrideSize(RenderBox* child, - LayoutUnit childPreferredSize) { - if (hasOrthogonalFlow(child)) - child->setOverrideLogicalContentHeight( - childPreferredSize - child->borderAndPaddingLogicalHeight()); - else - child->setOverrideLogicalContentWidth( - childPreferredSize - child->borderAndPaddingLogicalWidth()); -} - -ItemPosition RenderFlexibleBox::alignmentForChild(RenderBox* child) const { - ItemPosition align = resolveAlignment(style(), child->style()); - - if (align == ItemPositionBaseline && hasOrthogonalFlow(child)) - align = ItemPositionFlexStart; - - if (style()->flexWrap() == FlexWrapReverse) { - if (align == ItemPositionFlexStart) - align = ItemPositionFlexEnd; - else if (align == ItemPositionFlexEnd) - align = ItemPositionFlexStart; - } - - return align; -} - -size_t RenderFlexibleBox::numberOfInFlowPositionedChildren( - const OrderedFlexItemList& children) const { - size_t count = 0; - for (size_t i = 0; i < children.size(); ++i) { - RenderBox* child = children[i]; - if (!child->isOutOfFlowPositioned()) - ++count; - } - return count; -} - -void RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis( - RenderBox* child) { - if (hasAutoMarginsInCrossAxis(child)) { - child->updateLogicalHeight(); - if (isHorizontalFlow()) { - if (child->style()->marginTop().isAuto()) - child->setMarginTop(0); - if (child->style()->marginBottom().isAuto()) - child->setMarginBottom(0); - } else { - if (child->style()->marginLeft().isAuto()) - child->setMarginLeft(0); - if (child->style()->marginRight().isAuto()) - child->setMarginRight(0); - } - } -} - -bool RenderFlexibleBox::needToStretchChildLogicalHeight( - RenderBox* child) const { - if (alignmentForChild(child) != ItemPositionStretch) - return false; - - return isHorizontalFlow() && child->style()->height().isAuto(); -} - -void RenderFlexibleBox::layoutAndPlaceChildren( - LayoutUnit& crossAxisOffset, - const OrderedFlexItemList& children, - const Vector& childSizes, - LayoutUnit availableFreeSpace, - bool relayoutChildren, - Vector& lineContexts, - bool hasInfiniteLineLength) { - ASSERT(childSizes.size() == children.size()); - - size_t numberOfChildrenForJustifyContent = - numberOfInFlowPositionedChildren(children); - LayoutUnit autoMarginOffset = - autoMarginOffsetInMainAxis(children, availableFreeSpace); - LayoutUnit mainAxisOffset = flowAwareBorderStart() + flowAwarePaddingStart(); - mainAxisOffset += - initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), - numberOfChildrenForJustifyContent); - - LayoutUnit totalMainExtent = mainAxisExtent(); - LayoutUnit maxAscent = 0, maxDescent = 0; // Used when align-items: baseline. - LayoutUnit maxChildCrossAxisExtent = 0; - size_t seenInFlowPositionedChildren = 0; - bool shouldFlipMainAxis = !isColumnFlow() && !isLeftToRightFlow(); - for (size_t i = 0; i < children.size(); ++i) { - RenderBox* child = children[i]; - - if (child->isOutOfFlowPositioned()) { - child->containingBlock()->insertPositionedObject(child); - continue; - } - - LayoutUnit childPreferredSize = - childSizes[i] + mainAxisBorderAndPaddingExtentForChild(child); - setLogicalOverrideSize(child, childPreferredSize); - if (childPreferredSize != mainAxisExtentForChild(child)) { - child->setChildNeedsLayout(MarkOnlyThis); - } else { - // To avoid double applying margin changes in - // updateAutoMarginsInCrossAxis, we reset the margins here. - resetAutoMarginsAndLogicalTopInCrossAxis(child); - } - // We may have already forced relayout for orthogonal flowing children in - // preferredMainAxisContentExtentForChild. - bool forceChildRelayout = - relayoutChildren && !childPreferredMainAxisContentExtentRequiresLayout( - child, hasInfiniteLineLength); - updateBlockChildDirtyBitsBeforeLayout(forceChildRelayout, child); - child->layoutIfNeeded(); - - updateAutoMarginsInMainAxis(child, autoMarginOffset); - - LayoutUnit childCrossAxisMarginBoxExtent; - if (alignmentForChild(child) == ItemPositionBaseline && - !hasAutoMarginsInCrossAxis(child)) { - LayoutUnit ascent = marginBoxAscentForChild(child); - LayoutUnit descent = (crossAxisMarginExtentForChild(child) + - crossAxisExtentForChild(child)) - - ascent; - - maxAscent = std::max(maxAscent, ascent); - maxDescent = std::max(maxDescent, descent); - - childCrossAxisMarginBoxExtent = maxAscent + maxDescent; - } else { - childCrossAxisMarginBoxExtent = crossAxisIntrinsicExtentForChild(child) + - crossAxisMarginExtentForChild(child); - } - if (!isColumnFlow()) - setLogicalHeight( - std::max(logicalHeight(), crossAxisOffset + flowAwareBorderAfter() + - flowAwarePaddingAfter() + - childCrossAxisMarginBoxExtent)); - maxChildCrossAxisExtent = - std::max(maxChildCrossAxisExtent, childCrossAxisMarginBoxExtent); - - mainAxisOffset += flowAwareMarginStartForChild(child); - - LayoutUnit childMainExtent = mainAxisExtentForChild(child); - // In an RTL column situation, this will apply the margin-right/margin-end - // on the left. This will be fixed later in flipForRightToLeftColumn. - LayoutPoint childLocation( - shouldFlipMainAxis ? totalMainExtent - mainAxisOffset - childMainExtent - : mainAxisOffset, - crossAxisOffset + flowAwareMarginBeforeForChild(child)); - - // FIXME: Supporting layout deltas. - setFlowAwareLocationForChild(child, childLocation); - mainAxisOffset += childMainExtent + flowAwareMarginEndForChild(child); - - ++seenInFlowPositionedChildren; - if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent) - mainAxisOffset += justifyContentSpaceBetweenChildren( - availableFreeSpace, style()->justifyContent(), - numberOfChildrenForJustifyContent); - } - - if (isColumnFlow()) - setLogicalHeight(mainAxisOffset + flowAwareBorderEnd() + - flowAwarePaddingEnd()); - - if (style()->flexDirection() == FlowColumnReverse) { - // We have to do an extra pass for column-reverse to reposition the flex - // items since the start depends on the height of the flexbox, which we only - // know after we've positioned all the flex items. - updateLogicalHeight(); - layoutColumnReverse(children, crossAxisOffset, availableFreeSpace); - } - - if (m_numberOfInFlowChildrenOnFirstLine == -1) - m_numberOfInFlowChildrenOnFirstLine = seenInFlowPositionedChildren; - lineContexts.append(LineContext(crossAxisOffset, maxChildCrossAxisExtent, - children.size(), maxAscent)); - crossAxisOffset += maxChildCrossAxisExtent; -} - -void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children, - LayoutUnit crossAxisOffset, - LayoutUnit availableFreeSpace) { - // This is similar to the logic in layoutAndPlaceChildren, except we place the - // children starting from the end of the flexbox. We also don't need to layout - // anything since we're just moving the children to a new position. - size_t numberOfChildrenForJustifyContent = - numberOfInFlowPositionedChildren(children); - LayoutUnit mainAxisOffset = - logicalHeight() - flowAwareBorderEnd() - flowAwarePaddingEnd(); - mainAxisOffset -= - initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), - numberOfChildrenForJustifyContent); - - size_t seenInFlowPositionedChildren = 0; - for (size_t i = 0; i < children.size(); ++i) { - RenderBox* child = children[i]; - - if (child->isOutOfFlowPositioned()) - continue; - - mainAxisOffset -= - mainAxisExtentForChild(child) + flowAwareMarginEndForChild(child); - - setFlowAwareLocationForChild( - child, - LayoutPoint(mainAxisOffset, - crossAxisOffset + flowAwareMarginBeforeForChild(child))); - - mainAxisOffset -= flowAwareMarginStartForChild(child); - - ++seenInFlowPositionedChildren; - if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent) - mainAxisOffset -= justifyContentSpaceBetweenChildren( - availableFreeSpace, style()->justifyContent(), - numberOfChildrenForJustifyContent); - } -} - -static LayoutUnit initialAlignContentOffset(LayoutUnit availableFreeSpace, - EAlignContent alignContent, - unsigned numberOfLines) { - if (numberOfLines <= 1) - return 0; - if (alignContent == AlignContentFlexEnd) - return availableFreeSpace; - if (alignContent == AlignContentCenter) - return availableFreeSpace / 2; - if (alignContent == AlignContentSpaceAround) { - if (availableFreeSpace > 0 && numberOfLines) - return availableFreeSpace / (2 * numberOfLines); - if (availableFreeSpace < 0) - return availableFreeSpace / 2; - } - return 0; -} - -static LayoutUnit alignContentSpaceBetweenChildren( - LayoutUnit availableFreeSpace, - EAlignContent alignContent, - unsigned numberOfLines) { - if (availableFreeSpace > 0 && numberOfLines > 1) { - if (alignContent == AlignContentSpaceBetween) - return availableFreeSpace / (numberOfLines - 1); - if (alignContent == AlignContentSpaceAround || - alignContent == AlignContentStretch) - return availableFreeSpace / numberOfLines; - } - return 0; -} - -void RenderFlexibleBox::alignFlexLines(Vector& lineContexts) { - // If we have a single line flexbox or a multiline line flexbox with only one - // flex line, the line height is all the available space. For flex-direction: - // row, this means we need to use the height, so we do this after calling - // updateLogicalHeight. - if (lineContexts.size() == 1) { - lineContexts[0].crossAxisExtent = crossAxisContentExtent(); - return; - } - - if (style()->alignContent() == AlignContentFlexStart) - return; - - LayoutUnit availableCrossAxisSpace = crossAxisContentExtent(); - for (size_t i = 0; i < lineContexts.size(); ++i) - availableCrossAxisSpace -= lineContexts[i].crossAxisExtent; - - RenderBox* child = m_orderIterator.first(); - LayoutUnit lineOffset = initialAlignContentOffset( - availableCrossAxisSpace, style()->alignContent(), lineContexts.size()); - for (unsigned lineNumber = 0; lineNumber < lineContexts.size(); - ++lineNumber) { - lineContexts[lineNumber].crossAxisOffset += lineOffset; - for (size_t childNumber = 0; - childNumber < lineContexts[lineNumber].numberOfChildren; - ++childNumber, child = m_orderIterator.next()) - adjustAlignmentForChild(child, lineOffset); - - if (style()->alignContent() == AlignContentStretch && - availableCrossAxisSpace > 0) - lineContexts[lineNumber].crossAxisExtent += - availableCrossAxisSpace / static_cast(lineContexts.size()); - - lineOffset += alignContentSpaceBetweenChildren( - availableCrossAxisSpace, style()->alignContent(), lineContexts.size()); - } -} - -void RenderFlexibleBox::adjustAlignmentForChild(RenderBox* child, - LayoutUnit delta) { - if (child->isOutOfFlowPositioned()) { - return; - } - - setFlowAwareLocationForChild( - child, flowAwareLocationForChild(child) + LayoutSize(0, delta)); -} - -void RenderFlexibleBox::alignChildren(const Vector& lineContexts) { - // Keep track of the space between the baseline edge and the after edge of the - // box for each line. - Vector minMarginAfterBaselines; - - RenderBox* child = m_orderIterator.first(); - for (size_t lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) { - LayoutUnit minMarginAfterBaseline = LayoutUnit::max(); - LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisExtent; - LayoutUnit maxAscent = lineContexts[lineNumber].maxAscent; - - for (size_t childNumber = 0; - childNumber < lineContexts[lineNumber].numberOfChildren; - ++childNumber, child = m_orderIterator.next()) { - ASSERT(child); - if (child->isOutOfFlowPositioned()) { - if (style()->flexWrap() == FlexWrapReverse) - adjustAlignmentForChild(child, lineCrossAxisExtent); - continue; - } - - if (updateAutoMarginsInCrossAxis( - child, std::max(LayoutUnit(0), availableAlignmentSpaceForChild( - lineCrossAxisExtent, child)))) - continue; - - switch (alignmentForChild(child)) { - case ItemPositionAuto: - ASSERT_NOT_REACHED(); - break; - case ItemPositionStretch: { - applyStretchAlignmentToChild(child, lineCrossAxisExtent); - // Since wrap-reverse flips cross start and cross end, strech children - // should be aligned with the cross end. - if (style()->flexWrap() == FlexWrapReverse) - adjustAlignmentForChild(child, availableAlignmentSpaceForChild( - lineCrossAxisExtent, child)); - break; - } - case ItemPositionFlexStart: - break; - case ItemPositionFlexEnd: - adjustAlignmentForChild(child, availableAlignmentSpaceForChild( - lineCrossAxisExtent, child)); - break; - case ItemPositionCenter: - adjustAlignmentForChild( - child, - availableAlignmentSpaceForChild(lineCrossAxisExtent, child) / 2); - break; - case ItemPositionBaseline: { - // FIXME: If we get here in columns, we want the use the descent, - // except we currently can't get the ascent/descent of orthogonal - // children. https://bugs.webkit.org/show_bug.cgi?id=98076 - LayoutUnit ascent = marginBoxAscentForChild(child); - LayoutUnit startOffset = maxAscent - ascent; - adjustAlignmentForChild(child, startOffset); - - if (style()->flexWrap() == FlexWrapReverse) - minMarginAfterBaseline = std::min( - minMarginAfterBaseline, - availableAlignmentSpaceForChild(lineCrossAxisExtent, child) - - startOffset); - break; - } - case ItemPositionLastBaseline: - case ItemPositionSelfStart: - case ItemPositionSelfEnd: - case ItemPositionStart: - case ItemPositionEnd: - case ItemPositionLeft: - case ItemPositionRight: - // FIXME: File a bug about implementing that. The extended grammar - // is not enabled by default so we shouldn't hit this codepath. - ASSERT_NOT_REACHED(); - break; - } - } - minMarginAfterBaselines.append(minMarginAfterBaseline); - } - - if (style()->flexWrap() != FlexWrapReverse) - return; - - // wrap-reverse flips the cross axis start and end. For baseline alignment, - // this means we need to align the after edge of baseline elements with the - // after edge of the flex line. - child = m_orderIterator.first(); - for (size_t lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) { - LayoutUnit minMarginAfterBaseline = minMarginAfterBaselines[lineNumber]; - for (size_t childNumber = 0; - childNumber < lineContexts[lineNumber].numberOfChildren; - ++childNumber, child = m_orderIterator.next()) { - ASSERT(child); - if (alignmentForChild(child) == ItemPositionBaseline && - !hasAutoMarginsInCrossAxis(child) && minMarginAfterBaseline) - adjustAlignmentForChild(child, minMarginAfterBaseline); - } - } -} - -void RenderFlexibleBox::applyStretchAlignmentToChild( - RenderBox* child, - LayoutUnit lineCrossAxisExtent) { - if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) { - // FIXME: If the child has orthogonal flow, then it already has an override - // height set, so use it. - if (!hasOrthogonalFlow(child)) { - LayoutUnit heightBeforeStretching = - needToStretchChildLogicalHeight(child) - ? constrainedChildIntrinsicContentLogicalHeight(child) - : child->logicalHeight(); - LayoutUnit stretchedLogicalHeight = - heightBeforeStretching + - availableAlignmentSpaceForChildBeforeStretching(lineCrossAxisExtent, - child); - ASSERT(!child->needsLayout()); - LayoutUnit desiredLogicalHeight = child->constrainLogicalHeightByMinMax( - stretchedLogicalHeight, - heightBeforeStretching - child->borderAndPaddingLogicalHeight()); - - // FIXME: Can avoid laying out here in some cases. See - // https://webkit.org/b/87905. - if (desiredLogicalHeight != child->logicalHeight()) { - child->setOverrideLogicalContentHeight( - desiredLogicalHeight - child->borderAndPaddingLogicalHeight()); - child->setLogicalHeight(0); - child->forceChildLayout(); - } - } - } else if (isColumnFlow() && child->style()->logicalWidth().isAuto()) { - // FIXME: If the child doesn't have orthogonal flow, then it already has an - // override width set, so use it. - if (hasOrthogonalFlow(child)) { - LayoutUnit childWidth = std::max( - 0, lineCrossAxisExtent - crossAxisMarginExtentForChild(child)); - childWidth = - child->constrainLogicalWidthByMinMax(childWidth, childWidth, this); - - if (childWidth != child->logicalWidth()) { - child->setOverrideLogicalContentWidth( - childWidth - child->borderAndPaddingLogicalWidth()); - child->forceChildLayout(); - } - } - } -} - -void RenderFlexibleBox::flipForRightToLeftColumn() { - if (style()->isLeftToRightDirection() || !isColumnFlow()) - return; - - LayoutUnit crossExtent = crossAxisExtent(); - for (RenderBox* child = m_orderIterator.first(); child; - child = m_orderIterator.next()) { - if (child->isOutOfFlowPositioned()) - continue; - LayoutPoint location = flowAwareLocationForChild(child); - // For vertical flows, setFlowAwareLocationForChild will transpose x and y, - // so using the y axis for a column cross axis extent is correct. - location.setY(crossExtent - crossAxisExtentForChild(child) - location.y()); - setFlowAwareLocationForChild(child, location); - } -} - -void RenderFlexibleBox::flipForWrapReverse( - const Vector& lineContexts, - LayoutUnit crossAxisStartEdge) { - LayoutUnit contentExtent = crossAxisContentExtent(); - RenderBox* child = m_orderIterator.first(); - for (size_t lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) { - for (size_t childNumber = 0; - childNumber < lineContexts[lineNumber].numberOfChildren; - ++childNumber, child = m_orderIterator.next()) { - ASSERT(child); - LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisExtent; - LayoutUnit originalOffset = - lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; - LayoutUnit newOffset = - contentExtent - originalOffset - lineCrossAxisExtent; - adjustAlignmentForChild(child, newOffset - originalOffset); - } - } -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderFlexibleBox.h b/sky/engine/core/rendering/RenderFlexibleBox.h deleted file mode 100644 index fb4cc2a5e9c01..0000000000000 --- a/sky/engine/core/rendering/RenderFlexibleBox.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERFLEXIBLEBOX_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERFLEXIBLEBOX_H_ - -#include "flutter/sky/engine/core/rendering/OrderIterator.h" -#include "flutter/sky/engine/core/rendering/RenderBlock.h" - -namespace blink { - -class RenderFlexibleBox : public RenderBlock { - public: - RenderFlexibleBox(); - virtual ~RenderFlexibleBox(); - - virtual const char* renderName() const override; - - virtual bool isFlexibleBox() const override final { return true; } - void layout(); - - virtual int baselinePosition( - FontBaseline, - bool firstLine, - LineDirectionMode, - LinePositionMode = PositionOnContainingLine) const override; - virtual int firstLineBoxBaseline( - FontBaselineOrAuto baselineType) const override; - virtual int inlineBlockBaseline(LineDirectionMode) const override; - - virtual void paintChildren(PaintInfo&, - const LayoutPoint&, - Vector& layers) override final; - - bool isHorizontalFlow() const; - - protected: - virtual void computeIntrinsicLogicalWidths( - LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const override; - - virtual void styleDidChange(StyleDifference, - const RenderStyle* oldStyle) override; - virtual void removeChild(RenderObject*) override; - - private: - enum FlexSign { - PositiveFlexibility, - NegativeFlexibility, - }; - - enum PositionedLayoutMode { - FlipForRowReverse, - NoFlipForRowReverse, - }; - - typedef HashMap InflexibleFlexItemSize; - typedef Vector OrderedFlexItemList; - - struct LineContext; - struct Violation; - - // Use an inline capacity of 8, since flexbox containers usually have less - // than 8 children. - typedef Vector ChildFrameRects; - - bool hasOrthogonalFlow(RenderBox* child) const; - bool isColumnFlow() const; - bool isLeftToRightFlow() const; - bool isMultiline() const; - Length flexBasisForChild(RenderBox* child) const; - LayoutUnit crossAxisExtentForChild(RenderBox* child) const; - LayoutUnit crossAxisIntrinsicExtentForChild(RenderBox* child) const; - LayoutUnit childIntrinsicHeight(RenderBox* child) const; - LayoutUnit childIntrinsicWidth(RenderBox* child) const; - LayoutUnit mainAxisExtentForChild(RenderBox* child) const; - LayoutUnit crossAxisExtent() const; - LayoutUnit mainAxisExtent() const; - LayoutUnit crossAxisContentExtent() const; - LayoutUnit mainAxisContentExtent(LayoutUnit contentLogicalHeight); - LayoutUnit computeMainAxisExtentForChild(RenderBox* child, - SizeType, - const Length& size); - LayoutUnit flowAwareBorderStart() const; - LayoutUnit flowAwareBorderEnd() const; - LayoutUnit flowAwareBorderBefore() const; - LayoutUnit flowAwareBorderAfter() const; - LayoutUnit flowAwarePaddingStart() const; - LayoutUnit flowAwarePaddingEnd() const; - LayoutUnit flowAwarePaddingBefore() const; - LayoutUnit flowAwarePaddingAfter() const; - LayoutUnit flowAwareMarginStartForChild(RenderBox* child) const; - LayoutUnit flowAwareMarginEndForChild(RenderBox* child) const; - LayoutUnit flowAwareMarginBeforeForChild(RenderBox* child) const; - LayoutUnit crossAxisMarginExtentForChild(RenderBox* child) const; - LayoutPoint flowAwareLocationForChild(RenderBox* child) const; - // FIXME: Supporting layout deltas. - void setFlowAwareLocationForChild(RenderBox* child, const LayoutPoint&); - void adjustAlignmentForChild(RenderBox* child, LayoutUnit); - ItemPosition alignmentForChild(RenderBox* child) const; - LayoutUnit mainAxisBorderAndPaddingExtentForChild(RenderBox* child) const; - LayoutUnit preferredMainAxisContentExtentForChild( - RenderBox* child, - bool hasInfiniteLineLength, - bool relayoutChildren = false); - bool childPreferredMainAxisContentExtentRequiresLayout( - RenderBox* child, - bool hasInfiniteLineLength) const; - bool needToStretchChildLogicalHeight(RenderBox* child) const; - - void layoutFlexItems(bool relayoutChildren); - LayoutUnit autoMarginOffsetInMainAxis(const OrderedFlexItemList&, - LayoutUnit& availableFreeSpace); - void updateAutoMarginsInMainAxis(RenderBox* child, - LayoutUnit autoMarginOffset); - bool hasAutoMarginsInCrossAxis(RenderBox* child) const; - bool updateAutoMarginsInCrossAxis(RenderBox* child, - LayoutUnit availableAlignmentSpace); - void repositionLogicalHeightDependentFlexItems(Vector&); - LayoutUnit clientLogicalBottomAfterRepositioning(); - void appendChildFrameRects(ChildFrameRects&); - - LayoutUnit availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, - RenderBox*); - LayoutUnit availableAlignmentSpaceForChildBeforeStretching( - LayoutUnit lineCrossAxisExtent, - RenderBox*); - LayoutUnit marginBoxAscentForChild(RenderBox*); - - LayoutUnit computeChildMarginValue(Length margin); - void prepareOrderIteratorAndMargins(); - LayoutUnit adjustChildSizeForMinAndMax(RenderBox*, LayoutUnit childSize); - // The hypothetical main size of an item is the flex base size clamped - // according to its min and max main size properties - bool computeNextFlexLine(OrderedFlexItemList& orderedChildren, - LayoutUnit& sumFlexBaseSize, - double& totalFlexGrow, - double& totalWeightedFlexShrink, - LayoutUnit& sumHypotheticalMainSize, - bool& hasInfiniteLineLength, - bool relayoutChildren); - - bool resolveFlexibleLengths(FlexSign, - const OrderedFlexItemList&, - LayoutUnit& availableFreeSpace, - double& totalFlexGrow, - double& totalWeightedFlexShrink, - InflexibleFlexItemSize&, - Vector& childSizes, - bool hasInfiniteLineLength); - void freezeViolations(const Vector&, - LayoutUnit& availableFreeSpace, - double& totalFlexGrow, - double& totalWeightedFlexShrink, - InflexibleFlexItemSize&, - bool hasInfiniteLineLength); - - void resetAutoMarginsAndLogicalTopInCrossAxis(RenderBox*); - void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize); - size_t numberOfInFlowPositionedChildren(const OrderedFlexItemList&) const; - void layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, - const OrderedFlexItemList&, - const Vector& childSizes, - LayoutUnit availableFreeSpace, - bool relayoutChildren, - Vector&, - bool hasInfiniteLineLength); - void layoutColumnReverse(const OrderedFlexItemList&, - LayoutUnit crossAxisOffset, - LayoutUnit availableFreeSpace); - void alignFlexLines(Vector&); - void alignChildren(const Vector&); - void applyStretchAlignmentToChild(RenderBox*, LayoutUnit lineCrossAxisExtent); - void flipForRightToLeftColumn(); - void flipForWrapReverse(const Vector&, - LayoutUnit crossAxisStartEdge); - - // This is used to cache the preferred size for orthogonal flow children so we - // don't have to relayout to get it - HashMap m_intrinsicSizeAlongMainAxis; - - mutable OrderIterator m_orderIterator; - int m_numberOfInFlowChildrenOnFirstLine; -}; - -DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderFlexibleBox, isFlexibleBox()); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERFLEXIBLEBOX_H_ diff --git a/sky/engine/core/rendering/RenderGeometryMap.cpp b/sky/engine/core/rendering/RenderGeometryMap.cpp deleted file mode 100644 index 2fb15e888e70f..0000000000000 --- a/sky/engine/core/rendering/RenderGeometryMap.cpp +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/RenderGeometryMap.h" - -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/platform/geometry/TransformState.h" -#include "flutter/sky/engine/wtf/TemporaryChange.h" - -namespace blink { - -RenderGeometryMap::RenderGeometryMap(MapCoordinatesFlags flags) - : m_insertionPosition(kNotFound), - m_nonUniformStepsCount(0), - m_transformedStepsCount(0), - m_mapCoordinatesFlags(flags) {} - -RenderGeometryMap::~RenderGeometryMap() {} - -void RenderGeometryMap::mapToContainer(TransformState& transformState, - const RenderBox* container) const { - // If the mapping includes something like columns, we have to go via - // renderers. - if (hasNonUniformStep()) { - m_mapping.last().m_renderer->mapLocalToContainer( - container, transformState, ApplyContainerFlip | m_mapCoordinatesFlags); - transformState.flatten(); - return; - } - -#if ENABLE(ASSERT) - bool foundContainer = - !container || (m_mapping.size() && m_mapping[0].m_renderer == container); -#endif - - for (int i = m_mapping.size() - 1; i >= 0; --i) { - const RenderGeometryMapStep& currentStep = m_mapping[i]; - - // If container is the root RenderView (step 0) we want to apply its fixed - // position offset. - if (i > 0 && currentStep.m_renderer == container) { -#if ENABLE(ASSERT) - foundContainer = true; -#endif - break; - } - - ASSERT(!i == isTopmostRenderView(currentStep.m_renderer)); - - if (!i) { - // A null container indicates mapping through the root RenderView, so - // including its transform (the page scale). - if (!container && currentStep.m_transform) - transformState.applyTransform(*currentStep.m_transform.get()); - } else { - TransformState::TransformAccumulation accumulate = - currentStep.m_accumulatingTransform - ? TransformState::AccumulateTransform - : TransformState::FlattenTransform; - if (currentStep.m_transform) - transformState.applyTransform(*currentStep.m_transform.get(), - accumulate); - else - transformState.move(currentStep.m_offset.width(), - currentStep.m_offset.height(), accumulate); - } - } - - ASSERT(foundContainer); - transformState.flatten(); -} - -FloatPoint RenderGeometryMap::mapToContainer(const FloatPoint& p, - const RenderBox* container) const { - FloatPoint result; - - if (!hasTransformStep() && !hasNonUniformStep() && - (!container || - (m_mapping.size() && container == m_mapping[0].m_renderer))) - result = p + m_accumulatedOffset; - else { - TransformState transformState(TransformState::ApplyTransformDirection, p); - mapToContainer(transformState, container); - result = transformState.lastPlanarPoint(); - } - -#if ENABLE(ASSERT) - if (m_mapping.size() > 0) { - const RenderObject* lastRenderer = m_mapping.last().m_renderer; - const RenderLayer* layer = lastRenderer->enclosingLayer(); - - // Bounds for invisible layers are intentionally not calculated, and are - // therefore not necessarily expected to be correct here. This is ok, - // because they will be recomputed if the layer becomes visible. - if (!layer) { - FloatPoint rendererMappedResult = lastRenderer->localToContainerPoint( - p, container, m_mapCoordinatesFlags); - - ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)); - } - } -#endif - - return result; -} - -#ifndef NDEBUG -// Handy function to call from gdb while debugging mismatched point/rect errors. -void RenderGeometryMap::dumpSteps() const { - fprintf(stderr, "RenderGeometryMap::dumpSteps accumulatedOffset=%d,%d\n", - m_accumulatedOffset.width().toInt(), - m_accumulatedOffset.height().toInt()); - for (int i = m_mapping.size() - 1; i >= 0; --i) { - fprintf(stderr, " [%d] %s: offset=%d,%d", i, - m_mapping[i].m_renderer->debugName().ascii().data(), - m_mapping[i].m_offset.width().toInt(), - m_mapping[i].m_offset.height().toInt()); - if (m_mapping[i].m_hasTransform) - fprintf(stderr, " hasTransform"); - fprintf(stderr, "\n"); - } -} -#endif - -FloatQuad RenderGeometryMap::mapToContainer(const FloatRect& rect, - const RenderBox* container) const { - FloatRect result; - - if (!hasTransformStep() && !hasNonUniformStep() && - (!container || - (m_mapping.size() && container == m_mapping[0].m_renderer))) { - result = rect; - result.move(m_accumulatedOffset); - } else { - TransformState transformState(TransformState::ApplyTransformDirection, - rect.center(), rect); - mapToContainer(transformState, container); - result = transformState.lastPlanarQuad().boundingBox(); - } - -#if ENABLE(ASSERT) - if (m_mapping.size() > 0) { - const RenderObject* lastRenderer = m_mapping.last().m_renderer; - - // Bounds for invisible layers are intentionally not calculated, and are - // therefore not necessarily expected to be correct here. This is ok, - // because they will be recomputed if the layer becomes visible. - FloatRect rendererMappedResult = - lastRenderer - ->localToContainerQuad(rect, container, m_mapCoordinatesFlags) - .boundingBox(); - - // Inspector creates renderers with negative width - // . Taking FloatQuad bounds - // avoids spurious assertions because of that. - ASSERT(enclosingIntRect(rendererMappedResult) == - enclosingIntRect(FloatQuad(result).boundingBox())); - } -#endif - - return result; -} - -void RenderGeometryMap::pushMappingsToAncestor( - const RenderObject* renderer, - const RenderBox* ancestorRenderer) { - // We need to push mappings in reverse order here, so do insertions rather - // than appends. - TemporaryChange positionChange(m_insertionPosition, m_mapping.size()); - do { - renderer = renderer->pushMappingToContainer(ancestorRenderer, *this); - } while (renderer && renderer != ancestorRenderer); - - ASSERT(m_mapping.isEmpty() || isTopmostRenderView(m_mapping[0].m_renderer)); -} - -static bool canMapBetweenRenderers(const RenderObject* renderer, - const RenderObject* ancestor) { - for (const RenderObject* current = renderer;; current = current->parent()) { - if (current->hasTransform()) - return false; - - if (current == ancestor) - break; - } - - return true; -} - -void RenderGeometryMap::pushMappingsToAncestor( - const RenderLayer* layer, - const RenderLayer* ancestorLayer) { - const RenderObject* renderer = layer->renderer(); - - bool crossDocument = false; - ASSERT(!crossDocument || m_mapCoordinatesFlags & TraverseDocumentBoundaries); - - // We have to visit all the renderers to detect flipped blocks. This might - // defeat the gains from mapping via layers. - bool canConvertInLayerTree = - (ancestorLayer && !crossDocument) - ? canMapBetweenRenderers(layer->renderer(), ancestorLayer->renderer()) - : false; - - // fprintf(stderr, "RenderGeometryMap::pushMappingsToAncestor from layer %p - // to layer %p, canConvertInLayerTree=%d\n", layer, ancestorLayer, - // canConvertInLayerTree); - - if (canConvertInLayerTree) { - LayoutPoint layerOffset; - layer->convertToLayerCoords(ancestorLayer, layerOffset); - - // The RenderView must be pushed first. - if (!m_mapping.size()) { - ASSERT(ancestorLayer->renderer()->isRenderView()); - pushMappingsToAncestor(ancestorLayer->renderer(), 0); - } - - TemporaryChange positionChange(m_insertionPosition, - m_mapping.size()); - bool accumulatingTransform = - layer->renderer()->style()->preserves3D() || - ancestorLayer->renderer()->style()->preserves3D(); - push(renderer, toLayoutSize(layerOffset), accumulatingTransform, - /*isNonUniform*/ false, /*hasTransform*/ false); - return; - } - const RenderBox* ancestorRenderer = - ancestorLayer ? ancestorLayer->renderer() : 0; - pushMappingsToAncestor(renderer, ancestorRenderer); -} - -void RenderGeometryMap::push(const RenderObject* renderer, - const LayoutSize& offsetFromContainer, - bool accumulatingTransform, - bool isNonUniform, - bool hasTransform) { - // fprintf(stderr, "RenderGeometryMap::push %p %d,%d isNonUniform=%d\n", - // renderer, offsetFromContainer.width().toInt(), - // offsetFromContainer.height().toInt(), isNonUniform); - - ASSERT(m_insertionPosition != kNotFound); - ASSERT(!renderer->isRenderView() || !m_insertionPosition || - m_mapCoordinatesFlags & TraverseDocumentBoundaries); - - m_mapping.insert(m_insertionPosition, - RenderGeometryMapStep(renderer, accumulatingTransform, - isNonUniform, hasTransform)); - - RenderGeometryMapStep& step = m_mapping[m_insertionPosition]; - step.m_offset = offsetFromContainer; - - stepInserted(step); -} - -void RenderGeometryMap::push(const RenderObject* renderer, - const TransformationMatrix& t, - bool accumulatingTransform, - bool isNonUniform, - bool hasTransform) { - ASSERT(m_insertionPosition != kNotFound); - ASSERT(!renderer->isRenderView() || !m_insertionPosition || - m_mapCoordinatesFlags & TraverseDocumentBoundaries); - - m_mapping.insert(m_insertionPosition, - RenderGeometryMapStep(renderer, accumulatingTransform, - isNonUniform, hasTransform)); - - RenderGeometryMapStep& step = m_mapping[m_insertionPosition]; - - if (!t.isIntegerTranslation()) - step.m_transform = adoptPtr(new TransformationMatrix(t)); - else - step.m_offset = LayoutSize(t.e(), t.f()); - - stepInserted(step); -} - -void RenderGeometryMap::popMappingsToAncestor( - const RenderBox* ancestorRenderer) { - ASSERT(m_mapping.size()); - - while (m_mapping.size() && m_mapping.last().m_renderer != ancestorRenderer) { - stepRemoved(m_mapping.last()); - m_mapping.removeLast(); - } -} - -void RenderGeometryMap::popMappingsToAncestor( - const RenderLayer* ancestorLayer) { - const RenderBox* ancestorRenderer = - ancestorLayer ? ancestorLayer->renderer() : 0; - popMappingsToAncestor(ancestorRenderer); -} - -void RenderGeometryMap::stepInserted(const RenderGeometryMapStep& step) { - m_accumulatedOffset += step.m_offset; - - if (step.m_isNonUniform) - ++m_nonUniformStepsCount; - - if (step.m_transform) - ++m_transformedStepsCount; -} - -void RenderGeometryMap::stepRemoved(const RenderGeometryMapStep& step) { - m_accumulatedOffset -= step.m_offset; - - if (step.m_isNonUniform) { - ASSERT(m_nonUniformStepsCount); - --m_nonUniformStepsCount; - } - - if (step.m_transform) { - ASSERT(m_transformedStepsCount); - --m_transformedStepsCount; - } -} - -#if ENABLE(ASSERT) -bool RenderGeometryMap::isTopmostRenderView( - const RenderObject* renderer) const { - if (!renderer->isRenderView()) - return false; - - // If we're not working with multiple RenderViews, then any view is considered - // "topmost" (to preserve original behavior). - return !(m_mapCoordinatesFlags & TraverseDocumentBoundaries); -} -#endif - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderGeometryMap.h b/sky/engine/core/rendering/RenderGeometryMap.h deleted file mode 100644 index fb57bee1ea4c0..0000000000000 --- a/sky/engine/core/rendering/RenderGeometryMap.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERGEOMETRYMAP_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERGEOMETRYMAP_H_ - -#include "flutter/sky/engine/core/rendering/RenderGeometryMapStep.h" -#include "flutter/sky/engine/core/rendering/RenderObject.h" -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/IntSize.h" -#include "flutter/sky/engine/platform/geometry/LayoutSize.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" - -namespace blink { - -class RenderLayer; -class RenderBox; -class TransformationMatrix; -class TransformState; - -// Can be used while walking the Renderer tree to cache data about offsets and -// transforms. -class RenderGeometryMap { - WTF_MAKE_NONCOPYABLE(RenderGeometryMap); - - public: - RenderGeometryMap(MapCoordinatesFlags = UseTransforms); - ~RenderGeometryMap(); - - MapCoordinatesFlags mapCoordinatesFlags() const { - return m_mapCoordinatesFlags; - } - - FloatRect absoluteRect(const FloatRect& rect) const { - return mapToContainer(rect, 0).boundingBox(); - } - - // Map to a container. Will assert that the container has been pushed onto - // this map. A null container maps through the RenderView (including its scale - // transform, if any). If the container is the RenderView, the scroll offset - // is applied, but not the scale. - FloatPoint mapToContainer(const FloatPoint&, const RenderBox*) const; - FloatQuad mapToContainer(const FloatRect&, const RenderBox*) const; - - // Called by code walking the renderer or layer trees. - void pushMappingsToAncestor(const RenderLayer*, - const RenderLayer* ancestorLayer); - void popMappingsToAncestor(const RenderLayer*); - void pushMappingsToAncestor(const RenderObject*, - const RenderBox* ancestorRenderer); - void popMappingsToAncestor(const RenderBox*); - - // The following methods should only be called by renderers inside a call to - // pushMappingsToAncestor(). - - // Push geometry info between this renderer and some ancestor. The ancestor - // must be its container() or some stacking context between the renderer and - // its container. - void push(const RenderObject*, - const LayoutSize&, - bool accumulatingTransform = false, - bool isNonUniform = false, - bool hasTransform = false); - void push(const RenderObject*, - const TransformationMatrix&, - bool accumulatingTransform = false, - bool isNonUniform = false, - bool hasTransform = false); - - private: - void mapToContainer(TransformState&, const RenderBox* container = 0) const; - - void stepInserted(const RenderGeometryMapStep&); - void stepRemoved(const RenderGeometryMapStep&); - - bool hasNonUniformStep() const { return m_nonUniformStepsCount; } - bool hasTransformStep() const { return m_transformedStepsCount; } - -#ifndef NDEBUG - void dumpSteps() const; -#endif - -#if ENABLE(ASSERT) - bool isTopmostRenderView(const RenderObject* renderer) const; -#endif - - typedef Vector RenderGeometryMapSteps; - - size_t m_insertionPosition; - int m_nonUniformStepsCount; - int m_transformedStepsCount; - RenderGeometryMapSteps m_mapping; - LayoutSize m_accumulatedOffset; - MapCoordinatesFlags m_mapCoordinatesFlags; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERGEOMETRYMAP_H_ diff --git a/sky/engine/core/rendering/RenderGeometryMapStep.h b/sky/engine/core/rendering/RenderGeometryMapStep.h deleted file mode 100644 index 995774c38f9c1..0000000000000 --- a/sky/engine/core/rendering/RenderGeometryMapStep.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERGEOMETRYMAPSTEP_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERGEOMETRYMAPSTEP_H_ - -#include "flutter/sky/engine/platform/geometry/LayoutSize.h" -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" - -namespace blink { - -class RenderObject; - -// Stores data about how to map from one renderer to its container. -struct RenderGeometryMapStep { - RenderGeometryMapStep(const RenderGeometryMapStep& o) - : m_renderer(o.m_renderer), - m_offset(o.m_offset), - m_accumulatingTransform(o.m_accumulatingTransform), - m_isNonUniform(o.m_isNonUniform), - m_hasTransform(o.m_hasTransform) { - ASSERT(!o.m_transform); - } - RenderGeometryMapStep(const RenderObject* renderer, - bool accumulatingTransform, - bool isNonUniform, - bool hasTransform) - : m_renderer(renderer), - m_accumulatingTransform(accumulatingTransform), - m_isNonUniform(isNonUniform), - m_hasTransform(hasTransform) {} - const RenderObject* m_renderer; - LayoutSize m_offset; - OwnPtr m_transform; // Includes offset if non-null. - bool m_accumulatingTransform; - bool m_isNonUniform; // Mapping depends on the input point, e.g. because of - // CSS columns. - bool m_hasTransform; -}; - -} // namespace blink - -WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( - blink::RenderGeometryMapStep); - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERGEOMETRYMAPSTEP_H_ diff --git a/sky/engine/core/rendering/RenderInline.cpp b/sky/engine/core/rendering/RenderInline.cpp deleted file mode 100644 index 5000d49515e59..0000000000000 --- a/sky/engine/core/rendering/RenderInline.cpp +++ /dev/null @@ -1,756 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/RenderInline.h" - -#include "flutter/sky/engine/core/rendering/HitTestResult.h" -#include "flutter/sky/engine/core/rendering/InlineTextBox.h" -#include "flutter/sky/engine/core/rendering/RenderBlock.h" -#include "flutter/sky/engine/core/rendering/RenderGeometryMap.h" -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/core/rendering/style/StyleInheritedData.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/Region.h" -#include "flutter/sky/engine/platform/geometry/TransformState.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" - -namespace blink { - -struct SameSizeAsRenderInline : public RenderBoxModelObject { - virtual ~SameSizeAsRenderInline() {} - RenderObjectChildList m_children; - RenderLineBoxList m_lineBoxes; -}; - -COMPILE_ASSERT(sizeof(RenderInline) == sizeof(SameSizeAsRenderInline), - RenderInline_should_stay_small); - -RenderInline::RenderInline() {} - -void RenderInline::willBeDestroyed() { - // Make sure to destroy anonymous children first while they are still - // connected to the rest of the tree, so that they will properly dirty line - // boxes that they are removed from. Effects that do :before/:after only on - // hover could crash otherwise. - children()->destroyLeftoverChildren(); - - if (!documentBeingDestroyed()) { - if (firstLineBox()) { - // If line boxes are contained inside a root, that means we're an inline. - // In that case, we need to remove all the line boxes so that the parent - // lines aren't pointing to deleted children. If the first line box does - // not have a parent that means they are either already disconnected or - // root lines that can just be destroyed without disconnecting. - if (firstLineBox()->parent()) { - for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) - box->remove(); - } - } else if (parent()) - parent()->dirtyLinesFromChangedChild(this); - } - - m_lineBoxes.deleteLineBoxes(); - - RenderBoxModelObject::willBeDestroyed(); -} - -void RenderInline::styleDidChange(StyleDifference diff, - const RenderStyle* oldStyle) { - RenderBoxModelObject::styleDidChange(diff, oldStyle); - - if (!alwaysCreateLineBoxes()) { - RenderStyle* newStyle = style(); - bool alwaysCreateLineBoxesNew = - hasBoxDecorationBackground() || newStyle->hasPadding() || - newStyle->hasMargin() || newStyle->hasOutline(); - if (oldStyle && alwaysCreateLineBoxesNew) { - dirtyLineBoxes(false); - setNeedsLayout(); - } - setAlwaysCreateLineBoxes(alwaysCreateLineBoxesNew); - } -} - -void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout) { - // Once we have been tainted once, just assume it will happen again. This way - // effects like hover highlighting that change the background color will only - // cause a layout on the first rollover. - if (alwaysCreateLineBoxes()) - return; - - RenderStyle* parentStyle = parent()->style(); - RenderInline* parentRenderInline = - parent()->isRenderInline() ? toRenderInline(parent()) : 0; - bool alwaysCreateLineBoxesNew = - (parentRenderInline && parentRenderInline->alwaysCreateLineBoxes()) || - (parentRenderInline && parentStyle->verticalAlign() != BASELINE) || - style()->verticalAlign() != BASELINE || - style()->textEmphasisMark() != TextEmphasisMarkNone || - !parentStyle->font().fontMetrics().hasIdenticalAscentDescentAndLineGap( - style()->font().fontMetrics()) || - parentStyle->lineHeight() != style()->lineHeight(); - - if (alwaysCreateLineBoxesNew) { - if (!fullLayout) - dirtyLineBoxes(false); - setAlwaysCreateLineBoxes(); - } -} - -LayoutRect RenderInline::localCaretRect(InlineBox* inlineBox, - int, - LayoutUnit* extraWidthToEndOfLine) { - if (firstChild()) { - // This condition is possible if the RenderInline is at an editing boundary, - // i.e. the VisiblePosition is: - // | - // - // FIXME: need to figure out how to make this return a valid rect, note that - // there are no line boxes created in the above case. - return LayoutRect(); - } - - ASSERT_UNUSED(inlineBox, !inlineBox); - - if (extraWidthToEndOfLine) - *extraWidthToEndOfLine = 0; - - LayoutRect caretRect = - localCaretRectForEmptyElement(borderAndPaddingWidth(), 0); - - if (InlineBox* firstBox = firstLineBox()) - caretRect.moveBy(roundedLayoutPoint(firstBox->topLeft())); - - return caretRect; -} - -void RenderInline::addChild(RenderObject* newChild, RenderObject* beforeChild) { - RenderBoxModelObject::addChild(newChild, beforeChild); - newChild->setNeedsLayoutAndPrefWidthsRecalc(); -} - -void RenderInline::paint(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - Vector& layers) { - m_lineBoxes.paint(this, paintInfo, paintOffset, layers); -} - -template -void RenderInline::generateLineBoxRects(GeneratorContext& yield) const { - if (!alwaysCreateLineBoxes()) - generateCulledLineBoxRects(yield, this); - else if (InlineFlowBox* curr = firstLineBox()) { - for (; curr; curr = curr->nextLineBox()) - yield(FloatRect(curr->topLeft(), curr->size())); - } else - yield(FloatRect()); -} - -template -void RenderInline::generateCulledLineBoxRects( - GeneratorContext& yield, - const RenderInline* container) const { - if (!culledInlineFirstLineBox()) { - yield(FloatRect()); - return; - } - - for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { - if (curr->isFloatingOrOutOfFlowPositioned()) - continue; - - // We want to get the margin box in the inline direction, and then use our - // font ascent/descent in the block direction (aligned to the root box's - // baseline). - if (curr->isBox()) { - RenderBox* currBox = toRenderBox(curr); - if (currBox->inlineBoxWrapper()) { - RootInlineBox& rootBox = currBox->inlineBoxWrapper()->root(); - int logicalTop = - rootBox.logicalTop() + (rootBox.renderer() - .style(rootBox.isFirstLineStyle()) - ->font() - .fontMetrics() - .ascent() - - container->style(rootBox.isFirstLineStyle()) - ->font() - .fontMetrics() - .ascent()); - int logicalHeight = container->style(rootBox.isFirstLineStyle()) - ->font() - .fontMetrics() - .height(); - yield(FloatRect( - currBox->inlineBoxWrapper()->x() - currBox->marginLeft(), - logicalTop, (currBox->width() + currBox->marginWidth()).toFloat(), - logicalHeight)); - } - } else if (curr->isRenderInline()) { - // If the child doesn't need line boxes either, then we can recur. - RenderInline* currInline = toRenderInline(curr); - if (!currInline->alwaysCreateLineBoxes()) - currInline->generateCulledLineBoxRects(yield, container); - else { - for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; - childLine = childLine->nextLineBox()) { - RootInlineBox& rootBox = childLine->root(); - int logicalTop = rootBox.logicalTop() + - (rootBox.renderer() - .style(rootBox.isFirstLineStyle()) - ->font() - .fontMetrics() - .ascent() - - container->style(rootBox.isFirstLineStyle()) - ->font() - .fontMetrics() - .ascent()); - int logicalHeight = container->style(rootBox.isFirstLineStyle()) - ->font() - .fontMetrics() - .height(); - yield(FloatRect( - childLine->x() - childLine->marginLogicalLeft(), logicalTop, - childLine->logicalWidth() + childLine->marginLogicalLeft() + - childLine->marginLogicalRight(), - logicalHeight)); - } - } - } else if (curr->isText()) { - RenderText* currText = toRenderText(curr); - for (InlineTextBox* childText = currText->firstTextBox(); childText; - childText = childText->nextTextBox()) { - RootInlineBox& rootBox = childText->root(); - int logicalTop = - rootBox.logicalTop() + (rootBox.renderer() - .style(rootBox.isFirstLineStyle()) - ->font() - .fontMetrics() - .ascent() - - container->style(rootBox.isFirstLineStyle()) - ->font() - .fontMetrics() - .ascent()); - int logicalHeight = container->style(rootBox.isFirstLineStyle()) - ->font() - .fontMetrics() - .height(); - yield(FloatRect(childText->x(), logicalTop, childText->logicalWidth(), - logicalHeight)); - } - } - } -} - -namespace { - -class AbsoluteRectsGeneratorContext { - public: - AbsoluteRectsGeneratorContext(Vector& rects, - const LayoutPoint& accumulatedOffset) - : m_rects(rects), m_accumulatedOffset(accumulatedOffset) {} - - void operator()(const FloatRect& rect) { - IntRect intRect = enclosingIntRect(rect); - intRect.move(m_accumulatedOffset.x(), m_accumulatedOffset.y()); - m_rects.append(intRect); - } - - private: - Vector& m_rects; - const LayoutPoint& m_accumulatedOffset; -}; - -class AbsoluteQuadsGeneratorContext { - public: - AbsoluteQuadsGeneratorContext(const RenderInline* renderer, - Vector& quads) - : m_quads(quads), m_geometryMap() { - m_geometryMap.pushMappingsToAncestor(renderer, 0); - } - - void operator()(const FloatRect& rect) { - m_quads.append(m_geometryMap.absoluteRect(rect)); - } - - private: - Vector& m_quads; - RenderGeometryMap m_geometryMap; -}; - -} // unnamed namespace - -void RenderInline::absoluteQuads(Vector& quads) const { - AbsoluteQuadsGeneratorContext context(this, quads); - generateLineBoxRects(context); -} - -LayoutUnit RenderInline::offsetLeft() const { - LayoutPoint topLeft; - if (InlineBox* firstBox = firstLineBoxIncludingCulling()) - topLeft = flooredLayoutPoint(firstBox->topLeft()); - return adjustedPositionRelativeToOffsetParent(topLeft).x(); -} - -LayoutUnit RenderInline::offsetTop() const { - LayoutPoint topLeft; - if (InlineBox* firstBox = firstLineBoxIncludingCulling()) - topLeft = flooredLayoutPoint(firstBox->topLeft()); - return adjustedPositionRelativeToOffsetParent(topLeft).y(); -} - -static LayoutUnit computeMargin(const RenderInline* renderer, - const Length& margin) { - if (margin.isAuto()) - return 0; - if (margin.isFixed()) - return margin.value(); - if (margin.isPercent()) - return minimumValueForLength( - margin, std::max( - 0, renderer->containingBlock()->availableLogicalWidth())); - return 0; -} - -LayoutUnit RenderInline::marginLeft() const { - return computeMargin(this, style()->marginLeft()); -} - -LayoutUnit RenderInline::marginRight() const { - return computeMargin(this, style()->marginRight()); -} - -LayoutUnit RenderInline::marginTop() const { - return computeMargin(this, style()->marginTop()); -} - -LayoutUnit RenderInline::marginBottom() const { - return computeMargin(this, style()->marginBottom()); -} - -LayoutUnit RenderInline::marginStart(const RenderStyle* otherStyle) const { - return computeMargin( - this, style()->marginStartUsing(otherStyle ? otherStyle : style())); -} - -LayoutUnit RenderInline::marginEnd(const RenderStyle* otherStyle) const { - return computeMargin( - this, style()->marginEndUsing(otherStyle ? otherStyle : style())); -} - -LayoutUnit RenderInline::marginBefore(const RenderStyle* otherStyle) const { - return computeMargin( - this, style()->marginBeforeUsing(otherStyle ? otherStyle : style())); -} - -LayoutUnit RenderInline::marginAfter(const RenderStyle* otherStyle) const { - return computeMargin( - this, style()->marginAfterUsing(otherStyle ? otherStyle : style())); -} - -const char* RenderInline::renderName() const { - return "RenderInline"; -} - -bool RenderInline::nodeAtPoint(const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) { - return m_lineBoxes.hitTest(this, request, result, locationInContainer, - accumulatedOffset); -} - -namespace { - -class HitTestCulledInlinesGeneratorContext { - public: - HitTestCulledInlinesGeneratorContext(Region& region, - const HitTestLocation& location) - : m_intersected(false), m_region(region), m_location(location) {} - void operator()(const FloatRect& rect) { - m_intersected = m_intersected || m_location.intersects(rect); - m_region.unite(enclosingIntRect(rect)); - } - bool intersected() const { return m_intersected; } - - private: - bool m_intersected; - Region& m_region; - const HitTestLocation& m_location; -}; - -} // unnamed namespace - -bool RenderInline::hitTestCulledInline( - const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) { - ASSERT(result.isRectBasedTest() && !alwaysCreateLineBoxes()); - if (!visibleToHitTestRequest(request)) - return false; - - HitTestLocation tmpLocation(locationInContainer, - -toLayoutSize(accumulatedOffset)); - - Region regionResult; - HitTestCulledInlinesGeneratorContext context(regionResult, tmpLocation); - generateCulledLineBoxRects(context, this); - - if (context.intersected()) { - updateHitTestResult(result, tmpLocation.point()); - return regionResult.contains(tmpLocation.boundingBox()); - } - return false; -} - -PositionWithAffinity RenderInline::positionForPoint(const LayoutPoint& point) { - // FIXME(sky): Now that we don't have continuations, can this whole function - // just be the following? return containingBlock()->positionForPoint(point); - - // FIXME: Does not deal with relative positioned inlines (should it?) - RenderBlock* cb = containingBlock(); - if (firstLineBox()) { - // This inline actually has a line box. We must have clicked in the - // border/padding of one of these boxes. We should try to find a result by - // asking our containing block. - return cb->positionForPoint(point); - } - - // Translate the coords from the pre-anonymous block to the post-anonymous - // block. - return RenderBoxModelObject::positionForPoint(point); -} - -namespace { - -class LinesBoundingBoxGeneratorContext { - public: - LinesBoundingBoxGeneratorContext(FloatRect& rect) : m_rect(rect) {} - void operator()(const FloatRect& rect) { m_rect.uniteIfNonZero(rect); } - - private: - FloatRect& m_rect; -}; - -} // unnamed namespace - -IntRect RenderInline::linesBoundingBox() const { - if (!alwaysCreateLineBoxes()) { - ASSERT(!firstLineBox()); - FloatRect floatResult; - LinesBoundingBoxGeneratorContext context(floatResult); - generateCulledLineBoxRects(context, this); - return enclosingIntRect(floatResult); - } - - IntRect result; - - // See , for an unknown reason the linked list here is - // sometimes inconsistent, first is non-zero and last is zero. We have been - // unable to reproduce this at all (and consequently unable to figure ot why - // this is happening). The assert will hopefully catch the problem in debug - // builds and help us someday figure out why. We also put in a redundant - // check of lastLineBox() to avoid the crash for now. - ASSERT(!firstLineBox() == - !lastLineBox()); // Either both are null or both exist. - if (firstLineBox() && lastLineBox()) { - // Return the width of the minimal left side and the maximal right side. - float logicalLeftSide = 0; - float logicalRightSide = 0; - for (InlineFlowBox* curr = firstLineBox(); curr; - curr = curr->nextLineBox()) { - if (curr == firstLineBox() || curr->logicalLeft() < logicalLeftSide) - logicalLeftSide = curr->logicalLeft(); - if (curr == firstLineBox() || curr->logicalRight() > logicalRightSide) - logicalRightSide = curr->logicalRight(); - } - - float x = logicalLeftSide; - float y = firstLineBox()->y(); - float width = logicalRightSide - logicalLeftSide; - float height = lastLineBox()->logicalBottom() - y; - result = enclosingIntRect(FloatRect(x, y, width, height)); - } - - return result; -} - -InlineBox* RenderInline::culledInlineFirstLineBox() const { - for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { - if (curr->isFloatingOrOutOfFlowPositioned()) - continue; - - // We want to get the margin box in the inline direction, and then use our - // font ascent/descent in the block direction (aligned to the root box's - // baseline). - if (curr->isBox()) - return toRenderBox(curr)->inlineBoxWrapper(); - if (curr->isRenderInline()) { - RenderInline* currInline = toRenderInline(curr); - InlineBox* result = currInline->firstLineBoxIncludingCulling(); - if (result) - return result; - } else if (curr->isText()) { - RenderText* currText = toRenderText(curr); - if (currText->firstTextBox()) - return currText->firstTextBox(); - } - } - return 0; -} - -InlineBox* RenderInline::culledInlineLastLineBox() const { - for (RenderObject* curr = lastChild(); curr; curr = curr->previousSibling()) { - if (curr->isFloatingOrOutOfFlowPositioned()) - continue; - - // We want to get the margin box in the inline direction, and then use our - // font ascent/descent in the block direction (aligned to the root box's - // baseline). - if (curr->isBox()) - return toRenderBox(curr)->inlineBoxWrapper(); - if (curr->isRenderInline()) { - RenderInline* currInline = toRenderInline(curr); - InlineBox* result = currInline->lastLineBoxIncludingCulling(); - if (result) - return result; - } else if (curr->isText()) { - RenderText* currText = toRenderText(curr); - if (currText->lastTextBox()) - return currText->lastTextBox(); - } - } - return 0; -} - -LayoutRect RenderInline::culledInlineVisualOverflowBoundingBox() const { - FloatRect floatResult; - LinesBoundingBoxGeneratorContext context(floatResult); - generateCulledLineBoxRects(context, this); - LayoutRect result(enclosingLayoutRect(floatResult)); - for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { - if (curr->isFloatingOrOutOfFlowPositioned()) - continue; - - // For overflow we just have to propagate by hand and recompute it all. - if (curr->isBox()) { - RenderBox* currBox = toRenderBox(curr); - if (!currBox->hasSelfPaintingLayer() && currBox->inlineBoxWrapper()) { - LayoutRect logicalRect = currBox->visualOverflowRect(); - logicalRect.moveBy(currBox->location()); - result.uniteIfNonZero(logicalRect); - } - } else if (curr->isRenderInline()) { - // If the child doesn't need line boxes either, then we can recur. - RenderInline* currInline = toRenderInline(curr); - if (!currInline->alwaysCreateLineBoxes()) - result.uniteIfNonZero( - currInline->culledInlineVisualOverflowBoundingBox()); - else - result.uniteIfNonZero(currInline->linesVisualOverflowBoundingBox()); - } else if (curr->isText()) { - // FIXME; Overflow from text boxes is lost. We will need to cache this - // information in InlineTextBoxes. - RenderText* currText = toRenderText(curr); - result.uniteIfNonZero(currText->linesVisualOverflowBoundingBox()); - } - } - return result; -} - -LayoutRect RenderInline::linesVisualOverflowBoundingBox() const { - if (!alwaysCreateLineBoxes()) - return culledInlineVisualOverflowBoundingBox(); - - if (!firstLineBox() || !lastLineBox()) - return LayoutRect(); - - // Return the width of the minimal left side and the maximal right side. - LayoutUnit logicalLeftSide = LayoutUnit::max(); - LayoutUnit logicalRightSide = LayoutUnit::min(); - for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { - logicalLeftSide = - std::min(logicalLeftSide, curr->logicalLeftVisualOverflow()); - logicalRightSide = - std::max(logicalRightSide, curr->logicalRightVisualOverflow()); - } - - RootInlineBox& firstRootBox = firstLineBox()->root(); - RootInlineBox& lastRootBox = lastLineBox()->root(); - - LayoutUnit logicalTop = - firstLineBox()->logicalTopVisualOverflow(firstRootBox.lineTop()); - LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; - LayoutUnit logicalHeight = - lastLineBox()->logicalBottomVisualOverflow(lastRootBox.lineBottom()) - - logicalTop; - - LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); - return rect; -} - -void RenderInline::mapLocalToContainer( - const RenderBox* paintInvalidationContainer, - TransformState& transformState, - MapCoordinatesFlags mode) const { - bool containerSkipped; - RenderObject* o = container(paintInvalidationContainer, &containerSkipped); - if (!o) - return; - - if (mode & ApplyContainerFlip && o->isBox()) { - mode &= ~ApplyContainerFlip; - } - - LayoutSize containerOffset = - offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint())); - - bool preserve3D = mode & UseTransforms && - (o->style()->preserves3D() || style()->preserves3D()); - if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { - TransformationMatrix t; - getTransformFromContainer(o, containerOffset, t); - transformState.applyTransform(t, preserve3D - ? TransformState::AccumulateTransform - : TransformState::FlattenTransform); - } else - transformState.move(containerOffset.width(), containerOffset.height(), - preserve3D ? TransformState::AccumulateTransform - : TransformState::FlattenTransform); - - if (containerSkipped) { - // There can't be a transform between paintInvalidationContainer and o, - // because transforms create containers, so it should be safe to just - // subtract the delta between the paintInvalidationContainer and o. - LayoutSize containerOffset = - paintInvalidationContainer->offsetFromAncestorContainer(o); - transformState.move(-containerOffset.width(), -containerOffset.height(), - preserve3D ? TransformState::AccumulateTransform - : TransformState::FlattenTransform); - return; - } - - o->mapLocalToContainer(paintInvalidationContainer, transformState, mode); -} - -void RenderInline::updateHitTestResult(HitTestResult& result, - const LayoutPoint& point) {} - -void RenderInline::dirtyLineBoxes(bool fullLayout) { - if (fullLayout) { - m_lineBoxes.deleteLineBoxes(); - return; - } - - if (!alwaysCreateLineBoxes()) { - // We have to grovel into our children in order to dirty the appropriate - // lines. - for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) { - if (curr->isFloatingOrOutOfFlowPositioned()) - continue; - if (curr->isBox() && !curr->needsLayout()) { - RenderBox* currBox = toRenderBox(curr); - if (currBox->inlineBoxWrapper()) - currBox->inlineBoxWrapper()->root().markDirty(); - } else if (!curr->selfNeedsLayout()) { - if (curr->isRenderInline()) { - RenderInline* currInline = toRenderInline(curr); - for (InlineFlowBox* childLine = currInline->firstLineBox(); childLine; - childLine = childLine->nextLineBox()) - childLine->root().markDirty(); - } else if (curr->isText()) { - RenderText* currText = toRenderText(curr); - for (InlineTextBox* childText = currText->firstTextBox(); childText; - childText = childText->nextTextBox()) - childText->root().markDirty(); - } - } - } - } else - m_lineBoxes.dirtyLineBoxes(); -} - -void RenderInline::deleteLineBoxTree() { - m_lineBoxes.deleteLineBoxTree(); -} - -InlineFlowBox* RenderInline::createInlineFlowBox() { - return new InlineFlowBox(*this); -} - -InlineFlowBox* RenderInline::createAndAppendInlineFlowBox() { - setAlwaysCreateLineBoxes(); - InlineFlowBox* flowBox = createInlineFlowBox(); - m_lineBoxes.appendLineBox(flowBox); - return flowBox; -} - -LayoutUnit RenderInline::lineHeight( - bool firstLine, - LineDirectionMode /*direction*/, - LinePositionMode /*linePositionMode*/) const { - return style()->computedLineHeight(); -} - -int RenderInline::baselinePosition(FontBaseline baselineType, - bool firstLine, - LineDirectionMode direction, - LinePositionMode linePositionMode) const { - ASSERT(linePositionMode == PositionOnContainingLine); - const FontMetrics& fontMetrics = style(firstLine)->fontMetrics(); - return fontMetrics.ascent(baselineType) + - (lineHeight(firstLine, direction, linePositionMode) - - fontMetrics.height()) / - 2; -} - -namespace { - -class AbsoluteRectsIgnoringEmptyRectsGeneratorContext - : public AbsoluteRectsGeneratorContext { - public: - AbsoluteRectsIgnoringEmptyRectsGeneratorContext( - Vector& rects, - const LayoutPoint& accumulatedOffset) - : AbsoluteRectsGeneratorContext(rects, accumulatedOffset) {} - - void operator()(const FloatRect& rect) { - if (!rect.isEmpty()) - AbsoluteRectsGeneratorContext::operator()(rect); - } -}; - -} // unnamed namespace - -void RenderInline::addFocusRingRects(Vector& rects, - const LayoutPoint& additionalOffset, - const RenderBox* paintContainer) const { - AbsoluteRectsIgnoringEmptyRectsGeneratorContext context(rects, - additionalOffset); - generateLineBoxRects(context); - - addChildFocusRingRects(rects, additionalOffset, paintContainer); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderInline.h b/sky/engine/core/rendering/RenderInline.h deleted file mode 100644 index deceb0f6f2d8e..0000000000000 --- a/sky/engine/core/rendering/RenderInline.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERINLINE_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERINLINE_H_ - -#include "flutter/sky/engine/core/rendering/InlineFlowBox.h" -#include "flutter/sky/engine/core/rendering/RenderBoxModelObject.h" -#include "flutter/sky/engine/core/rendering/RenderLineBoxList.h" - -namespace blink { - -class RenderInline : public RenderBoxModelObject { - public: - explicit RenderInline(); - - RenderObject* firstChild() const { - ASSERT(children() == virtualChildren()); - return children()->firstChild(); - } - RenderObject* lastChild() const { - ASSERT(children() == virtualChildren()); - return children()->lastChild(); - } - - // If you have a RenderInline, use firstChild or lastChild instead. - void slowFirstChild() const = delete; - void slowLastChild() const = delete; - - virtual void addChild(RenderObject* newChild, - RenderObject* beforeChild = 0) override; - - virtual LayoutUnit marginLeft() const override final; - virtual LayoutUnit marginRight() const override final; - virtual LayoutUnit marginTop() const override final; - virtual LayoutUnit marginBottom() const override final; - virtual LayoutUnit marginBefore( - const RenderStyle* otherStyle = 0) const override final; - virtual LayoutUnit marginAfter( - const RenderStyle* otherStyle = 0) const override final; - virtual LayoutUnit marginStart( - const RenderStyle* otherStyle = 0) const override final; - virtual LayoutUnit marginEnd( - const RenderStyle* otherStyle = 0) const override final; - - virtual void absoluteQuads(Vector&) const override; - - IntRect linesBoundingBox() const; - LayoutRect linesVisualOverflowBoundingBox() const; - - InlineFlowBox* createAndAppendInlineFlowBox(); - - void dirtyLineBoxes(bool fullLayout); - void deleteLineBoxTree(); - - RenderLineBoxList* lineBoxes() { return &m_lineBoxes; } - const RenderLineBoxList* lineBoxes() const { return &m_lineBoxes; } - - InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } - InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } - InlineBox* firstLineBoxIncludingCulling() const { - return alwaysCreateLineBoxes() ? firstLineBox() - : culledInlineFirstLineBox(); - } - InlineBox* lastLineBoxIncludingCulling() const { - return alwaysCreateLineBoxes() ? lastLineBox() : culledInlineLastLineBox(); - } - - virtual void addFocusRingRects( - Vector&, - const LayoutPoint& additionalOffset, - const RenderBox* paintContainer = 0) const override final; - - bool alwaysCreateLineBoxes() const { - return alwaysCreateLineBoxesForRenderInline(); - } - void setAlwaysCreateLineBoxes(bool alwaysCreateLineBoxes = true) { - setAlwaysCreateLineBoxesForRenderInline(alwaysCreateLineBoxes); - } - void updateAlwaysCreateLineBoxes(bool fullLayout); - - virtual LayoutRect localCaretRect( - InlineBox*, - int, - LayoutUnit* extraWidthToEndOfLine) override final; - - bool hitTestCulledInline(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset); - - protected: - virtual void willBeDestroyed() override; - - virtual void styleDidChange(StyleDifference, - const RenderStyle* oldStyle) override; - - private: - virtual RenderObjectChildList* virtualChildren() override final { - return children(); - } - virtual const RenderObjectChildList* virtualChildren() const override final { - return children(); - } - const RenderObjectChildList* children() const { return &m_children; } - RenderObjectChildList* children() { return &m_children; } - - virtual const char* renderName() const override; - - virtual bool isRenderInline() const override final { return true; } - - LayoutRect culledInlineVisualOverflowBoundingBox() const; - InlineBox* culledInlineFirstLineBox() const; - InlineBox* culledInlineLastLineBox() const; - - template - void generateLineBoxRects(GeneratorContext& yield) const; - template - void generateCulledLineBoxRects(GeneratorContext& yield, - const RenderInline* container) const; - - virtual void layout() override final { - ASSERT_NOT_REACHED(); - } // Do nothing for layout() - - virtual void paint(PaintInfo&, - const LayoutPoint&, - Vector& layers) override final; - - virtual bool nodeAtPoint(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) override final; - - virtual LayoutUnit offsetLeft() const override final; - virtual LayoutUnit offsetTop() const override final; - virtual LayoutUnit offsetWidth() const override final { - return linesBoundingBox().width(); - } - virtual LayoutUnit offsetHeight() const override final { - return linesBoundingBox().height(); - } - - virtual void mapLocalToContainer( - const RenderBox* paintInvalidationContainer, - TransformState&, - MapCoordinatesFlags = ApplyContainerFlip) const override; - - virtual PositionWithAffinity positionForPoint( - const LayoutPoint&) override final; - - virtual IntRect borderBoundingBox() const override final { - IntRect boundingBox = linesBoundingBox(); - return IntRect(0, 0, boundingBox.width(), boundingBox.height()); - } - - virtual InlineFlowBox* createInlineFlowBox(); // Subclassed by SVG and Ruby - - virtual void dirtyLinesFromChangedChild(RenderObject* child) override final { - m_lineBoxes.dirtyLinesFromChangedChild(this, child); - } - - virtual LayoutUnit lineHeight( - bool firstLine, - LineDirectionMode, - LinePositionMode = PositionOnContainingLine) const override final; - virtual int baselinePosition( - FontBaseline, - bool firstLine, - LineDirectionMode, - LinePositionMode = PositionOnContainingLine) const override final; - - virtual void updateHitTestResult(HitTestResult&, - const LayoutPoint&) override final; - - RenderObjectChildList m_children; - RenderLineBoxList m_lineBoxes; // All of the line boxes created for this - // inline flow. For example, - // Hello
world.
will have two - // line boxes. -}; - -DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderInline, isRenderInline()); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERINLINE_H_ diff --git a/sky/engine/core/rendering/RenderLayer.cpp b/sky/engine/core/rendering/RenderLayer.cpp deleted file mode 100644 index 1f4c41066eae0..0000000000000 --- a/sky/engine/core/rendering/RenderLayer.cpp +++ /dev/null @@ -1,536 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. - * All rights reserved. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * Other contributors: - * Robert O'Callahan - * David Baron - * Christian Biesinger - * Randall Jesup - * Roland Mainz - * Josh Soref - * Boris Zbarsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#include "flutter/sky/engine/core/rendering/RenderLayer.h" - -#include "flutter/sky/engine/core/rendering/HitTestRequest.h" -#include "flutter/sky/engine/core/rendering/HitTestResult.h" -#include "flutter/sky/engine/core/rendering/HitTestingTransformState.h" -#include "flutter/sky/engine/core/rendering/RenderGeometryMap.h" -#include "flutter/sky/engine/core/rendering/RenderInline.h" -#include "flutter/sky/engine/core/rendering/RenderTreeAsText.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/platform/LengthFunctions.h" -#include "flutter/sky/engine/platform/Partitions.h" -#include "flutter/sky/engine/platform/geometry/FloatPoint3D.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/TransformState.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h" -#include "flutter/sky/engine/platform/transforms/ScaleTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" -#include "flutter/sky/engine/platform/transforms/TranslateTransformOperation.h" -#include "flutter/sky/engine/public/platform/Platform.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/text/CString.h" - -namespace blink { - -RenderLayer::RenderLayer(RenderBox* renderer, LayerType type) - : m_layerType(type), - m_isRootLayer(renderer->isRenderView()), - m_3DTransformedDescendantStatusDirty(true), - m_has3DTransformedDescendant(false), - m_renderer(renderer), - m_parent(0), - m_previous(0), - m_next(0), - m_first(0), - m_last(0), - m_clipper(*renderer) { - m_stackingNode = adoptPtr(new RenderLayerStackingNode(this)); - m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); -} - -RenderLayer::~RenderLayer() {} - -void RenderLayer::updateLayerPositionsAfterLayout() { - m_clipper.clearClipRectsIncludingDescendants(); -} - -void RenderLayer::dirty3DTransformedDescendantStatus() { - RenderLayerStackingNode* stackingNode = - m_stackingNode->ancestorStackingContextNode(); - if (!stackingNode) - return; - - stackingNode->layer()->m_3DTransformedDescendantStatusDirty = true; - - // This propagates up through preserve-3d hierarchies to the enclosing - // flattening layer. Note that preserves3D() creates stacking context, so we - // can just run up the stacking containers. - while (stackingNode && - stackingNode->layer()->renderer()->style()->preserves3D()) { - stackingNode->layer()->m_3DTransformedDescendantStatusDirty = true; - stackingNode = stackingNode->ancestorStackingContextNode(); - } -} - -// Return true if this layer or any preserve-3d descendants have 3d. -bool RenderLayer::update3DTransformedDescendantStatus() { - if (m_3DTransformedDescendantStatusDirty) { - m_has3DTransformedDescendant = false; - - m_stackingNode->updateZOrderLists(); - - // Transformed or preserve-3d descendants can only be in the z-order lists, - // not in the normal flow list, so we only need to check those. - RenderLayerStackingNodeIterator iterator(*m_stackingNode.get(), - PositiveZOrderChildren); - while (RenderLayerStackingNode* node = iterator.next()) - m_has3DTransformedDescendant |= - node->layer()->update3DTransformedDescendantStatus(); - - m_3DTransformedDescendantStatusDirty = false; - } - - // If we live in a 3d hierarchy, then the layer at the root of that hierarchy - // needs the m_has3DTransformedDescendant set. - if (renderer()->style()->preserves3D()) - return renderer()->has3DTransform() || m_has3DTransformedDescendant; - - return renderer()->has3DTransform(); -} - -IntSize RenderLayer::size() const { - // FIXME: Is snapping the size really needed here? - RenderBox* box = renderer(); - return pixelSnappedIntSize(box->size(), box->location()); -} - -LayoutPoint RenderLayer::location() const { - LayoutPoint localPoint; - LayoutSize inlineBoundingBoxOffset; // We don't put this into the RenderLayer - // x/y for inlines, so we need to - // subtract it out when done. - - if (renderer()->isInline() && renderer()->isRenderInline()) { - RenderInline* inlineFlow = toRenderInline(renderer()); - IntRect lineBox = inlineFlow->linesBoundingBox(); - inlineBoundingBoxOffset = toSize(lineBox.location()); - localPoint += inlineBoundingBoxOffset; - } else { - localPoint += renderer()->locationOffset(); - } - - if (!renderer()->isOutOfFlowPositioned() && renderer()->parent()) { - // We must adjust our position by walking up the render tree looking for the - // nearest enclosing object with a layer. - RenderObject* curr = renderer()->parent(); - while (curr && !curr->hasLayer()) { - if (curr->isBox()) { - // Rows and cells share the same coordinate space (that of the section). - // Omit them when computing our xpos/ypos. - localPoint += toRenderBox(curr)->locationOffset(); - } - curr = curr->parent(); - } - } - - // FIXME: We'd really like to just get rid of the concept of a layer rectangle - // and rely on the renderers. - localPoint -= inlineBoundingBoxOffset; - - return localPoint; -} - -RenderLayer* RenderLayer::enclosingPositionedAncestor() const { - RenderLayer* curr = parent(); - while (curr && !curr->isPositionedContainer()) - curr = curr->parent(); - - return curr; -} - -const RenderLayer* RenderLayer::compositingContainer() const { - if (stackingNode()->isNormalFlowOnly()) - return parent(); - if (RenderLayerStackingNode* ancestorStackingNode = - stackingNode()->ancestorStackingContextNode()) - return ancestorStackingNode->layer(); - return 0; -} - -void* RenderLayer::operator new(size_t sz) { - return partitionAlloc(Partitions::getRenderingPartition(), sz); -} - -void RenderLayer::operator delete(void* ptr) { - partitionFree(ptr); -} - -void RenderLayer::addChild(RenderLayer* child, RenderLayer* beforeChild) { - RenderLayer* prevSibling = - beforeChild ? beforeChild->previousSibling() : lastChild(); - if (prevSibling) { - child->setPreviousSibling(prevSibling); - prevSibling->setNextSibling(child); - ASSERT(prevSibling != child); - } else - setFirstChild(child); - - if (beforeChild) { - beforeChild->setPreviousSibling(child); - child->setNextSibling(beforeChild); - ASSERT(beforeChild != child); - } else - setLastChild(child); - - child->m_parent = this; - - if (child->stackingNode()->isNormalFlowOnly()) - m_stackingNode->dirtyNormalFlowList(); - - if (!child->stackingNode()->isNormalFlowOnly() || child->firstChild()) { - // Dirty the z-order list in which we are contained. The - // ancestorStackingContextNode() can be null in the case where we're - // building up generated content layers. This is ok, since the lists will - // start off dirty in that case anyway. - child->stackingNode()->dirtyStackingContextZOrderLists(); - } -} - -RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild) { - if (oldChild->previousSibling()) - oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); - if (oldChild->nextSibling()) - oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()); - - if (m_first == oldChild) - m_first = oldChild->nextSibling(); - if (m_last == oldChild) - m_last = oldChild->previousSibling(); - - if (oldChild->stackingNode()->isNormalFlowOnly()) - m_stackingNode->dirtyNormalFlowList(); - if (!oldChild->stackingNode()->isNormalFlowOnly() || oldChild->firstChild()) { - // Dirty the z-order list in which we are contained. When called via the - // reattachment process in removeOnlyThisLayer, the layer may already be - // disconnected from the main layer tree, so we need to null-check the - // |stackingContext| value. - oldChild->stackingNode()->dirtyStackingContextZOrderLists(); - } - - oldChild->setPreviousSibling(0); - oldChild->setNextSibling(0); - oldChild->m_parent = 0; - - return oldChild; -} - -void RenderLayer::removeOnlyThisLayer() { - if (!m_parent) - return; - - m_clipper.clearClipRectsIncludingDescendants(); - - RenderLayer* nextSib = nextSibling(); - - // Now walk our kids and reattach them to our parent. - RenderLayer* current = m_first; - while (current) { - RenderLayer* next = current->nextSibling(); - removeChild(current); - m_parent->addChild(current, nextSib); - - // FIXME: We should call a specialized version of this function. - current->updateLayerPositionsAfterLayout(); - current = next; - } - - // Remove us from the parent. - m_parent->removeChild(this); - m_renderer->destroyLayer(); -} - -void RenderLayer::insertOnlyThisLayer() { - if (!m_parent && renderer()->parent()) { - // We need to connect ourselves when our renderer() has a parent. - // Find our enclosingLayer and add ourselves. - RenderLayer* parentLayer = renderer()->parent()->enclosingLayer(); - ASSERT(parentLayer); - RenderLayer* beforeChild = - renderer()->parent()->findNextLayer(parentLayer, renderer()); - parentLayer->addChild(this, beforeChild); - } - - // Remove all descendant layers from the hierarchy and add them to the new - // position. - for (RenderObject* curr = renderer()->slowFirstChild(); curr; - curr = curr->nextSibling()) - curr->moveLayers(m_parent, this); - - // Clear out all the clip rects. - m_clipper.clearClipRectsIncludingDescendants(); -} - -// Returns the layer reached on the walk up towards the ancestor. -static inline const RenderLayer* accumulateOffsetTowardsAncestor( - const RenderLayer* layer, - const RenderLayer* ancestorLayer, - LayoutPoint& location) { - ASSERT(ancestorLayer != layer); - - const RenderBox* renderer = layer->renderer(); - EPosition position = renderer->style()->position(); - - RenderLayer* parentLayer; - if (position == AbsolutePosition) { - // Do what enclosingPositionedAncestor() does, but check for ancestorLayer - // along the way. - parentLayer = layer->parent(); - bool foundAncestorFirst = false; - while (parentLayer) { - // RenderFlowThread is a positioned container, child of RenderView, - // positioned at (0,0). This implies that, for out-of-flow positioned - // elements inside a RenderFlowThread, we are bailing out before reaching - // root layer. - if (parentLayer->isPositionedContainer()) - break; - - if (parentLayer == ancestorLayer) { - foundAncestorFirst = true; - break; - } - - parentLayer = parentLayer->parent(); - } - - if (foundAncestorFirst) { - // Found ancestorLayer before the abs. positioned container, so compute - // offset of both relative to enclosingPositionedAncestor and subtract. - RenderLayer* positionedAncestor = - parentLayer->enclosingPositionedAncestor(); - - LayoutPoint thisCoords; - layer->convertToLayerCoords(positionedAncestor, thisCoords); - - LayoutPoint ancestorCoords; - ancestorLayer->convertToLayerCoords(positionedAncestor, ancestorCoords); - - location += (thisCoords - ancestorCoords); - return ancestorLayer; - } - } else - parentLayer = layer->parent(); - - if (!parentLayer) - return 0; - - location += toSize(layer->location()); - return parentLayer; -} - -void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, - LayoutPoint& location) const { - if (ancestorLayer == this) - return; - - const RenderLayer* currLayer = this; - while (currLayer && currLayer != ancestorLayer) - currLayer = - accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, location); -} - -void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, - LayoutRect& rect) const { - LayoutPoint delta; - convertToLayerCoords(ancestorLayer, delta); - rect.move(-delta.x(), -delta.y()); -} - -void RenderLayer::clipToRect(const LayerPaintingInfo& localPaintingInfo, - GraphicsContext* context, - const ClipRect& clipRect, - BorderRadiusClippingRule rule) { - if (clipRect.rect() == localPaintingInfo.paintDirtyRect && - !clipRect.hasRadius()) - return; - context->save(); - context->clip(pixelSnappedIntRect(clipRect.rect())); -} - -void RenderLayer::restoreClip(GraphicsContext* context, - const LayoutRect& paintDirtyRect, - const ClipRect& clipRect) { - if (clipRect.rect() == paintDirtyRect && !clipRect.hasRadius()) - return; - context->restore(); -} - -bool RenderLayer::intersectsDamageRect( - const LayoutRect& layerBounds, - const LayoutRect& damageRect, - const RenderLayer* rootLayer, - const LayoutPoint* offsetFromRoot) const { - // Always examine the canvas and the root. - if (isRootLayer()) - return true; - - // Otherwise we need to compute the bounding box of this single layer and see - // if it intersects the damage rect. - return physicalBoundingBox(rootLayer, offsetFromRoot).intersects(damageRect); -} - -LayoutRect RenderLayer::logicalBoundingBox() const { - // There are three special cases we need to consider. - // (1) Inline Flows. For inline flows we will create a bounding box that - // fully encompasses all of the lines occupied by the inline. In other words, - // if some wraps to three lines, we'll create a bounding box that fully - // encloses the line boxes of all three lines (including overflow on those - // lines). (2) Left/Top Overflow. The width/height of layers already includes - // right/bottom overflow. However, in the case of left/top overflow, we have - // to create a bounding box that will extend to include this overflow. (3) - // Floats. When a layer has overhanging floats that it paints, we need to - // make sure to include these overhanging floats as part of our bounding box. - // We do this because we are the responsible layer for both hit testing and - // painting those floats. - LayoutRect result; - if (renderer()->isInline() && renderer()->isRenderInline()) { - result = toRenderInline(renderer())->linesVisualOverflowBoundingBox(); - } else { - RenderBox* box = renderer(); - result = box->borderBoxRect(); - result.unite(box->visualOverflowRect()); - } - - return result; -} - -LayoutRect RenderLayer::physicalBoundingBox( - const RenderLayer* ancestorLayer, - const LayoutPoint* offsetFromRoot) const { - LayoutPoint delta; - if (offsetFromRoot) - delta = *offsetFromRoot; - else - convertToLayerCoords(ancestorLayer, delta); - - LayoutRect result = logicalBoundingBox(); - result.moveBy(delta); - return result; -} - -static void expandRectForReflectionAndStackingChildren( - const RenderLayer* ancestorLayer, - LayoutRect& result) { - ASSERT(ancestorLayer->stackingNode()->isStackingContext() || - !ancestorLayer->stackingNode()->hasPositiveZOrderList()); - -#if ENABLE(ASSERT) - LayerListMutationDetector mutationChecker( - const_cast(ancestorLayer)->stackingNode()); -#endif - - RenderLayerStackingNodeIterator iterator(*ancestorLayer->stackingNode(), - AllChildren); - while (RenderLayerStackingNode* node = iterator.next()) { - result.unite(node->layer()->boundingBoxForCompositing(ancestorLayer)); - } -} - -LayoutRect -RenderLayer::physicalBoundingBoxIncludingReflectionAndStackingChildren( - const RenderLayer* ancestorLayer, - const LayoutPoint& offsetFromRoot) const { - LayoutPoint origin; - LayoutRect result = physicalBoundingBox(ancestorLayer, &origin); - - const_cast(this)->stackingNode()->updateLayerListsIfNeeded(); - - expandRectForReflectionAndStackingChildren(this, result); - - result.moveBy(offsetFromRoot); - return result; -} - -LayoutRect RenderLayer::boundingBoxForCompositing( - const RenderLayer* ancestorLayer) const { - if (!isSelfPaintingLayer()) - return LayoutRect(); - - if (!ancestorLayer) - ancestorLayer = this; - - LayoutRect localClipRect = clipper().localClipRect(); - if (localClipRect != PaintInfo::infiniteRect()) { - if (renderer()->transform()) - localClipRect = renderer()->transform()->mapRect(localClipRect); - - LayoutPoint delta; - convertToLayerCoords(ancestorLayer, delta); - localClipRect.moveBy(delta); - return localClipRect; - } - - LayoutPoint origin; - LayoutRect result = physicalBoundingBox(ancestorLayer, &origin); - - const_cast(this)->stackingNode()->updateLayerListsIfNeeded(); - - expandRectForReflectionAndStackingChildren(this, result); - - if (renderer()->transform()) - result = renderer()->transform()->mapRect(result); - - LayoutPoint delta; - convertToLayerCoords(ancestorLayer, delta); - result.moveBy(delta); - return result; -} - -bool RenderLayer::shouldBeSelfPaintingLayer() const { - return m_layerType == NormalLayer; -} - -void RenderLayer::styleChanged(StyleDifference diff, - const RenderStyle* oldStyle) { - m_stackingNode->updateIsNormalFlowOnly(); - m_stackingNode->updateStackingNodesAfterStyleChange(oldStyle); - - // Overlay scrollbars can make this layer self-painting so we need - // to recompute the bit once scrollbars have been updated. - m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderLayer.h b/sky/engine/core/rendering/RenderLayer.h deleted file mode 100644 index b5216cf474f10..0000000000000 --- a/sky/engine/core/rendering/RenderLayer.h +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * Other contributors: - * Robert O'Callahan - * David Baron - * Christian Biesinger - * Randall Jesup - * Roland Mainz - * Josh Soref - * Boris Zbarsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ - -#include "flutter/sky/engine/core/rendering/LayerPaintingInfo.h" -#include "flutter/sky/engine/core/rendering/RenderBox.h" -#include "flutter/sky/engine/core/rendering/RenderLayerClipper.h" -#include "flutter/sky/engine/core/rendering/RenderLayerStackingNode.h" -#include "flutter/sky/engine/core/rendering/RenderLayerStackingNodeIterator.h" -#include "flutter/sky/engine/public/platform/WebBlendMode.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" - -namespace blink { - -class RenderStyle; - -enum BorderRadiusClippingRule { - IncludeSelfForBorderRadius, - DoNotIncludeSelfForBorderRadius -}; -enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf }; - -class RenderLayer { - WTF_MAKE_NONCOPYABLE(RenderLayer); - - public: - RenderLayer(RenderBox*, LayerType); - ~RenderLayer(); - - RenderBox* renderer() const { return m_renderer; } - RenderLayer* parent() const { return m_parent; } - RenderLayer* previousSibling() const { return m_previous; } - RenderLayer* nextSibling() const { return m_next; } - RenderLayer* firstChild() const { return m_first; } - RenderLayer* lastChild() const { return m_last; } - - void addChild(RenderLayer* newChild, RenderLayer* beforeChild = 0); - RenderLayer* removeChild(RenderLayer*); - - void removeOnlyThisLayer(); - void insertOnlyThisLayer(); - - void styleChanged(StyleDifference, const RenderStyle* oldStyle); - bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } - void setLayerType(LayerType layerType) { m_layerType = layerType; } - - const RenderLayer* root() const { - const RenderLayer* curr = this; - while (curr->parent()) - curr = curr->parent(); - return curr; - } - - LayoutPoint location() const; - IntSize size() const; - LayoutRect rect() const { return LayoutRect(location(), size()); } - - bool isRootLayer() const { return m_isRootLayer; } - - void updateLayerPositionsAfterLayout(); - - RenderLayerStackingNode* stackingNode() { return m_stackingNode.get(); } - const RenderLayerStackingNode* stackingNode() const { - return m_stackingNode.get(); - } - - // Gets the nearest enclosing positioned ancestor layer (also includes - // the layer and the root layer). - RenderLayer* enclosingPositionedAncestor() const; - - const RenderLayer* compositingContainer() const; - - void convertToLayerCoords(const RenderLayer* ancestorLayer, - LayoutPoint&) const; - void convertToLayerCoords(const RenderLayer* ancestorLayer, - LayoutRect&) const; - - // Pass offsetFromRoot if known. - bool intersectsDamageRect(const LayoutRect& layerBounds, - const LayoutRect& damageRect, - const RenderLayer* rootLayer, - const LayoutPoint* offsetFromRoot = 0) const; - - // Bounding box relative to some ancestor layer. Pass offsetFromRoot if known. - LayoutRect physicalBoundingBox(const RenderLayer* ancestorLayer, - const LayoutPoint* offsetFromRoot = 0) const; - LayoutRect physicalBoundingBoxIncludingReflectionAndStackingChildren( - const RenderLayer* ancestorLayer, - const LayoutPoint& offsetFromRoot) const; - LayoutRect boundingBoxForCompositing( - const RenderLayer* ancestorLayer = 0) const; - - bool has3DTransformedDescendant() const { - return m_has3DTransformedDescendant; - } - // Both updates the status, and returns true if descendants of this have 3d. - bool update3DTransformedDescendantStatus(); - - void* operator new(size_t); - // Only safe to call from RenderBox::destroyLayer() - void operator delete(void*); - - RenderLayerClipper& clipper() { return m_clipper; } - const RenderLayerClipper& clipper() const { return m_clipper; } - - inline bool isPositionedContainer() const { - // FIXME: This is not in sync with containingBlock. - return isRootLayer() || renderer()->isPositioned() || - renderer()->hasTransform(); - } - - void clipToRect(const LayerPaintingInfo&, - GraphicsContext*, - const ClipRect&, - BorderRadiusClippingRule = IncludeSelfForBorderRadius); - void restoreClip(GraphicsContext*, - const LayoutRect& paintDirtyRect, - const ClipRect&); - - // Bounding box in the coordinates of this layer. - LayoutRect logicalBoundingBox() const; - - void setNextSibling(RenderLayer* next) { m_next = next; } - void setPreviousSibling(RenderLayer* prev) { m_previous = prev; } - void setFirstChild(RenderLayer* first) { m_first = first; } - void setLastChild(RenderLayer* last) { m_last = last; } - - bool shouldBeSelfPaintingLayer() const; - - void dirty3DTransformedDescendantStatus(); - - private: - LayerType m_layerType; - - // Self-painting layer is an optimization where we avoid the heavy RenderLayer - // painting machinery for a RenderLayer allocated only to handle the overflow - // clip case. - // FIXME(crbug.com/332791): Self-painting layer should be merged into the - // overflow-only concept. - unsigned m_isSelfPaintingLayer : 1; - - const unsigned m_isRootLayer : 1; - - unsigned m_3DTransformedDescendantStatusDirty : 1; - // Set on a stacking context layer that has 3D descendants anywhere - // in a preserves3D hierarchy. Hint to do 3D-aware hit testing. - unsigned m_has3DTransformedDescendant : 1; - - RenderBox* m_renderer; - - RenderLayer* m_parent; - RenderLayer* m_previous; - RenderLayer* m_next; - RenderLayer* m_first; - RenderLayer* m_last; - - RenderLayerClipper m_clipper; // FIXME: Lazily allocate? - OwnPtr m_stackingNode; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYER_H_ diff --git a/sky/engine/core/rendering/RenderLayerClipper.cpp b/sky/engine/core/rendering/RenderLayerClipper.cpp deleted file mode 100644 index 47f3b34e99d09..0000000000000 --- a/sky/engine/core/rendering/RenderLayerClipper.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. - * All rights reserved. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * Other contributors: - * Robert O'Callahan - * David Baron - * Christian Biesinger - * Randall Jesup - * Roland Mainz - * Josh Soref - * Boris Zbarsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#include "flutter/sky/engine/core/rendering/RenderLayerClipper.h" - -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" - -namespace blink { - -RenderLayerClipper::RenderLayerClipper(RenderBox& renderer) - : m_renderer(renderer) {} - -ClipRects* RenderLayerClipper::clipRectsIfCached( - const ClipRectsContext& context) const { - ASSERT(context.usesCache()); - if (!m_cache) - return 0; - ClipRectsCache::Entry& entry = m_cache->get(context.cacheSlot); - // FIXME: We used to ASSERT that we always got a consistent root layer. - // We should add a test that has an inconsistent root. See - // http://crbug.com/366118 for an example. - if (context.rootLayer != entry.root) - return 0; - -#ifdef CHECK_CACHED_CLIP_RECTS - // This code is useful to check cached clip rects, but is too expensive to - // leave enabled in debug builds by default. - ClipRectsContext tempContext(context); - tempContext.cacheSlot = UncachedClipRects; - ClipRects clipRects; - calculateClipRects(tempContext, clipRects); - ASSERT(clipRects == *entry.clipRects); -#endif - - return entry.clipRects.get(); -} - -ClipRects* RenderLayerClipper::storeClipRectsInCache( - const ClipRectsContext& context, - ClipRects* parentClipRects, - const ClipRects& clipRects) const { - ClipRectsCache::Entry& entry = cache().get(context.cacheSlot); - entry.root = context.rootLayer; - - if (parentClipRects) { - // If our clip rects match the clip rects of our parent, we share storage. - if (clipRects == *parentClipRects) { - entry.clipRects = parentClipRects; - return parentClipRects; - } - } - - entry.clipRects = ClipRects::create(clipRects); - return entry.clipRects.get(); -} - -ClipRects* RenderLayerClipper::getClipRects( - const ClipRectsContext& context) const { - if (ClipRects* result = clipRectsIfCached(context)) - return result; - - // Note that it's important that we call getClipRects on our parent - // before we call calculateClipRects so that calculateClipRects will hit - // the cache. - ClipRects* parentClipRects = 0; - if (context.rootLayer != m_renderer.layer() && m_renderer.layer()->parent()) - parentClipRects = - m_renderer.layer()->parent()->clipper().getClipRects(context); - - ClipRects clipRects; - calculateClipRects(context, clipRects); - return storeClipRectsInCache(context, parentClipRects, clipRects); -} - -void RenderLayerClipper::clearClipRectsIncludingDescendants() { - m_cache = nullptr; - - for (RenderLayer* layer = m_renderer.layer()->firstChild(); layer; - layer = layer->nextSibling()) - layer->clipper().clearClipRectsIncludingDescendants(); -} - -void RenderLayerClipper::clearClipRectsIncludingDescendants( - ClipRectsCacheSlot cacheSlot) { - if (m_cache) - m_cache->clear(cacheSlot); - - for (RenderLayer* layer = m_renderer.layer()->firstChild(); layer; - layer = layer->nextSibling()) - layer->clipper().clearClipRectsIncludingDescendants(cacheSlot); -} - -LayoutRect RenderLayerClipper::localClipRect() const { - // FIXME: border-radius not accounted for. - RenderLayer* clippingRootLayer = clippingRootForPainting(); - LayoutRect layerBounds; - ClipRect backgroundRect; - ClipRectsContext context(clippingRootLayer, PaintingClipRects); - calculateRects(context, PaintInfo::infiniteRect(), layerBounds, - backgroundRect); - - LayoutRect clipRect = backgroundRect.rect(); - if (clipRect == PaintInfo::infiniteRect()) - return clipRect; - - LayoutPoint clippingRootOffset; - m_renderer.layer()->convertToLayerCoords(clippingRootLayer, - clippingRootOffset); - clipRect.moveBy(-clippingRootOffset); - - return clipRect; -} - -void RenderLayerClipper::calculateRects( - const ClipRectsContext& context, - const LayoutRect& paintDirtyRect, - LayoutRect& layerBounds, - ClipRect& backgroundRect, - const LayoutPoint* offsetFromRoot) const { - bool isClippingRoot = m_renderer.layer() == context.rootLayer; - - if (!isClippingRoot && m_renderer.layer()->parent()) { - backgroundRect = backgroundClipRect(context); - backgroundRect.move(roundedIntSize(context.subPixelAccumulation)); - backgroundRect.intersect(paintDirtyRect); - } else { - backgroundRect = paintDirtyRect; - } - - LayoutPoint offset; - if (offsetFromRoot) - offset = *offsetFromRoot; - else - m_renderer.layer()->convertToLayerCoords(context.rootLayer, offset); - layerBounds = LayoutRect(offset, m_renderer.layer()->size()); - - // Update the clip rects that will be passed to child layers. - if (m_renderer.hasOverflowClip()) { - // If we establish an overflow clip at all, then go ahead and make sure our - // background rect is intersected with our layer's bounds including our - // visual overflow, since any visual overflow like box-shadow or - // border-outset is not clipped by overflow:auto/hidden. - if (m_renderer.hasVisualOverflow()) { - // FIXME: Perhaps we should be propagating the borderbox as the clip rect - // for children, even though - // we may need to inflate our clip specifically for shadows or - // outsets. - // FIXME: Does not do the right thing with CSS regions yet, since we don't - // yet factor in the individual region boxes as overflow. - LayoutRect layerBoundsWithVisualOverflow = - m_renderer.visualOverflowRect(); - layerBoundsWithVisualOverflow.moveBy(offset); - backgroundRect.intersect(layerBoundsWithVisualOverflow); - } else { - LayoutRect bounds = m_renderer.borderBoxRect(); - bounds.moveBy(offset); - backgroundRect.intersect(bounds); - } - } - - // CSS clip (different than clipping due to overflow) can clip to any box, - // even if it falls outside of the border box. - if (m_renderer.hasClip()) { - // Clip applies to *us* as well, so go ahead and update the damageRect. - LayoutRect newPosClip = m_renderer.clipRect(offset); - backgroundRect.intersect(newPosClip); - } -} - -void RenderLayerClipper::calculateClipRects(const ClipRectsContext& context, - ClipRects& clipRects) const { - if (!m_renderer.layer()->parent()) { - // The root layer's clip rect is always infinite. - clipRects.reset(PaintInfo::infiniteRect()); - return; - } - - bool isClippingRoot = m_renderer.layer() == context.rootLayer; - - // For transformed layers, the root layer was shifted to be us, so there is no - // need to examine the parent. We want to cache clip rects with us as the - // root. - RenderLayer* parentLayer = !isClippingRoot ? m_renderer.layer()->parent() : 0; - - // Ensure that our parent's clip has been calculated so that we can examine - // the values. - if (parentLayer) { - // FIXME: Why don't we just call getClipRects here? - if (context.usesCache() && - parentLayer->clipper().cachedClipRects(context)) { - clipRects = *parentLayer->clipper().cachedClipRects(context); - } else { - parentLayer->clipper().calculateClipRects(context, clipRects); - } - } else { - clipRects.reset(PaintInfo::infiniteRect()); - } - - if (m_renderer.style()->position() == AbsolutePosition) { - clipRects.setOverflowClipRect(clipRects.posClipRect()); - } - - // This offset cannot use convertToLayerCoords, because sometimes our - // rootLayer may be across some transformed layer boundary, for example, in - // the RenderLayerCompositor overlapMap, where clipRects are needed in view - // space. - LayoutPoint offset = roundedLayoutPoint(m_renderer.localToContainerPoint( - FloatPoint(), context.rootLayer->renderer())); - if (m_renderer.hasOverflowClip()) { - ClipRect newOverflowClip = m_renderer.overflowClipRect(offset); - newOverflowClip.setHasRadius(m_renderer.style()->hasBorderRadius()); - clipRects.setOverflowClipRect( - intersection(newOverflowClip, clipRects.overflowClipRect())); - if (m_renderer.isPositioned()) - clipRects.setPosClipRect( - intersection(newOverflowClip, clipRects.posClipRect())); - } - - if (m_renderer.hasClip()) { - LayoutRect newClip = m_renderer.clipRect(offset); - clipRects.setPosClipRect(intersection(newClip, clipRects.posClipRect())); - clipRects.setOverflowClipRect( - intersection(newClip, clipRects.overflowClipRect())); - } -} - -ClipRect RenderLayerClipper::backgroundClipRect( - const ClipRectsContext& context) const { - ASSERT(m_renderer.layer()->parent()); - - ClipRects parentClipRects; - if (m_renderer.layer() == context.rootLayer) - parentClipRects.reset(PaintInfo::infiniteRect()); - else - m_renderer.layer()->parent()->clipper().getOrCalculateClipRects( - context, parentClipRects); - - if (m_renderer.style()->position() == AbsolutePosition) - return parentClipRects.posClipRect(); - return parentClipRects.overflowClipRect(); -} - -void RenderLayerClipper::getOrCalculateClipRects( - const ClipRectsContext& context, - ClipRects& clipRects) const { - if (context.usesCache()) - clipRects = *getClipRects(context); - else - calculateClipRects(context, clipRects); -} - -RenderLayer* RenderLayerClipper::clippingRootForPainting() const { - const RenderLayer* current = m_renderer.layer(); - while (current) { - if (current->isRootLayer()) - return const_cast(current); - - current = current->compositingContainer(); - ASSERT(current); - if (current->renderer()->transform()) - return const_cast(current); - } - - ASSERT_NOT_REACHED(); - return 0; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderLayerClipper.h b/sky/engine/core/rendering/RenderLayerClipper.h deleted file mode 100644 index f5b4b23e949ce..0000000000000 --- a/sky/engine/core/rendering/RenderLayerClipper.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * Other contributors: - * Robert O'Callahan - * David Baron - * Christian Biesinger - * Randall Jesup - * Roland Mainz - * Josh Soref - * Boris Zbarsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ - -#include "flutter/sky/engine/core/rendering/ClipRectsCache.h" -#include "flutter/sky/engine/core/rendering/RenderBox.h" - -namespace blink { - -class RenderLayer; - -class ClipRectsContext { - public: - ClipRectsContext(const RenderLayer* root, - ClipRectsCacheSlot slot, - const LayoutSize& accumulation = LayoutSize()) - : rootLayer(root), cacheSlot(slot), subPixelAccumulation(accumulation) {} - - bool usesCache() const { return cacheSlot != UncachedClipRects; } - - const RenderLayer* const rootLayer; - - private: - friend class RenderLayerClipper; - - ClipRectsCacheSlot cacheSlot; - LayoutSize subPixelAccumulation; -}; - -class RenderLayerClipper { - WTF_MAKE_NONCOPYABLE(RenderLayerClipper); - - public: - explicit RenderLayerClipper(RenderBox&); - - void clearClipRectsIncludingDescendants(); - void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); - - LayoutRect localClipRect() const; // Returns the background clip rect of the - // layer in the local coordinate space. - - ClipRects* getClipRects(const ClipRectsContext&) const; - - ClipRect backgroundClipRect(const ClipRectsContext&) const; - - // This method figures out our layerBounds in coordinates relative to - // |rootLayer|. It also computes our clip rects for painting/event handling. - void calculateRects(const ClipRectsContext&, - const LayoutRect& paintDirtyRect, - LayoutRect& layerBounds, - ClipRect& backgroundRect, - const LayoutPoint* offsetFromRoot = 0) const; - - private: - void calculateClipRects(const ClipRectsContext&, ClipRects&) const; - - ClipRects* clipRectsIfCached(const ClipRectsContext&) const; - ClipRects* storeClipRectsInCache(const ClipRectsContext&, - ClipRects* parentClipRects, - const ClipRects&) const; - - // cachedClipRects looks buggy: It doesn't check whether context.rootLayer and - // entry.root match. - // FIXME: Move callers to clipRectsIfCached, which does the proper checks. - ClipRects* cachedClipRects(const ClipRectsContext& context) const { - return m_cache ? m_cache->get(context.cacheSlot).clipRects.get() : 0; - } - - void getOrCalculateClipRects(const ClipRectsContext&, ClipRects&) const; - - RenderLayer* clippingRootForPainting() const; - - ClipRectsCache& cache() const { - if (!m_cache) - m_cache = adoptPtr(new ClipRectsCache); - return *m_cache; - } - - // FIXME: Could this be a RenderBox? - RenderBox& m_renderer; - mutable OwnPtr m_cache; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ diff --git a/sky/engine/core/rendering/RenderLayerStackingNode.cpp b/sky/engine/core/rendering/RenderLayerStackingNode.cpp deleted file mode 100644 index f2245fc101fb5..0000000000000 --- a/sky/engine/core/rendering/RenderLayerStackingNode.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. - * All rights reserved. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * Other contributors: - * Robert O'Callahan - * David Baron - * Christian Biesinger - * Randall Jesup - * Roland Mainz - * Josh Soref - * Boris Zbarsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#include "flutter/sky/engine/core/rendering/RenderLayerStackingNode.h" - -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/public/platform/Platform.h" - -namespace blink { - -// FIXME: This should not require RenderLayer. There is currently a cycle where -// in order to determine if we shoulBeNormalFlowOnly() we have to ask the render -// layer about some of its state. -RenderLayerStackingNode::RenderLayerStackingNode(RenderLayer* layer) - : m_layer(layer), - m_normalFlowListDirty(true) -#if ENABLE(ASSERT) - , - m_layerListMutationAllowed(true), - m_stackingParent(0) -#endif -{ - m_isNormalFlowOnly = shouldBeNormalFlowOnly(); - - // Non-stacking contexts should have empty z-order lists. As this is already - // the case, there is no need to dirty / recompute these lists. - m_zOrderListsDirty = isStackingContext(); -} - -RenderLayerStackingNode::~RenderLayerStackingNode() { -#if ENABLE(ASSERT) - if (!renderer()->documentBeingDestroyed()) { - ASSERT(!isInStackingParentZOrderLists()); - ASSERT(!isInStackingParentNormalFlowList()); - - updateStackingParentForZOrderLists(0); - updateStackingParentForNormalFlowList(0); - } -#endif -} - -// Helper for the sorting of layers by z-index. -static inline bool compareZIndex(RenderLayerStackingNode* first, - RenderLayerStackingNode* second) { - return first->zIndex() < second->zIndex(); -} - -void RenderLayerStackingNode::dirtyZOrderLists() { - ASSERT(m_layerListMutationAllowed); - ASSERT(isStackingContext()); - -#if ENABLE(ASSERT) - updateStackingParentForZOrderLists(0); -#endif - - if (m_zOrderList) - m_zOrderList->clear(); - m_zOrderListsDirty = true; -} - -void RenderLayerStackingNode::dirtyStackingContextZOrderLists() { - if (RenderLayerStackingNode* stackingNode = ancestorStackingContextNode()) - stackingNode->dirtyZOrderLists(); -} - -void RenderLayerStackingNode::dirtyNormalFlowList() { - ASSERT(m_layerListMutationAllowed); - -#if ENABLE(ASSERT) - updateStackingParentForNormalFlowList(0); -#endif - - if (m_normalFlowList) - m_normalFlowList->clear(); - m_normalFlowListDirty = true; -} - -void RenderLayerStackingNode::rebuildZOrderLists() { - ASSERT(m_layerListMutationAllowed); - ASSERT(isDirtyStackingContext()); - - for (RenderLayer* child = layer()->firstChild(); child; - child = child->nextSibling()) - child->stackingNode()->collectLayers(m_zOrderList); - - if (m_zOrderList) - std::stable_sort(m_zOrderList->begin(), m_zOrderList->end(), compareZIndex); - -#if ENABLE(ASSERT) - updateStackingParentForZOrderLists(this); -#endif - - m_zOrderListsDirty = false; -} - -void RenderLayerStackingNode::updateNormalFlowList() { - if (!m_normalFlowListDirty) - return; - - ASSERT(m_layerListMutationAllowed); - - for (RenderLayer* child = layer()->firstChild(); child; - child = child->nextSibling()) { - if (child->stackingNode()->isNormalFlowOnly()) { - if (!m_normalFlowList) - m_normalFlowList = adoptPtr(new Vector); - m_normalFlowList->append(child->stackingNode()); - } - } - -#if ENABLE(ASSERT) - updateStackingParentForNormalFlowList(this); -#endif - - m_normalFlowListDirty = false; -} - -void RenderLayerStackingNode::collectLayers( - OwnPtr>& buffer) { - if (!isNormalFlowOnly()) { - if (!buffer) - buffer = adoptPtr(new Vector); - buffer->append(this); - } - - if (!isStackingContext()) { - for (RenderLayer* child = layer()->firstChild(); child; - child = child->nextSibling()) - child->stackingNode()->collectLayers(buffer); - } -} - -#if ENABLE(ASSERT) -bool RenderLayerStackingNode::isInStackingParentZOrderLists() const { - if (!m_stackingParent || m_stackingParent->zOrderListsDirty()) - return false; - - if (m_stackingParent->zOrderList() && - m_stackingParent->zOrderList()->find(this) != kNotFound) - return true; - - return false; -} - -bool RenderLayerStackingNode::isInStackingParentNormalFlowList() const { - if (!m_stackingParent || m_stackingParent->normalFlowListDirty()) - return false; - - return (m_stackingParent->normalFlowList() && - m_stackingParent->normalFlowList()->find(this) != kNotFound); -} - -void RenderLayerStackingNode::updateStackingParentForZOrderLists( - RenderLayerStackingNode* stackingParent) { - if (m_zOrderList) { - for (size_t i = 0; i < m_zOrderList->size(); ++i) - m_zOrderList->at(i)->setStackingParent(stackingParent); - } -} - -void RenderLayerStackingNode::updateStackingParentForNormalFlowList( - RenderLayerStackingNode* stackingParent) { - if (m_normalFlowList) { - for (size_t i = 0; i < m_normalFlowList->size(); ++i) - m_normalFlowList->at(i)->setStackingParent(stackingParent); - } -} -#endif - -void RenderLayerStackingNode::updateLayerListsIfNeeded() { - updateZOrderLists(); - updateNormalFlowList(); -} - -void RenderLayerStackingNode::updateStackingNodesAfterStyleChange( - const RenderStyle* oldStyle) { - bool wasStackingContext = oldStyle ? !oldStyle->hasAutoZIndex() : false; - unsigned oldZIndex = oldStyle ? oldStyle->zIndex() : 0; - - bool isStackingContext = this->isStackingContext(); - if (isStackingContext == wasStackingContext && oldZIndex == zIndex()) - return; - - dirtyStackingContextZOrderLists(); - - if (isStackingContext) - dirtyZOrderLists(); - else - clearZOrderLists(); -} - -// FIXME: Rename shouldBeNormalFlowOnly to something more accurate now that CSS -// 2.1 defines the term "normal flow". -bool RenderLayerStackingNode::shouldBeNormalFlowOnly() const { - return !isStackingContext() && !renderer()->isPositioned(); -} - -void RenderLayerStackingNode::updateIsNormalFlowOnly() { - bool isNormalFlowOnly = shouldBeNormalFlowOnly(); - if (isNormalFlowOnly == this->isNormalFlowOnly()) - return; - - m_isNormalFlowOnly = isNormalFlowOnly; - if (RenderLayer* p = layer()->parent()) - p->stackingNode()->dirtyNormalFlowList(); - dirtyStackingContextZOrderLists(); -} - -RenderLayerStackingNode* RenderLayerStackingNode::ancestorStackingContextNode() - const { - for (RenderLayer* ancestor = layer()->parent(); ancestor; - ancestor = ancestor->parent()) { - RenderLayerStackingNode* stackingNode = ancestor->stackingNode(); - if (stackingNode->isStackingContext()) - return stackingNode; - } - return 0; -} - -RenderBox* RenderLayerStackingNode::renderer() const { - return m_layer->renderer(); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderLayerStackingNode.h b/sky/engine/core/rendering/RenderLayerStackingNode.h deleted file mode 100644 index 97cef98b7f156..0000000000000 --- a/sky/engine/core/rendering/RenderLayerStackingNode.h +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * Other contributors: - * Robert O'Callahan - * David Baron - * Christian Biesinger - * Randall Jesup - * Roland Mainz - * Josh Soref - * Boris Zbarsky - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERLAYERSTACKINGNODE_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERLAYERSTACKINGNODE_H_ - -#include "flutter/sky/engine/core/rendering/RenderBox.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class RenderLayer; -class RenderStyle; - -class RenderLayerStackingNode { - WTF_MAKE_NONCOPYABLE(RenderLayerStackingNode); - - public: - explicit RenderLayerStackingNode(RenderLayer*); - ~RenderLayerStackingNode(); - - unsigned zIndex() const { return renderer()->style()->zIndex(); } - - // A stacking context is a layer that has a non-auto z-index. - bool isStackingContext() const { - return !renderer()->style()->hasAutoZIndex(); - } - - // Update our normal and z-index lists. - void updateLayerListsIfNeeded(); - - bool zOrderListsDirty() const { return m_zOrderListsDirty; } - void dirtyZOrderLists(); - void updateZOrderLists(); - void clearZOrderLists(); - void dirtyStackingContextZOrderLists(); - - bool hasPositiveZOrderList() const { - return zOrderList() && zOrderList()->size(); - } - - // FIXME: should check for dirtiness here? - bool isNormalFlowOnly() const { return m_isNormalFlowOnly; } - void updateIsNormalFlowOnly(); - bool normalFlowListDirty() const { return m_normalFlowListDirty; } - void dirtyNormalFlowList(); - - void updateStackingNodesAfterStyleChange(const RenderStyle* oldStyle); - - RenderLayerStackingNode* ancestorStackingContextNode() const; - - // Gets the enclosing stacking context for this node, possibly the node - // itself, if it is a stacking context. - RenderLayerStackingNode* enclosingStackingContextNode() { - return isStackingContext() ? this : ancestorStackingContextNode(); - } - - RenderLayer* layer() const { return m_layer; } - -#if ENABLE(ASSERT) - bool layerListMutationAllowed() const { return m_layerListMutationAllowed; } - void setLayerListMutationAllowed(bool flag) { - m_layerListMutationAllowed = flag; - } -#endif - - private: - friend class RenderLayerStackingNodeIterator; - friend class RenderLayerStackingNodeReverseIterator; - friend class RenderTreeAsText; - - Vector* zOrderList() const { - ASSERT(!m_zOrderListsDirty); - ASSERT(isStackingContext() || !m_zOrderList); - return m_zOrderList.get(); - } - - Vector* normalFlowList() const { - ASSERT(!m_normalFlowListDirty); - return m_normalFlowList.get(); - } - - void rebuildZOrderLists(); - void collectLayers(OwnPtr>& zOrderList); - -#if ENABLE(ASSERT) - bool isInStackingParentZOrderLists() const; - bool isInStackingParentNormalFlowList() const; - void updateStackingParentForZOrderLists( - RenderLayerStackingNode* stackingParent); - void updateStackingParentForNormalFlowList( - RenderLayerStackingNode* stackingParent); - void setStackingParent(RenderLayerStackingNode* stackingParent) { - m_stackingParent = stackingParent; - } -#endif - - bool shouldBeNormalFlowOnly() const; - - void updateNormalFlowList(); - - bool isDirtyStackingContext() const { - return m_zOrderListsDirty && isStackingContext(); - } - - // FIXME: Investigate changing this to Renderbox. - RenderBox* renderer() const; - - RenderLayer* m_layer; - - // m_zOrderList holds a sorted list of all the descendant nodes within - // that have z-indices of 0 or greater (auto will count as 0). - OwnPtr> m_zOrderList; - - // This list contains child nodes that cannot create stacking contexts. - OwnPtr> m_normalFlowList; - - unsigned m_zOrderListsDirty : 1; - unsigned m_normalFlowListDirty : 1; - unsigned m_isNormalFlowOnly : 1; - -#if ENABLE(ASSERT) - unsigned m_layerListMutationAllowed : 1; - RenderLayerStackingNode* m_stackingParent; -#endif -}; - -inline void RenderLayerStackingNode::clearZOrderLists() { - ASSERT(!isStackingContext()); - -#if ENABLE(ASSERT) - updateStackingParentForZOrderLists(0); -#endif - - m_zOrderList.clear(); -} - -inline void RenderLayerStackingNode::updateZOrderLists() { - if (!m_zOrderListsDirty) - return; - - if (!isStackingContext()) { - clearZOrderLists(); - m_zOrderListsDirty = false; - return; - } - - rebuildZOrderLists(); -} - -#if ENABLE(ASSERT) -class LayerListMutationDetector { - public: - explicit LayerListMutationDetector(RenderLayerStackingNode* stackingNode) - : m_stackingNode(stackingNode), - m_previousMutationAllowedState( - stackingNode->layerListMutationAllowed()) { - m_stackingNode->setLayerListMutationAllowed(false); - } - - ~LayerListMutationDetector() { - m_stackingNode->setLayerListMutationAllowed(m_previousMutationAllowedState); - } - - private: - RenderLayerStackingNode* m_stackingNode; - bool m_previousMutationAllowedState; -}; -#endif - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYERSTACKINGNODE_H_ diff --git a/sky/engine/core/rendering/RenderLayerStackingNodeIterator.cpp b/sky/engine/core/rendering/RenderLayerStackingNodeIterator.cpp deleted file mode 100644 index 269b8edb928f1..0000000000000 --- a/sky/engine/core/rendering/RenderLayerStackingNodeIterator.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/RenderLayerStackingNodeIterator.h" - -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderLayerStackingNode.h" - -namespace blink { - -RenderLayerStackingNode* RenderLayerStackingNodeIterator::next() { - if (m_remainingChildren & NormalFlowChildren) { - Vector* normalFlowList = m_root.normalFlowList(); - if (normalFlowList && m_index < normalFlowList->size()) - return normalFlowList->at(m_index++); - - m_index = 0; - m_remainingChildren &= ~NormalFlowChildren; - } - - if (m_remainingChildren & PositiveZOrderChildren) { - Vector* zOrderList = m_root.zOrderList(); - if (zOrderList && m_index < zOrderList->size()) - return zOrderList->at(m_index++); - - m_index = 0; - m_remainingChildren &= ~PositiveZOrderChildren; - } - - return 0; -} - -RenderLayerStackingNode* RenderLayerStackingNodeReverseIterator::next() { - if (m_remainingChildren & NormalFlowChildren) { - Vector* normalFlowList = m_root.normalFlowList(); - if (normalFlowList && m_index >= 0) - return normalFlowList->at(m_index--); - - m_remainingChildren &= ~NormalFlowChildren; - setIndexToLastItem(); - } - - if (m_remainingChildren & PositiveZOrderChildren) { - Vector* zOrderList = m_root.zOrderList(); - if (zOrderList && m_index >= 0) - return zOrderList->at(m_index--); - - m_remainingChildren &= ~PositiveZOrderChildren; - setIndexToLastItem(); - } - - return 0; -} - -void RenderLayerStackingNodeReverseIterator::setIndexToLastItem() { - if (m_remainingChildren & NormalFlowChildren) { - Vector* normalFlowList = m_root.normalFlowList(); - if (normalFlowList) { - m_index = normalFlowList->size() - 1; - return; - } - - m_remainingChildren &= ~NormalFlowChildren; - } - - if (m_remainingChildren & PositiveZOrderChildren) { - Vector* zOrderList = m_root.zOrderList(); - if (zOrderList) { - m_index = zOrderList->size() - 1; - return; - } - - m_remainingChildren &= ~PositiveZOrderChildren; - } - - // No more list to visit. - ASSERT(!m_remainingChildren); - m_index = -1; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderLayerStackingNodeIterator.h b/sky/engine/core/rendering/RenderLayerStackingNodeIterator.h deleted file mode 100644 index afe7603e34142..0000000000000 --- a/sky/engine/core/rendering/RenderLayerStackingNodeIterator.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERLAYERSTACKINGNODEITERATOR_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERLAYERSTACKINGNODEITERATOR_H_ - -#include "flutter/sky/engine/wtf/Noncopyable.h" - -namespace blink { - -enum ChildrenIteration { - NormalFlowChildren = 1, - PositiveZOrderChildren = 1 << 1, - AllChildren = NormalFlowChildren | PositiveZOrderChildren -}; - -class RenderLayerStackingNode; - -// This iterator walks the RenderLayerStackingNode lists in the following order: -// NormalFlowChildren -> PositiveZOrderChildren. -class RenderLayerStackingNodeIterator { - WTF_MAKE_NONCOPYABLE(RenderLayerStackingNodeIterator); - - public: - RenderLayerStackingNodeIterator(const RenderLayerStackingNode& root, - unsigned whichChildren) - : m_root(root), m_remainingChildren(whichChildren), m_index(0) {} - - RenderLayerStackingNode* next(); - - private: - const RenderLayerStackingNode& m_root; - unsigned m_remainingChildren; - unsigned m_index; -}; - -// This iterator is similar to RenderLayerStackingNodeIterator but it walks the -// lists in reverse order (from the last item to the first one). -class RenderLayerStackingNodeReverseIterator { - WTF_MAKE_NONCOPYABLE(RenderLayerStackingNodeReverseIterator); - - public: - RenderLayerStackingNodeReverseIterator(const RenderLayerStackingNode& root, - unsigned whichChildren) - : m_root(root), m_remainingChildren(whichChildren) { - setIndexToLastItem(); - } - - RenderLayerStackingNode* next(); - - private: - void setIndexToLastItem(); - - const RenderLayerStackingNode& m_root; - unsigned m_remainingChildren; - int m_index; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYERSTACKINGNODEITERATOR_H_ diff --git a/sky/engine/core/rendering/RenderLineBoxList.cpp b/sky/engine/core/rendering/RenderLineBoxList.cpp deleted file mode 100644 index 36642da6c7599..0000000000000 --- a/sky/engine/core/rendering/RenderLineBoxList.cpp +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/RenderLineBoxList.h" - -#include "flutter/sky/engine/core/rendering/HitTestResult.h" -#include "flutter/sky/engine/core/rendering/InlineTextBox.h" -#include "flutter/sky/engine/core/rendering/PaintInfo.h" -#include "flutter/sky/engine/core/rendering/RenderInline.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/core/rendering/RootInlineBox.h" - -namespace blink { - -#if ENABLE(ASSERT) -RenderLineBoxList::~RenderLineBoxList() { - ASSERT(!m_firstLineBox); - ASSERT(!m_lastLineBox); -} -#endif - -void RenderLineBoxList::appendLineBox(InlineFlowBox* box) { - checkConsistency(); - - if (!m_firstLineBox) - m_firstLineBox = m_lastLineBox = box; - else { - m_lastLineBox->setNextLineBox(box); - box->setPreviousLineBox(m_lastLineBox); - m_lastLineBox = box; - } - - checkConsistency(); -} - -void RenderLineBoxList::deleteLineBoxTree() { - InlineFlowBox* line = m_firstLineBox; - InlineFlowBox* nextLine; - while (line) { - nextLine = line->nextLineBox(); - line->deleteLine(); - line = nextLine; - } - m_firstLineBox = m_lastLineBox = 0; -} - -void RenderLineBoxList::extractLineBox(InlineFlowBox* box) { - checkConsistency(); - - m_lastLineBox = box->prevLineBox(); - if (box == m_firstLineBox) - m_firstLineBox = 0; - if (box->prevLineBox()) - box->prevLineBox()->setNextLineBox(0); - box->setPreviousLineBox(0); - for (InlineFlowBox* curr = box; curr; curr = curr->nextLineBox()) - curr->setExtracted(); - - checkConsistency(); -} - -void RenderLineBoxList::attachLineBox(InlineFlowBox* box) { - checkConsistency(); - - if (m_lastLineBox) { - m_lastLineBox->setNextLineBox(box); - box->setPreviousLineBox(m_lastLineBox); - } else - m_firstLineBox = box; - InlineFlowBox* last = box; - for (InlineFlowBox* curr = box; curr; curr = curr->nextLineBox()) { - curr->setExtracted(false); - last = curr; - } - m_lastLineBox = last; - - checkConsistency(); -} - -void RenderLineBoxList::removeLineBox(InlineFlowBox* box) { - checkConsistency(); - - if (box == m_firstLineBox) - m_firstLineBox = box->nextLineBox(); - if (box == m_lastLineBox) - m_lastLineBox = box->prevLineBox(); - if (box->nextLineBox()) - box->nextLineBox()->setPreviousLineBox(box->prevLineBox()); - if (box->prevLineBox()) - box->prevLineBox()->setNextLineBox(box->nextLineBox()); - - checkConsistency(); -} - -void RenderLineBoxList::deleteLineBoxes() { - if (m_firstLineBox) { - InlineFlowBox* next; - for (InlineFlowBox* curr = m_firstLineBox; curr; curr = next) { - next = curr->nextLineBox(); - curr->destroy(); - } - m_firstLineBox = 0; - m_lastLineBox = 0; - } -} - -void RenderLineBoxList::dirtyLineBoxes() { - for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) - curr->dirtyLineBoxes(); -} - -bool RenderLineBoxList::rangeIntersectsRect(RenderBoxModelObject* renderer, - LayoutUnit logicalTop, - LayoutUnit logicalBottom, - const LayoutRect& rect, - const LayoutPoint& offset) const { - LayoutUnit physicalStart = logicalTop; - LayoutUnit physicalEnd = logicalBottom; - LayoutUnit physicalExtent = absoluteValue(physicalEnd - physicalStart); - physicalStart = std::min(physicalStart, physicalEnd); - - physicalStart += offset.y(); - if (physicalStart >= rect.maxY() || - physicalStart + physicalExtent <= rect.y()) - return false; - - return true; -} - -bool RenderLineBoxList::anyLineIntersectsRect(RenderBoxModelObject* renderer, - const LayoutRect& rect, - const LayoutPoint& offset) const { - // We can check the first box and last box and avoid painting/hit testing if - // we don't intersect. This is a quick short-circuit that we can take to - // avoid walking any lines. - // FIXME: This check is flawed in the following extremely obscure way: - // if some line in the middle has a huge overflow, it might actually extend - // below the last line. - RootInlineBox& firstRootBox = firstLineBox()->root(); - RootInlineBox& lastRootBox = lastLineBox()->root(); - LayoutUnit firstLineTop = - firstLineBox()->logicalTopVisualOverflow(firstRootBox.lineTop()); - LayoutUnit lastLineBottom = - lastLineBox()->logicalBottomVisualOverflow(lastRootBox.lineBottom()); - - return rangeIntersectsRect(renderer, firstLineTop, lastLineBottom, rect, - offset); -} - -bool RenderLineBoxList::lineIntersectsDirtyRect( - RenderBoxModelObject* renderer, - InlineFlowBox* box, - const PaintInfo& paintInfo, - const LayoutPoint& offset) const { - RootInlineBox& root = box->root(); - LayoutUnit logicalTop = std::min( - box->logicalTopVisualOverflow(root.lineTop()), root.selectionTop()); - LayoutUnit logicalBottom = - box->logicalBottomVisualOverflow(root.lineBottom()); - - return rangeIntersectsRect(renderer, logicalTop, logicalBottom, - paintInfo.rect, offset); -} - -void RenderLineBoxList::paint(RenderBoxModelObject* renderer, - PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - Vector& layers) const { - ASSERT(renderer->isRenderBlock() || - (renderer->isRenderInline() && renderer->hasLayer())); // The only way - // an inline - // could paint - // like this is - // if it has a - // layer. - - // If we have no lines then we have no work to do. - if (!firstLineBox()) - return; - - if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset)) - return; - - PaintInfo info(paintInfo); - - // See if our root lines intersect with the dirty rect. If so, then we paint - // them. Note that boxes can easily overlap, so we can't make any assumptions - // based off positions of our first line box or our last line box. - for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { - if (lineIntersectsDirtyRect(renderer, curr, info, paintOffset)) { - RootInlineBox& root = curr->root(); - curr->paint(info, paintOffset, root.lineTop(), root.lineBottom(), layers); - } - } -} - -bool RenderLineBoxList::hitTest(RenderBoxModelObject* renderer, - const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) const { - ASSERT(renderer->isRenderBlock() || - (renderer->isRenderInline() && - renderer->hasLayer())); // The only way an inline could hit test like - // this is if it has a layer. - - // If we have no lines then we have no work to do. - if (!firstLineBox()) - return false; - - LayoutPoint point = locationInContainer.point(); - LayoutRect rect = - IntRect(point.x(), point.y() - locationInContainer.topPadding(), 1, - locationInContainer.topPadding() + - locationInContainer.bottomPadding() + 1); - - if (!anyLineIntersectsRect(renderer, rect, accumulatedOffset)) - return false; - - // See if our root lines contain the point. If so, then we hit test - // them further. Note that boxes can easily overlap, so we can't make any - // assumptions based off positions of our first line box or our last line box. - for (InlineFlowBox* curr = lastLineBox(); curr; curr = curr->prevLineBox()) { - RootInlineBox& root = curr->root(); - if (rangeIntersectsRect( - renderer, curr->logicalTopVisualOverflow(root.lineTop()), - curr->logicalBottomVisualOverflow(root.lineBottom()), rect, - accumulatedOffset)) { - bool inside = curr->nodeAtPoint(request, result, locationInContainer, - accumulatedOffset, root.lineTop(), - root.lineBottom()); - if (inside) { - renderer->updateHitTestResult( - result, - locationInContainer.point() - toLayoutSize(accumulatedOffset)); - return true; - } - } - } - - return false; -} - -void RenderLineBoxList::dirtyLinesFromChangedChild(RenderObject* container, - RenderObject* child) { - if (!container->parent() || - (container->isRenderBlock() && - (container->selfNeedsLayout() || !container->isRenderParagraph()))) - return; - - RenderInline* inlineContainer = - container->isRenderInline() ? toRenderInline(container) : 0; - InlineBox* firstBox = inlineContainer - ? inlineContainer->firstLineBoxIncludingCulling() - : firstLineBox(); - - // If we have no first line box, then just bail early. - if (!firstBox) { - // For an empty inline, go ahead and propagate the check up to our parent, - // unless the parent is already dirty. - if (container->isInline() && !container->ancestorLineBoxDirty()) { - container->parent()->dirtyLinesFromChangedChild(container); - container->setAncestorLineBoxDirty(); // Mark the container to avoid - // dirtying the same lines again - // across multiple destroy() calls - // of the same subtree. - } - return; - } - - // Try to figure out which line box we belong in. First try to find a - // previous line box by examining our siblings. If we didn't find a line box, - // then use our parent's first line box. - RootInlineBox* box = 0; - RenderObject* curr = 0; - ListHashSet potentialLineBreakObjects; - potentialLineBreakObjects.add(child); - for (curr = child->previousSibling(); curr; curr = curr->previousSibling()) { - potentialLineBreakObjects.add(curr); - - if (curr->isFloatingOrOutOfFlowPositioned()) - continue; - - if (curr->isReplaced()) { - InlineBox* wrapper = toRenderBox(curr)->inlineBoxWrapper(); - if (wrapper) - box = &wrapper->root(); - } else if (curr->isText()) { - InlineTextBox* textBox = toRenderText(curr)->lastTextBox(); - if (textBox) - box = &textBox->root(); - } else if (curr->isRenderInline()) { - InlineBox* lastSiblingBox = - toRenderInline(curr)->lastLineBoxIncludingCulling(); - if (lastSiblingBox) - box = &lastSiblingBox->root(); - } - - if (box) - break; - } - if (!box) { - if (inlineContainer && !inlineContainer->alwaysCreateLineBoxes()) { - // https://bugs.webkit.org/show_bug.cgi?id=60778 - // We may have just removed a
with no line box that was our first - // child. In this case we won't find a previous sibling, but firstBox can - // be pointing to a following sibling. This isn't good enough, since we - // won't locate the root line box that encloses the removed
. We have - // to just over-invalidate a bit and go up to our parent. - if (!inlineContainer->ancestorLineBoxDirty()) { - inlineContainer->parent()->dirtyLinesFromChangedChild(inlineContainer); - inlineContainer->setAncestorLineBoxDirty(); // Mark the container to - // avoid dirtying the same - // lines again across - // multiple destroy() calls - // of the same subtree. - } - return; - } - box = &firstBox->root(); - } - - // If we found a line box, then dirty it. - if (box) { - RootInlineBox* adjacentBox; - box->markDirty(); - - // dirty the adjacent lines that might be affected - // NOTE: we dirty the previous line because RootInlineBox objects cache - // the address of the first object on the next line after a BR, which we may - // be invalidating here. For more info, see how - // RenderParagraph::layoutChildren calls setLineBreakInfo with the result of - // findNextLineBreak. findNextLineBreak, despite the name, actually returns - // the first RenderObject after the BR. "Typing - // after pasting line does not appear until after window resize." - adjacentBox = box->prevRootBox(); - if (adjacentBox) - adjacentBox->markDirty(); - adjacentBox = box->nextRootBox(); - // If |child| or any of its immediately previous siblings with culled - // lineboxes is the object after a line-break in |box| or the linebox after - // it then that means |child| actually sits on the linebox after |box| (or - // is its line-break object) and so we need to dirty it as well. - if (adjacentBox && - (potentialLineBreakObjects.contains(box->lineBreakObj()) || - potentialLineBreakObjects.contains(adjacentBox->lineBreakObj()) || - isIsolated(container->style()->unicodeBidi()))) - adjacentBox->markDirty(); - } -} - -#if ENABLE(ASSERT) - -void RenderLineBoxList::checkConsistency() const { -#ifdef CHECK_CONSISTENCY - const InlineFlowBox* prev = 0; - for (const InlineFlowBox* child = m_firstLineBox; child != 0; - child = child->nextLineBox()) { - ASSERT(child->prevLineBox() == prev); - prev = child; - } - ASSERT(prev == m_lastLineBox); -#endif -} - -#endif - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderLineBoxList.h b/sky/engine/core/rendering/RenderLineBoxList.h deleted file mode 100644 index adcb39f716406..0000000000000 --- a/sky/engine/core/rendering/RenderLineBoxList.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERLINEBOXLIST_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERLINEBOXLIST_H_ - -#include "flutter/sky/engine/core/rendering/RenderObject.h" - -namespace blink { - -class RenderLineBoxList { - public: - RenderLineBoxList() : m_firstLineBox(0), m_lastLineBox(0) {} - -#if ENABLE(ASSERT) - ~RenderLineBoxList(); -#endif - - InlineFlowBox* firstLineBox() const { return m_firstLineBox; } - InlineFlowBox* lastLineBox() const { return m_lastLineBox; } - - void checkConsistency() const; - - void appendLineBox(InlineFlowBox*); - - void deleteLineBoxTree(); - void deleteLineBoxes(); - - void extractLineBox(InlineFlowBox*); - void attachLineBox(InlineFlowBox*); - void removeLineBox(InlineFlowBox*); - - void dirtyLineBoxes(); - void dirtyLinesFromChangedChild(RenderObject* parent, RenderObject* child); - - void paint(RenderBoxModelObject*, - PaintInfo&, - const LayoutPoint&, - Vector& layers) const; - bool hitTest(RenderBoxModelObject*, - const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) const; - - private: - bool anyLineIntersectsRect(RenderBoxModelObject*, - const LayoutRect&, - const LayoutPoint&) const; - bool lineIntersectsDirtyRect(RenderBoxModelObject*, - InlineFlowBox*, - const PaintInfo&, - const LayoutPoint&) const; - bool rangeIntersectsRect(RenderBoxModelObject*, - LayoutUnit logicalTop, - LayoutUnit logicalBottom, - const LayoutRect&, - const LayoutPoint&) const; - - // For block flows, each box represents the root inline box for a line in the - // paragraph. - // For inline flows, each box represents a portion of that inline. - InlineFlowBox* m_firstLineBox; - InlineFlowBox* m_lastLineBox; -}; - -#if !ENABLE(ASSERT) -inline void RenderLineBoxList::checkConsistency() const {} -#endif - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERLINEBOXLIST_H_ diff --git a/sky/engine/core/rendering/RenderObject.cpp b/sky/engine/core/rendering/RenderObject.cpp deleted file mode 100644 index fc0f32ea74769..0000000000000 --- a/sky/engine/core/rendering/RenderObject.cpp +++ /dev/null @@ -1,1703 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. - * All rights reserved. - * Copyright (C) 2009 Google Inc. All rights reserved. - * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. - * (http://www.torchmobile.com/) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/RenderObject.h" - -#include -#include "flutter/sky/engine/core/rendering/HitTestResult.h" -#include "flutter/sky/engine/core/rendering/RenderFlexibleBox.h" -#include "flutter/sky/engine/core/rendering/RenderGeometryMap.h" -#include "flutter/sky/engine/core/rendering/RenderInline.h" -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderObjectInlines.h" -#include "flutter/sky/engine/core/rendering/RenderParagraph.h" -#include "flutter/sky/engine/core/rendering/RenderText.h" -#include "flutter/sky/engine/core/rendering/RenderTheme.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/core/rendering/style/ShadowList.h" -#include "flutter/sky/engine/platform/Partitions.h" -#include "flutter/sky/engine/platform/geometry/TransformState.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "flutter/sky/engine/wtf/RefCountedLeakCounter.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#ifndef NDEBUG -#include -#endif - -namespace blink { - -#if ENABLE(ASSERT) - -RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope( - RenderObject& renderObject) - : m_renderObject(renderObject), - m_preexistingForbidden(m_renderObject.isSetNeedsLayoutForbidden()) { - m_renderObject.setNeedsLayoutIsForbidden(true); -} - -RenderObject::SetLayoutNeededForbiddenScope::~SetLayoutNeededForbiddenScope() { - m_renderObject.setNeedsLayoutIsForbidden(m_preexistingForbidden); -} -#endif - -struct SameSizeAsRenderObject { - virtual ~SameSizeAsRenderObject() {} // Allocate vtable pointer. - void* pointers[4]; -#if ENABLE(ASSERT) - unsigned m_debugBitfields : 2; -#if ENABLE(OILPAN) - unsigned m_oilpanBitfields : 1; -#endif -#endif - unsigned m_bitfields; -}; - -COMPILE_ASSERT(sizeof(RenderObject) == sizeof(SameSizeAsRenderObject), - RenderObject_should_stay_small); - -bool RenderObject::s_affectsParentBlock = false; - -#if !ENABLE(OILPAN) -void* RenderObject::operator new(size_t sz) { - ASSERT(isMainThread()); - return partitionAlloc(Partitions::getRenderingPartition(), sz); -} - -void RenderObject::operator delete(void* ptr) { - ASSERT(isMainThread()); - partitionFree(ptr); -} -#endif - -DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, - renderObjectCounter, - ("RenderObject")); -unsigned RenderObject::s_instanceCount = 0; - -RenderObject::RenderObject() - : m_style(nullptr), - m_parent(nullptr), - m_previous(nullptr), - m_next(nullptr) -#if ENABLE(ASSERT) - , - m_setNeedsLayoutForbidden(false) -#if ENABLE(OILPAN) - , - m_didCallDestroy(false) -#endif -#endif -{ -#ifndef NDEBUG - renderObjectCounter.increment(); -#endif - ++s_instanceCount; -} - -RenderObject::~RenderObject() { -#if ENABLE(OILPAN) - ASSERT(m_didCallDestroy); -#endif -#ifndef NDEBUG - renderObjectCounter.decrement(); -#endif - --s_instanceCount; -} - -String RenderObject::debugName() const { - return renderName(); -} - -bool RenderObject::isDescendantOf(const RenderObject* obj) const { - for (const RenderObject* r = this; r; r = r->m_parent) { - if (r == obj) - return true; - } - return false; -} - -void RenderObject::addChild(RenderObject* newChild, RenderObject* beforeChild) { - RenderObjectChildList* children = virtualChildren(); - ASSERT(children); - children->insertChildNode(this, newChild, beforeChild); -} - -void RenderObject::removeChild(RenderObject* oldChild) { - RenderObjectChildList* children = virtualChildren(); - ASSERT(children); - if (!children) - return; - - children->removeChildNode(this, oldChild); -} - -RenderObject* RenderObject::nextInPreOrder() const { - if (RenderObject* o = slowFirstChild()) - return o; - - return nextInPreOrderAfterChildren(); -} - -RenderObject* RenderObject::nextInPreOrderAfterChildren() const { - RenderObject* o = nextSibling(); - if (!o) { - o = parent(); - while (o && !o->nextSibling()) - o = o->parent(); - if (o) - o = o->nextSibling(); - } - - return o; -} - -RenderObject* RenderObject::nextInPreOrder( - const RenderObject* stayWithin) const { - if (RenderObject* o = slowFirstChild()) - return o; - - return nextInPreOrderAfterChildren(stayWithin); -} - -RenderObject* RenderObject::nextInPreOrderAfterChildren( - const RenderObject* stayWithin) const { - if (this == stayWithin) - return 0; - - const RenderObject* current = this; - RenderObject* next = current->nextSibling(); - for (; !next; next = current->nextSibling()) { - current = current->parent(); - if (!current || current == stayWithin) - return 0; - } - return next; -} - -RenderObject* RenderObject::previousInPreOrder() const { - if (RenderObject* o = previousSibling()) { - while (RenderObject* lastChild = o->slowLastChild()) - o = lastChild; - return o; - } - - return parent(); -} - -RenderObject* RenderObject::previousInPreOrder( - const RenderObject* stayWithin) const { - if (this == stayWithin) - return 0; - - return previousInPreOrder(); -} - -RenderObject* RenderObject::childAt(unsigned index) const { - RenderObject* child = slowFirstChild(); - for (unsigned i = 0; child && i < index; i++) - child = child->nextSibling(); - return child; -} - -RenderObject* RenderObject::lastLeafChild() const { - RenderObject* r = slowLastChild(); - while (r) { - RenderObject* n = 0; - n = r->slowLastChild(); - if (!n) - break; - r = n; - } - return r; -} - -static void addLayers(RenderObject* obj, - RenderLayer* parentLayer, - RenderObject*& newObject, - RenderLayer*& beforeChild) { - if (obj->hasLayer()) { - if (!beforeChild && newObject) { - // We need to figure out the layer that follows newObject. We only do - // this the first time we find a child layer, and then we update the - // pointer values for newObject and beforeChild used by everyone else. - beforeChild = newObject->parent()->findNextLayer(parentLayer, newObject); - newObject = 0; - } - parentLayer->addChild(toRenderBox(obj)->layer(), beforeChild); - return; - } - - for (RenderObject* curr = obj->slowFirstChild(); curr; - curr = curr->nextSibling()) - addLayers(curr, parentLayer, newObject, beforeChild); -} - -void RenderObject::addLayers(RenderLayer* parentLayer) { - if (!parentLayer) - return; - - RenderObject* object = this; - RenderLayer* beforeChild = 0; - blink::addLayers(this, parentLayer, object, beforeChild); -} - -void RenderObject::removeLayers(RenderLayer* parentLayer) { - if (!parentLayer) - return; - - if (hasLayer()) { - parentLayer->removeChild(toRenderBox(this)->layer()); - return; - } - - for (RenderObject* curr = slowFirstChild(); curr; curr = curr->nextSibling()) - curr->removeLayers(parentLayer); -} - -void RenderObject::moveLayers(RenderLayer* oldParent, RenderLayer* newParent) { - if (!newParent) - return; - - if (hasLayer()) { - RenderLayer* layer = toRenderBox(this)->layer(); - ASSERT(oldParent == layer->parent()); - if (oldParent) - oldParent->removeChild(layer); - newParent->addChild(layer); - return; - } - - for (RenderObject* curr = slowFirstChild(); curr; curr = curr->nextSibling()) - curr->moveLayers(oldParent, newParent); -} - -RenderLayer* RenderObject::findNextLayer(RenderLayer* parentLayer, - RenderObject* startPoint, - bool checkParent) { - // Error check the parent layer passed in. If it's null, we can't find - // anything. - if (!parentLayer) - return 0; - - // Step 1: If our layer is a child of the desired parent, then return our - // layer. - RenderLayer* ourLayer = hasLayer() ? toRenderBox(this)->layer() : 0; - if (ourLayer && ourLayer->parent() == parentLayer) - return ourLayer; - - // Step 2: If we don't have a layer, or our layer is the desired parent, then - // descend into our siblings trying to find the next layer whose parent is the - // desired parent. - if (!ourLayer || ourLayer == parentLayer) { - for (RenderObject* curr = startPoint ? startPoint->nextSibling() - : slowFirstChild(); - curr; curr = curr->nextSibling()) { - RenderLayer* nextLayer = curr->findNextLayer(parentLayer, 0, false); - if (nextLayer) - return nextLayer; - } - } - - // Step 3: If our layer is the desired parent layer, then we're finished. We - // didn't find anything. - if (parentLayer == ourLayer) - return 0; - - // Step 4: If |checkParent| is set, climb up to our parent and check its - // siblings that follow us to see if we can locate a layer. - if (checkParent && parent()) - return parent()->findNextLayer(parentLayer, this, true); - - return 0; -} - -RenderLayer* RenderObject::enclosingLayer() const { - for (const RenderObject* current = this; current; - current = current->parent()) { - if (current->hasLayer()) - return toRenderBox(current)->layer(); - } - // FIXME: We should remove the one caller that triggers this case and make - // this function return a reference. - ASSERT(!m_parent && !isRenderView()); - return 0; -} - -RenderBox* RenderObject::enclosingBox() const { - RenderObject* curr = const_cast(this); - while (curr) { - if (curr->isBox()) - return toRenderBox(curr); - curr = curr->parent(); - } - - ASSERT_NOT_REACHED(); - return 0; -} - -RenderBoxModelObject* RenderObject::enclosingBoxModelObject() const { - RenderObject* curr = const_cast(this); - while (curr) { - if (curr->isBoxModelObject()) - return toRenderBoxModelObject(curr); - curr = curr->parent(); - } - - ASSERT_NOT_REACHED(); - return 0; -} - -bool RenderObject::skipInvalidationWhenLaidOutChildren() const { - if (!neededLayoutBecauseOfChildren()) - return false; - - // SVG renderers need to be invalidated when their children are laid out. - // RenderBlocks with line boxes are responsible to invalidate them so we can't - // ignore them. - if (isRenderParagraph() && toRenderParagraph(this)->firstLineBox()) - return false; - - return rendererHasNoBoxEffect(); -} - -RenderBlock* RenderObject::firstLineBlock() const { - return 0; -} - -static inline bool objectIsRelayoutBoundary(const RenderObject* object) { - if (!object->hasOverflowClip()) - return false; - - if (object->style()->width().isIntrinsicOrAuto() || - object->style()->height().isIntrinsicOrAuto() || - object->style()->height().isPercent()) - return false; - - return true; -} - -void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, - RenderObject* newRoot, - SubtreeLayoutScope* layouter) { - ASSERT(!scheduleRelayout || !newRoot); - ASSERT(!isSetNeedsLayoutForbidden()); - ASSERT(!layouter || this != layouter->root()); - - RenderObject* object = container(); - RenderObject* last = this; - - bool simplifiedNormalFlowLayout = needsSimplifiedNormalFlowLayout() && - !selfNeedsLayout() && - !normalChildNeedsLayout(); - - while (object) { - if (object->selfNeedsLayout()) - return; - - // Don't mark the outermost object of an unrooted subtree. That object will - // be marked when the subtree is added to the document. - RenderObject* container = object->container(); - if (!container && !object->isRenderView()) - return; - if (!last->isText() && last->style()->hasOutOfFlowPosition()) { - bool willSkipRelativelyPositionedInlines = !object->isRenderBlock(); - // Skip relatively positioned inlines and anonymous blocks to get to the - // enclosing RenderBlock. - while (object && !object->isRenderBlock()) - object = object->container(); - if (!object || object->posChildNeedsLayout()) - return; - if (willSkipRelativelyPositionedInlines) - container = object->container(); - object->setPosChildNeedsLayout(true); - simplifiedNormalFlowLayout = true; - ASSERT(!object->isSetNeedsLayoutForbidden()); - } else if (simplifiedNormalFlowLayout) { - if (object->needsSimplifiedNormalFlowLayout()) - return; - object->setNeedsSimplifiedNormalFlowLayout(true); - ASSERT(!object->isSetNeedsLayoutForbidden()); - } else { - if (object->normalChildNeedsLayout()) - return; - object->setNormalChildNeedsLayout(true); - ASSERT(!object->isSetNeedsLayoutForbidden()); - } - - if (layouter) { - layouter->addRendererToLayout(object); - if (object == layouter->root()) - return; - } - - if (object == newRoot) - return; - - last = object; - if (scheduleRelayout && objectIsRelayoutBoundary(last)) - break; - object = container; - } - - if (scheduleRelayout) - last->scheduleRelayout(); -} - -#if ENABLE(ASSERT) -void RenderObject::checkBlockPositionedObjectsNeedLayout() { - ASSERT(!needsLayout()); - - if (isRenderBlock()) - toRenderBlock(this)->checkPositionedObjectsNeedLayout(); -} -#endif - -void RenderObject::setPreferredLogicalWidthsDirty(MarkingBehavior markParents) { - m_bitfields.setPreferredLogicalWidthsDirty(true); - if (markParents == MarkContainingBlockChain && - (isText() || !style()->hasOutOfFlowPosition())) - invalidateContainerPreferredLogicalWidths(); -} - -void RenderObject::clearPreferredLogicalWidthsDirty() { - m_bitfields.setPreferredLogicalWidthsDirty(false); -} - -void RenderObject::invalidateContainerPreferredLogicalWidths() { - // In order to avoid pathological behavior when inlines are deeply nested, we - // do include them in the chain that we mark dirty (even though they're kind - // of irrelevant). - RenderObject* o = container(); - while (o && !o->preferredLogicalWidthsDirty()) { - // Don't invalidate the outermost object of an unrooted subtree. That object - // will be invalidated when the subtree is added to the document. - RenderObject* container = o->container(); - if (!container && !o->isRenderView()) - break; - - o->m_bitfields.setPreferredLogicalWidthsDirty(true); - if (o->style()->hasOutOfFlowPosition()) - // A positioned object has no effect on the min/max width of its - // containing block ever. We can optimize this case and not go up any - // further. - break; - o = container; - } -} - -RenderBlock* RenderObject::containingBlock() const { - RenderObject* o = parent(); - if (!isText() && m_style->position() == AbsolutePosition) { - while (o) { - // For relpositioned inlines, we return the nearest non-anonymous - // enclosing block. We don't try to return the inline itself. This allows - // us to avoid having a positioned objects list in all RenderInlines and - // lets us return a strongly-typed RenderBlock* result from this method. - // The container() method can actually be used to obtain the inline - // directly. - if (o->style()->position() != StaticPosition && - (!o->isInline() || o->isReplaced())) - break; - - if (o->canContainAbsolutePositionObjects()) - break; - - if (o->style()->hasInFlowPosition() && o->isInline() && - !o->isReplaced()) { - o = o->containingBlock(); - break; - } - - o = o->parent(); - } - - if (o && !o->isRenderBlock()) - o = o->containingBlock(); - } else { - while (o && ((o->isInline() && !o->isReplaced()) || !o->isRenderBlock())) - o = o->parent(); - } - - if (!o || !o->isRenderBlock()) - return 0; // This can still happen in case of an orphaned tree - - return toRenderBlock(o); -} - -void RenderObject::drawLineForBoxSide(GraphicsContext* graphicsContext, - int x1, - int y1, - int x2, - int y2, - BoxSide side, - Color color, - EBorderStyle style, - int adjacentWidth1, - int adjacentWidth2, - bool antialias) { - int thickness; - int length; - if (side == BSTop || side == BSBottom) { - thickness = y2 - y1; - length = x2 - x1; - } else { - thickness = x2 - x1; - length = y2 - y1; - } - - // FIXME: We really would like this check to be an ASSERT as we don't want to - // draw empty borders. However nothing guarantees that the following recursive - // calls to drawLineForBoxSide will have non-null dimensions. - if (!thickness || !length) - return; - - if (style == DOUBLE && thickness < 3) - style = SOLID; - - switch (style) { - case BNONE: - case BHIDDEN: - return; - case DOTTED: - case DASHED: - drawDashedOrDottedBoxSide(graphicsContext, x1, y1, x2, y2, side, color, - thickness, style, antialias); - break; - case DOUBLE: - drawDoubleBoxSide(graphicsContext, x1, y1, x2, y2, length, side, color, - thickness, adjacentWidth1, adjacentWidth2, antialias); - break; - case RIDGE: - case GROOVE: - drawRidgeOrGrooveBoxSide(graphicsContext, x1, y1, x2, y2, side, color, - style, adjacentWidth1, adjacentWidth2, - antialias); - break; - case INSET: - // FIXME: Maybe we should lighten the colors on one side like Firefox. - // https://bugs.webkit.org/show_bug.cgi?id=58608 - if (side == BSTop || side == BSLeft) - color = color.dark(); - // fall through - case OUTSET: - if (style == OUTSET && (side == BSBottom || side == BSRight)) - color = color.dark(); - // fall through - case SOLID: - drawSolidBoxSide(graphicsContext, x1, y1, x2, y2, side, color, - adjacentWidth1, adjacentWidth2, antialias); - break; - } -} - -void RenderObject::drawDashedOrDottedBoxSide(GraphicsContext* graphicsContext, - int x1, - int y1, - int x2, - int y2, - BoxSide side, - Color color, - int thickness, - EBorderStyle style, - bool antialias) { - if (thickness <= 0) - return; - - bool wasAntialiased = graphicsContext->shouldAntialias(); - StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle(); - graphicsContext->setShouldAntialias(antialias); - graphicsContext->setStrokeColor(color); - graphicsContext->setStrokeThickness(thickness); - graphicsContext->setStrokeStyle(style == DASHED ? DashedStroke - : DottedStroke); - - switch (side) { - case BSBottom: - case BSTop: - graphicsContext->drawLine(IntPoint(x1, (y1 + y2) / 2), - IntPoint(x2, (y1 + y2) / 2)); - break; - case BSRight: - case BSLeft: - graphicsContext->drawLine(IntPoint((x1 + x2) / 2, y1), - IntPoint((x1 + x2) / 2, y2)); - break; - } - graphicsContext->setShouldAntialias(wasAntialiased); - graphicsContext->setStrokeStyle(oldStrokeStyle); -} - -void RenderObject::drawDoubleBoxSide(GraphicsContext* graphicsContext, - int x1, - int y1, - int x2, - int y2, - int length, - BoxSide side, - Color color, - int thickness, - int adjacentWidth1, - int adjacentWidth2, - bool antialias) { - int thirdOfThickness = (thickness + 1) / 3; - ASSERT(thirdOfThickness); - - if (!adjacentWidth1 && !adjacentWidth2) { - StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle(); - graphicsContext->setStrokeStyle(NoStroke); - graphicsContext->setFillColor(color); - - bool wasAntialiased = graphicsContext->shouldAntialias(); - graphicsContext->setShouldAntialias(antialias); - - switch (side) { - case BSTop: - case BSBottom: - graphicsContext->drawRect(IntRect(x1, y1, length, thirdOfThickness)); - graphicsContext->drawRect( - IntRect(x1, y2 - thirdOfThickness, length, thirdOfThickness)); - break; - case BSLeft: - case BSRight: - // FIXME: Why do we offset the border by 1 in this case but not the - // other one? - if (length > 1) { - graphicsContext->drawRect( - IntRect(x1, y1 + 1, thirdOfThickness, length - 1)); - graphicsContext->drawRect(IntRect(x2 - thirdOfThickness, y1 + 1, - thirdOfThickness, length - 1)); - } - break; - } - - graphicsContext->setShouldAntialias(wasAntialiased); - graphicsContext->setStrokeStyle(oldStrokeStyle); - return; - } - - int adjacent1BigThird = - ((adjacentWidth1 > 0) ? adjacentWidth1 + 1 : adjacentWidth1 - 1) / 3; - int adjacent2BigThird = - ((adjacentWidth2 > 0) ? adjacentWidth2 + 1 : adjacentWidth2 - 1) / 3; - - switch (side) { - case BSTop: - drawLineForBoxSide(graphicsContext, - x1 + std::max((-adjacentWidth1 * 2 + 1) / 3, 0), y1, - x2 - std::max((-adjacentWidth2 * 2 + 1) / 3, 0), - y1 + thirdOfThickness, side, color, SOLID, - adjacent1BigThird, adjacent2BigThird, antialias); - drawLineForBoxSide( - graphicsContext, x1 + std::max((adjacentWidth1 * 2 + 1) / 3, 0), - y2 - thirdOfThickness, x2 - std::max((adjacentWidth2 * 2 + 1) / 3, 0), - y2, side, color, SOLID, adjacent1BigThird, adjacent2BigThird, - antialias); - break; - case BSLeft: - drawLineForBoxSide( - graphicsContext, x1, y1 + std::max((-adjacentWidth1 * 2 + 1) / 3, 0), - x1 + thirdOfThickness, - y2 - std::max((-adjacentWidth2 * 2 + 1) / 3, 0), side, color, SOLID, - adjacent1BigThird, adjacent2BigThird, antialias); - drawLineForBoxSide(graphicsContext, x2 - thirdOfThickness, - y1 + std::max((adjacentWidth1 * 2 + 1) / 3, 0), x2, - y2 - std::max((adjacentWidth2 * 2 + 1) / 3, 0), side, - color, SOLID, adjacent1BigThird, adjacent2BigThird, - antialias); - break; - case BSBottom: - drawLineForBoxSide( - graphicsContext, x1 + std::max((adjacentWidth1 * 2 + 1) / 3, 0), y1, - x2 - std::max((adjacentWidth2 * 2 + 1) / 3, 0), y1 + thirdOfThickness, - side, color, SOLID, adjacent1BigThird, adjacent2BigThird, antialias); - drawLineForBoxSide( - graphicsContext, x1 + std::max((-adjacentWidth1 * 2 + 1) / 3, 0), - y2 - thirdOfThickness, - x2 - std::max((-adjacentWidth2 * 2 + 1) / 3, 0), y2, side, color, - SOLID, adjacent1BigThird, adjacent2BigThird, antialias); - break; - case BSRight: - drawLineForBoxSide( - graphicsContext, x1, y1 + std::max((adjacentWidth1 * 2 + 1) / 3, 0), - x1 + thirdOfThickness, y2 - std::max((adjacentWidth2 * 2 + 1) / 3, 0), - side, color, SOLID, adjacent1BigThird, adjacent2BigThird, antialias); - drawLineForBoxSide(graphicsContext, x2 - thirdOfThickness, - y1 + std::max((-adjacentWidth1 * 2 + 1) / 3, 0), x2, - y2 - std::max((-adjacentWidth2 * 2 + 1) / 3, 0), side, - color, SOLID, adjacent1BigThird, adjacent2BigThird, - antialias); - break; - default: - break; - } -} - -void RenderObject::drawRidgeOrGrooveBoxSide(GraphicsContext* graphicsContext, - int x1, - int y1, - int x2, - int y2, - BoxSide side, - Color color, - EBorderStyle style, - int adjacentWidth1, - int adjacentWidth2, - bool antialias) { - EBorderStyle s1; - EBorderStyle s2; - if (style == GROOVE) { - s1 = INSET; - s2 = OUTSET; - } else { - s1 = OUTSET; - s2 = INSET; - } - - int adjacent1BigHalf = - ((adjacentWidth1 > 0) ? adjacentWidth1 + 1 : adjacentWidth1 - 1) / 2; - int adjacent2BigHalf = - ((adjacentWidth2 > 0) ? adjacentWidth2 + 1 : adjacentWidth2 - 1) / 2; - - switch (side) { - case BSTop: - drawLineForBoxSide(graphicsContext, x1 + std::max(-adjacentWidth1, 0) / 2, - y1, x2 - std::max(-adjacentWidth2, 0) / 2, - (y1 + y2 + 1) / 2, side, color, s1, adjacent1BigHalf, - adjacent2BigHalf, antialias); - drawLineForBoxSide( - graphicsContext, x1 + std::max(adjacentWidth1 + 1, 0) / 2, - (y1 + y2 + 1) / 2, x2 - std::max(adjacentWidth2 + 1, 0) / 2, y2, side, - color, s2, adjacentWidth1 / 2, adjacentWidth2 / 2, antialias); - break; - case BSLeft: - drawLineForBoxSide( - graphicsContext, x1, y1 + std::max(-adjacentWidth1, 0) / 2, - (x1 + x2 + 1) / 2, y2 - std::max(-adjacentWidth2, 0) / 2, side, color, - s1, adjacent1BigHalf, adjacent2BigHalf, antialias); - drawLineForBoxSide(graphicsContext, (x1 + x2 + 1) / 2, - y1 + std::max(adjacentWidth1 + 1, 0) / 2, x2, - y2 - std::max(adjacentWidth2 + 1, 0) / 2, side, color, - s2, adjacentWidth1 / 2, adjacentWidth2 / 2, antialias); - break; - case BSBottom: - drawLineForBoxSide(graphicsContext, x1 + std::max(adjacentWidth1, 0) / 2, - y1, x2 - std::max(adjacentWidth2, 0) / 2, - (y1 + y2 + 1) / 2, side, color, s2, adjacent1BigHalf, - adjacent2BigHalf, antialias); - drawLineForBoxSide( - graphicsContext, x1 + std::max(-adjacentWidth1 + 1, 0) / 2, - (y1 + y2 + 1) / 2, x2 - std::max(-adjacentWidth2 + 1, 0) / 2, y2, - side, color, s1, adjacentWidth1 / 2, adjacentWidth2 / 2, antialias); - break; - case BSRight: - drawLineForBoxSide( - graphicsContext, x1, y1 + std::max(adjacentWidth1, 0) / 2, - (x1 + x2 + 1) / 2, y2 - std::max(adjacentWidth2, 0) / 2, side, color, - s2, adjacent1BigHalf, adjacent2BigHalf, antialias); - drawLineForBoxSide(graphicsContext, (x1 + x2 + 1) / 2, - y1 + std::max(-adjacentWidth1 + 1, 0) / 2, x2, - y2 - std::max(-adjacentWidth2 + 1, 0) / 2, side, color, - s1, adjacentWidth1 / 2, adjacentWidth2 / 2, antialias); - break; - } -} - -void RenderObject::drawSolidBoxSide(GraphicsContext* graphicsContext, - int x1, - int y1, - int x2, - int y2, - BoxSide side, - Color color, - int adjacentWidth1, - int adjacentWidth2, - bool antialias) { - StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle(); - graphicsContext->setStrokeStyle(NoStroke); - graphicsContext->setFillColor(color); - ASSERT(x2 >= x1); - ASSERT(y2 >= y1); - if (!adjacentWidth1 && !adjacentWidth2) { - // Turn off antialiasing to match the behavior of drawConvexPolygon(); - // this matters for rects in transformed contexts. - bool wasAntialiased = graphicsContext->shouldAntialias(); - graphicsContext->setShouldAntialias(antialias); - graphicsContext->drawRect(IntRect(x1, y1, x2 - x1, y2 - y1)); - graphicsContext->setShouldAntialias(wasAntialiased); - graphicsContext->setStrokeStyle(oldStrokeStyle); - return; - } - FloatPoint quad[4]; - switch (side) { - case BSTop: - quad[0] = FloatPoint(x1 + std::max(-adjacentWidth1, 0), y1); - quad[1] = FloatPoint(x1 + std::max(adjacentWidth1, 0), y2); - quad[2] = FloatPoint(x2 - std::max(adjacentWidth2, 0), y2); - quad[3] = FloatPoint(x2 - std::max(-adjacentWidth2, 0), y1); - break; - case BSBottom: - quad[0] = FloatPoint(x1 + std::max(adjacentWidth1, 0), y1); - quad[1] = FloatPoint(x1 + std::max(-adjacentWidth1, 0), y2); - quad[2] = FloatPoint(x2 - std::max(-adjacentWidth2, 0), y2); - quad[3] = FloatPoint(x2 - std::max(adjacentWidth2, 0), y1); - break; - case BSLeft: - quad[0] = FloatPoint(x1, y1 + std::max(-adjacentWidth1, 0)); - quad[1] = FloatPoint(x1, y2 - std::max(-adjacentWidth2, 0)); - quad[2] = FloatPoint(x2, y2 - std::max(adjacentWidth2, 0)); - quad[3] = FloatPoint(x2, y1 + std::max(adjacentWidth1, 0)); - break; - case BSRight: - quad[0] = FloatPoint(x1, y1 + std::max(adjacentWidth1, 0)); - quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); - quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); - quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); - break; - } - - graphicsContext->drawConvexPolygon(4, quad, antialias); - graphicsContext->setStrokeStyle(oldStrokeStyle); -} - -void RenderObject::addChildFocusRingRects( - Vector& rects, - const LayoutPoint& additionalOffset, - const RenderBox* paintContainer) const { - for (RenderObject* current = slowFirstChild(); current; - current = current->nextSibling()) { - if (current->isText()) - continue; - - if (current->isBox()) { - RenderBox* box = toRenderBox(current); - if (box->hasLayer()) { - Vector layerFocusRingRects; - box->addFocusRingRects(layerFocusRingRects, LayoutPoint(), box); - for (size_t i = 0; i < layerFocusRingRects.size(); ++i) { - FloatQuad quadInBox = box->localToContainerQuad( - FloatRect(layerFocusRingRects[i]), paintContainer); - FloatRect rect = quadInBox.boundingBox(); - // Floor the location instead of using pixelSnappedIntRect to match - // the !hasLayer() path. - // FIXME: roundedIntSize matches pixelSnappedIntRect in other places - // of addFocusRingRects because we always floor the offset. This - // assumption is fragile and should be replaced by better solution. - rects.append(IntRect(flooredIntPoint(rect.location()), - roundedIntSize(rect.size()))); - } - } else { - FloatPoint pos(additionalOffset); - pos.move(box->locationOffset()); - box->addFocusRingRects(rects, flooredIntPoint(pos), paintContainer); - } - } else { - current->addFocusRingRects(rects, additionalOffset, paintContainer); - } - } -} - -IntRect RenderObject::absoluteBoundingBoxRect() const { - Vector quads; - absoluteQuads(quads); - - size_t n = quads.size(); - if (!n) - return IntRect(); - - IntRect result = quads[0].enclosingBoundingBox(); - for (size_t i = 1; i < n; ++i) - result.unite(quads[i].enclosingBoundingBox()); - return result; -} - -void RenderObject::addAbsoluteRectForLayer(LayoutRect& result) { - if (hasLayer()) - result.unite(absoluteBoundingBoxRect()); - for (RenderObject* current = slowFirstChild(); current; - current = current->nextSibling()) - current->addAbsoluteRectForLayer(result); -} - -void RenderObject::paint(PaintInfo&, - const LayoutPoint&, - Vector& layers) {} - -void RenderObject::dirtyLinesFromChangedChild(RenderObject*) {} - -#ifndef NDEBUG - -void RenderObject::showTreeForThis() const {} - -void RenderObject::showRenderTreeForThis() const { - showRenderTree(this, 0); -} - -void RenderObject::showLineTreeForThis() const { - if (containingBlock()) - containingBlock()->showLineTreeAndMark(0, 0, 0, 0, this); -} - -void RenderObject::showRenderObject() const { - showRenderObject(0); -} - -void RenderObject::showRenderObject(int printedCharacters) const { - printedCharacters += fprintf(stderr, "%s %p", renderName(), this); - fputc('\n', stderr); -} - -void RenderObject::showRenderTreeAndMark(const RenderObject* markedObject1, - const char* markedLabel1, - const RenderObject* markedObject2, - const char* markedLabel2, - int depth) const { - int printedCharacters = 0; - if (markedObject1 == this && markedLabel1) - printedCharacters += fprintf(stderr, "%s", markedLabel1); - if (markedObject2 == this && markedLabel2) - printedCharacters += fprintf(stderr, "%s", markedLabel2); - for (; printedCharacters < depth * 2; printedCharacters++) - fputc(' ', stderr); - - showRenderObject(printedCharacters); - - for (const RenderObject* child = slowFirstChild(); child; - child = child->nextSibling()) - child->showRenderTreeAndMark(markedObject1, markedLabel1, markedObject2, - markedLabel2, depth + 1); -} - -#endif // NDEBUG - -bool RenderObject::isSelectable() const { - return !(style()->userSelect() == SELECT_NONE && - style()->userModify() == READ_ONLY); -} - -Color RenderObject::selectionBackgroundColor() const { - ASSERT_NOT_REACHED(); - // TODO(ianh): if we expose selection painting, we should expose a way to set - // the background colour - // TODO(ianh): need to be able to configure whether to consider the selection - // focused and active or not - if (!isSelectable()) - return Color::transparent; - bool isFocusedAndActive = true; - return isFocusedAndActive - ? RenderTheme::theme().activeSelectionBackgroundColor() - : RenderTheme::theme().inactiveSelectionBackgroundColor(); -} - -Color RenderObject::selectionColor() const { - ASSERT_NOT_REACHED(); - return style()->color(); -} - -Color RenderObject::selectionForegroundColor() const { - return selectionColor(); -} - -Color RenderObject::selectionEmphasisMarkColor() const { - return selectionColor(); -} - -void RenderObject::selectionStartEnd(int& spos, int& epos) const { - spos = -1; - epos = -1; -} - -StyleDifference RenderObject::adjustStyleDifference( - StyleDifference diff) const { - // The answer to layerTypeRequired() for plugins, iframes, and canvas can - // change without the actual style changing, since it depends on whether we - // decide to composite these elements. When the layer status of one of these - // elements changes, we need to force a layout. - if (!diff.needsFullLayout() && style() && isBox()) { - bool requiresLayer = toRenderBox(this)->layerTypeRequired() != NoLayer; - if (hasLayer() != requiresLayer) - diff.setNeedsFullLayout(); - } - - return diff; -} - -inline bool -RenderObject::hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor() - const { - if (style()->hasBorder() || style()->hasOutline()) - return true; - for (const RenderObject* r = slowFirstChild(); r; r = r->nextSibling()) { - if (r->isText() && !toRenderText(r)->isAllCollapsibleWhitespace()) - return true; - if (r->style()->hasOutline() || r->style()->hasBorder()) - return true; - } - return false; -} - -void RenderObject::markContainingBlocksForOverflowRecalc() { - for (RenderBlock* container = containingBlock(); - container && !container->childNeedsOverflowRecalcAfterStyleChange(); - container = container->containingBlock()) - container->setChildNeedsOverflowRecalcAfterStyleChange(true); -} - -void RenderObject::setNeedsOverflowRecalcAfterStyleChange() { - bool neededRecalc = needsOverflowRecalcAfterStyleChange(); - setSelfNeedsOverflowRecalcAfterStyleChange(true); - if (!neededRecalc) - markContainingBlocksForOverflowRecalc(); -} - -void RenderObject::setStyle(PassRefPtr style) { - ASSERT(style); - StyleDifference diff; - if (m_style) - diff = m_style->visualInvalidationDiff(*style); - - diff = adjustStyleDifference(diff); - - styleWillChange(diff, *style); - - RefPtr oldStyle = m_style.release(); - setStyleInternal(style); - - updateFillImages(oldStyle ? &oldStyle->backgroundLayers() : 0, - m_style->backgroundLayers()); - - bool doesNotNeedLayout = !m_parent || isText(); - - styleDidChange(diff, oldStyle.get()); - - // FIXME: |this| might be destroyed here. This can currently happen for a - // RenderTextFragment when its first-letter block gets an update in - // RenderTextFragment::styleDidChange. For RenderTextFragment(s), we will - // safely bail out with the doesNotNeedLayout flag. We might want to broaden - // this condition in the future as we move renderer changes out of layout and - // into style changes. - // FIXME(sky): Remove this. - if (doesNotNeedLayout) - return; - - // Now that the layer (if any) has been updated, we need to adjust the diff - // again, check whether we should layout now, and decide if we need to - // invalidate paints. - StyleDifference updatedDiff = adjustStyleDifference(diff); - - if (!diff.needsFullLayout()) { - if (updatedDiff.needsFullLayout()) - setNeedsLayoutAndPrefWidthsRecalc(); - else if (updatedDiff.needsPositionedMovementLayout()) - setNeedsPositionedMovementLayout(); - } - - if (diff.transformChanged() && !needsLayout()) { - if (RenderBlock* container = containingBlock()) - container->setNeedsOverflowRecalcAfterStyleChange(); - } -} - -void RenderObject::styleWillChange(StyleDifference diff, - const RenderStyle& newStyle) { - if (m_style) { - if (isOutOfFlowPositioned() && (m_style->position() != newStyle.position())) - // For changes in positioning styles, we need to conceivably remove - // ourselves from the positioned objects list. - toRenderBox(this)->removeFloatingOrPositionedChildFromBlockLists(); - - s_affectsParentBlock = - isFloatingOrOutOfFlowPositioned() && !newStyle.hasOutOfFlowPosition() && - parent() && - (parent()->isRenderParagraph() || parent()->isRenderInline()); - - // Clearing these bits is required to avoid leaving stale renderers. - // FIXME: We shouldn't need that hack if our logic was totally correct. - if (diff.needsLayout()) { - clearPositionedState(); - } - } else { - s_affectsParentBlock = false; - } -} - -void RenderObject::styleDidChange(StyleDifference diff, - const RenderStyle* oldStyle) { - if (s_affectsParentBlock) { - // An object that was floating or positioned became a normal flow object - // again. We have to make sure the render tree updates as needed to - // accommodate the new normal flow object. - setInline(style()->isDisplayInlineType()); - ASSERT(isInline() == parent()->isRenderParagraph()); - } - - if (!m_parent) - return; - - if (diff.needsFullLayout()) { - // If the object already needs layout, then setNeedsLayout won't do - // any work. But if the containing block has changed, then we may need - // to mark the new containing blocks for layout. The change that can - // directly affect the containing block of this object is a change to - // the position style. - if (needsLayout() && oldStyle->position() != m_style->position()) - markContainingBlocksForLayout(); - - // Ditto. - if (needsOverflowRecalcAfterStyleChange() && - oldStyle->position() != m_style->position()) - markContainingBlocksForOverflowRecalc(); - - if (diff.needsFullLayout()) - setNeedsLayoutAndPrefWidthsRecalc(); - } else if (diff.needsPositionedMovementLayout()) - setNeedsPositionedMovementLayout(); - - // Don't check for paint invalidation here; we need to wait until the layer - // has been updated by subclasses before we know if we have to invalidate - // paints (in setStyle()). -} - -void RenderObject::updateFillImages(const FillLayer* oldLayers, - const FillLayer& newLayers) { - // Optimize the common case - if (oldLayers && !oldLayers->next() && !newLayers.next() && - (oldLayers->image() == newLayers.image())) - return; - - // Go through the new layers and addClients first, to avoid removing all - // clients of an image. - for (const FillLayer* currNew = &newLayers; currNew; - currNew = currNew->next()) { - if (currNew->image()) - currNew->image()->addClient(this); - } - - for (const FillLayer* currOld = oldLayers; currOld; - currOld = currOld->next()) { - if (currOld->image()) - currOld->image()->removeClient(this); - } -} - -void RenderObject::updateImage(StyleImage* oldImage, StyleImage* newImage) { - if (oldImage != newImage) { - if (oldImage) - oldImage->removeClient(this); - if (newImage) - newImage->addClient(this); - } -} - -FloatPoint RenderObject::localToAbsolute(const FloatPoint& localPoint, - MapCoordinatesFlags mode) const { - TransformState transformState(TransformState::ApplyTransformDirection, - localPoint); - mapLocalToContainer(0, transformState, mode | ApplyContainerFlip); - transformState.flatten(); - - return transformState.lastPlanarPoint(); -} - -FloatPoint RenderObject::absoluteToLocal(const FloatPoint& containerPoint, - MapCoordinatesFlags mode) const { - TransformState transformState( - TransformState::UnapplyInverseTransformDirection, containerPoint); - mapAbsoluteToLocalPoint(mode, transformState); - transformState.flatten(); - - return transformState.lastPlanarPoint(); -} - -FloatQuad RenderObject::absoluteToLocalQuad(const FloatQuad& quad, - MapCoordinatesFlags mode) const { - TransformState transformState( - TransformState::UnapplyInverseTransformDirection, - quad.boundingBox().center(), quad); - mapAbsoluteToLocalPoint(mode, transformState); - transformState.flatten(); - return transformState.lastPlanarQuad(); -} - -void RenderObject::mapLocalToContainer( - const RenderBox* paintInvalidationContainer, - TransformState& transformState, - MapCoordinatesFlags mode) const { - if (paintInvalidationContainer == this) - return; - - RenderObject* o = parent(); - if (!o) - return; - - // FIXME: this should call offsetFromContainer to share code, but I'm not sure - // it's ever called. - if (mode & ApplyContainerFlip && o->isBox()) - mode &= ~ApplyContainerFlip; - - o->mapLocalToContainer(paintInvalidationContainer, transformState, mode); -} - -const RenderObject* RenderObject::pushMappingToContainer( - const RenderBox* ancestorToStopAt, - RenderGeometryMap& geometryMap) const { - ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != this); - - RenderObject* container = parent(); - if (!container) - return 0; - // FIXME(sky): Do we need to make this call? - geometryMap.push(this, LayoutSize(), false); - return container; -} - -void RenderObject::mapAbsoluteToLocalPoint( - MapCoordinatesFlags mode, - TransformState& transformState) const { - RenderObject* o = parent(); - if (o) - o->mapAbsoluteToLocalPoint(mode, transformState); -} - -bool RenderObject::shouldUseTransformFromContainer( - const RenderObject* containerObject) const { - // hasTransform() indicates whether the object has transform, transform-style - // or perspective. We just care about transform, so check the layer's - // transform directly. - return (isBox() && toRenderBox(this)->transform()) || - (containerObject && containerObject->style()->hasPerspective()); -} - -void RenderObject::getTransformFromContainer( - const RenderObject* containerObject, - const LayoutSize& offsetInContainer, - TransformationMatrix& transform) const { - transform.makeIdentity(); - transform.translate(offsetInContainer.width().toFloat(), - offsetInContainer.height().toFloat()); - TransformationMatrix* localTransform = - isBox() ? toRenderBox(this)->transform() : 0; - if (localTransform) - transform.multiply(*localTransform); - - if (containerObject && containerObject->hasLayer() && - containerObject->style()->hasPerspective()) { - // Perpsective on the container affects us, so we have to factor it in here. - ASSERT(containerObject->hasLayer()); - FloatPoint perspectiveOrigin = - toRenderBox(containerObject)->perspectiveOrigin(); - - TransformationMatrix perspectiveMatrix; - perspectiveMatrix.applyPerspective(containerObject->style()->perspective()); - - transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y(), - 0); - transform = perspectiveMatrix * transform; - transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(), 0); - } -} - -FloatQuad RenderObject::localToContainerQuad( - const FloatQuad& localQuad, - const RenderBox* paintInvalidationContainer, - MapCoordinatesFlags mode) const { - // Track the point at the center of the quad's bounding box. As - // mapLocalToContainer() calls offsetFromContainer(), it will use that point - // as the reference point to decide which column's transform to apply in - // multiple-column blocks. - TransformState transformState(TransformState::ApplyTransformDirection, - localQuad.boundingBox().center(), localQuad); - mapLocalToContainer(paintInvalidationContainer, transformState, - mode | ApplyContainerFlip | UseTransforms); - transformState.flatten(); - - return transformState.lastPlanarQuad(); -} - -FloatPoint RenderObject::localToContainerPoint( - const FloatPoint& localPoint, - const RenderBox* paintInvalidationContainer, - MapCoordinatesFlags mode) const { - TransformState transformState(TransformState::ApplyTransformDirection, - localPoint); - mapLocalToContainer(paintInvalidationContainer, transformState, - mode | ApplyContainerFlip | UseTransforms); - transformState.flatten(); - - return transformState.lastPlanarPoint(); -} - -LayoutSize RenderObject::offsetFromContainer(const RenderObject* o, - const LayoutPoint& point, - bool* offsetDependsOnPoint) const { - ASSERT(o == container()); - LayoutSize offset; - if (offsetDependsOnPoint) - *offsetDependsOnPoint = false; - return offset; -} - -LayoutSize RenderObject::offsetFromAncestorContainer( - const RenderObject* container) const { - LayoutSize offset; - LayoutPoint referencePoint; - const RenderObject* currContainer = this; - do { - const RenderObject* nextContainer = currContainer->container(); - ASSERT(nextContainer); // This means we reached the top without finding - // container. - if (!nextContainer) - break; - ASSERT(!currContainer->hasTransform()); - LayoutSize currentOffset = - currContainer->offsetFromContainer(nextContainer, referencePoint); - offset += currentOffset; - referencePoint.move(currentOffset); - currContainer = nextContainer; - } while (currContainer != container); - - return offset; -} - -LayoutRect RenderObject::localCaretRect(InlineBox*, - int, - LayoutUnit* extraWidthToEndOfLine) { - if (extraWidthToEndOfLine) - *extraWidthToEndOfLine = 0; - - return LayoutRect(); -} - -bool RenderObject::isRooted() const { - const RenderObject* object = this; - while (object->parent() && !object->hasLayer()) - object = object->parent(); - if (object->hasLayer()) - return toRenderBox(object)->layer()->root()->isRootLayer(); - return false; -} - -RespectImageOrientationEnum RenderObject::shouldRespectImageOrientation() - const { - return DoNotRespectImageOrientation; -} - -bool RenderObject::hasEntirelyFixedBackground() const { - return m_style->hasEntirelyFixedBackground(); -} - -RenderObject* RenderObject::container( - const RenderBox* paintInvalidationContainer, - bool* paintInvalidationContainerSkipped) const { - if (paintInvalidationContainerSkipped) - *paintInvalidationContainerSkipped = false; - - // This method is extremely similar to containingBlock(), but with a few - // notable exceptions. (1) It can be used on orphaned subtrees, i.e., it can - // be called safely even when the object is not part of the primary document - // subtree yet. (2) For normal flow elements, it just returns the parent. (3) - // For absolute positioned elements, it will return a relative positioned - // inline. containingBlock() simply skips relpositioned inlines and lets an - // enclosing block handle the layout of the positioned object. This does mean - // that computePositionedLogicalWidth and computePositionedLogicalHeight have - // to use container(). - RenderObject* o = parent(); - - if (isText()) - return o; - - EPosition pos = m_style->position(); - if (pos == AbsolutePosition) { - // We technically just want our containing block, but - // we may not have one if we're part of an uninstalled - // subtree. We'll climb as high as we can though. - while (o) { - if (o->style()->position() != StaticPosition) - break; - - if (o->canContainAbsolutePositionObjects()) - break; - - if (paintInvalidationContainerSkipped && o == paintInvalidationContainer) - *paintInvalidationContainerSkipped = true; - - o = o->parent(); - } - } - - return o; -} - -bool RenderObject::isSelectionBorder() const { - SelectionState st = selectionState(); - return st == SelectionStart || st == SelectionEnd || st == SelectionBoth; -} - -inline void RenderObject::clearLayoutRootIfNeeded() const {} - -void RenderObject::willBeDestroyed() { - // Destroy any leftover anonymous children. - RenderObjectChildList* children = virtualChildren(); - if (children) - children->destroyLeftoverChildren(); - - remove(); - setAncestorLineBoxDirty(false); - clearLayoutRootIfNeeded(); -} - -void RenderObject::insertedIntoTree() { - // FIXME: We should ASSERT(isRooted()) here but generated content makes some - // out-of-order insertion. - - // Keep our layer hierarchy updated. Optimize for the common case where we - // don't have any children and don't have a layer attached to ourselves. - RenderLayer* layer = 0; - if (slowFirstChild() || hasLayer()) { - layer = parent()->enclosingLayer(); - addLayers(layer); - } - - if (parent()->isRenderParagraph()) - parent()->dirtyLinesFromChangedChild(this); -} - -void RenderObject::willBeRemovedFromTree() { - // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removals - // which would need to be fixed first. - - // Keep our layer hierarchy updated. - if (slowFirstChild() || hasLayer()) - removeLayers(parent()->enclosingLayer()); - - if (isOutOfFlowPositioned() && parent()->isRenderParagraph()) - parent()->dirtyLinesFromChangedChild(this); -} - -void RenderObject::destroy() { -#if ENABLE(ASSERT) && ENABLE(OILPAN) - ASSERT(!m_didCallDestroy); - m_didCallDestroy = true; -#endif - willBeDestroyed(); - postDestroy(); -} - -void RenderObject::postDestroy() { - // It seems ugly that this is not in willBeDestroyed(). - if (m_style) { - for (const FillLayer* bgLayer = &m_style->backgroundLayers(); bgLayer; - bgLayer = bgLayer->next()) { - if (StyleImage* backgroundImage = bgLayer->image()) - backgroundImage->removeClient(this); - } - } - delete this; -} - -PositionWithAffinity RenderObject::positionForPoint(const LayoutPoint&) { - return createPositionWithAffinity(caretMinOffset(), DOWNSTREAM); -} - -// FIXME(sky): Change the callers to use nodeAtPoint direclty and remove this -// function. Or, rename nodeAtPoint to hitTest? -bool RenderObject::hitTest(const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) { - return nodeAtPoint(request, result, locationInContainer, accumulatedOffset); -} - -void RenderObject::updateHitTestResult(HitTestResult& result, - const LayoutPoint& point) {} - -bool RenderObject::nodeAtPoint(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& /*locationInContainer*/, - const LayoutPoint& /*accumulatedOffset*/) { - return false; -} - -void RenderObject::scheduleRelayout() {} - -void RenderObject::forceLayout() { - setSelfNeedsLayout(true); - layout(); -} - -// FIXME: Does this do anything different than forceLayout given that we don't -// walk the containing block chain. If not, we should change all callers to use -// forceLayout. -void RenderObject::forceChildLayout() { - setNormalChildNeedsLayout(true); - layout(); -} - -void RenderObject::getTextDecorations(unsigned decorations, - AppliedTextDecoration& underline, - AppliedTextDecoration& overline, - AppliedTextDecoration& linethrough, - bool quirksMode, - bool firstlineStyle) { - RenderObject* curr = this; - RenderStyle* styleToUse = 0; - unsigned currDecs = TextDecorationNone; - Color resultColor; - TextDecorationStyle resultStyle; - do { - styleToUse = curr->style(firstlineStyle); - currDecs = styleToUse->textDecoration(); - currDecs &= decorations; - resultColor = styleToUse->decorationColor(); - resultStyle = styleToUse->textDecorationStyle(); - // Parameter 'decorations' is cast as an int to enable the bitwise - // operations below. - if (currDecs) { - if (currDecs & TextDecorationUnderline) { - decorations &= ~TextDecorationUnderline; - underline.color = resultColor; - underline.style = resultStyle; - } - if (currDecs & TextDecorationOverline) { - decorations &= ~TextDecorationOverline; - overline.color = resultColor; - overline.style = resultStyle; - } - if (currDecs & TextDecorationLineThrough) { - decorations &= ~TextDecorationLineThrough; - linethrough.color = resultColor; - linethrough.style = resultStyle; - } - } - curr = curr->parent(); - } while (curr && decorations); - - // If we bailed out, use the element we bailed out at (typically a or - // element). - if (decorations && curr) { - styleToUse = curr->style(firstlineStyle); - resultColor = styleToUse->decorationColor(); - if (decorations & TextDecorationUnderline) { - underline.color = resultColor; - underline.style = resultStyle; - } - if (decorations & TextDecorationOverline) { - overline.color = resultColor; - overline.style = resultStyle; - } - if (decorations & TextDecorationLineThrough) { - linethrough.color = resultColor; - linethrough.style = resultStyle; - } - } -} - -int RenderObject::caretMinOffset() const { - return 0; -} - -int RenderObject::caretMaxOffset() const { - if (isReplaced()) - return 1; - return 0; -} - -int RenderObject::previousOffset(int current) const { - return current - 1; -} - -int RenderObject::previousOffsetForBackwardDeletion(int current) const { - return current - 1; -} - -int RenderObject::nextOffset(int current) const { - return current + 1; -} - -// touch-action applies to all elements with both width AND height properties. -// According to the CSS Box Model Spec -// (http://dev.w3.org/csswg/css-box/#the-width-and-height-properties) width -// applies to all elements but non-replaced inline elements, table rows, and row -// groups and height applies to all elements but non-replaced inline elements, -// table columns, and column groups. -bool RenderObject::supportsTouchAction() const { - if (isInline() && !isReplaced()) - return false; - return true; -} - -PositionWithAffinity RenderObject::createPositionWithAffinity( - int offset, - EAffinity affinity) { - return PositionWithAffinity(this, offset, affinity); -} - -bool RenderObject::canUpdateSelectionOnRootLineBoxes() { - if (needsLayout()) - return false; - - RenderBlock* containingBlock = this->containingBlock(); - return containingBlock ? !containingBlock->needsLayout() : false; -} - -bool RenderObject::nodeAtFloatPoint(const HitTestRequest&, - HitTestResult&, - const FloatPoint&) { - ASSERT_NOT_REACHED(); - return false; -} - -} // namespace blink - -#ifndef NDEBUG - -void showTree(const blink::RenderObject* object) { - if (object) - object->showTreeForThis(); -} - -void showLineTree(const blink::RenderObject* object) { - if (object) - object->showLineTreeForThis(); -} - -void showRenderTree(const blink::RenderObject* object1) { - showRenderTree(object1, 0); -} - -void showRenderTree(const blink::RenderObject* object1, - const blink::RenderObject* object2) { - if (object1) { - const blink::RenderObject* root = object1; - while (root->parent()) - root = root->parent(); - root->showRenderTreeAndMark(object1, "*", object2, "-", 0); - } -} - -#endif diff --git a/sky/engine/core/rendering/RenderObject.h b/sky/engine/core/rendering/RenderObject.h deleted file mode 100644 index f378e5e80b458..0000000000000 --- a/sky/engine/core/rendering/RenderObject.h +++ /dev/null @@ -1,1009 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. - * All rights reserved. - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ - -#include "flutter/sky/engine/core/editing/PositionWithAffinity.h" -#include "flutter/sky/engine/core/rendering/HitTestRequest.h" -#include "flutter/sky/engine/core/rendering/RenderObjectChildList.h" -#include "flutter/sky/engine/core/rendering/SubtreeLayoutScope.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" -#include "flutter/sky/engine/core/rendering/style/StyleInheritedData.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" - -namespace blink { - -class AffineTransform; -class HitTestLocation; -class HitTestResult; -class InlineBox; -class InlineFlowBox; -class Position; -class RenderBlock; -class RenderBox; -class RenderBoxModelObject; -class RenderGeometryMap; -class RenderLayer; -class RenderView; -class TransformState; - -struct PaintInfo; - -// Sides used when drawing borders and outlines. The values should run clockwise -// from top. -enum BoxSide { BSTop, BSRight, BSBottom, BSLeft }; - -enum MarkingBehavior { - MarkOnlyThis, - MarkContainingBlockChain, -}; - -enum MapCoordinatesMode { - UseTransforms = 1 << 0, - // FIXME(sky): What is this for? Do we need it? - ApplyContainerFlip = 1 << 1, - // FIXME(sky): Remove - TraverseDocumentBoundaries = 1 << 2, -}; -typedef unsigned MapCoordinatesFlags; - -const int caretWidth = 1; - -struct AnnotatedRegionValue { - bool operator==(const AnnotatedRegionValue& o) const { - return draggable == o.draggable && bounds == o.bounds; - } - - LayoutRect bounds; - bool draggable; -}; - -typedef WTF::HashMap> LayerHitTestRects; - -#ifndef NDEBUG -const int showTreeCharacterOffset = 39; -#endif - -// Base class for all rendering tree objects. -class RenderObject { - friend class RenderBlock; - friend class RenderObjectChildList; - WTF_MAKE_NONCOPYABLE(RenderObject); - - public: - // TODO(ojan): Pass in a reference since the node can no longer be null. - explicit RenderObject(); - virtual ~RenderObject(); - - virtual const char* renderName() const = 0; - - String debugName() const; - - RenderObject* parent() const { return m_parent; } - bool isDescendantOf(const RenderObject*) const; - - RenderObject* previousSibling() const { return m_previous; } - RenderObject* nextSibling() const { return m_next; } - - RenderObject* slowFirstChild() const { - if (const RenderObjectChildList* children = virtualChildren()) - return children->firstChild(); - return 0; - } - RenderObject* slowLastChild() const { - if (const RenderObjectChildList* children = virtualChildren()) - return children->lastChild(); - return 0; - } - - virtual RenderObjectChildList* virtualChildren() { return 0; } - virtual const RenderObjectChildList* virtualChildren() const { return 0; } - - RenderObject* nextInPreOrder() const; - RenderObject* nextInPreOrder(const RenderObject* stayWithin) const; - RenderObject* nextInPreOrderAfterChildren() const; - RenderObject* nextInPreOrderAfterChildren( - const RenderObject* stayWithin) const; - RenderObject* previousInPreOrder() const; - RenderObject* previousInPreOrder(const RenderObject* stayWithin) const; - RenderObject* childAt(unsigned) const; - - RenderObject* lastLeafChild() const; - - // The following six functions are used when the render tree hierarchy changes - // to make sure layers get properly added and removed. Since containership - // can be implemented by any subclass, and since a hierarchy can contain a - // mixture of boxes and other object types, these functions need to be in the - // base class. - RenderLayer* enclosingLayer() const; - void addLayers(RenderLayer* parentLayer); - void removeLayers(RenderLayer* parentLayer); - void moveLayers(RenderLayer* oldParent, RenderLayer* newParent); - RenderLayer* findNextLayer(RenderLayer* parentLayer, - RenderObject* startPoint, - bool checkParent = true); - - // Convenience function for getting to the nearest enclosing box of a - // RenderObject. - RenderBox* enclosingBox() const; - RenderBoxModelObject* enclosingBoxModelObject() const; - -#if ENABLE(ASSERT) - // Helper class forbidding calls to setNeedsLayout() during its lifetime. - class SetLayoutNeededForbiddenScope { - public: - explicit SetLayoutNeededForbiddenScope(RenderObject&); - ~SetLayoutNeededForbiddenScope(); - - private: - RenderObject& m_renderObject; - bool m_preexistingForbidden; - }; - - void assertRendererLaidOut() const { -#ifndef NDEBUG - if (needsLayout()) - showRenderTreeForThis(); -#endif - ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); - } - - void assertSubtreeIsLaidOut() const { - for (const RenderObject* renderer = this; renderer; - renderer = renderer->nextInPreOrder()) - renderer->assertRendererLaidOut(); - } -#endif - - bool skipInvalidationWhenLaidOutChildren() const; - - // FIXME: This could be used when changing the size of a renderer without - // children to skip some invalidations. - bool rendererHasNoBoxEffect() const { - return !style()->hasVisualOverflowingEffect() && !style()->hasBorder() && - !style()->hasBackground(); - } - - // Obtains the nearest enclosing block (including this block) that contributes - // a first-line style to our inline children. - virtual RenderBlock* firstLineBlock() const; - - // RenderObject tree manipulation - ////////////////////////////////////////// - virtual bool canHaveChildren() const { return virtualChildren(); } - virtual bool isChildAllowed(RenderObject*, RenderStyle*) const { - return true; - } - virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0); - virtual void removeChild(RenderObject*); - ////////////////////////////////////////// - - protected: - ////////////////////////////////////////// - // Helper functions. Dangerous to use! - void setPreviousSibling(RenderObject* previous) { m_previous = previous; } - void setNextSibling(RenderObject* next) { m_next = next; } - void setParent(RenderObject* parent) { m_parent = parent; } - - ////////////////////////////////////////// - private: -#if ENABLE(ASSERT) - bool isSetNeedsLayoutForbidden() const { return m_setNeedsLayoutForbidden; } - void setNeedsLayoutIsForbidden(bool flag) { - m_setNeedsLayoutForbidden = flag; - } -#endif - - void addAbsoluteRectForLayer(LayoutRect& result); - - public: -#ifndef NDEBUG - void showTreeForThis() const; - void showRenderTreeForThis() const; - void showLineTreeForThis() const; - - void showRenderObject() const; - // We don't make printedCharacters an optional parameter so that - // showRenderObject can be called from gdb easily. - void showRenderObject(int printedCharacters) const; - void showRenderTreeAndMark(const RenderObject* markedObject1 = 0, - const char* markedLabel1 = 0, - const RenderObject* markedObject2 = 0, - const char* markedLabel2 = 0, - int depth = 0) const; -#endif - - static unsigned instanceCount() { return s_instanceCount; } - -#if !ENABLE(OILPAN) - // RenderObjects are allocated out of the rendering partition. - void* operator new(size_t); - void operator delete(void*); -#endif - - public: - virtual bool isBoxModelObject() const { return false; } - virtual bool isCanvas() const { return false; } - virtual bool isImage() const { return false; } - virtual bool isInlineBlock() const { return false; } - virtual bool isRenderBlock() const { return false; } - virtual bool isRenderParagraph() const { return false; } - virtual bool isRenderInline() const { return false; } - virtual bool isRenderView() const { return false; } - - bool everHadLayout() const { return m_bitfields.everHadLayout(); } - - bool alwaysCreateLineBoxesForRenderInline() const { - ASSERT(isRenderInline()); - return m_bitfields.alwaysCreateLineBoxesForRenderInline(); - } - void setAlwaysCreateLineBoxesForRenderInline(bool alwaysCreateLineBoxes) { - ASSERT(isRenderInline()); - m_bitfields.setAlwaysCreateLineBoxesForRenderInline(alwaysCreateLineBoxes); - } - - bool ancestorLineBoxDirty() const { - return m_bitfields.ancestorLineBoxDirty(); - } - void setAncestorLineBoxDirty(bool value = true) { - m_bitfields.setAncestorLineBoxDirty(value); - if (value) - setNeedsLayout(); - } - - // SVG uses FloatPoint precise hit testing, and passes the point in parent - // coordinates instead of in paint invalidaiton container coordinates. - // Eventually the rest of the rendering tree will move to a similar model. - virtual bool nodeAtFloatPoint(const HitTestRequest&, - HitTestResult&, - const FloatPoint& pointInParent); - - bool canHaveWhitespaceChildren() const { return !isFlexibleBox(); } - - bool isOutOfFlowPositioned() const { - return m_bitfields.isOutOfFlowPositioned(); - } // absolute or fixed positioning - bool isPositioned() const { return m_bitfields.isPositioned(); } - - bool isText() const { return m_bitfields.isText(); } - bool isBox() const { return m_bitfields.isBox(); } - bool isInline() const { return m_bitfields.isInline(); } // inline object - bool isDragging() const { return m_bitfields.isDragging(); } - bool isReplaced() const { - return m_bitfields.isReplaced(); - } // a "replaced" element (see CSS) - - bool hasLayer() const { return m_bitfields.hasLayer(); } - - bool hasBoxDecorationBackground() const { - return m_bitfields.hasBoxDecorationBackground(); - } - bool hasBackground() const { return style()->hasBackground(); } - bool hasEntirelyFixedBackground() const; - - bool needsLayoutBecauseOfChildren() const { - return needsLayout() && !selfNeedsLayout() && - !needsPositionedMovementLayout() && - !needsSimplifiedNormalFlowLayout(); - } - - bool needsLayout() const { - return m_bitfields.selfNeedsLayout() || - m_bitfields.normalChildNeedsLayout() || - m_bitfields.posChildNeedsLayout() || - m_bitfields.needsSimplifiedNormalFlowLayout() || - m_bitfields.needsPositionedMovementLayout(); - } - - bool selfNeedsLayout() const { return m_bitfields.selfNeedsLayout(); } - bool needsPositionedMovementLayout() const { - return m_bitfields.needsPositionedMovementLayout(); - } - bool needsPositionedMovementLayoutOnly() const { - return m_bitfields.needsPositionedMovementLayout() && - !m_bitfields.selfNeedsLayout() && - !m_bitfields.normalChildNeedsLayout() && - !m_bitfields.posChildNeedsLayout() && - !m_bitfields.needsSimplifiedNormalFlowLayout(); - } - - bool posChildNeedsLayout() const { return m_bitfields.posChildNeedsLayout(); } - bool needsSimplifiedNormalFlowLayout() const { - return m_bitfields.needsSimplifiedNormalFlowLayout(); - } - bool normalChildNeedsLayout() const { - return m_bitfields.normalChildNeedsLayout(); - } - - bool preferredLogicalWidthsDirty() const { - return m_bitfields.preferredLogicalWidthsDirty(); - } - - bool needsOverflowRecalcAfterStyleChange() const { - return m_bitfields.selfNeedsOverflowRecalcAfterStyleChange() || - m_bitfields.childNeedsOverflowRecalcAfterStyleChange(); - } - bool selfNeedsOverflowRecalcAfterStyleChange() const { - return m_bitfields.selfNeedsOverflowRecalcAfterStyleChange(); - } - bool childNeedsOverflowRecalcAfterStyleChange() const { - return m_bitfields.childNeedsOverflowRecalcAfterStyleChange(); - } - - bool isSelectionBorder() const; - - bool hasClip() const { - return isOutOfFlowPositioned() && !style()->hasAutoClip(); - } - bool hasOverflowClip() const { return m_bitfields.hasOverflowClip(); } - bool hasClipOrOverflowClip() const { return hasClip() || hasOverflowClip(); } - - bool hasTransform() const { return m_bitfields.hasTransform(); } - bool hasClipPath() const { return style() && style()->clipPath(); } - - inline bool preservesNewline() const; - - bool isRooted() const; - - // Returns the object containing this one. Can be different from parent for - // positioned elements. If paintInvalidationContainer and - // paintInvalidationContainerSkipped are not null, on return - // *paintInvalidationContainerSkipped is true if the renderer returned is an - // ancestor of paintInvalidationContainer. - RenderObject* container(const RenderBox* paintInvalidationContainer = 0, - bool* paintInvalidationContainerSkipped = 0) const; - - void markContainingBlocksForLayout(bool scheduleRelayout = true, - RenderObject* newRoot = 0, - SubtreeLayoutScope* = 0); - void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain, - SubtreeLayoutScope* = 0); - void clearNeedsLayout(); - void setChildNeedsLayout(MarkingBehavior = MarkContainingBlockChain, - SubtreeLayoutScope* = 0); - void setNeedsPositionedMovementLayout(); - void setPreferredLogicalWidthsDirty( - MarkingBehavior = MarkContainingBlockChain); - void clearPreferredLogicalWidthsDirty(); - void invalidateContainerPreferredLogicalWidths(); - - void setNeedsLayoutAndPrefWidthsRecalc() { - setNeedsLayout(); - setPreferredLogicalWidthsDirty(); - } - - void setPositionState(EPosition position) { - ASSERT(position != AbsolutePosition || isBox()); - m_bitfields.setPositionedState(position); - } - void clearPositionedState() { m_bitfields.clearPositionedState(); } - - void setInline(bool isInline) { m_bitfields.setIsInline(isInline); } - - void setIsText() { m_bitfields.setIsText(true); } - void setIsBox() { m_bitfields.setIsBox(true); } - void setReplaced(bool isReplaced) { m_bitfields.setIsReplaced(isReplaced); } - void setHasOverflowClip(bool hasOverflowClip) { - m_bitfields.setHasOverflowClip(hasOverflowClip); - } - void setHasLayer(bool hasLayer) { m_bitfields.setHasLayer(hasLayer); } - void setHasTransform(bool hasTransform) { - m_bitfields.setHasTransform(hasTransform); - } - void setHasBoxDecorationBackground(bool b) { - m_bitfields.setHasBoxDecorationBackground(b); - } - - void scheduleRelayout(); - - void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers); - void updateImage(StyleImage*, StyleImage*); - - // paintOffset is the offset from the origin of the GraphicsContext at which - // to paint the current object. - virtual void paint(PaintInfo&, - const LayoutPoint& paintOffset, - Vector& layers); - - // Subclasses must reimplement this method to compute the size and position - // of this object and all its descendants. - virtual void layout() = 0; - - /* This function performs a layout only if one is needed. */ - void layoutIfNeeded() { - if (needsLayout()) - layout(); - } - - void forceLayout(); - void forceChildLayout(); - - bool hitTest(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset); - virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&); - virtual bool nodeAtPoint(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset); - - virtual PositionWithAffinity positionForPoint(const LayoutPoint&); - PositionWithAffinity createPositionWithAffinity(int offset, EAffinity); - PositionWithAffinity createPositionWithAffinity(const Position&); - - virtual void dirtyLinesFromChangedChild(RenderObject*); - - // Set the style of the object and update the state of the object accordingly. - void setStyle(PassRefPtr); - - // Updates only the local style ptr of the object. Does not update the state - // of the object, and so only should be called when the style is known not to - // have changed (or from setStyle). - void setStyleInternal(PassRefPtr style) { m_style = style; } - - // returns the containing block level element for this element. - RenderBlock* containingBlock() const; - - // Convert the given local point to absolute coordinates - // FIXME: Temporary. If UseTransforms is true, take transforms into account. - // Eventually localToAbsolute() will always be transform-aware. - FloatPoint localToAbsolute(const FloatPoint& localPoint = FloatPoint(), - MapCoordinatesFlags = 0) const; - FloatPoint absoluteToLocal(const FloatPoint&, MapCoordinatesFlags = 0) const; - - // Convert a local quad to absolute coordinates, taking transforms into - // account. - FloatQuad localToAbsoluteQuad(const FloatQuad& quad, - MapCoordinatesFlags mode = 0) const { - return localToContainerQuad(quad, 0, mode); - } - // Convert an absolute quad to local coordinates. - FloatQuad absoluteToLocalQuad(const FloatQuad&, - MapCoordinatesFlags mode = 0) const; - - // Convert a local quad into the coordinate system of container, taking - // transforms into account. - FloatQuad localToContainerQuad(const FloatQuad&, - const RenderBox* paintInvalidatinoContainer, - MapCoordinatesFlags = 0) const; - FloatPoint localToContainerPoint(const FloatPoint&, - const RenderBox* paintInvalidationContainer, - MapCoordinatesFlags = 0) const; - - // Return the offset from the container() renderer (excluding transforms). In - // multi-column layout, different offsets apply at different points, so return - // the offset that applies to the given point. - virtual LayoutSize offsetFromContainer(const RenderObject*, - const LayoutPoint&, - bool* offsetDependsOnPoint = 0) const; - // Return the offset from an object up the container() chain. Asserts that - // none of the intermediate objects have transforms. - LayoutSize offsetFromAncestorContainer(const RenderObject*) const; - - IntRect absoluteBoundingBoxRect() const; - - // Build an array of quads in absolute coords for line boxes - virtual void absoluteQuads(Vector&) const {} - - virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } - virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } - - RenderStyle* style() const { return m_style.get(); } - - /* The two following methods are inlined in RenderObjectInlines.h */ - RenderStyle* firstLineStyle() const; - RenderStyle* style(bool firstLine) const; - - struct AppliedTextDecoration { - Color color; - TextDecorationStyle style; - AppliedTextDecoration() - : color(Color::transparent), style(TextDecorationStyleSolid) {} - }; - - void getTextDecorations(unsigned decorations, - AppliedTextDecoration& underline, - AppliedTextDecoration& overline, - AppliedTextDecoration& linethrough, - bool quirksMode = false, - bool firstlineStyle = false); - - // Overriden by RenderText for character length, used in line layout code. - virtual unsigned length() const { return 1; } - - // FIXME(sky): Remove - bool isFloatingOrOutOfFlowPositioned() const { - return isOutOfFlowPositioned(); - } - - bool isTransparent() const { return style()->hasOpacity(); } - float opacity() const { return style()->opacity(); } - - enum SelectionState { - SelectionNone, // The object is not selected. - SelectionStart, // The object either contains the start of a selection run - // or is the start of a run - SelectionInside, // The object is fully encompassed by a selection run - SelectionEnd, // The object either contains the end of a selection run or - // is the end of a run - SelectionBoth // The object contains an entire run or is the sole selected - // object in that run - }; - - // The current selection state for an object. For blocks, the state refers to - // the state of the leaf descendants (as described above in the SelectionState - // enum declaration). - SelectionState selectionState() const { return m_bitfields.selectionState(); } - virtual void setSelectionState(SelectionState state) { - m_bitfields.setSelectionState(state); - } - inline void setSelectionStateIfNeeded(SelectionState); - bool canUpdateSelectionOnRootLineBoxes(); - - virtual bool canBeSelectionLeaf() const { return false; } - bool hasSelectedChildren() const { return selectionState() != SelectionNone; } - - bool isSelectable() const; - // Obtains the selection colors that should be used when painting a selection. - Color selectionBackgroundColor() const; - Color selectionForegroundColor() const; - Color selectionEmphasisMarkColor() const; - - // Whether or not a given block needs to paint selection gaps. - virtual bool shouldPaintSelectionGaps() const { return false; } - - /** - * Returns the local coordinates of the caret within this render object. - * @param caretOffset zero-based offset determining position within the render - * object. - * @param extraWidthToEndOfLine optional out arg to give extra width to end of - * line - useful for character range rect computations - */ - virtual LayoutRect localCaretRect(InlineBox*, - int caretOffset, - LayoutUnit* extraWidthToEndOfLine = 0); - - // When performing a global document tear-down, the renderer of the document - // is cleared. We use this as a hook to detect the case of document - // destruction and don't waste time doing unnecessary work. - bool documentBeingDestroyed() const; - - virtual void destroy(); - - // Virtual function helper for the new FlexibleBox Layout (display: - // -webkit-flex). - virtual bool isFlexibleBox() const { return false; } - - virtual int caretMinOffset() const; - virtual int caretMaxOffset() const; - - virtual int previousOffset(int current) const; - virtual int previousOffsetForBackwardDeletion(int current) const; - virtual int nextOffset(int current) const; - - void selectionStartEnd(int& spos, int& epos) const; - - void remove() { - if (parent()) - parent()->removeChild(this); - } - - bool supportsTouchAction() const; - - bool visibleToHitTestRequest(const HitTestRequest& request) const { - return (request.ignorePointerEventsNone() || - style()->pointerEvents() != PE_NONE); - } - - bool visibleToHitTesting() const { - return style()->pointerEvents() != PE_NONE; - } - - // Map points and quads through elements, potentially via 3d transforms. You - // should never need to call these directly; use - // localToAbsolute/absoluteToLocal methods instead. - virtual void mapLocalToContainer( - const RenderBox* paintInvalidationContainer, - TransformState&, - MapCoordinatesFlags = ApplyContainerFlip) const; - virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, - TransformState&) const; - - // Pushes state onto RenderGeometryMap about how to map coordinates from this - // renderer to its container, or ancestorToStopAt (whichever is encountered - // first). Returns the renderer which was mapped to (container or - // ancestorToStopAt). - virtual const RenderObject* pushMappingToContainer( - const RenderBox* ancestorToStopAt, - RenderGeometryMap&) const; - - bool shouldUseTransformFromContainer(const RenderObject* container) const; - void getTransformFromContainer(const RenderObject* container, - const LayoutSize& offsetInContainer, - TransformationMatrix&) const; - - bool createsGroup() const { return isTransparent(); } - - virtual void addFocusRingRects( - Vector&, - const LayoutPoint& /* additionalOffset */, - const RenderBox* /* paintContainer */ = 0) const {}; - - RespectImageOrientationEnum shouldRespectImageOrientation() const; - - bool onlyNeededPositionedMovementLayout() const { - return m_bitfields.onlyNeededPositionedMovementLayout(); - } - void setOnlyNeededPositionedMovementLayout(bool b) { - m_bitfields.setOnlyNeededPositionedMovementLayout(b); - } - - bool neededLayoutBecauseOfChildren() const { - return m_bitfields.neededLayoutBecauseOfChildren(); - } - void setNeededLayoutBecauseOfChildren(bool b) { - m_bitfields.setNeededLayoutBecauseOfChildren(b); - } - - void setNeedsOverflowRecalcAfterStyleChange(); - void markContainingBlocksForOverflowRecalc(); - - protected: - // Overrides should call the superclass at the end. m_style will be 0 the - // first time this function will be called. - virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); - // Overrides should call the superclass at the start. |oldStyle| will be 0 the - // first time this function is called. - virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); - - void drawLineForBoxSide(GraphicsContext*, - int x1, - int y1, - int x2, - int y2, - BoxSide, - Color, - EBorderStyle, - int adjbw1, - int adjbw2, - bool antialias = false); - void drawDashedOrDottedBoxSide(GraphicsContext*, - int x1, - int y1, - int x2, - int y2, - BoxSide, - Color, - int thickness, - EBorderStyle, - bool antialias); - void drawDoubleBoxSide(GraphicsContext*, - int x1, - int y1, - int x2, - int y2, - int length, - BoxSide, - Color, - int thickness, - int adjacentWidth1, - int adjacentWidth2, - bool antialias); - void drawRidgeOrGrooveBoxSide(GraphicsContext*, - int x1, - int y1, - int x2, - int y2, - BoxSide, - Color, - EBorderStyle, - int adjacentWidth1, - int adjacentWidth2, - bool antialias); - void drawSolidBoxSide(GraphicsContext*, - int x1, - int y1, - int x2, - int y2, - BoxSide, - Color, - int adjacentWidth1, - int adjacentWidth2, - bool antialias); - - void addChildFocusRingRects(Vector&, - const LayoutPoint& additionalOffset, - const RenderBox* paintContainer) const; - - void clearLayoutRootIfNeeded() const; - virtual void willBeDestroyed(); - void postDestroy(); - - void insertedIntoTree(); - void willBeRemovedFromTree(); - - private: - bool hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor() const; - - StyleDifference adjustStyleDifference(StyleDifference) const; - - Color selectionColor() const; - -#if ENABLE(ASSERT) - void checkBlockPositionedObjectsNeedLayout(); -#endif - - // FIXME(sky): This method is just to avoid copy-paste. - // Merge container into containingBlock and then get rid of this method. - bool canContainAbsolutePositionObjects() const { - return isRenderView() || (hasTransform() && isRenderBlock()); - } - - RefPtr m_style; - - RawPtr m_parent; - RawPtr m_previous; - RawPtr m_next; - -#if ENABLE(ASSERT) - unsigned m_setNeedsLayoutForbidden : 1; -#if ENABLE(OILPAN) - protected: - unsigned m_didCallDestroy : 1; - - private: -#endif -#endif - -#define ADD_BOOLEAN_BITFIELD(name, Name) \ - private: \ - unsigned m_##name : 1; \ - \ - public: \ - bool name() const { return m_##name; } \ - void set##Name(bool name) { m_##name = name; } - - class RenderObjectBitfields { - // FIXME(sky): Remove this enum and just use EPosition directly. - enum PositionedState { - IsStaticallyPositioned = 0, - IsOutOfFlowPositioned = 1, - }; - - public: - RenderObjectBitfields() - : m_selfNeedsLayout(false), - m_onlyNeededPositionedMovementLayout(false), - m_neededLayoutBecauseOfChildren(false), - m_needsPositionedMovementLayout(false), - m_normalChildNeedsLayout(false), - m_posChildNeedsLayout(false), - m_needsSimplifiedNormalFlowLayout(false), - m_preferredLogicalWidthsDirty(false), - m_selfNeedsOverflowRecalcAfterStyleChange(false), - m_childNeedsOverflowRecalcAfterStyleChange(false), - m_isText(false), - m_isBox(false), - m_isInline(true), - m_isReplaced(false), - m_isDragging(false), - m_hasLayer(false), - m_hasOverflowClip(false), - m_hasTransform(false), - m_hasBoxDecorationBackground(false), - m_everHadLayout(false), - m_ancestorLineBoxDirty(false), - m_alwaysCreateLineBoxesForRenderInline(false), - m_positionedState(IsStaticallyPositioned), - m_selectionState(SelectionNone) {} - - // 32 bits have been used in the first word, and 11 in the second. - ADD_BOOLEAN_BITFIELD(selfNeedsLayout, SelfNeedsLayout); - ADD_BOOLEAN_BITFIELD(onlyNeededPositionedMovementLayout, - OnlyNeededPositionedMovementLayout); - ADD_BOOLEAN_BITFIELD(neededLayoutBecauseOfChildren, - NeededLayoutBecauseOfChildren); - ADD_BOOLEAN_BITFIELD(needsPositionedMovementLayout, - NeedsPositionedMovementLayout); - ADD_BOOLEAN_BITFIELD(normalChildNeedsLayout, NormalChildNeedsLayout); - ADD_BOOLEAN_BITFIELD(posChildNeedsLayout, PosChildNeedsLayout); - ADD_BOOLEAN_BITFIELD(needsSimplifiedNormalFlowLayout, - NeedsSimplifiedNormalFlowLayout); - ADD_BOOLEAN_BITFIELD(preferredLogicalWidthsDirty, - PreferredLogicalWidthsDirty); - ADD_BOOLEAN_BITFIELD(selfNeedsOverflowRecalcAfterStyleChange, - SelfNeedsOverflowRecalcAfterStyleChange); - ADD_BOOLEAN_BITFIELD(childNeedsOverflowRecalcAfterStyleChange, - ChildNeedsOverflowRecalcAfterStyleChange); - - ADD_BOOLEAN_BITFIELD(isText, IsText); - ADD_BOOLEAN_BITFIELD(isBox, IsBox); - ADD_BOOLEAN_BITFIELD(isInline, IsInline); - ADD_BOOLEAN_BITFIELD(isReplaced, IsReplaced); - ADD_BOOLEAN_BITFIELD(isDragging, IsDragging); - - ADD_BOOLEAN_BITFIELD(hasLayer, HasLayer); - ADD_BOOLEAN_BITFIELD( - hasOverflowClip, - HasOverflowClip); // Set in the case of overflow:auto/scroll/hidden - ADD_BOOLEAN_BITFIELD(hasTransform, HasTransform); - ADD_BOOLEAN_BITFIELD(hasBoxDecorationBackground, - HasBoxDecorationBackground); - - ADD_BOOLEAN_BITFIELD(everHadLayout, EverHadLayout); - ADD_BOOLEAN_BITFIELD(ancestorLineBoxDirty, AncestorLineBoxDirty); - - // from RenderInline - ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForRenderInline, - AlwaysCreateLineBoxesForRenderInline); - - private: - unsigned m_positionedState : 1; // PositionedState - unsigned m_selectionState : 3; // SelectionState - - public: - bool isOutOfFlowPositioned() const { - return m_positionedState == IsOutOfFlowPositioned; - } - bool isPositioned() const { - return m_positionedState != IsStaticallyPositioned; - } - - void setPositionedState(int positionState) { - m_positionedState = static_cast(positionState); - } - void clearPositionedState() { m_positionedState = StaticPosition; } - - ALWAYS_INLINE SelectionState selectionState() const { - return static_cast(m_selectionState); - } - ALWAYS_INLINE void setSelectionState(SelectionState selectionState) { - m_selectionState = selectionState; - } - }; - -#undef ADD_BOOLEAN_BITFIELD - - RenderObjectBitfields m_bitfields; - - void setSelfNeedsLayout(bool b) { m_bitfields.setSelfNeedsLayout(b); } - void setNeedsPositionedMovementLayout(bool b) { - m_bitfields.setNeedsPositionedMovementLayout(b); - } - void setNormalChildNeedsLayout(bool b) { - m_bitfields.setNormalChildNeedsLayout(b); - } - void setPosChildNeedsLayout(bool b) { m_bitfields.setPosChildNeedsLayout(b); } - void setNeedsSimplifiedNormalFlowLayout(bool b) { - m_bitfields.setNeedsSimplifiedNormalFlowLayout(b); - } - void setIsDragging(bool b) { m_bitfields.setIsDragging(b); } - void setEverHadLayout(bool b) { m_bitfields.setEverHadLayout(b); } - void setSelfNeedsOverflowRecalcAfterStyleChange(bool b) { - m_bitfields.setSelfNeedsOverflowRecalcAfterStyleChange(b); - } - void setChildNeedsOverflowRecalcAfterStyleChange(bool b) { - m_bitfields.setChildNeedsOverflowRecalcAfterStyleChange(b); - } - - private: - // Store state between styleWillChange and styleDidChange - static bool s_affectsParentBlock; - - static unsigned s_instanceCount; -}; - -// Allow equality comparisons of RenderObjects by reference or pointer, -// interchangeably. -DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(RenderObject) - -inline bool RenderObject::documentBeingDestroyed() const { - return false; -} - -// setNeedsLayout() won't cause full paint invalidations as -// setNeedsLayout() does. Otherwise the two methods are identical. -inline void RenderObject::setNeedsLayout(MarkingBehavior markParents, - SubtreeLayoutScope* layouter) { - ASSERT(!isSetNeedsLayoutForbidden()); - bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); - setSelfNeedsLayout(true); - if (!alreadyNeededLayout) { - if (markParents == MarkContainingBlockChain && - (!layouter || layouter->root() != this)) - markContainingBlocksForLayout(true, 0, layouter); - } -} - -inline void RenderObject::clearNeedsLayout() { - setOnlyNeededPositionedMovementLayout(needsPositionedMovementLayoutOnly()); - setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()); - setSelfNeedsLayout(false); - setEverHadLayout(true); - setPosChildNeedsLayout(false); - setNeedsSimplifiedNormalFlowLayout(false); - setNormalChildNeedsLayout(false); - setNeedsPositionedMovementLayout(false); - setAncestorLineBoxDirty(false); -#if ENABLE(ASSERT) - checkBlockPositionedObjectsNeedLayout(); -#endif -} - -inline void RenderObject::setChildNeedsLayout(MarkingBehavior markParents, - SubtreeLayoutScope* layouter) { - ASSERT(!isSetNeedsLayoutForbidden()); - bool alreadyNeededLayout = normalChildNeedsLayout(); - setNormalChildNeedsLayout(true); - // FIXME: Replace MarkOnlyThis with the SubtreeLayoutScope code path and - // remove the MarkingBehavior argument entirely. - if (!alreadyNeededLayout && markParents == MarkContainingBlockChain && - (!layouter || layouter->root() != this)) - markContainingBlocksForLayout(true, 0, layouter); -} - -inline void RenderObject::setNeedsPositionedMovementLayout() { - bool alreadyNeededLayout = needsPositionedMovementLayout(); - setNeedsPositionedMovementLayout(true); - ASSERT(!isSetNeedsLayoutForbidden()); - if (!alreadyNeededLayout) - markContainingBlocksForLayout(); -} - -inline bool RenderObject::preservesNewline() const { - return style()->preserveNewline(); -} - -inline void RenderObject::setSelectionStateIfNeeded(SelectionState state) { - if (selectionState() == state) - return; - - setSelectionState(state); -} - -#define DEFINE_RENDER_OBJECT_TYPE_CASTS(thisType, predicate) \ - DEFINE_TYPE_CASTS(thisType, RenderObject, object, object->predicate, \ - object.predicate) - -} // namespace blink - -#ifndef NDEBUG -// Outside the WebCore namespace for ease of invocation from gdb. -void showTree(const blink::RenderObject*); -void showLineTree(const blink::RenderObject*); -void showRenderTree(const blink::RenderObject* object1); -// We don't make object2 an optional parameter so that showRenderTree -// can be called from gdb easily. -void showRenderTree(const blink::RenderObject* object1, - const blink::RenderObject* object2); - -#endif - -#endif // SKY_ENGINE_CORE_RENDERING_RENDEROBJECT_H_ diff --git a/sky/engine/core/rendering/RenderObjectChildList.cpp b/sky/engine/core/rendering/RenderObjectChildList.cpp deleted file mode 100644 index 79e549ca0c778..0000000000000 --- a/sky/engine/core/rendering/RenderObjectChildList.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. - * Copyright (C) Research In Motion Limited 2010. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/RenderObjectChildList.h" - -#include "flutter/sky/engine/core/rendering/RenderObject.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" - -namespace blink { - -void RenderObjectChildList::destroyLeftoverChildren() { - while (firstChild()) - firstChild()->destroy(); -} - -RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, - RenderObject* oldChild, - bool notifyRenderer) { - ASSERT(oldChild->parent() == owner); - - if (oldChild->isFloatingOrOutOfFlowPositioned()) - toRenderBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists(); - - // So that we'll get the appropriate dirty bit set (either that a normal flow - // child got yanked or that a positioned child got yanked). We also issue - // paint invalidations, so that the area exposed when the child disappears - // gets paint invalidated properly. - if (!owner->documentBeingDestroyed() && notifyRenderer && - oldChild->everHadLayout()) - oldChild->setNeedsLayoutAndPrefWidthsRecalc(); - - // If we have a line box wrapper, delete it. - if (oldChild->isBox()) - toRenderBox(oldChild)->deleteLineBoxWrapper(); - - if (!owner->documentBeingDestroyed() && notifyRenderer) - oldChild->willBeRemovedFromTree(); - - // WARNING: There should be no code running between willBeRemovedFromTree and - // the actual removal below. This is needed to avoid race conditions where - // willBeRemovedFromTree would dirty the tree's structure and the code running - // here would force an untimely rebuilding, leaving |oldChild| dangling. - - if (oldChild->previousSibling()) - oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); - if (oldChild->nextSibling()) - oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()); - - if (firstChild() == oldChild) - setFirstChild(oldChild->nextSibling()); - if (lastChild() == oldChild) - setLastChild(oldChild->previousSibling()); - - oldChild->setPreviousSibling(0); - oldChild->setNextSibling(0); - oldChild->setParent(0); - - return oldChild; -} - -void RenderObjectChildList::insertChildNode(RenderObject* owner, - RenderObject* newChild, - RenderObject* beforeChild, - bool notifyRenderer) { - ASSERT(!newChild->parent()); - - while (beforeChild && beforeChild->parent() && beforeChild->parent() != owner) - beforeChild = beforeChild->parent(); - - // This should never happen, but if it does prevent render tree corruption - // where child->parent() ends up being owner but - // child->nextSibling()->parent() is not owner. - if (beforeChild && beforeChild->parent() != owner) { - ASSERT_NOT_REACHED(); - return; - } - - newChild->setParent(owner); - - if (firstChild() == beforeChild) - setFirstChild(newChild); - - if (beforeChild) { - RenderObject* previousSibling = beforeChild->previousSibling(); - if (previousSibling) - previousSibling->setNextSibling(newChild); - newChild->setPreviousSibling(previousSibling); - newChild->setNextSibling(beforeChild); - beforeChild->setPreviousSibling(newChild); - } else { - if (lastChild()) - lastChild()->setNextSibling(newChild); - newChild->setPreviousSibling(lastChild()); - setLastChild(newChild); - } - - if (!owner->documentBeingDestroyed() && notifyRenderer) - newChild->insertedIntoTree(); - - newChild->setNeedsLayoutAndPrefWidthsRecalc(); - if (!owner->normalChildNeedsLayout()) - owner->setChildNeedsLayout(); // We may supply the static position for an - // absolute positioned child. -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderObjectChildList.h b/sky/engine/core/rendering/RenderObjectChildList.h deleted file mode 100644 index 9c7edb8f30abf..0000000000000 --- a/sky/engine/core/rendering/RenderObjectChildList.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDEROBJECTCHILDLIST_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDEROBJECTCHILDLIST_H_ - -#include "flutter/sky/engine/platform/heap/Handle.h" -#include "flutter/sky/engine/wtf/Forward.h" - -namespace blink { - -class RenderObject; - -class RenderObjectChildList { - DISALLOW_ALLOCATION(); - - public: - RenderObjectChildList() : m_firstChild(nullptr), m_lastChild(nullptr) {} - - RenderObject* firstChild() const { return m_firstChild; } - RenderObject* lastChild() const { return m_lastChild; } - - // FIXME: Temporary while RenderBox still exists. Eventually this will just - // happen during insert/append/remove methods on the child list, and nobody - // will need to manipulate firstChild or lastChild directly. - void setFirstChild(RenderObject* child) { m_firstChild = child; } - void setLastChild(RenderObject* child) { m_lastChild = child; } - - void destroyLeftoverChildren(); - - RenderObject* removeChildNode(RenderObject* owner, - RenderObject*, - bool notifyRenderer = true); - void insertChildNode(RenderObject* owner, - RenderObject* newChild, - RenderObject* beforeChild, - bool notifyRenderer = true); - void appendChildNode(RenderObject* owner, - RenderObject* newChild, - bool notifyRenderer = true) { - insertChildNode(owner, newChild, 0, notifyRenderer); - } - - private: - RenderObject* m_firstChild; - RenderObject* m_lastChild; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDEROBJECTCHILDLIST_H_ diff --git a/sky/engine/core/rendering/RenderObjectInlines.h b/sky/engine/core/rendering/RenderObjectInlines.h deleted file mode 100644 index b985d9325869c..0000000000000 --- a/sky/engine/core/rendering/RenderObjectInlines.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDEROBJECTINLINES_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDEROBJECTINLINES_H_ - -#include "flutter/sky/engine/core/rendering/RenderObject.h" - -namespace blink { - -// The following methods are inlined for performance but not put in -// RenderObject.h because that would unnecessarily tie RenderObject.h -// to StyleEngine.h for all users of RenderObject.h that don't use -// these methods. - -inline RenderStyle* RenderObject::firstLineStyle() const { - return style(); -} - -inline RenderStyle* RenderObject::style(bool firstLine) const { - return style(); -} - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDEROBJECTINLINES_H_ diff --git a/sky/engine/core/rendering/RenderOverflow.h b/sky/engine/core/rendering/RenderOverflow.h deleted file mode 100644 index f82d196476ee9..0000000000000 --- a/sky/engine/core/rendering/RenderOverflow.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDEROVERFLOW_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDEROVERFLOW_H_ - -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" - -namespace blink { -// RenderOverflow is a class for tracking content that spills out of a box. -// This class is used by RenderBox and InlineFlowBox. -// -// There are two types of overflow: layout overflow (which is expected to be -// reachable via scrolling mechanisms) and visual overflow (which is not -// expected to be reachable via scrolling mechanisms). -// -// Layout overflow examples include other boxes that spill out of our box, For -// example, in the inline case a tall image could spill out of a line box. - -// Examples of visual overflow are shadows, text stroke (and eventually outline -// and border-image). - -// This object is allocated only when some of these fields have non-default -// values in the owning box. -class RenderOverflow { - WTF_MAKE_NONCOPYABLE(RenderOverflow); - WTF_MAKE_FAST_ALLOCATED; - - public: - RenderOverflow(const LayoutRect& layoutRect, const LayoutRect& visualRect) - : m_layoutOverflow(layoutRect), m_visualOverflow(visualRect) {} - - const LayoutRect layoutOverflowRect() const { return m_layoutOverflow; } - const LayoutRect visualOverflowRect() const { return m_visualOverflow; } - LayoutRect contentsVisualOverflowRect() const { - return m_contentsVisualOverflow; - } - - void move(LayoutUnit dx, LayoutUnit dy); - - void addLayoutOverflow(const LayoutRect&); - void addVisualOverflow(const LayoutRect&); - void addContentsVisualOverflow(const LayoutRect& rect) { - m_contentsVisualOverflow.unite(rect); - } - - void setLayoutOverflow(const LayoutRect&); - void setVisualOverflow(const LayoutRect&); - - LayoutUnit layoutClientAfterEdge() const { return m_layoutClientAfterEdge; } - void setLayoutClientAfterEdge(LayoutUnit clientAfterEdge) { - m_layoutClientAfterEdge = clientAfterEdge; - } - - private: - LayoutRect m_layoutOverflow; - LayoutRect m_visualOverflow; - LayoutRect m_contentsVisualOverflow; - - LayoutUnit m_layoutClientAfterEdge; -}; - -inline void RenderOverflow::move(LayoutUnit dx, LayoutUnit dy) { - m_layoutOverflow.move(dx, dy); - m_visualOverflow.move(dx, dy); - m_contentsVisualOverflow.move(dx, dy); -} - -inline void RenderOverflow::addLayoutOverflow(const LayoutRect& rect) { - LayoutUnit maxX = std::max(rect.maxX(), m_layoutOverflow.maxX()); - LayoutUnit maxY = std::max(rect.maxY(), m_layoutOverflow.maxY()); - LayoutUnit minX = std::min(rect.x(), m_layoutOverflow.x()); - LayoutUnit minY = std::min(rect.y(), m_layoutOverflow.y()); - // In case the width/height is larger than LayoutUnit can represent, fix the - // right/bottom edge and shift the top/left ones - m_layoutOverflow.setWidth(maxX - minX); - m_layoutOverflow.setHeight(maxY - minY); - m_layoutOverflow.setX(maxX - m_layoutOverflow.width()); - m_layoutOverflow.setY(maxY - m_layoutOverflow.height()); -} - -inline void RenderOverflow::addVisualOverflow(const LayoutRect& rect) { - LayoutUnit maxX = std::max(rect.maxX(), m_visualOverflow.maxX()); - LayoutUnit maxY = std::max(rect.maxY(), m_visualOverflow.maxY()); - m_visualOverflow.setX(std::min(rect.x(), m_visualOverflow.x())); - m_visualOverflow.setY(std::min(rect.y(), m_visualOverflow.y())); - m_visualOverflow.setWidth(maxX - m_visualOverflow.x()); - m_visualOverflow.setHeight(maxY - m_visualOverflow.y()); -} - -inline void RenderOverflow::setLayoutOverflow(const LayoutRect& rect) { - m_layoutOverflow = rect; -} - -inline void RenderOverflow::setVisualOverflow(const LayoutRect& rect) { - m_visualOverflow = rect; -} - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDEROVERFLOW_H_ diff --git a/sky/engine/core/rendering/RenderOverflowTest.cpp b/sky/engine/core/rendering/RenderOverflowTest.cpp deleted file mode 100644 index 3ab844d149c4a..0000000000000 --- a/sky/engine/core/rendering/RenderOverflowTest.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/RenderOverflow.h" - -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" - -#include - -using namespace blink; - -namespace blink { - -// FIXME: Move this somewhere more generic. -void PrintTo(const LayoutRect& rect, std::ostream* os) { - *os << "LayoutRect(" << rect.x().toFloat() << ", " << rect.y().toFloat() - << ", " << rect.width().toFloat() << ", " << rect.height().toFloat() - << ")"; -} - -} // namespace blink - -namespace { - -LayoutRect initialLayoutOverflow() { - return LayoutRect(10, 10, 80, 80); -} - -LayoutRect initialVisualOverflow() { - return LayoutRect(0, 0, 100, 100); -} - -class RenderOverflowTest : public testing::Test { - protected: - RenderOverflowTest() - : m_overflow(initialLayoutOverflow(), initialVisualOverflow()) {} - RenderOverflow m_overflow; -}; - -TEST_F(RenderOverflowTest, InitialOverflowRects) { - EXPECT_EQ(initialLayoutOverflow(), m_overflow.layoutOverflowRect()); - EXPECT_EQ(initialVisualOverflow(), m_overflow.visualOverflowRect()); - EXPECT_TRUE(m_overflow.contentsVisualOverflowRect().isEmpty()); -} - -TEST_F(RenderOverflowTest, AddLayoutOverflowOutsideExpandsRect) { - m_overflow.addLayoutOverflow(LayoutRect(0, 10, 30, 10)); - EXPECT_EQ(LayoutRect(0, 10, 90, 80), m_overflow.layoutOverflowRect()); -} - -TEST_F(RenderOverflowTest, AddLayoutOverflowInsideDoesNotAffectRect) { - m_overflow.addLayoutOverflow(LayoutRect(50, 50, 10, 20)); - EXPECT_EQ(initialLayoutOverflow(), m_overflow.layoutOverflowRect()); -} - -TEST_F(RenderOverflowTest, AddLayoutOverflowEmpty) { - // This test documents the existing behavior so that we are aware when/if - // it changes. It would also be reasonable for addLayoutOverflow to be - // a no-op in this situation. - m_overflow.addLayoutOverflow(LayoutRect(200, 200, 0, 0)); - EXPECT_EQ(LayoutRect(10, 10, 190, 190), m_overflow.layoutOverflowRect()); -} - -TEST_F(RenderOverflowTest, AddLayoutOverflowDoesNotAffectVisualOverflow) { - m_overflow.addLayoutOverflow(LayoutRect(300, 300, 300, 300)); - EXPECT_EQ(initialVisualOverflow(), m_overflow.visualOverflowRect()); -} - -TEST_F(RenderOverflowTest, - AddLayoutOverflowDoesNotAffectContentsVisualOverflow) { - m_overflow.addLayoutOverflow(LayoutRect(300, 300, 300, 300)); - EXPECT_TRUE(m_overflow.contentsVisualOverflowRect().isEmpty()); -} - -TEST_F(RenderOverflowTest, AddVisualOverflowOutsideExpandsRect) { - m_overflow.addVisualOverflow(LayoutRect(150, -50, 10, 10)); - EXPECT_EQ(LayoutRect(0, -50, 160, 150), m_overflow.visualOverflowRect()); -} - -TEST_F(RenderOverflowTest, AddVisualOverflowInsideDoesNotAffectRect) { - m_overflow.addVisualOverflow(LayoutRect(0, 10, 90, 90)); - EXPECT_EQ(initialVisualOverflow(), m_overflow.visualOverflowRect()); -} - -TEST_F(RenderOverflowTest, AddVisualOverflowEmpty) { - // This test documents the existing behavior so that we are aware when/if - // it changes. It would also be reasonable for addVisualOverflow to be - // a no-op in this situation. - m_overflow.addVisualOverflow(LayoutRect(200, 200, 0, 0)); - EXPECT_EQ(LayoutRect(0, 0, 200, 200), m_overflow.visualOverflowRect()); -} - -TEST_F(RenderOverflowTest, AddVisualOverflowDoesNotAffectLayoutOverflow) { - m_overflow.addVisualOverflow(LayoutRect(300, 300, 300, 300)); - EXPECT_EQ(initialLayoutOverflow(), m_overflow.layoutOverflowRect()); -} - -TEST_F(RenderOverflowTest, - AddVisualOverflowDoesNotAffectContentsVisualOverflow) { - m_overflow.addVisualOverflow(LayoutRect(300, 300, 300, 300)); - EXPECT_TRUE(m_overflow.contentsVisualOverflowRect().isEmpty()); -} - -TEST_F(RenderOverflowTest, AddContentsVisualOverflowFirstCall) { - m_overflow.addContentsVisualOverflow(LayoutRect(0, 0, 10, 10)); - EXPECT_EQ(LayoutRect(0, 0, 10, 10), m_overflow.contentsVisualOverflowRect()); -} - -TEST_F(RenderOverflowTest, AddContentsVisualOverflowUnitesRects) { - m_overflow.addContentsVisualOverflow(LayoutRect(0, 0, 10, 10)); - m_overflow.addContentsVisualOverflow(LayoutRect(80, 80, 10, 10)); - EXPECT_EQ(LayoutRect(0, 0, 90, 90), m_overflow.contentsVisualOverflowRect()); -} - -TEST_F(RenderOverflowTest, AddContentsVisualOverflowRectWithinRect) { - m_overflow.addContentsVisualOverflow(LayoutRect(0, 0, 10, 10)); - m_overflow.addContentsVisualOverflow(LayoutRect(2, 2, 5, 5)); - EXPECT_EQ(LayoutRect(0, 0, 10, 10), m_overflow.contentsVisualOverflowRect()); -} - -TEST_F(RenderOverflowTest, AddContentsVisualOverflowEmpty) { - // This test documents the existing behavior so that we are aware when/if - // it changes. It would also be reasonable for addContentsVisualOverflow to - // expand in this situation. - m_overflow.addContentsVisualOverflow(LayoutRect(0, 0, 10, 10)); - m_overflow.addContentsVisualOverflow(LayoutRect(20, 20, 0, 0)); - EXPECT_EQ(LayoutRect(0, 0, 10, 10), m_overflow.contentsVisualOverflowRect()); -} - -TEST_F(RenderOverflowTest, MoveAffectsLayoutOverflow) { - m_overflow.move(500, 100); - EXPECT_EQ(LayoutRect(510, 110, 80, 80), m_overflow.layoutOverflowRect()); -} - -TEST_F(RenderOverflowTest, MoveAffectsVisualOverflow) { - m_overflow.move(500, 100); - EXPECT_EQ(LayoutRect(500, 100, 100, 100), m_overflow.visualOverflowRect()); -} - -TEST_F(RenderOverflowTest, MoveAffectsContentsVisualOverflow) { - m_overflow.addContentsVisualOverflow(LayoutRect(0, 0, 10, 10)); - m_overflow.move(500, 100); - EXPECT_EQ(LayoutRect(500, 100, 10, 10), - m_overflow.contentsVisualOverflowRect()); -} - -} // namespace diff --git a/sky/engine/core/rendering/RenderParagraph.cpp b/sky/engine/core/rendering/RenderParagraph.cpp deleted file mode 100644 index 722b9fe537817..0000000000000 --- a/sky/engine/core/rendering/RenderParagraph.cpp +++ /dev/null @@ -1,1862 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/core/rendering/RenderParagraph.h" - -#include "flutter/sky/engine/core/rendering/BidiRunForLine.h" -#include "flutter/sky/engine/core/rendering/InlineIterator.h" -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderObjectInlines.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/core/rendering/TextRunConstructor.h" -#include "flutter/sky/engine/core/rendering/VerticalPositionCache.h" -#include "flutter/sky/engine/core/rendering/line/BreakingContextInlineHeaders.h" -#include "flutter/sky/engine/core/rendering/line/LineLayoutState.h" -#include "flutter/sky/engine/core/rendering/line/LineWidth.h" -#include "flutter/sky/engine/core/rendering/line/RenderTextInfo.h" -#include "flutter/sky/engine/core/rendering/line/WordMeasurement.h" -#include "flutter/sky/engine/platform/fonts/Character.h" -#include "flutter/sky/engine/platform/text/BidiResolver.h" -#include "flutter/sky/engine/wtf/RefCountedLeakCounter.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -namespace blink { - -using namespace WTF::Unicode; - -RenderParagraph::RenderParagraph() : m_didExceedMaxLines(false) {} - -RenderParagraph::~RenderParagraph() {} - -const char* RenderParagraph::renderName() const { - return "RenderParagraph"; -} - -LayoutUnit RenderParagraph::logicalLeftSelectionOffset(RenderBlock* rootBlock, - LayoutUnit position) { - LayoutUnit logicalLeft = logicalLeftOffsetForLine(false); - if (logicalLeft == logicalLeftOffsetForContent()) - return RenderBlock::logicalLeftSelectionOffset(rootBlock, position); - - RenderBlock* cb = this; - while (cb != rootBlock) { - logicalLeft += cb->logicalLeft(); - cb = cb->containingBlock(); - } - return logicalLeft; -} - -LayoutUnit RenderParagraph::logicalRightSelectionOffset(RenderBlock* rootBlock, - LayoutUnit position) { - LayoutUnit logicalRight = logicalRightOffsetForLine(false); - if (logicalRight == logicalRightOffsetForContent()) - return RenderBlock::logicalRightSelectionOffset(rootBlock, position); - - RenderBlock* cb = this; - while (cb != rootBlock) { - logicalRight += cb->logicalLeft(); - cb = cb->containingBlock(); - } - return logicalRight; -} - -RootInlineBox* RenderParagraph::lineAtIndex(int i) const { - ASSERT(i >= 0); - - for (RootInlineBox* box = firstRootBox(); box; box = box->nextRootBox()) { - if (!i--) - return box; - } - - return 0; -} - -int RenderParagraph::lineCount(const RootInlineBox* stopRootInlineBox, - bool* found) const { - int count = 0; - for (RootInlineBox* box = firstRootBox(); box; box = box->nextRootBox()) { - count++; - if (box == stopRootInlineBox) { - if (found) - *found = true; - break; - } - } - - return count; -} - -void RenderParagraph::deleteLineBoxTree() { - m_lineBoxes.deleteLineBoxTree(); -} - -GapRects RenderParagraph::inlineSelectionGaps( - RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - LayoutUnit& lastLogicalTop, - LayoutUnit& lastLogicalLeft, - LayoutUnit& lastLogicalRight, - const PaintInfo* paintInfo) { - GapRects result; - - bool containsStart = - selectionState() == SelectionStart || selectionState() == SelectionBoth; - - if (!firstLineBox()) { - if (containsStart) { - // Go ahead and update our lastLogicalTop to be the bottom of the block. - //
s or empty blocks with height can trip this case. - lastLogicalTop = rootBlock->blockDirectionOffset(offsetFromRootBlock) + - logicalHeight(); - lastLogicalLeft = logicalLeftSelectionOffset(rootBlock, logicalHeight()); - lastLogicalRight = - logicalRightSelectionOffset(rootBlock, logicalHeight()); - } - return result; - } - - RootInlineBox* lastSelectedLine = 0; - RootInlineBox* curr; - for (curr = firstRootBox(); curr && !curr->hasSelectedChildren(); - curr = curr->nextRootBox()) { - } - - // Now paint the gaps for the lines. - for (; curr && curr->hasSelectedChildren(); curr = curr->nextRootBox()) { - LayoutUnit selTop = curr->selectionTopAdjustedForPrecedingBlock(); - LayoutUnit selHeight = curr->selectionHeightAdjustedForPrecedingBlock(); - - if (!containsStart && !lastSelectedLine && - selectionState() != SelectionStart && - selectionState() != SelectionBoth) { - result.uniteCenter(blockSelectionGap(rootBlock, rootBlockPhysicalPosition, - offsetFromRootBlock, lastLogicalTop, - lastLogicalLeft, lastLogicalRight, - selTop, paintInfo)); - } - - LayoutRect logicalRect(curr->logicalLeft(), selTop, curr->logicalWidth(), - selTop + selHeight); - logicalRect.move(offsetFromRootBlock); - LayoutRect physicalRect = rootBlock->logicalRectToPhysicalRect( - rootBlockPhysicalPosition, logicalRect); - if (!paintInfo || (physicalRect.y() < paintInfo->rect.maxY() && - physicalRect.maxY() > paintInfo->rect.y())) - result.unite(curr->lineSelectionGap(rootBlock, rootBlockPhysicalPosition, - offsetFromRootBlock, selTop, - selHeight, paintInfo)); - - lastSelectedLine = curr; - } - - if (containsStart && !lastSelectedLine) { - // VisibleSelection must start just after our last line. - lastSelectedLine = lastRootBox(); - } - - if (lastSelectedLine && selectionState() != SelectionEnd && - selectionState() != SelectionBoth) { - // Go ahead and update our lastY to be the bottom of the last selected line. - lastLogicalTop = rootBlock->blockDirectionOffset(offsetFromRootBlock) + - lastSelectedLine->selectionBottom(); - lastLogicalLeft = logicalLeftSelectionOffset( - rootBlock, lastSelectedLine->selectionBottom()); - lastLogicalRight = logicalRightSelectionOffset( - rootBlock, lastSelectedLine->selectionBottom()); - } - return result; -} - -void RenderParagraph::addOverflowFromChildren() { - LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : LayoutUnit(); - for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) { - addLayoutOverflow(curr->paddedLayoutOverflowRect(endPadding)); - LayoutRect visualOverflow = - curr->visualOverflowRect(curr->lineTop(), curr->lineBottom()); - addContentsVisualOverflow(visualOverflow); - } -} - -void RenderParagraph::simplifiedNormalFlowLayout() { - ListHashSet lineBoxes; - for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) { - RenderObject* o = walker.current(); - if (!o->isOutOfFlowPositioned() && o->isReplaced()) { - o->layoutIfNeeded(); - if (toRenderBox(o)->inlineBoxWrapper()) { - RootInlineBox& box = toRenderBox(o)->inlineBoxWrapper()->root(); - lineBoxes.add(&box); - } - } else if (o->isText() || - (o->isRenderInline() && !walker.atEndOfInline())) { - o->clearNeedsLayout(); - } - } - - // FIXME: Glyph overflow will get lost in this case, but not really a big - // deal. - GlyphOverflowAndFallbackFontsMap textBoxDataMap; - for (ListHashSet::const_iterator it = lineBoxes.begin(); - it != lineBoxes.end(); ++it) { - RootInlineBox* box = *it; - box->computeOverflow(box->lineTop(), box->lineBottom(), textBoxDataMap); - } -} - -void RenderParagraph::paintChildren(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - Vector& layers) { - m_lineBoxes.paint(this, paintInfo, paintOffset, layers); - - for (RenderObject* child = firstChild(); child; - child = child->nextSibling()) { - // TODO(ojan): This is wrong at the moment. Inlines can have self painting - // layers as well. Either make inlines with self-painting layers work or - // don't allow inlines to be self painting. - if (child->isBox()) { - RenderBox* box = toRenderBox(child); - if (box->hasSelfPaintingLayer()) - layers.append(box); - } - } -} - -bool RenderParagraph::hitTestContents( - const HitTestRequest& request, - HitTestResult& result, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) { - return m_lineBoxes.hitTest(this, request, result, locationInContainer, - accumulatedOffset); -} - -void RenderParagraph::markLinesDirtyInBlockRange(LayoutUnit logicalTop, - LayoutUnit logicalBottom, - RootInlineBox* highest) { - if (logicalTop >= logicalBottom) - return; - - RootInlineBox* lowestDirtyLine = lastRootBox(); - RootInlineBox* afterLowest = lowestDirtyLine; - while (lowestDirtyLine && - lowestDirtyLine->lineBottomWithLeading() >= logicalBottom && - logicalBottom < LayoutUnit::max()) { - afterLowest = lowestDirtyLine; - lowestDirtyLine = lowestDirtyLine->prevRootBox(); - } - - while (afterLowest && afterLowest != highest && - (afterLowest->lineBottomWithLeading() >= logicalTop || - afterLowest->lineBottomWithLeading() < 0)) { - afterLowest->markDirty(); - afterLowest = afterLowest->prevRootBox(); - } -} - -static void updateLogicalWidthForLeftAlignedBlock(bool isLeftToRightDirection, - BidiRun* trailingSpaceRun, - float& logicalLeft, - float& totalLogicalWidth, - float availableLogicalWidth) { - // The direction of the block should determine what happens with wide lines. - // In particular with RTL blocks, wide lines should still spill out to the - // left. - if (isLeftToRightDirection) { - if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun) - trailingSpaceRun->m_box->setLogicalWidth( - std::max(0, trailingSpaceRun->m_box->logicalWidth() - - totalLogicalWidth + availableLogicalWidth)); - return; - } - - if (trailingSpaceRun) - trailingSpaceRun->m_box->setLogicalWidth(0); - else if (totalLogicalWidth > availableLogicalWidth) - logicalLeft -= (totalLogicalWidth - availableLogicalWidth); -} - -static void updateLogicalWidthForRightAlignedBlock( - bool isLeftToRightDirection, - BidiRun* trailingSpaceRun, - float& logicalLeft, - float& totalLogicalWidth, - float availableLogicalWidth) { - // Wide lines spill out of the block based off direction. - // So even if text-align is right, if direction is LTR, wide lines should - // overflow out of the right side of the block. - if (isLeftToRightDirection) { - if (trailingSpaceRun) { - totalLogicalWidth -= trailingSpaceRun->m_box->logicalWidth(); - trailingSpaceRun->m_box->setLogicalWidth(0); - } - if (totalLogicalWidth < availableLogicalWidth) - logicalLeft += availableLogicalWidth - totalLogicalWidth; - return; - } - - if (totalLogicalWidth > availableLogicalWidth && trailingSpaceRun) { - trailingSpaceRun->m_box->setLogicalWidth( - std::max(0, trailingSpaceRun->m_box->logicalWidth() - - totalLogicalWidth + availableLogicalWidth)); - totalLogicalWidth -= trailingSpaceRun->m_box->logicalWidth(); - } else - logicalLeft += availableLogicalWidth - totalLogicalWidth; -} - -static void updateLogicalWidthForCenterAlignedBlock( - bool isLeftToRightDirection, - BidiRun* trailingSpaceRun, - float& logicalLeft, - float& totalLogicalWidth, - float availableLogicalWidth) { - float trailingSpaceWidth = 0; - if (trailingSpaceRun) { - totalLogicalWidth -= trailingSpaceRun->m_box->logicalWidth(); - trailingSpaceWidth = - std::min(trailingSpaceRun->m_box->logicalWidth(), - (availableLogicalWidth - totalLogicalWidth + 1) / 2); - trailingSpaceRun->m_box->setLogicalWidth( - std::max(0, trailingSpaceWidth)); - } - if (isLeftToRightDirection) - logicalLeft += - std::max((availableLogicalWidth - totalLogicalWidth) / 2, 0); - else - logicalLeft += totalLogicalWidth > availableLogicalWidth - ? (availableLogicalWidth - totalLogicalWidth) - : (availableLogicalWidth - totalLogicalWidth) / 2 - - trailingSpaceWidth; -} - -void RenderParagraph::updateLogicalWidthForAlignment( - const ETextAlign& textAlign, - const RootInlineBox* rootInlineBox, - BidiRun* trailingSpaceRun, - float& logicalLeft, - float& totalLogicalWidth, - float& availableLogicalWidth, - unsigned expansionOpportunityCount) { - TextDirection direction; - if (rootInlineBox && - rootInlineBox->renderer().style()->unicodeBidi() == Plaintext) - direction = rootInlineBox->direction(); - else - direction = style()->direction(); - - // Armed with the total width of the line (without justification), - // we now examine our text-align property in order to determine where to - // position the objects horizontally. The total width of the line can be - // increased if we end up justifying text. - switch (textAlign) { - case LEFT: - updateLogicalWidthForLeftAlignedBlock( - style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, - totalLogicalWidth, availableLogicalWidth); - break; - case RIGHT: - updateLogicalWidthForRightAlignedBlock( - style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, - totalLogicalWidth, availableLogicalWidth); - break; - case CENTER: - updateLogicalWidthForCenterAlignedBlock( - style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, - totalLogicalWidth, availableLogicalWidth); - break; - case JUSTIFY: - adjustInlineDirectionLineBounds(expansionOpportunityCount, logicalLeft, - availableLogicalWidth); - if (expansionOpportunityCount) { - if (trailingSpaceRun) { - totalLogicalWidth -= trailingSpaceRun->m_box->logicalWidth(); - trailingSpaceRun->m_box->setLogicalWidth(0); - } - break; - } - // Fall through - case TASTART: - if (direction == LTR) - updateLogicalWidthForLeftAlignedBlock( - style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, - totalLogicalWidth, availableLogicalWidth); - else - updateLogicalWidthForRightAlignedBlock( - style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, - totalLogicalWidth, availableLogicalWidth); - break; - case TAEND: - if (direction == LTR) - updateLogicalWidthForRightAlignedBlock( - style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, - totalLogicalWidth, availableLogicalWidth); - else - updateLogicalWidthForLeftAlignedBlock( - style()->isLeftToRightDirection(), trailingSpaceRun, logicalLeft, - totalLogicalWidth, availableLogicalWidth); - break; - } -} - -RootInlineBox* RenderParagraph::createAndAppendRootInlineBox() { - RootInlineBox* rootBox = createRootInlineBox(); - m_lineBoxes.appendLineBox(rootBox); - return rootBox; -} - -RootInlineBox* RenderParagraph::createRootInlineBox() { - return new RootInlineBox(*this); -} - -InlineBox* RenderParagraph::createInlineBoxForRenderer(RenderObject* obj, - bool isRootLineBox, - bool isOnlyRun) { - if (isRootLineBox) - return toRenderParagraph(obj)->createAndAppendRootInlineBox(); - - if (obj->isText()) { - InlineTextBox* textBox = toRenderText(obj)->createInlineTextBox(); - // We only treat a box as text for a
if we are on a line by ourself or - // in strict mode (Note the use of strict mode. In "almost strict" mode, we - // don't treat the box for
as text.) - return textBox; - } - - if (obj->isBox()) - return toRenderBox(obj)->createInlineBox(); - - return toRenderInline(obj)->createAndAppendInlineFlowBox(); -} - -static inline void dirtyLineBoxesForRenderer(RenderObject* o, bool fullLayout) { - if (o->isText()) { - RenderText* renderText = toRenderText(o); - renderText->dirtyLineBoxes(fullLayout); - } else - toRenderInline(o)->dirtyLineBoxes(fullLayout); -} - -static bool parentIsConstructedOrHaveNext(InlineFlowBox* parentBox) { - do { - if (parentBox->isConstructed() || parentBox->nextOnLine()) - return true; - parentBox = parentBox->parent(); - } while (parentBox); - return false; -} - -InlineFlowBox* RenderParagraph::createLineBoxes(RenderObject* obj, - const LineInfo& lineInfo, - InlineBox* childBox) { - // See if we have an unconstructed line box for this object that is also - // the last item on the line. - unsigned lineDepth = 1; - InlineFlowBox* parentBox = 0; - InlineFlowBox* result = 0; - bool hasDefaultLineBoxContain = - style()->lineBoxContain() == RenderStyle::initialLineBoxContain(); - do { - ASSERT_WITH_SECURITY_IMPLICATION(obj->isRenderInline() || obj == this); - - RenderInline* inlineFlow = (obj != this) ? toRenderInline(obj) : 0; - - // Get the last box we made for this render object. - parentBox = inlineFlow ? inlineFlow->lastLineBox() - : toRenderBlock(obj)->lastLineBox(); - - // If this box or its ancestor is constructed then it is from a previous - // line, and we need to make a new box for our line. If this box or its - // ancestor is unconstructed but it has something following it on the line, - // then we know we have to make a new box as well. In this situation our - // inline has actually been split in two on the same line (this can happen - // with very fancy language mixtures). - bool constructedNewBox = false; - bool allowedToConstructNewBox = !hasDefaultLineBoxContain || !inlineFlow || - inlineFlow->alwaysCreateLineBoxes(); - bool canUseExistingParentBox = - parentBox && !parentIsConstructedOrHaveNext(parentBox); - if (allowedToConstructNewBox && !canUseExistingParentBox) { - // We need to make a new box for this render object. Once - // made, we need to place it at the end of the current line. - InlineBox* newBox = createInlineBoxForRenderer(obj, obj == this); - ASSERT_WITH_SECURITY_IMPLICATION(newBox->isInlineFlowBox()); - parentBox = toInlineFlowBox(newBox); - parentBox->setFirstLineStyleBit(lineInfo.isFirstLine()); - if (!hasDefaultLineBoxContain) - parentBox->clearDescendantsHaveSameLineHeightAndBaseline(); - constructedNewBox = true; - } - - if (constructedNewBox || canUseExistingParentBox) { - if (!result) - result = parentBox; - - // If we have hit the block itself, then |box| represents the root - // inline box for the line, and it doesn't have to be appended to any - // parent inline. - if (childBox) - parentBox->addToLine(childBox); - - if (!constructedNewBox || obj == this) - break; - - childBox = parentBox; - } - - // If we've exceeded our line depth, then jump straight to the root and skip - // all the remaining intermediate inline flows. - obj = (++lineDepth >= cMaxLineDepth) ? this : obj->parent(); - - } while (true); - - return result; -} - -template -static inline bool endsWithASCIISpaces(const CharacterType* characters, - unsigned pos, - unsigned end) { - while (isASCIISpace(characters[pos])) { - pos++; - if (pos >= end) - return true; - } - return false; -} - -static bool reachedEndOfTextRenderer(const BidiRunList& bidiRuns) { - BidiRun* run = bidiRuns.logicallyLastRun(); - if (!run) - return true; - unsigned pos = run->stop(); - RenderObject* r = run->m_object; - if (!r->isText()) - return false; - RenderText* renderText = toRenderText(r); - unsigned length = renderText->textLength(); - if (pos >= length) - return true; - - if (renderText->is8Bit()) - return endsWithASCIISpaces(renderText->characters8(), pos, length); - return endsWithASCIISpaces(renderText->characters16(), pos, length); -} - -RootInlineBox* RenderParagraph::constructLine(BidiRunList& bidiRuns, - const LineInfo& lineInfo) { - ASSERT(bidiRuns.firstRun()); - - bool rootHasSelectedChildren = false; - InlineFlowBox* parentBox = 0; - int runCount = bidiRuns.runCount() - lineInfo.runsFromLeadingWhitespace(); - for (BidiRun* r = bidiRuns.firstRun(); r; r = r->next()) { - // Create a box for our object. - bool isOnlyRun = (runCount == 1); - if (runCount == 2) - isOnlyRun = false; - - if (lineInfo.isEmpty()) - continue; - - InlineBox* box = createInlineBoxForRenderer(r->m_object, false, isOnlyRun); - r->m_box = box; - - ASSERT(box); - if (!box) - continue; - - if (!rootHasSelectedChildren && - box->renderer().selectionState() != RenderObject::SelectionNone) - rootHasSelectedChildren = true; - - // If we have no parent box yet, or if the run is not simply a sibling, - // then we need to construct inline boxes as necessary to properly enclose - // the run's inline box. Segments can only be siblings at the root level, as - // they are positioned separately. - if (!parentBox || parentBox->renderer() != r->m_object->parent()) { - // Create new inline boxes all the way back to the appropriate insertion - // point. - parentBox = createLineBoxes(r->m_object->parent(), lineInfo, box); - } else { - // Append the inline box to this line. - parentBox->addToLine(box); - } - - box->setBidiLevel(r->level()); - - if (box->isInlineTextBox()) { - InlineTextBox* text = toInlineTextBox(box); - text->setStart(r->m_start); - text->setLen(r->m_stop - r->m_start); - text->setDirOverride(r->dirOverride()); - if (r->m_hasHyphen) - text->setHasHyphen(true); - if (r->m_hasAddedEllipsis) - text->setHasAddedEllipsis(true); - } - } - - ASSERT(lastLineBox() && !lastLineBox()->isConstructed()); - - // Set the m_selectedChildren flag on the root inline box if one of the leaf - // inline box from the bidi runs walk above has a selection state. - if (rootHasSelectedChildren) - lastLineBox()->root().setHasSelectedChildren(true); - - // Set bits on our inline flow boxes that indicate which sides should - // paint borders/margins/padding. This knowledge will ultimately be used when - // we determine the horizontal positions and widths of all the inline boxes on - // the line. - bool isLogicallyLastRunWrapped = - bidiRuns.logicallyLastRun()->m_object && - bidiRuns.logicallyLastRun()->m_object->isText() - ? !reachedEndOfTextRenderer(bidiRuns) - : true; - lastLineBox()->determineSpacingForFlowBoxes( - lineInfo.isLastLine(), isLogicallyLastRunWrapped, - bidiRuns.logicallyLastRun()->m_object); - - // Now mark the line boxes as being constructed. - lastLineBox()->setConstructed(); - - // Return the last line. - return lastRootBox(); -} - -ETextAlign RenderParagraph::textAlignmentForLine(bool endsWithSoftBreak) const { - ETextAlign alignment = style()->textAlign(); - if (endsWithSoftBreak) - return alignment; - return (alignment == JUSTIFY) ? TASTART : alignment; -} - -static inline void setLogicalWidthForTextRun( - RootInlineBox* lineBox, - BidiRun* run, - RenderText* renderer, - float xPos, - const LineInfo& lineInfo, - GlyphOverflowAndFallbackFontsMap& textBoxDataMap, - VerticalPositionCache& verticalPositionCache, - WordMeasurements& wordMeasurements) { - HashSet fallbackFonts; - GlyphOverflow glyphOverflow; - - const Font& font = renderer->style(lineInfo.isFirstLine())->font(); - // Always compute glyph overflow if the block's line-box-contain value is - // "glyphs". - if (lineBox->fitsToGlyphs()) { - // If we don't stick out of the root line's font box, then don't bother - // computing our glyph overflow. This optimization will keep us from - // computing glyph bounds in nearly all cases. - bool includeRootLine = lineBox->includesRootLineBoxFontOrLeading(); - int baselineShift = - lineBox->verticalPositionForBox(run->m_box, verticalPositionCache); - int rootDescent = includeRootLine ? font.fontMetrics().descent() : 0; - int rootAscent = includeRootLine ? font.fontMetrics().ascent() : 0; - int boxAscent = font.fontMetrics().ascent() - baselineShift; - int boxDescent = font.fontMetrics().descent() + baselineShift; - if (boxAscent > rootDescent || boxDescent > rootAscent) - glyphOverflow.computeBounds = true; - } - - LayoutUnit hyphenWidth = 0; - if (toInlineTextBox(run->m_box)->hasHyphen()) { - const Font& font = renderer->style(lineInfo.isFirstLine())->font(); - hyphenWidth = measureHyphenWidth(renderer, font, run->direction()); - } - float measuredWidth = 0; - - bool kerningIsEnabled = - font.fontDescription().typesettingFeatures() & Kerning; - - bool canUseSimpleFontCodePath = renderer->canUseSimpleFontCodePath(); - - // Since we don't cache glyph overflows, we need to re-measure the run if - // the style is linebox-contain: glyph. - - if (!lineBox->fitsToGlyphs() && canUseSimpleFontCodePath) { - int lastEndOffset = run->m_start; - for (size_t i = 0, size = wordMeasurements.size(); - i < size && lastEndOffset < run->m_stop; ++i) { - const WordMeasurement& wordMeasurement = wordMeasurements[i]; - if (wordMeasurement.width <= 0 || - wordMeasurement.startOffset == wordMeasurement.endOffset) - continue; - if (wordMeasurement.renderer != renderer || - wordMeasurement.startOffset != lastEndOffset || - wordMeasurement.endOffset > run->m_stop) - continue; - - lastEndOffset = wordMeasurement.endOffset; - if (kerningIsEnabled && lastEndOffset == run->m_stop) { - int wordLength = lastEndOffset - wordMeasurement.startOffset; - measuredWidth += - renderer->width(wordMeasurement.startOffset, wordLength, xPos, - run->direction(), lineInfo.isFirstLine()); - if (i > 0 && wordLength == 1 && - renderer->characterAt(wordMeasurement.startOffset) == ' ') - measuredWidth += renderer->style()->wordSpacing(); - } else - measuredWidth += wordMeasurement.width; - if (!wordMeasurement.fallbackFonts.isEmpty()) { - HashSet::const_iterator end = - wordMeasurement.fallbackFonts.end(); - for (HashSet::const_iterator it = - wordMeasurement.fallbackFonts.begin(); - it != end; ++it) - fallbackFonts.add(*it); - } - } - if (measuredWidth && lastEndOffset != run->m_stop) { - // If we don't have enough cached data, we'll measure the run again. - measuredWidth = 0; - fallbackFonts.clear(); - } - } - - if (!measuredWidth) - measuredWidth = renderer->width( - run->m_start, run->m_stop - run->m_start, xPos, run->direction(), - lineInfo.isFirstLine(), &fallbackFonts, &glyphOverflow); - - run->m_box->setLogicalWidth(measuredWidth + hyphenWidth); - if (!fallbackFonts.isEmpty()) { - ASSERT(run->m_box->isText()); - GlyphOverflowAndFallbackFontsMap::ValueType* it = - textBoxDataMap - .add(toInlineTextBox(run->m_box), - std::make_pair(Vector(), - GlyphOverflow())) - .storedValue; - ASSERT(it->value.first.isEmpty()); - copyToVector(fallbackFonts, it->value.first); - run->m_box->parent()->clearDescendantsHaveSameLineHeightAndBaseline(); - } - if (!glyphOverflow.isZero()) { - ASSERT(run->m_box->isText()); - GlyphOverflowAndFallbackFontsMap::ValueType* it = - textBoxDataMap - .add(toInlineTextBox(run->m_box), - std::make_pair(Vector(), - GlyphOverflow())) - .storedValue; - it->value.second = glyphOverflow; - run->m_box->clearKnownToHaveNoOverflow(); - } -} - -static inline void computeExpansionForJustifiedText( - BidiRun* firstRun, - BidiRun* trailingSpaceRun, - Vector& expansionOpportunities, - unsigned expansionOpportunityCount, - float& totalLogicalWidth, - float availableLogicalWidth) { - if (!expansionOpportunityCount || availableLogicalWidth <= totalLogicalWidth) - return; - - size_t i = 0; - for (BidiRun* r = firstRun; r; r = r->next()) { - if (!r->m_box || r == trailingSpaceRun) - continue; - - if (r->m_object->isText()) { - unsigned opportunitiesInRun = expansionOpportunities[i++]; - - ASSERT(opportunitiesInRun <= expansionOpportunityCount); - - // Don't justify for white-space: pre. - if (r->m_object->style()->whiteSpace() != PRE) { - InlineTextBox* textBox = toInlineTextBox(r->m_box); - int expansion = (availableLogicalWidth - totalLogicalWidth) * - opportunitiesInRun / expansionOpportunityCount; - textBox->setExpansion(expansion); - totalLogicalWidth += expansion; - } - expansionOpportunityCount -= opportunitiesInRun; - if (!expansionOpportunityCount) - break; - } - } -} - -static void updateLogicalInlinePositions(RenderParagraph* block, - float& lineLogicalLeft, - float& lineLogicalRight, - float& availableLogicalWidth, - IndentTextOrNot shouldIndentText) { - lineLogicalLeft = - block->logicalLeftOffsetForLine(shouldIndentText == IndentText).toFloat(); - lineLogicalRight = - block->logicalRightOffsetForLine(shouldIndentText == IndentText) - .toFloat(); - availableLogicalWidth = lineLogicalRight - lineLogicalLeft; -} - -void RenderParagraph::computeInlineDirectionPositionsForLine( - RootInlineBox* lineBox, - const LineInfo& lineInfo, - BidiRun* firstRun, - BidiRun* trailingSpaceRun, - bool reachedEnd, - GlyphOverflowAndFallbackFontsMap& textBoxDataMap, - VerticalPositionCache& verticalPositionCache, - WordMeasurements& wordMeasurements) { - ETextAlign textAlign = - textAlignmentForLine(!reachedEnd && !lineBox->endsWithBreak()); - - // CSS 2.1: "'Text-indent' only affects a line if it is the first formatted - // line of an element. For example, the first line of an anonymous block box - // is only affected if it is the first child of its parent element." CSS3 - // "text-indent", "each-line" affects the first line of the block container as - // well as each line after a forced line break, but does not affect lines - // after a soft wrap break. - bool isFirstLine = lineInfo.isFirstLine(); - bool isAfterHardLineBreak = - lineBox->prevRootBox() && lineBox->prevRootBox()->endsWithBreak(); - IndentTextOrNot shouldIndentText = - requiresIndent(isFirstLine, isAfterHardLineBreak, style()); - float lineLogicalLeft; - float lineLogicalRight; - float availableLogicalWidth; - updateLogicalInlinePositions(this, lineLogicalLeft, lineLogicalRight, - availableLogicalWidth, shouldIndentText); - bool needsWordSpacing; - - if (firstRun && firstRun->m_object->isReplaced()) - updateLogicalInlinePositions(this, lineLogicalLeft, lineLogicalRight, - availableLogicalWidth, shouldIndentText); - - computeInlineDirectionPositionsForSegment( - lineBox, lineInfo, textAlign, lineLogicalLeft, availableLogicalWidth, - firstRun, trailingSpaceRun, textBoxDataMap, verticalPositionCache, - wordMeasurements); - // The widths of all runs are now known. We can now place every inline box - // (and compute accurate widths for the inline flow boxes). - needsWordSpacing = false; - lineBox->placeBoxesInInlineDirection(lineLogicalLeft, needsWordSpacing); -} - -BidiRun* RenderParagraph::computeInlineDirectionPositionsForSegment( - RootInlineBox* lineBox, - const LineInfo& lineInfo, - ETextAlign textAlign, - float& logicalLeft, - float& availableLogicalWidth, - BidiRun* firstRun, - BidiRun* trailingSpaceRun, - GlyphOverflowAndFallbackFontsMap& textBoxDataMap, - VerticalPositionCache& verticalPositionCache, - WordMeasurements& wordMeasurements) { - bool needsWordSpacing = true; - float totalLogicalWidth = lineBox->getFlowSpacingLogicalWidth().toFloat(); - unsigned expansionOpportunityCount = 0; - bool isAfterExpansion = true; - Vector expansionOpportunities; - TextJustify textJustify = style()->textJustify(); - - BidiRun* r = firstRun; - for (; r; r = r->next()) { - if (!r->m_box || r->m_object->isOutOfFlowPositioned() || - r->m_box->isLineBreak()) - continue; // Positioned objects are only participating to figure out - // their correct static x position. They have no effect on the - // width. Similarly, line break boxes have no effect on the - // width. - if (r->m_object->isText()) { - RenderText* rt = toRenderText(r->m_object); - if (textAlign == JUSTIFY && r != trailingSpaceRun && - textJustify != TextJustifyNone) { - if (!isAfterExpansion) - toInlineTextBox(r->m_box)->setCanHaveLeadingExpansion(true); - unsigned opportunitiesInRun; - if (rt->is8Bit()) - opportunitiesInRun = Character::expansionOpportunityCount( - rt->characters8() + r->m_start, r->m_stop - r->m_start, - r->m_box->direction(), isAfterExpansion); - else - opportunitiesInRun = Character::expansionOpportunityCount( - rt->characters16() + r->m_start, r->m_stop - r->m_start, - r->m_box->direction(), isAfterExpansion); - expansionOpportunities.append(opportunitiesInRun); - expansionOpportunityCount += opportunitiesInRun; - } - - if (rt->textLength()) { - if (!r->m_start && needsWordSpacing && - isSpaceOrNewline(rt->characterAt(r->m_start))) - totalLogicalWidth += rt->style(lineInfo.isFirstLine()) - ->font() - .fontDescription() - .wordSpacing(); - needsWordSpacing = !isSpaceOrNewline(rt->characterAt(r->m_stop - 1)); - } - - setLogicalWidthForTextRun(lineBox, r, rt, totalLogicalWidth, lineInfo, - textBoxDataMap, verticalPositionCache, - wordMeasurements); - } else { - isAfterExpansion = false; - if (!r->m_object->isRenderInline()) { - RenderBox* renderBox = toRenderBox(r->m_object); - r->m_box->setLogicalWidth(logicalWidthForChild(renderBox).toFloat()); - totalLogicalWidth += - marginStartForChild(renderBox) + marginEndForChild(renderBox); - } - } - - totalLogicalWidth += r->m_box->logicalWidth(); - } - - if (isAfterExpansion && !expansionOpportunities.isEmpty()) { - expansionOpportunities.last()--; - expansionOpportunityCount--; - } - - updateLogicalWidthForAlignment( - textAlign, lineBox, trailingSpaceRun, logicalLeft, totalLogicalWidth, - availableLogicalWidth, expansionOpportunityCount); - - computeExpansionForJustifiedText( - firstRun, trailingSpaceRun, expansionOpportunities, - expansionOpportunityCount, totalLogicalWidth, availableLogicalWidth); - - return r; -} - -void RenderParagraph::computeBlockDirectionPositionsForLine( - RootInlineBox* lineBox, - BidiRun* firstRun, - GlyphOverflowAndFallbackFontsMap& textBoxDataMap, - VerticalPositionCache& verticalPositionCache) { - setLogicalHeight(lineBox->alignBoxesInBlockDirection( - logicalHeight(), textBoxDataMap, verticalPositionCache)); - - // Now make sure we place replaced render objects correctly. - for (BidiRun* r = firstRun; r; r = r->next()) { - ASSERT(r->m_box); - if (!r->m_box) - continue; // Skip runs with no line boxes. - - // Align positioned boxes with the top of the line box. This is - // a reasonable approximation of an appropriate y position. - if (r->m_object->isOutOfFlowPositioned()) - r->m_box->setLogicalTop(logicalHeight().toFloat()); - - // Position is used to properly position both replaced elements and - // to update the static normal flow x/y of positioned elements. - if (r->m_object->isText()) - toRenderText(r->m_object)->positionLineBox(r->m_box); - else if (r->m_object->isBox()) - toRenderBox(r->m_object)->positionLineBox(r->m_box); - } -} - -// This function constructs line boxes for all of the text runs in the resolver -// and computes their position. -RootInlineBox* RenderParagraph::createLineBoxesFromBidiRuns( - unsigned bidiLevel, - BidiRunList& bidiRuns, - const InlineIterator& end, - LineInfo& lineInfo, - VerticalPositionCache& verticalPositionCache, - BidiRun* trailingSpaceRun, - WordMeasurements& wordMeasurements) { - if (!bidiRuns.runCount()) - return 0; - - // FIXME: Why is this only done when we had runs? - lineInfo.setLastLine(!end.object()); - - RootInlineBox* lineBox = constructLine(bidiRuns, lineInfo); - if (!lineBox) - return 0; - - lineBox->setBidiLevel(bidiLevel); - lineBox->setEndsWithBreak(lineInfo.previousLineBrokeCleanly()); - - GlyphOverflowAndFallbackFontsMap textBoxDataMap; - - // Now we position all of our text runs horizontally. - computeInlineDirectionPositionsForLine( - lineBox, lineInfo, bidiRuns.firstRun(), trailingSpaceRun, end.atEnd(), - textBoxDataMap, verticalPositionCache, wordMeasurements); - - // Now position our text runs vertically. - computeBlockDirectionPositionsForLine(lineBox, bidiRuns.firstRun(), - textBoxDataMap, verticalPositionCache); - - // Compute our overflow now. - lineBox->computeOverflow(lineBox->lineTop(), lineBox->lineBottom(), - textBoxDataMap); - - return lineBox; -} - -static void deleteLineRange(LineLayoutState& layoutState, - RootInlineBox* startLine, - RootInlineBox* stopLine = 0) { - RootInlineBox* boxToDelete = startLine; - while (boxToDelete && boxToDelete != stopLine) { - // Note: deleteLineRange(firstRootBox()) is not identical to - // deleteLineBoxTree(). deleteLineBoxTree uses nextLineBox() instead of - // nextRootBox() when traversing. - RootInlineBox* next = boxToDelete->nextRootBox(); - boxToDelete->deleteLine(); - boxToDelete = next; - } -} - -void RenderParagraph::layoutRunsAndFloats(LineLayoutState& layoutState) { - // We want to skip ahead to the first dirty line - InlineBidiResolver resolver; - RootInlineBox* startLine = determineStartPosition(layoutState, resolver); - - // We also find the first clean line and extract these lines. We will add - // them back if we determine that we're able to synchronize after handling all - // our dirty lines. - InlineIterator cleanLineStart; - BidiStatus cleanLineBidiStatus; - if (!layoutState.isFullLayout() && startLine) - determineEndPosition(layoutState, startLine, cleanLineStart, - cleanLineBidiStatus); - - if (startLine) - deleteLineRange(layoutState, startLine); - - layoutRunsAndFloatsInRange(layoutState, resolver, cleanLineStart, - cleanLineBidiStatus); - linkToEndLineIfNeeded(layoutState); -} - -void RenderParagraph::layoutRunsAndFloatsInRange( - LineLayoutState& layoutState, - InlineBidiResolver& resolver, - const InlineIterator& cleanLineStart, - const BidiStatus& cleanLineBidiStatus) { - RenderStyle* styleToUse = style(); - LineMidpointState& lineMidpointState = resolver.midpointState(); - InlineIterator endOfLine = resolver.position(); - bool checkForEndLineMatch = layoutState.endLine(); - RenderTextInfo renderTextInfo; - VerticalPositionCache verticalPositionCache; - LineBreaker lineBreaker(this); - - m_didExceedMaxLines = false; - - while (!endOfLine.atEnd()) { - // FIXME: Is this check necessary before the first iteration or can it be - // moved to the end? - if (checkForEndLineMatch) { - layoutState.setEndLineMatched(matchedEndLine( - layoutState, resolver, cleanLineStart, cleanLineBidiStatus)); - if (layoutState.endLineMatched()) { - resolver.setPosition(InlineIterator(resolver.position().root(), 0, 0), - 0); - break; - } - } - - lineMidpointState.reset(); - - layoutState.lineInfo().setEmpty(true); - layoutState.lineInfo().resetRunsFromLeadingWhitespace(); - - bool isNewUBAParagraph = layoutState.lineInfo().previousLineBrokeCleanly(); - FloatingObject* lastFloatFromPreviousLine = 0; - - WordMeasurements wordMeasurements; - endOfLine = lineBreaker.nextLineBreak( - resolver, layoutState.lineInfo(), renderTextInfo, - lastFloatFromPreviousLine, wordMeasurements); - renderTextInfo.m_lineBreakIterator.resetPriorContext(); - m_didExceedMaxLines = - layoutState.lineInfo().lineIndex() > styleToUse->maxLines() && - !layoutState.lineInfo().isEmpty(); - if (resolver.position().atEnd() || m_didExceedMaxLines) { - // FIXME: We shouldn't be creating any runs in nextLineBreak to begin - // with! Once BidiRunList is separated from BidiResolver this will not be - // needed. - resolver.runs().deleteRuns(); - resolver.markCurrentRunEmpty(); // FIXME: This can probably be replaced - // by an ASSERT (or just removed). - resolver.setPosition(InlineIterator(resolver.position().root(), 0, 0), 0); - break; - } - - ASSERT(endOfLine != resolver.position()); - - // This is a short-cut for empty lines. - if (layoutState.lineInfo().isEmpty()) { - if (lastRootBox()) - lastRootBox()->setLineBreakInfo(endOfLine.object(), endOfLine.offset(), - resolver.status()); - } else { - VisualDirectionOverride override = - (styleToUse->rtlOrdering() == VisualOrder - ? (styleToUse->direction() == LTR ? VisualLeftToRightOverride - : VisualRightToLeftOverride) - : NoVisualOverride); - if (isNewUBAParagraph && styleToUse->unicodeBidi() == Plaintext && - !resolver.context()->parent()) { - TextDirection direction = determinePlaintextDirectionality( - resolver.position().root(), resolver.position().object(), - resolver.position().offset()); - resolver.setStatus( - BidiStatus(direction, isOverride(styleToUse->unicodeBidi()))); - } - // FIXME: This ownership is reversed. We should own the BidiRunList and - // pass it to createBidiRunsForLine. - BidiRunList& bidiRuns = resolver.runs(); - constructBidiRunsForLine( - resolver, bidiRuns, endOfLine, override, - layoutState.lineInfo().previousLineBrokeCleanly(), isNewUBAParagraph); - ASSERT(resolver.position() == endOfLine); - - BidiRun* trailingSpaceRun = resolver.trailingSpaceRun(); - - if (bidiRuns.runCount() && lineBreaker.lineWasHyphenated()) - bidiRuns.logicallyLastRun()->m_hasHyphen = true; - if (bidiRuns.runCount() && lineBreaker.lineWasEllipsized()) - bidiRuns.logicallyLastRun()->m_hasAddedEllipsis = true; - - // Now that the runs have been ordered, we create the line boxes. - // At the same time we figure out where border/padding/margin should be - // applied for inline flow boxes. - - RootInlineBox* lineBox = createLineBoxesFromBidiRuns( - resolver.status().context->level(), bidiRuns, endOfLine, - layoutState.lineInfo(), verticalPositionCache, trailingSpaceRun, - wordMeasurements); - - bidiRuns.deleteRuns(); - resolver.markCurrentRunEmpty(); // FIXME: This can probably be replaced - // by an ASSERT (or just removed). - - if (lineBox) - lineBox->setLineBreakInfo(endOfLine.object(), endOfLine.offset(), - resolver.status()); - } - - if (!layoutState.lineInfo().isEmpty()) - layoutState.lineInfo().setFirstLine(false); - - lineMidpointState.reset(); - resolver.setPosition(endOfLine, numberOfIsolateAncestors(endOfLine)); - - // Limit ellipsized text to a single line. - if (lineBreaker.lineWasEllipsized()) { - m_didExceedMaxLines = true; - resolver.setPosition(InlineIterator(resolver.position().root(), 0, 0), 0); - break; - } - } -} - -void RenderParagraph::linkToEndLineIfNeeded(LineLayoutState& layoutState) { - if (layoutState.endLine()) { - if (layoutState.endLineMatched()) { - // Attach all the remaining lines, and then adjust their y-positions as - // needed. - LayoutUnit delta = logicalHeight() - layoutState.endLineLogicalTop(); - for (RootInlineBox* line = layoutState.endLine(); line; - line = line->nextRootBox()) { - line->attachLine(); - if (delta) - line->adjustBlockDirectionPosition(delta.toFloat()); - } - setLogicalHeight(lastRootBox()->lineBottomWithLeading()); - } else { - // Delete all the remaining lines. - deleteLineRange(layoutState, layoutState.endLine()); - } - } -} - -struct InlineMinMaxIterator { - /* InlineMinMaxIterator is a class that will iterate over all render objects - that contribute to inline min/max width calculations. Note the following - about the way it walks: (1) Positioned content is skipped (since it does - not contribute to min/max width of a block) (2) We do not drill into the - children of floats or replaced elements, since you can't break in the - middle of such an element. (3) Inline flows (e.g.,
, , ) are - walked twice, since each side can have distinct borders/margin/padding that - contribute to the min/max width. - */ - RenderObject* parent; - RenderObject* current; - bool endOfInline; - - InlineMinMaxIterator(RenderObject* p) - : parent(p), current(p), endOfInline(false) {} - - RenderObject* next(); -}; - -RenderObject* InlineMinMaxIterator::next() { - RenderObject* result = 0; - bool oldEndOfInline = endOfInline; - endOfInline = false; - while (current || current == parent) { - if (!oldEndOfInline && - (current == parent || - (!current->isReplaced() && !current->isOutOfFlowPositioned()))) - result = current->slowFirstChild(); - - if (!result) { - // We hit the end of our inline. (It was empty, e.g., .) - if (!oldEndOfInline && current->isRenderInline()) { - result = current; - endOfInline = true; - break; - } - - while (current && current != parent) { - result = current->nextSibling(); - if (result) - break; - current = current->parent(); - if (current && current != parent && current->isRenderInline()) { - result = current; - endOfInline = true; - break; - } - } - } - - if (!result) - break; - - if (!result->isOutOfFlowPositioned() && - (result->isText() || result->isReplaced() || result->isRenderInline())) - break; - - current = result; - result = 0; - } - - // Update our position. - current = result; - return current; -} - -static LayoutUnit getBPMWidth(LayoutUnit childValue, Length cssUnit) { - if (cssUnit.type() != Auto) - return (cssUnit.isFixed() ? static_cast(cssUnit.value()) - : childValue); - return 0; -} - -static LayoutUnit getBorderPaddingMargin(RenderBoxModelObject* child, - bool endOfInline) { - RenderStyle* childStyle = child->style(); - if (endOfInline) { - return getBPMWidth(child->marginEnd(), childStyle->marginEnd()) + - getBPMWidth(child->paddingEnd(), childStyle->paddingEnd()) + - child->borderEnd(); - } - return getBPMWidth(child->marginStart(), childStyle->marginStart()) + - getBPMWidth(child->paddingStart(), childStyle->paddingStart()) + - child->borderStart(); -} - -static inline void stripTrailingSpace(float& inlineMax, - float& inlineMin, - RenderObject* trailingSpaceChild) { - if (trailingSpaceChild && trailingSpaceChild->isText()) { - // Collapse away the trailing space at the end of a block. - RenderText* t = toRenderText(trailingSpaceChild); - const UChar space = ' '; - const Font& font = t->style()->font(); // FIXME: This ignores first-line. - float spaceWidth = - font.width(constructTextRun(t, font, &space, 1, t->style(), LTR)); - inlineMax -= spaceWidth + font.fontDescription().wordSpacing(); - if (inlineMin > inlineMax) - inlineMin = inlineMax; - } -} - -static inline void updatePreferredWidth(LayoutUnit& preferredWidth, - float& result) { - LayoutUnit snappedResult = LayoutUnit::fromFloatCeil(result); - preferredWidth = std::max(snappedResult, preferredWidth); -} - -// When converting between floating point and LayoutUnits we risk losing -// precision with each conversion. When this occurs while accumulating our -// preferred widths, we can wind up with a line width that's larger than our -// maxPreferredWidth due to pure float accumulation. -static inline LayoutUnit adjustFloatForSubPixelLayout(float value) { - return LayoutUnit::fromFloatCeil(value); -} - -// FIXME: This function should be broken into something less monolithic. -// FIXME: The main loop here is very similar to LineBreaker::nextSegmentBreak. -// They can probably reuse code. -void RenderParagraph::computeIntrinsicLogicalWidths( - LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const { - float inlineMax = 0; - float inlineMin = 0; - - RenderStyle* styleToUse = style(); - RenderBlock* containingBlock = this->containingBlock(); - LayoutUnit cw = - containingBlock ? containingBlock->contentLogicalWidth() : LayoutUnit(); - - // If we are at the start of a line, we want to ignore all white-space. - // Also strip spaces if we previously had text that ended in a trailing space. - bool stripFrontSpaces = true; - RenderObject* trailingSpaceChild = 0; - - bool autoWrap, oldAutoWrap; - autoWrap = oldAutoWrap = styleToUse->autoWrap(); - - InlineMinMaxIterator childIterator(const_cast(this)); - - // Only gets added to the max preffered width once. - bool addedTextIndent = false; - // Signals the text indent was more negative than the min preferred width - bool hasRemainingNegativeTextIndent = false; - - LayoutUnit textIndent = minimumValueForLength(styleToUse->textIndent(), cw); - bool isPrevChildInlineFlow = false; - bool shouldBreakLineAfterText = false; - while (RenderObject* child = childIterator.next()) { - autoWrap = child->isReplaced() ? child->parent()->style()->autoWrap() - : child->style()->autoWrap(); - - // Step One: determine whether or not we need to go ahead and - // terminate our current line. Each discrete chunk can become - // the new min-width, if it is the widest chunk seen so far, and - // it can also become the max-width. - - // Children fall into three categories: - // (1) An inline flow object. These objects always have a min/max of 0, - // and are included in the iteration solely so that their margins can - // be added in. - // - // (2) An inline non-text non-flow object, e.g., an inline replaced element. - // These objects can always be on a line by themselves, so in this situation - // we need to go ahead and break the current line, and then add in our own - // margins and min/max width on its own line, and then terminate the line. - // - // (3) A text object. Text runs can have breakable characters at the start, - // the middle or the end. They may also lose whitespace off the front if - // we're already ignoring whitespace. In order to compute accurate min-width - // information, we need three pieces of information. - // (a) the min-width of the first non-breakable run. Should be 0 if the text - // string starts with whitespace. (b) the min-width of the last - // non-breakable run. Should be 0 if the text string ends with whitespace. - // (c) the min/max width of the string (trimmed for whitespace). - // - // If the text string starts with whitespace, then we need to go ahead and - // terminate our current line (unless we're already in a whitespace - // stripping mode. - // - // If the text string has a breakable character in the middle, but didn't - // start with whitespace, then we add the width of the first non-breakable - // run and then end the current line. We then need to use the intermediate - // min/max width values (if any of them are larger than our current - // min/max). We then look at the width of the last non-breakable run and use - // that to start a new line (unless we end in whitespace). - RenderStyle* childStyle = child->style(); - float childMin = 0; - float childMax = 0; - - if (!child->isText()) { - // Case (1) and (2). Inline replaced and inline flow elements. - if (child->isRenderInline()) { - // Add in padding/border/margin from the appropriate side of - // the element. - float bpm = getBorderPaddingMargin(toRenderInline(child), - childIterator.endOfInline) - .toFloat(); - childMin += bpm; - childMax += bpm; - - inlineMin += childMin; - inlineMax += childMax; - - child->clearPreferredLogicalWidthsDirty(); - } else { - // Inline replaced elts add in their margins to their min/max values. - LayoutUnit margins = 0; - Length startMargin = childStyle->marginStart(); - Length endMargin = childStyle->marginEnd(); - if (startMargin.isFixed()) - margins += adjustFloatForSubPixelLayout(startMargin.value()); - if (endMargin.isFixed()) - margins += adjustFloatForSubPixelLayout(endMargin.value()); - childMin += margins.ceilToFloat(); - childMax += margins.ceilToFloat(); - } - } - - if (!child->isRenderInline() && !child->isText()) { - // Case (2). Inline replaced elements and floats. - // Go ahead and terminate the current line as far as - // minwidth is concerned. - LayoutUnit childMinPreferredLogicalWidth = - child->minPreferredLogicalWidth(); - LayoutUnit childMaxPreferredLogicalWidth = - child->maxPreferredLogicalWidth(); - childMin += childMinPreferredLogicalWidth.ceilToFloat(); - childMax += childMaxPreferredLogicalWidth.ceilToFloat(); - - bool canBreakReplacedElement = true; - if ((canBreakReplacedElement && (autoWrap || oldAutoWrap) && - (!isPrevChildInlineFlow || shouldBreakLineAfterText))) { - updatePreferredWidth(minLogicalWidth, inlineMin); - inlineMin = 0; - } - - // Add in text-indent. This is added in only once. - if (!addedTextIndent) { - float ceiledTextIndent = textIndent.ceilToFloat(); - childMin += ceiledTextIndent; - childMax += ceiledTextIndent; - - if (childMin < 0) - textIndent = adjustFloatForSubPixelLayout(childMin); - else - addedTextIndent = true; - } - - // Add our width to the max. - inlineMax += std::max(0, childMax); - - if (!autoWrap || !canBreakReplacedElement || - (isPrevChildInlineFlow && !shouldBreakLineAfterText)) { - inlineMin += childMin; - } else { - // Now check our line. - updatePreferredWidth(minLogicalWidth, childMin); - - // Now start a new line. - inlineMin = 0; - } - - if (autoWrap && canBreakReplacedElement && isPrevChildInlineFlow) { - updatePreferredWidth(minLogicalWidth, inlineMin); - inlineMin = 0; - } - - // We are no longer stripping whitespace at the start of - // a line. - stripFrontSpaces = false; - trailingSpaceChild = 0; - } else if (child->isText()) { - // Case (3). Text. - RenderText* t = toRenderText(child); - - // Determine if we have a breakable character. Pass in - // whether or not we should ignore any spaces at the front - // of the string. If those are going to be stripped out, - // then they shouldn't be considered in the breakable char - // check. - bool hasBreakableChar, hasBreak; - float firstLineMinWidth, lastLineMinWidth; - bool hasBreakableStart, hasBreakableEnd; - float firstLineMaxWidth, lastLineMaxWidth; - t->trimmedPrefWidths(inlineMax, firstLineMinWidth, hasBreakableStart, - lastLineMinWidth, hasBreakableEnd, hasBreakableChar, - hasBreak, firstLineMaxWidth, lastLineMaxWidth, - childMin, childMax, stripFrontSpaces, - styleToUse->direction()); - - // This text object will not be rendered, but it may still provide a - // breaking opportunity. - if (!hasBreak && !childMax) { - if (autoWrap && (hasBreakableStart || hasBreakableEnd)) { - updatePreferredWidth(minLogicalWidth, inlineMin); - inlineMin = 0; - } - continue; - } - - if (stripFrontSpaces) - trailingSpaceChild = child; - else - trailingSpaceChild = 0; - - // Add in text-indent. This is added in only once. - float ti = 0; - if (!addedTextIndent || hasRemainingNegativeTextIndent) { - ti = textIndent.ceilToFloat(); - childMin += ti; - firstLineMinWidth += ti; - - // It the text indent negative and larger than the child minimum, we - // re-use the remainder in future minimum calculations, but using the - // negative value again on the maximum will lead to under-counting the - // max pref width. - if (!addedTextIndent) { - childMax += ti; - firstLineMaxWidth += ti; - addedTextIndent = true; - } - - if (childMin < 0) { - textIndent = childMin; - hasRemainingNegativeTextIndent = true; - } - } - - // If we have no breakable characters at all, - // then this is the easy case. We add ourselves to the current - // min and max and continue. - if (!hasBreakableChar) { - inlineMin += childMin; - } else { - if (hasBreakableStart) { - updatePreferredWidth(minLogicalWidth, inlineMin); - } else { - inlineMin += firstLineMinWidth; - updatePreferredWidth(minLogicalWidth, inlineMin); - childMin -= ti; - } - - inlineMin = childMin; - - if (hasBreakableEnd) { - updatePreferredWidth(minLogicalWidth, inlineMin); - inlineMin = 0; - shouldBreakLineAfterText = false; - } else { - updatePreferredWidth(minLogicalWidth, inlineMin); - inlineMin = lastLineMinWidth; - shouldBreakLineAfterText = true; - } - } - - if (hasBreak) { - inlineMax += firstLineMaxWidth; - updatePreferredWidth(maxLogicalWidth, inlineMax); - updatePreferredWidth(maxLogicalWidth, childMax); - inlineMax = lastLineMaxWidth; - addedTextIndent = true; - } else { - inlineMax += std::max(0, childMax); - } - } - - if (!child->isText() && child->isRenderInline()) - isPrevChildInlineFlow = true; - else - isPrevChildInlineFlow = false; - - oldAutoWrap = autoWrap; - } - - if (styleToUse->collapseWhiteSpace()) - stripTrailingSpace(inlineMax, inlineMin, trailingSpaceChild); - - updatePreferredWidth(minLogicalWidth, inlineMin); - updatePreferredWidth(maxLogicalWidth, inlineMax); - - maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); -} - -int RenderParagraph::firstLineBoxBaseline( - FontBaselineOrAuto baselineType) const { - if (!firstLineBox()) - return -1; - FontBaseline baseline; - if (baselineType.m_auto) - baseline = firstRootBox()->baselineType(); - else - baseline = baselineType.m_baseline; - return firstLineBox()->logicalTop() + - style(true)->fontMetrics().ascent(baseline); -} - -int RenderParagraph::lastLineBoxBaseline( - LineDirectionMode lineDirection) const { - if (!firstLineBox() && hasLineIfEmpty()) { - const FontMetrics& fontMetrics = firstLineStyle()->fontMetrics(); - return fontMetrics.ascent() + - (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - - fontMetrics.height()) / - 2 + - (lineDirection == HorizontalLine ? borderTop() + paddingTop() - : borderRight() + paddingRight()); - } - if (lastLineBox()) - return lastLineBox()->logicalTop() + - style(lastLineBox() == firstLineBox()) - ->fontMetrics() - .ascent(lastRootBox()->baselineType()); - return -1; -} - -void RenderParagraph::layout() { - ASSERT(needsLayout()); - ASSERT(isInlineBlock() || !isInline()); - - if (simplifiedLayout()) - return; - - SubtreeLayoutScope layoutScope(*this); - - LayoutUnit oldLeft = logicalLeft(); - bool logicalWidthChanged = updateLogicalWidthAndColumnWidth(); - bool relayoutChildren = logicalWidthChanged; - - LayoutUnit beforeEdge = borderBefore() + paddingBefore(); - LayoutUnit afterEdge = borderAfter() + paddingAfter(); - LayoutUnit previousHeight = logicalHeight(); - setLogicalHeight(beforeEdge); - - layoutChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge); - - LayoutUnit oldClientAfterEdge = clientLogicalBottom(); - - updateLogicalHeight(); - - if (previousHeight != logicalHeight()) - relayoutChildren = true; - - layoutPositionedObjects(relayoutChildren, - oldLeft != logicalLeft() - ? ForcedLayoutAfterContainingBlockMoved - : DefaultLayout); - - // Add overflow from children (unless we're multi-column, since in that case - // all our child overflow is clipped anyway). - computeOverflow(oldClientAfterEdge); - - updateLayerTransformAfterLayout(); - - clearNeedsLayout(); -} - -void RenderParagraph::layoutChildren(bool relayoutChildren, - SubtreeLayoutScope& layoutScope, - LayoutUnit beforeEdge, - LayoutUnit afterEdge) { - // Figure out if we should clear out our line boxes. - // FIXME: Handle resize eventually! - bool isFullLayout = !firstLineBox() || selfNeedsLayout() || relayoutChildren; - LineLayoutState layoutState(isFullLayout); - - if (isFullLayout) - lineBoxes()->deleteLineBoxes(); - - if (firstChild()) { - // In full layout mode, clear the line boxes of children upfront. Otherwise, - // siblings can run into stale root lineboxes during layout. Then layout - // the replaced elements later. In partial layout mode, line boxes are not - // deleted and only dirtied. In that case, we can layout the replaced - // elements at the same time. - Vector replacedChildren; - for (InlineWalker walker(this); !walker.atEnd(); walker.advance()) { - RenderObject* o = walker.current(); - - if (!layoutState.hasInlineChild() && o->isInline()) - layoutState.setHasInlineChild(true); - - if (o->isReplaced() || o->isOutOfFlowPositioned()) { - RenderBox* box = toRenderBox(o); - - updateBlockChildDirtyBitsBeforeLayout(relayoutChildren, box); - - if (o->isOutOfFlowPositioned()) { - o->containingBlock()->insertPositionedObject(box); - } else if (isFullLayout || o->needsLayout()) { - // Replaced element. - box->dirtyLineBoxes(isFullLayout); - if (isFullLayout) - replacedChildren.append(box); - else - o->layoutIfNeeded(); - } - } else if (o->isText() || - (o->isRenderInline() && !walker.atEndOfInline())) { - if (!o->isText()) - toRenderInline(o)->updateAlwaysCreateLineBoxes( - layoutState.isFullLayout()); - if (layoutState.isFullLayout() || o->selfNeedsLayout()) - dirtyLineBoxesForRenderer(o, layoutState.isFullLayout()); - o->clearNeedsLayout(); - } - } - - for (size_t i = 0; i < replacedChildren.size(); i++) - replacedChildren[i]->layoutIfNeeded(); - - layoutRunsAndFloats(layoutState); - } - - // Expand the last line to accommodate Ruby and emphasis marks. - int lastLineAnnotationsAdjustment = 0; - if (lastRootBox()) { - LayoutUnit lowestAllowedPosition = - std::max(lastRootBox()->lineBottom(), logicalHeight() + paddingAfter()); - lastLineAnnotationsAdjustment = - lastRootBox()->computeUnderAnnotationAdjustment(lowestAllowedPosition); - } - - // Now add in the bottom border/padding. - setLogicalHeight(logicalHeight() + lastLineAnnotationsAdjustment + afterEdge); - - if (!firstLineBox() && hasLineIfEmpty()) - setLogicalHeight(logicalHeight() + lineHeight(true, HorizontalLine, - PositionOfInteriorLineBoxes)); -} - -RootInlineBox* RenderParagraph::determineStartPosition( - LineLayoutState& layoutState, - InlineBidiResolver& resolver) { - RootInlineBox* curr = 0; - RootInlineBox* last = 0; - - if (layoutState.isFullLayout()) { - // If we encountered a new float and have inline children, mark ourself to - // force us to issue paint invalidations. - if (layoutState.hasInlineChild() && !selfNeedsLayout()) { - setNeedsLayout(MarkOnlyThis); - } - - // FIXME: This should just call deleteLineBoxTree, but that causes - // crashes for fast/repaint tests. - curr = firstRootBox(); - while (curr) { - // Note: This uses nextRootBox() insted of nextLineBox() like - // deleteLineBoxTree does. - RootInlineBox* next = curr->nextRootBox(); - curr->deleteLine(); - curr = next; - } - ASSERT(!firstLineBox() && !lastLineBox()); - } else { - if (curr) { - // We have a dirty line. - if (RootInlineBox* prevRootBox = curr->prevRootBox()) { - // We have a previous line. - if (!prevRootBox->endsWithBreak() || !prevRootBox->lineBreakObj() || - (prevRootBox->lineBreakObj()->isText() && - prevRootBox->lineBreakPos() >= - toRenderText(prevRootBox->lineBreakObj())->textLength())) - // The previous line didn't break cleanly or broke at a newline - // that has been deleted, so treat it as dirty too. - curr = prevRootBox; - } - } else { - // No dirty lines were found. - // If the last line didn't break cleanly, treat it as dirty. - if (lastRootBox() && !lastRootBox()->endsWithBreak()) - curr = lastRootBox(); - } - - // If we have no dirty lines, then last is just the last root box. - last = curr ? curr->prevRootBox() : lastRootBox(); - } - - layoutState.lineInfo().setFirstLine(!last); - layoutState.lineInfo().setPreviousLineBrokeCleanly(!last || - last->endsWithBreak()); - - if (last) { - setLogicalHeight(last->lineBottomWithLeading()); - InlineIterator iter = - InlineIterator(this, last->lineBreakObj(), last->lineBreakPos()); - resolver.setPosition(iter, numberOfIsolateAncestors(iter)); - resolver.setStatus(last->lineBreakBidiStatus()); - } else { - TextDirection direction = style()->direction(); - if (style()->unicodeBidi() == Plaintext) - direction = determinePlaintextDirectionality(this); - resolver.setStatus( - BidiStatus(direction, isOverride(style()->unicodeBidi()))); - InlineIterator iter = InlineIterator( - this, bidiFirstSkippingEmptyInlines(this, resolver.runs(), &resolver), - 0); - resolver.setPosition(iter, numberOfIsolateAncestors(iter)); - } - return curr; -} - -void RenderParagraph::determineEndPosition(LineLayoutState& layoutState, - RootInlineBox* startLine, - InlineIterator& cleanLineStart, - BidiStatus& cleanLineBidiStatus) { - ASSERT(!layoutState.endLine()); - RootInlineBox* last = 0; - for (RootInlineBox* curr = startLine->nextRootBox(); curr; - curr = curr->nextRootBox()) { - if (curr->isDirty()) - last = 0; - else if (!last) - last = curr; - } - - if (!last) - return; - - // At this point, |last| is the first line in a run of clean lines that ends - // with the last line in the block. - - RootInlineBox* prev = last->prevRootBox(); - cleanLineStart = - InlineIterator(this, prev->lineBreakObj(), prev->lineBreakPos()); - cleanLineBidiStatus = prev->lineBreakBidiStatus(); - layoutState.setEndLineLogicalTop(prev->lineBottomWithLeading()); - - for (RootInlineBox* line = last; line; line = line->nextRootBox()) - line->extractLine(); // Disconnect all line boxes from their render objects - // while preserving their connections to one another. - - layoutState.setEndLine(last); -} - -bool RenderParagraph::checkPaginationAndFloatsAtEndLine( - LineLayoutState& layoutState) { - // FIXME(sky): Remove this. - return true; -} - -bool RenderParagraph::matchedEndLine(LineLayoutState& layoutState, - const InlineBidiResolver& resolver, - const InlineIterator& endLineStart, - const BidiStatus& endLineStatus) { - if (resolver.position() == endLineStart) { - if (resolver.status() != endLineStatus) - return false; - return checkPaginationAndFloatsAtEndLine(layoutState); - } - - // The first clean line doesn't match, but we can check a handful of following - // lines to try to match back up. - static int numLines = 8; // The # of lines we're willing to match against. - RootInlineBox* originalEndLine = layoutState.endLine(); - RootInlineBox* line = originalEndLine; - for (int i = 0; i < numLines && line; i++, line = line->nextRootBox()) { - if (line->lineBreakObj() == resolver.position().object() && - line->lineBreakPos() == resolver.position().offset()) { - // We have a match. - if (line->lineBreakBidiStatus() != resolver.status()) - return false; // ...but the bidi state doesn't match. - - bool matched = false; - RootInlineBox* result = line->nextRootBox(); - layoutState.setEndLine(result); - if (result) { - layoutState.setEndLineLogicalTop(line->lineBottomWithLeading()); - matched = checkPaginationAndFloatsAtEndLine(layoutState); - } - - // Now delete the lines that we failed to sync. - deleteLineRange(layoutState, originalEndLine, result); - return matched; - } - } - - return false; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderParagraph.h b/sky/engine/core/rendering/RenderParagraph.h deleted file mode 100644 index fb21a2c51f828..0000000000000 --- a/sky/engine/core/rendering/RenderParagraph.h +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERPARAGRAPH_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERPARAGRAPH_H_ - -#include "flutter/sky/engine/core/rendering/RenderBlock.h" -#include "flutter/sky/engine/core/rendering/line/TrailingObjects.h" - -namespace blink { - -struct BidiRun; -// class InlineBidiResolver; -class InlineIterator; - -class RenderParagraph final : public RenderBlock { - public: - explicit RenderParagraph(); - virtual ~RenderParagraph(); - - bool isRenderParagraph() const final { return true; } - - void layout() final; - - LayoutUnit logicalRightOffsetForLine(bool shouldIndentText) const { - LayoutUnit right = logicalRightOffsetForContent(); - if (shouldIndentText && !style()->isLeftToRightDirection()) - right -= textIndentOffset(); - return right; - } - LayoutUnit logicalLeftOffsetForLine(bool shouldIndentText) const { - LayoutUnit left = logicalLeftOffsetForContent(); - if (shouldIndentText && style()->isLeftToRightDirection()) - left += textIndentOffset(); - return left; - } - - LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, - LayoutUnit position) final; - LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, - LayoutUnit position) final; - - virtual RootInlineBox* lineAtIndex(int) const; - virtual int lineCount(const RootInlineBox* = 0, bool* = 0) const; - - void deleteLineBoxTree() final; - - GapRects inlineSelectionGaps(RenderBlock* rootBlock, - const LayoutPoint& rootBlockPhysicalPosition, - const LayoutSize& offsetFromRootBlock, - LayoutUnit& lastLogicalTop, - LayoutUnit& lastLogicalLeft, - LayoutUnit& lastLogicalRight, - const PaintInfo*); - - static bool shouldSkipCreatingRunsForObject(RenderObject* obj) { - return obj->isOutOfFlowPositioned() && - !obj->style()->isOriginalDisplayInlineType() && - !obj->container()->isRenderInline(); - } - - bool didExceedMaxLines() const { return m_didExceedMaxLines; } - - // TODO(ojan): Remove the need for these. - using RenderBlock::firstLineBox; - using RenderBlock::lastRootBox; - using RenderBlock::lineBoxes; - - protected: - void addOverflowFromChildren() final; - - void simplifiedNormalFlowLayout() final; - - void paintChildren(PaintInfo&, - const LayoutPoint&, - Vector& layers) final; - - bool hitTestContents(const HitTestRequest&, - HitTestResult&, - const HitTestLocation& locationInContainer, - const LayoutPoint& accumulatedOffset) final; - - virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const; - - void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const final; - - int firstLineBoxBaseline(FontBaselineOrAuto baselineType) const final; - int lastLineBoxBaseline(LineDirectionMode) const final; - - private: - virtual const char* renderName() const override; - - void layoutChildren(bool relayoutChildren, - SubtreeLayoutScope&, - LayoutUnit beforeEdge, - LayoutUnit afterEdge); - - void markLinesDirtyInBlockRange(LayoutUnit logicalTop, - LayoutUnit logicalBottom, - RootInlineBox* highest = 0); - - void updateLogicalWidthForAlignment(const ETextAlign&, - const RootInlineBox*, - BidiRun* trailingSpaceRun, - float& logicalLeft, - float& totalLogicalWidth, - float& availableLogicalWidth, - unsigned expansionOpportunityCount); - - RootInlineBox* createAndAppendRootInlineBox(); - RootInlineBox* createRootInlineBox(); - InlineFlowBox* createLineBoxes(RenderObject*, - const LineInfo&, - InlineBox* childBox); - InlineBox* createInlineBoxForRenderer(RenderObject*, - bool isRootLineBox, - bool isOnlyRun = false); - RootInlineBox* constructLine(BidiRunList&, const LineInfo&); - void computeInlineDirectionPositionsForLine(RootInlineBox*, - const LineInfo&, - BidiRun* firstRun, - BidiRun* trailingSpaceRun, - bool reachedEnd, - GlyphOverflowAndFallbackFontsMap&, - VerticalPositionCache&, - WordMeasurements&); - BidiRun* computeInlineDirectionPositionsForSegment( - RootInlineBox*, - const LineInfo&, - ETextAlign, - float& logicalLeft, - float& availableLogicalWidth, - BidiRun* firstRun, - BidiRun* trailingSpaceRun, - GlyphOverflowAndFallbackFontsMap& textBoxDataMap, - VerticalPositionCache&, - WordMeasurements&); - void computeBlockDirectionPositionsForLine(RootInlineBox*, - BidiRun*, - GlyphOverflowAndFallbackFontsMap&, - VerticalPositionCache&); - // Helper function for layoutChildren() - RootInlineBox* createLineBoxesFromBidiRuns(unsigned bidiLevel, - BidiRunList&, - const InlineIterator& end, - LineInfo&, - VerticalPositionCache&, - BidiRun* trailingSpaceRun, - WordMeasurements&); - void layoutRunsAndFloats(LineLayoutState&); - void layoutRunsAndFloatsInRange(LineLayoutState&, - InlineBidiResolver&, - const InlineIterator& cleanLineStart, - const BidiStatus& cleanLineBidiStatus); - void linkToEndLineIfNeeded(LineLayoutState&); - RootInlineBox* determineStartPosition(LineLayoutState&, InlineBidiResolver&); - void determineEndPosition(LineLayoutState&, - RootInlineBox* startBox, - InlineIterator& cleanLineStart, - BidiStatus& cleanLineBidiStatus); - bool checkPaginationAndFloatsAtEndLine(LineLayoutState&); - bool matchedEndLine(LineLayoutState&, - const InlineBidiResolver&, - const InlineIterator& endLineStart, - const BidiStatus& endLineStatus); - - bool m_didExceedMaxLines; -}; - -DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderParagraph, isRenderParagraph()); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERPARAGRAPH_H_ diff --git a/sky/engine/core/rendering/RenderReplaced.cpp b/sky/engine/core/rendering/RenderReplaced.cpp deleted file mode 100644 index 6774866d5946f..0000000000000 --- a/sky/engine/core/rendering/RenderReplaced.cpp +++ /dev/null @@ -1,507 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/RenderReplaced.h" - -#include "flutter/sky/engine/core/rendering/RenderBlock.h" -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/platform/LengthFunctions.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" - -namespace blink { - -const int RenderReplaced::defaultWidth = 300; -const int RenderReplaced::defaultHeight = 150; - -RenderReplaced::RenderReplaced() - : m_intrinsicSize(defaultWidth, defaultHeight) { - setReplaced(true); -} - -RenderReplaced::RenderReplaced(const LayoutSize& intrinsicSize) - : m_intrinsicSize(intrinsicSize) { - setReplaced(true); -} - -RenderReplaced::~RenderReplaced() {} - -void RenderReplaced::willBeDestroyed() { - if (!documentBeingDestroyed() && parent()) - parent()->dirtyLinesFromChangedChild(this); - - RenderBox::willBeDestroyed(); -} - -void RenderReplaced::layout() { - ASSERT(needsLayout()); - - setHeight(minimumReplacedHeight()); - - updateLogicalWidth(); - updateLogicalHeight(); - - m_overflow.clear(); - addVisualEffectOverflow(); - updateLayerTransformAfterLayout(); - - clearNeedsLayout(); -} - -void RenderReplaced::intrinsicSizeChanged() { - m_intrinsicSize = IntSize(defaultWidth, defaultHeight); - setNeedsLayoutAndPrefWidthsRecalc(); -} - -void RenderReplaced::paint(PaintInfo& paintInfo, - const LayoutPoint& paintOffset, - Vector& layers) { - if (!shouldPaint(paintInfo, paintOffset)) - return; - - LayoutPoint adjustedPaintOffset = paintOffset + location(); - - if (hasBoxDecorationBackground()) - paintBoxDecorationBackground(paintInfo, adjustedPaintOffset); - - LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size()); - - bool completelyClippedOut = false; - if (style()->hasBorderRadius()) { - LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size()); - - if (borderRect.isEmpty()) - completelyClippedOut = true; - else { - // Push a clip if we have a border radius, since we want to round the - // foreground content that gets painted. - paintInfo.context->save(); - RoundedRect roundedInnerRect = style()->getRoundedInnerBorderFor( - paintRect, paddingTop() + borderTop(), - paddingBottom() + borderBottom(), paddingLeft() + borderLeft(), - paddingRight() + borderRight(), true, true); - clipRoundedInnerRect(paintInfo.context, paintRect, roundedInnerRect); - } - } - - if (!completelyClippedOut) { - paintReplaced(paintInfo, adjustedPaintOffset); - if (style()->hasBorderRadius()) - paintInfo.context->restore(); - } - - // The selection tint never gets clipped by border-radius rounding, since we - // want it to run right up to the edges of surrounding content. - if (selectionState() != SelectionNone) { - LayoutRect selectionPaintingRect = localSelectionRect(); - selectionPaintingRect.moveBy(adjustedPaintOffset); - paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), - selectionBackgroundColor()); - } -} - -bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, - const LayoutPoint& paintOffset) { - LayoutPoint adjustedPaintOffset = paintOffset + location(); - - // Early exit if the element touches the edges. - LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y(); - LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY(); - if (isSelected() && inlineBoxWrapper()) { - LayoutUnit selTop = - paintOffset.y() + inlineBoxWrapper()->root().selectionTop(); - LayoutUnit selBottom = - paintOffset.y() + selTop + inlineBoxWrapper()->root().selectionHeight(); - top = std::min(selTop, top); - bottom = std::max(selBottom, bottom); - } - - if (adjustedPaintOffset.x() + visualOverflowRect().x() >= - paintInfo.rect.maxX() || - adjustedPaintOffset.x() + visualOverflowRect().maxX() <= - paintInfo.rect.x()) - return false; - - if (top >= paintInfo.rect.maxY() || bottom <= paintInfo.rect.y()) - return false; - - return true; -} - -bool RenderReplaced::hasReplacedLogicalHeight() const { - if (style()->logicalHeight().isAuto()) - return false; - - if (style()->logicalHeight().isSpecified()) { - if (hasAutoHeightOrContainingBlockWithAutoHeight()) - return false; - return true; - } - - if (style()->logicalHeight().isIntrinsic()) - return true; - - return false; -} - -bool RenderReplaced::needsPreferredWidthsRecalculation() const { - // If the height is a percentage and the width is auto, then the - // containingBlocks's height changing can cause this node to change it's - // preferred width because it maintains aspect ratio. - return hasRelativeLogicalHeight() && style()->logicalWidth().isAuto() && - !hasAutoHeightOrContainingBlockWithAutoHeight(); -} - -static inline bool rendererHasAspectRatio(const RenderObject* renderer) { - ASSERT(renderer); - return renderer->isImage() || renderer->isCanvas(); -} - -void RenderReplaced::computeAspectRatioInformationForRenderBox( - FloatSize& constrainedSize, - double& intrinsicRatio) const { - FloatSize intrinsicSize; - computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio); - if (intrinsicRatio && !intrinsicSize.isEmpty()) - m_intrinsicSize = LayoutSize(intrinsicSize); - - // Now constrain the intrinsic size along each axis according to minimum and - // maximum width/heights along the opposite axis. So for example a maximum - // width that shrinks our width will result in the height we compute here - // having to shrink in order to preserve the aspect ratio. Because we compute - // these values independently along each axis, the final returned size may in - // fact not preserve the aspect ratio. - // FIXME: In the long term, it might be better to just return this code more - // to the way it used to be before this function was added, since all it has - // done is make the code more unclear. - constrainedSize = intrinsicSize; - if (intrinsicRatio && !intrinsicSize.isEmpty() && - style()->logicalWidth().isAuto() && style()->logicalHeight().isAuto()) { - // We can't multiply or divide by 'intrinsicRatio' here, it breaks tests, - // like fast/images/zoomed-img-size.html, which can only be fixed once - // subpixel precision is available for things like intrinsicWidth/Height. - constrainedSize.setWidth(RenderBox::computeReplacedLogicalHeight() * - intrinsicSize.width() / intrinsicSize.height()); - constrainedSize.setHeight(RenderBox::computeReplacedLogicalWidth() * - intrinsicSize.height() / intrinsicSize.width()); - } -} - -LayoutRect RenderReplaced::replacedContentRect( - const LayoutSize* overriddenIntrinsicSize) const { - LayoutRect contentRect = contentBoxRect(); - ObjectFit objectFit = style()->objectFit(); - - if (objectFit == ObjectFitFill && - style()->objectPosition() == RenderStyle::initialObjectPosition()) - objectFit = ObjectFitContain; - - LayoutSize intrinsicSize = overriddenIntrinsicSize ? *overriddenIntrinsicSize - : this->intrinsicSize(); - if (!intrinsicSize.width() || !intrinsicSize.height()) - return contentRect; - - LayoutRect finalRect = contentRect; - switch (objectFit) { - case ObjectFitContain: - case ObjectFitScaleDown: - case ObjectFitCover: - finalRect.setSize(finalRect.size().fitToAspectRatio( - intrinsicSize, objectFit == ObjectFitCover ? AspectRatioFitGrow - : AspectRatioFitShrink)); - if (objectFit != ObjectFitScaleDown || - finalRect.width() <= intrinsicSize.width()) - break; - // fall through - case ObjectFitNone: - finalRect.setSize(intrinsicSize); - break; - case ObjectFitFill: - break; - default: - ASSERT_NOT_REACHED(); - } - - LayoutUnit xOffset = minimumValueForLength( - style()->objectPosition().x(), contentRect.width() - finalRect.width()); - LayoutUnit yOffset = minimumValueForLength( - style()->objectPosition().y(), contentRect.height() - finalRect.height()); - finalRect.move(xOffset, yOffset); - - return finalRect; -} - -void RenderReplaced::computeIntrinsicRatioInformation( - FloatSize& intrinsicSize, - double& intrinsicRatio) const { - intrinsicSize = FloatSize(intrinsicLogicalWidth().toFloat(), - intrinsicLogicalHeight().toFloat()); - - // Figure out if we need to compute an intrinsic ratio. - if (intrinsicSize.isEmpty() || !rendererHasAspectRatio(this)) - return; - - intrinsicRatio = intrinsicSize.width() / intrinsicSize.height(); -} - -LayoutUnit RenderReplaced::computeReplacedLogicalWidth( - ShouldComputePreferred shouldComputePreferred) const { - if (style()->logicalWidth().isSpecified() || - style()->logicalWidth().isIntrinsic()) - return computeReplacedLogicalWidthRespectingMinMaxWidth( - computeReplacedLogicalWidthUsing(style()->logicalWidth()), - shouldComputePreferred); - - // 10.3.2 Inline, replaced elements: - // http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width - double intrinsicRatio = 0; - FloatSize constrainedSize; - computeAspectRatioInformationForRenderBox(constrainedSize, intrinsicRatio); - - if (style()->logicalWidth().isAuto()) { - bool computedHeightIsAuto = hasAutoHeightOrContainingBlockWithAutoHeight(); - bool hasIntrinsicWidth = constrainedSize.width() > 0; - - // If 'height' and 'width' both have computed values of 'auto' and the - // element also has an intrinsic width, then that intrinsic width is the - // used value of 'width'. - if (computedHeightIsAuto && hasIntrinsicWidth) - return computeReplacedLogicalWidthRespectingMinMaxWidth( - constrainedSize.width(), shouldComputePreferred); - - bool hasIntrinsicHeight = constrainedSize.height() > 0; - if (intrinsicRatio) { - // If 'height' and 'width' both have computed values of 'auto' and the - // element has no intrinsic width, but does have an intrinsic height and - // intrinsic ratio; or if 'width' has a computed value of 'auto', 'height' - // has some other computed value, and the element does have an intrinsic - // ratio; then the used value of 'width' is: (used height) * (intrinsic - // ratio) - if (intrinsicRatio && - ((computedHeightIsAuto && !hasIntrinsicWidth && hasIntrinsicHeight) || - !computedHeightIsAuto)) { - LayoutUnit logicalHeight = computeReplacedLogicalHeight(); - return computeReplacedLogicalWidthRespectingMinMaxWidth( - roundToInt(round(logicalHeight * intrinsicRatio)), - shouldComputePreferred); - } - - // If 'height' and 'width' both have computed values of 'auto' and the - // element has an intrinsic ratio but no intrinsic height or width, then - // the used value of 'width' is undefined in CSS 2.1. However, it is - // suggested that, if the containing block's width does not itself depend - // on the replaced element's width, then the used value of 'width' is - // calculated from the constraint equation used for block-level, - // non-replaced elements in normal flow. - if (computedHeightIsAuto && !hasIntrinsicWidth && !hasIntrinsicHeight) { - if (shouldComputePreferred == ComputePreferred) - return 0; - // The aforementioned 'constraint equation' used for block-level, - // non-replaced elements in normal flow: 'margin-left' + - // 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + - // 'border-right-width' + 'margin-right' = width of containing block - LayoutUnit logicalWidth = containingBlock()->availableLogicalWidth(); - - // This solves above equation for 'width' (== logicalWidth). - LayoutUnit marginStart = - minimumValueForLength(style()->marginStart(), logicalWidth); - LayoutUnit marginEnd = - minimumValueForLength(style()->marginEnd(), logicalWidth); - logicalWidth = std::max( - 0, logicalWidth - - (marginStart + marginEnd + (width() - clientWidth()))); - return computeReplacedLogicalWidthRespectingMinMaxWidth( - logicalWidth, shouldComputePreferred); - } - } - - // Otherwise, if 'width' has a computed value of 'auto', and the element has - // an intrinsic width, then that intrinsic width is the used value of - // 'width'. - if (hasIntrinsicWidth) - return computeReplacedLogicalWidthRespectingMinMaxWidth( - constrainedSize.width(), shouldComputePreferred); - - // Otherwise, if 'width' has a computed value of 'auto', but none of the - // conditions above are met, then the used value of 'width' becomes 300px. - // If 300px is too wide to fit the device, UAs should use the width of the - // largest rectangle that has a 2:1 ratio and fits the device instead. Note: - // We fall through and instead return intrinsicLogicalWidth() here - to - // preserve existing WebKit behavior, which might or might not be correct, - // or desired. Changing this to return cDefaultWidth, will affect lots of - // test results. Eg. some tests assume that a blank tag (which implies - // width/height=auto) has no intrinsic size, which is wrong per CSS 2.1, but - // matches our behavior since a long time. - } - - return computeReplacedLogicalWidthRespectingMinMaxWidth( - intrinsicLogicalWidth(), shouldComputePreferred); -} - -LayoutUnit RenderReplaced::computeReplacedLogicalHeight() const { - // 10.5 Content height: the 'height' property: - // http://www.w3.org/TR/CSS21/visudet.html#propdef-height - if (hasReplacedLogicalHeight()) - return computeReplacedLogicalHeightRespectingMinMaxHeight( - computeReplacedLogicalHeightUsing(style()->logicalHeight())); - - // 10.6.2 Inline, replaced elements: - // http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height - double intrinsicRatio = 0; - FloatSize constrainedSize; - computeAspectRatioInformationForRenderBox(constrainedSize, intrinsicRatio); - - bool widthIsAuto = style()->logicalWidth().isAuto(); - bool hasIntrinsicHeight = constrainedSize.height() > 0; - - // If 'height' and 'width' both have computed values of 'auto' and the element - // also has an intrinsic height, then that intrinsic height is the used value - // of 'height'. - if (widthIsAuto && hasIntrinsicHeight) - return computeReplacedLogicalHeightRespectingMinMaxHeight( - constrainedSize.height()); - - // Otherwise, if 'height' has a computed value of 'auto', and the element has - // an intrinsic ratio then the used value of 'height' is: (used width) / - // (intrinsic ratio) - if (intrinsicRatio) - return computeReplacedLogicalHeightRespectingMinMaxHeight( - roundToInt(round(availableLogicalWidth() / intrinsicRatio))); - - // Otherwise, if 'height' has a computed value of 'auto', and the element has - // an intrinsic height, then that intrinsic height is the used value of - // 'height'. - if (hasIntrinsicHeight) - return computeReplacedLogicalHeightRespectingMinMaxHeight( - constrainedSize.height()); - - // Otherwise, if 'height' has a computed value of 'auto', but none of the - // conditions above are met, then the used value of 'height' must be set to - // the height of the largest rectangle that has a 2:1 ratio, has a height not - // greater than 150px, and has a width not greater than the device width. - return computeReplacedLogicalHeightRespectingMinMaxHeight( - intrinsicLogicalHeight()); -} - -void RenderReplaced::computeIntrinsicLogicalWidths( - LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const { - minLogicalWidth = maxLogicalWidth = intrinsicLogicalWidth(); -} - -void RenderReplaced::computePreferredLogicalWidths() { - ASSERT(preferredLogicalWidthsDirty()); - - // We cannot resolve any percent logical width here as the available logical - // width may not be set on our containing block. - if (style()->logicalWidth().isPercent()) - computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, - m_maxPreferredLogicalWidth); - else - m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = - computeReplacedLogicalWidth(ComputePreferred); - - RenderStyle* styleToUse = style(); - if (styleToUse->logicalWidth().isPercent() || - styleToUse->logicalMaxWidth().isPercent()) - m_minPreferredLogicalWidth = 0; - - if (styleToUse->logicalMinWidth().isFixed() && - styleToUse->logicalMinWidth().value() > 0) { - m_maxPreferredLogicalWidth = std::max( - m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( - styleToUse->logicalMinWidth().value())); - m_minPreferredLogicalWidth = std::max( - m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( - styleToUse->logicalMinWidth().value())); - } - - if (styleToUse->logicalMaxWidth().isFixed()) { - m_maxPreferredLogicalWidth = std::min( - m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( - styleToUse->logicalMaxWidth().value())); - m_minPreferredLogicalWidth = std::min( - m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( - styleToUse->logicalMaxWidth().value())); - } - - LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth(); - m_minPreferredLogicalWidth += borderAndPadding; - m_maxPreferredLogicalWidth += borderAndPadding; - - clearPreferredLogicalWidthsDirty(); -} - -PositionWithAffinity RenderReplaced::positionForPoint( - const LayoutPoint& point) { - // FIXME: This code is buggy if the replaced element is relative positioned. - InlineBox* box = inlineBoxWrapper(); - RootInlineBox* rootBox = box ? &box->root() : 0; - - LayoutUnit top = rootBox ? rootBox->selectionTop() : logicalTop(); - LayoutUnit bottom = rootBox ? rootBox->selectionBottom() : logicalBottom(); - - LayoutUnit blockDirectionPosition = point.y() + y(); - - if (blockDirectionPosition < top) - return createPositionWithAffinity(caretMinOffset(), - DOWNSTREAM); // coordinates are above - - if (blockDirectionPosition >= bottom) - return createPositionWithAffinity(caretMaxOffset(), - DOWNSTREAM); // coordinates are below - - return RenderBox::positionForPoint(point); -} - -LayoutRect RenderReplaced::localSelectionRect(bool checkWhetherSelected) const { - if (checkWhetherSelected && !isSelected()) - return LayoutRect(); - - if (!inlineBoxWrapper()) - // We're a block-level replaced element. Just return our own dimensions. - return LayoutRect(LayoutPoint(), size()); - - RootInlineBox& root = inlineBoxWrapper()->root(); - LayoutUnit newLogicalTop = - root.selectionTop() - inlineBoxWrapper()->logicalTop(); - return LayoutRect(0, newLogicalTop, width(), root.selectionHeight()); -} - -void RenderReplaced::setSelectionState(SelectionState state) { - // The selection state for our containing block hierarchy is updated by the - // base class call. - RenderBox::setSelectionState(state); - - if (!inlineBoxWrapper()) - return; - - if (canUpdateSelectionOnRootLineBoxes()) - inlineBoxWrapper()->root().setHasSelectedChildren(isSelected()); -} - -bool RenderReplaced::isSelected() const { - return false; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderReplaced.h b/sky/engine/core/rendering/RenderReplaced.h deleted file mode 100644 index 41ac2960d597b..0000000000000 --- a/sky/engine/core/rendering/RenderReplaced.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERREPLACED_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERREPLACED_H_ - -#include "flutter/sky/engine/core/rendering/RenderBox.h" - -namespace blink { - -class RenderReplaced : public RenderBox { - public: - RenderReplaced(); - RenderReplaced(const LayoutSize& intrinsicSize); - virtual ~RenderReplaced(); - - virtual LayoutUnit computeReplacedLogicalWidth( - ShouldComputePreferred = ComputeActual) const override; - virtual LayoutUnit computeReplacedLogicalHeight() const override; - - bool hasReplacedLogicalHeight() const; - LayoutRect replacedContentRect( - const LayoutSize* overriddenIntrinsicSize = 0) const; - - virtual bool needsPreferredWidthsRecalculation() const override; - - // These values are specified to be 300 and 150 pixels in the CSS 2.1 spec. - // http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width - static const int defaultWidth; - static const int defaultHeight; - - protected: - virtual void willBeDestroyed() override; - - virtual void layout() override; - - virtual LayoutSize intrinsicSize() const override final { - return m_intrinsicSize; - } - virtual void computeIntrinsicRatioInformation( - FloatSize& intrinsicSize, - double& intrinsicRatio) const override; - - virtual void computeIntrinsicLogicalWidths( - LayoutUnit& minLogicalWidth, - LayoutUnit& maxLogicalWidth) const override final; - - virtual LayoutUnit intrinsicContentLogicalHeight() const { - return intrinsicLogicalHeight(); - } - - virtual LayoutUnit minimumReplacedHeight() const { return LayoutUnit(); } - - virtual void setSelectionState(SelectionState) override final; - - bool isSelected() const; - - void setIntrinsicSize(const LayoutSize& intrinsicSize) { - m_intrinsicSize = intrinsicSize; - } - virtual void intrinsicSizeChanged(); - - virtual void paint(PaintInfo&, - const LayoutPoint&, - Vector& layers) final; - bool shouldPaint(PaintInfo&, const LayoutPoint&); - LayoutRect localSelectionRect(bool checkWhetherSelected = true) - const; // This is in local coordinates, but it's a physical rect (so the - // top left corner is physical top left). - - private: - virtual const char* renderName() const override { return "RenderReplaced"; } - - virtual bool canHaveChildren() const override { return false; } - - virtual void computePreferredLogicalWidths() override final; - virtual void paintReplaced(PaintInfo&, const LayoutPoint&) {} - - virtual PositionWithAffinity positionForPoint( - const LayoutPoint&) override final; - - virtual bool canBeSelectionLeaf() const override { return true; } - - void computeAspectRatioInformationForRenderBox(FloatSize& constrainedSize, - double& intrinsicRatio) const; - - mutable LayoutSize m_intrinsicSize; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERREPLACED_H_ diff --git a/sky/engine/core/rendering/RenderText.cpp b/sky/engine/core/rendering/RenderText.cpp deleted file mode 100644 index 61073e14e1773..0000000000000 --- a/sky/engine/core/rendering/RenderText.cpp +++ /dev/null @@ -1,1650 +0,0 @@ -/* - * (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/RenderText.h" - -#include "flutter/sky/engine/core/rendering/InlineTextBox.h" -#include "flutter/sky/engine/core/rendering/RenderBlock.h" -#include "flutter/sky/engine/core/rendering/RenderLayer.h" -#include "flutter/sky/engine/core/rendering/RenderView.h" -#include "flutter/sky/engine/core/rendering/TextRunConstructor.h" -#include "flutter/sky/engine/core/rendering/break_lines.h" -#include "flutter/sky/engine/platform/fonts/Character.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/text/BidiResolver.h" -#include "flutter/sky/engine/platform/text/TextBox.h" -#include "flutter/sky/engine/platform/text/TextBreakIterator.h" -#include "flutter/sky/engine/platform/text/TextRunIterator.h" -#include "flutter/sky/engine/wtf/text/StringBuffer.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -using namespace WTF; -using namespace Unicode; - -namespace blink { - -struct SameSizeAsRenderText : public RenderObject { - uint32_t bitfields : 16; - float widths[4]; - String text; - void* pointers[2]; -}; - -COMPILE_ASSERT(sizeof(RenderText) == sizeof(SameSizeAsRenderText), - RenderText_should_stay_small); - -RenderText::RenderText(PassRefPtr str) - : m_hasTab(false), - m_linesDirty(false), - m_containsReversedText(false), - m_knownToHaveNoOverflowAndNoFallbackFonts(false), - m_minWidth(-1), - m_maxWidth(-1), - m_firstLineMinWidth(0), - m_lastLineLineMinWidth(0), - m_text(str), - m_firstTextBox(0), - m_lastTextBox(0) { - ASSERT(m_text); - - m_isAllASCII = m_text.containsOnlyASCII(); - m_canUseSimpleFontCodePath = computeCanUseSimpleFontCodePath(); - setIsText(); -} - -#if ENABLE(ASSERT) - -RenderText::~RenderText() { - ASSERT(!m_firstTextBox); - ASSERT(!m_lastTextBox); -} - -#endif - -const char* RenderText::renderName() const { - return "RenderText"; -} - -void RenderText::styleDidChange(StyleDifference diff, - const RenderStyle* oldStyle) { - // There is no need to ever schedule paint invalidations from a style change - // of a text run, since - // we already did this for the parent of the text run. - // We do have to schedule layouts, though, since a style change can force us - // to - // need to relayout. - if (diff.needsFullLayout()) { - setNeedsLayoutAndPrefWidthsRecalc(); - m_knownToHaveNoOverflowAndNoFallbackFonts = false; - } - - // This is an optimization that kicks off font load before layout. - // In order to make it fast, we only check if the first character of the - // text is included in the unicode ranges of the fonts. - if (!text().containsOnlyWhitespace()) - style()->font().willUseFontData(text().characterStartingAt(0)); -} - -void RenderText::removeAndDestroyTextBoxes() { - if (!documentBeingDestroyed()) { - if (firstTextBox()) { - for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) - box->remove(); - } else if (parent()) - parent()->dirtyLinesFromChangedChild(this); - } - deleteTextBoxes(); -} - -void RenderText::willBeDestroyed() { - removeAndDestroyTextBoxes(); - RenderObject::willBeDestroyed(); -} - -void RenderText::extractTextBox(InlineTextBox* box) { - checkConsistency(); - - m_lastTextBox = box->prevTextBox(); - if (box == m_firstTextBox) - m_firstTextBox = 0; - if (box->prevTextBox()) - box->prevTextBox()->setNextTextBox(0); - box->setPreviousTextBox(0); - for (InlineTextBox* curr = box; curr; curr = curr->nextTextBox()) - curr->setExtracted(); - - checkConsistency(); -} - -void RenderText::attachTextBox(InlineTextBox* box) { - checkConsistency(); - - if (m_lastTextBox) { - m_lastTextBox->setNextTextBox(box); - box->setPreviousTextBox(m_lastTextBox); - } else - m_firstTextBox = box; - InlineTextBox* last = box; - for (InlineTextBox* curr = box; curr; curr = curr->nextTextBox()) { - curr->setExtracted(false); - last = curr; - } - m_lastTextBox = last; - - checkConsistency(); -} - -void RenderText::removeTextBox(InlineTextBox* box) { - checkConsistency(); - - if (box == m_firstTextBox) - m_firstTextBox = box->nextTextBox(); - if (box == m_lastTextBox) - m_lastTextBox = box->prevTextBox(); - if (box->nextTextBox()) - box->nextTextBox()->setPreviousTextBox(box->prevTextBox()); - if (box->prevTextBox()) - box->prevTextBox()->setNextTextBox(box->nextTextBox()); - - checkConsistency(); -} - -void RenderText::deleteTextBoxes() { - if (firstTextBox()) { - InlineTextBox* next; - for (InlineTextBox* curr = firstTextBox(); curr; curr = next) { - next = curr->nextTextBox(); - curr->destroy(); - } - m_firstTextBox = m_lastTextBox = 0; - } -} - -static FloatRect localQuadForTextBox(InlineTextBox* box, - unsigned start, - unsigned end, - bool useSelectionHeight) { - unsigned realEnd = std::min(box->end() + 1, end); - LayoutRect r = box->localSelectionRect(start, realEnd); - if (r.height()) { - if (!useSelectionHeight) { - // Change the height and y position (or width and x for vertical text) - // because selectionRect uses selection-specific values. - r.setHeight(box->height()); - r.setY(box->y()); - } - return FloatRect(r); - } - return FloatRect(); -} - -void RenderText::appendAbsoluteTextBoxesForRange(std::vector& boxes, - unsigned start, - unsigned end) { - // Work around signed/unsigned issues. This function takes unsigneds, and is - // often passed UINT_MAX - // to mean "all the way to the end". InlineTextBox coordinates are unsigneds, - // so changing this - // function to take ints causes various internal mismatches. But selectionRect - // takes ints, and - // passing UINT_MAX to it causes trouble. Ideally we'd change selectionRect to - // take unsigneds, but - // that would cause many ripple effects, so for now we'll just clamp our - // unsigned parameters to INT_MAX. - ASSERT(end == UINT_MAX || end <= INT_MAX); - ASSERT(start <= INT_MAX); - start = std::min(start, static_cast(INT_MAX)); - end = std::min(end, static_cast(INT_MAX)); - - for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { - // Note: box->end() returns the index of the last character, not the index - // past it - if (start <= box->start() && box->end() < end) { - FloatRect r = box->calculateBoundaries(); - boxes.emplace_back(localToAbsoluteQuad(r).enclosingBoundingBox(), - box->direction()); - } else { - FloatRect rect = - localQuadForTextBox(box, start, end, /* useSelectionHeight */ false); - if (!rect.isEmpty()) - boxes.emplace_back(localToAbsoluteQuad(rect).enclosingBoundingBox(), - box->direction()); - } - } -} - -void RenderText::absoluteQuads(Vector& quads, - ClippingOption option) const { - for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { - FloatRect boundaries = box->calculateBoundaries(); - quads.append(localToAbsoluteQuad(boundaries, 0)); - } -} - -void RenderText::absoluteQuads(Vector& quads) const { - absoluteQuads(quads, NoClipping); -} - -void RenderText::absoluteQuadsForRange(Vector& quads, - unsigned start, - unsigned end, - bool useSelectionHeight) { - // Work around signed/unsigned issues. This function takes unsigneds, and is - // often passed UINT_MAX - // to mean "all the way to the end". InlineTextBox coordinates are unsigneds, - // so changing this - // function to take ints causes various internal mismatches. But selectionRect - // takes ints, and - // passing UINT_MAX to it causes trouble. Ideally we'd change selectionRect to - // take unsigneds, but - // that would cause many ripple effects, so for now we'll just clamp our - // unsigned parameters to INT_MAX. - ASSERT(end == UINT_MAX || end <= INT_MAX); - ASSERT(start <= INT_MAX); - start = std::min(start, static_cast(INT_MAX)); - end = std::min(end, static_cast(INT_MAX)); - - for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { - // Note: box->end() returns the index of the last character, not the index - // past it - if (start <= box->start() && box->end() < end) { - FloatRect r = box->calculateBoundaries(); - if (useSelectionHeight) { - LayoutRect selectionRect = box->localSelectionRect(start, end); - r.setHeight(selectionRect.height().toFloat()); - r.setY(selectionRect.y().toFloat()); - } - quads.append(localToAbsoluteQuad(r, 0)); - } else { - FloatRect rect = localQuadForTextBox(box, start, end, useSelectionHeight); - if (!rect.isZero()) - quads.append(localToAbsoluteQuad(rect, 0)); - } - } -} - -enum ShouldAffinityBeDownstream { - AlwaysDownstream, - AlwaysUpstream, - UpstreamIfPositionIsNotAtStart -}; - -static bool lineDirectionPointFitsInBox( - int pointLineDirection, - InlineTextBox* box, - ShouldAffinityBeDownstream& shouldAffinityBeDownstream) { - shouldAffinityBeDownstream = AlwaysDownstream; - - // the x coordinate is equal to the left edge of this box - // the affinity must be downstream so the position doesn't jump back to the - // previous line - // except when box is the first box in the line - if (pointLineDirection <= box->logicalLeft()) { - shouldAffinityBeDownstream = !box->prevLeafChild() - ? UpstreamIfPositionIsNotAtStart - : AlwaysDownstream; - return true; - } - - // and the x coordinate is to the left of the right edge of this box - // check to see if position goes in this box - if (pointLineDirection < box->logicalRight()) { - shouldAffinityBeDownstream = UpstreamIfPositionIsNotAtStart; - return true; - } - - // box is first on line - // and the x coordinate is to the left of the first text box left edge - if (!box->prevLeafChildIgnoringLineBreak() && - pointLineDirection < box->logicalLeft()) - return true; - - if (!box->nextLeafChildIgnoringLineBreak()) { - // box is last on line - // and the x coordinate is to the right of the last text box right edge - // generate VisiblePosition, use UPSTREAM affinity if possible - shouldAffinityBeDownstream = UpstreamIfPositionIsNotAtStart; - return true; - } - - return false; -} - -static PositionWithAffinity createPositionWithAffinityForBox( - const InlineBox* box, - int offset, - ShouldAffinityBeDownstream shouldAffinityBeDownstream) { - EAffinity affinity = VP_DEFAULT_AFFINITY; - switch (shouldAffinityBeDownstream) { - case AlwaysDownstream: - affinity = DOWNSTREAM; - break; - case AlwaysUpstream: - affinity = VP_UPSTREAM_IF_POSSIBLE; - break; - case UpstreamIfPositionIsNotAtStart: - affinity = - offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : DOWNSTREAM; - break; - } - int textStartOffset = box->renderer().isText() - ? toRenderText(box->renderer()).textStartOffset() - : 0; - return box->renderer().createPositionWithAffinity(offset + textStartOffset, - affinity); -} - -static PositionWithAffinity -createPositionWithAffinityForBoxAfterAdjustingOffsetForBiDi( - const InlineTextBox* box, - int offset, - ShouldAffinityBeDownstream shouldAffinityBeDownstream) { - ASSERT(box); - ASSERT(offset >= 0); - - if (offset && static_cast(offset) < box->len()) - return createPositionWithAffinityForBox(box, box->start() + offset, - shouldAffinityBeDownstream); - - bool positionIsAtStartOfBox = !offset; - if (positionIsAtStartOfBox == box->isLeftToRightDirection()) { - // offset is on the left edge - - const InlineBox* prevBox = box->prevLeafChildIgnoringLineBreak(); - if ((prevBox && prevBox->bidiLevel() == box->bidiLevel()) || - box->renderer().containingBlock()->style()->direction() == - box->direction()) // FIXME: left on 12CBA - return createPositionWithAffinityForBox(box, box->caretLeftmostOffset(), - shouldAffinityBeDownstream); - - if (prevBox && prevBox->bidiLevel() > box->bidiLevel()) { - // e.g. left of B in aDC12BAb - const InlineBox* leftmostBox; - do { - leftmostBox = prevBox; - prevBox = leftmostBox->prevLeafChildIgnoringLineBreak(); - } while (prevBox && prevBox->bidiLevel() > box->bidiLevel()); - return createPositionWithAffinityForBox( - leftmostBox, leftmostBox->caretRightmostOffset(), - shouldAffinityBeDownstream); - } - - if (!prevBox || prevBox->bidiLevel() < box->bidiLevel()) { - // e.g. left of D in aDC12BAb - const InlineBox* rightmostBox; - const InlineBox* nextBox = box; - do { - rightmostBox = nextBox; - nextBox = rightmostBox->nextLeafChildIgnoringLineBreak(); - } while (nextBox && nextBox->bidiLevel() >= box->bidiLevel()); - return createPositionWithAffinityForBox( - rightmostBox, - box->isLeftToRightDirection() ? rightmostBox->caretMaxOffset() - : rightmostBox->caretMinOffset(), - shouldAffinityBeDownstream); - } - - return createPositionWithAffinityForBox(box, box->caretRightmostOffset(), - shouldAffinityBeDownstream); - } - - const InlineBox* nextBox = box->nextLeafChildIgnoringLineBreak(); - if ((nextBox && nextBox->bidiLevel() == box->bidiLevel()) || - box->renderer().containingBlock()->style()->direction() == - box->direction()) - return createPositionWithAffinityForBox(box, box->caretRightmostOffset(), - shouldAffinityBeDownstream); - - // offset is on the right edge - if (nextBox && nextBox->bidiLevel() > box->bidiLevel()) { - // e.g. right of C in aDC12BAb - const InlineBox* rightmostBox; - do { - rightmostBox = nextBox; - nextBox = rightmostBox->nextLeafChildIgnoringLineBreak(); - } while (nextBox && nextBox->bidiLevel() > box->bidiLevel()); - return createPositionWithAffinityForBox(rightmostBox, - rightmostBox->caretLeftmostOffset(), - shouldAffinityBeDownstream); - } - - if (!nextBox || nextBox->bidiLevel() < box->bidiLevel()) { - // e.g. right of A in aDC12BAb - const InlineBox* leftmostBox; - const InlineBox* prevBox = box; - do { - leftmostBox = prevBox; - prevBox = leftmostBox->prevLeafChildIgnoringLineBreak(); - } while (prevBox && prevBox->bidiLevel() >= box->bidiLevel()); - return createPositionWithAffinityForBox(leftmostBox, - box->isLeftToRightDirection() - ? leftmostBox->caretMinOffset() - : leftmostBox->caretMaxOffset(), - shouldAffinityBeDownstream); - } - - return createPositionWithAffinityForBox(box, box->caretLeftmostOffset(), - shouldAffinityBeDownstream); -} - -PositionWithAffinity RenderText::positionForPoint(const LayoutPoint& point) { - if (!firstTextBox() || textLength() == 0) - return createPositionWithAffinity(0, DOWNSTREAM); - - LayoutUnit pointLineDirection = point.x(); - LayoutUnit pointBlockDirection = point.y(); - - InlineTextBox* lastBox = 0; - for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { - if (box->isLineBreak() && !box->prevLeafChild() && box->nextLeafChild() && - !box->nextLeafChild()->isLineBreak()) - box = box->nextTextBox(); - - RootInlineBox& rootBox = box->root(); - LayoutUnit top = std::min(rootBox.selectionTop(), rootBox.lineTop()); - if (pointBlockDirection > top || pointBlockDirection == top) { - LayoutUnit bottom = rootBox.selectionBottom(); - if (rootBox.nextRootBox()) - bottom = std::min(bottom, rootBox.nextRootBox()->lineTop()); - - if (pointBlockDirection < bottom) { - ShouldAffinityBeDownstream shouldAffinityBeDownstream; - if (lineDirectionPointFitsInBox(pointLineDirection, box, - shouldAffinityBeDownstream)) - return createPositionWithAffinityForBoxAfterAdjustingOffsetForBiDi( - box, box->offsetForPosition(pointLineDirection.toFloat()), - shouldAffinityBeDownstream); - } - } - lastBox = box; - } - - if (lastBox) { - ShouldAffinityBeDownstream shouldAffinityBeDownstream; - lineDirectionPointFitsInBox(pointLineDirection, lastBox, - shouldAffinityBeDownstream); - return createPositionWithAffinityForBoxAfterAdjustingOffsetForBiDi( - lastBox, - lastBox->offsetForPosition(pointLineDirection.toFloat()) + - lastBox->start(), - shouldAffinityBeDownstream); - } - return createPositionWithAffinity(0, DOWNSTREAM); -} - -LayoutRect RenderText::localCaretRect(InlineBox* inlineBox, - int caretOffset, - LayoutUnit* extraWidthToEndOfLine) { - if (!inlineBox) - return LayoutRect(); - - ASSERT(inlineBox->isInlineTextBox()); - if (!inlineBox->isInlineTextBox()) - return LayoutRect(); - - InlineTextBox* box = toInlineTextBox(inlineBox); - - int height = box->root().selectionHeight(); - int top = box->root().selectionTop(); - - // Go ahead and round left to snap it to the nearest pixel. - float left = box->positionForOffset(caretOffset); - - // Distribute the caret's width to either side of the offset. - int caretWidthLeftOfOffset = caretWidth / 2; - left -= caretWidthLeftOfOffset; - int caretWidthRightOfOffset = caretWidth - caretWidthLeftOfOffset; - - left = roundf(left); - - float rootLeft = box->root().logicalLeft(); - float rootRight = box->root().logicalRight(); - - // FIXME: should we use the width of the root inline box or the - // width of the containing block for this? - if (extraWidthToEndOfLine) - *extraWidthToEndOfLine = - (box->root().logicalWidth() + rootLeft) - (left + 1); - - RenderBlock* cb = containingBlock(); - RenderStyle* cbStyle = cb->style(); - - float leftEdge; - float rightEdge; - leftEdge = std::min(0, rootLeft); - rightEdge = std::max(cb->logicalWidth().toFloat(), rootRight); - - bool rightAligned = false; - switch (cbStyle->textAlign()) { - case RIGHT: - rightAligned = true; - break; - case LEFT: - case CENTER: - break; - case JUSTIFY: - case TASTART: - rightAligned = !cbStyle->isLeftToRightDirection(); - break; - case TAEND: - rightAligned = cbStyle->isLeftToRightDirection(); - break; - } - - if (rightAligned) { - left = std::max(left, leftEdge); - left = std::min(left, rootRight - caretWidth); - } else { - left = std::min(left, rightEdge - caretWidthRightOfOffset); - left = std::max(left, rootLeft); - } - - return IntRect(left, top, caretWidth, height); -} - -ALWAYS_INLINE float RenderText::widthFromCache( - const Font& f, - int start, - int len, - float xPos, - TextDirection textDirection, - HashSet* fallbackFonts, - GlyphOverflow* glyphOverflow) const { - if (f.isFixedPitch() && f.fontDescription().variant() == FontVariantNormal && - m_isAllASCII && (!glyphOverflow || !glyphOverflow->computeBounds)) { - float monospaceCharacterWidth = f.spaceWidth(); - float w = 0; - bool isSpace; - ASSERT(m_text); - StringImpl& text = *m_text.impl(); - for (int i = start; i < start + len; i++) { - char c = text[i]; - if (c <= space) { - if (c == space || c == newlineCharacter) { - w += monospaceCharacterWidth; - isSpace = true; - } else if (c == characterTabulation) { - if (style()->collapseWhiteSpace()) { - w += monospaceCharacterWidth; - isSpace = true; - } else { - w += f.tabWidth(style()->tabSize(), xPos + w); - isSpace = false; - } - } else - isSpace = false; - } else { - w += monospaceCharacterWidth; - isSpace = false; - } - if (isSpace && i > start) - w += f.fontDescription().wordSpacing(); - } - return w; - } - - TextRun run = constructTextRun(const_cast(this), f, this, start, - len, style(), textDirection); - run.setCharactersLength(textLength() - start); - ASSERT(run.charactersLength() >= run.length()); - - run.setCharacterScanForCodePath(!canUseSimpleFontCodePath()); - run.setTabSize(!style()->collapseWhiteSpace(), style()->tabSize()); - run.setXPos(xPos); - FontCachePurgePreventer fontCachePurgePreventer; - return f.width(run, fallbackFonts, glyphOverflow); -} - -void RenderText::trimmedPrefWidths(float leadWidth, - float& firstLineMinWidth, - bool& hasBreakableStart, - float& lastLineMinWidth, - bool& hasBreakableEnd, - bool& hasBreakableChar, - bool& hasBreak, - float& firstLineMaxWidth, - float& lastLineMaxWidth, - float& minWidth, - float& maxWidth, - bool& stripFrontSpaces, - TextDirection direction) { - bool collapseWhiteSpace = style()->collapseWhiteSpace(); - if (!collapseWhiteSpace) - stripFrontSpaces = false; - - if (m_hasTab || preferredLogicalWidthsDirty()) - computePreferredLogicalWidths(leadWidth); - - hasBreakableStart = !stripFrontSpaces && m_hasBreakableStart; - hasBreakableEnd = m_hasBreakableEnd; - - int len = textLength(); - - if (!len || (stripFrontSpaces && text().impl()->containsOnlyWhitespace())) { - firstLineMinWidth = 0; - lastLineMinWidth = 0; - firstLineMaxWidth = 0; - lastLineMaxWidth = 0; - minWidth = 0; - maxWidth = 0; - hasBreak = false; - return; - } - - minWidth = m_minWidth; - maxWidth = m_maxWidth; - - firstLineMinWidth = m_firstLineMinWidth; - lastLineMinWidth = m_lastLineLineMinWidth; - - hasBreakableChar = m_hasBreakableChar; - hasBreak = m_hasBreak; - - ASSERT(m_text); - StringImpl& text = *m_text.impl(); - if (text[0] == space || - (text[0] == newlineCharacter && !style()->preserveNewline()) || - text[0] == characterTabulation) { - const Font& font = style()->font(); // FIXME: This ignores first-line. - if (stripFrontSpaces) { - const UChar spaceChar = space; - float spaceWidth = font.width( - constructTextRun(this, font, &spaceChar, 1, style(), direction)); - maxWidth -= spaceWidth; - } else { - maxWidth += font.fontDescription().wordSpacing(); - } - } - - stripFrontSpaces = collapseWhiteSpace && m_hasEndWhiteSpace; - - if (!style()->autoWrap() || minWidth > maxWidth) - minWidth = maxWidth; - - // Compute our max widths by scanning the string for newlines. - if (hasBreak) { - const Font& f = style()->font(); // FIXME: This ignores first-line. - bool firstLine = true; - firstLineMaxWidth = maxWidth; - lastLineMaxWidth = maxWidth; - for (int i = 0; i < len; i++) { - int linelen = 0; - while (i + linelen < len && text[i + linelen] != newlineCharacter) - linelen++; - - if (linelen) { - lastLineMaxWidth = widthFromCache( - f, i, linelen, leadWidth + lastLineMaxWidth, direction, 0, 0); - if (firstLine) { - firstLine = false; - leadWidth = 0; - firstLineMaxWidth = lastLineMaxWidth; - } - i += linelen; - } else if (firstLine) { - firstLineMaxWidth = 0; - firstLine = false; - leadWidth = 0; - } - - if (i == len - 1) { - // A
 run that ends with a newline, as in, e.g.,
-        // 
Some text\n\nMore text
- lastLineMaxWidth = 0; - } - } - } -} - -float RenderText::minLogicalWidth() const { - if (preferredLogicalWidthsDirty()) - const_cast(this)->computePreferredLogicalWidths(0); - - return m_minWidth; -} - -float RenderText::maxLogicalWidth() const { - if (preferredLogicalWidthsDirty()) - const_cast(this)->computePreferredLogicalWidths(0); - - return m_maxWidth; -} - -void RenderText::computePreferredLogicalWidths(float leadWidth) { - HashSet fallbackFonts; - GlyphOverflow glyphOverflow; - computePreferredLogicalWidths(leadWidth, fallbackFonts, glyphOverflow); - - // We shouldn't change our mind once we "know". - ASSERT(!m_knownToHaveNoOverflowAndNoFallbackFonts || - (fallbackFonts.isEmpty() && glyphOverflow.isZero())); - m_knownToHaveNoOverflowAndNoFallbackFonts = - fallbackFonts.isEmpty() && glyphOverflow.isZero(); -} - -static inline float hyphenWidth(RenderText* renderer, - const Font& font, - TextDirection direction) { - RenderStyle* style = renderer->style(); - return font.width(constructTextRun( - renderer, font, style->hyphenString().string(), style, direction)); -} - -void RenderText::computePreferredLogicalWidths( - float leadWidth, - HashSet& fallbackFonts, - GlyphOverflow& glyphOverflow) { - ASSERT(m_hasTab || preferredLogicalWidthsDirty() || - !m_knownToHaveNoOverflowAndNoFallbackFonts); - - m_minWidth = 0; - m_maxWidth = 0; - m_firstLineMinWidth = 0; - m_lastLineLineMinWidth = 0; - - float currMinWidth = 0; - float currMaxWidth = 0; - m_hasBreakableChar = false; - m_hasBreak = false; - m_hasTab = false; - m_hasBreakableStart = false; - m_hasBreakableEnd = false; - m_hasEndWhiteSpace = false; - - RenderStyle* styleToUse = style(); - const Font& f = styleToUse->font(); // FIXME: This ignores first-line. - float wordSpacing = styleToUse->wordSpacing(); - int len = textLength(); - LazyLineBreakIterator breakIterator(m_text, styleToUse->locale()); - bool needsWordSpacing = false; - bool ignoringSpaces = false; - bool isSpace = false; - bool firstWord = true; - bool firstLine = true; - int nextBreakable = -1; - int lastWordBoundary = 0; - float cachedWordTrailingSpaceWidth[2] = {0, 0}; // LTR, RTL - - int firstGlyphLeftOverflow = -1; - - bool breakAll = (styleToUse->wordBreak() == BreakAllWordBreak || - styleToUse->wordBreak() == BreakWordBreak) && - styleToUse->autoWrap(); - - TextRun textRun(text()); - BidiResolver bidiResolver; - - BidiCharacterRun* run; - TextDirection textDirection = styleToUse->direction(); - if (isOverride(styleToUse->unicodeBidi())) { - run = 0; - } else { - BidiStatus status(textDirection, false); - bidiResolver.setStatus(status); - bidiResolver.setPositionIgnoringNestedIsolates( - TextRunIterator(&textRun, 0)); - bool hardLineBreak = false; - bool reorderRuns = false; - bidiResolver.createBidiRunsForLine( - TextRunIterator(&textRun, textRun.length()), NoVisualOverride, - hardLineBreak, reorderRuns); - BidiRunList& bidiRuns = bidiResolver.runs(); - run = bidiRuns.firstRun(); - } - - for (int i = 0; i < len; i++) { - UChar c = uncheckedCharacterAt(i); - - if (run) { - // Treat adjacent runs with the same resolved directionality - // (TextDirection as opposed to WTF::Unicode::Direction) as belonging - // to the same run to avoid breaking unnecessarily. - while (i >= run->stop() || - (run->next() && run->next()->direction() == run->direction())) - run = run->next(); - - ASSERT(run); - ASSERT(i <= run->stop()); - textDirection = run->direction(); - } - - bool previousCharacterIsSpace = isSpace; - bool isNewline = false; - if (c == newlineCharacter) { - if (styleToUse->preserveNewline()) { - m_hasBreak = true; - isNewline = true; - isSpace = false; - } else - isSpace = true; - } else if (c == characterTabulation) { - if (!styleToUse->collapseWhiteSpace()) { - m_hasTab = true; - isSpace = false; - } else - isSpace = true; - } else { - isSpace = c == space; - } - - bool isBreakableLocation = isNewline || (isSpace && styleToUse->autoWrap()); - if (!i) - m_hasBreakableStart = isBreakableLocation; - if (i == len - 1) { - m_hasBreakableEnd = isBreakableLocation; - m_hasEndWhiteSpace = isNewline || isSpace; - } - - if (!ignoringSpaces && styleToUse->collapseWhiteSpace() && - previousCharacterIsSpace && isSpace) - ignoringSpaces = true; - - if (ignoringSpaces && !isSpace) - ignoringSpaces = false; - - // Ignore spaces and soft hyphens - if (ignoringSpaces) { - ASSERT(lastWordBoundary == i); - lastWordBoundary++; - continue; - } else if (c == softHyphen) { - currMaxWidth += widthFromCache(f, lastWordBoundary, i - lastWordBoundary, - leadWidth + currMaxWidth, textDirection, - &fallbackFonts, &glyphOverflow); - if (firstGlyphLeftOverflow < 0) - firstGlyphLeftOverflow = glyphOverflow.left; - lastWordBoundary = i + 1; - continue; - } - - bool hasBreak = breakAll || isBreakable(breakIterator, i, nextBreakable); - bool betweenWords = true; - int j = i; - while (c != newlineCharacter && c != space && c != characterTabulation && - (c != softHyphen)) { - j++; - if (j == len) - break; - c = uncheckedCharacterAt(j); - if (isBreakable(breakIterator, j, nextBreakable) && - characterAt(j - 1) != softHyphen) - break; - if (breakAll) { - betweenWords = false; - break; - } - } - - // Terminate word boundary at bidi run boundary. - if (run) - j = std::min(j, run->stop() + 1); - int wordLen = j - i; - if (wordLen) { - bool isSpace = (j < len) && c == space; - - // Non-zero only when kerning is enabled, in which case we measure words - // with their trailing - // space, then subtract its width. - float wordTrailingSpaceWidth = 0; - if (isSpace && (f.fontDescription().typesettingFeatures() & Kerning)) { - ASSERT(textDirection >= 0 && textDirection <= 1); - if (!cachedWordTrailingSpaceWidth[textDirection]) - cachedWordTrailingSpaceWidth[textDirection] = - f.width(constructTextRun(this, f, &space, 1, styleToUse, - textDirection)) + - wordSpacing; - wordTrailingSpaceWidth = cachedWordTrailingSpaceWidth[textDirection]; - } - - float w; - if (wordTrailingSpaceWidth && isSpace) - w = widthFromCache(f, i, wordLen + 1, leadWidth + currMaxWidth, - textDirection, &fallbackFonts, &glyphOverflow) - - wordTrailingSpaceWidth; - else { - w = widthFromCache(f, i, wordLen, leadWidth + currMaxWidth, - textDirection, &fallbackFonts, &glyphOverflow); - if (c == softHyphen) - currMinWidth += hyphenWidth(this, f, textDirection); - } - - if (firstGlyphLeftOverflow < 0) - firstGlyphLeftOverflow = glyphOverflow.left; - currMinWidth += w; - if (betweenWords) { - if (lastWordBoundary == i) - currMaxWidth += w; - else - currMaxWidth += - widthFromCache(f, lastWordBoundary, j - lastWordBoundary, - leadWidth + currMaxWidth, textDirection, - &fallbackFonts, &glyphOverflow); - lastWordBoundary = j; - } - - bool isCollapsibleWhiteSpace = - (j < len) && styleToUse->isCollapsibleWhiteSpace(c); - if (j < len && styleToUse->autoWrap()) - m_hasBreakableChar = true; - - // Add in wordSpacing to our currMaxWidth, but not if this is the last - // word on a line or the - // last word in the run. - if (wordSpacing && (isSpace || isCollapsibleWhiteSpace) && - !containsOnlyWhitespace(j, len - j)) - currMaxWidth += wordSpacing; - - if (firstWord) { - firstWord = false; - // If the first character in the run is breakable, then we consider - // ourselves to have a beginning - // minimum width of 0, since a break could occur right before our run - // starts, preventing us from ever - // being appended to a previous text run when considering the total - // minimum width of the containing block. - if (hasBreak) - m_hasBreakableChar = true; - m_firstLineMinWidth = hasBreak ? 0 : currMinWidth; - } - m_lastLineLineMinWidth = currMinWidth; - - if (currMinWidth > m_minWidth) - m_minWidth = currMinWidth; - currMinWidth = 0; - - i += wordLen - 1; - } else { - // Nowrap can never be broken, so don't bother setting the - // breakable character boolean. Pre can only be broken if we encounter a - // newline. - if (style()->autoWrap() || isNewline) - m_hasBreakableChar = true; - - if (currMinWidth > m_minWidth) - m_minWidth = currMinWidth; - currMinWidth = 0; - - if (isNewline) { // Only set if preserveNewline was true and we saw a - // newline. - if (firstLine) { - firstLine = false; - leadWidth = 0; - if (!styleToUse->autoWrap()) - m_firstLineMinWidth = currMaxWidth; - } - - if (currMaxWidth > m_maxWidth) - m_maxWidth = currMaxWidth; - currMaxWidth = 0; - } else { - TextRun run = - constructTextRun(this, f, this, i, 1, styleToUse, textDirection); - run.setCharactersLength(len - i); - ASSERT(run.charactersLength() >= run.length()); - run.setTabSize(!style()->collapseWhiteSpace(), style()->tabSize()); - run.setXPos(leadWidth + currMaxWidth); - - currMaxWidth += f.width(run); - glyphOverflow.right = 0; - needsWordSpacing = isSpace && !previousCharacterIsSpace && i == len - 1; - } - ASSERT(lastWordBoundary == i); - lastWordBoundary++; - } - } - if (run) - bidiResolver.runs().deleteRuns(); - - if (firstGlyphLeftOverflow > 0) - glyphOverflow.left = firstGlyphLeftOverflow; - - if ((needsWordSpacing && len > 1) || (ignoringSpaces && !firstWord)) - currMaxWidth += wordSpacing; - - m_minWidth = std::max(currMinWidth, m_minWidth); - m_maxWidth = std::max(currMaxWidth, m_maxWidth); - - if (!styleToUse->autoWrap()) - m_minWidth = m_maxWidth; - - if (styleToUse->whiteSpace() == PRE) { - if (firstLine) - m_firstLineMinWidth = m_maxWidth; - m_lastLineLineMinWidth = currMaxWidth; - } - - clearPreferredLogicalWidthsDirty(); -} - -bool RenderText::isAllCollapsibleWhitespace() const { - unsigned length = textLength(); - if (is8Bit()) { - for (unsigned i = 0; i < length; ++i) { - if (!style()->isCollapsibleWhiteSpace(characters8()[i])) - return false; - } - return true; - } - for (unsigned i = 0; i < length; ++i) { - if (!style()->isCollapsibleWhiteSpace(characters16()[i])) - return false; - } - return true; -} - -bool RenderText::containsOnlyWhitespace(unsigned from, unsigned len) const { - ASSERT(m_text); - StringImpl& text = *m_text.impl(); - unsigned currPos; - for (currPos = from; - currPos < from + len && - (text[currPos] == newlineCharacter || text[currPos] == space || - text[currPos] == characterTabulation); - currPos++) { - } - return currPos >= (from + len); -} - -FloatPoint RenderText::firstRunOrigin() const { - return IntPoint(firstRunX(), firstRunY()); -} - -float RenderText::firstRunX() const { - return m_firstTextBox ? m_firstTextBox->x() : 0; -} - -float RenderText::firstRunY() const { - return m_firstTextBox ? m_firstTextBox->y() : 0; -} - -void RenderText::setSelectionState(SelectionState state) { - RenderObject::setSelectionState(state); - - if (canUpdateSelectionOnRootLineBoxes()) { - if (state == SelectionStart || state == SelectionEnd || - state == SelectionBoth) { - int startPos, endPos; - selectionStartEnd(startPos, endPos); - if (selectionState() == SelectionStart) { - endPos = textLength(); - - // to handle selection from end of text to end of line - if (startPos && startPos == endPos) - startPos = endPos - 1; - } else if (selectionState() == SelectionEnd) - startPos = 0; - - for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { - if (box->isSelected(startPos, endPos)) { - box->root().setHasSelectedChildren(true); - } - } - } else { - for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { - box->root().setHasSelectedChildren(state == SelectionInside); - } - } - } - - // The containing block can be null in case of an orphaned tree. - RenderBlock* containingBlock = this->containingBlock(); - if (containingBlock && !containingBlock->isRenderView()) - containingBlock->setSelectionState(state); -} - -void RenderText::setTextWithOffset(PassRefPtr text, - unsigned offset, - unsigned len, - bool force) { - if (!force && equal(m_text.impl(), text.get())) - return; - - unsigned oldLen = textLength(); - unsigned newLen = text->length(); - int delta = newLen - oldLen; - unsigned end = len ? offset + len - 1 : offset; - - RootInlineBox* firstRootBox = 0; - RootInlineBox* lastRootBox = 0; - - bool dirtiedLines = false; - - // Dirty all text boxes that include characters in between offset and - // offset+len. - for (InlineTextBox* curr = firstTextBox(); curr; curr = curr->nextTextBox()) { - // FIXME: This shouldn't rely on the end of a dirty line box. See - // https://bugs.webkit.org/show_bug.cgi?id=97264 - // Text run is entirely before the affected range. - if (curr->end() < offset) - continue; - - // Text run is entirely after the affected range. - if (curr->start() > end) { - curr->offsetRun(delta); - RootInlineBox* root = &curr->root(); - if (!firstRootBox) { - firstRootBox = root; - // The affected area was in between two runs. Go ahead and mark the root - // box of - // the run after the affected area as dirty. - firstRootBox->markDirty(); - dirtiedLines = true; - } - lastRootBox = root; - } else if (curr->end() >= offset && curr->end() <= end) { - // Text run overlaps with the left end of the affected range. - curr->dirtyLineBoxes(); - dirtiedLines = true; - } else if (curr->start() <= offset && curr->end() >= end) { - // Text run subsumes the affected range. - curr->dirtyLineBoxes(); - dirtiedLines = true; - } else if (curr->start() <= end && curr->end() >= end) { - // Text run overlaps with right end of the affected range. - curr->dirtyLineBoxes(); - dirtiedLines = true; - } - } - - // Now we have to walk all of the clean lines and adjust their cached line - // break information - // to reflect our updated offsets. - if (lastRootBox) - lastRootBox = lastRootBox->nextRootBox(); - if (firstRootBox) { - RootInlineBox* prev = firstRootBox->prevRootBox(); - if (prev) - firstRootBox = prev; - } else if (lastTextBox()) { - ASSERT(!lastRootBox); - firstRootBox = &lastTextBox()->root(); - firstRootBox->markDirty(); - dirtiedLines = true; - } - for (RootInlineBox* curr = firstRootBox; curr && curr != lastRootBox; - curr = curr->nextRootBox()) { - if (curr->lineBreakObj() == this && curr->lineBreakPos() > end) - curr->setLineBreakPos(clampToInteger(curr->lineBreakPos() + delta)); - } - - // If the text node is empty, dirty the line where new text will be inserted. - if (!firstTextBox() && parent()) { - parent()->dirtyLinesFromChangedChild(this); - dirtiedLines = true; - } - - m_linesDirty = dirtiedLines; - setText(text, force || dirtiedLines); -} - -static inline bool isInlineFlowOrEmptyText(const RenderObject* o) { - if (o->isRenderInline()) - return true; - if (!o->isText()) - return false; - return toRenderText(o)->text().isEmpty(); -} - -UChar RenderText::previousCharacter() const { - // find previous text renderer if one exists - const RenderObject* previousText = previousInPreOrder(); - for (; previousText; previousText = previousText->previousInPreOrder()) - if (!isInlineFlowOrEmptyText(previousText)) - break; - UChar prev = space; - if (previousText && previousText->isText()) - if (StringImpl* previousString = toRenderText(previousText)->text().impl()) - prev = (*previousString)[previousString->length() - 1]; - return prev; -} - -void RenderText::setTextInternal(PassRefPtr text) { - ASSERT(text); - m_text = text; - - ASSERT(m_text); - - m_isAllASCII = m_text.containsOnlyASCII(); - m_canUseSimpleFontCodePath = computeCanUseSimpleFontCodePath(); -} - -void RenderText::setText(PassRefPtr text, bool force) { - ASSERT(text); - - if (!force && equal(m_text.impl(), text.get())) - return; - - setTextInternal(text); - // If preferredLogicalWidthsDirty() of an orphan child is true, - // RenderObjectChildList:: - // insertChildNode() fails to set true to owner. To avoid that, we call - // setNeedsLayoutAndPrefWidthsRecalc() only if this RenderText has parent. - if (parent()) - setNeedsLayoutAndPrefWidthsRecalc(); - m_knownToHaveNoOverflowAndNoFallbackFonts = false; -} - -void RenderText::dirtyLineBoxes(bool fullLayout) { - if (fullLayout) - deleteTextBoxes(); - else if (!m_linesDirty) { - for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) - box->dirtyLineBoxes(); - } - m_linesDirty = false; -} - -InlineTextBox* RenderText::createTextBox() { - return new InlineTextBox(*this); -} - -InlineTextBox* RenderText::createInlineTextBox() { - InlineTextBox* textBox = createTextBox(); - if (!m_firstTextBox) - m_firstTextBox = m_lastTextBox = textBox; - else { - m_lastTextBox->setNextTextBox(textBox); - textBox->setPreviousTextBox(m_lastTextBox); - m_lastTextBox = textBox; - } - textBox->setIsText(true); - return textBox; -} - -void RenderText::positionLineBox(InlineBox* box) { - InlineTextBox* s = toInlineTextBox(box); - - // FIXME: should not be needed!!! - if (!s->len()) { - // We want the box to be destroyed. - s->remove(DontMarkLineBoxes); - if (m_firstTextBox == s) - m_firstTextBox = s->nextTextBox(); - else - s->prevTextBox()->setNextTextBox(s->nextTextBox()); - if (m_lastTextBox == s) - m_lastTextBox = s->prevTextBox(); - else - s->nextTextBox()->setPreviousTextBox(s->prevTextBox()); - s->destroy(); - return; - } - - m_containsReversedText |= !s->isLeftToRightDirection(); -} - -float RenderText::width(unsigned from, - unsigned len, - float xPos, - TextDirection textDirection, - bool firstLine, - HashSet* fallbackFonts, - GlyphOverflow* glyphOverflow) const { - if (from >= textLength()) - return 0; - - if (from + len > textLength()) - len = textLength() - from; - - return width(from, len, style(firstLine)->font(), xPos, textDirection, - fallbackFonts, glyphOverflow); -} - -float RenderText::width(unsigned from, - unsigned len, - const Font& f, - float xPos, - TextDirection textDirection, - HashSet* fallbackFonts, - GlyphOverflow* glyphOverflow) const { - ASSERT(from + len <= textLength()); - if (!textLength()) - return 0; - - float w; - if (&f == &style()->font()) { - if (!style()->preserveNewline() && !from && len == textLength() && - (!glyphOverflow || !glyphOverflow->computeBounds)) { - if (fallbackFonts) { - ASSERT(glyphOverflow); - if (preferredLogicalWidthsDirty() || - !m_knownToHaveNoOverflowAndNoFallbackFonts) { - const_cast(this)->computePreferredLogicalWidths( - 0, *fallbackFonts, *glyphOverflow); - // We shouldn't change our mind once we "know". - ASSERT(!m_knownToHaveNoOverflowAndNoFallbackFonts || - (fallbackFonts->isEmpty() && glyphOverflow->isZero())); - m_knownToHaveNoOverflowAndNoFallbackFonts = - fallbackFonts->isEmpty() && glyphOverflow->isZero(); - } - w = m_maxWidth; - } else { - w = maxLogicalWidth(); - } - } else { - w = widthFromCache(f, from, len, xPos, textDirection, fallbackFonts, - glyphOverflow); - } - } else { - TextRun run = constructTextRun(const_cast(this), f, this, from, - len, style(), textDirection); - run.setCharactersLength(textLength() - from); - ASSERT(run.charactersLength() >= run.length()); - - run.setCharacterScanForCodePath(!canUseSimpleFontCodePath()); - run.setTabSize(!style()->collapseWhiteSpace(), style()->tabSize()); - run.setXPos(xPos); - w = f.width(run, fallbackFonts, glyphOverflow); - } - - return w; -} - -IntRect RenderText::linesBoundingBox() const { - IntRect result; - - ASSERT(!firstTextBox() == - !lastTextBox()); // Either both are null or both exist. - if (firstTextBox() && lastTextBox()) { - // Return the width of the minimal left side and the maximal right side. - float logicalLeftSide = 0; - float logicalRightSide = 0; - for (InlineTextBox* curr = firstTextBox(); curr; - curr = curr->nextTextBox()) { - if (curr == firstTextBox() || curr->logicalLeft() < logicalLeftSide) - logicalLeftSide = curr->logicalLeft(); - if (curr == firstTextBox() || curr->logicalRight() > logicalRightSide) - logicalRightSide = curr->logicalRight(); - } - - float x = logicalLeftSide; - float y = firstTextBox()->y(); - float width = logicalRightSide - logicalLeftSide; - float height = lastTextBox()->logicalBottom() - y; - result = enclosingIntRect(FloatRect(x, y, width, height)); - } - - return result; -} - -LayoutRect RenderText::linesVisualOverflowBoundingBox() const { - if (!firstTextBox()) - return LayoutRect(); - - // Return the width of the minimal left side and the maximal right side. - LayoutUnit logicalLeftSide = LayoutUnit::max(); - LayoutUnit logicalRightSide = LayoutUnit::min(); - for (InlineTextBox* curr = firstTextBox(); curr; curr = curr->nextTextBox()) { - LayoutRect logicalVisualOverflow = curr->logicalOverflowRect(); - logicalLeftSide = std::min(logicalLeftSide, logicalVisualOverflow.x()); - logicalRightSide = std::max(logicalRightSide, logicalVisualOverflow.maxX()); - } - - LayoutUnit logicalTop = firstTextBox()->logicalTopVisualOverflow(); - LayoutUnit logicalWidth = logicalRightSide - logicalLeftSide; - LayoutUnit logicalHeight = - lastTextBox()->logicalBottomVisualOverflow() - logicalTop; - - LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); - return rect; -} - -int RenderText::caretMinOffset() const { - InlineTextBox* box = firstTextBox(); - if (!box) - return 0; - int minOffset = box->start(); - for (box = box->nextTextBox(); box; box = box->nextTextBox()) - minOffset = std::min(minOffset, box->start()); - return minOffset; -} - -int RenderText::caretMaxOffset() const { - InlineTextBox* box = lastTextBox(); - if (!lastTextBox()) - return textLength(); - - int maxOffset = box->start() + box->len(); - for (box = box->prevTextBox(); box; box = box->prevTextBox()) - maxOffset = std::max(maxOffset, box->start() + box->len()); - return maxOffset; -} - -unsigned RenderText::renderedTextLength() const { - int l = 0; - for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) - l += box->len(); - return l; -} - -int RenderText::previousOffset(int current) const { - if (isAllASCII() || m_text.is8Bit()) - return current - 1; - - StringImpl* textImpl = m_text.impl(); - TextBreakIterator* iterator = - cursorMovementIterator(textImpl->characters16(), textImpl->length()); - if (!iterator) - return current - 1; - - long result = iterator->preceding(current); - if (result == TextBreakDone) - result = current - 1; - - return result; -} - -#if OS(POSIX) - -#define HANGUL_CHOSEONG_START (0x1100) -#define HANGUL_CHOSEONG_END (0x115F) -#define HANGUL_JUNGSEONG_START (0x1160) -#define HANGUL_JUNGSEONG_END (0x11A2) -#define HANGUL_JONGSEONG_START (0x11A8) -#define HANGUL_JONGSEONG_END (0x11F9) -#define HANGUL_SYLLABLE_START (0xAC00) -#define HANGUL_SYLLABLE_END (0xD7AF) -#define HANGUL_JONGSEONG_COUNT (28) - -enum HangulState { - HangulStateL, - HangulStateV, - HangulStateT, - HangulStateLV, - HangulStateLVT, - HangulStateBreak -}; - -inline bool isHangulLVT(UChar32 character) { - return (character - HANGUL_SYLLABLE_START) % HANGUL_JONGSEONG_COUNT; -} - -inline bool isMark(UChar32 c) { - int8_t charType = u_charType(c); - return charType == U_NON_SPACING_MARK || charType == U_ENCLOSING_MARK || - charType == U_COMBINING_SPACING_MARK; -} - -inline bool isRegionalIndicator(UChar32 c) { - // National flag emoji each consists of a pair of regional indicator symbols. - return 0x1F1E6 <= c && c <= 0x1F1FF; -} - -#endif - -int RenderText::previousOffsetForBackwardDeletion(int current) const { -#if OS(POSIX) - ASSERT(m_text); - StringImpl& text = *m_text.impl(); - UChar32 character; - bool sawRegionalIndicator = false; - while (current > 0) { - if (U16_IS_TRAIL(text[--current])) - --current; - if (current < 0) - break; - - UChar32 character = text.characterStartingAt(current); - - if (sawRegionalIndicator) { - // We don't check if the pair of regional indicator symbols before current - // position can actually be combined - // into a flag, and just delete it. This may not agree with how the pair - // is rendered in edge cases, - // but is good enough in practice. - if (isRegionalIndicator(character)) - break; - // Don't delete a preceding character that isn't a regional indicator - // symbol. - U16_FWD_1_UNSAFE(text, current); - } - - // We don't combine characters in Armenian ... Limbu range for backward - // deletion. - if ((character >= 0x0530) && (character < 0x1950)) - break; - - if (isRegionalIndicator(character)) { - sawRegionalIndicator = true; - continue; - } - - if (!isMark(character) && (character != 0xFF9E) && (character != 0xFF9F)) - break; - } - - if (current <= 0) - return current; - - // Hangul - character = text.characterStartingAt(current); - if (((character >= HANGUL_CHOSEONG_START) && - (character <= HANGUL_JONGSEONG_END)) || - ((character >= HANGUL_SYLLABLE_START) && - (character <= HANGUL_SYLLABLE_END))) { - HangulState state; - - if (character < HANGUL_JUNGSEONG_START) - state = HangulStateL; - else if (character < HANGUL_JONGSEONG_START) - state = HangulStateV; - else if (character < HANGUL_SYLLABLE_START) - state = HangulStateT; - else - state = isHangulLVT(character) ? HangulStateLVT : HangulStateLV; - - while (current > 0 && - ((character = text.characterStartingAt(current - 1)) >= - HANGUL_CHOSEONG_START) && - (character <= HANGUL_SYLLABLE_END) && - ((character <= HANGUL_JONGSEONG_END) || - (character >= HANGUL_SYLLABLE_START))) { - switch (state) { - case HangulStateV: - if (character <= HANGUL_CHOSEONG_END) - state = HangulStateL; - else if ((character >= HANGUL_SYLLABLE_START) && - (character <= HANGUL_SYLLABLE_END) && - !isHangulLVT(character)) - state = HangulStateLV; - else if (character > HANGUL_JUNGSEONG_END) - state = HangulStateBreak; - break; - case HangulStateT: - if ((character >= HANGUL_JUNGSEONG_START) && - (character <= HANGUL_JUNGSEONG_END)) - state = HangulStateV; - else if ((character >= HANGUL_SYLLABLE_START) && - (character <= HANGUL_SYLLABLE_END)) - state = (isHangulLVT(character) ? HangulStateLVT : HangulStateLV); - else if (character < HANGUL_JUNGSEONG_START) - state = HangulStateBreak; - break; - default: - state = (character < HANGUL_JUNGSEONG_START) ? HangulStateL - : HangulStateBreak; - break; - } - if (state == HangulStateBreak) - break; - - --current; - } - } - - return current; -#else - // Platforms other than Unix-like delete by one code point. - if (U16_IS_TRAIL(m_text[--current])) - --current; - if (current < 0) - current = 0; - return current; -#endif -} - -int RenderText::nextOffset(int current) const { - if (isAllASCII() || m_text.is8Bit()) - return current + 1; - - StringImpl* textImpl = m_text.impl(); - TextBreakIterator* iterator = - cursorMovementIterator(textImpl->characters16(), textImpl->length()); - if (!iterator) - return current + 1; - - long result = iterator->following(current); - if (result == TextBreakDone) - result = current + 1; - - return result; -} - -bool RenderText::computeCanUseSimpleFontCodePath() const { - if (isAllASCII() || m_text.is8Bit()) - return true; - return Character::characterRangeCodePath(characters16(), length()) == - SimplePath; -} - -#if ENABLE(ASSERT) - -void RenderText::checkConsistency() const { -#ifdef CHECK_CONSISTENCY - const InlineTextBox* prev = 0; - for (const InlineTextBox* child = m_firstTextBox; child != 0; - child = child->nextTextBox()) { - ASSERT(child->renderer() == this); - ASSERT(child->prevTextBox() == prev); - prev = child; - } - ASSERT(prev == m_lastTextBox); -#endif -} - -#endif - -} // namespace blink diff --git a/sky/engine/core/rendering/RenderText.h b/sky/engine/core/rendering/RenderText.h deleted file mode 100644 index 7b7b3e8dae892..0000000000000 --- a/sky/engine/core/rendering/RenderText.h +++ /dev/null @@ -1,277 +0,0 @@ -/* - * (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004-2009, 2013 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERTEXT_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERTEXT_H_ - -#include - -#include "flutter/sky/engine/core/rendering/RenderObject.h" -#include "flutter/sky/engine/platform/LengthFunctions.h" -#include "flutter/sky/engine/platform/text/TextPath.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" - -namespace blink { -class InlineTextBox; -class TextBox; - -class RenderText : public RenderObject { - public: - // FIXME: If the node argument is not a Text node or the string argument is - // not the content of the Text node, updating text-transform property - // doesn't re-transform the string. - RenderText(PassRefPtr); -#if ENABLE(ASSERT) - virtual ~RenderText(); -#endif - - virtual const char* renderName() const override; - - void extractTextBox(InlineTextBox*); - void attachTextBox(InlineTextBox*); - void removeTextBox(InlineTextBox*); - - const String& text() const { return m_text; } - virtual unsigned textStartOffset() const { return 0; } - - InlineTextBox* createInlineTextBox(); - void dirtyLineBoxes(bool fullLayout); - - void appendAbsoluteTextBoxesForRange(std::vector&, - unsigned startOffset = 0, - unsigned endOffset = INT_MAX); - - virtual void absoluteQuads(Vector&) const override final; - void absoluteQuadsForRange(Vector&, - unsigned startOffset = 0, - unsigned endOffset = INT_MAX, - bool useSelectionHeight = false); - - enum ClippingOption { NoClipping, ClipToEllipsis }; - void absoluteQuads(Vector&, ClippingOption = NoClipping) const; - - virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override; - - bool is8Bit() const { return m_text.is8Bit(); } - const LChar* characters8() const { return m_text.impl()->characters8(); } - const UChar* characters16() const { return m_text.impl()->characters16(); } - bool hasEmptyText() const { return m_text.isEmpty(); } - String substring(unsigned position, unsigned length) const { - return m_text.substring(position, length); - } - UChar characterAt(unsigned) const; - UChar uncheckedCharacterAt(unsigned) const; - UChar operator[](unsigned i) const { return uncheckedCharacterAt(i); } - unsigned textLength() const { - return m_text.length(); - } // non virtual implementation of length() - void positionLineBox(InlineBox*); - - virtual float width(unsigned from, - unsigned len, - const Font&, - float xPos, - TextDirection, - HashSet* fallbackFonts = 0, - GlyphOverflow* = 0) const; - virtual float width(unsigned from, - unsigned len, - float xPos, - TextDirection, - bool firstLine = false, - HashSet* fallbackFonts = 0, - GlyphOverflow* = 0) const; - - float minLogicalWidth() const; - float maxLogicalWidth() const; - - void trimmedPrefWidths(float leadWidth, - float& firstLineMinWidth, - bool& hasBreakableStart, - float& lastLineMinWidth, - bool& hasBreakableEnd, - bool& hasBreakableChar, - bool& hasBreak, - float& firstLineMaxWidth, - float& lastLineMaxWidth, - float& minWidth, - float& maxWidth, - bool& stripFrontSpaces, - TextDirection); - - virtual IntRect linesBoundingBox() const; - LayoutRect linesVisualOverflowBoundingBox() const; - - FloatPoint firstRunOrigin() const; - float firstRunX() const; - float firstRunY() const; - - virtual void setText(PassRefPtr, bool force = false); - void setTextWithOffset(PassRefPtr, - unsigned offset, - unsigned len, - bool force = false); - - virtual bool canBeSelectionLeaf() const override { return true; } - virtual void setSelectionState(SelectionState s) override final; - virtual LayoutRect localCaretRect( - InlineBox*, - int caretOffset, - LayoutUnit* extraWidthToEndOfLine = 0) override; - - LayoutUnit marginLeft() const { - return minimumValueForLength(style()->marginLeft(), 0); - } - LayoutUnit marginRight() const { - return minimumValueForLength(style()->marginRight(), 0); - } - - InlineTextBox* firstTextBox() const { return m_firstTextBox; } - InlineTextBox* lastTextBox() const { return m_lastTextBox; } - - virtual int caretMinOffset() const override; - virtual int caretMaxOffset() const override; - unsigned renderedTextLength() const; - - virtual int previousOffset(int current) const override final; - virtual int previousOffsetForBackwardDeletion( - int current) const override final; - virtual int nextOffset(int current) const override final; - - bool containsReversedText() const { return m_containsReversedText; } - - void checkConsistency() const; - - bool isAllCollapsibleWhitespace() const; - - bool canUseSimpleFontCodePath() const { return m_canUseSimpleFontCodePath; } - - void removeAndDestroyTextBoxes(); - - protected: - virtual void willBeDestroyed() override; - - virtual void styleWillChange(StyleDifference, - const RenderStyle&) override final {} - virtual void styleDidChange(StyleDifference, - const RenderStyle* oldStyle) override; - - virtual void setTextInternal(PassRefPtr); - virtual UChar previousCharacter() const; - - InlineTextBox* createTextBox(); - - private: - void computePreferredLogicalWidths(float leadWidth); - void computePreferredLogicalWidths( - float leadWidth, - HashSet& fallbackFonts, - GlyphOverflow&); - - bool computeCanUseSimpleFontCodePath() const; - - // Make length() private so that callers that have a RenderText* - // will use the more efficient textLength() instead, while - // callers with a RenderObject* can continue to use length(). - virtual unsigned length() const override final { return textLength(); } - - virtual void paint(PaintInfo&, - const LayoutPoint&, - Vector& layers) override final { - ASSERT_NOT_REACHED(); - } - virtual void layout() override final { ASSERT_NOT_REACHED(); } - virtual bool nodeAtPoint(const HitTestRequest&, - HitTestResult&, - const HitTestLocation&, - const LayoutPoint&) override final { - ASSERT_NOT_REACHED(); - return false; - } - - void deleteTextBoxes(); - bool containsOnlyWhitespace(unsigned from, unsigned len) const; - float widthFromCache(const Font&, - int start, - int len, - float xPos, - TextDirection, - HashSet* fallbackFonts, - GlyphOverflow*) const; - bool isAllASCII() const { return m_isAllASCII; } - - bool isText() const = - delete; // This will catch anyone doing an unnecessary check. - - // We put the bitfield first to minimize padding on 64-bit. - bool m_hasBreakableChar : 1; // Whether or not we can be broken into multiple - // lines. - bool m_hasBreak : 1; // Whether or not we have a hard break (e.g.,
 with
-                        // '\n').
-  bool m_hasTab : 1;    // Whether or not we have a variable width tab character
-                        // (e.g., 
 with '\t').
-  bool m_hasBreakableStart : 1;
-  bool m_hasBreakableEnd : 1;
-  bool m_hasEndWhiteSpace : 1;
-  bool m_linesDirty : 1;  // This bit indicates that the text run has already
-                          // dirtied specific line boxes, and this hint will
-                          // enable RenderParagraph::layoutChildren to avoid
-                          // just dirtying everything when character data is
-                          // modified (e.g., appended/inserted or removed).
-  bool m_containsReversedText : 1;
-  bool m_isAllASCII : 1;
-  bool m_canUseSimpleFontCodePath : 1;
-  mutable bool m_knownToHaveNoOverflowAndNoFallbackFonts : 1;
-
-  float m_minWidth;
-  float m_maxWidth;
-  float m_firstLineMinWidth;
-  float m_lastLineLineMinWidth;
-
-  String m_text;
-
-  InlineTextBox* m_firstTextBox;
-  InlineTextBox* m_lastTextBox;
-};
-
-inline UChar RenderText::uncheckedCharacterAt(unsigned i) const {
-  ASSERT_WITH_SECURITY_IMPLICATION(i < textLength());
-  return is8Bit() ? characters8()[i] : characters16()[i];
-}
-
-inline UChar RenderText::characterAt(unsigned i) const {
-  if (i >= textLength())
-    return 0;
-
-  return uncheckedCharacterAt(i);
-}
-
-DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderText, isText());
-
-#if !ENABLE(ASSERT)
-inline void RenderText::checkConsistency() const {}
-#endif
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_RENDERTEXT_H_
diff --git a/sky/engine/core/rendering/RenderTheme.cpp b/sky/engine/core/rendering/RenderTheme.cpp
deleted file mode 100644
index fd8d122c1ad4c..0000000000000
--- a/sky/engine/core/rendering/RenderTheme.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * This file is part of the theme implementation for form controls in WebCore.
- *
- * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "flutter/sky/engine/core/rendering/RenderTheme.h"
-
-#include "flutter/sky/engine/core/rendering/PaintInfo.h"
-#include "flutter/sky/engine/core/rendering/RenderView.h"
-#include "flutter/sky/engine/core/rendering/style/RenderStyle.h"
-#include "flutter/sky/engine/platform/FloatConversion.h"
-#include "flutter/sky/engine/platform/fonts/FontSelector.h"
-#include "flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h"
-#include "flutter/sky/engine/public/platform/Platform.h"
-#include "flutter/sky/engine/wtf/text/StringBuilder.h"
-
-// The methods in this file are shared by all themes on every platform.
-
-namespace blink {
-
-RenderTheme::RenderTheme() : m_hasCustomFocusRingColor(false) {}
-
-Color RenderTheme::activeSelectionBackgroundColor() const {
-  return platformActiveSelectionBackgroundColor().blendWithWhite();
-}
-
-Color RenderTheme::inactiveSelectionBackgroundColor() const {
-  return platformInactiveSelectionBackgroundColor().blendWithWhite();
-}
-
-Color RenderTheme::activeSelectionForegroundColor() const {
-  return platformActiveSelectionForegroundColor();
-}
-
-Color RenderTheme::inactiveSelectionForegroundColor() const {
-  return platformInactiveSelectionForegroundColor();
-}
-
-Color RenderTheme::platformActiveSelectionBackgroundColor() const {
-  // Use a blue color by default if the platform theme doesn't define anything.
-  return Color(0, 0, 255);
-}
-
-Color RenderTheme::platformActiveSelectionForegroundColor() const {
-  // Use a white color by default if the platform theme doesn't define anything.
-  return Color::white;
-}
-
-Color RenderTheme::platformInactiveSelectionBackgroundColor() const {
-  // Use a grey color by default if the platform theme doesn't define anything.
-  // This color matches Firefox's inactive color.
-  return Color(176, 176, 176);
-}
-
-Color RenderTheme::platformInactiveSelectionForegroundColor() const {
-  // Use a black color by default.
-  return Color::black;
-}
-
-void RenderTheme::setCustomFocusRingColor(const Color& c) {
-  m_customFocusRingColor = c;
-  m_hasCustomFocusRingColor = true;
-}
-
-Color RenderTheme::focusRingColor() const {
-  return m_hasCustomFocusRingColor ? m_customFocusRingColor
-                                   : theme().platformFocusRingColor();
-}
-
-Color RenderTheme::tapHighlightColor() {
-  return theme().platformTapHighlightColor();
-}
-
-RenderTheme& RenderTheme::theme() {
-  DEFINE_STATIC_LOCAL(RenderTheme, renderTheme, ());
-  return renderTheme;
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/RenderTheme.h b/sky/engine/core/rendering/RenderTheme.h
deleted file mode 100644
index f9a82654b1795..0000000000000
--- a/sky/engine/core/rendering/RenderTheme.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * This file is part of the theme implementation for form controls in WebCore.
- *
- * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_RENDERTHEME_H_
-#define SKY_ENGINE_CORE_RENDERING_RENDERTHEME_H_
-
-#include "flutter/sky/engine/core/rendering/RenderObject.h"
-#include "flutter/sky/engine/wtf/PassRefPtr.h"
-#include "flutter/sky/engine/wtf/RefCounted.h"
-#include "flutter/sky/engine/wtf/text/WTFString.h"
-
-namespace blink {
-
-class RenderTheme : public RefCounted {
- protected:
-  RenderTheme();
-
- public:
-  // This function is to be implemented in your platform-specific theme
-  // implementation to hand back the appropriate platform theme.
-  static RenderTheme& theme();
-
-  Color focusRingColor() const;
-  virtual double caretBlinkInterval() const { return 0.5; }
-
-  // Text selection colors.
-  Color activeSelectionBackgroundColor() const;
-  Color inactiveSelectionBackgroundColor() const;
-  Color activeSelectionForegroundColor() const;
-  Color inactiveSelectionForegroundColor() const;
-
-  virtual bool supportsSelectionForegroundColors() const { return true; }
-  virtual Color platformDefaultCompositionBackgroundColor() const {
-    return defaultCompositionBackgroundColor;
-  }
-  void setCustomFocusRingColor(const Color&);
-
-  static Color tapHighlightColor();
-  virtual Color platformTapHighlightColor() const {
-    return RenderTheme::defaultTapHighlightColor;
-  }
-
- protected:
-  virtual Color platformActiveSelectionBackgroundColor() const;
-  virtual Color platformInactiveSelectionBackgroundColor() const;
-  virtual Color platformActiveSelectionForegroundColor() const;
-  virtual Color platformInactiveSelectionForegroundColor() const;
-  virtual Color platformFocusRingColor() const { return Color(0, 0, 0); }
-
- private:
-  Color m_customFocusRingColor;
-  bool m_hasCustomFocusRingColor;
-
-  // This color is expected to be drawn on a semi-transparent overlay,
-  // making it more transparent than its alpha value indicates.
-  static const RGBA32 defaultTapHighlightColor = 0x66000000;
-  static const RGBA32 defaultCompositionBackgroundColor = 0xFFFFDD55;
-};
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_RENDERTHEME_H_
diff --git a/sky/engine/core/rendering/RenderTreeAsText.cpp b/sky/engine/core/rendering/RenderTreeAsText.cpp
deleted file mode 100644
index 41677be03a113..0000000000000
--- a/sky/engine/core/rendering/RenderTreeAsText.cpp
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "flutter/sky/engine/core/rendering/RenderTreeAsText.h"
-
-#include "flutter/sky/engine/core/rendering/InlineTextBox.h"
-#include "flutter/sky/engine/core/rendering/RenderInline.h"
-#include "flutter/sky/engine/core/rendering/RenderLayer.h"
-#include "flutter/sky/engine/core/rendering/RenderView.h"
-#include "flutter/sky/engine/wtf/HexNumber.h"
-#include "flutter/sky/engine/wtf/Vector.h"
-#include "flutter/sky/engine/wtf/unicode/CharacterNames.h"
-
-namespace blink {
-
-String quoteAndEscapeNonPrintables(const String& s) {
-  StringBuilder result;
-  result.append('"');
-  for (unsigned i = 0; i != s.length(); ++i) {
-    UChar c = s[i];
-    if (c == '\\') {
-      result.append('\\');
-      result.append('\\');
-    } else if (c == '"') {
-      result.append('\\');
-      result.append('"');
-    } else if (c == '\n' || c == noBreakSpace)
-      result.append(' ');
-    else {
-      if (c >= 0x20 && c < 0x7F)
-        result.append(c);
-      else {
-        result.append('\\');
-        result.append('x');
-        result.append('{');
-        appendUnsignedAsHex(c, result);
-        result.append('}');
-      }
-    }
-  }
-  result.append('"');
-  return result.toString();
-}
-
-void RenderTreeAsText::writeRenderObject(TextStream& ts,
-                                         const RenderObject& o,
-                                         RenderAsTextBehavior behavior) {}
-
-static void writeTextRun(TextStream& ts,
-                         const RenderText& o,
-                         const InlineTextBox& run) {
-  // FIXME: For now use an "enclosingIntRect" model for x, y and logicalWidth,
-  // although this makes it harder to detect any changes caused by the
-  // conversion to floating point. :(
-  int x = run.x();
-  int y = run.y();
-  int logicalWidth = ceilf(run.left() + run.logicalWidth()) - x;
-
-  ts << "text run at (" << x << "," << y << ") width " << logicalWidth;
-  if (!run.isLeftToRightDirection() || run.dirOverride()) {
-    ts << (!run.isLeftToRightDirection() ? " RTL" : " LTR");
-    if (run.dirOverride())
-      ts << " override";
-  }
-  ts << ": "
-     << quoteAndEscapeNonPrintables(
-            String(o.text()).substring(run.start(), run.len()));
-  if (run.hasHyphen())
-    ts << " + hyphen string "
-       << quoteAndEscapeNonPrintables(o.style()->hyphenString());
-  ts << "\n";
-}
-
-void write(TextStream& ts,
-           const RenderObject& o,
-           int indent,
-           RenderAsTextBehavior behavior) {
-  writeIndent(ts, indent);
-
-  RenderTreeAsText::writeRenderObject(ts, o, behavior);
-  ts << "\n";
-
-  if (o.isText()) {
-    const RenderText& text = toRenderText(o);
-    for (InlineTextBox* box = text.firstTextBox(); box;
-         box = box->nextTextBox()) {
-      writeIndent(ts, indent + 1);
-      writeTextRun(ts, text, *box);
-    }
-  }
-
-  for (RenderObject* child = o.slowFirstChild(); child;
-       child = child->nextSibling()) {
-    if (child->hasLayer())
-      continue;
-    write(ts, *child, indent + 1, behavior);
-  }
-}
-
-static void write(TextStream& ts,
-                  RenderLayer& l,
-                  const LayoutRect& layerBounds,
-                  const LayoutRect& backgroundClipRect,
-                  int indent = 0,
-                  RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal) {
-  IntRect adjustedLayoutBounds = pixelSnappedIntRect(layerBounds);
-  IntRect adjustedBackgroundClipRect = pixelSnappedIntRect(backgroundClipRect);
-
-  writeIndent(ts, indent);
-
-  ts << "layer ";
-
-  if (behavior & RenderAsTextShowAddresses)
-    ts << static_cast(&l) << " ";
-
-  ts << adjustedLayoutBounds;
-
-  if (!adjustedLayoutBounds.isEmpty()) {
-    if (!adjustedBackgroundClipRect.contains(adjustedLayoutBounds))
-      ts << " backgroundClip " << adjustedBackgroundClipRect;
-  }
-
-  ts << "\n";
-  write(ts, *l.renderer(), indent + 1, behavior);
-}
-
-void RenderTreeAsText::writeLayers(TextStream& ts,
-                                   const RenderLayer* rootLayer,
-                                   RenderLayer* layer,
-                                   const LayoutRect& paintRect,
-                                   int indent,
-                                   RenderAsTextBehavior behavior) {
-  // FIXME: Apply overflow to the root layer to not break every test. Complete
-  // hack. Sigh.
-  LayoutRect paintDirtyRect(paintRect);
-  if (rootLayer == layer) {
-    paintDirtyRect.setWidth(
-        max(paintDirtyRect.width(),
-                        rootLayer->renderer()->layoutOverflowRect().maxX()));
-    paintDirtyRect.setHeight(
-        max(paintDirtyRect.height(),
-                        rootLayer->renderer()->layoutOverflowRect().maxY()));
-  }
-
-  // Calculate the clip rects we should use.
-  LayoutRect layerBounds;
-  ClipRect damageRect;
-  layer->clipper().calculateRects(
-      ClipRectsContext(rootLayer, UncachedClipRects), paintDirtyRect,
-      layerBounds, damageRect);
-
-  // FIXME: Apply overflow to the root layer to not break every test. Complete
-  // hack. Sigh.
-  if (rootLayer == layer)
-    layerBounds.setSize(layer->size().expandedTo(pixelSnappedIntSize(
-        layer->renderer()->maxLayoutOverflow(), LayoutPoint(0, 0))));
-
-  // Ensure our lists are up-to-date.
-  layer->stackingNode()->updateLayerListsIfNeeded();
-
-  bool shouldPaint = (behavior & RenderAsTextShowAllLayers)
-                         ? true
-                         : layer->intersectsDamageRect(
-                               layerBounds, damageRect.rect(), rootLayer);
-
-  if (shouldPaint)
-    write(ts, *layer, layerBounds, damageRect.rect(), indent, behavior);
-
-  if (Vector* normalFlowList =
-          layer->stackingNode()->normalFlowList()) {
-    int currIndent = indent;
-    if (behavior & RenderAsTextShowLayerNesting) {
-      writeIndent(ts, indent);
-      ts << " normal flow list(" << normalFlowList->size() << ")\n";
-      ++currIndent;
-    }
-    for (unsigned i = 0; i != normalFlowList->size(); ++i)
-      writeLayers(ts, rootLayer, normalFlowList->at(i)->layer(), paintDirtyRect,
-                  currIndent, behavior);
-  }
-
-  if (Vector* posList =
-          layer->stackingNode()->zOrderList()) {
-    int currIndent = indent;
-    if (behavior & RenderAsTextShowLayerNesting) {
-      writeIndent(ts, indent);
-      ts << " positive z-order list(" << posList->size() << ")\n";
-      ++currIndent;
-    }
-    for (unsigned i = 0; i != posList->size(); ++i)
-      writeLayers(ts, rootLayer, posList->at(i)->layer(), paintDirtyRect,
-                  currIndent, behavior);
-  }
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/RenderTreeAsText.h b/sky/engine/core/rendering/RenderTreeAsText.h
deleted file mode 100644
index e9cd7fd8e81a4..0000000000000
--- a/sky/engine/core/rendering/RenderTreeAsText.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_RENDERTREEASTEXT_H_
-#define SKY_ENGINE_CORE_RENDERING_RENDERTREEASTEXT_H_
-#include "flutter/sky/engine/platform/text/TextStream.h"
-
-#include "flutter/sky/engine/wtf/Forward.h"
-
-namespace blink {
-
-class LayoutRect;
-class Node;
-class RenderLayer;
-class RenderObject;
-class TextStream;
-
-enum RenderAsTextBehaviorFlags {
-  RenderAsTextBehaviorNormal = 0,
-  RenderAsTextShowAllLayers =
-      1 << 0,  // Dump all layers, not just those that would paint.
-  RenderAsTextShowLayerNesting = 1 << 1,  // Annotate the layer lists.
-  RenderAsTextShowCompositedLayers = 1
-                                     << 2,  // Show which layers are composited.
-  RenderAsTextShowAddresses = 1 << 3,   // Show layer and renderer addresses.
-  RenderAsTextShowIDAndClass = 1 << 4,  // Show id and class attributes
-  RenderAsTextDontUpdateLayout =
-      1 << 6,  // Don't update layout, to make it safe to call showLayerTree()
-               // from the debugger inside layout or painting code.
-  RenderAsTextShowLayoutState =
-      1 << 7  // Print the various 'needs layout' bits on renderers.
-};
-typedef unsigned RenderAsTextBehavior;
-
-// You don't need pageWidthInPixels if you don't specify
-// RenderAsTextInPrintingMode.
-void write(TextStream&,
-           const RenderObject&,
-           int indent = 0,
-           RenderAsTextBehavior = RenderAsTextBehaviorNormal);
-
-class RenderTreeAsText {
-  // FIXME: This is a cheesy hack to allow easy access to RenderStyle colors.
-  // It won't be needed if we convert it to use colorIncludingFallback instead.
-  // (This just involves rebaselining many results though, so for now it's not
-  // being done).
- public:
-  static void writeRenderObject(TextStream& ts,
-                                const RenderObject& o,
-                                RenderAsTextBehavior behavior);
-  static void writeLayers(TextStream&,
-                          const RenderLayer* rootLayer,
-                          RenderLayer*,
-                          const LayoutRect& paintDirtyRect,
-                          int indent = 0,
-                          RenderAsTextBehavior = RenderAsTextBehaviorNormal);
-};
-
-// Helper function shared with SVGRenderTreeAsText
-String quoteAndEscapeNonPrintables(const String&);
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_RENDERTREEASTEXT_H_
diff --git a/sky/engine/core/rendering/RenderView.cpp b/sky/engine/core/rendering/RenderView.cpp
deleted file mode 100644
index 6118bbbd92f06..0000000000000
--- a/sky/engine/core/rendering/RenderView.cpp
+++ /dev/null
@@ -1,342 +0,0 @@
-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc.
- * All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "flutter/sky/engine/core/rendering/RenderView.h"
-
-#include "flutter/sky/engine/core/rendering/HitTestResult.h"
-#include "flutter/sky/engine/core/rendering/RenderGeometryMap.h"
-#include "flutter/sky/engine/core/rendering/RenderLayer.h"
-#include "flutter/sky/engine/platform/geometry/FloatQuad.h"
-#include "flutter/sky/engine/platform/geometry/TransformState.h"
-#include "flutter/sky/engine/platform/graphics/GraphicsContext.h"
-
-namespace blink {
-
-RenderView::RenderView()
-    : m_selectionStart(nullptr),
-      m_selectionEnd(nullptr),
-      m_selectionStartPos(-1),
-      m_selectionEndPos(-1),
-      m_renderCounterCount(0),
-      m_hitTestCount(0) {
-  // init RenderObject attributes
-  setInline(false);
-
-  m_minPreferredLogicalWidth = 0;
-  m_maxPreferredLogicalWidth = 0;
-
-  setPreferredLogicalWidthsDirty(MarkOnlyThis);
-
-  setPositionState(AbsolutePosition);  // to 0,0 :)
-}
-
-RenderView::~RenderView() {}
-
-bool RenderView::hitTest(const HitTestRequest& request, HitTestResult& result) {
-  return hitTest(request, result.hitTestLocation(), result);
-}
-
-bool RenderView::hitTest(const HitTestRequest& request,
-                         const HitTestLocation& location,
-                         HitTestResult& result) {
-  m_hitTestCount++;
-
-  // TODO(ojan): Does any of this intersection stuff make sense for Sky?
-  LayoutRect hitTestArea;
-  hitTestArea.setSize(m_frameViewSize);
-
-  bool insideLayer =
-      hitTestLayer(layer(), 0, request, result, hitTestArea, location);
-  if (!insideLayer) {
-    // TODO(ojan): Is this code needed for Sky?
-
-    // We didn't hit any layer. If we are the root layer and the mouse is -- or
-    // just was -- down, return ourselves. We do this so mouse events continue
-    // getting delivered after a drag has exited the WebView, and so hit testing
-    // over a scrollbar hits the content document.
-    if (request.active() || request.release()) {
-      updateHitTestResult(result, location.point());
-      insideLayer = true;
-    }
-  }
-  return insideLayer;
-}
-
-void RenderView::computeLogicalHeight(
-    LayoutUnit logicalHeight,
-    LayoutUnit,
-    LogicalExtentComputedValues& computedValues) const {
-  computedValues.m_extent = logicalHeight;
-}
-
-void RenderView::updateLogicalWidth() {
-  setLogicalWidth(viewLogicalWidth());
-}
-
-bool RenderView::isChildAllowed(RenderObject* child, RenderStyle*) const {
-  return child->isBox();
-}
-
-void RenderView::layout() {
-  SubtreeLayoutScope layoutScope(*this);
-
-  bool relayoutChildren = width() != viewWidth() || height() != viewHeight();
-  if (relayoutChildren) {
-    layoutScope.setChildNeedsLayout(this);
-    for (RenderObject* child = firstChild(); child;
-         child = child->nextSibling()) {
-      if ((child->isBox() && toRenderBox(child)->hasRelativeLogicalHeight()) ||
-          child->style()->logicalHeight().isPercent() ||
-          child->style()->logicalMinHeight().isPercent() ||
-          child->style()->logicalMaxHeight().isPercent())
-        layoutScope.setChildNeedsLayout(child);
-    }
-  }
-
-  if (!needsLayout())
-    return;
-
-  RenderFlexibleBox::layout();
-  clearNeedsLayout();
-}
-
-void RenderView::mapLocalToContainer(
-    const RenderBox* paintInvalidationContainer,
-    TransformState& transformState,
-    MapCoordinatesFlags mode) const {
-  if (!paintInvalidationContainer && mode & UseTransforms &&
-      shouldUseTransformFromContainer(0)) {
-    TransformationMatrix t;
-    getTransformFromContainer(0, LayoutSize(), t);
-    transformState.applyTransform(t);
-  }
-}
-
-const RenderObject* RenderView::pushMappingToContainer(
-    const RenderBox* ancestorToStopAt,
-    RenderGeometryMap& geometryMap) const {
-  LayoutSize offset;
-  RenderObject* container = 0;
-
-  // If a container was specified, and was not 0 or the RenderView, then we
-  // should have found it by now unless we're traversing to a parent document.
-  ASSERT_ARG(ancestorToStopAt,
-             !ancestorToStopAt || ancestorToStopAt == this || container);
-
-  if ((!ancestorToStopAt || container) &&
-      shouldUseTransformFromContainer(container)) {
-    TransformationMatrix t;
-    getTransformFromContainer(container, LayoutSize(), t);
-    geometryMap.push(this, t, false, false, true);
-  } else {
-    geometryMap.push(this, offset, false, false, false);
-  }
-
-  return container;
-}
-
-void RenderView::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode,
-                                         TransformState& transformState) const {
-  if (mode & UseTransforms && shouldUseTransformFromContainer(0)) {
-    TransformationMatrix t;
-    getTransformFromContainer(0, LayoutSize(), t);
-    transformState.applyTransform(t);
-  }
-}
-
-void RenderView::paint(PaintInfo& paintInfo,
-                       const LayoutPoint& paintOffset,
-                       Vector& layers) {
-  // If we ever require layout but receive a paint anyway, something has gone
-  // horribly wrong.
-  ASSERT(!needsLayout());
-  // RenderViews should never be called to paint with an offset not on device
-  // pixels.
-  ASSERT(LayoutPoint(IntPoint(paintOffset.x(), paintOffset.y())) ==
-         paintOffset);
-
-  paintObject(paintInfo, paintOffset, layers);
-}
-
-void RenderView::paintBoxDecorationBackground(PaintInfo& paintInfo,
-                                              const LayoutPoint& paintOffset) {}
-
-void RenderView::absoluteQuads(Vector& quads) const {
-  quads.append(FloatRect(FloatPoint(), layer()->size()));
-}
-
-static RenderObject* rendererAfterPosition(RenderObject* object,
-                                           unsigned offset) {
-  if (!object)
-    return 0;
-
-  RenderObject* child = object->childAt(offset);
-  return child ? child : object->nextInPreOrderAfterChildren();
-}
-
-// When exploring the RenderTree looking for the nodes involved in the
-// Selection, sometimes it's required to change the traversing direction because
-// the "start" position is below the "end" one.
-static inline RenderObject* getNextOrPrevRenderObjectBasedOnDirection(
-    const RenderObject* o,
-    const RenderObject* stop,
-    bool& continueExploring,
-    bool& exploringBackwards) {
-  RenderObject* next;
-  if (exploringBackwards) {
-    next = o->previousInPreOrder();
-    continueExploring = next && !(next)->isRenderView();
-  } else {
-    next = o->nextInPreOrder();
-    continueExploring = next && next != stop;
-    exploringBackwards = !next && (next != stop);
-    if (exploringBackwards) {
-      next = stop->previousInPreOrder();
-      continueExploring = next && !next->isRenderView();
-    }
-  }
-
-  return next;
-}
-
-void RenderView::setSelection(RenderObject* start,
-                              int startPos,
-                              RenderObject* end,
-                              int endPos) {
-  // This code makes no assumptions as to if the rendering tree is up to date or
-  // not and will not try to update it. Currently clearSelection calls this
-  // (intentionally) without updating the rendering tree as it doesn't care.
-  // Other callers may want to force recalc style before calling this.
-
-  // Make sure both our start and end objects are defined.
-  // Check www.msnbc.com and try clicking around to find the case where this
-  // happened.
-  if ((start && !end) || (end && !start))
-    return;
-
-  // Just return if the selection hasn't changed.
-  if (m_selectionStart == start && m_selectionStartPos == startPos &&
-      m_selectionEnd == end && m_selectionEndPos == endPos)
-    return;
-
-  RenderObject* os = m_selectionStart;
-  RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
-  bool exploringBackwards = false;
-  bool continueExploring = os && (os != stop);
-  while (continueExploring) {
-    if ((os->canBeSelectionLeaf() || os == m_selectionStart ||
-         os == m_selectionEnd) &&
-        os->selectionState() != SelectionNone) {
-      os->setSelectionStateIfNeeded(SelectionNone);
-    }
-
-    os = getNextOrPrevRenderObjectBasedOnDirection(os, stop, continueExploring,
-                                                   exploringBackwards);
-  }
-
-  // set selection start and end
-  m_selectionStart = start;
-  m_selectionStartPos = startPos;
-  m_selectionEnd = end;
-  m_selectionEndPos = endPos;
-
-  // Update the selection status of all objects between m_selectionStart and
-  // m_selectionEnd
-  if (start && start == end) {
-    start->setSelectionStateIfNeeded(SelectionBoth);
-  } else {
-    if (start)
-      start->setSelectionStateIfNeeded(SelectionStart);
-    if (end)
-      end->setSelectionStateIfNeeded(SelectionEnd);
-  }
-
-  RenderObject* o = start;
-  stop = rendererAfterPosition(end, endPos);
-
-  while (o && o != stop) {
-    if (o != start && o != end && o->canBeSelectionLeaf())
-      o->setSelectionStateIfNeeded(SelectionInside);
-    o = o->nextInPreOrder();
-  }
-}
-
-void RenderView::getSelection(RenderObject*& startRenderer,
-                              int& startOffset,
-                              RenderObject*& endRenderer,
-                              int& endOffset) const {
-  startRenderer = m_selectionStart;
-  startOffset = m_selectionStartPos;
-  endRenderer = m_selectionEnd;
-  endOffset = m_selectionEndPos;
-}
-
-void RenderView::clearSelection() {
-  setSelection(0, -1, 0, -1);
-}
-
-void RenderView::selectionStartEnd(int& startPos, int& endPos) const {
-  startPos = m_selectionStartPos;
-  endPos = m_selectionEndPos;
-}
-
-IntRect RenderView::unscaledDocumentRect() const {
-  return pixelSnappedIntRect(layoutOverflowRect());
-}
-
-LayoutRect RenderView::backgroundRect(RenderBox* backgroundRenderer) const {
-  return unscaledDocumentRect();
-}
-
-IntRect RenderView::documentRect() const {
-  FloatRect overflowRect(unscaledDocumentRect());
-  if (hasTransform())
-    overflowRect = transform()->mapRect(overflowRect);
-  return IntRect(overflowRect);
-}
-
-int RenderView::viewHeight() const {
-  return m_frameViewSize.height();
-}
-
-int RenderView::viewWidth() const {
-  return m_frameViewSize.width();
-}
-
-int RenderView::viewLogicalHeight() const {
-  return viewHeight();
-}
-
-LayoutUnit RenderView::viewLogicalHeightForPercentages() const {
-  return viewLogicalHeight();
-}
-
-// FIXME(sky): remove
-double RenderView::layoutViewportWidth() const {
-  return viewWidth();
-}
-
-// FIXME(sky): remove
-double RenderView::layoutViewportHeight() const {
-  return viewHeight();
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/RenderView.h b/sky/engine/core/rendering/RenderView.h
deleted file mode 100644
index fd166aaca863e..0000000000000
--- a/sky/engine/core/rendering/RenderView.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2006 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_
-#define SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_
-
-#include "flutter/sky/engine/core/rendering/RenderFlexibleBox.h"
-#include "flutter/sky/engine/wtf/OwnPtr.h"
-
-namespace blink {
-
-// The root of the render tree, corresponding to the CSS initial containing
-// block. It's dimensions match that of the logical viewport (which may be
-// different from the visible viewport in fixed-layout mode), and it is always
-// at position (0,0) relative to the document (and so isn't necessarily in
-// view).
-class RenderView final : public RenderFlexibleBox {
- public:
-  explicit RenderView();
-  virtual ~RenderView();
-
-  bool hitTest(const HitTestRequest&, HitTestResult&);
-  bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&);
-
-  // Returns the total count of calls to HitTest, for testing.
-  unsigned hitTestCount() const { return m_hitTestCount; }
-
-  virtual const char* renderName() const override { return "RenderView"; }
-
-  virtual bool isRenderView() const override { return true; }
-
-  virtual LayerType layerTypeRequired() const override { return NormalLayer; }
-
-  virtual bool isChildAllowed(RenderObject*, RenderStyle*) const override;
-
-  virtual void layout() override;
-  virtual void updateLogicalWidth() override;
-  virtual void computeLogicalHeight(
-      LayoutUnit logicalHeight,
-      LayoutUnit logicalTop,
-      LogicalExtentComputedValues&) const override;
-
-  // The same as the FrameView's layoutHeight/layoutWidth but with null check
-  // guards.
-  int viewHeight() const;
-  int viewWidth() const;
-  int viewLogicalWidth() const { return viewWidth(); }
-  int viewLogicalHeight() const;
-  LayoutUnit viewLogicalHeightForPercentages() const;
-
-  virtual void paint(PaintInfo&,
-                     const LayoutPoint&,
-                     Vector& layers) override;
-  virtual void paintBoxDecorationBackground(PaintInfo&,
-                                            const LayoutPoint&) override;
-
-  void setSelection(RenderObject* start,
-                    int startPos,
-                    RenderObject*,
-                    int endPos);
-  void getSelection(RenderObject*& startRenderer,
-                    int& startOffset,
-                    RenderObject*& endRenderer,
-                    int& endOffset) const;
-  void clearSelection();
-  RenderObject* selectionStart() const { return m_selectionStart; }
-  RenderObject* selectionEnd() const { return m_selectionEnd; }
-  void selectionStartEnd(int& startPos, int& endPos) const;
-
-  virtual void absoluteQuads(Vector&) const override;
-
-  void setFrameViewSize(const IntSize& frameViewSize) {
-    m_frameViewSize = frameViewSize;
-  }
-
-  IntRect unscaledDocumentRect() const;
-  LayoutRect backgroundRect(RenderBox* backgroundRenderer) const;
-
-  IntRect documentRect() const;
-
-  double layoutViewportWidth() const;
-  double layoutViewportHeight() const;
-
- private:
-  virtual void mapLocalToContainer(
-      const RenderBox* paintInvalidationContainer,
-      TransformState&,
-      MapCoordinatesFlags = ApplyContainerFlip) const override;
-  virtual const RenderObject* pushMappingToContainer(
-      const RenderBox* ancestorToStopAt,
-      RenderGeometryMap&) const override;
-  virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags,
-                                       TransformState&) const override;
-
-  void positionDialog(RenderBox*);
-  void positionDialogs();
-
-  IntSize m_frameViewSize;
-
-  RawPtr m_selectionStart;
-  RawPtr m_selectionEnd;
-
-  int m_selectionStartPos;
-  int m_selectionEndPos;
-
-  unsigned m_renderCounterCount;
-
-  unsigned m_hitTestCount;
-};
-
-DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderView, isRenderView());
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_RENDERVIEW_H_
diff --git a/sky/engine/core/rendering/RootInlineBox.cpp b/sky/engine/core/rendering/RootInlineBox.cpp
deleted file mode 100644
index ca08a6d7b6379..0000000000000
--- a/sky/engine/core/rendering/RootInlineBox.cpp
+++ /dev/null
@@ -1,804 +0,0 @@
-/*
- * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "flutter/sky/engine/core/rendering/RootInlineBox.h"
-
-#include "flutter/sky/engine/core/rendering/HitTestResult.h"
-#include "flutter/sky/engine/core/rendering/InlineTextBox.h"
-#include "flutter/sky/engine/core/rendering/PaintInfo.h"
-#include "flutter/sky/engine/core/rendering/RenderInline.h"
-#include "flutter/sky/engine/core/rendering/RenderParagraph.h"
-#include "flutter/sky/engine/core/rendering/RenderView.h"
-#include "flutter/sky/engine/core/rendering/VerticalPositionCache.h"
-#include "flutter/sky/engine/platform/text/BidiResolver.h"
-#include "flutter/sky/engine/wtf/unicode/Unicode.h"
-
-namespace blink {
-
-struct SameSizeAsRootInlineBox : public InlineFlowBox {
-  unsigned unsignedVariable;
-  void* pointers[2];
-  LayoutUnit layoutVariables[5];
-};
-
-COMPILE_ASSERT(sizeof(RootInlineBox) == sizeof(SameSizeAsRootInlineBox),
-               RootInlineBox_should_stay_small);
-
-RootInlineBox::RootInlineBox(RenderParagraph& block)
-    : InlineFlowBox(block),
-      m_lineBreakPos(0),
-      m_lineBreakObj(0),
-      m_lineTop(0),
-      m_lineBottom(0),
-      m_lineTopWithLeading(0),
-      m_lineBottomWithLeading(0),
-      m_selectionBottom(0) {}
-
-void RootInlineBox::destroy() {
-  InlineFlowBox::destroy();
-}
-
-RenderLineBoxList* RootInlineBox::rendererLineBoxes() const {
-  return block().lineBoxes();
-}
-
-void RootInlineBox::clearTruncation() {}
-
-int RootInlineBox::baselinePosition(FontBaseline baselineType) const {
-  return boxModelObject()->baselinePosition(baselineType, isFirstLineStyle(),
-                                            HorizontalLine,
-                                            PositionOfInteriorLineBoxes);
-}
-
-LayoutUnit RootInlineBox::lineHeight() const {
-  return boxModelObject()->lineHeight(isFirstLineStyle(), HorizontalLine,
-                                      PositionOfInteriorLineBoxes);
-}
-
-void RootInlineBox::paint(PaintInfo& paintInfo,
-                          const LayoutPoint& paintOffset,
-                          LayoutUnit lineTop,
-                          LayoutUnit lineBottom,
-                          Vector& layers) {
-  InlineFlowBox::paint(paintInfo, paintOffset, lineTop, lineBottom, layers);
-}
-
-bool RootInlineBox::nodeAtPoint(const HitTestRequest& request,
-                                HitTestResult& result,
-                                const HitTestLocation& locationInContainer,
-                                const LayoutPoint& accumulatedOffset,
-                                LayoutUnit lineTop,
-                                LayoutUnit lineBottom) {
-  return InlineFlowBox::nodeAtPoint(request, result, locationInContainer,
-                                    accumulatedOffset, lineTop, lineBottom);
-}
-
-void RootInlineBox::adjustPosition(float dx, float dy) {
-  InlineFlowBox::adjustPosition(dx, dy);
-  LayoutUnit blockDirectionDelta =
-      dy;  // The block direction delta is a LayoutUnit.
-  m_lineTop += blockDirectionDelta;
-  m_lineBottom += blockDirectionDelta;
-  m_lineTopWithLeading += blockDirectionDelta;
-  m_lineBottomWithLeading += blockDirectionDelta;
-  m_selectionBottom += blockDirectionDelta;
-}
-
-void RootInlineBox::childRemoved(InlineBox* box) {
-  if (&box->renderer() == m_lineBreakObj)
-    setLineBreakInfo(0, 0, BidiStatus());
-
-  for (RootInlineBox* prev = prevRootBox();
-       prev && prev->lineBreakObj() == &box->renderer();
-       prev = prev->prevRootBox()) {
-    prev->setLineBreakInfo(0, 0, BidiStatus());
-    prev->markDirty();
-  }
-}
-
-LayoutUnit RootInlineBox::alignBoxesInBlockDirection(
-    LayoutUnit heightOfBlock,
-    GlyphOverflowAndFallbackFontsMap& textBoxDataMap,
-    VerticalPositionCache& verticalPositionCache) {
-  // SVG will handle vertical alignment on its own.
-  if (isSVGRootInlineBox())
-    return 0;
-
-  LayoutUnit maxPositionTop = 0;
-  LayoutUnit maxPositionBottom = 0;
-  int maxAscent = 0;
-  int maxDescent = 0;
-  bool setMaxAscent = false;
-  bool setMaxDescent = false;
-
-  m_baselineType = AlphabeticBaseline;
-
-  computeLogicalBoxHeights(this, maxPositionTop, maxPositionBottom, maxAscent,
-                           maxDescent, setMaxAscent, setMaxDescent, true,
-                           textBoxDataMap, baselineType(),
-                           verticalPositionCache);
-
-  if (maxAscent + maxDescent < std::max(maxPositionTop, maxPositionBottom))
-    adjustMaxAscentAndDescent(maxAscent, maxDescent, maxPositionTop,
-                              maxPositionBottom);
-
-  LayoutUnit maxHeight = maxAscent + maxDescent;
-  LayoutUnit lineTop = heightOfBlock;
-  LayoutUnit lineBottom = heightOfBlock;
-  LayoutUnit lineTopIncludingMargins = heightOfBlock;
-  LayoutUnit lineBottomIncludingMargins = heightOfBlock;
-  LayoutUnit selectionBottom = heightOfBlock;
-  bool setLineTop = false;
-  bool hasAnnotationsBefore = false;
-  bool hasAnnotationsAfter = false;
-  placeBoxesInBlockDirection(heightOfBlock, maxHeight, maxAscent, true, lineTop,
-                             lineBottom, selectionBottom, setLineTop,
-                             lineTopIncludingMargins,
-                             lineBottomIncludingMargins, hasAnnotationsBefore,
-                             hasAnnotationsAfter, baselineType());
-  m_hasAnnotationsBefore = hasAnnotationsBefore;
-  m_hasAnnotationsAfter = hasAnnotationsAfter;
-
-  maxHeight =
-      std::max(0, maxHeight);  // FIXME: Is this really necessary?
-
-  setLineTopBottomPositions(lineTop, lineBottom, heightOfBlock,
-                            heightOfBlock + maxHeight, selectionBottom);
-
-  LayoutUnit annotationsAdjustment = beforeAnnotationsAdjustment();
-  if (annotationsAdjustment) {
-    // FIXME: Need to handle pagination here. We might have to move to the next
-    // page/column as a result of the ruby expansion.
-    adjustBlockDirectionPosition(annotationsAdjustment.toFloat());
-    heightOfBlock += annotationsAdjustment;
-  }
-
-  return heightOfBlock + maxHeight;
-}
-
-float RootInlineBox::maxLogicalTop() const {
-  float maxLogicalTop = 0;
-  computeMaxLogicalTop(maxLogicalTop);
-  return maxLogicalTop;
-}
-
-LayoutUnit RootInlineBox::beforeAnnotationsAdjustment() const {
-  LayoutUnit result = 0;
-
-  // Annotations under the previous line may push us down.
-  if (prevRootBox() && prevRootBox()->hasAnnotationsAfter())
-    result = prevRootBox()->computeUnderAnnotationAdjustment(lineTop());
-
-  if (!hasAnnotationsBefore())
-    return result;
-
-  // Annotations over this line may push us further down.
-  LayoutUnit highestAllowedPosition =
-      prevRootBox() ? std::min(prevRootBox()->lineBottom(), lineTop()) + result
-                    : static_cast(block().borderBefore());
-  result = computeOverAnnotationAdjustment(highestAllowedPosition);
-
-  return result;
-}
-
-GapRects RootInlineBox::lineSelectionGap(
-    RenderBlock* rootBlock,
-    const LayoutPoint& rootBlockPhysicalPosition,
-    const LayoutSize& offsetFromRootBlock,
-    LayoutUnit selTop,
-    LayoutUnit selHeight,
-    const PaintInfo* paintInfo) {
-  RenderObject::SelectionState lineState = selectionState();
-
-  bool leftGap, rightGap;
-  block().getSelectionGapInfo(lineState, leftGap, rightGap);
-
-  GapRects result;
-
-  InlineBox* firstBox = firstSelectedBox();
-  InlineBox* lastBox = lastSelectedBox();
-  if (leftGap) {
-    result.uniteLeft(block().logicalLeftSelectionGap(
-        rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock,
-        &firstBox->parent()->renderer(), firstBox->logicalLeft(), selTop,
-        selHeight, paintInfo));
-  }
-  if (rightGap) {
-    result.uniteRight(block().logicalRightSelectionGap(
-        rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock,
-        &lastBox->parent()->renderer(), lastBox->logicalRight(), selTop,
-        selHeight, paintInfo));
-  }
-
-  // When dealing with bidi text, a non-contiguous selection region is possible.
-  // e.g. The logical text aaaAAAbbb (capitals denote RTL text and non-capitals
-  // LTR) is layed out visually as 3 text runs |aaa|bbb|AAA| if we select 4
-  // characters from the start of the text the selection will look like
-  // (underline denotes selection): |aaa|bbb|AAA|
-  //  ___       _
-  // We can see that the |bbb| run is not part of the selection while the runs
-  // around it are.
-  if (firstBox && firstBox != lastBox) {
-    // Now fill in any gaps on the line that occurred between two selected
-    // elements.
-    LayoutUnit lastLogicalLeft = firstBox->logicalRight();
-    bool isPreviousBoxSelected =
-        firstBox->selectionState() != RenderObject::SelectionNone;
-    for (InlineBox* box = firstBox->nextLeafChild(); box;
-         box = box->nextLeafChild()) {
-      if (box->selectionState() != RenderObject::SelectionNone) {
-        LayoutRect logicalRect(lastLogicalLeft, selTop,
-                               box->logicalLeft() - lastLogicalLeft, selHeight);
-        logicalRect.move(offsetFromRootBlock);
-        LayoutRect gapRect = rootBlock->logicalRectToPhysicalRect(
-            rootBlockPhysicalPosition, logicalRect);
-        if (isPreviousBoxSelected && gapRect.width() > 0 &&
-            gapRect.height() > 0) {
-          if (paintInfo)
-            paintInfo->context->fillRect(
-                gapRect, box->parent()->renderer().selectionBackgroundColor());
-          // VisibleSelection may be non-contiguous, see comment above.
-          result.uniteCenter(gapRect);
-        }
-        lastLogicalLeft = box->logicalRight();
-      }
-      if (box == lastBox)
-        break;
-      isPreviousBoxSelected =
-          box->selectionState() != RenderObject::SelectionNone;
-    }
-  }
-
-  return result;
-}
-
-RenderObject::SelectionState RootInlineBox::selectionState() {
-  // Walk over all of the selected boxes.
-  RenderObject::SelectionState state = RenderObject::SelectionNone;
-  for (InlineBox* box = firstLeafChild(); box; box = box->nextLeafChild()) {
-    RenderObject::SelectionState boxState = box->selectionState();
-    if ((boxState == RenderObject::SelectionStart &&
-         state == RenderObject::SelectionEnd) ||
-        (boxState == RenderObject::SelectionEnd &&
-         state == RenderObject::SelectionStart))
-      state = RenderObject::SelectionBoth;
-    else if (state == RenderObject::SelectionNone ||
-             ((boxState == RenderObject::SelectionStart ||
-               boxState == RenderObject::SelectionEnd) &&
-              (state == RenderObject::SelectionNone ||
-               state == RenderObject::SelectionInside)))
-      state = boxState;
-    else if (boxState == RenderObject::SelectionNone &&
-             state == RenderObject::SelectionStart) {
-      // We are past the end of the selection.
-      state = RenderObject::SelectionBoth;
-    }
-    if (state == RenderObject::SelectionBoth)
-      break;
-  }
-
-  return state;
-}
-
-InlineBox* RootInlineBox::firstSelectedBox() {
-  for (InlineBox* box = firstLeafChild(); box; box = box->nextLeafChild()) {
-    if (box->selectionState() != RenderObject::SelectionNone)
-      return box;
-  }
-
-  return 0;
-}
-
-InlineBox* RootInlineBox::lastSelectedBox() {
-  for (InlineBox* box = lastLeafChild(); box; box = box->prevLeafChild()) {
-    if (box->selectionState() != RenderObject::SelectionNone)
-      return box;
-  }
-
-  return 0;
-}
-
-LayoutUnit RootInlineBox::selectionTop() const {
-  LayoutUnit selectionTop = m_lineTop;
-
-  if (m_hasAnnotationsBefore)
-    selectionTop -= computeOverAnnotationAdjustment(m_lineTop);
-
-  if (!prevRootBox())
-    return selectionTop;
-
-  return prevRootBox()->selectionBottom();
-}
-
-LayoutUnit RootInlineBox::selectionTopAdjustedForPrecedingBlock() const {
-  LayoutUnit top = selectionTop();
-
-  RenderObject::SelectionState blockSelectionState =
-      root().block().selectionState();
-  if (blockSelectionState != RenderObject::SelectionInside &&
-      blockSelectionState != RenderObject::SelectionEnd)
-    return top;
-
-  LayoutSize offsetToBlockBefore;
-  if (RenderBlock* block =
-          root().block().blockBeforeWithinSelectionRoot(offsetToBlockBefore)) {
-    if (block->isRenderParagraph()) {
-      if (RootInlineBox* lastLine = toRenderParagraph(block)->lastRootBox()) {
-        RenderObject::SelectionState lastLineSelectionState =
-            lastLine->selectionState();
-        if (lastLineSelectionState != RenderObject::SelectionInside &&
-            lastLineSelectionState != RenderObject::SelectionStart)
-          return top;
-
-        LayoutUnit lastLineSelectionBottom =
-            lastLine->selectionBottom() + offsetToBlockBefore.height();
-        top = std::max(top, lastLineSelectionBottom);
-      }
-    }
-  }
-
-  return top;
-}
-
-LayoutUnit RootInlineBox::selectionBottom() const {
-  LayoutUnit selectionBottom = m_selectionBottom;
-  if (m_hasAnnotationsAfter)
-    selectionBottom += computeUnderAnnotationAdjustment(m_lineBottom);
-  return selectionBottom;
-}
-
-int RootInlineBox::blockDirectionPointInLine() const {
-  return std::max(lineTop(), selectionTop());
-}
-
-RenderParagraph& RootInlineBox::block() const {
-  return toRenderParagraph(renderer());
-}
-
-static bool isEditableLeaf(InlineBox* leaf) {
-  return false;
-}
-
-InlineBox* RootInlineBox::closestLeafChildForPoint(
-    const IntPoint& pointInContents,
-    bool onlyEditableLeaves) {
-  return closestLeafChildForLogicalLeftPosition(pointInContents.x(),
-                                                onlyEditableLeaves);
-}
-
-InlineBox* RootInlineBox::closestLeafChildForLogicalLeftPosition(
-    int leftPosition,
-    bool onlyEditableLeaves) {
-  InlineBox* firstLeaf = firstLeafChild();
-  InlineBox* lastLeaf = lastLeafChild();
-
-  if (firstLeaf != lastLeaf) {
-    if (firstLeaf->isLineBreak())
-      firstLeaf = firstLeaf->nextLeafChildIgnoringLineBreak();
-    else if (lastLeaf->isLineBreak())
-      lastLeaf = lastLeaf->prevLeafChildIgnoringLineBreak();
-  }
-
-  if (firstLeaf == lastLeaf &&
-      (!onlyEditableLeaves || isEditableLeaf(firstLeaf)))
-    return firstLeaf;
-
-  // Avoid returning a list marker when possible.
-  if (leftPosition <= firstLeaf->logicalLeft() &&
-      (!onlyEditableLeaves || isEditableLeaf(firstLeaf)))
-    // The leftPosition coordinate is less or equal to left edge of the
-    // firstLeaf. Return it.
-    return firstLeaf;
-
-  if (leftPosition >= lastLeaf->logicalRight() &&
-      (!onlyEditableLeaves || isEditableLeaf(lastLeaf)))
-    // The leftPosition coordinate is greater or equal to right edge of the
-    // lastLeaf. Return it.
-    return lastLeaf;
-
-  InlineBox* closestLeaf = 0;
-  for (InlineBox* leaf = firstLeaf; leaf;
-       leaf = leaf->nextLeafChildIgnoringLineBreak()) {
-    if (!onlyEditableLeaves || isEditableLeaf(leaf)) {
-      closestLeaf = leaf;
-      if (leftPosition < leaf->logicalRight())
-        // The x coordinate is less than the right edge of the box.
-        // Return it.
-        return leaf;
-    }
-  }
-
-  return closestLeaf ? closestLeaf : lastLeaf;
-}
-
-BidiStatus RootInlineBox::lineBreakBidiStatus() const {
-  return BidiStatus(
-      static_cast(m_lineBreakBidiStatusEor),
-      static_cast(m_lineBreakBidiStatusLastStrong),
-      static_cast(m_lineBreakBidiStatusLast),
-      m_lineBreakContext);
-}
-
-void RootInlineBox::setLineBreakInfo(RenderObject* obj,
-                                     unsigned breakPos,
-                                     const BidiStatus& status) {
-  // When setting lineBreakObj, the RenderObject must not be a RenderInline
-  // with no line boxes, otherwise all sorts of invariants are broken later.
-  // This has security implications because if the RenderObject does not
-  // point to at least one line box, then that RenderInline can be deleted
-  // later without resetting the lineBreakObj, leading to use-after-free.
-  ASSERT_WITH_SECURITY_IMPLICATION(!obj || obj->isText() ||
-                                   !(obj->isRenderInline() && obj->isBox() &&
-                                     !toRenderBox(obj)->inlineBoxWrapper()));
-
-  m_lineBreakObj = obj;
-  m_lineBreakPos = breakPos;
-  m_lineBreakBidiStatusEor = status.eor;
-  m_lineBreakBidiStatusLastStrong = status.lastStrong;
-  m_lineBreakBidiStatusLast = status.last;
-  m_lineBreakContext = status.context;
-}
-
-void RootInlineBox::removeLineBoxFromRenderObject() {
-  block().lineBoxes()->removeLineBox(this);
-}
-
-void RootInlineBox::extractLineBoxFromRenderObject() {
-  block().lineBoxes()->extractLineBox(this);
-}
-
-void RootInlineBox::attachLineBoxToRenderObject() {
-  block().lineBoxes()->attachLineBox(this);
-}
-
-LayoutRect RootInlineBox::paddedLayoutOverflowRect(
-    LayoutUnit endPadding) const {
-  LayoutRect lineLayoutOverflow = layoutOverflowRect(lineTop(), lineBottom());
-  if (!endPadding)
-    return lineLayoutOverflow;
-
-  if (isLeftToRightDirection())
-    lineLayoutOverflow.shiftMaxXEdgeTo(std::max(
-        lineLayoutOverflow.maxX(), logicalRight() + endPadding));
-  else
-    lineLayoutOverflow.shiftXEdgeTo(std::min(
-        lineLayoutOverflow.x(), logicalLeft() - endPadding));
-
-  return lineLayoutOverflow;
-}
-
-static void setAscentAndDescent(int& ascent,
-                                int& descent,
-                                int newAscent,
-                                int newDescent,
-                                bool& ascentDescentSet) {
-  if (!ascentDescentSet) {
-    ascentDescentSet = true;
-    ascent = newAscent;
-    descent = newDescent;
-  } else {
-    ascent = std::max(ascent, newAscent);
-    descent = std::max(descent, newDescent);
-  }
-}
-
-void RootInlineBox::ascentAndDescentForBox(
-    InlineBox* box,
-    GlyphOverflowAndFallbackFontsMap& textBoxDataMap,
-    int& ascent,
-    int& descent,
-    bool& affectsAscent,
-    bool& affectsDescent) const {
-  bool ascentDescentSet = false;
-
-  // Replaced boxes will return 0 for the line-height if line-box-contain says
-  // they are not to be included.
-  if (box->renderer().isReplaced()) {
-    if (renderer().style(isFirstLineStyle())->lineBoxContain() &
-        LineBoxContainReplaced) {
-      ascent = box->baselinePosition(baselineType());
-      descent = box->lineHeight() - ascent;
-
-      // Replaced elements always affect both the ascent and descent.
-      affectsAscent = true;
-      affectsDescent = true;
-    }
-    return;
-  }
-
-  Vector* usedFonts = 0;
-  GlyphOverflow* glyphOverflow = 0;
-  if (box->isText()) {
-    GlyphOverflowAndFallbackFontsMap::iterator it =
-        textBoxDataMap.find(toInlineTextBox(box));
-    usedFonts = it == textBoxDataMap.end() ? 0 : &it->value.first;
-    glyphOverflow = it == textBoxDataMap.end() ? 0 : &it->value.second;
-  }
-
-  bool includeLeading = includeLeadingForBox(box);
-  bool includeFont = includeFontForBox(box);
-
-  bool setUsedFont = false;
-  bool setUsedFontWithLeading = false;
-
-  if (usedFonts && !usedFonts->isEmpty() &&
-      (includeFont ||
-       (box->renderer().style(isFirstLineStyle())->lineHeight().isNegative() &&
-        includeLeading))) {
-    usedFonts->append(
-        box->renderer().style(isFirstLineStyle())->font().primaryFont());
-    for (size_t i = 0; i < usedFonts->size(); ++i) {
-      const FontMetrics& fontMetrics = usedFonts->at(i)->fontMetrics();
-      int usedFontAscent = fontMetrics.ascent(baselineType());
-      int usedFontDescent = fontMetrics.descent(baselineType());
-      int halfLeading = (fontMetrics.lineSpacing() - fontMetrics.height()) / 2;
-      int usedFontAscentAndLeading = usedFontAscent + halfLeading;
-      int usedFontDescentAndLeading =
-          fontMetrics.lineSpacing() - usedFontAscentAndLeading;
-      if (includeFont) {
-        setAscentAndDescent(ascent, descent, usedFontAscent, usedFontDescent,
-                            ascentDescentSet);
-        setUsedFont = true;
-      }
-      if (includeLeading) {
-        setAscentAndDescent(ascent, descent, usedFontAscentAndLeading,
-                            usedFontDescentAndLeading, ascentDescentSet);
-        setUsedFontWithLeading = true;
-      }
-      if (!affectsAscent)
-        affectsAscent = usedFontAscent - box->logicalTop() > 0;
-      if (!affectsDescent)
-        affectsDescent = usedFontDescent + box->logicalTop() > 0;
-    }
-  }
-
-  // If leading is included for the box, then we compute that box.
-  if (includeLeading && !setUsedFontWithLeading) {
-    int ascentWithLeading = box->baselinePosition(baselineType());
-    int descentWithLeading = box->lineHeight() - ascentWithLeading;
-    setAscentAndDescent(ascent, descent, ascentWithLeading, descentWithLeading,
-                        ascentDescentSet);
-
-    // Examine the font box for inline flows and text boxes to see if any part
-    // of it is above the baseline. If the top of our font box relative to the
-    // root box baseline is above the root box baseline, then we are
-    // contributing to the maxAscent value. Descent is similar. If any part of
-    // our font box is below the root box's baseline, then we contribute to the
-    // maxDescent value.
-    affectsAscent = ascentWithLeading - box->logicalTop() > 0;
-    affectsDescent = descentWithLeading + box->logicalTop() > 0;
-  }
-
-  if (includeFontForBox(box) && !setUsedFont) {
-    int fontAscent = box->renderer()
-                         .style(isFirstLineStyle())
-                         ->fontMetrics()
-                         .ascent(baselineType());
-    int fontDescent = box->renderer()
-                          .style(isFirstLineStyle())
-                          ->fontMetrics()
-                          .descent(baselineType());
-    setAscentAndDescent(ascent, descent, fontAscent, fontDescent,
-                        ascentDescentSet);
-    affectsAscent = fontAscent - box->logicalTop() > 0;
-    affectsDescent = fontDescent + box->logicalTop() > 0;
-  }
-
-  if (includeGlyphsForBox(box) && glyphOverflow &&
-      glyphOverflow->computeBounds) {
-    setAscentAndDescent(ascent, descent, glyphOverflow->top,
-                        glyphOverflow->bottom, ascentDescentSet);
-    affectsAscent = glyphOverflow->top - box->logicalTop() > 0;
-    affectsDescent = glyphOverflow->bottom + box->logicalTop() > 0;
-    glyphOverflow->top =
-        std::min(glyphOverflow->top,
-                 std::max(0, glyphOverflow->top - box->renderer()
-                                                      .style(isFirstLineStyle())
-                                                      ->fontMetrics()
-                                                      .ascent(baselineType())));
-    glyphOverflow->bottom = std::min(
-        glyphOverflow->bottom,
-        std::max(0, glyphOverflow->bottom - box->renderer()
-                                                .style(isFirstLineStyle())
-                                                ->fontMetrics()
-                                                .descent(baselineType())));
-  }
-
-  if (includeMarginForBox(box)) {
-    LayoutUnit ascentWithMargin = box->renderer()
-                                      .style(isFirstLineStyle())
-                                      ->fontMetrics()
-                                      .ascent(baselineType());
-    LayoutUnit descentWithMargin = box->renderer()
-                                       .style(isFirstLineStyle())
-                                       ->fontMetrics()
-                                       .descent(baselineType());
-    if (box->parent() && !box->renderer().isText()) {
-      ascentWithMargin += box->boxModelObject()->borderBefore() +
-                          box->boxModelObject()->paddingBefore() +
-                          box->boxModelObject()->marginBefore();
-      descentWithMargin += box->boxModelObject()->borderAfter() +
-                           box->boxModelObject()->paddingAfter() +
-                           box->boxModelObject()->marginAfter();
-    }
-    setAscentAndDescent(ascent, descent, ascentWithMargin, descentWithMargin,
-                        ascentDescentSet);
-
-    // Treat like a replaced element, since we're using the margin box.
-    affectsAscent = true;
-    affectsDescent = true;
-  }
-}
-
-LayoutUnit RootInlineBox::verticalPositionForBox(
-    InlineBox* box,
-    VerticalPositionCache& verticalPositionCache) {
-  if (box->renderer().isText())
-    return box->parent()->logicalTop();
-
-  RenderBoxModelObject* renderer = box->boxModelObject();
-  ASSERT(renderer->isInline());
-  if (!renderer->isInline())
-    return 0;
-
-  bool firstLine = false;
-
-  // Check the cache.
-  bool isRenderInline = renderer->isRenderInline();
-  if (isRenderInline && !firstLine) {
-    LayoutUnit verticalPosition =
-        verticalPositionCache.get(renderer, baselineType());
-    if (verticalPosition != PositionUndefined)
-      return verticalPosition;
-  }
-
-  LayoutUnit verticalPosition = 0;
-  EVerticalAlign verticalAlign = renderer->style()->verticalAlign();
-  if (verticalAlign == TOP || verticalAlign == BOTTOM)
-    return 0;
-
-  RenderObject* parent = renderer->parent();
-  if (parent->isRenderInline() && parent->style()->verticalAlign() != TOP &&
-      parent->style()->verticalAlign() != BOTTOM)
-    verticalPosition = box->parent()->logicalTop();
-
-  if (verticalAlign != BASELINE) {
-    const Font& font = parent->style(firstLine)->font();
-    const FontMetrics& fontMetrics = font.fontMetrics();
-    int fontSize = font.fontDescription().computedPixelSize();
-
-    LineDirectionMode lineDirection = HorizontalLine;
-
-    if (verticalAlign == SUB)
-      verticalPosition += fontSize / 5 + 1;
-    else if (verticalAlign == SUPER)
-      verticalPosition -= fontSize / 3 + 1;
-    else if (verticalAlign == TEXT_TOP)
-      verticalPosition +=
-          renderer->baselinePosition(baselineType(), firstLine, lineDirection) -
-          fontMetrics.ascent(baselineType());
-    else if (verticalAlign == MIDDLE)
-      verticalPosition =
-          (verticalPosition -
-           static_cast(fontMetrics.xHeight() / 2) -
-           renderer->lineHeight(firstLine, lineDirection) / 2 +
-           renderer->baselinePosition(baselineType(), firstLine, lineDirection))
-              .round();
-    else if (verticalAlign == TEXT_BOTTOM) {
-      verticalPosition += fontMetrics.descent(baselineType());
-      // lineHeight - baselinePosition is always 0 for replaced elements (except
-      // inline blocks), so don't bother wasting time in that case.
-      if (!renderer->isReplaced() || renderer->isInlineBlock())
-        verticalPosition -= (renderer->lineHeight(firstLine, lineDirection) -
-                             renderer->baselinePosition(
-                                 baselineType(), firstLine, lineDirection));
-    } else if (verticalAlign == BASELINE_MIDDLE)
-      verticalPosition +=
-          -renderer->lineHeight(firstLine, lineDirection) / 2 +
-          renderer->baselinePosition(baselineType(), firstLine, lineDirection);
-    else if (verticalAlign == LENGTH) {
-      LayoutUnit lineHeight;
-      // Per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align:
-      // 'Percentages: refer to the 'line-height' of the element itself'.
-      if (renderer->style()->verticalAlignLength().isPercent())
-        lineHeight = renderer->style()->computedLineHeight();
-      else
-        lineHeight = renderer->lineHeight(firstLine, lineDirection);
-      verticalPosition -=
-          valueForLength(renderer->style()->verticalAlignLength(), lineHeight);
-    }
-  }
-
-  // Store the cached value.
-  if (isRenderInline && !firstLine)
-    verticalPositionCache.set(renderer, baselineType(), verticalPosition);
-
-  return verticalPosition;
-}
-
-bool RootInlineBox::includeLeadingForBox(InlineBox* box) const {
-  if (box->renderer().isReplaced() ||
-      (box->renderer().isText() && !box->isText()))
-    return false;
-
-  LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
-  return (lineBoxContain & LineBoxContainInline) ||
-         (box == this && (lineBoxContain & LineBoxContainBlock));
-}
-
-bool RootInlineBox::includeFontForBox(InlineBox* box) const {
-  if (box->renderer().isReplaced() ||
-      (box->renderer().isText() && !box->isText()))
-    return false;
-
-  if (!box->isText() && box->isInlineFlowBox() &&
-      !toInlineFlowBox(box)->hasTextChildren())
-    return false;
-
-  // For now map "glyphs" to "font" in vertical text mode until the bounds
-  // returned by glyphs aren't garbage.
-  LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
-  return lineBoxContain & LineBoxContainFont;
-}
-
-bool RootInlineBox::includeGlyphsForBox(InlineBox* box) const {
-  if (box->renderer().isReplaced() ||
-      (box->renderer().isText() && !box->isText()))
-    return false;
-
-  if (!box->isText() && box->isInlineFlowBox() &&
-      !toInlineFlowBox(box)->hasTextChildren())
-    return false;
-
-  // FIXME: We can't fit to glyphs yet for vertical text, since the bounds
-  // returned are garbage.
-  LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
-  return lineBoxContain & LineBoxContainGlyphs;
-}
-
-bool RootInlineBox::includeMarginForBox(InlineBox* box) const {
-  if (box->renderer().isReplaced() ||
-      (box->renderer().isText() && !box->isText()))
-    return false;
-
-  LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
-  return lineBoxContain & LineBoxContainInlineBox;
-}
-
-bool RootInlineBox::fitsToGlyphs() const {
-  // FIXME: We can't fit to glyphs yet for vertical text, since the bounds
-  // returned are garbage.
-  LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
-  return lineBoxContain & LineBoxContainGlyphs;
-}
-
-bool RootInlineBox::includesRootLineBoxFontOrLeading() const {
-  LineBoxContain lineBoxContain = renderer().style()->lineBoxContain();
-  return (lineBoxContain & LineBoxContainBlock) ||
-         (lineBoxContain & LineBoxContainInline) ||
-         (lineBoxContain & LineBoxContainFont);
-}
-
-#ifndef NDEBUG
-const char* RootInlineBox::boxName() const {
-  return "RootInlineBox";
-}
-#endif
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/RootInlineBox.h b/sky/engine/core/rendering/RootInlineBox.h
deleted file mode 100644
index 4fad3827b8c2d..0000000000000
--- a/sky/engine/core/rendering/RootInlineBox.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_ROOTINLINEBOX_H_
-#define SKY_ENGINE_CORE_RENDERING_ROOTINLINEBOX_H_
-
-#include "flutter/sky/engine/core/rendering/InlineFlowBox.h"
-#include "flutter/sky/engine/platform/text/BidiContext.h"
-
-namespace blink {
-
-class EllipsisBox;
-class HitTestResult;
-class RenderParagraph;
-
-struct BidiStatus;
-struct GapRects;
-
-class RootInlineBox : public InlineFlowBox {
- public:
-  explicit RootInlineBox(RenderParagraph&);
-
-  virtual void destroy() override final;
-
-  virtual bool isRootInlineBox() const override final { return true; }
-
-  void detachEllipsisBox();
-
-  RootInlineBox* nextRootBox() const {
-    return static_cast(m_nextLineBox);
-  }
-  RootInlineBox* prevRootBox() const {
-    return static_cast(m_prevLineBox);
-  }
-
-  virtual void adjustPosition(float dx, float dy) override final;
-
-  LayoutUnit lineTop() const { return m_lineTop; }
-  LayoutUnit lineBottom() const { return m_lineBottom; }
-
-  LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; }
-  LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; }
-
-  LayoutUnit selectionTop() const;
-  LayoutUnit selectionBottom() const;
-  LayoutUnit selectionHeight() const {
-    return max(0, selectionBottom() - selectionTop());
-  }
-
-  LayoutUnit selectionTopAdjustedForPrecedingBlock() const;
-  LayoutUnit selectionHeightAdjustedForPrecedingBlock() const {
-    return max(
-        0, selectionBottom() - selectionTopAdjustedForPrecedingBlock());
-  }
-
-  int blockDirectionPointInLine() const;
-
-  LayoutUnit alignBoxesInBlockDirection(LayoutUnit heightOfBlock,
-                                        GlyphOverflowAndFallbackFontsMap&,
-                                        VerticalPositionCache&);
-  void setLineTopBottomPositions(
-      LayoutUnit top,
-      LayoutUnit bottom,
-      LayoutUnit topWithLeading,
-      LayoutUnit bottomWithLeading,
-      LayoutUnit selectionBottom = LayoutUnit::min()) {
-    m_lineTop = top;
-    m_lineBottom = bottom;
-    m_lineTopWithLeading = topWithLeading;
-    m_lineBottomWithLeading = bottomWithLeading;
-    m_selectionBottom =
-        selectionBottom == LayoutUnit::min() ? bottom : selectionBottom;
-  }
-
-  virtual RenderLineBoxList* rendererLineBoxes() const override final;
-
-  RenderObject* lineBreakObj() const { return m_lineBreakObj; }
-  BidiStatus lineBreakBidiStatus() const;
-  void setLineBreakInfo(RenderObject*, unsigned breakPos, const BidiStatus&);
-
-  unsigned lineBreakPos() const { return m_lineBreakPos; }
-  void setLineBreakPos(unsigned p) { m_lineBreakPos = p; }
-
-  using InlineBox::endsWithBreak;
-  using InlineBox::setEndsWithBreak;
-
-  void childRemoved(InlineBox* box);
-
-  void paintEllipsisBox(PaintInfo&,
-                        const LayoutPoint&,
-                        LayoutUnit lineTop,
-                        LayoutUnit lineBottom,
-                        Vector& layers) const;
-
-  virtual void clearTruncation() override final;
-
-  virtual int baselinePosition(FontBaseline baselineType) const override final;
-  virtual LayoutUnit lineHeight() const override final;
-
-  virtual void paint(PaintInfo&,
-                     const LayoutPoint&,
-                     LayoutUnit lineTop,
-                     LayoutUnit lineBottom,
-                     Vector& layers) override;
-  virtual bool nodeAtPoint(const HitTestRequest&,
-                           HitTestResult&,
-                           const HitTestLocation& locationInContainer,
-                           const LayoutPoint& accumulatedOffset,
-                           LayoutUnit lineTop,
-                           LayoutUnit lineBottom) override final;
-
-  using InlineBox::hasSelectedChildren;
-  using InlineBox::setHasSelectedChildren;
-
-  virtual RenderObject::SelectionState selectionState() override final;
-  InlineBox* firstSelectedBox();
-  InlineBox* lastSelectedBox();
-
-  GapRects lineSelectionGap(RenderBlock* rootBlock,
-                            const LayoutPoint& rootBlockPhysicalPosition,
-                            const LayoutSize& offsetFromRootBlock,
-                            LayoutUnit selTop,
-                            LayoutUnit selHeight,
-                            const PaintInfo*);
-
-  RenderParagraph& block() const;
-
-  InlineBox* closestLeafChildForPoint(const IntPoint&, bool onlyEditableLeaves);
-  InlineBox* closestLeafChildForLogicalLeftPosition(
-      int,
-      bool onlyEditableLeaves = false);
-
-  virtual void extractLineBoxFromRenderObject() override final;
-  virtual void attachLineBoxToRenderObject() override final;
-  virtual void removeLineBoxFromRenderObject() override final;
-
-  FontBaseline baselineType() const {
-    return static_cast(m_baselineType);
-  }
-
-  bool hasAnnotationsBefore() const { return m_hasAnnotationsBefore; }
-  bool hasAnnotationsAfter() const { return m_hasAnnotationsAfter; }
-
-  LayoutRect paddedLayoutOverflowRect(LayoutUnit endPadding) const;
-
-  void ascentAndDescentForBox(InlineBox*,
-                              GlyphOverflowAndFallbackFontsMap&,
-                              int& ascent,
-                              int& descent,
-                              bool& affectsAscent,
-                              bool& affectsDescent) const;
-  LayoutUnit verticalPositionForBox(InlineBox*, VerticalPositionCache&);
-  bool includeLeadingForBox(InlineBox*) const;
-  bool includeFontForBox(InlineBox*) const;
-  bool includeGlyphsForBox(InlineBox*) const;
-  bool includeMarginForBox(InlineBox*) const;
-  bool fitsToGlyphs() const;
-  bool includesRootLineBoxFontOrLeading() const;
-
-  LayoutUnit logicalTopVisualOverflow() const {
-    return InlineFlowBox::logicalTopVisualOverflow(lineTop());
-  }
-  LayoutUnit logicalBottomVisualOverflow() const {
-    return InlineFlowBox::logicalBottomVisualOverflow(lineBottom());
-  }
-  LayoutUnit logicalTopLayoutOverflow() const {
-    return InlineFlowBox::logicalTopLayoutOverflow(lineTop());
-  }
-  LayoutUnit logicalBottomLayoutOverflow() const {
-    return InlineFlowBox::logicalBottomLayoutOverflow(lineBottom());
-  }
-
-  // Used to calculate the underline offset for TextUnderlinePositionUnder.
-  float maxLogicalTop() const;
-
-#ifndef NDEBUG
-  virtual const char* boxName() const override;
-#endif
- private:
-  LayoutUnit beforeAnnotationsAdjustment() const;
-
-  // This folds into the padding at the end of InlineFlowBox on 64-bit.
-  unsigned m_lineBreakPos;
-
-  // Where this line ended.  The exact object and the position within that
-  // object are stored so that we can create an InlineIterator beginning just
-  // after the end of this line.
-  RenderObject* m_lineBreakObj;
-  RefPtr m_lineBreakContext;
-
-  LayoutUnit m_lineTop;
-  LayoutUnit m_lineBottom;
-  LayoutUnit m_lineTopWithLeading;
-  LayoutUnit m_lineBottomWithLeading;
-  LayoutUnit m_selectionBottom;
-};
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_ROOTINLINEBOX_H_
diff --git a/sky/engine/core/rendering/ScrollAlignment.cpp b/sky/engine/core/rendering/ScrollAlignment.cpp
deleted file mode 100644
index 3f7062ca8ad9b..0000000000000
--- a/sky/engine/core/rendering/ScrollAlignment.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * Portions are Copyright (C) 1998 Netscape Communications Corporation.
- *
- * Other contributors:
- *   Robert O'Callahan 
- *   David Baron 
- *   Christian Biesinger 
- *   Randall Jesup 
- *   Roland Mainz 
- *   Josh Soref 
- *   Boris Zbarsky 
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
- *
- * Alternatively, the contents of this file may be used under the terms
- * of either the Mozilla Public License Version 1.1, found at
- * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
- * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
- * (the "GPL"), in which case the provisions of the MPL or the GPL are
- * applicable instead of those above.  If you wish to allow use of your
- * version of this file only under the terms of one of those two
- * licenses (the MPL or the GPL) and not to allow others to use your
- * version of this file under the LGPL, indicate your decision by
- * deletingthe provisions above and replace them with the notice and
- * other provisions required by the MPL or the GPL, as the case may be.
- * If you do not delete the provisions above, a recipient may use your
- * version of this file under any of the LGPL, the MPL or the GPL.
- */
-
-#include "flutter/sky/engine/core/rendering/ScrollAlignment.h"
-
-#include "flutter/sky/engine/platform/geometry/LayoutRect.h"
-
-namespace blink {
-
-const ScrollAlignment ScrollAlignment::alignCenterIfNeeded = {
-    ScrollAlignmentNoScroll, ScrollAlignmentCenter, ScrollAlignmentClosestEdge};
-const ScrollAlignment ScrollAlignment::alignToEdgeIfNeeded = {
-    ScrollAlignmentNoScroll, ScrollAlignmentClosestEdge,
-    ScrollAlignmentClosestEdge};
-const ScrollAlignment ScrollAlignment::alignCenterAlways = {
-    ScrollAlignmentCenter, ScrollAlignmentCenter, ScrollAlignmentCenter};
-const ScrollAlignment ScrollAlignment::alignTopAlways = {
-    ScrollAlignmentTop, ScrollAlignmentTop, ScrollAlignmentTop};
-
-#define MIN_INTERSECT_FOR_REVEAL 32
-
-LayoutRect ScrollAlignment::getRectToExpose(const LayoutRect& visibleRect,
-                                            const LayoutRect& exposeRect,
-                                            const ScrollAlignment& alignX,
-                                            const ScrollAlignment& alignY) {
-  // Determine the appropriate X behavior.
-  ScrollAlignmentBehavior scrollX;
-  LayoutRect exposeRectX(exposeRect.x(), visibleRect.y(), exposeRect.width(),
-                         visibleRect.height());
-  LayoutUnit intersectWidth = intersection(visibleRect, exposeRectX).width();
-  if (intersectWidth == exposeRect.width() ||
-      intersectWidth >= MIN_INTERSECT_FOR_REVEAL) {
-    // If the rectangle is fully visible, use the specified visible behavior.
-    // If the rectangle is partially visible, but over a certain threshold,
-    // then treat it as fully visible to avoid unnecessary horizontal scrolling
-    scrollX = getVisibleBehavior(alignX);
-  } else if (intersectWidth == visibleRect.width()) {
-    // If the rect is bigger than the visible area, don't bother trying to
-    // center. Other alignments will work.
-    scrollX = getVisibleBehavior(alignX);
-    if (scrollX == ScrollAlignmentCenter)
-      scrollX = ScrollAlignmentNoScroll;
-  } else if (intersectWidth > 0) {
-    // If the rectangle is partially visible, but not above the minimum
-    // threshold, use the specified partial behavior
-    scrollX = getPartialBehavior(alignX);
-  } else {
-    scrollX = getHiddenBehavior(alignX);
-  }
-
-  if (scrollX == ScrollAlignmentClosestEdge) {
-    // Closest edge is the right in two cases:
-    // (1) exposeRect to the right of and smaller than visibleRect
-    // (2) exposeRect to the left of and larger than visibleRect
-    if ((exposeRect.maxX() > visibleRect.maxX() &&
-         exposeRect.width() < visibleRect.width()) ||
-        (exposeRect.maxX() < visibleRect.maxX() &&
-         exposeRect.width() > visibleRect.width())) {
-      scrollX = ScrollAlignmentRight;
-    }
-  }
-
-  // Given the X behavior, compute the X coordinate.
-  LayoutUnit x;
-  if (scrollX == ScrollAlignmentNoScroll)
-    x = visibleRect.x();
-  else if (scrollX == ScrollAlignmentRight)
-    x = exposeRect.maxX() - visibleRect.width();
-  else if (scrollX == ScrollAlignmentCenter)
-    x = exposeRect.x() + (exposeRect.width() - visibleRect.width()) / 2;
-  else
-    x = exposeRect.x();
-
-  // Determine the appropriate Y behavior.
-  ScrollAlignmentBehavior scrollY;
-  LayoutRect exposeRectY(visibleRect.x(), exposeRect.y(), visibleRect.width(),
-                         exposeRect.height());
-  LayoutUnit intersectHeight = intersection(visibleRect, exposeRectY).height();
-  if (intersectHeight == exposeRect.height()) {
-    // If the rectangle is fully visible, use the specified visible behavior.
-    scrollY = getVisibleBehavior(alignY);
-  } else if (intersectHeight == visibleRect.height()) {
-    // If the rect is bigger than the visible area, don't bother trying to
-    // center. Other alignments will work.
-    scrollY = getVisibleBehavior(alignY);
-    if (scrollY == ScrollAlignmentCenter)
-      scrollY = ScrollAlignmentNoScroll;
-  } else if (intersectHeight > 0) {
-    // If the rectangle is partially visible, use the specified partial behavior
-    scrollY = getPartialBehavior(alignY);
-  } else {
-    scrollY = getHiddenBehavior(alignY);
-  }
-
-  if (scrollY == ScrollAlignmentClosestEdge) {
-    // Closest edge is the bottom in two cases:
-    // (1) exposeRect below and smaller than visibleRect
-    // (2) exposeRect above and larger than visibleRect
-    if ((exposeRect.maxY() > visibleRect.maxY() &&
-         exposeRect.height() < visibleRect.height()) ||
-        (exposeRect.maxY() < visibleRect.maxY() &&
-         exposeRect.height() > visibleRect.height())) {
-      scrollY = ScrollAlignmentBottom;
-    }
-  }
-
-  // Given the Y behavior, compute the Y coordinate.
-  LayoutUnit y;
-  if (scrollY == ScrollAlignmentNoScroll)
-    y = visibleRect.y();
-  else if (scrollY == ScrollAlignmentBottom)
-    y = exposeRect.maxY() - visibleRect.height();
-  else if (scrollY == ScrollAlignmentCenter)
-    y = exposeRect.y() + (exposeRect.height() - visibleRect.height()) / 2;
-  else
-    y = exposeRect.y();
-
-  return LayoutRect(LayoutPoint(x, y), visibleRect.size());
-}
-
-};  // namespace blink
diff --git a/sky/engine/core/rendering/ScrollAlignment.h b/sky/engine/core/rendering/ScrollAlignment.h
deleted file mode 100644
index 0a6cf32b53c31..0000000000000
--- a/sky/engine/core/rendering/ScrollAlignment.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2003, 2009 Apple Inc.  All rights reserved.
- *
- * Portions are Copyright (C) 1998 Netscape Communications Corporation.
- *
- * Other contributors:
- *   Robert O'Callahan 
- *   David Baron 
- *   Christian Biesinger 
- *   Randall Jesup 
- *   Roland Mainz 
- *   Josh Soref 
- *   Boris Zbarsky 
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
- *
- * Alternatively, the contents of this file may be used under the terms
- * of either the Mozilla Public License Version 1.1, found at
- * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public
- * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html
- * (the "GPL"), in which case the provisions of the MPL or the GPL are
- * applicable instead of those above.  If you wish to allow use of your
- * version of this file only under the terms of one of those two
- * licenses (the MPL or the GPL) and not to allow others to use your
- * version of this file under the LGPL, indicate your decision by
- * deletingthe provisions above and replace them with the notice and
- * other provisions required by the MPL or the GPL, as the case may be.
- * If you do not delete the provisions above, a recipient may use your
- * version of this file under any of the LGPL, the MPL or the GPL.
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_SCROLLALIGNMENT_H_
-#define SKY_ENGINE_CORE_RENDERING_SCROLLALIGNMENT_H_
-
-namespace blink {
-
-enum ScrollAlignmentBehavior {
-  ScrollAlignmentNoScroll,
-  ScrollAlignmentCenter,
-  ScrollAlignmentTop,
-  ScrollAlignmentBottom,
-  ScrollAlignmentLeft,
-  ScrollAlignmentRight,
-  ScrollAlignmentClosestEdge
-};
-
-class LayoutRect;
-
-struct ScrollAlignment {
-  static ScrollAlignmentBehavior getVisibleBehavior(const ScrollAlignment& s) {
-    return s.m_rectVisible;
-  }
-  static ScrollAlignmentBehavior getPartialBehavior(const ScrollAlignment& s) {
-    return s.m_rectPartial;
-  }
-  static ScrollAlignmentBehavior getHiddenBehavior(const ScrollAlignment& s) {
-    return s.m_rectHidden;
-  }
-
-  // FIXME: This function should probably go somewhere else but where?
-  static LayoutRect getRectToExpose(const LayoutRect& visibleRect,
-                                    const LayoutRect& exposeRect,
-                                    const ScrollAlignment& alignX,
-                                    const ScrollAlignment& alignY);
-
-  static const ScrollAlignment alignCenterIfNeeded;
-  static const ScrollAlignment alignToEdgeIfNeeded;
-  static const ScrollAlignment alignCenterAlways;
-  static const ScrollAlignment alignTopAlways;
-
-  ScrollAlignmentBehavior m_rectVisible;
-  ScrollAlignmentBehavior m_rectHidden;
-  ScrollAlignmentBehavior m_rectPartial;
-};
-
-};  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_SCROLLALIGNMENT_H_
diff --git a/sky/engine/core/rendering/SubtreeLayoutScope.cpp b/sky/engine/core/rendering/SubtreeLayoutScope.cpp
deleted file mode 100644
index 6700b7603c1d3..0000000000000
--- a/sky/engine/core/rendering/SubtreeLayoutScope.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "flutter/sky/engine/core/rendering/SubtreeLayoutScope.h"
-
-#include "flutter/sky/engine/core/rendering/RenderObject.h"
-
-namespace blink {
-
-SubtreeLayoutScope::SubtreeLayoutScope(RenderObject& root) : m_root(root) {}
-
-SubtreeLayoutScope::~SubtreeLayoutScope() {
-  RELEASE_ASSERT(!m_root.needsLayout());
-
-#if ENABLE(ASSERT)
-  for (HashSet::iterator it = m_renderersToLayout.begin();
-       it != m_renderersToLayout.end(); ++it)
-    (*it)->assertRendererLaidOut();
-#endif
-}
-
-void SubtreeLayoutScope::setNeedsLayout(RenderObject* descendant) {
-  ASSERT(descendant->isDescendantOf(&m_root));
-  descendant->setNeedsLayout(MarkContainingBlockChain, this);
-}
-
-void SubtreeLayoutScope::setChildNeedsLayout(RenderObject* descendant) {
-  ASSERT(descendant->isDescendantOf(&m_root));
-  descendant->setChildNeedsLayout(MarkContainingBlockChain, this);
-}
-
-void SubtreeLayoutScope::addRendererToLayout(RenderObject* renderer) {
-#if ENABLE(ASSERT)
-  m_renderersToLayout.add(renderer);
-#endif
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/SubtreeLayoutScope.h b/sky/engine/core/rendering/SubtreeLayoutScope.h
deleted file mode 100644
index 04eb4e34c1372..0000000000000
--- a/sky/engine/core/rendering/SubtreeLayoutScope.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_SUBTREELAYOUTSCOPE_H_
-#define SKY_ENGINE_CORE_RENDERING_SUBTREELAYOUTSCOPE_H_
-
-#include "flutter/sky/engine/wtf/HashSet.h"
-
-// This is the way to mark a subtree as needing layout during layout,
-// e.g. for the purposes of doing a multipass layout.
-//
-// It should only be used during layout. Outside of layout, you should
-// just call renderer->setNeedsLayout() directly.
-//
-// It ensures that you don't accidentally mark part of the tree as
-// needing layout and not actually lay it out.
-
-namespace blink {
-
-class RenderObject;
-
-class SubtreeLayoutScope {
- public:
-  SubtreeLayoutScope(RenderObject& root);
-  ~SubtreeLayoutScope();
-
-  void setNeedsLayout(RenderObject* descendant);
-  void setChildNeedsLayout(RenderObject* descendant);
-
-  RenderObject& root() { return m_root; }
-  void addRendererToLayout(RenderObject* renderer);
-
- private:
-  RenderObject& m_root;
-
-#if ENABLE(ASSERT)
-  HashSet m_renderersToLayout;
-#endif
-};
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_SUBTREELAYOUTSCOPE_H_
diff --git a/sky/engine/core/rendering/TextRunConstructor.cpp b/sky/engine/core/rendering/TextRunConstructor.cpp
deleted file mode 100644
index aca2b1bedaaed..0000000000000
--- a/sky/engine/core/rendering/TextRunConstructor.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "flutter/sky/engine/core/rendering/TextRunConstructor.h"
-
-#include "flutter/sky/engine/core/rendering/RenderText.h"
-#include "flutter/sky/engine/core/rendering/style/RenderStyle.h"
-#include "flutter/sky/engine/platform/text/BidiTextRun.h"
-
-namespace blink {
-
-template 
-static inline TextRun constructTextRunInternal(
-    RenderObject* context,
-    const Font& font,
-    const CharacterType* characters,
-    int length,
-    RenderStyle* style,
-    TextDirection direction,
-    TextRun::ExpansionBehavior expansion) {
-  ASSERT(style);
-
-  bool directionalOverride = style->rtlOrdering() == VisualOrder;
-  return TextRun(characters, length, 0, 0, expansion, direction,
-                 directionalOverride);
-}
-
-template 
-static inline TextRun constructTextRunInternal(
-    RenderObject* context,
-    const Font& font,
-    const CharacterType* characters,
-    int length,
-    RenderStyle* style,
-    TextDirection direction,
-    TextRun::ExpansionBehavior expansion,
-    TextRunFlags flags) {
-  ASSERT(style);
-
-  TextDirection textDirection = direction;
-  bool directionalOverride = style->rtlOrdering() == VisualOrder;
-  if (flags != DefaultTextRunFlags) {
-    if (flags & RespectDirection)
-      textDirection = style->direction();
-    if (flags & RespectDirectionOverride)
-      directionalOverride |= isOverride(style->unicodeBidi());
-  }
-
-  return TextRun(characters, length, 0, 0, expansion, textDirection,
-                 directionalOverride);
-}
-
-TextRun constructTextRun(RenderObject* context,
-                         const Font& font,
-                         const LChar* characters,
-                         int length,
-                         RenderStyle* style,
-                         TextDirection direction,
-                         TextRun::ExpansionBehavior expansion) {
-  return constructTextRunInternal(context, font, characters, length, style,
-                                  direction, expansion);
-}
-
-TextRun constructTextRun(RenderObject* context,
-                         const Font& font,
-                         const UChar* characters,
-                         int length,
-                         RenderStyle* style,
-                         TextDirection direction,
-                         TextRun::ExpansionBehavior expansion) {
-  return constructTextRunInternal(context, font, characters, length, style,
-                                  direction, expansion);
-}
-
-TextRun constructTextRun(RenderObject* context,
-                         const Font& font,
-                         const RenderText* text,
-                         RenderStyle* style,
-                         TextDirection direction,
-                         TextRun::ExpansionBehavior expansion) {
-  if (text->is8Bit())
-    return constructTextRunInternal(context, font, text->characters8(),
-                                    text->textLength(), style, direction,
-                                    expansion);
-  return constructTextRunInternal(context, font, text->characters16(),
-                                  text->textLength(), style, direction,
-                                  expansion);
-}
-
-TextRun constructTextRun(RenderObject* context,
-                         const Font& font,
-                         const RenderText* text,
-                         unsigned offset,
-                         unsigned length,
-                         RenderStyle* style,
-                         TextDirection direction,
-                         TextRun::ExpansionBehavior expansion) {
-  ASSERT(offset + length <= text->textLength());
-  if (text->is8Bit())
-    return constructTextRunInternal(context, font, text->characters8() + offset,
-                                    length, style, direction, expansion);
-  return constructTextRunInternal(context, font, text->characters16() + offset,
-                                  length, style, direction, expansion);
-}
-
-TextRun constructTextRun(RenderObject* context,
-                         const Font& font,
-                         const String& string,
-                         RenderStyle* style,
-                         TextDirection direction,
-                         TextRun::ExpansionBehavior expansion,
-                         TextRunFlags flags) {
-  unsigned length = string.length();
-  if (!length)
-    return constructTextRunInternal(context, font, static_cast(0),
-                                    length, style, direction, expansion, flags);
-  if (string.is8Bit())
-    return constructTextRunInternal(context, font, string.characters8(), length,
-                                    style, direction, expansion, flags);
-  return constructTextRunInternal(context, font, string.characters16(), length,
-                                  style, direction, expansion, flags);
-}
-
-TextRun constructTextRun(RenderObject* context,
-                         const Font& font,
-                         const String& string,
-                         RenderStyle* style,
-                         TextRun::ExpansionBehavior expansion,
-                         TextRunFlags flags) {
-  bool hasStrongDirectionality;
-  return constructTextRun(
-      context, font, string, style,
-      determineDirectionality(string, hasStrongDirectionality), expansion,
-      flags);
-}
-
-TextRun constructTextRun(RenderObject* context,
-                         const Font& font,
-                         const RenderText* text,
-                         unsigned offset,
-                         unsigned length,
-                         RenderStyle* style,
-                         TextRun::ExpansionBehavior expansion) {
-  ASSERT(offset + length <= text->textLength());
-  TextRun run = text->is8Bit()
-                    ? constructTextRunInternal(context, font,
-                                               text->characters8() + offset,
-                                               length, style, LTR, expansion)
-                    : constructTextRunInternal(context, font,
-                                               text->characters16() + offset,
-                                               length, style, LTR, expansion);
-  bool hasStrongDirectionality;
-  run.setDirection(directionForRun(run, hasStrongDirectionality));
-  return run;
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/TextRunConstructor.h b/sky/engine/core/rendering/TextRunConstructor.h
deleted file mode 100644
index 87881cca71a80..0000000000000
--- a/sky/engine/core/rendering/TextRunConstructor.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- *           (C) 1999 Antti Koivisto (koivisto@kde.org)
- *           (C) 2007 David Smith (catfish.man@gmail.com)
- * Copyright (C) 2003-2013 Apple Inc. All rights reserved.
- * Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_TEXTRUNCONSTRUCTOR_H_
-#define SKY_ENGINE_CORE_RENDERING_TEXTRUNCONSTRUCTOR_H_
-
-#include "flutter/sky/engine/platform/text/TextDirection.h"
-#include "flutter/sky/engine/platform/text/TextRun.h"
-#include "flutter/sky/engine/wtf/text/WTFString.h"
-#include "flutter/sky/engine/wtf/unicode/Unicode.h"
-
-namespace blink {
-
-class Font;
-class RenderObject;
-class RenderStyle;
-class RenderText;
-
-enum TextRunFlag {
-  DefaultTextRunFlags = 0,
-  RespectDirection = 1 << 0,
-  RespectDirectionOverride = 1 << 1
-};
-
-typedef unsigned TextRunFlags;
-
-// Direction resolved from string value.
-TextRun constructTextRun(
-    RenderObject* context,
-    const Font&,
-    const String&,
-    RenderStyle*,
-    TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion |
-                                 TextRun::ForbidLeadingExpansion,
-    TextRunFlags = DefaultTextRunFlags);
-TextRun constructTextRun(
-    RenderObject* context,
-    const Font&,
-    const RenderText*,
-    unsigned offset,
-    unsigned length,
-    RenderStyle*,
-    TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion |
-                                 TextRun::ForbidLeadingExpansion);
-
-// Explicit direction.
-TextRun constructTextRun(
-    RenderObject* context,
-    const Font&,
-    const String&,
-    RenderStyle*,
-    TextDirection,
-    TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion |
-                                 TextRun::ForbidLeadingExpansion,
-    TextRunFlags = DefaultTextRunFlags);
-
-TextRun constructTextRun(
-    RenderObject* context,
-    const Font&,
-    const RenderText*,
-    RenderStyle*,
-    TextDirection,
-    TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion |
-                                 TextRun::ForbidLeadingExpansion);
-
-TextRun constructTextRun(
-    RenderObject* context,
-    const Font&,
-    const RenderText*,
-    unsigned offset,
-    unsigned length,
-    RenderStyle*,
-    TextDirection,
-    TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion |
-                                 TextRun::ForbidLeadingExpansion);
-
-TextRun constructTextRun(
-    RenderObject* context,
-    const Font&,
-    const RenderText*,
-    unsigned offset,
-    RenderStyle*,
-    TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion |
-                                 TextRun::ForbidLeadingExpansion);
-
-TextRun constructTextRun(
-    RenderObject* context,
-    const Font&,
-    const LChar* characters,
-    int length,
-    RenderStyle*,
-    TextDirection,
-    TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion |
-                                 TextRun::ForbidLeadingExpansion);
-
-TextRun constructTextRun(
-    RenderObject* context,
-    const Font&,
-    const UChar* characters,
-    int length,
-    RenderStyle*,
-    TextDirection,
-    TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion |
-                                 TextRun::ForbidLeadingExpansion);
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_TEXTRUNCONSTRUCTOR_H_
diff --git a/sky/engine/core/rendering/VerticalPositionCache.h b/sky/engine/core/rendering/VerticalPositionCache.h
deleted file mode 100644
index ad42b6c6a7f3c..0000000000000
--- a/sky/engine/core/rendering/VerticalPositionCache.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_VERTICALPOSITIONCACHE_H_
-#define SKY_ENGINE_CORE_RENDERING_VERTICALPOSITIONCACHE_H_
-
-#include "flutter/sky/engine/platform/fonts/FontBaseline.h"
-#include "flutter/sky/engine/wtf/HashMap.h"
-
-namespace blink {
-
-class RenderObject;
-
-// Values for vertical alignment.
-const int PositionUndefined = 0x80000000;
-
-class VerticalPositionCache {
-  WTF_MAKE_NONCOPYABLE(VerticalPositionCache);
-
- public:
-  VerticalPositionCache() {}
-
-  int get(RenderObject* renderer, FontBaseline baselineType) const {
-    const HashMap& mapToCheck =
-        baselineType == AlphabeticBaseline ? m_alphabeticPositions
-                                           : m_ideographicPositions;
-    const HashMap::const_iterator it =
-        mapToCheck.find(renderer);
-    if (it == mapToCheck.end())
-      return PositionUndefined;
-    return it->value;
-  }
-
-  void set(RenderObject* renderer, FontBaseline baselineType, int position) {
-    if (baselineType == AlphabeticBaseline)
-      m_alphabeticPositions.set(renderer, position);
-    else
-      m_ideographicPositions.set(renderer, position);
-  }
-
- private:
-  HashMap m_alphabeticPositions;
-  HashMap m_ideographicPositions;
-};
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_VERTICALPOSITIONCACHE_H_
diff --git a/sky/engine/core/rendering/break_lines.cpp b/sky/engine/core/rendering/break_lines.cpp
deleted file mode 100644
index 5ae4acf79c635..0000000000000
--- a/sky/engine/core/rendering/break_lines.cpp
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Copyright (C) 2005, 2007, 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "flutter/sky/engine/core/rendering/break_lines.h"
-
-#include "flutter/sky/engine/platform/text/TextBreakIterator.h"
-#include "flutter/sky/engine/wtf/ASCIICType.h"
-#include "flutter/sky/engine/wtf/StdLibExtras.h"
-#include "flutter/sky/engine/wtf/unicode/CharacterNames.h"
-
-namespace blink {
-
-template 
-static inline bool isBreakableSpace(UChar ch) {
-  switch (ch) {
-    case ' ':
-    case '\n':
-    case '\t':
-      return true;
-    case noBreakSpace:
-      return treatNoBreakSpaceAsBreak;
-    default:
-      return false;
-  }
-}
-
-static const UChar asciiLineBreakTableFirstChar = '!';
-static const UChar asciiLineBreakTableLastChar = 127;
-
-// Pack 8 bits into one byte
-#define B(a, b, c, d, e, f, g, h)                                         \
-  ((a) | ((b) << 1) | ((c) << 2) | ((d) << 3) | ((e) << 4) | ((f) << 5) | \
-   ((g) << 6) | ((h) << 7))
-
-// Line breaking table row for each digit (0-9)
-#define DI \
-  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-
-// Line breaking table row for ascii letters (a-z A-Z)
-#define AL \
-  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-
-#define F 0xFF
-
-// Line breaking table for printable ASCII characters. Line breaking
-// opportunities in this table are as below:
-// - before opening punctuations such as '(', '<', '[', '{' after certain
-// characters (compatible with Firefox 3.6);
-// - after '-' and '?' (backward-compatible, and compatible with Internet
-// Explorer). Please refer to 
-// for line breaking matrixes of different browsers and the ICU standard.
-static const unsigned char asciiLineBreakTable
-    [][(asciiLineBreakTableLastChar - asciiLineBreakTableFirstChar) / 8 + 1] = {
-        //  !  "  #  $  %  &  '  (     )  *  +  ,  -  .  /  0  1-8   9  :  ;  <
-        //  =  >  ?  @     A-X      Y  Z  [  \  ]  ^  _  `     a-x      y  z  {
-        //  |  }  ~  DEL
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // !
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // "
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // #
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // $
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // %
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // &
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // '
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // (
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // )
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // *
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // +
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // ,
-        {B(1, 1, 1, 1, 1, 1, 1, 1), B(1, 1, 1, 1, 1, 0, 1, 0), 0,
-         B(0, 1, 1, 1, 1, 1, 1, 1), F, F, F, B(1, 1, 1, 1, 1, 1, 1, 1), F, F, F,
-         B(1, 1, 1, 1, 1, 1, 1, 1)},  // - Note: breaking before '0'-'9' is
-                                      // handled hard-coded in
-                                      // shouldBreakAfter().
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // .
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // /
-        DI,
-        DI,
-        DI,
-        DI,
-        DI,
-        DI,
-        DI,
-        DI,
-        DI,
-        DI,  // 0-9
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // :
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // ;
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // <
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // =
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // >
-        {B(0, 0, 1, 1, 1, 1, 0, 1), B(0, 1, 1, 0, 1, 0, 0, 1), F,
-         B(1, 0, 0, 1, 1, 1, 0, 1), F, F, F, B(1, 1, 1, 1, 0, 1, 1, 1), F, F, F,
-         B(1, 1, 1, 1, 0, 1, 1, 0)},  // ?
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // @
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,  // A-Z
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // [
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // '\'
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // ]
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // ^
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // _
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // `
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,
-        AL,  // a-z
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // {
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // |
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // }
-        {B(0, 0, 0, 0, 0, 0, 0, 1), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 1, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 1, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 1, 0, 0, 0, 0, 0)},  // ~
-        {B(0, 0, 0, 0, 0, 0, 0, 0), B(0, 0, 0, 0, 0, 0, 0, 0), 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, B(0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0,
-         B(0, 0, 0, 0, 0, 0, 0, 0)},  // DEL
-};
-
-#undef B
-#undef F
-#undef DI
-#undef AL
-
-COMPILE_ASSERT(WTF_ARRAY_LENGTH(asciiLineBreakTable) ==
-                   asciiLineBreakTableLastChar - asciiLineBreakTableFirstChar +
-                       1,
-               TestLineBreakTableConsistency);
-
-static inline bool shouldBreakAfter(UChar lastCh, UChar ch, UChar nextCh) {
-  // Don't allow line breaking between '-' and a digit if the '-' may mean a
-  // minus sign in the context, while allow breaking in 'ABCD-1234' and
-  // '1234-5678' which may be in long URLs.
-  if (ch == '-' && isASCIIDigit(nextCh))
-    return isASCIIAlphanumeric(lastCh);
-
-  // If both ch and nextCh are ASCII characters, use a lookup table for enhanced
-  // speed and for compatibility with other browsers (see comments for
-  // asciiLineBreakTable for details).
-  if (ch >= asciiLineBreakTableFirstChar && ch <= asciiLineBreakTableLastChar &&
-      nextCh >= asciiLineBreakTableFirstChar &&
-      nextCh <= asciiLineBreakTableLastChar) {
-    const unsigned char* tableRow =
-        asciiLineBreakTable[ch - asciiLineBreakTableFirstChar];
-    int nextChIndex = nextCh - asciiLineBreakTableFirstChar;
-    return tableRow[nextChIndex / 8] & (1 << (nextChIndex % 8));
-  }
-  // Otherwise defer to the Unicode algorithm by returning false.
-  return false;
-}
-
-template 
-inline bool needsLineBreakIterator(UChar ch) {
-  if (treatNoBreakSpaceAsBreak)
-    return ch > asciiLineBreakTableLastChar;
-  return ch > asciiLineBreakTableLastChar && ch != noBreakSpace;
-}
-
-template 
-static inline int nextBreakablePosition(
-    LazyLineBreakIterator& lazyBreakIterator,
-    const CharacterType* str,
-    unsigned length,
-    int pos) {
-  int len = static_cast(length);
-  int nextBreak = -1;
-
-  CharacterType lastLastCh =
-      pos > 1 ? str[pos - 2]
-              : static_cast(
-                    lazyBreakIterator.secondToLastCharacter());
-  CharacterType lastCh =
-      pos > 0 ? str[pos - 1]
-              : static_cast(lazyBreakIterator.lastCharacter());
-  unsigned priorContextLength = lazyBreakIterator.priorContextLength();
-  for (int i = pos; i < len; i++) {
-    CharacterType ch = str[i];
-
-    if (isBreakableSpace(ch) ||
-        shouldBreakAfter(lastLastCh, lastCh, ch))
-      return i;
-
-    if (needsLineBreakIterator(ch) ||
-        needsLineBreakIterator(lastCh)) {
-      if (nextBreak < i) {
-        // Don't break if positioned at start of primary context and there is no
-        // prior context.
-        if (i || priorContextLength) {
-          TextBreakIterator* breakIterator =
-              lazyBreakIterator.get(priorContextLength);
-          if (breakIterator) {
-            nextBreak = breakIterator->following(i - 1 + priorContextLength);
-            if (nextBreak >= 0) {
-              nextBreak -= priorContextLength;
-            }
-          }
-        }
-      }
-      if (i == nextBreak && !isBreakableSpace(lastCh))
-        return i;
-    }
-
-    lastLastCh = lastCh;
-    lastCh = ch;
-  }
-
-  return len;
-}
-
-int nextBreakablePositionIgnoringNBSP(LazyLineBreakIterator& lazyBreakIterator,
-                                      int pos) {
-  String string = lazyBreakIterator.string();
-  if (string.is8Bit())
-    return nextBreakablePosition(
-        lazyBreakIterator, string.characters8(), string.length(), pos);
-  return nextBreakablePosition(
-      lazyBreakIterator, string.characters16(), string.length(), pos);
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/break_lines.h b/sky/engine/core/rendering/break_lines.h
deleted file mode 100644
index 806c4e367bc50..0000000000000
--- a/sky/engine/core/rendering/break_lines.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2005 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_BREAK_LINES_H_
-#define SKY_ENGINE_CORE_RENDERING_BREAK_LINES_H_
-
-#include "flutter/sky/engine/wtf/unicode/Unicode.h"
-
-namespace blink {
-
-class LazyLineBreakIterator;
-
-int nextBreakablePositionIgnoringNBSP(LazyLineBreakIterator&, int pos);
-
-inline bool isBreakable(LazyLineBreakIterator& lazyBreakIterator,
-                        int pos,
-                        int& nextBreakable) {
-  if (pos > nextBreakable)
-    nextBreakable = nextBreakablePositionIgnoringNBSP(lazyBreakIterator, pos);
-  return pos == nextBreakable;
-}
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_BREAK_LINES_H_
diff --git a/sky/engine/core/rendering/line/BreakingContext.cpp b/sky/engine/core/rendering/line/BreakingContext.cpp
deleted file mode 100644
index 9c658ce2d9886..0000000000000
--- a/sky/engine/core/rendering/line/BreakingContext.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
- * right reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2013 Adobe Systems Incorporated.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "flutter/sky/engine/core/rendering/line/BreakingContextInlineHeaders.h"
-
-namespace blink {
-
-InlineIterator BreakingContext::handleEndOfLine() {
-  if (m_lineBreak == m_resolver.position() && !m_lineBreak.object()) {
-    // we just add as much as possible
-    if (m_blockStyle->whiteSpace() == PRE && !m_current.offset()) {
-      m_lineBreak.moveTo(m_lastObject,
-                         m_lastObject->isText() ? m_lastObject->length() : 0);
-    } else if (m_lineBreak.object()) {
-      // Don't ever break in the middle of a word if we can help it.
-      // There's no room at all. We just have to be on this line,
-      // even though we'll spill out.
-      m_lineBreak.moveTo(m_current.object(), m_current.offset());
-    }
-  }
-
-  // FIXME Bug 100049: We do not need to consume input in a multi-segment line
-  // unless no segment will.
-  if (m_lineBreak == m_resolver.position())
-    m_lineBreak.increment();
-
-  // Sanity check our midpoints.
-  m_lineMidpointState.checkMidpoints(m_lineBreak);
-
-  m_trailingObjects.updateMidpointsForTrailingObjects(
-      m_lineMidpointState, m_lineBreak, TrailingObjects::CollapseFirstSpace);
-
-  // We might have made lineBreak an iterator that points past the end
-  // of the object. Do this adjustment to make it point to the start
-  // of the next object instead to avoid confusing the rest of the
-  // code.
-  if (m_lineBreak.offset()) {
-    // This loop enforces the invariant that line breaks should never point
-    // at an empty inline. See http://crbug.com/305904.
-    do {
-      m_lineBreak.setOffset(m_lineBreak.offset() - 1);
-      m_lineBreak.increment();
-    } while (!m_lineBreak.atEnd() && isEmptyInline(m_lineBreak.object()));
-  }
-
-  m_lineInfo.incrementLineIndex();
-
-  return m_lineBreak;
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/line/BreakingContextInlineHeaders.h b/sky/engine/core/rendering/line/BreakingContextInlineHeaders.h
deleted file mode 100644
index b06f67edaef75..0000000000000
--- a/sky/engine/core/rendering/line/BreakingContextInlineHeaders.h
+++ /dev/null
@@ -1,943 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
- * right reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2013 Adobe Systems Incorporated.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_LINE_BREAKINGCONTEXTINLINEHEADERS_H_
-#define SKY_ENGINE_CORE_RENDERING_LINE_BREAKINGCONTEXTINLINEHEADERS_H_
-
-#include "flutter/sky/engine/core/rendering/InlineIterator.h"
-#include "flutter/sky/engine/core/rendering/InlineTextBox.h"
-#include "flutter/sky/engine/core/rendering/RenderInline.h"
-#include "flutter/sky/engine/core/rendering/RenderLayer.h"
-#include "flutter/sky/engine/core/rendering/RenderObjectInlines.h"
-#include "flutter/sky/engine/core/rendering/TextRunConstructor.h"
-#include "flutter/sky/engine/core/rendering/break_lines.h"
-#include "flutter/sky/engine/core/rendering/line/LineBreaker.h"
-#include "flutter/sky/engine/core/rendering/line/LineInfo.h"
-#include "flutter/sky/engine/core/rendering/line/LineWidth.h"
-#include "flutter/sky/engine/core/rendering/line/RenderTextInfo.h"
-#include "flutter/sky/engine/core/rendering/line/TrailingObjects.h"
-#include "flutter/sky/engine/core/rendering/line/WordMeasurement.h"
-
-namespace blink {
-
-// We don't let our line box tree for a single line get any deeper than this.
-const unsigned cMaxLineDepth = 200;
-
-class BreakingContext {
- public:
-  BreakingContext(InlineBidiResolver& resolver,
-                  LineInfo& inLineInfo,
-                  LineWidth& lineWidth,
-                  RenderTextInfo& inRenderTextInfo,
-                  FloatingObject* inLastFloatFromPreviousLine,
-                  bool appliedStartWidth,
-                  RenderParagraph* block)
-      : m_resolver(resolver),
-        m_current(resolver.position()),
-        m_lineBreak(resolver.position()),
-        m_block(block),
-        m_lastObject(m_current.object()),
-        m_nextObject(0),
-        m_currentStyle(0),
-        m_blockStyle(block->style()),
-        m_lineInfo(inLineInfo),
-        m_renderTextInfo(inRenderTextInfo),
-        m_width(lineWidth),
-        m_currWS(NORMAL),
-        m_lastWS(NORMAL),
-        m_preservesNewline(false),
-        m_atStart(true),
-        m_ignoringSpaces(false),
-        m_currentCharacterIsSpace(false),
-        m_currentCharacterShouldCollapseIfPreWap(false),
-        m_appliedStartWidth(appliedStartWidth),
-        m_includeEndWidth(true),
-        m_autoWrap(false),
-        m_autoWrapWasEverTrueOnLine(false),
-        m_collapseWhiteSpace(false),
-        m_startingNewParagraph(m_lineInfo.previousLineBrokeCleanly()),
-        m_atEnd(false),
-        m_lineMidpointState(resolver.midpointState()) {
-    m_lineInfo.setPreviousLineBrokeCleanly(false);
-  }
-
-  RenderObject* currentObject() { return m_current.object(); }
-  InlineIterator lineBreak() { return m_lineBreak; }
-  bool atEnd() { return m_atEnd; }
-
-  void initializeForCurrentObject();
-
-  void increment();
-
-  void handleOutOfFlowPositioned(Vector& positionedObjects);
-  void handleEmptyInline();
-  void handleReplaced();
-  bool handleText(WordMeasurements&, bool& hyphenated, bool& ellipsized);
-  void commitAndUpdateLineBreakIfNeeded();
-  InlineIterator handleEndOfLine();
-
-  void clearLineBreakIfFitsOnLine() {
-    if (m_width.fitsOnLine() || m_lastWS == NOWRAP)
-      m_lineBreak.clear();
-  }
-
- private:
-  void skipTrailingWhitespace(InlineIterator&, const LineInfo&);
-
-  InlineBidiResolver& m_resolver;
-
-  InlineIterator m_current;
-  InlineIterator m_lineBreak;
-  InlineIterator m_startOfIgnoredSpaces;
-
-  RenderParagraph* m_block;
-  RenderObject* m_lastObject;
-  RenderObject* m_nextObject;
-
-  RenderStyle* m_currentStyle;
-  RenderStyle* m_blockStyle;
-
-  LineInfo& m_lineInfo;
-
-  RenderTextInfo& m_renderTextInfo;
-
-  LineWidth m_width;
-
-  EWhiteSpace m_currWS;
-  EWhiteSpace m_lastWS;
-
-  bool m_preservesNewline;
-  bool m_atStart;
-  bool m_ignoringSpaces;
-  bool m_currentCharacterIsSpace;
-  bool m_currentCharacterShouldCollapseIfPreWap;
-  bool m_appliedStartWidth;
-  bool m_includeEndWidth;
-  bool m_autoWrap;
-  bool m_autoWrapWasEverTrueOnLine;
-  bool m_collapseWhiteSpace;
-  bool m_startingNewParagraph;
-  bool m_atEnd;
-
-  LineMidpointState& m_lineMidpointState;
-
-  TrailingObjects m_trailingObjects;
-};
-
-inline bool shouldCollapseWhiteSpace(const RenderStyle* style,
-                                     const LineInfo& lineInfo,
-                                     WhitespacePosition whitespacePosition) {
-  // CSS2 16.6.1
-  // If a space (U+0020) at the beginning of a line has 'white-space' set to
-  // 'normal', 'nowrap', or 'pre-line', it is removed. If a space (U+0020) at
-  // the end of a line has 'white-space' set to 'normal', 'nowrap', or
-  // 'pre-line', it is also removed. If spaces (U+0020) or tabs (U+0009) at the
-  // end of a line have 'white-space' set to 'pre-wrap', UAs may visually
-  // collapse them.
-  return style->collapseWhiteSpace() ||
-         (whitespacePosition == TrailingWhitespace &&
-          style->whiteSpace() == PRE_WRAP &&
-          (!lineInfo.isEmpty() || !lineInfo.previousLineBrokeCleanly()));
-}
-
-inline bool requiresLineBoxForContent(RenderInline* flow,
-                                      const LineInfo& lineInfo) {
-  RenderObject* parent = flow->parent();
-  if ((flow->style(lineInfo.isFirstLine())->lineHeight() !=
-           parent->style(lineInfo.isFirstLine())->lineHeight() ||
-       flow->style()->verticalAlign() != parent->style()->verticalAlign() ||
-       !parent->style()
-            ->font()
-            .fontMetrics()
-            .hasIdenticalAscentDescentAndLineGap(
-                flow->style()->font().fontMetrics())))
-    return true;
-  return false;
-}
-
-inline bool alwaysRequiresLineBox(RenderObject* flow) {
-  // FIXME: Right now, we only allow line boxes for inlines that are truly
-  // empty. We need to fix this, though, because at the very least, inlines
-  // containing only ignorable whitespace should should also have line boxes.
-  return isEmptyInline(flow) &&
-         toRenderInline(flow)->hasInlineDirectionBordersPaddingOrMargin();
-}
-
-inline bool requiresLineBox(
-    const InlineIterator& it,
-    const LineInfo& lineInfo = LineInfo(),
-    WhitespacePosition whitespacePosition = LeadingWhitespace) {
-  if (it.object()->isFloatingOrOutOfFlowPositioned())
-    return false;
-
-  if (it.object()->isRenderInline() && !alwaysRequiresLineBox(it.object()) &&
-      !requiresLineBoxForContent(toRenderInline(it.object()), lineInfo))
-    return false;
-
-  if (!shouldCollapseWhiteSpace(it.object()->style(), lineInfo,
-                                whitespacePosition))
-    return true;
-
-  UChar current = it.current();
-  bool notJustWhitespace = current != ' ' && current != '\t' &&
-                           current != softHyphen &&
-                           (current != '\n' || it.object()->preservesNewline());
-  return notJustWhitespace || isEmptyInline(it.object());
-}
-
-// FIXME: The entire concept of the skipTrailingWhitespace function is flawed,
-// since we really need to be building line boxes even for containers that may
-// ultimately collapse away. Otherwise we'll never get positioned elements quite
-// right. In other words, we need to build this function's work into the normal
-// line object iteration process. NB. this function will insert any floating
-// elements that would otherwise be skipped but it will not position them.
-inline void BreakingContext::skipTrailingWhitespace(InlineIterator& iterator,
-                                                    const LineInfo& lineInfo) {
-  while (!iterator.atEnd() &&
-         !requiresLineBox(iterator, lineInfo, TrailingWhitespace))
-    iterator.increment();
-}
-
-inline void BreakingContext::initializeForCurrentObject() {
-  m_currentStyle = m_current.object()->style();
-  m_nextObject = bidiNextSkippingEmptyInlines(m_block, m_current.object());
-  if (m_nextObject && m_nextObject->parent() &&
-      !m_nextObject->parent()->isDescendantOf(m_current.object()->parent()))
-    m_includeEndWidth = true;
-
-  m_currWS = m_current.object()->isReplaced()
-                 ? m_current.object()->parent()->style()->whiteSpace()
-                 : m_currentStyle->whiteSpace();
-  m_lastWS = m_lastObject->isReplaced()
-                 ? m_lastObject->parent()->style()->whiteSpace()
-                 : m_lastObject->style()->whiteSpace();
-
-  m_autoWrap = RenderStyle::autoWrap(m_currWS);
-  m_autoWrapWasEverTrueOnLine = m_autoWrapWasEverTrueOnLine || m_autoWrap;
-
-  m_preservesNewline = RenderStyle::preserveNewline(m_currWS);
-  m_collapseWhiteSpace = RenderStyle::collapseWhiteSpace(m_currWS);
-}
-
-inline void BreakingContext::increment() {
-  // Clear out our character space bool, since inline 
s don't collapse
-  // whitespace with adjacent inline normal/nowrap spans.
-  if (!m_collapseWhiteSpace)
-    m_currentCharacterIsSpace = false;
-
-  m_current.moveToStartOf(m_nextObject);
-  m_atStart = false;
-}
-
-inline LayoutUnit borderPaddingMarginStart(RenderInline* child) {
-  return child->marginStart() + child->paddingStart() + child->borderStart();
-}
-
-inline LayoutUnit borderPaddingMarginEnd(RenderInline* child) {
-  return child->marginEnd() + child->paddingEnd() + child->borderEnd();
-}
-
-inline bool shouldAddBorderPaddingMargin(RenderObject* child, bool& checkSide) {
-  if (!child || (child->isText() && !toRenderText(child)->textLength()))
-    return true;
-  checkSide = false;
-  return checkSide;
-}
-
-inline LayoutUnit inlineLogicalWidth(RenderObject* child,
-                                     bool start = true,
-                                     bool end = true) {
-  unsigned lineDepth = 1;
-  LayoutUnit extraWidth = 0;
-  RenderObject* parent = child->parent();
-  while (parent->isRenderInline() && lineDepth++ < cMaxLineDepth) {
-    RenderInline* parentAsRenderInline = toRenderInline(parent);
-    if (!isEmptyInline(parentAsRenderInline)) {
-      if (start &&
-          shouldAddBorderPaddingMargin(child->previousSibling(), start))
-        extraWidth += borderPaddingMarginStart(parentAsRenderInline);
-      if (end && shouldAddBorderPaddingMargin(child->nextSibling(), end))
-        extraWidth += borderPaddingMarginEnd(parentAsRenderInline);
-      if (!start && !end)
-        return extraWidth;
-    }
-    child = parent;
-    parent = child->parent();
-  }
-  return extraWidth;
-}
-
-inline void BreakingContext::handleOutOfFlowPositioned(
-    Vector& positionedObjects) {
-  // If our original display wasn't an inline type, then we can
-  // go ahead and determine our static inline position now.
-  RenderBox* box = toRenderBox(m_current.object());
-
-  // If we're ignoring spaces, we have to stop and include this object and
-  // then start ignoring spaces again.
-  if (box->style()->isOriginalDisplayInlineType() ||
-      box->container()->isRenderInline()) {
-    if (m_ignoringSpaces)
-      m_lineMidpointState.ensureLineBoxInsideIgnoredSpaces(box);
-    m_trailingObjects.appendObjectIfNeeded(box);
-  } else {
-    positionedObjects.append(box);
-  }
-  m_width.addUncommittedWidth(inlineLogicalWidth(box).toFloat());
-  // Reset prior line break context characters.
-  m_renderTextInfo.m_lineBreakIterator.resetPriorContext();
-}
-
-// This is currently just used for list markers and inline flows that have line
-// boxes. Neither should have an effect on whitespace at the start of the line.
-inline bool shouldSkipWhitespaceAfterStartObject(
-    RenderParagraph* block,
-    RenderObject* o,
-    LineMidpointState& lineMidpointState) {
-  RenderObject* next = bidiNextSkippingEmptyInlines(block, o);
-  while (next && next->isFloatingOrOutOfFlowPositioned())
-    next = bidiNextSkippingEmptyInlines(block, next);
-
-  if (next && next->isText() && toRenderText(next)->textLength() > 0) {
-    RenderText* nextText = toRenderText(next);
-    UChar nextChar = nextText->characterAt(0);
-    if (nextText->style()->isCollapsibleWhiteSpace(nextChar)) {
-      lineMidpointState.startIgnoringSpaces(InlineIterator(0, o, 0));
-      return true;
-    }
-  }
-
-  return false;
-}
-
-inline void BreakingContext::handleEmptyInline() {
-  // This should only end up being called on empty inlines
-  ASSERT(isEmptyInline(m_current.object()));
-
-  RenderInline* flowBox = toRenderInline(m_current.object());
-
-  bool requiresLineBox = alwaysRequiresLineBox(m_current.object());
-  if (requiresLineBox || requiresLineBoxForContent(flowBox, m_lineInfo)) {
-    // An empty inline that only has line-height, vertical-align or font-metrics
-    // will not force linebox creation (and thus affect the height of the line)
-    // if the rest of the line is empty.
-    if (requiresLineBox)
-      m_lineInfo.setEmpty(false, m_block, &m_width);
-    if (m_ignoringSpaces) {
-      // If we are in a run of ignored spaces then ensure we get a linebox if
-      // lineboxes are eventually created for the line...
-      m_trailingObjects.clear();
-      m_lineMidpointState.ensureLineBoxInsideIgnoredSpaces(m_current.object());
-    } else if (m_blockStyle->collapseWhiteSpace() &&
-               m_resolver.position().object() == m_current.object() &&
-               shouldSkipWhitespaceAfterStartObject(m_block, m_current.object(),
-                                                    m_lineMidpointState)) {
-      // If this object is at the start of the line, we need to behave like list
-      // markers and start ignoring spaces.
-      m_currentCharacterShouldCollapseIfPreWap = m_currentCharacterIsSpace =
-          true;
-      m_ignoringSpaces = true;
-    } else {
-      // If we are after a trailing space but aren't ignoring spaces yet then
-      // ensure we get a linebox if we encounter collapsible whitepace.
-      m_trailingObjects.appendObjectIfNeeded(m_current.object());
-    }
-  }
-
-  m_width.addUncommittedWidth((inlineLogicalWidth(m_current.object()) +
-                               borderPaddingMarginStart(flowBox) +
-                               borderPaddingMarginEnd(flowBox))
-                                  .toFloat());
-}
-
-inline void BreakingContext::handleReplaced() {
-  RenderBox* replacedBox = toRenderBox(m_current.object());
-
-  if (m_atStart)
-    m_width.updateAvailableWidth();
-
-  // Break on replaced elements if either has normal white-space.
-  if (m_autoWrap || RenderStyle::autoWrap(m_lastWS)) {
-    m_width.commit();
-    m_lineBreak.moveToStartOf(m_current.object());
-  }
-
-  if (m_ignoringSpaces)
-    m_lineMidpointState.stopIgnoringSpaces(
-        InlineIterator(0, m_current.object(), 0));
-
-  m_lineInfo.setEmpty(false, m_block, &m_width);
-  m_ignoringSpaces = false;
-  m_currentCharacterShouldCollapseIfPreWap = m_currentCharacterIsSpace = false;
-  m_trailingObjects.clear();
-
-  // Optimize for a common case. If we can't find whitespace after the list
-  // item, then this is all moot.
-  LayoutUnit replacedLogicalWidth = m_block->logicalWidthForChild(replacedBox) +
-                                    m_block->marginStartForChild(replacedBox) +
-                                    m_block->marginEndForChild(replacedBox) +
-                                    inlineLogicalWidth(m_current.object());
-  m_width.addUncommittedWidth(replacedLogicalWidth.toFloat());
-  // Update prior line break context characters, using U+FFFD (OBJECT
-  // REPLACEMENT CHARACTER) for replaced element.
-  m_renderTextInfo.m_lineBreakIterator.updatePriorContext(replacementCharacter);
-}
-
-inline void nextCharacter(UChar& currentCharacter,
-                          UChar& lastCharacter,
-                          UChar& secondToLastCharacter) {
-  secondToLastCharacter = lastCharacter;
-  lastCharacter = currentCharacter;
-}
-
-inline float firstPositiveWidth(const WordMeasurements& wordMeasurements) {
-  for (size_t i = 0; i < wordMeasurements.size(); ++i) {
-    if (wordMeasurements[i].width > 0)
-      return wordMeasurements[i].width;
-  }
-  return 0;
-}
-
-inline float measureHyphenWidth(RenderText* renderer,
-                                const Font& font,
-                                TextDirection textDirection) {
-  RenderStyle* style = renderer->style();
-  return font.width(constructTextRun(renderer, font,
-                                     style->hyphenString().string(), style,
-                                     style->direction()));
-}
-
-inline float measureEllipsisWidth(RenderText* renderer,
-                                  const Font& font,
-                                  const String& ellipsis) {
-  RenderStyle* style = renderer->style();
-  return font.width(
-      constructTextRun(renderer, font, ellipsis, style, style->direction()));
-}
-
-ALWAYS_INLINE TextDirection
-textDirectionFromUnicode(WTF::Unicode::Direction direction) {
-  return direction == WTF::Unicode::RightToLeft ||
-                 direction == WTF::Unicode::RightToLeftArabic
-             ? RTL
-             : LTR;
-}
-
-ALWAYS_INLINE float textWidth(
-    RenderText* text,
-    unsigned from,
-    unsigned len,
-    const Font& font,
-    float xPos,
-    bool isFixedPitch,
-    bool collapseWhiteSpace,
-    HashSet* fallbackFonts = 0) {
-  GlyphOverflow glyphOverflow;
-  if (isFixedPitch || (!from && len == text->textLength()))
-    return text->width(from, len, font, xPos, text->style()->direction(),
-                       fallbackFonts, &glyphOverflow);
-
-  TextRun run = constructTextRun(text, font, text, from, len, text->style());
-  run.setCharacterScanForCodePath(!text->canUseSimpleFontCodePath());
-  run.setTabSize(!collapseWhiteSpace, text->style()->tabSize());
-  run.setXPos(xPos);
-  return font.width(run, fallbackFonts, &glyphOverflow);
-}
-
-inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements,
-                                        bool& hyphenated,
-                                        bool& ellipsized) {
-  if (!m_current.offset())
-    m_appliedStartWidth = false;
-
-  RenderText* renderText = toRenderText(m_current.object());
-
-  // If we have left a no-wrap inline and entered an autowrap inline while
-  // ignoring spaces then we need to mark the start of the autowrap inline as a
-  // potential linebreak now.
-  if (m_autoWrap && !RenderStyle::autoWrap(m_lastWS) && m_ignoringSpaces) {
-    m_width.commit();
-    m_lineBreak.moveToStartOf(m_current.object());
-  }
-
-  RenderStyle* style = renderText->style(m_lineInfo.isFirstLine());
-  const Font& font = style->font();
-  bool isFixedPitch = font.isFixedPitch();
-
-  unsigned lastSpace = m_current.offset();
-  float wordSpacing = m_currentStyle->wordSpacing();
-  float lastSpaceWordSpacing = 0;
-  float wordSpacingForWordMeasurement = 0;
-
-  float wrapW =
-      m_width.uncommittedWidth() +
-      inlineLogicalWidth(m_current.object(), !m_appliedStartWidth, true);
-  float charWidth = 0;
-  // Auto-wrapping text should wrap in the middle of a word only if it could not
-  // wrap before the word, which is only possible if the word is the first thing
-  // on the line, that is, if |w| is zero.
-  bool breakWords =
-      m_currentStyle->breakWords() &&
-      ((m_autoWrap && !m_width.committedWidth()) || m_currWS == PRE);
-  bool midWordBreak = false;
-  bool breakAll =
-      m_currentStyle->wordBreak() == BreakAllWordBreak && m_autoWrap;
-
-  float hyphenWidth = 0;
-
-  bool ellipsizeMode = false;
-  float ellipsisWidth = 0;
-  unsigned ellipsisBreakOffset = 0;
-  if (m_lineInfo.lineIndex() == m_blockStyle->maxLines() - 1 ||
-      m_blockStyle->maxLines() == INT_MAX) {
-    ellipsizeMode = !m_blockStyle->ellipsis().isEmpty();
-    if (ellipsizeMode) {
-      ellipsisWidth = measureEllipsisWidth(renderText, font,
-                                           m_blockStyle->ellipsis().string());
-      breakAll = true;
-    }
-  }
-
-  if (m_renderTextInfo.m_text != renderText) {
-    m_renderTextInfo.m_text = renderText;
-    m_renderTextInfo.m_font = &font;
-    m_renderTextInfo.m_lineBreakIterator.resetStringAndReleaseIterator(
-        renderText->text(), style->locale());
-  } else if (m_renderTextInfo.m_font != &font) {
-    m_renderTextInfo.m_font = &font;
-  }
-
-  // Non-zero only when kerning is enabled, in which case we measure
-  // words with their trailing space, then subtract its width.
-  float wordTrailingSpaceWidth =
-      (font.fontDescription().typesettingFeatures() & Kerning)
-          ? font.width(constructTextRun(renderText, font, &space, 1, style,
-                                        style->direction())) +
-                wordSpacing
-          : 0;
-
-  UChar lastCharacter = m_renderTextInfo.m_lineBreakIterator.lastCharacter();
-  UChar secondToLastCharacter =
-      m_renderTextInfo.m_lineBreakIterator.secondToLastCharacter();
-  for (; m_current.offset() < renderText->textLength();
-       m_current.fastIncrementInTextNode()) {
-    bool previousCharacterIsSpace = m_currentCharacterIsSpace;
-    bool previousCharacterShouldCollapseIfPreWap =
-        m_currentCharacterShouldCollapseIfPreWap;
-    UChar c = m_current.current();
-    m_currentCharacterShouldCollapseIfPreWap = m_currentCharacterIsSpace =
-        c == ' ' || c == '\t' || (!m_preservesNewline && (c == '\n'));
-
-    if (!m_collapseWhiteSpace || !m_currentCharacterIsSpace)
-      m_lineInfo.setEmpty(false, m_block, &m_width);
-
-    if (c == softHyphen && m_autoWrap && !hyphenWidth) {
-      hyphenWidth = measureHyphenWidth(
-          renderText, font,
-          textDirectionFromUnicode(m_resolver.position().direction()));
-      m_width.addUncommittedWidth(hyphenWidth);
-    }
-
-    bool applyWordSpacing = false;
-
-    if ((breakAll || breakWords) && !midWordBreak) {
-      wrapW += charWidth;
-      bool midWordBreakIsBeforeSurrogatePair =
-          U16_IS_LEAD(c) && m_current.offset() + 1 < renderText->textLength() &&
-          U16_IS_TRAIL((*renderText)[m_current.offset() + 1]);
-      charWidth = textWidth(renderText, m_current.offset(),
-                            midWordBreakIsBeforeSurrogatePair ? 2 : 1, font,
-                            m_width.committedWidth() + wrapW, isFixedPitch,
-                            m_collapseWhiteSpace);
-
-      float midWordWidth = m_width.committedWidth() + wrapW + charWidth;
-      midWordBreak = midWordWidth > m_width.availableWidth();
-
-      // Check whether there is enough space to fit this character plus an
-      // ellipsis.
-      if (ellipsizeMode &&
-          midWordWidth + ellipsisWidth <= m_width.availableWidth()) {
-        ellipsisBreakOffset = m_current.offset();
-      }
-    }
-
-    int nextBreakablePosition = m_current.nextBreakablePosition();
-    bool betweenWords =
-        c == '\n' || (m_currWS != PRE && !m_atStart &&
-                      isBreakable(m_renderTextInfo.m_lineBreakIterator,
-                                  m_current.offset(), nextBreakablePosition));
-    m_current.setNextBreakablePosition(nextBreakablePosition);
-
-    if (betweenWords || midWordBreak) {
-      bool stoppedIgnoringSpaces = false;
-      if (m_ignoringSpaces) {
-        lastSpaceWordSpacing = 0;
-        if (!m_currentCharacterIsSpace) {
-          // Stop ignoring spaces and begin at this
-          // new point.
-          m_ignoringSpaces = false;
-          wordSpacingForWordMeasurement = 0;
-          lastSpace = m_current.offset();  // e.g., "Foo    goo", don't add in
-                                           // any of the ignored spaces.
-          m_lineMidpointState.stopIgnoringSpaces(
-              InlineIterator(0, m_current.object(), m_current.offset()));
-          stoppedIgnoringSpaces = true;
-        } else {
-          // Just keep ignoring these spaces.
-          nextCharacter(c, lastCharacter, secondToLastCharacter);
-          continue;
-        }
-      }
-
-      wordMeasurements.grow(wordMeasurements.size() + 1);
-      WordMeasurement& wordMeasurement = wordMeasurements.last();
-
-      wordMeasurement.renderer = renderText;
-      wordMeasurement.endOffset = m_current.offset();
-      wordMeasurement.startOffset = lastSpace;
-
-      float additionalTempWidth;
-      if (wordTrailingSpaceWidth && c == ' ')
-        additionalTempWidth =
-            textWidth(renderText, lastSpace, m_current.offset() + 1 - lastSpace,
-                      font, m_width.currentWidth(), isFixedPitch,
-                      m_collapseWhiteSpace, &wordMeasurement.fallbackFonts) -
-            wordTrailingSpaceWidth;
-      else
-        additionalTempWidth =
-            textWidth(renderText, lastSpace, m_current.offset() - lastSpace,
-                      font, m_width.currentWidth(), isFixedPitch,
-                      m_collapseWhiteSpace, &wordMeasurement.fallbackFonts);
-
-      wordMeasurement.width =
-          additionalTempWidth + wordSpacingForWordMeasurement;
-      additionalTempWidth += lastSpaceWordSpacing;
-      m_width.addUncommittedWidth(additionalTempWidth);
-
-      if (m_collapseWhiteSpace && previousCharacterIsSpace &&
-          m_currentCharacterIsSpace && additionalTempWidth)
-        m_width.setTrailingWhitespaceWidth(additionalTempWidth);
-
-      if (!m_appliedStartWidth) {
-        m_width.addUncommittedWidth(
-            inlineLogicalWidth(m_current.object(), true, false).toFloat());
-        m_appliedStartWidth = true;
-      }
-
-      applyWordSpacing = wordSpacing && m_currentCharacterIsSpace;
-
-      if (!m_width.committedWidth() && m_autoWrap && !m_width.fitsOnLine())
-        m_width.fitBelowFloats(m_lineInfo.isFirstLine());
-
-      if (m_autoWrap || breakWords) {
-        // If we break only after white-space, consider the current character
-        // as candidate width for this line.
-        bool lineWasTooWide = false;
-        if (m_width.fitsOnLine() && m_currentCharacterIsSpace &&
-            m_currentStyle->breakOnlyAfterWhiteSpace() && !midWordBreak) {
-          float charWidth =
-              textWidth(renderText, m_current.offset(), 1, font,
-                        m_width.currentWidth(), isFixedPitch,
-                        m_collapseWhiteSpace, &wordMeasurement.fallbackFonts) +
-              (applyWordSpacing ? wordSpacing : 0);
-          // Check if line is too big even without the extra space
-          // at the end of the line. If it is not, do nothing.
-          // If the line needs the extra whitespace to be too long,
-          // then move the line break to the space.
-          if (!m_width.fitsOnLine(charWidth)) {
-            lineWasTooWide = true;
-            m_lineBreak.moveTo(m_current.object(), m_current.offset(),
-                               m_current.nextBreakablePosition());
-            skipTrailingWhitespace(m_lineBreak, m_lineInfo);
-          }
-        }
-        if (lineWasTooWide || !m_width.fitsOnLine()) {
-          if (m_lineBreak.atTextParagraphSeparator()) {
-            if (!stoppedIgnoringSpaces && m_current.offset() > 0)
-              m_lineMidpointState.ensureCharacterGetsLineBox(m_current);
-            m_lineBreak.increment();
-            m_lineInfo.setPreviousLineBrokeCleanly(true);
-            wordMeasurement.endOffset = m_lineBreak.offset();
-          }
-          if (m_lineBreak.object() && m_lineBreak.offset() &&
-              m_lineBreak.object()->isText() &&
-              toRenderText(m_lineBreak.object())->textLength() &&
-              toRenderText(m_lineBreak.object())
-                      ->characterAt(m_lineBreak.offset() - 1) == softHyphen)
-            hyphenated = true;
-          if (m_lineBreak.offset() &&
-              m_lineBreak.offset() != (unsigned)wordMeasurement.endOffset &&
-              !wordMeasurement.width) {
-            if (charWidth) {
-              wordMeasurement.endOffset = m_lineBreak.offset();
-              wordMeasurement.width = charWidth;
-            }
-          }
-
-          // Didn't fit. Jump to the end unless there's still an opportunity to
-          // collapse whitespace.
-          if (m_ignoringSpaces || !m_collapseWhiteSpace ||
-              !m_currentCharacterIsSpace || !previousCharacterIsSpace) {
-            m_atEnd = true;
-            return false;
-          }
-        } else {
-          if (!betweenWords || (midWordBreak && !m_autoWrap))
-            m_width.addUncommittedWidth(-additionalTempWidth);
-          if (hyphenWidth) {
-            // Subtract the width of the soft hyphen out since we fit on a line.
-            m_width.addUncommittedWidth(-hyphenWidth);
-            hyphenWidth = 0;
-          }
-        }
-      }
-
-      if (c == '\n' && m_preservesNewline) {
-        if (!stoppedIgnoringSpaces && m_current.offset())
-          m_lineMidpointState.ensureCharacterGetsLineBox(m_current);
-        m_lineBreak.moveTo(m_current.object(), m_current.offset(),
-                           m_current.nextBreakablePosition());
-        m_lineBreak.increment();
-        m_lineInfo.setPreviousLineBrokeCleanly(true);
-        m_lineInfo
-            .incrementLineIndex();  // caller only calls this if we return false
-        return true;
-      }
-
-      if (m_autoWrap && betweenWords) {
-        m_width.commit();
-        wrapW = 0;
-        m_lineBreak.moveTo(m_current.object(), m_current.offset(),
-                           m_current.nextBreakablePosition());
-        // Auto-wrapping text should not wrap in the middle of a word once it
-        // has had an opportunity to break after a word.
-        breakWords = false;
-      }
-
-      if (midWordBreak && !U16_IS_TRAIL(c) &&
-          !(WTF::Unicode::category(c) &
-            (WTF::Unicode::Mark_NonSpacing | WTF::Unicode::Mark_Enclosing |
-             WTF::Unicode::Mark_SpacingCombining))) {
-        if (ellipsizeMode) {
-          // Break the line at the position where an ellipsis would fit.
-          m_lineBreak.moveTo(m_current.object(), ellipsisBreakOffset,
-                             m_current.nextBreakablePosition());
-          ellipsized = true;
-        } else {
-          // Remember this as a breakable position in case
-          // adding the end width forces a break.
-          m_lineBreak.moveTo(m_current.object(), m_current.offset(),
-                             m_current.nextBreakablePosition());
-          midWordBreak &= (breakWords || breakAll);
-        }
-      }
-
-      if (betweenWords) {
-        lastSpaceWordSpacing = applyWordSpacing ? wordSpacing : 0;
-        wordSpacingForWordMeasurement =
-            (applyWordSpacing && wordMeasurement.width) ? wordSpacing : 0;
-        lastSpace = m_current.offset();
-      }
-
-      if (!m_ignoringSpaces && m_currentStyle->collapseWhiteSpace()) {
-        // If we encounter a newline, or if we encounter a
-        // second space, we need to go ahead and break up this
-        // run and enter a mode where we start collapsing spaces.
-        if (m_currentCharacterIsSpace && previousCharacterIsSpace) {
-          m_ignoringSpaces = true;
-
-          // We just entered a mode where we are ignoring
-          // spaces. Create a midpoint to terminate the run
-          // before the second space.
-          m_lineMidpointState.startIgnoringSpaces(m_startOfIgnoredSpaces);
-          m_trailingObjects.updateMidpointsForTrailingObjects(
-              m_lineMidpointState, InlineIterator(),
-              TrailingObjects::DoNotCollapseFirstSpace);
-        }
-      }
-    } else if (m_ignoringSpaces) {
-      // Stop ignoring spaces and begin at this
-      // new point.
-      m_ignoringSpaces = false;
-      lastSpaceWordSpacing = applyWordSpacing ? wordSpacing : 0;
-      wordSpacingForWordMeasurement =
-          (applyWordSpacing && wordMeasurements.last().width) ? wordSpacing : 0;
-      lastSpace = m_current.offset();  // e.g., "Foo    goo", don't add in any
-                                       // of the ignored spaces.
-      m_lineMidpointState.stopIgnoringSpaces(
-          InlineIterator(0, m_current.object(), m_current.offset()));
-    }
-
-    if (m_currentCharacterIsSpace && !previousCharacterIsSpace) {
-      m_startOfIgnoredSpaces.setObject(m_current.object());
-      m_startOfIgnoredSpaces.setOffset(m_current.offset());
-    }
-
-    if (!m_currentCharacterIsSpace && previousCharacterShouldCollapseIfPreWap) {
-      if (m_autoWrap && m_currentStyle->breakOnlyAfterWhiteSpace() &&
-          !ellipsizeMode) {
-        m_lineBreak.moveTo(m_current.object(), m_current.offset(),
-                           m_current.nextBreakablePosition());
-      }
-    }
-
-    if (m_collapseWhiteSpace && m_currentCharacterIsSpace && !m_ignoringSpaces)
-      m_trailingObjects.setTrailingWhitespace(toRenderText(m_current.object()));
-    else if (!m_currentStyle->collapseWhiteSpace() ||
-             !m_currentCharacterIsSpace)
-      m_trailingObjects.clear();
-
-    m_atStart = false;
-    nextCharacter(c, lastCharacter, secondToLastCharacter);
-  }
-
-  m_renderTextInfo.m_lineBreakIterator.setPriorContext(lastCharacter,
-                                                       secondToLastCharacter);
-
-  wordMeasurements.grow(wordMeasurements.size() + 1);
-  WordMeasurement& wordMeasurement = wordMeasurements.last();
-  wordMeasurement.renderer = renderText;
-
-  // IMPORTANT: current.m_pos is > length here!
-  float additionalTempWidth =
-      m_ignoringSpaces
-          ? 0
-          : textWidth(renderText, lastSpace, m_current.offset() - lastSpace,
-                      font, m_width.currentWidth(), isFixedPitch,
-                      m_collapseWhiteSpace, &wordMeasurement.fallbackFonts);
-  wordMeasurement.startOffset = lastSpace;
-  wordMeasurement.endOffset = m_current.offset();
-  wordMeasurement.width =
-      m_ignoringSpaces ? 0
-                       : additionalTempWidth + wordSpacingForWordMeasurement;
-  additionalTempWidth += lastSpaceWordSpacing;
-
-  LayoutUnit inlineLogicalTempWidth = inlineLogicalWidth(
-      m_current.object(), !m_appliedStartWidth, m_includeEndWidth);
-  m_width.addUncommittedWidth(additionalTempWidth + inlineLogicalTempWidth);
-
-  if (m_collapseWhiteSpace && m_currentCharacterIsSpace && additionalTempWidth)
-    m_width.setTrailingWhitespaceWidth(additionalTempWidth +
-                                       inlineLogicalTempWidth);
-
-  m_includeEndWidth = false;
-
-  if (!m_width.fitsOnLine()) {
-    if (!hyphenated && m_lineBreak.previousInSameNode() == softHyphen) {
-      hyphenated = true;
-      m_atEnd = true;
-    }
-  }
-  return false;
-}
-
-inline void BreakingContext::commitAndUpdateLineBreakIfNeeded() {
-  bool checkForBreak = m_autoWrap;
-  if (m_width.committedWidth() && !m_width.fitsOnLine() &&
-      m_lineBreak.object() && m_currWS == NOWRAP) {
-    checkForBreak = true;
-  } else if (m_nextObject && m_current.object()->isText() &&
-             m_nextObject->isText() &&
-             (m_autoWrap || m_nextObject->style()->autoWrap())) {
-    if (m_autoWrap && m_currentCharacterIsSpace) {
-      checkForBreak = true;
-    } else {
-      RenderText* nextText = toRenderText(m_nextObject);
-      if (nextText->textLength()) {
-        UChar c = nextText->characterAt(0);
-        // If the next item on the line is text, and if we did not end with
-        // a space, then the next text run continues our word (and so it needs
-        // to keep adding to the uncommitted width. Just update and continue.
-        checkForBreak = !m_currentCharacterIsSpace &&
-                        (c == ' ' || c == '\t' ||
-                         (c == '\n' && !m_nextObject->preservesNewline()));
-      }
-
-      if (!m_width.fitsOnLine() && !m_width.committedWidth())
-        m_width.fitBelowFloats(m_lineInfo.isFirstLine());
-
-      bool canPlaceOnLine =
-          m_width.fitsOnLine() || !m_autoWrapWasEverTrueOnLine;
-      if (canPlaceOnLine && checkForBreak) {
-        m_width.commit();
-        m_lineBreak.moveToStartOf(m_nextObject);
-      }
-    }
-  }
-
-  ASSERT_WITH_SECURITY_IMPLICATION(m_currentStyle->refCount() > 0);
-  if (checkForBreak && !m_width.fitsOnLine()) {
-    // if we have floats, try to get below them.
-    if (m_currentCharacterIsSpace && !m_ignoringSpaces &&
-        m_currentStyle->collapseWhiteSpace())
-      m_trailingObjects.clear();
-
-    if (m_width.committedWidth()) {
-      m_atEnd = true;
-      return;
-    }
-
-    m_width.fitBelowFloats(m_lineInfo.isFirstLine());
-
-    // |width| may have been adjusted because we got shoved down past a float
-    // (thus giving us more room), so we need to retest, and only jump to the
-    // end label if we still don't fit on the line. -dwh
-    if (!m_width.fitsOnLine()) {
-      m_atEnd = true;
-      return;
-    }
-  } else if (m_blockStyle->autoWrap() && !m_width.fitsOnLine() &&
-             !m_width.committedWidth()) {
-    // If the container autowraps but the current child does not then we still
-    // need to ensure that it wraps and moves below any floats.
-    m_width.fitBelowFloats(m_lineInfo.isFirstLine());
-  }
-
-  if (!m_current.object()->isFloatingOrOutOfFlowPositioned()) {
-    m_lastObject = m_current.object();
-    if (m_lastObject->isReplaced() && m_autoWrap) {
-      m_width.commit();
-      m_lineBreak.moveToStartOf(m_nextObject);
-    }
-  }
-}
-
-inline IndentTextOrNot requiresIndent(bool isFirstLine,
-                                      bool isAfterHardLineBreak,
-                                      RenderStyle* style) {
-  IndentTextOrNot shouldIndentText = DoNotIndentText;
-  if (isFirstLine ||
-      (isAfterHardLineBreak && style->textIndentLine()) == TextIndentEachLine)
-    shouldIndentText = IndentText;
-
-  if (style->textIndentType() == TextIndentHanging)
-    shouldIndentText =
-        shouldIndentText == IndentText ? DoNotIndentText : IndentText;
-
-  return shouldIndentText;
-}
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_LINE_BREAKINGCONTEXTINLINEHEADERS_H_
diff --git a/sky/engine/core/rendering/line/LineBreaker.cpp b/sky/engine/core/rendering/line/LineBreaker.cpp
deleted file mode 100644
index 3e16bb9c1610e..0000000000000
--- a/sky/engine/core/rendering/line/LineBreaker.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
- * right reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "flutter/sky/engine/core/rendering/line/LineBreaker.h"
-
-#include "flutter/sky/engine/core/rendering/line/BreakingContextInlineHeaders.h"
-
-namespace blink {
-
-void LineBreaker::skipLeadingWhitespace(
-    InlineBidiResolver& resolver,
-    LineInfo& lineInfo,
-    FloatingObject* lastFloatFromPreviousLine,
-    LineWidth& width) {
-  while (!resolver.position().atEnd() &&
-         !requiresLineBox(resolver.position(), lineInfo, LeadingWhitespace)) {
-    RenderObject* object = resolver.position().object();
-    if (object->isOutOfFlowPositioned() &&
-        object->style()->isOriginalDisplayInlineType()) {
-      resolver.runs().addRun(createRun(0, 1, object, resolver));
-      lineInfo.incrementRunsFromLeadingWhitespace();
-    }
-    resolver.position().increment(&resolver);
-  }
-  resolver.commitExplicitEmbedding(resolver.runs());
-}
-
-void LineBreaker::reset() {
-  m_positionedObjects.clear();
-  m_hyphenated = false;
-  m_ellipsized = false;
-}
-
-InlineIterator LineBreaker::nextLineBreak(
-    InlineBidiResolver& resolver,
-    LineInfo& lineInfo,
-    RenderTextInfo& renderTextInfo,
-    FloatingObject* lastFloatFromPreviousLine,
-    WordMeasurements& wordMeasurements) {
-  reset();
-
-  ASSERT(resolver.position().root() == m_block);
-
-  bool appliedStartWidth = resolver.position().offset() > 0;
-
-  LineWidth width(
-      *m_block, lineInfo.isFirstLine(),
-      requiresIndent(lineInfo.isFirstLine(),
-                     lineInfo.previousLineBrokeCleanly(), m_block->style()));
-
-  skipLeadingWhitespace(resolver, lineInfo, lastFloatFromPreviousLine, width);
-
-  if (resolver.position().atEnd())
-    return resolver.position();
-
-  BreakingContext context(resolver, lineInfo, width, renderTextInfo,
-                          lastFloatFromPreviousLine, appliedStartWidth,
-                          m_block);
-
-  while (context.currentObject()) {
-    context.initializeForCurrentObject();
-    if (context.currentObject()->isOutOfFlowPositioned()) {
-      context.handleOutOfFlowPositioned(m_positionedObjects);
-    } else if (context.currentObject()->isRenderInline()) {
-      context.handleEmptyInline();
-    } else if (context.currentObject()->isReplaced()) {
-      context.handleReplaced();
-    } else if (context.currentObject()->isText()) {
-      if (context.handleText(wordMeasurements, m_hyphenated, m_ellipsized)) {
-        // We've hit a hard text line break. Our line break iterator is updated,
-        // so go ahead and early return.
-        return context.lineBreak();
-      }
-    } else {
-      ASSERT_NOT_REACHED();
-    }
-
-    if (context.atEnd())
-      return context.handleEndOfLine();
-
-    context.commitAndUpdateLineBreakIfNeeded();
-
-    if (context.atEnd())
-      return context.handleEndOfLine();
-
-    context.increment();
-  }
-
-  context.clearLineBreakIfFitsOnLine();
-
-  return context.handleEndOfLine();
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/line/LineBreaker.h b/sky/engine/core/rendering/line/LineBreaker.h
deleted file mode 100644
index 8f61f2f387a3c..0000000000000
--- a/sky/engine/core/rendering/line/LineBreaker.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
- * right reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_LINE_LINEBREAKER_H_
-#define SKY_ENGINE_CORE_RENDERING_LINE_LINEBREAKER_H_
-
-#include "flutter/sky/engine/core/rendering/InlineIterator.h"
-#include "flutter/sky/engine/core/rendering/line/LineInfo.h"
-#include "flutter/sky/engine/wtf/Vector.h"
-
-namespace blink {
-
-enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace };
-
-struct RenderTextInfo;
-
-class LineBreaker {
- public:
-  friend class BreakingContext;
-  LineBreaker(RenderParagraph* block) : m_block(block) { reset(); }
-
-  InlineIterator nextLineBreak(InlineBidiResolver&,
-                               LineInfo&,
-                               RenderTextInfo&,
-                               FloatingObject* lastFloatFromPreviousLine,
-                               WordMeasurements&);
-
-  bool lineWasHyphenated() { return m_hyphenated; }
-  bool lineWasEllipsized() { return m_ellipsized; }
-  const Vector& positionedObjects() { return m_positionedObjects; }
-
- private:
-  void reset();
-
-  void skipLeadingWhitespace(InlineBidiResolver&,
-                             LineInfo&,
-                             FloatingObject* lastFloatFromPreviousLine,
-                             LineWidth&);
-
-  RenderParagraph* m_block;
-  bool m_hyphenated;
-  bool m_ellipsized;
-  Vector m_positionedObjects;
-};
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_LINE_LINEBREAKER_H_
diff --git a/sky/engine/core/rendering/line/LineInfo.h b/sky/engine/core/rendering/line/LineInfo.h
deleted file mode 100644
index 64b3410d33acc..0000000000000
--- a/sky/engine/core/rendering/line/LineInfo.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
- * right reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2013 Adobe Systems Incorporated.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_LINE_LINEINFO_H_
-#define SKY_ENGINE_CORE_RENDERING_LINE_LINEINFO_H_
-
-#include "flutter/sky/engine/core/rendering/line/LineWidth.h"
-
-namespace blink {
-
-class LineInfo {
- public:
-  LineInfo()
-      : m_isFirstLine(true),
-        m_isLastLine(false),
-        m_isEmpty(true),
-        m_previousLineBrokeCleanly(true),
-        m_runsFromLeadingWhitespace(0),
-        m_lineIndex(0) {}
-
-  bool isFirstLine() const { return m_isFirstLine; }
-  bool isLastLine() const { return m_isLastLine; }
-  bool isEmpty() const { return m_isEmpty; }
-  bool previousLineBrokeCleanly() const { return m_previousLineBrokeCleanly; }
-  unsigned runsFromLeadingWhitespace() const {
-    return m_runsFromLeadingWhitespace;
-  }
-  void resetRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace = 0; }
-  void incrementRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace++; }
-
-  void setFirstLine(bool firstLine) { m_isFirstLine = firstLine; }
-  void setLastLine(bool lastLine) { m_isLastLine = lastLine; }
-  void setEmpty(bool empty, RenderBlock* block = 0, LineWidth* lineWidth = 0) {
-    m_isEmpty = empty;
-  }
-
-  void incrementLineIndex() { ++m_lineIndex; }
-  int lineIndex() const { return m_lineIndex; }
-
-  void setPreviousLineBrokeCleanly(bool previousLineBrokeCleanly) {
-    m_previousLineBrokeCleanly = previousLineBrokeCleanly;
-  }
-
- private:
-  bool m_isFirstLine;
-  bool m_isLastLine;
-  bool m_isEmpty;
-  bool m_previousLineBrokeCleanly;
-  unsigned m_runsFromLeadingWhitespace;
-  int m_lineIndex;
-};
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_LINE_LINEINFO_H_
diff --git a/sky/engine/core/rendering/line/LineLayoutState.h b/sky/engine/core/rendering/line/LineLayoutState.h
deleted file mode 100644
index b454e54ffa7a0..0000000000000
--- a/sky/engine/core/rendering/line/LineLayoutState.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
- * right reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_LINE_LINELAYOUTSTATE_H_
-#define SKY_ENGINE_CORE_RENDERING_LINE_LINELAYOUTSTATE_H_
-
-#include "flutter/sky/engine/core/rendering/RenderParagraph.h"
-#include "flutter/sky/engine/platform/geometry/LayoutRect.h"
-
-namespace blink {
-
-// LineLayoutState keeps track of global information
-// during an entire linebox tree layout pass (aka
-// RenderParagraph::layoutChildren).
-class LineLayoutState {
- public:
-  LineLayoutState(bool fullLayout)
-      : m_endLine(0),
-        m_endLineLogicalTop(0),
-        m_endLineMatched(false),
-        m_hasInlineChild(false),
-        m_isFullLayout(fullLayout),
-        m_adjustedLogicalLineTop(0) {}
-
-  void markForFullLayout() { m_isFullLayout = true; }
-  bool isFullLayout() const { return m_isFullLayout; }
-
-  bool endLineMatched() const { return m_endLineMatched; }
-  void setEndLineMatched(bool endLineMatched) {
-    m_endLineMatched = endLineMatched;
-  }
-
-  bool hasInlineChild() const { return m_hasInlineChild; }
-  void setHasInlineChild(bool hasInlineChild) {
-    m_hasInlineChild = hasInlineChild;
-  }
-
-  LineInfo& lineInfo() { return m_lineInfo; }
-  const LineInfo& lineInfo() const { return m_lineInfo; }
-
-  LayoutUnit endLineLogicalTop() const { return m_endLineLogicalTop; }
-  void setEndLineLogicalTop(LayoutUnit logicalTop) {
-    m_endLineLogicalTop = logicalTop;
-  }
-
-  RootInlineBox* endLine() const { return m_endLine; }
-  void setEndLine(RootInlineBox* line) { m_endLine = line; }
-
-  LayoutUnit adjustedLogicalLineTop() const { return m_adjustedLogicalLineTop; }
-  void setAdjustedLogicalLineTop(LayoutUnit value) {
-    m_adjustedLogicalLineTop = value;
-  }
-
- private:
-  RootInlineBox* m_endLine;
-  LineInfo m_lineInfo;
-  LayoutUnit m_endLineLogicalTop;
-  bool m_endLineMatched;
-  // FIXME(sky): Do we still need this?
-  // Used as a performance optimization to avoid doing a full paint invalidation
-  // when our floats change but we don't have any inline children.
-  bool m_hasInlineChild;
-
-  bool m_isFullLayout;
-
-  LayoutUnit m_adjustedLogicalLineTop;
-};
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_LINE_LINELAYOUTSTATE_H_
diff --git a/sky/engine/core/rendering/line/LineWidth.cpp b/sky/engine/core/rendering/line/LineWidth.cpp
deleted file mode 100644
index 64f9e0f7be5e3..0000000000000
--- a/sky/engine/core/rendering/line/LineWidth.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer in the documentation and/or other materials
- *    provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "flutter/sky/engine/core/rendering/line/LineWidth.h"
-
-#include "flutter/sky/engine/core/rendering/RenderBlock.h"
-#include "flutter/sky/engine/core/rendering/RenderParagraph.h"
-
-namespace blink {
-
-LineWidth::LineWidth(RenderParagraph& block,
-                     bool isFirstLine,
-                     IndentTextOrNot shouldIndentText)
-    : m_block(block),
-      m_uncommittedWidth(0),
-      m_committedWidth(0),
-      m_trailingWhitespaceWidth(0),
-      m_left(0),
-      m_right(0),
-      m_availableWidth(0),
-      m_shouldIndentText(shouldIndentText) {
-  updateAvailableWidth();
-}
-
-void LineWidth::updateAvailableWidth() {
-  m_left = m_block.logicalLeftOffsetForLine(shouldIndentText()).toFloat();
-  m_right = m_block.logicalRightOffsetForLine(shouldIndentText()).toFloat();
-  computeAvailableWidthFromLeftAndRight();
-}
-
-void LineWidth::commit() {
-  m_committedWidth += m_uncommittedWidth;
-  m_uncommittedWidth = 0;
-}
-
-void LineWidth::updateLineDimension(LayoutUnit newLineTop,
-                                    LayoutUnit newLineWidth,
-                                    const float& newLineLeft,
-                                    const float& newLineRight) {
-  if (newLineWidth <= m_availableWidth)
-    return;
-
-  m_block.setLogicalHeight(newLineTop);
-  m_availableWidth = newLineWidth.toFloat();
-  m_left = newLineLeft;
-  m_right = newLineRight;
-}
-
-void LineWidth::fitBelowFloats(bool isFirstLine) {
-  ASSERT(!m_committedWidth);
-  ASSERT(!fitsOnLine());
-
-  LayoutUnit floatLogicalBottom;
-  LayoutUnit lastFloatLogicalBottom = m_block.logicalHeight();
-  float newLineWidth = m_availableWidth;
-  float newLineLeft = m_left;
-  float newLineRight = m_right;
-
-  while (true) {
-    floatLogicalBottom = lastFloatLogicalBottom;
-    if (floatLogicalBottom <= lastFloatLogicalBottom)
-      break;
-
-    newLineLeft =
-        m_block.logicalLeftOffsetForLine(shouldIndentText()).toFloat();
-    newLineRight =
-        m_block.logicalRightOffsetForLine(shouldIndentText()).toFloat();
-    newLineWidth = std::max(0.0f, newLineRight - newLineLeft);
-
-    lastFloatLogicalBottom = floatLogicalBottom;
-
-    if (newLineWidth >= m_uncommittedWidth)
-      break;
-  }
-  updateLineDimension(lastFloatLogicalBottom, newLineWidth, newLineLeft,
-                      newLineRight);
-}
-
-void LineWidth::computeAvailableWidthFromLeftAndRight() {
-  m_availableWidth = max(0.0f, m_right - m_left);
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/line/LineWidth.h b/sky/engine/core/rendering/line/LineWidth.h
deleted file mode 100644
index 8ef514fbf3090..0000000000000
--- a/sky/engine/core/rendering/line/LineWidth.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer.
- * 2. Redistributions in binary form must reproduce the above
- *    copyright notice, this list of conditions and the following
- *    disclaimer in the documentation and/or other materials
- *    provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_LINE_LINEWIDTH_H_
-#define SKY_ENGINE_CORE_RENDERING_LINE_LINEWIDTH_H_
-
-#include "flutter/sky/engine/platform/LayoutUnit.h"
-
-namespace blink {
-
-class FloatingObject;
-class RenderObject;
-class RenderParagraph;
-
-enum IndentTextOrNot { DoNotIndentText, IndentText };
-enum WhitespaceTreatment { ExcludeWhitespace, IncludeWhitespace };
-
-class LineWidth {
- public:
-  LineWidth(RenderParagraph&,
-            bool isFirstLine,
-            IndentTextOrNot shouldIndentText);
-
-  bool fitsOnLine() const {
-    return currentWidth() <= (m_availableWidth + LayoutUnit::epsilon());
-  }
-  bool fitsOnLine(float extra) const {
-    return currentWidth() + extra <= (m_availableWidth + LayoutUnit::epsilon());
-  }
-  bool fitsOnLine(float extra, WhitespaceTreatment whitespaceTreatment) const {
-    return currentWidth() -
-               (whitespaceTreatment == ExcludeWhitespace
-                    ? trailingWhitespaceWidth()
-                    : 0) +
-               extra <=
-           (m_availableWidth + LayoutUnit::epsilon());
-  }
-
-  float currentWidth() const { return m_committedWidth + m_uncommittedWidth; }
-  // FIXME: We should eventually replace these three functions by ones that work
-  // on a higher abstraction.
-  float uncommittedWidth() const { return m_uncommittedWidth; }
-  float committedWidth() const { return m_committedWidth; }
-  float availableWidth() const { return m_availableWidth; }
-  float trailingWhitespaceWidth() const { return m_trailingWhitespaceWidth; }
-
-  void updateAvailableWidth();
-  void addUncommittedWidth(float delta) { m_uncommittedWidth += delta; }
-  void commit();
-  void fitBelowFloats(bool isFirstLine = false);
-  void setTrailingWhitespaceWidth(float width) {
-    m_trailingWhitespaceWidth = width;
-  }
-
-  bool shouldIndentText() const { return m_shouldIndentText == IndentText; }
-
- private:
-  void computeAvailableWidthFromLeftAndRight();
-  void updateLineDimension(LayoutUnit newLineTop,
-                           LayoutUnit newLineWidth,
-                           const float& newLineLeft,
-                           const float& newLineRight);
-
-  RenderParagraph& m_block;
-  float m_uncommittedWidth;
-  float m_committedWidth;
-  float m_trailingWhitespaceWidth;
-  float m_left;
-  float m_right;
-  float m_availableWidth;
-  IndentTextOrNot m_shouldIndentText;
-};
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_LINE_LINEWIDTH_H_
diff --git a/sky/engine/core/rendering/line/RenderTextInfo.h b/sky/engine/core/rendering/line/RenderTextInfo.h
deleted file mode 100644
index 672aa1fd647a8..0000000000000
--- a/sky/engine/core/rendering/line/RenderTextInfo.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
- * right reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_LINE_RENDERTEXTINFO_H_
-#define SKY_ENGINE_CORE_RENDERING_LINE_RENDERTEXTINFO_H_
-
-#include "flutter/sky/engine/platform/text/TextBreakIterator.h"
-
-namespace blink {
-
-class Font;
-class RenderText;
-
-struct RenderTextInfo {
-  RenderTextInfo() : m_text(0), m_font(0) {}
-
-  RenderText* m_text;
-  LazyLineBreakIterator m_lineBreakIterator;
-  const Font* m_font;
-};
-
-}  // namespace blink
-
-#endif  // SKY_ENGINE_CORE_RENDERING_LINE_RENDERTEXTINFO_H_
diff --git a/sky/engine/core/rendering/line/TrailingObjects.cpp b/sky/engine/core/rendering/line/TrailingObjects.cpp
deleted file mode 100644
index 1235976270e46..0000000000000
--- a/sky/engine/core/rendering/line/TrailingObjects.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
- * right reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2014 Adobe Systems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "flutter/sky/engine/core/rendering/line/TrailingObjects.h"
-
-#include "flutter/sky/engine/core/rendering/InlineIterator.h"
-
-namespace blink {
-
-void TrailingObjects::updateMidpointsForTrailingObjects(
-    LineMidpointState& lineMidpointState,
-    const InlineIterator& lBreak,
-    CollapseFirstSpaceOrNot collapseFirstSpace) {
-  if (!m_whitespace)
-    return;
-
-  // This object is either going to be part of the last midpoint, or it is going
-  // to be the actual endpoint. In both cases we just decrease our pos by 1
-  // level to exclude the space, allowing it to - in effect - collapse into the
-  // newline.
-  if (lineMidpointState.numMidpoints() % 2) {
-    // Find the trailing space object's midpoint.
-    int trailingSpaceMidpoint = lineMidpointState.numMidpoints() - 1;
-    for (; trailingSpaceMidpoint > 0 &&
-           lineMidpointState.midpoints()[trailingSpaceMidpoint].object() !=
-               m_whitespace;
-         --trailingSpaceMidpoint) {
-    }
-    ASSERT(trailingSpaceMidpoint >= 0);
-    if (collapseFirstSpace == CollapseFirstSpace)
-      lineMidpointState.midpoints()[trailingSpaceMidpoint].setOffset(
-          lineMidpointState.midpoints()[trailingSpaceMidpoint].offset() - 1);
-
-    // Now make sure every single trailingPositionedBox following the
-    // trailingSpaceMidpoint properly stops and starts ignoring spaces.
-    size_t currentMidpoint = trailingSpaceMidpoint + 1;
-    for (size_t i = 0; i < m_objects.size(); ++i) {
-      if (currentMidpoint >= lineMidpointState.numMidpoints()) {
-        // We don't have a midpoint for this box yet.
-        lineMidpointState.ensureLineBoxInsideIgnoredSpaces(m_objects[i]);
-      } else {
-        ASSERT(lineMidpointState.midpoints()[currentMidpoint].object() ==
-               m_objects[i]);
-        ASSERT(lineMidpointState.midpoints()[currentMidpoint + 1].object() ==
-               m_objects[i]);
-      }
-      currentMidpoint += 2;
-    }
-  } else if (!lBreak.object()) {
-    ASSERT(collapseFirstSpace == CollapseFirstSpace);
-    // Add a new end midpoint that stops right at the very end.
-    unsigned length = m_whitespace->textLength();
-    unsigned pos = length >= 2 ? length - 2 : UINT_MAX;
-    InlineIterator endMid(0, m_whitespace, pos);
-    lineMidpointState.startIgnoringSpaces(endMid);
-    for (size_t i = 0; i < m_objects.size(); ++i) {
-      lineMidpointState.ensureLineBoxInsideIgnoredSpaces(m_objects[i]);
-    }
-  }
-}
-
-}  // namespace blink
diff --git a/sky/engine/core/rendering/line/TrailingObjects.h b/sky/engine/core/rendering/line/TrailingObjects.h
deleted file mode 100644
index 19910495d8ece..0000000000000
--- a/sky/engine/core/rendering/line/TrailingObjects.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
- * right reserved.
- * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2014 Adobe Systems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef SKY_ENGINE_CORE_RENDERING_LINE_TRAILINGOBJECTS_H_
-#define SKY_ENGINE_CORE_RENDERING_LINE_TRAILINGOBJECTS_H_
-
-#include "flutter/sky/engine/wtf/Vector.h"
-
-namespace blink {
-
-class InlineIterator;
-class RenderObject;
-class RenderText;
-
-struct BidiRun;
-
-template 
-class BidiResolver;
-template 
-class MidpointState;
-typedef BidiResolver InlineBidiResolver;
-typedef MidpointState LineMidpointState;
-
-// This class allows us to ensure lineboxes are created in the right place on
-// the line when an out-of-flow positioned object or an empty inline is
-// encountered between a trailing space and subsequent spaces and we want to
-// ignore (i.e. collapse) surplus whitespace. So for example:
-//   
X Y
-// or -//
X
Y
-// In both of the above snippets the inline and the positioned object occur -// after a trailing space and before a space that will cause our line breaking -// algorithm to start ignoring spaces. When it does that we want to ensure that -// the inline/positioned object gets a linebox and that it is part of the -// collapsed whitespace. So to achieve this we use appendObjectIfNeeded() to -// keep track of objects encountered after a trailing whitespace and -// updateMidpointsForTrailingObjects() to put them in the right place when we -// start ignoring surplus whitespace. - -class TrailingObjects { - public: - TrailingObjects() : m_whitespace(0) {} - - void setTrailingWhitespace(RenderText* whitespace) { - ASSERT(whitespace); - m_whitespace = whitespace; - } - - void clear() { - m_whitespace = 0; - // Using resize(0) rather than clear() here saves 2% on - // PerformanceTests/Layout/line-layout.html because we avoid freeing and - // re-allocating the underlying buffer repeatedly. - m_objects.resize(0); - } - - void appendObjectIfNeeded(RenderObject* object) { - if (m_whitespace) - m_objects.append(object); - } - - enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace }; - - void updateMidpointsForTrailingObjects(LineMidpointState&, - const InlineIterator& lBreak, - CollapseFirstSpaceOrNot); - - private: - RenderText* m_whitespace; - Vector m_objects; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_LINE_TRAILINGOBJECTS_H_ diff --git a/sky/engine/core/rendering/line/WordMeasurement.h b/sky/engine/core/rendering/line/WordMeasurement.h deleted file mode 100644 index 35821be188a0e..0000000000000 --- a/sky/engine/core/rendering/line/WordMeasurement.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All - * right reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * Copyright (C) 2013 Adobe Systems Incorporated. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_LINE_WORDMEASUREMENT_H_ -#define SKY_ENGINE_CORE_RENDERING_LINE_WORDMEASUREMENT_H_ - -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/wtf/HashSet.h" - -namespace blink { - -class RenderText; - -class WordMeasurement { - public: - WordMeasurement() : renderer(0), width(0), startOffset(0), endOffset(0) {} - - RenderText* renderer; - float width; - int startOffset; - int endOffset; - HashSet fallbackFonts; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_LINE_WORDMEASUREMENT_H_ diff --git a/sky/engine/core/rendering/style/AppliedTextDecoration.cpp b/sky/engine/core/rendering/style/AppliedTextDecoration.cpp deleted file mode 100644 index eea0c16965ea2..0000000000000 --- a/sky/engine/core/rendering/style/AppliedTextDecoration.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/core/rendering/style/AppliedTextDecoration.h" - -namespace blink { - -AppliedTextDecoration::AppliedTextDecoration(TextDecoration line, - TextDecorationStyle style, - StyleColor color) - : m_line(line), m_style(style), m_color(color) {} - -AppliedTextDecoration::AppliedTextDecoration(TextDecoration line) - : m_line(line), - m_style(TextDecorationStyleSolid), - m_color(StyleColor::currentColor()) {} - -AppliedTextDecoration::AppliedTextDecoration() - : m_line(TextDecorationUnderline), - m_style(TextDecorationStyleSolid), - m_color(StyleColor::currentColor()) {} - -bool AppliedTextDecoration::operator==(const AppliedTextDecoration& o) const { - return m_color == o.m_color && m_line == o.m_line && m_style == o.m_style; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/AppliedTextDecoration.h b/sky/engine/core/rendering/style/AppliedTextDecoration.h deleted file mode 100644 index 3db2cb1b8a583..0000000000000 --- a/sky/engine/core/rendering/style/AppliedTextDecoration.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_APPLIEDTEXTDECORATION_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_APPLIEDTEXTDECORATION_H_ - -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" -#include "flutter/sky/engine/core/rendering/style/StyleColor.h" - -namespace blink { - -class AppliedTextDecoration { - public: - AppliedTextDecoration(TextDecoration, TextDecorationStyle, StyleColor); - explicit AppliedTextDecoration(TextDecoration); - AppliedTextDecoration(); - - TextDecoration line() const { return static_cast(m_line); } - TextDecorationStyle style() const { - return static_cast(m_style); - } - - bool isSimpleUnderline() const { - return m_line == TextDecorationUnderline && - m_style == TextDecorationStyleSolid && m_color.isCurrentColor(); - } - bool operator==(const AppliedTextDecoration&) const; - bool operator!=(const AppliedTextDecoration& o) const { - return !(*this == o); - } - - private: - unsigned m_line : TextDecorationBits; - unsigned m_style : 3; // TextDecorationStyle - StyleColor m_color; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_APPLIEDTEXTDECORATION_H_ diff --git a/sky/engine/core/rendering/style/BorderData.h b/sky/engine/core/rendering/style/BorderData.h deleted file mode 100644 index 30efea937c067..0000000000000 --- a/sky/engine/core/rendering/style/BorderData.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_BORDERDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_BORDERDATA_H_ - -#include "flutter/sky/engine/core/rendering/style/BorderValue.h" -#include "flutter/sky/engine/platform/LengthSize.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" - -namespace blink { - -class BorderData { - friend class RenderStyle; - - public: - BorderData() - : m_topLeft(Length(0, Fixed), Length(0, Fixed)), - m_topRight(Length(0, Fixed), Length(0, Fixed)), - m_bottomLeft(Length(0, Fixed), Length(0, Fixed)), - m_bottomRight(Length(0, Fixed), Length(0, Fixed)) {} - bool hasBorder() const { - return m_left.nonZero() || m_right.nonZero() || m_top.nonZero() || - m_bottom.nonZero(); - } - - bool hasBorderRadius() const { - if (!m_topLeft.width().isZero()) - return true; - if (!m_topRight.width().isZero()) - return true; - if (!m_bottomLeft.width().isZero()) - return true; - if (!m_bottomRight.width().isZero()) - return true; - return false; - } - - unsigned borderLeftWidth() const { - if ((m_left.style() == BNONE || m_left.style() == BHIDDEN)) - return 0; - return m_left.width(); - } - - unsigned borderRightWidth() const { - if ((m_right.style() == BNONE || m_right.style() == BHIDDEN)) - return 0; - return m_right.width(); - } - - unsigned borderTopWidth() const { - if ((m_top.style() == BNONE || m_top.style() == BHIDDEN)) - return 0; - return m_top.width(); - } - - unsigned borderBottomWidth() const { - if ((m_bottom.style() == BNONE || m_bottom.style() == BHIDDEN)) - return 0; - return m_bottom.width(); - } - - bool operator==(const BorderData& o) const { - return m_left == o.m_left && m_right == o.m_right && m_top == o.m_top && - m_bottom == o.m_bottom && m_topLeft == o.m_topLeft && - m_topRight == o.m_topRight && m_bottomLeft == o.m_bottomLeft && - m_bottomRight == o.m_bottomRight; - } - - bool visuallyEqual(const BorderData& o) const { - return m_left.visuallyEqual(o.m_left) && m_right.visuallyEqual(o.m_right) && - m_top.visuallyEqual(o.m_top) && m_bottom.visuallyEqual(o.m_bottom) && - m_topLeft == o.m_topLeft && m_topRight == o.m_topRight && - m_bottomLeft == o.m_bottomLeft && m_bottomRight == o.m_bottomRight; - } - - bool operator!=(const BorderData& o) const { return !(*this == o); } - - const BorderValue& left() const { return m_left; } - const BorderValue& right() const { return m_right; } - const BorderValue& top() const { return m_top; } - const BorderValue& bottom() const { return m_bottom; } - - const LengthSize& topLeft() const { return m_topLeft; } - const LengthSize& topRight() const { return m_topRight; } - const LengthSize& bottomLeft() const { return m_bottomLeft; } - const LengthSize& bottomRight() const { return m_bottomRight; } - - private: - BorderValue m_left; - BorderValue m_right; - BorderValue m_top; - BorderValue m_bottom; - - LengthSize m_topLeft; - LengthSize m_topRight; - LengthSize m_bottomLeft; - LengthSize m_bottomRight; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_BORDERDATA_H_ diff --git a/sky/engine/core/rendering/style/BorderValue.h b/sky/engine/core/rendering/style/BorderValue.h deleted file mode 100644 index 4325b2c0a203c..0000000000000 --- a/sky/engine/core/rendering/style/BorderValue.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_BORDERVALUE_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_BORDERVALUE_H_ - -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" -#include "flutter/sky/engine/core/rendering/style/StyleColor.h" -#include "flutter/sky/engine/platform/graphics/Color.h" - -namespace blink { - -class BorderValue { - friend class RenderStyle; - - public: - BorderValue() - : m_color(0), - m_colorIsCurrentColor(true), - m_width(3), - m_style(BNONE), - m_isAuto(AUTO_OFF) {} - - bool nonZero(bool checkStyle = true) const { - return width() && (!checkStyle || m_style != BNONE); - } - - bool isTransparent() const { - return !m_colorIsCurrentColor && !m_color.alpha(); - } - - bool isVisible(bool checkStyle = true) const { - return nonZero(checkStyle) && !isTransparent() && - (!checkStyle || m_style != BHIDDEN); - } - - bool operator==(const BorderValue& o) const { - return m_width == o.m_width && m_style == o.m_style && - m_color == o.m_color && - m_colorIsCurrentColor == o.m_colorIsCurrentColor; - } - - // The default width is 3px, but if the style is none we compute a value of 0 - // (in RenderStyle itself) - bool visuallyEqual(const BorderValue& o) const { - if (m_style == BNONE && o.m_style == BNONE) - return true; - if (m_style == BHIDDEN && o.m_style == BHIDDEN) - return true; - return *this == o; - } - - bool operator!=(const BorderValue& o) const { return !(*this == o); } - - void setColor(const StyleColor& color) { - m_color = color.resolve(Color()); - m_colorIsCurrentColor = color.isCurrentColor(); - } - - StyleColor color() const { - return m_colorIsCurrentColor ? StyleColor::currentColor() - : StyleColor(m_color); - } - - unsigned width() const { return m_width; } - - EBorderStyle style() const { return static_cast(m_style); } - void setStyle(EBorderStyle style) { m_style = style; } - - protected: - Color m_color; - unsigned m_colorIsCurrentColor : 1; - - unsigned m_width : 26; - unsigned m_style : 4; // EBorderStyle - - // This is only used by OutlineValue but moved here to keep the bits packed. - unsigned m_isAuto : 1; // OutlineIsAuto -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_BORDERVALUE_H_ diff --git a/sky/engine/core/rendering/style/CollapsedBorderValue.h b/sky/engine/core/rendering/style/CollapsedBorderValue.h deleted file mode 100644 index 2b6f1c0f3333b..0000000000000 --- a/sky/engine/core/rendering/style/CollapsedBorderValue.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_COLLAPSEDBORDERVALUE_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_COLLAPSEDBORDERVALUE_H_ - -#include "flutter/sky/engine/core/rendering/style/BorderValue.h" - -namespace blink { - -class CollapsedBorderValue { - public: - CollapsedBorderValue() - : m_color(0), - m_colorIsCurrentColor(true), - m_width(0), - m_style(BNONE), - m_precedence(BOFF), - m_transparent(false) {} - - CollapsedBorderValue(const BorderValue& border, - const StyleColor& color, - EBorderPrecedence precedence) - : m_color(color.resolve(Color())), - m_colorIsCurrentColor(color.isCurrentColor()), - m_width(border.nonZero() ? border.width() : 0), - m_style(border.style()), - m_precedence(precedence), - m_transparent(border.isTransparent()) {} - - unsigned width() const { return m_style > BHIDDEN ? m_width : 0; } - EBorderStyle style() const { return static_cast(m_style); } - bool exists() const { return m_precedence != BOFF; } - StyleColor color() const { - return m_colorIsCurrentColor ? StyleColor::currentColor() - : StyleColor(m_color); - } - bool isTransparent() const { return m_transparent; } - EBorderPrecedence precedence() const { - return static_cast(m_precedence); - } - - bool isSameIgnoringColor(const CollapsedBorderValue& o) const { - return width() == o.width() && style() == o.style() && - precedence() == o.precedence(); - } - - private: - Color m_color; - unsigned m_colorIsCurrentColor : 1; - unsigned m_width : 23; - unsigned m_style : 4; // EBorderStyle - unsigned m_precedence : 3; // EBorderPrecedence - unsigned m_transparent : 1; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_COLLAPSEDBORDERVALUE_H_ diff --git a/sky/engine/core/rendering/style/CounterDirectives.cpp b/sky/engine/core/rendering/style/CounterDirectives.cpp deleted file mode 100644 index fb6de7e5d1821..0000000000000 --- a/sky/engine/core/rendering/style/CounterDirectives.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/CounterDirectives.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -namespace blink { - -bool operator==(const CounterDirectives& a, const CounterDirectives& b) { - return a.isIncrement() == b.isIncrement() && - a.incrementValue() == b.incrementValue() && - a.isReset() == b.isReset() && a.resetValue() == b.resetValue(); -} - -PassOwnPtr clone( - const CounterDirectiveMap& counterDirectives) { - OwnPtr result = adoptPtr(new CounterDirectiveMap); - *result = counterDirectives; - return result.release(); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/CounterDirectives.h b/sky/engine/core/rendering/style/CounterDirectives.h deleted file mode 100644 index db76a29feffcc..0000000000000 --- a/sky/engine/core/rendering/style/CounterDirectives.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_COUNTERDIRECTIVES_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_COUNTERDIRECTIVES_H_ - -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/AtomicStringHash.h" - -namespace blink { - -class CounterDirectives { - public: - CounterDirectives() - : m_isResetSet(false), - m_isIncrementSet(false), - m_resetValue(0), - m_incrementValue(0) {} - - // FIXME: The code duplication here could possibly be replaced by using two - // maps, or by using a container that held two generic Directive objects. - - bool isReset() const { return m_isResetSet; } - int resetValue() const { return m_resetValue; } - void setResetValue(int value) { - m_resetValue = value; - m_isResetSet = true; - } - void clearReset() { - m_resetValue = 0; - m_isResetSet = false; - } - void inheritReset(CounterDirectives& parent) { - m_resetValue = parent.m_resetValue; - m_isResetSet = parent.m_isResetSet; - } - - bool isIncrement() const { return m_isIncrementSet; } - int incrementValue() const { return m_incrementValue; } - void addIncrementValue(int value) { - m_incrementValue = clampToInteger((double)m_incrementValue + value); - m_isIncrementSet = true; - } - void clearIncrement() { - m_incrementValue = 0; - m_isIncrementSet = false; - } - void inheritIncrement(CounterDirectives& parent) { - m_incrementValue = parent.m_incrementValue; - m_isIncrementSet = parent.m_isIncrementSet; - } - - bool isDefined() const { return isReset() || isIncrement(); } - - int combinedValue() const { - ASSERT(m_isResetSet || !m_resetValue); - ASSERT(m_isIncrementSet || !m_incrementValue); - // FIXME: Shouldn't allow overflow here. - return m_resetValue + m_incrementValue; - } - - private: - bool m_isResetSet; - bool m_isIncrementSet; - int m_resetValue; - int m_incrementValue; -}; - -bool operator==(const CounterDirectives&, const CounterDirectives&); -inline bool operator!=(const CounterDirectives& a, const CounterDirectives& b) { - return !(a == b); -} - -typedef HashMap CounterDirectiveMap; - -PassOwnPtr clone(const CounterDirectiveMap&); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_COUNTERDIRECTIVES_H_ diff --git a/sky/engine/core/rendering/style/DataEquivalency.h b/sky/engine/core/rendering/style/DataEquivalency.h deleted file mode 100644 index 5c9bcbcb1ee78..0000000000000 --- a/sky/engine/core/rendering/style/DataEquivalency.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_DATAEQUIVALENCY_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_DATAEQUIVALENCY_H_ - -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -template -bool dataEquivalent(const T* a, const T* b) { - if (a == b) - return true; - if (!a || !b) - return false; - return *a == *b; -} - -template -bool dataEquivalent(const RefPtr& a, const RefPtr& b) { - return dataEquivalent(a.get(), b.get()); -} - -template -bool dataEquivalent(const OwnPtr& a, const OwnPtr& b) { - return dataEquivalent(a.get(), b.get()); -} - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_DATAEQUIVALENCY_H_ diff --git a/sky/engine/core/rendering/style/DataRef.h b/sky/engine/core/rendering/style/DataRef.h deleted file mode 100644 index 9b30a58f8c8c2..0000000000000 --- a/sky/engine/core/rendering/style/DataRef.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_DATAREF_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_DATAREF_H_ - -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -template -class DataRef { - public: - const T* get() const { return m_data.get(); } - - const T& operator*() const { return *get(); } - const T* operator->() const { return get(); } - - T* access() { - if (!m_data->hasOneRef()) - m_data = m_data->copy(); - return m_data.get(); - } - - void init() { - ASSERT(!m_data); - m_data = T::create(); - } - - bool operator==(const DataRef& o) const { - ASSERT(m_data); - ASSERT(o.m_data); - return m_data == o.m_data || *m_data == *o.m_data; - } - - bool operator!=(const DataRef& o) const { - ASSERT(m_data); - ASSERT(o.m_data); - return m_data != o.m_data && *m_data != *o.m_data; - } - - private: - RefPtr m_data; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_DATAREF_H_ diff --git a/sky/engine/core/rendering/style/FillLayer.cpp b/sky/engine/core/rendering/style/FillLayer.cpp deleted file mode 100644 index f2dc2a96d5710..0000000000000 --- a/sky/engine/core/rendering/style/FillLayer.cpp +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/FillLayer.h" - -#include "flutter/sky/engine/core/rendering/style/DataEquivalency.h" - -namespace blink { - -struct SameSizeAsFillLayer { - FillLayer* m_next; - - RefPtr m_image; - - Length m_xPosition; - Length m_yPosition; - - LengthSize m_sizeLength; - - unsigned m_bitfields1; - unsigned m_bitfields2; -}; - -COMPILE_ASSERT(sizeof(FillLayer) == sizeof(SameSizeAsFillLayer), - FillLayer_should_stay_small); - -FillLayer::FillLayer(EFillLayerType type, bool useInitialValues) - : m_next(0), - m_image(FillLayer::initialFillImage(type)), - m_xPosition(FillLayer::initialFillXPosition(type)), - m_yPosition(FillLayer::initialFillYPosition(type)), - m_sizeLength(FillLayer::initialFillSizeLength(type)), - m_attachment(FillLayer::initialFillAttachment(type)), - m_clip(FillLayer::initialFillClip(type)), - m_origin(FillLayer::initialFillOrigin(type)), - m_repeatX(FillLayer::initialFillRepeatX(type)), - m_repeatY(FillLayer::initialFillRepeatY(type)), - m_composite(FillLayer::initialFillComposite(type)), - m_sizeType(useInitialValues ? FillLayer::initialFillSizeType(type) - : SizeNone), - m_blendMode(FillLayer::initialFillBlendMode(type)), - m_backgroundXOrigin(LeftEdge), - m_backgroundYOrigin(TopEdge), - m_imageSet(useInitialValues), - m_attachmentSet(useInitialValues), - m_clipSet(useInitialValues), - m_originSet(useInitialValues), - m_repeatXSet(useInitialValues), - m_repeatYSet(useInitialValues), - m_xPosSet(useInitialValues), - m_yPosSet(useInitialValues), - m_backgroundXOriginSet(false), - m_backgroundYOriginSet(false), - m_compositeSet(useInitialValues), - m_blendModeSet(useInitialValues), - m_type(type) {} - -FillLayer::FillLayer(const FillLayer& o) - : m_next(o.m_next ? new FillLayer(*o.m_next) : 0), - m_image(o.m_image), - m_xPosition(o.m_xPosition), - m_yPosition(o.m_yPosition), - m_sizeLength(o.m_sizeLength), - m_attachment(o.m_attachment), - m_clip(o.m_clip), - m_origin(o.m_origin), - m_repeatX(o.m_repeatX), - m_repeatY(o.m_repeatY), - m_composite(o.m_composite), - m_sizeType(o.m_sizeType), - m_blendMode(o.m_blendMode), - m_backgroundXOrigin(o.m_backgroundXOrigin), - m_backgroundYOrigin(o.m_backgroundYOrigin), - m_imageSet(o.m_imageSet), - m_attachmentSet(o.m_attachmentSet), - m_clipSet(o.m_clipSet), - m_originSet(o.m_originSet), - m_repeatXSet(o.m_repeatXSet), - m_repeatYSet(o.m_repeatYSet), - m_xPosSet(o.m_xPosSet), - m_yPosSet(o.m_yPosSet), - m_backgroundXOriginSet(o.m_backgroundXOriginSet), - m_backgroundYOriginSet(o.m_backgroundYOriginSet), - m_compositeSet(o.m_compositeSet), - m_blendModeSet(o.m_blendModeSet), - m_type(o.m_type) {} - -FillLayer::~FillLayer() { - delete m_next; -} - -FillLayer& FillLayer::operator=(const FillLayer& o) { - if (m_next != o.m_next) { - delete m_next; - m_next = o.m_next ? new FillLayer(*o.m_next) : 0; - } - - m_image = o.m_image; - m_xPosition = o.m_xPosition; - m_yPosition = o.m_yPosition; - m_backgroundXOrigin = o.m_backgroundXOrigin; - m_backgroundYOrigin = o.m_backgroundYOrigin; - m_backgroundXOriginSet = o.m_backgroundXOriginSet; - m_backgroundYOriginSet = o.m_backgroundYOriginSet; - m_sizeLength = o.m_sizeLength; - m_attachment = o.m_attachment; - m_clip = o.m_clip; - m_composite = o.m_composite; - m_blendMode = o.m_blendMode; - m_origin = o.m_origin; - m_repeatX = o.m_repeatX; - m_repeatY = o.m_repeatY; - m_sizeType = o.m_sizeType; - - m_imageSet = o.m_imageSet; - m_attachmentSet = o.m_attachmentSet; - m_clipSet = o.m_clipSet; - m_compositeSet = o.m_compositeSet; - m_blendModeSet = o.m_blendModeSet; - m_originSet = o.m_originSet; - m_repeatXSet = o.m_repeatXSet; - m_repeatYSet = o.m_repeatYSet; - m_xPosSet = o.m_xPosSet; - m_yPosSet = o.m_yPosSet; - - m_type = o.m_type; - - return *this; -} - -bool FillLayer::operator==(const FillLayer& o) const { - // We do not check the "isSet" booleans for each property, since those are - // only used during initial construction to propagate patterns into layers. - // All layer comparisons happen after values have all been filled in anyway. - return dataEquivalent(m_image, o.m_image) && m_xPosition == o.m_xPosition && - m_yPosition == o.m_yPosition && - m_backgroundXOrigin == o.m_backgroundXOrigin && - m_backgroundYOrigin == o.m_backgroundYOrigin && - m_attachment == o.m_attachment && m_clip == o.m_clip && - m_composite == o.m_composite && m_blendMode == o.m_blendMode && - m_origin == o.m_origin && m_repeatX == o.m_repeatX && - m_repeatY == o.m_repeatY && m_sizeType == o.m_sizeType && - m_sizeLength == o.m_sizeLength && m_type == o.m_type && - ((m_next && o.m_next) ? *m_next == *o.m_next : m_next == o.m_next); -} - -void FillLayer::fillUnsetProperties() { - FillLayer* curr; - for (curr = this; curr && curr->isXPositionSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_xPosition = pattern->m_xPosition; - if (pattern->isBackgroundXOriginSet()) - curr->m_backgroundXOrigin = pattern->m_backgroundXOrigin; - if (pattern->isBackgroundYOriginSet()) - curr->m_backgroundYOrigin = pattern->m_backgroundYOrigin; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } - - for (curr = this; curr && curr->isYPositionSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_yPosition = pattern->m_yPosition; - if (pattern->isBackgroundXOriginSet()) - curr->m_backgroundXOrigin = pattern->m_backgroundXOrigin; - if (pattern->isBackgroundYOriginSet()) - curr->m_backgroundYOrigin = pattern->m_backgroundYOrigin; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } - - for (curr = this; curr && curr->isAttachmentSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_attachment = pattern->m_attachment; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } - - for (curr = this; curr && curr->isClipSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_clip = pattern->m_clip; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } - - for (curr = this; curr && curr->isCompositeSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_composite = pattern->m_composite; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } - - for (curr = this; curr && curr->isBlendModeSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_blendMode = pattern->m_blendMode; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } - - for (curr = this; curr && curr->isOriginSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_origin = pattern->m_origin; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } - - for (curr = this; curr && curr->isRepeatXSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_repeatX = pattern->m_repeatX; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } - - for (curr = this; curr && curr->isRepeatYSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_repeatY = pattern->m_repeatY; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } - - for (curr = this; curr && curr->isSizeSet(); curr = curr->next()) { - } - if (curr && curr != this) { - // We need to fill in the remaining values with the pattern specified. - for (FillLayer* pattern = this; curr; curr = curr->next()) { - curr->m_sizeType = pattern->m_sizeType; - curr->m_sizeLength = pattern->m_sizeLength; - pattern = pattern->next(); - if (pattern == curr || !pattern) - pattern = this; - } - } -} - -void FillLayer::cullEmptyLayers() { - FillLayer* next; - for (FillLayer* p = this; p; p = next) { - next = p->m_next; - if (next && !next->isImageSet()) { - delete next; - p->m_next = 0; - break; - } - } -} - -static EFillBox clipMax(EFillBox clipA, EFillBox clipB) { - if (clipA == BorderFillBox || clipB == BorderFillBox) - return BorderFillBox; - if (clipA == PaddingFillBox || clipB == PaddingFillBox) - return PaddingFillBox; - return ContentFillBox; -} - -void FillLayer::computeClipMax() const { - if (m_next) { - m_next->computeClipMax(); - m_clipMax = clipMax(clip(), m_next->clip()); - } else - m_clipMax = m_clip; -} - -bool FillLayer::clipOccludesNextLayers(bool firstLayer) const { - if (firstLayer) - computeClipMax(); - return m_clip == m_clipMax; -} - -bool FillLayer::containsImage(StyleImage* s) const { - if (!s) - return false; - if (m_image && *s == *m_image) - return true; - if (m_next) - return m_next->containsImage(s); - return false; -} - -bool FillLayer::imagesAreLoaded() const { - const FillLayer* curr; - for (curr = this; curr; curr = curr->next()) { - if (curr->m_image && !curr->m_image->isLoaded()) - return false; - } - - return true; -} - -bool FillLayer::hasOpaqueImage(const RenderObject* renderer) const { - if (!m_image) - return false; - - if (m_composite == CompositeClear || m_composite == CompositeCopy) - return true; - - if (m_blendMode != WebBlendModeNormal) - return false; - - if (m_composite == CompositeSourceOver) - return m_image->knownToBeOpaque(renderer); - - return false; -} - -bool FillLayer::hasRepeatXY() const { - return m_repeatX == RepeatFill && m_repeatY == RepeatFill; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/FillLayer.h b/sky/engine/core/rendering/style/FillLayer.h deleted file mode 100644 index 55046f0d0366d..0000000000000 --- a/sky/engine/core/rendering/style/FillLayer.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_FILLLAYER_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_FILLLAYER_H_ - -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" -#include "flutter/sky/engine/core/rendering/style/StyleImage.h" -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/platform/LengthSize.h" -#include "flutter/sky/engine/platform/graphics/GraphicsTypes.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -struct FillSize { - FillSize() : type(SizeLength) {} - - FillSize(EFillSizeType t, const LengthSize& l) : type(t), size(l) {} - - bool operator==(const FillSize& o) const { - return type == o.type && size == o.size; - } - bool operator!=(const FillSize& o) const { return !(*this == o); } - - EFillSizeType type; - LengthSize size; -}; - -class FillLayer { - WTF_MAKE_FAST_ALLOCATED; - - public: - FillLayer(EFillLayerType, bool useInitialValues = false); - ~FillLayer(); - - StyleImage* image() const { return m_image.get(); } - const Length& xPosition() const { return m_xPosition; } - const Length& yPosition() const { return m_yPosition; } - BackgroundEdgeOrigin backgroundXOrigin() const { - return static_cast(m_backgroundXOrigin); - } - BackgroundEdgeOrigin backgroundYOrigin() const { - return static_cast(m_backgroundYOrigin); - } - EFillAttachment attachment() const { - return static_cast(m_attachment); - } - EFillBox clip() const { return static_cast(m_clip); } - EFillBox origin() const { return static_cast(m_origin); } - EFillRepeat repeatX() const { return static_cast(m_repeatX); } - EFillRepeat repeatY() const { return static_cast(m_repeatY); } - CompositeOperator composite() const { - return static_cast(m_composite); - } - WebBlendMode blendMode() const { - return static_cast(m_blendMode); - } - const LengthSize& sizeLength() const { return m_sizeLength; } - EFillSizeType sizeType() const { - return static_cast(m_sizeType); - } - FillSize size() const { - return FillSize(static_cast(m_sizeType), m_sizeLength); - } - - const FillLayer* next() const { return m_next; } - FillLayer* next() { return m_next; } - FillLayer* ensureNext() { - if (!m_next) - m_next = new FillLayer(type()); - return m_next; - } - - bool isImageSet() const { return m_imageSet; } - bool isXPositionSet() const { return m_xPosSet; } - bool isYPositionSet() const { return m_yPosSet; } - bool isBackgroundXOriginSet() const { return m_backgroundXOriginSet; } - bool isBackgroundYOriginSet() const { return m_backgroundYOriginSet; } - bool isAttachmentSet() const { return m_attachmentSet; } - bool isClipSet() const { return m_clipSet; } - bool isOriginSet() const { return m_originSet; } - bool isRepeatXSet() const { return m_repeatXSet; } - bool isRepeatYSet() const { return m_repeatYSet; } - bool isCompositeSet() const { return m_compositeSet; } - bool isBlendModeSet() const { return m_blendModeSet; } - bool isSizeSet() const { return m_sizeType != SizeNone; } - - void setImage(PassRefPtr i) { - m_image = i; - m_imageSet = true; - } - void setXPosition(const Length& position) { - m_xPosition = position; - m_xPosSet = true; - m_backgroundXOriginSet = false; - m_backgroundXOrigin = LeftEdge; - } - void setYPosition(const Length& position) { - m_yPosition = position; - m_yPosSet = true; - m_backgroundYOriginSet = false; - m_backgroundYOrigin = TopEdge; - } - void setBackgroundXOrigin(BackgroundEdgeOrigin origin) { - m_backgroundXOrigin = origin; - m_backgroundXOriginSet = true; - } - void setBackgroundYOrigin(BackgroundEdgeOrigin origin) { - m_backgroundYOrigin = origin; - m_backgroundYOriginSet = true; - } - void setAttachment(EFillAttachment attachment) { - m_attachment = attachment; - m_attachmentSet = true; - } - void setClip(EFillBox b) { - m_clip = b; - m_clipSet = true; - } - void setOrigin(EFillBox b) { - m_origin = b; - m_originSet = true; - } - void setRepeatX(EFillRepeat r) { - m_repeatX = r; - m_repeatXSet = true; - } - void setRepeatY(EFillRepeat r) { - m_repeatY = r; - m_repeatYSet = true; - } - void setComposite(CompositeOperator c) { - m_composite = c; - m_compositeSet = true; - } - void setBlendMode(WebBlendMode b) { - m_blendMode = b; - m_blendModeSet = true; - } - void setSizeType(EFillSizeType b) { m_sizeType = b; } - void setSizeLength(const LengthSize& l) { m_sizeLength = l; } - void setSize(FillSize f) { - m_sizeType = f.type; - m_sizeLength = f.size; - } - - void clearImage() { - m_image.clear(); - m_imageSet = false; - } - void clearXPosition() { - m_xPosSet = false; - m_backgroundXOriginSet = false; - } - void clearYPosition() { - m_yPosSet = false; - m_backgroundYOriginSet = false; - } - - void clearAttachment() { m_attachmentSet = false; } - void clearClip() { m_clipSet = false; } - void clearOrigin() { m_originSet = false; } - void clearRepeatX() { m_repeatXSet = false; } - void clearRepeatY() { m_repeatYSet = false; } - void clearComposite() { m_compositeSet = false; } - void clearBlendMode() { m_blendModeSet = false; } - void clearSize() { m_sizeType = SizeNone; } - - FillLayer& operator=(const FillLayer& o); - FillLayer(const FillLayer& o); - - bool operator==(const FillLayer& o) const; - bool operator!=(const FillLayer& o) const { return !(*this == o); } - - bool containsImage(StyleImage*) const; - bool imagesAreLoaded() const; - - bool hasImage() const { - if (m_image) - return true; - return m_next ? m_next->hasImage() : false; - } - - bool hasFixedImage() const { - if (m_image && m_attachment == FixedBackgroundAttachment) - return true; - return m_next ? m_next->hasFixedImage() : false; - } - - bool hasOpaqueImage(const RenderObject*) const; - bool hasRepeatXY() const; - bool clipOccludesNextLayers(bool firstLayer) const; - - EFillLayerType type() const { return static_cast(m_type); } - - void fillUnsetProperties(); - void cullEmptyLayers(); - - static EFillAttachment initialFillAttachment(EFillLayerType) { - return LocalBackgroundAttachment; - } - static EFillBox initialFillClip(EFillLayerType) { return BorderFillBox; } - static EFillBox initialFillOrigin(EFillLayerType type) { - return type == BackgroundFillLayer ? PaddingFillBox : BorderFillBox; - } - static EFillRepeat initialFillRepeatX(EFillLayerType) { return NoRepeatFill; } - static EFillRepeat initialFillRepeatY(EFillLayerType) { return NoRepeatFill; } - static CompositeOperator initialFillComposite(EFillLayerType) { - return CompositeSourceOver; - } - static WebBlendMode initialFillBlendMode(EFillLayerType) { - return WebBlendModeNormal; - } - static EFillSizeType initialFillSizeType(EFillLayerType) { - return SizeLength; - } - static LengthSize initialFillSizeLength(EFillLayerType) { - return LengthSize(); - } - static FillSize initialFillSize(EFillLayerType type) { - return FillSize(initialFillSizeType(type), initialFillSizeLength(type)); - } - static Length initialFillXPosition(EFillLayerType) { - return Length(0.0, Percent); - } - static Length initialFillYPosition(EFillLayerType) { - return Length(0.0, Percent); - } - static StyleImage* initialFillImage(EFillLayerType) { return 0; } - - private: - friend class RenderStyle; - - void computeClipMax() const; - - FillLayer() {} - - FillLayer* m_next; - - RefPtr m_image; - - Length m_xPosition; - Length m_yPosition; - - LengthSize m_sizeLength; - - unsigned m_attachment : 2; // EFillAttachment - unsigned m_clip : 2; // EFillBox - unsigned m_origin : 2; // EFillBox - unsigned m_repeatX : 3; // EFillRepeat - unsigned m_repeatY : 3; // EFillRepeat - unsigned m_composite : 4; // CompositeOperator - unsigned m_sizeType : 2; // EFillSizeType - unsigned m_blendMode : 5; // WebBlendMode - unsigned m_backgroundXOrigin : 2; // BackgroundEdgeOrigin - unsigned m_backgroundYOrigin : 2; // BackgroundEdgeOrigin - - unsigned m_imageSet : 1; - unsigned m_attachmentSet : 1; - unsigned m_clipSet : 1; - unsigned m_originSet : 1; - unsigned m_repeatXSet : 1; - unsigned m_repeatYSet : 1; - unsigned m_xPosSet : 1; - unsigned m_yPosSet : 1; - unsigned m_backgroundXOriginSet : 1; - unsigned m_backgroundYOriginSet : 1; - unsigned m_compositeSet : 1; - unsigned m_blendModeSet : 1; - - unsigned m_type : 1; // EFillLayerType - - mutable unsigned m_clipMax : 2; // EFillBox, maximum m_clip value from this - // to bottom layer -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_FILLLAYER_H_ diff --git a/sky/engine/core/rendering/style/OutlineValue.h b/sky/engine/core/rendering/style/OutlineValue.h deleted file mode 100644 index 9f31a5cca0f1d..0000000000000 --- a/sky/engine/core/rendering/style/OutlineValue.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_OUTLINEVALUE_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_OUTLINEVALUE_H_ - -#include "flutter/sky/engine/core/rendering/style/BorderValue.h" - -namespace blink { - -class OutlineValue : public BorderValue { - friend class RenderStyle; - - public: - OutlineValue() : m_offset(0) {} - - bool operator==(const OutlineValue& o) const { - return BorderValue::operator==(o) && m_offset == o.m_offset && - m_isAuto == o.m_isAuto; - } - - bool operator!=(const OutlineValue& o) const { return !(*this == o); } - - bool visuallyEqual(const OutlineValue& o) const { - if (m_style == BNONE && o.m_style == BNONE) - return true; - return *this == o; - } - - int offset() const { return m_offset; } - void setOffset(int offset) { m_offset = offset; } - - OutlineIsAuto isAuto() const { return static_cast(m_isAuto); } - void setIsAuto(OutlineIsAuto isAuto) { m_isAuto = isAuto; } - - private: - int m_offset; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_OUTLINEVALUE_H_ diff --git a/sky/engine/core/rendering/style/OutlineValueTest.cpp b/sky/engine/core/rendering/style/OutlineValueTest.cpp deleted file mode 100644 index 4603a0a61e562..0000000000000 --- a/sky/engine/core/rendering/style/OutlineValueTest.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/core/rendering/style/OutlineValue.h" - -#include - -using namespace blink; - -namespace { - -TEST(OutlineValueTest, VisuallyEqualStyle) { - OutlineValue outline1; - OutlineValue outline2; - - // Outlines visually equal if their styles are all BNONE. - EXPECT_TRUE(outline1.visuallyEqual(outline2)); - outline2.setOffset(10); - EXPECT_TRUE(outline1.visuallyEqual(outline2)); - - outline2.setStyle(DOTTED); - outline1.setOffset(10); - EXPECT_FALSE(outline1.visuallyEqual(outline2)); -} - -TEST(OutlineValueTest, VisuallyEqualOffset) { - OutlineValue outline1; - OutlineValue outline2; - - outline1.setStyle(DOTTED); - outline2.setStyle(DOTTED); - EXPECT_TRUE(outline1.visuallyEqual(outline2)); - - outline1.setOffset(10); - EXPECT_FALSE(outline1.visuallyEqual(outline2)); - - outline2.setOffset(10); - EXPECT_TRUE(outline1.visuallyEqual(outline2)); -} - -TEST(OutlineValueTest, VisuallyEqualIsAuto) { - OutlineValue outline1; - OutlineValue outline2; - - outline1.setStyle(DOTTED); - outline2.setStyle(DOTTED); - EXPECT_TRUE(outline1.visuallyEqual(outline2)); - - outline1.setIsAuto(AUTO_ON); - EXPECT_FALSE(outline1.visuallyEqual(outline2)); - - outline2.setIsAuto(AUTO_ON); - EXPECT_TRUE(outline1.visuallyEqual(outline2)); -} - -} // namespace diff --git a/sky/engine/core/rendering/style/RenderStyle.cpp b/sky/engine/core/rendering/style/RenderStyle.cpp deleted file mode 100644 index c10113cb93cfc..0000000000000 --- a/sky/engine/core/rendering/style/RenderStyle.cpp +++ /dev/null @@ -1,1102 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. - * All rights reserved. - * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" - -#include -#include "flutter/sky/engine/core/rendering/RenderTheme.h" -#include "flutter/sky/engine/core/rendering/style/AppliedTextDecoration.h" -#include "flutter/sky/engine/core/rendering/style/DataEquivalency.h" -#include "flutter/sky/engine/core/rendering/style/ShadowList.h" -#include "flutter/sky/engine/core/rendering/style/StyleImage.h" -#include "flutter/sky/engine/core/rendering/style/StyleInheritedData.h" -#include "flutter/sky/engine/platform/LengthFunctions.h" -#include "flutter/sky/engine/platform/fonts/Font.h" -#include "flutter/sky/engine/platform/fonts/FontSelector.h" -#include "flutter/sky/engine/platform/geometry/FloatRoundedRect.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -struct SameSizeAsBorderValue { - RGBA32 m_color; - unsigned m_width; -}; - -COMPILE_ASSERT(sizeof(BorderValue) == sizeof(SameSizeAsBorderValue), - BorderValue_should_not_grow); - -inline RenderStyle* defaultStyle() { - DEFINE_STATIC_REF(RenderStyle, s_defaultStyle, - (RenderStyle::createDefaultStyle())); - return s_defaultStyle; -} - -PassRefPtr RenderStyle::create() { - return adoptRef(new RenderStyle()); -} - -PassRefPtr RenderStyle::createDefaultStyle() { - return adoptRef(new RenderStyle(DefaultStyle)); -} - -PassRefPtr RenderStyle::clone(const RenderStyle* other) { - return adoptRef(new RenderStyle(*other)); -} - -ALWAYS_INLINE RenderStyle::RenderStyle() - : m_box(defaultStyle()->m_box), - visual(defaultStyle()->visual), - m_background(defaultStyle()->m_background), - surround(defaultStyle()->surround), - rareNonInheritedData(defaultStyle()->rareNonInheritedData), - rareInheritedData(defaultStyle()->rareInheritedData), - inherited(defaultStyle()->inherited) { - setBitDefaults(); // Would it be faster to copy this from the default style? - COMPILE_ASSERT((sizeof(InheritedFlags) <= 8), InheritedFlags_does_not_grow); - COMPILE_ASSERT((sizeof(NonInheritedFlags) <= 8), - NonInheritedFlags_does_not_grow); -} - -ALWAYS_INLINE RenderStyle::RenderStyle(DefaultStyleTag) { - setBitDefaults(); - - m_box.init(); - visual.init(); - m_background.init(); - surround.init(); - rareNonInheritedData.init(); - rareNonInheritedData.access()->m_flexibleBox.init(); - rareNonInheritedData.access()->m_transform.init(); - rareNonInheritedData.access()->m_filter.init(); - rareInheritedData.init(); - inherited.init(); -} - -ALWAYS_INLINE RenderStyle::RenderStyle(const RenderStyle& o) - : RefCounted(), - m_box(o.m_box), - visual(o.visual), - m_background(o.m_background), - surround(o.surround), - rareNonInheritedData(o.rareNonInheritedData), - rareInheritedData(o.rareInheritedData), - inherited(o.inherited), - inherited_flags(o.inherited_flags), - noninherited_flags(o.noninherited_flags) {} - -StyleRecalcChange RenderStyle::stylePropagationDiff( - const RenderStyle* oldStyle, - const RenderStyle* newStyle) { - if ((!oldStyle && newStyle) || (oldStyle && !newStyle)) - return Reattach; - - if (!oldStyle && !newStyle) - return NoChange; - - if (oldStyle->display() != newStyle->display() || - oldStyle->justifyItems() != newStyle->justifyItems() || - oldStyle->alignItems() != newStyle->alignItems()) - return Reattach; - - if (*oldStyle == *newStyle) - return NoChange; - - if (oldStyle->inheritedNotEqual(newStyle) || - oldStyle->hasExplicitlyInheritedProperties() || - newStyle->hasExplicitlyInheritedProperties()) - return Inherit; - - return NoInherit; -} - -void RenderStyle::inheritFrom(const RenderStyle* inheritParent) { - rareInheritedData = inheritParent->rareInheritedData; - inherited = inheritParent->inherited; - inherited_flags = inheritParent->inherited_flags; -} - -void RenderStyle::copyNonInheritedFrom(const RenderStyle* other) { - m_box = other->m_box; - visual = other->visual; - m_background = other->m_background; - surround = other->surround; - rareNonInheritedData = other->rareNonInheritedData; - // The flags are copied one-by-one because noninherited_flags contains a bunch - // of stuff other than real style data. - noninherited_flags.effectiveDisplay = - other->noninherited_flags.effectiveDisplay; - noninherited_flags.originalDisplay = - other->noninherited_flags.originalDisplay; - noninherited_flags.overflowX = other->noninherited_flags.overflowX; - noninherited_flags.overflowY = other->noninherited_flags.overflowY; - noninherited_flags.verticalAlign = other->noninherited_flags.verticalAlign; - noninherited_flags.position = other->noninherited_flags.position; - noninherited_flags.unicodeBidi = other->noninherited_flags.unicodeBidi; - noninherited_flags.explicitInheritance = - other->noninherited_flags.explicitInheritance; - noninherited_flags.currentColor = other->noninherited_flags.currentColor; - noninherited_flags.hasViewportUnits = - other->noninherited_flags.hasViewportUnits; -} - -bool RenderStyle::operator==(const RenderStyle& o) const { - // compare everything except the pseudoStyle pointer - return inherited_flags == o.inherited_flags && - noninherited_flags == o.noninherited_flags && m_box == o.m_box && - visual == o.visual && m_background == o.m_background && - surround == o.surround && - rareNonInheritedData == o.rareNonInheritedData && - rareInheritedData == o.rareInheritedData && inherited == o.inherited; -} - -bool RenderStyle::inheritedNotEqual(const RenderStyle* other) const { - return inherited_flags != other->inherited_flags || - inherited != other->inherited || - rareInheritedData != other->rareInheritedData; -} - -bool RenderStyle::inheritedDataShared(const RenderStyle* other) const { - // This is a fast check that only looks if the data structures are shared. - return inherited_flags == other->inherited_flags && - inherited.get() == other->inherited.get() && - rareInheritedData.get() == other->rareInheritedData.get(); -} - -bool RenderStyle::requiresOnlyBlockChildren() const { - switch (display()) { - case PARAGRAPH: - case INLINE: - return false; - - case FLEX: - case INLINE_FLEX: - return true; - - case NONE: - ASSERT_NOT_REACHED(); - return false; - } - - ASSERT_NOT_REACHED(); - return false; -} - -static bool positionedObjectMovedOnly(const LengthBox& a, - const LengthBox& b, - const Length& width) { - // If any unit types are different, then we can't guarantee - // that this was just a movement. - if (a.left().type() != b.left().type() || - a.right().type() != b.right().type() || - a.top().type() != b.top().type() || - a.bottom().type() != b.bottom().type()) - return false; - - // Only one unit can be non-auto in the horizontal direction and - // in the vertical direction. Otherwise the adjustment of values - // is changing the size of the box. - if (!a.left().isIntrinsicOrAuto() && !a.right().isIntrinsicOrAuto()) - return false; - if (!a.top().isIntrinsicOrAuto() && !a.bottom().isIntrinsicOrAuto()) - return false; - // If our width is auto and left or right is specified and changed then this - // is not just a movement - we need to resize to our container. - if (width.isIntrinsicOrAuto() && - ((!a.left().isIntrinsicOrAuto() && a.left() != b.left()) || - (!a.right().isIntrinsicOrAuto() && a.right() != b.right()))) - return false; - - // One of the units is fixed or percent in both directions and stayed - // that way in the new style. Therefore all we are doing is moving. - return true; -} - -StyleDifference RenderStyle::visualInvalidationDiff( - const RenderStyle& other) const { - // Note, we use .get() on each DataRef below because DataRef::operator== will - // do a deep compare, which is duplicate work when we're going to compare each - // property inside this function anyway. - - StyleDifference diff; - - if (diffNeedsFullLayout(other)) { - diff.setNeedsFullLayout(); - } else if (position() != StaticPosition && - surround->offset != other.surround->offset) { - // Optimize for the case where a positioned layer is moving but not changing - // size. - if (positionedObjectMovedOnly(surround->offset, other.surround->offset, - m_box->width())) - diff.setNeedsPositionedMovementLayout(); - else - diff.setNeedsFullLayout(); - } - - updatePropertySpecificDifferences(other, diff); - - // Cursors are not checked, since they will be set appropriately in response - // to mouse events, so they don't need to cause any paint invalidation or - // layout. - - return diff; -} - -bool RenderStyle::diffNeedsFullLayout(const RenderStyle& other) const { - // FIXME: Not all cases in this method need both full layout and paint - // invalidation. Should move cases into diffNeedsFullLayout() if - // - don't need paint invalidation at all; - // - or the renderer knows how to exactly invalidate paints caused by the - // layout change - // instead of forced full paint invalidation. - - if (surround.get() != other.surround.get()) { - // If our border widths change, then we need to layout. Other changes to - // borders only necessitate a paint invalidation. - if (borderLeftWidth() != other.borderLeftWidth() || - borderTopWidth() != other.borderTopWidth() || - borderBottomWidth() != other.borderBottomWidth() || - borderRightWidth() != other.borderRightWidth()) - return true; - } - - if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { - if (rareNonInheritedData->textOverflow != - other.rareNonInheritedData->textOverflow || - rareNonInheritedData->m_wrapFlow != - other.rareNonInheritedData->m_wrapFlow || - rareNonInheritedData->m_wrapThrough != - other.rareNonInheritedData->m_wrapThrough || - rareNonInheritedData->m_order != other.rareNonInheritedData->m_order || - rareNonInheritedData->m_alignContent != - other.rareNonInheritedData->m_alignContent || - rareNonInheritedData->m_alignItems != - other.rareNonInheritedData->m_alignItems || - rareNonInheritedData->m_alignSelf != - other.rareNonInheritedData->m_alignSelf || - rareNonInheritedData->m_justifyContent != - other.rareNonInheritedData->m_justifyContent) - return true; - - if (rareNonInheritedData->m_flexibleBox.get() != - other.rareNonInheritedData->m_flexibleBox.get() && - *rareNonInheritedData->m_flexibleBox.get() != - *other.rareNonInheritedData->m_flexibleBox.get()) - return true; - - // FIXME: We should add an optimized form of layout that just recomputes - // visual overflow. - if (!rareNonInheritedData->shadowDataEquivalent( - *other.rareNonInheritedData.get())) - return true; - - // If the counter directives change, trigger a relayout to re-calculate - // counter values and rebuild the counter node tree. - const CounterDirectiveMap* mapA = - rareNonInheritedData->m_counterDirectives.get(); - const CounterDirectiveMap* mapB = - other.rareNonInheritedData->m_counterDirectives.get(); - if (!(mapA == mapB || (mapA && mapB && *mapA == *mapB))) - return true; - - // We only need do layout for opacity changes if adding or losing opacity - // could trigger a change in us being a stacking context. - if (hasAutoZIndex() != other.hasAutoZIndex() && - rareNonInheritedData->hasOpacity() != - other.rareNonInheritedData->hasOpacity()) { - // FIXME: We would like to use SimplifiedLayout here, but we can't quite - // do that yet. We need to make sure SimplifiedLayout can operate - // correctly on RenderInlines (we will need to add a - // selfNeedsSimplifiedLayout bit in order to not get confused and taint - // every line). In addition we need to solve the floating object issue - // when layers come and go. Right now a full layout is necessary to keep - // floating object lists sane. - return true; - } - } - - if (rareInheritedData.get() != other.rareInheritedData.get()) { - if (rareInheritedData->highlight != other.rareInheritedData->highlight || - rareInheritedData->indent != other.rareInheritedData->indent || - rareInheritedData->m_textAlignLast != - other.rareInheritedData->m_textAlignLast || - rareInheritedData->m_textIndentLine != - other.rareInheritedData->m_textIndentLine || - rareInheritedData->wordBreak != other.rareInheritedData->wordBreak || - rareInheritedData->overflowWrap != - other.rareInheritedData->overflowWrap || - rareInheritedData->lineBreak != other.rareInheritedData->lineBreak || - rareInheritedData->hyphens != other.rareInheritedData->hyphens || - rareInheritedData->hyphenationLimitBefore != - other.rareInheritedData->hyphenationLimitBefore || - rareInheritedData->hyphenationLimitAfter != - other.rareInheritedData->hyphenationLimitAfter || - rareInheritedData->hyphenationString != - other.rareInheritedData->hyphenationString || - rareInheritedData->locale != other.rareInheritedData->locale || - rareInheritedData->textEmphasisMark != - other.rareInheritedData->textEmphasisMark || - rareInheritedData->textEmphasisPosition != - other.rareInheritedData->textEmphasisPosition || - rareInheritedData->textEmphasisCustomMark != - other.rareInheritedData->textEmphasisCustomMark || - rareInheritedData->m_textJustify != - other.rareInheritedData->m_textJustify || - rareInheritedData->m_textOrientation != - other.rareInheritedData->m_textOrientation || - rareInheritedData->m_tabSize != other.rareInheritedData->m_tabSize || - rareInheritedData->m_lineBoxContain != - other.rareInheritedData->m_lineBoxContain || - rareInheritedData->textStrokeWidth != - other.rareInheritedData->textStrokeWidth) - return true; - - if (!rareInheritedData->shadowDataEquivalent( - *other.rareInheritedData.get())) - return true; - } - - if (inherited.get() != other.inherited.get()) { - if (inherited->line_height != other.inherited->line_height || - inherited->font != other.inherited->font || - inherited->horizontal_border_spacing != - other.inherited->horizontal_border_spacing || - inherited->vertical_border_spacing != - other.inherited->vertical_border_spacing) - return true; - } - - if (inherited_flags.m_rtlOrdering != other.inherited_flags.m_rtlOrdering || - inherited_flags._text_align != other.inherited_flags._text_align || - inherited_flags._direction != other.inherited_flags._direction || - inherited_flags._white_space != other.inherited_flags._white_space) - return true; - - if (noninherited_flags.overflowX != other.noninherited_flags.overflowX || - noninherited_flags.overflowY != other.noninherited_flags.overflowY || - noninherited_flags.unicodeBidi != other.noninherited_flags.unicodeBidi || - noninherited_flags.position != other.noninherited_flags.position || - noninherited_flags.originalDisplay != - other.noninherited_flags.originalDisplay) - return true; - - if (!m_background->outline().visuallyEqual(other.m_background->outline())) { - // FIXME: We only really need to recompute the overflow but we don't have an - // optimized layout for it. - return true; - } - - if (m_box.get() != other.m_box.get()) { - if (m_box->width() != other.m_box->width() || - m_box->minWidth() != other.m_box->minWidth() || - m_box->maxWidth() != other.m_box->maxWidth() || - m_box->height() != other.m_box->height() || - m_box->minHeight() != other.m_box->minHeight() || - m_box->maxHeight() != other.m_box->maxHeight()) - return true; - - if (m_box->verticalAlign() != other.m_box->verticalAlign()) - return true; - - if (m_box->boxSizing() != other.m_box->boxSizing()) - return true; - } - - if (noninherited_flags.verticalAlign != - other.noninherited_flags.verticalAlign) - return true; - - if (surround.get() != other.surround.get()) { - if (surround->margin != other.surround->margin) - return true; - - if (surround->padding != other.surround->padding) - return true; - } - - // Movement of non-static-positioned object is special cased in - // RenderStyle::visualInvalidationDiff(). - - return false; -} - -void RenderStyle::updatePropertySpecificDifferences( - const RenderStyle& other, - StyleDifference& diff) const { - // StyleAdjuster has ensured that zIndex is non-auto only if it's applicable. - if (m_box->zIndex() != other.m_box->zIndex() || - m_box->hasAutoZIndex() != other.m_box->hasAutoZIndex()) - diff.setZIndexChanged(); - - if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) { - if (!transformDataEquivalent(other)) - diff.setTransformChanged(); - - if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity) - diff.setOpacityChanged(); - - if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filter) - diff.setFilterChanged(); - } -} - -inline bool requireTransformOrigin( - const Vector>& transformOperations, - RenderStyle::ApplyTransformOrigin applyOrigin) { - // transform-origin brackets the transform with translate operations. - // Optimize for the case where the only transform is a translation, since the - // transform-origin is irrelevant in that case. - if (applyOrigin != RenderStyle::IncludeTransformOrigin) - return false; - - unsigned size = transformOperations.size(); - for (unsigned i = 0; i < size; ++i) { - TransformOperation::OperationType type = transformOperations[i]->type(); - if (type != TransformOperation::TranslateX && - type != TransformOperation::TranslateY && - type != TransformOperation::Translate && - type != TransformOperation::TranslateZ && - type != TransformOperation::Translate3D) - return true; - } - - return false; -} - -void RenderStyle::applyTransform(TransformationMatrix& transform, - const LayoutSize& borderBoxSize, - ApplyTransformOrigin applyOrigin) const { - applyTransform(transform, FloatRect(FloatPoint(), borderBoxSize), - applyOrigin); -} - -void RenderStyle::applyTransform(TransformationMatrix& transform, - const FloatRect& boundingBox, - ApplyTransformOrigin applyOrigin) const { - const Vector>& transformOperations = - rareNonInheritedData->m_transform->m_operations.operations(); - bool applyTransformOrigin = - requireTransformOrigin(transformOperations, applyOrigin); - - float offsetX = transformOriginX().type() == Percent ? boundingBox.x() : 0; - float offsetY = transformOriginY().type() == Percent ? boundingBox.y() : 0; - - if (applyTransformOrigin) { - transform.translate3d( - floatValueForLength(transformOriginX(), boundingBox.width()) + offsetX, - floatValueForLength(transformOriginY(), boundingBox.height()) + offsetY, - transformOriginZ()); - } - - unsigned size = transformOperations.size(); - for (unsigned i = 0; i < size; ++i) - transformOperations[i]->apply(transform, boundingBox.size()); - - if (applyTransformOrigin) { - transform.translate3d( - -floatValueForLength(transformOriginX(), boundingBox.width()) - offsetX, - -floatValueForLength(transformOriginY(), boundingBox.height()) - - offsetY, - -transformOriginZ()); - } -} - -void RenderStyle::setTextShadow(PassRefPtr s) { - rareInheritedData.access()->textShadow = s; -} - -void RenderStyle::setBoxShadow(PassRefPtr s) { - rareNonInheritedData.access()->m_boxShadow = s; -} - -static RoundedRect::Radii calcRadiiFor(const BorderData& border, IntSize size) { - return RoundedRect::Radii( - IntSize(valueForLength(border.topLeft().width(), size.width()), - valueForLength(border.topLeft().height(), size.height())), - IntSize(valueForLength(border.topRight().width(), size.width()), - valueForLength(border.topRight().height(), size.height())), - IntSize(valueForLength(border.bottomLeft().width(), size.width()), - valueForLength(border.bottomLeft().height(), size.height())), - IntSize(valueForLength(border.bottomRight().width(), size.width()), - valueForLength(border.bottomRight().height(), size.height()))); -} - -Color RenderStyle::color() const { - return inherited->color; -} -void RenderStyle::setColor(const Color& v) { - SET_VAR(inherited, color, v); -} - -short RenderStyle::horizontalBorderSpacing() const { - return inherited->horizontal_border_spacing; -} -short RenderStyle::verticalBorderSpacing() const { - return inherited->vertical_border_spacing; -} -void RenderStyle::setHorizontalBorderSpacing(short v) { - SET_VAR(inherited, horizontal_border_spacing, v); -} -void RenderStyle::setVerticalBorderSpacing(short v) { - SET_VAR(inherited, vertical_border_spacing, v); -} - -RoundedRect RenderStyle::getRoundedBorderFor( - const LayoutRect& borderRect, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) const { - IntRect snappedBorderRect(pixelSnappedIntRect(borderRect)); - RoundedRect roundedRect(snappedBorderRect); - if (hasBorderRadius()) { - RoundedRect::Radii radii = - calcRadiiFor(surround->border, snappedBorderRect.size()); - radii.scale(calcBorderRadiiConstraintScaleFor(borderRect, radii)); - roundedRect.includeLogicalEdges(radii, includeLogicalLeftEdge, - includeLogicalRightEdge); - } - return roundedRect; -} - -RoundedRect RenderStyle::getRoundedInnerBorderFor( - const LayoutRect& borderRect, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) const { - int leftWidth = (includeLogicalLeftEdge) ? borderLeftWidth() : 0; - int rightWidth = (includeLogicalRightEdge) ? borderRightWidth() : 0; - int topWidth = borderTopWidth(); - int bottomWidth = borderBottomWidth(); - - return getRoundedInnerBorderFor(borderRect, topWidth, bottomWidth, leftWidth, - rightWidth, includeLogicalLeftEdge, - includeLogicalRightEdge); -} - -RoundedRect RenderStyle::getRoundedInnerBorderFor( - const LayoutRect& borderRect, - int topWidth, - int bottomWidth, - int leftWidth, - int rightWidth, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) const { - LayoutRect innerRect(borderRect.x() + leftWidth, borderRect.y() + topWidth, - borderRect.width() - leftWidth - rightWidth, - borderRect.height() - topWidth - bottomWidth); - - RoundedRect roundedRect(pixelSnappedIntRect(innerRect)); - - if (hasBorderRadius()) { - RoundedRect::Radii radii = getRoundedBorderFor(borderRect).radii(); - radii.shrink(topWidth, bottomWidth, leftWidth, rightWidth); - roundedRect.includeLogicalEdges(radii, includeLogicalLeftEdge, - includeLogicalRightEdge); - } - return roundedRect; -} - -static bool allLayersAreFixed(const FillLayer& layer) { - for (const FillLayer* currLayer = &layer; currLayer; - currLayer = currLayer->next()) { - if (!currLayer->image() || - currLayer->attachment() != FixedBackgroundAttachment) - return false; - } - - return true; -} - -bool RenderStyle::hasEntirelyFixedBackground() const { - return allLayersAreFixed(backgroundLayers()); -} - -const CounterDirectiveMap* RenderStyle::counterDirectives() const { - return rareNonInheritedData->m_counterDirectives.get(); -} - -CounterDirectiveMap& RenderStyle::accessCounterDirectives() { - OwnPtr& map = - rareNonInheritedData.access()->m_counterDirectives; - if (!map) - map = adoptPtr(new CounterDirectiveMap); - return *map; -} - -const CounterDirectives RenderStyle::getCounterDirectives( - const AtomicString& identifier) const { - if (const CounterDirectiveMap* directives = counterDirectives()) - return directives->get(identifier); - return CounterDirectives(); -} - -const AtomicString& RenderStyle::hyphenString() const { - const AtomicString& hyphenationString = - rareInheritedData.get()->hyphenationString; - if (!hyphenationString.isNull()) - return hyphenationString; - - // FIXME: This should depend on locale. - DEFINE_STATIC_LOCAL(AtomicString, hyphenMinusString, (&hyphenMinus, 1)); - DEFINE_STATIC_LOCAL(AtomicString, hyphenString, (&hyphen, 1)); - return font().primaryFontHasGlyphForCharacter(hyphen) ? hyphenString - : hyphenMinusString; -} - -const AtomicString& RenderStyle::textEmphasisMarkString() const { - switch (textEmphasisMark()) { - case TextEmphasisMarkNone: - return nullAtom; - case TextEmphasisMarkCustom: - return textEmphasisCustomMark(); - case TextEmphasisMarkDot: { - DEFINE_STATIC_LOCAL(AtomicString, filledDotString, (&bullet, 1)); - DEFINE_STATIC_LOCAL(AtomicString, openDotString, (&whiteBullet, 1)); - return textEmphasisFill() == TextEmphasisFillFilled ? filledDotString - : openDotString; - } - case TextEmphasisMarkCircle: { - DEFINE_STATIC_LOCAL(AtomicString, filledCircleString, (&blackCircle, 1)); - DEFINE_STATIC_LOCAL(AtomicString, openCircleString, (&whiteCircle, 1)); - return textEmphasisFill() == TextEmphasisFillFilled ? filledCircleString - : openCircleString; - } - case TextEmphasisMarkDoubleCircle: { - DEFINE_STATIC_LOCAL(AtomicString, filledDoubleCircleString, - (&fisheye, 1)); - DEFINE_STATIC_LOCAL(AtomicString, openDoubleCircleString, (&bullseye, 1)); - return textEmphasisFill() == TextEmphasisFillFilled - ? filledDoubleCircleString - : openDoubleCircleString; - } - case TextEmphasisMarkTriangle: { - DEFINE_STATIC_LOCAL(AtomicString, filledTriangleString, - (&blackUpPointingTriangle, 1)); - DEFINE_STATIC_LOCAL(AtomicString, openTriangleString, - (&whiteUpPointingTriangle, 1)); - return textEmphasisFill() == TextEmphasisFillFilled ? filledTriangleString - : openTriangleString; - } - case TextEmphasisMarkSesame: { - DEFINE_STATIC_LOCAL(AtomicString, filledSesameString, (&sesameDot, 1)); - DEFINE_STATIC_LOCAL(AtomicString, openSesameString, (&whiteSesameDot, 1)); - return textEmphasisFill() == TextEmphasisFillFilled ? filledSesameString - : openSesameString; - } - case TextEmphasisMarkAuto: - ASSERT_NOT_REACHED(); - return nullAtom; - } - - ASSERT_NOT_REACHED(); - return nullAtom; -} - -const Font& RenderStyle::font() const { - return inherited->font; -} -const FontMetrics& RenderStyle::fontMetrics() const { - return inherited->font.fontMetrics(); -} -const FontDescription& RenderStyle::fontDescription() const { - return inherited->font.fontDescription(); -} -float RenderStyle::specifiedFontSize() const { - return fontDescription().specifiedSize(); -} -float RenderStyle::computedFontSize() const { - return fontDescription().computedSize(); -} -int RenderStyle::fontSize() const { - return fontDescription().computedPixelSize(); -} -FontWeight RenderStyle::fontWeight() const { - return fontDescription().weight(); -} -FontStretch RenderStyle::fontStretch() const { - return fontDescription().stretch(); -} - -TextDecoration RenderStyle::textDecorationsInEffect() const { - int decorations = 0; - - const Vector& applied = appliedTextDecorations(); - - for (size_t i = 0; i < applied.size(); ++i) - decorations |= applied[i].line(); - - return static_cast(decorations); -} - -const Vector& RenderStyle::appliedTextDecorations() - const { - if (!inherited_flags.m_textUnderline && - !rareInheritedData->appliedTextDecorations) { - DEFINE_STATIC_LOCAL(Vector, empty, ()); - return empty; - } - if (inherited_flags.m_textUnderline) { - DEFINE_STATIC_LOCAL(Vector, underline, - (1, AppliedTextDecoration(TextDecorationUnderline))); - return underline; - } - - return rareInheritedData->appliedTextDecorations->vector(); -} - -float RenderStyle::wordSpacing() const { - return fontDescription().wordSpacing(); -} -float RenderStyle::letterSpacing() const { - return fontDescription().letterSpacing(); -} - -bool RenderStyle::setFontDescription(const FontDescription& v) { - if (inherited->font.fontDescription() != v) { - inherited.access()->font = Font(v); - return true; - } - return false; -} - -const Length& RenderStyle::specifiedLineHeight() const { - return inherited->line_height; -} -Length RenderStyle::lineHeight() const { - return inherited->line_height; -} - -void RenderStyle::setLineHeight(const Length& specifiedLineHeight) { - SET_VAR(inherited, line_height, specifiedLineHeight); -} - -int RenderStyle::computedLineHeight() const { - const Length& lh = lineHeight(); - - // Negative value means the line height is not set. Use the font's built-in - // spacing. - if (lh.isNegative()) - return fontMetrics().lineSpacing(); - - if (lh.isPercent()) - return minimumValueForLength(lh, fontSize()); - - return lh.value(); -} - -void RenderStyle::setWordSpacing(float wordSpacing) { - FontSelector* currentFontSelector = font().fontSelector(); - FontDescription desc(fontDescription()); - desc.setWordSpacing(wordSpacing); - setFontDescription(desc); - font().update(currentFontSelector); -} - -void RenderStyle::setLetterSpacing(float letterSpacing) { - FontSelector* currentFontSelector = font().fontSelector(); - FontDescription desc(fontDescription()); - desc.setLetterSpacing(letterSpacing); - setFontDescription(desc); - font().update(currentFontSelector); -} - -void RenderStyle::setFontSize(float size) { - ASSERT(std::isfinite(size)); - if (!std::isfinite(size) || size < 0) - size = 0; - - FontSelector* currentFontSelector = font().fontSelector(); - FontDescription desc(fontDescription()); - desc.setSpecifiedSize(size); - desc.setComputedSize(size); - - setFontDescription(desc); - font().update(currentFontSelector); -} - -void RenderStyle::setFontWeight(FontWeight weight) { - FontSelector* currentFontSelector = font().fontSelector(); - FontDescription desc(fontDescription()); - desc.setWeight(weight); - setFontDescription(desc); - font().update(currentFontSelector); -} - -void RenderStyle::addAppliedTextDecoration( - const AppliedTextDecoration& decoration) { - RefPtr& list = - rareInheritedData.access()->appliedTextDecorations; - - if (!list) - list = AppliedTextDecorationList::create(); - else if (!list->hasOneRef()) - list = list->copy(); - - if (inherited_flags.m_textUnderline) { - inherited_flags.m_textUnderline = false; - list->append(AppliedTextDecoration(TextDecorationUnderline)); - } - - list->append(decoration); -} - -void RenderStyle::applyTextDecorations() { - if (textDecoration() == TextDecorationNone) - return; - - TextDecorationStyle style = textDecorationStyle(); - StyleColor styleColor = decorationStyleColor(); - - int decorations = textDecoration(); - - if (decorations & TextDecorationUnderline) { - // To save memory, we don't use AppliedTextDecoration objects in the - // common case of a single simple underline. - AppliedTextDecoration underline(TextDecorationUnderline, style, styleColor); - - if (!rareInheritedData->appliedTextDecorations && - underline.isSimpleUnderline()) - inherited_flags.m_textUnderline = true; - else - addAppliedTextDecoration(underline); - } - if (decorations & TextDecorationOverline) - addAppliedTextDecoration( - AppliedTextDecoration(TextDecorationOverline, style, styleColor)); - if (decorations & TextDecorationLineThrough) - addAppliedTextDecoration( - AppliedTextDecoration(TextDecorationLineThrough, style, styleColor)); -} - -void RenderStyle::clearAppliedTextDecorations() { - inherited_flags.m_textUnderline = false; - - if (rareInheritedData->appliedTextDecorations) - rareInheritedData.access()->appliedTextDecorations = nullptr; -} - -void RenderStyle::setFontStretch(FontStretch stretch) { - FontSelector* currentFontSelector = font().fontSelector(); - FontDescription desc(fontDescription()); - desc.setStretch(stretch); - setFontDescription(desc); - font().update(currentFontSelector); -} - -void RenderStyle::getShadowExtent(const ShadowList* shadowList, - LayoutUnit& top, - LayoutUnit& right, - LayoutUnit& bottom, - LayoutUnit& left) const { - top = 0; - right = 0; - bottom = 0; - left = 0; - - size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; - for (size_t i = 0; i < shadowCount; ++i) { - const ShadowData& shadow = shadowList->shadows()[i]; - if (shadow.style() == Inset) - continue; - float blurAndSpread = shadow.blur() + shadow.spread(); - - top = std::min(top, shadow.y() - blurAndSpread); - right = std::max(right, shadow.x() + blurAndSpread); - bottom = std::max(bottom, shadow.y() + blurAndSpread); - left = std::min(left, shadow.x() - blurAndSpread); - } -} - -LayoutBoxExtent RenderStyle::getShadowInsetExtent( - const ShadowList* shadowList) const { - LayoutUnit top = 0; - LayoutUnit right = 0; - LayoutUnit bottom = 0; - LayoutUnit left = 0; - - size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; - for (size_t i = 0; i < shadowCount; ++i) { - const ShadowData& shadow = shadowList->shadows()[i]; - if (shadow.style() == Normal) - continue; - float blurAndSpread = shadow.blur() + shadow.spread(); - top = std::max(top, shadow.y() + blurAndSpread); - right = std::min(right, shadow.x() - blurAndSpread); - bottom = std::min(bottom, shadow.y() - blurAndSpread); - left = std::max(left, shadow.x() + blurAndSpread); - } - - return LayoutBoxExtent(top, right, bottom, left); -} - -void RenderStyle::getShadowHorizontalExtent(const ShadowList* shadowList, - LayoutUnit& left, - LayoutUnit& right) const { - left = 0; - right = 0; - - size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; - for (size_t i = 0; i < shadowCount; ++i) { - const ShadowData& shadow = shadowList->shadows()[i]; - if (shadow.style() == Inset) - continue; - float blurAndSpread = shadow.blur() + shadow.spread(); - - left = std::min(left, shadow.x() - blurAndSpread); - right = std::max(right, shadow.x() + blurAndSpread); - } -} - -void RenderStyle::getShadowVerticalExtent(const ShadowList* shadowList, - LayoutUnit& top, - LayoutUnit& bottom) const { - top = 0; - bottom = 0; - - size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; - for (size_t i = 0; i < shadowCount; ++i) { - const ShadowData& shadow = shadowList->shadows()[i]; - if (shadow.style() == Inset) - continue; - float blurAndSpread = shadow.blur() + shadow.spread(); - - top = std::min(top, shadow.y() - blurAndSpread); - bottom = std::max(bottom, shadow.y() + blurAndSpread); - } -} - -StyleColor RenderStyle::decorationStyleColor() const { - StyleColor styleColor = textDecorationColor(); - - if (!styleColor.isCurrentColor()) - return styleColor; - - if (textStrokeWidth()) { - // Prefer stroke color if possible, but not if it's fully transparent. - StyleColor textStrokeStyleColor = textStrokeColor(); - if (!textStrokeStyleColor.isCurrentColor() && - textStrokeStyleColor.color().alpha()) - return textStrokeStyleColor; - } - - return textFillColor(); -} - -Color RenderStyle::decorationColor() const { - return decorationStyleColor().resolve(color()); -} - -const BorderValue& RenderStyle::borderBefore() const { - // FIXME(sky): Remove - return borderTop(); -} - -const BorderValue& RenderStyle::borderAfter() const { - // FIXME(sky): Remove - return borderBottom(); -} - -const BorderValue& RenderStyle::borderStart() const { - return isLeftToRightDirection() ? borderLeft() : borderRight(); -} - -const BorderValue& RenderStyle::borderEnd() const { - return isLeftToRightDirection() ? borderRight() : borderLeft(); -} - -unsigned short RenderStyle::borderBeforeWidth() const { - // FIXME(sky): Remove - return borderTopWidth(); -} - -unsigned short RenderStyle::borderAfterWidth() const { - // FIXME(sky): Remove - return borderBottomWidth(); -} - -unsigned short RenderStyle::borderStartWidth() const { - return isLeftToRightDirection() ? borderLeftWidth() : borderRightWidth(); -} - -unsigned short RenderStyle::borderEndWidth() const { - return isLeftToRightDirection() ? borderRightWidth() : borderLeftWidth(); -} - -void RenderStyle::setMarginStart(const Length& margin) { - if (isLeftToRightDirection()) - setMarginLeft(margin); - else - setMarginRight(margin); -} - -void RenderStyle::setMarginEnd(const Length& margin) { - if (isLeftToRightDirection()) - setMarginRight(margin); - else - setMarginLeft(margin); -} - -TextEmphasisMark RenderStyle::textEmphasisMark() const { - TextEmphasisMark mark = - static_cast(rareInheritedData->textEmphasisMark); - if (mark != TextEmphasisMarkAuto) - return mark; - return TextEmphasisMarkDot; -} - -Color RenderStyle::initialTapHighlightColor() { - return RenderTheme::tapHighlightColor(); -} - -float calcBorderRadiiConstraintScaleFor(const FloatRect& rect, - const FloatRoundedRect::Radii& radii) { - // Constrain corner radii using CSS3 rules: - // http://www.w3.org/TR/css3-background/#the-border-radius - - float factor = 1; - float radiiSum; - - // top - radiiSum = radii.topLeft().width() + - radii.topRight().width(); // Casts to avoid integer overflow. - if (radiiSum > rect.width()) - factor = std::min(rect.width() / radiiSum, factor); - - // bottom - radiiSum = radii.bottomLeft().width() + radii.bottomRight().width(); - if (radiiSum > rect.width()) - factor = std::min(rect.width() / radiiSum, factor); - - // left - radiiSum = radii.topLeft().height() + radii.bottomLeft().height(); - if (radiiSum > rect.height()) - factor = std::min(rect.height() / radiiSum, factor); - - // right - radiiSum = radii.topRight().height() + radii.bottomRight().height(); - if (radiiSum > rect.height()) - factor = std::min(rect.height() / radiiSum, factor); - - ASSERT(factor <= 1); - return factor; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/RenderStyle.h b/sky/engine/core/rendering/style/RenderStyle.h deleted file mode 100644 index 782edd1338396..0000000000000 --- a/sky/engine/core/rendering/style/RenderStyle.h +++ /dev/null @@ -1,1745 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All - * rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLE_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLE_H_ - -#include "flutter/sky/engine/core/rendering/style/BorderValue.h" -#include "flutter/sky/engine/core/rendering/style/CounterDirectives.h" -#include "flutter/sky/engine/core/rendering/style/DataRef.h" -#include "flutter/sky/engine/core/rendering/style/OutlineValue.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" -#include "flutter/sky/engine/core/rendering/style/ShapeValue.h" -#include "flutter/sky/engine/core/rendering/style/StyleBackgroundData.h" -#include "flutter/sky/engine/core/rendering/style/StyleBoxData.h" -#include "flutter/sky/engine/core/rendering/style/StyleDifference.h" -#include "flutter/sky/engine/core/rendering/style/StyleFilterData.h" -#include "flutter/sky/engine/core/rendering/style/StyleFlexibleBoxData.h" -#include "flutter/sky/engine/core/rendering/style/StyleInheritedData.h" -#include "flutter/sky/engine/core/rendering/style/StyleRareInheritedData.h" -#include "flutter/sky/engine/core/rendering/style/StyleRareNonInheritedData.h" -#include "flutter/sky/engine/core/rendering/style/StyleSurroundData.h" -#include "flutter/sky/engine/core/rendering/style/StyleTransformData.h" -#include "flutter/sky/engine/core/rendering/style/StyleVisualData.h" -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/platform/LengthBox.h" -#include "flutter/sky/engine/platform/LengthSize.h" -#include "flutter/sky/engine/platform/fonts/FontBaseline.h" -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/platform/geometry/FloatRoundedRect.h" -#include "flutter/sky/engine/platform/geometry/LayoutBoxExtent.h" -#include "flutter/sky/engine/platform/geometry/RoundedRect.h" -#include "flutter/sky/engine/platform/graphics/Color.h" -#include "flutter/sky/engine/platform/graphics/GraphicsTypes.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" -#include "flutter/sky/engine/platform/text/UnicodeBidi.h" -#include "flutter/sky/engine/platform/transforms/TransformOperations.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/Vector.h" - -template -inline bool compareEqual(const T& t, const U& u) { - return t == static_cast(u); -} - -#define SET_VAR(group, variable, value) \ - if (!compareEqual(group->variable, value)) \ - group.access()->variable = value - -#define SET_VAR_WITH_SETTER(group, getter, setter, value) \ - if (!compareEqual(group->getter(), value)) \ - group.access()->setter(value) - -#define SET_BORDERVALUE_COLOR(group, variable, value) \ - if (!compareEqual(group->variable.color(), value)) \ - group.access()->variable.setColor(value) - -namespace blink { - -using std::max; - -class AppliedTextDecoration; -class BorderData; -class Font; -class FontMetrics; -class ShadowList; -class StyleImage; -class StyleInheritedData; -class StyleResolver; -class TransformationMatrix; - -class RenderStyle : public RefCounted { - friend class EditingStyle; // Editing has to only reveal unvisited info. - friend class CSSComputedStyleDeclaration; // Ignores visited styles, so needs - // to be able to see unvisited - // info. - friend class StyleBuilderFunctions; // Sets color styles - - // FIXME: When we stop resolving currentColor at style time, these can be - // removed. - friend class CSSToStyleMap; - friend class FilterOperationResolver; - friend class StyleBuilderConverter; - friend class StyleResolverState; - friend class StyleResolver; - - protected: - // non-inherited attributes - DataRef m_box; - DataRef visual; - DataRef m_background; - DataRef surround; - DataRef rareNonInheritedData; - - // inherited attributes - DataRef rareInheritedData; - DataRef inherited; - - // !START SYNC!: Keep this in sync with the copy constructor in - // RenderStyle.cpp and implicitlyInherited() in StyleResolver.cpp - - // inherit - struct InheritedFlags { - bool operator==(const InheritedFlags& other) const { - return (_visibility == other._visibility) && - (_text_align == other._text_align) && - (m_textUnderline == other.m_textUnderline) && - (_direction == other._direction) && - (_white_space == other._white_space) && - (m_rtlOrdering == other.m_rtlOrdering) && - (_pointerEvents == other._pointerEvents); - } - - bool operator!=(const InheritedFlags& other) const { - return !(*this == other); - } - - unsigned _visibility : 2; // EVisibility - unsigned _text_align : 4; // ETextAlign - unsigned m_textUnderline : 1; - unsigned _direction : 1; // TextDirection - unsigned _white_space : 3; // EWhiteSpace - - // non CSS2 inherited - unsigned m_rtlOrdering : 1; // Order - unsigned _pointerEvents : 4; // EPointerEvents - - // 19 bits - } inherited_flags; - - // don't inherit - struct NonInheritedFlags { - bool operator==(const NonInheritedFlags& other) const { - return effectiveDisplay == other.effectiveDisplay && - originalDisplay == other.originalDisplay && - overflowX == other.overflowX && overflowY == other.overflowY && - verticalAlign == other.verticalAlign && - position == other.position && styleType == other.styleType && - affectedByFocus == other.affectedByFocus && - affectedByHover == other.affectedByHover && - affectedByActive == other.affectedByActive && - unicodeBidi == other.unicodeBidi && - explicitInheritance == other.explicitInheritance && - currentColor == other.currentColor && unique == other.unique && - emptyState == other.emptyState && - firstChildState == other.firstChildState && - lastChildState == other.lastChildState && isLink == other.isLink; - } - - bool operator!=(const NonInheritedFlags& other) const { - return !(*this == other); - } - - unsigned effectiveDisplay : 5; // EDisplay - unsigned originalDisplay : 5; // EDisplay - unsigned overflowX : 3; // EOverflow - unsigned overflowY : 3; // EOverflow - unsigned verticalAlign : 4; // EVerticalAlign - unsigned position : 1; // EPosition - unsigned unicodeBidi : 3; // EUnicodeBidi - - // This is set if we used viewport units when resolving a length. - // It is mutable so we can pass around const RenderStyles to resolve - // lengths. - mutable unsigned hasViewportUnits : 1; - - // 32 bits - - unsigned styleType : 6; // PseudoId - unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited - // property - unsigned - currentColor : 1; // At least one color has the value 'currentColor' - unsigned unique : 1; // Style can not be shared. - - unsigned emptyState : 1; - unsigned firstChildState : 1; - unsigned lastChildState : 1; - - unsigned affectedByFocus : 1; - unsigned affectedByHover : 1; - unsigned affectedByActive : 1; - - unsigned isLink : 1; - // If you add more style bits here, you will also need to update - // RenderStyle::copyNonInheritedFrom() 63 bits - } noninherited_flags; - - // !END SYNC! - - protected: - void setBitDefaults() { - inherited_flags._visibility = initialVisibility(); - inherited_flags._text_align = initialTextAlign(); - inherited_flags.m_textUnderline = false; - inherited_flags._direction = initialDirection(); - inherited_flags._white_space = initialWhiteSpace(); - inherited_flags.m_rtlOrdering = initialRTLOrdering(); - inherited_flags._pointerEvents = initialPointerEvents(); - - noninherited_flags.effectiveDisplay = noninherited_flags.originalDisplay = - initialDisplay(); - noninherited_flags.overflowX = initialOverflowX(); - noninherited_flags.overflowY = initialOverflowY(); - noninherited_flags.verticalAlign = initialVerticalAlign(); - noninherited_flags.position = initialPosition(); - noninherited_flags.unicodeBidi = initialUnicodeBidi(); - noninherited_flags.explicitInheritance = false; - noninherited_flags.currentColor = false; - noninherited_flags.unique = false; - noninherited_flags.emptyState = false; - noninherited_flags.firstChildState = false; - noninherited_flags.lastChildState = false; - noninherited_flags.hasViewportUnits = false; - noninherited_flags.affectedByFocus = false; - noninherited_flags.affectedByHover = false; - noninherited_flags.affectedByActive = false; - noninherited_flags.isLink = false; - } - - private: - ALWAYS_INLINE RenderStyle(); - - enum DefaultStyleTag { DefaultStyle }; - ALWAYS_INLINE explicit RenderStyle(DefaultStyleTag); - ALWAYS_INLINE RenderStyle(const RenderStyle&); - - public: - static PassRefPtr create(); - static PassRefPtr createDefaultStyle(); - static PassRefPtr clone(const RenderStyle*); - - // Computes how the style change should be propagated down the tree. - static StyleRecalcChange stylePropagationDiff(const RenderStyle* oldStyle, - const RenderStyle* newStyle); - - StyleDifference visualInvalidationDiff(const RenderStyle&) const; - - void inheritFrom(const RenderStyle* inheritParent); - void copyNonInheritedFrom(const RenderStyle*); - - void setHasViewportUnits(bool hasViewportUnits = true) const { - noninherited_flags.hasViewportUnits = hasViewportUnits; - } - bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits; } - - bool affectedByFocus() const { return noninherited_flags.affectedByFocus; } - bool affectedByHover() const { return noninherited_flags.affectedByHover; } - bool affectedByActive() const { return noninherited_flags.affectedByActive; } - - void setAffectedByFocus() { noninherited_flags.affectedByFocus = true; } - void setAffectedByHover() { noninherited_flags.affectedByHover = true; } - void setAffectedByActive() { noninherited_flags.affectedByActive = true; } - - bool operator==(const RenderStyle& other) const; - bool operator!=(const RenderStyle& other) const { return !(*this == other); } - bool hasMargin() const { return surround->margin.nonZero(); } - bool hasBorder() const { return surround->border.hasBorder(); } - bool hasPadding() const { return surround->padding.nonZero(); } - bool hasOffset() const { return surround->offset.nonZero(); } - bool hasMarginBeforeQuirk() const { return marginBefore().quirk(); } - bool hasMarginAfterQuirk() const { return marginAfter().quirk(); } - - bool hasBackgroundImage() const { - return m_background->background().hasImage(); - } - bool hasFixedBackgroundImage() const { - return m_background->background().hasFixedImage(); - } - - bool hasEntirelyFixedBackground() const; - - bool hasBackground() const { - Color color = resolveColor(backgroundColor()); - if (color.alpha()) - return true; - return hasBackgroundImage(); - } - - Order rtlOrdering() const { - return static_cast(inherited_flags.m_rtlOrdering); - } - void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; } - - // attribute getter methods - - EDisplay display() const { - return static_cast(noninherited_flags.effectiveDisplay); - } - EDisplay originalDisplay() const { - return static_cast(noninherited_flags.originalDisplay); - } - - const Length& left() const { return surround->offset.left(); } - const Length& right() const { return surround->offset.right(); } - const Length& top() const { return surround->offset.top(); } - const Length& bottom() const { return surround->offset.bottom(); } - - // Accessors for positioned object edges that take into account writing mode. - const Length& logicalLeft() const { return surround->offset.logicalLeft(); } - const Length& logicalRight() const { return surround->offset.logicalRight(); } - const Length& logicalTop() const { return surround->offset.before(); } - const Length& logicalBottom() const { return surround->offset.after(); } - - // Whether or not a positioned element requires normal flow x/y to be computed - // to determine its position. - bool hasAutoLeftAndRight() const { - return left().isAuto() && right().isAuto(); - } - bool hasAutoTopAndBottom() const { - return top().isAuto() && bottom().isAuto(); - } - - EPosition position() const { - return static_cast(noninherited_flags.position); - } - bool hasOutOfFlowPosition() const { return position() == AbsolutePosition; } - // FIXME(sky): Remove - bool hasInFlowPosition() const { return false; } - - const Length& width() const { return m_box->width(); } - const Length& height() const { return m_box->height(); } - const Length& minWidth() const { return m_box->minWidth(); } - const Length& maxWidth() const { return m_box->maxWidth(); } - const Length& minHeight() const { return m_box->minHeight(); } - const Length& maxHeight() const { return m_box->maxHeight(); } - - const Length& logicalWidth() const { return width(); } - const Length& logicalHeight() const { return height(); } - const Length& logicalMinWidth() const { return minWidth(); } - const Length& logicalMaxWidth() const { return maxWidth(); } - const Length& logicalMinHeight() const { return minHeight(); } - const Length& logicalMaxHeight() const { return maxHeight(); } - - const BorderData& border() const { return surround->border; } - const BorderValue& borderLeft() const { return surround->border.left(); } - const BorderValue& borderRight() const { return surround->border.right(); } - const BorderValue& borderTop() const { return surround->border.top(); } - const BorderValue& borderBottom() const { return surround->border.bottom(); } - - const BorderValue& borderBefore() const; - const BorderValue& borderAfter() const; - const BorderValue& borderStart() const; - const BorderValue& borderEnd() const; - - const LengthSize& borderTopLeftRadius() const { - return surround->border.topLeft(); - } - const LengthSize& borderTopRightRadius() const { - return surround->border.topRight(); - } - const LengthSize& borderBottomLeftRadius() const { - return surround->border.bottomLeft(); - } - const LengthSize& borderBottomRightRadius() const { - return surround->border.bottomRight(); - } - bool hasBorderRadius() const { return surround->border.hasBorderRadius(); } - - unsigned borderLeftWidth() const { - return surround->border.borderLeftWidth(); - } - EBorderStyle borderLeftStyle() const { - return surround->border.left().style(); - } - bool borderLeftIsTransparent() const { - return surround->border.left().isTransparent(); - } - unsigned borderRightWidth() const { - return surround->border.borderRightWidth(); - } - EBorderStyle borderRightStyle() const { - return surround->border.right().style(); - } - bool borderRightIsTransparent() const { - return surround->border.right().isTransparent(); - } - unsigned borderTopWidth() const { return surround->border.borderTopWidth(); } - EBorderStyle borderTopStyle() const { return surround->border.top().style(); } - bool borderTopIsTransparent() const { - return surround->border.top().isTransparent(); - } - unsigned borderBottomWidth() const { - return surround->border.borderBottomWidth(); - } - EBorderStyle borderBottomStyle() const { - return surround->border.bottom().style(); - } - bool borderBottomIsTransparent() const { - return surround->border.bottom().isTransparent(); - } - - unsigned short borderBeforeWidth() const; - unsigned short borderAfterWidth() const; - unsigned short borderStartWidth() const; - unsigned short borderEndWidth() const; - - unsigned short outlineSize() const { - return max(0, outlineWidth() + outlineOffset()); - } - unsigned short outlineWidth() const { - if (m_background->outline().style() == BNONE) - return 0; - return m_background->outline().width(); - } - bool hasOutline() const { - return outlineWidth() > 0 && outlineStyle() > BHIDDEN; - } - EBorderStyle outlineStyle() const { return m_background->outline().style(); } - OutlineIsAuto outlineStyleIsAuto() const { - return static_cast(m_background->outline().isAuto()); - } - - EOverflow overflowX() const { - return static_cast(noninherited_flags.overflowX); - } - EOverflow overflowY() const { - return static_cast(noninherited_flags.overflowY); - } - // It's sufficient to just check one direction, since it's illegal to have - // visible on only one overflow value. - bool isOverflowVisible() const { - ASSERT(overflowX() != OVISIBLE || overflowX() == overflowY()); - return overflowX() == OVISIBLE; - } - bool isOverflowPaged() const { - return overflowY() == OPAGEDX || overflowY() == OPAGEDY; - } - - EVerticalAlign verticalAlign() const { - return static_cast(noninherited_flags.verticalAlign); - } - const Length& verticalAlignLength() const { return m_box->verticalAlign(); } - - const Length& clipLeft() const { return visual->clip.left(); } - const Length& clipRight() const { return visual->clip.right(); } - const Length& clipTop() const { return visual->clip.top(); } - const Length& clipBottom() const { return visual->clip.bottom(); } - const LengthBox& clip() const { return visual->clip; } - bool hasAutoClip() const { return visual->hasAutoClip; } - - EUnicodeBidi unicodeBidi() const { - return static_cast(noninherited_flags.unicodeBidi); - } - - const Font& font() const; - const FontMetrics& fontMetrics() const; - const FontDescription& fontDescription() const; - float specifiedFontSize() const; - float computedFontSize() const; - int fontSize() const; - FontWeight fontWeight() const; - FontStretch fontStretch() const; - - const Length& textIndent() const { return rareInheritedData->indent; } - TextIndentLine textIndentLine() const { - return static_cast(rareInheritedData->m_textIndentLine); - } - TextIndentType textIndentType() const { - return static_cast(rareInheritedData->m_textIndentType); - } - ETextAlign textAlign() const { - return static_cast(inherited_flags._text_align); - } - TextAlignLast textAlignLast() const { - return static_cast(rareInheritedData->m_textAlignLast); - } - TextJustify textJustify() const { - return static_cast(rareInheritedData->m_textJustify); - } - TextDecoration textDecorationsInEffect() const; - const Vector& appliedTextDecorations() const; - TextDecoration textDecoration() const { - return static_cast(visual->textDecoration); - } - TextUnderlinePosition textUnderlinePosition() const { - return static_cast( - rareInheritedData->m_textUnderlinePosition); - } - TextDecorationStyle textDecorationStyle() const { - return static_cast( - rareNonInheritedData->m_textDecorationStyle); - } - float wordSpacing() const; - float letterSpacing() const; - - TextDirection direction() const { - return static_cast(inherited_flags._direction); - } - bool isLeftToRightDirection() const { return direction() == LTR; } - - const Length& specifiedLineHeight() const; - Length lineHeight() const; - int computedLineHeight() const; - - EWhiteSpace whiteSpace() const { - return static_cast(inherited_flags._white_space); - } - static bool autoWrap(EWhiteSpace ws) { - // Nowrap and pre don't automatically wrap. - return ws != NOWRAP && ws != PRE; - } - - bool autoWrap() const { return autoWrap(whiteSpace()); } - - static bool preserveNewline(EWhiteSpace ws) { - // Normal and nowrap do not preserve newlines. - return ws != NORMAL && ws != NOWRAP; - } - - bool preserveNewline() const { return preserveNewline(whiteSpace()); } - - static bool collapseWhiteSpace(EWhiteSpace ws) { - // Pre and prewrap do not collapse whitespace. - return ws != PRE && ws != PRE_WRAP; - } - - bool collapseWhiteSpace() const { return collapseWhiteSpace(whiteSpace()); } - - bool isCollapsibleWhiteSpace(UChar c) const { - switch (c) { - case ' ': - case '\t': - return collapseWhiteSpace(); - case '\n': - return !preserveNewline(); - } - return false; - } - - bool breakOnlyAfterWhiteSpace() const { - return whiteSpace() == PRE_WRAP || lineBreak() == LineBreakAfterWhiteSpace; - } - - bool breakWords() const { - return wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflowWrap; - } - - EFillRepeat backgroundRepeatX() const { - return static_cast(m_background->background().repeatX()); - } - EFillRepeat backgroundRepeatY() const { - return static_cast(m_background->background().repeatY()); - } - CompositeOperator backgroundComposite() const { - return static_cast( - m_background->background().composite()); - } - EFillAttachment backgroundAttachment() const { - return static_cast( - m_background->background().attachment()); - } - EFillBox backgroundClip() const { - return static_cast(m_background->background().clip()); - } - EFillBox backgroundOrigin() const { - return static_cast(m_background->background().origin()); - } - const Length& backgroundXPosition() const { - return m_background->background().xPosition(); - } - const Length& backgroundYPosition() const { - return m_background->background().yPosition(); - } - EFillSizeType backgroundSizeType() const { - return m_background->background().sizeType(); - } - const LengthSize& backgroundSizeLength() const { - return m_background->background().sizeLength(); - } - FillLayer& accessBackgroundLayers() { - return m_background.access()->m_background; - } - const FillLayer& backgroundLayers() const { - return m_background->background(); - } - - short horizontalBorderSpacing() const; - short verticalBorderSpacing() const; - - const Length& marginTop() const { return surround->margin.top(); } - const Length& marginBottom() const { return surround->margin.bottom(); } - const Length& marginLeft() const { return surround->margin.left(); } - const Length& marginRight() const { return surround->margin.right(); } - const Length& marginBefore() const { return surround->margin.before(); } - const Length& marginAfter() const { return surround->margin.after(); } - const Length& marginStart() const { - return surround->margin.start(direction()); - } - const Length& marginEnd() const { return surround->margin.end(direction()); } - const Length& marginStartUsing(const RenderStyle* otherStyle) const { - return surround->margin.start(otherStyle->direction()); - } - const Length& marginEndUsing(const RenderStyle* otherStyle) const { - return surround->margin.end(otherStyle->direction()); - } - const Length& marginBeforeUsing(const RenderStyle* otherStyle) const { - return surround->margin.before(); - } - const Length& marginAfterUsing(const RenderStyle* otherStyle) const { - return surround->margin.after(); - } - - const LengthBox& paddingBox() const { return surround->padding; } - const Length& paddingTop() const { return surround->padding.top(); } - const Length& paddingBottom() const { return surround->padding.bottom(); } - const Length& paddingLeft() const { return surround->padding.left(); } - const Length& paddingRight() const { return surround->padding.right(); } - const Length& paddingBefore() const { return surround->padding.before(); } - const Length& paddingAfter() const { return surround->padding.after(); } - const Length& paddingStart() const { - return surround->padding.start(direction()); - } - const Length& paddingEnd() const { - return surround->padding.end(direction()); - } - - bool isLink() const { return noninherited_flags.isLink; } - - // CSS3 Getter Methods - - int outlineOffset() const { - if (m_background->outline().style() == BNONE) - return 0; - return m_background->outline().offset(); - } - - ShadowList* textShadow() const { return rareInheritedData->textShadow.get(); } - void getTextShadowExtent(LayoutUnit& top, - LayoutUnit& right, - LayoutUnit& bottom, - LayoutUnit& left) const { - getShadowExtent(textShadow(), top, right, bottom, left); - } - void getTextShadowHorizontalExtent(LayoutUnit& left, - LayoutUnit& right) const { - getShadowHorizontalExtent(textShadow(), left, right); - } - void getTextShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { - getShadowVerticalExtent(textShadow(), top, bottom); - } - void getTextShadowInlineDirectionExtent(LayoutUnit& logicalLeft, - LayoutUnit& logicalRight) { - getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); - } - void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, - LayoutUnit& logicalBottom) { - getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); - } - - float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; } - float opacity() const { return rareNonInheritedData->opacity; } - bool hasOpacity() const { return opacity() < 1.0f; } - // aspect ratio convenience method - bool hasAspectRatio() const { return rareNonInheritedData->m_hasAspectRatio; } - float aspectRatio() const { - return aspectRatioNumerator() / aspectRatioDenominator(); - } - float aspectRatioDenominator() const { - return rareNonInheritedData->m_aspectRatioDenominator; - } - float aspectRatioNumerator() const { - return rareNonInheritedData->m_aspectRatioNumerator; - } - - int order() const { return rareNonInheritedData->m_order; } - float flexGrow() const { - return rareNonInheritedData->m_flexibleBox->m_flexGrow; - } - float flexShrink() const { - return rareNonInheritedData->m_flexibleBox->m_flexShrink; - } - const Length& flexBasis() const { - return rareNonInheritedData->m_flexibleBox->m_flexBasis; - } - EAlignContent alignContent() const { - return static_cast(rareNonInheritedData->m_alignContent); - } - ItemPosition alignItems() const { - return static_cast(rareNonInheritedData->m_alignItems); - } - OverflowAlignment alignItemsOverflowAlignment() const { - return static_cast( - rareNonInheritedData->m_alignItemsOverflowAlignment); - } - ItemPosition alignSelf() const { - return static_cast(rareNonInheritedData->m_alignSelf); - } - OverflowAlignment alignSelfOverflowAlignment() const { - return static_cast( - rareNonInheritedData->m_alignSelfOverflowAlignment); - } - EFlexDirection flexDirection() const { - return static_cast( - rareNonInheritedData->m_flexibleBox->m_flexDirection); - } - bool isColumnFlexDirection() const { - return flexDirection() == FlowColumn || - flexDirection() == FlowColumnReverse; - } - bool isReverseFlexDirection() const { - return flexDirection() == FlowRowReverse || - flexDirection() == FlowColumnReverse; - } - EFlexWrap flexWrap() const { - return static_cast( - rareNonInheritedData->m_flexibleBox->m_flexWrap); - } - EJustifyContent justifyContent() const { - return static_cast(rareNonInheritedData->m_justifyContent); - } - ItemPosition justifyItems() const { - return static_cast(rareNonInheritedData->m_justifyItems); - } - OverflowAlignment justifyItemsOverflowAlignment() const { - return static_cast( - rareNonInheritedData->m_justifyItemsOverflowAlignment); - } - ItemPositionType justifyItemsPositionType() const { - return static_cast( - rareNonInheritedData->m_justifyItemsPositionType); - } - ItemPosition justifySelf() const { - return static_cast(rareNonInheritedData->m_justifySelf); - } - OverflowAlignment justifySelfOverflowAlignment() const { - return static_cast( - rareNonInheritedData->m_justifySelfOverflowAlignment); - } - - ShadowList* boxShadow() const { - return rareNonInheritedData->m_boxShadow.get(); - } - void getBoxShadowExtent(LayoutUnit& top, - LayoutUnit& right, - LayoutUnit& bottom, - LayoutUnit& left) const { - getShadowExtent(boxShadow(), top, right, bottom, left); - } - LayoutBoxExtent getBoxShadowInsetExtent() const { - return getShadowInsetExtent(boxShadow()); - } - void getBoxShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { - getShadowHorizontalExtent(boxShadow(), left, right); - } - void getBoxShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { - getShadowVerticalExtent(boxShadow(), top, bottom); - } - void getBoxShadowInlineDirectionExtent(LayoutUnit& logicalLeft, - LayoutUnit& logicalRight) { - getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); - } - void getBoxShadowBlockDirectionExtent(LayoutUnit& logicalTop, - LayoutUnit& logicalBottom) { - getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); - } - - EBoxDecorationBreak boxDecorationBreak() const { - return m_box->boxDecorationBreak(); - } - - // FIXME: reflections should belong to this helper function but they are - // currently handled through their self-painting layers. So the rendering code - // doesn't account for them. - bool hasVisualOverflowingEffect() const { - return boxShadow() || hasOutline(); - } - - EBoxSizing boxSizing() const { return m_box->boxSizing(); } - EUserModify userModify() const { - return static_cast(rareInheritedData->userModify); - } - EUserSelect userSelect() const { - return static_cast(rareInheritedData->userSelect); - } - TextOverflow textOverflow() const { - return static_cast(rareNonInheritedData->textOverflow); - } - EWordBreak wordBreak() const { - return static_cast(rareInheritedData->wordBreak); - } - EOverflowWrap overflowWrap() const { - return static_cast(rareInheritedData->overflowWrap); - } - LineBreak lineBreak() const { - return static_cast(rareInheritedData->lineBreak); - } - const AtomicString& highlight() const { return rareInheritedData->highlight; } - const AtomicString& hyphenationString() const { - return rareInheritedData->hyphenationString; - } - const AtomicString& locale() const { return rareInheritedData->locale; } - const TransformOperations& transform() const { - return rareNonInheritedData->m_transform->m_operations; - } - const Length& transformOriginX() const { - return rareNonInheritedData->m_transform->m_x; - } - const Length& transformOriginY() const { - return rareNonInheritedData->m_transform->m_y; - } - float transformOriginZ() const { - return rareNonInheritedData->m_transform->m_z; - } - bool hasTransform() const { - return !rareNonInheritedData->m_transform->m_operations.operations() - .isEmpty(); - } - bool transformDataEquivalent(const RenderStyle& otherStyle) const { - return rareNonInheritedData->m_transform == - otherStyle.rareNonInheritedData->m_transform; - } - - TextEmphasisFill textEmphasisFill() const { - return static_cast(rareInheritedData->textEmphasisFill); - } - TextEmphasisMark textEmphasisMark() const; - const AtomicString& textEmphasisCustomMark() const { - return rareInheritedData->textEmphasisCustomMark; - } - TextEmphasisPosition textEmphasisPosition() const { - return static_cast( - rareInheritedData->textEmphasisPosition); - } - const AtomicString& textEmphasisMarkString() const; - - TextOrientation textOrientation() const { - return static_cast(rareInheritedData->m_textOrientation); - } - - ObjectFit objectFit() const { - return static_cast(rareNonInheritedData->m_objectFit); - } - LengthPoint objectPosition() const { - return rareNonInheritedData->m_objectPosition; - } - - // Return true if any transform related property (currently transform, - // transformStyle3D or perspective) indicates that we are transforming - bool hasTransformRelatedProperty() const { - return hasTransform() || preserves3D() || hasPerspective(); - } - - enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }; - void applyTransform(TransformationMatrix&, - const LayoutSize& borderBoxSize, - ApplyTransformOrigin = IncludeTransformOrigin) const; - void applyTransform(TransformationMatrix&, - const FloatRect& boundingBox, - ApplyTransformOrigin = IncludeTransformOrigin) const; - - unsigned tabSize() const { return rareInheritedData->m_tabSize; } - - // End CSS3 Getters - - WrapFlow wrapFlow() const { - return static_cast(rareNonInheritedData->m_wrapFlow); - } - WrapThrough wrapThrough() const { - return static_cast(rareNonInheritedData->m_wrapThrough); - } - - // Apple-specific property getter methods - EPointerEvents pointerEvents() const { - return static_cast(inherited_flags._pointerEvents); - } - - ETransformStyle3D transformStyle3D() const { - return static_cast( - rareNonInheritedData->m_transformStyle3D); - } - bool preserves3D() const { - return rareNonInheritedData->m_transformStyle3D == - TransformStyle3DPreserve3D; - } - - float perspective() const { return rareNonInheritedData->m_perspective; } - bool hasPerspective() const { - return rareNonInheritedData->m_perspective > 0; - } - const Length& perspectiveOriginX() const { - return rareNonInheritedData->m_perspectiveOriginX; - } - const Length& perspectiveOriginY() const { - return rareNonInheritedData->m_perspectiveOriginY; - } - - LineBoxContain lineBoxContain() const { - return rareInheritedData->m_lineBoxContain; - } - Color tapHighlightColor() const { - return rareInheritedData->tapHighlightColor; - } - - EImageRendering imageRendering() const { - return static_cast(rareInheritedData->m_imageRendering); - } - - TouchAction touchAction() const { - return static_cast(rareNonInheritedData->m_touchAction); - } - TouchActionDelay touchActionDelay() const { - return static_cast(rareInheritedData->m_touchActionDelay); - } - - // Flutter property getters - const AtomicString& ellipsis() const { - return rareNonInheritedData->m_ellipsis; - } - int maxLines() const { return rareNonInheritedData->m_maxLines; } - - // attribute setter methods - - void setDisplay(EDisplay v) { noninherited_flags.effectiveDisplay = v; } - void setOriginalDisplay(EDisplay v) { - noninherited_flags.originalDisplay = v; - } - void setPosition(EPosition v) { noninherited_flags.position = v; } - - void setLeft(const Length& v) { SET_VAR(surround, offset.m_left, v); } - void setRight(const Length& v) { SET_VAR(surround, offset.m_right, v); } - void setTop(const Length& v) { SET_VAR(surround, offset.m_top, v); } - void setBottom(const Length& v) { SET_VAR(surround, offset.m_bottom, v); } - - void setWidth(const Length& v) { SET_VAR(m_box, m_width, v); } - void setHeight(const Length& v) { SET_VAR(m_box, m_height, v); } - - void setLogicalWidth(const Length& v) { - // FIXME(sky): Remove - SET_VAR(m_box, m_width, v); - } - - void setLogicalHeight(const Length& v) { - // FIXME(sky): Remove - SET_VAR(m_box, m_height, v); - } - - void setMinWidth(const Length& v) { SET_VAR(m_box, m_minWidth, v); } - void setMaxWidth(const Length& v) { SET_VAR(m_box, m_maxWidth, v); } - void setMinHeight(const Length& v) { SET_VAR(m_box, m_minHeight, v); } - void setMaxHeight(const Length& v) { SET_VAR(m_box, m_maxHeight, v); } - - void resetBorder() { - resetBorderTop(); - resetBorderRight(); - resetBorderBottom(); - resetBorderLeft(); - resetBorderTopLeftRadius(); - resetBorderTopRightRadius(); - resetBorderBottomLeftRadius(); - resetBorderBottomRightRadius(); - } - void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()); } - void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()); } - void resetBorderBottom() { - SET_VAR(surround, border.m_bottom, BorderValue()); - } - void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()); } - void resetBorderTopLeftRadius() { - SET_VAR(surround, border.m_topLeft, initialBorderRadius()); - } - void resetBorderTopRightRadius() { - SET_VAR(surround, border.m_topRight, initialBorderRadius()); - } - void resetBorderBottomLeftRadius() { - SET_VAR(surround, border.m_bottomLeft, initialBorderRadius()); - } - void resetBorderBottomRightRadius() { - SET_VAR(surround, border.m_bottomRight, initialBorderRadius()); - } - - void setBackgroundColor(const StyleColor& v) { - SET_VAR(m_background, m_color, v); - } - - void setBackgroundXPosition(const Length& length) { - SET_VAR(m_background, m_background.m_xPosition, length); - } - void setBackgroundYPosition(const Length& length) { - SET_VAR(m_background, m_background.m_yPosition, length); - } - void setBackgroundSize(EFillSizeType b) { - SET_VAR(m_background, m_background.m_sizeType, b); - } - void setBackgroundSizeLength(const LengthSize& s) { - SET_VAR(m_background, m_background.m_sizeLength, s); - } - - void setBorderTopLeftRadius(const LengthSize& s) { - SET_VAR(surround, border.m_topLeft, s); - } - void setBorderTopRightRadius(const LengthSize& s) { - SET_VAR(surround, border.m_topRight, s); - } - void setBorderBottomLeftRadius(const LengthSize& s) { - SET_VAR(surround, border.m_bottomLeft, s); - } - void setBorderBottomRightRadius(const LengthSize& s) { - SET_VAR(surround, border.m_bottomRight, s); - } - - void setBorderRadius(const LengthSize& s) { - setBorderTopLeftRadius(s); - setBorderTopRightRadius(s); - setBorderBottomLeftRadius(s); - setBorderBottomRightRadius(s); - } - void setBorderRadius(const IntSize& s) { - setBorderRadius( - LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed))); - } - - RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, - bool includeLogicalLeftEdge = true, - bool includeLogicalRightEdge = true) const; - RoundedRect getRoundedInnerBorderFor( - const LayoutRect& borderRect, - bool includeLogicalLeftEdge = true, - bool includeLogicalRightEdge = true) const; - - RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, - int topWidth, - int bottomWidth, - int leftWidth, - int rightWidth, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) const; - - void setBorderLeftWidth(unsigned v) { - SET_VAR(surround, border.m_left.m_width, v); - } - void setBorderLeftStyle(EBorderStyle v) { - SET_VAR(surround, border.m_left.m_style, v); - } - void setBorderLeftColor(const StyleColor& v) { - SET_BORDERVALUE_COLOR(surround, border.m_left, v); - } - void setBorderRightWidth(unsigned v) { - SET_VAR(surround, border.m_right.m_width, v); - } - void setBorderRightStyle(EBorderStyle v) { - SET_VAR(surround, border.m_right.m_style, v); - } - void setBorderRightColor(const StyleColor& v) { - SET_BORDERVALUE_COLOR(surround, border.m_right, v); - } - void setBorderTopWidth(unsigned v) { - SET_VAR(surround, border.m_top.m_width, v); - } - void setBorderTopStyle(EBorderStyle v) { - SET_VAR(surround, border.m_top.m_style, v); - } - void setBorderTopColor(const StyleColor& v) { - SET_BORDERVALUE_COLOR(surround, border.m_top, v); - } - void setBorderBottomWidth(unsigned v) { - SET_VAR(surround, border.m_bottom.m_width, v); - } - void setBorderBottomStyle(EBorderStyle v) { - SET_VAR(surround, border.m_bottom.m_style, v); - } - void setBorderBottomColor(const StyleColor& v) { - SET_BORDERVALUE_COLOR(surround, border.m_bottom, v); - } - - void setOutlineWidth(unsigned short v) { - SET_VAR(m_background, m_outline.m_width, v); - } - void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { - SET_VAR(m_background, m_outline.m_isAuto, isAuto); - } - void setOutlineStyle(EBorderStyle v) { - SET_VAR(m_background, m_outline.m_style, v); - } - void setOutlineColor(const StyleColor& v) { - SET_BORDERVALUE_COLOR(m_background, m_outline, v); - } - - void setOverflowX(EOverflow v) { noninherited_flags.overflowX = v; } - void setOverflowY(EOverflow v) { noninherited_flags.overflowY = v; } - void setVisibility(EVisibility v) { inherited_flags._visibility = v; } - void setVerticalAlign(EVerticalAlign v) { - noninherited_flags.verticalAlign = v; - } - void setVerticalAlignLength(const Length& length) { - setVerticalAlign(LENGTH); - SET_VAR(m_box, m_verticalAlign, length); - } - - void setHasAutoClip() { - SET_VAR(visual, hasAutoClip, true); - SET_VAR(visual, clip, RenderStyle::initialClip()); - } - void setClip(const LengthBox& box) { - SET_VAR(visual, hasAutoClip, false); - SET_VAR(visual, clip, box); - } - - void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags.unicodeBidi = b; } - - bool setFontDescription(const FontDescription&); - // Only used for text autosizing. - void setFontSize(float); - void setFontStretch(FontStretch); - void setFontWeight(FontWeight); - - void setColor(const Color&); - void setTextIndent(const Length& v) { SET_VAR(rareInheritedData, indent, v); } - void setTextIndentLine(TextIndentLine v) { - SET_VAR(rareInheritedData, m_textIndentLine, v); - } - void setTextIndentType(TextIndentType v) { - SET_VAR(rareInheritedData, m_textIndentType, v); - } - void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } - void setTextAlignLast(TextAlignLast v) { - SET_VAR(rareInheritedData, m_textAlignLast, v); - } - void setTextJustify(TextJustify v) { - SET_VAR(rareInheritedData, m_textJustify, v); - } - void applyTextDecorations(); - void clearAppliedTextDecorations(); - void setTextDecoration(TextDecoration v) { - SET_VAR(visual, textDecoration, v); - } - void setTextUnderlinePosition(TextUnderlinePosition v) { - SET_VAR(rareInheritedData, m_textUnderlinePosition, v); - } - void setTextDecorationStyle(TextDecorationStyle v) { - SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); - } - void setDirection(TextDirection v) { inherited_flags._direction = v; } - void setLineHeight(const Length& specifiedLineHeight); - - void setImageRendering(EImageRendering v) { - SET_VAR(rareInheritedData, m_imageRendering, v); - } - - void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; } - - // FIXME: Remove these two and replace them with respective FontBuilder calls. - void setWordSpacing(float); - void setLetterSpacing(float); - - void adjustBackgroundLayers() { - if (backgroundLayers().next()) { - accessBackgroundLayers().cullEmptyLayers(); - accessBackgroundLayers().fillUnsetProperties(); - } - } - - void setHorizontalBorderSpacing(short); - void setVerticalBorderSpacing(short); - - void setHasAspectRatio(bool b) { - SET_VAR(rareNonInheritedData, m_hasAspectRatio, b); - } - void setAspectRatioDenominator(float v) { - SET_VAR(rareNonInheritedData, m_aspectRatioDenominator, v); - } - void setAspectRatioNumerator(float v) { - SET_VAR(rareNonInheritedData, m_aspectRatioNumerator, v); - } - - void setMarginTop(const Length& v) { SET_VAR(surround, margin.m_top, v); } - void setMarginBottom(const Length& v) { - SET_VAR(surround, margin.m_bottom, v); - } - void setMarginLeft(const Length& v) { SET_VAR(surround, margin.m_left, v); } - void setMarginRight(const Length& v) { SET_VAR(surround, margin.m_right, v); } - void setMarginStart(const Length&); - void setMarginEnd(const Length&); - - void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)); } - void setPaddingBox(const LengthBox& b) { SET_VAR(surround, padding, b); } - void setPaddingTop(const Length& v) { SET_VAR(surround, padding.m_top, v); } - void setPaddingBottom(const Length& v) { - SET_VAR(surround, padding.m_bottom, v); - } - void setPaddingLeft(const Length& v) { SET_VAR(surround, padding.m_left, v); } - void setPaddingRight(const Length& v) { - SET_VAR(surround, padding.m_right, v); - } - - void setIsLink(bool b) { noninherited_flags.isLink = b; } - - bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); } - void setHasAutoZIndex() { - SET_VAR(m_box, m_hasAutoZIndex, true); - SET_VAR(m_box, m_zIndex, 0); - } - unsigned zIndex() const { return m_box->zIndex(); } - void setZIndex(unsigned v) { - SET_VAR(m_box, m_hasAutoZIndex, false); - SET_VAR(m_box, m_zIndex, v); - } - - // CSS3 Setters - void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v); } - void setTextShadow(PassRefPtr); - void setTextStrokeColor(const StyleColor& c) { - SET_VAR_WITH_SETTER(rareInheritedData, textStrokeColor, setTextStrokeColor, - c); - } - void setTextStrokeWidth(float w) { - SET_VAR(rareInheritedData, textStrokeWidth, w); - } - void setTextFillColor(const StyleColor& c) { - SET_VAR_WITH_SETTER(rareInheritedData, textFillColor, setTextFillColor, c); - } - void setOpacity(float f) { - float v = clampTo(f, 0, 1); - SET_VAR(rareNonInheritedData, opacity, v); - } - // For valid values of box-align see - // http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment - void setBoxDecorationBreak(EBoxDecorationBreak b) { - SET_VAR(m_box, m_boxDecorationBreak, b); - } - void setBoxShadow(PassRefPtr); - void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); } - void setFlexGrow(float f) { - SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexGrow, f); - } - void setFlexShrink(float f) { - SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexShrink, f); - } - void setFlexBasis(const Length& length) { - SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexBasis, length); - } - // We restrict the smallest value to int min + 2 because we use int min and - // int min + 1 as special values in a hash set. - void setOrder(int o) { - SET_VAR(rareNonInheritedData, m_order, - max(std::numeric_limits::min() + 2, o)); - } - void setAlignContent(EAlignContent p) { - SET_VAR(rareNonInheritedData, m_alignContent, p); - } - void setAlignItems(ItemPosition a) { - SET_VAR(rareNonInheritedData, m_alignItems, a); - } - void setAlignItemsOverflowAlignment(OverflowAlignment overflowAlignment) { - SET_VAR(rareNonInheritedData, m_alignItemsOverflowAlignment, - overflowAlignment); - } - void setAlignSelf(ItemPosition a) { - SET_VAR(rareNonInheritedData, m_alignSelf, a); - } - void setAlignSelfOverflowAlignment(OverflowAlignment overflowAlignment) { - SET_VAR(rareNonInheritedData, m_alignSelfOverflowAlignment, - overflowAlignment); - } - void setFlexDirection(EFlexDirection direction) { - SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexDirection, - direction); - } - void setFlexWrap(EFlexWrap w) { - SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexWrap, w); - } - void setJustifyContent(EJustifyContent p) { - SET_VAR(rareNonInheritedData, m_justifyContent, p); - } - void setJustifyItems(ItemPosition justifyItems) { - SET_VAR(rareNonInheritedData, m_justifyItems, justifyItems); - } - void setJustifyItemsOverflowAlignment(OverflowAlignment overflowAlignment) { - SET_VAR(rareNonInheritedData, m_justifyItemsOverflowAlignment, - overflowAlignment); - } - void setJustifyItemsPositionType(ItemPositionType positionType) { - SET_VAR(rareNonInheritedData, m_justifyItemsPositionType, positionType); - } - void setJustifySelf(ItemPosition justifySelf) { - SET_VAR(rareNonInheritedData, m_justifySelf, justifySelf); - } - void setJustifySelfOverflowAlignment(OverflowAlignment overflowAlignment) { - SET_VAR(rareNonInheritedData, m_justifySelfOverflowAlignment, - overflowAlignment); - } - - void setUserModify(EUserModify u) { - SET_VAR(rareInheritedData, userModify, u); - } - void setUserSelect(EUserSelect s) { - SET_VAR(rareInheritedData, userSelect, s); - } - void setTextOverflow(TextOverflow overflow) { - SET_VAR(rareNonInheritedData, textOverflow, overflow); - } - void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); } - void setOverflowWrap(EOverflowWrap b) { - SET_VAR(rareInheritedData, overflowWrap, b); - } - void setLineBreak(LineBreak b) { SET_VAR(rareInheritedData, lineBreak, b); } - void setHighlight(const AtomicString& h) { - SET_VAR(rareInheritedData, highlight, h); - } - void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); } - void setHyphenationString(const AtomicString& h) { - SET_VAR(rareInheritedData, hyphenationString, h); - } - void setLocale(const AtomicString& locale) { - SET_VAR(rareInheritedData, locale, locale); - } - void setTransform(const TransformOperations& ops) { - SET_VAR(rareNonInheritedData.access()->m_transform, m_operations, ops); - } - void setTransformOriginX(const Length& l) { - SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); - } - void setTransformOriginY(const Length& l) { - SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); - } - void setTransformOriginZ(float f) { - SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); - } - void setTextDecorationColor(const StyleColor& c) { - SET_VAR(rareNonInheritedData, m_textDecorationColor, c); - } - void setTextEmphasisColor(const StyleColor& c) { - SET_VAR_WITH_SETTER(rareInheritedData, textEmphasisColor, - setTextEmphasisColor, c); - } - void setTextEmphasisFill(TextEmphasisFill fill) { - SET_VAR(rareInheritedData, textEmphasisFill, fill); - } - void setTextEmphasisMark(TextEmphasisMark mark) { - SET_VAR(rareInheritedData, textEmphasisMark, mark); - } - void setTextEmphasisCustomMark(const AtomicString& mark) { - SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); - } - void setTextEmphasisPosition(TextEmphasisPosition position) { - SET_VAR(rareInheritedData, textEmphasisPosition, position); - } - bool setTextOrientation(TextOrientation); - - void setObjectFit(ObjectFit f) { - SET_VAR(rareNonInheritedData, m_objectFit, f); - } - void setObjectPosition(LengthPoint position) { - SET_VAR(rareNonInheritedData, m_objectPosition, position); - } - - void setTabSize(unsigned size) { - SET_VAR(rareInheritedData, m_tabSize, size); - } - - // End CSS3 Setters - - void setWrapFlow(WrapFlow wrapFlow) { - SET_VAR(rareNonInheritedData, m_wrapFlow, wrapFlow); - } - void setWrapThrough(WrapThrough wrapThrough) { - SET_VAR(rareNonInheritedData, m_wrapThrough, wrapThrough); - } - - // Apple-specific property setters - void setPointerEvents(EPointerEvents p) { - inherited_flags._pointerEvents = p; - } - - void setTransformStyle3D(ETransformStyle3D b) { - SET_VAR(rareNonInheritedData, m_transformStyle3D, b); - } - void setPerspective(float p) { - SET_VAR(rareNonInheritedData, m_perspective, p); - } - void setPerspectiveOriginX(const Length& l) { - SET_VAR(rareNonInheritedData, m_perspectiveOriginX, l); - } - void setPerspectiveOriginY(const Length& l) { - SET_VAR(rareNonInheritedData, m_perspectiveOriginY, l); - } - - void setLineBoxContain(LineBoxContain c) { - SET_VAR(rareInheritedData, m_lineBoxContain, c); - } - void setTapHighlightColor(const Color& c) { - SET_VAR(rareInheritedData, tapHighlightColor, c); - } - void setTouchAction(TouchAction t) { - SET_VAR(rareNonInheritedData, m_touchAction, t); - } - void setTouchActionDelay(TouchActionDelay t) { - SET_VAR(rareInheritedData, m_touchActionDelay, t); - } - - void setClipPath(PassRefPtr operation) { - if (rareNonInheritedData->m_clipPath != operation) - rareNonInheritedData.access()->m_clipPath = operation; - } - ClipPathOperation* clipPath() const { - return rareNonInheritedData->m_clipPath.get(); - } - - // Flutter property setters - void setEllipsis(const AtomicString& e) { - SET_VAR(rareNonInheritedData, m_ellipsis, e); - } - void setMaxLines(int m) { SET_VAR(rareNonInheritedData, m_maxLines, m); } - - static ClipPathOperation* initialClipPath() { return 0; } - - const CounterDirectiveMap* counterDirectives() const; - CounterDirectiveMap& accessCounterDirectives(); - const CounterDirectives getCounterDirectives( - const AtomicString& identifier) const; - - const AtomicString& hyphenString() const; - - bool inheritedNotEqual(const RenderStyle*) const; - bool inheritedDataShared(const RenderStyle*) const; - - bool requiresOnlyBlockChildren() const; - bool isDisplayReplacedType() const { - return isDisplayReplacedType(display()); - } - bool isDisplayInlineType() const { return isDisplayInlineType(display()); } - bool isOriginalDisplayInlineType() const { - return isDisplayInlineType(originalDisplay()); - } - bool isDisplayFlexibleBox() const { return isDisplayFlexibleBox(display()); } - - // A unique style is one that has matches something that makes it impossible - // to share. - bool unique() const { return noninherited_flags.unique; } - void setUnique() { noninherited_flags.unique = true; } - - bool isSharable() const; - - bool emptyState() const { return noninherited_flags.emptyState; } - void setEmptyState(bool b) { - setUnique(); - noninherited_flags.emptyState = b; - } - bool firstChildState() const { return noninherited_flags.firstChildState; } - void setFirstChildState() { - setUnique(); - noninherited_flags.firstChildState = true; - } - bool lastChildState() const { return noninherited_flags.lastChildState; } - void setLastChildState() { - setUnique(); - noninherited_flags.lastChildState = true; - } - - StyleColor decorationStyleColor() const; - Color decorationColor() const; - - void setHasExplicitlyInheritedProperties() { - noninherited_flags.explicitInheritance = true; - } - bool hasExplicitlyInheritedProperties() const { - return noninherited_flags.explicitInheritance; - } - - void setHasCurrentColor() { noninherited_flags.currentColor = true; } - bool hasCurrentColor() const { return noninherited_flags.currentColor; } - - bool hasBoxDecorations() const { - return hasBorder() || hasBorderRadius() || hasOutline() || boxShadow(); - } - - // Initial values for all the properties - static EBorderStyle initialBorderStyle() { return BNONE; } - static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; } - static LengthSize initialBorderRadius() { - return LengthSize(Length(0, Fixed), Length(0, Fixed)); - } - static LengthBox initialClip() { return LengthBox(); } - static TextDirection initialDirection() { return LTR; } - static TextOrientation initialTextOrientation() { - return TextOrientationVerticalRight; - } - static ObjectFit initialObjectFit() { return ObjectFitFill; } - static LengthPoint initialObjectPosition() { - return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); - } - static EDisplay initialDisplay() { return FLEX; } - static EOverflow initialOverflowX() { return OVISIBLE; } - static EOverflow initialOverflowY() { return OVISIBLE; } - static EPosition initialPosition() { return StaticPosition; } - static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } - static EVisibility initialVisibility() { return VISIBLE; } - static EWhiteSpace initialWhiteSpace() { return PRE_WRAP; } - static short initialHorizontalBorderSpacing() { return 0; } - static short initialVerticalBorderSpacing() { return 0; } - static Color initialColor() { return Color::white; } - static unsigned initialBorderWidth() { return 3; } - static unsigned short initialColumnRuleWidth() { return 3; } - static unsigned short initialOutlineWidth() { return 3; } - static float initialLetterWordSpacing() { return 0.0f; } - static Length initialSize() { return Length(); } - static Length initialMinSize() { return Length(Fixed); } - static Length initialMaxSize() { return Length(MaxSizeNone); } - static Length initialOffset() { return Length(); } - static Length initialMargin() { return Length(Fixed); } - static Length initialPadding() { return Length(Fixed); } - static Length initialTextIndent() { return Length(Fixed); } - static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine; } - static TextIndentType initialTextIndentType() { return TextIndentNormal; } - static EVerticalAlign initialVerticalAlign() { return BASELINE; } - static Length initialLineHeight() { return Length(-100.0, Percent); } - static ETextAlign initialTextAlign() { return TASTART; } - static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; } - static TextJustify initialTextJustify() { return TextJustifyAuto; } - static TextDecoration initialTextDecoration() { return TextDecorationNone; } - static TextUnderlinePosition initialTextUnderlinePosition() { - return TextUnderlinePositionAuto; - } - static TextDecorationStyle initialTextDecorationStyle() { - return TextDecorationStyleSolid; - } - static int initialOutlineOffset() { return 0; } - static float initialOpacity() { return 1.0f; } - static EBoxAlignment initialBoxAlign() { return BSTRETCH; } - static EBoxDecorationBreak initialBoxDecorationBreak() { return DSLICE; } - static EBoxDirection initialBoxDirection() { return BNORMAL; } - static EBoxLines initialBoxLines() { return SINGLE; } - static EBoxOrient initialBoxOrient() { return HORIZONTAL; } - static EBoxPack initialBoxPack() { return Start; } - static float initialBoxFlex() { return 0.0f; } - static unsigned initialBoxFlexGroup() { return 1; } - static unsigned initialBoxOrdinalGroup() { return 1; } - static EBoxSizing initialBoxSizing() { return CONTENT_BOX; } - static float initialFlexGrow() { return 0; } - static float initialFlexShrink() { return 0; } - static Length initialFlexBasis() { return Length(Auto); } - static int initialOrder() { return 0; } - static EAlignContent initialAlignContent() { return AlignContentStretch; } - static ItemPosition initialAlignItems() { return ItemPositionStretch; } - static OverflowAlignment initialAlignItemsOverflowAlignment() { - return OverflowAlignmentDefault; - } - static ItemPosition initialAlignSelf() { return ItemPositionAuto; } - static OverflowAlignment initialAlignSelfOverflowAlignment() { - return OverflowAlignmentDefault; - } - static EFlexDirection initialFlexDirection() { return FlowColumn; } - static EFlexWrap initialFlexWrap() { return FlexNoWrap; } - static EJustifyContent initialJustifyContent() { return JustifyFlexStart; } - static ItemPosition initialJustifyItems() { return ItemPositionAuto; } - static OverflowAlignment initialJustifyItemsOverflowAlignment() { - return OverflowAlignmentDefault; - } - static ItemPositionType initialJustifyItemsPositionType() { - return NonLegacyPosition; - } - static ItemPosition initialJustifySelf() { return ItemPositionAuto; } - static OverflowAlignment initialJustifySelfOverflowAlignment() { - return OverflowAlignmentDefault; - } - static EUserModify initialUserModify() { return READ_ONLY; } - static EUserSelect initialUserSelect() { return SELECT_TEXT; } - static TextOverflow initialTextOverflow() { return TextOverflowClip; } - static EWordBreak initialWordBreak() { return NormalWordBreak; } - static EOverflowWrap initialOverflowWrap() { return BreakOverflowWrap; } - static LineBreak initialLineBreak() { return LineBreakAuto; } - static const AtomicString& initialHighlight() { return nullAtom; } - static const AtomicString& initialHyphenationString() { return nullAtom; } - static const AtomicString& initialLocale() { return nullAtom; } - static bool initialHasAspectRatio() { return false; } - static float initialAspectRatioDenominator() { return 1; } - static float initialAspectRatioNumerator() { return 1; } - static Order initialRTLOrdering() { return LogicalOrder; } - static float initialTextStrokeWidth() { return 0; } - static unsigned short initialColumnCount() { return 1; } - static ColumnFill initialColumnFill() { return ColumnFillBalance; } - static const TransformOperations& initialTransform() { - DEFINE_STATIC_LOCAL(TransformOperations, ops, ()); - return ops; - } - static Length initialTransformOriginX() { return Length(50.0, Percent); } - static Length initialTransformOriginY() { return Length(50.0, Percent); } - static EPointerEvents initialPointerEvents() { return PE_AUTO; } - static float initialTransformOriginZ() { return 0; } - static ETransformStyle3D initialTransformStyle3D() { - return TransformStyle3DFlat; - } - static float initialPerspective() { return 0; } - static Length initialPerspectiveOriginX() { return Length(50.0, Percent); } - static Length initialPerspectiveOriginY() { return Length(50.0, Percent); } - static Color initialBackgroundColor() { return Color::transparent; } - static TextEmphasisFill initialTextEmphasisFill() { - return TextEmphasisFillFilled; - } - static TextEmphasisMark initialTextEmphasisMark() { - return TextEmphasisMarkNone; - } - static const AtomicString& initialTextEmphasisCustomMark() { - return nullAtom; - } - static TextEmphasisPosition initialTextEmphasisPosition() { - return TextEmphasisPositionOver; - } - static LineBoxContain initialLineBoxContain() { - return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; - } - static ImageOrientationEnum initialImageOrientation() { - return OriginTopLeft; - } - static EImageRendering initialImageRendering() { return ImageRenderingAuto; } - static ImageResolutionSource initialImageResolutionSource() { - return ImageResolutionSpecified; - } - static ImageResolutionSnap initialImageResolutionSnap() { - return ImageResolutionNoSnap; - } - static float initialImageResolution() { return 1; } - static TouchAction initialTouchAction() { return TouchActionAuto; } - static TouchActionDelay initialTouchActionDelay() { - return TouchActionDelayScript; - } - static ShadowList* initialBoxShadow() { return 0; } - static ShadowList* initialTextShadow() { return 0; } - - static unsigned initialTabSize() { return 8; } - - static WrapFlow initialWrapFlow() { return WrapFlowAuto; } - static WrapThrough initialWrapThrough() { return WrapThroughWrap; } - - // Keep these at the end. - // FIXME: Why? Seems these should all be one big sorted list. - static Color initialTapHighlightColor(); - - Color resolveColor(StyleColor unresolvedColor) const { - return unresolvedColor.resolve(color()); - } - - StyleColor borderLeftColor() const { return surround->border.left().color(); } - StyleColor borderRightColor() const { - return surround->border.right().color(); - } - StyleColor borderTopColor() const { return surround->border.top().color(); } - StyleColor borderBottomColor() const { - return surround->border.bottom().color(); - } - StyleColor backgroundColor() const { return m_background->color(); } - Color color() const; - StyleColor textEmphasisColor() const { - return rareInheritedData->textEmphasisColor(); - } - StyleColor textFillColor() const { - return rareInheritedData->textFillColor(); - } - StyleColor textStrokeColor() const { - return rareInheritedData->textStrokeColor(); - } - - private: - void inheritUnicodeBidiFrom(const RenderStyle* parent) { - noninherited_flags.unicodeBidi = parent->noninherited_flags.unicodeBidi; - } - void getShadowExtent(const ShadowList*, - LayoutUnit& top, - LayoutUnit& right, - LayoutUnit& bottom, - LayoutUnit& left) const; - LayoutBoxExtent getShadowInsetExtent(const ShadowList*) const; - void getShadowHorizontalExtent(const ShadowList*, - LayoutUnit& left, - LayoutUnit& right) const; - void getShadowVerticalExtent(const ShadowList*, - LayoutUnit& top, - LayoutUnit& bottom) const; - void getShadowInlineDirectionExtent(const ShadowList* shadow, - LayoutUnit& logicalLeft, - LayoutUnit& logicalRight) const { - return getShadowHorizontalExtent(shadow, logicalLeft, logicalRight); - } - void getShadowBlockDirectionExtent(const ShadowList* shadow, - LayoutUnit& logicalTop, - LayoutUnit& logicalBottom) const { - return getShadowVerticalExtent(shadow, logicalTop, logicalBottom); - } - - bool isDisplayFlexibleBox(EDisplay display) const { - return display == FLEX || display == INLINE_FLEX; - } - - bool isDisplayReplacedType(EDisplay display) const { - return display == INLINE_FLEX; - } - - bool isDisplayInlineType(EDisplay display) const { - return display == INLINE || isDisplayReplacedType(display); - } - - StyleColor textDecorationColor() const { - return rareNonInheritedData->m_textDecorationColor; - } - - void addAppliedTextDecoration(const AppliedTextDecoration&); - - bool diffNeedsFullLayout(const RenderStyle& other) const; - bool diffNeedsRecompositeLayer(const RenderStyle& other) const; - void updatePropertySpecificDifferences(const RenderStyle& other, - StyleDifference&) const; -}; - -inline bool RenderStyle::isSharable() const { - return !unique(); -} - -inline bool RenderStyle::setTextOrientation(TextOrientation textOrientation) { - if (compareEqual(rareInheritedData->m_textOrientation, textOrientation)) - return false; - - rareInheritedData.access()->m_textOrientation = textOrientation; - return true; -} - -float calcBorderRadiiConstraintScaleFor(const FloatRect&, - const FloatRoundedRect::Radii&); - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLE_H_ diff --git a/sky/engine/core/rendering/style/RenderStyleConstants.h b/sky/engine/core/rendering/style/RenderStyleConstants.h deleted file mode 100644 index 636e9cd6e1aea..0000000000000 --- a/sky/engine/core/rendering/style/RenderStyleConstants.h +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. - * All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. - * (http://www.torchmobile.com/) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLECONSTANTS_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLECONSTANTS_H_ - -#include - -namespace blink { - -enum StyleRecalcChange { - NoChange, - NoInherit, - Inherit, - Force, - Reattach, - ReattachNoRenderer -}; - -enum ColumnFill { ColumnFillBalance, ColumnFillAuto }; - -// These have been defined in the order of their precedence for -// border-collapsing. Do not change this order! This order also must match the -// order in CSSValueKeywords.in. -enum EBorderStyle { - BNONE, - BHIDDEN, - INSET, - GROOVE, - OUTSET, - RIDGE, - DOTTED, - DASHED, - SOLID, - DOUBLE -}; - -enum EBorderPrecedence { - BOFF, - BTABLE, - BCOLGROUP, - BCOL, - BROWGROUP, - BROW, - BCELL -}; - -enum OutlineIsAuto { AUTO_OFF = 0, AUTO_ON }; - -enum EPosition { - StaticPosition = 0, - AbsolutePosition = 1, -}; - -// Box decoration attributes. Not inherited. - -enum EBoxDecorationBreak { DSLICE, DCLONE }; - -// Box attributes. Not inherited. - -enum EBoxSizing { CONTENT_BOX, BORDER_BOX }; - -// Random visual rendering model attributes. Not inherited. - -enum EOverflow { OVISIBLE, OHIDDEN, OAUTO, OOVERLAY, OPAGEDX, OPAGEDY }; - -enum EVerticalAlign { - BASELINE, - MIDDLE, - SUB, - SUPER, - TEXT_TOP, - TEXT_BOTTOM, - TOP, - BOTTOM, - BASELINE_MIDDLE, - LENGTH -}; - -enum EFillAttachment { LocalBackgroundAttachment, FixedBackgroundAttachment }; - -enum EFillBox { BorderFillBox, PaddingFillBox, ContentFillBox }; - -enum EFillRepeat { RepeatFill, NoRepeatFill, RoundFill, SpaceFill }; - -// FIXME(sky): Remove this enum. -enum EFillLayerType { BackgroundFillLayer }; - -// CSS3 Background Values -enum EFillSizeType { Contain, Cover, SizeLength, SizeNone }; - -// CSS3 Background Position -enum BackgroundEdgeOrigin { TopEdge, RightEdge, BottomEdge, LeftEdge }; - -// Deprecated Flexible Box Properties - -enum EBoxPack { Start, Center, End, Justify }; -enum EBoxAlignment { BSTRETCH, BSTART, BCENTER, BEND, BBASELINE }; -enum EBoxOrient { HORIZONTAL, VERTICAL }; -enum EBoxLines { SINGLE, MULTIPLE }; -enum EBoxDirection { BNORMAL, BREVERSE }; - -// CSS3 Flexbox Properties - -enum EAlignContent { - AlignContentFlexStart, - AlignContentFlexEnd, - AlignContentCenter, - AlignContentSpaceBetween, - AlignContentSpaceAround, - AlignContentStretch -}; -enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse }; -enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse }; -enum EJustifyContent { - JustifyFlexStart, - JustifyFlexEnd, - JustifyCenter, - JustifySpaceBetween, - JustifySpaceAround -}; - -// CSS3 User Modify Properties - -enum EUserModify { READ_ONLY, READ_WRITE, READ_WRITE_PLAINTEXT_ONLY }; - -// CSS3 User Select Values - -enum EUserSelect { SELECT_NONE, SELECT_TEXT, SELECT_ALL }; - -// CSS3 Image Values -enum ObjectFit { - ObjectFitFill, - ObjectFitContain, - ObjectFitCover, - ObjectFitNone, - ObjectFitScaleDown -}; - -// Word Break Values. Matches WinIE, rather than CSS3 - -enum EWordBreak { NormalWordBreak, BreakAllWordBreak, BreakWordBreak }; - -enum EOverflowWrap { NormalOverflowWrap, BreakOverflowWrap }; - -enum LineBreak { - LineBreakAuto, - LineBreakLoose, - LineBreakNormal, - LineBreakStrict, - LineBreakAfterWhiteSpace -}; - -enum EAnimPlayState { AnimPlayStatePlaying, AnimPlayStatePaused }; - -enum EWhiteSpace { NORMAL, PRE, PRE_WRAP, PRE_LINE, NOWRAP, KHTML_NOWRAP }; - -// The order of this enum must match the order of the values in dart:ui's -// TextAlign. -enum ETextAlign { - LEFT, - RIGHT, - CENTER, - JUSTIFY, - TASTART, - TAEND, -}; - -static const size_t TextDecorationBits = 4; -enum TextDecoration { - TextDecorationNone = 0x0, - TextDecorationUnderline = 0x1, - TextDecorationOverline = 0x2, - TextDecorationLineThrough = 0x4, - TextDecorationBlink = 0x8 -}; -inline TextDecoration operator|(TextDecoration a, TextDecoration b) { - return TextDecoration(int(a) | int(b)); -} -inline TextDecoration& operator|=(TextDecoration& a, TextDecoration b) { - return a = a | b; -} - -enum TextDecorationStyle { - TextDecorationStyleSolid, - TextDecorationStyleDouble, - TextDecorationStyleDotted, - TextDecorationStyleDashed, - TextDecorationStyleWavy -}; - -enum TextAlignLast { - TextAlignLastAuto, - TextAlignLastStart, - TextAlignLastEnd, - TextAlignLastLeft, - TextAlignLastRight, - TextAlignLastCenter, - TextAlignLastJustify -}; - -enum TextJustify { - TextJustifyAuto, - TextJustifyNone, - TextJustifyInterWord, - TextJustifyDistribute -}; - -enum TextUnderlinePosition { - // FIXME: Implement support for 'under left' and 'under right' values. - TextUnderlinePositionAuto, - TextUnderlinePositionUnder -}; - -enum EVisibility { VISIBLE, HIDDEN, COLLAPSE }; - -// The order of this enum must match the order of the display values in -// CSSValueKeywords.in. -enum EDisplay { - INLINE, - PARAGRAPH, - FLEX, - INLINE_FLEX, - NONE, -}; - -enum EPointerEvents { - PE_NONE, - PE_AUTO, - PE_STROKE, - PE_FILL, - PE_PAINTED, - PE_VISIBLE, - PE_VISIBLE_STROKE, - PE_VISIBLE_FILL, - PE_VISIBLE_PAINTED, - PE_BOUNDINGBOX, - PE_ALL -}; - -enum ETransformStyle3D { TransformStyle3DFlat, TransformStyle3DPreserve3D }; - -enum Hyphens { HyphensNone, HyphensManual, HyphensAuto }; - -enum TextEmphasisFill { TextEmphasisFillFilled, TextEmphasisFillOpen }; - -enum TextEmphasisMark { - TextEmphasisMarkNone, - TextEmphasisMarkAuto, - TextEmphasisMarkDot, - TextEmphasisMarkCircle, - TextEmphasisMarkDoubleCircle, - TextEmphasisMarkTriangle, - TextEmphasisMarkSesame, - TextEmphasisMarkCustom -}; - -enum TextEmphasisPosition { - TextEmphasisPositionOver, - TextEmphasisPositionUnder -}; - -enum TextOrientation { - TextOrientationVerticalRight, - TextOrientationUpright, - TextOrientationSideways, - TextOrientationSidewaysRight -}; - -enum TextOverflow { TextOverflowClip = 0, TextOverflowEllipsis }; - -enum EImageRendering { - ImageRenderingAuto, - ImageRenderingOptimizeSpeed, - ImageRenderingOptimizeQuality, - ImageRenderingOptimizeContrast, - ImageRenderingPixelated -}; - -enum ImageResolutionSource { - ImageResolutionSpecified = 0, - ImageResolutionFromImage -}; - -enum ImageResolutionSnap { - ImageResolutionNoSnap = 0, - ImageResolutionSnapPixels -}; - -enum Order { LogicalOrder = 0, VisualOrder }; - -enum WrapFlow { - WrapFlowAuto, - WrapFlowBoth, - WrapFlowStart, - WrapFlowEnd, - WrapFlowMaximum, - WrapFlowClear -}; - -enum WrapThrough { WrapThroughWrap, WrapThroughNone }; - -static const size_t TouchActionBits = 4; -enum TouchAction { - TouchActionAuto = 0x0, - TouchActionNone = 0x1, - TouchActionPanX = 0x2, - TouchActionPanY = 0x4, - TouchActionPinchZoom = 0x8, -}; -inline TouchAction operator|(TouchAction a, TouchAction b) { - return TouchAction(int(a) | int(b)); -} -inline TouchAction& operator|=(TouchAction& a, TouchAction b) { - return a = a | b; -} -inline TouchAction operator&(TouchAction a, TouchAction b) { - return TouchAction(int(a) & int(b)); -} -inline TouchAction& operator&=(TouchAction& a, TouchAction b) { - return a = a & b; -} - -enum TouchActionDelay { TouchActionDelayNone, TouchActionDelayScript }; - -enum ItemPosition { - ItemPositionAuto, - ItemPositionStretch, - ItemPositionBaseline, - ItemPositionLastBaseline, - ItemPositionCenter, - ItemPositionStart, - ItemPositionEnd, - ItemPositionSelfStart, - ItemPositionSelfEnd, - ItemPositionFlexStart, - ItemPositionFlexEnd, - ItemPositionLeft, - ItemPositionRight -}; - -enum OverflowAlignment { - OverflowAlignmentDefault, - OverflowAlignmentTrue, - OverflowAlignmentSafe -}; - -enum ItemPositionType { NonLegacyPosition, LegacyPosition }; - -// Reasonable maximum to prevent insane font sizes from causing crashes on some -// platforms (such as Windows). -static const float maximumAllowedFontSize = 1000000.0f; - -enum TextIndentLine { TextIndentFirstLine, TextIndentEachLine }; -enum TextIndentType { TextIndentNormal, TextIndentHanging }; - -enum CSSBoxType { - BoxMissing = 0, - MarginBox, - BorderBox, - PaddingBox, - ContentBox -}; - -enum LineBoxContainFlags { - LineBoxContainNone = 0x0, - LineBoxContainBlock = 0x1, - LineBoxContainInline = 0x2, - LineBoxContainFont = 0x4, - LineBoxContainGlyphs = 0x8, - LineBoxContainReplaced = 0x10, - LineBoxContainInlineBox = 0x20 -}; -typedef unsigned LineBoxContain; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_RENDERSTYLECONSTANTS_H_ diff --git a/sky/engine/core/rendering/style/ShadowData.cpp b/sky/engine/core/rendering/style/ShadowData.cpp deleted file mode 100644 index 2d4ec0d7aa752..0000000000000 --- a/sky/engine/core/rendering/style/ShadowData.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/ShadowData.h" - -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" - -namespace blink { - -bool ShadowData::operator==(const ShadowData& o) const { - return m_location == o.m_location && m_blur == o.m_blur && - m_spread == o.m_spread && m_style == o.m_style && m_color == o.m_color; -} - -ShadowData ShadowData::blend(const ShadowData& from, double progress) const { - if (style() != from.style()) - return *this; - - return ShadowData(blink::blend(from.location(), location(), progress), - clampTo(blink::blend(from.blur(), blur(), progress), 0.0f), - blink::blend(from.spread(), spread(), progress), style(), - blink::blend(from.color(), color(), progress)); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/ShadowData.h b/sky/engine/core/rendering/style/ShadowData.h deleted file mode 100644 index f0298cfad87b4..0000000000000 --- a/sky/engine/core/rendering/style/ShadowData.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009 Apple Inc. - * All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_SHADOWDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_SHADOWDATA_H_ - -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/graphics/Color.h" - -namespace blink { - -enum ShadowStyle { Normal, Inset }; - -// This class holds information about shadows for the text-shadow and box-shadow -// properties. -class ShadowData { - WTF_MAKE_FAST_ALLOCATED; - - public: - ShadowData(const FloatPoint& location, - float blur, - float spread, - ShadowStyle style, - const Color& color) - : m_location(location), - m_blur(blur), - m_spread(spread), - m_color(color), - m_style(style) {} - - bool operator==(const ShadowData&) const; - bool operator!=(const ShadowData& o) const { return !(*this == o); } - - ShadowData blend(const ShadowData& from, double progress) const; - - float x() const { return m_location.x(); } - float y() const { return m_location.y(); } - FloatPoint location() const { return m_location; } - float blur() const { return m_blur; } - float spread() const { return m_spread; } - ShadowStyle style() const { return m_style; } - const Color& color() const { return m_color; } - - private: - FloatPoint m_location; - float m_blur; - float m_spread; - // FIXME: We should use StyleColor here to allow currentColor to work - // correctly with visited links - Color m_color; - ShadowStyle m_style; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_SHADOWDATA_H_ diff --git a/sky/engine/core/rendering/style/ShadowList.cpp b/sky/engine/core/rendering/style/ShadowList.cpp deleted file mode 100644 index 703f0b0f549b9..0000000000000 --- a/sky/engine/core/rendering/style/ShadowList.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/style/ShadowList.h" - -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" - -namespace blink { - -static inline void calculateShadowExtent(const ShadowList* shadowList, - float& shadowLeft, - float& shadowRight, - float& shadowTop, - float& shadowBottom) { - ASSERT(shadowList); - size_t shadowCount = shadowList->shadows().size(); - for (size_t i = 0; i < shadowCount; ++i) { - const ShadowData& shadow = shadowList->shadows()[i]; - if (shadow.style() == Inset) - continue; - float blurAndSpread = shadow.blur() + shadow.spread(); - shadowLeft = std::min(shadow.x() - blurAndSpread, shadowLeft); - shadowRight = std::max(shadow.x() + blurAndSpread, shadowRight); - shadowTop = std::min(shadow.y() - blurAndSpread, shadowTop); - shadowBottom = std::max(shadow.y() + blurAndSpread, shadowBottom); - } -} - -void ShadowList::adjustRectForShadow(LayoutRect& rect) const { - FloatRect floatRect(rect); - adjustRectForShadow(floatRect); - rect = LayoutRect(floatRect); -} - -void ShadowList::adjustRectForShadow(FloatRect& rect) const { - float shadowLeft = 0; - float shadowRight = 0; - float shadowTop = 0; - float shadowBottom = 0; - calculateShadowExtent(this, shadowLeft, shadowRight, shadowTop, shadowBottom); - - rect.move(shadowLeft, shadowTop); - rect.setWidth(rect.width() - shadowLeft + shadowRight); - rect.setHeight(rect.height() - shadowTop + shadowBottom); -} - -PassRefPtr ShadowList::blend(const ShadowList* from, - const ShadowList* to, - double progress) { - size_t fromLength = from ? from->shadows().size() : 0; - size_t toLength = to ? to->shadows().size() : 0; - if (!fromLength && !toLength) - return nullptr; - - ShadowDataVector shadows; - - DEFINE_STATIC_LOCAL(ShadowData, defaultShadowData, - (FloatPoint(), 0, 0, Normal, Color::transparent)); - DEFINE_STATIC_LOCAL(ShadowData, defaultInsetShadowData, - (FloatPoint(), 0, 0, Inset, Color::transparent)); - - size_t maxLength = std::max(fromLength, toLength); - for (size_t i = 0; i < maxLength; ++i) { - const ShadowData* fromShadow = i < fromLength ? &from->shadows()[i] : 0; - const ShadowData* toShadow = i < toLength ? &to->shadows()[i] : 0; - if (!fromShadow) - fromShadow = toShadow->style() == Inset ? &defaultInsetShadowData - : &defaultShadowData; - else if (!toShadow) - toShadow = fromShadow->style() == Inset ? &defaultInsetShadowData - : &defaultShadowData; - shadows.append(toShadow->blend(*fromShadow, progress)); - } - - return ShadowList::adopt(shadows); -} - -PassOwnPtr ShadowList::createDrawLooper( - DrawLooperBuilder::ShadowAlphaMode alphaMode) const { - OwnPtr drawLooperBuilder = DrawLooperBuilder::create(); - for (size_t i = shadows().size(); i--;) { - const ShadowData& shadow = shadows()[i]; - drawLooperBuilder->addShadow( - FloatSize(shadow.x(), shadow.y()), shadow.blur(), shadow.color(), - DrawLooperBuilder::ShadowRespectsTransforms, alphaMode); - } - drawLooperBuilder->addUnmodifiedContent(); - return drawLooperBuilder.release(); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/ShadowList.h b/sky/engine/core/rendering/style/ShadowList.h deleted file mode 100644 index 9f7637e070a2d..0000000000000 --- a/sky/engine/core/rendering/style/ShadowList.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_SHADOWLIST_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_SHADOWLIST_H_ - -#include "flutter/sky/engine/core/rendering/style/ShadowData.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" -#include "flutter/sky/engine/platform/graphics/DrawLooperBuilder.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class FloatRect; -class LayoutRect; - -typedef Vector ShadowDataVector; - -// These are used to store shadows in specified order, but we usually want to -// iterate over them backwards as the first-specified shadow is painted on top. -class ShadowList : public RefCounted { - public: - // This consumes passed in vector. - static PassRefPtr adopt(ShadowDataVector& shadows) { - return adoptRef(new ShadowList(shadows)); - } - const ShadowDataVector& shadows() const { return m_shadows; } - bool operator==(const ShadowList& o) const { - return m_shadows == o.m_shadows; - } - bool operator!=(const ShadowList& o) const { return !(*this == o); } - - static PassRefPtr blend(const ShadowList* from, - const ShadowList* to, - double progress); - - void adjustRectForShadow(LayoutRect&) const; - void adjustRectForShadow(FloatRect&) const; - - PassOwnPtr createDrawLooper( - DrawLooperBuilder::ShadowAlphaMode) const; - - private: - ShadowList(ShadowDataVector& shadows) { - // If we have no shadows, we use a null ShadowList - ASSERT(!shadows.isEmpty()); - m_shadows.swap(shadows); - m_shadows.shrinkToFit(); - } - ShadowDataVector m_shadows; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_SHADOWLIST_H_ diff --git a/sky/engine/core/rendering/style/ShapeValue.h b/sky/engine/core/rendering/style/ShapeValue.h deleted file mode 100644 index 6a0f37e4ed56e..0000000000000 --- a/sky/engine/core/rendering/style/ShapeValue.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_SHAPEVALUE_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_SHAPEVALUE_H_ - -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" -#include "flutter/sky/engine/core/rendering/style/StyleImage.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" - -namespace blink { - -class ShapeValue : public RefCounted { - public: - enum ShapeValueType { - // The Auto value is defined by a null ShapeValue* - Box, - Image - }; - - static PassRefPtr createBoxShapeValue(CSSBoxType cssBox) { - return adoptRef(new ShapeValue(cssBox)); - } - - static PassRefPtr createImageValue(PassRefPtr image) { - return adoptRef(new ShapeValue(image)); - } - - ShapeValueType type() const { return m_type; } - - StyleImage* image() const { return m_image.get(); } - bool isImageValid() const { - if (!image()) - return false; - return image()->isGeneratedImage(); - } - void setImage(PassRefPtr image) { - ASSERT(type() == Image); - if (m_image != image) - m_image = image; - } - CSSBoxType cssBox() const { return m_cssBox; } - - bool operator==(const ShapeValue& other) const; - - private: - ShapeValue(ShapeValueType type) : m_type(type), m_cssBox(BoxMissing) {} - ShapeValue(PassRefPtr image) - : m_type(Image), m_image(image), m_cssBox(ContentBox) {} - ShapeValue(CSSBoxType cssBox) : m_type(Box), m_cssBox(cssBox) {} - - ShapeValueType m_type; - RefPtr m_image; - CSSBoxType m_cssBox; -}; - -inline bool ShapeValue::operator==(const ShapeValue& other) const { - if (type() != other.type()) - return false; - - switch (type()) { - case Box: - return cssBox() == other.cssBox(); - case Image: - return image() == other.image(); - } - - ASSERT_NOT_REACHED(); - return false; -} - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_SHAPEVALUE_H_ diff --git a/sky/engine/core/rendering/style/StyleBackgroundData.cpp b/sky/engine/core/rendering/style/StyleBackgroundData.cpp deleted file mode 100644 index 38bc262c153c7..0000000000000 --- a/sky/engine/core/rendering/style/StyleBackgroundData.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/StyleBackgroundData.h" - -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" - -namespace blink { - -StyleBackgroundData::StyleBackgroundData() - : m_background(BackgroundFillLayer, true), - m_color(RenderStyle::initialBackgroundColor()) {} - -StyleBackgroundData::StyleBackgroundData(const StyleBackgroundData& o) - : RefCounted(), - m_background(o.m_background), - m_color(o.m_color), - m_outline(o.m_outline) {} - -bool StyleBackgroundData::operator==(const StyleBackgroundData& o) const { - return m_background == o.m_background && m_color == o.m_color && - m_outline == o.m_outline; -} - -bool StyleBackgroundData::visuallyEqual(const StyleBackgroundData& o) const { - return m_background == o.m_background && m_color == o.m_color && - m_outline.visuallyEqual(o.m_outline); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleBackgroundData.h b/sky/engine/core/rendering/style/StyleBackgroundData.h deleted file mode 100644 index ba8739d721f78..0000000000000 --- a/sky/engine/core/rendering/style/StyleBackgroundData.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLEBACKGROUNDDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLEBACKGROUNDDATA_H_ - -#include "flutter/sky/engine/core/rendering/style/FillLayer.h" -#include "flutter/sky/engine/core/rendering/style/OutlineValue.h" -#include "flutter/sky/engine/platform/graphics/Color.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -class StyleBackgroundData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleBackgroundData); - } - PassRefPtr copy() const { - return adoptRef(new StyleBackgroundData(*this)); - } - ~StyleBackgroundData() {} - - bool operator==(const StyleBackgroundData& o) const; - bool operator!=(const StyleBackgroundData& o) const { return !(*this == o); } - - bool visuallyEqual(const StyleBackgroundData&) const; - - const FillLayer& background() const { return m_background; } - const StyleColor& color() const { return m_color; } - const OutlineValue& outline() const { return m_outline; } - - private: - friend class RenderStyle; - - StyleBackgroundData(); - StyleBackgroundData(const StyleBackgroundData&); - - FillLayer m_background; - StyleColor m_color; - OutlineValue m_outline; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEBACKGROUNDDATA_H_ diff --git a/sky/engine/core/rendering/style/StyleBoxData.cpp b/sky/engine/core/rendering/style/StyleBoxData.cpp deleted file mode 100644 index 92433305cd320..0000000000000 --- a/sky/engine/core/rendering/style/StyleBoxData.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/StyleBoxData.h" - -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" - -namespace blink { - -struct SameSizeAsStyleBoxData : public RefCounted { - Length length[7]; - unsigned m_zIndex; - uint32_t bitfields; -}; - -COMPILE_ASSERT(sizeof(StyleBoxData) == sizeof(SameSizeAsStyleBoxData), - StyleBoxData_should_not_grow); - -StyleBoxData::StyleBoxData() - : m_minWidth(RenderStyle::initialMinSize()), - m_maxWidth(RenderStyle::initialMaxSize()), - m_minHeight(RenderStyle::initialMinSize()), - m_maxHeight(RenderStyle::initialMaxSize()), - m_zIndex(0), - m_hasAutoZIndex(true), - m_boxSizing(RenderStyle::initialBoxSizing()), - m_boxDecorationBreak(DSLICE) {} - -StyleBoxData::StyleBoxData(const StyleBoxData& o) - : RefCounted(), - m_width(o.m_width), - m_height(o.m_height), - m_minWidth(o.m_minWidth), - m_maxWidth(o.m_maxWidth), - m_minHeight(o.m_minHeight), - m_maxHeight(o.m_maxHeight), - m_verticalAlign(o.m_verticalAlign), - m_zIndex(o.m_zIndex), - m_hasAutoZIndex(o.m_hasAutoZIndex), - m_boxSizing(o.m_boxSizing), - m_boxDecorationBreak(o.m_boxDecorationBreak) {} - -bool StyleBoxData::operator==(const StyleBoxData& o) const { - return m_width == o.m_width && m_height == o.m_height && - m_minWidth == o.m_minWidth && m_maxWidth == o.m_maxWidth && - m_minHeight == o.m_minHeight && m_maxHeight == o.m_maxHeight && - m_verticalAlign == o.m_verticalAlign && m_zIndex == o.m_zIndex && - m_hasAutoZIndex == o.m_hasAutoZIndex && m_boxSizing == o.m_boxSizing && - m_boxDecorationBreak == o.m_boxDecorationBreak; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleBoxData.h b/sky/engine/core/rendering/style/StyleBoxData.h deleted file mode 100644 index 1ef4d4b99f3a7..0000000000000 --- a/sky/engine/core/rendering/style/StyleBoxData.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLEBOXDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLEBOXDATA_H_ - -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -class StyleBoxData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleBoxData); - } - PassRefPtr copy() const { - return adoptRef(new StyleBoxData(*this)); - } - - bool operator==(const StyleBoxData& o) const; - bool operator!=(const StyleBoxData& o) const { return !(*this == o); } - - const Length& width() const { return m_width; } - const Length& height() const { return m_height; } - - const Length& minWidth() const { return m_minWidth; } - const Length& minHeight() const { return m_minHeight; } - - const Length& maxWidth() const { return m_maxWidth; } - const Length& maxHeight() const { return m_maxHeight; } - - const Length& verticalAlign() const { return m_verticalAlign; } - - unsigned zIndex() const { return m_zIndex; } - bool hasAutoZIndex() const { return m_hasAutoZIndex; } - - EBoxSizing boxSizing() const { return static_cast(m_boxSizing); } - EBoxDecorationBreak boxDecorationBreak() const { - return static_cast(m_boxDecorationBreak); - } - - private: - friend class RenderStyle; - - StyleBoxData(); - StyleBoxData(const StyleBoxData&); - - Length m_width; - Length m_height; - - Length m_minWidth; - Length m_maxWidth; - - Length m_minHeight; - Length m_maxHeight; - - Length m_verticalAlign; - - unsigned m_zIndex; - unsigned m_hasAutoZIndex : 1; - unsigned m_boxSizing : 1; // EBoxSizing - unsigned m_boxDecorationBreak : 1; // EBoxDecorationBreak -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEBOXDATA_H_ diff --git a/sky/engine/core/rendering/style/StyleColor.h b/sky/engine/core/rendering/style/StyleColor.h deleted file mode 100644 index 97b2498723c3f..0000000000000 --- a/sky/engine/core/rendering/style/StyleColor.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLECOLOR_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLECOLOR_H_ - -#include "flutter/sky/engine/platform/graphics/Color.h" - -namespace blink { - -class StyleColor { - public: - StyleColor(Color color) : m_color(color), m_currentColor(false) {} - static StyleColor currentColor() { return StyleColor(); } - - bool isCurrentColor() const { return m_currentColor; } - Color color() const { - ASSERT(!isCurrentColor()); - return m_color; - } - - Color resolve(Color currentColor) const { - return m_currentColor ? currentColor : m_color; - } - - private: - StyleColor() : m_currentColor(true) {} - Color m_color; - bool m_currentColor; -}; - -inline bool operator==(const StyleColor& a, const StyleColor& b) { - if (a.isCurrentColor() || b.isCurrentColor()) - return a.isCurrentColor() && b.isCurrentColor(); - return a.color() == b.color(); -} - -inline bool operator!=(const StyleColor& a, const StyleColor& b) { - return !(a == b); -} - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLECOLOR_H_ diff --git a/sky/engine/core/rendering/style/StyleDifference.h b/sky/engine/core/rendering/style/StyleDifference.h deleted file mode 100644 index b442403abbd95..0000000000000 --- a/sky/engine/core/rendering/style/StyleDifference.h +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLEDIFFERENCE_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLEDIFFERENCE_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" - -namespace blink { - -class StyleDifference { - public: - enum PropertyDifference { - TransformChanged = 1 << 0, - OpacityChanged = 1 << 1, - ZIndexChanged = 1 << 2, - FilterChanged = 1 << 3, - }; - - StyleDifference() - : m_layoutType(NoLayout), m_propertySpecificDifferences(0) {} - - bool needsLayout() const { return m_layoutType != NoLayout; } - void clearNeedsLayout() { m_layoutType = NoLayout; } - - // The offset of this positioned object has been updated. - bool needsPositionedMovementLayout() const { - return m_layoutType == PositionedMovement; - } - void setNeedsPositionedMovementLayout() { - ASSERT(!needsFullLayout()); - m_layoutType = PositionedMovement; - } - - bool needsFullLayout() const { return m_layoutType == FullLayout; } - void setNeedsFullLayout() { m_layoutType = FullLayout; } - - bool transformChanged() const { - return m_propertySpecificDifferences & TransformChanged; - } - void setTransformChanged() { - m_propertySpecificDifferences |= TransformChanged; - } - - bool opacityChanged() const { - return m_propertySpecificDifferences & OpacityChanged; - } - void setOpacityChanged() { m_propertySpecificDifferences |= OpacityChanged; } - - bool zIndexChanged() const { - return m_propertySpecificDifferences & ZIndexChanged; - } - void setZIndexChanged() { m_propertySpecificDifferences |= ZIndexChanged; } - - bool filterChanged() const { - return m_propertySpecificDifferences & FilterChanged; - } - void setFilterChanged() { m_propertySpecificDifferences |= FilterChanged; } - - private: - enum LayoutType { NoLayout = 0, PositionedMovement, FullLayout }; - unsigned m_layoutType : 2; - - unsigned m_propertySpecificDifferences : 5; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEDIFFERENCE_H_ diff --git a/sky/engine/core/rendering/style/StyleFilterData.cpp b/sky/engine/core/rendering/style/StyleFilterData.cpp deleted file mode 100644 index 3e2bc4c952c8e..0000000000000 --- a/sky/engine/core/rendering/style/StyleFilterData.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/core/rendering/style/StyleFilterData.h" - -namespace blink { - -StyleFilterData::StyleFilterData() {} - -StyleFilterData::StyleFilterData(const StyleFilterData& o) {} - -bool StyleFilterData::operator==(const StyleFilterData& o) const { - return true; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleFilterData.h b/sky/engine/core/rendering/style/StyleFilterData.h deleted file mode 100644 index efaadb52a3c38..0000000000000 --- a/sky/engine/core/rendering/style/StyleFilterData.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLEFILTERDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLEFILTERDATA_H_ - -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -class StyleFilterData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleFilterData); - } - PassRefPtr copy() const { - return adoptRef(new StyleFilterData(*this)); - } - - bool operator==(const StyleFilterData&) const; - bool operator!=(const StyleFilterData& o) const { return !(*this == o); } - - private: - StyleFilterData(); - StyleFilterData(const StyleFilterData&); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEFILTERDATA_H_ diff --git a/sky/engine/core/rendering/style/StyleFlexibleBoxData.cpp b/sky/engine/core/rendering/style/StyleFlexibleBoxData.cpp deleted file mode 100644 index d2117d1fce58b..0000000000000 --- a/sky/engine/core/rendering/style/StyleFlexibleBoxData.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - */ - -#include "flutter/sky/engine/core/rendering/style/StyleFlexibleBoxData.h" - -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" - -namespace blink { - -StyleFlexibleBoxData::StyleFlexibleBoxData() - : m_flexGrow(RenderStyle::initialFlexGrow()), - m_flexShrink(RenderStyle::initialFlexShrink()), - m_flexBasis(RenderStyle::initialFlexBasis()), - m_flexDirection(RenderStyle::initialFlexDirection()), - m_flexWrap(RenderStyle::initialFlexWrap()) {} - -StyleFlexibleBoxData::StyleFlexibleBoxData(const StyleFlexibleBoxData& o) - : RefCounted(), - m_flexGrow(o.m_flexGrow), - m_flexShrink(o.m_flexShrink), - m_flexBasis(o.m_flexBasis), - m_flexDirection(o.m_flexDirection), - m_flexWrap(o.m_flexWrap) {} - -bool StyleFlexibleBoxData::operator==(const StyleFlexibleBoxData& o) const { - return m_flexGrow == o.m_flexGrow && m_flexShrink == o.m_flexShrink && - m_flexBasis == o.m_flexBasis && m_flexDirection == o.m_flexDirection && - m_flexWrap == o.m_flexWrap; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleFlexibleBoxData.h b/sky/engine/core/rendering/style/StyleFlexibleBoxData.h deleted file mode 100644 index e6058befae749..0000000000000 --- a/sky/engine/core/rendering/style/StyleFlexibleBoxData.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLEFLEXIBLEBOXDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLEFLEXIBLEBOXDATA_H_ - -#include "flutter/sky/engine/platform/Length.h" - -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -class StyleFlexibleBoxData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleFlexibleBoxData); - } - PassRefPtr copy() const { - return adoptRef(new StyleFlexibleBoxData(*this)); - } - - bool operator==(const StyleFlexibleBoxData&) const; - bool operator!=(const StyleFlexibleBoxData& o) const { return !(*this == o); } - - float m_flexGrow; - float m_flexShrink; - Length m_flexBasis; - - unsigned m_flexDirection : 2; // EFlexDirection - unsigned m_flexWrap : 2; // EFlexWrap - - private: - StyleFlexibleBoxData(); - StyleFlexibleBoxData(const StyleFlexibleBoxData&); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEFLEXIBLEBOXDATA_H_ diff --git a/sky/engine/core/rendering/style/StyleImage.h b/sky/engine/core/rendering/style/StyleImage.h deleted file mode 100644 index 0cec9e265a292..0000000000000 --- a/sky/engine/core/rendering/style/StyleImage.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLEIMAGE_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLEIMAGE_H_ - -#include "flutter/sky/engine/platform/geometry/IntSize.h" -#include "flutter/sky/engine/platform/geometry/LayoutSize.h" -#include "flutter/sky/engine/platform/graphics/Image.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -class RenderObject; - -typedef void* WrappedImagePtr; - -class StyleImage : public RefCounted { - public: - virtual ~StyleImage() {} - - bool operator==(const StyleImage& other) const { - return data() == other.data(); - } - - virtual bool canRender(const RenderObject&) const { return true; } - virtual bool isLoaded() const { return true; } - virtual bool errorOccurred() const { return false; } - virtual LayoutSize imageSize(const RenderObject*) const = 0; - virtual void computeIntrinsicDimensions(const RenderObject*, - Length& intrinsicWidth, - Length& intrinsicHeight, - FloatSize& intrinsicRatio) = 0; - virtual bool imageHasRelativeWidth() const = 0; - virtual bool imageHasRelativeHeight() const = 0; - virtual bool usesImageContainerSize() const = 0; - virtual void setContainerSizeForRenderer(const RenderObject*, - const IntSize&) = 0; - virtual void addClient(RenderObject*) = 0; - virtual void removeClient(RenderObject*) = 0; - virtual PassRefPtr image(RenderObject*, const IntSize&) const = 0; - virtual WrappedImagePtr data() const = 0; - virtual float imageScaleFactor() const { return 1; } - virtual bool knownToBeOpaque(const RenderObject*) const = 0; - - ALWAYS_INLINE bool isPendingImage() const { return m_isPendingImage; } - ALWAYS_INLINE bool isGeneratedImage() const { return m_isGeneratedImage; } - - protected: - StyleImage() : m_isPendingImage(false), m_isGeneratedImage(false) {} - bool m_isPendingImage : 1; - bool m_isGeneratedImage : 1; -}; - -#define DEFINE_STYLE_IMAGE_TYPE_CASTS(thisType, function) \ - DEFINE_TYPE_CASTS(thisType, StyleImage, styleImage, styleImage->function, \ - styleImage.function); \ - inline thisType* to##thisType(const RefPtr& styleImage) { \ - return to##thisType(styleImage.get()); \ - } \ - typedef int NeedsSemiColonAfterDefineStyleImageTypeCasts - -} // namespace blink -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEIMAGE_H_ diff --git a/sky/engine/core/rendering/style/StyleInheritedData.cpp b/sky/engine/core/rendering/style/StyleInheritedData.cpp deleted file mode 100644 index 97163776a596f..0000000000000 --- a/sky/engine/core/rendering/style/StyleInheritedData.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/StyleInheritedData.h" - -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" - -namespace blink { - -StyleInheritedData::StyleInheritedData() - : horizontal_border_spacing(RenderStyle::initialHorizontalBorderSpacing()), - vertical_border_spacing(RenderStyle::initialVerticalBorderSpacing()), - line_height(RenderStyle::initialLineHeight()), - color(RenderStyle::initialColor()) {} - -StyleInheritedData::~StyleInheritedData() {} - -StyleInheritedData::StyleInheritedData(const StyleInheritedData& o) - : RefCounted(), - horizontal_border_spacing(o.horizontal_border_spacing), - vertical_border_spacing(o.vertical_border_spacing), - line_height(o.line_height), - font(o.font), - color(o.color) {} - -bool StyleInheritedData::operator==(const StyleInheritedData& o) const { - return line_height == o.line_height && font == o.font && color == o.color && - horizontal_border_spacing == o.horizontal_border_spacing && - vertical_border_spacing == o.vertical_border_spacing; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleInheritedData.h b/sky/engine/core/rendering/style/StyleInheritedData.h deleted file mode 100644 index a849f21eda334..0000000000000 --- a/sky/engine/core/rendering/style/StyleInheritedData.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLEINHERITEDDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLEINHERITEDDATA_H_ - -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/platform/fonts/Font.h" -#include "flutter/sky/engine/platform/graphics/Color.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -class StyleInheritedData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleInheritedData); - } - PassRefPtr copy() const { - return adoptRef(new StyleInheritedData(*this)); - } - ~StyleInheritedData(); - - bool operator==(const StyleInheritedData& o) const; - bool operator!=(const StyleInheritedData& o) const { return !(*this == o); } - - short horizontal_border_spacing; - short vertical_border_spacing; - - // could be packed in a short but doesn't - // make a difference currently because of padding - Length line_height; - - Font font; - Color color; - - private: - StyleInheritedData(); - StyleInheritedData(const StyleInheritedData&); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEINHERITEDDATA_H_ diff --git a/sky/engine/core/rendering/style/StyleRareInheritedData.cpp b/sky/engine/core/rendering/style/StyleRareInheritedData.cpp deleted file mode 100644 index d60b15a44ebe7..0000000000000 --- a/sky/engine/core/rendering/style/StyleRareInheritedData.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/StyleRareInheritedData.h" - -#include "flutter/sky/engine/core/rendering/style/AppliedTextDecoration.h" -#include "flutter/sky/engine/core/rendering/style/DataEquivalency.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" -#include "flutter/sky/engine/core/rendering/style/ShadowList.h" -#include "flutter/sky/engine/core/rendering/style/StyleImage.h" - -namespace blink { - -StyleRareInheritedData::StyleRareInheritedData() - : textStrokeWidth(RenderStyle::initialTextStrokeWidth()), - indent(RenderStyle::initialTextIndent()), - m_textStrokeColorIsCurrentColor(true), - m_textFillColorIsCurrentColor(true), - m_textEmphasisColorIsCurrentColor(true), - userModify(READ_ONLY), - wordBreak(RenderStyle::initialWordBreak()), - overflowWrap(RenderStyle::initialOverflowWrap()), - lineBreak(LineBreakAuto), - userSelect(RenderStyle::initialUserSelect()), - hyphens(HyphensManual), - textEmphasisFill(TextEmphasisFillFilled), - textEmphasisMark(TextEmphasisMarkNone), - textEmphasisPosition(TextEmphasisPositionOver), - m_textAlignLast(RenderStyle::initialTextAlignLast()), - m_textJustify(RenderStyle::initialTextJustify()), - m_textOrientation(TextOrientationVerticalRight), - m_textIndentLine(RenderStyle::initialTextIndentLine()), - m_textIndentType(RenderStyle::initialTextIndentLine()), - m_lineBoxContain(RenderStyle::initialLineBoxContain()), - m_imageRendering(RenderStyle::initialImageRendering()), - m_textUnderlinePosition(RenderStyle::initialTextUnderlinePosition()), - m_touchActionDelay(RenderStyle::initialTouchActionDelay()), - m_subtreeWillChangeContents(false), - hyphenationLimitBefore(-1), - hyphenationLimitAfter(-1), - hyphenationLimitLines(-1), - m_tabSize(RenderStyle::initialTabSize()), - tapHighlightColor(RenderStyle::initialTapHighlightColor()) {} - -StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o) - : RefCounted(), - m_textStrokeColor(o.m_textStrokeColor), - textStrokeWidth(o.textStrokeWidth), - m_textFillColor(o.m_textFillColor), - m_textEmphasisColor(o.m_textEmphasisColor), - textShadow(o.textShadow), - highlight(o.highlight), - indent(o.indent), - m_textStrokeColorIsCurrentColor(o.m_textStrokeColorIsCurrentColor), - m_textFillColorIsCurrentColor(o.m_textFillColorIsCurrentColor), - m_textEmphasisColorIsCurrentColor(o.m_textEmphasisColorIsCurrentColor), - userModify(o.userModify), - wordBreak(o.wordBreak), - overflowWrap(o.overflowWrap), - lineBreak(o.lineBreak), - userSelect(o.userSelect), - hyphens(o.hyphens), - textEmphasisFill(o.textEmphasisFill), - textEmphasisMark(o.textEmphasisMark), - textEmphasisPosition(o.textEmphasisPosition), - m_textAlignLast(o.m_textAlignLast), - m_textJustify(o.m_textJustify), - m_textOrientation(o.m_textOrientation), - m_textIndentLine(o.m_textIndentLine), - m_textIndentType(o.m_textIndentType), - m_lineBoxContain(o.m_lineBoxContain), - m_imageRendering(o.m_imageRendering), - m_textUnderlinePosition(o.m_textUnderlinePosition), - m_touchActionDelay(o.m_touchActionDelay), - m_subtreeWillChangeContents(o.m_subtreeWillChangeContents), - hyphenationLimitBefore(o.hyphenationLimitBefore), - hyphenationLimitAfter(o.hyphenationLimitAfter), - hyphenationLimitLines(o.hyphenationLimitLines), - hyphenationString(o.hyphenationString), - locale(o.locale), - textEmphasisCustomMark(o.textEmphasisCustomMark), - m_tabSize(o.m_tabSize), - tapHighlightColor(o.tapHighlightColor), - appliedTextDecorations(o.appliedTextDecorations) {} - -StyleRareInheritedData::~StyleRareInheritedData() {} - -bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const { - return m_textStrokeColor == o.m_textStrokeColor && - textStrokeWidth == o.textStrokeWidth && - m_textFillColor == o.m_textFillColor && - m_textEmphasisColor == o.m_textEmphasisColor && - tapHighlightColor == o.tapHighlightColor && shadowDataEquivalent(o) && - highlight == o.highlight && indent == o.indent && - m_textStrokeColorIsCurrentColor == o.m_textStrokeColorIsCurrentColor && - m_textFillColorIsCurrentColor == o.m_textFillColorIsCurrentColor && - m_textEmphasisColorIsCurrentColor == - o.m_textEmphasisColorIsCurrentColor && - userModify == o.userModify && wordBreak == o.wordBreak && - overflowWrap == o.overflowWrap && lineBreak == o.lineBreak && - userSelect == o.userSelect && hyphens == o.hyphens && - hyphenationLimitBefore == o.hyphenationLimitBefore && - hyphenationLimitAfter == o.hyphenationLimitAfter && - hyphenationLimitLines == o.hyphenationLimitLines && - textEmphasisFill == o.textEmphasisFill && - textEmphasisMark == o.textEmphasisMark && - textEmphasisPosition == o.textEmphasisPosition && - m_touchActionDelay == o.m_touchActionDelay && - m_textAlignLast == o.m_textAlignLast && - m_textJustify == o.m_textJustify && - m_textOrientation == o.m_textOrientation && - m_textIndentLine == o.m_textIndentLine && - m_textIndentType == o.m_textIndentType && - m_lineBoxContain == o.m_lineBoxContain && - m_subtreeWillChangeContents == o.m_subtreeWillChangeContents && - hyphenationString == o.hyphenationString && locale == o.locale && - textEmphasisCustomMark == o.textEmphasisCustomMark && - m_tabSize == o.m_tabSize && m_imageRendering == o.m_imageRendering && - m_textUnderlinePosition == o.m_textUnderlinePosition && - dataEquivalent(appliedTextDecorations, o.appliedTextDecorations); -} - -bool StyleRareInheritedData::shadowDataEquivalent( - const StyleRareInheritedData& o) const { - return dataEquivalent(textShadow.get(), o.textShadow.get()); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleRareInheritedData.h b/sky/engine/core/rendering/style/StyleRareInheritedData.h deleted file mode 100644 index 1b11f14488274..0000000000000 --- a/sky/engine/core/rendering/style/StyleRareInheritedData.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLERAREINHERITEDDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLERAREINHERITEDDATA_H_ - -#include "flutter/sky/engine/core/rendering/style/DataRef.h" -#include "flutter/sky/engine/core/rendering/style/StyleColor.h" -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/platform/graphics/Color.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefVector.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -namespace blink { - -class AppliedTextDecoration; -class ShadowList; -class StyleImage; - -typedef RefVector AppliedTextDecorationList; - -// This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific -// properties. By grouping them together, we save space, and only allocate this -// object when someone actually uses one of these properties. -class StyleRareInheritedData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleRareInheritedData); - } - PassRefPtr copy() const { - return adoptRef(new StyleRareInheritedData(*this)); - } - ~StyleRareInheritedData(); - - bool operator==(const StyleRareInheritedData& o) const; - bool operator!=(const StyleRareInheritedData& o) const { - return !(*this == o); - } - bool shadowDataEquivalent(const StyleRareInheritedData&) const; - - StyleColor textStrokeColor() const { - return m_textStrokeColorIsCurrentColor ? StyleColor::currentColor() - : StyleColor(m_textStrokeColor); - } - StyleColor textFillColor() const { - return m_textFillColorIsCurrentColor ? StyleColor::currentColor() - : StyleColor(m_textFillColor); - } - StyleColor textEmphasisColor() const { - return m_textEmphasisColorIsCurrentColor ? StyleColor::currentColor() - : StyleColor(m_textEmphasisColor); - } - - void setTextStrokeColor(const StyleColor& color) { - m_textStrokeColor = color.resolve(Color()); - m_textStrokeColorIsCurrentColor = color.isCurrentColor(); - } - void setTextFillColor(const StyleColor& color) { - m_textFillColor = color.resolve(Color()); - m_textFillColorIsCurrentColor = color.isCurrentColor(); - } - void setTextEmphasisColor(const StyleColor& color) { - m_textEmphasisColor = color.resolve(Color()); - m_textEmphasisColorIsCurrentColor = color.isCurrentColor(); - } - - Color m_textStrokeColor; - float textStrokeWidth; - Color m_textFillColor; - Color m_textEmphasisColor; - - RefPtr - textShadow; // Our text shadow information for shadowed text drawing. - AtomicString - highlight; // Apple-specific extension for custom highlight rendering. - - Length indent; - - unsigned m_textStrokeColorIsCurrentColor : 1; - unsigned m_textFillColorIsCurrentColor : 1; - unsigned m_textEmphasisColorIsCurrentColor : 1; - - unsigned userModify : 2; // EUserModify (editing) - unsigned wordBreak : 2; // EWordBreak - unsigned overflowWrap : 1; // EOverflowWrap - unsigned lineBreak : 3; // LineBreak - unsigned userSelect : 2; // EUserSelect - unsigned hyphens : 2; // Hyphens - unsigned textEmphasisFill : 1; // TextEmphasisFill - unsigned textEmphasisMark : 3; // TextEmphasisMark - unsigned textEmphasisPosition : 1; // TextEmphasisPosition - unsigned m_textAlignLast : 3; // TextAlignLast - unsigned m_textJustify : 2; // TextJustify - unsigned m_textOrientation : 2; // TextOrientation - unsigned m_textIndentLine : 1; // TextIndentEachLine - unsigned m_textIndentType : 1; // TextIndentHanging - unsigned m_lineBoxContain : 7; // LineBoxContain - // CSS Image Values Level 3 - unsigned m_imageRendering : 3; // EImageRendering - unsigned m_textUnderlinePosition : 1; // TextUnderlinePosition - unsigned m_touchActionDelay : 1; // TouchActionDelay - - // Though will-change is not itself an inherited property, the intent - // expressed by 'will-change: contents' includes descendants. - unsigned m_subtreeWillChangeContents : 1; - - short hyphenationLimitBefore; - short hyphenationLimitAfter; - short hyphenationLimitLines; - AtomicString hyphenationString; - - AtomicString locale; - - AtomicString textEmphasisCustomMark; - - unsigned m_tabSize; - - Color tapHighlightColor; - - RefPtr appliedTextDecorations; - - private: - StyleRareInheritedData(); - StyleRareInheritedData(const StyleRareInheritedData&); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLERAREINHERITEDDATA_H_ diff --git a/sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp b/sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp deleted file mode 100644 index 5eff2a086da5d..0000000000000 --- a/sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/StyleRareNonInheritedData.h" - -#include "flutter/sky/engine/core/rendering/style/DataEquivalency.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" -#include "flutter/sky/engine/core/rendering/style/ShadowList.h" -#include "flutter/sky/engine/core/rendering/style/StyleFilterData.h" -#include "flutter/sky/engine/core/rendering/style/StyleTransformData.h" - -namespace blink { - -StyleRareNonInheritedData::StyleRareNonInheritedData() - : opacity(RenderStyle::initialOpacity()), - m_aspectRatioDenominator(RenderStyle::initialAspectRatioDenominator()), - m_aspectRatioNumerator(RenderStyle::initialAspectRatioNumerator()), - m_perspective(RenderStyle::initialPerspective()), - m_perspectiveOriginX(RenderStyle::initialPerspectiveOriginX()), - m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY()), - m_clipPath(RenderStyle::initialClipPath()), - m_textDecorationColor(StyleColor::currentColor()), - m_order(RenderStyle::initialOrder()), - m_objectPosition(RenderStyle::initialObjectPosition()), - m_maxLines(INT_MAX), - m_transformStyle3D(RenderStyle::initialTransformStyle3D()), - m_alignContent(RenderStyle::initialAlignContent()), - m_alignItems(RenderStyle::initialAlignItems()), - m_alignItemsOverflowAlignment( - RenderStyle::initialAlignItemsOverflowAlignment()), - m_alignSelf(RenderStyle::initialAlignSelf()), - m_alignSelfOverflowAlignment( - RenderStyle::initialAlignSelfOverflowAlignment()), - m_justifyContent(RenderStyle::initialJustifyContent()), - textOverflow(RenderStyle::initialTextOverflow()), - m_textDecorationStyle(RenderStyle::initialTextDecorationStyle()), - m_wrapFlow(RenderStyle::initialWrapFlow()), - m_wrapThrough(RenderStyle::initialWrapThrough()), - m_hasAspectRatio(false), - m_touchAction(RenderStyle::initialTouchAction()), - m_objectFit(RenderStyle::initialObjectFit()), - m_justifyItems(RenderStyle::initialJustifyItems()), - m_justifyItemsOverflowAlignment( - RenderStyle::initialJustifyItemsOverflowAlignment()), - m_justifyItemsPositionType( - RenderStyle::initialJustifyItemsPositionType()), - m_justifySelf(RenderStyle::initialJustifySelf()), - m_justifySelfOverflowAlignment( - RenderStyle::initialJustifySelfOverflowAlignment()) {} - -StyleRareNonInheritedData::StyleRareNonInheritedData( - const StyleRareNonInheritedData& o) - : RefCounted(), - opacity(o.opacity), - m_aspectRatioDenominator(o.m_aspectRatioDenominator), - m_aspectRatioNumerator(o.m_aspectRatioNumerator), - m_perspective(o.m_perspective), - m_perspectiveOriginX(o.m_perspectiveOriginX), - m_perspectiveOriginY(o.m_perspectiveOriginY), - m_flexibleBox(o.m_flexibleBox), - m_transform(o.m_transform), - m_filter(o.m_filter), - m_counterDirectives(o.m_counterDirectives ? clone(*o.m_counterDirectives) - : nullptr), - m_boxShadow(o.m_boxShadow), - m_clipPath(o.m_clipPath), - m_textDecorationColor(o.m_textDecorationColor), - m_order(o.m_order), - m_objectPosition(o.m_objectPosition), - m_maxLines(o.m_maxLines), - m_transformStyle3D(o.m_transformStyle3D), - m_alignContent(o.m_alignContent), - m_alignItems(o.m_alignItems), - m_alignItemsOverflowAlignment(o.m_alignItemsOverflowAlignment), - m_alignSelf(o.m_alignSelf), - m_alignSelfOverflowAlignment(o.m_alignSelfOverflowAlignment), - m_justifyContent(o.m_justifyContent), - textOverflow(o.textOverflow), - m_textDecorationStyle(o.m_textDecorationStyle), - m_wrapFlow(o.m_wrapFlow), - m_wrapThrough(o.m_wrapThrough), - m_hasAspectRatio(o.m_hasAspectRatio), - m_touchAction(o.m_touchAction), - m_objectFit(o.m_objectFit), - m_justifyItems(o.m_justifyItems), - m_justifyItemsOverflowAlignment(o.m_justifyItemsOverflowAlignment), - m_justifyItemsPositionType(o.m_justifyItemsPositionType), - m_justifySelf(o.m_justifySelf), - m_justifySelfOverflowAlignment(o.m_justifySelfOverflowAlignment) {} - -StyleRareNonInheritedData::~StyleRareNonInheritedData() {} - -bool StyleRareNonInheritedData::operator==( - const StyleRareNonInheritedData& o) const { - return opacity == o.opacity && - m_aspectRatioDenominator == o.m_aspectRatioDenominator && - m_aspectRatioNumerator == o.m_aspectRatioNumerator && - m_perspective == o.m_perspective && - m_perspectiveOriginX == o.m_perspectiveOriginX && - m_perspectiveOriginY == o.m_perspectiveOriginY && - m_flexibleBox == o.m_flexibleBox && m_transform == o.m_transform && - m_filter == o.m_filter && counterDataEquivalent(o) && - shadowDataEquivalent(o) && m_clipPath == o.m_clipPath && - m_textDecorationColor == o.m_textDecorationColor && - m_order == o.m_order && m_objectPosition == o.m_objectPosition && - m_maxLines == o.m_maxLines && - m_transformStyle3D == o.m_transformStyle3D && - m_alignContent == o.m_alignContent && m_alignItems == o.m_alignItems && - m_alignItemsOverflowAlignment == o.m_alignItemsOverflowAlignment && - m_alignSelf == o.m_alignSelf && - m_alignSelfOverflowAlignment == o.m_alignSelfOverflowAlignment && - m_justifyContent == o.m_justifyContent && - textOverflow == o.textOverflow && - m_textDecorationStyle == o.m_textDecorationStyle && - m_wrapFlow == o.m_wrapFlow && m_wrapThrough == o.m_wrapThrough && - m_hasAspectRatio == o.m_hasAspectRatio && - m_touchAction == o.m_touchAction && m_objectFit == o.m_objectFit && - m_justifyItems == o.m_justifyItems && - m_justifyItemsOverflowAlignment == o.m_justifyItemsOverflowAlignment && - m_justifyItemsPositionType == o.m_justifyItemsPositionType && - m_justifySelf == o.m_justifySelf && - m_justifySelfOverflowAlignment == o.m_justifySelfOverflowAlignment; -} - -bool StyleRareNonInheritedData::counterDataEquivalent( - const StyleRareNonInheritedData& o) const { - return dataEquivalent(m_counterDirectives, o.m_counterDirectives); -} - -bool StyleRareNonInheritedData::shadowDataEquivalent( - const StyleRareNonInheritedData& o) const { - return dataEquivalent(m_boxShadow, o.m_boxShadow); -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleRareNonInheritedData.h b/sky/engine/core/rendering/style/StyleRareNonInheritedData.h deleted file mode 100644 index e96b4a7349dc8..0000000000000 --- a/sky/engine/core/rendering/style/StyleRareNonInheritedData.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLERARENONINHERITEDDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLERARENONINHERITEDDATA_H_ - -#include "flutter/sky/engine/core/rendering/ClipPathOperation.h" -#include "flutter/sky/engine/core/rendering/style/CounterDirectives.h" -#include "flutter/sky/engine/core/rendering/style/DataRef.h" -#include "flutter/sky/engine/core/rendering/style/FillLayer.h" -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" -#include "flutter/sky/engine/core/rendering/style/ShapeValue.h" -#include "flutter/sky/engine/core/rendering/style/StyleColor.h" -#include "flutter/sky/engine/platform/LengthPoint.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class LengthSize; -class ShadowList; -class StyleFilterData; -class StyleFlexibleBoxData; -class StyleTransformData; - -// This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific -// properties. By grouping them together, we save space, and only allocate this -// object when someone actually uses one of these properties. -class StyleRareNonInheritedData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleRareNonInheritedData); - } - PassRefPtr copy() const { - return adoptRef(new StyleRareNonInheritedData(*this)); - } - ~StyleRareNonInheritedData(); - - bool operator==(const StyleRareNonInheritedData&) const; - bool operator!=(const StyleRareNonInheritedData& o) const { - return !(*this == o); - } - - bool counterDataEquivalent(const StyleRareNonInheritedData&) const; - bool shadowDataEquivalent(const StyleRareNonInheritedData&) const; - bool hasOpacity() const { return opacity < 1; } - - float opacity; // Whether or not we're transparent. - - float m_aspectRatioDenominator; - float m_aspectRatioNumerator; - - float m_perspective; - Length m_perspectiveOriginX; - Length m_perspectiveOriginY; - - DataRef m_flexibleBox; - DataRef - m_transform; // Transform properties (rotate, scale, skew, etc.) - - DataRef - m_filter; // Filter operations (url, sepia, blur, etc.) - - OwnPtr m_counterDirectives; - - RefPtr m_boxShadow; - - RefPtr m_clipPath; - - StyleColor m_textDecorationColor; - - int m_order; - - LengthPoint m_objectPosition; - - AtomicString m_ellipsis; - int m_maxLines; - - unsigned m_transformStyle3D : 1; // ETransformStyle3D - - unsigned m_alignContent : 3; // EAlignContent - unsigned m_alignItems : 4; // ItemPosition - unsigned m_alignItemsOverflowAlignment : 2; // OverflowAlignment - unsigned m_alignSelf : 4; // ItemPosition - unsigned m_alignSelfOverflowAlignment : 2; // OverflowAlignment - unsigned m_justifyContent : 3; // EJustifyContent - - unsigned textOverflow : 1; // Whether or not lines that spill out should be - // truncated with "..." - - unsigned m_textDecorationStyle : 3; // TextDecorationStyle - unsigned m_wrapFlow : 3; // WrapFlow - unsigned m_wrapThrough : 1; // WrapThrough - - unsigned m_hasAspectRatio : 1; // Whether or not an aspect ratio has been - // specified. - - unsigned m_touchAction : TouchActionBits; // TouchAction - - unsigned m_objectFit : 3; // ObjectFit - - unsigned m_isolation : 1; // Isolation - - unsigned m_justifyItems : 4; // ItemPosition - unsigned m_justifyItemsOverflowAlignment : 2; // OverflowAlignment - unsigned m_justifyItemsPositionType : 1; // Whether or not alignment uses the - // 'legacy' keyword. - - unsigned m_justifySelf : 4; // ItemPosition - unsigned m_justifySelfOverflowAlignment : 2; // OverflowAlignment - - private: - StyleRareNonInheritedData(); - StyleRareNonInheritedData(const StyleRareNonInheritedData&); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLERARENONINHERITEDDATA_H_ diff --git a/sky/engine/core/rendering/style/StyleSurroundData.cpp b/sky/engine/core/rendering/style/StyleSurroundData.cpp deleted file mode 100644 index 3b4b045fdb100..0000000000000 --- a/sky/engine/core/rendering/style/StyleSurroundData.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/StyleSurroundData.h" - -namespace blink { - -StyleSurroundData::StyleSurroundData() : margin(Fixed), padding(Fixed) {} - -StyleSurroundData::StyleSurroundData(const StyleSurroundData& o) - : RefCounted(), - offset(o.offset), - margin(o.margin), - padding(o.padding), - border(o.border) {} - -bool StyleSurroundData::operator==(const StyleSurroundData& o) const { - return offset == o.offset && margin == o.margin && padding == o.padding && - border == o.border; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleSurroundData.h b/sky/engine/core/rendering/style/StyleSurroundData.h deleted file mode 100644 index 7b36179784cf7..0000000000000 --- a/sky/engine/core/rendering/style/StyleSurroundData.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLESURROUNDDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLESURROUNDDATA_H_ - -#include "flutter/sky/engine/core/rendering/style/BorderData.h" -#include "flutter/sky/engine/platform/LengthBox.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -class StyleSurroundData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleSurroundData); - } - PassRefPtr copy() const { - return adoptRef(new StyleSurroundData(*this)); - } - - bool operator==(const StyleSurroundData& o) const; - bool operator!=(const StyleSurroundData& o) const { return !(*this == o); } - - LengthBox offset; - LengthBox margin; - LengthBox padding; - BorderData border; - - private: - StyleSurroundData(); - StyleSurroundData(const StyleSurroundData&); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLESURROUNDDATA_H_ diff --git a/sky/engine/core/rendering/style/StyleTransformData.cpp b/sky/engine/core/rendering/style/StyleTransformData.cpp deleted file mode 100644 index 4038803515519..0000000000000 --- a/sky/engine/core/rendering/style/StyleTransformData.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/StyleTransformData.h" - -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" - -namespace blink { - -StyleTransformData::StyleTransformData() - : m_operations(RenderStyle::initialTransform()), - m_x(RenderStyle::initialTransformOriginX()), - m_y(RenderStyle::initialTransformOriginY()), - m_z(RenderStyle::initialTransformOriginZ()) {} - -StyleTransformData::StyleTransformData(const StyleTransformData& o) - : RefCounted(), - m_operations(o.m_operations), - m_x(o.m_x), - m_y(o.m_y), - m_z(o.m_z) {} - -bool StyleTransformData::operator==(const StyleTransformData& o) const { - return m_x == o.m_x && m_y == o.m_y && m_z == o.m_z && - m_operations == o.m_operations; -} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleTransformData.h b/sky/engine/core/rendering/style/StyleTransformData.h deleted file mode 100644 index e9b5e4647b9ca..0000000000000 --- a/sky/engine/core/rendering/style/StyleTransformData.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLETRANSFORMDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLETRANSFORMDATA_H_ - -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/platform/transforms/TransformOperations.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -class StyleTransformData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleTransformData); - } - PassRefPtr copy() const { - return adoptRef(new StyleTransformData(*this)); - } - - bool operator==(const StyleTransformData& o) const; - bool operator!=(const StyleTransformData& o) const { return !(*this == o); } - - TransformOperations m_operations; - Length m_x; - Length m_y; - float m_z; - - private: - StyleTransformData(); - StyleTransformData(const StyleTransformData&); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLETRANSFORMDATA_H_ diff --git a/sky/engine/core/rendering/style/StyleVisualData.cpp b/sky/engine/core/rendering/style/StyleVisualData.cpp deleted file mode 100644 index b63967bb6f5a6..0000000000000 --- a/sky/engine/core/rendering/style/StyleVisualData.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/core/rendering/style/StyleVisualData.h" - -#include "flutter/sky/engine/core/rendering/style/RenderStyle.h" - -namespace blink { - -StyleVisualData::StyleVisualData() - : hasAutoClip(true), textDecoration(RenderStyle::initialTextDecoration()) {} - -StyleVisualData::~StyleVisualData() {} - -StyleVisualData::StyleVisualData(const StyleVisualData& o) - : RefCounted(), - clip(o.clip), - hasAutoClip(o.hasAutoClip), - textDecoration(o.textDecoration) {} - -} // namespace blink diff --git a/sky/engine/core/rendering/style/StyleVisualData.h b/sky/engine/core/rendering/style/StyleVisualData.h deleted file mode 100644 index 85061ae74f9cf..0000000000000 --- a/sky/engine/core/rendering/style/StyleVisualData.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_CORE_RENDERING_STYLE_STYLEVISUALDATA_H_ -#define SKY_ENGINE_CORE_RENDERING_STYLE_STYLEVISUALDATA_H_ - -#include "flutter/sky/engine/core/rendering/style/RenderStyleConstants.h" -#include "flutter/sky/engine/platform/LengthBox.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -class StyleVisualData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new StyleVisualData); - } - PassRefPtr copy() const { - return adoptRef(new StyleVisualData(*this)); - } - ~StyleVisualData(); - - bool operator==(const StyleVisualData& o) const { - return clip == o.clip && hasAutoClip == o.hasAutoClip && - textDecoration == o.textDecoration; - } - bool operator!=(const StyleVisualData& o) const { return !(*this == o); } - - LengthBox clip; - bool hasAutoClip : 1; - unsigned textDecoration - : TextDecorationBits; // Text decorations defined *only* by this element. - - private: - StyleVisualData(); - StyleVisualData(const StyleVisualData&); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_STYLE_STYLEVISUALDATA_H_ diff --git a/sky/engine/platform/BUILD.gn b/sky/engine/platform/BUILD.gn deleted file mode 100644 index 11b029ffccd73..0000000000000 --- a/sky/engine/platform/BUILD.gn +++ /dev/null @@ -1,325 +0,0 @@ -# Copyright 2014 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. - -source_set("platform") { - sources = [ - "CalculationValue.h", - "Decimal.cpp", - "Decimal.h", - "FloatConversion.h", - "Language.cpp", - "Language.h", - "LayoutUnit.h", - "Length.cpp", - "Length.h", - "LengthBox.cpp", - "LengthBox.h", - "LengthFunctions.cpp", - "LengthFunctions.h", - "LengthPoint.h", - "LengthSize.h", - "NotImplemented.h", - "Partitions.cpp", - "Partitions.h", - "PlatformExport.h", - "PurgeableVector.cpp", - "PurgeableVector.h", - "SharedBuffer.cpp", - "SharedBuffer.h", - "animation/AnimationUtilities.h", - "animation/AnimationValue.h", - "animation/KeyframeValueList.cpp", - "animation/KeyframeValueList.h", - "animation/TimingFunction.cpp", - "animation/TimingFunction.h", - "animation/UnitBezier.h", - "exported/Platform.cpp", - "exported/WebCommon.cpp", - "fonts/AlternateFontFamily.h", - "fonts/Character.cpp", - "fonts/Character.h", - "fonts/CustomFontData.h", - "fonts/FixedPitchFontType.h", - "fonts/Font.cpp", - "fonts/Font.h", - "fonts/FontBaseline.h", - "fonts/FontCache.cpp", - "fonts/FontCache.h", - "fonts/FontCacheClient.h", - "fonts/FontCacheKey.h", - "fonts/FontCustomPlatformData.h", - "fonts/FontData.cpp", - "fonts/FontData.h", - "fonts/FontDataCache.cpp", - "fonts/FontDataCache.h", - "fonts/FontDescription.cpp", - "fonts/FontDescription.h", - "fonts/FontFaceCreationParams.h", - "fonts/FontFallbackList.cpp", - "fonts/FontFallbackList.h", - "fonts/FontFamily.cpp", - "fonts/FontFamily.h", - "fonts/FontFeatureSettings.cpp", - "fonts/FontFeatureSettings.h", - "fonts/FontMetrics.h", - "fonts/FontOrientation.h", - "fonts/FontPlatformData.cpp", - "fonts/FontPlatformData.h", - "fonts/FontPlatformFeatures.h", - "fonts/FontRenderStyle.h", - "fonts/FontSelector.h", - "fonts/FontSmoothingMode.h", - "fonts/FontTraits.h", - "fonts/FontWidthVariant.h", - "fonts/Glyph.h", - "fonts/GlyphBuffer.h", - "fonts/GlyphMetricsMap.h", - "fonts/GlyphPage.h", - "fonts/GlyphPageTreeNode.cpp", - "fonts/GlyphPageTreeNode.h", - "fonts/Latin1TextIterator.h", - "fonts/SegmentedFontData.cpp", - "fonts/SegmentedFontData.h", - "fonts/SimpleFontData.cpp", - "fonts/SimpleFontData.h", - "fonts/TextBlob.h", - "fonts/TextRenderingMode.h", - "fonts/TypesettingFeatures.h", - "fonts/VDMXParser.cpp", - "fonts/VDMXParser.h", - "fonts/WidthCache.h", - "fonts/WidthIterator.cpp", - "fonts/WidthIterator.h", - "fonts/harfbuzz/FontHarfBuzz.cpp", - "fonts/harfbuzz/HarfBuzzFace.cpp", - "fonts/harfbuzz/HarfBuzzFace.h", - "fonts/harfbuzz/HarfBuzzFaceSkia.cpp", - "fonts/harfbuzz/HarfBuzzShaper.cpp", - "fonts/harfbuzz/HarfBuzzShaper.h", - "fonts/opentype/OpenTypeTypes.h", - "fonts/skia/FontCacheSkia.cpp", - "fonts/skia/FontCustomPlatformDataSkia.cpp", - "fonts/skia/FontPlatformDataSkia.cpp", - "fonts/skia/SimpleFontDataSkia.cpp", - "geometry/FloatBox.h", - "geometry/FloatBoxExtent.h", - "geometry/FloatPoint.cpp", - "geometry/FloatPoint.h", - "geometry/FloatPoint3D.cpp", - "geometry/FloatPoint3D.h", - "geometry/FloatQuad.cpp", - "geometry/FloatQuad.h", - "geometry/FloatRect.cpp", - "geometry/FloatRect.h", - "geometry/FloatRoundedRect.cpp", - "geometry/FloatRoundedRect.h", - "geometry/FloatSize.cpp", - "geometry/FloatSize.h", - "geometry/IntPoint.h", - "geometry/IntRect.cpp", - "geometry/IntRect.h", - "geometry/IntRectExtent.h", - "geometry/IntSize.h", - "geometry/IntSizeHash.h", - "geometry/LayoutBoxExtent.cpp", - "geometry/LayoutBoxExtent.h", - "geometry/LayoutPoint.h", - "geometry/LayoutRect.cpp", - "geometry/LayoutRect.h", - "geometry/LayoutSize.h", - "geometry/Region.cpp", - "geometry/Region.h", - "geometry/RoundedRect.cpp", - "geometry/RoundedRect.h", - "geometry/TransformState.cpp", - "geometry/TransformState.h", - "graphics/Color.cpp", - "graphics/Color.h", - "graphics/ColorSpace.cpp", - "graphics/ColorSpace.h", - "graphics/DashArray.h", - "graphics/DrawLooperBuilder.cpp", - "graphics/DrawLooperBuilder.h", - "graphics/FrameData.cpp", - "graphics/FrameData.h", - "graphics/GeneratedImage.cpp", - "graphics/GeneratedImage.h", - "graphics/Gradient.cpp", - "graphics/Gradient.h", - "graphics/GradientGeneratedImage.cpp", - "graphics/GradientGeneratedImage.h", - "graphics/GraphicsContext.cpp", - "graphics/GraphicsContext.h", - "graphics/GraphicsContextState.cpp", - "graphics/GraphicsContextState.h", - "graphics/GraphicsContextStateSaver.h", - "graphics/GraphicsTypes.cpp", - "graphics/GraphicsTypes.h", - "graphics/Image.cpp", - "graphics/Image.h", - "graphics/ImageFilter.cpp", - "graphics/ImageFilter.h", - "graphics/ImageObserver.cpp", - "graphics/ImageObserver.h", - "graphics/ImageOrientation.cpp", - "graphics/ImageOrientation.h", - "graphics/Path.cpp", - "graphics/Path.h", - "graphics/PathTraversalState.cpp", - "graphics/PathTraversalState.h", - "graphics/Pattern.cpp", - "graphics/Pattern.h", - "graphics/RegionTracker.cpp", - "graphics/RegionTracker.h", - "graphics/StrokeData.cpp", - "graphics/StrokeData.h", - "graphics/skia/SkSizeHash.h", - "graphics/skia/SkiaUtils.cpp", - "graphics/skia/SkiaUtils.h", - "heap/Handle.h", - "text/BidiCharacterRun.cpp", - "text/BidiCharacterRun.h", - "text/BidiContext.cpp", - "text/BidiContext.h", - "text/BidiResolver.h", - "text/BidiRunList.h", - "text/BidiTextRun.cpp", - "text/BidiTextRun.h", - "text/LineEnding.cpp", - "text/LineEnding.h", - "text/LocaleToScriptMapping.cpp", - "text/LocaleToScriptMapping.h", - "text/NonCJKGlyphOrientation.h", - "text/SurrogatePairAwareTextIterator.cpp", - "text/SurrogatePairAwareTextIterator.h", - "text/TextBoundaries.cpp", - "text/TextBoundaries.h", - "text/TextBox.h", - "text/TextBreakIterator.cpp", - "text/TextBreakIterator.h", - "text/TextBreakIteratorICU.cpp", - "text/TextBreakIteratorInternalICU.cpp", - "text/TextBreakIteratorInternalICU.h", - "text/TextDecoration.h", - "text/TextDirection.h", - "text/TextPath.h", - "text/TextRun.cpp", - "text/TextRun.h", - "text/TextRunIterator.h", - "text/TextStream.cpp", - "text/TextStream.h", - "text/UnicodeBidi.h", - "text/UnicodeRange.cpp", - "text/UnicodeRange.h", - "text/UnicodeUtilities.cpp", - "text/UnicodeUtilities.h", - "transforms/AffineTransform.cpp", - "transforms/AffineTransform.h", - "transforms/IdentityTransformOperation.h", - "transforms/InterpolatedTransformOperation.cpp", - "transforms/InterpolatedTransformOperation.h", - "transforms/Matrix3DTransformOperation.cpp", - "transforms/Matrix3DTransformOperation.h", - "transforms/MatrixTransformOperation.cpp", - "transforms/MatrixTransformOperation.h", - "transforms/PerspectiveTransformOperation.cpp", - "transforms/PerspectiveTransformOperation.h", - "transforms/RotateTransformOperation.cpp", - "transforms/RotateTransformOperation.h", - "transforms/ScaleTransformOperation.cpp", - "transforms/ScaleTransformOperation.h", - "transforms/SkewTransformOperation.cpp", - "transforms/SkewTransformOperation.h", - "transforms/TransformOperation.h", - "transforms/TransformOperations.cpp", - "transforms/TransformOperations.h", - "transforms/TransformationMatrix.cpp", - "transforms/TransformationMatrix.h", - "transforms/TranslateTransformOperation.cpp", - "transforms/TranslateTransformOperation.h", - ] - - deps = [ - "//third_party/harfbuzz", - ] - - public_deps = [ - "$flutter_root/common", - "$flutter_root/sky/engine/wtf", - "//third_party/skia", - "//third_party/skia:effects", - "//third_party/skia:gpu", - ] - - public_configs = [ - "$flutter_root:config", - ] - - if (!is_mac) { - sources += [ - "fonts/opentype/OpenTypeVerticalData.cpp", - "fonts/opentype/OpenTypeVerticalData.h", - ] - } - - if (is_linux || is_fuchsia) { - sources += [ "fonts/linux/FontPlatformDataLinux.cpp" ] - } - - if (is_ios || is_mac) { - sources += [ "fonts/apple/FontPlatformDataApple.cpp" ] - } - - if (is_mac && !is_ios) { - sources += [ "fonts/FontCacheEmpty.cpp" ] - } - - if (is_android || is_ios) { - sources += [ "fonts/mobile/FontCacheMobile.cpp" ] - } - - if (is_linux && !is_android) { - sources += [ "fonts/FontCacheEmpty.cpp" ] - } - - if (is_fuchsia) { - sources += [ - "fonts/fuchsia/FontCacheFuchsia.cpp", - "fonts/fuchsia/FontCacheFuchsia.h", - ] - - deps += [ "//garnet/public/lib/fonts/fidl" ] - } - - configs += [ - "$flutter_root/sky/engine:config", - "$flutter_root/sky/engine:non_test_config", - ] - - defines = [ - "BLINK_PLATFORM_IMPLEMENTATION=1", - "INSIDE_BLINK", - ] - - include_dirs = [ "$root_build_dir" ] - if (is_win) { - cflags = [ - "/wd4334", # Result of 32-bit shift implicity converted to 64 bits. - "/wd4724", # Modulo by 0. - ] - sources += [ - "fonts/win/FontCacheSkiaWin.cpp", - "fonts/win/FontFallbackWin.cpp", - "fonts/win/FontFallbackWin.h", - "fonts/win/FontPlatformDataWin.cpp", - ] - } - - if (is_android) { - # Add in some Linux files also shared with Android. - set_sources_assignment_filter([]) - sources += [ "fonts/linux/FontPlatformDataLinux.cpp" ] - set_sources_assignment_filter(sources_assignment_filter) - } -} diff --git a/sky/engine/platform/CalculationValue.h b/sky/engine/platform/CalculationValue.h deleted file mode 100644 index 229eea4b9c479..0000000000000 --- a/sky/engine/platform/CalculationValue.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_CALCULATIONVALUE_H_ -#define SKY_ENGINE_PLATFORM_CALCULATIONVALUE_H_ - -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/platform/LengthFunctions.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -class PLATFORM_EXPORT CalculationValue : public RefCounted { - public: - static PassRefPtr create(PixelsAndPercent value, - ValueRange range) { - return adoptRef(new CalculationValue(value, range)); - } - - float evaluate(float maxValue) const { - return pixels() + percent() / 100 * maxValue; - } - bool operator==(const CalculationValue& o) const { - return pixels() == o.pixels() && percent() == o.percent(); - } - bool isNonNegative() const { return m_isNonNegative; } - float pixels() const { return m_value.pixels; } - float percent() const { return m_value.percent; } - PixelsAndPercent pixelsAndPercent() const { return m_value; } - - private: - CalculationValue(PixelsAndPercent value, ValueRange range) - : m_value(value), m_isNonNegative(range == ValueRangeNonNegative) {} - - PixelsAndPercent m_value; - bool m_isNonNegative; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_CALCULATIONVALUE_H_ diff --git a/sky/engine/platform/Decimal.cpp b/sky/engine/platform/Decimal.cpp deleted file mode 100644 index 62bd3a8a18520..0000000000000 --- a/sky/engine/platform/Decimal.cpp +++ /dev/null @@ -1,997 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/Decimal.h" - -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" - -#include -#include - -namespace blink { - -namespace DecimalPrivate { - -static int const ExponentMax = 1023; -static int const ExponentMin = -1023; -static int const Precision = 18; - -static const uint64_t MaxCoefficient = - UINT64_C(0xDE0B6B3A763FFFF); // 999999999999999999 == 18 9's - -// This class handles Decimal special values. -class SpecialValueHandler { - WTF_MAKE_NONCOPYABLE(SpecialValueHandler); - - public: - enum HandleResult { - BothFinite, - BothInfinity, - EitherNaN, - LHSIsInfinity, - RHSIsInfinity, - }; - - SpecialValueHandler(const Decimal& lhs, const Decimal& rhs); - HandleResult handle(); - Decimal value() const; - - private: - enum Result { - ResultIsLHS, - ResultIsRHS, - ResultIsUnknown, - }; - - const Decimal& m_lhs; - const Decimal& m_rhs; - Result m_result; -}; - -SpecialValueHandler::SpecialValueHandler(const Decimal& lhs, const Decimal& rhs) - : m_lhs(lhs), m_rhs(rhs), m_result(ResultIsUnknown) {} - -SpecialValueHandler::HandleResult SpecialValueHandler::handle() { - if (m_lhs.isFinite() && m_rhs.isFinite()) - return BothFinite; - - const Decimal::EncodedData::FormatClass lhsClass = - m_lhs.value().formatClass(); - const Decimal::EncodedData::FormatClass rhsClass = - m_rhs.value().formatClass(); - if (lhsClass == Decimal::EncodedData::ClassNaN) { - m_result = ResultIsLHS; - return EitherNaN; - } - - if (rhsClass == Decimal::EncodedData::ClassNaN) { - m_result = ResultIsRHS; - return EitherNaN; - } - - if (lhsClass == Decimal::EncodedData::ClassInfinity) - return rhsClass == Decimal::EncodedData::ClassInfinity ? BothInfinity - : LHSIsInfinity; - - if (rhsClass == Decimal::EncodedData::ClassInfinity) - return RHSIsInfinity; - - ASSERT_NOT_REACHED(); - return BothFinite; -} - -Decimal SpecialValueHandler::value() const { - switch (m_result) { - case ResultIsLHS: - return m_lhs; - case ResultIsRHS: - return m_rhs; - case ResultIsUnknown: - default: - ASSERT_NOT_REACHED(); - return m_lhs; - } -} - -// This class is used for 128 bit unsigned integer arithmetic. -class UInt128 { - public: - UInt128(uint64_t low, uint64_t high) : m_high(high), m_low(low) {} - - UInt128& operator/=(uint32_t); - - uint64_t high() const { return m_high; } - uint64_t low() const { return m_low; } - - static UInt128 multiply(uint64_t u, uint64_t v) { - return UInt128(u * v, multiplyHigh(u, v)); - } - - private: - static uint32_t highUInt32(uint64_t x) { - return static_cast(x >> 32); - } - static uint32_t lowUInt32(uint64_t x) { - return static_cast(x & ((static_cast(1) << 32) - 1)); - } - static uint64_t makeUInt64(uint32_t low, uint32_t high) { - return low | (static_cast(high) << 32); - } - - static uint64_t multiplyHigh(uint64_t, uint64_t); - - uint64_t m_high; - uint64_t m_low; -}; - -UInt128& UInt128::operator/=(const uint32_t divisor) { - ASSERT(divisor); - - if (!m_high) { - m_low /= divisor; - return *this; - } - - uint32_t dividend[4]; - dividend[0] = lowUInt32(m_low); - dividend[1] = highUInt32(m_low); - dividend[2] = lowUInt32(m_high); - dividend[3] = highUInt32(m_high); - - uint32_t quotient[4]; - uint32_t remainder = 0; - for (int i = 3; i >= 0; --i) { - const uint64_t work = makeUInt64(dividend[i], remainder); - remainder = static_cast(work % divisor); - quotient[i] = static_cast(work / divisor); - } - m_low = makeUInt64(quotient[0], quotient[1]); - m_high = makeUInt64(quotient[2], quotient[3]); - return *this; -} - -// Returns high 64bit of 128bit product. -uint64_t UInt128::multiplyHigh(uint64_t u, uint64_t v) { - const uint64_t uLow = lowUInt32(u); - const uint64_t uHigh = highUInt32(u); - const uint64_t vLow = lowUInt32(v); - const uint64_t vHigh = highUInt32(v); - const uint64_t partialProduct = uHigh * vLow + highUInt32(uLow * vLow); - return uHigh * vHigh + highUInt32(partialProduct) + - highUInt32(uLow * vHigh + lowUInt32(partialProduct)); -} - -static int countDigits(uint64_t x) { - int numberOfDigits = 0; - for (uint64_t powerOfTen = 1; x >= powerOfTen; powerOfTen *= 10) { - ++numberOfDigits; - if (powerOfTen >= std::numeric_limits::max() / 10) - break; - } - return numberOfDigits; -} - -static uint64_t scaleDown(uint64_t x, int n) { - ASSERT(n >= 0); - while (n > 0 && x) { - x /= 10; - --n; - } - return x; -} - -static uint64_t scaleUp(uint64_t x, int n) { - ASSERT(n >= 0); - ASSERT(n < Precision); - - uint64_t y = 1; - uint64_t z = 10; - for (;;) { - if (n & 1) - y = y * z; - - n >>= 1; - if (!n) - return x * y; - - z = z * z; - } -} - -} // namespace DecimalPrivate - -using namespace DecimalPrivate; - -Decimal::EncodedData::EncodedData(Sign sign, FormatClass formatClass) - : m_coefficient(0), - m_exponent(0), - m_formatClass(formatClass), - m_sign(sign) {} - -Decimal::EncodedData::EncodedData(Sign sign, int exponent, uint64_t coefficient) - : m_formatClass(coefficient ? ClassNormal : ClassZero), m_sign(sign) { - if (exponent >= ExponentMin && exponent <= ExponentMax) { - while (coefficient > MaxCoefficient) { - coefficient /= 10; - ++exponent; - } - } - - if (exponent > ExponentMax) { - m_coefficient = 0; - m_exponent = 0; - m_formatClass = ClassInfinity; - return; - } - - if (exponent < ExponentMin) { - m_coefficient = 0; - m_exponent = 0; - m_formatClass = ClassZero; - return; - } - - m_coefficient = coefficient; - m_exponent = static_cast(exponent); -} - -bool Decimal::EncodedData::operator==(const EncodedData& another) const { - return m_sign == another.m_sign && m_formatClass == another.m_formatClass && - m_exponent == another.m_exponent && - m_coefficient == another.m_coefficient; -} - -Decimal::Decimal(int32_t i32) - : m_data(i32 < 0 ? Negative : Positive, - 0, - i32 < 0 ? static_cast(-static_cast(i32)) - : static_cast(i32)) {} - -Decimal::Decimal(Sign sign, int exponent, uint64_t coefficient) - : m_data(sign, exponent, coefficient) {} - -Decimal::Decimal(const EncodedData& data) : m_data(data) {} - -Decimal::Decimal(const Decimal& other) : m_data(other.m_data) {} - -Decimal& Decimal::operator=(const Decimal& other) { - m_data = other.m_data; - return *this; -} - -Decimal& Decimal::operator+=(const Decimal& other) { - m_data = (*this + other).m_data; - return *this; -} - -Decimal& Decimal::operator-=(const Decimal& other) { - m_data = (*this - other).m_data; - return *this; -} - -Decimal& Decimal::operator*=(const Decimal& other) { - m_data = (*this * other).m_data; - return *this; -} - -Decimal& Decimal::operator/=(const Decimal& other) { - m_data = (*this / other).m_data; - return *this; -} - -Decimal Decimal::operator-() const { - if (isNaN()) - return *this; - - Decimal result(*this); - result.m_data.setSign(invertSign(m_data.sign())); - return result; -} - -Decimal Decimal::operator+(const Decimal& rhs) const { - const Decimal& lhs = *this; - const Sign lhsSign = lhs.sign(); - const Sign rhsSign = rhs.sign(); - - SpecialValueHandler handler(lhs, rhs); - switch (handler.handle()) { - case SpecialValueHandler::BothFinite: - break; - - case SpecialValueHandler::BothInfinity: - return lhsSign == rhsSign ? lhs : nan(); - - case SpecialValueHandler::EitherNaN: - return handler.value(); - - case SpecialValueHandler::LHSIsInfinity: - return lhs; - - case SpecialValueHandler::RHSIsInfinity: - return rhs; - } - - const AlignedOperands alignedOperands = alignOperands(lhs, rhs); - - const uint64_t result = - lhsSign == rhsSign - ? alignedOperands.lhsCoefficient + alignedOperands.rhsCoefficient - : alignedOperands.lhsCoefficient - alignedOperands.rhsCoefficient; - - if (lhsSign == Negative && rhsSign == Positive && !result) - return Decimal(Positive, alignedOperands.exponent, 0); - - return static_cast(result) >= 0 - ? Decimal(lhsSign, alignedOperands.exponent, result) - : Decimal(invertSign(lhsSign), alignedOperands.exponent, - -static_cast(result)); -} - -Decimal Decimal::operator-(const Decimal& rhs) const { - const Decimal& lhs = *this; - const Sign lhsSign = lhs.sign(); - const Sign rhsSign = rhs.sign(); - - SpecialValueHandler handler(lhs, rhs); - switch (handler.handle()) { - case SpecialValueHandler::BothFinite: - break; - - case SpecialValueHandler::BothInfinity: - return lhsSign == rhsSign ? nan() : lhs; - - case SpecialValueHandler::EitherNaN: - return handler.value(); - - case SpecialValueHandler::LHSIsInfinity: - return lhs; - - case SpecialValueHandler::RHSIsInfinity: - return infinity(invertSign(rhsSign)); - } - - const AlignedOperands alignedOperands = alignOperands(lhs, rhs); - - const uint64_t result = - lhsSign == rhsSign - ? alignedOperands.lhsCoefficient - alignedOperands.rhsCoefficient - : alignedOperands.lhsCoefficient + alignedOperands.rhsCoefficient; - - if (lhsSign == Negative && rhsSign == Negative && !result) - return Decimal(Positive, alignedOperands.exponent, 0); - - return static_cast(result) >= 0 - ? Decimal(lhsSign, alignedOperands.exponent, result) - : Decimal(invertSign(lhsSign), alignedOperands.exponent, - -static_cast(result)); -} - -Decimal Decimal::operator*(const Decimal& rhs) const { - const Decimal& lhs = *this; - const Sign lhsSign = lhs.sign(); - const Sign rhsSign = rhs.sign(); - const Sign resultSign = lhsSign == rhsSign ? Positive : Negative; - - SpecialValueHandler handler(lhs, rhs); - switch (handler.handle()) { - case SpecialValueHandler::BothFinite: { - const uint64_t lhsCoefficient = lhs.m_data.coefficient(); - const uint64_t rhsCoefficient = rhs.m_data.coefficient(); - int resultExponent = lhs.exponent() + rhs.exponent(); - UInt128 work(UInt128::multiply(lhsCoefficient, rhsCoefficient)); - while (work.high()) { - work /= 10; - ++resultExponent; - } - return Decimal(resultSign, resultExponent, work.low()); - } - - case SpecialValueHandler::BothInfinity: - return infinity(resultSign); - - case SpecialValueHandler::EitherNaN: - return handler.value(); - - case SpecialValueHandler::LHSIsInfinity: - return rhs.isZero() ? nan() : infinity(resultSign); - - case SpecialValueHandler::RHSIsInfinity: - return lhs.isZero() ? nan() : infinity(resultSign); - } - - ASSERT_NOT_REACHED(); - return nan(); -} - -Decimal Decimal::operator/(const Decimal& rhs) const { - const Decimal& lhs = *this; - const Sign lhsSign = lhs.sign(); - const Sign rhsSign = rhs.sign(); - const Sign resultSign = lhsSign == rhsSign ? Positive : Negative; - - SpecialValueHandler handler(lhs, rhs); - switch (handler.handle()) { - case SpecialValueHandler::BothFinite: - break; - - case SpecialValueHandler::BothInfinity: - return nan(); - - case SpecialValueHandler::EitherNaN: - return handler.value(); - - case SpecialValueHandler::LHSIsInfinity: - return infinity(resultSign); - - case SpecialValueHandler::RHSIsInfinity: - return zero(resultSign); - } - - ASSERT(lhs.isFinite()); - ASSERT(rhs.isFinite()); - - if (rhs.isZero()) - return lhs.isZero() ? nan() : infinity(resultSign); - - int resultExponent = lhs.exponent() - rhs.exponent(); - - if (lhs.isZero()) - return Decimal(resultSign, resultExponent, 0); - - uint64_t remainder = lhs.m_data.coefficient(); - const uint64_t divisor = rhs.m_data.coefficient(); - uint64_t result = 0; - while (result < MaxCoefficient / 100) { - while (remainder < divisor) { - remainder *= 10; - result *= 10; - --resultExponent; - } - result += remainder / divisor; - remainder %= divisor; - if (!remainder) - break; - } - - if (remainder > divisor / 2) - ++result; - - return Decimal(resultSign, resultExponent, result); -} - -bool Decimal::operator==(const Decimal& rhs) const { - return m_data == rhs.m_data || compareTo(rhs).isZero(); -} - -bool Decimal::operator!=(const Decimal& rhs) const { - if (m_data == rhs.m_data) - return false; - const Decimal result = compareTo(rhs); - if (result.isNaN()) - return false; - return !result.isZero(); -} - -bool Decimal::operator<(const Decimal& rhs) const { - const Decimal result = compareTo(rhs); - if (result.isNaN()) - return false; - return !result.isZero() && result.isNegative(); -} - -bool Decimal::operator<=(const Decimal& rhs) const { - if (m_data == rhs.m_data) - return true; - const Decimal result = compareTo(rhs); - if (result.isNaN()) - return false; - return result.isZero() || result.isNegative(); -} - -bool Decimal::operator>(const Decimal& rhs) const { - const Decimal result = compareTo(rhs); - if (result.isNaN()) - return false; - return !result.isZero() && result.isPositive(); -} - -bool Decimal::operator>=(const Decimal& rhs) const { - if (m_data == rhs.m_data) - return true; - const Decimal result = compareTo(rhs); - if (result.isNaN()) - return false; - return result.isZero() || !result.isNegative(); -} - -Decimal Decimal::abs() const { - Decimal result(*this); - result.m_data.setSign(Positive); - return result; -} - -Decimal::AlignedOperands Decimal::alignOperands(const Decimal& lhs, - const Decimal& rhs) { - ASSERT(lhs.isFinite()); - ASSERT(rhs.isFinite()); - - const int lhsExponent = lhs.exponent(); - const int rhsExponent = rhs.exponent(); - int exponent = std::min(lhsExponent, rhsExponent); - uint64_t lhsCoefficient = lhs.m_data.coefficient(); - uint64_t rhsCoefficient = rhs.m_data.coefficient(); - - if (lhsExponent > rhsExponent) { - const int numberOfLHSDigits = countDigits(lhsCoefficient); - if (numberOfLHSDigits) { - const int lhsShiftAmount = lhsExponent - rhsExponent; - const int overflow = numberOfLHSDigits + lhsShiftAmount - Precision; - if (overflow <= 0) { - lhsCoefficient = scaleUp(lhsCoefficient, lhsShiftAmount); - } else { - lhsCoefficient = scaleUp(lhsCoefficient, lhsShiftAmount - overflow); - rhsCoefficient = scaleDown(rhsCoefficient, overflow); - exponent += overflow; - } - } - - } else if (lhsExponent < rhsExponent) { - const int numberOfRHSDigits = countDigits(rhsCoefficient); - if (numberOfRHSDigits) { - const int rhsShiftAmount = rhsExponent - lhsExponent; - const int overflow = numberOfRHSDigits + rhsShiftAmount - Precision; - if (overflow <= 0) { - rhsCoefficient = scaleUp(rhsCoefficient, rhsShiftAmount); - } else { - rhsCoefficient = scaleUp(rhsCoefficient, rhsShiftAmount - overflow); - lhsCoefficient = scaleDown(lhsCoefficient, overflow); - exponent += overflow; - } - } - } - - AlignedOperands alignedOperands; - alignedOperands.exponent = exponent; - alignedOperands.lhsCoefficient = lhsCoefficient; - alignedOperands.rhsCoefficient = rhsCoefficient; - return alignedOperands; -} - -static bool isMultiplePowersOfTen(uint64_t coefficient, int n) { - return !coefficient || !(coefficient % scaleUp(1, n)); -} - -// Round toward positive infinity. -// Note: Mac ports defines ceil(x) as wtf_ceil(x), so we can't use name "ceil" -// here. -Decimal Decimal::ceiling() const { - if (isSpecial()) - return *this; - - if (exponent() >= 0) - return *this; - - uint64_t result = m_data.coefficient(); - const int numberOfDigits = countDigits(result); - const int numberOfDropDigits = -exponent(); - if (numberOfDigits < numberOfDropDigits) - return isPositive() ? Decimal(1) : zero(Positive); - - result = scaleDown(result, numberOfDropDigits); - if (isPositive() && - !isMultiplePowersOfTen(m_data.coefficient(), numberOfDropDigits)) - ++result; - return Decimal(sign(), 0, result); -} - -Decimal Decimal::compareTo(const Decimal& rhs) const { - const Decimal result(*this - rhs); - switch (result.m_data.formatClass()) { - case EncodedData::ClassInfinity: - return result.isNegative() ? Decimal(-1) : Decimal(1); - - case EncodedData::ClassNaN: - case EncodedData::ClassNormal: - return result; - - case EncodedData::ClassZero: - return zero(Positive); - - default: - ASSERT_NOT_REACHED(); - return nan(); - } -} - -// Round toward negative infinity. -Decimal Decimal::floor() const { - if (isSpecial()) - return *this; - - if (exponent() >= 0) - return *this; - - uint64_t result = m_data.coefficient(); - const int numberOfDigits = countDigits(result); - const int numberOfDropDigits = -exponent(); - if (numberOfDigits < numberOfDropDigits) - return isPositive() ? zero(Positive) : Decimal(-1); - - result = scaleDown(result, numberOfDropDigits); - if (isNegative() && - !isMultiplePowersOfTen(m_data.coefficient(), numberOfDropDigits)) - ++result; - return Decimal(sign(), 0, result); -} - -Decimal Decimal::fromDouble(double doubleValue) { - if (std::isfinite(doubleValue)) - return fromString(String::numberToStringECMAScript(doubleValue)); - - if (std::isinf(doubleValue)) - return infinity(doubleValue < 0 ? Negative : Positive); - - return nan(); -} - -Decimal Decimal::fromString(const String& str) { - int exponent = 0; - Sign exponentSign = Positive; - int numberOfDigits = 0; - int numberOfDigitsAfterDot = 0; - int numberOfExtraDigits = 0; - Sign sign = Positive; - - enum { - StateDigit, - StateDot, - StateDotDigit, - StateE, - StateEDigit, - StateESign, - StateSign, - StateStart, - StateZero, - } state = StateStart; - -#define HandleCharAndBreak(expected, nextState) \ - if (ch == expected) { \ - state = nextState; \ - break; \ - } - -#define HandleTwoCharsAndBreak(expected1, expected2, nextState) \ - if (ch == expected1 || ch == expected2) { \ - state = nextState; \ - break; \ - } - - uint64_t accumulator = 0; - for (unsigned index = 0; index < str.length(); ++index) { - const int ch = str[index]; - switch (state) { - case StateDigit: - if (ch >= '0' && ch <= '9') { - if (numberOfDigits < Precision) { - ++numberOfDigits; - accumulator *= 10; - accumulator += ch - '0'; - } else { - ++numberOfExtraDigits; - } - break; - } - - HandleCharAndBreak('.', StateDot); - HandleTwoCharsAndBreak('E', 'e', StateE); - return nan(); - - case StateDot: - case StateDotDigit: - if (ch >= '0' && ch <= '9') { - if (numberOfDigits < Precision) { - ++numberOfDigits; - ++numberOfDigitsAfterDot; - accumulator *= 10; - accumulator += ch - '0'; - } - state = StateDotDigit; - break; - } - - HandleTwoCharsAndBreak('E', 'e', StateE); - return nan(); - - case StateE: - if (ch == '+') { - exponentSign = Positive; - state = StateESign; - break; - } - - if (ch == '-') { - exponentSign = Negative; - state = StateESign; - break; - } - - if (ch >= '0' && ch <= '9') { - exponent = ch - '0'; - state = StateEDigit; - break; - } - - return nan(); - - case StateEDigit: - if (ch >= '0' && ch <= '9') { - exponent *= 10; - exponent += ch - '0'; - if (exponent > ExponentMax + Precision) { - if (accumulator) - return exponentSign == Negative ? zero(Positive) : infinity(sign); - return zero(sign); - } - state = StateEDigit; - break; - } - - return nan(); - - case StateESign: - if (ch >= '0' && ch <= '9') { - exponent = ch - '0'; - state = StateEDigit; - break; - } - - return nan(); - - case StateSign: - if (ch >= '1' && ch <= '9') { - accumulator = ch - '0'; - numberOfDigits = 1; - state = StateDigit; - break; - } - - HandleCharAndBreak('0', StateZero); - return nan(); - - case StateStart: - if (ch >= '1' && ch <= '9') { - accumulator = ch - '0'; - numberOfDigits = 1; - state = StateDigit; - break; - } - - if (ch == '-') { - sign = Negative; - state = StateSign; - break; - } - - if (ch == '+') { - sign = Positive; - state = StateSign; - break; - } - - HandleCharAndBreak('0', StateZero); - HandleCharAndBreak('.', StateDot); - return nan(); - - case StateZero: - if (ch == '0') - break; - - if (ch >= '1' && ch <= '9') { - accumulator = ch - '0'; - numberOfDigits = 1; - state = StateDigit; - break; - } - - HandleCharAndBreak('.', StateDot); - HandleTwoCharsAndBreak('E', 'e', StateE); - return nan(); - - default: - ASSERT_NOT_REACHED(); - return nan(); - } - } - - if (state == StateZero) - return zero(sign); - - if (state == StateDigit || state == StateEDigit || state == StateDotDigit) { - int resultExponent = exponent * (exponentSign == Negative ? -1 : 1) - - numberOfDigitsAfterDot + numberOfExtraDigits; - if (resultExponent < ExponentMin) - return zero(Positive); - - const int overflow = resultExponent - ExponentMax + 1; - if (overflow > 0) { - if (overflow + numberOfDigits - numberOfDigitsAfterDot > Precision) - return infinity(sign); - accumulator = scaleUp(accumulator, overflow); - resultExponent -= overflow; - } - - return Decimal(sign, resultExponent, accumulator); - } - - return nan(); -} - -Decimal Decimal::infinity(const Sign sign) { - return Decimal(EncodedData(sign, EncodedData::ClassInfinity)); -} - -Decimal Decimal::nan() { - return Decimal(EncodedData(Positive, EncodedData::ClassNaN)); -} - -Decimal Decimal::remainder(const Decimal& rhs) const { - const Decimal quotient = *this / rhs; - return quotient.isSpecial() - ? quotient - : *this - (quotient.isNegative() ? quotient.ceiling() - : quotient.floor()) * - rhs; -} - -Decimal Decimal::round() const { - if (isSpecial()) - return *this; - - if (exponent() >= 0) - return *this; - - uint64_t result = m_data.coefficient(); - const int numberOfDigits = countDigits(result); - const int numberOfDropDigits = -exponent(); - if (numberOfDigits < numberOfDropDigits) - return zero(Positive); - - result = scaleDown(result, numberOfDropDigits - 1); - if (result % 10 >= 5) - result += 10; - result /= 10; - return Decimal(sign(), 0, result); -} - -double Decimal::toDouble() const { - if (isFinite()) { - bool valid; - const double doubleValue = toString().toDouble(&valid); - return valid ? doubleValue : std::numeric_limits::quiet_NaN(); - } - - if (isInfinity()) - return isNegative() ? -std::numeric_limits::infinity() - : std::numeric_limits::infinity(); - - return std::numeric_limits::quiet_NaN(); -} - -String Decimal::toString() const { - switch (m_data.formatClass()) { - case EncodedData::ClassInfinity: - return sign() ? "-Infinity" : "Infinity"; - - case EncodedData::ClassNaN: - return "NaN"; - - case EncodedData::ClassNormal: - case EncodedData::ClassZero: - break; - - default: - ASSERT_NOT_REACHED(); - return ""; - } - - StringBuilder builder; - if (sign()) - builder.append('-'); - - int originalExponent = exponent(); - uint64_t coefficient = m_data.coefficient(); - - if (originalExponent < 0) { - const int maxDigits = DBL_DIG; - uint64_t lastDigit = 0; - while (countDigits(coefficient) > maxDigits) { - lastDigit = coefficient % 10; - coefficient /= 10; - ++originalExponent; - } - - if (lastDigit >= 5) - ++coefficient; - - while (originalExponent < 0 && coefficient && !(coefficient % 10)) { - coefficient /= 10; - ++originalExponent; - } - } - - const String digits = String::number(coefficient); - int coefficientLength = static_cast(digits.length()); - const int adjustedExponent = originalExponent + coefficientLength - 1; - if (originalExponent <= 0 && adjustedExponent >= -6) { - if (!originalExponent) { - builder.append(digits); - return builder.toString(); - } - - if (adjustedExponent >= 0) { - for (int i = 0; i < coefficientLength; ++i) { - builder.append(digits[i]); - if (i == adjustedExponent) - builder.append('.'); - } - return builder.toString(); - } - - builder.appendLiteral("0."); - for (int i = adjustedExponent + 1; i < 0; ++i) - builder.append('0'); - - builder.append(digits); - - } else { - builder.append(digits[0]); - while (coefficientLength >= 2 && digits[coefficientLength - 1] == '0') - --coefficientLength; - if (coefficientLength >= 2) { - builder.append('.'); - for (int i = 1; i < coefficientLength; ++i) - builder.append(digits[i]); - } - - if (adjustedExponent) { - builder.append(adjustedExponent < 0 ? "e" : "e+"); - builder.appendNumber(adjustedExponent); - } - } - return builder.toString(); -} - -Decimal Decimal::zero(Sign sign) { - return Decimal(EncodedData(sign, EncodedData::ClassZero)); -} - -} // namespace blink diff --git a/sky/engine/platform/Decimal.h b/sky/engine/platform/Decimal.h deleted file mode 100644 index 6088487f9f2b4..0000000000000 --- a/sky/engine/platform/Decimal.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_DECIMAL_H_ -#define SKY_ENGINE_PLATFORM_DECIMAL_H_ - -#include -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -namespace DecimalPrivate { -class SpecialValueHandler; -} - -// This class represents decimal base floating point number. -// -// FIXME: Once all C++ compiler support decimal type, we should replace this -// class to compiler supported one. See below URI for current status of decimal -// type for C++: // -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1977.html -class PLATFORM_EXPORT Decimal { - WTF_MAKE_FAST_ALLOCATED; - - public: - enum Sign { - Positive, - Negative, - }; - - // You should not use EncodedData other than unit testing. - class EncodedData { - // For accessing FormatClass. - friend class Decimal; - friend class DecimalPrivate::SpecialValueHandler; - - public: - EncodedData(Sign, int exponent, uint64_t coefficient); - - bool operator==(const EncodedData&) const; - bool operator!=(const EncodedData& another) const { - return !operator==(another); - } - - uint64_t coefficient() const { return m_coefficient; } - int countDigits() const; - int exponent() const { return m_exponent; } - bool isFinite() const { return !isSpecial(); } - bool isInfinity() const { return m_formatClass == ClassInfinity; } - bool isNaN() const { return m_formatClass == ClassNaN; } - bool isSpecial() const { - return m_formatClass == ClassInfinity || m_formatClass == ClassNaN; - } - bool isZero() const { return m_formatClass == ClassZero; } - Sign sign() const { return m_sign; } - void setSign(Sign sign) { m_sign = sign; } - - private: - enum FormatClass { - ClassInfinity, - ClassNormal, - ClassNaN, - ClassZero, - }; - - EncodedData(Sign, FormatClass); - FormatClass formatClass() const { return m_formatClass; } - - uint64_t m_coefficient; - int16_t m_exponent; - FormatClass m_formatClass; - Sign m_sign; - }; - - Decimal(int32_t = 0); - Decimal(Sign, int exponent, uint64_t coefficient); - Decimal(const Decimal&); - - Decimal& operator=(const Decimal&); - Decimal& operator+=(const Decimal&); - Decimal& operator-=(const Decimal&); - Decimal& operator*=(const Decimal&); - Decimal& operator/=(const Decimal&); - - Decimal operator-() const; - - bool operator==(const Decimal&) const; - bool operator!=(const Decimal&) const; - bool operator<(const Decimal&) const; - bool operator<=(const Decimal&) const; - bool operator>(const Decimal&) const; - bool operator>=(const Decimal&) const; - - Decimal operator+(const Decimal&) const; - Decimal operator-(const Decimal&) const; - Decimal operator*(const Decimal&)const; - Decimal operator/(const Decimal&) const; - - int exponent() const { - ASSERT(isFinite()); - return m_data.exponent(); - } - - bool isFinite() const { return m_data.isFinite(); } - bool isInfinity() const { return m_data.isInfinity(); } - bool isNaN() const { return m_data.isNaN(); } - bool isNegative() const { return sign() == Negative; } - bool isPositive() const { return sign() == Positive; } - bool isSpecial() const { return m_data.isSpecial(); } - bool isZero() const { return m_data.isZero(); } - - Decimal abs() const; - Decimal ceiling() const; - Decimal floor() const; - Decimal remainder(const Decimal&) const; - Decimal round() const; - - double toDouble() const; - // Note: toString method supports infinity and nan but fromString not. - String toString() const; - - static Decimal fromDouble(double); - // fromString supports following syntax EBNF: - // number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)? - // | sign? '.' digit+ (exponent-marker sign? digit+)? - // sign ::= '+' | '-' - // exponent-marker ::= 'e' | 'E' - // digit ::= '0' | '1' | ... | '9' - // Note: fromString doesn't support "infinity" and "nan". - static Decimal fromString(const String&); - static Decimal infinity(Sign); - static Decimal nan(); - static Decimal zero(Sign); - - // You should not use below methods. We expose them for unit testing. - explicit Decimal(const EncodedData&); - const EncodedData& value() const { return m_data; } - - private: - struct AlignedOperands { - uint64_t lhsCoefficient; - uint64_t rhsCoefficient; - int exponent; - }; - - Decimal(double); - Decimal compareTo(const Decimal&) const; - - static AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs); - static inline Sign invertSign(Sign sign) { - return sign == Negative ? Positive : Negative; - } - - Sign sign() const { return m_data.sign(); } - - EncodedData m_data; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_DECIMAL_H_ diff --git a/sky/engine/platform/DecimalTest.cpp b/sky/engine/platform/DecimalTest.cpp deleted file mode 100644 index 48abe09c60439..0000000000000 --- a/sky/engine/platform/DecimalTest.cpp +++ /dev/null @@ -1,1166 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/Decimal.h" - -#include -#include -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/text/CString.h" - -namespace blink { - -std::ostream& operator<<(std::ostream& os, const Decimal& decimal) { - Decimal::EncodedData data = decimal.value(); - return os << "encode(" << String::number(data.coefficient()).ascii().data() - << ", " << String::number(data.exponent()).ascii().data() << ", " - << (data.sign() == Decimal::Negative ? "Negative" : "Positive") - << ")=" << decimal.toString().ascii().data(); -} - -} // namespace blink - -using namespace blink; - -// Simulate WebCore/html/StepRange -class DecimalStepRange { - public: - Decimal maximum; - Decimal minimum; - Decimal step; - - DecimalStepRange(const Decimal& minimum, - const Decimal& maximum, - const Decimal& step) - : maximum(maximum), minimum(minimum), step(step) {} - - Decimal clampValue(Decimal value) const { - const Decimal result = minimum + ((value - minimum) / step).round() * step; - ASSERT(result.isFinite()); - return result > maximum ? result - step : result; - } -}; - -class DecimalTest : public ::testing::Test { - protected: - typedef Decimal::Sign Sign; - - protected: - static const Sign Positive = Decimal::Positive; - - protected: - static const Sign Negative = Decimal::Negative; - - Decimal encode(uint64_t coefficient, int exponent, Sign sign) { - return Decimal(sign, exponent, coefficient); - } - - protected: - Decimal fromString(const String& string) { - return Decimal::fromString(string); - } - - protected: - Decimal stepDown(const String& minimum, - const String& maximum, - const String& step, - const String& valueString, - int numberOfStepTimes) { - DecimalStepRange stepRange(fromString(minimum), fromString(maximum), - fromString(step)); - Decimal value = fromString(valueString); - for (int i = 0; i < numberOfStepTimes; ++i) { - value -= stepRange.step; - value = stepRange.clampValue(value); - } - return value; - } - - protected: - Decimal stepUp(const String& minimum, - const String& maximum, - const String& step, - const String& valueString, - int numberOfStepTimes) { - DecimalStepRange stepRange(fromString(minimum), fromString(maximum), - fromString(step)); - Decimal value = fromString(valueString); - for (int i = 0; i < numberOfStepTimes; ++i) { - value += stepRange.step; - value = stepRange.clampValue(value); - } - return value; - } -}; - -// FIXME: We should use expectedSign without "Decimal::", however, g++ causes -// undefined references for DecimalTest::Positive and Negative. -#define EXPECT_DECIMAL_ENCODED_DATA_EQ(expectedCoefficient, expectedExponent, \ - expectedSign, decimal) \ - EXPECT_EQ((expectedCoefficient), (decimal).value().coefficient()); \ - EXPECT_EQ((expectedExponent), (decimal).value().exponent()); \ - EXPECT_EQ(Decimal::expectedSign, (decimal).value().sign()); - -#define EXPECT_DECIMAL_STREQ(expected, decimal) \ - EXPECT_STREQ((expected), (decimal).toString().ascii().data()) - -TEST_F(DecimalTest, Abs) { - EXPECT_EQ(encode(0, 0, Positive), encode(0, 0, Positive).abs()); - EXPECT_EQ(encode(0, 0, Positive), encode(0, 0, Negative).abs()); - - EXPECT_EQ(encode(0, 10, Positive), encode(0, 10, Positive).abs()); - EXPECT_EQ(encode(0, 10, Positive), encode(0, 10, Negative).abs()); - - EXPECT_EQ(encode(0, -10, Positive), encode(0, -10, Positive).abs()); - EXPECT_EQ(encode(0, -10, Positive), encode(0, -10, Negative).abs()); - - EXPECT_EQ(encode(1, 0, Positive), encode(1, 0, Positive).abs()); - EXPECT_EQ(encode(1, 0, Positive), encode(1, 0, Negative).abs()); - - EXPECT_EQ(encode(1, 10, Positive), encode(1, 10, Positive).abs()); - EXPECT_EQ(encode(1, 10, Positive), encode(1, 10, Negative).abs()); - - EXPECT_EQ(encode(1, -10, Positive), encode(1, -10, Positive).abs()); - EXPECT_EQ(encode(1, -10, Positive), encode(1, -10, Negative).abs()); -} - -TEST_F(DecimalTest, AbsBigExponent) { - EXPECT_EQ(encode(1, 1000, Positive), encode(1, 1000, Positive).abs()); - EXPECT_EQ(encode(1, 1000, Positive), encode(1, 1000, Negative).abs()); -} - -TEST_F(DecimalTest, AbsSmallExponent) { - EXPECT_EQ(encode(1, -1000, Positive), encode(1, -1000, Positive).abs()); - EXPECT_EQ(encode(1, -1000, Positive), encode(1, -1000, Negative).abs()); -} - -TEST_F(DecimalTest, AbsSpecialValues) { - EXPECT_EQ(Decimal::infinity(Positive), Decimal::infinity(Positive).abs()); - EXPECT_EQ(Decimal::infinity(Positive), Decimal::infinity(Negative).abs()); - EXPECT_EQ(Decimal::nan(), Decimal::nan().abs()); -} - -TEST_F(DecimalTest, Add) { - EXPECT_EQ(encode(0, 0, Positive), Decimal(0) + Decimal(0)); - EXPECT_EQ(Decimal(1), Decimal(2) + Decimal(-1)); - EXPECT_EQ(Decimal(1), Decimal(-1) + Decimal(2)); - EXPECT_EQ(encode(100, 0, Positive), Decimal(99) + Decimal(1)); - EXPECT_EQ(encode(100, 0, Negative), Decimal(-50) + Decimal(-50)); - EXPECT_EQ(encode(UINT64_C(1000000000000000), 35, Positive), - encode(1, 50, Positive) + Decimal(1)); - EXPECT_EQ(encode(UINT64_C(1000000000000000), 35, Positive), - Decimal(1) + encode(1, 50, Positive)); - EXPECT_EQ(encode(UINT64_C(10000000001), 0, Positive), - encode(1, 10, Positive) + Decimal(1)); - EXPECT_EQ(encode(UINT64_C(10000000001), 0, Positive), - Decimal(1) + encode(1, 10, Positive)); - EXPECT_EQ(encode(1, 0, Positive), - encode(1, -1022, Positive) + encode(1, 0, Positive)); - EXPECT_EQ(encode(2, -1022, Positive), - encode(1, -1022, Positive) + encode(1, -1022, Positive)); -} - -TEST_F(DecimalTest, AddBigExponent) { - EXPECT_EQ(encode(1, 1022, Positive), - encode(1, 1022, Positive) + encode(1, 0, Positive)); - EXPECT_EQ(encode(2, 1022, Positive), - encode(1, 1022, Positive) + encode(1, 1022, Positive)); - EXPECT_EQ(Decimal::infinity(Positive), - encode(std::numeric_limits::max(), 1022, Positive) + - encode(1, 0, Positive)); - EXPECT_EQ(encode(1, 1022, Positive), - encode(1, 1022, Positive) + encode(1, -1000, Positive)); -} - -TEST_F(DecimalTest, AddSmallExponent) { - EXPECT_EQ(encode(1, 0, Positive), - encode(1, -1022, Positive) + encode(1, 0, Positive)); - EXPECT_EQ(encode(2, -1022, Positive), - encode(1, -1022, Positive) + encode(1, -1022, Positive)); -} - -TEST_F(DecimalTest, AddSpecialValues) { - const Decimal Infinity(Decimal::infinity(Positive)); - const Decimal MinusInfinity(Decimal::infinity(Negative)); - const Decimal NaN(Decimal::nan()); - const Decimal Ten(10); - - EXPECT_EQ(Infinity, Infinity + Infinity); - EXPECT_EQ(NaN, Infinity + MinusInfinity); - EXPECT_EQ(NaN, MinusInfinity + Infinity); - EXPECT_EQ(MinusInfinity, MinusInfinity + MinusInfinity); - - EXPECT_EQ(Infinity, Infinity + Ten); - EXPECT_EQ(Infinity, Ten + Infinity); - EXPECT_EQ(MinusInfinity, MinusInfinity + Ten); - EXPECT_EQ(MinusInfinity, Ten + MinusInfinity); - - EXPECT_EQ(NaN, NaN + NaN); - EXPECT_EQ(NaN, NaN + Ten); - EXPECT_EQ(NaN, Ten + NaN); - - EXPECT_EQ(NaN, NaN - Infinity); - EXPECT_EQ(NaN, NaN - MinusInfinity); - EXPECT_EQ(NaN, Infinity - NaN); - EXPECT_EQ(NaN, MinusInfinity - NaN); -} - -TEST_F(DecimalTest, Ceiling) { - EXPECT_EQ(Decimal(1), Decimal(1).ceiling()); - EXPECT_EQ(Decimal(1), encode(1, -10, Positive).ceiling()); - EXPECT_EQ(Decimal(2), encode(11, -1, Positive).ceiling()); - EXPECT_EQ(Decimal(2), encode(13, -1, Positive).ceiling()); - EXPECT_EQ(Decimal(2), encode(15, -1, Positive).ceiling()); - EXPECT_EQ(Decimal(2), encode(19, -1, Positive).ceiling()); - EXPECT_EQ(Decimal(2), encode(151, -2, Positive).ceiling()); - EXPECT_EQ(Decimal(2), encode(101, -2, Positive).ceiling()); - EXPECT_EQ(Decimal(1), encode(199, -3, Positive).ceiling()); - EXPECT_EQ(Decimal(2), encode(199, -2, Positive).ceiling()); - EXPECT_EQ(Decimal(3), encode(209, -2, Positive).ceiling()); - - EXPECT_EQ(Decimal(-1), Decimal(-1).ceiling()); - EXPECT_EQ(Decimal(0), encode(1, -10, Negative).ceiling()); - EXPECT_EQ(Decimal(-1), encode(11, -1, Negative).ceiling()); - EXPECT_EQ(Decimal(-1), encode(13, -1, Negative).ceiling()); - EXPECT_EQ(Decimal(-1), encode(15, -1, Negative).ceiling()); - EXPECT_EQ(Decimal(-1), encode(19, -1, Negative).ceiling()); - EXPECT_EQ(Decimal(-1), encode(151, -2, Negative).ceiling()); - EXPECT_EQ(Decimal(-1), encode(101, -2, Negative).ceiling()); - EXPECT_EQ(Decimal(0), encode(199, -3, Negative).ceiling()); - EXPECT_EQ(Decimal(-1), encode(199, -2, Negative).ceiling()); - EXPECT_EQ(Decimal(-2), encode(209, -2, Negative).ceiling()); -} - -TEST_F(DecimalTest, CeilingBigExponent) { - EXPECT_EQ(encode(1, 1000, Positive), encode(1, 1000, Positive).ceiling()); - EXPECT_EQ(encode(1, 1000, Negative), encode(1, 1000, Negative).ceiling()); -} - -TEST_F(DecimalTest, CeilingSmallExponent) { - EXPECT_EQ(encode(1, 0, Positive), encode(1, -1000, Positive).ceiling()); - EXPECT_EQ(encode(0, 0, Negative), encode(1, -1000, Negative).ceiling()); -} - -TEST_F(DecimalTest, CeilingSpecialValues) { - EXPECT_EQ(Decimal::infinity(Positive), Decimal::infinity(Positive).ceiling()); - EXPECT_EQ(Decimal::infinity(Negative), Decimal::infinity(Negative).ceiling()); - EXPECT_EQ(Decimal::nan(), Decimal::nan().ceiling()); -} - -TEST_F(DecimalTest, Compare) { - EXPECT_TRUE(Decimal(0) == Decimal(0)); - EXPECT_TRUE(Decimal(0) != Decimal(1)); - EXPECT_TRUE(Decimal(0) < Decimal(1)); - EXPECT_TRUE(Decimal(0) <= Decimal(0)); - EXPECT_TRUE(Decimal(0) > Decimal(-1)); - EXPECT_TRUE(Decimal(0) >= Decimal(0)); - - EXPECT_FALSE(Decimal(1) == Decimal(2)); - EXPECT_FALSE(Decimal(1) != Decimal(1)); - EXPECT_FALSE(Decimal(1) < Decimal(0)); - EXPECT_FALSE(Decimal(1) <= Decimal(0)); - EXPECT_FALSE(Decimal(1) > Decimal(2)); - EXPECT_FALSE(Decimal(1) >= Decimal(2)); -} - -TEST_F(DecimalTest, CompareBigExponent) { - EXPECT_TRUE(encode(1, 1000, Positive) == encode(1, 1000, Positive)); - EXPECT_FALSE(encode(1, 1000, Positive) != encode(1, 1000, Positive)); - EXPECT_FALSE(encode(1, 1000, Positive) < encode(1, 1000, Positive)); - EXPECT_TRUE(encode(1, 1000, Positive) <= encode(1, 1000, Positive)); - EXPECT_FALSE(encode(1, 1000, Positive) > encode(1, 1000, Positive)); - EXPECT_TRUE(encode(1, 1000, Positive) >= encode(1, 1000, Positive)); - - EXPECT_TRUE(encode(1, 1000, Negative) == encode(1, 1000, Negative)); - EXPECT_FALSE(encode(1, 1000, Negative) != encode(1, 1000, Negative)); - EXPECT_FALSE(encode(1, 1000, Negative) < encode(1, 1000, Negative)); - EXPECT_TRUE(encode(1, 1000, Negative) <= encode(1, 1000, Negative)); - EXPECT_FALSE(encode(1, 1000, Negative) > encode(1, 1000, Negative)); - EXPECT_TRUE(encode(1, 1000, Negative) >= encode(1, 1000, Negative)); - - EXPECT_FALSE(encode(2, 1000, Positive) == encode(1, 1000, Positive)); - EXPECT_TRUE(encode(2, 1000, Positive) != encode(1, 1000, Positive)); - EXPECT_FALSE(encode(2, 1000, Positive) < encode(1, 1000, Positive)); - EXPECT_FALSE(encode(2, 1000, Positive) <= encode(1, 1000, Positive)); - EXPECT_TRUE(encode(2, 1000, Positive) > encode(1, 1000, Positive)); - EXPECT_TRUE(encode(2, 1000, Positive) >= encode(1, 1000, Positive)); - - EXPECT_FALSE(encode(2, 1000, Negative) == encode(1, 1000, Negative)); - EXPECT_TRUE(encode(2, 1000, Negative) != encode(1, 1000, Negative)); - EXPECT_TRUE(encode(2, 1000, Negative) < encode(1, 1000, Negative)); - EXPECT_TRUE(encode(2, 1000, Negative) <= encode(1, 1000, Negative)); - EXPECT_FALSE(encode(2, 1000, Negative) > encode(1, 1000, Negative)); - EXPECT_FALSE(encode(2, 1000, Negative) >= encode(1, 1000, Negative)); -} - -TEST_F(DecimalTest, CompareSmallExponent) { - EXPECT_TRUE(encode(1, -1000, Positive) == encode(1, -1000, Positive)); - EXPECT_FALSE(encode(1, -1000, Positive) != encode(1, -1000, Positive)); - EXPECT_FALSE(encode(1, -1000, Positive) < encode(1, -1000, Positive)); - EXPECT_TRUE(encode(1, -1000, Positive) <= encode(1, -1000, Positive)); - EXPECT_FALSE(encode(1, -1000, Positive) > encode(1, -1000, Positive)); - EXPECT_TRUE(encode(1, -1000, Positive) >= encode(1, -1000, Positive)); - - EXPECT_TRUE(encode(1, -1000, Negative) == encode(1, -1000, Negative)); - EXPECT_FALSE(encode(1, -1000, Negative) != encode(1, -1000, Negative)); - EXPECT_FALSE(encode(1, -1000, Negative) < encode(1, -1000, Negative)); - EXPECT_TRUE(encode(1, -1000, Negative) <= encode(1, -1000, Negative)); - EXPECT_FALSE(encode(1, -1000, Negative) > encode(1, -1000, Negative)); - EXPECT_TRUE(encode(1, -1000, Negative) >= encode(1, -1000, Negative)); - - EXPECT_FALSE(encode(2, -1000, Positive) == encode(1, -1000, Positive)); - EXPECT_TRUE(encode(2, -1000, Positive) != encode(1, -1000, Positive)); - EXPECT_FALSE(encode(2, -1000, Positive) < encode(1, -1000, Positive)); - EXPECT_FALSE(encode(2, -1000, Positive) <= encode(1, -1000, Positive)); - EXPECT_TRUE(encode(2, -1000, Positive) > encode(1, -1000, Positive)); - EXPECT_TRUE(encode(2, -1000, Positive) >= encode(1, -1000, Positive)); - - EXPECT_FALSE(encode(2, -1000, Negative) == encode(1, -1000, Negative)); - EXPECT_TRUE(encode(2, -1000, Negative) != encode(1, -1000, Negative)); - EXPECT_TRUE(encode(2, -1000, Negative) < encode(1, -1000, Negative)); - EXPECT_TRUE(encode(2, -1000, Negative) <= encode(1, -1000, Negative)); - EXPECT_FALSE(encode(2, -1000, Negative) > encode(1, -1000, Negative)); - EXPECT_FALSE(encode(2, -1000, Negative) >= encode(1, -1000, Negative)); -} - -TEST_F(DecimalTest, CompareSpecialValues) { - const Decimal Infinity(Decimal::infinity(Positive)); - const Decimal MinusInfinity(Decimal::infinity(Negative)); - const Decimal NaN(Decimal::nan()); - const Decimal Zero(Decimal::zero(Positive)); - const Decimal MinusZero(Decimal::zero(Negative)); - const Decimal Ten(10); - - EXPECT_TRUE(Zero == Zero); - EXPECT_FALSE(Zero != Zero); - EXPECT_FALSE(Zero < Zero); - EXPECT_TRUE(Zero <= Zero); - EXPECT_FALSE(Zero > Zero); - EXPECT_TRUE(Zero >= Zero); - - EXPECT_TRUE(Zero == MinusZero); - EXPECT_FALSE(Zero != MinusZero); - EXPECT_FALSE(Zero < MinusZero); - EXPECT_TRUE(Zero <= MinusZero); - EXPECT_FALSE(Zero > MinusZero); - EXPECT_TRUE(Zero >= MinusZero); - - EXPECT_TRUE(MinusZero == Zero); - EXPECT_FALSE(MinusZero != Zero); - EXPECT_FALSE(MinusZero < Zero); - EXPECT_TRUE(MinusZero <= Zero); - EXPECT_FALSE(MinusZero > Zero); - EXPECT_TRUE(MinusZero >= Zero); - - EXPECT_TRUE(MinusZero == MinusZero); - EXPECT_FALSE(MinusZero != MinusZero); - EXPECT_FALSE(MinusZero < MinusZero); - EXPECT_TRUE(MinusZero <= MinusZero); - EXPECT_FALSE(MinusZero > MinusZero); - EXPECT_TRUE(MinusZero >= MinusZero); - - EXPECT_TRUE(Infinity == Infinity); - EXPECT_FALSE(Infinity != Infinity); - EXPECT_FALSE(Infinity < Infinity); - EXPECT_TRUE(Infinity <= Infinity); - EXPECT_FALSE(Infinity > Infinity); - EXPECT_TRUE(Infinity >= Infinity); - - EXPECT_FALSE(Infinity == Ten); - EXPECT_TRUE(Infinity != Ten); - EXPECT_FALSE(Infinity < Ten); - EXPECT_FALSE(Infinity <= Ten); - EXPECT_TRUE(Infinity > Ten); - EXPECT_TRUE(Infinity >= Ten); - - EXPECT_FALSE(Infinity == MinusInfinity); - EXPECT_TRUE(Infinity != MinusInfinity); - EXPECT_FALSE(Infinity < MinusInfinity); - EXPECT_FALSE(Infinity <= MinusInfinity); - EXPECT_TRUE(Infinity > MinusInfinity); - EXPECT_TRUE(Infinity >= MinusInfinity); - - EXPECT_FALSE(Infinity == NaN); - EXPECT_FALSE(Infinity != NaN); - EXPECT_FALSE(Infinity < NaN); - EXPECT_FALSE(Infinity <= NaN); - EXPECT_FALSE(Infinity > NaN); - EXPECT_FALSE(Infinity >= NaN); - - EXPECT_FALSE(MinusInfinity == Infinity); - EXPECT_TRUE(MinusInfinity != Infinity); - EXPECT_TRUE(MinusInfinity < Infinity); - EXPECT_TRUE(MinusInfinity <= Infinity); - EXPECT_FALSE(MinusInfinity > Infinity); - EXPECT_FALSE(MinusInfinity >= Infinity); - - EXPECT_FALSE(MinusInfinity == Ten); - EXPECT_TRUE(MinusInfinity != Ten); - EXPECT_TRUE(MinusInfinity < Ten); - EXPECT_TRUE(MinusInfinity <= Ten); - EXPECT_FALSE(MinusInfinity > Ten); - EXPECT_FALSE(MinusInfinity >= Ten); - - EXPECT_TRUE(MinusInfinity == MinusInfinity); - EXPECT_FALSE(MinusInfinity != MinusInfinity); - EXPECT_FALSE(MinusInfinity < MinusInfinity); - EXPECT_TRUE(MinusInfinity <= MinusInfinity); - EXPECT_FALSE(MinusInfinity > MinusInfinity); - EXPECT_TRUE(MinusInfinity >= MinusInfinity); - - EXPECT_FALSE(MinusInfinity == NaN); - EXPECT_FALSE(MinusInfinity != NaN); - EXPECT_FALSE(MinusInfinity < NaN); - EXPECT_FALSE(MinusInfinity <= NaN); - EXPECT_FALSE(MinusInfinity > NaN); - EXPECT_FALSE(MinusInfinity >= NaN); - - EXPECT_FALSE(NaN == Infinity); - EXPECT_FALSE(NaN != Infinity); - EXPECT_FALSE(NaN < Infinity); - EXPECT_FALSE(NaN <= Infinity); - EXPECT_FALSE(NaN > Infinity); - EXPECT_FALSE(NaN >= Infinity); - - EXPECT_FALSE(NaN == Ten); - EXPECT_FALSE(NaN != Ten); - EXPECT_FALSE(NaN < Ten); - EXPECT_FALSE(NaN <= Ten); - EXPECT_FALSE(NaN > Ten); - EXPECT_FALSE(NaN >= Ten); - - EXPECT_FALSE(NaN == MinusInfinity); - EXPECT_FALSE(NaN != MinusInfinity); - EXPECT_FALSE(NaN < MinusInfinity); - EXPECT_FALSE(NaN <= MinusInfinity); - EXPECT_FALSE(NaN > MinusInfinity); - EXPECT_FALSE(NaN >= MinusInfinity); - - EXPECT_TRUE(NaN == NaN); - EXPECT_FALSE(NaN != NaN); - EXPECT_FALSE(NaN < NaN); - EXPECT_TRUE(NaN <= NaN); - EXPECT_FALSE(NaN > NaN); - EXPECT_TRUE(NaN >= NaN); -} - -TEST_F(DecimalTest, Constructor) { - EXPECT_DECIMAL_ENCODED_DATA_EQ(0u, 0, Positive, encode(0, 0, Positive)); - EXPECT_DECIMAL_ENCODED_DATA_EQ(0u, 0, Negative, encode(0, 0, Negative)); - EXPECT_DECIMAL_ENCODED_DATA_EQ(1u, 0, Positive, encode(1, 0, Positive)); - EXPECT_DECIMAL_ENCODED_DATA_EQ(1u, 0, Negative, encode(1, 0, Negative)); - EXPECT_DECIMAL_ENCODED_DATA_EQ(1u, 1022, Positive, encode(1, 1022, Positive)); - EXPECT_DECIMAL_ENCODED_DATA_EQ(1u, 1022, Negative, encode(1, 1022, Negative)); - EXPECT_DECIMAL_ENCODED_DATA_EQ(1u, 1023, Positive, encode(1, 1023, Positive)); - EXPECT_DECIMAL_ENCODED_DATA_EQ(1u, 1023, Negative, encode(1, 1023, Negative)); - EXPECT_TRUE(encode(1, 2000, Positive).isInfinity()); - EXPECT_TRUE(encode(1, 2000, Negative).isInfinity()); - EXPECT_DECIMAL_ENCODED_DATA_EQ(0u, 0, Positive, encode(1, -2000, Positive)); - EXPECT_DECIMAL_ENCODED_DATA_EQ(0u, 0, Negative, encode(1, -2000, Negative)); - EXPECT_DECIMAL_ENCODED_DATA_EQ( - UINT64_C(99999999999999998), 0, Positive, - encode(UINT64_C(99999999999999998), 0, Positive)); - EXPECT_DECIMAL_ENCODED_DATA_EQ( - UINT64_C(99999999999999998), 0, Negative, - encode(UINT64_C(99999999999999998), 0, Negative)); - EXPECT_DECIMAL_ENCODED_DATA_EQ( - UINT64_C(99999999999999999), 0, Positive, - encode(UINT64_C(99999999999999999), 0, Positive)); - EXPECT_DECIMAL_ENCODED_DATA_EQ( - UINT64_C(99999999999999999), 0, Negative, - encode(UINT64_C(99999999999999999), 0, Negative)); - EXPECT_DECIMAL_ENCODED_DATA_EQ( - UINT64_C(100000000000000000), 0, Positive, - encode(UINT64_C(100000000000000000), 0, Positive)); - EXPECT_DECIMAL_ENCODED_DATA_EQ( - UINT64_C(100000000000000000), 0, Negative, - encode(UINT64_C(100000000000000000), 0, Negative)); -} - -TEST_F(DecimalTest, Division) { - EXPECT_EQ(encode(0, 0, Positive), Decimal(0) / Decimal(1)); - EXPECT_EQ(encode(2, 0, Negative), Decimal(2) / Decimal(-1)); - EXPECT_EQ(encode(5, -1, Negative), Decimal(-1) / Decimal(2)); - EXPECT_EQ(encode(99, 0, Positive), Decimal(99) / Decimal(1)); - EXPECT_EQ(Decimal(1), Decimal(-50) / Decimal(-50)); - EXPECT_EQ(encode(UINT64_C(33333333333333333), -17, Positive), - Decimal(1) / Decimal(3)); - EXPECT_EQ(encode(UINT64_C(12345678901234), -1, Positive), - encode(UINT64_C(12345678901234), 0, Positive) / Decimal(10)); -} - -TEST_F(DecimalTest, DivisionBigExponent) { - EXPECT_EQ(encode(1, 1022, Positive), - encode(1, 1022, Positive) / encode(1, 0, Positive)); - EXPECT_EQ(encode(1, 0, Positive), - encode(1, 1022, Positive) / encode(1, 1022, Positive)); - EXPECT_EQ(Decimal::infinity(Positive), - encode(1, 1022, Positive) / encode(1, -1000, Positive)); -} - -TEST_F(DecimalTest, DivisionSmallExponent) { - EXPECT_EQ(encode(1, -1022, Positive), - encode(1, -1022, Positive) / encode(1, 0, Positive)); - EXPECT_EQ(encode(1, 0, Positive), - encode(1, -1022, Positive) / encode(1, -1022, Positive)); -} - -TEST_F(DecimalTest, DivisionSpecialValues) { - const Decimal Infinity(Decimal::infinity(Positive)); - const Decimal MinusInfinity(Decimal::infinity(Negative)); - const Decimal NaN(Decimal::nan()); - const Decimal Zero(Decimal::zero(Positive)); - const Decimal MinusZero(Decimal::zero(Negative)); - const Decimal Ten(10); - const Decimal MinusTen(-10); - - EXPECT_EQ(NaN, Zero / Zero); - EXPECT_EQ(NaN, Zero / MinusZero); - EXPECT_EQ(NaN, MinusZero / Zero); - EXPECT_EQ(NaN, MinusZero / MinusZero); - - EXPECT_EQ(Infinity, Ten / Zero); - EXPECT_EQ(MinusInfinity, Ten / MinusZero); - EXPECT_EQ(MinusInfinity, MinusTen / Zero); - EXPECT_EQ(Infinity, MinusTen / MinusZero); - - EXPECT_EQ(Infinity, Infinity / Zero); - EXPECT_EQ(MinusInfinity, Infinity / MinusZero); - EXPECT_EQ(MinusInfinity, MinusInfinity / Zero); - EXPECT_EQ(Infinity, MinusInfinity / MinusZero); - - EXPECT_EQ(NaN, Infinity / Infinity); - EXPECT_EQ(NaN, Infinity / MinusInfinity); - EXPECT_EQ(NaN, MinusInfinity / Infinity); - EXPECT_EQ(NaN, MinusInfinity / MinusInfinity); - - EXPECT_EQ(Zero, Ten / Infinity); - EXPECT_EQ(MinusZero, Ten / MinusInfinity); - EXPECT_EQ(MinusZero, MinusTen / Infinity); - EXPECT_EQ(Zero, MinusTen / MinusInfinity); - - EXPECT_EQ(NaN, NaN / NaN); - EXPECT_EQ(NaN, NaN / Ten); - EXPECT_EQ(NaN, Ten / NaN); - - EXPECT_EQ(NaN, NaN / Infinity); - EXPECT_EQ(NaN, NaN / MinusInfinity); - EXPECT_EQ(NaN, Infinity / NaN); - EXPECT_EQ(NaN, MinusInfinity / NaN); -} - -TEST_F(DecimalTest, EncodedData) { - EXPECT_EQ(encode(0, 0, Positive), encode(0, 0, Positive)); - EXPECT_EQ(encode(0, 0, Negative), encode(0, 0, Negative)); - EXPECT_EQ(Decimal(1), Decimal(1)); - EXPECT_EQ(encode(1, 0, Negative), encode(1, 0, Negative)); - EXPECT_EQ(Decimal::infinity(Positive), encode(1, 2000, Positive)); - EXPECT_EQ(Decimal::zero(Positive), encode(1, -2000, Positive)); -} - -TEST_F(DecimalTest, Floor) { - EXPECT_EQ(Decimal(1), Decimal(1).floor()); - EXPECT_EQ(Decimal(0), encode(1, -10, Positive).floor()); - EXPECT_EQ(Decimal(1), encode(11, -1, Positive).floor()); - EXPECT_EQ(Decimal(1), encode(13, -1, Positive).floor()); - EXPECT_EQ(Decimal(1), encode(15, -1, Positive).floor()); - EXPECT_EQ(Decimal(1), encode(19, -1, Positive).floor()); - EXPECT_EQ(Decimal(1), encode(193332, -5, Positive).floor()); - EXPECT_EQ(Decimal(12), encode(12002, -3, Positive).floor()); - - EXPECT_EQ(Decimal(-1), Decimal(-1).floor()); - EXPECT_EQ(Decimal(-1), encode(1, -10, Negative).floor()); - EXPECT_EQ(Decimal(-2), encode(11, -1, Negative).floor()); - EXPECT_EQ(Decimal(-2), encode(13, -1, Negative).floor()); - EXPECT_EQ(Decimal(-2), encode(15, -1, Negative).floor()); - EXPECT_EQ(Decimal(-2), encode(19, -1, Negative).floor()); - EXPECT_EQ(Decimal(-2), encode(193332, -5, Negative).floor()); - EXPECT_EQ(Decimal(-13), encode(12002, -3, Negative).floor()); -} - -TEST_F(DecimalTest, FloorBigExponent) { - EXPECT_EQ(encode(1, 1000, Positive), encode(1, 1000, Positive).floor()); - EXPECT_EQ(encode(1, 1000, Negative), encode(1, 1000, Negative).floor()); -} - -TEST_F(DecimalTest, FloorSmallExponent) { - EXPECT_EQ(encode(0, 0, Positive), encode(1, -1000, Positive).floor()); - EXPECT_EQ(encode(1, 0, Negative), encode(1, -1000, Negative).floor()); -} - -TEST_F(DecimalTest, FloorSpecialValues) { - EXPECT_EQ(Decimal::infinity(Positive), Decimal::infinity(Positive).floor()); - EXPECT_EQ(Decimal::infinity(Negative), Decimal::infinity(Negative).floor()); - EXPECT_EQ(Decimal::nan(), Decimal::nan().floor()); -} - -TEST_F(DecimalTest, FromDouble) { - EXPECT_EQ(encode(0, 0, Positive), Decimal::fromDouble(0.0)); - EXPECT_EQ(encode(0, 0, Negative), Decimal::fromDouble(-0.0)); - EXPECT_EQ(encode(1, 0, Positive), Decimal::fromDouble(1)); - EXPECT_EQ(encode(1, 0, Negative), Decimal::fromDouble(-1)); - EXPECT_EQ(encode(123, 0, Positive), Decimal::fromDouble(123)); - EXPECT_EQ(encode(123, 0, Negative), Decimal::fromDouble(-123)); - EXPECT_EQ(encode(1, -1, Positive), Decimal::fromDouble(0.1)); - EXPECT_EQ(encode(1, -1, Negative), Decimal::fromDouble(-0.1)); -} - -TEST_F(DecimalTest, FromDoubleLimits) { - EXPECT_EQ(encode(UINT64_C(2220446049250313), -31, Positive), - Decimal::fromDouble(std::numeric_limits::epsilon())); - EXPECT_EQ(encode(UINT64_C(2220446049250313), -31, Negative), - Decimal::fromDouble(-std::numeric_limits::epsilon())); - EXPECT_EQ(encode(UINT64_C(17976931348623157), 292, Positive), - Decimal::fromDouble(std::numeric_limits::max())); - EXPECT_EQ(encode(UINT64_C(17976931348623157), 292, Negative), - Decimal::fromDouble(-std::numeric_limits::max())); - EXPECT_EQ(encode(UINT64_C(22250738585072014), -324, Positive), - Decimal::fromDouble(std::numeric_limits::min())); - EXPECT_EQ(encode(UINT64_C(22250738585072014), -324, Negative), - Decimal::fromDouble(-std::numeric_limits::min())); - EXPECT_TRUE(Decimal::fromDouble(std::numeric_limits::infinity()) - .isInfinity()); - EXPECT_TRUE(Decimal::fromDouble(-std::numeric_limits::infinity()) - .isInfinity()); - EXPECT_TRUE( - Decimal::fromDouble(std::numeric_limits::quiet_NaN()).isNaN()); - EXPECT_TRUE( - Decimal::fromDouble(-std::numeric_limits::quiet_NaN()).isNaN()); -} - -TEST_F(DecimalTest, FromInt32) { - EXPECT_EQ(encode(0, 0, Positive), Decimal(0)); - EXPECT_EQ(encode(1, 0, Positive), Decimal(1)); - EXPECT_EQ(encode(1, 0, Negative), Decimal(-1)); - EXPECT_EQ(encode(100, 0, Positive), Decimal(100)); - EXPECT_EQ(encode(100, 0, Negative), Decimal(-100)); - EXPECT_EQ(encode(0x7FFFFFFF, 0, Positive), - Decimal(std::numeric_limits::max())); - EXPECT_EQ(encode(0x80000000u, 0, Negative), - Decimal(std::numeric_limits::min())); -} - -TEST_F(DecimalTest, FromString) { - EXPECT_EQ(encode(0, 0, Positive), fromString("0")); - EXPECT_EQ(encode(0, 0, Negative), fromString("-0")); - EXPECT_EQ(Decimal(1), fromString("1")); - EXPECT_EQ(encode(1, 0, Negative), fromString("-1")); - EXPECT_EQ(Decimal(1), fromString("01")); - EXPECT_EQ(encode(3, 0, Positive), fromString("+3")); - EXPECT_EQ(encode(0, 3, Positive), fromString("0E3")); - EXPECT_EQ(encode(5, -1, Positive), fromString(".5")); - EXPECT_EQ(encode(100, 0, Positive), fromString("100")); - EXPECT_EQ(encode(100, 0, Negative), fromString("-100")); - EXPECT_EQ(encode(123, -2, Positive), fromString("1.23")); - EXPECT_EQ(encode(123, -2, Negative), fromString("-1.23")); - EXPECT_EQ(encode(123, 8, Positive), fromString("1.23E10")); - EXPECT_EQ(encode(123, 8, Negative), fromString("-1.23E10")); - EXPECT_EQ(encode(123, 8, Positive), fromString("1.23E+10")); - EXPECT_EQ(encode(123, 8, Negative), fromString("-1.23E+10")); - EXPECT_EQ(encode(123, -12, Positive), fromString("1.23E-10")); - EXPECT_EQ(encode(123, -12, Negative), fromString("-1.23E-10")); - EXPECT_EQ(encode(5, -7, Positive), fromString("0.0000005")); - EXPECT_EQ(encode(0, 0, Positive), fromString("0e9999")); - EXPECT_EQ(encode(123, -3, Positive), fromString("0.123")); - EXPECT_EQ(encode(0, -2, Positive), fromString("00.00")); - EXPECT_EQ(encode(1, 2, Positive), fromString("1E2")); - EXPECT_EQ(Decimal::infinity(Positive), fromString("1E20000")); - EXPECT_EQ(Decimal::zero(Positive), fromString("1E-20000")); - EXPECT_EQ(encode(1000, 1023, Positive), fromString("1E1026")); - EXPECT_EQ(Decimal::zero(Positive), fromString("1E-1026")); - EXPECT_EQ(Decimal::infinity(Positive), fromString("1234567890E1036")); - - // 2^1024 - const uint64_t leadingDigitsOf2PowerOf1024 = UINT64_C(17976931348623159); - EXPECT_EQ(encode(leadingDigitsOf2PowerOf1024, 292, Positive), - fromString("1797693134862315907729305190789024733617976978942306572" - "7343008115773267580550096313270847732240753602112011387" - "9871393357658789768814416622492847430639474124377767893" - "4248654852763022196012460941194530829520850057688381506" - "8234246288147391311054082723716335051068458629823994724" - "5938479716304835356329624224137216")); -} - -// These strings are look like proper number, but we don't accept them. -TEST_F(DecimalTest, FromStringLikeNumber) { - EXPECT_EQ(Decimal::nan(), fromString(" 123 ")); - EXPECT_EQ(Decimal::nan(), fromString("1,234")); -} - -// fromString doesn't support infinity and NaN. -TEST_F(DecimalTest, FromStringSpecialValues) { - EXPECT_EQ(Decimal::nan(), fromString("INF")); - EXPECT_EQ(Decimal::nan(), fromString("Infinity")); - EXPECT_EQ(Decimal::nan(), fromString("infinity")); - EXPECT_EQ(Decimal::nan(), fromString("+Infinity")); - EXPECT_EQ(Decimal::nan(), fromString("+infinity")); - EXPECT_EQ(Decimal::nan(), fromString("-Infinity")); - EXPECT_EQ(Decimal::nan(), fromString("-infinity")); - EXPECT_EQ(Decimal::nan(), fromString("NaN")); - EXPECT_EQ(Decimal::nan(), fromString("nan")); - EXPECT_EQ(Decimal::nan(), fromString("+NaN")); - EXPECT_EQ(Decimal::nan(), fromString("+nan")); - EXPECT_EQ(Decimal::nan(), fromString("-NaN")); - EXPECT_EQ(Decimal::nan(), fromString("-nan")); -} - -TEST_F(DecimalTest, fromStringTruncated) { - EXPECT_EQ(Decimal::nan(), fromString("x")); - EXPECT_EQ(Decimal::nan(), fromString("0.")); - EXPECT_EQ(Decimal::nan(), fromString("1x")); - - EXPECT_EQ(Decimal::nan(), fromString("1Ex")); - EXPECT_EQ(Decimal::nan(), fromString("1E2x")); - EXPECT_EQ(Decimal::nan(), fromString("1E+x")); -} - -TEST_F(DecimalTest, Multiplication) { - EXPECT_EQ(encode(0, 0, Positive), Decimal(0) * Decimal(0)); - EXPECT_EQ(encode(2, 0, Negative), Decimal(2) * Decimal(-1)); - EXPECT_EQ(encode(2, 0, Negative), Decimal(-1) * Decimal(2)); - EXPECT_EQ(encode(99, 0, Positive), Decimal(99) * Decimal(1)); - EXPECT_EQ(encode(2500, 0, Positive), Decimal(-50) * Decimal(-50)); - EXPECT_EQ(encode(1, 21, Positive), - encode(UINT64_C(10000000000), 0, Positive) * - encode(UINT64_C(100000000000), 0, Positive)); -} - -TEST_F(DecimalTest, MultiplicationBigExponent) { - EXPECT_EQ(encode(1, 1022, Positive), - encode(1, 1022, Positive) * encode(1, 0, Positive)); - EXPECT_EQ(Decimal::infinity(Positive), - encode(1, 1022, Positive) * encode(1, 1022, Positive)); - EXPECT_EQ(encode(1, 22, Positive), - encode(1, 1022, Positive) * encode(1, -1000, Positive)); -} - -TEST_F(DecimalTest, MultiplicationSmallExponent) { - EXPECT_EQ(encode(1, -1022, Positive), - encode(1, -1022, Positive) * encode(1, 0, Positive)); - EXPECT_EQ(encode(0, 0, Positive), - encode(1, -1022, Positive) * encode(1, -1022, Positive)); -} - -TEST_F(DecimalTest, MultiplicationSpecialValues) { - const Decimal Infinity(Decimal::infinity(Positive)); - const Decimal MinusInfinity(Decimal::infinity(Negative)); - const Decimal NaN(Decimal::nan()); - const Decimal Ten(10); - const Decimal MinusTen(-10); - const Decimal Zero(Decimal::zero(Positive)); - const Decimal MinusZero(Decimal::zero(Negative)); - - EXPECT_EQ(Infinity, Infinity * Infinity); - EXPECT_EQ(MinusInfinity, Infinity * MinusInfinity); - EXPECT_EQ(MinusInfinity, MinusInfinity * Infinity); - EXPECT_EQ(Infinity, MinusInfinity * MinusInfinity); - - EXPECT_EQ(NaN, Infinity * Zero); - EXPECT_EQ(NaN, Zero * MinusInfinity); - EXPECT_EQ(NaN, MinusInfinity * Zero); - EXPECT_EQ(NaN, MinusInfinity * Zero); - - EXPECT_EQ(NaN, Infinity * MinusZero); - EXPECT_EQ(NaN, MinusZero * MinusInfinity); - EXPECT_EQ(NaN, MinusInfinity * MinusZero); - EXPECT_EQ(NaN, MinusInfinity * MinusZero); - - EXPECT_EQ(Infinity, Infinity * Ten); - EXPECT_EQ(Infinity, Ten * Infinity); - EXPECT_EQ(MinusInfinity, MinusInfinity * Ten); - EXPECT_EQ(MinusInfinity, Ten * MinusInfinity); - - EXPECT_EQ(MinusInfinity, Infinity * MinusTen); - EXPECT_EQ(MinusInfinity, MinusTen * Infinity); - EXPECT_EQ(Infinity, MinusInfinity * MinusTen); - EXPECT_EQ(Infinity, MinusTen * MinusInfinity); - - EXPECT_EQ(NaN, NaN * NaN); - EXPECT_EQ(NaN, NaN * Ten); - EXPECT_EQ(NaN, Ten * NaN); - - EXPECT_EQ(NaN, NaN * Infinity); - EXPECT_EQ(NaN, NaN * MinusInfinity); - EXPECT_EQ(NaN, Infinity * NaN); - EXPECT_EQ(NaN, MinusInfinity * NaN); -} - -TEST_F(DecimalTest, Negate) { - EXPECT_EQ(encode(0, 0, Negative), -encode(0, 0, Positive)); - EXPECT_EQ(encode(0, 0, Positive), -encode(0, 0, Negative)); - - EXPECT_EQ(encode(0, 10, Negative), -encode(0, 10, Positive)); - EXPECT_EQ(encode(0, 10, Positive), -encode(0, 10, Negative)); - - EXPECT_EQ(encode(0, -10, Negative), -encode(0, -10, Positive)); - EXPECT_EQ(encode(0, -10, Positive), -encode(0, -10, Negative)); - - EXPECT_EQ(encode(1, 0, Negative), -encode(1, 0, Positive)); - EXPECT_EQ(encode(1, 0, Positive), -encode(1, 0, Negative)); - - EXPECT_EQ(encode(1, 10, Negative), -encode(1, 10, Positive)); - EXPECT_EQ(encode(1, 10, Positive), -encode(1, 10, Negative)); - - EXPECT_EQ(encode(1, -10, Negative), -encode(1, -10, Positive)); - EXPECT_EQ(encode(1, -10, Positive), -encode(1, -10, Negative)); -} - -TEST_F(DecimalTest, NegateBigExponent) { - EXPECT_EQ(encode(1, 1000, Negative), -encode(1, 1000, Positive)); - EXPECT_EQ(encode(1, 1000, Positive), -encode(1, 1000, Negative)); -} - -TEST_F(DecimalTest, NegateSmallExponent) { - EXPECT_EQ(encode(1, -1000, Negative), -encode(1, -1000, Positive)); - EXPECT_EQ(encode(1, -1000, Positive), -encode(1, -1000, Negative)); -} - -TEST_F(DecimalTest, NegateSpecialValues) { - EXPECT_EQ(Decimal::infinity(Negative), -Decimal::infinity(Positive)); - EXPECT_EQ(Decimal::infinity(Positive), -Decimal::infinity(Negative)); - EXPECT_EQ(Decimal::nan(), -Decimal::nan()); -} - -TEST_F(DecimalTest, Predicates) { - EXPECT_TRUE(Decimal::zero(Positive).isFinite()); - EXPECT_FALSE(Decimal::zero(Positive).isInfinity()); - EXPECT_FALSE(Decimal::zero(Positive).isNaN()); - EXPECT_TRUE(Decimal::zero(Positive).isPositive()); - EXPECT_FALSE(Decimal::zero(Positive).isNegative()); - EXPECT_FALSE(Decimal::zero(Positive).isSpecial()); - EXPECT_TRUE(Decimal::zero(Positive).isZero()); - - EXPECT_TRUE(Decimal::zero(Negative).isFinite()); - EXPECT_FALSE(Decimal::zero(Negative).isInfinity()); - EXPECT_FALSE(Decimal::zero(Negative).isNaN()); - EXPECT_FALSE(Decimal::zero(Negative).isPositive()); - EXPECT_TRUE(Decimal::zero(Negative).isNegative()); - EXPECT_FALSE(Decimal::zero(Negative).isSpecial()); - EXPECT_TRUE(Decimal::zero(Negative).isZero()); - - EXPECT_TRUE(Decimal(123).isFinite()); - EXPECT_FALSE(Decimal(123).isInfinity()); - EXPECT_FALSE(Decimal(123).isNaN()); - EXPECT_TRUE(Decimal(123).isPositive()); - EXPECT_FALSE(Decimal(123).isNegative()); - EXPECT_FALSE(Decimal(123).isSpecial()); - EXPECT_FALSE(Decimal(123).isZero()); - - EXPECT_TRUE(Decimal(-123).isFinite()); - EXPECT_FALSE(Decimal(-123).isInfinity()); - EXPECT_FALSE(Decimal(-123).isNaN()); - EXPECT_FALSE(Decimal(-123).isPositive()); - EXPECT_TRUE(Decimal(-123).isNegative()); - EXPECT_FALSE(Decimal(-123).isSpecial()); - EXPECT_FALSE(Decimal(-123).isZero()); -} - -TEST_F(DecimalTest, PredicatesSpecialValues) { - EXPECT_FALSE(Decimal::infinity(Positive).isFinite()); - EXPECT_TRUE(Decimal::infinity(Positive).isInfinity()); - EXPECT_FALSE(Decimal::infinity(Positive).isNaN()); - EXPECT_TRUE(Decimal::infinity(Positive).isPositive()); - EXPECT_FALSE(Decimal::infinity(Positive).isNegative()); - EXPECT_TRUE(Decimal::infinity(Positive).isSpecial()); - EXPECT_FALSE(Decimal::infinity(Positive).isZero()); - - EXPECT_FALSE(Decimal::infinity(Negative).isFinite()); - EXPECT_TRUE(Decimal::infinity(Negative).isInfinity()); - EXPECT_FALSE(Decimal::infinity(Negative).isNaN()); - EXPECT_FALSE(Decimal::infinity(Negative).isPositive()); - EXPECT_TRUE(Decimal::infinity(Negative).isNegative()); - EXPECT_TRUE(Decimal::infinity(Negative).isSpecial()); - EXPECT_FALSE(Decimal::infinity(Negative).isZero()); - - EXPECT_FALSE(Decimal::nan().isFinite()); - EXPECT_FALSE(Decimal::nan().isInfinity()); - EXPECT_TRUE(Decimal::nan().isNaN()); - EXPECT_TRUE(Decimal::nan().isSpecial()); - EXPECT_FALSE(Decimal::nan().isZero()); -} - -// tests/fast/forms/number/number-stepup-stepdown-from-renderer -TEST_F(DecimalTest, RealWorldExampleNumberStepUpStepDownFromRenderer) { - EXPECT_DECIMAL_STREQ("10", stepDown("0", "100", "10", "19", 1)); - EXPECT_DECIMAL_STREQ("90", stepUp("0", "99", "10", "89", 1)); - EXPECT_DECIMAL_STREQ( - "1", stepUp("0", "1", "0.33333333333333333", "0", 3)); // step=1/3 - EXPECT_DECIMAL_STREQ("0.01", stepUp("0", "0.01", "0.0033333333333333333", "0", - 3)); // step=1/300 - EXPECT_DECIMAL_STREQ( - "1", stepUp("0", "1", "0.003921568627450980", "0", 255)); // step=1/255 - EXPECT_DECIMAL_STREQ("1", stepUp("0", "1", "0.1", "0", 10)); -} - -TEST_F(DecimalTest, RealWorldExampleNumberStepUpStepDownFromRendererRounding) { - EXPECT_DECIMAL_STREQ("5.015", stepUp("0", "100", "0.005", "5.005", 2)); - EXPECT_DECIMAL_STREQ("5.06", stepUp("0", "100", "0.005", "5.005", 11)); - EXPECT_DECIMAL_STREQ("5.065", stepUp("0", "100", "0.005", "5.005", 12)); - - EXPECT_DECIMAL_STREQ("5.015", stepUp("4", "9", "0.005", "5.005", 2)); - EXPECT_DECIMAL_STREQ("5.06", stepUp("4", "9", "0.005", "5.005", 11)); - EXPECT_DECIMAL_STREQ("5.065", stepUp("4", "9", "0.005", "5.005", 12)); -} - -TEST_F(DecimalTest, RealWorldExampleRangeStepUpStepDown) { - EXPECT_DECIMAL_STREQ("1e+38", stepUp("0", "1E38", "1", "1E38", 9)); - EXPECT_DECIMAL_STREQ("1e+38", stepDown("0", "1E38", "1", "1E38", 9)); -} - -TEST_F(DecimalTest, Remainder) { - EXPECT_EQ(encode(21, -1, Positive), encode(21, -1, Positive).remainder(3)); - EXPECT_EQ(Decimal(1), Decimal(10).remainder(3)); - EXPECT_EQ(Decimal(1), Decimal(10).remainder(-3)); - EXPECT_EQ(encode(1, 0, Negative), Decimal(-10).remainder(3)); - EXPECT_EQ(Decimal(-1), Decimal(-10).remainder(-3)); - EXPECT_EQ(encode(2, -1, Positive), encode(102, -1, Positive).remainder(1)); - EXPECT_EQ(encode(1, -1, Positive), - Decimal(10).remainder(encode(3, -1, Positive))); - EXPECT_EQ(Decimal(1), - encode(36, -1, Positive).remainder(encode(13, -1, Positive))); - EXPECT_EQ(encode(1, 86, Positive), - (encode(1234, 100, Positive).remainder(Decimal(3)))); - EXPECT_EQ(Decimal(500), (Decimal(500).remainder(1000))); - EXPECT_EQ(Decimal(-500), (Decimal(-500).remainder(1000))); -} - -TEST_F(DecimalTest, RemainderBigExponent) { - EXPECT_EQ(encode(0, 1022, Positive), - encode(1, 1022, Positive).remainder(encode(1, 0, Positive))); - EXPECT_EQ(encode(0, 1022, Positive), - encode(1, 1022, Positive).remainder(encode(1, 1022, Positive))); - EXPECT_EQ(Decimal::infinity(Positive), - encode(1, 1022, Positive).remainder(encode(1, -1000, Positive))); -} - -TEST_F(DecimalTest, RemainderSmallExponent) { - EXPECT_EQ(encode(1, -1022, Positive), - encode(1, -1022, Positive).remainder(encode(1, 0, Positive))); - EXPECT_EQ(encode(0, -1022, Positive), - encode(1, -1022, Positive).remainder(encode(1, -1022, Positive))); -} - -TEST_F(DecimalTest, RemainderSpecialValues) { - EXPECT_EQ(Decimal::infinity(Positive), - Decimal::infinity(Positive).remainder(1)); - EXPECT_EQ(Decimal::infinity(Negative), - Decimal::infinity(Negative).remainder(1)); - EXPECT_EQ(Decimal::nan(), Decimal::nan().remainder(1)); - - EXPECT_EQ(Decimal::infinity(Negative), - Decimal::infinity(Positive).remainder(-1)); - EXPECT_EQ(Decimal::infinity(Positive), - Decimal::infinity(Negative).remainder(-1)); - EXPECT_EQ(Decimal::nan(), Decimal::nan().remainder(-1)); - - EXPECT_EQ(Decimal::infinity(Positive), - Decimal::infinity(Positive).remainder(3)); - EXPECT_EQ(Decimal::infinity(Negative), - Decimal::infinity(Negative).remainder(3)); - EXPECT_EQ(Decimal::nan(), Decimal::nan().remainder(3)); - - EXPECT_EQ(Decimal::infinity(Negative), - Decimal::infinity(Positive).remainder(-1)); - EXPECT_EQ(Decimal::infinity(Positive), - Decimal::infinity(Negative).remainder(-1)); - EXPECT_EQ(Decimal::nan(), Decimal::nan().remainder(-1)); - - EXPECT_EQ(Decimal::nan(), Decimal(1).remainder(Decimal::infinity(Positive))); - EXPECT_EQ(Decimal::nan(), Decimal(1).remainder(Decimal::infinity(Negative))); - EXPECT_EQ(Decimal::nan(), Decimal(1).remainder(Decimal::nan())); -} - -TEST_F(DecimalTest, Round) { - EXPECT_EQ(Decimal(1), (Decimal(9) / Decimal(10)).round()); - EXPECT_EQ(Decimal(25), (Decimal(5) / fromString("0.200")).round()); - EXPECT_EQ(Decimal(3), (Decimal(5) / Decimal(2)).round()); - EXPECT_EQ(Decimal(1), (Decimal(2) / Decimal(3)).round()); - EXPECT_EQ(Decimal(3), (Decimal(10) / Decimal(3)).round()); - EXPECT_EQ(Decimal(3), (Decimal(1) / fromString("0.3")).round()); - EXPECT_EQ(Decimal(10), (Decimal(1) / fromString("0.1")).round()); - EXPECT_EQ(Decimal(5), (Decimal(1) / fromString("0.2")).round()); - EXPECT_EQ(Decimal(10), (fromString("10.2") / 1).round()); - EXPECT_EQ(encode(1234, 100, Positive), encode(1234, 100, Positive).round()); - - EXPECT_EQ(Decimal(2), encode(190002, -5, Positive).round()); - EXPECT_EQ(Decimal(2), encode(150002, -5, Positive).round()); - EXPECT_EQ(Decimal(2), encode(150000, -5, Positive).round()); - EXPECT_EQ(Decimal(12), encode(12492, -3, Positive).round()); - EXPECT_EQ(Decimal(13), encode(12502, -3, Positive).round()); - - EXPECT_EQ(Decimal(-2), encode(190002, -5, Negative).round()); - EXPECT_EQ(Decimal(-2), encode(150002, -5, Negative).round()); - EXPECT_EQ(Decimal(-2), encode(150000, -5, Negative).round()); - EXPECT_EQ(Decimal(-12), encode(12492, -3, Negative).round()); - EXPECT_EQ(Decimal(-13), encode(12502, -3, Negative).round()); -} - -TEST_F(DecimalTest, RoundSpecialValues) { - EXPECT_EQ(Decimal::infinity(Positive), Decimal::infinity(Positive).round()); - EXPECT_EQ(Decimal::infinity(Negative), Decimal::infinity(Negative).round()); - EXPECT_EQ(Decimal::nan(), Decimal::nan().round()); -} - -TEST_F(DecimalTest, Subtract) { - EXPECT_EQ(encode(0, 0, Positive), Decimal(0) - Decimal(0)); - EXPECT_EQ(encode(3, 0, Positive), Decimal(2) - Decimal(-1)); - EXPECT_EQ(encode(3, 0, Negative), Decimal(-1) - Decimal(2)); - EXPECT_EQ(encode(98, 0, Positive), Decimal(99) - Decimal(1)); - EXPECT_EQ(encode(0, 0, Positive), Decimal(-50) - Decimal(-50)); - EXPECT_EQ(encode(UINT64_C(1000000000000000), 35, Positive), - encode(1, 50, Positive) - Decimal(1)); - EXPECT_EQ(encode(UINT64_C(1000000000000000), 35, Negative), - Decimal(1) - encode(1, 50, Positive)); -} - -TEST_F(DecimalTest, SubtractBigExponent) { - EXPECT_EQ(encode(1, 1022, Positive), - encode(1, 1022, Positive) - encode(1, 0, Positive)); - EXPECT_EQ(encode(0, 0, Positive), - encode(1, 1022, Positive) - encode(1, 1022, Positive)); - EXPECT_EQ(encode(1, 1022, Positive), - encode(1, 1022, Positive) + encode(1, -1000, Positive)); -} - -TEST_F(DecimalTest, SubtractSmallExponent) { - EXPECT_EQ(encode(UINT64_C(10000000000000000), -16, Negative), - encode(1, -1022, Positive) - encode(1, 0, Positive)); - EXPECT_EQ(encode(0, 0, Positive), - encode(1, -1022, Positive) - encode(1, -1022, Positive)); -} - -TEST_F(DecimalTest, SubtractSpecialValues) { - const Decimal Infinity(Decimal::infinity(Positive)); - const Decimal MinusInfinity(Decimal::infinity(Negative)); - const Decimal NaN(Decimal::nan()); - const Decimal Ten(10); - - EXPECT_EQ(NaN, Infinity - Infinity); - EXPECT_EQ(Infinity, Infinity - MinusInfinity); - EXPECT_EQ(MinusInfinity, MinusInfinity - Infinity); - EXPECT_EQ(NaN, MinusInfinity - MinusInfinity); - - EXPECT_EQ(Infinity, Infinity - Ten); - EXPECT_EQ(MinusInfinity, Ten - Infinity); - EXPECT_EQ(MinusInfinity, MinusInfinity - Ten); - EXPECT_EQ(Infinity, Ten - MinusInfinity); - - EXPECT_EQ(NaN, NaN - NaN); - EXPECT_EQ(NaN, NaN - Ten); - EXPECT_EQ(NaN, Ten - NaN); - - EXPECT_EQ(NaN, NaN - Infinity); - EXPECT_EQ(NaN, NaN - MinusInfinity); - EXPECT_EQ(NaN, Infinity - NaN); - EXPECT_EQ(NaN, MinusInfinity - NaN); -} - -TEST_F(DecimalTest, ToDouble) { - EXPECT_EQ(0.0, encode(0, 0, Positive).toDouble()); - EXPECT_EQ(-0.0, encode(0, 0, Negative).toDouble()); - - EXPECT_EQ(1.0, encode(1, 0, Positive).toDouble()); - EXPECT_EQ(-1.0, encode(1, 0, Negative).toDouble()); - - EXPECT_EQ(0.1, encode(1, -1, Positive).toDouble()); - EXPECT_EQ(-0.1, encode(1, -1, Negative).toDouble()); - EXPECT_EQ(0.3, encode(3, -1, Positive).toDouble()); - EXPECT_EQ(-0.3, encode(3, -1, Negative).toDouble()); - EXPECT_EQ(0.6, encode(6, -1, Positive).toDouble()); - EXPECT_EQ(-0.6, encode(6, -1, Negative).toDouble()); - EXPECT_EQ(0.7, encode(7, -1, Positive).toDouble()); - EXPECT_EQ(-0.7, encode(7, -1, Negative).toDouble()); - - EXPECT_EQ(0.01, encode(1, -2, Positive).toDouble()); - EXPECT_EQ(0.001, encode(1, -3, Positive).toDouble()); - EXPECT_EQ(0.0001, encode(1, -4, Positive).toDouble()); - EXPECT_EQ(0.00001, encode(1, -5, Positive).toDouble()); - - EXPECT_EQ(1e+308, encode(1, 308, Positive).toDouble()); - EXPECT_EQ(1e-307, encode(1, -307, Positive).toDouble()); - - EXPECT_TRUE(std::isinf(encode(1, 1000, Positive).toDouble())); - EXPECT_EQ(0.0, encode(1, -1000, Positive).toDouble()); -} - -TEST_F(DecimalTest, ToDoubleSpecialValues) { - EXPECT_TRUE(std::isinf(Decimal::infinity(Decimal::Positive).toDouble())); - EXPECT_TRUE(std::isinf(Decimal::infinity(Decimal::Negative).toDouble())); - EXPECT_TRUE(std::isnan(Decimal::nan().toDouble())); -} - -TEST_F(DecimalTest, ToString) { - EXPECT_DECIMAL_STREQ("0", Decimal::zero(Positive)); - EXPECT_DECIMAL_STREQ("-0", Decimal::zero(Negative)); - EXPECT_DECIMAL_STREQ("1", Decimal(1)); - EXPECT_DECIMAL_STREQ("-1", Decimal(-1)); - EXPECT_DECIMAL_STREQ("1234567", Decimal(1234567)); - EXPECT_DECIMAL_STREQ("-1234567", Decimal(-1234567)); - EXPECT_DECIMAL_STREQ("0.5", encode(5, -1, Positive)); - EXPECT_DECIMAL_STREQ("-0.5", encode(5, -1, Negative)); - EXPECT_DECIMAL_STREQ("12.345", encode(12345, -3, Positive)); - EXPECT_DECIMAL_STREQ("-12.345", encode(12345, -3, Negative)); - EXPECT_DECIMAL_STREQ("0.12345", encode(12345, -5, Positive)); - EXPECT_DECIMAL_STREQ("-0.12345", encode(12345, -5, Negative)); - EXPECT_DECIMAL_STREQ("50", encode(50, 0, Positive)); - EXPECT_DECIMAL_STREQ("-50", encode(50, 0, Negative)); - EXPECT_DECIMAL_STREQ("5e+1", encode(5, 1, Positive)); - EXPECT_DECIMAL_STREQ("-5e+1", encode(5, 1, Negative)); - EXPECT_DECIMAL_STREQ("5.678e+103", encode(5678, 100, Positive)); - EXPECT_DECIMAL_STREQ("-5.678e+103", encode(5678, 100, Negative)); - EXPECT_DECIMAL_STREQ("5.678e-97", encode(5678, -100, Positive)); - EXPECT_DECIMAL_STREQ("-5.678e-97", encode(5678, -100, Negative)); - EXPECT_DECIMAL_STREQ("8639999913600001", - encode(UINT64_C(8639999913600001), 0, Positive)); - EXPECT_DECIMAL_STREQ( - "9007199254740991", - encode((static_cast(1) << DBL_MANT_DIG) - 1, 0, Positive)); - EXPECT_DECIMAL_STREQ("99999999999999999", - encode(UINT64_C(99999999999999999), 0, Positive)); - EXPECT_DECIMAL_STREQ("9.9999999999999999e+17", - encode(UINT64_C(99999999999999999), 1, Positive)); - EXPECT_DECIMAL_STREQ("9.9999999999999999e+18", - encode(UINT64_C(99999999999999999), 2, Positive)); - EXPECT_DECIMAL_STREQ("1e+16", - encode(UINT64_C(99999999999999999), -1, Positive)); - EXPECT_DECIMAL_STREQ("1000000000000000", - encode(UINT64_C(99999999999999999), -2, Positive)); - EXPECT_DECIMAL_STREQ("1", encode(UINT64_C(99999999999999999), -17, Positive)); - EXPECT_DECIMAL_STREQ("0.001", - encode(UINT64_C(99999999999999999), -20, Positive)); - EXPECT_DECIMAL_STREQ("1e-83", - encode(UINT64_C(99999999999999999), -100, Positive)); -} - -TEST_F(DecimalTest, ToStringSpecialValues) { - EXPECT_DECIMAL_STREQ("Infinity", Decimal::infinity(Positive)); - EXPECT_DECIMAL_STREQ("-Infinity", Decimal::infinity(Negative)); - EXPECT_DECIMAL_STREQ("NaN", Decimal::nan()); -} diff --git a/sky/engine/platform/FloatConversion.h b/sky/engine/platform/FloatConversion.h deleted file mode 100644 index 04c6353e359d2..0000000000000 --- a/sky/engine/platform/FloatConversion.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FLOATCONVERSION_H_ -#define SKY_ENGINE_PLATFORM_FLOATCONVERSION_H_ - -namespace blink { - -template -float narrowPrecisionToFloat(T); - -template <> -inline float narrowPrecisionToFloat(double number) { - return static_cast(number); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FLOATCONVERSION_H_ diff --git a/sky/engine/platform/Language.cpp b/sky/engine/platform/Language.cpp deleted file mode 100644 index be0c51fc3058b..0000000000000 --- a/sky/engine/platform/Language.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2010, 2013 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/Language.h" - -#include "flutter/sky/engine/public/platform/Platform.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -static const AtomicString& platformLanguage() { - DEFINE_STATIC_LOCAL(AtomicString, computedDefaultLanguage, ()); - if (computedDefaultLanguage.isEmpty()) { - std::string defaultLocale = blink::Platform::current()->defaultLocale(); - computedDefaultLanguage = - AtomicString::fromUTF8(defaultLocale.data(), defaultLocale.size()); - ASSERT(!computedDefaultLanguage.isEmpty()); - } - return computedDefaultLanguage; -} - -AtomicString defaultLanguage() { - Vector languages = userPreferredLanguages(); - if (!languages.isEmpty()) - return languages[0]; - - return emptyAtom; -} - -static Vector& preferredLanguagesOverride() { - DEFINE_STATIC_LOCAL(Vector, override, ()); - return override; -} - -Vector userPreferredLanguagesOverride() { - return preferredLanguagesOverride(); -} - -void overrideUserPreferredLanguages(const Vector& override) { - preferredLanguagesOverride() = override; -} - -Vector userPreferredLanguages() { - Vector& override = preferredLanguagesOverride(); - if (!override.isEmpty()) - return override; - - Vector languages; - languages.reserveInitialCapacity(1); - languages.append(platformLanguage()); - return languages; -} - -static String canonicalLanguageIdentifier(const String& languageCode) { - String lowercaseLanguageCode = languageCode.lower(); - - if (lowercaseLanguageCode.length() >= 3 && lowercaseLanguageCode[2] == '_') - lowercaseLanguageCode.replace(2, 1, "-"); - - return lowercaseLanguageCode; -} - -size_t indexOfBestMatchingLanguageInList( - const AtomicString& language, - const Vector& languageList) { - AtomicString languageWithoutLocaleMatch; - AtomicString languageMatchButNotLocale; - size_t languageWithoutLocaleMatchIndex = 0; - size_t languageMatchButNotLocaleMatchIndex = 0; - bool canMatchLanguageOnly = (language.length() == 2 || - (language.length() >= 3 && language[2] == '-')); - - for (size_t i = 0; i < languageList.size(); ++i) { - String canonicalizedLanguageFromList = - canonicalLanguageIdentifier(languageList[i]); - - if (language == canonicalizedLanguageFromList) - return i; - - if (canMatchLanguageOnly && canonicalizedLanguageFromList.length() >= 2) { - if (language[0] == canonicalizedLanguageFromList[0] && - language[1] == canonicalizedLanguageFromList[1]) { - if (!languageWithoutLocaleMatch.length() && - canonicalizedLanguageFromList.length() == 2) { - languageWithoutLocaleMatch = languageList[i]; - languageWithoutLocaleMatchIndex = i; - } - if (!languageMatchButNotLocale.length() && - canonicalizedLanguageFromList.length() >= 3) { - languageMatchButNotLocale = languageList[i]; - languageMatchButNotLocaleMatchIndex = i; - } - } - } - } - - // If we have both a language-only match and a languge-but-not-locale match, - // return the languge-only match as is considered a "better" match. For - // example, if the list provided has both "en-GB" and "en" and the user - // prefers "en-US" we will return "en". - if (languageWithoutLocaleMatch.length()) - return languageWithoutLocaleMatchIndex; - - if (languageMatchButNotLocale.length()) - return languageMatchButNotLocaleMatchIndex; - - return languageList.size(); -} - -} // namespace blink diff --git a/sky/engine/platform/Language.h b/sky/engine/platform/Language.h deleted file mode 100644 index 21928927272e1..0000000000000 --- a/sky/engine/platform/Language.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2010, 2013 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_LANGUAGE_H_ -#define SKY_ENGINE_PLATFORM_LANGUAGE_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -PLATFORM_EXPORT AtomicString defaultLanguage(); -PLATFORM_EXPORT Vector userPreferredLanguages(); -PLATFORM_EXPORT Vector userPreferredLanguagesOverride(); -PLATFORM_EXPORT void overrideUserPreferredLanguages( - const Vector&); -PLATFORM_EXPORT size_t -indexOfBestMatchingLanguageInList(const AtomicString& language, - const Vector& languageList); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_LANGUAGE_H_ diff --git a/sky/engine/platform/LayoutUnit.h b/sky/engine/platform/LayoutUnit.h deleted file mode 100644 index 44a5208d50a15..0000000000000 --- a/sky/engine/platform/LayoutUnit.h +++ /dev/null @@ -1,707 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_LAYOUTUNIT_H_ -#define SKY_ENGINE_PLATFORM_LAYOUTUNIT_H_ - -#include -#include -#include -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/SaturatedArithmetic.h" - -namespace blink { - -#if !ERROR_DISABLED - -#define REPORT_OVERFLOW(doesOverflow) ((void)0) - -#else - -#define REPORT_OVERFLOW(doesOverflow) \ - do \ - if (!(doesOverflow)) { \ - WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, "!(%s)", \ - #doesOverflow); \ - } \ - while (0) - -#endif - -static const int kLayoutUnitFractionalBits = 6; -static const int kFixedPointDenominator = 1 << kLayoutUnitFractionalBits; - -const int intMaxForLayoutUnit = INT_MAX / kFixedPointDenominator; -const int intMinForLayoutUnit = INT_MIN / kFixedPointDenominator; - -class LayoutUnit { - public: - LayoutUnit() : m_value(0) {} - LayoutUnit(int value) { setValue(value); } - LayoutUnit(unsigned short value) { setValue(value); } - LayoutUnit(unsigned value) { setValue(value); } - LayoutUnit(unsigned long value) { - m_value = clampTo(value * kFixedPointDenominator); - } - LayoutUnit(unsigned long long value) { - m_value = clampTo(value * kFixedPointDenominator); - } - LayoutUnit(float value) { - m_value = clampTo(value * kFixedPointDenominator); - } - LayoutUnit(double value) { - m_value = clampTo(value * kFixedPointDenominator); - } - - static LayoutUnit fromFloatCeil(float value) { - LayoutUnit v; - v.m_value = clampToInteger(ceilf(value * kFixedPointDenominator)); - return v; - } - - static LayoutUnit fromFloatFloor(float value) { - LayoutUnit v; - v.m_value = clampToInteger(floorf(value * kFixedPointDenominator)); - return v; - } - - static LayoutUnit fromFloatRound(float value) { - if (value >= 0) - return clamp(value + epsilon() / 2.0f); - return clamp(value - epsilon() / 2.0f); - } - - int toInt() const { return m_value / kFixedPointDenominator; } - float toFloat() const { - return static_cast(m_value) / kFixedPointDenominator; - } - double toDouble() const { - return static_cast(m_value) / kFixedPointDenominator; - } - float ceilToFloat() const { - float floatValue = toFloat(); - if (static_cast(floatValue * kFixedPointDenominator) == m_value) - return floatValue; - if (floatValue > 0) - return nextafterf(floatValue, std::numeric_limits::max()); - return nextafterf(floatValue, std::numeric_limits::min()); - } - unsigned toUnsigned() const { - REPORT_OVERFLOW(m_value >= 0); - return toInt(); - } - - operator int() const { return toInt(); } - operator unsigned() const { return toUnsigned(); } - operator double() const { return toDouble(); } - operator bool() const { return m_value; } - - LayoutUnit operator++(int) { - m_value += kFixedPointDenominator; - return *this; - } - - inline int rawValue() const { return m_value; } - inline void setRawValue(int value) { m_value = value; } - void setRawValue(long long value) { - REPORT_OVERFLOW(value > std::numeric_limits::min() && - value < std::numeric_limits::max()); - m_value = static_cast(value); - } - - LayoutUnit abs() const { - LayoutUnit returnValue; - returnValue.setRawValue(::abs(m_value)); - return returnValue; - } - int ceil() const { - if (UNLIKELY(m_value >= INT_MAX - kFixedPointDenominator + 1)) - return intMaxForLayoutUnit; - - if (m_value >= 0) - return (m_value + kFixedPointDenominator - 1) / kFixedPointDenominator; - return toInt(); - } - ALWAYS_INLINE int round() const { - return saturatedAddition(rawValue(), kFixedPointDenominator / 2) >> - kLayoutUnitFractionalBits; - } - - int floor() const { - if (UNLIKELY(m_value <= INT_MIN + kFixedPointDenominator - 1)) - return intMinForLayoutUnit; - - return m_value >> kLayoutUnitFractionalBits; - } - - LayoutUnit fraction() const { - // Add the fraction to the size (as opposed to the full location) to avoid - // overflows. Compute fraction using the mod operator to preserve the sign - // of the value as it may affect rounding. - LayoutUnit fraction; - fraction.setRawValue(rawValue() % kFixedPointDenominator); - return fraction; - } - - bool mightBeSaturated() const { - return rawValue() == std::numeric_limits::max() || - rawValue() == std::numeric_limits::min(); - } - - static float epsilon() { return 1.0f / kFixedPointDenominator; } - - static const LayoutUnit max() { - LayoutUnit m; - m.m_value = std::numeric_limits::max(); - return m; - } - static const LayoutUnit min() { - LayoutUnit m; - m.m_value = std::numeric_limits::min(); - return m; - } - - // Versions of max/min that are slightly smaller/larger than max/min() to - // allow for roinding without overflowing. - static const LayoutUnit nearlyMax() { - LayoutUnit m; - m.m_value = std::numeric_limits::max() - kFixedPointDenominator / 2; - return m; - } - static const LayoutUnit nearlyMin() { - LayoutUnit m; - m.m_value = std::numeric_limits::min() + kFixedPointDenominator / 2; - return m; - } - - static LayoutUnit clamp(double value) { - return clampTo(value, LayoutUnit::min(), LayoutUnit::max()); - } - - private: - static bool isInBounds(int value) { - return ::abs(value) <= - std::numeric_limits::max() / kFixedPointDenominator; - } - static bool isInBounds(unsigned value) { - return value <= static_cast(std::numeric_limits::max()) / - kFixedPointDenominator; - } - static bool isInBounds(double value) { - return ::fabs(value) <= - std::numeric_limits::max() / kFixedPointDenominator; - } - - ALWAYS_INLINE void setValue(int value) { - m_value = saturatedSet(value, kLayoutUnitFractionalBits); - } - - inline void setValue(unsigned value) { - m_value = saturatedSet(value, kLayoutUnitFractionalBits); - } - - int m_value; -}; - -inline bool operator<=(const LayoutUnit& a, const LayoutUnit& b) { - return a.rawValue() <= b.rawValue(); -} - -inline bool operator<=(const LayoutUnit& a, float b) { - return a.toFloat() <= b; -} - -inline bool operator<=(const LayoutUnit& a, int b) { - return a <= LayoutUnit(b); -} - -inline bool operator<=(const float a, const LayoutUnit& b) { - return a <= b.toFloat(); -} - -inline bool operator<=(const int a, const LayoutUnit& b) { - return LayoutUnit(a) <= b; -} - -inline bool operator>=(const LayoutUnit& a, const LayoutUnit& b) { - return a.rawValue() >= b.rawValue(); -} - -inline bool operator>=(const LayoutUnit& a, int b) { - return a >= LayoutUnit(b); -} - -inline bool operator>=(const float a, const LayoutUnit& b) { - return a >= b.toFloat(); -} - -inline bool operator>=(const LayoutUnit& a, float b) { - return a.toFloat() >= b; -} - -inline bool operator>=(const int a, const LayoutUnit& b) { - return LayoutUnit(a) >= b; -} - -inline bool operator<(const LayoutUnit& a, const LayoutUnit& b) { - return a.rawValue() < b.rawValue(); -} - -inline bool operator<(const LayoutUnit& a, int b) { - return a < LayoutUnit(b); -} - -inline bool operator<(const LayoutUnit& a, float b) { - return a.toFloat() < b; -} - -inline bool operator<(const LayoutUnit& a, double b) { - return a.toDouble() < b; -} - -inline bool operator<(const int a, const LayoutUnit& b) { - return LayoutUnit(a) < b; -} - -inline bool operator<(const float a, const LayoutUnit& b) { - return a < b.toFloat(); -} - -inline bool operator>(const LayoutUnit& a, const LayoutUnit& b) { - return a.rawValue() > b.rawValue(); -} - -inline bool operator>(const LayoutUnit& a, double b) { - return a.toDouble() > b; -} - -inline bool operator>(const LayoutUnit& a, float b) { - return a.toFloat() > b; -} - -inline bool operator>(const LayoutUnit& a, int b) { - return a > LayoutUnit(b); -} - -inline bool operator>(const int a, const LayoutUnit& b) { - return LayoutUnit(a) > b; -} - -inline bool operator>(const float a, const LayoutUnit& b) { - return a > b.toFloat(); -} - -inline bool operator>(const double a, const LayoutUnit& b) { - return a > b.toDouble(); -} - -inline bool operator!=(const LayoutUnit& a, const LayoutUnit& b) { - return a.rawValue() != b.rawValue(); -} - -inline bool operator!=(const LayoutUnit& a, float b) { - return a != LayoutUnit(b); -} - -inline bool operator!=(const int a, const LayoutUnit& b) { - return LayoutUnit(a) != b; -} - -inline bool operator!=(const LayoutUnit& a, int b) { - return a != LayoutUnit(b); -} - -inline bool operator==(const LayoutUnit& a, const LayoutUnit& b) { - return a.rawValue() == b.rawValue(); -} - -inline bool operator==(const LayoutUnit& a, int b) { - return a == LayoutUnit(b); -} - -inline bool operator==(const int a, const LayoutUnit& b) { - return LayoutUnit(a) == b; -} - -inline bool operator==(const LayoutUnit& a, float b) { - return a.toFloat() == b; -} - -inline bool operator==(const float a, const LayoutUnit& b) { - return a == b.toFloat(); -} - -// For multiplication that's prone to overflow, this bounds it to -// LayoutUnit::max() and ::min() -inline LayoutUnit boundedMultiply(const LayoutUnit& a, const LayoutUnit& b) { - int64_t result = static_cast(a.rawValue()) * - static_cast(b.rawValue()) / kFixedPointDenominator; - int32_t high = static_cast(result >> 32); - int32_t low = static_cast(result); - uint32_t saturated = - (static_cast(a.rawValue() ^ b.rawValue()) >> 31) + - std::numeric_limits::max(); - // If the higher 32 bits does not match the lower 32 with sign extension the - // operation overflowed. - if (high != low >> 31) - result = saturated; - - LayoutUnit returnVal; - returnVal.setRawValue(static_cast(result)); - return returnVal; -} - -inline LayoutUnit operator*(const LayoutUnit& a, const LayoutUnit& b) { - return boundedMultiply(a, b); -} - -inline double operator*(const LayoutUnit& a, double b) { - return a.toDouble() * b; -} - -inline float operator*(const LayoutUnit& a, float b) { - return a.toFloat() * b; -} - -inline LayoutUnit operator*(const LayoutUnit& a, int b) { - return a * LayoutUnit(b); -} - -inline LayoutUnit operator*(const LayoutUnit& a, unsigned short b) { - return a * LayoutUnit(b); -} - -inline LayoutUnit operator*(const LayoutUnit& a, unsigned b) { - return a * LayoutUnit(b); -} - -inline LayoutUnit operator*(const LayoutUnit& a, unsigned long b) { - return a * LayoutUnit(b); -} - -inline LayoutUnit operator*(const LayoutUnit& a, unsigned long long b) { - return a * LayoutUnit(b); -} - -inline LayoutUnit operator*(unsigned short a, const LayoutUnit& b) { - return LayoutUnit(a) * b; -} - -inline LayoutUnit operator*(unsigned a, const LayoutUnit& b) { - return LayoutUnit(a) * b; -} - -inline LayoutUnit operator*(unsigned long a, const LayoutUnit& b) { - return LayoutUnit(a) * b; -} - -inline LayoutUnit operator*(unsigned long long a, const LayoutUnit& b) { - return LayoutUnit(a) * b; -} - -inline LayoutUnit operator*(const int a, const LayoutUnit& b) { - return LayoutUnit(a) * b; -} - -inline float operator*(const float a, const LayoutUnit& b) { - return a * b.toFloat(); -} - -inline double operator*(const double a, const LayoutUnit& b) { - return a * b.toDouble(); -} - -inline LayoutUnit operator/(const LayoutUnit& a, const LayoutUnit& b) { - LayoutUnit returnVal; - long long rawVal = static_cast(kFixedPointDenominator) * - a.rawValue() / b.rawValue(); - returnVal.setRawValue(clampTo(rawVal)); - return returnVal; -} - -inline float operator/(const LayoutUnit& a, float b) { - return a.toFloat() / b; -} - -inline double operator/(const LayoutUnit& a, double b) { - return a.toDouble() / b; -} - -inline LayoutUnit operator/(const LayoutUnit& a, int b) { - return a / LayoutUnit(b); -} - -inline LayoutUnit operator/(const LayoutUnit& a, unsigned short b) { - return a / LayoutUnit(b); -} - -inline LayoutUnit operator/(const LayoutUnit& a, unsigned b) { - return a / LayoutUnit(b); -} - -inline LayoutUnit operator/(const LayoutUnit& a, unsigned long b) { - return a / LayoutUnit(b); -} - -inline LayoutUnit operator/(const LayoutUnit& a, unsigned long long b) { - return a / LayoutUnit(b); -} - -inline float operator/(const float a, const LayoutUnit& b) { - return a / b.toFloat(); -} - -inline double operator/(const double a, const LayoutUnit& b) { - return a / b.toDouble(); -} - -inline LayoutUnit operator/(const int a, const LayoutUnit& b) { - return LayoutUnit(a) / b; -} - -inline LayoutUnit operator/(unsigned short a, const LayoutUnit& b) { - return LayoutUnit(a) / b; -} - -inline LayoutUnit operator/(unsigned a, const LayoutUnit& b) { - return LayoutUnit(a) / b; -} - -inline LayoutUnit operator/(unsigned long a, const LayoutUnit& b) { - return LayoutUnit(a) / b; -} - -inline LayoutUnit operator/(unsigned long long a, const LayoutUnit& b) { - return LayoutUnit(a) / b; -} - -ALWAYS_INLINE LayoutUnit operator+(const LayoutUnit& a, const LayoutUnit& b) { - LayoutUnit returnVal; - returnVal.setRawValue(saturatedAddition(a.rawValue(), b.rawValue())); - return returnVal; -} - -inline LayoutUnit operator+(const LayoutUnit& a, int b) { - return a + LayoutUnit(b); -} - -inline float operator+(const LayoutUnit& a, float b) { - return a.toFloat() + b; -} - -inline double operator+(const LayoutUnit& a, double b) { - return a.toDouble() + b; -} - -inline LayoutUnit operator+(const int a, const LayoutUnit& b) { - return LayoutUnit(a) + b; -} - -inline float operator+(const float a, const LayoutUnit& b) { - return a + b.toFloat(); -} - -inline double operator+(const double a, const LayoutUnit& b) { - return a + b.toDouble(); -} - -ALWAYS_INLINE LayoutUnit operator-(const LayoutUnit& a, const LayoutUnit& b) { - LayoutUnit returnVal; - returnVal.setRawValue(saturatedSubtraction(a.rawValue(), b.rawValue())); - return returnVal; -} - -inline LayoutUnit operator-(const LayoutUnit& a, int b) { - return a - LayoutUnit(b); -} - -inline LayoutUnit operator-(const LayoutUnit& a, unsigned b) { - return a - LayoutUnit(b); -} - -inline float operator-(const LayoutUnit& a, float b) { - return a.toFloat() - b; -} - -inline LayoutUnit operator-(const int a, const LayoutUnit& b) { - return LayoutUnit(a) - b; -} - -inline float operator-(const float a, const LayoutUnit& b) { - return a - b.toFloat(); -} - -inline LayoutUnit operator-(const LayoutUnit& a) { - LayoutUnit returnVal; - returnVal.setRawValue(-a.rawValue()); - return returnVal; -} - -// For returning the remainder after a division with integer results. -inline LayoutUnit intMod(const LayoutUnit& a, const LayoutUnit& b) { - // This calculates the modulo so that: a = static_cast(a / b) * b + - // intMod(a, b). - LayoutUnit returnVal; - returnVal.setRawValue(a.rawValue() % b.rawValue()); - return returnVal; -} - -inline LayoutUnit operator%(const LayoutUnit& a, const LayoutUnit& b) { - // This calculates the modulo so that: a = (a / b) * b + a % b. - LayoutUnit returnVal; - long long rawVal = - (static_cast(kFixedPointDenominator) * a.rawValue()) % - b.rawValue(); - returnVal.setRawValue(rawVal / kFixedPointDenominator); - return returnVal; -} - -inline LayoutUnit operator%(const LayoutUnit& a, int b) { - return a % LayoutUnit(b); -} - -inline LayoutUnit operator%(int a, const LayoutUnit& b) { - return LayoutUnit(a) % b; -} - -inline LayoutUnit& operator+=(LayoutUnit& a, const LayoutUnit& b) { - a.setRawValue(saturatedAddition(a.rawValue(), b.rawValue())); - return a; -} - -inline LayoutUnit& operator+=(LayoutUnit& a, int b) { - a = a + b; - return a; -} - -inline LayoutUnit& operator+=(LayoutUnit& a, float b) { - a = a + b; - return a; -} - -inline float& operator+=(float& a, const LayoutUnit& b) { - a = a + b; - return a; -} - -inline LayoutUnit& operator-=(LayoutUnit& a, int b) { - a = a - b; - return a; -} - -inline LayoutUnit& operator-=(LayoutUnit& a, const LayoutUnit& b) { - a.setRawValue(saturatedSubtraction(a.rawValue(), b.rawValue())); - return a; -} - -inline LayoutUnit& operator-=(LayoutUnit& a, float b) { - a = a - b; - return a; -} - -inline float& operator-=(float& a, const LayoutUnit& b) { - a = a - b; - return a; -} - -inline LayoutUnit& operator*=(LayoutUnit& a, const LayoutUnit& b) { - a = a * b; - return a; -} -// operator*=(LayoutUnit& a, int b) is supported by the operator above plus -// LayoutUnit(int). - -inline LayoutUnit& operator*=(LayoutUnit& a, float b) { - a = a * b; - return a; -} - -inline float& operator*=(float& a, const LayoutUnit& b) { - a = a * b; - return a; -} - -inline LayoutUnit& operator/=(LayoutUnit& a, const LayoutUnit& b) { - a = a / b; - return a; -} -// operator/=(LayoutUnit& a, int b) is supported by the operator above plus -// LayoutUnit(int). - -inline LayoutUnit& operator/=(LayoutUnit& a, float b) { - a = a / b; - return a; -} - -inline float& operator/=(float& a, const LayoutUnit& b) { - a = a / b; - return a; -} - -inline int snapSizeToPixel(LayoutUnit size, LayoutUnit location) { - LayoutUnit fraction = location.fraction(); - return (fraction + size).round() - fraction.round(); -} - -inline int roundToInt(LayoutUnit value) { - return value.round(); -} - -inline int floorToInt(LayoutUnit value) { - return value.floor(); -} - -inline LayoutUnit absoluteValue(const LayoutUnit& value) { - return value.abs(); -} - -inline LayoutUnit layoutMod(const LayoutUnit& numerator, - const LayoutUnit& denominator) { - return numerator % denominator; -} - -inline bool isIntegerValue(const LayoutUnit value) { - return value.toInt() == value; -} - -inline LayoutUnit clampToLayoutUnit(LayoutUnit value, - LayoutUnit min, - LayoutUnit max) { - if (value >= max) - return max; - if (value <= min) - return min; - return value; -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_LAYOUTUNIT_H_ diff --git a/sky/engine/platform/LayoutUnitTest.cpp b/sky/engine/platform/LayoutUnitTest.cpp deleted file mode 100644 index 7a3d0d16edc51..0000000000000 --- a/sky/engine/platform/LayoutUnitTest.cpp +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/LayoutUnit.h" - -#include -#include - -using namespace blink; - -namespace { - -TEST(WebCoreLayoutUnit, LayoutUnitInt) { - ASSERT_EQ(LayoutUnit(INT_MIN).toInt(), intMinForLayoutUnit); - ASSERT_EQ(LayoutUnit(INT_MIN / 2).toInt(), intMinForLayoutUnit); - ASSERT_EQ(LayoutUnit(intMinForLayoutUnit - 1).toInt(), intMinForLayoutUnit); - ASSERT_EQ(LayoutUnit(intMinForLayoutUnit).toInt(), intMinForLayoutUnit); - ASSERT_EQ(LayoutUnit(intMinForLayoutUnit + 1).toInt(), - intMinForLayoutUnit + 1); - ASSERT_EQ(LayoutUnit(intMinForLayoutUnit / 2).toInt(), - intMinForLayoutUnit / 2); - ASSERT_EQ(LayoutUnit(-10000).toInt(), -10000); - ASSERT_EQ(LayoutUnit(-1000).toInt(), -1000); - ASSERT_EQ(LayoutUnit(-100).toInt(), -100); - ASSERT_EQ(LayoutUnit(-10).toInt(), -10); - ASSERT_EQ(LayoutUnit(-1).toInt(), -1); - ASSERT_EQ(LayoutUnit(0).toInt(), 0); - ASSERT_EQ(LayoutUnit(1).toInt(), 1); - ASSERT_EQ(LayoutUnit(100).toInt(), 100); - ASSERT_EQ(LayoutUnit(1000).toInt(), 1000); - ASSERT_EQ(LayoutUnit(10000).toInt(), 10000); - ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit / 2).toInt(), - intMaxForLayoutUnit / 2); - ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit - 1).toInt(), - intMaxForLayoutUnit - 1); - ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit).toInt(), intMaxForLayoutUnit); - ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit + 1).toInt(), intMaxForLayoutUnit); - ASSERT_EQ(LayoutUnit(INT_MAX / 2).toInt(), intMaxForLayoutUnit); - ASSERT_EQ(LayoutUnit(INT_MAX).toInt(), intMaxForLayoutUnit); -} - -TEST(WebCoreLayoutUnit, LayoutUnitFloat) { - const float tolerance = 1.0f / kFixedPointDenominator; - ASSERT_FLOAT_EQ(LayoutUnit(1.0f).toFloat(), 1.0f); - ASSERT_FLOAT_EQ(LayoutUnit(1.25f).toFloat(), 1.25f); - ASSERT_NEAR(LayoutUnit(1.1f).toFloat(), 1.1f, tolerance); - ASSERT_NEAR(LayoutUnit(1.33f).toFloat(), 1.33f, tolerance); - ASSERT_NEAR(LayoutUnit(1.3333f).toFloat(), 1.3333f, tolerance); - ASSERT_NEAR(LayoutUnit(1.53434f).toFloat(), 1.53434f, tolerance); - ASSERT_NEAR(LayoutUnit(345634).toFloat(), 345634.0f, tolerance); - ASSERT_NEAR(LayoutUnit(345634.12335f).toFloat(), 345634.12335f, tolerance); - ASSERT_NEAR(LayoutUnit(-345634.12335f).toFloat(), -345634.12335f, tolerance); - ASSERT_NEAR(LayoutUnit(-345634).toFloat(), -345634.0f, tolerance); -} - -TEST(WebCoreLayoutUnit, LayoutUnitRounding) { - ASSERT_EQ(LayoutUnit(-1.9f).round(), -2); - ASSERT_EQ(LayoutUnit(-1.6f).round(), -2); - ASSERT_EQ(LayoutUnit::fromFloatRound(-1.51f).round(), -2); - ASSERT_EQ(LayoutUnit::fromFloatRound(-1.5f).round(), -1); - ASSERT_EQ(LayoutUnit::fromFloatRound(-1.49f).round(), -1); - ASSERT_EQ(LayoutUnit(-1.0f).round(), -1); - ASSERT_EQ(LayoutUnit::fromFloatRound(-0.99f).round(), -1); - ASSERT_EQ(LayoutUnit::fromFloatRound(-0.51f).round(), -1); - ASSERT_EQ(LayoutUnit::fromFloatRound(-0.50f).round(), 0); - ASSERT_EQ(LayoutUnit::fromFloatRound(-0.49f).round(), 0); - ASSERT_EQ(LayoutUnit(-0.1f).round(), 0); - ASSERT_EQ(LayoutUnit(0.0f).round(), 0); - ASSERT_EQ(LayoutUnit(0.1f).round(), 0); - ASSERT_EQ(LayoutUnit::fromFloatRound(0.49f).round(), 0); - ASSERT_EQ(LayoutUnit::fromFloatRound(0.50f).round(), 1); - ASSERT_EQ(LayoutUnit::fromFloatRound(0.51f).round(), 1); - ASSERT_EQ(LayoutUnit(0.99f).round(), 1); - ASSERT_EQ(LayoutUnit(1.0f).round(), 1); - ASSERT_EQ(LayoutUnit::fromFloatRound(1.49f).round(), 1); - ASSERT_EQ(LayoutUnit::fromFloatRound(1.5f).round(), 2); - ASSERT_EQ(LayoutUnit::fromFloatRound(1.51f).round(), 2); -} - -TEST(WebCoreLayoutUnit, LayoutUnitSnapSizeToPixel) { - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1), LayoutUnit(0)), 1); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1), LayoutUnit(0.5)), 1); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0)), 2); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0.49)), 2); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0.5)), 1); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0.75)), 1); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(0.99)), 1); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(1)), 2); - - ASSERT_EQ(snapSizeToPixel(LayoutUnit(0.5), LayoutUnit(1.5)), 0); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(0.99), LayoutUnit(1.5)), 0); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.0), LayoutUnit(1.5)), 1); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.49), LayoutUnit(1.5)), 1); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(1.5), LayoutUnit(1.5)), 1); - - ASSERT_EQ(snapSizeToPixel(LayoutUnit(100.5), LayoutUnit(100)), 101); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(intMaxForLayoutUnit), LayoutUnit(0.3)), - intMaxForLayoutUnit); - ASSERT_EQ(snapSizeToPixel(LayoutUnit(intMinForLayoutUnit), LayoutUnit(-0.3)), - intMinForLayoutUnit); -} - -TEST(WebCoreLayoutUnit, LayoutUnitMultiplication) { - ASSERT_EQ((LayoutUnit(1) * LayoutUnit(1)).toInt(), 1); - ASSERT_EQ((LayoutUnit(1) * LayoutUnit(2)).toInt(), 2); - ASSERT_EQ((LayoutUnit(2) * LayoutUnit(1)).toInt(), 2); - ASSERT_EQ((LayoutUnit(2) * LayoutUnit(0.5)).toInt(), 1); - ASSERT_EQ((LayoutUnit(0.5) * LayoutUnit(2)).toInt(), 1); - ASSERT_EQ((LayoutUnit(100) * LayoutUnit(1)).toInt(), 100); - - ASSERT_EQ((LayoutUnit(-1) * LayoutUnit(1)).toInt(), -1); - ASSERT_EQ((LayoutUnit(-1) * LayoutUnit(2)).toInt(), -2); - ASSERT_EQ((LayoutUnit(-2) * LayoutUnit(1)).toInt(), -2); - ASSERT_EQ((LayoutUnit(-2) * LayoutUnit(0.5)).toInt(), -1); - ASSERT_EQ((LayoutUnit(-0.5) * LayoutUnit(2)).toInt(), -1); - ASSERT_EQ((LayoutUnit(-100) * LayoutUnit(1)).toInt(), -100); - - ASSERT_EQ((LayoutUnit(-1) * LayoutUnit(-1)).toInt(), 1); - ASSERT_EQ((LayoutUnit(-1) * LayoutUnit(-2)).toInt(), 2); - ASSERT_EQ((LayoutUnit(-2) * LayoutUnit(-1)).toInt(), 2); - ASSERT_EQ((LayoutUnit(-2) * LayoutUnit(-0.5)).toInt(), 1); - ASSERT_EQ((LayoutUnit(-0.5) * LayoutUnit(-2)).toInt(), 1); - ASSERT_EQ((LayoutUnit(-100) * LayoutUnit(-1)).toInt(), 100); - - ASSERT_EQ((LayoutUnit(100) * LayoutUnit(3.33)).round(), 333); - ASSERT_EQ((LayoutUnit(-100) * LayoutUnit(3.33)).round(), -333); - ASSERT_EQ((LayoutUnit(-100) * LayoutUnit(-3.33)).round(), 333); - - size_t aHundredSizeT = 100; - ASSERT_EQ((LayoutUnit(aHundredSizeT) * LayoutUnit(1)).toInt(), 100); - ASSERT_EQ((aHundredSizeT * LayoutUnit(4)).toInt(), 400); - ASSERT_EQ((LayoutUnit(4) * aHundredSizeT).toInt(), 400); - - int quarterMax = intMaxForLayoutUnit / 4; - ASSERT_EQ((LayoutUnit(quarterMax) * LayoutUnit(2)).toInt(), quarterMax * 2); - ASSERT_EQ((LayoutUnit(quarterMax) * LayoutUnit(3)).toInt(), quarterMax * 3); - ASSERT_EQ((LayoutUnit(quarterMax) * LayoutUnit(4)).toInt(), quarterMax * 4); - ASSERT_EQ((LayoutUnit(quarterMax) * LayoutUnit(5)).toInt(), - intMaxForLayoutUnit); - - size_t overflowIntSizeT = intMaxForLayoutUnit * 4; - ASSERT_EQ((LayoutUnit(overflowIntSizeT) * LayoutUnit(2)).toInt(), - intMaxForLayoutUnit); - ASSERT_EQ((overflowIntSizeT * LayoutUnit(4)).toInt(), intMaxForLayoutUnit); - ASSERT_EQ((LayoutUnit(4) * overflowIntSizeT).toInt(), intMaxForLayoutUnit); -} - -TEST(WebCoreLayoutUnit, LayoutUnitDivision) { - ASSERT_EQ((LayoutUnit(1) / LayoutUnit(1)).toInt(), 1); - ASSERT_EQ((LayoutUnit(1) / LayoutUnit(2)).toInt(), 0); - ASSERT_EQ((LayoutUnit(2) / LayoutUnit(1)).toInt(), 2); - ASSERT_EQ((LayoutUnit(2) / LayoutUnit(0.5)).toInt(), 4); - ASSERT_EQ((LayoutUnit(0.5) / LayoutUnit(2)).toInt(), 0); - ASSERT_EQ((LayoutUnit(100) / LayoutUnit(10)).toInt(), 10); - ASSERT_FLOAT_EQ((LayoutUnit(1) / LayoutUnit(2)).toFloat(), 0.5f); - ASSERT_FLOAT_EQ((LayoutUnit(0.5) / LayoutUnit(2)).toFloat(), 0.25f); - - ASSERT_EQ((LayoutUnit(-1) / LayoutUnit(1)).toInt(), -1); - ASSERT_EQ((LayoutUnit(-1) / LayoutUnit(2)).toInt(), 0); - ASSERT_EQ((LayoutUnit(-2) / LayoutUnit(1)).toInt(), -2); - ASSERT_EQ((LayoutUnit(-2) / LayoutUnit(0.5)).toInt(), -4); - ASSERT_EQ((LayoutUnit(-0.5) / LayoutUnit(2)).toInt(), 0); - ASSERT_EQ((LayoutUnit(-100) / LayoutUnit(10)).toInt(), -10); - ASSERT_FLOAT_EQ((LayoutUnit(-1) / LayoutUnit(2)).toFloat(), -0.5f); - ASSERT_FLOAT_EQ((LayoutUnit(-0.5) / LayoutUnit(2)).toFloat(), -0.25f); - - ASSERT_EQ((LayoutUnit(-1) / LayoutUnit(-1)).toInt(), 1); - ASSERT_EQ((LayoutUnit(-1) / LayoutUnit(-2)).toInt(), 0); - ASSERT_EQ((LayoutUnit(-2) / LayoutUnit(-1)).toInt(), 2); - ASSERT_EQ((LayoutUnit(-2) / LayoutUnit(-0.5)).toInt(), 4); - ASSERT_EQ((LayoutUnit(-0.5) / LayoutUnit(-2)).toInt(), 0); - ASSERT_EQ((LayoutUnit(-100) / LayoutUnit(-10)).toInt(), 10); - ASSERT_FLOAT_EQ((LayoutUnit(-1) / LayoutUnit(-2)).toFloat(), 0.5f); - ASSERT_FLOAT_EQ((LayoutUnit(-0.5) / LayoutUnit(-2)).toFloat(), 0.25f); - - size_t aHundredSizeT = 100; - ASSERT_EQ((LayoutUnit(aHundredSizeT) / LayoutUnit(2)).toInt(), 50); - ASSERT_EQ((aHundredSizeT / LayoutUnit(4)).toInt(), 25); - ASSERT_EQ((LayoutUnit(400) / aHundredSizeT).toInt(), 4); - - ASSERT_EQ((LayoutUnit(intMaxForLayoutUnit) / LayoutUnit(2)).toInt(), - intMaxForLayoutUnit / 2); - ASSERT_EQ((LayoutUnit(intMaxForLayoutUnit) / LayoutUnit(0.5)).toInt(), - intMaxForLayoutUnit); -} - -TEST(WebCoreLayoutUnit, LayoutUnitCeil) { - ASSERT_EQ(LayoutUnit(0).ceil(), 0); - ASSERT_EQ(LayoutUnit(0.1).ceil(), 1); - ASSERT_EQ(LayoutUnit(0.5).ceil(), 1); - ASSERT_EQ(LayoutUnit(0.9).ceil(), 1); - ASSERT_EQ(LayoutUnit(1.0).ceil(), 1); - ASSERT_EQ(LayoutUnit(1.1).ceil(), 2); - - ASSERT_EQ(LayoutUnit(-0.1).ceil(), 0); - ASSERT_EQ(LayoutUnit(-0.5).ceil(), 0); - ASSERT_EQ(LayoutUnit(-0.9).ceil(), 0); - ASSERT_EQ(LayoutUnit(-1.0).ceil(), -1); - - ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit).ceil(), intMaxForLayoutUnit); - ASSERT_EQ((LayoutUnit(intMaxForLayoutUnit) - LayoutUnit(0.5)).ceil(), - intMaxForLayoutUnit); - ASSERT_EQ((LayoutUnit(intMaxForLayoutUnit) - LayoutUnit(1)).ceil(), - intMaxForLayoutUnit - 1); - - ASSERT_EQ(LayoutUnit(intMinForLayoutUnit).ceil(), intMinForLayoutUnit); -} - -TEST(WebCoreLayoutUnit, LayoutUnitFloor) { - ASSERT_EQ(LayoutUnit(0).floor(), 0); - ASSERT_EQ(LayoutUnit(0.1).floor(), 0); - ASSERT_EQ(LayoutUnit(0.5).floor(), 0); - ASSERT_EQ(LayoutUnit(0.9).floor(), 0); - ASSERT_EQ(LayoutUnit(1.0).floor(), 1); - ASSERT_EQ(LayoutUnit(1.1).floor(), 1); - - ASSERT_EQ(LayoutUnit(-0.1).floor(), -1); - ASSERT_EQ(LayoutUnit(-0.5).floor(), -1); - ASSERT_EQ(LayoutUnit(-0.9).floor(), -1); - ASSERT_EQ(LayoutUnit(-1.0).floor(), -1); - - ASSERT_EQ(LayoutUnit(intMaxForLayoutUnit).floor(), intMaxForLayoutUnit); - - ASSERT_EQ(LayoutUnit(intMinForLayoutUnit).floor(), intMinForLayoutUnit); - ASSERT_EQ((LayoutUnit(intMinForLayoutUnit) + LayoutUnit(0.5)).floor(), - intMinForLayoutUnit); - ASSERT_EQ((LayoutUnit(intMinForLayoutUnit) + LayoutUnit(1)).floor(), - intMinForLayoutUnit + 1); -} - -TEST(WebCoreLayoutUnit, LayoutUnitFloatOverflow) { - // These should overflow to the max/min according to their sign. - ASSERT_EQ(intMaxForLayoutUnit, LayoutUnit(176972000.0f).toInt()); - ASSERT_EQ(intMinForLayoutUnit, LayoutUnit(-176972000.0f).toInt()); - ASSERT_EQ(intMaxForLayoutUnit, LayoutUnit(176972000.0).toInt()); - ASSERT_EQ(intMinForLayoutUnit, LayoutUnit(-176972000.0).toInt()); -} - -} // namespace diff --git a/sky/engine/platform/Length.cpp b/sky/engine/platform/Length.cpp deleted file mode 100644 index b0f4b02d7464e..0000000000000 --- a/sky/engine/platform/Length.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2001 Dirk Mueller ( mueller@kde.org ) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. - * All rights reserved. - * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/Length.h" - -#include "flutter/sky/engine/platform/CalculationValue.h" -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" -#include "flutter/sky/engine/wtf/ASCIICType.h" -#include "flutter/sky/engine/wtf/text/StringBuffer.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -using namespace WTF; - -namespace blink { - -template -static unsigned splitLength(const CharType* data, - unsigned length, - unsigned& intLength, - unsigned& doubleLength) { - ASSERT(length); - - unsigned i = 0; - while (i < length && isSpaceOrNewline(data[i])) - ++i; - if (i < length && (data[i] == '+' || data[i] == '-')) - ++i; - while (i < length && isASCIIDigit(data[i])) - ++i; - intLength = i; - while (i < length && (isASCIIDigit(data[i]) || data[i] == '.')) - ++i; - doubleLength = i; - - // IE quirk: Skip whitespace between the number and the % character (20 % => - // 20%). - while (i < length && isSpaceOrNewline(data[i])) - ++i; - - return i; -} - -template -static Length parseHTMLAreaCoordinate(const CharType* data, unsigned length) { - unsigned intLength; - unsigned doubleLength; - splitLength(data, length, intLength, doubleLength); - - bool ok; - int r = charactersToIntStrict(data, intLength, &ok); - if (ok) - return Length(r, Fixed); - return Length(0, Fixed); -} - -class CalculationValueHandleMap { - WTF_MAKE_FAST_ALLOCATED; - - public: - CalculationValueHandleMap() : m_index(1) {} - - int insert(PassRefPtr calcValue) { - ASSERT(m_index); - // FIXME calc(): https://bugs.webkit.org/show_bug.cgi?id=80489 - // This monotonically increasing handle generation scheme is potentially - // wasteful of the handle space. Consider reusing empty handles. - while (m_map.contains(m_index)) - m_index++; - - m_map.set(m_index, calcValue); - - return m_index; - } - - void remove(int index) { - ASSERT(m_map.contains(index)); - m_map.remove(index); - } - - CalculationValue& get(int index) { - ASSERT(m_map.contains(index)); - return *m_map.get(index); - } - - void decrementRef(int index) { - ASSERT(m_map.contains(index)); - CalculationValue* value = m_map.get(index); - if (value->hasOneRef()) { - // Force the CalculationValue destructor early to avoid a potential - // recursive call inside HashMap remove(). - m_map.set(index, nullptr); - m_map.remove(index); - } else { - value->deref(); - } - } - - private: - int m_index; - HashMap> m_map; -}; - -static CalculationValueHandleMap& calcHandles() { - DEFINE_STATIC_LOCAL(CalculationValueHandleMap, handleMap, ()); - return handleMap; -} - -Length::Length(PassRefPtr calc) - : m_quirk(false), m_type(Calculated), m_isFloat(false) { - m_intValue = calcHandles().insert(calc); -} - -Length Length::blendMixedTypes(const Length& from, - double progress, - ValueRange range) const { - ASSERT(from.isSpecified()); - ASSERT(isSpecified()); - PixelsAndPercent fromPixelsAndPercent = from.pixelsAndPercent(); - PixelsAndPercent toPixelsAndPercent = pixelsAndPercent(); - const float pixels = blink::blend(fromPixelsAndPercent.pixels, - toPixelsAndPercent.pixels, progress); - const float percent = blink::blend(fromPixelsAndPercent.percent, - toPixelsAndPercent.percent, progress); - return Length( - CalculationValue::create(PixelsAndPercent(pixels, percent), range)); -} - -PixelsAndPercent Length::pixelsAndPercent() const { - switch (type()) { - case Fixed: - return PixelsAndPercent(value(), 0); - case Percent: - return PixelsAndPercent(0, value()); - case Calculated: - return calculationValue().pixelsAndPercent(); - default: - ASSERT_NOT_REACHED(); - return PixelsAndPercent(0, 0); - } -} - -Length Length::subtractFromOneHundredPercent() const { - PixelsAndPercent result = pixelsAndPercent(); - result.pixels = -result.pixels; - result.percent = 100 - result.percent; - if (result.pixels && result.percent) - return Length(CalculationValue::create(result, ValueRangeAll)); - if (result.percent) - return Length(result.percent, Percent); - return Length(result.pixels, Fixed); -} - -CalculationValue& Length::calculationValue() const { - ASSERT(isCalculated()); - return calcHandles().get(calculationHandle()); -} - -void Length::incrementCalculatedRef() const { - ASSERT(isCalculated()); - calculationValue().ref(); -} - -void Length::decrementCalculatedRef() const { - ASSERT(isCalculated()); - calcHandles().decrementRef(calculationHandle()); -} - -float Length::nonNanCalculatedValue(int maxValue) const { - ASSERT(isCalculated()); - float result = calculationValue().evaluate(maxValue); - if (std::isnan(result)) - return 0; - return result; -} - -bool Length::isCalculatedEqual(const Length& o) const { - return isCalculated() && (&calculationValue() == &o.calculationValue() || - calculationValue() == o.calculationValue()); -} - -struct SameSizeAsLength { - int32_t value; - int32_t metaData; -}; -COMPILE_ASSERT(sizeof(Length) == sizeof(SameSizeAsLength), - length_should_stay_small); - -} // namespace blink diff --git a/sky/engine/platform/Length.h b/sky/engine/platform/Length.h deleted file mode 100644 index f5f27d75472e9..0000000000000 --- a/sky/engine/platform/Length.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - Copyright (C) 1999 Lars Knoll (knoll@kde.org) - Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) - Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef SKY_ENGINE_PLATFORM_LENGTH_H_ -#define SKY_ENGINE_PLATFORM_LENGTH_H_ - -#include -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -// FIXME: This enum makes it hard to tell in general what values may be -// appropriate for any given Length. -enum LengthType { - Auto, - Percent, - Fixed, - Intrinsic, - MinIntrinsic, - MinContent, - MaxContent, - FillAvailable, - FitContent, - Calculated, - DeviceWidth, - DeviceHeight, - MaxSizeNone -}; - -enum ValueRange { ValueRangeAll, ValueRangeNonNegative }; - -struct PixelsAndPercent { - PixelsAndPercent(float pixels, float percent) - : pixels(pixels), percent(percent) {} - float pixels; - float percent; -}; - -class CalculationValue; - -class PLATFORM_EXPORT Length { - WTF_MAKE_FAST_ALLOCATED; - - public: - Length() : m_intValue(0), m_quirk(false), m_type(Auto), m_isFloat(false) {} - - Length(LengthType t) - : m_intValue(0), m_quirk(false), m_type(t), m_isFloat(false) { - ASSERT(t != Calculated); - } - - Length(int v, LengthType t, bool q = false) - : m_intValue(v), m_quirk(q), m_type(t), m_isFloat(false) { - ASSERT(t != Calculated); - } - - Length(LayoutUnit v, LengthType t, bool q = false) - : m_floatValue(v.toFloat()), m_quirk(q), m_type(t), m_isFloat(true) { - ASSERT(t != Calculated); - } - - Length(float v, LengthType t, bool q = false) - : m_floatValue(v), m_quirk(q), m_type(t), m_isFloat(true) { - ASSERT(t != Calculated); - } - - Length(double v, LengthType t, bool q = false) - : m_quirk(q), m_type(t), m_isFloat(true) { - m_floatValue = static_cast(v); - } - - explicit Length(PassRefPtr); - - Length(const Length& length) { - memcpy(this, &length, sizeof(Length)); - if (isCalculated()) - incrementCalculatedRef(); - } - - Length& operator=(const Length& length) { - if (length.isCalculated()) - length.incrementCalculatedRef(); - if (isCalculated()) - decrementCalculatedRef(); - memcpy(this, &length, sizeof(Length)); - return *this; - } - - Length(Length&& length) { - memcpy(this, &length, sizeof(Length)); - - // Reset |length|'s type to Auto to make sure its destructor - // won't call decrementCalculatedRef() as we don't call - // incrementCalculatedRef() here. - length.m_type = Auto; - } - - Length& operator=(Length&& length) { - if (this == &length) - return *this; - - if (isCalculated()) - decrementCalculatedRef(); - - memcpy(this, &length, sizeof(Length)); - - // Reset |length|'s type to Auto to make sure its destructor - // won't call decrementCalculatedRef() as we don't call - // incrementCalculatedRef() here. - length.m_type = Auto; - - return *this; - } - - ~Length() { - if (isCalculated()) - decrementCalculatedRef(); - } - - bool operator==(const Length& o) const { - return (m_type == o.m_type) && (m_quirk == o.m_quirk) && - (isMaxSizeNone() || (getFloatValue() == o.getFloatValue()) || - isCalculatedEqual(o)); - } - bool operator!=(const Length& o) const { return !(*this == o); } - - const Length& operator*=(float v) { - if (isCalculated()) { - ASSERT_NOT_REACHED(); - return *this; - } - - if (m_isFloat) - m_floatValue = static_cast(m_floatValue * v); - else - m_intValue = static_cast(m_intValue * v); - - return *this; - } - - inline float value() const { return getFloatValue(); } - - int intValue() const { - if (isCalculated()) { - ASSERT_NOT_REACHED(); - return 0; - } - return getIntValue(); - } - - float percent() const { - ASSERT(type() == Percent); - return getFloatValue(); - } - PixelsAndPercent pixelsAndPercent() const; - - CalculationValue& calculationValue() const; - - LengthType type() const { return static_cast(m_type); } - bool quirk() const { return m_quirk; } - - void setQuirk(bool quirk) { m_quirk = quirk; } - - void setValue(LengthType t, int value) { - m_type = t; - m_intValue = value; - m_isFloat = false; - } - - void setValue(int value) { - if (isCalculated()) { - ASSERT_NOT_REACHED(); - return; - } - setValue(Fixed, value); - } - - void setValue(LengthType t, float value) { - m_type = t; - m_floatValue = value; - m_isFloat = true; - } - - void setValue(LengthType t, LayoutUnit value) { - m_type = t; - m_floatValue = value.toFloat(); - m_isFloat = true; - } - - void setValue(float value) { *this = Length(value, Fixed); } - - bool isMaxSizeNone() const { return type() == MaxSizeNone; } - - // FIXME calc: https://bugs.webkit.org/show_bug.cgi?id=80357. A calculated - // Length always contains a percentage, and without a maxValue passed to these - // functions it's impossible to determine the sign or zero-ness. We assume all - // calc values are positive and non-zero for now. - bool isZero() const { - ASSERT(!isMaxSizeNone()); - if (isCalculated()) - return false; - - return m_isFloat ? !m_floatValue : !m_intValue; - } - bool isPositive() const { - if (isMaxSizeNone()) - return false; - if (isCalculated()) - return true; - - return getFloatValue() > 0; - } - bool isNegative() const { - if (isMaxSizeNone() || isCalculated()) - return false; - - return getFloatValue() < 0; - } - - bool isAuto() const { return type() == Auto; } - bool isPercent() const { return type() == Percent || type() == Calculated; } - bool isFixed() const { return type() == Fixed; } - bool isIntrinsicOrAuto() const { - return type() == Auto || isLegacyIntrinsic() || isIntrinsic(); - } - bool isLegacyIntrinsic() const { - return type() == Intrinsic || type() == MinIntrinsic; - } - bool isIntrinsic() const { - return type() == MinContent || type() == MaxContent || - type() == FillAvailable || type() == FitContent; - } - bool isSpecified() const { - return type() == Fixed || type() == Percent || type() == Calculated; - } - bool isSpecifiedOrIntrinsic() const { return isSpecified() || isIntrinsic(); } - bool isCalculated() const { return type() == Calculated; } - bool isCalculatedEqual(const Length&) const; - bool isMinContent() const { return type() == MinContent; } - bool isMaxContent() const { return type() == MaxContent; } - bool isFillAvailable() const { return type() == FillAvailable; } - bool isFitContent() const { return type() == FitContent; } - - Length blend(const Length& from, double progress, ValueRange range) const { - ASSERT(isSpecified() && from.isSpecified()); - - if (progress == 0.0) - return from; - - if (progress == 1.0) - return *this; - - if (from.type() == Calculated || type() == Calculated) - return blendMixedTypes(from, progress, range); - - if (!from.isZero() && !isZero() && from.type() != type()) - return blendMixedTypes(from, progress, range); - - if (from.isZero() && isZero()) - return *this; - - LengthType resultType = type(); - if (isZero()) - resultType = from.type(); - - float blendedValue = blink::blend(from.value(), value(), progress); - if (range == ValueRangeNonNegative) - blendedValue = clampTo(blendedValue, 0); - return Length(blendedValue, resultType); - } - - float getFloatValue() const { - ASSERT(!isMaxSizeNone()); - return m_isFloat ? m_floatValue : m_intValue; - } - float nonNanCalculatedValue(int maxValue) const; - - Length subtractFromOneHundredPercent() const; - - private: - int getIntValue() const { - ASSERT(!isMaxSizeNone()); - return m_isFloat ? static_cast(m_floatValue) : m_intValue; - } - - Length blendMixedTypes(const Length& from, double progress, ValueRange) const; - - int calculationHandle() const { - ASSERT(isCalculated()); - return getIntValue(); - } - void incrementCalculatedRef() const; - void decrementCalculatedRef() const; - - union { - int m_intValue; - float m_floatValue; - }; - bool m_quirk; - unsigned char m_type; - bool m_isFloat; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_LENGTH_H_ diff --git a/sky/engine/platform/LengthBox.cpp b/sky/engine/platform/LengthBox.cpp deleted file mode 100644 index 7d34d952b9570..0000000000000 --- a/sky/engine/platform/LengthBox.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/LengthBox.h" - -namespace blink { - -const Length& LengthBox::logicalLeft() const { - return m_left; -} - -const Length& LengthBox::logicalRight() const { - return m_right; -} - -const Length& LengthBox::before() const { - // FIXME(sky): Remove - return m_top; -} - -const Length& LengthBox::after() const { - // FIXME(sky): Remove - return m_bottom; -} - -const Length& LengthBox::start(TextDirection direction) const { - return isLeftToRightDirection(direction) ? m_left : m_right; -} - -const Length& LengthBox::end(TextDirection direction) const { - return isLeftToRightDirection(direction) ? m_right : m_left; -} - -} // namespace blink diff --git a/sky/engine/platform/LengthBox.h b/sky/engine/platform/LengthBox.h deleted file mode 100644 index 148b1bd19b3be..0000000000000 --- a/sky/engine/platform/LengthBox.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 1999 Lars Knoll (knoll@kde.org) - Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - Copyright (c) 2012, Google Inc. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef SKY_ENGINE_PLATFORM_LENGTHBOX_H_ -#define SKY_ENGINE_PLATFORM_LENGTHBOX_H_ - -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" - -namespace blink { - -class PLATFORM_EXPORT LengthBox { - public: - LengthBox() {} - - LengthBox(LengthType t) : m_left(t), m_right(t), m_top(t), m_bottom(t) {} - - LengthBox(int v) - : m_left(Length(v, Fixed)), - m_right(Length(v, Fixed)), - m_top(Length(v, Fixed)), - m_bottom(Length(v, Fixed)) {} - - LengthBox(const Length& t, const Length& r, const Length& b, const Length& l) - : m_left(l), m_right(r), m_top(t), m_bottom(b) {} - - LengthBox(int t, int r, int b, int l) - : m_left(Length(l, Fixed)), - m_right(Length(r, Fixed)), - m_top(Length(t, Fixed)), - m_bottom(Length(b, Fixed)) {} - - const Length& left() const { return m_left; } - const Length& right() const { return m_right; } - const Length& top() const { return m_top; } - const Length& bottom() const { return m_bottom; } - - const Length& logicalLeft() const; - const Length& logicalRight() const; - - const Length& before() const; - const Length& after() const; - const Length& start(TextDirection) const; - const Length& end(TextDirection) const; - - bool operator==(const LengthBox& o) const { - return m_left == o.m_left && m_right == o.m_right && m_top == o.m_top && - m_bottom == o.m_bottom; - } - - bool operator!=(const LengthBox& o) const { return !(*this == o); } - - bool nonZero() const { - return !(m_left.isZero() && m_right.isZero() && m_top.isZero() && - m_bottom.isZero()); - } - - // Must be public for SET_VAR in RenderStyle.h - Length m_left; - Length m_right; - Length m_top; - Length m_bottom; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_LENGTHBOX_H_ diff --git a/sky/engine/platform/LengthFunctions.cpp b/sky/engine/platform/LengthFunctions.cpp deleted file mode 100644 index bd294cfe8981d..0000000000000 --- a/sky/engine/platform/LengthFunctions.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - Copyright (C) 1999 Lars Knoll (knoll@kde.org) - Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) - Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. - Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "flutter/sky/engine/platform/LengthFunctions.h" - -#include "flutter/sky/engine/platform/LayoutUnit.h" -#include "flutter/sky/engine/platform/LengthSize.h" - -namespace blink { - -int intValueForLength(const Length& length, LayoutUnit maximumValue) { - return static_cast(valueForLength(length, maximumValue)); -} - -float floatValueForLength(const Length& length, float maximumValue) { - switch (length.type()) { - case Fixed: - return length.getFloatValue(); - case Percent: - return static_cast(maximumValue * length.percent() / 100.0f); - case FillAvailable: - case Auto: - return static_cast(maximumValue); - case Calculated: - return length.nonNanCalculatedValue(maximumValue); - case Intrinsic: - case MinIntrinsic: - case MinContent: - case MaxContent: - case FitContent: - case DeviceWidth: - case DeviceHeight: - case MaxSizeNone: - ASSERT_NOT_REACHED(); - return 0; - } - ASSERT_NOT_REACHED(); - return 0; -} - -LayoutUnit minimumValueForLength(const Length& length, - LayoutUnit maximumValue) { - switch (length.type()) { - case Fixed: - return length.value(); - case Percent: - // Don't remove the extra cast to float. It is needed for rounding on - // 32-bit Intel machines that use the FPU stack. - return static_cast(maximumValue * length.percent() / 100.0f); - case Calculated: - return length.nonNanCalculatedValue(maximumValue); - case FillAvailable: - case Auto: - return 0; - case Intrinsic: - case MinIntrinsic: - case MinContent: - case MaxContent: - case FitContent: - case DeviceWidth: - case DeviceHeight: - case MaxSizeNone: - ASSERT_NOT_REACHED(); - return 0; - } - ASSERT_NOT_REACHED(); - return 0; -} - -LayoutUnit roundedMinimumValueForLength(const Length& length, - LayoutUnit maximumValue) { - if (length.type() == Percent) - return static_cast( - round(maximumValue * length.percent() / 100.0f)); - return minimumValueForLength(length, maximumValue); -} - -LayoutUnit valueForLength(const Length& length, LayoutUnit maximumValue) { - switch (length.type()) { - case Fixed: - case Percent: - case Calculated: - return minimumValueForLength(length, maximumValue); - case FillAvailable: - case Auto: - return maximumValue; - case Intrinsic: - case MinIntrinsic: - case MinContent: - case MaxContent: - case FitContent: - case DeviceWidth: - case DeviceHeight: - case MaxSizeNone: - ASSERT_NOT_REACHED(); - return 0; - } - ASSERT_NOT_REACHED(); - return 0; -} - -FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, - const FloatSize& boxSize) { - return FloatSize(floatValueForLength(lengthSize.width(), boxSize.width()), - floatValueForLength(lengthSize.height(), boxSize.height())); -} - -} // namespace blink diff --git a/sky/engine/platform/LengthFunctions.h b/sky/engine/platform/LengthFunctions.h deleted file mode 100644 index 1102447cd10cf..0000000000000 --- a/sky/engine/platform/LengthFunctions.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (C) 1999 Lars Knoll (knoll@kde.org) - Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) - Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. - Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef SKY_ENGINE_PLATFORM_LENGTHFUNCTIONS_H_ -#define SKY_ENGINE_PLATFORM_LENGTHFUNCTIONS_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" - -namespace blink { - -class FloatSize; -class LayoutUnit; -class Length; -class LengthSize; - -PLATFORM_EXPORT int intValueForLength(const Length&, LayoutUnit maximumValue); -PLATFORM_EXPORT float floatValueForLength(const Length&, float maximumValue); -PLATFORM_EXPORT LayoutUnit minimumValueForLength(const Length&, - LayoutUnit maximumValue); -PLATFORM_EXPORT LayoutUnit -roundedMinimumValueForLength(const Length&, LayoutUnit maximumValue); -PLATFORM_EXPORT LayoutUnit valueForLength(const Length&, - LayoutUnit maximumValue); -PLATFORM_EXPORT FloatSize floatSizeForLengthSize(const LengthSize&, - const FloatSize& boxSize); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_LENGTHFUNCTIONS_H_ diff --git a/sky/engine/platform/LengthPoint.h b/sky/engine/platform/LengthPoint.h deleted file mode 100644 index aa1b80c5cd3f7..0000000000000 --- a/sky/engine/platform/LengthPoint.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2013, Opera Software ASA. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Opera Software ASA nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_LENGTHPOINT_H_ -#define SKY_ENGINE_PLATFORM_LENGTHPOINT_H_ - -#include "flutter/sky/engine/platform/Length.h" - -namespace blink { - -struct LengthPoint { - public: - LengthPoint() {} - - LengthPoint(const Length& x, const Length& y) : m_x(x), m_y(y) {} - - bool operator==(const LengthPoint& o) const { - return m_x == o.m_x && m_y == o.m_y; - } - bool operator!=(const LengthPoint& o) const { - return m_x != o.m_x || m_y != o.m_y; - } - - void setX(const Length& x) { m_x = x; } - const Length& x() const { return m_x; } - - void setY(const Length& y) { m_y = y; } - const Length& y() const { return m_y; } - - private: - Length m_x; - Length m_y; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_LENGTHPOINT_H_ diff --git a/sky/engine/platform/LengthSize.h b/sky/engine/platform/LengthSize.h deleted file mode 100644 index 036a2b5189374..0000000000000 --- a/sky/engine/platform/LengthSize.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 1999 Lars Knoll (knoll@kde.org) - Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef SKY_ENGINE_PLATFORM_LENGTHSIZE_H_ -#define SKY_ENGINE_PLATFORM_LENGTHSIZE_H_ - -#include "flutter/sky/engine/platform/Length.h" - -namespace blink { - -class LengthSize { - public: - LengthSize() {} - - LengthSize(const Length& width, const Length& height) - : m_width(width), m_height(height) {} - - bool operator==(const LengthSize& o) const { - return m_width == o.m_width && m_height == o.m_height; - } - - void setWidth(const Length& width) { m_width = width; } - const Length& width() const { return m_width; } - - void setHeight(const Length& height) { m_height = height; } - const Length& height() const { return m_height; } - - private: - Length m_width; - Length m_height; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_LENGTHSIZE_H_ diff --git a/sky/engine/platform/NotImplemented.h b/sky/engine/platform/NotImplemented.h deleted file mode 100644 index 03934d329a6f4..0000000000000 --- a/sky/engine/platform/NotImplemented.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2007 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_NOTIMPLEMENTED_H_ -#define SKY_ENGINE_PLATFORM_NOTIMPLEMENTED_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Assertions.h" - -#define notImplemented() ((void)0) - -#endif // SKY_ENGINE_PLATFORM_NOTIMPLEMENTED_H_ diff --git a/sky/engine/platform/Partitions.cpp b/sky/engine/platform/Partitions.cpp deleted file mode 100644 index 0fff7345b6b1c..0000000000000 --- a/sky/engine/platform/Partitions.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/Partitions.h" - -namespace blink { - -SizeSpecificPartitionAllocator<3072> Partitions::m_objectModelAllocator; -SizeSpecificPartitionAllocator<1024> Partitions::m_renderingAllocator; - -void Partitions::init() { - m_objectModelAllocator.init(); - m_renderingAllocator.init(); -} - -void Partitions::shutdown() { - // We could ASSERT here for a memory leak within the partition, but it leads - // to very hard to diagnose ASSERTs, so it's best to leave leak checking for - // the valgrind and heapcheck bots, which run without partitions. - (void)m_renderingAllocator.shutdown(); - (void)m_objectModelAllocator.shutdown(); -} - -} // namespace blink diff --git a/sky/engine/platform/Partitions.h b/sky/engine/platform/Partitions.h deleted file mode 100644 index 0b8955870a88b..0000000000000 --- a/sky/engine/platform/Partitions.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_PARTITIONS_H_ -#define SKY_ENGINE_PLATFORM_PARTITIONS_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/PartitionAlloc.h" - -namespace blink { - -class PLATFORM_EXPORT Partitions { - public: - static void init(); - static void shutdown(); - - ALWAYS_INLINE static PartitionRoot* getObjectModelPartition() { - return m_objectModelAllocator.root(); - } - ALWAYS_INLINE static PartitionRoot* getRenderingPartition() { - return m_renderingAllocator.root(); - } - - static size_t currentDOMMemoryUsage() { - return m_objectModelAllocator.root()->totalSizeOfCommittedPages; - } - - private: - static SizeSpecificPartitionAllocator<3072> m_objectModelAllocator; - static SizeSpecificPartitionAllocator<1024> m_renderingAllocator; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_PARTITIONS_H_ diff --git a/sky/engine/platform/PlatformExport.h b/sky/engine/platform/PlatformExport.h deleted file mode 100644 index 07831305f57fa..0000000000000 --- a/sky/engine/platform/PlatformExport.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_PLATFORMEXPORT_H_ -#define SKY_ENGINE_PLATFORM_PLATFORMEXPORT_H_ - -#if !defined(BLINK_PLATFORM_IMPLEMENTATION) -#define BLINK_PLATFORM_IMPLEMENTATION 0 -#endif - -#if defined(COMPONENT_BUILD) -#define PLATFORM_EXPORT __attribute__((visibility("default"))) -#else // defined(COMPONENT_BUILD) -#define PLATFORM_EXPORT -#endif - -#endif // SKY_ENGINE_PLATFORM_PLATFORMEXPORT_H_ diff --git a/sky/engine/platform/PurgeableVector.cpp b/sky/engine/platform/PurgeableVector.cpp deleted file mode 100644 index b0b5b059eb089..0000000000000 --- a/sky/engine/platform/PurgeableVector.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/PurgeableVector.h" - -#include "flutter/sky/engine/public/platform/Platform.h" -#include "flutter/sky/engine/public/platform/WebDiscardableMemory.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -#include - -namespace blink { - -// WebDiscardableMemory allocations are expensive and page-grained. We only use -// them when there's a reasonable amount of memory to be saved by the OS -// discarding the memory. -static const size_t minimumDiscardableAllocationSize = 4 * 4096; - -PurgeableVector::PurgeableVector(PurgeableOption purgeable) - : m_discardableCapacity(0), - m_discardableSize(0), - m_isPurgeable(purgeable == Purgeable), - m_locksCount(1) // The buffer is locked at creation. -{} - -PurgeableVector::~PurgeableVector() {} - -void PurgeableVector::reserveCapacity(size_t capacity) { - ASSERT(isLocked()); - - if (m_isPurgeable) { - if (reservePurgeableCapacity(capacity, UseExactCapacity)) - return; - // Fallback to non-purgeable buffer allocation in case discardable memory - // allocation failed. - } - - if (!m_vector.capacity()) { - // Using reserveInitialCapacity() on the underlying vector ensures that the - // vector uses the exact specified capacity to avoid consuming too much - // memory for small resources. - m_vector.reserveInitialCapacity(capacity); - } else { - m_vector.reserveCapacity(capacity); - } - - moveDataFromDiscardableToVector(); -} - -void PurgeableVector::moveDataFromDiscardableToVector() { - if (m_discardable) { - m_vector.append(static_cast(m_discardable->data()), - m_discardableSize); - clearDiscardable(); - } -} - -void PurgeableVector::clearDiscardable() { - m_discardable.clear(); - m_discardableCapacity = 0; - m_discardableSize = 0; -} - -void PurgeableVector::append(const char* data, size_t length) { - ASSERT(isLocked()); - - if (!m_isPurgeable) { - m_vector.append(data, length); - return; - } - - const size_t currentSize = - m_discardable ? m_discardableSize : m_vector.size(); - const size_t newBufferSize = currentSize + length; - - if (!reservePurgeableCapacity(newBufferSize, UseExponentialGrowth)) { - moveDataFromDiscardableToVector(); - m_vector.append(data, length); - return; - } - - ASSERT(m_discardableSize + length <= m_discardableCapacity); - memcpy(static_cast(m_discardable->data()) + m_discardableSize, data, - length); - m_discardableSize += length; -} - -void PurgeableVector::grow(size_t newSize) { - ASSERT(newSize >= size()); - - if (m_isPurgeable) { - if (reservePurgeableCapacity(newSize, UseExponentialGrowth)) { - m_discardableSize = newSize; - return; - } - moveDataFromDiscardableToVector(); - } - - m_vector.resize(newSize); -} - -void PurgeableVector::clear() { - clearDiscardable(); - m_vector.clear(); -} - -char* PurgeableVector::data() { - ASSERT(isLocked()); - return m_discardable ? static_cast(m_discardable->data()) - : m_vector.data(); -} - -size_t PurgeableVector::size() const { - return m_discardable ? m_discardableSize : m_vector.size(); -} - -void PurgeableVector::adopt(Vector& other) { - if (size() > 0) - clear(); - - if (!m_isPurgeable) { - m_vector.swap(other); - return; - } - - if (other.isEmpty()) - return; - - append(other.data(), other.size()); - other.clear(); -} - -bool PurgeableVector::lock() { - ++m_locksCount; - if (m_locksCount > 1) - return true; - - ASSERT(m_locksCount == 1); - if (!m_discardable) - return true; - - return m_discardable->lock(); -} - -void PurgeableVector::unlock() { - ASSERT(isLocked()); - --m_locksCount; - if (m_locksCount > 0) - return; - - if (!m_vector.isEmpty()) { - ASSERT(!m_discardable); - m_isPurgeable = true; - if (!reservePurgeableCapacity(m_vector.size(), UseExactCapacity)) - return; - } - - if (m_discardable) - m_discardable->unlock(); -} - -bool PurgeableVector::isLocked() const { - ASSERT(m_locksCount >= 0); - return m_locksCount > 0; -} - -bool PurgeableVector::reservePurgeableCapacity( - size_t capacity, - PurgeableAllocationStrategy allocationStrategy) { - ASSERT(m_isPurgeable); - - if (m_discardable && m_discardableCapacity >= capacity) { - ASSERT(!m_vector.capacity()); - return true; - } - - if (capacity < minimumDiscardableAllocationSize) - return false; - - if (allocationStrategy == UseExponentialGrowth) - capacity = adjustPurgeableCapacity(capacity); - - OwnPtr discardable = adoptPtr( - blink::Platform::current()->allocateAndLockDiscardableMemory(capacity)); - if (!discardable) { - // Discardable memory is not supported. - m_isPurgeable = false; - return false; - } - - m_discardableCapacity = capacity; - // Copy the data that was either in the previous purgeable buffer or in the - // vector to the new purgeable buffer. - if (m_discardable) { - memcpy(discardable->data(), m_discardable->data(), m_discardableSize); - } else { - memcpy(discardable->data(), m_vector.data(), m_vector.size()); - m_discardableSize = m_vector.size(); - m_vector.clear(); - } - - m_discardable.swap(discardable); - ASSERT(!m_vector.capacity()); - return true; -} - -size_t PurgeableVector::adjustPurgeableCapacity(size_t capacity) const { - ASSERT(capacity >= minimumDiscardableAllocationSize); - - const float growthFactor = 1.5; - size_t newCapacity = std::max( - capacity, static_cast(m_discardableCapacity * growthFactor)); - - // Discardable memory has page-granularity so align to the next page here to - // minimize fragmentation. Since the page size is only used below to minimize - // fragmentation it's still safe to use it even if it gets out of sync (e.g. - // due to the use of huge pages). - const size_t kPageSize = 4096; - newCapacity = (newCapacity + kPageSize - 1) & ~(kPageSize - 1); - - return std::max(capacity, newCapacity); // Overflow check. -} - -} // namespace blink diff --git a/sky/engine/platform/PurgeableVector.h b/sky/engine/platform/PurgeableVector.h deleted file mode 100644 index 427fe0e9ade66..0000000000000 --- a/sky/engine/platform/PurgeableVector.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_PURGEABLEVECTOR_H_ -#define SKY_ENGINE_PLATFORM_PURGEABLEVECTOR_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class WebDiscardableMemory; - -// A simple vector implementation that supports purgeable memory. The vector is -// already locked at construction and locking uses an internal counter which -// means that N calls to lock() must be followed by N+1 calls to unlock() to -// actually make the vector purgeable. -class PLATFORM_EXPORT PurgeableVector { - WTF_MAKE_NONCOPYABLE(PurgeableVector); - - public: - enum PurgeableOption { - NotPurgeable, - Purgeable, - }; - - // Clients who know in advance that they will call unlock() should construct - // the instance with the Purgeable option so that the instance uses - // discardable memory from the start and unlock() doesn't cause a memcpy(). - PurgeableVector(PurgeableOption = Purgeable); - - ~PurgeableVector(); - - // WARNING: This causes a memcpy() if the instance was constructed with the - // Purgeable hint or had its internal vector moved to discardable memory - // after a call to unlock(). - void adopt(Vector& other); - - void append(const char* data, size_t length); - - void grow(size_t); - - void clear(); - - // The instance must be locked before calling this. - char* data(); - - size_t size() const; - - // Returns whether the memory is still resident. - bool lock(); - - // WARNING: Calling unlock() on an instance that wasn't created with the - // Purgeable option does an extra memcpy(). - void unlock(); - - bool isLocked() const; - - // Note that this method should be used carefully since it may not use - // exponential growth internally. This means that repeated/invalid uses of - // it can result in O(N^2) append(). If you don't exactly know what you are - // doing then you should probably not call this method. - void reserveCapacity(size_t capacity); - - private: - enum PurgeableAllocationStrategy { - UseExactCapacity, - UseExponentialGrowth, - }; - - // Copies data from the discardable buffer to the vector and clears the - // discardable buffer. - void moveDataFromDiscardableToVector(); - - void clearDiscardable(); - - bool reservePurgeableCapacity(size_t capacity, PurgeableAllocationStrategy); - - size_t adjustPurgeableCapacity(size_t capacity) const; - - // Vector used when the instance is constructed without the purgeability - // hint or when discardable memory allocation fails. - // Note that there can't be data both in |m_vector| and - // |m_discardable|, i.e. only one of them is used at a given time. - Vector m_vector; - OwnPtr m_discardable; - size_t m_discardableCapacity; - size_t m_discardableSize; - bool m_isPurgeable; - int m_locksCount; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_PURGEABLEVECTOR_H_ diff --git a/sky/engine/platform/PurgeableVectorTest.cpp b/sky/engine/platform/PurgeableVectorTest.cpp deleted file mode 100644 index 0d56db123dbe6..0000000000000 --- a/sky/engine/platform/PurgeableVectorTest.cpp +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/PurgeableVector.h" - -#include "flutter/sky/engine/platform/TestingPlatformSupport.h" -#include "flutter/sky/engine/public/platform/WebDiscardableMemory.h" -#include "flutter/sky/engine/wtf/Vector.h" - -#include -#include - -#include - -using namespace blink; - -namespace { - -const size_t kTestSize = 32 * 1024; - -enum DiscardableMemorySupport { - DontSupportDiscardableMemory, - SupportDiscardableMemory, -}; - -class PurgeableVectorTestWithPlatformSupport - : public testing::TestWithParam { - public: - PurgeableVectorTestWithPlatformSupport() - : m_testingPlatformSupport(makeTestingPlatformSupportConfig()) {} - - protected: - bool isDiscardableMemorySupported() const { - return GetParam() == SupportDiscardableMemory; - } - - TestingPlatformSupport::Config makeTestingPlatformSupportConfig() const { - TestingPlatformSupport::Config config; - config.hasDiscardableMemorySupport = isDiscardableMemorySupported(); - return config; - } - - PurgeableVector::PurgeableOption makePurgeableOption() const { - return isDiscardableMemorySupported() ? PurgeableVector::Purgeable - : PurgeableVector::NotPurgeable; - } - - private: - TestingPlatformSupport m_testingPlatformSupport; -}; - -TEST_P(PurgeableVectorTestWithPlatformSupport, grow) { - PurgeableVector purgeableVector(makePurgeableOption()); - purgeableVector.grow(kTestSize); - ASSERT_EQ(kTestSize, purgeableVector.size()); - // Make sure the underlying buffer was actually (re)allocated. - memset(purgeableVector.data(), 0, purgeableVector.size()); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, clear) { - Vector testData(kTestSize); - std::generate(testData.begin(), testData.end(), &std::rand); - - PurgeableVector purgeableVector(makePurgeableOption()); - purgeableVector.append(testData.data(), testData.size()); - EXPECT_EQ(testData.size(), purgeableVector.size()); - - purgeableVector.clear(); - EXPECT_EQ(0U, purgeableVector.size()); - EXPECT_EQ(0, purgeableVector.data()); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, clearDoesNotResetLockCounter) { - PurgeableVector purgeableVector(makePurgeableOption()); - purgeableVector.clear(); - EXPECT_TRUE(purgeableVector.isLocked()); - purgeableVector.unlock(); - EXPECT_FALSE(purgeableVector.isLocked()); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, - reserveCapacityDoesNotChangeSize) { - PurgeableVector purgeableVector(makePurgeableOption()); - EXPECT_EQ(0U, purgeableVector.size()); - purgeableVector.reserveCapacity(kTestSize); - EXPECT_EQ(0U, purgeableVector.size()); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, multipleAppends) { - Vector testData(kTestSize); - std::generate(testData.begin(), testData.end(), &std::rand); - - PurgeableVector purgeableVector(makePurgeableOption()); - // Force an allocation. - const char kSmallString[] = "hello"; - purgeableVector.append(kSmallString, sizeof(kSmallString)); - const char* const data = purgeableVector.data(); - - // Append all the testing data in 4 iterations. The |data| pointer should - // have been changed at the end of the unit test due to reallocations. - const size_t kIterationCount = 4; - ASSERT_EQ(0U, testData.size() % kIterationCount); - for (size_t i = 0; i < kIterationCount; ++i) { - const char* const testDataStart = - testData.data() + i * (testData.size() / kIterationCount); - purgeableVector.append(testDataStart, testData.size() / kIterationCount); - ASSERT_EQ((i + 1) * testData.size() / kIterationCount, - purgeableVector.size() - sizeof(kSmallString)); - } - - ASSERT_EQ(sizeof(kSmallString) + testData.size(), purgeableVector.size()); - EXPECT_NE(data, purgeableVector.data()); - EXPECT_EQ(0, memcmp(purgeableVector.data() + sizeof(kSmallString), - testData.data(), testData.size())); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, - multipleAppendsAfterReserveCapacity) { - Vector testData(kTestSize); - std::generate(testData.begin(), testData.end(), &std::rand); - - PurgeableVector purgeableVector(makePurgeableOption()); - purgeableVector.reserveCapacity(testData.size()); - const char* const data = purgeableVector.data(); - - // The |data| pointer should be unchanged at the end of the unit test - // meaning that there should not have been any reallocation. - const size_t kIterationCount = 4; - ASSERT_EQ(0U, testData.size() % kIterationCount); - for (size_t i = 0; i < kIterationCount; ++i) { - const char* const testDataStart = - testData.data() + i * (testData.size() / kIterationCount); - purgeableVector.append(testDataStart, testData.size() / kIterationCount); - ASSERT_EQ((i + 1) * testData.size() / kIterationCount, - purgeableVector.size()); - } - - ASSERT_EQ(testData.size(), purgeableVector.size()); - EXPECT_EQ(data, purgeableVector.data()); - EXPECT_EQ(0, - memcmp(purgeableVector.data(), testData.data(), testData.size())); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, - reserveCapacityUsesExactCapacityWhenVectorIsEmpty) { - Vector testData(kTestSize); - std::generate(testData.begin(), testData.end(), &std::rand); - - PurgeableVector purgeableVector(makePurgeableOption()); - purgeableVector.reserveCapacity(kTestSize); - const char* const data = purgeableVector.data(); - - purgeableVector.append(testData.data(), testData.size()); - EXPECT_EQ(data, purgeableVector.data()); - EXPECT_EQ(0, - memcmp(purgeableVector.data(), testData.data(), testData.size())); - - // This test is not reliable if the PurgeableVector uses a plain WTF::Vector - // for storage, as it does if discardable memory is not supported; the vectors - // capacity will always be expanded to fill the PartitionAlloc bucket. - if (isDiscardableMemorySupported()) { - // Appending one extra byte should cause a reallocation since the first - // allocation happened while the purgeable vector was empty. This behavior - // helps us guarantee that there is no memory waste on very small vectors - // (which SharedBuffer requires). - purgeableVector.append(testData.data(), 1); - EXPECT_NE(data, purgeableVector.data()); - } -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, appendReservesCapacityIfNeeded) { - Vector testData(kTestSize); - std::generate(testData.begin(), testData.end(), &std::rand); - - PurgeableVector purgeableVector(makePurgeableOption()); - // No reserveCapacity(). - ASSERT_FALSE(purgeableVector.data()); - - purgeableVector.append(testData.data(), testData.size()); - ASSERT_EQ(testData.size(), purgeableVector.size()); - ASSERT_EQ(0, - memcmp(purgeableVector.data(), testData.data(), testData.size())); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, adopt) { - Vector testData(kTestSize); - std::generate(testData.begin(), testData.end(), &std::rand); - const Vector testDataCopy(testData); - const char* const testDataPtr = testData.data(); - - PurgeableVector purgeableVector(makePurgeableOption()); - purgeableVector.adopt(testData); - EXPECT_TRUE(testData.isEmpty()); - EXPECT_EQ(kTestSize, purgeableVector.size()); - ASSERT_EQ(0, memcmp(purgeableVector.data(), testDataCopy.data(), - testDataCopy.size())); - - if (isDiscardableMemorySupported()) { - // An extra discardable memory allocation + memcpy() should have happened. - EXPECT_NE(testDataPtr, purgeableVector.data()); - } else { - // Vector::swap() should have been used. - EXPECT_EQ(testDataPtr, purgeableVector.data()); - } -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, adoptEmptyVector) { - Vector testData; - PurgeableVector purgeableVector(makePurgeableOption()); - purgeableVector.adopt(testData); -} - -TEST(PurgeableVectorTestWithPlatformSupport, adoptDiscardsPreviousData) { - Vector testData; - std::generate(testData.begin(), testData.end(), &std::rand); - - PurgeableVector purgeableVector(PurgeableVector::NotPurgeable); - static const char smallString[] = "hello"; - purgeableVector.append(smallString, sizeof(smallString)); - ASSERT_EQ(0, - memcmp(purgeableVector.data(), smallString, sizeof(smallString))); - - purgeableVector.adopt(testData); - EXPECT_EQ(testData.size(), purgeableVector.size()); - ASSERT_EQ(0, - memcmp(purgeableVector.data(), testData.data(), testData.size())); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, - unlockWithoutHintAtConstruction) { - Vector testData(30000); - std::generate(testData.begin(), testData.end(), &std::rand); - - unsigned length = testData.size(); - PurgeableVector purgeableVector(PurgeableVector::NotPurgeable); - purgeableVector.append(testData.data(), length); - ASSERT_EQ(length, purgeableVector.size()); - const char* data = purgeableVector.data(); - - purgeableVector.unlock(); - - // Note that the purgeable vector must be locked before calling data(). - const bool wasPurged = !purgeableVector.lock(); - if (isDiscardableMemorySupported()) { - // The implementation of purgeable memory used for testing always purges - // data upon unlock(). - EXPECT_TRUE(wasPurged); - } - - if (isDiscardableMemorySupported()) { - // The data should have been moved from the heap-allocated vector to a - // purgeable buffer. - ASSERT_NE(data, purgeableVector.data()); - } else { - ASSERT_EQ(data, purgeableVector.data()); - } - - if (!wasPurged) - ASSERT_EQ(0, memcmp(purgeableVector.data(), testData.data(), length)); -} - -TEST(PurgeableVectorTest, unlockOnEmptyPurgeableVector) { - PurgeableVector purgeableVector; - ASSERT_EQ(0U, purgeableVector.size()); - purgeableVector.unlock(); - ASSERT_FALSE(purgeableVector.isLocked()); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, - unlockOnPurgeableVectorWithPurgeableHint) { - Vector testData(kTestSize); - std::generate(testData.begin(), testData.end(), &std::rand); - - PurgeableVector purgeableVector; - purgeableVector.append(testData.data(), kTestSize); - const char* const data = purgeableVector.data(); - - // unlock() should happen in place, i.e. without causing any reallocation. - // Note that the instance must be locked when data() is called. - purgeableVector.unlock(); - EXPECT_FALSE(purgeableVector.isLocked()); - purgeableVector.lock(); - EXPECT_TRUE(purgeableVector.isLocked()); - EXPECT_EQ(data, purgeableVector.data()); -} - -TEST_P(PurgeableVectorTestWithPlatformSupport, lockingUsesACounter) { - Vector testData(kTestSize); - std::generate(testData.begin(), testData.end(), &std::rand); - - PurgeableVector purgeableVector(PurgeableVector::NotPurgeable); - purgeableVector.append(testData.data(), testData.size()); - ASSERT_EQ(testData.size(), purgeableVector.size()); - - ASSERT_TRUE( - purgeableVector.isLocked()); // SharedBuffer is locked at creation. - ASSERT_TRUE(purgeableVector.lock()); // Add an extra lock. - ASSERT_TRUE(purgeableVector.isLocked()); - - purgeableVector.unlock(); - ASSERT_TRUE(purgeableVector.isLocked()); - - purgeableVector.unlock(); - ASSERT_FALSE(purgeableVector.isLocked()); - - if (purgeableVector.lock()) - ASSERT_EQ(0, - memcmp(purgeableVector.data(), testData.data(), testData.size())); -} - -// Instantiates all the unit tests using the SharedBufferTestWithPlatformSupport -// fixture both with and without discardable memory support. -INSTANTIATE_TEST_CASE_P(testsWithPlatformSetUp, - PurgeableVectorTestWithPlatformSupport, - ::testing::Values(DontSupportDiscardableMemory, - SupportDiscardableMemory)); - -} // namespace diff --git a/sky/engine/platform/SharedBuffer.cpp b/sky/engine/platform/SharedBuffer.cpp deleted file mode 100644 index bc94f22e97ce6..0000000000000 --- a/sky/engine/platform/SharedBuffer.cpp +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/SharedBuffer.h" - -#include "flutter/sky/engine/public/platform/Platform.h" -#include "flutter/sky/engine/wtf/unicode/UTF8.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" -#include "third_party/skia/include/private/SkMalloc.h" - -#undef SHARED_BUFFER_STATS - -#ifdef SHARED_BUFFER_STATS -#include "flutter/sky/engine/wtf/DataLog.h" -#endif - -namespace blink { - -static const unsigned segmentSize = 0x1000; -static const unsigned segmentPositionMask = 0x0FFF; - -static inline unsigned segmentIndex(unsigned position) { - return position / segmentSize; -} - -static inline unsigned offsetInSegment(unsigned position) { - return position & segmentPositionMask; -} - -static inline char* allocateSegment() { - return static_cast(fastMalloc(segmentSize)); -} - -static inline void freeSegment(char* p) { - fastFree(p); -} - -#ifdef SHARED_BUFFER_STATS - -static Mutex& statsMutex() { - DEFINE_STATIC_LOCAL(Mutex, mutex, ()); - return mutex; -} - -static HashSet& liveBuffers() { - DEFINE_STATIC_LOCAL(HashSet, buffers, ()); - return buffers; -} - -static bool sizeComparator(SharedBuffer* a, SharedBuffer* b) { - return a->size() > b->size(); -} - -static CString snippetForBuffer(SharedBuffer* sharedBuffer) { - const unsigned kMaxSnippetLength = 64; - char* snippet = 0; - unsigned snippetLength = std::min(sharedBuffer->size(), kMaxSnippetLength); - CString result = CString::newUninitialized(snippetLength, snippet); - - const char* segment; - unsigned offset = 0; - while (unsigned segmentLength = sharedBuffer->getSomeData(segment, offset)) { - unsigned length = std::min(segmentLength, snippetLength - offset); - memcpy(snippet + offset, segment, length); - offset += segmentLength; - if (offset >= snippetLength) - break; - } - - for (unsigned i = 0; i < snippetLength; ++i) { - if (!isASCIIPrintable(snippet[i])) - snippet[i] = '?'; - } - - return result; -} - -static void printStats() { - MutexLocker locker(statsMutex()); - Vector buffers; - for (HashSet::const_iterator iter = liveBuffers().begin(); - iter != liveBuffers().end(); ++iter) - buffers.append(*iter); - std::sort(buffers.begin(), buffers.end(), sizeComparator); - - dataLogF("---- Shared Buffer Stats ----\n"); - for (size_t i = 0; i < buffers.size() && i < 64; ++i) { - CString snippet = snippetForBuffer(buffers[i]); - dataLogF("Buffer size=%8u %s\n", buffers[i]->size(), snippet.data()); - } -} - -static void didCreateSharedBuffer(SharedBuffer* buffer) { - MutexLocker locker(statsMutex()); - liveBuffers().add(buffer); - - Threads::UI()->PostTask(printStats); -} - -static void willDestroySharedBuffer(SharedBuffer* buffer) { - MutexLocker locker(statsMutex()); - liveBuffers().remove(buffer); -} - -#endif - -SharedBuffer::SharedBuffer() - : m_size(0), m_buffer(PurgeableVector::NotPurgeable) { -#ifdef SHARED_BUFFER_STATS - didCreateSharedBuffer(this); -#endif -} - -SharedBuffer::SharedBuffer(size_t size) - : m_size(size), m_buffer(PurgeableVector::NotPurgeable) { - m_buffer.reserveCapacity(size); - m_buffer.grow(size); -#ifdef SHARED_BUFFER_STATS - didCreateSharedBuffer(this); -#endif -} - -SharedBuffer::SharedBuffer(const char* data, int size) - : m_size(0), m_buffer(PurgeableVector::NotPurgeable) { - // FIXME: Use unsigned consistently, and check for invalid casts when calling - // into SharedBuffer from other code. - if (size < 0) - CRASH(); - - append(data, size); - -#ifdef SHARED_BUFFER_STATS - didCreateSharedBuffer(this); -#endif -} - -SharedBuffer::SharedBuffer(const char* data, - int size, - PurgeableVector::PurgeableOption purgeable) - : m_size(0), m_buffer(purgeable) { - // FIXME: Use unsigned consistently, and check for invalid casts when calling - // into SharedBuffer from other code. - if (size < 0) - CRASH(); - - append(data, size); - -#ifdef SHARED_BUFFER_STATS - didCreateSharedBuffer(this); -#endif -} - -SharedBuffer::SharedBuffer(const unsigned char* data, int size) - : m_size(0), m_buffer(PurgeableVector::NotPurgeable) { - // FIXME: Use unsigned consistently, and check for invalid casts when calling - // into SharedBuffer from other code. - if (size < 0) - CRASH(); - - append(reinterpret_cast(data), size); - -#ifdef SHARED_BUFFER_STATS - didCreateSharedBuffer(this); -#endif -} - -SharedBuffer::~SharedBuffer() { - clear(); - -#ifdef SHARED_BUFFER_STATS - willDestroySharedBuffer(this); -#endif -} - -PassRefPtr SharedBuffer::adoptVector(Vector& vector) { - RefPtr buffer = create(); - buffer->m_buffer.adopt(vector); - buffer->m_size = buffer->m_buffer.size(); - return buffer.release(); -} - -unsigned SharedBuffer::size() const { - return m_size; -} - -const char* SharedBuffer::data() const { - mergeSegmentsIntoBuffer(); - return m_buffer.data(); -} - -void SharedBuffer::append(PassRefPtr data) { - const char* segment; - size_t position = 0; - while (size_t length = data->getSomeData(segment, position)) { - append(segment, length); - position += length; - } -} - -void SharedBuffer::append(const char* data, unsigned length) { - ASSERT(isLocked()); - if (!length) - return; - - ASSERT(m_size >= m_buffer.size()); - unsigned positionInSegment = offsetInSegment(m_size - m_buffer.size()); - m_size += length; - - if (m_size <= segmentSize) { - // No need to use segments for small resource data. - m_buffer.append(data, length); - return; - } - - char* segment; - if (!positionInSegment) { - segment = allocateSegment(); - m_segments.append(segment); - } else - segment = m_segments.last() + positionInSegment; - - unsigned segmentFreeSpace = segmentSize - positionInSegment; - unsigned bytesToCopy = std::min(length, segmentFreeSpace); - - for (;;) { - memcpy(segment, data, bytesToCopy); - if (static_cast(length) == bytesToCopy) - break; - - length -= bytesToCopy; - data += bytesToCopy; - segment = allocateSegment(); - m_segments.append(segment); - bytesToCopy = std::min(length, segmentSize); - } -} - -void SharedBuffer::append(const Vector& data) { - append(data.data(), data.size()); -} - -void SharedBuffer::clear() { - for (unsigned i = 0; i < m_segments.size(); ++i) - freeSegment(m_segments[i]); - - m_segments.clear(); - m_size = 0; - m_buffer.clear(); -} - -PassRefPtr SharedBuffer::copy() const { - RefPtr clone(adoptRef(new SharedBuffer)); - clone->m_size = m_size; - clone->m_buffer.reserveCapacity(m_size); - clone->m_buffer.append(m_buffer.data(), m_buffer.size()); - if (!m_segments.isEmpty()) { - const char* segment = 0; - unsigned position = m_buffer.size(); - while (unsigned segmentSize = getSomeData(segment, position)) { - clone->m_buffer.append(segment, segmentSize); - position += segmentSize; - } - ASSERT(position == clone->size()); - } - return clone.release(); -} - -void SharedBuffer::mergeSegmentsIntoBuffer() const { - unsigned bufferSize = m_buffer.size(); - if (m_size > bufferSize) { - m_buffer.reserveCapacity(m_size); - unsigned bytesLeft = m_size - bufferSize; - for (unsigned i = 0; i < m_segments.size(); ++i) { - unsigned bytesToCopy = std::min(bytesLeft, segmentSize); - m_buffer.append(m_segments[i], bytesToCopy); - bytesLeft -= bytesToCopy; - freeSegment(m_segments[i]); - } - m_segments.clear(); - } -} - -unsigned SharedBuffer::getSomeData(const char*& someData, - unsigned position) const { - ASSERT(isLocked()); - unsigned totalSize = size(); - if (position >= totalSize) { - someData = 0; - return 0; - } - - ASSERT_WITH_SECURITY_IMPLICATION(position < m_size); - unsigned consecutiveSize = m_buffer.size(); - if (position < consecutiveSize) { - someData = m_buffer.data() + position; - return consecutiveSize - position; - } - - position -= consecutiveSize; - unsigned segments = m_segments.size(); - unsigned maxSegmentedSize = segments * segmentSize; - unsigned segment = segmentIndex(position); - if (segment < segments) { - unsigned bytesLeft = totalSize - consecutiveSize; - unsigned segmentedSize = std::min(maxSegmentedSize, bytesLeft); - - unsigned positionInSegment = offsetInSegment(position); - someData = m_segments[segment] + positionInSegment; - return segment == segments - 1 ? segmentedSize - position - : segmentSize - positionInSegment; - } - ASSERT_NOT_REACHED(); - return 0; -} - -sk_sp SharedBuffer::getAsSkData() const { - unsigned bufferLength = size(); - char* buffer = static_cast(sk_malloc_throw(bufferLength)); - const char* segment = 0; - unsigned position = 0; - while (unsigned segmentSize = getSomeData(segment, position)) { - memcpy(buffer + position, segment, segmentSize); - position += segmentSize; - } - - if (position != bufferLength) { - ASSERT_NOT_REACHED(); - // Don't return the incomplete SkData. - return nullptr; - } - return SkData::MakeFromMalloc(buffer, bufferLength); -} - -bool SharedBuffer::lock() { - return m_buffer.lock(); -} - -void SharedBuffer::unlock() { - mergeSegmentsIntoBuffer(); - m_buffer.unlock(); -} - -bool SharedBuffer::isLocked() const { - return m_buffer.isLocked(); -} - -} // namespace blink diff --git a/sky/engine/platform/SharedBuffer.h b/sky/engine/platform/SharedBuffer.h deleted file mode 100644 index ab3a19af4bc0c..0000000000000 --- a/sky/engine/platform/SharedBuffer.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_SHAREDBUFFER_H_ -#define SKY_ENGINE_PLATFORM_SHAREDBUFFER_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/PurgeableVector.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "third_party/skia/include/core/SkData.h" - -namespace blink { - -class PLATFORM_EXPORT SharedBuffer : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new SharedBuffer); - } - static PassRefPtr create(size_t size) { - return adoptRef(new SharedBuffer(size)); - } - static PassRefPtr create(const char* c, int i) { - return adoptRef(new SharedBuffer(c, i)); - } - static PassRefPtr create(const unsigned char* c, int i) { - return adoptRef(new SharedBuffer(c, i)); - } - - static PassRefPtr createPurgeable(const char* c, int i) { - return adoptRef(new SharedBuffer(c, i, PurgeableVector::Purgeable)); - } - - static PassRefPtr adoptVector(Vector&); - - ~SharedBuffer(); - - // Calling this function will force internal segmented buffers to be merged - // into a flat buffer. Use getSomeData() whenever possible for better - // performance. - const char* data() const; - - unsigned size() const; - - bool isEmpty() const { return !size(); } - - void append(PassRefPtr); - void append(const char*, unsigned); - void append(const Vector&); - - void clear(); - - PassRefPtr copy() const; - - // Return the number of consecutive bytes after "position". "data" - // points to the first byte. - // Return 0 when no more data left. - // When extracting all data with getSomeData(), the caller should - // repeat calling it until it returns 0. - // Usage: - // const char* segment; - // unsigned pos = 0; - // while (unsigned length = sharedBuffer->getSomeData(segment, pos)) { - // // Use the data. for example: decoder->decode(segment, length); - // pos += length; - // } - unsigned getSomeData(const char*& data, unsigned position = 0) const; - - // Creates an SkData and copies this SharedBuffer's contents to that - // SkData without merging segmented buffers into a flat buffer. - sk_sp getAsSkData() const; - - // See PurgeableVector::lock(). - bool lock(); - - // WARNING: Calling unlock() on a SharedBuffer that wasn't created with the - // purgeability option does an extra memcpy(). Please use - // SharedBuffer::createPurgeable() if you intend to call unlock(). - void unlock(); - - bool isLocked() const; - - private: - SharedBuffer(); - explicit SharedBuffer(size_t); - SharedBuffer(const char*, int); - SharedBuffer(const char*, int, PurgeableVector::PurgeableOption); - SharedBuffer(const unsigned char*, int); - - // See SharedBuffer::data(). - void mergeSegmentsIntoBuffer() const; - - unsigned m_size; - mutable PurgeableVector m_buffer; - mutable Vector m_segments; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_SHAREDBUFFER_H_ diff --git a/sky/engine/platform/TestingPlatformSupport.cpp b/sky/engine/platform/TestingPlatformSupport.cpp deleted file mode 100644 index 930d51ffaa466..0000000000000 --- a/sky/engine/platform/TestingPlatformSupport.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/TestingPlatformSupport.h" - -namespace blink { - -TestingDiscardableMemory::TestingDiscardableMemory(size_t size) - : m_data(size), m_isLocked(true) {} - -TestingDiscardableMemory::~TestingDiscardableMemory() {} - -bool TestingDiscardableMemory::lock() { - ASSERT(!m_isLocked); - m_isLocked = true; - return false; -} - -void* TestingDiscardableMemory::data() { - ASSERT(m_isLocked); - return m_data.data(); -} - -void TestingDiscardableMemory::unlock() { - ASSERT(m_isLocked); - m_isLocked = false; - // Force eviction to catch clients not correctly checking the return value of - // lock(). - memset(m_data.data(), 0, m_data.size()); -} - -TestingPlatformSupport::TestingPlatformSupport(const Config& config) - : m_config(config), m_oldPlatform(blink::Platform::current()) { - blink::Platform::initialize(this); -} - -TestingPlatformSupport::~TestingPlatformSupport() { - blink::Platform::initialize(m_oldPlatform); -} - -blink::WebDiscardableMemory* -TestingPlatformSupport::allocateAndLockDiscardableMemory(size_t bytes) { - return !m_config.hasDiscardableMemorySupport - ? 0 - : new TestingDiscardableMemory(bytes); -} - -} // namespace blink diff --git a/sky/engine/platform/TestingPlatformSupport.h b/sky/engine/platform/TestingPlatformSupport.h deleted file mode 100644 index 2c1fe36fec022..0000000000000 --- a/sky/engine/platform/TestingPlatformSupport.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TESTINGPLATFORMSUPPORT_H_ -#define SKY_ENGINE_PLATFORM_TESTINGPLATFORMSUPPORT_H_ - -#include "flutter/sky/engine/public/platform/Platform.h" -#include "flutter/sky/engine/public/platform/WebDiscardableMemory.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class TestingDiscardableMemory : public WebDiscardableMemory { - public: - explicit TestingDiscardableMemory(size_t); - virtual ~TestingDiscardableMemory(); - - // WebDiscardableMemory: - virtual bool lock() override; - virtual void* data() override; - virtual void unlock() override; - - private: - Vector m_data; - bool m_isLocked; -}; - -class TestingPlatformSupport : public Platform { - public: - struct Config { - Config() : hasDiscardableMemorySupport(false) {} - - bool hasDiscardableMemorySupport; - }; - - explicit TestingPlatformSupport(const Config&); - - virtual ~TestingPlatformSupport(); - - // Platform: - virtual WebDiscardableMemory* allocateAndLockDiscardableMemory( - size_t bytes) override; - - private: - const Config m_config; - Platform* const m_oldPlatform; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TESTINGPLATFORMSUPPORT_H_ diff --git a/sky/engine/platform/animation/AnimationUtilities.h b/sky/engine/platform/animation/AnimationUtilities.h deleted file mode 100644 index 31f30aa8750c9..0000000000000 --- a/sky/engine/platform/animation/AnimationUtilities.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_ANIMATION_ANIMATIONUTILITIES_H_ -#define SKY_ENGINE_PLATFORM_ANIMATION_ANIMATIONUTILITIES_H_ - -#include "flutter/sky/engine/platform/LayoutUnit.h" -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/IntPoint.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/TypeTraits.h" - -namespace blink { - -inline int blend(int from, int to, double progress) { - return lround(from + (to - from) * progress); -} - -// For unsigned types. -template -inline T blend(T from, T to, double progress) { - COMPILE_ASSERT(WTF::IsInteger::value, BlendForUnsignedTypes); - return clampTo(round(to > from ? from + (to - from) * progress - : from - (from - to) * progress)); -} - -inline double blend(double from, double to, double progress) { - return from + (to - from) * progress; -} - -inline float blend(float from, float to, double progress) { - return static_cast(from + (to - from) * progress); -} - -inline LayoutUnit blend(LayoutUnit from, LayoutUnit to, double progress) { - return from + (to - from) * progress; -} - -inline IntPoint blend(const IntPoint& from, - const IntPoint& to, - double progress) { - return IntPoint(blend(from.x(), to.x(), progress), - blend(from.y(), to.y(), progress)); -} - -inline FloatPoint blend(const FloatPoint& from, - const FloatPoint& to, - double progress) { - return FloatPoint(blend(from.x(), to.x(), progress), - blend(from.y(), to.y(), progress)); -} - -// Calculates the accuracy for evaluating a timing function for an animation -// with the specified duration. -inline double accuracyForDuration(double duration) { - return 1.0 / (200.0 * duration); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_ANIMATION_ANIMATIONUTILITIES_H_ diff --git a/sky/engine/platform/animation/AnimationValue.h b/sky/engine/platform/animation/AnimationValue.h deleted file mode 100644 index c18c61307e4b1..0000000000000 --- a/sky/engine/platform/animation/AnimationValue.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_ANIMATION_ANIMATIONVALUE_H_ -#define SKY_ENGINE_PLATFORM_ANIMATION_ANIMATIONVALUE_H_ - -#include "flutter/sky/engine/platform/animation/TimingFunction.h" -#include "flutter/sky/engine/platform/transforms/TransformOperations.h" - -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -// Base class for animation values (also used for transitions). Here to -// represent values for properties being animated via the GraphicsLayer, -// without pulling in style-related data from outside of the platform directory. -class AnimationValue { - WTF_MAKE_FAST_ALLOCATED; - - public: - explicit AnimationValue(double keyTime, - PassRefPtr timingFunction = nullptr) - : m_keyTime(keyTime), m_timingFunction(timingFunction) {} - - virtual ~AnimationValue() {} - - double keyTime() const { return m_keyTime; } - const TimingFunction* timingFunction() const { - return m_timingFunction.get(); - } - virtual PassOwnPtr clone() const = 0; - - private: - double m_keyTime; - RefPtr m_timingFunction; -}; - -// Used to store one float value of an animation. -class FloatAnimationValue final : public AnimationValue { - public: - FloatAnimationValue(double keyTime, - float value, - PassRefPtr timingFunction = nullptr) - : AnimationValue(keyTime, timingFunction), m_value(value) {} - virtual PassOwnPtr clone() const override { - return adoptPtr(new FloatAnimationValue(*this)); - } - - float value() const { return m_value; } - - private: - float m_value; -}; - -// Used to store one transform value in a keyframe list. -class TransformAnimationValue final : public AnimationValue { - public: - explicit TransformAnimationValue( - double keyTime, - const TransformOperations* value = 0, - PassRefPtr timingFunction = nullptr) - : AnimationValue(keyTime, timingFunction) { - if (value) - m_value = *value; - } - virtual PassOwnPtr clone() const override { - return adoptPtr(new TransformAnimationValue(*this)); - } - - const TransformOperations* value() const { return &m_value; } - - private: - TransformOperations m_value; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_ANIMATION_ANIMATIONVALUE_H_ diff --git a/sky/engine/platform/animation/KeyframeValueList.cpp b/sky/engine/platform/animation/KeyframeValueList.cpp deleted file mode 100644 index d08375cfc1c92..0000000000000 --- a/sky/engine/platform/animation/KeyframeValueList.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/animation/KeyframeValueList.h" - -namespace blink { - -void KeyframeValueList::insert(PassOwnPtr value) { - for (size_t i = 0; i < m_values.size(); ++i) { - const AnimationValue* curValue = m_values[i].get(); - if (curValue->keyTime() == value->keyTime()) { - ASSERT_NOT_REACHED(); - // insert after - m_values.insert(i + 1, value); - return; - } - if (curValue->keyTime() > value->keyTime()) { - // insert before - m_values.insert(i, value); - return; - } - } - - m_values.append(value); -} - -} // namespace blink diff --git a/sky/engine/platform/animation/KeyframeValueList.h b/sky/engine/platform/animation/KeyframeValueList.h deleted file mode 100644 index 830567ef07a21..0000000000000 --- a/sky/engine/platform/animation/KeyframeValueList.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_ANIMATION_KEYFRAMEVALUELIST_H_ -#define SKY_ENGINE_PLATFORM_ANIMATION_KEYFRAMEVALUELIST_H_ - -#include "flutter/sky/engine/platform/animation/AnimationValue.h" - -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -enum AnimatedPropertyID { - AnimatedPropertyInvalid, - AnimatedPropertyTransform, - AnimatedPropertyOpacity, - AnimatedPropertyBackgroundColor, - AnimatedPropertyFilter -}; - -// Used to store a series of values in a keyframe list. -// Values will all be of the same type, which can be inferred from the property. -class PLATFORM_EXPORT KeyframeValueList { - public: - explicit KeyframeValueList(AnimatedPropertyID property) - : m_property(property) {} - - KeyframeValueList(const KeyframeValueList& other) - : m_property(other.property()) { - for (size_t i = 0; i < other.m_values.size(); ++i) - m_values.append(other.m_values[i]->clone()); - } - - KeyframeValueList& operator=(const KeyframeValueList& other) { - KeyframeValueList copy(other); - swap(copy); - return *this; - } - - void swap(KeyframeValueList& other) { - std::swap(m_property, other.m_property); - m_values.swap(other.m_values); - } - - AnimatedPropertyID property() const { return m_property; } - - size_t size() const { return m_values.size(); } - const AnimationValue* at(size_t i) const { return m_values.at(i).get(); } - - // Insert, sorted by keyTime. - void insert(PassOwnPtr); - - protected: - Vector> m_values; - AnimatedPropertyID m_property; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_ANIMATION_KEYFRAMEVALUELIST_H_ diff --git a/sky/engine/platform/animation/TimingFunction.cpp b/sky/engine/platform/animation/TimingFunction.cpp deleted file mode 100644 index dad8e400eb167..0000000000000 --- a/sky/engine/platform/animation/TimingFunction.cpp +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/platform/animation/TimingFunction.h" - -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -String LinearTimingFunction::toString() const { - return "linear"; -} - -double LinearTimingFunction::evaluate(double fraction, double) const { - return fraction; -} - -void LinearTimingFunction::range(double* minValue, double* maxValue) const {} - -String CubicBezierTimingFunction::toString() const { - switch (this->subType()) { - case CubicBezierTimingFunction::Ease: - return "ease"; - case CubicBezierTimingFunction::EaseIn: - return "ease-in"; - case CubicBezierTimingFunction::EaseOut: - return "ease-out"; - case CubicBezierTimingFunction::EaseInOut: - return "ease-in-out"; - case CubicBezierTimingFunction::Custom: - return "cubic-bezier(" + String::numberToStringECMAScript(this->x1()) + - ", " + String::numberToStringECMAScript(this->y1()) + ", " + - String::numberToStringECMAScript(this->x2()) + ", " + - String::numberToStringECMAScript(this->y2()) + ")"; - default: - ASSERT_NOT_REACHED(); - } - return ""; -} - -double CubicBezierTimingFunction::evaluate(double fraction, - double accuracy) const { - if (!m_bezier) - m_bezier = adoptPtr(new UnitBezier(m_x1, m_y1, m_x2, m_y2)); - return m_bezier->solve(fraction, accuracy); -} - -// This works by taking taking the derivative of the cubic bezier, on the y -// axis. We can then solve for where the derivative is zero to find the min -// and max distace along the line. We the have to solve those in terms of time -// rather than distance on the x-axis -void CubicBezierTimingFunction::range(double* minValue, - double* maxValue) const { - if (0 <= m_y1 && m_y2 < 1 && 0 <= m_y2 && m_y2 <= 1) { - return; - } - - double a = 3.0 * (m_y1 - m_y2) + 1.0; - double b = 2.0 * (m_y2 - 2.0 * m_y1); - double c = m_y1; - - if (std::abs(a) < std::numeric_limits::epsilon() && - std::abs(b) < std::numeric_limits::epsilon()) { - return; - } - - double t1 = 0.0; - double t2 = 0.0; - - if (std::abs(a) < std::numeric_limits::epsilon()) { - t1 = -c / b; - } else { - double discriminant = b * b - 4 * a * c; - if (discriminant < 0) - return; - double discriminantSqrt = sqrt(discriminant); - t1 = (-b + discriminantSqrt) / (2 * a); - t2 = (-b - discriminantSqrt) / (2 * a); - } - - double solution1 = 0.0; - double solution2 = 0.0; - - // If the solution is in the range [0,1] then we include it, otherwise we - // ignore it. - if (!m_bezier) - m_bezier = adoptPtr(new UnitBezier(m_x1, m_y1, m_x2, m_y2)); - - // An interesting fact about these beziers is that they are only - // actually evaluated in [0,1]. After that we take the tangent at that point - // and linearly project it out. - if (0 < t1 && t1 < 1) - solution1 = m_bezier->sampleCurveY(t1); - - if (0 < t2 && t2 < 1) - solution2 = m_bezier->sampleCurveY(t2); - - // Since our input values can be out of the range 0->1 so we must also - // consider the minimum and maximum points. - double solutionMin = - m_bezier->solve(*minValue, std::numeric_limits::epsilon()); - double solutionMax = - m_bezier->solve(*maxValue, std::numeric_limits::epsilon()); - *minValue = std::min(std::min(solutionMin, solutionMax), 0.0); - *maxValue = std::max(std::max(solutionMin, solutionMax), 1.0); - *minValue = std::min(std::min(*minValue, solution1), solution2); - *maxValue = std::max(std::max(*maxValue, solution1), solution2); -} - -String StepsTimingFunction::toString() const { - StringBuilder builder; - switch (this->subType()) { - case StepsTimingFunction::Start: - return "step-start"; - case StepsTimingFunction::Middle: - return "step-middle"; - case StepsTimingFunction::End: - return "step-end"; - case StepsTimingFunction::Custom: - builder.append("steps(" + - String::numberToStringECMAScript(this->numberOfSteps()) + - ", "); - - if (this->stepAtPosition() == StepsTimingFunction::StepAtStart) - builder.appendLiteral("start"); - else if (this->stepAtPosition() == StepsTimingFunction::StepAtMiddle) - builder.appendLiteral("middle"); - else if (this->stepAtPosition() == StepsTimingFunction::StepAtEnd) - builder.appendLiteral("end"); - else - ASSERT_NOT_REACHED(); - - builder.append(')'); - break; - default: - ASSERT_NOT_REACHED(); - } - return builder.toString(); -} - -void StepsTimingFunction::range(double* minValue, double* maxValue) const { - *minValue = 0; - *maxValue = 1; -} - -double StepsTimingFunction::evaluate(double fraction, double) const { - double startOffset = 0; - switch (m_stepAtPosition) { - case StepAtStart: - startOffset = 1; - break; - case StepAtMiddle: - startOffset = 0.5; - break; - case StepAtEnd: - startOffset = 0; - break; - default: - ASSERT_NOT_REACHED(); - break; - } - return clampTo(floor((m_steps * fraction) + startOffset) / m_steps, 0.0, 1.0); -} - -// Equals operators -bool operator==(const LinearTimingFunction& lhs, const TimingFunction& rhs) { - return rhs.type() == TimingFunction::LinearFunction; -} - -bool operator==(const CubicBezierTimingFunction& lhs, - const TimingFunction& rhs) { - if (rhs.type() != TimingFunction::CubicBezierFunction) - return false; - - const CubicBezierTimingFunction& ctf = toCubicBezierTimingFunction(rhs); - if ((lhs.subType() == CubicBezierTimingFunction::Custom) && - (ctf.subType() == CubicBezierTimingFunction::Custom)) - return (lhs.x1() == ctf.x1()) && (lhs.y1() == ctf.y1()) && - (lhs.x2() == ctf.x2()) && (lhs.y2() == ctf.y2()); - - return lhs.subType() == ctf.subType(); -} - -bool operator==(const StepsTimingFunction& lhs, const TimingFunction& rhs) { - if (rhs.type() != TimingFunction::StepsFunction) - return false; - - const StepsTimingFunction& stf = toStepsTimingFunction(rhs); - if ((lhs.subType() == StepsTimingFunction::Custom) && - (stf.subType() == StepsTimingFunction::Custom)) - return (lhs.numberOfSteps() == stf.numberOfSteps()) && - (lhs.stepAtPosition() == stf.stepAtPosition()); - - return lhs.subType() == stf.subType(); -} - -// The generic operator== *must* come after the -// non-generic operator== otherwise it will end up calling itself. -bool operator==(const TimingFunction& lhs, const TimingFunction& rhs) { - switch (lhs.type()) { - case TimingFunction::LinearFunction: { - const LinearTimingFunction& linear = toLinearTimingFunction(lhs); - return (linear == rhs); - } - case TimingFunction::CubicBezierFunction: { - const CubicBezierTimingFunction& cubic = toCubicBezierTimingFunction(lhs); - return (cubic == rhs); - } - case TimingFunction::StepsFunction: { - const StepsTimingFunction& step = toStepsTimingFunction(lhs); - return (step == rhs); - } - default: - ASSERT_NOT_REACHED(); - } - return false; -} - -// No need to define specific operator!= as they can all come via this function. -bool operator!=(const TimingFunction& lhs, const TimingFunction& rhs) { - return !(lhs == rhs); -} - -} // namespace blink diff --git a/sky/engine/platform/animation/TimingFunction.h b/sky/engine/platform/animation/TimingFunction.h deleted file mode 100644 index d3c635a4d0689..0000000000000 --- a/sky/engine/platform/animation/TimingFunction.h +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_ANIMATION_TIMINGFUNCTION_H_ -#define SKY_ENGINE_PLATFORM_ANIMATION_TIMINGFUNCTION_H_ - -#include -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" -#include "flutter/sky/engine/platform/animation/UnitBezier.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -class PLATFORM_EXPORT TimingFunction : public RefCounted { - public: - enum Type { LinearFunction, CubicBezierFunction, StepsFunction }; - - virtual ~TimingFunction() {} - - Type type() const { return m_type; } - - virtual String toString() const = 0; - - // Evaluates the timing function at the given fraction. The accuracy parameter - // provides a hint as to the required accuracy and is not guaranteed. - virtual double evaluate(double fraction, double accuracy) const = 0; - - // This function returns the minimum and maximum values obtainable when - // calling evaluate(); - virtual void range(double* minValue, double* maxValue) const = 0; - - protected: - TimingFunction(Type type) : m_type(type) {} - - private: - Type m_type; -}; - -class PLATFORM_EXPORT LinearTimingFunction final : public TimingFunction { - public: - static LinearTimingFunction* shared() { - DEFINE_STATIC_REF(LinearTimingFunction, linear, - (adoptRef(new LinearTimingFunction()))); - return linear; - } - - virtual ~LinearTimingFunction() {} - - virtual String toString() const override; - - virtual double evaluate(double fraction, double) const override; - - virtual void range(double* minValue, double* maxValue) const override; - - private: - LinearTimingFunction() : TimingFunction(LinearFunction) {} -}; - -class PLATFORM_EXPORT CubicBezierTimingFunction final : public TimingFunction { - public: - enum SubType { Ease, EaseIn, EaseOut, EaseInOut, Custom }; - - static PassRefPtr create(double x1, - double y1, - double x2, - double y2) { - return adoptRef(new CubicBezierTimingFunction(Custom, x1, y1, x2, y2)); - } - - static CubicBezierTimingFunction* preset(SubType subType) { - switch (subType) { - case Ease: { - DEFINE_STATIC_REF(CubicBezierTimingFunction, ease, - (adoptRef(new CubicBezierTimingFunction( - Ease, 0.25, 0.1, 0.25, 1.0)))); - return ease; - } - case EaseIn: { - DEFINE_STATIC_REF(CubicBezierTimingFunction, easeIn, - (adoptRef(new CubicBezierTimingFunction( - EaseIn, 0.42, 0.0, 1.0, 1.0)))); - return easeIn; - } - case EaseOut: { - DEFINE_STATIC_REF(CubicBezierTimingFunction, easeOut, - (adoptRef(new CubicBezierTimingFunction( - EaseOut, 0.0, 0.0, 0.58, 1.0)))); - return easeOut; - } - case EaseInOut: { - DEFINE_STATIC_REF(CubicBezierTimingFunction, easeInOut, - (adoptRef(new CubicBezierTimingFunction( - EaseInOut, 0.42, 0.0, 0.58, 1.0)))); - return easeInOut; - } - default: - ASSERT_NOT_REACHED(); - return 0; - } - } - - virtual ~CubicBezierTimingFunction() {} - - virtual String toString() const override; - - virtual double evaluate(double fraction, double accuracy) const override; - virtual void range(double* minValue, double* maxValue) const override; - - double x1() const { return m_x1; } - double y1() const { return m_y1; } - double x2() const { return m_x2; } - double y2() const { return m_y2; } - - SubType subType() const { return m_subType; } - - private: - explicit CubicBezierTimingFunction(SubType subType, - double x1, - double y1, - double x2, - double y2) - : TimingFunction(CubicBezierFunction), - m_x1(x1), - m_y1(y1), - m_x2(x2), - m_y2(y2), - m_subType(subType) {} - - double m_x1; - double m_y1; - double m_x2; - double m_y2; - SubType m_subType; - mutable OwnPtr m_bezier; -}; - -class PLATFORM_EXPORT StepsTimingFunction final : public TimingFunction { - public: - enum SubType { Start, End, Middle, Custom }; - - enum StepAtPosition { StepAtStart, StepAtMiddle, StepAtEnd }; - - static PassRefPtr create(int steps, - StepAtPosition stepAtPosition) { - return adoptRef(new StepsTimingFunction(Custom, steps, stepAtPosition)); - } - - static StepsTimingFunction* preset(SubType subType) { - switch (subType) { - case Start: { - DEFINE_STATIC_REF( - StepsTimingFunction, start, - (adoptRef(new StepsTimingFunction(Start, 1, StepAtStart)))); - return start; - } - case Middle: { - DEFINE_STATIC_REF( - StepsTimingFunction, middle, - (adoptRef(new StepsTimingFunction(Middle, 1, StepAtMiddle)))); - return middle; - } - case End: { - DEFINE_STATIC_REF( - StepsTimingFunction, end, - (adoptRef(new StepsTimingFunction(End, 1, StepAtEnd)))); - return end; - } - default: - ASSERT_NOT_REACHED(); - return 0; - } - } - - virtual ~StepsTimingFunction() {} - - virtual String toString() const override; - - virtual double evaluate(double fraction, double) const override; - - virtual void range(double* minValue, double* maxValue) const override; - int numberOfSteps() const { return m_steps; } - StepAtPosition stepAtPosition() const { return m_stepAtPosition; } - - SubType subType() const { return m_subType; } - - private: - StepsTimingFunction(SubType subType, int steps, StepAtPosition stepAtPosition) - : TimingFunction(StepsFunction), - m_steps(steps), - m_stepAtPosition(stepAtPosition), - m_subType(subType) {} - - int m_steps; - StepAtPosition m_stepAtPosition; - SubType m_subType; -}; - -PLATFORM_EXPORT bool operator==(const LinearTimingFunction&, - const TimingFunction&); -PLATFORM_EXPORT bool operator==(const CubicBezierTimingFunction&, - const TimingFunction&); -PLATFORM_EXPORT bool operator==(const StepsTimingFunction&, - const TimingFunction&); - -PLATFORM_EXPORT bool operator==(const TimingFunction&, const TimingFunction&); -PLATFORM_EXPORT bool operator!=(const TimingFunction&, const TimingFunction&); - -#define DEFINE_TIMING_FUNCTION_TYPE_CASTS(typeName) \ - DEFINE_TYPE_CASTS(typeName##TimingFunction, TimingFunction, value, \ - value->type() == TimingFunction::typeName##Function, \ - value.type() == TimingFunction::typeName##Function) - -DEFINE_TIMING_FUNCTION_TYPE_CASTS(Linear); -DEFINE_TIMING_FUNCTION_TYPE_CASTS(CubicBezier); -DEFINE_TIMING_FUNCTION_TYPE_CASTS(Steps); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_ANIMATION_TIMINGFUNCTION_H_ diff --git a/sky/engine/platform/animation/TimingFunctionTest.cpp b/sky/engine/platform/animation/TimingFunctionTest.cpp deleted file mode 100644 index dea32efa0644a..0000000000000 --- a/sky/engine/platform/animation/TimingFunctionTest.cpp +++ /dev/null @@ -1,461 +0,0 @@ -/* - * Copyright (c) 2013, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/animation/TimingFunction.h" - -#include -#include -#include -#include -#include "flutter/sky/engine/wtf/text/WTFString.h" - -// Macro is only used to allow the use of streams. -// Can be removed if a pretty failure message isn't needed. -#define EXPECT_NE_WITH_MESSAGE(a, b) \ - EXPECT_NE(*a.second, *b.second) \ - << a.first << " (" << a.second->toString().latin1().data() << ")" \ - << " == " << b.first << " (" << b.second->toString().latin1().data() \ - << ")" \ - << "\n"; - -namespace blink { - -namespace { - -class TimingFunctionTest : public ::testing::Test { - public: - void notEqualHelperLoop( - Vector>>& v) { - for (size_t i = 0; i < v.size(); ++i) { - for (size_t j = 0; j < v.size(); ++j) { - if (i == j) - continue; - EXPECT_NE_WITH_MESSAGE(v[i], v[j]); - } - } - } -}; - -TEST_F(TimingFunctionTest, LinearToString) { - RefPtr linearTiming = LinearTimingFunction::shared(); - EXPECT_EQ(linearTiming->toString(), "linear"); -} - -TEST_F(TimingFunctionTest, CubicToString) { - RefPtr cubicEaseTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease); - EXPECT_EQ("ease", cubicEaseTiming->toString()); - RefPtr cubicEaseInTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn); - EXPECT_EQ("ease-in", cubicEaseInTiming->toString()); - RefPtr cubicEaseOutTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut); - EXPECT_EQ("ease-out", cubicEaseOutTiming->toString()); - RefPtr cubicEaseInOutTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut); - EXPECT_EQ("ease-in-out", cubicEaseInOutTiming->toString()); - - RefPtr cubicCustomTiming = - CubicBezierTimingFunction::create(0.17, 0.67, 1, -1.73); - EXPECT_EQ("cubic-bezier(0.17, 0.67, 1, -1.73)", - cubicCustomTiming->toString()); -} - -TEST_F(TimingFunctionTest, StepToString) { - RefPtr stepTimingStart = - StepsTimingFunction::preset(StepsTimingFunction::Start); - EXPECT_EQ("step-start", stepTimingStart->toString()); - - RefPtr stepTimingMiddle = - StepsTimingFunction::preset(StepsTimingFunction::Middle); - EXPECT_EQ("step-middle", stepTimingMiddle->toString()); - - RefPtr stepTimingEnd = - StepsTimingFunction::preset(StepsTimingFunction::End); - EXPECT_EQ("step-end", stepTimingEnd->toString()); - - RefPtr stepTimingCustomStart = - StepsTimingFunction::create(3, StepsTimingFunction::StepAtStart); - EXPECT_EQ("steps(3, start)", stepTimingCustomStart->toString()); - - RefPtr stepTimingCustomMiddle = - StepsTimingFunction::create(4, StepsTimingFunction::StepAtMiddle); - EXPECT_EQ("steps(4, middle)", stepTimingCustomMiddle->toString()); - - RefPtr stepTimingCustomEnd = - StepsTimingFunction::create(5, StepsTimingFunction::StepAtEnd); - EXPECT_EQ("steps(5, end)", stepTimingCustomEnd->toString()); -} - -TEST_F(TimingFunctionTest, BaseOperatorEq) { - RefPtr linearTiming = LinearTimingFunction::shared(); - RefPtr cubicTiming1 = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn); - RefPtr cubicTiming2 = - CubicBezierTimingFunction::create(0.17, 0.67, 1, -1.73); - RefPtr stepsTiming1 = - StepsTimingFunction::preset(StepsTimingFunction::End); - RefPtr stepsTiming2 = - StepsTimingFunction::create(5, StepsTimingFunction::StepAtStart); - - Vector>> v; - v.append(std::make_pair("linearTiming", linearTiming)); - v.append(std::make_pair("cubicTiming1", cubicTiming1)); - v.append(std::make_pair("cubicTiming2", cubicTiming2)); - v.append(std::make_pair("stepsTiming1", stepsTiming1)); - v.append(std::make_pair("stepsTiming2", stepsTiming2)); - notEqualHelperLoop(v); -} - -TEST_F(TimingFunctionTest, LinearOperatorEq) { - RefPtr linearTiming1 = LinearTimingFunction::shared(); - RefPtr linearTiming2 = LinearTimingFunction::shared(); - EXPECT_EQ(*linearTiming1, *linearTiming1); - EXPECT_EQ(*linearTiming1, *linearTiming2); -} - -TEST_F(TimingFunctionTest, CubicOperatorEq) { - RefPtr cubicEaseInTiming1 = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn); - RefPtr cubicEaseInTiming2 = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn); - EXPECT_EQ(*cubicEaseInTiming1, *cubicEaseInTiming1); - EXPECT_EQ(*cubicEaseInTiming1, *cubicEaseInTiming2); - - RefPtr cubicEaseOutTiming1 = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut); - RefPtr cubicEaseOutTiming2 = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut); - EXPECT_EQ(*cubicEaseOutTiming1, *cubicEaseOutTiming1); - EXPECT_EQ(*cubicEaseOutTiming1, *cubicEaseOutTiming2); - - RefPtr cubicEaseInOutTiming1 = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut); - RefPtr cubicEaseInOutTiming2 = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut); - EXPECT_EQ(*cubicEaseInOutTiming1, *cubicEaseInOutTiming1); - EXPECT_EQ(*cubicEaseInOutTiming1, *cubicEaseInOutTiming2); - - RefPtr cubicCustomTiming1 = - CubicBezierTimingFunction::create(0.17, 0.67, 1, -1.73); - RefPtr cubicCustomTiming2 = - CubicBezierTimingFunction::create(0.17, 0.67, 1, -1.73); - EXPECT_EQ(*cubicCustomTiming1, *cubicCustomTiming1); - EXPECT_EQ(*cubicCustomTiming1, *cubicCustomTiming2); - - Vector>> v; - v.append(std::make_pair("cubicEaseInTiming1", cubicEaseInTiming1)); - v.append(std::make_pair("cubicEaseOutTiming1", cubicEaseOutTiming1)); - v.append(std::make_pair("cubicEaseInOutTiming1", cubicEaseInOutTiming1)); - v.append(std::make_pair("cubicCustomTiming1", cubicCustomTiming1)); - notEqualHelperLoop(v); -} - -TEST_F(TimingFunctionTest, CubicOperatorEqReflectivity) { - RefPtr cubicA = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn); - RefPtr cubicB = - CubicBezierTimingFunction::create(0.42, 0.0, 1.0, 1.0); - EXPECT_NE(*cubicA, *cubicB); - EXPECT_NE(*cubicB, *cubicA); -} - -TEST_F(TimingFunctionTest, StepsOperatorEq) { - RefPtr stepsTimingStart1 = - StepsTimingFunction::preset(StepsTimingFunction::Start); - RefPtr stepsTimingStart2 = - StepsTimingFunction::preset(StepsTimingFunction::Start); - EXPECT_EQ(*stepsTimingStart1, *stepsTimingStart1); - EXPECT_EQ(*stepsTimingStart1, *stepsTimingStart2); - - RefPtr stepsTimingEnd1 = - StepsTimingFunction::preset(StepsTimingFunction::End); - RefPtr stepsTimingEnd2 = - StepsTimingFunction::preset(StepsTimingFunction::End); - EXPECT_EQ(*stepsTimingEnd1, *stepsTimingEnd1); - EXPECT_EQ(*stepsTimingEnd1, *stepsTimingEnd2); - - RefPtr stepsTimingCustom1 = - StepsTimingFunction::create(5, StepsTimingFunction::StepAtStart); - RefPtr stepsTimingCustom2 = - StepsTimingFunction::create(5, StepsTimingFunction::StepAtEnd); - RefPtr stepsTimingCustom3 = - StepsTimingFunction::create(7, StepsTimingFunction::StepAtStart); - RefPtr stepsTimingCustom4 = - StepsTimingFunction::create(7, StepsTimingFunction::StepAtEnd); - - EXPECT_EQ(*StepsTimingFunction::create(5, StepsTimingFunction::StepAtStart), - *stepsTimingCustom1); - EXPECT_EQ(*StepsTimingFunction::create(5, StepsTimingFunction::StepAtEnd), - *stepsTimingCustom2); - EXPECT_EQ(*StepsTimingFunction::create(7, StepsTimingFunction::StepAtStart), - *stepsTimingCustom3); - EXPECT_EQ(*StepsTimingFunction::create(7, StepsTimingFunction::StepAtEnd), - *stepsTimingCustom4); - - Vector>> v; - v.append(std::make_pair("stepsTimingStart1", stepsTimingStart1)); - v.append(std::make_pair("stepsTimingEnd1", stepsTimingEnd1)); - v.append(std::make_pair("stepsTimingCustom1", stepsTimingCustom1)); - v.append(std::make_pair("stepsTimingCustom2", stepsTimingCustom2)); - v.append(std::make_pair("stepsTimingCustom3", stepsTimingCustom3)); - v.append(std::make_pair("stepsTimingCustom4", stepsTimingCustom4)); - notEqualHelperLoop(v); -} - -TEST_F(TimingFunctionTest, StepsOperatorEqReflectivity) { - RefPtr stepsA = - StepsTimingFunction::preset(StepsTimingFunction::Start); - RefPtr stepsB = - StepsTimingFunction::create(1, StepsTimingFunction::StepAtStart); - EXPECT_NE(*stepsA, *stepsB); - EXPECT_NE(*stepsB, *stepsA); -} - -TEST_F(TimingFunctionTest, LinearEvaluate) { - RefPtr linearTiming = LinearTimingFunction::shared(); - EXPECT_EQ(0.2, linearTiming->evaluate(0.2, 0)); - EXPECT_EQ(0.6, linearTiming->evaluate(0.6, 0)); - EXPECT_EQ(-0.2, linearTiming->evaluate(-0.2, 0)); - EXPECT_EQ(1.6, linearTiming->evaluate(1.6, 0)); -} - -TEST_F(TimingFunctionTest, LinearRange) { - double start = 0; - double end = 1; - RefPtr linearTiming = LinearTimingFunction::shared(); - linearTiming->range(&start, &end); - EXPECT_NEAR(0, start, 0.01); - EXPECT_NEAR(1, end, 0.01); - start = -1; - end = 10; - linearTiming->range(&start, &end); - EXPECT_NEAR(-1, start, 0.01); - EXPECT_NEAR(10, end, 0.01); -} - -TEST_F(TimingFunctionTest, StepRange) { - double start = 0; - double end = 1; - RefPtr steps = - StepsTimingFunction::preset(StepsTimingFunction::Start); - steps->range(&start, &end); - EXPECT_NEAR(0, start, 0.01); - EXPECT_NEAR(1, end, 0.01); - - start = -1; - end = 10; - steps->range(&start, &end); - EXPECT_NEAR(0, start, 0.01); - EXPECT_NEAR(1, end, 0.01); -} - -TEST_F(TimingFunctionTest, CubicRange) { - double start = 0; - double end = 1; - - RefPtr cubicEaseTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease); - start = 0; - end = 1; - cubicEaseTiming->range(&start, &end); - EXPECT_NEAR(0, start, 0.01); - EXPECT_NEAR(1, end, 0.01); - start = -1; - end = 10; - cubicEaseTiming->range(&start, &end); - EXPECT_NEAR(-0.4, start, 0.01); - EXPECT_NEAR(1, end, 0.01); - - RefPtr cubicEaseInTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn); - start = 0; - end = 1; - cubicEaseInTiming->range(&start, &end); - EXPECT_NEAR(0, start, 0.01); - EXPECT_NEAR(1, end, 0.01); - start = -1; - end = 10; - cubicEaseInTiming->range(&start, &end); - EXPECT_NEAR(0.0, start, 0.01); - EXPECT_NEAR(16.51, end, 0.01); - - RefPtr cubicEaseOutTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut); - start = 0; - end = 1; - cubicEaseOutTiming->range(&start, &end); - EXPECT_NEAR(0, start, 0.01); - EXPECT_NEAR(1, end, 0.01); - start = -1; - end = 10; - cubicEaseOutTiming->range(&start, &end); - EXPECT_NEAR(-1.72, start, 0.01); - EXPECT_NEAR(1.0, end, 0.01); - - RefPtr cubicEaseInOutTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut); - start = 0; - end = 1; - cubicEaseInOutTiming->range(&start, &end); - EXPECT_NEAR(0, start, 0.01); - EXPECT_NEAR(1, end, 0.01); - start = -1; - end = 10; - cubicEaseInOutTiming->range(&start, &end); - EXPECT_NEAR(0.0, start, 0.01); - EXPECT_NEAR(1.0, end, 0.01); - - RefPtr cubicCustomTiming = - CubicBezierTimingFunction::create(0.17, 0.67, 1.0, -1.73); - start = 0; - end = 1; - cubicCustomTiming->range(&start, &end); - EXPECT_NEAR(-0.33, start, 0.01); - EXPECT_NEAR(1.0, end, 0.01); - - start = -1; - end = 10; - cubicCustomTiming->range(&start, &end); - EXPECT_NEAR(-3.94, start, 0.01); - EXPECT_NEAR(4.578, end, 0.01); -} - -TEST_F(TimingFunctionTest, CubicEvaluate) { - double tolerance = 0.01; - RefPtr cubicEaseTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease); - EXPECT_NEAR(0.418, cubicEaseTiming->evaluate(0.25, tolerance), tolerance); - EXPECT_NEAR(0.805, cubicEaseTiming->evaluate(0.50, tolerance), tolerance); - EXPECT_NEAR(0.960, cubicEaseTiming->evaluate(0.75, tolerance), tolerance); - - RefPtr cubicEaseInTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseIn); - EXPECT_NEAR(0.093, cubicEaseInTiming->evaluate(0.25, tolerance), tolerance); - EXPECT_NEAR(0.305, cubicEaseInTiming->evaluate(0.50, tolerance), tolerance); - EXPECT_NEAR(0.620, cubicEaseInTiming->evaluate(0.75, tolerance), tolerance); - - RefPtr cubicEaseOutTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseOut); - EXPECT_NEAR(0.379, cubicEaseOutTiming->evaluate(0.25, tolerance), tolerance); - EXPECT_NEAR(0.694, cubicEaseOutTiming->evaluate(0.50, tolerance), tolerance); - EXPECT_NEAR(0.906, cubicEaseOutTiming->evaluate(0.75, tolerance), tolerance); - - RefPtr cubicEaseInOutTiming = - CubicBezierTimingFunction::preset(CubicBezierTimingFunction::EaseInOut); - EXPECT_NEAR(0.128, cubicEaseInOutTiming->evaluate(0.25, tolerance), - tolerance); - EXPECT_NEAR(0.500, cubicEaseInOutTiming->evaluate(0.50, tolerance), - tolerance); - EXPECT_NEAR(0.871, cubicEaseInOutTiming->evaluate(0.75, tolerance), - tolerance); - - RefPtr cubicCustomTiming = - CubicBezierTimingFunction::create(0.17, 0.67, 1, -1.73); - EXPECT_NEAR(0.034, cubicCustomTiming->evaluate(0.25, tolerance), tolerance); - EXPECT_NEAR(-0.217, cubicCustomTiming->evaluate(0.50, tolerance), tolerance); - EXPECT_NEAR(-0.335, cubicCustomTiming->evaluate(0.75, tolerance), tolerance); -} - -TEST_F(TimingFunctionTest, StepsEvaluate) { - RefPtr stepsTimingStart = - StepsTimingFunction::preset(StepsTimingFunction::Start); - EXPECT_EQ(0.00, stepsTimingStart->evaluate(-1.10, 0)); - EXPECT_EQ(0.00, stepsTimingStart->evaluate(-0.10, 0)); - EXPECT_EQ(1.00, stepsTimingStart->evaluate(0.00, 0)); - EXPECT_EQ(1.00, stepsTimingStart->evaluate(0.20, 0)); - EXPECT_EQ(1.00, stepsTimingStart->evaluate(0.60, 0)); - EXPECT_EQ(1.00, stepsTimingStart->evaluate(1.00, 0)); - EXPECT_EQ(1.00, stepsTimingStart->evaluate(2.00, 0)); - - RefPtr stepsTimingMiddle = - StepsTimingFunction::preset(StepsTimingFunction::Middle); - EXPECT_EQ(0.00, stepsTimingMiddle->evaluate(-2.50, 0)); - EXPECT_EQ(0.00, stepsTimingMiddle->evaluate(0.00, 0)); - EXPECT_EQ(0.00, stepsTimingMiddle->evaluate(0.49, 0)); - EXPECT_EQ(1.00, stepsTimingMiddle->evaluate(0.50, 0)); - EXPECT_EQ(1.00, stepsTimingMiddle->evaluate(1.00, 0)); - EXPECT_EQ(1.00, stepsTimingMiddle->evaluate(2.50, 0)); - - RefPtr stepsTimingEnd = - StepsTimingFunction::preset(StepsTimingFunction::End); - EXPECT_EQ(0.00, stepsTimingEnd->evaluate(-2.00, 0)); - EXPECT_EQ(0.00, stepsTimingEnd->evaluate(0.00, 0)); - EXPECT_EQ(0.00, stepsTimingEnd->evaluate(0.20, 0)); - EXPECT_EQ(0.00, stepsTimingEnd->evaluate(0.60, 0)); - EXPECT_EQ(1.00, stepsTimingEnd->evaluate(1.00, 0)); - EXPECT_EQ(1.00, stepsTimingEnd->evaluate(2.00, 0)); - - RefPtr stepsTimingCustomStart = - StepsTimingFunction::create(4, StepsTimingFunction::StepAtStart); - EXPECT_EQ(0.00, stepsTimingCustomStart->evaluate(-0.50, 0)); - EXPECT_EQ(0.25, stepsTimingCustomStart->evaluate(0.00, 0)); - EXPECT_EQ(0.25, stepsTimingCustomStart->evaluate(0.24, 0)); - EXPECT_EQ(0.50, stepsTimingCustomStart->evaluate(0.25, 0)); - EXPECT_EQ(0.50, stepsTimingCustomStart->evaluate(0.49, 0)); - EXPECT_EQ(0.75, stepsTimingCustomStart->evaluate(0.50, 0)); - EXPECT_EQ(0.75, stepsTimingCustomStart->evaluate(0.74, 0)); - EXPECT_EQ(1.00, stepsTimingCustomStart->evaluate(0.75, 0)); - EXPECT_EQ(1.00, stepsTimingCustomStart->evaluate(1.00, 0)); - EXPECT_EQ(1.00, stepsTimingCustomStart->evaluate(1.50, 0)); - - RefPtr stepsTimingCustomMiddle = - StepsTimingFunction::create(4, StepsTimingFunction::StepAtMiddle); - EXPECT_EQ(0.00, stepsTimingCustomMiddle->evaluate(-2.00, 0)); - EXPECT_EQ(0.00, stepsTimingCustomMiddle->evaluate(0.00, 0)); - EXPECT_EQ(0.00, stepsTimingCustomMiddle->evaluate(0.12, 0)); - EXPECT_EQ(0.25, stepsTimingCustomMiddle->evaluate(0.13, 0)); - EXPECT_EQ(0.25, stepsTimingCustomMiddle->evaluate(0.37, 0)); - EXPECT_EQ(0.50, stepsTimingCustomMiddle->evaluate(0.38, 0)); - EXPECT_EQ(0.50, stepsTimingCustomMiddle->evaluate(0.62, 0)); - EXPECT_EQ(0.75, stepsTimingCustomMiddle->evaluate(0.63, 0)); - EXPECT_EQ(0.75, stepsTimingCustomMiddle->evaluate(0.87, 0)); - EXPECT_EQ(1.00, stepsTimingCustomMiddle->evaluate(0.88, 0)); - EXPECT_EQ(1.00, stepsTimingCustomMiddle->evaluate(1.00, 0)); - EXPECT_EQ(1.00, stepsTimingCustomMiddle->evaluate(3.00, 0)); - - RefPtr stepsTimingCustomEnd = - StepsTimingFunction::create(4, StepsTimingFunction::StepAtEnd); - EXPECT_EQ(0.00, stepsTimingCustomEnd->evaluate(-2.00, 0)); - EXPECT_EQ(0.00, stepsTimingCustomEnd->evaluate(0.00, 0)); - EXPECT_EQ(0.00, stepsTimingCustomEnd->evaluate(0.24, 0)); - EXPECT_EQ(0.25, stepsTimingCustomEnd->evaluate(0.25, 0)); - EXPECT_EQ(0.25, stepsTimingCustomEnd->evaluate(0.49, 0)); - EXPECT_EQ(0.50, stepsTimingCustomEnd->evaluate(0.50, 0)); - EXPECT_EQ(0.50, stepsTimingCustomEnd->evaluate(0.74, 0)); - EXPECT_EQ(0.75, stepsTimingCustomEnd->evaluate(0.75, 0)); - EXPECT_EQ(0.75, stepsTimingCustomEnd->evaluate(0.99, 0)); - EXPECT_EQ(1.00, stepsTimingCustomEnd->evaluate(1.00, 0)); - EXPECT_EQ(1.00, stepsTimingCustomEnd->evaluate(2.00, 0)); -} - -} // namespace - -} // namespace blink diff --git a/sky/engine/platform/animation/UnitBezier.h b/sky/engine/platform/animation/UnitBezier.h deleted file mode 100644 index ceb122158a45d..0000000000000 --- a/sky/engine/platform/animation/UnitBezier.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_ANIMATION_UNITBEZIER_H_ -#define SKY_ENGINE_PLATFORM_ANIMATION_UNITBEZIER_H_ - -#include -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Assertions.h" - -namespace blink { - -struct UnitBezier { - UnitBezier(double p1x, double p1y, double p2x, double p2y) { - // Calculate the polynomial coefficients, implicit first and last control - // points are (0,0) and (1,1). - cx = 3.0 * p1x; - bx = 3.0 * (p2x - p1x) - cx; - ax = 1.0 - cx - bx; - - cy = 3.0 * p1y; - by = 3.0 * (p2y - p1y) - cy; - ay = 1.0 - cy - by; - - // End-point gradients are used to calculate timing function results - // outside the range [0, 1]. - // - // There are three possibilities for the gradient at each end: - // (1) the closest control point is not horizontally coincident with regard - // to - // (0, 0) or (1, 1). In this case the line between the end point and - // the control point is tangent to the bezier at the end point. - // (2) the closest control point is coincident with the end point. In - // this case the line between the end point and the far control - // point is tangent to the bezier at the end point. - // (3) the closest control point is horizontally coincident with the end - // point, but vertically distinct. In this case the gradient at the - // end point is Infinite. However, this causes issues when - // interpolating. As a result, we break down to a simple case of - // 0 gradient under these conditions. - - if (p1x > 0) - m_startGradient = p1y / p1x; - else if (!p1y && p2x > 0) - m_startGradient = p2y / p2x; - else - m_startGradient = 0; - - if (p2x < 1) - m_endGradient = (p2y - 1) / (p2x - 1); - else if (p2x == 1 && p1x < 1) - m_endGradient = (p1y - 1) / (p1x - 1); - else - m_endGradient = 0; - } - - double sampleCurveX(double t) { - // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule. - return ((ax * t + bx) * t + cx) * t; - } - - double sampleCurveY(double t) { return ((ay * t + by) * t + cy) * t; } - - double sampleCurveDerivativeX(double t) { - return (3.0 * ax * t + 2.0 * bx) * t + cx; - } - - // Given an x value, find a parametric value it came from. - double solveCurveX(double x, double epsilon) { - ASSERT(x >= 0.0); - ASSERT(x <= 1.0); - - double t0; - double t1; - double t2; - double x2; - double d2; - int i; - - // First try a few iterations of Newton's method -- normally very fast. - for (t2 = x, i = 0; i < 8; i++) { - x2 = sampleCurveX(t2) - x; - if (fabs(x2) < epsilon) - return t2; - d2 = sampleCurveDerivativeX(t2); - if (fabs(d2) < 1e-6) - break; - t2 = t2 - x2 / d2; - } - - // Fall back to the bisection method for reliability. - t0 = 0.0; - t1 = 1.0; - t2 = x; - - while (t0 < t1) { - x2 = sampleCurveX(t2); - if (fabs(x2 - x) < epsilon) - return t2; - if (x > x2) - t0 = t2; - else - t1 = t2; - t2 = (t1 - t0) * .5 + t0; - } - - // Failure. - return t2; - } - - // Evaluates y at the given x. The epsilon parameter provides a hint as to the - // required accuracy and is not guaranteed. - double solve(double x, double epsilon) { - if (x < 0.0) - return 0.0 + m_startGradient * x; - if (x > 1.0) - return 1.0 + m_endGradient * (x - 1.0); - return sampleCurveY(solveCurveX(x, epsilon)); - } - - private: - double ax; - double bx; - double cx; - - double ay; - double by; - double cy; - - double m_startGradient; - double m_endGradient; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_ANIMATION_UNITBEZIER_H_ diff --git a/sky/engine/platform/animation/UnitBezierTest.cpp b/sky/engine/platform/animation/UnitBezierTest.cpp deleted file mode 100644 index 19d4367827ef5..0000000000000 --- a/sky/engine/platform/animation/UnitBezierTest.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/animation/UnitBezier.h" - -#include - -using namespace blink; - -namespace { - -TEST(UnitBezierTest, BasicUse) { - UnitBezier bezier(0.5, 1.0, 0.5, 1.0); - EXPECT_EQ(0.875, bezier.solve(0.5, 0.005)); -} - -TEST(UnitBezierTest, Overshoot) { - UnitBezier bezier(0.5, 2.0, 0.5, 2.0); - EXPECT_EQ(1.625, bezier.solve(0.5, 0.005)); -} - -TEST(UnitBezierTest, Undershoot) { - UnitBezier bezier(0.5, -1.0, 0.5, -1.0); - EXPECT_EQ(-0.625, bezier.solve(0.5, 0.005)); -} - -TEST(UnitBezierTest, InputAtEdgeOfRange) { - UnitBezier bezier(0.5, 1.0, 0.5, 1.0); - EXPECT_EQ(0.0, bezier.solve(0.0, 0.005)); - EXPECT_EQ(1.0, bezier.solve(1.0, 0.005)); -} - -TEST(UnitBezierTest, InputOutOfRange) { - UnitBezier bezier(0.5, 1.0, 0.5, 1.0); - EXPECT_EQ(-2.0, bezier.solve(-1.0, 0.005)); - EXPECT_EQ(1.0, bezier.solve(2.0, 0.005)); -} - -TEST(UnitBezierTest, InputOutOfRangeLargeEpsilon) { - UnitBezier bezier(0.5, 1.0, 0.5, 1.0); - EXPECT_EQ(-2.0, bezier.solve(-1.0, 1.0)); - EXPECT_EQ(1.0, bezier.solve(2.0, 1.0)); -} - -TEST(UnitBezierTest, InputOutOfRangeCoincidentEndpoints) { - UnitBezier bezier(0.0, 0.0, 1.0, 1.0); - EXPECT_EQ(-1.0, bezier.solve(-1.0, 0.005)); - EXPECT_EQ(2.0, bezier.solve(2.0, 0.005)); -} - -TEST(UnitBezierTest, InputOutOfRangeVerticalGradient) { - UnitBezier bezier(0.0, 1.0, 1.0, 0.0); - EXPECT_EQ(0.0, bezier.solve(-1.0, 0.005)); - EXPECT_EQ(1.0, bezier.solve(2.0, 0.005)); -} - -TEST(UnitBezierTest, InputOutOfRangeDistinctEndpoints) { - UnitBezier bezier(0.1, 0.2, 0.8, 0.8); - EXPECT_EQ(-2.0, bezier.solve(-1.0, 0.005)); - EXPECT_EQ(2.0, bezier.solve(2.0, 0.005)); -} - -} // namespace diff --git a/sky/engine/platform/exported/Platform.cpp b/sky/engine/platform/exported/Platform.cpp deleted file mode 100644 index 1050fd9ee2ecd..0000000000000 --- a/sky/engine/platform/exported/Platform.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/public/platform/Platform.h" - -namespace blink { - -static Platform* s_platform = 0; - -void Platform::initialize(Platform* platform) { - s_platform = platform; -} - -void Platform::shutdown() { - s_platform = 0; -} - -Platform* Platform::current() { - return s_platform; -} - -} // namespace blink diff --git a/sky/engine/platform/exported/WebCommon.cpp b/sky/engine/platform/exported/WebCommon.cpp deleted file mode 100644 index d081ee306fdd8..0000000000000 --- a/sky/engine/platform/exported/WebCommon.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/public/platform/WebCommon.h" - -#include "flutter/sky/engine/wtf/Assertions.h" - -namespace blink { - -void failedAssertion(const char* file, - int line, - const char* function, - const char* assertion) { - WTFReportAssertionFailure(file, line, function, assertion); - CRASH(); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/AlternateFontFamily.h b/sky/engine/platform/fonts/AlternateFontFamily.h deleted file mode 100644 index 587120ff2ddd2..0000000000000 --- a/sky/engine/platform/fonts/AlternateFontFamily.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2007 Nicholas Shanks - * Copyright (C) 2013 Google, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_ALTERNATEFONTFAMILY_H_ -#define SKY_ENGINE_PLATFORM_FONTS_ALTERNATEFONTFAMILY_H_ - -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -namespace blink { - -// We currently do not support bitmap fonts on windows. -// Instead of trying to construct a bitmap font and then going down the fallback -// path map certain common bitmap fonts to their truetype equivalent up front. -inline const AtomicString& adjustFamilyNameToAvoidUnsupportedFonts( - const AtomicString& familyName) { - return familyName; -} - -inline const AtomicString& alternateFamilyName(const AtomicString& familyName) { - // Alias Courier <-> Courier New - DEFINE_STATIC_LOCAL(AtomicString, courier, - ("Courier", AtomicString::ConstructFromLiteral)); - DEFINE_STATIC_LOCAL(AtomicString, courierNew, - ("Courier New", AtomicString::ConstructFromLiteral)); - if (equalIgnoringCase(familyName, courier)) - return courierNew; - // On Windows, Courier New (truetype font) is always present and - // Courier is a bitmap font. So, we don't want to map Courier New to - // Courier. - if (equalIgnoringCase(familyName, courierNew)) - return courier; - - // Alias Times and Times New Roman. - DEFINE_STATIC_LOCAL(AtomicString, times, - ("Times", AtomicString::ConstructFromLiteral)); - DEFINE_STATIC_LOCAL(AtomicString, timesNewRoman, - ("Times New Roman", AtomicString::ConstructFromLiteral)); - if (equalIgnoringCase(familyName, times)) - return timesNewRoman; - if (equalIgnoringCase(familyName, timesNewRoman)) - return times; - - // Alias Arial and Helvetica - DEFINE_STATIC_LOCAL(AtomicString, arial, - ("Arial", AtomicString::ConstructFromLiteral)); - DEFINE_STATIC_LOCAL(AtomicString, helvetica, - ("Helvetica", AtomicString::ConstructFromLiteral)); - if (equalIgnoringCase(familyName, arial)) - return helvetica; - if (equalIgnoringCase(familyName, helvetica)) - return arial; - - return emptyAtom; -} - -inline const AtomicString getFallbackFontFamily( - const FontDescription& description) { - DEFINE_STATIC_LOCAL(const AtomicString, sansStr, - ("sans-serif", AtomicString::ConstructFromLiteral)); - DEFINE_STATIC_LOCAL(const AtomicString, serifStr, - ("serif", AtomicString::ConstructFromLiteral)); - DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, - ("monospace", AtomicString::ConstructFromLiteral)); - DEFINE_STATIC_LOCAL(const AtomicString, cursiveStr, - ("cursive", AtomicString::ConstructFromLiteral)); - DEFINE_STATIC_LOCAL(const AtomicString, fantasyStr, - ("fantasy", AtomicString::ConstructFromLiteral)); - - switch (description.genericFamily()) { - case FontDescription::SansSerifFamily: - return sansStr; - case FontDescription::SerifFamily: - return serifStr; - case FontDescription::MonospaceFamily: - return monospaceStr; - case FontDescription::CursiveFamily: - return cursiveStr; - case FontDescription::FantasyFamily: - return fantasyStr; - default: - // Let the caller use the system default font. - return emptyAtom; - } -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_ALTERNATEFONTFAMILY_H_ diff --git a/sky/engine/platform/fonts/Character.cpp b/sky/engine/platform/fonts/Character.cpp deleted file mode 100644 index 23a700197bb60..0000000000000 --- a/sky/engine/platform/fonts/Character.cpp +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/Character.h" - -#include "flutter/sky/engine/platform/fonts/FontPlatformFeatures.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" - -using namespace WTF; -using namespace Unicode; - -namespace blink { - -static const UChar32 cjkIsolatedSymbolsArray[] = { - // 0x2C7 Caron, Mandarin Chinese 3rd Tone - 0x2C7, - // 0x2CA Modifier Letter Acute Accent, Mandarin Chinese 2nd Tone - 0x2CA, - // 0x2CB Modifier Letter Grave Access, Mandarin Chinese 4th Tone - 0x2CB, - // 0x2D9 Dot Above, Mandarin Chinese 5th Tone - 0x2D9, 0x2020, 0x2021, 0x2030, 0x203B, 0x203C, 0x2042, 0x2047, 0x2048, - 0x2049, 0x2051, 0x20DD, 0x20DE, 0x2100, 0x2103, 0x2105, 0x2109, 0x210A, - 0x2113, 0x2116, 0x2121, 0x212B, 0x213B, 0x2150, 0x2151, 0x2152, 0x217F, - 0x2189, 0x2307, 0x2312, 0x23CE, 0x2423, 0x25A0, 0x25A1, 0x25A2, 0x25AA, - 0x25AB, 0x25B1, 0x25B2, 0x25B3, 0x25B6, 0x25B7, 0x25BC, 0x25BD, 0x25C0, - 0x25C1, 0x25C6, 0x25C7, 0x25C9, 0x25CB, 0x25CC, 0x25EF, 0x2605, 0x2606, - 0x260E, 0x2616, 0x2617, 0x2640, 0x2642, 0x26A0, 0x26BD, 0x26BE, 0x2713, - 0x271A, 0x273F, 0x2740, 0x2756, 0x2B1A, 0xFE10, 0xFE11, 0xFE12, 0xFE19, - 0xFF1D, - // Emoji. - 0x1F100}; - -// Takes a flattened list of closed intervals -template -bool valueInIntervalList(const T (&intervalList)[size], const T& value) { - const T* bound = - std::upper_bound(&intervalList[0], &intervalList[size], value); - if ((bound - intervalList) % 2 == 1) - return true; - return bound > intervalList && *(bound - 1) == value; -} - -CodePath Character::characterRangeCodePath(const UChar* characters, - unsigned len) { - static const UChar complexCodePathRanges[] = { - // U+02E5 through U+02E9 (Modifier Letters : Tone letters) - 0x2E5, 0x2E9, - // U+0300 through U+036F Combining diacritical marks - 0x300, 0x36F, - // U+0591 through U+05CF excluding U+05BE Hebrew combining marks, ... - 0x0591, 0x05BD, - // ... Hebrew punctuation Paseq, Sof Pasuq and Nun Hafukha - 0x05BF, 0x05CF, - // U+0600 through U+109F Arabic, Syriac, Thaana, NKo, Samaritan, Mandaic, - // Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, - // Malayalam, Sinhala, Thai, Lao, Tibetan, Myanmar - 0x0600, 0x109F, - // U+1100 through U+11FF Hangul Jamo (only Ancient Korean should be left - // here if you precompose; Modern Korean will be precomposed as a result - // of step A) - 0x1100, 0x11FF, - // U+135D through U+135F Ethiopic combining marks - 0x135D, 0x135F, - // U+1780 through U+18AF Tagalog, Hanunoo, Buhid, Taghanwa,Khmer, - // Mongolian - 0x1700, 0x18AF, - // U+1900 through U+194F Limbu (Unicode 4.0) - 0x1900, 0x194F, - // U+1980 through U+19DF New Tai Lue - 0x1980, 0x19DF, - // U+1A00 through U+1CFF Buginese, Tai Tham, Balinese, Batak, Lepcha, - // Vedic - 0x1A00, 0x1CFF, - // U+1DC0 through U+1DFF Comining diacritical mark supplement - 0x1DC0, 0x1DFF, - // U+20D0 through U+20FF Combining marks for symbols - 0x20D0, 0x20FF, - // U+2CEF through U+2CF1 Combining marks for Coptic - 0x2CEF, 0x2CF1, - // U+302A through U+302F Ideographic and Hangul Tone marks - 0x302A, 0x302F, - // U+A67C through U+A67D Combining marks for old Cyrillic - 0xA67C, 0xA67D, - // U+A6F0 through U+A6F1 Combining mark for Bamum - 0xA6F0, 0xA6F1, - // U+A800 through U+ABFF Nagri, Phags-pa, Saurashtra, Devanagari Extended, - // Hangul Jamo Ext. A, Javanese, Myanmar Extended A, Tai Viet, Meetei - // Mayek - 0xA800, 0xABFF, - // U+D7B0 through U+D7FF Hangul Jamo Ext. B - 0xD7B0, 0xD7FF, - // U+FE00 through U+FE0F Unicode variation selectors - 0xFE00, 0xFE0F, - // U+FE20 through U+FE2F Combining half marks - 0xFE20, 0xFE2F}; - - CodePath result = SimplePath; - for (unsigned i = 0; i < len; i++) { - const UChar c = characters[i]; - - // Shortcut for common case - if (c < 0x2E5) - continue; - - // U+1E00 through U+2000 characters with diacritics and stacked diacritics - if (c >= 0x1E00 && c <= 0x2000) { - result = SimpleWithGlyphOverflowPath; - continue; - } - - // Surrogate pairs - if (c > 0xD7FF && c <= 0xDBFF) { - if (i == len - 1) - continue; - - UChar next = characters[++i]; - if (!U16_IS_TRAIL(next)) - continue; - - UChar32 supplementaryCharacter = U16_GET_SUPPLEMENTARY(c, next); - - if (supplementaryCharacter < - 0x1F1E6) // U+1F1E6 through U+1F1FF Regional Indicator Symbols - continue; - if (supplementaryCharacter <= 0x1F1FF) - return ComplexPath; - - if (supplementaryCharacter < - 0xE0100) // U+E0100 through U+E01EF Unicode variation selectors. - continue; - if (supplementaryCharacter <= 0xE01EF) - return ComplexPath; - - // FIXME: Check for Brahmi (U+11000 block), Kaithi (U+11080 block) and - // other complex scripts in plane 1 or higher. - - continue; - } - - // Search for other Complex cases - if (valueInIntervalList(complexCodePathRanges, c)) - return ComplexPath; - } - - return result; -} - -bool Character::isCJKIdeograph(UChar32 c) { - static const UChar32 cjkIdeographRanges[] = { - // CJK Radicals Supplement and Kangxi Radicals. - 0x2E80, 0x2FDF, - // CJK Strokes. - 0x31C0, 0x31EF, - // CJK Unified Ideographs Extension A. - 0x3400, 0x4DBF, - // The basic CJK Unified Ideographs block. - 0x4E00, 0x9FFF, - // CJK Compatibility Ideographs. - 0xF900, 0xFAFF, - // CJK Unified Ideographs Extension B. - 0x20000, 0x2A6DF, - // CJK Unified Ideographs Extension C. - // CJK Unified Ideographs Extension D. - 0x2A700, 0x2B81F, - // CJK Compatibility Ideographs Supplement. - 0x2F800, 0x2FA1F}; - static size_t cjkIdeographRangesCount = WTF_ARRAY_LENGTH(cjkIdeographRanges); - - // Early out - if (c < cjkIdeographRanges[0] || - c > cjkIdeographRanges[cjkIdeographRangesCount - 1]) - return false; - - return valueInIntervalList(cjkIdeographRanges, c); -} - -bool Character::isCJKIdeographOrSymbol(UChar32 c) { - // Likely common case - if (c < 0x2C7) - return false; - - // Hash lookup for isolated symbols (those not part of a contiguous range) - static HashSet* cjkIsolatedSymbols = 0; - if (!cjkIsolatedSymbols) { - cjkIsolatedSymbols = new HashSet(); - for (size_t i = 0; i < WTF_ARRAY_LENGTH(cjkIsolatedSymbolsArray); ++i) - cjkIsolatedSymbols->add(cjkIsolatedSymbolsArray[i]); - } - if (cjkIsolatedSymbols->contains(c)) - return true; - - if (isCJKIdeograph(c)) - return true; - - static const UChar32 cjkSymbolRanges[] = { - 0x2156, 0x215A, 0x2160, 0x216B, 0x2170, 0x217B, 0x23BE, 0x23CC, 0x2460, - 0x2492, 0x249C, 0x24FF, 0x25CE, 0x25D3, 0x25E2, 0x25E6, 0x2600, 0x2603, - 0x2660, 0x266F, 0x2672, 0x267D, 0x2776, 0x277F, - // Ideographic Description Characters, with CJK Symbols and Punctuation, - // excluding 0x3030. Then Hiragana 0x3040 .. 0x309F, Katakana 0x30A0 .. - // 0x30FF, Bopomofo 0x3100 .. 0x312F - 0x2FF0, 0x302F, 0x3031, 0x312F, - // More Bopomofo and Bopomofo Extended 0x31A0 .. 0x31BF - 0x3190, 0x31BF, - // Enclosed CJK Letters and Months (0x3200 .. 0x32FF). - // CJK Compatibility (0x3300 .. 0x33FF). - 0x3200, 0x33FF, 0xF860, 0xF862, - // CJK Compatibility Forms. - 0xFE30, 0xFE4F, - // Halfwidth and Fullwidth Forms - // Usually only used in CJK - 0xFF00, 0xFF0C, 0xFF0E, 0xFF1A, 0xFF1F, 0xFFEF, - // Emoji. - 0x1F110, 0x1F129, 0x1F130, 0x1F149, 0x1F150, 0x1F169, 0x1F170, 0x1F189, - 0x1F200, 0x1F6FF}; - - return valueInIntervalList(cjkSymbolRanges, c); -} - -unsigned Character::expansionOpportunityCount(const LChar* characters, - size_t length, - TextDirection direction, - bool& isAfterExpansion) { - unsigned count = 0; - if (direction == LTR) { - for (size_t i = 0; i < length; ++i) { - if (treatAsSpace(characters[i])) { - count++; - isAfterExpansion = true; - } else { - isAfterExpansion = false; - } - } - } else { - for (size_t i = length; i > 0; --i) { - if (treatAsSpace(characters[i - 1])) { - count++; - isAfterExpansion = true; - } else { - isAfterExpansion = false; - } - } - } - return count; -} - -unsigned Character::expansionOpportunityCount(const UChar* characters, - size_t length, - TextDirection direction, - bool& isAfterExpansion) { - static bool expandAroundIdeographs = - FontPlatformFeatures::canExpandAroundIdeographsInComplexText(); - unsigned count = 0; - if (direction == LTR) { - for (size_t i = 0; i < length; ++i) { - UChar32 character = characters[i]; - if (treatAsSpace(character)) { - count++; - isAfterExpansion = true; - continue; - } - if (U16_IS_LEAD(character) && i + 1 < length && - U16_IS_TRAIL(characters[i + 1])) { - character = U16_GET_SUPPLEMENTARY(character, characters[i + 1]); - i++; - } - if (expandAroundIdeographs && isCJKIdeographOrSymbol(character)) { - if (!isAfterExpansion) - count++; - count++; - isAfterExpansion = true; - continue; - } - isAfterExpansion = false; - } - } else { - for (size_t i = length; i > 0; --i) { - UChar32 character = characters[i - 1]; - if (treatAsSpace(character)) { - count++; - isAfterExpansion = true; - continue; - } - if (U16_IS_TRAIL(character) && i > 1 && U16_IS_LEAD(characters[i - 2])) { - character = U16_GET_SUPPLEMENTARY(characters[i - 2], character); - i--; - } - if (expandAroundIdeographs && isCJKIdeographOrSymbol(character)) { - if (!isAfterExpansion) - count++; - count++; - isAfterExpansion = true; - continue; - } - isAfterExpansion = false; - } - } - return count; -} - -bool Character::canReceiveTextEmphasis(UChar32 c) { - CharCategory category = Unicode::category(c); - if (category & (Separator_Space | Separator_Line | Separator_Paragraph | - Other_NotAssigned | Other_Control | Other_Format)) - return false; - - // Additional word-separator characters listed in CSS Text Level 3 Editor's - // Draft 3 November 2010. - if (c == ethiopicWordspace || c == aegeanWordSeparatorLine || - c == aegeanWordSeparatorDot || c == ugariticWordDivider || - c == tibetanMarkIntersyllabicTsheg || c == tibetanMarkDelimiterTshegBstar) - return false; - - return true; -} - -template -static inline String normalizeSpacesInternal(const CharacterType* characters, - unsigned length) { - StringBuilder normalized; - normalized.reserveCapacity(length); - - for (unsigned i = 0; i < length; ++i) - normalized.append(Character::normalizeSpaces(characters[i])); - - return normalized.toString(); -} - -String Character::normalizeSpaces(const LChar* characters, unsigned length) { - return normalizeSpacesInternal(characters, length); -} - -String Character::normalizeSpaces(const UChar* characters, unsigned length) { - return normalizeSpacesInternal(characters, length); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/Character.h b/sky/engine/platform/fonts/Character.h deleted file mode 100644 index 72adc88d0f8e9..0000000000000 --- a/sky/engine/platform/fonts/Character.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_CHARACTER_H_ -#define SKY_ENGINE_PLATFORM_FONTS_CHARACTER_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" -#include "flutter/sky/engine/platform/text/TextPath.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -namespace blink { - -class PLATFORM_EXPORT Character { - public: - static CodePath characterRangeCodePath(const LChar*, unsigned) { - return SimplePath; - } - static CodePath characterRangeCodePath(const UChar*, unsigned len); - - static bool isCJKIdeograph(UChar32); - static bool isCJKIdeographOrSymbol(UChar32); - - static unsigned expansionOpportunityCount(const LChar*, - size_t length, - TextDirection, - bool& isAfterExpansion); - static unsigned expansionOpportunityCount(const UChar*, - size_t length, - TextDirection, - bool& isAfterExpansion); - - static bool treatAsSpace(UChar c) { - return c == ' ' || c == '\t' || c == '\n' || c == noBreakSpace; - } - static bool treatAsZeroWidthSpace(UChar c) { - return treatAsZeroWidthSpaceInComplexScript(c) || c == 0x200c || - c == 0x200d; - } - static bool treatAsZeroWidthSpaceInComplexScript(UChar c) { - return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || - c == zeroWidthSpace || (c >= 0x200e && c <= 0x200f) || - (c >= 0x202a && c <= 0x202e) || c == zeroWidthNoBreakSpace || - c == objectReplacementCharacter; - } - static bool canReceiveTextEmphasis(UChar32); - - static inline UChar normalizeSpaces(UChar character) { - if (treatAsSpace(character)) - return space; - - if (treatAsZeroWidthSpace(character)) - return zeroWidthSpace; - - return character; - } - - static String normalizeSpaces(const LChar*, unsigned length); - static String normalizeSpaces(const UChar*, unsigned length); - - private: - Character(); -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_CHARACTER_H_ diff --git a/sky/engine/platform/fonts/CustomFontData.h b/sky/engine/platform/fonts/CustomFontData.h deleted file mode 100644 index 3b9ad4a5b96d4..0000000000000 --- a/sky/engine/platform/fonts/CustomFontData.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2013 Google, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_CUSTOMFONTDATA_H_ -#define SKY_ENGINE_PLATFORM_FONTS_CUSTOMFONTDATA_H_ - -#include -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/Glyph.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -struct GlyphData; -class GlyphPage; -class SimpleFontData; -struct WidthIterator; - -class PLATFORM_EXPORT CustomFontData : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new CustomFontData()); - } - - virtual ~CustomFontData() {} - - virtual void beginLoadIfNeeded() const {}; - virtual bool isLoading() const { return false; } - virtual bool isLoadingFallback() const { return false; } - virtual bool shouldSkipDrawing() const { return false; } - virtual void clearFontFaceSource() {} - - virtual bool isSVGFont() const { return false; } - virtual void initializeFontData(SimpleFontData*, float) {} - - protected: - CustomFontData() {} -}; - -#define DEFINE_CUSTOM_FONT_DATA_TYPE_CASTS(thisType, predicate) \ - template \ - inline thisType* to##thisType(const RefPtr& customFontData) { \ - return to##thisType(customFontData.get()); \ - } \ - DEFINE_TYPE_CASTS(thisType, CustomFontData, customFontData, \ - customFontData->predicate, customFontData.predicate) - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_CUSTOMFONTDATA_H_ diff --git a/sky/engine/platform/fonts/FixedPitchFontType.h b/sky/engine/platform/fonts/FixedPitchFontType.h deleted file mode 100644 index b207172e86b85..0000000000000 --- a/sky/engine/platform/fonts/FixedPitchFontType.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FIXEDPITCHFONTTYPE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FIXEDPITCHFONTTYPE_H_ - -namespace blink { - -enum FixedPitchFontType { FixedPitchFont, NonFixedPitchFont }; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FIXEDPITCHFONTTYPE_H_ diff --git a/sky/engine/platform/fonts/Font.cpp b/sky/engine/platform/fonts/Font.cpp deleted file mode 100644 index 01e3b7c051dce..0000000000000 --- a/sky/engine/platform/fonts/Font.cpp +++ /dev/null @@ -1,974 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/fonts/Font.h" - -#include "flutter/sky/engine/platform/LayoutUnit.h" -#include "flutter/sky/engine/platform/fonts/Character.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" -#include "flutter/sky/engine/platform/fonts/FontPlatformFeatures.h" -#include "flutter/sky/engine/platform/fonts/GlyphBuffer.h" -#include "flutter/sky/engine/platform/fonts/GlyphPageTreeNode.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/platform/fonts/WidthIterator.h" -#include "flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "flutter/sky/engine/platform/text/TextRun.h" -#include "flutter/sky/engine/wtf/MainThread.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -using namespace WTF; -using namespace Unicode; - -namespace blink { - -CodePath Font::s_codePath = AutoPath; - -// ============================================================================================ -// Font Implementation (Cross-Platform Portion) -// ============================================================================================ - -Font::Font() {} - -Font::Font(const FontDescription& fd) : m_fontDescription(fd) {} - -Font::Font(const Font& other) - : m_fontDescription(other.m_fontDescription), - m_fontFallbackList(other.m_fontFallbackList) {} - -Font& Font::operator=(const Font& other) { - m_fontDescription = other.m_fontDescription; - m_fontFallbackList = other.m_fontFallbackList; - return *this; -} - -bool Font::operator==(const Font& other) const { - // Our FontData don't have to be checked, since checking the font description - // will be fine. - // FIXME: This does not work if the font was made with the FontPlatformData - // constructor. - if (loadingCustomFonts() || other.loadingCustomFonts()) - return false; - - FontSelector* first = - m_fontFallbackList ? m_fontFallbackList->fontSelector() : 0; - FontSelector* second = - other.m_fontFallbackList ? other.m_fontFallbackList->fontSelector() : 0; - - return first == second && m_fontDescription == other.m_fontDescription && - (m_fontFallbackList ? m_fontFallbackList->fontSelectorVersion() : 0) == - (other.m_fontFallbackList - ? other.m_fontFallbackList->fontSelectorVersion() - : 0) && - (m_fontFallbackList ? m_fontFallbackList->generation() : 0) == - (other.m_fontFallbackList ? other.m_fontFallbackList->generation() - : 0); -} - -void Font::update(PassRefPtr fontSelector) const { - // FIXME: It is pretty crazy that we are willing to just poke into a RefPtr, - // but it ends up being reasonably safe (because inherited fonts in the render - // tree pick up the new style anyway. Other copies are transient, e.g., the - // state in the GraphicsContext, and won't stick around long enough to get you - // in trouble). Still, this is pretty disgusting, and could eventually be - // rectified by using RefPtrs for Fonts themselves. - if (!m_fontFallbackList) - m_fontFallbackList = FontFallbackList::create(); - m_fontFallbackList->invalidate(fontSelector); -} - -float Font::buildGlyphBuffer(const TextRunPaintInfo& runInfo, - GlyphBuffer& glyphBuffer, - ForTextEmphasisOrNot forTextEmphasis) const { - if (codePath(runInfo.run) == ComplexPath) { - HarfBuzzShaper shaper(this, runInfo.run, - (forTextEmphasis == ForTextEmphasis) - ? HarfBuzzShaper::ForTextEmphasis - : HarfBuzzShaper::NotForTextEmphasis); - shaper.setDrawRange(runInfo.from, runInfo.to); - shaper.shape(&glyphBuffer); - - return 0; - } - - WidthIterator it(this, runInfo.run, nullptr, false, forTextEmphasis); - it.advance(runInfo.from); - float beforeWidth = it.runWidthSoFar(); - it.advance(runInfo.to, &glyphBuffer); - - if (runInfo.run.ltr()) - return beforeWidth; - - // RTL - float afterWidth = it.runWidthSoFar(); - it.advance(runInfo.run.length()); - glyphBuffer.reverse(); - - return it.runWidthSoFar() - afterWidth; -} - -void Font::drawText(GraphicsContext* context, - const TextRunPaintInfo& runInfo, - const FloatPoint& point) const { - // Don't draw anything while we are using custom fonts that are in the process - // of loading. - if (shouldSkipDrawing()) - return; - - TextDrawingModeFlags textMode = context->textDrawingMode(); - if (!(textMode & TextModeFill) && - !((textMode & TextModeStroke) && context->hasStroke())) - return; - - if (runInfo.cachedTextBlob && runInfo.cachedTextBlob->get()) { - // we have a pre-cached blob -- happy joy! - drawTextBlob(context, runInfo.cachedTextBlob->get(), point.data()); - return; - } - - { - FontCachePurgePreventer preventer; - GlyphBuffer glyphBuffer; - float initialAdvance = buildGlyphBuffer(runInfo, glyphBuffer); - - if (glyphBuffer.isEmpty()) - return; - - // Enabling text-blobs forces the blob rendering path even for uncacheable - // blobs. - TextBlobPtr uncacheableTextBlob; - TextBlobPtr& textBlob = - runInfo.cachedTextBlob ? *runInfo.cachedTextBlob : uncacheableTextBlob; - FloatRect blobBounds = runInfo.bounds; - blobBounds.moveBy(-point); - - textBlob = buildTextBlob(glyphBuffer, initialAdvance, blobBounds); - if (textBlob) { - drawTextBlob(context, textBlob.get(), point.data()); - return; - } - - drawGlyphBuffer(context, runInfo, glyphBuffer, - FloatPoint(point.x() + initialAdvance, point.y())); - } -} - -float Font::drawUncachedText( - GraphicsContext* context, - const TextRunPaintInfo& runInfo, - const FloatPoint& point, - CustomFontNotReadyAction customFontNotReadyAction) const { - // Don't draw anything while we are using custom fonts that are in the process - // of loading, except if the 'force' argument is set to true (in which case it - // will use a fallback font). - if (shouldSkipDrawing() && - customFontNotReadyAction == DoNotPaintIfFontNotReady) - return 0; - - TextDrawingModeFlags textMode = context->textDrawingMode(); - if (!(textMode & TextModeFill) && - !((textMode & TextModeStroke) && context->hasStroke())) - return 0; - - GlyphBuffer glyphBuffer; - float initialAdvance = buildGlyphBuffer(runInfo, glyphBuffer); - - if (glyphBuffer.isEmpty()) - return 0; - - return drawGlyphBuffer(context, runInfo, glyphBuffer, - FloatPoint(point.x() + initialAdvance, point.y())); -} - -void Font::drawEmphasisMarks(GraphicsContext* context, - const TextRunPaintInfo& runInfo, - const AtomicString& mark, - const FloatPoint& point) const { - if (shouldSkipDrawing()) - return; - - GlyphBuffer glyphBuffer; - float initialAdvance = - buildGlyphBuffer(runInfo, glyphBuffer, ForTextEmphasis); - - if (glyphBuffer.isEmpty()) - return; - - drawEmphasisMarks(context, runInfo, glyphBuffer, mark, - FloatPoint(point.x() + initialAdvance, point.y())); -} - -static inline void updateGlyphOverflowFromBounds( - const IntRectExtent& glyphBounds, - const FontMetrics& fontMetrics, - GlyphOverflow* glyphOverflow) { - glyphOverflow->top = std::max( - glyphOverflow->top, - glyphBounds.top() - - (glyphOverflow->computeBounds ? 0 : fontMetrics.ascent())); - glyphOverflow->bottom = std::max( - glyphOverflow->bottom, - glyphBounds.bottom() - - (glyphOverflow->computeBounds ? 0 : fontMetrics.descent())); - glyphOverflow->left = glyphBounds.left(); - glyphOverflow->right = glyphBounds.right(); -} - -float Font::width(const TextRun& run, - HashSet* fallbackFonts, - GlyphOverflow* glyphOverflow) const { - CodePath codePathToUse = codePath(run); - if (codePathToUse != ComplexPath) { - // The simple path can optimize the case where glyph overflow is not - // observable. - if (codePathToUse != SimpleWithGlyphOverflowPath && - (glyphOverflow && !glyphOverflow->computeBounds)) - glyphOverflow = 0; - } - - bool hasWordSpacingOrLetterSpacing = - fontDescription().wordSpacing() || fontDescription().letterSpacing(); - bool isCacheable = - codePathToUse == ComplexPath && - !hasWordSpacingOrLetterSpacing // Word spacing and letter spacing can - // change the width of a word. - && !run.allowTabs(); // If we allow tabs and a tab occurs inside a word, - // the width of the word varies based on its - // position on the line. - - WidthCacheEntry* cacheEntry = - isCacheable ? m_fontFallbackList->widthCache().add(run, WidthCacheEntry()) - : 0; - if (cacheEntry && cacheEntry->isValid()) { - if (glyphOverflow) - updateGlyphOverflowFromBounds(cacheEntry->glyphBounds, fontMetrics(), - glyphOverflow); - return cacheEntry->width; - } - - float result; - IntRectExtent glyphBounds; - if (codePathToUse == ComplexPath) { - result = floatWidthForComplexText(run, fallbackFonts, &glyphBounds); - } else { - ASSERT(!isCacheable); - result = floatWidthForSimpleText(run, fallbackFonts, - glyphOverflow ? &glyphBounds : 0); - } - - if (cacheEntry && (!fallbackFonts || fallbackFonts->isEmpty())) { - cacheEntry->glyphBounds = glyphBounds; - cacheEntry->width = result; - } - - if (glyphOverflow) - updateGlyphOverflowFromBounds(glyphBounds, fontMetrics(), glyphOverflow); - return result; -} - -float Font::width(const TextRun& run, - int& charsConsumed, - Glyph& glyphId) const { - charsConsumed = run.length(); - glyphId = 0; - return width(run); -} - -FloatRect Font::selectionRectForText(const TextRun& run, - const FloatPoint& point, - int h, - int from, - int to, - bool accountForGlyphBounds) const { - to = (to == -1 ? run.length() : to); - - CodePath codePathToUse = codePath(run); - // FIXME: Use the fast code path once it handles partial runs with kerning and - // ligatures. See http://webkit.org/b/100050 - if (codePathToUse != ComplexPath && fontDescription().typesettingFeatures() && - (from || to != run.length())) - codePathToUse = ComplexPath; - - if (codePathToUse != ComplexPath) - return selectionRectForSimpleText(run, point, h, from, to, - accountForGlyphBounds); - - return selectionRectForComplexText(run, point, h, from, to); -} - -int Font::offsetForPosition(const TextRun& run, - float x, - bool includePartialGlyphs) const { - // FIXME: Use the fast code path once it handles partial runs with kerning and - // ligatures. See http://webkit.org/b/100050 - if (codePath(run) != ComplexPath && !fontDescription().typesettingFeatures()) - return offsetForPositionForSimpleText(run, x, includePartialGlyphs); - - return offsetForPositionForComplexText(run, x, includePartialGlyphs); -} - -void Font::setCodePath(CodePath p) { - s_codePath = p; -} - -CodePath Font::codePath() { - return s_codePath; -} - -CodePath Font::codePath(const TextRun& run) const { - if (s_codePath != AutoPath) - return s_codePath; - - if (m_fontDescription.featureSettings() && - m_fontDescription.featureSettings()->size() > 0 && - m_fontDescription.letterSpacing() == 0) - return ComplexPath; - - if (m_fontDescription.widthVariant() != RegularWidth) - return ComplexPath; - - if (run.length() > 1 && fontDescription().typesettingFeatures()) - return ComplexPath; - - if (!run.characterScanForCodePath()) - return SimplePath; - - if (run.is8Bit()) - return SimplePath; - - // Start from 0 since drawing and highlighting also measure the characters - // before run->from. - return Character::characterRangeCodePath(run.characters16(), run.length()); -} - -void Font::willUseFontData(UChar32 character) const { - const FontFamily& family = fontDescription().family(); - if (m_fontFallbackList && m_fontFallbackList->fontSelector() && - !family.familyIsEmpty()) - m_fontFallbackList->fontSelector()->willUseFontData( - fontDescription(), family.family(), character); -} - -static inline bool isInRange(UChar32 character, - UChar32 lowerBound, - UChar32 upperBound) { - return character >= lowerBound && character <= upperBound; -} - -static bool shouldIgnoreRotation(UChar32 character) { - if (character == 0x000A7 || character == 0x000A9 || character == 0x000AE) - return true; - - if (character == 0x000B6 || character == 0x000BC || character == 0x000BD || - character == 0x000BE) - return true; - - if (isInRange(character, 0x002E5, 0x002EB)) - return true; - - if (isInRange(character, 0x01100, 0x011FF) || - isInRange(character, 0x01401, 0x0167F) || - isInRange(character, 0x01800, 0x018FF)) - return true; - - if (character == 0x02016 || character == 0x02018 || character == 0x02019 || - character == 0x02020 || character == 0x02021 || character == 0x2030 || - character == 0x02031) - return true; - - if (isInRange(character, 0x0203B, 0x0203D) || character == 0x02042 || - character == 0x02044 || character == 0x02047 || character == 0x02048 || - character == 0x02049 || character == 0x2051) - return true; - - if (isInRange(character, 0x02065, 0x02069) || - isInRange(character, 0x020DD, 0x020E0) || - isInRange(character, 0x020E2, 0x020E4) || - isInRange(character, 0x02100, 0x02117) || - isInRange(character, 0x02119, 0x02131) || - isInRange(character, 0x02133, 0x0213F)) - return true; - - if (isInRange(character, 0x02145, 0x0214A) || character == 0x0214C || - character == 0x0214D || isInRange(character, 0x0214F, 0x0218F)) - return true; - - if (isInRange(character, 0x02300, 0x02307) || - isInRange(character, 0x0230C, 0x0231F) || - isInRange(character, 0x02322, 0x0232B) || - isInRange(character, 0x0237D, 0x0239A) || - isInRange(character, 0x023B4, 0x023B6) || - isInRange(character, 0x023BA, 0x023CF) || - isInRange(character, 0x023D1, 0x023DB) || - isInRange(character, 0x023E2, 0x024FF)) - return true; - - if (isInRange(character, 0x025A0, 0x02619) || - isInRange(character, 0x02620, 0x02767) || - isInRange(character, 0x02776, 0x02793) || - isInRange(character, 0x02B12, 0x02B2F) || - isInRange(character, 0x02B4D, 0x02BFF) || - isInRange(character, 0x02E80, 0x03007)) - return true; - - if (character == 0x03012 || character == 0x03013 || - isInRange(character, 0x03020, 0x0302F) || - isInRange(character, 0x03031, 0x0309F) || - isInRange(character, 0x030A1, 0x030FB) || - isInRange(character, 0x030FD, 0x0A4CF)) - return true; - - if (isInRange(character, 0x0A840, 0x0A87F) || - isInRange(character, 0x0A960, 0x0A97F) || - isInRange(character, 0x0AC00, 0x0D7FF) || - isInRange(character, 0x0E000, 0x0FAFF)) - return true; - - if (isInRange(character, 0x0FE10, 0x0FE1F) || - isInRange(character, 0x0FE30, 0x0FE48) || - isInRange(character, 0x0FE50, 0x0FE57) || - isInRange(character, 0x0FE5F, 0x0FE62) || - isInRange(character, 0x0FE67, 0x0FE6F)) - return true; - - if (isInRange(character, 0x0FF01, 0x0FF07) || - isInRange(character, 0x0FF0A, 0x0FF0C) || - isInRange(character, 0x0FF0E, 0x0FF19) || - isInRange(character, 0x0FF1F, 0x0FF3A)) - return true; - - if (character == 0x0FF3C || character == 0x0FF3E) - return true; - - if (isInRange(character, 0x0FF40, 0x0FF5A) || - isInRange(character, 0x0FFE0, 0x0FFE2) || - isInRange(character, 0x0FFE4, 0x0FFE7) || - isInRange(character, 0x0FFF0, 0x0FFF8) || character == 0x0FFFD) - return true; - - if (isInRange(character, 0x13000, 0x1342F) || - isInRange(character, 0x1B000, 0x1B0FF) || - isInRange(character, 0x1D000, 0x1D1FF) || - isInRange(character, 0x1D300, 0x1D37F) || - isInRange(character, 0x1F000, 0x1F64F) || - isInRange(character, 0x1F680, 0x1F77F)) - return true; - - if (isInRange(character, 0x20000, 0x2FFFD) || - isInRange(character, 0x30000, 0x3FFFD)) - return true; - - return false; -} - -static inline std::pair -glyphDataAndPageForNonCJKCharacterWithGlyphOrientation( - UChar32 character, - NonCJKGlyphOrientation orientation, - GlyphData& data, - GlyphPage* page, - unsigned pageNumber) { - if (orientation == NonCJKGlyphOrientationUpright || - shouldIgnoreRotation(character)) { - RefPtr uprightFontData = - data.fontData->uprightOrientationFontData(); - GlyphPageTreeNode* uprightNode = - GlyphPageTreeNode::getRootChild(uprightFontData.get(), pageNumber); - GlyphPage* uprightPage = uprightNode->page(); - if (uprightPage) { - GlyphData uprightData = uprightPage->glyphDataForCharacter(character); - // If the glyphs are the same, then we know we can just use the horizontal - // glyph rotated vertically to be upright. - if (data.glyph == uprightData.glyph) - return std::make_pair(data, page); - // The glyphs are distinct, meaning that the font has a vertical-right - // glyph baked into it. We can't use that glyph, so we fall back to the - // upright data and use the horizontal glyph. - if (uprightData.fontData) - return std::make_pair(uprightData, uprightPage); - } - } else if (orientation == NonCJKGlyphOrientationVerticalRight) { - RefPtr verticalRightFontData = - data.fontData->verticalRightOrientationFontData(); - GlyphPageTreeNode* verticalRightNode = GlyphPageTreeNode::getRootChild( - verticalRightFontData.get(), pageNumber); - GlyphPage* verticalRightPage = verticalRightNode->page(); - if (verticalRightPage) { - GlyphData verticalRightData = - verticalRightPage->glyphDataForCharacter(character); - // If the glyphs are distinct, we will make the assumption that the font - // has a vertical-right glyph baked into it. - if (data.glyph != verticalRightData.glyph) - return std::make_pair(data, page); - // The glyphs are identical, meaning that we should just use the - // horizontal glyph. - if (verticalRightData.fontData) - return std::make_pair(verticalRightData, verticalRightPage); - } - } - return std::make_pair(data, page); -} - -std::pair Font::glyphDataAndPageForCharacter( - UChar32 c, - bool mirror, - FontDataVariant variant) const { - ASSERT(isMainThread()); - - if (variant == AutoVariant) { - if (m_fontDescription.variant() == FontVariantSmallCaps && - !primaryFont()->isSVGFont()) { - UChar32 upperC = toUpper(c); - if (upperC != c) { - c = upperC; - variant = SmallCapsVariant; - } else { - variant = NormalVariant; - } - } else { - variant = NormalVariant; - } - } - - if (mirror) - c = mirroredChar(c); - - unsigned pageNumber = (c / GlyphPage::size); - - GlyphPageTreeNode* node = m_fontFallbackList->getPageNode(pageNumber); - if (!node) { - node = GlyphPageTreeNode::getRootChild(fontDataAt(0), pageNumber); - m_fontFallbackList->setPageNode(pageNumber, node); - } - - GlyphPage* page = 0; - if (variant == NormalVariant) { - // Fastest loop, for the common case (normal variant). - while (true) { - page = node->page(); - if (page) { - GlyphData data = page->glyphDataForCharacter(c); - if (data.fontData && - (data.fontData->platformData().orientation() == Horizontal || - data.fontData->isTextOrientationFallback())) - return std::make_pair(data, page); - - if (data.fontData) { - if (Character::isCJKIdeographOrSymbol(c)) { - if (!data.fontData->hasVerticalGlyphs()) { - // Use the broken ideograph font data. The broken ideograph font - // will use the horizontal width of glyphs to make sure you get a - // square (even for broken glyphs like symbols used for - // punctuation). - variant = BrokenIdeographVariant; - break; - } - } else { - return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation( - c, m_fontDescription.nonCJKGlyphOrientation(), data, page, - pageNumber); - } - - return std::make_pair(data, page); - } - - if (node->isSystemFallback()) - break; - } - - // Proceed with the fallback list. - node = node->getChild(fontDataAt(node->level()), pageNumber); - m_fontFallbackList->setPageNode(pageNumber, node); - } - } - if (variant != NormalVariant) { - while (true) { - page = node->page(); - if (page) { - GlyphData data = page->glyphDataForCharacter(c); - if (data.fontData) { - // The variantFontData function should not normally return 0. - // But if it does, we will just render the capital letter big. - RefPtr variantFontData = - data.fontData->variantFontData(m_fontDescription, variant); - if (!variantFontData) - return std::make_pair(data, page); - - GlyphPageTreeNode* variantNode = GlyphPageTreeNode::getRootChild( - variantFontData.get(), pageNumber); - GlyphPage* variantPage = variantNode->page(); - if (variantPage) { - GlyphData data = variantPage->glyphDataForCharacter(c); - if (data.fontData) - return std::make_pair(data, variantPage); - } - - // Do not attempt system fallback off the variantFontData. This is the - // very unlikely case that a font has the lowercase character but the - // small caps font does not have its uppercase version. - return std::make_pair(variantFontData->missingGlyphData(), page); - } - - if (node->isSystemFallback()) - break; - } - - // Proceed with the fallback list. - node = node->getChild(fontDataAt(node->level()), pageNumber); - m_fontFallbackList->setPageNode(pageNumber, node); - } - } - - ASSERT(page); - ASSERT(node->isSystemFallback()); - - // System fallback is character-dependent. When we get here, we - // know that the character in question isn't in the system fallback - // font's glyph page. Try to lazily create it here. - - // FIXME: Unclear if this should normalizeSpaces above 0xFFFF. - // Doing so changes fast/text/international/plane2-diffs.html - UChar32 characterToRender = c; - if (characterToRender <= 0xFFFF) - characterToRender = Character::normalizeSpaces(characterToRender); - const SimpleFontData* fontDataToSubstitute = - fontDataAt(0)->fontDataForCharacter(characterToRender); - RefPtr characterFontData = - FontCache::fontCache()->fallbackFontForCharacter( - m_fontDescription, characterToRender, fontDataToSubstitute); - if (characterFontData) { - if (characterFontData->platformData().orientation() == Vertical && - !characterFontData->hasVerticalGlyphs() && - Character::isCJKIdeographOrSymbol(c)) - variant = BrokenIdeographVariant; - if (variant != NormalVariant) - characterFontData = - characterFontData->variantFontData(m_fontDescription, variant); - } - if (characterFontData) { - // Got the fallback glyph and font. - GlyphPage* fallbackPage = - GlyphPageTreeNode::getRootChild(characterFontData.get(), pageNumber) - ->page(); - GlyphData data = fallbackPage && fallbackPage->glyphForCharacter(c) - ? fallbackPage->glyphDataForCharacter(c) - : characterFontData->missingGlyphData(); - // Cache it so we don't have to do system fallback again next time. - if (variant == NormalVariant) { - page->setGlyphDataForCharacter(c, data.glyph, data.fontData); - data.fontData->setMaxGlyphPageTreeLevel( - std::max(data.fontData->maxGlyphPageTreeLevel(), node->level())); - if (!Character::isCJKIdeographOrSymbol(c) && - data.fontData->platformData().orientation() != Horizontal && - !data.fontData->isTextOrientationFallback()) - return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation( - c, m_fontDescription.nonCJKGlyphOrientation(), data, page, - pageNumber); - } - return std::make_pair(data, page); - } - - // Even system fallback can fail; use the missing glyph in that case. - // FIXME: It would be nicer to use the missing glyph from the last resort font - // instead. - GlyphData data = primaryFont()->missingGlyphData(); - if (variant == NormalVariant) { - page->setGlyphDataForCharacter(c, data.glyph, data.fontData); - data.fontData->setMaxGlyphPageTreeLevel( - std::max(data.fontData->maxGlyphPageTreeLevel(), node->level())); - } - return std::make_pair(data, page); -} - -bool Font::primaryFontHasGlyphForCharacter(UChar32 character) const { - unsigned pageNumber = (character / GlyphPage::size); - - GlyphPageTreeNode* node = - GlyphPageTreeNode::getRootChild(primaryFont(), pageNumber); - GlyphPage* page = node->page(); - - return page && page->glyphForCharacter(character); -} - -// FIXME: This function may not work if the emphasis mark uses a complex script, -// but none of the standard emphasis marks do so. -bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, - GlyphData& glyphData) const { - if (mark.isEmpty()) - return false; - - UChar32 character = mark[0]; - - if (U16_IS_SURROGATE(character)) { - if (!U16_IS_SURROGATE_LEAD(character)) - return false; - - if (mark.length() < 2) - return false; - - UChar low = mark[1]; - if (!U16_IS_TRAIL(low)) - return false; - - character = U16_GET_SUPPLEMENTARY(character, low); - } - - glyphData = glyphDataForCharacter(character, false, EmphasisMarkVariant); - return true; -} - -int Font::emphasisMarkAscent(const AtomicString& mark) const { - FontCachePurgePreventer purgePreventer; - - GlyphData markGlyphData; - if (!getEmphasisMarkGlyphData(mark, markGlyphData)) - return 0; - - const SimpleFontData* markFontData = markGlyphData.fontData; - ASSERT(markFontData); - if (!markFontData) - return 0; - - return markFontData->fontMetrics().ascent(); -} - -int Font::emphasisMarkDescent(const AtomicString& mark) const { - FontCachePurgePreventer purgePreventer; - - GlyphData markGlyphData; - if (!getEmphasisMarkGlyphData(mark, markGlyphData)) - return 0; - - const SimpleFontData* markFontData = markGlyphData.fontData; - ASSERT(markFontData); - if (!markFontData) - return 0; - - return markFontData->fontMetrics().descent(); -} - -int Font::emphasisMarkHeight(const AtomicString& mark) const { - FontCachePurgePreventer purgePreventer; - - GlyphData markGlyphData; - if (!getEmphasisMarkGlyphData(mark, markGlyphData)) - return 0; - - const SimpleFontData* markFontData = markGlyphData.fontData; - ASSERT(markFontData); - if (!markFontData) - return 0; - - return markFontData->fontMetrics().height(); -} - -float Font::drawGlyphBuffer(GraphicsContext* context, - const TextRunPaintInfo& runInfo, - const GlyphBuffer& glyphBuffer, - const FloatPoint& point) const { - // Draw each contiguous run of glyphs that use the same font data. - const SimpleFontData* fontData = glyphBuffer.fontDataAt(0); - FloatPoint startPoint(point); - float advanceSoFar = 0; - unsigned lastFrom = 0; - unsigned nextGlyph = 0; - while (nextGlyph < glyphBuffer.size()) { - const SimpleFontData* nextFontData = glyphBuffer.fontDataAt(nextGlyph); - if (nextFontData != fontData) { - drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, - startPoint, runInfo.bounds); - lastFrom = nextGlyph; - fontData = nextFontData; - startPoint += FloatSize(advanceSoFar, 0); - advanceSoFar = 0; - } - advanceSoFar += glyphBuffer.advanceAt(nextGlyph); - nextGlyph++; - } - drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, - startPoint, runInfo.bounds); - startPoint += FloatSize(advanceSoFar, 0); - return startPoint.x() - point.x(); -} - -inline static float offsetToMiddleOfGlyph(const SimpleFontData* fontData, - Glyph glyph) { - if (fontData->platformData().orientation() == Horizontal) { - FloatRect bounds = fontData->boundsForGlyph(glyph); - return bounds.x() + bounds.width() / 2; - } - // FIXME: Use glyph bounds once they make sense for vertical fonts. - return fontData->widthForGlyph(glyph) / 2; -} - -inline static float offsetToMiddleOfAdvanceAtIndex( - const GlyphBuffer& glyphBuffer, - size_t i) { - return glyphBuffer.advanceAt(i) / 2; -} - -void Font::drawEmphasisMarks(GraphicsContext* context, - const TextRunPaintInfo& runInfo, - const GlyphBuffer& glyphBuffer, - const AtomicString& mark, - const FloatPoint& point) const { - FontCachePurgePreventer purgePreventer; - - GlyphData markGlyphData; - if (!getEmphasisMarkGlyphData(mark, markGlyphData)) - return; - - const SimpleFontData* markFontData = markGlyphData.fontData; - ASSERT(markFontData); - if (!markFontData) - return; - - Glyph markGlyph = markGlyphData.glyph; - Glyph spaceGlyph = markFontData->spaceGlyph(); - - float middleOfLastGlyph = offsetToMiddleOfAdvanceAtIndex(glyphBuffer, 0); - FloatPoint startPoint(point.x() + middleOfLastGlyph - - offsetToMiddleOfGlyph(markFontData, markGlyph), - point.y()); - - GlyphBuffer markBuffer; - for (unsigned i = 0; i + 1 < glyphBuffer.size(); ++i) { - float middleOfNextGlyph = - offsetToMiddleOfAdvanceAtIndex(glyphBuffer, i + 1); - float advance = - glyphBuffer.advanceAt(i) - middleOfLastGlyph + middleOfNextGlyph; - markBuffer.add(glyphBuffer.glyphAt(i) ? markGlyph : spaceGlyph, - markFontData, advance); - middleOfLastGlyph = middleOfNextGlyph; - } - markBuffer.add( - glyphBuffer.glyphAt(glyphBuffer.size() - 1) ? markGlyph : spaceGlyph, - markFontData, 0); - - drawGlyphBuffer(context, runInfo, markBuffer, startPoint); -} - -float Font::floatWidthForSimpleText( - const TextRun& run, - HashSet* fallbackFonts, - IntRectExtent* glyphBounds) const { - WidthIterator it(this, run, fallbackFonts, glyphBounds); - it.advance(run.length()); - - if (glyphBounds) { - glyphBounds->setTop(floorf(-it.minGlyphBoundingBoxY())); - glyphBounds->setBottom(ceilf(it.maxGlyphBoundingBoxY())); - glyphBounds->setLeft(floorf(it.firstGlyphOverflow())); - glyphBounds->setRight(ceilf(it.lastGlyphOverflow())); - } - - return it.m_runWidthSoFar; -} - -FloatRect Font::pixelSnappedSelectionRect(float fromX, - float toX, - float y, - float height) { - // Using roundf() rather than ceilf() for the right edge as a compromise to - // ensure correct caret positioning. - float roundedX = roundf(fromX); - return FloatRect(roundedX, y, roundf(toX - roundedX), height); -} - -FloatRect Font::selectionRectForSimpleText(const TextRun& run, - const FloatPoint& point, - int h, - int from, - int to, - bool accountForGlyphBounds) const { - WidthIterator it(this, run, 0, accountForGlyphBounds); - it.advance(from); - float fromX = it.m_runWidthSoFar; - it.advance(to); - float toX = it.m_runWidthSoFar; - - if (run.rtl()) { - it.advance(run.length()); - float totalWidth = it.m_runWidthSoFar; - float beforeWidth = fromX; - float afterWidth = toX; - fromX = totalWidth - afterWidth; - toX = totalWidth - beforeWidth; - } - - return pixelSnappedSelectionRect( - point.x() + fromX, point.x() + toX, - accountForGlyphBounds ? it.minGlyphBoundingBoxY() : point.y(), - accountForGlyphBounds - ? it.maxGlyphBoundingBoxY() - it.minGlyphBoundingBoxY() - : h); -} - -int Font::offsetForPositionForSimpleText(const TextRun& run, - float x, - bool includePartialGlyphs) const { - float delta = x; - - WidthIterator it(this, run); - unsigned offset; - if (run.rtl()) { - delta -= floatWidthForSimpleText(run); - while (1) { - offset = it.m_currentCharacter; - float w; - if (!it.advanceOneCharacter(w)) - break; - delta += w; - if (includePartialGlyphs) { - if (delta - w / 2 >= 0) - break; - } else { - if (delta >= 0) - break; - } - } - } else { - while (1) { - offset = it.m_currentCharacter; - float w; - if (!it.advanceOneCharacter(w)) - break; - delta -= w; - if (includePartialGlyphs) { - if (delta + w / 2 <= 0) - break; - } else { - if (delta <= 0) - break; - } - } - } - - return offset; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/Font.h b/sky/engine/platform/fonts/Font.h deleted file mode 100644 index 3f37f19df201a..0000000000000 --- a/sky/engine/platform/fonts/Font.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2006, 2007, 2010, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2008 Holger Hans Peter Freyther - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONT_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONT_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/platform/fonts/TextBlob.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" -#include "flutter/sky/engine/platform/text/TextPath.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -// "X11/X.h" defines Complex to 0 and conflicts -// with Complex value in CodePath enum. -#ifdef Complex -#undef Complex -#endif - -class SkTextBlob; -struct SkPoint; - -namespace blink { - -class FloatPoint; -class FloatRect; -class FontData; -class FontMetrics; -class FontSelector; -class GlyphBuffer; -class GraphicsContext; -class TextRun; -struct TextRunPaintInfo; - -struct GlyphData; - -struct GlyphOverflow { - GlyphOverflow() - : left(0), right(0), top(0), bottom(0), computeBounds(false) {} - - bool isZero() const { return !left && !right && !top && !bottom; } - - int left; - int right; - int top; - int bottom; - bool computeBounds; -}; - -class PLATFORM_EXPORT Font { - public: - Font(); - Font(const FontDescription&); - ~Font(); - - Font(const Font&); - Font& operator=(const Font&); - - bool operator==(const Font& other) const; - bool operator!=(const Font& other) const { return !(*this == other); } - - const FontDescription& fontDescription() const { return m_fontDescription; } - - void update(PassRefPtr) const; - - enum CustomFontNotReadyAction { - DoNotPaintIfFontNotReady, - UseFallbackIfFontNotReady - }; - void drawText(GraphicsContext*, - const TextRunPaintInfo&, - const FloatPoint&) const; - float drawUncachedText(GraphicsContext*, - const TextRunPaintInfo&, - const FloatPoint&, - CustomFontNotReadyAction) const; - void drawEmphasisMarks(GraphicsContext*, - const TextRunPaintInfo&, - const AtomicString& mark, - const FloatPoint&) const; - - float width(const TextRun&, - HashSet* fallbackFonts = 0, - GlyphOverflow* = 0) const; - float width(const TextRun&, int& charsConsumed, Glyph& glyphId) const; - - int offsetForPosition(const TextRun&, - float position, - bool includePartialGlyphs) const; - FloatRect selectionRectForText(const TextRun&, - const FloatPoint&, - int h, - int from = 0, - int to = -1, - bool accountForGlyphBounds = false) const; - - bool isFixedPitch() const; - - // Metrics that we query the FontFallbackList for. - const FontMetrics& fontMetrics() const { - return primaryFont()->fontMetrics(); - } - float spaceWidth() const { - return primaryFont()->spaceWidth() + fontDescription().letterSpacing(); - } - float tabWidth(const SimpleFontData&, unsigned tabSize, float position) const; - float tabWidth(unsigned tabSize, float position) const { - return tabWidth(*primaryFont(), tabSize, position); - } - - int emphasisMarkAscent(const AtomicString&) const; - int emphasisMarkDescent(const AtomicString&) const; - int emphasisMarkHeight(const AtomicString&) const; - - const SimpleFontData* primaryFont() const; - const FontData* fontDataAt(unsigned) const; - inline GlyphData glyphDataForCharacter( - UChar32 c, - bool mirror, - FontDataVariant variant = AutoVariant) const { - return glyphDataAndPageForCharacter(c, mirror, variant).first; - } - std::pair glyphDataAndPageForCharacter( - UChar32, - bool mirror, - FontDataVariant = AutoVariant) const; - bool primaryFontHasGlyphForCharacter(UChar32) const; - - CodePath codePath(const TextRun&) const; - - private: - enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; - - // Returns the initial in-stream advance. - float buildGlyphBuffer(const TextRunPaintInfo&, - GlyphBuffer&, - ForTextEmphasisOrNot = NotForTextEmphasis) const; - TextBlobPtr buildTextBlob(const GlyphBuffer&, - float initialAdvance, - const FloatRect& bounds) const; - void drawGlyphs(GraphicsContext*, - const SimpleFontData*, - const GlyphBuffer&, - unsigned from, - unsigned numGlyphs, - const FloatPoint&, - const FloatRect& textRect) const; - void drawTextBlob(GraphicsContext*, - const SkTextBlob*, - const SkPoint& origin) const; - float drawGlyphBuffer(GraphicsContext*, - const TextRunPaintInfo&, - const GlyphBuffer&, - const FloatPoint&) const; - void drawEmphasisMarks(GraphicsContext*, - const TextRunPaintInfo&, - const GlyphBuffer&, - const AtomicString&, - const FloatPoint&) const; - float floatWidthForSimpleText( - const TextRun&, - HashSet* fallbackFonts = 0, - IntRectExtent* glyphBounds = 0) const; - int offsetForPositionForSimpleText(const TextRun&, - float position, - bool includePartialGlyphs) const; - FloatRect selectionRectForSimpleText(const TextRun&, - const FloatPoint&, - int h, - int from, - int to, - bool accountForGlyphBounds) const; - - bool getEmphasisMarkGlyphData(const AtomicString&, GlyphData&) const; - - float floatWidthForComplexText(const TextRun&, - HashSet* fallbackFonts, - IntRectExtent* glyphBounds) const; - int offsetForPositionForComplexText(const TextRun&, - float position, - bool includePartialGlyphs) const; - FloatRect selectionRectForComplexText(const TextRun&, - const FloatPoint&, - int h, - int from, - int to) const; - - friend struct WidthIterator; - - public: - // Useful for debugging the different font rendering code paths. - static void setCodePath(CodePath); - static CodePath codePath(); - static CodePath s_codePath; - - FontSelector* fontSelector() const; - - FontFallbackList* fontList() const { return m_fontFallbackList.get(); } - - void willUseFontData(UChar32) const; - - static FloatRect pixelSnappedSelectionRect(float fromX, - float toX, - float y, - float height); - - private: - bool loadingCustomFonts() const { - return m_fontFallbackList && m_fontFallbackList->loadingCustomFonts(); - } - - bool shouldSkipDrawing() const { - return m_fontFallbackList && m_fontFallbackList->shouldSkipDrawing(); - } - - FontDescription m_fontDescription; - mutable RefPtr m_fontFallbackList; -}; - -inline Font::~Font() {} - -inline const SimpleFontData* Font::primaryFont() const { - ASSERT(m_fontFallbackList); - return m_fontFallbackList->primarySimpleFontData(m_fontDescription); -} - -inline const FontData* Font::fontDataAt(unsigned index) const { - ASSERT(m_fontFallbackList); - return m_fontFallbackList->fontDataAt(m_fontDescription, index); -} - -inline bool Font::isFixedPitch() const { - ASSERT(m_fontFallbackList); - return m_fontFallbackList->isFixedPitch(m_fontDescription); -} - -inline FontSelector* Font::fontSelector() const { - return m_fontFallbackList ? m_fontFallbackList->fontSelector() : 0; -} - -inline float Font::tabWidth(const SimpleFontData& fontData, - unsigned tabSize, - float position) const { - if (!tabSize) - return fontDescription().letterSpacing(); - float tabWidth = - tabSize * fontData.spaceWidth() + fontDescription().letterSpacing(); - return tabWidth - fmodf(position, tabWidth); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONT_H_ diff --git a/sky/engine/platform/fonts/FontBaseline.h b/sky/engine/platform/fonts/FontBaseline.h deleted file mode 100644 index 12e799a2afad6..0000000000000 --- a/sky/engine/platform/fonts/FontBaseline.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTBASELINE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTBASELINE_H_ - -namespace blink { - -enum FontBaseline { AlphabeticBaseline, IdeographicBaseline }; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTBASELINE_H_ diff --git a/sky/engine/platform/fonts/FontCache.cpp b/sky/engine/platform/fonts/FontCache.cpp deleted file mode 100644 index 7279685ff92f9..0000000000000 --- a/sky/engine/platform/fonts/FontCache.cpp +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2007 Nicholas Shanks - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontCache.h" - -#include "flutter/sky/engine/platform/fonts/AlternateFontFamily.h" -#include "flutter/sky/engine/platform/fonts/FontCacheClient.h" -#include "flutter/sky/engine/platform/fonts/FontCacheKey.h" -#include "flutter/sky/engine/platform/fonts/FontDataCache.h" -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" -#include "flutter/sky/engine/platform/fonts/FontSmoothingMode.h" -#include "flutter/sky/engine/platform/fonts/TextRenderingMode.h" -#include "flutter/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/ListHashSet.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/text/AtomicStringHash.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" - -using namespace WTF; - -namespace blink { - -#if !OS(WIN) -FontCache::FontCache() : m_purgePreventCount(0) {} -#endif - -typedef HashMap, - FontCacheKeyHash, - FontCacheKeyTraits> - FontPlatformDataCache; - -static FontPlatformDataCache* gFontPlatformDataCache = 0; - -#if OS(WIN) -bool FontCache::s_useDirectWrite = false; -IDWriteFactory* FontCache::s_directWriteFactory = 0; -bool FontCache::s_useSubpixelPositioning = false; -float FontCache::s_deviceScaleFactor = 1.0; -#endif - -FontCache* FontCache::fontCache() { - DEFINE_STATIC_LOCAL(FontCache, globalFontCache, ()); - return &globalFontCache; -} - -FontPlatformData* FontCache::getFontPlatformData( - const FontDescription& fontDescription, - const FontFaceCreationParams& creationParams, - bool checkingAlternateName) { - if (!gFontPlatformDataCache) { - gFontPlatformDataCache = new FontPlatformDataCache; - platformInit(); - } - - FontCacheKey key = fontDescription.cacheKey(creationParams); - FontPlatformData* result = 0; - bool foundResult; - FontPlatformDataCache::iterator it = gFontPlatformDataCache->find(key); - if (it == gFontPlatformDataCache->end()) { - result = createFontPlatformData(fontDescription, creationParams, - fontDescription.effectiveFontSize()); - gFontPlatformDataCache->set(key, adoptPtr(result)); - foundResult = result; - } else { - result = it->value.get(); - foundResult = true; - } - - if (!foundResult && !checkingAlternateName && - creationParams.creationType() == CreateFontByFamily) { - // We were unable to find a font. We have a small set of fonts that we alias - // to other names, e.g., Arial/Helvetica, Courier/Courier New, etc. Try - // looking up the font under the aliased name. - const AtomicString& alternateName = - alternateFamilyName(creationParams.family()); - if (!alternateName.isEmpty()) { - FontFaceCreationParams createByAlternateFamily(alternateName); - result = - getFontPlatformData(fontDescription, createByAlternateFamily, true); - } - if (result) - gFontPlatformDataCache->set( - key, adoptPtr(new FontPlatformData( - *result))); // Cache the result under the old name. - } - - return result; -} - -#if ENABLE(OPENTYPE_VERTICAL) -typedef HashMap, - IntHash, - UnsignedWithZeroKeyHashTraits> - FontVerticalDataCache; - -FontVerticalDataCache& fontVerticalDataCacheInstance() { - DEFINE_STATIC_LOCAL(FontVerticalDataCache, fontVerticalDataCache, ()); - return fontVerticalDataCache; -} - -PassRefPtr FontCache::getVerticalData( - const FontFileKey& key, - const FontPlatformData& platformData) { - FontVerticalDataCache& fontVerticalDataCache = - fontVerticalDataCacheInstance(); - FontVerticalDataCache::iterator result = fontVerticalDataCache.find(key); - if (result != fontVerticalDataCache.end()) - return result.get()->value; - - RefPtr verticalData = - OpenTypeVerticalData::create(platformData); - if (!verticalData->isOpenType()) - verticalData.clear(); - fontVerticalDataCache.set(key, verticalData); - return verticalData; -} -#endif - -static FontDataCache* gFontDataCache = 0; - -PassRefPtr FontCache::getFontData( - const FontDescription& fontDescription, - const AtomicString& family, - bool checkingAlternateName, - ShouldRetain shouldRetain) { - if (FontPlatformData* platformData = getFontPlatformData( - fontDescription, - FontFaceCreationParams( - adjustFamilyNameToAvoidUnsupportedFonts(family)), - checkingAlternateName)) - return fontDataFromFontPlatformData(platformData, shouldRetain); - - return nullptr; -} - -PassRefPtr FontCache::fontDataFromFontPlatformData( - const FontPlatformData* platformData, - ShouldRetain shouldRetain) { - if (!gFontDataCache) - gFontDataCache = new FontDataCache; - -#if ENABLE(ASSERT) - if (shouldRetain == DoNotRetain) - ASSERT(m_purgePreventCount); -#endif - - return gFontDataCache->get(platformData, shouldRetain); -} - -bool FontCache::isPlatformFontAvailable(const FontDescription& fontDescription, - const AtomicString& family) { - bool checkingAlternateName = true; - return getFontPlatformData( - fontDescription, - FontFaceCreationParams(adjustFamilyNameToAvoidUnsupportedFonts(family)), - checkingAlternateName); -} - -SimpleFontData* FontCache::getNonRetainedLastResortFallbackFont( - const FontDescription& fontDescription) { - return getLastResortFallbackFont(fontDescription, DoNotRetain).leakRef(); -} - -void FontCache::releaseFontData(const SimpleFontData* fontData) { - ASSERT(gFontDataCache); - - gFontDataCache->release(fontData); -} - -static inline void purgePlatformFontDataCache() { - if (!gFontPlatformDataCache) - return; - - Vector keysToRemove; - keysToRemove.reserveInitialCapacity(gFontPlatformDataCache->size()); - FontPlatformDataCache::iterator platformDataEnd = - gFontPlatformDataCache->end(); - for (FontPlatformDataCache::iterator platformData = - gFontPlatformDataCache->begin(); - platformData != platformDataEnd; ++platformData) { - if (platformData->value && - !gFontDataCache->contains(platformData->value.get())) - keysToRemove.append(platformData->key); - } - gFontPlatformDataCache->removeAll(keysToRemove); -} - -static inline void purgeFontVerticalDataCache() { -#if ENABLE(OPENTYPE_VERTICAL) - FontVerticalDataCache& fontVerticalDataCache = - fontVerticalDataCacheInstance(); - if (!fontVerticalDataCache.isEmpty()) { - // Mark & sweep unused verticalData - FontVerticalDataCache::iterator verticalDataEnd = - fontVerticalDataCache.end(); - for (FontVerticalDataCache::iterator verticalData = - fontVerticalDataCache.begin(); - verticalData != verticalDataEnd; ++verticalData) { - if (verticalData->value) - verticalData->value->setInFontCache(false); - } - - gFontDataCache->markAllVerticalData(); - - Vector keysToRemove; - keysToRemove.reserveInitialCapacity(fontVerticalDataCache.size()); - for (FontVerticalDataCache::iterator verticalData = - fontVerticalDataCache.begin(); - verticalData != verticalDataEnd; ++verticalData) { - if (!verticalData->value || !verticalData->value->inFontCache()) - keysToRemove.append(verticalData->key); - } - fontVerticalDataCache.removeAll(keysToRemove); - } -#endif -} - -void FontCache::purge(PurgeSeverity PurgeSeverity) { - // We should never be forcing the purge while the FontCachePurgePreventer is - // in scope. - ASSERT(!m_purgePreventCount || PurgeSeverity == PurgeIfNeeded); - if (m_purgePreventCount) - return; - - if (!gFontDataCache || !gFontDataCache->purge(PurgeSeverity)) - return; - - purgePlatformFontDataCache(); - purgeFontVerticalDataCache(); -} - -static bool invalidateFontCache = false; - -HashSet>& fontCacheClients() { - DEFINE_STATIC_LOCAL(OwnPtr>>, clients, - (adoptPtr(new HashSet>()))); - invalidateFontCache = true; - return *clients; -} - -void FontCache::addClient(FontCacheClient* client) { - ASSERT(!fontCacheClients().contains(client)); - fontCacheClients().add(client); -} - -#if !ENABLE(OILPAN) -void FontCache::removeClient(FontCacheClient* client) { - ASSERT(fontCacheClients().contains(client)); - fontCacheClients().remove(client); -} -#endif - -static unsigned short gGeneration = 0; - -unsigned short FontCache::generation() { - return gGeneration; -} - -void FontCache::invalidate() { - if (!invalidateFontCache) { - ASSERT(!gFontPlatformDataCache); - return; - } - - if (gFontPlatformDataCache) { - delete gFontPlatformDataCache; - gFontPlatformDataCache = new FontPlatformDataCache; - } - - gGeneration++; - - Vector> clients; - size_t numClients = fontCacheClients().size(); - clients.reserveInitialCapacity(numClients); - HashSet>::iterator end = fontCacheClients().end(); - for (HashSet>::iterator it = - fontCacheClients().begin(); - it != end; ++it) - clients.append(*it); - - ASSERT(numClients == clients.size()); - for (size_t i = 0; i < numClients; ++i) - clients[i]->fontCacheInvalidated(); - - purge(ForcePurge); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontCache.h b/sky/engine/platform/fonts/FontCache.h deleted file mode 100644 index 13cc904fa87e8..0000000000000 --- a/sky/engine/platform/fonts/FontCache.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2007-2008 Torch Mobile, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTCACHE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTCACHE_H_ - -#include -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/FontFaceCreationParams.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" -#include "third_party/skia/include/core/SkRefCnt.h" - -#if OS(WIN) -#include "SkFontMgr.h" -struct IDWriteFactory; -#endif - -#if OS(ANDROID) -#include -#endif - -class SkTypeface; - -namespace blink { - -class FontCacheClient; -class FontFaceCreationParams; -class FontPlatformData; -class FontDescription; -class OpenTypeVerticalData; -class SimpleFontData; - -enum ShouldRetain { Retain, DoNotRetain }; -enum PurgeSeverity { PurgeIfNeeded, ForcePurge }; - -class PLATFORM_EXPORT FontCache { - friend class FontCachePurgePreventer; - - WTF_MAKE_NONCOPYABLE(FontCache); - WTF_MAKE_FAST_ALLOCATED; - - public: - static FontCache* fontCache(); - - void releaseFontData(const SimpleFontData*); - - // This method is implemented by the plaform and used by - // FontFastPath to lookup the font for a given character. - PassRefPtr fallbackFontForCharacter( - const FontDescription&, - UChar32, - const SimpleFontData* fontDataToSubstitute); - - // Also implemented by the platform. - void platformInit(); - - PassRefPtr getFontData(const FontDescription&, - const AtomicString&, - bool checkingAlternateName = false, - ShouldRetain = Retain); - PassRefPtr getLastResortFallbackFont(const FontDescription&, - ShouldRetain = Retain); - SimpleFontData* getNonRetainedLastResortFallbackFont(const FontDescription&); - bool isPlatformFontAvailable(const FontDescription&, const AtomicString&); - - void addClient(FontCacheClient*); -#if !ENABLE(OILPAN) - void removeClient(FontCacheClient*); -#endif - - unsigned short generation(); - void invalidate(); - -#if OS(WIN) - bool useSubpixelPositioning() const { return s_useSubpixelPositioning; } - SkFontMgr* fontManager() { return m_fontManager.get(); } - static bool useDirectWrite() { return s_useDirectWrite; } - static float deviceScaleFactor() { return s_deviceScaleFactor; } - static void setUseDirectWrite(bool useDirectWrite) { - s_useDirectWrite = useDirectWrite; - } - static void setDirectWriteFactory(IDWriteFactory* factory) { - s_directWriteFactory = factory; - } - static void setDeviceScaleFactor(float deviceScaleFactor) { - s_deviceScaleFactor = deviceScaleFactor; - } - static void setUseSubpixelPositioning(bool useSubpixelPositioning) { - s_useSubpixelPositioning = useSubpixelPositioning; - } - static void addSideloadedFontForTesting(SkTypeface*); - // Functions to cache and retrieve the system font metrics. - static void setMenuFontMetrics(const wchar_t* familyName, int32_t fontHeight); - static void setSmallCaptionFontMetrics(const wchar_t* familyName, - int32_t fontHeight); - static void setStatusFontMetrics(const wchar_t* familyName, - int32_t fontHeight); - static int32_t menuFontHeight() { return s_menuFontHeight; } - static const AtomicString& menuFontFamily() { - return *s_smallCaptionFontFamilyName; - } - static int32_t smallCaptionFontHeight() { return s_smallCaptionFontHeight; } - static const AtomicString& smallCaptionFontFamily() { - return *s_smallCaptionFontFamilyName; - } - static int32_t statusFontHeight() { return s_statusFontHeight; } - static const AtomicString& statusFontFamily() { - return *s_statusFontFamilyName; - } -#endif - -#if ENABLE(OPENTYPE_VERTICAL) - typedef uint32_t FontFileKey; - PassRefPtr getVerticalData(const FontFileKey&, - const FontPlatformData&); -#endif - -#if !OS(ANDROID) && !OS(IOS) - struct PlatformFallbackFont { - String name; - CString filename; - int fontconfigInterfaceId; - int ttcIndex; - bool isBold; - bool isItalic; - }; - static void getFontForCharacter(UChar32, - const char* preferredLocale, - PlatformFallbackFont*); -#endif - - private: - FontCache(); - ~FontCache(); - - void purge(PurgeSeverity = PurgeIfNeeded); - - void disablePurging() { m_purgePreventCount++; } - void enablePurging() { - ASSERT(m_purgePreventCount); - if (!--m_purgePreventCount) - purge(PurgeIfNeeded); - } - - // FIXME: This method should eventually be removed. - FontPlatformData* getFontPlatformData(const FontDescription&, - const FontFaceCreationParams&, - bool checkingAlternateName = false); - - // These methods are implemented by each platform. - FontPlatformData* createFontPlatformData(const FontDescription&, - const FontFaceCreationParams&, - float fontSize); - - // Implemented on skia platforms. - sk_sp createTypeface(const FontDescription&, - const FontFaceCreationParams&, - CString& name); - - PassRefPtr fontDataFromFontPlatformData( - const FontPlatformData*, - ShouldRetain = Retain); - PassRefPtr fallbackOnStandardFontStyle(const FontDescription&, - UChar32); - - // Don't purge if this count is > 0; - int m_purgePreventCount; - -#if OS(WIN) - sk_sp m_fontManager; - static bool s_useDirectWrite; - static IDWriteFactory* s_directWriteFactory; - static float s_deviceScaleFactor; - static bool s_useSubpixelPositioning; - static HashMap>* s_sideloadedFonts; - // The system font metrics cache. - static AtomicString* s_menuFontFamilyName; - static int32_t s_menuFontHeight; - static AtomicString* s_smallCaptionFontFamilyName; - static int32_t s_smallCaptionFontHeight; - static AtomicString* s_statusFontFamilyName; - static int32_t s_statusFontHeight; -#endif - -#if OS(ANDROID) - friend class ComplexTextController; -#endif - friend class SimpleFontData; // For fontDataFromFontPlatformData - friend class FontFallbackList; -}; - -class PLATFORM_EXPORT FontCachePurgePreventer { - public: - FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } - ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTCACHE_H_ diff --git a/sky/engine/platform/fonts/FontCacheClient.h b/sky/engine/platform/fonts/FontCacheClient.h deleted file mode 100644 index 2fb49c8fea34a..0000000000000 --- a/sky/engine/platform/fonts/FontCacheClient.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTCACHECLIENT_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTCACHECLIENT_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/heap/Handle.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -class PLATFORM_EXPORT FontCacheClient : public RefCounted { - public: - virtual ~FontCacheClient() {} - - virtual void fontCacheInvalidated() = 0; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTCACHECLIENT_H_ diff --git a/sky/engine/platform/fonts/FontCacheEmpty.cpp b/sky/engine/platform/fonts/FontCacheEmpty.cpp deleted file mode 100644 index 14b09683774bb..0000000000000 --- a/sky/engine/platform/fonts/FontCacheEmpty.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2016, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "lib/fxl/logging.h" - -namespace blink { - -void FontCache::getFontForCharacter(UChar32, - const char*, - FontCache::PlatformFallbackFont*) {} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontCacheKey.h b/sky/engine/platform/fonts/FontCacheKey.h deleted file mode 100644 index b3d952f466aab..0000000000000 --- a/sky/engine/platform/fonts/FontCacheKey.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name of Google Inc. nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTCACHEKEY_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTCACHEKEY_H_ - -#include "flutter/sky/engine/platform/fonts/FontFaceCreationParams.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/HashTableDeletedValueType.h" -#include "flutter/sky/engine/wtf/text/AtomicStringHash.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" - -namespace blink { - -// Multiplying the floating point size by 100 gives two decimal point -// precision which should be sufficient. -static const unsigned s_fontSizePrecisionMultiplier = 100; - -struct FontCacheKey { - WTF_MAKE_FAST_ALLOCATED; - - public: - FontCacheKey() : m_creationParams(), m_fontSize(0), m_options(0) {} - FontCacheKey(FontFaceCreationParams creationParams, - float fontSize, - unsigned options) - : m_creationParams(creationParams), - m_fontSize(fontSize * s_fontSizePrecisionMultiplier), - m_options(options) {} - FontCacheKey(WTF::HashTableDeletedValueType) - : m_fontSize(hashTableDeletedSize()) {} - - unsigned hash() const { - unsigned hashCodes[3] = {m_creationParams.hash(), m_fontSize, m_options}; - return StringHasher::hashMemory(hashCodes); - } - - bool operator==(const FontCacheKey& other) const { - return m_creationParams == other.m_creationParams && - m_fontSize == other.m_fontSize && m_options == other.m_options; - } - - bool isHashTableDeletedValue() const { - return m_fontSize == hashTableDeletedSize(); - } - - static unsigned precisionMultiplier() { - return s_fontSizePrecisionMultiplier; - } - - private: - static unsigned hashTableDeletedSize() { return 0xFFFFFFFFU; } - - FontFaceCreationParams m_creationParams; - unsigned m_fontSize; - unsigned m_options; -}; - -struct FontCacheKeyHash { - static unsigned hash(const FontCacheKey& key) { return key.hash(); } - - static bool equal(const FontCacheKey& a, const FontCacheKey& b) { - return a == b; - } - - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -struct FontCacheKeyTraits : WTF::SimpleClassHashTraits {}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTCACHEKEY_H_ diff --git a/sky/engine/platform/fonts/FontCacheTest.cpp b/sky/engine/platform/fonts/FontCacheTest.cpp deleted file mode 100644 index 5ca51515ed732..0000000000000 --- a/sky/engine/platform/fonts/FontCacheTest.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/platform/fonts/FontCache.h" - -#include -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/public/platform/Platform.h" - -namespace blink { - -class EmptyPlatform : public Platform { - public: - EmptyPlatform() {} - virtual ~EmptyPlatform() {} -}; - -TEST(FontCache, getLastResortFallbackFont) { - FontCache* fontCache = FontCache::fontCache(); - ASSERT_TRUE(fontCache); - - Platform* oldPlatform = Platform::current(); - OwnPtr platform = adoptPtr(new EmptyPlatform); - Platform::initialize(platform.get()); - - FontDescription fontDescription; - fontDescription.setGenericFamily(FontDescription::StandardFamily); - RefPtr fontData = - fontCache->getLastResortFallbackFont(fontDescription, Retain); - EXPECT_TRUE(fontData); - - fontDescription.setGenericFamily(FontDescription::SansSerifFamily); - fontData = fontCache->getLastResortFallbackFont(fontDescription, Retain); - EXPECT_TRUE(fontData); - - Platform::initialize(oldPlatform); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontCustomPlatformData.h b/sky/engine/platform/fonts/FontCustomPlatformData.h deleted file mode 100644 index a0f6cf23e1767..0000000000000 --- a/sky/engine/platform/fonts/FontCustomPlatformData.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2007 Apple Computer, Inc. - * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTCUSTOMPLATFORMDATA_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTCUSTOMPLATFORMDATA_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/FontOrientation.h" -#include "flutter/sky/engine/platform/fonts/FontWidthVariant.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "third_party/skia/include/core/SkRefCnt.h" - -class SkTypeface; - -namespace blink { - -class FontPlatformData; -class SharedBuffer; - -class PLATFORM_EXPORT FontCustomPlatformData { - WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); - - public: - static PassOwnPtr create(SharedBuffer*); - ~FontCustomPlatformData(); - - FontPlatformData fontPlatformData(float size, - bool bold, - bool italic, - FontOrientation = Horizontal, - FontWidthVariant = RegularWidth); - - static bool supportsFormat(const String&); - - private: - explicit FontCustomPlatformData(sk_sp); - sk_sp m_typeface; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTCUSTOMPLATFORMDATA_H_ diff --git a/sky/engine/platform/fonts/FontData.cpp b/sky/engine/platform/fonts/FontData.cpp deleted file mode 100644 index 9e66f5ae82860..0000000000000 --- a/sky/engine/platform/fonts/FontData.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontData.h" - -namespace blink { - -FontData::~FontData() {} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontData.h b/sky/engine/platform/fonts/FontData.h deleted file mode 100644 index 3805253b7edb9..0000000000000 --- a/sky/engine/platform/fonts/FontData.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTDATA_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTDATA_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -class SimpleFontData; - -class PLATFORM_EXPORT FontData : public RefCounted { - WTF_MAKE_NONCOPYABLE(FontData); - WTF_MAKE_FAST_ALLOCATED; - - public: - FontData() : m_maxGlyphPageTreeLevel(0) {} - - virtual ~FontData(); - - virtual const SimpleFontData* fontDataForCharacter(UChar32) const = 0; - virtual bool isCustomFont() const = 0; - virtual bool isLoading() const = 0; - // Returns whether this is a temporary font data for a custom font which is - // not yet loaded. - virtual bool isLoadingFallback() const = 0; - virtual bool isSegmented() const = 0; - virtual bool shouldSkipDrawing() const = 0; - - void setMaxGlyphPageTreeLevel(unsigned level) const { - m_maxGlyphPageTreeLevel = level; - } - unsigned maxGlyphPageTreeLevel() const { return m_maxGlyphPageTreeLevel; } - -#ifndef NDEBUG - virtual String description() const = 0; -#endif - - private: - mutable unsigned m_maxGlyphPageTreeLevel; -}; - -#define DEFINE_FONT_DATA_TYPE_CASTS(thisType, predicate) \ - template \ - inline thisType* to##thisType(const RefPtr& fontData) { \ - return to##thisType(fontData.get()); \ - } \ - DEFINE_TYPE_CASTS(thisType, FontData, fontData, \ - fontData->isSegmented() == predicate, \ - fontData.isSegmented() == predicate) - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTDATA_H_ diff --git a/sky/engine/platform/fonts/FontDataCache.cpp b/sky/engine/platform/fonts/FontDataCache.cpp deleted file mode 100644 index a9f6d8f2ad281..0000000000000 --- a/sky/engine/platform/fonts/FontDataCache.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontDataCache.h" - -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" - -using namespace WTF; - -namespace blink { - -#if !OS(ANDROID) -const unsigned cMaxInactiveFontData = 250; -const unsigned cTargetInactiveFontData = 200; -#else -const unsigned cMaxInactiveFontData = 225; -const unsigned cTargetInactiveFontData = 200; -#endif - -PassRefPtr FontDataCache::get( - const FontPlatformData* platformData, - ShouldRetain shouldRetain) { - if (!platformData) - return nullptr; - - Cache::iterator result = m_cache.find(*platformData); - if (result == m_cache.end()) { - pair, unsigned> newValue( - SimpleFontData::create(*platformData), shouldRetain == Retain ? 1 : 0); - m_cache.set(*platformData, newValue); - if (shouldRetain == DoNotRetain) - m_inactiveFontData.add(newValue.first); - return newValue.first.release(); - } - - if (!result.get()->value.second) { - ASSERT(m_inactiveFontData.contains(result.get()->value.first)); - m_inactiveFontData.remove(result.get()->value.first); - } - - if (shouldRetain == Retain) { - result.get()->value.second++; - } else if (!result.get()->value.second) { - // If shouldRetain is DoNotRetain and count is 0, we want to remove the - // fontData from m_inactiveFontData (above) and re-add here to update LRU - // position. - m_inactiveFontData.add(result.get()->value.first); - } - - return result.get()->value.first; -} - -bool FontDataCache::contains(const FontPlatformData* fontPlatformData) const { - return m_cache.contains(*fontPlatformData); -} - -void FontDataCache::release(const SimpleFontData* fontData) { - ASSERT(!fontData->isCustomFont()); - - Cache::iterator it = m_cache.find(fontData->platformData()); - ASSERT(it != m_cache.end()); - if (it == m_cache.end()) - return; - - ASSERT(it->value.second); - if (!--it->value.second) - m_inactiveFontData.add(it->value.first); -} - -void FontDataCache::markAllVerticalData() { -#if ENABLE(OPENTYPE_VERTICAL) - Cache::iterator end = m_cache.end(); - for (Cache::iterator fontData = m_cache.begin(); fontData != end; - ++fontData) { - OpenTypeVerticalData* verticalData = const_cast( - fontData->value.first->verticalData()); - if (verticalData) - verticalData->setInFontCache(true); - } -#endif -} - -bool FontDataCache::purge(PurgeSeverity PurgeSeverity) { - if (PurgeSeverity == ForcePurge) - return purgeLeastRecentlyUsed(INT_MAX); - - if (m_inactiveFontData.size() > cMaxInactiveFontData) - return purgeLeastRecentlyUsed(m_inactiveFontData.size() - - cTargetInactiveFontData); - - return false; -} - -bool FontDataCache::purgeLeastRecentlyUsed(int count) { - static bool isPurging; // Guard against reentry when e.g. a deleted FontData - // releases its small caps FontData. - if (isPurging) - return false; - - isPurging = true; - - Vector, 20> fontDataToDelete; - ListHashSet>::iterator end = m_inactiveFontData.end(); - ListHashSet>::iterator it = m_inactiveFontData.begin(); - for (int i = 0; i < count && it != end; ++it, ++i) { - RefPtr& fontData = *it.get(); - m_cache.remove(fontData->platformData()); - // We should not delete SimpleFontData here because deletion can modify - // m_inactiveFontData. See http://trac.webkit.org/changeset/44011 - fontDataToDelete.append(fontData); - } - - if (it == end) { - // Removed everything - m_inactiveFontData.clear(); - } else { - for (int i = 0; i < count; ++i) - m_inactiveFontData.remove(m_inactiveFontData.begin()); - } - - bool didWork = fontDataToDelete.size(); - - fontDataToDelete.clear(); - - isPurging = false; - - return didWork; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontDataCache.h b/sky/engine/platform/fonts/FontDataCache.h deleted file mode 100644 index cf879410670a6..0000000000000 --- a/sky/engine/platform/fonts/FontDataCache.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTDATACACHE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTDATACACHE_H_ - -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/ListHashSet.h" - -namespace blink { - -class SimpleFontData; - -struct FontDataCacheKeyHash { - static unsigned hash(const FontPlatformData& platformData) { - return platformData.hash(); - } - - static bool equal(const FontPlatformData& a, const FontPlatformData& b) { - return a == b; - } - - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -struct FontDataCacheKeyTraits : WTF::GenericHashTraits { - static const bool emptyValueIsZero = true; - static const bool needsDestruction = true; - static const FontPlatformData& emptyValue() { - DEFINE_STATIC_LOCAL(FontPlatformData, key, (0.f, false, false)); - return key; - } - static void constructDeletedValue(FontPlatformData& slot, bool) { - new (NotNull, &slot) FontPlatformData(WTF::HashTableDeletedValue); - } - static bool isDeletedValue(const FontPlatformData& value) { - return value.isHashTableDeletedValue(); - } -}; - -class FontDataCache { - public: - PassRefPtr get(const FontPlatformData*, - ShouldRetain = Retain); - bool contains(const FontPlatformData*) const; - void release(const SimpleFontData*); - - // This is used by FontVerticalDataCache to mark all items with vertical data - // that are currently in cache as "in cache", which is later used to sweep the - // FontVerticalDataCache. - void markAllVerticalData(); - - // Purges items in FontDataCache according to provided severity. - // Returns true if any removal of cache items actually occurred. - bool purge(PurgeSeverity); - - private: - bool purgeLeastRecentlyUsed(int count); - - typedef HashMap, unsigned>, - FontDataCacheKeyHash, - FontDataCacheKeyTraits> - Cache; - Cache m_cache; - ListHashSet> m_inactiveFontData; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTDATACACHE_H_ diff --git a/sky/engine/platform/fonts/FontDescription.cpp b/sky/engine/platform/fonts/FontDescription.cpp deleted file mode 100644 index 67581bad7a5c7..0000000000000 --- a/sky/engine/platform/fonts/FontDescription.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (C) 2007 Nicholas Shanks - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontDescription.h" - -#include "flutter/sky/engine/wtf/text/AtomicStringHash.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" - -namespace blink { - -struct SameSizeAsFontDescription { - FontFamily familyList; - RefPtr m_featureSettings; - String locale; - float sizes[4]; - // FXIME: Make them fit into one word. - uint32_t bitfields; - uint32_t bitfields2 : 7; -}; - -COMPILE_ASSERT(sizeof(FontDescription) == sizeof(SameSizeAsFontDescription), - FontDescription_should_stay_small); - -TypesettingFeatures FontDescription::s_defaultTypesettingFeatures = 0; - -bool FontDescription::s_useSubpixelTextPositioning = false; - -FontWeight FontDescription::lighterWeight(FontWeight weight) { - switch (weight) { - case FontWeight100: - case FontWeight200: - case FontWeight300: - case FontWeight400: - case FontWeight500: - return FontWeight100; - - case FontWeight600: - case FontWeight700: - return FontWeight400; - - case FontWeight800: - case FontWeight900: - return FontWeight700; - } - ASSERT_NOT_REACHED(); - return FontWeightNormal; -} - -FontWeight FontDescription::bolderWeight(FontWeight weight) { - switch (weight) { - case FontWeight100: - case FontWeight200: - case FontWeight300: - return FontWeight400; - - case FontWeight400: - case FontWeight500: - return FontWeight700; - - case FontWeight600: - case FontWeight700: - case FontWeight800: - case FontWeight900: - return FontWeight900; - } - ASSERT_NOT_REACHED(); - return FontWeightNormal; -} - -FontTraits FontDescription::traits() const { - return FontTraits(style(), variant(), weight(), stretch()); -} - -FontDescription::VariantLigatures FontDescription::variantLigatures() const { - VariantLigatures ligatures; - - ligatures.common = commonLigaturesState(); - ligatures.discretionary = discretionaryLigaturesState(); - ligatures.historical = historicalLigaturesState(); - ligatures.contextual = contextualLigaturesState(); - - return ligatures; -} - -void FontDescription::setTraits(FontTraits traits) { - setStyle(traits.style()); - setVariant(traits.variant()); - setWeight(traits.weight()); - setStretch(traits.stretch()); -} - -void FontDescription::setVariantLigatures(const VariantLigatures& ligatures) { - m_commonLigaturesState = ligatures.common; - m_discretionaryLigaturesState = ligatures.discretionary; - m_historicalLigaturesState = ligatures.historical; - m_contextualLigaturesState = ligatures.contextual; - - updateTypesettingFeatures(); -} - -float FontDescription::effectiveFontSize() const { - float size = computedSize(); - - // Ensure that the effective precision matches the font-cache precision. - // This guarantees that the same precision is used regardless of cache status. - return floorf(size * FontCacheKey::precisionMultiplier()) / - FontCacheKey::precisionMultiplier(); -} - -FontCacheKey FontDescription::cacheKey( - const FontFaceCreationParams& creationParams, - FontTraits desiredTraits) const { - FontTraits fontTraits = desiredTraits.bitfield() ? desiredTraits : traits(); - - unsigned options = static_cast(m_syntheticItalic) << 7 | // bit 8 - static_cast(m_syntheticBold) << 6 | // bit 7 - static_cast(m_fontSmoothing) << 4 | // bits 5-6 - static_cast(m_textRendering) << 2 | // bits 3-4 - static_cast(m_orientation) << 1 | // bit 2 - static_cast(m_subpixelTextPosition); // bit 1 - - return FontCacheKey(creationParams, effectiveFontSize(), - options | fontTraits.bitfield() << 8); -} - -void FontDescription::setDefaultTypesettingFeatures( - TypesettingFeatures typesettingFeatures) { - s_defaultTypesettingFeatures = typesettingFeatures; -} - -TypesettingFeatures FontDescription::defaultTypesettingFeatures() { - return s_defaultTypesettingFeatures; -} - -void FontDescription::updateTypesettingFeatures() const { - m_typesettingFeatures = s_defaultTypesettingFeatures; - - switch (textRendering()) { - case AutoTextRendering: - break; - case OptimizeSpeed: - m_typesettingFeatures &= ~(blink::Kerning | Ligatures); - break; - case GeometricPrecision: - case OptimizeLegibility: - m_typesettingFeatures |= blink::Kerning | Ligatures; - break; - } - - switch (kerning()) { - case FontDescription::NoneKerning: - m_typesettingFeatures &= ~blink::Kerning; - break; - case FontDescription::NormalKerning: - m_typesettingFeatures |= blink::Kerning; - break; - case FontDescription::AutoKerning: - break; - } - - // As per CSS (http://dev.w3.org/csswg/css-text-3/#letter-spacing-property), - // When the effective letter-spacing between two characters is not zero (due - // to either justification or non-zero computed letter-spacing), user agents - // should not apply optional ligatures. - if (m_letterSpacing == 0) { - switch (commonLigaturesState()) { - case FontDescription::DisabledLigaturesState: - m_typesettingFeatures &= ~Ligatures; - break; - case FontDescription::EnabledLigaturesState: - m_typesettingFeatures |= Ligatures; - break; - case FontDescription::NormalLigaturesState: - break; - } - - if (discretionaryLigaturesState() == - FontDescription::EnabledLigaturesState || - historicalLigaturesState() == FontDescription::EnabledLigaturesState || - contextualLigaturesState() == FontDescription::EnabledLigaturesState) { - m_typesettingFeatures |= blink::Ligatures; - } - } -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontDescription.h b/sky/engine/platform/fonts/FontDescription.h deleted file mode 100644 index a3086cf593ff6..0000000000000 --- a/sky/engine/platform/fonts/FontDescription.h +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. - * All rights reserved. - * Copyright (C) 2007 Nicholas Shanks - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIother.m_ If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USm_ - * - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTDESCRIPTION_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTDESCRIPTION_H_ - -#include "flutter/sky/engine/platform/fonts/FixedPitchFontType.h" -#include "flutter/sky/engine/platform/fonts/FontCacheKey.h" -#include "flutter/sky/engine/platform/fonts/FontFamily.h" -#include "flutter/sky/engine/platform/fonts/FontFeatureSettings.h" -#include "flutter/sky/engine/platform/fonts/FontOrientation.h" -#include "flutter/sky/engine/platform/fonts/FontSmoothingMode.h" -#include "flutter/sky/engine/platform/fonts/FontTraits.h" -#include "flutter/sky/engine/platform/fonts/FontWidthVariant.h" -#include "flutter/sky/engine/platform/fonts/TextRenderingMode.h" -#include "flutter/sky/engine/platform/fonts/TypesettingFeatures.h" -#include "flutter/sky/engine/platform/text/NonCJKGlyphOrientation.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -#include "flutter/sky/engine/wtf/RefPtr.h" - -#include - -namespace blink { - -class PLATFORM_EXPORT FontDescription { - public: - enum GenericFamilyType { - NoFamily, - StandardFamily, - SerifFamily, - SansSerifFamily, - MonospaceFamily, - CursiveFamily, - FantasyFamily, - PictographFamily - }; - - enum Kerning { AutoKerning, NormalKerning, NoneKerning }; - - enum LigaturesState { - NormalLigaturesState, - DisabledLigaturesState, - EnabledLigaturesState - }; - - FontDescription() - : m_locale("en"), - m_specifiedSize(0), - m_computedSize(0), - m_letterSpacing(0), - m_wordSpacing(0), - m_orientation(Horizontal), - m_nonCJKGlyphOrientation(NonCJKGlyphOrientationVerticalRight), - m_widthVariant(RegularWidth), - m_style(FontStyleNormal), - m_variant(FontVariantNormal), - m_isAbsoluteSize(false), - m_weight(FontWeightNormal), - m_stretch(FontStretchNormal), - m_genericFamily(NoFamily), - m_kerning(AutoKerning), - m_commonLigaturesState(NormalLigaturesState), - m_discretionaryLigaturesState(NormalLigaturesState), - m_historicalLigaturesState(NormalLigaturesState), - m_contextualLigaturesState(NormalLigaturesState), - m_fontSmoothing(AutoSmoothing), - m_textRendering(AutoTextRendering), - m_script(USCRIPT_COMMON), - m_syntheticBold(false), - m_syntheticItalic(false), - m_subpixelTextPosition(s_useSubpixelTextPositioning), - m_typesettingFeatures(s_defaultTypesettingFeatures) {} - - bool operator==(const FontDescription&) const; - bool operator!=(const FontDescription& other) const { - return !(*this == other); - } - - struct VariantLigatures { - VariantLigatures() - : common(NormalLigaturesState), - discretionary(NormalLigaturesState), - historical(NormalLigaturesState), - contextual(NormalLigaturesState) {} - - unsigned common : 2; - unsigned discretionary : 2; - unsigned historical : 2; - unsigned contextual : 2; - }; - - const FontFamily& family() const { return m_familyList; } - FontFamily& firstFamily() { return m_familyList; } - float specifiedSize() const { return m_specifiedSize; } - float computedSize() const { return m_computedSize; } - FontStyle style() const { return static_cast(m_style); } - int computedPixelSize() const { return int(m_computedSize + 0.5f); } - FontVariant variant() const { return static_cast(m_variant); } - bool isAbsoluteSize() const { return m_isAbsoluteSize; } - FontWeight weight() const { return static_cast(m_weight); } - FontStretch stretch() const { return static_cast(m_stretch); } - static FontWeight lighterWeight(FontWeight); - static FontWeight bolderWeight(FontWeight); - GenericFamilyType genericFamily() const { - return static_cast(m_genericFamily); - } - - Kerning kerning() const { return static_cast(m_kerning); } - VariantLigatures variantLigatures() const; - LigaturesState commonLigaturesState() const { - return static_cast(m_commonLigaturesState); - } - LigaturesState discretionaryLigaturesState() const { - return static_cast(m_discretionaryLigaturesState); - } - LigaturesState historicalLigaturesState() const { - return static_cast(m_historicalLigaturesState); - } - LigaturesState contextualLigaturesState() const { - return static_cast(m_contextualLigaturesState); - } - FontSmoothingMode fontSmoothing() const { - return static_cast(m_fontSmoothing); - } - TextRenderingMode textRendering() const { - return static_cast(m_textRendering); - } - UScriptCode script() const { return static_cast(m_script); } - const String& locale() const { return m_locale; } - bool isSyntheticBold() const { return m_syntheticBold; } - bool isSyntheticItalic() const { return m_syntheticItalic; } - bool useSubpixelPositioning() const { return m_subpixelTextPosition; } - - FontTraits traits() const; - float wordSpacing() const { return m_wordSpacing; } - float letterSpacing() const { return m_letterSpacing; } - FontOrientation orientation() const { - return static_cast(m_orientation); - } - NonCJKGlyphOrientation nonCJKGlyphOrientation() const { - return static_cast(m_nonCJKGlyphOrientation); - } - FontWidthVariant widthVariant() const { - return static_cast(m_widthVariant); - } - FontFeatureSettings* featureSettings() const { - return m_featureSettings.get(); - } - - float effectiveFontSize() - const; // Returns either the computedSize or the computedPixelSize - FontCacheKey cacheKey(const FontFaceCreationParams&, - FontTraits desiredTraits = FontTraits(0)) const; - - void setFamily(const FontFamily& family) { m_familyList = family; } - void setComputedSize(float s) { m_computedSize = clampToFloat(s); } - void setSpecifiedSize(float s) { m_specifiedSize = clampToFloat(s); } - void setStyle(FontStyle i) { m_style = i; } - void setVariant(FontVariant c) { m_variant = c; } - void setVariantLigatures(const VariantLigatures&); - void setIsAbsoluteSize(bool s) { m_isAbsoluteSize = s; } - void setWeight(FontWeight w) { m_weight = w; } - void setStretch(FontStretch s) { m_stretch = s; } - void setGenericFamily(GenericFamilyType genericFamily) { - m_genericFamily = genericFamily; - } - void setKerning(Kerning kerning) { - m_kerning = kerning; - updateTypesettingFeatures(); - } - void setFontSmoothing(FontSmoothingMode smoothing) { - m_fontSmoothing = smoothing; - } - void setTextRendering(TextRenderingMode rendering) { - m_textRendering = rendering; - updateTypesettingFeatures(); - } - void setOrientation(FontOrientation orientation) { - m_orientation = orientation; - } - void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { - m_nonCJKGlyphOrientation = orientation; - } - void setWidthVariant(FontWidthVariant widthVariant) { - m_widthVariant = widthVariant; - } - void setScript(UScriptCode s) { m_script = s; } - void setLocale(const String& locale) { m_locale = locale; } - void setSyntheticBold(bool syntheticBold) { m_syntheticBold = syntheticBold; } - void setSyntheticItalic(bool syntheticItalic) { - m_syntheticItalic = syntheticItalic; - } - void setFeatureSettings(PassRefPtr settings) { - m_featureSettings = settings; - } - void setTraits(FontTraits); - void setWordSpacing(float s) { m_wordSpacing = s; } - void setLetterSpacing(float s) { m_letterSpacing = s; } - - TypesettingFeatures typesettingFeatures() const { - return static_cast(m_typesettingFeatures); - } - - static void setSubpixelPositioning(bool b) { - s_useSubpixelTextPositioning = b; - } - static bool subpixelPositioning() { return s_useSubpixelTextPositioning; } - - static void setDefaultTypesettingFeatures(TypesettingFeatures); - static TypesettingFeatures defaultTypesettingFeatures(); - - private: - FontFamily m_familyList; // The list of font families to be used. - RefPtr m_featureSettings; - String m_locale; - - void updateTypesettingFeatures() const; - - float m_specifiedSize; // Specified CSS value. Independent of rendering - // issues such as integer rounding, minimum font - // sizes. - float m_computedSize; // Computed size adjusted for the minimum font size. - - float m_letterSpacing; - float m_wordSpacing; - - unsigned m_orientation : 1; // FontOrientation - Whether the font is - // rendering on a horizontal line or a vertical - // line. - unsigned m_nonCJKGlyphOrientation : 1; // NonCJKGlyphOrientation - Only used - // by vertical text. Determines the - // default orientation for - // non-ideograph glyphs. - - unsigned m_widthVariant : 2; // FontWidthVariant - - unsigned m_style : 1; // FontStyle - unsigned m_variant : 1; // FontVariant - unsigned - m_isAbsoluteSize : 1; // Whether or not CSS specified an explicit size - // (logical sizes like "medium" don't count). - unsigned m_weight : 4; // FontWeight - unsigned m_stretch : 4; // FontStretch - unsigned m_genericFamily : 3; // GenericFamilyType - - unsigned m_kerning : 2; // Kerning - - unsigned m_commonLigaturesState : 2; - unsigned m_discretionaryLigaturesState : 2; - unsigned m_historicalLigaturesState : 2; - unsigned m_contextualLigaturesState : 2; - - unsigned m_fontSmoothing : 2; // FontSmoothingMode - unsigned m_textRendering : 2; // TextRenderingMode - unsigned m_script : 7; // Used to help choose an appropriate font for generic - // font families. - unsigned m_syntheticBold : 1; - unsigned m_syntheticItalic : 1; - unsigned m_subpixelTextPosition : 1; - - mutable unsigned m_typesettingFeatures : 2; // TypesettingFeatures - - static TypesettingFeatures s_defaultTypesettingFeatures; - - static bool s_useSubpixelTextPositioning; -}; - -inline bool FontDescription::operator==(const FontDescription& other) const { - return m_familyList == other.m_familyList && - m_specifiedSize == other.m_specifiedSize && - m_computedSize == other.m_computedSize && - m_letterSpacing == other.m_letterSpacing && - m_wordSpacing == other.m_wordSpacing && m_style == other.m_style && - m_variant == other.m_variant && - m_isAbsoluteSize == other.m_isAbsoluteSize && - m_weight == other.m_weight && m_stretch == other.m_stretch && - m_genericFamily == other.m_genericFamily && - m_kerning == other.m_kerning && - m_commonLigaturesState == other.m_commonLigaturesState && - m_discretionaryLigaturesState == other.m_discretionaryLigaturesState && - m_historicalLigaturesState == other.m_historicalLigaturesState && - m_contextualLigaturesState == other.m_contextualLigaturesState && - m_fontSmoothing == other.m_fontSmoothing && - m_textRendering == other.m_textRendering && - m_orientation == other.m_orientation && - m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation && - m_widthVariant == other.m_widthVariant && m_script == other.m_script && - m_syntheticBold == other.m_syntheticBold && - m_syntheticItalic == other.m_syntheticItalic && - m_featureSettings == other.m_featureSettings && - m_subpixelTextPosition == other.m_subpixelTextPosition; -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTDESCRIPTION_H_ diff --git a/sky/engine/platform/fonts/FontDescriptionTest.cpp b/sky/engine/platform/fonts/FontDescriptionTest.cpp deleted file mode 100644 index 412873a7203be..0000000000000 --- a/sky/engine/platform/fonts/FontDescriptionTest.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontDescription.h" - -#include - -namespace blink { - -static inline void assertDescriptionMatchesMask(FontDescription& source, - FontTraitsBitfield bitfield) { - FontDescription target; - target.setTraits(FontTraits(bitfield)); - EXPECT_EQ(source.style(), target.style()); - EXPECT_EQ(source.variant(), target.variant()); - EXPECT_EQ(source.weight(), target.weight()); - EXPECT_EQ(source.stretch(), target.stretch()); -} - -TEST(FontDescriptionTest, TestFontTraits) { - FontDescription source; - source.setStyle(FontStyleNormal); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeightNormal); - source.setStretch(FontStretchNormal); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleNormal); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeightNormal); - source.setStretch(FontStretchExtraCondensed); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeight900); - source.setStretch(FontStretchUltraExpanded); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantSmallCaps); - source.setWeight(FontWeight100); - source.setStretch(FontStretchExtraExpanded); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeight900); - source.setStretch(FontStretchNormal); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeight800); - source.setStretch(FontStretchNormal); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeight700); - source.setStretch(FontStretchNormal); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeight600); - source.setStretch(FontStretchNormal); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeight500); - source.setStretch(FontStretchNormal); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeight400); - source.setStretch(FontStretchNormal); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeight300); - source.setStretch(FontStretchUltraExpanded); - assertDescriptionMatchesMask(source, source.traits().bitfield()); - - source.setStyle(FontStyleItalic); - source.setVariant(FontVariantNormal); - source.setWeight(FontWeight200); - source.setStretch(FontStretchNormal); - assertDescriptionMatchesMask(source, source.traits().bitfield()); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontFaceCreationParams.h b/sky/engine/platform/fonts/FontFaceCreationParams.h deleted file mode 100644 index 047fa05b30f51..0000000000000 --- a/sky/engine/platform/fonts/FontFaceCreationParams.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2009, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTFACECREATIONPARAMS_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTFACECREATIONPARAMS_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/StringHasher.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" - -namespace blink { - -enum FontFaceCreationType { CreateFontByFamily, CreateFontByFciIdAndTtcIndex }; - -class FontFaceCreationParams { - FontFaceCreationType m_creationType; - AtomicString m_family; - CString m_filename; - int m_fontconfigInterfaceId; - int m_ttcIndex; - - public: - FontFaceCreationParams() - : m_creationType(CreateFontByFamily), - m_family(AtomicString()), - m_filename(CString()), - m_fontconfigInterfaceId(0), - m_ttcIndex(0) {} - - explicit FontFaceCreationParams(AtomicString family) - : m_creationType(CreateFontByFamily), - m_family(family), - m_filename(CString()), - m_fontconfigInterfaceId(0), - m_ttcIndex(0) {} - - FontFaceCreationParams(CString filename, - int fontconfigInterfaceId, - int ttcIndex = 0) - : m_creationType(CreateFontByFciIdAndTtcIndex), - m_filename(filename), - m_fontconfigInterfaceId(fontconfigInterfaceId), - m_ttcIndex(ttcIndex) {} - - FontFaceCreationType creationType() const { return m_creationType; } - AtomicString family() const { - ASSERT(m_creationType == CreateFontByFamily); - return m_family; - } - CString filename() const { - ASSERT(m_creationType == CreateFontByFciIdAndTtcIndex); - return m_filename; - } - int fontconfigInterfaceId() const { - ASSERT(m_creationType == CreateFontByFciIdAndTtcIndex); - return m_fontconfigInterfaceId; - } - int ttcIndex() const { - ASSERT(m_creationType == CreateFontByFciIdAndTtcIndex); - return m_ttcIndex; - } - - unsigned hash() const { - if (m_creationType == CreateFontByFciIdAndTtcIndex) { - StringHasher hasher; - // Hashing the filename and ints in this way is sensitive to character - // encoding and endianness. However, since the hash is not transferred - // over a network or permanently stored and only used for the runtime of - // Chromium, this is not a concern. - hasher.addCharacters(reinterpret_cast(m_filename.data()), - m_filename.length()); - hasher.addCharacters(reinterpret_cast(&m_ttcIndex), - sizeof(m_ttcIndex)); - hasher.addCharacters( - reinterpret_cast(&m_fontconfigInterfaceId), - sizeof(m_fontconfigInterfaceId)); - return hasher.hash(); - } - return CaseFoldingHash::hash(m_family.isEmpty() ? "" : m_family); - } - - bool operator==(const FontFaceCreationParams& other) const { - return m_creationType == other.m_creationType && - equalIgnoringCase(m_family, other.m_family) && - m_filename == other.m_filename && - m_fontconfigInterfaceId == other.m_fontconfigInterfaceId && - m_ttcIndex == other.m_ttcIndex; - } -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTFACECREATIONPARAMS_H_ diff --git a/sky/engine/platform/fonts/FontFallbackList.cpp b/sky/engine/platform/fonts/FontFallbackList.cpp deleted file mode 100644 index 4786d65e0d7ad..0000000000000 --- a/sky/engine/platform/fonts/FontFallbackList.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontFallbackList.h" - -#include "flutter/common/settings.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/platform/fonts/FontFamily.h" -#include "flutter/sky/engine/platform/fonts/SegmentedFontData.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -namespace blink { - -bool gUseTestFonts = false; -void FontFallbackList::SetUseTestFonts(bool useTestFonts) { - gUseTestFonts = useTestFonts; -} - -FontFallbackList::FontFallbackList() - : m_pageZero(0), - m_cachedPrimarySimpleFontData(0), - m_fontSelector(nullptr), - m_fontSelectorVersion(0), - m_familyIndex(0), - m_generation(FontCache::fontCache()->generation()), - m_pitch(UnknownPitch), - m_hasLoadingFallback(false), - m_useTestFonts(gUseTestFonts) {} - -void FontFallbackList::invalidate(PassRefPtr fontSelector) { - releaseFontData(); - m_fontList.clear(); - m_pageZero = 0; - m_pages.clear(); - m_cachedPrimarySimpleFontData = 0; - m_familyIndex = 0; - m_pitch = UnknownPitch; - m_hasLoadingFallback = false; - m_fontSelector = fontSelector; - m_fontSelectorVersion = m_fontSelector ? m_fontSelector->version() : 0; - m_generation = FontCache::fontCache()->generation(); - m_widthCache.clear(); -} - -void FontFallbackList::releaseFontData() { - unsigned numFonts = m_fontList.size(); - for (unsigned i = 0; i < numFonts; ++i) { - if (!m_fontList[i]->isCustomFont()) { - ASSERT(!m_fontList[i]->isSegmented()); - FontCache::fontCache()->releaseFontData(toSimpleFontData(m_fontList[i])); - } - } -} - -void FontFallbackList::determinePitch( - const FontDescription& fontDescription) const { - for (unsigned fontIndex = 0;; ++fontIndex) { - const FontData* fontData = fontDataAt(fontDescription, fontIndex); - if (!fontData) { - // All fonts are custom fonts and are loading. Fallback should be variable - // pitch. - m_pitch = VariablePitch; - break; - } - - const SimpleFontData* simpleFontData; - if (fontData->isSegmented()) { - const SegmentedFontData* segmentedFontData = - toSegmentedFontData(fontData); - if (segmentedFontData->numRanges() != 1 || - !segmentedFontData->rangeAt(0).isEntireRange()) { - m_pitch = VariablePitch; - break; - } - simpleFontData = segmentedFontData->rangeAt(0).fontData().get(); - } else { - simpleFontData = toSimpleFontData(fontData); - } - if (!fontData->isLoadingFallback()) { - m_pitch = simpleFontData->pitch(); - break; - } - } -} - -bool FontFallbackList::loadingCustomFonts() const { - if (!m_hasLoadingFallback) - return false; - - unsigned numFonts = m_fontList.size(); - for (unsigned i = 0; i < numFonts; ++i) { - if (m_fontList[i]->isLoading()) - return true; - } - return false; -} - -bool FontFallbackList::shouldSkipDrawing() const { - if (!m_hasLoadingFallback) - return false; - - unsigned numFonts = m_fontList.size(); - for (unsigned i = 0; i < numFonts; ++i) { - if (m_fontList[i]->shouldSkipDrawing()) - return true; - } - return false; -} - -const SimpleFontData* FontFallbackList::determinePrimarySimpleFontData( - const FontDescription& fontDescription) const { - bool shouldLoadCustomFont = true; - - for (unsigned fontIndex = 0;; ++fontIndex) { - const FontData* fontData = fontDataAt(fontDescription, fontIndex); - if (!fontData) { - // All fonts are custom fonts and are loading. Return the first FontData. - fontData = fontDataAt(fontDescription, 0); - if (fontData) - return fontData->fontDataForCharacter(space); - - SimpleFontData* lastResortFallback = - FontCache::fontCache() - ->getLastResortFallbackFont(fontDescription) - .get(); - ASSERT(lastResortFallback); - return lastResortFallback; - } - - if (fontData->isSegmented() && - !toSegmentedFontData(fontData)->containsCharacter(space)) - continue; - - const SimpleFontData* fontDataForSpace = - fontData->fontDataForCharacter(space); - ASSERT(fontDataForSpace); - - // When a custom font is loading, we should use the correct fallback font to - // layout the text. Here skip the temporary font for the loading custom font - // which may not act as the correct fallback font. - if (!fontDataForSpace->isLoadingFallback()) - return fontDataForSpace; - - if (fontData->isSegmented()) { - const SegmentedFontData* segmented = toSegmentedFontData(fontData); - for (unsigned i = 0; i < segmented->numRanges(); i++) { - const SimpleFontData* rangeFontData = - segmented->rangeAt(i).fontData().get(); - if (!rangeFontData->isLoadingFallback()) - return rangeFontData; - } - if (fontData->isLoading()) - shouldLoadCustomFont = false; - } - - // Begin to load the first custom font if needed. - if (shouldLoadCustomFont) { - shouldLoadCustomFont = false; - fontDataForSpace->customFontData()->beginLoadIfNeeded(); - } - } -} - -PassRefPtr FontFallbackList::getFontData( - const FontDescription& fontDescription, - int& familyIndex) const { - RefPtr result; - - int startIndex = familyIndex; - const FontFamily* startFamily = &fontDescription.family(); - for (int i = 0; startFamily && i < startIndex; i++) - startFamily = startFamily->next(); - const FontFamily* currFamily = startFamily; - while (currFamily && !result) { - familyIndex++; - if (currFamily->family().length() || m_useTestFonts) { - if (m_fontSelector) - result = - m_fontSelector->getFontData(fontDescription, currFamily->family()); - - if (!result) - result = FontCache::fontCache()->getFontData(fontDescription, - currFamily->family()); - } - currFamily = currFamily->next(); - } - - if (!currFamily) - familyIndex = cAllFamiliesScanned; - - if (result || startIndex) - return result.release(); - - // Still no result. Hand back our last resort fallback font. - return FontCache::fontCache()->getLastResortFallbackFont(fontDescription); -} - -const FontData* FontFallbackList::fontDataAt( - const FontDescription& fontDescription, - unsigned realizedFontIndex) const { - if (realizedFontIndex < m_fontList.size()) - return m_fontList[realizedFontIndex] - .get(); // This fallback font is already in our list. - - // Make sure we're not passing in some crazy value here. - ASSERT(realizedFontIndex == m_fontList.size()); - - if (m_familyIndex == cAllFamiliesScanned) - return 0; - - // Ask the font cache for the font data. - // We are obtaining this font for the first time. We keep track of the - // families we've looked at before in |m_familyIndex|, so that we never scan - // the same spot in the list twice. getFontData will adjust our - // |m_familyIndex| as it scans for the right font to make. - ASSERT(FontCache::fontCache()->generation() == m_generation); - RefPtr result = getFontData(fontDescription, m_familyIndex); - if (result) { - m_fontList.append(result); - if (result->isLoadingFallback()) - m_hasLoadingFallback = true; - } - return result.get(); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontFallbackList.h b/sky/engine/platform/fonts/FontFallbackList.h deleted file mode 100644 index 3331387968edc..0000000000000 --- a/sky/engine/platform/fonts/FontFallbackList.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTFALLBACKLIST_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTFALLBACKLIST_H_ - -#include "flutter/sky/engine/platform/fonts/FontSelector.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/platform/fonts/WidthCache.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/MainThread.h" - -namespace blink { - -class GlyphPageTreeNode; -class FontDescription; - -const int cAllFamiliesScanned = -1; - -class PLATFORM_EXPORT FontFallbackList : public RefCounted { - WTF_MAKE_NONCOPYABLE(FontFallbackList); - - public: - typedef HashMap::Hash> GlyphPages; - - class GlyphPagesStateSaver { - public: - GlyphPagesStateSaver(FontFallbackList& fallbackList) - : m_fallbackList(fallbackList), - m_pages(fallbackList.m_pages), - m_pageZero(fallbackList.m_pageZero) {} - - ~GlyphPagesStateSaver() { - m_fallbackList.m_pages = m_pages; - m_fallbackList.m_pageZero = m_pageZero; - } - - private: - FontFallbackList& m_fallbackList; - GlyphPages& m_pages; - GlyphPageTreeNode* m_pageZero; - }; - - static PassRefPtr create() { - return adoptRef(new FontFallbackList()); - } - - ~FontFallbackList() { releaseFontData(); } - void invalidate(PassRefPtr); - - bool isFixedPitch(const FontDescription& fontDescription) const { - if (m_pitch == UnknownPitch) - determinePitch(fontDescription); - return m_pitch == FixedPitch; - } - void determinePitch(const FontDescription&) const; - - bool loadingCustomFonts() const; - bool shouldSkipDrawing() const; - - FontSelector* fontSelector() const { return m_fontSelector.get(); } - // FIXME: It should be possible to combine fontSelectorVersion and generation. - unsigned fontSelectorVersion() const { return m_fontSelectorVersion; } - unsigned generation() const { return m_generation; } - - WidthCache& widthCache() const { return m_widthCache; } - - const SimpleFontData* primarySimpleFontData( - const FontDescription& fontDescription) { - ASSERT(isMainThread()); - if (!m_cachedPrimarySimpleFontData) - m_cachedPrimarySimpleFontData = - determinePrimarySimpleFontData(fontDescription); - return m_cachedPrimarySimpleFontData; - } - const FontData* fontDataAt(const FontDescription&, unsigned index) const; - - GlyphPageTreeNode* getPageNode(unsigned pageNumber) const { - return pageNumber ? m_pages.get(pageNumber) : m_pageZero; - } - - void setPageNode(unsigned pageNumber, GlyphPageTreeNode* node) { - if (pageNumber) - m_pages.set(pageNumber, node); - else - m_pageZero = node; - } - - static void SetUseTestFonts(bool useTestFonts); - - private: - FontFallbackList(); - - PassRefPtr getFontData(const FontDescription&, - int& familyIndex) const; - - const SimpleFontData* determinePrimarySimpleFontData( - const FontDescription&) const; - - void releaseFontData(); - - mutable Vector, 1> m_fontList; - GlyphPages m_pages; - GlyphPageTreeNode* m_pageZero; - mutable const SimpleFontData* m_cachedPrimarySimpleFontData; - RefPtr m_fontSelector; - mutable WidthCache m_widthCache; - unsigned m_fontSelectorVersion; - mutable int m_familyIndex; - unsigned short m_generation; - mutable unsigned m_pitch : 3; // Pitch - mutable bool m_hasLoadingFallback : 1; - bool m_useTestFonts = false; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTFALLBACKLIST_H_ diff --git a/sky/engine/platform/fonts/FontFamily.cpp b/sky/engine/platform/fonts/FontFamily.cpp deleted file mode 100644 index 728899c1cca9f..0000000000000 --- a/sky/engine/platform/fonts/FontFamily.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontFamily.h" - -namespace blink { - -bool operator==(const FontFamily& a, const FontFamily& b) { - if (a.family() != b.family()) - return false; - const FontFamily* ap; - const FontFamily* bp; - for (ap = a.next(), bp = b.next(); ap != bp; - ap = ap->next(), bp = bp->next()) { - if (!ap || !bp) - return false; - if (ap->family() != bp->family()) - return false; - } - return true; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontFamily.h b/sky/engine/platform/fonts/FontFamily.h deleted file mode 100644 index f2ebe66cdd66e..0000000000000 --- a/sky/engine/platform/fonts/FontFamily.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTFAMILY_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTFAMILY_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -namespace blink { - -class SharedFontFamily; - -class PLATFORM_EXPORT FontFamily { - public: - FontFamily() {} - ~FontFamily(); - - void setFamily(const AtomicString& family) { m_family = family; } - const AtomicString& family() const { return m_family; } - bool familyIsEmpty() const { return m_family.isEmpty(); } - - const FontFamily* next() const; - - void appendFamily(PassRefPtr); - PassRefPtr releaseNext(); - - private: - AtomicString m_family; - RefPtr m_next; -}; - -class PLATFORM_EXPORT SharedFontFamily : public FontFamily, - public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new SharedFontFamily); - } - - private: - SharedFontFamily() {} -}; - -PLATFORM_EXPORT bool operator==(const FontFamily&, const FontFamily&); -inline bool operator!=(const FontFamily& a, const FontFamily& b) { - return !(a == b); -} - -inline FontFamily::~FontFamily() { - RefPtr reaper = m_next.release(); - while (reaper && reaper->hasOneRef()) - reaper = reaper->releaseNext(); // implicitly protects reaper->next, then - // derefs reaper -} - -inline const FontFamily* FontFamily::next() const { - return m_next.get(); -} - -inline void FontFamily::appendFamily(PassRefPtr family) { - m_next = family; -} - -inline PassRefPtr FontFamily::releaseNext() { - return m_next.release(); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTFAMILY_H_ diff --git a/sky/engine/platform/fonts/FontFamilyNames.in b/sky/engine/platform/fonts/FontFamilyNames.in deleted file mode 100644 index 504b7ebe2c1ce..0000000000000 --- a/sky/engine/platform/fonts/FontFamilyNames.in +++ /dev/null @@ -1,10 +0,0 @@ -namespace="FontFamily" -export="PLATFORM_EXPORT" - --webkit-cursive --webkit-fantasy --webkit-monospace --webkit-sans-serif --webkit-serif --webkit-pictograph --webkit-standard diff --git a/sky/engine/platform/fonts/FontFeatureSettings.cpp b/sky/engine/platform/fonts/FontFeatureSettings.cpp deleted file mode 100644 index 2ff6975f98753..0000000000000 --- a/sky/engine/platform/fonts/FontFeatureSettings.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontFeatureSettings.h" - -namespace blink { - -FontFeature::FontFeature(const AtomicString& tag, int value) - : m_tag(tag), m_value(value) {} - -bool FontFeature::operator==(const FontFeature& other) { - return m_tag == other.m_tag && m_value == other.m_value; -} - -FontFeatureSettings::FontFeatureSettings() {} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontFeatureSettings.h b/sky/engine/platform/fonts/FontFeatureSettings.h deleted file mode 100644 index 7de8f7074db27..0000000000000 --- a/sky/engine/platform/fonts/FontFeatureSettings.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTFEATURESETTINGS_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTFEATURESETTINGS_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -namespace blink { - -class PLATFORM_EXPORT FontFeature { - public: - FontFeature(const AtomicString& tag, int value); - bool operator==(const FontFeature&); - - const AtomicString& tag() const { return m_tag; } - int value() const { return m_value; } - - private: - AtomicString m_tag; - const int m_value; -}; - -class PLATFORM_EXPORT FontFeatureSettings - : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new FontFeatureSettings()); - } - void append(const FontFeature& feature) { m_list.append(feature); } - size_t size() const { return m_list.size(); } - const FontFeature& operator[](int index) const { return m_list[index]; } - const FontFeature& at(size_t index) const { return m_list.at(index); } - - private: - FontFeatureSettings(); - Vector m_list; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTFEATURESETTINGS_H_ diff --git a/sky/engine/platform/fonts/FontMetrics.h b/sky/engine/platform/fonts/FontMetrics.h deleted file mode 100644 index 28f8b77bec8d2..0000000000000 --- a/sky/engine/platform/fonts/FontMetrics.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTMETRICS_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTMETRICS_H_ - -#include "flutter/sky/engine/platform/fonts/FontBaseline.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -const unsigned gDefaultUnitsPerEm = 1000; - -class FontMetrics { - public: - FontMetrics() - : m_unitsPerEm(gDefaultUnitsPerEm), - m_ascent(0), - m_descent(0), - m_lineGap(0), - m_lineSpacing(0), - m_xHeight(0), - m_zeroWidth(0), - m_underlinethickness(0), - m_underlinePosition(0), - m_hasXHeight(false), - m_hasZeroWidth(false) {} - - unsigned unitsPerEm() const { return m_unitsPerEm; } - void setUnitsPerEm(unsigned unitsPerEm) { m_unitsPerEm = unitsPerEm; } - - float floatAscent(FontBaseline baselineType = AlphabeticBaseline) const { - if (baselineType == AlphabeticBaseline) - return m_ascent; - return floatHeight() / 2; - } - - void setAscent(float ascent) { m_ascent = ascent; } - - float floatDescent(FontBaseline baselineType = AlphabeticBaseline) const { - if (baselineType == AlphabeticBaseline) - return m_descent; - return floatHeight() / 2; - } - - void setDescent(float descent) { m_descent = descent; } - - float floatHeight(FontBaseline baselineType = AlphabeticBaseline) const { - return floatAscent(baselineType) + floatDescent(baselineType); - } - - float floatLineGap() const { return m_lineGap; } - void setLineGap(float lineGap) { m_lineGap = lineGap; } - - float floatLineSpacing() const { return m_lineSpacing; } - void setLineSpacing(float lineSpacing) { m_lineSpacing = lineSpacing; } - - float xHeight() const { return m_xHeight; } - void setXHeight(float xHeight) { - m_xHeight = xHeight; - m_hasXHeight = true; - } - - bool hasXHeight() const { return m_hasXHeight && m_xHeight > 0; } - void setHasXHeight(bool hasXHeight) { m_hasXHeight = hasXHeight; } - - // Integer variants of certain metrics, used for HTML rendering. - int ascent(FontBaseline baselineType = AlphabeticBaseline) const { - if (baselineType == AlphabeticBaseline) - return lroundf(m_ascent); - return height() - height() / 2; - } - - int descent(FontBaseline baselineType = AlphabeticBaseline) const { - if (baselineType == AlphabeticBaseline) - return lroundf(m_descent); - return height() / 2; - } - - int height(FontBaseline baselineType = AlphabeticBaseline) const { - return ascent(baselineType) + descent(baselineType); - } - - int lineGap() const { return lroundf(m_lineGap); } - int lineSpacing() const { return lroundf(m_lineSpacing); } - - bool hasIdenticalAscentDescentAndLineGap(const FontMetrics& other) const { - return ascent() == other.ascent() && descent() == other.descent() && - lineGap() == other.lineGap(); - } - - float zeroWidth() const { return m_zeroWidth; } - void setZeroWidth(float zeroWidth) { - m_zeroWidth = zeroWidth; - m_hasZeroWidth = true; - } - - bool hasZeroWidth() const { return m_hasZeroWidth; } - void setHasZeroWidth(bool hasZeroWidth) { m_hasZeroWidth = hasZeroWidth; } - - float underlineThickness() const { return m_underlinethickness; } - void setUnderlineThickness(float underlineThickness) { - m_underlinethickness = underlineThickness; - } - - float underlinePosition() const { return m_underlinePosition; } - void setUnderlinePosition(float underlinePosition) { - m_underlinePosition = underlinePosition; - } - - private: - friend class SimpleFontData; - - void reset() { - m_unitsPerEm = gDefaultUnitsPerEm; - m_ascent = 0; - m_descent = 0; - m_lineGap = 0; - m_lineSpacing = 0; - m_xHeight = 0; - m_hasXHeight = false; - m_underlinethickness = 0; - m_underlinePosition = 0; - } - - unsigned m_unitsPerEm; - float m_ascent; - float m_descent; - float m_lineGap; - float m_lineSpacing; - float m_xHeight; - float m_zeroWidth; - float m_underlinethickness; - float m_underlinePosition; - bool m_hasXHeight; - bool m_hasZeroWidth; -}; - -inline float scaleEmToUnits(float x, unsigned unitsPerEm) { - return unitsPerEm ? x / unitsPerEm : x; -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTMETRICS_H_ diff --git a/sky/engine/platform/fonts/FontOrientation.h b/sky/engine/platform/fonts/FontOrientation.h deleted file mode 100644 index 7326de32fd982..0000000000000 --- a/sky/engine/platform/fonts/FontOrientation.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTORIENTATION_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTORIENTATION_H_ - -namespace blink { - -enum FontOrientation { Horizontal, Vertical }; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTORIENTATION_H_ diff --git a/sky/engine/platform/fonts/FontPlatformData.cpp b/sky/engine/platform/fonts/FontPlatformData.cpp deleted file mode 100644 index eb9fac8a77fc1..0000000000000 --- a/sky/engine/platform/fonts/FontPlatformData.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" - -#include "flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "third_party/skia/include/core/SkTypeface.h" - -namespace blink { - -FontPlatformData::FontPlatformData(WTF::HashTableDeletedValueType) - : m_textSize(0), - m_syntheticBold(false), - m_syntheticItalic(false), - m_orientation(Horizontal), - m_isHashTableDeletedValue(true) {} - -FontPlatformData::FontPlatformData() - : m_textSize(0), - m_syntheticBold(false), - m_syntheticItalic(false), - m_orientation(Horizontal), - m_isHashTableDeletedValue(false) {} - -FontPlatformData::FontPlatformData(float textSize, - bool syntheticBold, - bool syntheticItalic) - : m_textSize(textSize), - m_syntheticBold(syntheticBold), - m_syntheticItalic(syntheticItalic), - m_orientation(Horizontal), - m_isHashTableDeletedValue(false) {} - -FontPlatformData::FontPlatformData(const FontPlatformData& src) - : m_typeface(src.m_typeface), - m_family(src.m_family), - m_textSize(src.m_textSize), - m_syntheticBold(src.m_syntheticBold), - m_syntheticItalic(src.m_syntheticItalic), - m_orientation(src.m_orientation), - m_style(src.m_style), - m_harfBuzzFace(nullptr), - m_isHashTableDeletedValue(false) {} - -FontPlatformData::FontPlatformData(sk_sp tf, - const char* family, - float textSize, - bool syntheticBold, - bool syntheticItalic, - FontOrientation orientation, - bool subpixelTextPosition) - : m_typeface(tf), - m_family(family), - m_textSize(textSize), - m_syntheticBold(syntheticBold), - m_syntheticItalic(syntheticItalic), - m_orientation(orientation), - m_isHashTableDeletedValue(false) { - querySystemForRenderStyle(subpixelTextPosition); -} - -FontPlatformData::FontPlatformData(const FontPlatformData& src, float textSize) - : m_typeface(src.m_typeface), - m_family(src.m_family), - m_textSize(textSize), - m_syntheticBold(src.m_syntheticBold), - m_syntheticItalic(src.m_syntheticItalic), - m_orientation(src.m_orientation), - m_harfBuzzFace(nullptr), - m_isHashTableDeletedValue(false) { - querySystemForRenderStyle(FontDescription::subpixelPositioning()); -} - -FontPlatformData::~FontPlatformData() {} - -FontPlatformData& FontPlatformData::operator=(const FontPlatformData& src) { - m_typeface = src.m_typeface; - m_family = src.m_family; - m_textSize = src.m_textSize; - m_syntheticBold = src.m_syntheticBold; - m_syntheticItalic = src.m_syntheticItalic; - m_harfBuzzFace = nullptr; - m_orientation = src.m_orientation; - m_style = src.m_style; - return *this; -} - -#ifndef NDEBUG -String FontPlatformData::description() const { - return String(); -} -#endif - -SkFontID FontPlatformData::uniqueID() const { - return m_typeface->uniqueID(); -} - -String FontPlatformData::fontFamilyName() const { - // FIXME(crbug.com/326582): come up with a proper way of handling SVG. - if (!this->typeface()) - return ""; - SkTypeface::LocalizedStrings* fontFamilyIterator = - this->typeface()->createFamilyNameIterator(); - SkTypeface::LocalizedString localizedString; - while (fontFamilyIterator->next(&localizedString) && - !localizedString.fString.size()) { - } - fontFamilyIterator->unref(); - return String(localizedString.fString.c_str()); -} - -bool FontPlatformData::operator==(const FontPlatformData& a) const { - // If either of the typeface pointers are null then we test for pointer - // equality. Otherwise, we call SkTypeface::Equal on the valid pointers. - bool typefacesEqual; - if (!m_typeface || !a.m_typeface) - typefacesEqual = m_typeface == a.m_typeface; - else - typefacesEqual = SkTypeface::Equal(m_typeface.get(), a.m_typeface.get()); - - return typefacesEqual && m_textSize == a.m_textSize && - m_syntheticBold == a.m_syntheticBold && - m_syntheticItalic == a.m_syntheticItalic && - m_orientation == a.m_orientation && m_style == a.m_style && - m_isHashTableDeletedValue == a.m_isHashTableDeletedValue; -} - -bool FontPlatformData::isFixedPitch() const { - return typeface() && typeface()->isFixedPitch(); -} - -HarfBuzzFace* FontPlatformData::harfBuzzFace() const { - if (!m_harfBuzzFace) - m_harfBuzzFace = - HarfBuzzFace::create(const_cast(this), uniqueID()); - - return m_harfBuzzFace.get(); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontPlatformData.h b/sky/engine/platform/fonts/FontPlatformData.h deleted file mode 100644 index 0ba90b2812b20..0000000000000 --- a/sky/engine/platform/fonts/FontPlatformData.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTPLATFORMDATA_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTPLATFORMDATA_H_ - -#include "flutter/sky/engine/platform/SharedBuffer.h" -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/platform/fonts/FontOrientation.h" -#include "flutter/sky/engine/platform/fonts/FontRenderStyle.h" -#include "flutter/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/HashTableDeletedValueType.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/StringImpl.h" -#include "third_party/skia/include/core/SkPaint.h" - -class SkTypeface; -typedef uint32_t SkFontID; - -namespace blink { - -class GraphicsContext; -class HarfBuzzFace; - -class PLATFORM_EXPORT FontPlatformData { - public: - // Used for deleted values in the font cache's hash tables. The hash table - // will create us with this structure, and it will compare other values - // to this "Deleted" one. It expects the Deleted one to be differentiable - // from the 0 one (created with the empty constructor), so we can't just - // set everything to 0. - FontPlatformData(WTF::HashTableDeletedValueType); - FontPlatformData(); - FontPlatformData(float textSize, bool syntheticBold, bool syntheticItalic); - FontPlatformData(const FontPlatformData&); - FontPlatformData(sk_sp, - const char* name, - float textSize, - bool syntheticBold, - bool syntheticItalic, - FontOrientation = Horizontal, - bool subpixelTextPosition = defaultUseSubpixelPositioning()); - FontPlatformData(const FontPlatformData& src, float textSize); - ~FontPlatformData(); - - String fontFamilyName() const; - float size() const { return m_textSize; } - bool isFixedPitch() const; - - SkTypeface* typeface() const { return m_typeface.get(); } - HarfBuzzFace* harfBuzzFace() const; - SkFontID uniqueID() const; - unsigned hash() const; - - FontOrientation orientation() const { return m_orientation; } - void setOrientation(FontOrientation orientation) { - m_orientation = orientation; - } - void setSyntheticBold(bool syntheticBold) { m_syntheticBold = syntheticBold; } - void setSyntheticItalic(bool syntheticItalic) { - m_syntheticItalic = syntheticItalic; - } - bool operator==(const FontPlatformData&) const; - FontPlatformData& operator=(const FontPlatformData&); - bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; } - -#if OS(WIN) - void setMinSizeForAntiAlias(unsigned size) { m_minSizeForAntiAlias = size; } - unsigned minSizeForAntiAlias() const { return m_minSizeForAntiAlias; } - void setMinSizeForSubpixel(float size) { m_minSizeForSubpixel = size; } - float minSizeForSubpixel() const { return m_minSizeForSubpixel; } - void setHinting(SkPaint::Hinting style) { - m_style.useAutoHint = 0; - m_style.hintStyle = style; - } -#endif - - bool fontContainsCharacter(UChar32 character); - -#if ENABLE(OPENTYPE_VERTICAL) - PassRefPtr verticalData() const; - PassRefPtr openTypeTable(uint32_t table) const; -#endif - -#ifndef NDEBUG - String description() const; -#endif - - // The returned styles are all actual styles without - // FontRenderStyle::NoPreference. - const FontRenderStyle& fontRenderStyle() const { return m_style; } - void setupPaint(SkPaint*, GraphicsContext* = 0) const; - -#if OS(WIN) - int paintTextFlags() const { return m_paintTextFlags; } -#else - static void setHinting(SkPaint::Hinting); - static void setAutoHint(bool); - static void setUseBitmaps(bool); - static void setAntiAlias(bool); - static void setSubpixelRendering(bool); -#endif - - private: - bool static defaultUseSubpixelPositioning(); - void querySystemForRenderStyle(bool useSkiaSubpixelPositioning); - - sk_sp m_typeface; - CString m_family; - float m_textSize; - bool m_syntheticBold; - bool m_syntheticItalic; - FontOrientation m_orientation; - FontRenderStyle m_style; - mutable RefPtr m_harfBuzzFace; - bool m_isHashTableDeletedValue; -#if OS(WIN) - int m_paintTextFlags; - bool m_useSubpixelPositioning; - unsigned m_minSizeForAntiAlias; - float m_minSizeForSubpixel; -#endif -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTPLATFORMDATA_H_ diff --git a/sky/engine/platform/fonts/FontPlatformFeatures.h b/sky/engine/platform/fonts/FontPlatformFeatures.h deleted file mode 100644 index 23ae003ebdc20..0000000000000 --- a/sky/engine/platform/fonts/FontPlatformFeatures.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTPLATFORMFEATURES_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTPLATFORMFEATURES_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" - -namespace blink { - -class FontPlatformFeatures { - public: - static bool canExpandAroundIdeographsInComplexText(); - - private: - FontPlatformFeatures(); -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTPLATFORMFEATURES_H_ diff --git a/sky/engine/platform/fonts/FontRenderStyle.h b/sky/engine/platform/fonts/FontRenderStyle.h deleted file mode 100644 index 752185ef33c0d..0000000000000 --- a/sky/engine/platform/fonts/FontRenderStyle.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) 2010, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTRENDERSTYLE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTRENDERSTYLE_H_ - -namespace blink { - -// FontRenderStyle describes the user's preferences for rendering a font at a -// given size. -struct FontRenderStyle { - enum { - NoPreference = 2, - }; - - FontRenderStyle() - : useBitmaps(0), - useAutoHint(0), - useHinting(0), - hintStyle(0), - useAntiAlias(0), - useSubpixelRendering(0), - useSubpixelPositioning(0) {} - - bool operator==(const FontRenderStyle& a) const { - return useBitmaps == a.useBitmaps && useAutoHint == a.useAutoHint && - useHinting == a.useHinting && hintStyle == a.hintStyle && - useAntiAlias == a.useAntiAlias && - useSubpixelRendering == a.useSubpixelRendering && - useSubpixelPositioning == a.useSubpixelPositioning; - } - - // Each of the use* members below can take one of three values: - // 0: off - // 1: on - // NoPreference: no preference expressed - char useBitmaps; // use embedded bitmap strike if possible - char useAutoHint; // use 'auto' hinting (FreeType specific) - char useHinting; // hint glyphs to the pixel grid - char hintStyle; // level of hinting, 0..3 - char useAntiAlias; // antialias glyph shapes - char - useSubpixelRendering; // use subpixel rendering (partially-filled pixels) - char useSubpixelPositioning; // use subpixel positioning (fractional X - // positions for glyphs) -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTRENDERSTYLE_H_ diff --git a/sky/engine/platform/fonts/FontSelector.h b/sky/engine/platform/fonts/FontSelector.h deleted file mode 100644 index 2c7631454a515..0000000000000 --- a/sky/engine/platform/fonts/FontSelector.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTSELECTOR_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTSELECTOR_H_ - -#include "flutter/sky/engine/platform/fonts/FontCacheClient.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -namespace blink { - -class FontData; -class FontDescription; - -class FontSelector : public FontCacheClient { - public: - virtual ~FontSelector() {} - virtual PassRefPtr getFontData(const FontDescription&, - const AtomicString& familyName) = 0; - virtual void willUseFontData(const FontDescription&, - const AtomicString& familyName, - UChar32) = 0; - - virtual unsigned version() const = 0; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTSELECTOR_H_ diff --git a/sky/engine/platform/fonts/FontSmoothingMode.h b/sky/engine/platform/fonts/FontSmoothingMode.h deleted file mode 100644 index aa7449f9fdf8a..0000000000000 --- a/sky/engine/platform/fonts/FontSmoothingMode.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTSMOOTHINGMODE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTSMOOTHINGMODE_H_ - -namespace blink { - -enum FontSmoothingMode { - AutoSmoothing, - NoSmoothing, - Antialiased, - SubpixelAntialiased -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTSMOOTHINGMODE_H_ diff --git a/sky/engine/platform/fonts/FontTest.cpp b/sky/engine/platform/fonts/FontTest.cpp deleted file mode 100644 index 39a470f5801a6..0000000000000 --- a/sky/engine/platform/fonts/FontTest.cpp +++ /dev/null @@ -1,363 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// Tests for the Font class. - -#include "flutter/sky/engine/platform/fonts/Character.h" -#include "flutter/sky/engine/platform/fonts/Font.h" - -#include - -namespace blink { - -static void TestSpecificUCharRange(UChar rangeStart, UChar rangeEnd) { - UChar below[1]; - UChar start[1]; - UChar midway[1]; - UChar end[1]; - UChar above[1]; - - below[0] = rangeStart - 1; - start[0] = rangeStart; - midway[0] = ((int)rangeStart + (int)rangeEnd) / 2; - end[0] = rangeEnd; - above[0] = rangeEnd + 1; - - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(below, 1)); - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(start, 1)); - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(midway, 1)); - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(end, 1)); - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(above, 1)); -} - -TEST(FontTest, TestCharacterRangeCodePath) { - static UChar c1[] = {0x0}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c1, 1)); - - TestSpecificUCharRange(0x2E5, 0x2E9); - TestSpecificUCharRange(0x300, 0x36F); - TestSpecificUCharRange(0x0591, 0x05BD); - TestSpecificUCharRange(0x05BF, 0x05CF); - TestSpecificUCharRange(0x0600, 0x109F); - TestSpecificUCharRange(0x1100, 0x11FF); - TestSpecificUCharRange(0x135D, 0x135F); - TestSpecificUCharRange(0x1700, 0x18AF); - TestSpecificUCharRange(0x1900, 0x194F); - TestSpecificUCharRange(0x1980, 0x19DF); - TestSpecificUCharRange(0x1A00, 0x1CFF); - - static UChar c2[] = {0x1DBF}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c2, 1)); - static UChar c3[] = {0x1DC0}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c3, 1)); - static UChar c4[] = {0x1DD0}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c4, 1)); - static UChar c5[] = {0x1DFF}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c5, 1)); - static UChar c6[] = {0x1E00}; - EXPECT_EQ(SimpleWithGlyphOverflowPath, - Character::characterRangeCodePath(c6, 1)); - static UChar c7[] = {0x2000}; - EXPECT_EQ(SimpleWithGlyphOverflowPath, - Character::characterRangeCodePath(c7, 1)); - static UChar c8[] = {0x2001}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c8, 1)); - - TestSpecificUCharRange(0x20D0, 0x20FF); - TestSpecificUCharRange(0x2CEF, 0x2CF1); - TestSpecificUCharRange(0x302A, 0x302F); - - TestSpecificUCharRange(0xA67C, 0xA67D); - TestSpecificUCharRange(0xA6F0, 0xA6F1); - TestSpecificUCharRange(0xA800, 0xABFF); - - TestSpecificUCharRange(0xD7B0, 0xD7FF); - TestSpecificUCharRange(0xFE00, 0xFE0F); - TestSpecificUCharRange(0xFE20, 0xFE2F); -} - -TEST(FontTest, TestCharacterRangeCodePathSurrogate1) { - /* To be surrogate ... */ - /* 1st character must be 0xD800 .. 0xDBFF */ - /* 2nd character must be 0xdc00 .. 0xdfff */ - - /* The following 5 should all be Simple because they are not surrogate. */ - static UChar c1[] = {0xD800, 0xDBFE}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c1, 2)); - static UChar c2[] = {0xD800, 0xE000}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c2, 2)); - static UChar c3[] = {0xDBFF, 0xDBFE}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c3, 2)); - static UChar c4[] = {0xDBFF, 0xE000}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c4, 2)); - static UChar c5[] = {0xDC00, 0xDBFF}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c5, 2)); - - /* To be Complex, the Supplementary Character must be in either */ - /* U+1F1E6 through U+1F1FF or U+E0100 through U+E01EF. */ - /* That is, a lead of 0xD83C with trail 0xDDE6 .. 0xDDFF or */ - /* a lead of 0xDB40 with trail 0xDD00 .. 0xDDEF. */ - static UChar c6[] = {0xD83C, 0xDDE5}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c6, 2)); - static UChar c7[] = {0xD83C, 0xDDE6}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c7, 2)); - static UChar c8[] = {0xD83C, 0xDDF0}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c8, 2)); - static UChar c9[] = {0xD83C, 0xDDFF}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c9, 2)); - static UChar c10[] = {0xD83C, 0xDE00}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c10, 2)); - - static UChar c11[] = {0xDB40, 0xDCFF}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c11, 2)); - static UChar c12[] = {0xDB40, 0xDD00}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c12, 2)); - static UChar c13[] = {0xDB40, 0xDDED}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c13, 2)); - static UChar c14[] = {0xDB40, 0xDDEF}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c14, 2)); - static UChar c15[] = {0xDB40, 0xDDF0}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c15, 2)); -} - -TEST(FontTest, TestCharacterRangeCodePathString) { - // Simple-Simple is still simple - static UChar c1[] = {0x2FF, 0x2FF}; - EXPECT_EQ(SimplePath, Character::characterRangeCodePath(c1, 2)); - // Complex-Simple is Complex - static UChar c2[] = {0x300, 0x2FF}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c2, 2)); - // Simple-Complex is Complex - static UChar c3[] = {0x2FF, 0x330}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c3, 2)); - // Complex-Complex is Complex - static UChar c4[] = {0x36F, 0x330}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c4, 2)); - // SimpleWithGlyphOverflow-Simple is SimpleWithGlyphOverflow - static UChar c5[] = {0x1E00, 0x2FF}; - EXPECT_EQ(SimpleWithGlyphOverflowPath, - Character::characterRangeCodePath(c5, 2)); - // Simple-SimpleWithGlyphOverflow is SimpleWithGlyphOverflow - static UChar c6[] = {0x2FF, 0x2000}; - EXPECT_EQ(SimpleWithGlyphOverflowPath, - Character::characterRangeCodePath(c6, 2)); - // SimpleWithGlyphOverflow-Complex is Complex - static UChar c7[] = {0x1E00, 0x330}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c7, 2)); - // Complex-SimpleWithGlyphOverflow is Complex - static UChar c8[] = {0x330, 0x2000}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c8, 2)); - // Surrogate-Complex is Complex - static UChar c9[] = {0xD83C, 0xDDE5, 0x330}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c9, 3)); - // Complex-Surrogate is Complex - static UChar c10[] = {0x330, 0xD83C, 0xDDE5}; - EXPECT_EQ(ComplexPath, Character::characterRangeCodePath(c10, 3)); -} - -static void TestSpecificUChar32RangeIdeograph(UChar32 rangeStart, - UChar32 rangeEnd) { - EXPECT_FALSE(Character::isCJKIdeograph(rangeStart - 1)); - EXPECT_TRUE(Character::isCJKIdeograph(rangeStart)); - EXPECT_TRUE(Character::isCJKIdeograph( - (UChar32)((uint64_t)rangeStart + (uint64_t)rangeEnd) / 2)); - EXPECT_TRUE(Character::isCJKIdeograph(rangeEnd)); - EXPECT_FALSE(Character::isCJKIdeograph(rangeEnd + 1)); -} - -TEST(FontTest, TestIsCJKIdeograph) { - // The basic CJK Unified Ideographs block. - TestSpecificUChar32RangeIdeograph(0x4E00, 0x9FFF); - // CJK Unified Ideographs Extension A. - TestSpecificUChar32RangeIdeograph(0x3400, 0x4DBF); - // CJK Unified Ideographs Extension A and Kangxi Radicals. - TestSpecificUChar32RangeIdeograph(0x2E80, 0x2FDF); - // CJK Strokes. - TestSpecificUChar32RangeIdeograph(0x31C0, 0x31EF); - // CJK Compatibility Ideographs. - TestSpecificUChar32RangeIdeograph(0xF900, 0xFAFF); - // CJK Unified Ideographs Extension B. - TestSpecificUChar32RangeIdeograph(0x20000, 0x2A6DF); - // CJK Unified Ideographs Extension C. - // CJK Unified Ideographs Extension D. - TestSpecificUChar32RangeIdeograph(0x2A700, 0x2B81F); - // CJK Compatibility Ideographs Supplement. - TestSpecificUChar32RangeIdeograph(0x2F800, 0x2FA1F); -} - -static void TestSpecificUChar32RangeIdeographSymbol(UChar32 rangeStart, - UChar32 rangeEnd) { - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(rangeStart - 1)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(rangeStart)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol( - (UChar32)((uint64_t)rangeStart + (uint64_t)rangeEnd) / 2)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(rangeEnd)); - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(rangeEnd + 1)); -} - -TEST(FontTest, TestIsCJKIdeographOrSymbol) { - // CJK Compatibility Ideographs Supplement. - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2C7)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2CA)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2CB)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2D9)); - - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2020)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2021)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2030)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x203B)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x203C)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2042)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2047)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2048)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2049)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2051)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x20DD)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x20DE)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2100)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2103)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2105)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2109)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x210A)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2113)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2116)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2121)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x212B)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x213B)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2150)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2151)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2152)); - - TestSpecificUChar32RangeIdeographSymbol(0x2156, 0x215A); - TestSpecificUChar32RangeIdeographSymbol(0x2160, 0x216B); - TestSpecificUChar32RangeIdeographSymbol(0x2170, 0x217B); - - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x217F)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2189)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2307)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2312)); - - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(0x23BD)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x23BE)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x23C4)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x23CC)); - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(0x23CD)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x23CE)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2423)); - - TestSpecificUChar32RangeIdeographSymbol(0x2460, 0x2492); - TestSpecificUChar32RangeIdeographSymbol(0x249C, 0x24FF); - - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25A0)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25A1)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25A2)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25AA)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25AB)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25B1)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25B2)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25B3)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25B6)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25B7)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25BC)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25BD)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25C0)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25C1)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25C6)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25C7)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25C9)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25CB)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25CC)); - - TestSpecificUChar32RangeIdeographSymbol(0x25CE, 0x25D3); - TestSpecificUChar32RangeIdeographSymbol(0x25E2, 0x25E6); - - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x25EF)); - - TestSpecificUChar32RangeIdeographSymbol(0x2600, 0x2603); - - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2605)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2606)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x260E)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2616)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2617)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2640)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2642)); - - TestSpecificUChar32RangeIdeographSymbol(0x2660, 0x266F); - TestSpecificUChar32RangeIdeographSymbol(0x2672, 0x267D); - - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x26A0)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x26BD)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x26BE)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2713)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x271A)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x273F)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2740)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2756)); - - TestSpecificUChar32RangeIdeographSymbol(0x2776, 0x277F); - - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x2B1A)); - - TestSpecificUChar32RangeIdeographSymbol(0x2FF0, 0x302F); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x3031)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x312F)); - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(0x3130)); - - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(0x318F)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x3190)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x319F)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x31BF)); - - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(0x31FF)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x3200)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x3300)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x33FF)); - - TestSpecificUChar32RangeIdeographSymbol(0xF860, 0xF862); - TestSpecificUChar32RangeIdeographSymbol(0xFE30, 0xFE4F); - - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0xFE10)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0xFE11)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0xFE12)); - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0xFE19)); - - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(0xFF0D)); - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(0xFF1B)); - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(0xFF1C)); - EXPECT_FALSE(Character::isCJKIdeographOrSymbol(0xFF1E)); - - TestSpecificUChar32RangeIdeographSymbol(0xFF00, 0xFFEF); - - EXPECT_TRUE(Character::isCJKIdeographOrSymbol(0x1F100)); - - TestSpecificUChar32RangeIdeographSymbol(0x1F110, 0x1F129); - TestSpecificUChar32RangeIdeographSymbol(0x1F130, 0x1F149); - TestSpecificUChar32RangeIdeographSymbol(0x1F150, 0x1F169); - TestSpecificUChar32RangeIdeographSymbol(0x1F170, 0x1F189); - TestSpecificUChar32RangeIdeographSymbol(0x1F200, 0x1F6FF); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/FontTraits.h b/sky/engine/platform/fonts/FontTraits.h deleted file mode 100644 index 36a01a7755c40..0000000000000 --- a/sky/engine/platform/fonts/FontTraits.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTTRAITS_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTTRAITS_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" - -namespace blink { - -enum FontWeight { - FontWeight100, - FontWeight200, - FontWeight300, - FontWeight400, - FontWeight500, - FontWeight600, - FontWeight700, - FontWeight800, - FontWeight900, - FontWeightNormal = FontWeight400, - FontWeightBold = FontWeight700 -}; - -// Numeric values matching OS/2 & Windows Metrics usWidthClass table. -// https://www.microsoft.com/typography/otspec/os2.htm -enum FontStretch { - FontStretchUltraCondensed = 1, - FontStretchExtraCondensed = 2, - FontStretchCondensed = 3, - FontStretchSemiCondensed = 4, - FontStretchNormal = 5, - FontStretchSemiExpanded = 6, - FontStretchExpanded = 7, - FontStretchExtraExpanded = 8, - FontStretchUltraExpanded = 9 -}; - -enum FontStyle { FontStyleNormal = 0, FontStyleItalic = 1 }; - -enum FontVariant { FontVariantNormal = 0, FontVariantSmallCaps = 1 }; - -typedef unsigned FontTraitsBitfield; - -struct FontTraits { - FontTraits(FontStyle style, - FontVariant variant, - FontWeight weight, - FontStretch stretch) { - m_traits.m_style = style; - m_traits.m_variant = variant; - m_traits.m_weight = weight; - m_traits.m_stretch = stretch; - m_traits.m_filler = 0; - ASSERT(!(m_bitfield >> 10)); - } - FontTraits(FontTraitsBitfield bitfield) : m_bitfield(bitfield) { - ASSERT(!m_traits.m_filler); - ASSERT(!(m_bitfield >> 10)); - } - FontStyle style() const { return static_cast(m_traits.m_style); } - FontVariant variant() const { - return static_cast(m_traits.m_variant); - } - FontWeight weight() const { - return static_cast(m_traits.m_weight); - } - FontStretch stretch() const { - return static_cast(m_traits.m_stretch); - } - FontTraitsBitfield bitfield() const { return m_bitfield; } - - union { - struct { - unsigned m_style : 1; - unsigned m_variant : 1; - unsigned m_weight : 4; - unsigned m_stretch : 4; - unsigned m_filler : 22; - } m_traits; - FontTraitsBitfield m_bitfield; - }; -}; - -} // namespace blink -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTTRAITS_H_ diff --git a/sky/engine/platform/fonts/FontWidthVariant.h b/sky/engine/platform/fonts/FontWidthVariant.h deleted file mode 100644 index 4ce6e1575f570..0000000000000 --- a/sky/engine/platform/fonts/FontWidthVariant.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FONTWIDTHVARIANT_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FONTWIDTHVARIANT_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" - -namespace blink { - -enum FontWidthVariant { - RegularWidth, - HalfWidth, - ThirdWidth, - QuarterWidth, - LastFontWidthVariant = QuarterWidth -}; - -const unsigned FontWidthVariantWidth = 2; - -COMPILE_ASSERT(LastFontWidthVariant >> FontWidthVariantWidth == 0, - FontWidthVariantWidth_is_correct); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FONTWIDTHVARIANT_H_ diff --git a/sky/engine/platform/fonts/Glyph.h b/sky/engine/platform/fonts/Glyph.h deleted file mode 100644 index 3756dd11fd190..0000000000000 --- a/sky/engine/platform/fonts/Glyph.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) Research In Motion Limited 2011. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_GLYPH_H_ -#define SKY_ENGINE_PLATFORM_FONTS_GLYPH_H_ - -namespace blink { - -typedef unsigned short Glyph; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_GLYPH_H_ diff --git a/sky/engine/platform/fonts/GlyphBuffer.h b/sky/engine/platform/fonts/GlyphBuffer.h deleted file mode 100644 index 90910bff59c61..0000000000000 --- a/sky/engine/platform/fonts/GlyphBuffer.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2006, 2009, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2007-2008 Torch Mobile Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_GLYPHBUFFER_H_ -#define SKY_ENGINE_PLATFORM_FONTS_GLYPHBUFFER_H_ - -#include "flutter/sky/engine/platform/fonts/Glyph.h" -#include "flutter/sky/engine/platform/geometry/FloatSize.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class SimpleFontData; - -class GlyphBuffer { - public: - GlyphBuffer() {} - - bool isEmpty() const { return m_fontData.isEmpty(); } - bool hasOffsets() const { return !m_offsets.isEmpty(); } - unsigned size() const { return m_fontData.size(); } - - void clear() { - m_fontData.clear(); - m_glyphs.clear(); - m_advances.clear(); - m_offsets.clear(); - } - - const Glyph* glyphs(unsigned from) const { return m_glyphs.data() + from; } - const float* advances(unsigned from) const { - return m_advances.data() + from; - } - const FloatSize* offsets(unsigned from) const { - return m_offsets.data() + from; - } - - const SimpleFontData* fontDataAt(unsigned index) const { - return m_fontData[index]; - } - - Glyph glyphAt(unsigned index) const { return m_glyphs[index]; } - - float advanceAt(unsigned index) const { return m_advances[index]; } - - void add(Glyph glyph, const SimpleFontData* font, float width) { - // should not mix offset/advance-only glyphs - ASSERT(!hasOffsets()); - - m_fontData.append(font); - m_glyphs.append(glyph); - m_advances.append(width); - } - - void add(Glyph glyph, - const SimpleFontData* font, - const FloatSize& offset, - float advance) { - // should not mix offset/advance-only glyphs - ASSERT(size() == m_offsets.size()); - - m_fontData.append(font); - m_glyphs.append(glyph); - m_offsets.append(offset); - m_advances.append(advance); - } - - void reverse() { - m_fontData.reverse(); - m_glyphs.reverse(); - m_advances.reverse(); - } - - void expandLastAdvance(float width) { - ASSERT(!isEmpty()); - float& lastAdvance = m_advances.last(); - lastAdvance += width; - } - - private: - Vector m_fontData; - Vector m_glyphs; - Vector m_advances; - Vector m_offsets; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_GLYPHBUFFER_H_ diff --git a/sky/engine/platform/fonts/GlyphMetricsMap.h b/sky/engine/platform/fonts/GlyphMetricsMap.h deleted file mode 100644 index 309f3062e4089..0000000000000 --- a/sky/engine/platform/fonts/GlyphMetricsMap.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_GLYPHMETRICSMAP_H_ -#define SKY_ENGINE_PLATFORM_FONTS_GLYPHMETRICSMAP_H_ - -#include "flutter/sky/engine/platform/fonts/Glyph.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -const float cGlyphSizeUnknown = -1; - -template -class GlyphMetricsMap { - WTF_MAKE_NONCOPYABLE(GlyphMetricsMap); - - public: - GlyphMetricsMap() : m_filledPrimaryPage(false) {} - T metricsForGlyph(Glyph glyph) { - return locatePage(glyph / GlyphMetricsPage::size)->metricsForGlyph(glyph); - } - - void setMetricsForGlyph(Glyph glyph, const T& metrics) { - locatePage(glyph / GlyphMetricsPage::size) - ->setMetricsForGlyph(glyph, metrics); - } - - private: - class GlyphMetricsPage { - public: - static const size_t size = 256; // Usually covers Latin-1 in a single page. - - T metricsForGlyph(Glyph glyph) const { return m_metrics[glyph % size]; } - void setMetricsForGlyph(Glyph glyph, const T& metrics) { - setMetricsForIndex(glyph % size, metrics); - } - void setMetricsForIndex(unsigned index, const T& metrics) { - ASSERT_WITH_SECURITY_IMPLICATION(index < size); - m_metrics[index] = metrics; - } - - private: - T m_metrics[size]; - }; - - GlyphMetricsPage* locatePage(unsigned pageNumber) { - if (!pageNumber && m_filledPrimaryPage) - return &m_primaryPage; - return locatePageSlowCase(pageNumber); - } - - GlyphMetricsPage* locatePageSlowCase(unsigned pageNumber); - - static T unknownMetrics(); - - bool m_filledPrimaryPage; - GlyphMetricsPage m_primaryPage; // We optimize for the page that contains - // glyph indices 0-255. - OwnPtr>> m_pages; -}; - -template <> -inline float GlyphMetricsMap::unknownMetrics() { - return cGlyphSizeUnknown; -} - -template <> -inline FloatRect GlyphMetricsMap::unknownMetrics() { - return FloatRect(0, 0, cGlyphSizeUnknown, cGlyphSizeUnknown); -} - -template -typename GlyphMetricsMap::GlyphMetricsPage* -GlyphMetricsMap::locatePageSlowCase(unsigned pageNumber) { - GlyphMetricsPage* page; - if (!pageNumber) { - ASSERT(!m_filledPrimaryPage); - page = &m_primaryPage; - m_filledPrimaryPage = true; - } else { - if (m_pages) { - page = m_pages->get(pageNumber); - if (page) - return page; - } else - m_pages = adoptPtr(new HashMap>); - page = new GlyphMetricsPage; - m_pages->set(pageNumber, adoptPtr(page)); - } - - // Fill in the whole page with the unknown glyph information. - for (unsigned i = 0; i < GlyphMetricsPage::size; i++) - page->setMetricsForIndex(i, unknownMetrics()); - - return page; -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_GLYPHMETRICSMAP_H_ diff --git a/sky/engine/platform/fonts/GlyphPage.h b/sky/engine/platform/fonts/GlyphPage.h deleted file mode 100644 index c5fe77d0b4526..0000000000000 --- a/sky/engine/platform/fonts/GlyphPage.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2013 Apple Inc. All rights reserved. - * Copyright (C) Research In Motion Limited 2011. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_GLYPHPAGE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_GLYPHPAGE_H_ - -#include -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/CustomFontData.h" -#include "flutter/sky/engine/platform/fonts/Glyph.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -class SimpleFontData; -class GlyphPageTreeNode; - -// Holds the glyph index and the corresponding SimpleFontData information for a -// given character. -struct GlyphData { - GlyphData(Glyph g = 0, const SimpleFontData* f = 0) : glyph(g), fontData(f) {} - Glyph glyph; - const SimpleFontData* fontData; -}; - -// A GlyphPage contains a fixed-size set of GlyphData mappings for a contiguous -// range of characters in the Unicode code space. GlyphPages are indexed -// starting from 0 and incrementing for each 256 glyphs. -// -// One page may actually include glyphs from other fonts if the characters are -// missing in the primary font. It is owned by exactly one GlyphPageTreeNode, -// although multiple nodes may reference it as their "page" if they are supposed -// to be overriding the parent's node, but provide no additional information. -class PLATFORM_EXPORT GlyphPage : public RefCounted { - public: - static PassRefPtr createForMixedFontData( - GlyphPageTreeNode* owner) { - void* slot = fastMalloc(sizeof(GlyphPage) + - sizeof(SimpleFontData*) * GlyphPage::size); - return adoptRef(new (slot) GlyphPage(owner)); - } - - static PassRefPtr createForSingleFontData( - GlyphPageTreeNode* owner, - const SimpleFontData* fontData) { - ASSERT(fontData); - return adoptRef(new GlyphPage(owner, fontData)); - } - - PassRefPtr createCopiedSystemFallbackPage( - GlyphPageTreeNode* owner) const { - RefPtr page = GlyphPage::createForMixedFontData(owner); - memcpy(page->m_glyphs, m_glyphs, sizeof(m_glyphs)); - if (hasPerGlyphFontData()) - memcpy(page->m_perGlyphFontData, m_perGlyphFontData, - sizeof(SimpleFontData*) * GlyphPage::size); - else { - for (size_t i = 0; i < GlyphPage::size; ++i) { - page->m_perGlyphFontData[i] = m_glyphs[i] ? m_fontDataForAllGlyphs : 0; - } - } - page->m_customFontToLoad = m_customFontToLoad; - return page.release(); - } - - ~GlyphPage() {} - - static const unsigned char sizeBits = 8; - static const size_t size = - (1 << GlyphPage::sizeBits); // Covers Latin-1 in a single page. - static unsigned indexForCharacter(UChar32 c) { return c & 0xFF; } - - ALWAYS_INLINE GlyphData glyphDataForCharacter(UChar32 c) const { - unsigned index = indexForCharacter(c); - if (const CustomFontData* customData = customFontToLoadAt(index)) - customData->beginLoadIfNeeded(); - return glyphDataForIndex(index); - } - - ALWAYS_INLINE GlyphData glyphDataForIndex(unsigned index) const { - ASSERT_WITH_SECURITY_IMPLICATION(index < size); - Glyph glyph = m_glyphs[index]; - if (hasPerGlyphFontData()) - return GlyphData(glyph, m_perGlyphFontData[index]); - return GlyphData(glyph, glyph ? m_fontDataForAllGlyphs : 0); - } - - ALWAYS_INLINE Glyph glyphForCharacter(UChar32 c) const { - return glyphAt(indexForCharacter(c)); - } - - ALWAYS_INLINE Glyph glyphAt(unsigned index) const { - ASSERT_WITH_SECURITY_IMPLICATION(index < size); - return m_glyphs[index]; - } - - void setGlyphDataForCharacter(UChar32 c, Glyph g, const SimpleFontData* f) { - setGlyphDataForIndex(indexForCharacter(c), g, f); - } - - void setGlyphDataForIndex(unsigned index, - Glyph glyph, - const SimpleFontData* fontData) { - ASSERT_WITH_SECURITY_IMPLICATION(index < size); - m_glyphs[index] = glyph; - setCustomFontToLoad(index, 0); - - if (hasPerGlyphFontData()) { - m_perGlyphFontData[index] = fontData; - } else { - // A single-font GlyphPage already assigned m_fontDataForAllGlyphs in the - // constructor. - ASSERT(!glyph || fontData == m_fontDataForAllGlyphs); - } - } - - void setGlyphDataForIndex(unsigned index, const GlyphData& glyphData) { - setGlyphDataForIndex(index, glyphData.glyph, glyphData.fontData); - } - - const CustomFontData* customFontToLoadAt(unsigned index) const { - ASSERT_WITH_SECURITY_IMPLICATION(index < size); - return m_customFontToLoad ? m_customFontToLoad->at(index) : 0; - } - - void setCustomFontToLoad(unsigned index, - const CustomFontData* customFontToLoad) { - if (!m_customFontToLoad) { - if (!customFontToLoad) - return; - m_customFontToLoad = CustomDataPage::create(); - } - ASSERT_WITH_SECURITY_IMPLICATION(index < size); - m_customFontToLoad->set(index, customFontToLoad); - } - - void removeFontDataFromSystemFallbackPage(const SimpleFontData* fontData) { - // This method should only be called on the system fallback page, which is - // never single-font. - ASSERT(hasPerGlyphFontData()); - for (size_t i = 0; i < size; ++i) { - if (m_perGlyphFontData[i] == fontData) { - m_glyphs[i] = 0; - m_perGlyphFontData[i] = 0; - } - } - } - - GlyphPageTreeNode* owner() const { return m_owner; } - - private: - explicit GlyphPage(GlyphPageTreeNode* owner, - const SimpleFontData* fontDataForAllGlyphs = 0) - : m_fontDataForAllGlyphs(fontDataForAllGlyphs), m_owner(owner) { - memset(m_glyphs, 0, sizeof(m_glyphs)); - if (hasPerGlyphFontData()) - memset(m_perGlyphFontData, 0, sizeof(SimpleFontData*) * GlyphPage::size); - } - - bool hasPerGlyphFontData() const { return !m_fontDataForAllGlyphs; } - - class CustomDataPage : public RefCounted { - public: - static RefPtr create() { - return adoptRef(new CustomDataPage()); - } - const CustomFontData* at(size_t index) const { return m_customData[index]; } - void set(size_t index, const CustomFontData* data) { - m_customData[index] = data; - } - - private: - CustomDataPage() { memset(m_customData, 0, sizeof(m_customData)); } - const CustomFontData* m_customData[size]; - }; - - const SimpleFontData* m_fontDataForAllGlyphs; - GlyphPageTreeNode* m_owner; - RefPtr m_customFontToLoad; - Glyph m_glyphs[size]; - - // NOTE: This array has (GlyphPage::size) elements if m_fontDataForAllGlyphs - // is null. - const SimpleFontData* m_perGlyphFontData[0]; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_GLYPHPAGE_H_ diff --git a/sky/engine/platform/fonts/GlyphPageTreeNode.cpp b/sky/engine/platform/fonts/GlyphPageTreeNode.cpp deleted file mode 100644 index b0b8ac8fe5297..0000000000000 --- a/sky/engine/platform/fonts/GlyphPageTreeNode.cpp +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/GlyphPageTreeNode.h" - -#include -#include "flutter/sky/engine/platform/fonts/SegmentedFontData.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -namespace blink { - -using std::max; -using std::min; - -HashMap* GlyphPageTreeNode::roots = 0; -GlyphPageTreeNode* GlyphPageTreeNode::pageZeroRoot = 0; - -GlyphPageTreeNode* GlyphPageTreeNode::getRoot(unsigned pageNumber) { - static bool initialized; - if (!initialized) { - initialized = true; - roots = new HashMap; - pageZeroRoot = new GlyphPageTreeNode; - } - - if (!pageNumber) - return pageZeroRoot; - - if (GlyphPageTreeNode* foundNode = roots->get(pageNumber)) - return foundNode; - - GlyphPageTreeNode* node = new GlyphPageTreeNode; -#if ENABLE(ASSERT) - node->m_pageNumber = pageNumber; -#endif - roots->set(pageNumber, node); - return node; -} - -size_t GlyphPageTreeNode::treeGlyphPageCount() { - size_t count = 0; - if (roots) { - HashMap::iterator end = roots->end(); - for (HashMap::iterator it = roots->begin(); - it != end; ++it) - count += it->value->pageCount(); - } - - if (pageZeroRoot) - count += pageZeroRoot->pageCount(); - - return count; -} - -size_t GlyphPageTreeNode::pageCount() const { - size_t count = m_page && m_page->owner() == this ? 1 : 0; - GlyphPageTreeNodeMap::const_iterator end = m_children.end(); - for (GlyphPageTreeNodeMap::const_iterator it = m_children.begin(); it != end; - ++it) - count += it->value->pageCount(); - - return count; -} - -void GlyphPageTreeNode::pruneTreeCustomFontData(const FontData* fontData) { - // Enumerate all the roots and prune any tree that contains our custom font - // data. - if (roots) { - HashMap::iterator end = roots->end(); - for (HashMap::iterator it = roots->begin(); - it != end; ++it) - it->value->pruneCustomFontData(fontData); - } - - if (pageZeroRoot) - pageZeroRoot->pruneCustomFontData(fontData); -} - -void GlyphPageTreeNode::pruneTreeFontData(const SimpleFontData* fontData) { - if (roots) { - HashMap::iterator end = roots->end(); - for (HashMap::iterator it = roots->begin(); - it != end; ++it) - it->value->pruneFontData(fontData); - } - - if (pageZeroRoot) - pageZeroRoot->pruneFontData(fontData); -} - -static bool fill(GlyphPage* pageToFill, - unsigned offset, - unsigned length, - UChar* buffer, - unsigned bufferLength, - const SimpleFontData* fontData) { - bool hasGlyphs = - fontData->fillGlyphPage(pageToFill, offset, length, buffer, bufferLength); - return hasGlyphs; -} - -void GlyphPageTreeNode::initializePage(const FontData* fontData, - unsigned pageNumber) { - ASSERT(!m_page); - - // This function must not be called for the root of the tree, because that - // level does not contain any glyphs. - ASSERT(m_level > 0 && m_parent); - - // The parent's page will be 0 if we are level one or the parent's font data - // did not contain any glyphs for that page. - GlyphPage* parentPage = m_parent->page(); - - // NULL FontData means we're being asked for the system fallback font. - if (fontData) { - if (m_level == 1) { - // Children of the root hold pure pages. These will cover only one - // font data's glyphs, and will have glyph index 0 if the font data does - // not contain the glyph. - unsigned start = pageNumber * GlyphPage::size; - UChar buffer[GlyphPage::size * 2 + 2]; - unsigned bufferLength; - unsigned i; - - // Fill in a buffer with the entire "page" of characters that we want to - // look up glyphs for. - if (start < 0x10000) { - bufferLength = GlyphPage::size; - for (i = 0; i < GlyphPage::size; i++) - buffer[i] = start + i; - - if (start == 0) { - // Control characters must not render at all. - for (i = 0; i < 0x20; ++i) - buffer[i] = zeroWidthSpace; - for (i = 0x7F; i < 0xA0; i++) - buffer[i] = zeroWidthSpace; - buffer[softHyphen] = zeroWidthSpace; - - // \n, \t, and nonbreaking space must render as a space. - buffer[newlineCharacter] = space; - buffer[characterTabulation] = space; - buffer[noBreakSpace] = space; - } else if (start == (leftToRightMark & ~(GlyphPage::size - 1))) { - // LRM, RLM, LRE, RLE, ZWNJ, ZWJ, and PDF must not render at all. - buffer[leftToRightMark - start] = zeroWidthSpace; - buffer[rightToLeftMark - start] = zeroWidthSpace; - buffer[leftToRightEmbed - start] = zeroWidthSpace; - buffer[rightToLeftEmbed - start] = zeroWidthSpace; - buffer[leftToRightOverride - start] = zeroWidthSpace; - buffer[rightToLeftOverride - start] = zeroWidthSpace; - buffer[zeroWidthNonJoiner - start] = zeroWidthSpace; - buffer[zeroWidthJoiner - start] = zeroWidthSpace; - buffer[popDirectionalFormatting - start] = zeroWidthSpace; - } else if (start == - (objectReplacementCharacter & ~(GlyphPage::size - 1))) { - // Object replacement character must not render at all. - buffer[objectReplacementCharacter - start] = zeroWidthSpace; - } else if (start == (zeroWidthNoBreakSpace & ~(GlyphPage::size - 1))) { - // ZWNBS/BOM must not render at all. - buffer[zeroWidthNoBreakSpace - start] = zeroWidthSpace; - } - } else { - bufferLength = GlyphPage::size * 2; - for (i = 0; i < GlyphPage::size; i++) { - int c = i + start; - buffer[i * 2] = U16_LEAD(c); - buffer[i * 2 + 1] = U16_TRAIL(c); - } - } - - // Now that we have a buffer full of characters, we want to get back an - // array of glyph indices. This part involves calling into the - // platform-specific routine of our glyph map for actually filling in the - // page with the glyphs. Success is not guaranteed. For example, Times - // fails to fill page 260, giving glyph data for only 128 out of 256 - // characters. - bool haveGlyphs; - if (!fontData->isSegmented()) { - m_page = GlyphPage::createForSingleFontData(this, - toSimpleFontData(fontData)); - haveGlyphs = fill(m_page.get(), 0, GlyphPage::size, buffer, - bufferLength, toSimpleFontData(fontData)); - } else { - m_page = GlyphPage::createForMixedFontData(this); - haveGlyphs = false; - - const SegmentedFontData* segmentedFontData = - toSegmentedFontData(fontData); - for (int i = segmentedFontData->numRanges() - 1; i >= 0; i--) { - const FontDataRange& range = segmentedFontData->rangeAt(i); - // all this casting is to ensure all the parameters to min and max - // have the same type, to avoid ambiguous template parameter errors on - // Windows - int from = - max(0, static_cast(range.from()) - static_cast(start)); - int to = - 1 + min(static_cast(range.to()) - static_cast(start), - static_cast(GlyphPage::size) - 1); - if (from >= static_cast(GlyphPage::size) || to <= 0) - continue; - - // If this is a custom font needs to be loaded, do not fill - // the page so that font fallback is used while loading. - RefPtr customData = - range.fontData()->customFontData(); - if (customData && customData->isLoadingFallback()) { - for (int j = from; j < to; j++) { - m_page->setCustomFontToLoad(j, customData.get()); - haveGlyphs = true; - } - continue; - } - - haveGlyphs |= fill(m_page.get(), from, to - from, - buffer + from * (start < 0x10000 ? 1 : 2), - (to - from) * (start < 0x10000 ? 1 : 2), - range.fontData().get()); - } - } - - if (!haveGlyphs) - m_page = nullptr; - } else if (parentPage && parentPage->owner() != m_parent) { - // The page we're overriding may not be owned by our parent node. - // This happens when our parent node provides no useful overrides - // and just copies the pointer to an already-existing page (see - // below). - // - // We want our override to be shared by all nodes that reference - // that page to avoid duplication, and so standardize on having the - // page's owner collect all the overrides. Call getChild on the - // page owner with the desired font data (this will populate - // the page) and then reference it. - m_page = parentPage->owner()->getChild(fontData, pageNumber)->page(); - } else { - // Get the pure page for the fallback font (at level 1 with no - // overrides). getRootChild will always create a page if one - // doesn't exist, but the page doesn't necessarily have glyphs - // (this pointer may be 0). - GlyphPage* fallbackPage = getRootChild(fontData, pageNumber)->page(); - if (!parentPage) { - // When the parent has no glyphs for this page, we can easily - // override it just by supplying the glyphs from our font. - m_page = fallbackPage; - } else if (!fallbackPage) { - // When our font has no glyphs for this page, we can just reference the - // parent page. - m_page = parentPage; - } else { - // Combine the parent's glyphs and ours to form a new more complete - // page. - m_page = GlyphPage::createForMixedFontData(this); - - // Overlay the parent page on the fallback page. Check if the fallback - // font has added anything. - bool newGlyphs = false; - for (unsigned i = 0; i < GlyphPage::size; i++) { - if (parentPage->glyphAt(i)) { - m_page->setGlyphDataForIndex(i, parentPage->glyphDataForIndex(i)); - } else if (fallbackPage->glyphAt(i)) { - m_page->setGlyphDataForIndex(i, fallbackPage->glyphDataForIndex(i)); - newGlyphs = true; - } - - if (parentPage->customFontToLoadAt(i)) { - m_page->setCustomFontToLoad(i, parentPage->customFontToLoadAt(i)); - } else if (fallbackPage->customFontToLoadAt(i) && - !parentPage->glyphAt(i)) { - m_page->setCustomFontToLoad(i, fallbackPage->customFontToLoadAt(i)); - newGlyphs = true; - } - } - - if (!newGlyphs) - // We didn't override anything, so our override is just the parent - // page. - m_page = parentPage; - } - } - } else { - // System fallback. Initialized with the parent's page here, as individual - // entries may use different fonts depending on character. If the Font - // ever finds it needs a glyph out of the system fallback page, it will - // ask the system for the best font to use and fill that glyph in for us. - if (parentPage) - m_page = parentPage->createCopiedSystemFallbackPage(this); - else - m_page = GlyphPage::createForMixedFontData(this); - } -} - -GlyphPageTreeNode* GlyphPageTreeNode::getChild(const FontData* fontData, - unsigned pageNumber) { - ASSERT(fontData || !m_isSystemFallback); - ASSERT(pageNumber == m_pageNumber); - - if (GlyphPageTreeNode* foundChild = - fontData ? m_children.get(fontData) : m_systemFallbackChild.get()) - return foundChild; - - GlyphPageTreeNode* child = new GlyphPageTreeNode; - child->m_parent = this; - child->m_level = m_level + 1; - if (fontData && fontData->isCustomFont()) { - for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent) - curr->m_customFontCount++; - } - -#if ENABLE(ASSERT) - child->m_pageNumber = m_pageNumber; -#endif - if (fontData) { - m_children.set(fontData, adoptPtr(child)); - fontData->setMaxGlyphPageTreeLevel( - max(fontData->maxGlyphPageTreeLevel(), child->m_level)); - } else { - m_systemFallbackChild = adoptPtr(child); - child->m_isSystemFallback = true; - } - child->initializePage(fontData, pageNumber); - return child; -} - -void GlyphPageTreeNode::pruneCustomFontData(const FontData* fontData) { - if (!fontData || !m_customFontCount) - return; - - // Prune any branch that contains this FontData. - if (OwnPtr node = m_children.take(fontData)) { - if (unsigned customFontCount = node->m_customFontCount + 1) { - for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent) - curr->m_customFontCount -= customFontCount; - } - } - - // Check any branches that remain that still have custom fonts underneath - // them. - if (!m_customFontCount) - return; - - GlyphPageTreeNodeMap::iterator end = m_children.end(); - for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it) - it->value->pruneCustomFontData(fontData); -} - -void GlyphPageTreeNode::pruneFontData(const SimpleFontData* fontData, - unsigned level) { - ASSERT(fontData); - - // Prune fall back child (if any) of this font. - if (m_systemFallbackChild && m_systemFallbackChild->m_page) - m_systemFallbackChild->m_page->removeFontDataFromSystemFallbackPage( - fontData); - - // Prune any branch that contains this FontData. - if (OwnPtr node = m_children.take(fontData)) { - if (unsigned customFontCount = node->m_customFontCount) { - for (GlyphPageTreeNode* curr = this; curr; curr = curr->m_parent) - curr->m_customFontCount -= customFontCount; - } - } - - level++; - if (level > fontData->maxGlyphPageTreeLevel()) - return; - - GlyphPageTreeNodeMap::iterator end = m_children.end(); - for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it) - it->value->pruneFontData(fontData, level); -} - -#ifndef NDEBUG -void GlyphPageTreeNode::showSubtree() { - Vector indent(level()); - indent.fill('\t', level()); - indent.append(0); - - GlyphPageTreeNodeMap::iterator end = m_children.end(); - for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; - ++it) { - printf("%s\t%p %s\n", indent.data(), it->key, - it->key->description().utf8().data()); - it->value->showSubtree(); - } - if (m_systemFallbackChild) { - printf("%s\t* fallback\n", indent.data()); - m_systemFallbackChild->showSubtree(); - } -} -#endif - -} // namespace blink - -#ifndef NDEBUG -void showGlyphPageTrees() { - printf("Page 0:\n"); - showGlyphPageTree(0); - HashMap::iterator end = - blink::GlyphPageTreeNode::roots->end(); - for (HashMap::iterator it = - blink::GlyphPageTreeNode::roots->begin(); - it != end; ++it) { - printf("\nPage %d:\n", it->key); - showGlyphPageTree(it->key); - } -} - -void showGlyphPageTree(unsigned pageNumber) { - blink::GlyphPageTreeNode::getRoot(pageNumber)->showSubtree(); -} -#endif diff --git a/sky/engine/platform/fonts/GlyphPageTreeNode.h b/sky/engine/platform/fonts/GlyphPageTreeNode.h deleted file mode 100644 index f04f0cdc8645a..0000000000000 --- a/sky/engine/platform/fonts/GlyphPageTreeNode.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_GLYPHPAGETREENODE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_GLYPHPAGETREENODE_H_ - -#include -#include "flutter/sky/engine/platform/fonts/GlyphPage.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -#ifndef NDEBUG -void PLATFORM_EXPORT showGlyphPageTrees(); -void PLATFORM_EXPORT showGlyphPageTree(unsigned pageNumber); -#endif - -namespace blink { - -class FontData; -class SimpleFontData; - -// The glyph page tree is a data structure that maps (FontData, glyph page -// number) to a GlyphPage. Level 0 (the "root") is special. There is one root -// GlyphPageTreeNode for each glyph page number. The roots do not have a -// GlyphPage associated with them, and their initializePage() function is never -// called to fill the glyphs. -// -// Each root node maps a FontData pointer to another GlyphPageTreeNode at -// level 1 (the "root child") that stores the actual glyphs for a specific font -// data. These nodes will only have a GlyphPage if they have glyphs for that -// range. -// -// Levels greater than one correspond to subsequent levels of the fallback list -// for that font. These levels override their parent's page of glyphs by -// filling in holes with the new font (thus making a more complete page). -// -// A NULL FontData pointer corresponds to the system fallback -// font. It is tracked separately from the regular pages and overrides so that -// the glyph pages do not get polluted with these last-resort glyphs. The -// system fallback page is not populated at construction like the other pages, -// but on demand for each glyph, because the system may need to use different -// fallback fonts for each. This lazy population is done by the Font. -class PLATFORM_EXPORT GlyphPageTreeNode { - WTF_MAKE_FAST_ALLOCATED; - WTF_MAKE_NONCOPYABLE(GlyphPageTreeNode); - - public: - static GlyphPageTreeNode* getRootChild(const FontData* fontData, - unsigned pageNumber) { - return getRoot(pageNumber)->getChild(fontData, pageNumber); - } - - static void pruneTreeCustomFontData(const FontData*); - static void pruneTreeFontData(const SimpleFontData*); - - void pruneCustomFontData(const FontData*); - void pruneFontData(const SimpleFontData*, unsigned level = 0); - - GlyphPageTreeNode* parent() const { return m_parent; } - GlyphPageTreeNode* getChild(const FontData*, unsigned pageNumber); - - // Returns a page of glyphs (or NULL if there are no glyphs in this page's - // character range). - GlyphPage* page() const { return m_page.get(); } - - // Returns the level of this node. See class-level comment. - unsigned level() const { return m_level; } - - // The system fallback font has special rules (see above). - bool isSystemFallback() const { return m_isSystemFallback; } - - static size_t treeGlyphPageCount(); - size_t pageCount() const; - - private: - GlyphPageTreeNode() - : m_parent(0), - m_level(0), - m_isSystemFallback(false), - m_customFontCount(0) -#if ENABLE(ASSERT) - , - m_pageNumber(0) -#endif - { - } - - static GlyphPageTreeNode* getRoot(unsigned pageNumber); - void initializePage(const FontData*, unsigned pageNumber); - -#ifndef NDEBUG - void showSubtree(); -#endif - - static HashMap* roots; - static GlyphPageTreeNode* pageZeroRoot; - - typedef HashMap> - GlyphPageTreeNodeMap; - - GlyphPageTreeNodeMap m_children; - GlyphPageTreeNode* m_parent; - RefPtr m_page; - unsigned m_level : 31; - bool m_isSystemFallback : 1; - unsigned m_customFontCount; - OwnPtr m_systemFallbackChild; - -#if ENABLE(ASSERT) - unsigned m_pageNumber; -#endif -#ifndef NDEBUG - friend void ::showGlyphPageTrees(); - friend void ::showGlyphPageTree(unsigned pageNumber); -#endif -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_GLYPHPAGETREENODE_H_ diff --git a/sky/engine/platform/fonts/GlyphPageTreeNodeTest.cpp b/sky/engine/platform/fonts/GlyphPageTreeNodeTest.cpp deleted file mode 100644 index cf3f8fea8dee6..0000000000000 --- a/sky/engine/platform/fonts/GlyphPageTreeNodeTest.cpp +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/platform/fonts/GlyphPageTreeNode.h" - -#include -#include "flutter/sky/engine/platform/fonts/SegmentedFontData.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" - -namespace blink { - -class TestCustomFontData : public CustomFontData { - public: - static PassRefPtr create() { - return adoptRef(new TestCustomFontData()); - } - - private: - TestCustomFontData() {} - virtual bool isLoadingFallback() const override { return true; } -}; - -class TestSimpleFontData : public SimpleFontData { - public: - static PassRefPtr create(UChar32 from, UChar32 to) { - return adoptRef(new TestSimpleFontData(nullptr, from, to)); - } - - static PassRefPtr createUnloaded(UChar32 from, - UChar32 to) { - return adoptRef( - new TestSimpleFontData(TestCustomFontData::create(), from, to)); - } - - private: - TestSimpleFontData(PassRefPtr customData, - UChar32 from, - UChar32 to) - : SimpleFontData(customData, 10, false, false), m_from(from), m_to(to) {} - - bool fillGlyphPage(GlyphPage* pageToFill, - unsigned offset, - unsigned length, - UChar* buffer, - unsigned bufferLength) const override { - const Glyph kGlyph = 1; - String bufferString(buffer, bufferLength); - unsigned bufferIndex = 0; - bool hasGlyphs = false; - for (unsigned i = 0; i < length; i++) { - UChar32 c = bufferString.characterStartingAt(bufferIndex); - bufferIndex += U16_LENGTH(c); - if (m_from <= c && c <= m_to) { - pageToFill->setGlyphDataForIndex(offset + i, kGlyph, this); - hasGlyphs = true; - } - } - return hasGlyphs; - } - - UChar32 m_from; - UChar32 m_to; -}; - -TEST(GlyphPageTreeNode, rootChild) { - const unsigned kPageNumber = 0; - size_t pageCountBeforeTest = GlyphPageTreeNode::treeGlyphPageCount(); - { - RefPtr data = TestSimpleFontData::create('a', 'z'); - GlyphPageTreeNode* node = - GlyphPageTreeNode::getRootChild(data.get(), kPageNumber); - EXPECT_EQ(pageCountBeforeTest + 1, GlyphPageTreeNode::treeGlyphPageCount()); - EXPECT_TRUE(node->page()->glyphAt('a')); - EXPECT_FALSE(node->page()->glyphAt('A')); - EXPECT_FALSE(node->isSystemFallback()); - EXPECT_EQ(1u, node->level()); - EXPECT_EQ(node, node->page()->owner()); - } - EXPECT_EQ(pageCountBeforeTest, GlyphPageTreeNode::treeGlyphPageCount()); -} - -TEST(GlyphPageTreeNode, level2) { - const unsigned kPageNumber = 0; - size_t pageCountBeforeTest = GlyphPageTreeNode::treeGlyphPageCount(); - { - RefPtr dataAtoC = TestSimpleFontData::create('A', 'C'); - RefPtr dataCtoE = TestSimpleFontData::create('C', 'E'); - GlyphPageTreeNode* node1 = - GlyphPageTreeNode::getRootChild(dataAtoC.get(), kPageNumber); - GlyphPageTreeNode* node2 = node1->getChild(dataCtoE.get(), kPageNumber); - EXPECT_EQ(pageCountBeforeTest + 3, GlyphPageTreeNode::treeGlyphPageCount()); - - EXPECT_EQ(2u, node2->level()); - EXPECT_EQ(dataAtoC, node2->page()->glyphDataForCharacter('A').fontData); - EXPECT_EQ(dataAtoC, node2->page()->glyphDataForCharacter('C').fontData); - EXPECT_EQ(dataCtoE, node2->page()->glyphDataForCharacter('E').fontData); - } - EXPECT_EQ(pageCountBeforeTest, GlyphPageTreeNode::treeGlyphPageCount()); -} - -TEST(GlyphPageTreeNode, segmentedData) { - const unsigned kPageNumber = 0; - size_t pageCountBeforeTest = GlyphPageTreeNode::treeGlyphPageCount(); - { - RefPtr dataBtoC = TestSimpleFontData::create('B', 'C'); - RefPtr dataCtoE = TestSimpleFontData::create('C', 'E'); - RefPtr segmentedData = SegmentedFontData::create(); - segmentedData->appendRange(FontDataRange('A', 'C', dataBtoC)); - segmentedData->appendRange(FontDataRange('C', 'D', dataCtoE)); - GlyphPageTreeNode* node = - GlyphPageTreeNode::getRootChild(segmentedData.get(), kPageNumber); - - EXPECT_EQ(0, node->page()->glyphDataForCharacter('A').fontData); - EXPECT_EQ(dataBtoC, node->page()->glyphDataForCharacter('B').fontData); - EXPECT_EQ(dataBtoC, node->page()->glyphDataForCharacter('C').fontData); - EXPECT_EQ(dataCtoE, node->page()->glyphDataForCharacter('D').fontData); - EXPECT_EQ(0, node->page()->glyphDataForCharacter('E').fontData); - } - EXPECT_EQ(pageCountBeforeTest, GlyphPageTreeNode::treeGlyphPageCount()); -} - -TEST(GlyphPageTreeNode, outsideBMP) { - const unsigned kPageNumber = 0x1f300 / GlyphPage::size; - size_t pageCountBeforeTest = GlyphPageTreeNode::treeGlyphPageCount(); - { - RefPtr data = - TestSimpleFontData::create(0x1f310, 0x1f320); - GlyphPageTreeNode* node = - GlyphPageTreeNode::getRootChild(data.get(), kPageNumber); - EXPECT_EQ(pageCountBeforeTest + 1, GlyphPageTreeNode::treeGlyphPageCount()); - EXPECT_FALSE(node->page()->glyphForCharacter(0x1f30f)); - EXPECT_TRUE(node->page()->glyphForCharacter(0x1f310)); - EXPECT_TRUE(node->page()->glyphForCharacter(0x1f320)); - EXPECT_FALSE(node->page()->glyphForCharacter(0x1f321)); - } - EXPECT_EQ(pageCountBeforeTest, GlyphPageTreeNode::treeGlyphPageCount()); -} - -TEST(GlyphPageTreeNode, customData) { - const unsigned kPageNumber = 0; - size_t pageCountBeforeTest = GlyphPageTreeNode::treeGlyphPageCount(); - { - RefPtr dataAtoC = - TestSimpleFontData::createUnloaded('A', 'C'); - RefPtr dataBtoD = TestSimpleFontData::create('B', 'D'); - RefPtr dataCtoE = - TestSimpleFontData::createUnloaded('C', 'E'); - RefPtr segmentedData = SegmentedFontData::create(); - segmentedData->appendRange(FontDataRange('A', 'C', dataAtoC)); - segmentedData->appendRange(FontDataRange('B', 'D', dataBtoD)); - segmentedData->appendRange(FontDataRange('C', 'E', dataCtoE)); - GlyphPageTreeNode* node = - GlyphPageTreeNode::getRootChild(segmentedData.get(), kPageNumber); - - EXPECT_EQ(0, node->page()->glyphDataForCharacter('A').fontData); - EXPECT_EQ(dataBtoD, node->page()->glyphDataForCharacter('B').fontData); - EXPECT_EQ(dataBtoD, node->page()->glyphDataForCharacter('C').fontData); - EXPECT_EQ(dataBtoD, node->page()->glyphDataForCharacter('D').fontData); - EXPECT_EQ(0, node->page()->glyphDataForCharacter('E').fontData); - - EXPECT_EQ(dataAtoC->customFontData(), - node->page()->customFontToLoadAt('A')); - EXPECT_EQ(dataAtoC->customFontData(), - node->page()->customFontToLoadAt('B')); - EXPECT_EQ(dataAtoC->customFontData(), - node->page()->customFontToLoadAt('C')); - EXPECT_EQ(0, node->page()->customFontToLoadAt('D')); - EXPECT_EQ(dataCtoE->customFontData(), - node->page()->customFontToLoadAt('E')); - } - EXPECT_EQ(pageCountBeforeTest, GlyphPageTreeNode::treeGlyphPageCount()); -} - -TEST(GlyphPageTreeNode, customDataWithMultiplePages) { - const unsigned kPageNumber = 0; - size_t pageCountBeforeTest = GlyphPageTreeNode::treeGlyphPageCount(); - { - RefPtr dataAtoC = - TestSimpleFontData::createUnloaded('A', 'C'); - RefPtr dataBtoD = TestSimpleFontData::create('B', 'D'); - RefPtr dataCtoE = - TestSimpleFontData::createUnloaded('C', 'E'); - RefPtr segmentedData1 = SegmentedFontData::create(); - RefPtr segmentedData2 = SegmentedFontData::create(); - RefPtr segmentedData3 = SegmentedFontData::create(); - segmentedData1->appendRange(FontDataRange('A', 'C', dataAtoC)); - segmentedData2->appendRange(FontDataRange('B', 'D', dataBtoD)); - segmentedData3->appendRange(FontDataRange('C', 'E', dataCtoE)); - GlyphPageTreeNode* node1 = - GlyphPageTreeNode::getRootChild(segmentedData1.get(), kPageNumber); - GlyphPageTreeNode* node2 = - node1->getChild(segmentedData2.get(), kPageNumber); - GlyphPageTreeNode* node3 = - node2->getChild(segmentedData3.get(), kPageNumber); - - EXPECT_EQ(0, node3->page()->glyphDataForCharacter('A').fontData); - EXPECT_EQ(dataBtoD, node3->page()->glyphDataForCharacter('B').fontData); - EXPECT_EQ(dataBtoD, node3->page()->glyphDataForCharacter('C').fontData); - EXPECT_EQ(dataBtoD, node3->page()->glyphDataForCharacter('D').fontData); - EXPECT_EQ(0, node3->page()->glyphDataForCharacter('E').fontData); - - EXPECT_EQ(dataAtoC->customFontData(), - node3->page()->customFontToLoadAt('A')); - EXPECT_EQ(dataAtoC->customFontData(), - node3->page()->customFontToLoadAt('B')); - EXPECT_EQ(dataAtoC->customFontData(), - node3->page()->customFontToLoadAt('C')); - EXPECT_EQ(0, node3->page()->customFontToLoadAt('D')); - EXPECT_EQ(dataCtoE->customFontData(), - node3->page()->customFontToLoadAt('E')); - } - EXPECT_EQ(pageCountBeforeTest, GlyphPageTreeNode::treeGlyphPageCount()); -} - -TEST(GlyphPageTreeNode, systemFallback) { - const unsigned kPageNumber = 0; - size_t pageCountBeforeTest = GlyphPageTreeNode::treeGlyphPageCount(); - { - RefPtr dataAtoC = - TestSimpleFontData::createUnloaded('A', 'C'); - RefPtr dataBtoD = TestSimpleFontData::create('B', 'D'); - RefPtr segmentedData = SegmentedFontData::create(); - segmentedData->appendRange(FontDataRange('A', 'C', dataAtoC)); - GlyphPageTreeNode* node1 = - GlyphPageTreeNode::getRootChild(segmentedData.get(), kPageNumber); - GlyphPageTreeNode* node2 = node1->getChild(dataBtoD.get(), kPageNumber); - GlyphPageTreeNode* node3 = node2->getChild(0, kPageNumber); - - EXPECT_TRUE(node3->isSystemFallback()); - - EXPECT_EQ(0, node3->page()->glyphDataForCharacter('A').fontData); - EXPECT_EQ(dataBtoD, node3->page()->glyphDataForCharacter('B').fontData); - EXPECT_EQ(dataBtoD, node3->page()->glyphDataForCharacter('C').fontData); - EXPECT_EQ(dataBtoD, node3->page()->glyphDataForCharacter('D').fontData); - - EXPECT_EQ(dataAtoC->customFontData(), - node3->page()->customFontToLoadAt('A')); - EXPECT_EQ(dataAtoC->customFontData(), - node3->page()->customFontToLoadAt('B')); - EXPECT_EQ(dataAtoC->customFontData(), - node3->page()->customFontToLoadAt('C')); - EXPECT_EQ(0, node3->page()->customFontToLoadAt('D')); - } - EXPECT_EQ(pageCountBeforeTest, GlyphPageTreeNode::treeGlyphPageCount()); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/Latin1TextIterator.h b/sky/engine/platform/fonts/Latin1TextIterator.h deleted file mode 100644 index 249658087aad2..0000000000000 --- a/sky/engine/platform/fonts/Latin1TextIterator.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * Copyright (C) Research In Motion Limited 2011. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_LATIN1TEXTITERATOR_H_ -#define SKY_ENGINE_PLATFORM_FONTS_LATIN1TEXTITERATOR_H_ - -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -class Latin1TextIterator { - public: - // The passed in LChar pointer starts at 'currentCharacter'. The iterator - // operates on the range [currentCharacter, lastCharacter]. 'endCharacter' - // denotes the maximum length of the UChar array, which might exceed - // 'lastCharacter'. - Latin1TextIterator(const LChar* characters, - int currentCharacter, - int lastCharacter, - int /*endCharacter*/) - : m_characters(characters), - m_currentCharacter(currentCharacter), - m_lastCharacter(lastCharacter) {} - - bool consume(UChar32& character, unsigned& clusterLength) { - if (m_currentCharacter >= m_lastCharacter) - return false; - - character = *m_characters; - clusterLength = 1; - return true; - } - - void advance(unsigned advanceLength) { - m_characters += advanceLength; - m_currentCharacter += advanceLength; - } - - int currentCharacter() const { return m_currentCharacter; } - const LChar* characters() const { return m_characters; } - - private: - const LChar* m_characters; - int m_currentCharacter; - int m_lastCharacter; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_LATIN1TEXTITERATOR_H_ diff --git a/sky/engine/platform/fonts/SegmentedFontData.cpp b/sky/engine/platform/fonts/SegmentedFontData.cpp deleted file mode 100644 index f92694c4fa265..0000000000000 --- a/sky/engine/platform/fonts/SegmentedFontData.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/SegmentedFontData.h" - -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -SegmentedFontData::~SegmentedFontData() { - GlyphPageTreeNode::pruneTreeCustomFontData(this); -} - -const SimpleFontData* SegmentedFontData::fontDataForCharacter(UChar32 c) const { - Vector::const_iterator end = m_ranges.end(); - for (Vector::const_iterator it = m_ranges.begin(); it != end; - ++it) { - if (it->from() <= c && it->to() >= c) - return it->fontData().get(); - } - return m_ranges[0].fontData().get(); -} - -bool SegmentedFontData::containsCharacter(UChar32 c) const { - Vector::const_iterator end = m_ranges.end(); - for (Vector::const_iterator it = m_ranges.begin(); it != end; - ++it) { - if (c >= it->from() && c <= it->to()) - return true; - } - return false; -} - -bool SegmentedFontData::isCustomFont() const { - // All segmented fonts are custom fonts. - return true; -} - -bool SegmentedFontData::isLoading() const { - Vector::const_iterator end = m_ranges.end(); - for (Vector::const_iterator it = m_ranges.begin(); it != end; - ++it) { - if (it->fontData()->isLoading()) - return true; - } - return false; -} - -// Returns true if any of the sub fonts are loadingFallback. -bool SegmentedFontData::isLoadingFallback() const { - Vector::const_iterator end = m_ranges.end(); - for (Vector::const_iterator it = m_ranges.begin(); it != end; - ++it) { - if (it->fontData()->isLoadingFallback()) - return true; - } - return false; -} - -bool SegmentedFontData::isSegmented() const { - return true; -} - -bool SegmentedFontData::shouldSkipDrawing() const { - Vector::const_iterator end = m_ranges.end(); - for (Vector::const_iterator it = m_ranges.begin(); it != end; - ++it) { - if (it->fontData()->shouldSkipDrawing()) - return true; - } - return false; -} - -#ifndef NDEBUG -String SegmentedFontData::description() const { - return "[segmented font]"; -} -#endif - -} // namespace blink diff --git a/sky/engine/platform/fonts/SegmentedFontData.h b/sky/engine/platform/fonts/SegmentedFontData.h deleted file mode 100644 index 899f612daac43..0000000000000 --- a/sky/engine/platform/fonts/SegmentedFontData.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_SEGMENTEDFONTDATA_H_ -#define SKY_ENGINE_PLATFORM_FONTS_SEGMENTEDFONTDATA_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/FontData.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class SimpleFontData; - -struct FontDataRange { - FontDataRange(UChar32 from, UChar32 to, PassRefPtr fontData) - : m_from(from), m_to(to), m_fontData(fontData) {} - - UChar32 from() const { return m_from; } - UChar32 to() const { return m_to; } - bool isEntireRange() const { return !m_from && m_to >= 0x10ffff; } - PassRefPtr fontData() const { return m_fontData; } - - private: - UChar32 m_from; - UChar32 m_to; - RefPtr m_fontData; -}; - -class PLATFORM_EXPORT SegmentedFontData : public FontData { - public: - static PassRefPtr create() { - return adoptRef(new SegmentedFontData); - } - - virtual ~SegmentedFontData(); - - void appendRange(const FontDataRange& range) { m_ranges.append(range); } - unsigned numRanges() const { return m_ranges.size(); } - const FontDataRange& rangeAt(unsigned i) const { return m_ranges[i]; } - bool containsCharacter(UChar32) const; - -#ifndef NDEBUG - virtual String description() const override; -#endif - - private: - SegmentedFontData() {} - - virtual const SimpleFontData* fontDataForCharacter(UChar32) const override; - - virtual bool isCustomFont() const override; - virtual bool isLoading() const override; - virtual bool isLoadingFallback() const override; - virtual bool isSegmented() const override; - virtual bool shouldSkipDrawing() const override; - - Vector m_ranges; -}; - -DEFINE_FONT_DATA_TYPE_CASTS(SegmentedFontData, true); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_SEGMENTEDFONTDATA_H_ diff --git a/sky/engine/platform/fonts/SimpleFontData.cpp b/sky/engine/platform/fonts/SimpleFontData.cpp deleted file mode 100644 index bf19a2d067f5a..0000000000000 --- a/sky/engine/platform/fonts/SimpleFontData.cpp +++ /dev/null @@ -1,272 +0,0 @@ -/* - * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2006 Alexey Proskuryakov - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" - -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -const float smallCapsFontSizeMultiplier = 0.7f; -const float emphasisMarkFontSizeMultiplier = 0.5f; - -SimpleFontData::SimpleFontData(const FontPlatformData& platformData, - PassRefPtr customData, - bool isTextOrientationFallback) - : m_maxCharWidth(-1), - m_avgCharWidth(-1), - m_platformData(platformData), - m_treatAsFixedPitch(false), - m_isTextOrientationFallback(isTextOrientationFallback), - m_isBrokenIdeographFallback(false) -#if ENABLE(OPENTYPE_VERTICAL) - , - m_verticalData(nullptr) -#endif - , - m_hasVerticalGlyphs(false), - m_customFontData(customData) { - platformInit(); - platformGlyphInit(); - platformCharWidthInit(); -#if ENABLE(OPENTYPE_VERTICAL) - if (platformData.orientation() == Vertical && !isTextOrientationFallback) { - m_verticalData = platformData.verticalData(); - m_hasVerticalGlyphs = - m_verticalData.get() && m_verticalData->hasVerticalMetrics(); - } -#endif -} - -SimpleFontData::SimpleFontData(PassRefPtr customData, - float fontSize, - bool syntheticBold, - bool syntheticItalic) - : m_platformData( - FontPlatformData(fontSize, syntheticBold, syntheticItalic)), - m_treatAsFixedPitch(false), - m_isTextOrientationFallback(false), - m_isBrokenIdeographFallback(false) -#if ENABLE(OPENTYPE_VERTICAL) - , - m_verticalData(nullptr) -#endif - , - m_hasVerticalGlyphs(false), - m_customFontData(customData) { - if (m_customFontData) - m_customFontData->initializeFontData(this, fontSize); -} - -// Estimates of avgCharWidth and maxCharWidth for platforms that don't support -// accessing these values from the font. -void SimpleFontData::initCharWidths() { - GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page(); - - // Treat the width of a '0' as the avgCharWidth. - if (m_avgCharWidth <= 0.f && glyphPageZero) { - static const UChar32 digitZeroChar = '0'; - Glyph digitZeroGlyph = glyphPageZero->glyphForCharacter(digitZeroChar); - if (digitZeroGlyph) - m_avgCharWidth = widthForGlyph(digitZeroGlyph); - } - - // If we can't retrieve the width of a '0', fall back to the x height. - if (m_avgCharWidth <= 0.f) - m_avgCharWidth = m_fontMetrics.xHeight(); - - if (m_maxCharWidth <= 0.f) - m_maxCharWidth = std::max(m_avgCharWidth, m_fontMetrics.floatAscent()); -} - -void SimpleFontData::platformGlyphInit() { - GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page(); - if (!glyphPageZero) { - WTF_LOG_ERROR("Failed to get glyph page zero."); - m_spaceGlyph = 0; - m_spaceWidth = 0; - m_zeroGlyph = 0; - determinePitch(); - m_zeroWidthSpaceGlyph = 0; - m_missingGlyphData.fontData = this; - m_missingGlyphData.glyph = 0; - return; - } - - m_zeroWidthSpaceGlyph = glyphPageZero->glyphForCharacter(0); - - // Nasty hack to determine if we should round or ceil space widths. - // If the font is monospace or fake monospace we ceil to ensure that - // every character and the space are the same width. Otherwise we round. - m_spaceGlyph = glyphPageZero->glyphForCharacter(' '); - float width = widthForGlyph(m_spaceGlyph); - m_spaceWidth = width; - m_zeroGlyph = glyphPageZero->glyphForCharacter('0'); - m_fontMetrics.setZeroWidth(widthForGlyph(m_zeroGlyph)); - determinePitch(); - - // Force the glyph for ZERO WIDTH SPACE to have zero width, unless it is - // shared with SPACE. Helvetica is an example of a non-zero width ZERO WIDTH - // SPACE glyph. See Ask for the - // glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control characters, - // including 0, are mapped to the ZERO WIDTH SPACE glyph. - if (m_zeroWidthSpaceGlyph == m_spaceGlyph) { - m_zeroWidthSpaceGlyph = 0; - } - - m_missingGlyphData.fontData = this; - m_missingGlyphData.glyph = 0; -} - -SimpleFontData::~SimpleFontData() { - if (!isSVGFont()) - platformDestroy(); - - if (isCustomFont()) - GlyphPageTreeNode::pruneTreeCustomFontData(this); - else - GlyphPageTreeNode::pruneTreeFontData(this); -} - -const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const { - return this; -} - -Glyph SimpleFontData::glyphForCharacter(UChar32 character) const { - // As GlyphPage::size is power of 2 so shifting is valid - GlyphPageTreeNode* node = - GlyphPageTreeNode::getRootChild(this, character >> GlyphPage::sizeBits); - return node->page() ? node->page()->glyphAt(character & 0xFF) : 0; -} - -bool SimpleFontData::isSegmented() const { - return false; -} - -PassRefPtr SimpleFontData::verticalRightOrientationFontData() - const { - if (!m_derivedFontData) - m_derivedFontData = DerivedFontData::create(isCustomFont()); - if (!m_derivedFontData->verticalRightOrientation) { - FontPlatformData verticalRightPlatformData(m_platformData); - verticalRightPlatformData.setOrientation(Horizontal); - m_derivedFontData->verticalRightOrientation = - create(verticalRightPlatformData, - isCustomFont() ? CustomFontData::create() : nullptr, true); - } - return m_derivedFontData->verticalRightOrientation; -} - -PassRefPtr SimpleFontData::uprightOrientationFontData() const { - if (!m_derivedFontData) - m_derivedFontData = DerivedFontData::create(isCustomFont()); - if (!m_derivedFontData->uprightOrientation) - m_derivedFontData->uprightOrientation = - create(m_platformData, - isCustomFont() ? CustomFontData::create() : nullptr, true); - return m_derivedFontData->uprightOrientation; -} - -PassRefPtr SimpleFontData::smallCapsFontData( - const FontDescription& fontDescription) const { - if (!m_derivedFontData) - m_derivedFontData = DerivedFontData::create(isCustomFont()); - if (!m_derivedFontData->smallCaps) - m_derivedFontData->smallCaps = - createScaledFontData(fontDescription, smallCapsFontSizeMultiplier); - - return m_derivedFontData->smallCaps; -} - -PassRefPtr SimpleFontData::emphasisMarkFontData( - const FontDescription& fontDescription) const { - if (!m_derivedFontData) - m_derivedFontData = DerivedFontData::create(isCustomFont()); - if (!m_derivedFontData->emphasisMark) - m_derivedFontData->emphasisMark = - createScaledFontData(fontDescription, emphasisMarkFontSizeMultiplier); - - return m_derivedFontData->emphasisMark; -} - -PassRefPtr SimpleFontData::brokenIdeographFontData() const { - if (!m_derivedFontData) - m_derivedFontData = DerivedFontData::create(isCustomFont()); - if (!m_derivedFontData->brokenIdeograph) { - m_derivedFontData->brokenIdeograph = create( - m_platformData, isCustomFont() ? CustomFontData::create() : nullptr); - m_derivedFontData->brokenIdeograph->m_isBrokenIdeographFallback = true; - } - return m_derivedFontData->brokenIdeograph; -} - -#ifndef NDEBUG -String SimpleFontData::description() const { - if (isSVGFont()) - return "[SVG font]"; - if (isCustomFont()) - return "[custom font]"; - - return platformData().description(); -} -#endif - -PassOwnPtr -SimpleFontData::DerivedFontData::create(bool forCustomFont) { - return adoptPtr(new DerivedFontData(forCustomFont)); -} - -SimpleFontData::DerivedFontData::~DerivedFontData() { - if (!forCustomFont) - return; - - if (smallCaps) - GlyphPageTreeNode::pruneTreeCustomFontData(smallCaps.get()); - if (emphasisMark) - GlyphPageTreeNode::pruneTreeCustomFontData(emphasisMark.get()); - if (brokenIdeograph) - GlyphPageTreeNode::pruneTreeCustomFontData(brokenIdeograph.get()); - if (verticalRightOrientation) - GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get()); - if (uprightOrientation) - GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get()); -} - -PassRefPtr SimpleFontData::createScaledFontData( - const FontDescription& fontDescription, - float scaleFactor) const { - // FIXME: Support scaled SVG fonts. Given that SVG is scalable in general this - // should be achievable. - if (isSVGFont()) - return nullptr; - - return platformCreateScaledFontData(fontDescription, scaleFactor); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/SimpleFontData.h b/sky/engine/platform/fonts/SimpleFontData.h deleted file mode 100644 index 30afc0484f8c2..0000000000000 --- a/sky/engine/platform/fonts/SimpleFontData.h +++ /dev/null @@ -1,305 +0,0 @@ -/* - * This file is part of the internal font implementation. - * - * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2007-2008 Torch Mobile, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_SIMPLEFONTDATA_H_ -#define SKY_ENGINE_PLATFORM_FONTS_SIMPLEFONTDATA_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/CustomFontData.h" -#include "flutter/sky/engine/platform/fonts/FontBaseline.h" -#include "flutter/sky/engine/platform/fonts/FontData.h" -#include "flutter/sky/engine/platform/fonts/FontMetrics.h" -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" -#include "flutter/sky/engine/platform/fonts/GlyphMetricsMap.h" -#include "flutter/sky/engine/platform/fonts/GlyphPageTreeNode.h" -#include "flutter/sky/engine/platform/fonts/TypesettingFeatures.h" -#include "flutter/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" - -namespace blink { - -class FontDescription; - -enum FontDataVariant { - AutoVariant, - NormalVariant, - SmallCapsVariant, - EmphasisMarkVariant, - BrokenIdeographVariant -}; -enum Pitch { UnknownPitch, FixedPitch, VariablePitch }; - -class PLATFORM_EXPORT SimpleFontData : public FontData { - public: - // Used to create platform fonts. - static PassRefPtr create( - const FontPlatformData& platformData, - PassRefPtr customData = nullptr, - bool isTextOrientationFallback = false) { - return adoptRef(new SimpleFontData(platformData, customData, - isTextOrientationFallback)); - } - - // Used to create SVG Fonts. - static PassRefPtr create( - PassRefPtr customData, - float fontSize, - bool syntheticBold, - bool syntheticItalic) { - return adoptRef(new SimpleFontData(customData, fontSize, syntheticBold, - syntheticItalic)); - } - - virtual ~SimpleFontData(); - - static const SimpleFontData* systemFallback() { - return reinterpret_cast(-1); - } - - const FontPlatformData& platformData() const { return m_platformData; } -#if ENABLE(OPENTYPE_VERTICAL) - const OpenTypeVerticalData* verticalData() const { - return m_verticalData.get(); - } -#endif - - PassRefPtr smallCapsFontData(const FontDescription&) const; - PassRefPtr emphasisMarkFontData(const FontDescription&) const; - PassRefPtr brokenIdeographFontData() const; - - PassRefPtr variantFontData(const FontDescription& description, - FontDataVariant variant) const { - switch (variant) { - case SmallCapsVariant: - return smallCapsFontData(description); - case EmphasisMarkVariant: - return emphasisMarkFontData(description); - case BrokenIdeographVariant: - return brokenIdeographFontData(); - case AutoVariant: - case NormalVariant: - break; - } - ASSERT_NOT_REACHED(); - return const_cast(this); - } - - PassRefPtr verticalRightOrientationFontData() const; - PassRefPtr uprightOrientationFontData() const; - - bool hasVerticalGlyphs() const { return m_hasVerticalGlyphs; } - bool isTextOrientationFallback() const { return m_isTextOrientationFallback; } - - FontMetrics& fontMetrics() { return m_fontMetrics; } - const FontMetrics& fontMetrics() const { return m_fontMetrics; } - float sizePerUnit() const { - return platformData().size() / - (fontMetrics().unitsPerEm() ? fontMetrics().unitsPerEm() : 1); - } - - float maxCharWidth() const { return m_maxCharWidth; } - void setMaxCharWidth(float maxCharWidth) { m_maxCharWidth = maxCharWidth; } - - float avgCharWidth() const { return m_avgCharWidth; } - void setAvgCharWidth(float avgCharWidth) { m_avgCharWidth = avgCharWidth; } - - FloatRect boundsForGlyph(Glyph) const; - float widthForGlyph(Glyph glyph) const; - FloatRect platformBoundsForGlyph(Glyph) const; - float platformWidthForGlyph(Glyph) const; - - float spaceWidth() const { return m_spaceWidth; } - void setSpaceWidth(float spaceWidth) { m_spaceWidth = spaceWidth; } - - Glyph spaceGlyph() const { return m_spaceGlyph; } - void setSpaceGlyph(Glyph spaceGlyph) { m_spaceGlyph = spaceGlyph; } - Glyph zeroWidthSpaceGlyph() const { return m_zeroWidthSpaceGlyph; } - void setZeroWidthSpaceGlyph(Glyph spaceGlyph) { - m_zeroWidthSpaceGlyph = spaceGlyph; - } - bool isZeroWidthSpaceGlyph(Glyph glyph) const { - return glyph == m_zeroWidthSpaceGlyph && glyph; - } - Glyph zeroGlyph() const { return m_zeroGlyph; } - void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; } - - virtual const SimpleFontData* fontDataForCharacter(UChar32) const override; - - Glyph glyphForCharacter(UChar32) const; - - void determinePitch(); - Pitch pitch() const { - return m_treatAsFixedPitch ? FixedPitch : VariablePitch; - } - - bool isSVGFont() const { - return m_customFontData && m_customFontData->isSVGFont(); - } - virtual bool isCustomFont() const override { return m_customFontData; } - virtual bool isLoading() const override { - return m_customFontData ? m_customFontData->isLoading() : false; - } - virtual bool isLoadingFallback() const override { - return m_customFontData ? m_customFontData->isLoadingFallback() : false; - } - virtual bool isSegmented() const override; - virtual bool shouldSkipDrawing() const override { - return m_customFontData && m_customFontData->shouldSkipDrawing(); - } - - const GlyphData& missingGlyphData() const { return m_missingGlyphData; } - void setMissingGlyphData(const GlyphData& glyphData) { - m_missingGlyphData = glyphData; - } - -#ifndef NDEBUG - virtual String description() const override; -#endif - - bool canRenderCombiningCharacterSequence(const UChar*, size_t) const; - - PassRefPtr customFontData() const { return m_customFontData; } - - // Implemented by the platform. - virtual bool fillGlyphPage(GlyphPage* pageToFill, - unsigned offset, - unsigned length, - UChar* buffer, - unsigned bufferLength) const; - - protected: - SimpleFontData(const FontPlatformData&, - PassRefPtr customData, - bool isTextOrientationFallback = false); - - SimpleFontData(PassRefPtr customData, - float fontSize, - bool syntheticBold, - bool syntheticItalic); - - private: - void platformInit(); - void platformGlyphInit(); - void platformCharWidthInit(); - void platformDestroy(); - - void initCharWidths(); - - PassRefPtr createScaledFontData(const FontDescription&, - float scaleFactor) const; - PassRefPtr platformCreateScaledFontData( - const FontDescription&, - float scaleFactor) const; - - FontMetrics m_fontMetrics; - float m_maxCharWidth; - float m_avgCharWidth; - - FontPlatformData m_platformData; - - mutable OwnPtr> m_glyphToBoundsMap; - mutable GlyphMetricsMap m_glyphToWidthMap; - - bool m_treatAsFixedPitch; - - bool m_isTextOrientationFallback; - bool m_isBrokenIdeographFallback; -#if ENABLE(OPENTYPE_VERTICAL) - RefPtr m_verticalData; -#endif - bool m_hasVerticalGlyphs; - - Glyph m_spaceGlyph; - float m_spaceWidth; - Glyph m_zeroGlyph; - - Glyph m_zeroWidthSpaceGlyph; - - GlyphData m_missingGlyphData; - - struct DerivedFontData { - static PassOwnPtr create(bool forCustomFont); - ~DerivedFontData(); - - bool forCustomFont; - RefPtr smallCaps; - RefPtr emphasisMark; - RefPtr brokenIdeograph; - RefPtr verticalRightOrientation; - RefPtr uprightOrientation; - - private: - DerivedFontData(bool custom) : forCustomFont(custom) {} - }; - - mutable OwnPtr m_derivedFontData; - - RefPtr m_customFontData; - - mutable OwnPtr> m_combiningCharacterSequenceSupport; -}; - -ALWAYS_INLINE FloatRect SimpleFontData::boundsForGlyph(Glyph glyph) const { - if (isZeroWidthSpaceGlyph(glyph)) - return FloatRect(); - - FloatRect bounds; - if (m_glyphToBoundsMap) { - bounds = m_glyphToBoundsMap->metricsForGlyph(glyph); - if (bounds.width() != cGlyphSizeUnknown) - return bounds; - } - - bounds = platformBoundsForGlyph(glyph); - if (!m_glyphToBoundsMap) - m_glyphToBoundsMap = adoptPtr(new GlyphMetricsMap); - m_glyphToBoundsMap->setMetricsForGlyph(glyph, bounds); - return bounds; -} - -ALWAYS_INLINE float SimpleFontData::widthForGlyph(Glyph glyph) const { - if (isZeroWidthSpaceGlyph(glyph)) - return 0; - - float width = m_glyphToWidthMap.metricsForGlyph(glyph); - if (width != cGlyphSizeUnknown) - return width; - -#if ENABLE(OPENTYPE_VERTICAL) - if (m_verticalData) - width = m_verticalData->advanceHeight(this, glyph); - else -#endif - width = platformWidthForGlyph(glyph); - - m_glyphToWidthMap.setMetricsForGlyph(glyph, width); - return width; -} - -DEFINE_FONT_DATA_TYPE_CASTS(SimpleFontData, false); - -} // namespace blink -#endif // SKY_ENGINE_PLATFORM_FONTS_SIMPLEFONTDATA_H_ diff --git a/sky/engine/platform/fonts/TextBlob.h b/sky/engine/platform/fonts/TextBlob.h deleted file mode 100644 index 82c65059676d5..0000000000000 --- a/sky/engine/platform/fonts/TextBlob.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_PLATFORM_FONTS_TEXTBLOB_H_ -#define SKY_ENGINE_PLATFORM_FONTS_TEXTBLOB_H_ - -#include "third_party/skia/include/core/SkRefCnt.h" -#include "third_party/skia/include/core/SkTextBlob.h" - -namespace blink { - -// Holds a (mutable) reference to an immutable SkTextBlob. -// Typedefs are used only to insulate core/ from Skia type names. -typedef sk_sp TextBlobPtr; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_TEXTBLOB_H_ diff --git a/sky/engine/platform/fonts/TextRenderingMode.h b/sky/engine/platform/fonts/TextRenderingMode.h deleted file mode 100644 index 00585153d99a7..0000000000000 --- a/sky/engine/platform/fonts/TextRenderingMode.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_TEXTRENDERINGMODE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_TEXTRENDERINGMODE_H_ - -namespace blink { - -enum TextRenderingMode { - AutoTextRendering, - OptimizeSpeed, - OptimizeLegibility, - GeometricPrecision -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_TEXTRENDERINGMODE_H_ diff --git a/sky/engine/platform/fonts/TypesettingFeatures.h b/sky/engine/platform/fonts/TypesettingFeatures.h deleted file mode 100644 index a1267fb1710a7..0000000000000 --- a/sky/engine/platform/fonts/TypesettingFeatures.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_TYPESETTINGFEATURES_H_ -#define SKY_ENGINE_PLATFORM_FONTS_TYPESETTINGFEATURES_H_ - -namespace blink { - -enum TypesettingFeature { - Kerning = 1 << 0, - Ligatures = 1 << 1, -}; - -typedef unsigned TypesettingFeatures; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_TYPESETTINGFEATURES_H_ diff --git a/sky/engine/platform/fonts/VDMXParser.cpp b/sky/engine/platform/fonts/VDMXParser.cpp deleted file mode 100644 index d881320a6fe1f..0000000000000 --- a/sky/engine/platform/fonts/VDMXParser.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/VDMXParser.h" - -#include -#include - -#include "flutter/sky/engine/wtf/ByteOrder.h" - -// Buffer helper class -// -// This class perform some trival buffer operations while checking for -// out-of-bounds errors. As a family they return false if anything is amiss, -// updating the current offset otherwise. -class Buffer { - public: - Buffer(const uint8_t* buffer, size_t length) - : m_buffer(buffer), m_length(length), m_offset(0) {} - - bool skip(size_t numBytes) { - if (m_offset + numBytes > m_length) - return false; - m_offset += numBytes; - return true; - } - - bool readU8(uint8_t* value) { - if (m_offset + sizeof(uint8_t) > m_length) - return false; - *value = m_buffer[m_offset]; - m_offset += sizeof(uint8_t); - return true; - } - - bool readU16(uint16_t* value) { - if (m_offset + sizeof(uint16_t) > m_length) - return false; - memcpy(value, m_buffer + m_offset, sizeof(uint16_t)); - *value = ntohs(*value); - m_offset += sizeof(uint16_t); - return true; - } - - bool readS16(int16_t* value) { - return readU16(reinterpret_cast(value)); - } - - size_t offset() const { return m_offset; } - - void setOffset(size_t newoffset) { m_offset = newoffset; } - - private: - const uint8_t* const m_buffer; - const size_t m_length; - size_t m_offset; -}; - -// VDMX parsing code. -// -// VDMX tables are found in some TrueType/OpenType fonts and contain -// ascender/descender overrides for certain (usually small) sizes. This is -// needed in order to match font metrics on Windows. -// -// Freetype does not parse these tables so we do so here. - -namespace blink { - -// Parse a TrueType VDMX table. -// yMax: (output) the ascender value from the table -// yMin: (output) the descender value from the table (negative!) -// vdmx: the table bytes -// vdmxLength: length of @vdmx, in bytes -// targetPixelSize: the pixel size of the font (e.g. 16) -// -// Returns true iff a suitable match are found. Otherwise, *yMax and *yMin are -// untouched. size_t must be 32-bits to avoid overflow. -// -// See http://www.microsoft.com/opentype/otspec/vdmx.htm -bool parseVDMX(int* yMax, - int* yMin, - const uint8_t* vdmx, - size_t vdmxLength, - unsigned targetPixelSize) { - Buffer buf(vdmx, vdmxLength); - - // We ignore the version. Future tables should be backwards compatible with - // this layout. - uint16_t numRatios; - if (!buf.skip(4) || !buf.readU16(&numRatios)) - return false; - - // Now we have two tables. Firstly we have @numRatios Ratio records, then a - // matching array of @numRatios offsets. We save the offset of the beginning - // of this second table. - // - // Range 6 <= x <= 262146 - unsigned long offsetTableOffset = - buf.offset() + 4 /* sizeof struct ratio */ * numRatios; - - unsigned desiredRatio = 0xffffffff; - // We read 4 bytes per record, so the offset range is - // 6 <= x <= 524286 - for (unsigned i = 0; i < numRatios; ++i) { - uint8_t xRatio, yRatio1, yRatio2; - - if (!buf.skip(1) || !buf.readU8(&xRatio) || !buf.readU8(&yRatio1) || - !buf.readU8(&yRatio2)) - return false; - - // This either covers 1:1, or this is the default entry (0, 0, 0) - if ((xRatio == 1 && yRatio1 <= 1 && yRatio2 >= 1) || - (xRatio == 0 && yRatio1 == 0 && yRatio2 == 0)) { - desiredRatio = i; - break; - } - } - - if (desiredRatio == 0xffffffff) // no ratio found - return false; - - // Range 10 <= x <= 393216 - buf.setOffset(offsetTableOffset + sizeof(uint16_t) * desiredRatio); - - // Now we read from the offset table to get the offset of another array - uint16_t groupOffset; - if (!buf.readU16(&groupOffset)) - return false; - // Range 0 <= x <= 65535 - buf.setOffset(groupOffset); - - uint16_t numRecords; - if (!buf.readU16(&numRecords) || !buf.skip(sizeof(uint16_t))) - return false; - - // We read 6 bytes per record, so the offset range is - // 4 <= x <= 458749 - for (unsigned i = 0; i < numRecords; ++i) { - uint16_t pixelSize; - if (!buf.readU16(&pixelSize)) - return false; - // the entries are sorted, so we can abort early if need be - if (pixelSize > targetPixelSize) - return false; - - if (pixelSize == targetPixelSize) { - int16_t tempYMax, tempYMin; - if (!buf.readS16(&tempYMax) || !buf.readS16(&tempYMin)) - return false; - *yMin = tempYMin; - *yMax = tempYMax; - return true; - } - if (!buf.skip(2 * sizeof(int16_t))) - return false; - } - - return false; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/VDMXParser.h b/sky/engine/platform/fonts/VDMXParser.h deleted file mode 100644 index 0ca20f8c0cbe2..0000000000000 --- a/sky/engine/platform/fonts/VDMXParser.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2009, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_VDMXPARSER_H_ -#define SKY_ENGINE_PLATFORM_FONTS_VDMXPARSER_H_ - -#include -#include - -namespace blink { -bool parseVDMX(int* ymax, - int* ymin, - const uint8_t* vdmx, - size_t vdmxLength, - unsigned targetPixelSize); -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_VDMXPARSER_H_ diff --git a/sky/engine/platform/fonts/WidthCache.h b/sky/engine/platform/fonts/WidthCache.h deleted file mode 100644 index cf9fbf011ad98..0000000000000 --- a/sky/engine/platform/fonts/WidthCache.h +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_WIDTHCACHE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_WIDTHCACHE_H_ - -#include "flutter/sky/engine/platform/geometry/IntRectExtent.h" -#include "flutter/sky/engine/platform/text/TextRun.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/HashFunctions.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/HashTableDeletedValueType.h" -#include "flutter/sky/engine/wtf/StringHasher.h" - -namespace blink { - -struct WidthCacheEntry { - WidthCacheEntry() { width = std::numeric_limits::quiet_NaN(); } - bool isValid() const { return !std::isnan(width); } - float width; - IntRectExtent glyphBounds; -}; - -class WidthCache { - private: - // Used to optimize small strings as hash table keys. Avoids malloc'ing an - // out-of-line StringImpl. - class SmallStringKey { - public: - static unsigned capacity() { return s_capacity; } - - SmallStringKey() : m_length(s_emptyValueLength) {} - - SmallStringKey(WTF::HashTableDeletedValueType) - : m_length(s_deletedValueLength) {} - - template - SmallStringKey(CharacterType* characters, unsigned short length) - : m_length(length) { - ASSERT(length <= s_capacity); - - StringHasher hasher; - - bool remainder = length & 1; - length >>= 1; - - unsigned i = 0; - while (length--) { - m_characters[i] = characters[i]; - m_characters[i + 1] = characters[i + 1]; - hasher.addCharactersAssumingAligned(characters[i], characters[i + 1]); - i += 2; - } - - if (remainder) { - m_characters[i] = characters[i]; - hasher.addCharacter(characters[i]); - } - - m_hash = hasher.hash(); - } - - const UChar* characters() const { return m_characters; } - unsigned short length() const { return m_length; } - unsigned hash() const { return m_hash; } - - bool isHashTableDeletedValue() const { - return m_length == s_deletedValueLength; - } - bool isHashTableEmptyValue() const { - return m_length == s_emptyValueLength; - } - - private: - static const unsigned s_capacity = 15; - static const unsigned s_emptyValueLength = s_capacity + 1; - static const unsigned s_deletedValueLength = s_capacity + 2; - - unsigned m_hash; - unsigned short m_length; - UChar m_characters[s_capacity]; - }; - - struct SmallStringKeyHash { - static unsigned hash(const SmallStringKey& key) { return key.hash(); } - static bool equal(const SmallStringKey& a, const SmallStringKey& b) { - return a == b; - } - static const bool safeToCompareToEmptyOrDeleted = - true; // Empty and deleted values have lengths that are not equal to - // any valid length. - }; - - struct SmallStringKeyHashTraits : WTF::SimpleClassHashTraits { - static const bool hasIsEmptyValueFunction = true; - static bool isEmptyValue(const SmallStringKey& key) { - return key.isHashTableEmptyValue(); - } - static const bool needsDestruction = false; - static const unsigned minimumTableSize = 16; - }; - - friend bool operator==(const SmallStringKey&, const SmallStringKey&); - - public: - WidthCache() : m_interval(s_maxInterval), m_countdown(m_interval) {} - - WidthCacheEntry* add(const TextRun& run, WidthCacheEntry entry) { - if (static_cast(run.length()) > SmallStringKey::capacity()) - return 0; - - if (m_countdown > 0) { - --m_countdown; - return 0; - } - - return addSlowCase(run, entry); - } - - void clear() { - m_singleCharMap.clear(); - m_map.clear(); - } - - private: - WidthCacheEntry* addSlowCase(const TextRun& run, WidthCacheEntry entry) { - int length = run.length(); - bool isNewEntry; - WidthCacheEntry* value; - if (length == 1) { - SingleCharMap::AddResult addResult = m_singleCharMap.add(run[0], entry); - isNewEntry = addResult.isNewEntry; - value = &addResult.storedValue->value; - } else { - SmallStringKey smallStringKey; - if (run.is8Bit()) - smallStringKey = SmallStringKey(run.characters8(), length); - else - smallStringKey = SmallStringKey(run.characters16(), length); - - Map::AddResult addResult = m_map.add(smallStringKey, entry); - isNewEntry = addResult.isNewEntry; - value = &addResult.storedValue->value; - } - - // Cache hit: ramp up by sampling the next few words. - if (!isNewEntry) { - m_interval = s_minInterval; - return value; - } - - // Cache miss: ramp down by increasing our sampling interval. - if (m_interval < s_maxInterval) - ++m_interval; - m_countdown = m_interval; - - if ((m_singleCharMap.size() + m_map.size()) < s_maxSize) - return value; - - // No need to be fancy: we're just trying to avoid pathological growth. - m_singleCharMap.clear(); - m_map.clear(); - return 0; - } - - typedef HashMap - Map; - typedef HashMap::Hash, - WTF::UnsignedWithZeroKeyHashTraits> - SingleCharMap; - static const int s_minInterval = - -3; // A cache hit pays for about 3 cache misses. - static const int s_maxInterval = - 20; // Sampling at this interval has almost no overhead. - static const unsigned s_maxSize = - 500000; // Just enough to guard against pathological growth. - - int m_interval; - int m_countdown; - SingleCharMap m_singleCharMap; - Map m_map; -}; - -inline bool operator==(const WidthCache::SmallStringKey& a, - const WidthCache::SmallStringKey& b) { - if (a.length() != b.length()) - return false; - return WTF::equal(a.characters(), b.characters(), a.length()); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_WIDTHCACHE_H_ diff --git a/sky/engine/platform/fonts/WidthIterator.cpp b/sky/engine/platform/fonts/WidthIterator.cpp deleted file mode 100644 index 44a6dfe5bbe70..0000000000000 --- a/sky/engine/platform/fonts/WidthIterator.cpp +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. - * All rights reserved. - * Copyright (C) 2008 Holger Hans Peter Freyther - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/fonts/WidthIterator.h" - -#include "flutter/sky/engine/platform/fonts/Character.h" -#include "flutter/sky/engine/platform/fonts/Font.h" -#include "flutter/sky/engine/platform/fonts/FontPlatformFeatures.h" -#include "flutter/sky/engine/platform/fonts/GlyphBuffer.h" -#include "flutter/sky/engine/platform/fonts/Latin1TextIterator.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/platform/text/SurrogatePairAwareTextIterator.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -using namespace WTF; -using namespace Unicode; - -namespace blink { - -WidthIterator::WidthIterator(const Font* font, - const TextRun& run, - HashSet* fallbackFonts, - bool accountForGlyphBounds, - bool forTextEmphasis) - : m_font(font), - m_run(run), - m_currentCharacter(0), - m_runWidthSoFar(0), - m_isAfterExpansion(!run.allowsLeadingExpansion()), - m_fallbackFonts(fallbackFonts), - m_maxGlyphBoundingBoxY(std::numeric_limits::min()), - m_minGlyphBoundingBoxY(std::numeric_limits::max()), - m_firstGlyphOverflow(0), - m_lastGlyphOverflow(0), - m_accountForGlyphBounds(accountForGlyphBounds), - m_forTextEmphasis(forTextEmphasis) { - // If the padding is non-zero, count the number of spaces in the run - // and divide that by the padding for per space addition. - m_expansion = m_run.expansion(); - if (!m_expansion) - m_expansionPerOpportunity = 0; - else { - bool isAfterExpansion = m_isAfterExpansion; - unsigned expansionOpportunityCount = - m_run.is8Bit() ? Character::expansionOpportunityCount( - m_run.characters8(), m_run.length(), - m_run.direction(), isAfterExpansion) - : Character::expansionOpportunityCount( - m_run.characters16(), m_run.length(), - m_run.direction(), isAfterExpansion); - if (isAfterExpansion && !m_run.allowsTrailingExpansion()) - expansionOpportunityCount--; - - if (!expansionOpportunityCount) - m_expansionPerOpportunity = 0; - else - m_expansionPerOpportunity = m_expansion / expansionOpportunityCount; - } -} - -GlyphData WidthIterator::glyphDataForCharacter(CharacterData& charData) { - ASSERT(m_font); - return m_font->glyphDataForCharacter(charData.character, m_run.rtl()); -} - -float WidthIterator::characterWidth(UChar32 character, - const GlyphData& glyphData) const { - const SimpleFontData* fontData = glyphData.fontData; - ASSERT(fontData); - - if (UNLIKELY(character == '\t' && m_run.allowTabs())) - return m_font->tabWidth(*fontData, m_run.tabSize(), - m_run.xPos() + m_runWidthSoFar); - - float width = fontData->widthForGlyph(glyphData.glyph); - - // SVG uses horizontalGlyphStretch(), when textLength is used to - // stretch/squeeze text. - if (UNLIKELY(m_run.horizontalGlyphStretch() != 1)) - width *= m_run.horizontalGlyphStretch(); - - return width; -} - -void WidthIterator::cacheFallbackFont(UChar32 character, - const SimpleFontData* fontData, - const SimpleFontData* primaryFont) { - if (fontData == primaryFont) - return; - - // FIXME: This does a little extra work that could be avoided if - // glyphDataForCharacter() returned whether it chose to use a small caps font. - if (m_font->fontDescription().variant() == FontVariantNormal || - character == toUpper(character)) { - m_fallbackFonts->add(fontData); - } else { - ASSERT(m_font->fontDescription().variant() == FontVariantSmallCaps); - const GlyphData uppercaseGlyphData = - m_font->glyphDataForCharacter(toUpper(character), m_run.rtl()); - if (uppercaseGlyphData.fontData != primaryFont) - m_fallbackFonts->add(uppercaseGlyphData.fontData); - } -} - -float WidthIterator::adjustSpacing(float width, - const CharacterData& charData, - const SimpleFontData& fontData, - GlyphBuffer* glyphBuffer) { - // Account for letter-spacing. - if (width) - width += m_font->fontDescription().letterSpacing(); - - static bool expandAroundIdeographs = - FontPlatformFeatures::canExpandAroundIdeographsInComplexText(); - bool treatAsSpace = Character::treatAsSpace(charData.character); - if (treatAsSpace || (expandAroundIdeographs && - Character::isCJKIdeographOrSymbol(charData.character))) { - // Distribute the run's total expansion evenly over all expansion - // opportunities in the run. - if (m_expansion) { - if (!treatAsSpace && !m_isAfterExpansion) { - // Take the expansion opportunity before this ideograph. - m_expansion -= m_expansionPerOpportunity; - float expansionAtThisOpportunity = m_expansionPerOpportunity; - m_runWidthSoFar += expansionAtThisOpportunity; - if (glyphBuffer) { - if (glyphBuffer->isEmpty()) { - if (m_forTextEmphasis) - glyphBuffer->add(fontData.zeroWidthSpaceGlyph(), &fontData, - m_expansionPerOpportunity); - else - glyphBuffer->add(fontData.spaceGlyph(), &fontData, - expansionAtThisOpportunity); - } else { - glyphBuffer->expandLastAdvance(expansionAtThisOpportunity); - } - } - } - if (m_run.allowsTrailingExpansion() || - (m_run.ltr() && charData.characterOffset + charData.clusterLength < - static_cast(m_run.length())) || - (m_run.rtl() && charData.characterOffset)) { - m_expansion -= m_expansionPerOpportunity; - width += m_expansionPerOpportunity; - m_isAfterExpansion = true; - } - } else { - m_isAfterExpansion = false; - } - - // Account for word spacing. - // We apply additional space between "words" by adding width to the space - // character. - if (treatAsSpace && (charData.character != '\t' || !m_run.allowTabs()) && - (charData.characterOffset || charData.character == noBreakSpace) && - m_font->fontDescription().wordSpacing()) { - width += m_font->fontDescription().wordSpacing(); - } - } else { - m_isAfterExpansion = false; - } - - return width; -} - -void WidthIterator::updateGlyphBounds(const GlyphData& glyphData, - float width, - bool firstCharacter) { - ASSERT(glyphData.fontData); - FloatRect bounds = glyphData.fontData->boundsForGlyph(glyphData.glyph); - - if (firstCharacter) - m_firstGlyphOverflow = std::max(0, -bounds.x()); - m_lastGlyphOverflow = std::max(0, bounds.maxX() - width); - m_maxGlyphBoundingBoxY = std::max(m_maxGlyphBoundingBoxY, bounds.maxY()); - m_minGlyphBoundingBoxY = std::min(m_minGlyphBoundingBoxY, bounds.y()); -} - -template -unsigned WidthIterator::advanceInternal(TextIterator& textIterator, - GlyphBuffer* glyphBuffer) { - bool hasExtraSpacing = - (m_font->fontDescription().letterSpacing() || - m_font->fontDescription().wordSpacing() || m_expansion) && - !m_run.spacingDisabled(); - - const SimpleFontData* primaryFont = m_font->primaryFont(); - const SimpleFontData* lastFontData = primaryFont; - - CharacterData charData; - while (textIterator.consume(charData.character, charData.clusterLength)) { - charData.characterOffset = textIterator.currentCharacter(); - - const GlyphData glyphData = glyphDataForCharacter(charData); - Glyph glyph = glyphData.glyph; - const SimpleFontData* fontData = glyphData.fontData; - ASSERT(fontData); - - // Now that we have a glyph and font data, get its width. - float width = characterWidth(charData.character, glyphData); - - if (m_fallbackFonts && lastFontData != fontData && width) { - lastFontData = fontData; - cacheFallbackFont(charData.character, fontData, primaryFont); - } - - if (hasExtraSpacing) - width = adjustSpacing(width, charData, *fontData, glyphBuffer); - - if (m_accountForGlyphBounds) - updateGlyphBounds(glyphData, width, !charData.characterOffset); - - if (m_forTextEmphasis && - !Character::canReceiveTextEmphasis(charData.character)) - glyph = 0; - - // Advance past the character we just dealt with. - textIterator.advance(charData.clusterLength); - m_runWidthSoFar += width; - - if (glyphBuffer) - glyphBuffer->add(glyph, fontData, width); - } - - unsigned consumedCharacters = - textIterator.currentCharacter() - m_currentCharacter; - m_currentCharacter = textIterator.currentCharacter(); - - return consumedCharacters; -} - -unsigned WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer) { - int length = m_run.length(); - - if (offset > length) - offset = length; - - if (m_currentCharacter >= static_cast(offset)) - return 0; - - if (m_run.is8Bit()) { - Latin1TextIterator textIterator(m_run.data8(m_currentCharacter), - m_currentCharacter, offset, length); - return advanceInternal(textIterator, glyphBuffer); - } - - SurrogatePairAwareTextIterator textIterator( - m_run.data16(m_currentCharacter), m_currentCharacter, offset, length); - return advanceInternal(textIterator, glyphBuffer); -} - -bool WidthIterator::advanceOneCharacter(float& width) { - float initialWidth = m_runWidthSoFar; - - if (!advance(m_currentCharacter + 1)) - return false; - - width = m_runWidthSoFar - initialWidth; - return true; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/WidthIterator.h b/sky/engine/platform/fonts/WidthIterator.h deleted file mode 100644 index 6f16e75e96395..0000000000000 --- a/sky/engine/platform/fonts/WidthIterator.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2008, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2008 Holger Hans Peter Freyther - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_WIDTHITERATOR_H_ -#define SKY_ENGINE_PLATFORM_FONTS_WIDTHITERATOR_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/text/TextRun.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -class Font; -class GlyphBuffer; -class SimpleFontData; -class TextRun; -struct GlyphData; - -struct PLATFORM_EXPORT WidthIterator { - WTF_MAKE_FAST_ALLOCATED; - - public: - WidthIterator(const Font*, - const TextRun&, - HashSet* fallbackFonts = 0, - bool accountForGlyphBounds = false, - bool forTextEmphasis = false); - - unsigned advance(int to, GlyphBuffer* = 0); - bool advanceOneCharacter(float& width); - - float maxGlyphBoundingBoxY() const { - ASSERT(m_accountForGlyphBounds); - return m_maxGlyphBoundingBoxY; - } - float minGlyphBoundingBoxY() const { - ASSERT(m_accountForGlyphBounds); - return m_minGlyphBoundingBoxY; - } - float firstGlyphOverflow() const { - ASSERT(m_accountForGlyphBounds); - return m_firstGlyphOverflow; - } - float lastGlyphOverflow() const { - ASSERT(m_accountForGlyphBounds); - return m_lastGlyphOverflow; - } - - const TextRun& run() const { return m_run; } - float runWidthSoFar() const { return m_runWidthSoFar; } - - const Font* m_font; - - const TextRun& m_run; - - unsigned m_currentCharacter; - float m_runWidthSoFar; - float m_expansion; - float m_expansionPerOpportunity; - bool m_isAfterExpansion; - - private: - struct CharacterData { - UChar32 character; - unsigned clusterLength; - int characterOffset; - }; - - GlyphData glyphDataForCharacter(CharacterData&); - float characterWidth(UChar32, const GlyphData&) const; - void cacheFallbackFont(UChar32, - const SimpleFontData*, - const SimpleFontData* primaryFont); - float adjustSpacing(float, - const CharacterData&, - const SimpleFontData&, - GlyphBuffer*); - void updateGlyphBounds(const GlyphData&, float width, bool firstCharacter); - - template - unsigned advanceInternal(TextIterator&, GlyphBuffer*); - - HashSet* m_fallbackFonts; - float m_maxGlyphBoundingBoxY; - float m_minGlyphBoundingBoxY; - float m_firstGlyphOverflow; - float m_lastGlyphOverflow; - - bool m_accountForGlyphBounds : 1; - bool m_forTextEmphasis : 1; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_WIDTHITERATOR_H_ diff --git a/sky/engine/platform/fonts/apple/FontPlatformDataApple.cpp b/sky/engine/platform/fonts/apple/FontPlatformDataApple.cpp deleted file mode 100644 index c0fd6af42b1a8..0000000000000 --- a/sky/engine/platform/fonts/apple/FontPlatformDataApple.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" -#include "third_party/skia/include/core/SkTypeface.h" - -namespace blink { - -void FontPlatformData::setupPaint(SkPaint* paint, - GraphicsContext* context) const { - bool shouldSmoothFonts = true; - bool shouldAntialias = true; - bool useSubpixelText = true; - paint->setAntiAlias(shouldAntialias); - paint->setEmbeddedBitmapText(false); - const float ts = m_textSize >= 0 ? m_textSize : 12; - paint->setTextSize(SkFloatToScalar(ts)); - paint->setTypeface(m_typeface); - paint->setFakeBoldText(m_syntheticBold); - paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0); - paint->setAutohinted(false); // freetype specific - paint->setLCDRenderText(shouldSmoothFonts); - paint->setSubpixelText(useSubpixelText); - paint->setHinting(SkPaint::kNo_Hinting); -} - -void FontPlatformData::querySystemForRenderStyle( - bool useSkiaSubpixelPositioning) { - if (!m_style.useHinting) - m_style.hintStyle = SkPaint::kNo_Hinting; - else if (m_style.useHinting == FontRenderStyle::NoPreference) - m_style.hintStyle = SkPaint::kNormal_Hinting; - if (m_style.useBitmaps == FontRenderStyle::NoPreference) - m_style.useBitmaps = true; - if (m_style.useAutoHint == FontRenderStyle::NoPreference) - m_style.useAutoHint = true; - if (m_style.useAntiAlias == FontRenderStyle::NoPreference) - m_style.useAntiAlias = true; - if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference) - m_style.useSubpixelRendering = false; - if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference) - m_style.useSubpixelPositioning = useSkiaSubpixelPositioning; -} - -bool FontPlatformData::defaultUseSubpixelPositioning() { - return false; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp b/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp deleted file mode 100644 index 78ac2b4d33243..0000000000000 --- a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h" - -#include -#include -#include -#include -#include - -#include "flutter/sky/engine/platform/fonts/AlternateFontFamily.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include -#include "lib/fsl/vmo/sized_vmo.h" -#include "lib/fxl/logging.h" -#include "third_party/skia/include/core/SkData.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/ports/SkFontMgr.h" - -namespace blink { -namespace { - -uint32_t ToIntegerWeight(FontWeight weight) { - switch (weight) { - case FontWeight100: - return 100; - case FontWeight200: - return 200; - case FontWeight300: - return 300; - case FontWeight400: - return 400; - case FontWeight500: - return 500; - case FontWeight600: - return 600; - case FontWeight700: - return 700; - case FontWeight800: - return 800; - case FontWeight900: - return 900; - } - ASSERT_NOT_REACHED(); - return 400; -} - -fonts::FontSlant ToFontSlant(FontStyle style) { - switch (style) { - case FontStyleNormal: - return fonts::FontSlant::UPRIGHT; - case FontStyleItalic: - return fonts::FontSlant::ITALIC; - } - ASSERT_NOT_REACHED(); - return fonts::FontSlant::UPRIGHT; -} - -void UnmapMemory(const void* buffer, void* context) { - static_assert(sizeof(void*) == sizeof(uint64_t), "pointers aren't 64-bit"); - const uint64_t size = reinterpret_cast(context); - zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); -} - -sk_sp MakeSkDataFromBuffer(const mem::Buffer& data) { - if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || - data.size > std::numeric_limits::max()) { - return nullptr; - } - uint64_t size = data.size; - uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, - ZX_VM_FLAG_PERM_READ, &buffer); - if (status != ZX_OK) - return nullptr; - return SkData::MakeWithProc(reinterpret_cast(buffer), size, - UnmapMemory, reinterpret_cast(size)); -} - -fonts::FontProviderPtr* g_font_provider = nullptr; - -fonts::FontProviderPtr& GetFontProvider() { - FXL_CHECK(g_font_provider); - return *g_font_provider; -} - -} // namespace - -void SetFontProvider(fonts::FontProviderPtr provider) { - FXL_CHECK(!g_font_provider); - g_font_provider = new fonts::FontProviderPtr; - *g_font_provider = std::move(provider); -} - -void FontCache::getFontForCharacter(UChar32 c, - const char* preferredLocale, - PlatformFallbackFont* font) {} - -sk_sp FontCache::createTypeface( - const FontDescription& fontDescription, - const FontFaceCreationParams& creationParams, - CString& name) { - AtomicString family = creationParams.family(); - - if (family.isEmpty()) { - name = getFallbackFontFamily(fontDescription).string().utf8(); - } else { - name = family.utf8(); - } - - fonts::FontRequest request; - request.family = name.data(); - request.weight = ToIntegerWeight(fontDescription.weight()); - request.width = static_cast(fontDescription.stretch()); - request.slant = ToFontSlant(fontDescription.style()); - - fonts::FontResponsePtr response; - auto& font_provider = GetFontProvider(); - font_provider->GetFont( - std::move(request), - [&response](fonts::FontResponsePtr r) { response = std::move(r); }); - font_provider.WaitForResponse(); - - FXL_DCHECK(response) - << "Unable to contact the font provider. Did you run " - "Flutter in an environment that has a font manager?\n" - "See ."; - - if (!response) - return nullptr; - - sk_sp data = MakeSkDataFromBuffer(response->data.buffer); - if (!data) - return nullptr; - - return SkFontMgr::RefDefault()->makeFromData(std::move(data)); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h b/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h deleted file mode 100644 index fd11337f7d2b8..0000000000000 --- a/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 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. - -#ifndef SKY_ENGINE_PLATFORM_FONTS_FUCHSIA_FONT_CACHE_FUCHSIA_H_ -#define SKY_ENGINE_PLATFORM_FONTS_FUCHSIA_FONT_CACHE_FUCHSIA_H_ - -#include - -namespace blink { - -void SetFontProvider(fonts::FontProviderPtr provider); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_FUCHSIA_FONT_CACHE_FUCHSIA_H_ diff --git a/sky/engine/platform/fonts/harfbuzz/FontHarfBuzz.cpp b/sky/engine/platform/fonts/harfbuzz/FontHarfBuzz.cpp deleted file mode 100644 index a84537282bb3c..0000000000000 --- a/sky/engine/platform/fonts/harfbuzz/FontHarfBuzz.cpp +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/Font.h" - -#include "flutter/sky/engine/platform/fonts/FontPlatformFeatures.h" -#include "flutter/sky/engine/platform/fonts/GlyphBuffer.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" - -#include "third_party/skia/include/core/SkPaint.h" -#include "third_party/skia/include/private/SkTemplates.h" - -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -#include - -namespace blink { - -bool FontPlatformFeatures::canExpandAroundIdeographsInComplexText() { - return false; -} - -static SkPaint textFillPaint(GraphicsContext* gc, const SimpleFontData* font) { - SkPaint paint = gc->fillPaint(); - font->platformData().setupPaint(&paint, gc); - gc->adjustTextRenderMode(&paint); - paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); - return paint; -} - -static SkPaint textStrokePaint(GraphicsContext* gc, - const SimpleFontData* font, - bool isFilling) { - SkPaint paint = gc->strokePaint(); - font->platformData().setupPaint(&paint, gc); - gc->adjustTextRenderMode(&paint); - paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); - if (isFilling) { - // If there is a shadow and we filled above, there will already be - // a shadow. We don't want to draw it again or it will be too dark - // and it will go on top of the fill. - // - // Note that this isn't strictly correct, since the stroke could be - // very thick and the shadow wouldn't account for this. The "right" - // thing would be to draw to a new layer and then draw that layer - // with a shadow. But this is a lot of extra work for something - // that isn't normally an issue. - paint.setLooper(0); - } - return paint; -} - -static void paintGlyphs(GraphicsContext* gc, - const SimpleFontData* font, - const Glyph glyphs[], - unsigned numGlyphs, - const SkPoint pos[], - const FloatRect& textRect) { - TextDrawingModeFlags textMode = gc->textDrawingMode(); - - // We draw text up to two times (once for fill, once for stroke). - if (textMode & TextModeFill) { - SkPaint paint = textFillPaint(gc, font); - gc->drawPosText(glyphs, numGlyphs * sizeof(Glyph), pos, textRect, paint); - } - - if ((textMode & TextModeStroke) && gc->hasStroke()) { - SkPaint paint = textStrokePaint(gc, font, textMode & TextModeFill); - gc->drawPosText(glyphs, numGlyphs * sizeof(Glyph), pos, textRect, paint); - } -} - -static void paintGlyphsHorizontal(GraphicsContext* gc, - const SimpleFontData* font, - const Glyph glyphs[], - unsigned numGlyphs, - const SkScalar xpos[], - SkScalar constY, - const FloatRect& textRect) { - TextDrawingModeFlags textMode = gc->textDrawingMode(); - - if (textMode & TextModeFill) { - SkPaint paint = textFillPaint(gc, font); - gc->drawPosTextH(glyphs, numGlyphs * sizeof(Glyph), xpos, constY, textRect, - paint); - } - - if ((textMode & TextModeStroke) && gc->hasStroke()) { - SkPaint paint = textStrokePaint(gc, font, textMode & TextModeFill); - gc->drawPosTextH(glyphs, numGlyphs * sizeof(Glyph), xpos, constY, textRect, - paint); - } -} - -void Font::drawGlyphs(GraphicsContext* gc, - const SimpleFontData* font, - const GlyphBuffer& glyphBuffer, - unsigned from, - unsigned numGlyphs, - const FloatPoint& point, - const FloatRect& textRect) const { - SkScalar x = SkFloatToScalar(point.x()); - SkScalar y = SkFloatToScalar(point.y()); - -// ENABLE_OPENTYPE_VERTICAL is not enabled on MACOSX -#if !OS(MACOSX) - const OpenTypeVerticalData* verticalData = font->verticalData(); - if (font->platformData().orientation() == Vertical && verticalData) { - SkAutoSTMalloc<32, SkPoint> storage(numGlyphs); - SkPoint* pos = storage.get(); - - AffineTransform savedMatrix = gc->getCTM(); - gc->concatCTM(AffineTransform(0, -1, 1, 0, point.x(), point.y())); - gc->concatCTM(AffineTransform(1, 0, 0, 1, -point.x(), -point.y())); - - const unsigned kMaxBufferLength = 256; - Vector translations; - - const FontMetrics& metrics = font->fontMetrics(); - SkScalar verticalOriginX = - SkFloatToScalar(point.x() + metrics.floatAscent() - - metrics.floatAscent(IdeographicBaseline)); - float horizontalOffset = point.x(); - - unsigned glyphIndex = 0; - while (glyphIndex < numGlyphs) { - unsigned chunkLength = std::min(kMaxBufferLength, numGlyphs - glyphIndex); - - const Glyph* glyphs = glyphBuffer.glyphs(from + glyphIndex); - translations.resize(chunkLength); - verticalData->getVerticalTranslationsForGlyphs( - font, &glyphs[0], chunkLength, - reinterpret_cast(&translations[0])); - - x = verticalOriginX; - y = SkFloatToScalar(point.y() + horizontalOffset - point.x()); - - float currentWidth = 0; - for (unsigned i = 0; i < chunkLength; ++i, ++glyphIndex) { - pos[i].set( - x + SkIntToScalar(lroundf(translations[i].x())), - y + -SkIntToScalar(-lroundf(currentWidth - translations[i].y()))); - currentWidth += glyphBuffer.advanceAt(from + glyphIndex); - } - horizontalOffset += currentWidth; - paintGlyphs(gc, font, glyphs, chunkLength, pos, textRect); - } - - gc->setCTM(savedMatrix); - return; - } -#endif - - if (!glyphBuffer.hasOffsets()) { - SkAutoSTMalloc<64, SkScalar> storage(numGlyphs); - SkScalar* xpos = storage.get(); - const float* adv = glyphBuffer.advances(from); - for (unsigned i = 0; i < numGlyphs; i++) { - xpos[i] = x; - x += SkFloatToScalar(adv[i]); - } - const Glyph* glyphs = glyphBuffer.glyphs(from); - paintGlyphsHorizontal(gc, font, glyphs, numGlyphs, xpos, SkFloatToScalar(y), - textRect); - return; - } - - // FIXME: text rendering speed: - // Android has code in their WebCore fork to special case when the - // GlyphBuffer has no advances other than the defaults. In that case the - // text drawing can proceed faster. However, it's unclear when those - // patches may be upstreamed to WebKit so we always use the slower path - // here. - SkAutoSTMalloc<32, SkPoint> storage(numGlyphs); - SkPoint* pos = storage.get(); - const FloatSize* offsets = glyphBuffer.offsets(from); - const float* advances = glyphBuffer.advances(from); - SkScalar advanceSoFar = SkFloatToScalar(0); - for (unsigned i = 0; i < numGlyphs; i++) { - pos[i].set(x + SkFloatToScalar(offsets[i].width()) + advanceSoFar, - y + SkFloatToScalar(offsets[i].height())); - advanceSoFar += SkFloatToScalar(advances[i]); - } - - const Glyph* glyphs = glyphBuffer.glyphs(from); - paintGlyphs(gc, font, glyphs, numGlyphs, pos, textRect); -} - -void Font::drawTextBlob(GraphicsContext* gc, - const SkTextBlob* blob, - const SkPoint& origin) const { - // FIXME: It would be good to move this to Font.cpp, if we're sure that none - // of the things in FontMac's setupPaint need to apply here. - // See also paintGlyphs. - TextDrawingModeFlags textMode = gc->textDrawingMode(); - - if (textMode & TextModeFill) - gc->drawTextBlob(blob, origin, gc->fillPaint()); - - if ((textMode & TextModeStroke) && gc->hasStroke()) { - SkPaint paint = gc->strokePaint(); - if (textMode & TextModeFill) - paint.setLooper(0); - gc->drawTextBlob(blob, origin, paint); - } -} - -float Font::floatWidthForComplexText( - const TextRun& run, - HashSet* fallbackFonts, - IntRectExtent* glyphBounds) const { - HarfBuzzShaper shaper(this, run, HarfBuzzShaper::NotForTextEmphasis, - fallbackFonts); - if (!shaper.shape()) - return 0; - - glyphBounds->setTop(floorf(-shaper.glyphBoundingBox().top())); - glyphBounds->setBottom(ceilf(shaper.glyphBoundingBox().bottom())); - glyphBounds->setLeft( - std::max(0, floorf(-shaper.glyphBoundingBox().left()))); - glyphBounds->setRight(std::max( - 0, ceilf(shaper.glyphBoundingBox().right() - shaper.totalWidth()))); - - return shaper.totalWidth(); -} - -// Return the code point index for the given |x| offset into the text run. -int Font::offsetForPositionForComplexText(const TextRun& run, - float xFloat, - bool includePartialGlyphs) const { - HarfBuzzShaper shaper(this, run); - if (!shaper.shape()) - return 0; - return shaper.offsetForPosition(xFloat); -} - -// Return the rectangle for selecting the given range of code-points in the -// TextRun. -FloatRect Font::selectionRectForComplexText(const TextRun& run, - const FloatPoint& point, - int height, - int from, - int to) const { - HarfBuzzShaper shaper(this, run); - if (!shaper.shape()) - return FloatRect(); - return shaper.selectionRect(point, height, from, to); -} - -namespace { - -template -bool buildTextBlobInternal(const GlyphBuffer& glyphBuffer, - SkScalar initialAdvance, - SkTextBlobBuilder& builder) { - SkScalar x = initialAdvance; - unsigned i = 0; - while (i < glyphBuffer.size()) { - const SimpleFontData* fontData = glyphBuffer.fontDataAt(i); - - // FIXME: Handle vertical text. - if (fontData->platformData().orientation() == Vertical) - return false; - - // FIXME: Handle SVG fonts. - if (fontData->isSVGFont()) - return false; - - // FIXME: FontPlatformData makes some decisions on the device scale - // factor, which is found via the GraphicsContext. This should be fixed - // to avoid correctness problems here. - SkPaint paint; - fontData->platformData().setupPaint(&paint); - paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); - - unsigned start = i++; - while (i < glyphBuffer.size() && glyphBuffer.fontDataAt(i) == fontData) - i++; - unsigned count = i - start; - - const SkTextBlobBuilder::RunBuffer& buffer = - hasOffsets ? builder.allocRunPos(paint, count) - : builder.allocRunPosH(paint, count, 0); - - const uint16_t* glyphs = glyphBuffer.glyphs(start); - std::copy(glyphs, glyphs + count, buffer.glyphs); - - const float* advances = glyphBuffer.advances(start); - const FloatSize* offsets = glyphBuffer.offsets(start); - for (unsigned j = 0; j < count; j++) { - if (hasOffsets) { - const FloatSize& offset = offsets[j]; - buffer.pos[2 * j] = x + offset.width(); - buffer.pos[2 * j + 1] = offset.height(); - } else { - buffer.pos[j] = x; - } - x += SkFloatToScalar(advances[j]); - } - } - return true; -} - -} // namespace - -TextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, - float initialAdvance, - const FloatRect& bounds) const { - SkTextBlobBuilder builder; - SkScalar advance = SkFloatToScalar(initialAdvance); - - bool success = - glyphBuffer.hasOffsets() - ? buildTextBlobInternal(glyphBuffer, advance, builder) - : buildTextBlobInternal(glyphBuffer, advance, builder); - return success ? TextBlobPtr(builder.make()) : nullptr; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.cpp b/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.cpp deleted file mode 100644 index 75ac940bb54f8..0000000000000 --- a/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.h" - -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" -#include "hb-ot.h" -#include "hb.h" - -namespace blink { - -const hb_tag_t HarfBuzzFace::vertTag = HB_TAG('v', 'e', 'r', 't'); -const hb_tag_t HarfBuzzFace::vrt2Tag = HB_TAG('v', 'r', 't', '2'); - -// Though we have FontCache class, which provides the cache mechanism for -// WebKit's font objects, we also need additional caching layer for HarfBuzz -// to reduce the memory consumption because hb_face_t should be associated with -// underling font data (e.g. CTFontRef, FTFace). - -class FaceCacheEntry : public RefCounted { - public: - static PassRefPtr create(hb_face_t* face) { - ASSERT(face); - return adoptRef(new FaceCacheEntry(face)); - } - ~FaceCacheEntry() { hb_face_destroy(m_face); } - - hb_face_t* face() { return m_face; } - HashMap* glyphCache() { return &m_glyphCache; } - - private: - explicit FaceCacheEntry(hb_face_t* face) : m_face(face) {} - - hb_face_t* m_face; - HashMap m_glyphCache; -}; - -typedef HashMap, - WTF::IntHash, - WTF::UnsignedWithZeroKeyHashTraits> - HarfBuzzFaceCache; - -static HarfBuzzFaceCache* harfBuzzFaceCache() { - DEFINE_STATIC_LOCAL(HarfBuzzFaceCache, s_harfBuzzFaceCache, ()); - return &s_harfBuzzFaceCache; -} - -HarfBuzzFace::HarfBuzzFace(FontPlatformData* platformData, uint64_t uniqueID) - : m_platformData(platformData), - m_uniqueID(uniqueID), - m_scriptForVerticalText(HB_SCRIPT_INVALID) { - HarfBuzzFaceCache::AddResult result = - harfBuzzFaceCache()->add(m_uniqueID, nullptr); - if (result.isNewEntry) - result.storedValue->value = FaceCacheEntry::create(createFace()); - result.storedValue->value->ref(); - m_face = result.storedValue->value->face(); - m_glyphCacheForFaceCacheEntry = result.storedValue->value->glyphCache(); -} - -HarfBuzzFace::~HarfBuzzFace() { - HarfBuzzFaceCache::iterator result = harfBuzzFaceCache()->find(m_uniqueID); - ASSERT_WITH_SECURITY_IMPLICATION(result != harfBuzzFaceCache()->end()); - ASSERT(result.get()->value->refCount() > 1); - result.get()->value->deref(); - if (result.get()->value->refCount() == 1) - harfBuzzFaceCache()->remove(m_uniqueID); -} - -static hb_script_t findScriptForVerticalGlyphSubstitution(hb_face_t* face) { - static const unsigned maxCount = 32; - - unsigned scriptCount = maxCount; - hb_tag_t scriptTags[maxCount]; - hb_ot_layout_table_get_script_tags(face, HB_OT_TAG_GSUB, 0, &scriptCount, - scriptTags); - for (unsigned scriptIndex = 0; scriptIndex < scriptCount; ++scriptIndex) { - unsigned languageCount = maxCount; - hb_tag_t languageTags[maxCount]; - hb_ot_layout_script_get_language_tags(face, HB_OT_TAG_GSUB, scriptIndex, 0, - &languageCount, languageTags); - for (unsigned languageIndex = 0; languageIndex < languageCount; - ++languageIndex) { - unsigned featureIndex; - if (hb_ot_layout_language_find_feature( - face, HB_OT_TAG_GSUB, scriptIndex, languageIndex, - HarfBuzzFace::vertTag, &featureIndex) || - hb_ot_layout_language_find_feature( - face, HB_OT_TAG_GSUB, scriptIndex, languageIndex, - HarfBuzzFace::vrt2Tag, &featureIndex)) - return hb_ot_tag_to_script(scriptTags[scriptIndex]); - } - } - return HB_SCRIPT_INVALID; -} - -void HarfBuzzFace::setScriptForVerticalGlyphSubstitution(hb_buffer_t* buffer) { - if (m_scriptForVerticalText == HB_SCRIPT_INVALID) - m_scriptForVerticalText = findScriptForVerticalGlyphSubstitution(m_face); - hb_buffer_set_script(buffer, m_scriptForVerticalText); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.h b/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.h deleted file mode 100644 index 1d638b5b78012..0000000000000 --- a/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_HARFBUZZ_HARFBUZZFACE_H_ -#define SKY_ENGINE_PLATFORM_FONTS_HARFBUZZ_HARFBUZZFACE_H_ - -#include - -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -class FontPlatformData; - -class HarfBuzzFace : public RefCounted { - public: - static const hb_tag_t vertTag; - static const hb_tag_t vrt2Tag; - - static PassRefPtr create(FontPlatformData* platformData, - uint64_t uniqueID) { - return adoptRef(new HarfBuzzFace(platformData, uniqueID)); - } - ~HarfBuzzFace(); - - hb_font_t* createFont(); - - void setScriptForVerticalGlyphSubstitution(hb_buffer_t*); - - private: - HarfBuzzFace(FontPlatformData*, uint64_t); - - hb_face_t* createFace(); - - FontPlatformData* m_platformData; - uint64_t m_uniqueID; - hb_face_t* m_face; - WTF::HashMap* m_glyphCacheForFaceCacheEntry; - - hb_script_t m_scriptForVerticalText; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_HARFBUZZ_HARFBUZZFACE_H_ diff --git a/sky/engine/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp b/sky/engine/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp deleted file mode 100644 index 9150b18900a88..0000000000000 --- a/sky/engine/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. All rights reserved. - * Copyright (c) 2014 BlackBerry Limited. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.h" - -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.h" -#include "third_party/skia/include/core/SkPaint.h" -#include "third_party/skia/include/core/SkPath.h" -#include "third_party/skia/include/core/SkPoint.h" -#include "third_party/skia/include/core/SkRect.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/private/SkFixed.h" - -#include "flutter/sky/engine/wtf/HashMap.h" -#include "hb.h" - -namespace blink { - -// Our implementation of the callbacks which HarfBuzz requires by using Skia -// calls. See the HarfBuzz source for references about what these callbacks do. - -struct HarfBuzzFontData { - HarfBuzzFontData( - WTF::HashMap* glyphCacheForFaceCacheEntry) - : m_glyphCacheForFaceCacheEntry(glyphCacheForFaceCacheEntry) {} - SkPaint m_paint; - WTF::HashMap* m_glyphCacheForFaceCacheEntry; -}; - -static hb_position_t SkiaScalarToHarfBuzzPosition(SkScalar value) { - return SkScalarToFixed(value); -} - -static void SkiaGetGlyphWidthAndExtents(SkPaint* paint, - hb_codepoint_t codepoint, - hb_position_t* width, - hb_glyph_extents_t* extents) { - ASSERT(codepoint <= 0xFFFF); - paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding); - - SkScalar skWidth; - SkRect skBounds; - uint16_t glyph = codepoint; - - paint->getTextWidths(&glyph, sizeof(glyph), &skWidth, &skBounds); - if (width) - *width = SkiaScalarToHarfBuzzPosition(skWidth); - if (extents) { - // Invert y-axis because Skia is y-grows-down but we set up HarfBuzz to be - // y-grows-up. - extents->x_bearing = SkiaScalarToHarfBuzzPosition(skBounds.fLeft); - extents->y_bearing = SkiaScalarToHarfBuzzPosition(-skBounds.fTop); - extents->width = SkiaScalarToHarfBuzzPosition(skBounds.width()); - extents->height = SkiaScalarToHarfBuzzPosition(-skBounds.height()); - } -} - -static hb_bool_t harfBuzzGetGlyph(hb_font_t* hbFont, - void* fontData, - hb_codepoint_t unicode, - hb_codepoint_t variationSelector, - hb_codepoint_t* glyph, - void* userData) { - // Variation selectors not supported. - if (variationSelector) - return false; - - HarfBuzzFontData* hbFontData = reinterpret_cast(fontData); - - WTF::HashMap::AddResult result = - hbFontData->m_glyphCacheForFaceCacheEntry->add(unicode, 0); - if (result.isNewEntry) { - SkPaint* paint = &hbFontData->m_paint; - paint->setTextEncoding(SkPaint::kUTF32_TextEncoding); - uint16_t glyph16; - paint->textToGlyphs(&unicode, sizeof(hb_codepoint_t), &glyph16); - result.storedValue->value = glyph16; - *glyph = glyph16; - } - *glyph = result.storedValue->value; - return !!*glyph; -} - -static hb_position_t harfBuzzGetGlyphHorizontalAdvance(hb_font_t* hbFont, - void* fontData, - hb_codepoint_t glyph, - void* userData) { - HarfBuzzFontData* hbFontData = reinterpret_cast(fontData); - hb_position_t advance = 0; - - SkiaGetGlyphWidthAndExtents(&hbFontData->m_paint, glyph, &advance, 0); - return advance; -} - -static hb_bool_t harfBuzzGetGlyphHorizontalOrigin(hb_font_t* hbFont, - void* fontData, - hb_codepoint_t glyph, - hb_position_t* x, - hb_position_t* y, - void* userData) { - // Just return true, following the way that HarfBuzz-FreeType - // implementation does. - return true; -} - -static hb_position_t harfBuzzGetGlyphHorizontalKerning( - hb_font_t*, - void* fontData, - hb_codepoint_t leftGlyph, - hb_codepoint_t rightGlyph, - void*) { - HarfBuzzFontData* hbFontData = reinterpret_cast(fontData); - if (hbFontData->m_paint.isVerticalText()) { - // We don't support cross-stream kerning - return 0; - } - - SkTypeface* typeface = hbFontData->m_paint.getTypeface(); - - const uint16_t glyphs[2] = {static_cast(leftGlyph), - static_cast(rightGlyph)}; - int32_t kerningAdjustments[1] = {0}; - - if (typeface->getKerningPairAdjustments(glyphs, 2, kerningAdjustments)) { - SkScalar upm = SkIntToScalar(typeface->getUnitsPerEm()); - SkScalar size = hbFontData->m_paint.getTextSize(); - return SkiaScalarToHarfBuzzPosition(kerningAdjustments[0] * size / upm); - } - - return 0; -} - -static hb_position_t harfBuzzGetGlyphVerticalKerning(hb_font_t*, - void* fontData, - hb_codepoint_t topGlyph, - hb_codepoint_t bottomGlyph, - void*) { - HarfBuzzFontData* hbFontData = reinterpret_cast(fontData); - if (!hbFontData->m_paint.isVerticalText()) { - // We don't support cross-stream kerning - return 0; - } - - SkTypeface* typeface = hbFontData->m_paint.getTypeface(); - - const uint16_t glyphs[2] = {static_cast(topGlyph), - static_cast(bottomGlyph)}; - int32_t kerningAdjustments[1] = {0}; - - if (typeface->getKerningPairAdjustments(glyphs, 2, kerningAdjustments)) { - SkScalar upm = SkIntToScalar(typeface->getUnitsPerEm()); - SkScalar size = hbFontData->m_paint.getTextSize(); - return SkiaScalarToHarfBuzzPosition(kerningAdjustments[0] * size / upm); - } - - return 0; -} - -static hb_bool_t harfBuzzGetGlyphExtents(hb_font_t* hbFont, - void* fontData, - hb_codepoint_t glyph, - hb_glyph_extents_t* extents, - void* userData) { - HarfBuzzFontData* hbFontData = reinterpret_cast(fontData); - - SkiaGetGlyphWidthAndExtents(&hbFontData->m_paint, glyph, 0, extents); - return true; -} - -static hb_font_funcs_t* harfBuzzSkiaGetFontFuncs() { - static hb_font_funcs_t* harfBuzzSkiaFontFuncs = 0; - - // We don't set callback functions which we can't support. - // HarfBuzz will use the fallback implementation if they aren't set. - if (!harfBuzzSkiaFontFuncs) { - harfBuzzSkiaFontFuncs = hb_font_funcs_create(); - hb_font_funcs_set_glyph_func(harfBuzzSkiaFontFuncs, harfBuzzGetGlyph, 0, 0); - hb_font_funcs_set_glyph_h_advance_func( - harfBuzzSkiaFontFuncs, harfBuzzGetGlyphHorizontalAdvance, 0, 0); - hb_font_funcs_set_glyph_h_kerning_func( - harfBuzzSkiaFontFuncs, harfBuzzGetGlyphHorizontalKerning, 0, 0); - hb_font_funcs_set_glyph_h_origin_func( - harfBuzzSkiaFontFuncs, harfBuzzGetGlyphHorizontalOrigin, 0, 0); - hb_font_funcs_set_glyph_v_kerning_func( - harfBuzzSkiaFontFuncs, harfBuzzGetGlyphVerticalKerning, 0, 0); - hb_font_funcs_set_glyph_extents_func(harfBuzzSkiaFontFuncs, - harfBuzzGetGlyphExtents, 0, 0); - hb_font_funcs_make_immutable(harfBuzzSkiaFontFuncs); - } - return harfBuzzSkiaFontFuncs; -} - -static hb_blob_t* harfBuzzSkiaGetTable(hb_face_t* face, - hb_tag_t tag, - void* userData) { - SkTypeface* typeface = reinterpret_cast(userData); - - const size_t tableSize = typeface->getTableSize(tag); - if (!tableSize) - return 0; - - char* buffer = reinterpret_cast(fastMalloc(tableSize)); - if (!buffer) - return 0; - size_t actualSize = typeface->getTableData(tag, 0, tableSize, buffer); - if (tableSize != actualSize) { - fastFree(buffer); - return 0; - } - - return hb_blob_create(const_cast(buffer), tableSize, - HB_MEMORY_MODE_WRITABLE, buffer, fastFree); -} - -static void destroyHarfBuzzFontData(void* userData) { - HarfBuzzFontData* hbFontData = reinterpret_cast(userData); - delete hbFontData; -} - -hb_face_t* HarfBuzzFace::createFace() { - hb_face_t* face = hb_face_create_for_tables(harfBuzzSkiaGetTable, - m_platformData->typeface(), 0); - ASSERT(face); - return face; -} - -hb_font_t* HarfBuzzFace::createFont() { - HarfBuzzFontData* hbFontData = - new HarfBuzzFontData(m_glyphCacheForFaceCacheEntry); - m_platformData->setupPaint(&hbFontData->m_paint); - hb_font_t* font = hb_font_create(m_face); - hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, - destroyHarfBuzzFontData); - float size = m_platformData->size(); - int scale = SkiaScalarToHarfBuzzPosition(size); - hb_font_set_scale(font, scale, scale); - hb_font_make_immutable(font); - return font; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.cpp b/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.cpp deleted file mode 100644 index a097bc4a3993a..0000000000000 --- a/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.cpp +++ /dev/null @@ -1,1227 +0,0 @@ -/* - * Copyright (c) 2012 Google Inc. All rights reserved. - * Copyright (C) 2013 BlackBerry Limited. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.h" - -#include -#include -#include -#include "flutter/sky/engine/platform/LayoutUnit.h" -#include "flutter/sky/engine/platform/fonts/Character.h" -#include "flutter/sky/engine/platform/fonts/Font.h" -#include "flutter/sky/engine/platform/fonts/GlyphBuffer.h" -#include "flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.h" -#include "flutter/sky/engine/platform/text/SurrogatePairAwareTextIterator.h" -#include "flutter/sky/engine/platform/text/TextBreakIterator.h" -#include "flutter/sky/engine/wtf/Compiler.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" -#include "hb.h" - -#include -#include -#include - -namespace blink { - -template -class HarfBuzzScopedPtr { - public: - typedef void (*DestroyFunction)(T*); - - HarfBuzzScopedPtr(T* ptr, DestroyFunction destroy) - : m_ptr(ptr), m_destroy(destroy) { - ASSERT(m_destroy); - } - ~HarfBuzzScopedPtr() { - if (m_ptr) - (*m_destroy)(m_ptr); - } - - T* get() { return m_ptr; } - void set(T* ptr) { m_ptr = ptr; } - - private: - T* m_ptr; - DestroyFunction m_destroy; -}; - -static const unsigned cHarfBuzzCacheMaxSize = 256; - -struct CachedShapingResultsLRUNode; -struct CachedShapingResults; -typedef std::map CachedShapingResultsMap; -typedef std::list CachedShapingResultsLRU; - -struct CachedShapingResults { - CachedShapingResults(hb_buffer_t* harfBuzzBuffer, - const Font* runFont, - hb_direction_t runDir, - const String& newLocale); - ~CachedShapingResults(); - - hb_buffer_t* buffer; - Font font; - hb_direction_t dir; - String locale; - CachedShapingResultsLRU::iterator lru; -}; - -struct CachedShapingResultsLRUNode { - CachedShapingResultsLRUNode( - const CachedShapingResultsMap::iterator& cacheEntry); - ~CachedShapingResultsLRUNode(); - - CachedShapingResultsMap::iterator entry; -}; - -CachedShapingResults::CachedShapingResults(hb_buffer_t* harfBuzzBuffer, - const Font* fontData, - hb_direction_t dirData, - const String& newLocale) - : buffer(harfBuzzBuffer), - font(*fontData), - dir(dirData), - locale(newLocale) {} - -CachedShapingResults::~CachedShapingResults() { - hb_buffer_destroy(buffer); -} - -CachedShapingResultsLRUNode::CachedShapingResultsLRUNode( - const CachedShapingResultsMap::iterator& cacheEntry) - : entry(cacheEntry) {} - -CachedShapingResultsLRUNode::~CachedShapingResultsLRUNode() {} - -class HarfBuzzRunCache { - public: - HarfBuzzRunCache(); - ~HarfBuzzRunCache(); - - CachedShapingResults* find(const std::wstring& key) const; - void remove(CachedShapingResults* node); - void moveToBack(CachedShapingResults* node); - bool insert(const std::wstring& key, CachedShapingResults* run); - - private: - CachedShapingResultsMap m_harfBuzzRunMap; - CachedShapingResultsLRU m_harfBuzzRunLRU; -}; - -HarfBuzzRunCache::HarfBuzzRunCache() {} - -HarfBuzzRunCache::~HarfBuzzRunCache() { - for (CachedShapingResultsMap::iterator it = m_harfBuzzRunMap.begin(); - it != m_harfBuzzRunMap.end(); ++it) - delete it->second; - for (CachedShapingResultsLRU::iterator it = m_harfBuzzRunLRU.begin(); - it != m_harfBuzzRunLRU.end(); ++it) - delete *it; -} - -bool HarfBuzzRunCache::insert(const std::wstring& key, - CachedShapingResults* data) { - std::pair results = - m_harfBuzzRunMap.insert(CachedShapingResultsMap::value_type(key, data)); - - if (!results.second) - return false; - - CachedShapingResultsLRUNode* node = - new CachedShapingResultsLRUNode(results.first); - - m_harfBuzzRunLRU.push_back(node); - data->lru = --m_harfBuzzRunLRU.end(); - - if (m_harfBuzzRunMap.size() > cHarfBuzzCacheMaxSize) { - CachedShapingResultsLRUNode* lru = m_harfBuzzRunLRU.front(); - CachedShapingResults* foo = lru->entry->second; - m_harfBuzzRunMap.erase(lru->entry); - m_harfBuzzRunLRU.pop_front(); - delete foo; - delete lru; - } - - return true; -} - -inline CachedShapingResults* HarfBuzzRunCache::find( - const std::wstring& key) const { - CachedShapingResultsMap::const_iterator it = m_harfBuzzRunMap.find(key); - - return it != m_harfBuzzRunMap.end() ? it->second : 0; -} - -inline void HarfBuzzRunCache::remove(CachedShapingResults* node) { - CachedShapingResultsLRUNode* lruNode = *node->lru; - - m_harfBuzzRunLRU.erase(node->lru); - m_harfBuzzRunMap.erase(lruNode->entry); - delete lruNode; - delete node; -} - -inline void HarfBuzzRunCache::moveToBack(CachedShapingResults* node) { - CachedShapingResultsLRUNode* lruNode = *node->lru; - m_harfBuzzRunLRU.erase(node->lru); - m_harfBuzzRunLRU.push_back(lruNode); - node->lru = --m_harfBuzzRunLRU.end(); -} - -HarfBuzzRunCache& harfBuzzRunCache() { - DEFINE_STATIC_LOCAL(HarfBuzzRunCache, globalHarfBuzzRunCache, ()); - return globalHarfBuzzRunCache; -} - -static inline float harfBuzzPositionToFloat(hb_position_t value) { - return static_cast(value) / (1 << 16); -} - -static inline unsigned countGraphemesInCluster(const UChar* normalizedBuffer, - unsigned normalizedBufferLength, - uint16_t startIndex, - uint16_t endIndex) { - if (startIndex > endIndex) { - uint16_t tempIndex = startIndex; - startIndex = endIndex; - endIndex = tempIndex; - } - uint16_t length = endIndex - startIndex; - ASSERT(static_cast(startIndex + length) <= normalizedBufferLength); - TextBreakIterator* cursorPosIterator = - cursorMovementIterator(&normalizedBuffer[startIndex], length); - - int cursorPos = cursorPosIterator->current(); - int numGraphemes = -1; - while (0 <= cursorPos) { - cursorPos = cursorPosIterator->next(); - numGraphemes++; - } - return numGraphemes < 0 ? 0 : numGraphemes; -} - -inline HarfBuzzShaper::HarfBuzzRun::HarfBuzzRun(const SimpleFontData* fontData, - unsigned startIndex, - unsigned numCharacters, - hb_direction_t direction, - hb_script_t script) - : m_fontData(fontData), - m_startIndex(startIndex), - m_numCharacters(numCharacters), - m_numGlyphs(0), - m_direction(direction), - m_script(script), - m_width(0) {} - -inline HarfBuzzShaper::HarfBuzzRun::HarfBuzzRun(const HarfBuzzRun& rhs) - : m_fontData(rhs.m_fontData), - m_startIndex(rhs.m_startIndex), - m_numCharacters(rhs.m_numCharacters), - m_numGlyphs(rhs.m_numGlyphs), - m_direction(rhs.m_direction), - m_script(rhs.m_script), - m_glyphs(rhs.m_glyphs), - m_advances(rhs.m_advances), - m_glyphToCharacterIndexes(rhs.m_glyphToCharacterIndexes), - m_offsets(rhs.m_offsets), - m_width(rhs.m_width) {} - -HarfBuzzShaper::HarfBuzzRun::~HarfBuzzRun() {} - -inline void HarfBuzzShaper::HarfBuzzRun::applyShapeResult( - hb_buffer_t* harfBuzzBuffer) { - m_numGlyphs = hb_buffer_get_length(harfBuzzBuffer); - m_glyphs.resize(m_numGlyphs); - m_advances.resize(m_numGlyphs); - m_glyphToCharacterIndexes.resize(m_numGlyphs); - m_offsets.resize(m_numGlyphs); -} - -inline void HarfBuzzShaper::HarfBuzzRun::setGlyphAndPositions(unsigned index, - uint16_t glyphId, - float advance, - float offsetX, - float offsetY) { - m_glyphs[index] = glyphId; - m_advances[index] = advance; - m_offsets[index] = FloatSize(offsetX, offsetY); -} - -int HarfBuzzShaper::HarfBuzzRun::characterIndexForXPosition(float targetX) { - ASSERT(targetX <= m_width); - float currentX = 0; - float currentAdvance = m_advances[0]; - unsigned glyphIndex = 0; - - // Sum up advances that belong to a character. - while (glyphIndex < m_numGlyphs - 1 && - m_glyphToCharacterIndexes[glyphIndex] == - m_glyphToCharacterIndexes[glyphIndex + 1]) - currentAdvance += m_advances[++glyphIndex]; - currentAdvance = currentAdvance / 2.0; - if (targetX <= currentAdvance) - return rtl() ? m_numCharacters : 0; - - currentX = currentAdvance; - ++glyphIndex; - while (glyphIndex < m_numGlyphs) { - unsigned prevCharacterIndex = m_glyphToCharacterIndexes[glyphIndex - 1]; - float prevAdvance = currentAdvance; - currentAdvance = m_advances[glyphIndex]; - while (glyphIndex < m_numGlyphs - 1 && - m_glyphToCharacterIndexes[glyphIndex] == - m_glyphToCharacterIndexes[glyphIndex + 1]) - currentAdvance += m_advances[++glyphIndex]; - currentAdvance = currentAdvance / 2.0; - float nextX = currentX + prevAdvance + currentAdvance; - if (currentX <= targetX && targetX <= nextX) - return rtl() ? prevCharacterIndex : m_glyphToCharacterIndexes[glyphIndex]; - currentX = nextX; - ++glyphIndex; - } - - return rtl() ? 0 : m_numCharacters; -} - -float HarfBuzzShaper::HarfBuzzRun::xPositionForOffset(unsigned offset) { - ASSERT(offset < m_numCharacters); - unsigned glyphIndex = 0; - float position = 0; - if (rtl()) { - while (glyphIndex < m_numGlyphs && - m_glyphToCharacterIndexes[glyphIndex] > offset) { - position += m_advances[glyphIndex]; - ++glyphIndex; - } - // For RTL, we need to return the right side boundary of the character. - // Add advance of glyphs which are part of the character. - while (glyphIndex < m_numGlyphs - 1 && - m_glyphToCharacterIndexes[glyphIndex] == - m_glyphToCharacterIndexes[glyphIndex + 1]) { - position += m_advances[glyphIndex]; - ++glyphIndex; - } - position += m_advances[glyphIndex]; - } else { - while (glyphIndex < m_numGlyphs && - m_glyphToCharacterIndexes[glyphIndex] < offset) { - position += m_advances[glyphIndex]; - ++glyphIndex; - } - } - return position; -} - -static void normalizeCharacters(const TextRun& run, - unsigned length, - UChar* destination, - unsigned* destinationLength) { - unsigned position = 0; - bool error = false; - const UChar* source; - String stringFor8BitRun; - if (run.is8Bit()) { - stringFor8BitRun = - String::make16BitFrom8BitSource(run.characters8(), run.length()); - source = stringFor8BitRun.characters16(); - } else - source = run.characters16(); - - *destinationLength = 0; - while (position < length) { - UChar32 character; - U16_NEXT(source, position, length, character); - // Don't normalize tabs as they are not treated as spaces for word-end. - if (Character::treatAsSpace(character) && character != characterTabulation) - character = space; - else if (Character::treatAsZeroWidthSpaceInComplexScript(character)) - character = zeroWidthSpace; - U16_APPEND(destination, *destinationLength, length, character, error); - ASSERT_UNUSED(error, !error); - } -} - -HarfBuzzShaper::HarfBuzzShaper(const Font* font, - const TextRun& run, - ForTextEmphasisOrNot forTextEmphasis, - HashSet* fallbackFonts) - : m_font(font), - m_normalizedBufferLength(0), - m_run(run), - m_wordSpacingAdjustment(font->fontDescription().wordSpacing()), - m_padding(0), - m_padPerWordBreak(0), - m_padError(0), - m_letterSpacing(font->fontDescription().letterSpacing()), - m_fromIndex(0), - m_toIndex(m_run.length()), - m_forTextEmphasis(forTextEmphasis), - m_glyphBoundingBox(std::numeric_limits::max(), - std::numeric_limits::min(), - std::numeric_limits::min(), - std::numeric_limits::max()), - m_fallbackFonts(fallbackFonts) { - m_normalizedBuffer = adoptArrayPtr(new UChar[m_run.length() + 1]); - normalizeCharacters(m_run, m_run.length(), m_normalizedBuffer.get(), - &m_normalizedBufferLength); - setPadding(m_run.expansion()); - setFontFeatures(); -} - -// In complex text word-spacing affects each line-break, space (U+0020) and -// non-breaking space (U+00A0). -static inline bool isCodepointSpace(UChar c) { - return c == space || c == noBreakSpace || c == newlineCharacter; -} - -static inline bool isWordEnd(const UChar* normalizedBuffer, unsigned index) { - // This could refer a high-surrogate, but should work. - return index && isCodepointSpace(normalizedBuffer[index]); -} - -int HarfBuzzShaper::determineWordBreakSpacing() { - int wordBreakSpacing = m_wordSpacingAdjustment; - - if (m_padding > 0) { - int toPad = roundf(m_padPerWordBreak + m_padError); - m_padError += m_padPerWordBreak - toPad; - - if (m_padding < toPad) - toPad = m_padding; - m_padding -= toPad; - wordBreakSpacing += toPad; - } - return wordBreakSpacing; -} - -// setPadding sets a number of pixels to be distributed across the TextRun. -// WebKit uses this to justify text. -void HarfBuzzShaper::setPadding(int padding) { - m_padding = padding; - m_padError = 0; - if (!m_padding) - return; - - // If we have padding to distribute, then we try to give an equal - // amount to each space. The last space gets the smaller amount, if - // any. - unsigned numWordEnds = 0; - - for (unsigned i = 0; i < m_normalizedBufferLength; i++) { - if (isWordEnd(m_normalizedBuffer.get(), i)) - numWordEnds++; - } - - if (numWordEnds) - m_padPerWordBreak = m_padding / numWordEnds; - else - m_padPerWordBreak = 0; -} - -void HarfBuzzShaper::setDrawRange(int from, int to) { - ASSERT_WITH_SECURITY_IMPLICATION(from >= 0); - ASSERT_WITH_SECURITY_IMPLICATION(to <= m_run.length()); - m_fromIndex = from; - m_toIndex = to; -} - -void HarfBuzzShaper::setFontFeatures() { - const FontDescription& description = m_font->fontDescription(); - if (description.orientation() == Vertical) { - static hb_feature_t vert = {HarfBuzzFace::vertTag, 1, 0, - static_cast(-1)}; - static hb_feature_t vrt2 = {HarfBuzzFace::vrt2Tag, 1, 0, - static_cast(-1)}; - m_features.append(vert); - m_features.append(vrt2); - } - - static hb_feature_t noKern = {HB_TAG('k', 'e', 'r', 'n'), 0, 0, - static_cast(-1)}; - static hb_feature_t noVkrn = {HB_TAG('v', 'k', 'r', 'n'), 0, 0, - static_cast(-1)}; - switch (description.kerning()) { - case FontDescription::NormalKerning: - // kern/vkrn are enabled by default - break; - case FontDescription::NoneKerning: - m_features.append(description.orientation() == Vertical ? noVkrn - : noKern); - break; - case FontDescription::AutoKerning: - break; - } - - static hb_feature_t noClig = {HB_TAG('c', 'l', 'i', 'g'), 0, 0, - static_cast(-1)}; - static hb_feature_t noLiga = {HB_TAG('l', 'i', 'g', 'a'), 0, 0, - static_cast(-1)}; - switch (description.commonLigaturesState()) { - case FontDescription::DisabledLigaturesState: - m_features.append(noLiga); - m_features.append(noClig); - break; - case FontDescription::EnabledLigaturesState: - // liga and clig are on by default - break; - case FontDescription::NormalLigaturesState: - break; - } - static hb_feature_t dlig = {HB_TAG('d', 'l', 'i', 'g'), 1, 0, - static_cast(-1)}; - switch (description.discretionaryLigaturesState()) { - case FontDescription::DisabledLigaturesState: - // dlig is off by default - break; - case FontDescription::EnabledLigaturesState: - m_features.append(dlig); - break; - case FontDescription::NormalLigaturesState: - break; - } - static hb_feature_t hlig = {HB_TAG('h', 'l', 'i', 'g'), 1, 0, - static_cast(-1)}; - switch (description.historicalLigaturesState()) { - case FontDescription::DisabledLigaturesState: - // hlig is off by default - break; - case FontDescription::EnabledLigaturesState: - m_features.append(hlig); - break; - case FontDescription::NormalLigaturesState: - break; - } - static hb_feature_t noCalt = {HB_TAG('c', 'a', 'l', 't'), 0, 0, - static_cast(-1)}; - switch (description.contextualLigaturesState()) { - case FontDescription::DisabledLigaturesState: - m_features.append(noCalt); - break; - case FontDescription::EnabledLigaturesState: - // calt is on by default - break; - case FontDescription::NormalLigaturesState: - break; - } - - static hb_feature_t hwid = {HB_TAG('h', 'w', 'i', 'd'), 1, 0, - static_cast(-1)}; - static hb_feature_t twid = {HB_TAG('t', 'w', 'i', 'd'), 1, 0, - static_cast(-1)}; - static hb_feature_t qwid = {HB_TAG('d', 'w', 'i', 'd'), 1, 0, - static_cast(-1)}; - switch (description.widthVariant()) { - case HalfWidth: - m_features.append(hwid); - break; - case ThirdWidth: - m_features.append(twid); - break; - case QuarterWidth: - m_features.append(qwid); - break; - case RegularWidth: - break; - } - - FontFeatureSettings* settings = description.featureSettings(); - if (!settings) - return; - - unsigned numFeatures = settings->size(); - for (unsigned i = 0; i < numFeatures; ++i) { - hb_feature_t feature; - const AtomicString& tag = settings->at(i).tag(); - feature.tag = HB_TAG(tag[0], tag[1], tag[2], tag[3]); - feature.value = settings->at(i).value(); - feature.start = 0; - feature.end = static_cast(-1); - m_features.append(feature); - } -} - -bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer) { - if (!createHarfBuzzRuns()) - return false; - - m_totalWidth = 0; - if (!shapeHarfBuzzRuns()) - return false; - - if (m_harfBuzzRuns.last()->hasGlyphToCharacterIndexes() && glyphBuffer && - !fillGlyphBuffer(glyphBuffer)) - return false; - - return true; -} - -static inline int handleMultipleUChar(UChar32 character, - unsigned clusterLength, - const SimpleFontData* currentFontData, - const UChar* currentCharacterPosition, - const UChar* markCharactersEnd, - const UChar* normalizedBufferEnd) { - if (U_GET_GC_MASK(character) & U_GC_M_MASK) { - int markLength = clusterLength; - while (markCharactersEnd < normalizedBufferEnd) { - UChar32 nextCharacter; - int nextCharacterLength = 0; - U16_NEXT(markCharactersEnd, nextCharacterLength, - normalizedBufferEnd - markCharactersEnd, nextCharacter); - if (!(U_GET_GC_MASK(nextCharacter) & U_GC_M_MASK)) - break; - markLength += nextCharacterLength; - markCharactersEnd += nextCharacterLength; - } - - if (currentFontData->canRenderCombiningCharacterSequence( - currentCharacterPosition, - markCharactersEnd - currentCharacterPosition)) { - return markLength; - } - } - return 0; -} - -struct CandidateRun { - UChar32 character; - unsigned start; - unsigned end; - const SimpleFontData* fontData; - UScriptCode script; -}; - -static inline bool collectCandidateRuns(const UChar* normalizedBuffer, - size_t bufferLength, - const Font* font, - Vector* runs) { - const UChar* normalizedBufferEnd = normalizedBuffer + bufferLength; - SurrogatePairAwareTextIterator iterator(normalizedBuffer, 0, bufferLength, - bufferLength); - UChar32 character; - unsigned clusterLength = 0; - unsigned startIndexOfCurrentRun = 0; - if (!iterator.consume(character, clusterLength)) - return false; - - const SimpleFontData* nextFontData = - font->glyphDataForCharacter(character, false).fontData; - UErrorCode errorCode = U_ZERO_ERROR; - UScriptCode nextScript = uscript_getScript(character, &errorCode); - if (U_FAILURE(errorCode)) - return false; - - do { - const UChar* currentCharacterPosition = iterator.characters(); - const SimpleFontData* currentFontData = nextFontData; - UScriptCode currentScript = nextScript; - - UChar32 lastCharacter = character; - for (iterator.advance(clusterLength); - iterator.consume(character, clusterLength); - iterator.advance(clusterLength)) { - if (Character::treatAsZeroWidthSpace(character)) - continue; - - int length = handleMultipleUChar( - character, clusterLength, currentFontData, currentCharacterPosition, - iterator.characters() + clusterLength, normalizedBufferEnd); - if (length) { - clusterLength = length; - continue; - } - - nextFontData = font->glyphDataForCharacter(character, false).fontData; - nextScript = uscript_getScript(character, &errorCode); - if (U_FAILURE(errorCode)) - return false; - if (lastCharacter == zeroWidthJoiner) - currentFontData = nextFontData; - if ((nextFontData != currentFontData) || - ((currentScript != nextScript) && (nextScript != USCRIPT_INHERITED) && - (!uscript_hasScript(character, currentScript)))) - break; - currentCharacterPosition = iterator.characters(); - lastCharacter = character; - } - - CandidateRun run = {character, startIndexOfCurrentRun, - static_cast(iterator.currentCharacter()), - currentFontData, currentScript}; - runs->append(run); - - startIndexOfCurrentRun = iterator.currentCharacter(); - } while (iterator.consume(character, clusterLength)); - - return true; -} - -static inline bool matchesAdjacentRun(UScriptCode* scriptExtensions, - int length, - CandidateRun& adjacentRun) { - for (int i = 0; i < length; i++) { - if (scriptExtensions[i] == adjacentRun.script) - return true; - } - return false; -} - -static inline void resolveRunBasedOnScriptExtensions( - Vector& runs, - CandidateRun& run, - size_t i, - size_t length, - UScriptCode* scriptExtensions, - int extensionsLength, - size_t& nextResolvedRun) { - // If uscript_getScriptExtensions returns 1 it only contains the script value, - // we only care about ScriptExtensions which is indicated by a value >= 2. - if (extensionsLength <= 1) - return; - - if (i > 0 && - matchesAdjacentRun(scriptExtensions, extensionsLength, runs[i - 1])) { - run.script = runs[i - 1].script; - return; - } - - for (size_t j = i + 1; j < length; j++) { - if (runs[j].script != USCRIPT_COMMON && - runs[j].script != USCRIPT_INHERITED && - matchesAdjacentRun(scriptExtensions, extensionsLength, runs[j])) { - nextResolvedRun = j; - break; - } - } -} - -static inline void resolveRunBasedOnScriptValue(Vector& runs, - CandidateRun& run, - size_t i, - size_t length, - size_t& nextResolvedRun) { - if (run.script != USCRIPT_COMMON) - return; - - if (i > 0 && runs[i - 1].script != USCRIPT_COMMON) { - run.script = runs[i - 1].script; - return; - } - - for (size_t j = i + 1; j < length; j++) { - if (runs[j].script != USCRIPT_COMMON && - runs[j].script != USCRIPT_INHERITED) { - nextResolvedRun = j; - break; - } - } -} - -static inline bool resolveCandidateRuns(Vector& runs) { - UScriptCode scriptExtensions[USCRIPT_CODE_LIMIT]; - UErrorCode errorCode = U_ZERO_ERROR; - size_t length = runs.size(); - size_t nextResolvedRun = 0; - for (size_t i = 0; i < length; i++) { - CandidateRun& run = runs[i]; - nextResolvedRun = 0; - - if (run.script == USCRIPT_INHERITED) - run.script = i > 0 ? runs[i - 1].script : USCRIPT_COMMON; - - int extensionsLength = uscript_getScriptExtensions( - run.character, scriptExtensions, - sizeof(scriptExtensions) / sizeof(scriptExtensions[0]), &errorCode); - if (U_FAILURE(errorCode)) - return false; - - resolveRunBasedOnScriptExtensions(runs, run, i, length, scriptExtensions, - extensionsLength, nextResolvedRun); - resolveRunBasedOnScriptValue(runs, run, i, length, nextResolvedRun); - for (size_t j = i; j < nextResolvedRun; j++) - runs[j].script = runs[nextResolvedRun].script; - - i = std::max(i, nextResolvedRun); - } - return true; -} - -bool HarfBuzzShaper::createHarfBuzzRuns() { - Vector candidateRuns; - if (!collectCandidateRuns(m_normalizedBuffer.get(), m_normalizedBufferLength, - m_font, &candidateRuns)) - return false; - - if (!resolveCandidateRuns(candidateRuns)) - return false; - - size_t length = candidateRuns.size(); - for (size_t i = 0; i < length;) { - CandidateRun& run = candidateRuns[i]; - CandidateRun lastMatchingRun = run; - for (i++; i < length; i++) { - if (candidateRuns[i].script != run.script || - candidateRuns[i].fontData != run.fontData) - break; - lastMatchingRun = candidateRuns[i]; - } - addHarfBuzzRun(run.start, lastMatchingRun.end, run.fontData, run.script); - } - return !m_harfBuzzRuns.isEmpty(); -} - -// A port of hb_icu_script_to_script because harfbuzz on CrOS is built -// without hb-icu. See http://crbug.com/356929 -static inline hb_script_t ICUScriptToHBScript(UScriptCode script) { - if (UNLIKELY(script == USCRIPT_INVALID_CODE)) - return HB_SCRIPT_INVALID; - - return hb_script_from_string(uscript_getShortName(script), -1); -} - -static inline hb_direction_t TextDirectionToHBDirection(TextDirection dir) { - return dir == RTL ? HB_DIRECTION_RTL : HB_DIRECTION_LTR; -} - -void HarfBuzzShaper::addHarfBuzzRun(unsigned startCharacter, - unsigned endCharacter, - const SimpleFontData* fontData, - UScriptCode script) { - ASSERT(endCharacter > startCharacter); - ASSERT(script != USCRIPT_INVALID_CODE); - if (m_fallbackFonts) - m_fallbackFonts->add(fontData); - return m_harfBuzzRuns.append(HarfBuzzRun::create( - fontData, startCharacter, endCharacter - startCharacter, - TextDirectionToHBDirection(m_run.direction()), - ICUScriptToHBScript(script))); -} - -static const uint16_t* toUint16(const UChar* src) { - // FIXME: This relies on undefined behavior however it works on the - // current versions of all compilers we care about and avoids making - // a copy of the string. - COMPILE_ASSERT(sizeof(UChar) == sizeof(uint16_t), - UChar_is_the_same_size_as_uint16_t); - return reinterpret_cast(src); -} - -bool HarfBuzzShaper::shapeHarfBuzzRuns() { - HarfBuzzScopedPtr harfBuzzBuffer(hb_buffer_create(), - hb_buffer_destroy); - - HarfBuzzRunCache& runCache = harfBuzzRunCache(); - const FontDescription& fontDescription = m_font->fontDescription(); - const String& localeString = fontDescription.locale(); - CString locale = localeString.latin1(); - - for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) { - unsigned runIndex = m_run.rtl() ? m_harfBuzzRuns.size() - i - 1 : i; - HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get(); - const SimpleFontData* currentFontData = currentRun->fontData(); - if (currentFontData->isSVGFont()) - return false; - - FontPlatformData* platformData = - const_cast(¤tFontData->platformData()); - HarfBuzzFace* face = platformData->harfBuzzFace(); - if (!face) - return false; - - hb_buffer_set_language( - harfBuzzBuffer.get(), - hb_language_from_string(locale.data(), locale.length())); - hb_buffer_set_script(harfBuzzBuffer.get(), currentRun->script()); - hb_buffer_set_direction(harfBuzzBuffer.get(), currentRun->direction()); - - const UChar* src = m_normalizedBuffer.get() + currentRun->startIndex(); - std::wstring key(src, src + currentRun->numCharacters()); - - CachedShapingResults* cachedResults = runCache.find(key); - if (cachedResults) { - if (cachedResults->dir == currentRun->direction() && - cachedResults->font == *m_font && - cachedResults->locale == localeString) { - currentRun->applyShapeResult(cachedResults->buffer); - setGlyphPositionsForHarfBuzzRun(currentRun, cachedResults->buffer); - - hb_buffer_clear_contents(harfBuzzBuffer.get()); - - runCache.moveToBack(cachedResults); - - continue; - } - - runCache.remove(cachedResults); - } - - // Add a space as pre-context to the buffer. This prevents showing - // dotted-circle for combining marks at the beginning of runs. - static const uint16_t preContext = ' '; - hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0); - - if (fontDescription.variant() == FontVariantSmallCaps && - u_islower(m_normalizedBuffer[currentRun->startIndex()])) { - String upperText = - String(m_normalizedBuffer.get() + currentRun->startIndex(), - currentRun->numCharacters()) - .upper(); - ASSERT(!upperText.is8Bit()); // m_normalizedBuffer is 16 bit, therefore - // upperText is 16 bit, even after we call - // makeUpper(). - hb_buffer_add_utf16( - harfBuzzBuffer.get(), toUint16(upperText.characters16()), - currentRun->numCharacters(), 0, currentRun->numCharacters()); - } else { - hb_buffer_add_utf16( - harfBuzzBuffer.get(), - toUint16(m_normalizedBuffer.get() + currentRun->startIndex()), - currentRun->numCharacters(), 0, currentRun->numCharacters()); - } - - if (fontDescription.orientation() == Vertical) - face->setScriptForVerticalGlyphSubstitution(harfBuzzBuffer.get()); - - HarfBuzzScopedPtr harfBuzzFont(face->createFont(), - hb_font_destroy); - - hb_shape(harfBuzzFont.get(), harfBuzzBuffer.get(), - m_features.isEmpty() ? 0 : m_features.data(), m_features.size()); - currentRun->applyShapeResult(harfBuzzBuffer.get()); - setGlyphPositionsForHarfBuzzRun(currentRun, harfBuzzBuffer.get()); - - runCache.insert( - key, new CachedShapingResults(harfBuzzBuffer.get(), m_font, - currentRun->direction(), localeString)); - - harfBuzzBuffer.set(hb_buffer_create()); - } - - return true; -} - -void HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun( - HarfBuzzRun* currentRun, - hb_buffer_t* harfBuzzBuffer) { - const SimpleFontData* currentFontData = currentRun->fontData(); - hb_glyph_info_t* glyphInfos = hb_buffer_get_glyph_infos(harfBuzzBuffer, 0); - hb_glyph_position_t* glyphPositions = - hb_buffer_get_glyph_positions(harfBuzzBuffer, 0); - - if (!currentRun->hasGlyphToCharacterIndexes()) { - // FIXME: https://crbug.com/337886 - ASSERT_NOT_REACHED(); - return; - } - - unsigned numGlyphs = currentRun->numGlyphs(); - uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes(); - float totalAdvance = 0; - FloatPoint glyphOrigin; - - // HarfBuzz returns the shaping result in visual order. We need not to flip - // for RTL. - for (size_t i = 0; i < numGlyphs; ++i) { - bool runEnd = i + 1 == numGlyphs; - uint16_t glyph = glyphInfos[i].codepoint; - float offsetX = harfBuzzPositionToFloat(glyphPositions[i].x_offset); - float offsetY = -harfBuzzPositionToFloat(glyphPositions[i].y_offset); - float advance = harfBuzzPositionToFloat(glyphPositions[i].x_advance); - - unsigned currentCharacterIndex = - currentRun->startIndex() + glyphInfos[i].cluster; - bool isClusterEnd = - runEnd || glyphInfos[i].cluster != glyphInfos[i + 1].cluster; - float spacing = 0; - - glyphToCharacterIndexes[i] = glyphInfos[i].cluster; - - if (isClusterEnd && !Character::treatAsZeroWidthSpace( - m_normalizedBuffer[currentCharacterIndex])) - spacing += m_letterSpacing; - - if (isClusterEnd && - isWordEnd(m_normalizedBuffer.get(), currentCharacterIndex)) - spacing += determineWordBreakSpacing(); - - if (currentFontData->isZeroWidthSpaceGlyph(glyph)) { - currentRun->setGlyphAndPositions(i, glyph, 0, 0, 0); - continue; - } - - advance += spacing; - if (m_run.rtl()) { - // In RTL, spacing should be added to left side of glyphs. - offsetX += spacing; - if (!isClusterEnd) - offsetX += m_letterSpacing; - } - - currentRun->setGlyphAndPositions(i, glyph, advance, offsetX, offsetY); - - FloatRect glyphBounds = currentFontData->boundsForGlyph(glyph); - glyphBounds.move(glyphOrigin.x(), glyphOrigin.y()); - m_glyphBoundingBox.unite(glyphBounds); - glyphOrigin += FloatSize(advance + offsetX, offsetY); - - totalAdvance += advance; - } - currentRun->setWidth(totalAdvance > 0.0 ? totalAdvance : 0.0); - m_totalWidth += currentRun->width(); -} - -void HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun(GlyphBuffer* glyphBuffer, - HarfBuzzRun* currentRun, - float& carryAdvance) { - FloatSize* offsets = currentRun->offsets(); - uint16_t* glyphs = currentRun->glyphs(); - float* advances = currentRun->advances(); - unsigned numGlyphs = currentRun->numGlyphs(); - uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes(); - FloatSize runStartOffset = FloatSize(); - if (m_run.rtl()) { - for (unsigned i = 0; i < numGlyphs; ++i) { - uint16_t currentCharacterIndex = - currentRun->startIndex() + glyphToCharacterIndexes[i]; - if (currentCharacterIndex >= m_toIndex) { - carryAdvance += advances[i]; - } else if (currentCharacterIndex >= m_fromIndex) { - runStartOffset = HB_DIRECTION_IS_HORIZONTAL(currentRun->direction()) - ? FloatSize(carryAdvance, 0) - : FloatSize(0, carryAdvance); - glyphBuffer->add(glyphs[i], currentRun->fontData(), - runStartOffset + offsets[i], - carryAdvance + advances[i]); - carryAdvance = 0; - } - } - } else { - for (unsigned i = 0; i < numGlyphs; ++i) { - uint16_t currentCharacterIndex = - currentRun->startIndex() + glyphToCharacterIndexes[i]; - if (currentCharacterIndex < m_fromIndex) { - carryAdvance += advances[i]; - } else if (currentCharacterIndex < m_toIndex) { - runStartOffset = HB_DIRECTION_IS_HORIZONTAL(currentRun->direction()) - ? FloatSize(carryAdvance, 0) - : FloatSize(0, carryAdvance); - glyphBuffer->add(glyphs[i], currentRun->fontData(), - runStartOffset + offsets[i], - carryAdvance + advances[i]); - carryAdvance = 0; - } - } - } -} - -void HarfBuzzShaper::fillGlyphBufferForTextEmphasis(GlyphBuffer* glyphBuffer, - HarfBuzzRun* currentRun) { - // FIXME: Instead of generating a synthetic GlyphBuffer here which is then - // used by the drawEmphasisMarks method of FontFastPath, we should roll our - // own emphasis mark drawing function. - - float* advances = currentRun->advances(); - unsigned numGlyphs = currentRun->numGlyphs(); - uint16_t* glyphToCharacterIndexes = currentRun->glyphToCharacterIndexes(); - unsigned graphemesInCluster = 1; - float clusterAdvance = 0; - uint16_t clusterStart; - - // A "cluster" in this context means a cluster as it is used by HarfBuzz: - // The minimal group of characters and corresponding glyphs, that cannot be - // broken down further from a text shaping point of view. A cluster can - // contain multiple glyphs and grapheme clusters, with mutually overlapping - // boundaries. Below we count grapheme clusters per HarfBuzz clusters, then - // linearly split the sum of corresponding glyph advances by the number of - // grapheme clusters in order to find positions for emphasis mark drawing. - - if (m_run.rtl()) - clusterStart = currentRun->startIndex() + currentRun->numCharacters(); - else - clusterStart = currentRun->startIndex() + glyphToCharacterIndexes[0]; - - for (unsigned i = 0; i < numGlyphs; ++i) { - uint16_t currentCharacterIndex = - currentRun->startIndex() + glyphToCharacterIndexes[i]; - bool isRunEnd = (i + 1 == numGlyphs); - bool isClusterEnd = isRunEnd || (currentRun->startIndex() + - glyphToCharacterIndexes[i + 1] != - currentCharacterIndex); - clusterAdvance += advances[i]; - - if (isClusterEnd) { - uint16_t clusterEnd; - if (m_run.rtl()) - clusterEnd = currentCharacterIndex; - else - clusterEnd = - isRunEnd - ? currentRun->startIndex() + currentRun->numCharacters() - : currentRun->startIndex() + glyphToCharacterIndexes[i + 1]; - - graphemesInCluster = countGraphemesInCluster(m_normalizedBuffer.get(), - m_normalizedBufferLength, - clusterStart, clusterEnd); - if (!graphemesInCluster || !clusterAdvance) - continue; - - float glyphAdvanceX = clusterAdvance / graphemesInCluster; - for (unsigned j = 0; j < graphemesInCluster; ++j) { - // Do not put emphasis marks on space, separator, and control - // characters. - Glyph glyphToAdd = - Character::canReceiveTextEmphasis(m_run[currentCharacterIndex]) ? 1 - : 0; - glyphBuffer->add(glyphToAdd, currentRun->fontData(), glyphAdvanceX); - } - clusterStart = clusterEnd; - clusterAdvance = 0; - } - } -} - -bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer) { - unsigned numRuns = m_harfBuzzRuns.size(); - float carryAdvance = 0; - if (m_run.rtl()) { - for (int runIndex = numRuns - 1; runIndex >= 0; --runIndex) { - HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get(); - if (!currentRun->hasGlyphToCharacterIndexes()) { - // FIXME: bug 337886, 359664 - continue; - } - if (m_forTextEmphasis == ForTextEmphasis) - fillGlyphBufferForTextEmphasis(glyphBuffer, currentRun); - else - fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, carryAdvance); - } - } else { - for (unsigned runIndex = 0; runIndex < numRuns; ++runIndex) { - HarfBuzzRun* currentRun = m_harfBuzzRuns[runIndex].get(); - if (!currentRun->hasGlyphToCharacterIndexes()) { - // FIXME: bug 337886, 359664 - continue; - } - if (m_forTextEmphasis == ForTextEmphasis) - fillGlyphBufferForTextEmphasis(glyphBuffer, currentRun); - else - fillGlyphBufferFromHarfBuzzRun(glyphBuffer, currentRun, carryAdvance); - } - } - return glyphBuffer->size(); -} - -int HarfBuzzShaper::offsetForPosition(float targetX) { - int charactersSoFar = 0; - float currentX = 0; - - if (m_run.rtl()) { - charactersSoFar = m_normalizedBufferLength; - for (int i = m_harfBuzzRuns.size() - 1; i >= 0; --i) { - charactersSoFar -= m_harfBuzzRuns[i]->numCharacters(); - float nextX = currentX + m_harfBuzzRuns[i]->width(); - float offsetForRun = targetX - currentX; - if (offsetForRun >= 0 && offsetForRun <= m_harfBuzzRuns[i]->width()) { - // The x value in question is within this script run. - const unsigned index = - m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun); - return charactersSoFar + index; - } - currentX = nextX; - } - } else { - for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) { - float nextX = currentX + m_harfBuzzRuns[i]->width(); - float offsetForRun = targetX - currentX; - if (offsetForRun >= 0 && offsetForRun <= m_harfBuzzRuns[i]->width()) { - const unsigned index = - m_harfBuzzRuns[i]->characterIndexForXPosition(offsetForRun); - return charactersSoFar + index; - } - charactersSoFar += m_harfBuzzRuns[i]->numCharacters(); - currentX = nextX; - } - } - - return charactersSoFar; -} - -FloatRect HarfBuzzShaper::selectionRect(const FloatPoint& point, - int height, - int from, - int to) { - float currentX = 0; - float fromX = 0; - float toX = 0; - bool foundFromX = false; - bool foundToX = false; - - if (m_run.rtl()) - currentX = m_totalWidth; - for (unsigned i = 0; i < m_harfBuzzRuns.size(); ++i) { - if (m_run.rtl()) - currentX -= m_harfBuzzRuns[i]->width(); - int numCharacters = m_harfBuzzRuns[i]->numCharacters(); - if (!foundFromX && from >= 0 && from < numCharacters) { - fromX = m_harfBuzzRuns[i]->xPositionForOffset(from) + currentX; - foundFromX = true; - } else - from -= numCharacters; - - if (!foundToX && to >= 0 && to < numCharacters) { - toX = m_harfBuzzRuns[i]->xPositionForOffset(to) + currentX; - foundToX = true; - } else - to -= numCharacters; - - if (foundFromX && foundToX) - break; - if (!m_run.rtl()) - currentX += m_harfBuzzRuns[i]->width(); - } - - // The position in question might be just after the text. - if (!foundFromX) - fromX = 0; - if (!foundToX) - toX = m_run.rtl() ? 0 : m_totalWidth; - - if (fromX < toX) { - return Font::pixelSnappedSelectionRect(point.x() + fromX, point.x() + toX, - point.y(), height); - } - - return Font::pixelSnappedSelectionRect(point.x() + toX, point.x() + fromX, - point.y(), height); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.h b/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.h deleted file mode 100644 index 6464f36463fad..0000000000000 --- a/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_HARFBUZZ_HARFBUZZSHAPER_H_ -#define SKY_ENGINE_PLATFORM_FONTS_HARFBUZZ_HARFBUZZSHAPER_H_ - -#include "flutter/sky/engine/platform/geometry/FloatBoxExtent.h" -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/text/TextRun.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" -#include "hb.h" - -#include - -namespace blink { - -class Font; -class GlyphBuffer; -class SimpleFontData; - -class HarfBuzzShaper final { - public: - enum ForTextEmphasisOrNot { NotForTextEmphasis, ForTextEmphasis }; - - HarfBuzzShaper(const Font*, - const TextRun&, - ForTextEmphasisOrNot = NotForTextEmphasis, - HashSet* fallbackFonts = 0); - - void setDrawRange(int from, int to); - bool shape(GlyphBuffer* = 0); - float totalWidth() { return m_totalWidth; } - int offsetForPosition(float targetX); - FloatRect selectionRect(const FloatPoint&, int height, int from, int to); - FloatBoxExtent glyphBoundingBox() const { return m_glyphBoundingBox; } - - private: - class HarfBuzzRun { - public: - HarfBuzzRun(const HarfBuzzRun&); - ~HarfBuzzRun(); - - static PassOwnPtr create(const SimpleFontData* fontData, - unsigned startIndex, - unsigned numCharacters, - hb_direction_t direction, - hb_script_t script) { - return adoptPtr(new HarfBuzzRun(fontData, startIndex, numCharacters, - direction, script)); - } - - void applyShapeResult(hb_buffer_t*); - void setGlyphAndPositions(unsigned index, - uint16_t glyphId, - float advance, - float offsetX, - float offsetY); - void setWidth(float width) { m_width = width; } - - int characterIndexForXPosition(float targetX); - float xPositionForOffset(unsigned offset); - - const SimpleFontData* fontData() { return m_fontData; } - unsigned startIndex() const { return m_startIndex; } - unsigned numCharacters() const { return m_numCharacters; } - unsigned numGlyphs() const { return m_numGlyphs; } - uint16_t* glyphs() { return &m_glyphs[0]; } - float* advances() { return &m_advances[0]; } - FloatSize* offsets() { return &m_offsets[0]; } - bool hasGlyphToCharacterIndexes() const { - return m_glyphToCharacterIndexes.size() > 0; - } - uint16_t* glyphToCharacterIndexes() { - return &m_glyphToCharacterIndexes[0]; - } - float width() { return m_width; } - hb_direction_t direction() { return m_direction; } - bool rtl() { return m_direction == HB_DIRECTION_RTL; } - hb_script_t script() { return m_script; } - - private: - HarfBuzzRun(const SimpleFontData*, - unsigned startIndex, - unsigned numCharacters, - hb_direction_t, - hb_script_t); - - const SimpleFontData* m_fontData; - unsigned m_startIndex; - size_t m_numCharacters; - unsigned m_numGlyphs; - hb_direction_t m_direction; - hb_script_t m_script; - Vector m_glyphs; - Vector m_advances; - Vector m_glyphToCharacterIndexes; - Vector m_offsets; - float m_width; - }; - - int determineWordBreakSpacing(); - // setPadding sets a number of pixels to be distributed across the TextRun. - // WebKit uses this to justify text. - void setPadding(int); - - void setFontFeatures(); - - bool createHarfBuzzRuns(); - bool shapeHarfBuzzRuns(); - bool fillGlyphBuffer(GlyphBuffer*); - void fillGlyphBufferFromHarfBuzzRun(GlyphBuffer*, - HarfBuzzRun*, - float& carryAdvance); - void fillGlyphBufferForTextEmphasis(GlyphBuffer*, HarfBuzzRun* currentRun); - void setGlyphPositionsForHarfBuzzRun(HarfBuzzRun*, hb_buffer_t*); - void addHarfBuzzRun(unsigned startCharacter, - unsigned endCharacter, - const SimpleFontData*, - UScriptCode); - - const Font* m_font; - OwnPtr m_normalizedBuffer; - unsigned m_normalizedBufferLength; - const TextRun& m_run; - - float m_wordSpacingAdjustment; // Delta adjustment (pixels) for each word - // break. - float m_padding; // Pixels to be distributed over the line at word breaks. - float m_padPerWordBreak; // Pixels to be added to each word break. - float m_padError; // m_padPerWordBreak might have a fractional component. - // Since we only add a whole number of padding pixels at - // each word break we accumulate error. This is the number - // of pixels that we are behind so far. - float m_letterSpacing; // Pixels to be added after each glyph. - - Vector m_features; - Vector, 16> m_harfBuzzRuns; - - int m_fromIndex; - int m_toIndex; - - ForTextEmphasisOrNot m_forTextEmphasis; - - float m_totalWidth; - FloatBoxExtent m_glyphBoundingBox; - HashSet* m_fallbackFonts; - - friend struct CachedShapingResults; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_HARFBUZZ_HARFBUZZSHAPER_H_ diff --git a/sky/engine/platform/fonts/linux/FontCacheLinux.cpp b/sky/engine/platform/fonts/linux/FontCacheLinux.cpp deleted file mode 100644 index 46ea32ce6c819..0000000000000 --- a/sky/engine/platform/fonts/linux/FontCacheLinux.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontCache.h" - -#include -#include -#include -#include - -#include "flutter/sky/engine/public/platform/Platform.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/AtomicStringHash.h" -#include "flutter/sky/engine/wtf/text/CString.h" - -namespace blink { - -class CachedFont { - public: - // Note: We pass the charset explicitly as callers - // should not create CachedFont entries without knowing - // that the FcPattern contains a valid charset. - CachedFont(FcPattern* pattern, FcCharSet* charSet) - : m_supportedCharacters(charSet) { - ASSERT(pattern); - ASSERT(charSet); - m_fallbackFont.name = fontName(pattern); - m_fallbackFont.filename = fontFilename(pattern); - m_fallbackFont.ttcIndex = fontTtcIndex(pattern); - m_fallbackFont.isBold = fontIsBold(pattern); - m_fallbackFont.isItalic = fontIsItalic(pattern); - } - - const FontCache::PlatformFallbackFont& fallbackFont() const { - return m_fallbackFont; - } - bool hasGlyphForCharacter(UChar32 c) { - return m_supportedCharacters && FcCharSetHasChar(m_supportedCharacters, c); - } - - private: - static String fontName(FcPattern* pattern) { - FcChar8* familyName = nullptr; - if (FcPatternGetString(pattern, FC_FAMILY, 0, &familyName) != FcResultMatch) - return String(); - - // FCChar8 is unsigned char, so we cast to char for CString. - const char* charFamily = reinterpret_cast(familyName); - return String::fromUTF8(charFamily, strlen(charFamily)); - } - - static CString fontFilename(FcPattern* pattern) { - FcChar8* cFilename = nullptr; - if (FcPatternGetString(pattern, FC_FILE, 0, &cFilename) != FcResultMatch) - return CString(); - const char* fontFilename = reinterpret_cast(cFilename); - return CString(fontFilename, strlen(fontFilename)); - } - - static int fontTtcIndex(FcPattern* pattern) { - int ttcIndex = -1; - if (FcPatternGetInteger(pattern, FC_INDEX, 0, &ttcIndex) != FcResultMatch || - ttcIndex < 0) - return 0; - return ttcIndex; - } - - static bool fontIsBold(FcPattern* pattern) { - int weight = 0; - if (FcPatternGetInteger(pattern, FC_WEIGHT, 0, &weight) != FcResultMatch) - return false; - return weight >= FC_WEIGHT_BOLD; - } - - static bool fontIsItalic(FcPattern* pattern) { - int slant = 0; - if (FcPatternGetInteger(pattern, FC_SLANT, 0, &slant) != FcResultMatch) - return false; - return slant != FC_SLANT_ROMAN; - } - - FontCache::PlatformFallbackFont m_fallbackFont; - // m_supportedCharaters is owned by the parent - // FcFontSet and should never be freed. - FcCharSet* m_supportedCharacters; -}; - -class CachedFontSet { - WTF_MAKE_NONCOPYABLE(CachedFontSet); - - public: - // CachedFontSet takes ownership of the passed FcFontSet. - static PassOwnPtr createForLocale(const char* locale) { - FcFontSet* fontSet = createFcFontSetForLocale(locale); - return adoptPtr(new CachedFontSet(fontSet)); - } - - ~CachedFontSet() { - m_fallbackList.clear(); - FcFontSetDestroy(m_fontSet); - } - - FontCache::PlatformFallbackFont fallbackFontForChar(UChar32 c) { - Vector::iterator itr = m_fallbackList.begin(); - for (; itr != m_fallbackList.end(); itr++) { - if (itr->hasGlyphForCharacter(c)) - return itr->fallbackFont(); - } - // The previous code just returned garbage if the user didn't - // have the necessary fonts, this seems better than garbage. - // Current callers happen to ignore any values with an empty family string. - return FontCache::PlatformFallbackFont(); - } - - private: - static FcFontSet* createFcFontSetForLocale(const char* locale) { - FcPattern* pattern = FcPatternCreate(); - - if (locale) { - // FcChar* is unsigned char* so we have to cast. - FcPatternAddString(pattern, FC_LANG, - reinterpret_cast(locale)); - } - - FcValue fcvalue; - fcvalue.type = FcTypeBool; - fcvalue.u.b = FcTrue; - FcPatternAdd(pattern, FC_SCALABLE, fcvalue, FcFalse); - - FcConfigSubstitute(0, pattern, FcMatchPattern); - FcDefaultSubstitute(pattern); - - if (!locale) - FcPatternDel(pattern, FC_LANG); - - // The result parameter returns if any fonts were found. - // We already handle 0 fonts correctly, so we ignore the param. - FcResult result; - FcFontSet* fontSet = FcFontSort(0, pattern, 0, 0, &result); - FcPatternDestroy(pattern); - - // The caller will take ownership of this FcFontSet. - return fontSet; - } - - CachedFontSet(FcFontSet* fontSet) : m_fontSet(fontSet) { fillFallbackList(); } - - void fillFallbackList() { - ASSERT(m_fallbackList.isEmpty()); - if (!m_fontSet) - return; - - for (int i = 0; i < m_fontSet->nfont; ++i) { - FcPattern* pattern = m_fontSet->fonts[i]; - - // Ignore any bitmap fonts users may still have installed from last - // century. - FcBool isScalable; - if (FcPatternGetBool(pattern, FC_SCALABLE, 0, &isScalable) != - FcResultMatch || - !isScalable) - continue; - - // Ignore any fonts FontConfig knows about, but that we don't have - // permission to read. - FcChar8* cFilename; - if (FcPatternGetString(pattern, FC_FILE, 0, &cFilename) != FcResultMatch) - continue; - if (access(reinterpret_cast(cFilename), R_OK)) - continue; - - // Make sure this font can tell us what characters it has glyphs for. - FcCharSet* charSet; - if (FcPatternGetCharSet(pattern, FC_CHARSET, 0, &charSet) != - FcResultMatch) - continue; - - m_fallbackList.append(CachedFont(pattern, charSet)); - } - } - - FcFontSet* m_fontSet; // Owned by this object. - // CachedFont has a FcCharset* which points into the FcFontSet. - // If the FcFontSet is ever destroyed, the fallbackList - // must be cleared first. - Vector m_fallbackList; -}; - -class FontSetCache { - public: - static FontSetCache& shared() { - DEFINE_STATIC_LOCAL(FontSetCache, cache, ()); - return cache; - } - - FontCache::PlatformFallbackFont fallbackFontForCharInLocale( - UChar32 c, - const char* locale) { - DEFINE_STATIC_LOCAL(AtomicString, kNoLocale, ("NO_LOCALE_SPECIFIED")); - AtomicString localeKey; - if (locale && strlen(locale)) { - localeKey = AtomicString(locale); - } else { - // String hash computation the m_setsByLocale map needs - // a non-empty string. - localeKey = kNoLocale; - } - - LocaleToCachedFont::iterator itr = m_setsByLocale.find(localeKey); - if (itr == m_setsByLocale.end()) { - OwnPtr newEntry = - CachedFontSet::createForLocale(strlen(locale) ? locale : 0); - return m_setsByLocale.add(localeKey, newEntry.release()) - .storedValue->value->fallbackFontForChar(c); - } - return itr.get()->value->fallbackFontForChar(c); - } - // FIXME: We may wish to add a way to prune the cache at a later time. - - private: - // FIXME: This shouldn't need to be AtomicString, but - // currently HashTraits isn't smart enough - // to hash the string (only does pointer compares). - typedef HashMap> LocaleToCachedFont; - LocaleToCachedFont m_setsByLocale; -}; - -void FontCache::getFontForCharacter( - UChar32 c, - const char* locale, - FontCache::PlatformFallbackFont* fallbackFont) { - *fallbackFont = FontSetCache::shared().fallbackFontForCharInLocale(c, locale); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/linux/FontPlatformDataLinux.cpp b/sky/engine/platform/fonts/linux/FontPlatformDataLinux.cpp deleted file mode 100644 index 37f473f7ba314..0000000000000 --- a/sky/engine/platform/fonts/linux/FontPlatformDataLinux.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/public/platform/Platform.h" - -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "third_party/skia/include/core/SkTypeface.h" - -namespace blink { - -static SkPaint::Hinting skiaHinting = SkPaint::kSlight_Hinting; -static bool useSkiaAutoHint = true; -static bool useSkiaBitmaps = true; -static bool useSkiaAntiAlias = true; -static bool useSkiaSubpixelRendering = false; - -void FontPlatformData::setHinting(SkPaint::Hinting hinting) { - skiaHinting = hinting; -} - -void FontPlatformData::setAutoHint(bool useAutoHint) { - useSkiaAutoHint = useAutoHint; -} - -void FontPlatformData::setUseBitmaps(bool useBitmaps) { - useSkiaBitmaps = useBitmaps; -} - -void FontPlatformData::setAntiAlias(bool useAntiAlias) { - useSkiaAntiAlias = useAntiAlias; -} - -void FontPlatformData::setSubpixelRendering(bool useSubpixelRendering) { - useSkiaSubpixelRendering = useSubpixelRendering; -} - -void FontPlatformData::setupPaint(SkPaint* paint, - GraphicsContext* context) const { - paint->setAntiAlias(m_style.useAntiAlias); - paint->setHinting(static_cast(m_style.hintStyle)); - paint->setEmbeddedBitmapText(m_style.useBitmaps); - paint->setAutohinted(m_style.useAutoHint); - if (m_style.useAntiAlias) - paint->setLCDRenderText(m_style.useSubpixelRendering); - - // Do not enable subpixel text on low-dpi if full hinting is requested. - bool useSubpixelText = paint->getHinting() != SkPaint::kFull_Hinting || - (context && context->deviceScaleFactor() > 1.0f); - - // TestRunner specifically toggles the subpixel positioning flag. - if (useSubpixelText) - paint->setSubpixelText(true); - else - paint->setSubpixelText(m_style.useSubpixelPositioning); - - const float ts = m_textSize >= 0 ? m_textSize : 12; - paint->setTextSize(SkFloatToScalar(ts)); - paint->setTypeface(m_typeface); - paint->setFakeBoldText(m_syntheticBold); - paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0); -} - -void FontPlatformData::querySystemForRenderStyle( - bool useSkiaSubpixelPositioning) { - m_style.useBitmaps = 2; - m_style.useAutoHint = 2; - m_style.useHinting = 2; - m_style.hintStyle = 0; - m_style.useAntiAlias = 2; - m_style.useSubpixelRendering = 2; - m_style.useSubpixelPositioning = 2; - - // Fix FontRenderStyle::NoPreference to actual styles. - if (m_style.useAntiAlias == FontRenderStyle::NoPreference) - m_style.useAntiAlias = useSkiaAntiAlias; - - if (!m_style.useHinting) - m_style.hintStyle = SkPaint::kNo_Hinting; - else if (m_style.useHinting == FontRenderStyle::NoPreference) - m_style.hintStyle = skiaHinting; - - if (m_style.useBitmaps == FontRenderStyle::NoPreference) - m_style.useBitmaps = useSkiaBitmaps; - if (m_style.useAutoHint == FontRenderStyle::NoPreference) - m_style.useAutoHint = useSkiaAutoHint; - if (m_style.useAntiAlias == FontRenderStyle::NoPreference) - m_style.useAntiAlias = useSkiaAntiAlias; - if (m_style.useSubpixelRendering == FontRenderStyle::NoPreference) - m_style.useSubpixelRendering = useSkiaSubpixelRendering; - - // TestRunner specifically toggles the subpixel positioning flag. - if (m_style.useSubpixelPositioning == FontRenderStyle::NoPreference) - m_style.useSubpixelPositioning = useSkiaSubpixelPositioning; -} - -bool FontPlatformData::defaultUseSubpixelPositioning() { - return FontDescription::subpixelPositioning(); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/mobile/FontCacheMobile.cpp b/sky/engine/platform/fonts/mobile/FontCacheMobile.cpp deleted file mode 100644 index 09456ed1f48b9..0000000000000 --- a/sky/engine/platform/fonts/mobile/FontCacheMobile.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2017 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontCache.h" - -#include "flutter/sky/engine/platform/Language.h" -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/platform/fonts/FontFaceCreationParams.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/platform/text/LocaleToScriptMapping.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/ports/SkFontMgr.h" - -namespace blink { - -// SkFontMgr requires script-based locale names, like "zh-Hant" and "zh-Hans", -// instead of "zh-CN" and "zh-TW". -static CString toSkFontMgrLocale(const String& locale) { - if (!locale.startsWith("zh", TextCaseInsensitive)) - return locale.ascii(); - switch (localeToScriptCodeForFontSelection(locale)) { - case USCRIPT_SIMPLIFIED_HAN: - return "zh-Hans"; - case USCRIPT_TRADITIONAL_HAN: - return "zh-Hant"; - default: - return locale.ascii(); - } -} - -static AtomicString getFamilyNameForCharacter( - UChar32 c, - const FontDescription& fontDescription) { - sk_sp fm(SkFontMgr::RefDefault()); - const char* bcp47Locales[2]; - int localeCount = 0; - CString defaultLocale = toSkFontMgrLocale(defaultLanguage()); - bcp47Locales[localeCount++] = defaultLocale.data(); - CString fontLocale; - if (!fontDescription.locale().isEmpty()) { - fontLocale = toSkFontMgrLocale(fontDescription.locale()); - bcp47Locales[localeCount++] = fontLocale.data(); - } - sk_sp typeface(fm->matchFamilyStyleCharacter( - 0, SkFontStyle(), bcp47Locales, localeCount, c)); - if (!typeface) - return emptyAtom; - - SkString skiaFamilyName; - typeface->getFamilyName(&skiaFamilyName); - return skiaFamilyName.c_str(); -} - -PassRefPtr FontCache::fallbackFontForCharacter( - const FontDescription& fontDescription, - UChar32 c, - const SimpleFontData*) { - AtomicString familyName = getFamilyNameForCharacter(c, fontDescription); - if (familyName.isEmpty()) - return getLastResortFallbackFont(fontDescription, DoNotRetain); - return fontDataFromFontPlatformData( - getFontPlatformData(fontDescription, FontFaceCreationParams(familyName)), - DoNotRetain); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/mobile/FontCacheMobileTest.cpp b/sky/engine/platform/fonts/mobile/FontCacheMobileTest.cpp deleted file mode 100644 index 3e4b91166e424..0000000000000 --- a/sky/engine/platform/fonts/mobile/FontCacheMobileTest.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/platform/fonts/FontCache.h" - -#include -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" - -namespace blink { - -TEST(FontCacheMobile, fallbackFontForCharacter) { - // A Latin character in the common locale system font, but not in the - // Chinese locale-preferred font. - const UChar32 testChar = 228; - - FontDescription fontDescription; - fontDescription.setScript(USCRIPT_SIMPLIFIED_HAN); - fontDescription.setGenericFamily(FontDescription::StandardFamily); - - FontCache* fontCache = FontCache::fontCache(); - ASSERT_TRUE(fontCache); - RefPtr fontData = - fontCache->fallbackFontForCharacter(fontDescription, testChar, 0); - EXPECT_TRUE(fontData); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/opentype/OpenTypeTypes.h b/sky/engine/platform/fonts/opentype/OpenTypeTypes.h deleted file mode 100644 index af38f9806c58b..0000000000000 --- a/sky/engine/platform/fonts/opentype/OpenTypeTypes.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2012 Koji Ishii - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_OPENTYPE_OPENTYPETYPES_H_ -#define SKY_ENGINE_PLATFORM_FONTS_OPENTYPE_OPENTYPETYPES_H_ - -#include "flutter/sky/engine/platform/SharedBuffer.h" -#include "flutter/sky/engine/wtf/ByteOrder.h" - -namespace blink { -namespace OpenType { - -struct Int16 { - Int16(int16_t u) : v(htons(static_cast(u))) {} - operator int16_t() const { return static_cast(ntohs(v)); } - uint16_t v; // in BigEndian -}; - -struct UInt16 { - UInt16(uint16_t u) : v(htons(u)) {} - operator uint16_t() const { return ntohs(v); } - uint16_t v; // in BigEndian -}; - -struct Int32 { - Int32(int32_t u) : v(htonl(static_cast(u))) {} - operator int32_t() const { return static_cast(ntohl(v)); } - uint32_t v; // in BigEndian -}; - -struct UInt32 { - UInt32(uint32_t u) : v(htonl(u)) {} - operator uint32_t() const { return ntohl(v); } - uint32_t v; // in BigEndian -}; - -typedef UInt32 Fixed; -typedef UInt16 Offset; -typedef UInt16 GlyphID; - -// OTTag is native because it's only compared against constants, so we don't -// do endian conversion here but make sure constants are in big-endian order. -// Note that multi-character literal is implementation-defined in C++0x. -typedef uint32_t Tag; -#define OT_MAKE_TAG(ch1, ch2, ch3, ch4) \ - ((((uint32_t)(ch4)) << 24) | (((uint32_t)(ch3)) << 16) | \ - (((uint32_t)(ch2)) << 8) | ((uint32_t)(ch1))) - -template -static const T* validateTable(const RefPtr& buffer, - size_t count = 1) { - if (!buffer || buffer->size() < sizeof(T) * count) - return 0; - return reinterpret_cast(buffer->data()); -} - -struct TableBase { - protected: - static bool isValidEnd(const SharedBuffer& buffer, const void* position) { - if (position < buffer.data()) - return false; - size_t offset = reinterpret_cast(position) - buffer.data(); - return offset <= buffer.size(); // "<=" because end is included as valid - } - - template - static const T* validatePtr(const SharedBuffer& buffer, - const void* position) { - const T* casted = reinterpret_cast(position); - if (!isValidEnd(buffer, &casted[1])) - return 0; - return casted; - } - - template - const T* validateOffset(const SharedBuffer& buffer, uint16_t offset) const { - return validatePtr(buffer, - reinterpret_cast(this) + offset); - } -}; - -} // namespace OpenType -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_OPENTYPE_OPENTYPETYPES_H_ diff --git a/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.cpp b/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.cpp deleted file mode 100644 index 7addf33a1a274..0000000000000 --- a/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.cpp +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (C) 2012 Koji Ishii - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h" - -#include "flutter/sky/engine/platform/SharedBuffer.h" -#include "flutter/sky/engine/platform/fonts/GlyphPage.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/platform/fonts/opentype/OpenTypeTypes.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { -namespace OpenType { - -const uint32_t HheaTag = OT_MAKE_TAG('h', 'h', 'e', 'a'); -const uint32_t HmtxTag = OT_MAKE_TAG('h', 'm', 't', 'x'); -const uint32_t VheaTag = OT_MAKE_TAG('v', 'h', 'e', 'a'); -const uint32_t VmtxTag = OT_MAKE_TAG('v', 'm', 't', 'x'); -const uint32_t VORGTag = OT_MAKE_TAG('V', 'O', 'R', 'G'); - -#pragma pack(1) - -struct HheaTable { - OpenType::Fixed version; - OpenType::Int16 ascender; - OpenType::Int16 descender; - OpenType::Int16 lineGap; - OpenType::Int16 advanceWidthMax; - OpenType::Int16 minLeftSideBearing; - OpenType::Int16 minRightSideBearing; - OpenType::Int16 xMaxExtent; - OpenType::Int16 caretSlopeRise; - OpenType::Int16 caretSlopeRun; - OpenType::Int16 caretOffset; - OpenType::Int16 reserved[4]; - OpenType::Int16 metricDataFormat; - OpenType::UInt16 numberOfHMetrics; -}; - -struct VheaTable { - OpenType::Fixed version; - OpenType::Int16 ascent; - OpenType::Int16 descent; - OpenType::Int16 lineGap; - OpenType::Int16 advanceHeightMax; - OpenType::Int16 minTopSideBearing; - OpenType::Int16 minBottomSideBearing; - OpenType::Int16 yMaxExtent; - OpenType::Int16 caretSlopeRise; - OpenType::Int16 caretSlopeRun; - OpenType::Int16 caretOffset; - OpenType::Int16 reserved[4]; - OpenType::Int16 metricDataFormat; - OpenType::UInt16 numOfLongVerMetrics; -}; - -struct HmtxTable { - struct Entry { - OpenType::UInt16 advanceWidth; - OpenType::Int16 lsb; - } entries[1]; -}; - -struct VmtxTable { - struct Entry { - OpenType::UInt16 advanceHeight; - OpenType::Int16 topSideBearing; - } entries[1]; -}; - -struct VORGTable { - OpenType::UInt16 majorVersion; - OpenType::UInt16 minorVersion; - OpenType::Int16 defaultVertOriginY; - OpenType::UInt16 numVertOriginYMetrics; - struct VertOriginYMetrics { - OpenType::UInt16 glyphIndex; - OpenType::Int16 vertOriginY; - } vertOriginYMetrics[1]; - - size_t requiredSize() const { - return sizeof(*this) + - sizeof(VertOriginYMetrics) * (numVertOriginYMetrics - 1); - } -}; - -#pragma pack() - -} // namespace OpenType - -OpenTypeVerticalData::OpenTypeVerticalData(const FontPlatformData& platformData) - : m_defaultVertOriginY(0) { - loadMetrics(platformData); -} - -void OpenTypeVerticalData::loadMetrics(const FontPlatformData& platformData) { - // Load hhea and hmtx to get x-component of vertical origins. - // If these tables are missing, it's not an OpenType font. - RefPtr buffer = platformData.openTypeTable(OpenType::HheaTag); - const OpenType::HheaTable* hhea = - OpenType::validateTable(buffer); - if (!hhea) - return; - uint16_t countHmtxEntries = hhea->numberOfHMetrics; - if (!countHmtxEntries) { - WTF_LOG_ERROR("Invalid numberOfHMetrics"); - return; - } - - buffer = platformData.openTypeTable(OpenType::HmtxTag); - const OpenType::HmtxTable* hmtx = - OpenType::validateTable(buffer, countHmtxEntries); - if (!hmtx) { - WTF_LOG_ERROR("hhea exists but hmtx does not (or broken)"); - return; - } - m_advanceWidths.resize(countHmtxEntries); - for (uint16_t i = 0; i < countHmtxEntries; ++i) - m_advanceWidths[i] = hmtx->entries[i].advanceWidth; - - // Load vhea first. This table is required for fonts that support vertical - // flow. - buffer = platformData.openTypeTable(OpenType::VheaTag); - const OpenType::VheaTable* vhea = - OpenType::validateTable(buffer); - if (!vhea) - return; - uint16_t countVmtxEntries = vhea->numOfLongVerMetrics; - if (!countVmtxEntries) { - WTF_LOG_ERROR("Invalid numOfLongVerMetrics"); - return; - } - - // Load VORG. This table is optional. - buffer = platformData.openTypeTable(OpenType::VORGTag); - const OpenType::VORGTable* vorg = - OpenType::validateTable(buffer); - if (vorg && buffer->size() >= vorg->requiredSize()) { - m_defaultVertOriginY = vorg->defaultVertOriginY; - uint16_t countVertOriginYMetrics = vorg->numVertOriginYMetrics; - if (!countVertOriginYMetrics) { - // Add one entry so that hasVORG() becomes true - m_vertOriginY.set(0, m_defaultVertOriginY); - } else { - for (uint16_t i = 0; i < countVertOriginYMetrics; ++i) { - const OpenType::VORGTable::VertOriginYMetrics& metrics = - vorg->vertOriginYMetrics[i]; - m_vertOriginY.set(metrics.glyphIndex, metrics.vertOriginY); - } - } - } - - // Load vmtx then. This table is required for fonts that support vertical - // flow. - buffer = platformData.openTypeTable(OpenType::VmtxTag); - const OpenType::VmtxTable* vmtx = - OpenType::validateTable(buffer, countVmtxEntries); - if (!vmtx) { - WTF_LOG_ERROR("vhea exists but vmtx does not (or broken)"); - return; - } - m_advanceHeights.resize(countVmtxEntries); - for (uint16_t i = 0; i < countVmtxEntries; ++i) - m_advanceHeights[i] = vmtx->entries[i].advanceHeight; - - // VORG is preferred way to calculate vertical origin than vmtx, - // so load topSideBearing from vmtx only if VORG is missing. - if (hasVORG()) - return; - - size_t sizeExtra = - buffer->size() - sizeof(OpenType::VmtxTable::Entry) * countVmtxEntries; - if (sizeExtra % sizeof(OpenType::Int16)) { - WTF_LOG_ERROR("vmtx has incorrect tsb count"); - return; - } - size_t countTopSideBearings = - countVmtxEntries + sizeExtra / sizeof(OpenType::Int16); - m_topSideBearings.resize(countTopSideBearings); - size_t i; - for (i = 0; i < countVmtxEntries; ++i) - m_topSideBearings[i] = vmtx->entries[i].topSideBearing; - if (i < countTopSideBearings) { - const OpenType::Int16* pTopSideBearingsExtra = - reinterpret_cast( - &vmtx->entries[countVmtxEntries]); - for (; i < countTopSideBearings; ++i, ++pTopSideBearingsExtra) - m_topSideBearings[i] = *pTopSideBearingsExtra; - } -} - -float OpenTypeVerticalData::advanceHeight(const SimpleFontData* font, - Glyph glyph) const { - size_t countHeights = m_advanceHeights.size(); - if (countHeights) { - uint16_t advanceFUnit = - m_advanceHeights[glyph < countHeights ? glyph : countHeights - 1]; - float advance = advanceFUnit * font->sizePerUnit(); - return advance; - } - - // No vertical info in the font file; use height as advance. - return font->fontMetrics().height(); -} - -void OpenTypeVerticalData::getVerticalTranslationsForGlyphs( - const SimpleFontData* font, - const Glyph* glyphs, - size_t count, - float* outXYArray) const { - size_t countWidths = m_advanceWidths.size(); - ASSERT(countWidths > 0); - const FontMetrics& metrics = font->fontMetrics(); - float sizePerUnit = font->sizePerUnit(); - float ascent = metrics.ascent(); - bool useVORG = hasVORG(); - size_t countTopSideBearings = m_topSideBearings.size(); - float defaultVertOriginY = std::numeric_limits::quiet_NaN(); - for (float *end = &(outXYArray[count * 2]); outXYArray != end; - ++glyphs, outXYArray += 2) { - Glyph glyph = *glyphs; - uint16_t widthFUnit = - m_advanceWidths[glyph < countWidths ? glyph : countWidths - 1]; - float width = widthFUnit * sizePerUnit; - outXYArray[0] = -width / 2; - - // For Y, try VORG first. - if (useVORG) { - if (glyph) { - int16_t vertOriginYFUnit = m_vertOriginY.get(glyph); - if (vertOriginYFUnit) { - outXYArray[1] = -vertOriginYFUnit * sizePerUnit; - continue; - } - } - if (std::isnan(defaultVertOriginY)) - defaultVertOriginY = -m_defaultVertOriginY * sizePerUnit; - outXYArray[1] = defaultVertOriginY; - continue; - } - - // If no VORG, try vmtx next. - if (countTopSideBearings) { - int16_t topSideBearingFUnit = - m_topSideBearings[glyph < countTopSideBearings - ? glyph - : countTopSideBearings - 1]; - float topSideBearing = topSideBearingFUnit * sizePerUnit; - FloatRect bounds = font->boundsForGlyph(glyph); - outXYArray[1] = bounds.y() - topSideBearing; - continue; - } - - // No vertical info in the font file; use ascent as vertical origin. - outXYArray[1] = -ascent; - } -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h b/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h deleted file mode 100644 index d42b917607574..0000000000000 --- a/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2012 Koji Ishii - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_FONTS_OPENTYPE_OPENTYPEVERTICALDATA_H_ -#define SKY_ENGINE_PLATFORM_FONTS_OPENTYPE_OPENTYPEVERTICALDATA_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/Glyph.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class FontPlatformData; -class SimpleFontData; - -class PLATFORM_EXPORT OpenTypeVerticalData - : public RefCounted { - public: - static PassRefPtr create( - const FontPlatformData& platformData) { - return adoptRef(new OpenTypeVerticalData(platformData)); - } - - bool isOpenType() const { return !m_advanceWidths.isEmpty(); } - bool hasVerticalMetrics() const { return !m_advanceHeights.isEmpty(); } - float advanceHeight(const SimpleFontData*, Glyph) const; - - bool inFontCache() const { return m_inFontCache; } - void setInFontCache(bool inFontCache) { m_inFontCache = inFontCache; } - - void getVerticalTranslationsForGlyphs(const SimpleFontData*, - const Glyph*, - size_t, - float* outXYArray) const; - - private: - explicit OpenTypeVerticalData(const FontPlatformData&); - - void loadMetrics(const FontPlatformData&); - bool hasVORG() const { return !m_vertOriginY.isEmpty(); } - - HashMap m_verticalGlyphMap; - Vector m_advanceWidths; - Vector m_advanceHeights; - Vector m_topSideBearings; - int16_t m_defaultVertOriginY; - HashMap m_vertOriginY; - - bool m_inFontCache; // for mark & sweep in FontCache::purgeInactiveFontData() -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_FONTS_OPENTYPE_OPENTYPEVERTICALDATA_H_ diff --git a/sky/engine/platform/fonts/skia/FontCacheSkia.cpp b/sky/engine/platform/fonts/skia/FontCacheSkia.cpp deleted file mode 100644 index 10b73d324063c..0000000000000 --- a/sky/engine/platform/fonts/skia/FontCacheSkia.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/platform/NotImplemented.h" -#include "flutter/sky/engine/platform/fonts/AlternateFontFamily.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/platform/fonts/FontFaceCreationParams.h" -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" -#include "flutter/sky/engine/public/platform/Platform.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "third_party/skia/include/core/SkStream.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/ports/SkFontMgr.h" - -#if !OS(WIN) && !OS(ANDROID) -#include "third_party/skia/include/ports/SkFontConfigInterface.h" -#endif - -namespace blink { - -#if !OS(FUCHSIA) - -static int toSkiaWeight(FontWeight weight) { - switch (weight) { - case FontWeight100: - return SkFontStyle::kThin_Weight; - case FontWeight200: - return SkFontStyle::kExtraLight_Weight; - case FontWeight300: - return SkFontStyle::kLight_Weight; - case FontWeight400: - return SkFontStyle::kNormal_Weight; - case FontWeight500: - return SkFontStyle::kMedium_Weight; - case FontWeight600: - return SkFontStyle::kSemiBold_Weight; - case FontWeight700: - return SkFontStyle::kBold_Weight; - case FontWeight800: - return SkFontStyle::kExtraBold_Weight; - case FontWeight900: - return SkFontStyle::kBlack_Weight; - } - ASSERT_NOT_REACHED(); - return SkFontStyle::kNormal_Weight; -} - -static SkFontStyle::Slant toSkiaSlant(FontStyle style) { - switch (style) { - case FontStyleNormal: - return SkFontStyle::kUpright_Slant; - case FontStyleItalic: - return SkFontStyle::kItalic_Slant; - } - ASSERT_NOT_REACHED(); - return SkFontStyle::kUpright_Slant; -} - -static int toSkiaWidth(FontStretch stretch) { - // Numeric values matching OS/2 & Windows Metrics usWidthClass table. - // https://www.microsoft.com/typography/otspec/os2.htm - return static_cast(stretch); -} - -static SkFontStyle toSkiaFontStyle(const FontDescription& fontDescription) { - return SkFontStyle(toSkiaWeight(fontDescription.weight()), - toSkiaWidth(fontDescription.stretch()), - toSkiaSlant(fontDescription.style())); -} - -#endif // !OS(FUCHSIA) - -void FontCache::platformInit() {} - -PassRefPtr FontCache::fallbackOnStandardFontStyle( - const FontDescription& fontDescription, - UChar32 character) { - FontDescription substituteDescription(fontDescription); - substituteDescription.setStyle(FontStyleNormal); - substituteDescription.setWeight(FontWeightNormal); - - FontFaceCreationParams creationParams( - substituteDescription.family().family()); - FontPlatformData* substitutePlatformData = - getFontPlatformData(substituteDescription, creationParams); - if (substitutePlatformData && - substitutePlatformData->fontContainsCharacter(character)) { - FontPlatformData platformData = FontPlatformData(*substitutePlatformData); - platformData.setSyntheticBold(fontDescription.weight() >= FontWeight600); - platformData.setSyntheticItalic(fontDescription.style() == FontStyleItalic); - return fontDataFromFontPlatformData(&platformData, DoNotRetain); - } - - return nullptr; -} - -#if !OS(WIN) && !OS(ANDROID) && !OS(IOS) -PassRefPtr FontCache::fallbackFontForCharacter( - const FontDescription& fontDescription, - UChar32 c, - const SimpleFontData*) { - // First try the specified font with standard style & weight. - if (fontDescription.style() == FontStyleItalic || - fontDescription.weight() >= FontWeight600) { - RefPtr fontData = - fallbackOnStandardFontStyle(fontDescription, c); - if (fontData) - return fontData; - } - - FontCache::PlatformFallbackFont fallbackFont; - FontCache::getFontForCharacter(c, "", &fallbackFont); - if (fallbackFont.name.isEmpty()) - return nullptr; - - FontFaceCreationParams creationParams; - creationParams = FontFaceCreationParams(fallbackFont.filename, - fallbackFont.fontconfigInterfaceId, - fallbackFont.ttcIndex); - - // Changes weight and/or italic of given FontDescription depends on - // the result of fontconfig so that keeping the correct font mapping - // of the given character. See http://crbug.com/32109 for details. - bool shouldSetSyntheticBold = false; - bool shouldSetSyntheticItalic = false; - FontDescription description(fontDescription); - if (fallbackFont.isBold && description.weight() < FontWeightBold) - description.setWeight(FontWeightBold); - if (!fallbackFont.isBold && description.weight() >= FontWeightBold) { - shouldSetSyntheticBold = true; - description.setWeight(FontWeightNormal); - } - if (fallbackFont.isItalic && description.style() == FontStyleNormal) - description.setStyle(FontStyleItalic); - if (!fallbackFont.isItalic && description.style() == FontStyleItalic) { - shouldSetSyntheticItalic = true; - description.setStyle(FontStyleNormal); - } - - FontPlatformData* substitutePlatformData = - getFontPlatformData(description, creationParams); - if (!substitutePlatformData) - return nullptr; - FontPlatformData platformData = FontPlatformData(*substitutePlatformData); - platformData.setSyntheticBold(shouldSetSyntheticBold); - platformData.setSyntheticItalic(shouldSetSyntheticItalic); - return fontDataFromFontPlatformData(&platformData, DoNotRetain); -} - -#endif // !OS(WIN) && !OS(ANDROID) - -PassRefPtr FontCache::getLastResortFallbackFont( - const FontDescription& description, - ShouldRetain shouldRetain) { - const FontFaceCreationParams fallbackCreationParams( - getFallbackFontFamily(description)); - const FontPlatformData* fontPlatformData = - getFontPlatformData(description, fallbackCreationParams); - - // We should at least have Sans or Arial which is the last resort fallback of - // SkFontHost ports. - if (!fontPlatformData) { - DEFINE_STATIC_LOCAL( - const FontFaceCreationParams, sansCreationParams, - (AtomicString("Sans", AtomicString::ConstructFromLiteral))); - fontPlatformData = getFontPlatformData(description, sansCreationParams); - } - if (!fontPlatformData) { - DEFINE_STATIC_LOCAL( - const FontFaceCreationParams, arialCreationParams, - (AtomicString("Arial", AtomicString::ConstructFromLiteral))); - fontPlatformData = getFontPlatformData(description, arialCreationParams); - } - - ASSERT(fontPlatformData); - return fontDataFromFontPlatformData(fontPlatformData, shouldRetain); -} - -#if !OS(FUCHSIA) -sk_sp FontCache::createTypeface( - const FontDescription& fontDescription, - const FontFaceCreationParams& creationParams, - CString& name) { -#if !OS(WIN) && !OS(ANDROID) - if (creationParams.creationType() == CreateFontByFciIdAndTtcIndex) { - return SkTypeface::MakeFromFile(creationParams.filename().data()); - } -#endif - - AtomicString family = creationParams.family(); - // If we're creating a fallback font (e.g. "-webkit-monospace"), convert the - // name into the fallback name (like "monospace") that fontconfig understands. - if (!family.length() || family.startsWith("-webkit-")) { - name = getFallbackFontFamily(fontDescription).string().utf8(); - } else { - // convert the name to utf8 - name = family.utf8(); - } - - SkFontStyle style = toSkiaFontStyle(fontDescription); - sk_sp fm(SkFontMgr::RefDefault()); - sk_sp typeface(fm->matchFamilyStyle(name.data(), style)); - if (typeface) - return typeface; - - return SkTypeface::MakeFromName(name.data(), style); -} -#endif - -#if !OS(WIN) -FontPlatformData* FontCache::createFontPlatformData( - const FontDescription& fontDescription, - const FontFaceCreationParams& creationParams, - float fontSize) { - CString name; - sk_sp tf = createTypeface(fontDescription, creationParams, name); - if (!tf) - return 0; - - FontPlatformData* result = new FontPlatformData( - tf, name.data(), fontSize, - (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || - fontDescription.isSyntheticBold(), - (fontDescription.style() && !tf->isItalic()) || - fontDescription.isSyntheticItalic(), - fontDescription.orientation(), fontDescription.useSubpixelPositioning()); - return result; -} -#endif // !OS(WIN) - -} // namespace blink diff --git a/sky/engine/platform/fonts/skia/FontCustomPlatformDataSkia.cpp b/sky/engine/platform/fonts/skia/FontCustomPlatformDataSkia.cpp deleted file mode 100644 index f3f42e5bb4bda..0000000000000 --- a/sky/engine/platform/fonts/skia/FontCustomPlatformDataSkia.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007 Apple Computer, Inc. - * Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. - * Copyright (C) 2010 Company 100, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontCustomPlatformData.h" - -#include "flutter/sky/engine/platform/SharedBuffer.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "third_party/skia/include/core/SkStream.h" -#include "third_party/skia/include/core/SkTypeface.h" - -namespace blink { - -FontCustomPlatformData::FontCustomPlatformData(sk_sp typeface) - : m_typeface(typeface) {} - -FontCustomPlatformData::~FontCustomPlatformData() {} - -FontPlatformData FontCustomPlatformData::fontPlatformData( - float size, - bool bold, - bool italic, - FontOrientation orientation, - FontWidthVariant) { - ASSERT(m_typeface); - return FontPlatformData(m_typeface, "", size, bold && !m_typeface->isBold(), - italic && !m_typeface->isItalic(), orientation); -} - -PassOwnPtr FontCustomPlatformData::create( - SharedBuffer* buffer) { - ASSERT_ARG(buffer, buffer); - - SkMemoryStream* stream = new SkMemoryStream(buffer->getAsSkData()); - sk_sp typeface = SkTypeface::MakeFromStream(stream); - if (!typeface) - return nullptr; - - return adoptPtr(new FontCustomPlatformData(typeface)); -} - -bool FontCustomPlatformData::supportsFormat(const String& format) { - return equalIgnoringCase(format, "truetype") || - equalIgnoringCase(format, "opentype"); -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/skia/FontPlatformDataSkia.cpp b/sky/engine/platform/fonts/skia/FontPlatformDataSkia.cpp deleted file mode 100644 index 8e46405b7049f..0000000000000 --- a/sky/engine/platform/fonts/skia/FontPlatformDataSkia.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontPlatformData.h" - -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/src/core/SkEndian.h" - -namespace blink { - -unsigned FontPlatformData::hash() const { - unsigned h = SkTypeface::UniqueID(m_typeface.get()); - h ^= 0x01010101 * ((static_cast(m_orientation) << 2) | - (static_cast(m_syntheticBold) << 1) | - static_cast(m_syntheticItalic)); - - // This memcpy is to avoid a reinterpret_cast that breaks strict-aliasing - // rules. Memcpy is generally optimized enough so that performance doesn't - // matter here. - uint32_t textSizeBytes; - memcpy(&textSizeBytes, &m_textSize, sizeof(uint32_t)); - h ^= textSizeBytes; - - return h; -} - -bool FontPlatformData::fontContainsCharacter(UChar32 character) { - SkPaint paint; - setupPaint(&paint); - paint.setTextEncoding(SkPaint::kUTF32_TextEncoding); - - uint16_t glyph; - paint.textToGlyphs(&character, sizeof(character), &glyph); - return glyph; -} - -#if ENABLE(OPENTYPE_VERTICAL) -PassRefPtr FontPlatformData::verticalData() const { - return FontCache::fontCache()->getVerticalData(typeface()->uniqueID(), *this); -} - -PassRefPtr FontPlatformData::openTypeTable(uint32_t table) const { - RefPtr buffer; - - SkFontTableTag tag = SkEndianSwap32(table); - const size_t tableSize = m_typeface->getTableSize(tag); - if (tableSize) { - Vector tableBuffer(tableSize); - m_typeface->getTableData(tag, 0, tableSize, &tableBuffer[0]); - buffer = SharedBuffer::adoptVector(tableBuffer); - } - return buffer.release(); -} -#endif - -} // namespace blink diff --git a/sky/engine/platform/fonts/skia/SimpleFontDataSkia.cpp b/sky/engine/platform/fonts/skia/SimpleFontDataSkia.cpp deleted file mode 100644 index 54569a10ed28e..0000000000000 --- a/sky/engine/platform/fonts/skia/SimpleFontDataSkia.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/SimpleFontData.h" - -#include -#include "flutter/sky/engine/platform/fonts/FontDescription.h" -#include "flutter/sky/engine/platform/fonts/GlyphPage.h" -#include "flutter/sky/engine/platform/fonts/VDMXParser.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" -#include "third_party/skia/include/core/SkPaint.h" -#include "third_party/skia/include/core/SkPath.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/core/SkTypes.h" - -namespace blink { - -#if OS(LINUX) || OS(ANDROID) - -// This is the largest VDMX table which we'll try to load and parse. -static const size_t maxVDMXTableSize = 1024 * 1024; // 1 MB - -#endif // OS(LINUX) || OS(ANDROID) - -void SimpleFontData::platformInit() { - if (!m_platformData.size()) { - m_fontMetrics.reset(); - m_avgCharWidth = 0; - m_maxCharWidth = 0; - return; - } - - SkPaint paint; - SkPaint::FontMetrics metrics; - - m_platformData.setupPaint(&paint); - paint.getFontMetrics(&metrics); - SkTypeface* face = paint.getTypeface(); - ASSERT(face); - - int vdmxAscent = 0, vdmxDescent = 0; - bool isVDMXValid = false; - -#if OS(LINUX) || OS(ANDROID) - // Manually digging up VDMX metrics is only applicable when bytecode hinting - // using FreeType. With GDI, the metrics will already have taken this into - // account (as needed). With DirectWrite or CoreText, no bytecode hinting is - // ever done. This code should be pushed into FreeType (hinted font metrics). - static const uint32_t vdmxTag = SkSetFourByteTag('V', 'D', 'M', 'X'); - int pixelSize = m_platformData.size() + 0.5; - if (!paint.isAutohinted() && - (paint.getHinting() == SkPaint::kFull_Hinting || - paint.getHinting() == SkPaint::kNormal_Hinting)) { - size_t vdmxSize = face->getTableSize(vdmxTag); - if (vdmxSize && vdmxSize < maxVDMXTableSize) { - uint8_t* vdmxTable = (uint8_t*)fastMalloc(vdmxSize); - if (vdmxTable && - face->getTableData(vdmxTag, 0, vdmxSize, vdmxTable) == vdmxSize && - parseVDMX(&vdmxAscent, &vdmxDescent, vdmxTable, vdmxSize, pixelSize)) - isVDMXValid = true; - fastFree(vdmxTable); - } - } -#endif - - float ascent; - float descent; - - // Beware those who step here: This code is designed to match Win32 font - // metrics *exactly* (except the adjustment of ascent/descent on - // Linux/Android). - if (isVDMXValid) { - ascent = vdmxAscent; - descent = -vdmxDescent; - } else { - ascent = SkScalarRoundToInt(-metrics.fAscent); - descent = SkScalarRoundToInt(metrics.fDescent); -#if OS(LINUX) || OS(ANDROID) - // When subpixel positioning is enabled, if the descent is rounded down, the - // descent part of the glyph may be truncated when displayed in a 'overflow: - // hidden' container. To avoid that, borrow 1 unit from the ascent when - // possible. - // FIXME: This can be removed if sub-pixel ascent/descent is supported. - if (platformData().fontRenderStyle().useSubpixelPositioning && - descent < SkScalarToFloat(metrics.fDescent) && ascent >= 1) { - ++descent; - --ascent; - } -#endif - } - - m_fontMetrics.setAscent(ascent); - m_fontMetrics.setDescent(descent); - - float xHeight; - if (metrics.fXHeight) { - xHeight = metrics.fXHeight; - m_fontMetrics.setXHeight(xHeight); - } else { - xHeight = ascent * 0.56; // Best guess from Windows font metrics. - m_fontMetrics.setXHeight(xHeight); - m_fontMetrics.setHasXHeight(false); - } - - float lineGap = SkScalarToFloat(metrics.fLeading); - m_fontMetrics.setLineGap(lineGap); - m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + - lroundf(lineGap)); - - SkScalar underlineThickness, underlinePosition; - if (metrics.hasUnderlineThickness(&underlineThickness) && - metrics.hasUnderlinePosition(&underlinePosition)) { - m_fontMetrics.setUnderlineThickness(SkScalarToFloat(underlineThickness)); - m_fontMetrics.setUnderlinePosition(SkScalarToFloat(-underlinePosition)); - } - - if (platformData().orientation() == Vertical && - !isTextOrientationFallback()) { - static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a'); - static const uint32_t vorgTag = SkSetFourByteTag('V', 'O', 'R', 'G'); - size_t vheaSize = face->getTableSize(vheaTag); - size_t vorgSize = face->getTableSize(vorgTag); - if ((vheaSize > 0) || (vorgSize > 0)) - m_hasVerticalGlyphs = true; - } - - // In WebKit/WebCore/platform/graphics/SimpleFontData.cpp, m_spaceWidth is - // calculated for us, but we need to calculate m_maxCharWidth and - // m_avgCharWidth in order for text entry widgets to be sized correctly. - // FIXME: This seems incorrect and should probably use fMaxCharWidth as - // the code path above. - SkScalar xRange = metrics.fXMax - metrics.fXMin; - m_maxCharWidth = - SkScalarRoundToInt(xRange * SkScalarRoundToInt(m_platformData.size())); - - if (metrics.fAvgCharWidth) - m_avgCharWidth = SkScalarRoundToInt(metrics.fAvgCharWidth); - else { - m_avgCharWidth = xHeight; - - GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)->page(); - - if (glyphPageZero) { - static const UChar32 xChar = 'x'; - const Glyph xGlyph = glyphPageZero->glyphForCharacter(xChar); - - if (xGlyph) { - // In widthForGlyph(), xGlyph will be compared with - // m_zeroWidthSpaceGlyph, which isn't initialized yet here. - // Initialize it with zero to make sure widthForGlyph() returns - // the right width. - m_zeroWidthSpaceGlyph = 0; - m_avgCharWidth = widthForGlyph(xGlyph); - } - } - } - - if (int unitsPerEm = face->getUnitsPerEm()) - m_fontMetrics.setUnitsPerEm(unitsPerEm); -} - -void SimpleFontData::platformCharWidthInit() { - // charwidths are set in platformInit. -} - -void SimpleFontData::platformDestroy() {} - -PassRefPtr SimpleFontData::platformCreateScaledFontData( - const FontDescription& fontDescription, - float scaleFactor) const { - const float scaledSize = - lroundf(fontDescription.computedSize() * scaleFactor); - return SimpleFontData::create( - FontPlatformData(m_platformData, scaledSize), - isCustomFont() ? CustomFontData::create() : nullptr); -} - -void SimpleFontData::determinePitch() { - m_treatAsFixedPitch = platformData().isFixedPitch(); -} - -static inline void getSkiaBoundsForGlyph(SkPaint& paint, - Glyph glyph, - SkRect& bounds) { - paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); - - SkPath path; - paint.getTextPath(&glyph, sizeof(glyph), 0, 0, &path); - bounds = path.getBounds(); - - if (!paint.isSubpixelText()) { - SkIRect ir; - bounds.round(&ir); - bounds.set(ir); - } -} - -FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const { - if (!m_platformData.size()) - return FloatRect(); - - SkASSERT(sizeof(glyph) == 2); // compile-time assert - - SkPaint paint; - m_platformData.setupPaint(&paint); - - SkRect bounds; - getSkiaBoundsForGlyph(paint, glyph, bounds); - return FloatRect(bounds); -} - -float SimpleFontData::platformWidthForGlyph(Glyph glyph) const { - if (!m_platformData.size()) - return 0; - - SkASSERT(sizeof(glyph) == 2); // compile-time assert - - SkPaint paint; - - m_platformData.setupPaint(&paint); - - paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding); - SkScalar width = paint.measureText(&glyph, 2); - if (!paint.isSubpixelText()) - width = SkScalarRoundToInt(width); - return SkScalarToFloat(width); -} - -bool SimpleFontData::canRenderCombiningCharacterSequence( - const UChar* characters, - size_t length) const { - if (!m_combiningCharacterSequenceSupport) - m_combiningCharacterSequenceSupport = adoptPtr(new HashMap); - - WTF::HashMap::AddResult addResult = - m_combiningCharacterSequenceSupport->add(String(characters, length), - false); - if (!addResult.isNewEntry) - return addResult.storedValue->value; - - UErrorCode error = U_ZERO_ERROR; - Vector normalizedCharacters(length); - int32_t normalizedLength = - unorm_normalize(characters, length, UNORM_NFC, UNORM_UNICODE_3_2, - &normalizedCharacters[0], length, &error); - // Can't render if we have an error or no composition occurred. - if (U_FAILURE(error) || (static_cast(normalizedLength) == length)) - return false; - - SkPaint paint; - m_platformData.setupPaint(&paint); - paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); - if (paint.textToGlyphs(&normalizedCharacters[0], normalizedLength * 2, 0)) { - addResult.storedValue->value = true; - return true; - } - return false; -} - -bool SimpleFontData::fillGlyphPage(GlyphPage* pageToFill, - unsigned offset, - unsigned length, - UChar* buffer, - unsigned bufferLength) const { - if (U16_IS_LEAD(buffer[bufferLength - 1])) { - SkDebugf("%s last char is high-surrogate", __FUNCTION__); - return false; - } - - SkAutoSTMalloc glyphStorage(length); - - uint16_t* glyphs = glyphStorage.get(); - SkTypeface* typeface = platformData().typeface(); - typeface->charsToGlyphs(buffer, SkTypeface::kUTF16_Encoding, glyphs, length); - - bool haveGlyphs = false; - for (unsigned i = 0; i < length; i++) { - if (glyphs[i]) { - pageToFill->setGlyphDataForIndex(offset + i, glyphs[i], this); - haveGlyphs = true; - } - } - - return haveGlyphs; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/win/FontCacheSkiaWin.cpp b/sky/engine/platform/fonts/win/FontCacheSkiaWin.cpp deleted file mode 100644 index b92821a06d50d..0000000000000 --- a/sky/engine/platform/fonts/win/FontCacheSkiaWin.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Computer, Inc. - * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#include "SkFontMgr.h" -#include "SkTypeface_win.h" -#include "platform/fonts/FontDescription.h" -#include "platform/fonts/FontFaceCreationParams.h" -#include "platform/fonts/FontPlatformData.h" -#include "platform/fonts/SimpleFontData.h" -#include "platform/fonts/win/FontFallbackWin.h" - -namespace blink { - -HashMap>* FontCache::s_sideloadedFonts = 0; - -// Cached system font metrics. -AtomicString* FontCache::s_menuFontFamilyName = 0; -int32_t FontCache::s_menuFontHeight = 0; -AtomicString* FontCache::s_smallCaptionFontFamilyName = 0; -int32_t FontCache::s_smallCaptionFontHeight = 0; -AtomicString* FontCache::s_statusFontFamilyName = 0; -int32_t FontCache::s_statusFontHeight = 0; - -namespace { - -int32_t ensureMinimumFontHeightIfNeeded(int32_t fontHeight) { - // Adjustment for codepage 936 to make the fonts more legible in Simplified - // Chinese. Please refer to LayoutThemeFontProviderWin.cpp for more - // information. - return (fontHeight < 12.0f) && (GetACP() == 936) ? 12.0f : fontHeight; -} - -} // namespace - -// static -void FontCache::setMenuFontMetrics(const wchar_t* familyName, - int32_t fontHeight) { - s_menuFontFamilyName = new AtomicString(familyName); - s_menuFontHeight = ensureMinimumFontHeightIfNeeded(fontHeight); -} - -// static -void FontCache::setSmallCaptionFontMetrics(const wchar_t* familyName, - int32_t fontHeight) { - s_smallCaptionFontFamilyName = new AtomicString(familyName); - s_smallCaptionFontHeight = ensureMinimumFontHeightIfNeeded(fontHeight); -} - -// static -void FontCache::setStatusFontMetrics(const wchar_t* familyName, - int32_t fontHeight) { - s_statusFontFamilyName = new AtomicString(familyName); - s_statusFontHeight = ensureMinimumFontHeightIfNeeded(fontHeight); -} - -FontCache::FontCache() : m_purgePreventCount(0) { - sk_sp fontManager; - - if (s_useDirectWrite) { - fontManager = SkFontMgr_New_DirectWrite(s_directWriteFactory); - s_useSubpixelPositioning = true; - } else { - fontManager = SkFontMgr_New_GDI(); - // Subpixel text positioning is not supported by the GDI backend. - s_useSubpixelPositioning = false; - } - - ASSERT(fontManager); - m_fontManager = fontManager; -} - -// Given the desired base font, this will create a SimpleFontData for a specific -// font that can be used to render the given range of characters. -PassRefPtr FontCache::fallbackFontForCharacter( - const FontDescription& fontDescription, - UChar32 character, - const SimpleFontData* originalFontData) { - // First try the specified font with standard style & weight. - if (fontDescription.style() == FontStyleItalic || - fontDescription.weight() >= FontWeightBold) { - RefPtr fontData = - fallbackOnStandardFontStyle(fontDescription, character); - if (fontData) - return fontData; - } - - // FIXME: Consider passing fontDescription.dominantScript() - // to GetFallbackFamily here. - UScriptCode script; - const wchar_t* family = getFallbackFamily( - character, fontDescription.genericFamily(), &script, m_fontManager.get()); - FontPlatformData* data = 0; - if (family) { - FontFaceCreationParams createByFamily(AtomicString(family, wcslen(family))); - data = getFontPlatformData(fontDescription, createByFamily); - } - - // Last resort font list : PanUnicode. CJK fonts have a pretty - // large repertoire. Eventually, we need to scan all the fonts - // on the system to have a Firefox-like coverage. - // Make sure that all of them are lowercased. - const static wchar_t* const cjkFonts[] = { - L"arial unicode ms", L"ms pgothic", L"simsun", L"gulim", L"pmingliu", - L"wenquanyi zen hei", // Partial CJK Ext. A coverage but more widely - // known to Chinese users. - L"ar pl shanheisun uni", L"ar pl zenkai uni", - L"han nom a", // Complete CJK Ext. A coverage. - L"code2000" // Complete CJK Ext. A coverage. - // CJK Ext. B fonts are not listed here because it's of no use - // with our current non-BMP character handling because we use - // Uniscribe for it and that code path does not go through here. - }; - - const static wchar_t* const commonFonts[] = { - L"tahoma", L"arial unicode ms", L"lucida sans unicode", - L"microsoft sans serif", L"palatino linotype", - // Six fonts below (and code2000 at the end) are not from MS, but - // once installed, cover a very wide range of characters. - L"dejavu serif", L"dejavu sasns", L"freeserif", L"freesans", L"gentium", - L"gentiumalt", L"ms pgothic", L"simsun", L"gulim", L"pmingliu", - L"code2000"}; - - const wchar_t* const* panUniFonts = 0; - int numFonts = 0; - if (script == USCRIPT_HAN) { - panUniFonts = cjkFonts; - numFonts = WTF_ARRAY_LENGTH(cjkFonts); - } else { - panUniFonts = commonFonts; - numFonts = WTF_ARRAY_LENGTH(commonFonts); - } - // Font returned from getFallbackFamily may not cover |character| - // because it's based on script to font mapping. This problem is - // critical enough for non-Latin scripts (especially Han) to - // warrant an additional (real coverage) check with fontCotainsCharacter. - int i; - for (i = 0; - (!data || !data->fontContainsCharacter(character)) && i < numFonts; - ++i) { - family = panUniFonts[i]; - FontFaceCreationParams createByFamily(AtomicString(family, wcslen(family))); - data = getFontPlatformData(fontDescription, createByFamily); - } - - // For font fallback we want to match the subpixel behavior of the original - // font. Mixing subpixel and non-subpixel in the same text run looks really - // odd and causes problems with preferred width calculations. - if (data && originalFontData) { - const FontPlatformData& platformData = originalFontData->platformData(); - data->setMinSizeForAntiAlias(platformData.minSizeForAntiAlias()); - data->setMinSizeForSubpixel(platformData.minSizeForSubpixel()); - } - - // When i-th font (0-base) in |panUniFonts| contains a character and - // we get out of the loop, |i| will be |i + 1|. That is, if only the - // last font in the array covers the character, |i| will be numFonts. - // So, we have to use '<=" rather than '<' to see if we found a font - // covering the character. - if (i <= numFonts) - return fontDataFromFontPlatformData(data, DoNotRetain); - - return nullptr; -} - -static inline bool equalIgnoringCase(const AtomicString& a, const SkString& b) { - return equalIgnoringCase(a, AtomicString::fromUTF8(b.c_str())); -} - -static bool typefacesMatchesFamily(const SkTypeface* tf, - const AtomicString& family) { - SkTypeface::LocalizedStrings* actualFamilies = tf->createFamilyNameIterator(); - bool matchesRequestedFamily = false; - SkTypeface::LocalizedString actualFamily; - - while (actualFamilies->next(&actualFamily)) { - if (equalIgnoringCase(family, actualFamily.fString)) { - matchesRequestedFamily = true; - break; - } - } - actualFamilies->unref(); - - // getFamilyName may return a name not returned by the - // createFamilyNameIterator. Specifically in cases where Windows substitutes - // the font based on the HKLM\SOFTWARE\Microsoft\Windows - // NT\CurrentVersion\FontSubstitutes registry entries. - if (!matchesRequestedFamily) { - SkString familyName; - tf->getFamilyName(&familyName); - if (equalIgnoringCase(family, familyName)) - matchesRequestedFamily = true; - } - - return matchesRequestedFamily; -} - -static bool typefacesHasWeightSuffix(const AtomicString& family, - AtomicString& adjustedName, - FontWeight& variantWeight) { - struct FamilyWeightSuffix { - const wchar_t* suffix; - size_t length; - FontWeight weight; - }; - // Mapping from suffix to weight from the DirectWrite documentation. - // http://msdn.microsoft.com/en-us/library/windows/desktop/dd368082.aspx - const static FamilyWeightSuffix variantForSuffix[] = { - {L" thin", 5, FontWeight100}, {L" extralight", 11, FontWeight200}, - {L" ultralight", 11, FontWeight200}, {L" light", 6, FontWeight300}, - {L" medium", 7, FontWeight500}, {L" demibold", 9, FontWeight600}, - {L" semibold", 9, FontWeight600}, {L" extrabold", 10, FontWeight800}, - {L" ultrabold", 10, FontWeight800}, {L" black", 6, FontWeight900}, - {L" heavy", 6, FontWeight900}}; - size_t numVariants = WTF_ARRAY_LENGTH(variantForSuffix); - for (size_t i = 0; i < numVariants; i++) { - const FamilyWeightSuffix& entry = variantForSuffix[i]; - if (family.endsWith(entry.suffix, TextCaseInsensitive)) { - String familyName = family.string(); - familyName.truncate(family.length() - entry.length); - adjustedName = AtomicString(familyName); - variantWeight = entry.weight; - return true; - } - } - - return false; -} - -static bool typefacesHasStretchSuffix(const AtomicString& family, - AtomicString& adjustedName, - FontStretch& variantStretch) { - struct FamilyStretchSuffix { - const wchar_t* suffix; - size_t length; - FontStretch stretch; - }; - // Mapping from suffix to stretch value from the DirectWrite documentation. - // http://msdn.microsoft.com/en-us/library/windows/desktop/dd368078.aspx - // Also includes Narrow as a synonym for Condensed to to support Arial - // Narrow and other fonts following the same naming scheme. - const static FamilyStretchSuffix variantForSuffix[] = { - {L" ultracondensed", 15, FontStretchUltraCondensed}, - {L" extracondensed", 15, FontStretchExtraCondensed}, - {L" condensed", 10, FontStretchCondensed}, - {L" narrow", 7, FontStretchCondensed}, - {L" semicondensed", 14, FontStretchSemiCondensed}, - {L" semiexpanded", 13, FontStretchSemiExpanded}, - {L" expanded", 9, FontStretchExpanded}, - {L" extraexpanded", 14, FontStretchExtraExpanded}, - {L" ultraexpanded", 14, FontStretchUltraExpanded}}; - size_t numVariants = WTF_ARRAY_LENGTH(variantForSuffix); - for (size_t i = 0; i < numVariants; i++) { - const FamilyStretchSuffix& entry = variantForSuffix[i]; - if (family.endsWith(entry.suffix, TextCaseInsensitive)) { - String familyName = family.string(); - familyName.truncate(family.length() - entry.length); - adjustedName = AtomicString(familyName); - variantStretch = entry.stretch; - return true; - } - } - - return false; -} - -FontPlatformData* FontCache::createFontPlatformData( - const FontDescription& fontDescription, - const FontFaceCreationParams& creationParams, - float fontSize) { - ASSERT(creationParams.creationType() == CreateFontByFamily); - - CString name; - sk_sp tf = createTypeface(fontDescription, creationParams, name); - // Windows will always give us a valid pointer here, even if the face name - // is non-existent. We have to double-check and see if the family name was - // really used. - if (!tf || !typefacesMatchesFamily(tf.get(), creationParams.family())) { - AtomicString adjustedName; - FontWeight variantWeight; - FontStretch variantStretch; - - if (typefacesHasWeightSuffix(creationParams.family(), adjustedName, - variantWeight)) { - FontFaceCreationParams adjustedParams(adjustedName); - FontDescription adjustedFontDescription = fontDescription; - adjustedFontDescription.setWeight(variantWeight); - tf = createTypeface(adjustedFontDescription, adjustedParams, name); - if (!tf || !typefacesMatchesFamily(tf.get(), adjustedName)) - return 0; - - } else if (typefacesHasStretchSuffix(creationParams.family(), adjustedName, - variantStretch)) { - FontFaceCreationParams adjustedParams(adjustedName); - FontDescription adjustedFontDescription = fontDescription; - adjustedFontDescription.setStretch(variantStretch); - tf = createTypeface(adjustedFontDescription, adjustedParams, name); - if (!tf || !typefacesMatchesFamily(tf.get(), adjustedName)) - return 0; - - } else { - return 0; - } - } - - FontPlatformData* result = new FontPlatformData( - tf, name.data(), fontSize, - (fontDescription.weight() >= FontWeight600 && !tf->isBold()) || - fontDescription.isSyntheticBold(), - (fontDescription.style() == FontStyleItalic && !tf->isItalic()) || - fontDescription.isSyntheticItalic(), - fontDescription.orientation(), s_useSubpixelPositioning); - - struct FamilyMinSize { - const wchar_t* family; - unsigned minSize; - }; - const static FamilyMinSize minAntiAliasSizeForFont[] = { - {L"simsun", 11}, {L"dotum", 12}, {L"gulim", 12}, {L"pmingliu", 11}}; - size_t numFonts = WTF_ARRAY_LENGTH(minAntiAliasSizeForFont); - for (size_t i = 0; i < numFonts; i++) { - FamilyMinSize entry = minAntiAliasSizeForFont[i]; - if (typefacesMatchesFamily(tf.get(), entry.family)) { - result->setMinSizeForAntiAlias(entry.minSize); - break; - } - } - - // List of fonts that look bad with subpixel text rendering at smaller font - // sizes. This includes all fonts in the Microsoft Core fonts for the Web - // collection. - const static wchar_t* noSubpixelForSmallSizeFont[] = { - L"andale mono", L"arial", L"comic sans", L"courier new", - L"dotum", L"georgia", L"impact", L"lucida console", - L"tahoma", L"times new roman", L"trebuchet ms", L"verdana", - L"webdings"}; - const static float minSizeForSubpixelForFont = 16.0f; - numFonts = WTF_ARRAY_LENGTH(noSubpixelForSmallSizeFont); - for (size_t i = 0; i < numFonts; i++) { - const wchar_t* family = noSubpixelForSmallSizeFont[i]; - if (typefacesMatchesFamily(tf.get(), family)) { - result->setMinSizeForSubpixel(minSizeForSubpixelForFont); - break; - } - } - - return result; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/win/FontFallbackWin.cpp b/sky/engine/platform/fonts/win/FontFallbackWin.cpp deleted file mode 100644 index 0e5eda8c1b620..0000000000000 --- a/sky/engine/platform/fonts/win/FontFallbackWin.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2012 Google Inc. All - * rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/fonts/win/FontFallbackWin.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#include -#include -#include -#include "SkFontMgr.h" -#include "SkTypeface.h" -#include "flutter/sky/engine/platform/fonts/FontCache.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -namespace { - -static inline bool isFontPresent(const UChar* fontName, - SkFontMgr* fontManager) { - String family = fontName; - sk_sp tf( - fontManager->matchFamilyStyle(family.utf8().data(), SkFontStyle())); - if (!tf) - return false; - - SkTypeface::LocalizedStrings* actualFamilies = tf->createFamilyNameIterator(); - bool matchesRequestedFamily = false; - SkTypeface::LocalizedString actualFamily; - while (actualFamilies->next(&actualFamily)) { - if (equalIgnoringCase( - family, AtomicString::fromUTF8(actualFamily.fString.c_str()))) { - matchesRequestedFamily = true; - break; - } - } - actualFamilies->unref(); - - return matchesRequestedFamily; -} - -// A simple mapping from UScriptCode to family name. This is a sparse array, -// which works well since the range of UScriptCode values is small. -typedef const UChar* ScriptToFontMap[USCRIPT_CODE_LIMIT]; - -void initializeScriptMonospaceFontMap(ScriptToFontMap& scriptFontMap, - SkFontMgr* fontManager) { - struct FontMap { - UScriptCode script; - const UChar* family; - }; - - static const FontMap fontMap[] = { - {USCRIPT_HEBREW, L"courier new"}, - {USCRIPT_ARABIC, L"courier new"}, - }; - - for (size_t i = 0; i < WTF_ARRAY_LENGTH(fontMap); ++i) - scriptFontMap[fontMap[i].script] = fontMap[i].family; -} - -void initializeScriptFontMap(ScriptToFontMap& scriptFontMap, - SkFontMgr* fontManager) { - struct FontMap { - UScriptCode script; - const UChar* family; - }; - - static const FontMap fontMap[] = { - {USCRIPT_LATIN, L"times new roman"}, - {USCRIPT_GREEK, L"times new roman"}, - {USCRIPT_CYRILLIC, L"times new roman"}, - // FIXME: Consider trying new Vista fonts before XP fonts for CJK. - // Some Vista users do want to use Vista cleartype CJK fonts. If we - // did, the results of tests with CJK characters would have to be - // regenerated for Vista. - {USCRIPT_SIMPLIFIED_HAN, L"simsun"}, - {USCRIPT_TRADITIONAL_HAN, L"pmingliu"}, - {USCRIPT_HIRAGANA, L"ms pgothic"}, - {USCRIPT_KATAKANA, L"ms pgothic"}, - {USCRIPT_KATAKANA_OR_HIRAGANA, L"ms pgothic"}, - {USCRIPT_HANGUL, L"gulim"}, - {USCRIPT_THAI, L"tahoma"}, - {USCRIPT_HEBREW, L"david"}, - {USCRIPT_ARABIC, L"tahoma"}, - {USCRIPT_DEVANAGARI, L"mangal"}, - {USCRIPT_BENGALI, L"vrinda"}, - {USCRIPT_GURMUKHI, L"raavi"}, - {USCRIPT_GUJARATI, L"shruti"}, - {USCRIPT_TAMIL, L"latha"}, - {USCRIPT_TELUGU, L"gautami"}, - {USCRIPT_KANNADA, L"tunga"}, - {USCRIPT_GEORGIAN, L"sylfaen"}, - {USCRIPT_ARMENIAN, L"sylfaen"}, - {USCRIPT_THAANA, L"mv boli"}, - {USCRIPT_CANADIAN_ABORIGINAL, L"euphemia"}, - {USCRIPT_CHEROKEE, L"plantagenet cherokee"}, - {USCRIPT_MONGOLIAN, L"mongolian balti"}, - // For USCRIPT_COMMON, we map blocks to scripts when - // that makes sense. - }; - - struct ScriptToFontFamilies { - UScriptCode script; - const UChar** families; - }; - - // Kartika on Vista or earlier lacks the support for Chillu - // letters added to Unicode 5.1. - // Try AnjaliOldLipi (a very widely used Malaylalam font with the full - // Unicode 5.x support) before falling back to Kartika. - static const UChar* malayalamFonts[] = {L"AnjaliOldLipi", L"Lohit Malayalam", - L"Kartika", L"Rachana", 0}; - // Try Khmer OS before Vista fonts because 'Khmer OS' goes along better - // with Latin and looks better/larger for the same size. - static const UChar* khmerFonts[] = {L"Khmer OS", L"MoolBoran", L"DaunPenh", - L"Code2000", 0}; - // For the following 6 scripts, two or fonts are listed. The fonts in - // the 1st slot are not available on Windows XP. To support these - // scripts on XP, listed in the rest of slots are widely used - // fonts. - static const UChar* ethiopicFonts[] = {L"Nyala", - L"Abyssinica SIL", - L"Ethiopia Jiret", - L"Visual Geez Unicode", - L"GF Zemen Unicode", - 0}; - static const UChar* oriyaFonts[] = {L"Kalinga", L"ori1Uni", L"Lohit Oriya", - 0}; - static const UChar* laoFonts[] = {L"DokChampa", L"Saysettha OT", - L"Phetsarath OT", L"Code2000", 0}; - static const UChar* tibetanFonts[] = {L"Microsoft Himalaya", L"Jomolhari", - L"Tibetan Machine Uni", 0}; - static const UChar* sinhalaFonts[] = {L"Iskoola Pota", L"AksharUnicode", 0}; - static const UChar* yiFonts[] = {L"Microsoft Yi Balti", L"Nuosu SIL", - L"Code2000", 0}; - // http://www.bethmardutho.org/support/meltho/download/index.php - static const UChar* syriacFonts[] = {L"Estrangelo Edessa", - L"Estrangelo Nisibin", L"Code2000", 0}; - // No Myanmar/Burmese font is shipped with Windows, yet. Try a few - // widely available/used ones that supports Unicode 5.1 or later. - static const UChar* myanmarFonts[] = {L"Padauk", L"Parabaik", L"Myanmar3", - L"Code2000", 0}; - - static const ScriptToFontFamilies scriptToFontFamilies[] = { - {USCRIPT_MALAYALAM, malayalamFonts}, - {USCRIPT_KHMER, khmerFonts}, - {USCRIPT_ETHIOPIC, ethiopicFonts}, - {USCRIPT_ORIYA, oriyaFonts}, - {USCRIPT_LAO, laoFonts}, - {USCRIPT_TIBETAN, tibetanFonts}, - {USCRIPT_SINHALA, sinhalaFonts}, - {USCRIPT_YI, yiFonts}, - {USCRIPT_SYRIAC, syriacFonts}, - {USCRIPT_MYANMAR, myanmarFonts}, - }; - - for (size_t i = 0; i < WTF_ARRAY_LENGTH(fontMap); ++i) - scriptFontMap[fontMap[i].script] = fontMap[i].family; - - // FIXME: Instead of scanning the hard-coded list, we have to - // use EnumFont* to 'inspect' fonts to pick up fonts covering scripts - // when it's possible (e.g. using OS/2 table). If we do that, this - // had better be pulled out of here. - for (size_t i = 0; i < WTF_ARRAY_LENGTH(scriptToFontFamilies); ++i) { - UScriptCode script = scriptToFontFamilies[i].script; - scriptFontMap[script] = 0; - const UChar** familyPtr = scriptToFontFamilies[i].families; - while (*familyPtr) { - if (isFontPresent(*familyPtr, fontManager)) { - scriptFontMap[script] = *familyPtr; - break; - } - ++familyPtr; - } - } - - // Initialize the locale-dependent mapping. - // Since Chrome synchronizes the ICU default locale with its UI locale, - // this ICU locale tells the current UI locale of Chrome. - icu::Locale locale = icu::Locale::getDefault(); - const UChar* localeFamily = 0; - if (locale == icu::Locale::getJapanese()) { - localeFamily = scriptFontMap[USCRIPT_HIRAGANA]; - } else if (locale == icu::Locale::getKorean()) { - localeFamily = scriptFontMap[USCRIPT_HANGUL]; - } else if (locale == icu::Locale::getTraditionalChinese()) { - localeFamily = scriptFontMap[USCRIPT_TRADITIONAL_HAN]; - } else { - // For other locales, use the simplified Chinese font for Han. - localeFamily = scriptFontMap[USCRIPT_SIMPLIFIED_HAN]; - } - if (localeFamily) - scriptFontMap[USCRIPT_HAN] = localeFamily; -} - -// There are a lot of characters in USCRIPT_COMMON that can be covered -// by fonts for scripts closely related to them. See -// http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:Script=Common:] -// FIXME: make this more efficient with a wider coverage -UScriptCode getScriptBasedOnUnicodeBlock(int ucs4) { - UBlockCode block = ublock_getCode(ucs4); - switch (block) { - case UBLOCK_CJK_SYMBOLS_AND_PUNCTUATION: - return USCRIPT_HAN; - case UBLOCK_HIRAGANA: - case UBLOCK_KATAKANA: - return USCRIPT_HIRAGANA; - case UBLOCK_ARABIC: - return USCRIPT_ARABIC; - case UBLOCK_THAI: - return USCRIPT_THAI; - case UBLOCK_GREEK: - return USCRIPT_GREEK; - case UBLOCK_DEVANAGARI: - // For Danda and Double Danda (U+0964, U+0965), use a Devanagari - // font for now although they're used by other scripts as well. - // Without a context, we can't do any better. - return USCRIPT_DEVANAGARI; - case UBLOCK_ARMENIAN: - return USCRIPT_ARMENIAN; - case UBLOCK_GEORGIAN: - return USCRIPT_GEORGIAN; - case UBLOCK_KANNADA: - return USCRIPT_KANNADA; - default: - return USCRIPT_COMMON; - } -} - -UScriptCode getScript(int ucs4) { - UErrorCode err = U_ZERO_ERROR; - UScriptCode script = uscript_getScript(ucs4, &err); - // If script is invalid, common or inherited or there's an error, - // infer a script based on the unicode block of a character. - if (script <= USCRIPT_INHERITED || U_FAILURE(err)) - script = getScriptBasedOnUnicodeBlock(ucs4); - return script; -} - -} // namespace - -// FIXME: this is font fallback code version 0.1 -// - Cover all the scripts -// - Get the default font for each script/generic family from the -// preference instead of hardcoding in the source. -// (at least, read values from the registry for IE font settings). -// - Support generic families (from FontDescription) -// - If the default font for a script is not available, -// try some more fonts known to support it. Finally, we can -// use EnumFontFamilies or similar APIs to come up with a list of -// fonts supporting the script and cache the result. -// - Consider using UnicodeSet (or UnicodeMap) converted from -// GLYPHSET (BMP) or directly read from truetype cmap tables to -// keep track of which character is supported by which font -// - Update script_font_cache in response to WM_FONTCHANGE - -const UChar* getFontFamilyForScript(UScriptCode script, - FontDescription::GenericFamilyType generic, - SkFontMgr* fontManager) { - static ScriptToFontMap scriptFontMap; - static ScriptToFontMap scriptMonospaceFontMap; - static bool initialized = false; - if (!initialized) { - initializeScriptFontMap(scriptFontMap, fontManager); - initializeScriptMonospaceFontMap(scriptMonospaceFontMap, fontManager); - initialized = true; - } - if (script == USCRIPT_INVALID_CODE) - return 0; - ASSERT(script < USCRIPT_CODE_LIMIT); - if (generic == FontDescription::MonospaceFamily && - scriptMonospaceFontMap[script]) - return scriptMonospaceFontMap[script]; - return scriptFontMap[script]; -} - -// FIXME: -// - Handle 'Inherited', 'Common' and 'Unknown' -// (see http://www.unicode.org/reports/tr24/#Usage_Model ) -// For 'Inherited' and 'Common', perhaps we need to -// accept another parameter indicating the previous family -// and just return it. -// - All the characters (or characters up to the point a single -// font can cover) need to be taken into account -const UChar* getFallbackFamily(UChar32 character, - FontDescription::GenericFamilyType generic, - UScriptCode* scriptChecked, - SkFontMgr* fontManager) { - ASSERT(character); - UScriptCode script = getScript(character); - - // For the full-width ASCII characters (U+FF00 - U+FF5E), use the font for - // Han (determined in a locale-dependent way above). Full-width ASCII - // characters are rather widely used in Japanese and Chinese documents and - // they're fully covered by Chinese, Japanese and Korean fonts. - if (0xFF00 < character && character < 0xFF5F) - script = USCRIPT_HAN; - - if (script == USCRIPT_COMMON) - script = getScriptBasedOnUnicodeBlock(character); - - const UChar* family = getFontFamilyForScript(script, generic, fontManager); - // Another lame work-around to cover non-BMP characters. - // If the font family for script is not found or the character is - // not in BMP (> U+FFFF), we resort to the hard-coded list of - // fallback fonts for now. - if (!family || character > 0xFFFF) { - int plane = character >> 16; - switch (plane) { - case 1: - family = L"code2001"; - break; - case 2: - // Use a Traditional Chinese ExtB font if in Traditional Chinese locale. - // Otherwise, use a Simplified Chinese ExtB font. Windows Japanese - // fonts do support a small subset of ExtB (that are included in JIS X - // 0213), but its coverage is rather sparse. Eventually, this should be - // controlled by lang/xml:lang. - if (icu::Locale::getDefault() == icu::Locale::getTraditionalChinese()) - family = L"pmingliu-extb"; - else - family = L"simsun-extb"; - break; - default: - family = L"lucida sans unicode"; - } - } - - if (scriptChecked) - *scriptChecked = script; - return family; -} - -} // namespace blink diff --git a/sky/engine/platform/fonts/win/FontFallbackWin.h b/sky/engine/platform/fonts/win/FontFallbackWin.h deleted file mode 100644 index e55ab9b64b819..0000000000000 --- a/sky/engine/platform/fonts/win/FontFallbackWin.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FontFallbackWin_h -#define FontFallbackWin_h - -#include -#include -#include -#include -#include -#include "platform/PlatformExport.h" -#include "platform/fonts/FontDescription.h" - -class SkFontMgr; - -namespace blink { - -// Return a font family that can render |character| based on what script -// that characters belong to. -// When scriptChecked is non-zero, the script used to determine -// the family is returned. -PLATFORM_EXPORT const UChar* getFallbackFamily( - UChar32 character, - FontDescription::GenericFamilyType, - UScriptCode* scriptChecked, - SkFontMgr* fontManager); -PLATFORM_EXPORT UScriptCode -scriptCodeForUnifiedHanFromLocale(const icu::Locale&); - -} // namespace blink - -#endif // FontFallbackWin_h diff --git a/sky/engine/platform/fonts/win/FontPlatformDataWin.cpp b/sky/engine/platform/fonts/win/FontPlatformDataWin.cpp deleted file mode 100644 index 39f5d6bb05aa0..0000000000000 --- a/sky/engine/platform/fonts/win/FontPlatformDataWin.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Computer, Inc. - * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/OperatingSystem.h" -#include "platform/fonts/FontPlatformData.h" - -#include -#include "SkTypeface.h" -#include "platform/fonts/FontCache.h" -#include "platform/graphics/GraphicsContext.h" - -namespace blink { - -// Maximum font size, in pixels, at which embedded bitmaps will be used -// if available. -const float kMaxSizeForEmbeddedBitmap = 24.0f; - -void FontPlatformData::setupPaint(SkPaint* paint, - GraphicsContext* context) const { - const float ts = m_textSize >= 0 ? m_textSize : 12; - paint->setTextSize(SkFloatToScalar(m_textSize)); - paint->setTypeface(m_typeface); - paint->setFakeBoldText(m_syntheticBold); - paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0); - - uint32_t textFlags = paintTextFlags(); - uint32_t flags = paint->getFlags(); - static const uint32_t textFlagsMask = SkPaint::kAntiAlias_Flag | - SkPaint::kLCDRenderText_Flag; - flags &= ~textFlagsMask; - - if (ts <= kMaxSizeForEmbeddedBitmap) - flags |= SkPaint::kEmbeddedBitmapText_Flag; - - if (ts >= m_minSizeForAntiAlias) { - if (m_useSubpixelPositioning - // Disable subpixel text for certain older fonts at smaller sizes as - // they tend to get quite blurry at non-integer sizes and positions. - // For high-DPI this workaround isn't required. - && (ts >= m_minSizeForSubpixel || - FontCache::fontCache()->deviceScaleFactor() >= 1.5) - - // Subpixel text positioning looks pretty bad without font - // smoothing. Disable it unless some type of font smoothing is used. - // As most tests run without font smoothing we enable it for tests - // to ensure we get good test coverage matching the more common - // smoothing enabled behavior. - && (textFlags & SkPaint::kAntiAlias_Flag)) - flags |= SkPaint::kSubpixelText_Flag; - - SkASSERT(!(textFlags & ~textFlagsMask)); - flags |= textFlags; - } - - paint->setFlags(flags); -} - -// Lookup the current system settings for font smoothing. -// We cache these values for performance, but if the browser has a way to be -// notified when these change, we could re-query them at that time. -static uint32_t getSystemTextFlags() { - static bool gInited; - static uint32_t gFlags; - if (!gInited) { - BOOL enabled; - gFlags = 0; - if (SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &enabled, 0)) { - if (enabled) { - gFlags |= SkPaint::kAntiAlias_Flag; - - UINT smoothType; - if (SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &smoothType, 0)) { - if (FE_FONTSMOOTHINGCLEARTYPE == smoothType) - gFlags |= SkPaint::kLCDRenderText_Flag; - } - } - } else { - // SystemParametersInfo will fail only under full sandbox lockdown on - // Win8+. So, we default to settings we know are supported and look good. - // FIXME(eae): We should be querying the DirectWrite settings directly - // so we can respect the settings for users who turn off smoothing. - gFlags = SkPaint::kAntiAlias_Flag | SkPaint::kLCDRenderText_Flag; - } - gInited = true; - } - return gFlags; -} - -static bool isWebFont(const String& familyName) { - // Web-fonts have artifical names constructed to always be: - // 1. 24 characters, followed by a '\0' - // 2. the last two characters are '==' - return familyName.length() == 24 && '=' == familyName[22] && - '=' == familyName[23]; -} - -static int computePaintTextFlags(String fontFamilyName) { - int textFlags = getSystemTextFlags(); - - // Many web-fonts are so poorly hinted that they are terrible to read when - // drawn in BW. In these cases, we have decided to FORCE these fonts to be - // drawn with at least grayscale AA, even when the System (getSystemTextFlags) - // tells us to draw only in BW. - if (isWebFont(fontFamilyName)) - textFlags |= SkPaint::kAntiAlias_Flag; - - return textFlags; -} - -void FontPlatformData::querySystemForRenderStyle(bool) { - m_paintTextFlags = computePaintTextFlags(fontFamilyName()); -} - -bool FontPlatformData::defaultUseSubpixelPositioning() { - return FontCache::fontCache()->useSubpixelPositioning(); -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/FloatBox.h b/sky/engine/platform/geometry/FloatBox.h deleted file mode 100644 index 59a8a268f591e..0000000000000 --- a/sky/engine/platform/geometry/FloatBox.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 2014, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_FLOATBOX_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_FLOATBOX_H_ - -#include -#include "flutter/sky/engine/platform/geometry/FloatPoint3D.h" - -namespace blink { - -class FloatBox { - public: - FloatBox() : m_x(0), m_y(0), m_z(0), m_width(0), m_height(0), m_depth(0) {} - - FloatBox(float x, float y, float z, float width, float height, float depth) - : m_x(x), - m_y(y), - m_z(z), - m_width(width), - m_height(height), - m_depth(depth) {} - - FloatBox(const FloatBox& box) - : m_x(box.x()), - m_y(box.y()), - m_z(box.z()), - m_width(box.width()), - m_height(box.height()), - m_depth(box.depth()) {} - - void setOrigin(const FloatPoint3D& origin) { - m_x = origin.x(); - m_y = origin.y(); - m_z = origin.z(); - } - - void setSize(const FloatPoint3D& origin) { - ASSERT(origin.x() >= 0); - ASSERT(origin.y() >= 0); - ASSERT(origin.z() >= 0); - - m_width = origin.x(); - m_height = origin.y(); - m_depth = origin.z(); - } - - void move(const FloatPoint3D& location) { - m_x += location.x(); - m_y += location.y(); - m_z += location.z(); - } - - void flatten() { - m_z = 0; - m_depth = 0; - } - - void expandTo(const FloatPoint3D& low, const FloatPoint3D& high) { - ASSERT(low.x() <= high.x()); - ASSERT(low.y() <= high.y()); - ASSERT(low.z() <= high.z()); - - float minX = std::min(m_x, low.x()); - float minY = std::min(m_y, low.y()); - float minZ = std::min(m_z, low.z()); - - float maxX = std::max(right(), high.x()); - float maxY = std::max(bottom(), high.y()); - float maxZ = std::max(front(), high.z()); - - m_x = minX; - m_y = minY; - m_z = minZ; - - m_width = maxX - minX; - m_height = maxY - minY; - m_depth = maxZ - minZ; - } - - void expandTo(const FloatPoint3D& point) { expandTo(point, point); } - - void expandTo(const FloatBox& box) { - expandTo(FloatPoint3D(box.x(), box.y(), box.z()), - FloatPoint3D(box.right(), box.bottom(), box.front())); - } - - void unionBounds(const FloatBox& box) { - if (box.isEmpty()) - return; - - if (isEmpty()) { - *this = box; - return; - } - - expandTo(box); - } - - bool isEmpty() const { - return (m_width <= 0 && m_height <= 0) || (m_width <= 0 && m_depth <= 0) || - (m_height <= 0 && m_depth <= 0); - } - - float right() const { return m_x + m_width; } - float bottom() const { return m_y + m_height; } - float front() const { return m_z + m_depth; } - float x() const { return m_x; } - float y() const { return m_y; } - float z() const { return m_z; } - float width() const { return m_width; } - float height() const { return m_height; } - float depth() const { return m_depth; } - - private: - float m_x; - float m_y; - float m_z; - float m_width; - float m_height; - float m_depth; -}; - -inline bool operator==(const FloatBox& a, const FloatBox& b) { - return a.x() == b.x() && a.y() == b.y() && a.z() == b.z() && - a.width() == b.width() && a.height() == b.height() && - a.depth() == b.depth(); -} - -inline bool operator!=(const FloatBox& a, const FloatBox& b) { - return !(a == b); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_FLOATBOX_H_ diff --git a/sky/engine/platform/geometry/FloatBoxExtent.h b/sky/engine/platform/geometry/FloatBoxExtent.h deleted file mode 100644 index f3cb9760dd8a7..0000000000000 --- a/sky/engine/platform/geometry/FloatBoxExtent.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_FLOATBOXEXTENT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_FLOATBOXEXTENT_H_ - -#include "flutter/sky/engine/platform/geometry/FloatRect.h" - -namespace blink { - -class FloatBoxExtent { - public: - FloatBoxExtent() : m_top(0), m_right(0), m_bottom(0), m_left(0) {} - - FloatBoxExtent(float top, float right, float bottom, float left) - : m_top(top), m_right(right), m_bottom(bottom), m_left(left) {} - - float top() const { return m_top; } - void setTop(float top) { m_top = top; } - - float right() const { return m_right; } - void setRight(float right) { m_right = right; } - - float bottom() const { return m_bottom; } - void setBottom(float bottom) { m_bottom = bottom; } - - float left() const { return m_left; } - void setLeft(float left) { m_left = left; } - - bool isZero() const { return !left() && !right() && !top() && !bottom(); } - - void expandRect(FloatRect& rect) const { - if (isZero()) - return; - - rect.move(-left(), -top()); - rect.expand(left() + right(), top() + bottom()); - } - - void unite(const FloatBoxExtent& other) { - m_top = std::min(m_top, other.top()); - m_right = std::max(m_right, other.right()); - m_bottom = std::max(m_bottom, other.bottom()); - m_left = std::min(m_left, other.left()); - } - - void unite(const FloatRect& rect) { - m_top = std::min(m_top, rect.y()); - m_right = std::max(m_right, rect.maxX()); - m_bottom = std::max(m_bottom, rect.maxY()); - m_left = std::min(m_left, rect.x()); - } - - private: - float m_top; - float m_right; - float m_bottom; - float m_left; -}; - -inline bool operator==(const FloatBoxExtent& a, const FloatBoxExtent& b) { - return a.top() == b.top() && a.right() == b.right() && - a.bottom() == b.bottom() && a.left() == b.left(); -} - -inline bool operator!=(const FloatBoxExtent& a, const FloatBoxExtent& b) { - return !(a == b); -} - -inline void operator+=(FloatBoxExtent& a, const FloatBoxExtent& b) { - a.setTop(a.top() + b.top()); - a.setRight(a.right() + b.right()); - a.setBottom(a.bottom() + b.bottom()); - a.setLeft(a.left() + b.left()); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_FLOATBOXEXTENT_H_ diff --git a/sky/engine/platform/geometry/FloatBoxTest.cpp b/sky/engine/platform/geometry/FloatBoxTest.cpp deleted file mode 100644 index 45fdf44bac00a..0000000000000 --- a/sky/engine/platform/geometry/FloatBoxTest.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES,:tabnew INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/FloatBox.h" - -#include "flutter/sky/engine/platform/geometry/FloatBoxTestHelpers.h" - -#include - -using namespace blink; - -namespace { - -TEST(FloatBoxTest, SimpleCreationTest) { - FloatBox box(1, 2, 3, 4, 5, 6); - EXPECT_EQ(1, box.x()); - EXPECT_EQ(2, box.y()); - EXPECT_EQ(3, box.z()); - EXPECT_EQ(4, box.width()); - EXPECT_EQ(5, box.height()); - EXPECT_EQ(6, box.depth()); - EXPECT_EQ(5, box.right()); - EXPECT_EQ(7, box.bottom()); - EXPECT_EQ(9, box.front()); -} - -TEST(FloatBoxTest, PositionTest) { - FloatBox box(0, 0, 0, 4, 4, 4); - box.move(FloatPoint3D(1, 2, 3)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(1, 2, 3, 4, 4, 4), box); - box.setOrigin(FloatPoint3D(-1, -2, -3)); - box.move(FloatPoint3D(-1, -2, -3)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-2, -4, -6, 4, 4, 4), box); -} - -TEST(FloatBoxTest, CopyTest) { - FloatBox box(1, 2, 3, 4, 4, 4); - FloatBox box2(box); - EXPECT_EQ(box, box2); - box.setSize(FloatPoint3D(3, 3, 3)); - EXPECT_NE(box, box2); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(1, 2, 3, 3, 3, 3), box); -} - -TEST(FloatBoxTest, FlattenTest) { - FloatBox box(1, 2, 3, 4, 4, 4); - box.flatten(); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(1, 2, 0, 4, 4, 0), box); -} - -TEST(FloatBoxTest, ExpandTests) { - FloatBox box; - box.expandTo(FloatPoint3D(10, -3, 2)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, -3, 0, 10, 3, 2), box); - - box.expandTo(FloatPoint3D(-15, 6, 8)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-15, -3, 0, 25, 9, 8), box); - - box = FloatBox(); - box.expandTo(FloatPoint3D(-3, 6, 9), FloatPoint3D(-2, 10, 11)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-3, 0, 0, 3, 10, 11), box); - - box = FloatBox(); - box.expandTo(FloatBox(-10, -10, -10, 3, 30, 40)); - box.expandTo(FloatBox(-11, 3, 50, 10, 15, 1)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-11, -10, -10, 11, 30, 61), box); -} - -TEST(FloatBoxTest, UnionTest) { - FloatBox box; - EXPECT_TRUE(box.isEmpty()); - FloatBox unionedBox(3, 5, 6, 5, 3, 9); - box.unionBounds(unionedBox); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, unionedBox, box); - - box.unionBounds(FloatBox()); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, unionedBox, box); - - box.unionBounds(FloatBox(0, 0, 0, 1, 1, 1)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, 0, 0, 8, 8, 15), box); -} - -TEST(FloatBoxTest, EmptyBoxTest) { - FloatBox box; - EXPECT_TRUE(box.isEmpty()); - box.expandTo(FloatPoint3D(1, 0, 0)); - EXPECT_TRUE(box.isEmpty()); - box.expandTo(FloatPoint3D(0, 1, 0)); - EXPECT_FALSE(box.isEmpty()); -} - -} // namespace diff --git a/sky/engine/platform/geometry/FloatBoxTestHelpers.cpp b/sky/engine/platform/geometry/FloatBoxTestHelpers.cpp deleted file mode 100644 index a8b5ac8ccb8d0..0000000000000 --- a/sky/engine/platform/geometry/FloatBoxTestHelpers.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/FloatBoxTestHelpers.h" - -#include "flutter/sky/engine/platform/geometry/FloatBox.h" -const static float kTestEpsilon = 1e-6; - -void blink::PrintTo(const FloatBox& box, ::std::ostream* os) { - *os << "FloatBox(" << box.x() << ", " << box.y() << ", " << box.z() << ", " - << box.width() << ", " << box.height() << ", " << box.depth() << ")"; -} - -bool blink::FloatBoxTest::ApproximatelyEqual(const float& a, const float& b) { - float absA = ::fabs(a); - float absB = ::fabs(b); - float absErr = ::fabs(a - b); - if (a == b) - return true; - - if (a == 0 || b == 0 || absErr < std::numeric_limits::min()) - return absErr < (kTestEpsilon * std::numeric_limits::min()); - - return ((absErr / (absA + absB)) < kTestEpsilon); -} - -bool blink::FloatBoxTest::ApproximatelyEqual(const FloatBox& a, - const FloatBox& b) { - if (!ApproximatelyEqual(a.x(), b.x()) || !ApproximatelyEqual(a.y(), b.y()) || - !ApproximatelyEqual(a.z(), b.z()) || - !ApproximatelyEqual(a.width(), b.width()) || - !ApproximatelyEqual(a.height(), b.height()) || - !ApproximatelyEqual(a.depth(), b.depth())) { - return false; - } - return true; -} - -::testing::AssertionResult blink::FloatBoxTest::AssertAlmostEqual( - const char* m_expr, - const char* n_expr, - const FloatBox& m, - const FloatBox& n) { - if (!ApproximatelyEqual(m, n)) { - return ::testing::AssertionFailure() - << " Value of:" << n_expr << std::endl - << " Actual:" << testing::PrintToString(n) << std::endl - << "Expected Approx:" << m_expr << std::endl - << " Which is:" << ::testing::PrintToString(m); - } - return ::testing::AssertionSuccess(); -} - -::testing::AssertionResult blink::FloatBoxTest::AssertContains( - const char* m_expr, - const char* n_expr, - const FloatBox& m, - const FloatBox& n) { - FloatBox newM = m; - newM.expandTo(n); - if (!ApproximatelyEqual(m, newM)) { - return ::testing::AssertionFailure() - << " Value of:" << n_expr << std::endl - << " Actual:" << testing::PrintToString(n) << std::endl - << "Not Contained in:" << m_expr << std::endl - << " Which is:" << ::testing::PrintToString(m); - } - return ::testing::AssertionSuccess(); -} diff --git a/sky/engine/platform/geometry/FloatBoxTestHelpers.h b/sky/engine/platform/geometry/FloatBoxTestHelpers.h deleted file mode 100644 index 8025ab28829ca..0000000000000 --- a/sky/engine/platform/geometry/FloatBoxTestHelpers.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_FLOATBOXTESTHELPERS_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_FLOATBOXTESTHELPERS_H_ - -#include -namespace blink { -class FloatBox; - -void PrintTo(const FloatBox&, ::std::ostream*); -bool ApproximatelyEqual(const float&, const float&); - -namespace FloatBoxTest { -bool ApproximatelyEqual(const float&, const float&); -bool ApproximatelyEqual(const FloatBox&, const FloatBox&); -::testing::AssertionResult AssertAlmostEqual(const char*, - const char*, - const FloatBox&, - const FloatBox&); -::testing::AssertionResult AssertContains(const char*, - const char*, - const FloatBox&, - const FloatBox&); -} // namespace FloatBoxTest -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_FLOATBOXTESTHELPERS_H_ diff --git a/sky/engine/platform/geometry/FloatPoint.cpp b/sky/engine/platform/geometry/FloatPoint.cpp deleted file mode 100644 index b9d6aa3c22c9d..0000000000000 --- a/sky/engine/platform/geometry/FloatPoint.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2005 Nokia. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" - -#include -#include -#include "flutter/sky/engine/platform/FloatConversion.h" -#include "flutter/sky/engine/platform/geometry/LayoutPoint.h" -#include "flutter/sky/engine/platform/geometry/LayoutSize.h" -#include "third_party/skia/include/core/SkPoint.h" - -namespace blink { - -// Skia has problems when passed infinite, etc floats, filter them to 0. -static inline SkScalar WebCoreFloatToSkScalar(float f) { - return SkFloatToScalar(std::isfinite(f) ? f : 0); -} - -FloatPoint::FloatPoint(const IntPoint& p) : m_x(p.x()), m_y(p.y()) {} - -FloatPoint::FloatPoint(const LayoutPoint& p) - : m_x(p.x().toFloat()), m_y(p.y().toFloat()) {} - -void FloatPoint::normalize() { - float tempLength = length(); - - if (tempLength) { - m_x /= tempLength; - m_y /= tempLength; - } -} - -float FloatPoint::slopeAngleRadians() const { - return atan2f(m_y, m_x); -} - -float FloatPoint::length() const { - return sqrtf(lengthSquared()); -} - -void FloatPoint::move(const LayoutSize& size) { - m_x += size.width(); - m_y += size.height(); -} - -void FloatPoint::moveBy(const LayoutPoint& point) { - m_x += point.x(); - m_y += point.y(); -} - -SkPoint FloatPoint::data() const { - SkPoint p = {WebCoreFloatToSkScalar(m_x), WebCoreFloatToSkScalar(m_y)}; - return p; -} - -FloatPoint FloatPoint::narrowPrecision(double x, double y) { - return FloatPoint(narrowPrecisionToFloat(x), narrowPrecisionToFloat(y)); -} - -float findSlope(const FloatPoint& p1, const FloatPoint& p2, float& c) { - if (p2.x() == p1.x()) - return std::numeric_limits::infinity(); - - // y = mx + c - float slope = (p2.y() - p1.y()) / (p2.x() - p1.x()); - c = p1.y() - slope * p1.x(); - return slope; -} - -bool findIntersection(const FloatPoint& p1, - const FloatPoint& p2, - const FloatPoint& d1, - const FloatPoint& d2, - FloatPoint& intersection) { - float pxLength = p2.x() - p1.x(); - float pyLength = p2.y() - p1.y(); - - float dxLength = d2.x() - d1.x(); - float dyLength = d2.y() - d1.y(); - - float denom = pxLength * dyLength - pyLength * dxLength; - if (!denom) - return false; - - float param = - ((d1.x() - p1.x()) * dyLength - (d1.y() - p1.y()) * dxLength) / denom; - - intersection.setX(p1.x() + param * pxLength); - intersection.setY(p1.y() + param * pyLength); - return true; -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/FloatPoint.h b/sky/engine/platform/geometry/FloatPoint.h deleted file mode 100644 index 0484a015d3edc..0000000000000 --- a/sky/engine/platform/geometry/FloatPoint.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2005 Nokia. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_FLOATPOINT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_FLOATPOINT_H_ - -#include -#include "flutter/sky/engine/platform/geometry/FloatSize.h" -#include "flutter/sky/engine/platform/geometry/IntPoint.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -struct SkPoint; - -namespace blink { - -class IntPoint; -class IntSize; -class LayoutPoint; -class LayoutSize; - -class PLATFORM_EXPORT FloatPoint { - public: - FloatPoint() : m_x(0), m_y(0) {} - FloatPoint(float x, float y) : m_x(x), m_y(y) {} - FloatPoint(const IntPoint&); - FloatPoint(const LayoutPoint&); - explicit FloatPoint(const FloatSize& size) - : m_x(size.width()), m_y(size.height()) {} - - static FloatPoint zero() { return FloatPoint(); } - - static FloatPoint narrowPrecision(double x, double y); - - float x() const { return m_x; } - float y() const { return m_y; } - - void setX(float x) { m_x = x; } - void setY(float y) { m_y = y; } - void set(float x, float y) { - m_x = x; - m_y = y; - } - void move(float dx, float dy) { - m_x += dx; - m_y += dy; - } - void move(const IntSize& a) { - m_x += a.width(); - m_y += a.height(); - } - void move(const LayoutSize&); - void move(const FloatSize& a) { - m_x += a.width(); - m_y += a.height(); - } - void moveBy(const IntPoint& a) { - m_x += a.x(); - m_y += a.y(); - } - void moveBy(const LayoutPoint&); - void moveBy(const FloatPoint& a) { - m_x += a.x(); - m_y += a.y(); - } - void scale(float sx, float sy) { - m_x *= sx; - m_y *= sy; - } - - void normalize(); - - float dot(const FloatPoint& a) const { return m_x * a.x() + m_y * a.y(); } - - float slopeAngleRadians() const; - float length() const; - float lengthSquared() const { return m_x * m_x + m_y * m_y; } - - FloatPoint expandedTo(const FloatPoint& other) const { - return FloatPoint(std::max(m_x, other.m_x), std::max(m_y, other.m_y)); - } - - FloatPoint shrunkTo(const FloatPoint& other) const { - return FloatPoint(std::min(m_x, other.m_x), std::min(m_y, other.m_y)); - } - - FloatPoint transposedPoint() const { return FloatPoint(m_y, m_x); } - - FloatPoint scaledBy(float scale) const { - return FloatPoint(m_x * scale, m_y * scale); - } - - SkPoint data() const; - - private: - float m_x, m_y; -}; - -inline FloatPoint& operator+=(FloatPoint& a, const FloatSize& b) { - a.move(b.width(), b.height()); - return a; -} - -inline FloatPoint& operator+=(FloatPoint& a, const FloatPoint& b) { - a.move(b.x(), b.y()); - return a; -} - -inline FloatPoint& operator-=(FloatPoint& a, const FloatSize& b) { - a.move(-b.width(), -b.height()); - return a; -} - -inline FloatPoint operator+(const FloatPoint& a, const FloatSize& b) { - return FloatPoint(a.x() + b.width(), a.y() + b.height()); -} - -inline FloatPoint operator+(const FloatPoint& a, const FloatPoint& b) { - return FloatPoint(a.x() + b.x(), a.y() + b.y()); -} - -inline FloatSize operator-(const FloatPoint& a, const FloatPoint& b) { - return FloatSize(a.x() - b.x(), a.y() - b.y()); -} - -inline FloatPoint operator-(const FloatPoint& a, const FloatSize& b) { - return FloatPoint(a.x() - b.width(), a.y() - b.height()); -} - -inline FloatPoint operator-(const FloatPoint& a) { - return FloatPoint(-a.x(), -a.y()); -} - -inline bool operator==(const FloatPoint& a, const FloatPoint& b) { - return a.x() == b.x() && a.y() == b.y(); -} - -inline bool operator!=(const FloatPoint& a, const FloatPoint& b) { - return a.x() != b.x() || a.y() != b.y(); -} - -inline float operator*(const FloatPoint& a, const FloatPoint& b) { - // dot product - return a.dot(b); -} - -inline IntPoint roundedIntPoint(const FloatPoint& p) { - return IntPoint(clampToInteger(roundf(p.x())), clampToInteger(roundf(p.y()))); -} - -inline IntPoint flooredIntPoint(const FloatPoint& p) { - return IntPoint(clampToInteger(floorf(p.x())), clampToInteger(floorf(p.y()))); -} - -inline IntPoint ceiledIntPoint(const FloatPoint& p) { - return IntPoint(clampToInteger(ceilf(p.x())), clampToInteger(ceilf(p.y()))); -} - -inline IntSize flooredIntSize(const FloatPoint& p) { - return IntSize(clampToInteger(floorf(p.x())), clampToInteger(floorf(p.y()))); -} - -inline FloatSize toFloatSize(const FloatPoint& a) { - return FloatSize(a.x(), a.y()); -} - -PLATFORM_EXPORT float findSlope(const FloatPoint& p1, - const FloatPoint& p2, - float& c); - -// Find point where lines through the two pairs of points intersect. Returns -// false if the lines don't intersect. -PLATFORM_EXPORT bool findIntersection(const FloatPoint& p1, - const FloatPoint& p2, - const FloatPoint& d1, - const FloatPoint& d2, - FloatPoint& intersection); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_FLOATPOINT_H_ diff --git a/sky/engine/platform/geometry/FloatPoint3D.cpp b/sky/engine/platform/geometry/FloatPoint3D.cpp deleted file mode 100644 index b36f282389cbc..0000000000000 --- a/sky/engine/platform/geometry/FloatPoint3D.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann - 2004, 2005 Rob Buis - 2005 Eric Seidel - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - aint with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "flutter/sky/engine/platform/geometry/FloatPoint3D.h" - -#include - -namespace blink { - -void FloatPoint3D::normalize() { - float tempLength = length(); - - if (tempLength) { - m_x /= tempLength; - m_y /= tempLength; - m_z /= tempLength; - } -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/FloatPoint3D.h b/sky/engine/platform/geometry/FloatPoint3D.h deleted file mode 100644 index be82a1edbbd03..0000000000000 --- a/sky/engine/platform/geometry/FloatPoint3D.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann - 2004, 2005 Rob Buis - 2005 Eric Seidel - 2010 Zoltan Herczeg - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - aint with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_FLOATPOINT3D_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_FLOATPOINT3D_H_ - -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" - -namespace blink { - -class PLATFORM_EXPORT FloatPoint3D { - public: - FloatPoint3D() : m_x(0), m_y(0), m_z(0) {} - - FloatPoint3D(float x, float y, float z) : m_x(x), m_y(y), m_z(z) {} - - FloatPoint3D(const FloatPoint& p) : m_x(p.x()), m_y(p.y()), m_z(0) {} - - FloatPoint3D(const FloatPoint3D& p) : m_x(p.x()), m_y(p.y()), m_z(p.z()) {} - - float x() const { return m_x; } - void setX(float x) { m_x = x; } - - float y() const { return m_y; } - void setY(float y) { m_y = y; } - - float z() const { return m_z; } - void setZ(float z) { m_z = z; } - void set(float x, float y, float z) { - m_x = x; - m_y = y; - m_z = z; - } - void move(float dx, float dy, float dz) { - m_x += dx; - m_y += dy; - m_z += dz; - } - void scale(float sx, float sy, float sz) { - m_x *= sx; - m_y *= sy; - m_z *= sz; - } - - bool isZero() const { return !m_x && !m_y && !m_z; } - - void normalize(); - - float dot(const FloatPoint3D& a) const { - return m_x * a.x() + m_y * a.y() + m_z * a.z(); - } - - // Sets this FloatPoint3D to the cross product of the passed two. - // It is safe for "this" to be the same as either or both of the - // arguments. - void cross(const FloatPoint3D& a, const FloatPoint3D& b) { - float x = a.y() * b.z() - a.z() * b.y(); - float y = a.z() * b.x() - a.x() * b.z(); - float z = a.x() * b.y() - a.y() * b.x(); - m_x = x; - m_y = y; - m_z = z; - } - - // Convenience function returning "this cross point" as a - // stack-allocated result. - FloatPoint3D cross(const FloatPoint3D& point) const { - FloatPoint3D result; - result.cross(*this, point); - return result; - } - - float lengthSquared() const { return this->dot(*this); } - float length() const { return sqrtf(lengthSquared()); } - - float distanceTo(const FloatPoint3D& a) const; - - private: - float m_x; - float m_y; - float m_z; -}; - -inline FloatPoint3D& operator+=(FloatPoint3D& a, const FloatPoint3D& b) { - a.move(b.x(), b.y(), b.z()); - return a; -} - -inline FloatPoint3D& operator-=(FloatPoint3D& a, const FloatPoint3D& b) { - a.move(-b.x(), -b.y(), -b.z()); - return a; -} - -inline FloatPoint3D operator+(const FloatPoint3D& a, const FloatPoint3D& b) { - return FloatPoint3D(a.x() + b.x(), a.y() + b.y(), a.z() + b.z()); -} - -inline FloatPoint3D operator-(const FloatPoint3D& a, const FloatPoint3D& b) { - return FloatPoint3D(a.x() - b.x(), a.y() - b.y(), a.z() - b.z()); -} - -inline bool operator==(const FloatPoint3D& a, const FloatPoint3D& b) { - return a.x() == b.x() && a.y() == b.y() && a.z() == b.z(); -} - -inline bool operator!=(const FloatPoint3D& a, const FloatPoint3D& b) { - return a.x() != b.x() || a.y() != b.y() || a.z() != b.z(); -} - -inline float operator*(const FloatPoint3D& a, const FloatPoint3D& b) { - // dot product - return a.dot(b); -} - -inline FloatPoint3D operator*(float k, const FloatPoint3D& v) { - return FloatPoint3D(k * v.x(), k * v.y(), k * v.z()); -} - -inline FloatPoint3D operator*(const FloatPoint3D& v, float k) { - return FloatPoint3D(k * v.x(), k * v.y(), k * v.z()); -} - -inline float FloatPoint3D::distanceTo(const FloatPoint3D& a) const { - return (*this - a).length(); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_FLOATPOINT3D_H_ diff --git a/sky/engine/platform/geometry/FloatQuad.cpp b/sky/engine/platform/geometry/FloatQuad.cpp deleted file mode 100644 index 6ba913eeaccfa..0000000000000 --- a/sky/engine/platform/geometry/FloatQuad.cpp +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) - * Copyright (C) 2013 Xidorn Quan (quanxunzhen@gmail.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" - -#include -#include - -namespace blink { - -static inline float min4(float a, float b, float c, float d) { - return std::min(std::min(a, b), std::min(c, d)); -} - -static inline float max4(float a, float b, float c, float d) { - return std::max(std::max(a, b), std::max(c, d)); -} - -inline float dot(const FloatSize& a, const FloatSize& b) { - return a.width() * b.width() + a.height() * b.height(); -} - -inline float determinant(const FloatSize& a, const FloatSize& b) { - return a.width() * b.height() - a.height() * b.width(); -} - -inline bool isPointInTriangle(const FloatPoint& p, - const FloatPoint& t1, - const FloatPoint& t2, - const FloatPoint& t3) { - // Compute vectors - FloatSize v0 = t3 - t1; - FloatSize v1 = t2 - t1; - FloatSize v2 = p - t1; - - // Compute dot products - float dot00 = dot(v0, v0); - float dot01 = dot(v0, v1); - float dot02 = dot(v0, v2); - float dot11 = dot(v1, v1); - float dot12 = dot(v1, v2); - - // Compute barycentric coordinates - float invDenom = 1.0f / (dot00 * dot11 - dot01 * dot01); - float u = (dot11 * dot02 - dot01 * dot12) * invDenom; - float v = (dot00 * dot12 - dot01 * dot02) * invDenom; - - // Check if point is in triangle - return (u >= 0) && (v >= 0) && (u + v <= 1); -} - -FloatRect FloatQuad::boundingBox() const { - float left = min4(m_p1.x(), m_p2.x(), m_p3.x(), m_p4.x()); - float top = min4(m_p1.y(), m_p2.y(), m_p3.y(), m_p4.y()); - - float right = max4(m_p1.x(), m_p2.x(), m_p3.x(), m_p4.x()); - float bottom = max4(m_p1.y(), m_p2.y(), m_p3.y(), m_p4.y()); - - return FloatRect(left, top, right - left, bottom - top); -} - -static inline bool withinEpsilon(float a, float b) { - return fabs(a - b) < std::numeric_limits::epsilon(); -} - -bool FloatQuad::isRectilinear() const { - return (withinEpsilon(m_p1.x(), m_p2.x()) && - withinEpsilon(m_p2.y(), m_p3.y()) && - withinEpsilon(m_p3.x(), m_p4.x()) && - withinEpsilon(m_p4.y(), m_p1.y())) || - (withinEpsilon(m_p1.y(), m_p2.y()) && - withinEpsilon(m_p2.x(), m_p3.x()) && - withinEpsilon(m_p3.y(), m_p4.y()) && - withinEpsilon(m_p4.x(), m_p1.x())); -} - -bool FloatQuad::containsPoint(const FloatPoint& p) const { - return isPointInTriangle(p, m_p1, m_p2, m_p3) || - isPointInTriangle(p, m_p1, m_p3, m_p4); -} - -// Note that we only handle convex quads here. -bool FloatQuad::containsQuad(const FloatQuad& other) const { - return containsPoint(other.p1()) && containsPoint(other.p2()) && - containsPoint(other.p3()) && containsPoint(other.p4()); -} - -static inline FloatPoint rightMostCornerToVector(const FloatRect& rect, - const FloatSize& vector) { - // Return the corner of the rectangle that if it is to the left of the vector - // would mean all of the rectangle is to the left of the vector. - // The vector here represents the side between two points in a clockwise - // convex polygon. - // - // Q XXX - // QQQ XXX If the lower left corner of X is left of the vector that goes - // from the top corner of Q to - // QQQ the right corner of Q, then all of X is left of the vector, and - // intersection impossible. - // Q - // - FloatPoint point; - if (vector.width() >= 0) - point.setY(rect.maxY()); - else - point.setY(rect.y()); - if (vector.height() >= 0) - point.setX(rect.x()); - else - point.setX(rect.maxX()); - return point; -} - -bool FloatQuad::intersectsRect(const FloatRect& rect) const { - // For each side of the quad clockwise we check if the rectangle is to the - // left of it since only content on the right can onlap with the quad. This - // only works if the quad is convex. - FloatSize v1, v2, v3, v4; - - // Ensure we use clockwise vectors. - if (!isCounterclockwise()) { - v1 = m_p2 - m_p1; - v2 = m_p3 - m_p2; - v3 = m_p4 - m_p3; - v4 = m_p1 - m_p4; - } else { - v1 = m_p4 - m_p1; - v2 = m_p1 - m_p2; - v3 = m_p2 - m_p3; - v4 = m_p3 - m_p4; - } - - FloatPoint p = rightMostCornerToVector(rect, v1); - if (determinant(v1, p - m_p1) < 0) - return false; - - p = rightMostCornerToVector(rect, v2); - if (determinant(v2, p - m_p2) < 0) - return false; - - p = rightMostCornerToVector(rect, v3); - if (determinant(v3, p - m_p3) < 0) - return false; - - p = rightMostCornerToVector(rect, v4); - if (determinant(v4, p - m_p4) < 0) - return false; - - // If not all of the rectangle is outside one of the quad's four sides, then - // that means at least a part of the rectangle is overlapping the quad. - return true; -} - -// Tests whether the line is contained by or intersected with the circle. -static inline bool lineIntersectsCircle(const FloatPoint& center, - float radius, - const FloatPoint& p0, - const FloatPoint& p1) { - float x0 = p0.x() - center.x(), y0 = p0.y() - center.y(); - float x1 = p1.x() - center.x(), y1 = p1.y() - center.y(); - float radius2 = radius * radius; - if ((x0 * x0 + y0 * y0) <= radius2 || (x1 * x1 + y1 * y1) <= radius2) - return true; - if (p0 == p1) - return false; - - float a = y0 - y1; - float b = x1 - x0; - float c = x0 * y1 - x1 * y0; - float distance2 = c * c / (a * a + b * b); - // If distance between the center point and the line > the radius, - // the line doesn't cross (or is contained by) the ellipse. - if (distance2 > radius2) - return false; - - // The nearest point on the line is between p0 and p1? - float x = -a * c / (a * a + b * b); - float y = -b * c / (a * a + b * b); - return (((x0 <= x && x <= x1) || (x0 >= x && x >= x1)) && - ((y0 <= y && y <= y1) || (y1 <= y && y <= y0))); -} - -bool FloatQuad::intersectsCircle(const FloatPoint& center, float radius) const { - return containsPoint( - center) // The circle may be totally contained by the quad. - || lineIntersectsCircle(center, radius, m_p1, m_p2) || - lineIntersectsCircle(center, radius, m_p2, m_p3) || - lineIntersectsCircle(center, radius, m_p3, m_p4) || - lineIntersectsCircle(center, radius, m_p4, m_p1); -} - -bool FloatQuad::intersectsEllipse(const FloatPoint& center, - const FloatSize& radii) const { - // Transform the ellipse to an origin-centered circle whose radius is the - // product of major radius and minor radius. Here we apply the same - // transformation to the quad. - FloatQuad transformedQuad(*this); - transformedQuad.move(-center.x(), -center.y()); - transformedQuad.scale(radii.height(), radii.width()); - - FloatPoint originPoint; - return transformedQuad.intersectsCircle(originPoint, - radii.height() * radii.width()); -} - -bool FloatQuad::isCounterclockwise() const { - // Return if the two first vectors are turning clockwise. If the quad is - // convex then all following vectors will turn the same way. - return determinant(m_p2 - m_p1, m_p3 - m_p2) < 0; -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/FloatQuad.h b/sky/engine/platform/geometry/FloatQuad.h deleted file mode 100644 index 9597f386feb30..0000000000000 --- a/sky/engine/platform/geometry/FloatQuad.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_FLOATQUAD_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_FLOATQUAD_H_ - -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" - -namespace blink { - -// A FloatQuad is a collection of 4 points, often representing the result of -// mapping a rectangle through transforms. When initialized from a rect, the -// points are in clockwise order from top left. -class PLATFORM_EXPORT FloatQuad { - public: - FloatQuad() {} - - FloatQuad(const FloatPoint& p1, - const FloatPoint& p2, - const FloatPoint& p3, - const FloatPoint& p4) - : m_p1(p1), m_p2(p2), m_p3(p3), m_p4(p4) {} - - FloatQuad(const FloatRect& inRect) - : m_p1(inRect.location()), - m_p2(inRect.maxX(), inRect.y()), - m_p3(inRect.maxX(), inRect.maxY()), - m_p4(inRect.x(), inRect.maxY()) {} - - FloatPoint p1() const { return m_p1; } - FloatPoint p2() const { return m_p2; } - FloatPoint p3() const { return m_p3; } - FloatPoint p4() const { return m_p4; } - - void setP1(const FloatPoint& p) { m_p1 = p; } - void setP2(const FloatPoint& p) { m_p2 = p; } - void setP3(const FloatPoint& p) { m_p3 = p; } - void setP4(const FloatPoint& p) { m_p4 = p; } - - // isEmpty tests that the bounding box is empty. This will not identify - // "slanted" empty quads. - bool isEmpty() const { return boundingBox().isEmpty(); } - - // Tests whether this quad can be losslessly represented by a FloatRect, - // that is, if two edges are parallel to the x-axis and the other two - // are parallel to the y-axis. If this method returns true, the - // corresponding FloatRect can be retrieved with boundingBox(). - bool isRectilinear() const; - - // Tests whether the given point is inside, or on an edge or corner of this - // quad. - bool containsPoint(const FloatPoint&) const; - - // Tests whether the four corners of other are inside, or coincident with the - // sides of this quad. Note that this only works for convex quads, but that - // includes all quads that originate from transformed rects. - bool containsQuad(const FloatQuad&) const; - - // Tests whether any part of the rectangle intersects with this quad. - // This only works for convex quads. - bool intersectsRect(const FloatRect&) const; - - // Test whether any part of the circle/ellipse intersects with this quad. - // Note that these two functions only work for convex quads. - bool intersectsCircle(const FloatPoint& center, float radius) const; - bool intersectsEllipse(const FloatPoint& center, - const FloatSize& radii) const; - - // The center of the quad. If the quad is the result of a affine-transformed - // rectangle this is the same as the original center transformed. - FloatPoint center() const { - return FloatPoint((m_p1.x() + m_p2.x() + m_p3.x() + m_p4.x()) / 4.0, - (m_p1.y() + m_p2.y() + m_p3.y() + m_p4.y()) / 4.0); - } - - FloatRect boundingBox() const; - IntRect enclosingBoundingBox() const { - return enclosingIntRect(boundingBox()); - } - - void move(const FloatSize& offset) { - m_p1 += offset; - m_p2 += offset; - m_p3 += offset; - m_p4 += offset; - } - - void move(float dx, float dy) { - m_p1.move(dx, dy); - m_p2.move(dx, dy); - m_p3.move(dx, dy); - m_p4.move(dx, dy); - } - - void scale(float dx, float dy) { - m_p1.scale(dx, dy); - m_p2.scale(dx, dy); - m_p3.scale(dx, dy); - m_p4.scale(dx, dy); - } - - // Tests whether points are in clock-wise, or counter clock-wise order. - // Note that output is undefined when all points are colinear. - bool isCounterclockwise() const; - - private: - FloatPoint m_p1; - FloatPoint m_p2; - FloatPoint m_p3; - FloatPoint m_p4; -}; - -inline FloatQuad& operator+=(FloatQuad& a, const FloatSize& b) { - a.move(b); - return a; -} - -inline FloatQuad& operator-=(FloatQuad& a, const FloatSize& b) { - a.move(-b.width(), -b.height()); - return a; -} - -inline bool operator==(const FloatQuad& a, const FloatQuad& b) { - return a.p1() == b.p1() && a.p2() == b.p2() && a.p3() == b.p3() && - a.p4() == b.p4(); -} - -inline bool operator!=(const FloatQuad& a, const FloatQuad& b) { - return a.p1() != b.p1() || a.p2() != b.p2() || a.p3() != b.p3() || - a.p4() != b.p4(); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_FLOATQUAD_H_ diff --git a/sky/engine/platform/geometry/FloatRect.cpp b/sky/engine/platform/geometry/FloatRect.cpp deleted file mode 100644 index 1a176ea01fd73..0000000000000 --- a/sky/engine/platform/geometry/FloatRect.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2005 Nokia. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/FloatRect.h" - -#include "flutter/sky/engine/platform/FloatConversion.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "third_party/skia/include/core/SkRect.h" - -#include -#include - -namespace blink { - -FloatRect::FloatRect(const IntRect& r) - : m_location(r.location()), m_size(r.size()) {} - -FloatRect::FloatRect(const LayoutRect& r) - : m_location(r.location()), m_size(r.size()) {} - -FloatRect::FloatRect(const SkRect& r) - : m_location(r.fLeft, r.fTop), m_size(r.width(), r.height()) {} - -FloatRect FloatRect::narrowPrecision(double x, - double y, - double width, - double height) { - return FloatRect(narrowPrecisionToFloat(x), narrowPrecisionToFloat(y), - narrowPrecisionToFloat(width), - narrowPrecisionToFloat(height)); -} - -bool FloatRect::isExpressibleAsIntRect() const { - return isWithinIntRange(x()) && isWithinIntRange(y()) && - isWithinIntRange(width()) && isWithinIntRange(height()) && - isWithinIntRange(maxX()) && isWithinIntRange(maxY()); -} - -bool FloatRect::intersects(const FloatRect& other) const { - // Checking emptiness handles negative widths as well as zero. - return !isEmpty() && !other.isEmpty() && x() < other.maxX() && - other.x() < maxX() && y() < other.maxY() && other.y() < maxY(); -} - -bool FloatRect::contains(const FloatRect& other) const { - return x() <= other.x() && maxX() >= other.maxX() && y() <= other.y() && - maxY() >= other.maxY(); -} - -bool FloatRect::contains(const FloatPoint& point, - ContainsMode containsMode) const { - if (containsMode == InsideOrOnStroke) - return contains(point.x(), point.y()); - return x() < point.x() && maxX() > point.x() && y() < point.y() && - maxY() > point.y(); -} - -void FloatRect::intersect(const FloatRect& other) { - float left = std::max(x(), other.x()); - float top = std::max(y(), other.y()); - float right = std::min(maxX(), other.maxX()); - float bottom = std::min(maxY(), other.maxY()); - - // Return a clean empty rectangle for non-intersecting cases. - if (left >= right || top >= bottom) { - left = 0; - top = 0; - right = 0; - bottom = 0; - } - - setLocationAndSizeFromEdges(left, top, right, bottom); -} - -void FloatRect::unite(const FloatRect& other) { - // Handle empty special cases first. - if (other.isEmpty()) - return; - if (isEmpty()) { - *this = other; - return; - } - - uniteEvenIfEmpty(other); -} - -void FloatRect::uniteEvenIfEmpty(const FloatRect& other) { - float minX = std::min(x(), other.x()); - float minY = std::min(y(), other.y()); - float maxX = std::max(this->maxX(), other.maxX()); - float maxY = std::max(this->maxY(), other.maxY()); - - setLocationAndSizeFromEdges(minX, minY, maxX, maxY); -} - -void FloatRect::uniteIfNonZero(const FloatRect& other) { - // Handle empty special cases first. - if (other.isZero()) - return; - if (isZero()) { - *this = other; - return; - } - - uniteEvenIfEmpty(other); -} - -void FloatRect::extend(const FloatPoint& p) { - float minX = std::min(x(), p.x()); - float minY = std::min(y(), p.y()); - float maxX = std::max(this->maxX(), p.x()); - float maxY = std::max(this->maxY(), p.y()); - - setLocationAndSizeFromEdges(minX, minY, maxX, maxY); -} - -void FloatRect::scale(float sx, float sy) { - m_location.setX(x() * sx); - m_location.setY(y() * sy); - m_size.setWidth(width() * sx); - m_size.setHeight(height() * sy); -} - -FloatRect unionRect(const Vector& rects) { - FloatRect result; - - size_t count = rects.size(); - for (size_t i = 0; i < count; ++i) - result.unite(rects[i]); - - return result; -} - -void FloatRect::fitToPoints(const FloatPoint& p0, const FloatPoint& p1) { - float left = std::min(p0.x(), p1.x()); - float top = std::min(p0.y(), p1.y()); - float right = std::max(p0.x(), p1.x()); - float bottom = std::max(p0.y(), p1.y()); - - setLocationAndSizeFromEdges(left, top, right, bottom); -} - -namespace { -// Helpers for 3- and 4-way max and min. - -template -T min3(const T& v1, const T& v2, const T& v3) { - return std::min(std::min(v1, v2), v3); -} - -template -T max3(const T& v1, const T& v2, const T& v3) { - return std::max(std::max(v1, v2), v3); -} - -template -T min4(const T& v1, const T& v2, const T& v3, const T& v4) { - return std::min(std::min(v1, v2), std::min(v3, v4)); -} - -template -T max4(const T& v1, const T& v2, const T& v3, const T& v4) { - return std::max(std::max(v1, v2), std::max(v3, v4)); -} - -} // anonymous namespace - -void FloatRect::fitToPoints(const FloatPoint& p0, - const FloatPoint& p1, - const FloatPoint& p2) { - float left = min3(p0.x(), p1.x(), p2.x()); - float top = min3(p0.y(), p1.y(), p2.y()); - float right = max3(p0.x(), p1.x(), p2.x()); - float bottom = max3(p0.y(), p1.y(), p2.y()); - - setLocationAndSizeFromEdges(left, top, right, bottom); -} - -void FloatRect::fitToPoints(const FloatPoint& p0, - const FloatPoint& p1, - const FloatPoint& p2, - const FloatPoint& p3) { - float left = min4(p0.x(), p1.x(), p2.x(), p3.x()); - float top = min4(p0.y(), p1.y(), p2.y(), p3.y()); - float right = max4(p0.x(), p1.x(), p2.x(), p3.x()); - float bottom = max4(p0.y(), p1.y(), p2.y(), p3.y()); - - setLocationAndSizeFromEdges(left, top, right, bottom); -} - -IntRect enclosingIntRect(const FloatRect& rect) { - IntPoint location = flooredIntPoint(rect.minXMinYCorner()); - IntPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner()); - - return IntRect(location, maxPoint - location); -} - -IntRect enclosedIntRect(const FloatRect& rect) { - IntPoint location = ceiledIntPoint(rect.minXMinYCorner()); - IntPoint maxPoint = flooredIntPoint(rect.maxXMaxYCorner()); - IntSize size = maxPoint - location; - size.clampNegativeToZero(); - - return IntRect(location, size); -} - -IntRect roundedIntRect(const FloatRect& rect) { - return IntRect(roundedIntPoint(rect.location()), roundedIntSize(rect.size())); -} - -FloatRect mapRect(const FloatRect& r, - const FloatRect& srcRect, - const FloatRect& destRect) { - if (!srcRect.width() || !srcRect.height()) - return FloatRect(); - - float widthScale = destRect.width() / srcRect.width(); - float heightScale = destRect.height() / srcRect.height(); - return FloatRect(destRect.x() + (r.x() - srcRect.x()) * widthScale, - destRect.y() + (r.y() - srcRect.y()) * heightScale, - r.width() * widthScale, r.height() * heightScale); -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/FloatRect.h b/sky/engine/platform/geometry/FloatRect.h deleted file mode 100644 index 8c0947dc20df6..0000000000000 --- a/sky/engine/platform/geometry/FloatRect.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2005 Nokia. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_FLOATRECT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_FLOATRECT_H_ - -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "third_party/skia/include/core/SkRect.h" - -namespace blink { - -class LayoutRect; -class IntRect; - -class PLATFORM_EXPORT FloatRect { - public: - enum ContainsMode { InsideOrOnStroke, InsideButNotOnStroke }; - - FloatRect() {} - FloatRect(const FloatPoint& location, const FloatSize& size) - : m_location(location), m_size(size) {} - FloatRect(float x, float y, float width, float height) - : m_location(FloatPoint(x, y)), m_size(FloatSize(width, height)) {} - FloatRect(const IntRect&); - FloatRect(const LayoutRect&); - FloatRect(const SkRect&); - - static FloatRect narrowPrecision(double x, - double y, - double width, - double height); - - FloatPoint location() const { return m_location; } - FloatSize size() const { return m_size; } - - void setLocation(const FloatPoint& location) { m_location = location; } - void setSize(const FloatSize& size) { m_size = size; } - - float x() const { return m_location.x(); } - float y() const { return m_location.y(); } - float maxX() const { return x() + width(); } - float maxY() const { return y() + height(); } - float width() const { return m_size.width(); } - float height() const { return m_size.height(); } - - void setX(float x) { m_location.setX(x); } - void setY(float y) { m_location.setY(y); } - void setWidth(float width) { m_size.setWidth(width); } - void setHeight(float height) { m_size.setHeight(height); } - - bool isEmpty() const { return m_size.isEmpty(); } - bool isZero() const { return m_size.isZero(); } - bool isExpressibleAsIntRect() const; - - FloatPoint center() const { - return FloatPoint(x() + width() / 2, y() + height() / 2); - } - - void move(const FloatSize& delta) { m_location += delta; } - void moveBy(const FloatPoint& delta) { - m_location.move(delta.x(), delta.y()); - } - void move(float dx, float dy) { m_location.move(dx, dy); } - - void expand(const FloatSize& size) { m_size += size; } - void expand(float dw, float dh) { m_size.expand(dw, dh); } - void contract(const FloatSize& size) { m_size -= size; } - void contract(float dw, float dh) { m_size.expand(-dw, -dh); } - - void shiftXEdgeTo(float edge) { - float delta = edge - x(); - setX(edge); - setWidth(std::max(0.0f, width() - delta)); - } - void shiftMaxXEdgeTo(float edge) { - float delta = edge - maxX(); - setWidth(std::max(0.0f, width() + delta)); - } - void shiftYEdgeTo(float edge) { - float delta = edge - y(); - setY(edge); - setHeight(std::max(0.0f, height() - delta)); - } - void shiftMaxYEdgeTo(float edge) { - float delta = edge - maxY(); - setHeight(std::max(0.0f, height() + delta)); - } - - FloatPoint minXMinYCorner() const { return m_location; } // typically topLeft - FloatPoint maxXMinYCorner() const { - return FloatPoint(m_location.x() + m_size.width(), m_location.y()); - } // typically topRight - FloatPoint minXMaxYCorner() const { - return FloatPoint(m_location.x(), m_location.y() + m_size.height()); - } // typically bottomLeft - FloatPoint maxXMaxYCorner() const { - return FloatPoint(m_location.x() + m_size.width(), - m_location.y() + m_size.height()); - } // typically bottomRight - - bool intersects(const FloatRect&) const; - bool contains(const FloatRect&) const; - bool contains(const FloatPoint&, ContainsMode = InsideOrOnStroke) const; - - void intersect(const FloatRect&); - void unite(const FloatRect&); - void uniteEvenIfEmpty(const FloatRect&); - void uniteIfNonZero(const FloatRect&); - void extend(const FloatPoint&); - - // Note, this doesn't match what IntRect::contains(IntPoint&) does; the int - // version is really checking for containment of 1x1 rect, but that doesn't - // make sense with floats. - bool contains(float px, float py) const { - return px >= x() && px <= maxX() && py >= y() && py <= maxY(); - } - - void inflateX(float dx) { - m_location.setX(m_location.x() - dx); - m_size.setWidth(m_size.width() + dx + dx); - } - void inflateY(float dy) { - m_location.setY(m_location.y() - dy); - m_size.setHeight(m_size.height() + dy + dy); - } - void inflate(float d) { - inflateX(d); - inflateY(d); - } - void scale(float s) { scale(s, s); } - void scale(float sx, float sy); - - FloatRect transposedRect() const { - return FloatRect(m_location.transposedPoint(), m_size.transposedSize()); - } - - // Re-initializes this rectangle to fit the sets of passed points. - void fitToPoints(const FloatPoint& p0, const FloatPoint& p1); - void fitToPoints(const FloatPoint& p0, - const FloatPoint& p1, - const FloatPoint& p2); - void fitToPoints(const FloatPoint& p0, - const FloatPoint& p1, - const FloatPoint& p2, - const FloatPoint& p3); - - operator SkRect() const { - return SkRect::MakeXYWH(x(), y(), width(), height()); - } - - private: - FloatPoint m_location; - FloatSize m_size; - - void setLocationAndSizeFromEdges(float left, - float top, - float right, - float bottom) { - m_location.set(left, top); - m_size.setWidth(right - left); - m_size.setHeight(bottom - top); - } -}; - -inline FloatRect intersection(const FloatRect& a, const FloatRect& b) { - FloatRect c = a; - c.intersect(b); - return c; -} - -inline FloatRect unionRect(const FloatRect& a, const FloatRect& b) { - FloatRect c = a; - c.unite(b); - return c; -} - -FloatRect unionRect(const Vector&); - -inline FloatRect& operator+=(FloatRect& a, const FloatRect& b) { - a.move(b.x(), b.y()); - a.setWidth(a.width() + b.width()); - a.setHeight(a.height() + b.height()); - return a; -} - -inline FloatRect operator+(const FloatRect& a, const FloatRect& b) { - FloatRect c = a; - c += b; - return c; -} - -inline bool operator==(const FloatRect& a, const FloatRect& b) { - return a.location() == b.location() && a.size() == b.size(); -} - -inline bool operator!=(const FloatRect& a, const FloatRect& b) { - return a.location() != b.location() || a.size() != b.size(); -} - -PLATFORM_EXPORT IntRect enclosingIntRect(const FloatRect&); - -// Returns a valid IntRect contained within the given FloatRect. -PLATFORM_EXPORT IntRect enclosedIntRect(const FloatRect&); - -PLATFORM_EXPORT IntRect roundedIntRect(const FloatRect&); - -// Map supplied rect from srcRect to an equivalent rect in destRect. -PLATFORM_EXPORT FloatRect mapRect(const FloatRect&, - const FloatRect& srcRect, - const FloatRect& destRect); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_FLOATRECT_H_ diff --git a/sky/engine/platform/geometry/FloatRoundedRect.cpp b/sky/engine/platform/geometry/FloatRoundedRect.cpp deleted file mode 100644 index 2c754dc370703..0000000000000 --- a/sky/engine/platform/geometry/FloatRoundedRect.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/FloatRoundedRect.h" - -#include - -namespace blink { - -FloatRoundedRect::FloatRoundedRect(float x, float y, float width, float height) - : m_rect(x, y, width, height) {} - -FloatRoundedRect::FloatRoundedRect(const FloatRect& rect, const Radii& radii) - : m_rect(rect), m_radii(radii) {} - -FloatRoundedRect::FloatRoundedRect(const FloatRect& rect, - const FloatSize& topLeft, - const FloatSize& topRight, - const FloatSize& bottomLeft, - const FloatSize& bottomRight) - : m_rect(rect), m_radii(topLeft, topRight, bottomLeft, bottomRight) {} - -bool FloatRoundedRect::Radii::isZero() const { - return m_topLeft.isZero() && m_topRight.isZero() && m_bottomLeft.isZero() && - m_bottomRight.isZero(); -} - -void FloatRoundedRect::Radii::scale(float factor) { - if (factor == 1) - return; - - // If either radius on a corner becomes zero, reset both radii on that corner. - m_topLeft.scale(factor); - if (!m_topLeft.width() || !m_topLeft.height()) - m_topLeft = FloatSize(); - m_topRight.scale(factor); - if (!m_topRight.width() || !m_topRight.height()) - m_topRight = FloatSize(); - m_bottomLeft.scale(factor); - if (!m_bottomLeft.width() || !m_bottomLeft.height()) - m_bottomLeft = FloatSize(); - m_bottomRight.scale(factor); - if (!m_bottomRight.width() || !m_bottomRight.height()) - m_bottomRight = FloatSize(); -} - -void FloatRoundedRect::Radii::expand(float topWidth, - float bottomWidth, - float leftWidth, - float rightWidth) { - if (m_topLeft.width() > 0 && m_topLeft.height() > 0) { - m_topLeft.setWidth(std::max(0, m_topLeft.width() + leftWidth)); - m_topLeft.setHeight(std::max(0, m_topLeft.height() + topWidth)); - } - if (m_topRight.width() > 0 && m_topRight.height() > 0) { - m_topRight.setWidth(std::max(0, m_topRight.width() + rightWidth)); - m_topRight.setHeight(std::max(0, m_topRight.height() + topWidth)); - } - if (m_bottomLeft.width() > 0 && m_bottomLeft.height() > 0) { - m_bottomLeft.setWidth(std::max(0, m_bottomLeft.width() + leftWidth)); - m_bottomLeft.setHeight( - std::max(0, m_bottomLeft.height() + bottomWidth)); - } - if (m_bottomRight.width() > 0 && m_bottomRight.height() > 0) { - m_bottomRight.setWidth( - std::max(0, m_bottomRight.width() + rightWidth)); - m_bottomRight.setHeight( - std::max(0, m_bottomRight.height() + bottomWidth)); - } -} - -static inline float cornerRectIntercept(float y, const FloatRect& cornerRect) { - ASSERT(cornerRect.height() > 0); - return cornerRect.width() * - sqrt(1 - (y * y) / (cornerRect.height() * cornerRect.height())); -} - -bool FloatRoundedRect::xInterceptsAtY(float y, - float& minXIntercept, - float& maxXIntercept) const { - if (y < rect().y() || y > rect().maxY()) - return false; - - if (!isRounded()) { - minXIntercept = rect().x(); - maxXIntercept = rect().maxX(); - return true; - } - - const FloatRect& topLeftRect = topLeftCorner(); - const FloatRect& bottomLeftRect = bottomLeftCorner(); - - if (!topLeftRect.isEmpty() && y >= topLeftRect.y() && y < topLeftRect.maxY()) - minXIntercept = topLeftRect.maxX() - - cornerRectIntercept(topLeftRect.maxY() - y, topLeftRect); - else if (!bottomLeftRect.isEmpty() && y >= bottomLeftRect.y() && - y <= bottomLeftRect.maxY()) - minXIntercept = bottomLeftRect.maxX() - - cornerRectIntercept(y - bottomLeftRect.y(), bottomLeftRect); - else - minXIntercept = m_rect.x(); - - const FloatRect& topRightRect = topRightCorner(); - const FloatRect& bottomRightRect = bottomRightCorner(); - - if (!topRightRect.isEmpty() && y >= topRightRect.y() && - y <= topRightRect.maxY()) - maxXIntercept = topRightRect.x() + - cornerRectIntercept(topRightRect.maxY() - y, topRightRect); - else if (!bottomRightRect.isEmpty() && y >= bottomRightRect.y() && - y <= bottomRightRect.maxY()) - maxXIntercept = - bottomRightRect.x() + - cornerRectIntercept(y - bottomRightRect.y(), bottomRightRect); - else - maxXIntercept = m_rect.maxX(); - - return true; -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/FloatRoundedRect.h b/sky/engine/platform/geometry/FloatRoundedRect.h deleted file mode 100644 index 365475e9dc1ad..0000000000000 --- a/sky/engine/platform/geometry/FloatRoundedRect.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_FLOATROUNDEDRECT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_FLOATROUNDEDRECT_H_ - -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/FloatSize.h" -#include "flutter/sky/engine/platform/geometry/RoundedRect.h" - -namespace blink { - -class PLATFORM_EXPORT FloatRoundedRect { - public: - class PLATFORM_EXPORT Radii { - public: - Radii() {} - Radii(const FloatSize& topLeft, - const FloatSize& topRight, - const FloatSize& bottomLeft, - const FloatSize& bottomRight) - : m_topLeft(topLeft), - m_topRight(topRight), - m_bottomLeft(bottomLeft), - m_bottomRight(bottomRight) {} - - Radii(const RoundedRect::Radii& intRadii) - : m_topLeft(intRadii.topLeft()), - m_topRight(intRadii.topRight()), - m_bottomLeft(intRadii.bottomLeft()), - m_bottomRight(intRadii.bottomRight()) {} - - void setTopLeft(const FloatSize& size) { m_topLeft = size; } - void setTopRight(const FloatSize& size) { m_topRight = size; } - void setBottomLeft(const FloatSize& size) { m_bottomLeft = size; } - void setBottomRight(const FloatSize& size) { m_bottomRight = size; } - const FloatSize& topLeft() const { return m_topLeft; } - const FloatSize& topRight() const { return m_topRight; } - const FloatSize& bottomLeft() const { return m_bottomLeft; } - const FloatSize& bottomRight() const { return m_bottomRight; } - - bool isZero() const; - - void scale(float factor); - void expand(float topWidth, - float bottomWidth, - float leftWidth, - float rightWidth); - void expand(float size) { expand(size, size, size, size); } - void shrink(float topWidth, - float bottomWidth, - float leftWidth, - float rightWidth) { - expand(-topWidth, -bottomWidth, -leftWidth, -rightWidth); - } - void shrink(float size) { shrink(size, size, size, size); } - - private: - FloatSize m_topLeft; - FloatSize m_topRight; - FloatSize m_bottomLeft; - FloatSize m_bottomRight; - }; - - explicit FloatRoundedRect(const FloatRect&, const Radii& = Radii()); - FloatRoundedRect(float x, float y, float width, float height); - FloatRoundedRect(const FloatRect&, - const FloatSize& topLeft, - const FloatSize& topRight, - const FloatSize& bottomLeft, - const FloatSize& bottomRight); - - const FloatRect& rect() const { return m_rect; } - const Radii& radii() const { return m_radii; } - bool isRounded() const { return !m_radii.isZero(); } - bool isEmpty() const { return m_rect.isEmpty(); } - - void setRect(const FloatRect& rect) { m_rect = rect; } - void setRadii(const Radii& radii) { m_radii = radii; } - - void move(const FloatSize& size) { m_rect.move(size); } - void inflate(float size) { m_rect.inflate(size); } - void expandRadii(float size) { m_radii.expand(size); } - void shrinkRadii(float size) { m_radii.shrink(size); } - - FloatRect topLeftCorner() const { - return FloatRect(m_rect.x(), m_rect.y(), m_radii.topLeft().width(), - m_radii.topLeft().height()); - } - FloatRect topRightCorner() const { - return FloatRect(m_rect.maxX() - m_radii.topRight().width(), m_rect.y(), - m_radii.topRight().width(), m_radii.topRight().height()); - } - FloatRect bottomLeftCorner() const { - return FloatRect(m_rect.x(), m_rect.maxY() - m_radii.bottomLeft().height(), - m_radii.bottomLeft().width(), - m_radii.bottomLeft().height()); - } - FloatRect bottomRightCorner() const { - return FloatRect(m_rect.maxX() - m_radii.bottomRight().width(), - m_rect.maxY() - m_radii.bottomRight().height(), - m_radii.bottomRight().width(), - m_radii.bottomRight().height()); - } - - bool xInterceptsAtY(float y, - float& minXIntercept, - float& maxXIntercept) const; - - private: - FloatRect m_rect; - Radii m_radii; -}; - -inline bool operator==(const FloatRoundedRect::Radii& a, - const FloatRoundedRect::Radii& b) { - return a.topLeft() == b.topLeft() && a.topRight() == b.topRight() && - a.bottomLeft() == b.bottomLeft() && a.bottomRight() == b.bottomRight(); -} - -inline bool operator==(const FloatRoundedRect& a, const FloatRoundedRect& b) { - return a.rect() == b.rect() && a.radii() == b.radii(); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_FLOATROUNDEDRECT_H_ diff --git a/sky/engine/platform/geometry/FloatRoundedRectTest.cpp b/sky/engine/platform/geometry/FloatRoundedRectTest.cpp deleted file mode 100644 index 84c9ba746df55..0000000000000 --- a/sky/engine/platform/geometry/FloatRoundedRectTest.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/FloatRoundedRect.h" - -#include - -using namespace blink; - -namespace blink { - -void PrintTo(const FloatSize& size, std::ostream* os) { - *os << "FloatSize(" << size.width() << ", " << size.height() << ")"; -} - -void PrintTo(const FloatRect& rect, std::ostream* os) { - *os << "FloatRect(" << rect.x() << ", " << rect.y() << ", " << rect.width() - << ", " << rect.height() << ")"; -} - -void PrintTo(const FloatRoundedRect::Radii& radii, std::ostream* os) { - *os << "FloatRoundedRect::Radii(" << ::testing::PrintToString(radii.topLeft()) - << ", " << ::testing::PrintToString(radii.topRight()) << ", " - << ::testing::PrintToString(radii.bottomRight()) << ", " - << ::testing::PrintToString(radii.bottomLeft()) << ")"; -} - -void PrintTo(const FloatRoundedRect& roundedRect, std::ostream* os) { - *os << "FloatRoundedRect(" << ::testing::PrintToString(roundedRect.rect()) - << ", " << ::testing::PrintToString(roundedRect.radii()) << ")"; -} - -} // namespace blink - -namespace { - -#define TEST_INTERCEPTS(roundedRect, yCoordinate, expectedMinXIntercept, \ - expectedMaxXIntercept) \ - { \ - float minXIntercept; \ - float maxXIntercept; \ - EXPECT_TRUE(roundedRect.xInterceptsAtY(yCoordinate, minXIntercept, \ - maxXIntercept)); \ - EXPECT_FLOAT_EQ(expectedMinXIntercept, minXIntercept); \ - EXPECT_FLOAT_EQ(expectedMaxXIntercept, maxXIntercept); \ - } - -TEST(FloatRoundedRectTest, zeroRadii) { - FloatRoundedRect r = FloatRoundedRect(1, 2, 3, 4); - - EXPECT_EQ(FloatRect(1, 2, 3, 4), r.rect()); - EXPECT_EQ(FloatSize(), r.radii().topLeft()); - EXPECT_EQ(FloatSize(), r.radii().topRight()); - EXPECT_EQ(FloatSize(), r.radii().bottomLeft()); - EXPECT_EQ(FloatSize(), r.radii().bottomRight()); - EXPECT_TRUE(r.radii().isZero()); - EXPECT_FALSE(r.isRounded()); - EXPECT_FALSE(r.isEmpty()); - - EXPECT_EQ(FloatRect(1, 2, 0, 0), r.topLeftCorner()); - EXPECT_EQ(FloatRect(4, 2, 0, 0), r.topRightCorner()); - EXPECT_EQ(FloatRect(4, 6, 0, 0), r.bottomRightCorner()); - EXPECT_EQ(FloatRect(1, 6, 0, 0), r.bottomLeftCorner()); - - TEST_INTERCEPTS(r, 2, r.rect().x(), r.rect().maxX()); - TEST_INTERCEPTS(r, 4, r.rect().x(), r.rect().maxX()); - TEST_INTERCEPTS(r, 6, r.rect().x(), r.rect().maxX()); - - float minXIntercept; - float maxXIntercept; - - EXPECT_FALSE(r.xInterceptsAtY(1, minXIntercept, maxXIntercept)); - EXPECT_FALSE(r.xInterceptsAtY(7, minXIntercept, maxXIntercept)); - - // The FloatRoundedRect::expandRadii() function doesn't change radii - // FloatSizes that are <= zero. Same as RoundedRect::expandRadii(). - r.expandRadii(20); - r.shrinkRadii(10); - EXPECT_TRUE(r.radii().isZero()); -} - -TEST(FloatRoundedRectTest, circle) { - FloatSize cornerRadii(50, 50); - FloatRoundedRect r(FloatRect(0, 0, 100, 100), cornerRadii, cornerRadii, - cornerRadii, cornerRadii); - - EXPECT_EQ(FloatRect(0, 0, 100, 100), r.rect()); - EXPECT_EQ(cornerRadii, r.radii().topLeft()); - EXPECT_EQ(cornerRadii, r.radii().topRight()); - EXPECT_EQ(cornerRadii, r.radii().bottomLeft()); - EXPECT_EQ(cornerRadii, r.radii().bottomRight()); - EXPECT_FALSE(r.radii().isZero()); - EXPECT_TRUE(r.isRounded()); - EXPECT_FALSE(r.isEmpty()); - - EXPECT_EQ(FloatRect(0, 0, 50, 50), r.topLeftCorner()); - EXPECT_EQ(FloatRect(50, 0, 50, 50), r.topRightCorner()); - EXPECT_EQ(FloatRect(0, 50, 50, 50), r.bottomLeftCorner()); - EXPECT_EQ(FloatRect(50, 50, 50, 50), r.bottomRightCorner()); - - TEST_INTERCEPTS(r, 0, 50, 50); - TEST_INTERCEPTS(r, 25, 6.69873, 93.3013); - TEST_INTERCEPTS(r, 50, 0, 100); - TEST_INTERCEPTS(r, 75, 6.69873, 93.3013); - TEST_INTERCEPTS(r, 100, 50, 50); - - float minXIntercept; - float maxXIntercept; - - EXPECT_FALSE(r.xInterceptsAtY(-1, minXIntercept, maxXIntercept)); - EXPECT_FALSE(r.xInterceptsAtY(101, minXIntercept, maxXIntercept)); -} - -/* - * FloatRoundedRect geometry for this test. Corner radii are in parens, x and y - * intercepts for the elliptical corners are noted. The rectangle itself is at - * 0,0 with width and height 100. - * - * (10, 15) x=10 x=90 (10, 20) - * (--+---------+--) - * y=15 +--| |-+ y=20 - * | | - * | | - * y=85 + -| |- + y=70 - * (--+---------+--) - * (25, 15) x=25 x=80 (20, 30) - */ -TEST(FloatRoundedRectTest, ellipticalCorners) { - FloatSize cornerSize(10, 20); - FloatRoundedRect::Radii cornerRadii; - cornerRadii.setTopLeft(FloatSize(10, 15)); - cornerRadii.setTopRight(FloatSize(10, 20)); - cornerRadii.setBottomLeft(FloatSize(25, 15)); - cornerRadii.setBottomRight(FloatSize(20, 30)); - - FloatRoundedRect r(FloatRect(0, 0, 100, 100), cornerRadii); - - EXPECT_EQ(r.radii(), - FloatRoundedRect::Radii(FloatSize(10, 15), FloatSize(10, 20), - FloatSize(25, 15), FloatSize(20, 30))); - EXPECT_EQ(r, FloatRoundedRect(FloatRect(0, 0, 100, 100), cornerRadii)); - - EXPECT_EQ(FloatRect(0, 0, 10, 15), r.topLeftCorner()); - EXPECT_EQ(FloatRect(90, 0, 10, 20), r.topRightCorner()); - EXPECT_EQ(FloatRect(0, 85, 25, 15), r.bottomLeftCorner()); - EXPECT_EQ(FloatRect(80, 70, 20, 30), r.bottomRightCorner()); - - TEST_INTERCEPTS(r, 5, 2.5464401, 96.61438); - TEST_INTERCEPTS(r, 15, 0, 99.682457); - TEST_INTERCEPTS(r, 20, 0, 100); - TEST_INTERCEPTS(r, 50, 0, 100); - TEST_INTERCEPTS(r, 70, 0, 100); - TEST_INTERCEPTS(r, 85, 0, 97.320511); - TEST_INTERCEPTS(r, 95, 6.3661003, 91.05542); - - float minXIntercept; - float maxXIntercept; - - EXPECT_FALSE(r.xInterceptsAtY(-1, minXIntercept, maxXIntercept)); - EXPECT_FALSE(r.xInterceptsAtY(101, minXIntercept, maxXIntercept)); -} - -} // namespace diff --git a/sky/engine/platform/geometry/FloatSize.cpp b/sky/engine/platform/geometry/FloatSize.cpp deleted file mode 100644 index 1de5dd0afa1d1..0000000000000 --- a/sky/engine/platform/geometry/FloatSize.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2005 Nokia. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/FloatSize.h" - -#include -#include -#include "flutter/sky/engine/platform/FloatConversion.h" -#include "flutter/sky/engine/platform/geometry/IntSize.h" -#include "flutter/sky/engine/platform/geometry/LayoutSize.h" - -namespace blink { - -FloatSize::FloatSize(const LayoutSize& size) - : m_width(size.width().toFloat()), m_height(size.height().toFloat()) {} - -float FloatSize::diagonalLength() const { - return sqrtf(diagonalLengthSquared()); -} - -bool FloatSize::isZero() const { - return fabs(m_width) < std::numeric_limits::epsilon() && - fabs(m_height) < std::numeric_limits::epsilon(); -} - -bool FloatSize::isExpressibleAsIntSize() const { - return isWithinIntRange(m_width) && isWithinIntRange(m_height); -} - -FloatSize FloatSize::narrowPrecision(double width, double height) { - return FloatSize(narrowPrecisionToFloat(width), - narrowPrecisionToFloat(height)); -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/FloatSize.h b/sky/engine/platform/geometry/FloatSize.h deleted file mode 100644 index 249aaa923e27b..0000000000000 --- a/sky/engine/platform/geometry/FloatSize.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2005 Nokia. All rights reserved. - * 2008 Eric Seidel - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_FLOATSIZE_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_FLOATSIZE_H_ - -#include "flutter/sky/engine/platform/geometry/IntPoint.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -class IntSize; -class LayoutSize; - -class PLATFORM_EXPORT FloatSize { - public: - FloatSize() : m_width(0), m_height(0) {} - FloatSize(float width, float height) : m_width(width), m_height(height) {} - FloatSize(const IntSize& size) - : m_width(size.width()), m_height(size.height()) {} - FloatSize(const LayoutSize&); - - static FloatSize narrowPrecision(double width, double height); - - float width() const { return m_width; } - float height() const { return m_height; } - - void setWidth(float width) { m_width = width; } - void setHeight(float height) { m_height = height; } - - bool isEmpty() const { return m_width <= 0 || m_height <= 0; } - bool isZero() const; - bool isExpressibleAsIntSize() const; - - float aspectRatio() const { return m_width / m_height; } - - void expand(float width, float height) { - m_width += width; - m_height += height; - } - - void scale(float s) { scale(s, s); } - - void scale(float scaleX, float scaleY) { - m_width *= scaleX; - m_height *= scaleY; - } - - FloatSize expandedTo(const FloatSize& other) const { - return FloatSize(m_width > other.m_width ? m_width : other.m_width, - m_height > other.m_height ? m_height : other.m_height); - } - - FloatSize shrunkTo(const FloatSize& other) const { - return FloatSize(m_width < other.m_width ? m_width : other.m_width, - m_height < other.m_height ? m_height : other.m_height); - } - - float diagonalLength() const; - float diagonalLengthSquared() const { - return m_width * m_width + m_height * m_height; - } - - FloatSize transposedSize() const { return FloatSize(m_height, m_width); } - - FloatSize scaledBy(float scale) const { return scaledBy(scale, scale); } - - FloatSize scaledBy(float scaleX, float scaleY) const { - return FloatSize(m_width * scaleX, m_height * scaleY); - } - - private: - float m_width, m_height; -}; - -inline FloatSize& operator+=(FloatSize& a, const FloatSize& b) { - a.setWidth(a.width() + b.width()); - a.setHeight(a.height() + b.height()); - return a; -} - -inline FloatSize& operator-=(FloatSize& a, const FloatSize& b) { - a.setWidth(a.width() - b.width()); - a.setHeight(a.height() - b.height()); - return a; -} - -inline FloatSize operator+(const FloatSize& a, const FloatSize& b) { - return FloatSize(a.width() + b.width(), a.height() + b.height()); -} - -inline FloatSize operator-(const FloatSize& a, const FloatSize& b) { - return FloatSize(a.width() - b.width(), a.height() - b.height()); -} - -inline FloatSize operator-(const FloatSize& size) { - return FloatSize(-size.width(), -size.height()); -} - -inline FloatSize operator*(const FloatSize& a, const float b) { - return FloatSize(a.width() * b, a.height() * b); -} - -inline FloatSize operator*(const float a, const FloatSize& b) { - return FloatSize(a * b.width(), a * b.height()); -} - -inline bool operator==(const FloatSize& a, const FloatSize& b) { - return a.width() == b.width() && a.height() == b.height(); -} - -inline bool operator!=(const FloatSize& a, const FloatSize& b) { - return a.width() != b.width() || a.height() != b.height(); -} - -inline IntSize roundedIntSize(const FloatSize& p) { - return IntSize(clampToInteger(roundf(p.width())), - clampToInteger(roundf(p.height()))); -} - -inline IntSize flooredIntSize(const FloatSize& p) { - return IntSize(clampToInteger(floorf(p.width())), - clampToInteger(floorf(p.height()))); -} - -inline IntSize expandedIntSize(const FloatSize& p) { - return IntSize(clampToInteger(ceilf(p.width())), - clampToInteger(ceilf(p.height()))); -} - -inline IntPoint flooredIntPoint(const FloatSize& p) { - return IntPoint(clampToInteger(floorf(p.width())), - clampToInteger(floorf(p.height()))); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_FLOATSIZE_H_ diff --git a/sky/engine/platform/geometry/IntPoint.h b/sky/engine/platform/geometry/IntPoint.h deleted file mode 100644 index 61189ca1e86ec..0000000000000 --- a/sky/engine/platform/geometry/IntPoint.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_INTPOINT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_INTPOINT_H_ - -#include "flutter/sky/engine/platform/geometry/IntSize.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/VectorTraits.h" - -namespace blink { - -class PLATFORM_EXPORT IntPoint { - public: - IntPoint() : m_x(0), m_y(0) {} - IntPoint(int x, int y) : m_x(x), m_y(y) {} - explicit IntPoint(const IntSize& size) - : m_x(size.width()), m_y(size.height()) {} - - static IntPoint zero() { return IntPoint(); } - - int x() const { return m_x; } - int y() const { return m_y; } - - void setX(int x) { m_x = x; } - void setY(int y) { m_y = y; } - - void move(const IntSize& s) { move(s.width(), s.height()); } - void moveBy(const IntPoint& offset) { move(offset.x(), offset.y()); } - void move(int dx, int dy) { - m_x += dx; - m_y += dy; - } - void scale(float sx, float sy) { - m_x = lroundf(static_cast(m_x * sx)); - m_y = lroundf(static_cast(m_y * sy)); - } - - IntPoint expandedTo(const IntPoint& other) const { - return IntPoint(m_x > other.m_x ? m_x : other.m_x, - m_y > other.m_y ? m_y : other.m_y); - } - - IntPoint shrunkTo(const IntPoint& other) const { - return IntPoint(m_x < other.m_x ? m_x : other.m_x, - m_y < other.m_y ? m_y : other.m_y); - } - - int distanceSquaredToPoint(const IntPoint&) const; - - void clampNegativeToZero() { *this = expandedTo(zero()); } - - IntPoint transposedPoint() const { return IntPoint(m_y, m_x); } - - private: - int m_x, m_y; -}; - -inline IntPoint& operator+=(IntPoint& a, const IntSize& b) { - a.move(b.width(), b.height()); - return a; -} - -inline IntPoint& operator-=(IntPoint& a, const IntSize& b) { - a.move(-b.width(), -b.height()); - return a; -} - -inline IntPoint operator+(const IntPoint& a, const IntSize& b) { - return IntPoint(a.x() + b.width(), a.y() + b.height()); -} - -inline IntPoint operator+(const IntPoint& a, const IntPoint& b) { - return IntPoint(a.x() + b.x(), a.y() + b.y()); -} - -inline IntSize operator-(const IntPoint& a, const IntPoint& b) { - return IntSize(a.x() - b.x(), a.y() - b.y()); -} - -inline IntPoint operator-(const IntPoint& a, const IntSize& b) { - return IntPoint(a.x() - b.width(), a.y() - b.height()); -} - -inline IntPoint operator-(const IntPoint& point) { - return IntPoint(-point.x(), -point.y()); -} - -inline bool operator==(const IntPoint& a, const IntPoint& b) { - return a.x() == b.x() && a.y() == b.y(); -} - -inline bool operator!=(const IntPoint& a, const IntPoint& b) { - return a.x() != b.x() || a.y() != b.y(); -} - -inline IntSize toIntSize(const IntPoint& a) { - return IntSize(a.x(), a.y()); -} - -inline int IntPoint::distanceSquaredToPoint(const IntPoint& point) const { - return ((*this) - point).diagonalLengthSquared(); -} - -} // namespace blink - -WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::IntPoint); - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_INTPOINT_H_ diff --git a/sky/engine/platform/geometry/IntRect.cpp b/sky/engine/platform/geometry/IntRect.cpp deleted file mode 100644 index 8b6c9218ccf1f..0000000000000 --- a/sky/engine/platform/geometry/IntRect.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/IntRect.h" - -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" -#include "third_party/skia/include/core/SkRect.h" - -#include - -namespace blink { - -IntRect::IntRect(const FloatRect& r) - : m_location(clampToInteger(r.x()), clampToInteger(r.y())), - m_size(clampToInteger(r.width()), clampToInteger(r.height())) {} - -IntRect::IntRect(const LayoutRect& r) - : m_location(r.x(), r.y()), m_size(r.width(), r.height()) {} - -bool IntRect::intersects(const IntRect& other) const { - // Checking emptiness handles negative widths as well as zero. - return !isEmpty() && !other.isEmpty() && x() < other.maxX() && - other.x() < maxX() && y() < other.maxY() && other.y() < maxY(); -} - -bool IntRect::contains(const IntRect& other) const { - return x() <= other.x() && maxX() >= other.maxX() && y() <= other.y() && - maxY() >= other.maxY(); -} - -void IntRect::intersect(const IntRect& other) { - int left = std::max(x(), other.x()); - int top = std::max(y(), other.y()); - int right = std::min(maxX(), other.maxX()); - int bottom = std::min(maxY(), other.maxY()); - - // Return a clean empty rectangle for non-intersecting cases. - if (left >= right || top >= bottom) { - left = 0; - top = 0; - right = 0; - bottom = 0; - } - - m_location.setX(left); - m_location.setY(top); - m_size.setWidth(right - left); - m_size.setHeight(bottom - top); -} - -void IntRect::unite(const IntRect& other) { - // Handle empty special cases first. - if (other.isEmpty()) - return; - if (isEmpty()) { - *this = other; - return; - } - - int left = std::min(x(), other.x()); - int top = std::min(y(), other.y()); - int right = std::max(maxX(), other.maxX()); - int bottom = std::max(maxY(), other.maxY()); - - m_location.setX(left); - m_location.setY(top); - m_size.setWidth(right - left); - m_size.setHeight(bottom - top); -} - -void IntRect::uniteIfNonZero(const IntRect& other) { - // Handle empty special cases first. - if (!other.width() && !other.height()) - return; - if (!width() && !height()) { - *this = other; - return; - } - - int left = std::min(x(), other.x()); - int top = std::min(y(), other.y()); - int right = std::max(maxX(), other.maxX()); - int bottom = std::max(maxY(), other.maxY()); - - m_location.setX(left); - m_location.setY(top); - m_size.setWidth(right - left); - m_size.setHeight(bottom - top); -} - -void IntRect::scale(float s) { - m_location.setX((int)(x() * s)); - m_location.setY((int)(y() * s)); - m_size.setWidth((int)(width() * s)); - m_size.setHeight((int)(height() * s)); -} - -static inline int distanceToInterval(int pos, int start, int end) { - if (pos < start) - return start - pos; - if (pos > end) - return end - pos; - return 0; -} - -IntSize IntRect::differenceToPoint(const IntPoint& point) const { - int xdistance = distanceToInterval(point.x(), x(), maxX()); - int ydistance = distanceToInterval(point.y(), y(), maxY()); - return IntSize(xdistance, ydistance); -} - -IntRect::operator SkIRect() const { - SkIRect rect = {x(), y(), maxX(), maxY()}; - return rect; -} - -IntRect::operator SkRect() const { - SkRect rect; - rect.set(SkIntToScalar(x()), SkIntToScalar(y()), SkIntToScalar(maxX()), - SkIntToScalar(maxY())); - return rect; -} - -IntRect unionRect(const Vector& rects) { - IntRect result; - - size_t count = rects.size(); - for (size_t i = 0; i < count; ++i) - result.unite(rects[i]); - - return result; -} - -#ifndef NDEBUG -// Prints the rect to the screen. -void IntRect::show() const { - LayoutRect(*this).show(); -} -#endif - -} // namespace blink diff --git a/sky/engine/platform/geometry/IntRect.h b/sky/engine/platform/geometry/IntRect.h deleted file mode 100644 index f89515d179863..0000000000000 --- a/sky/engine/platform/geometry/IntRect.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_INTRECT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_INTRECT_H_ - -#include "flutter/sky/engine/platform/geometry/IntPoint.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/VectorTraits.h" - -struct SkRect; -struct SkIRect; - -namespace blink { - -class FloatRect; -class LayoutRect; - -class PLATFORM_EXPORT IntRect { - WTF_MAKE_FAST_ALLOCATED; - - public: - IntRect() {} - IntRect(const IntPoint& location, const IntSize& size) - : m_location(location), m_size(size) {} - IntRect(int x, int y, int width, int height) - : m_location(IntPoint(x, y)), m_size(IntSize(width, height)) {} - - explicit IntRect( - const FloatRect&); // don't do this implicitly since it's lossy - explicit IntRect( - const LayoutRect&); // don't do this implicitly since it's lossy - - IntPoint location() const { return m_location; } - IntSize size() const { return m_size; } - - void setLocation(const IntPoint& location) { m_location = location; } - void setSize(const IntSize& size) { m_size = size; } - - int x() const { return m_location.x(); } - int y() const { return m_location.y(); } - int maxX() const { return x() + width(); } - int maxY() const { return y() + height(); } - int width() const { return m_size.width(); } - int height() const { return m_size.height(); } - - void setX(int x) { m_location.setX(x); } - void setY(int y) { m_location.setY(y); } - void setWidth(int width) { m_size.setWidth(width); } - void setHeight(int height) { m_size.setHeight(height); } - - bool isEmpty() const { return m_size.isEmpty(); } - - // NOTE: The result is rounded to integer values, and thus may be not the - // exact center point. - IntPoint center() const { - return IntPoint(x() + width() / 2, y() + height() / 2); - } - - void move(const IntSize& size) { m_location += size; } - void moveBy(const IntPoint& offset) { - m_location.move(offset.x(), offset.y()); - } - void move(int dx, int dy) { m_location.move(dx, dy); } - - void expand(const IntSize& size) { m_size += size; } - void expand(int dw, int dh) { m_size.expand(dw, dh); } - void contract(const IntSize& size) { m_size -= size; } - void contract(int dw, int dh) { m_size.expand(-dw, -dh); } - - void shiftXEdgeTo(int edge) { - int delta = edge - x(); - setX(edge); - setWidth(std::max(0, width() - delta)); - } - void shiftMaxXEdgeTo(int edge) { - int delta = edge - maxX(); - setWidth(std::max(0, width() + delta)); - } - void shiftYEdgeTo(int edge) { - int delta = edge - y(); - setY(edge); - setHeight(std::max(0, height() - delta)); - } - void shiftMaxYEdgeTo(int edge) { - int delta = edge - maxY(); - setHeight(std::max(0, height() + delta)); - } - - IntPoint minXMinYCorner() const { return m_location; } // typically topLeft - IntPoint maxXMinYCorner() const { - return IntPoint(m_location.x() + m_size.width(), m_location.y()); - } // typically topRight - IntPoint minXMaxYCorner() const { - return IntPoint(m_location.x(), m_location.y() + m_size.height()); - } // typically bottomLeft - IntPoint maxXMaxYCorner() const { - return IntPoint(m_location.x() + m_size.width(), - m_location.y() + m_size.height()); - } // typically bottomRight - - bool intersects(const IntRect&) const; - bool contains(const IntRect&) const; - - // This checks to see if the rect contains x,y in the traditional sense. - // Equivalent to checking if the rect contains a 1x1 rect below and to the - // right of (px,py). - bool contains(int px, int py) const { - return px >= x() && px < maxX() && py >= y() && py < maxY(); - } - bool contains(const IntPoint& point) const { - return contains(point.x(), point.y()); - } - - void intersect(const IntRect&); - void unite(const IntRect&); - void uniteIfNonZero(const IntRect&); - - void inflateX(int dx) { - m_location.setX(m_location.x() - dx); - m_size.setWidth(m_size.width() + dx + dx); - } - void inflateY(int dy) { - m_location.setY(m_location.y() - dy); - m_size.setHeight(m_size.height() + dy + dy); - } - void inflate(int d) { - inflateX(d); - inflateY(d); - } - void scale(float s); - - IntSize differenceToPoint(const IntPoint&) const; - int distanceSquaredToPoint(const IntPoint& p) const { - return differenceToPoint(p).diagonalLengthSquared(); - } - - IntRect transposedRect() const { - return IntRect(m_location.transposedPoint(), m_size.transposedSize()); - } - - operator SkRect() const; - operator SkIRect() const; - -#ifndef NDEBUG - // Prints the rect to the screen. - void show() const; -#endif - - private: - IntPoint m_location; - IntSize m_size; -}; - -inline IntRect intersection(const IntRect& a, const IntRect& b) { - IntRect c = a; - c.intersect(b); - return c; -} - -inline IntRect unionRect(const IntRect& a, const IntRect& b) { - IntRect c = a; - c.unite(b); - return c; -} - -PLATFORM_EXPORT IntRect unionRect(const Vector&); - -inline bool operator==(const IntRect& a, const IntRect& b) { - return a.location() == b.location() && a.size() == b.size(); -} - -inline bool operator!=(const IntRect& a, const IntRect& b) { - return a.location() != b.location() || a.size() != b.size(); -} - -} // namespace blink - -WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::IntRect); - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_INTRECT_H_ diff --git a/sky/engine/platform/geometry/IntRectExtent.h b/sky/engine/platform/geometry/IntRectExtent.h deleted file mode 100644 index f34c2b33ca8d3..0000000000000 --- a/sky/engine/platform/geometry/IntRectExtent.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_INTRECTEXTENT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_INTRECTEXTENT_H_ - -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" - -namespace blink { - -class IntRectExtent { - public: - IntRectExtent() : m_top(0), m_right(0), m_bottom(0), m_left(0) {} - - IntRectExtent(int top, int right, int bottom, int left) - : m_top(top), m_right(right), m_bottom(bottom), m_left(left) {} - - int top() const { return m_top; } - void setTop(int top) { m_top = top; } - - int right() const { return m_right; } - void setRight(int right) { m_right = right; } - - int bottom() const { return m_bottom; } - void setBottom(int bottom) { m_bottom = bottom; } - - int left() const { return m_left; } - void setLeft(int left) { m_left = left; } - - bool isZero() const { return !left() && !right() && !top() && !bottom(); } - - void expandRect(LayoutRect& rect) const { - if (isZero()) - return; - - rect.move(-left(), -top()); - rect.expand(left() + right(), top() + bottom()); - } - - private: - int m_top; - int m_right; - int m_bottom; - int m_left; -}; - -inline bool operator==(const IntRectExtent& a, const IntRectExtent& b) { - return a.top() == b.top() && a.right() == b.right() && - a.bottom() == b.bottom() && a.left() == b.left(); -} - -inline bool operator!=(const IntRectExtent& a, const IntRectExtent& b) { - return !(a == b); -} - -inline void operator+=(IntRectExtent& a, const IntRectExtent& b) { - a.setTop(a.top() + b.top()); - a.setRight(a.right() + b.right()); - a.setBottom(a.bottom() + b.bottom()); - a.setLeft(a.left() + b.left()); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_INTRECTEXTENT_H_ diff --git a/sky/engine/platform/geometry/IntSize.h b/sky/engine/platform/geometry/IntSize.h deleted file mode 100644 index 59841d027dc88..0000000000000 --- a/sky/engine/platform/geometry/IntSize.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. - * All rights reserved. - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_INTSIZE_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_INTSIZE_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/public/platform/WebCommon.h" - -namespace blink { - -class PLATFORM_EXPORT IntSize { - public: - IntSize() : m_width(0), m_height(0) {} - IntSize(int width, int height) : m_width(width), m_height(height) {} - - int width() const { return m_width; } - int height() const { return m_height; } - - void setWidth(int width) { m_width = width; } - void setHeight(int height) { m_height = height; } - - bool isEmpty() const { return m_width <= 0 || m_height <= 0; } - bool isZero() const { return !m_width && !m_height; } - - float aspectRatio() const { - return static_cast(m_width) / static_cast(m_height); - } - - void expand(int width, int height) { - m_width += width; - m_height += height; - } - - void scale(float widthScale, float heightScale) { - m_width = static_cast(static_cast(m_width) * widthScale); - m_height = static_cast(static_cast(m_height) * heightScale); - } - - void scale(float scale) { this->scale(scale, scale); } - - IntSize expandedTo(const IntSize& other) const { - return IntSize(m_width > other.m_width ? m_width : other.m_width, - m_height > other.m_height ? m_height : other.m_height); - } - - IntSize shrunkTo(const IntSize& other) const { - return IntSize(m_width < other.m_width ? m_width : other.m_width, - m_height < other.m_height ? m_height : other.m_height); - } - - void clampNegativeToZero() { *this = expandedTo(IntSize()); } - - void clampToMinimumSize(const IntSize& minimumSize) { - if (m_width < minimumSize.width()) - m_width = minimumSize.width(); - if (m_height < minimumSize.height()) - m_height = minimumSize.height(); - } - - // Return area in a uint64_t to avoid overflow. - uint64_t area() const { return static_cast(width()) * height(); } - - int diagonalLengthSquared() const { - return m_width * m_width + m_height * m_height; - } - - IntSize transposedSize() const { return IntSize(m_height, m_width); } - - private: - int m_width, m_height; -}; - -inline IntSize& operator+=(IntSize& a, const IntSize& b) { - a.setWidth(a.width() + b.width()); - a.setHeight(a.height() + b.height()); - return a; -} - -inline IntSize& operator-=(IntSize& a, const IntSize& b) { - a.setWidth(a.width() - b.width()); - a.setHeight(a.height() - b.height()); - return a; -} - -inline IntSize operator+(const IntSize& a, const IntSize& b) { - return IntSize(a.width() + b.width(), a.height() + b.height()); -} - -inline IntSize operator-(const IntSize& a, const IntSize& b) { - return IntSize(a.width() - b.width(), a.height() - b.height()); -} - -inline IntSize operator-(const IntSize& size) { - return IntSize(-size.width(), -size.height()); -} - -inline bool operator==(const IntSize& a, const IntSize& b) { - return a.width() == b.width() && a.height() == b.height(); -} - -inline bool operator!=(const IntSize& a, const IntSize& b) { - return a.width() != b.width() || a.height() != b.height(); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_INTSIZE_H_ diff --git a/sky/engine/platform/geometry/IntSizeHash.h b/sky/engine/platform/geometry/IntSizeHash.h deleted file mode 100644 index c8ffa01482e66..0000000000000 --- a/sky/engine/platform/geometry/IntSizeHash.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_INTSIZEHASH_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_INTSIZEHASH_H_ - -#include "flutter/sky/engine/platform/geometry/IntSize.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/HashSet.h" - -namespace WTF { - -template <> -struct IntHash { - static unsigned hash(const blink::IntSize& key) { - return pairIntHash(key.width(), key.height()); - } - static bool equal(const blink::IntSize& a, const blink::IntSize& b) { - return a == b; - } - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -template <> -struct DefaultHash { - typedef IntHash Hash; -}; - -template <> -struct HashTraits : GenericHashTraits { - static const bool emptyValueIsZero = true; - static const bool needsDestruction = false; - static void constructDeletedValue(blink::IntSize& slot, bool) { - new (NotNull, &slot) blink::IntSize(-1, -1); - } - static bool isDeletedValue(const blink::IntSize& value) { - return value.width() == -1 && value.height() == -1; - } -}; - -} // namespace WTF - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_INTSIZEHASH_H_ diff --git a/sky/engine/platform/geometry/LayoutBoxExtent.cpp b/sky/engine/platform/geometry/LayoutBoxExtent.cpp deleted file mode 100644 index 648cd6e45e352..0000000000000 --- a/sky/engine/platform/geometry/LayoutBoxExtent.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/LayoutBoxExtent.h" - -#include "flutter/sky/engine/wtf/Assertions.h" - -namespace blink { - -LayoutUnit LayoutBoxExtent::logicalTop() const { - return m_top; -} - -LayoutUnit LayoutBoxExtent::logicalBottom() const { - return m_bottom; -} - -LayoutUnit LayoutBoxExtent::logicalLeft() const { - return m_left; -} - -LayoutUnit LayoutBoxExtent::logicalRight() const { - return m_right; -} - -LayoutUnit LayoutBoxExtent::before() const { - // FIXME(sky): Remove - return m_top; -} - -LayoutUnit LayoutBoxExtent::after() const { - // FIXME(sky): Remove - return m_bottom; -} - -LayoutUnit LayoutBoxExtent::start(TextDirection direction) const { - return isLeftToRightDirection(direction) ? m_left : m_right; -} - -LayoutUnit LayoutBoxExtent::end(TextDirection direction) const { - return isLeftToRightDirection(direction) ? m_right : m_left; -} - -void LayoutBoxExtent::setBefore(LayoutUnit value) { - // FIXME(sky): Remove - m_top = value; -} - -void LayoutBoxExtent::setAfter(LayoutUnit value) { - // FIXME(sky): Remove - m_bottom = value; -} - -void LayoutBoxExtent::setStart(TextDirection direction, LayoutUnit value) { - if (isLeftToRightDirection(direction)) - m_left = value; - else - m_right = value; -} - -void LayoutBoxExtent::setEnd(TextDirection direction, LayoutUnit value) { - if (isLeftToRightDirection(direction)) - m_right = value; - else - m_left = value; -} - -LayoutUnit& LayoutBoxExtent::mutableLogicalLeft() { - return m_left; -} - -LayoutUnit& LayoutBoxExtent::mutableLogicalRight() { - return m_right; -} - -LayoutUnit& LayoutBoxExtent::mutableBefore() { - return m_top; -} - -LayoutUnit& LayoutBoxExtent::mutableAfter() { - return m_bottom; -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/LayoutBoxExtent.h b/sky/engine/platform/geometry/LayoutBoxExtent.h deleted file mode 100644 index cb565c7d10262..0000000000000 --- a/sky/engine/platform/geometry/LayoutBoxExtent.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTBOXEXTENT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTBOXEXTENT_H_ - -#include "flutter/sky/engine/platform/LayoutUnit.h" -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" - -namespace blink { - -class PLATFORM_EXPORT LayoutBoxExtent { - public: - LayoutBoxExtent() : m_top(0), m_right(0), m_bottom(0), m_left(0) {} - LayoutBoxExtent(LayoutUnit top, - LayoutUnit right, - LayoutUnit bottom, - LayoutUnit left) - : m_top(top), m_right(right), m_bottom(bottom), m_left(left) {} - - inline LayoutUnit top() const { return m_top; } - inline LayoutUnit right() const { return m_right; } - inline LayoutUnit bottom() const { return m_bottom; } - inline LayoutUnit left() const { return m_left; } - - inline void setTop(LayoutUnit value) { m_top = value; } - inline void setRight(LayoutUnit value) { m_right = value; } - inline void setBottom(LayoutUnit value) { m_bottom = value; } - inline void setLeft(LayoutUnit value) { m_left = value; } - - LayoutUnit logicalTop() const; - LayoutUnit logicalBottom() const; - LayoutUnit logicalLeft() const; - LayoutUnit logicalRight() const; - - LayoutUnit before() const; - LayoutUnit after() const; - LayoutUnit start(TextDirection) const; - LayoutUnit end(TextDirection) const; - - void setBefore(LayoutUnit); - void setAfter(LayoutUnit); - void setStart(TextDirection, LayoutUnit); - void setEnd(TextDirection, LayoutUnit); - - LayoutUnit& mutableLogicalLeft(); - LayoutUnit& mutableLogicalRight(); - - LayoutUnit& mutableBefore(); - LayoutUnit& mutableAfter(); - - private: - LayoutUnit m_top; - LayoutUnit m_right; - LayoutUnit m_bottom; - LayoutUnit m_left; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTBOXEXTENT_H_ diff --git a/sky/engine/platform/geometry/LayoutPoint.h b/sky/engine/platform/geometry/LayoutPoint.h deleted file mode 100644 index 46b4e09a4e885..0000000000000 --- a/sky/engine/platform/geometry/LayoutPoint.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTPOINT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTPOINT_H_ - -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/LayoutSize.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -class LayoutPoint { - public: - LayoutPoint() {} - LayoutPoint(LayoutUnit x, LayoutUnit y) : m_x(x), m_y(y) {} - LayoutPoint(const IntPoint& point) : m_x(point.x()), m_y(point.y()) {} - explicit LayoutPoint(const FloatPoint& size) : m_x(size.x()), m_y(size.y()) {} - explicit LayoutPoint(const LayoutSize& size) - : m_x(size.width()), m_y(size.height()) {} - - static LayoutPoint zero() { return LayoutPoint(); } - - LayoutUnit x() const { return m_x; } - LayoutUnit y() const { return m_y; } - - void setX(LayoutUnit x) { m_x = x; } - void setY(LayoutUnit y) { m_y = y; } - - void move(const LayoutSize& s) { move(s.width(), s.height()); } - void moveBy(const LayoutPoint& offset) { move(offset.x(), offset.y()); } - void move(LayoutUnit dx, LayoutUnit dy) { - m_x += dx; - m_y += dy; - } - void scale(float sx, float sy) { - m_x *= sx; - m_y *= sy; - } - - LayoutPoint expandedTo(const LayoutPoint& other) const { - return LayoutPoint(std::max(m_x, other.m_x), std::max(m_y, other.m_y)); - } - - LayoutPoint shrunkTo(const LayoutPoint& other) const { - return LayoutPoint(std::min(m_x, other.m_x), std::min(m_y, other.m_y)); - } - - void clampNegativeToZero() { *this = expandedTo(zero()); } - - LayoutPoint transposedPoint() const { return LayoutPoint(m_y, m_x); } - - private: - LayoutUnit m_x, m_y; -}; - -ALWAYS_INLINE LayoutPoint& operator+=(LayoutPoint& a, const LayoutSize& b) { - a.move(b.width(), b.height()); - return a; -} - -ALWAYS_INLINE LayoutPoint& operator-=(LayoutPoint& a, const LayoutSize& b) { - a.move(-b.width(), -b.height()); - return a; -} - -inline LayoutPoint operator+(const LayoutPoint& a, const LayoutSize& b) { - return LayoutPoint(a.x() + b.width(), a.y() + b.height()); -} - -ALWAYS_INLINE LayoutPoint operator+(const LayoutPoint& a, - const LayoutPoint& b) { - return LayoutPoint(a.x() + b.x(), a.y() + b.y()); -} - -ALWAYS_INLINE LayoutSize operator-(const LayoutPoint& a, const LayoutPoint& b) { - return LayoutSize(a.x() - b.x(), a.y() - b.y()); -} - -inline LayoutPoint operator-(const LayoutPoint& a, const LayoutSize& b) { - return LayoutPoint(a.x() - b.width(), a.y() - b.height()); -} - -inline LayoutPoint operator-(const LayoutPoint& point) { - return LayoutPoint(-point.x(), -point.y()); -} - -ALWAYS_INLINE bool operator==(const LayoutPoint& a, const LayoutPoint& b) { - return a.x() == b.x() && a.y() == b.y(); -} - -inline bool operator!=(const LayoutPoint& a, const LayoutPoint& b) { - return a.x() != b.x() || a.y() != b.y(); -} - -inline LayoutPoint toPoint(const LayoutSize& size) { - return LayoutPoint(size.width(), size.height()); -} - -inline LayoutPoint toLayoutPoint(const LayoutSize& p) { - return LayoutPoint(p.width(), p.height()); -} - -inline LayoutSize toSize(const LayoutPoint& a) { - return LayoutSize(a.x(), a.y()); -} - -inline IntPoint flooredIntPoint(const LayoutPoint& point) { - return IntPoint(point.x().floor(), point.y().floor()); -} - -inline IntPoint roundedIntPoint(const LayoutPoint& point) { - return IntPoint(point.x().round(), point.y().round()); -} - -inline IntPoint roundedIntPoint(const LayoutSize& size) { - return IntPoint(size.width().round(), size.height().round()); -} - -inline IntPoint ceiledIntPoint(const LayoutPoint& point) { - return IntPoint(point.x().ceil(), point.y().ceil()); -} - -inline LayoutPoint flooredLayoutPoint(const FloatPoint& p) { - return LayoutPoint(LayoutUnit::fromFloatFloor(p.x()), - LayoutUnit::fromFloatFloor(p.y())); -} - -inline LayoutPoint ceiledLayoutPoint(const FloatPoint& p) { - return LayoutPoint(LayoutUnit::fromFloatCeil(p.x()), - LayoutUnit::fromFloatCeil(p.y())); -} - -inline IntSize pixelSnappedIntSize(const LayoutSize& s, const LayoutPoint& p) { - return IntSize(snapSizeToPixel(s.width(), p.x()), - snapSizeToPixel(s.height(), p.y())); -} - -inline LayoutPoint roundedLayoutPoint(const FloatPoint& p) { - return LayoutPoint(p); -} - -inline LayoutSize toLayoutSize(const LayoutPoint& p) { - return LayoutSize(p.x(), p.y()); -} - -inline LayoutPoint flooredLayoutPoint(const FloatSize& s) { - return flooredLayoutPoint(FloatPoint(s)); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTPOINT_H_ diff --git a/sky/engine/platform/geometry/LayoutRect.cpp b/sky/engine/platform/geometry/LayoutRect.cpp deleted file mode 100644 index da821e662d40b..0000000000000 --- a/sky/engine/platform/geometry/LayoutRect.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" - -#include -#include -#include "flutter/sky/engine/platform/LayoutUnit.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" - -namespace blink { - -LayoutRect::LayoutRect(const FloatRect& r) - : m_location(LayoutPoint(r.location())), m_size(LayoutSize(r.size())) {} - -bool LayoutRect::intersects(const LayoutRect& other) const { - // Checking emptiness handles negative widths as well as zero. - return !isEmpty() && !other.isEmpty() && x() < other.maxX() && - other.x() < maxX() && y() < other.maxY() && other.y() < maxY(); -} - -bool LayoutRect::contains(const LayoutRect& other) const { - return x() <= other.x() && maxX() >= other.maxX() && y() <= other.y() && - maxY() >= other.maxY(); -} - -void LayoutRect::intersect(const LayoutRect& other) { - LayoutPoint newLocation(std::max(x(), other.x()), std::max(y(), other.y())); - LayoutPoint newMaxPoint(std::min(maxX(), other.maxX()), - std::min(maxY(), other.maxY())); - - // Return a clean empty rectangle for non-intersecting cases. - if (newLocation.x() >= newMaxPoint.x() || - newLocation.y() >= newMaxPoint.y()) { - newLocation = LayoutPoint(0, 0); - newMaxPoint = LayoutPoint(0, 0); - } - - m_location = newLocation; - m_size = newMaxPoint - newLocation; -} - -void LayoutRect::unite(const LayoutRect& other) { - // Handle empty special cases first. - if (other.isEmpty()) - return; - if (isEmpty()) { - *this = other; - return; - } - - LayoutPoint newLocation(std::min(x(), other.x()), std::min(y(), other.y())); - LayoutPoint newMaxPoint(std::max(maxX(), other.maxX()), - std::max(maxY(), other.maxY())); - - m_location = newLocation; - m_size = newMaxPoint - newLocation; -} - -void LayoutRect::uniteIfNonZero(const LayoutRect& other) { - // Handle empty special cases first. - if (!other.width() && !other.height()) - return; - if (!width() && !height()) { - *this = other; - return; - } - - LayoutPoint newLocation(std::min(x(), other.x()), std::min(y(), other.y())); - LayoutPoint newMaxPoint(std::max(maxX(), other.maxX()), - std::max(maxY(), other.maxY())); - - m_location = newLocation; - m_size = newMaxPoint - newLocation; -} - -void LayoutRect::scale(float s) { - m_location.scale(s, s); - m_size.scale(s); -} - -void LayoutRect::scale(float xAxisScale, float yAxisScale) { - m_location.scale(xAxisScale, yAxisScale); - m_size.scale(xAxisScale, yAxisScale); -} - -#ifndef NDEBUG -void LayoutRect::show(bool showRawValue) const { - if (showRawValue) - printf("Rect (in raw layout units): [x=%d y=%d maxX=%d maxY=%d]\n", - x().rawValue(), y().rawValue(), maxX().rawValue(), - maxY().rawValue()); - else - printf("Rect (in pixels): [x=%lf y=%lf maxX=%lf maxY=%lf]\n", - x().toDouble(), y().toDouble(), maxX().toDouble(), - maxY().toDouble()); -} -#endif - -LayoutRect unionRect(const Vector& rects) { - LayoutRect result; - - size_t count = rects.size(); - for (size_t i = 0; i < count; ++i) - result.unite(rects[i]); - - return result; -} - -IntRect enclosingIntRect(const LayoutRect& rect) { - IntPoint location = flooredIntPoint(rect.minXMinYCorner()); - IntPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner()); - - return IntRect(location, maxPoint - location); -} - -LayoutRect enclosingLayoutRect(const FloatRect& rect) { - LayoutPoint location = flooredLayoutPoint(rect.minXMinYCorner()); - LayoutPoint maxPoint = ceiledLayoutPoint(rect.maxXMaxYCorner()); - return LayoutRect(location, maxPoint - location); -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/LayoutRect.h b/sky/engine/platform/geometry/LayoutRect.h deleted file mode 100644 index 099d467ac5d73..0000000000000 --- a/sky/engine/platform/geometry/LayoutRect.h +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTRECT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTRECT_H_ - -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "flutter/sky/engine/platform/geometry/LayoutBoxExtent.h" -#include "flutter/sky/engine/platform/geometry/LayoutPoint.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class FloatRect; - -class PLATFORM_EXPORT LayoutRect { - public: - LayoutRect() {} - LayoutRect(const LayoutPoint& location, const LayoutSize& size) - : m_location(location), m_size(size) {} - LayoutRect(LayoutUnit x, LayoutUnit y, LayoutUnit width, LayoutUnit height) - : m_location(LayoutPoint(x, y)), m_size(LayoutSize(width, height)) {} - LayoutRect(const FloatPoint& location, const FloatSize& size) - : m_location(location), m_size(size) {} - LayoutRect(const IntRect& rect) - : m_location(rect.location()), m_size(rect.size()) {} - - explicit LayoutRect( - const FloatRect&); // don't do this implicitly since it's lossy - - LayoutPoint location() const { return m_location; } - LayoutSize size() const { return m_size; } - - IntPoint pixelSnappedLocation() const { return roundedIntPoint(m_location); } - IntSize pixelSnappedSize() const { - return IntSize(snapSizeToPixel(m_size.width(), m_location.x()), - snapSizeToPixel(m_size.height(), m_location.y())); - } - - void setLocation(const LayoutPoint& location) { m_location = location; } - void setSize(const LayoutSize& size) { m_size = size; } - - ALWAYS_INLINE LayoutUnit x() const { return m_location.x(); } - ALWAYS_INLINE LayoutUnit y() const { return m_location.y(); } - ALWAYS_INLINE LayoutUnit maxX() const { return x() + width(); } - ALWAYS_INLINE LayoutUnit maxY() const { return y() + height(); } - LayoutUnit width() const { return m_size.width(); } - LayoutUnit height() const { return m_size.height(); } - - int pixelSnappedX() const { return x().round(); } - int pixelSnappedY() const { return y().round(); } - int pixelSnappedWidth() const { return snapSizeToPixel(width(), x()); } - int pixelSnappedHeight() const { return snapSizeToPixel(height(), y()); } - int pixelSnappedMaxX() const { - return (m_location.x() + m_size.width()).round(); - } - int pixelSnappedMaxY() const { - return (m_location.y() + m_size.height()).round(); - } - - void setX(LayoutUnit x) { m_location.setX(x); } - void setY(LayoutUnit y) { m_location.setY(y); } - void setWidth(LayoutUnit width) { m_size.setWidth(width); } - void setHeight(LayoutUnit height) { m_size.setHeight(height); } - - ALWAYS_INLINE bool isEmpty() const { return m_size.isEmpty(); } - - // NOTE: The result is rounded to integer values, and thus may be not the - // exact center point. - LayoutPoint center() const { - return LayoutPoint(x() + width() / 2, y() + height() / 2); - } - - void move(const LayoutSize& size) { m_location += size; } - void moveBy(const LayoutPoint& offset) { - m_location.move(offset.x(), offset.y()); - } - void move(LayoutUnit dx, LayoutUnit dy) { m_location.move(dx, dy); } - - void expand(const LayoutSize& size) { m_size += size; } - void expand(const LayoutBoxExtent& box) { - m_location.move(-box.left(), -box.top()); - m_size.expand(box.left() + box.right(), box.top() + box.bottom()); - } - void expand(LayoutUnit dw, LayoutUnit dh) { m_size.expand(dw, dh); } - void contract(const LayoutSize& size) { m_size -= size; } - void contract(const LayoutBoxExtent& box) { - m_location.move(box.left(), box.top()); - m_size.shrink(box.left() + box.right(), box.top() + box.bottom()); - } - void contract(LayoutUnit dw, LayoutUnit dh) { m_size.expand(-dw, -dh); } - - void shiftXEdgeTo(LayoutUnit edge) { - LayoutUnit delta = edge - x(); - setX(edge); - setWidth(std::max(0, width() - delta)); - } - void shiftMaxXEdgeTo(LayoutUnit edge) { - LayoutUnit delta = edge - maxX(); - setWidth(std::max(0, width() + delta)); - } - void shiftYEdgeTo(LayoutUnit edge) { - LayoutUnit delta = edge - y(); - setY(edge); - setHeight(std::max(0, height() - delta)); - } - void shiftMaxYEdgeTo(LayoutUnit edge) { - LayoutUnit delta = edge - maxY(); - setHeight(std::max(0, height() + delta)); - } - - LayoutPoint minXMinYCorner() const { - return m_location; - } // typically topLeft - LayoutPoint maxXMinYCorner() const { - return LayoutPoint(m_location.x() + m_size.width(), m_location.y()); - } // typically topRight - LayoutPoint minXMaxYCorner() const { - return LayoutPoint(m_location.x(), m_location.y() + m_size.height()); - } // typically bottomLeft - LayoutPoint maxXMaxYCorner() const { - return LayoutPoint(m_location.x() + m_size.width(), - m_location.y() + m_size.height()); - } // typically bottomRight - - bool intersects(const LayoutRect&) const; - bool contains(const LayoutRect&) const; - - // This checks to see if the rect contains x,y in the traditional sense. - // Equivalent to checking if the rect contains a 1x1 rect below and to the - // right of (px,py). - bool contains(LayoutUnit px, LayoutUnit py) const { - return px >= x() && px < maxX() && py >= y() && py < maxY(); - } - bool contains(const LayoutPoint& point) const { - return contains(point.x(), point.y()); - } - - void intersect(const LayoutRect&); - void unite(const LayoutRect&); - void uniteIfNonZero(const LayoutRect&); - - void inflateX(LayoutUnit dx) { - m_location.setX(m_location.x() - dx); - m_size.setWidth(m_size.width() + dx + dx); - } - void inflateY(LayoutUnit dy) { - m_location.setY(m_location.y() - dy); - m_size.setHeight(m_size.height() + dy + dy); - } - void inflate(LayoutUnit d) { - inflateX(d); - inflateY(d); - } - void scale(float s); - void scale(float xAxisScale, float yAxisScale); - - LayoutRect transposedRect() const { - return LayoutRect(m_location.transposedPoint(), m_size.transposedSize()); - } - - static LayoutRect infiniteRect() { - // Return a rect that is slightly smaller than the true max rect to allow - // pixelSnapping to round up to the nearest IntRect without overflowing. - return LayoutRect(LayoutUnit::nearlyMin() / 2, LayoutUnit::nearlyMin() / 2, - LayoutUnit::nearlyMax(), LayoutUnit::nearlyMax()); - } - -#ifndef NDEBUG - // Prints the rect to the screen. - void show(bool showRawValue = false) const; -#endif - - private: - LayoutPoint m_location; - LayoutSize m_size; -}; - -inline LayoutRect intersection(const LayoutRect& a, const LayoutRect& b) { - LayoutRect c = a; - c.intersect(b); - return c; -} - -inline LayoutRect unionRect(const LayoutRect& a, const LayoutRect& b) { - LayoutRect c = a; - c.unite(b); - return c; -} - -PLATFORM_EXPORT LayoutRect unionRect(const Vector&); - -ALWAYS_INLINE bool operator==(const LayoutRect& a, const LayoutRect& b) { - return a.location() == b.location() && a.size() == b.size(); -} - -inline bool operator!=(const LayoutRect& a, const LayoutRect& b) { - return a.location() != b.location() || a.size() != b.size(); -} - -inline IntRect pixelSnappedIntRect(const LayoutRect& rect) { - return IntRect(roundedIntPoint(rect.location()), - IntSize(snapSizeToPixel(rect.width(), rect.x()), - snapSizeToPixel(rect.height(), rect.y()))); -} - -PLATFORM_EXPORT IntRect enclosingIntRect(const LayoutRect&); -PLATFORM_EXPORT LayoutRect enclosingLayoutRect(const FloatRect&); - -inline IntRect pixelSnappedIntRect(LayoutUnit left, - LayoutUnit top, - LayoutUnit width, - LayoutUnit height) { - return IntRect(left.round(), top.round(), snapSizeToPixel(width, left), - snapSizeToPixel(height, top)); -} - -inline IntRect pixelSnappedIntRectFromEdges(LayoutUnit left, - LayoutUnit top, - LayoutUnit right, - LayoutUnit bottom) { - return IntRect(left.round(), top.round(), snapSizeToPixel(right - left, left), - snapSizeToPixel(bottom - top, top)); -} - -inline IntRect pixelSnappedIntRect(LayoutPoint location, LayoutSize size) { - return IntRect(roundedIntPoint(location), - pixelSnappedIntSize(size, location)); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTRECT_H_ diff --git a/sky/engine/platform/geometry/LayoutSize.h b/sky/engine/platform/geometry/LayoutSize.h deleted file mode 100644 index c8c5cb0fa4852..0000000000000 --- a/sky/engine/platform/geometry/LayoutSize.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTSIZE_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTSIZE_H_ - -#include "flutter/sky/engine/platform/LayoutUnit.h" -#include "flutter/sky/engine/platform/geometry/FloatSize.h" -#include "flutter/sky/engine/platform/geometry/IntSize.h" - -namespace blink { - -enum AspectRatioFit { AspectRatioFitShrink, AspectRatioFitGrow }; - -class LayoutSize { - public: - LayoutSize() {} - LayoutSize(const IntSize& size) - : m_width(size.width()), m_height(size.height()) {} - LayoutSize(LayoutUnit width, LayoutUnit height) - : m_width(width), m_height(height) {} - - explicit LayoutSize(const FloatSize& size) - : m_width(size.width()), m_height(size.height()) {} - - LayoutUnit width() const { return m_width; } - LayoutUnit height() const { return m_height; } - - void setWidth(LayoutUnit width) { m_width = width; } - void setHeight(LayoutUnit height) { m_height = height; } - - bool isEmpty() const { - return m_width.rawValue() <= 0 || m_height.rawValue() <= 0; - } - bool isZero() const { return !m_width && !m_height; } - - float aspectRatio() const { return m_width.toFloat() / m_height.toFloat(); } - - void expand(LayoutUnit width, LayoutUnit height) { - m_width += width; - m_height += height; - } - - void shrink(LayoutUnit width, LayoutUnit height) { - m_width -= width; - m_height -= height; - } - - void scale(float scale) { - m_width *= scale; - m_height *= scale; - } - - void scale(float widthScale, float heightScale) { - m_width *= widthScale; - m_height *= heightScale; - } - - LayoutSize expandedTo(const LayoutSize& other) const { - return LayoutSize(m_width > other.m_width ? m_width : other.m_width, - m_height > other.m_height ? m_height : other.m_height); - } - - LayoutSize shrunkTo(const LayoutSize& other) const { - return LayoutSize(m_width < other.m_width ? m_width : other.m_width, - m_height < other.m_height ? m_height : other.m_height); - } - - void clampNegativeToZero() { *this = expandedTo(LayoutSize()); } - - void clampToMinimumSize(const LayoutSize& minimumSize) { - if (m_width < minimumSize.width()) - m_width = minimumSize.width(); - if (m_height < minimumSize.height()) - m_height = minimumSize.height(); - } - - LayoutSize transposedSize() const { return LayoutSize(m_height, m_width); } - - LayoutSize fitToAspectRatio(const LayoutSize& aspectRatio, - AspectRatioFit fit) const { - float heightScale = height().toFloat() / aspectRatio.height().toFloat(); - float widthScale = width().toFloat() / aspectRatio.width().toFloat(); - if ((widthScale > heightScale) != (fit == AspectRatioFitGrow)) - return LayoutSize(height() * aspectRatio.width() / aspectRatio.height(), - height()); - return LayoutSize(width(), - width() * aspectRatio.height() / aspectRatio.width()); - } - - LayoutSize fraction() const { - return LayoutSize(m_width.fraction(), m_height.fraction()); - } - - private: - LayoutUnit m_width, m_height; -}; - -inline LayoutSize& operator+=(LayoutSize& a, const LayoutSize& b) { - a.setWidth(a.width() + b.width()); - a.setHeight(a.height() + b.height()); - return a; -} - -inline LayoutSize& operator-=(LayoutSize& a, const LayoutSize& b) { - a.setWidth(a.width() - b.width()); - a.setHeight(a.height() - b.height()); - return a; -} - -inline LayoutSize operator+(const LayoutSize& a, const LayoutSize& b) { - return LayoutSize(a.width() + b.width(), a.height() + b.height()); -} - -inline LayoutSize operator-(const LayoutSize& a, const LayoutSize& b) { - return LayoutSize(a.width() - b.width(), a.height() - b.height()); -} - -inline LayoutSize operator-(const LayoutSize& size) { - return LayoutSize(-size.width(), -size.height()); -} - -inline bool operator==(const LayoutSize& a, const LayoutSize& b) { - return a.width() == b.width() && a.height() == b.height(); -} - -inline bool operator!=(const LayoutSize& a, const LayoutSize& b) { - return a.width() != b.width() || a.height() != b.height(); -} - -inline IntSize flooredIntSize(const LayoutSize& s) { - return IntSize(s.width().floor(), s.height().floor()); -} - -inline IntSize roundedIntSize(const LayoutSize& s) { - return IntSize(s.width().round(), s.height().round()); -} - -inline LayoutSize roundedLayoutSize(const FloatSize& s) { - return LayoutSize(s); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_LAYOUTSIZE_H_ diff --git a/sky/engine/platform/geometry/Region.cpp b/sky/engine/platform/geometry/Region.cpp deleted file mode 100644 index cac9ee883b3ce..0000000000000 --- a/sky/engine/platform/geometry/Region.cpp +++ /dev/null @@ -1,635 +0,0 @@ -/* - * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/Region.h" - -#include - -// A region class based on the paper "Scanline Coherent Shape Algebra" -// by Jonathan E. Steinhart from the book "Graphics Gems II". -// -// This implementation uses two vectors instead of linked list, and -// also compresses regions when possible. - -namespace blink { - -Region::Region() {} - -Region::Region(const IntRect& rect) : m_bounds(rect), m_shape(rect) {} - -Vector Region::rects() const { - Vector rects; - - for (Shape::SpanIterator span = m_shape.spansBegin(), - end = m_shape.spansEnd(); - span != end && span + 1 != end; ++span) { - int y = span->y; - int height = (span + 1)->y - y; - - for (Shape::SegmentIterator segment = m_shape.segmentsBegin(span), - end = m_shape.segmentsEnd(span); - segment != end && segment + 1 != end; segment += 2) { - int x = *segment; - int width = *(segment + 1) - x; - - rects.append(IntRect(x, y, width, height)); - } - } - - return rects; -} - -bool Region::contains(const Region& region) const { - if (!m_bounds.contains(region.m_bounds)) - return false; - - return Shape::compareShapes(m_shape, - region.m_shape); -} - -bool Region::contains(const IntPoint& point) const { - if (!m_bounds.contains(point)) - return false; - - for (Shape::SpanIterator span = m_shape.spansBegin(), - end = m_shape.spansEnd(); - span != end && span + 1 != end; ++span) { - int y = span->y; - int maxY = (span + 1)->y; - - if (y > point.y()) - break; - if (maxY <= point.y()) - continue; - - for (Shape::SegmentIterator segment = m_shape.segmentsBegin(span), - end = m_shape.segmentsEnd(span); - segment != end && segment + 1 != end; segment += 2) { - int x = *segment; - int maxX = *(segment + 1); - - if (x > point.x()) - break; - if (maxX > point.x()) - return true; - } - } - - return false; -} - -bool Region::intersects(const Region& region) const { - if (!m_bounds.intersects(region.m_bounds)) - return false; - - return Shape::compareShapes( - m_shape, region.m_shape); -} - -unsigned Region::totalArea() const { - Vector rects = this->rects(); - size_t size = rects.size(); - unsigned totalArea = 0; - - for (size_t i = 0; i < size; ++i) { - IntRect rect = rects[i]; - totalArea += (rect.width() * rect.height()); - } - - return totalArea; -} - -template -bool Region::Shape::compareShapes(const Shape& aShape, const Shape& bShape) { - bool result = CompareOperation::defaultResult; - - Shape::SpanIterator aSpan = aShape.spansBegin(); - Shape::SpanIterator aSpanEnd = aShape.spansEnd(); - Shape::SpanIterator bSpan = bShape.spansBegin(); - Shape::SpanIterator bSpanEnd = bShape.spansEnd(); - - bool aHadSegmentInPreviousSpan = false; - bool bHadSegmentInPreviousSpan = false; - while (aSpan != aSpanEnd && aSpan + 1 != aSpanEnd && bSpan != bSpanEnd && - bSpan + 1 != bSpanEnd) { - int aY = aSpan->y; - int aMaxY = (aSpan + 1)->y; - int bY = bSpan->y; - int bMaxY = (bSpan + 1)->y; - - Shape::SegmentIterator aSegment = aShape.segmentsBegin(aSpan); - Shape::SegmentIterator aSegmentEnd = aShape.segmentsEnd(aSpan); - Shape::SegmentIterator bSegment = bShape.segmentsBegin(bSpan); - Shape::SegmentIterator bSegmentEnd = bShape.segmentsEnd(bSpan); - - // Look for a non-overlapping part of the spans. If B had a segment in its - // previous span, then we already tested A against B within that span. - bool aHasSegmentInSpan = aSegment != aSegmentEnd; - bool bHasSegmentInSpan = bSegment != bSegmentEnd; - if (aY < bY && !bHadSegmentInPreviousSpan && aHasSegmentInSpan && - CompareOperation::aOutsideB(result)) - return result; - if (bY < aY && !aHadSegmentInPreviousSpan && bHasSegmentInSpan && - CompareOperation::bOutsideA(result)) - return result; - - aHadSegmentInPreviousSpan = aHasSegmentInSpan; - bHadSegmentInPreviousSpan = bHasSegmentInSpan; - - bool spansOverlap = bMaxY > aY && bY < aMaxY; - if (spansOverlap) { - while (aSegment != aSegmentEnd && bSegment != bSegmentEnd) { - int aX = *aSegment; - int aMaxX = *(aSegment + 1); - int bX = *bSegment; - int bMaxX = *(bSegment + 1); - - bool segmentsOverlap = bMaxX > aX && bX < aMaxX; - if (segmentsOverlap && CompareOperation::aOverlapsB(result)) - return result; - if (aX < bX && CompareOperation::aOutsideB(result)) - return result; - if (bX < aX && CompareOperation::bOutsideA(result)) - return result; - - if (aMaxX < bMaxX) { - aSegment += 2; - } else if (bMaxX < aMaxX) { - bSegment += 2; - } else { - aSegment += 2; - bSegment += 2; - } - } - - if (aSegment != aSegmentEnd && CompareOperation::aOutsideB(result)) - return result; - if (bSegment != bSegmentEnd && CompareOperation::bOutsideA(result)) - return result; - } - - if (aMaxY < bMaxY) { - aSpan += 1; - } else if (bMaxY < aMaxY) { - bSpan += 1; - } else { - aSpan += 1; - bSpan += 1; - } - } - - if (aSpan != aSpanEnd && aSpan + 1 != aSpanEnd && - CompareOperation::aOutsideB(result)) - return result; - if (bSpan != bSpanEnd && bSpan + 1 != bSpanEnd && - CompareOperation::bOutsideA(result)) - return result; - - return result; -} - -void Region::Shape::trimCapacities() { - m_segments.shrinkToReasonableCapacity(); - m_spans.shrinkToReasonableCapacity(); -} - -struct Region::Shape::CompareContainsOperation { - const static bool defaultResult = true; - inline static bool aOutsideB(bool& /* result */) { return false; } - inline static bool bOutsideA(bool& result) { - result = false; - return true; - } - inline static bool aOverlapsB(bool& /* result */) { return false; } -}; - -struct Region::Shape::CompareIntersectsOperation { - const static bool defaultResult = false; - inline static bool aOutsideB(bool& /* result */) { return false; } - inline static bool bOutsideA(bool& /* result */) { return false; } - inline static bool aOverlapsB(bool& result) { - result = true; - return true; - } -}; - -Region::Shape::Shape() {} - -Region::Shape::Shape(const IntRect& rect) { - appendSpan(rect.y()); - appendSegment(rect.x()); - appendSegment(rect.maxX()); - appendSpan(rect.maxY()); -} - -Region::Shape::Shape(size_t segmentsCapacity, size_t spansCapacity) { - m_segments.reserveCapacity(segmentsCapacity); - m_spans.reserveCapacity(spansCapacity); -} - -void Region::Shape::appendSpan(int y) { - m_spans.append(Span(y, m_segments.size())); -} - -bool Region::Shape::canCoalesce(SegmentIterator begin, SegmentIterator end) { - if (m_spans.isEmpty()) - return false; - - SegmentIterator lastSpanBegin = - m_segments.data() + m_spans.last().segmentIndex; - SegmentIterator lastSpanEnd = m_segments.data() + m_segments.size(); - - // Check if both spans have an equal number of segments. - if (lastSpanEnd - lastSpanBegin != end - begin) - return false; - - // Check if both spans are equal. - if (!std::equal(begin, end, lastSpanBegin)) - return false; - - // Since the segments are equal the second segment can just be ignored. - return true; -} - -void Region::Shape::appendSpan(int y, - SegmentIterator begin, - SegmentIterator end) { - if (canCoalesce(begin, end)) - return; - - appendSpan(y); - m_segments.appendRange(begin, end); -} - -void Region::Shape::appendSpans(const Shape& shape, - SpanIterator begin, - SpanIterator end) { - for (SpanIterator it = begin; it != end; ++it) - appendSpan(it->y, shape.segmentsBegin(it), shape.segmentsEnd(it)); -} - -void Region::Shape::appendSegment(int x) { - m_segments.append(x); -} - -Region::Shape::SpanIterator Region::Shape::spansBegin() const { - return m_spans.data(); -} - -Region::Shape::SpanIterator Region::Shape::spansEnd() const { - return m_spans.data() + m_spans.size(); -} - -Region::Shape::SegmentIterator Region::Shape::segmentsBegin( - SpanIterator it) const { - ASSERT(it >= m_spans.data()); - ASSERT(it < m_spans.data() + m_spans.size()); - - // Check if this span has any segments. - if (it->segmentIndex == m_segments.size()) - return 0; - - return &m_segments[it->segmentIndex]; -} - -Region::Shape::SegmentIterator Region::Shape::segmentsEnd( - SpanIterator it) const { - ASSERT(it >= m_spans.data()); - ASSERT(it < m_spans.data() + m_spans.size()); - - // Check if this span has any segments. - if (it->segmentIndex == m_segments.size()) - return 0; - - ASSERT(it + 1 < m_spans.data() + m_spans.size()); - size_t segmentIndex = (it + 1)->segmentIndex; - - ASSERT_WITH_SECURITY_IMPLICATION(segmentIndex <= m_segments.size()); - return m_segments.data() + segmentIndex; -} - -#ifndef NDEBUG -void Region::Shape::dump() const { - for (Shape::SpanIterator span = spansBegin(), end = spansEnd(); span != end; - ++span) { - printf("%6d: (", span->y); - - for (Shape::SegmentIterator segment = segmentsBegin(span), - end = segmentsEnd(span); - segment != end; ++segment) - printf("%d ", *segment); - printf(")\n"); - } - - printf("\n"); -} -#endif - -IntRect Region::Shape::bounds() const { - if (isEmpty()) - return IntRect(); - - SpanIterator span = spansBegin(); - int minY = span->y; - - SpanIterator lastSpan = spansEnd() - 1; - int maxY = lastSpan->y; - - int minX = std::numeric_limits::max(); - int maxX = std::numeric_limits::min(); - - while (span != lastSpan) { - SegmentIterator firstSegment = segmentsBegin(span); - SegmentIterator lastSegment = segmentsEnd(span) - 1; - - if (firstSegment && lastSegment) { - ASSERT(firstSegment != lastSegment); - - if (*firstSegment < minX) - minX = *firstSegment; - - if (*lastSegment > maxX) - maxX = *lastSegment; - } - - ++span; - } - - ASSERT(minX <= maxX); - ASSERT(minY <= maxY); - - return IntRect(minX, minY, maxX - minX, maxY - minY); -} - -void Region::Shape::translate(const IntSize& offset) { - for (size_t i = 0; i < m_segments.size(); ++i) - m_segments[i] += offset.width(); - for (size_t i = 0; i < m_spans.size(); ++i) - m_spans[i].y += offset.height(); -} - -void Region::Shape::swap(Shape& other) { - m_segments.swap(other.m_segments); - m_spans.swap(other.m_spans); -} - -enum { - Shape1, - Shape2, -}; - -template -Region::Shape Region::Shape::shapeOperation(const Shape& shape1, - const Shape& shape2) { - COMPILE_ASSERT(!(!Operation::shouldAddRemainingSegmentsFromSpan1 && - Operation::shouldAddRemainingSegmentsFromSpan2), - invalid_segment_combination); - COMPILE_ASSERT(!(!Operation::shouldAddRemainingSpansFromShape1 && - Operation::shouldAddRemainingSpansFromShape2), - invalid_span_combination); - - size_t segmentsCapacity = shape1.segmentsSize() + shape2.segmentsSize(); - size_t spansCapacity = shape1.spansSize() + shape2.spansSize(); - Shape result(segmentsCapacity, spansCapacity); - if (Operation::trySimpleOperation(shape1, shape2, result)) - return result; - - SpanIterator spans1 = shape1.spansBegin(); - SpanIterator spans1End = shape1.spansEnd(); - - SpanIterator spans2 = shape2.spansBegin(); - SpanIterator spans2End = shape2.spansEnd(); - - SegmentIterator segments1 = 0; - SegmentIterator segments1End = 0; - - SegmentIterator segments2 = 0; - SegmentIterator segments2End = 0; - - Vector segments; - segments.reserveCapacity( - std::max(shape1.segmentsSize(), shape2.segmentsSize())); - - // Iterate over all spans. - while (spans1 != spans1End && spans2 != spans2End) { - int y = 0; - int test = spans1->y - spans2->y; - - if (test <= 0) { - y = spans1->y; - - segments1 = shape1.segmentsBegin(spans1); - segments1End = shape1.segmentsEnd(spans1); - ++spans1; - } - if (test >= 0) { - y = spans2->y; - - segments2 = shape2.segmentsBegin(spans2); - segments2End = shape2.segmentsEnd(spans2); - ++spans2; - } - - int flag = 0; - int oldFlag = 0; - - SegmentIterator s1 = segments1; - SegmentIterator s2 = segments2; - - // Clear vector without dropping capacity. - segments.resize(0); - ASSERT(segments.capacity()); - - // Now iterate over the segments in each span and construct a new vector of - // segments. - while (s1 != segments1End && s2 != segments2End) { - int test = *s1 - *s2; - int x; - - if (test <= 0) { - x = *s1; - flag = flag ^ 1; - ++s1; - } - if (test >= 0) { - x = *s2; - flag = flag ^ 2; - ++s2; - } - - if (flag == Operation::opCode || oldFlag == Operation::opCode) - segments.append(x); - - oldFlag = flag; - } - - // Add any remaining segments. - if (Operation::shouldAddRemainingSegmentsFromSpan1 && s1 != segments1End) - segments.appendRange(s1, segments1End); - else if (Operation::shouldAddRemainingSegmentsFromSpan2 && - s2 != segments2End) - segments.appendRange(s2, segments2End); - - // Add the span. - if (!segments.isEmpty() || !result.isEmpty()) - result.appendSpan(y, segments.data(), segments.data() + segments.size()); - } - - // Add any remaining spans. - if (Operation::shouldAddRemainingSpansFromShape1 && spans1 != spans1End) - result.appendSpans(shape1, spans1, spans1End); - else if (Operation::shouldAddRemainingSpansFromShape2 && spans2 != spans2End) - result.appendSpans(shape2, spans2, spans2End); - - result.trimCapacities(); - - return result; -} - -struct Region::Shape::UnionOperation { - static bool trySimpleOperation(const Shape& shape1, - const Shape& shape2, - Shape& result) { - if (shape1.isEmpty()) { - result = shape2; - return true; - } - - return false; - } - - static const int opCode = 0; - - static const bool shouldAddRemainingSegmentsFromSpan1 = true; - static const bool shouldAddRemainingSegmentsFromSpan2 = true; - static const bool shouldAddRemainingSpansFromShape1 = true; - static const bool shouldAddRemainingSpansFromShape2 = true; -}; - -Region::Shape Region::Shape::unionShapes(const Shape& shape1, - const Shape& shape2) { - return shapeOperation(shape1, shape2); -} - -struct Region::Shape::IntersectOperation { - static bool trySimpleOperation(const Shape&, const Shape&, Shape&) { - return false; - } - - static const int opCode = 3; - - static const bool shouldAddRemainingSegmentsFromSpan1 = false; - static const bool shouldAddRemainingSegmentsFromSpan2 = false; - static const bool shouldAddRemainingSpansFromShape1 = false; - static const bool shouldAddRemainingSpansFromShape2 = false; -}; - -Region::Shape Region::Shape::intersectShapes(const Shape& shape1, - const Shape& shape2) { - return shapeOperation(shape1, shape2); -} - -struct Region::Shape::SubtractOperation { - static bool trySimpleOperation(const Shape&, const Shape&, Region::Shape&) { - return false; - } - - static const int opCode = 1; - - static const bool shouldAddRemainingSegmentsFromSpan1 = true; - static const bool shouldAddRemainingSegmentsFromSpan2 = false; - static const bool shouldAddRemainingSpansFromShape1 = true; - static const bool shouldAddRemainingSpansFromShape2 = false; -}; - -Region::Shape Region::Shape::subtractShapes(const Shape& shape1, - const Shape& shape2) { - return shapeOperation(shape1, shape2); -} - -#ifndef NDEBUG -void Region::dump() const { - printf("Bounds: (%d, %d, %d, %d)\n", m_bounds.x(), m_bounds.y(), - m_bounds.width(), m_bounds.height()); - m_shape.dump(); -} -#endif - -void Region::intersect(const Region& region) { - if (m_bounds.isEmpty()) - return; - if (!m_bounds.intersects(region.m_bounds)) { - m_shape = Shape(); - m_bounds = IntRect(); - return; - } - - Shape intersectedShape = Shape::intersectShapes(m_shape, region.m_shape); - - m_shape.swap(intersectedShape); - m_bounds = m_shape.bounds(); -} - -void Region::unite(const Region& region) { - if (region.isEmpty()) - return; - if (isRect() && m_bounds.contains(region.m_bounds)) - return; - if (region.isRect() && region.m_bounds.contains(m_bounds)) { - m_shape = region.m_shape; - m_bounds = region.m_bounds; - return; - } - // FIXME: We may want another way to construct a Region without doing this - // test when we expect it to be false. - if (!isRect() && contains(region)) - return; - - Shape unitedShape = Shape::unionShapes(m_shape, region.m_shape); - - m_shape.swap(unitedShape); - m_bounds.unite(region.m_bounds); -} - -void Region::subtract(const Region& region) { - if (m_bounds.isEmpty()) - return; - if (region.isEmpty()) - return; - if (!m_bounds.intersects(region.m_bounds)) - return; - - Shape subtractedShape = Shape::subtractShapes(m_shape, region.m_shape); - - m_shape.swap(subtractedShape); - m_bounds = m_shape.bounds(); -} - -void Region::translate(const IntSize& offset) { - m_bounds.move(offset); - m_shape.translate(offset); -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/Region.h b/sky/engine/platform/geometry/Region.h deleted file mode 100644 index 323e599f3f247..0000000000000 --- a/sky/engine/platform/geometry/Region.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_REGION_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_REGION_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class PLATFORM_EXPORT Region { - public: - Region(); - Region(const IntRect&); - - IntRect bounds() const { return m_bounds; } - bool isEmpty() const { return m_bounds.isEmpty(); } - bool isRect() const { return m_shape.isRect(); } - - Vector rects() const; - - void unite(const Region&); - void intersect(const Region&); - void subtract(const Region&); - - void translate(const IntSize&); - - // Returns true if the query region is a subset of this region. - bool contains(const Region&) const; - - bool contains(const IntPoint&) const; - - // Returns true if the query region intersects any part of this region. - bool intersects(const Region&) const; - - unsigned totalArea() const; - -#ifndef NDEBUG - void dump() const; -#endif - - private: - struct Span { - Span(int y, size_t segmentIndex) : y(y), segmentIndex(segmentIndex) {} - - int y; - size_t segmentIndex; - }; - - class Shape { - public: - Shape(); - Shape(const IntRect&); - Shape(size_t segmentsCapacity, size_t spansCapacity); - - IntRect bounds() const; - bool isEmpty() const { return m_spans.isEmpty(); } - bool isRect() const { - return m_spans.size() <= 2 && m_segments.size() <= 2; - } - - typedef const Span* SpanIterator; - SpanIterator spansBegin() const; - SpanIterator spansEnd() const; - size_t spansSize() const { return m_spans.size(); } - - typedef const int* SegmentIterator; - SegmentIterator segmentsBegin(SpanIterator) const; - SegmentIterator segmentsEnd(SpanIterator) const; - size_t segmentsSize() const { return m_segments.size(); } - - static Shape unionShapes(const Shape& shape1, const Shape& shape2); - static Shape intersectShapes(const Shape& shape1, const Shape& shape2); - static Shape subtractShapes(const Shape& shape1, const Shape& shape2); - - void translate(const IntSize&); - void swap(Shape&); - - struct CompareContainsOperation; - struct CompareIntersectsOperation; - - template - static bool compareShapes(const Shape& shape1, const Shape& shape2); - void trimCapacities(); - -#ifndef NDEBUG - void dump() const; -#endif - - private: - struct UnionOperation; - struct IntersectOperation; - struct SubtractOperation; - - template - static Shape shapeOperation(const Shape& shape1, const Shape& shape2); - - void appendSegment(int x); - void appendSpan(int y); - void appendSpan(int y, SegmentIterator begin, SegmentIterator end); - void appendSpans(const Shape&, SpanIterator begin, SpanIterator end); - - bool canCoalesce(SegmentIterator begin, SegmentIterator end); - - Vector m_segments; - Vector m_spans; - - friend bool operator==(const Shape&, const Shape&); - }; - - IntRect m_bounds; - Shape m_shape; - - friend bool operator==(const Region&, const Region&); - friend bool operator==(const Shape&, const Shape&); - friend bool operator==(const Span&, const Span&); -}; - -static inline Region intersect(const Region& a, const Region& b) { - Region result(a); - result.intersect(b); - - return result; -} - -static inline Region subtract(const Region& a, const Region& b) { - Region result(a); - result.subtract(b); - - return result; -} - -static inline Region translate(const Region& region, const IntSize& offset) { - Region result(region); - result.translate(offset); - - return result; -} - -inline bool operator==(const Region& a, const Region& b) { - return a.m_bounds == b.m_bounds && a.m_shape == b.m_shape; -} - -inline bool operator==(const Region::Shape& a, const Region::Shape& b) { - return a.m_spans == b.m_spans && a.m_segments == b.m_segments; -} - -inline bool operator==(const Region::Span& a, const Region::Span& b) { - return a.y == b.y && a.segmentIndex == b.segmentIndex; -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_REGION_H_ diff --git a/sky/engine/platform/geometry/RegionTest.cpp b/sky/engine/platform/geometry/RegionTest.cpp deleted file mode 100644 index 6624db7096c07..0000000000000 --- a/sky/engine/platform/geometry/RegionTest.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/Region.h" - -#include - -using namespace blink; - -namespace { - -#define TEST_INSIDE_RECT(r, x, y, w, h) \ - EXPECT_TRUE(r.contains(IntPoint(x, y))); \ - EXPECT_TRUE(r.contains(IntPoint(x + w - 1, y))); \ - EXPECT_TRUE(r.contains(IntPoint(x, y + h - 1))); \ - EXPECT_TRUE(r.contains(IntPoint(x + w - 1, y + h - 1))); \ - EXPECT_TRUE(r.contains(IntPoint(x, y + h / 2))); \ - EXPECT_TRUE(r.contains(IntPoint(x + w - 1, y + h / 2))); \ - EXPECT_TRUE(r.contains(IntPoint(x + w / 2, y))); \ - EXPECT_TRUE(r.contains(IntPoint(x + w / 2, y + h - 1))); \ - EXPECT_TRUE(r.contains(IntPoint(x + w / 2, y + h / 2))); - -#define TEST_LEFT_OF_RECT(r, x, y, w, h) \ - EXPECT_FALSE(r.contains(IntPoint(x - 1, y))); \ - EXPECT_FALSE(r.contains(IntPoint(x - 1, y + h - 1))); - -#define TEST_RIGHT_OF_RECT(r, x, y, w, h) \ - EXPECT_FALSE(r.contains(IntPoint(x + w, y))); \ - EXPECT_FALSE(r.contains(IntPoint(x + w, y + h - 1))); - -#define TEST_TOP_OF_RECT(r, x, y, w, h) \ - EXPECT_FALSE(r.contains(IntPoint(x, y - 1))); \ - EXPECT_FALSE(r.contains(IntPoint(x + w - 1, y - 1))); - -#define TEST_BOTTOM_OF_RECT(r, x, y, w, h) \ - EXPECT_FALSE(r.contains(IntPoint(x, y + h))); \ - EXPECT_FALSE(r.contains(IntPoint(x + w - 1, y + h))); - -TEST(RegionTest, containsPoint) { - Region r; - - EXPECT_FALSE(r.contains(IntPoint(0, 0))); - - r.unite(IntRect(35, 35, 1, 1)); - TEST_INSIDE_RECT(r, 35, 35, 1, 1); - TEST_LEFT_OF_RECT(r, 35, 35, 1, 1); - TEST_RIGHT_OF_RECT(r, 35, 35, 1, 1); - TEST_TOP_OF_RECT(r, 35, 35, 1, 1); - TEST_BOTTOM_OF_RECT(r, 35, 35, 1, 1); - - r.unite(IntRect(30, 30, 10, 10)); - TEST_INSIDE_RECT(r, 30, 30, 10, 10); - TEST_LEFT_OF_RECT(r, 30, 30, 10, 10); - TEST_RIGHT_OF_RECT(r, 30, 30, 10, 10); - TEST_TOP_OF_RECT(r, 30, 30, 10, 10); - TEST_BOTTOM_OF_RECT(r, 30, 30, 10, 10); - - r.unite(IntRect(31, 40, 10, 10)); - EXPECT_FALSE(r.contains(IntPoint(30, 40))); - EXPECT_TRUE(r.contains(IntPoint(31, 40))); - EXPECT_FALSE(r.contains(IntPoint(40, 39))); - EXPECT_TRUE(r.contains(IntPoint(40, 40))); - - TEST_INSIDE_RECT(r, 30, 30, 10, 10); - TEST_LEFT_OF_RECT(r, 30, 30, 10, 10); - TEST_RIGHT_OF_RECT(r, 30, 30, 10, 10); - TEST_TOP_OF_RECT(r, 30, 30, 10, 10); - TEST_INSIDE_RECT(r, 31, 40, 10, 10); - TEST_LEFT_OF_RECT(r, 31, 40, 10, 10); - TEST_RIGHT_OF_RECT(r, 31, 40, 10, 10); - TEST_BOTTOM_OF_RECT(r, 31, 40, 10, 10); - - r.unite(IntRect(42, 40, 10, 10)); - - TEST_INSIDE_RECT(r, 42, 40, 10, 10); - TEST_LEFT_OF_RECT(r, 42, 40, 10, 10); - TEST_RIGHT_OF_RECT(r, 42, 40, 10, 10); - TEST_TOP_OF_RECT(r, 42, 40, 10, 10); - TEST_BOTTOM_OF_RECT(r, 42, 40, 10, 10); - - TEST_INSIDE_RECT(r, 30, 30, 10, 10); - TEST_LEFT_OF_RECT(r, 30, 30, 10, 10); - TEST_RIGHT_OF_RECT(r, 30, 30, 10, 10); - TEST_TOP_OF_RECT(r, 30, 30, 10, 10); - TEST_INSIDE_RECT(r, 31, 40, 10, 10); - TEST_LEFT_OF_RECT(r, 31, 40, 10, 10); - TEST_RIGHT_OF_RECT(r, 31, 40, 10, 10); - TEST_BOTTOM_OF_RECT(r, 31, 40, 10, 10); -} - -TEST(RegionTest, emptySpan) { - Region r; - r.unite(IntRect(5, 0, 10, 10)); - r.unite(IntRect(0, 5, 10, 10)); - r.subtract(IntRect(7, 7, 10, 0)); - - Vector rects = r.rects(); - for (size_t i = 0; i < rects.size(); ++i) - EXPECT_FALSE(rects[i].isEmpty()); -} - -#define TEST_NO_INTERSECT(a, b) \ - { \ - Region ar = a; \ - Region br = b; \ - EXPECT_FALSE(ar.intersects(br)); \ - EXPECT_FALSE(br.intersects(ar)); \ - } - -#define TEST_INTERSECT(a, b) \ - { \ - Region ar = a; \ - Region br = b; \ - EXPECT_TRUE(ar.intersects(br)); \ - EXPECT_TRUE(br.intersects(ar)); \ - } - -TEST(RegionTest, intersectsRegion) { - Region r; - - TEST_NO_INTERSECT(IntRect(), IntRect()); - TEST_NO_INTERSECT(IntRect(), IntRect(0, 0, 1, 1)); - TEST_NO_INTERSECT(IntRect(), IntRect(1, 1, 1, 1)); - - r.unite(IntRect(0, 0, 1, 1)); - TEST_NO_INTERSECT(r, IntRect()); - TEST_INTERSECT(r, IntRect(0, 0, 1, 1)); - TEST_INTERSECT(r, IntRect(0, 0, 2, 2)); - TEST_INTERSECT(r, IntRect(-1, 0, 2, 2)); - TEST_INTERSECT(r, IntRect(-1, -1, 2, 2)); - TEST_INTERSECT(r, IntRect(0, -1, 2, 2)); - TEST_INTERSECT(r, IntRect(-1, -1, 3, 3)); - - r.unite(IntRect(0, 0, 3, 3)); - r.unite(IntRect(10, 0, 3, 3)); - r.unite(IntRect(0, 10, 13, 3)); - TEST_NO_INTERSECT(r, IntRect()); - TEST_INTERSECT(r, IntRect(1, 1, 1, 1)); - TEST_INTERSECT(r, IntRect(0, 0, 2, 2)); - TEST_INTERSECT(r, IntRect(1, 0, 2, 2)); - TEST_INTERSECT(r, IntRect(1, 1, 2, 2)); - TEST_INTERSECT(r, IntRect(0, 1, 2, 2)); - TEST_INTERSECT(r, IntRect(0, 0, 3, 3)); - TEST_INTERSECT(r, IntRect(-1, -1, 2, 2)); - TEST_INTERSECT(r, IntRect(2, -1, 2, 2)); - TEST_INTERSECT(r, IntRect(2, 2, 2, 2)); - TEST_INTERSECT(r, IntRect(-1, 2, 2, 2)); - - TEST_INTERSECT(r, IntRect(11, 1, 1, 1)); - TEST_INTERSECT(r, IntRect(10, 0, 2, 2)); - TEST_INTERSECT(r, IntRect(11, 0, 2, 2)); - TEST_INTERSECT(r, IntRect(11, 1, 2, 2)); - TEST_INTERSECT(r, IntRect(10, 1, 2, 2)); - TEST_INTERSECT(r, IntRect(10, 0, 3, 3)); - TEST_INTERSECT(r, IntRect(9, -1, 2, 2)); - TEST_INTERSECT(r, IntRect(12, -1, 2, 2)); - TEST_INTERSECT(r, IntRect(12, 2, 2, 2)); - TEST_INTERSECT(r, IntRect(9, 2, 2, 2)); - - TEST_INTERSECT(r, IntRect(0, -1, 13, 5)); - TEST_INTERSECT(r, IntRect(1, -1, 11, 5)); - TEST_INTERSECT(r, IntRect(2, -1, 9, 5)); - TEST_INTERSECT(r, IntRect(2, -1, 8, 5)); - TEST_INTERSECT(r, IntRect(3, -1, 8, 5)); - TEST_NO_INTERSECT(r, IntRect(3, -1, 7, 5)); - - TEST_INTERSECT(r, IntRect(0, 1, 13, 1)); - TEST_INTERSECT(r, IntRect(1, 1, 11, 1)); - TEST_INTERSECT(r, IntRect(2, 1, 9, 1)); - TEST_INTERSECT(r, IntRect(2, 1, 8, 1)); - TEST_INTERSECT(r, IntRect(3, 1, 8, 1)); - TEST_NO_INTERSECT(r, IntRect(3, 1, 7, 1)); - - TEST_INTERSECT(r, IntRect(0, 0, 13, 13)); - TEST_INTERSECT(r, IntRect(0, 1, 13, 11)); - TEST_INTERSECT(r, IntRect(0, 2, 13, 9)); - TEST_INTERSECT(r, IntRect(0, 2, 13, 8)); - TEST_INTERSECT(r, IntRect(0, 3, 13, 8)); - TEST_NO_INTERSECT(r, IntRect(0, 3, 13, 7)); -} - -TEST(RegionTest, ReadPastFullSpanVectorInIntersectsTest) { - Region r; - - // This region has enough spans to fill its allocated Vector exactly. - r.unite(IntRect(400, 300, 1, 800)); - r.unite(IntRect(785, 585, 1, 1)); - r.unite(IntRect(787, 585, 1, 1)); - r.unite(IntRect(0, 587, 16, 162)); - r.unite(IntRect(26, 590, 300, 150)); - r.unite(IntRect(196, 750, 1, 1)); - r.unite(IntRect(0, 766, 1, 1)); - r.unite(IntRect(0, 782, 1, 1)); - r.unite(IntRect(745, 798, 1, 1)); - r.unite(IntRect(795, 882, 10, 585)); - r.unite(IntRect(100, 1499, 586, 1)); - r.unite(IntRect(100, 1500, 585, 784)); - // This query rect goes past the bottom of the Region, causing the - // test to reach the last span and try go past it. It should not read - // memory off the end of the span Vector. - TEST_NO_INTERSECT(r, IntRect(0, 2184, 1, 150)); -} - -#define TEST_NO_CONTAINS(a, b) \ - { \ - Region ar = a; \ - Region br = b; \ - EXPECT_FALSE(ar.contains(br)); \ - } - -#define TEST_CONTAINS(a, b) \ - { \ - Region ar = a; \ - Region br = b; \ - EXPECT_TRUE(ar.contains(br)); \ - } - -TEST(RegionTest, containsRegion) { - TEST_CONTAINS(IntRect(), IntRect()); - TEST_NO_CONTAINS(IntRect(), IntRect(0, 0, 1, 1)); - TEST_NO_CONTAINS(IntRect(), IntRect(1, 1, 1, 1)); - - TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(11, 10, 1, 1)); - TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(10, 11, 1, 1)); - TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(9, 10, 1, 1)); - TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(10, 9, 1, 1)); - TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(9, 9, 2, 2)); - TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(10, 9, 2, 2)); - TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(9, 10, 2, 2)); - TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(10, 10, 2, 2)); - TEST_NO_CONTAINS(IntRect(10, 10, 1, 1), IntRect(9, 9, 3, 3)); - - Region hLines; - for (int i = 10; i < 20; i += 2) - hLines.unite(IntRect(i, 10, 1, 10)); - - TEST_CONTAINS(IntRect(10, 10, 9, 10), hLines); - TEST_NO_CONTAINS(IntRect(10, 10, 9, 9), hLines); - TEST_NO_CONTAINS(IntRect(10, 11, 9, 9), hLines); - TEST_NO_CONTAINS(IntRect(10, 10, 8, 10), hLines); - TEST_NO_CONTAINS(IntRect(11, 10, 8, 10), hLines); - - Region vLines; - for (int i = 10; i < 20; i += 2) - vLines.unite(IntRect(10, i, 10, 1)); - - TEST_CONTAINS(IntRect(10, 10, 10, 9), vLines); - TEST_NO_CONTAINS(IntRect(10, 10, 9, 9), vLines); - TEST_NO_CONTAINS(IntRect(11, 10, 9, 9), vLines); - TEST_NO_CONTAINS(IntRect(10, 10, 10, 8), vLines); - TEST_NO_CONTAINS(IntRect(10, 11, 10, 8), vLines); - - Region grid; - for (int i = 10; i < 20; i += 2) - for (int j = 10; j < 20; j += 2) - grid.unite(IntRect(i, j, 1, 1)); - - TEST_CONTAINS(IntRect(10, 10, 9, 9), grid); - TEST_NO_CONTAINS(IntRect(10, 10, 9, 8), grid); - TEST_NO_CONTAINS(IntRect(10, 11, 9, 8), grid); - TEST_NO_CONTAINS(IntRect(10, 10, 8, 9), grid); - TEST_NO_CONTAINS(IntRect(11, 10, 8, 9), grid); - - TEST_CONTAINS(hLines, hLines); - TEST_CONTAINS(vLines, vLines); - TEST_NO_CONTAINS(vLines, hLines); - TEST_NO_CONTAINS(hLines, vLines); - TEST_CONTAINS(grid, grid); - TEST_CONTAINS(hLines, grid); - TEST_CONTAINS(vLines, grid); - TEST_NO_CONTAINS(grid, hLines); - TEST_NO_CONTAINS(grid, vLines); - - for (int i = 10; i < 20; i += 2) - TEST_CONTAINS(hLines, IntRect(i, 10, 1, 10)); - - for (int i = 10; i < 20; i += 2) - TEST_CONTAINS(vLines, IntRect(10, i, 10, 1)); - - for (int i = 10; i < 20; i += 2) - for (int j = 10; j < 20; j += 2) - TEST_CONTAINS(grid, IntRect(i, j, 1, 1)); - - Region container; - container.unite(IntRect(0, 0, 40, 20)); - container.unite(IntRect(0, 20, 41, 20)); - TEST_CONTAINS(container, IntRect(5, 5, 30, 30)); - - container = Region(); - container.unite(IntRect(0, 0, 10, 10)); - container.unite(IntRect(0, 30, 10, 10)); - container.unite(IntRect(30, 30, 10, 10)); - container.unite(IntRect(30, 0, 10, 10)); - TEST_NO_CONTAINS(container, IntRect(5, 5, 30, 30)); - - container = Region(); - container.unite(IntRect(0, 0, 10, 10)); - container.unite(IntRect(0, 30, 10, 10)); - container.unite(IntRect(30, 0, 10, 40)); - TEST_NO_CONTAINS(container, IntRect(5, 5, 30, 30)); - - container = Region(); - container.unite(IntRect(30, 0, 10, 10)); - container.unite(IntRect(30, 30, 10, 10)); - container.unite(IntRect(0, 0, 10, 40)); - TEST_NO_CONTAINS(container, IntRect(5, 5, 30, 30)); - - container = Region(); - container.unite(IntRect(0, 0, 10, 40)); - container.unite(IntRect(30, 0, 10, 40)); - TEST_NO_CONTAINS(container, IntRect(5, 5, 30, 30)); - - container = Region(); - container.unite(IntRect(0, 0, 40, 40)); - TEST_NO_CONTAINS(container, IntRect(10, -1, 20, 10)); - - container = Region(); - container.unite(IntRect(0, 0, 40, 40)); - TEST_NO_CONTAINS(container, IntRect(10, 31, 20, 10)); - - container = Region(); - container.unite(IntRect(0, 0, 40, 20)); - container.unite(IntRect(0, 20, 41, 20)); - TEST_NO_CONTAINS(container, IntRect(-1, 10, 10, 20)); - - container = Region(); - container.unite(IntRect(0, 0, 40, 20)); - container.unite(IntRect(0, 20, 41, 20)); - TEST_NO_CONTAINS(container, IntRect(31, 10, 10, 20)); - - container = Region(); - container.unite(IntRect(0, 0, 40, 40)); - container.subtract(IntRect(0, 20, 60, 0)); - TEST_NO_CONTAINS(container, IntRect(31, 10, 10, 20)); -} - -TEST(RegionTest, unite) { - Region r; - Region r2; - - // A rect uniting a contained rect does not change the region. - r2 = r = IntRect(0, 0, 50, 50); - r2.unite(IntRect(20, 20, 10, 10)); - EXPECT_EQ(r, r2); - - // A rect uniting a containing rect gives back the containing rect. - r = IntRect(0, 0, 50, 50); - r.unite(IntRect(0, 0, 100, 100)); - EXPECT_EQ(Region(IntRect(0, 0, 100, 100)), r); - - // A complex region uniting a contained rect does not change the region. - r = IntRect(0, 0, 50, 50); - r.unite(IntRect(100, 0, 50, 50)); - r2 = r; - r2.unite(IntRect(20, 20, 10, 10)); - EXPECT_EQ(r, r2); - - // A complex region uniting a containing rect gives back the containing rect. - r = IntRect(0, 0, 50, 50); - r.unite(IntRect(100, 0, 50, 50)); - r.unite(IntRect(0, 0, 500, 500)); - EXPECT_EQ(Region(IntRect(0, 0, 500, 500)), r); -} - -} // namespace diff --git a/sky/engine/platform/geometry/RoundedRect.cpp b/sky/engine/platform/geometry/RoundedRect.cpp deleted file mode 100644 index f11958ff494e2..0000000000000 --- a/sky/engine/platform/geometry/RoundedRect.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * Copyright (C) 2013 Xidorn Quan (quanxunzhen@gmail.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/RoundedRect.h" - -#include -#include "flutter/sky/engine/wtf/Assertions.h" - -namespace blink { - -bool RoundedRect::Radii::isZero() const { - return m_topLeft.isZero() && m_topRight.isZero() && m_bottomLeft.isZero() && - m_bottomRight.isZero(); -} - -void RoundedRect::Radii::scale(float factor) { - if (factor == 1) - return; - - // If either radius on a corner becomes zero, reset both radii on that corner. - m_topLeft.scale(factor); - if (!m_topLeft.width() || !m_topLeft.height()) - m_topLeft = IntSize(); - m_topRight.scale(factor); - if (!m_topRight.width() || !m_topRight.height()) - m_topRight = IntSize(); - m_bottomLeft.scale(factor); - if (!m_bottomLeft.width() || !m_bottomLeft.height()) - m_bottomLeft = IntSize(); - m_bottomRight.scale(factor); - if (!m_bottomRight.width() || !m_bottomRight.height()) - m_bottomRight = IntSize(); -} - -void RoundedRect::Radii::expand(int topWidth, - int bottomWidth, - int leftWidth, - int rightWidth) { - if (m_topLeft.width() > 0 && m_topLeft.height() > 0) { - m_topLeft.setWidth(std::max(0, m_topLeft.width() + leftWidth)); - m_topLeft.setHeight(std::max(0, m_topLeft.height() + topWidth)); - } - if (m_topRight.width() > 0 && m_topRight.height() > 0) { - m_topRight.setWidth(std::max(0, m_topRight.width() + rightWidth)); - m_topRight.setHeight(std::max(0, m_topRight.height() + topWidth)); - } - if (m_bottomLeft.width() > 0 && m_bottomLeft.height() > 0) { - m_bottomLeft.setWidth(std::max(0, m_bottomLeft.width() + leftWidth)); - m_bottomLeft.setHeight( - std::max(0, m_bottomLeft.height() + bottomWidth)); - } - if (m_bottomRight.width() > 0 && m_bottomRight.height() > 0) { - m_bottomRight.setWidth( - std::max(0, m_bottomRight.width() + rightWidth)); - m_bottomRight.setHeight( - std::max(0, m_bottomRight.height() + bottomWidth)); - } -} - -void RoundedRect::inflateWithRadii(int size) { - IntRect old = m_rect; - - m_rect.inflate(size); - // Considering the inflation factor of shorter size to scale the radii seems - // appropriate here - float factor; - if (m_rect.width() < m_rect.height()) - factor = old.width() ? (float)m_rect.width() / old.width() : int(0); - else - factor = old.height() ? (float)m_rect.height() / old.height() : int(0); - - m_radii.scale(factor); -} - -void RoundedRect::Radii::includeLogicalEdges(const RoundedRect::Radii& edges, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) { - if (includeLogicalLeftEdge) { - m_bottomLeft = edges.bottomLeft(); - m_topLeft = edges.topLeft(); - } - - if (includeLogicalRightEdge) { - m_topRight = edges.topRight(); - m_bottomRight = edges.bottomRight(); - } -} - -RoundedRect::RoundedRect(int x, int y, int width, int height) - : m_rect(x, y, width, height) {} - -RoundedRect::RoundedRect(const IntRect& rect, const Radii& radii) - : m_rect(rect), m_radii(radii) {} - -RoundedRect::RoundedRect(const IntRect& rect, - const IntSize& topLeft, - const IntSize& topRight, - const IntSize& bottomLeft, - const IntSize& bottomRight) - : m_rect(rect), m_radii(topLeft, topRight, bottomLeft, bottomRight) {} - -IntRect RoundedRect::radiusCenterRect() const { - ASSERT(isRenderable()); - int minX = m_rect.x() + - std::max(m_radii.topLeft().width(), m_radii.bottomLeft().width()); - int minY = m_rect.y() + - std::max(m_radii.topLeft().height(), m_radii.topRight().height()); - int maxX = m_rect.maxX() - std::max(m_radii.topRight().width(), - m_radii.bottomRight().width()); - int maxY = m_rect.maxY() - std::max(m_radii.bottomLeft().height(), - m_radii.bottomRight().height()); - return IntRect(minX, minY, maxX - minX, maxY - minY); -} - -void RoundedRect::includeLogicalEdges(const Radii& edges, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge) { - m_radii.includeLogicalEdges(edges, includeLogicalLeftEdge, - includeLogicalRightEdge); -} - -bool RoundedRect::isRenderable() const { - return m_radii.topLeft().width() + m_radii.topRight().width() <= - m_rect.width() && - m_radii.bottomLeft().width() + m_radii.bottomRight().width() <= - m_rect.width() && - m_radii.topLeft().height() + m_radii.bottomLeft().height() <= - m_rect.height() && - m_radii.topRight().height() + m_radii.bottomRight().height() <= - m_rect.height(); -} - -void RoundedRect::adjustRadii() { - int maxRadiusWidth = - std::max(m_radii.topLeft().width() + m_radii.topRight().width(), - m_radii.bottomLeft().width() + m_radii.bottomRight().width()); - int maxRadiusHeight = - std::max(m_radii.topLeft().height() + m_radii.bottomLeft().height(), - m_radii.topRight().height() + m_radii.bottomRight().height()); - - if (maxRadiusWidth <= 0 || maxRadiusHeight <= 0) { - m_radii.scale(0.0f); - return; - } - float widthRatio = static_cast(m_rect.width()) / maxRadiusWidth; - float heightRatio = static_cast(m_rect.height()) / maxRadiusHeight; - m_radii.scale(widthRatio < heightRatio ? widthRatio : heightRatio); -} - -bool RoundedRect::intersectsQuad(const FloatQuad& quad) const { - FloatRect rect(m_rect); - if (!quad.intersectsRect(rect)) - return false; - - const IntSize& topLeft = m_radii.topLeft(); - if (!topLeft.isEmpty()) { - FloatRect rect(m_rect.x(), m_rect.y(), topLeft.width(), topLeft.height()); - if (quad.intersectsRect(rect)) { - FloatPoint center(m_rect.x() + topLeft.width(), - m_rect.y() + topLeft.height()); - FloatSize size(topLeft.width(), topLeft.height()); - if (!quad.intersectsEllipse(center, size)) - return false; - } - } - - const IntSize& topRight = m_radii.topRight(); - if (!topRight.isEmpty()) { - FloatRect rect(m_rect.maxX() - topRight.width(), m_rect.y(), - topRight.width(), topRight.height()); - if (quad.intersectsRect(rect)) { - FloatPoint center(m_rect.maxX() - topRight.width(), - m_rect.y() + topRight.height()); - FloatSize size(topRight.width(), topRight.height()); - if (!quad.intersectsEllipse(center, size)) - return false; - } - } - - const IntSize& bottomLeft = m_radii.bottomLeft(); - if (!bottomLeft.isEmpty()) { - FloatRect rect(m_rect.x(), m_rect.maxY() - bottomLeft.height(), - bottomLeft.width(), bottomLeft.height()); - if (quad.intersectsRect(rect)) { - FloatPoint center(m_rect.x() + bottomLeft.width(), - m_rect.maxY() - bottomLeft.height()); - FloatSize size(bottomLeft.width(), bottomLeft.height()); - if (!quad.intersectsEllipse(center, size)) - return false; - } - } - - const IntSize& bottomRight = m_radii.bottomRight(); - if (!bottomRight.isEmpty()) { - FloatRect rect(m_rect.maxX() - bottomRight.width(), - m_rect.maxY() - bottomRight.height(), bottomRight.width(), - bottomRight.height()); - if (quad.intersectsRect(rect)) { - FloatPoint center(m_rect.maxX() - bottomRight.width(), - m_rect.maxY() - bottomRight.height()); - FloatSize size(bottomRight.width(), bottomRight.height()); - if (!quad.intersectsEllipse(center, size)) - return false; - } - } - - return true; -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/RoundedRect.h b/sky/engine/platform/geometry/RoundedRect.h deleted file mode 100644 index 6bdf4ae8167f6..0000000000000 --- a/sky/engine/platform/geometry/RoundedRect.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_ROUNDEDRECT_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_ROUNDEDRECT_H_ - -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" - -namespace blink { - -// This class is used to represent rectangles with rounded corners. It is only -// used for painting. It uses integer units because using layout units leads to -// blurry rounded corners. -class PLATFORM_EXPORT RoundedRect { - public: - class PLATFORM_EXPORT Radii { - public: - Radii() {} - Radii(const IntSize& topLeft, - const IntSize& topRight, - const IntSize& bottomLeft, - const IntSize& bottomRight) - : m_topLeft(topLeft), - m_topRight(topRight), - m_bottomLeft(bottomLeft), - m_bottomRight(bottomRight) {} - - void setTopLeft(const IntSize& size) { m_topLeft = size; } - void setTopRight(const IntSize& size) { m_topRight = size; } - void setBottomLeft(const IntSize& size) { m_bottomLeft = size; } - void setBottomRight(const IntSize& size) { m_bottomRight = size; } - const IntSize& topLeft() const { return m_topLeft; } - const IntSize& topRight() const { return m_topRight; } - const IntSize& bottomLeft() const { return m_bottomLeft; } - const IntSize& bottomRight() const { return m_bottomRight; } - - bool isZero() const; - - void includeLogicalEdges(const Radii& edges, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge); - - void scale(float factor); - void expand(int topWidth, int bottomWidth, int leftWidth, int rightWidth); - void expand(int size) { expand(size, size, size, size); } - void shrink(int topWidth, int bottomWidth, int leftWidth, int rightWidth) { - expand(-topWidth, -bottomWidth, -leftWidth, -rightWidth); - } - void shrink(int size) { shrink(size, size, size, size); } - - private: - IntSize m_topLeft; - IntSize m_topRight; - IntSize m_bottomLeft; - IntSize m_bottomRight; - }; - - explicit RoundedRect(const IntRect&, const Radii& = Radii()); - RoundedRect(int x, int y, int width, int height); - RoundedRect(const IntRect&, - const IntSize& topLeft, - const IntSize& topRight, - const IntSize& bottomLeft, - const IntSize& bottomRight); - - const IntRect& rect() const { return m_rect; } - const Radii& radii() const { return m_radii; } - bool isRounded() const { return !m_radii.isZero(); } - bool isEmpty() const { return m_rect.isEmpty(); } - - // Returns a quickly computed rect enclosed by the rounded rect. - IntRect radiusCenterRect() const; - - void setRect(const IntRect& rect) { m_rect = rect; } - void setRadii(const Radii& radii) { m_radii = radii; } - - void move(const IntSize& size) { m_rect.move(size); } - void inflate(int size) { m_rect.inflate(size); } - void inflateWithRadii(int size); - void expandRadii(int size) { m_radii.expand(size); } - void shrinkRadii(int size) { m_radii.shrink(size); } - - void includeLogicalEdges(const Radii& edges, - bool includeLogicalLeftEdge, - bool includeLogicalRightEdge); - - bool isRenderable() const; - void adjustRadii(); - - // Tests whether the quad intersects any part of this rounded rectangle. - // This only works for convex quads. - bool intersectsQuad(const FloatQuad&) const; - - private: - IntRect m_rect; - Radii m_radii; -}; - -inline bool operator==(const RoundedRect::Radii& a, - const RoundedRect::Radii& b) { - return a.topLeft() == b.topLeft() && a.topRight() == b.topRight() && - a.bottomLeft() == b.bottomLeft() && a.bottomRight() == b.bottomRight(); -} - -inline bool operator!=(const RoundedRect::Radii& a, - const RoundedRect::Radii& b) { - return !(a == b); -} - -inline bool operator==(const RoundedRect& a, const RoundedRect& b) { - return a.rect() == b.rect() && a.radii() == b.radii(); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_ROUNDEDRECT_H_ diff --git a/sky/engine/platform/geometry/RoundedRectTest.cpp b/sky/engine/platform/geometry/RoundedRectTest.cpp deleted file mode 100644 index 80bc7bbf253d7..0000000000000 --- a/sky/engine/platform/geometry/RoundedRectTest.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/RoundedRect.h" - -#include -#include "flutter/sky/engine/platform/geometry/IntRect.h" - -using namespace blink; - -namespace blink { - -// FIXME: Move this somewhere more generic. -void PrintTo(const IntRect& rect, std::ostream* os) { - *os << "IntRect(" << rect.x() << ", " << rect.y() << ", " << rect.width() - << ", " << rect.height() << ")"; -} - -} // namespace blink - -namespace { - -TEST(RoundedRectTest, RadiusCenterRectZeroRadius) { - RoundedRect rr(100, 200, 300, 400); - EXPECT_TRUE(rr.rect().contains(rr.radiusCenterRect())); - EXPECT_EQ(IntRect(100, 200, 300, 400), rr.radiusCenterRect()); -} - -TEST(RoundedRectTest, RadiusCenterRectEqualRadius) { - RoundedRect rr(IntRect(100, 200, 300, 400), IntSize(10, 10), IntSize(10, 10), - IntSize(10, 10), IntSize(10, 10)); - EXPECT_TRUE(rr.rect().contains(rr.radiusCenterRect())); - EXPECT_EQ(IntRect(110, 210, 280, 380), rr.radiusCenterRect()); -} - -TEST(RoundedRectTest, RadiusCenterRectUnequalRadius) { - RoundedRect rr(IntRect(100, 200, 300, 400), IntSize(5, 5), IntSize(10, 10), - IntSize(15, 15), IntSize(20, 20)); - EXPECT_TRUE(rr.rect().contains(rr.radiusCenterRect())); - EXPECT_EQ(IntRect(115, 210, 265, 370), rr.radiusCenterRect()); -} - -TEST(RoundedRectTest, RadiusCenterRectElliptical) { - RoundedRect rr(IntRect(100, 200, 300, 400), IntSize(20, 10), IntSize(20, 10), - IntSize(10, 20), IntSize(10, 20)); - EXPECT_TRUE(rr.rect().contains(rr.radiusCenterRect())); - EXPECT_EQ(IntRect(120, 210, 260, 370), rr.radiusCenterRect()); -} - -} // namespace diff --git a/sky/engine/platform/geometry/TransformState.cpp b/sky/engine/platform/geometry/TransformState.cpp deleted file mode 100644 index 32fe3e7dbce4e..0000000000000 --- a/sky/engine/platform/geometry/TransformState.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/geometry/TransformState.h" - -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -namespace blink { - -TransformState& TransformState::operator=(const TransformState& other) { - m_accumulatedOffset = other.m_accumulatedOffset; - m_mapPoint = other.m_mapPoint; - m_mapQuad = other.m_mapQuad; - if (m_mapPoint) - m_lastPlanarPoint = other.m_lastPlanarPoint; - if (m_mapQuad) - m_lastPlanarQuad = other.m_lastPlanarQuad; - m_accumulatingTransform = other.m_accumulatingTransform; - m_direction = other.m_direction; - - m_accumulatedTransform.clear(); - - if (other.m_accumulatedTransform) - m_accumulatedTransform = - adoptPtr(new TransformationMatrix(*other.m_accumulatedTransform)); - - return *this; -} - -void TransformState::translateTransform(const LayoutSize& offset) { - if (m_direction == ApplyTransformDirection) - m_accumulatedTransform->translateRight(offset.width().toDouble(), - offset.height().toDouble()); - else - m_accumulatedTransform->translate(offset.width().toDouble(), - offset.height().toDouble()); -} - -void TransformState::translateMappedCoordinates(const LayoutSize& offset) { - LayoutSize adjustedOffset = - (m_direction == ApplyTransformDirection) ? offset : -offset; - if (m_mapPoint) - m_lastPlanarPoint.move(adjustedOffset); - if (m_mapQuad) - m_lastPlanarQuad.move(adjustedOffset); -} - -void TransformState::move(const LayoutSize& offset, - TransformAccumulation accumulate) { - if (accumulate == FlattenTransform || !m_accumulatedTransform) { - m_accumulatedOffset += offset; - } else { - applyAccumulatedOffset(); - if (m_accumulatingTransform && m_accumulatedTransform) { - // If we're accumulating into an existing transform, apply the - // translation. - translateTransform(offset); - - // Then flatten if necessary. - if (accumulate == FlattenTransform) - flatten(); - } else { - // Just move the point and/or quad. - translateMappedCoordinates(offset); - } - } - m_accumulatingTransform = accumulate == AccumulateTransform; -} - -void TransformState::applyAccumulatedOffset() { - LayoutSize offset = m_accumulatedOffset; - m_accumulatedOffset = LayoutSize(); - if (!offset.isZero()) { - if (m_accumulatedTransform) { - translateTransform(offset); - flatten(); - } else { - translateMappedCoordinates(offset); - } - } -} - -// FIXME: We transform AffineTransform to TransformationMatrix. This is rather -// inefficient. -void TransformState::applyTransform( - const AffineTransform& transformFromContainer, - TransformAccumulation accumulate, - bool* wasClamped) { - applyTransform(transformFromContainer.toTransformationMatrix(), accumulate, - wasClamped); -} - -void TransformState::applyTransform( - const TransformationMatrix& transformFromContainer, - TransformAccumulation accumulate, - bool* wasClamped) { - if (wasClamped) - *wasClamped = false; - - if (transformFromContainer.isIntegerTranslation()) { - move(LayoutSize(transformFromContainer.e(), transformFromContainer.f()), - accumulate); - return; - } - - applyAccumulatedOffset(); - - // If we have an accumulated transform from last time, multiply in this - // transform - if (m_accumulatedTransform) { - if (m_direction == ApplyTransformDirection) - m_accumulatedTransform = adoptPtr(new TransformationMatrix( - transformFromContainer * *m_accumulatedTransform)); - else - m_accumulatedTransform->multiply(transformFromContainer); - } else if (accumulate == AccumulateTransform) { - // Make one if we started to accumulate - m_accumulatedTransform = - adoptPtr(new TransformationMatrix(transformFromContainer)); - } - - if (accumulate == FlattenTransform) { - const TransformationMatrix* finalTransform = - m_accumulatedTransform ? m_accumulatedTransform.get() - : &transformFromContainer; - flattenWithTransform(*finalTransform, wasClamped); - } - m_accumulatingTransform = accumulate == AccumulateTransform; -} - -void TransformState::flatten(bool* wasClamped) { - if (wasClamped) - *wasClamped = false; - - applyAccumulatedOffset(); - - if (!m_accumulatedTransform) { - m_accumulatingTransform = false; - return; - } - - flattenWithTransform(*m_accumulatedTransform, wasClamped); -} - -FloatPoint TransformState::mappedPoint(bool* wasClamped) const { - if (wasClamped) - *wasClamped = false; - - FloatPoint point = m_lastPlanarPoint; - point.move((m_direction == ApplyTransformDirection) ? m_accumulatedOffset - : -m_accumulatedOffset); - if (!m_accumulatedTransform) - return point; - - if (m_direction == ApplyTransformDirection) - return m_accumulatedTransform->mapPoint(point); - - return m_accumulatedTransform->inverse().projectPoint(point, wasClamped); -} - -FloatQuad TransformState::mappedQuad(bool* wasClamped) const { - if (wasClamped) - *wasClamped = false; - - FloatQuad quad = m_lastPlanarQuad; - quad.move((m_direction == ApplyTransformDirection) ? m_accumulatedOffset - : -m_accumulatedOffset); - if (!m_accumulatedTransform) - return quad; - - if (m_direction == ApplyTransformDirection) - return m_accumulatedTransform->mapQuad(quad); - - return m_accumulatedTransform->inverse().projectQuad(quad, wasClamped); -} - -void TransformState::flattenWithTransform(const TransformationMatrix& t, - bool* wasClamped) { - if (m_direction == ApplyTransformDirection) { - if (m_mapPoint) - m_lastPlanarPoint = t.mapPoint(m_lastPlanarPoint); - if (m_mapQuad) - m_lastPlanarQuad = t.mapQuad(m_lastPlanarQuad); - } else { - TransformationMatrix inverseTransform = t.inverse(); - if (m_mapPoint) - m_lastPlanarPoint = inverseTransform.projectPoint(m_lastPlanarPoint); - if (m_mapQuad) - m_lastPlanarQuad = - inverseTransform.projectQuad(m_lastPlanarQuad, wasClamped); - } - - // We could throw away m_accumulatedTransform if we wanted to here, but that - // would cause thrash when traversing hierarchies with alternating - // preserve-3d and flat elements. - if (m_accumulatedTransform) - m_accumulatedTransform->makeIdentity(); - m_accumulatingTransform = false; -} - -} // namespace blink diff --git a/sky/engine/platform/geometry/TransformState.h b/sky/engine/platform/geometry/TransformState.h deleted file mode 100644 index 653c0b4bdc290..0000000000000 --- a/sky/engine/platform/geometry/TransformState.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GEOMETRY_TRANSFORMSTATE_H_ -#define SKY_ENGINE_PLATFORM_GEOMETRY_TRANSFORMSTATE_H_ - -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/IntSize.h" -#include "flutter/sky/engine/platform/geometry/LayoutSize.h" -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" - -namespace blink { - -class PLATFORM_EXPORT TransformState { - public: - enum TransformDirection { - ApplyTransformDirection, - UnapplyInverseTransformDirection - }; - enum TransformAccumulation { FlattenTransform, AccumulateTransform }; - - TransformState(TransformDirection mappingDirection, - const FloatPoint& p, - const FloatQuad& quad) - : m_lastPlanarPoint(p), - m_lastPlanarQuad(quad), - m_accumulatingTransform(false), - m_mapPoint(true), - m_mapQuad(true), - m_direction(mappingDirection) {} - - TransformState(TransformDirection mappingDirection, const FloatPoint& p) - : m_lastPlanarPoint(p), - m_accumulatingTransform(false), - m_mapPoint(true), - m_mapQuad(false), - m_direction(mappingDirection) {} - - TransformState(TransformDirection mappingDirection, const FloatQuad& quad) - : m_lastPlanarQuad(quad), - m_accumulatingTransform(false), - m_mapPoint(false), - m_mapQuad(true), - m_direction(mappingDirection) {} - - TransformState(const TransformState& other) { *this = other; } - - TransformState& operator=(const TransformState&); - - void setQuad(const FloatQuad& quad) { - // FIXME: this assumes that the quad being added is in the coordinate system - // of the current state. This breaks if we're simultaneously mapping a - // point. https://bugs.webkit.org/show_bug.cgi?id=106680 - ASSERT(!m_mapPoint); - m_accumulatedOffset = LayoutSize(); - m_lastPlanarQuad = quad; - } - - void move(LayoutUnit x, - LayoutUnit y, - TransformAccumulation accumulate = FlattenTransform) { - move(LayoutSize(x, y), accumulate); - } - - void move(const LayoutSize&, TransformAccumulation = FlattenTransform); - void applyTransform(const AffineTransform& transformFromContainer, - TransformAccumulation = FlattenTransform, - bool* wasClamped = 0); - void applyTransform(const TransformationMatrix& transformFromContainer, - TransformAccumulation = FlattenTransform, - bool* wasClamped = 0); - void flatten(bool* wasClamped = 0); - - // Return the coords of the point or quad in the last flattened layer - FloatPoint lastPlanarPoint() const { return m_lastPlanarPoint; } - FloatQuad lastPlanarQuad() const { return m_lastPlanarQuad; } - - // Return the point or quad mapped through the current transform - FloatPoint mappedPoint(bool* wasClamped = 0) const; - FloatQuad mappedQuad(bool* wasClamped = 0) const; - - private: - void translateTransform(const LayoutSize&); - void translateMappedCoordinates(const LayoutSize&); - void flattenWithTransform(const TransformationMatrix&, bool* wasClamped); - void applyAccumulatedOffset(); - - FloatPoint m_lastPlanarPoint; - FloatQuad m_lastPlanarQuad; - - // We only allocate the transform if we need to - OwnPtr m_accumulatedTransform; - LayoutSize m_accumulatedOffset; - bool m_accumulatingTransform; - bool m_mapPoint, m_mapQuad; - TransformDirection m_direction; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GEOMETRY_TRANSFORMSTATE_H_ diff --git a/sky/engine/platform/graphics/Color.cpp b/sky/engine/platform/graphics/Color.cpp deleted file mode 100644 index 150ebfc199af4..0000000000000 --- a/sky/engine/platform/graphics/Color.cpp +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/Color.h" - -#include "flutter/sky/engine/platform/Decimal.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/HexNumber.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/dtoa.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" - -namespace blink { - -// FIXME: Use C++11 strong enums to avoid static data member with initializer -// definition problems. -const RGBA32 Color::black; -const RGBA32 Color::white; -const RGBA32 Color::darkGray; -const RGBA32 Color::gray; -const RGBA32 Color::lightGray; -const RGBA32 Color::transparent; - -static const RGBA32 lightenedBlack = 0xFF545454; -static const RGBA32 darkenedWhite = 0xFFABABAB; - -RGBA32 makeRGB(int r, int g, int b) { - return 0xFF000000 | std::max(0, std::min(r, 255)) << 16 | - std::max(0, std::min(g, 255)) << 8 | std::max(0, std::min(b, 255)); -} - -RGBA32 makeRGBA(int r, int g, int b, int a) { - return std::max(0, std::min(a, 255)) << 24 | - std::max(0, std::min(r, 255)) << 16 | - std::max(0, std::min(g, 255)) << 8 | std::max(0, std::min(b, 255)); -} - -static int colorFloatToRGBAByte(float f) { - // We use lroundf and 255 instead of nextafterf(256, 0) to match CG's rounding - return std::max(0, std::min(static_cast(lroundf(255.0f * f)), 255)); -} - -RGBA32 makeRGBA32FromFloats(float r, float g, float b, float a) { - return colorFloatToRGBAByte(a) << 24 | colorFloatToRGBAByte(r) << 16 | - colorFloatToRGBAByte(g) << 8 | colorFloatToRGBAByte(b); -} - -RGBA32 colorWithOverrideAlpha(RGBA32 color, float overrideAlpha) { - RGBA32 rgbOnly = color & 0x00FFFFFF; - RGBA32 rgba = rgbOnly | colorFloatToRGBAByte(overrideAlpha) << 24; - return rgba; -} - -static double calcHue(double temp1, double temp2, double hueVal) { - if (hueVal < 0.0) - hueVal++; - else if (hueVal > 1.0) - hueVal--; - if (hueVal * 6.0 < 1.0) - return temp1 + (temp2 - temp1) * hueVal * 6.0; - if (hueVal * 2.0 < 1.0) - return temp2; - if (hueVal * 3.0 < 2.0) - return temp1 + (temp2 - temp1) * (2.0 / 3.0 - hueVal) * 6.0; - return temp1; -} - -// Explanation of this algorithm can be found in the CSS3 Color Module -// specification at http://www.w3.org/TR/css3-color/#hsl-color with further -// explanation available at http://en.wikipedia.org/wiki/HSL_color_space - -// all values are in the range of 0 to 1.0 -RGBA32 makeRGBAFromHSLA(double hue, - double saturation, - double lightness, - double alpha) { - const double scaleFactor = nextafter(256.0, 0.0); - - if (!saturation) { - int greyValue = static_cast(lightness * scaleFactor); - return makeRGBA(greyValue, greyValue, greyValue, - static_cast(alpha * scaleFactor)); - } - - double temp2 = lightness < 0.5 - ? lightness * (1.0 + saturation) - : lightness + saturation - lightness * saturation; - double temp1 = 2.0 * lightness - temp2; - - return makeRGBA( - static_cast(calcHue(temp1, temp2, hue + 1.0 / 3.0) * scaleFactor), - static_cast(calcHue(temp1, temp2, hue) * scaleFactor), - static_cast(calcHue(temp1, temp2, hue - 1.0 / 3.0) * scaleFactor), - static_cast(alpha * scaleFactor)); -} - -RGBA32 makeRGBAFromCMYKA(float c, float m, float y, float k, float a) { - double colors = 1 - k; - int r = static_cast(nextafter(256, 0) * (colors * (1 - c))); - int g = static_cast(nextafter(256, 0) * (colors * (1 - m))); - int b = static_cast(nextafter(256, 0) * (colors * (1 - y))); - return makeRGBA(r, g, b, static_cast(nextafter(256, 0) * a)); -} - -// originally moved here from the CSS parser -template -static inline bool parseHexColorInternal(const CharacterType* name, - unsigned length, - RGBA32& rgb) { - if (length != 3 && length != 6) - return false; - unsigned value = 0; - for (unsigned i = 0; i < length; ++i) { - if (!isASCIIHexDigit(name[i])) - return false; - value <<= 4; - value |= toASCIIHexValue(name[i]); - } - if (length == 6) { - rgb = 0xFF000000 | value; - return true; - } - // #abc converts to #aabbcc - rgb = 0xFF000000 | (value & 0xF00) << 12 | (value & 0xF00) << 8 | - (value & 0xF0) << 8 | (value & 0xF0) << 4 | (value & 0xF) << 4 | - (value & 0xF); - return true; -} - -bool Color::parseHexColor(const LChar* name, unsigned length, RGBA32& rgb) { - return parseHexColorInternal(name, length, rgb); -} - -bool Color::parseHexColor(const UChar* name, unsigned length, RGBA32& rgb) { - return parseHexColorInternal(name, length, rgb); -} - -bool Color::parseHexColor(const String& name, RGBA32& rgb) { - unsigned length = name.length(); - - if (!length) - return false; - if (name.is8Bit()) - return parseHexColor(name.characters8(), name.length(), rgb); - return parseHexColor(name.characters16(), name.length(), rgb); -} - -String Color::serializedAsCSSComponentValue() const { - StringBuilder result; - result.reserveCapacity(32); - bool colorHasAlpha = hasAlpha(); - if (colorHasAlpha) - result.appendLiteral("rgba("); - else - result.appendLiteral("rgb("); - - result.appendNumber(static_cast(red())); - result.appendLiteral(", "); - - result.appendNumber(static_cast(green())); - result.appendLiteral(", "); - - result.appendNumber(static_cast(blue())); - if (colorHasAlpha) { - result.appendLiteral(", "); - - NumberToStringBuffer buffer; - const char* alphaString = - numberToFixedPrecisionString(alpha() / 255.0f, 6, buffer, true); - result.append(alphaString, strlen(alphaString)); - } - - result.append(')'); - return result.toString(); -} - -String Color::serialized() const { - if (!hasAlpha()) { - StringBuilder builder; - builder.reserveCapacity(7); - builder.append('#'); - appendByteAsHex(red(), builder, Lowercase); - appendByteAsHex(green(), builder, Lowercase); - appendByteAsHex(blue(), builder, Lowercase); - return builder.toString(); - } - - StringBuilder result; - result.reserveCapacity(28); - - result.appendLiteral("rgba("); - result.appendNumber(red()); - result.appendLiteral(", "); - result.appendNumber(green()); - result.appendLiteral(", "); - result.appendNumber(blue()); - result.appendLiteral(", "); - - if (!alpha()) - result.append('0'); - else { - result.append(Decimal::fromDouble(alpha() / 255.0).toString()); - } - - result.append(')'); - return result.toString(); -} - -String Color::nameForRenderTreeAsText() const { - if (alpha() < 0xFF) - return String::format("#%02X%02X%02X%02X", red(), green(), blue(), alpha()); - return String::format("#%02X%02X%02X", red(), green(), blue()); -} - -Color Color::light() const { - // Hardcode this common case for speed. - if (m_color == black) - return lightenedBlack; - - const float scaleFactor = nextafterf(256.0f, 0.0f); - - float r, g, b, a; - getRGBA(r, g, b, a); - - float v = std::max(r, std::max(g, b)); - - if (v == 0.0f) - // Lightened black with alpha. - return Color(0x54, 0x54, 0x54, alpha()); - - float multiplier = std::min(1.0f, v + 0.33f) / v; - - return Color(static_cast(multiplier * r * scaleFactor), - static_cast(multiplier * g * scaleFactor), - static_cast(multiplier * b * scaleFactor), alpha()); -} - -Color Color::dark() const { - // Hardcode this common case for speed. - if (m_color == white) - return darkenedWhite; - - const float scaleFactor = nextafterf(256.0f, 0.0f); - - float r, g, b, a; - getRGBA(r, g, b, a); - - float v = std::max(r, std::max(g, b)); - float multiplier = std::max(0.0f, (v - 0.33f) / v); - - return Color(static_cast(multiplier * r * scaleFactor), - static_cast(multiplier * g * scaleFactor), - static_cast(multiplier * b * scaleFactor), alpha()); -} - -Color Color::combineWithAlpha(float otherAlpha) const { - return colorWithOverrideAlpha(rgb(), (alpha() / 255.f) * otherAlpha); -} - -static int blendComponent(int c, int a) { - // We use white. - float alpha = a / 255.0f; - int whiteBlend = 255 - a; - c -= whiteBlend; - return static_cast(c / alpha); -} - -const int cStartAlpha = 153; // 60% -const int cEndAlpha = 204; // 80%; -const int cAlphaIncrement = 17; // Increments in between. - -Color Color::blend(const Color& source) const { - if (!alpha() || !source.hasAlpha()) - return source; - - if (!source.alpha()) - return *this; - - int d = 255 * (alpha() + source.alpha()) - alpha() * source.alpha(); - int a = d / 255; - int r = (red() * alpha() * (255 - source.alpha()) + - 255 * source.alpha() * source.red()) / - d; - int g = (green() * alpha() * (255 - source.alpha()) + - 255 * source.alpha() * source.green()) / - d; - int b = (blue() * alpha() * (255 - source.alpha()) + - 255 * source.alpha() * source.blue()) / - d; - return Color(r, g, b, a); -} - -Color Color::blendWithWhite() const { - // If the color contains alpha already, we leave it alone. - if (hasAlpha()) - return *this; - - Color newColor; - for (int alpha = cStartAlpha; alpha <= cEndAlpha; alpha += cAlphaIncrement) { - // We have a solid color. Convert to an equivalent color that looks the - // same when blended with white at the current alpha. Try using less - // transparency if the numbers end up being negative. - int r = blendComponent(red(), alpha); - int g = blendComponent(green(), alpha); - int b = blendComponent(blue(), alpha); - - newColor = Color(r, g, b, alpha); - - if (r >= 0 && g >= 0 && b >= 0) - break; - } - return newColor; -} - -void Color::getRGBA(float& r, float& g, float& b, float& a) const { - r = red() / 255.0f; - g = green() / 255.0f; - b = blue() / 255.0f; - a = alpha() / 255.0f; -} - -void Color::getRGBA(double& r, double& g, double& b, double& a) const { - r = red() / 255.0; - g = green() / 255.0; - b = blue() / 255.0; - a = alpha() / 255.0; -} - -void Color::getHSL(double& hue, double& saturation, double& lightness) const { - // http://en.wikipedia.org/wiki/HSL_color_space. This is a direct copy of - // the algorithm therein, although it's 360^o based and we end up wanting - // [0...1) based. It's clearer if we stick to 360^o until the end. - double r = static_cast(red()) / 255.0; - double g = static_cast(green()) / 255.0; - double b = static_cast(blue()) / 255.0; - double max = std::max(std::max(r, g), b); - double min = std::min(std::min(r, g), b); - - if (max == min) - hue = 0.0; - else if (max == r) - hue = (60.0 * ((g - b) / (max - min))) + 360.0; - else if (max == g) - hue = (60.0 * ((b - r) / (max - min))) + 120.0; - else - hue = (60.0 * ((r - g) / (max - min))) + 240.0; - - if (hue >= 360.0) - hue -= 360.0; - - // makeRGBAFromHSLA assumes that hue is in [0...1). - hue /= 360.0; - - lightness = 0.5 * (max + min); - if (max == min) - saturation = 0.0; - else if (lightness <= 0.5) - saturation = ((max - min) / (max + min)); - else - saturation = ((max - min) / (2.0 - (max + min))); -} - -Color colorFromPremultipliedARGB(RGBA32 pixelColor) { - int alpha = alphaChannel(pixelColor); - if (alpha && alpha < 255) { - return Color::createUnchecked(redChannel(pixelColor) * 255 / alpha, - greenChannel(pixelColor) * 255 / alpha, - blueChannel(pixelColor) * 255 / alpha, alpha); - } else - return Color(pixelColor); -} - -RGBA32 premultipliedARGBFromColor(const Color& color) { - unsigned pixelColor; - - unsigned alpha = color.alpha(); - if (alpha < 255) { - pixelColor = - Color::createUnchecked((color.red() * alpha + 254) / 255, - (color.green() * alpha + 254) / 255, - (color.blue() * alpha + 254) / 255, alpha) - .rgb(); - } else - pixelColor = color.rgb(); - - return pixelColor; -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/Color.h b/sky/engine/platform/graphics/Color.h deleted file mode 100644 index a0e2f130053e3..0000000000000 --- a/sky/engine/platform/graphics/Color.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_COLOR_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_COLOR_H_ - -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -class Color; - -typedef unsigned RGBA32; // RGBA quadruplet - -PLATFORM_EXPORT RGBA32 makeRGB(int r, int g, int b); -PLATFORM_EXPORT RGBA32 makeRGBA(int r, int g, int b, int a); - -PLATFORM_EXPORT RGBA32 colorWithOverrideAlpha(RGBA32 color, - float overrideAlpha); -PLATFORM_EXPORT RGBA32 makeRGBA32FromFloats(float r, float g, float b, float a); -PLATFORM_EXPORT RGBA32 makeRGBAFromHSLA(double h, double s, double l, double a); -PLATFORM_EXPORT RGBA32 -makeRGBAFromCMYKA(float c, float m, float y, float k, float a); - -inline int redChannel(RGBA32 color) { - return (color >> 16) & 0xFF; -} -inline int greenChannel(RGBA32 color) { - return (color >> 8) & 0xFF; -} -inline int blueChannel(RGBA32 color) { - return color & 0xFF; -} -inline int alphaChannel(RGBA32 color) { - return (color >> 24) & 0xFF; -} - -class PLATFORM_EXPORT Color { - WTF_MAKE_FAST_ALLOCATED; - - public: - Color() : m_color(Color::transparent) {} - Color(RGBA32 color) : m_color(color) {} - Color(int r, int g, int b) : m_color(makeRGB(r, g, b)) {} - Color(int r, int g, int b, int a) : m_color(makeRGBA(r, g, b, a)) {} - // Color is currently limited to 32bit RGBA, perhaps some day we'll support - // better colors - Color(float r, float g, float b, float a) - : m_color(makeRGBA32FromFloats(r, g, b, a)) {} - // Creates a new color from the specific CMYK and alpha values. - Color(float c, float m, float y, float k, float a) - : m_color(makeRGBAFromCMYKA(c, m, y, k, a)) {} - - static Color createUnchecked(int r, int g, int b) { - RGBA32 color = 0xFF000000 | r << 16 | g << 8 | b; - return Color(color); - } - static Color createUnchecked(int r, int g, int b, int a) { - RGBA32 color = a << 24 | r << 16 | g << 8 | b; - return Color(color); - } - - // Returns the color serialized according to HTML5 - // - - // http://www.whatwg.org/specs/web-apps/current-work/#serialization-of-a-color - String serialized() const; - - // Returns the color serialized according to CSSOM - // - http://dev.w3.org/csswg/cssom/#serialize-a-css-component-value - String serializedAsCSSComponentValue() const; - - // Returns the color serialized as either #RRGGBB or #RRGGBBAA - // The latter format is not a valid CSS color, and should only be seen in DRT - // dumps. - String nameForRenderTreeAsText() const; - - bool hasAlpha() const { return alpha() < 255; } - - int red() const { return redChannel(m_color); } - int green() const { return greenChannel(m_color); } - int blue() const { return blueChannel(m_color); } - int alpha() const { return alphaChannel(m_color); } - - RGBA32 rgb() const { return m_color; } // Preserve the alpha. - void setRGB(int r, int g, int b) { m_color = makeRGB(r, g, b); } - void setRGB(RGBA32 rgb) { m_color = rgb; } - void getRGBA(float& r, float& g, float& b, float& a) const; - void getRGBA(double& r, double& g, double& b, double& a) const; - void getHSL(double& h, double& s, double& l) const; - - Color light() const; - Color dark() const; - - Color combineWithAlpha(float otherAlpha) const; - - // This is an implementation of Porter-Duff's "source-over" equation - Color blend(const Color&) const; - Color blendWithWhite() const; - - static bool parseHexColor(const String&, RGBA32&); - static bool parseHexColor(const LChar*, unsigned, RGBA32&); - static bool parseHexColor(const UChar*, unsigned, RGBA32&); - - static const RGBA32 black = 0xFF000000; - static const RGBA32 white = 0xFFFFFFFF; - static const RGBA32 darkGray = 0xFF808080; - static const RGBA32 gray = 0xFFA0A0A0; - static const RGBA32 lightGray = 0xFFC0C0C0; - static const RGBA32 transparent = 0x00000000; - - private: - RGBA32 m_color; -}; - -inline bool operator==(const Color& a, const Color& b) { - return a.rgb() == b.rgb(); -} - -inline bool operator!=(const Color& a, const Color& b) { - return !(a == b); -} - -PLATFORM_EXPORT Color colorFromPremultipliedARGB(RGBA32); -PLATFORM_EXPORT RGBA32 premultipliedARGBFromColor(const Color&); - -inline Color blend(const Color& from, - const Color& to, - double progress, - bool blendPremultiplied = true) { - if (blendPremultiplied) { - // Contrary to the name, RGBA32 actually stores ARGB, so we can initialize - // Color directly from premultipliedARGBFromColor(). Also, - // premultipliedARGBFromColor() bails on zero alpha, so special-case that. - Color premultFrom = from.alpha() ? premultipliedARGBFromColor(from) : 0; - Color premultTo = to.alpha() ? premultipliedARGBFromColor(to) : 0; - - Color premultBlended( - blend(premultFrom.red(), premultTo.red(), progress), - blend(premultFrom.green(), premultTo.green(), progress), - blend(premultFrom.blue(), premultTo.blue(), progress), - blend(premultFrom.alpha(), premultTo.alpha(), progress)); - - return Color(colorFromPremultipliedARGB(premultBlended.rgb())); - } - - return Color(blend(from.red(), to.red(), progress), - blend(from.green(), to.green(), progress), - blend(from.blue(), to.blue(), progress), - blend(from.alpha(), to.alpha(), progress)); -} -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_COLOR_H_ diff --git a/sky/engine/platform/graphics/ColorSpace.cpp b/sky/engine/platform/graphics/ColorSpace.cpp deleted file mode 100644 index 226dfb587bbe3..0000000000000 --- a/sky/engine/platform/graphics/ColorSpace.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2008, Google Inc. All rights reserved. - * Copyright (C) 2009 Dirk Schulze - * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/ColorSpace.h" - -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -namespace ColorSpaceUtilities { - -static const uint8_t* getLinearRgbLUT() { - static uint8_t linearRgbLUT[256]; - static bool initialized; - if (!initialized) { - for (unsigned i = 0; i < 256; i++) { - float color = i / 255.0f; - color = (color <= 0.04045f ? color / 12.92f - : pow((color + 0.055f) / 1.055f, 2.4f)); - color = std::max(0.0f, color); - color = std::min(1.0f, color); - linearRgbLUT[i] = static_cast(round(color * 255)); - } - initialized = true; - } - return linearRgbLUT; -} - -static const uint8_t* getDeviceRgbLUT() { - static uint8_t deviceRgbLUT[256]; - static bool initialized; - if (!initialized) { - for (unsigned i = 0; i < 256; i++) { - float color = i / 255.0f; - color = (powf(color, 1.0f / 2.4f) * 1.055f) - 0.055f; - color = std::max(0.0f, color); - color = std::min(1.0f, color); - deviceRgbLUT[i] = static_cast(round(color * 255)); - } - initialized = true; - } - return deviceRgbLUT; -} - -const uint8_t* getConversionLUT(ColorSpace dstColorSpace, - ColorSpace srcColorSpace) { - // Identity. - if (srcColorSpace == dstColorSpace) - return 0; - - // Only sRGB/DeviceRGB <-> linearRGB are supported at the moment. - if ((srcColorSpace != ColorSpaceLinearRGB && - srcColorSpace != ColorSpaceDeviceRGB) || - (dstColorSpace != ColorSpaceLinearRGB && - dstColorSpace != ColorSpaceDeviceRGB)) - return 0; - - if (dstColorSpace == ColorSpaceLinearRGB) - return getLinearRgbLUT(); - if (dstColorSpace == ColorSpaceDeviceRGB) - return getDeviceRgbLUT(); - - ASSERT_NOT_REACHED(); - return 0; -} - -Color convertColor(const Color& srcColor, - ColorSpace dstColorSpace, - ColorSpace srcColorSpace) { - const uint8_t* lookupTable = getConversionLUT(dstColorSpace, srcColorSpace); - if (!lookupTable) - return srcColor; - - return Color(lookupTable[srcColor.red()], lookupTable[srcColor.green()], - lookupTable[srcColor.blue()], srcColor.alpha()); -} - -} // namespace ColorSpaceUtilities - -} // namespace blink diff --git a/sky/engine/platform/graphics/ColorSpace.h b/sky/engine/platform/graphics/ColorSpace.h deleted file mode 100644 index 19b23a2bf1b19..0000000000000 --- a/sky/engine/platform/graphics/ColorSpace.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_COLORSPACE_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_COLORSPACE_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/graphics/Color.h" - -namespace blink { - -enum ColorSpace { ColorSpaceDeviceRGB, ColorSpaceSRGB, ColorSpaceLinearRGB }; - -namespace ColorSpaceUtilities { - -// Get a pointer to a 8-bit lookup table that will convert color components -// in the |srcColorSpace| to the |dstColorSpace|. -// If the conversion cannot be performed, or is a no-op (identity transform), -// then 0 is returned. -// (Note that a round-trip - f(B,A)[f(A,B)[x]] - is not lossless in general.) -const uint8_t* getConversionLUT(ColorSpace dstColorSpace, - ColorSpace srcColorSpace = ColorSpaceDeviceRGB); - -// Convert a Color assumed to be in the |srcColorSpace| into the -// |dstColorSpace|. -Color convertColor(const Color& srcColor, - ColorSpace dstColorSpace, - ColorSpace srcColorSpace = ColorSpaceDeviceRGB); - -} // namespace ColorSpaceUtilities - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_COLORSPACE_H_ diff --git a/sky/engine/platform/graphics/DashArray.h b/sky/engine/platform/graphics/DashArray.h deleted file mode 100644 index 53de51952c97b..0000000000000 --- a/sky/engine/platform/graphics/DashArray.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2008 Dirk Schulze - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_DASHARRAY_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_DASHARRAY_H_ - -#include "flutter/sky/engine/wtf/Vector.h" - -typedef float DashArrayElement; - -typedef Vector DashArray; - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_DASHARRAY_H_ diff --git a/sky/engine/platform/graphics/DrawLooperBuilder.cpp b/sky/engine/platform/graphics/DrawLooperBuilder.cpp deleted file mode 100644 index 376cc2e92dcf0..0000000000000 --- a/sky/engine/platform/graphics/DrawLooperBuilder.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/DrawLooperBuilder.h" - -#include "flutter/sky/engine/platform/geometry/FloatSize.h" -#include "flutter/sky/engine/platform/graphics/Color.h" -#include "flutter/sky/engine/platform/graphics/skia/SkiaUtils.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "third_party/skia/include/core/SkColor.h" -#include "third_party/skia/include/core/SkColorFilter.h" -#include "third_party/skia/include/core/SkDrawLooper.h" -#include "third_party/skia/include/core/SkMaskFilter.h" -#include "third_party/skia/include/core/SkPaint.h" - -namespace blink { - -DrawLooperBuilder::DrawLooperBuilder() {} - -DrawLooperBuilder::~DrawLooperBuilder() {} - -PassOwnPtr DrawLooperBuilder::create() { - return adoptPtr(new DrawLooperBuilder); -} - -sk_sp DrawLooperBuilder::detachDrawLooper() { - return m_skDrawLooperBuilder.detach(); -} - -void DrawLooperBuilder::addUnmodifiedContent() { - SkLayerDrawLooper::LayerInfo info; - m_skDrawLooperBuilder.addLayerOnTop(info); -} - -// This replicates the old skia behavior when it used to take radius for blur. -// Now it takes sigma. -static SkScalar RadiusToSigma(SkScalar radius) { - SkASSERT(radius > 0); - return 0.57735f * radius + 0.5f; -} - -void DrawLooperBuilder::addShadow(const FloatSize& offset, - float blur, - const Color& color, - ShadowTransformMode shadowTransformMode, - ShadowAlphaMode shadowAlphaMode) { - // Detect when there's no effective shadow. - if (!color.alpha()) - return; - - SkColor skColor = color.rgb(); - - SkLayerDrawLooper::LayerInfo info; - - switch (shadowAlphaMode) { - case ShadowRespectsAlpha: - info.fColorMode = SkBlendMode::kDst; - break; - case ShadowIgnoresAlpha: - info.fColorMode = SkBlendMode::kSrc; - break; - default: - ASSERT_NOT_REACHED(); - } - - if (blur) - info.fPaintBits |= SkLayerDrawLooper::kMaskFilter_Bit; // our blur - info.fPaintBits |= SkLayerDrawLooper::kColorFilter_Bit; - info.fOffset.set(offset.width(), offset.height()); - info.fPostTranslate = (shadowTransformMode == ShadowIgnoresTransforms); - - SkPaint* paint = m_skDrawLooperBuilder.addLayerOnTop(info); - - if (blur) { - const SkScalar sigma = RadiusToSigma(blur / 2); - bool respectCTM = (shadowTransformMode != ShadowIgnoresTransforms); - paint->setMaskFilter( - SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, sigma, respectCTM)); - } - - paint->setColorFilter( - SkColorFilter::MakeModeFilter(skColor, SkBlendMode::kSrcIn)); -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/DrawLooperBuilder.h b/sky/engine/platform/graphics/DrawLooperBuilder.h deleted file mode 100644 index 09e2ee245fc3b..0000000000000 --- a/sky/engine/platform/graphics/DrawLooperBuilder.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_DRAWLOOPERBUILDER_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_DRAWLOOPERBUILDER_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "third_party/skia/include/effects/SkLayerDrawLooper.h" - -class SkDrawLooper; - -namespace blink { - -class Color; -class FloatSize; - -class PLATFORM_EXPORT DrawLooperBuilder final { - // Implementing the copy constructor properly would require writing code to - // copy the underlying SkLayerDrawLooper::Builder. - WTF_MAKE_NONCOPYABLE(DrawLooperBuilder); - - public: - enum ShadowTransformMode { - ShadowRespectsTransforms, - ShadowIgnoresTransforms - }; - enum ShadowAlphaMode { ShadowRespectsAlpha, ShadowIgnoresAlpha }; - - DrawLooperBuilder(); - ~DrawLooperBuilder(); - - static PassOwnPtr create(); - - // Creates the SkDrawLooper and passes ownership to the caller. The builder - // should not be used any more after calling this method. - sk_sp detachDrawLooper(); - - void addUnmodifiedContent(); - void addShadow(const FloatSize& offset, - float blur, - const Color&, - ShadowTransformMode = ShadowRespectsTransforms, - ShadowAlphaMode = ShadowRespectsAlpha); - - private: - SkLayerDrawLooper::Builder m_skDrawLooperBuilder; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_DRAWLOOPERBUILDER_H_ diff --git a/sky/engine/platform/graphics/FrameData.cpp b/sky/engine/platform/graphics/FrameData.cpp deleted file mode 100644 index 6abb81227d6aa..0000000000000 --- a/sky/engine/platform/graphics/FrameData.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) - * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/FrameData.h" - -namespace blink { - -FrameData::FrameData() - : m_orientation(DefaultImageOrientation), - m_duration(0), - m_haveMetadata(false), - m_isComplete(false), - m_hasAlpha(true), - m_frameBytes(0) {} - -FrameData::~FrameData() { - clear(true); -} - -bool FrameData::clear(bool clearMetadata) { - return false; -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/FrameData.h b/sky/engine/platform/graphics/FrameData.h deleted file mode 100644 index 13c450cf03dca..0000000000000 --- a/sky/engine/platform/graphics/FrameData.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) - * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2008-2009 Torch Mobile, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_FRAMEDATA_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_FRAMEDATA_H_ - -#include "flutter/sky/engine/platform/graphics/ImageOrientation.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/VectorTraits.h" - -namespace blink { - -struct FrameData { - WTF_MAKE_NONCOPYABLE(FrameData); - - public: - FrameData(); - ~FrameData(); - - // Clear the cached image data on the frame, and (optionally) the metadata. - // Returns whether there was cached image data to clear. - bool clear(bool clearMetadata); - - ImageOrientation m_orientation; - float m_duration; - bool m_haveMetadata : 1; - bool m_isComplete : 1; - bool m_hasAlpha : 1; - unsigned m_frameBytes; -}; - -} // namespace blink - -namespace WTF { -template <> -struct VectorTraits - : public SimpleClassVectorTraits { - static const bool canInitializeWithMemset = - false; // Not all FrameData members initialize to 0. -}; -} // namespace WTF - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_FRAMEDATA_H_ diff --git a/sky/engine/platform/graphics/GeneratedImage.cpp b/sky/engine/platform/graphics/GeneratedImage.cpp deleted file mode 100644 index b62afb37c1b10..0000000000000 --- a/sky/engine/platform/graphics/GeneratedImage.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/GeneratedImage.h" - -#include "flutter/sky/engine/platform/geometry/FloatSize.h" - -namespace blink { - -void GeneratedImage::computeIntrinsicDimensions(Length& intrinsicWidth, - Length& intrinsicHeight, - FloatSize& intrinsicRatio) { - Image::computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, - intrinsicRatio); - intrinsicRatio = FloatSize(); -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/GeneratedImage.h b/sky/engine/platform/graphics/GeneratedImage.h deleted file mode 100644 index 035fd9b45e181..0000000000000 --- a/sky/engine/platform/graphics/GeneratedImage.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2008 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_GENERATEDIMAGE_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_GENERATEDIMAGE_H_ - -#include "flutter/sky/engine/platform/geometry/IntSize.h" -#include "flutter/sky/engine/platform/graphics/Image.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -class PLATFORM_EXPORT GeneratedImage : public Image { - public: - virtual void setContainerSize(const IntSize& size) override { m_size = size; } - virtual bool usesContainerSize() const override { return true; } - virtual bool hasRelativeWidth() const override { return true; } - virtual bool hasRelativeHeight() const override { return true; } - virtual void computeIntrinsicDimensions(Length& intrinsicWidth, - Length& intrinsicHeight, - FloatSize& intrinsicRatio) override; - - virtual IntSize size() const override { return m_size; } - - // Assume that generated content has no decoded data we need to worry about - virtual void destroyDecodedData(bool) override {} - - protected: - virtual void drawPattern(GraphicsContext*, - const FloatRect&, - const FloatSize&, - const FloatPoint&, - CompositeOperator, - const FloatRect&, - WebBlendMode, - const IntSize& repeatSpacing) override = 0; - - // FIXME: Implement this to be less conservative. - virtual bool currentFrameKnownToBeOpaque() override { return false; } - - GeneratedImage() {} - - IntSize m_size; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_GENERATEDIMAGE_H_ diff --git a/sky/engine/platform/graphics/Gradient.cpp b/sky/engine/platform/graphics/Gradient.cpp deleted file mode 100644 index f1bc095023c9b..0000000000000 --- a/sky/engine/platform/graphics/Gradient.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2007 Alp Toker - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/Gradient.h" - -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "flutter/sky/engine/platform/graphics/skia/SkiaUtils.h" -#include "third_party/skia/include/core/SkColor.h" -#include "third_party/skia/include/core/SkShader.h" -#include "third_party/skia/include/effects/SkGradientShader.h" - -typedef Vector ColorStopOffsetVector; -typedef Vector ColorStopColorVector; - -namespace blink { - -Gradient::Gradient(const FloatPoint& p0, const FloatPoint& p1) - : m_p0(p0), - m_p1(p1), - m_r0(0), - m_r1(0), - m_aspectRatio(1), - m_radial(false), - m_stopsSorted(false), - m_drawInPMColorSpace(false), - m_spreadMethod(SpreadMethodPad) {} - -Gradient::Gradient(const FloatPoint& p0, - float r0, - const FloatPoint& p1, - float r1, - float aspectRatio) - : m_p0(p0), - m_p1(p1), - m_r0(r0), - m_r1(r1), - m_aspectRatio(aspectRatio), - m_radial(true), - m_stopsSorted(false), - m_drawInPMColorSpace(false), - m_spreadMethod(SpreadMethodPad) {} - -Gradient::~Gradient() {} - -static inline bool compareStops(const Gradient::ColorStop& a, - const Gradient::ColorStop& b) { - return a.stop < b.stop; -} - -void Gradient::addColorStop(const Gradient::ColorStop& stop) { - if (m_stops.isEmpty()) { - m_stopsSorted = true; - } else { - m_stopsSorted = m_stopsSorted && compareStops(m_stops.last(), stop); - } - - m_stops.append(stop); - m_gradient = nullptr; -} - -void Gradient::sortStopsIfNecessary() { - if (m_stopsSorted) - return; - - m_stopsSorted = true; - - if (!m_stops.size()) - return; - - std::stable_sort(m_stops.begin(), m_stops.end(), compareStops); -} - -bool Gradient::hasAlpha() const { - for (size_t i = 0; i < m_stops.size(); i++) { - if (m_stops[i].color.hasAlpha()) - return true; - } - - return false; -} - -void Gradient::setSpreadMethod(GradientSpreadMethod spreadMethod) { - // FIXME: Should it become necessary, allow calls to this method after - // m_gradient has been set. - ASSERT(!m_gradient); - - if (m_spreadMethod == spreadMethod) - return; - - m_spreadMethod = spreadMethod; -} - -void Gradient::setDrawsInPMColorSpace(bool drawInPMColorSpace) { - if (drawInPMColorSpace == m_drawInPMColorSpace) - return; - - m_drawInPMColorSpace = drawInPMColorSpace; - m_gradient = nullptr; -} - -void Gradient::setGradientSpaceTransform( - const AffineTransform& gradientSpaceTransformation) { - if (m_gradientSpaceTransformation == gradientSpaceTransformation) - return; - - m_gradientSpaceTransformation = gradientSpaceTransformation; - m_gradient = nullptr; -} - -// Determine the total number of stops needed, including pseudo-stops at the -// ends as necessary. -static size_t totalStopsNeeded(const Gradient::ColorStop* stopData, - size_t count) { - // N.B.: The tests in this function should kept in sync with the ones in - // fillStops(), or badness happens. - const Gradient::ColorStop* stop = stopData; - size_t countUsed = count; - if (count < 1 || stop->stop > 0.0) - countUsed++; - stop += count - 1; - if (count < 1 || stop->stop < 1.0) - countUsed++; - return countUsed; -} - -// FIXME: This would be more at home as Color::operator SkColor. -static inline SkColor makeSkColor(const Color& c) { - return SkColorSetARGB(c.alpha(), c.red(), c.green(), c.blue()); -} - -// Collect sorted stop position and color information into the pos and colors -// buffers, ensuring stops at both 0.0 and 1.0. The buffers must be large -// enough to hold information for all stops, including the new endpoints if -// stops at 0.0 and 1.0 aren't already included. -static void fillStops(const Gradient::ColorStop* stopData, - size_t count, - ColorStopOffsetVector& pos, - ColorStopColorVector& colors) { - const Gradient::ColorStop* stop = stopData; - size_t start = 0; - if (count < 1) { - // A gradient with no stops must be transparent black. - pos[0] = WebCoreFloatToSkScalar(0.0); - colors[0] = SK_ColorTRANSPARENT; - start = 1; - } else if (stop->stop > 0.0) { - // Copy the first stop to 0.0. The first stop position may have a slight - // rounding error, but we don't care in this float comparison, since - // 0.0 comes through cleanly and people aren't likely to want a gradient - // with a stop at (0 + epsilon). - pos[0] = WebCoreFloatToSkScalar(0.0); - colors[0] = makeSkColor(stop->color); - start = 1; - } - - for (size_t i = start; i < start + count; i++) { - pos[i] = WebCoreFloatToSkScalar(stop->stop); - colors[i] = makeSkColor(stop->color); - ++stop; - } - - // Copy the last stop to 1.0 if needed. See comment above about this float - // comparison. - if (count < 1 || (--stop)->stop < 1.0) { - pos[start + count] = WebCoreFloatToSkScalar(1.0); - colors[start + count] = colors[start + count - 1]; - } -} - -sk_sp Gradient::shader() { - if (m_gradient) - return m_gradient; - - sortStopsIfNecessary(); - ASSERT(m_stopsSorted); - - size_t countUsed = totalStopsNeeded(m_stops.data(), m_stops.size()); - ASSERT(countUsed >= 2); - ASSERT(countUsed >= m_stops.size()); - - ColorStopOffsetVector pos(countUsed); - ColorStopColorVector colors(countUsed); - fillStops(m_stops.data(), m_stops.size(), pos, colors); - - SkShader::TileMode tile = SkShader::kClamp_TileMode; - switch (m_spreadMethod) { - case SpreadMethodReflect: - tile = SkShader::kMirror_TileMode; - break; - case SpreadMethodRepeat: - tile = SkShader::kRepeat_TileMode; - break; - case SpreadMethodPad: - tile = SkShader::kClamp_TileMode; - break; - } - - uint32_t shouldDrawInPMColorSpace = - m_drawInPMColorSpace ? SkGradientShader::kInterpolateColorsInPremul_Flag - : 0; - if (m_radial) { - if (aspectRatio() != 1) { - // CSS3 elliptical gradients: apply the elliptical scaling at the - // gradient center point. - m_gradientSpaceTransformation.translate(m_p0.x(), m_p0.y()); - m_gradientSpaceTransformation.scale(1, 1 / aspectRatio()); - m_gradientSpaceTransformation.translate(-m_p0.x(), -m_p0.y()); - ASSERT(m_p0 == m_p1); - } - SkMatrix localMatrix = - affineTransformToSkMatrix(m_gradientSpaceTransformation); - - // Since the two-point radial gradient is slower than the plain radial, - // only use it if we have to. - if (m_p0 == m_p1 && m_r0 <= 0.0f) { - m_gradient = SkGradientShader::MakeRadial( - m_p1.data(), m_r1, colors.data(), pos.data(), - static_cast(countUsed), tile, shouldDrawInPMColorSpace, - &localMatrix); - } else { - // The radii we give to Skia must be positive. If we're given a - // negative radius, ask for zero instead. - SkScalar radius0 = m_r0 >= 0.0f ? WebCoreFloatToSkScalar(m_r0) : 0; - SkScalar radius1 = m_r1 >= 0.0f ? WebCoreFloatToSkScalar(m_r1) : 0; - m_gradient = SkGradientShader::MakeTwoPointConical( - m_p0.data(), radius0, m_p1.data(), radius1, colors.data(), pos.data(), - static_cast(countUsed), tile, shouldDrawInPMColorSpace, - &localMatrix); - } - } else { - SkPoint pts[2] = {m_p0.data(), m_p1.data()}; - SkMatrix localMatrix = - affineTransformToSkMatrix(m_gradientSpaceTransformation); - m_gradient = SkGradientShader::MakeLinear( - pts, colors.data(), pos.data(), static_cast(countUsed), tile, - shouldDrawInPMColorSpace, &localMatrix); - } - - if (!m_gradient) { - // use last color, since our "geometry" was degenerate (e.g. radius==0) - m_gradient = SkShader::MakeColorShader(colors[countUsed - 1]); - } - return m_gradient; -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/Gradient.h b/sky/engine/platform/graphics/Gradient.h deleted file mode 100644 index 585580035c45a..0000000000000 --- a/sky/engine/platform/graphics/Gradient.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2007 Alp Toker - * Copyright (C) 2008 Torch Mobile, Inc. - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_GRADIENT_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_GRADIENT_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/graphics/Color.h" -#include "flutter/sky/engine/platform/graphics/GraphicsTypes.h" -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" - -class SkShader; - -namespace blink { - -class PLATFORM_EXPORT Gradient : public RefCounted { - public: - static PassRefPtr create(const FloatPoint& p0, - const FloatPoint& p1) { - return adoptRef(new Gradient(p0, p1)); - } - static PassRefPtr create(const FloatPoint& p0, - float r0, - const FloatPoint& p1, - float r1, - float aspectRatio = 1) { - return adoptRef(new Gradient(p0, r0, p1, r1, aspectRatio)); - } - ~Gradient(); - - struct ColorStop { - float stop; - Color color; - - ColorStop(float s, const Color& c) : stop(s), color(c) {} - }; - void addColorStop(const ColorStop&); - void addColorStop(float value, const Color& color) { - addColorStop(ColorStop(value, color)); - } - - bool hasAlpha() const; - bool shaderChanged() const { return !m_gradient; } - - bool isRadial() const { return m_radial; } - bool isZeroSize() const { - return m_p0.x() == m_p1.x() && m_p0.y() == m_p1.y() && - (!m_radial || m_r0 == m_r1); - } - - const FloatPoint& p0() const { return m_p0; } - const FloatPoint& p1() const { return m_p1; } - - void setP0(const FloatPoint& p) { - if (m_p0 == p) - return; - - m_p0 = p; - } - - void setP1(const FloatPoint& p) { - if (m_p1 == p) - return; - - m_p1 = p; - } - - float startRadius() const { return m_r0; } - float endRadius() const { return m_r1; } - - void setStartRadius(float r) { - if (m_r0 == r) - return; - - m_r0 = r; - } - - void setEndRadius(float r) { - if (m_r1 == r) - return; - - m_r1 = r; - } - - float aspectRatio() const { return m_aspectRatio; } - - sk_sp shader(); - - void setDrawsInPMColorSpace(bool drawInPMColorSpace); - - void setSpreadMethod(GradientSpreadMethod); - GradientSpreadMethod spreadMethod() { return m_spreadMethod; } - void setGradientSpaceTransform( - const AffineTransform& gradientSpaceTransformation); - AffineTransform gradientSpaceTransform() { - return m_gradientSpaceTransformation; - } - - private: - Gradient(const FloatPoint& p0, const FloatPoint& p1); - Gradient(const FloatPoint& p0, - float r0, - const FloatPoint& p1, - float r1, - float aspectRatio); - - void destroyShader(); - - void sortStopsIfNecessary(); - - FloatPoint m_p0; - FloatPoint m_p1; - float m_r0; - float m_r1; - float m_aspectRatio; // For elliptical gradient, width / height. - Vector m_stops; - bool m_radial; - bool m_stopsSorted; - bool m_drawInPMColorSpace; - GradientSpreadMethod m_spreadMethod; - AffineTransform m_gradientSpaceTransformation; - - sk_sp m_gradient; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_GRADIENT_H_ diff --git a/sky/engine/platform/graphics/GradientGeneratedImage.cpp b/sky/engine/platform/graphics/GradientGeneratedImage.cpp deleted file mode 100644 index 0db697a06695f..0000000000000 --- a/sky/engine/platform/graphics/GradientGeneratedImage.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2008, 2009, 2010, 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/GradientGeneratedImage.h" - -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h" - -namespace blink { - -void GradientGeneratedImage::draw(GraphicsContext* destContext, - const FloatRect& destRect, - const FloatRect& srcRect, - CompositeOperator compositeOp, - WebBlendMode blendMode) { - GraphicsContextStateSaver stateSaver(*destContext); - destContext->setCompositeOperation(compositeOp, blendMode); - destContext->clip(destRect); - destContext->translate(destRect.x(), destRect.y()); - if (destRect.size() != srcRect.size()) - destContext->scale(destRect.width() / srcRect.width(), - destRect.height() / srcRect.height()); - destContext->translate(-srcRect.x(), -srcRect.y()); - destContext->setFillGradient(m_gradient); - destContext->fillRect(FloatRect(FloatPoint(), m_size)); -} - -void GradientGeneratedImage::drawPattern(GraphicsContext* destContext, - const FloatRect& srcRect, - const FloatSize& scale, - const FloatPoint& phase, - CompositeOperator compositeOp, - const FloatRect& destRect, - WebBlendMode blendMode, - const IntSize& repeatSpacing) { - float stepX = srcRect.width() + repeatSpacing.width(); - float stepY = srcRect.height() + repeatSpacing.height(); - int firstColumn = static_cast( - floorf((((destRect.x() - phase.x()) / scale.width()) - srcRect.x()) / - srcRect.width())); - int firstRow = static_cast( - floorf((((destRect.y() - phase.y()) / scale.height()) - srcRect.y()) / - srcRect.height())); - for (int i = firstColumn;; ++i) { - float dstX = (srcRect.x() + i * stepX) * scale.width() + phase.x(); - // assert that first column encroaches left edge of dstRect. - ASSERT(i > firstColumn || dstX <= destRect.x()); - ASSERT(i == firstColumn || dstX > destRect.x()); - - if (dstX >= destRect.maxX()) - break; - float dstMaxX = dstX + srcRect.width() * scale.width(); - if (dstX < destRect.x()) - dstX = destRect.x(); - if (dstMaxX > destRect.maxX()) - dstMaxX = destRect.maxX(); - if (dstX >= dstMaxX) - continue; - - FloatRect visibleSrcRect; - FloatRect tileDstRect; - tileDstRect.setX(dstX); - tileDstRect.setWidth(dstMaxX - dstX); - visibleSrcRect.setX((tileDstRect.x() - phase.x()) / scale.width() - - i * stepX); - visibleSrcRect.setWidth(tileDstRect.width() / scale.width()); - - for (int j = firstRow;; j++) { - float dstY = (srcRect.y() + j * stepY) * scale.height() + phase.y(); - // assert that first row encroaches top edge of dstRect. - ASSERT(j > firstRow || dstY <= destRect.y()); - ASSERT(j == firstRow || dstY > destRect.y()); - - if (dstY >= destRect.maxY()) - break; - float dstMaxY = dstY + srcRect.height() * scale.height(); - if (dstY < destRect.y()) - dstY = destRect.y(); - if (dstMaxY > destRect.maxY()) - dstMaxY = destRect.maxY(); - if (dstY >= dstMaxY) - continue; - - tileDstRect.setY(dstY); - tileDstRect.setHeight(dstMaxY - dstY); - visibleSrcRect.setY((tileDstRect.y() - phase.y()) / scale.height() - - j * stepY); - visibleSrcRect.setHeight(tileDstRect.height() / scale.height()); - draw(destContext, tileDstRect, visibleSrcRect, compositeOp, blendMode); - } - } -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/GradientGeneratedImage.h b/sky/engine/platform/graphics/GradientGeneratedImage.h deleted file mode 100644 index 7d9f8c30c3ae4..0000000000000 --- a/sky/engine/platform/graphics/GradientGeneratedImage.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2008, 2012 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_GRADIENTGENERATEDIMAGE_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_GRADIENTGENERATEDIMAGE_H_ - -#include "flutter/sky/engine/platform/geometry/IntSize.h" -#include "flutter/sky/engine/platform/graphics/GeneratedImage.h" -#include "flutter/sky/engine/platform/graphics/Gradient.h" -#include "flutter/sky/engine/platform/graphics/Image.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace blink { - -class PLATFORM_EXPORT GradientGeneratedImage : public GeneratedImage { - public: - static PassRefPtr create( - PassRefPtr generator, - const IntSize& size) { - return adoptRef(new GradientGeneratedImage(generator, size)); - } - - virtual ~GradientGeneratedImage() {} - - protected: - virtual void draw(GraphicsContext*, - const FloatRect&, - const FloatRect&, - CompositeOperator, - WebBlendMode) override; - virtual void drawPattern(GraphicsContext*, - const FloatRect&, - const FloatSize&, - const FloatPoint&, - CompositeOperator, - const FloatRect&, - WebBlendMode, - const IntSize& repeatSpacing) override; - - GradientGeneratedImage(PassRefPtr generator, const IntSize& size) - : m_gradient(generator) { - m_size = size; - } - - RefPtr m_gradient; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_GRADIENTGENERATEDIMAGE_H_ diff --git a/sky/engine/platform/graphics/GraphicsContext.cpp b/sky/engine/platform/graphics/GraphicsContext.cpp deleted file mode 100644 index a0f8bc8f29161..0000000000000 --- a/sky/engine/platform/graphics/GraphicsContext.cpp +++ /dev/null @@ -1,1580 +0,0 @@ -/* - * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" - -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "flutter/sky/engine/platform/geometry/RoundedRect.h" -#include "flutter/sky/engine/platform/graphics/Gradient.h" -#include "flutter/sky/engine/platform/graphics/skia/SkiaUtils.h" -#include "flutter/sky/engine/platform/text/BidiResolver.h" -#include "flutter/sky/engine/platform/text/TextRunIterator.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "third_party/skia/include/core/SkAnnotation.h" -#include "third_party/skia/include/core/SkColorFilter.h" -#include "third_party/skia/include/core/SkData.h" -#include "third_party/skia/include/core/SkMaskFilter.h" -#include "third_party/skia/include/core/SkPicture.h" -#include "third_party/skia/include/core/SkRRect.h" -#include "third_party/skia/include/core/SkRefCnt.h" -#include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/include/effects/SkCornerPathEffect.h" -#include "third_party/skia/include/effects/SkLumaColorFilter.h" -#include "third_party/skia/include/effects/SkPictureImageFilter.h" -#include "third_party/skia/include/gpu/GrRenderTarget.h" -#include "third_party/skia/include/gpu/GrTexture.h" - -namespace blink { - -struct GraphicsContext::CanvasSaveState { - CanvasSaveState(bool pendingSave, int count) - : m_pendingSave(pendingSave), m_restoreCount(count) {} - - bool m_pendingSave; - int m_restoreCount; -}; - -GraphicsContext::GraphicsContext(SkCanvas* canvas, - DisabledMode disableContextOrPainting) - : m_canvas(canvas), - m_paintStateStack(), - m_paintStateIndex(0), - m_pendingCanvasSave(false) -#if ENABLE(ASSERT) - , - m_layerCount(0), - m_disableDestructionChecks(false) -#endif - , - m_disabledState(disableContextOrPainting), - m_deviceScaleFactor(1.0f), - m_regionTrackingMode(RegionTrackingDisabled), - m_trackTextRegion(false), - m_accelerated(false), - m_isCertainlyOpaque(true), - m_antialiasHairlineImages(false), - m_shouldSmoothFonts(true) { - ASSERT(canvas); - - // FIXME: Do some tests to determine how many states are typically used, and - // allocate several here. - m_paintStateStack.append(GraphicsContextState::create()); - m_paintState = m_paintStateStack.last().get(); -} - -GraphicsContext::~GraphicsContext() { -#if ENABLE(ASSERT) - if (!m_disableDestructionChecks) { - ASSERT(!m_paintStateIndex); - ASSERT(!m_paintState->saveCount()); - ASSERT(!m_layerCount); - ASSERT(m_canvasStateStack.isEmpty()); - } -#endif -} - -void GraphicsContext::resetCanvas(SkCanvas* canvas) { - ASSERT(canvas); - m_canvas = canvas; - m_trackedRegion.reset(); -} - -void GraphicsContext::setRegionTrackingMode(RegionTrackingMode mode) { - m_regionTrackingMode = mode; - if (mode == RegionTrackingOpaque) - m_trackedRegion.setTrackedRegionType(RegionTracker::Opaque); - else if (mode == RegionTrackingOverwrite) - m_trackedRegion.setTrackedRegionType(RegionTracker::Overwrite); -} - -void GraphicsContext::save() { - if (contextDisabled()) - return; - - m_paintState->incrementSaveCount(); - - m_canvasStateStack.append( - CanvasSaveState(m_pendingCanvasSave, m_canvas->getSaveCount())); - m_pendingCanvasSave = true; -} - -void GraphicsContext::restore() { - if (contextDisabled()) - return; - - if (!m_paintStateIndex && !m_paintState->saveCount()) { - WTF_LOG_ERROR("ERROR void GraphicsContext::restore() stack is empty"); - return; - } - - if (m_paintState->saveCount()) { - m_paintState->decrementSaveCount(); - } else { - m_paintStateIndex--; - m_paintState = m_paintStateStack[m_paintStateIndex].get(); - } - - CanvasSaveState savedState = m_canvasStateStack.last(); - m_canvasStateStack.removeLast(); - m_pendingCanvasSave = savedState.m_pendingSave; - m_canvas->restoreToCount(savedState.m_restoreCount); -} - -void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint) { - if (contextDisabled()) - return; - - realizeCanvasSave(); - - m_canvas->saveLayer(bounds, paint); - if (regionTrackingEnabled()) - m_trackedRegion.pushCanvasLayer(paint); -} - -void GraphicsContext::restoreLayer() { - if (contextDisabled()) - return; - - m_canvas->restore(); - if (regionTrackingEnabled()) - m_trackedRegion.popCanvasLayer(this); -} - -void GraphicsContext::setStrokePattern(PassRefPtr pattern) { - if (contextDisabled()) - return; - - ASSERT(pattern); - if (!pattern) { - setStrokeColor(Color::black); - return; - } - mutableState()->setStrokePattern(pattern); -} - -void GraphicsContext::setStrokeGradient(PassRefPtr gradient) { - if (contextDisabled()) - return; - - ASSERT(gradient); - if (!gradient) { - setStrokeColor(Color::black); - return; - } - mutableState()->setStrokeGradient(gradient); -} - -void GraphicsContext::setFillPattern(PassRefPtr pattern) { - if (contextDisabled()) - return; - - ASSERT(pattern); - if (!pattern) { - setFillColor(Color::black); - return; - } - - mutableState()->setFillPattern(pattern); -} - -void GraphicsContext::setFillGradient(PassRefPtr gradient) { - if (contextDisabled()) - return; - - ASSERT(gradient); - if (!gradient) { - setFillColor(Color::black); - return; - } - - mutableState()->setFillGradient(gradient); -} - -void GraphicsContext::setShadow( - const FloatSize& offset, - float blur, - const Color& color, - DrawLooperBuilder::ShadowTransformMode shadowTransformMode, - DrawLooperBuilder::ShadowAlphaMode shadowAlphaMode) { - if (contextDisabled()) - return; - - if (!color.alpha() || (!offset.width() && !offset.height() && !blur)) { - clearShadow(); - return; - } - - OwnPtr drawLooperBuilder = DrawLooperBuilder::create(); - drawLooperBuilder->addShadow(offset, blur, color, shadowTransformMode, - shadowAlphaMode); - drawLooperBuilder->addUnmodifiedContent(); - setDrawLooper(drawLooperBuilder.release()); -} - -void GraphicsContext::setDrawLooper( - PassOwnPtr drawLooperBuilder) { - if (contextDisabled()) - return; - - mutableState()->setDrawLooper(drawLooperBuilder->detachDrawLooper()); -} - -void GraphicsContext::clearDrawLooper() { - if (contextDisabled()) - return; - - mutableState()->clearDrawLooper(); -} - -bool GraphicsContext::hasShadow() const { - return !!immutableState()->drawLooper(); -} - -bool GraphicsContext::getTransformedClipBounds(FloatRect* bounds) const { - if (contextDisabled()) - return false; - SkIRect skIBounds; - if (!m_canvas->getDeviceClipBounds(&skIBounds)) - return false; - SkRect skBounds = SkRect::Make(skIBounds); - *bounds = FloatRect(skBounds); - return true; -} - -SkMatrix GraphicsContext::getTotalMatrix() const { - if (contextDisabled()) - return SkMatrix::I(); - - return m_canvas->getTotalMatrix(); -} - -void GraphicsContext::adjustTextRenderMode(SkPaint* paint) { - if (contextDisabled()) - return; - - if (!paint->isLCDRenderText()) - return; - - paint->setLCDRenderText(couldUseLCDRenderedText()); -} - -void GraphicsContext::setCompositeOperation( - CompositeOperator compositeOperation, - WebBlendMode blendMode) { - if (contextDisabled()) - return; - mutableState()->setCompositeOperation(compositeOperation, blendMode); -} - -SkColorFilter* GraphicsContext::colorFilter() const { - return immutableState()->colorFilter(); -} - -void GraphicsContext::setColorFilter(ColorFilterObsolete colorFilter) {} - -bool GraphicsContext::readPixels(const SkImageInfo& info, - void* pixels, - size_t rowBytes, - int x, - int y) { - if (contextDisabled()) - return false; - - return m_canvas->readPixels(info, pixels, rowBytes, x, y); -} - -void GraphicsContext::setMatrix(const SkMatrix& matrix) { - if (contextDisabled()) - return; - - realizeCanvasSave(); - - m_canvas->setMatrix(matrix); -} - -void GraphicsContext::concat(const SkMatrix& matrix) { - if (contextDisabled()) - return; - - if (matrix.isIdentity()) - return; - - realizeCanvasSave(); - - m_canvas->concat(matrix); -} - -void GraphicsContext::beginTransparencyLayer(float opacity, - const FloatRect* bounds) { - beginLayer(opacity, immutableState()->compositeOperator(), bounds); -} - -void GraphicsContext::beginLayer(float opacity, - CompositeOperator op, - const FloatRect* bounds, - ColorFilterObsolete colorFilter, - sk_sp imageFilter) { - if (contextDisabled()) - return; - - SkPaint layerPaint; - layerPaint.setAlpha(static_cast(opacity * 255)); - layerPaint.setBlendMode( - WebCoreCompositeToSkiaComposite(op, m_paintState->blendMode())); - layerPaint.setImageFilter(imageFilter); - - if (bounds) { - SkRect skBounds = WebCoreFloatRectToSKRect(*bounds); - saveLayer(&skBounds, &layerPaint); - } else { - saveLayer(0, &layerPaint); - } - -#if ENABLE(ASSERT) - ++m_layerCount; -#endif -} - -void GraphicsContext::endLayer() { - if (contextDisabled()) - return; - - restoreLayer(); - - ASSERT(m_layerCount > 0); -#if ENABLE(ASSERT) - --m_layerCount; -#endif -} - -void GraphicsContext::drawConvexPolygon(size_t numPoints, - const FloatPoint* points, - bool shouldAntialias) { - if (contextDisabled()) - return; - - if (numPoints <= 1) - return; - - SkPath path; - setPathFromConvexPoints(&path, numPoints, points); - - SkPaint paint(immutableState()->fillPaint()); - paint.setAntiAlias(shouldAntialias); - drawPath(path, paint); - - if (strokeStyle() != NoStroke) - drawPath(path, immutableState()->strokePaint()); -} - -float GraphicsContext::prepareFocusRingPaint(SkPaint& paint, - const Color& color, - int width) const { - paint.setAntiAlias(true); - paint.setStyle(SkPaint::kStroke_Style); - paint.setColor(color.rgb()); - paint.setStrokeWidth(focusRingWidth(width)); - return 1; -} - -void GraphicsContext::drawFocusRingPath(const SkPath& path, - const Color& color, - int width) { - SkPaint paint; - float cornerRadius = prepareFocusRingPaint(paint, color, width); - - paint.setPathEffect(SkCornerPathEffect::Make(SkFloatToScalar(cornerRadius))); - - // Outer path - drawPath(path, paint); -} - -void GraphicsContext::drawFocusRingRect(const SkRect& rect, - const Color& color, - int width) { - SkPaint paint; - float cornerRadius = prepareFocusRingPaint(paint, color, width); - - SkRRect rrect; - rrect.setRectXY(rect, SkFloatToScalar(cornerRadius), - SkFloatToScalar(cornerRadius)); - - // Outer rect - drawRRect(rrect, paint); -} - -static inline IntRect areaCastingShadowInHole(const IntRect& holeRect, - int shadowBlur, - int shadowSpread, - const IntSize& shadowOffset) { - IntRect bounds(holeRect); - - bounds.inflate(shadowBlur); - - if (shadowSpread < 0) - bounds.inflate(-shadowSpread); - - IntRect offsetBounds = bounds; - offsetBounds.move(-shadowOffset); - return unionRect(bounds, offsetBounds); -} - -void GraphicsContext::drawInnerShadow(const RoundedRect& rect, - const Color& shadowColor, - const IntSize shadowOffset, - int shadowBlur, - int shadowSpread, - Edges clippedEdges) { - if (contextDisabled()) - return; - - IntRect holeRect(rect.rect()); - holeRect.inflate(-shadowSpread); - - if (holeRect.isEmpty()) { - if (rect.isRounded()) - fillRoundedRect(rect, shadowColor); - else - fillRect(rect.rect(), shadowColor); - return; - } - - if (clippedEdges & LeftEdge) { - holeRect.move(-std::max(shadowOffset.width(), 0) - shadowBlur, 0); - holeRect.setWidth(holeRect.width() + std::max(shadowOffset.width(), 0) + - shadowBlur); - } - if (clippedEdges & TopEdge) { - holeRect.move(0, -std::max(shadowOffset.height(), 0) - shadowBlur); - holeRect.setHeight(holeRect.height() + std::max(shadowOffset.height(), 0) + - shadowBlur); - } - if (clippedEdges & RightEdge) - holeRect.setWidth(holeRect.width() - std::min(shadowOffset.width(), 0) + - shadowBlur); - if (clippedEdges & BottomEdge) - holeRect.setHeight(holeRect.height() - std::min(shadowOffset.height(), 0) + - shadowBlur); - - Color fillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), - 255); - - IntRect outerRect = areaCastingShadowInHole(rect.rect(), shadowBlur, - shadowSpread, shadowOffset); - RoundedRect roundedHole(holeRect, rect.radii()); - - save(); - if (rect.isRounded()) { - Path path; - path.addRoundedRect(rect); - clipPath(path); - roundedHole.shrinkRadii(shadowSpread); - } else { - clip(rect.rect()); - } - - OwnPtr drawLooperBuilder = DrawLooperBuilder::create(); - drawLooperBuilder->addShadow(shadowOffset, shadowBlur, shadowColor, - DrawLooperBuilder::ShadowRespectsTransforms, - DrawLooperBuilder::ShadowIgnoresAlpha); - setDrawLooper(drawLooperBuilder.release()); - fillRectWithRoundedHole(outerRect, roundedHole, fillColor); - restore(); - clearDrawLooper(); -} - -void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2) { - if (contextDisabled()) - return; - - StrokeStyle penStyle = strokeStyle(); - if (penStyle == NoStroke) - return; - - FloatPoint p1 = point1; - FloatPoint p2 = point2; - bool isVerticalLine = (p1.x() == p2.x()); - int width = roundf(strokeThickness()); - - // We know these are vertical or horizontal lines, so the length will just - // be the sum of the displacement component vectors give or take 1 - - // probably worth the speed up of no square root, which also won't be exact. - FloatSize disp = p2 - p1; - int length = SkScalarRoundToInt(disp.width() + disp.height()); - SkPaint paint(immutableState()->strokePaint(length)); - - if (strokeStyle() == DottedStroke || strokeStyle() == DashedStroke) { - // Do a rect fill of our endpoints. This ensures we always have the - // appearance of being a border. We then draw the actual dotted/dashed - // line. - SkRect r1, r2; - r1.set(p1.x(), p1.y(), p1.x() + width, p1.y() + width); - r2.set(p2.x(), p2.y(), p2.x() + width, p2.y() + width); - - if (isVerticalLine) { - r1.offset(-width / 2, 0); - r2.offset(-width / 2, -width); - } else { - r1.offset(0, -width / 2); - r2.offset(-width, -width / 2); - } - SkPaint fillPaint; - fillPaint.setColor(paint.getColor()); - drawRect(r1, fillPaint); - drawRect(r2, fillPaint); - } - - adjustLineToPixelBoundaries(p1, p2, width, penStyle); - SkPoint pts[2] = {p1.data(), p2.data()}; - - m_canvas->drawPoints(SkCanvas::kLines_PointMode, 2, pts, paint); - - if (regionTrackingEnabled()) - m_trackedRegion.didDrawPoints(this, SkCanvas::kLines_PointMode, 2, pts, - paint); -} - -void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, - float width, - DocumentMarkerLineStyle style) { - if (contextDisabled()) - return; - - // Use 2x resources for a device scale factor of 1.5 or above. - int deviceScaleFactor = m_deviceScaleFactor > 1.5f ? 2 : 1; - - // Create the pattern we'll use to draw the underline. - int index = style == DocumentMarkerGrammarLineStyle ? 1 : 0; - static SkBitmap* misspellBitmap1x[2] = {0, 0}; - static SkBitmap* misspellBitmap2x[2] = {0, 0}; - SkBitmap** misspellBitmap = - deviceScaleFactor == 2 ? misspellBitmap2x : misspellBitmap1x; - if (!misspellBitmap[index]) { - // We use a 2-pixel-high misspelling indicator because that seems to be - // what WebKit is designed for, and how much room there is in a typical - // page for it. - const int rowPixels = - 32 * deviceScaleFactor; // Must be multiple of 4 for pattern below. - const int colPixels = 2 * deviceScaleFactor; - SkBitmap bitmap; - bitmap.allocN32Pixels(rowPixels, colPixels); - - bitmap.eraseARGB(0, 0, 0, 0); - if (deviceScaleFactor == 1) - draw1xMarker(&bitmap, index); - else if (deviceScaleFactor == 2) - draw2xMarker(&bitmap, index); - else - ASSERT_NOT_REACHED(); - - misspellBitmap[index] = new SkBitmap(bitmap); - } - - SkScalar originX = WebCoreFloatToSkScalar(pt.x()); - - // Offset it vertically by 1 so that there's some space under the text. - SkScalar originY = WebCoreFloatToSkScalar(pt.y()) + 1; - originX *= deviceScaleFactor; - originY *= deviceScaleFactor; - - SkMatrix localMatrix; - localMatrix.setTranslate(originX, originY); - - SkPaint paint; - paint.setShader(SkShader::MakeBitmapShader( - *misspellBitmap[index], SkShader::kRepeat_TileMode, - SkShader::kRepeat_TileMode, &localMatrix)); - - SkRect rect; - rect.set(originX, originY, - originX + WebCoreFloatToSkScalar(width) * deviceScaleFactor, - originY + SkIntToScalar(misspellBitmap[index]->height())); - - if (deviceScaleFactor == 2) { - save(); - scale(0.5, 0.5); - } - drawRect(rect, paint); - if (deviceScaleFactor == 2) - restore(); -} - -void GraphicsContext::drawLineForText(const FloatPoint& pt, float width) { - if (contextDisabled()) - return; - - if (width <= 0) - return; - - SkPaint paint; - switch (strokeStyle()) { - case NoStroke: - case SolidStroke: - case DoubleStroke: - case WavyStroke: { - int thickness = SkMax32(static_cast(strokeThickness()), 1); - SkRect r; - r.fLeft = WebCoreFloatToSkScalar(pt.x()); - // Avoid anti-aliasing lines. Currently, these are always horizontal. - // Round to nearest pixel to match text and other content. - r.fTop = WebCoreFloatToSkScalar(floorf(pt.y() + 0.5f)); - r.fRight = r.fLeft + WebCoreFloatToSkScalar(width); - r.fBottom = r.fTop + SkIntToScalar(thickness); - paint = immutableState()->fillPaint(); - // Text lines are drawn using the stroke color. - paint.setColor(effectiveStrokeColor()); - drawRect(r, paint); - return; - } - case DottedStroke: - case DashedStroke: { - int y = floorf(pt.y() + std::max(strokeThickness() / 2.0f, 0.5f)); - drawLine(IntPoint(pt.x(), y), IntPoint(pt.x() + width, y)); - return; - } - } - - ASSERT_NOT_REACHED(); -} - -// Draws a filled rectangle with a stroked border. -void GraphicsContext::drawRect(const IntRect& rect) { - if (contextDisabled()) - return; - - ASSERT(!rect.isEmpty()); - if (rect.isEmpty()) - return; - - SkRect skRect = rect; - int fillcolorNotTransparent = - immutableState()->fillColor().rgb() & 0xFF000000; - if (fillcolorNotTransparent) - drawRect(skRect, immutableState()->fillPaint()); - - if (immutableState()->strokeData().style() != NoStroke && - immutableState()->strokeData().color().alpha()) { - // Stroke a width: 1 inset border - SkPaint paint(immutableState()->fillPaint()); - paint.setColor(effectiveStrokeColor()); - paint.setStyle(SkPaint::kStroke_Style); - paint.setStrokeWidth(1); - - skRect.inset(0.5f, 0.5f); - drawRect(skRect, paint); - } -} - -void GraphicsContext::drawText(const Font& font, - const TextRunPaintInfo& runInfo, - const FloatPoint& point) { - if (contextDisabled()) - return; - - font.drawText(this, runInfo, point); -} - -void GraphicsContext::drawEmphasisMarks(const Font& font, - const TextRunPaintInfo& runInfo, - const AtomicString& mark, - const FloatPoint& point) { - if (contextDisabled()) - return; - - font.drawEmphasisMarks(this, runInfo, mark, point); -} - -void GraphicsContext::drawBidiText( - const Font& font, - const TextRunPaintInfo& runInfo, - const FloatPoint& point, - Font::CustomFontNotReadyAction customFontNotReadyAction) { - if (contextDisabled()) - return; - - // sub-run painting is not supported for Bidi text. - const TextRun& run = runInfo.run; - ASSERT((runInfo.from == 0) && (runInfo.to == run.length())); - BidiResolver bidiResolver; - bidiResolver.setStatus( - BidiStatus(run.direction(), run.directionalOverride())); - bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0)); - - // FIXME: This ownership should be reversed. We should pass BidiRunList - // to BidiResolver in createBidiRunsForLine. - BidiRunList& bidiRuns = bidiResolver.runs(); - bidiResolver.createBidiRunsForLine(TextRunIterator(&run, run.length())); - if (!bidiRuns.runCount()) - return; - - FloatPoint currPoint = point; - BidiCharacterRun* bidiRun = bidiRuns.firstRun(); - while (bidiRun) { - TextRun subrun = - run.subRun(bidiRun->start(), bidiRun->stop() - bidiRun->start()); - bool isRTL = bidiRun->level() % 2; - subrun.setDirection(isRTL ? RTL : LTR); - subrun.setDirectionalOverride(bidiRun->dirOverride()); - - TextRunPaintInfo subrunInfo(subrun); - subrunInfo.bounds = runInfo.bounds; - float runWidth = font.drawUncachedText(this, subrunInfo, currPoint, - customFontNotReadyAction); - - bidiRun = bidiRun->next(); - currPoint.move(runWidth, 0); - } - - bidiRuns.deleteRuns(); -} - -void GraphicsContext::drawHighlightForText(const Font& font, - const TextRun& run, - const FloatPoint& point, - int h, - const Color& backgroundColor, - int from, - int to) { - if (contextDisabled()) - return; - - fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor); -} - -void GraphicsContext::drawImage( - Image* image, - const IntPoint& p, - CompositeOperator op, - RespectImageOrientationEnum shouldRespectImageOrientation) { - if (!image) - return; - drawImage(image, FloatRect(IntRect(p, image->size())), - FloatRect(FloatPoint(), FloatSize(image->size())), op, - shouldRespectImageOrientation); -} - -void GraphicsContext::drawImage( - Image* image, - const IntRect& r, - CompositeOperator op, - RespectImageOrientationEnum shouldRespectImageOrientation) { - if (!image) - return; - drawImage(image, FloatRect(r), - FloatRect(FloatPoint(), FloatSize(image->size())), op, - shouldRespectImageOrientation); -} - -void GraphicsContext::drawImage( - Image* image, - const FloatRect& dest, - const FloatRect& src, - CompositeOperator op, - RespectImageOrientationEnum shouldRespectImageOrientation) { - drawImage(image, dest, src, op, WebBlendModeNormal, - shouldRespectImageOrientation); -} - -void GraphicsContext::drawImage(Image* image, const FloatRect& dest) { - if (!image) - return; - drawImage(image, dest, FloatRect(IntRect(IntPoint(), image->size()))); -} - -void GraphicsContext::drawImage( - Image* image, - const FloatRect& dest, - const FloatRect& src, - CompositeOperator op, - WebBlendMode blendMode, - RespectImageOrientationEnum shouldRespectImageOrientation) { - if (contextDisabled() || !image) - return; - image->draw(this, dest, src, op, blendMode, shouldRespectImageOrientation); -} - -void GraphicsContext::drawTiledImage(Image* image, - const IntRect& destRect, - const IntPoint& srcPoint, - const IntSize& tileSize, - CompositeOperator op, - WebBlendMode blendMode, - const IntSize& repeatSpacing) { - if (contextDisabled() || !image) - return; - image->drawTiled(this, destRect, srcPoint, tileSize, op, blendMode, - repeatSpacing); -} - -void GraphicsContext::drawTiledImage(Image* image, - const IntRect& dest, - const IntRect& srcRect, - const FloatSize& tileScaleFactor, - Image::TileRule hRule, - Image::TileRule vRule, - CompositeOperator op) { - if (contextDisabled() || !image) - return; - - if (hRule == Image::StretchTile && vRule == Image::StretchTile) { - // Just do a scale. - drawImage(image, dest, srcRect, op); - return; - } - - image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op); -} - -void GraphicsContext::drawBitmap(const SkBitmap& bitmap, - SkScalar left, - SkScalar top, - const SkPaint* paint) { - if (contextDisabled()) - return; - - m_canvas->drawBitmap(bitmap, left, top, paint); - - if (regionTrackingEnabled()) { - SkRect rect = SkRect::MakeXYWH(left, top, bitmap.width(), bitmap.height()); - m_trackedRegion.didDrawRect(this, rect, *paint, &bitmap); - } -} - -void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, - const SkRect* src, - const SkRect& dst, - const SkPaint* paint) { - if (contextDisabled()) - return; - - SkCanvas::SrcRectConstraint flags = - immutableState()->shouldClampToSourceRect() - ? SkCanvas::kStrict_SrcRectConstraint - : SkCanvas::kFast_SrcRectConstraint; - - m_canvas->drawBitmapRect(bitmap, *src, dst, paint, flags); - - if (regionTrackingEnabled()) - m_trackedRegion.didDrawRect(this, dst, *paint, &bitmap); -} - -void GraphicsContext::drawOval(const SkRect& oval, const SkPaint& paint) { - if (contextDisabled()) - return; - - m_canvas->drawOval(oval, paint); - - if (regionTrackingEnabled()) - m_trackedRegion.didDrawBounded(this, oval, paint); -} - -void GraphicsContext::drawPath(const SkPath& path, const SkPaint& paint) { - if (contextDisabled()) - return; - - m_canvas->drawPath(path, paint); - - if (regionTrackingEnabled()) - m_trackedRegion.didDrawPath(this, path, paint); -} - -void GraphicsContext::drawRect(const SkRect& rect, const SkPaint& paint) { - if (contextDisabled()) - return; - - m_canvas->drawRect(rect, paint); - - if (regionTrackingEnabled()) - m_trackedRegion.didDrawRect(this, rect, paint, 0); -} - -void GraphicsContext::drawRRect(const SkRRect& rrect, const SkPaint& paint) { - if (contextDisabled()) - return; - - m_canvas->drawRRect(rrect, paint); - - if (regionTrackingEnabled()) - m_trackedRegion.didDrawBounded(this, rrect.rect(), paint); -} - -void GraphicsContext::didDrawRect(const SkRect& rect, - const SkPaint& paint, - const SkBitmap* bitmap) { - if (contextDisabled()) - return; - - if (regionTrackingEnabled()) - m_trackedRegion.didDrawRect(this, rect, paint, bitmap); -} - -void GraphicsContext::drawPosText(const void* text, - size_t byteLength, - const SkPoint pos[], - const SkRect& textRect, - const SkPaint& paint) { - if (contextDisabled()) - return; - - m_canvas->drawPosText(text, byteLength, pos, paint); - didDrawTextInRect(textRect); - - // FIXME: compute bounds for positioned text. - if (regionTrackingEnabled()) - m_trackedRegion.didDrawUnbounded(this, paint, RegionTracker::FillOrStroke); -} - -void GraphicsContext::drawPosTextH(const void* text, - size_t byteLength, - const SkScalar xpos[], - SkScalar constY, - const SkRect& textRect, - const SkPaint& paint) { - if (contextDisabled()) - return; - - m_canvas->drawPosTextH(text, byteLength, xpos, constY, paint); - didDrawTextInRect(textRect); - - // FIXME: compute bounds for positioned text. - if (regionTrackingEnabled()) - m_trackedRegion.didDrawUnbounded(this, paint, RegionTracker::FillOrStroke); -} - -void GraphicsContext::drawTextBlob(const SkTextBlob* blob, - const SkPoint& origin, - const SkPaint& paint) { - if (contextDisabled()) - return; - - m_canvas->drawTextBlob(blob, origin.x(), origin.y(), paint); - - SkRect bounds = blob->bounds(); - bounds.offset(origin); - didDrawTextInRect(bounds); - - // FIXME: use bounds here if it helps performance. - if (regionTrackingEnabled()) - m_trackedRegion.didDrawUnbounded(this, paint, RegionTracker::FillOrStroke); -} - -void GraphicsContext::fillPath(const Path& pathToFill) { - if (contextDisabled() || pathToFill.isEmpty()) - return; - - // Use const_cast and temporarily modify the fill type instead of copying the - // path. - SkPath& path = const_cast(pathToFill.skPath()); - SkPath::FillType previousFillType = path.getFillType(); - - SkPath::FillType temporaryFillType = - WebCoreWindRuleToSkFillType(immutableState()->fillRule()); - path.setFillType(temporaryFillType); - - drawPath(path, immutableState()->fillPaint()); - - path.setFillType(previousFillType); -} - -void GraphicsContext::fillRect(const FloatRect& rect) { - if (contextDisabled()) - return; - - SkRect r = rect; - - drawRect(r, immutableState()->fillPaint()); -} - -void GraphicsContext::fillRect(const FloatRect& rect, const Color& color) { - if (contextDisabled()) - return; - - SkRect r = rect; - SkPaint paint = immutableState()->fillPaint(); - paint.setColor(color.rgb()); - drawRect(r, paint); -} - -void GraphicsContext::fillBetweenRoundedRects(const IntRect& outer, - const IntSize& outerTopLeft, - const IntSize& outerTopRight, - const IntSize& outerBottomLeft, - const IntSize& outerBottomRight, - const IntRect& inner, - const IntSize& innerTopLeft, - const IntSize& innerTopRight, - const IntSize& innerBottomLeft, - const IntSize& innerBottomRight, - const Color& color) { - if (contextDisabled()) - return; - - SkVector outerRadii[4]; - SkVector innerRadii[4]; - setRadii(outerRadii, outerTopLeft, outerTopRight, outerBottomRight, - outerBottomLeft); - setRadii(innerRadii, innerTopLeft, innerTopRight, innerBottomRight, - innerBottomLeft); - - SkRRect rrOuter; - SkRRect rrInner; - rrOuter.setRectRadii(outer, outerRadii); - rrInner.setRectRadii(inner, innerRadii); - - SkPaint paint(immutableState()->fillPaint()); - paint.setColor(color.rgb()); - - m_canvas->drawDRRect(rrOuter, rrInner, paint); - - if (regionTrackingEnabled()) - m_trackedRegion.didDrawBounded(this, rrOuter.getBounds(), paint); -} - -void GraphicsContext::fillBetweenRoundedRects(const RoundedRect& outer, - const RoundedRect& inner, - const Color& color) { - fillBetweenRoundedRects( - outer.rect(), outer.radii().topLeft(), outer.radii().topRight(), - outer.radii().bottomLeft(), outer.radii().bottomRight(), inner.rect(), - inner.radii().topLeft(), inner.radii().topRight(), - inner.radii().bottomLeft(), inner.radii().bottomRight(), color); -} - -void GraphicsContext::fillRoundedRect(const IntRect& rect, - const IntSize& topLeft, - const IntSize& topRight, - const IntSize& bottomLeft, - const IntSize& bottomRight, - const Color& color) { - if (contextDisabled()) - return; - - if (topLeft.width() + topRight.width() > rect.width() || - bottomLeft.width() + bottomRight.width() > rect.width() || - topLeft.height() + bottomLeft.height() > rect.height() || - topRight.height() + bottomRight.height() > rect.height()) { - // Not all the radii fit, return a rect. This matches the behavior of - // Path::createRoundedRectangle. Without this we attempt to draw a round - // shadow for a square box. - fillRect(rect, color); - return; - } - - SkVector radii[4]; - setRadii(radii, topLeft, topRight, bottomRight, bottomLeft); - - SkRRect rr; - rr.setRectRadii(rect, radii); - - SkPaint paint(immutableState()->fillPaint()); - paint.setColor(color.rgb()); - - m_canvas->drawRRect(rr, paint); - - if (regionTrackingEnabled()) - m_trackedRegion.didDrawBounded(this, rr.getBounds(), paint); -} - -void GraphicsContext::fillEllipse(const FloatRect& ellipse) { - if (contextDisabled()) - return; - - SkRect rect = ellipse; - drawOval(rect, immutableState()->fillPaint()); -} - -void GraphicsContext::strokePath(const Path& pathToStroke) { - if (contextDisabled() || pathToStroke.isEmpty()) - return; - - const SkPath& path = pathToStroke.skPath(); - drawPath(path, immutableState()->strokePaint()); -} - -void GraphicsContext::strokeRect(const FloatRect& rect) { - strokeRect(rect, strokeThickness()); -} - -void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth) { - if (contextDisabled()) - return; - - SkPaint paint(immutableState()->strokePaint()); - paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth)); - // Reset the dash effect to account for the width - immutableState()->strokeData().setupPaintDashPathEffect(&paint, 0); - // strokerect has special rules for CSS when the rect is degenerate: - // if width==0 && height==0, do nothing - // if width==0 || height==0, then just draw line for the other dimension - SkRect r(rect); - bool validW = r.width() > 0; - bool validH = r.height() > 0; - if (validW && validH) { - drawRect(r, paint); - } else if (validW || validH) { - // we are expected to respect the lineJoin, so we can't just call - // drawLine -- we have to create a path that doubles back on itself. - SkPath path; - path.moveTo(r.fLeft, r.fTop); - path.lineTo(r.fRight, r.fBottom); - path.close(); - drawPath(path, paint); - } -} - -void GraphicsContext::strokeEllipse(const FloatRect& ellipse) { - if (contextDisabled()) - return; - - drawOval(ellipse, immutableState()->strokePaint()); -} - -void GraphicsContext::clipRoundedRect(const RoundedRect& rect, - SkClipOp clipOp) { - if (contextDisabled()) - return; - - if (!rect.isRounded()) { - clipRect(rect.rect(), NotAntiAliased, clipOp); - return; - } - - SkVector radii[4]; - RoundedRect::Radii wkRadii = rect.radii(); - setRadii(radii, wkRadii.topLeft(), wkRadii.topRight(), wkRadii.bottomRight(), - wkRadii.bottomLeft()); - - SkRRect r; - r.setRectRadii(rect.rect(), radii); - - clipRRect(r, AntiAliased, clipOp); -} - -void GraphicsContext::clipOut(const Path& pathToClip) { - if (contextDisabled()) - return; - - // Use const_cast and temporarily toggle the inverse fill type instead of - // copying the path. - SkPath& path = const_cast(pathToClip.skPath()); - path.toggleInverseFillType(); - clipPath(path, AntiAliased); - path.toggleInverseFillType(); -} - -void GraphicsContext::clipPath(const Path& pathToClip, WindRule clipRule) { - if (contextDisabled() || pathToClip.isEmpty()) - return; - - // Use const_cast and temporarily modify the fill type instead of copying the - // path. - SkPath& path = const_cast(pathToClip.skPath()); - SkPath::FillType previousFillType = path.getFillType(); - - SkPath::FillType temporaryFillType = WebCoreWindRuleToSkFillType(clipRule); - path.setFillType(temporaryFillType); - clipPath(path, AntiAliased); - - path.setFillType(previousFillType); -} - -void GraphicsContext::clipConvexPolygon(size_t numPoints, - const FloatPoint* points, - bool antialiased) { - if (contextDisabled()) - return; - - if (numPoints <= 1) - return; - - SkPath path; - setPathFromConvexPoints(&path, numPoints, points); - clipPath(path, antialiased ? AntiAliased : NotAntiAliased); -} - -void GraphicsContext::clipOutRoundedRect(const RoundedRect& rect) { - if (contextDisabled()) - return; - - clipRoundedRect(rect, SkClipOp::kDifference); -} - -void GraphicsContext::canvasClip(const Path& pathToClip, WindRule clipRule) { - if (contextDisabled()) - return; - - // Use const_cast and temporarily modify the fill type instead of copying the - // path. - SkPath& path = const_cast(pathToClip.skPath()); - SkPath::FillType previousFillType = path.getFillType(); - - SkPath::FillType temporaryFillType = WebCoreWindRuleToSkFillType(clipRule); - path.setFillType(temporaryFillType); - clipPath(path); - - path.setFillType(previousFillType); -} - -void GraphicsContext::clipRect(const SkRect& rect, - AntiAliasingMode aa, - SkClipOp op) { - if (contextDisabled()) - return; - - realizeCanvasSave(); - - m_canvas->clipRect(rect, op, aa == AntiAliased); -} - -void GraphicsContext::clipPath(const SkPath& path, - AntiAliasingMode aa, - SkClipOp op) { - if (contextDisabled()) - return; - - realizeCanvasSave(); - - m_canvas->clipPath(path, op, aa == AntiAliased); -} - -void GraphicsContext::clipRRect(const SkRRect& rect, - AntiAliasingMode aa, - SkClipOp op) { - if (contextDisabled()) - return; - - realizeCanvasSave(); - - m_canvas->clipRRect(rect, op, aa == AntiAliased); -} - -void GraphicsContext::rotate(float angleInRadians) { - if (contextDisabled()) - return; - - realizeCanvasSave(); - - m_canvas->rotate( - WebCoreFloatToSkScalar(angleInRadians * (180.0f / 3.14159265f))); -} - -void GraphicsContext::translate(float x, float y) { - if (contextDisabled()) - return; - - if (!x && !y) - return; - - realizeCanvasSave(); - - m_canvas->translate(WebCoreFloatToSkScalar(x), WebCoreFloatToSkScalar(y)); -} - -void GraphicsContext::scale(float x, float y) { - if (contextDisabled()) - return; - - if (x == 1.0f && y == 1.0f) - return; - - realizeCanvasSave(); - - m_canvas->scale(WebCoreFloatToSkScalar(x), WebCoreFloatToSkScalar(y)); -} - -AffineTransform GraphicsContext::getCTM() const { - if (contextDisabled()) - return AffineTransform(); - - SkMatrix m = getTotalMatrix(); - return AffineTransform( - SkScalarToDouble(m.getScaleX()), SkScalarToDouble(m.getSkewY()), - SkScalarToDouble(m.getSkewX()), SkScalarToDouble(m.getScaleY()), - SkScalarToDouble(m.getTranslateX()), SkScalarToDouble(m.getTranslateY())); -} - -void GraphicsContext::fillRect(const FloatRect& rect, - const Color& color, - CompositeOperator op) { - if (contextDisabled()) - return; - - CompositeOperator previousOperator = compositeOperation(); - setCompositeOperation(op); - fillRect(rect, color); - setCompositeOperation(previousOperator); -} - -void GraphicsContext::fillRoundedRect(const RoundedRect& rect, - const Color& color) { - if (contextDisabled()) - return; - - if (rect.isRounded()) - fillRoundedRect(rect.rect(), rect.radii().topLeft(), - rect.radii().topRight(), rect.radii().bottomLeft(), - rect.radii().bottomRight(), color); - else - fillRect(rect.rect(), color); -} - -void GraphicsContext::fillRectWithRoundedHole( - const IntRect& rect, - const RoundedRect& roundedHoleRect, - const Color& color) { - if (contextDisabled()) - return; - - Path path; - path.addRect(rect); - - if (!roundedHoleRect.radii().isZero()) - path.addRoundedRect(roundedHoleRect); - else - path.addRect(roundedHoleRect.rect()); - - WindRule oldFillRule = fillRule(); - Color oldFillColor = fillColor(); - - setFillRule(RULE_EVENODD); - setFillColor(color); - - fillPath(path); - - setFillRule(oldFillRule); - setFillColor(oldFillColor); -} - -void GraphicsContext::clearRect(const FloatRect& rect) { - if (contextDisabled()) - return; - - SkRect r = rect; - SkPaint paint(immutableState()->fillPaint()); - paint.setBlendMode(SkBlendMode::kClear); - drawRect(r, paint); -} - -void GraphicsContext::adjustLineToPixelBoundaries(FloatPoint& p1, - FloatPoint& p2, - float strokeWidth, - StrokeStyle penStyle) { - // For odd widths, we add in 0.5 to the appropriate x/y so that the float - // arithmetic works out. For example, with a border width of 3, WebKit will - // pass us (y1+y2)/2, e.g., (50+53)/2 = 103/2 = 51 when we want 51.5. It is - // always true that an even width gave us a perfect position, but an odd width - // gave us a position that is off by exactly 0.5. - if (penStyle == DottedStroke || penStyle == DashedStroke) { - if (p1.x() == p2.x()) { - p1.setY(p1.y() + strokeWidth); - p2.setY(p2.y() - strokeWidth); - } else { - p1.setX(p1.x() + strokeWidth); - p2.setX(p2.x() - strokeWidth); - } - } - - if (static_cast(strokeWidth) % 2) { // odd - if (p1.x() == p2.x()) { - // We're a vertical line. Adjust our x. - p1.setX(p1.x() + 0.5f); - p2.setX(p2.x() + 0.5f); - } else { - // We're a horizontal line. Adjust our y. - p1.setY(p1.y() + 0.5f); - p2.setY(p2.y() + 0.5f); - } - } -} - -void GraphicsContext::setPathFromConvexPoints(SkPath* path, - size_t numPoints, - const FloatPoint* points) { - path->incReserve(numPoints); - path->moveTo(WebCoreFloatToSkScalar(points[0].x()), - WebCoreFloatToSkScalar(points[0].y())); - for (size_t i = 1; i < numPoints; ++i) { - path->lineTo(WebCoreFloatToSkScalar(points[i].x()), - WebCoreFloatToSkScalar(points[i].y())); - } -} - -void GraphicsContext::setRadii(SkVector* radii, - IntSize topLeft, - IntSize topRight, - IntSize bottomRight, - IntSize bottomLeft) { - radii[SkRRect::kUpperLeft_Corner].set(SkIntToScalar(topLeft.width()), - SkIntToScalar(topLeft.height())); - radii[SkRRect::kUpperRight_Corner].set(SkIntToScalar(topRight.width()), - SkIntToScalar(topRight.height())); - radii[SkRRect::kLowerRight_Corner].set(SkIntToScalar(bottomRight.width()), - SkIntToScalar(bottomRight.height())); - radii[SkRRect::kLowerLeft_Corner].set(SkIntToScalar(bottomLeft.width()), - SkIntToScalar(bottomLeft.height())); -} - -void GraphicsContext::draw2xMarker(SkBitmap* bitmap, int index) { - const SkPMColor lineColor = lineColors(index); - const SkPMColor antiColor1 = antiColors1(index); - const SkPMColor antiColor2 = antiColors2(index); - - uint32_t* row1 = bitmap->getAddr32(0, 0); - uint32_t* row2 = bitmap->getAddr32(0, 1); - uint32_t* row3 = bitmap->getAddr32(0, 2); - uint32_t* row4 = bitmap->getAddr32(0, 3); - - // Pattern: X0o o0X0o o0 - // XX0o o0XXX0o o0X - // o0XXX0o o0XXX0o - // o0X0o o0X0o - const SkPMColor row1Color[] = {lineColor, antiColor1, antiColor2, 0, - 0, 0, antiColor2, antiColor1}; - const SkPMColor row2Color[] = {lineColor, lineColor, antiColor1, antiColor2, - 0, antiColor2, antiColor1, lineColor}; - const SkPMColor row3Color[] = {0, antiColor2, antiColor1, lineColor, - lineColor, lineColor, antiColor1, antiColor2}; - const SkPMColor row4Color[] = {0, 0, antiColor2, antiColor1, - lineColor, antiColor1, antiColor2, 0}; - - for (int x = 0; x < bitmap->width() + 8; x += 8) { - int count = std::min(bitmap->width() - x, 8); - if (count > 0) { - memcpy(row1 + x, row1Color, count * sizeof(SkPMColor)); - memcpy(row2 + x, row2Color, count * sizeof(SkPMColor)); - memcpy(row3 + x, row3Color, count * sizeof(SkPMColor)); - memcpy(row4 + x, row4Color, count * sizeof(SkPMColor)); - } - } -} - -void GraphicsContext::draw1xMarker(SkBitmap* bitmap, int index) { - const uint32_t lineColor = lineColors(index); - const uint32_t antiColor = antiColors2(index); - - // Pattern: X o o X o o X - // o X o o X o - uint32_t* row1 = bitmap->getAddr32(0, 0); - uint32_t* row2 = bitmap->getAddr32(0, 1); - for (int x = 0; x < bitmap->width(); x++) { - switch (x % 4) { - case 0: - row1[x] = lineColor; - break; - case 1: - row1[x] = antiColor; - row2[x] = antiColor; - break; - case 2: - row2[x] = lineColor; - break; - case 3: - row1[x] = antiColor; - row2[x] = antiColor; - break; - } - } -} - -SkPMColor GraphicsContext::lineColors(int index) { - static const SkPMColor colors[] = { - SkPreMultiplyARGB(0xFF, 0xFF, 0x00, 0x00), // Opaque red. - SkPreMultiplyARGB(0xFF, 0xC0, 0xC0, 0xC0) // Opaque gray. - }; - - return colors[index]; -} - -SkPMColor GraphicsContext::antiColors1(int index) { - static const SkPMColor colors[] = { - SkPreMultiplyARGB(0xB0, 0xFF, 0x00, 0x00), // Semitransparent red. - SkPreMultiplyARGB(0xB0, 0xC0, 0xC0, 0xC0) // Semitransparent gray. - }; - - return colors[index]; -} - -SkPMColor GraphicsContext::antiColors2(int index) { - static const SkPMColor colors[] = { - SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red - SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray - }; - - return colors[index]; -} - -void GraphicsContext::didDrawTextInRect(const SkRect& textRect) { - if (m_trackTextRegion) - m_textRegion.join(textRect); -} - -void GraphicsContext::preparePaintForDrawRectToRect( - SkPaint* paint, - const SkRect& srcRect, - const SkRect& destRect, - CompositeOperator compositeOp, - WebBlendMode blendMode, - bool isLazyDecoded, - bool isDataComplete) const { - paint->setBlendMode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode)); - paint->setColorFilter(sk_ref_sp(this->colorFilter())); - paint->setAlpha(this->getNormalizedAlpha()); - paint->setLooper(this->drawLooper()); - paint->setAntiAlias(shouldDrawAntiAliased(this, destRect)); - - InterpolationQuality resampling; - if (this->isAccelerated()) { - resampling = InterpolationLow; - } else if (isLazyDecoded) { - resampling = InterpolationHigh; - } else { - // Take into account scale applied to the canvas when computing sampling - // mode (e.g. CSS scale or page scale). - SkRect destRectTarget = destRect; - SkMatrix totalMatrix = this->getTotalMatrix(); - if (!(totalMatrix.getType() & - (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask))) - totalMatrix.mapRect(&destRectTarget, destRect); - - resampling = computeInterpolationQuality( - totalMatrix, SkScalarToFloat(srcRect.width()), - SkScalarToFloat(srcRect.height()), - SkScalarToFloat(destRectTarget.width()), - SkScalarToFloat(destRectTarget.height()), isDataComplete); - } - - if (resampling == InterpolationNone) { - // FIXME: This is to not break tests (it results in the filter bitmap flag - // being set to true). We need to decide if we respect InterpolationNone - // being returned from computeInterpolationQuality. - resampling = InterpolationLow; - } - resampling = limitInterpolationQuality(this, resampling); - paint->setFilterQuality(static_cast(resampling)); -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/GraphicsContext.h b/sky/engine/platform/graphics/GraphicsContext.h deleted file mode 100644 index dd7350d737abd..0000000000000 --- a/sky/engine/platform/graphics/GraphicsContext.h +++ /dev/null @@ -1,633 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2008-2009 Torch Mobile, Inc. - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXT_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXT_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/Font.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/graphics/DashArray.h" -#include "flutter/sky/engine/platform/graphics/DrawLooperBuilder.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContextState.h" -#include "flutter/sky/engine/platform/graphics/ImageFilter.h" -#include "flutter/sky/engine/platform/graphics/ImageOrientation.h" -#include "flutter/sky/engine/platform/graphics/RegionTracker.h" -#include "flutter/sky/engine/platform/graphics/skia/SkiaUtils.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -class SkBitmap; -class SkPaint; -class SkPath; -class SkRRect; -class SkTextBlob; -struct SkRect; - -namespace blink { - -class KURL; - -class PLATFORM_EXPORT GraphicsContext { - WTF_MAKE_NONCOPYABLE(GraphicsContext); - WTF_MAKE_FAST_ALLOCATED; - - public: - enum AntiAliasingMode { NotAntiAliased, AntiAliased }; - enum AccessMode { ReadOnly, ReadWrite }; - - enum DisabledMode { - NothingDisabled = 0, // Run as normal. - FullyDisabled = 1 // Do absolutely minimal work to remove the cost of the - // context from performance tests. - }; - - explicit GraphicsContext(SkCanvas*, DisabledMode = NothingDisabled); - ~GraphicsContext(); - - // Returns the canvas used for painting. Must not be called if painting is - // disabled. Accessing the backing canvas this way flushes all queued save - // ops, so it should be avoided. Use the corresponding draw/matrix/clip - // methods instead. - SkCanvas* canvas() { - // Flush any pending saves. - realizeCanvasSave(); - - return m_canvas; - } - const SkCanvas* canvas() const { return m_canvas; } - - void resetCanvas(SkCanvas*); - - bool contextDisabled() const { return m_disabledState; } - - // ---------- State management methods ----------------- - void save(); - void restore(); - unsigned saveCount() { return m_canvasStateStack.size(); } -#if ENABLE(ASSERT) - void disableDestructionChecks() { m_disableDestructionChecks = true; } -#endif - - void saveLayer(const SkRect* bounds, const SkPaint*); - void restoreLayer(); - - bool hasStroke() const { - return strokeStyle() != NoStroke && strokeThickness() > 0; - } - - float strokeThickness() const { - return immutableState()->strokeData().thickness(); - } - void setStrokeThickness(float thickness) { - mutableState()->setStrokeThickness(thickness); - } - - StrokeStyle strokeStyle() const { - return immutableState()->strokeData().style(); - } - void setStrokeStyle(StrokeStyle style) { - mutableState()->setStrokeStyle(style); - } - - Color strokeColor() const { return immutableState()->strokeData().color(); } - void setStrokeColor(const Color& color) { - mutableState()->setStrokeColor(color); - } - SkColor effectiveStrokeColor() const { - return immutableState()->effectiveStrokeColor(); - } - - Pattern* strokePattern() const { - return immutableState()->strokeData().pattern(); - } - void setStrokePattern(PassRefPtr); - - Gradient* strokeGradient() const { - return immutableState()->strokeData().gradient(); - } - void setStrokeGradient(PassRefPtr); - - void setLineCap(LineCap cap) { mutableState()->setLineCap(cap); } - void setLineDash(const DashArray& dashes, float dashOffset) { - mutableState()->setLineDash(dashes, dashOffset); - } - void setLineJoin(LineJoin join) { mutableState()->setLineJoin(join); } - void setMiterLimit(float limit) { mutableState()->setMiterLimit(limit); } - - WindRule fillRule() const { return immutableState()->fillRule(); } - void setFillRule(WindRule fillRule) { mutableState()->setFillRule(fillRule); } - - Color fillColor() const { return immutableState()->fillColor(); } - void setFillColor(const Color& color) { mutableState()->setFillColor(color); } - SkColor effectiveFillColor() const { - return immutableState()->effectiveFillColor(); - } - - void setFillPattern(PassRefPtr); - Pattern* fillPattern() const { return immutableState()->fillPattern(); } - - void setFillGradient(PassRefPtr); - Gradient* fillGradient() const { return immutableState()->fillGradient(); } - - const sk_sp& drawLooper() const { - return immutableState()->drawLooper(); - } - - bool getTransformedClipBounds(FloatRect* bounds) const; - SkMatrix getTotalMatrix() const; - - void setShouldAntialias(bool antialias) { - mutableState()->setShouldAntialias(antialias); - } - bool shouldAntialias() const { return immutableState()->shouldAntialias(); } - - // Disable the anti-aliasing optimization for scales/multiple-of-90-degrees - // rotations of thin ("hairline") images. - // Note: This will only be reliable when the device pixel scale/ratio is - // fixed (e.g. when drawing to context backed by an ImageBuffer). - void disableAntialiasingOptimizationForHairlineImages() { - m_antialiasHairlineImages = true; - } - bool shouldAntialiasHairlineImages() const { - return m_antialiasHairlineImages; - } - - void setShouldClampToSourceRect(bool clampToSourceRect) { - mutableState()->setShouldClampToSourceRect(clampToSourceRect); - } - bool shouldClampToSourceRect() const { - return immutableState()->shouldClampToSourceRect(); - } - - // FIXME: the setter is only used once, at construction time; convert to a - // constructor param, and possibly consolidate with other flags - // (paintDisabled, isPrinting, ...) - void setShouldSmoothFonts(bool smoothFonts) { - m_shouldSmoothFonts = smoothFonts; - } - - // Turn off LCD text for the paint if not supported on this context. - void adjustTextRenderMode(SkPaint*); - bool couldUseLCDRenderedText() const { - return m_isCertainlyOpaque && m_shouldSmoothFonts; - } - - void setTextDrawingMode(TextDrawingModeFlags mode) { - mutableState()->setTextDrawingMode(mode); - } - TextDrawingModeFlags textDrawingMode() const { - return immutableState()->textDrawingMode(); - } - - void setAlphaAsFloat(float alpha) { mutableState()->setAlphaAsFloat(alpha); } - int getNormalizedAlpha() const { - int alpha = immutableState()->alpha(); - return alpha > 255 ? 255 : alpha; - } - - void setImageInterpolationQuality(InterpolationQuality quality) { - mutableState()->setInterpolationQuality(quality); - } - InterpolationQuality imageInterpolationQuality() const { - return immutableState()->interpolationQuality(); - } - - void setCompositeOperation(CompositeOperator, - WebBlendMode = WebBlendModeNormal); - CompositeOperator compositeOperation() const { - return immutableState()->compositeOperator(); - } - WebBlendMode blendModeOperation() const { - return immutableState()->blendMode(); - } - - // Speicy the device scale factor which may change the way document markers - // and fonts are rendered. - void setDeviceScaleFactor(float factor) { m_deviceScaleFactor = factor; } - float deviceScaleFactor() const { return m_deviceScaleFactor; } - - // If true we are (most likely) rendering to a web page and the - // canvas has been prepared with an opaque background. If false, - // the canvas may have transparency (as is the case when rendering - // to a canvas object). - void setCertainlyOpaque(bool isOpaque) { m_isCertainlyOpaque = isOpaque; } - - bool isAccelerated() const { return m_accelerated; } - void setAccelerated(bool accelerated) { m_accelerated = accelerated; } - - // The opaque region is empty until tracking is turned on. - // It is never clerared by the context. - enum RegionTrackingMode { - RegionTrackingDisabled = 0, - RegionTrackingOpaque, - RegionTrackingOverwrite - }; - void setRegionTrackingMode(RegionTrackingMode); - bool regionTrackingEnabled() { - return m_regionTrackingMode != RegionTrackingDisabled; - } - const RegionTracker& opaqueRegion() const { return m_trackedRegion; } - - // The text region is empty until tracking is turned on. - // It is never clerared by the context. - void setTrackTextRegion(bool track) { m_trackTextRegion = track; } - const SkRect& textRegion() const { return m_textRegion; } - - SkColorFilter* colorFilter() const; - void setColorFilter(ColorFilterObsolete); - // ---------- End state management methods ----------------- - - // Get the contents of the image buffer - bool readPixels(const SkImageInfo&, - void* pixels, - size_t rowBytes, - int x, - int y); - - // Get the current fill style. - const SkPaint& fillPaint() const { return immutableState()->fillPaint(); } - - // Get the current stroke style. - const SkPaint& strokePaint() const { return immutableState()->strokePaint(); } - - // These draw methods will do both stroking and filling. - // FIXME: ...except drawRect(), which fills properly but always strokes - // using a 1-pixel stroke inset from the rect borders (of the correct - // stroke color). - void drawRect(const IntRect&); - void drawLine(const IntPoint&, const IntPoint&); - void drawConvexPolygon(size_t numPoints, - const FloatPoint*, - bool shouldAntialias = false); - - void fillPath(const Path&); - void strokePath(const Path&); - - void fillEllipse(const FloatRect&); - void strokeEllipse(const FloatRect&); - - void fillRect(const FloatRect&); - void fillRect(const FloatRect&, const Color&); - void fillRect(const FloatRect&, const Color&, CompositeOperator); - void fillRoundedRect(const IntRect&, - const IntSize& topLeft, - const IntSize& topRight, - const IntSize& bottomLeft, - const IntSize& bottomRight, - const Color&); - void fillRoundedRect(const RoundedRect&, const Color&); - - void clearRect(const FloatRect&); - - void strokeRect(const FloatRect&); - void strokeRect(const FloatRect&, float lineWidth); - - void fillBetweenRoundedRects(const IntRect&, - const IntSize& outerTopLeft, - const IntSize& outerTopRight, - const IntSize& outerBottomLeft, - const IntSize& outerBottomRight, - const IntRect&, - const IntSize& innerTopLeft, - const IntSize& innerTopRight, - const IntSize& innerBottomLeft, - const IntSize& innerBottomRight, - const Color&); - void fillBetweenRoundedRects(const RoundedRect&, - const RoundedRect&, - const Color&); - - void drawImage(Image*, - const IntPoint&, - CompositeOperator = CompositeSourceOver, - RespectImageOrientationEnum = DoNotRespectImageOrientation); - void drawImage(Image*, - const IntRect&, - CompositeOperator = CompositeSourceOver, - RespectImageOrientationEnum = DoNotRespectImageOrientation); - void drawImage(Image*, const FloatRect& destRect); - void drawImage(Image*, - const FloatRect& destRect, - const FloatRect& srcRect, - CompositeOperator = CompositeSourceOver, - RespectImageOrientationEnum = DoNotRespectImageOrientation); - void drawImage(Image*, - const FloatRect& destRect, - const FloatRect& srcRect, - CompositeOperator, - WebBlendMode, - RespectImageOrientationEnum = DoNotRespectImageOrientation); - - void drawTiledImage(Image*, - const IntRect& destRect, - const IntPoint& srcPoint, - const IntSize& tileSize, - CompositeOperator = CompositeSourceOver, - WebBlendMode = WebBlendModeNormal, - const IntSize& repeatSpacing = IntSize()); - void drawTiledImage(Image*, - const IntRect& destRect, - const IntRect& srcRect, - const FloatSize& tileScaleFactor, - Image::TileRule hRule = Image::StretchTile, - Image::TileRule vRule = Image::StretchTile, - CompositeOperator = CompositeSourceOver); - - void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0); - void drawBitmapRect(const SkBitmap&, - const SkRect*, - const SkRect&, - const SkPaint* = 0); - void drawOval(const SkRect&, const SkPaint&); - void drawPath(const SkPath&, const SkPaint&); - // After drawing directly to the context's canvas, use this function to notify - // the context so it can track the opaque region. - // FIXME: this is still needed only because ImageSkia::paintSkBitmap() may - // need to notify for a - // smaller rect than the one drawn to, due to its clipping logic. - void didDrawRect(const SkRect&, const SkPaint&, const SkBitmap* = 0); - void drawRect(const SkRect&, const SkPaint&); - void drawPosText(const void* text, - size_t byteLength, - const SkPoint pos[], - const SkRect& textRect, - const SkPaint&); - void drawPosTextH(const void* text, - size_t byteLength, - const SkScalar xpos[], - SkScalar constY, - const SkRect& textRect, - const SkPaint&); - void drawTextBlob(const SkTextBlob*, const SkPoint& origin, const SkPaint&); - - void clip(const IntRect& rect) { clipRect(rect); } - void clip(const FloatRect& rect) { clipRect(rect); } - void clipRoundedRect(const RoundedRect&, SkClipOp = SkClipOp::kIntersect); - void clipOut(const IntRect& rect) { - clipRect(rect, NotAntiAliased, SkClipOp::kDifference); - } - void clipOutRoundedRect(const RoundedRect&); - void clipPath(const Path&, WindRule = RULE_EVENODD); - void clipConvexPolygon(size_t numPoints, - const FloatPoint*, - bool antialias = true); - void clipRect(const SkRect&, - AntiAliasingMode = NotAntiAliased, - SkClipOp = SkClipOp::kIntersect); - - void drawText(const Font&, const TextRunPaintInfo&, const FloatPoint&); - void drawEmphasisMarks(const Font&, - const TextRunPaintInfo&, - const AtomicString& mark, - const FloatPoint&); - void drawBidiText( - const Font&, - const TextRunPaintInfo&, - const FloatPoint&, - Font::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady); - void drawHighlightForText(const Font&, - const TextRun&, - const FloatPoint&, - int h, - const Color& backgroundColor, - int from = 0, - int to = -1); - - void drawLineForText(const FloatPoint&, float width); - enum DocumentMarkerLineStyle { - DocumentMarkerSpellingLineStyle, - DocumentMarkerGrammarLineStyle - }; - void drawLineForDocumentMarker(const FloatPoint&, - float width, - DocumentMarkerLineStyle); - - void beginTransparencyLayer(float opacity, const FloatRect* = 0); - void beginLayer(float opacity, - CompositeOperator, - const FloatRect* = 0, - ColorFilterObsolete = ColorFilterNone, - sk_sp = 0); - void endLayer(); - - bool hasShadow() const; - void setShadow(const FloatSize& offset, - float blur, - const Color&, - DrawLooperBuilder::ShadowTransformMode = - DrawLooperBuilder::ShadowRespectsTransforms, - DrawLooperBuilder::ShadowAlphaMode = - DrawLooperBuilder::ShadowRespectsAlpha); - void clearShadow() { clearDrawLooper(); } - - // It is assumed that this draw looper is used only for shadows - // (i.e. a draw looper is set if and only if there is a shadow). - // The builder passed into this method will be destroyed. - void setDrawLooper(PassOwnPtr); - void clearDrawLooper(); - - enum Edge { - NoEdge = 0, - TopEdge = 1 << 1, - RightEdge = 1 << 2, - BottomEdge = 1 << 3, - LeftEdge = 1 << 4 - }; - typedef unsigned Edges; - void drawInnerShadow(const RoundedRect&, - const Color& shadowColor, - const IntSize shadowOffset, - int shadowBlur, - int shadowSpread, - Edges clippedEdges = NoEdge); - - // This clip function is used only by code. It allows - // implementations to handle clipping on the canvas differently since - // the discipline is different. - void canvasClip(const Path&, WindRule = RULE_EVENODD); - void clipOut(const Path&); - - // ---------- Transformation methods ----------------- - // Note that the getCTM method returns only the current transform from Blink's - // perspective, which is not the final transform used to place content on - // screen. It cannot be relied upon for testing where a point will appear on - // screen or how large it will be. - AffineTransform getCTM() const; - void concatCTM(const AffineTransform& affine) { - concat(affineTransformToSkMatrix(affine)); - } - void setCTM(const AffineTransform& affine) { - setMatrix(affineTransformToSkMatrix(affine)); - } - void setMatrix(const SkMatrix&); - - void scale(float x, float y); - void rotate(float angleInRadians); - void translate(float x, float y); - - // This function applies the device scale factor to the context, making the - // context capable of acting as a base-level context for a HiDPI environment. - void applyDeviceScaleFactor(float deviceScaleFactor) { - scale(deviceScaleFactor, deviceScaleFactor); - } - // ---------- End transformation methods ----------------- - - static void adjustLineToPixelBoundaries(FloatPoint& p1, - FloatPoint& p2, - float strokeWidth, - StrokeStyle); - - void preparePaintForDrawRectToRect(SkPaint*, - const SkRect& srcRect, - const SkRect& destRect, - CompositeOperator, - WebBlendMode, - bool isLazyDecoded = false, - bool isDataComplete = true) const; - - static int focusRingOutsetExtent(int offset, int width) { - return focusRingOutset(offset) + (focusRingWidth(width) + 1) / 2; - } - - private: - const GraphicsContextState* immutableState() const { return m_paintState; } - - GraphicsContextState* mutableState() { - realizePaintSave(); - return m_paintState; - } - - static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*); - static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize); - - static inline int focusRingOutset(int offset) { return 0; } - static inline int focusRingWidth(int width) { return 1; } - static SkPMColor lineColors(int); - static SkPMColor antiColors1(int); - static SkPMColor antiColors2(int); - static void draw1xMarker(SkBitmap*, int); - static void draw2xMarker(SkBitmap*, int); - - // Helpers for drawing a focus ring (drawFocusRing) - float prepareFocusRingPaint(SkPaint&, const Color&, int width) const; - void drawFocusRingPath(const SkPath&, const Color&, int width); - void drawFocusRingRect(const SkRect&, const Color&, int width); - - // SkCanvas wrappers. - void clipPath(const SkPath&, - AntiAliasingMode = NotAntiAliased, - SkClipOp = SkClipOp::kIntersect); - void clipRRect(const SkRRect&, - AntiAliasingMode = NotAntiAliased, - SkClipOp = SkClipOp::kIntersect); - void concat(const SkMatrix&); - void drawRRect(const SkRRect&, const SkPaint&); - - // Apply deferred paint state saves - void realizePaintSave() { - if (contextDisabled()) - return; - - if (m_paintState->saveCount()) { - m_paintState->decrementSaveCount(); - ++m_paintStateIndex; - if (m_paintStateStack.size() == m_paintStateIndex) { - m_paintStateStack.append( - GraphicsContextState::createAndCopy(*m_paintState)); - m_paintState = m_paintStateStack[m_paintStateIndex].get(); - } else { - GraphicsContextState* priorPaintState = m_paintState; - m_paintState = m_paintStateStack[m_paintStateIndex].get(); - m_paintState->copy(*priorPaintState); - } - } - } - - // Apply deferred canvas state saves - void realizeCanvasSave() { - if (!m_pendingCanvasSave || contextDisabled()) - return; - - m_canvas->save(); - m_pendingCanvasSave = false; - } - - void didDrawTextInRect(const SkRect& textRect); - - void fillRectWithRoundedHole(const IntRect&, - const RoundedRect& roundedHoleRect, - const Color&); - - // null indicates painting is contextDisabled. Never delete this object. - SkCanvas* m_canvas; - - // Paint states stack. Enables local drawing state change with - // save()/restore() calls. This state controls the appearance of drawn - // content. We do not delete from this stack to avoid memory churn. - Vector> m_paintStateStack; - // Current index on the stack. May not be the last thing on the stack. - unsigned m_paintStateIndex; - // Raw pointer to the current state. - GraphicsContextState* m_paintState; - - // Currently pending save flags for Skia Canvas state. - // Canvas state includes the canavs, it's matrix and clips. Think of it as - // _where_ the draw operations will happen. - struct CanvasSaveState; - Vector m_canvasStateStack; - bool m_pendingCanvasSave; - -#if ENABLE(ASSERT) - unsigned m_layerCount; - bool m_disableDestructionChecks; -#endif - // Tracks the region painted opaque via the GraphicsContext. - RegionTracker m_trackedRegion; - - // Tracks the region where text is painted via the GraphicsContext. - SkRect m_textRegion; - - unsigned m_disabledState; - - float m_deviceScaleFactor; - - // Activation for the above region tracking features - unsigned m_regionTrackingMode : 2; - bool m_trackTextRegion : 1; - - bool m_accelerated : 1; - bool m_isCertainlyOpaque : 1; - bool m_antialiasHairlineImages : 1; - bool m_shouldSmoothFonts : 1; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXT_H_ diff --git a/sky/engine/platform/graphics/GraphicsContextState.cpp b/sky/engine/platform/graphics/GraphicsContextState.cpp deleted file mode 100644 index 66e42d6244390..0000000000000 --- a/sky/engine/platform/graphics/GraphicsContextState.cpp +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) 2014 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. - -#include "flutter/sky/engine/platform/graphics/GraphicsContextState.h" - -#include "flutter/sky/engine/platform/graphics/skia/SkiaUtils.h" - -namespace blink { - -GraphicsContextState::GraphicsContextState() - : m_fillColor(Color::black), - m_fillRule(RULE_NONZERO), - m_textDrawingMode(TextModeFill), - m_alpha(256), - m_compositeOperator(CompositeSourceOver), - m_blendMode(WebBlendModeNormal), - m_interpolationQuality(InterpolationDefault), - m_saveCount(0), - m_shouldAntialias(true), - m_shouldClampToSourceRect(true) { - m_strokePaint.setStyle(SkPaint::kStroke_Style); - m_strokePaint.setStrokeWidth(SkFloatToScalar(m_strokeData.thickness())); - m_strokePaint.setColor(applyAlpha(m_strokeData.color().rgb())); - m_strokePaint.setStrokeCap(SkPaint::kDefault_Cap); - m_strokePaint.setStrokeJoin(SkPaint::kDefault_Join); - m_strokePaint.setStrokeMiter(SkFloatToScalar(m_strokeData.miterLimit())); - m_strokePaint.setFilterQuality( - WebCoreInterpolationQualityToSkFilterQuality(m_interpolationQuality)); - m_strokePaint.setAntiAlias(m_shouldAntialias); - m_fillPaint.setColor(applyAlpha(m_fillColor.rgb())); - m_fillPaint.setFilterQuality( - WebCoreInterpolationQualityToSkFilterQuality(m_interpolationQuality)); - m_fillPaint.setAntiAlias(m_shouldAntialias); -} - -GraphicsContextState::GraphicsContextState(const GraphicsContextState& other) - : m_strokePaint(other.m_strokePaint), - m_fillPaint(other.m_fillPaint), - m_strokeData(other.m_strokeData), - m_fillColor(other.m_fillColor), - m_fillRule(other.m_fillRule), - m_fillGradient(other.m_fillGradient), - m_fillPattern(other.m_fillPattern), - m_looper(other.m_looper), - m_textDrawingMode(other.m_textDrawingMode), - m_alpha(other.m_alpha), - m_colorFilter(other.m_colorFilter), - m_compositeOperator(other.m_compositeOperator), - m_blendMode(other.m_blendMode), - m_interpolationQuality(other.m_interpolationQuality), - m_saveCount(0), - m_shouldAntialias(other.m_shouldAntialias), - m_shouldClampToSourceRect(other.m_shouldClampToSourceRect) {} - -void GraphicsContextState::copy(const GraphicsContextState& source) { - this->~GraphicsContextState(); - new (this) GraphicsContextState(source); -} - -const SkPaint& GraphicsContextState::strokePaint(int strokedPathLength) const { - if (m_strokeData.gradient() && m_strokeData.gradient()->shaderChanged()) - m_strokePaint.setShader(m_strokeData.gradient()->shader()); - m_strokeData.setupPaintDashPathEffect(&m_strokePaint, strokedPathLength); - return m_strokePaint; -} - -const SkPaint& GraphicsContextState::fillPaint() const { - if (m_fillGradient && m_fillGradient->shaderChanged()) - m_fillPaint.setShader(m_fillGradient->shader()); - return m_fillPaint; -} - -void GraphicsContextState::setStrokeStyle(StrokeStyle style) { - m_strokeData.setStyle(style); -} - -void GraphicsContextState::setStrokeThickness(float thickness) { - m_strokeData.setThickness(thickness); - m_strokePaint.setStrokeWidth(SkFloatToScalar(thickness)); -} - -void GraphicsContextState::setStrokeColor(const Color& color) { - m_strokeData.clearGradient(); - m_strokeData.clearPattern(); - m_strokeData.setColor(color); - m_strokePaint.setColor(applyAlpha(color.rgb())); - m_strokePaint.setShader(0); -} - -void GraphicsContextState::setStrokeGradient( - const PassRefPtr gradient) { - m_strokeData.setColor(Color::black); - m_strokeData.clearPattern(); - m_strokeData.setGradient(gradient); - m_strokePaint.setColor(applyAlpha(SK_ColorBLACK)); - m_strokePaint.setShader(m_strokeData.gradient()->shader()); -} - -void GraphicsContextState::clearStrokeGradient() { - m_strokeData.clearGradient(); - ASSERT(!m_strokeData.pattern()); - m_strokePaint.setColor(applyAlpha(m_strokeData.color().rgb())); -} - -void GraphicsContextState::setStrokePattern(const PassRefPtr pattern) { - m_strokeData.setColor(Color::black); - m_strokeData.clearGradient(); - m_strokeData.setPattern(pattern); - m_strokePaint.setColor(applyAlpha(SK_ColorBLACK)); - m_strokePaint.setShader(sk_ref_sp(m_strokeData.pattern()->shader())); -} - -void GraphicsContextState::clearStrokePattern() { - m_strokeData.clearPattern(); - ASSERT(!m_strokeData.gradient()); - m_strokePaint.setColor(applyAlpha(m_strokeData.color().rgb())); -} - -void GraphicsContextState::setLineCap(LineCap cap) { - m_strokeData.setLineCap(cap); - m_strokePaint.setStrokeCap((SkPaint::Cap)cap); -} - -void GraphicsContextState::setLineJoin(LineJoin join) { - m_strokeData.setLineJoin(join); - m_strokePaint.setStrokeJoin((SkPaint::Join)join); -} - -void GraphicsContextState::setMiterLimit(float miterLimit) { - m_strokeData.setMiterLimit(miterLimit); - m_strokePaint.setStrokeMiter(SkFloatToScalar(miterLimit)); -} - -void GraphicsContextState::setFillColor(const Color& color) { - m_fillColor = color; - m_fillGradient.clear(); - m_fillPattern.clear(); - m_fillPaint.setColor(applyAlpha(color.rgb())); - m_fillPaint.setShader(0); -} - -void GraphicsContextState::setFillGradient( - const PassRefPtr gradient) { - m_fillColor = Color::black; - m_fillPattern.clear(); - m_fillGradient = gradient; - m_fillPaint.setColor(applyAlpha(SK_ColorBLACK)); - m_fillPaint.setShader(m_fillGradient->shader()); -} - -void GraphicsContextState::clearFillGradient() { - m_fillGradient.clear(); - ASSERT(!m_fillPattern); - m_fillPaint.setColor(applyAlpha(m_fillColor.rgb())); -} - -void GraphicsContextState::setFillPattern(const PassRefPtr pattern) { - m_fillColor = Color::black; - m_fillGradient.clear(); - m_fillPattern = pattern; - m_fillPaint.setColor(applyAlpha(SK_ColorBLACK)); - m_fillPaint.setShader(sk_ref_sp(m_fillPattern->shader())); -} - -void GraphicsContextState::clearFillPattern() { - m_fillPattern.clear(); - ASSERT(!m_fillGradient); - m_fillPaint.setColor(applyAlpha(m_fillColor.rgb())); -} - -// Shadow. (This will need tweaking if we use draw loopers for other things.) -void GraphicsContextState::setDrawLooper(sk_sp drawLooper) { - m_looper = drawLooper; - m_strokePaint.setLooper(m_looper); - m_fillPaint.setLooper(m_looper); -} - -void GraphicsContextState::clearDrawLooper() { - m_looper.reset(); - m_strokePaint.setLooper(nullptr); - m_fillPaint.setLooper(nullptr); -} - -void GraphicsContextState::setAlphaAsFloat(float alpha) { - if (alpha < 0) { - m_alpha = 0; - } else { - m_alpha = roundf(alpha * 256); - if (m_alpha > 256) - m_alpha = 256; - } - m_strokePaint.setColor(applyAlpha(m_strokeData.color().rgb())); - m_fillPaint.setColor(applyAlpha(m_fillColor.rgb())); -} - -void GraphicsContextState::setLineDash(const DashArray& dashes, - float dashOffset) { - m_strokeData.setLineDash(dashes, dashOffset); -} - -void GraphicsContextState::setColorFilter(sk_sp colorFilter) { - m_colorFilter = colorFilter; - m_strokePaint.setColorFilter(m_colorFilter); - m_fillPaint.setColorFilter(m_colorFilter); -} - -void GraphicsContextState::setCompositeOperation( - CompositeOperator compositeOperation, - WebBlendMode blendMode) { - m_compositeOperator = compositeOperation; - m_blendMode = blendMode; - SkBlendMode skiaBlendMode = - WebCoreCompositeToSkiaComposite(compositeOperation, blendMode); - m_strokePaint.setBlendMode(skiaBlendMode); - m_fillPaint.setBlendMode(skiaBlendMode); -} - -void GraphicsContextState::setInterpolationQuality( - InterpolationQuality quality) { - m_interpolationQuality = quality; - m_strokePaint.setFilterQuality( - WebCoreInterpolationQualityToSkFilterQuality(quality)); - m_fillPaint.setFilterQuality( - WebCoreInterpolationQualityToSkFilterQuality(quality)); -} - -void GraphicsContextState::setShouldAntialias(bool shouldAntialias) { - m_shouldAntialias = shouldAntialias; - m_strokePaint.setAntiAlias(shouldAntialias); - m_fillPaint.setAntiAlias(shouldAntialias); -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/GraphicsContextState.h b/sky/engine/platform/graphics/GraphicsContextState.h deleted file mode 100644 index 4e19e2bfbdd47..0000000000000 --- a/sky/engine/platform/graphics/GraphicsContextState.h +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (C) 2013 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXTSTATE_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXTSTATE_H_ - -#include "flutter/sky/engine/platform/graphics/DrawLooperBuilder.h" -#include "flutter/sky/engine/platform/graphics/Gradient.h" -#include "flutter/sky/engine/platform/graphics/GraphicsTypes.h" -#include "flutter/sky/engine/platform/graphics/Path.h" -#include "flutter/sky/engine/platform/graphics/Pattern.h" -#include "flutter/sky/engine/platform/graphics/StrokeData.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "third_party/skia/include/core/SkColorFilter.h" -#include "third_party/skia/include/core/SkPaint.h" - -namespace blink { - -// Encapsulates the state information we store for each pushed graphics state. -// Only GraphicsContext can use this class. -class PLATFORM_EXPORT GraphicsContextState final { - public: - static PassOwnPtr create() { - return adoptPtr(new GraphicsContextState()); - } - - static PassOwnPtr createAndCopy( - const GraphicsContextState& other) { - return adoptPtr(new GraphicsContextState(other)); - } - - void copy(const GraphicsContextState&); - - // SkPaint objects that reflect the current state. If the length of the - // path to be stroked is known, pass it in for correct dash or dot placement. - const SkPaint& strokePaint(int strokedPathLength = 0) const; - const SkPaint& fillPaint() const; - - uint16_t saveCount() const { return m_saveCount; } - void incrementSaveCount() { ++m_saveCount; } - void decrementSaveCount() { --m_saveCount; } - - // Stroke data - const StrokeData& strokeData() const { return m_strokeData; } - - void setStrokeStyle(StrokeStyle); - - void setStrokeThickness(float); - - SkColor effectiveStrokeColor() const { - return applyAlpha(m_strokeData.color().rgb()); - } - void setStrokeColor(const Color&); - - void setStrokeGradient(const PassRefPtr); - void clearStrokeGradient(); - - void setStrokePattern(const PassRefPtr); - void clearStrokePattern(); - - void setLineCap(LineCap); - - void setLineJoin(LineJoin); - - void setMiterLimit(float); - - void setLineDash(const DashArray&, float); - - // Fill data - Color fillColor() const { return m_fillColor; } - SkColor effectiveFillColor() const { return applyAlpha(m_fillColor.rgb()); } - void setFillColor(const Color&); - - Gradient* fillGradient() const { return m_fillGradient.get(); } - void setFillGradient(const PassRefPtr); - void clearFillGradient(); - - Pattern* fillPattern() const { return m_fillPattern.get(); } - void setFillPattern(const PassRefPtr); - void clearFillPattern(); - - // Path fill rule - WindRule fillRule() const { return m_fillRule; } - void setFillRule(WindRule rule) { m_fillRule = rule; } - - // Shadow. (This will need tweaking if we use draw loopers for other things.) - const sk_sp& drawLooper() const { return m_looper; } - void setDrawLooper(sk_sp); - void clearDrawLooper(); - - // Text. (See TextModeFill & friends.) - TextDrawingModeFlags textDrawingMode() const { return m_textDrawingMode; } - void setTextDrawingMode(TextDrawingModeFlags mode) { - m_textDrawingMode = mode; - } - - // Common shader state. - int alpha() const { return m_alpha; } - void setAlphaAsFloat(float); - - SkColorFilter* colorFilter() const { return m_colorFilter.get(); } - void setColorFilter(sk_sp); - - // Compositing control, for the CSS and Canvas compositing spec. - void setCompositeOperation(CompositeOperator, WebBlendMode); - CompositeOperator compositeOperator() const { return m_compositeOperator; } - WebBlendMode blendMode() const { return m_blendMode; } - - // Image interpolation control. - InterpolationQuality interpolationQuality() const { - return m_interpolationQuality; - } - void setInterpolationQuality(InterpolationQuality); - - bool shouldAntialias() const { return m_shouldAntialias; } - void setShouldAntialias(bool); - - bool shouldClampToSourceRect() const { return m_shouldClampToSourceRect; } - void setShouldClampToSourceRect(bool shouldClampToSourceRect) { - m_shouldClampToSourceRect = shouldClampToSourceRect; - } - - private: - GraphicsContextState(); - explicit GraphicsContextState(const GraphicsContextState&); - GraphicsContextState& operator=(const GraphicsContextState&); - - // Helper function for applying the state's alpha value to the given input - // color to produce a new output color. - SkColor applyAlpha(SkColor c) const { - int a = SkAlphaMul(SkColorGetA(c), m_alpha); - return (c & 0x00FFFFFF) | (a << 24); - } - - // These are mutbale to enable gradient updates when the paints are fetched - // for use. - mutable SkPaint m_strokePaint; - mutable SkPaint m_fillPaint; - - StrokeData m_strokeData; - - Color m_fillColor; - WindRule m_fillRule; - RefPtr m_fillGradient; - RefPtr m_fillPattern; - - sk_sp m_looper; - - TextDrawingModeFlags m_textDrawingMode; - - int m_alpha; - sk_sp m_colorFilter; - - CompositeOperator m_compositeOperator; - WebBlendMode m_blendMode; - - InterpolationQuality m_interpolationQuality; - - uint16_t m_saveCount; - - bool m_shouldAntialias : 1; - bool m_shouldClampToSourceRect : 1; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXTSTATE_H_ diff --git a/sky/engine/platform/graphics/GraphicsContextStateSaver.h b/sky/engine/platform/graphics/GraphicsContextStateSaver.h deleted file mode 100644 index cc1358cc82430..0000000000000 --- a/sky/engine/platform/graphics/GraphicsContextStateSaver.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (C) 2013 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXTSTATESAVER_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXTSTATESAVER_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" - -namespace blink { - -class PLATFORM_EXPORT GraphicsContextStateSaver { - WTF_MAKE_FAST_ALLOCATED; - - public: - GraphicsContextStateSaver(GraphicsContext& context, - bool saveAndRestore = true) - : m_context(context), m_saveAndRestore(saveAndRestore) { - if (m_saveAndRestore) - m_context.save(); - } - - ~GraphicsContextStateSaver() { - if (m_saveAndRestore) - m_context.restore(); - } - - void save() { - ASSERT(!m_saveAndRestore); - m_context.save(); - m_saveAndRestore = true; - } - - void restore() { - ASSERT(m_saveAndRestore); - m_context.restore(); - m_saveAndRestore = false; - } - - GraphicsContext* context() const { return &m_context; } - bool saved() const { return m_saveAndRestore; } - - private: - GraphicsContext& m_context; - bool m_saveAndRestore; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSCONTEXTSTATESAVER_H_ diff --git a/sky/engine/platform/graphics/GraphicsTypes.cpp b/sky/engine/platform/graphics/GraphicsTypes.cpp deleted file mode 100644 index 9717a0d882682..0000000000000 --- a/sky/engine/platform/graphics/GraphicsTypes.cpp +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2012 Rik Cabanier (cabanier@adobe.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/GraphicsTypes.h" - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -static const char* const compositeOperatorNames[] = {"clear", - "copy", - "source-over", - "source-in", - "source-out", - "source-atop", - "destination-over", - "destination-in", - "destination-out", - "destination-atop", - "xor", - "darker", - "lighter"}; - -static const char* const blendOperatorNames[] = { - "multiply", "screen", "overlay", "darken", "lighten", - "color-dodge", "color-burn", "hard-light", "soft-light", "difference", - "exclusion", "hue", "saturation", "color", "luminosity"}; -const int numCompositeOperatorNames = WTF_ARRAY_LENGTH(compositeOperatorNames); -const int numBlendOperatorNames = WTF_ARRAY_LENGTH(blendOperatorNames); - -bool parseCompositeAndBlendOperator(const String& s, - CompositeOperator& op, - WebBlendMode& blendOp) { - for (int i = 0; i < numCompositeOperatorNames; i++) { - if (s == compositeOperatorNames[i]) { - op = static_cast(i); - blendOp = WebBlendModeNormal; - return true; - } - } - - for (int i = 0; i < numBlendOperatorNames; i++) { - if (s == blendOperatorNames[i]) { - blendOp = static_cast(i + 1); - // For now, blending will always assume source-over. This will be fixed in - // the future - op = CompositeSourceOver; - return true; - } - } - - return false; -} - -// FIXME: when we support blend modes in combination with compositing other than -// source-over this routine needs to be updated. -String compositeOperatorName(CompositeOperator op, WebBlendMode blendOp) { - ASSERT(op >= 0); - ASSERT(op < numCompositeOperatorNames); - ASSERT(blendOp >= 0); - ASSERT(blendOp <= numBlendOperatorNames); - if (blendOp != WebBlendModeNormal) - return blendOperatorNames[blendOp - 1]; - return compositeOperatorNames[op]; -} - -bool parseLineCap(const String& s, LineCap& cap) { - if (s == "butt") { - cap = ButtCap; - return true; - } - if (s == "round") { - cap = RoundCap; - return true; - } - if (s == "square") { - cap = SquareCap; - return true; - } - return false; -} - -String lineCapName(LineCap cap) { - ASSERT(cap >= 0); - ASSERT(cap < 3); - const char* const names[3] = {"butt", "round", "square"}; - return names[cap]; -} - -bool parseLineJoin(const String& s, LineJoin& join) { - if (s == "miter") { - join = MiterJoin; - return true; - } - if (s == "round") { - join = RoundJoin; - return true; - } - if (s == "bevel") { - join = BevelJoin; - return true; - } - return false; -} - -String lineJoinName(LineJoin join) { - ASSERT(join >= 0); - ASSERT(join < 3); - const char* const names[3] = {"miter", "round", "bevel"}; - return names[join]; -} - -String textAlignName(TextAlign align) { - ASSERT(align >= 0); - ASSERT(align < 5); - const char* const names[5] = {"start", "end", "left", "center", "right"}; - return names[align]; -} - -bool parseTextAlign(const String& s, TextAlign& align) { - if (s == "start") { - align = StartTextAlign; - return true; - } - if (s == "end") { - align = EndTextAlign; - return true; - } - if (s == "left") { - align = LeftTextAlign; - return true; - } - if (s == "center") { - align = CenterTextAlign; - return true; - } - if (s == "right") { - align = RightTextAlign; - return true; - } - return false; -} - -String textBaselineName(TextBaseline baseline) { - ASSERT(baseline >= 0); - ASSERT(baseline < 6); - const char* const names[6] = {"alphabetic", "top", "middle", - "bottom", "ideographic", "hanging"}; - return names[baseline]; -} - -bool parseTextBaseline(const String& s, TextBaseline& baseline) { - if (s == "alphabetic") { - baseline = AlphabeticTextBaseline; - return true; - } - if (s == "top") { - baseline = TopTextBaseline; - return true; - } - if (s == "middle") { - baseline = MiddleTextBaseline; - return true; - } - if (s == "bottom") { - baseline = BottomTextBaseline; - return true; - } - if (s == "ideographic") { - baseline = IdeographicTextBaseline; - return true; - } - if (s == "hanging") { - baseline = HangingTextBaseline; - return true; - } - return false; -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/GraphicsTypes.h b/sky/engine/platform/graphics/GraphicsTypes.h deleted file mode 100644 index f42851b50c6ed..0000000000000 --- a/sky/engine/platform/graphics/GraphicsTypes.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSTYPES_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSTYPES_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/public/platform/WebBlendMode.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" -#include "third_party/skia/include/core/SkPaint.h" -#include "third_party/skia/include/core/SkPath.h" - -namespace blink { - -enum StrokeStyle { - NoStroke, - SolidStroke, - DottedStroke, - DashedStroke, - DoubleStroke, - WavyStroke, -}; - -enum InterpolationQuality { - InterpolationNone = kNone_SkFilterQuality, - InterpolationLow = kLow_SkFilterQuality, - InterpolationMedium = kMedium_SkFilterQuality, - InterpolationHigh = kHigh_SkFilterQuality, -#if USE(LOW_QUALITY_IMAGE_INTERPOLATION) - InterpolationDefault = InterpolationLow, -#else - InterpolationDefault = InterpolationHigh, -#endif -}; - -enum CompositeOperator { - CompositeClear, - CompositeCopy, - CompositeSourceOver, - CompositeSourceIn, - CompositeSourceOut, - CompositeSourceAtop, - CompositeDestinationOver, - CompositeDestinationIn, - CompositeDestinationOut, - CompositeDestinationAtop, - CompositeXOR, - CompositePlusDarker, - CompositePlusLighter, - CompositeDifference -}; - -enum GradientSpreadMethod { - SpreadMethodPad, - SpreadMethodReflect, - SpreadMethodRepeat -}; - -enum LineCap { - ButtCap = SkPaint::kButt_Cap, - RoundCap = SkPaint::kRound_Cap, - SquareCap = SkPaint::kSquare_Cap -}; - -enum LineJoin { - MiterJoin = SkPaint::kMiter_Join, - RoundJoin = SkPaint::kRound_Join, - BevelJoin = SkPaint::kBevel_Join -}; - -enum HorizontalAlignment { AlignLeft, AlignRight, AlignHCenter }; - -enum TextBaseline { - AlphabeticTextBaseline, - TopTextBaseline, - MiddleTextBaseline, - BottomTextBaseline, - IdeographicTextBaseline, - HangingTextBaseline -}; - -enum TextAlign { - StartTextAlign, - EndTextAlign, - LeftTextAlign, - CenterTextAlign, - RightTextAlign -}; - -enum TextDrawingMode { - TextModeFill = 1 << 0, - TextModeStroke = 1 << 1, -}; -typedef unsigned TextDrawingModeFlags; - -// FIXME(sky): Remove this enum. -enum ColorFilterObsolete { - ColorFilterNone, -}; - -enum WindRule { - RULE_NONZERO = SkPath::kWinding_FillType, - RULE_EVENODD = SkPath::kEvenOdd_FillType -}; - -PLATFORM_EXPORT String compositeOperatorName(CompositeOperator, WebBlendMode); -PLATFORM_EXPORT bool parseCompositeAndBlendOperator(const String&, - CompositeOperator&, - WebBlendMode&); - -PLATFORM_EXPORT String lineCapName(LineCap); -PLATFORM_EXPORT bool parseLineCap(const String&, LineCap&); - -PLATFORM_EXPORT String lineJoinName(LineJoin); -PLATFORM_EXPORT bool parseLineJoin(const String&, LineJoin&); - -PLATFORM_EXPORT String textAlignName(TextAlign); -PLATFORM_EXPORT bool parseTextAlign(const String&, TextAlign&); - -PLATFORM_EXPORT String textBaselineName(TextBaseline); -PLATFORM_EXPORT bool parseTextBaseline(const String&, TextBaseline&); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_GRAPHICSTYPES_H_ diff --git a/sky/engine/platform/graphics/Image.cpp b/sky/engine/platform/graphics/Image.cpp deleted file mode 100644 index f1c2c7f80a5a5..0000000000000 --- a/sky/engine/platform/graphics/Image.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) - * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/Image.h" - -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/platform/SharedBuffer.h" -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/FloatSize.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h" -#include "flutter/sky/engine/public/platform/Platform.h" -#include "flutter/sky/engine/wtf/MainThread.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" - -#include - -namespace blink { - -Image::Image(ImageObserver* observer) : m_imageObserver(observer) {} - -Image::~Image() {} - -bool Image::setData(PassRefPtr data, bool allDataReceived) { - m_encodedImageData = data; - if (!m_encodedImageData.get()) - return true; - - int length = m_encodedImageData->size(); - if (!length) - return true; - - return dataChanged(allDataReceived); -} - -void Image::fillWithSolidColor(GraphicsContext* ctxt, - const FloatRect& dstRect, - const Color& color, - CompositeOperator op) { - if (!color.alpha()) - return; - - CompositeOperator previousOperator = ctxt->compositeOperation(); - ctxt->setCompositeOperation( - !color.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op); - ctxt->fillRect(dstRect, color); - ctxt->setCompositeOperation(previousOperator); -} - -FloatRect Image::adjustForNegativeSize(const FloatRect& rect) { - FloatRect norm = rect; - if (norm.width() < 0) { - norm.setX(norm.x() + norm.width()); - norm.setWidth(-norm.width()); - } - if (norm.height() < 0) { - norm.setY(norm.y() + norm.height()); - norm.setHeight(-norm.height()); - } - return norm; -} - -void Image::draw(GraphicsContext* ctx, - const FloatRect& dstRect, - const FloatRect& srcRect, - CompositeOperator op, - WebBlendMode blendMode, - RespectImageOrientationEnum) {} - -void Image::drawTiled(GraphicsContext* ctxt, - const FloatRect& destRect, - const FloatPoint& srcPoint, - const FloatSize& scaledTileSize, - CompositeOperator op, - WebBlendMode blendMode, - const IntSize& repeatSpacing) {} - -// FIXME: Merge with the other drawTiled eventually, since we need a combination -// of both for some things. -void Image::drawTiled(GraphicsContext* ctxt, - const FloatRect& dstRect, - const FloatRect& srcRect, - const FloatSize& providedTileScaleFactor, - TileRule hRule, - TileRule vRule, - CompositeOperator op) {} - -void Image::drawPattern(GraphicsContext* context, - const FloatRect& floatSrcRect, - const FloatSize& scale, - const FloatPoint& phase, - CompositeOperator compositeOp, - const FloatRect& destRect, - WebBlendMode blendMode, - const IntSize& repeatSpacing) {} - -void Image::computeIntrinsicDimensions(Length& intrinsicWidth, - Length& intrinsicHeight, - FloatSize& intrinsicRatio) {} - -PassRefPtr Image::imageForDefaultFrame() { - RefPtr image(this); - return image.release(); -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/Image.h b/sky/engine/platform/graphics/Image.h deleted file mode 100644 index e17b1b775e366..0000000000000 --- a/sky/engine/platform/graphics/Image.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) - * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_IMAGE_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_IMAGE_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "flutter/sky/engine/platform/graphics/Color.h" -#include "flutter/sky/engine/platform/graphics/GraphicsTypes.h" -#include "flutter/sky/engine/platform/graphics/ImageOrientation.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -class FloatPoint; -class FloatRect; -class FloatSize; -class GraphicsContext; -class Length; -class SharedBuffer; - -// This class gets notified when an image creates or destroys decoded frames and -// when it advances animation frames. -class ImageObserver; - -class PLATFORM_EXPORT Image : public RefCounted { - friend class GeneratedImage; - friend class GradientGeneratedImage; - friend class GraphicsContext; - - public: - virtual ~Image(); - - virtual bool currentFrameKnownToBeOpaque() = 0; - - bool isNull() const { return size().isEmpty(); } - - virtual void setContainerSize(const IntSize&) {} - virtual bool usesContainerSize() const { return false; } - virtual bool hasRelativeWidth() const { return false; } - virtual bool hasRelativeHeight() const { return false; } - virtual void computeIntrinsicDimensions(Length& intrinsicWidth, - Length& intrinsicHeight, - FloatSize& intrinsicRatio); - - virtual IntSize size() const = 0; - IntRect rect() const { return IntRect(IntPoint(), size()); } - int width() const { return size().width(); } - int height() const { return size().height(); } - virtual bool getHotSpot(IntPoint&) const { return false; } - - bool setData(PassRefPtr data, bool allDataReceived); - virtual bool dataChanged(bool /*allDataReceived*/) { return false; } - - virtual String filenameExtension() const { - return String(); - } // null string if unknown - - virtual void destroyDecodedData(bool destroyAll) = 0; - - SharedBuffer* data() { return m_encodedImageData.get(); } - - // Animation begins whenever someone draws the image, so startAnimation() is - // not normally called. It will automatically pause once all observers no - // longer want to render the image anywhere. - enum CatchUpAnimation { DoNotCatchUp, CatchUp }; - virtual void startAnimation(CatchUpAnimation = CatchUp) {} - virtual void stopAnimation() {} - virtual void resetAnimation() {} - - // True if this image can potentially animate. - virtual bool maybeAnimated() { return false; } - - // Typically the ImageResource that owns us. - ImageObserver* imageObserver() const { return m_imageObserver; } - void setImageObserver(ImageObserver* observer) { m_imageObserver = observer; } - - enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile }; - - virtual PassRefPtr imageForDefaultFrame(); - - virtual void drawPattern(GraphicsContext*, - const FloatRect&, - const FloatSize&, - const FloatPoint& phase, - CompositeOperator, - const FloatRect&, - WebBlendMode = WebBlendModeNormal, - const IntSize& repeatSpacing = IntSize()); - -#if ENABLE(ASSERT) - virtual bool notSolidColor() { return true; } -#endif - - protected: - Image(ImageObserver* = 0); - - static void fillWithSolidColor(GraphicsContext*, - const FloatRect& dstRect, - const Color&, - CompositeOperator); - static FloatRect adjustForNegativeSize(const FloatRect&); // A helper method - // for translating - // negative width - // and height - // values. - - virtual void draw(GraphicsContext*, - const FloatRect& dstRect, - const FloatRect& srcRect, - CompositeOperator, - WebBlendMode) = 0; - virtual void draw(GraphicsContext*, - const FloatRect& dstRect, - const FloatRect& srcRect, - CompositeOperator, - WebBlendMode, - RespectImageOrientationEnum); - void drawTiled(GraphicsContext*, - const FloatRect& dstRect, - const FloatPoint& srcPoint, - const FloatSize& tileSize, - CompositeOperator, - WebBlendMode, - const IntSize& repeatSpacing); - void drawTiled(GraphicsContext*, - const FloatRect& dstRect, - const FloatRect& srcRect, - const FloatSize& tileScaleFactor, - TileRule hRule, - TileRule vRule, - CompositeOperator); - - // Supporting tiled drawing - virtual bool mayFillWithSolidColor() { return false; } - virtual Color solidColor() const { return Color(); } - - private: - RefPtr m_encodedImageData; - ImageObserver* m_imageObserver; -}; - -#define DEFINE_IMAGE_TYPE_CASTS(typeName) \ - DEFINE_TYPE_CASTS(typeName, Image, image, image->is##typeName(), \ - image.is##typeName()) - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_IMAGE_H_ diff --git a/sky/engine/platform/graphics/ImageFilter.cpp b/sky/engine/platform/graphics/ImageFilter.cpp deleted file mode 100644 index 486b0a206a652..0000000000000 --- a/sky/engine/platform/graphics/ImageFilter.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/platform/graphics/ImageFilter.h" - -#include "third_party/skia/include/core/SkImageFilter.h" - -namespace blink { - -FloatRect mapImageFilterRect(SkImageFilter* filter, const FloatRect& rect) { - return filter->computeFastBounds(rect); -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/ImageFilter.h b/sky/engine/platform/graphics/ImageFilter.h deleted file mode 100644 index ddc144dd2ffb7..0000000000000 --- a/sky/engine/platform/graphics/ImageFilter.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_IMAGEFILTER_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_IMAGEFILTER_H_ - -#include "flutter/sky/engine/platform/geometry/FloatRect.h" - -class SkImageFilter; - -namespace blink { - -PLATFORM_EXPORT FloatRect mapImageFilterRect(SkImageFilter*, const FloatRect&); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_IMAGEFILTER_H_ diff --git a/sky/engine/platform/graphics/ImageObserver.cpp b/sky/engine/platform/graphics/ImageObserver.cpp deleted file mode 100644 index 0d4ba408c7fdb..0000000000000 --- a/sky/engine/platform/graphics/ImageObserver.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Google, Inc. ("Google") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "flutter/sky/engine/platform/graphics/ImageObserver.h" - -namespace blink { - -ImageObserver::~ImageObserver() {} - -} // namespace blink diff --git a/sky/engine/platform/graphics/ImageObserver.h b/sky/engine/platform/graphics/ImageObserver.h deleted file mode 100644 index 05d9ab7f64941..0000000000000 --- a/sky/engine/platform/graphics/ImageObserver.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_IMAGEOBSERVER_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_IMAGEOBSERVER_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" - -namespace blink { - -class Image; -class IntRect; - -// Interface for notification about changes to an image, including decoding, -// drawing, and animating. -class PLATFORM_EXPORT ImageObserver { - protected: - virtual ~ImageObserver(); - - public: - virtual void decodedSizeChanged(const Image*, int delta) = 0; - virtual void didDraw(const Image*) = 0; - - virtual bool shouldPauseAnimation(const Image*) = 0; - virtual void animationAdvanced(const Image*) = 0; - - virtual void changedInRect(const Image*, const IntRect&) = 0; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_IMAGEOBSERVER_H_ diff --git a/sky/engine/platform/graphics/ImageOrientation.cpp b/sky/engine/platform/graphics/ImageOrientation.cpp deleted file mode 100644 index ebfdaa31ecca3..0000000000000 --- a/sky/engine/platform/graphics/ImageOrientation.cpp +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/ImageOrientation.h" - -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" - -namespace blink { - -AffineTransform ImageOrientation::transformFromDefault( - const FloatSize& drawnSize) const { - float w = drawnSize.width(); - float h = drawnSize.height(); - - switch (m_orientation) { - case OriginTopLeft: - return AffineTransform(); - case OriginTopRight: - return AffineTransform(-1, 0, 0, 1, w, 0); - case OriginBottomRight: - return AffineTransform(-1, 0, 0, -1, w, h); - case OriginBottomLeft: - return AffineTransform(1, 0, 0, -1, 0, h); - case OriginLeftTop: - return AffineTransform(0, 1, 1, 0, 0, 0); - case OriginRightTop: - return AffineTransform(0, 1, -1, 0, w, 0); - case OriginRightBottom: - return AffineTransform(0, -1, -1, 0, w, h); - case OriginLeftBottom: - return AffineTransform(0, -1, 1, 0, 0, h); - } - - ASSERT_NOT_REACHED(); - return AffineTransform(); -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/ImageOrientation.h b/sky/engine/platform/graphics/ImageOrientation.h deleted file mode 100644 index 4301ecca25563..0000000000000 --- a/sky/engine/platform/graphics/ImageOrientation.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_IMAGEORIENTATION_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_IMAGEORIENTATION_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" - -namespace blink { - -class AffineTransform; -class FloatSize; - -// This enum intentionally matches the orientation values from the EXIF spec. -// See JEITA CP-3451, page 18. http://www.exif.org/Exif2-2.PDF -enum ImageOrientationEnum { - // "TopLeft" means that the 0 row starts at the Top, the 0 column starts at - // the Left. - OriginTopLeft = 1, // default - OriginTopRight = 2, // mirror along y-axis - OriginBottomRight = 3, // 180 degree rotation - OriginBottomLeft = 4, // mirror along the x-axis - OriginLeftTop = 5, // mirror along x-axis + 270 degree CW rotation - OriginRightTop = 6, // 90 degree CW rotation - OriginRightBottom = 7, // mirror along x-axis + 90 degree CW rotation - OriginLeftBottom = 8, // 270 degree CW rotation - // All other values are "reserved" as of EXIF 2.2 - DefaultImageOrientation = OriginTopLeft, -}; - -enum RespectImageOrientationEnum { - DoNotRespectImageOrientation = 0, - RespectImageOrientation = 1 -}; - -class PLATFORM_EXPORT ImageOrientation { - public: - ImageOrientation(ImageOrientationEnum orientation = DefaultImageOrientation) - : m_orientation(orientation) {} - - bool usesWidthAsHeight() const { - // Values 5 through 8 all flip the width/height. - return m_orientation >= OriginLeftTop; - } - - // ImageOrientationEnum currently matches EXIF values, however code outside - // this function should never assume that. - static ImageOrientation fromEXIFValue(int exifValue) { - // Values direct from images may be invalid, in which case we use the - // default. - if (exifValue < OriginTopLeft || exifValue > OriginLeftBottom) - return DefaultImageOrientation; - return static_cast(exifValue); - } - - // This transform can be used for drawing an image according to the - // orientation. It should be used in a right-handed coordinate system. - AffineTransform transformFromDefault(const FloatSize& drawnSize) const; - - inline bool operator==(const ImageOrientation& other) const { - return other.m_orientation == m_orientation; - } - inline bool operator!=(const ImageOrientation& other) const { - return !(*this == other); - } - - private: - // FIXME: This only needs to be one byte. - ImageOrientationEnum m_orientation; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_IMAGEORIENTATION_H_ diff --git a/sky/engine/platform/graphics/Path.cpp b/sky/engine/platform/graphics/Path.cpp deleted file mode 100644 index c104dc12060aa..0000000000000 --- a/sky/engine/platform/graphics/Path.cpp +++ /dev/null @@ -1,526 +0,0 @@ -/* - * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. - * 2006 Rob Buis - * Copyright (C) 2007 Eric Seidel - * Copyright (C) 2013 Google Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/Path.h" - -#include -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "flutter/sky/engine/platform/graphics/skia/SkiaUtils.h" -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "third_party/skia/include/pathops/SkPathOps.h" - -namespace blink { - -Path::Path() : m_path() {} - -Path::Path(const Path& other) { - m_path = SkPath(other.m_path); -} - -Path::~Path() {} - -Path& Path::operator=(const Path& other) { - m_path = SkPath(other.m_path); - return *this; -} - -bool Path::operator==(const Path& other) const { - return m_path == other.m_path; -} - -bool Path::contains(const FloatPoint& point, WindRule rule) const { - return SkPathContainsPoint(m_path, point, - static_cast(rule)); -} - -bool Path::strokeContains(const FloatPoint& point, - const StrokeData& strokeData) const { - SkPaint paint; - strokeData.setupPaint(&paint); - SkPath strokePath; - paint.getFillPath(m_path, &strokePath); - - return SkPathContainsPoint(strokePath, point, SkPath::kWinding_FillType); -} - -FloatRect Path::boundingRect() const { - return m_path.getBounds(); -} - -FloatRect Path::strokeBoundingRect(const StrokeData& strokeData) const { - SkPaint paint; - strokeData.setupPaint(&paint); - SkPath boundingPath; - paint.getFillPath(m_path, &boundingPath); - - return boundingPath.getBounds(); -} - -static FloatPoint* convertPathPoints(FloatPoint dst[], - const SkPoint src[], - int count) { - for (int i = 0; i < count; i++) { - dst[i].setX(SkScalarToFloat(src[i].fX)); - dst[i].setY(SkScalarToFloat(src[i].fY)); - } - return dst; -} - -void Path::apply(void* info, PathApplierFunction function) const { - SkPath::RawIter iter(m_path); - SkPoint pts[4]; - PathElement pathElement; - FloatPoint pathPoints[3]; - - for (;;) { - switch (iter.next(pts)) { - case SkPath::kMove_Verb: - pathElement.type = PathElementMoveToPoint; - pathElement.points = convertPathPoints(pathPoints, &pts[0], 1); - break; - case SkPath::kLine_Verb: - pathElement.type = PathElementAddLineToPoint; - pathElement.points = convertPathPoints(pathPoints, &pts[1], 1); - break; - case SkPath::kQuad_Verb: - pathElement.type = PathElementAddQuadCurveToPoint; - pathElement.points = convertPathPoints(pathPoints, &pts[1], 2); - break; - case SkPath::kCubic_Verb: - pathElement.type = PathElementAddCurveToPoint; - pathElement.points = convertPathPoints(pathPoints, &pts[1], 3); - break; - case SkPath::kClose_Verb: - pathElement.type = PathElementCloseSubpath; - pathElement.points = convertPathPoints(pathPoints, 0, 0); - break; - case SkPath::kDone_Verb: - return; - default: // place-holder for kConic_Verb, when that lands from skia - break; - } - function(info, &pathElement); - } -} - -void Path::transform(const AffineTransform& xform) { - m_path.transform(affineTransformToSkMatrix(xform)); -} - -float Path::length() const { - SkScalar length = 0; - SkPathMeasure measure(m_path, false); - - do { - length += measure.getLength(); - } while (measure.nextContour()); - - return SkScalarToFloat(length); -} - -FloatPoint Path::pointAtLength(float length, bool& ok) const { - FloatPoint point; - float normal; - ok = pointAndNormalAtLength(length, point, normal); - return point; -} - -float Path::normalAngleAtLength(float length, bool& ok) const { - FloatPoint point; - float normal; - ok = pointAndNormalAtLength(length, point, normal); - return normal; -} - -static bool calculatePointAndNormalOnPath(SkPathMeasure& measure, - SkScalar length, - FloatPoint& point, - float& normalAngle, - SkScalar* accumulatedLength = 0) { - do { - SkScalar contourLength = measure.getLength(); - if (length <= contourLength) { - SkVector tangent; - SkPoint position; - - if (measure.getPosTan(length, &position, &tangent)) { - normalAngle = - rad2deg(SkScalarToFloat(SkScalarATan2(tangent.fY, tangent.fX))); - point = FloatPoint(SkScalarToFloat(position.fX), - SkScalarToFloat(position.fY)); - return true; - } - } - length -= contourLength; - if (accumulatedLength) - *accumulatedLength += contourLength; - } while (measure.nextContour()); - return false; -} - -bool Path::pointAndNormalAtLength(float length, - FloatPoint& point, - float& normal) const { - SkPathMeasure measure(m_path, false); - - if (calculatePointAndNormalOnPath(measure, WebCoreFloatToSkScalar(length), - point, normal)) - return true; - - normal = 0; - point = FloatPoint(0, 0); - return false; -} - -Path::PositionCalculator::PositionCalculator(const Path& path) - : m_path(path.skPath()), - m_pathMeasure(path.skPath(), false), - m_accumulatedLength(0) {} - -bool Path::PositionCalculator::pointAndNormalAtLength(float length, - FloatPoint& point, - float& normalAngle) { - SkScalar skLength = WebCoreFloatToSkScalar(length); - if (skLength >= 0) { - if (skLength < m_accumulatedLength) { - // Reset path measurer to rewind (and restart from 0). - m_pathMeasure.setPath(&m_path, false); - m_accumulatedLength = 0; - } else { - skLength -= m_accumulatedLength; - } - - if (calculatePointAndNormalOnPath(m_pathMeasure, skLength, point, - normalAngle, &m_accumulatedLength)) - return true; - } - - normalAngle = 0; - point = FloatPoint(0, 0); - return false; -} - -void Path::clear() { - m_path.reset(); -} - -bool Path::isEmpty() const { - return m_path.isEmpty(); -} - -bool Path::hasCurrentPoint() const { - return m_path.getPoints(0, 0); -} - -FloatPoint Path::currentPoint() const { - if (m_path.countPoints() > 0) { - SkPoint skResult; - m_path.getLastPt(&skResult); - FloatPoint result; - result.setX(SkScalarToFloat(skResult.fX)); - result.setY(SkScalarToFloat(skResult.fY)); - return result; - } - - // FIXME: Why does this return quietNaN? Other ports return 0,0. - float quietNaN = std::numeric_limits::quiet_NaN(); - return FloatPoint(quietNaN, quietNaN); -} - -WindRule Path::windRule() const { - return m_path.getFillType() == SkPath::kEvenOdd_FillType ? RULE_EVENODD - : RULE_NONZERO; -} - -void Path::setWindRule(const WindRule rule) { - m_path.setFillType(WebCoreWindRuleToSkFillType(rule)); -} - -void Path::moveTo(const FloatPoint& point) { - m_path.moveTo(point.data()); -} - -void Path::addLineTo(const FloatPoint& point) { - m_path.lineTo(point.data()); -} - -void Path::addQuadCurveTo(const FloatPoint& cp, const FloatPoint& ep) { - m_path.quadTo(cp.data(), ep.data()); -} - -void Path::addBezierCurveTo(const FloatPoint& p1, - const FloatPoint& p2, - const FloatPoint& ep) { - m_path.cubicTo(p1.data(), p2.data(), ep.data()); -} - -void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius) { - m_path.arcTo(p1.data(), p2.data(), WebCoreFloatToSkScalar(radius)); -} - -void Path::closeSubpath() { - m_path.close(); -} - -void Path::addEllipse(const FloatPoint& p, - float radiusX, - float radiusY, - float startAngle, - float endAngle, - bool anticlockwise) { - ASSERT(ellipseIsRenderable(startAngle, endAngle)); - ASSERT(startAngle >= 0 && startAngle < twoPiFloat); - ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || - (!anticlockwise && (endAngle - startAngle) >= 0)); - - SkScalar cx = WebCoreFloatToSkScalar(p.x()); - SkScalar cy = WebCoreFloatToSkScalar(p.y()); - SkScalar radiusXScalar = WebCoreFloatToSkScalar(radiusX); - SkScalar radiusYScalar = WebCoreFloatToSkScalar(radiusY); - - SkRect oval; - oval.set(cx - radiusXScalar, cy - radiusYScalar, cx + radiusXScalar, - cy + radiusYScalar); - - float sweep = endAngle - startAngle; - SkScalar startDegrees = WebCoreFloatToSkScalar(startAngle * 180 / piFloat); - SkScalar sweepDegrees = WebCoreFloatToSkScalar(sweep * 180 / piFloat); - SkScalar s360 = SkIntToScalar(360); - - // We can't use SkPath::addOval(), because addOval() makes new sub-path. - // addOval() calls moveTo() and close() internally. - - // Use s180, not s360, because SkPath::arcTo(oval, angle, s360, false) draws - // nothing. - SkScalar s180 = SkIntToScalar(180); - if (SkScalarNearlyEqual(sweepDegrees, s360)) { - // SkPath::arcTo can't handle the sweepAngle that is equal to or greater - // than 2Pi. - m_path.arcTo(oval, startDegrees, s180, false); - m_path.arcTo(oval, startDegrees + s180, s180, false); - return; - } - if (SkScalarNearlyEqual(sweepDegrees, -s360)) { - m_path.arcTo(oval, startDegrees, -s180, false); - m_path.arcTo(oval, startDegrees - s180, -s180, false); - return; - } - - m_path.arcTo(oval, startDegrees, sweepDegrees, false); -} - -void Path::addArc(const FloatPoint& p, - float radius, - float startAngle, - float endAngle, - bool anticlockwise) { - addEllipse(p, radius, radius, startAngle, endAngle, anticlockwise); -} - -void Path::addRect(const FloatRect& rect) { - m_path.addRect(rect); -} - -void Path::addEllipse(const FloatPoint& p, - float radiusX, - float radiusY, - float rotation, - float startAngle, - float endAngle, - bool anticlockwise) { - ASSERT(ellipseIsRenderable(startAngle, endAngle)); - ASSERT(startAngle >= 0 && startAngle < twoPiFloat); - ASSERT((anticlockwise && (startAngle - endAngle) >= 0) || - (!anticlockwise && (endAngle - startAngle) >= 0)); - - if (!rotation) { - addEllipse(FloatPoint(p.x(), p.y()), radiusX, radiusY, startAngle, endAngle, - anticlockwise); - return; - } - - // Add an arc after the relevant transform. - AffineTransform ellipseTransform = - AffineTransform::translation(p.x(), p.y()).rotateRadians(rotation); - ASSERT(ellipseTransform.isInvertible()); - AffineTransform inverseEllipseTransform = ellipseTransform.inverse(); - transform(inverseEllipseTransform); - addEllipse(FloatPoint::zero(), radiusX, radiusY, startAngle, endAngle, - anticlockwise); - transform(ellipseTransform); -} - -void Path::addEllipse(const FloatRect& rect) { - m_path.addOval(rect); -} - -void Path::addRoundedRect(const RoundedRect& r) { - addRoundedRect(r.rect(), r.radii().topLeft(), r.radii().topRight(), - r.radii().bottomLeft(), r.radii().bottomRight()); -} - -void Path::addRoundedRect(const FloatRect& rect, - const FloatSize& roundingRadii) { - if (rect.isEmpty()) - return; - - FloatSize radius(roundingRadii); - FloatSize halfSize(rect.width() / 2, rect.height() / 2); - - // Apply the SVG corner radius constraints, per the rect section of the SVG - // shapes spec: if one of rx,ry is negative, then the other corner radius - // value is used. If both values are negative then rx = ry = 0. If rx is - // greater than half of the width of the rectangle then set rx to half of the - // width; ry is handled similarly. - - if (radius.width() < 0) - radius.setWidth((radius.height() < 0) ? 0 : radius.height()); - - if (radius.height() < 0) - radius.setHeight(radius.width()); - - if (radius.width() > halfSize.width()) - radius.setWidth(halfSize.width()); - - if (radius.height() > halfSize.height()) - radius.setHeight(halfSize.height()); - - addPathForRoundedRect(rect, radius, radius, radius, radius); -} - -void Path::addRoundedRect(const FloatRect& rect, - const FloatSize& topLeftRadius, - const FloatSize& topRightRadius, - const FloatSize& bottomLeftRadius, - const FloatSize& bottomRightRadius) { - if (rect.isEmpty()) - return; - - if (rect.width() < topLeftRadius.width() + topRightRadius.width() || - rect.width() < bottomLeftRadius.width() + bottomRightRadius.width() || - rect.height() < topLeftRadius.height() + bottomLeftRadius.height() || - rect.height() < topRightRadius.height() + bottomRightRadius.height()) { - // If all the radii cannot be accommodated, return a rect. - addRect(rect); - return; - } - - addPathForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, - bottomRightRadius); -} - -void Path::addPathForRoundedRect(const FloatRect& rect, - const FloatSize& topLeftRadius, - const FloatSize& topRightRadius, - const FloatSize& bottomLeftRadius, - const FloatSize& bottomRightRadius) { - addBeziersForRoundedRect(rect, topLeftRadius, topRightRadius, - bottomLeftRadius, bottomRightRadius); -} - -// Approximation of control point positions on a bezier to simulate a quarter of -// a circle. This is 1-kappa, where kappa = 4 * (sqrt(2) - 1) / 3 -static const float gCircleControlPoint = 0.447715f; - -void Path::addBeziersForRoundedRect(const FloatRect& rect, - const FloatSize& topLeftRadius, - const FloatSize& topRightRadius, - const FloatSize& bottomLeftRadius, - const FloatSize& bottomRightRadius) { - moveTo(FloatPoint(rect.x() + topLeftRadius.width(), rect.y())); - - addLineTo(FloatPoint(rect.maxX() - topRightRadius.width(), rect.y())); - if (topRightRadius.width() > 0 || topRightRadius.height() > 0) - addBezierCurveTo( - FloatPoint(rect.maxX() - topRightRadius.width() * gCircleControlPoint, - rect.y()), - FloatPoint(rect.maxX(), - rect.y() + topRightRadius.height() * gCircleControlPoint), - FloatPoint(rect.maxX(), rect.y() + topRightRadius.height())); - addLineTo(FloatPoint(rect.maxX(), rect.maxY() - bottomRightRadius.height())); - if (bottomRightRadius.width() > 0 || bottomRightRadius.height() > 0) - addBezierCurveTo( - FloatPoint(rect.maxX(), rect.maxY() - bottomRightRadius.height() * - gCircleControlPoint), - FloatPoint( - rect.maxX() - bottomRightRadius.width() * gCircleControlPoint, - rect.maxY()), - FloatPoint(rect.maxX() - bottomRightRadius.width(), rect.maxY())); - addLineTo(FloatPoint(rect.x() + bottomLeftRadius.width(), rect.maxY())); - if (bottomLeftRadius.width() > 0 || bottomLeftRadius.height() > 0) - addBezierCurveTo( - FloatPoint(rect.x() + bottomLeftRadius.width() * gCircleControlPoint, - rect.maxY()), - FloatPoint(rect.x(), rect.maxY() - bottomLeftRadius.height() * - gCircleControlPoint), - FloatPoint(rect.x(), rect.maxY() - bottomLeftRadius.height())); - addLineTo(FloatPoint(rect.x(), rect.y() + topLeftRadius.height())); - if (topLeftRadius.width() > 0 || topLeftRadius.height() > 0) - addBezierCurveTo( - FloatPoint(rect.x(), - rect.y() + topLeftRadius.height() * gCircleControlPoint), - FloatPoint(rect.x() + topLeftRadius.width() * gCircleControlPoint, - rect.y()), - FloatPoint(rect.x() + topLeftRadius.width(), rect.y())); - - closeSubpath(); -} - -void Path::addPath(const Path& src, const AffineTransform& transform) { - m_path.addPath(src.skPath(), affineTransformToSkMatrix(transform)); -} - -void Path::translate(const FloatSize& size) { - m_path.offset(WebCoreFloatToSkScalar(size.width()), - WebCoreFloatToSkScalar(size.height())); -} - -bool Path::subtractPath(const Path& other) { - return Op(m_path, other.m_path, kDifference_SkPathOp, &m_path); -} - -bool Path::intersectPath(const Path& other) { - return Op(m_path, other.m_path, kIntersect_SkPathOp, &m_path); -} - -bool Path::unionPath(const Path& other) { - return Op(m_path, other.m_path, kUnion_SkPathOp, &m_path); -} - -#if ENABLE(ASSERT) -bool ellipseIsRenderable(float startAngle, float endAngle) { - return (std::abs(endAngle - startAngle) < twoPiFloat) || - WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), twoPiFloat); -} -#endif - -} // namespace blink diff --git a/sky/engine/platform/graphics/Path.h b/sky/engine/platform/graphics/Path.h deleted file mode 100644 index 53016e8dc99d4..0000000000000 --- a/sky/engine/platform/graphics/Path.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. - * 2006 Rob Buis - * Copyright (C) 2007-2008 Torch Mobile, Inc. - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_PATH_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_PATH_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/geometry/RoundedRect.h" -#include "flutter/sky/engine/platform/graphics/GraphicsTypes.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "third_party/skia/include/core/SkPath.h" -#include "third_party/skia/include/core/SkPathMeasure.h" - -class SkPath; - -namespace blink { - -class AffineTransform; -class FloatPoint; -class FloatRect; -class FloatSize; -class StrokeData; - -enum PathElementType { - PathElementMoveToPoint, // The points member will contain 1 value. - PathElementAddLineToPoint, // The points member will contain 1 value. - PathElementAddQuadCurveToPoint, // The points member will contain 2 values. - PathElementAddCurveToPoint, // The points member will contain 3 values. - PathElementCloseSubpath // The points member will contain no values. -}; - -// The points in the structure are the same as those that would be used with the -// add... method. For example, a line returns the endpoint, while a cubic -// returns two tangent points and the endpoint. -struct PathElement { - PathElementType type; - FloatPoint* points; -}; - -typedef void (*PathApplierFunction)(void* info, const PathElement*); - -class PLATFORM_EXPORT Path { - WTF_MAKE_FAST_ALLOCATED; - - public: - Path(); - ~Path(); - - Path(const Path&); - Path& operator=(const Path&); - bool operator==(const Path&) const; - - bool contains(const FloatPoint&, WindRule = RULE_NONZERO) const; - bool strokeContains(const FloatPoint&, const StrokeData&) const; - FloatRect boundingRect() const; - FloatRect strokeBoundingRect(const StrokeData&) const; - - float length() const; - FloatPoint pointAtLength(float length, bool& ok) const; - float normalAngleAtLength(float length, bool& ok) const; - bool pointAndNormalAtLength(float length, FloatPoint&, float&) const; - - // Helper for computing a sequence of positions and normals (normal angles) on - // a path. The best possible access pattern will be one where the |length| - // value is strictly increasing. For other access patterns, performance will - // vary depending on curvature and number of segments, but should never be - // worse than that of the state-less method on Path. - class PLATFORM_EXPORT PositionCalculator { - WTF_MAKE_NONCOPYABLE(PositionCalculator); - - public: - explicit PositionCalculator(const Path&); - - bool pointAndNormalAtLength(float length, FloatPoint&, float&); - - private: - SkPath m_path; - SkPathMeasure m_pathMeasure; - SkScalar m_accumulatedLength; - }; - - void clear(); - bool isEmpty() const; - // Gets the current point of the current path, which is conceptually the final - // point reached by the path so far. Note the Path can be empty (isEmpty() == - // true) and still have a current point. - bool hasCurrentPoint() const; - FloatPoint currentPoint() const; - - WindRule windRule() const; - void setWindRule(const WindRule); - - void moveTo(const FloatPoint&); - void addLineTo(const FloatPoint&); - void addQuadCurveTo(const FloatPoint& controlPoint, - const FloatPoint& endPoint); - void addBezierCurveTo(const FloatPoint& controlPoint1, - const FloatPoint& controlPoint2, - const FloatPoint& endPoint); - void addArcTo(const FloatPoint&, const FloatPoint&, float radius); - void closeSubpath(); - - void addArc(const FloatPoint&, - float radius, - float startAngle, - float endAngle, - bool anticlockwise); - void addRect(const FloatRect&); - void addEllipse(const FloatPoint&, - float radiusX, - float radiusY, - float rotation, - float startAngle, - float endAngle, - bool anticlockwise); - void addEllipse(const FloatRect&); - - void addRoundedRect(const FloatRect&, const FloatSize& roundingRadii); - void addRoundedRect(const FloatRect&, - const FloatSize& topLeftRadius, - const FloatSize& topRightRadius, - const FloatSize& bottomLeftRadius, - const FloatSize& bottomRightRadius); - void addRoundedRect(const RoundedRect&); - - void addPath(const Path&, const AffineTransform&); - - void translate(const FloatSize&); - - const SkPath& skPath() const { return m_path; } - - void apply(void* info, PathApplierFunction) const; - void transform(const AffineTransform&); - - void addPathForRoundedRect(const FloatRect&, - const FloatSize& topLeftRadius, - const FloatSize& topRightRadius, - const FloatSize& bottomLeftRadius, - const FloatSize& bottomRightRadius); - void addBeziersForRoundedRect(const FloatRect&, - const FloatSize& topLeftRadius, - const FloatSize& topRightRadius, - const FloatSize& bottomLeftRadius, - const FloatSize& bottomRightRadius); - - bool subtractPath(const Path&); - bool intersectPath(const Path&); - - // Updates the path to the union (inclusive-or) of itself with the given - // argument. - bool unionPath(const Path& other); - - private: - void addEllipse(const FloatPoint&, - float radiusX, - float radiusY, - float startAngle, - float endAngle, - bool anticlockwise); - - SkPath m_path; -}; - -#if ENABLE(ASSERT) -PLATFORM_EXPORT bool ellipseIsRenderable(float startAngle, float endAngle); -#endif - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_PATH_H_ diff --git a/sky/engine/platform/graphics/PathTraversalState.cpp b/sky/engine/platform/graphics/PathTraversalState.cpp deleted file mode 100644 index 9ea151656c609..0000000000000 --- a/sky/engine/platform/graphics/PathTraversalState.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Eric Seidel - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "flutter/sky/engine/platform/graphics/PathTraversalState.h" - -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -static inline FloatPoint midPoint(const FloatPoint& first, - const FloatPoint& second) { - return FloatPoint((first.x() + second.x()) / 2.0f, - (first.y() + second.y()) / 2.0f); -} - -static inline float distanceLine(const FloatPoint& start, - const FloatPoint& end) { - return sqrtf((end.x() - start.x()) * (end.x() - start.x()) + - (end.y() - start.y()) * (end.y() - start.y())); -} - -struct QuadraticBezier { - QuadraticBezier() {} - QuadraticBezier(const FloatPoint& s, const FloatPoint& c, const FloatPoint& e) - : start(s), control(c), end(e), splitDepth(0) {} - - double magnitudeSquared() const { - return ((double)(start.dot(start)) + (double)(control.dot(control)) + - (double)(end.dot(end))) / - 9.0; - } - - float approximateDistance() const { - return distanceLine(start, control) + distanceLine(control, end); - } - - void split(QuadraticBezier& left, QuadraticBezier& right) const { - left.control = midPoint(start, control); - right.control = midPoint(control, end); - - FloatPoint leftControlToRightControl = - midPoint(left.control, right.control); - left.end = leftControlToRightControl; - right.start = leftControlToRightControl; - - left.start = start; - right.end = end; - - left.splitDepth = right.splitDepth = splitDepth + 1; - } - - FloatPoint start; - FloatPoint control; - FloatPoint end; - unsigned short splitDepth; -}; - -struct CubicBezier { - CubicBezier() {} - CubicBezier(const FloatPoint& s, - const FloatPoint& c1, - const FloatPoint& c2, - const FloatPoint& e) - : start(s), control1(c1), control2(c2), end(e), splitDepth(0) {} - - double magnitudeSquared() const { - return ((double)(start.dot(start)) + (double)(control1.dot(control1)) + - (double)(control2.dot(control2)) + (double)(end.dot(end))) / - 16.0; - } - - float approximateDistance() const { - return distanceLine(start, control1) + distanceLine(control1, control2) + - distanceLine(control2, end); - } - - void split(CubicBezier& left, CubicBezier& right) const { - FloatPoint startToControl1 = midPoint(control1, control2); - - left.start = start; - left.control1 = midPoint(start, control1); - left.control2 = midPoint(left.control1, startToControl1); - - right.control2 = midPoint(control2, end); - right.control1 = midPoint(right.control2, startToControl1); - right.end = end; - - FloatPoint leftControl2ToRightControl1 = - midPoint(left.control2, right.control1); - left.end = leftControl2ToRightControl1; - right.start = leftControl2ToRightControl1; - - left.splitDepth = right.splitDepth = splitDepth + 1; - } - - FloatPoint start; - FloatPoint control1; - FloatPoint control2; - FloatPoint end; - unsigned short splitDepth; -}; - -template -static float curveLength(PathTraversalState& traversalState, CurveType curve) { - static const unsigned short curveSplitDepthLimit = 20; - static const double pathSegmentLengthToleranceSquared = 1.e-16; - - double curveScaleForToleranceSquared = curve.magnitudeSquared(); - if (curveScaleForToleranceSquared < pathSegmentLengthToleranceSquared) - return 0; - - Vector curveStack; - curveStack.append(curve); - - float totalLength = 0; - do { - float length = curve.approximateDistance(); - double lengthDiscrepancy = length - distanceLine(curve.start, curve.end); - if ((lengthDiscrepancy * lengthDiscrepancy) / - curveScaleForToleranceSquared > - pathSegmentLengthToleranceSquared && - curve.splitDepth < curveSplitDepthLimit) { - CurveType leftCurve; - CurveType rightCurve; - curve.split(leftCurve, rightCurve); - curve = leftCurve; - curveStack.append(rightCurve); - } else { - totalLength += length; - if (traversalState.m_action == - PathTraversalState::TraversalPointAtLength || - traversalState.m_action == - PathTraversalState::TraversalNormalAngleAtLength) { - traversalState.m_previous = curve.start; - traversalState.m_current = curve.end; - if (traversalState.m_totalLength + totalLength > - traversalState.m_desiredLength) - return totalLength; - } - curve = curveStack.last(); - curveStack.removeLast(); - } - } while (!curveStack.isEmpty()); - - return totalLength; -} - -PathTraversalState::PathTraversalState(PathTraversalAction action) - : m_action(action), - m_success(false), - m_totalLength(0), - m_segmentIndex(0), - m_desiredLength(0), - m_normalAngle(0) {} - -float PathTraversalState::closeSubpath() { - float distance = distanceLine(m_current, m_start); - m_current = m_start; - return distance; -} - -float PathTraversalState::moveTo(const FloatPoint& point) { - m_current = m_start = point; - return 0; -} - -float PathTraversalState::lineTo(const FloatPoint& point) { - float distance = distanceLine(m_current, point); - m_current = point; - return distance; -} - -float PathTraversalState::quadraticBezierTo(const FloatPoint& newControl, - const FloatPoint& newEnd) { - float distance = curveLength( - *this, QuadraticBezier(m_current, newControl, newEnd)); - - if (m_action != TraversalPointAtLength && - m_action != TraversalNormalAngleAtLength) - m_current = newEnd; - - return distance; -} - -float PathTraversalState::cubicBezierTo(const FloatPoint& newControl1, - const FloatPoint& newControl2, - const FloatPoint& newEnd) { - float distance = curveLength( - *this, CubicBezier(m_current, newControl1, newControl2, newEnd)); - - if (m_action != TraversalPointAtLength && - m_action != TraversalNormalAngleAtLength) - m_current = newEnd; - - return distance; -} - -void PathTraversalState::processSegment() { - if (m_action == TraversalSegmentAtLength && m_totalLength >= m_desiredLength) - m_success = true; - - if ((m_action == TraversalPointAtLength || - m_action == TraversalNormalAngleAtLength) && - m_totalLength >= m_desiredLength) { - float slope = FloatPoint(m_current - m_previous).slopeAngleRadians(); - if (m_action == TraversalPointAtLength) { - float offset = m_desiredLength - m_totalLength; - m_current.move(offset * cosf(slope), offset * sinf(slope)); - } else { - m_normalAngle = rad2deg(slope); - } - m_success = true; - } - m_previous = m_current; -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/PathTraversalState.h b/sky/engine/platform/graphics/PathTraversalState.h deleted file mode 100644 index 65d84411c8b1a..0000000000000 --- a/sky/engine/platform/graphics/PathTraversalState.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Eric Seidel - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_PATHTRAVERSALSTATE_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_PATHTRAVERSALSTATE_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" - -namespace blink { - -class PLATFORM_EXPORT PathTraversalState { - public: - enum PathTraversalAction { - TraversalTotalLength, - TraversalPointAtLength, - TraversalSegmentAtLength, - TraversalNormalAngleAtLength - }; - - PathTraversalState(PathTraversalAction); - - float closeSubpath(); - float moveTo(const FloatPoint&); - float lineTo(const FloatPoint&); - float quadraticBezierTo(const FloatPoint& newControl, - const FloatPoint& newEnd); - float cubicBezierTo(const FloatPoint& newControl1, - const FloatPoint& newControl2, - const FloatPoint& newEnd); - - void processSegment(); - - public: - PathTraversalAction m_action; - bool m_success; - - FloatPoint m_current; - FloatPoint m_start; - - float m_totalLength; - unsigned m_segmentIndex; - float m_desiredLength; - - // For normal calculations - FloatPoint m_previous; - float m_normalAngle; // degrees -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_PATHTRAVERSALSTATE_H_ diff --git a/sky/engine/platform/graphics/Pattern.cpp b/sky/engine/platform/graphics/Pattern.cpp deleted file mode 100644 index 74157d8ea8766..0000000000000 --- a/sky/engine/platform/graphics/Pattern.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2008 Eric Seidel - * Copyright (C) 2013 Google, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/Pattern.h" - -#include "flutter/sky/engine/platform/graphics/skia/SkiaUtils.h" -#include "third_party/skia/include/core/SkCanvas.h" - -namespace blink { - -PassRefPtr Pattern::createBitmapPattern(PassRefPtr tileImage, - RepeatMode repeatMode) { - return adoptRef(new Pattern(tileImage, repeatMode)); -} - -Pattern::Pattern(PassRefPtr image, RepeatMode repeatMode) {} - -Pattern::~Pattern() {} - -SkShader* Pattern::shader() { - return m_pattern.get(); -} - -void Pattern::setPatternSpaceTransform( - const AffineTransform& patternSpaceTransformation) { - if (patternSpaceTransformation == m_patternSpaceTransformation) - return; - - m_patternSpaceTransformation = patternSpaceTransformation; - m_pattern.reset(); -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/Pattern.h b/sky/engine/platform/graphics/Pattern.h deleted file mode 100644 index 9238e1b78a209..0000000000000 --- a/sky/engine/platform/graphics/Pattern.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2008 Eric Seidel - * Copyright (C) 2007-2008 Torch Mobile, Inc. - * Copyright (C) 2013 Google, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_PATTERN_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_PATTERN_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/graphics/Image.h" -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "third_party/skia/include/core/SkShader.h" - -namespace blink { - -class PLATFORM_EXPORT Pattern : public RefCounted { - public: - enum RepeatMode { - RepeatModeX = 1 << 0, - RepeatModeY = 1 << 1, - - RepeatModeNone = 0, - RepeatModeXY = RepeatModeX | RepeatModeY - }; - - static PassRefPtr createBitmapPattern(PassRefPtr tileImage, - RepeatMode = RepeatModeXY); - ~Pattern(); - - SkShader* shader(); - - void setPatternSpaceTransform( - const AffineTransform& patternSpaceTransformation); - - private: - Pattern(PassRefPtr, RepeatMode); - AffineTransform m_patternSpaceTransformation; - sk_sp m_pattern; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_PATTERN_H_ diff --git a/sky/engine/platform/graphics/RegionTracker.cpp b/sky/engine/platform/graphics/RegionTracker.cpp deleted file mode 100644 index 659d368b6f8e4..0000000000000 --- a/sky/engine/platform/graphics/RegionTracker.cpp +++ /dev/null @@ -1,470 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/RegionTracker.h" - -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "third_party/skia/include/core/SkColorFilter.h" -#include "third_party/skia/include/core/SkShader.h" - -namespace blink { - -RegionTracker::RegionTracker() - : m_opaqueRect(SkRect::MakeEmpty()), m_trackedRegionType(Opaque) {} - -void RegionTracker::reset() { - ASSERT(m_canvasLayerStack.isEmpty()); - m_opaqueRect = SkRect::MakeEmpty(); -} - -IntRect RegionTracker::asRect() const { - // Returns the largest enclosed rect. - // TODO: actually, this logic looks like its returning the smallest. - // to return largest, shouldn't we take floor of left/top - // and the ceil of right/bottom? - int left = SkScalarCeilToInt(m_opaqueRect.fLeft); - int top = SkScalarCeilToInt(m_opaqueRect.fTop); - int right = SkScalarFloorToInt(m_opaqueRect.fRight); - int bottom = SkScalarFloorToInt(m_opaqueRect.fBottom); - return IntRect(left, top, right - left, bottom - top); -} - -// Returns true if the xfermode will force the dst to be opaque, regardless of -// the current dst. -static inline bool xfermodeIsOpaque(const SkPaint& paint, bool srcIsOpaque) { - if (!srcIsOpaque) - return false; - - switch (paint.getBlendMode()) { - case SkBlendMode::kSrc: // source - case SkBlendMode::kSrcOver: // source + dest - source*dest - case SkBlendMode::kDstOver: // source + dest - source*dest - case SkBlendMode::kDstATop: // source - case SkBlendMode::kPlus: // source+dest - default: // the rest are all source + dest - source*dest - return true; - case SkBlendMode::kClear: // 0 - case SkBlendMode::kDst: // dest - case SkBlendMode::kSrcIn: // source * dest - case SkBlendMode::kDstIn: // dest * source - case SkBlendMode::kSrcOut: // source * (1-dest) - case SkBlendMode::kDstOut: // dest * (1-source) - case SkBlendMode::kSrcATop: // dest - case SkBlendMode::kXor: // source + dest - 2*(source*dest) - return false; - } -} - -static inline bool xfermodeIsOverwrite(const SkPaint& paint) { - switch (paint.getBlendMode()) { - case SkBlendMode::kSrc: - case SkBlendMode::kClear: - return true; - default: - return false; - } -} - -// Returns true if the xfermode will keep the dst opaque, assuming the dst is -// already opaque. -static inline bool xfermodePreservesOpaque(const SkPaint& paint, - bool srcIsOpaque) { - switch (paint.getBlendMode()) { - case SkBlendMode::kDst: // dest - case SkBlendMode::kSrcOver: // source + dest - source*dest - case SkBlendMode::kDstOver: // source + dest - source*dest - case SkBlendMode::kSrcATop: // dest - case SkBlendMode::kPlus: // source+dest - default: // the rest are all source + dest - source*dest - return true; - case SkBlendMode::kClear: // 0 - case SkBlendMode::kSrcOut: // source * (1-dest) - case SkBlendMode::kDstOut: // dest * (1-source) - case SkBlendMode::kXor: // source + dest - 2*(source*dest) - return false; - case SkBlendMode::kSrc: // source - case SkBlendMode::kSrcIn: // source * dest - case SkBlendMode::kDstIn: // dest * source - case SkBlendMode::kDstATop: // source - return srcIsOpaque; - } -} - -// Returns true if all pixels painted will be opaque. -static inline bool paintIsOpaque(const SkPaint& paint, - RegionTracker::DrawType drawType, - const SkBitmap* bitmap) { - if (paint.getAlpha() < 0xFF) - return false; - bool checkFillOnly = drawType != RegionTracker::FillOrStroke; - if (!checkFillOnly && paint.getStyle() != SkPaint::kFill_Style && - paint.isAntiAlias()) - return false; - SkShader* shader = paint.getShader(); - if (shader && !shader->isOpaque()) - return false; - if (bitmap && !bitmap->isOpaque()) - return false; - if (paint.getLooper()) - return false; - if (paint.getImageFilter()) - return false; - if (paint.getMaskFilter()) - return false; - SkColorFilter* colorFilter = paint.getColorFilter(); - if (colorFilter && - !(colorFilter->getFlags() & SkColorFilter::kAlphaUnchanged_Flag)) - return false; - return true; -} - -// Returns true if there is a rectangular clip, with the result in -// |deviceClipRect|. -static inline bool getDeviceClipAsRect(const GraphicsContext* context, - SkRect& deviceClipRect) { - // Get the current clip in device coordinate space. - if (!context->canvas()->isClipRect()) { - deviceClipRect.setEmpty(); - return false; - } - - SkIRect deviceClipIRect; - if (context->canvas()->getDeviceClipBounds(&deviceClipIRect)) - deviceClipRect.set(deviceClipIRect); - else - deviceClipRect.setEmpty(); - - return true; -} - -void RegionTracker::pushCanvasLayer(const SkPaint* paint) { - CanvasLayerState state; - if (paint) - state.paint = *paint; - m_canvasLayerStack.append(state); -} - -void RegionTracker::popCanvasLayer(const GraphicsContext* context) { - ASSERT(!m_canvasLayerStack.isEmpty()); - if (m_canvasLayerStack.isEmpty()) - return; - - const CanvasLayerState& canvasLayer = m_canvasLayerStack.last(); - SkRect layerOpaqueRect = canvasLayer.opaqueRect; - SkPaint layerPaint = canvasLayer.paint; - - // Apply the image mask. - if (canvasLayer.hasImageMask && - !layerOpaqueRect.intersect(canvasLayer.imageOpaqueRect)) - layerOpaqueRect.setEmpty(); - - m_canvasLayerStack.removeLast(); - - applyOpaqueRegionFromLayer(context, layerOpaqueRect, layerPaint); -} - -void RegionTracker::setImageMask(const SkRect& imageOpaqueRect) { - ASSERT(!m_canvasLayerStack.isEmpty()); - m_canvasLayerStack.last().hasImageMask = true; - m_canvasLayerStack.last().imageOpaqueRect = imageOpaqueRect; -} - -void RegionTracker::didDrawRect(const GraphicsContext* context, - const SkRect& fillRect, - const SkPaint& paint, - const SkBitmap* sourceBitmap) { - // Any stroking may put alpha in pixels even if the filling part does not. - if (paint.getStyle() != SkPaint::kFill_Style) { - bool fillsBounds = false; - - if (!paint.canComputeFastBounds()) { - didDrawUnbounded(context, paint, FillOrStroke); - } else { - SkRect strokeRect; - strokeRect = paint.computeFastBounds(fillRect, &strokeRect); - didDraw(context, strokeRect, paint, sourceBitmap, fillsBounds, - FillOrStroke); - } - } - - bool fillsBounds = paint.getStyle() != SkPaint::kStroke_Style; - didDraw(context, fillRect, paint, sourceBitmap, fillsBounds, FillOnly); -} - -void RegionTracker::didDrawPath(const GraphicsContext* context, - const SkPath& path, - const SkPaint& paint) { - SkRect rect; - if (path.isRect(&rect)) { - didDrawRect(context, rect, paint, 0); - return; - } - - bool fillsBounds = false; - - if (!paint.canComputeFastBounds()) { - didDrawUnbounded(context, paint, FillOrStroke); - } else { - rect = paint.computeFastBounds(path.getBounds(), &rect); - didDraw(context, rect, paint, 0, fillsBounds, FillOrStroke); - } -} - -void RegionTracker::didDrawPoints(const GraphicsContext* context, - SkCanvas::PointMode mode, - int numPoints, - const SkPoint points[], - const SkPaint& paint) { - if (!numPoints) - return; - - SkRect rect; - rect.fLeft = points[0].fX; - rect.fRight = points[0].fX + 1; - rect.fTop = points[0].fY; - rect.fBottom = points[0].fY + 1; - - for (int i = 1; i < numPoints; ++i) { - rect.fLeft = std::min(rect.fLeft, points[i].fX); - rect.fRight = std::max(rect.fRight, points[i].fX + 1); - rect.fTop = std::min(rect.fTop, points[i].fY); - rect.fBottom = std::max(rect.fBottom, points[i].fY + 1); - } - - bool fillsBounds = false; - - if (!paint.canComputeFastBounds()) { - didDrawUnbounded(context, paint, FillOrStroke); - } else { - rect = paint.computeFastBounds(rect, &rect); - didDraw(context, rect, paint, 0, fillsBounds, FillOrStroke); - } -} - -void RegionTracker::didDrawBounded(const GraphicsContext* context, - const SkRect& bounds, - const SkPaint& paint) { - bool fillsBounds = false; - - if (!paint.canComputeFastBounds()) { - didDrawUnbounded(context, paint, FillOrStroke); - } else { - SkRect rect; - rect = paint.computeFastBounds(bounds, &rect); - didDraw(context, rect, paint, 0, fillsBounds, FillOrStroke); - } -} - -void RegionTracker::didDraw(const GraphicsContext* context, - const SkRect& rect, - const SkPaint& paint, - const SkBitmap* sourceBitmap, - bool fillsBounds, - DrawType drawType) { - SkRect targetRect = rect; - - // Apply the transform to device coordinate space. - SkMatrix canvasTransform = context->canvas()->getTotalMatrix(); - if (!canvasTransform.mapRect(&targetRect)) - fillsBounds = false; - - // Apply the current clip. - SkRect deviceClipRect; - if (!getDeviceClipAsRect(context, deviceClipRect)) - fillsBounds = false; - else if (!targetRect.intersect(deviceClipRect)) - return; - - if (m_trackedRegionType == Overwrite && fillsBounds && - xfermodeIsOverwrite(paint)) { - markRectAsOpaque(targetRect); - return; - } - - bool drawsOpaque = paintIsOpaque(paint, drawType, sourceBitmap); - bool xfersOpaque = xfermodeIsOpaque(paint, drawsOpaque); - - if (fillsBounds && xfersOpaque) { - markRectAsOpaque(targetRect); - } else if (m_trackedRegionType == Opaque && - !xfermodePreservesOpaque(paint, drawsOpaque)) { - markRectAsNonOpaque(targetRect); - } -} - -void RegionTracker::didDrawUnbounded(const GraphicsContext* context, - const SkPaint& paint, - DrawType drawType) { - bool drawsOpaque = paintIsOpaque(paint, drawType, 0); - bool preservesOpaque = xfermodePreservesOpaque(paint, drawsOpaque); - - if (preservesOpaque) - return; - - SkRect deviceClipRect; - getDeviceClipAsRect(context, deviceClipRect); - markRectAsNonOpaque(deviceClipRect); -} - -void RegionTracker::applyOpaqueRegionFromLayer(const GraphicsContext* context, - const SkRect& layerOpaqueRect, - const SkPaint& paint) { - SkRect deviceClipRect; - bool deviceClipIsARect = getDeviceClipAsRect(context, deviceClipRect); - - if (deviceClipIsARect && deviceClipRect.isEmpty()) - return; - - SkRect sourceOpaqueRect = layerOpaqueRect; - // Save the opaque area in the destination, so we can preserve the parts of it - // under the source opaque area if possible. - SkRect destinationOpaqueRect = currentTrackingOpaqueRect(); - - bool outsideSourceOpaqueRectPreservesOpaque = - xfermodePreservesOpaque(paint, false); - if (!outsideSourceOpaqueRectPreservesOpaque) { - if (!deviceClipIsARect) { - markAllAsNonOpaque(); - return; - } - markRectAsNonOpaque(deviceClipRect); - } - - if (!deviceClipIsARect) - return; - if (!sourceOpaqueRect.intersect(deviceClipRect)) - return; - - bool sourceOpaqueRectDrawsOpaque = paintIsOpaque(paint, FillOnly, 0); - bool sourceOpaqueRectXfersOpaque = - xfermodeIsOpaque(paint, sourceOpaqueRectDrawsOpaque); - bool sourceOpaqueRectPreservesOpaque = - xfermodePreservesOpaque(paint, sourceOpaqueRectDrawsOpaque); - - // If the layer's opaque area is being drawn opaque in the layer below, then - // mark it opaque. Otherwise, if it preserves opaque then keep the - // intersection of the two. - if (sourceOpaqueRectXfersOpaque) - markRectAsOpaque(sourceOpaqueRect); - else if (sourceOpaqueRectPreservesOpaque && - sourceOpaqueRect.intersect(destinationOpaqueRect)) - markRectAsOpaque(sourceOpaqueRect); -} - -void RegionTracker::markRectAsOpaque(const SkRect& rect) { - // We want to keep track of an opaque region but bound its complexity at a - // constant size. We keep track of the largest rectangle seen by area. If we - // can add the new rect to this rectangle then we do that, as that is the - // cheapest way to increase the area returned without increasing the - // complexity. - - SkRect& opaqueRect = currentTrackingOpaqueRect(); - - if (rect.isEmpty()) - return; - if (opaqueRect.contains(rect)) - return; - if (rect.contains(opaqueRect)) { - opaqueRect = rect; - return; - } - - if (rect.fTop <= opaqueRect.fTop && rect.fBottom >= opaqueRect.fBottom) { - if (rect.fLeft < opaqueRect.fLeft && rect.fRight >= opaqueRect.fLeft) - opaqueRect.fLeft = rect.fLeft; - if (rect.fRight > opaqueRect.fRight && rect.fLeft <= opaqueRect.fRight) - opaqueRect.fRight = rect.fRight; - } else if (rect.fLeft <= opaqueRect.fLeft && - rect.fRight >= opaqueRect.fRight) { - if (rect.fTop < opaqueRect.fTop && rect.fBottom >= opaqueRect.fTop) - opaqueRect.fTop = rect.fTop; - if (rect.fBottom > opaqueRect.fBottom && rect.fTop <= opaqueRect.fBottom) - opaqueRect.fBottom = rect.fBottom; - } - - long opaqueArea = (long)opaqueRect.width() * (long)opaqueRect.height(); - long area = (long)rect.width() * (long)rect.height(); - if (area > opaqueArea) - opaqueRect = rect; -} - -void RegionTracker::markRectAsNonOpaque(const SkRect& rect) { - // We want to keep as much of the current opaque rectangle as we can, so find - // the one largest rectangle inside m_opaqueRect that does not intersect with - // |rect|. - - SkRect& opaqueRect = currentTrackingOpaqueRect(); - - if (!SkRect::Intersects(rect, opaqueRect)) - return; - if (rect.contains(opaqueRect)) { - markAllAsNonOpaque(); - return; - } - - int deltaLeft = rect.fLeft - opaqueRect.fLeft; - int deltaRight = opaqueRect.fRight - rect.fRight; - int deltaTop = rect.fTop - opaqueRect.fTop; - int deltaBottom = opaqueRect.fBottom - rect.fBottom; - - // horizontal is the larger of the two rectangles to the left or to the right - // of |rect| and inside opaqueRect. vertical is the larger of the two - // rectangles above or below |rect| and inside opaqueRect. - SkRect horizontal = opaqueRect; - if (deltaTop > deltaBottom) - horizontal.fBottom = rect.fTop; - else - horizontal.fTop = rect.fBottom; - SkRect vertical = opaqueRect; - if (deltaLeft > deltaRight) - vertical.fRight = rect.fLeft; - else - vertical.fLeft = rect.fRight; - - if ((long)horizontal.width() * (long)horizontal.height() > - (long)vertical.width() * (long)vertical.height()) - opaqueRect = horizontal; - else - opaqueRect = vertical; -} - -void RegionTracker::markAllAsNonOpaque() { - SkRect& opaqueRect = currentTrackingOpaqueRect(); - opaqueRect.setEmpty(); -} - -SkRect& RegionTracker::currentTrackingOpaqueRect() { - // If we are drawing into a canvas layer, then track the opaque rect in that - // layer. - return m_canvasLayerStack.isEmpty() ? m_opaqueRect - : m_canvasLayerStack.last().opaqueRect; -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/RegionTracker.h b/sky/engine/platform/graphics/RegionTracker.h deleted file mode 100644 index c73e34262311b..0000000000000 --- a/sky/engine/platform/graphics/RegionTracker.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_REGIONTRACKER_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_REGIONTRACKER_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "third_party/skia/include/core/SkCanvas.h" -#include "third_party/skia/include/core/SkPaint.h" -#include "third_party/skia/include/core/SkPoint.h" -#include "third_party/skia/include/core/SkRect.h" - -namespace blink { -class GraphicsContext; - -enum RegionTrackingMode { TrackOpaqueRegion, TRackOverwriteRegion }; - -// This class is an encapsulation of functionality for GraphicsContext, and its -// methods are mirrored there for the outside world. It tracks paints and -// computes what area will be opaque. -class PLATFORM_EXPORT RegionTracker final { - public: - RegionTracker(); - - // The resulting opaque region as a single rect. - IntRect asRect() const; - - void pushCanvasLayer(const SkPaint*); - void popCanvasLayer(const GraphicsContext*); - - void setImageMask(const SkRect& imageOpaqueRect); - - enum RegionType { Opaque, Overwrite }; - - // Set this to true to track regions that occlude the destination instead of - // only regions that produce opaque pixels. - void setTrackedRegionType(RegionType type) { m_trackedRegionType = type; } - - enum DrawType { FillOnly, FillOrStroke }; - - void didDrawRect(const GraphicsContext*, - const SkRect&, - const SkPaint&, - const SkBitmap* sourceBitmap); - void didDrawPath(const GraphicsContext*, const SkPath&, const SkPaint&); - void didDrawPoints(const GraphicsContext*, - SkCanvas::PointMode, - int numPoints, - const SkPoint[], - const SkPaint&); - void didDrawBounded(const GraphicsContext*, const SkRect&, const SkPaint&); - void didDrawUnbounded(const GraphicsContext*, const SkPaint&, DrawType); - - struct CanvasLayerState { - CanvasLayerState() : hasImageMask(false), opaqueRect(SkRect::MakeEmpty()) {} - - SkPaint paint; - - // An image mask is being applied to the layer. - bool hasImageMask; - // The opaque area in the image mask. - SkRect imageOpaqueRect; - - SkRect opaqueRect; - }; - - void reset(); - - private: - void didDraw(const GraphicsContext*, - const SkRect&, - const SkPaint&, - const SkBitmap* sourceBitmap, - bool fillsBounds, - DrawType); - void applyOpaqueRegionFromLayer(const GraphicsContext*, - const SkRect& layerOpaqueRect, - const SkPaint&); - void markRectAsOpaque(const SkRect&); - void markRectAsNonOpaque(const SkRect&); - void markAllAsNonOpaque(); - - SkRect& currentTrackingOpaqueRect(); - - SkRect m_opaqueRect; - RegionType m_trackedRegionType; - - Vector m_canvasLayerStack; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_REGIONTRACKER_H_ diff --git a/sky/engine/platform/graphics/StrokeData.cpp b/sky/engine/platform/graphics/StrokeData.cpp deleted file mode 100644 index 6c40d7c483bdb..0000000000000 --- a/sky/engine/platform/graphics/StrokeData.cpp +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (C) 2013 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "flutter/sky/engine/platform/graphics/StrokeData.h" - -#include "flutter/sky/engine/platform/graphics/skia/SkiaUtils.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -namespace blink { - -static const int dashRatio = 3; // Ratio of the length of a dash to its width. - -void StrokeData::setLineDash(const DashArray& dashes, float dashOffset) { - // FIXME: This is lifted directly off SkiaSupport, lines 49-74 - // so it is not guaranteed to work correctly. - size_t dashLength = dashes.size(); - if (!dashLength) { - // If no dash is set, revert to solid stroke - // FIXME: do we need to set NoStroke in some cases? - m_style = SolidStroke; - m_dash.reset(); - return; - } - - size_t count = !(dashLength % 2) ? dashLength : dashLength * 2; - OwnPtr intervals = adoptArrayPtr(new SkScalar[count]); - - for (unsigned i = 0; i < count; i++) - intervals[i] = dashes[i % dashLength]; - - m_dash = SkDashPathEffect::Make(intervals.get(), count, dashOffset); -} - -void StrokeData::setupPaint(SkPaint* paint, int length) const { - paint->setStyle(SkPaint::kStroke_Style); - paint->setStrokeWidth(SkFloatToScalar(m_thickness)); - paint->setStrokeCap(m_lineCap); - paint->setStrokeJoin(m_lineJoin); - paint->setStrokeMiter(SkFloatToScalar(m_miterLimit)); - - setupPaintDashPathEffect(paint, length); -} - -void StrokeData::setupPaintDashPathEffect(SkPaint* paint, int length) const { - float width = m_thickness; - if (m_dash) { - paint->setPathEffect(m_dash); - } else { - switch (m_style) { - case NoStroke: - case SolidStroke: - case DoubleStroke: - case WavyStroke: // FIXME: - // https://code.google.com/p/chromium/issues/detail?id=229574 - paint->setPathEffect(0); - return; - case DashedStroke: - width = dashRatio * width; - // Fall through. - case DottedStroke: - // Truncate the width, since we don't want fuzzy dots or dashes. - int dashLength = static_cast(width); - // Subtract off the endcaps, since they're rendered separately. - int distance = length - 2 * static_cast(m_thickness); - int phase = 1; - if (dashLength > 1) { - // Determine how many dashes or dots we should have. - int numDashes = distance / dashLength; - int remainder = distance % dashLength; - // Adjust the phase to center the dashes within the line. - if (numDashes % 2) { - // Odd: shift right a full dash, minus half the remainder. - phase = dashLength - remainder / 2; - } else { - // Even: shift right half a dash, minus half the remainder. - phase = (dashLength - remainder) / 2; - } - } - SkScalar dashLengthSk = SkIntToScalar(dashLength); - SkScalar intervals[2] = {dashLengthSk, dashLengthSk}; - paint->setPathEffect( - SkDashPathEffect::Make(intervals, 2, SkIntToScalar(phase))); - } - } -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/StrokeData.h b/sky/engine/platform/graphics/StrokeData.h deleted file mode 100644 index 775ded88f4796..0000000000000 --- a/sky/engine/platform/graphics/StrokeData.h +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (C) 2013 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_STROKEDATA_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_STROKEDATA_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/graphics/DashArray.h" -#include "flutter/sky/engine/platform/graphics/Gradient.h" -#include "flutter/sky/engine/platform/graphics/GraphicsTypes.h" -#include "flutter/sky/engine/platform/graphics/Pattern.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "third_party/skia/include/core/SkColorPriv.h" -#include "third_party/skia/include/effects/SkDashPathEffect.h" - -namespace blink { - -// Encapsulates stroke painting information. -// It is pulled out of GraphicsContextState to enable other methods to use it. -class PLATFORM_EXPORT StrokeData { - public: - StrokeData() - : m_style(SolidStroke), - m_thickness(0), - m_color(Color::black), - m_lineCap(SkPaint::kDefault_Cap), - m_lineJoin(SkPaint::kDefault_Join), - m_miterLimit(4) {} - - StrokeStyle style() const { return m_style; } - void setStyle(StrokeStyle style) { m_style = style; } - - float thickness() const { return m_thickness; } - void setThickness(float thickness) { m_thickness = thickness; } - - Color color() const { return m_color; } - void setColor(const Color& color) { m_color = color; } - - Gradient* gradient() const { return m_gradient.get(); } - void setGradient(const PassRefPtr gradient) { - m_gradient = gradient; - } - void clearGradient() { m_gradient.clear(); } - - Pattern* pattern() const { return m_pattern.get(); } - void setPattern(const PassRefPtr pattern) { m_pattern = pattern; } - void clearPattern() { m_pattern.clear(); } - - LineCap lineCap() const { return (LineCap)m_lineCap; } - void setLineCap(LineCap cap) { m_lineCap = (SkPaint::Cap)cap; } - - LineJoin lineJoin() const { return (LineJoin)m_lineJoin; } - void setLineJoin(LineJoin join) { m_lineJoin = (SkPaint::Join)join; } - - float miterLimit() const { return m_miterLimit; } - void setMiterLimit(float miterLimit) { m_miterLimit = miterLimit; } - - void setLineDash(const DashArray&, float); - - // Sets everything on the paint except the pattern, gradient and color. - // If a non-zero length is provided, the number of dashes/dots on a - // dashed/dotted line will be adjusted to start and end that length with a - // dash/dot. - void setupPaint(SkPaint*, int length = 0) const; - - // Setup any DashPathEffect on the paint. If a non-zero length is provided, - // and no line dash has been set, the number of dashes/dots on a dashed/dotted - // line will be adjusted to start and end that length with a dash/dot. - void setupPaintDashPathEffect(SkPaint*, int) const; - - private: - StrokeStyle m_style; - float m_thickness; - Color m_color; - RefPtr m_gradient; - RefPtr m_pattern; - SkPaint::Cap m_lineCap; - SkPaint::Join m_lineJoin; - float m_miterLimit; - sk_sp m_dash; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_STROKEDATA_H_ diff --git a/sky/engine/platform/graphics/skia/SkSizeHash.h b/sky/engine/platform/graphics/skia/SkSizeHash.h deleted file mode 100644 index be296df121aee..0000000000000 --- a/sky/engine/platform/graphics/skia/SkSizeHash.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_SKIA_SKSIZEHASH_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_SKIA_SKSIZEHASH_H_ - -#include "flutter/sky/engine/wtf/HashMap.h" -#include "third_party/skia/include/core/SkScalar.h" -#include "third_party/skia/include/core/SkSize.h" - -namespace WTF { - -template <> -struct IntHash { - static unsigned hash(const SkSize& key) { - return pairIntHash(key.width(), key.height()); - } - static bool equal(const SkSize& a, const SkSize& b) { return a == b; } - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -template <> -struct DefaultHash { - typedef IntHash Hash; -}; - -template <> -struct HashTraits : GenericHashTraits { - static const bool emptyValueIsZero = true; - static const bool needsDestruction = false; - static SkSize emptyValue() { return SkSize::Make(0, 0); } - static void constructDeletedValue(SkSize& slot, bool) { - slot = SkSize::Make(-1, -1); - } - static bool isDeletedValue(const SkSize& value) { - return value.width() == -1 && value.height() == -1; - } -}; - -template <> -struct IntHash { - static unsigned hash(const SkISize& key) { - return pairIntHash(key.width(), key.height()); - } - static bool equal(const SkISize& a, const SkISize& b) { return a == b; } - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -template <> -struct DefaultHash { - typedef IntHash Hash; -}; - -template <> -struct HashTraits : GenericHashTraits { - static const bool emptyValueIsZero = true; - static const bool needsDestruction = false; - static SkISize emptyValue() { return SkISize::Make(0, 0); } - static void constructDeletedValue(SkISize& slot, bool) { - slot = SkISize::Make(-1, -1); - } - static bool isDeletedValue(const SkISize& value) { - return value.width() == -1 && value.height() == -1; - } -}; - -} // namespace WTF - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_SKIA_SKSIZEHASH_H_ diff --git a/sky/engine/platform/graphics/skia/SkiaUtils.cpp b/sky/engine/platform/graphics/skia/SkiaUtils.cpp deleted file mode 100644 index fc0b1f58befae..0000000000000 --- a/sky/engine/platform/graphics/skia/SkiaUtils.cpp +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 2006,2007,2008, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/graphics/skia/SkiaUtils.h" - -#include "flutter/sky/engine/platform/graphics/GraphicsContext.h" -#include "third_party/skia/include/core/SkColorPriv.h" -#include "third_party/skia/include/core/SkRegion.h" - -namespace blink { - -static const struct CompositOpToXfermodeMode { - CompositeOperator mCompositOp; - SkBlendMode m_xfermodeMode; -} gMapCompositOpsToXfermodeModes[] = { - {CompositeClear, SkBlendMode::kClear}, - {CompositeCopy, SkBlendMode::kSrc}, - {CompositeSourceOver, SkBlendMode::kSrcOver}, - {CompositeSourceIn, SkBlendMode::kSrcIn}, - {CompositeSourceOut, SkBlendMode::kSrcOut}, - {CompositeSourceAtop, SkBlendMode::kSrcATop}, - {CompositeDestinationOver, SkBlendMode::kDstOver}, - {CompositeDestinationIn, SkBlendMode::kDstIn}, - {CompositeDestinationOut, SkBlendMode::kDstOut}, - {CompositeDestinationAtop, SkBlendMode::kDstATop}, - {CompositeXOR, SkBlendMode::kXor}, - {CompositePlusDarker, SkBlendMode::kDarken}, - {CompositePlusLighter, SkBlendMode::kPlus}}; - -// keep this array in sync with WebBlendMode enum in -// public/platform/WebBlendMode.h -static const SkBlendMode gMapBlendOpsToXfermodeModes[] = { - SkBlendMode::kClear, // WebBlendModeNormal - SkBlendMode::kMultiply, // WebBlendModeMultiply - SkBlendMode::kScreen, // WebBlendModeScreen - SkBlendMode::kOverlay, // WebBlendModeOverlay - SkBlendMode::kDarken, // WebBlendModeDarken - SkBlendMode::kLighten, // WebBlendModeLighten - SkBlendMode::kColorDodge, // WebBlendModeColorDodge - SkBlendMode::kColorBurn, // WebBlendModeColorBurn - SkBlendMode::kHardLight, // WebBlendModeHardLight - SkBlendMode::kSoftLight, // WebBlendModeSoftLight - SkBlendMode::kDifference, // WebBlendModeDifference - SkBlendMode::kExclusion, // WebBlendModeExclusion - SkBlendMode::kHue, // WebBlendModeHue - SkBlendMode::kSaturation, // WebBlendModeSaturation - SkBlendMode::kColor, // WebBlendModeColor - SkBlendMode::kLuminosity // WebBlendModeLuminosity -}; - -SkBlendMode WebCoreCompositeToSkiaComposite(CompositeOperator op, - WebBlendMode blendMode) { - if (blendMode != WebBlendModeNormal) { - if (static_cast(blendMode) >= - SK_ARRAY_COUNT(gMapBlendOpsToXfermodeModes)) { - SkDEBUGF( - ("GraphicsContext::setPlatformCompositeOperation unknown " - "WebBlendMode %d\n", - blendMode)); - return SkBlendMode::kSrcOver; - } - return gMapBlendOpsToXfermodeModes[static_cast(blendMode)]; - } - - const CompositOpToXfermodeMode* table = gMapCompositOpsToXfermodeModes; - if (static_cast(op) >= - SK_ARRAY_COUNT(gMapCompositOpsToXfermodeModes)) { - SkDEBUGF( - ("GraphicsContext::setPlatformCompositeOperation unknown " - "CompositeOperator %d\n", - op)); - return SkBlendMode::kSrcOver; - } - SkASSERT(table[static_cast(op)].mCompositOp == op); - return table[static_cast(op)].m_xfermodeMode; -} - -static U8CPU InvScaleByte(U8CPU component, uint32_t scale) { - SkASSERT(component == (uint8_t)component); - return (component * scale + 0x8000) >> 16; -} - -SkColor SkPMColorToColor(SkPMColor pm) { - if (!pm) - return 0; - unsigned a = SkGetPackedA32(pm); - if (!a) { - // A zero alpha value when there are non-zero R, G, or B channels is an - // invalid premultiplied color (since all channels should have been - // multiplied by 0 if a=0). - SkASSERT(false); - // In production, return 0 to protect against division by zero. - return 0; - } - - uint32_t scale = (255 << 16) / a; - - return SkColorSetARGB(a, InvScaleByte(SkGetPackedR32(pm), scale), - InvScaleByte(SkGetPackedG32(pm), scale), - InvScaleByte(SkGetPackedB32(pm), scale)); -} - -bool SkPathContainsPoint(const SkPath& originalPath, - const FloatPoint& point, - SkPath::FillType ft) { - SkRect bounds = originalPath.getBounds(); - - // We can immediately return false if the point is outside the bounding - // rect. We don't use bounds.contains() here, since it would exclude - // points on the right and bottom edges of the bounding rect, and we want - // to include them. - SkScalar fX = SkFloatToScalar(point.x()); - SkScalar fY = SkFloatToScalar(point.y()); - if (fX < bounds.fLeft || fX > bounds.fRight || fY < bounds.fTop || - fY > bounds.fBottom) - return false; - - // Scale the path to a large size before hit testing for two reasons: - // 1) Skia has trouble with coordinates close to the max signed 16-bit values, - // so we scale larger paths down. - // TODO: when Skia is patched to work properly with large values, this will - // not be necessary. - // 2) Skia does not support analytic hit testing, so we scale paths up to do - // raster hit testing with subpixel accuracy. - SkScalar biggestCoord = - std::max(std::max(std::max(bounds.fRight, bounds.fBottom), -bounds.fLeft), - -bounds.fTop); - if (SkScalarNearlyZero(biggestCoord)) - return false; - biggestCoord = std::max(std::max(biggestCoord, fX + 1), fY + 1); - - const SkScalar kMaxCoordinate = SkIntToScalar(1 << 15); - SkScalar scale = kMaxCoordinate / biggestCoord; - - SkRegion rgn; - SkRegion clip; - SkMatrix m; - SkPath scaledPath(originalPath); - - scaledPath.setFillType(ft); - m.setScale(scale, scale); - scaledPath.transform(m, 0); - - int x = static_cast(floorf(0.5f + point.x() * scale)); - int y = static_cast(floorf(0.5f + point.y() * scale)); - clip.setRect(x - 1, y - 1, x + 1, y + 1); - - return rgn.setPath(scaledPath, clip); -} - -SkMatrix affineTransformToSkMatrix(const AffineTransform& source) { - SkMatrix result; - - result.setScaleX(WebCoreDoubleToSkScalar(source.a())); - result.setSkewX(WebCoreDoubleToSkScalar(source.c())); - result.setTranslateX(WebCoreDoubleToSkScalar(source.e())); - - result.setScaleY(WebCoreDoubleToSkScalar(source.d())); - result.setSkewY(WebCoreDoubleToSkScalar(source.b())); - result.setTranslateY(WebCoreDoubleToSkScalar(source.f())); - - // FIXME: Set perspective properly. - result.setPerspX(0); - result.setPerspY(0); - result.set(SkMatrix::kMPersp2, SK_Scalar1); - - return result; -} - -bool nearlyIntegral(float value) { - return fabs(value - floorf(value)) < std::numeric_limits::epsilon(); -} - -InterpolationQuality limitInterpolationQuality( - const GraphicsContext* context, - InterpolationQuality resampling) { - return std::min(resampling, context->imageInterpolationQuality()); -} - -InterpolationQuality computeInterpolationQuality(const SkMatrix& matrix, - float srcWidth, - float srcHeight, - float destWidth, - float destHeight, - bool isDataComplete) { - // The percent change below which we will not resample. This usually means - // an off-by-one error on the web page, and just doing nearest neighbor - // sampling is usually good enough. - const float kFractionalChangeThreshold = 0.025f; - - // Images smaller than this in either direction are considered "small" and - // are not resampled ever (see below). - const int kSmallImageSizeThreshold = 8; - - // The amount an image can be stretched in a single direction before we - // say that it is being stretched so much that it must be a line or - // background that doesn't need resampling. - const float kLargeStretch = 3.0f; - - // Figure out if we should resample this image. We try to prune out some - // common cases where resampling won't give us anything, since it is much - // slower than drawing stretched. - float diffWidth = fabs(destWidth - srcWidth); - float diffHeight = fabs(destHeight - srcHeight); - bool widthNearlyEqual = diffWidth < std::numeric_limits::epsilon(); - bool heightNearlyEqual = diffHeight < std::numeric_limits::epsilon(); - // We don't need to resample if the source and destination are the same. - if (widthNearlyEqual && heightNearlyEqual) - return InterpolationNone; - - if (srcWidth <= kSmallImageSizeThreshold || - srcHeight <= kSmallImageSizeThreshold || - destWidth <= kSmallImageSizeThreshold || - destHeight <= kSmallImageSizeThreshold) { - // Small image detected. - - // Resample in the case where the new size would be non-integral. - // This can cause noticeable breaks in repeating patterns, except - // when the source image is only one pixel wide in that dimension. - if ((!nearlyIntegral(destWidth) && - srcWidth > 1 + std::numeric_limits::epsilon()) || - (!nearlyIntegral(destHeight) && - srcHeight > 1 + std::numeric_limits::epsilon())) - return InterpolationLow; - - // Otherwise, don't resample small images. These are often used for - // borders and rules (think 1x1 images used to make lines). - return InterpolationNone; - } - - if (srcHeight * kLargeStretch <= destHeight || - srcWidth * kLargeStretch <= destWidth) { - // Large image detected. - - // Don't resample if it is being stretched a lot in only one direction. - // This is trying to catch cases where somebody has created a border - // (which might be large) and then is stretching it to fill some part - // of the page. - if (widthNearlyEqual || heightNearlyEqual) - return InterpolationNone; - - // The image is growing a lot and in more than one direction. Resampling - // is slow and doesn't give us very much when growing a lot. - return InterpolationLow; - } - - if ((diffWidth / srcWidth < kFractionalChangeThreshold) && - (diffHeight / srcHeight < kFractionalChangeThreshold)) { - // It is disappointingly common on the web for image sizes to be off by - // one or two pixels. We don't bother resampling if the size difference - // is a small fraction of the original size. - return InterpolationNone; - } - - // When the image is not yet done loading, use linear. We don't cache the - // partially resampled images, and as they come in incrementally, it causes - // us to have to resample the whole thing every time. - if (!isDataComplete) - return InterpolationLow; - - // Everything else gets resampled. - // High quality interpolation only enabled for scaling and translation. - if (!(matrix.getType() & - (SkMatrix::kAffine_Mask | SkMatrix::kPerspective_Mask))) - return InterpolationHigh; - - return InterpolationLow; -} - -bool shouldDrawAntiAliased(const GraphicsContext* context, - const SkRect& destRect) { - if (!context->shouldAntialias()) - return false; - const SkMatrix totalMatrix = context->getTotalMatrix(); - // Don't disable anti-aliasing if we're rotated or skewed. - if (!totalMatrix.rectStaysRect()) - return true; - // Disable anti-aliasing for scales or n*90 degree rotations. - // Allow to opt out of the optimization though for "hairline" geometry - // images - using the shouldAntialiasHairlineImages() GraphicsContext flag. - if (!context->shouldAntialiasHairlineImages()) - return false; - // Check if the dimensions of the destination are "small" (less than one - // device pixel). To prevent sudden drop-outs. Since we know that - // kRectStaysRect_Mask is set, the matrix either has scale and no skew or - // vice versa. We can query the kAffine_Mask flag to determine which case - // it is. - // FIXME: This queries the CTM while drawing, which is generally - // discouraged. Always drawing with AA can negatively impact performance - // though - that's why it's not always on. - SkScalar widthExpansion, heightExpansion; - if (totalMatrix.getType() & SkMatrix::kAffine_Mask) - widthExpansion = totalMatrix[SkMatrix::kMSkewY], - heightExpansion = totalMatrix[SkMatrix::kMSkewX]; - else - widthExpansion = totalMatrix[SkMatrix::kMScaleX], - heightExpansion = totalMatrix[SkMatrix::kMScaleY]; - return destRect.width() * fabs(widthExpansion) < 1 || - destRect.height() * fabs(heightExpansion) < 1; -} - -} // namespace blink diff --git a/sky/engine/platform/graphics/skia/SkiaUtils.h b/sky/engine/platform/graphics/skia/SkiaUtils.h deleted file mode 100644 index 91cf887b08dd1..0000000000000 --- a/sky/engine/platform/graphics/skia/SkiaUtils.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2006,2007,2008, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// All of the functions in this file should move to new homes and this file -// should be deleted. - -#ifndef SKY_ENGINE_PLATFORM_GRAPHICS_SKIA_SKIAUTILS_H_ -#define SKY_ENGINE_PLATFORM_GRAPHICS_SKIA_SKIAUTILS_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/graphics/Color.h" -#include "flutter/sky/engine/platform/graphics/GraphicsTypes.h" -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "third_party/skia/include/core/SkMatrix.h" -#include "third_party/skia/include/core/SkPaint.h" -#include "third_party/skia/include/core/SkPath.h" -#include "third_party/skia/include/core/SkRefCnt.h" - -namespace blink { - -class GraphicsContext; - -SkBlendMode PLATFORM_EXPORT - WebCoreCompositeToSkiaComposite(CompositeOperator, - WebBlendMode = WebBlendModeNormal); - -// move this guy into SkColor.h -SkColor SkPMColorToColor(SkPMColor); - -inline SkFilterQuality WebCoreInterpolationQualityToSkFilterQuality( - InterpolationQuality quality) { - // FIXME: this reflects existing client mappings, but should probably - // be expanded to map higher level interpolations more accurately. - return quality != InterpolationNone ? kLow_SkFilterQuality - : kNone_SkFilterQuality; -} - -// Skia has problems when passed infinite, etc floats, filter them to 0. -inline SkScalar WebCoreFloatToSkScalar(float f) { - return SkFloatToScalar(std::isfinite(f) ? f : 0); -} - -inline SkScalar WebCoreDoubleToSkScalar(double d) { - return SkDoubleToScalar(std::isfinite(d) ? d : 0); -} - -inline SkRect WebCoreFloatRectToSKRect(const FloatRect& rect) { - return SkRect::MakeLTRB(SkFloatToScalar(rect.x()), SkFloatToScalar(rect.y()), - SkFloatToScalar(rect.maxX()), - SkFloatToScalar(rect.maxY())); -} - -inline bool WebCoreFloatNearlyEqual(float a, float b) { - return SkScalarNearlyEqual(WebCoreFloatToSkScalar(a), - WebCoreFloatToSkScalar(b)); -} - -inline SkPath::FillType WebCoreWindRuleToSkFillType(WindRule rule) { - return static_cast(rule); -} - -// Determine if a given WebKit point is contained in a path -bool PLATFORM_EXPORT SkPathContainsPoint(const SkPath&, - const FloatPoint&, - SkPath::FillType); - -SkMatrix PLATFORM_EXPORT affineTransformToSkMatrix(const AffineTransform&); - -bool nearlyIntegral(float value); - -InterpolationQuality limitInterpolationQuality(const GraphicsContext*, - InterpolationQuality resampling); - -InterpolationQuality computeInterpolationQuality(const SkMatrix&, - float srcWidth, - float srcHeight, - float destWidth, - float destHeight, - bool isDataComplete = true); - -bool shouldDrawAntiAliased(const GraphicsContext*, const SkRect& destRect); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_GRAPHICS_SKIA_SKIAUTILS_H_ diff --git a/sky/engine/platform/heap/Handle.h b/sky/engine/platform/heap/Handle.h deleted file mode 100644 index 6af362eabc027..0000000000000 --- a/sky/engine/platform/heap/Handle.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_HEAP_HANDLE_H_ -#define SKY_ENGINE_PLATFORM_HEAP_HANDLE_H_ - -#include "flutter/sky/engine/wtf/StdLibExtras.h" - -// -// STACK_ALLOCATED(): Use if the object is only stack allocated. -// -// DISALLOW_ALLOCATION(): Cannot be allocated with new operators but can -// be a part object. -// -// ALLOW_ONLY_INLINE_ALLOCATION(): Allows only placement new operator. -// This disallows general allocation of this object but allows to put -// the object as a value object in collections. -// -#define DISALLOW_ALLOCATION() \ - private: \ - void* operator new(size_t) = delete; \ - void* operator new(size_t, NotNullTag, void*) = delete; \ - void* operator new(size_t, void*) = delete; - -#define ALLOW_ONLY_INLINE_ALLOCATION() \ - public: \ - void* operator new(size_t, NotNullTag, void* location) { return location; } \ - void* operator new(size_t, void* location) { return location; } \ - \ - private: \ - void* operator new(size_t) = delete; - -#define STATIC_ONLY(Type) \ - private: \ - Type() = delete; - -// These macros insert annotations that the Blink GC plugin for clang uses for -// verification. STACK_ALLOCATED is used to declare that objects of this type -// are always stack allocated. GC_PLUGIN_IGNORE is used to make the plugin -// ignore a particular class or field when checking for proper usage. When using -// GC_PLUGIN_IGNORE a bug-number should be provided as an argument where the -// bug describes what needs to happen to remove the GC_PLUGIN_IGNORE again. -#if COMPILER(CLANG) -#define STACK_ALLOCATED() \ - private: \ - __attribute__((annotate("blink_stack_allocated"))) void* operator new( \ - size_t) = delete; \ - void* operator new(size_t, NotNullTag, void*) = delete; \ - void* operator new(size_t, void*) = delete; - -#else -#define STACK_ALLOCATED() DISALLOW_ALLOCATION() -#endif - -#define DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) \ - public: \ - ~type(); \ - \ - private: -#define DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(type) \ - public: \ - virtual ~type(); \ - \ - private: - -#define DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(type) \ - type::~type() {} - -#define DEFINE_STATIC_REF_WILL_BE_PERSISTENT(type, name, arguments) \ - DEFINE_STATIC_REF(type, name, arguments) - -#endif // SKY_ENGINE_PLATFORM_HEAP_HANDLE_H_ diff --git a/sky/engine/platform/testing/RunAllTests.cpp b/sky/engine/platform/testing/RunAllTests.cpp deleted file mode 100644 index 3ee6c6c9dccd4..0000000000000 --- a/sky/engine/platform/testing/RunAllTests.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "base/test/test_suite.h" -#include "flutter/sky/engine/platform/Partitions.h" -#include "flutter/sky/engine/platform/TestingPlatformSupport.h" -#include "flutter/sky/engine/wtf/MainThread.h" -#include "flutter/sky/engine/wtf/WTF.h" - -int main(int argc, char** argv) { - WTF::initialize(); - WTF::initializeMainThread(); - - blink::TestingPlatformSupport::Config platformConfig; - blink::TestingPlatformSupport platform(platformConfig); - - blink::Partitions::init(); - int result = base::RunUnitTestsUsingBaseTestSuite(argc, argv); - blink::Partitions::shutdown(); - return result; -} diff --git a/sky/engine/platform/text/BidiCharacterRun.cpp b/sky/engine/platform/text/BidiCharacterRun.cpp deleted file mode 100644 index 7be0f82932559..0000000000000 --- a/sky/engine/platform/text/BidiCharacterRun.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/text/BidiCharacterRun.h" - -#include "flutter/sky/engine/platform/Partitions.h" -#include "flutter/sky/engine/wtf/RefCountedLeakCounter.h" - -using namespace WTF; - -namespace blink { - -DEFINE_DEBUG_ONLY_GLOBAL(RefCountedLeakCounter, - bidiRunCounter, - ("BidiCharacterRun")); - -void* BidiCharacterRun::operator new(size_t sz) { -#ifndef NDEBUG - bidiRunCounter.increment(); -#endif - return partitionAlloc(Partitions::getRenderingPartition(), sz); -} - -void BidiCharacterRun::operator delete(void* ptr) { -#ifndef NDEBUG - bidiRunCounter.decrement(); -#endif - partitionFree(ptr); -} - -} // namespace blink diff --git a/sky/engine/platform/text/BidiCharacterRun.h b/sky/engine/platform/text/BidiCharacterRun.h deleted file mode 100644 index 1862fc6dbba67..0000000000000 --- a/sky/engine/platform/text/BidiCharacterRun.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_BIDICHARACTERRUN_H_ -#define SKY_ENGINE_PLATFORM_TEXT_BIDICHARACTERRUN_H_ - -#include "flutter/sky/engine/platform/text/BidiContext.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" - -namespace blink { - -struct BidiCharacterRun { - BidiCharacterRun(int start, - int stop, - BidiContext* context, - WTF::Unicode::Direction dir) - : m_override(context->override()), - m_next(0), - m_start(start), - m_stop(stop) { - ASSERT(m_start <= m_stop); - if (dir == WTF::Unicode::OtherNeutral) - dir = context->dir(); - - m_level = context->level(); - - // add level of run (cases I1 & I2) - if (m_level % 2) { - if (dir == WTF::Unicode::LeftToRight || - dir == WTF::Unicode::ArabicNumber || - dir == WTF::Unicode::EuropeanNumber) - m_level++; - } else { - if (dir == WTF::Unicode::RightToLeft) - m_level++; - else if (dir == WTF::Unicode::ArabicNumber || - dir == WTF::Unicode::EuropeanNumber) - m_level += 2; - } - } - - // BidiCharacterRun are allocated out of the rendering partition. - PLATFORM_EXPORT void* operator new(size_t); - PLATFORM_EXPORT void operator delete(void*); - - int start() const { return m_start; } - int stop() const { return m_stop; } - unsigned char level() const { return m_level; } - bool reversed() const { return m_level % 2; } - bool dirOverride() { return m_override; } - TextDirection direction() const { return reversed() ? RTL : LTR; } - - BidiCharacterRun* next() const { return m_next; } - void setNext(BidiCharacterRun* next) { m_next = next; } - - // Do not add anything apart from bitfields until after m_next. See - // https://bugs.webkit.org/show_bug.cgi?id=100173 - bool m_override : 1; - bool m_hasHyphen : 1; // Used by BidiRun subclass which is a layering - // violation but enables us to save 8 bytes per object - // on 64-bit. - bool m_hasAddedEllipsis : 1; - unsigned char m_level; - BidiCharacterRun* m_next; - int m_start; - int m_stop; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_BIDICHARACTERRUN_H_ diff --git a/sky/engine/platform/text/BidiContext.cpp b/sky/engine/platform/text/BidiContext.cpp deleted file mode 100644 index e49403dca0f43..0000000000000 --- a/sky/engine/platform/text/BidiContext.cpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2006, 2007, 2009, 2010 Apple Inc. - * All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/text/BidiContext.h" - -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -using namespace WTF::Unicode; - -struct SameSizeAsBidiContext : public RefCounted { - uint32_t bitfields : 16; - void* parent; -}; - -COMPILE_ASSERT(sizeof(BidiContext) == sizeof(SameSizeAsBidiContext), - BidiContext_should_stay_small); - -inline PassRefPtr BidiContext::createUncached( - unsigned char level, - Direction direction, - bool override, - BidiEmbeddingSource source, - BidiContext* parent) { - return adoptRef(new BidiContext(level, direction, override, source, parent)); -} - -PassRefPtr BidiContext::create(unsigned char level, - Direction direction, - bool override, - BidiEmbeddingSource source, - BidiContext* parent) { - ASSERT(direction == (level % 2 ? RightToLeft : LeftToRight)); - - if (parent) - return createUncached(level, direction, override, source, parent); - - ASSERT(level <= 1); - if (!level) { - if (!override) { - DEFINE_STATIC_REF( - BidiContext, ltrContext, - (createUncached(0, LeftToRight, false, FromStyleOrDOM, 0))); - return ltrContext; - } - - DEFINE_STATIC_REF( - BidiContext, ltrOverrideContext, - (createUncached(0, LeftToRight, true, FromStyleOrDOM, 0))); - return ltrOverrideContext; - } - - if (!override) { - DEFINE_STATIC_REF( - BidiContext, rtlContext, - (createUncached(1, RightToLeft, false, FromStyleOrDOM, 0))); - return rtlContext; - } - - DEFINE_STATIC_REF(BidiContext, rtlOverrideContext, - (createUncached(1, RightToLeft, true, FromStyleOrDOM, 0))); - return rtlOverrideContext; -} - -static inline PassRefPtr copyContextAndRebaselineLevel( - BidiContext* context, - BidiContext* parent) { - ASSERT(context); - unsigned char newLevel = parent ? parent->level() : 0; - if (context->dir() == RightToLeft) - newLevel = nextGreaterOddLevel(newLevel); - else if (parent) - newLevel = nextGreaterEvenLevel(newLevel); - - return BidiContext::create(newLevel, context->dir(), context->override(), - context->source(), parent); -} - -// The BidiContext stack must be immutable -- they're re-used for re-layout -// after DOM modification/editing -- so we copy all the non-unicode contexts, -// and recalculate their levels. -PassRefPtr -BidiContext::copyStackRemovingUnicodeEmbeddingContexts() { - Vector contexts; - for (BidiContext* iter = this; iter; iter = iter->parent()) { - if (iter->source() != FromUnicode) - contexts.append(iter); - } - ASSERT(contexts.size()); - - RefPtr topContext = - copyContextAndRebaselineLevel(contexts.last(), 0); - for (int i = contexts.size() - 1; i > 0; --i) - topContext = - copyContextAndRebaselineLevel(contexts[i - 1], topContext.get()); - - return topContext.release(); -} - -bool operator==(const BidiContext& c1, const BidiContext& c2) { - if (&c1 == &c2) - return true; - if (c1.level() != c2.level() || c1.override() != c2.override() || - c1.dir() != c2.dir() || c1.source() != c2.source()) - return false; - if (!c1.parent()) - return !c2.parent(); - return c2.parent() && *c1.parent() == *c2.parent(); -} - -} // namespace blink diff --git a/sky/engine/platform/text/BidiContext.h b/sky/engine/platform/text/BidiContext.h deleted file mode 100644 index 71e041a7aff63..0000000000000 --- a/sky/engine/platform/text/BidiContext.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2006, 2007, 2009, 2010 Apple Inc. - * All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_BIDICONTEXT_H_ -#define SKY_ENGINE_PLATFORM_TEXT_BIDICONTEXT_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -enum BidiEmbeddingSource { FromStyleOrDOM, FromUnicode }; - -// Used to keep track of explicit embeddings. -class PLATFORM_EXPORT BidiContext : public RefCounted { - public: - static PassRefPtr create(unsigned char level, - WTF::Unicode::Direction, - bool override = false, - BidiEmbeddingSource = FromStyleOrDOM, - BidiContext* parent = 0); - - BidiContext* parent() const { return m_parent.get(); } - unsigned char level() const { return m_level; } - WTF::Unicode::Direction dir() const { - return static_cast(m_direction); - } - bool override() const { return m_override; } - BidiEmbeddingSource source() const { - return static_cast(m_source); - } - - PassRefPtr copyStackRemovingUnicodeEmbeddingContexts(); - - // http://www.unicode.org/reports/tr9/#Modifications - // 6.3 raised the limit from 61 to 125. - // http://unicode.org/reports/tr9/#BD2 - static const unsigned char kMaxLevel = 125; - - private: - BidiContext(unsigned char level, - WTF::Unicode::Direction direction, - bool override, - BidiEmbeddingSource source, - BidiContext* parent) - : m_level(level), - m_direction(direction), - m_override(override), - m_source(source), - m_parent(parent) { - ASSERT(level <= kMaxLevel); - } - - static PassRefPtr createUncached(unsigned char level, - WTF::Unicode::Direction, - bool override, - BidiEmbeddingSource, - BidiContext* parent); - - unsigned - m_level : 7; // The maximium bidi level is 125: - // http://unicode.org/reports/tr9/#Explicit_Levels_and_Directions - unsigned m_direction : 5; // Direction - unsigned m_override : 1; - unsigned m_source : 1; // BidiEmbeddingSource - RefPtr m_parent; -}; - -inline unsigned char nextGreaterOddLevel(unsigned char level) { - return (level + 1) | 1; -} - -inline unsigned char nextGreaterEvenLevel(unsigned char level) { - return (level + 2) & ~1; -} - -PLATFORM_EXPORT bool operator==(const BidiContext&, const BidiContext&); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_BIDICONTEXT_H_ diff --git a/sky/engine/platform/text/BidiResolver.h b/sky/engine/platform/text/BidiResolver.h deleted file mode 100644 index be1068ced8b42..0000000000000 --- a/sky/engine/platform/text/BidiResolver.h +++ /dev/null @@ -1,1155 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_BIDIRESOLVER_H_ -#define SKY_ENGINE_PLATFORM_TEXT_BIDIRESOLVER_H_ - -#include "flutter/sky/engine/platform/text/BidiCharacterRun.h" -#include "flutter/sky/engine/platform/text/BidiContext.h" -#include "flutter/sky/engine/platform/text/BidiRunList.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -class RenderObject; - -template -class MidpointState { - public: - MidpointState() { reset(); } - - void reset() { - m_numMidpoints = 0; - m_currentMidpoint = 0; - m_betweenMidpoints = false; - } - - void startIgnoringSpaces(const Iterator& midpoint) { - ASSERT(!(m_numMidpoints % 2)); - addMidpoint(midpoint); - } - - void stopIgnoringSpaces(const Iterator& midpoint) { - ASSERT(m_numMidpoints % 2); - addMidpoint(midpoint); - } - - // When ignoring spaces, this needs to be called for objects that need line - // boxes such as RenderInlines or hard line breaks to ensure that they're not - // ignored. - void ensureLineBoxInsideIgnoredSpaces(RenderObject* renderer) { - Iterator midpoint(0, renderer, 0); - stopIgnoringSpaces(midpoint); - startIgnoringSpaces(midpoint); - } - - // Adding a pair of midpoints before a character will split it out into a new - // line box. - void ensureCharacterGetsLineBox(Iterator& textParagraphSeparator) { - startIgnoringSpaces(Iterator(0, textParagraphSeparator.object(), - textParagraphSeparator.offset() - 1)); - stopIgnoringSpaces(Iterator(0, textParagraphSeparator.object(), - textParagraphSeparator.offset())); - } - - void checkMidpoints(Iterator& lBreak) { - // Check to see if our last midpoint is a start point beyond the line break. - // If so, shave it off the list, and shave off a trailing space if the - // previous end point doesn't preserve whitespace. - if (lBreak.object() && m_numMidpoints && !(m_numMidpoints % 2)) { - Iterator* midpointsIterator = m_midpoints.data(); - Iterator& endpoint = midpointsIterator[m_numMidpoints - 2]; - const Iterator& startpoint = midpointsIterator[m_numMidpoints - 1]; - Iterator currpoint = endpoint; - while (!currpoint.atEnd() && currpoint != startpoint && - currpoint != lBreak) - currpoint.increment(); - if (currpoint == lBreak) { - // We hit the line break before the start point. Shave off the start - // point. - m_numMidpoints--; - if (endpoint.object()->style()->collapseWhiteSpace() && - endpoint.object()->isText()) - endpoint.setOffset(endpoint.offset() - 1); - } - } - } - - Vector& midpoints() { return m_midpoints; } - const unsigned& numMidpoints() const { return m_numMidpoints; } - const unsigned& currentMidpoint() const { return m_currentMidpoint; } - void incrementCurrentMidpoint() { m_currentMidpoint++; } - const bool& betweenMidpoints() const { return m_betweenMidpoints; } - void setBetweenMidpoints(bool betweenMidpoint) { - m_betweenMidpoints = betweenMidpoint; - } - - private: - // The goal is to reuse the line state across multiple - // lines so we just keep an array around for midpoints and never clear it - // across multiple lines. We track the number of items and position using the - // two other variables. - Vector m_midpoints; - unsigned m_numMidpoints; - unsigned m_currentMidpoint; - bool m_betweenMidpoints; - - void addMidpoint(const Iterator& midpoint) { - if (m_midpoints.size() <= m_numMidpoints) - m_midpoints.grow(m_numMidpoints + 10); - - Iterator* midpointsIterator = m_midpoints.data(); - midpointsIterator[m_numMidpoints++] = midpoint; - } -}; - -// The BidiStatus at a given position (typically the end of a line) can -// be cached and then used to restart bidi resolution at that position. -struct BidiStatus { - BidiStatus() - : eor(WTF::Unicode::OtherNeutral), - lastStrong(WTF::Unicode::OtherNeutral), - last(WTF::Unicode::OtherNeutral) {} - - // Creates a BidiStatus representing a new paragraph root with a default - // direction. Uses TextDirection as it only has two possibilities instead of - // WTF::Unicode::Direction which has 19. - BidiStatus(TextDirection textDirection, bool isOverride) { - WTF::Unicode::Direction direction = textDirection == LTR - ? WTF::Unicode::LeftToRight - : WTF::Unicode::RightToLeft; - eor = lastStrong = last = direction; - context = BidiContext::create(textDirection == LTR ? 0 : 1, direction, - isOverride); - } - - BidiStatus(WTF::Unicode::Direction eorDir, - WTF::Unicode::Direction lastStrongDir, - WTF::Unicode::Direction lastDir, - PassRefPtr bidiContext) - : eor(eorDir), - lastStrong(lastStrongDir), - last(lastDir), - context(bidiContext) {} - - WTF::Unicode::Direction eor; - WTF::Unicode::Direction lastStrong; - WTF::Unicode::Direction last; - RefPtr context; -}; - -class BidiEmbedding { - public: - BidiEmbedding(WTF::Unicode::Direction direction, BidiEmbeddingSource source) - : m_direction(direction), m_source(source) {} - - WTF::Unicode::Direction direction() const { return m_direction; } - BidiEmbeddingSource source() const { return m_source; } - - private: - WTF::Unicode::Direction m_direction; - BidiEmbeddingSource m_source; -}; - -inline bool operator==(const BidiStatus& status1, const BidiStatus& status2) { - return status1.eor == status2.eor && status1.last == status2.last && - status1.lastStrong == status2.lastStrong && - *(status1.context) == *(status2.context); -} - -inline bool operator!=(const BidiStatus& status1, const BidiStatus& status2) { - return !(status1 == status2); -} - -enum VisualDirectionOverride { - NoVisualOverride, - VisualLeftToRightOverride, - VisualRightToLeftOverride -}; - -// BidiResolver is WebKit's implementation of the Unicode Bidi Algorithm -// http://unicode.org/reports/tr9 -template -class BidiResolver { - WTF_MAKE_NONCOPYABLE(BidiResolver); - - public: - BidiResolver() - : m_direction(WTF::Unicode::OtherNeutral), - m_reachedEndOfLine(false), - m_emptyRun(true), - m_nestedIsolateCount(0), - m_trailingSpaceRun(0) {} - -#if ENABLE(ASSERT) - ~BidiResolver(); -#endif - - const Iterator& position() const { return m_current; } - Iterator& position() { return m_current; } - void setPositionIgnoringNestedIsolates(const Iterator& position) { - m_current = position; - } - void setPosition(const Iterator& position, unsigned nestedIsolatedCount) { - m_current = position; - m_nestedIsolateCount = nestedIsolatedCount; - } - - BidiContext* context() const { return m_status.context.get(); } - void setContext(PassRefPtr c) { m_status.context = c; } - - void setLastDir(WTF::Unicode::Direction lastDir) { m_status.last = lastDir; } - void setLastStrongDir(WTF::Unicode::Direction lastStrongDir) { - m_status.lastStrong = lastStrongDir; - } - void setEorDir(WTF::Unicode::Direction eorDir) { m_status.eor = eorDir; } - - WTF::Unicode::Direction dir() const { return m_direction; } - void setDir(WTF::Unicode::Direction d) { m_direction = d; } - - const BidiStatus& status() const { return m_status; } - void setStatus(const BidiStatus s) { - ASSERT(s.context); - m_status = s; - m_paragraphDirectionality = - s.context->dir() == WTF::Unicode::LeftToRight ? LTR : RTL; - } - - MidpointState& midpointState() { return m_midpointState; } - - // The current algorithm handles nested isolates one layer of nesting at a - // time. But when we layout each isolated span, we will walk into (and ignore) - // all child isolated spans. - void enterIsolate() { m_nestedIsolateCount++; } - void exitIsolate() { - ASSERT(m_nestedIsolateCount >= 1); - m_nestedIsolateCount--; - } - bool inIsolate() const { return m_nestedIsolateCount; } - - void embed(WTF::Unicode::Direction, BidiEmbeddingSource); - bool commitExplicitEmbedding(BidiRunList&); - - void createBidiRunsForLine(const Iterator& end, - VisualDirectionOverride = NoVisualOverride, - bool hardLineBreak = false, - bool reorderRuns = true); - - BidiRunList& runs() { return m_runs; } - - // FIXME: This used to be part of deleteRuns() but was a layering violation. - // It's unclear if this is still needed. - void markCurrentRunEmpty() { m_emptyRun = true; } - - Vector& isolatedRuns() { return m_isolatedRuns; } - - bool isEndOfLine(const Iterator& end) { - return m_current == end || m_current.atEnd(); - } - - TextDirection determineParagraphDirectionality( - bool* hasStrongDirectionality = 0); - - void setMidpointStateForIsolatedRun(Run*, const MidpointState&); - MidpointState midpointStateForIsolatedRun(Run*); - - Iterator endOfLine() const { return m_endOfLine; } - - Run* trailingSpaceRun() const { return m_trailingSpaceRun; } - - protected: - void increment() { m_current.increment(); } - // FIXME: Instead of InlineBidiResolvers subclassing this method, we should - // pass in some sort of Traits object which knows how to create runs for - // appending. - void appendRun(BidiRunList&); - - Run* addTrailingRun(BidiRunList&, - int, - int, - Run*, - BidiContext*, - TextDirection) const { - return 0; - } - Iterator m_current; - // sor and eor are "start of run" and "end of run" respectively and correpond - // to abreviations used in UBA spec: http://unicode.org/reports/tr9/#BD7 - Iterator m_sor; // Points to the first character in the current run. - Iterator m_eor; // Points to the last character in the current run. - Iterator m_last; - BidiStatus m_status; - WTF::Unicode::Direction m_direction; - // m_endOfRunAtEndOfLine is "the position last eor in the end of line" - Iterator m_endOfRunAtEndOfLine; - Iterator m_endOfLine; - bool m_reachedEndOfLine; - Iterator m_lastBeforeET; // Before a EuropeanNumberTerminator - bool m_emptyRun; - - // FIXME: This should not belong to the resolver, but rather be passed - // into createBidiRunsForLine by the caller. - BidiRunList m_runs; - - MidpointState m_midpointState; - - unsigned m_nestedIsolateCount; - Vector m_isolatedRuns; - Run* m_trailingSpaceRun; - TextDirection m_paragraphDirectionality; - - private: - void raiseExplicitEmbeddingLevel(BidiRunList&, - WTF::Unicode::Direction from, - WTF::Unicode::Direction to); - void lowerExplicitEmbeddingLevel(BidiRunList&, - WTF::Unicode::Direction from); - void checkDirectionInLowerRaiseEmbeddingLevel(); - - void updateStatusLastFromCurrentDirection(WTF::Unicode::Direction); - void reorderRunsFromLevels(BidiRunList&) const; - - bool needsToApplyL1Rule(BidiRunList&) { return false; } - int findFirstTrailingSpaceAtRun(Run*) { return 0; } - // http://www.unicode.org/reports/tr9/#L1 - void applyL1Rule(BidiRunList&); - - Vector m_currentExplicitEmbeddingSequence; - HashMap> m_midpointStateForIsolatedRun; -}; - -#if ENABLE(ASSERT) -template -BidiResolver::~BidiResolver() { - // The owner of this resolver should have handled the isolated runs. - ASSERT(m_isolatedRuns.isEmpty()); -} -#endif - -template -void BidiResolver::appendRun(BidiRunList& runs) { - if (!m_emptyRun && !m_eor.atEnd()) { - unsigned startOffset = m_sor.offset(); - unsigned endOffset = m_eor.offset(); - - if (!m_endOfRunAtEndOfLine.atEnd() && - endOffset >= m_endOfRunAtEndOfLine.offset()) { - m_reachedEndOfLine = true; - endOffset = m_endOfRunAtEndOfLine.offset(); - } - - if (endOffset >= startOffset) - runs.addRun(new Run(startOffset, endOffset + 1, context(), m_direction)); - - m_eor.increment(); - m_sor = m_eor; - } - - m_direction = WTF::Unicode::OtherNeutral; - m_status.eor = WTF::Unicode::OtherNeutral; -} - -template -void BidiResolver::embed(WTF::Unicode::Direction dir, - BidiEmbeddingSource source) { - // Isolated spans compute base directionality during their own UBA run. - // Do not insert fake embed characters once we enter an isolated span. - ASSERT(!inIsolate()); - using namespace WTF::Unicode; - - ASSERT(dir == PopDirectionalFormat || dir == LeftToRightEmbedding || - dir == LeftToRightOverride || dir == RightToLeftEmbedding || - dir == RightToLeftOverride); - m_currentExplicitEmbeddingSequence.append(BidiEmbedding(dir, source)); -} - -template -void BidiResolver::checkDirectionInLowerRaiseEmbeddingLevel() { - using namespace WTF::Unicode; - - ASSERT(m_status.eor != OtherNeutral || m_eor.atEnd()); - ASSERT(m_status.last != NonSpacingMark && m_status.last != BoundaryNeutral && - m_status.last != RightToLeftEmbedding && - m_status.last != LeftToRightEmbedding && - m_status.last != RightToLeftOverride && - m_status.last != LeftToRightOverride && - m_status.last != PopDirectionalFormat); - if (m_direction == OtherNeutral) - m_direction = - m_status.lastStrong == LeftToRight ? LeftToRight : RightToLeft; -} - -template -void BidiResolver::lowerExplicitEmbeddingLevel( - BidiRunList& runs, - WTF::Unicode::Direction from) { - using namespace WTF::Unicode; - - if (!m_emptyRun && m_eor != m_last) { - checkDirectionInLowerRaiseEmbeddingLevel(); - // bidi.sor ... bidi.eor ... bidi.last eor; need to append the - // bidi.sor-bidi.eor run or extend it through bidi.last - if (from == LeftToRight) { - // bidi.sor ... bidi.eor ... bidi.last L - if (m_status.eor == EuropeanNumber) { - if (m_status.lastStrong != LeftToRight) { - m_direction = EuropeanNumber; - appendRun(runs); - } - } else if (m_status.eor == ArabicNumber) { - m_direction = ArabicNumber; - appendRun(runs); - } else if (m_status.lastStrong != LeftToRight) { - appendRun(runs); - m_direction = LeftToRight; - } - } else if (m_status.eor == EuropeanNumber || m_status.eor == ArabicNumber || - m_status.lastStrong == LeftToRight) { - appendRun(runs); - m_direction = RightToLeft; - } - m_eor = m_last; - } - - appendRun(runs); - m_emptyRun = true; - - // sor for the new run is determined by the higher level (rule X10) - setLastDir(from); - setLastStrongDir(from); - m_eor = Iterator(); -} - -template -void BidiResolver::raiseExplicitEmbeddingLevel( - BidiRunList& runs, - WTF::Unicode::Direction from, - WTF::Unicode::Direction to) { - using namespace WTF::Unicode; - - if (!m_emptyRun && m_eor != m_last) { - checkDirectionInLowerRaiseEmbeddingLevel(); - // bidi.sor ... bidi.eor ... bidi.last eor; need to append the - // bidi.sor-bidi.eor run or extend it through bidi.last - if (to == LeftToRight) { - // bidi.sor ... bidi.eor ... bidi.last L - if (m_status.eor == EuropeanNumber) { - if (m_status.lastStrong != LeftToRight) { - m_direction = EuropeanNumber; - appendRun(runs); - } - } else if (m_status.eor == ArabicNumber) { - m_direction = ArabicNumber; - appendRun(runs); - } else if (m_status.lastStrong != LeftToRight && from == LeftToRight) { - appendRun(runs); - m_direction = LeftToRight; - } - } else if (m_status.eor == ArabicNumber || - (m_status.eor == EuropeanNumber && - (m_status.lastStrong != LeftToRight || from == RightToLeft)) || - (m_status.eor != EuropeanNumber && - m_status.lastStrong == LeftToRight && from == RightToLeft)) { - appendRun(runs); - m_direction = RightToLeft; - } - m_eor = m_last; - } - - appendRun(runs); - m_emptyRun = true; - - setLastDir(to); - setLastStrongDir(to); - m_eor = Iterator(); -} - -template -void BidiResolver::applyL1Rule(BidiRunList& runs) { - ASSERT(runs.runCount()); - if (!needsToApplyL1Rule(runs)) - return; - - Run* trailingSpaceRun = runs.logicallyLastRun(); - - int firstSpace = findFirstTrailingSpaceAtRun(trailingSpaceRun); - if (firstSpace == trailingSpaceRun->stop()) - return; - - bool shouldReorder = - trailingSpaceRun != - (m_paragraphDirectionality == LTR ? runs.lastRun() : runs.firstRun()); - if (firstSpace != trailingSpaceRun->start()) { - BidiContext* baseContext = context(); - while (BidiContext* parent = baseContext->parent()) - baseContext = parent; - - m_trailingSpaceRun = addTrailingRun( - runs, firstSpace, trailingSpaceRun->m_stop, trailingSpaceRun, - baseContext, m_paragraphDirectionality); - ASSERT(m_trailingSpaceRun); - trailingSpaceRun->m_stop = firstSpace; - return; - } - if (!shouldReorder) { - m_trailingSpaceRun = trailingSpaceRun; - return; - } - - if (m_paragraphDirectionality == LTR) { - runs.moveRunToEnd(trailingSpaceRun); - trailingSpaceRun->m_level = 0; - } else { - runs.moveRunToBeginning(trailingSpaceRun); - trailingSpaceRun->m_level = 1; - } - m_trailingSpaceRun = trailingSpaceRun; -} - -template -bool BidiResolver::commitExplicitEmbedding( - BidiRunList& runs) { - // When we're "inIsolate()" we're resolving the parent context which - // ignores (skips over) the isolated content, including embedding levels. - // We should never accrue embedding levels while skipping over isolated - // content. - ASSERT(!inIsolate() || m_currentExplicitEmbeddingSequence.isEmpty()); - - using namespace WTF::Unicode; - - unsigned char fromLevel = context()->level(); - RefPtr toContext = context(); - - for (size_t i = 0; i < m_currentExplicitEmbeddingSequence.size(); ++i) { - BidiEmbedding embedding = m_currentExplicitEmbeddingSequence[i]; - if (embedding.direction() == PopDirectionalFormat) { - if (BidiContext* parentContext = toContext->parent()) - toContext = parentContext; - } else { - Direction direction = (embedding.direction() == RightToLeftEmbedding || - embedding.direction() == RightToLeftOverride) - ? RightToLeft - : LeftToRight; - bool override = embedding.direction() == LeftToRightOverride || - embedding.direction() == RightToLeftOverride; - unsigned char level = toContext->level(); - if (direction == RightToLeft) - level = nextGreaterOddLevel(level); - else - level = nextGreaterEvenLevel(level); - if (level < BidiContext::kMaxLevel) - toContext = BidiContext::create(level, direction, override, - embedding.source(), toContext.get()); - } - } - - unsigned char toLevel = toContext->level(); - - if (toLevel > fromLevel) - raiseExplicitEmbeddingLevel(runs, fromLevel % 2 ? RightToLeft : LeftToRight, - toLevel % 2 ? RightToLeft : LeftToRight); - else if (toLevel < fromLevel) - lowerExplicitEmbeddingLevel(runs, - fromLevel % 2 ? RightToLeft : LeftToRight); - - setContext(toContext); - - m_currentExplicitEmbeddingSequence.clear(); - - return fromLevel != toLevel; -} - -template -inline void BidiResolver::updateStatusLastFromCurrentDirection( - WTF::Unicode::Direction dirCurrent) { - using namespace WTF::Unicode; - switch (dirCurrent) { - case EuropeanNumberTerminator: - if (m_status.last != EuropeanNumber) - m_status.last = EuropeanNumberTerminator; - break; - case EuropeanNumberSeparator: - case CommonNumberSeparator: - case SegmentSeparator: - case WhiteSpaceNeutral: - case OtherNeutral: - switch (m_status.last) { - case LeftToRight: - case RightToLeft: - case RightToLeftArabic: - case EuropeanNumber: - case ArabicNumber: - m_status.last = dirCurrent; - break; - default: - m_status.last = OtherNeutral; - } - break; - case NonSpacingMark: - case BoundaryNeutral: - case RightToLeftEmbedding: - case LeftToRightEmbedding: - case RightToLeftOverride: - case LeftToRightOverride: - case PopDirectionalFormat: - // ignore these - break; - case EuropeanNumber: - // fall through - default: - m_status.last = dirCurrent; - } -} - -template -inline void BidiResolver::reorderRunsFromLevels( - BidiRunList& runs) const { - unsigned char levelLow = BidiContext::kMaxLevel; - unsigned char levelHigh = 0; - for (Run* run = runs.firstRun(); run; run = run->next()) { - levelHigh = std::max(run->level(), levelHigh); - levelLow = std::min(run->level(), levelLow); - } - - // This implements reordering of the line (L2 according to Bidi spec): - // http://unicode.org/reports/tr9/#L2 - // L2. From the highest level found in the text to the lowest odd level on - // each line, reverse any contiguous sequence of characters that are at that - // level or higher. - - // Reversing is only done up to the lowest odd level. - if (!(levelLow % 2)) - levelLow++; - - unsigned count = runs.runCount() - 1; - - while (levelHigh >= levelLow) { - unsigned i = 0; - Run* run = runs.firstRun(); - while (i < count) { - for (; i < count && run && run->level() < levelHigh; i++) - run = run->next(); - unsigned start = i; - for (; i <= count && run && run->level() >= levelHigh; i++) - run = run->next(); - unsigned end = i - 1; - runs.reverseRuns(start, end); - } - levelHigh--; - } -} - -template -TextDirection BidiResolver::determineParagraphDirectionality( - bool* hasStrongDirectionality) { - while (!m_current.atEnd()) { - if (inIsolate()) { - increment(); - continue; - } - if (m_current.atParagraphSeparator()) - break; - UChar32 current = m_current.current(); - if (UNLIKELY(U16_IS_SURROGATE(current))) { - increment(); - // If this not the high part of the surrogate pair, then drop it and move - // to the next. - if (!U16_IS_SURROGATE_LEAD(current)) - continue; - UChar high = static_cast(current); - if (m_current.atEnd()) - continue; - UChar low = m_current.current(); - // Verify the low part. If invalid, then assume an invalid surrogate pair - // and retry. - if (!U16_IS_TRAIL(low)) - continue; - current = U16_GET_SUPPLEMENTARY(high, low); - } - WTF::Unicode::Direction charDirection = WTF::Unicode::direction(current); - if (charDirection == WTF::Unicode::LeftToRight) { - if (hasStrongDirectionality) - *hasStrongDirectionality = true; - return LTR; - } - if (charDirection == WTF::Unicode::RightToLeft || - charDirection == WTF::Unicode::RightToLeftArabic) { - if (hasStrongDirectionality) - *hasStrongDirectionality = true; - return RTL; - } - increment(); - } - if (hasStrongDirectionality) - *hasStrongDirectionality = false; - return LTR; -} - -template -void BidiResolver::createBidiRunsForLine( - const Iterator& end, - VisualDirectionOverride override, - bool hardLineBreak, - bool reorderRuns) { - using namespace WTF::Unicode; - - ASSERT(m_direction == OtherNeutral); - m_trailingSpaceRun = 0; - - m_endOfLine = end; - - if (override != NoVisualOverride) { - m_emptyRun = false; - m_sor = m_current; - m_eor = Iterator(); - while (m_current != end && !m_current.atEnd()) { - m_eor = m_current; - increment(); - } - m_direction = - override == VisualLeftToRightOverride ? LeftToRight : RightToLeft; - appendRun(m_runs); - m_runs.setLogicallyLastRun(m_runs.lastRun()); - if (override == VisualRightToLeftOverride && m_runs.runCount()) - m_runs.reverseRuns(0, m_runs.runCount() - 1); - return; - } - - m_emptyRun = true; - - m_eor = Iterator(); - - m_last = m_current; - bool lastLineEnded = false; - BidiResolver stateAtEnd; - - while (true) { - if (inIsolate() && m_emptyRun) { - m_sor = m_current; - m_emptyRun = false; - } - - if (!lastLineEnded && isEndOfLine(end)) { - if (m_emptyRun) - break; - - stateAtEnd.m_status = m_status; - stateAtEnd.m_sor = m_sor; - stateAtEnd.m_eor = m_eor; - stateAtEnd.m_last = m_last; - stateAtEnd.m_reachedEndOfLine = m_reachedEndOfLine; - stateAtEnd.m_lastBeforeET = m_lastBeforeET; - stateAtEnd.m_emptyRun = m_emptyRun; - m_endOfRunAtEndOfLine = m_last; - lastLineEnded = true; - } - Direction dirCurrent; - if (lastLineEnded && (hardLineBreak || m_current.atEnd())) { - BidiContext* c = context(); - if (hardLineBreak) { - // A deviation from the Unicode Bidi Algorithm in order to match - // WinIE and user expectations: hard line breaks reset bidi state - // coming from unicode bidi control characters, but not those from - // DOM nodes with specified directionality - stateAtEnd.setContext(c->copyStackRemovingUnicodeEmbeddingContexts()); - - dirCurrent = stateAtEnd.context()->dir(); - stateAtEnd.setEorDir(dirCurrent); - stateAtEnd.setLastDir(dirCurrent); - stateAtEnd.setLastStrongDir(dirCurrent); - } else { - while (c->parent()) - c = c->parent(); - dirCurrent = c->dir(); - } - } else { - dirCurrent = m_current.direction(); - if (context()->override() && dirCurrent != RightToLeftEmbedding && - dirCurrent != LeftToRightEmbedding && - dirCurrent != RightToLeftOverride && - dirCurrent != LeftToRightOverride && - dirCurrent != PopDirectionalFormat) - dirCurrent = context()->dir(); - else if (dirCurrent == NonSpacingMark) - dirCurrent = m_status.last; - } - - // We ignore all character directionality while in unicode-bidi: isolate - // spans. We'll handle ordering the isolated characters in a second pass. - if (inIsolate()) - dirCurrent = OtherNeutral; - - ASSERT(m_status.eor != OtherNeutral || m_eor.atEnd()); - switch (dirCurrent) { - // embedding and overrides (X1-X9 in the Bidi specs) - case RightToLeftEmbedding: - case LeftToRightEmbedding: - case RightToLeftOverride: - case LeftToRightOverride: - case PopDirectionalFormat: - embed(dirCurrent, FromUnicode); - commitExplicitEmbedding(m_runs); - break; - - // strong types - case LeftToRight: - switch (m_status.last) { - case RightToLeft: - case RightToLeftArabic: - case EuropeanNumber: - case ArabicNumber: - if (m_status.last != EuropeanNumber || - m_status.lastStrong != LeftToRight) - appendRun(m_runs); - break; - case LeftToRight: - break; - case EuropeanNumberSeparator: - case EuropeanNumberTerminator: - case CommonNumberSeparator: - case BoundaryNeutral: - case BlockSeparator: - case SegmentSeparator: - case WhiteSpaceNeutral: - case OtherNeutral: - if (m_status.eor == EuropeanNumber) { - if (m_status.lastStrong != LeftToRight) { - // the numbers need to be on a higher embedding level, so let's - // close that run - m_direction = EuropeanNumber; - appendRun(m_runs); - if (context()->dir() != LeftToRight) { - // the neutrals take the embedding direction, which is R - m_eor = m_last; - m_direction = RightToLeft; - appendRun(m_runs); - } - } - } else if (m_status.eor == ArabicNumber) { - // Arabic numbers are always on a higher embedding level, so let's - // close that run - m_direction = ArabicNumber; - appendRun(m_runs); - if (context()->dir() != LeftToRight) { - // the neutrals take the embedding direction, which is R - m_eor = m_last; - m_direction = RightToLeft; - appendRun(m_runs); - } - } else if (m_status.lastStrong != LeftToRight) { - // last stuff takes embedding dir - if (context()->dir() == RightToLeft) { - m_eor = m_last; - m_direction = RightToLeft; - } - appendRun(m_runs); - } - default: - break; - } - m_eor = m_current; - m_status.eor = LeftToRight; - m_status.lastStrong = LeftToRight; - m_direction = LeftToRight; - break; - case RightToLeftArabic: - case RightToLeft: - switch (m_status.last) { - case LeftToRight: - case EuropeanNumber: - case ArabicNumber: - appendRun(m_runs); - case RightToLeft: - case RightToLeftArabic: - break; - case EuropeanNumberSeparator: - case EuropeanNumberTerminator: - case CommonNumberSeparator: - case BoundaryNeutral: - case BlockSeparator: - case SegmentSeparator: - case WhiteSpaceNeutral: - case OtherNeutral: - if (m_status.eor == EuropeanNumber) { - if (m_status.lastStrong == LeftToRight && - context()->dir() == LeftToRight) - m_eor = m_last; - appendRun(m_runs); - } else if (m_status.eor == ArabicNumber) { - appendRun(m_runs); - } else if (m_status.lastStrong == LeftToRight) { - if (context()->dir() == LeftToRight) - m_eor = m_last; - appendRun(m_runs); - } - default: - break; - } - m_eor = m_current; - m_status.eor = RightToLeft; - m_status.lastStrong = dirCurrent; - m_direction = RightToLeft; - break; - - // weak types: - - case EuropeanNumber: - if (m_status.lastStrong != RightToLeftArabic) { - // if last strong was AL change EN to AN - switch (m_status.last) { - case EuropeanNumber: - case LeftToRight: - break; - case RightToLeft: - case RightToLeftArabic: - case ArabicNumber: - m_eor = m_last; - appendRun(m_runs); - m_direction = EuropeanNumber; - break; - case EuropeanNumberSeparator: - case CommonNumberSeparator: - if (m_status.eor == EuropeanNumber) - break; - case EuropeanNumberTerminator: - case BoundaryNeutral: - case BlockSeparator: - case SegmentSeparator: - case WhiteSpaceNeutral: - case OtherNeutral: - if (m_status.eor == EuropeanNumber) { - if (m_status.lastStrong == RightToLeft) { - // ENs on both sides behave like Rs, so the neutrals should be - // R. Terminate the EN run. - appendRun(m_runs); - // Make an R run. - m_eor = m_status.last == EuropeanNumberTerminator - ? m_lastBeforeET - : m_last; - m_direction = RightToLeft; - appendRun(m_runs); - // Begin a new EN run. - m_direction = EuropeanNumber; - } - } else if (m_status.eor == ArabicNumber) { - // Terminate the AN run. - appendRun(m_runs); - if (m_status.lastStrong == RightToLeft || - context()->dir() == RightToLeft) { - // Make an R run. - m_eor = m_status.last == EuropeanNumberTerminator - ? m_lastBeforeET - : m_last; - m_direction = RightToLeft; - appendRun(m_runs); - // Begin a new EN run. - m_direction = EuropeanNumber; - } - } else if (m_status.lastStrong == RightToLeft) { - // Extend the R run to include the neutrals. - m_eor = m_status.last == EuropeanNumberTerminator - ? m_lastBeforeET - : m_last; - m_direction = RightToLeft; - appendRun(m_runs); - // Begin a new EN run. - m_direction = EuropeanNumber; - } - default: - break; - } - m_eor = m_current; - m_status.eor = EuropeanNumber; - if (m_direction == OtherNeutral) - m_direction = LeftToRight; - break; - } - case ArabicNumber: - dirCurrent = ArabicNumber; - switch (m_status.last) { - case LeftToRight: - if (context()->dir() == LeftToRight) - appendRun(m_runs); - break; - case ArabicNumber: - break; - case RightToLeft: - case RightToLeftArabic: - case EuropeanNumber: - m_eor = m_last; - appendRun(m_runs); - break; - case CommonNumberSeparator: - if (m_status.eor == ArabicNumber) - break; - case EuropeanNumberSeparator: - case EuropeanNumberTerminator: - case BoundaryNeutral: - case BlockSeparator: - case SegmentSeparator: - case WhiteSpaceNeutral: - case OtherNeutral: - if (m_status.eor == ArabicNumber || - (m_status.eor == EuropeanNumber && - (m_status.lastStrong == RightToLeft || - context()->dir() == RightToLeft)) || - (m_status.eor != EuropeanNumber && - m_status.lastStrong == LeftToRight && - context()->dir() == RightToLeft)) { - // Terminate the run before the neutrals. - appendRun(m_runs); - // Begin an R run for the neutrals. - m_direction = RightToLeft; - } else if (m_direction == OtherNeutral) { - m_direction = m_status.lastStrong == LeftToRight ? LeftToRight - : RightToLeft; - } - m_eor = m_last; - appendRun(m_runs); - default: - break; - } - m_eor = m_current; - m_status.eor = ArabicNumber; - if (m_direction == OtherNeutral) - m_direction = ArabicNumber; - break; - case EuropeanNumberSeparator: - case CommonNumberSeparator: - break; - case EuropeanNumberTerminator: - if (m_status.last == EuropeanNumber) { - dirCurrent = EuropeanNumber; - m_eor = m_current; - m_status.eor = dirCurrent; - } else if (m_status.last != EuropeanNumberTerminator) { - m_lastBeforeET = m_emptyRun ? m_eor : m_last; - } - break; - - // boundary neutrals should be ignored - case BoundaryNeutral: - if (m_eor == m_last) - m_eor = m_current; - break; - // neutrals - case BlockSeparator: - // ### what do we do with newline and paragraph seperators that come to - // here? - break; - case SegmentSeparator: - // ### implement rule L1 - break; - case WhiteSpaceNeutral: - break; - case OtherNeutral: - break; - default: - break; - } - - if (lastLineEnded && m_eor == m_current) { - if (!m_reachedEndOfLine) { - m_eor = m_endOfRunAtEndOfLine; - switch (m_status.eor) { - case LeftToRight: - case RightToLeft: - case ArabicNumber: - m_direction = m_status.eor; - break; - case EuropeanNumber: - m_direction = m_status.lastStrong == LeftToRight ? LeftToRight - : EuropeanNumber; - break; - default: - ASSERT_NOT_REACHED(); - } - appendRun(m_runs); - } - m_current = end; - m_status = stateAtEnd.m_status; - m_sor = stateAtEnd.m_sor; - m_eor = stateAtEnd.m_eor; - m_last = stateAtEnd.m_last; - m_reachedEndOfLine = stateAtEnd.m_reachedEndOfLine; - m_lastBeforeET = stateAtEnd.m_lastBeforeET; - m_emptyRun = stateAtEnd.m_emptyRun; - m_direction = OtherNeutral; - break; - } - - updateStatusLastFromCurrentDirection(dirCurrent); - m_last = m_current; - - if (m_emptyRun) { - m_sor = m_current; - m_emptyRun = false; - } - - increment(); - if (!m_currentExplicitEmbeddingSequence.isEmpty()) { - bool committed = commitExplicitEmbedding(m_runs); - if (committed && lastLineEnded) { - m_current = end; - m_status = stateAtEnd.m_status; - m_sor = stateAtEnd.m_sor; - m_eor = stateAtEnd.m_eor; - m_last = stateAtEnd.m_last; - m_reachedEndOfLine = stateAtEnd.m_reachedEndOfLine; - m_lastBeforeET = stateAtEnd.m_lastBeforeET; - m_emptyRun = stateAtEnd.m_emptyRun; - m_direction = OtherNeutral; - break; - } - } - } - - m_runs.setLogicallyLastRun(m_runs.lastRun()); - if (reorderRuns) - reorderRunsFromLevels(m_runs); - m_endOfRunAtEndOfLine = Iterator(); - m_endOfLine = Iterator(); - - if (!hardLineBreak && m_runs.runCount()) - applyL1Rule(m_runs); -} - -template -void BidiResolver::setMidpointStateForIsolatedRun( - Run* run, - const MidpointState& midpoint) { - ASSERT(!m_midpointStateForIsolatedRun.contains(run)); - m_midpointStateForIsolatedRun.add(run, midpoint); -} - -template -MidpointState -BidiResolver::midpointStateForIsolatedRun(Run* run) { - return m_midpointStateForIsolatedRun.take(run); -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_BIDIRESOLVER_H_ diff --git a/sky/engine/platform/text/BidiResolverTest.cpp b/sky/engine/platform/text/BidiResolverTest.cpp deleted file mode 100644 index 2ad444415e9a0..0000000000000 --- a/sky/engine/platform/text/BidiResolverTest.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/text/BidiResolver.h" - -#include -#include -#include "flutter/sky/engine/platform/text/BidiTestHarness.h" -#include "flutter/sky/engine/platform/text/TextRunIterator.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" - -namespace { - -using namespace WTF; -using namespace blink; - -TEST(BidiResolver, Basic) { - bool hasStrongDirectionality; - String value("foo"); - TextRun run(value); - BidiResolver bidiResolver; - bidiResolver.setStatus( - BidiStatus(run.direction(), run.directionalOverride())); - bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0)); - TextDirection direction = - bidiResolver.determineParagraphDirectionality(&hasStrongDirectionality); - EXPECT_TRUE(hasStrongDirectionality); - EXPECT_EQ(LTR, direction); -} - -TextDirection determineParagraphDirectionality( - const TextRun& textRun, - bool* hasStrongDirectionality = 0) { - BidiResolver resolver; - resolver.setStatus(BidiStatus(LTR, false)); - resolver.setPositionIgnoringNestedIsolates(TextRunIterator(&textRun, 0)); - return resolver.determineParagraphDirectionality(hasStrongDirectionality); -} - -struct TestData { - UChar text[3]; - size_t length; - TextDirection expectedDirection; - bool expectedStrong; -}; - -void testDirectionality(const TestData& entry) { - bool hasStrongDirectionality; - String data(entry.text, entry.length); - TextRun run(data); - TextDirection direction = - determineParagraphDirectionality(run, &hasStrongDirectionality); - EXPECT_EQ(entry.expectedStrong, hasStrongDirectionality); - EXPECT_EQ(entry.expectedDirection, direction); -} - -TEST(BidiResolver, ParagraphDirectionSurrogates) { - const TestData testData[] = {// Test strong RTL, non-BMP. (U+10858 Imperial - // Aramaic number one, strong RTL) - {{0xD802, 0xDC58}, 2, RTL, true}, - - // Test strong LTR, non-BMP. (U+1D15F Musical - // symbol quarter note, strong LTR) - {{0xD834, 0xDD5F}, 2, LTR, true}, - - // Test broken surrogate: valid leading, invalid - // trail. (Lead of U+10858, space) - {{0xD802, ' '}, 2, LTR, false}, - - // Test broken surrogate: invalid leading. (Trail - // of U+10858, U+05D0 Hebrew Alef) - {{0xDC58, 0x05D0}, 2, RTL, true}, - - // Test broken surrogate: valid leading, invalid - // trail/valid lead, valid trail. - {{0xD802, 0xD802, 0xDC58}, 3, RTL, true}, - - // Test broken surrogate: valid leading, no trail - // (string too short). (Lead of U+10858) - {{0xD802, 0xDC58}, 1, LTR, false}, - - // Test broken surrogate: trail appearing before - // lead. (U+10858 units reversed) - {{0xDC58, 0xD802}, 2, LTR, false}}; - for (size_t i = 0; i < WTF_ARRAY_LENGTH(testData); ++i) - testDirectionality(testData[i]); -} - -class BidiTestRunner { - public: - BidiTestRunner() - : m_testsRun(0), - m_testsSkipped(0), - m_ignoredCharFailures(0), - m_levelFailures(0), - m_orderFailures(0) {} - - void skipTestsWith(UChar codepoint) { m_skippedCodePoints.insert(codepoint); } - - void runTest(const std::basic_string& input, - const std::vector& reorder, - const std::vector& levels, - bidi_test::ParagraphDirection, - const std::string& line, - size_t lineNumber); - - size_t m_testsRun; - size_t m_testsSkipped; - std::set m_skippedCodePoints; - size_t m_ignoredCharFailures; - size_t m_levelFailures; - size_t m_orderFailures; -}; - -// Blink's UBA does not filter out control characters, etc. Maybe it should? -// Instead it depends on later layers of Blink to simply ignore them. -// This function helps us emulate that to be compatible with BidiTest.txt -// expectations. -static bool isNonRenderedCodePoint(UChar c) { - // The tests also expect us to ignore soft-hyphen. - if (c == 0xAD) - return true; - // Control characters are not rendered: - return c >= 0x202A && c <= 0x202E; - // But it seems to expect LRI, etc. to be rendered!? -} - -std::string diffString(const std::vector& actual, - const std::vector& expected) { - std::ostringstream diff; - diff << "actual: "; - // This is the magical way to print a vector to a stream, clear, right? - std::copy(actual.begin(), actual.end(), - std::ostream_iterator(diff, " ")); - diff << " expected: "; - std::copy(expected.begin(), expected.end(), - std::ostream_iterator(diff, " ")); - return diff.str(); -} - -void BidiTestRunner::runTest(const std::basic_string& input, - const std::vector& expectedOrder, - const std::vector& expectedLevels, - bidi_test::ParagraphDirection paragraphDirection, - const std::string& line, - size_t lineNumber) { - if (!m_skippedCodePoints.empty()) { - for (size_t i = 0; i < input.size(); i++) { - if (m_skippedCodePoints.count(input[i])) { - m_testsSkipped++; - return; - } - } - } - - m_testsRun++; - - TextRun textRun(input.data(), input.size()); - switch (paragraphDirection) { - case bidi_test::DirectionAutoLTR: - textRun.setDirection(determineParagraphDirectionality(textRun)); - break; - case bidi_test::DirectionLTR: - textRun.setDirection(LTR); - break; - case bidi_test::DirectionRTL: - textRun.setDirection(RTL); - break; - } - BidiResolver resolver; - resolver.setStatus( - BidiStatus(textRun.direction(), textRun.directionalOverride())); - resolver.setPositionIgnoringNestedIsolates(TextRunIterator(&textRun, 0)); - - BidiRunList& runs = resolver.runs(); - resolver.createBidiRunsForLine(TextRunIterator(&textRun, textRun.length())); - - std::ostringstream errorContext; - errorContext << ", line " << lineNumber << " \"" << line << "\""; - errorContext << " context: " - << bidi_test::nameFromParagraphDirection(paragraphDirection); - - std::vector actualOrder; - std::vector actualLevels; - actualLevels.assign(input.size(), -1); - BidiCharacterRun* run = runs.firstRun(); - while (run) { - // Blink's UBA just makes runs, the actual ordering of the display of - // characters is handled later in our pipeline, so we fake it here: - bool reversed = run->reversed(); - ASSERT(run->stop() >= run->start()); - size_t length = run->stop() - run->start(); - for (size_t i = 0; i < length; i++) { - int inputIndex = reversed ? run->stop() - i - 1 : run->start() + i; - if (!isNonRenderedCodePoint(input[inputIndex])) - actualOrder.push_back(inputIndex); - // BidiTest.txt gives expected level data in the order of the original - // input. - actualLevels[inputIndex] = run->level(); - } - run = run->next(); - } - - if (expectedOrder.size() != actualOrder.size()) { - m_ignoredCharFailures++; - EXPECT_EQ(expectedOrder.size(), actualOrder.size()) << errorContext.str(); - } else if (expectedOrder != actualOrder) { - m_orderFailures++; - printf("ORDER %s%s\n", diffString(actualOrder, expectedOrder).c_str(), - errorContext.str().c_str()); - } - - if (expectedLevels.size() != actualLevels.size()) { - m_ignoredCharFailures++; - EXPECT_EQ(expectedLevels.size(), actualLevels.size()) << errorContext.str(); - } else { - for (size_t i = 0; i < expectedLevels.size(); i++) { - // level == -1 means the level should be ignored. - if (expectedLevels[i] == actualLevels[i] || expectedLevels[i] == -1) - continue; - - printf("LEVELS %s%s\n", diffString(actualLevels, expectedLevels).c_str(), - errorContext.str().c_str()); - m_levelFailures++; - break; - } - } - runs.deleteRuns(); -} - -TEST(BidiResolver, BidiTest_txt) { - BidiTestRunner runner; - // Blink's Unicode Bidi Algorithm (UBA) doesn't yet support the - // new isolate directives from Unicode 6.3: - // http://www.unicode.org/reports/tr9/#Explicit_Directional_Isolates - runner.skipTestsWith(0x2066); // LRI - runner.skipTestsWith(0x2067); // RLI - runner.skipTestsWith(0x2068); // FSI - runner.skipTestsWith(0x2069); // PDI - - // This code wants to use PathService from base/path_service.h - // but we aren't allowed to depend on base/ directly from Blink yet. - // Alternatively we could use: - // blink::Platform::current()->unitTestSupport()->webKitRootDir() - // and a relative path, but that would require running inside - // webkit_unit_tests (to have a functioning Platform object). - // The file we want is: - // src/third_party/icu/source/test/testdata/BidiTest.txt - // but we don't have any good way to find it from this unittest. - // Just assume we're running this test manually for now. On the - // bots we just print a warning that we can't find the test file. - std::string bidiTestPath = "BidiTest.txt"; - std::ifstream bidiTestFile(bidiTestPath.c_str()); - if (!bidiTestFile.is_open()) { - printf("ERROR: Failed to open BidiTest.txt, cannot run tests.\n"); - return; - } - - bidi_test::Harness harness(runner); - harness.parse(bidiTestFile); - bidiTestFile.close(); - - if (runner.m_testsSkipped) - printf("WARNING: Skipped %zu tests.\n", runner.m_testsSkipped); - printf("Ran %zu tests: %zu level failures %zu order failures.\n", - runner.m_testsRun, runner.m_levelFailures, runner.m_orderFailures); - - // The unittest harness only pays attention to GTest output, so we verify - // that the tests behaved as expected: - EXPECT_EQ(352098u, runner.m_testsRun); - EXPECT_EQ(418143u, runner.m_testsSkipped); - EXPECT_EQ(0u, runner.m_ignoredCharFailures); - EXPECT_EQ(44882u, runner.m_levelFailures); - EXPECT_EQ(19151u, runner.m_orderFailures); -} - -} // namespace diff --git a/sky/engine/platform/text/BidiRunList.h b/sky/engine/platform/text/BidiRunList.h deleted file mode 100644 index f562c151ba966..0000000000000 --- a/sky/engine/platform/text/BidiRunList.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * Copyright (C) 2003, 2004, 2006, 2007, 2008 Apple Inc. All right reserved. - * Copyright (C) 2011 Google, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_BIDIRUNLIST_H_ -#define SKY_ENGINE_PLATFORM_TEXT_BIDIRUNLIST_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" - -namespace blink { - -template -class BidiRunList { - WTF_MAKE_NONCOPYABLE(BidiRunList); - - public: - BidiRunList() - : m_firstRun(0), m_lastRun(0), m_logicallyLastRun(0), m_runCount(0) {} - - // FIXME: Once BidiResolver no longer owns the BidiRunList, - // then ~BidiRunList should call deleteRuns() automatically. - - Run* firstRun() const { return m_firstRun; } - Run* lastRun() const { return m_lastRun; } - Run* logicallyLastRun() const { return m_logicallyLastRun; } - unsigned runCount() const { return m_runCount; } - - void addRun(Run*); - void prependRun(Run*); - - void moveRunToEnd(Run*); - void moveRunToBeginning(Run*); - - void deleteRuns(); - void reverseRuns(unsigned start, unsigned end); - void reorderRunsFromLevels(); - - void setLogicallyLastRun(Run* run) { m_logicallyLastRun = run; } - - void replaceRunWithRuns(Run* toReplace, BidiRunList& newRuns); - - private: - void clearWithoutDestroyingRuns(); - - Run* m_firstRun; - Run* m_lastRun; - Run* m_logicallyLastRun; - unsigned m_runCount; -}; - -template -inline void BidiRunList::addRun(Run* run) { - if (!m_firstRun) - m_firstRun = run; - else - m_lastRun->m_next = run; - m_lastRun = run; - m_runCount++; -} - -template -inline void BidiRunList::prependRun(Run* run) { - ASSERT(!run->m_next); - - if (!m_lastRun) - m_lastRun = run; - else - run->m_next = m_firstRun; - m_firstRun = run; - m_runCount++; -} - -template -inline void BidiRunList::moveRunToEnd(Run* run) { - ASSERT(m_firstRun); - ASSERT(m_lastRun); - ASSERT(run->m_next); - - Run* current = 0; - Run* next = m_firstRun; - while (next != run) { - current = next; - next = current->next(); - } - - if (!current) - m_firstRun = run->next(); - else - current->m_next = run->m_next; - - run->m_next = 0; - m_lastRun->m_next = run; - m_lastRun = run; -} - -template -inline void BidiRunList::moveRunToBeginning(Run* run) { - ASSERT(m_firstRun); - ASSERT(m_lastRun); - ASSERT(run != m_firstRun); - - Run* current = m_firstRun; - Run* next = current->next(); - while (next != run) { - current = next; - next = current->next(); - } - - current->m_next = run->m_next; - if (run == m_lastRun) - m_lastRun = current; - - run->m_next = m_firstRun; - m_firstRun = run; -} - -template -void BidiRunList::replaceRunWithRuns(Run* toReplace, - BidiRunList& newRuns) { - ASSERT(newRuns.runCount()); - ASSERT(m_firstRun); - ASSERT(toReplace); - - if (m_firstRun == toReplace) { - m_firstRun = newRuns.firstRun(); - } else { - // Find the run just before "toReplace" in the list of runs. - Run* previousRun = m_firstRun; - while (previousRun->next() != toReplace) - previousRun = previousRun->next(); - ASSERT(previousRun); - previousRun->setNext(newRuns.firstRun()); - } - - newRuns.lastRun()->setNext(toReplace->next()); - - // Fix up any of other pointers which may now be stale. - if (m_lastRun == toReplace) - m_lastRun = newRuns.lastRun(); - if (m_logicallyLastRun == toReplace) - m_logicallyLastRun = newRuns.logicallyLastRun(); - m_runCount += - newRuns.runCount() - 1; // We added the new runs and removed toReplace. - - delete toReplace; - newRuns.clearWithoutDestroyingRuns(); -} - -template -void BidiRunList::clearWithoutDestroyingRuns() { - m_firstRun = 0; - m_lastRun = 0; - m_logicallyLastRun = 0; - m_runCount = 0; -} - -template -void BidiRunList::deleteRuns() { - if (!m_firstRun) - return; - - Run* curr = m_firstRun; - while (curr) { - Run* s = curr->next(); - delete curr; - curr = s; - } - - clearWithoutDestroyingRuns(); -} - -template -void BidiRunList::reverseRuns(unsigned start, unsigned end) { - ASSERT(m_runCount); - if (start >= end) - return; - - ASSERT(end < m_runCount); - - // Get the item before the start of the runs to reverse and put it in - // |beforeStart|. |curr| should point to the first run to reverse. - Run* curr = m_firstRun; - Run* beforeStart = 0; - unsigned i = 0; - while (i < start) { - i++; - beforeStart = curr; - curr = curr->next(); - } - - Run* startRun = curr; - while (i < end) { - i++; - curr = curr->next(); - } - Run* endRun = curr; - Run* afterEnd = curr->next(); - - i = start; - curr = startRun; - Run* newNext = afterEnd; - while (i <= end) { - // Do the reversal. - Run* next = curr->next(); - curr->m_next = newNext; - newNext = curr; - curr = next; - i++; - } - - // Now hook up beforeStart and afterEnd to the startRun and endRun. - if (beforeStart) - beforeStart->m_next = endRun; - else - m_firstRun = endRun; - - startRun->m_next = afterEnd; - if (!afterEnd) - m_lastRun = startRun; -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_BIDIRUNLIST_H_ diff --git a/sky/engine/platform/text/BidiTestHarness.h b/sky/engine/platform/text/BidiTestHarness.h deleted file mode 100644 index 1b14d28e4f4b7..0000000000000 --- a/sky/engine/platform/text/BidiTestHarness.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_BIDITESTHARNESS_H_ -#define SKY_ENGINE_PLATFORM_TEXT_BIDITESTHARNESS_H_ - -#include -#include -#include -#include -#include - -// FIXME: We don't have any business owning this code. We should try to -// upstream this to unicode.org if possible (for other implementations to use). -// Unicode.org provides a reference implmentation, including parser: -// http://www.unicode.org/Public/PROGRAMS/BidiReferenceC/6.3.0/source/brtest.c -// But it, like the other implementations I've found, is rather tied to -// the algorithms it is testing. This file seeks to only implement the parser -// bits. - -// Other C/C++ implementations of this parser: -// https://github.com/googlei18n/fribidi-vs-unicode/blob/master/test.c -// http://source.icu-project.org/repos/icu/icu/trunk/source/test/intltest/bidiconf.cpp -// Both of those are too tied to their respective projects to be use to Blink. - -// There are non-C implmentations to parse BidiTest.txt as well, including: -// https://github.com/twitter/twitter-cldr-rb/blob/master/spec/bidi/bidi_spec.rb - -// NOTE: None of this file is currently written to be thread-safe. - -namespace bidi_test { - -enum ParagraphDirection { - DirectionAutoLTR = 1, - DirectionLTR = 2, - DirectionRTL = 4, -}; -const int kMaxParagraphDirection = - DirectionAutoLTR | DirectionLTR | DirectionRTL; - -// For error printing: -std::string nameFromParagraphDirection(ParagraphDirection paragraphDirection) { - switch (paragraphDirection) { - case bidi_test::DirectionAutoLTR: - return "Auto-LTR"; - case bidi_test::DirectionLTR: - return "LTR"; - case bidi_test::DirectionRTL: - return "RTL"; - } - // This should never be reached. - return ""; -} - -template -class Harness { - public: - Harness(Runner& runner) : m_runner(runner) {} - void parse(std::istream& bidiTestFile); - - private: - Runner& m_runner; -}; - -// We could use boost::trim, but no other part of Blink uses boost yet. -inline void ltrim(std::string& s) { - static const std::string separators(" \t"); - s.erase(0, s.find_first_not_of(separators)); -} - -inline void rtrim(std::string& s) { - static const std::string separators(" \t"); - size_t lastNonSpace = s.find_last_not_of(separators); - if (lastNonSpace == std::string::npos) { - s.erase(); - return; - } - size_t firstSpaceAtEndOfString = lastNonSpace + 1; - if (firstSpaceAtEndOfString >= s.size()) - return; // lastNonSpace was the last char. - s.erase(firstSpaceAtEndOfString, - std::string::npos); // erase to the end of the string. -} - -inline void trim(std::string& s) { - rtrim(s); - ltrim(s); -} - -static std::vector parseStringList(const std::string& str) { - std::vector strings; - static const std::string separators(" \t"); - size_t lastPos = str.find_first_not_of(separators); // skip leading spaces - size_t pos = str.find_first_of(separators, lastPos); // find next space - - while (std::string::npos != pos || std::string::npos != lastPos) { - strings.push_back(str.substr(lastPos, pos - lastPos)); - lastPos = str.find_first_not_of(separators, pos); - pos = str.find_first_of(separators, lastPos); - } - return strings; -} - -static std::vector parseIntList(const std::string& str) { - std::vector ints; - std::vector strings = parseStringList(str); - for (size_t x = 0; x < strings.size(); x++) { - int i = atoi(strings[x].c_str()); - ints.push_back(i); - } - return ints; -} - -static std::vector parseLevels(const std::string& line) { - std::vector levels; - std::vector strings = parseStringList(line); - for (size_t x = 0; x < strings.size(); x++) { - const std::string& levelString = strings[x]; - int i; - if (levelString == "x") - i = -1; - else - i = atoi(levelString.c_str()); - levels.push_back(i); - } - return levels; -} - -// This is not thread-safe as written. -static std::basic_string parseTestString(const std::string& line) { - std::basic_string testString; - static std::map charClassExamples; - if (charClassExamples.empty()) { - // FIXME: Explicit make_pair is ugly, but required for C++98 compat. - charClassExamples.insert(std::make_pair("L", 0x6c)); // 'l' for L - charClassExamples.insert(std::make_pair("R", 0x05D0)); // HEBREW ALEF - charClassExamples.insert(std::make_pair("EN", 0x33)); // '3' for EN - charClassExamples.insert(std::make_pair("ES", 0x2d)); // '-' for ES - charClassExamples.insert(std::make_pair("ET", 0x25)); // '%' for ET - charClassExamples.insert(std::make_pair("AN", 0x0660)); // arabic 0 - charClassExamples.insert(std::make_pair("CS", 0x2c)); // ',' for CS - charClassExamples.insert(std::make_pair("B", 0x0A)); // - charClassExamples.insert(std::make_pair("S", 0x09)); // - charClassExamples.insert(std::make_pair("WS", 0x20)); // ' ' for WS - charClassExamples.insert(std::make_pair("ON", 0x3d)); // '=' for ON - charClassExamples.insert( - std::make_pair("NSM", 0x05BF)); // HEBREW POINT RAFE - charClassExamples.insert(std::make_pair("AL", 0x0608)); // ARABIC RAY - charClassExamples.insert(std::make_pair("BN", 0x00AD)); // SOFT HYPHEN - charClassExamples.insert(std::make_pair("LRE", 0x202A)); - charClassExamples.insert(std::make_pair("RLE", 0x202B)); - charClassExamples.insert(std::make_pair("PDF", 0x202C)); - charClassExamples.insert(std::make_pair("LRO", 0x202D)); - charClassExamples.insert(std::make_pair("RLO", 0x202E)); - charClassExamples.insert(std::make_pair("LRI", 0x2066)); - charClassExamples.insert(std::make_pair("RLI", 0x2067)); - charClassExamples.insert(std::make_pair("FSI", 0x2068)); - charClassExamples.insert(std::make_pair("PDI", 0x2069)); - } - - std::vector charClasses = parseStringList(line); - for (size_t i = 0; i < charClasses.size(); i++) { - // FIXME: If the lookup failed we could return false for a parse error. - testString.push_back(charClassExamples.find(charClasses[i])->second); - } - return testString; -} - -static bool parseParagraphDirectionMask(const std::string& line, - int& modeMask) { - modeMask = atoi(line.c_str()); - return modeMask >= 1 && modeMask <= kMaxParagraphDirection; -} - -static void parseError(const std::string& line, size_t lineNumber) { - // Use printf to avoid the expense of std::cout. - printf("Parse error, line %zu : %s\n", lineNumber, line.c_str()); -} - -template -void Harness::parse(std::istream& bidiTestFile) { - static const std::string levelsPrefix("@Levels"); - static const std::string reorderPrefix("@Reorder"); - - // FIXME: UChar is an ICU type and cheating a bit to use here. - // uint16_t might be more portable. - std::basic_string testString; - std::vector levels; - std::vector reorder; - int paragraphDirectionMask; - - std::string line; - size_t lineNumber = 0; - while (std::getline(bidiTestFile, line)) { - lineNumber++; - const std::string originalLine = line; - size_t commentStart = line.find_first_of('#'); - if (commentStart != std::string::npos) - line = line.substr(0, commentStart); - trim(line); - if (line.empty()) - continue; - if (line[0] == '@') { - if (!line.find(levelsPrefix)) { - levels = parseLevels(line.substr(levelsPrefix.length() + 1)); - continue; - } - if (!line.find(reorderPrefix)) { - reorder = parseIntList(line.substr(reorderPrefix.length() + 1)); - continue; - } - } else { - // Assume it's a data line. - size_t seperatorIndex = line.find_first_of(';'); - if (seperatorIndex == std::string::npos) { - parseError(originalLine, lineNumber); - continue; - } - testString = parseTestString(line.substr(0, seperatorIndex)); - if (!parseParagraphDirectionMask(line.substr(seperatorIndex + 1), - paragraphDirectionMask)) { - parseError(originalLine, lineNumber); - continue; - } - - if (paragraphDirectionMask & DirectionAutoLTR) - m_runner.runTest(testString, reorder, levels, DirectionAutoLTR, - originalLine, lineNumber); - if (paragraphDirectionMask & DirectionLTR) - m_runner.runTest(testString, reorder, levels, DirectionLTR, - originalLine, lineNumber); - if (paragraphDirectionMask & DirectionRTL) - m_runner.runTest(testString, reorder, levels, DirectionRTL, - originalLine, lineNumber); - } - } -} - -} // namespace bidi_test - -#endif // SKY_ENGINE_PLATFORM_TEXT_BIDITESTHARNESS_H_ diff --git a/sky/engine/platform/text/BidiTextRun.cpp b/sky/engine/platform/text/BidiTextRun.cpp deleted file mode 100644 index 09ea083e1502f..0000000000000 --- a/sky/engine/platform/text/BidiTextRun.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/text/BidiTextRun.h" - -#include "flutter/sky/engine/platform/text/BidiResolver.h" -#include "flutter/sky/engine/platform/text/TextRunIterator.h" - -namespace blink { - -TextDirection directionForRun(TextRun& run, bool& hasStrongDirectionality) { - BidiResolver bidiResolver; - bidiResolver.setStatus( - BidiStatus(run.direction(), run.directionalOverride())); - bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0)); - return bidiResolver.determineParagraphDirectionality( - &hasStrongDirectionality); -} - -TextDirection determineDirectionality(const String& value, - bool& hasStrongDirectionality) { - TextRun run(value); - return directionForRun(run, hasStrongDirectionality); -} - -TextRun textRunWithDirectionality(const String& value, - bool& hasStrongDirectionality) { - TextRun run(value); - TextDirection direction = directionForRun(run, hasStrongDirectionality); - if (hasStrongDirectionality) - run.setDirection(direction); - return run; -} - -} // namespace blink diff --git a/sky/engine/platform/text/BidiTextRun.h b/sky/engine/platform/text/BidiTextRun.h deleted file mode 100644 index 5e4523ecef132..0000000000000 --- a/sky/engine/platform/text/BidiTextRun.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_BIDITEXTRUN_H_ -#define SKY_ENGINE_PLATFORM_TEXT_BIDITEXTRUN_H_ - -#include "flutter/sky/engine/platform/text/TextDirection.h" -#include "flutter/sky/engine/platform/text/TextRun.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -PLATFORM_EXPORT TextDirection directionForRun(TextRun&, - bool& hasStrongDirectionality); -PLATFORM_EXPORT TextDirection -determineDirectionality(const String& value, bool& hasStrongDirectionality); -PLATFORM_EXPORT TextRun -textRunWithDirectionality(const String& value, bool& hasStrongDirectionality); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_BIDITEXTRUN_H_ diff --git a/sky/engine/platform/text/ICUError.cpp b/sky/engine/platform/text/ICUError.cpp deleted file mode 100644 index 9d9b7c79c8a42..0000000000000 --- a/sky/engine/platform/text/ICUError.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/sky/engine/platform/text/ICUError.h" - -#include "base/allocator/partition_allocator/oom.h" - -namespace blink { - -// Distinguish memory allocation failures from other errors. -// https://groups.google.com/a/chromium.org/d/msg/platform-architecture-dev/MP0k9WGnCjA/zIBiJtilBwAJ -static NEVER_INLINE void ICUOutOfMemory() { - OOM_CRASH(); -} - -void ICUError::HandleFailure() { - switch (error_) { - case U_MEMORY_ALLOCATION_ERROR: - ICUOutOfMemory(); - break; - case U_ILLEGAL_ARGUMENT_ERROR: - CHECK(false) << error_; - break; - default: - break; - } -} - -} // namespace blink diff --git a/sky/engine/platform/text/ICUError.h b/sky/engine/platform/text/ICUError.h deleted file mode 100644 index 23d2865284a50..0000000000000 --- a/sky/engine/platform/text/ICUError.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2016 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. - -#ifndef ICUError_h -#define ICUError_h - -#include -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Allocator.h" -#include "flutter/sky/engine/wtf/Assertions.h" - -namespace blink { - -// ICUError provides the unified way to handle ICU errors in Blink. -class PLATFORM_EXPORT ICUError { - STACK_ALLOCATED(); - - public: - ~ICUError() { CrashIfCritical(); } - - UErrorCode* operator&() { return &error_; } - operator UErrorCode() const { return error_; } - operator UErrorCode&() { return error_; } - - void operator=(UErrorCode error) { error_ = error; } - - // Crash the renderer in the appropriate way if critical failure occurred. - void CrashIfCritical(); - - private: - UErrorCode error_ = U_ZERO_ERROR; - - void HandleFailure(); -}; - -inline void ICUError::CrashIfCritical() { - if (U_FAILURE(error_)) - HandleFailure(); -} - -} // namespace blink - -#endif // ICUError_h diff --git a/sky/engine/platform/text/LineEnding.cpp b/sky/engine/platform/text/LineEnding.cpp deleted file mode 100644 index 13f8d8a22a4ca..0000000000000 --- a/sky/engine/platform/text/LineEnding.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/text/LineEnding.h" - -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace { - -class OutputBuffer { - public: - virtual char* allocate(size_t) = 0; - virtual void copy(const CString&) = 0; - virtual ~OutputBuffer() {} -}; - -class CStringBuffer final : public OutputBuffer { - public: - CStringBuffer(CString& buffer) : m_buffer(buffer) {} - ~CStringBuffer() override {} - - char* allocate(size_t size) override { - char* ptr; - m_buffer = CString::newUninitialized(size, ptr); - return ptr; - } - - void copy(const CString& source) override { m_buffer = source; } - - const CString& buffer() const { return m_buffer; } - - private: - CString m_buffer; -}; - -class VectorCharAppendBuffer final : public OutputBuffer { - public: - VectorCharAppendBuffer(Vector& buffer) : m_buffer(buffer) {} - ~VectorCharAppendBuffer() override {} - - char* allocate(size_t size) override { - size_t oldSize = m_buffer.size(); - m_buffer.grow(oldSize + size); - return m_buffer.data() + oldSize; - } - - void copy(const CString& source) override { - m_buffer.append(source.data(), source.length()); - } - - private: - Vector& m_buffer; -}; - -void internalNormalizeLineEndingsToCRLF(const CString& from, - OutputBuffer& buffer) { - // Compute the new length. - size_t newLen = 0; - const char* p = from.data(); - while (p < from.data() + from.length()) { - char c = *p++; - if (c == '\r') { - // Safe to look ahead because of trailing '\0'. - if (*p != '\n') { - // Turn CR into CRLF. - newLen += 2; - } - } else if (c == '\n') { - // Turn LF into CRLF. - newLen += 2; - } else { - // Leave other characters alone. - newLen += 1; - } - } - if (newLen < from.length()) - return; - - if (newLen == from.length()) { - buffer.copy(from); - return; - } - - p = from.data(); - char* q = buffer.allocate(newLen); - - // Make a copy of the string. - while (p < from.data() + from.length()) { - char c = *p++; - if (c == '\r') { - // Safe to look ahead because of trailing '\0'. - if (*p != '\n') { - // Turn CR into CRLF. - *q++ = '\r'; - *q++ = '\n'; - } - } else if (c == '\n') { - // Turn LF into CRLF. - *q++ = '\r'; - *q++ = '\n'; - } else { - // Leave other characters alone. - *q++ = c; - } - } -} - -}; // namespace - -namespace blink { - -void normalizeToCROrLF(const CString& from, Vector& result, bool toCR); - -// Normalize all line-endings to CR or LF. -void normalizeToCROrLF(const CString& from, Vector& result, bool toCR) { - // Compute the new length. - size_t newLen = 0; - bool needFix = false; - const char* p = from.data(); - char fromEndingChar = toCR ? '\n' : '\r'; - char toEndingChar = toCR ? '\r' : '\n'; - while (p < from.data() + from.length()) { - char c = *p++; - if (c == '\r' && *p == '\n') { - // Turn CRLF into CR or LF. - p++; - needFix = true; - } else if (c == fromEndingChar) { - // Turn CR/LF into LF/CR. - needFix = true; - } - newLen += 1; - } - - // Grow the result buffer. - p = from.data(); - size_t oldResultSize = result.size(); - result.grow(oldResultSize + newLen); - char* q = result.data() + oldResultSize; - - // If no need to fix the string, just copy the string over. - if (!needFix) { - memcpy(q, p, from.length()); - return; - } - - // Make a copy of the string. - while (p < from.data() + from.length()) { - char c = *p++; - if (c == '\r' && *p == '\n') { - // Turn CRLF or CR into CR or LF. - p++; - *q++ = toEndingChar; - } else if (c == fromEndingChar) { - // Turn CR/LF into LF/CR. - *q++ = toEndingChar; - } else { - // Leave other characters alone. - *q++ = c; - } - } -} - -CString normalizeLineEndingsToCRLF(const CString& from) { - if (!from.length()) - return from; - CString result; - CStringBuffer buffer(result); - internalNormalizeLineEndingsToCRLF(from, buffer); - return buffer.buffer(); -} - -void normalizeLineEndingsToCR(const CString& from, Vector& result) { - normalizeToCROrLF(from, result, true); -} - -void normalizeLineEndingsToLF(const CString& from, Vector& result) { - normalizeToCROrLF(from, result, false); -} - -void normalizeLineEndingsToNative(const CString& from, Vector& result) { - normalizeLineEndingsToLF(from, result); -} - -} // namespace blink diff --git a/sky/engine/platform/text/LineEnding.h b/sky/engine/platform/text/LineEnding.h deleted file mode 100644 index 8b3430b9d7bd5..0000000000000 --- a/sky/engine/platform/text/LineEnding.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_LINEENDING_H_ -#define SKY_ENGINE_PLATFORM_TEXT_LINEENDING_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -// Normalize all line-endings in the given string to CRLF. -PLATFORM_EXPORT CString normalizeLineEndingsToCRLF(const CString& from); - -// Normalize all line-endings in the given string to CR and append the result to -// the given buffer. -PLATFORM_EXPORT void normalizeLineEndingsToCR(const CString& from, - Vector& result); - -// Normalize all line-endings in the given string to LF and append the result to -// the given buffer. -PLATFORM_EXPORT void normalizeLineEndingsToLF(const CString& from, - Vector& result); - -// Normalize all line-endings in the given string to the native line-endings and -// append the result to the given buffer. (Normalize to CRLF on Windows and -// normalize to LF on all other platforms.) -PLATFORM_EXPORT void normalizeLineEndingsToNative(const CString& from, - Vector& result); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_LINEENDING_H_ diff --git a/sky/engine/platform/text/LocaleToScriptMapping.cpp b/sky/engine/platform/text/LocaleToScriptMapping.cpp deleted file mode 100644 index b17a9c1e606d1..0000000000000 --- a/sky/engine/platform/text/LocaleToScriptMapping.cpp +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/text/LocaleToScriptMapping.h" - -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" - -namespace blink { - -UScriptCode scriptNameToCode(const String& scriptName) { - struct ScriptNameCode { - const char* name; - UScriptCode code; - }; - - // This generally maps an ISO 15924 script code to its UScriptCode, but - // certain families of script codes are treated as a single script for - // assigning a per-script font in Settings. For example, "hira" is mapped to - // USCRIPT_KATAKANA_OR_HIRAGANA instead of USCRIPT_HIRAGANA, since we want all - // Japanese scripts to be rendered using the same font setting. - static const ScriptNameCode scriptNameCodeList[] = { - {"zyyy", USCRIPT_COMMON}, - {"qaai", USCRIPT_INHERITED}, - {"arab", USCRIPT_ARABIC}, - {"armn", USCRIPT_ARMENIAN}, - {"beng", USCRIPT_BENGALI}, - {"bopo", USCRIPT_BOPOMOFO}, - {"cher", USCRIPT_CHEROKEE}, - {"copt", USCRIPT_COPTIC}, - {"cyrl", USCRIPT_CYRILLIC}, - {"dsrt", USCRIPT_DESERET}, - {"deva", USCRIPT_DEVANAGARI}, - {"ethi", USCRIPT_ETHIOPIC}, - {"geor", USCRIPT_GEORGIAN}, - {"goth", USCRIPT_GOTHIC}, - {"grek", USCRIPT_GREEK}, - {"gujr", USCRIPT_GUJARATI}, - {"guru", USCRIPT_GURMUKHI}, - {"hani", USCRIPT_HAN}, - {"hang", USCRIPT_HANGUL}, - {"hebr", USCRIPT_HEBREW}, - {"hira", USCRIPT_KATAKANA_OR_HIRAGANA}, - {"knda", USCRIPT_KANNADA}, - {"kana", USCRIPT_KATAKANA_OR_HIRAGANA}, - {"khmr", USCRIPT_KHMER}, - {"laoo", USCRIPT_LAO}, - {"latn", USCRIPT_LATIN}, - {"mlym", USCRIPT_MALAYALAM}, - {"mong", USCRIPT_MONGOLIAN}, - {"mymr", USCRIPT_MYANMAR}, - {"ogam", USCRIPT_OGHAM}, - {"ital", USCRIPT_OLD_ITALIC}, - {"orya", USCRIPT_ORIYA}, - {"runr", USCRIPT_RUNIC}, - {"sinh", USCRIPT_SINHALA}, - {"syrc", USCRIPT_SYRIAC}, - {"taml", USCRIPT_TAMIL}, - {"telu", USCRIPT_TELUGU}, - {"thaa", USCRIPT_THAANA}, - {"thai", USCRIPT_THAI}, - {"tibt", USCRIPT_TIBETAN}, - {"cans", USCRIPT_CANADIAN_ABORIGINAL}, - {"yiii", USCRIPT_YI}, - {"tglg", USCRIPT_TAGALOG}, - {"hano", USCRIPT_HANUNOO}, - {"buhd", USCRIPT_BUHID}, - {"tagb", USCRIPT_TAGBANWA}, - {"brai", USCRIPT_BRAILLE}, - {"cprt", USCRIPT_CYPRIOT}, - {"limb", USCRIPT_LIMBU}, - {"linb", USCRIPT_LINEAR_B}, - {"osma", USCRIPT_OSMANYA}, - {"shaw", USCRIPT_SHAVIAN}, - {"tale", USCRIPT_TAI_LE}, - {"ugar", USCRIPT_UGARITIC}, - {"hrkt", USCRIPT_KATAKANA_OR_HIRAGANA}, - {"bugi", USCRIPT_BUGINESE}, - {"glag", USCRIPT_GLAGOLITIC}, - {"khar", USCRIPT_KHAROSHTHI}, - {"sylo", USCRIPT_SYLOTI_NAGRI}, - {"talu", USCRIPT_NEW_TAI_LUE}, - {"tfng", USCRIPT_TIFINAGH}, - {"xpeo", USCRIPT_OLD_PERSIAN}, - {"bali", USCRIPT_BALINESE}, - {"batk", USCRIPT_BATAK}, - {"blis", USCRIPT_BLISSYMBOLS}, - {"brah", USCRIPT_BRAHMI}, - {"cham", USCRIPT_CHAM}, - {"cirt", USCRIPT_CIRTH}, - {"cyrs", USCRIPT_OLD_CHURCH_SLAVONIC_CYRILLIC}, - {"egyd", USCRIPT_DEMOTIC_EGYPTIAN}, - {"egyh", USCRIPT_HIERATIC_EGYPTIAN}, - {"egyp", USCRIPT_EGYPTIAN_HIEROGLYPHS}, - {"geok", USCRIPT_KHUTSURI}, - {"hans", USCRIPT_SIMPLIFIED_HAN}, - {"hant", USCRIPT_TRADITIONAL_HAN}, - {"hmng", USCRIPT_PAHAWH_HMONG}, - {"hung", USCRIPT_OLD_HUNGARIAN}, - {"inds", USCRIPT_HARAPPAN_INDUS}, - {"java", USCRIPT_JAVANESE}, - {"kali", USCRIPT_KAYAH_LI}, - {"latf", USCRIPT_LATIN_FRAKTUR}, - {"latg", USCRIPT_LATIN_GAELIC}, - {"lepc", USCRIPT_LEPCHA}, - {"lina", USCRIPT_LINEAR_A}, - {"mand", USCRIPT_MANDAEAN}, - {"maya", USCRIPT_MAYAN_HIEROGLYPHS}, - {"mero", USCRIPT_MEROITIC}, - {"nkoo", USCRIPT_NKO}, - {"orkh", USCRIPT_ORKHON}, - {"perm", USCRIPT_OLD_PERMIC}, - {"phag", USCRIPT_PHAGS_PA}, - {"phnx", USCRIPT_PHOENICIAN}, - {"plrd", USCRIPT_PHONETIC_POLLARD}, - {"roro", USCRIPT_RONGORONGO}, - {"sara", USCRIPT_SARATI}, - {"syre", USCRIPT_ESTRANGELO_SYRIAC}, - {"syrj", USCRIPT_WESTERN_SYRIAC}, - {"syrn", USCRIPT_EASTERN_SYRIAC}, - {"teng", USCRIPT_TENGWAR}, - {"vaii", USCRIPT_VAI}, - {"visp", USCRIPT_VISIBLE_SPEECH}, - {"xsux", USCRIPT_CUNEIFORM}, - {"jpan", USCRIPT_KATAKANA_OR_HIRAGANA}, - {"kore", USCRIPT_HANGUL}, - {"zxxx", USCRIPT_UNWRITTEN_LANGUAGES}, - {"zzzz", USCRIPT_UNKNOWN}}; - - typedef HashMap ScriptNameCodeMap; - DEFINE_STATIC_LOCAL(ScriptNameCodeMap, scriptNameCodeMap, ()); - if (scriptNameCodeMap.isEmpty()) { - for (size_t i = 0; - i < sizeof(scriptNameCodeList) / sizeof(scriptNameCodeList[0]); ++i) - scriptNameCodeMap.set(scriptNameCodeList[i].name, - scriptNameCodeList[i].code); - } - - HashMap::iterator it = - scriptNameCodeMap.find(scriptName.lower()); - if (it != scriptNameCodeMap.end()) - return it->value; - return USCRIPT_INVALID_CODE; -} - -UScriptCode localeToScriptCodeForFontSelection(const String& locale) { - struct LocaleScript { - const char* locale; - UScriptCode script; - }; - - static const LocaleScript localeScriptList[] = { - {"aa", USCRIPT_LATIN}, - {"ab", USCRIPT_CYRILLIC}, - {"ady", USCRIPT_CYRILLIC}, - {"af", USCRIPT_LATIN}, - {"ak", USCRIPT_LATIN}, - {"am", USCRIPT_ETHIOPIC}, - {"ar", USCRIPT_ARABIC}, - {"as", USCRIPT_BENGALI}, - {"ast", USCRIPT_LATIN}, - {"av", USCRIPT_CYRILLIC}, - {"ay", USCRIPT_LATIN}, - {"az", USCRIPT_LATIN}, - {"ba", USCRIPT_CYRILLIC}, - {"be", USCRIPT_CYRILLIC}, - {"bg", USCRIPT_CYRILLIC}, - {"bi", USCRIPT_LATIN}, - {"bn", USCRIPT_BENGALI}, - {"bo", USCRIPT_TIBETAN}, - {"bs", USCRIPT_LATIN}, - {"ca", USCRIPT_LATIN}, - {"ce", USCRIPT_CYRILLIC}, - {"ceb", USCRIPT_LATIN}, - {"ch", USCRIPT_LATIN}, - {"chk", USCRIPT_LATIN}, - {"cs", USCRIPT_LATIN}, - {"cy", USCRIPT_LATIN}, - {"da", USCRIPT_LATIN}, - {"de", USCRIPT_LATIN}, - {"dv", USCRIPT_THAANA}, - {"dz", USCRIPT_TIBETAN}, - {"ee", USCRIPT_LATIN}, - {"efi", USCRIPT_LATIN}, - {"el", USCRIPT_GREEK}, - {"en", USCRIPT_LATIN}, - {"es", USCRIPT_LATIN}, - {"et", USCRIPT_LATIN}, - {"eu", USCRIPT_LATIN}, - {"fa", USCRIPT_ARABIC}, - {"fi", USCRIPT_LATIN}, - {"fil", USCRIPT_LATIN}, - {"fj", USCRIPT_LATIN}, - {"fo", USCRIPT_LATIN}, - {"fr", USCRIPT_LATIN}, - {"fur", USCRIPT_LATIN}, - {"fy", USCRIPT_LATIN}, - {"ga", USCRIPT_LATIN}, - {"gaa", USCRIPT_LATIN}, - {"gd", USCRIPT_LATIN}, - {"gil", USCRIPT_LATIN}, - {"gl", USCRIPT_LATIN}, - {"gn", USCRIPT_LATIN}, - {"gsw", USCRIPT_LATIN}, - {"gu", USCRIPT_GUJARATI}, - {"ha", USCRIPT_LATIN}, - {"haw", USCRIPT_LATIN}, - {"he", USCRIPT_HEBREW}, - {"hi", USCRIPT_DEVANAGARI}, - {"hil", USCRIPT_LATIN}, - {"ho", USCRIPT_LATIN}, - {"hr", USCRIPT_LATIN}, - {"ht", USCRIPT_LATIN}, - {"hu", USCRIPT_LATIN}, - {"hy", USCRIPT_ARMENIAN}, - {"id", USCRIPT_LATIN}, - {"ig", USCRIPT_LATIN}, - {"ii", USCRIPT_YI}, - {"ilo", USCRIPT_LATIN}, - {"inh", USCRIPT_CYRILLIC}, - {"is", USCRIPT_LATIN}, - {"it", USCRIPT_LATIN}, - {"iu", USCRIPT_CANADIAN_ABORIGINAL}, - {"ja", USCRIPT_KATAKANA_OR_HIRAGANA}, - {"jv", USCRIPT_LATIN}, - {"ka", USCRIPT_GEORGIAN}, - {"kaj", USCRIPT_LATIN}, - {"kam", USCRIPT_LATIN}, - {"kbd", USCRIPT_CYRILLIC}, - {"kha", USCRIPT_LATIN}, - {"kk", USCRIPT_CYRILLIC}, - {"kl", USCRIPT_LATIN}, - {"km", USCRIPT_KHMER}, - {"kn", USCRIPT_KANNADA}, - {"ko", USCRIPT_HANGUL}, - {"kok", USCRIPT_DEVANAGARI}, - {"kos", USCRIPT_LATIN}, - {"kpe", USCRIPT_LATIN}, - {"krc", USCRIPT_CYRILLIC}, - {"ks", USCRIPT_ARABIC}, - {"ku", USCRIPT_ARABIC}, - {"kum", USCRIPT_CYRILLIC}, - {"ky", USCRIPT_CYRILLIC}, - {"la", USCRIPT_LATIN}, - {"lah", USCRIPT_ARABIC}, - {"lb", USCRIPT_LATIN}, - {"lez", USCRIPT_CYRILLIC}, - {"ln", USCRIPT_LATIN}, - {"lo", USCRIPT_LAO}, - {"lt", USCRIPT_LATIN}, - {"lv", USCRIPT_LATIN}, - {"mai", USCRIPT_DEVANAGARI}, - {"mdf", USCRIPT_CYRILLIC}, - {"mg", USCRIPT_LATIN}, - {"mh", USCRIPT_LATIN}, - {"mi", USCRIPT_LATIN}, - {"mk", USCRIPT_CYRILLIC}, - {"ml", USCRIPT_MALAYALAM}, - {"mn", USCRIPT_CYRILLIC}, - {"mr", USCRIPT_DEVANAGARI}, - {"ms", USCRIPT_LATIN}, - {"mt", USCRIPT_LATIN}, - {"my", USCRIPT_MYANMAR}, - {"myv", USCRIPT_CYRILLIC}, - {"na", USCRIPT_LATIN}, - {"nb", USCRIPT_LATIN}, - {"ne", USCRIPT_DEVANAGARI}, - {"niu", USCRIPT_LATIN}, - {"nl", USCRIPT_LATIN}, - {"nn", USCRIPT_LATIN}, - {"nr", USCRIPT_LATIN}, - {"nso", USCRIPT_LATIN}, - {"ny", USCRIPT_LATIN}, - {"oc", USCRIPT_LATIN}, - {"om", USCRIPT_LATIN}, - {"or", USCRIPT_ORIYA}, - {"os", USCRIPT_CYRILLIC}, - {"pa", USCRIPT_GURMUKHI}, - {"pag", USCRIPT_LATIN}, - {"pap", USCRIPT_LATIN}, - {"pau", USCRIPT_LATIN}, - {"pl", USCRIPT_LATIN}, - {"pon", USCRIPT_LATIN}, - {"ps", USCRIPT_ARABIC}, - {"pt", USCRIPT_LATIN}, - {"qu", USCRIPT_LATIN}, - {"rm", USCRIPT_LATIN}, - {"rn", USCRIPT_LATIN}, - {"ro", USCRIPT_LATIN}, - {"ru", USCRIPT_CYRILLIC}, - {"rw", USCRIPT_LATIN}, - {"sa", USCRIPT_DEVANAGARI}, - {"sah", USCRIPT_CYRILLIC}, - {"sat", USCRIPT_LATIN}, - {"sd", USCRIPT_ARABIC}, - {"se", USCRIPT_LATIN}, - {"sg", USCRIPT_LATIN}, - {"si", USCRIPT_SINHALA}, - {"sid", USCRIPT_LATIN}, - {"sk", USCRIPT_LATIN}, - {"sl", USCRIPT_LATIN}, - {"sm", USCRIPT_LATIN}, - {"so", USCRIPT_LATIN}, - {"sq", USCRIPT_LATIN}, - {"sr", USCRIPT_CYRILLIC}, - {"ss", USCRIPT_LATIN}, - {"st", USCRIPT_LATIN}, - {"su", USCRIPT_LATIN}, - {"sv", USCRIPT_LATIN}, - {"sw", USCRIPT_LATIN}, - {"ta", USCRIPT_TAMIL}, - {"te", USCRIPT_TELUGU}, - {"tet", USCRIPT_LATIN}, - {"tg", USCRIPT_CYRILLIC}, - {"th", USCRIPT_THAI}, - {"ti", USCRIPT_ETHIOPIC}, - {"tig", USCRIPT_ETHIOPIC}, - {"tk", USCRIPT_LATIN}, - {"tkl", USCRIPT_LATIN}, - {"tl", USCRIPT_LATIN}, - {"tn", USCRIPT_LATIN}, - {"to", USCRIPT_LATIN}, - {"tpi", USCRIPT_LATIN}, - {"tr", USCRIPT_LATIN}, - {"trv", USCRIPT_LATIN}, - {"ts", USCRIPT_LATIN}, - {"tt", USCRIPT_CYRILLIC}, - {"tvl", USCRIPT_LATIN}, - {"tw", USCRIPT_LATIN}, - {"ty", USCRIPT_LATIN}, - {"tyv", USCRIPT_CYRILLIC}, - {"udm", USCRIPT_CYRILLIC}, - {"ug", USCRIPT_ARABIC}, - {"uk", USCRIPT_CYRILLIC}, - {"und", USCRIPT_LATIN}, - {"ur", USCRIPT_ARABIC}, - {"uz", USCRIPT_CYRILLIC}, - {"ve", USCRIPT_LATIN}, - {"vi", USCRIPT_LATIN}, - {"wal", USCRIPT_ETHIOPIC}, - {"war", USCRIPT_LATIN}, - {"wo", USCRIPT_LATIN}, - {"xh", USCRIPT_LATIN}, - {"yap", USCRIPT_LATIN}, - {"yo", USCRIPT_LATIN}, - {"za", USCRIPT_LATIN}, - {"zh", USCRIPT_SIMPLIFIED_HAN}, - {"zh_hk", USCRIPT_TRADITIONAL_HAN}, - {"zh_tw", USCRIPT_TRADITIONAL_HAN}, - {"zu", USCRIPT_LATIN}}; - - typedef HashMap LocaleScriptMap; - DEFINE_STATIC_LOCAL(LocaleScriptMap, localeScriptMap, ()); - if (localeScriptMap.isEmpty()) { - for (size_t i = 0; - i < sizeof(localeScriptList) / sizeof(localeScriptList[0]); ++i) - localeScriptMap.set(localeScriptList[i].locale, - localeScriptList[i].script); - } - - String canonicalLocale = locale.lower().replace('-', '_'); - while (!canonicalLocale.isEmpty()) { - HashMap::iterator it = - localeScriptMap.find(canonicalLocale); - if (it != localeScriptMap.end()) - return it->value; - size_t pos = canonicalLocale.reverseFind('_'); - if (pos == kNotFound) - break; - UScriptCode code = scriptNameToCode(canonicalLocale.substring(pos + 1)); - if (code != USCRIPT_INVALID_CODE && code != USCRIPT_UNKNOWN) - return code; - canonicalLocale = canonicalLocale.substring(0, pos); - } - return USCRIPT_COMMON; -} - -} // namespace blink diff --git a/sky/engine/platform/text/LocaleToScriptMapping.h b/sky/engine/platform/text/LocaleToScriptMapping.h deleted file mode 100644 index a8ff55367d056..0000000000000 --- a/sky/engine/platform/text/LocaleToScriptMapping.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_LOCALETOSCRIPTMAPPING_H_ -#define SKY_ENGINE_PLATFORM_TEXT_LOCALETOSCRIPTMAPPING_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -#include - -namespace blink { - -PLATFORM_EXPORT UScriptCode localeToScriptCodeForFontSelection(const String&); -PLATFORM_EXPORT UScriptCode scriptNameToCode(const String&); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_LOCALETOSCRIPTMAPPING_H_ diff --git a/sky/engine/platform/text/NonCJKGlyphOrientation.h b/sky/engine/platform/text/NonCJKGlyphOrientation.h deleted file mode 100644 index 0181c9fa1e1c4..0000000000000 --- a/sky/engine/platform/text/NonCJKGlyphOrientation.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_NONCJKGLYPHORIENTATION_H_ -#define SKY_ENGINE_PLATFORM_TEXT_NONCJKGLYPHORIENTATION_H_ - -namespace blink { - -enum NonCJKGlyphOrientation { - NonCJKGlyphOrientationVerticalRight, - NonCJKGlyphOrientationUpright -}; -} - -#endif // SKY_ENGINE_PLATFORM_TEXT_NONCJKGLYPHORIENTATION_H_ diff --git a/sky/engine/platform/text/SurrogatePairAwareTextIterator.cpp b/sky/engine/platform/text/SurrogatePairAwareTextIterator.cpp deleted file mode 100644 index 18f03ccb498d4..0000000000000 --- a/sky/engine/platform/text/SurrogatePairAwareTextIterator.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2011 Apple Inc. - * All rights reserved. - * Copyright (C) 2008 Holger Hans Peter Freyther - * Copyright (C) Research In Motion Limited 2011. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/text/SurrogatePairAwareTextIterator.h" - -#include - -using namespace WTF; -using namespace Unicode; - -namespace blink { - -SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator( - const UChar* characters, - int currentCharacter, - int lastCharacter, - int endCharacter) - : m_characters(characters), - m_currentCharacter(currentCharacter), - m_lastCharacter(lastCharacter), - m_endCharacter(endCharacter) {} - -bool SurrogatePairAwareTextIterator::consumeSlowCase(UChar32& character, - unsigned& clusterLength) { - if (character <= 0x30FE) { - // Deal with Hiragana and Katakana voiced and semi-voiced syllables. - // Normalize into composed form, and then look for glyph with base + - // combined mark. Check above for character range to minimize performance - // impact. - if (UChar32 normalized = normalizeVoicingMarks()) { - character = normalized; - clusterLength = 2; - } - return true; - } - - if (!U16_IS_SURROGATE(character)) - return true; - - // If we have a surrogate pair, make sure it starts with the high part. - if (!U16_IS_SURROGATE_LEAD(character)) - return false; - - // Do we have a surrogate pair? If so, determine the full Unicode (32 bit) - // code point before glyph lookup. Make sure we have another character and - // it's a low surrogate. - if (m_currentCharacter + 1 >= m_endCharacter) - return false; - - UChar low = m_characters[1]; - if (!U16_IS_TRAIL(low)) - return false; - - character = U16_GET_SUPPLEMENTARY(character, low); - clusterLength = 2; - return true; -} - -UChar32 SurrogatePairAwareTextIterator::normalizeVoicingMarks() { - // According to - // http://www.unicode.org/Public/UNIDATA/UCD.html#Canonical_Combining_Class_Values - static const uint8_t hiraganaKatakanaVoicingMarksCombiningClass = 8; - - if (m_currentCharacter + 1 >= m_endCharacter) - return 0; - - if (combiningClass(m_characters[1]) == - hiraganaKatakanaVoicingMarksCombiningClass) { - // Normalize into composed form using 3.2 rules. - UChar normalizedCharacters[2] = {0, 0}; - UErrorCode uStatus = U_ZERO_ERROR; - int32_t resultLength = - unorm_normalize(m_characters, 2, UNORM_NFC, UNORM_UNICODE_3_2, - &normalizedCharacters[0], 2, &uStatus); - if (resultLength == 1 && !uStatus) - return normalizedCharacters[0]; - } - - return 0; -} - -} // namespace blink diff --git a/sky/engine/platform/text/SurrogatePairAwareTextIterator.h b/sky/engine/platform/text/SurrogatePairAwareTextIterator.h deleted file mode 100644 index 0d666e882a0a5..0000000000000 --- a/sky/engine/platform/text/SurrogatePairAwareTextIterator.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) Research In Motion Limited 2011. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_SURROGATEPAIRAWARETEXTITERATOR_H_ -#define SKY_ENGINE_PLATFORM_TEXT_SURROGATEPAIRAWARETEXTITERATOR_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -namespace blink { - -class PLATFORM_EXPORT SurrogatePairAwareTextIterator { - public: - // The passed in UChar pointer starts at 'currentCharacter'. The iterator - // operatoes on the range [currentCharacter, lastCharacter]. 'endCharacter' - // denotes the maximum length of the UChar array, which might exceed - // 'lastCharacter'. - SurrogatePairAwareTextIterator(const UChar*, - int currentCharacter, - int lastCharacter, - int endCharacter); - - inline bool consume(UChar32& character, unsigned& clusterLength) { - if (m_currentCharacter >= m_lastCharacter) - return false; - - character = *m_characters; - clusterLength = 1; - - if (character < HiraganaLetterSmallA) - return true; - - return consumeSlowCase(character, clusterLength); - } - - void advance(unsigned advanceLength) { - m_characters += advanceLength; - m_currentCharacter += advanceLength; - } - - int currentCharacter() const { return m_currentCharacter; } - const UChar* characters() const { return m_characters; } - - private: - bool consumeSlowCase(UChar32&, unsigned&); - UChar32 normalizeVoicingMarks(); - - const UChar* m_characters; - int m_currentCharacter; - int m_lastCharacter; - int m_endCharacter; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_SURROGATEPAIRAWARETEXTITERATOR_H_ diff --git a/sky/engine/platform/text/TextBoundaries.cpp b/sky/engine/platform/text/TextBoundaries.cpp deleted file mode 100644 index 0d37208c579d5..0000000000000 --- a/sky/engine/platform/text/TextBoundaries.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2009 Dominik Röttsches - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/text/TextBoundaries.h" - -#include "flutter/sky/engine/platform/text/TextBreakIterator.h" -#include "flutter/sky/engine/wtf/text/StringImpl.h" - -using namespace WTF; -using namespace Unicode; - -namespace blink { - -int endOfFirstWordBoundaryContext(const UChar* characters, int length) { - for (int i = 0; i < length;) { - int first = i; - UChar32 ch; - U16_NEXT(characters, i, length, ch); - if (!requiresContextForWordBoundary(ch)) - return first; - } - return length; -} - -int startOfLastWordBoundaryContext(const UChar* characters, int length) { - for (int i = length; i > 0;) { - int last = i; - UChar32 ch; - U16_PREV(characters, 0, i, ch); - if (!requiresContextForWordBoundary(ch)) - return last; - } - return 0; -} - -int findNextWordFromIndex(const UChar* chars, - int len, - int position, - bool forward) { - TextBreakIterator* it = wordBreakIterator(chars, len); - - if (forward) { - position = it->following(position); - while (position != TextBreakDone) { - // We stop searching when the character preceeding the break - // is alphanumeric. - if (position < len && isAlphanumeric(chars[position - 1])) - return position; - - position = it->following(position); - } - - return len; - } else { - position = it->preceding(position); - while (position != TextBreakDone) { - // We stop searching when the character following the break - // is alphanumeric. - if (position > 0 && isAlphanumeric(chars[position])) - return position; - - position = it->preceding(position); - } - - return 0; - } -} - -void findWordBoundary(const UChar* chars, - int len, - int position, - int* start, - int* end) { - TextBreakIterator* it = wordBreakIterator(chars, len); - *end = it->following(position); - if (*end < 0) - *end = it->last(); - *start = it->previous(); -} - -int findWordEndBoundary(const UChar* chars, int len, int position) { - TextBreakIterator* it = wordBreakIterator(chars, len); - int end = it->following(position); - return end < 0 ? it->last() : end; -} - -} // namespace blink diff --git a/sky/engine/platform/text/TextBoundaries.h b/sky/engine/platform/text/TextBoundaries.h deleted file mode 100644 index 23862175d92b2..0000000000000 --- a/sky/engine/platform/text/TextBoundaries.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTBOUNDARIES_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTBOUNDARIES_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -inline bool requiresContextForWordBoundary(UChar32 ch) { - return WTF::Unicode::hasLineBreakingPropertyComplexContext(ch); -} - -PLATFORM_EXPORT int endOfFirstWordBoundaryContext(const UChar* characters, - int length); -PLATFORM_EXPORT int startOfLastWordBoundaryContext(const UChar* characters, - int length); - -PLATFORM_EXPORT void findWordBoundary(const UChar*, - int len, - int position, - int* start, - int* end); -PLATFORM_EXPORT int findWordEndBoundary(const UChar*, int len, int position); -PLATFORM_EXPORT int findNextWordFromIndex(const UChar*, - int len, - int position, - bool forward); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTBOUNDARIES_H_ diff --git a/sky/engine/platform/text/TextBox.h b/sky/engine/platform/text/TextBox.h deleted file mode 100644 index b091a05097132..0000000000000 --- a/sky/engine/platform/text/TextBox.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 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. - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTBOX_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTBOX_H_ - -#include "flutter/sky/engine/platform/text/TextDirection.h" -#include "third_party/skia/include/core/SkRect.h" - -namespace blink { - -class TextBox { - public: - TextBox() : is_null(true) {} - TextBox(SkRect r, TextDirection direction) - : sk_rect(std::move(r)), direction(direction), is_null(false) {} - - SkRect sk_rect; - TextDirection direction; - bool is_null; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTBOX_H_ diff --git a/sky/engine/platform/text/TextBreakIterator.cpp b/sky/engine/platform/text/TextBreakIterator.cpp deleted file mode 100644 index 934346ecbf827..0000000000000 --- a/sky/engine/platform/text/TextBreakIterator.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * (C) 1999 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "flutter/sky/engine/platform/text/TextBreakIterator.h" - -namespace blink { - -unsigned numGraphemeClusters(const String& string) { - unsigned stringLength = string.length(); - - if (!stringLength) - return 0; - - // The only Latin-1 Extended Grapheme Cluster is CR LF - if (string.is8Bit() && !string.contains('\r')) - return stringLength; - - NonSharedCharacterBreakIterator it(string); - if (!it) - return stringLength; - - unsigned num = 0; - while (it.next() != TextBreakDone) - ++num; - return num; -} - -unsigned numCharactersInGraphemeClusters(const String& string, - unsigned numGraphemeClusters) { - unsigned stringLength = string.length(); - - if (!stringLength) - return 0; - - // The only Latin-1 Extended Grapheme Cluster is CR LF - if (string.is8Bit() && !string.contains('\r')) - return std::min(stringLength, numGraphemeClusters); - - NonSharedCharacterBreakIterator it(string); - if (!it) - return std::min(stringLength, numGraphemeClusters); - - for (unsigned i = 0; i < numGraphemeClusters; ++i) { - if (it.next() == TextBreakDone) - return stringLength; - } - return it.current(); -} - -} // namespace blink diff --git a/sky/engine/platform/text/TextBreakIterator.h b/sky/engine/platform/text/TextBreakIterator.h deleted file mode 100644 index 8fd01344239c4..0000000000000 --- a/sky/engine/platform/text/TextBreakIterator.h +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright (C) 2006 Lars Knoll - * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTBREAKITERATOR_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTBREAKITERATOR_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -#include - -namespace blink { - -typedef icu::BreakIterator TextBreakIterator; - -// Note: The returned iterator is good only until you get another iterator, with -// the exception of acquireLineBreakIterator. - -// This is similar to character break iterator in most cases, but is subject to -// platform UI conventions. One notable example where this can be different -// from character break iterator is Thai prepend characters, see bug 24342. -// Use this for insertion point and selection manipulations. -PLATFORM_EXPORT TextBreakIterator* cursorMovementIterator(const UChar*, - int length); - -PLATFORM_EXPORT TextBreakIterator* wordBreakIterator(const String&, - int start, - int length); -PLATFORM_EXPORT TextBreakIterator* wordBreakIterator(const UChar*, int length); -PLATFORM_EXPORT TextBreakIterator* acquireLineBreakIterator( - const LChar*, - int length, - const AtomicString& locale, - const UChar* priorContext, - unsigned priorContextLength); -PLATFORM_EXPORT TextBreakIterator* acquireLineBreakIterator( - const UChar*, - int length, - const AtomicString& locale, - const UChar* priorContext, - unsigned priorContextLength); -PLATFORM_EXPORT void releaseLineBreakIterator(TextBreakIterator*); -PLATFORM_EXPORT TextBreakIterator* sentenceBreakIterator(const UChar*, - int length); - -PLATFORM_EXPORT bool isWordTextBreak(TextBreakIterator*); - -const int TextBreakDone = -1; - -class PLATFORM_EXPORT LazyLineBreakIterator { - public: - LazyLineBreakIterator() - : m_iterator(0), m_cachedPriorContext(0), m_cachedPriorContextLength(0) { - resetPriorContext(); - } - - LazyLineBreakIterator(String string, - const AtomicString& locale = AtomicString()) - : m_string(string), - m_locale(locale), - m_iterator(0), - m_cachedPriorContext(0), - m_cachedPriorContextLength(0) { - resetPriorContext(); - } - - ~LazyLineBreakIterator() { - if (m_iterator) - releaseLineBreakIterator(m_iterator); - } - - String string() const { return m_string; } - - UChar lastCharacter() const { - COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, - TextBreakIterator_unexpected_prior_context_length); - return m_priorContext[1]; - } - - UChar secondToLastCharacter() const { - COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, - TextBreakIterator_unexpected_prior_context_length); - return m_priorContext[0]; - } - - void setPriorContext(UChar last, UChar secondToLast) { - COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, - TextBreakIterator_unexpected_prior_context_length); - m_priorContext[0] = secondToLast; - m_priorContext[1] = last; - } - - void updatePriorContext(UChar last) { - COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, - TextBreakIterator_unexpected_prior_context_length); - m_priorContext[0] = m_priorContext[1]; - m_priorContext[1] = last; - } - - void resetPriorContext() { - COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, - TextBreakIterator_unexpected_prior_context_length); - m_priorContext[0] = 0; - m_priorContext[1] = 0; - } - - unsigned priorContextLength() const { - unsigned priorContextLength = 0; - COMPILE_ASSERT(WTF_ARRAY_LENGTH(m_priorContext) == 2, - TextBreakIterator_unexpected_prior_context_length); - if (m_priorContext[1]) { - ++priorContextLength; - if (m_priorContext[0]) - ++priorContextLength; - } - return priorContextLength; - } - - // Obtain text break iterator, possibly previously cached, where this iterator - // is (or has been) initialized to use the previously stored string as the - // primary breaking context and using previously stored prior context if - // non-empty. - TextBreakIterator* get(unsigned priorContextLength) { - ASSERT(priorContextLength <= priorContextCapacity); - const UChar* priorContext = - priorContextLength - ? &m_priorContext[priorContextCapacity - priorContextLength] - : 0; - if (!m_iterator) { - if (m_string.is8Bit()) - m_iterator = acquireLineBreakIterator(m_string.characters8(), - m_string.length(), m_locale, - priorContext, priorContextLength); - else - m_iterator = acquireLineBreakIterator(m_string.characters16(), - m_string.length(), m_locale, - priorContext, priorContextLength); - m_cachedPriorContext = priorContext; - m_cachedPriorContextLength = priorContextLength; - } else if (priorContext != m_cachedPriorContext || - priorContextLength != m_cachedPriorContextLength) { - this->resetStringAndReleaseIterator(m_string, m_locale); - return this->get(priorContextLength); - } - return m_iterator; - } - - void resetStringAndReleaseIterator(String string, - const AtomicString& locale) { - if (m_iterator) - releaseLineBreakIterator(m_iterator); - - m_string = string; - m_locale = locale; - m_iterator = 0; - m_cachedPriorContext = 0; - m_cachedPriorContextLength = 0; - } - - private: - static const unsigned priorContextCapacity = 2; - String m_string; - AtomicString m_locale; - TextBreakIterator* m_iterator; - UChar m_priorContext[priorContextCapacity]; - const UChar* m_cachedPriorContext; - unsigned m_cachedPriorContextLength; -}; - -// Iterates over "extended grapheme clusters", as defined in UAX #29. -// Note that platform implementations may be less sophisticated - e.g. ICU prior -// to version 4.0 only supports "legacy grapheme clusters". Use this for general -// text processing, e.g. string truncation. - -class PLATFORM_EXPORT NonSharedCharacterBreakIterator { - WTF_MAKE_NONCOPYABLE(NonSharedCharacterBreakIterator); - - public: - explicit NonSharedCharacterBreakIterator(const String&); - NonSharedCharacterBreakIterator(const UChar*, unsigned length); - ~NonSharedCharacterBreakIterator(); - - int next(); - int current(); - - bool isBreak(int offset) const; - int preceding(int offset) const; - int following(int offset) const; - - bool operator!() const { return !m_is8Bit && !m_iterator; } - - private: - void createIteratorForBuffer(const UChar*, unsigned length); - - unsigned clusterLengthStartingAt(unsigned offset) const { - ASSERT(m_is8Bit); - // The only Latin-1 Extended Grapheme Cluster is CR LF - return isCRBeforeLF(offset) ? 2 : 1; - } - - bool isCRBeforeLF(unsigned offset) const { - ASSERT(m_is8Bit); - return m_charaters8[offset] == '\r' && offset + 1 < m_length && - m_charaters8[offset + 1] == '\n'; - } - - bool isLFAfterCR(unsigned offset) const { - ASSERT(m_is8Bit); - return m_charaters8[offset] == '\n' && offset >= 1 && - m_charaters8[offset - 1] == '\r'; - } - - bool m_is8Bit; - - // For 8 bit strings, we implement the iterator ourselves. - const LChar* m_charaters8; - unsigned m_offset; - unsigned m_length; - - // For 16 bit strings, we use a TextBreakIterator. - TextBreakIterator* m_iterator; -}; - -// Counts the number of grapheme clusters. A surrogate pair or a sequence -// of a non-combining character and following combining characters is -// counted as 1 grapheme cluster. -PLATFORM_EXPORT unsigned numGraphemeClusters(const String&); -// Returns the number of characters which will be less than or equal to -// the specified grapheme cluster length. -PLATFORM_EXPORT unsigned numCharactersInGraphemeClusters(const String&, - unsigned); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTBREAKITERATOR_H_ diff --git a/sky/engine/platform/text/TextBreakIteratorICU.cpp b/sky/engine/platform/text/TextBreakIteratorICU.cpp deleted file mode 100644 index 9d1e2d3f9001a..0000000000000 --- a/sky/engine/platform/text/TextBreakIteratorICU.cpp +++ /dev/null @@ -1,947 +0,0 @@ -/* - * Copyright (C) 2006 Lars Knoll - * Copyright (C) 2007, 2011, 2012 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/text/TextBreakIterator.h" - -#include -#include -#include "flutter/sky/engine/platform/text/TextBreakIteratorInternalICU.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/ThreadSpecific.h" -#include "flutter/sky/engine/wtf/ThreadingPrimitives.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -using namespace WTF; - -namespace blink { - -class LineBreakIteratorPool { - WTF_MAKE_NONCOPYABLE(LineBreakIteratorPool); - - public: - static LineBreakIteratorPool& sharedPool() { - static WTF::ThreadSpecific* pool = - new WTF::ThreadSpecific; - return **pool; - } - - static PassOwnPtr create() { - return adoptPtr(new LineBreakIteratorPool); - } - - icu::BreakIterator* take(const AtomicString& locale) { - icu::BreakIterator* iterator = 0; - for (size_t i = 0; i < m_pool.size(); ++i) { - if (m_pool[i].first == locale) { - iterator = m_pool[i].second; - m_pool.remove(i); - break; - } - } - - if (!iterator) { - UErrorCode openStatus = U_ZERO_ERROR; - bool localeIsEmpty = locale.isEmpty(); - iterator = icu::BreakIterator::createLineInstance( - localeIsEmpty ? icu::Locale(currentTextBreakLocaleID()) - : icu::Locale(locale.utf8().data()), - openStatus); - // locale comes from a web page and it can be invalid, leading ICU - // to fail, in which case we fall back to the default locale. - if (!localeIsEmpty && U_FAILURE(openStatus)) { - openStatus = U_ZERO_ERROR; - iterator = icu::BreakIterator::createLineInstance( - icu::Locale(currentTextBreakLocaleID()), openStatus); - } - - if (U_FAILURE(openStatus)) { - WTF_LOG_ERROR("icu::BreakIterator construction failed with status %d", - openStatus); - return 0; - } - } - - ASSERT(!m_vendedIterators.contains(iterator)); - m_vendedIterators.set(iterator, locale); - return iterator; - } - - void put(icu::BreakIterator* iterator) { - ASSERT_ARG(iterator, m_vendedIterators.contains(iterator)); - - if (m_pool.size() == capacity) { - delete (m_pool[0].second); - m_pool.remove(0); - } - - m_pool.append(Entry(m_vendedIterators.take(iterator), iterator)); - } - - private: - LineBreakIteratorPool() {} - - static const size_t capacity = 4; - - typedef pair Entry; - typedef Vector Pool; - Pool m_pool; - HashMap m_vendedIterators; - - friend WTF::ThreadSpecific:: - operator LineBreakIteratorPool*(); -}; - -enum TextContext { NoContext, PriorContext, PrimaryContext }; - -const int textBufferCapacity = 16; - -typedef struct { - UText text; - UChar buffer[textBufferCapacity]; -} UTextWithBuffer; - -static inline int64_t textPinIndex(int64_t& index, int64_t limit) { - if (index < 0) - index = 0; - else if (index > limit) - index = limit; - return index; -} - -static inline int64_t textNativeLength(UText* text) { - return text->a + text->b; -} - -// Relocate pointer from source into destination as required. -static void textFixPointer(const UText* source, - UText* destination, - const void*& pointer) { - if (pointer >= source->pExtra && - pointer < static_cast(source->pExtra) + source->extraSize) { - // Pointer references source extra buffer. - pointer = static_cast(destination->pExtra) + - (static_cast(pointer) - - static_cast(source->pExtra)); - } else if (pointer >= source && - pointer < - reinterpret_cast(source) + source->sizeOfStruct) { - // Pointer references source text structure, but not source extra buffer. - pointer = reinterpret_cast(destination) + - (static_cast(pointer) - - reinterpret_cast(source)); - } -} - -static UText* textClone(UText* destination, - const UText* source, - UBool deep, - UErrorCode* status) { - ASSERT_UNUSED(deep, !deep); - if (U_FAILURE(*status)) - return 0; - int32_t extraSize = source->extraSize; - destination = utext_setup(destination, extraSize, status); - if (U_FAILURE(*status)) - return destination; - void* extraNew = destination->pExtra; - int32_t flags = destination->flags; - int sizeToCopy = std::min(source->sizeOfStruct, destination->sizeOfStruct); - memcpy(destination, source, sizeToCopy); - destination->pExtra = extraNew; - destination->flags = flags; - memcpy(destination->pExtra, source->pExtra, extraSize); - textFixPointer(source, destination, destination->context); - textFixPointer(source, destination, destination->p); - textFixPointer(source, destination, destination->q); - ASSERT(!destination->r); - const void* chunkContents = - static_cast(destination->chunkContents); - textFixPointer(source, destination, chunkContents); - destination->chunkContents = static_cast(chunkContents); - return destination; -} - -static int32_t textExtract(UText*, - int64_t, - int64_t, - UChar*, - int32_t, - UErrorCode* errorCode) { - // In the present context, this text provider is used only with ICU functions - // that do not perform an extract operation. - ASSERT_NOT_REACHED(); - *errorCode = U_UNSUPPORTED_ERROR; - return 0; -} - -static void textClose(UText* text) { - text->context = 0; -} - -static inline TextContext textGetContext(const UText* text, - int64_t nativeIndex, - UBool forward) { - if (!text->b || nativeIndex > text->b) - return PrimaryContext; - if (nativeIndex == text->b) - return forward ? PrimaryContext : PriorContext; - return PriorContext; -} - -static inline TextContext textLatin1GetCurrentContext(const UText* text) { - if (!text->chunkContents) - return NoContext; - return text->chunkContents == text->pExtra ? PrimaryContext : PriorContext; -} - -static void textLatin1MoveInPrimaryContext(UText* text, - int64_t nativeIndex, - int64_t nativeLength, - UBool forward) { - ASSERT(text->chunkContents == text->pExtra); - if (forward) { - ASSERT(nativeIndex >= text->b && nativeIndex < nativeLength); - text->chunkNativeStart = nativeIndex; - text->chunkNativeLimit = nativeIndex + text->extraSize / sizeof(UChar); - if (text->chunkNativeLimit > nativeLength) - text->chunkNativeLimit = nativeLength; - } else { - ASSERT(nativeIndex > text->b && nativeIndex <= nativeLength); - text->chunkNativeLimit = nativeIndex; - text->chunkNativeStart = nativeIndex - text->extraSize / sizeof(UChar); - if (text->chunkNativeStart < text->b) - text->chunkNativeStart = text->b; - } - int64_t length = text->chunkNativeLimit - text->chunkNativeStart; - // Ensure chunk length is well defined if computed length exceeds int32_t - // range. - ASSERT(length <= std::numeric_limits::max()); - text->chunkLength = length <= std::numeric_limits::max() - ? static_cast(length) - : 0; - text->nativeIndexingLimit = text->chunkLength; - text->chunkOffset = forward ? 0 : text->chunkLength; - StringImpl::copyChars( - const_cast(text->chunkContents), - static_cast(text->p) + (text->chunkNativeStart - text->b), - static_cast(text->chunkLength)); -} - -static void textLatin1SwitchToPrimaryContext(UText* text, - int64_t nativeIndex, - int64_t nativeLength, - UBool forward) { - ASSERT(!text->chunkContents || text->chunkContents == text->q); - text->chunkContents = static_cast(text->pExtra); - textLatin1MoveInPrimaryContext(text, nativeIndex, nativeLength, forward); -} - -static void textLatin1MoveInPriorContext(UText* text, - int64_t nativeIndex, - int64_t nativeLength, - UBool forward) { - ASSERT(text->chunkContents == text->q); - ASSERT(forward ? nativeIndex < text->b : nativeIndex <= text->b); - ASSERT_UNUSED(nativeLength, forward ? nativeIndex < nativeLength - : nativeIndex <= nativeLength); - ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength - : nativeIndex <= nativeLength); - text->chunkNativeStart = 0; - text->chunkNativeLimit = text->b; - text->chunkLength = text->b; - text->nativeIndexingLimit = text->chunkLength; - int64_t offset = nativeIndex - text->chunkNativeStart; - // Ensure chunk offset is well defined if computed offset exceeds int32_t - // range or chunk length. - ASSERT(offset <= std::numeric_limits::max()); - text->chunkOffset = std::min(offset <= std::numeric_limits::max() - ? static_cast(offset) - : 0, - text->chunkLength); -} - -static void textLatin1SwitchToPriorContext(UText* text, - int64_t nativeIndex, - int64_t nativeLength, - UBool forward) { - ASSERT(!text->chunkContents || text->chunkContents == text->pExtra); - text->chunkContents = static_cast(text->q); - textLatin1MoveInPriorContext(text, nativeIndex, nativeLength, forward); -} - -static inline bool textInChunkOrOutOfRange(UText* text, - int64_t nativeIndex, - int64_t nativeLength, - UBool forward, - UBool& isAccessible) { - if (forward) { - if (nativeIndex >= text->chunkNativeStart && - nativeIndex < text->chunkNativeLimit) { - int64_t offset = nativeIndex - text->chunkNativeStart; - // Ensure chunk offset is well formed if computed offset exceeds int32_t - // range. - ASSERT(offset <= std::numeric_limits::max()); - text->chunkOffset = offset <= std::numeric_limits::max() - ? static_cast(offset) - : 0; - isAccessible = TRUE; - return true; - } - if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) { - text->chunkOffset = text->chunkLength; - isAccessible = FALSE; - return true; - } - } else { - if (nativeIndex > text->chunkNativeStart && - nativeIndex <= text->chunkNativeLimit) { - int64_t offset = nativeIndex - text->chunkNativeStart; - // Ensure chunk offset is well formed if computed offset exceeds int32_t - // range. - ASSERT(offset <= std::numeric_limits::max()); - text->chunkOffset = offset <= std::numeric_limits::max() - ? static_cast(offset) - : 0; - isAccessible = TRUE; - return true; - } - if (nativeIndex <= 0 && !text->chunkNativeStart) { - text->chunkOffset = 0; - isAccessible = FALSE; - return true; - } - } - return false; -} - -static UBool textLatin1Access(UText* text, int64_t nativeIndex, UBool forward) { - if (!text->context) - return FALSE; - int64_t nativeLength = textNativeLength(text); - UBool isAccessible; - if (textInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, - isAccessible)) - return isAccessible; - nativeIndex = textPinIndex(nativeIndex, nativeLength - 1); - TextContext currentContext = textLatin1GetCurrentContext(text); - TextContext newContext = textGetContext(text, nativeIndex, forward); - ASSERT(newContext != NoContext); - if (newContext == currentContext) { - if (currentContext == PrimaryContext) { - textLatin1MoveInPrimaryContext(text, nativeIndex, nativeLength, forward); - } else { - textLatin1MoveInPriorContext(text, nativeIndex, nativeLength, forward); - } - } else if (newContext == PrimaryContext) { - textLatin1SwitchToPrimaryContext(text, nativeIndex, nativeLength, forward); - } else { - ASSERT(newContext == PriorContext); - textLatin1SwitchToPriorContext(text, nativeIndex, nativeLength, forward); - } - return TRUE; -} - -static const struct UTextFuncs textLatin1Funcs = { - sizeof(UTextFuncs), 0, 0, 0, textClone, textNativeLength, - textLatin1Access, textExtract, 0, 0, 0, 0, - textClose, 0, 0, 0, -}; - -static void textInit(UText* text, - const UTextFuncs* funcs, - const void* string, - unsigned length, - const UChar* priorContext, - int priorContextLength) { - text->pFuncs = funcs; - text->providerProperties = 1 << UTEXT_PROVIDER_STABLE_CHUNKS; - text->context = string; - text->p = string; - text->a = length; - text->q = priorContext; - text->b = priorContextLength; -} - -static UText* textOpenLatin1(UTextWithBuffer* utWithBuffer, - const LChar* string, - unsigned length, - const UChar* priorContext, - int priorContextLength, - UErrorCode* status) { - if (U_FAILURE(*status)) - return 0; - - if (!string || - length > static_cast(std::numeric_limits::max())) { - *status = U_ILLEGAL_ARGUMENT_ERROR; - return 0; - } - UText* text = - utext_setup(&utWithBuffer->text, sizeof(utWithBuffer->buffer), status); - if (U_FAILURE(*status)) { - ASSERT(!text); - return 0; - } - textInit(text, &textLatin1Funcs, string, length, priorContext, - priorContextLength); - return text; -} - -static inline TextContext textUTF16GetCurrentContext(const UText* text) { - if (!text->chunkContents) - return NoContext; - return text->chunkContents == text->p ? PrimaryContext : PriorContext; -} - -static void textUTF16MoveInPrimaryContext(UText* text, - int64_t nativeIndex, - int64_t nativeLength, - UBool forward) { - ASSERT(text->chunkContents == text->p); - ASSERT_UNUSED(forward, - forward ? nativeIndex >= text->b : nativeIndex > text->b); - ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength - : nativeIndex <= nativeLength); - text->chunkNativeStart = text->b; - text->chunkNativeLimit = nativeLength; - int64_t length = text->chunkNativeLimit - text->chunkNativeStart; - // Ensure chunk length is well defined if computed length exceeds int32_t - // range. - ASSERT(length <= std::numeric_limits::max()); - text->chunkLength = length <= std::numeric_limits::max() - ? static_cast(length) - : 0; - text->nativeIndexingLimit = text->chunkLength; - int64_t offset = nativeIndex - text->chunkNativeStart; - // Ensure chunk offset is well defined if computed offset exceeds int32_t - // range or chunk length. - ASSERT(offset <= std::numeric_limits::max()); - text->chunkOffset = std::min(offset <= std::numeric_limits::max() - ? static_cast(offset) - : 0, - text->chunkLength); -} - -static void textUTF16SwitchToPrimaryContext(UText* text, - int64_t nativeIndex, - int64_t nativeLength, - UBool forward) { - ASSERT(!text->chunkContents || text->chunkContents == text->q); - text->chunkContents = static_cast(text->p); - textUTF16MoveInPrimaryContext(text, nativeIndex, nativeLength, forward); -} - -static void textUTF16MoveInPriorContext(UText* text, - int64_t nativeIndex, - int64_t nativeLength, - UBool forward) { - ASSERT(text->chunkContents == text->q); - ASSERT(forward ? nativeIndex < text->b : nativeIndex <= text->b); - ASSERT_UNUSED(nativeLength, forward ? nativeIndex < nativeLength - : nativeIndex <= nativeLength); - ASSERT_UNUSED(forward, forward ? nativeIndex < nativeLength - : nativeIndex <= nativeLength); - text->chunkNativeStart = 0; - text->chunkNativeLimit = text->b; - text->chunkLength = text->b; - text->nativeIndexingLimit = text->chunkLength; - int64_t offset = nativeIndex - text->chunkNativeStart; - // Ensure chunk offset is well defined if computed offset exceeds int32_t - // range or chunk length. - ASSERT(offset <= std::numeric_limits::max()); - text->chunkOffset = std::min(offset <= std::numeric_limits::max() - ? static_cast(offset) - : 0, - text->chunkLength); -} - -static void textUTF16SwitchToPriorContext(UText* text, - int64_t nativeIndex, - int64_t nativeLength, - UBool forward) { - ASSERT(!text->chunkContents || text->chunkContents == text->p); - text->chunkContents = static_cast(text->q); - textUTF16MoveInPriorContext(text, nativeIndex, nativeLength, forward); -} - -static UBool textUTF16Access(UText* text, int64_t nativeIndex, UBool forward) { - if (!text->context) - return FALSE; - int64_t nativeLength = textNativeLength(text); - UBool isAccessible; - if (textInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, - isAccessible)) - return isAccessible; - nativeIndex = textPinIndex(nativeIndex, nativeLength - 1); - TextContext currentContext = textUTF16GetCurrentContext(text); - TextContext newContext = textGetContext(text, nativeIndex, forward); - ASSERT(newContext != NoContext); - if (newContext == currentContext) { - if (currentContext == PrimaryContext) { - textUTF16MoveInPrimaryContext(text, nativeIndex, nativeLength, forward); - } else { - textUTF16MoveInPriorContext(text, nativeIndex, nativeLength, forward); - } - } else if (newContext == PrimaryContext) { - textUTF16SwitchToPrimaryContext(text, nativeIndex, nativeLength, forward); - } else { - ASSERT(newContext == PriorContext); - textUTF16SwitchToPriorContext(text, nativeIndex, nativeLength, forward); - } - return TRUE; -} - -static const struct UTextFuncs textUTF16Funcs = { - sizeof(UTextFuncs), 0, 0, 0, textClone, textNativeLength, - textUTF16Access, textExtract, 0, 0, 0, 0, - textClose, 0, 0, 0, -}; - -static UText* textOpenUTF16(UText* text, - const UChar* string, - unsigned length, - const UChar* priorContext, - int priorContextLength, - UErrorCode* status) { - if (U_FAILURE(*status)) - return 0; - - if (!string || - length > static_cast(std::numeric_limits::max())) { - *status = U_ILLEGAL_ARGUMENT_ERROR; - return 0; - } - - text = utext_setup(text, 0, status); - if (U_FAILURE(*status)) { - ASSERT(!text); - return 0; - } - textInit(text, &textUTF16Funcs, string, length, priorContext, - priorContextLength); - return text; -} - -static UText emptyText = UTEXT_INITIALIZER; - -static TextBreakIterator* wordBreakIterator(const LChar* string, int length) { - UErrorCode errorCode = U_ZERO_ERROR; - static TextBreakIterator* breakIter = 0; - if (!breakIter) { - breakIter = icu::BreakIterator::createWordInstance( - icu::Locale(currentTextBreakLocaleID()), errorCode); - ASSERT_WITH_MESSAGE(U_SUCCESS(errorCode), - "ICU could not open a break iterator: %s (%d)", - u_errorName(errorCode), errorCode); - if (!breakIter) - return 0; - } - - UTextWithBuffer textLocal; - textLocal.text = emptyText; - textLocal.text.extraSize = sizeof(textLocal.buffer); - textLocal.text.pExtra = textLocal.buffer; - - UErrorCode openStatus = U_ZERO_ERROR; - UText* text = textOpenLatin1(&textLocal, string, length, 0, 0, &openStatus); - if (U_FAILURE(openStatus)) { - WTF_LOG_ERROR("textOpenLatin1 failed with status %d", openStatus); - return 0; - } - - UErrorCode setTextStatus = U_ZERO_ERROR; - breakIter->setText(text, setTextStatus); - if (U_FAILURE(setTextStatus)) - WTF_LOG_ERROR("BreakIterator::seText failed with status %d", setTextStatus); - - utext_close(text); - - return breakIter; -} - -static void setText16(TextBreakIterator* iter, - const UChar* string, - int length) { - UErrorCode errorCode = U_ZERO_ERROR; - UText uText = UTEXT_INITIALIZER; - utext_openUChars(&uText, string, length, &errorCode); - if (U_FAILURE(errorCode)) - return; - iter->setText(&uText, errorCode); -} - -TextBreakIterator* wordBreakIterator(const UChar* string, int length) { - UErrorCode errorCode = U_ZERO_ERROR; - static TextBreakIterator* breakIter = 0; - if (!breakIter) { - breakIter = icu::BreakIterator::createWordInstance( - icu::Locale(currentTextBreakLocaleID()), errorCode); - ASSERT_WITH_MESSAGE(U_SUCCESS(errorCode), - "ICU could not open a break iterator: %s (%d)", - u_errorName(errorCode), errorCode); - if (!breakIter) - return 0; - } - setText16(breakIter, string, length); - return breakIter; -} - -TextBreakIterator* wordBreakIterator(const String& string, - int start, - int length) { - if (string.isEmpty()) - return 0; - if (string.is8Bit()) - return wordBreakIterator(string.characters8() + start, length); - return wordBreakIterator(string.characters16() + start, length); -} - -TextBreakIterator* acquireLineBreakIterator(const LChar* string, - int length, - const AtomicString& locale, - const UChar* priorContext, - unsigned priorContextLength) { - TextBreakIterator* iterator = - LineBreakIteratorPool::sharedPool().take(locale); - if (!iterator) - return 0; - - UTextWithBuffer textLocal; - textLocal.text = emptyText; - textLocal.text.extraSize = sizeof(textLocal.buffer); - textLocal.text.pExtra = textLocal.buffer; - - UErrorCode openStatus = U_ZERO_ERROR; - UText* text = textOpenLatin1(&textLocal, string, length, priorContext, - priorContextLength, &openStatus); - if (U_FAILURE(openStatus)) { - WTF_LOG_ERROR("textOpenLatin1 failed with status %d", openStatus); - return 0; - } - - UErrorCode setTextStatus = U_ZERO_ERROR; - iterator->setText(text, setTextStatus); - if (U_FAILURE(setTextStatus)) { - WTF_LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus); - return 0; - } - - utext_close(text); - - return iterator; -} - -TextBreakIterator* acquireLineBreakIterator(const UChar* string, - int length, - const AtomicString& locale, - const UChar* priorContext, - unsigned priorContextLength) { - TextBreakIterator* iterator = - LineBreakIteratorPool::sharedPool().take(locale); - if (!iterator) - return 0; - - UText textLocal = UTEXT_INITIALIZER; - - UErrorCode openStatus = U_ZERO_ERROR; - UText* text = textOpenUTF16(&textLocal, string, length, priorContext, - priorContextLength, &openStatus); - if (U_FAILURE(openStatus)) { - WTF_LOG_ERROR("textOpenUTF16 failed with status %d", openStatus); - return 0; - } - - UErrorCode setTextStatus = U_ZERO_ERROR; - iterator->setText(text, setTextStatus); - if (U_FAILURE(setTextStatus)) { - WTF_LOG_ERROR("ubrk_setUText failed with status %d", setTextStatus); - return 0; - } - - utext_close(text); - - return iterator; -} - -void releaseLineBreakIterator(TextBreakIterator* iterator) { - ASSERT_ARG(iterator, iterator); - - LineBreakIteratorPool::sharedPool().put(iterator); -} - -static TextBreakIterator* nonSharedCharacterBreakIterator; - -static inline bool compareAndSwapNonSharedCharacterBreakIterator( - TextBreakIterator* expected, - TextBreakIterator* newValue) { - DEFINE_STATIC_LOCAL(Mutex, nonSharedCharacterBreakIteratorMutex, ()); - MutexLocker locker(nonSharedCharacterBreakIteratorMutex); - if (nonSharedCharacterBreakIterator != expected) - return false; - nonSharedCharacterBreakIterator = newValue; - return true; -} - -NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator( - const String& string) - : m_is8Bit(true), m_charaters8(0), m_offset(0), m_length(0), m_iterator(0) { - if (string.isEmpty()) - return; - - m_is8Bit = string.is8Bit(); - - if (m_is8Bit) { - m_charaters8 = string.characters8(); - m_offset = 0; - m_length = string.length(); - return; - } - - createIteratorForBuffer(string.characters16(), string.length()); -} - -NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator( - const UChar* buffer, - unsigned length) - : m_is8Bit(false), - m_charaters8(0), - m_offset(0), - m_length(0), - m_iterator(0) { - createIteratorForBuffer(buffer, length); -} - -void NonSharedCharacterBreakIterator::createIteratorForBuffer( - const UChar* buffer, - unsigned length) { - m_iterator = nonSharedCharacterBreakIterator; - bool createdIterator = - m_iterator && - compareAndSwapNonSharedCharacterBreakIterator(m_iterator, 0); - if (!createdIterator) { - UErrorCode errorCode = U_ZERO_ERROR; - m_iterator = icu::BreakIterator::createCharacterInstance( - icu::Locale(currentTextBreakLocaleID()), errorCode); - ASSERT_WITH_MESSAGE(U_SUCCESS(errorCode), - "ICU could not open a break iterator: %s (%d)", - u_errorName(errorCode), errorCode); - } - - setText16(m_iterator, buffer, length); -} - -NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator() { - if (m_is8Bit) - return; - if (!compareAndSwapNonSharedCharacterBreakIterator(0, m_iterator)) - delete m_iterator; -} - -int NonSharedCharacterBreakIterator::next() { - if (!m_is8Bit) - return m_iterator->next(); - - if (m_offset >= m_length) - return TextBreakDone; - - m_offset += clusterLengthStartingAt(m_offset); - return m_offset; -} - -int NonSharedCharacterBreakIterator::current() { - if (!m_is8Bit) - return m_iterator->current(); - return m_offset; -} - -bool NonSharedCharacterBreakIterator::isBreak(int offset) const { - if (!m_is8Bit) - return m_iterator->isBoundary(offset); - return !isLFAfterCR(offset); -} - -int NonSharedCharacterBreakIterator::preceding(int offset) const { - if (!m_is8Bit) - return m_iterator->preceding(offset); - if (offset <= 0) - return TextBreakDone; - if (isLFAfterCR(offset)) - return offset - 2; - return offset - 1; -} - -int NonSharedCharacterBreakIterator::following(int offset) const { - if (!m_is8Bit) - return m_iterator->following(offset); - if (static_cast(offset) >= m_length) - return TextBreakDone; - return offset + clusterLengthStartingAt(offset); -} - -TextBreakIterator* sentenceBreakIterator(const UChar* string, int length) { - UErrorCode openStatus = U_ZERO_ERROR; - static TextBreakIterator* iterator = 0; - if (!iterator) { - iterator = icu::BreakIterator::createSentenceInstance( - icu::Locale(currentTextBreakLocaleID()), openStatus); - ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), - "ICU could not open a break iterator: %s (%d)", - u_errorName(openStatus), openStatus); - if (!iterator) - return 0; - } - - setText16(iterator, string, length); - return iterator; -} - -bool isWordTextBreak(TextBreakIterator* iterator) { - icu::RuleBasedBreakIterator* ruleBasedBreakIterator = - static_cast(iterator); - int ruleStatus = ruleBasedBreakIterator->getRuleStatus(); - return ruleStatus != UBRK_WORD_NONE; -} - -static TextBreakIterator* setUpIteratorWithRules(const char* breakRules, - const UChar* string, - int length) { - if (!string) - return 0; - - static TextBreakIterator* iterator = 0; - if (!iterator) { - UParseError parseStatus; - UErrorCode openStatus = U_ZERO_ERROR; - Vector rules; - String(breakRules).appendTo(rules); - - iterator = new icu::RuleBasedBreakIterator( - icu::UnicodeString(rules.data(), rules.size()), parseStatus, - openStatus); - ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), - "ICU could not open a break iterator: %s (%d)", - u_errorName(openStatus), openStatus); - if (!iterator) - return 0; - } - - setText16(iterator, string, length); - return iterator; -} - -TextBreakIterator* cursorMovementIterator(const UChar* string, int length) { - // This rule set is based on character-break iterator rules of ICU 4.0 - // . - // The major differences from the original ones are listed below: - // * Replaced '[\p{Grapheme_Cluster_Break = SpacingMark}]' with - // '[\p{General_Category = Spacing Mark} - $Extend]' for ICU 3.8 or earlier; - // * Removed rules that prevent a cursor from moving after prepend characters - // (Bug 24342); - // * Added rules that prevent a cursor from moving after virama signs of Indic - // languages except Tamil (Bug 15790), and; - // * Added rules that prevent a cursor from moving before Japanese half-width - // katakara voiced marks. - // * Added rules for regional indicator symbols. - static const char* const kRules = - "$CR = [\\p{Grapheme_Cluster_Break = CR}];" - "$LF = [\\p{Grapheme_Cluster_Break = LF}];" - "$Control = [\\p{Grapheme_Cluster_Break = Control}];" - "$VoiceMarks = [\\uFF9E\\uFF9F];" // Japanese half-width katakana voiced - // marks - "$Extend = [\\p{Grapheme_Cluster_Break = Extend} $VoiceMarks - [\\u0E30 " - "\\u0E32 \\u0E45 \\u0EB0 \\u0EB2]];" - "$SpacingMark = [[\\p{General_Category = Spacing Mark}] - $Extend];" - "$L = [\\p{Grapheme_Cluster_Break = L}];" - "$V = [\\p{Grapheme_Cluster_Break = V}];" - "$T = [\\p{Grapheme_Cluster_Break = T}];" - "$LV = [\\p{Grapheme_Cluster_Break = LV}];" - "$LVT = [\\p{Grapheme_Cluster_Break = LVT}];" - "$Hin0 = [\\u0905-\\u0939];" // Devanagari Letter A,...,Ha - "$HinV = \\u094D;" // Devanagari Sign Virama - "$Hin1 = [\\u0915-\\u0939];" // Devanagari Letter Ka,...,Ha - "$Ben0 = [\\u0985-\\u09B9];" // Bengali Letter A,...,Ha - "$BenV = \\u09CD;" // Bengali Sign Virama - "$Ben1 = [\\u0995-\\u09B9];" // Bengali Letter Ka,...,Ha - "$Pan0 = [\\u0A05-\\u0A39];" // Gurmukhi Letter A,...,Ha - "$PanV = \\u0A4D;" // Gurmukhi Sign Virama - "$Pan1 = [\\u0A15-\\u0A39];" // Gurmukhi Letter Ka,...,Ha - "$Guj0 = [\\u0A85-\\u0AB9];" // Gujarati Letter A,...,Ha - "$GujV = \\u0ACD;" // Gujarati Sign Virama - "$Guj1 = [\\u0A95-\\u0AB9];" // Gujarati Letter Ka,...,Ha - "$Ori0 = [\\u0B05-\\u0B39];" // Oriya Letter A,...,Ha - "$OriV = \\u0B4D;" // Oriya Sign Virama - "$Ori1 = [\\u0B15-\\u0B39];" // Oriya Letter Ka,...,Ha - "$Tel0 = [\\u0C05-\\u0C39];" // Telugu Letter A,...,Ha - "$TelV = \\u0C4D;" // Telugu Sign Virama - "$Tel1 = [\\u0C14-\\u0C39];" // Telugu Letter Ka,...,Ha - "$Kan0 = [\\u0C85-\\u0CB9];" // Kannada Letter A,...,Ha - "$KanV = \\u0CCD;" // Kannada Sign Virama - "$Kan1 = [\\u0C95-\\u0CB9];" // Kannada Letter A,...,Ha - "$Mal0 = [\\u0D05-\\u0D39];" // Malayalam Letter A,...,Ha - "$MalV = \\u0D4D;" // Malayalam Sign Virama - "$Mal1 = [\\u0D15-\\u0D39];" // Malayalam Letter A,...,Ha - "$RI = [\\U0001F1E6-\\U0001F1FF];" // Emoji regional indicators - "!!chain;" - "!!forward;" - "$CR $LF;" - "$L ($L | $V | $LV | $LVT);" - "($LV | $V) ($V | $T);" - "($LVT | $T) $T;" - "[^$Control $CR $LF] $Extend;" - "[^$Control $CR $LF] $SpacingMark;" - "$RI $RI / $RI;" - "$RI $RI;" - "$Hin0 $HinV $Hin1;" // Devanagari Virama (forward) - "$Ben0 $BenV $Ben1;" // Bengali Virama (forward) - "$Pan0 $PanV $Pan1;" // Gurmukhi Virama (forward) - "$Guj0 $GujV $Guj1;" // Gujarati Virama (forward) - "$Ori0 $OriV $Ori1;" // Oriya Virama (forward) - "$Tel0 $TelV $Tel1;" // Telugu Virama (forward) - "$Kan0 $KanV $Kan1;" // Kannada Virama (forward) - "$Mal0 $MalV $Mal1;" // Malayalam Virama (forward) - "!!reverse;" - "$LF $CR;" - "($L | $V | $LV | $LVT) $L;" - "($V | $T) ($LV | $V);" - "$T ($LVT | $T);" - "$Extend [^$Control $CR $LF];" - "$SpacingMark [^$Control $CR $LF];" - "$RI $RI / $RI $RI;" - "$RI $RI;" - "$Hin1 $HinV $Hin0;" // Devanagari Virama (backward) - "$Ben1 $BenV $Ben0;" // Bengali Virama (backward) - "$Pan1 $PanV $Pan0;" // Gurmukhi Virama (backward) - "$Guj1 $GujV $Guj0;" // Gujarati Virama (backward) - "$Ori1 $OriV $Ori0;" // Gujarati Virama (backward) - "$Tel1 $TelV $Tel0;" // Telugu Virama (backward) - "$Kan1 $KanV $Kan0;" // Kannada Virama (backward) - "$Mal1 $MalV $Mal0;" // Malayalam Virama (backward) - "!!safe_reverse;" - "!!safe_forward;"; - - return setUpIteratorWithRules(kRules, string, length); -} - -} // namespace blink diff --git a/sky/engine/platform/text/TextBreakIteratorInternalICU.cpp b/sky/engine/platform/text/TextBreakIteratorInternalICU.cpp deleted file mode 100644 index 5bd08a315c33a..0000000000000 --- a/sky/engine/platform/text/TextBreakIteratorInternalICU.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2008, 2009 Google Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#include "flutter/sky/engine/platform/text/TextBreakIteratorInternalICU.h" - -#include "flutter/sky/engine/platform/Language.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -static const char* UILanguage() { - // Chrome's UI language can be different from the OS UI language on Windows. - // We want to return Chrome's UI language here. - DEFINE_STATIC_LOCAL(const CString, locale, (defaultLanguage().latin1())); - return locale.data(); -} - -const char* currentSearchLocaleID() { - return UILanguage(); -} - -const char* currentTextBreakLocaleID() { - return UILanguage(); -} - -} // namespace blink diff --git a/sky/engine/platform/text/TextBreakIteratorInternalICU.h b/sky/engine/platform/text/TextBreakIteratorInternalICU.h deleted file mode 100644 index a2a6eabd5c336..0000000000000 --- a/sky/engine/platform/text/TextBreakIteratorInternalICU.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTBREAKITERATORINTERNALICU_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTBREAKITERATORINTERNALICU_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" - -// FIXME: Now that this handles locales for ICU, not just for text breaking, -// this file and the various implementation files should be renamed. - -namespace blink { - -PLATFORM_EXPORT const char* currentSearchLocaleID(); -PLATFORM_EXPORT const char* currentTextBreakLocaleID(); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTBREAKITERATORINTERNALICU_H_ diff --git a/sky/engine/platform/text/TextDecoration.h b/sky/engine/platform/text/TextDecoration.h deleted file mode 100644 index e44426a50bbe5..0000000000000 --- a/sky/engine/platform/text/TextDecoration.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTDECORATION_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTDECORATION_H_ - -namespace blink { - -enum TextDecorationType { - TextDecorationTypeSpelling = 1 << 1, - TextDecorationTypeGrammar = 1 << 2, - TextDecorationTypeInvisibleSpellcheck = 1 << 3, -}; -} - -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTDECORATION_H_ diff --git a/sky/engine/platform/text/TextDirection.h b/sky/engine/platform/text/TextDirection.h deleted file mode 100644 index 1e39c7628e443..0000000000000 --- a/sky/engine/platform/text/TextDirection.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTDIRECTION_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTDIRECTION_H_ - -namespace blink { - -// The order of this enum must match the order of the values in dart:ui's -// TextDirection. -enum TextDirection { RTL, LTR }; - -inline bool isLeftToRightDirection(TextDirection direction) { - return direction == LTR; -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTDIRECTION_H_ diff --git a/sky/engine/platform/text/TextPath.h b/sky/engine/platform/text/TextPath.h deleted file mode 100644 index 6320a8f93a5d8..0000000000000 --- a/sky/engine/platform/text/TextPath.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2013 Samsung All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Samsung nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTPATH_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTPATH_H_ - -namespace blink { - -enum CodePath { - AutoPath, - SimplePath, - ComplexPath, - SimpleWithGlyphOverflowPath -}; -} - -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTPATH_H_ diff --git a/sky/engine/platform/text/TextRun.cpp b/sky/engine/platform/text/TextRun.cpp deleted file mode 100644 index 1c2e2d22ce11c..0000000000000 --- a/sky/engine/platform/text/TextRun.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/text/TextRun.h" - -namespace blink { - -struct ExpectedTextRunSize { - const void* pointer; - int integers[2]; - float float1; - float float2; - float float3; - uint32_t bitfields : 10; - unsigned anUnsigned; - RefPtr renderingContext; -}; - -COMPILE_ASSERT(sizeof(TextRun) == sizeof(ExpectedTextRunSize), - TextRun_is_not_of_expected_size); - -void TextRun::setText(const String& string) { - m_len = string.length(); - if (!m_len) { - m_data.characters8 = 0; - m_is8Bit = true; - return; - } - m_is8Bit = string.is8Bit(); - if (m_is8Bit) - m_data.characters8 = string.characters8(); - else - m_data.characters16 = string.characters16(); -} - -} // namespace blink diff --git a/sky/engine/platform/text/TextRun.h b/sky/engine/platform/text/TextRun.h deleted file mode 100644 index 43b09d12ae77f..0000000000000 --- a/sky/engine/platform/text/TextRun.h +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2006, 2007, 2011 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTRUN_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTRUN_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/platform/fonts/Glyph.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/text/TextDirection.h" -#include "flutter/sky/engine/platform/text/TextPath.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "third_party/skia/include/core/SkRefCnt.h" - -class SkTextBlob; - -namespace blink { - -class FloatPoint; -class Font; -class GraphicsContext; -class GlyphBuffer; -class SimpleFontData; -struct GlyphData; -struct WidthIterator; - -class PLATFORM_EXPORT TextRun { - WTF_MAKE_FAST_ALLOCATED; - - public: - enum ExpansionBehaviorFlags { - ForbidTrailingExpansion = 0 << 0, - AllowTrailingExpansion = 1 << 0, - ForbidLeadingExpansion = 0 << 1, - AllowLeadingExpansion = 1 << 1, - }; - - typedef unsigned ExpansionBehavior; - - TextRun(const LChar* c, - unsigned len, - float xpos = 0, - float expansion = 0, - ExpansionBehavior expansionBehavior = AllowTrailingExpansion | - ForbidLeadingExpansion, - TextDirection direction = LTR, - bool directionalOverride = false, - bool characterScanForCodePath = true) - : m_charactersLength(len), - m_len(len), - m_xpos(xpos), - m_horizontalGlyphStretch(1), - m_expansion(expansion), - m_expansionBehavior(expansionBehavior), - m_is8Bit(true), - m_allowTabs(false), - m_direction(direction), - m_directionalOverride(directionalOverride), - m_characterScanForCodePath(characterScanForCodePath), - m_disableSpacing(false), - m_tabSize(0) { - m_data.characters8 = c; - } - - TextRun(const UChar* c, - unsigned len, - float xpos = 0, - float expansion = 0, - ExpansionBehavior expansionBehavior = AllowTrailingExpansion | - ForbidLeadingExpansion, - TextDirection direction = LTR, - bool directionalOverride = false, - bool characterScanForCodePath = true) - : m_charactersLength(len), - m_len(len), - m_xpos(xpos), - m_horizontalGlyphStretch(1), - m_expansion(expansion), - m_expansionBehavior(expansionBehavior), - m_is8Bit(false), - m_allowTabs(false), - m_direction(direction), - m_directionalOverride(directionalOverride), - m_characterScanForCodePath(characterScanForCodePath), - m_disableSpacing(false), - m_tabSize(0) { - m_data.characters16 = c; - } - - TextRun(const String& string, - float xpos = 0, - float expansion = 0, - ExpansionBehavior expansionBehavior = AllowTrailingExpansion | - ForbidLeadingExpansion, - TextDirection direction = LTR, - bool directionalOverride = false, - bool characterScanForCodePath = true) - : m_charactersLength(string.length()), - m_len(string.length()), - m_xpos(xpos), - m_horizontalGlyphStretch(1), - m_expansion(expansion), - m_expansionBehavior(expansionBehavior), - m_allowTabs(false), - m_direction(direction), - m_directionalOverride(directionalOverride), - m_characterScanForCodePath(characterScanForCodePath), - m_disableSpacing(false), - m_tabSize(0) { - if (!m_charactersLength) { - m_is8Bit = true; - m_data.characters8 = 0; - } else if (string.is8Bit()) { - m_data.characters8 = string.characters8(); - m_is8Bit = true; - } else { - m_data.characters16 = string.characters16(); - m_is8Bit = false; - } - } - - TextRun(const StringView& string, - float xpos = 0, - float expansion = 0, - ExpansionBehavior expansionBehavior = AllowTrailingExpansion | - ForbidLeadingExpansion, - TextDirection direction = LTR, - bool directionalOverride = false, - bool characterScanForCodePath = true) - : m_charactersLength(string.length()), - m_len(string.length()), - m_xpos(xpos), - m_horizontalGlyphStretch(1), - m_expansion(expansion), - m_expansionBehavior(expansionBehavior), - m_allowTabs(false), - m_direction(direction), - m_directionalOverride(directionalOverride), - m_characterScanForCodePath(characterScanForCodePath), - m_disableSpacing(false), - m_tabSize(0) { - if (!m_charactersLength) { - m_is8Bit = true; - m_data.characters8 = 0; - } else if (string.is8Bit()) { - m_data.characters8 = string.characters8(); - m_is8Bit = true; - } else { - m_data.characters16 = string.characters16(); - m_is8Bit = false; - } - } - - TextRun subRun(unsigned startOffset, unsigned length) const { - ASSERT(startOffset < m_len); - - TextRun result = *this; - - if (is8Bit()) { - result.setText(data8(startOffset), length); - return result; - } - result.setText(data16(startOffset), length); - return result; - } - - UChar operator[](unsigned i) const { - ASSERT_WITH_SECURITY_IMPLICATION(i < m_len); - return is8Bit() ? m_data.characters8[i] : m_data.characters16[i]; - } - const LChar* data8(unsigned i) const { - ASSERT_WITH_SECURITY_IMPLICATION(i < m_len); - ASSERT(is8Bit()); - return &m_data.characters8[i]; - } - const UChar* data16(unsigned i) const { - ASSERT_WITH_SECURITY_IMPLICATION(i < m_len); - ASSERT(!is8Bit()); - return &m_data.characters16[i]; - } - - const LChar* characters8() const { - ASSERT(is8Bit()); - return m_data.characters8; - } - const UChar* characters16() const { - ASSERT(!is8Bit()); - return m_data.characters16; - } - - bool is8Bit() const { return m_is8Bit; } - int length() const { return m_len; } - int charactersLength() const { return m_charactersLength; } - - void setText(const LChar* c, unsigned len) { - m_data.characters8 = c; - m_len = len; - m_is8Bit = true; - } - void setText(const UChar* c, unsigned len) { - m_data.characters16 = c; - m_len = len; - m_is8Bit = false; - } - void setText(const String&); - void setCharactersLength(unsigned charactersLength) { - m_charactersLength = charactersLength; - } - - float horizontalGlyphStretch() const { return m_horizontalGlyphStretch; } - void setHorizontalGlyphStretch(float scale) { - m_horizontalGlyphStretch = scale; - } - - bool allowTabs() const { return m_allowTabs; } - unsigned tabSize() const { return m_tabSize; } - void setTabSize(bool, unsigned); - - float xPos() const { return m_xpos; } - void setXPos(float xPos) { m_xpos = xPos; } - float expansion() const { return m_expansion; } - bool allowsLeadingExpansion() const { - return m_expansionBehavior & AllowLeadingExpansion; - } - bool allowsTrailingExpansion() const { - return m_expansionBehavior & AllowTrailingExpansion; - } - TextDirection direction() const { - return static_cast(m_direction); - } - bool rtl() const { return m_direction == RTL; } - bool ltr() const { return m_direction == LTR; } - bool directionalOverride() const { return m_directionalOverride; } - bool characterScanForCodePath() const { return m_characterScanForCodePath; } - bool spacingDisabled() const { return m_disableSpacing; } - - void disableSpacing() { m_disableSpacing = true; } - void setDirection(TextDirection direction) { m_direction = direction; } - void setDirectionalOverride(bool override) { - m_directionalOverride = override; - } - void setCharacterScanForCodePath(bool scan) { - m_characterScanForCodePath = scan; - } - - class RenderingContext : public RefCounted { - public: - virtual ~RenderingContext() {} - - virtual GlyphData glyphDataForCharacter(const Font&, - const TextRun&, - WidthIterator&, - UChar32 character, - bool mirror, - int currentCharacter, - unsigned& advanceLength) = 0; - virtual float floatWidthUsingSVGFont(const Font&, - const TextRun&, - int& charsConsumed, - Glyph& glyphId) const = 0; - }; - - RenderingContext* renderingContext() const { - return m_renderingContext.get(); - } - void setRenderingContext(PassRefPtr context) { - m_renderingContext = context; - } - - private: - union { - const LChar* characters8; - const UChar* characters16; - } m_data; - unsigned m_charactersLength; // Marks the end of the characters buffer. - // Default equals to m_len. - unsigned m_len; - - // m_xpos is the x position relative to the left start of the text line, not - // relative to the left start of the containing block. In the case of right - // alignment or center alignment, left start of the text line is not the same - // as left start of the containing block. - float m_xpos; - float m_horizontalGlyphStretch; - - float m_expansion; - ExpansionBehavior m_expansionBehavior : 2; - unsigned m_is8Bit : 1; - unsigned m_allowTabs : 1; - unsigned m_direction : 1; - unsigned m_directionalOverride : 1; // Was this direction set by an override - // character. - unsigned m_characterScanForCodePath : 1; - unsigned m_disableSpacing : 1; - unsigned m_tabSize; - RefPtr m_renderingContext; -}; - -inline void TextRun::setTabSize(bool allow, unsigned size) { - m_allowTabs = allow; - m_tabSize = size; -} - -// Container for parameters needed to paint TextRun. -struct TextRunPaintInfo { - explicit TextRunPaintInfo(const TextRun& r) - : run(r), from(0), to(r.length()) {} - - const TextRun& run; - int from; - int to; - FloatRect bounds; - sk_sp* cachedTextBlob; -}; - -} // namespace blink -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTRUN_H_ diff --git a/sky/engine/platform/text/TextRunIterator.h b/sky/engine/platform/text/TextRunIterator.h deleted file mode 100644 index 216824a36fadb..0000000000000 --- a/sky/engine/platform/text/TextRunIterator.h +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (C) 2013 Google Inc. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTRUNITERATOR_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTRUNITERATOR_H_ - -#include "flutter/sky/engine/platform/text/TextRun.h" - -namespace blink { - -class TextRunIterator { - public: - TextRunIterator() : m_textRun(0), m_offset(0) {} - - TextRunIterator(const TextRun* textRun, unsigned offset) - : m_textRun(textRun), m_offset(offset) {} - - TextRunIterator(const TextRunIterator& other) - : m_textRun(other.m_textRun), m_offset(other.m_offset) {} - - unsigned offset() const { return m_offset; } - void increment() { m_offset++; } - bool atEnd() const { return !m_textRun || m_offset >= m_textRun->length(); } - UChar current() const { return (*m_textRun)[m_offset]; } - WTF::Unicode::Direction direction() const { - return atEnd() ? WTF::Unicode::OtherNeutral - : WTF::Unicode::direction(current()); - } - bool atParagraphSeparator() const { return current() == '\n'; } - - bool operator==(const TextRunIterator& other) { - return m_offset == other.m_offset && m_textRun == other.m_textRun; - } - - bool operator!=(const TextRunIterator& other) { return !operator==(other); } - - private: - const TextRun* m_textRun; - int m_offset; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTRUNITERATOR_H_ diff --git a/sky/engine/platform/text/TextStream.cpp b/sky/engine/platform/text/TextStream.cpp deleted file mode 100644 index deaaafc01540d..0000000000000 --- a/sky/engine/platform/text/TextStream.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2004, 2008, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/text/TextStream.h" - -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/FloatSize.h" -#include "flutter/sky/engine/platform/geometry/IntPoint.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/StringExtras.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace blink { - -static const size_t printBufferSize = - 100; // large enough for any integer or floating point value in string - // format, including trailing null character - -static inline bool hasFractions(double val) { - static const double s_epsilon = 0.0001; - int ival = static_cast(val); - double dval = static_cast(ival); - return fabs(val - dval) > s_epsilon; -} - -TextStream& TextStream::operator<<(bool b) { - return *this << (b ? "1" : "0"); -} - -TextStream& TextStream::operator<<(int i) { - m_text.appendNumber(i); - return *this; -} - -TextStream& TextStream::operator<<(unsigned i) { - m_text.appendNumber(i); - return *this; -} - -TextStream& TextStream::operator<<(long i) { - m_text.appendNumber(i); - return *this; -} - -TextStream& TextStream::operator<<(unsigned long i) { - m_text.appendNumber(i); - return *this; -} - -TextStream& TextStream::operator<<(long long i) { - m_text.appendNumber(i); - return *this; -} - -TextStream& TextStream::operator<<(unsigned long long i) { - m_text.appendNumber(i); - return *this; -} - -TextStream& TextStream::operator<<(float f) { - m_text.append(String::numberToStringFixedWidth(f, 2)); - return *this; -} - -TextStream& TextStream::operator<<(double d) { - m_text.append(String::numberToStringFixedWidth(d, 2)); - return *this; -} - -TextStream& TextStream::operator<<(const char* string) { - m_text.append(string); - return *this; -} - -TextStream& TextStream::operator<<(const void* p) { - char buffer[printBufferSize]; - snprintf(buffer, sizeof(buffer) - 1, "%p", p); - return *this << buffer; -} - -TextStream& TextStream::operator<<(const String& string) { - m_text.append(string); - return *this; -} - -TextStream& TextStream::operator<<( - const FormatNumberRespectingIntegers& numberToFormat) { - if (hasFractions(numberToFormat.value)) - return *this << numberToFormat.value; - - m_text.appendNumber(static_cast(numberToFormat.value)); - return *this; -} - -String TextStream::release() { - String result = m_text.toString(); - m_text.clear(); - return result; -} - -TextStream& operator<<(TextStream& ts, const IntRect& r) { - return ts << "at (" << r.x() << "," << r.y() << ") size " << r.width() << "x" - << r.height(); -} - -TextStream& operator<<(TextStream& ts, const IntPoint& p) { - return ts << "(" << p.x() << "," << p.y() << ")"; -} - -TextStream& operator<<(TextStream& ts, const FloatPoint& p) { - ts << "(" << TextStream::FormatNumberRespectingIntegers(p.x()); - ts << "," << TextStream::FormatNumberRespectingIntegers(p.y()); - ts << ")"; - return ts; -} - -TextStream& operator<<(TextStream& ts, const FloatSize& s) { - ts << "width=" << TextStream::FormatNumberRespectingIntegers(s.width()); - ts << " height=" << TextStream::FormatNumberRespectingIntegers(s.height()); - return ts; -} - -TextStream& operator<<(TextStream& ts, const FloatRect& r) { - ts << "at (" << TextStream::FormatNumberRespectingIntegers(r.x()); - ts << "," << TextStream::FormatNumberRespectingIntegers(r.y()); - ts << ") size " << TextStream::FormatNumberRespectingIntegers(r.width()); - ts << "x" << TextStream::FormatNumberRespectingIntegers(r.height()); - return ts; -} - -void writeIndent(TextStream& ts, int indent) { - for (int i = 0; i != indent; ++i) - ts << " "; -} - -} // namespace blink diff --git a/sky/engine/platform/text/TextStream.h b/sky/engine/platform/text/TextStream.h deleted file mode 100644 index e718358231035..0000000000000 --- a/sky/engine/platform/text/TextStream.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2004, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_TEXTSTREAM_H_ -#define SKY_ENGINE_PLATFORM_TEXT_TEXTSTREAM_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -class IntPoint; -class IntRect; -class FloatPoint; -class FloatRect; -class FloatSize; - -class PLATFORM_EXPORT TextStream { - public: - struct FormatNumberRespectingIntegers { - FormatNumberRespectingIntegers(double number) : value(number) {} - double value; - }; - - TextStream& operator<<(bool); - TextStream& operator<<(int); - TextStream& operator<<(unsigned); - TextStream& operator<<(long); - TextStream& operator<<(unsigned long); - TextStream& operator<<(long long); - TextStream& operator<<(unsigned long long); - TextStream& operator<<(float); - TextStream& operator<<(double); - TextStream& operator<<(const char*); - TextStream& operator<<(const void*); - TextStream& operator<<(const String&); - TextStream& operator<<(const FormatNumberRespectingIntegers&); - - String release(); - - private: - StringBuilder m_text; -}; - -PLATFORM_EXPORT TextStream& operator<<(TextStream&, const IntPoint&); -PLATFORM_EXPORT TextStream& operator<<(TextStream&, const IntRect&); -PLATFORM_EXPORT TextStream& operator<<(TextStream&, const FloatPoint&); -PLATFORM_EXPORT TextStream& operator<<(TextStream&, const FloatSize&); -PLATFORM_EXPORT TextStream& operator<<(TextStream&, const FloatRect&); - -PLATFORM_EXPORT void writeIndent(TextStream&, int indent); - -template -TextStream& operator<<(TextStream& ts, const Vector& vector) { - ts << "["; - - unsigned size = vector.size(); - for (unsigned i = 0; i < size; ++i) { - ts << vector[i]; - if (i < size - 1) - ts << ", "; - } - - ts << "]"; - return ts; -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_TEXTSTREAM_H_ diff --git a/sky/engine/platform/text/UnicodeBidi.h b/sky/engine/platform/text/UnicodeBidi.h deleted file mode 100644 index 20c5d32d7fe23..0000000000000 --- a/sky/engine/platform/text/UnicodeBidi.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2011 Google, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_UNICODEBIDI_H_ -#define SKY_ENGINE_PLATFORM_TEXT_UNICODEBIDI_H_ - -namespace blink { - -enum EUnicodeBidi { - UBNormal, - Embed, - Override, - Isolate, - Plaintext, - IsolateOverride, -}; - -inline bool isIsolated(const EUnicodeBidi& unicodeBidi) { - return unicodeBidi == Isolate || unicodeBidi == IsolateOverride || - unicodeBidi == Plaintext; -} - -inline bool isOverride(EUnicodeBidi unicodeBidi) { - return unicodeBidi == Override || unicodeBidi == IsolateOverride; -} - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_UNICODEBIDI_H_ diff --git a/sky/engine/platform/text/UnicodeRange.cpp b/sky/engine/platform/text/UnicodeRange.cpp deleted file mode 100644 index ff9f9b01baec9..0000000000000 --- a/sky/engine/platform/text/UnicodeRange.cpp +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Copyright (C) 2007 Apple Computer, Inc. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#include "flutter/sky/engine/platform/text/UnicodeRange.h" - -namespace blink { - -// This table depends on unicode range definitions. -// Each item's index must correspond to a unicode range value -// eg. x-cyrillic = LangGroupTable[cRangeCyrillic] -static const char* const gUnicodeRangeToLangGroupTable[] = { - "x-cyrillic", "el", "tr", "he", "ar", "x-baltic", - "th", "ko", "ja", "zh-CN", "zh-TW", "x-devanagari", - "x-tamil", "x-armn", "x-beng", "x-cans", "x-ethi", "x-geor", - "x-gujr", "x-guru", "x-khmr", "x-mlym"}; - -/********************************************************************** - * Unicode subranges as defined in unicode 3.0 - * x-western, x-central-euro, tr, x-baltic -> latin - * 0000 - 036f - * 1e00 - 1eff - * 2000 - 206f (general punctuation) - * 20a0 - 20cf (currency symbols) - * 2100 - 214f (letterlike symbols) - * 2150 - 218f (Number Forms) - * el -> greek - * 0370 - 03ff - * 1f00 - 1fff - * x-cyrillic -> cyrillic - * 0400 - 04ff - * he -> hebrew - * 0590 - 05ff - * ar -> arabic - * 0600 - 06ff - * fb50 - fdff (arabic presentation forms) - * fe70 - feff (arabic presentation forms b) - * th - thai - * 0e00 - 0e7f - * ko -> korean - * ac00 - d7af (hangul Syllables) - * 1100 - 11ff (jamo) - * 3130 - 318f (hangul compatibility jamo) - * ja - * 3040 - 309f (hiragana) - * 30a0 - 30ff (katakana) - * zh-CN - * zh-TW - * - * CJK - * 3100 - 312f (bopomofo) - * 31a0 - 31bf (bopomofo extended) - * 3000 - 303f (CJK Symbols and Punctuation) - * 2e80 - 2eff (CJK radicals supplement) - * 2f00 - 2fdf (Kangxi Radicals) - * 2ff0 - 2fff (Ideographic Description Characters) - * 3190 - 319f (kanbun) - * 3200 - 32ff (Enclosed CJK letters and Months) - * 3300 - 33ff (CJK compatibility) - * 3400 - 4dbf (CJK Unified Ideographs Extension A) - * 4e00 - 9faf (CJK Unified Ideographs) - * f900 - fa5f (CJK Compatibility Ideographs) - * fe30 - fe4f (CJK compatibility Forms) - * ff00 - ffef (halfwidth and fullwidth forms) - * - * Armenian - * 0530 - 058f - * Sriac - * 0700 - 074f - * Thaana - * 0780 - 07bf - * Devanagari - * 0900 - 097f - * Bengali - * 0980 - 09ff - * Gurmukhi - * 0a00 - 0a7f - * Gujarati - * 0a80 - 0aff - * Oriya - * 0b00 - 0b7f - * Tamil - * 0b80 - 0bff - * Telugu - * 0c00 - 0c7f - * Kannada - * 0c80 - 0cff - * Malayalam - * 0d00 - 0d7f - * Sinhala - * 0d80 - 0def - * Lao - * 0e80 - 0eff - * Tibetan - * 0f00 - 0fbf - * Myanmar - * 1000 - 109f - * Georgian - * 10a0 - 10ff - * Ethiopic - * 1200 - 137f - * Cherokee - * 13a0 - 13ff - * Canadian Aboriginal Syllabics - * 1400 - 167f - * Ogham - * 1680 - 169f - * Runic - * 16a0 - 16ff - * Khmer - * 1780 - 17ff - * Mongolian - * 1800 - 18af - * Misc - superscripts and subscripts - * 2070 - 209f - * Misc - Combining Diacritical Marks for Symbols - * 20d0 - 20ff - * Misc - Arrows - * 2190 - 21ff - * Misc - Mathematical Operators - * 2200 - 22ff - * Misc - Miscellaneous Technical - * 2300 - 23ff - * Misc - Control picture - * 2400 - 243f - * Misc - Optical character recognition - * 2440 - 2450 - * Misc - Enclose Alphanumerics - * 2460 - 24ff - * Misc - Box Drawing - * 2500 - 257f - * Misc - Block Elements - * 2580 - 259f - * Misc - Geometric Shapes - * 25a0 - 25ff - * Misc - Miscellaneous Symbols - * 2600 - 267f - * Misc - Dingbats - * 2700 - 27bf - * Misc - Braille Patterns - * 2800 - 28ff - * Yi Syllables - * a000 - a48f - * Yi radicals - * a490 - a4cf - * Alphabetic Presentation Forms - * fb00 - fb4f - * Misc - Combining half Marks - * fe20 - fe2f - * Misc - small form variants - * fe50 - fe6f - * Misc - Specials - * fff0 - ffff - *********************************************************************/ - -static const unsigned cNumSubTables = 9; -static const unsigned cSubTableSize = 16; - -static const unsigned char gUnicodeSubrangeTable[cNumSubTables][cSubTableSize] = - { - { - // table for X--- - cRangeTableBase + 1, // u0xxx - cRangeTableBase + 2, // u1xxx - cRangeTableBase + 3, // u2xxx - cRangeSetCJK, // u3xxx - cRangeSetCJK, // u4xxx - cRangeSetCJK, // u5xxx - cRangeSetCJK, // u6xxx - cRangeSetCJK, // u7xxx - cRangeSetCJK, // u8xxx - cRangeSetCJK, // u9xxx - cRangeTableBase + 4, // uaxxx - cRangeKorean, // ubxxx - cRangeKorean, // ucxxx - cRangeTableBase + 5, // udxxx - cRangePrivate, // uexxx - cRangeTableBase + 6 // ufxxx - }, - { - // table for 0X-- - cRangeSetLatin, // u00xx - cRangeSetLatin, // u01xx - cRangeSetLatin, // u02xx - cRangeGreek, // u03xx XXX 0300-036f is in fact - // cRangeCombiningDiacriticalMarks - cRangeCyrillic, // u04xx - cRangeTableBase + - 7, // u05xx, includes Cyrillic supplement, Hebrew, and Armenian - cRangeArabic, // u06xx - cRangeTertiaryTable, // u07xx - cRangeUnassigned, // u08xx - cRangeTertiaryTable, // u09xx - cRangeTertiaryTable, // u0axx - cRangeTertiaryTable, // u0bxx - cRangeTertiaryTable, // u0cxx - cRangeTertiaryTable, // u0dxx - cRangeTertiaryTable, // u0exx - cRangeTibetan, // u0fxx - }, - { - // table for 1x-- - cRangeTertiaryTable, // u10xx - cRangeKorean, // u11xx - cRangeEthiopic, // u12xx - cRangeTertiaryTable, // u13xx - cRangeCanadian, // u14xx - cRangeCanadian, // u15xx - cRangeTertiaryTable, // u16xx - cRangeKhmer, // u17xx - cRangeMongolian, // u18xx - cRangeUnassigned, // u19xx - cRangeUnassigned, // u1axx - cRangeUnassigned, // u1bxx - cRangeUnassigned, // u1cxx - cRangeUnassigned, // u1dxx - cRangeSetLatin, // u1exx - cRangeGreek, // u1fxx - }, - { - // table for 2x-- - cRangeSetLatin, // u20xx - cRangeSetLatin, // u21xx - cRangeMathOperators, // u22xx - cRangeMiscTechnical, // u23xx - cRangeControlOpticalEnclose, // u24xx - cRangeBoxBlockGeometrics, // u25xx - cRangeMiscSymbols, // u26xx - cRangeDingbats, // u27xx - cRangeBraillePattern, // u28xx - cRangeUnassigned, // u29xx - cRangeUnassigned, // u2axx - cRangeUnassigned, // u2bxx - cRangeUnassigned, // u2cxx - cRangeUnassigned, // u2dxx - cRangeSetCJK, // u2exx - cRangeSetCJK, // u2fxx - }, - { - // table for ax-- - cRangeYi, // ua0xx - cRangeYi, // ua1xx - cRangeYi, // ua2xx - cRangeYi, // ua3xx - cRangeYi, // ua4xx - cRangeUnassigned, // ua5xx - cRangeUnassigned, // ua6xx - cRangeUnassigned, // ua7xx - cRangeUnassigned, // ua8xx - cRangeUnassigned, // ua9xx - cRangeUnassigned, // uaaxx - cRangeUnassigned, // uabxx - cRangeKorean, // uacxx - cRangeKorean, // uadxx - cRangeKorean, // uaexx - cRangeKorean, // uafxx - }, - { - // table for dx-- - cRangeKorean, // ud0xx - cRangeKorean, // ud1xx - cRangeKorean, // ud2xx - cRangeKorean, // ud3xx - cRangeKorean, // ud4xx - cRangeKorean, // ud5xx - cRangeKorean, // ud6xx - cRangeKorean, // ud7xx - cRangeSurrogate, // ud8xx - cRangeSurrogate, // ud9xx - cRangeSurrogate, // udaxx - cRangeSurrogate, // udbxx - cRangeSurrogate, // udcxx - cRangeSurrogate, // uddxx - cRangeSurrogate, // udexx - cRangeSurrogate, // udfxx - }, - { - // table for fx-- - cRangePrivate, // uf0xx - cRangePrivate, // uf1xx - cRangePrivate, // uf2xx - cRangePrivate, // uf3xx - cRangePrivate, // uf4xx - cRangePrivate, // uf5xx - cRangePrivate, // uf6xx - cRangePrivate, // uf7xx - cRangePrivate, // uf8xx - cRangeSetCJK, // uf9xx - cRangeSetCJK, // ufaxx - cRangeArabic, // ufbxx, includes alphabic presentation form - cRangeArabic, // ufcxx - cRangeArabic, // ufdxx - cRangeArabic, // ufexx, includes Combining half marks, - // CJK compatibility forms, - // CJK compatibility forms, - // small form variants - cRangeTableBase + - 8, // uffxx, halfwidth and fullwidth forms, includes Specials - }, - { - // table for 0x0500 - 0x05ff - cRangeCyrillic, // u050x - cRangeCyrillic, // u051x - cRangeCyrillic, // u052x - cRangeArmenian, // u053x - cRangeArmenian, // u054x - cRangeArmenian, // u055x - cRangeArmenian, // u056x - cRangeArmenian, // u057x - cRangeArmenian, // u058x - cRangeHebrew, // u059x - cRangeHebrew, // u05ax - cRangeHebrew, // u05bx - cRangeHebrew, // u05cx - cRangeHebrew, // u05dx - cRangeHebrew, // u05ex - cRangeHebrew, // u05fx - }, - { - // table for 0xff00 - 0xffff - cRangeSetCJK, // uff0x, fullwidth latin - cRangeSetCJK, // uff1x, fullwidth latin - cRangeSetCJK, // uff2x, fullwidth latin - cRangeSetCJK, // uff3x, fullwidth latin - cRangeSetCJK, // uff4x, fullwidth latin - cRangeSetCJK, // uff5x, fullwidth latin - cRangeSetCJK, // uff6x, halfwidth katakana - cRangeSetCJK, // uff7x, halfwidth katakana - cRangeSetCJK, // uff8x, halfwidth katakana - cRangeSetCJK, // uff9x, halfwidth katakana - cRangeSetCJK, // uffax, halfwidth hangul jamo - cRangeSetCJK, // uffbx, halfwidth hangul jamo - cRangeSetCJK, // uffcx, halfwidth hangul jamo - cRangeSetCJK, // uffdx, halfwidth hangul jamo - cRangeSetCJK, // uffex, fullwidth symbols - cRangeSpecials, // ufffx, Specials - }, -}; - -// Most scripts between U+0700 and U+16FF are assigned a chunk of 128 (0x80) -// code points so that the number of entries in the tertiary range -// table for that range is obtained by dividing (0x1700 - 0x0700) by 128. -// Exceptions: Ethiopic, Tibetan, Hangul Jamo and Canadian aboriginal -// syllabaries take multiple chunks and Ogham and Runic share a single chunk. -static const unsigned cTertiaryTableSize = ((0x1700 - 0x0700) / 0x80); - -static const unsigned char gUnicodeTertiaryRangeTable[cTertiaryTableSize] = { - // table for 0x0700 - 0x1600 - cRangeSyriac, // u070x - cRangeThaana, // u078x - cRangeUnassigned, // u080x place holder(resolved in the 2ndary tab.) - cRangeUnassigned, // u088x place holder(resolved in the 2ndary tab.) - cRangeDevanagari, // u090x - cRangeBengali, // u098x - cRangeGurmukhi, // u0a0x - cRangeGujarati, // u0a8x - cRangeOriya, // u0b0x - cRangeTamil, // u0b8x - cRangeTelugu, // u0c0x - cRangeKannada, // u0c8x - cRangeMalayalam, // u0d0x - cRangeSinhala, // u0d8x - cRangeThai, // u0e0x - cRangeLao, // u0e8x - cRangeTibetan, // u0f0x place holder(resolved in the 2ndary tab.) - cRangeTibetan, // u0f8x place holder(resolved in the 2ndary tab.) - cRangeMyanmar, // u100x - cRangeGeorgian, // u108x - cRangeKorean, // u110x place holder(resolved in the 2ndary tab.) - cRangeKorean, // u118x place holder(resolved in the 2ndary tab.) - cRangeEthiopic, // u120x place holder(resolved in the 2ndary tab.) - cRangeEthiopic, // u128x place holder(resolved in the 2ndary tab.) - cRangeEthiopic, // u130x - cRangeCherokee, // u138x - cRangeCanadian, // u140x place holder(resolved in the 2ndary tab.) - cRangeCanadian, // u148x place holder(resolved in the 2ndary tab.) - cRangeCanadian, // u150x place holder(resolved in the 2ndary tab.) - cRangeCanadian, // u158x place holder(resolved in the 2ndary tab.) - cRangeCanadian, // u160x - cRangeOghamRunic, // u168x this contains two scripts, Ogham & Runic -}; - -// A two level index is almost enough for locating a range, with the -// exception of u03xx and u05xx. Since we don't really care about range for -// combining diacritical marks in our font application, they are -// not discriminated further. Future adoption of this method for other use -// should be aware of this limitation. The implementation can be extended if -// there is such a need. -// For Indic, Southeast Asian scripts and some other scripts between -// U+0700 and U+16FF, it's extended to the third level. -unsigned findCharUnicodeRange(UChar32 ch) { - if (ch >= 0xFFFF) - return 0; - - unsigned range; - - // search the first table - range = gUnicodeSubrangeTable[0][ch >> 12]; - - if (range < cRangeTableBase) - // we try to get a specific range - return range; - - // otherwise, we have one more table to look at - range = gUnicodeSubrangeTable[range - cRangeTableBase][(ch & 0x0f00) >> 8]; - if (range < cRangeTableBase) - return range; - if (range < cRangeTertiaryTable) - return gUnicodeSubrangeTable[range - cRangeTableBase][(ch & 0x00f0) >> 4]; - - // Yet another table to look at : U+0700 - U+16FF : 128 code point blocks - return gUnicodeTertiaryRangeTable[(ch - 0x0700) >> 7]; -} - -const char* langGroupFromUnicodeRange(unsigned char unicodeRange) { - if (cRangeSpecificItemNum > unicodeRange) - return gUnicodeRangeToLangGroupTable[unicodeRange]; - return 0; -} - -} // namespace blink diff --git a/sky/engine/platform/text/UnicodeRange.h b/sky/engine/platform/text/UnicodeRange.h deleted file mode 100644 index dc4e9f9a9ece0..0000000000000 --- a/sky/engine/platform/text/UnicodeRange.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2007 Apple Computer, Inc. - * - * Portions are Copyright (C) 1998 Netscape Communications Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Alternatively, the contents of this file may be used under the terms - * of either the Mozilla Public License Version 1.1, found at - * http://www.mozilla.org/MPL/ (the "MPL") or the GNU General Public - * License Version 2.0, found at http://www.fsf.org/copyleft/gpl.html - * (the "GPL"), in which case the provisions of the MPL or the GPL are - * applicable instead of those above. If you wish to allow use of your - * version of this file only under the terms of one of those two - * licenses (the MPL or the GPL) and not to allow others to use your - * version of this file under the LGPL, indicate your decision by - * deletingthe provisions above and replace them with the notice and - * other provisions required by the MPL or the GPL, as the case may be. - * If you do not delete the provisions above, a recipient may use your - * version of this file under any of the LGPL, the MPL or the GPL. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_UNICODERANGE_H_ -#define SKY_ENGINE_PLATFORM_TEXT_UNICODERANGE_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -// The following constants define unicode subranges -// values below cRangeNum must be continuous so that we can map to -// a lang group directly. -// All ranges we care about should fit within 32 bits. - -// Frequently used range definitions -const unsigned char cRangeCyrillic = 0; -const unsigned char cRangeGreek = 1; -const unsigned char cRangeTurkish = 2; -const unsigned char cRangeHebrew = 3; -const unsigned char cRangeArabic = 4; -const unsigned char cRangeBaltic = 5; -const unsigned char cRangeThai = 6; -const unsigned char cRangeKorean = 7; -const unsigned char cRangeJapanese = 8; -const unsigned char cRangeSChinese = 9; -const unsigned char cRangeTChinese = 10; -const unsigned char cRangeDevanagari = 11; -const unsigned char cRangeTamil = 12; -const unsigned char cRangeArmenian = 13; -const unsigned char cRangeBengali = 14; -const unsigned char cRangeCanadian = 15; -const unsigned char cRangeEthiopic = 16; -const unsigned char cRangeGeorgian = 17; -const unsigned char cRangeGujarati = 18; -const unsigned char cRangeGurmukhi = 19; -const unsigned char cRangeKhmer = 20; -const unsigned char cRangeMalayalam = 21; - -const unsigned char cRangeSpecificItemNum = 22; - -// range/rangeSet grow to this place 22-29 - -const unsigned char cRangeSetStart = - 30; // range set definition starts from here -const unsigned char cRangeSetLatin = 30; -const unsigned char cRangeSetCJK = 31; -const unsigned char cRangeSetEnd = 31; // range set definition ends here - -// less frequently used range definition -const unsigned char cRangeSurrogate = 32; -const unsigned char cRangePrivate = 33; -const unsigned char cRangeMisc = 34; -const unsigned char cRangeUnassigned = 35; -const unsigned char cRangeSyriac = 36; -const unsigned char cRangeThaana = 37; -const unsigned char cRangeOriya = 38; -const unsigned char cRangeTelugu = 39; -const unsigned char cRangeKannada = 40; -const unsigned char cRangeSinhala = 41; -const unsigned char cRangeLao = 42; -const unsigned char cRangeTibetan = 43; -const unsigned char cRangeMyanmar = 44; -const unsigned char cRangeCherokee = 45; -const unsigned char cRangeOghamRunic = 46; -const unsigned char cRangeMongolian = 47; -const unsigned char cRangeMathOperators = 48; -const unsigned char cRangeMiscTechnical = 49; -const unsigned char cRangeControlOpticalEnclose = 50; -const unsigned char cRangeBoxBlockGeometrics = 51; -const unsigned char cRangeMiscSymbols = 52; -const unsigned char cRangeDingbats = 53; -const unsigned char cRangeBraillePattern = 54; -const unsigned char cRangeYi = 55; -const unsigned char cRangeCombiningDiacriticalMarks = 56; -const unsigned char cRangeSpecials = 57; - -const unsigned char cRangeTableBase = - 128; // values over 127 are reserved for internal use only -const unsigned char cRangeTertiaryTable = 145; // leave room for 16 subtable - // indices (cRangeTableBase + 1 - // .. cRangeTableBase + 16) - -PLATFORM_EXPORT unsigned findCharUnicodeRange(UChar32); -PLATFORM_EXPORT const char* langGroupFromUnicodeRange( - unsigned char unicodeRange); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_UNICODERANGE_H_ diff --git a/sky/engine/platform/text/UnicodeUtilities.cpp b/sky/engine/platform/text/UnicodeUtilities.cpp deleted file mode 100644 index 715e0f3bcfc64..0000000000000 --- a/sky/engine/platform/text/UnicodeUtilities.cpp +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All - * rights reserved. - * Copyright (C) 2005 Alexey Proskuryakov. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/text/UnicodeUtilities.h" - -#include -#include "flutter/sky/engine/wtf/text/StringBuffer.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -using namespace WTF::Unicode; - -namespace blink { - -enum VoicedSoundMarkType { - NoVoicedSoundMark, - VoicedSoundMark, - SemiVoicedSoundMark -}; - -template -static inline CharType foldQuoteMarkOrSoftHyphen(CharType c) { - switch (static_cast(c)) { - case hebrewPunctuationGershayim: - case leftDoubleQuotationMark: - case rightDoubleQuotationMark: - return '"'; - case hebrewPunctuationGeresh: - case leftSingleQuotationMark: - case rightSingleQuotationMark: - return '\''; - case softHyphen: - // Replace soft hyphen with an ignorable character so that their presence - // or absence will not affect string comparison. - return 0; - default: - return c; - } -} - -void foldQuoteMarksAndSoftHyphens(UChar* data, size_t length) { - for (size_t i = 0; i < length; ++i) - data[i] = foldQuoteMarkOrSoftHyphen(data[i]); -} - -void foldQuoteMarksAndSoftHyphens(String& s) { - s.replace(hebrewPunctuationGeresh, '\''); - s.replace(hebrewPunctuationGershayim, '"'); - s.replace(leftDoubleQuotationMark, '"'); - s.replace(leftSingleQuotationMark, '\''); - s.replace(rightDoubleQuotationMark, '"'); - s.replace(rightSingleQuotationMark, '\''); - // Replace soft hyphen with an ignorable character so that their presence or - // absence will not affect string comparison. - s.replace(softHyphen, 0); -} - -static bool isNonLatin1Separator(UChar32 character) { - ASSERT_ARG(character, character >= 256); - - return U_GET_GC_MASK(character) & - (U_GC_S_MASK | U_GC_P_MASK | U_GC_Z_MASK | U_GC_CF_MASK); -} - -bool isSeparator(UChar32 character) { - static const bool latin1SeparatorTable[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, // space ! " # $ % & ' ( ) * + , - - // . / - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, // : ; < = > ? - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, // @ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, - 1, // [ \ ] ^ _ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, // ` - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, - 0, // { | } ~ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0}; - - if (character < 256) - return latin1SeparatorTable[character]; - - return isNonLatin1Separator(character); -} - -// ICU's search ignores the distinction between small kana letters and ones -// that are not small, and also characters that differ only in the voicing -// marks when considering only primary collation strength differences. -// This is not helpful for end users, since these differences make words -// distinct, so for our purposes we need these to be considered. -// The Unicode folks do not think the collation algorithm should be -// changed. To work around this, we would like to tailor the ICU searcher, -// but we can't get that to work yet. So instead, we check for cases where -// these differences occur, and skip those matches. - -// We refer to the above technique as the "kana workaround". The next few -// functions are helper functinos for the kana workaround. - -bool isKanaLetter(UChar character) { - // Hiragana letters. - if (character >= 0x3041 && character <= 0x3096) - return true; - - // Katakana letters. - if (character >= 0x30A1 && character <= 0x30FA) - return true; - if (character >= 0x31F0 && character <= 0x31FF) - return true; - - // Halfwidth katakana letters. - if (character >= 0xFF66 && character <= 0xFF9D && character != 0xFF70) - return true; - - return false; -} - -bool isSmallKanaLetter(UChar character) { - ASSERT(isKanaLetter(character)); - - switch (character) { - case 0x3041: // HIRAGANA LETTER SMALL A - case 0x3043: // HIRAGANA LETTER SMALL I - case 0x3045: // HIRAGANA LETTER SMALL U - case 0x3047: // HIRAGANA LETTER SMALL E - case 0x3049: // HIRAGANA LETTER SMALL O - case 0x3063: // HIRAGANA LETTER SMALL TU - case 0x3083: // HIRAGANA LETTER SMALL YA - case 0x3085: // HIRAGANA LETTER SMALL YU - case 0x3087: // HIRAGANA LETTER SMALL YO - case 0x308E: // HIRAGANA LETTER SMALL WA - case 0x3095: // HIRAGANA LETTER SMALL KA - case 0x3096: // HIRAGANA LETTER SMALL KE - case 0x30A1: // KATAKANA LETTER SMALL A - case 0x30A3: // KATAKANA LETTER SMALL I - case 0x30A5: // KATAKANA LETTER SMALL U - case 0x30A7: // KATAKANA LETTER SMALL E - case 0x30A9: // KATAKANA LETTER SMALL O - case 0x30C3: // KATAKANA LETTER SMALL TU - case 0x30E3: // KATAKANA LETTER SMALL YA - case 0x30E5: // KATAKANA LETTER SMALL YU - case 0x30E7: // KATAKANA LETTER SMALL YO - case 0x30EE: // KATAKANA LETTER SMALL WA - case 0x30F5: // KATAKANA LETTER SMALL KA - case 0x30F6: // KATAKANA LETTER SMALL KE - case 0x31F0: // KATAKANA LETTER SMALL KU - case 0x31F1: // KATAKANA LETTER SMALL SI - case 0x31F2: // KATAKANA LETTER SMALL SU - case 0x31F3: // KATAKANA LETTER SMALL TO - case 0x31F4: // KATAKANA LETTER SMALL NU - case 0x31F5: // KATAKANA LETTER SMALL HA - case 0x31F6: // KATAKANA LETTER SMALL HI - case 0x31F7: // KATAKANA LETTER SMALL HU - case 0x31F8: // KATAKANA LETTER SMALL HE - case 0x31F9: // KATAKANA LETTER SMALL HO - case 0x31FA: // KATAKANA LETTER SMALL MU - case 0x31FB: // KATAKANA LETTER SMALL RA - case 0x31FC: // KATAKANA LETTER SMALL RI - case 0x31FD: // KATAKANA LETTER SMALL RU - case 0x31FE: // KATAKANA LETTER SMALL RE - case 0x31FF: // KATAKANA LETTER SMALL RO - case 0xFF67: // HALFWIDTH KATAKANA LETTER SMALL A - case 0xFF68: // HALFWIDTH KATAKANA LETTER SMALL I - case 0xFF69: // HALFWIDTH KATAKANA LETTER SMALL U - case 0xFF6A: // HALFWIDTH KATAKANA LETTER SMALL E - case 0xFF6B: // HALFWIDTH KATAKANA LETTER SMALL O - case 0xFF6C: // HALFWIDTH KATAKANA LETTER SMALL YA - case 0xFF6D: // HALFWIDTH KATAKANA LETTER SMALL YU - case 0xFF6E: // HALFWIDTH KATAKANA LETTER SMALL YO - case 0xFF6F: // HALFWIDTH KATAKANA LETTER SMALL TU - return true; - } - return false; -} - -static inline VoicedSoundMarkType composedVoicedSoundMark(UChar character) { - ASSERT(isKanaLetter(character)); - - switch (character) { - case 0x304C: // HIRAGANA LETTER GA - case 0x304E: // HIRAGANA LETTER GI - case 0x3050: // HIRAGANA LETTER GU - case 0x3052: // HIRAGANA LETTER GE - case 0x3054: // HIRAGANA LETTER GO - case 0x3056: // HIRAGANA LETTER ZA - case 0x3058: // HIRAGANA LETTER ZI - case 0x305A: // HIRAGANA LETTER ZU - case 0x305C: // HIRAGANA LETTER ZE - case 0x305E: // HIRAGANA LETTER ZO - case 0x3060: // HIRAGANA LETTER DA - case 0x3062: // HIRAGANA LETTER DI - case 0x3065: // HIRAGANA LETTER DU - case 0x3067: // HIRAGANA LETTER DE - case 0x3069: // HIRAGANA LETTER DO - case 0x3070: // HIRAGANA LETTER BA - case 0x3073: // HIRAGANA LETTER BI - case 0x3076: // HIRAGANA LETTER BU - case 0x3079: // HIRAGANA LETTER BE - case 0x307C: // HIRAGANA LETTER BO - case 0x3094: // HIRAGANA LETTER VU - case 0x30AC: // KATAKANA LETTER GA - case 0x30AE: // KATAKANA LETTER GI - case 0x30B0: // KATAKANA LETTER GU - case 0x30B2: // KATAKANA LETTER GE - case 0x30B4: // KATAKANA LETTER GO - case 0x30B6: // KATAKANA LETTER ZA - case 0x30B8: // KATAKANA LETTER ZI - case 0x30BA: // KATAKANA LETTER ZU - case 0x30BC: // KATAKANA LETTER ZE - case 0x30BE: // KATAKANA LETTER ZO - case 0x30C0: // KATAKANA LETTER DA - case 0x30C2: // KATAKANA LETTER DI - case 0x30C5: // KATAKANA LETTER DU - case 0x30C7: // KATAKANA LETTER DE - case 0x30C9: // KATAKANA LETTER DO - case 0x30D0: // KATAKANA LETTER BA - case 0x30D3: // KATAKANA LETTER BI - case 0x30D6: // KATAKANA LETTER BU - case 0x30D9: // KATAKANA LETTER BE - case 0x30DC: // KATAKANA LETTER BO - case 0x30F4: // KATAKANA LETTER VU - case 0x30F7: // KATAKANA LETTER VA - case 0x30F8: // KATAKANA LETTER VI - case 0x30F9: // KATAKANA LETTER VE - case 0x30FA: // KATAKANA LETTER VO - return VoicedSoundMark; - case 0x3071: // HIRAGANA LETTER PA - case 0x3074: // HIRAGANA LETTER PI - case 0x3077: // HIRAGANA LETTER PU - case 0x307A: // HIRAGANA LETTER PE - case 0x307D: // HIRAGANA LETTER PO - case 0x30D1: // KATAKANA LETTER PA - case 0x30D4: // KATAKANA LETTER PI - case 0x30D7: // KATAKANA LETTER PU - case 0x30DA: // KATAKANA LETTER PE - case 0x30DD: // KATAKANA LETTER PO - return SemiVoicedSoundMark; - } - return NoVoicedSoundMark; -} - -static inline bool isCombiningVoicedSoundMark(UChar character) { - switch (character) { - case 0x3099: // COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK - case 0x309A: // COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK - return true; - } - return false; -} - -bool containsKanaLetters(const String& pattern) { - const unsigned length = pattern.length(); - for (unsigned i = 0; i < length; ++i) { - if (isKanaLetter(pattern[i])) - return true; - } - return false; -} - -void normalizeCharactersIntoNFCForm(const UChar* characters, - unsigned length, - Vector& buffer) { - ASSERT(length); - - buffer.resize(length); - - UErrorCode status = U_ZERO_ERROR; - size_t bufferSize = unorm_normalize(characters, length, UNORM_NFC, 0, - buffer.data(), length, &status); - ASSERT(status == U_ZERO_ERROR || status == U_STRING_NOT_TERMINATED_WARNING || - status == U_BUFFER_OVERFLOW_ERROR); - ASSERT(bufferSize); - - buffer.resize(bufferSize); - - if (status == U_ZERO_ERROR || status == U_STRING_NOT_TERMINATED_WARNING) - return; - - status = U_ZERO_ERROR; - unorm_normalize(characters, length, UNORM_NFC, 0, buffer.data(), bufferSize, - &status); - ASSERT(status == U_STRING_NOT_TERMINATED_WARNING); -} - -// This function returns kNotFound if |first| and |second| contain different -// Kana letters. If |first| and |second| contain the same Kana letter then -// function returns offset in characters from |first|. Pointers to both strings -// increase simultaneously so so it is possible to use one offset value. -static inline size_t compareKanaLetterAndComposedVoicedSoundMarks( - const UChar* first, - const UChar* firstEnd, - const UChar* second, - const UChar* secondEnd) { - const UChar* start = first; - // Check for differences in the kana letter character itself. - if (isSmallKanaLetter(*first) != isSmallKanaLetter(*second)) - return kNotFound; - if (composedVoicedSoundMark(*first) != composedVoicedSoundMark(*second)) - return kNotFound; - ++first; - ++second; - - // Check for differences in combining voiced sound marks found after the - // letter. - while (true) { - const bool secondIsNotSoundMark = - second == secondEnd || !isCombiningVoicedSoundMark(*second); - if (first == firstEnd || !isCombiningVoicedSoundMark(*first)) { - return secondIsNotSoundMark ? first - start : kNotFound; - } - if (secondIsNotSoundMark) - return kNotFound; - if (*first != *second) - return kNotFound; - ++first; - ++second; - } -} - -bool checkOnlyKanaLettersInStrings(const UChar* firstData, - unsigned firstLength, - const UChar* secondData, - unsigned secondLength) { - const UChar* a = firstData; - const UChar* aEnd = firstData + firstLength; - - const UChar* b = secondData; - const UChar* bEnd = secondData + secondLength; - while (true) { - // Skip runs of non-kana-letter characters. This is necessary so we can - // correctly handle strings where the |firstData| and |secondData| have - // different-length runs of characters that match, while still double - // checking the correctness of matches of kana letters with other kana - // letters. - while (a != aEnd && !isKanaLetter(*a)) - ++a; - while (b != bEnd && !isKanaLetter(*b)) - ++b; - - // If we reached the end of either the target or the match, we should have - // reached the end of both; both should have the same number of kana - // letters. - if (a == aEnd || b == bEnd) { - return a == aEnd && b == bEnd; - } - - // Check that single Kana letters in |a| and |b| are the same. - const size_t offset = - compareKanaLetterAndComposedVoicedSoundMarks(a, aEnd, b, bEnd); - if (offset == kNotFound) - return false; - - // Update values of |a| and |b| after comparing. - a += offset; - b += offset; - } -} - -bool checkKanaStringsEqual(const UChar* firstData, - unsigned firstLength, - const UChar* secondData, - unsigned secondLength) { - const UChar* a = firstData; - const UChar* aEnd = firstData + firstLength; - - const UChar* b = secondData; - const UChar* bEnd = secondData + secondLength; - while (true) { - // Check for non-kana-letter characters. - while (a != aEnd && !isKanaLetter(*a) && b != bEnd && !isKanaLetter(*b)) { - if (*a++ != *b++) - return false; - } - - // If we reached the end of either the target or the match, we should have - // reached the end of both; both should have the same number of kana - // letters. - if (a == aEnd || b == bEnd) { - return a == aEnd && b == bEnd; - } - - if (isKanaLetter(*a) != isKanaLetter(*b)) - return false; - - // Check that single Kana letters in |a| and |b| are the same. - const size_t offset = - compareKanaLetterAndComposedVoicedSoundMarks(a, aEnd, b, bEnd); - if (offset == kNotFound) - return false; - - // Update values of |a| and |b| after comparing. - a += offset; - b += offset; - } -} - -} // namespace blink diff --git a/sky/engine/platform/text/UnicodeUtilities.h b/sky/engine/platform/text/UnicodeUtilities.h deleted file mode 100644 index 4ea99067c75b5..0000000000000 --- a/sky/engine/platform/text/UnicodeUtilities.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TEXT_UNICODEUTILITIES_H_ -#define SKY_ENGINE_PLATFORM_TEXT_UNICODEUTILITIES_H_ - -#include "flutter/sky/engine/platform/PlatformExport.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace blink { - -PLATFORM_EXPORT bool isSeparator(UChar32); -PLATFORM_EXPORT bool isKanaLetter(UChar character); -PLATFORM_EXPORT bool containsKanaLetters(const String&); -PLATFORM_EXPORT void normalizeCharactersIntoNFCForm(const UChar* characters, - unsigned length, - Vector& buffer); -PLATFORM_EXPORT void foldQuoteMarksAndSoftHyphens(UChar* data, size_t length); -PLATFORM_EXPORT void foldQuoteMarksAndSoftHyphens(String&); -PLATFORM_EXPORT bool checkOnlyKanaLettersInStrings(const UChar* firstData, - unsigned firstLength, - const UChar* secondData, - unsigned secondLength); -PLATFORM_EXPORT bool checkKanaStringsEqual(const UChar* firstData, - unsigned firstLength, - const UChar* secondData, - unsigned secondLength); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TEXT_UNICODEUTILITIES_H_ diff --git a/sky/engine/platform/text/UnicodeUtilitiesTest.cpp b/sky/engine/platform/text/UnicodeUtilitiesTest.cpp deleted file mode 100644 index d666682b6d537..0000000000000 --- a/sky/engine/platform/text/UnicodeUtilitiesTest.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2013 Yandex LLC. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Yandex LLC nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/text/UnicodeUtilities.h" - -#include -#include -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -using namespace blink; - -namespace { - -static const UChar32 kMaxLatinCharCount = 256; - -static bool isTestFirstAndLastCharsInCategoryFailed = false; -UBool U_CALLCONV testFirstAndLastCharsInCategory(const void* context, - UChar32 start, - UChar32 limit, - UCharCategory type) { - if (start >= kMaxLatinCharCount && - U_MASK(type) & (U_GC_S_MASK | U_GC_P_MASK | U_GC_Z_MASK | U_GC_CF_MASK) && - (!isSeparator(start) || !isSeparator(limit - 1))) { - isTestFirstAndLastCharsInCategoryFailed = true; - - // Break enumeration process - return 0; - } - - return 1; -} - -TEST(WebCoreUnicodeUnit, Separators) { - static const bool latinSeparatorTable[kMaxLatinCharCount] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, // space ! " # $ % & ' ( ) * + , - . - // / - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, // : ; < = > ? - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, // @ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, - 1, // [ \ ] ^ _ - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, // ` - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, - 0, // { | } ~ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0}; - - for (UChar32 character = 0; character < kMaxLatinCharCount; ++character) { - EXPECT_EQ(isSeparator(character), latinSeparatorTable[character]); - } - - isTestFirstAndLastCharsInCategoryFailed = false; - u_enumCharTypes(&testFirstAndLastCharsInCategory, 0); - EXPECT_FALSE(isTestFirstAndLastCharsInCategoryFailed); -} - -TEST(WebCoreUnicodeUnit, KanaLetters) { - // Non Kana symbols - for (UChar character = 0; character < 0x3041; ++character) - EXPECT_FALSE(isKanaLetter(character)); - - // Hiragana letters. - for (UChar character = 0x3041; character <= 0x3096; ++character) - EXPECT_TRUE(isKanaLetter(character)); - - // Katakana letters. - for (UChar character = 0x30A1; character <= 0x30FA; ++character) - EXPECT_TRUE(isKanaLetter(character)); -} - -TEST(WebCoreUnicodeUnit, ContainsKanaLetters) { - // Non Kana symbols - String nonKanaString; - for (UChar character = 0; character < 0x3041; ++character) - nonKanaString.append(character); - EXPECT_FALSE(containsKanaLetters(nonKanaString)); - - // Hiragana letters. - for (UChar character = 0x3041; character <= 0x3096; ++character) { - String str(nonKanaString); - str.append(character); - EXPECT_TRUE(containsKanaLetters(str)); - } - - // Katakana letters. - for (UChar character = 0x30A1; character <= 0x30FA; ++character) { - String str(nonKanaString); - str.append(character); - EXPECT_TRUE(containsKanaLetters(str)); - } -} - -TEST(WebCoreUnicodeUnit, FoldQuoteMarkOrSoftHyphenTest) { - const UChar charactersToFold[] = {hebrewPunctuationGershayim, - leftDoubleQuotationMark, - rightDoubleQuotationMark, - hebrewPunctuationGeresh, - leftSingleQuotationMark, - rightSingleQuotationMark, - softHyphen}; - - String stringToFold(charactersToFold, WTF_ARRAY_LENGTH(charactersToFold)); - Vector buffer; - stringToFold.appendTo(buffer); - - foldQuoteMarksAndSoftHyphens(stringToFold); - - const String foldedString("\"\"\"\'\'\'\0", - WTF_ARRAY_LENGTH(charactersToFold)); - EXPECT_EQ(stringToFold, foldedString); - - foldQuoteMarksAndSoftHyphens(buffer.data(), buffer.size()); - EXPECT_EQ(String(buffer), foldedString); -} - -TEST(WebCoreUnicodeUnit, OnlyKanaLettersEqualityTest) { - const UChar nonKanaString1[] = {'a', 'b', 'c', 'd'}; - const UChar nonKanaString2[] = {'e', 'f', 'g'}; - - // Check that non-Kana letters will be skipped. - EXPECT_TRUE(checkOnlyKanaLettersInStrings( - nonKanaString1, WTF_ARRAY_LENGTH(nonKanaString1), nonKanaString2, - WTF_ARRAY_LENGTH(nonKanaString2))); - - const UChar kanaString[] = {'e', 'f', 'g', 0x3041}; - EXPECT_FALSE(checkOnlyKanaLettersInStrings( - kanaString, WTF_ARRAY_LENGTH(kanaString), nonKanaString2, - WTF_ARRAY_LENGTH(nonKanaString2))); - - // Compare with self. - EXPECT_TRUE( - checkOnlyKanaLettersInStrings(kanaString, WTF_ARRAY_LENGTH(kanaString), - kanaString, WTF_ARRAY_LENGTH(kanaString))); - - UChar voicedKanaString1[] = {0x3042, 0x3099}; - UChar voicedKanaString2[] = {0x3042, 0x309A}; - - // Comparing strings with different sound marks should fail. - EXPECT_FALSE(checkOnlyKanaLettersInStrings( - voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, - WTF_ARRAY_LENGTH(voicedKanaString2))); - - // Now strings will be the same. - voicedKanaString2[1] = 0x3099; - EXPECT_TRUE(checkOnlyKanaLettersInStrings( - voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, - WTF_ARRAY_LENGTH(voicedKanaString2))); - - voicedKanaString2[0] = 0x3043; - EXPECT_FALSE(checkOnlyKanaLettersInStrings( - voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, - WTF_ARRAY_LENGTH(voicedKanaString2))); -} - -TEST(WebCoreUnicodeUnit, StringsWithKanaLettersTest) { - const UChar nonKanaString1[] = {'a', 'b', 'c'}; - const UChar nonKanaString2[] = {'a', 'b', 'c'}; - - // Check that non-Kana letters will be compared. - EXPECT_TRUE( - checkKanaStringsEqual(nonKanaString1, WTF_ARRAY_LENGTH(nonKanaString1), - nonKanaString2, WTF_ARRAY_LENGTH(nonKanaString2))); - - const UChar kanaString[] = {'a', 'b', 'c', 0x3041}; - EXPECT_FALSE(checkKanaStringsEqual(kanaString, WTF_ARRAY_LENGTH(kanaString), - nonKanaString2, - WTF_ARRAY_LENGTH(nonKanaString2))); - - // Compare with self. - EXPECT_TRUE(checkKanaStringsEqual(kanaString, WTF_ARRAY_LENGTH(kanaString), - kanaString, WTF_ARRAY_LENGTH(kanaString))); - - const UChar kanaString2[] = {'x', 'y', 'z', 0x3041}; - // Comparing strings with different non-Kana letters should fail. - EXPECT_FALSE(checkKanaStringsEqual(kanaString, WTF_ARRAY_LENGTH(kanaString), - kanaString2, - WTF_ARRAY_LENGTH(kanaString2))); - - const UChar kanaString3[] = {'a', 'b', 'c', 0x3042, 0x3099, 'm', 'n', 'o'}; - // Check that non-Kana letters after Kana letters will be compared. - EXPECT_TRUE(checkKanaStringsEqual(kanaString3, WTF_ARRAY_LENGTH(kanaString3), - kanaString3, - WTF_ARRAY_LENGTH(kanaString3))); - - const UChar kanaString4[] = {'a', 'b', 'c', 0x3042, 0x3099, - 'm', 'n', 'o', 'p'}; - // And now comparing should fail. - EXPECT_FALSE(checkKanaStringsEqual(kanaString3, WTF_ARRAY_LENGTH(kanaString3), - kanaString4, - WTF_ARRAY_LENGTH(kanaString4))); - - UChar voicedKanaString1[] = {0x3042, 0x3099}; - UChar voicedKanaString2[] = {0x3042, 0x309A}; - - // Comparing strings with different sound marks should fail. - EXPECT_FALSE(checkKanaStringsEqual( - voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, - WTF_ARRAY_LENGTH(voicedKanaString2))); - - // Now strings will be the same. - voicedKanaString2[1] = 0x3099; - EXPECT_TRUE(checkKanaStringsEqual( - voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, - WTF_ARRAY_LENGTH(voicedKanaString2))); - - voicedKanaString2[0] = 0x3043; - EXPECT_FALSE(checkKanaStringsEqual( - voicedKanaString1, WTF_ARRAY_LENGTH(voicedKanaString1), voicedKanaString2, - WTF_ARRAY_LENGTH(voicedKanaString2))); -} - -} // namespace diff --git a/sky/engine/platform/transforms/AffineTransform.cpp b/sky/engine/platform/transforms/AffineTransform.cpp deleted file mode 100644 index afd101708a36b..0000000000000 --- a/sky/engine/platform/transforms/AffineTransform.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* - * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - * 2010 Dirk Schulze - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" - -#include "flutter/sky/engine/platform/FloatConversion.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -AffineTransform::AffineTransform() { - setMatrix(1, 0, 0, 1, 0, 0); -} - -AffineTransform::AffineTransform(double a, - double b, - double c, - double d, - double e, - double f) { - setMatrix(a, b, c, d, e, f); -} - -void AffineTransform::makeIdentity() { - setMatrix(1, 0, 0, 1, 0, 0); -} - -void AffineTransform::setMatrix(double a, - double b, - double c, - double d, - double e, - double f) { - m_transform[0] = a; - m_transform[1] = b; - m_transform[2] = c; - m_transform[3] = d; - m_transform[4] = e; - m_transform[5] = f; -} - -bool AffineTransform::isIdentity() const { - return (m_transform[0] == 1 && m_transform[1] == 0 && m_transform[2] == 0 && - m_transform[3] == 1 && m_transform[4] == 0 && m_transform[5] == 0); -} - -double AffineTransform::xScale() const { - return sqrt(m_transform[0] * m_transform[0] + - m_transform[1] * m_transform[1]); -} - -double AffineTransform::yScale() const { - return sqrt(m_transform[2] * m_transform[2] + - m_transform[3] * m_transform[3]); -} - -double AffineTransform::det() const { - return m_transform[0] * m_transform[3] - m_transform[1] * m_transform[2]; -} - -bool AffineTransform::isInvertible() const { - return det() != 0.0; -} - -AffineTransform AffineTransform::inverse() const { - double determinant = det(); - if (determinant == 0.0) - return AffineTransform(); - - AffineTransform result; - if (isIdentityOrTranslation()) { - result.m_transform[4] = -m_transform[4]; - result.m_transform[5] = -m_transform[5]; - return result; - } - - result.m_transform[0] = m_transform[3] / determinant; - result.m_transform[1] = -m_transform[1] / determinant; - result.m_transform[2] = -m_transform[2] / determinant; - result.m_transform[3] = m_transform[0] / determinant; - result.m_transform[4] = - (m_transform[2] * m_transform[5] - m_transform[3] * m_transform[4]) / - determinant; - result.m_transform[5] = - (m_transform[1] * m_transform[4] - m_transform[0] * m_transform[5]) / - determinant; - - return result; -} - -// Multiplies this AffineTransform by the provided AffineTransform - i.e. -// this = this * other; -AffineTransform& AffineTransform::multiply(const AffineTransform& other) { - AffineTransform trans; - - trans.m_transform[0] = other.m_transform[0] * m_transform[0] + - other.m_transform[1] * m_transform[2]; - trans.m_transform[1] = other.m_transform[0] * m_transform[1] + - other.m_transform[1] * m_transform[3]; - trans.m_transform[2] = other.m_transform[2] * m_transform[0] + - other.m_transform[3] * m_transform[2]; - trans.m_transform[3] = other.m_transform[2] * m_transform[1] + - other.m_transform[3] * m_transform[3]; - trans.m_transform[4] = other.m_transform[4] * m_transform[0] + - other.m_transform[5] * m_transform[2] + m_transform[4]; - trans.m_transform[5] = other.m_transform[4] * m_transform[1] + - other.m_transform[5] * m_transform[3] + m_transform[5]; - - setMatrix(trans.m_transform); - return *this; -} - -AffineTransform& AffineTransform::rotate(double a) { - // angle is in degree. Switch to radian - return rotateRadians(deg2rad(a)); -} - -AffineTransform& AffineTransform::rotateRadians(double a) { - double cosAngle = cos(a); - double sinAngle = sin(a); - AffineTransform rot(cosAngle, sinAngle, -sinAngle, cosAngle, 0, 0); - - multiply(rot); - return *this; -} - -AffineTransform& AffineTransform::scale(double s) { - return scale(s, s); -} - -AffineTransform& AffineTransform::scale(double sx, double sy) { - m_transform[0] *= sx; - m_transform[1] *= sx; - m_transform[2] *= sy; - m_transform[3] *= sy; - return *this; -} - -// *this = *this * translation -AffineTransform& AffineTransform::translate(double tx, double ty) { - if (isIdentityOrTranslation()) { - m_transform[4] += tx; - m_transform[5] += ty; - return *this; - } - - m_transform[4] += tx * m_transform[0] + ty * m_transform[2]; - m_transform[5] += tx * m_transform[1] + ty * m_transform[3]; - return *this; -} - -AffineTransform& AffineTransform::scaleNonUniform(double sx, double sy) { - return scale(sx, sy); -} - -AffineTransform& AffineTransform::rotateFromVector(double x, double y) { - return rotateRadians(atan2(y, x)); -} - -AffineTransform& AffineTransform::flipX() { - return scale(-1, 1); -} - -AffineTransform& AffineTransform::flipY() { - return scale(1, -1); -} - -AffineTransform& AffineTransform::shear(double sx, double sy) { - double a = m_transform[0]; - double b = m_transform[1]; - - m_transform[0] += sy * m_transform[2]; - m_transform[1] += sy * m_transform[3]; - m_transform[2] += sx * a; - m_transform[3] += sx * b; - - return *this; -} - -AffineTransform& AffineTransform::skew(double angleX, double angleY) { - return shear(tan(deg2rad(angleX)), tan(deg2rad(angleY))); -} - -AffineTransform& AffineTransform::skewX(double angle) { - return shear(tan(deg2rad(angle)), 0); -} - -AffineTransform& AffineTransform::skewY(double angle) { - return shear(0, tan(deg2rad(angle))); -} - -AffineTransform makeMapBetweenRects(const FloatRect& source, - const FloatRect& dest) { - AffineTransform transform; - transform.translate(dest.x() - source.x(), dest.y() - source.y()); - transform.scale(dest.width() / source.width(), - dest.height() / source.height()); - return transform; -} - -void AffineTransform::map(double x, double y, double& x2, double& y2) const { - x2 = (m_transform[0] * x + m_transform[2] * y + m_transform[4]); - y2 = (m_transform[1] * x + m_transform[3] * y + m_transform[5]); -} - -IntPoint AffineTransform::mapPoint(const IntPoint& point) const { - double x2, y2; - map(point.x(), point.y(), x2, y2); - - // Round the point. - return IntPoint(lround(x2), lround(y2)); -} - -FloatPoint AffineTransform::mapPoint(const FloatPoint& point) const { - double x2, y2; - map(point.x(), point.y(), x2, y2); - - return FloatPoint(narrowPrecisionToFloat(x2), narrowPrecisionToFloat(y2)); -} - -IntSize AffineTransform::mapSize(const IntSize& size) const { - double width2 = size.width() * xScale(); - double height2 = size.height() * yScale(); - - return IntSize(lround(width2), lround(height2)); -} - -FloatSize AffineTransform::mapSize(const FloatSize& size) const { - double width2 = size.width() * xScale(); - double height2 = size.height() * yScale(); - - return FloatSize(narrowPrecisionToFloat(width2), - narrowPrecisionToFloat(height2)); -} - -IntRect AffineTransform::mapRect(const IntRect& rect) const { - return enclosingIntRect(mapRect(FloatRect(rect))); -} - -FloatRect AffineTransform::mapRect(const FloatRect& rect) const { - if (isIdentityOrTranslation()) { - if (!m_transform[4] && !m_transform[5]) - return rect; - - FloatRect mappedRect(rect); - mappedRect.move(narrowPrecisionToFloat(m_transform[4]), - narrowPrecisionToFloat(m_transform[5])); - return mappedRect; - } - - FloatQuad result; - result.setP1(mapPoint(rect.location())); - result.setP2(mapPoint(FloatPoint(rect.maxX(), rect.y()))); - result.setP3(mapPoint(FloatPoint(rect.maxX(), rect.maxY()))); - result.setP4(mapPoint(FloatPoint(rect.x(), rect.maxY()))); - return result.boundingBox(); -} - -FloatQuad AffineTransform::mapQuad(const FloatQuad& q) const { - if (isIdentityOrTranslation()) { - FloatQuad mappedQuad(q); - mappedQuad.move(narrowPrecisionToFloat(m_transform[4]), - narrowPrecisionToFloat(m_transform[5])); - return mappedQuad; - } - - FloatQuad result; - result.setP1(mapPoint(q.p1())); - result.setP2(mapPoint(q.p2())); - result.setP3(mapPoint(q.p3())); - result.setP4(mapPoint(q.p4())); - return result; -} - -TransformationMatrix AffineTransform::toTransformationMatrix() const { - return TransformationMatrix(m_transform[0], m_transform[1], m_transform[2], - m_transform[3], m_transform[4], m_transform[5]); -} - -bool AffineTransform::decompose(DecomposedType& decomp) const { - AffineTransform m(*this); - - // Compute scaling factors - double sx = xScale(); - double sy = yScale(); - - // Compute cross product of transformed unit vectors. If negative, - // one axis was flipped. - if (m.a() * m.d() - m.c() * m.b() < 0) { - // Flip axis with minimum unit vector dot product - if (m.a() < m.d()) - sx = -sx; - else - sy = -sy; - } - - // Remove scale from matrix - m.scale(1 / sx, 1 / sy); - - // Compute rotation - double angle = atan2(m.b(), m.a()); - - // Remove rotation from matrix - m.rotateRadians(-angle); - - // Return results - decomp.scaleX = sx; - decomp.scaleY = sy; - decomp.angle = angle; - decomp.remainderA = m.a(); - decomp.remainderB = m.b(); - decomp.remainderC = m.c(); - decomp.remainderD = m.d(); - decomp.translateX = m.e(); - decomp.translateY = m.f(); - - return true; -} - -void AffineTransform::recompose(const DecomposedType& decomp) { - this->setA(decomp.remainderA); - this->setB(decomp.remainderB); - this->setC(decomp.remainderC); - this->setD(decomp.remainderD); - this->setE(decomp.translateX); - this->setF(decomp.translateY); - this->rotateRadians(decomp.angle); - this->scale(decomp.scaleX, decomp.scaleY); -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/AffineTransform.h b/sky/engine/platform/transforms/AffineTransform.h deleted file mode 100644 index e323a2bcccbc6..0000000000000 --- a/sky/engine/platform/transforms/AffineTransform.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - * 2010 Dirk Schulze - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_AFFINETRANSFORM_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_AFFINETRANSFORM_H_ - -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" - -#include // for memcpy -#include "flutter/sky/engine/wtf/FastAllocBase.h" - -namespace blink { - -class FloatPoint; -class FloatQuad; -class FloatRect; -class IntPoint; -class IntRect; -class TransformationMatrix; - -class PLATFORM_EXPORT AffineTransform { - WTF_MAKE_FAST_ALLOCATED; - - public: - typedef double Transform[6]; - - AffineTransform(); - AffineTransform(double a, double b, double c, double d, double e, double f); - - void setMatrix(double a, double b, double c, double d, double e, double f); - - void map(double x, double y, double& x2, double& y2) const; - - // Rounds the mapped point to the nearest integer value. - IntPoint mapPoint(const IntPoint&) const; - - FloatPoint mapPoint(const FloatPoint&) const; - - IntSize mapSize(const IntSize&) const; - - FloatSize mapSize(const FloatSize&) const; - - // Rounds the resulting mapped rectangle out. This is helpful for bounding - // box computations but may not be what is wanted in other contexts. - IntRect mapRect(const IntRect&) const; - - FloatRect mapRect(const FloatRect&) const; - FloatQuad mapQuad(const FloatQuad&) const; - - bool isIdentity() const; - - double a() const { return m_transform[0]; } - void setA(double a) { m_transform[0] = a; } - double b() const { return m_transform[1]; } - void setB(double b) { m_transform[1] = b; } - double c() const { return m_transform[2]; } - void setC(double c) { m_transform[2] = c; } - double d() const { return m_transform[3]; } - void setD(double d) { m_transform[3] = d; } - double e() const { return m_transform[4]; } - void setE(double e) { m_transform[4] = e; } - double f() const { return m_transform[5]; } - void setF(double f) { m_transform[5] = f; } - - void makeIdentity(); - - AffineTransform& multiply(const AffineTransform& other); - AffineTransform& scale(double); - AffineTransform& scale(double sx, double sy); - AffineTransform& scaleNonUniform(double sx, double sy); - AffineTransform& rotate(double a); - AffineTransform& rotateRadians(double a); - AffineTransform& rotateFromVector(double x, double y); - AffineTransform& translate(double tx, double ty); - AffineTransform& shear(double sx, double sy); - AffineTransform& flipX(); - AffineTransform& flipY(); - AffineTransform& skew(double angleX, double angleY); - AffineTransform& skewX(double angle); - AffineTransform& skewY(double angle); - - double xScale() const; - double yScale() const; - - double det() const; - bool isInvertible() const; - AffineTransform inverse() const; - - TransformationMatrix toTransformationMatrix() const; - - bool isIdentityOrTranslation() const { - return m_transform[0] == 1 && m_transform[1] == 0 && m_transform[2] == 0 && - m_transform[3] == 1; - } - - bool isIdentityOrTranslationOrFlipped() const { - return m_transform[0] == 1 && m_transform[1] == 0 && m_transform[2] == 0 && - (m_transform[3] == 1 || m_transform[3] == -1); - } - - bool preservesAxisAlignment() const { - return (m_transform[1] == 0 && m_transform[2] == 0) || - (m_transform[0] == 0 && m_transform[3] == 0); - } - - bool operator==(const AffineTransform& m2) const { - return (m_transform[0] == m2.m_transform[0] && - m_transform[1] == m2.m_transform[1] && - m_transform[2] == m2.m_transform[2] && - m_transform[3] == m2.m_transform[3] && - m_transform[4] == m2.m_transform[4] && - m_transform[5] == m2.m_transform[5]); - } - - bool operator!=(const AffineTransform& other) const { - return !(*this == other); - } - - // *this = *this * t (i.e., a multRight) - AffineTransform& operator*=(const AffineTransform& t) { return multiply(t); } - - // result = *this * t (i.e., a multRight) - AffineTransform operator*(const AffineTransform& t) const { - AffineTransform result = *this; - result *= t; - return result; - } - - static AffineTransform translation(double x, double y) { - return AffineTransform(1, 0, 0, 1, x, y); - } - - // decompose the matrix into its component parts - typedef struct { - double scaleX, scaleY; - double angle; - double remainderA, remainderB, remainderC, remainderD; - double translateX, translateY; - } DecomposedType; - - bool decompose(DecomposedType&) const; - void recompose(const DecomposedType&); - - private: - void setMatrix(const Transform m) { - if (m && m != m_transform) - memcpy(m_transform, m, sizeof(Transform)); - } - - Transform m_transform; -}; - -PLATFORM_EXPORT AffineTransform makeMapBetweenRects(const FloatRect& source, - const FloatRect& dest); - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_AFFINETRANSFORM_H_ diff --git a/sky/engine/platform/transforms/IdentityTransformOperation.h b/sky/engine/platform/transforms/IdentityTransformOperation.h deleted file mode 100644 index 66977c9faa175..0000000000000 --- a/sky/engine/platform/transforms/IdentityTransformOperation.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_IDENTITYTRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_IDENTITYTRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" - -namespace blink { - -class PLATFORM_EXPORT IdentityTransformOperation : public TransformOperation { - public: - static PassRefPtr create() { - return adoptRef(new IdentityTransformOperation()); - } - - virtual bool canBlendWith(const TransformOperation& other) const { - return isSameType(other); - } - - private: - virtual bool isIdentity() const override final { return true; } - virtual OperationType type() const override { return Identity; } - - virtual bool operator==(const TransformOperation& o) const override { - return isSameType(o); - } - - virtual void apply(TransformationMatrix&, const FloatSize&) const override {} - - virtual PassRefPtr blend(const TransformOperation*, - double, - bool = false) override { - return this; - } - - IdentityTransformOperation() {} -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_IDENTITYTRANSFORMOPERATION_H_ diff --git a/sky/engine/platform/transforms/InterpolatedTransformOperation.cpp b/sky/engine/platform/transforms/InterpolatedTransformOperation.cpp deleted file mode 100644 index 978ac691f5194..0000000000000 --- a/sky/engine/platform/transforms/InterpolatedTransformOperation.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/transforms/InterpolatedTransformOperation.h" - -#include "flutter/sky/engine/platform/transforms/IdentityTransformOperation.h" - -namespace blink { - -bool InterpolatedTransformOperation::operator==( - const TransformOperation& o) const { - if (!isSameType(o)) - return false; - const InterpolatedTransformOperation* t = - static_cast(&o); - return progress == t->progress && from == t->from && to == t->to; -} - -void InterpolatedTransformOperation::apply( - TransformationMatrix& transform, - const FloatSize& borderBoxSize) const { - TransformationMatrix fromTransform; - TransformationMatrix toTransform; - from.apply(borderBoxSize, fromTransform); - to.apply(borderBoxSize, toTransform); - - toTransform.blend(fromTransform, progress); - transform.multiply(toTransform); -} - -PassRefPtr InterpolatedTransformOperation::blend( - const TransformOperation* from, - double progress, - bool blendToIdentity) { - if (from && !from->isSameType(*this)) - return this; - - TransformOperations thisOperations; - thisOperations.operations().append(this); - TransformOperations fromOperations; - if (blendToIdentity) - fromOperations.operations().append(IdentityTransformOperation::create()); - else - fromOperations.operations().append(const_cast(from)); - return InterpolatedTransformOperation::create(thisOperations, fromOperations, - progress); -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/InterpolatedTransformOperation.h b/sky/engine/platform/transforms/InterpolatedTransformOperation.h deleted file mode 100644 index 2a9df8acc3e36..0000000000000 --- a/sky/engine/platform/transforms/InterpolatedTransformOperation.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_INTERPOLATEDTRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_INTERPOLATEDTRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" -#include "flutter/sky/engine/platform/transforms/TransformOperations.h" - -namespace blink { - -// This class is an implementation detail for deferred interpolations. -class PLATFORM_EXPORT InterpolatedTransformOperation - : public TransformOperation { - public: - static PassRefPtr create( - const TransformOperations& from, - const TransformOperations& to, - double progress) { - return adoptRef(new InterpolatedTransformOperation(from, to, progress)); - } - - virtual bool canBlendWith(const TransformOperation& other) const { - return isSameType(other); - } - - private: - virtual bool isIdentity() const override { return false; } - - virtual OperationType type() const override { return Interpolated; } - - virtual bool operator==(const TransformOperation&) const override; - virtual void apply(TransformationMatrix&, - const FloatSize& borderBoxSize) const override; - - virtual PassRefPtr blend( - const TransformOperation* from, - double progress, - bool blendToIdentity = false) override; - - virtual bool dependsOnBoxSize() const override { - return from.dependsOnBoxSize() || to.dependsOnBoxSize(); - } - - InterpolatedTransformOperation(const TransformOperations& from, - const TransformOperations& to, - double progress) - : from(from), to(to), progress(progress) {} - - const TransformOperations from; - const TransformOperations to; - double progress; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_INTERPOLATEDTRANSFORMOPERATION_H_ diff --git a/sky/engine/platform/transforms/Matrix3DTransformOperation.cpp b/sky/engine/platform/transforms/Matrix3DTransformOperation.cpp deleted file mode 100644 index b034d1d40e26f..0000000000000 --- a/sky/engine/platform/transforms/Matrix3DTransformOperation.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/transforms/Matrix3DTransformOperation.h" - -#include - -namespace blink { - -PassRefPtr Matrix3DTransformOperation::blend( - const TransformOperation* from, - double progress, - bool blendToIdentity) { - if (from && !from->isSameType(*this)) - return this; - - // Convert the TransformOperations into matrices - FloatSize size; - TransformationMatrix fromT; - TransformationMatrix toT; - if (from) - from->apply(fromT, size); - - apply(toT, size); - - if (blendToIdentity) - std::swap(fromT, toT); - - toT.blend(fromT, progress); - return Matrix3DTransformOperation::create(toT); -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/Matrix3DTransformOperation.h b/sky/engine/platform/transforms/Matrix3DTransformOperation.h deleted file mode 100644 index ae48975f96f96..0000000000000 --- a/sky/engine/platform/transforms/Matrix3DTransformOperation.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_MATRIX3DTRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_MATRIX3DTRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" - -namespace blink { - -class PLATFORM_EXPORT Matrix3DTransformOperation : public TransformOperation { - public: - static PassRefPtr create( - const TransformationMatrix& matrix) { - return adoptRef(new Matrix3DTransformOperation(matrix)); - } - - TransformationMatrix matrix() const { return m_matrix; } - - virtual bool canBlendWith(const TransformOperation& other) const { - return false; - } - - private: - virtual bool isIdentity() const override { return m_matrix.isIdentity(); } - - virtual OperationType type() const override { return Matrix3D; } - - virtual bool operator==(const TransformOperation& o) const override { - if (!isSameType(o)) - return false; - const Matrix3DTransformOperation* m = - static_cast(&o); - return m_matrix == m->m_matrix; - } - - virtual void apply(TransformationMatrix& transform, - const FloatSize&) const override { - transform.multiply(TransformationMatrix(m_matrix)); - } - - virtual PassRefPtr blend( - const TransformOperation* from, - double progress, - bool blendToIdentity = false) override; - - Matrix3DTransformOperation(const TransformationMatrix& mat) { - m_matrix = mat; - } - - TransformationMatrix m_matrix; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_MATRIX3DTRANSFORMOPERATION_H_ diff --git a/sky/engine/platform/transforms/MatrixTransformOperation.cpp b/sky/engine/platform/transforms/MatrixTransformOperation.cpp deleted file mode 100644 index 8e0fe3bd1c108..0000000000000 --- a/sky/engine/platform/transforms/MatrixTransformOperation.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/transforms/MatrixTransformOperation.h" - -#include - -namespace blink { - -PassRefPtr MatrixTransformOperation::blend( - const TransformOperation* from, - double progress, - bool blendToIdentity) { - if (from && !from->isSameType(*this)) - return this; - - // convert the TransformOperations into matrices - FloatSize size; - TransformationMatrix fromT; - TransformationMatrix toT(m_a, m_b, m_c, m_d, m_e, m_f); - if (from) { - const MatrixTransformOperation* m = - static_cast(from); - fromT.setMatrix(m->m_a, m->m_b, m->m_c, m->m_d, m->m_e, m->m_f); - } - - if (blendToIdentity) - std::swap(fromT, toT); - - toT.blend(fromT, progress); - return MatrixTransformOperation::create(toT.a(), toT.b(), toT.c(), toT.d(), - toT.e(), toT.f()); -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/MatrixTransformOperation.h b/sky/engine/platform/transforms/MatrixTransformOperation.h deleted file mode 100644 index 73aa1bc82549c..0000000000000 --- a/sky/engine/platform/transforms/MatrixTransformOperation.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_MATRIXTRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_MATRIXTRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" - -namespace blink { - -class PLATFORM_EXPORT MatrixTransformOperation : public TransformOperation { - public: - static PassRefPtr create(double a, - double b, - double c, - double d, - double e, - double f) { - return adoptRef(new MatrixTransformOperation(a, b, c, d, e, f)); - } - - static PassRefPtr create( - const TransformationMatrix& t) { - return adoptRef(new MatrixTransformOperation(t)); - } - - TransformationMatrix matrix() const { - return TransformationMatrix(m_a, m_b, m_c, m_d, m_e, m_f); - } - - virtual bool canBlendWith(const TransformOperation& other) const { - return false; - } - - private: - virtual bool isIdentity() const override { - return m_a == 1 && !m_b && !m_c && m_d == 1 && !m_e && !m_f; - } - - virtual OperationType type() const override { return Matrix; } - - virtual bool operator==(const TransformOperation& o) const override { - if (!isSameType(o)) - return false; - - const MatrixTransformOperation* m = - static_cast(&o); - return m_a == m->m_a && m_b == m->m_b && m_c == m->m_c && m_d == m->m_d && - m_e == m->m_e && m_f == m->m_f; - } - - virtual void apply(TransformationMatrix& transform, - const FloatSize&) const override { - TransformationMatrix matrix(m_a, m_b, m_c, m_d, m_e, m_f); - transform.multiply(matrix); - } - - virtual PassRefPtr blend( - const TransformOperation* from, - double progress, - bool blendToIdentity = false) override; - - MatrixTransformOperation(double a, - double b, - double c, - double d, - double e, - double f) - : m_a(a), m_b(b), m_c(c), m_d(d), m_e(e), m_f(f) {} - - MatrixTransformOperation(const TransformationMatrix& t) - : m_a(t.a()), - m_b(t.b()), - m_c(t.c()), - m_d(t.d()), - m_e(t.e()), - m_f(t.f()) {} - - double m_a; - double m_b; - double m_c; - double m_d; - double m_e; - double m_f; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_MATRIXTRANSFORMOPERATION_H_ diff --git a/sky/engine/platform/transforms/PerspectiveTransformOperation.cpp b/sky/engine/platform/transforms/PerspectiveTransformOperation.cpp deleted file mode 100644 index 313447d510900..0000000000000 --- a/sky/engine/platform/transforms/PerspectiveTransformOperation.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/transforms/PerspectiveTransformOperation.h" - -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -PassRefPtr PerspectiveTransformOperation::blend( - const TransformOperation* from, - double progress, - bool blendToIdentity) { - if (from && !from->isSameType(*this)) - return this; - - if (blendToIdentity) { - double p = blink::blend( - m_p, 1., progress); // FIXME: this seems wrong. - // https://bugs.webkit.org/show_bug.cgi?id=52700 - return PerspectiveTransformOperation::create(clampToPositiveInteger(p)); - } - - const PerspectiveTransformOperation* fromOp = - static_cast(from); - - TransformationMatrix fromT; - TransformationMatrix toT; - fromT.applyPerspective(fromOp ? fromOp->m_p : 0); - toT.applyPerspective(m_p); - toT.blend(fromT, progress); - TransformationMatrix::DecomposedType decomp; - toT.decompose(decomp); - - if (decomp.perspectiveZ) { - double val = -1.0 / decomp.perspectiveZ; - return PerspectiveTransformOperation::create(clampToPositiveInteger(val)); - } - return PerspectiveTransformOperation::create(0); -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/PerspectiveTransformOperation.h b/sky/engine/platform/transforms/PerspectiveTransformOperation.h deleted file mode 100644 index 0a14f4d7133d5..0000000000000 --- a/sky/engine/platform/transforms/PerspectiveTransformOperation.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_PERSPECTIVETRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_PERSPECTIVETRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" - -namespace blink { - -class PLATFORM_EXPORT PerspectiveTransformOperation - : public TransformOperation { - public: - static PassRefPtr create(double p) { - return adoptRef(new PerspectiveTransformOperation(p)); - } - - double perspective() const { return m_p; } - - virtual bool canBlendWith(const TransformOperation& other) const { - return isSameType(other); - } - - private: - virtual bool isIdentity() const override { return !m_p; } - virtual OperationType type() const override { return Perspective; } - - virtual bool operator==(const TransformOperation& o) const override { - if (!isSameType(o)) - return false; - const PerspectiveTransformOperation* p = - static_cast(&o); - return m_p == p->m_p; - } - - virtual void apply(TransformationMatrix& transform, - const FloatSize&) const override { - transform.applyPerspective(m_p); - } - - virtual PassRefPtr blend( - const TransformOperation* from, - double progress, - bool blendToIdentity = false) override; - - PerspectiveTransformOperation(double p) : m_p(p) {} - - double m_p; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_PERSPECTIVETRANSFORMOPERATION_H_ diff --git a/sky/engine/platform/transforms/RotateTransformOperation.cpp b/sky/engine/platform/transforms/RotateTransformOperation.cpp deleted file mode 100644 index c284bf261514a..0000000000000 --- a/sky/engine/platform/transforms/RotateTransformOperation.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/transforms/RotateTransformOperation.h" - -#include -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" -#include "flutter/sky/engine/platform/geometry/FloatPoint3D.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace blink { - -static const double angleEpsilon = 1e-4; - -FloatPoint3D RotateTransformOperation::axis() const { - return FloatPoint3D(x(), y(), z()); -} - -bool RotateTransformOperation::shareSameAxis( - const RotateTransformOperation* from, - const RotateTransformOperation* to, - FloatPoint3D* axis, - double* fromAngle, - double* toAngle) { - *axis = FloatPoint3D(0, 0, 1); - *fromAngle = 0; - *toAngle = 0; - - if (!from && !to) - return true; - - bool fromZero = !from || from->axis().isZero(); - bool toZero = !to || to->axis().isZero(); - - if (fromZero && toZero) - return true; - - if (fromZero) { - *axis = to->axis(); - *toAngle = to->angle(); - return true; - } - - if (toZero) { - *axis = from->axis(); - *fromAngle = from->angle(); - return true; - } - - FloatPoint3D fromAxis = from->axis(); - FloatPoint3D toAxis = to->axis(); - - double fromSquared = fromAxis.lengthSquared(); - double toSquared = toAxis.lengthSquared(); - - double dot = fromAxis.dot(toAxis); - double error = std::abs(1 - (dot * dot) / (fromSquared * toSquared)); - - if (error > angleEpsilon) - return false; - *axis = from->axis(); - *fromAngle = from->angle(); - *toAngle = to->angle(); - return true; -} - -PassRefPtr RotateTransformOperation::blend( - const TransformOperation* from, - double progress, - bool blendToIdentity) { - if (from && !from->isSameType(*this)) - return this; - - if (blendToIdentity) - return RotateTransformOperation::create( - m_x, m_y, m_z, m_angle - m_angle * progress, m_type); - - const RotateTransformOperation* fromOp = - static_cast(from); - - // Optimize for single axis rotation - if (!fromOp || (fromOp->m_x == 0 && fromOp->m_y == 0 && fromOp->m_z == 1) || - (fromOp->m_x == 0 && fromOp->m_y == 1 && fromOp->m_z == 0) || - (fromOp->m_x == 1 && fromOp->m_y == 0 && fromOp->m_z == 0)) { - double fromAngle = fromOp ? fromOp->m_angle : 0; - return RotateTransformOperation::create( - fromOp ? fromOp->m_x : m_x, fromOp ? fromOp->m_y : m_y, - fromOp ? fromOp->m_z : m_z, blink::blend(fromAngle, m_angle, progress), - m_type); - } - double fromAngle; - double toAngle; - FloatPoint3D axis; - - if (shareSameAxis(fromOp, this, &axis, &fromAngle, &toAngle)) - return RotateTransformOperation::create( - axis.x(), axis.y(), axis.z(), - blink::blend(fromAngle, toAngle, progress), m_type); - - const RotateTransformOperation* toOp = this; - - // Create the 2 rotation matrices - TransformationMatrix fromT; - TransformationMatrix toT; - fromT.rotate3d((fromOp ? fromOp->m_x : 0), (fromOp ? fromOp->m_y : 0), - (fromOp ? fromOp->m_z : 1), (fromOp ? fromOp->m_angle : 0)); - - toT.rotate3d((toOp ? toOp->m_x : 0), (toOp ? toOp->m_y : 0), - (toOp ? toOp->m_z : 1), (toOp ? toOp->m_angle : 0)); - - // Blend them - toT.blend(fromT, progress); - - // Extract the result as a quaternion - TransformationMatrix::DecomposedType decomp; - toT.decompose(decomp); - - // Convert that to Axis/Angle form - double x = -decomp.quaternionX; - double y = -decomp.quaternionY; - double z = -decomp.quaternionZ; - double length = std::sqrt(x * x + y * y + z * z); - double angle = 0; - - if (length > 0.00001) { - x /= length; - y /= length; - z /= length; - angle = rad2deg(std::acos(decomp.quaternionW) * 2); - } else { - x = 0; - y = 0; - z = 1; - } - return RotateTransformOperation::create(x, y, z, angle, Rotate3D); -} - -bool RotateTransformOperation::canBlendWith( - const TransformOperation& other) const { - return other.isSameType(*this); -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/RotateTransformOperation.h b/sky/engine/platform/transforms/RotateTransformOperation.h deleted file mode 100644 index 1fabd70d6917e..0000000000000 --- a/sky/engine/platform/transforms/RotateTransformOperation.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_ROTATETRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_ROTATETRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" - -namespace blink { - -class PLATFORM_EXPORT RotateTransformOperation : public TransformOperation { - public: - static PassRefPtr create(double angle, - OperationType type) { - return adoptRef(new RotateTransformOperation(0, 0, 1, angle, type)); - } - - static PassRefPtr create(double x, - double y, - double z, - double angle, - OperationType type) { - return adoptRef(new RotateTransformOperation(x, y, z, angle, type)); - } - - double x() const { return m_x; } - double y() const { return m_y; } - double z() const { return m_z; } - double angle() const { return m_angle; } - - FloatPoint3D axis() const; - static bool shareSameAxis(const RotateTransformOperation* fromRotation, - const RotateTransformOperation* toRotation, - FloatPoint3D* axis, - double* fromAngle, - double* toAngle); - - virtual bool canBlendWith(const TransformOperation& other) const; - virtual OperationType type() const override { return m_type; } - - private: - virtual bool isIdentity() const override { return !m_angle; } - - virtual bool operator==(const TransformOperation& o) const override { - if (!isSameType(o)) - return false; - const RotateTransformOperation* r = - static_cast(&o); - return m_x == r->m_x && m_y == r->m_y && m_z == r->m_z && - m_angle == r->m_angle; - } - - virtual void apply(TransformationMatrix& transform, - const FloatSize& /*borderBoxSize*/) const override { - transform.rotate3d(m_x, m_y, m_z, m_angle); - } - - virtual PassRefPtr blend( - const TransformOperation* from, - double progress, - bool blendToIdentity = false) override; - - RotateTransformOperation(double x, - double y, - double z, - double angle, - OperationType type) - : m_x(x), m_y(y), m_z(z), m_angle(angle), m_type(type) { - ASSERT(type == RotateX || type == RotateY || type == RotateZ || - type == Rotate3D); - } - - double m_x; - double m_y; - double m_z; - double m_angle; - OperationType m_type; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_ROTATETRANSFORMOPERATION_H_ diff --git a/sky/engine/platform/transforms/ScaleTransformOperation.cpp b/sky/engine/platform/transforms/ScaleTransformOperation.cpp deleted file mode 100644 index c332f8290aa11..0000000000000 --- a/sky/engine/platform/transforms/ScaleTransformOperation.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/transforms/ScaleTransformOperation.h" - -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" - -namespace blink { - -PassRefPtr ScaleTransformOperation::blend( - const TransformOperation* from, - double progress, - bool blendToIdentity) { - if (from && !from->canBlendWith(*this)) - return this; - - if (blendToIdentity) - return ScaleTransformOperation::create( - blink::blend(m_x, 1.0, progress), blink::blend(m_y, 1.0, progress), - blink::blend(m_z, 1.0, progress), m_type); - - const ScaleTransformOperation* fromOp = - static_cast(from); - double fromX = fromOp ? fromOp->m_x : 1.0; - double fromY = fromOp ? fromOp->m_y : 1.0; - double fromZ = fromOp ? fromOp->m_z : 1.0; - return ScaleTransformOperation::create( - blink::blend(fromX, m_x, progress), blink::blend(fromY, m_y, progress), - blink::blend(fromZ, m_z, progress), m_type); -} - -bool ScaleTransformOperation::canBlendWith( - const TransformOperation& other) const { - return other.type() == ScaleX || other.type() == ScaleY || - other.type() == ScaleZ || other.type() == Scale3D || - other.type() == Scale; -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/ScaleTransformOperation.h b/sky/engine/platform/transforms/ScaleTransformOperation.h deleted file mode 100644 index 88c733b6afe5a..0000000000000 --- a/sky/engine/platform/transforms/ScaleTransformOperation.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_SCALETRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_SCALETRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" - -namespace blink { - -class PLATFORM_EXPORT ScaleTransformOperation : public TransformOperation { - public: - static PassRefPtr create(double sx, - double sy, - OperationType type) { - return adoptRef(new ScaleTransformOperation(sx, sy, 1, type)); - } - - static PassRefPtr create(double sx, - double sy, - double sz, - OperationType type) { - return adoptRef(new ScaleTransformOperation(sx, sy, sz, type)); - } - - double x() const { return m_x; } - double y() const { return m_y; } - double z() const { return m_z; } - - virtual bool canBlendWith(const TransformOperation& other) const; - - private: - virtual bool isIdentity() const override { - return m_x == 1 && m_y == 1 && m_z == 1; - } - - virtual OperationType type() const override { return m_type; } - - virtual bool operator==(const TransformOperation& o) const override { - if (!isSameType(o)) - return false; - const ScaleTransformOperation* s = - static_cast(&o); - return m_x == s->m_x && m_y == s->m_y && m_z == s->m_z; - } - - virtual void apply(TransformationMatrix& transform, - const FloatSize&) const override { - transform.scale3d(m_x, m_y, m_z); - } - - virtual PassRefPtr blend( - const TransformOperation* from, - double progress, - bool blendToIdentity = false) override; - - ScaleTransformOperation(double sx, double sy, double sz, OperationType type) - : m_x(sx), m_y(sy), m_z(sz), m_type(type) { - ASSERT(type == ScaleX || type == ScaleY || type == ScaleZ || - type == Scale || type == Scale3D); - } - - double m_x; - double m_y; - double m_z; - OperationType m_type; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_SCALETRANSFORMOPERATION_H_ diff --git a/sky/engine/platform/transforms/SkewTransformOperation.cpp b/sky/engine/platform/transforms/SkewTransformOperation.cpp deleted file mode 100644 index a4b4174034edb..0000000000000 --- a/sky/engine/platform/transforms/SkewTransformOperation.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/transforms/SkewTransformOperation.h" - -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" - -namespace blink { - -PassRefPtr SkewTransformOperation::blend( - const TransformOperation* from, - double progress, - bool blendToIdentity) { - if (from && !from->canBlendWith(*this)) - return this; - - if (blendToIdentity) - return SkewTransformOperation::create(blink::blend(m_angleX, 0.0, progress), - blink::blend(m_angleY, 0.0, progress), - m_type); - - const SkewTransformOperation* fromOp = - static_cast(from); - double fromAngleX = fromOp ? fromOp->m_angleX : 0; - double fromAngleY = fromOp ? fromOp->m_angleY : 0; - return SkewTransformOperation::create( - blink::blend(fromAngleX, m_angleX, progress), - blink::blend(fromAngleY, m_angleY, progress), m_type); -} - -bool SkewTransformOperation::canBlendWith( - const TransformOperation& other) const { - return other.type() == Skew || other.type() == SkewX || other.type() == SkewY; -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/SkewTransformOperation.h b/sky/engine/platform/transforms/SkewTransformOperation.h deleted file mode 100644 index c7cf36774dce5..0000000000000 --- a/sky/engine/platform/transforms/SkewTransformOperation.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_SKEWTRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_SKEWTRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" - -namespace blink { - -class PLATFORM_EXPORT SkewTransformOperation : public TransformOperation { - public: - static PassRefPtr create(double angleX, - double angleY, - OperationType type) { - return adoptRef(new SkewTransformOperation(angleX, angleY, type)); - } - - double angleX() const { return m_angleX; } - double angleY() const { return m_angleY; } - - virtual bool canBlendWith(const TransformOperation& other) const; - - private: - virtual bool isIdentity() const override { return !m_angleX && !m_angleY; } - virtual OperationType type() const override { return m_type; } - - virtual bool operator==(const TransformOperation& o) const override { - if (!isSameType(o)) - return false; - const SkewTransformOperation* s = - static_cast(&o); - return m_angleX == s->m_angleX && m_angleY == s->m_angleY; - } - - virtual void apply(TransformationMatrix& transform, - const FloatSize&) const override { - transform.skew(m_angleX, m_angleY); - } - - virtual PassRefPtr blend( - const TransformOperation* from, - double progress, - bool blendToIdentity = false) override; - - SkewTransformOperation(double angleX, double angleY, OperationType type) - : m_angleX(angleX), m_angleY(angleY), m_type(type) {} - - double m_angleX; - double m_angleY; - OperationType m_type; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_SKEWTRANSFORMOPERATION_H_ diff --git a/sky/engine/platform/transforms/TransformOperation.h b/sky/engine/platform/transforms/TransformOperation.h deleted file mode 100644 index a23a3854d99a4..0000000000000 --- a/sky/engine/platform/transforms/TransformOperation.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/geometry/FloatSize.h" -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace blink { - -// CSS Transforms (may become part of CSS3) - -class PLATFORM_EXPORT TransformOperation - : public RefCounted { - public: - enum OperationType { - ScaleX, - ScaleY, - Scale, - TranslateX, - TranslateY, - Translate, - Rotate, - RotateZ = Rotate, - SkewX, - SkewY, - Skew, - Matrix, - ScaleZ, - Scale3D, - TranslateZ, - Translate3D, - RotateX, - RotateY, - Rotate3D, - Matrix3D, - Perspective, - Interpolated, - Identity, - None - }; - - virtual ~TransformOperation() {} - - virtual bool operator==(const TransformOperation&) const = 0; - bool operator!=(const TransformOperation& o) const { return !(*this == o); } - - virtual bool isIdentity() const = 0; - - virtual void apply(TransformationMatrix&, - const FloatSize& borderBoxSize) const = 0; - - virtual PassRefPtr blend( - const TransformOperation* from, - double progress, - bool blendToIdentity = false) = 0; - - virtual OperationType type() const = 0; - bool isSameType(const TransformOperation& other) const { - return other.type() == type(); - } - virtual bool canBlendWith(const TransformOperation& other) const = 0; - - bool is3DOperation() const { - OperationType opType = type(); - return opType == ScaleZ || opType == Scale3D || opType == TranslateZ || - opType == Translate3D || opType == RotateX || opType == RotateY || - opType == Rotate3D || opType == Matrix3D || opType == Perspective || - opType == Interpolated; - } - - virtual bool dependsOnBoxSize() const { return false; } -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSFORMOPERATION_H_ diff --git a/sky/engine/platform/transforms/TransformOperations.cpp b/sky/engine/platform/transforms/TransformOperations.cpp deleted file mode 100644 index 35ef092f5809a..0000000000000 --- a/sky/engine/platform/transforms/TransformOperations.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/transforms/TransformOperations.h" - -#include -#include "flutter/sky/engine/platform/animation/AnimationUtilities.h" -#include "flutter/sky/engine/platform/geometry/FloatBox.h" -#include "flutter/sky/engine/platform/transforms/IdentityTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/InterpolatedTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/RotateTransformOperation.h" - -namespace blink { - -TransformOperations::TransformOperations(bool makeIdentity) { - if (makeIdentity) - m_operations.append(IdentityTransformOperation::create()); -} - -bool TransformOperations::operator==(const TransformOperations& o) const { - if (m_operations.size() != o.m_operations.size()) - return false; - - unsigned s = m_operations.size(); - for (unsigned i = 0; i < s; i++) { - if (*m_operations[i] != *o.m_operations[i]) - return false; - } - - return true; -} - -bool TransformOperations::operationsMatch( - const TransformOperations& other) const { - size_t numOperations = operations().size(); - // If the sizes of the function lists don't match, the lists don't match - if (numOperations != other.operations().size()) - return false; - - // If the types of each function are not the same, the lists don't match - for (size_t i = 0; i < numOperations; ++i) { - if (!operations()[i]->isSameType(*other.operations()[i])) - return false; - } - return true; -} - -TransformOperations TransformOperations::blendByMatchingOperations( - const TransformOperations& from, - const double& progress) const { - TransformOperations result; - - unsigned fromSize = from.operations().size(); - unsigned toSize = operations().size(); - unsigned size = std::max(fromSize, toSize); - for (unsigned i = 0; i < size; i++) { - RefPtr fromOperation = - (i < fromSize) ? from.operations()[i].get() : 0; - RefPtr toOperation = - (i < toSize) ? operations()[i].get() : 0; - RefPtr blendedOperation = - toOperation ? toOperation->blend(fromOperation.get(), progress) - : (fromOperation ? fromOperation->blend(0, progress, true) - : nullptr); - if (blendedOperation) - result.operations().append(blendedOperation); - else { - RefPtr identityOperation = - IdentityTransformOperation::create(); - if (progress > 0.5) - result.operations().append(toOperation ? toOperation - : identityOperation); - else - result.operations().append(fromOperation ? fromOperation - : identityOperation); - } - } - - return result; -} - -TransformOperations TransformOperations::blendByUsingMatrixInterpolation( - const TransformOperations& from, - double progress) const { - TransformOperations result; - result.operations().append( - InterpolatedTransformOperation::create(from, *this, progress)); - return result; -} - -TransformOperations TransformOperations::blend(const TransformOperations& from, - double progress) const { - if (from == *this || (!from.size() && !size())) - return *this; - - // If either list is empty, use blendByMatchingOperations which has special - // logic for this case. - if (!from.size() || !size() || from.operationsMatch(*this)) - return blendByMatchingOperations(from, progress); - - return blendByUsingMatrixInterpolation(from, progress); -} - -static void findCandidatesInPlane(double px, - double py, - double nz, - double* candidates, - int* numCandidates) { - // The angle that this point is rotated with respect to the plane nz - double phi = atan2(px, py); - - *numCandidates = 4; - candidates[0] = phi; // The element at 0deg (maximum x) - - for (int i = 1; i < *numCandidates; ++i) - candidates[i] = candidates[i - 1] + M_PI_2; // every 90 deg - if (nz < 0.f) { - for (int i = 0; i < *numCandidates; ++i) - candidates[i] *= -1; - } -} - -// This method returns the bounding box that contains the starting point, -// the ending point, and any of the extrema (in each dimension) found across -// the circle described by the arc. These are then filtered to points that -// actually reside on the arc. -static void boundingBoxForArc(const FloatPoint3D& point, - const RotateTransformOperation& fromTransform, - const RotateTransformOperation& toTransform, - double minProgress, - double maxProgress, - FloatBox& box) { - double candidates[6]; - int numCandidates = 0; - - FloatPoint3D axis(fromTransform.axis()); - double fromDegrees = fromTransform.angle(); - double toDegrees = toTransform.angle(); - - if (axis.dot(toTransform.axis()) < 0) - toDegrees *= -1; - - fromDegrees = blend(fromDegrees, toTransform.angle(), minProgress); - toDegrees = blend(toDegrees, fromTransform.angle(), 1.0 - maxProgress); - if (fromDegrees > toDegrees) - std::swap(fromDegrees, toDegrees); - - TransformationMatrix fromMatrix; - TransformationMatrix toMatrix; - fromMatrix.rotate3d(fromTransform.x(), fromTransform.y(), fromTransform.z(), - fromDegrees); - toMatrix.rotate3d(fromTransform.x(), fromTransform.y(), fromTransform.z(), - toDegrees); - - FloatPoint3D fromPoint = fromMatrix.mapPoint(point); - FloatPoint3D toPoint = toMatrix.mapPoint(point); - - if (box.isEmpty()) - box.setOrigin(fromPoint); - else - box.expandTo(fromPoint); - - box.expandTo(toPoint); - - switch (fromTransform.type()) { - case TransformOperation::RotateX: - findCandidatesInPlane(point.y(), point.z(), fromTransform.x(), candidates, - &numCandidates); - break; - case TransformOperation::RotateY: - findCandidatesInPlane(point.z(), point.x(), fromTransform.y(), candidates, - &numCandidates); - break; - case TransformOperation::RotateZ: - findCandidatesInPlane(point.x(), point.y(), fromTransform.z(), candidates, - &numCandidates); - break; - default: { - FloatPoint3D normal = axis; - if (normal.isZero()) - return; - normal.normalize(); - FloatPoint3D origin; - FloatPoint3D toPoint = point - origin; - FloatPoint3D center = origin + normal * toPoint.dot(normal); - FloatPoint3D v1 = point - center; - if (v1.isZero()) - return; - - v1.normalize(); - FloatPoint3D v2 = normal.cross(v1); - // v1 is the basis vector in the direction of the point. - // i.e. with a rotation of 0, v1 is our +x vector. - // v2 is a perpenticular basis vector of our plane (+y). - - // Take the parametric equation of a circle. - // (x = r*cos(t); y = r*sin(t); - // We can treat that as a circle on the plane v1xv2 - // From that we get the parametric equations for a circle on the - // plane in 3d space of - // x(t) = r*cos(t)*v1.x + r*sin(t)*v2.x + cx - // y(t) = r*cos(t)*v1.y + r*sin(t)*v2.y + cy - // z(t) = r*cos(t)*v1.z + r*sin(t)*v2.z + cz - // taking the derivative of (x, y, z) and solving for 0 gives us our - // maximum/minimum x, y, z values - // x'(t) = r*cos(t)*v2.x - r*sin(t)*v1.x = 0 - // tan(t) = v2.x/v1.x - // t = atan2(v2.x, v1.x) + n*M_PI; - - candidates[0] = atan2(v2.x(), v1.x()); - candidates[1] = candidates[0] + M_PI; - candidates[2] = atan2(v2.y(), v1.y()); - candidates[3] = candidates[2] + M_PI; - candidates[4] = atan2(v2.z(), v1.z()); - candidates[5] = candidates[4] + M_PI; - numCandidates = 6; - } break; - } - - double minRadians = deg2rad(fromDegrees); - double maxRadians = deg2rad(toDegrees); - // Once we have the candidates, we now filter them down to ones that - // actually live on the arc, rather than the entire circle. - for (int i = 0; i < numCandidates; ++i) { - double radians = candidates[i]; - - while (radians < minRadians) - radians += 2.0 * M_PI; - while (radians > maxRadians) - radians -= 2.0 * M_PI; - if (radians < minRadians) - continue; - - TransformationMatrix rotation; - rotation.rotate3d(axis.x(), axis.y(), axis.z(), rad2deg(radians)); - box.expandTo(rotation.mapPoint(point)); - } -} - -bool TransformOperations::blendedBoundsForBox(const FloatBox& box, - const TransformOperations& from, - const double& minProgress, - const double& maxProgress, - FloatBox* bounds) const { - int fromSize = from.operations().size(); - int toSize = operations().size(); - int size = std::max(fromSize, toSize); - - *bounds = box; - for (int i = size - 1; i >= 0; i--) { - RefPtr fromOperation = - (i < fromSize) ? from.operations()[i] : nullptr; - RefPtr toOperation = - (i < toSize) ? operations()[i] : nullptr; - if (fromOperation && fromOperation->type() == TransformOperation::None) - fromOperation = nullptr; - - if (toOperation && toOperation->type() == TransformOperation::None) - toOperation = nullptr; - - TransformOperation::OperationType interpolationType = - toOperation - ? toOperation->type() - : fromOperation ? fromOperation->type() : TransformOperation::None; - if (fromOperation && toOperation && - !fromOperation->canBlendWith(*toOperation.get())) - return false; - - switch (interpolationType) { - case TransformOperation::Identity: - bounds->expandTo(box); - continue; - case TransformOperation::Translate: - case TransformOperation::TranslateX: - case TransformOperation::TranslateY: - case TransformOperation::TranslateZ: - case TransformOperation::Translate3D: - case TransformOperation::Scale: - case TransformOperation::ScaleX: - case TransformOperation::ScaleY: - case TransformOperation::ScaleZ: - case TransformOperation::Scale3D: - case TransformOperation::Skew: - case TransformOperation::SkewX: - case TransformOperation::SkewY: - case TransformOperation::Perspective: { - RefPtr fromTransform; - RefPtr toTransform; - if (!toOperation) { - fromTransform = - fromOperation->blend(toOperation.get(), 1 - minProgress, false); - toTransform = - fromOperation->blend(toOperation.get(), 1 - maxProgress, false); - } else { - fromTransform = - toOperation->blend(fromOperation.get(), minProgress, false); - toTransform = - toOperation->blend(fromOperation.get(), maxProgress, false); - } - if (!fromTransform || !toTransform) - continue; - TransformationMatrix fromMatrix; - TransformationMatrix toMatrix; - fromTransform->apply(fromMatrix, FloatSize()); - toTransform->apply(toMatrix, FloatSize()); - FloatBox fromBox = *bounds; - FloatBox toBox = *bounds; - fromMatrix.transformBox(fromBox); - toMatrix.transformBox(toBox); - *bounds = fromBox; - bounds->expandTo(toBox); - continue; - } - case TransformOperation::Rotate: // This is also RotateZ - case TransformOperation::Rotate3D: - case TransformOperation::RotateX: - case TransformOperation::RotateY: { - RefPtr identityRotation; - const RotateTransformOperation* fromRotation = nullptr; - const RotateTransformOperation* toRotation = nullptr; - if (fromOperation) { - fromRotation = - static_cast(fromOperation.get()); - if (fromRotation->axis().isZero()) - fromRotation = nullptr; - } - - if (toOperation) { - toRotation = - static_cast(toOperation.get()); - if (toRotation->axis().isZero()) - toRotation = nullptr; - } - - double fromAngle; - double toAngle; - FloatPoint3D axis; - if (!RotateTransformOperation::shareSameAxis( - fromRotation, toRotation, &axis, &fromAngle, &toAngle)) { - return (false); - } - - if (!fromRotation) { - identityRotation = RotateTransformOperation::create( - axis.x(), axis.y(), axis.z(), 0, - fromOperation ? fromOperation->type() : toOperation->type()); - fromRotation = identityRotation.get(); - } - - if (!toRotation) { - if (!identityRotation) - identityRotation = RotateTransformOperation::create( - axis.x(), axis.y(), axis.z(), 0, - fromOperation ? fromOperation->type() : toOperation->type()); - toRotation = identityRotation.get(); - } - - FloatBox fromBox = *bounds; - bool first = true; - for (size_t i = 0; i < 2; ++i) { - for (size_t j = 0; j < 2; ++j) { - for (size_t k = 0; k < 2; ++k) { - FloatBox boundsForArc; - FloatPoint3D corner(fromBox.x(), fromBox.y(), fromBox.z()); - corner += FloatPoint3D(i * fromBox.width(), j * fromBox.height(), - k * fromBox.depth()); - boundingBoxForArc(corner, *fromRotation, *toRotation, minProgress, - maxProgress, boundsForArc); - if (first) { - *bounds = boundsForArc; - first = false; - } else { - bounds->expandTo(boundsForArc); - } - } - } - } - } - continue; - case TransformOperation::None: - continue; - case TransformOperation::Matrix: - case TransformOperation::Matrix3D: - case TransformOperation::Interpolated: - return (false); - } - } - - return true; -} - -TransformOperations TransformOperations::add( - const TransformOperations& addend) const { - TransformOperations result; - result.m_operations = operations(); - result.m_operations.appendVector(addend.operations()); - return result; -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/TransformOperations.h b/sky/engine/platform/transforms/TransformOperations.h deleted file mode 100644 index abd3c149b9870..0000000000000 --- a/sky/engine/platform/transforms/TransformOperations.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSFORMOPERATIONS_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSFORMOPERATIONS_H_ - -#include "flutter/sky/engine/platform/geometry/LayoutSize.h" -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { -class FloatBox; -class PLATFORM_EXPORT TransformOperations { - WTF_MAKE_FAST_ALLOCATED; - - public: - explicit TransformOperations(bool makeIdentity = false); - - bool operator==(const TransformOperations& o) const; - bool operator!=(const TransformOperations& o) const { return !(*this == o); } - - void apply(const FloatSize& sz, TransformationMatrix& t) const { - for (unsigned i = 0; i < m_operations.size(); ++i) - m_operations[i]->apply(t, sz); - } - - // Return true if any of the operation types are 3D operation types (even if - // the values describe affine transforms) - bool has3DOperation() const { - for (unsigned i = 0; i < m_operations.size(); ++i) - if (m_operations[i]->is3DOperation()) - return true; - return false; - } - - bool dependsOnBoxSize() const { - for (unsigned i = 0; i < m_operations.size(); ++i) { - if (m_operations[i]->dependsOnBoxSize()) - return true; - } - return false; - } - - bool operationsMatch(const TransformOperations&) const; - - void clear() { m_operations.clear(); } - - Vector>& operations() { return m_operations; } - const Vector>& operations() const { - return m_operations; - } - - size_t size() const { return m_operations.size(); } - const TransformOperation* at(size_t index) const { - return index < m_operations.size() ? m_operations.at(index).get() : 0; - } - - bool blendedBoundsForBox(const FloatBox&, - const TransformOperations& from, - const double& minProgress, - const double& maxProgress, - FloatBox* bounds) const; - TransformOperations blendByMatchingOperations(const TransformOperations& from, - const double& progress) const; - TransformOperations blendByUsingMatrixInterpolation( - const TransformOperations& from, - double progress) const; - TransformOperations blend(const TransformOperations& from, - double progress) const; - TransformOperations add(const TransformOperations& addend) const; - - private: - Vector> m_operations; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSFORMOPERATIONS_H_ diff --git a/sky/engine/platform/transforms/TransformOperationsTest.cpp b/sky/engine/platform/transforms/TransformOperationsTest.cpp deleted file mode 100644 index 045f64f9ac1e3..0000000000000 --- a/sky/engine/platform/transforms/TransformOperationsTest.cpp +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/transforms/TransformOperations.h" - -#include "flutter/sky/engine/platform/geometry/FloatBox.h" -#include "flutter/sky/engine/platform/geometry/FloatBoxTestHelpers.h" -#include "flutter/sky/engine/platform/transforms/IdentityTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/Matrix3DTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/MatrixTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/PerspectiveTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/RotateTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/ScaleTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/SkewTransformOperation.h" -#include "flutter/sky/engine/platform/transforms/TranslateTransformOperation.h" - -#include - -using namespace blink; -namespace { - -static const TransformOperations identityOperations; - -static void EmpiricallyTestBounds(const TransformOperations& from, - const TransformOperations& to, - const double& minProgress, - const double& maxProgress) { - FloatBox box(200, 500, 100, 100, 300, 200); - FloatBox bounds; - - EXPECT_TRUE( - to.blendedBoundsForBox(box, from, minProgress, maxProgress, &bounds)); - bool firstTime = true; - - FloatBox empiricalBounds; - static const size_t numSteps = 10; - for (size_t step = 0; step < numSteps; ++step) { - float t = step / (numSteps - 1); - t = minProgress + (maxProgress - minProgress) * t; - TransformOperations operations = from.blend(to, t); - TransformationMatrix matrix; - operations.apply(FloatSize(0, 0), matrix); - FloatBox transformed = box; - matrix.transformBox(transformed); - - if (firstTime) - empiricalBounds = transformed; - else - empiricalBounds.unionBounds(transformed); - firstTime = false; - } - - ASSERT_PRED_FORMAT2(FloatBoxTest::AssertContains, bounds, empiricalBounds); -} - -TEST(TransformOperationsTest, AbsoluteAnimatedTranslatedBoundsTest) { - TransformOperations fromOps; - TransformOperations toOps; - fromOps.operations().append(TranslateTransformOperation::create( - Length(-30, blink::Fixed), Length(20, blink::Fixed), 15, - TransformOperation::Translate3D)); - toOps.operations().append(TranslateTransformOperation::create( - Length(10, blink::Fixed), Length(10, blink::Fixed), 200, - TransformOperation::Translate3D)); - FloatBox box(0, 0, 0, 10, 10, 10); - FloatBox bounds; - - EXPECT_TRUE( - toOps.blendedBoundsForBox(box, identityOperations, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, 0, 0, 20, 20, 210), bounds); - - EXPECT_TRUE( - identityOperations.blendedBoundsForBox(box, toOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, 0, 0, 20, 20, 210), bounds); - - EXPECT_TRUE( - identityOperations.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-30, 0, 0, 40, 30, 25), bounds); - - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-30, 10, 15, 50, 20, 195), bounds); - - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, -0.5, 1.25, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-50, 7.5, -77.5, 80, 27.5, 333.75), bounds); -} - -TEST(TransformOperationsTest, EmpiricalAnimatedTranslatedBoundsTest) { - float testTransforms[][2][3] = {{{0, 0, 0}, {10, 10, 0}}, - {{-100, 202.5, -32.6}, {43.2, 56.1, 89.75}}, - {{43.2, 56.1, 89.75}, {-100, 202.5, -32.6}}}; - - // All progressions for animations start and end at 0, 1 respectively, - // we can go outside of these bounds, but will always at least contain - // [0,1]. - float progress[][2] = {{0, 1}, {-.25, 1.25}}; - - for (size_t i = 0; i < WTF_ARRAY_LENGTH(testTransforms); ++i) { - for (size_t j = 0; j < WTF_ARRAY_LENGTH(progress); ++j) { - TransformOperations fromOps; - TransformOperations toOps; - fromOps.operations().append(TranslateTransformOperation::create( - Length(testTransforms[i][0][0], blink::Fixed), - Length(testTransforms[i][0][1], blink::Fixed), - testTransforms[i][0][2], TransformOperation::Translate3D)); - toOps.operations().append(TranslateTransformOperation::create( - Length(testTransforms[i][1][0], blink::Fixed), - Length(testTransforms[i][1][1], blink::Fixed), - testTransforms[i][1][2], TransformOperation::Translate3D)); - EmpiricallyTestBounds(fromOps, toOps, 0, 1); - } - } -} - -TEST(TransformOperationsTest, AbsoluteAnimatedScaleBoundsTest) { - TransformOperations fromOps; - TransformOperations toOps; - fromOps.operations().append( - ScaleTransformOperation::create(4, -3, TransformOperation::Scale)); - toOps.operations().append( - ScaleTransformOperation::create(5, 2, TransformOperation::Scale)); - - FloatBox box(0, 0, 0, 10, 10, 10); - FloatBox bounds; - - EXPECT_TRUE( - toOps.blendedBoundsForBox(box, identityOperations, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, 0, 0, 50, 20, 10), bounds); - - EXPECT_TRUE( - identityOperations.blendedBoundsForBox(box, toOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, 0, 0, 50, 20, 10), bounds); - - EXPECT_TRUE( - identityOperations.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, -30, 0, 40, 40, 10), bounds); - - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, -30, 0, 50, 50, 10), bounds); - - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, -0.5, 1.25, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, -55, 0, 52.5, 87.5, 10), bounds); -} - -TEST(TransformOperationsTest, EmpiricalAnimatedScaleBoundsTest) { - float testTransforms[][2][3] = {{{1, 1, 1}, {10, 10, -32}}, - {{1, 2, 5}, {-1, -2, -4}}, - {{0, 0, 0}, {1, 2, 3}}, - {{0, 0, 0}, {0, 0, 0}}}; - - // All progressions for animations start and end at 0, 1 respectively, - // we can go outside of these bounds, but will always at least contain - // [0,1]. - float progress[][2] = {{0, 1}, {-.25f, 1.25f}}; - - for (size_t i = 0; i < WTF_ARRAY_LENGTH(testTransforms); ++i) { - for (size_t j = 0; j < WTF_ARRAY_LENGTH(progress); ++j) { - TransformOperations fromOps; - TransformOperations toOps; - fromOps.operations().append(TranslateTransformOperation::create( - Length(testTransforms[i][0][0], blink::Fixed), - Length(testTransforms[i][0][1], blink::Fixed), - testTransforms[i][0][2], TransformOperation::Translate3D)); - toOps.operations().append(TranslateTransformOperation::create( - Length(testTransforms[i][1][0], blink::Fixed), - Length(testTransforms[i][1][1], blink::Fixed), - testTransforms[i][1][2], TransformOperation::Translate3D)); - EmpiricallyTestBounds(fromOps, toOps, 0, 1); - } - } -} - -TEST(TransformOperationsTest, AbsoluteAnimatedRotationBounds) { - TransformOperations fromOps; - TransformOperations toOps; - fromOps.operations().append( - RotateTransformOperation::create(0, TransformOperation::Rotate)); - toOps.operations().append( - RotateTransformOperation::create(360, TransformOperation::Rotate)); - float sqrt2 = sqrt(2.0f); - FloatBox box(-sqrt2, -sqrt2, 0, sqrt2, sqrt2, 0); - FloatBox bounds; - - // Since we're rotating 360 degrees, any box with dimensions between 0 and - // 2 * sqrt(2) should give the same result. - float sizes[] = {0, 0.1f, sqrt2, 2 * sqrt2}; - toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds); - for (size_t i = 0; i < WTF_ARRAY_LENGTH(sizes); ++i) { - box.setSize(FloatPoint3D(sizes[i], sizes[i], 0)); - - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-2, -2, 0, 4, 4, 0), bounds); - } -} - -TEST(TransformOperationsTest, AbsoluteAnimatedExtremeRotationBounds) { - // If the normal is off-plane, we can have up to 6 exrema (min/max in each - // dimension between) the endpoints of the arg. This makes sure we are - // catching all 6. - TransformOperations fromOps; - TransformOperations toOps; - fromOps.operations().append(RotateTransformOperation::create( - 1, 1, 1, 30, TransformOperation::Rotate3D)); - toOps.operations().append(RotateTransformOperation::create( - 1, 1, 1, 390, TransformOperation::Rotate3D)); - - FloatBox box(1, 0, 0, 0, 0, 0); - FloatBox bounds; - float min = -1 / 3.0f; - float max = 1; - float size = max - min; - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(min, min, min, size, size, size), bounds); -} - -TEST(TransformOperationsTest, AbsoluteAnimatedAxisRotationBounds) { - // We can handle rotations about a single axis. If the axes are different, - // we revert to matrix interpolation for which inflated bounds cannot be - // computed. - TransformOperations fromOps; - TransformOperations toSame; - TransformOperations toOpposite; - TransformOperations toDifferent; - fromOps.operations().append(RotateTransformOperation::create( - 1, 1, 1, 30, TransformOperation::Rotate3D)); - toSame.operations().append(RotateTransformOperation::create( - 1, 1, 1, 390, TransformOperation::Rotate3D)); - toOpposite.operations().append(RotateTransformOperation::create( - -1, -1, -1, 390, TransformOperation::Rotate3D)); - toDifferent.operations().append(RotateTransformOperation::create( - 1, 3, 1, 390, TransformOperation::Rotate3D)); - - FloatBox box(1, 0, 0, 0, 0, 0); - FloatBox bounds; - EXPECT_TRUE(toSame.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_TRUE(toOpposite.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_FALSE(toDifferent.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); -} - -TEST(TransformOperationsTest, AbsoluteAnimatedOnAxisRotationBounds) { - // If we rotate a point that is on the axis of rotation, the box should not - // change at all. - TransformOperations fromOps; - TransformOperations toOps; - fromOps.operations().append(RotateTransformOperation::create( - 1, 1, 1, 30, TransformOperation::Rotate3D)); - toOps.operations().append(RotateTransformOperation::create( - 1, 1, 1, 390, TransformOperation::Rotate3D)); - - FloatBox box(1, 1, 1, 0, 0, 0); - FloatBox bounds; - - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, box, bounds); -} - -// This would have been best as anonymous structs, but |WTF_ARRAY_LENGTH| -// does not get along with anonymous structs once we support C++11 -// WTF_ARRAY_LENGTH will automatically support anonymous structs. - -struct ProblematicAxisTest { - double x; - double y; - double z; - FloatBox expected; -}; - -TEST(TransformOperationsTest, AbsoluteAnimatedProblematicAxisRotationBounds) { - // Zeros in the components of the axis osf rotation turned out to be tricky to - // deal with in practice. This function tests some potentially problematic - // axes to ensure sane behavior. - - // Some common values used in the expected boxes. - float dim1 = 0.292893f; - float dim2 = sqrt(2.0f); - float dim3 = 2 * dim2; - - ProblematicAxisTest tests[] = { - {0, 0, 0, FloatBox(1, 1, 1, 0, 0, 0)}, - {1, 0, 0, FloatBox(1, -dim2, -dim2, 0, dim3, dim3)}, - {0, 1, 0, FloatBox(-dim2, 1, -dim2, dim3, 0, dim3)}, - {0, 0, 1, FloatBox(-dim2, -dim2, 1, dim3, dim3, 0)}, - {1, 1, 0, FloatBox(dim1, dim1, -1, dim2, dim2, 2)}, - {0, 1, 1, FloatBox(-1, dim1, dim1, 2, dim2, dim2)}, - {1, 0, 1, FloatBox(dim1, -1, dim1, dim2, 2, dim2)}}; - - for (size_t i = 0; i < WTF_ARRAY_LENGTH(tests); ++i) { - float x = tests[i].x; - float y = tests[i].y; - float z = tests[i].z; - TransformOperations fromOps; - fromOps.operations().append(RotateTransformOperation::create( - x, y, z, 0, TransformOperation::Rotate3D)); - TransformOperations toOps; - toOps.operations().append(RotateTransformOperation::create( - x, y, z, 360, TransformOperation::Rotate3D)); - FloatBox box(1, 1, 1, 0, 0, 0); - FloatBox bounds; - - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, tests[i].expected, - bounds); - } -} - -TEST(TransformOperationsTest, BlendedBoundsForRotationEmpiricalTests) { - float axes[][3] = {{1, 1, 1}, {-1, -1, -1}, {-1, 2, 3}, {1, -2, 3}, - {0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}, - {1, 1, 0}, {0, 1, 1}, {1, 0, 1}, {-1, 0, 0}, - {0, -1, 0}, {0, 0, -1}, {-1, -1, 0}, {0, -1, -1}, - {-1, 0, -1}}; - - float angles[][2] = {{5, 100}, {10, 5}, {0, 360}, {20, 180}, - {-20, -180}, {180, -220}, {220, 320}, {1020, 1120}, - {-3200, 120}, {-9000, -9050}}; - - float progress[][2] = {{0, 1}, {-0.25f, 1.25f}}; - - for (size_t i = 0; i < WTF_ARRAY_LENGTH(axes); ++i) { - for (size_t j = 0; j < WTF_ARRAY_LENGTH(angles); ++j) { - for (size_t k = 0; k < WTF_ARRAY_LENGTH(progress); ++k) { - float x = axes[i][0]; - float y = axes[i][1]; - float z = axes[i][2]; - - TransformOperations fromOps; - TransformOperations toOps; - - fromOps.operations().append(RotateTransformOperation::create( - x, y, z, angles[j][0], TransformOperation::Rotate3D)); - toOps.operations().append(RotateTransformOperation::create( - x, y, z, angles[j][1], TransformOperation::Rotate3D)); - EmpiricallyTestBounds(fromOps, toOps, progress[k][0], progress[k][1]); - } - } - } -} - -TEST(TransformOperationsTest, AbsoluteAnimatedPerspectiveBoundsTest) { - TransformOperations fromOps; - TransformOperations toOps; - fromOps.operations().append(PerspectiveTransformOperation::create(10)); - toOps.operations().append(PerspectiveTransformOperation::create(30)); - FloatBox box(0, 0, 0, 10, 10, 10); - FloatBox bounds; - toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, 0, 0, 15, 15, 15), bounds); - - fromOps.blendedBoundsForBox(box, toOps, -0.25, 1.25, &bounds); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-40, -40, -40, 52, 52, 52), bounds); -} - -TEST(TransformOperationsTest, EmpiricalAnimatedPerspectiveBoundsTest) { - float depths[][2] = { - {600, 400}, {800, 1000}, {800, std::numeric_limits::infinity()}}; - - float progress[][2] = {{0, 1}, {-0.1f, 1.1f}}; - - for (size_t i = 0; i < WTF_ARRAY_LENGTH(depths); ++i) { - for (size_t j = 0; j < WTF_ARRAY_LENGTH(progress); ++j) { - TransformOperations fromOps; - TransformOperations toOps; - - fromOps.operations().append( - PerspectiveTransformOperation::create(depths[i][0])); - toOps.operations().append( - PerspectiveTransformOperation::create(depths[i][1])); - - EmpiricallyTestBounds(fromOps, toOps, progress[j][0], progress[j][1]); - } - } -} - -TEST(TransformOperationsTest, AnimatedSkewBoundsTest) { - TransformOperations fromOps; - TransformOperations toOps; - fromOps.operations().append( - SkewTransformOperation::create(-45, 0, TransformOperation::Skew)); - toOps.operations().append( - SkewTransformOperation::create(0, 45, TransformOperation::Skew)); - FloatBox box(0, 0, 0, 10, 10, 10); - FloatBox bounds; - - toOps.blendedBoundsForBox(box, identityOperations, 0, 1, &bounds); - ASSERT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(0, 0, 0, 10, 20, 10), bounds); - - identityOperations.blendedBoundsForBox(box, fromOps, 0, 1, &bounds); - ASSERT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-10, 0, 0, 20, 10, 10), bounds); - - toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds); - ASSERT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-10, 0, 0, 20, 20, 10), bounds); - - fromOps.blendedBoundsForBox(box, toOps, 0, 1, &bounds); - ASSERT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-10, 0, 0, 20, 20, 10), bounds); -} - -TEST(TransformOperationsTest, NonCommutativeRotations) { - TransformOperations fromOps; - fromOps.operations().append(RotateTransformOperation::create( - 1, 0, 0, 0, TransformOperation::Rotate3D)); - fromOps.operations().append(RotateTransformOperation::create( - 0, 1, 0, 0, TransformOperation::Rotate3D)); - TransformOperations toOps; - toOps.operations().append(RotateTransformOperation::create( - 1, 0, 0, 45, TransformOperation::Rotate3D)); - toOps.operations().append(RotateTransformOperation::create( - 0, 1, 0, 135, TransformOperation::Rotate3D)); - - FloatBox box(0, 0, 0, 1, 1, 1); - FloatBox bounds; - - double minProgress = 0; - double maxProgress = 1; - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, minProgress, maxProgress, - &bounds)); - - TransformOperations operations = toOps.blend(fromOps, maxProgress); - TransformationMatrix blendedTransform; - operations.apply(FloatSize(0, 0), blendedTransform); - - FloatPoint3D blendedPoint(0.9f, 0.9f, 0); - blendedPoint = blendedTransform.mapPoint(blendedPoint); - FloatBox expandedBounds = bounds; - expandedBounds.expandTo(blendedPoint); - - ASSERT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, bounds, expandedBounds); -} - -TEST(TransformOperationsTest, AbsoluteSequenceBoundsTest) { - TransformOperations fromOps; - TransformOperations toOps; - - fromOps.operations().append(TranslateTransformOperation::create( - Length(1, Fixed), Length(-5, Fixed), 1, TransformOperation::Translate3D)); - fromOps.operations().append( - ScaleTransformOperation::create(-1, 2, 3, TransformOperation::Scale3D)); - fromOps.operations().append(TranslateTransformOperation::create( - Length(2, Fixed), Length(4, Fixed), -1, TransformOperation::Translate3D)); - - toOps.operations().append( - TranslateTransformOperation::create(Length(13, Fixed), Length(-1, Fixed), - 5, TransformOperation::Translate3D)); - toOps.operations().append( - ScaleTransformOperation::create(-3, -2, 5, TransformOperation::Scale3D)); - toOps.operations().append(TranslateTransformOperation::create( - Length(6, Fixed), Length(-2, Fixed), 3, TransformOperation::Translate3D)); - - FloatBox box(1, 2, 3, 4, 4, 4); - FloatBox bounds; - - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, -0.5, 1.5, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-57, -59, -1, 76, 112, 80), bounds); - - EXPECT_TRUE(toOps.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-32, -25, 7, 42, 44, 48), bounds); - - EXPECT_TRUE( - toOps.blendedBoundsForBox(box, identityOperations, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-33, -13, 3, 57, 19, 52), bounds); - - EXPECT_TRUE( - identityOperations.blendedBoundsForBox(box, fromOps, 0, 1, &bounds)); - EXPECT_PRED_FORMAT2(FloatBoxTest::AssertAlmostEqual, - FloatBox(-7, -3, 2, 15, 23, 20), bounds); -} - -} // namespace diff --git a/sky/engine/platform/transforms/TransformationMatrix.cpp b/sky/engine/platform/transforms/TransformationMatrix.cpp deleted file mode 100644 index 503c370539bf2..0000000000000 --- a/sky/engine/platform/transforms/TransformationMatrix.cpp +++ /dev/null @@ -1,1589 +0,0 @@ -/* - * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2009 Torch Mobile, Inc. - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" - -#include "flutter/sky/engine/platform/geometry/FloatBox.h" -#include "flutter/sky/engine/platform/geometry/FloatQuad.h" -#include "flutter/sky/engine/platform/geometry/FloatRect.h" -#include "flutter/sky/engine/platform/geometry/IntRect.h" -#include "flutter/sky/engine/platform/geometry/LayoutRect.h" -#include "flutter/sky/engine/platform/transforms/AffineTransform.h" - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/MathExtras.h" - -#if CPU(X86_64) -#include -#endif - -namespace blink { - -// -// Supporting Math Functions -// -// This is a set of function from various places (attributed inline) to do -// things like inversion and decomposition of a 4x4 matrix. They are used -// throughout the code -// - -// -// Adapted from Matrix Inversion by Richard Carling, Graphics Gems -// . - -// EULA: The Graphics Gems code is copyright-protected. In other words, you -// cannot claim the text of the code as your own and resell it. Using the code -// is permitted in any program, product, or library, non-commercial or -// commercial. Giving credit is not required, though is a nice gesture. The code -// comes as-is, and if there are any flaws or problems with any Gems code, -// nobody involved with Gems - authors, editors, publishers, or webmasters - are -// to be held responsible. Basically, don't be a jerk, and remember that -// anything free comes with no guarantee. - -// A clarification about the storage of matrix elements -// -// This class uses a 2 dimensional array internally to store the elements of the -// matrix. The first index into the array refers to the column that the element -// lies in; the second index refers to the row. -// -// In other words, this is the layout of the matrix: -// -// | m_matrix[0][0] m_matrix[1][0] m_matrix[2][0] m_matrix[3][0] | -// | m_matrix[0][1] m_matrix[1][1] m_matrix[2][1] m_matrix[3][1] | -// | m_matrix[0][2] m_matrix[1][2] m_matrix[2][2] m_matrix[3][2] | -// | m_matrix[0][3] m_matrix[1][3] m_matrix[2][3] m_matrix[3][3] | - -typedef double Vector4[4]; -typedef double Vector3[3]; - -const double SMALL_NUMBER = 1.e-8; - -// inverse(original_matrix, inverse_matrix) -// -// calculate the inverse of a 4x4 matrix -// -// -1 -// A = ___1__ adjoint A -// det A - -// double = determinant2x2(double a, double b, double c, double d) -// -// calculate the determinant of a 2x2 matrix. - -static double determinant2x2(double a, double b, double c, double d) { - return a * d - b * c; -} - -// double = determinant3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3) -// -// Calculate the determinant of a 3x3 matrix -// in the form -// -// | a1, b1, c1 | -// | a2, b2, c2 | -// | a3, b3, c3 | - -static double determinant3x3(double a1, - double a2, - double a3, - double b1, - double b2, - double b3, - double c1, - double c2, - double c3) { - return a1 * determinant2x2(b2, b3, c2, c3) - - b1 * determinant2x2(a2, a3, c2, c3) + - c1 * determinant2x2(a2, a3, b2, b3); -} - -// double = determinant4x4(matrix) -// -// calculate the determinant of a 4x4 matrix. - -static double determinant4x4(const TransformationMatrix::Matrix4& m) { - // Assign to individual variable names to aid selecting - // correct elements - - double a1 = m[0][0]; - double b1 = m[0][1]; - double c1 = m[0][2]; - double d1 = m[0][3]; - - double a2 = m[1][0]; - double b2 = m[1][1]; - double c2 = m[1][2]; - double d2 = m[1][3]; - - double a3 = m[2][0]; - double b3 = m[2][1]; - double c3 = m[2][2]; - double d3 = m[2][3]; - - double a4 = m[3][0]; - double b4 = m[3][1]; - double c4 = m[3][2]; - double d4 = m[3][3]; - - return a1 * determinant3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4) - - b1 * determinant3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4) + - c1 * determinant3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4) - - d1 * determinant3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4); -} - -// adjoint( original_matrix, inverse_matrix ) -// -// calculate the adjoint of a 4x4 matrix -// -// Let a denote the minor determinant of matrix A obtained by -// ij -// -// deleting the ith row and jth column from A. -// -// i+j -// Let b = (-1) a -// ij ji -// -// The matrix B = (b ) is the adjoint of A -// ij - -static void adjoint(const TransformationMatrix::Matrix4& matrix, - TransformationMatrix::Matrix4& result) { - // Assign to individual variable names to aid - // selecting correct values - double a1 = matrix[0][0]; - double b1 = matrix[0][1]; - double c1 = matrix[0][2]; - double d1 = matrix[0][3]; - - double a2 = matrix[1][0]; - double b2 = matrix[1][1]; - double c2 = matrix[1][2]; - double d2 = matrix[1][3]; - - double a3 = matrix[2][0]; - double b3 = matrix[2][1]; - double c3 = matrix[2][2]; - double d3 = matrix[2][3]; - - double a4 = matrix[3][0]; - double b4 = matrix[3][1]; - double c4 = matrix[3][2]; - double d4 = matrix[3][3]; - - // Row column labeling reversed since we transpose rows & columns - result[0][0] = determinant3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4); - result[1][0] = -determinant3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4); - result[2][0] = determinant3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4); - result[3][0] = -determinant3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4); - - result[0][1] = -determinant3x3(b1, b3, b4, c1, c3, c4, d1, d3, d4); - result[1][1] = determinant3x3(a1, a3, a4, c1, c3, c4, d1, d3, d4); - result[2][1] = -determinant3x3(a1, a3, a4, b1, b3, b4, d1, d3, d4); - result[3][1] = determinant3x3(a1, a3, a4, b1, b3, b4, c1, c3, c4); - - result[0][2] = determinant3x3(b1, b2, b4, c1, c2, c4, d1, d2, d4); - result[1][2] = -determinant3x3(a1, a2, a4, c1, c2, c4, d1, d2, d4); - result[2][2] = determinant3x3(a1, a2, a4, b1, b2, b4, d1, d2, d4); - result[3][2] = -determinant3x3(a1, a2, a4, b1, b2, b4, c1, c2, c4); - - result[0][3] = -determinant3x3(b1, b2, b3, c1, c2, c3, d1, d2, d3); - result[1][3] = determinant3x3(a1, a2, a3, c1, c2, c3, d1, d2, d3); - result[2][3] = -determinant3x3(a1, a2, a3, b1, b2, b3, d1, d2, d3); - result[3][3] = determinant3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3); -} - -// Returns false if the matrix is not invertible -static bool inverse(const TransformationMatrix::Matrix4& matrix, - TransformationMatrix::Matrix4& result) { - // Calculate the adjoint matrix - adjoint(matrix, result); - - // Calculate the 4x4 determinant - // If the determinant is zero, - // then the inverse matrix is not unique. - double det = determinant4x4(matrix); - - if (fabs(det) < SMALL_NUMBER) - return false; - - // Scale the adjoint matrix to get the inverse - - for (int i = 0; i < 4; i++) - for (int j = 0; j < 4; j++) - result[i][j] = result[i][j] / det; - - return true; -} - -// End of code adapted from Matrix Inversion by Richard Carling - -// Perform a decomposition on the passed matrix, return false if unsuccessful -// From Graphics Gems: unmatrix.c - -// Transpose rotation portion of matrix a, return b -static void transposeMatrix4(const TransformationMatrix::Matrix4& a, - TransformationMatrix::Matrix4& b) { - for (int i = 0; i < 4; i++) - for (int j = 0; j < 4; j++) - b[i][j] = a[j][i]; -} - -// Multiply a homogeneous point by a matrix and return the transformed point -static void v4MulPointByMatrix(const Vector4 p, - const TransformationMatrix::Matrix4& m, - Vector4 result) { - result[0] = - (p[0] * m[0][0]) + (p[1] * m[1][0]) + (p[2] * m[2][0]) + (p[3] * m[3][0]); - result[1] = - (p[0] * m[0][1]) + (p[1] * m[1][1]) + (p[2] * m[2][1]) + (p[3] * m[3][1]); - result[2] = - (p[0] * m[0][2]) + (p[1] * m[1][2]) + (p[2] * m[2][2]) + (p[3] * m[3][2]); - result[3] = - (p[0] * m[0][3]) + (p[1] * m[1][3]) + (p[2] * m[2][3]) + (p[3] * m[3][3]); -} - -static double v3Length(Vector3 a) { - return std::sqrt((a[0] * a[0]) + (a[1] * a[1]) + (a[2] * a[2])); -} - -static void v3Scale(Vector3 v, double desiredLength) { - double len = v3Length(v); - if (len != 0) { - double l = desiredLength / len; - v[0] *= l; - v[1] *= l; - v[2] *= l; - } -} - -static double v3Dot(const Vector3 a, const Vector3 b) { - return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]); -} - -// Make a linear combination of two vectors and return the result. -// result = (a * ascl) + (b * bscl) -static void v3Combine(const Vector3 a, - const Vector3 b, - Vector3 result, - double ascl, - double bscl) { - result[0] = (ascl * a[0]) + (bscl * b[0]); - result[1] = (ascl * a[1]) + (bscl * b[1]); - result[2] = (ascl * a[2]) + (bscl * b[2]); -} - -// Return the cross product result = a cross b */ -static void v3Cross(const Vector3 a, const Vector3 b, Vector3 result) { - result[0] = (a[1] * b[2]) - (a[2] * b[1]); - result[1] = (a[2] * b[0]) - (a[0] * b[2]); - result[2] = (a[0] * b[1]) - (a[1] * b[0]); -} - -static bool decompose(const TransformationMatrix::Matrix4& mat, - TransformationMatrix::DecomposedType& result) { - TransformationMatrix::Matrix4 localMatrix; - memcpy(localMatrix, mat, sizeof(TransformationMatrix::Matrix4)); - - // Normalize the matrix. - if (localMatrix[3][3] == 0) - return false; - - int i, j; - for (i = 0; i < 4; i++) - for (j = 0; j < 4; j++) - localMatrix[i][j] /= localMatrix[3][3]; - - // perspectiveMatrix is used to solve for perspective, but it also provides - // an easy way to test for singularity of the upper 3x3 component. - TransformationMatrix::Matrix4 perspectiveMatrix; - memcpy(perspectiveMatrix, localMatrix, sizeof(TransformationMatrix::Matrix4)); - for (i = 0; i < 3; i++) - perspectiveMatrix[i][3] = 0; - perspectiveMatrix[3][3] = 1; - - if (determinant4x4(perspectiveMatrix) == 0) - return false; - - // First, isolate perspective. This is the messiest. - if (localMatrix[0][3] != 0 || localMatrix[1][3] != 0 || - localMatrix[2][3] != 0) { - // rightHandSide is the right hand side of the equation. - Vector4 rightHandSide; - rightHandSide[0] = localMatrix[0][3]; - rightHandSide[1] = localMatrix[1][3]; - rightHandSide[2] = localMatrix[2][3]; - rightHandSide[3] = localMatrix[3][3]; - - // Solve the equation by inverting perspectiveMatrix and multiplying - // rightHandSide by the inverse. (This is the easiest way, not - // necessarily the best.) - TransformationMatrix::Matrix4 inversePerspectiveMatrix, - transposedInversePerspectiveMatrix; - inverse(perspectiveMatrix, inversePerspectiveMatrix); - transposeMatrix4(inversePerspectiveMatrix, - transposedInversePerspectiveMatrix); - - Vector4 perspectivePoint; - v4MulPointByMatrix(rightHandSide, transposedInversePerspectiveMatrix, - perspectivePoint); - - result.perspectiveX = perspectivePoint[0]; - result.perspectiveY = perspectivePoint[1]; - result.perspectiveZ = perspectivePoint[2]; - result.perspectiveW = perspectivePoint[3]; - - // Clear the perspective partition - localMatrix[0][3] = localMatrix[1][3] = localMatrix[2][3] = 0; - localMatrix[3][3] = 1; - } else { - // No perspective. - result.perspectiveX = result.perspectiveY = result.perspectiveZ = 0; - result.perspectiveW = 1; - } - - // Next take care of translation (easy). - result.translateX = localMatrix[3][0]; - localMatrix[3][0] = 0; - result.translateY = localMatrix[3][1]; - localMatrix[3][1] = 0; - result.translateZ = localMatrix[3][2]; - localMatrix[3][2] = 0; - - // Vector4 type and functions need to be added to the common set. - Vector3 row[3], pdum3; - - // Now get scale and shear. - for (i = 0; i < 3; i++) { - row[i][0] = localMatrix[i][0]; - row[i][1] = localMatrix[i][1]; - row[i][2] = localMatrix[i][2]; - } - - // Compute X scale factor and normalize first row. - result.scaleX = v3Length(row[0]); - v3Scale(row[0], 1.0); - - // Compute XY shear factor and make 2nd row orthogonal to 1st. - result.skewXY = v3Dot(row[0], row[1]); - v3Combine(row[1], row[0], row[1], 1.0, -result.skewXY); - - // Now, compute Y scale and normalize 2nd row. - result.scaleY = v3Length(row[1]); - v3Scale(row[1], 1.0); - result.skewXY /= result.scaleY; - - // Compute XZ and YZ shears, orthogonalize 3rd row. - result.skewXZ = v3Dot(row[0], row[2]); - v3Combine(row[2], row[0], row[2], 1.0, -result.skewXZ); - result.skewYZ = v3Dot(row[1], row[2]); - v3Combine(row[2], row[1], row[2], 1.0, -result.skewYZ); - - // Next, get Z scale and normalize 3rd row. - result.scaleZ = v3Length(row[2]); - v3Scale(row[2], 1.0); - result.skewXZ /= result.scaleZ; - result.skewYZ /= result.scaleZ; - - // At this point, the matrix (in rows[]) is orthonormal. - // Check for a coordinate system flip. If the determinant - // is -1, then negate the matrix and the scaling factors. - v3Cross(row[1], row[2], pdum3); - if (v3Dot(row[0], pdum3) < 0) { - result.scaleX *= -1; - result.scaleY *= -1; - result.scaleZ *= -1; - - for (i = 0; i < 3; i++) { - row[i][0] *= -1; - row[i][1] *= -1; - row[i][2] *= -1; - } - } - - // Now, get the rotations out, as described in the gem. - - // FIXME - Add the ability to return either quaternions (which are - // easier to recompose with) or Euler angles (rx, ry, rz), which - // are easier for authors to deal with. The latter will only be useful - // when we fix https://bugs.webkit.org/show_bug.cgi?id=23799, so I - // will leave the Euler angle code here for now. - - // ret.rotateY = asin(-row[0][2]); - // if (cos(ret.rotateY) != 0) { - // ret.rotateX = atan2(row[1][2], row[2][2]); - // ret.rotateZ = atan2(row[0][1], row[0][0]); - // } else { - // ret.rotateX = atan2(-row[2][0], row[1][1]); - // ret.rotateZ = 0; - // } - - double s, t, x, y, z, w; - - t = row[0][0] + row[1][1] + row[2][2] + 1.0; - - if (t > 1e-4) { - s = 0.5 / std::sqrt(t); - w = 0.25 / s; - x = (row[2][1] - row[1][2]) * s; - y = (row[0][2] - row[2][0]) * s; - z = (row[1][0] - row[0][1]) * s; - } else if (row[0][0] > row[1][1] && row[0][0] > row[2][2]) { - s = std::sqrt(1.0 + row[0][0] - row[1][1] - row[2][2]) * 2.0; // S=4*qx - x = 0.25 * s; - y = (row[0][1] + row[1][0]) / s; - z = (row[0][2] + row[2][0]) / s; - w = (row[2][1] - row[1][2]) / s; - } else if (row[1][1] > row[2][2]) { - s = std::sqrt(1.0 + row[1][1] - row[0][0] - row[2][2]) * 2.0; // S=4*qy - x = (row[0][1] + row[1][0]) / s; - y = 0.25 * s; - z = (row[1][2] + row[2][1]) / s; - w = (row[0][2] - row[2][0]) / s; - } else { - s = std::sqrt(1.0 + row[2][2] - row[0][0] - row[1][1]) * 2.0; // S=4*qz - x = (row[0][2] + row[2][0]) / s; - y = (row[1][2] + row[2][1]) / s; - z = 0.25 * s; - w = (row[1][0] - row[0][1]) / s; - } - - result.quaternionX = x; - result.quaternionY = y; - result.quaternionZ = z; - result.quaternionW = w; - - return true; -} - -// Perform a spherical linear interpolation between the two -// passed quaternions with 0 <= t <= 1 -static void slerp(double qa[4], const double qb[4], double t) { - double ax, ay, az, aw; - double bx, by, bz, bw; - double cx, cy, cz, cw; - double angle; - double th, invth, scale, invscale; - - ax = qa[0]; - ay = qa[1]; - az = qa[2]; - aw = qa[3]; - bx = qb[0]; - by = qb[1]; - bz = qb[2]; - bw = qb[3]; - - angle = ax * bx + ay * by + az * bz + aw * bw; - - if (angle < 0.0) { - ax = -ax; - ay = -ay; - az = -az; - aw = -aw; - angle = -angle; - } - - if (angle + 1.0 > .05) { - if (1.0 - angle >= .05) { - th = std::acos(angle); - invth = 1.0 / std::sin(th); - scale = std::sin(th * (1.0 - t)) * invth; - invscale = std::sin(th * t) * invth; - } else { - scale = 1.0 - t; - invscale = t; - } - } else { - bx = -ay; - by = ax; - bz = -aw; - bw = az; - scale = std::sin(piDouble * (.5 - t)); - invscale = std::sin(piDouble * t); - } - - cx = ax * scale + bx * invscale; - cy = ay * scale + by * invscale; - cz = az * scale + bz * invscale; - cw = aw * scale + bw * invscale; - - qa[0] = cx; - qa[1] = cy; - qa[2] = cz; - qa[3] = cw; -} - -// End of Supporting Math Functions - -TransformationMatrix::TransformationMatrix(const AffineTransform& t) { - setMatrix(t.a(), t.b(), t.c(), t.d(), t.e(), t.f()); -} - -TransformationMatrix& TransformationMatrix::scale(double s) { - return scaleNonUniform(s, s); -} - -TransformationMatrix& TransformationMatrix::rotateFromVector(double x, - double y) { - return rotate(rad2deg(atan2(y, x))); -} - -TransformationMatrix& TransformationMatrix::flipX() { - return scaleNonUniform(-1.0, 1.0); -} - -TransformationMatrix& TransformationMatrix::flipY() { - return scaleNonUniform(1.0, -1.0); -} - -FloatPoint TransformationMatrix::projectPoint(const FloatPoint& p, - bool* clamped) const { - // This is basically raytracing. We have a point in the destination - // plane with z=0, and we cast a ray parallel to the z-axis from that - // point to find the z-position at which it intersects the z=0 plane - // with the transform applied. Once we have that point we apply the - // inverse transform to find the corresponding point in the source - // space. - // - // Given a plane with normal Pn, and a ray starting at point R0 and - // with direction defined by the vector Rd, we can find the - // intersection point as a distance d from R0 in units of Rd by: - // - // d = -dot (Pn', R0) / dot (Pn', Rd) - if (clamped) - *clamped = false; - - if (m33() == 0) { - // In this case, the projection plane is parallel to the ray we are trying - // to trace, and there is no well-defined value for the projection. - return FloatPoint(); - } - - double x = p.x(); - double y = p.y(); - double z = -(m13() * x + m23() * y + m43()) / m33(); - - // FIXME: use multVecMatrix() - double outX = x * m11() + y * m21() + z * m31() + m41(); - double outY = x * m12() + y * m22() + z * m32() + m42(); - - double w = x * m14() + y * m24() + z * m34() + m44(); - if (w <= 0) { - // Using int max causes overflow when other code uses the projected point. - // To represent infinity yet reduce the risk of overflow, we use a large but - // not-too-large number here when clamping. - const int largeNumber = 100000000 / kFixedPointDenominator; - outX = copysign(largeNumber, outX); - outY = copysign(largeNumber, outY); - if (clamped) - *clamped = true; - } else if (w != 1) { - outX /= w; - outY /= w; - } - - return FloatPoint(static_cast(outX), static_cast(outY)); -} - -FloatQuad TransformationMatrix::projectQuad(const FloatQuad& q, - bool* clamped) const { - FloatQuad projectedQuad; - - bool clamped1 = false; - bool clamped2 = false; - bool clamped3 = false; - bool clamped4 = false; - - projectedQuad.setP1(projectPoint(q.p1(), &clamped1)); - projectedQuad.setP2(projectPoint(q.p2(), &clamped2)); - projectedQuad.setP3(projectPoint(q.p3(), &clamped3)); - projectedQuad.setP4(projectPoint(q.p4(), &clamped4)); - - if (clamped) - *clamped = clamped1 || clamped2 || clamped3 || clamped4; - - // If all points on the quad had w < 0, then the entire quad would not be - // visible to the projected surface. - bool everythingWasClipped = clamped1 && clamped2 && clamped3 && clamped4; - if (everythingWasClipped) - return FloatQuad(); - - return projectedQuad; -} - -static float clampEdgeValue(float f) { - ASSERT(!std::isnan(f)); - return std::min(std::max(f, (-LayoutUnit::max() / 2).toFloat()), - (LayoutUnit::max() / 2).toFloat()); -} - -LayoutRect TransformationMatrix::clampedBoundsOfProjectedQuad( - const FloatQuad& q) const { - FloatRect mappedQuadBounds = projectQuad(q).boundingBox(); - - float left = clampEdgeValue(floorf(mappedQuadBounds.x())); - float top = clampEdgeValue(floorf(mappedQuadBounds.y())); - - float right; - if (std::isinf(mappedQuadBounds.x()) && std::isinf(mappedQuadBounds.width())) - right = (LayoutUnit::max() / 2).toFloat(); - else - right = clampEdgeValue(ceilf(mappedQuadBounds.maxX())); - - float bottom; - if (std::isinf(mappedQuadBounds.y()) && std::isinf(mappedQuadBounds.height())) - bottom = (LayoutUnit::max() / 2).toFloat(); - else - bottom = clampEdgeValue(ceilf(mappedQuadBounds.maxY())); - - return LayoutRect(LayoutUnit::clamp(left), LayoutUnit::clamp(top), - LayoutUnit::clamp(right - left), - LayoutUnit::clamp(bottom - top)); -} - -void TransformationMatrix::transformBox(FloatBox& box) const { - FloatBox bounds; - bool firstPoint = true; - for (size_t i = 0; i < 2; ++i) { - for (size_t j = 0; j < 2; ++j) { - for (size_t k = 0; k < 2; ++k) { - FloatPoint3D point(box.x(), box.y(), box.z()); - point += - FloatPoint3D(i * box.width(), j * box.height(), k * box.depth()); - point = mapPoint(point); - if (firstPoint) { - bounds.setOrigin(point); - firstPoint = false; - } else { - bounds.expandTo(point); - } - } - } - } - box = bounds; -} - -FloatPoint TransformationMatrix::mapPoint(const FloatPoint& p) const { - if (isIdentityOrTranslation()) - return FloatPoint(p.x() + static_cast(m_matrix[3][0]), - p.y() + static_cast(m_matrix[3][1])); - - return internalMapPoint(p); -} - -FloatPoint3D TransformationMatrix::mapPoint(const FloatPoint3D& p) const { - if (isIdentityOrTranslation()) - return FloatPoint3D(p.x() + static_cast(m_matrix[3][0]), - p.y() + static_cast(m_matrix[3][1]), - p.z() + static_cast(m_matrix[3][2])); - - return internalMapPoint(p); -} - -IntRect TransformationMatrix::mapRect(const IntRect& rect) const { - return enclosingIntRect(mapRect(FloatRect(rect))); -} - -LayoutRect TransformationMatrix::mapRect(const LayoutRect& r) const { - return enclosingLayoutRect(mapRect(FloatRect(r))); -} - -FloatRect TransformationMatrix::mapRect(const FloatRect& r) const { - if (isIdentityOrTranslation()) { - FloatRect mappedRect(r); - mappedRect.move(static_cast(m_matrix[3][0]), - static_cast(m_matrix[3][1])); - return mappedRect; - } - - FloatQuad result; - - float maxX = r.maxX(); - float maxY = r.maxY(); - result.setP1(internalMapPoint(FloatPoint(r.x(), r.y()))); - result.setP2(internalMapPoint(FloatPoint(maxX, r.y()))); - result.setP3(internalMapPoint(FloatPoint(maxX, maxY))); - result.setP4(internalMapPoint(FloatPoint(r.x(), maxY))); - - return result.boundingBox(); -} - -FloatQuad TransformationMatrix::mapQuad(const FloatQuad& q) const { - if (isIdentityOrTranslation()) { - FloatQuad mappedQuad(q); - mappedQuad.move(static_cast(m_matrix[3][0]), - static_cast(m_matrix[3][1])); - return mappedQuad; - } - - FloatQuad result; - result.setP1(internalMapPoint(q.p1())); - result.setP2(internalMapPoint(q.p2())); - result.setP3(internalMapPoint(q.p3())); - result.setP4(internalMapPoint(q.p4())); - return result; -} - -TransformationMatrix& TransformationMatrix::scaleNonUniform(double sx, - double sy) { - m_matrix[0][0] *= sx; - m_matrix[0][1] *= sx; - m_matrix[0][2] *= sx; - m_matrix[0][3] *= sx; - - m_matrix[1][0] *= sy; - m_matrix[1][1] *= sy; - m_matrix[1][2] *= sy; - m_matrix[1][3] *= sy; - return *this; -} - -TransformationMatrix& TransformationMatrix::scale3d(double sx, - double sy, - double sz) { - scaleNonUniform(sx, sy); - - m_matrix[2][0] *= sz; - m_matrix[2][1] *= sz; - m_matrix[2][2] *= sz; - m_matrix[2][3] *= sz; - return *this; -} - -TransformationMatrix& TransformationMatrix::rotate3d(double x, - double y, - double z, - double angle) { - // Normalize the axis of rotation - double length = std::sqrt(x * x + y * y + z * z); - if (length == 0) { - // A direction vector that cannot be normalized, such as [0, 0, 0], will - // cause the rotation to not be applied. - return *this; - } else if (length != 1) { - x /= length; - y /= length; - z /= length; - } - - // Angles are in degrees. Switch to radians. - angle = deg2rad(angle); - - double sinTheta = std::sin(angle); - double cosTheta = std::cos(angle); - - TransformationMatrix mat; - - // Optimize cases where the axis is along a major axis - if (x == 1.0 && y == 0.0 && z == 0.0) { - mat.m_matrix[0][0] = 1.0; - mat.m_matrix[0][1] = 0.0; - mat.m_matrix[0][2] = 0.0; - mat.m_matrix[1][0] = 0.0; - mat.m_matrix[1][1] = cosTheta; - mat.m_matrix[1][2] = sinTheta; - mat.m_matrix[2][0] = 0.0; - mat.m_matrix[2][1] = -sinTheta; - mat.m_matrix[2][2] = cosTheta; - mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; - mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; - mat.m_matrix[3][3] = 1.0; - } else if (x == 0.0 && y == 1.0 && z == 0.0) { - mat.m_matrix[0][0] = cosTheta; - mat.m_matrix[0][1] = 0.0; - mat.m_matrix[0][2] = -sinTheta; - mat.m_matrix[1][0] = 0.0; - mat.m_matrix[1][1] = 1.0; - mat.m_matrix[1][2] = 0.0; - mat.m_matrix[2][0] = sinTheta; - mat.m_matrix[2][1] = 0.0; - mat.m_matrix[2][2] = cosTheta; - mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; - mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; - mat.m_matrix[3][3] = 1.0; - } else if (x == 0.0 && y == 0.0 && z == 1.0) { - mat.m_matrix[0][0] = cosTheta; - mat.m_matrix[0][1] = sinTheta; - mat.m_matrix[0][2] = 0.0; - mat.m_matrix[1][0] = -sinTheta; - mat.m_matrix[1][1] = cosTheta; - mat.m_matrix[1][2] = 0.0; - mat.m_matrix[2][0] = 0.0; - mat.m_matrix[2][1] = 0.0; - mat.m_matrix[2][2] = 1.0; - mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; - mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; - mat.m_matrix[3][3] = 1.0; - } else { - // This case is the rotation about an arbitrary unit vector. - // - // Formula is adapted from Wikipedia article on Rotation matrix, - // http://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle - // - // An alternate resource with the same matrix: - // http://www.fastgraph.com/makegames/3drotation/ - // - double oneMinusCosTheta = 1 - cosTheta; - mat.m_matrix[0][0] = cosTheta + x * x * oneMinusCosTheta; - mat.m_matrix[0][1] = y * x * oneMinusCosTheta + z * sinTheta; - mat.m_matrix[0][2] = z * x * oneMinusCosTheta - y * sinTheta; - mat.m_matrix[1][0] = x * y * oneMinusCosTheta - z * sinTheta; - mat.m_matrix[1][1] = cosTheta + y * y * oneMinusCosTheta; - mat.m_matrix[1][2] = z * y * oneMinusCosTheta + x * sinTheta; - mat.m_matrix[2][0] = x * z * oneMinusCosTheta + y * sinTheta; - mat.m_matrix[2][1] = y * z * oneMinusCosTheta - x * sinTheta; - mat.m_matrix[2][2] = cosTheta + z * z * oneMinusCosTheta; - mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; - mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; - mat.m_matrix[3][3] = 1.0; - } - multiply(mat); - return *this; -} - -TransformationMatrix& TransformationMatrix::rotate3d(double rx, - double ry, - double rz) { - // Angles are in degrees. Switch to radians. - rx = deg2rad(rx); - ry = deg2rad(ry); - rz = deg2rad(rz); - - TransformationMatrix mat; - - double sinTheta = std::sin(rz); - double cosTheta = std::cos(rz); - - mat.m_matrix[0][0] = cosTheta; - mat.m_matrix[0][1] = sinTheta; - mat.m_matrix[0][2] = 0.0; - mat.m_matrix[1][0] = -sinTheta; - mat.m_matrix[1][1] = cosTheta; - mat.m_matrix[1][2] = 0.0; - mat.m_matrix[2][0] = 0.0; - mat.m_matrix[2][1] = 0.0; - mat.m_matrix[2][2] = 1.0; - mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; - mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; - mat.m_matrix[3][3] = 1.0; - - TransformationMatrix rmat(mat); - - sinTheta = std::sin(ry); - cosTheta = std::cos(ry); - - mat.m_matrix[0][0] = cosTheta; - mat.m_matrix[0][1] = 0.0; - mat.m_matrix[0][2] = -sinTheta; - mat.m_matrix[1][0] = 0.0; - mat.m_matrix[1][1] = 1.0; - mat.m_matrix[1][2] = 0.0; - mat.m_matrix[2][0] = sinTheta; - mat.m_matrix[2][1] = 0.0; - mat.m_matrix[2][2] = cosTheta; - mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; - mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; - mat.m_matrix[3][3] = 1.0; - - rmat.multiply(mat); - - sinTheta = std::sin(rx); - cosTheta = std::cos(rx); - - mat.m_matrix[0][0] = 1.0; - mat.m_matrix[0][1] = 0.0; - mat.m_matrix[0][2] = 0.0; - mat.m_matrix[1][0] = 0.0; - mat.m_matrix[1][1] = cosTheta; - mat.m_matrix[1][2] = sinTheta; - mat.m_matrix[2][0] = 0.0; - mat.m_matrix[2][1] = -sinTheta; - mat.m_matrix[2][2] = cosTheta; - mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; - mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; - mat.m_matrix[3][3] = 1.0; - - rmat.multiply(mat); - - multiply(rmat); - return *this; -} - -TransformationMatrix& TransformationMatrix::translate(double tx, double ty) { - m_matrix[3][0] += tx * m_matrix[0][0] + ty * m_matrix[1][0]; - m_matrix[3][1] += tx * m_matrix[0][1] + ty * m_matrix[1][1]; - m_matrix[3][2] += tx * m_matrix[0][2] + ty * m_matrix[1][2]; - m_matrix[3][3] += tx * m_matrix[0][3] + ty * m_matrix[1][3]; - return *this; -} - -TransformationMatrix& TransformationMatrix::translate3d(double tx, - double ty, - double tz) { - m_matrix[3][0] += - tx * m_matrix[0][0] + ty * m_matrix[1][0] + tz * m_matrix[2][0]; - m_matrix[3][1] += - tx * m_matrix[0][1] + ty * m_matrix[1][1] + tz * m_matrix[2][1]; - m_matrix[3][2] += - tx * m_matrix[0][2] + ty * m_matrix[1][2] + tz * m_matrix[2][2]; - m_matrix[3][3] += - tx * m_matrix[0][3] + ty * m_matrix[1][3] + tz * m_matrix[2][3]; - return *this; -} - -TransformationMatrix& TransformationMatrix::translateRight(double tx, - double ty) { - if (tx != 0) { - m_matrix[0][0] += m_matrix[0][3] * tx; - m_matrix[1][0] += m_matrix[1][3] * tx; - m_matrix[2][0] += m_matrix[2][3] * tx; - m_matrix[3][0] += m_matrix[3][3] * tx; - } - - if (ty != 0) { - m_matrix[0][1] += m_matrix[0][3] * ty; - m_matrix[1][1] += m_matrix[1][3] * ty; - m_matrix[2][1] += m_matrix[2][3] * ty; - m_matrix[3][1] += m_matrix[3][3] * ty; - } - - return *this; -} - -TransformationMatrix& TransformationMatrix::translateRight3d(double tx, - double ty, - double tz) { - translateRight(tx, ty); - if (tz != 0) { - m_matrix[0][2] += m_matrix[0][3] * tz; - m_matrix[1][2] += m_matrix[1][3] * tz; - m_matrix[2][2] += m_matrix[2][3] * tz; - m_matrix[3][2] += m_matrix[3][3] * tz; - } - - return *this; -} - -TransformationMatrix& TransformationMatrix::skew(double sx, double sy) { - // angles are in degrees. Switch to radians - sx = deg2rad(sx); - sy = deg2rad(sy); - - TransformationMatrix mat; - mat.m_matrix[0][1] = - std::tan(sy); // note that the y shear goes in the first row - mat.m_matrix[1][0] = std::tan(sx); // and the x shear in the second row - - multiply(mat); - return *this; -} - -TransformationMatrix& TransformationMatrix::applyPerspective(double p) { - TransformationMatrix mat; - if (p != 0) - mat.m_matrix[2][3] = -1 / p; - - multiply(mat); - return *this; -} - -TransformationMatrix TransformationMatrix::rectToRect(const FloatRect& from, - const FloatRect& to) { - ASSERT(!from.isEmpty()); - return TransformationMatrix(to.width() / from.width(), 0, 0, - to.height() / from.height(), to.x() - from.x(), - to.y() - from.y()); -} - -// this = mat * this. -TransformationMatrix& TransformationMatrix::multiply( - const TransformationMatrix& mat) { -#if CPU(APPLE_ARMV7S) - double* leftMatrix = &(m_matrix[0][0]); - const double* rightMatrix = &(mat.m_matrix[0][0]); - asm volatile( // First row of leftMatrix. - "mov r3, %[leftMatrix]\n\t" - "vld1.64 { d16-d19 }, [%[leftMatrix], :128]!\n\t" - "vld1.64 { d0-d3}, [%[rightMatrix], :128]!\n\t" - "vmul.f64 d4, d0, d16\n\t" - "vld1.64 { d20-d23 }, [%[leftMatrix], :128]!\n\t" - "vmla.f64 d4, d1, d20\n\t" - "vld1.64 { d24-d27 }, [%[leftMatrix], :128]!\n\t" - "vmla.f64 d4, d2, d24\n\t" - "vld1.64 { d28-d31 }, [%[leftMatrix], :128]!\n\t" - "vmla.f64 d4, d3, d28\n\t" - - "vmul.f64 d5, d0, d17\n\t" - "vmla.f64 d5, d1, d21\n\t" - "vmla.f64 d5, d2, d25\n\t" - "vmla.f64 d5, d3, d29\n\t" - - "vmul.f64 d6, d0, d18\n\t" - "vmla.f64 d6, d1, d22\n\t" - "vmla.f64 d6, d2, d26\n\t" - "vmla.f64 d6, d3, d30\n\t" - - "vmul.f64 d7, d0, d19\n\t" - "vmla.f64 d7, d1, d23\n\t" - "vmla.f64 d7, d2, d27\n\t" - "vmla.f64 d7, d3, d31\n\t" - "vld1.64 { d0-d3}, [%[rightMatrix], :128]!\n\t" - "vst1.64 { d4-d7 }, [r3, :128]!\n\t" - - // Second row of leftMatrix. - "vmul.f64 d4, d0, d16\n\t" - "vmla.f64 d4, d1, d20\n\t" - "vmla.f64 d4, d2, d24\n\t" - "vmla.f64 d4, d3, d28\n\t" - - "vmul.f64 d5, d0, d17\n\t" - "vmla.f64 d5, d1, d21\n\t" - "vmla.f64 d5, d2, d25\n\t" - "vmla.f64 d5, d3, d29\n\t" - - "vmul.f64 d6, d0, d18\n\t" - "vmla.f64 d6, d1, d22\n\t" - "vmla.f64 d6, d2, d26\n\t" - "vmla.f64 d6, d3, d30\n\t" - - "vmul.f64 d7, d0, d19\n\t" - "vmla.f64 d7, d1, d23\n\t" - "vmla.f64 d7, d2, d27\n\t" - "vmla.f64 d7, d3, d31\n\t" - "vld1.64 { d0-d3}, [%[rightMatrix], :128]!\n\t" - "vst1.64 { d4-d7 }, [r3, :128]!\n\t" - - // Third row of leftMatrix. - "vmul.f64 d4, d0, d16\n\t" - "vmla.f64 d4, d1, d20\n\t" - "vmla.f64 d4, d2, d24\n\t" - "vmla.f64 d4, d3, d28\n\t" - - "vmul.f64 d5, d0, d17\n\t" - "vmla.f64 d5, d1, d21\n\t" - "vmla.f64 d5, d2, d25\n\t" - "vmla.f64 d5, d3, d29\n\t" - - "vmul.f64 d6, d0, d18\n\t" - "vmla.f64 d6, d1, d22\n\t" - "vmla.f64 d6, d2, d26\n\t" - "vmla.f64 d6, d3, d30\n\t" - - "vmul.f64 d7, d0, d19\n\t" - "vmla.f64 d7, d1, d23\n\t" - "vmla.f64 d7, d2, d27\n\t" - "vmla.f64 d7, d3, d31\n\t" - "vld1.64 { d0-d3}, [%[rightMatrix], :128]\n\t" - "vst1.64 { d4-d7 }, [r3, :128]!\n\t" - - // Fourth and last row of leftMatrix. - "vmul.f64 d4, d0, d16\n\t" - "vmla.f64 d4, d1, d20\n\t" - "vmla.f64 d4, d2, d24\n\t" - "vmla.f64 d4, d3, d28\n\t" - - "vmul.f64 d5, d0, d17\n\t" - "vmla.f64 d5, d1, d21\n\t" - "vmla.f64 d5, d2, d25\n\t" - "vmla.f64 d5, d3, d29\n\t" - - "vmul.f64 d6, d0, d18\n\t" - "vmla.f64 d6, d1, d22\n\t" - "vmla.f64 d6, d2, d26\n\t" - "vmla.f64 d6, d3, d30\n\t" - - "vmul.f64 d7, d0, d19\n\t" - "vmla.f64 d7, d1, d23\n\t" - "vmla.f64 d7, d2, d27\n\t" - "vmla.f64 d7, d3, d31\n\t" - "vst1.64 { d4-d7 }, [r3, :128]\n\t" - : [leftMatrix] "+r"(leftMatrix), [rightMatrix] "+r"(rightMatrix) - : - : "memory", "r3", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d16", - "d17", "d18", "d19", "d20", "d21", "d22", "d23", "d24", "d25", "d26", - "d27", "d28", "d29", "d30", "d31"); -#elif defined(TRANSFORMATION_MATRIX_USE_X86_64_SSE2) - // x86_64 has 16 XMM registers which is enough to do the multiplication fully - // in registers. - __m128d matrixBlockA = _mm_load_pd(&(m_matrix[0][0])); - __m128d matrixBlockC = _mm_load_pd(&(m_matrix[1][0])); - __m128d matrixBlockE = _mm_load_pd(&(m_matrix[2][0])); - __m128d matrixBlockG = _mm_load_pd(&(m_matrix[3][0])); - - // First row. - __m128d otherMatrixFirstParam = _mm_set1_pd(mat.m_matrix[0][0]); - __m128d otherMatrixSecondParam = _mm_set1_pd(mat.m_matrix[0][1]); - __m128d otherMatrixThirdParam = _mm_set1_pd(mat.m_matrix[0][2]); - __m128d otherMatrixFourthParam = _mm_set1_pd(mat.m_matrix[0][3]); - - // output00 and output01. - __m128d accumulator = _mm_mul_pd(matrixBlockA, otherMatrixFirstParam); - __m128d temp1 = _mm_mul_pd(matrixBlockC, otherMatrixSecondParam); - __m128d temp2 = _mm_mul_pd(matrixBlockE, otherMatrixThirdParam); - __m128d temp3 = _mm_mul_pd(matrixBlockG, otherMatrixFourthParam); - - __m128d matrixBlockB = _mm_load_pd(&(m_matrix[0][2])); - __m128d matrixBlockD = _mm_load_pd(&(m_matrix[1][2])); - __m128d matrixBlockF = _mm_load_pd(&(m_matrix[2][2])); - __m128d matrixBlockH = _mm_load_pd(&(m_matrix[3][2])); - - accumulator = _mm_add_pd(accumulator, temp1); - accumulator = _mm_add_pd(accumulator, temp2); - accumulator = _mm_add_pd(accumulator, temp3); - _mm_store_pd(&m_matrix[0][0], accumulator); - - // output02 and output03. - accumulator = _mm_mul_pd(matrixBlockB, otherMatrixFirstParam); - temp1 = _mm_mul_pd(matrixBlockD, otherMatrixSecondParam); - temp2 = _mm_mul_pd(matrixBlockF, otherMatrixThirdParam); - temp3 = _mm_mul_pd(matrixBlockH, otherMatrixFourthParam); - - accumulator = _mm_add_pd(accumulator, temp1); - accumulator = _mm_add_pd(accumulator, temp2); - accumulator = _mm_add_pd(accumulator, temp3); - _mm_store_pd(&m_matrix[0][2], accumulator); - - // Second row. - otherMatrixFirstParam = _mm_set1_pd(mat.m_matrix[1][0]); - otherMatrixSecondParam = _mm_set1_pd(mat.m_matrix[1][1]); - otherMatrixThirdParam = _mm_set1_pd(mat.m_matrix[1][2]); - otherMatrixFourthParam = _mm_set1_pd(mat.m_matrix[1][3]); - - // output10 and output11. - accumulator = _mm_mul_pd(matrixBlockA, otherMatrixFirstParam); - temp1 = _mm_mul_pd(matrixBlockC, otherMatrixSecondParam); - temp2 = _mm_mul_pd(matrixBlockE, otherMatrixThirdParam); - temp3 = _mm_mul_pd(matrixBlockG, otherMatrixFourthParam); - - accumulator = _mm_add_pd(accumulator, temp1); - accumulator = _mm_add_pd(accumulator, temp2); - accumulator = _mm_add_pd(accumulator, temp3); - _mm_store_pd(&m_matrix[1][0], accumulator); - - // output12 and output13. - accumulator = _mm_mul_pd(matrixBlockB, otherMatrixFirstParam); - temp1 = _mm_mul_pd(matrixBlockD, otherMatrixSecondParam); - temp2 = _mm_mul_pd(matrixBlockF, otherMatrixThirdParam); - temp3 = _mm_mul_pd(matrixBlockH, otherMatrixFourthParam); - - accumulator = _mm_add_pd(accumulator, temp1); - accumulator = _mm_add_pd(accumulator, temp2); - accumulator = _mm_add_pd(accumulator, temp3); - _mm_store_pd(&m_matrix[1][2], accumulator); - - // Third row. - otherMatrixFirstParam = _mm_set1_pd(mat.m_matrix[2][0]); - otherMatrixSecondParam = _mm_set1_pd(mat.m_matrix[2][1]); - otherMatrixThirdParam = _mm_set1_pd(mat.m_matrix[2][2]); - otherMatrixFourthParam = _mm_set1_pd(mat.m_matrix[2][3]); - - // output20 and output21. - accumulator = _mm_mul_pd(matrixBlockA, otherMatrixFirstParam); - temp1 = _mm_mul_pd(matrixBlockC, otherMatrixSecondParam); - temp2 = _mm_mul_pd(matrixBlockE, otherMatrixThirdParam); - temp3 = _mm_mul_pd(matrixBlockG, otherMatrixFourthParam); - - accumulator = _mm_add_pd(accumulator, temp1); - accumulator = _mm_add_pd(accumulator, temp2); - accumulator = _mm_add_pd(accumulator, temp3); - _mm_store_pd(&m_matrix[2][0], accumulator); - - // output22 and output23. - accumulator = _mm_mul_pd(matrixBlockB, otherMatrixFirstParam); - temp1 = _mm_mul_pd(matrixBlockD, otherMatrixSecondParam); - temp2 = _mm_mul_pd(matrixBlockF, otherMatrixThirdParam); - temp3 = _mm_mul_pd(matrixBlockH, otherMatrixFourthParam); - - accumulator = _mm_add_pd(accumulator, temp1); - accumulator = _mm_add_pd(accumulator, temp2); - accumulator = _mm_add_pd(accumulator, temp3); - _mm_store_pd(&m_matrix[2][2], accumulator); - - // Fourth row. - otherMatrixFirstParam = _mm_set1_pd(mat.m_matrix[3][0]); - otherMatrixSecondParam = _mm_set1_pd(mat.m_matrix[3][1]); - otherMatrixThirdParam = _mm_set1_pd(mat.m_matrix[3][2]); - otherMatrixFourthParam = _mm_set1_pd(mat.m_matrix[3][3]); - - // output30 and output31. - accumulator = _mm_mul_pd(matrixBlockA, otherMatrixFirstParam); - temp1 = _mm_mul_pd(matrixBlockC, otherMatrixSecondParam); - temp2 = _mm_mul_pd(matrixBlockE, otherMatrixThirdParam); - temp3 = _mm_mul_pd(matrixBlockG, otherMatrixFourthParam); - - accumulator = _mm_add_pd(accumulator, temp1); - accumulator = _mm_add_pd(accumulator, temp2); - accumulator = _mm_add_pd(accumulator, temp3); - _mm_store_pd(&m_matrix[3][0], accumulator); - - // output32 and output33. - accumulator = _mm_mul_pd(matrixBlockB, otherMatrixFirstParam); - temp1 = _mm_mul_pd(matrixBlockD, otherMatrixSecondParam); - temp2 = _mm_mul_pd(matrixBlockF, otherMatrixThirdParam); - temp3 = _mm_mul_pd(matrixBlockH, otherMatrixFourthParam); - - accumulator = _mm_add_pd(accumulator, temp1); - accumulator = _mm_add_pd(accumulator, temp2); - accumulator = _mm_add_pd(accumulator, temp3); - _mm_store_pd(&m_matrix[3][2], accumulator); -#else - Matrix4 tmp; - - tmp[0][0] = (mat.m_matrix[0][0] * m_matrix[0][0] + - mat.m_matrix[0][1] * m_matrix[1][0] + - mat.m_matrix[0][2] * m_matrix[2][0] + - mat.m_matrix[0][3] * m_matrix[3][0]); - tmp[0][1] = (mat.m_matrix[0][0] * m_matrix[0][1] + - mat.m_matrix[0][1] * m_matrix[1][1] + - mat.m_matrix[0][2] * m_matrix[2][1] + - mat.m_matrix[0][3] * m_matrix[3][1]); - tmp[0][2] = (mat.m_matrix[0][0] * m_matrix[0][2] + - mat.m_matrix[0][1] * m_matrix[1][2] + - mat.m_matrix[0][2] * m_matrix[2][2] + - mat.m_matrix[0][3] * m_matrix[3][2]); - tmp[0][3] = (mat.m_matrix[0][0] * m_matrix[0][3] + - mat.m_matrix[0][1] * m_matrix[1][3] + - mat.m_matrix[0][2] * m_matrix[2][3] + - mat.m_matrix[0][3] * m_matrix[3][3]); - - tmp[1][0] = (mat.m_matrix[1][0] * m_matrix[0][0] + - mat.m_matrix[1][1] * m_matrix[1][0] + - mat.m_matrix[1][2] * m_matrix[2][0] + - mat.m_matrix[1][3] * m_matrix[3][0]); - tmp[1][1] = (mat.m_matrix[1][0] * m_matrix[0][1] + - mat.m_matrix[1][1] * m_matrix[1][1] + - mat.m_matrix[1][2] * m_matrix[2][1] + - mat.m_matrix[1][3] * m_matrix[3][1]); - tmp[1][2] = (mat.m_matrix[1][0] * m_matrix[0][2] + - mat.m_matrix[1][1] * m_matrix[1][2] + - mat.m_matrix[1][2] * m_matrix[2][2] + - mat.m_matrix[1][3] * m_matrix[3][2]); - tmp[1][3] = (mat.m_matrix[1][0] * m_matrix[0][3] + - mat.m_matrix[1][1] * m_matrix[1][3] + - mat.m_matrix[1][2] * m_matrix[2][3] + - mat.m_matrix[1][3] * m_matrix[3][3]); - - tmp[2][0] = (mat.m_matrix[2][0] * m_matrix[0][0] + - mat.m_matrix[2][1] * m_matrix[1][0] + - mat.m_matrix[2][2] * m_matrix[2][0] + - mat.m_matrix[2][3] * m_matrix[3][0]); - tmp[2][1] = (mat.m_matrix[2][0] * m_matrix[0][1] + - mat.m_matrix[2][1] * m_matrix[1][1] + - mat.m_matrix[2][2] * m_matrix[2][1] + - mat.m_matrix[2][3] * m_matrix[3][1]); - tmp[2][2] = (mat.m_matrix[2][0] * m_matrix[0][2] + - mat.m_matrix[2][1] * m_matrix[1][2] + - mat.m_matrix[2][2] * m_matrix[2][2] + - mat.m_matrix[2][3] * m_matrix[3][2]); - tmp[2][3] = (mat.m_matrix[2][0] * m_matrix[0][3] + - mat.m_matrix[2][1] * m_matrix[1][3] + - mat.m_matrix[2][2] * m_matrix[2][3] + - mat.m_matrix[2][3] * m_matrix[3][3]); - - tmp[3][0] = (mat.m_matrix[3][0] * m_matrix[0][0] + - mat.m_matrix[3][1] * m_matrix[1][0] + - mat.m_matrix[3][2] * m_matrix[2][0] + - mat.m_matrix[3][3] * m_matrix[3][0]); - tmp[3][1] = (mat.m_matrix[3][0] * m_matrix[0][1] + - mat.m_matrix[3][1] * m_matrix[1][1] + - mat.m_matrix[3][2] * m_matrix[2][1] + - mat.m_matrix[3][3] * m_matrix[3][1]); - tmp[3][2] = (mat.m_matrix[3][0] * m_matrix[0][2] + - mat.m_matrix[3][1] * m_matrix[1][2] + - mat.m_matrix[3][2] * m_matrix[2][2] + - mat.m_matrix[3][3] * m_matrix[3][2]); - tmp[3][3] = (mat.m_matrix[3][0] * m_matrix[0][3] + - mat.m_matrix[3][1] * m_matrix[1][3] + - mat.m_matrix[3][2] * m_matrix[2][3] + - mat.m_matrix[3][3] * m_matrix[3][3]); - - setMatrix(tmp); -#endif - return *this; -} - -void TransformationMatrix::multVecMatrix(double x, - double y, - double& resultX, - double& resultY) const { - resultX = m_matrix[3][0] + x * m_matrix[0][0] + y * m_matrix[1][0]; - resultY = m_matrix[3][1] + x * m_matrix[0][1] + y * m_matrix[1][1]; - double w = m_matrix[3][3] + x * m_matrix[0][3] + y * m_matrix[1][3]; - if (w != 1 && w != 0) { - resultX /= w; - resultY /= w; - } -} - -void TransformationMatrix::multVecMatrix(double x, - double y, - double z, - double& resultX, - double& resultY, - double& resultZ) const { - resultX = m_matrix[3][0] + x * m_matrix[0][0] + y * m_matrix[1][0] + - z * m_matrix[2][0]; - resultY = m_matrix[3][1] + x * m_matrix[0][1] + y * m_matrix[1][1] + - z * m_matrix[2][1]; - resultZ = m_matrix[3][2] + x * m_matrix[0][2] + y * m_matrix[1][2] + - z * m_matrix[2][2]; - double w = m_matrix[3][3] + x * m_matrix[0][3] + y * m_matrix[1][3] + - z * m_matrix[2][3]; - if (w != 1 && w != 0) { - resultX /= w; - resultY /= w; - resultZ /= w; - } -} - -bool TransformationMatrix::isInvertible() const { - if (isIdentityOrTranslation()) - return true; - - double det = blink::determinant4x4(m_matrix); - - if (fabs(det) < SMALL_NUMBER) - return false; - - return true; -} - -TransformationMatrix TransformationMatrix::inverse() const { - if (isIdentityOrTranslation()) { - // identity matrix - if (m_matrix[3][0] == 0 && m_matrix[3][1] == 0 && m_matrix[3][2] == 0) - return TransformationMatrix(); - - // translation - return TransformationMatrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, - -m_matrix[3][0], -m_matrix[3][1], - -m_matrix[3][2], 1); - } - - TransformationMatrix invMat; - bool inverted = blink::inverse(m_matrix, invMat.m_matrix); - if (!inverted) - return TransformationMatrix(); - - return invMat; -} - -void TransformationMatrix::makeAffine() { - m_matrix[0][2] = 0; - m_matrix[0][3] = 0; - - m_matrix[1][2] = 0; - m_matrix[1][3] = 0; - - m_matrix[2][0] = 0; - m_matrix[2][1] = 0; - m_matrix[2][2] = 1; - m_matrix[2][3] = 0; - - m_matrix[3][2] = 0; - m_matrix[3][3] = 1; -} - -AffineTransform TransformationMatrix::toAffineTransform() const { - return AffineTransform(m_matrix[0][0], m_matrix[0][1], m_matrix[1][0], - m_matrix[1][1], m_matrix[3][0], m_matrix[3][1]); -} - -static inline void blendFloat(double& from, double to, double progress) { - if (from != to) - from = from + (to - from) * progress; -} - -void TransformationMatrix::blend(const TransformationMatrix& from, - double progress) { - if (from.isIdentity() && isIdentity()) - return; - - // decompose - DecomposedType fromDecomp; - DecomposedType toDecomp; - if (!from.decompose(fromDecomp) || !decompose(toDecomp)) { - if (progress < 0.5) - *this = from; - return; - } - - // interpolate - blendFloat(fromDecomp.scaleX, toDecomp.scaleX, progress); - blendFloat(fromDecomp.scaleY, toDecomp.scaleY, progress); - blendFloat(fromDecomp.scaleZ, toDecomp.scaleZ, progress); - blendFloat(fromDecomp.skewXY, toDecomp.skewXY, progress); - blendFloat(fromDecomp.skewXZ, toDecomp.skewXZ, progress); - blendFloat(fromDecomp.skewYZ, toDecomp.skewYZ, progress); - blendFloat(fromDecomp.translateX, toDecomp.translateX, progress); - blendFloat(fromDecomp.translateY, toDecomp.translateY, progress); - blendFloat(fromDecomp.translateZ, toDecomp.translateZ, progress); - blendFloat(fromDecomp.perspectiveX, toDecomp.perspectiveX, progress); - blendFloat(fromDecomp.perspectiveY, toDecomp.perspectiveY, progress); - blendFloat(fromDecomp.perspectiveZ, toDecomp.perspectiveZ, progress); - blendFloat(fromDecomp.perspectiveW, toDecomp.perspectiveW, progress); - - slerp(&fromDecomp.quaternionX, &toDecomp.quaternionX, progress); - - // recompose - recompose(fromDecomp); -} - -bool TransformationMatrix::decompose(DecomposedType& decomp) const { - if (isIdentity()) { - memset(&decomp, 0, sizeof(decomp)); - decomp.perspectiveW = 1; - decomp.scaleX = 1; - decomp.scaleY = 1; - decomp.scaleZ = 1; - } - - if (!blink::decompose(m_matrix, decomp)) - return false; - return true; -} - -void TransformationMatrix::recompose(const DecomposedType& decomp) { - makeIdentity(); - - // first apply perspective - m_matrix[0][3] = decomp.perspectiveX; - m_matrix[1][3] = decomp.perspectiveY; - m_matrix[2][3] = decomp.perspectiveZ; - m_matrix[3][3] = decomp.perspectiveW; - - // now translate - translate3d(decomp.translateX, decomp.translateY, decomp.translateZ); - - // apply rotation - double xx = decomp.quaternionX * decomp.quaternionX; - double xy = decomp.quaternionX * decomp.quaternionY; - double xz = decomp.quaternionX * decomp.quaternionZ; - double xw = decomp.quaternionX * decomp.quaternionW; - double yy = decomp.quaternionY * decomp.quaternionY; - double yz = decomp.quaternionY * decomp.quaternionZ; - double yw = decomp.quaternionY * decomp.quaternionW; - double zz = decomp.quaternionZ * decomp.quaternionZ; - double zw = decomp.quaternionZ * decomp.quaternionW; - - // Construct a composite rotation matrix from the quaternion values - TransformationMatrix rotationMatrix( - 1 - 2 * (yy + zz), 2 * (xy - zw), 2 * (xz + yw), 0, 2 * (xy + zw), - 1 - 2 * (xx + zz), 2 * (yz - xw), 0, 2 * (xz - yw), 2 * (yz + xw), - 1 - 2 * (xx + yy), 0, 0, 0, 0, 1); - - multiply(rotationMatrix); - - // now apply skew - if (decomp.skewYZ) { - TransformationMatrix tmp; - tmp.setM32(decomp.skewYZ); - multiply(tmp); - } - - if (decomp.skewXZ) { - TransformationMatrix tmp; - tmp.setM31(decomp.skewXZ); - multiply(tmp); - } - - if (decomp.skewXY) { - TransformationMatrix tmp; - tmp.setM21(decomp.skewXY); - multiply(tmp); - } - - // finally, apply scale - scale3d(decomp.scaleX, decomp.scaleY, decomp.scaleZ); -} - -bool TransformationMatrix::isIntegerTranslation() const { - if (!isIdentityOrTranslation()) - return false; - - // Check for translate Z. - if (m_matrix[3][2]) - return false; - - // Check for non-integer translate X/Y. - if (static_cast(m_matrix[3][0]) != m_matrix[3][0] || - static_cast(m_matrix[3][1]) != m_matrix[3][1]) - return false; - - return true; -} - -TransformationMatrix TransformationMatrix::to2dTransform() const { - return TransformationMatrix(m_matrix[0][0], m_matrix[0][1], 0, m_matrix[0][3], - m_matrix[1][0], m_matrix[1][1], 0, m_matrix[1][3], - 0, 0, 1, 0, m_matrix[3][0], m_matrix[3][1], 0, - m_matrix[3][3]); -} - -void TransformationMatrix::toColumnMajorFloatArray(FloatMatrix4& result) const { - result[0] = m11(); - result[1] = m12(); - result[2] = m13(); - result[3] = m14(); - result[4] = m21(); - result[5] = m22(); - result[6] = m23(); - result[7] = m24(); - result[8] = m31(); - result[9] = m32(); - result[10] = m33(); - result[11] = m34(); - result[12] = m41(); - result[13] = m42(); - result[14] = m43(); - result[15] = m44(); -} - -SkMatrix44 TransformationMatrix::toSkMatrix44( - const TransformationMatrix& matrix) { - SkMatrix44 ret(SkMatrix44::kUninitialized_Constructor); - ret.setDouble(0, 0, matrix.m11()); - ret.setDouble(0, 1, matrix.m21()); - ret.setDouble(0, 2, matrix.m31()); - ret.setDouble(0, 3, matrix.m41()); - ret.setDouble(1, 0, matrix.m12()); - ret.setDouble(1, 1, matrix.m22()); - ret.setDouble(1, 2, matrix.m32()); - ret.setDouble(1, 3, matrix.m42()); - ret.setDouble(2, 0, matrix.m13()); - ret.setDouble(2, 1, matrix.m23()); - ret.setDouble(2, 2, matrix.m33()); - ret.setDouble(2, 3, matrix.m43()); - ret.setDouble(3, 0, matrix.m14()); - ret.setDouble(3, 1, matrix.m24()); - ret.setDouble(3, 2, matrix.m34()); - ret.setDouble(3, 3, matrix.m44()); - return ret; -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/TransformationMatrix.h b/sky/engine/platform/transforms/TransformationMatrix.h deleted file mode 100644 index 6504afdec431f..0000000000000 --- a/sky/engine/platform/transforms/TransformationMatrix.h +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSFORMATIONMATRIX_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSFORMATIONMATRIX_H_ - -#include //for memcpy -#include "flutter/sky/engine/platform/geometry/FloatPoint.h" -#include "flutter/sky/engine/platform/geometry/FloatPoint3D.h" -#include "flutter/sky/engine/platform/geometry/IntPoint.h" -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" -#include "third_party/skia/include/core/SkMatrix44.h" - -namespace blink { - -class AffineTransform; -class IntRect; -class LayoutRect; -class FloatRect; -class FloatQuad; -class FloatBox; -#if CPU(X86_64) && !OS(WIN) -#define TRANSFORMATION_MATRIX_USE_X86_64_SSE2 -#endif - -class PLATFORM_EXPORT TransformationMatrix { - WTF_MAKE_FAST_ALLOCATED; - - public: -#if CPU(APPLE_ARMV7S) || defined(TRANSFORMATION_MATRIX_USE_X86_64_SSE2) - typedef double Matrix4[4][4] __attribute__((aligned(16))); -#else - typedef double Matrix4[4][4]; -#endif - - TransformationMatrix() { makeIdentity(); } - TransformationMatrix(const AffineTransform& t); - TransformationMatrix(const TransformationMatrix& t) { *this = t; } - TransformationMatrix(double a, - double b, - double c, - double d, - double e, - double f) { - setMatrix(a, b, c, d, e, f); - } - TransformationMatrix(double m11, - double m12, - double m13, - double m14, - double m21, - double m22, - double m23, - double m24, - double m31, - double m32, - double m33, - double m34, - double m41, - double m42, - double m43, - double m44) { - setMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, - m42, m43, m44); - } - - void setMatrix(double a, double b, double c, double d, double e, double f) { - m_matrix[0][0] = a; - m_matrix[0][1] = b; - m_matrix[0][2] = 0; - m_matrix[0][3] = 0; - m_matrix[1][0] = c; - m_matrix[1][1] = d; - m_matrix[1][2] = 0; - m_matrix[1][3] = 0; - m_matrix[2][0] = 0; - m_matrix[2][1] = 0; - m_matrix[2][2] = 1; - m_matrix[2][3] = 0; - m_matrix[3][0] = e; - m_matrix[3][1] = f; - m_matrix[3][2] = 0; - m_matrix[3][3] = 1; - } - - void setMatrix(double m11, - double m12, - double m13, - double m14, - double m21, - double m22, - double m23, - double m24, - double m31, - double m32, - double m33, - double m34, - double m41, - double m42, - double m43, - double m44) { - m_matrix[0][0] = m11; - m_matrix[0][1] = m12; - m_matrix[0][2] = m13; - m_matrix[0][3] = m14; - m_matrix[1][0] = m21; - m_matrix[1][1] = m22; - m_matrix[1][2] = m23; - m_matrix[1][3] = m24; - m_matrix[2][0] = m31; - m_matrix[2][1] = m32; - m_matrix[2][2] = m33; - m_matrix[2][3] = m34; - m_matrix[3][0] = m41; - m_matrix[3][1] = m42; - m_matrix[3][2] = m43; - m_matrix[3][3] = m44; - } - - TransformationMatrix& operator=(const TransformationMatrix& t) { - setMatrix(t.m_matrix); - return *this; - } - - TransformationMatrix& makeIdentity() { - setMatrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); - return *this; - } - - bool isIdentity() const { - return m_matrix[0][0] == 1 && m_matrix[0][1] == 0 && m_matrix[0][2] == 0 && - m_matrix[0][3] == 0 && m_matrix[1][0] == 0 && m_matrix[1][1] == 1 && - m_matrix[1][2] == 0 && m_matrix[1][3] == 0 && m_matrix[2][0] == 0 && - m_matrix[2][1] == 0 && m_matrix[2][2] == 1 && m_matrix[2][3] == 0 && - m_matrix[3][0] == 0 && m_matrix[3][1] == 0 && m_matrix[3][2] == 0 && - m_matrix[3][3] == 1; - } - - // This form preserves the double math from input to output - void map(double x, double y, double& x2, double& y2) const { - multVecMatrix(x, y, x2, y2); - } - - // Map a 3D point through the transform, returning a 3D point. - FloatPoint3D mapPoint(const FloatPoint3D&) const; - - // Map a 2D point through the transform, returning a 2D point. - // Note that this ignores the z component, effectively projecting the point - // into the z=0 plane. - FloatPoint mapPoint(const FloatPoint&) const; - - // Like the version above, except that it rounds the mapped point to the - // nearest integer value. - IntPoint mapPoint(const IntPoint& p) const { - return roundedIntPoint(mapPoint(FloatPoint(p))); - } - - // If the matrix has 3D components, the z component of the result is - // dropped, effectively projecting the rect into the z=0 plane - FloatRect mapRect(const FloatRect&) const; - - // Rounds the resulting mapped rectangle out. This is helpful for bounding - // box computations but may not be what is wanted in other contexts. - IntRect mapRect(const IntRect&) const; - LayoutRect mapRect(const LayoutRect&) const; - - // If the matrix has 3D components, the z component of the result is - // dropped, effectively projecting the quad into the z=0 plane - FloatQuad mapQuad(const FloatQuad&) const; - - // Map a point on the z=0 plane into a point on - // the plane with with the transform applied, by extending - // a ray perpendicular to the source plane and computing - // the local x,y position of the point where that ray intersects - // with the destination plane. - FloatPoint projectPoint(const FloatPoint&, bool* clamped = 0) const; - // Projects the four corners of the quad - FloatQuad projectQuad(const FloatQuad&, bool* clamped = 0) const; - // Projects the four corners of the quad and takes a bounding box, - // while sanitizing values created when the w component is negative. - LayoutRect clampedBoundsOfProjectedQuad(const FloatQuad&) const; - - void transformBox(FloatBox&) const; - - double m11() const { return m_matrix[0][0]; } - void setM11(double f) { m_matrix[0][0] = f; } - double m12() const { return m_matrix[0][1]; } - void setM12(double f) { m_matrix[0][1] = f; } - double m13() const { return m_matrix[0][2]; } - void setM13(double f) { m_matrix[0][2] = f; } - double m14() const { return m_matrix[0][3]; } - void setM14(double f) { m_matrix[0][3] = f; } - double m21() const { return m_matrix[1][0]; } - void setM21(double f) { m_matrix[1][0] = f; } - double m22() const { return m_matrix[1][1]; } - void setM22(double f) { m_matrix[1][1] = f; } - double m23() const { return m_matrix[1][2]; } - void setM23(double f) { m_matrix[1][2] = f; } - double m24() const { return m_matrix[1][3]; } - void setM24(double f) { m_matrix[1][3] = f; } - double m31() const { return m_matrix[2][0]; } - void setM31(double f) { m_matrix[2][0] = f; } - double m32() const { return m_matrix[2][1]; } - void setM32(double f) { m_matrix[2][1] = f; } - double m33() const { return m_matrix[2][2]; } - void setM33(double f) { m_matrix[2][2] = f; } - double m34() const { return m_matrix[2][3]; } - void setM34(double f) { m_matrix[2][3] = f; } - double m41() const { return m_matrix[3][0]; } - void setM41(double f) { m_matrix[3][0] = f; } - double m42() const { return m_matrix[3][1]; } - void setM42(double f) { m_matrix[3][1] = f; } - double m43() const { return m_matrix[3][2]; } - void setM43(double f) { m_matrix[3][2] = f; } - double m44() const { return m_matrix[3][3]; } - void setM44(double f) { m_matrix[3][3] = f; } - - double a() const { return m_matrix[0][0]; } - void setA(double a) { m_matrix[0][0] = a; } - - double b() const { return m_matrix[0][1]; } - void setB(double b) { m_matrix[0][1] = b; } - - double c() const { return m_matrix[1][0]; } - void setC(double c) { m_matrix[1][0] = c; } - - double d() const { return m_matrix[1][1]; } - void setD(double d) { m_matrix[1][1] = d; } - - double e() const { return m_matrix[3][0]; } - void setE(double e) { m_matrix[3][0] = e; } - - double f() const { return m_matrix[3][1]; } - void setF(double f) { m_matrix[3][1] = f; } - - // this = mat * this. - TransformationMatrix& multiply(const TransformationMatrix&); - - TransformationMatrix& scale(double); - TransformationMatrix& scaleNonUniform(double sx, double sy); - TransformationMatrix& scale3d(double sx, double sy, double sz); - - TransformationMatrix& rotate(double d) { return rotate3d(0, 0, d); } - TransformationMatrix& rotateFromVector(double x, double y); - TransformationMatrix& rotate3d(double rx, double ry, double rz); - - // The vector (x,y,z) is normalized if it's not already. A vector of - // (0,0,0) uses a vector of (0,0,1). - TransformationMatrix& rotate3d(double x, double y, double z, double angle); - - TransformationMatrix& translate(double tx, double ty); - TransformationMatrix& translate3d(double tx, double ty, double tz); - - // translation added with a post-multiply - TransformationMatrix& translateRight(double tx, double ty); - TransformationMatrix& translateRight3d(double tx, double ty, double tz); - - TransformationMatrix& flipX(); - TransformationMatrix& flipY(); - TransformationMatrix& skew(double angleX, double angleY); - TransformationMatrix& skewX(double angle) { return skew(angle, 0); } - TransformationMatrix& skewY(double angle) { return skew(0, angle); } - - TransformationMatrix& applyPerspective(double p); - bool hasPerspective() const { return m_matrix[2][3] != 0.0f; } - - // returns a transformation that maps a rect to a rect - static TransformationMatrix rectToRect(const FloatRect&, const FloatRect&); - - bool isInvertible() const; - - // This method returns the identity matrix if it is not invertible. - // Use isInvertible() before calling this if you need to know. - TransformationMatrix inverse() const; - - // decompose the matrix into its component parts - typedef struct { - double scaleX, scaleY, scaleZ; - double skewXY, skewXZ, skewYZ; - double quaternionX, quaternionY, quaternionZ, quaternionW; - double translateX, translateY, translateZ; - double perspectiveX, perspectiveY, perspectiveZ, perspectiveW; - } DecomposedType; - - bool decompose(DecomposedType& decomp) const; - void recompose(const DecomposedType& decomp); - - void blend(const TransformationMatrix& from, double progress); - - bool isAffine() const { - return (m13() == 0 && m14() == 0 && m23() == 0 && m24() == 0 && - m31() == 0 && m32() == 0 && m33() == 1 && m34() == 0 && - m43() == 0 && m44() == 1); - } - - // Throw away the non-affine parts of the matrix (lossy!) - void makeAffine(); - - AffineTransform toAffineTransform() const; - - bool operator==(const TransformationMatrix& m2) const { - return (m_matrix[0][0] == m2.m_matrix[0][0] && - m_matrix[0][1] == m2.m_matrix[0][1] && - m_matrix[0][2] == m2.m_matrix[0][2] && - m_matrix[0][3] == m2.m_matrix[0][3] && - m_matrix[1][0] == m2.m_matrix[1][0] && - m_matrix[1][1] == m2.m_matrix[1][1] && - m_matrix[1][2] == m2.m_matrix[1][2] && - m_matrix[1][3] == m2.m_matrix[1][3] && - m_matrix[2][0] == m2.m_matrix[2][0] && - m_matrix[2][1] == m2.m_matrix[2][1] && - m_matrix[2][2] == m2.m_matrix[2][2] && - m_matrix[2][3] == m2.m_matrix[2][3] && - m_matrix[3][0] == m2.m_matrix[3][0] && - m_matrix[3][1] == m2.m_matrix[3][1] && - m_matrix[3][2] == m2.m_matrix[3][2] && - m_matrix[3][3] == m2.m_matrix[3][3]); - } - - bool operator!=(const TransformationMatrix& other) const { - return !(*this == other); - } - - // *this = *this * t - TransformationMatrix& operator*=(const TransformationMatrix& t) { - return multiply(t); - } - - // result = *this * t - TransformationMatrix operator*(const TransformationMatrix& t) const { - TransformationMatrix result = *this; - result.multiply(t); - return result; - } - - bool isIdentityOrTranslation() const { - return m_matrix[0][0] == 1 && m_matrix[0][1] == 0 && m_matrix[0][2] == 0 && - m_matrix[0][3] == 0 && m_matrix[1][0] == 0 && m_matrix[1][1] == 1 && - m_matrix[1][2] == 0 && m_matrix[1][3] == 0 && m_matrix[2][0] == 0 && - m_matrix[2][1] == 0 && m_matrix[2][2] == 1 && m_matrix[2][3] == 0 && - m_matrix[3][3] == 1; - } - - bool isIntegerTranslation() const; - - // This method returns the matrix without 3D components. - TransformationMatrix to2dTransform() const; - - typedef float FloatMatrix4[16]; - void toColumnMajorFloatArray(FloatMatrix4& result) const; - - static SkMatrix44 toSkMatrix44(const TransformationMatrix&); - - private: - // multiply passed 2D point by matrix (assume z=0) - void multVecMatrix(double x, double y, double& dstX, double& dstY) const; - FloatPoint internalMapPoint(const FloatPoint& sourcePoint) const { - double resultX; - double resultY; - multVecMatrix(sourcePoint.x(), sourcePoint.y(), resultX, resultY); - return FloatPoint(static_cast(resultX), static_cast(resultY)); - } - - // multiply passed 3D point by matrix - void multVecMatrix(double x, - double y, - double z, - double& dstX, - double& dstY, - double& dstZ) const; - FloatPoint3D internalMapPoint(const FloatPoint3D& sourcePoint) const { - double resultX; - double resultY; - double resultZ; - multVecMatrix(sourcePoint.x(), sourcePoint.y(), sourcePoint.z(), resultX, - resultY, resultZ); - return FloatPoint3D(static_cast(resultX), - static_cast(resultY), - static_cast(resultZ)); - } - - void setMatrix(const Matrix4 m) { - if (m && m != m_matrix) - memcpy(m_matrix, m, sizeof(Matrix4)); - } - - Matrix4 m_matrix; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSFORMATIONMATRIX_H_ diff --git a/sky/engine/platform/transforms/TransformationMatrixTest.cpp b/sky/engine/platform/transforms/TransformationMatrixTest.cpp deleted file mode 100644 index b487a19b71b30..0000000000000 --- a/sky/engine/platform/transforms/TransformationMatrixTest.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/platform/transforms/TransformationMatrix.h" - -#include - -using namespace blink; -namespace { - -TEST(TransformationMatrixTest, NonInvertableBlendTest) { - TransformationMatrix from; - TransformationMatrix to(2.7133590938, 0.0, 0.0, 0.0, 0.0, 2.4645137761, 0.0, - 0.0, 0.0, 0.0, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05); - TransformationMatrix result; - - result = to; - result.blend(from, 0.25); - EXPECT_TRUE(result == from); - - result = to; - result.blend(from, 0.75); - EXPECT_TRUE(result == to); -} - -} // namespace diff --git a/sky/engine/platform/transforms/TranslateTransformOperation.cpp b/sky/engine/platform/transforms/TranslateTransformOperation.cpp deleted file mode 100644 index d41a0b0d00f06..0000000000000 --- a/sky/engine/platform/transforms/TranslateTransformOperation.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/platform/transforms/TranslateTransformOperation.h" - -namespace blink { - -PassRefPtr TranslateTransformOperation::blend( - const TransformOperation* from, - double progress, - bool blendToIdentity) { - if (from && !from->canBlendWith(*this)) - return this; - - const Length zeroLength(0, Fixed); - if (blendToIdentity) - return TranslateTransformOperation::create( - zeroLength.blend(m_x, progress, ValueRangeAll), - zeroLength.blend(m_y, progress, ValueRangeAll), - blink::blend(0., m_z, progress), m_type); - - const TranslateTransformOperation* fromOp = - static_cast(from); - Length fromX = fromOp ? fromOp->m_x : zeroLength; - Length fromY = fromOp ? fromOp->m_y : zeroLength; - double fromZ = fromOp ? fromOp->m_z : 0; - return TranslateTransformOperation::create( - m_x.blend(fromX, progress, ValueRangeAll), - m_y.blend(fromY, progress, ValueRangeAll), - blink::blend(fromZ, m_z, progress), m_type); -} - -bool TranslateTransformOperation::canBlendWith( - const TransformOperation& other) const { - return other.type() == Translate || other.type() == TranslateX || - other.type() == TranslateY || other.type() == TranslateZ || - other.type() == Translate3D; -} - -} // namespace blink diff --git a/sky/engine/platform/transforms/TranslateTransformOperation.h b/sky/engine/platform/transforms/TranslateTransformOperation.h deleted file mode 100644 index 022ca8f80cc7c..0000000000000 --- a/sky/engine/platform/transforms/TranslateTransformOperation.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2000 Lars Knoll (knoll@kde.org) - * (C) 2000 Antti Koivisto (koivisto@kde.org) - * (C) 2000 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSLATETRANSFORMOPERATION_H_ -#define SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSLATETRANSFORMOPERATION_H_ - -#include "flutter/sky/engine/platform/Length.h" -#include "flutter/sky/engine/platform/LengthFunctions.h" -#include "flutter/sky/engine/platform/transforms/TransformOperation.h" - -namespace blink { - -class PLATFORM_EXPORT TranslateTransformOperation : public TransformOperation { - public: - static PassRefPtr create(const Length& tx, - const Length& ty, - OperationType type) { - return adoptRef(new TranslateTransformOperation(tx, ty, 0, type)); - } - - static PassRefPtr create(const Length& tx, - const Length& ty, - double tz, - OperationType type) { - return adoptRef(new TranslateTransformOperation(tx, ty, tz, type)); - } - - virtual bool canBlendWith(const TransformOperation& other) const; - - double x(const FloatSize& borderBoxSize) const { - return floatValueForLength(m_x, borderBoxSize.width()); - } - double y(const FloatSize& borderBoxSize) const { - return floatValueForLength(m_y, borderBoxSize.height()); - } - - Length x() const { return m_x; } - Length y() const { return m_y; } - double z() const { return m_z; } - - private: - virtual bool isIdentity() const override { - return !floatValueForLength(m_x, 1) && !floatValueForLength(m_y, 1) && !m_z; - } - - virtual OperationType type() const override { return m_type; } - - virtual bool operator==(const TransformOperation& o) const override { - if (!isSameType(o)) - return false; - const TranslateTransformOperation* t = - static_cast(&o); - return m_x == t->m_x && m_y == t->m_y && m_z == t->m_z; - } - - virtual void apply(TransformationMatrix& transform, - const FloatSize& borderBoxSize) const override { - transform.translate3d(x(borderBoxSize), y(borderBoxSize), z()); - } - - virtual PassRefPtr blend( - const TransformOperation* from, - double progress, - bool blendToIdentity = false) override; - - virtual bool dependsOnBoxSize() const override { - return m_x.isPercent() || m_y.isPercent(); - } - - TranslateTransformOperation(const Length& tx, - const Length& ty, - double tz, - OperationType type) - : m_x(tx), m_y(ty), m_z(tz), m_type(type) { - ASSERT(type == TranslateX || type == TranslateY || type == TranslateZ || - type == Translate || type == Translate3D); - } - - Length m_x; - Length m_y; - double m_z; - OperationType m_type; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PLATFORM_TRANSFORMS_TRANSLATETRANSFORMOPERATION_H_ diff --git a/sky/engine/public/BUILD.gn b/sky/engine/public/BUILD.gn deleted file mode 100644 index 76041ba280e9f..0000000000000 --- a/sky/engine/public/BUILD.gn +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2014 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. - -group("test_support") { - deps = [ - "$flutter_root/sky/engine/web:test_support", - ] -} - -source_set("platform_headers") { - public = [ - "platform/Platform.h", - "platform/WebBlendMode.h", - "platform/WebCommon.h", - "platform/WebDiscardableMemory.h", - ] - - public_configs = [ - "$flutter_root:config", - ] -} - -source_set("web_headers") { - public = [ - "web/Sky.h", - ] - - public_configs = [ - "$flutter_root:config", - ] -} diff --git a/sky/engine/public/platform/Platform.h b/sky/engine/public/platform/Platform.h deleted file mode 100644 index 2a1980d9616a1..0000000000000 --- a/sky/engine/public/platform/Platform.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PUBLIC_PLATFORM_PLATFORM_H_ -#define SKY_ENGINE_PUBLIC_PLATFORM_PLATFORM_H_ - -#include - -#include "flutter/sky/engine/public/platform/WebCommon.h" - -namespace blink { -class WebDiscardableMemory; - -class Platform { - public: - // HTML5 Database ------------------------------------------------------ - typedef int FileHandle; - - BLINK_PLATFORM_EXPORT static void initialize(Platform*); - BLINK_PLATFORM_EXPORT static void shutdown(); - BLINK_PLATFORM_EXPORT static Platform* current(); - - // Allocates discardable memory. May return 0, even if the platform supports - // discardable memory. If nonzero, however, then the WebDiscardableMmeory is - // returned in an locked state. You may use its underlying data() member - // directly, taking care to unlock it when you are ready to let it become - // discardable. - virtual WebDiscardableMemory* allocateAndLockDiscardableMemory(size_t bytes) { - return 0; - } - - // System -------------------------------------------------------------- - - // Returns a value such as "en-US". - virtual std::string defaultLocale() { return std::string(); } - - protected: - virtual ~Platform() {} -}; - -} // namespace blink - -#endif // SKY_ENGINE_PUBLIC_PLATFORM_PLATFORM_H_ diff --git a/sky/engine/public/platform/WebBlendMode.h b/sky/engine/public/platform/WebBlendMode.h deleted file mode 100644 index 0aed97402dd36..0000000000000 --- a/sky/engine/public/platform/WebBlendMode.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PUBLIC_PLATFORM_WEBBLENDMODE_H_ -#define SKY_ENGINE_PUBLIC_PLATFORM_WEBBLENDMODE_H_ - -#include "flutter/sky/engine/public/platform/WebCommon.h" - -namespace blink { - -enum WebBlendMode { - WebBlendModeNormal, - WebBlendModeMultiply, - WebBlendModeScreen, - WebBlendModeOverlay, - WebBlendModeDarken, - WebBlendModeLighten, - WebBlendModeColorDodge, - WebBlendModeColorBurn, - WebBlendModeHardLight, - WebBlendModeSofxlight, - WebBlendModeDifference, - WebBlendModeExclusion, - WebBlendModeHue, - WebBlendModeSaturation, - WebBlendModeColor, - WebBlendModeLuminosity -}; - -} // namespace blink - -#endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBBLENDMODE_H_ diff --git a/sky/engine/public/platform/WebCommon.h b/sky/engine/public/platform/WebCommon.h deleted file mode 100644 index ae1d890aefcb9..0000000000000 --- a/sky/engine/public/platform/WebCommon.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PUBLIC_PLATFORM_WEBCOMMON_H_ -#define SKY_ENGINE_PUBLIC_PLATFORM_WEBCOMMON_H_ - -#if !defined(BLINK_IMPLEMENTATION) -#define BLINK_IMPLEMENTATION 0 -#endif - -#if !defined(BLINK_PLATFORM_IMPLEMENTATION) -#define BLINK_PLATFORM_IMPLEMENTATION 0 -#endif - -#if !defined(BLINK_COMMON_IMPLEMENTATION) -#define BLINK_COMMON_IMPLEMENTATION 0 -#endif - -#if defined(COMPONENT_BUILD) -#define BLINK_EXPORT __attribute__((visibility("default"))) -#define BLINK_PLATFORM_EXPORT __attribute__((visibility("default"))) -#define BLINK_COMMON_EXPORT __attribute__((visibility("default"))) -#else // defined(COMPONENT_BUILD) -#define BLINK_EXPORT -#define BLINK_PLATFORM_EXPORT -#define BLINK_COMMON_EXPORT -#endif - -// ----------------------------------------------------------------------------- -// Basic types - -#include // For size_t -#include // For int32_t - -namespace blink { - -// UTF-32 character type -typedef int32_t WebUChar32; - -// UTF-16 character type -typedef unsigned short WebUChar; - -// Latin-1 character type -typedef unsigned char WebLChar; - -// ----------------------------------------------------------------------------- -// Assertions - -BLINK_COMMON_EXPORT void failedAssertion(const char* file, - int line, - const char* function, - const char* assertion); - -} // namespace blink - -// Ideally, only use inside the public directory but outside of INSIDE_BLINK -// blocks. (Otherwise use WTF's ASSERT.) -#if defined(NDEBUG) -#define BLINK_ASSERT(assertion) ((void)0) -#else -#define BLINK_ASSERT(assertion) \ - do { \ - if (!(assertion)) \ - failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \ - } while (0) -#endif - -#define BLINK_ASSERT_NOT_REACHED() BLINK_ASSERT(0) - -#endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBCOMMON_H_ diff --git a/sky/engine/public/platform/WebDiscardableMemory.h b/sky/engine/public/platform/WebDiscardableMemory.h deleted file mode 100644 index 5feb541228ed4..0000000000000 --- a/sky/engine/public/platform/WebDiscardableMemory.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PUBLIC_PLATFORM_WEBDISCARDABLEMEMORY_H_ -#define SKY_ENGINE_PUBLIC_PLATFORM_WEBDISCARDABLEMEMORY_H_ - -namespace blink { - -// A memory allocation that can be automatically discarded by the operating -// system under memory pressure. -// -// Discardable usage is typically: -// WebDiscardableMemory* mem = allocateAndLockedDiscardableMemory(1024*1024); -// void* data = mem->data(); -// memset(data, 3, 1024*1024); -// mem->unlock(); -// -// Later, when you need it again: -// if (!mem->lock()) { -// ... handle the fact that the memory is gone... -// delete mem; // Make sure to destroy it. It is never going to come back. -// return; -// } -// ... use mem->data() as much as you want -// mem->unlock(); -// -class WebDiscardableMemory { - public: - // Must not be called while locked. - virtual ~WebDiscardableMemory() {} - - // Locks the memory, prevent it from being discarded. Once locked. you may - // obtain a pointer to that memory using the data() method. - // - // lock() may return false, indicating that the underlying memory was - // discarded and that the lock failed. In this case, the - // WebDiscardableMemory is effectively dead. - // - // Nested calls to lock are not allowed. - virtual bool lock() = 0; - - // Returns the current pointer for the discardable memory. This call is ONLY - // valid when the discardable memory object is locked. - virtual void* data() = 0; - - // Unlock the memory so that it can be purged by the system. Must be called - // after every successful lock call. - virtual void unlock() = 0; -}; - -} // namespace blink - -#endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBDISCARDABLEMEMORY_H_ diff --git a/sky/engine/public/web/Sky.h b/sky/engine/public/web/Sky.h deleted file mode 100644 index 16c79006375ba..0000000000000 --- a/sky/engine/public/web/Sky.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_PUBLIC_WEB_SKY_H_ -#define SKY_ENGINE_PUBLIC_WEB_SKY_H_ - -#include "../platform/Platform.h" - -namespace blink { - -// Must be called on the thread that will be the main WebKit thread before -// using any other WebKit APIs. The provided Platform; must be -// non-null and must remain valid until the current thread calls shutdown. -BLINK_EXPORT void InitEngine(Platform*); - -// Once shutdown, the Platform passed to initialize will no longer -// be accessed. No other WebKit objects should be in use when this function is -// called. Any background threads created by WebKit are promised to be -// terminated by the time this function returns. -BLINK_EXPORT void ShutdownEngine(); - -} // namespace blink - -#endif // SKY_ENGINE_PUBLIC_WEB_SKY_H_ diff --git a/sky/engine/web/BUILD.gn b/sky/engine/web/BUILD.gn deleted file mode 100644 index f96d58cb09cd6..0000000000000 --- a/sky/engine/web/BUILD.gn +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2014 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. - -source_set("web") { - sources = [ - "Sky.cpp", - ] - - deps = [ - "$flutter_root/sky/engine/core", - "$flutter_root/sky/engine/platform", - ] - - configs += [ - "$flutter_root/sky/engine:config", - "$flutter_root/sky/engine:inside_blink", - "$flutter_root/sky/engine:non_test_config", - ] - - public_configs = [ - "$flutter_root:config", - ] - - if (is_fuchsia) { - deps += [ "//garnet/public/lib/fsl" ] - } else { - deps += [ "$flutter_root/fml" ] - } -} diff --git a/sky/engine/web/Sky.cpp b/sky/engine/web/Sky.cpp deleted file mode 100644 index 52c6243743d7b..0000000000000 --- a/sky/engine/web/Sky.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/public/web/Sky.h" - -#include "flutter/glue/trace_event.h" -#include "flutter/sky/engine/core/Init.h" -#include "flutter/sky/engine/public/platform/Platform.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/MainThread.h" -#include "flutter/sky/engine/wtf/WTF.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/TextEncoding.h" -#include "lib/fxl/build_config.h" -#include "lib/tonic/dart_microtask_queue.h" - -#if defined(OS_FUCHSIA) - -#include "lib/fsl/tasks/message_loop.h" // nogncheck - -#else // defined(OS_FUCHSIA) - -#include "flutter/fml/message_loop.h" // nogncheck - -#endif // defined(OS_FUCHSIA) - -namespace blink { - -// Make sure we are not re-initialized in the same address space. -// Doing so may cause hard to reproduce crashes. -static bool s_webKitInitialized = false; - -void InitEngine(Platform* platform) { - TRACE_EVENT0("flutter", "InitEngine"); - - ASSERT(!s_webKitInitialized); - s_webKitInitialized = true; - - ASSERT(platform); - Platform::initialize(platform); - - WTF::initialize(); - WTF::initializeMainThread(); - - DEFINE_STATIC_LOCAL(CoreInitializer, initializer, ()); - initializer.init(); - - // There are some code paths (for example, running WebKit in the browser - // process and calling into LocalStorage before anything else) where the - // UTF8 string encoding tables are used on a background thread before - // they're set up. This is a problem because their set up routines assert - // they're running on the main WebKitThread. It might be possible to make - // the initialization thread-safe, but given that so many code paths use - // this, initializing this lazily probably doesn't buy us much. - WTF::UTF8Encoding(); -} - -void ShutdownEngine() { - // FIXME: Shutdown dart? - - CoreInitializer::shutdown(); - WTF::shutdown(); - Platform::shutdown(); -} - -} // namespace blink diff --git a/sky/engine/wtf/ASCIICType.h b/sky/engine/wtf/ASCIICType.h deleted file mode 100644 index 18237bc8a948e..0000000000000 --- a/sky/engine/wtf/ASCIICType.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_ASCIICTYPE_H_ -#define SKY_ENGINE_WTF_ASCIICTYPE_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" - -// The behavior of many of the functions in the header is dependent -// on the current locale. But in the WebKit project, all uses of those functions -// are in code processing something that's not locale-specific. These -// equivalents for some of the functions are named more explicitly, -// not dependent on the C library locale, and we should also optimize them as -// needed. - -// All functions return false or leave the character unchanged if passed a -// character that is outside the range 0-7F. So they can be used on Unicode -// strings or characters if the intent is to do processing only if the character -// is ASCII. - -namespace WTF { - -template -inline bool isASCII(CharType c) { - return !(c & ~0x7F); -} - -template -inline bool isASCIIAlpha(CharType c) { - return (c | 0x20) >= 'a' && (c | 0x20) <= 'z'; -} - -template -inline bool isASCIIDigit(CharType c) { - return c >= '0' && c <= '9'; -} - -template -inline bool isASCIIAlphanumeric(CharType c) { - return isASCIIDigit(c) || isASCIIAlpha(c); -} - -template -inline bool isASCIIHexDigit(CharType c) { - return isASCIIDigit(c) || ((c | 0x20) >= 'a' && (c | 0x20) <= 'f'); -} - -template -inline bool isASCIILower(CharType c) { - return c >= 'a' && c <= 'z'; -} - -template -inline bool isASCIIOctalDigit(CharType c) { - return (c >= '0') & (c <= '7'); -} - -template -inline bool isASCIIPrintable(CharType c) { - return c >= ' ' && c <= '~'; -} - -/* - Statistics from a run of Apple's page load test for callers of isASCIISpace: - - character count - --------- ----- - non-spaces 689383 - 20 space 294720 - 0A \n 89059 - 09 \t 28320 - 0D \r 0 - 0C \f 0 - 0B \v 0 - */ -template -inline bool isASCIISpace(CharType c) { - return c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9)); -} - -template -inline bool isASCIIUpper(CharType c) { - return c >= 'A' && c <= 'Z'; -} - -template -inline CharType toASCIILower(CharType c) { -#if defined(_MSC_FULL_VER) && _MSC_FULL_VER == 170060610 - // Make a workaround for VS2012 update 3 optimizer bug, remove once VS2012 fix - // it. - return (c >= 'A' && c <= 'Z') ? c + 0x20 : c; -#else - return c | ((c >= 'A' && c <= 'Z') << 5); -#endif -} - -template -inline CharType toASCIILowerUnchecked(CharType character) { - // This function can be used for comparing any input character - // to a lowercase English character. The isASCIIAlphaCaselessEqual - // below should be used for regular comparison of ASCII alpha - // characters, but switch statements in CSS tokenizer require - // direct use of this function. - return character | 0x20; -} - -template -inline CharType toASCIIUpper(CharType c) { - return c & ~((c >= 'a' && c <= 'z') << 5); -} - -template -inline int toASCIIHexValue(CharType c) { - ASSERT(isASCIIHexDigit(c)); - return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF; -} - -template -inline int toASCIIHexValue(CharType upperValue, CharType lowerValue) { - ASSERT(isASCIIHexDigit(upperValue) && isASCIIHexDigit(lowerValue)); - return ((toASCIIHexValue(upperValue) << 4) & 0xF0) | - toASCIIHexValue(lowerValue); -} - -inline char lowerNibbleToASCIIHexDigit(char c) { - char nibble = c & 0xF; - return nibble < 10 ? '0' + nibble : 'A' + nibble - 10; -} - -inline char upperNibbleToASCIIHexDigit(char c) { - char nibble = (c >> 4) & 0xF; - return nibble < 10 ? '0' + nibble : 'A' + nibble - 10; -} - -template -inline bool isASCIIAlphaCaselessEqual(CharType cssCharacter, char character) { - // This function compares a (preferrably) constant ASCII - // lowercase letter to any input character. - ASSERT(character >= 'a' && character <= 'z'); - return LIKELY(toASCIILowerUnchecked(cssCharacter) == character); -} - -} // namespace WTF - -using WTF::isASCII; -using WTF::isASCIIAlpha; -using WTF::isASCIIAlphaCaselessEqual; -using WTF::isASCIIAlphanumeric; -using WTF::isASCIIDigit; -using WTF::isASCIIHexDigit; -using WTF::isASCIILower; -using WTF::isASCIIOctalDigit; -using WTF::isASCIIPrintable; -using WTF::isASCIISpace; -using WTF::isASCIIUpper; -using WTF::lowerNibbleToASCIIHexDigit; -using WTF::toASCIIHexValue; -using WTF::toASCIILower; -using WTF::toASCIILowerUnchecked; -using WTF::toASCIIUpper; -using WTF::upperNibbleToASCIIHexDigit; - -#endif // SKY_ENGINE_WTF_ASCIICTYPE_H_ diff --git a/sky/engine/wtf/AddressSpaceRandomization.cpp b/sky/engine/wtf/AddressSpaceRandomization.cpp deleted file mode 100644 index 8f03f0929eeba..0000000000000 --- a/sky/engine/wtf/AddressSpaceRandomization.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/wtf/AddressSpaceRandomization.h" - -#include "flutter/sky/engine/wtf/PageAllocator.h" -#include "flutter/sky/engine/wtf/SpinLock.h" - -namespace WTF { - -namespace { - -// This is the same PRNG as used by tcmalloc for mapping address randomness; -// see http://burtleburtle.net/bob/rand/smallprng.html -struct ranctx { - int lock; - bool initialized; - uint32_t a; - uint32_t b; - uint32_t c; - uint32_t d; -}; - -#define rot(x, k) (((x) << (k)) | ((x) >> (32 - (k)))) - -uint32_t ranvalInternal(ranctx* x) { - uint32_t e = x->a - rot(x->b, 27); - x->a = x->b ^ rot(x->c, 17); - x->b = x->c + x->d; - x->c = x->d + e; - x->d = e + x->a; - return x->d; -} - -#undef rot - -uint32_t ranval(ranctx* x) { - spinLockLock(&x->lock); - if (UNLIKELY(!x->initialized)) { - x->initialized = true; - char c; - uint32_t seed = static_cast(reinterpret_cast(&c)); - x->a = 0xf1ea5eed; - x->b = x->c = x->d = seed; - for (int i = 0; i < 20; ++i) { - (void)ranvalInternal(x); - } - } - uint32_t ret = ranvalInternal(x); - spinLockUnlock(&x->lock); - return ret; -} - -static struct ranctx s_ranctx; - -} // namespace - -// Calculates a random preferred mapping address. In calculating an -// address, we balance good ASLR against not fragmenting the address -// space too badly. -void* getRandomPageBase() { - uintptr_t random; - random = static_cast(ranval(&s_ranctx)); -#if CPU(X86_64) - random <<= 32UL; - random |= static_cast(ranval(&s_ranctx)); - // This address mask gives a low liklihood of address space collisions. - // We handle the situation gracefully if there is a collision. -#if OS(WIN) - // 64-bit Windows has a bizarrely small 8TB user address space. - // Allocates in the 1-5TB region. - random &= 0x3ffffffffffUL; - random += 0x10000000000UL; -#else - // Linux and OS X support the full 47-bit user space of x64 processors. - random &= 0x3fffffffffffUL; -#endif -#elif CPU(ARM64) - // ARM64 on Linux has 39-bit user space. - random &= 0x3fffffffffUL; - random += 0x1000000000UL; -#else // !CPU(X86_64) && !CPU(ARM64) - // This is a good range on Windows, Linux and Mac. - // Allocates in the 0.5-1.5GB region. - random &= 0x3fffffff; - random += 0x20000000; -#endif // CPU(X86_64) - random &= kPageAllocationGranularityBaseMask; - return reinterpret_cast(random); -} - -} // namespace WTF diff --git a/sky/engine/wtf/AddressSpaceRandomization.h b/sky/engine/wtf/AddressSpaceRandomization.h deleted file mode 100644 index 87770656b8704..0000000000000 --- a/sky/engine/wtf/AddressSpaceRandomization.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_WTF_ADDRESSSPACERANDOMIZATION_H_ -#define SKY_ENGINE_WTF_ADDRESSSPACERANDOMIZATION_H_ - -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -// Calculates a random preferred mapping address. In calculating an -// address, we balance good ASLR against not fragmenting the address -// space too badly. -WTF_EXPORT void* getRandomPageBase(); - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_ADDRESSSPACERANDOMIZATION_H_ diff --git a/sky/engine/wtf/Alignment.h b/sky/engine/wtf/Alignment.h deleted file mode 100644 index 9869ec38d2e00..0000000000000 --- a/sky/engine/wtf/Alignment.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_ALIGNMENT_H_ -#define SKY_ENGINE_WTF_ALIGNMENT_H_ - -#include -#include -#include -#include "flutter/sky/engine/wtf/Compiler.h" - -namespace WTF { - -#if COMPILER(GCC) -#define WTF_ALIGN_OF(type) __alignof__(type) -#define WTF_ALIGNED(variable_type, variable, n) \ - variable_type variable __attribute__((__aligned__(n))) -#elif COMPILER(MSVC) -#define WTF_ALIGN_OF(type) __alignof(type) -#define WTF_ALIGNED(variable_type, variable, n) \ - __declspec(align(n)) variable_type variable -#else -#error WTF_ALIGN macros need alignment control. -#endif - -#if COMPILER(GCC) -typedef char __attribute__((__may_alias__)) AlignedBufferChar; -#else -typedef char AlignedBufferChar; -#endif - -template -struct AlignedBuffer; -template -struct AlignedBuffer { - AlignedBufferChar buffer[size]; -}; -template -struct AlignedBuffer { - WTF_ALIGNED(AlignedBufferChar, buffer[size], 2); -}; -template -struct AlignedBuffer { - WTF_ALIGNED(AlignedBufferChar, buffer[size], 4); -}; -template -struct AlignedBuffer { - WTF_ALIGNED(AlignedBufferChar, buffer[size], 8); -}; -template -struct AlignedBuffer { - WTF_ALIGNED(AlignedBufferChar, buffer[size], 16); -}; -template -struct AlignedBuffer { - WTF_ALIGNED(AlignedBufferChar, buffer[size], 32); -}; -template -struct AlignedBuffer { - WTF_ALIGNED(AlignedBufferChar, buffer[size], 64); -}; - -template -void swap(AlignedBuffer& a, - AlignedBuffer& b) { - for (size_t i = 0; i < size; ++i) - std::swap(a.buffer[i], b.buffer[i]); -} - -template -inline bool isAlignedTo(const void* pointer) { - return !(reinterpret_cast(pointer) & mask); -} -} // namespace WTF - -#endif // SKY_ENGINE_WTF_ALIGNMENT_H_ diff --git a/sky/engine/wtf/Allocator.h b/sky/engine/wtf/Allocator.h deleted file mode 100644 index 366df2d0b5119..0000000000000 --- a/sky/engine/wtf/Allocator.h +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2015 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. - -#ifndef WTF_Allocator_h -#define WTF_Allocator_h - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/TypeTraits.h" -#include "flutter/sky/engine/wtf/allocator/Partitions.h" - -namespace WTF { - -namespace internal { -// A dummy class used in following macros. -class __thisIsHereToForceASemicolonAfterThisMacro; -} // namespace internal - -// Classes that contain references to garbage-collected objects but aren't -// themselves garbaged allocated, have some extra macros available which -// allows their use to be restricted to cases where the garbage collector -// is able to discover their references. These macros will be useful for -// non-garbage-collected objects to avoid unintended allocations. -// -// STACK_ALLOCATED(): Use if the object is only stack allocated. -// Garbage-collected objects should be in Members but you do not need the -// trace method as they are on the stack. (Down the line these might turn -// in to raw pointers, but for now Members indicate that we have thought -// about them and explicitly taken care of them.) -// -// DISALLOW_NEW(): Cannot be allocated with new operators but can be a -// part of object. If it has Members you need a trace method and the containing -// object needs to call that trace method. -// -// DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(): Allows only placement new operator. This -// disallows general allocation of this object but allows to put the object as a -// value object in collections. If these have Members you need to have a trace -// method. That trace method will be called automatically by the on-heap -// collections. -// -#define DISALLOW_NEW() \ - void* operator new(size_t) = delete; \ - void* operator new(size_t, NotNullTag, void*) = delete; \ - void* operator new(size_t, void*) = delete - -#define DISALLOW_NEW_EXCEPT_PLACEMENT_NEW() \ - public: \ - using IsAllowOnlyPlacementNew = int; \ - void* operator new(size_t, NotNullTag, void* location) { return location; } \ - void* operator new(size_t, void* location) { return location; } \ - \ - private: \ - void* operator new(size_t) = delete; \ - \ - public: \ - friend class ::WTF::internal::__thisIsHereToForceASemicolonAfterThisMacro - -#define STATIC_ONLY(Type) \ - Type() = delete; \ - Type(const Type&) = delete; \ - Type& operator=(const Type&) = delete; \ - void* operator new(size_t) = delete; \ - void* operator new(size_t, NotNullTag, void*) = delete; \ - void* operator new(size_t, void*) = delete - -#define IS_GARBAGE_COLLECTED_TYPE() \ - public: \ - using IsGarbageCollectedTypeMarker = int; \ - \ - private: \ - friend class ::WTF::internal::__thisIsHereToForceASemicolonAfterThisMacro - -#if defined(__clang__) -#define STACK_ALLOCATED() \ - __attribute__((annotate("blink_stack_allocated"))) void* operator new( \ - size_t) = delete; \ - void* operator new(size_t, NotNullTag, void*) = delete; \ - void* operator new(size_t, void*) = delete - -#else -#define STACK_ALLOCATED() DISALLOW_NEW() -#endif - -// Provides customizable overrides of fastMalloc/fastFree and operator -// new/delete -// -// Provided functionality: -// Macro: USING_FAST_MALLOC -// -// Example usage: -// class Widget { -// USING_FAST_MALLOC(Widget) -// ... -// }; -// -// struct Data { -// USING_FAST_MALLOC(Data) -// public: -// ... -// }; -// - -#define USING_FAST_MALLOC_INTERNAL(type, typeName) \ - public: \ - void* operator new(size_t, void* p) { return p; } \ - void* operator new[](size_t, void* p) { return p; } \ - \ - void* operator new(size_t size) { \ - return ::WTF::Partitions::FastMalloc(size, typeName); \ - } \ - \ - void operator delete(void* p) { ::WTF::Partitions::FastFree(p); } \ - \ - void* operator new[](size_t size) { \ - return ::WTF::Partitions::FastMalloc(size, typeName); \ - } \ - \ - void operator delete[](void* p) { ::WTF::Partitions::FastFree(p); } \ - void* operator new(size_t, NotNullTag, void* location) { \ - DCHECK(location); \ - return location; \ - } \ - \ - private: \ - friend class ::WTF::internal::__thisIsHereToForceASemicolonAfterThisMacro - -// In official builds, do not include type info string literals to avoid -// bloating the binary. -#if defined(OFFICIAL_BUILD) -#define WTF_HEAP_PROFILER_TYPE_NAME(T) nullptr -#else -#define WTF_HEAP_PROFILER_TYPE_NAME(T) ::WTF::GetStringWithTypeName() -#endif - -// Both of these macros enable fast malloc and provide type info to the heap -// profiler. The regular macro does not provide type info in official builds, -// to avoid bloating the binary with type name strings. The |WITH_TYPE_NAME| -// variant provides type info unconditionally, so it should be used sparingly. -// Furthermore, the |WITH_TYPE_NAME| variant does not work if |type| is a -// template argument; |USING_FAST_MALLOC| does. -#define USING_FAST_MALLOC(type) \ - USING_FAST_MALLOC_INTERNAL(type, WTF_HEAP_PROFILER_TYPE_NAME(type)) -#define USING_FAST_MALLOC_WITH_TYPE_NAME(type) \ - USING_FAST_MALLOC_INTERNAL(type, #type) - -} // namespace WTF - -// This version of placement new omits a 0 check. -enum NotNullTag { NotNull }; -inline void* operator new(size_t, NotNullTag, void* location) { - DCHECK(location); - return location; -} - -#endif /* WTF_Allocator_h */ diff --git a/sky/engine/wtf/Assertions.cpp b/sky/engine/wtf/Assertions.cpp deleted file mode 100644 index 4ab8f8d06f2a3..0000000000000 --- a/sky/engine/wtf/Assertions.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * Copyright (C) 2011 University of Szeged. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/Assertions.h" - -#include "flutter/glue/stack_trace.h" -#include "flutter/sky/engine/wtf/Compiler.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -// The vprintf_stderr_common function triggers this error in the Mac build. -// Feel free to remove this pragma if this file builds on Mac. -// According to -// http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas -// we need to place this directive before any data or functions are defined. -#if !OS(WIN) -#pragma GCC diagnostic ignored "-Wmissing-format-attribute" -#endif - -#include -#include -#include -#include - -#if HAVE(SIGNAL_H) -#include -#endif - -#if (OS(LINUX) && !defined(__UCLIBC__) && !defined(FNL_MUSL)) -#include -#include -#include -#endif - -#if OS(ANDROID) -#include -#endif - -extern "C" { - -WTF_ATTRIBUTE_PRINTF(1, 0) -static void vprintf_stderr_common(const char* format, va_list args) { -#if OS(ANDROID) - __android_log_vprint(ANDROID_LOG_WARN, "flutter", format, args); -#else - vfprintf(stderr, format, args); -#endif -} - -#if COMPILER(CLANG) || COMPILER(GCC) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-nonliteral" -#endif - -static void vprintf_stderr_with_prefix(const char* prefix, - const char* format, - va_list args) { - size_t prefixLength = strlen(prefix); - size_t formatLength = strlen(format); - OwnPtr formatWithPrefix = - adoptArrayPtr(new char[prefixLength + formatLength + 1]); - memcpy(formatWithPrefix.get(), prefix, prefixLength); - memcpy(formatWithPrefix.get() + prefixLength, format, formatLength); - formatWithPrefix[prefixLength + formatLength] = 0; - - vprintf_stderr_common(formatWithPrefix.get(), args); -} - -static void vprintf_stderr_with_trailing_newline(const char* format, - va_list args) { - size_t formatLength = strlen(format); - if (formatLength && format[formatLength - 1] == '\n') { - vprintf_stderr_common(format, args); - return; - } - - OwnPtr formatWithNewline = adoptArrayPtr(new char[formatLength + 2]); - memcpy(formatWithNewline.get(), format, formatLength); - formatWithNewline[formatLength] = '\n'; - formatWithNewline[formatLength + 1] = 0; - - vprintf_stderr_common(formatWithNewline.get(), args); -} - -#if COMPILER(CLANG) || COMPILER(GCC) -#pragma GCC diagnostic pop -#endif - -WTF_ATTRIBUTE_PRINTF(1, 2) -static void printf_stderr_common(const char* format, ...) { - va_list args; - va_start(args, format); - vprintf_stderr_common(format, args); - va_end(args); -} - -static void printCallSite(const char* file, int line, const char* function) { - // By using this format, which matches the format used by MSVC for compiler - // errors, developers using Visual Studio can double-click the file/line - // number in the Output Window to have the editor navigate to that line of - // code. It seems fine for other developers, too. - printf_stderr_common("%s(%d) : %s\n", file, line, function); -} - -void WTFReportAssertionFailure(const char* file, - int line, - const char* function, - const char* assertion) { - if (assertion) - printf_stderr_common("ASSERTION FAILED: %s\n", assertion); - else - printf_stderr_common("SHOULD NEVER BE REACHED\n"); - printCallSite(file, line, function); -} - -void WTFReportAssertionFailureWithMessage(const char* file, - int line, - const char* function, - const char* assertion, - const char* format, - ...) { - va_list args; - va_start(args, format); - vprintf_stderr_with_prefix("ASSERTION FAILED: ", format, args); - va_end(args); - printf_stderr_common("\n%s\n", assertion); - printCallSite(file, line, function); -} - -void WTFReportArgumentAssertionFailure(const char* file, - int line, - const char* function, - const char* argName, - const char* assertion) { - printf_stderr_common("ARGUMENT BAD: %s, %s\n", argName, assertion); - printCallSite(file, line, function); -} - -void WTFReportBacktrace() { - glue::PrintStackTrace(); -} - -void WTFReportFatalError(const char* file, - int line, - const char* function, - const char* format, - ...) { - va_list args; - va_start(args, format); - vprintf_stderr_with_prefix("FATAL ERROR: ", format, args); - va_end(args); - printf_stderr_common("\n"); - printCallSite(file, line, function); -} - -void WTFReportError(const char* file, - int line, - const char* function, - const char* format, - ...) { - va_list args; - va_start(args, format); - vprintf_stderr_with_prefix("ERROR: ", format, args); - va_end(args); - printf_stderr_common("\n"); - printCallSite(file, line, function); -} - -void WTFLog(WTFLogChannel* channel, const char* format, ...) { - if (channel->state != WTFLogChannelOn) - return; - - va_list args; - va_start(args, format); - vprintf_stderr_with_trailing_newline(format, args); - va_end(args); -} - -void WTFLogVerbose(const char* file, - int line, - const char* function, - WTFLogChannel* channel, - const char* format, - ...) { - if (channel->state != WTFLogChannelOn) - return; - - va_list args; - va_start(args, format); - vprintf_stderr_with_trailing_newline(format, args); - va_end(args); - - printCallSite(file, line, function); -} - -void WTFLogAlways(const char* format, ...) { - va_list args; - va_start(args, format); - vprintf_stderr_with_trailing_newline(format, args); - va_end(args); -} - -} // extern "C" diff --git a/sky/engine/wtf/Assertions.h b/sky/engine/wtf/Assertions.h deleted file mode 100644 index 1870452cc8f79..0000000000000 --- a/sky/engine/wtf/Assertions.h +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_ASSERTIONS_H_ -#define SKY_ENGINE_WTF_ASSERTIONS_H_ - -/* - No namespaces because this file has to be includable from C and Objective-C. - - Note, this file uses many GCC extensions, but it should be compatible with - C, Objective C, C++, and Objective C++. - - For non-debug builds, everything is disabled by default, except for the - RELEASE_ASSERT family of macros. - - Defining any of the symbols explicitly prevents this from having any effect. -*/ - -#include - -#include "flutter/sky/engine/wtf/Compiler.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -/* Users must test "#if ENABLE(ASSERT)", which helps ensure that code - testing this macro has included this header. */ -#ifndef ENABLE_ASSERT -#ifdef NDEBUG -/* Disable ASSERT* macros in release mode by default. */ -#define ENABLE_ASSERT 0 -#else -#define ENABLE_ASSERT 1 -#endif /* NDEBUG */ -#endif - -#ifndef BACKTRACE_DISABLED -#define BACKTRACE_DISABLED !ENABLE(ASSERT) -#endif - -#ifndef ASSERT_MSG_DISABLED -#define ASSERT_MSG_DISABLED !ENABLE(ASSERT) -#endif - -#ifndef ASSERT_ARG_DISABLED -#define ASSERT_ARG_DISABLED !ENABLE(ASSERT) -#endif - -#ifndef FATAL_DISABLED -#define FATAL_DISABLED !ENABLE(ASSERT) -#endif - -#ifndef ERROR_DISABLED -#define ERROR_DISABLED !ENABLE(ASSERT) -#endif - -#ifndef LOG_DISABLED -#define LOG_DISABLED !ENABLE(ASSERT) -#endif - -/* WTF logging functions can process %@ in the format string to log a NSObject* - but the printf format attribute emits a warning when %@ is used in the format - string. Until is resolved we can't include the - attribute when being used from Objective-C code in case it decides to use %@. - */ -#if COMPILER(GCC) && !defined(__OBJC__) -#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) \ - __attribute__((__format__(printf, formatStringArgument, extraArguments))) -#else -#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) -#endif - -/* These helper functions are always declared, but not necessarily always - * defined if the corresponding function is disabled. */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { WTFLogChannelOff, WTFLogChannelOn } WTFLogChannelState; - -typedef struct { - WTFLogChannelState state; -} WTFLogChannel; - -WTF_EXPORT void WTFReportAssertionFailure(const char* file, - int line, - const char* function, - const char* assertion); -WTF_EXPORT void WTFReportAssertionFailureWithMessage(const char* file, - int line, - const char* function, - const char* assertion, - const char* format, - ...) - WTF_ATTRIBUTE_PRINTF(5, 6); -WTF_EXPORT void WTFReportArgumentAssertionFailure(const char* file, - int line, - const char* function, - const char* argName, - const char* assertion); -WTF_EXPORT void WTFReportFatalError(const char* file, - int line, - const char* function, - const char* format, - ...) WTF_ATTRIBUTE_PRINTF(4, 5); -WTF_EXPORT void WTFReportError(const char* file, - int line, - const char* function, - const char* format, - ...) WTF_ATTRIBUTE_PRINTF(4, 5); -WTF_EXPORT void WTFLog(WTFLogChannel*, const char* format, ...) - WTF_ATTRIBUTE_PRINTF(2, 3); -WTF_EXPORT void WTFLogVerbose(const char* file, - int line, - const char* function, - WTFLogChannel*, - const char* format, - ...) WTF_ATTRIBUTE_PRINTF(5, 6); -WTF_EXPORT void WTFLogAlways(const char* format, ...) - WTF_ATTRIBUTE_PRINTF(1, 2); - -WTF_EXPORT void WTFReportBacktrace(); - -#ifdef __cplusplus -} -#endif - -/* IMMEDIATE_CRASH() - Like CRASH() below but crashes in the fastest, simplest - * possible way with no attempt at logging. */ -#ifndef IMMEDIATE_CRASH -#if COMPILER(GCC) -#define IMMEDIATE_CRASH() __builtin_trap() -#else -#define IMMEDIATE_CRASH() ((void (*)())0)() -#endif -#endif - -/* CRASH() - Raises a fatal error resulting in program termination and - triggering either the debugger or the crash reporter. - - Use CRASH() in response to known, unrecoverable errors like out-of-memory. - Macro is enabled in both debug and release mode. - To test for unknown errors and verify assumptions, use ASSERT instead, to - avoid impacting performance in release builds. - - Signals are ignored by the crash reporter on OS X so we must do better. -*/ -#ifndef CRASH -#define CRASH() \ - (WTFReportBacktrace(), (*(int*)0xfbadbeef = 0), IMMEDIATE_CRASH()) -#endif - -#if COMPILER(CLANG) -#define NO_RETURN_DUE_TO_CRASH NO_RETURN -#else -#define NO_RETURN_DUE_TO_CRASH -#endif - -/* BACKTRACE - - Print a backtrace to the same location as ASSERT messages. -*/ -#if BACKTRACE_DISABLED - -#define BACKTRACE() ((void)0) - -#else - -#define BACKTRACE() \ - do { \ - WTFReportBacktrace(); \ - } while (false) - -#endif - -/* ASSERT, ASSERT_NOT_REACHED, ASSERT_UNUSED - - These macros are compiled out of release builds. - Expressions inside them are evaluated in debug builds only. -*/ -#if OS(WIN) -/* FIXME: Change to use something other than ASSERT to avoid this conflict with - * the underlying platform */ -#undef ASSERT -#endif - -#if ENABLE(ASSERT) - -#define ASSERT(assertion) \ - (!(assertion) ? (WTFReportAssertionFailure(__FILE__, __LINE__, \ - WTF_PRETTY_FUNCTION, #assertion), \ - CRASH()) \ - : (void)0) - -#define ASSERT_AT(assertion, file, line, function) \ - (!(assertion) \ - ? (WTFReportAssertionFailure(file, line, function, #assertion), \ - CRASH()) \ - : (void)0) - -#define ASSERT_NOT_REACHED() \ - do { \ - WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, 0); \ - CRASH(); \ - } while (0) - -#define ASSERT_UNUSED(variable, assertion) ASSERT(assertion) - -#define NO_RETURN_DUE_TO_ASSERT NO_RETURN_DUE_TO_CRASH - -#else - -#define ASSERT(assertion) ((void)0) -#define ASSERT_AT(assertion, file, line, function) ((void)0) -#define ASSERT_NOT_REACHED() ((void)0) -#define NO_RETURN_DUE_TO_ASSERT - -#define ASSERT_UNUSED(variable, assertion) ((void)variable) - -#endif - -/* ASSERT_WITH_SECURITY_IMPLICATION / RELEASE_ASSERT_WITH_SECURITY_IMPLICATION - - Use in places where failure of the assertion indicates a possible security - vulnerability. Classes of these vulnerabilities include bad casts, out of - bounds accesses, use-after-frees, etc. Please be sure to file bugs for these - failures using the security template: - http://code.google.com/p/chromium/issues/entry?template=Security%20Bug -*/ -#ifdef ADDRESS_SANITIZER - -#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) \ - (!(assertion) ? (WTFReportAssertionFailure(__FILE__, __LINE__, \ - WTF_PRETTY_FUNCTION, #assertion), \ - CRASH()) \ - : (void)0) - -#define RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(assertion) \ - ASSERT_WITH_SECURITY_IMPLICATION(assertion) - -#else - -#define ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT(assertion) -#define RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(assertion) \ - RELEASE_ASSERT(assertion) - -#endif - -// Users must test "#if ENABLE(SECURITY_ASSERT)", which helps ensure -// that code testing this macro has included this header. -#if defined(ADDRESS_SANITIZER) || ENABLE(ASSERT) -#define ENABLE_SECURITY_ASSERT 1 -#else -#define ENABLE_SECURITY_ASSERT 0 -#endif - -/* ASSERT_WITH_MESSAGE */ - -#if ASSERT_MSG_DISABLED -#define ASSERT_WITH_MESSAGE(assertion, ...) ((void)0) -#else -#define ASSERT_WITH_MESSAGE(assertion, ...) \ - do \ - if (!(assertion)) { \ - WTFReportAssertionFailureWithMessage( \ - __FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion, __VA_ARGS__); \ - CRASH(); \ - } \ - while (0) -#endif - -/* ASSERT_WITH_MESSAGE_UNUSED */ - -#if ASSERT_MSG_DISABLED -#define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) ((void)variable) -#else -#define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) \ - do \ - if (!(assertion)) { \ - WTFReportAssertionFailureWithMessage( \ - __FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion, __VA_ARGS__); \ - CRASH(); \ - } \ - while (0) -#endif - -/* ASSERT_ARG */ - -#if ASSERT_ARG_DISABLED - -#define ASSERT_ARG(argName, assertion) ((void)0) - -#else - -#define ASSERT_ARG(argName, assertion) \ - do \ - if (!(assertion)) { \ - WTFReportArgumentAssertionFailure( \ - __FILE__, __LINE__, WTF_PRETTY_FUNCTION, #argName, #assertion); \ - CRASH(); \ - } \ - while (0) - -#endif - -/* COMPILE_ASSERT */ -#ifndef COMPILE_ASSERT -#define COMPILE_ASSERT(exp, name) static_assert((exp), #name) -#endif - -/* FATAL */ - -#if FATAL_DISABLED -#define FATAL(...) ((void)0) -#else -#define FATAL(...) \ - do { \ - WTFReportFatalError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__); \ - CRASH(); \ - } while (0) -#endif - -/* WTF_LOG_ERROR */ - -#if ERROR_DISABLED -#define WTF_LOG_ERROR(...) ((void)0) -#else -#define WTF_LOG_ERROR(...) \ - WTFReportError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__) -#endif - -/* WTF_LOG */ - -#if LOG_DISABLED -#define WTF_LOG(channel, ...) ((void)0) -#else -#define WTF_LOG(channel, ...) \ - WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), \ - __VA_ARGS__) -#define JOIN_LOG_CHANNEL_WITH_PREFIX(prefix, channel) \ - JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel) -#define JOIN_LOG_CHANNEL_WITH_PREFIX_LEVEL_2(prefix, channel) prefix##channel -#endif - -/* UNREACHABLE_FOR_PLATFORM */ - -#if COMPILER(CLANG) -/* This would be a macro except that its use of #pragma works best around - a function. Hence it uses macro naming convention. */ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wmissing-noreturn" -static inline void UNREACHABLE_FOR_PLATFORM() { - ASSERT_NOT_REACHED(); -} -#pragma clang diagnostic pop -#else -#define UNREACHABLE_FOR_PLATFORM() ASSERT_NOT_REACHED() -#endif - -/* RELEASE_ASSERT - - Use in places where failure of an assertion indicates a definite security - vulnerability from which execution must not continue even in a release build. - Please sure to file bugs for these failures using the security template: - http://code.google.com/p/chromium/issues/entry?template=Security%20Bug -*/ - -#if ENABLE(ASSERT) -#define RELEASE_ASSERT(assertion) ASSERT(assertion) -#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) \ - ASSERT_WITH_MESSAGE(assertion, __VA_ARGS__) -#define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED() -#else -#define RELEASE_ASSERT(assertion) \ - (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0) -#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion) -#define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH() -#endif - -/* DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES */ - -// Allow equality comparisons of Objects by reference or pointer, -// interchangeably. This can be only used on types whose equality makes no other -// sense than pointer equality. -#define DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(thisType) \ - inline bool operator==(const thisType& a, const thisType& b) { \ - return &a == &b; \ - } \ - inline bool operator==(const thisType& a, const thisType* b) { \ - return &a == b; \ - } \ - inline bool operator==(const thisType* a, const thisType& b) { \ - return a == &b; \ - } \ - inline bool operator!=(const thisType& a, const thisType& b) { \ - return !(a == b); \ - } \ - inline bool operator!=(const thisType& a, const thisType* b) { \ - return !(a == b); \ - } \ - inline bool operator!=(const thisType* a, const thisType& b) { \ - return !(a == b); \ - } - -#define DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES_REFCOUNTED(thisType) \ - DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES(thisType) \ - inline bool operator==(const PassRefPtr& a, const thisType& b) { \ - return a.get() == &b; \ - } \ - inline bool operator==(const thisType& a, const PassRefPtr& b) { \ - return &a == b.get(); \ - } \ - inline bool operator!=(const PassRefPtr& a, const thisType& b) { \ - return !(a == b); \ - } \ - inline bool operator!=(const thisType& a, const PassRefPtr& b) { \ - return !(a == b); \ - } - -/* DEFINE_TYPE_CASTS */ - -#define DEFINE_TYPE_CASTS(thisType, argumentType, argumentName, \ - pointerPredicate, referencePredicate) \ - inline thisType* to##thisType(argumentType* argumentName) { \ - ASSERT_WITH_SECURITY_IMPLICATION(!argumentName || (pointerPredicate)); \ - return static_cast(argumentName); \ - } \ - inline const thisType* to##thisType(const argumentType* argumentName) { \ - ASSERT_WITH_SECURITY_IMPLICATION(!argumentName || (pointerPredicate)); \ - return static_cast(argumentName); \ - } \ - inline thisType& to##thisType(argumentType& argumentName) { \ - ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ - return static_cast(argumentName); \ - } \ - inline const thisType& to##thisType(const argumentType& argumentName) { \ - ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ - return static_cast(argumentName); \ - } \ - void to##thisType(const thisType*); \ - void to##thisType(const thisType&) - -#endif // SKY_ENGINE_WTF_ASSERTIONS_H_ diff --git a/sky/engine/wtf/Atomics.h b/sky/engine/wtf/Atomics.h deleted file mode 100644 index 918190bbaa352..0000000000000 --- a/sky/engine/wtf/Atomics.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2010, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_ATOMICS_H_ -#define SKY_ENGINE_WTF_ATOMICS_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#include - -#if OS(WIN) -#include -#endif - -#if defined(THREAD_SANITIZER) -#include -#endif - -namespace WTF { - -#if OS(WIN) - -// atomicAdd returns the result of the addition. -ALWAYS_INLINE int atomicAdd(int volatile* addend, int increment) { - return InterlockedExchangeAdd(reinterpret_cast(addend), - static_cast(increment)) + - increment; -} - -ALWAYS_INLINE unsigned atomicAdd(unsigned volatile* addend, - unsigned increment) { - return InterlockedExchangeAdd(reinterpret_cast(addend), - static_cast(increment)) + - increment; -} - -#if OS(WIN64) -ALWAYS_INLINE unsigned long long atomicAdd(unsigned long long volatile* addend, - unsigned long long increment) { - return InterlockedExchangeAdd64(reinterpret_cast(addend), - static_cast(increment)) + - increment; -} -#endif - -// atomicSubtract returns the result of the subtraction. -ALWAYS_INLINE int atomicSubtract(int volatile* addend, int decrement) { - return InterlockedExchangeAdd(reinterpret_cast(addend), - static_cast(-decrement)) - - decrement; -} - -ALWAYS_INLINE unsigned atomicSubtract(unsigned volatile* addend, - unsigned decrement) { - return InterlockedExchangeAdd(reinterpret_cast(addend), - -static_cast(decrement)) - - decrement; -} - -#if OS(WIN64) -ALWAYS_INLINE unsigned long long atomicSubtract( - unsigned long long volatile* addend, - unsigned long long decrement) { - return InterlockedExchangeAdd64(reinterpret_cast(addend), - -static_cast(decrement)) - - decrement; -} -#endif - -ALWAYS_INLINE int atomicIncrement(int volatile* addend) { - return InterlockedIncrement(reinterpret_cast(addend)); -} -ALWAYS_INLINE int atomicDecrement(int volatile* addend) { - return InterlockedDecrement(reinterpret_cast(addend)); -} - -ALWAYS_INLINE int64_t atomicIncrement(int64_t volatile* addend) { - return InterlockedIncrement64(reinterpret_cast(addend)); -} -ALWAYS_INLINE int64_t atomicDecrement(int64_t volatile* addend) { - return InterlockedDecrement64(reinterpret_cast(addend)); -} - -ALWAYS_INLINE int atomicTestAndSetToOne(int volatile* ptr) { - int ret = InterlockedExchange(reinterpret_cast(ptr), 1); - ASSERT(!ret || ret == 1); - return ret; -} - -ALWAYS_INLINE void atomicSetOneToZero(int volatile* ptr) { - ASSERT(*ptr == 1); - InterlockedExchange(reinterpret_cast(ptr), 0); -} - -#else - -// atomicAdd returns the result of the addition. -ALWAYS_INLINE int atomicAdd(int volatile* addend, int increment) { - return __sync_add_and_fetch(addend, increment); -} -// atomicSubtract returns the result of the subtraction. -ALWAYS_INLINE int atomicSubtract(int volatile* addend, int decrement) { - return __sync_sub_and_fetch(addend, decrement); -} - -ALWAYS_INLINE int atomicIncrement(int volatile* addend) { - return atomicAdd(addend, 1); -} -ALWAYS_INLINE int atomicDecrement(int volatile* addend) { - return atomicSubtract(addend, 1); -} - -ALWAYS_INLINE int64_t atomicIncrement(int64_t volatile* addend) { - return __sync_add_and_fetch(addend, 1); -} -ALWAYS_INLINE int64_t atomicDecrement(int64_t volatile* addend) { - return __sync_sub_and_fetch(addend, 1); -} - -ALWAYS_INLINE int atomicTestAndSetToOne(int volatile* ptr) { - int ret = __sync_lock_test_and_set(ptr, 1); - ASSERT(!ret || ret == 1); - return ret; -} - -ALWAYS_INLINE void atomicSetOneToZero(int volatile* ptr) { - ASSERT(*ptr == 1); - __sync_lock_release(ptr); -} - -#endif - -#if defined(THREAD_SANITIZER) -ALWAYS_INLINE void releaseStore(volatile int* ptr, int value) { - __tsan_atomic32_store(ptr, value, __tsan_memory_order_release); -} - -ALWAYS_INLINE int acquireLoad(volatile const int* ptr) { - return __tsan_atomic32_load(ptr, __tsan_memory_order_acquire); -} - -ALWAYS_INLINE void releaseStore(volatile unsigned* ptr, unsigned value) { - __tsan_atomic32_store(reinterpret_cast(ptr), - static_cast(value), __tsan_memory_order_release); -} - -ALWAYS_INLINE unsigned acquireLoad(volatile const unsigned* ptr) { - return static_cast(__tsan_atomic32_load( - reinterpret_cast(ptr), __tsan_memory_order_acquire)); -} -#else - -#if CPU(X86) || CPU(X86_64) -// Only compiler barrier is needed. -#if OS(WIN) -#define MEMORY_BARRIER() _ReadWriteBarrier() -#else -#define MEMORY_BARRIER() __asm__ __volatile__("" : : : "memory") -#endif // OS(WIN) -#elif CPU(ARM) && (OS(LINUX) || OS(ANDROID)) -// On ARM __sync_synchronize generates dmb which is very expensive on single -// core devices which don't actually need it. Avoid the cost by calling into -// kuser_memory_barrier helper. -inline void memoryBarrier() { - // Note: This is a function call, which is also an implicit compiler barrier. - typedef void (*KernelMemoryBarrierFunc)(); - ((KernelMemoryBarrierFunc)0xffff0fa0)(); -} -#define MEMORY_BARRIER() memoryBarrier() -#else -// Fallback to the compiler intrinsic on all other platforms. -#define MEMORY_BARRIER() __sync_synchronize() -#endif - -ALWAYS_INLINE void releaseStore(volatile int* ptr, int value) { - MEMORY_BARRIER(); - *ptr = value; -} - -ALWAYS_INLINE int acquireLoad(volatile const int* ptr) { - int value = *ptr; - MEMORY_BARRIER(); - return value; -} - -ALWAYS_INLINE void releaseStore(volatile unsigned* ptr, unsigned value) { - MEMORY_BARRIER(); - *ptr = value; -} - -ALWAYS_INLINE unsigned acquireLoad(volatile const unsigned* ptr) { - unsigned value = *ptr; - MEMORY_BARRIER(); - return value; -} - -#undef MEMORY_BARRIER - -#endif - -} // namespace WTF - -using WTF::acquireLoad; -using WTF::atomicAdd; -using WTF::atomicDecrement; -using WTF::atomicIncrement; -using WTF::atomicSetOneToZero; -using WTF::atomicSubtract; -using WTF::atomicTestAndSetToOne; -using WTF::releaseStore; - -#endif // SKY_ENGINE_WTF_ATOMICS_H_ diff --git a/sky/engine/wtf/BUILD.gn b/sky/engine/wtf/BUILD.gn deleted file mode 100644 index c1ed097e96e6a..0000000000000 --- a/sky/engine/wtf/BUILD.gn +++ /dev/null @@ -1,273 +0,0 @@ -# Copyright 2014 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. - -config("clang_warnings") { - if (is_clang) { - cflags = [ - "-Wno-for-loop-analysis", - "-Wno-shift-negative-value", - ] - } -} - -source_set("wtf") { - sources = [ - "ASCIICType.h", - "AddressSpaceRandomization.cpp", - "AddressSpaceRandomization.h", - "Alignment.h", - "Assertions.cpp", - "Assertions.h", - "Atomics.h", - "BitwiseOperations.h", - "ByteOrder.h", - "ByteSwap.h", - "CPU.h", - "CheckedArithmetic.h", - "Compiler.h", - "DataLog.cpp", - "DataLog.h", - "DefaultAllocator.cpp", - "DefaultAllocator.h", - "Deque.h", - "DoubleBufferedDeque.h", - "DoublyLinkedList.h", - "DynamicAnnotations.cpp", - "DynamicAnnotations.h", - "EnumClass.h", - "FastAllocBase.h", - "FastMalloc.cpp", - "FastMalloc.h", - "FilePrintStream.cpp", - "FilePrintStream.h", - "Forward.h", - "GetPtr.h", - "HashCountedSet.h", - "HashFunctions.h", - "HashIterators.h", - "HashMap.h", - "HashSet.h", - "HashTable.cpp", - "HashTable.h", - "HashTableDeletedValueType.h", - "HashTraits.h", - "HexNumber.h", - "InstanceCounter.cpp", - "InstanceCounter.h", - "LeakAnnotations.h", - "LinkedHashSet.h", - "LinkedStack.h", - "ListHashSet.h", - "Locker.h", - "MainThread.cpp", - "MainThread.h", - "MakeUnique.h", - "MallocZoneSupport.h", - "MathExtras.h", - "NonCopyingSort.h", - "Noncopyable.h", - "NotFound.h", - "NullPtr.h", - "OperatingSystem.h", - "OwnPtr.h", - "OwnPtrCommon.h", - "PageAllocator.cpp", - "PageAllocator.h", - "PartitionAlloc.cpp", - "PartitionAlloc.h", - "PassOwnPtr.h", - "PassRefPtr.h", - "PassTraits.h", - "PrintStream.cpp", - "PrintStream.h", - "RawPtr.h", - "RefCounted.h", - "RefCountedLeakCounter.cpp", - "RefCountedLeakCounter.h", - "RefPtr.h", - "RefVector.h", - "SaturatedArithmetic.h", - "SizeLimits.cpp", - "SpinLock.h", - "StaticConstructors.h", - "StdLibExtras.h", - "StreamBuffer.h", - "StringExtras.h", - "StringHasher.h", - "TemporaryChange.h", - "ThreadRestrictionVerifier.h", - "ThreadSafeRefCounted.h", - "ThreadSpecific.h", - "Threading.h", - "ThreadingPrimitives.h", - "TypeTraits.cpp", - "TypeTraits.h", - "Vector.h", - "VectorTraits.h", - "WTF.cpp", - "WTF.h", - "WTFExport.h", - "WTFThreadData.cpp", - "WTFThreadData.h", - "asm/SaturatedArithmeticARM.h", - "dtoa.cpp", - "dtoa.h", - "dtoa/bignum-dtoa.cc", - "dtoa/bignum-dtoa.h", - "dtoa/bignum.cc", - "dtoa/bignum.h", - "dtoa/cached-powers.cc", - "dtoa/cached-powers.h", - "dtoa/diy-fp.cc", - "dtoa/diy-fp.h", - "dtoa/double-conversion.cc", - "dtoa/double-conversion.h", - "dtoa/double.h", - "dtoa/fast-dtoa.cc", - "dtoa/fast-dtoa.h", - "dtoa/fixed-dtoa.cc", - "dtoa/fixed-dtoa.h", - "dtoa/strtod.cc", - "dtoa/strtod.h", - "dtoa/utils.h", - "text/ASCIIFastPath.h", - "text/AtomicString.cpp", - "text/AtomicString.h", - "text/AtomicStringHash.h", - "text/CString.cpp", - "text/CString.h", - "text/IntegerToStringConversion.h", - "text/StringBuffer.h", - "text/StringBuilder.cpp", - "text/StringBuilder.h", - "text/StringConcatenate.h", - "text/StringHash.h", - "text/StringImpl.cpp", - "text/StringImpl.h", - "text/StringOperators.h", - "text/StringStatics.cpp", - "text/StringStatics.h", - "text/StringUTF8Adaptor.h", - "text/StringView.h", - "text/TextCodec.cpp", - "text/TextCodec.h", - "text/TextCodecASCIIFastPath.h", - "text/TextCodecICU.cpp", - "text/TextCodecICU.h", - "text/TextCodecLatin1.cpp", - "text/TextCodecLatin1.h", - "text/TextCodecReplacement.cpp", - "text/TextCodecReplacement.h", - "text/TextCodecUTF16.cpp", - "text/TextCodecUTF16.h", - "text/TextCodecUTF8.cpp", - "text/TextCodecUTF8.h", - "text/TextCodecUserDefined.cpp", - "text/TextCodecUserDefined.h", - "text/TextEncoding.cpp", - "text/TextEncoding.h", - "text/TextEncodingRegistry.cpp", - "text/TextEncodingRegistry.h", - "text/TextPosition.cpp", - "text/TextPosition.h", - "text/WTFString.cpp", - "text/WTFString.h", - "unicode/CharacterNames.h", - "unicode/Collator.h", - "unicode/UTF8.cpp", - "unicode/UTF8.h", - "unicode/Unicode.h", - "unicode/icu/CollatorICU.cpp", - "unicode/icu/UnicodeIcu.h", - ] - - configs += [ - ":clang_warnings", - "$flutter_root/sky/engine:config", - "$flutter_root/sky/engine:non_test_config", - ] - - public_configs = [ - "$flutter_root/common:flutter_config", - "$flutter_root:config", - "//third_party/icu:icu_config", - ] - - public_deps = [ - "//garnet/public/lib/fxl", - "//third_party/icu", - ] - - deps = [ - "$flutter_root/glue", - ] - - if (is_android) { - libs = [ "log" ] - } - - if (is_win) { - sources += [ - "ThreadSpecificWin.cpp", - "ThreadingWin.cpp", - ] - } else { - sources += [ - "ThreadIdentifierDataPthreads.cpp", - "ThreadIdentifierDataPthreads.h", - "ThreadingPthreads.cpp", - ] - } -} - -executable("wtf_unittests") { - testonly = true - - sources = [ - "CheckedArithmeticTest.cpp", - "DequeTest.cpp", - "DoubleBufferedDequeTest.cpp", - "HashMapTest.cpp", - "HashSetTest.cpp", - "ListHashSetTest.cpp", - "MathExtrasTest.cpp", - "PartitionAllocTest.cpp", - "RefPtrTest.cpp", - "SaturatedArithmeticTest.cpp", - "StringExtrasTest.cpp", - "StringHasherTest.cpp", - "TemporaryChangeTest.cpp", - "VectorTest.cpp", - "testing/RunAllTests.cpp", - "testing/WTFTestHelpers.cpp", - "testing/WTFTestHelpers.h", - "testing/WTFTestHelpersTest.cpp", - "text/AtomicStringTest.cpp", - "text/CStringTest.cpp", - "text/StringBufferTest.cpp", - "text/StringBuilderTest.cpp", - "text/StringImplTest.cpp", - "text/StringOperatorsTest.cpp", - "text/TextCodecUTF8Test.cpp", - - # The following tests depend on either ICU or the locale. Disable them for - # now. - # "text/TextCodecReplacementTest.cpp", - # "text/WTFStringTest.cpp", - ] - - configs += [ - ":clang_warnings", - "$flutter_root/sky/engine:config", - ] - - deps = [ - ":wtf", - "//third_party/dart/runtime:libdart_jit", - - # Does not use $flutter_root/testing because it needs and provides its own main - # function in RunAllTests.cpp. - "//third_party/googletest:gtest", - ] -} diff --git a/sky/engine/wtf/BitwiseOperations.h b/sky/engine/wtf/BitwiseOperations.h deleted file mode 100644 index 28bbbcad77914..0000000000000 --- a/sky/engine/wtf/BitwiseOperations.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_BITWISEOPERATIONS_H_ -#define SKY_ENGINE_WTF_BITWISEOPERATIONS_H_ - -// DESCRIPTION -// countLeadingZeros() is a bitwise operation that counts the number of leading -// zeros in a binary value, starting with the most significant bit. C does not -// have an operator to do this, but fortunately the various compilers have -// built-ins that map to fast underlying processor instructions. - -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/Compiler.h" - -#include - -#if COMPILER(MSVC) -#include -#endif - -namespace WTF { - -#if COMPILER(MSVC) - -ALWAYS_INLINE uint32_t countLeadingZeros32(uint32_t x) { - unsigned long index; - return LIKELY(_BitScanReverse(&index, x)) ? (31 - index) : 32; -} - -#if CPU(64BIT) - -// MSVC only supplies _BitScanForward64 when building for a 64-bit target. -ALWAYS_INLINE uint64_t countLeadingZeros64(uint64_t x) { - unsigned long index; - return LIKELY(_BitScanReverse64(&index, x)) ? (63 - index) : 64; -} - -#endif // CPU(64BIT) - -#elif COMPILER(GCC) - -// This is very annoying. __builtin_clz has undefined behaviour for an input of -// 0, even though these's clearly a return value that makes sense, and even -// though nascent processor clz instructions have defined behaviour for 0. -// We could drop to raw __asm__ to do better, but we'll avoid doing that unless -// we see proof that we need to. -ALWAYS_INLINE uint32_t countLeadingZeros32(uint32_t x) { - return LIKELY(x) ? __builtin_clz(x) : 32; -} - -ALWAYS_INLINE uint64_t countLeadingZeros64(uint64_t x) { - return LIKELY(x) ? __builtin_clzll(x) : 64; -} - -#endif - -#if CPU(64BIT) - -ALWAYS_INLINE size_t countLeadingZerosSizet(size_t x) { - return countLeadingZeros64(x); -} - -#else - -ALWAYS_INLINE size_t countLeadingZerosSizet(size_t x) { - return countLeadingZeros32(x); -} - -#endif - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_BITWISEOPERATIONS_H_ diff --git a/sky/engine/wtf/ByteOrder.h b/sky/engine/wtf/ByteOrder.h deleted file mode 100644 index dbe6242786a6a..0000000000000 --- a/sky/engine/wtf/ByteOrder.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_BYTEORDER_H_ -#define SKY_ENGINE_WTF_BYTEORDER_H_ - -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#if OS(POSIX) -#include -#endif - -#if OS(WIN) -#include -#endif - -#endif // SKY_ENGINE_WTF_BYTEORDER_H_ diff --git a/sky/engine/wtf/ByteSwap.h b/sky/engine/wtf/ByteSwap.h deleted file mode 100644 index 362f57b024bbc..0000000000000 --- a/sky/engine/wtf/ByteSwap.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_BYTESWAP_H_ -#define SKY_ENGINE_WTF_BYTESWAP_H_ - -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/Compiler.h" - -#include - -#if COMPILER(MSVC) -#include -#endif - -namespace WTF { - -inline uint32_t wswap32(uint32_t x) { - return ((x & 0xffff0000) >> 16) | ((x & 0x0000ffff) << 16); -} - -#if COMPILER(MSVC) -ALWAYS_INLINE uint64_t bswap64(uint64_t x) { - return _byteswap_uint64(x); -} -ALWAYS_INLINE uint32_t bswap32(uint32_t x) { - return _byteswap_ulong(x); -} -#else -ALWAYS_INLINE uint64_t bswap64(uint64_t x) { - return __builtin_bswap64(x); -} -ALWAYS_INLINE uint32_t bswap32(uint32_t x) { - return __builtin_bswap32(x); -} -#endif -// GCC 4.6 lacks __builtin_bswap16. Newer versions have it but we support 4.6. -#if COMPILER(CLANG) -ALWAYS_INLINE uint16_t bswap16(uint16_t x) { - return __builtin_bswap16(x); -} -#elif COMPILER(MSVC) -ALWAYS_INLINE uint16_t bswap16(uint16_t x) { - return _byteswap_ushort(x); -} -#else -inline uint16_t bswap16(uint16_t x) { - return ((x & 0xff00) >> 8) | ((x & 0x00ff) << 8); -} -#endif - -#if CPU(64BIT) - -ALWAYS_INLINE size_t bswapuintptrt(size_t x) { - return bswap64(x); -} - -#else - -ALWAYS_INLINE size_t bswapuintptrt(size_t x) { - return bswap32(x); -} - -#endif - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_BYTESWAP_H_ diff --git a/sky/engine/wtf/CONTRIBUTORS.pthreads-win32 b/sky/engine/wtf/CONTRIBUTORS.pthreads-win32 deleted file mode 100644 index 7de0f260659e4..0000000000000 --- a/sky/engine/wtf/CONTRIBUTORS.pthreads-win32 +++ /dev/null @@ -1,137 +0,0 @@ -This is a copy of CONTRIBUTORS file for the Pthreads-win32 library, downloaded -from http://sourceware.org/cgi-bin/cvsweb.cgi/~checkout~/pthreads/CONTRIBUTORS?rev=1.32&cvsroot=pthreads-win32 - -Included here to compliment the Pthreads-win32 license header in wtf/ThreadingWin.cpp file. -WebKit is using derived sources of ThreadCondition code from Pthreads-win32. - -------------------------------------------------------------------------------- - -Contributors (in approximate order of appearance) - -[See also the ChangeLog file where individuals are -attributed in log entries. Likewise in the FAQ file.] - -Ben Elliston bje at cygnus dot com - Initiated the project; - setup the project infrastructure (CVS, web page, etc.); - early prototype routines. -Ross Johnson rpj at callisto dot canberra dot edu dot au - early prototype routines; - ongoing project coordination/maintenance; - implementation of spin locks and barriers; - various enhancements; - bug fixes; - documentation; - testsuite. -Robert Colquhoun rjc at trump dot net dot au - Early bug fixes. -John E. Bossom John dot Bossom at cognos dot com - Contributed substantial original working implementation; - bug fixes; - ongoing guidance and standards interpretation. -Anders Norlander anorland at hem2 dot passagen dot se - Early enhancements and runtime checking for supported - Win32 routines. -Tor Lillqvist tml at iki dot fi - General enhancements; - early bug fixes to condition variables. -Scott Lightner scott at curriculum dot com - Bug fix. -Kevin Ruland Kevin dot Ruland at anheuser-busch dot com - Various bug fixes. -Mike Russo miker at eai dot com - Bug fix. -Mark E. Armstrong avail at pacbell dot net - Bug fixes. -Lorin Hochstein lmh at xiphos dot ca - general bug fixes; bug fixes to condition variables. -Peter Slacik Peter dot Slacik at tatramed dot sk - Bug fixes. -Mumit Khan khan at xraylith dot wisc dot edu - Fixes to work with Mingw32. -Milan Gardian mg at tatramed dot sk - Bug fixes and reports/analyses of obscure problems. -Aurelio Medina aureliom at crt dot com - First implementation of read-write locks. -Graham Dumpleton Graham dot Dumpleton at ra dot pad dot otc dot telstra dot com dot au - Bug fix in condition variables. -Tristan Savatier tristan at mpegtv dot com - WinCE port. -Erik Hensema erik at hensema dot xs4all dot nl - Bug fixes. -Rich Peters rpeters at micro-magic dot com -Todd Owen towen at lucidcalm dot dropbear dot id dot au - Bug fixes to dll loading. -Jason Nye jnye at nbnet dot nb dot ca - Implementation of async cancelation. -Fred Forester fforest at eticomm dot net -Kevin D. Clark kclark at cabletron dot com -David Baggett dmb at itasoftware dot com - Bug fixes. -Paul Redondo paul at matchvision dot com -Scott McCaskill scott at 3dfx dot com - Bug fixes. -Jef Gearhart jgearhart at tpssys dot com - Bug fix. -Arthur Kantor akantor at bexusa dot com - Mutex enhancements. -Steven Reddie smr at essemer dot com dot au - Bug fix. -Alexander Terekhov TEREKHOV at de dot ibm dot com - Re-implemented and improved read-write locks; - (with Louis Thomas) re-implemented and improved - condition variables; - enhancements to semaphores; - enhancements to mutexes; - new mutex implementation in 'futex' style; - suggested a robust implementation of pthread_once - similar to that implemented by V.Kliathcko; - system clock change handling re CV timeouts; - bug fixes. -Thomas Pfaff tpfaff at gmx dot net - Changes to make C version usable with C++ applications; - re-implemented mutex routines to avoid Win32 mutexes - and TryEnterCriticalSection; - procedure to fix Mingw32 thread-safety issues. -Franco Bez franco dot bez at gmx dot de - procedure to fix Mingw32 thread-safety issues. -Louis Thomas lthomas at arbitrade dot com - (with Alexander Terekhov) re-implemented and improved - condition variables. -David Korn dgk at research dot att dot com - Ported to UWIN. -Phil Frisbie, Jr. phil at hawksoft dot com - Bug fix. -Ralf Brese Ralf dot Brese at pdb4 dot siemens dot de - Bug fix. -prionx at juno dot com prionx at juno dot com - Bug fixes. -Max Woodbury mtew at cds dot duke dot edu - POSIX versioning conditionals; - reduced namespace pollution; - idea to separate routines to reduce statically - linked image sizes. -Rob Fanner rfanner at stonethree dot com - Bug fix. -Michael Johnson michaelj at maine dot rr dot com - Bug fix. -Nicolas Barry boozai at yahoo dot com - Bug fixes. -Piet van Bruggen pietvb at newbridges dot nl - Bug fix. -Makoto Kato raven at oldskool dot jp - AMD64 port. -Panagiotis E. Hadjidoukas peh at hpclab dot ceid dot upatras dot gr - Contributed the QueueUserAPCEx package which - makes preemptive async cancelation possible. -Will Bryant will dot bryant at ecosm dot com - Borland compiler patch and makefile. -Anuj Goyal anuj dot goyal at gmail dot com - Port to Digital Mars compiler. -Gottlob Frege gottlobfrege at gmail dot com - re-implemented pthread_once (version 2) - (pthread_once cancellation added by rpj). -Vladimir Kliatchko vladimir at kliatchko dot com - reimplemented pthread_once with the same form - as described by A.Terekhov (later version 2); - implementation of MCS (Mellor-Crummey/Scott) locks. \ No newline at end of file diff --git a/sky/engine/wtf/CPU.h b/sky/engine/wtf/CPU.h deleted file mode 100644 index 6fcf18799e570..0000000000000 --- a/sky/engine/wtf/CPU.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. - * Copyright (C) 2013 Samsung Electronics. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_CPU_H_ -#define SKY_ENGINE_WTF_CPU_H_ - -#include "flutter/sky/engine/wtf/Compiler.h" - -/* CPU() - the target CPU architecture */ -#define CPU(WTF_FEATURE) \ - (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE) - -/* ==== CPU() - the target CPU architecture ==== */ - -/* This defines CPU(BIG_ENDIAN) or nothing, as appropriate. */ -/* This defines CPU(32BIT) or CPU(64BIT), as appropriate. */ - -/* CPU(X86) - i386 / x86 32-bit */ -#if defined(__i386__) || defined(i386) || defined(_M_IX86) || \ - defined(_X86_) || defined(__THW_INTEL) -#define WTF_CPU_X86 1 -#endif - -/* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */ -#if defined(__x86_64__) || defined(_M_X64) -#define WTF_CPU_X86_64 1 -#define WTF_CPU_64BIT 1 -#endif - -/* CPU(ARM) - ARM, any version*/ -#define WTF_ARM_ARCH_AT_LEAST(N) \ - (CPU(ARM) && defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION >= N) - -#if defined(arm) || defined(__arm__) || defined(ARM) || defined(_ARM_) -#define WTF_CPU_ARM 1 - -#if defined(__ARMEB__) -#define WTF_CPU_BIG_ENDIAN 1 - -#elif !defined(__ARM_EABI__) && !defined(__EABI__) && !defined(__VFP_FP__) && \ - !defined(ANDROID) -#define WTF_CPU_MIDDLE_ENDIAN 1 - -#endif - -/* Set WTF_ARM_ARCH_VERSION */ -#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || \ - defined(__MARM_ARMV4__) -#define WTF_ARM_ARCH_VERSION 4 - -#elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \ - defined(__MARM_ARMV5__) -#define WTF_ARM_ARCH_VERSION 5 - -#elif defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) || \ - defined(__ARM_ARCH_5TEJ__) -#define WTF_ARM_ARCH_VERSION 5 - -#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \ - defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \ - defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) || \ - defined(__ARMV6__) -#define WTF_ARM_ARCH_VERSION 6 - -#elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || \ - defined(__ARM_ARCH_7S__) -#define WTF_ARM_ARCH_VERSION 7 - -/* MSVC sets _M_ARM */ -#elif defined(_M_ARM) -#define WTF_ARM_ARCH_VERSION _M_ARM -#else -#define WTF_ARM_ARCH_VERSION 0 - -#endif - -/* Set WTF_THUMB_ARCH_VERSION */ -#if defined(__ARM_ARCH_4T__) -#define WTF_THUMB_ARCH_VERSION 1 - -#elif defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__) || \ - defined(__ARM_ARCH_5TEJ__) -#define WTF_THUMB_ARCH_VERSION 2 - -#elif defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || \ - defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || \ - defined(__ARM_ARCH_6M__) -#define WTF_THUMB_ARCH_VERSION 3 - -#elif defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_7__) || \ - defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7M__) || \ - defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7S__) -#define WTF_THUMB_ARCH_VERSION 4 - -#else -#define WTF_THUMB_ARCH_VERSION 0 -#endif - -/* CPU(ARM_THUMB2) - Thumb2 instruction set is available */ -#if !defined(WTF_CPU_ARM_THUMB2) -#if defined(thumb2) || defined(__thumb2__) || \ - ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4) -#define WTF_CPU_ARM_THUMB2 1 -#elif WTF_ARM_ARCH_AT_LEAST(4) -#define WTF_CPU_ARM_THUMB2 0 -#else -#error "Unsupported ARM architecture" -#endif -#endif /* !defined(WTF_CPU_ARM_THUMB2) */ - -#if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON) -#define WTF_CPU_ARM_NEON 1 -#endif - -#if CPU(ARM_NEON) -// All NEON intrinsics usage can be disabled by this macro. -#define HAVE_ARM_NEON_INTRINSICS 1 -#endif - -#if defined(__ARM_ARCH_7S__) -#define WTF_CPU_APPLE_ARMV7S 1 -#endif - -#if !defined(WTF_CPU_64BIT) -#define WTF_CPU_32BIT 1 -#endif - -#endif /* ARM */ - -/* CPU(ARM64) - AArch64 64-bit */ -#if defined(__aarch64__) -#define WTF_CPU_ARM64 1 -#define WTF_CPU_64BIT 1 -#endif - -#endif // SKY_ENGINE_WTF_CPU_H_ diff --git a/sky/engine/wtf/CheckedArithmetic.h b/sky/engine/wtf/CheckedArithmetic.h deleted file mode 100644 index 02aa093567ee0..0000000000000 --- a/sky/engine/wtf/CheckedArithmetic.h +++ /dev/null @@ -1,735 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_CHECKEDARITHMETIC_H_ -#define SKY_ENGINE_WTF_CHECKEDARITHMETIC_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/EnumClass.h" -#include "flutter/sky/engine/wtf/TypeTraits.h" - -#include -#include - -/* Checked - * - * This class provides a mechanism to perform overflow-safe integer arithmetic - * without having to manually ensure that you have all the required bounds - * checks directly in your code. - * - * There are two modes of operation: - * - The default is Checked, and crashes at the point - * and overflow has occurred. - * - The alternative is Checked, which uses an additional - * byte of storage to track whether an overflow has occurred, subsequent - * unchecked operations will crash if an overflow has occured - * - * It is possible to provide a custom overflow handler, in which case you need - * to support these functions: - * - void overflowed(); - * This function is called when an operation has produced an overflow. - * - bool hasOverflowed(); - * This function must return true if overflowed() has been called on an - * instance and false if it has not. - * - void clearOverflow(); - * Used to reset overflow tracking when a value is being overwritten with - * a new value. - * - * Checked works for all integer types, with the following caveats: - * - Mixing signedness of operands is only supported for types narrower than - * 64bits. - * - It does have a performance impact, so tight loops may want to be careful - * when using it. - * - */ - -namespace WTF { - -ENUM_CLASS(CheckedState){DidOverflow, - DidNotOverflow} ENUM_CLASS_END(CheckedState); - -class CrashOnOverflow { - protected: - NO_RETURN_DUE_TO_CRASH void overflowed() { CRASH(); } - - void clearOverflow() {} - - public: - bool hasOverflowed() const { return false; } -}; - -class RecordOverflow { - protected: - RecordOverflow() : m_overflowed(false) {} - - void overflowed() { m_overflowed = true; } - - void clearOverflow() { m_overflowed = false; } - - public: - bool hasOverflowed() const { return m_overflowed; } - - private: - unsigned char m_overflowed; -}; - -template -class Checked; -template -struct RemoveChecked; -template -struct RemoveChecked>; - -template ::is_signed, - bool sourceSigned = std::numeric_limits::is_signed> -struct BoundsChecker; -template -struct BoundsChecker { - static bool inBounds(Source value) { - // Same signedness so implicit type conversion will always increase - // precision to widest type - return value <= std::numeric_limits::max(); - } -}; - -template -struct BoundsChecker { - static bool inBounds(Source value) { - // Same signedness so implicit type conversion will always increase - // precision to widest type - return std::numeric_limits::min() <= value && - value <= std::numeric_limits::max(); - } -}; - -template -struct BoundsChecker { - static bool inBounds(Source value) { - // Target is unsigned so any value less than zero is clearly unsafe - if (value < 0) - return false; - // If our (unsigned) Target is the same or greater width we can - // convert value to type Target without losing precision - if (sizeof(Target) >= sizeof(Source)) - return static_cast(value) <= std::numeric_limits::max(); - // The signed Source type has greater precision than the target so - // max(Target) -> Source will widen. - return value <= static_cast(std::numeric_limits::max()); - } -}; - -template -struct BoundsChecker { - static bool inBounds(Source value) { - // Signed target with an unsigned source - if (sizeof(Target) <= sizeof(Source)) - return value <= static_cast(std::numeric_limits::max()); - // Target is Wider than Source so we're guaranteed to fit any value in - // unsigned Source - return true; - } -}; - -template ::value || - (sizeof(Target) > sizeof(Source))> -struct BoundsCheckElider; -template -struct BoundsCheckElider { - static bool inBounds(Source) { return true; } -}; -template -struct BoundsCheckElider - : public BoundsChecker {}; - -template -static inline bool isInBounds(Source value) { - return BoundsCheckElider::inBounds(value); -} - -template -struct RemoveChecked { - typedef T CleanType; - static const CleanType DefaultValue = 0; -}; - -template -struct RemoveChecked> { - typedef typename RemoveChecked::CleanType CleanType; - static const CleanType DefaultValue = 0; -}; - -template -struct RemoveChecked> { - typedef typename RemoveChecked::CleanType CleanType; - static const CleanType DefaultValue = 0; -}; - -// The ResultBase and SignednessSelector are used to workaround typeof not being -// available in MSVC -template sizeof(V)), - bool sameSize = (sizeof(U) == sizeof(V))> -struct ResultBase; -template -struct ResultBase { - typedef U ResultType; -}; - -template -struct ResultBase { - typedef V ResultType; -}; - -template -struct ResultBase { - typedef U ResultType; -}; - -template ::is_signed, - bool vIsSigned = std::numeric_limits::is_signed> -struct SignednessSelector; -template -struct SignednessSelector { - typedef U ResultType; -}; - -template -struct SignednessSelector { - typedef U ResultType; -}; - -template -struct SignednessSelector { - typedef V ResultType; -}; - -template -struct SignednessSelector { - typedef U ResultType; -}; - -template -struct ResultBase { - typedef typename SignednessSelector::ResultType ResultType; -}; - -template -struct Result : ResultBase::CleanType, - typename RemoveChecked::CleanType> {}; - -template ::ResultType, - bool lhsSigned = std::numeric_limits::is_signed, - bool rhsSigned = std::numeric_limits::is_signed> -struct ArithmeticOperations; - -template -struct ArithmeticOperations { - // LHS and RHS are signed types - - // Helper function - static inline bool signsMatch(LHS lhs, RHS rhs) { return (lhs ^ rhs) >= 0; } - - static inline bool add(LHS lhs, - RHS rhs, - ResultType& result) WARN_UNUSED_RETURN { - if (signsMatch(lhs, rhs)) { - if (lhs >= 0) { - if ((std::numeric_limits::max() - rhs) < lhs) - return false; - } else { - ResultType temp = lhs - std::numeric_limits::min(); - if (rhs < -temp) - return false; - } - } // if the signs do not match this operation can't overflow - result = lhs + rhs; - return true; - } - - static inline bool sub(LHS lhs, - RHS rhs, - ResultType& result) WARN_UNUSED_RETURN { - if (!signsMatch(lhs, rhs)) { - if (lhs >= 0) { - if (lhs > std::numeric_limits::max() + rhs) - return false; - } else { - if (rhs > std::numeric_limits::max() + lhs) - return false; - } - } // if the signs match this operation can't overflow - result = lhs - rhs; - return true; - } - - static inline bool multiply(LHS lhs, - RHS rhs, - ResultType& result) WARN_UNUSED_RETURN { - if (signsMatch(lhs, rhs)) { - if (lhs >= 0) { - if (lhs && (std::numeric_limits::max() / lhs) < rhs) - return false; - } else { - if (static_cast(lhs) == - std::numeric_limits::min() || - static_cast(rhs) == - std::numeric_limits::min()) - return false; - if ((std::numeric_limits::max() / -lhs) < -rhs) - return false; - } - } else { - if (lhs < 0) { - if (rhs && lhs < (std::numeric_limits::min() / rhs)) - return false; - } else { - if (lhs && rhs < (std::numeric_limits::min() / lhs)) - return false; - } - } - result = lhs * rhs; - return true; - } - - static inline bool equals(LHS lhs, RHS rhs) { return lhs == rhs; } -}; - -template -struct ArithmeticOperations { - // LHS and RHS are unsigned types so bounds checks are nice and easy - static inline bool add(LHS lhs, - RHS rhs, - ResultType& result) WARN_UNUSED_RETURN { - ResultType temp = lhs + rhs; - if (temp < lhs) - return false; - result = temp; - return true; - } - - static inline bool sub(LHS lhs, - RHS rhs, - ResultType& result) WARN_UNUSED_RETURN { - ResultType temp = lhs - rhs; - if (temp > lhs) - return false; - result = temp; - return true; - } - - static inline bool multiply(LHS lhs, - RHS rhs, - ResultType& result) WARN_UNUSED_RETURN { - if (!lhs || !rhs) { - result = 0; - return true; - } - if (std::numeric_limits::max() / lhs < rhs) - return false; - result = lhs * rhs; - return true; - } - - static inline bool equals(LHS lhs, RHS rhs) { return lhs == rhs; } -}; - -template -struct ArithmeticOperations { - static inline bool add(int64_t lhs, int64_t rhs, ResultType& result) { - int64_t temp = lhs + rhs; - if (temp < std::numeric_limits::min()) - return false; - if (temp > std::numeric_limits::max()) - return false; - result = static_cast(temp); - return true; - } - - static inline bool sub(int64_t lhs, int64_t rhs, ResultType& result) { - int64_t temp = lhs - rhs; - if (temp < std::numeric_limits::min()) - return false; - if (temp > std::numeric_limits::max()) - return false; - result = static_cast(temp); - return true; - } - - static inline bool multiply(int64_t lhs, int64_t rhs, ResultType& result) { - int64_t temp = lhs * rhs; - if (temp < std::numeric_limits::min()) - return false; - if (temp > std::numeric_limits::max()) - return false; - result = static_cast(temp); - return true; - } - - static inline bool equals(int lhs, unsigned rhs) { - return static_cast(lhs) == static_cast(rhs); - } -}; - -template -struct ArithmeticOperations { - static inline bool add(int64_t lhs, int64_t rhs, ResultType& result) { - return ArithmeticOperations::add(rhs, lhs, - result); - } - - static inline bool sub(int64_t lhs, int64_t rhs, ResultType& result) { - return ArithmeticOperations::sub(lhs, rhs, - result); - } - - static inline bool multiply(int64_t lhs, int64_t rhs, ResultType& result) { - return ArithmeticOperations::multiply(rhs, lhs, - result); - } - - static inline bool equals(unsigned lhs, int rhs) { - return ArithmeticOperations::equals(rhs, lhs); - } -}; - -template -static inline bool safeAdd(U lhs, V rhs, R& result) { - return ArithmeticOperations::add(lhs, rhs, result); -} - -template -static inline bool safeSub(U lhs, V rhs, R& result) { - return ArithmeticOperations::sub(lhs, rhs, result); -} - -template -static inline bool safeMultiply(U lhs, V rhs, R& result) { - return ArithmeticOperations::multiply(lhs, rhs, result); -} - -template -static inline bool safeEquals(U lhs, V rhs) { - return ArithmeticOperations::equals(lhs, rhs); -} - -enum ResultOverflowedTag { ResultOverflowed }; - -template -class Checked : public OverflowHandler { - public: - template - friend class Checked; - Checked() : m_value(0) {} - - Checked(ResultOverflowedTag) : m_value(0) { this->overflowed(); } - - template - Checked(U value) { - if (!isInBounds(value)) - this->overflowed(); - m_value = static_cast(value); - } - - template - Checked(const Checked& rhs) : m_value(rhs.m_value) { - if (rhs.hasOverflowed()) - this->overflowed(); - } - - template - Checked(const Checked& rhs) : OverflowHandler(rhs) { - if (!isInBounds(rhs.m_value)) - this->overflowed(); - m_value = static_cast(rhs.m_value); - } - - template - Checked(const Checked& rhs) { - if (rhs.hasOverflowed()) - this->overflowed(); - if (!isInBounds(rhs.m_value)) - this->overflowed(); - m_value = static_cast(rhs.m_value); - } - - const Checked& operator=(Checked rhs) { - this->clearOverflow(); - if (rhs.hasOverflowed()) - this->overflowed(); - m_value = static_cast(rhs.m_value); - return *this; - } - - template - const Checked& operator=(U value) { - return *this = Checked(value); - } - - template - const Checked& operator=(const Checked& rhs) { - return *this = Checked(rhs); - } - - // prefix - const Checked& operator++() { - if (m_value == std::numeric_limits::max()) - this->overflowed(); - m_value++; - return *this; - } - - const Checked& operator--() { - if (m_value == std::numeric_limits::min()) - this->overflowed(); - m_value--; - return *this; - } - - // postfix operators - const Checked operator++(int) { - if (m_value == std::numeric_limits::max()) - this->overflowed(); - return Checked(m_value++); - } - - const Checked operator--(int) { - if (m_value == std::numeric_limits::min()) - this->overflowed(); - return Checked(m_value--); - } - - // Boolean operators - bool operator!() const { - if (this->hasOverflowed()) - CRASH(); - return !m_value; - } - - typedef void*(Checked::*UnspecifiedBoolType); - operator UnspecifiedBoolType*() const { - if (this->hasOverflowed()) - CRASH(); - return (m_value) ? reinterpret_cast(1) : 0; - } - - // Value accessors. unsafeGet() will crash if there's been an overflow. - T unsafeGet() const { - if (this->hasOverflowed()) - CRASH(); - return m_value; - } - - inline CheckedState safeGet(T& value) const WARN_UNUSED_RETURN { - value = m_value; - if (this->hasOverflowed()) - return CheckedState::DidOverflow; - return CheckedState::DidNotOverflow; - } - - // Mutating assignment - template - const Checked operator+=(U rhs) { - if (!safeAdd(m_value, rhs, m_value)) - this->overflowed(); - return *this; - } - - template - const Checked operator-=(U rhs) { - if (!safeSub(m_value, rhs, m_value)) - this->overflowed(); - return *this; - } - - template - const Checked operator*=(U rhs) { - if (!safeMultiply(m_value, rhs, m_value)) - this->overflowed(); - return *this; - } - - const Checked operator*=(double rhs) { - double result = rhs * m_value; - // Handle +/- infinity and NaN - if (!(std::numeric_limits::min() <= result && - std::numeric_limits::max() >= result)) - this->overflowed(); - m_value = (T)result; - return *this; - } - - const Checked operator*=(float rhs) { return *this *= (double)rhs; } - - template - const Checked operator+=(Checked rhs) { - if (rhs.hasOverflowed()) - this->overflowed(); - return *this += rhs.m_value; - } - - template - const Checked operator-=(Checked rhs) { - if (rhs.hasOverflowed()) - this->overflowed(); - return *this -= rhs.m_value; - } - - template - const Checked operator*=(Checked rhs) { - if (rhs.hasOverflowed()) - this->overflowed(); - return *this *= rhs.m_value; - } - - // Equality comparisons - template - bool operator==(Checked rhs) { - return unsafeGet() == rhs.unsafeGet(); - } - - template - bool operator==(U rhs) { - if (this->hasOverflowed()) - this->overflowed(); - return safeEquals(m_value, rhs); - } - - template - const Checked operator==(Checked rhs) { - return unsafeGet() == Checked(rhs.unsafeGet()); - } - - template - bool operator!=(U rhs) { - return !(*this == rhs); - } - - private: - // Disallow implicit conversion of floating point to integer types - Checked(float); - Checked(double); - void operator=(float); - void operator=(double); - void operator+=(float); - void operator+=(double); - void operator-=(float); - void operator-=(double); - T m_value; -}; - -template -static inline Checked::ResultType, OverflowHandler> -operator+(Checked lhs, Checked rhs) { - U x = 0; - V y = 0; - bool overflowed = lhs.safeGet(x) == CheckedState::DidOverflow || - rhs.safeGet(y) == CheckedState::DidOverflow; - typename Result::ResultType result = 0; - overflowed |= !safeAdd(x, y, result); - if (overflowed) - return ResultOverflowed; - return result; -} - -template -static inline Checked::ResultType, OverflowHandler> -operator-(Checked lhs, Checked rhs) { - U x = 0; - V y = 0; - bool overflowed = lhs.safeGet(x) == CheckedState::DidOverflow || - rhs.safeGet(y) == CheckedState::DidOverflow; - typename Result::ResultType result = 0; - overflowed |= !safeSub(x, y, result); - if (overflowed) - return ResultOverflowed; - return result; -} - -template -static inline Checked::ResultType, OverflowHandler> -operator*(Checked lhs, Checked rhs) { - U x = 0; - V y = 0; - bool overflowed = lhs.safeGet(x) == CheckedState::DidOverflow || - rhs.safeGet(y) == CheckedState::DidOverflow; - typename Result::ResultType result = 0; - overflowed |= !safeMultiply(x, y, result); - if (overflowed) - return ResultOverflowed; - return result; -} - -template -static inline Checked::ResultType, OverflowHandler> -operator+(Checked lhs, V rhs) { - return lhs + Checked(rhs); -} - -template -static inline Checked::ResultType, OverflowHandler> -operator-(Checked lhs, V rhs) { - return lhs - Checked(rhs); -} - -template -static inline Checked::ResultType, OverflowHandler> -operator*(Checked lhs, V rhs) { - return lhs * Checked(rhs); -} - -template -static inline Checked::ResultType, OverflowHandler> -operator+(U lhs, Checked rhs) { - return Checked(lhs) + rhs; -} - -template -static inline Checked::ResultType, OverflowHandler> -operator-(U lhs, Checked rhs) { - return Checked(lhs) - rhs; -} - -template -static inline Checked::ResultType, OverflowHandler> -operator*(U lhs, Checked rhs) { - return Checked(lhs) * rhs; -} - -} // namespace WTF - -using WTF::Checked; -using WTF::CheckedState; -using WTF::RecordOverflow; - -#endif // SKY_ENGINE_WTF_CHECKEDARITHMETIC_H_ diff --git a/sky/engine/wtf/CheckedArithmeticTest.cpp b/sky/engine/wtf/CheckedArithmeticTest.cpp deleted file mode 100644 index e015fd5f4cfbb..0000000000000 --- a/sky/engine/wtf/CheckedArithmeticTest.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/CheckedArithmetic.h" - -namespace { - -#define CheckedArithmeticTest(type, coerceLiteral, MixedSignednessTest) \ - TEST(WTF, Checked_##type) { \ - Checked value; \ - EXPECT_EQ(coerceLiteral(0), value.unsafeGet()); \ - EXPECT_EQ(std::numeric_limits::max(), \ - (value + std::numeric_limits::max()).unsafeGet()); \ - EXPECT_EQ(std::numeric_limits::max(), \ - (std::numeric_limits::max() + value).unsafeGet()); \ - EXPECT_EQ(std::numeric_limits::min(), \ - (value + std::numeric_limits::min()).unsafeGet()); \ - EXPECT_EQ(std::numeric_limits::min(), \ - (std::numeric_limits::min() + value).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (value * coerceLiteral(0)).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (coerceLiteral(0) * value).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (value * value).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (value - coerceLiteral(0)).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (coerceLiteral(0) - value).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (value - value).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (value++).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(1), (value--).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(1), (++value).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (--value).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(10), (value += coerceLiteral(10)).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(10), value.unsafeGet()); \ - EXPECT_EQ(coerceLiteral(100), (value *= coerceLiteral(10)).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(100), value.unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (value -= coerceLiteral(100)).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), value.unsafeGet()); \ - value = 10; \ - EXPECT_EQ(coerceLiteral(10), value.unsafeGet()); \ - EXPECT_EQ(coerceLiteral(0), (value - coerceLiteral(10)).unsafeGet()); \ - EXPECT_EQ(coerceLiteral(10), value.unsafeGet()); \ - value = std::numeric_limits::min(); \ - EXPECT_EQ(true, (Checked(value - coerceLiteral(1))) \ - .hasOverflowed()); \ - EXPECT_EQ(true, !((value--).hasOverflowed())); \ - EXPECT_EQ(true, value.hasOverflowed()); \ - value = std::numeric_limits::max(); \ - EXPECT_EQ(true, !value.hasOverflowed()); \ - EXPECT_EQ(true, (Checked(value + coerceLiteral(1))) \ - .hasOverflowed()); \ - EXPECT_EQ(true, !(value++).hasOverflowed()); \ - EXPECT_EQ(true, value.hasOverflowed()); \ - value = std::numeric_limits::max(); \ - EXPECT_EQ(true, (value += coerceLiteral(1)).hasOverflowed()); \ - EXPECT_EQ(true, value.hasOverflowed()); \ - value = 10; \ - type _value = 0; \ - EXPECT_EQ(true, \ - CheckedState::DidNotOverflow == \ - (value * Checked(0)).safeGet(_value)); \ - _value = 0; \ - EXPECT_EQ(true, \ - CheckedState::DidNotOverflow == \ - (Checked(0) * value).safeGet(_value)); \ - _value = 0; \ - EXPECT_EQ(true, CheckedState::DidOverflow == \ - (value * Checked( \ - std::numeric_limits::max())) \ - .safeGet(_value)); \ - _value = 0; \ - EXPECT_EQ( \ - true, \ - CheckedState::DidOverflow == \ - (Checked(std::numeric_limits::max()) * \ - value) \ - .safeGet(_value)); \ - value = 0; \ - _value = 0; \ - EXPECT_EQ(true, CheckedState::DidNotOverflow == \ - (value * Checked( \ - std::numeric_limits::max())) \ - .safeGet(_value)); \ - _value = 0; \ - EXPECT_EQ( \ - true, \ - CheckedState::DidNotOverflow == \ - (Checked(std::numeric_limits::max()) * \ - value) \ - .safeGet(_value)); \ - value = 1; \ - _value = 0; \ - EXPECT_EQ(true, CheckedState::DidNotOverflow == \ - (value * Checked( \ - std::numeric_limits::max())) \ - .safeGet(_value)); \ - _value = 0; \ - EXPECT_EQ( \ - true, \ - CheckedState::DidNotOverflow == \ - (Checked(std::numeric_limits::max()) * \ - value) \ - .safeGet(_value)); \ - _value = 0; \ - value = 0; \ - EXPECT_EQ(true, CheckedState::DidNotOverflow == \ - (value * Checked( \ - std::numeric_limits::max())) \ - .safeGet(_value)); \ - _value = 0; \ - EXPECT_EQ( \ - true, \ - CheckedState::DidNotOverflow == \ - (Checked(std::numeric_limits::max()) * \ - (type)0) \ - .safeGet(_value)); \ - _value = 0; \ - value = 1; \ - EXPECT_EQ(true, CheckedState::DidNotOverflow == \ - (value * Checked( \ - std::numeric_limits::max())) \ - .safeGet(_value)); \ - _value = 0; \ - EXPECT_EQ( \ - true, \ - CheckedState::DidNotOverflow == \ - (Checked(std::numeric_limits::max()) * \ - (type)1) \ - .safeGet(_value)); \ - _value = 0; \ - value = 2; \ - EXPECT_EQ(true, CheckedState::DidOverflow == \ - (value * Checked( \ - std::numeric_limits::max())) \ - .safeGet(_value)); \ - _value = 0; \ - EXPECT_EQ( \ - true, \ - CheckedState::DidOverflow == \ - (Checked(std::numeric_limits::max()) * \ - (type)2) \ - .safeGet(_value)); \ - value = 10; \ - EXPECT_EQ(true, (value * Checked( \ - std::numeric_limits::max())) \ - .hasOverflowed()); \ - MixedSignednessTest( \ - EXPECT_EQ(coerceLiteral(0), (value + -10).unsafeGet())); \ - MixedSignednessTest(EXPECT_EQ(0U, (value - 10U).unsafeGet())); \ - MixedSignednessTest( \ - EXPECT_EQ(coerceLiteral(0), (-10 + value).unsafeGet())); \ - MixedSignednessTest(EXPECT_EQ(0U, (10U - value).unsafeGet())); \ - value = std::numeric_limits::min(); \ - MixedSignednessTest(EXPECT_EQ( \ - true, (Checked(value - 1)).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, !(value--).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, value.hasOverflowed())); \ - value = std::numeric_limits::max(); \ - MixedSignednessTest(EXPECT_EQ(true, !value.hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ( \ - true, (Checked(value + 1)).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, !(value++).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, value.hasOverflowed())); \ - value = std::numeric_limits::max(); \ - MixedSignednessTest(EXPECT_EQ(true, (value += 1).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, value.hasOverflowed())); \ - value = std::numeric_limits::min(); \ - MixedSignednessTest(EXPECT_EQ(true, (value - 1U).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, !(value--).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, value.hasOverflowed())); \ - value = std::numeric_limits::max(); \ - MixedSignednessTest(EXPECT_EQ(true, !value.hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ( \ - true, (Checked(value + 1U)).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, !(value++).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, value.hasOverflowed())); \ - value = std::numeric_limits::max(); \ - MixedSignednessTest(EXPECT_EQ(true, (value += 1U).hasOverflowed())); \ - MixedSignednessTest(EXPECT_EQ(true, value.hasOverflowed())); \ - } - -#define CoerceLiteralToUnsigned(x) x##U -#define CoerceLiteralNop(x) x -#define AllowMixedSignednessTest(x) x -#define IgnoreMixedSignednessTest(x) -CheckedArithmeticTest(int8_t, CoerceLiteralNop, IgnoreMixedSignednessTest) - CheckedArithmeticTest(int16_t, CoerceLiteralNop, IgnoreMixedSignednessTest) - CheckedArithmeticTest(int32_t, - CoerceLiteralNop, - AllowMixedSignednessTest) - CheckedArithmeticTest(uint32_t, - CoerceLiteralToUnsigned, - AllowMixedSignednessTest) - CheckedArithmeticTest(int64_t, - CoerceLiteralNop, - IgnoreMixedSignednessTest) - CheckedArithmeticTest(uint64_t, - CoerceLiteralToUnsigned, - IgnoreMixedSignednessTest) - -} // namespace diff --git a/sky/engine/wtf/Compiler.h b/sky/engine/wtf/Compiler.h deleted file mode 100644 index 7767c52b18c61..0000000000000 --- a/sky/engine/wtf/Compiler.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_COMPILER_H_ -#define SKY_ENGINE_WTF_COMPILER_H_ - -/* COMPILER() - the compiler being used to build the project */ -#define COMPILER(WTF_FEATURE) \ - (defined WTF_COMPILER_##WTF_FEATURE && WTF_COMPILER_##WTF_FEATURE) - -/* ==== COMPILER() - the compiler being used to build the project ==== */ - -/* COMPILER(CLANG) - Clang */ -#if defined(__clang__) -#define WTF_COMPILER_CLANG 1 - -#define CLANG_PRAGMA(PRAGMA) _Pragma(PRAGMA) -#endif - -#ifndef CLANG_PRAGMA -#define CLANG_PRAGMA(PRAGMA) -#endif - -/* COMPILER(MSVC) - Microsoft Visual C++ */ -#if defined(_MSC_VER) -#define WTF_COMPILER_MSVC 1 -#endif - -/* COMPILER(GCC) - GNU Compiler Collection */ -#if defined(__GNUC__) -#define WTF_COMPILER_GCC 1 -#define GCC_VERSION \ - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -#define GCC_VERSION_AT_LEAST(major, minor, patch) \ - (GCC_VERSION >= (major * 10000 + minor * 100 + patch)) -#else -/* Define this for !GCC compilers, just so we can write things like - * GCC_VERSION_AT_LEAST(4, 1, 0). */ -#define GCC_VERSION_AT_LEAST(major, minor, patch) 0 -#endif - -/* ==== Compiler features ==== */ - -/* ALWAYS_INLINE */ - -#ifndef ALWAYS_INLINE -#if COMPILER(GCC) && defined(NDEBUG) -#define ALWAYS_INLINE inline __attribute__((__always_inline__)) -#else -#define ALWAYS_INLINE inline -#endif -#endif - -/* NEVER_INLINE */ - -#ifndef NEVER_INLINE -#if COMPILER(GCC) -#define NEVER_INLINE __attribute__((__noinline__)) -#else -#define NEVER_INLINE -#endif -#endif - -/* UNLIKELY */ - -#ifndef UNLIKELY -#if COMPILER(GCC) -#define UNLIKELY(x) __builtin_expect((x), 0) -#else -#define UNLIKELY(x) (x) -#endif -#endif - -/* LIKELY */ - -#ifndef LIKELY -#if COMPILER(GCC) -#define LIKELY(x) __builtin_expect((x), 1) -#else -#define LIKELY(x) (x) -#endif -#endif - -/* NO_RETURN */ - -#ifndef NO_RETURN -#if COMPILER(GCC) -#define NO_RETURN __attribute((__noreturn__)) -#else -#define NO_RETURN -#endif -#endif - -/* WARN_UNUSED_RETURN */ - -#if COMPILER(GCC) -#define WARN_UNUSED_RETURN __attribute__((warn_unused_result)) -#else -#define WARN_UNUSED_RETURN -#endif - -/* ALLOW_UNUSED */ - -#if COMPILER(GCC) -#define ALLOW_UNUSED __attribute__((unused)) -#else -#define ALLOW_UNUSED -#endif - -/* REFERENCED_FROM_ASM */ - -#ifndef REFERENCED_FROM_ASM -#if COMPILER(GCC) -#define REFERENCED_FROM_ASM __attribute__((used)) -#else -#define REFERENCED_FROM_ASM -#endif -#endif - -/* WTF_PRETTY_FUNCTION */ - -#if COMPILER(GCC) -#define WTF_PRETTY_FUNCTION __PRETTY_FUNCTION__ -#else -#define WTF_PRETTY_FUNCTION __FUNCTION__ -#endif - -#endif // SKY_ENGINE_WTF_COMPILER_H_ diff --git a/sky/engine/wtf/DataLog.cpp b/sky/engine/wtf/DataLog.cpp deleted file mode 100644 index 867bfb99a28b0..0000000000000 --- a/sky/engine/wtf/DataLog.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/DataLog.h" - -#if OS(POSIX) -#include -#include -#endif - -#define DATA_LOG_TO_FILE 0 - -// Uncomment to force logging to the given file regardless of what the -// environment variable says. Note that we will append "..txt" where -// is the PID. - -// This path won't work on Windows, make sure to change to something like -// C:\\Users\\\\log.txt. -#define DATA_LOG_FILENAME "/tmp/WTFLog" - -namespace WTF { - -#if USE(PTHREADS) -static pthread_once_t initializeLogFileOnceKey = PTHREAD_ONCE_INIT; -#endif - -static FilePrintStream* file; - -static void initializeLogFileOnce() { -#if DATA_LOG_TO_FILE -#ifdef DATA_LOG_FILENAME - const char* filename = DATA_LOG_FILENAME; -#else - const char* filename = getenv("WTF_DATA_LOG_FILENAME"); -#endif - char actualFilename[1024]; - - snprintf(actualFilename, sizeof(actualFilename), "%s.%d.txt", filename, - getpid()); - - if (filename) { - file = FilePrintStream::open(actualFilename, "w").leakPtr(); - if (!file) - fprintf(stderr, "Warning: Could not open log file %s for writing.\n", - actualFilename); - } -#endif // DATA_LOG_TO_FILE - if (!file) - file = new FilePrintStream(stderr, FilePrintStream::Borrow); - - setvbuf(file->file(), 0, _IONBF, 0); // Prefer unbuffered output, so that we - // get a full log upon crash or - // deadlock. -} - -static void initializeLogFile() { -#if USE(PTHREADS) - pthread_once(&initializeLogFileOnceKey, initializeLogFileOnce); -#else - if (!file) - initializeLogFileOnce(); -#endif -} - -FilePrintStream& dataFile() { - initializeLogFile(); - return *file; -} - -void dataLogFV(const char* format, va_list argList) { - dataFile().vprintf(format, argList); -} - -void dataLogF(const char* format, ...) { - va_list argList; - va_start(argList, format); - dataLogFV(format, argList); - va_end(argList); -} - -void dataLogFString(const char* str) { - dataFile().printf("%s", str); -} - -} // namespace WTF diff --git a/sky/engine/wtf/DataLog.h b/sky/engine/wtf/DataLog.h deleted file mode 100644 index aa056cc78b228..0000000000000 --- a/sky/engine/wtf/DataLog.h +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_DATALOG_H_ -#define SKY_ENGINE_WTF_DATALOG_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/FilePrintStream.h" - -#include -#include - -namespace WTF { - -FilePrintStream& dataFile(); - -void dataLogFV(const char* format, va_list) WTF_ATTRIBUTE_PRINTF(1, 0); -void dataLogF(const char* format, ...) WTF_ATTRIBUTE_PRINTF(1, 2); -void dataLogFString(const char*); - -template -void dataLog(const T& value) { - dataFile().print(value); -} - -template -void dataLog(const T1& value1, const T2& value2) { - dataFile().print(value1, value2); -} - -template -void dataLog(const T1& value1, const T2& value2, const T3& value3) { - dataFile().print(value1, value2, value3); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4) { - dataFile().print(value1, value2, value3, value4); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5) { - dataFile().print(value1, value2, value3, value4, value5); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6) { - dataFile().print(value1, value2, value3, value4, value5, value6); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7) { - dataFile().print(value1, value2, value3, value4, value5, value6, value7); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8) { - dataFile().print(value1, value2, value3, value4, value5, value6, value7, - value8); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9) { - dataFile().print(value1, value2, value3, value4, value5, value6, value7, - value8, value9); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9, - const T10& value10) { - dataFile().print(value1, value2, value3, value4, value5, value6, value7, - value8, value9, value10); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9, - const T10& value10, - const T11& value11) { - dataFile().print(value1, value2, value3, value4, value5, value6, value7, - value8, value9, value10, value11); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9, - const T10& value10, - const T11& value11, - const T12& value12) { - dataFile().print(value1, value2, value3, value4, value5, value6, value7, - value8, value9, value10, value11, value12); -} - -template -void dataLog(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9, - const T10& value10, - const T11& value11, - const T12& value12, - const T13& value13) { - dataFile().print(value1, value2, value3, value4, value5, value6, value7, - value8, value9, value10, value11, value12, value13); -} - -} // namespace WTF - -using WTF::dataLog; -using WTF::dataLogF; -using WTF::dataLogFString; - -#endif // SKY_ENGINE_WTF_DATALOG_H_ diff --git a/sky/engine/wtf/DefaultAllocator.cpp b/sky/engine/wtf/DefaultAllocator.cpp deleted file mode 100644 index 313887f90d49a..0000000000000 --- a/sky/engine/wtf/DefaultAllocator.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/DefaultAllocator.h" - -#include "flutter/sky/engine/wtf/PartitionAlloc.h" - -namespace WTF { - -void* DefaultAllocator::backingAllocate(size_t size) { - return partitionAllocGeneric(Partitions::getBufferPartition(), size); -} - -void DefaultAllocator::backingFree(void* address) { - partitionFreeGeneric(Partitions::getBufferPartition(), address); -} - -} // namespace WTF diff --git a/sky/engine/wtf/DefaultAllocator.h b/sky/engine/wtf/DefaultAllocator.h deleted file mode 100644 index 6593da24e7036..0000000000000 --- a/sky/engine/wtf/DefaultAllocator.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_DEFAULTALLOCATOR_H_ -#define SKY_ENGINE_WTF_DEFAULTALLOCATOR_H_ - -// This is the allocator that is used for allocations that are not on the -// traced, garbage collected heap. It uses FastMalloc for collections, -// but uses the partition allocator for the backing store of the collections. - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/PartitionAlloc.h" -#include "flutter/sky/engine/wtf/WTF.h" - -#include - -namespace WTF { - -class DefaultAllocatorDummyVisitor; - -class DefaultAllocatorQuantizer { - public: - template - static size_t quantizedSize(size_t count) { - RELEASE_ASSERT(count <= kMaxUnquantizedAllocation / sizeof(T)); - return partitionAllocActualSize(Partitions::getBufferPartition(), - count * sizeof(T)); - } - static const size_t kMaxUnquantizedAllocation = kGenericMaxDirectMapped; -}; - -class DefaultAllocator { - public: - typedef DefaultAllocatorQuantizer Quantizer; - static const bool isGarbageCollected = false; - template - struct VectorBackingHelper { - typedef void Type; - }; - template - struct HashTableBackingHelper { - typedef void Type; - }; - template - static Return backingMalloc(size_t size) { - return reinterpret_cast(backingAllocate(size)); - } - template - static Return zeroedBackingMalloc(size_t size) { - void* result = backingAllocate(size); - memset(result, 0, size); - return reinterpret_cast(result); - } - template - static Return malloc(size_t size) { - return reinterpret_cast(fastMalloc(size)); - } - WTF_EXPORT static void backingFree(void* address); - static void free(void* address) { fastFree(address); } - template - static void* newArray(size_t bytes) { - return malloc(bytes); - } - static void deleteArray(void* ptr) { - free(ptr); // Not the system free, the one from this class. - } - - static bool isAllocationAllowed() { return true; } - - static void markNoTracing(...) { ASSERT_NOT_REACHED(); } - - static void registerDelayedMarkNoTracing(...) { ASSERT_NOT_REACHED(); } - - static void registerWeakMembers(...) { ASSERT_NOT_REACHED(); } - - static void registerWeakTable(...) { ASSERT_NOT_REACHED(); } - -#if ENABLE(ASSERT) - static bool weakTableRegistered(...) { - ASSERT_NOT_REACHED(); - return false; - } -#endif - - template - static void trace(...) { - ASSERT_NOT_REACHED(); - } - - template - struct OtherType { - typedef T* Type; - }; - - template - static T& getOther(T* other) { - return *other; - } - - static void enterNoAllocationScope() {} - static void leaveNoAllocationScope() {} - - private: - WTF_EXPORT static void* backingAllocate(size_t); -}; - -// The Windows compiler seems to be very eager to instantiate things it won't -// need, so unless we have this class we get compile errors. -class DefaultAllocatorDummyVisitor { - public: - template - inline bool isAlive(T obj) { - ASSERT_NOT_REACHED(); - return false; - } -}; - -} // namespace WTF - -#define WTF_USE_ALLOCATOR(ClassName, Allocator) \ - public: \ - void* operator new(size_t size) { \ - return Allocator::template malloc(size); \ - } \ - void operator delete(void* p) { Allocator::free(p); } \ - void* operator new[](size_t size) { \ - return Allocator::template newArray(size); \ - } \ - void operator delete[](void* p) { Allocator::deleteArray(p); } \ - void* operator new(size_t, NotNullTag, void* location) { \ - ASSERT(location); \ - return location; \ - } \ - \ - private: \ - typedef int __thisIsHereToForceASemicolonAfterThisMacro - -using WTF::DefaultAllocator; - -#endif // SKY_ENGINE_WTF_DEFAULTALLOCATOR_H_ diff --git a/sky/engine/wtf/Deque.h b/sky/engine/wtf/Deque.h deleted file mode 100644 index 5b85864122bc9..0000000000000 --- a/sky/engine/wtf/Deque.h +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_DEQUE_H_ -#define SKY_ENGINE_WTF_DEQUE_H_ - -// FIXME: Could move what Vector and Deque share into a separate file. -// Deque doesn't actually use Vector. - -#include -#include "flutter/sky/engine/wtf/PassTraits.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace WTF { -template -class DequeIteratorBase; -template -class DequeIterator; -template -class DequeConstIterator; - -template -class Deque : public VectorDestructorBase, - T, - (inlineCapacity > 0), - Allocator::isGarbageCollected> { - WTF_USE_ALLOCATOR(Deque, Allocator); - - public: - typedef DequeIterator iterator; - typedef DequeConstIterator const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - typedef PassTraits Pass; - typedef typename PassTraits::PassType PassType; - - Deque(); - Deque(const Deque&); - // FIXME: Doesn't work if there is an inline buffer, due to crbug.com/360572 - Deque& operator=(const Deque&); - - void finalize(); - - // We hard wire the inlineCapacity to zero here, due to crbug.com/360572 - void swap(Deque&); - - size_t size() const { - return m_start <= m_end ? m_end - m_start - : m_end + m_buffer.capacity() - m_start; - } - bool isEmpty() const { return m_start == m_end; } - - iterator begin() { return iterator(this, m_start); } - iterator end() { return iterator(this, m_end); } - const_iterator begin() const { return const_iterator(this, m_start); } - const_iterator end() const { return const_iterator(this, m_end); } - reverse_iterator rbegin() { return reverse_iterator(end()); } - reverse_iterator rend() { return reverse_iterator(begin()); } - const_reverse_iterator rbegin() const { - return const_reverse_iterator(end()); - } - const_reverse_iterator rend() const { - return const_reverse_iterator(begin()); - } - - T& first() { - ASSERT(m_start != m_end); - return m_buffer.buffer()[m_start]; - } - const T& first() const { - ASSERT(m_start != m_end); - return m_buffer.buffer()[m_start]; - } - PassType takeFirst(); - - T& last() { - ASSERT(m_start != m_end); - return *(--end()); - } - const T& last() const { - ASSERT(m_start != m_end); - return *(--end()); - } - PassType takeLast(); - - T& at(size_t i) { - RELEASE_ASSERT(i < size()); - size_t right = m_buffer.capacity() - m_start; - return i < right ? m_buffer.buffer()[m_start + i] - : m_buffer.buffer()[i - right]; - } - const T& at(size_t i) const { - RELEASE_ASSERT(i < size()); - size_t right = m_buffer.capacity() - m_start; - return i < right ? m_buffer.buffer()[m_start + i] - : m_buffer.buffer()[i - right]; - } - - T& operator[](size_t i) { return at(i); } - const T& operator[](size_t i) const { return at(i); } - - template - void append(const U&); - template - void prepend(const U&); - void removeFirst(); - void removeLast(); - void remove(iterator&); - void remove(const_iterator&); - - void clear(); - - template - iterator findIf(Predicate&); - - private: - friend class DequeIteratorBase; - - typedef VectorBuffer Buffer; - typedef VectorTypeOperations TypeOperations; - typedef DequeIteratorBase IteratorBase; - - void remove(size_t position); - void destroyAll(); - void expandCapacityIfNeeded(); - void expandCapacity(); - - Buffer m_buffer; - unsigned m_start; - unsigned m_end; -}; - -template -class DequeIteratorBase { - protected: - DequeIteratorBase(); - DequeIteratorBase(const Deque*, size_t); - DequeIteratorBase(const DequeIteratorBase&); - DequeIteratorBase& operator=( - const DequeIteratorBase&); - ~DequeIteratorBase(); - - void assign(const DequeIteratorBase& other) { *this = other; } - - void increment(); - void decrement(); - - T* before() const; - T* after() const; - - bool isEqual(const DequeIteratorBase&) const; - - private: - Deque* m_deque; - unsigned m_index; - - friend class Deque; -}; - -template -class DequeIterator : public DequeIteratorBase { - private: - typedef DequeIteratorBase Base; - typedef DequeIterator Iterator; - - public: - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef T* pointer; - typedef T& reference; - typedef std::bidirectional_iterator_tag iterator_category; - - DequeIterator(Deque* deque, size_t index) - : Base(deque, index) {} - - DequeIterator(const Iterator& other) : Base(other) {} - DequeIterator& operator=(const Iterator& other) { - Base::assign(other); - return *this; - } - - T& operator*() const { return *Base::after(); } - T* operator->() const { return Base::after(); } - - bool operator==(const Iterator& other) const { return Base::isEqual(other); } - bool operator!=(const Iterator& other) const { return !Base::isEqual(other); } - - Iterator& operator++() { - Base::increment(); - return *this; - } - // postfix ++ intentionally omitted - Iterator& operator--() { - Base::decrement(); - return *this; - } - // postfix -- intentionally omitted -}; - -template -class DequeConstIterator - : public DequeIteratorBase { - private: - typedef DequeIteratorBase Base; - typedef DequeConstIterator Iterator; - typedef DequeIterator NonConstIterator; - - public: - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef const T* pointer; - typedef const T& reference; - typedef std::bidirectional_iterator_tag iterator_category; - - DequeConstIterator(const Deque* deque, - size_t index) - : Base(deque, index) {} - - DequeConstIterator(const Iterator& other) : Base(other) {} - DequeConstIterator(const NonConstIterator& other) : Base(other) {} - DequeConstIterator& operator=(const Iterator& other) { - Base::assign(other); - return *this; - } - DequeConstIterator& operator=(const NonConstIterator& other) { - Base::assign(other); - return *this; - } - - const T& operator*() const { return *Base::after(); } - const T* operator->() const { return Base::after(); } - - bool operator==(const Iterator& other) const { return Base::isEqual(other); } - bool operator!=(const Iterator& other) const { return !Base::isEqual(other); } - - Iterator& operator++() { - Base::increment(); - return *this; - } - // postfix ++ intentionally omitted - Iterator& operator--() { - Base::decrement(); - return *this; - } - // postfix -- intentionally omitted -}; - -template -inline Deque::Deque() : m_start(0), m_end(0) {} - -template -inline Deque::Deque( - const Deque& other) - : m_buffer(other.m_buffer.capacity()), - m_start(other.m_start), - m_end(other.m_end) { - const T* otherBuffer = other.m_buffer.buffer(); - if (m_start <= m_end) - TypeOperations::uninitializedCopy(otherBuffer + m_start, - otherBuffer + m_end, - m_buffer.buffer() + m_start); - else { - TypeOperations::uninitializedCopy(otherBuffer, otherBuffer + m_end, - m_buffer.buffer()); - TypeOperations::uninitializedCopy(otherBuffer + m_start, - otherBuffer + m_buffer.capacity(), - m_buffer.buffer() + m_start); - } -} - -template -inline Deque& Deque::operator=( - const Deque& other) { - Deque copy(other); - swap(copy); - return *this; -} - -template -inline void Deque::destroyAll() { - if (m_start <= m_end) { - TypeOperations::destruct(m_buffer.buffer() + m_start, - m_buffer.buffer() + m_end); - } else { - TypeOperations::destruct(m_buffer.buffer(), m_buffer.buffer() + m_end); - TypeOperations::destruct(m_buffer.buffer() + m_start, - m_buffer.buffer() + m_buffer.capacity()); - } -} - -// Off-GC-heap deques: Destructor should be called. -// On-GC-heap deques: Destructor should be called for inline buffers -// (if any) but destructor shouldn't be called for vector backing since -// it is managed by the traced GC heap. -template -inline void Deque::finalize() { - if (!inlineCapacity && !m_buffer.buffer()) - return; - if (!isEmpty() && - !(Allocator::isGarbageCollected && m_buffer.hasOutOfLineBuffer())) - destroyAll(); - - m_buffer.destruct(); -} - -// FIXME: Doesn't work if there is an inline buffer, due to crbug.com/360572 -template -inline void Deque::swap( - Deque& other) { - std::swap(m_start, other.m_start); - std::swap(m_end, other.m_end); - m_buffer.swapVectorBuffer(other.m_buffer); -} - -template -inline void Deque::clear() { - destroyAll(); - m_start = 0; - m_end = 0; - m_buffer.deallocateBuffer(m_buffer.buffer()); - m_buffer.resetBufferPointer(); -} - -template -template -inline DequeIterator -Deque::findIf(Predicate& predicate) { - iterator end_iterator = end(); - for (iterator it = begin(); it != end_iterator; ++it) { - if (predicate(*it)) - return it; - } - return end_iterator; -} - -template -inline void Deque::expandCapacityIfNeeded() { - if (m_start) { - if (m_end + 1 != m_start) - return; - } else if (m_end) { - if (m_end != m_buffer.capacity() - 1) - return; - } else if (m_buffer.capacity()) - return; - - expandCapacity(); -} - -template -void Deque::expandCapacity() { - size_t oldCapacity = m_buffer.capacity(); - T* oldBuffer = m_buffer.buffer(); - m_buffer.allocateBuffer( - std::max(static_cast(16), oldCapacity + oldCapacity / 4 + 1)); - if (m_start <= m_end) - TypeOperations::move(oldBuffer + m_start, oldBuffer + m_end, - m_buffer.buffer() + m_start); - else { - TypeOperations::move(oldBuffer, oldBuffer + m_end, m_buffer.buffer()); - size_t newStart = m_buffer.capacity() - (oldCapacity - m_start); - TypeOperations::move(oldBuffer + m_start, oldBuffer + oldCapacity, - m_buffer.buffer() + newStart); - m_start = newStart; - } - m_buffer.deallocateBuffer(oldBuffer); -} - -template -inline typename Deque::PassType -Deque::takeFirst() { - T oldFirst = Pass::transfer(first()); - removeFirst(); - return Pass::transfer(oldFirst); -} - -template -inline typename Deque::PassType -Deque::takeLast() { - T oldLast = Pass::transfer(last()); - removeLast(); - return Pass::transfer(oldLast); -} - -template -template -inline void Deque::append(const U& value) { - expandCapacityIfNeeded(); - new (NotNull, &m_buffer.buffer()[m_end]) T(value); - if (m_end == m_buffer.capacity() - 1) - m_end = 0; - else - ++m_end; -} - -template -template -inline void Deque::prepend(const U& value) { - expandCapacityIfNeeded(); - if (!m_start) - m_start = m_buffer.capacity() - 1; - else - --m_start; - new (NotNull, &m_buffer.buffer()[m_start]) T(value); -} - -template -inline void Deque::removeFirst() { - ASSERT(!isEmpty()); - TypeOperations::destruct(&m_buffer.buffer()[m_start], - &m_buffer.buffer()[m_start + 1]); - if (m_start == m_buffer.capacity() - 1) - m_start = 0; - else - ++m_start; -} - -template -inline void Deque::removeLast() { - ASSERT(!isEmpty()); - if (!m_end) - m_end = m_buffer.capacity() - 1; - else - --m_end; - TypeOperations::destruct(&m_buffer.buffer()[m_end], - &m_buffer.buffer()[m_end + 1]); -} - -template -inline void Deque::remove(iterator& it) { - remove(it.m_index); -} - -template -inline void Deque::remove(const_iterator& it) { - remove(it.m_index); -} - -template -inline void Deque::remove(size_t position) { - if (position == m_end) - return; - - T* buffer = m_buffer.buffer(); - TypeOperations::destruct(&buffer[position], &buffer[position + 1]); - - // Find which segment of the circular buffer contained the remove element, and - // only move elements in that part. - if (position >= m_start) { - TypeOperations::moveOverlapping(buffer + m_start, buffer + position, - buffer + m_start + 1); - m_start = (m_start + 1) % m_buffer.capacity(); - } else { - TypeOperations::moveOverlapping(buffer + position + 1, buffer + m_end, - buffer + position); - m_end = (m_end - 1 + m_buffer.capacity()) % m_buffer.capacity(); - } -} - -template -inline DequeIteratorBase::DequeIteratorBase() - : m_deque(0) {} - -template -inline DequeIteratorBase::DequeIteratorBase( - const Deque* deque, - size_t index) - : m_deque(const_cast*>(deque)), - m_index(index) {} - -template -inline DequeIteratorBase::DequeIteratorBase( - const DequeIteratorBase& other) - : m_deque(other.m_deque), m_index(other.m_index) {} - -template -inline DequeIteratorBase& -DequeIteratorBase::operator=( - const DequeIteratorBase& other) { - m_deque = other.m_deque; - m_index = other.m_index; - return *this; -} - -template -inline DequeIteratorBase::~DequeIteratorBase() {} - -template -inline bool DequeIteratorBase::isEqual( - const DequeIteratorBase& other) const { - return m_index == other.m_index; -} - -template -inline void DequeIteratorBase::increment() { - ASSERT(m_index != m_deque->m_end); - ASSERT(m_deque->m_buffer.capacity()); - if (m_index == m_deque->m_buffer.capacity() - 1) - m_index = 0; - else - ++m_index; -} - -template -inline void DequeIteratorBase::decrement() { - ASSERT(m_index != m_deque->m_start); - ASSERT(m_deque->m_buffer.capacity()); - if (!m_index) - m_index = m_deque->m_buffer.capacity() - 1; - else - --m_index; -} - -template -inline T* DequeIteratorBase::after() const { - ASSERT(m_index != m_deque->m_end); - return &m_deque->m_buffer.buffer()[m_index]; -} - -template -inline T* DequeIteratorBase::before() const { - ASSERT(m_index != m_deque->m_start); - if (!m_index) - return &m_deque->m_buffer.buffer()[m_deque->m_buffer.capacity() - 1]; - return &m_deque->m_buffer.buffer()[m_index - 1]; -} - -template -inline void swap(Deque& a, - Deque& b) { - a.swap(b); -} - -} // namespace WTF - -using WTF::Deque; - -#endif // SKY_ENGINE_WTF_DEQUE_H_ diff --git a/sky/engine/wtf/DequeTest.cpp b/sky/engine/wtf/DequeTest.cpp deleted file mode 100644 index fedb77a9d3bfc..0000000000000 --- a/sky/engine/wtf/DequeTest.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/Deque.h" - -#include -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -namespace { - -TEST(DequeTest, Basic) { - Deque intDeque; - EXPECT_TRUE(intDeque.isEmpty()); - EXPECT_EQ(0ul, intDeque.size()); -} - -void checkNumberSequence(Deque& deque, int from, int to, bool increment) { - Deque::iterator it = increment ? deque.begin() : deque.end(); - size_t index = increment ? 0 : deque.size(); - int step = from < to ? 1 : -1; - for (int i = from; i != to + step; i += step) { - if (!increment) { - --it; - --index; - } - - EXPECT_EQ(i, *it); - EXPECT_EQ(i, deque[index]); - - if (increment) { - ++it; - ++index; - } - } - EXPECT_EQ(increment ? deque.end() : deque.begin(), it); - EXPECT_EQ(increment ? deque.size() : 0, index); -} - -void checkNumberSequenceReverse(Deque& deque, - int from, - int to, - bool increment) { - Deque::reverse_iterator it = increment ? deque.rbegin() : deque.rend(); - size_t index = increment ? 0 : deque.size(); - int step = from < to ? 1 : -1; - for (int i = from; i != to + step; i += step) { - if (!increment) { - --it; - --index; - } - - EXPECT_EQ(i, *it); - EXPECT_EQ(i, deque.at(deque.size() - 1 - index)); - - if (increment) { - ++it; - ++index; - } - } - EXPECT_EQ(increment ? deque.rend() : deque.rbegin(), it); - EXPECT_EQ(increment ? deque.size() : 0, index); -} - -TEST(DequeTest, Reverse) { - Deque intDeque; - intDeque.append(10); - intDeque.append(11); - intDeque.append(12); - intDeque.append(13); - - checkNumberSequence(intDeque, 10, 13, true); - checkNumberSequence(intDeque, 13, 10, false); - checkNumberSequenceReverse(intDeque, 13, 10, true); - checkNumberSequenceReverse(intDeque, 10, 13, false); - - intDeque.append(14); - intDeque.append(15); - EXPECT_EQ(10, intDeque.takeFirst()); - EXPECT_EQ(15, intDeque.takeLast()); - checkNumberSequence(intDeque, 11, 14, true); - checkNumberSequence(intDeque, 14, 11, false); - checkNumberSequenceReverse(intDeque, 14, 11, true); - checkNumberSequenceReverse(intDeque, 11, 14, false); - - for (int i = 15; i < 200; ++i) - intDeque.append(i); - checkNumberSequence(intDeque, 11, 199, true); - checkNumberSequence(intDeque, 199, 11, false); - checkNumberSequenceReverse(intDeque, 199, 11, true); - checkNumberSequenceReverse(intDeque, 11, 199, false); - - for (int i = 0; i < 180; ++i) { - EXPECT_EQ(i + 11, intDeque[0]); - EXPECT_EQ(i + 11, intDeque.takeFirst()); - } - checkNumberSequence(intDeque, 191, 199, true); - checkNumberSequence(intDeque, 199, 191, false); - checkNumberSequenceReverse(intDeque, 199, 191, true); - checkNumberSequenceReverse(intDeque, 191, 199, false); - - Deque intDeque2; - swap(intDeque, intDeque2); - - checkNumberSequence(intDeque2, 191, 199, true); - checkNumberSequence(intDeque2, 199, 191, false); - checkNumberSequenceReverse(intDeque2, 199, 191, true); - checkNumberSequenceReverse(intDeque2, 191, 199, false); - - intDeque.swap(intDeque2); - - checkNumberSequence(intDeque, 191, 199, true); - checkNumberSequence(intDeque, 199, 191, false); - checkNumberSequenceReverse(intDeque, 199, 191, true); - checkNumberSequenceReverse(intDeque, 191, 199, false); - - intDeque.swap(intDeque2); - - checkNumberSequence(intDeque2, 191, 199, true); - checkNumberSequence(intDeque2, 199, 191, false); - checkNumberSequenceReverse(intDeque2, 199, 191, true); - checkNumberSequenceReverse(intDeque2, 191, 199, false); -} - -class DestructCounter { - public: - explicit DestructCounter(int i, int* destructNumber) - : m_i(i), m_destructNumber(destructNumber) {} - - ~DestructCounter() { ++(*m_destructNumber); } - int get() const { return m_i; } - - private: - int m_i; - int* m_destructNumber; -}; - -typedef WTF::Deque> OwnPtrDeque; - -TEST(DequeTest, OwnPtr) { - int destructNumber = 0; - OwnPtrDeque deque; - deque.append(adoptPtr(new DestructCounter(0, &destructNumber))); - deque.append(adoptPtr(new DestructCounter(1, &destructNumber))); - EXPECT_EQ(2u, deque.size()); - - OwnPtr& counter0 = deque.first(); - EXPECT_EQ(0, counter0->get()); - int counter1 = deque.last()->get(); - EXPECT_EQ(1, counter1); - EXPECT_EQ(0, destructNumber); - - size_t index = 0; - for (OwnPtrDeque::iterator iter = deque.begin(); iter != deque.end(); - ++iter) { - OwnPtr& refCounter = *iter; - EXPECT_EQ(index, static_cast(refCounter->get())); - EXPECT_EQ(index, static_cast((*refCounter).get())); - index++; - } - EXPECT_EQ(0, destructNumber); - - OwnPtrDeque::iterator it = deque.begin(); - for (index = 0; index < deque.size(); ++index) { - OwnPtr& refCounter = *it; - EXPECT_EQ(index, static_cast(refCounter->get())); - index++; - ++it; - } - EXPECT_EQ(0, destructNumber); - - EXPECT_EQ(0, deque.first()->get()); - deque.removeFirst(); - EXPECT_EQ(1, deque.first()->get()); - EXPECT_EQ(1u, deque.size()); - EXPECT_EQ(1, destructNumber); - - OwnPtr ownCounter1 = deque.first().release(); - deque.removeFirst(); - EXPECT_EQ(counter1, ownCounter1->get()); - EXPECT_EQ(0u, deque.size()); - EXPECT_EQ(1, destructNumber); - - ownCounter1.clear(); - EXPECT_EQ(2, destructNumber); - - size_t count = 1025; - destructNumber = 0; - for (size_t i = 0; i < count; ++i) - deque.prepend(adoptPtr(new DestructCounter(i, &destructNumber))); - - // Deque relocation must not destruct OwnPtr element. - EXPECT_EQ(0, destructNumber); - EXPECT_EQ(count, deque.size()); - - OwnPtrDeque copyDeque; - deque.swap(copyDeque); - EXPECT_EQ(0, destructNumber); - EXPECT_EQ(count, copyDeque.size()); - EXPECT_EQ(0u, deque.size()); - - copyDeque.clear(); - EXPECT_EQ(count, static_cast(destructNumber)); -} - -// WrappedInt class will fail if it was memmoved or memcpyed. -static HashSet constructedWrappedInts; -class WrappedInt { - public: - WrappedInt(int i = 0) : m_originalThisPtr(this), m_i(i) { - constructedWrappedInts.add(this); - } - - WrappedInt(const WrappedInt& other) - : m_originalThisPtr(this), m_i(other.m_i) { - constructedWrappedInts.add(this); - } - - WrappedInt& operator=(const WrappedInt& other) { - m_i = other.m_i; - return *this; - } - - ~WrappedInt() { - EXPECT_EQ(m_originalThisPtr, this); - EXPECT_TRUE(constructedWrappedInts.contains(this)); - constructedWrappedInts.remove(this); - } - - int get() const { return m_i; } - - private: - void* m_originalThisPtr; - int m_i; -}; - -TEST(DequeTest, SwapWithoutInlineCapacity) { - Deque dequeA; - dequeA.append(WrappedInt(1)); - Deque dequeB; - dequeB.append(WrappedInt(2)); - - ASSERT_EQ(dequeA.size(), dequeB.size()); - dequeA.swap(dequeB); - - ASSERT_EQ(1u, dequeA.size()); - EXPECT_EQ(2, dequeA.first().get()); - ASSERT_EQ(1u, dequeB.size()); - EXPECT_EQ(1, dequeB.first().get()); - - dequeA.append(WrappedInt(3)); - - ASSERT_GT(dequeA.size(), dequeB.size()); - dequeA.swap(dequeB); - - ASSERT_EQ(1u, dequeA.size()); - EXPECT_EQ(1, dequeA.first().get()); - ASSERT_EQ(2u, dequeB.size()); - EXPECT_EQ(2, dequeB.first().get()); - - ASSERT_LT(dequeA.size(), dequeB.size()); - dequeA.swap(dequeB); - - ASSERT_EQ(2u, dequeA.size()); - EXPECT_EQ(2, dequeA.first().get()); - ASSERT_EQ(1u, dequeB.size()); - EXPECT_EQ(1, dequeB.first().get()); - - dequeA.append(WrappedInt(4)); - dequeA.swap(dequeB); - - ASSERT_EQ(1u, dequeA.size()); - EXPECT_EQ(1, dequeA.first().get()); - ASSERT_EQ(3u, dequeB.size()); - EXPECT_EQ(2, dequeB.first().get()); - - dequeB.swap(dequeA); -} - -} // namespace diff --git a/sky/engine/wtf/DoubleBufferedDeque.h b/sky/engine/wtf/DoubleBufferedDeque.h deleted file mode 100644 index 9ebe68ae757c3..0000000000000 --- a/sky/engine/wtf/DoubleBufferedDeque.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_WTF_DOUBLEBUFFEREDDEQUE_H_ -#define SKY_ENGINE_WTF_DOUBLEBUFFEREDDEQUE_H_ - -#include "flutter/sky/engine/wtf/Deque.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" - -namespace WTF { - -// A helper class for managing double buffered deques, typically where the -// client locks when appending or swapping. -template -class DoubleBufferedDeque { - WTF_MAKE_NONCOPYABLE(DoubleBufferedDeque); - - public: - DoubleBufferedDeque() : m_activeIndex(0) {} - - void append(const T& value) { m_queue[m_activeIndex].append(value); } - - bool isEmpty() const { return m_queue[m_activeIndex].isEmpty(); } - - Deque& swapBuffers() { - int oldIndex = m_activeIndex; - m_activeIndex ^= 1; - ASSERT(m_queue[m_activeIndex].isEmpty()); - return m_queue[oldIndex]; - } - - private: - Deque m_queue[2]; - int m_activeIndex; -}; - -} // namespace WTF - -using WTF::DoubleBufferedDeque; - -#endif // SKY_ENGINE_WTF_DOUBLEBUFFEREDDEQUE_H_ diff --git a/sky/engine/wtf/DoubleBufferedDequeTest.cpp b/sky/engine/wtf/DoubleBufferedDequeTest.cpp deleted file mode 100644 index 9aeb1ba02e740..0000000000000 --- a/sky/engine/wtf/DoubleBufferedDequeTest.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/wtf/DoubleBufferedDeque.h" - -#include - -namespace { - -typedef testing::Test DoubleBufferedDequeTest; - -TEST(DoubleBufferedDequeTest, TestIsEmpty) { - DoubleBufferedDeque queue; - - EXPECT_TRUE(queue.isEmpty()); - queue.append(1); - EXPECT_FALSE(queue.isEmpty()); -} - -TEST(DoubleBufferedDequeTest, TestIsEmptyAfterSwapBuffers) { - DoubleBufferedDeque queue; - queue.append(1); - - queue.swapBuffers(); - EXPECT_TRUE(queue.isEmpty()); -} - -TEST(DoubleBufferedDequeTest, TestDoubleBuffering) { - DoubleBufferedDeque queue; - queue.append(1); - queue.append(10); - queue.append(100); - - { - Deque& deque = queue.swapBuffers(); - EXPECT_EQ(1, deque.takeFirst()); - EXPECT_EQ(10, deque.takeFirst()); - EXPECT_EQ(100, deque.takeFirst()); - } - queue.append(2); - - EXPECT_EQ(2, queue.swapBuffers().takeFirst()); - queue.append(3); - - EXPECT_EQ(3, queue.swapBuffers().takeFirst()); -} - -} // namespace diff --git a/sky/engine/wtf/DoublyLinkedList.h b/sky/engine/wtf/DoublyLinkedList.h deleted file mode 100644 index dc830734f940c..0000000000000 --- a/sky/engine/wtf/DoublyLinkedList.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_DOUBLYLINKEDLIST_H_ -#define SKY_ENGINE_WTF_DOUBLYLINKEDLIST_H_ - -namespace WTF { - -// This class allows nodes to share code without dictating data member layout. -template -class DoublyLinkedListNode { - public: - DoublyLinkedListNode(); - - void setPrev(T*); - void setNext(T*); - - T* prev() const; - T* next() const; -}; - -template -inline DoublyLinkedListNode::DoublyLinkedListNode() { - setPrev(0); - setNext(0); -} - -template -inline void DoublyLinkedListNode::setPrev(T* prev) { - static_cast(this)->m_prev = prev; -} - -template -inline void DoublyLinkedListNode::setNext(T* next) { - static_cast(this)->m_next = next; -} - -template -inline T* DoublyLinkedListNode::prev() const { - return static_cast(this)->m_prev; -} - -template -inline T* DoublyLinkedListNode::next() const { - return static_cast(this)->m_next; -} - -template -class DoublyLinkedList { - public: - DoublyLinkedList(); - - bool isEmpty() const; - size_t size() const; // This is O(n). - void clear(); - - T* head() const; - T* removeHead(); - - T* tail() const; - - void push(T*); - void append(T*); - void remove(T*); - - private: - T* m_head; - T* m_tail; -}; - -template -inline DoublyLinkedList::DoublyLinkedList() : m_head(0), m_tail(0) {} - -template -inline bool DoublyLinkedList::isEmpty() const { - return !m_head; -} - -template -inline size_t DoublyLinkedList::size() const { - size_t size = 0; - for (T* node = m_head; node; node = node->next()) - ++size; - return size; -} - -template -inline void DoublyLinkedList::clear() { - m_head = 0; - m_tail = 0; -} - -template -inline T* DoublyLinkedList::head() const { - return m_head; -} - -template -inline T* DoublyLinkedList::tail() const { - return m_tail; -} - -template -inline void DoublyLinkedList::push(T* node) { - if (!m_head) { - ASSERT(!m_tail); - m_head = node; - m_tail = node; - node->setPrev(0); - node->setNext(0); - return; - } - - ASSERT(m_tail); - m_head->setPrev(node); - node->setNext(m_head); - node->setPrev(0); - m_head = node; -} - -template -inline void DoublyLinkedList::append(T* node) { - if (!m_tail) { - ASSERT(!m_head); - m_head = node; - m_tail = node; - node->setPrev(0); - node->setNext(0); - return; - } - - ASSERT(m_head); - m_tail->setNext(node); - node->setPrev(m_tail); - node->setNext(0); - m_tail = node; -} - -template -inline void DoublyLinkedList::remove(T* node) { - if (node->prev()) { - ASSERT(node != m_head); - node->prev()->setNext(node->next()); - } else { - ASSERT(node == m_head); - m_head = node->next(); - } - - if (node->next()) { - ASSERT(node != m_tail); - node->next()->setPrev(node->prev()); - } else { - ASSERT(node == m_tail); - m_tail = node->prev(); - } -} - -template -inline T* DoublyLinkedList::removeHead() { - T* node = head(); - if (node) - remove(node); - return node; -} - -} // namespace WTF - -using WTF::DoublyLinkedList; -using WTF::DoublyLinkedListNode; - -#endif // SKY_ENGINE_WTF_DOUBLYLINKEDLIST_H_ diff --git a/sky/engine/wtf/DynamicAnnotations.cpp b/sky/engine/wtf/DynamicAnnotations.cpp deleted file mode 100644 index 76b5439b04df0..0000000000000 --- a/sky/engine/wtf/DynamicAnnotations.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/DynamicAnnotations.h" - -#if USE(DYNAMIC_ANNOTATIONS) && !USE(DYNAMIC_ANNOTATIONS_NOIMPL) - -// Identical code folding(-Wl,--icf=all) countermeasures. -// This makes all Annotate* functions different, which prevents the linker from -// folding them. -#ifdef __COUNTER__ -#define DYNAMIC_ANNOTATIONS_IMPL \ - volatile short lineno = (__LINE__ << 8) + __COUNTER__; \ - (void)lineno; -#else -#define DYNAMIC_ANNOTATIONS_IMPL \ - volatile short lineno = (__LINE__ << 8); \ - (void)lineno; -#endif - -void WTFAnnotateBenignRaceSized(const char*, - int, - const volatile void*, - long, - const char*) { - DYNAMIC_ANNOTATIONS_IMPL -} - -void WTFAnnotateHappensBefore(const char*, int, const volatile void*) { - DYNAMIC_ANNOTATIONS_IMPL -} - -void WTFAnnotateHappensAfter(const char*, int, const volatile void*) { - DYNAMIC_ANNOTATIONS_IMPL -} - -#endif // USE(DYNAMIC_ANNOTATIONS) && !USE(DYNAMIC_ANNOTATIONS_NOIMPL) diff --git a/sky/engine/wtf/DynamicAnnotations.h b/sky/engine/wtf/DynamicAnnotations.h deleted file mode 100644 index 8913dc8d89ce4..0000000000000 --- a/sky/engine/wtf/DynamicAnnotations.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_DYNAMICANNOTATIONS_H_ -#define SKY_ENGINE_WTF_DYNAMICANNOTATIONS_H_ - -/* This file defines dynamic annotations for use with dynamic analysis - * tool such as ThreadSanitizer, Valgrind, etc. - * - * Dynamic annotation is a source code annotation that affects - * the generated code (that is, the annotation is not a comment). - * Each such annotation is attached to a particular - * instruction and/or to a particular object (address) in the program. - * - * By using dynamic annotations a developer can give more details to the dynamic - * analysis tool to improve its precision. - * - * In C/C++ program the annotations are represented as C macros. - * With the default build flags, these macros are empty, hence don't affect - * performance of a compiled binary. - * If dynamic annotations are enabled, they just call no-op functions. - * The dynamic analysis tools can intercept these functions and replace them - * with their own implementations. - * - * See http://code.google.com/p/data-race-test/wiki/DynamicAnnotations for more - * information. - */ - -#include "flutter/sky/engine/wtf/OperatingSystem.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -#if USE(DYNAMIC_ANNOTATIONS) -/* Tell data race detector that we're not interested in reports on the given - * address range. */ -#define WTF_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \ - WTFAnnotateBenignRaceSized(__FILE__, __LINE__, address, size, description) -#define WTF_ANNOTATE_BENIGN_RACE(pointer, description) \ - WTFAnnotateBenignRaceSized(__FILE__, __LINE__, pointer, sizeof(*(pointer)), \ - description) - -/* Annotations for user-defined synchronization mechanisms. - * These annotations can be used to define happens-before arcs in user-defined - * synchronization mechanisms: the race detector will infer an arc from - * the former to the latter when they share the same argument pointer. - * - * The most common case requiring annotations is atomic reference counting: - * bool deref() { - * ANNOTATE_HAPPENS_BEFORE(&m_refCount); - * if (!atomicDecrement(&m_refCount)) { - * // m_refCount is now 0 - * ANNOTATE_HAPPENS_AFTER(&m_refCount); - * // "return true; happens-after each atomicDecrement of m_refCount" - * return true; - * } - * return false; - * } - */ -#define WTF_ANNOTATE_HAPPENS_BEFORE(address) \ - WTFAnnotateHappensBefore(__FILE__, __LINE__, address) -#define WTF_ANNOTATE_HAPPENS_AFTER(address) \ - WTFAnnotateHappensAfter(__FILE__, __LINE__, address) - -#ifdef __cplusplus -extern "C" { -#endif -/* Don't use these directly, use the above macros instead. */ -WTF_EXPORT void WTFAnnotateBenignRaceSized(const char* file, - int line, - const volatile void* memory, - long size, - const char* description); -WTF_EXPORT void WTFAnnotateHappensBefore(const char* file, - int line, - const volatile void* address); -WTF_EXPORT void WTFAnnotateHappensAfter(const char* file, - int line, - const volatile void* address); -#ifdef __cplusplus -} // extern "C" -#endif - -#else // USE(DYNAMIC_ANNOTATIONS) -/* These macros are empty when dynamic annotations are not enabled so you can - * use them without affecting the performance of release binaries. */ -#define WTF_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) -#define WTF_ANNOTATE_BENIGN_RACE(pointer, description) -#define WTF_ANNOTATE_HAPPENS_BEFORE(address) -#define WTF_ANNOTATE_HAPPENS_AFTER(address) -#endif // USE(DYNAMIC_ANNOTATIONS) - -#endif // SKY_ENGINE_WTF_DYNAMICANNOTATIONS_H_ diff --git a/sky/engine/wtf/EnumClass.h b/sky/engine/wtf/EnumClass.h deleted file mode 100644 index c36ca5108d2ed..0000000000000 --- a/sky/engine/wtf/EnumClass.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2013 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_ENUMCLASS_H_ -#define SKY_ENGINE_WTF_ENUMCLASS_H_ - -#include "flutter/sky/engine/wtf/Compiler.h" - -namespace WTF { - -// How to define a type safe enum list using the ENUM_CLASS macros? -// =============================================================== -// To get an enum list like this: -// -// enum class MyEnums { -// Value1, -// Value2, -// ... -// ValueN -// }; -// -// ... write this: -// -// ENUM_CLASS(MyEnums) { -// Value1, -// Value2, -// ... -// ValueN -// } ENUM_CLASS_END(MyEnums); -// -// The ENUM_CLASS macros will use C++11's enum class if the compiler supports -// it. Otherwise, it will use the EnumClass template below. - -#define ENUM_CLASS(__enumName) enum class __enumName - -#define ENUM_CLASS_END(__enumName) - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_ENUMCLASS_H_ diff --git a/sky/engine/wtf/FastAllocBase.h b/sky/engine/wtf/FastAllocBase.h deleted file mode 100644 index cadcffa1558ea..0000000000000 --- a/sky/engine/wtf/FastAllocBase.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2008, 2009 Paul Pedriana . - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_FASTALLOCBASE_H_ -#define SKY_ENGINE_WTF_FASTALLOCBASE_H_ - -// Provides customizable overrides of fastMalloc/fastFree and operator -// new/delete -// -// Provided functionality: -// Macro: WTF_MAKE_FAST_ALLOCATED -// -// Example usage: -// class Widget { -// WTF_MAKE_FAST_ALLOCATED -// ... -// }; -// -// struct Data { -// WTF_MAKE_FAST_ALLOCATED -// public: -// ... -// }; -// - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/FastMalloc.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" - -#define WTF_MAKE_FAST_ALLOCATED \ - public: \ - void* operator new(size_t, void* p) { return p; } \ - void* operator new[](size_t, void* p) { return p; } \ - \ - void* operator new(size_t size) { return ::WTF::fastMalloc(size); } \ - \ - void operator delete(void* p) { ::WTF::fastFree(p); } \ - \ - void* operator new[](size_t size) { return ::WTF::fastMalloc(size); } \ - \ - void operator delete[](void* p) { ::WTF::fastFree(p); } \ - void* operator new(size_t, NotNullTag, void* location) { \ - ASSERT(location); \ - return location; \ - } \ - \ - private: \ - typedef int __thisIsHereToForceASemicolonAfterThisMacro - -#endif // SKY_ENGINE_WTF_FASTALLOCBASE_H_ diff --git a/sky/engine/wtf/FastMalloc.cpp b/sky/engine/wtf/FastMalloc.cpp deleted file mode 100644 index 71b582c3c8811..0000000000000 --- a/sky/engine/wtf/FastMalloc.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2005, 2007, Google Inc. -// All rights reserved. -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "flutter/sky/engine/wtf/FastMalloc.h" - -#include -#include "flutter/sky/engine/wtf/PartitionAlloc.h" -#include "flutter/sky/engine/wtf/SpinLock.h" - -namespace WTF { - -static PartitionAllocatorGeneric gPartition; -static int gLock = 0; -static bool gInitialized = false; - -void* fastZeroedMalloc(size_t n) { - void* result = fastMalloc(n); - memset(result, 0, n); - return result; -} - -char* fastStrDup(const char* src) { - size_t len = strlen(src) + 1; - char* dup = static_cast(fastMalloc(len)); - memcpy(dup, src, len); - return dup; -} - -void fastMallocShutdown() { - gPartition.shutdown(); -} - -void* fastMalloc(size_t n) { - if (UNLIKELY(!gInitialized)) { - spinLockLock(&gLock); - if (!gInitialized) { - gInitialized = true; - gPartition.init(); - } - spinLockUnlock(&gLock); - } - return partitionAllocGeneric(gPartition.root(), n); -} - -void fastFree(void* p) { - partitionFreeGeneric(gPartition.root(), p); -} - -void* fastRealloc(void* p, size_t n) { - return partitionReallocGeneric(gPartition.root(), p, n); -} - -} // namespace WTF diff --git a/sky/engine/wtf/FastMalloc.h b/sky/engine/wtf/FastMalloc.h deleted file mode 100644 index 7574553aade0a..0000000000000 --- a/sky/engine/wtf/FastMalloc.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_FASTMALLOC_H_ -#define SKY_ENGINE_WTF_FASTMALLOC_H_ - -#include - -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -// Initialization is implicit on first use. -WTF_EXPORT void fastMallocShutdown(); - -// These functions crash safely if an allocation fails. -WTF_EXPORT void* fastMalloc(size_t); -WTF_EXPORT void* fastZeroedMalloc(size_t); -WTF_EXPORT void* fastRealloc(void*, size_t); -WTF_EXPORT char* fastStrDup(const char*); - -WTF_EXPORT void fastFree(void*); - -} // namespace WTF - -using WTF::fastFree; -using WTF::fastMalloc; -using WTF::fastRealloc; -using WTF::fastStrDup; -using WTF::fastZeroedMalloc; - -#endif // SKY_ENGINE_WTF_FASTMALLOC_H_ diff --git a/sky/engine/wtf/FilePrintStream.cpp b/sky/engine/wtf/FilePrintStream.cpp deleted file mode 100644 index 0b0ee6102d955..0000000000000 --- a/sky/engine/wtf/FilePrintStream.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/FilePrintStream.h" - -namespace WTF { - -FilePrintStream::FilePrintStream(FILE* file, AdoptionMode adoptionMode) - : m_file(file), m_adoptionMode(adoptionMode) {} - -FilePrintStream::~FilePrintStream() { - if (m_adoptionMode == Borrow) - return; - fclose(m_file); -} - -PassOwnPtr FilePrintStream::open(const char* filename, - const char* mode) { - FILE* file = fopen(filename, mode); - if (!file) - return PassOwnPtr(); - - return adoptPtr(new FilePrintStream(file)); -} - -void FilePrintStream::vprintf(const char* format, va_list argList) { - vfprintf(m_file, format, argList); -} - -void FilePrintStream::flush() { - fflush(m_file); -} - -} // namespace WTF diff --git a/sky/engine/wtf/FilePrintStream.h b/sky/engine/wtf/FilePrintStream.h deleted file mode 100644 index 5d26469e197ba..0000000000000 --- a/sky/engine/wtf/FilePrintStream.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_FILEPRINTSTREAM_H_ -#define SKY_ENGINE_WTF_FILEPRINTSTREAM_H_ - -#include -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/PrintStream.h" - -namespace WTF { - -class WTF_EXPORT FilePrintStream final : public PrintStream { - public: - enum AdoptionMode { Adopt, Borrow }; - - FilePrintStream(FILE*, AdoptionMode = Adopt); - virtual ~FilePrintStream(); - - static PassOwnPtr open(const char* filename, - const char* mode); - - FILE* file() { return m_file; } - - virtual void vprintf(const char* format, va_list) override - WTF_ATTRIBUTE_PRINTF(2, 0); - virtual void flush() override; - - private: - FILE* m_file; - AdoptionMode m_adoptionMode; -}; - -} // namespace WTF - -using WTF::FilePrintStream; - -#endif // SKY_ENGINE_WTF_FILEPRINTSTREAM_H_ diff --git a/sky/engine/wtf/Forward.h b/sky/engine/wtf/Forward.h deleted file mode 100644 index 38eb2805f83b0..0000000000000 --- a/sky/engine/wtf/Forward.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2006, 2009, 2011 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_FORWARD_H_ -#define SKY_ENGINE_WTF_FORWARD_H_ - -#include - -namespace WTF { -template -class Function; -template -class OwnPtr; -template -class PassOwnPtr; -template -class PassRefPtr; -template -class RefPtr; -template -class Vector; - -class AtomicString; -class CString; -template -class SizeSpecificPartitionAllocator; -class String; -template -class StringBuffer; -class StringBuilder; -class StringImpl; -} // namespace WTF - -using WTF::Function; -using WTF::OwnPtr; -using WTF::PassOwnPtr; -using WTF::PassRefPtr; -using WTF::RefPtr; -using WTF::Vector; - -using WTF::AtomicString; -using WTF::CString; -using WTF::String; -using WTF::StringBuffer; -using WTF::StringBuilder; -using WTF::StringImpl; - -#endif // SKY_ENGINE_WTF_FORWARD_H_ diff --git a/sky/engine/wtf/GetPtr.h b/sky/engine/wtf/GetPtr.h deleted file mode 100644 index 72f323380b0c2..0000000000000 --- a/sky/engine/wtf/GetPtr.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_GETPTR_H_ -#define SKY_ENGINE_WTF_GETPTR_H_ - -namespace WTF { - -template -inline T* getPtr(T* p) { - return p; -} - -template -inline T* getPtr(T& p) { - return &p; -} - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_GETPTR_H_ diff --git a/sky/engine/wtf/HashCountedSet.h b/sky/engine/wtf/HashCountedSet.h deleted file mode 100644 index 0272523bc9ea7..0000000000000 --- a/sky/engine/wtf/HashCountedSet.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_HASHCOUNTEDSET_H_ -#define SKY_ENGINE_WTF_HASHCOUNTEDSET_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace WTF { - -// An unordered hash set that keeps track of how many times you added an -// item to the set. The iterators have fields ->key and ->value that return -// the set members and their counts, respectively. -template ::Hash, - typename Traits = HashTraits, - typename Allocator = DefaultAllocator> -class HashCountedSet { - WTF_USE_ALLOCATOR(HashCountedSet, Allocator); - - private: - typedef HashMap, - Allocator> - ImplType; - - public: - typedef Value ValueType; - typedef typename ImplType::iterator iterator; - typedef typename ImplType::const_iterator const_iterator; - typedef typename ImplType::AddResult AddResult; - - HashCountedSet() {} - - void swap(HashCountedSet& other) { m_impl.swap(other.m_impl); } - - unsigned size() const { return m_impl.size(); } - unsigned capacity() const { return m_impl.capacity(); } - bool isEmpty() const { return m_impl.isEmpty(); } - - // Iterators iterate over pairs of values (called key) and counts (called - // value). - iterator begin() { return m_impl.begin(); } - iterator end() { return m_impl.end(); } - const_iterator begin() const { return m_impl.begin(); } - const_iterator end() const { return m_impl.end(); } - - iterator find(const ValueType& value) { return m_impl.find(value); } - const_iterator find(const ValueType& value) const { - return m_impl.find(value); - } - bool contains(const ValueType& value) const { return m_impl.contains(value); } - unsigned count(const ValueType& value) const { return m_impl.get(value); } - - // Increases the count if an equal value is already present - // the return value is a pair of an iterator to the new value's - // location, and a bool that is true if an new entry was added. - AddResult add(const ValueType&); - - // Reduces the count of the value, and removes it if count - // goes down to zero, returns true if the value is removed. - bool remove(const ValueType& value) { return remove(find(value)); } - bool remove(iterator); - - // Removes the value, regardless of its count. - void removeAll(const ValueType& value) { removeAll(find(value)); } - void removeAll(iterator); - - // Clears the whole set. - void clear() { m_impl.clear(); } - - private: - ImplType m_impl; -}; - -template -inline typename HashCountedSet::AddResult -HashCountedSet::add(const ValueType& value) { - AddResult result = m_impl.add(value, 0); - ++result.storedValue->value; - return result; -} - -template -inline bool HashCountedSet::remove(iterator it) { - if (it == end()) - return false; - - unsigned oldVal = it->value; - ASSERT(oldVal); - unsigned newVal = oldVal - 1; - if (newVal) { - it->value = newVal; - return false; - } - - m_impl.remove(it); - return true; -} - -template -inline void HashCountedSet::removeAll(iterator it) { - if (it == end()) - return; - - m_impl.remove(it); -} - -template -inline void copyToVector(const HashCountedSet& collection, - VectorType& vector) { - typedef typename HashCountedSet::const_iterator iterator; - - vector.resize(collection.size()); - - iterator it = collection.begin(); - iterator end = collection.end(); - for (unsigned i = 0; it != end; ++it, ++i) - vector[i] = *it; -} - -template -inline void copyToVector( - const HashCountedSet& collection, - Vector& vector) { - typedef typename HashCountedSet::const_iterator iterator; - - vector.resize(collection.size()); - - iterator it = collection.begin(); - iterator end = collection.end(); - for (unsigned i = 0; it != end; ++it, ++i) - vector[i] = (*it).key; -} - -} // namespace WTF - -using WTF::HashCountedSet; - -#endif // SKY_ENGINE_WTF_HASHCOUNTEDSET_H_ diff --git a/sky/engine/wtf/HashFunctions.h b/sky/engine/wtf/HashFunctions.h deleted file mode 100644 index 054bf7614ac29..0000000000000 --- a/sky/engine/wtf/HashFunctions.h +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_HASHFUNCTIONS_H_ -#define SKY_ENGINE_WTF_HASHFUNCTIONS_H_ - -#include -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" - -namespace WTF { - -template -struct IntTypes; -template <> -struct IntTypes<1> { - typedef int8_t SignedType; - typedef uint8_t UnsignedType; -}; -template <> -struct IntTypes<2> { - typedef int16_t SignedType; - typedef uint16_t UnsignedType; -}; -template <> -struct IntTypes<4> { - typedef int32_t SignedType; - typedef uint32_t UnsignedType; -}; -template <> -struct IntTypes<8> { - typedef int64_t SignedType; - typedef uint64_t UnsignedType; -}; - -// integer hash function - -// Thomas Wang's 32 Bit Mix Function: -// http://www.cris.com/~Ttwang/tech/inthash.htm -inline unsigned intHash(uint8_t key8) { - unsigned key = key8; - key += ~(key << 15); - key ^= (key >> 10); - key += (key << 3); - key ^= (key >> 6); - key += ~(key << 11); - key ^= (key >> 16); - return key; -} - -// Thomas Wang's 32 Bit Mix Function: -// http://www.cris.com/~Ttwang/tech/inthash.htm -inline unsigned intHash(uint16_t key16) { - unsigned key = key16; - key += ~(key << 15); - key ^= (key >> 10); - key += (key << 3); - key ^= (key >> 6); - key += ~(key << 11); - key ^= (key >> 16); - return key; -} - -// Thomas Wang's 32 Bit Mix Function: -// http://www.cris.com/~Ttwang/tech/inthash.htm -inline unsigned intHash(uint32_t key) { - key += ~(key << 15); - key ^= (key >> 10); - key += (key << 3); - key ^= (key >> 6); - key += ~(key << 11); - key ^= (key >> 16); - return key; -} - -// Thomas Wang's 64 bit Mix Function: -// http://www.cris.com/~Ttwang/tech/inthash.htm -inline unsigned intHash(uint64_t key) { - key += ~(key << 32); - key ^= (key >> 22); - key += ~(key << 13); - key ^= (key >> 8); - key += (key << 3); - key ^= (key >> 15); - key += ~(key << 27); - key ^= (key >> 31); - return static_cast(key); -} - -// Compound integer hash method: -// http://opendatastructures.org/versions/edition-0.1d/ods-java/node33.html#SECTION00832000000000000000 -inline unsigned pairIntHash(unsigned key1, unsigned key2) { - unsigned shortRandom1 = 277951225; // A random 32-bit value. - unsigned shortRandom2 = 95187966; // A random 32-bit value. - uint64_t longRandom = 19248658165952622LL; // A random 64-bit value. - - uint64_t product = longRandom * (shortRandom1 * key1 + shortRandom2 * key2); - unsigned highBits = - static_cast(product >> (sizeof(uint64_t) - sizeof(unsigned))); - return highBits; -} - -template -struct IntHash { - static unsigned hash(T key) { - return intHash( - static_cast::UnsignedType>(key)); - } - static bool equal(T a, T b) { return a == b; } - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -template -struct FloatHash { - typedef typename IntTypes::UnsignedType Bits; - static unsigned hash(T key) { return intHash(bitwise_cast(key)); } - static bool equal(T a, T b) { - return bitwise_cast(a) == bitwise_cast(b); - } - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -// pointer identity hash function - -template -struct PtrHash { - static unsigned hash(T key) { - return IntHash::hash(reinterpret_cast(key)); - } - static bool equal(T a, T b) { return a == b; } - static bool equal(std::nullptr_t, T b) { return b == 0; } - static bool equal(T a, std::nullptr_t) { return a == 0; } - static const bool safeToCompareToEmptyOrDeleted = true; -}; -template -struct PtrHash> : PtrHash { - using PtrHash::hash; - static unsigned hash(const RefPtr

& key) { return hash(key.get()); } - static unsigned hash(const PassRefPtr

& key) { return hash(key.get()); } - using PtrHash::equal; - static bool equal(const RefPtr

& a, const RefPtr

& b) { return a == b; } - static bool equal(P* a, const RefPtr

& b) { return a == b; } - static bool equal(const RefPtr

& a, P* b) { return a == b; } - static bool equal(const RefPtr

& a, const PassRefPtr

& b) { - return a == b; - } -}; -template -struct PtrHash> : PtrHash { - using PtrHash::hash; - static unsigned hash(const RawPtr

& key) { return hash(key.get()); } - using PtrHash::equal; - static bool equal(const RawPtr

& a, const RawPtr

& b) { return a == b; } - static bool equal(P* a, const RawPtr

& b) { return a == b; } - static bool equal(const RawPtr

& a, P* b) { return a == b; } -}; -template -struct PtrHash> : PtrHash { - using PtrHash::hash; - static unsigned hash(const OwnPtr

& key) { return hash(key.get()); } - static unsigned hash(const PassOwnPtr

& key) { return hash(key.get()); } - - static bool equal(const OwnPtr

& a, const OwnPtr

& b) { - return a.get() == b.get(); - } - static bool equal(const OwnPtr

& a, P* b) { return a == b; } - static bool equal(const OwnPtr

& a, const PassOwnPtr

& b) { - return a.get() == b.get(); - } -}; - -// default hash function for each type - -template -struct DefaultHash; - -template -struct PairHash { - static unsigned hash(const std::pair& p) { - return pairIntHash(DefaultHash::Hash::hash(p.first), - DefaultHash::Hash::hash(p.second)); - } - static bool equal(const std::pair& a, const std::pair& b) { - return DefaultHash::Hash::equal(a.first, b.first) && - DefaultHash::Hash::equal(a.second, b.second); - } - static const bool safeToCompareToEmptyOrDeleted = - DefaultHash::Hash::safeToCompareToEmptyOrDeleted && - DefaultHash::Hash::safeToCompareToEmptyOrDeleted; -}; - -template -struct IntPairHash { - static unsigned hash(const std::pair& p) { - return pairIntHash(p.first, p.second); - } - static bool equal(const std::pair& a, const std::pair& b) { - return PairHash::equal(a, b); - } - static const bool safeToCompareToEmptyOrDeleted = - PairHash::safeToCompareToEmptyOrDeleted; -}; - -// make IntHash the default hash function for many integer types - -template <> -struct DefaultHash { - typedef IntHash Hash; -}; -template <> -struct DefaultHash { - typedef IntHash Hash; -}; -template <> -struct DefaultHash { - typedef IntHash Hash; -}; -template <> -struct DefaultHash { - typedef IntHash Hash; -}; -template <> -struct DefaultHash { - typedef IntHash Hash; -}; -template <> -struct DefaultHash { - typedef IntHash Hash; -}; -template <> -struct DefaultHash { - typedef IntHash Hash; -}; -template <> -struct DefaultHash { - typedef IntHash Hash; -}; -template <> -struct DefaultHash { - typedef IntHash Hash; -}; -template <> -struct DefaultHash { - typedef FloatHash Hash; -}; -template <> -struct DefaultHash { - typedef FloatHash Hash; -}; - -// make PtrHash the default hash function for pointer types that don't -// specialize - -template -struct DefaultHash { - typedef PtrHash Hash; -}; -template -struct DefaultHash> { - typedef PtrHash> Hash; -}; -template -struct DefaultHash> { - typedef PtrHash> Hash; -}; -template -struct DefaultHash> { - typedef PtrHash> Hash; -}; - -// make IntPairHash the default hash function for pairs of (at most) 32-bit -// integers. - -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; -template <> -struct DefaultHash> { - typedef IntPairHash Hash; -}; - -// make PairHash the default hash function for pairs of arbitrary values. - -template -struct DefaultHash> { - typedef PairHash Hash; -}; - -} // namespace WTF - -using WTF::DefaultHash; -using WTF::IntHash; -using WTF::PtrHash; - -#endif // SKY_ENGINE_WTF_HASHFUNCTIONS_H_ diff --git a/sky/engine/wtf/HashIterators.h b/sky/engine/wtf/HashIterators.h deleted file mode 100644 index a6f4f9cf6bb34..0000000000000 --- a/sky/engine/wtf/HashIterators.h +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_HASHITERATORS_H_ -#define SKY_ENGINE_WTF_HASHITERATORS_H_ - -namespace WTF { - -template -struct HashTableConstKeysIterator; -template -struct HashTableConstValuesIterator; -template -struct HashTableKeysIterator; -template -struct HashTableValuesIterator; - -template -struct HashTableConstIteratorAdapter> { - private: - typedef KeyValuePair ValueType; - - public: - typedef HashTableConstKeysIterator Keys; - typedef HashTableConstValuesIterator - Values; - - HashTableConstIteratorAdapter() {} - HashTableConstIteratorAdapter( - const typename HashTableType::const_iterator& impl) - : m_impl(impl) {} - - const ValueType* get() const { return (const ValueType*)m_impl.get(); } - const ValueType& operator*() const { return *get(); } - const ValueType* operator->() const { return get(); } - - HashTableConstIteratorAdapter& operator++() { - ++m_impl; - return *this; - } - // postfix ++ intentionally omitted - - Keys keys() { return Keys(*this); } - Values values() { return Values(*this); } - - typename HashTableType::const_iterator m_impl; -}; - -template -struct HashTableIteratorAdapter> { - private: - typedef KeyValuePair ValueType; - - public: - typedef HashTableKeysIterator Keys; - typedef HashTableValuesIterator Values; - - HashTableIteratorAdapter() {} - HashTableIteratorAdapter(const typename HashTableType::iterator& impl) - : m_impl(impl) {} - - ValueType* get() const { return (ValueType*)m_impl.get(); } - ValueType& operator*() const { return *get(); } - ValueType* operator->() const { return get(); } - - HashTableIteratorAdapter& operator++() { - ++m_impl; - return *this; - } - // postfix ++ intentionally omitted - - operator HashTableConstIteratorAdapter() { - typename HashTableType::const_iterator i = m_impl; - return i; - } - - Keys keys() { return Keys(*this); } - Values values() { return Values(*this); } - - typename HashTableType::iterator m_impl; -}; - -template -struct HashTableConstKeysIterator { - private: - typedef HashTableConstIteratorAdapter> - ConstIterator; - - public: - HashTableConstKeysIterator(const ConstIterator& impl) : m_impl(impl) {} - - const KeyType* get() const { return &(m_impl.get()->key); } - const KeyType& operator*() const { return *get(); } - const KeyType* operator->() const { return get(); } - - HashTableConstKeysIterator& operator++() { - ++m_impl; - return *this; - } - // postfix ++ intentionally omitted - - ConstIterator m_impl; -}; - -template -struct HashTableConstValuesIterator { - private: - typedef HashTableConstIteratorAdapter> - ConstIterator; - - public: - HashTableConstValuesIterator(const ConstIterator& impl) : m_impl(impl) {} - - const MappedType* get() const { return &(m_impl.get()->value); } - const MappedType& operator*() const { return *get(); } - const MappedType* operator->() const { return get(); } - - HashTableConstValuesIterator& operator++() { - ++m_impl; - return *this; - } - // postfix ++ intentionally omitted - - ConstIterator m_impl; -}; - -template -struct HashTableKeysIterator { - private: - typedef HashTableIteratorAdapter> - Iterator; - typedef HashTableConstIteratorAdapter> - ConstIterator; - - public: - HashTableKeysIterator(const Iterator& impl) : m_impl(impl) {} - - KeyType* get() const { return &(m_impl.get()->key); } - KeyType& operator*() const { return *get(); } - KeyType* operator->() const { return get(); } - - HashTableKeysIterator& operator++() { - ++m_impl; - return *this; - } - // postfix ++ intentionally omitted - - operator HashTableConstKeysIterator() { - ConstIterator i = m_impl; - return i; - } - - Iterator m_impl; -}; - -template -struct HashTableValuesIterator { - private: - typedef HashTableIteratorAdapter> - Iterator; - typedef HashTableConstIteratorAdapter> - ConstIterator; - - public: - HashTableValuesIterator(const Iterator& impl) : m_impl(impl) {} - - MappedType* get() const { return &(m_impl.get()->value); } - MappedType& operator*() const { return *get(); } - MappedType* operator->() const { return get(); } - - HashTableValuesIterator& operator++() { - ++m_impl; - return *this; - } - // postfix ++ intentionally omitted - - operator HashTableConstValuesIterator() { - ConstIterator i = m_impl; - return i; - } - - Iterator m_impl; -}; - -template -inline bool operator==(const HashTableConstKeysIterator& a, - const HashTableConstKeysIterator& b) { - return a.m_impl == b.m_impl; -} - -template -inline bool operator!=(const HashTableConstKeysIterator& a, - const HashTableConstKeysIterator& b) { - return a.m_impl != b.m_impl; -} - -template -inline bool operator==(const HashTableConstValuesIterator& a, - const HashTableConstValuesIterator& b) { - return a.m_impl == b.m_impl; -} - -template -inline bool operator!=(const HashTableConstValuesIterator& a, - const HashTableConstValuesIterator& b) { - return a.m_impl != b.m_impl; -} - -template -inline bool operator==(const HashTableKeysIterator& a, - const HashTableKeysIterator& b) { - return a.m_impl == b.m_impl; -} - -template -inline bool operator!=(const HashTableKeysIterator& a, - const HashTableKeysIterator& b) { - return a.m_impl != b.m_impl; -} - -template -inline bool operator==(const HashTableValuesIterator& a, - const HashTableValuesIterator& b) { - return a.m_impl == b.m_impl; -} - -template -inline bool operator!=(const HashTableValuesIterator& a, - const HashTableValuesIterator& b) { - return a.m_impl != b.m_impl; -} - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_HASHITERATORS_H_ diff --git a/sky/engine/wtf/HashMap.h b/sky/engine/wtf/HashMap.h deleted file mode 100644 index f440406474084..0000000000000 --- a/sky/engine/wtf/HashMap.h +++ /dev/null @@ -1,687 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_HASHMAP_H_ -#define SKY_ENGINE_WTF_HASHMAP_H_ - -#include "flutter/sky/engine/wtf/DefaultAllocator.h" -#include "flutter/sky/engine/wtf/HashTable.h" - -namespace WTF { - -template -struct HashMapValueTraits; - -template -struct ReferenceTypeMaker { - typedef T& ReferenceType; -}; -template -struct ReferenceTypeMaker { - typedef T& ReferenceType; -}; - -struct KeyValuePairKeyExtractor { - template - static const typename T::KeyType& extract(const T& p) { - return p.key; - } -}; - -// Note: empty or deleted key values are not allowed, using them may lead to -// undefined behavior. For pointer keys this means that null pointers are not -// allowed unless you supply custom key traits. -template ::Hash, - typename KeyTraitsArg = HashTraits, - typename MappedTraitsArg = HashTraits, - typename Allocator = DefaultAllocator> -class HashMap { - WTF_USE_ALLOCATOR(HashMap, Allocator); - - private: - typedef KeyTraitsArg KeyTraits; - typedef MappedTraitsArg MappedTraits; - typedef HashMapValueTraits ValueTraits; - - public: - typedef typename KeyTraits::TraitType KeyType; - typedef typename KeyTraits::PassInType KeyPassInType; - typedef const typename KeyTraits::PeekInType& KeyPeekInType; - typedef typename MappedTraits::TraitType MappedType; - typedef typename ValueTraits::TraitType ValueType; - - private: - typedef typename MappedTraits::PassInType MappedPassInType; - typedef typename MappedTraits::PassOutType MappedPassOutType; - typedef typename MappedTraits::PeekOutType MappedPeekType; - - typedef typename ReferenceTypeMaker::ReferenceType - MappedPassInReferenceType; - - typedef HashArg HashFunctions; - - typedef HashTable - HashTableType; - - class HashMapKeysProxy; - class HashMapValuesProxy; - - public: - typedef HashTableIteratorAdapter iterator; - typedef HashTableConstIteratorAdapter - const_iterator; - typedef typename HashTableType::AddResult AddResult; - - public: - void swap(HashMap& ref) { m_impl.swap(ref.m_impl); } - - void swap(typename Allocator::template OtherType::Type other) { - HashMap& ref = Allocator::getOther(other); - m_impl.swap(ref.m_impl); - } - - unsigned size() const; - unsigned capacity() const; - bool isEmpty() const; - - // iterators iterate over pairs of keys and values - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - - HashMapKeysProxy& keys() { return static_cast(*this); } - const HashMapKeysProxy& keys() const { - return static_cast(*this); - } - - HashMapValuesProxy& values() { - return static_cast(*this); - } - const HashMapValuesProxy& values() const { - return static_cast(*this); - } - - iterator find(KeyPeekInType); - const_iterator find(KeyPeekInType) const; - bool contains(KeyPeekInType) const; - MappedPeekType get(KeyPeekInType) const; - - // replaces value but not key if key is already present - // return value is a pair of the iterator to the key location, - // and a boolean that's true if a new value was actually added - AddResult set(KeyPassInType, MappedPassInType); - - // does nothing if key is already present - // return value is a pair of the iterator to the key location, - // and a boolean that's true if a new value was actually added - AddResult add(KeyPassInType, MappedPassInType); - - void remove(KeyPeekInType); - void remove(iterator); - void clear(); - template - void removeAll(const Collection& toBeRemoved) { - WTF::removeAll(*this, toBeRemoved); - } - - MappedPassOutType take( - KeyPeekInType); // efficient combination of get with remove - - // An alternate version of find() that finds the object by hashing and - // comparing with some other type, to avoid the cost of type conversion. - // HashTranslator must have the following function members: - // static unsigned hash(const T&); - // static bool equal(const ValueType&, const T&); - template - iterator find(const T&); - template - const_iterator find(const T&) const; - template - bool contains(const T&) const; - - // An alternate version of add() that finds the object by hashing and - // comparing with some other type, to avoid the cost of type conversion if the - // object is already in the table. HashTranslator must have the following - // function members: - // static unsigned hash(const T&); - // static bool equal(const ValueType&, const T&); - // static translate(ValueType&, const T&, unsigned hashCode); - template - AddResult add(const T&, MappedPassInType); - - static bool isValidKey(KeyPeekInType); - - private: - AddResult inlineAdd(KeyPassInType, MappedPassInReferenceType); - - HashTableType m_impl; -}; - -template -class HashMap::HashMapKeysProxy : private HashMap { - public: - typedef HashMap - HashMapType; - typedef typename HashMapType::iterator::Keys iterator; - typedef typename HashMapType::const_iterator::Keys const_iterator; - - iterator begin() { return HashMapType::begin().keys(); } - - iterator end() { return HashMapType::end().keys(); } - - const_iterator begin() const { return HashMapType::begin().keys(); } - - const_iterator end() const { return HashMapType::end().keys(); } - - private: - friend class HashMap; - - // These are intentionally not implemented. - HashMapKeysProxy(); - HashMapKeysProxy(const HashMapKeysProxy&); - HashMapKeysProxy& operator=(const HashMapKeysProxy&); - ~HashMapKeysProxy(); -}; - -template -class HashMap::HashMapValuesProxy : private HashMap { - public: - typedef HashMap - HashMapType; - typedef typename HashMapType::iterator::Values iterator; - typedef typename HashMapType::const_iterator::Values const_iterator; - - iterator begin() { return HashMapType::begin().values(); } - - iterator end() { return HashMapType::end().values(); } - - const_iterator begin() const { return HashMapType::begin().values(); } - - const_iterator end() const { return HashMapType::end().values(); } - - private: - friend class HashMap; - - // These are intentionally not implemented. - HashMapValuesProxy(); - HashMapValuesProxy(const HashMapValuesProxy&); - HashMapValuesProxy& operator=(const HashMapValuesProxy&); - ~HashMapValuesProxy(); -}; - -template -struct HashMapValueTraits : KeyValuePairHashTraits { - static const bool hasIsEmptyValueFunction = true; - static bool isEmptyValue( - const typename KeyValuePairHashTraits::TraitType& - value) { - return isHashTraitsEmptyValue(value.key); - } -}; - -template -struct HashMapTranslator { - template - static unsigned hash(const T& key) { - return HashFunctions::hash(key); - } - template - static bool equal(const T& a, const U& b) { - return HashFunctions::equal(a, b); - } - template - static void translate(T& location, const U& key, const V& mapped) { - location.key = key; - ValueTraits::ValueTraits::store(mapped, location.value); - } -}; - -template -struct HashMapTranslatorAdapter { - template - static unsigned hash(const T& key) { - return Translator::hash(key); - } - template - static bool equal(const T& a, const U& b) { - return Translator::equal(a, b); - } - template - static void translate(T& location, - const U& key, - const V& mapped, - unsigned hashCode) { - Translator::translate(location.key, key, hashCode); - ValueTraits::ValueTraits::store(mapped, location.value); - } -}; - -template -inline unsigned HashMap::size() const { - return m_impl.size(); -} - -template -inline unsigned HashMap::capacity() const { - return m_impl.capacity(); -} - -template -inline bool HashMap::isEmpty() const { - return m_impl.isEmpty(); -} - -template -inline typename HashMap::iterator -HashMap::begin() { - return m_impl.begin(); -} - -template -inline typename HashMap::iterator -HashMap::end() { - return m_impl.end(); -} - -template -inline typename HashMap::const_iterator -HashMap::begin() const { - return m_impl.begin(); -} - -template -inline typename HashMap::const_iterator -HashMap::end() const { - return m_impl.end(); -} - -template -inline typename HashMap::iterator -HashMap::find(KeyPeekInType key) { - return m_impl.find(key); -} - -template -inline typename HashMap::const_iterator -HashMap::find(KeyPeekInType key) const { - return m_impl.find(key); -} - -template -inline bool HashMap::contains(KeyPeekInType key) const { - return m_impl.contains(key); -} - -template -template -inline typename HashMap::iterator -HashMap::find(const TYPE& value) { - return m_impl - .template find>( - value); -} - -template -template -inline typename HashMap::const_iterator -HashMap::find(const TYPE& value) const { - return m_impl - .template find>( - value); -} - -template -template -inline bool HashMap::contains(const TYPE& value) const { - return m_impl - .template contains>( - value); -} - -template -typename HashMap::AddResult -HashMap::inlineAdd(KeyPassInType key, - MappedPassInReferenceType mapped) { - return m_impl.template add>( - key, mapped); -} - -template -typename HashMap::AddResult HashMap::set( - KeyPassInType key, - MappedPassInType mapped) { - AddResult result = inlineAdd(key, mapped); - if (!result.isNewEntry) { - // The inlineAdd call above found an existing hash table entry; we need to - // set the mapped value. - MappedTraits::store(mapped, result.storedValue->value); - } - return result; -} - -template -template -typename HashMap::AddResult HashMap::add( - const TYPE& key, - MappedPassInType value) { - return m_impl.template addPassingHashCode< - HashMapTranslatorAdapter>(key, value); -} - -template -typename HashMap::AddResult HashMap::add( - KeyPassInType key, - MappedPassInType mapped) { - return inlineAdd(key, mapped); -} - -template -typename HashMap::MappedPeekType -HashMap::get(KeyPeekInType key) const { - ValueType* entry = const_cast(m_impl).lookup(key); - if (!entry) - return MappedTraits::peek(MappedTraits::emptyValue()); - return MappedTraits::peek(entry->value); -} - -template -inline void HashMap::remove(iterator it) { - m_impl.remove(it.m_impl); -} - -template -inline void HashMap::remove(KeyPeekInType key) { - remove(find(key)); -} - -template -inline void HashMap::clear() { - m_impl.clear(); -} - -template -typename HashMap::MappedPassOutType -HashMap::take(KeyPeekInType key) { - iterator it = find(key); - if (it == end()) - return MappedTraits::passOut(MappedTraits::emptyValue()); - MappedPassOutType result = MappedTraits::passOut(it->value); - remove(it); - return result; -} - -template -inline bool HashMap::isValidKey(KeyPeekInType key) { - if (KeyTraits::isDeletedValue(key)) - return false; - - if (HashFunctions::safeToCompareToEmptyOrDeleted) { - if (key == KeyTraits::emptyValue()) - return false; - } else { - if (isHashTraitsEmptyValue(key)) - return false; - } - - return true; -} - -template -bool operator==(const HashMap& a, - const HashMap& b) { - if (a.size() != b.size()) - return false; - - typedef typename HashMap::const_iterator const_iterator; - - const_iterator aEnd = a.end(); - const_iterator bEnd = b.end(); - for (const_iterator it = a.begin(); it != aEnd; ++it) { - const_iterator bPos = b.find(it->key); - if (bPos == bEnd || it->value != bPos->value) - return false; - } - - return true; -} - -template -inline bool operator!=(const HashMap& a, - const HashMap& b) { - return !(a == b); -} - -template -inline void copyKeysToVector(const HashMap& collection, - Z& vector) { - typedef typename HashMap::const_iterator::Keys iterator; - - vector.resize(collection.size()); - - iterator it = collection.begin().keys(); - iterator end = collection.end().keys(); - for (unsigned i = 0; it != end; ++it, ++i) - vector[i] = *it; -} - -template -inline void copyValuesToVector(const HashMap& collection, - Z& vector) { - typedef typename HashMap::const_iterator::Values iterator; - - vector.resize(collection.size()); - - iterator it = collection.begin().values(); - iterator end = collection.end().values(); - for (unsigned i = 0; it != end; ++it, ++i) - vector[i] = *it; -} - -} // namespace WTF - -using WTF::HashMap; - -#endif // SKY_ENGINE_WTF_HASHMAP_H_ diff --git a/sky/engine/wtf/HashMapTest.cpp b/sky/engine/wtf/HashMapTest.cpp deleted file mode 100644 index 5dd817ccf41eb..0000000000000 --- a/sky/engine/wtf/HashMapTest.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace { - -typedef WTF::HashMap IntHashMap; - -TEST(HashMapTest, IteratorComparison) { - IntHashMap map; - map.add(1, 2); - EXPECT_TRUE(map.begin() != map.end()); - EXPECT_FALSE(map.begin() == map.end()); - - IntHashMap::const_iterator begin = map.begin(); - EXPECT_TRUE(begin == map.begin()); - EXPECT_TRUE(map.begin() == begin); - EXPECT_TRUE(begin != map.end()); - EXPECT_TRUE(map.end() != begin); - EXPECT_FALSE(begin != map.begin()); - EXPECT_FALSE(map.begin() != begin); - EXPECT_FALSE(begin == map.end()); - EXPECT_FALSE(map.end() == begin); -} - -struct TestDoubleHashTraits : HashTraits { - static const unsigned minimumTableSize = 8; -}; - -typedef HashMap::Hash, - TestDoubleHashTraits> - DoubleHashMap; - -static int bucketForKey(double key) { - return DefaultHash::Hash::hash(key) & - (TestDoubleHashTraits::minimumTableSize - 1); -} - -TEST(HashMapTest, DoubleHashCollisions) { - // The "clobber" key here is one that ends up stealing the bucket that the -0 - // key originally wants to be in. This makes the 0 and -0 keys collide and the - // test then fails unless the FloatHash::equals() implementation can - // distinguish them. - const double clobberKey = 6; - const double zeroKey = 0; - const double negativeZeroKey = -zeroKey; - - DoubleHashMap map; - - map.add(clobberKey, 1); - map.add(zeroKey, 2); - map.add(negativeZeroKey, 3); - - EXPECT_EQ(bucketForKey(clobberKey), bucketForKey(negativeZeroKey)); - EXPECT_EQ(1, map.get(clobberKey)); - EXPECT_EQ(2, map.get(zeroKey)); - EXPECT_EQ(3, map.get(negativeZeroKey)); -} - -class DestructCounter { - public: - explicit DestructCounter(int i, int* destructNumber) - : m_i(i), m_destructNumber(destructNumber) {} - - ~DestructCounter() { ++(*m_destructNumber); } - int get() const { return m_i; } - - private: - int m_i; - int* m_destructNumber; -}; - -typedef WTF::HashMap> OwnPtrHashMap; - -TEST(HashMapTest, OwnPtrAsValue) { - int destructNumber = 0; - OwnPtrHashMap map; - map.add(1, adoptPtr(new DestructCounter(1, &destructNumber))); - map.add(2, adoptPtr(new DestructCounter(2, &destructNumber))); - - DestructCounter* counter1 = map.get(1); - EXPECT_EQ(1, counter1->get()); - DestructCounter* counter2 = map.get(2); - EXPECT_EQ(2, counter2->get()); - EXPECT_EQ(0, destructNumber); - - for (OwnPtrHashMap::iterator iter = map.begin(); iter != map.end(); ++iter) { - OwnPtr& ownCounter = iter->value; - EXPECT_EQ(iter->key, ownCounter->get()); - } - ASSERT_EQ(0, destructNumber); - - OwnPtr ownCounter1 = map.take(1); - EXPECT_EQ(ownCounter1.get(), counter1); - EXPECT_FALSE(map.contains(1)); - EXPECT_EQ(0, destructNumber); - - map.remove(2); - EXPECT_FALSE(map.contains(2)); - EXPECT_EQ(0UL, map.size()); - EXPECT_EQ(1, destructNumber); - - ownCounter1.clear(); - EXPECT_EQ(2, destructNumber); -} - -class DummyRefCounted : public WTF::RefCounted { - public: - DummyRefCounted(bool& isDeleted) : m_isDeleted(isDeleted) { - m_isDeleted = false; - } - ~DummyRefCounted() { - ASSERT(!m_isDeleted); - m_isDeleted = true; - } - - void ref() { - ASSERT(!m_isDeleted); - WTF::RefCounted::ref(); - ++m_refInvokesCount; - } - - void deref() { - ASSERT(!m_isDeleted); - WTF::RefCounted::deref(); - } - - static int m_refInvokesCount; - - private: - bool& m_isDeleted; -}; - -int DummyRefCounted::m_refInvokesCount = 0; - -TEST(HashMapTest, RefPtrAsKey) { - bool isDeleted = false; - DummyRefCounted::m_refInvokesCount = 0; - RefPtr ptr = adoptRef(new DummyRefCounted(isDeleted)); - EXPECT_EQ(0, DummyRefCounted::m_refInvokesCount); - HashMap, int> map; - map.add(ptr, 1); - // Referenced only once (to store a copy in the container). - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); - EXPECT_EQ(1, map.get(ptr)); - - DummyRefCounted* rawPtr = ptr.get(); - - EXPECT_TRUE(map.contains(rawPtr)); - EXPECT_NE(map.end(), map.find(rawPtr)); - EXPECT_TRUE(map.contains(ptr)); - EXPECT_NE(map.end(), map.find(ptr)); - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); - - ptr.clear(); - EXPECT_FALSE(isDeleted); - - map.remove(rawPtr); - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); - EXPECT_TRUE(isDeleted); - EXPECT_TRUE(map.isEmpty()); -} - -TEST(HashMaptest, RemoveAdd) { - DummyRefCounted::m_refInvokesCount = 0; - bool isDeleted = false; - - typedef HashMap> Map; - Map map; - - RefPtr ptr = adoptRef(new DummyRefCounted(isDeleted)); - EXPECT_EQ(0, DummyRefCounted::m_refInvokesCount); - - map.add(1, ptr); - // Referenced only once (to store a copy in the container). - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); - EXPECT_EQ(ptr, map.get(1)); - - ptr.clear(); - EXPECT_FALSE(isDeleted); - - map.remove(1); - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); - EXPECT_TRUE(isDeleted); - EXPECT_TRUE(map.isEmpty()); - - // Add and remove until the deleted slot is reused. - for (int i = 1; i < 100; i++) { - bool isDeleted2 = false; - RefPtr ptr2 = adoptRef(new DummyRefCounted(isDeleted2)); - map.add(i, ptr2); - EXPECT_FALSE(isDeleted2); - ptr2.clear(); - EXPECT_FALSE(isDeleted2); - map.remove(i); - EXPECT_TRUE(isDeleted2); - } -} - -class SimpleClass { - public: - explicit SimpleClass(int v) : m_v(v) {} - int v() { return m_v; } - - private: - int m_v; -}; -typedef HashMap> IntSimpleMap; - -TEST(HashMapTest, AddResult) { - IntSimpleMap map; - IntSimpleMap::AddResult result = map.add(1, nullptr); - EXPECT_TRUE(result.isNewEntry); - EXPECT_EQ(1, result.storedValue->key); - EXPECT_EQ(0, result.storedValue->value.get()); - - SimpleClass* simple1 = new SimpleClass(1); - result.storedValue->value = adoptPtr(simple1); - EXPECT_EQ(simple1, map.get(1)); - - IntSimpleMap::AddResult result2 = map.add(1, adoptPtr(new SimpleClass(2))); - EXPECT_FALSE(result2.isNewEntry); - EXPECT_EQ(1, map.get(1)->v()); -} - -} // namespace diff --git a/sky/engine/wtf/HashSet.h b/sky/engine/wtf/HashSet.h deleted file mode 100644 index 6ec3f27ae1154..0000000000000 --- a/sky/engine/wtf/HashSet.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_HASHSET_H_ -#define SKY_ENGINE_WTF_HASHSET_H_ - -#include "flutter/sky/engine/wtf/DefaultAllocator.h" -#include "flutter/sky/engine/wtf/HashTable.h" - -namespace WTF { - -struct IdentityExtractor; - -// Note: empty or deleted values are not allowed, using them may lead to -// undefined behavior. For pointer valuess this means that null pointers are not -// allowed unless you supply custom traits. -template ::Hash, - typename TraitsArg = HashTraits, - typename Allocator = DefaultAllocator> -class HashSet { - WTF_USE_ALLOCATOR(HashSet, Allocator); - - private: - typedef HashArg HashFunctions; - typedef TraitsArg ValueTraits; - typedef typename ValueTraits::PeekInType ValuePeekInType; - typedef typename ValueTraits::PassInType ValuePassInType; - typedef typename ValueTraits::PassOutType ValuePassOutType; - - public: - typedef typename ValueTraits::TraitType ValueType; - - private: - typedef HashTable - HashTableType; - - public: - typedef HashTableConstIteratorAdapter iterator; - typedef HashTableConstIteratorAdapter - const_iterator; - typedef typename HashTableType::AddResult AddResult; - - void swap(HashSet& ref) { m_impl.swap(ref.m_impl); } - - void swap(typename Allocator::template OtherType::Type other) { - HashSet& ref = Allocator::getOther(other); - m_impl.swap(ref.m_impl); - } - - unsigned size() const; - unsigned capacity() const; - bool isEmpty() const; - - iterator begin() const; - iterator end() const; - - iterator find(ValuePeekInType) const; - bool contains(ValuePeekInType) const; - - // An alternate version of find() that finds the object by hashing and - // comparing with some other type, to avoid the cost of type conversion. - // HashTranslator must have the following function members: - // static unsigned hash(const T&); - // static bool equal(const ValueType&, const T&); - template - iterator find(const T&) const; - template - bool contains(const T&) const; - - // The return value is a pair of an iterator to the new value's location, - // and a bool that is true if an new entry was added. - AddResult add(ValuePassInType); - - // An alternate version of add() that finds the object by hashing and - // comparing with some other type, to avoid the cost of type conversion if the - // object is already in the table. HashTranslator must have the following - // function members: - // static unsigned hash(const T&); - // static bool equal(const ValueType&, const T&); - // static translate(ValueType&, const T&, unsigned hashCode); - template - AddResult add(const T&); - - void remove(ValuePeekInType); - void remove(iterator); - void clear(); - template - void removeAll(const Collection& toBeRemoved) { - WTF::removeAll(*this, toBeRemoved); - } - - static bool isValidValue(ValuePeekInType); - - ValuePassOutType take(iterator); - ValuePassOutType take(ValuePeekInType); - ValuePassOutType takeAny(); - - private: - HashTableType m_impl; -}; - -struct IdentityExtractor { - template - static const T& extract(const T& t) { - return t; - } -}; - -template -struct HashSetTranslatorAdapter { - template - static unsigned hash(const T& key) { - return Translator::hash(key); - } - template - static bool equal(const T& a, const U& b) { - return Translator::equal(a, b); - } - template - static void translate(T& location, - const U& key, - const U&, - unsigned hashCode) { - Translator::translate(location, key, hashCode); - } -}; - -template -inline unsigned HashSet::size() const { - return m_impl.size(); -} - -template -inline unsigned HashSet::capacity() const { - return m_impl.capacity(); -} - -template -inline bool HashSet::isEmpty() const { - return m_impl.isEmpty(); -} - -template -inline typename HashSet::iterator HashSet::begin() - const { - return m_impl.begin(); -} - -template -inline typename HashSet::iterator HashSet::end() const { - return m_impl.end(); -} - -template -inline typename HashSet::iterator HashSet::find( - ValuePeekInType value) const { - return m_impl.find(value); -} - -template -inline bool HashSet::contains( - ValuePeekInType value) const { - return m_impl.contains(value); -} - -template -template -typename HashSet:: - iterator inline HashSet::find( - const T& value) const { - return m_impl.template find>(value); -} - -template -template -inline bool HashSet::contains( - const T& value) const { - return m_impl.template contains>( - value); -} - -template -inline typename HashSet::AddResult HashSet::add( - ValuePassInType value) { - return m_impl.add(value); -} - -template -template -inline typename HashSet::AddResult -HashSet::add(const T& value) { - return m_impl - .template addPassingHashCode>( - value, value); -} - -template -inline void HashSet::remove(iterator it) { - m_impl.remove(it.m_impl); -} - -template -inline void HashSet::remove(ValuePeekInType value) { - remove(find(value)); -} - -template -inline void HashSet::clear() { - m_impl.clear(); -} - -template -inline bool HashSet::isValidValue(ValuePeekInType value) { - if (ValueTraits::isDeletedValue(value)) - return false; - - if (HashFunctions::safeToCompareToEmptyOrDeleted) { - if (value == ValueTraits::emptyValue()) - return false; - } else { - if (isHashTraitsEmptyValue(value)) - return false; - } - - return true; -} - -template -inline typename HashSet::ValuePassOutType HashSet::take( - iterator it) { - if (it == end()) - return ValueTraits::emptyValue(); - - ValuePassOutType result = ValueTraits::passOut(const_cast(*it)); - remove(it); - - return result; -} - -template -inline typename HashSet::ValuePassOutType HashSet::take( - ValuePeekInType value) { - return take(find(value)); -} - -template -inline typename HashSet::ValuePassOutType -HashSet::takeAny() { - return take(begin()); -} - -template -inline void copyToVector(const C& collection, W& vector) { - typedef typename C::const_iterator iterator; - - vector.resize(collection.size()); - - iterator it = collection.begin(); - iterator end = collection.end(); - for (unsigned i = 0; it != end; ++it, ++i) - vector[i] = *it; -} - -} // namespace WTF - -using WTF::HashSet; - -#endif // SKY_ENGINE_WTF_HASHSET_H_ diff --git a/sky/engine/wtf/HashSetTest.cpp b/sky/engine/wtf/HashSetTest.cpp deleted file mode 100644 index 888e7df2a8e33..0000000000000 --- a/sky/engine/wtf/HashSetTest.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" - -namespace { - -template -struct InitialCapacityTestHashTraits - : public WTF::UnsignedWithZeroKeyHashTraits { - static const int minimumTableSize = initialCapacity; -}; - -template -void testInitialCapacity() { - const unsigned initialCapacity = WTF::HashTableCapacityForSize::value; - HashSet::Hash, - InitialCapacityTestHashTraits> - testSet; - - // Initial capacity is null. - EXPECT_EQ(0UL, testSet.capacity()); - - // Adding items up to size should never change the capacity. - for (size_t i = 0; i < size; ++i) { - testSet.add(i); - EXPECT_EQ(initialCapacity, testSet.capacity()); - } - - // Adding items up to less than half the capacity should not change the - // capacity. - unsigned capacityLimit = initialCapacity / 2 - 1; - for (size_t i = size; i < capacityLimit; ++i) { - testSet.add(i); - EXPECT_EQ(initialCapacity, testSet.capacity()); - } - - // Adding one more item increase the capacity. - testSet.add(initialCapacity); - EXPECT_GT(testSet.capacity(), initialCapacity); -} - -template -void generateTestCapacityUpToSize(); -template <> -void generateTestCapacityUpToSize<0>() {} -template -void generateTestCapacityUpToSize() { - generateTestCapacityUpToSize(); - testInitialCapacity(); -} - -TEST(HashSetTest, InitialCapacity) { - generateTestCapacityUpToSize<128>(); -} - -struct Dummy { - Dummy(bool& deleted) : deleted(deleted) {} - - ~Dummy() { deleted = true; } - - bool& deleted; -}; - -TEST(HashSetTest, HashSetOwnPtr) { - bool deleted1 = false, deleted2 = false; - - typedef HashSet> OwnPtrSet; - OwnPtrSet set; - - Dummy* ptr1 = new Dummy(deleted1); - { - // AddResult in a separate scope to avoid assertion hit, - // since we modify the container further. - HashSet>::AddResult res1 = set.add(adoptPtr(ptr1)); - EXPECT_EQ(ptr1, res1.storedValue->get()); - } - - EXPECT_FALSE(deleted1); - EXPECT_EQ(1UL, set.size()); - OwnPtrSet::iterator it1 = set.find(ptr1); - EXPECT_NE(set.end(), it1); - EXPECT_EQ(ptr1, (*it1)); - - Dummy* ptr2 = new Dummy(deleted2); - { - HashSet>::AddResult res2 = set.add(adoptPtr(ptr2)); - EXPECT_EQ(res2.storedValue->get(), ptr2); - } - - EXPECT_FALSE(deleted2); - EXPECT_EQ(2UL, set.size()); - OwnPtrSet::iterator it2 = set.find(ptr2); - EXPECT_NE(set.end(), it2); - EXPECT_EQ(ptr2, (*it2)); - - set.remove(ptr1); - EXPECT_TRUE(deleted1); - - set.clear(); - EXPECT_TRUE(deleted2); - EXPECT_TRUE(set.isEmpty()); - - deleted1 = false; - deleted2 = false; - { - OwnPtrSet set; - set.add(adoptPtr(new Dummy(deleted1))); - set.add(adoptPtr(new Dummy(deleted2))); - } - EXPECT_TRUE(deleted1); - EXPECT_TRUE(deleted2); - - deleted1 = false; - deleted2 = false; - OwnPtr ownPtr1; - OwnPtr ownPtr2; - ptr1 = new Dummy(deleted1); - ptr2 = new Dummy(deleted2); - { - OwnPtrSet set; - set.add(adoptPtr(ptr1)); - set.add(adoptPtr(ptr2)); - ownPtr1 = set.take(ptr1); - EXPECT_EQ(1UL, set.size()); - ownPtr2 = set.takeAny(); - EXPECT_TRUE(set.isEmpty()); - } - EXPECT_FALSE(deleted1); - EXPECT_FALSE(deleted2); - - EXPECT_EQ(ptr1, ownPtr1); - EXPECT_EQ(ptr2, ownPtr2); -} - -class DummyRefCounted : public WTF::RefCounted { - public: - DummyRefCounted(bool& isDeleted) : m_isDeleted(isDeleted) { - m_isDeleted = false; - } - ~DummyRefCounted() { m_isDeleted = true; } - - void ref() { - WTF::RefCounted::ref(); - ++s_refInvokesCount; - } - - static int s_refInvokesCount; - - private: - bool& m_isDeleted; -}; - -int DummyRefCounted::s_refInvokesCount = 0; - -TEST(HashSetTest, HashSetRefPtr) { - bool isDeleted = false; - RefPtr ptr = adoptRef(new DummyRefCounted(isDeleted)); - EXPECT_EQ(0, DummyRefCounted::s_refInvokesCount); - HashSet> set; - set.add(ptr); - // Referenced only once (to store a copy in the container). - EXPECT_EQ(1, DummyRefCounted::s_refInvokesCount); - - DummyRefCounted* rawPtr = ptr.get(); - - EXPECT_TRUE(set.contains(rawPtr)); - EXPECT_NE(set.end(), set.find(rawPtr)); - EXPECT_TRUE(set.contains(ptr)); - EXPECT_NE(set.end(), set.find(ptr)); - - ptr.clear(); - EXPECT_FALSE(isDeleted); - - set.remove(rawPtr); - EXPECT_TRUE(isDeleted); - EXPECT_TRUE(set.isEmpty()); - EXPECT_EQ(1, DummyRefCounted::s_refInvokesCount); -} - -} // namespace diff --git a/sky/engine/wtf/HashTable.cpp b/sky/engine/wtf/HashTable.cpp deleted file mode 100644 index 589d0320c8ea3..0000000000000 --- a/sky/engine/wtf/HashTable.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2005 Apple Inc. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "flutter/sky/engine/wtf/HashTable.h" -#include "flutter/sky/engine/wtf/DataLog.h" - -namespace WTF { - -#if DUMP_HASHTABLE_STATS - -int HashTableStats::numAccesses; -int HashTableStats::numCollisions; -int HashTableStats::collisionGraph[4096]; -int HashTableStats::maxCollisions; -int HashTableStats::numRehashes; -int HashTableStats::numRemoves; -int HashTableStats::numReinserts; - -static Mutex& hashTableStatsMutex() { - AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); - return mutex; -} - -void HashTableStats::recordCollisionAtCount(int count) { - MutexLocker lock(hashTableStatsMutex()); - if (count > maxCollisions) - maxCollisions = count; - numCollisions++; - collisionGraph[count]++; -} - -void HashTableStats::dumpStats() { - MutexLocker lock(hashTableStatsMutex()); - - dataLogF("\nWTF::HashTable statistics\n\n"); - dataLogF("%d accesses\n", numAccesses); - dataLogF("%d total collisions, average %.2f probes per access\n", - numCollisions, 1.0 * (numAccesses + numCollisions) / numAccesses); - dataLogF("longest collision chain: %d\n", maxCollisions); - for (int i = 1; i <= maxCollisions; i++) { - dataLogF( - " %d lookups with exactly %d collisions (%.2f%% , %.2f%% with this " - "many or more)\n", - collisionGraph[i], i, - 100.0 * (collisionGraph[i] - collisionGraph[i + 1]) / numAccesses, - 100.0 * collisionGraph[i] / numAccesses); - } - dataLogF("%d rehashes\n", numRehashes); - dataLogF("%d reinserts\n", numReinserts); -} - -#endif - -} // namespace WTF diff --git a/sky/engine/wtf/HashTable.h b/sky/engine/wtf/HashTable.h deleted file mode 100644 index 5678e27997572..0000000000000 --- a/sky/engine/wtf/HashTable.h +++ /dev/null @@ -1,1751 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. - * All rights reserved. - * Copyright (C) 2008 David Levin - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_HASHTABLE_H_ -#define SKY_ENGINE_WTF_HASHTABLE_H_ - -#include "flutter/sky/engine/wtf/Alignment.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/DefaultAllocator.h" -#include "flutter/sky/engine/wtf/HashTraits.h" -#include "flutter/sky/engine/wtf/WTF.h" - -#define DUMP_HASHTABLE_STATS 0 -#define DUMP_HASHTABLE_STATS_PER_TABLE 0 - -#if DUMP_HASHTABLE_STATS_PER_TABLE -#include "flutter/sky/engine/wtf/DataLog.h" -#endif - -#if DUMP_HASHTABLE_STATS -#if DUMP_HASHTABLE_STATS_PER_TABLE -#define UPDATE_PROBE_COUNTS() \ - ++probeCount; \ - HashTableStats::recordCollisionAtCount(probeCount); \ - ++perTableProbeCount; \ - m_stats->recordCollisionAtCount(perTableProbeCount) -#define UPDATE_ACCESS_COUNTS() \ - atomicIncrement(&HashTableStats::numAccesses); \ - int probeCount = 0; \ - ++m_stats->numAccesses; \ - int perTableProbeCount = 0 -#else -#define UPDATE_PROBE_COUNTS() \ - ++probeCount; \ - HashTableStats::recordCollisionAtCount(probeCount) -#define UPDATE_ACCESS_COUNTS() \ - atomicIncrement(&HashTableStats::numAccesses); \ - int probeCount = 0 -#endif -#else -#if DUMP_HASHTABLE_STATS_PER_TABLE -#define UPDATE_PROBE_COUNTS() \ - ++perTableProbeCount; \ - m_stats->recordCollisionAtCount(perTableProbeCount) -#define UPDATE_ACCESS_COUNTS() \ - ++m_stats->numAccesses; \ - int perTableProbeCount = 0 -#else -#define UPDATE_PROBE_COUNTS() \ - do { \ - } while (0) -#define UPDATE_ACCESS_COUNTS() \ - do { \ - } while (0) -#endif -#endif - -namespace WTF { - -#if DUMP_HASHTABLE_STATS - -struct HashTableStats { - // The following variables are all atomically incremented when modified. - static int numAccesses; - static int numRehashes; - static int numRemoves; - static int numReinserts; - - // The following variables are only modified in the recordCollisionAtCount - // method within a mutex. - static int maxCollisions; - static int numCollisions; - static int collisionGraph[4096]; - - static void recordCollisionAtCount(int count); - static void dumpStats(); -}; - -#endif - -template -class HashTable; -template -class HashTableIterator; -template -class HashTableConstIterator; -template -class LinkedHashSet; - -typedef enum { HashItemKnownGood } HashItemKnownGoodTag; - -template -class HashTableConstIterator { - private: - typedef HashTable - HashTableType; - typedef HashTableIterator - iterator; - typedef HashTableConstIterator - const_iterator; - typedef Value ValueType; - typedef typename Traits::IteratorConstGetType GetType; - typedef const ValueType* PointerType; - - friend class HashTable; - friend class HashTableIterator; - - void skipEmptyBuckets() { - while (m_position != m_endPosition && - HashTableType::isEmptyOrDeletedBucket(*m_position)) - ++m_position; - } - - HashTableConstIterator(PointerType position, - PointerType endPosition, - const HashTableType* container) - : m_position(position), - m_endPosition(endPosition) -#if ENABLE(ASSERT) - , - m_container(container), - m_containerModifications(container->modifications()) -#endif - { - skipEmptyBuckets(); - } - - HashTableConstIterator(PointerType position, - PointerType endPosition, - const HashTableType* container, - HashItemKnownGoodTag) - : m_position(position), - m_endPosition(endPosition) -#if ENABLE(ASSERT) - , - m_container(container), - m_containerModifications(container->modifications()) -#endif - { - ASSERT(m_containerModifications == m_container->modifications()); - } - - void checkModifications() const { - // HashTable and collections that build on it do not support - // modifications while there is an iterator in use. The exception - // is ListHashSet, which has its own iterators that tolerate - // modification of the underlying set. - ASSERT(m_containerModifications == m_container->modifications()); - } - - public: - HashTableConstIterator() {} - - GetType get() const { - checkModifications(); - return m_position; - } - typename Traits::IteratorConstReferenceType operator*() const { - return Traits::getToReferenceConstConversion(get()); - } - GetType operator->() const { return get(); } - - const_iterator& operator++() { - ASSERT(m_position != m_endPosition); - checkModifications(); - ++m_position; - skipEmptyBuckets(); - return *this; - } - - // postfix ++ intentionally omitted - - // Comparison. - bool operator==(const const_iterator& other) const { - return m_position == other.m_position; - } - bool operator!=(const const_iterator& other) const { - return m_position != other.m_position; - } - bool operator==(const iterator& other) const { - return *this == static_cast(other); - } - bool operator!=(const iterator& other) const { - return *this != static_cast(other); - } - - private: - PointerType m_position; - PointerType m_endPosition; -#if ENABLE(ASSERT) - const HashTableType* m_container; - int64_t m_containerModifications; -#endif -}; - -template -class HashTableIterator { - private: - typedef HashTable - HashTableType; - typedef HashTableIterator - iterator; - typedef HashTableConstIterator - const_iterator; - typedef Value ValueType; - typedef typename Traits::IteratorGetType GetType; - typedef ValueType* PointerType; - - friend class HashTable; - - HashTableIterator(PointerType pos, - PointerType end, - const HashTableType* container) - : m_iterator(pos, end, container) {} - HashTableIterator(PointerType pos, - PointerType end, - const HashTableType* container, - HashItemKnownGoodTag tag) - : m_iterator(pos, end, container, tag) {} - - public: - HashTableIterator() {} - - // default copy, assignment and destructor are OK - - GetType get() const { return const_cast(m_iterator.get()); } - typename Traits::IteratorReferenceType operator*() const { - return Traits::getToReferenceConversion(get()); - } - GetType operator->() const { return get(); } - - iterator& operator++() { - ++m_iterator; - return *this; - } - - // postfix ++ intentionally omitted - - // Comparison. - bool operator==(const iterator& other) const { - return m_iterator == other.m_iterator; - } - bool operator!=(const iterator& other) const { - return m_iterator != other.m_iterator; - } - bool operator==(const const_iterator& other) const { - return m_iterator == other; - } - bool operator!=(const const_iterator& other) const { - return m_iterator != other; - } - - operator const_iterator() const { return m_iterator; } - - private: - const_iterator m_iterator; -}; - -using std::swap; - -// Work around MSVC's standard library, whose swap for pairs does not swap by -// component. -template -inline void hashTableSwap(T& a, T& b) { - swap(a, b); -} - -template -inline void hashTableSwap(KeyValuePair& a, KeyValuePair& b) { - swap(a.key, b.key); - swap(a.value, b.value); -} - -template -struct Mover; -template -struct Mover { - static void move(T& from, T& to) { - // A swap operation should not normally allocate, but it may do so - // if it is falling back on some sort of triple assignment in the - // style of t = a; a = b; b = t because there is no overloaded swap - // operation. We can't allow allocation both because it is slower - // than a true swap operation, but also because allocation implies - // allowing GC: We cannot allow a GC after swapping only the key. - // The value is only traced if the key is present and therefore the - // GC will not see the value in the old backing if the key has been - // moved to the new backing. Therefore, we cannot allow GC until - // after both key and value have been moved. - Allocator::enterNoAllocationScope(); - hashTableSwap(from, to); - Allocator::leaveNoAllocationScope(); - } -}; -template -struct Mover { - static void move(T& from, T& to) { to = from; } -}; - -template -class IdentityHashTranslator { - public: - template - static unsigned hash(const T& key) { - return HashFunctions::hash(key); - } - template - static bool equal(const T& a, const U& b) { - return HashFunctions::equal(a, b); - } - template - static void translate(T& location, const U&, const V& value) { - location = value; - } -}; - -template -struct HashTableAddResult { - HashTableAddResult(const HashTableType* container, - ValueType* storedValue, - bool isNewEntry) - : storedValue(storedValue), - isNewEntry(isNewEntry) -#if ENABLE(SECURITY_ASSERT) - , - m_container(container), - m_containerModifications(container->modifications()) -#endif - { - ASSERT_UNUSED(container, container); - } - - ~HashTableAddResult() { - // If rehash happened before accessing storedValue, it's - // use-after-free. Any modification may cause a rehash, so we check - // for modifications here. - // Rehash after accessing storedValue is harmless but will assert if - // the AddResult destructor takes place after a modification. You - // may need to limit the scope of the AddResult. - ASSERT_WITH_SECURITY_IMPLICATION(m_containerModifications == - m_container->modifications()); - } - - ValueType* storedValue; - bool isNewEntry; - -#if ENABLE(SECURITY_ASSERT) - private: - const HashTableType* m_container; - const int64_t m_containerModifications; -#endif -}; - -template -struct HashTableHelper { - static bool isEmptyBucket(const Value& value) { - return isHashTraitsEmptyValue(Extractor::extract(value)); - } - static bool isDeletedBucket(const Value& value) { - return KeyTraits::isDeletedValue(Extractor::extract(value)); - } - static bool isEmptyOrDeletedBucket(const Value& value) { - return isEmptyBucket(value) || isDeletedBucket(value); - } -}; - -template -struct HashTableKeyChecker { - // There's no simple generic way to make this check if - // safeToCompareToEmptyOrDeleted is false, so the check always passes. - template - static bool checkKey(const T&) { - return true; - } -}; - -template -struct HashTableKeyChecker { - template - static bool checkKey(const T& key) { - // FIXME : Check also equality to the deleted value. - return !HashTranslator::equal(KeyTraits::emptyValue(), key); - } -}; - -// Don't declare a destructor for HeapAllocated hash tables. -template -class HashTableDestructorBase; - -template -class HashTableDestructorBase {}; - -template -class HashTableDestructorBase { - public: - ~HashTableDestructorBase() { static_cast(this)->finalize(); } -}; - -// Note: empty or deleted key values are not allowed, using them may lead to -// undefined behavior. For pointer keys this means that null pointers are not -// allowed unless you supply custom key traits. -template -class HashTable - : public HashTableDestructorBase, - Allocator::isGarbageCollected> { - public: - typedef HashTableIterator - iterator; - typedef HashTableConstIterator - const_iterator; - typedef Traits ValueTraits; - typedef Key KeyType; - typedef typename KeyTraits::PeekInType KeyPeekInType; - typedef typename KeyTraits::PassInType KeyPassInType; - typedef Value ValueType; - typedef Extractor ExtractorType; - typedef KeyTraits KeyTraitsType; - typedef typename Traits::PassInType ValuePassInType; - typedef IdentityHashTranslator IdentityTranslatorType; - typedef HashTableAddResult AddResult; - -#if DUMP_HASHTABLE_STATS_PER_TABLE - struct Stats { - Stats() - : numAccesses(0), - numRehashes(0), - numRemoves(0), - numReinserts(0), - maxCollisions(0), - numCollisions(0), - collisionGraph() {} - - int numAccesses; - int numRehashes; - int numRemoves; - int numReinserts; - - int maxCollisions; - int numCollisions; - int collisionGraph[4096]; - - void recordCollisionAtCount(int count) { - if (count > maxCollisions) - maxCollisions = count; - numCollisions++; - collisionGraph[count]++; - } - - void dumpStats() { - dataLogF("\nWTF::HashTable::Stats dump\n\n"); - dataLogF("%d accesses\n", numAccesses); - dataLogF("%d total collisions, average %.2f probes per access\n", - numCollisions, - 1.0 * (numAccesses + numCollisions) / numAccesses); - dataLogF("longest collision chain: %d\n", maxCollisions); - for (int i = 1; i <= maxCollisions; i++) { - dataLogF( - " %d lookups with exactly %d collisions (%.2f%% , %.2f%% with " - "this many or more)\n", - collisionGraph[i], i, - 100.0 * (collisionGraph[i] - collisionGraph[i + 1]) / numAccesses, - 100.0 * collisionGraph[i] / numAccesses); - } - dataLogF("%d rehashes\n", numRehashes); - dataLogF("%d reinserts\n", numReinserts); - } - }; -#endif - - HashTable(); - void finalize() { - ASSERT(!Allocator::isGarbageCollected); - if (LIKELY(!m_table)) - return; - deleteAllBucketsAndDeallocate(m_table, m_tableSize); - m_table = 0; - } - - HashTable(const HashTable&); - void swap(HashTable&); - HashTable& operator=(const HashTable&); - - // When the hash table is empty, just return the same iterator for end as for - // begin. This is more efficient because we don't have to skip all the empty - // and deleted buckets, and iterating an empty table is a common case that's - // worth optimizing. - iterator begin() { return isEmpty() ? end() : makeIterator(m_table); } - iterator end() { return makeKnownGoodIterator(m_table + m_tableSize); } - const_iterator begin() const { - return isEmpty() ? end() : makeConstIterator(m_table); - } - const_iterator end() const { - return makeKnownGoodConstIterator(m_table + m_tableSize); - } - - unsigned size() const { return m_keyCount; } - unsigned capacity() const { return m_tableSize; } - bool isEmpty() const { return !m_keyCount; } - - AddResult add(ValuePassInType value) { - return add(Extractor::extract(value), value); - } - - // A special version of add() that finds the object by hashing and comparing - // with some other type, to avoid the cost of type conversion if the object is - // already in the table. - template - AddResult add(const T& key, const Extra&); - template - AddResult addPassingHashCode(const T& key, const Extra&); - - iterator find(KeyPeekInType key) { return find(key); } - const_iterator find(KeyPeekInType key) const { - return find(key); - } - bool contains(KeyPeekInType key) const { - return contains(key); - } - - template - iterator find(const T&); - template - const_iterator find(const T&) const; - template - bool contains(const T&) const; - - void remove(KeyPeekInType); - void remove(iterator); - void remove(const_iterator); - void clear(); - - static bool isEmptyBucket(const ValueType& value) { - return isHashTraitsEmptyValue(Extractor::extract(value)); - } - static bool isDeletedBucket(const ValueType& value) { - return KeyTraits::isDeletedValue(Extractor::extract(value)); - } - static bool isEmptyOrDeletedBucket(const ValueType& value) { - return HashTableHelper::isEmptyOrDeletedBucket(value); - } - - ValueType* lookup(KeyPeekInType key) { - return lookup(key); - } - template - ValueType* lookup(T); - template - const ValueType* lookup(T) const; - -#if ENABLE(ASSERT) - int64_t modifications() const { return m_modifications; } - void registerModification() { m_modifications++; } - // HashTable and collections that build on it do not support - // modifications while there is an iterator in use. The exception is - // ListHashSet, which has its own iterators that tolerate modification - // of the underlying set. - void checkModifications(int64_t mods) const { - ASSERT(mods == m_modifications); - } -#else - int64_t modifications() const { return 0; } - void registerModification() {} - void checkModifications(int64_t mods) const {} -#endif - - private: - static ValueType* allocateTable(unsigned size); - static void deleteAllBucketsAndDeallocate(ValueType* table, unsigned size); - - typedef std::pair LookupType; - typedef std::pair FullLookupType; - - LookupType lookupForWriting(const Key& key) { - return lookupForWriting(key); - }; - template - FullLookupType fullLookupForWriting(const T&); - template - LookupType lookupForWriting(const T&); - - void remove(ValueType*); - - bool shouldExpand() const { - return (m_keyCount + m_deletedCount) * m_maxLoad >= m_tableSize; - } - bool mustRehashInPlace() const { - return m_keyCount * m_minLoad < m_tableSize * 2; - } - bool shouldShrink() const { - // isAllocationAllowed check should be at the last because it's - // expensive. - return m_keyCount * m_minLoad < m_tableSize && - m_tableSize > KeyTraits::minimumTableSize && - Allocator::isAllocationAllowed(); - } - ValueType* expand(ValueType* entry = 0); - void shrink() { rehash(m_tableSize / 2, 0); } - - ValueType* rehash(unsigned newTableSize, ValueType* entry); - ValueType* reinsert(ValueType&); - - static void initializeBucket(ValueType& bucket); - static void deleteBucket(ValueType& bucket) { - bucket.~ValueType(); - Traits::constructDeletedValue(bucket, Allocator::isGarbageCollected); - } - - FullLookupType makeLookupResult(ValueType* position, - bool found, - unsigned hash) { - return FullLookupType(LookupType(position, found), hash); - } - - iterator makeIterator(ValueType* pos) { - return iterator(pos, m_table + m_tableSize, this); - } - const_iterator makeConstIterator(ValueType* pos) const { - return const_iterator(pos, m_table + m_tableSize, this); - } - iterator makeKnownGoodIterator(ValueType* pos) { - return iterator(pos, m_table + m_tableSize, this, HashItemKnownGood); - } - const_iterator makeKnownGoodConstIterator(ValueType* pos) const { - return const_iterator(pos, m_table + m_tableSize, this, HashItemKnownGood); - } - - static const unsigned m_maxLoad = 2; - static const unsigned m_minLoad = 6; - - unsigned tableSizeMask() const { - size_t mask = m_tableSize - 1; - ASSERT((mask & m_tableSize) == 0); - return mask; - } - - void setEnqueued() { m_queueFlag = true; } - void clearEnqueued() { m_queueFlag = false; } - bool enqueued() { return m_queueFlag; } - - ValueType* m_table; - unsigned m_tableSize; - unsigned m_keyCount; - unsigned m_deletedCount : 31; - bool m_queueFlag : 1; -#if ENABLE(ASSERT) - unsigned m_modifications; -#endif - -#if DUMP_HASHTABLE_STATS_PER_TABLE - public: - mutable OwnPtr m_stats; -#endif - - template - friend class LinkedHashSet; -}; - -// Set all the bits to one after the most significant bit: 00110101010 -> -// 00111111111. -template -struct OneifyLowBits; -template <> -struct OneifyLowBits<0> { - static const unsigned value = 0; -}; -template -struct OneifyLowBits { - static const unsigned value = number | OneifyLowBits<(number >> 1)>::value; -}; -// Compute the first power of two integer that is an upper bound of the -// parameter 'number'. -template -struct UpperPowerOfTwoBound { - static const unsigned value = (OneifyLowBits::value + 1) * 2; -}; - -// Because power of two numbers are the limit of maxLoad, their capacity is -// twice the UpperPowerOfTwoBound, or 4 times their values. -template -struct HashTableCapacityForSizeSplitter; -template -struct HashTableCapacityForSizeSplitter { - static const unsigned value = size * 4; -}; -template -struct HashTableCapacityForSizeSplitter { - static const unsigned value = UpperPowerOfTwoBound::value; -}; - -// HashTableCapacityForSize computes the upper power of two capacity to hold the -// size parameter. This is done at compile time to initialize the HashTraits. -template -struct HashTableCapacityForSize { - static const unsigned value = - HashTableCapacityForSizeSplitter::value; - COMPILE_ASSERT(size > 0, HashTableNonZeroMinimumCapacity); - COMPILE_ASSERT(!static_cast(value >> 31), HashTableNoCapacityOverflow); - COMPILE_ASSERT(value > (2 * size), HashTableCapacityHoldsContentSize); -}; - -template -inline HashTable::HashTable() - : m_table(0), - m_tableSize(0), - m_keyCount(0), - m_deletedCount(0), - m_queueFlag(false) -#if ENABLE(ASSERT) - , - m_modifications(0) -#endif -#if DUMP_HASHTABLE_STATS_PER_TABLE - , - m_stats(adoptPtr(new Stats)) -#endif -{ -} - -inline unsigned doubleHash(unsigned key) { - key = ~key + (key >> 23); - key ^= (key << 12); - key ^= (key >> 7); - key ^= (key << 2); - key ^= (key >> 20); - return key; -} - -template -template -inline Value* -HashTable:: - lookup(T key) { - return const_cast( - const_cast(this)->lookup(key)); -} - -template -template -inline const Value* -HashTable:: - lookup(T key) const { - ASSERT((HashTableKeyChecker< - HashTranslator, KeyTraits, - HashFunctions::safeToCompareToEmptyOrDeleted>::checkKey(key))); - const ValueType* table = m_table; - if (!table) - return 0; - - size_t k = 0; - size_t sizeMask = tableSizeMask(); - unsigned h = HashTranslator::hash(key); - size_t i = h & sizeMask; - - UPDATE_ACCESS_COUNTS(); - - while (1) { - const ValueType* entry = table + i; - - if (HashFunctions::safeToCompareToEmptyOrDeleted) { - if (HashTranslator::equal(Extractor::extract(*entry), key)) - return entry; - - if (isEmptyBucket(*entry)) - return 0; - } else { - if (isEmptyBucket(*entry)) - return 0; - - if (!isDeletedBucket(*entry) && - HashTranslator::equal(Extractor::extract(*entry), key)) - return entry; - } - UPDATE_PROBE_COUNTS(); - if (!k) - k = 1 | doubleHash(h); - i = (i + k) & sizeMask; - } -} - -template -template -inline typename HashTable::LookupType -HashTable:: - lookupForWriting(const T& key) { - ASSERT(m_table); - registerModification(); - - ValueType* table = m_table; - size_t k = 0; - size_t sizeMask = tableSizeMask(); - unsigned h = HashTranslator::hash(key); - size_t i = h & sizeMask; - - UPDATE_ACCESS_COUNTS(); - - ValueType* deletedEntry = 0; - - while (1) { - ValueType* entry = table + i; - - if (isEmptyBucket(*entry)) - return LookupType(deletedEntry ? deletedEntry : entry, false); - - if (HashFunctions::safeToCompareToEmptyOrDeleted) { - if (HashTranslator::equal(Extractor::extract(*entry), key)) - return LookupType(entry, true); - - if (isDeletedBucket(*entry)) - deletedEntry = entry; - } else { - if (isDeletedBucket(*entry)) - deletedEntry = entry; - else if (HashTranslator::equal(Extractor::extract(*entry), key)) - return LookupType(entry, true); - } - UPDATE_PROBE_COUNTS(); - if (!k) - k = 1 | doubleHash(h); - i = (i + k) & sizeMask; - } -} - -template -template -inline typename HashTable::FullLookupType -HashTable:: - fullLookupForWriting(const T& key) { - ASSERT(m_table); - registerModification(); - - ValueType* table = m_table; - size_t k = 0; - size_t sizeMask = tableSizeMask(); - unsigned h = HashTranslator::hash(key); - size_t i = h & sizeMask; - - UPDATE_ACCESS_COUNTS(); - - ValueType* deletedEntry = 0; - - while (1) { - ValueType* entry = table + i; - - if (isEmptyBucket(*entry)) - return makeLookupResult(deletedEntry ? deletedEntry : entry, false, h); - - if (HashFunctions::safeToCompareToEmptyOrDeleted) { - if (HashTranslator::equal(Extractor::extract(*entry), key)) - return makeLookupResult(entry, true, h); - - if (isDeletedBucket(*entry)) - deletedEntry = entry; - } else { - if (isDeletedBucket(*entry)) - deletedEntry = entry; - else if (HashTranslator::equal(Extractor::extract(*entry), key)) - return makeLookupResult(entry, true, h); - } - UPDATE_PROBE_COUNTS(); - if (!k) - k = 1 | doubleHash(h); - i = (i + k) & sizeMask; - } -} - -template -struct HashTableBucketInitializer; - -template <> -struct HashTableBucketInitializer { - template - static void initialize(Value& bucket) { - new (NotNull, &bucket) Value(Traits::emptyValue()); - } -}; - -template <> -struct HashTableBucketInitializer { - template - static void initialize(Value& bucket) { - // This initializes the bucket without copying the empty value. - // That makes it possible to use this with types that don't support copying. - // The memset to 0 looks like a slow operation but is optimized by the - // compilers. - memset(&bucket, 0, sizeof(bucket)); - } -}; - -template -inline void -HashTable:: - initializeBucket(ValueType& bucket) { - // For hash maps the key and value cannot be initialied simultaneously, - // and it would be wrong to have a GC when only one was initialized and - // the other still contained garbage (eg. from a previous use of the - // same slot). Therefore we forbid allocation (and thus GC) while the - // slot is initalized to an empty value. - Allocator::enterNoAllocationScope(); - HashTableBucketInitializer::template initialize< - Traits>(bucket); - Allocator::leaveNoAllocationScope(); -} - -template -template -typename HashTable::AddResult -HashTable:: - add(const T& key, const Extra& extra) { - ASSERT(Allocator::isAllocationAllowed()); - if (!m_table) - expand(); - - ASSERT(m_table); - - ValueType* table = m_table; - size_t k = 0; - size_t sizeMask = tableSizeMask(); - unsigned h = HashTranslator::hash(key); - size_t i = h & sizeMask; - - UPDATE_ACCESS_COUNTS(); - - ValueType* deletedEntry = 0; - ValueType* entry; - while (1) { - entry = table + i; - - if (isEmptyBucket(*entry)) - break; - - if (HashFunctions::safeToCompareToEmptyOrDeleted) { - if (HashTranslator::equal(Extractor::extract(*entry), key)) - return AddResult(this, entry, false); - - if (isDeletedBucket(*entry)) - deletedEntry = entry; - } else { - if (isDeletedBucket(*entry)) - deletedEntry = entry; - else if (HashTranslator::equal(Extractor::extract(*entry), key)) - return AddResult(this, entry, false); - } - UPDATE_PROBE_COUNTS(); - if (!k) - k = 1 | doubleHash(h); - i = (i + k) & sizeMask; - } - - registerModification(); - - if (deletedEntry) { - // Overwrite any data left over from last use, using placement new - // or memset. - initializeBucket(*deletedEntry); - entry = deletedEntry; - --m_deletedCount; - } - - HashTranslator::translate(*entry, key, extra); - ASSERT(!isEmptyOrDeletedBucket(*entry)); - - ++m_keyCount; - - if (shouldExpand()) - entry = expand(entry); - - return AddResult(this, entry, true); -} - -template -template -typename HashTable::AddResult -HashTable:: - addPassingHashCode(const T& key, const Extra& extra) { - ASSERT(Allocator::isAllocationAllowed()); - if (!m_table) - expand(); - - FullLookupType lookupResult = fullLookupForWriting(key); - - ValueType* entry = lookupResult.first.first; - bool found = lookupResult.first.second; - unsigned h = lookupResult.second; - - if (found) - return AddResult(this, entry, false); - - registerModification(); - - if (isDeletedBucket(*entry)) { - initializeBucket(*entry); - --m_deletedCount; - } - - HashTranslator::translate(*entry, key, extra, h); - ASSERT(!isEmptyOrDeletedBucket(*entry)); - - ++m_keyCount; - if (shouldExpand()) - entry = expand(entry); - - return AddResult(this, entry, true); -} - -template -Value* -HashTable:: - reinsert(ValueType& entry) { - ASSERT(m_table); - registerModification(); - ASSERT(!lookupForWriting(Extractor::extract(entry)).second); - ASSERT( - !isDeletedBucket(*(lookupForWriting(Extractor::extract(entry)).first))); -#if DUMP_HASHTABLE_STATS - atomicIncrement(&HashTableStats::numReinserts); -#endif -#if DUMP_HASHTABLE_STATS_PER_TABLE - ++m_stats->numReinserts; -#endif - Value* newEntry = lookupForWriting(Extractor::extract(entry)).first; - Mover::move(entry, *newEntry); - - return newEntry; -} - -template -template -inline typename HashTable::iterator -HashTable:: - find(const T& key) { - ValueType* entry = lookup(key); - if (!entry) - return end(); - - return makeKnownGoodIterator(entry); -} - -template -template -inline typename HashTable::const_iterator -HashTable:: - find(const T& key) const { - ValueType* entry = const_cast(this)->lookup(key); - if (!entry) - return end(); - - return makeKnownGoodConstIterator(entry); -} - -template -template -bool HashTable::contains(const T& key) const { - return const_cast(this)->lookup(key); -} - -template -void HashTable::remove(ValueType* pos) { - registerModification(); -#if DUMP_HASHTABLE_STATS - atomicIncrement(&HashTableStats::numRemoves); -#endif -#if DUMP_HASHTABLE_STATS_PER_TABLE - ++m_stats->numRemoves; -#endif - - deleteBucket(*pos); - ++m_deletedCount; - --m_keyCount; - - if (shouldShrink()) - shrink(); -} - -template -inline void -HashTable:: - remove(iterator it) { - if (it == end()) - return; - - remove(const_cast(it.m_iterator.m_position)); -} - -template -inline void -HashTable:: - remove(const_iterator it) { - if (it == end()) - return; - - remove(const_cast(it.m_position)); -} - -template -inline void -HashTable:: - remove(KeyPeekInType key) { - remove(find(key)); -} - -template -Value* -HashTable:: - allocateTable(unsigned size) { - typedef typename Allocator::template HashTableBackingHelper::Type - HashTableBacking; - - size_t allocSize = size * sizeof(ValueType); - ValueType* result; - // Assert that we will not use memset on things with a vtable entry. - // The compiler will also check this on some platforms. We would - // like to check this on the whole value (key-value pair), but - // IsPolymorphic will return false for a pair of two types, even if - // one of the components is polymorphic. - COMPILE_ASSERT(!Traits::emptyValueIsZero || !IsPolymorphic::value, - EmptyValueCannotBeZeroForThingsWithAVtable); - if (Traits::emptyValueIsZero) { - result = - Allocator::template zeroedBackingMalloc( - allocSize); - } else { - result = Allocator::template backingMalloc( - allocSize); - for (unsigned i = 0; i < size; i++) - initializeBucket(result[i]); - } - return result; -} - -template -void HashTable::deleteAllBucketsAndDeallocate(ValueType* table, - unsigned size) { - if (Traits::needsDestruction) { - for (unsigned i = 0; i < size; ++i) { - // This code is called when the hash table is cleared or - // resized. We have allocated a new backing store and we need - // to run the destructors on the old backing store, as it is - // being freed. If we are GCing we need to both call the - // destructor and mark the bucket as deleted, otherwise the - // destructor gets called again when the GC finds the backing - // store. With the default allocator it's enough to call the - // destructor, since we will free the memory explicitly and - // we won't see the memory with the bucket again. - if (!isEmptyOrDeletedBucket(table[i])) { - if (Allocator::isGarbageCollected) - deleteBucket(table[i]); - else - table[i].~ValueType(); - } - } - } - Allocator::backingFree(table); -} - -template -Value* -HashTable:: - expand(Value* entry) { - unsigned newSize; - if (!m_tableSize) { - newSize = KeyTraits::minimumTableSize; - } else if (mustRehashInPlace()) { - newSize = m_tableSize; - } else { - newSize = m_tableSize * 2; - RELEASE_ASSERT(newSize > m_tableSize); - } - - return rehash(newSize, entry); -} - -template -Value* -HashTable:: - rehash(unsigned newTableSize, Value* entry) { - unsigned oldTableSize = m_tableSize; - ValueType* oldTable = m_table; - -#if DUMP_HASHTABLE_STATS - if (oldTableSize != 0) - atomicIncrement(&HashTableStats::numRehashes); -#endif - -#if DUMP_HASHTABLE_STATS_PER_TABLE - if (oldTableSize != 0) - ++m_stats->numRehashes; -#endif - - m_table = allocateTable(newTableSize); - m_tableSize = newTableSize; - - Value* newEntry = 0; - for (unsigned i = 0; i != oldTableSize; ++i) { - if (isEmptyOrDeletedBucket(oldTable[i])) { - ASSERT(&oldTable[i] != entry); - continue; - } - - Value* reinsertedEntry = reinsert(oldTable[i]); - if (&oldTable[i] == entry) { - ASSERT(!newEntry); - newEntry = reinsertedEntry; - } - } - - m_deletedCount = 0; - - deleteAllBucketsAndDeallocate(oldTable, oldTableSize); - - return newEntry; -} - -template -void HashTable::clear() { - registerModification(); - if (!m_table) - return; - - deleteAllBucketsAndDeallocate(m_table, m_tableSize); - m_table = 0; - m_tableSize = 0; - m_keyCount = 0; -} - -template -HashTable:: - HashTable(const HashTable& other) - : m_table(0), - m_tableSize(0), - m_keyCount(0), - m_deletedCount(0), - m_queueFlag(false) -#if ENABLE(ASSERT) - , - m_modifications(0) -#endif -#if DUMP_HASHTABLE_STATS_PER_TABLE - , - m_stats(adoptPtr(new Stats(*other.m_stats))) -#endif -{ - // Copy the hash table the dumb way, by adding each element to the new table. - // It might be more efficient to copy the table slots, but it's not clear that - // efficiency is needed. - const_iterator end = other.end(); - for (const_iterator it = other.begin(); it != end; ++it) - add(*it); -} - -template -void HashTable::swap(HashTable& other) { - std::swap(m_table, other.m_table); - std::swap(m_tableSize, other.m_tableSize); - std::swap(m_keyCount, other.m_keyCount); - // std::swap does not work for bit fields. - unsigned deleted = m_deletedCount; - m_deletedCount = other.m_deletedCount; - other.m_deletedCount = deleted; - ASSERT(!m_queueFlag); - ASSERT(!other.m_queueFlag); - -#if ENABLE(ASSERT) - std::swap(m_modifications, other.m_modifications); -#endif - -#if DUMP_HASHTABLE_STATS_PER_TABLE - m_stats.swap(other.m_stats); -#endif -} - -template -HashTable& -HashTable:: -operator=(const HashTable& other) { - HashTable tmp(other); - swap(tmp); - return *this; -} - -// iterator adapters - -template -struct HashTableConstIteratorAdapter { - HashTableConstIteratorAdapter() {} - HashTableConstIteratorAdapter( - const typename HashTableType::const_iterator& impl) - : m_impl(impl) {} - typedef typename Traits::IteratorConstGetType GetType; - typedef - typename HashTableType::ValueTraits::IteratorConstGetType SourceGetType; - - GetType get() const { - return const_cast(SourceGetType(m_impl.get())); - } - typename Traits::IteratorConstReferenceType operator*() const { - return Traits::getToReferenceConstConversion(get()); - } - GetType operator->() const { return get(); } - - HashTableConstIteratorAdapter& operator++() { - ++m_impl; - return *this; - } - // postfix ++ intentionally omitted - - typename HashTableType::const_iterator m_impl; -}; - -template -struct HashTableIteratorAdapter { - typedef typename Traits::IteratorGetType GetType; - typedef typename HashTableType::ValueTraits::IteratorGetType SourceGetType; - - HashTableIteratorAdapter() {} - HashTableIteratorAdapter(const typename HashTableType::iterator& impl) - : m_impl(impl) {} - - GetType get() const { - return const_cast(SourceGetType(m_impl.get())); - } - typename Traits::IteratorReferenceType operator*() const { - return Traits::getToReferenceConversion(get()); - } - GetType operator->() const { return get(); } - - HashTableIteratorAdapter& operator++() { - ++m_impl; - return *this; - } - // postfix ++ intentionally omitted - - operator HashTableConstIteratorAdapter() { - typename HashTableType::const_iterator i = m_impl; - return i; - } - - typename HashTableType::iterator m_impl; -}; - -template -inline bool operator==(const HashTableConstIteratorAdapter& a, - const HashTableConstIteratorAdapter& b) { - return a.m_impl == b.m_impl; -} - -template -inline bool operator!=(const HashTableConstIteratorAdapter& a, - const HashTableConstIteratorAdapter& b) { - return a.m_impl != b.m_impl; -} - -template -inline bool operator==(const HashTableIteratorAdapter& a, - const HashTableIteratorAdapter& b) { - return a.m_impl == b.m_impl; -} - -template -inline bool operator!=(const HashTableIteratorAdapter& a, - const HashTableIteratorAdapter& b) { - return a.m_impl != b.m_impl; -} - -// All 4 combinations of ==, != and Const,non const. -template -inline bool operator==(const HashTableConstIteratorAdapter& a, - const HashTableIteratorAdapter& b) { - return a.m_impl == b.m_impl; -} - -template -inline bool operator!=(const HashTableConstIteratorAdapter& a, - const HashTableIteratorAdapter& b) { - return a.m_impl != b.m_impl; -} - -template -inline bool operator==(const HashTableIteratorAdapter& a, - const HashTableConstIteratorAdapter& b) { - return a.m_impl == b.m_impl; -} - -template -inline bool operator!=(const HashTableIteratorAdapter& a, - const HashTableConstIteratorAdapter& b) { - return a.m_impl != b.m_impl; -} - -template -inline void removeAll(Collection1& collection, const Collection2& toBeRemoved) { - if (collection.isEmpty() || toBeRemoved.isEmpty()) - return; - typedef typename Collection2::const_iterator CollectionIterator; - CollectionIterator end(toBeRemoved.end()); - for (CollectionIterator it(toBeRemoved.begin()); it != end; ++it) - collection.remove(*it); -} - -} // namespace WTF - -#include "flutter/sky/engine/wtf/HashIterators.h" - -#endif // SKY_ENGINE_WTF_HASHTABLE_H_ diff --git a/sky/engine/wtf/HashTableDeletedValueType.h b/sky/engine/wtf/HashTableDeletedValueType.h deleted file mode 100644 index 91a4881e80251..0000000000000 --- a/sky/engine/wtf/HashTableDeletedValueType.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_HASHTABLEDELETEDVALUETYPE_H_ -#define SKY_ENGINE_WTF_HASHTABLEDELETEDVALUETYPE_H_ - -namespace WTF { - -enum HashTableDeletedValueType { HashTableDeletedValue }; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_HASHTABLEDELETEDVALUETYPE_H_ diff --git a/sky/engine/wtf/HashTraits.h b/sky/engine/wtf/HashTraits.h deleted file mode 100644 index 4b668a55bbcb3..0000000000000 --- a/sky/engine/wtf/HashTraits.h +++ /dev/null @@ -1,419 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_HASHTRAITS_H_ -#define SKY_ENGINE_WTF_HASHTRAITS_H_ - -#include // For memset. -#include -#include -#include "flutter/sky/engine/wtf/HashFunctions.h" -#include "flutter/sky/engine/wtf/HashTableDeletedValueType.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/TypeTraits.h" - -namespace WTF { - -class String; - -template -class OwnPtr; -template -class PassOwnPtr; - -template -struct HashTraits; - -template -struct GenericHashTraitsBase; - -enum ShouldWeakPointersBeMarkedStrongly { - WeakPointersActStrong, - WeakPointersActWeak -}; - -template -struct GenericHashTraitsBase { - // The emptyValueIsZero flag is used to optimize allocation of empty hash - // tables with zeroed memory. - static const bool emptyValueIsZero = false; - - // The hasIsEmptyValueFunction flag allows the hash table to automatically - // generate code to check for the empty value when it can be done with the - // equality operator, but allows custom functions for cases like String that - // need them. - static const bool hasIsEmptyValueFunction = false; - - // The needsDestruction flag is used to optimize destruction and rehashing. - static const bool needsDestruction = true; - - // The starting table size. Can be overridden when we know beforehand that - // a hash table will have at least N entries. -#if defined(MEMORY_SANITIZER_INITIAL_SIZE) - static const unsigned minimumTableSize = 1; -#else - static const unsigned minimumTableSize = 8; -#endif - static const WeakHandlingFlag weakHandlingFlag = - IsWeak::value ? WeakHandlingInCollections - : NoWeakHandlingInCollections; -}; - -// Default integer traits disallow both 0 and -1 as keys (max value instead of -// -1 for unsigned). -template -struct GenericHashTraitsBase : GenericHashTraitsBase { - static const bool emptyValueIsZero = true; - static const bool needsDestruction = false; - static void constructDeletedValue(T& slot, bool) { - slot = static_cast(-1); - } - static bool isDeletedValue(T value) { return value == static_cast(-1); } -}; - -template -struct GenericHashTraits : GenericHashTraitsBase::value, T> { - typedef T TraitType; - typedef T EmptyValueType; - - static T emptyValue() { return T(); } - - // Type for functions that do not take ownership, such as contains. - typedef const T& PeekInType; - typedef T* IteratorGetType; - typedef const T* IteratorConstGetType; - typedef T& IteratorReferenceType; - typedef const T& IteratorConstReferenceType; - static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { - return *x; - } - static IteratorConstReferenceType getToReferenceConstConversion( - IteratorConstGetType x) { - return *x; - } - // Type for functions that take ownership, such as add. - // The store function either not be called or called once to store something - // passed in. The value passed to the store function will be PassInType. - typedef const T& PassInType; - static void store(const T& value, T& storage) { storage = value; } - - // Type for return value of functions that transfer ownership, such as take. - typedef T PassOutType; - static const T& passOut(const T& value) { return value; } - - // Type for return value of functions that do not transfer ownership, such as - // get. - // FIXME: We could change this type to const T& for better performance if we - // figured out a way to handle the return value from emptyValue, which is a - // temporary. - typedef T PeekOutType; - static const T& peek(const T& value) { return value; } -}; - -template -struct HashTraits : GenericHashTraits {}; - -template -struct FloatHashTraits : GenericHashTraits { - static const bool needsDestruction = false; - static T emptyValue() { return std::numeric_limits::infinity(); } - static void constructDeletedValue(T& slot, bool) { - slot = -std::numeric_limits::infinity(); - } - static bool isDeletedValue(T value) { - return value == -std::numeric_limits::infinity(); - } -}; - -template <> -struct HashTraits : FloatHashTraits {}; -template <> -struct HashTraits : FloatHashTraits {}; - -// Default unsigned traits disallow both 0 and max as keys -- use these traits -// to allow zero and disallow max - 1. -template -struct UnsignedWithZeroKeyHashTraits : GenericHashTraits { - static const bool emptyValueIsZero = false; - static const bool needsDestruction = false; - static T emptyValue() { return std::numeric_limits::max(); } - static void constructDeletedValue(T& slot, bool) { - slot = std::numeric_limits::max() - 1; - } - static bool isDeletedValue(T value) { - return value == std::numeric_limits::max() - 1; - } -}; - -template -struct HashTraits : GenericHashTraits { - static const bool emptyValueIsZero = true; - static const bool needsDestruction = false; - static void constructDeletedValue(P*& slot, bool) { - slot = reinterpret_cast(-1); - } - static bool isDeletedValue(P* value) { - return value == reinterpret_cast(-1); - } -}; - -template -struct SimpleClassHashTraits : GenericHashTraits { - static const bool emptyValueIsZero = true; - static void constructDeletedValue(T& slot, bool) { - new (NotNull, &slot) T(HashTableDeletedValue); - } - static bool isDeletedValue(const T& value) { - return value.isHashTableDeletedValue(); - } -}; - -template -struct HashTraits> : SimpleClassHashTraits> { - typedef std::nullptr_t EmptyValueType; - - static EmptyValueType emptyValue() { return nullptr; } - - static const bool hasIsEmptyValueFunction = true; - static bool isEmptyValue(const OwnPtr

& value) { return !value; } - - typedef typename OwnPtr

::PtrType PeekInType; - - typedef PassOwnPtr

PassInType; - static void store(PassOwnPtr

value, OwnPtr

& storage) { - storage = value; - } - - typedef PassOwnPtr

PassOutType; - static PassOwnPtr

passOut(OwnPtr

& value) { return value.release(); } - static PassOwnPtr

passOut(std::nullptr_t) { return nullptr; } - - typedef typename OwnPtr

::PtrType PeekOutType; - static PeekOutType peek(const OwnPtr

& value) { return value.get(); } - static PeekOutType peek(std::nullptr_t) { return 0; } -}; - -template -struct HashTraits> : SimpleClassHashTraits> { - typedef std::nullptr_t EmptyValueType; - static EmptyValueType emptyValue() { return nullptr; } - - static const bool hasIsEmptyValueFunction = true; - static bool isEmptyValue(const RefPtr

& value) { return !value; } - - typedef RefPtrValuePeeker

PeekInType; - typedef RefPtr

* IteratorGetType; - typedef const RefPtr

* IteratorConstGetType; - typedef RefPtr

& IteratorReferenceType; - typedef const RefPtr

& IteratorConstReferenceType; - static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { - return *x; - } - static IteratorConstReferenceType getToReferenceConstConversion( - IteratorConstGetType x) { - return *x; - } - - typedef PassRefPtr

PassInType; - static void store(PassRefPtr

value, RefPtr

& storage) { - storage = value; - } - - typedef PassRefPtr

PassOutType; - static PassOutType passOut(RefPtr

& value) { return value.release(); } - static PassOutType passOut(std::nullptr_t) { return nullptr; } - - typedef P* PeekOutType; - static PeekOutType peek(const RefPtr

& value) { return value.get(); } - static PeekOutType peek(std::nullptr_t) { return 0; } -}; - -template -struct HashTraits> : HashTraits {}; - -template <> -struct HashTraits : SimpleClassHashTraits { - static const bool hasIsEmptyValueFunction = true; - static bool isEmptyValue(const String&); -}; - -// This struct template is an implementation detail of the -// isHashTraitsEmptyValue function, which selects either the emptyValue function -// or the isEmptyValue function to check for empty values. -template -struct HashTraitsEmptyValueChecker; -template -struct HashTraitsEmptyValueChecker { - template - static bool isEmptyValue(const T& value) { - return Traits::isEmptyValue(value); - } -}; -template -struct HashTraitsEmptyValueChecker { - template - static bool isEmptyValue(const T& value) { - return value == Traits::emptyValue(); - } -}; -template -inline bool isHashTraitsEmptyValue(const T& value) { - return HashTraitsEmptyValueChecker< - Traits, Traits::hasIsEmptyValueFunction>::isEmptyValue(value); -} - -template -struct PairHashTraits - : GenericHashTraits> { - typedef FirstTraitsArg FirstTraits; - typedef SecondTraitsArg SecondTraits; - typedef std::pair - TraitType; - typedef std::pair - EmptyValueType; - - static const bool emptyValueIsZero = - FirstTraits::emptyValueIsZero && SecondTraits::emptyValueIsZero; - static EmptyValueType emptyValue() { - return std::make_pair(FirstTraits::emptyValue(), - SecondTraits::emptyValue()); - } - - static const bool needsDestruction = - FirstTraits::needsDestruction || SecondTraits::needsDestruction; - - static const unsigned minimumTableSize = FirstTraits::minimumTableSize; - - static void constructDeletedValue(TraitType& slot, bool zeroValue) { - FirstTraits::constructDeletedValue(slot.first, zeroValue); - // For GC collections the memory for the backing is zeroed when it - // is allocated, and the constructors may take advantage of that, - // especially if a GC occurs during insertion of an entry into the - // table. This slot is being marked deleted, but If the slot is - // reused at a later point, the same assumptions around memory - // zeroing must hold as they did at the initial allocation. - // Therefore we zero the value part of the slot here for GC - // collections. - if (zeroValue) - memset(reinterpret_cast(&slot.second), 0, sizeof(slot.second)); - } - static bool isDeletedValue(const TraitType& value) { - return FirstTraits::isDeletedValue(value.first); - } -}; - -template -struct HashTraits> - : public PairHashTraits, HashTraits> {}; - -template -struct KeyValuePair { - typedef KeyTypeArg KeyType; - - KeyValuePair() {} - - KeyValuePair(const KeyTypeArg& _key, const ValueTypeArg& _value) - : key(_key), value(_value) {} - - template - KeyValuePair(const KeyValuePair& other) - : key(other.key), value(other.value) {} - - KeyTypeArg key; - ValueTypeArg value; -}; - -template -struct KeyValuePairHashTraits - : GenericHashTraits> { - typedef KeyTraitsArg KeyTraits; - typedef ValueTraitsArg ValueTraits; - typedef KeyValuePair - TraitType; - typedef KeyValuePair - EmptyValueType; - - static const bool emptyValueIsZero = - KeyTraits::emptyValueIsZero && ValueTraits::emptyValueIsZero; - static EmptyValueType emptyValue() { - return KeyValuePair( - KeyTraits::emptyValue(), ValueTraits::emptyValue()); - } - - static const bool needsDestruction = - KeyTraits::needsDestruction || ValueTraits::needsDestruction; - static const WeakHandlingFlag weakHandlingFlag = - (KeyTraits::weakHandlingFlag == WeakHandlingInCollections || - ValueTraits::weakHandlingFlag == WeakHandlingInCollections) - ? WeakHandlingInCollections - : NoWeakHandlingInCollections; - - static const unsigned minimumTableSize = KeyTraits::minimumTableSize; - - static void constructDeletedValue(TraitType& slot, bool zeroValue) { - KeyTraits::constructDeletedValue(slot.key, zeroValue); - // See similar code in this file for why we need to do this. - if (zeroValue) - memset(reinterpret_cast(&slot.value), 0, sizeof(slot.value)); - } - static bool isDeletedValue(const TraitType& value) { - return KeyTraits::isDeletedValue(value.key); - } -}; - -template -struct HashTraits> - : public KeyValuePairHashTraits, HashTraits> {}; - -template -struct NullableHashTraits : public HashTraits { - static const bool emptyValueIsZero = false; - static T emptyValue() { return reinterpret_cast(1); } -}; - -// This is for tracing inside collections that have special support for weak -// pointers. The trait has a trace method which returns true if there are weak -// pointers to things that have not (yet) been marked live. Returning true -// indicates that the entry in the collection may yet be removed by weak -// handling. Default implementation for non-weak types is to use the regular -// non-weak TraceTrait. Default implementation for types with weakness is to -// call traceInCollection on the type's trait. -template -struct TraceInCollectionTrait; - -} // namespace WTF - -using WTF::HashTraits; -using WTF::NullableHashTraits; -using WTF::PairHashTraits; -using WTF::SimpleClassHashTraits; - -#endif // SKY_ENGINE_WTF_HASHTRAITS_H_ diff --git a/sky/engine/wtf/HexNumber.h b/sky/engine/wtf/HexNumber.h deleted file mode 100644 index 39fc0c3576017..0000000000000 --- a/sky/engine/wtf/HexNumber.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2011 Research In Motion Limited. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SKY_ENGINE_WTF_HEXNUMBER_H_ -#define SKY_ENGINE_WTF_HEXNUMBER_H_ - -#include "flutter/sky/engine/wtf/text/StringConcatenate.h" - -namespace WTF { - -enum HexConversionMode { Lowercase, Uppercase }; - -namespace Internal { - -const LChar lowerHexDigits[17] = "0123456789abcdef"; -const LChar upperHexDigits[17] = "0123456789ABCDEF"; -inline const LChar* hexDigitsForMode(HexConversionMode mode) { - return mode == Lowercase ? lowerHexDigits : upperHexDigits; -} - -}; // namespace Internal - -template -inline void appendByteAsHex(unsigned char byte, - T& destination, - HexConversionMode mode = Uppercase) { - const LChar* hexDigits = Internal::hexDigitsForMode(mode); - destination.append(hexDigits[byte >> 4]); - destination.append(hexDigits[byte & 0xF]); -} - -template -inline void placeByteAsHexCompressIfPossible( - unsigned char byte, - T& destination, - unsigned& index, - HexConversionMode mode = Uppercase) { - const LChar* hexDigits = Internal::hexDigitsForMode(mode); - if (byte >= 0x10) - destination[index++] = hexDigits[byte >> 4]; - destination[index++] = hexDigits[byte & 0xF]; -} - -template -inline void placeByteAsHex(unsigned char byte, - T& destination, - HexConversionMode mode = Uppercase) { - const LChar* hexDigits = Internal::hexDigitsForMode(mode); - *destination++ = hexDigits[byte >> 4]; - *destination++ = hexDigits[byte & 0xF]; -} - -template -inline void appendUnsignedAsHex(unsigned number, - T& destination, - HexConversionMode mode = Uppercase) { - const LChar* hexDigits = Internal::hexDigitsForMode(mode); - Vector result; - do { - result.prepend(hexDigits[number % 16]); - number >>= 4; - } while (number > 0); - - destination.append(result.data(), result.size()); -} - -// Same as appendUnsignedAsHex, but using exactly 'desiredDigits' for the -// conversion. -template -inline void appendUnsignedAsHexFixedSize(unsigned number, - T& destination, - unsigned desiredDigits, - HexConversionMode mode = Uppercase) { - ASSERT(desiredDigits); - - const LChar* hexDigits = Internal::hexDigitsForMode(mode); - Vector result; - do { - result.prepend(hexDigits[number % 16]); - number >>= 4; - } while (result.size() < desiredDigits); - - ASSERT(result.size() == desiredDigits); - destination.append(result.data(), result.size()); -} - -} // namespace WTF - -using WTF::Lowercase; -using WTF::appendByteAsHex; -using WTF::appendUnsignedAsHex; -using WTF::appendUnsignedAsHexFixedSize; -using WTF::placeByteAsHex; -using WTF::placeByteAsHexCompressIfPossible; - -#endif // SKY_ENGINE_WTF_HEXNUMBER_H_ diff --git a/sky/engine/wtf/InstanceCounter.cpp b/sky/engine/wtf/InstanceCounter.cpp deleted file mode 100644 index 50ad7b3ae9faa..0000000000000 --- a/sky/engine/wtf/InstanceCounter.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/InstanceCounter.h" - -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/ThreadingPrimitives.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -#if ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING) - -#if COMPILER(CLANG) -const size_t extractNameFunctionPrefixLength = - sizeof("const char *WTF::extractNameFunction() [T = ") - 1; -const size_t extractNameFunctionPostfixLength = sizeof("]") - 1; -#elif COMPILER(GCC) -const size_t extractNameFunctionPrefixLength = - sizeof("const char* WTF::extractNameFunction() [with T = ") - 1; -const size_t extractNameFunctionPostfixLength = sizeof("]") - 1; -#else -#warning \ - "Extracting typename is supported only in compiler GCC, CLANG and MSVC at this moment" -#endif - -// This function is used to stringify a typename T without using RTTI. -// The result of extractNameFunction() is given as |funcName|. -// |extractTypeNameFromFunctionName| then extracts a typename string from -// |funcName|. -String extractTypeNameFromFunctionName(const char* funcName) { -#if COMPILER(CLANG) || COMPILER(GCC) - size_t funcNameLength = strlen(funcName); - ASSERT(funcNameLength > - extractNameFunctionPrefixLength + extractNameFunctionPostfixLength); - - const char* funcNameWithoutPrefix = - funcName + extractNameFunctionPrefixLength; - return String(funcNameWithoutPrefix, funcNameLength - - extractNameFunctionPrefixLength - - extractNameFunctionPostfixLength); -#else - return String("unknown"); -#endif -} - -class InstanceCounter { - public: - void incrementInstanceCount(const String& instanceName, void* ptr); - void decrementInstanceCount(const String& instanceName, void* ptr); - String dump(); - - static InstanceCounter* instance() { - DEFINE_STATIC_LOCAL(InstanceCounter, self, ()); - return &self; - } - - private: - InstanceCounter() {} - - Mutex m_mutex; - HashMap m_counterMap; -}; - -void incrementInstanceCount(const char* extractNameFunctionName, void* ptr) { - String instanceName = - extractTypeNameFromFunctionName(extractNameFunctionName); - InstanceCounter::instance()->incrementInstanceCount(instanceName, ptr); -} - -void decrementInstanceCount(const char* extractNameFunctionName, void* ptr) { - String instanceName = - extractTypeNameFromFunctionName(extractNameFunctionName); - InstanceCounter::instance()->decrementInstanceCount(instanceName, ptr); -} - -String dumpRefCountedInstanceCounts() { - return InstanceCounter::instance()->dump(); -} - -void InstanceCounter::incrementInstanceCount(const String& instanceName, - void* ptr) { - MutexLocker locker(m_mutex); - HashMap::AddResult result = m_counterMap.add(instanceName, 1); - if (!result.isNewEntry) - ++(result.storedValue->value); -} - -void InstanceCounter::decrementInstanceCount(const String& instanceName, - void* ptr) { - MutexLocker locker(m_mutex); - HashMap::iterator it = m_counterMap.find(instanceName); - ASSERT(it != m_counterMap.end()); - - --(it->value); - if (!it->value) - m_counterMap.remove(it); -} - -String InstanceCounter::dump() { - MutexLocker locker(m_mutex); - - StringBuilder builder; - - builder.append("{"); - HashMap::iterator it = m_counterMap.begin(); - HashMap::iterator itEnd = m_counterMap.end(); - for (; it != itEnd; ++it) { - if (it != m_counterMap.begin()) - builder.append(","); - builder.append("\""); - builder.append(it->key); - builder.append("\": "); - builder.append(String::number(it->value)); - } - builder.append("}"); - - return builder.toString(); -} - -#else - -String dumpRefCountedInstanceCounts() { - return String("{}"); -} - -#endif // ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING) - -} // namespace WTF diff --git a/sky/engine/wtf/InstanceCounter.h b/sky/engine/wtf/InstanceCounter.h deleted file mode 100644 index cc1fd530244a1..0000000000000 --- a/sky/engine/wtf/InstanceCounter.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_INSTANCECOUNTER_H_ -#define SKY_ENGINE_WTF_INSTANCECOUNTER_H_ - -#include "flutter/sky/engine/wtf/Compiler.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -class String; -WTF_EXPORT String dumpRefCountedInstanceCounts(); - -#if ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING) -WTF_EXPORT void incrementInstanceCount(const char* extractNameFunctionName, - void* ptr); -WTF_EXPORT void decrementInstanceCount(const char* extractNameFunctionName, - void* ptr); - -WTF_EXPORT String extractTypeNameFromFunctionName(const char* funcName); - -template -inline const char* extractNameFunction() { - return WTF_PRETTY_FUNCTION; -} - -template -inline void incrementInstanceCount(T* p) { - incrementInstanceCount(extractNameFunction(), p); -} - -template -inline void decrementInstanceCount(T* p) { - decrementInstanceCount(extractNameFunction(), p); -} - -#endif // ENABLE(INSTANCE_COUNTER) || ENABLE(GC_PROFILING) - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_INSTANCECOUNTER_H_ diff --git a/sky/engine/wtf/LeakAnnotations.h b/sky/engine/wtf/LeakAnnotations.h deleted file mode 100644 index 269f2e1bbb224..0000000000000 --- a/sky/engine/wtf/LeakAnnotations.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * Copyright (C) 2013 Samsung Electronics. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_LEAKANNOTATIONS_H_ -#define SKY_ENGINE_WTF_LEAKANNOTATIONS_H_ - -// This file defines macros which can be used to annotate intentional memory -// leaks. Support for annotations is implemented in HeapChecker and -// LeakSanitizer. Annotated objects will be treated as a source of live -// pointers, i.e. any heap objects reachable by following pointers from an -// annotated object will not be reported as leaks. -// -// WTF_ANNOTATE_SCOPED_MEMORY_LEAK: all allocations made in the current scope -// will be annotated as leaks. -// WTF_ANNOTATE_LEAKING_OBJECT_PTR(X): the heap object referenced by pointer X -// will be annotated as a leak. -// -// Note that HeapChecker will report a fatal error if an object which has been -// annotated with ANNOTATE_LEAKING_OBJECT_PTR is later deleted (but -// LeakSanitizer won't). - -#include "flutter/sky/engine/wtf/Noncopyable.h" - -namespace WTF { - -#if USE(LEAK_SANITIZER) -extern "C" { -void __lsan_disable(); -void __lsan_enable(); -void __lsan_ignore_object(const void* p); -} // extern "C" - -class LeakSanitizerDisabler { - WTF_MAKE_NONCOPYABLE(LeakSanitizerDisabler); - - public: - LeakSanitizerDisabler() { __lsan_disable(); } - - ~LeakSanitizerDisabler() { __lsan_enable(); } -}; - -#define WTF_ANNOTATE_SCOPED_MEMORY_LEAK \ - WTF::LeakSanitizerDisabler leakSanitizerDisabler; \ - static_cast(0) - -#define WTF_ANNOTATE_LEAKING_OBJECT_PTR(X) WTF::__lsan_ignore_object(X) - -#else // USE(LEAK_SANITIZER) - -// If Leak Sanitizer is not being used, the annotations should be no-ops. -#define WTF_ANNOTATE_SCOPED_MEMORY_LEAK -#define WTF_ANNOTATE_LEAKING_OBJECT_PTR(X) - -#endif // USE(LEAK_SANITIZER) - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_LEAKANNOTATIONS_H_ diff --git a/sky/engine/wtf/LinkedHashSet.h b/sky/engine/wtf/LinkedHashSet.h deleted file mode 100644 index a6c0d792ad886..0000000000000 --- a/sky/engine/wtf/LinkedHashSet.h +++ /dev/null @@ -1,820 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. - * All rights reserved. - * Copyright (C) 2011, Benjamin Poulain - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_LINKEDHASHSET_H_ -#define SKY_ENGINE_WTF_LINKEDHASHSET_H_ - -#include "flutter/sky/engine/wtf/DefaultAllocator.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -namespace WTF { - -// LinkedHashSet: Just like HashSet, this class provides a Set -// interface - a collection of unique objects with O(1) insertion, -// removal and test for containership. However, it also has an -// order - iterating it will always give back values in the order -// in which they are added. - -// Unlike ListHashSet, but like most WTF collections, iteration is NOT safe -// against mutation of the LinkedHashSet. - -template -class LinkedHashSet; - -template -class LinkedHashSetIterator; -template -class LinkedHashSetConstIterator; -template -class LinkedHashSetReverseIterator; -template -class LinkedHashSetConstReverseIterator; - -template -struct LinkedHashSetTranslator; -template -struct LinkedHashSetExtractor; -template -struct LinkedHashSetTraits; - -class LinkedHashSetNodeBase { - public: - LinkedHashSetNodeBase() : m_prev(this), m_next(this) {} - - void unlink() { - if (!m_next) - return; - ASSERT(m_prev); - ASSERT(m_next->m_prev == this); - ASSERT(m_prev->m_next == this); - m_next->m_prev = m_prev; - m_prev->m_next = m_next; - } - - ~LinkedHashSetNodeBase() { unlink(); } - - void insertBefore(LinkedHashSetNodeBase& other) { - other.m_next = this; - other.m_prev = m_prev; - m_prev->m_next = &other; - m_prev = &other; - ASSERT(other.m_next); - ASSERT(other.m_prev); - ASSERT(m_next); - ASSERT(m_prev); - } - - void insertAfter(LinkedHashSetNodeBase& other) { - other.m_prev = this; - other.m_next = m_next; - m_next->m_prev = &other; - m_next = &other; - ASSERT(other.m_next); - ASSERT(other.m_prev); - ASSERT(m_next); - ASSERT(m_prev); - } - - LinkedHashSetNodeBase(LinkedHashSetNodeBase* prev, - LinkedHashSetNodeBase* next) - : m_prev(prev), m_next(next) { - ASSERT((prev && next) || (!prev && !next)); - } - - LinkedHashSetNodeBase* m_prev; - LinkedHashSetNodeBase* m_next; - - protected: - // If we take a copy of a node we can't copy the next and prev pointers, - // since they point to something that does not point at us. This is used - // inside the shouldExpand() "if" in HashTable::add. - LinkedHashSetNodeBase(const LinkedHashSetNodeBase& other) - : m_prev(0), m_next(0) {} - - private: - // Should not be used. - LinkedHashSetNodeBase& operator=(const LinkedHashSetNodeBase& other); -}; - -template -class LinkedHashSetNode : public LinkedHashSetNodeBase { - public: - LinkedHashSetNode(const ValueArg& value, - LinkedHashSetNodeBase* prev, - LinkedHashSetNodeBase* next) - : LinkedHashSetNodeBase(prev, next), m_value(value) {} - - ValueArg m_value; - - private: - // Not used. - LinkedHashSetNode(const LinkedHashSetNode&); -}; - -template ::Hash, - typename TraitsArg = HashTraits, - typename Allocator = DefaultAllocator> -class LinkedHashSet { - WTF_USE_ALLOCATOR(LinkedHashSet, Allocator); - - private: - typedef ValueArg Value; - typedef TraitsArg Traits; - typedef LinkedHashSetNode Node; - typedef LinkedHashSetNodeBase NodeBase; - typedef LinkedHashSetTranslator - NodeHashFunctions; - typedef LinkedHashSetTraits NodeHashTraits; - - typedef HashTable - ImplType; - - public: - typedef LinkedHashSetIterator iterator; - friend class LinkedHashSetIterator; - typedef LinkedHashSetConstIterator const_iterator; - friend class LinkedHashSetConstIterator; - - typedef LinkedHashSetReverseIterator reverse_iterator; - friend class LinkedHashSetReverseIterator; - typedef LinkedHashSetConstReverseIterator - const_reverse_iterator; - friend class LinkedHashSetConstReverseIterator; - - struct AddResult { - AddResult(const typename ImplType::AddResult& hashTableAddResult) - : storedValue(&hashTableAddResult.storedValue->m_value), - isNewEntry(hashTableAddResult.isNewEntry) {} - - Value* storedValue; - bool isNewEntry; - }; - - typedef typename HashTraits::PeekInType ValuePeekInType; - - LinkedHashSet(); - LinkedHashSet(const LinkedHashSet&); - LinkedHashSet& operator=(const LinkedHashSet&); - - // Needs finalization. The anchor needs to unlink itself from the chain. - ~LinkedHashSet(); - - static void finalize(void* pointer) { - reinterpret_cast(pointer)->~LinkedHashSet(); - } - - void swap(LinkedHashSet&); - - unsigned size() const { return m_impl.size(); } - unsigned capacity() const { return m_impl.capacity(); } - bool isEmpty() const { return m_impl.isEmpty(); } - - iterator begin() { return makeIterator(firstNode()); } - iterator end() { return makeIterator(anchor()); } - const_iterator begin() const { return makeConstIterator(firstNode()); } - const_iterator end() const { return makeConstIterator(anchor()); } - - reverse_iterator rbegin() { return makeReverseIterator(lastNode()); } - reverse_iterator rend() { return makeReverseIterator(anchor()); } - const_reverse_iterator rbegin() const { - return makeConstReverseIterator(lastNode()); - } - const_reverse_iterator rend() const { - return makeConstReverseIterator(anchor()); - } - - Value& first(); - const Value& first() const; - void removeFirst(); - - Value& last(); - const Value& last() const; - void removeLast(); - - iterator find(ValuePeekInType); - const_iterator find(ValuePeekInType) const; - bool contains(ValuePeekInType) const; - - // An alternate version of find() that finds the object by hashing and - // comparing with some other type, to avoid the cost of type conversion. The - // HashTranslator interface is defined in HashSet. - template - iterator find(const T&); - template - const_iterator find(const T&) const; - template - bool contains(const T&) const; - - // The return value of add is a pair of a pointer to the stored value, - // and a bool that is true if an new entry was added. - AddResult add(ValuePeekInType); - - // Same as add() except that the return value is an - // iterator. Useful in cases where it's needed to have the - // same return value as find() and where it's not possible to - // use a pointer to the storedValue. - iterator addReturnIterator(ValuePeekInType); - - // Add the value to the end of the collection. If the value was already in - // the list, it is moved to the end. - AddResult appendOrMoveToLast(ValuePeekInType); - - // Add the value to the beginning of the collection. If the value was already - // in the list, it is moved to the beginning. - AddResult prependOrMoveToFirst(ValuePeekInType); - - AddResult insertBefore(ValuePeekInType beforeValue, ValuePeekInType newValue); - AddResult insertBefore(iterator it, ValuePeekInType newValue) { - return m_impl.template add(newValue, it.node()); - } - - void remove(ValuePeekInType); - void remove(iterator); - void clear() { m_impl.clear(); } - template - void removeAll(const Collection& other) { - WTF::removeAll(*this, other); - } - - int64_t modifications() const { return m_impl.modifications(); } - void checkModifications(int64_t mods) const { - m_impl.checkModifications(mods); - } - - private: - Node* anchor() { return reinterpret_cast(&m_anchor); } - const Node* anchor() const { - return reinterpret_cast(&m_anchor); - } - Node* firstNode() { return reinterpret_cast(m_anchor.m_next); } - const Node* firstNode() const { - return reinterpret_cast(m_anchor.m_next); - } - Node* lastNode() { return reinterpret_cast(m_anchor.m_prev); } - const Node* lastNode() const { - return reinterpret_cast(m_anchor.m_prev); - } - - iterator makeIterator(const Node* position) { - return iterator(position, this); - } - const_iterator makeConstIterator(const Node* position) const { - return const_iterator(position, this); - } - reverse_iterator makeReverseIterator(const Node* position) { - return reverse_iterator(position, this); - } - const_reverse_iterator makeConstReverseIterator(const Node* position) const { - return const_reverse_iterator(position, this); - } - - ImplType m_impl; - NodeBase m_anchor; -}; - -template -struct LinkedHashSetTranslator { - typedef LinkedHashSetNode Node; - typedef LinkedHashSetNodeBase NodeBase; - typedef typename HashTraits::PeekInType ValuePeekInType; - static unsigned hash(const Node& node) { - return HashFunctions::hash(node.m_value); - } - static unsigned hash(const ValuePeekInType& key) { - return HashFunctions::hash(key); - } - static bool equal(const Node& a, const ValuePeekInType& b) { - return HashFunctions::equal(a.m_value, b); - } - static bool equal(const Node& a, const Node& b) { - return HashFunctions::equal(a.m_value, b.m_value); - } - static void translate(Node& location, ValuePeekInType key, NodeBase* anchor) { - anchor->insertBefore(location); - location.m_value = key; - } - - // Empty (or deleted) slots have the m_next pointer set to null, but we - // don't do anything to the other fields, which may contain junk. - // Therefore you can't compare a newly constructed empty value with a - // slot and get the right answer. - static const bool safeToCompareToEmptyOrDeleted = false; -}; - -template -struct LinkedHashSetExtractor { - static const Value& extract(const LinkedHashSetNode& node) { - return node.m_value; - } -}; - -template -struct LinkedHashSetTraits - : public SimpleClassHashTraits> { - typedef LinkedHashSetNode Node; - typedef ValueTraitsArg ValueTraits; - - // The slot is empty when the m_next field is zero so it's safe to zero - // the backing. - static const bool emptyValueIsZero = true; - - static const bool hasIsEmptyValueFunction = true; - static bool isEmptyValue(const Node& node) { return !node.m_next; } - - static const int deletedValue = -1; - - static void constructDeletedValue(Node& slot, bool) { - slot.m_next = reinterpret_cast(deletedValue); - } - static bool isDeletedValue(const Node& slot) { - return slot.m_next == reinterpret_cast(deletedValue); - } - - // We always need to call destructors, that's how we get linked and - // unlinked from the chain. - static const bool needsDestruction = true; - - // Whether we need to trace and do weak processing depends on the traits of - // the type inside the node. - template - struct NeedsTracingLazily { - static const bool value = ValueTraits::template NeedsTracingLazily<>::value; - }; - static const WeakHandlingFlag weakHandlingFlag = - ValueTraits::weakHandlingFlag; -}; - -template -class LinkedHashSetIterator { - private: - typedef typename LinkedHashSetType::Node Node; - typedef typename LinkedHashSetType::Traits Traits; - - typedef typename LinkedHashSetType::Value& ReferenceType; - typedef typename LinkedHashSetType::Value* PointerType; - - typedef LinkedHashSetConstIterator const_iterator; - - Node* node() { return const_cast(m_iterator.node()); } - - protected: - LinkedHashSetIterator(const Node* position, LinkedHashSetType* m_container) - : m_iterator(position, m_container) {} - - public: - // Default copy, assignment and destructor are OK. - - PointerType get() const { return const_cast(m_iterator.get()); } - ReferenceType operator*() const { return *get(); } - PointerType operator->() const { return get(); } - - LinkedHashSetIterator& operator++() { - ++m_iterator; - return *this; - } - LinkedHashSetIterator& operator--() { - --m_iterator; - return *this; - } - - // Postfix ++ and -- intentionally omitted. - - // Comparison. - bool operator==(const LinkedHashSetIterator& other) const { - return m_iterator == other.m_iterator; - } - bool operator!=(const LinkedHashSetIterator& other) const { - return m_iterator != other.m_iterator; - } - - operator const_iterator() const { return m_iterator; } - - protected: - const_iterator m_iterator; - template - friend class LinkedHashSet; -}; - -template -class LinkedHashSetConstIterator { - private: - typedef typename LinkedHashSetType::Node Node; - typedef typename LinkedHashSetType::Traits Traits; - - typedef const typename LinkedHashSetType::Value& ReferenceType; - typedef const typename LinkedHashSetType::Value* PointerType; - - const Node* node() const { return static_cast(m_position); } - - protected: - LinkedHashSetConstIterator(const LinkedHashSetNodeBase* position, - const LinkedHashSetType* container) - : m_position(position) -#if ENABLE(ASSERT) - , - m_container(container), - m_containerModifications(container->modifications()) -#endif - { - } - - public: - PointerType get() const { - checkModifications(); - return &static_cast(m_position)->m_value; - } - ReferenceType operator*() const { return *get(); } - PointerType operator->() const { return get(); } - - LinkedHashSetConstIterator& operator++() { - ASSERT(m_position); - checkModifications(); - m_position = m_position->m_next; - return *this; - } - - LinkedHashSetConstIterator& operator--() { - ASSERT(m_position); - checkModifications(); - m_position = m_position->m_prev; - return *this; - } - - // Postfix ++ and -- intentionally omitted. - - // Comparison. - bool operator==(const LinkedHashSetConstIterator& other) const { - return m_position == other.m_position; - } - bool operator!=(const LinkedHashSetConstIterator& other) const { - return m_position != other.m_position; - } - - private: - const LinkedHashSetNodeBase* m_position; -#if ENABLE(ASSERT) - void checkModifications() const { - m_container->checkModifications(m_containerModifications); - } - const LinkedHashSetType* m_container; - int64_t m_containerModifications; -#else - void checkModifications() const {} -#endif - template - friend class LinkedHashSet; - friend class LinkedHashSetIterator; -}; - -template -class LinkedHashSetReverseIterator - : public LinkedHashSetIterator { - typedef LinkedHashSetIterator Superclass; - typedef LinkedHashSetConstReverseIterator - const_reverse_iterator; - typedef typename LinkedHashSetType::Node Node; - - protected: - LinkedHashSetReverseIterator(const Node* position, - LinkedHashSetType* container) - : Superclass(position, container) {} - - public: - LinkedHashSetReverseIterator& operator++() { - Superclass::operator--(); - return *this; - } - LinkedHashSetReverseIterator& operator--() { - Superclass::operator++(); - return *this; - } - - // Postfix ++ and -- intentionally omitted. - - operator const_reverse_iterator() const { - return *reinterpret_cast(this); - } - - template - friend class LinkedHashSet; -}; - -template -class LinkedHashSetConstReverseIterator - : public LinkedHashSetConstIterator { - typedef LinkedHashSetConstIterator Superclass; - typedef typename LinkedHashSetType::Node Node; - - public: - LinkedHashSetConstReverseIterator(const Node* position, - const LinkedHashSetType* container) - : Superclass(position, container) {} - - LinkedHashSetConstReverseIterator& operator++() { - Superclass::operator--(); - return *this; - } - LinkedHashSetConstReverseIterator& operator--() { - Superclass::operator++(); - return *this; - } - - // Postfix ++ and -- intentionally omitted. - - template - friend class LinkedHashSet; -}; - -template -inline LinkedHashSet::LinkedHashSet() {} - -template -inline LinkedHashSet::LinkedHashSet(const LinkedHashSet& other) - : m_anchor() { - const_iterator end = other.end(); - for (const_iterator it = other.begin(); it != end; ++it) - add(*it); -} - -template -inline LinkedHashSet& LinkedHashSet::operator=( - const LinkedHashSet& other) { - LinkedHashSet tmp(other); - swap(tmp); - return *this; -} - -template -inline void LinkedHashSet::swap(LinkedHashSet& other) { - m_impl.swap(other.m_impl); - swapAnchor(m_anchor, other.m_anchor); -} - -template -inline LinkedHashSet::~LinkedHashSet() { - // The destructor of m_anchor will implicitly be called here, which will - // unlink the anchor from the collection. -} - -template -inline T& LinkedHashSet::first() { - ASSERT(!isEmpty()); - return firstNode()->m_value; -} - -template -inline const T& LinkedHashSet::first() const { - ASSERT(!isEmpty()); - return firstNode()->m_value; -} - -template -inline void LinkedHashSet::removeFirst() { - ASSERT(!isEmpty()); - m_impl.remove(static_cast(m_anchor.m_next)); -} - -template -inline T& LinkedHashSet::last() { - ASSERT(!isEmpty()); - return lastNode()->m_value; -} - -template -inline const T& LinkedHashSet::last() const { - ASSERT(!isEmpty()); - return lastNode()->m_value; -} - -template -inline void LinkedHashSet::removeLast() { - ASSERT(!isEmpty()); - m_impl.remove(static_cast(m_anchor.m_prev)); -} - -template -inline typename LinkedHashSet::iterator -LinkedHashSet::find(ValuePeekInType value) { - LinkedHashSet::Node* node = - m_impl.template lookup( - value); - if (!node) - return end(); - return makeIterator(node); -} - -template -inline typename LinkedHashSet::const_iterator -LinkedHashSet::find(ValuePeekInType value) const { - const LinkedHashSet::Node* node = - m_impl.template lookup( - value); - if (!node) - return end(); - return makeConstIterator(node); -} - -template -struct LinkedHashSetTranslatorAdapter { - template - static unsigned hash(const T& key) { - return Translator::hash(key); - } - template - static bool equal(const T& a, const U& b) { - return Translator::equal(a.m_value, b); - } -}; - -template -template -inline typename LinkedHashSet::iterator -LinkedHashSet::find(const T& value) { - typedef LinkedHashSetTranslatorAdapter TranslatedFunctions; - const LinkedHashSet::Node* node = - m_impl.template lookup(value); - if (!node) - return end(); - return makeIterator(node); -} - -template -template -inline typename LinkedHashSet::const_iterator -LinkedHashSet::find(const T& value) const { - typedef LinkedHashSetTranslatorAdapter TranslatedFunctions; - const LinkedHashSet::Node* node = - m_impl.template lookup(value); - if (!node) - return end(); - return makeConstIterator(node); -} - -template -template -inline bool LinkedHashSet::contains(const T& value) const { - return m_impl - .template contains>(value); -} - -template -inline bool LinkedHashSet::contains(ValuePeekInType value) const { - return m_impl.template contains(value); -} - -template -typename LinkedHashSet::AddResult -LinkedHashSet::add( - ValuePeekInType value) { - return m_impl.template add(value, &m_anchor); -} - -template -typename LinkedHashSet::iterator -LinkedHashSet::addReturnIterator(ValuePeekInType value) { - typename ImplType::AddResult result = - m_impl.template add(value, &m_anchor); - return makeIterator(result.storedValue); -} - -template -typename LinkedHashSet::AddResult -LinkedHashSet::appendOrMoveToLast(ValuePeekInType value) { - typename ImplType::AddResult result = - m_impl.template add(value, &m_anchor); - Node* node = result.storedValue; - if (!result.isNewEntry) { - node->unlink(); - m_anchor.insertBefore(*node); - } - return result; -} - -template -typename LinkedHashSet::AddResult -LinkedHashSet::prependOrMoveToFirst(ValuePeekInType value) { - typename ImplType::AddResult result = - m_impl.template add(value, m_anchor.m_next); - Node* node = result.storedValue; - if (!result.isNewEntry) { - node->unlink(); - m_anchor.insertAfter(*node); - } - return result; -} - -template -typename LinkedHashSet::AddResult -LinkedHashSet::insertBefore(ValuePeekInType beforeValue, - ValuePeekInType newValue) { - return insertBefore(find(beforeValue), newValue); -} - -template -inline void LinkedHashSet::remove(iterator it) { - if (it == end()) - return; - m_impl.remove(it.node()); -} - -template -inline void LinkedHashSet::remove(ValuePeekInType value) { - remove(find(value)); -} - -inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) { - ASSERT(a.m_prev && a.m_next && b.m_prev && b.m_next); - swap(a.m_prev, b.m_prev); - swap(a.m_next, b.m_next); - if (b.m_next == &a) { - ASSERT(b.m_prev == &a); - b.m_next = &b; - b.m_prev = &b; - } else { - b.m_next->m_prev = &b; - b.m_prev->m_next = &b; - } - if (a.m_next == &b) { - ASSERT(a.m_prev == &b); - a.m_next = &a; - a.m_prev = &a; - } else { - a.m_next->m_prev = &a; - a.m_prev->m_next = &a; - } -} - -inline void swap(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) { - ASSERT(a.m_next != &a && b.m_next != &b); - swap(a.m_prev, b.m_prev); - swap(a.m_next, b.m_next); - if (b.m_next) { - b.m_next->m_prev = &b; - b.m_prev->m_next = &b; - } - if (a.m_next) { - a.m_next->m_prev = &a; - a.m_prev->m_next = &a; - } -} - -template -inline void swap(LinkedHashSetNode& a, - LinkedHashSetNode& b) { - typedef LinkedHashSetNodeBase Base; - Allocator::enterNoAllocationScope(); - swap(static_cast(a), static_cast(b)); - swap(a.m_value, b.m_value); - Allocator::leaveNoAllocationScope(); -} - -// Warning: After and while calling this you have a collection with deleted -// pointers. Consider using a smart pointer like OwnPtr and calling clear() -// instead. -template -void deleteAllValues(const LinkedHashSet& set) { - typedef typename LinkedHashSet::const_iterator iterator; - iterator end = set.end(); - for (iterator it = set.begin(); it != end; ++it) - delete *it; -} - -} // namespace WTF - -using WTF::LinkedHashSet; - -#endif // SKY_ENGINE_WTF_LINKEDHASHSET_H_ diff --git a/sky/engine/wtf/LinkedStack.h b/sky/engine/wtf/LinkedStack.h deleted file mode 100644 index 7930a6ecb6e1b..0000000000000 --- a/sky/engine/wtf/LinkedStack.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_LINKEDSTACK_H_ -#define SKY_ENGINE_WTF_LINKEDSTACK_H_ - -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" - -namespace WTF { - -template -class LinkedStack { - WTF_MAKE_FAST_ALLOCATED; - - public: - LinkedStack() : m_size(0) {} - - bool isEmpty(); - - void push(const T&); - const T& peek(); - void pop(); - - size_t size(); - - // This inner class used to be private but is now public on account of a - // possible MSVC bug. It can be made private again if we get rid of - // WTF_MAKE_FAST_ALLOCATED ever. - class Node { - WTF_MAKE_FAST_ALLOCATED; - - public: - Node(const T&, PassOwnPtr next); - - T m_data; - OwnPtr m_next; - }; - - private: - OwnPtr m_head; - size_t m_size; -}; - -template -LinkedStack::Node::Node(const T& data, PassOwnPtr next) - : m_data(data), m_next(next) {} - -template -inline bool LinkedStack::isEmpty() { - return !m_head; -} - -template -inline void LinkedStack::push(const T& data) { - m_head = adoptPtr(new Node(data, m_head.release())); - ++m_size; -} - -template -inline const T& LinkedStack::peek() { - return m_head->m_data; -} - -template -inline void LinkedStack::pop() { - ASSERT(m_head && m_size); - m_head = m_head->m_next.release(); - --m_size; -} - -template -inline size_t LinkedStack::size() { - return m_size; -} - -} // namespace WTF - -using WTF::LinkedStack; - -#endif // SKY_ENGINE_WTF_LINKEDSTACK_H_ diff --git a/sky/engine/wtf/ListHashSet.h b/sky/engine/wtf/ListHashSet.h deleted file mode 100644 index c4bd804d34c26..0000000000000 --- a/sky/engine/wtf/ListHashSet.h +++ /dev/null @@ -1,1048 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. - * All rights reserved. - * Copyright (C) 2011, Benjamin Poulain - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_LISTHASHSET_H_ -#define SKY_ENGINE_WTF_LISTHASHSET_H_ - -#include "flutter/sky/engine/wtf/DefaultAllocator.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -namespace WTF { - -// ListHashSet: Just like HashSet, this class provides a Set -// interface - a collection of unique objects with O(1) insertion, -// removal and test for containership. However, it also has an -// order - iterating it will always give back values in the order -// in which they are added. - -// Unlike iteration of most WTF Hash data structures, iteration is -// guaranteed safe against mutation of the ListHashSet, except for -// removal of the item currently pointed to by a given iterator. - -template -class ListHashSet; - -template -class ListHashSetIterator; -template -class ListHashSetConstIterator; -template -class ListHashSetReverseIterator; -template -class ListHashSetConstReverseIterator; - -template -class ListHashSetNodeBase; -template -class ListHashSetNode; -template -struct ListHashSetAllocator; - -template -struct ListHashSetNodeHashFunctions; -template -struct ListHashSetTranslator; - -// Don't declare a destructor for HeapAllocated ListHashSet. -template -class ListHashSetDestructorBase; - -template -class ListHashSetDestructorBase { - protected: - typename Allocator::AllocatorProvider m_allocatorProvider; -}; - -template -class ListHashSetDestructorBase { - public: - ~ListHashSetDestructorBase() { static_cast(this)->finalize(); } - - protected: - typename Allocator::AllocatorProvider m_allocatorProvider; -}; - -// Note that for a ListHashSet you cannot specify the HashTraits as a -// template argument. It uses the default hash traits for the ValueArg -// type. -template ::Hash, - typename AllocatorArg = - ListHashSetAllocator> -class ListHashSet - : public ListHashSetDestructorBase< - ListHashSet, - AllocatorArg, - AllocatorArg::isGarbageCollected> { - typedef AllocatorArg Allocator; - WTF_USE_ALLOCATOR(ListHashSet, Allocator); - - typedef ListHashSetNode Node; - typedef HashTraits NodeTraits; - typedef ListHashSetNodeHashFunctions NodeHash; - typedef ListHashSetTranslator BaseTranslator; - - typedef HashTable - ImplType; - typedef HashTableIterator - ImplTypeIterator; - typedef HashTableConstIterator - ImplTypeConstIterator; - - typedef HashArg HashFunctions; - - public: - typedef ValueArg ValueType; - typedef HashTraits ValueTraits; - typedef typename ValueTraits::PeekInType ValuePeekInType; - typedef typename ValueTraits::PassInType ValuePassInType; - typedef typename ValueTraits::PassOutType ValuePassOutType; - - typedef ListHashSetIterator iterator; - typedef ListHashSetConstIterator const_iterator; - friend class ListHashSetIterator; - friend class ListHashSetConstIterator; - - typedef ListHashSetReverseIterator reverse_iterator; - typedef ListHashSetConstReverseIterator const_reverse_iterator; - friend class ListHashSetReverseIterator; - friend class ListHashSetConstReverseIterator; - - template - struct HashTableAddResult { - HashTableAddResult(Node* storedValue, bool isNewEntry) - : storedValue(storedValue), isNewEntry(isNewEntry) {} - Node* storedValue; - bool isNewEntry; - }; - typedef HashTableAddResult AddResult; - - ListHashSet(); - ListHashSet(const ListHashSet&); - ListHashSet& operator=(const ListHashSet&); - void finalize(); - - void swap(ListHashSet&); - - unsigned size() const { return m_impl.size(); } - unsigned capacity() const { return m_impl.capacity(); } - bool isEmpty() const { return m_impl.isEmpty(); } - - iterator begin() { return makeIterator(m_head); } - iterator end() { return makeIterator(0); } - const_iterator begin() const { return makeConstIterator(m_head); } - const_iterator end() const { return makeConstIterator(0); } - - reverse_iterator rbegin() { return makeReverseIterator(m_tail); } - reverse_iterator rend() { return makeReverseIterator(0); } - const_reverse_iterator rbegin() const { - return makeConstReverseIterator(m_tail); - } - const_reverse_iterator rend() const { return makeConstReverseIterator(0); } - - ValueType& first(); - const ValueType& first() const; - void removeFirst(); - - ValueType& last(); - const ValueType& last() const; - void removeLast(); - - iterator find(ValuePeekInType); - const_iterator find(ValuePeekInType) const; - bool contains(ValuePeekInType) const; - - // An alternate version of find() that finds the object by hashing and - // comparing with some other type, to avoid the cost of type conversion. The - // HashTranslator interface is defined in HashSet. - template - iterator find(const T&); - template - const_iterator find(const T&) const; - template - bool contains(const T&) const; - - // The return value of add is a pair of a pointer to the stored value, - // and a bool that is true if an new entry was added. - AddResult add(ValuePassInType); - - // Same as add() except that the return value is an - // iterator. Useful in cases where it's needed to have the - // same return value as find() and where it's not possible to - // use a pointer to the storedValue. - iterator addReturnIterator(ValuePassInType); - - // Add the value to the end of the collection. If the value was already in - // the list, it is moved to the end. - AddResult appendOrMoveToLast(ValuePassInType); - - // Add the value to the beginning of the collection. If the value was already - // in the list, it is moved to the beginning. - AddResult prependOrMoveToFirst(ValuePassInType); - - AddResult insertBefore(ValuePeekInType beforeValue, ValuePassInType newValue); - AddResult insertBefore(iterator, ValuePassInType); - - void remove(ValuePeekInType value) { return remove(find(value)); } - void remove(iterator); - void clear(); - template - void removeAll(const Collection& other) { - WTF::removeAll(*this, other); - } - - ValuePassOutType take(iterator); - ValuePassOutType take(ValuePeekInType); - ValuePassOutType takeFirst(); - - private: - void unlink(Node*); - void unlinkAndDelete(Node*); - void appendNode(Node*); - void prependNode(Node*); - void insertNodeBefore(Node* beforeNode, Node* newNode); - void deleteAllNodes(); - Allocator* allocator() const { return this->m_allocatorProvider.get(); } - void createAllocatorIfNeeded() { - this->m_allocatorProvider.createAllocatorIfNeeded(); - } - void deallocate(Node* node) const { - this->m_allocatorProvider.deallocate(node); - } - - iterator makeIterator(Node* position) { return iterator(this, position); } - const_iterator makeConstIterator(Node* position) const { - return const_iterator(this, position); - } - reverse_iterator makeReverseIterator(Node* position) { - return reverse_iterator(this, position); - } - const_reverse_iterator makeConstReverseIterator(Node* position) const { - return const_reverse_iterator(this, position); - } - - ImplType m_impl; - Node* m_head; - Node* m_tail; -}; - -// ListHashSetNode has this base class to hold the members because the MSVC -// compiler otherwise gets into circular template dependencies when trying -// to do sizeof on a node. -template -class ListHashSetNodeBase { - protected: - ListHashSetNodeBase(const ValueArg& value) - : m_value(value), - m_prev(0), - m_next(0) -#if ENABLE(ASSERT) - , - m_isAllocated(true) -#endif - { - } - - template - ListHashSetNodeBase(const U& value) - : m_value(value), - m_prev(0), - m_next(0) -#if ENABLE(ASSERT) - , - m_isAllocated(true) -#endif - { - } - - public: - ValueArg m_value; - ListHashSetNodeBase* m_prev; - ListHashSetNodeBase* m_next; -#if ENABLE(ASSERT) - bool m_isAllocated; -#endif -}; - -// This allocator is only used for non-Heap ListHashSets. -template -struct ListHashSetAllocator : public DefaultAllocator { - typedef DefaultAllocator TableAllocator; - typedef ListHashSetNode Node; - typedef ListHashSetNodeBase NodeBase; - class AllocatorProvider { - public: - void createAllocatorIfNeeded() { - if (!m_allocator) - m_allocator = adoptPtr(new ListHashSetAllocator); - } - - void swap(AllocatorProvider& other) { m_allocator.swap(other.m_allocator); } - - void deallocate(Node* node) const { - ASSERT(m_allocator); - m_allocator->deallocate(node); - } - - ListHashSetAllocator* get() const { - ASSERT(m_allocator); - return m_allocator.get(); - } - - private: - OwnPtr m_allocator; - }; - - ListHashSetAllocator() - : m_freeList(pool()), m_isDoneWithInitialFreeList(false) { - memset(m_pool.buffer, 0, sizeof(m_pool.buffer)); - } - - Node* allocateNode() { - Node* result = m_freeList; - - if (!result) - return static_cast(fastMalloc(sizeof(NodeBase))); - - ASSERT(!result->m_isAllocated); - - Node* next = result->next(); - ASSERT(!next || !next->m_isAllocated); - if (!next && !m_isDoneWithInitialFreeList) { - next = result + 1; - if (next == pastPool()) { - m_isDoneWithInitialFreeList = true; - next = 0; - } else { - ASSERT(inPool(next)); - ASSERT(!next->m_isAllocated); - } - } - m_freeList = next; - - return result; - } - - void deallocate(Node* node) { - if (inPool(node)) { -#if ENABLE(ASSERT) - node->m_isAllocated = false; -#endif - node->m_next = m_freeList; - m_freeList = node; - return; - } - - fastFree(node); - } - - bool inPool(Node* node) { return node >= pool() && node < pastPool(); } - - private: - Node* pool() { return reinterpret_cast_ptr(m_pool.buffer); } - Node* pastPool() { return pool() + m_poolSize; } - - Node* m_freeList; - bool m_isDoneWithInitialFreeList; -#if defined(MEMORY_SANITIZER_INITIAL_SIZE) - // The allocation pool for nodes is one big chunk that ASAN has no - // insight into, so it can cloak errors. Make it as small as possible - // to force nodes to be allocated individually where ASAN can see them. - static const size_t m_poolSize = 1; -#else - static const size_t m_poolSize = inlineCapacity; -#endif - AlignedBuffer m_pool; -}; - -template -class ListHashSetNode : public ListHashSetNodeBase { - public: - typedef AllocatorArg NodeAllocator; - typedef ValueArg Value; - - template - ListHashSetNode(U value) : ListHashSetNodeBase(value) {} - - void* operator new(size_t, NodeAllocator* allocator) { - COMPILE_ASSERT( - sizeof(ListHashSetNode) == sizeof(ListHashSetNodeBase), - PleaseAddAnyFieldsToTheBase); - return allocator->allocateNode(); - } - - void setWasAlreadyDestructed() { - if (NodeAllocator::isGarbageCollected && - HashTraits::needsDestruction) - this->m_prev = unlinkedNodePointer(); - } - - bool wasAlreadyDestructed() const { - ASSERT(NodeAllocator::isGarbageCollected); - return this->m_prev == unlinkedNodePointer(); - } - - static void finalize(void* pointer) { - ASSERT(HashTraits::needsDestruction); // No need to waste time - // calling finalize if it's - // not needed. - ListHashSetNode* self = reinterpret_cast_ptr(pointer); - - // Check whether this node was already destructed before being - // unlinked from the collection. - if (self->wasAlreadyDestructed()) - return; - - self->m_value.~ValueArg(); - } - - void destroy(NodeAllocator* allocator) { - this->~ListHashSetNode(); - setWasAlreadyDestructed(); - allocator->deallocate(this); - } - - ListHashSetNode* next() const { - return reinterpret_cast(this->m_next); - } - ListHashSetNode* prev() const { - return reinterpret_cast(this->m_prev); - } - - // Don't add fields here, the ListHashSetNodeBase and this should have - // the same size. - - static ListHashSetNode* unlinkedNodePointer() { - return reinterpret_cast(-1); - } - - template - friend struct ListHashSetNodeHashFunctions; -}; - -template -struct ListHashSetNodeHashFunctions { - template - static unsigned hash(const T& key) { - return HashArg::hash(key->m_value); - } - template - static bool equal(const T& a, const T& b) { - return HashArg::equal(a->m_value, b->m_value); - } - static const bool safeToCompareToEmptyOrDeleted = false; -}; - -template -class ListHashSetIterator { - private: - typedef typename Set::const_iterator const_iterator; - typedef typename Set::Node Node; - typedef typename Set::ValueType ValueType; - typedef ValueType& ReferenceType; - typedef ValueType* PointerType; - - ListHashSetIterator(const Set* set, Node* position) - : m_iterator(set, position) {} - - public: - ListHashSetIterator() {} - - // default copy, assignment and destructor are OK - - PointerType get() const { return const_cast(m_iterator.get()); } - ReferenceType operator*() const { return *get(); } - PointerType operator->() const { return get(); } - - ListHashSetIterator& operator++() { - ++m_iterator; - return *this; - } - ListHashSetIterator& operator--() { - --m_iterator; - return *this; - } - - // Postfix ++ and -- intentionally omitted. - - // Comparison. - bool operator==(const ListHashSetIterator& other) const { - return m_iterator == other.m_iterator; - } - bool operator!=(const ListHashSetIterator& other) const { - return m_iterator != other.m_iterator; - } - - operator const_iterator() const { return m_iterator; } - - private: - Node* node() { return m_iterator.node(); } - - const_iterator m_iterator; - - template - friend class ListHashSet; -}; - -template -class ListHashSetConstIterator { - private: - typedef typename Set::const_iterator const_iterator; - typedef typename Set::Node Node; - typedef typename Set::ValueType ValueType; - typedef const ValueType& ReferenceType; - typedef const ValueType* PointerType; - - friend class ListHashSetIterator; - - ListHashSetConstIterator(const Set* set, Node* position) - : m_set(set), m_position(position) {} - - public: - ListHashSetConstIterator() {} - - PointerType get() const { return &m_position->m_value; } - ReferenceType operator*() const { return *get(); } - PointerType operator->() const { return get(); } - - ListHashSetConstIterator& operator++() { - ASSERT(m_position != 0); - m_position = m_position->next(); - return *this; - } - - ListHashSetConstIterator& operator--() { - ASSERT(m_position != m_set->m_head); - if (!m_position) - m_position = m_set->m_tail; - else - m_position = m_position->prev(); - return *this; - } - - // Postfix ++ and -- intentionally omitted. - - // Comparison. - bool operator==(const ListHashSetConstIterator& other) const { - return m_position == other.m_position; - } - bool operator!=(const ListHashSetConstIterator& other) const { - return m_position != other.m_position; - } - - private: - Node* node() { return m_position; } - - const Set* m_set; - Node* m_position; - - template - friend class ListHashSet; -}; - -template -class ListHashSetReverseIterator { - private: - typedef typename Set::const_reverse_iterator const_reverse_iterator; - typedef typename Set::Node Node; - typedef typename Set::ValueType ValueType; - typedef ValueType& ReferenceType; - typedef ValueType* PointerType; - - ListHashSetReverseIterator(const Set* set, Node* position) - : m_iterator(set, position) {} - - public: - ListHashSetReverseIterator() {} - - // default copy, assignment and destructor are OK - - PointerType get() const { return const_cast(m_iterator.get()); } - ReferenceType operator*() const { return *get(); } - PointerType operator->() const { return get(); } - - ListHashSetReverseIterator& operator++() { - ++m_iterator; - return *this; - } - ListHashSetReverseIterator& operator--() { - --m_iterator; - return *this; - } - - // Postfix ++ and -- intentionally omitted. - - // Comparison. - bool operator==(const ListHashSetReverseIterator& other) const { - return m_iterator == other.m_iterator; - } - bool operator!=(const ListHashSetReverseIterator& other) const { - return m_iterator != other.m_iterator; - } - - operator const_reverse_iterator() const { return m_iterator; } - - private: - Node* node() { return m_iterator.node(); } - - const_reverse_iterator m_iterator; - - template - friend class ListHashSet; -}; - -template -class ListHashSetConstReverseIterator { - private: - typedef typename Set::reverse_iterator reverse_iterator; - typedef typename Set::Node Node; - typedef typename Set::ValueType ValueType; - typedef const ValueType& ReferenceType; - typedef const ValueType* PointerType; - - friend class ListHashSetReverseIterator; - - ListHashSetConstReverseIterator(const Set* set, Node* position) - : m_set(set), m_position(position) {} - - public: - ListHashSetConstReverseIterator() {} - - PointerType get() const { return &m_position->m_value; } - ReferenceType operator*() const { return *get(); } - PointerType operator->() const { return get(); } - - ListHashSetConstReverseIterator& operator++() { - ASSERT(m_position != 0); - m_position = m_position->prev(); - return *this; - } - - ListHashSetConstReverseIterator& operator--() { - ASSERT(m_position != m_set->m_tail); - if (!m_position) - m_position = m_set->m_head; - else - m_position = m_position->next(); - return *this; - } - - // Postfix ++ and -- intentionally omitted. - - // Comparison. - bool operator==(const ListHashSetConstReverseIterator& other) const { - return m_position == other.m_position; - } - bool operator!=(const ListHashSetConstReverseIterator& other) const { - return m_position != other.m_position; - } - - private: - Node* node() { return m_position; } - - const Set* m_set; - Node* m_position; - - template - friend class ListHashSet; -}; - -template -struct ListHashSetTranslator { - template - static unsigned hash(const T& key) { - return HashFunctions::hash(key); - } - template - static bool equal(const T& a, const U& b) { - return HashFunctions::equal(a->m_value, b); - } - template - static void translate(T*& location, const U& key, const V& allocator) { - location = new (const_cast(&allocator)) T(key); - } -}; - -template -inline ListHashSet::ListHashSet() - : m_head(0), m_tail(0) {} - -template -inline ListHashSet::ListHashSet( - const ListHashSet& other) - : m_head(0), m_tail(0) { - const_iterator end = other.end(); - for (const_iterator it = other.begin(); it != end; ++it) - add(*it); -} - -template -inline ListHashSet& -ListHashSet::operator=(const ListHashSet& other) { - ListHashSet tmp(other); - swap(tmp); - return *this; -} - -template -inline void ListHashSet::swap(ListHashSet& other) { - m_impl.swap(other.m_impl); - std::swap(m_head, other.m_head); - std::swap(m_tail, other.m_tail); - this->m_allocatorProvider.swap(other.m_allocatorProvider); -} - -template -inline void ListHashSet::finalize() { - COMPILE_ASSERT(!Allocator::isGarbageCollected, - FinalizeOnHeapAllocatedListHashSetShouldNeverBeCalled); - deleteAllNodes(); -} - -template -inline T& ListHashSet::first() { - ASSERT(!isEmpty()); - return m_head->m_value; -} - -template -inline void ListHashSet::removeFirst() { - ASSERT(!isEmpty()); - m_impl.remove(m_head); - unlinkAndDelete(m_head); -} - -template -inline const T& ListHashSet::first() const { - ASSERT(!isEmpty()); - return m_head->m_value; -} - -template -inline T& ListHashSet::last() { - ASSERT(!isEmpty()); - return m_tail->m_value; -} - -template -inline const T& ListHashSet::last() const { - ASSERT(!isEmpty()); - return m_tail->m_value; -} - -template -inline void ListHashSet::removeLast() { - ASSERT(!isEmpty()); - m_impl.remove(m_tail); - unlinkAndDelete(m_tail); -} - -template -inline typename ListHashSet::iterator -ListHashSet::find(ValuePeekInType value) { - ImplTypeIterator it = m_impl.template find(value); - if (it == m_impl.end()) - return end(); - return makeIterator(*it); -} - -template -inline typename ListHashSet::const_iterator -ListHashSet::find(ValuePeekInType value) const { - ImplTypeConstIterator it = m_impl.template find(value); - if (it == m_impl.end()) - return end(); - return makeConstIterator(*it); -} - -template -struct ListHashSetTranslatorAdapter { - template - static unsigned hash(const T& key) { - return Translator::hash(key); - } - template - static bool equal(const T& a, const U& b) { - return Translator::equal(a->m_value, b); - } -}; - -template -template -inline typename ListHashSet::iterator -ListHashSet::find(const T& value) { - ImplTypeConstIterator it = - m_impl.template find>(value); - if (it == m_impl.end()) - return end(); - return makeIterator(*it); -} - -template -template -inline typename ListHashSet::const_iterator -ListHashSet::find(const T& value) const { - ImplTypeConstIterator it = - m_impl.template find>(value); - if (it == m_impl.end()) - return end(); - return makeConstIterator(*it); -} - -template -template -inline bool ListHashSet::contains( - const T& value) const { - return m_impl.template contains>( - value); -} - -template -inline bool ListHashSet::contains( - ValuePeekInType value) const { - return m_impl.template contains(value); -} - -template -typename ListHashSet::AddResult -ListHashSet::add(ValuePassInType value) { - createAllocatorIfNeeded(); - // The second argument is a const ref. This is useful for the HashTable - // because it lets it take lvalues by reference, but for our purposes - // it's inconvenient, since it constrains us to be const, whereas the - // allocator actually changes when it does allocations. - typename ImplType::AddResult result = - m_impl.template add(value, *this->allocator()); - if (result.isNewEntry) - appendNode(*result.storedValue); - return AddResult(*result.storedValue, result.isNewEntry); -} - -template -typename ListHashSet::iterator -ListHashSet::addReturnIterator(ValuePassInType value) { - return makeIterator(add(value).storedValue); -} - -template -typename ListHashSet::AddResult -ListHashSet::appendOrMoveToLast( - ValuePassInType value) { - createAllocatorIfNeeded(); - typename ImplType::AddResult result = - m_impl.template add(value, *this->allocator()); - Node* node = *result.storedValue; - if (!result.isNewEntry) - unlink(node); - appendNode(node); - return AddResult(*result.storedValue, result.isNewEntry); -} - -template -typename ListHashSet::AddResult -ListHashSet::prependOrMoveToFirst( - ValuePassInType value) { - createAllocatorIfNeeded(); - typename ImplType::AddResult result = - m_impl.template add(value, *this->allocator()); - Node* node = *result.storedValue; - if (!result.isNewEntry) - unlink(node); - prependNode(node); - return AddResult(*result.storedValue, result.isNewEntry); -} - -template -typename ListHashSet::AddResult -ListHashSet::insertBefore(iterator it, - ValuePassInType newValue) { - createAllocatorIfNeeded(); - typename ImplType::AddResult result = - m_impl.template add(newValue, *this->allocator()); - if (result.isNewEntry) - insertNodeBefore(it.node(), *result.storedValue); - return AddResult(*result.storedValue, result.isNewEntry); -} - -template -typename ListHashSet::AddResult -ListHashSet::insertBefore(ValuePeekInType beforeValue, - ValuePassInType newValue) { - createAllocatorIfNeeded(); - return insertBefore(find(beforeValue), newValue); -} - -template -inline void ListHashSet::remove(iterator it) { - if (it == end()) - return; - m_impl.remove(it.node()); - unlinkAndDelete(it.node()); -} - -template -inline void ListHashSet::clear() { - deleteAllNodes(); - m_impl.clear(); - m_head = 0; - m_tail = 0; -} - -template -typename ListHashSet::ValuePassOutType -ListHashSet::take(iterator it) { - if (it == end()) - return ValueTraits::emptyValue(); - - m_impl.remove(it.node()); - ValuePassOutType result = ValueTraits::passOut(it.node()->m_value); - unlinkAndDelete(it.node()); - - return result; -} - -template -typename ListHashSet::ValuePassOutType -ListHashSet::take(ValuePeekInType value) { - return take(find(value)); -} - -template -typename ListHashSet::ValuePassOutType -ListHashSet::takeFirst() { - ASSERT(!isEmpty()); - m_impl.remove(m_head); - ValuePassOutType result = ValueTraits::passOut(m_head->m_value); - unlinkAndDelete(m_head); - - return result; -} - -template -void ListHashSet::unlink(Node* node) { - if (!node->m_prev) { - ASSERT(node == m_head); - m_head = node->next(); - } else { - ASSERT(node != m_head); - node->m_prev->m_next = node->m_next; - } - - if (!node->m_next) { - ASSERT(node == m_tail); - m_tail = node->prev(); - } else { - ASSERT(node != m_tail); - node->m_next->m_prev = node->m_prev; - } -} - -template -void ListHashSet::unlinkAndDelete(Node* node) { - unlink(node); - node->destroy(this->allocator()); -} - -template -void ListHashSet::appendNode(Node* node) { - node->m_prev = m_tail; - node->m_next = 0; - - if (m_tail) { - ASSERT(m_head); - m_tail->m_next = node; - } else { - ASSERT(!m_head); - m_head = node; - } - - m_tail = node; -} - -template -void ListHashSet::prependNode(Node* node) { - node->m_prev = 0; - node->m_next = m_head; - - if (m_head) - m_head->m_prev = node; - else - m_tail = node; - - m_head = node; -} - -template -void ListHashSet::insertNodeBefore(Node* beforeNode, - Node* newNode) { - if (!beforeNode) - return appendNode(newNode); - - newNode->m_next = beforeNode; - newNode->m_prev = beforeNode->m_prev; - if (beforeNode->m_prev) - beforeNode->m_prev->m_next = newNode; - beforeNode->m_prev = newNode; - - if (!newNode->m_prev) - m_head = newNode; -} - -template -void ListHashSet::deleteAllNodes() { - if (!m_head) - return; - - for (Node *node = m_head, *next = m_head->next(); node; - node = next, next = node ? node->next() : 0) - node->destroy(this->allocator()); -} - -} // namespace WTF - -using WTF::ListHashSet; - -#endif // SKY_ENGINE_WTF_LISTHASHSET_H_ diff --git a/sky/engine/wtf/ListHashSetTest.cpp b/sky/engine/wtf/ListHashSetTest.cpp deleted file mode 100644 index 32809172845f4..0000000000000 --- a/sky/engine/wtf/ListHashSetTest.cpp +++ /dev/null @@ -1,686 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/LinkedHashSet.h" -#include "flutter/sky/engine/wtf/ListHashSet.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -namespace { - -template -void removeFirstHelper() { - Set list; - list.add(-1); - list.add(0); - list.add(1); - list.add(2); - list.add(3); - - EXPECT_EQ(-1, list.first()); - EXPECT_EQ(3, list.last()); - - list.removeFirst(); - EXPECT_EQ(0, list.first()); - - list.removeLast(); - EXPECT_EQ(2, list.last()); - - list.removeFirst(); - EXPECT_EQ(1, list.first()); - - list.removeFirst(); - EXPECT_EQ(2, list.first()); - - list.removeFirst(); - EXPECT_TRUE(list.isEmpty()); -} - -TEST(ListHashSetTest, RemoveFirst) { - removeFirstHelper>(); - removeFirstHelper>(); -} - -TEST(LinkedHashSetTest, RemoveFirst) { - removeFirstHelper>(); -} - -template -void appendOrMoveToLastNewItems() { - Set list; - typename Set::AddResult result = list.appendOrMoveToLast(1); - EXPECT_TRUE(result.isNewEntry); - result = list.add(2); - EXPECT_TRUE(result.isNewEntry); - result = list.appendOrMoveToLast(3); - EXPECT_TRUE(result.isNewEntry); - - EXPECT_EQ(list.size(), 3UL); - - // The list should be in order 1, 2, 3. - typename Set::iterator iterator = list.begin(); - EXPECT_EQ(1, *iterator); - ++iterator; - EXPECT_EQ(2, *iterator); - ++iterator; - EXPECT_EQ(3, *iterator); - ++iterator; -} - -TEST(ListHashSetTest, AppendOrMoveToLastNewItems) { - appendOrMoveToLastNewItems>(); - appendOrMoveToLastNewItems>(); -} - -TEST(LinkedHashSetTest, AppendOrMoveToLastNewItems) { - appendOrMoveToLastNewItems>(); -} - -template -void appendOrMoveToLastWithDuplicates() { - Set list; - - // Add a single element twice. - typename Set::AddResult result = list.add(1); - EXPECT_TRUE(result.isNewEntry); - result = list.appendOrMoveToLast(1); - EXPECT_FALSE(result.isNewEntry); - EXPECT_EQ(1UL, list.size()); - - list.add(2); - list.add(3); - EXPECT_EQ(3UL, list.size()); - - // Appending 2 move it to the end. - EXPECT_EQ(3, list.last()); - result = list.appendOrMoveToLast(2); - EXPECT_FALSE(result.isNewEntry); - EXPECT_EQ(2, list.last()); - - // Inverse the list by moving each element to end end. - result = list.appendOrMoveToLast(3); - EXPECT_FALSE(result.isNewEntry); - result = list.appendOrMoveToLast(2); - EXPECT_FALSE(result.isNewEntry); - result = list.appendOrMoveToLast(1); - EXPECT_FALSE(result.isNewEntry); - EXPECT_EQ(3UL, list.size()); - - typename Set::iterator iterator = list.begin(); - EXPECT_EQ(3, *iterator); - ++iterator; - EXPECT_EQ(2, *iterator); - ++iterator; - EXPECT_EQ(1, *iterator); - ++iterator; -} - -TEST(ListHashSetTest, AppendOrMoveToLastWithDuplicates) { - appendOrMoveToLastWithDuplicates>(); - appendOrMoveToLastWithDuplicates>(); -} - -TEST(LinkedHashSetTest, AppendOrMoveToLastWithDuplicates) { - appendOrMoveToLastWithDuplicates>(); -} - -template -void prependOrMoveToFirstNewItems() { - Set list; - typename Set::AddResult result = list.prependOrMoveToFirst(1); - EXPECT_TRUE(result.isNewEntry); - result = list.add(2); - EXPECT_TRUE(result.isNewEntry); - result = list.prependOrMoveToFirst(3); - EXPECT_TRUE(result.isNewEntry); - - EXPECT_EQ(list.size(), 3UL); - - // The list should be in order 3, 1, 2. - typename Set::iterator iterator = list.begin(); - EXPECT_EQ(3, *iterator); - ++iterator; - EXPECT_EQ(1, *iterator); - ++iterator; - EXPECT_EQ(2, *iterator); - ++iterator; -} - -TEST(ListHashSetTest, PrependOrMoveToFirstNewItems) { - prependOrMoveToFirstNewItems>(); - prependOrMoveToFirstNewItems>(); -} - -TEST(LinkedHashSetTest, PrependOrMoveToFirstNewItems) { - prependOrMoveToFirstNewItems>(); -} - -template -void prependOrMoveToLastWithDuplicates() { - Set list; - - // Add a single element twice. - typename Set::AddResult result = list.add(1); - EXPECT_TRUE(result.isNewEntry); - result = list.prependOrMoveToFirst(1); - EXPECT_FALSE(result.isNewEntry); - EXPECT_EQ(1UL, list.size()); - - list.add(2); - list.add(3); - EXPECT_EQ(3UL, list.size()); - - // Prepending 2 move it to the beginning. - EXPECT_EQ(1, list.first()); - result = list.prependOrMoveToFirst(2); - EXPECT_FALSE(result.isNewEntry); - EXPECT_EQ(2, list.first()); - - // Inverse the list by moving each element to the first position. - result = list.prependOrMoveToFirst(1); - EXPECT_FALSE(result.isNewEntry); - result = list.prependOrMoveToFirst(2); - EXPECT_FALSE(result.isNewEntry); - result = list.prependOrMoveToFirst(3); - EXPECT_FALSE(result.isNewEntry); - EXPECT_EQ(3UL, list.size()); - - typename Set::iterator iterator = list.begin(); - EXPECT_EQ(3, *iterator); - ++iterator; - EXPECT_EQ(2, *iterator); - ++iterator; - EXPECT_EQ(1, *iterator); - ++iterator; -} - -TEST(ListHashSetTest, PrependOrMoveToLastWithDuplicates) { - prependOrMoveToLastWithDuplicates>(); - prependOrMoveToLastWithDuplicates>(); -} - -TEST(LinkedHashSetTest, PrependOrMoveToLastWithDuplicates) { - prependOrMoveToLastWithDuplicates>(); -} - -class DummyRefCounted : public WTF::RefCounted { - public: - DummyRefCounted(bool& isDeleted) : m_isDeleted(isDeleted) { - m_isDeleted = false; - } - ~DummyRefCounted() { m_isDeleted = true; } - void ref() { - WTF::RefCounted::ref(); - ++m_refInvokesCount; - } - - static int m_refInvokesCount; - - private: - bool& m_isDeleted; -}; - -int DummyRefCounted::m_refInvokesCount = 0; - -template -void withRefPtr() { - bool isDeleted = false; - DummyRefCounted::m_refInvokesCount = 0; - RefPtr ptr = adoptRef(new DummyRefCounted(isDeleted)); - EXPECT_EQ(0, DummyRefCounted::m_refInvokesCount); - - Set set; - set.add(ptr); - // Referenced only once (to store a copy in the container). - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); - EXPECT_EQ(ptr, set.first()); - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); - - DummyRefCounted* rawPtr = ptr.get(); - - EXPECT_TRUE(set.contains(ptr)); - EXPECT_TRUE(set.contains(rawPtr)); - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); - - ptr.clear(); - EXPECT_FALSE(isDeleted); - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); - - set.remove(rawPtr); - EXPECT_TRUE(isDeleted); - - EXPECT_EQ(1, DummyRefCounted::m_refInvokesCount); -} - -TEST(ListHashSetTest, WithRefPtr) { - withRefPtr>>(); - withRefPtr, 1>>(); -} - -TEST(LinkedHashSetTest, WithRefPtr) { - withRefPtr>>(); -} - -template -void findHelper() { - Set set; - set.add(-1); - set.add(0); - set.add(1); - set.add(2); - set.add(3); - - SetRef ref = set; - Iterator it = ref.find(2); - EXPECT_EQ(2, *it); - ++it; - EXPECT_EQ(3, *it); - --it; - --it; - EXPECT_EQ(1, *it); -} - -TEST(ListHashSetTest, Find) { - findHelper, const ListHashSet&, - ListHashSet::const_iterator>(); - findHelper, ListHashSet&, ListHashSet::iterator>(); - findHelper, const ListHashSet&, - ListHashSet::const_iterator>(); - findHelper, ListHashSet&, - ListHashSet::iterator>(); -} - -TEST(LinkedHashSetTest, Find) { - findHelper, const LinkedHashSet&, - LinkedHashSet::const_iterator>(); - findHelper, LinkedHashSet&, - LinkedHashSet::iterator>(); -} - -template -void insertBeforeHelper(bool canModifyWhileIterating) { - Set set; - set.add(-1); - set.add(0); - set.add(2); - set.add(3); - - typename Set::iterator it = set.find(2); - EXPECT_EQ(2, *it); - set.insertBefore(it, 1); - if (!canModifyWhileIterating) - it = set.find(2); - ++it; - EXPECT_EQ(3, *it); - EXPECT_EQ(5u, set.size()); - --it; - --it; - EXPECT_EQ(1, *it); - if (canModifyWhileIterating) { - set.remove(-1); - set.remove(0); - set.remove(2); - set.remove(3); - EXPECT_EQ(1u, set.size()); - EXPECT_EQ(1, *it); - ++it; - EXPECT_EQ(it, set.end()); - --it; - EXPECT_EQ(1, *it); - set.insertBefore(it, -1); - set.insertBefore(it, 0); - set.add(2); - set.add(3); - } - set.insertBefore(2, 42); - set.insertBefore(-1, 103); - EXPECT_EQ(103, set.first()); - if (!canModifyWhileIterating) - it = set.find(1); - ++it; - EXPECT_EQ(42, *it); - EXPECT_EQ(7u, set.size()); -} - -TEST(ListHashSetTest, InsertBefore) { - insertBeforeHelper>(true); - insertBeforeHelper>(true); -} - -TEST(LinkedHashSetTest, InsertBefore) { - insertBeforeHelper>(false); -} - -template -void addReturnIterator(bool canModifyWhileIterating) { - Set set; - set.add(-1); - set.add(0); - set.add(1); - set.add(2); - - typename Set::iterator it = set.addReturnIterator(3); - EXPECT_EQ(3, *it); - --it; - EXPECT_EQ(2, *it); - EXPECT_EQ(5u, set.size()); - --it; - EXPECT_EQ(1, *it); - --it; - EXPECT_EQ(0, *it); - it = set.addReturnIterator(4); - if (canModifyWhileIterating) { - set.remove(3); - set.remove(2); - set.remove(1); - set.remove(0); - set.remove(-1); - EXPECT_EQ(1u, set.size()); - } - EXPECT_EQ(4, *it); - ++it; - EXPECT_EQ(it, set.end()); - --it; - EXPECT_EQ(4, *it); - if (canModifyWhileIterating) { - set.insertBefore(it, -1); - set.insertBefore(it, 0); - set.insertBefore(it, 1); - set.insertBefore(it, 2); - set.insertBefore(it, 3); - } - EXPECT_EQ(6u, set.size()); - it = set.addReturnIterator(5); - EXPECT_EQ(7u, set.size()); - set.remove(it); - EXPECT_EQ(6u, set.size()); - EXPECT_EQ(4, set.last()); -} - -TEST(ListHashSetTest, AddReturnIterator) { - addReturnIterator>(true); - addReturnIterator>(true); -} - -TEST(LinkedHashSetTest, AddReturnIterator) { - addReturnIterator>(false); -} - -template -void excerciseValuePeekInType() { - Set set; - bool isDeleted = false; - bool isDeleted2 = false; - - RefPtr ptr = adoptRef(new DummyRefCounted(isDeleted)); - RefPtr ptr2 = adoptRef(new DummyRefCounted(isDeleted2)); - - typename Set::AddResult addResult = set.add(ptr); - EXPECT_TRUE(addResult.isNewEntry); - set.find(ptr); - const Set& constSet(set); - constSet.find(ptr); - EXPECT_TRUE(set.contains(ptr)); - typename Set::iterator it = set.addReturnIterator(ptr); - set.appendOrMoveToLast(ptr); - set.prependOrMoveToFirst(ptr); - set.insertBefore(ptr, ptr); - set.insertBefore(it, ptr); - EXPECT_EQ(1u, set.size()); - set.add(ptr2); - ptr2.clear(); - set.remove(ptr); - - EXPECT_FALSE(isDeleted); - ptr.clear(); - EXPECT_TRUE(isDeleted); - - EXPECT_FALSE(isDeleted2); - set.removeFirst(); - EXPECT_TRUE(isDeleted2); - - EXPECT_EQ(0u, set.size()); -} - -TEST(ListHashSetTest, ExcerciseValuePeekInType) { - excerciseValuePeekInType>>(); - excerciseValuePeekInType, 1>>(); -} - -TEST(LinkedHashSetTest, ExcerciseValuePeekInType) { - excerciseValuePeekInType>>(); -} - -struct Simple { - Simple(int value) : m_value(value){}; - int m_value; -}; - -struct Complicated { - Complicated(int value) : m_simple(value) { s_objectsConstructed++; } - - Complicated(const Complicated& other) : m_simple(other.m_simple) { - s_objectsConstructed++; - } - - Simple m_simple; - static int s_objectsConstructed; - - private: - Complicated(); -}; - -int Complicated::s_objectsConstructed = 0; - -struct ComplicatedHashFunctions { - static unsigned hash(const Complicated& key) { return key.m_simple.m_value; } - static bool equal(const Complicated& a, const Complicated& b) { - return a.m_simple.m_value == b.m_simple.m_value; - } -}; -struct ComplexityTranslator { - static unsigned hash(const Simple& key) { return key.m_value; } - static bool equal(const Complicated& a, const Simple& b) { - return a.m_simple.m_value == b.m_value; - } -}; - -template -void translatorTest() { - Set set; - set.add(Complicated(42)); - int baseLine = Complicated::s_objectsConstructed; - - typename Set::iterator it = - set.template find(Simple(42)); - EXPECT_NE(it, set.end()); - EXPECT_EQ(baseLine, Complicated::s_objectsConstructed); - - it = set.template find(Simple(103)); - EXPECT_EQ(it, set.end()); - EXPECT_EQ(baseLine, Complicated::s_objectsConstructed); - - const Set& constSet(set); - - typename Set::const_iterator constIterator = - constSet.template find(Simple(42)); - EXPECT_NE(constIterator, constSet.end()); - EXPECT_EQ(baseLine, Complicated::s_objectsConstructed); - - constIterator = constSet.template find(Simple(103)); - EXPECT_EQ(constIterator, constSet.end()); - EXPECT_EQ(baseLine, Complicated::s_objectsConstructed); -} - -TEST(ListHashSetTest, ComplexityTranslator) { - translatorTest>(); - translatorTest>(); -} - -TEST(LinkedHashSetTest, ComplexityTranslator) { - translatorTest>(); -} - -struct Dummy { - Dummy(bool& deleted) : deleted(deleted) {} - - ~Dummy() { deleted = true; } - - bool& deleted; -}; - -TEST(ListHashSetTest, WithOwnPtr) { - bool deleted1 = false, deleted2 = false; - - typedef ListHashSet> OwnPtrSet; - OwnPtrSet set; - - Dummy* ptr1 = new Dummy(deleted1); - { - // AddResult in a separate scope to avoid assertion hit, - // since we modify the container further. - OwnPtrSet::AddResult res1 = set.add(adoptPtr(ptr1)); - EXPECT_EQ(res1.storedValue->m_value.get(), ptr1); - } - - EXPECT_FALSE(deleted1); - EXPECT_EQ(1UL, set.size()); - OwnPtrSet::iterator it1 = set.find(ptr1); - EXPECT_NE(set.end(), it1); - EXPECT_EQ(ptr1, (*it1)); - - Dummy* ptr2 = new Dummy(deleted2); - { - OwnPtrSet::AddResult res2 = set.add(adoptPtr(ptr2)); - EXPECT_EQ(res2.storedValue->m_value.get(), ptr2); - } - - EXPECT_FALSE(deleted2); - EXPECT_EQ(2UL, set.size()); - OwnPtrSet::iterator it2 = set.find(ptr2); - EXPECT_NE(set.end(), it2); - EXPECT_EQ(ptr2, (*it2)); - - set.remove(ptr1); - EXPECT_TRUE(deleted1); - - set.clear(); - EXPECT_TRUE(deleted2); - EXPECT_TRUE(set.isEmpty()); - - deleted1 = false; - deleted2 = false; - { - OwnPtrSet set; - set.add(adoptPtr(new Dummy(deleted1))); - set.add(adoptPtr(new Dummy(deleted2))); - } - EXPECT_TRUE(deleted1); - EXPECT_TRUE(deleted2); - - deleted1 = false; - deleted2 = false; - OwnPtr ownPtr1; - OwnPtr ownPtr2; - ptr1 = new Dummy(deleted1); - ptr2 = new Dummy(deleted2); - { - OwnPtrSet set; - set.add(adoptPtr(ptr1)); - set.add(adoptPtr(ptr2)); - ownPtr1 = set.takeFirst(); - EXPECT_EQ(1UL, set.size()); - ownPtr2 = set.take(ptr2); - EXPECT_TRUE(set.isEmpty()); - } - EXPECT_FALSE(deleted1); - EXPECT_FALSE(deleted2); - - EXPECT_EQ(ptr1, ownPtr1); - EXPECT_EQ(ptr2, ownPtr2); -} - -template -void swapTestHelper() { - int num = 10; - Set set0; - Set set1; - Set set2; - for (int i = 0; i < num; ++i) { - set1.add(i + 1); - set2.add(num - i); - } - - typename Set::iterator it1 = set1.begin(); - typename Set::iterator it2 = set2.begin(); - for (int i = 0; i < num; ++i, ++it1, ++it2) { - EXPECT_EQ(*it1, i + 1); - EXPECT_EQ(*it2, num - i); - } - EXPECT_EQ(set0.begin(), set0.end()); - EXPECT_EQ(it1, set1.end()); - EXPECT_EQ(it2, set2.end()); - - // Shift sets: 2->1, 1->0, 0->2 - set1.swap(set2); // Swap with non-empty sets. - set0.swap(set2); // Swap with an empty set. - - it1 = set0.begin(); - it2 = set1.begin(); - for (int i = 0; i < num; ++i, ++it1, ++it2) { - EXPECT_EQ(*it1, i + 1); - EXPECT_EQ(*it2, num - i); - } - EXPECT_EQ(it1, set0.end()); - EXPECT_EQ(it2, set1.end()); - EXPECT_EQ(set2.begin(), set2.end()); - - int removedIndex = num >> 1; - set0.remove(removedIndex + 1); - set1.remove(num - removedIndex); - - it1 = set0.begin(); - it2 = set1.begin(); - for (int i = 0; i < num; ++i, ++it1, ++it2) { - if (i == removedIndex) - ++i; - EXPECT_EQ(*it1, i + 1); - EXPECT_EQ(*it2, num - i); - } - EXPECT_EQ(it1, set0.end()); - EXPECT_EQ(it2, set1.end()); -} - -TEST(ListHashSetTest, Swap) { - swapTestHelper>(); -} - -TEST(LinkedHashSetTest, Swap) { - swapTestHelper>(); -} - -} // namespace diff --git a/sky/engine/wtf/Locker.h b/sky/engine/wtf/Locker.h deleted file mode 100644 index d601da3f565f1..0000000000000 --- a/sky/engine/wtf/Locker.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -#ifndef SKY_ENGINE_WTF_LOCKER_H_ -#define SKY_ENGINE_WTF_LOCKER_H_ - -#include "flutter/sky/engine/wtf/Noncopyable.h" - -namespace WTF { - -template -class Locker { - WTF_MAKE_NONCOPYABLE(Locker); - - public: - Locker(T& lockable) : m_lockable(lockable) { m_lockable.lock(); } - ~Locker() { m_lockable.unlock(); } - - private: - T& m_lockable; -}; - -} // namespace WTF - -using WTF::Locker; - -#endif // SKY_ENGINE_WTF_LOCKER_H_ diff --git a/sky/engine/wtf/MainThread.cpp b/sky/engine/wtf/MainThread.cpp deleted file mode 100644 index c35e15ab1e4ae..0000000000000 --- a/sky/engine/wtf/MainThread.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/MainThread.h" - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/Threading.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -namespace WTF { - -static ThreadIdentifier mainThreadIdentifier; - -void initializeMainThread() { - static bool initializedMainThread; - if (initializedMainThread) - return; - initializedMainThread = true; - - mainThreadIdentifier = currentThread(); - AtomicString::init(); -} - -bool isMainThread() { - return currentThread() == mainThreadIdentifier; -} - -} // namespace WTF diff --git a/sky/engine/wtf/MainThread.h b/sky/engine/wtf/MainThread.h deleted file mode 100644 index f87734278e411..0000000000000 --- a/sky/engine/wtf/MainThread.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_MAINTHREAD_H_ -#define SKY_ENGINE_WTF_MAINTHREAD_H_ - -#include - -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -typedef uint32_t ThreadIdentifier; -typedef void MainThreadFunction(void*); - -WTF_EXPORT void initializeMainThread(); - -WTF_EXPORT bool isMainThread(); - -} // namespace WTF - -using WTF::isMainThread; -#endif // SKY_ENGINE_WTF_MAINTHREAD_H_ diff --git a/sky/engine/wtf/MakeUnique.h b/sky/engine/wtf/MakeUnique.h deleted file mode 100644 index ad09454c34e3c..0000000000000 --- a/sky/engine/wtf/MakeUnique.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2015 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. - -// This is almost the source from N3656 ("make_unique (Revision 1)"; -// https://isocpp.org/files/papers/N3656.txt) almost verbatim, so that we have a -// "make_unique" to use until we can use C++14. The following changes have been -// made: -// - It's called |MakeUnique| instead of |make_unique|. -// - It's in the |WTF| namespace instead of |std|; this also -// necessitates adding some |std::|s. -// - It's been formatted. - -#ifndef SKY_ENGINE_WTF_MAKE_UNIQUE_H_ -#define SKY_ENGINE_WTF_MAKE_UNIQUE_H_ - -#include -#include -#include -#include - -namespace WTF { - -template -struct _Unique_if { - typedef std::unique_ptr _Single_object; -}; - -template -struct _Unique_if { - typedef std::unique_ptr _Unknown_bound; -}; - -template -struct _Unique_if { - typedef void _Known_bound; -}; - -template -typename _Unique_if::_Single_object MakeUnique(Args&&... args) { - return std::unique_ptr(new T(std::forward(args)...)); -} - -template -typename _Unique_if::_Unknown_bound MakeUnique(size_t n) { - typedef typename std::remove_extent::type U; - return std::unique_ptr(new U[n]()); -} - -template -typename _Unique_if::_Known_bound MakeUnique(Args&&...) = delete; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_MAKE_UNIQUE_H_ diff --git a/sky/engine/wtf/MallocZoneSupport.h b/sky/engine/wtf/MallocZoneSupport.h deleted file mode 100644 index 2a3150b72d362..0000000000000 --- a/sky/engine/wtf/MallocZoneSupport.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_MALLOCZONESUPPORT_H_ -#define SKY_ENGINE_WTF_MALLOCZONESUPPORT_H_ - -#include - -namespace WTF { - -class RemoteMemoryReader { - task_t m_task; - memory_reader_t* m_reader; - - public: - RemoteMemoryReader(task_t task, memory_reader_t* reader) - : m_task(task), m_reader(reader) {} - - void* operator()(vm_address_t address, size_t size) const { - void* output; - kern_return_t err = - (*m_reader)(m_task, address, size, static_cast(&output)); - if (err) - output = 0; - return output; - } - - template - T* operator()(T* address, size_t size = sizeof(T)) const { - return static_cast( - (*this)(reinterpret_cast(address), size)); - } - - template - T* nextEntryInHardenedLinkedList(T** address, uintptr_t entropy) const; -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_MALLOCZONESUPPORT_H_ diff --git a/sky/engine/wtf/MathExtras.h b/sky/engine/wtf/MathExtras.h deleted file mode 100644 index f8c3c057a4258..0000000000000 --- a/sky/engine/wtf/MathExtras.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_MATHEXTRAS_H_ -#define SKY_ENGINE_WTF_MATHEXTRAS_H_ - -#include -#include - -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#if COMPILER(MSVC) -#define _USE_MATH_DEFINES -#include -#include -#else -#include -#endif - -const double piDouble = M_PI; -const float piFloat = static_cast(M_PI); - -const double piOverTwoDouble = M_PI_2; -const float piOverTwoFloat = static_cast(M_PI_2); - -const double piOverFourDouble = M_PI_4; -const float piOverFourFloat = static_cast(M_PI_4); - -const double twoPiDouble = piDouble * 2.0; -const float twoPiFloat = piFloat * 2.0f; - -#if OS(ANDROID) -// ANDROID and MSVC's math.h does not currently supply log2 or log2f. -inline double log2(double num) { - // This constant is roughly M_LN2, which is not provided by default on Windows - // and Android. - return log(num) / 0.693147180559945309417232121458176568; -} - -inline float log2f(float num) { - // This constant is roughly M_LN2, which is not provided by default on Windows - // and Android. - return logf(num) / 0.693147180559945309417232121458176568f; -} -#endif - -inline double deg2rad(double d) { - return d * piDouble / 180.0; -} -inline double rad2deg(double r) { - return r * 180.0 / piDouble; -} -inline double deg2grad(double d) { - return d * 400.0 / 360.0; -} -inline double grad2deg(double g) { - return g * 360.0 / 400.0; -} -inline double turn2deg(double t) { - return t * 360.0; -} -inline double deg2turn(double d) { - return d / 360.0; -} -inline double rad2grad(double r) { - return r * 200.0 / piDouble; -} -inline double grad2rad(double g) { - return g * piDouble / 200.0; -} -inline double turn2grad(double t) { - return t * 400; -} -inline double grad2turn(double g) { - return g / 400; -} - -inline float deg2rad(float d) { - return d * piFloat / 180.0f; -} -inline float rad2deg(float r) { - return r * 180.0f / piFloat; -} -inline float deg2grad(float d) { - return d * 400.0f / 360.0f; -} -inline float grad2deg(float g) { - return g * 360.0f / 400.0f; -} -inline float turn2deg(float t) { - return t * 360.0f; -} -inline float deg2turn(float d) { - return d / 360.0f; -} -inline float rad2grad(float r) { - return r * 200.0f / piFloat; -} -inline float grad2rad(float g) { - return g * piFloat / 200.0f; -} -inline float turn2grad(float t) { - return t * 400; -} -inline float grad2turn(float g) { - return g / 400; -} - -// std::numeric_limits::min() returns the smallest positive value for -// floating point types -template -inline T defaultMinimumForClamp() { - return std::numeric_limits::min(); -} -template <> -inline float defaultMinimumForClamp() { - return -std::numeric_limits::max(); -} -template <> -inline double defaultMinimumForClamp() { - return -std::numeric_limits::max(); -} -template -inline T defaultMaximumForClamp() { - return std::numeric_limits::max(); -} - -template -inline T clampTo(double value, - T min = defaultMinimumForClamp(), - T max = defaultMaximumForClamp()) { - if (value >= static_cast(max)) - return max; - if (value <= static_cast(min)) - return min; - return static_cast(value); -} -template <> -inline long long int clampTo( - double, - long long int, - long long int); // clampTo does not support long long ints. - -inline int clampToInteger(double value) { - return clampTo(value); -} - -inline unsigned clampToUnsigned(double value) { - return clampTo(value); -} - -inline float clampToFloat(double value) { - return clampTo(value); -} - -inline int clampToPositiveInteger(double value) { - return clampTo(value, 0); -} - -inline int clampToInteger(float value) { - return clampTo(value); -} - -inline int clampToInteger(unsigned x) { - const unsigned intMax = - static_cast(std::numeric_limits::max()); - - if (x >= intMax) - return std::numeric_limits::max(); - return static_cast(x); -} - -inline bool isWithinIntRange(float x) { - return x > static_cast(std::numeric_limits::min()) && - x < static_cast(std::numeric_limits::max()); -} - -static size_t greatestCommonDivisor(size_t a, size_t b) { - return b ? greatestCommonDivisor(b, a % b) : a; -} - -inline size_t lowestCommonMultiple(size_t a, size_t b) { - return a && b ? a / greatestCommonDivisor(a, b) * b : 0; -} - -#ifndef UINT64_C -#define UINT64_C(c) c##ull -#endif - -// Calculate d % 2^{64}. -inline void doubleToInteger(double d, unsigned long long& value) { - if (std::isnan(d) || std::isinf(d)) - value = 0; - else { - // -2^{64} < fmodValue < 2^{64}. - double fmodValue = - fmod(trunc(d), std::numeric_limits::max() + 1.0); - if (fmodValue >= 0) { - // 0 <= fmodValue < 2^{64}. - // 0 <= value < 2^{64}. This cast causes no loss. - value = static_cast(fmodValue); - } else { - // -2^{64} < fmodValue < 0. - // 0 < fmodValueInUnsignedLongLong < 2^{64}. This cast causes no loss. - unsigned long long fmodValueInUnsignedLongLong = - static_cast(-fmodValue); - // -1 < (std::numeric_limits::max() - - // fmodValueInUnsignedLongLong) < 2^{64} - 1. 0 < value < 2^{64}. - value = std::numeric_limits::max() - - fmodValueInUnsignedLongLong + 1; - } - } -} - -namespace WTF { - -inline unsigned fastLog2(unsigned i) { - unsigned log2 = 0; - if (i & (i - 1)) - log2 += 1; - if (i >> 16) - log2 += 16, i >>= 16; - if (i >> 8) - log2 += 8, i >>= 8; - if (i >> 4) - log2 += 4, i >>= 4; - if (i >> 2) - log2 += 2, i >>= 2; - if (i >> 1) - log2 += 1; - return log2; -} - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_MATHEXTRAS_H_ diff --git a/sky/engine/wtf/MathExtrasTest.cpp b/sky/engine/wtf/MathExtrasTest.cpp deleted file mode 100644 index 7ec2405f864d0..0000000000000 --- a/sky/engine/wtf/MathExtrasTest.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (C) 2012 Intel Corporation - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/MathExtras.h" - -namespace { - -TEST(MathExtrasTest, Lrint) { - EXPECT_EQ(-8, lrint(-7.5)); - EXPECT_EQ(-8, lrint(-8.5)); - EXPECT_EQ(0, lrint(-0.5)); - EXPECT_EQ(0, lrint(0.5)); - EXPECT_EQ(0, lrint(-0.5)); - EXPECT_EQ(1, lrint(1.3)); - EXPECT_EQ(2, lrint(1.7)); - EXPECT_EQ(0, lrint(0)); - EXPECT_EQ(0, lrint(-0)); - if (sizeof(long int) == 8) { - // Largest double number with 0.5 precision and one halfway rounding case - // below. - EXPECT_EQ(pow(2.0, 52), lrint(pow(2.0, 52) - 0.5)); - EXPECT_EQ(pow(2.0, 52) - 2, lrint(pow(2.0, 52) - 1.5)); - // Smallest double number with 0.5 precision and one halfway rounding case - // above. - EXPECT_EQ(-pow(2.0, 52), lrint(-pow(2.0, 52) + 0.5)); - EXPECT_EQ(-pow(2.0, 52) + 2, lrint(-pow(2.0, 52) + 1.5)); - } -} - -TEST(MathExtrasTest, clampToIntLong) { - if (sizeof(long) == sizeof(int)) - return; - - long maxInt = std::numeric_limits::max(); - long minInt = std::numeric_limits::min(); - long overflowInt = maxInt + 1; - long underflowInt = minInt - 1; - - EXPECT_GT(overflowInt, maxInt); - EXPECT_LT(underflowInt, minInt); - - EXPECT_EQ(maxInt, clampTo(maxInt)); - EXPECT_EQ(minInt, clampTo(minInt)); - - EXPECT_EQ(maxInt, clampTo(overflowInt)); - EXPECT_EQ(minInt, clampTo(underflowInt)); -} - -TEST(MathExtrasTest, clampToIntLongLong) { - long long maxInt = std::numeric_limits::max(); - long long minInt = std::numeric_limits::min(); - long long overflowInt = maxInt + 1; - long long underflowInt = minInt - 1; - - EXPECT_GT(overflowInt, maxInt); - EXPECT_LT(underflowInt, minInt); - - EXPECT_EQ(maxInt, clampTo(maxInt)); - EXPECT_EQ(minInt, clampTo(minInt)); - - EXPECT_EQ(maxInt, clampTo(overflowInt)); - EXPECT_EQ(minInt, clampTo(underflowInt)); -} - -TEST(MathExtrasTest, clampToIntegerFloat) { - // This test is inaccurate as floats will round the min / max integer - // due to the narrow mantissa. However it will properly checks within - // (close to the extreme) and outside the integer range. - float maxInt = std::numeric_limits::max(); - float minInt = std::numeric_limits::min(); - float overflowInt = maxInt * 1.1; - float underflowInt = minInt * 1.1; - - EXPECT_GT(overflowInt, maxInt); - EXPECT_LT(underflowInt, minInt); - - // If maxInt == 2^31 - 1 (ie on I32 architecture), the closest float used to - // represent it is 2^31. - EXPECT_NEAR(clampToInteger(maxInt), maxInt, 1); - EXPECT_EQ(minInt, clampToInteger(minInt)); - - EXPECT_NEAR(clampToInteger(overflowInt), maxInt, 1); - EXPECT_EQ(minInt, clampToInteger(underflowInt)); -} - -TEST(MathExtrasTest, clampToIntegerDouble) { - double maxInt = std::numeric_limits::max(); - double minInt = std::numeric_limits::min(); - double overflowInt = maxInt + 1; - double underflowInt = minInt - 1; - - EXPECT_GT(overflowInt, maxInt); - EXPECT_LT(underflowInt, minInt); - - EXPECT_EQ(maxInt, clampToInteger(maxInt)); - EXPECT_EQ(minInt, clampToInteger(minInt)); - - EXPECT_EQ(clampToInteger(overflowInt), maxInt); - EXPECT_EQ(clampToInteger(underflowInt), minInt); -} - -TEST(MathExtrasTest, clampToFloat) { - double maxFloat = std::numeric_limits::max(); - double minFloat = -maxFloat; - double overflowFloat = maxFloat * 1.1; - double underflowFloat = minFloat * 1.1; - - EXPECT_GT(overflowFloat, maxFloat); - EXPECT_LT(underflowFloat, minFloat); - - EXPECT_EQ(maxFloat, clampToFloat(maxFloat)); - EXPECT_EQ(minFloat, clampToFloat(minFloat)); - - EXPECT_EQ(maxFloat, clampToFloat(overflowFloat)); - EXPECT_EQ(minFloat, clampToFloat(underflowFloat)); - - EXPECT_EQ(maxFloat, clampToFloat(std::numeric_limits::infinity())); - EXPECT_EQ(minFloat, clampToFloat(-std::numeric_limits::infinity())); -} - -TEST(MathExtrasTest, clampToUnsignedLong) { - if (sizeof(unsigned long) == sizeof(unsigned)) - return; - - unsigned long maxUnsigned = std::numeric_limits::max(); - unsigned long overflowUnsigned = maxUnsigned + 1; - - EXPECT_GT(overflowUnsigned, maxUnsigned); - - EXPECT_EQ(maxUnsigned, clampTo(maxUnsigned)); - - EXPECT_EQ(maxUnsigned, clampTo(overflowUnsigned)); - EXPECT_EQ(0u, clampTo(-1)); -} - -TEST(MathExtrasTest, clampToUnsignedLongLong) { - unsigned long long maxUnsigned = std::numeric_limits::max(); - unsigned long long overflowUnsigned = maxUnsigned + 1; - - EXPECT_GT(overflowUnsigned, maxUnsigned); - - EXPECT_EQ(maxUnsigned, clampTo(maxUnsigned)); - - EXPECT_EQ(maxUnsigned, clampTo(overflowUnsigned)); - EXPECT_EQ(0u, clampTo(-1)); -} - -// Make sure that various +-inf cases are handled properly (they aren't -// by default on VS). -TEST(MathExtrasTest, infinityMath) { - double posInf = std::numeric_limits::infinity(); - double negInf = -std::numeric_limits::infinity(); - double nan = std::numeric_limits::quiet_NaN(); - - EXPECT_EQ(M_PI_4, atan2(posInf, posInf)); - EXPECT_EQ(3.0 * M_PI_4, atan2(posInf, negInf)); - EXPECT_EQ(-M_PI_4, atan2(negInf, posInf)); - EXPECT_EQ(-3.0 * M_PI_4, atan2(negInf, negInf)); - - EXPECT_EQ(0.0, fmod(0.0, posInf)); - EXPECT_EQ(7.0, fmod(7.0, posInf)); - EXPECT_EQ(-7.0, fmod(-7.0, posInf)); - EXPECT_EQ(0.0, fmod(0.0, negInf)); - EXPECT_EQ(7.0, fmod(7.0, negInf)); - EXPECT_EQ(-7.0, fmod(-7.0, negInf)); - - EXPECT_EQ(1.0, pow(5.0, 0.0)); - EXPECT_EQ(1.0, pow(-5.0, 0.0)); - EXPECT_EQ(1.0, pow(nan, 0.0)); -} - -} // namespace diff --git a/sky/engine/wtf/NonCopyingSort.h b/sky/engine/wtf/NonCopyingSort.h deleted file mode 100644 index e7e65a0d8757f..0000000000000 --- a/sky/engine/wtf/NonCopyingSort.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef SKY_ENGINE_WTF_NONCOPYINGSORT_H_ -#define SKY_ENGINE_WTF_NONCOPYINGSORT_H_ - -namespace WTF { - -using std::swap; - -template -inline void siftDown(RandomAccessIterator array, - ptrdiff_t start, - ptrdiff_t end, - Predicate compareLess) { - ptrdiff_t root = start; - - while (root * 2 + 1 <= end) { - ptrdiff_t child = root * 2 + 1; - if (child < end && compareLess(array[child], array[child + 1])) - child++; - - if (compareLess(array[root], array[child])) { - swap(array[root], array[child]); - root = child; - } else - return; - } -} - -template -inline void heapify(RandomAccessIterator array, - ptrdiff_t count, - Predicate compareLess) { - ptrdiff_t start = (count - 2) / 2; - - while (start >= 0) { - siftDown(array, start, count - 1, compareLess); - start--; - } -} - -template -void heapSort(RandomAccessIterator start, - RandomAccessIterator end, - Predicate compareLess) { - ptrdiff_t count = end - start; - heapify(start, count, compareLess); - - ptrdiff_t endIndex = count - 1; - while (endIndex > 0) { - swap(start[endIndex], start[0]); - siftDown(start, 0, endIndex - 1, compareLess); - endIndex--; - } -} - -template -inline void nonCopyingSort(RandomAccessIterator start, - RandomAccessIterator end, - Predicate compareLess) { - // heapsort happens to use only swaps, not copies, but the essential thing - // about this function is the fact that it does not copy, not the specific - // algorithm - heapSort(start, end, compareLess); -} - -} // namespace WTF - -using WTF::nonCopyingSort; - -#endif // SKY_ENGINE_WTF_NONCOPYINGSORT_H_ diff --git a/sky/engine/wtf/Noncopyable.h b/sky/engine/wtf/Noncopyable.h deleted file mode 100644 index 7254ed80e9c84..0000000000000 --- a/sky/engine/wtf/Noncopyable.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_NONCOPYABLE_H_ -#define SKY_ENGINE_WTF_NONCOPYABLE_H_ - -#include "flutter/sky/engine/wtf/Compiler.h" - -#define WTF_MAKE_NONCOPYABLE(ClassName) \ - private: \ - ClassName(const ClassName&) = delete; \ - ClassName& operator=(const ClassName&) = delete; - -#endif // SKY_ENGINE_WTF_NONCOPYABLE_H_ diff --git a/sky/engine/wtf/NotFound.h b/sky/engine/wtf/NotFound.h deleted file mode 100644 index a90e96c9895e8..0000000000000 --- a/sky/engine/wtf/NotFound.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_NOTFOUND_H_ -#define SKY_ENGINE_WTF_NOTFOUND_H_ - -namespace WTF { -const size_t kNotFound = static_cast(-1); -} - -using WTF::kNotFound; - -#endif // SKY_ENGINE_WTF_NOTFOUND_H_ diff --git a/sky/engine/wtf/NullPtr.h b/sky/engine/wtf/NullPtr.h deleted file mode 100644 index de5a13c471f39..0000000000000 --- a/sky/engine/wtf/NullPtr.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -#ifndef SKY_ENGINE_WTF_NULLPTR_H_ -#define SKY_ENGINE_WTF_NULLPTR_H_ - -// libstdc++ supports nullptr_t starting with gcc 4.6. STLport doesn't define -// it. -#if (defined(__GLIBCXX__) && __GLIBCXX__ < 20110325) || \ - defined(_STLPORT_VERSION) -namespace std { -typedef decltype(nullptr) nullptr_t; -} -#endif - -#define WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(ClassName) \ - private: \ - ClassName(int) = delete -#define WTF_DISALLOW_ZERO_ASSIGNMENT(ClassName) \ - private: \ - ClassName& operator=(int) = delete - -#endif // SKY_ENGINE_WTF_NULLPTR_H_ diff --git a/sky/engine/wtf/OperatingSystem.h b/sky/engine/wtf/OperatingSystem.h deleted file mode 100644 index 19b64896f0507..0000000000000 --- a/sky/engine/wtf/OperatingSystem.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006, 2013 Apple Inc. - * Copyright (C) 2009 Google Inc. All rights reserved. - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_OPERATING_SYSTEM_H_ -#define SKY_ENGINE_WTF_OPERATING_SYSTEM_H_ - -/* ==== Platform adaptation macros: these describe properties of the target - * environment. ==== */ - -/* HAVE() - specific system features (headers, functions or similar) that are - * present or not */ -#define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE) -/* OS() - underlying operating system; only to be used for mandated low-level - services like virtual memory, not to choose a GUI toolkit */ -#define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE) - -/* ==== Policy decision macros: these define policy choices for a particular - * port. ==== */ - -/* USE() - use a particular third-party library or optional OS service */ -#define USE(WTF_FEATURE) \ - (defined WTF_USE_##WTF_FEATURE && WTF_USE_##WTF_FEATURE) -/* ENABLE() - turn on a specific feature of WebKit */ -#define ENABLE(WTF_FEATURE) \ - (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE) - -/* ==== OS() - underlying operating system; only to be used for mandated - low-level services like virtual memory, not to choose a GUI toolkit ==== */ - -/* OS(ANDROID) - Android */ -#ifdef ANDROID -#define WTF_OS_ANDROID 1 -/* OS(LINUX) - Linux */ -#elif defined(__linux__) -#define WTF_OS_LINUX 1 -#endif - -#ifdef __Fuchsia__ -#define WTF_OS_FUCHSIA 1 -#endif - -/* OS(WIN) - Windows */ -#ifdef _WIN32 -#define WTF_OS_WIN 1 -#endif - -/* OS(WIN64) - Windows 64-bit */ -#ifdef _WIN64 -#define WTF_OS_WIN64 1 -#endif - -/* Always OS(POSIX) */ -#ifndef _WIN32 -#define WTF_OS_POSIX 1 -#endif - -#ifdef __APPLE__ -/* OS(MACOSX) - Mac and iOS */ -#define WTF_OS_MACOSX 1 -#include -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR -/* OS(IOS) - iOS */ -#define WTF_OS_IOS 1 -#endif -#endif /* __APPLE__ */ - -/* Operating environments */ - -#if OS(ANDROID) || OS(IOS) || OS(MACOSX) || OS(LINUX) -#define WTF_USE_LOW_QUALITY_IMAGE_INTERPOLATION 1 -#define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_DITHERING 1 -#define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING 1 -#else -#define WTF_USE_ICCJPEG 1 -#define WTF_USE_QCMSLIB 1 -#endif - -#if OS(POSIX) -#define HAVE_SIGNAL_H 1 -#define HAVE_SYS_TIME_H 1 -#define WTF_USE_PTHREADS 1 -#endif - -#endif // SKY_ENGINE_WTF_OPERATING_SYSTEM_H_ diff --git a/sky/engine/wtf/OwnPtr.h b/sky/engine/wtf/OwnPtr.h deleted file mode 100644 index a94211e9d9ac1..0000000000000 --- a/sky/engine/wtf/OwnPtr.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_OWNPTR_H_ -#define SKY_ENGINE_WTF_OWNPTR_H_ - -#include -#include "flutter/sky/engine/wtf/HashTableDeletedValueType.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/NullPtr.h" -#include "flutter/sky/engine/wtf/OwnPtrCommon.h" - -namespace WTF { - -template -class PassOwnPtr; - -template -class OwnPtr { - // If rvalue references are not supported, the copy constructor is - // public so OwnPtr cannot be marked noncopyable. See note below. - WTF_MAKE_NONCOPYABLE(OwnPtr); - WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(OwnPtr); - - public: - typedef typename RemoveExtent::Type ValueType; - typedef ValueType* PtrType; - - OwnPtr() : m_ptr(0) {} - OwnPtr(std::nullptr_t) : m_ptr(0) {} - - // See comment in PassOwnPtr.h for why this takes a const reference. - OwnPtr(const PassOwnPtr&); - template - OwnPtr(const PassOwnPtr&, EnsurePtrConvertibleArgDecl(U, T)); - - // Hash table deleted values, which are only constructed and never copied or - // destroyed. - OwnPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) {} - bool isHashTableDeletedValue() const { - return m_ptr == hashTableDeletedValue(); - } - - ~OwnPtr() { - OwnedPtrDeleter::deletePtr(m_ptr); - m_ptr = 0; - } - - PtrType get() const { return m_ptr; } - - void clear(); - PassOwnPtr release(); - PtrType leakPtr() WARN_UNUSED_RETURN; - - ValueType& operator*() const { - ASSERT(m_ptr); - return *m_ptr; - } - PtrType operator->() const { - ASSERT(m_ptr); - return m_ptr; - } - - ValueType& operator[](std::ptrdiff_t i) const; - - bool operator!() const { return !m_ptr; } - - // This conversion operator allows implicit conversion to bool but not to - // other integer types. - typedef PtrType OwnPtr::*UnspecifiedBoolType; - operator UnspecifiedBoolType() const { return m_ptr ? &OwnPtr::m_ptr : 0; } - - OwnPtr& operator=(const PassOwnPtr&); - OwnPtr& operator=(std::nullptr_t) { - clear(); - return *this; - } - template - OwnPtr& operator=(const PassOwnPtr&); - - OwnPtr(OwnPtr&&); - template - OwnPtr(OwnPtr&&); - - OwnPtr& operator=(OwnPtr&&); - template - OwnPtr& operator=(OwnPtr&&); - - void swap(OwnPtr& o) { std::swap(m_ptr, o.m_ptr); } - - static T* hashTableDeletedValue() { return reinterpret_cast(-1); } - - private: - // We should never have two OwnPtrs for the same underlying object (otherwise - // we'll get double-destruction), so these equality operators should never be - // needed. - template - bool operator==(const OwnPtr&) const { - COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); - return false; - } - template - bool operator!=(const OwnPtr&) const { - COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); - return false; - } - template - bool operator==(const PassOwnPtr&) const { - COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); - return false; - } - template - bool operator!=(const PassOwnPtr&) const { - COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); - return false; - } - - PtrType m_ptr; -}; - -template -inline OwnPtr::OwnPtr(const PassOwnPtr& o) : m_ptr(o.leakPtr()) {} - -template -template -inline OwnPtr::OwnPtr(const PassOwnPtr& o, - EnsurePtrConvertibleArgDefn(U, T)) - : m_ptr(o.leakPtr()) { - COMPILE_ASSERT(!IsArray::value, Pointers_to_array_must_never_be_converted); -} - -template -inline void OwnPtr::clear() { - PtrType ptr = m_ptr; - m_ptr = 0; - OwnedPtrDeleter::deletePtr(ptr); -} - -template -inline PassOwnPtr OwnPtr::release() { - PtrType ptr = m_ptr; - m_ptr = 0; - return PassOwnPtr(ptr); -} - -template -inline typename OwnPtr::PtrType OwnPtr::leakPtr() { - PtrType ptr = m_ptr; - m_ptr = 0; - return ptr; -} - -template -inline typename OwnPtr::ValueType& OwnPtr::operator[]( - std::ptrdiff_t i) const { - COMPILE_ASSERT(IsArray::value, - Elements_access_is_possible_for_arrays_only); - ASSERT(m_ptr); - ASSERT(i >= 0); - return m_ptr[i]; -} - -template -inline OwnPtr& OwnPtr::operator=(const PassOwnPtr& o) { - PtrType ptr = m_ptr; - m_ptr = o.leakPtr(); - ASSERT(!ptr || m_ptr != ptr); - OwnedPtrDeleter::deletePtr(ptr); - return *this; -} - -template -template -inline OwnPtr& OwnPtr::operator=(const PassOwnPtr& o) { - COMPILE_ASSERT(!IsArray::value, Pointers_to_array_must_never_be_converted); - PtrType ptr = m_ptr; - m_ptr = o.leakPtr(); - ASSERT(!ptr || m_ptr != ptr); - OwnedPtrDeleter::deletePtr(ptr); - return *this; -} - -template -inline OwnPtr::OwnPtr(OwnPtr&& o) : m_ptr(o.leakPtr()) {} - -template -template -inline OwnPtr::OwnPtr(OwnPtr&& o) : m_ptr(o.leakPtr()) { - COMPILE_ASSERT(!IsArray::value, Pointers_to_array_must_never_be_converted); -} - -template -inline OwnPtr& OwnPtr::operator=(OwnPtr&& o) { - PtrType ptr = m_ptr; - m_ptr = o.leakPtr(); - ASSERT(!ptr || m_ptr != ptr); - OwnedPtrDeleter::deletePtr(ptr); - - return *this; -} - -template -template -inline OwnPtr& OwnPtr::operator=(OwnPtr&& o) { - COMPILE_ASSERT(!IsArray::value, Pointers_to_array_must_never_be_converted); - PtrType ptr = m_ptr; - m_ptr = o.leakPtr(); - ASSERT(!ptr || m_ptr != ptr); - OwnedPtrDeleter::deletePtr(ptr); - - return *this; -} - -template -inline void swap(OwnPtr& a, OwnPtr& b) { - a.swap(b); -} - -template -inline bool operator==(const OwnPtr& a, U* b) { - return a.get() == b; -} - -template -inline bool operator==(T* a, const OwnPtr& b) { - return a == b.get(); -} - -template -inline bool operator!=(const OwnPtr& a, U* b) { - return a.get() != b; -} - -template -inline bool operator!=(T* a, const OwnPtr& b) { - return a != b.get(); -} - -template -inline typename OwnPtr::PtrType getPtr(const OwnPtr& p) { - return p.get(); -} - -} // namespace WTF - -using WTF::OwnPtr; - -#endif // SKY_ENGINE_WTF_OWNPTR_H_ diff --git a/sky/engine/wtf/OwnPtrCommon.h b/sky/engine/wtf/OwnPtrCommon.h deleted file mode 100644 index b14c7f55400ed..0000000000000 --- a/sky/engine/wtf/OwnPtrCommon.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * Copyright (C) 2009 Torch Mobile, Inc. - * Copyright (C) 2010 Company 100 Inc. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_OWNPTRCOMMON_H_ -#define SKY_ENGINE_WTF_OWNPTRCOMMON_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/TypeTraits.h" - -namespace WTF { - -class RefCountedBase; -class ThreadSafeRefCountedBase; - -template -struct IsRefCounted { - static const bool value = IsSubclass::value || - IsSubclass::value; -}; - -template -struct OwnedPtrDeleter { - static void deletePtr(T* ptr) { - COMPILE_ASSERT(!IsRefCounted::value, UseRefPtrForRefCountedObjects); - COMPILE_ASSERT(sizeof(T) > 0, TypeMustBeComplete); - delete ptr; - } -}; - -template -struct OwnedPtrDeleter { - static void deletePtr(T* ptr) { - COMPILE_ASSERT(!IsRefCounted::value, UseRefPtrForRefCountedObjects); - COMPILE_ASSERT(sizeof(T) > 0, TypeMustBeComplete); - delete[] ptr; - } -}; - -template -struct OwnedPtrDeleter { - COMPILE_ASSERT(sizeof(T) < 0, DoNotUseArrayWithSizeAsType); -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_OWNPTRCOMMON_H_ diff --git a/sky/engine/wtf/PageAllocator.cpp b/sky/engine/wtf/PageAllocator.cpp deleted file mode 100644 index 52ad28cc3188b..0000000000000 --- a/sky/engine/wtf/PageAllocator.cpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/PageAllocator.h" - -#include "flutter/sky/engine/wtf/AddressSpaceRandomization.h" -#include "flutter/sky/engine/wtf/Assertions.h" - -#include - -#if OS(POSIX) - -#include -#include -#include -#include -#include "garnet/public/lib/fxl/logging.h" - -#ifndef MADV_FREE -#define MADV_FREE MADV_DONTNEED -#endif - -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif - -#elif OS(WIN) -#include -#else -#error Unknown OS -#endif // OS(POSIX) - -namespace WTF { - -// This simple internal function wraps the OS-specific page allocation call so -// that it behaves consistently: the address is a hint and if it cannot be used, -// the allocation will be placed elsewhere. -static void* systemAllocPages(void* addr, size_t len) { - ASSERT(!(len & kPageAllocationGranularityOffsetMask)); - ASSERT(!(reinterpret_cast(addr) & - kPageAllocationGranularityOffsetMask)); - void* ret = 0; -#if OS(WIN) - ret = VirtualAlloc(addr, len, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - if (!ret) - ret = VirtualAlloc(0, len, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); -#else - ret = mmap(addr, len, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, - 0); - if (ret == MAP_FAILED) - ret = 0; -#endif - return ret; -} - -static bool trimMapping(void* baseAddr, - size_t baseLen, - void* trimAddr, - size_t trimLen) { -#if OS(WIN) - return false; -#else - char* basePtr = static_cast(baseAddr); - char* trimPtr = static_cast(trimAddr); - ASSERT(trimPtr >= basePtr); - ASSERT(trimPtr + trimLen <= basePtr + baseLen); - size_t preLen = trimPtr - basePtr; - if (preLen) { - int ret = munmap(basePtr, preLen); - RELEASE_ASSERT(!ret); - } - size_t postLen = (basePtr + baseLen) - (trimPtr + trimLen); - if (postLen) { - int ret = munmap(trimPtr + trimLen, postLen); - RELEASE_ASSERT(!ret); - } - return true; -#endif -} - -void* allocPages(void* addr, size_t len, size_t align) { - ASSERT(len >= kPageAllocationGranularity); - ASSERT(!(len & kPageAllocationGranularityOffsetMask)); - ASSERT(align >= kPageAllocationGranularity); - ASSERT(!(align & kPageAllocationGranularityOffsetMask)); - ASSERT(!(reinterpret_cast(addr) & - kPageAllocationGranularityOffsetMask)); - size_t alignOffsetMask = align - 1; - size_t alignBaseMask = ~alignOffsetMask; - ASSERT(!(reinterpret_cast(addr) & alignOffsetMask)); - // If the client passed null as the address, choose a good one. - if (!addr) { - addr = getRandomPageBase(); - addr = reinterpret_cast(reinterpret_cast(addr) & - alignBaseMask); - } - - // The common case, which is also the least work we can do, is that the - // address and length are suitable. Just try it. - void* ret = systemAllocPages(addr, len); - // If the alignment is to our liking, we're done. - if (!ret || !(reinterpret_cast(ret) & alignOffsetMask)) - return ret; - - // Annoying. Unmap and map a larger range to be sure to succeed on the - // second, slower attempt. - freePages(ret, len); - - size_t tryLen = len + (align - kPageAllocationGranularity); - RELEASE_ASSERT(tryLen > len); - - // We loop to cater for the unlikely case where another thread maps on top - // of the aligned location we choose. - int count = 0; - while (count++ < 100) { - ret = systemAllocPages(addr, tryLen); - if (!ret) - return 0; - // We can now try and trim out a subset of the mapping. - addr = reinterpret_cast( - (reinterpret_cast(ret) + alignOffsetMask) & alignBaseMask); - - // On POSIX systems, we can trim the oversized mapping to fit exactly. - // This will always work on POSIX systems. - if (trimMapping(ret, tryLen, addr, len)) - return addr; - - // On Windows, you can't trim an existing mapping so we unmap and remap - // a subset. We used to do for all platforms, but OSX 10.8 has a - // broken mmap() that ignores address hints for valid, unused addresses. - freePages(ret, tryLen); - ret = systemAllocPages(addr, len); - if (ret == addr || !ret) - return ret; - - // Unlikely race / collision. Do the simple thing and just start again. - freePages(ret, len); - addr = getRandomPageBase(); - addr = reinterpret_cast(reinterpret_cast(addr) & - alignBaseMask); - } - IMMEDIATE_CRASH(); - return 0; -} - -void freePages(void* addr, size_t len) { - ASSERT(!(reinterpret_cast(addr) & - kPageAllocationGranularityOffsetMask)); - ASSERT(!(len & kPageAllocationGranularityOffsetMask)); -#if OS(POSIX) - int ret = munmap(addr, len); - RELEASE_ASSERT(!ret); -#else - BOOL ret = VirtualFree(addr, 0, MEM_RELEASE); - RELEASE_ASSERT(ret); -#endif -} - -void setSystemPagesInaccessible(void* addr, size_t len) { - ASSERT(!(len & kSystemPageOffsetMask)); -#if OS(POSIX) - int ret = mprotect(addr, len, PROT_NONE); - RELEASE_ASSERT(!ret); -#else - BOOL ret = VirtualFree(addr, len, MEM_DECOMMIT); - RELEASE_ASSERT(ret); -#endif -} - -void setSystemPagesAccessible(void* addr, size_t len) { - ASSERT(!(len & kSystemPageOffsetMask)); -#if OS(POSIX) - int ret = mprotect(addr, len, PROT_READ | PROT_WRITE); - RELEASE_ASSERT(!ret); -#else - void* ret = VirtualAlloc(addr, len, MEM_COMMIT, PAGE_READWRITE); - RELEASE_ASSERT(ret); -#endif -} - -void decommitSystemPages(void* addr, size_t len) { - ASSERT(!(len & kSystemPageOffsetMask)); -#if OS(POSIX) - if (madvise(addr, len, MADV_FREE)) { - FXL_LOG(ERROR) << "Error '" << strerror(errno) << " (" << errno - << ")' on madvise(" << addr << "," << len << ",MADV_FREE);"; - } -#else - setSystemPagesInaccessible(addr, len); -#endif -} - -void recommitSystemPages(void* addr, size_t len) { - ASSERT(!(len & kSystemPageOffsetMask)); -#if OS(POSIX) - (void)addr; -#else - setSystemPagesAccessible(addr, len); -#endif -} - -} // namespace WTF diff --git a/sky/engine/wtf/PageAllocator.h b/sky/engine/wtf/PageAllocator.h deleted file mode 100644 index 63af754f708bc..0000000000000 --- a/sky/engine/wtf/PageAllocator.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_PAGEALLOCATOR_H_ -#define SKY_ENGINE_WTF_PAGEALLOCATOR_H_ - -#include -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -#if OS(WIN) -static const size_t kPageAllocationGranularityShift = 16; // 64KB -#else -static const size_t kPageAllocationGranularityShift = 12; // 4KB -#endif -static const size_t kPageAllocationGranularity = - 1 << kPageAllocationGranularityShift; -static const size_t kPageAllocationGranularityOffsetMask = - kPageAllocationGranularity - 1; -static const size_t kPageAllocationGranularityBaseMask = - ~kPageAllocationGranularityOffsetMask; - -// All Blink-supported systems have 4096 sized system pages and can handle -// permissions and commit / decommit at this granularity. -static const size_t kSystemPageSize = 4096; -static const size_t kSystemPageOffsetMask = kSystemPageSize - 1; -static const size_t kSystemPageBaseMask = ~kSystemPageOffsetMask; - -// Allocate one or more pages. Addresses in the range will be readable and -// writeable but not executable. -// The requested address is just a hint; the actual address returned may -// differ. The returned address will be aligned at least to align bytes. -// len is in bytes, and must be a multiple of kPageAllocationGranularity. -// align is in bytes, and must be a power-of-two multiple of -// kPageAllocationGranularity. -// If addr is null, then a suitable and randomized address will be chosen -// automatically. -// This call will return null if the allocation cannot be satisfied. -WTF_EXPORT void* allocPages(void* addr, size_t len, size_t align); - -// Free one or more pages. -// addr and len must match a previous call to allocPages(). -WTF_EXPORT void freePages(void* addr, size_t len); - -// Mark one or more system pages as being inaccessible. -// Subsequently accessing any address in the range will fault, and the -// addresses will not be re-used by future allocations. -// len must be a multiple of kSystemPageSize bytes. -WTF_EXPORT void setSystemPagesInaccessible(void* addr, size_t len); - -// Mark one or more system pages as being accessible. -// The pages will be readable and writeable. -// len must be a multiple of kSystemPageSize bytes. -WTF_EXPORT void setSystemPagesAccessible(void* addr, size_t len); - -// Decommit one or more system pages. Decommitted means that the physical memory -// is released to the system, but the virtual address space remains reserved. -// System pages are re-committed by calling recommitSystemPages(). Touching -// a decommitted page _may_ fault. -// Clients should not make any assumptions about the contents of decommitted -// system pages, before or after they write to the page. The only guarantee -// provided is that the contents of the system page will be deterministic again -// after recommitting and writing to it. In particlar note that system pages -// are// not guaranteed to be zero-filled upon re-commit. len must be a multiple -// of kSystemPageSize bytes. -WTF_EXPORT void decommitSystemPages(void* addr, size_t len); - -// Recommit one or more system pages. Decommitted system pages must be -// recommitted before they are read are written again. -// Note that this operation may be a no-op on some platforms. -// len must be a multiple of kSystemPageSize bytes. -WTF_EXPORT void recommitSystemPages(void* addr, size_t len); - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_PAGEALLOCATOR_H_ diff --git a/sky/engine/wtf/PartitionAlloc.cpp b/sky/engine/wtf/PartitionAlloc.cpp deleted file mode 100644 index aaf56a830af22..0000000000000 --- a/sky/engine/wtf/PartitionAlloc.cpp +++ /dev/null @@ -1,1051 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/PartitionAlloc.h" - -#include - -#ifndef NDEBUG -#include -#endif - -// Two partition pages are used as guard / metadata page so make sure the super -// page size is bigger. -COMPILE_ASSERT(WTF::kPartitionPageSize * 4 <= WTF::kSuperPageSize, - ok_super_page_size); -COMPILE_ASSERT(!(WTF::kSuperPageSize % WTF::kPartitionPageSize), - ok_super_page_multiple); -// Four system pages gives us room to hack out a still-guard-paged piece -// of metadata in the middle of a guard partition page. -COMPILE_ASSERT(WTF::kSystemPageSize * 4 <= WTF::kPartitionPageSize, - ok_partition_page_size); -COMPILE_ASSERT(!(WTF::kPartitionPageSize % WTF::kSystemPageSize), - ok_partition_page_multiple); -COMPILE_ASSERT(sizeof(WTF::PartitionPage) <= WTF::kPageMetadataSize, - PartitionPage_not_too_big); -COMPILE_ASSERT(sizeof(WTF::PartitionBucket) <= WTF::kPageMetadataSize, - PartitionBucket_not_too_big); -COMPILE_ASSERT(sizeof(WTF::PartitionSuperPageExtentEntry) <= - WTF::kPageMetadataSize, - PartitionSuperPageExtentEntry_not_too_big); -COMPILE_ASSERT(WTF::kPageMetadataSize* WTF::kNumPartitionPagesPerSuperPage <= - WTF::kSystemPageSize, - page_metadata_fits_in_hole); -// Check that some of our zanier calculations worked out as expected. -COMPILE_ASSERT(WTF::kGenericSmallestBucket == 8, generic_smallest_bucket); -COMPILE_ASSERT(WTF::kGenericMaxBucketed == 983040, generic_max_bucketed); - -namespace WTF { - -int PartitionRootBase::gInitializedLock = 0; -bool PartitionRootBase::gInitialized = false; -PartitionPage PartitionRootBase::gSeedPage; -PartitionBucket PartitionRootBase::gPagedBucket; - -static size_t partitionBucketNumSystemPages(size_t size) { - // This works out reasonably for the current bucket sizes of the generic - // allocator, and the current values of partition page size and constants. - // Specifically, we have enough room to always pack the slots perfectly into - // some number of system pages. The only waste is the waste associated with - // unfaulted pages (i.e. wasted address space). - // TODO: we end up using a lot of system pages for very small sizes. For - // example, we'll use 12 system pages for slot size 24. The slot size is - // so small that the waste would be tiny with just 4, or 1, system pages. - // Later, we can investigate whether there are anti-fragmentation benefits - // to using fewer system pages. - double bestWasteRatio = 1.0f; - size_t bestPages = 0; - if (size > kMaxSystemPagesPerSlotSpan * kSystemPageSize) { - ASSERT(!(size % kSystemPageSize)); - return size / kSystemPageSize; - } - ASSERT(size <= kMaxSystemPagesPerSlotSpan * kSystemPageSize); - for (size_t i = kNumSystemPagesPerPartitionPage - 1; - i <= kMaxSystemPagesPerSlotSpan; ++i) { - size_t pageSize = kSystemPageSize * i; - size_t numSlots = pageSize / size; - size_t waste = pageSize - (numSlots * size); - // Leaving a page unfaulted is not free; the page will occupy an empty page - // table entry. Make a simple attempt to account for that. - size_t numRemainderPages = i & (kNumSystemPagesPerPartitionPage - 1); - size_t numUnfaultedPages = - numRemainderPages - ? (kNumSystemPagesPerPartitionPage - numRemainderPages) - : 0; - waste += sizeof(void*) * numUnfaultedPages; - double wasteRatio = (double)waste / (double)pageSize; - if (wasteRatio < bestWasteRatio) { - bestWasteRatio = wasteRatio; - bestPages = i; - } - } - ASSERT(bestPages > 0); - return bestPages; -} - -static void parititonAllocBaseInit(PartitionRootBase* root) { - ASSERT(!root->initialized); - - spinLockLock(&PartitionRootBase::gInitializedLock); - if (!PartitionRootBase::gInitialized) { - PartitionRootBase::gInitialized = true; - // We mark the seed page as free to make sure it is skipped by our - // logic to find a new active page. - PartitionRootBase::gPagedBucket.activePagesHead = - &PartitionRootGeneric::gSeedPage; - } - spinLockUnlock(&PartitionRootBase::gInitializedLock); - - root->initialized = true; - root->totalSizeOfCommittedPages = 0; - root->totalSizeOfSuperPages = 0; - root->nextSuperPage = 0; - root->nextPartitionPage = 0; - root->nextPartitionPageEnd = 0; - root->firstExtent = 0; - root->currentExtent = 0; - - memset(&root->globalEmptyPageRing, '\0', sizeof(root->globalEmptyPageRing)); - root->globalEmptyPageRingIndex = 0; - - // This is a "magic" value so we can test if a root pointer is valid. - root->invertedSelf = ~reinterpret_cast(root); -} - -static void partitionBucketInitBase(PartitionBucket* bucket, - PartitionRootBase* root) { - bucket->activePagesHead = &PartitionRootGeneric::gSeedPage; - bucket->freePagesHead = 0; - bucket->numFullPages = 0; - bucket->numSystemPagesPerSlotSpan = - partitionBucketNumSystemPages(bucket->slotSize); -} - -void partitionAllocInit(PartitionRoot* root, - size_t numBuckets, - size_t maxAllocation) { - parititonAllocBaseInit(root); - - root->numBuckets = numBuckets; - root->maxAllocation = maxAllocation; - size_t i; - for (i = 0; i < root->numBuckets; ++i) { - PartitionBucket* bucket = &root->buckets()[i]; - if (!i) - bucket->slotSize = kAllocationGranularity; - else - bucket->slotSize = i << kBucketShift; - partitionBucketInitBase(bucket, root); - } -} - -void partitionAllocGenericInit(PartitionRootGeneric* root) { - parititonAllocBaseInit(root); - - root->lock = 0; - - // Precalculate some shift and mask constants used in the hot path. - // Example: malloc(41) == 101001 binary. - // Order is 6 (1 << 6-1)==32 is highest bit set. - // orderIndex is the next three MSB == 010 == 2. - // subOrderIndexMask is a mask for the remaining bits == 11 (masking to 01 for - // the subOrderIndex). - size_t order; - for (order = 0; order <= kBitsPerSizet; ++order) { - size_t orderIndexShift; - if (order < kGenericNumBucketsPerOrderBits + 1) - orderIndexShift = 0; - else - orderIndexShift = order - (kGenericNumBucketsPerOrderBits + 1); - root->orderIndexShifts[order] = orderIndexShift; - size_t subOrderIndexMask; - if (order == kBitsPerSizet) { - // This avoids invoking undefined behavior for an excessive shift. - subOrderIndexMask = - static_cast(-1) >> (kGenericNumBucketsPerOrderBits + 1); - } else { - subOrderIndexMask = - ((1 << order) - 1) >> (kGenericNumBucketsPerOrderBits + 1); - } - root->orderSubIndexMasks[order] = subOrderIndexMask; - } - - // Set up the actual usable buckets first. - // Note that typical values (i.e. min allocation size of 8) will result in - // invalid buckets (size==9 etc. or more generally, size is not a multiple - // of the smallest allocation granularity). - // We avoid them in the bucket lookup map, but we tolerate them to keep the - // code simpler and the structures more generic. - size_t i, j; - size_t currentSize = kGenericSmallestBucket; - size_t currentIncrement = - kGenericSmallestBucket >> kGenericNumBucketsPerOrderBits; - PartitionBucket* bucket = &root->buckets[0]; - for (i = 0; i < kGenericNumBucketedOrders; ++i) { - for (j = 0; j < kGenericNumBucketsPerOrder; ++j) { - bucket->slotSize = currentSize; - partitionBucketInitBase(bucket, root); - // Disable invalid buckets so that touching them faults. - if (currentSize % kGenericSmallestBucket) - bucket->activePagesHead = 0; - currentSize += currentIncrement; - ++bucket; - } - currentIncrement <<= 1; - } - ASSERT(currentSize == 1 << kGenericMaxBucketedOrder); - ASSERT(bucket == &root->buckets[0] + (kGenericNumBucketedOrders * - kGenericNumBucketsPerOrder)); - - // Then set up the fast size -> bucket lookup table. - bucket = &root->buckets[0]; - PartitionBucket** bucketPtr = &root->bucketLookups[0]; - for (order = 0; order <= kBitsPerSizet; ++order) { - for (j = 0; j < kGenericNumBucketsPerOrder; ++j) { - if (order < kGenericMinBucketedOrder) { - // Use the bucket of finest granularity for malloc(0) etc. - *bucketPtr++ = &root->buckets[0]; - } else if (order > kGenericMaxBucketedOrder) { - *bucketPtr++ = &PartitionRootGeneric::gPagedBucket; - } else { - PartitionBucket* validBucket = bucket; - // Skip over invalid buckets. - while (validBucket->slotSize % kGenericSmallestBucket) - validBucket++; - *bucketPtr++ = validBucket; - bucket++; - } - } - } - ASSERT(bucket == &root->buckets[0] + (kGenericNumBucketedOrders * - kGenericNumBucketsPerOrder)); - ASSERT(bucketPtr == &root->bucketLookups[0] + - ((kBitsPerSizet + 1) * kGenericNumBucketsPerOrder)); - // And there's one last bucket lookup that will be hit for e.g. malloc(-1), - // which tries to overflow to a non-existant order. - *bucketPtr = &PartitionRootGeneric::gPagedBucket; -} - -static bool partitionAllocShutdownBucket(PartitionBucket* bucket) { - // Failure here indicates a memory leak. - bool noLeaks = !bucket->numFullPages; - PartitionPage* page = bucket->activePagesHead; - while (page) { - if (page->numAllocatedSlots) - noLeaks = false; - page = page->nextPage; - } - - return noLeaks; -} - -static void partitionAllocBaseShutdown(PartitionRootBase* root) { - ASSERT(root->initialized); - root->initialized = false; - - // Now that we've examined all partition pages in all buckets, it's safe - // to free all our super pages. We first collect the super page pointers - // on the stack because some of them are themselves store in super pages. - char* superPages[kMaxPartitionSize / kSuperPageSize]; - size_t numSuperPages = 0; - PartitionSuperPageExtentEntry* entry = root->firstExtent; - while (entry) { - char* superPage = entry->superPageBase; - while (superPage != entry->superPagesEnd) { - superPages[numSuperPages] = superPage; - numSuperPages++; - superPage += kSuperPageSize; - } - entry = entry->next; - } - ASSERT(numSuperPages == root->totalSizeOfSuperPages / kSuperPageSize); - for (size_t i = 0; i < numSuperPages; ++i) - freePages(superPages[i], kSuperPageSize); -} - -bool partitionAllocShutdown(PartitionRoot* root) { - bool noLeaks = true; - size_t i; - for (i = 0; i < root->numBuckets; ++i) { - PartitionBucket* bucket = &root->buckets()[i]; - if (!partitionAllocShutdownBucket(bucket)) - noLeaks = false; - } - - partitionAllocBaseShutdown(root); - return noLeaks; -} - -bool partitionAllocGenericShutdown(PartitionRootGeneric* root) { - bool noLeaks = true; - size_t i; - for (i = 0; i < kGenericNumBucketedOrders * kGenericNumBucketsPerOrder; ++i) { - PartitionBucket* bucket = &root->buckets[i]; - if (!partitionAllocShutdownBucket(bucket)) - noLeaks = false; - } - partitionAllocBaseShutdown(root); - return noLeaks; -} - -static NEVER_INLINE void partitionOutOfMemory() { - IMMEDIATE_CRASH(); -} - -static NEVER_INLINE void partitionFull() { - IMMEDIATE_CRASH(); -} - -static ALWAYS_INLINE void partitionDecommitSystemPages(PartitionRootBase* root, - void* addr, - size_t len) { - decommitSystemPages(addr, len); - ASSERT(root->totalSizeOfCommittedPages > len); - root->totalSizeOfCommittedPages -= len; -} - -static ALWAYS_INLINE void partitionRecommitSystemPages(PartitionRootBase* root, - void* addr, - size_t len) { - recommitSystemPages(addr, len); - root->totalSizeOfCommittedPages += len; -} - -static ALWAYS_INLINE void* partitionAllocPartitionPages( - PartitionRootBase* root, - int flags, - size_t numPartitionPages) { - ASSERT(!(reinterpret_cast(root->nextPartitionPage) % - kPartitionPageSize)); - ASSERT(!(reinterpret_cast(root->nextPartitionPageEnd) % - kPartitionPageSize)); - RELEASE_ASSERT(numPartitionPages <= kNumPartitionPagesPerSuperPage); - size_t totalSize = kPartitionPageSize * numPartitionPages; - root->totalSizeOfCommittedPages += totalSize; - size_t numPartitionPagesLeft = - (root->nextPartitionPageEnd - root->nextPartitionPage) >> - kPartitionPageShift; - if (LIKELY(numPartitionPagesLeft >= numPartitionPages)) { - // In this case, we can still hand out pages from the current super page - // allocation. - char* ret = root->nextPartitionPage; - root->nextPartitionPage += totalSize; - return ret; - } - - // Need a new super page. - root->totalSizeOfSuperPages += kSuperPageSize; - if (root->totalSizeOfSuperPages > kMaxPartitionSize) - partitionFull(); - char* requestedAddress = root->nextSuperPage; - char* superPage = reinterpret_cast( - allocPages(requestedAddress, kSuperPageSize, kSuperPageSize)); - if (UNLIKELY(!superPage)) { - if (flags & PartitionAllocReturnNull) - return 0; - partitionOutOfMemory(); - } - root->nextSuperPage = superPage + kSuperPageSize; - char* ret = superPage + kPartitionPageSize; - root->nextPartitionPage = ret + totalSize; - root->nextPartitionPageEnd = root->nextSuperPage - kPartitionPageSize; - // Make the first partition page in the super page a guard page, but leave a - // hole in the middle. - // This is where we put page metadata and also a tiny amount of extent - // metadata. - setSystemPagesInaccessible(superPage, kSystemPageSize); - setSystemPagesInaccessible(superPage + (kSystemPageSize * 2), - kPartitionPageSize - (kSystemPageSize * 2)); - // Also make the last partition page a guard page. - setSystemPagesInaccessible(superPage + (kSuperPageSize - kPartitionPageSize), - kPartitionPageSize); - - // If we were after a specific address, but didn't get it, assume that - // the system chose a lousy address and re-randomize the next - // allocation. - if (requestedAddress && requestedAddress != superPage) - root->nextSuperPage = 0; - - // We allocated a new super page so update super page metadata. - // First check if this is a new extent or not. - PartitionSuperPageExtentEntry* latestExtent = - reinterpret_cast( - partitionSuperPageToMetadataArea(superPage)); - PartitionSuperPageExtentEntry* currentExtent = root->currentExtent; - bool isNewExtent = (superPage != requestedAddress); - if (UNLIKELY(isNewExtent)) { - latestExtent->next = 0; - if (UNLIKELY(!currentExtent)) { - root->firstExtent = latestExtent; - } else { - ASSERT(currentExtent->superPageBase); - currentExtent->next = latestExtent; - } - root->currentExtent = latestExtent; - currentExtent = latestExtent; - currentExtent->superPageBase = superPage; - currentExtent->superPagesEnd = superPage + kSuperPageSize; - } else { - // We allocated next to an existing extent so just nudge the size up a - // little. - currentExtent->superPagesEnd += kSuperPageSize; - ASSERT(ret >= currentExtent->superPageBase && - ret < currentExtent->superPagesEnd); - } - // By storing the root in every extent metadata object, we have a fast way - // to go from a pointer within the partition to the root object. - latestExtent->root = root; - - return ret; -} - -static ALWAYS_INLINE void partitionUnusePage(PartitionRootBase* root, - PartitionPage* page) { - ASSERT(page->bucket->numSystemPagesPerSlotSpan); - void* addr = partitionPageToPointer(page); - partitionDecommitSystemPages( - root, addr, page->bucket->numSystemPagesPerSlotSpan * kSystemPageSize); -} - -static ALWAYS_INLINE size_t -partitionBucketSlots(const PartitionBucket* bucket) { - return (bucket->numSystemPagesPerSlotSpan * kSystemPageSize) / - bucket->slotSize; -} - -static ALWAYS_INLINE size_t -partitionBucketPartitionPages(const PartitionBucket* bucket) { - return (bucket->numSystemPagesPerSlotSpan + - (kNumSystemPagesPerPartitionPage - 1)) / - kNumSystemPagesPerPartitionPage; -} - -static ALWAYS_INLINE void partitionPageReset(PartitionPage* page, - PartitionBucket* bucket) { - ASSERT(page != &PartitionRootGeneric::gSeedPage); - page->numAllocatedSlots = 0; - page->numUnprovisionedSlots = partitionBucketSlots(bucket); - ASSERT(page->numUnprovisionedSlots); - page->bucket = bucket; - page->nextPage = 0; - // NULLing the freelist is not strictly necessary but it makes an ASSERT in - // partitionPageFillFreelist simpler. - page->freelistHead = 0; - page->pageOffset = 0; - page->freeCacheIndex = -1; - size_t numPartitionPages = partitionBucketPartitionPages(bucket); - size_t i; - char* pageCharPtr = reinterpret_cast(page); - for (i = 1; i < numPartitionPages; ++i) { - pageCharPtr += kPageMetadataSize; - PartitionPage* secondaryPage = - reinterpret_cast(pageCharPtr); - secondaryPage->pageOffset = i; - } -} - -static ALWAYS_INLINE char* partitionPageAllocAndFillFreelist( - PartitionPage* page) { - ASSERT(page != &PartitionRootGeneric::gSeedPage); - size_t numSlots = page->numUnprovisionedSlots; - ASSERT(numSlots); - PartitionBucket* bucket = page->bucket; - // We should only get here when _every_ slot is either used or unprovisioned. - // (The third state is "on the freelist". If we have a non-empty freelist, we - // should not get here.) - ASSERT(numSlots + page->numAllocatedSlots == partitionBucketSlots(bucket)); - // Similarly, make explicitly sure that the freelist is empty. - ASSERT(!page->freelistHead); - ASSERT(page->numAllocatedSlots >= 0); - - size_t size = bucket->slotSize; - char* base = reinterpret_cast(partitionPageToPointer(page)); - char* returnObject = base + (size * page->numAllocatedSlots); - char* firstFreelistPointer = returnObject + size; - char* firstFreelistPointerExtent = - firstFreelistPointer + sizeof(PartitionFreelistEntry*); - // Our goal is to fault as few system pages as possible. We calculate the - // page containing the "end" of the returned slot, and then allow freelist - // pointers to be written up to the end of that page. - char* subPageLimit = reinterpret_cast( - (reinterpret_cast(firstFreelistPointer) + - kSystemPageOffsetMask) & - kSystemPageBaseMask); - char* slotsLimit = returnObject + (size * page->numUnprovisionedSlots); - char* freelistLimit = subPageLimit; - if (UNLIKELY(slotsLimit < freelistLimit)) - freelistLimit = slotsLimit; - - size_t numNewFreelistEntries = 0; - if (LIKELY(firstFreelistPointerExtent <= freelistLimit)) { - // Only consider used space in the slot span. If we consider wasted - // space, we may get an off-by-one when a freelist pointer fits in the - // wasted space, but a slot does not. - // We know we can fit at least one freelist pointer. - numNewFreelistEntries = 1; - // Any further entries require space for the whole slot span. - numNewFreelistEntries += - (freelistLimit - firstFreelistPointerExtent) / size; - } - - // We always return an object slot -- that's the +1 below. - // We do not neccessarily create any new freelist entries, because we cross - // sub page boundaries frequently for large bucket sizes. - ASSERT(numNewFreelistEntries + 1 <= numSlots); - numSlots -= (numNewFreelistEntries + 1); - page->numUnprovisionedSlots = numSlots; - page->numAllocatedSlots++; - - if (LIKELY(numNewFreelistEntries)) { - char* freelistPointer = firstFreelistPointer; - PartitionFreelistEntry* entry = - reinterpret_cast(freelistPointer); - page->freelistHead = entry; - while (--numNewFreelistEntries) { - freelistPointer += size; - PartitionFreelistEntry* nextEntry = - reinterpret_cast(freelistPointer); - entry->next = partitionFreelistMask(nextEntry); - entry = nextEntry; - } - entry->next = partitionFreelistMask(0); - } else { - page->freelistHead = 0; - } - return returnObject; -} - -// This helper function scans the active page list for a suitable new active -// page, starting at the passed in page. -// When it finds a suitable new active page (one that has free slots), it is -// set as the new active page and true is returned. If there is no suitable new -// active page, false is returned and the current active page is set to null. -// As potential pages are scanned, they are tidied up according to their state. -// Freed pages are swept on to the free page list and full pages are unlinked -// from any list. -static ALWAYS_INLINE bool partitionSetNewActivePage(PartitionPage* page) { - if (page == &PartitionRootBase::gSeedPage) { - ASSERT(!page->nextPage); - return false; - } - - PartitionPage* nextPage = 0; - PartitionBucket* bucket = page->bucket; - - for (; page; page = nextPage) { - nextPage = page->nextPage; - ASSERT(page->bucket == bucket); - ASSERT(page != bucket->freePagesHead); - ASSERT(!bucket->freePagesHead || page != bucket->freePagesHead->nextPage); - - // Page is usable if it has something on the freelist, or unprovisioned - // slots that can be turned into a freelist. - if (LIKELY(page->freelistHead != 0) || - LIKELY(page->numUnprovisionedSlots)) { - bucket->activePagesHead = page; - return true; - } - - ASSERT(page->numAllocatedSlots >= 0); - if (LIKELY(page->numAllocatedSlots == 0)) { - ASSERT(page->freeCacheIndex == -1); - // We hit a free page, so shepherd it on to the free page list. - page->nextPage = bucket->freePagesHead; - bucket->freePagesHead = page; - } else { - // If we get here, we found a full page. Skip over it too, and also - // tag it as full (via a negative value). We need it tagged so that - // free'ing can tell, and move it back into the active page list. - ASSERT(page->numAllocatedSlots == - static_cast(partitionBucketSlots(bucket))); - page->numAllocatedSlots = -page->numAllocatedSlots; - ++bucket->numFullPages; - // numFullPages is a uint16_t for efficient packing so guard against - // overflow to be safe. - RELEASE_ASSERT(bucket->numFullPages); - // Not necessary but might help stop accidents. - page->nextPage = 0; - } - } - - bucket->activePagesHead = 0; - return false; -} - -struct PartitionDirectMapExtent { - size_t mapSize; // Mapped size, not including guard pages and meta-data. -}; - -static ALWAYS_INLINE PartitionDirectMapExtent* partitionPageToDirectMapExtent( - PartitionPage* page) { - ASSERT(partitionBucketIsDirectMapped(page->bucket)); - return reinterpret_cast( - reinterpret_cast(page) + 2 * kPageMetadataSize); -} - -static ALWAYS_INLINE void* partitionDirectMap(PartitionRootBase* root, - int flags, - size_t size) { - size = partitionDirectMapSize(size); - - // Because we need to fake looking like a super page, We need to allocate - // a bunch of system pages more than "size": - // - The first few system pages are the partition page in which the super - // page metadata is stored. We fault just one system page out of a partition - // page sized clump. - // - We add a trailing guard page. - size_t mapSize = size + kPartitionPageSize + kSystemPageSize; - // Round up to the allocation granularity. - mapSize += kPageAllocationGranularityOffsetMask; - mapSize &= kPageAllocationGranularityBaseMask; - - // TODO: we may want to let the operating system place these allocations - // where it pleases. On 32-bit, this might limit address space - // fragmentation and on 64-bit, this might have useful savings for TLB - // and page table overhead. - // TODO: if upsizing realloc()s are common on large sizes, we could - // consider over-allocating address space on 64-bit, "just in case". - // TODO: consider pre-populating page tables (e.g. MAP_POPULATE on Linux, - // MADV_WILLNEED on POSIX). - // TODO: these pages will be zero-filled. Consider internalizing an - // allocZeroed() API so we can avoid a memset() entirely in this case. - char* ptr = reinterpret_cast(allocPages(0, mapSize, kSuperPageSize)); - if (!ptr) { - if (flags & PartitionAllocReturnNull) - return 0; - partitionOutOfMemory(); - } - char* ret = ptr + kPartitionPageSize; - // TODO: due to all the guard paging, this arrangement creates 4 mappings. - // We could get it down to three by using read-only for the metadata page, - // or perhaps two by leaving out the trailing guard page on 64-bit. - setSystemPagesInaccessible(ptr, kSystemPageSize); - setSystemPagesInaccessible(ptr + (kSystemPageSize * 2), - kPartitionPageSize - (kSystemPageSize * 2)); - setSystemPagesInaccessible(ret + size, kSystemPageSize); - - PartitionSuperPageExtentEntry* extent = - reinterpret_cast( - partitionSuperPageToMetadataArea(ptr)); - extent->root = root; - PartitionPage* page = partitionPointerToPageNoAlignmentCheck(ret); - PartitionBucket* bucket = reinterpret_cast( - reinterpret_cast(page) + kPageMetadataSize); - page->freelistHead = 0; - page->nextPage = 0; - page->bucket = bucket; - page->numAllocatedSlots = 1; - page->numUnprovisionedSlots = 0; - page->pageOffset = 0; - page->freeCacheIndex = 0; - - bucket->activePagesHead = 0; - bucket->freePagesHead = 0; - bucket->slotSize = size; - bucket->numSystemPagesPerSlotSpan = 0; - bucket->numFullPages = 0; - - PartitionDirectMapExtent* mapExtent = partitionPageToDirectMapExtent(page); - mapExtent->mapSize = mapSize - kPartitionPageSize - kSystemPageSize; - - return ret; -} - -static ALWAYS_INLINE void partitionDirectUnmap(PartitionPage* page) { - size_t unmapSize = partitionPageToDirectMapExtent(page)->mapSize; - - // Add on the size of the trailing guard page and preceeding partition - // page. - unmapSize += kPartitionPageSize + kSystemPageSize; - - ASSERT(!(unmapSize & kPageAllocationGranularityOffsetMask)); - - char* ptr = reinterpret_cast(partitionPageToPointer(page)); - // Account for the mapping starting a partition page before the actual - // allocation address. - ptr -= kPartitionPageSize; - - freePages(ptr, unmapSize); -} - -void* partitionAllocSlowPath(PartitionRootBase* root, - int flags, - size_t size, - PartitionBucket* bucket) { - // The slow path is called when the freelist is empty. - ASSERT(!bucket->activePagesHead->freelistHead); - - // For the partitionAllocGeneric API, we have a bunch of buckets marked - // as special cases. We bounce them through to the slow path so that we - // can still have a blazing fast hot path due to lack of corner-case - // branches. - bool returnNull = flags & PartitionAllocReturnNull; - if (UNLIKELY(partitionBucketIsDirectMapped(bucket))) { - ASSERT(size > kGenericMaxBucketed); - ASSERT(bucket == &PartitionRootBase::gPagedBucket); - if (size > kGenericMaxDirectMapped) { - if (returnNull) - return 0; - RELEASE_ASSERT(false); - } - return partitionDirectMap(root, flags, size); - } - - // First, look for a usable page in the existing active pages list. - // Change active page, accepting the current page as a candidate. - if (LIKELY(partitionSetNewActivePage(bucket->activePagesHead))) { - PartitionPage* newPage = bucket->activePagesHead; - if (LIKELY(newPage->freelistHead != 0)) { - PartitionFreelistEntry* ret = newPage->freelistHead; - newPage->freelistHead = partitionFreelistMask(ret->next); - newPage->numAllocatedSlots++; - return ret; - } - ASSERT(newPage->numUnprovisionedSlots); - return partitionPageAllocAndFillFreelist(newPage); - } - - // Second, look in our list of freed but reserved pages. - PartitionPage* newPage = bucket->freePagesHead; - if (LIKELY(newPage != 0)) { - ASSERT(newPage != &PartitionRootGeneric::gSeedPage); - ASSERT(!newPage->freelistHead); - ASSERT(!newPage->numAllocatedSlots); - ASSERT(!newPage->numUnprovisionedSlots); - ASSERT(newPage->freeCacheIndex == -1); - bucket->freePagesHead = newPage->nextPage; - void* addr = partitionPageToPointer(newPage); - partitionRecommitSystemPages( - root, addr, - newPage->bucket->numSystemPagesPerSlotSpan * kSystemPageSize); - } else { - // Third. If we get here, we need a brand new page. - size_t numPartitionPages = partitionBucketPartitionPages(bucket); - void* rawNewPage = - partitionAllocPartitionPages(root, flags, numPartitionPages); - if (UNLIKELY(!rawNewPage)) { - ASSERT(returnNull); - return 0; - } - // Skip the alignment check because it depends on page->bucket, which is not - // yet set. - newPage = partitionPointerToPageNoAlignmentCheck(rawNewPage); - } - - partitionPageReset(newPage, bucket); - bucket->activePagesHead = newPage; - return partitionPageAllocAndFillFreelist(newPage); -} - -static ALWAYS_INLINE void partitionFreePage(PartitionRootBase* root, - PartitionPage* page) { - ASSERT(page->freelistHead); - ASSERT(!page->numAllocatedSlots); - partitionUnusePage(root, page); - // We actually leave the freed page in the active list. We'll sweep it on - // to the free page list when we next walk the active page list. Pulling - // this trick enables us to use a singly-linked page list for all cases, - // which is critical in keeping the page metadata structure down to 32 - // bytes in size. - page->freelistHead = 0; - page->numUnprovisionedSlots = 0; -} - -static ALWAYS_INLINE void partitionRegisterEmptyPage(PartitionPage* page) { - PartitionRootBase* root = partitionPageToRoot(page); - - // If the page is already registered as empty, give it another life. - if (page->freeCacheIndex != -1) { - ASSERT(page->freeCacheIndex >= 0); - ASSERT(static_cast(page->freeCacheIndex) < kMaxFreeableSpans); - ASSERT(root->globalEmptyPageRing[page->freeCacheIndex] == page); - root->globalEmptyPageRing[page->freeCacheIndex] = 0; - } - - size_t currentIndex = root->globalEmptyPageRingIndex; - PartitionPage* pageToFree = root->globalEmptyPageRing[currentIndex]; - // The page might well have been re-activated, filled up, etc. before we get - // around to looking at it here. - if (pageToFree) { - ASSERT(pageToFree != &PartitionRootBase::gSeedPage); - ASSERT(pageToFree->freeCacheIndex >= 0); - ASSERT(static_cast(pageToFree->freeCacheIndex) < - kMaxFreeableSpans); - ASSERT(pageToFree == root->globalEmptyPageRing[pageToFree->freeCacheIndex]); - if (!pageToFree->numAllocatedSlots && pageToFree->freelistHead) { - // The page is still empty, and not freed, so _really_ free it. - partitionFreePage(root, pageToFree); - } - pageToFree->freeCacheIndex = -1; - } - - // We put the empty slot span on our global list of "pages that were once - // empty". thus providing it a bit of breathing room to get re-used before - // we really free it. This improves performance, particularly on Mac OS X - // which has subpar memory management performance. - root->globalEmptyPageRing[currentIndex] = page; - page->freeCacheIndex = currentIndex; - ++currentIndex; - if (currentIndex == kMaxFreeableSpans) - currentIndex = 0; - root->globalEmptyPageRingIndex = currentIndex; -} - -void partitionFreeSlowPath(PartitionPage* page) { - PartitionBucket* bucket = page->bucket; - ASSERT(page != &PartitionRootGeneric::gSeedPage); - ASSERT(bucket->activePagesHead != &PartitionRootGeneric::gSeedPage); - if (LIKELY(page->numAllocatedSlots == 0)) { - // Page became fully unused. - if (UNLIKELY(partitionBucketIsDirectMapped(bucket))) { - partitionDirectUnmap(page); - return; - } - // If it's the current active page, attempt to change it. We'd prefer to - // leave the page empty as a gentle force towards defragmentation. - if (LIKELY(page == bucket->activePagesHead) && page->nextPage) { - if (partitionSetNewActivePage(page->nextPage)) { - ASSERT(bucket->activePagesHead != page); - // Link the empty page back in after the new current page, to - // avoid losing a reference to it. - // TODO: consider walking the list to link the empty page after - // all non-empty pages? - PartitionPage* currentPage = bucket->activePagesHead; - page->nextPage = currentPage->nextPage; - currentPage->nextPage = page; - } else { - bucket->activePagesHead = page; - page->nextPage = 0; - } - } - partitionRegisterEmptyPage(page); - } else { - // Ensure that the page is full. That's the only valid case if we - // arrive here. - ASSERT(page->numAllocatedSlots < 0); - // A transition of numAllocatedSlots from 0 to -1 is not legal, and - // likely indicates a double-free. - RELEASE_ASSERT(page->numAllocatedSlots != -1); - page->numAllocatedSlots = -page->numAllocatedSlots - 2; - ASSERT(page->numAllocatedSlots == - static_cast(partitionBucketSlots(bucket) - 1)); - // Fully used page became partially used. It must be put back on the - // non-full page list. Also make it the current page to increase the - // chances of it being filled up again. The old current page will be - // the next page. - page->nextPage = bucket->activePagesHead; - bucket->activePagesHead = page; - --bucket->numFullPages; - // Special case: for a partition page with just a single slot, it may - // now be empty and we want to run it through the empty logic. - if (UNLIKELY(page->numAllocatedSlots == 0)) - partitionFreeSlowPath(page); - } -} - -bool partitionReallocDirectMappedInPlace(PartitionRootGeneric* root, - PartitionPage* page, - size_t newSize) { - ASSERT(partitionBucketIsDirectMapped(page->bucket)); - - newSize = partitionCookieSizeAdjustAdd(newSize); - - // Note that the new size might be a bucketed size; this function is called - // whenever we're reallocating a direct mapped allocation. - newSize = partitionDirectMapSize(newSize); - if (newSize < kGenericMinDirectMappedDownsize) - return false; - - // bucket->slotSize is the current size of the allocation. - size_t currentSize = page->bucket->slotSize; - if (newSize == currentSize) - return true; - - char* charPtr = static_cast(partitionPageToPointer(page)); - - if (newSize < currentSize) { - size_t mapSize = partitionPageToDirectMapExtent(page)->mapSize; - - // Don't reallocate in-place if new size is less than 80 % of the full - // map size, to avoid holding on to too much unused address space. - if ((newSize / kSystemPageSize) * 5 < (mapSize / kSystemPageSize) * 4) - return false; - - // Shrink by decommitting unneeded pages and making them inaccessible. - size_t decommitSize = currentSize - newSize; - partitionDecommitSystemPages(root, charPtr + newSize, decommitSize); - setSystemPagesInaccessible(charPtr + newSize, decommitSize); - } else if (newSize <= partitionPageToDirectMapExtent(page)->mapSize) { - // Grow within the actually allocated memory. Just need to make the - // pages accessible again. - size_t recommitSize = newSize - currentSize; - setSystemPagesAccessible(charPtr + currentSize, recommitSize); - partitionRecommitSystemPages(root, charPtr + currentSize, recommitSize); - -#if ENABLE(ASSERT) - memset(charPtr + currentSize, kUninitializedByte, recommitSize); -#endif - } else { - // We can't perform the realloc in-place. - // TODO: support this too when possible. - return false; - } - -#if ENABLE(ASSERT) - // Write a new trailing cookie. - partitionCookieWriteValue(charPtr + newSize - kCookieSize); -#endif - - page->bucket->slotSize = newSize; - return true; -} - -void* partitionReallocGeneric(PartitionRootGeneric* root, - void* ptr, - size_t newSize) { -#if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) - return realloc(ptr, newSize); -#else - if (UNLIKELY(!ptr)) - return partitionAllocGeneric(root, newSize); - if (UNLIKELY(!newSize)) { - partitionFreeGeneric(root, ptr); - return 0; - } - - RELEASE_ASSERT(newSize <= kGenericMaxDirectMapped); - - ASSERT(partitionPointerIsValid(partitionCookieFreePointerAdjust(ptr))); - - PartitionPage* page = - partitionPointerToPage(partitionCookieFreePointerAdjust(ptr)); - - if (UNLIKELY(partitionBucketIsDirectMapped(page->bucket))) { - // We may be able to perform the realloc in place by changing the - // accessibility of memory pages and, if reducing the size, decommitting - // them. - if (partitionReallocDirectMappedInPlace(root, page, newSize)) - return ptr; - } - - size_t actualNewSize = partitionAllocActualSize(root, newSize); - size_t actualOldSize = partitionAllocGetSize(ptr); - - // TODO: note that tcmalloc will "ignore" a downsizing realloc() unless the - // new size is a significant percentage smaller. We could do the same if we - // determine it is a win. - if (actualNewSize == actualOldSize) { - // Trying to allocate a block of size newSize would give us a block of - // the same size as the one we've already got, so no point in doing - // anything here. - return ptr; - } - - // This realloc cannot be resized in-place. Sadness. - void* ret = partitionAllocGeneric(root, newSize); - size_t copySize = actualOldSize; - if (newSize < copySize) - copySize = newSize; - - memcpy(ret, ptr, copySize); - partitionFreeGeneric(root, ptr); - return ret; -#endif -} - -#ifndef NDEBUG - -void partitionDumpStats(const PartitionRoot& root) { - size_t i; - size_t totalLive = 0; - size_t totalResident = 0; - size_t totalFreeable = 0; - for (i = 0; i < root.numBuckets; ++i) { - const PartitionBucket& bucket = root.buckets()[i]; - if (bucket.activePagesHead == &PartitionRootGeneric::gSeedPage && - !bucket.freePagesHead && !bucket.numFullPages) { - // Empty bucket with no freelist or full pages. Skip reporting it. - continue; - } - size_t numFreePages = 0; - PartitionPage* freePages = bucket.freePagesHead; - while (freePages) { - ++numFreePages; - freePages = freePages->nextPage; - } - size_t bucketSlotSize = bucket.slotSize; - size_t bucketNumSlots = partitionBucketSlots(&bucket); - size_t bucketUsefulStorage = bucketSlotSize * bucketNumSlots; - size_t bucketPageSize = bucket.numSystemPagesPerSlotSpan * kSystemPageSize; - size_t bucketWaste = bucketPageSize - bucketUsefulStorage; - size_t numActiveBytes = bucket.numFullPages * bucketUsefulStorage; - size_t numResidentBytes = bucket.numFullPages * bucketPageSize; - size_t numFreeableBytes = 0; - size_t numActivePages = 0; - const PartitionPage* page = bucket.activePagesHead; - while (page) { - ASSERT(page != &PartitionRootGeneric::gSeedPage); - // A page may be on the active list but freed and not yet swept. - if (!page->freelistHead && !page->numUnprovisionedSlots && - !page->numAllocatedSlots) { - ++numFreePages; - } else { - ++numActivePages; - numActiveBytes += (page->numAllocatedSlots * bucketSlotSize); - size_t pageBytesResident = - (bucketNumSlots - page->numUnprovisionedSlots) * bucketSlotSize; - // Round up to system page size. - pageBytesResident = - (pageBytesResident + kSystemPageOffsetMask) & kSystemPageBaseMask; - numResidentBytes += pageBytesResident; - if (!page->numAllocatedSlots) - numFreeableBytes += pageBytesResident; - } - page = page->nextPage; - } - totalLive += numActiveBytes; - totalResident += numResidentBytes; - totalFreeable += numFreeableBytes; - printf( - "bucket size %zu (pageSize %zu waste %zu): %zu alloc/%zu commit/%zu " - "freeable bytes, %zu/%zu/%zu full/active/free pages\n", - bucketSlotSize, bucketPageSize, bucketWaste, numActiveBytes, - numResidentBytes, numFreeableBytes, - static_cast(bucket.numFullPages), numActivePages, numFreePages); - } - printf("total live: %zu bytes\n", totalLive); - printf("total resident: %zu bytes\n", totalResident); - printf("total freeable: %zu bytes\n", totalFreeable); - fflush(stdout); -} - -#endif // !NDEBUG - -} // namespace WTF diff --git a/sky/engine/wtf/PartitionAlloc.h b/sky/engine/wtf/PartitionAlloc.h deleted file mode 100644 index 6e81d1a1b3287..0000000000000 --- a/sky/engine/wtf/PartitionAlloc.h +++ /dev/null @@ -1,714 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_PARTITIONALLOC_H_ -#define SKY_ENGINE_WTF_PARTITIONALLOC_H_ - -// DESCRIPTION -// partitionAlloc() / partitionAllocGeneric() and partitionFree() / -// partitionFreeGeneric() are approximately analagous to malloc() and free(). -// -// The main difference is that a PartitionRoot / PartitionRootGeneric object -// must be supplied to these functions, representing a specific "heap partition" -// that will be used to satisfy the allocation. Different partitions are -// guaranteed to exist in separate address spaces, including being separate from -// the main system heap. If the contained objects are all freed, physical memory -// is returned to the system but the address space remains reserved. -// -// THE ONLY LEGITIMATE WAY TO OBTAIN A PartitionRoot IS THROUGH THE -// SizeSpecificPartitionAllocator / PartitionAllocatorGeneric classes. To -// minimize the instruction count to the fullest extent possible, the -// PartitonRoot is really just a header adjacent to other data areas provided -// by the allocator class. -// -// The partitionAlloc() variant of the API has the following caveats: -// - Allocations and frees against a single partition must be single threaded. -// - Allocations must not exceed a max size, chosen at compile-time via a -// templated parameter to PartitionAllocator. -// - Allocation sizes must be aligned to the system pointer size. -// - Allocations are bucketed exactly according to size. -// -// And for partitionAllocGeneric(): -// - Multi-threaded use against a single partition is ok; locking is handled. -// - Allocations of any arbitrary size can be handled (subject to a limit of -// INT_MAX bytes for security reasons). -// - Bucketing is by approximate size, for example an allocation of 4000 bytes -// might be placed into a 4096-byte bucket. Bucket sizes are chosen to try and -// keep worst-case waste to ~10%. -// -// The allocators are designed to be extremely fast, thanks to the following -// properties and design: -// - Just a single (reasonably predicatable) branch in the hot / fast path for -// both allocating and (significantly) freeing. -// - A minimal number of operations in the hot / fast path, with the slow paths -// in separate functions, leading to the possibility of inlining. -// - Each partition page (which is usually multiple physical pages) has a -// metadata structure which allows fast mapping of free() address to an -// underlying bucket. -// - Supports a lock-free API for fast performance in single-threaded cases. -// - The freelist for a given bucket is split across a number of partition -// pages, enabling various simple tricks to try and minimize fragmentation. -// - Fine-grained bucket sizes leading to less waste and better packing. -// -// The following security properties are provided at this time: -// - Linear overflows cannot corrupt into the partition. -// - Linear overflows cannot corrupt out of the partition. -// - Freed pages will only be re-used within the partition. -// (exception: large allocations > ~1MB) -// - Freed pages will only hold same-sized objects when re-used. -// - Dereference of freelist pointer should fault. -// - Out-of-line main metadata: linear over or underflow cannot corrupt it. -// - Partial pointer overwrite of freelist pointer should fault. -// - Rudimentary double-free detection. -// - Large allocations (> ~1MB) are guard-paged at the beginning and end. -// -// The following security properties could be investigated in the future: -// - Per-object bucketing (instead of per-size) is mostly available at the API, -// but not used yet. -// - No randomness of freelist entries or bucket position. -// - Better checking for wild pointers in free(). -// - Better freelist masking function to guarantee fault on 32-bit. - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/BitwiseOperations.h" -#include "flutter/sky/engine/wtf/ByteSwap.h" -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/PageAllocator.h" -#include "flutter/sky/engine/wtf/SpinLock.h" - -#include - -#if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) -#include -#endif - -#if ENABLE(ASSERT) -#include -#endif - -namespace WTF { - -// Maximum size of a partition's mappings. 2046MB. Note that the total amount of -// bytes allocatable at the API will be smaller. This is because things like -// guard pages, metadata, page headers and wasted space come out of the total. -// The 2GB is not necessarily contiguous in virtual address space. -static const size_t kMaxPartitionSize = 2046u * 1024u * 1024u; - -// Allocation granularity of sizeof(void*) bytes. -static const size_t kAllocationGranularity = sizeof(void*); -static const size_t kAllocationGranularityMask = kAllocationGranularity - 1; -static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2; - -// Underlying partition storage pages are a power-of-two size. It is typical -// for a partition page to be based on multiple system pages. Most references to -// "page" refer to partition pages. -// We also have the concept of "super pages" -- these are the underlying system -// allocations we make. Super pages contain multiple partition pages inside them -// and include space for a small amount of metadata per partition page. -// Inside super pages, we store "slot spans". A slot span is a continguous range -// of one or more partition pages that stores allocations of the same size. -// Slot span sizes are adjusted depending on the allocation size, to make sure -// the packing does not lead to unused (wasted) space at the end of the last -// system page of the span. For our current max slot span size of 64k and other -// constant values, we pack _all_ partitionAllocGeneric() sizes perfectly up -// against the end of a system page. -static const size_t kPartitionPageShift = 14; // 16KB -static const size_t kPartitionPageSize = 1 << kPartitionPageShift; -static const size_t kPartitionPageOffsetMask = kPartitionPageSize - 1; -static const size_t kPartitionPageBaseMask = ~kPartitionPageOffsetMask; -static const size_t kMaxPartitionPagesPerSlotSpan = 4; - -// To avoid fragmentation via never-used freelist entries, we hand out partition -// freelist sections gradually, in units of the dominant system page size. -// What we're actually doing is avoiding filling the full partition page -// (typically 16KB) will freelist pointers right away. Writing freelist -// pointers will fault and dirty a private page, which is very wasteful if we -// never actually store objects there. -static const size_t kNumSystemPagesPerPartitionPage = - kPartitionPageSize / kSystemPageSize; -static const size_t kMaxSystemPagesPerSlotSpan = - kNumSystemPagesPerPartitionPage * kMaxPartitionPagesPerSlotSpan; - -// We reserve virtual address space in 2MB chunks (aligned to 2MB as well). -// These chunks are called "super pages". We do this so that we can store -// metadata in the first few pages of each 2MB aligned section. This leads to -// a very fast free(). We specifically choose 2MB because this virtual address -// block represents a full but single PTE allocation on ARM, ia32 and x64. -static const size_t kSuperPageShift = 21; // 2MB -static const size_t kSuperPageSize = 1 << kSuperPageShift; -static const size_t kSuperPageOffsetMask = kSuperPageSize - 1; -static const size_t kSuperPageBaseMask = ~kSuperPageOffsetMask; -static const size_t kNumPartitionPagesPerSuperPage = - kSuperPageSize / kPartitionPageSize; - -static const size_t kPageMetadataShift = 5; // 32 bytes per partition page. -static const size_t kPageMetadataSize = 1 << kPageMetadataShift; - -// The following kGeneric* constants apply to the generic variants of the API. -// The "order" of an allocation is closely related to the power-of-two size of -// the allocation. More precisely, the order is the bit index of the -// most-significant-bit in the allocation size, where the bit numbers starts -// at index 1 for the least-significant-bit. -// In terms of allocation sizes, order 0 covers 0, order 1 covers 1, order 2 -// covers 2->3, order 3 covers 4->7, order 4 covers 8->15. -static const size_t kGenericMinBucketedOrder = 4; // 8 bytes. -static const size_t kGenericMaxBucketedOrder = - 20; // Largest bucketed order is 1<<(20-1) (storing 512KB -> almost 1MB) -static const size_t kGenericNumBucketedOrders = - (kGenericMaxBucketedOrder - kGenericMinBucketedOrder) + 1; -static const size_t kGenericNumBucketsPerOrderBits = - 3; // Eight buckets per order (for the higher orders), e.g. order 8 is 128, - // 144, 160, ..., 240 -static const size_t kGenericNumBucketsPerOrder = - 1 << kGenericNumBucketsPerOrderBits; -static const size_t kGenericSmallestBucket = 1 - << (kGenericMinBucketedOrder - 1); -static const size_t kGenericMaxBucketSpacing = - 1 << ((kGenericMaxBucketedOrder - 1) - kGenericNumBucketsPerOrderBits); -static const size_t kGenericMaxBucketed = - (1 << (kGenericMaxBucketedOrder - 1)) + - ((kGenericNumBucketsPerOrder - 1) * kGenericMaxBucketSpacing); -static const size_t kGenericMinDirectMappedDownsize = - kGenericMaxBucketed + - 1; // Limit when downsizing a direct mapping using realloc(). -static const size_t kGenericMaxDirectMapped = INT_MAX - kSystemPageSize; -static const size_t kBitsPerSizet = sizeof(void*) * CHAR_BIT; - -// Constants for the memory reclaim logic. -static const size_t kMaxFreeableSpans = 16; - -#if ENABLE(ASSERT) -// These two byte values match tcmalloc. -static const unsigned char kUninitializedByte = 0xAB; -static const unsigned char kFreedByte = 0xCD; -static const uint32_t kCookieValue = 0xDEADBEEFu; -static const size_t kCookieSize = - 16; // Handles alignment up to XMM instructions on Intel. -#endif - -struct PartitionBucket; -struct PartitionRootBase; - -struct PartitionFreelistEntry { - PartitionFreelistEntry* next; -}; - -// Some notes on page states. A page can be in one of three major states: -// 1) Active. -// 2) Full. -// 3) Free. -// An active page has available free slots. A full page has no free slots. A -// free page has had its backing memory released back to the system. -// There are two linked lists tracking the pages. The "active page" list is an -// approximation of a list of active pages. It is an approximation because both -// free and full pages may briefly be present in the list until we next do a -// scan over it. The "free page" list is an accurate list of pages which have -// been returned back to the system. -// The significant page transitions are: -// - free() will detect when a full page has a slot free()'d and immediately -// return the page to the head of the active list. -// - free() will detect when a page is fully emptied. It _may_ add it to the -// free list and it _may_ leave it on the active list until a future list scan. -// - malloc() _may_ scan the active page list in order to fulfil the request. -// If it does this, full and free pages encountered will be booted out of the -// active list. If there are no suitable active pages found, a free page (if one -// exists) will be pulled from the free list on to the active list. -struct PartitionPage { - PartitionFreelistEntry* freelistHead; - PartitionPage* nextPage; - PartitionBucket* bucket; - int16_t numAllocatedSlots; // Deliberately signed, -1 for free page, -n for - // full pages. - uint16_t numUnprovisionedSlots; - uint16_t pageOffset; - int16_t freeCacheIndex; // -1 if not in the free cache. -}; - -struct PartitionBucket { - PartitionPage* activePagesHead; // Accessed most in hot path => goes first. - PartitionPage* freePagesHead; - uint32_t slotSize; - uint16_t numSystemPagesPerSlotSpan; - uint16_t numFullPages; -}; - -// An "extent" is a span of consecutive superpages. We link to the partition's -// next extent (if there is one) at the very start of a superpage's metadata -// area. -struct PartitionSuperPageExtentEntry { - PartitionRootBase* root; - char* superPageBase; - char* superPagesEnd; - PartitionSuperPageExtentEntry* next; -}; - -struct WTF_EXPORT PartitionRootBase { - size_t totalSizeOfCommittedPages; - size_t totalSizeOfSuperPages; - unsigned numBuckets; - unsigned maxAllocation; - bool initialized; - char* nextSuperPage; - char* nextPartitionPage; - char* nextPartitionPageEnd; - PartitionSuperPageExtentEntry* currentExtent; - PartitionSuperPageExtentEntry* firstExtent; - PartitionPage* globalEmptyPageRing[kMaxFreeableSpans]; - size_t globalEmptyPageRingIndex; - uintptr_t invertedSelf; - - static int gInitializedLock; - static bool gInitialized; - static PartitionPage gSeedPage; - static PartitionBucket gPagedBucket; -}; - -// Never instantiate a PartitionRoot directly, instead use PartitionAlloc. -struct PartitionRoot : public PartitionRootBase { - // The PartitionAlloc templated class ensures the following is correct. - ALWAYS_INLINE PartitionBucket* buckets() { - return reinterpret_cast(this + 1); - } - ALWAYS_INLINE const PartitionBucket* buckets() const { - return reinterpret_cast(this + 1); - } -}; - -// Never instantiate a PartitionRootGeneric directly, instead use -// PartitionAllocatorGeneric. -struct PartitionRootGeneric : public PartitionRootBase { - int lock; - // Some pre-computed constants. - size_t orderIndexShifts[kBitsPerSizet + 1]; - size_t orderSubIndexMasks[kBitsPerSizet + 1]; - // The bucket lookup table lets us map a size_t to a bucket quickly. - // The trailing +1 caters for the overflow case for very large allocation - // sizes. It is one flat array instead of a 2D array because in the 2D world, - // we'd need to index array[blah][max+1] which risks undefined behavior. - PartitionBucket* - bucketLookups[((kBitsPerSizet + 1) * kGenericNumBucketsPerOrder) + 1]; - PartitionBucket - buckets[kGenericNumBucketedOrders * kGenericNumBucketsPerOrder]; -}; - -// Flags for partitionAllocGenericFlags. -enum PartitionAllocFlags { - PartitionAllocReturnNull = 1 << 0, -}; - -WTF_EXPORT void partitionAllocInit(PartitionRoot*, - size_t numBuckets, - size_t maxAllocation); -WTF_EXPORT bool partitionAllocShutdown(PartitionRoot*); -WTF_EXPORT void partitionAllocGenericInit(PartitionRootGeneric*); -WTF_EXPORT bool partitionAllocGenericShutdown(PartitionRootGeneric*); - -WTF_EXPORT NEVER_INLINE void* partitionAllocSlowPath(PartitionRootBase*, - int, - size_t, - PartitionBucket*); -WTF_EXPORT NEVER_INLINE void partitionFreeSlowPath(PartitionPage*); -WTF_EXPORT NEVER_INLINE void* partitionReallocGeneric(PartitionRootGeneric*, - void*, - size_t); - -#ifndef NDEBUG -WTF_EXPORT void partitionDumpStats(const PartitionRoot&); -#endif - -ALWAYS_INLINE PartitionFreelistEntry* partitionFreelistMask( - PartitionFreelistEntry* ptr) { - // We use bswap on little endian as a fast mask for two reasons: - // 1) If an object is freed and its vtable used where the attacker doesn't - // get the chance to run allocations between the free and use, the vtable - // dereference is likely to fault. - // 2) If the attacker has a linear buffer overflow and elects to try and - // corrupt a freelist pointer, partial pointer overwrite attacks are - // thwarted. - // For big endian, similar guarantees are arrived at with a negation. -#if CPU(BIG_ENDIAN) - uintptr_t masked = ~reinterpret_cast(ptr); -#else - uintptr_t masked = bswapuintptrt(reinterpret_cast(ptr)); -#endif - return reinterpret_cast(masked); -} - -ALWAYS_INLINE size_t partitionCookieSizeAdjustAdd(size_t size) { -#if ENABLE(ASSERT) - // Add space for cookies, checking for integer overflow. - ASSERT(size + (2 * kCookieSize) > size); - size += 2 * kCookieSize; -#endif - return size; -} - -ALWAYS_INLINE size_t partitionCookieSizeAdjustSubtract(size_t size) { -#if ENABLE(ASSERT) - // Remove space for cookies. - ASSERT(size >= 2 * kCookieSize); - size -= 2 * kCookieSize; -#endif - return size; -} - -ALWAYS_INLINE void* partitionCookieFreePointerAdjust(void* ptr) { -#if ENABLE(ASSERT) - // The value given to the application is actually just after the cookie. - ptr = static_cast(ptr) - kCookieSize; -#endif - return ptr; -} - -ALWAYS_INLINE void partitionCookieWriteValue(void* ptr) { -#if ENABLE(ASSERT) - uint32_t* cookiePtr = reinterpret_cast(ptr); - for (size_t i = 0; i < kCookieSize / sizeof(kCookieValue); ++i, ++cookiePtr) - *cookiePtr = kCookieValue; -#endif -} - -ALWAYS_INLINE void partitionCookieCheckValue(void* ptr) { -#if ENABLE(ASSERT) - uint32_t* cookiePtr = reinterpret_cast(ptr); - for (size_t i = 0; i < kCookieSize / sizeof(kCookieValue); ++i, ++cookiePtr) - ASSERT(*cookiePtr == kCookieValue); -#endif -} - -ALWAYS_INLINE char* partitionSuperPageToMetadataArea(char* ptr) { - uintptr_t pointerAsUint = reinterpret_cast(ptr); - ASSERT(!(pointerAsUint & kSuperPageOffsetMask)); - // The metadata area is exactly one system page (the guard page) into the - // super page. - return reinterpret_cast(pointerAsUint + kSystemPageSize); -} - -ALWAYS_INLINE PartitionPage* partitionPointerToPageNoAlignmentCheck(void* ptr) { - uintptr_t pointerAsUint = reinterpret_cast(ptr); - char* superPagePtr = - reinterpret_cast(pointerAsUint & kSuperPageBaseMask); - uintptr_t partitionPageIndex = - (pointerAsUint & kSuperPageOffsetMask) >> kPartitionPageShift; - // Index 0 is invalid because it is the metadata area and the last index is - // invalid because it is a guard page. - ASSERT(partitionPageIndex); - ASSERT(partitionPageIndex < kNumPartitionPagesPerSuperPage - 1); - PartitionPage* page = reinterpret_cast( - partitionSuperPageToMetadataArea(superPagePtr) + - (partitionPageIndex << kPageMetadataShift)); - // Many partition pages can share the same page object. Adjust for that. - size_t delta = page->pageOffset << kPageMetadataShift; - page = - reinterpret_cast(reinterpret_cast(page) - delta); - return page; -} - -ALWAYS_INLINE void* partitionPageToPointer(PartitionPage* page) { - uintptr_t pointerAsUint = reinterpret_cast(page); - uintptr_t superPageOffset = (pointerAsUint & kSuperPageOffsetMask); - ASSERT(superPageOffset > kSystemPageSize); - ASSERT(superPageOffset < kSystemPageSize + (kNumPartitionPagesPerSuperPage * - kPageMetadataSize)); - uintptr_t partitionPageIndex = - (superPageOffset - kSystemPageSize) >> kPageMetadataShift; - // Index 0 is invalid because it is the metadata area and the last index is - // invalid because it is a guard page. - ASSERT(partitionPageIndex); - ASSERT(partitionPageIndex < kNumPartitionPagesPerSuperPage - 1); - uintptr_t superPageBase = (pointerAsUint & kSuperPageBaseMask); - void* ret = reinterpret_cast( - superPageBase + (partitionPageIndex << kPartitionPageShift)); - return ret; -} - -ALWAYS_INLINE PartitionPage* partitionPointerToPage(void* ptr) { - PartitionPage* page = partitionPointerToPageNoAlignmentCheck(ptr); - // Checks that the pointer is a multiple of bucket size. - ASSERT(!((reinterpret_cast(ptr) - - reinterpret_cast(partitionPageToPointer(page))) % - page->bucket->slotSize)); - return page; -} - -ALWAYS_INLINE PartitionRootBase* partitionPageToRoot(PartitionPage* page) { - PartitionSuperPageExtentEntry* extentEntry = - reinterpret_cast( - reinterpret_cast(page) & kSystemPageBaseMask); - return extentEntry->root; -} - -ALWAYS_INLINE bool partitionPointerIsValid(void* ptr) { - PartitionPage* page = partitionPointerToPage(ptr); - PartitionRootBase* root = partitionPageToRoot(page); - return root->invertedSelf == ~reinterpret_cast(root); -} - -ALWAYS_INLINE void* partitionBucketAlloc(PartitionRootBase* root, - int flags, - size_t size, - PartitionBucket* bucket) { - PartitionPage* page = bucket->activePagesHead; - ASSERT(page->numAllocatedSlots >= 0); - void* ret = page->freelistHead; - if (LIKELY(ret != 0)) { - // If these asserts fire, you probably corrupted memory. - ASSERT(partitionPointerIsValid(ret)); - PartitionFreelistEntry* newHead = - partitionFreelistMask(static_cast(ret)->next); - page->freelistHead = newHead; - ASSERT(!ret || partitionPointerIsValid(ret)); - page->numAllocatedSlots++; - } else { - ret = partitionAllocSlowPath(root, flags, size, bucket); - } -#if ENABLE(ASSERT) - if (!ret) - return 0; - // Fill the uninitialized pattern. and write the cookies. - page = partitionPointerToPage(ret); - size_t bucketSize = page->bucket->slotSize; - memset(ret, kUninitializedByte, bucketSize); - partitionCookieWriteValue(ret); - partitionCookieWriteValue(reinterpret_cast(ret) + bucketSize - - kCookieSize); - // The value given to the application is actually just after the cookie. - ret = static_cast(ret) + kCookieSize; -#endif - return ret; -} - -ALWAYS_INLINE void* partitionAlloc(PartitionRoot* root, size_t size) { -#if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) - void* result = malloc(size); - RELEASE_ASSERT(result); - return result; -#else - size = partitionCookieSizeAdjustAdd(size); - ASSERT(root->initialized); - size_t index = size >> kBucketShift; - ASSERT(index < root->numBuckets); - ASSERT(size == index << kBucketShift); - PartitionBucket* bucket = &root->buckets()[index]; - return partitionBucketAlloc(root, 0, size, bucket); -#endif // defined(MEMORY_TOOL_REPLACES_ALLOCATOR) -} - -ALWAYS_INLINE void partitionFreeWithPage(void* ptr, PartitionPage* page) { - // If these asserts fire, you probably corrupted memory. -#if ENABLE(ASSERT) - size_t bucketSize = page->bucket->slotSize; - partitionCookieCheckValue(ptr); - partitionCookieCheckValue(reinterpret_cast(ptr) + bucketSize - - kCookieSize); - memset(ptr, kFreedByte, bucketSize); -#endif - ASSERT(page->numAllocatedSlots); - PartitionFreelistEntry* freelistHead = page->freelistHead; - ASSERT(!freelistHead || partitionPointerIsValid(freelistHead)); - RELEASE_ASSERT(ptr != freelistHead); // Catches an immediate double free. - ASSERT(!freelistHead || - ptr != partitionFreelistMask(freelistHead->next)); // Look for double - // free one level - // deeper in debug. - PartitionFreelistEntry* entry = static_cast(ptr); - entry->next = partitionFreelistMask(freelistHead); - page->freelistHead = entry; - --page->numAllocatedSlots; - if (UNLIKELY(page->numAllocatedSlots <= 0)) - partitionFreeSlowPath(page); -} - -ALWAYS_INLINE void partitionFree(void* ptr) { -#if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) - free(ptr); -#else - ptr = partitionCookieFreePointerAdjust(ptr); - ASSERT(partitionPointerIsValid(ptr)); - PartitionPage* page = partitionPointerToPage(ptr); - partitionFreeWithPage(ptr, page); -#endif -} - -ALWAYS_INLINE PartitionBucket* partitionGenericSizeToBucket( - PartitionRootGeneric* root, - size_t size) { - size_t order = kBitsPerSizet - countLeadingZerosSizet(size); - // The order index is simply the next few bits after the most significant bit. - size_t orderIndex = (size >> root->orderIndexShifts[order]) & - (kGenericNumBucketsPerOrder - 1); - // And if the remaining bits are non-zero we must bump the bucket up. - size_t subOrderIndex = size & root->orderSubIndexMasks[order]; - PartitionBucket* bucket = - root->bucketLookups[(order << kGenericNumBucketsPerOrderBits) + - orderIndex + !!subOrderIndex]; - ASSERT(!bucket->slotSize || bucket->slotSize >= size); - ASSERT(!(bucket->slotSize % kGenericSmallestBucket)); - return bucket; -} - -ALWAYS_INLINE void* partitionAllocGenericFlags(PartitionRootGeneric* root, - int flags, - size_t size) { -#if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) - void* result = malloc(size); - RELEASE_ASSERT(result); - return result; -#else - ASSERT(root->initialized); - size = partitionCookieSizeAdjustAdd(size); - PartitionBucket* bucket = partitionGenericSizeToBucket(root, size); - spinLockLock(&root->lock); - void* ret = partitionBucketAlloc(root, flags, size, bucket); - spinLockUnlock(&root->lock); - return ret; -#endif -} - -ALWAYS_INLINE void* partitionAllocGeneric(PartitionRootGeneric* root, - size_t size) { - return partitionAllocGenericFlags(root, 0, size); -} - -ALWAYS_INLINE void partitionFreeGeneric(PartitionRootGeneric* root, void* ptr) { -#if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) - free(ptr); -#else - ASSERT(root->initialized); - - if (UNLIKELY(!ptr)) - return; - - ptr = partitionCookieFreePointerAdjust(ptr); - ASSERT(partitionPointerIsValid(ptr)); - PartitionPage* page = partitionPointerToPage(ptr); - spinLockLock(&root->lock); - partitionFreeWithPage(ptr, page); - spinLockUnlock(&root->lock); -#endif -} - -ALWAYS_INLINE bool partitionBucketIsDirectMapped(PartitionBucket* bucket) { - return !bucket->numSystemPagesPerSlotSpan; -} - -ALWAYS_INLINE size_t partitionDirectMapSize(size_t size) { - // Caller must check that the size is not above the kGenericMaxDirectMapped - // limit before calling. This also guards against integer overflow in the - // calculation here. - ASSERT(size <= kGenericMaxDirectMapped); - return (size + kSystemPageOffsetMask) & kSystemPageBaseMask; -} - -ALWAYS_INLINE size_t partitionAllocActualSize(PartitionRootGeneric* root, - size_t size) { -#if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) - return size; -#else - ASSERT(root->initialized); - size = partitionCookieSizeAdjustAdd(size); - PartitionBucket* bucket = partitionGenericSizeToBucket(root, size); - if (LIKELY(!partitionBucketIsDirectMapped(bucket))) { - size = bucket->slotSize; - } else if (size > kGenericMaxDirectMapped) { - // Too large to allocate => return the size unchanged. - } else { - ASSERT(bucket == &PartitionRootBase::gPagedBucket); - size = partitionDirectMapSize(size); - } - return partitionCookieSizeAdjustSubtract(size); -#endif -} - -ALWAYS_INLINE bool partitionAllocSupportsGetSize() { -#if defined(MEMORY_TOOL_REPLACES_ALLOCATOR) - return false; -#else - return true; -#endif -} - -ALWAYS_INLINE size_t partitionAllocGetSize(void* ptr) { - // No need to lock here. Only 'ptr' being freed by another thread could - // cause trouble, and the caller is responsible for that not happening. - ASSERT(partitionAllocSupportsGetSize()); - ptr = partitionCookieFreePointerAdjust(ptr); - ASSERT(partitionPointerIsValid(ptr)); - PartitionPage* page = partitionPointerToPage(ptr); - size_t size = page->bucket->slotSize; - return partitionCookieSizeAdjustSubtract(size); -} - -// N (or more accurately, N - sizeof(void*)) represents the largest size in -// bytes that will be handled by a SizeSpecificPartitionAllocator. -// Attempts to partitionAlloc() more than this amount will fail. -template -class SizeSpecificPartitionAllocator { - public: - static const size_t kMaxAllocation = N - kAllocationGranularity; - static const size_t kNumBuckets = N / kAllocationGranularity; - void init() { - partitionAllocInit(&m_partitionRoot, kNumBuckets, kMaxAllocation); - } - bool shutdown() { return partitionAllocShutdown(&m_partitionRoot); } - ALWAYS_INLINE PartitionRoot* root() { return &m_partitionRoot; } - - private: - PartitionRoot m_partitionRoot; - PartitionBucket m_actualBuckets[kNumBuckets]; -}; - -class PartitionAllocatorGeneric { - public: - void init() { partitionAllocGenericInit(&m_partitionRoot); } - bool shutdown() { return partitionAllocGenericShutdown(&m_partitionRoot); } - ALWAYS_INLINE PartitionRootGeneric* root() { return &m_partitionRoot; } - - private: - PartitionRootGeneric m_partitionRoot; -}; - -} // namespace WTF - -using WTF::PartitionAllocatorGeneric; -using WTF::PartitionRoot; -using WTF::SizeSpecificPartitionAllocator; -using WTF::partitionAlloc; -using WTF::partitionAllocActualSize; -using WTF::partitionAllocGeneric; -using WTF::partitionAllocGetSize; -using WTF::partitionAllocInit; -using WTF::partitionAllocShutdown; -using WTF::partitionAllocSupportsGetSize; -using WTF::partitionFree; -using WTF::partitionFreeGeneric; -using WTF::partitionReallocGeneric; - -#endif // SKY_ENGINE_WTF_PARTITIONALLOC_H_ diff --git a/sky/engine/wtf/PartitionAllocTest.cpp b/sky/engine/wtf/PartitionAllocTest.cpp deleted file mode 100644 index 6824d1d2557ff..0000000000000 --- a/sky/engine/wtf/PartitionAllocTest.cpp +++ /dev/null @@ -1,1289 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/PartitionAlloc.h" - -#include -#include -#include -#include "flutter/sky/engine/wtf/BitwiseOperations.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -#if OS(POSIX) -#include - -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif -#endif // OS(POSIX) - -#if !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) - -namespace { - -static const size_t kTestMaxAllocation = 4096; -static SizeSpecificPartitionAllocator allocator; -static PartitionAllocatorGeneric genericAllocator; - -static const size_t kTestAllocSize = 16; -#if !ENABLE(ASSERT) -static const size_t kPointerOffset = 0; -static const size_t kExtraAllocSize = 0; -#else -static const size_t kPointerOffset = WTF::kCookieSize; -static const size_t kExtraAllocSize = WTF::kCookieSize * 2; -#endif -static const size_t kRealAllocSize = kTestAllocSize + kExtraAllocSize; -static const size_t kTestBucketIndex = kRealAllocSize >> WTF::kBucketShift; - -static void TestSetup() { - allocator.init(); - genericAllocator.init(); -} - -static void TestShutdown() { -#ifndef NDEBUG - // Test that the partition statistic dumping code works. Previously, it - // bitrotted because no test calls it. - partitionDumpStats(*allocator.root()); -#endif - - // We expect no leaks in the general case. We have a test for leak - // detection. - EXPECT_TRUE(allocator.shutdown()); - EXPECT_TRUE(genericAllocator.shutdown()); -} - -static WTF::PartitionPage* GetFullPage(size_t size) { - size_t realSize = size + kExtraAllocSize; - size_t bucketIdx = realSize >> WTF::kBucketShift; - WTF::PartitionBucket* bucket = &allocator.root()->buckets()[bucketIdx]; - size_t numSlots = - (bucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize) / realSize; - void* first = 0; - void* last = 0; - size_t i; - for (i = 0; i < numSlots; ++i) { - void* ptr = partitionAlloc(allocator.root(), size); - EXPECT_TRUE(ptr); - if (!i) - first = WTF::partitionCookieFreePointerAdjust(ptr); - else if (i == numSlots - 1) - last = WTF::partitionCookieFreePointerAdjust(ptr); - } - EXPECT_EQ(WTF::partitionPointerToPage(first), - WTF::partitionPointerToPage(last)); - if (bucket->numSystemPagesPerSlotSpan == WTF::kNumSystemPagesPerPartitionPage) - EXPECT_EQ(reinterpret_cast(first) & WTF::kPartitionPageBaseMask, - reinterpret_cast(last) & WTF::kPartitionPageBaseMask); - EXPECT_EQ(numSlots, - static_cast(bucket->activePagesHead->numAllocatedSlots)); - EXPECT_EQ(0, bucket->activePagesHead->freelistHead); - EXPECT_TRUE(bucket->activePagesHead); - EXPECT_TRUE(bucket->activePagesHead != &WTF::PartitionRootGeneric::gSeedPage); - return bucket->activePagesHead; -} - -static void FreeFullPage(WTF::PartitionPage* page) { - size_t size = page->bucket->slotSize; - size_t numSlots = - (page->bucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize) / size; - EXPECT_EQ(numSlots, static_cast(abs(page->numAllocatedSlots))); - char* ptr = reinterpret_cast(partitionPageToPointer(page)); - size_t i; - for (i = 0; i < numSlots; ++i) { - partitionFree(ptr + kPointerOffset); - ptr += size; - } -} - -static void CycleFreeCache(size_t size) { - size_t realSize = size + kExtraAllocSize; - size_t bucketIdx = realSize >> WTF::kBucketShift; - WTF::PartitionBucket* bucket = &allocator.root()->buckets()[bucketIdx]; - ASSERT(!bucket->activePagesHead->numAllocatedSlots); - - for (size_t i = 0; i < WTF::kMaxFreeableSpans; ++i) { - void* ptr = partitionAlloc(allocator.root(), size); - EXPECT_EQ(1, bucket->activePagesHead->numAllocatedSlots); - partitionFree(ptr); - EXPECT_EQ(0, bucket->activePagesHead->numAllocatedSlots); - EXPECT_NE(-1, bucket->activePagesHead->freeCacheIndex); - } -} - -static void CycleGenericFreeCache(size_t size) { - for (size_t i = 0; i < WTF::kMaxFreeableSpans; ++i) { - void* ptr = partitionAllocGeneric(genericAllocator.root(), size); - WTF::PartitionPage* page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - WTF::PartitionBucket* bucket = page->bucket; - EXPECT_EQ(1, bucket->activePagesHead->numAllocatedSlots); - partitionFreeGeneric(genericAllocator.root(), ptr); - EXPECT_EQ(0, bucket->activePagesHead->numAllocatedSlots); - EXPECT_NE(-1, bucket->activePagesHead->freeCacheIndex); - } -} - -// Check that the most basic of allocate / free pairs work. -TEST(PartitionAllocTest, Basic) { - TestSetup(); - WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex]; - WTF::PartitionPage* seedPage = &WTF::PartitionRootGeneric::gSeedPage; - - EXPECT_FALSE(bucket->freePagesHead); - EXPECT_EQ(seedPage, bucket->activePagesHead); - EXPECT_EQ(0, bucket->activePagesHead->nextPage); - - void* ptr = partitionAlloc(allocator.root(), kTestAllocSize); - EXPECT_TRUE(ptr); - EXPECT_EQ(kPointerOffset, - reinterpret_cast(ptr) & WTF::kPartitionPageOffsetMask); - // Check that the offset appears to include a guard page. - EXPECT_EQ(WTF::kPartitionPageSize + kPointerOffset, - reinterpret_cast(ptr) & WTF::kSuperPageOffsetMask); - - partitionFree(ptr); - // Expect that the last active page does not get tossed to the freelist. - EXPECT_FALSE(bucket->freePagesHead); - - TestShutdown(); -} - -// Check that we can detect a memory leak. -TEST(PartitionAllocTest, SimpleLeak) { - TestSetup(); - void* leakedPtr = partitionAlloc(allocator.root(), kTestAllocSize); - (void)leakedPtr; - void* leakedPtr2 = - partitionAllocGeneric(genericAllocator.root(), kTestAllocSize); - (void)leakedPtr2; - EXPECT_FALSE(allocator.shutdown()); - EXPECT_FALSE(genericAllocator.shutdown()); -} - -// Test multiple allocations, and freelist handling. -TEST(PartitionAllocTest, MultiAlloc) { - TestSetup(); - - char* ptr1 = - reinterpret_cast(partitionAlloc(allocator.root(), kTestAllocSize)); - char* ptr2 = - reinterpret_cast(partitionAlloc(allocator.root(), kTestAllocSize)); - EXPECT_TRUE(ptr1); - EXPECT_TRUE(ptr2); - ptrdiff_t diff = ptr2 - ptr1; - EXPECT_EQ(static_cast(kRealAllocSize), diff); - - // Check that we re-use the just-freed slot. - partitionFree(ptr2); - ptr2 = - reinterpret_cast(partitionAlloc(allocator.root(), kTestAllocSize)); - EXPECT_TRUE(ptr2); - diff = ptr2 - ptr1; - EXPECT_EQ(static_cast(kRealAllocSize), diff); - partitionFree(ptr1); - ptr1 = - reinterpret_cast(partitionAlloc(allocator.root(), kTestAllocSize)); - EXPECT_TRUE(ptr1); - diff = ptr2 - ptr1; - EXPECT_EQ(static_cast(kRealAllocSize), diff); - - char* ptr3 = - reinterpret_cast(partitionAlloc(allocator.root(), kTestAllocSize)); - EXPECT_TRUE(ptr3); - diff = ptr3 - ptr1; - EXPECT_EQ(static_cast(kRealAllocSize * 2), diff); - - partitionFree(ptr1); - partitionFree(ptr2); - partitionFree(ptr3); - - TestShutdown(); -} - -// Test a bucket with multiple pages. -TEST(PartitionAllocTest, MultiPages) { - TestSetup(); - WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex]; - - WTF::PartitionPage* page = GetFullPage(kTestAllocSize); - FreeFullPage(page); - EXPECT_FALSE(bucket->freePagesHead); - EXPECT_EQ(page, bucket->activePagesHead); - EXPECT_EQ(0, page->nextPage); - EXPECT_EQ(0, page->numAllocatedSlots); - - page = GetFullPage(kTestAllocSize); - WTF::PartitionPage* page2 = GetFullPage(kTestAllocSize); - - EXPECT_EQ(page2, bucket->activePagesHead); - EXPECT_EQ(0, page2->nextPage); - EXPECT_EQ(reinterpret_cast(partitionPageToPointer(page)) & - WTF::kSuperPageBaseMask, - reinterpret_cast(partitionPageToPointer(page2)) & - WTF::kSuperPageBaseMask); - - // Fully free the non-current page. It should not be freelisted because - // there is no other immediately useable page. The other page is full. - FreeFullPage(page); - EXPECT_EQ(0, page->numAllocatedSlots); - EXPECT_FALSE(bucket->freePagesHead); - EXPECT_EQ(page, bucket->activePagesHead); - - // Allocate a new page, it should pull from the freelist. - page = GetFullPage(kTestAllocSize); - EXPECT_FALSE(bucket->freePagesHead); - EXPECT_EQ(page, bucket->activePagesHead); - - FreeFullPage(page); - FreeFullPage(page2); - EXPECT_EQ(0, page->numAllocatedSlots); - EXPECT_EQ(0, page2->numAllocatedSlots); - EXPECT_EQ(0, page2->numUnprovisionedSlots); - EXPECT_NE(-1, page2->freeCacheIndex); - - TestShutdown(); -} - -// Test some finer aspects of internal page transitions. -TEST(PartitionAllocTest, PageTransitions) { - TestSetup(); - WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex]; - - WTF::PartitionPage* page1 = GetFullPage(kTestAllocSize); - EXPECT_EQ(page1, bucket->activePagesHead); - EXPECT_EQ(0, page1->nextPage); - WTF::PartitionPage* page2 = GetFullPage(kTestAllocSize); - EXPECT_EQ(page2, bucket->activePagesHead); - EXPECT_EQ(0, page2->nextPage); - - // Bounce page1 back into the non-full list then fill it up again. - char* ptr = - reinterpret_cast(partitionPageToPointer(page1)) + kPointerOffset; - partitionFree(ptr); - EXPECT_EQ(page1, bucket->activePagesHead); - (void)partitionAlloc(allocator.root(), kTestAllocSize); - EXPECT_EQ(page1, bucket->activePagesHead); - EXPECT_EQ(page2, bucket->activePagesHead->nextPage); - - // Allocating another page at this point should cause us to scan over page1 - // (which is both full and NOT our current page), and evict it from the - // freelist. Older code had a O(n^2) condition due to failure to do this. - WTF::PartitionPage* page3 = GetFullPage(kTestAllocSize); - EXPECT_EQ(page3, bucket->activePagesHead); - EXPECT_EQ(0, page3->nextPage); - - // Work out a pointer into page2 and free it. - ptr = reinterpret_cast(partitionPageToPointer(page2)) + kPointerOffset; - partitionFree(ptr); - // Trying to allocate at this time should cause us to cycle around to page2 - // and find the recently freed slot. - char* newPtr = - reinterpret_cast(partitionAlloc(allocator.root(), kTestAllocSize)); - EXPECT_EQ(ptr, newPtr); - EXPECT_EQ(page2, bucket->activePagesHead); - EXPECT_EQ(page3, page2->nextPage); - - // Work out a pointer into page1 and free it. This should pull the page - // back into the list of available pages. - ptr = reinterpret_cast(partitionPageToPointer(page1)) + kPointerOffset; - partitionFree(ptr); - // This allocation should be satisfied by page1. - newPtr = - reinterpret_cast(partitionAlloc(allocator.root(), kTestAllocSize)); - EXPECT_EQ(ptr, newPtr); - EXPECT_EQ(page1, bucket->activePagesHead); - EXPECT_EQ(page2, page1->nextPage); - - FreeFullPage(page3); - FreeFullPage(page2); - FreeFullPage(page1); - - // Allocating whilst in this state exposed a bug, so keep the test. - ptr = - reinterpret_cast(partitionAlloc(allocator.root(), kTestAllocSize)); - partitionFree(ptr); - - TestShutdown(); -} - -// Test some corner cases relating to page transitions in the internal -// free page list metadata bucket. -TEST(PartitionAllocTest, FreePageListPageTransitions) { - TestSetup(); - WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex]; - - size_t numToFillFreeListPage = - WTF::kPartitionPageSize / (sizeof(WTF::PartitionPage) + kExtraAllocSize); - // The +1 is because we need to account for the fact that the current page - // never gets thrown on the freelist. - ++numToFillFreeListPage; - OwnPtr pages = - adoptArrayPtr(new WTF::PartitionPage*[numToFillFreeListPage]); - - size_t i; - for (i = 0; i < numToFillFreeListPage; ++i) { - pages[i] = GetFullPage(kTestAllocSize); - } - EXPECT_EQ(pages[numToFillFreeListPage - 1], bucket->activePagesHead); - for (i = 0; i < numToFillFreeListPage; ++i) - FreeFullPage(pages[i]); - EXPECT_EQ(0, bucket->activePagesHead->numAllocatedSlots); - EXPECT_NE(-1, bucket->activePagesHead->nextPage->freeCacheIndex); - EXPECT_EQ(0, bucket->activePagesHead->nextPage->numAllocatedSlots); - EXPECT_EQ(0, bucket->activePagesHead->nextPage->numUnprovisionedSlots); - - // Allocate / free in a different bucket size so we get control of a - // different free page list. We need two pages because one will be the last - // active page and not get freed. - WTF::PartitionPage* page1 = GetFullPage(kTestAllocSize * 2); - WTF::PartitionPage* page2 = GetFullPage(kTestAllocSize * 2); - FreeFullPage(page1); - FreeFullPage(page2); - - // If we re-allocate all kTestAllocSize allocations, we'll pull all the - // free pages and end up freeing the first page for free page objects. - // It's getting a bit tricky but a nice re-entrancy is going on: - // alloc(kTestAllocSize) -> pulls page from free page list -> - // free(PartitionFreepagelistEntry) -> last entry in page freed -> - // alloc(PartitionFreepagelistEntry). - for (i = 0; i < numToFillFreeListPage; ++i) { - pages[i] = GetFullPage(kTestAllocSize); - } - EXPECT_EQ(pages[numToFillFreeListPage - 1], bucket->activePagesHead); - - // As part of the final free-up, we'll test another re-entrancy: - // free(kTestAllocSize) -> last entry in page freed -> - // alloc(PartitionFreepagelistEntry) -> pulls page from free page list -> - // free(PartitionFreepagelistEntry) - for (i = 0; i < numToFillFreeListPage; ++i) - FreeFullPage(pages[i]); - EXPECT_EQ(0, bucket->activePagesHead->numAllocatedSlots); - EXPECT_NE(-1, bucket->activePagesHead->nextPage->freeCacheIndex); - EXPECT_EQ(0, bucket->activePagesHead->nextPage->numAllocatedSlots); - EXPECT_EQ(0, bucket->activePagesHead->nextPage->numUnprovisionedSlots); - - TestShutdown(); -} - -// Test a large series of allocations that cross more than one underlying -// 64KB super page allocation. -TEST(PartitionAllocTest, MultiPageAllocs) { - TestSetup(); - // This is guaranteed to cross a super page boundary because the first - // partition page "slot" will be taken up by a guard page. - size_t numPagesNeeded = WTF::kNumPartitionPagesPerSuperPage; - // The super page should begin and end in a guard so we one less page in - // order to allocate a single page in the new super page. - --numPagesNeeded; - - EXPECT_GT(numPagesNeeded, 1u); - OwnPtr pages; - pages = adoptArrayPtr(new WTF::PartitionPage*[numPagesNeeded]); - uintptr_t firstSuperPageBase = 0; - size_t i; - for (i = 0; i < numPagesNeeded; ++i) { - pages[i] = GetFullPage(kTestAllocSize); - void* storagePtr = partitionPageToPointer(pages[i]); - if (!i) - firstSuperPageBase = - reinterpret_cast(storagePtr) & WTF::kSuperPageBaseMask; - if (i == numPagesNeeded - 1) { - uintptr_t secondSuperPageBase = - reinterpret_cast(storagePtr) & WTF::kSuperPageBaseMask; - uintptr_t secondSuperPageOffset = - reinterpret_cast(storagePtr) & WTF::kSuperPageOffsetMask; - EXPECT_FALSE(secondSuperPageBase == firstSuperPageBase); - // Check that we allocated a guard page for the second page. - EXPECT_EQ(WTF::kPartitionPageSize, secondSuperPageOffset); - } - } - for (i = 0; i < numPagesNeeded; ++i) - FreeFullPage(pages[i]); - - TestShutdown(); -} - -// Test the generic allocation functions that can handle arbitrary sizes and -// reallocing etc. -TEST(PartitionAllocTest, GenericAlloc) { - TestSetup(); - - void* ptr = partitionAllocGeneric(genericAllocator.root(), 1); - EXPECT_TRUE(ptr); - partitionFreeGeneric(genericAllocator.root(), ptr); - ptr = partitionAllocGeneric(genericAllocator.root(), - WTF::kGenericMaxBucketed + 1); - EXPECT_TRUE(ptr); - partitionFreeGeneric(genericAllocator.root(), ptr); - - ptr = partitionAllocGeneric(genericAllocator.root(), 1); - EXPECT_TRUE(ptr); - void* origPtr = ptr; - char* charPtr = static_cast(ptr); - *charPtr = 'A'; - - // Change the size of the realloc, remaining inside the same bucket. - void* newPtr = partitionReallocGeneric(genericAllocator.root(), ptr, 2); - EXPECT_EQ(ptr, newPtr); - newPtr = partitionReallocGeneric(genericAllocator.root(), ptr, 1); - EXPECT_EQ(ptr, newPtr); - newPtr = partitionReallocGeneric(genericAllocator.root(), ptr, - WTF::kGenericSmallestBucket); - EXPECT_EQ(ptr, newPtr); - - // Change the size of the realloc, switching buckets. - newPtr = partitionReallocGeneric(genericAllocator.root(), ptr, - WTF::kGenericSmallestBucket + 1); - EXPECT_NE(newPtr, ptr); - // Check that the realloc copied correctly. - char* newCharPtr = static_cast(newPtr); - EXPECT_EQ(*newCharPtr, 'A'); -#if ENABLE(ASSERT) - // Subtle: this checks for an old bug where we copied too much from the - // source of the realloc. The condition can be detected by a trashing of - // the uninitialized value in the space of the upsized allocation. - EXPECT_EQ( - WTF::kUninitializedByte, - static_cast(*(newCharPtr + WTF::kGenericSmallestBucket))); -#endif - *newCharPtr = 'B'; - // The realloc moved. To check that the old allocation was freed, we can - // do an alloc of the old allocation size and check that the old allocation - // address is at the head of the freelist and reused. - void* reusedPtr = partitionAllocGeneric(genericAllocator.root(), 1); - EXPECT_EQ(reusedPtr, origPtr); - partitionFreeGeneric(genericAllocator.root(), reusedPtr); - - // Downsize the realloc. - ptr = newPtr; - newPtr = partitionReallocGeneric(genericAllocator.root(), ptr, 1); - EXPECT_EQ(newPtr, origPtr); - newCharPtr = static_cast(newPtr); - EXPECT_EQ(*newCharPtr, 'B'); - *newCharPtr = 'C'; - - // Upsize the realloc to outside the partition. - ptr = newPtr; - newPtr = partitionReallocGeneric(genericAllocator.root(), ptr, - WTF::kGenericMaxBucketed + 1); - EXPECT_NE(newPtr, ptr); - newCharPtr = static_cast(newPtr); - EXPECT_EQ(*newCharPtr, 'C'); - *newCharPtr = 'D'; - - // Upsize and downsize the realloc, remaining outside the partition. - ptr = newPtr; - newPtr = partitionReallocGeneric(genericAllocator.root(), ptr, - WTF::kGenericMaxBucketed * 10); - newCharPtr = static_cast(newPtr); - EXPECT_EQ(*newCharPtr, 'D'); - *newCharPtr = 'E'; - ptr = newPtr; - newPtr = partitionReallocGeneric(genericAllocator.root(), ptr, - WTF::kGenericMaxBucketed * 2); - newCharPtr = static_cast(newPtr); - EXPECT_EQ(*newCharPtr, 'E'); - *newCharPtr = 'F'; - - // Downsize the realloc to inside the partition. - ptr = newPtr; - newPtr = partitionReallocGeneric(genericAllocator.root(), ptr, 1); - EXPECT_NE(newPtr, ptr); - EXPECT_EQ(newPtr, origPtr); - newCharPtr = static_cast(newPtr); - EXPECT_EQ(*newCharPtr, 'F'); - - partitionFreeGeneric(genericAllocator.root(), newPtr); - TestShutdown(); -} - -// Test the generic allocation functions can handle some specific sizes of -// interest. -TEST(PartitionAllocTest, GenericAllocSizes) { - TestSetup(); - - void* ptr = partitionAllocGeneric(genericAllocator.root(), 0); - EXPECT_TRUE(ptr); - partitionFreeGeneric(genericAllocator.root(), ptr); - - // kPartitionPageSize is interesting because it results in just one - // allocation per page, which tripped up some corner cases. - size_t size = WTF::kPartitionPageSize - kExtraAllocSize; - ptr = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr); - void* ptr2 = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr2); - partitionFreeGeneric(genericAllocator.root(), ptr); - // Should be freeable at this point. - WTF::PartitionPage* page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - EXPECT_NE(-1, page->freeCacheIndex); - partitionFreeGeneric(genericAllocator.root(), ptr2); - - size = (((WTF::kPartitionPageSize * WTF::kMaxPartitionPagesPerSlotSpan) - - WTF::kSystemPageSize) / - 2) - - kExtraAllocSize; - ptr = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr); - memset(ptr, 'A', size); - ptr2 = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr2); - void* ptr3 = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr3); - void* ptr4 = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr4); - - page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - WTF::PartitionPage* page2 = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr3)); - EXPECT_NE(page, page2); - - partitionFreeGeneric(genericAllocator.root(), ptr); - partitionFreeGeneric(genericAllocator.root(), ptr3); - partitionFreeGeneric(genericAllocator.root(), ptr2); - // Should be freeable at this point. - EXPECT_NE(-1, page->freeCacheIndex); - EXPECT_EQ(0, page->numAllocatedSlots); - EXPECT_EQ(0, page->numUnprovisionedSlots); - void* newPtr = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_EQ(ptr3, newPtr); - newPtr = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_EQ(ptr2, newPtr); -#if OS(LINUX) && !ENABLE(ASSERT) - // On Linux, we have a guarantee that freelisting a page should cause its - // contents to be nulled out. We check for null here to detect an bug we - // had where a large slot size was causing us to not properly free all - // resources back to the system. - // We only run the check when asserts are disabled because when they are - // enabled, the allocated area is overwritten with an "uninitialized" - // byte pattern. - EXPECT_EQ(0, *(reinterpret_cast(newPtr) + (size - 1))); -#endif - partitionFreeGeneric(genericAllocator.root(), newPtr); - partitionFreeGeneric(genericAllocator.root(), ptr3); - partitionFreeGeneric(genericAllocator.root(), ptr4); - - // Can we allocate a massive (512MB) size? - ptr = partitionAllocGeneric(genericAllocator.root(), 512 * 1024 * 1024); - partitionFreeGeneric(genericAllocator.root(), ptr); - - // Check a more reasonable, but still direct mapped, size. - // Chop a system page and a byte off to test for rounding errors. - size = 20 * 1024 * 1024; - size -= WTF::kSystemPageSize; - size -= 1; - ptr = partitionAllocGeneric(genericAllocator.root(), size); - char* charPtr = reinterpret_cast(ptr); - *(charPtr + (size - 1)) = 'A'; - partitionFreeGeneric(genericAllocator.root(), ptr); - - // Can we free null? - partitionFreeGeneric(genericAllocator.root(), 0); - - // Do we correctly get a null for a failed allocation? - EXPECT_EQ(0, partitionAllocGenericFlags(genericAllocator.root(), - WTF::PartitionAllocReturnNull, - 3u * 1024 * 1024 * 1024)); - - TestShutdown(); -} - -// Test that we can fetch the real allocated size after an allocation. -TEST(PartitionAllocTest, GenericAllocGetSize) { - TestSetup(); - - void* ptr; - size_t requestedSize, actualSize, predictedSize; - - EXPECT_TRUE(partitionAllocSupportsGetSize()); - - // Allocate something small. - requestedSize = 511 - kExtraAllocSize; - predictedSize = - partitionAllocActualSize(genericAllocator.root(), requestedSize); - ptr = partitionAllocGeneric(genericAllocator.root(), requestedSize); - EXPECT_TRUE(ptr); - actualSize = partitionAllocGetSize(ptr); - EXPECT_EQ(predictedSize, actualSize); - EXPECT_LT(requestedSize, actualSize); - partitionFreeGeneric(genericAllocator.root(), ptr); - - // Allocate a size that should be a perfect match for a bucket, because it - // is an exact power of 2. - requestedSize = (256 * 1024) - kExtraAllocSize; - predictedSize = - partitionAllocActualSize(genericAllocator.root(), requestedSize); - ptr = partitionAllocGeneric(genericAllocator.root(), requestedSize); - EXPECT_TRUE(ptr); - actualSize = partitionAllocGetSize(ptr); - EXPECT_EQ(predictedSize, actualSize); - EXPECT_EQ(requestedSize, actualSize); - partitionFreeGeneric(genericAllocator.root(), ptr); - - // Allocate a size that is a system page smaller than a bucket. GetSize() - // should return a larger size than we asked for now. - requestedSize = (256 * 1024) - WTF::kSystemPageSize - kExtraAllocSize; - predictedSize = - partitionAllocActualSize(genericAllocator.root(), requestedSize); - ptr = partitionAllocGeneric(genericAllocator.root(), requestedSize); - EXPECT_TRUE(ptr); - actualSize = partitionAllocGetSize(ptr); - EXPECT_EQ(predictedSize, actualSize); - EXPECT_EQ(requestedSize + WTF::kSystemPageSize, actualSize); - // Check that we can write at the end of the reported size too. - char* charPtr = reinterpret_cast(ptr); - *(charPtr + (actualSize - 1)) = 'A'; - partitionFreeGeneric(genericAllocator.root(), ptr); - - // Allocate something very large, and uneven. - requestedSize = 512 * 1024 * 1024 - 1; - predictedSize = - partitionAllocActualSize(genericAllocator.root(), requestedSize); - ptr = partitionAllocGeneric(genericAllocator.root(), requestedSize); - EXPECT_TRUE(ptr); - actualSize = partitionAllocGetSize(ptr); - EXPECT_EQ(predictedSize, actualSize); - EXPECT_LT(requestedSize, actualSize); - partitionFreeGeneric(genericAllocator.root(), ptr); - - // Too large allocation. - requestedSize = INT_MAX; - predictedSize = - partitionAllocActualSize(genericAllocator.root(), requestedSize); - EXPECT_EQ(requestedSize, predictedSize); - - TestShutdown(); -} - -// Test the realloc() contract. -TEST(PartitionAllocTest, Realloc) { - TestSetup(); - - // realloc(0, size) should be equivalent to malloc(). - void* ptr = - partitionReallocGeneric(genericAllocator.root(), 0, kTestAllocSize); - memset(ptr, 'A', kTestAllocSize); - WTF::PartitionPage* page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - // realloc(ptr, 0) should be equivalent to free(). - void* ptr2 = partitionReallocGeneric(genericAllocator.root(), ptr, 0); - EXPECT_EQ(0, ptr2); - EXPECT_EQ(WTF::partitionCookieFreePointerAdjust(ptr), page->freelistHead); - - // Test that growing an allocation with realloc() copies everything from the - // old allocation. - size_t size = WTF::kSystemPageSize - kExtraAllocSize; - EXPECT_EQ(size, partitionAllocActualSize(genericAllocator.root(), size)); - ptr = partitionAllocGeneric(genericAllocator.root(), size); - memset(ptr, 'A', size); - ptr2 = partitionReallocGeneric(genericAllocator.root(), ptr, size + 1); - EXPECT_NE(ptr, ptr2); - char* charPtr2 = static_cast(ptr2); - EXPECT_EQ('A', charPtr2[0]); - EXPECT_EQ('A', charPtr2[size - 1]); -#if ENABLE(ASSERT) - EXPECT_EQ(WTF::kUninitializedByte, - static_cast(charPtr2[size])); -#endif - - // Test that shrinking an allocation with realloc() also copies everything - // from the old allocation. - ptr = partitionReallocGeneric(genericAllocator.root(), ptr2, size - 1); - EXPECT_NE(ptr2, ptr); - char* charPtr = static_cast(ptr); - EXPECT_EQ('A', charPtr[0]); - EXPECT_EQ('A', charPtr[size - 2]); -#if ENABLE(ASSERT) - EXPECT_EQ(WTF::kUninitializedByte, - static_cast(charPtr[size - 1])); -#endif - - partitionFreeGeneric(genericAllocator.root(), ptr); - - // Test that shrinking a direct mapped allocation happens in-place. - size = WTF::kGenericMaxBucketed + 16 * WTF::kSystemPageSize; - ptr = partitionAllocGeneric(genericAllocator.root(), size); - size_t actualSize = partitionAllocGetSize(ptr); - ptr2 = partitionReallocGeneric( - genericAllocator.root(), ptr, - WTF::kGenericMaxBucketed + 8 * WTF::kSystemPageSize); - EXPECT_EQ(ptr, ptr2); - EXPECT_EQ(actualSize - 8 * WTF::kSystemPageSize, partitionAllocGetSize(ptr2)); - - // Test that a previously in-place shrunk direct mapped allocation can be - // expanded up again within its original size. - ptr = partitionReallocGeneric(genericAllocator.root(), ptr2, - size - WTF::kSystemPageSize); - EXPECT_EQ(ptr2, ptr); - EXPECT_EQ(actualSize - WTF::kSystemPageSize, partitionAllocGetSize(ptr)); - - // Test that a direct mapped allocation is performed not in-place when the - // new size is small enough. - ptr2 = partitionReallocGeneric(genericAllocator.root(), ptr, - WTF::kSystemPageSize); - EXPECT_NE(ptr, ptr2); - - partitionFreeGeneric(genericAllocator.root(), ptr2); - - TestShutdown(); -} - -// Tests the handing out of freelists for partial pages. -TEST(PartitionAllocTest, PartialPageFreelists) { - TestSetup(); - - size_t bigSize = allocator.root()->maxAllocation - kExtraAllocSize; - EXPECT_EQ(WTF::kSystemPageSize - WTF::kAllocationGranularity, - bigSize + kExtraAllocSize); - size_t bucketIdx = (bigSize + kExtraAllocSize) >> WTF::kBucketShift; - WTF::PartitionBucket* bucket = &allocator.root()->buckets()[bucketIdx]; - EXPECT_EQ(0, bucket->freePagesHead); - - void* ptr = partitionAlloc(allocator.root(), bigSize); - EXPECT_TRUE(ptr); - - WTF::PartitionPage* page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - size_t totalSlots = - (page->bucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize) / - (bigSize + kExtraAllocSize); - EXPECT_EQ(4u, totalSlots); - // The freelist should have one entry, because we were able to exactly fit - // one object slot and one freelist pointer (the null that the head points - // to) into a system page. - EXPECT_TRUE(page->freelistHead); - EXPECT_EQ(1, page->numAllocatedSlots); - EXPECT_EQ(2, page->numUnprovisionedSlots); - - void* ptr2 = partitionAlloc(allocator.root(), bigSize); - EXPECT_TRUE(ptr2); - EXPECT_FALSE(page->freelistHead); - EXPECT_EQ(2, page->numAllocatedSlots); - EXPECT_EQ(2, page->numUnprovisionedSlots); - - void* ptr3 = partitionAlloc(allocator.root(), bigSize); - EXPECT_TRUE(ptr3); - EXPECT_TRUE(page->freelistHead); - EXPECT_EQ(3, page->numAllocatedSlots); - EXPECT_EQ(0, page->numUnprovisionedSlots); - - void* ptr4 = partitionAlloc(allocator.root(), bigSize); - EXPECT_TRUE(ptr4); - EXPECT_FALSE(page->freelistHead); - EXPECT_EQ(4, page->numAllocatedSlots); - EXPECT_EQ(0, page->numUnprovisionedSlots); - - void* ptr5 = partitionAlloc(allocator.root(), bigSize); - EXPECT_TRUE(ptr5); - - WTF::PartitionPage* page2 = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr5)); - EXPECT_EQ(1, page2->numAllocatedSlots); - - // Churn things a little whilst there's a partial page freelist. - partitionFree(ptr); - ptr = partitionAlloc(allocator.root(), bigSize); - void* ptr6 = partitionAlloc(allocator.root(), bigSize); - - partitionFree(ptr); - partitionFree(ptr2); - partitionFree(ptr3); - partitionFree(ptr4); - partitionFree(ptr5); - partitionFree(ptr6); - EXPECT_NE(-1, page->freeCacheIndex); - EXPECT_NE(-1, page2->freeCacheIndex); - EXPECT_TRUE(page2->freelistHead); - EXPECT_EQ(0, page2->numAllocatedSlots); - - // And test a couple of sizes that do not cross kSystemPageSize with a single - // allocation. - size_t mediumSize = (WTF::kSystemPageSize / 2) - kExtraAllocSize; - bucketIdx = (mediumSize + kExtraAllocSize) >> WTF::kBucketShift; - bucket = &allocator.root()->buckets()[bucketIdx]; - EXPECT_EQ(0, bucket->freePagesHead); - - ptr = partitionAlloc(allocator.root(), mediumSize); - EXPECT_TRUE(ptr); - page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - EXPECT_EQ(1, page->numAllocatedSlots); - totalSlots = - (page->bucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize) / - (mediumSize + kExtraAllocSize); - size_t firstPageSlots = WTF::kSystemPageSize / (mediumSize + kExtraAllocSize); - EXPECT_EQ(2u, firstPageSlots); - EXPECT_EQ(totalSlots - firstPageSlots, page->numUnprovisionedSlots); - - partitionFree(ptr); - - size_t smallSize = (WTF::kSystemPageSize / 4) - kExtraAllocSize; - bucketIdx = (smallSize + kExtraAllocSize) >> WTF::kBucketShift; - bucket = &allocator.root()->buckets()[bucketIdx]; - EXPECT_EQ(0, bucket->freePagesHead); - - ptr = partitionAlloc(allocator.root(), smallSize); - EXPECT_TRUE(ptr); - page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - EXPECT_EQ(1, page->numAllocatedSlots); - totalSlots = - (page->bucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize) / - (smallSize + kExtraAllocSize); - firstPageSlots = WTF::kSystemPageSize / (smallSize + kExtraAllocSize); - EXPECT_EQ(totalSlots - firstPageSlots, page->numUnprovisionedSlots); - - partitionFree(ptr); - EXPECT_TRUE(page->freelistHead); - EXPECT_EQ(0, page->numAllocatedSlots); - - size_t verySmallSize = 32 - kExtraAllocSize; - bucketIdx = (verySmallSize + kExtraAllocSize) >> WTF::kBucketShift; - bucket = &allocator.root()->buckets()[bucketIdx]; - EXPECT_EQ(0, bucket->freePagesHead); - - ptr = partitionAlloc(allocator.root(), verySmallSize); - EXPECT_TRUE(ptr); - page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - EXPECT_EQ(1, page->numAllocatedSlots); - totalSlots = - (page->bucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize) / - (verySmallSize + kExtraAllocSize); - firstPageSlots = WTF::kSystemPageSize / (verySmallSize + kExtraAllocSize); - EXPECT_EQ(totalSlots - firstPageSlots, page->numUnprovisionedSlots); - - partitionFree(ptr); - EXPECT_TRUE(page->freelistHead); - EXPECT_EQ(0, page->numAllocatedSlots); - - // And try an allocation size (against the generic allocator) that is - // larger than a system page. - size_t pageAndAHalfSize = - (WTF::kSystemPageSize + (WTF::kSystemPageSize / 2)) - kExtraAllocSize; - ptr = partitionAllocGeneric(genericAllocator.root(), pageAndAHalfSize); - EXPECT_TRUE(ptr); - page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - EXPECT_EQ(1, page->numAllocatedSlots); - EXPECT_TRUE(page->freelistHead); - totalSlots = - (page->bucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize) / - (pageAndAHalfSize + kExtraAllocSize); - EXPECT_EQ(totalSlots - 2, page->numUnprovisionedSlots); - partitionFreeGeneric(genericAllocator.root(), ptr); - - // And then make sure than exactly the page size only faults one page. - size_t pageSize = WTF::kSystemPageSize - kExtraAllocSize; - ptr = partitionAllocGeneric(genericAllocator.root(), pageSize); - EXPECT_TRUE(ptr); - page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - EXPECT_EQ(1, page->numAllocatedSlots); - EXPECT_FALSE(page->freelistHead); - totalSlots = - (page->bucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize) / - (pageSize + kExtraAllocSize); - EXPECT_EQ(totalSlots - 1, page->numUnprovisionedSlots); - partitionFreeGeneric(genericAllocator.root(), ptr); - - TestShutdown(); -} - -// Test some of the fragmentation-resistant properties of the allocator. -TEST(PartitionAllocTest, PageRefilling) { - TestSetup(); - WTF::PartitionBucket* bucket = &allocator.root()->buckets()[kTestBucketIndex]; - - // Grab two full pages and a non-full page. - WTF::PartitionPage* page1 = GetFullPage(kTestAllocSize); - WTF::PartitionPage* page2 = GetFullPage(kTestAllocSize); - void* ptr = partitionAlloc(allocator.root(), kTestAllocSize); - EXPECT_TRUE(ptr); - EXPECT_NE(page1, bucket->activePagesHead); - EXPECT_NE(page2, bucket->activePagesHead); - WTF::PartitionPage* page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - EXPECT_EQ(1, page->numAllocatedSlots); - - // Work out a pointer into page2 and free it; and then page1 and free it. - char* ptr2 = reinterpret_cast(WTF::partitionPageToPointer(page1)) + - kPointerOffset; - partitionFree(ptr2); - ptr2 = reinterpret_cast(WTF::partitionPageToPointer(page2)) + - kPointerOffset; - partitionFree(ptr2); - - // If we perform two allocations from the same bucket now, we expect to - // refill both the nearly full pages. - (void)partitionAlloc(allocator.root(), kTestAllocSize); - (void)partitionAlloc(allocator.root(), kTestAllocSize); - EXPECT_EQ(1, page->numAllocatedSlots); - - FreeFullPage(page2); - FreeFullPage(page1); - partitionFree(ptr); - - TestShutdown(); -} - -// Basic tests to ensure that allocations work for partial page buckets. -TEST(PartitionAllocTest, PartialPages) { - TestSetup(); - - // Find a size that is backed by a partial partition page. - size_t size = sizeof(void*); - WTF::PartitionBucket* bucket = 0; - while (size < kTestMaxAllocation) { - bucket = &allocator.root()->buckets()[size >> WTF::kBucketShift]; - if (bucket->numSystemPagesPerSlotSpan % - WTF::kNumSystemPagesPerPartitionPage) - break; - size += sizeof(void*); - } - EXPECT_LT(size, kTestMaxAllocation); - - WTF::PartitionPage* page1 = GetFullPage(size); - WTF::PartitionPage* page2 = GetFullPage(size); - FreeFullPage(page2); - FreeFullPage(page1); - - TestShutdown(); -} - -// Test correct handling if our mapping collides with another. -TEST(PartitionAllocTest, MappingCollision) { - TestSetup(); - // The -2 is because the first and last partition pages in a super page are - // guard pages. - size_t numPartitionPagesNeeded = WTF::kNumPartitionPagesPerSuperPage - 2; - OwnPtr firstSuperPagePages = - adoptArrayPtr(new WTF::PartitionPage*[numPartitionPagesNeeded]); - OwnPtr secondSuperPagePages = - adoptArrayPtr(new WTF::PartitionPage*[numPartitionPagesNeeded]); - - size_t i; - for (i = 0; i < numPartitionPagesNeeded; ++i) - firstSuperPagePages[i] = GetFullPage(kTestAllocSize); - - char* pageBase = reinterpret_cast( - WTF::partitionPageToPointer(firstSuperPagePages[0])); - EXPECT_EQ(WTF::kPartitionPageSize, - reinterpret_cast(pageBase) & WTF::kSuperPageOffsetMask); - pageBase -= WTF::kPartitionPageSize; - // Map a single system page either side of the mapping for our allocations, - // with the goal of tripping up alignment of the next mapping. - void* map1 = WTF::allocPages(pageBase - WTF::kPageAllocationGranularity, - WTF::kPageAllocationGranularity, - WTF::kPageAllocationGranularity); - EXPECT_TRUE(map1); - void* map2 = WTF::allocPages(pageBase + WTF::kSuperPageSize, - WTF::kPageAllocationGranularity, - WTF::kPageAllocationGranularity); - EXPECT_TRUE(map2); - WTF::setSystemPagesInaccessible(map1, WTF::kPageAllocationGranularity); - WTF::setSystemPagesInaccessible(map2, WTF::kPageAllocationGranularity); - - for (i = 0; i < numPartitionPagesNeeded; ++i) - secondSuperPagePages[i] = GetFullPage(kTestAllocSize); - - WTF::freePages(map1, WTF::kPageAllocationGranularity); - WTF::freePages(map2, WTF::kPageAllocationGranularity); - - pageBase = - reinterpret_cast(partitionPageToPointer(secondSuperPagePages[0])); - EXPECT_EQ(WTF::kPartitionPageSize, - reinterpret_cast(pageBase) & WTF::kSuperPageOffsetMask); - pageBase -= WTF::kPartitionPageSize; - // Map a single system page either side of the mapping for our allocations, - // with the goal of tripping up alignment of the next mapping. - map1 = WTF::allocPages(pageBase - WTF::kPageAllocationGranularity, - WTF::kPageAllocationGranularity, - WTF::kPageAllocationGranularity); - EXPECT_TRUE(map1); - map2 = WTF::allocPages(pageBase + WTF::kSuperPageSize, - WTF::kPageAllocationGranularity, - WTF::kPageAllocationGranularity); - EXPECT_TRUE(map2); - WTF::setSystemPagesInaccessible(map1, WTF::kPageAllocationGranularity); - WTF::setSystemPagesInaccessible(map2, WTF::kPageAllocationGranularity); - - WTF::PartitionPage* pageInThirdSuperPage = GetFullPage(kTestAllocSize); - WTF::freePages(map1, WTF::kPageAllocationGranularity); - WTF::freePages(map2, WTF::kPageAllocationGranularity); - - EXPECT_EQ(0u, reinterpret_cast( - partitionPageToPointer(pageInThirdSuperPage)) & - WTF::kPartitionPageOffsetMask); - - // And make sure we really did get a page in a new superpage. - EXPECT_NE(reinterpret_cast( - partitionPageToPointer(firstSuperPagePages[0])) & - WTF::kSuperPageBaseMask, - reinterpret_cast( - partitionPageToPointer(pageInThirdSuperPage)) & - WTF::kSuperPageBaseMask); - EXPECT_NE(reinterpret_cast( - partitionPageToPointer(secondSuperPagePages[0])) & - WTF::kSuperPageBaseMask, - reinterpret_cast( - partitionPageToPointer(pageInThirdSuperPage)) & - WTF::kSuperPageBaseMask); - - FreeFullPage(pageInThirdSuperPage); - for (i = 0; i < numPartitionPagesNeeded; ++i) { - FreeFullPage(firstSuperPagePages[i]); - FreeFullPage(secondSuperPagePages[i]); - } - - TestShutdown(); -} - -// Tests that pages in the free page cache do get freed as appropriate. -TEST(PartitionAllocTest, FreeCache) { - TestSetup(); - - EXPECT_EQ(0U, allocator.root()->totalSizeOfCommittedPages); - - size_t bigSize = allocator.root()->maxAllocation - kExtraAllocSize; - size_t bucketIdx = (bigSize + kExtraAllocSize) >> WTF::kBucketShift; - WTF::PartitionBucket* bucket = &allocator.root()->buckets()[bucketIdx]; - - void* ptr = partitionAlloc(allocator.root(), bigSize); - EXPECT_TRUE(ptr); - WTF::PartitionPage* page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - EXPECT_EQ(0, bucket->freePagesHead); - EXPECT_EQ(1, page->numAllocatedSlots); - EXPECT_EQ(WTF::kPartitionPageSize, - allocator.root()->totalSizeOfCommittedPages); - partitionFree(ptr); - EXPECT_EQ(0, page->numAllocatedSlots); - EXPECT_NE(-1, page->freeCacheIndex); - EXPECT_TRUE(page->freelistHead); - - CycleFreeCache(kTestAllocSize); - - // Flushing the cache should have really freed the unused page. - EXPECT_FALSE(page->freelistHead); - EXPECT_EQ(-1, page->freeCacheIndex); - EXPECT_EQ(0, page->numAllocatedSlots); - WTF::PartitionBucket* cycleFreeCacheBucket = - &allocator.root()->buckets()[kTestBucketIndex]; - EXPECT_EQ( - cycleFreeCacheBucket->numSystemPagesPerSlotSpan * WTF::kSystemPageSize, - allocator.root()->totalSizeOfCommittedPages); - - // Check that an allocation works ok whilst in this state (a free'd page - // as the active pages head). - ptr = partitionAlloc(allocator.root(), bigSize); - EXPECT_FALSE(bucket->freePagesHead); - partitionFree(ptr); - - // Also check that a page that is bouncing immediately between empty and - // used does not get freed. - for (size_t i = 0; i < WTF::kMaxFreeableSpans * 2; ++i) { - ptr = partitionAlloc(allocator.root(), bigSize); - EXPECT_TRUE(page->freelistHead); - partitionFree(ptr); - EXPECT_TRUE(page->freelistHead); - } - EXPECT_EQ(WTF::kPartitionPageSize, - allocator.root()->totalSizeOfCommittedPages); - TestShutdown(); -} - -// Tests for a bug we had with losing references to free pages. -TEST(PartitionAllocTest, LostFreePagesBug) { - TestSetup(); - - size_t size = WTF::kPartitionPageSize - kExtraAllocSize; - - void* ptr = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr); - void* ptr2 = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr2); - - WTF::PartitionPage* page = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr)); - WTF::PartitionPage* page2 = - WTF::partitionPointerToPage(WTF::partitionCookieFreePointerAdjust(ptr2)); - WTF::PartitionBucket* bucket = page->bucket; - - EXPECT_EQ(0, bucket->freePagesHead); - EXPECT_EQ(-1, page->numAllocatedSlots); - EXPECT_EQ(1, page2->numAllocatedSlots); - - partitionFreeGeneric(genericAllocator.root(), ptr); - partitionFreeGeneric(genericAllocator.root(), ptr2); - - EXPECT_EQ(0, bucket->freePagesHead); - EXPECT_EQ(0, page->numAllocatedSlots); - EXPECT_EQ(0, page2->numAllocatedSlots); - EXPECT_TRUE(page->freelistHead); - EXPECT_TRUE(page2->freelistHead); - - CycleGenericFreeCache(kTestAllocSize); - - EXPECT_FALSE(page->freelistHead); - EXPECT_FALSE(page2->freelistHead); - - EXPECT_FALSE(bucket->freePagesHead); - EXPECT_TRUE(bucket->activePagesHead); - EXPECT_TRUE(bucket->activePagesHead->nextPage); - - // At this moment, we have two freed pages, on the freelist. - - ptr = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr); - partitionFreeGeneric(genericAllocator.root(), ptr); - - EXPECT_TRUE(bucket->activePagesHead); - EXPECT_TRUE(bucket->freePagesHead); - - CycleGenericFreeCache(kTestAllocSize); - - // We're now set up to trigger the bug by scanning over the active pages - // list, where the current active page is freed, and there exists at least - // one freed page in the free pages list. - ptr = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr); - partitionFreeGeneric(genericAllocator.root(), ptr); - - EXPECT_TRUE(bucket->activePagesHead); - EXPECT_TRUE(bucket->freePagesHead); - - TestShutdown(); -} - -#if !OS(ANDROID) && !OS(IOS) && !OS(FUCHSIA) - -// Make sure that malloc(-1) dies. -// In the past, we had an integer overflow that would alias malloc(-1) to -// malloc(0), which is not good. -TEST(PartitionAllocDeathTest, LargeAllocs) { - TestSetup(); - // Largest alloc. - EXPECT_DEATH( - partitionAllocGeneric(genericAllocator.root(), static_cast(-1)), - ""); - // And the smallest allocation we expect to die. - EXPECT_DEATH(partitionAllocGeneric(genericAllocator.root(), - static_cast(INT_MAX) + 1), - ""); - - TestShutdown(); -} - -// Check that our immediate double-free detection works. -TEST(PartitionAllocDeathTest, ImmediateDoubleFree) { - TestSetup(); - - void* ptr = partitionAllocGeneric(genericAllocator.root(), kTestAllocSize); - EXPECT_TRUE(ptr); - partitionFreeGeneric(genericAllocator.root(), ptr); - - EXPECT_DEATH(partitionFreeGeneric(genericAllocator.root(), ptr), ""); - - TestShutdown(); -} - -// Check that our refcount-based double-free detection works. -TEST(PartitionAllocDeathTest, RefcountDoubleFree) { - TestSetup(); - - void* ptr = partitionAllocGeneric(genericAllocator.root(), kTestAllocSize); - EXPECT_TRUE(ptr); - void* ptr2 = partitionAllocGeneric(genericAllocator.root(), kTestAllocSize); - EXPECT_TRUE(ptr2); - partitionFreeGeneric(genericAllocator.root(), ptr); - partitionFreeGeneric(genericAllocator.root(), ptr2); - // This is not an immediate double-free so our immediate detection won't - // fire. However, it does take the "refcount" of the partition page to -1, - // which is illegal and should be trapped. - EXPECT_DEATH(partitionFreeGeneric(genericAllocator.root(), ptr), ""); - - TestShutdown(); -} - -// Check that guard pages are present where expected. -TEST(PartitionAllocDeathTest, GuardPages) { - TestSetup(); - - // This large size will result in a direct mapped allocation with guard - // pages at either end. - size_t size = - (WTF::kGenericMaxBucketed + WTF::kSystemPageSize) - kExtraAllocSize; - void* ptr = partitionAllocGeneric(genericAllocator.root(), size); - EXPECT_TRUE(ptr); - char* charPtr = reinterpret_cast(ptr) - kPointerOffset; - - EXPECT_DEATH(*(charPtr - 1) = 'A', ""); - EXPECT_DEATH(*(charPtr + size + kExtraAllocSize) = 'A', ""); - - partitionFreeGeneric(genericAllocator.root(), ptr); - - TestShutdown(); -} - -#endif // !OS(ANDROID) - -// Tests that the countLeadingZeros() functions work to our satisfaction. -// It doesn't seem worth the overhead of a whole new file for these tests, so -// we'll put them here since partitionAllocGeneric will depend heavily on these -// functions working correctly. -TEST(PartitionAllocTest, CLZWorks) { - EXPECT_EQ(32u, WTF::countLeadingZeros32(0u)); - EXPECT_EQ(31u, WTF::countLeadingZeros32(1u)); - EXPECT_EQ(1u, WTF::countLeadingZeros32(1u << 30)); - EXPECT_EQ(0u, WTF::countLeadingZeros32(1u << 31)); - -#if CPU(64BIT) - EXPECT_EQ(64u, WTF::countLeadingZerosSizet(0ull)); - EXPECT_EQ(63u, WTF::countLeadingZerosSizet(1ull)); - EXPECT_EQ(32u, WTF::countLeadingZerosSizet(1ull << 31)); - EXPECT_EQ(1u, WTF::countLeadingZerosSizet(1ull << 62)); - EXPECT_EQ(0u, WTF::countLeadingZerosSizet(1ull << 63)); -#else - EXPECT_EQ(32u, WTF::countLeadingZerosSizet(0u)); - EXPECT_EQ(31u, WTF::countLeadingZerosSizet(1u)); - EXPECT_EQ(1u, WTF::countLeadingZerosSizet(1u << 30)); - EXPECT_EQ(0u, WTF::countLeadingZerosSizet(1u << 31)); -#endif -} - -} // namespace - -#endif // !defined(MEMORY_TOOL_REPLACES_ALLOCATOR) diff --git a/sky/engine/wtf/PassOwnPtr.h b/sky/engine/wtf/PassOwnPtr.h deleted file mode 100644 index 96594d93690fa..0000000000000 --- a/sky/engine/wtf/PassOwnPtr.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2013 Intel Corporation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_PASSOWNPTR_H_ -#define SKY_ENGINE_WTF_PASSOWNPTR_H_ - -#include "flutter/sky/engine/wtf/NullPtr.h" -#include "flutter/sky/engine/wtf/OwnPtrCommon.h" - -namespace WTF { - -template -class OwnPtr; -template -class PassOwnPtr; -template -PassOwnPtr adoptPtr(T*); -template -PassOwnPtr adoptArrayPtr(T*); - -template -class PassOwnPtr { - WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(PassOwnPtr); - - public: - typedef typename RemoveExtent::Type ValueType; - typedef ValueType* PtrType; - - PassOwnPtr() : m_ptr(0) {} - PassOwnPtr(std::nullptr_t) : m_ptr(0) {} - - // It somewhat breaks the type system to allow transfer of ownership out of - // a const PassOwnPtr. However, it makes it much easier to work with - // PassOwnPtr temporaries, and we don't have a need to use real const - // PassOwnPtrs anyway. - PassOwnPtr(const PassOwnPtr& o) : m_ptr(o.leakPtr()) {} - template - PassOwnPtr(const PassOwnPtr&, EnsurePtrConvertibleArgDecl(U, T)); - - ~PassOwnPtr() { OwnedPtrDeleter::deletePtr(m_ptr); } - - PtrType get() const { return m_ptr; } - - PtrType leakPtr() const WARN_UNUSED_RETURN; - - ValueType& operator*() const { - ASSERT(m_ptr); - return *m_ptr; - } - PtrType operator->() const { - ASSERT(m_ptr); - return m_ptr; - } - - bool operator!() const { return !m_ptr; } - - // This conversion operator allows implicit conversion to bool but not to - // other integer types. - typedef PtrType PassOwnPtr::*UnspecifiedBoolType; - operator UnspecifiedBoolType() const { - return m_ptr ? &PassOwnPtr::m_ptr : 0; - } - - template - friend PassOwnPtr adoptPtr(U*); - template - friend PassOwnPtr adoptArrayPtr(U*); - template - friend class OwnPtr; - - private: - explicit PassOwnPtr(PtrType ptr) : m_ptr(ptr) {} - - PassOwnPtr& operator=(const PassOwnPtr&) { - COMPILE_ASSERT(!sizeof(T*), PassOwnPtr_should_never_be_assigned_to); - return *this; - } - - // We should never have two OwnPtrs for the same underlying object (otherwise - // we'll get double-destruction), so these equality operators should never be - // needed. - template - bool operator==(const PassOwnPtr&) const { - COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); - return false; - } - template - bool operator!=(const PassOwnPtr&) const { - COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); - return false; - } - template - bool operator==(const OwnPtr&) const { - COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); - return false; - } - template - bool operator!=(const OwnPtr&) const { - COMPILE_ASSERT(!sizeof(U*), OwnPtrs_should_never_be_equal); - return false; - } - - mutable PtrType m_ptr; -}; - -template -template -inline PassOwnPtr::PassOwnPtr(const PassOwnPtr& o, - EnsurePtrConvertibleArgDefn(U, T)) - : m_ptr(o.leakPtr()) { - COMPILE_ASSERT(!IsArray::value, Pointers_to_array_must_never_be_converted); -} - -template -inline typename PassOwnPtr::PtrType PassOwnPtr::leakPtr() const { - PtrType ptr = m_ptr; - m_ptr = 0; - return ptr; -} - -template -inline bool operator==(const PassOwnPtr& a, U* b) { - return a.get() == b; -} - -template -inline bool operator==(T* a, const PassOwnPtr& b) { - return a == b.get(); -} - -template -inline bool operator!=(const PassOwnPtr& a, U* b) { - return a.get() != b; -} - -template -inline bool operator!=(T* a, const PassOwnPtr& b) { - return a != b.get(); -} - -template -inline PassOwnPtr adoptPtr(T* ptr) { - return PassOwnPtr(ptr); -} - -template -inline PassOwnPtr adoptArrayPtr(T* ptr) { - return PassOwnPtr(ptr); -} - -template -inline PassOwnPtr static_pointer_cast(const PassOwnPtr& p) { - COMPILE_ASSERT(!IsArray::value, Pointers_to_array_must_never_be_converted); - return adoptPtr(static_cast(p.leakPtr())); -} - -template -inline T* getPtr(const PassOwnPtr& p) { - return p.get(); -} - -} // namespace WTF - -using WTF::PassOwnPtr; -using WTF::adoptArrayPtr; -using WTF::adoptPtr; -using WTF::static_pointer_cast; - -#endif // SKY_ENGINE_WTF_PASSOWNPTR_H_ diff --git a/sky/engine/wtf/PassRefPtr.h b/sky/engine/wtf/PassRefPtr.h deleted file mode 100644 index 42b0918f29066..0000000000000 --- a/sky/engine/wtf/PassRefPtr.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_PASSREFPTR_H_ -#define SKY_ENGINE_WTF_PASSREFPTR_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/Compiler.h" -#include "flutter/sky/engine/wtf/NullPtr.h" -#include "flutter/sky/engine/wtf/RawPtr.h" -#include "flutter/sky/engine/wtf/TypeTraits.h" - -namespace WTF { - -template -class RefPtr; -template -class PassRefPtr; -template -PassRefPtr adoptRef(T*); - -inline void adopted(const void*) {} - -// requireAdoption() is not overloaded for WTF::RefCounted, which has a -// built-in assumption that adoption is required. requireAdoption() is -// for bootstrapping alternate reference count classes that are compatible -// with ReftPtr/PassRefPtr but cannot have adoption checks enabled -// by default, such as skia's SkRefCnt. The purpose of requireAdoption() -// is to enable adoption checks only once it is known that the object will -// be used with RefPtr/PassRefPtr. -inline void requireAdoption(const void*) {} - -template -ALWAYS_INLINE void refIfNotNull(T* ptr) { - if (LIKELY(ptr != 0)) { - requireAdoption(ptr); - ptr->ref(); - } -} - -template -ALWAYS_INLINE void derefIfNotNull(T* ptr) { - if (LIKELY(ptr != 0)) - ptr->deref(); -} - -template -class PassRefPtr { - WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(PassRefPtr); - - public: - PassRefPtr() : m_ptr(0) {} - PassRefPtr(std::nullptr_t) : m_ptr(0) {} - PassRefPtr(T* ptr) : m_ptr(ptr) { refIfNotNull(ptr); } - template - PassRefPtr(const RawPtr& ptr, EnsurePtrConvertibleArgDecl(U, T)) - : m_ptr(ptr.get()) { - refIfNotNull(m_ptr); - } - explicit PassRefPtr(T& ptr) : m_ptr(&ptr) { m_ptr->ref(); } - // It somewhat breaks the type system to allow transfer of ownership out of - // a const PassRefPtr. However, it makes it much easier to work with - // PassRefPtr temporaries, and we don't have a need to use real const - // PassRefPtrs anyway. - PassRefPtr(const PassRefPtr& o) : m_ptr(o.leakRef()) {} - template - PassRefPtr(const PassRefPtr& o, EnsurePtrConvertibleArgDecl(U, T)) - : m_ptr(o.leakRef()) {} - - ALWAYS_INLINE ~PassRefPtr() { derefIfNotNull(m_ptr); } - - template - PassRefPtr(const RefPtr&, EnsurePtrConvertibleArgDecl(U, T)); - - T* get() const { return m_ptr; } - - T* leakRef() const WARN_UNUSED_RETURN; - - T& operator*() const { return *m_ptr; } - T* operator->() const { return m_ptr; } - - bool operator!() const { return !m_ptr; } - - // This conversion operator allows implicit conversion to bool but not to - // other integer types. - typedef T*(PassRefPtr::*UnspecifiedBoolType); - operator UnspecifiedBoolType() const { - return m_ptr ? &PassRefPtr::m_ptr : 0; - } - - friend PassRefPtr adoptRef(T*); - - private: - enum AdoptRefTag { AdoptRef }; - PassRefPtr(T* ptr, AdoptRefTag) : m_ptr(ptr) {} - - PassRefPtr& operator=(const PassRefPtr&) { - COMPILE_ASSERT(!sizeof(T*), PassRefPtr_should_never_be_assigned_to); - return *this; - } - - mutable T* m_ptr; -}; - -template -template -inline PassRefPtr::PassRefPtr(const RefPtr& o, - EnsurePtrConvertibleArgDefn(U, T)) - : m_ptr(o.get()) { - T* ptr = m_ptr; - refIfNotNull(ptr); -} - -template -inline T* PassRefPtr::leakRef() const { - T* ptr = m_ptr; - m_ptr = 0; - return ptr; -} - -template -inline bool operator==(const PassRefPtr& a, const PassRefPtr& b) { - return a.get() == b.get(); -} - -template -inline bool operator==(const PassRefPtr& a, const RefPtr& b) { - return a.get() == b.get(); -} - -template -inline bool operator==(const RefPtr& a, const PassRefPtr& b) { - return a.get() == b.get(); -} - -template -inline bool operator==(const PassRefPtr& a, U* b) { - return a.get() == b; -} - -template -inline bool operator==(T* a, const PassRefPtr& b) { - return a == b.get(); -} - -template -inline bool operator==(const PassRefPtr& a, const RawPtr& b) { - return a.get() == b.get(); -} - -template -inline bool operator==(const RawPtr& a, const PassRefPtr& b) { - return a.get() == b.get(); -} - -template -inline bool operator!=(const PassRefPtr& a, const PassRefPtr& b) { - return a.get() != b.get(); -} - -template -inline bool operator!=(const PassRefPtr& a, const RefPtr& b) { - return a.get() != b.get(); -} - -template -inline bool operator!=(const RefPtr& a, const PassRefPtr& b) { - return a.get() != b.get(); -} - -template -inline bool operator!=(const PassRefPtr& a, U* b) { - return a.get() != b; -} - -template -inline bool operator!=(T* a, const PassRefPtr& b) { - return a != b.get(); -} - -template -inline bool operator!=(const PassRefPtr& a, const RawPtr& b) { - return a.get() != b.get(); -} - -template -inline bool operator!=(const RawPtr& a, const PassRefPtr& b) { - return a.get() != b.get(); -} - -template -PassRefPtr adoptRef(T* p) { - adopted(p); - return PassRefPtr(p, PassRefPtr::AdoptRef); -} - -template -inline PassRefPtr static_pointer_cast(const PassRefPtr& p) { - return adoptRef(static_cast(p.leakRef())); -} - -template -inline T* getPtr(const PassRefPtr& p) { - return p.get(); -} - -} // namespace WTF - -using WTF::PassRefPtr; -using WTF::adoptRef; -using WTF::static_pointer_cast; - -#endif // SKY_ENGINE_WTF_PASSREFPTR_H_ diff --git a/sky/engine/wtf/PassTraits.h b/sky/engine/wtf/PassTraits.h deleted file mode 100644 index 68b67f407a29c..0000000000000 --- a/sky/engine/wtf/PassTraits.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_PASSTRAITS_H_ -#define SKY_ENGINE_WTF_PASSTRAITS_H_ - -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" - -// The PassTraits template exists to help optimize (or make possible) use -// of WTF data structures with WTF smart pointers that have a Pass -// variant for transfer of ownership - -namespace WTF { - -template -struct PassTraits { - typedef T Type; - typedef T PassType; - static Type& transfer(Type& value) { return value; } -}; - -template -struct PassTraits> { - typedef OwnPtr Type; - typedef PassOwnPtr PassType; - static PassType transfer(Type& value) { return value.release(); } -}; - -template -struct PassTraits> { - typedef RefPtr Type; - typedef PassRefPtr PassType; - static PassType transfer(Type& value) { return value.release(); } -}; - -} // namespace WTF - -using WTF::PassTraits; - -#endif // SKY_ENGINE_WTF_PASSTRAITS_H_ diff --git a/sky/engine/wtf/PrintStream.cpp b/sky/engine/wtf/PrintStream.cpp deleted file mode 100644 index 1b5f53ed362b8..0000000000000 --- a/sky/engine/wtf/PrintStream.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/PrintStream.h" - -#include -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -PrintStream::PrintStream() {} -PrintStream::~PrintStream() {} // Force the vtable to be in this module - -void PrintStream::printf(const char* format, ...) { - va_list argList; - va_start(argList, format); - vprintf(format, argList); - va_end(argList); -} - -void PrintStream::flush() {} - -void printInternal(PrintStream& out, const char* string) { - out.printf("%s", string); -} - -void printInternal(PrintStream& out, const CString& string) { - out.print(string.data()); -} - -void printInternal(PrintStream& out, const String& string) { - out.print(string.utf8()); -} - -void printInternal(PrintStream& out, bool value) { - if (value) - out.print("true"); - else - out.print("false"); -} - -void printInternal(PrintStream& out, int value) { - out.printf("%d", value); -} - -void printInternal(PrintStream& out, unsigned value) { - out.printf("%u", value); -} - -void printInternal(PrintStream& out, long value) { - out.printf("%ld", value); -} - -void printInternal(PrintStream& out, unsigned long value) { - out.printf("%lu", value); -} - -void printInternal(PrintStream& out, long long value) { - out.printf("%lld", value); -} - -void printInternal(PrintStream& out, unsigned long long value) { - out.printf("%llu", value); -} - -void printInternal(PrintStream& out, float value) { - out.print(static_cast(value)); -} - -void printInternal(PrintStream& out, double value) { - out.printf("%lf", value); -} - -void dumpCharacter(PrintStream& out, char value) { - out.printf("%c", value); -} - -} // namespace WTF diff --git a/sky/engine/wtf/PrintStream.h b/sky/engine/wtf/PrintStream.h deleted file mode 100644 index 59a5c1123d487..0000000000000 --- a/sky/engine/wtf/PrintStream.h +++ /dev/null @@ -1,428 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_PRINTSTREAM_H_ -#define SKY_ENGINE_WTF_PRINTSTREAM_H_ - -#include -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -class CString; -class String; - -class WTF_EXPORT PrintStream { - WTF_MAKE_FAST_ALLOCATED; - WTF_MAKE_NONCOPYABLE(PrintStream); - - public: - PrintStream(); - virtual ~PrintStream(); - - void printf(const char* format, ...) WTF_ATTRIBUTE_PRINTF(2, 3); - virtual void vprintf(const char* format, va_list) - WTF_ATTRIBUTE_PRINTF(2, 0) = 0; - - // Typically a no-op for many subclasses of PrintStream, this is a hint that - // the implementation should flush its buffers if it had not done so already. - virtual void flush(); - - template - void print(const T& value) { - printInternal(*this, value); - } - - template - void print(const T1& value1, const T2& value2) { - print(value1); - print(value2); - } - - template - void print(const T1& value1, const T2& value2, const T3& value3) { - print(value1); - print(value2); - print(value3); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4) { - print(value1); - print(value2); - print(value3); - print(value4); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5) { - print(value1); - print(value2); - print(value3); - print(value4); - print(value5); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6) { - print(value1); - print(value2); - print(value3); - print(value4); - print(value5); - print(value6); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7) { - print(value1); - print(value2); - print(value3); - print(value4); - print(value5); - print(value6); - print(value7); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8) { - print(value1); - print(value2); - print(value3); - print(value4); - print(value5); - print(value6); - print(value7); - print(value8); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9) { - print(value1); - print(value2); - print(value3); - print(value4); - print(value5); - print(value6); - print(value7); - print(value8); - print(value9); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9, - const T10& value10) { - print(value1); - print(value2); - print(value3); - print(value4); - print(value5); - print(value6); - print(value7); - print(value8); - print(value9); - print(value10); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9, - const T10& value10, - const T11& value11) { - print(value1); - print(value2); - print(value3); - print(value4); - print(value5); - print(value6); - print(value7); - print(value8); - print(value9); - print(value10); - print(value11); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9, - const T10& value10, - const T11& value11, - const T12& value12) { - print(value1); - print(value2); - print(value3); - print(value4); - print(value5); - print(value6); - print(value7); - print(value8); - print(value9); - print(value10); - print(value11); - print(value12); - } - - template - void print(const T1& value1, - const T2& value2, - const T3& value3, - const T4& value4, - const T5& value5, - const T6& value6, - const T7& value7, - const T8& value8, - const T9& value9, - const T10& value10, - const T11& value11, - const T12& value12, - const T13& value13) { - print(value1); - print(value2); - print(value3); - print(value4); - print(value5); - print(value6); - print(value7); - print(value8); - print(value9); - print(value10); - print(value11); - print(value12); - print(value13); - } -}; - -WTF_EXPORT void printInternal(PrintStream&, const char*); -WTF_EXPORT void printInternal(PrintStream&, const CString&); -WTF_EXPORT void printInternal(PrintStream&, const String&); -inline void printInternal(PrintStream& out, char* value) { - printInternal(out, static_cast(value)); -} -inline void printInternal(PrintStream& out, CString& value) { - printInternal(out, static_cast(value)); -} -inline void printInternal(PrintStream& out, String& value) { - printInternal(out, static_cast(value)); -} -WTF_EXPORT void printInternal(PrintStream&, bool); -WTF_EXPORT void printInternal(PrintStream&, int); -WTF_EXPORT void printInternal(PrintStream&, unsigned); -WTF_EXPORT void printInternal(PrintStream&, long); -WTF_EXPORT void printInternal(PrintStream&, unsigned long); -WTF_EXPORT void printInternal(PrintStream&, long long); -WTF_EXPORT void printInternal(PrintStream&, unsigned long long); -WTF_EXPORT void printInternal(PrintStream&, float); -WTF_EXPORT void printInternal(PrintStream&, double); - -template -void printInternal(PrintStream& out, const T& value) { - value.dump(out); -} - -#define MAKE_PRINT_ADAPTOR(Name, Type, function) \ - class Name { \ - public: \ - Name(const Type& value) : m_value(value) {} \ - void dump(PrintStream& out) const { function(out, m_value); } \ - \ - private: \ - Type m_value; \ - } - -#define MAKE_PRINT_METHOD_ADAPTOR(Name, Type, method) \ - class Name { \ - public: \ - Name(const Type& value) : m_value(value) {} \ - void dump(PrintStream& out) const { m_value.method(out); } \ - \ - private: \ - const Type& m_value; \ - } - -#define MAKE_PRINT_METHOD(Type, dumpMethod, method) \ - MAKE_PRINT_METHOD_ADAPTOR(DumperFor_##method, Type, dumpMethod); \ - DumperFor_##method method() const { return DumperFor_##method(*this); } - -// Use an adaptor-based dumper for characters to avoid situations where -// you've "compressed" an integer to a character and it ends up printing -// as ASCII when you wanted it to print as a number. -void dumpCharacter(PrintStream&, char); -MAKE_PRINT_ADAPTOR(CharacterDump, char, dumpCharacter); - -template -class PointerDump { - public: - PointerDump(const T* ptr) : m_ptr(ptr) {} - - void dump(PrintStream& out) const { - if (m_ptr) - printInternal(out, *m_ptr); - else - out.print("(null)"); - } - - private: - const T* m_ptr; -}; - -template -PointerDump pointerDump(const T* ptr) { - return PointerDump(ptr); -} - -} // namespace WTF - -using WTF::CharacterDump; -using WTF::PointerDump; -using WTF::PrintStream; -using WTF::pointerDump; - -#endif // SKY_ENGINE_WTF_PRINTSTREAM_H_ diff --git a/sky/engine/wtf/RawPtr.h b/sky/engine/wtf/RawPtr.h deleted file mode 100644 index 509623a237f31..0000000000000 --- a/sky/engine/wtf/RawPtr.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2014 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_RAWPTR_H_ -#define SKY_ENGINE_WTF_RAWPTR_H_ - -#include -#include - -#include "flutter/sky/engine/wtf/HashTableDeletedValueType.h" - -// RawPtr is a simple wrapper for a raw pointer that provides the -// interface (get, clear) of other pointer types such as RefPtr, -// Persistent and Member. This is used for the Blink garbage -// collection work in order to be able to write shared code that will -// use reference counting or garbage collection based on a -// compile-time flag. - -namespace WTF { - -template -class RawPtr { - WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(RawPtr); - WTF_DISALLOW_ZERO_ASSIGNMENT(RawPtr); - - public: - RawPtr() { -#if ENABLE(ASSERT) - m_ptr = reinterpret_cast(rawPtrZapValue); -#endif - } - RawPtr(std::nullptr_t) : m_ptr(0) {} - RawPtr(T* ptr) : m_ptr(ptr) {} - explicit RawPtr(T& reference) : m_ptr(&reference) {} - RawPtr(const RawPtr& other) : m_ptr(other.get()) {} - - template - RawPtr(const RawPtr& other) : m_ptr(other.get()) {} - - // Hash table deleted values, which are only constructed and never copied or - // destroyed. - RawPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) {} - bool isHashTableDeletedValue() const { - return m_ptr == hashTableDeletedValue(); - } - - T* get() const { return m_ptr; } - void clear() { m_ptr = 0; } - // FIXME: oilpan: Remove release and leakRef once we remove RefPtr. - RawPtr release() { - RawPtr tmp = m_ptr; - m_ptr = 0; - return tmp; - } - T* leakRef() { - T* ptr = m_ptr; - m_ptr = 0; - return ptr; - } - T* leakPtr() { - T* ptr = m_ptr; - m_ptr = 0; - return ptr; - } - - template - RawPtr& operator=(U* ptr) { - m_ptr = ptr; - return *this; - } - - template - RawPtr& operator=(RawPtr ptr) { - m_ptr = ptr.get(); - return *this; - } - - RawPtr& operator=(std::nullptr_t) { - m_ptr = 0; - return *this; - } - - operator T*() const { return m_ptr; } - T& operator*() const { return *m_ptr; } - T* operator->() const { return m_ptr; } - bool operator!() const { return !m_ptr; } - - void swap(RawPtr& o) { std::swap(m_ptr, o.m_ptr); } - - static T* hashTableDeletedValue() { return reinterpret_cast(-1); } - - private: - static const uintptr_t rawPtrZapValue = 0x3a3a3a3a; - T* m_ptr; -}; - -template -inline RawPtr static_pointer_cast(const RawPtr& p) { - return RawPtr(static_cast(p.get())); -} - -template -inline T* getPtr(const RawPtr& p) { - return p.get(); -} - -} // namespace WTF - -using WTF::RawPtr; - -#endif // SKY_ENGINE_WTF_RAWPTR_H_ diff --git a/sky/engine/wtf/RefCounted.h b/sky/engine/wtf/RefCounted.h deleted file mode 100644 index ef6da7d60ef52..0000000000000 --- a/sky/engine/wtf/RefCounted.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_REFCOUNTED_H_ -#define SKY_ENGINE_WTF_REFCOUNTED_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/InstanceCounter.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -#if ENABLE(ASSERT) -#define CHECK_REF_COUNTED_LIFECYCLE 1 -#include "flutter/sky/engine/wtf/ThreadRestrictionVerifier.h" -#else -#define CHECK_REF_COUNTED_LIFECYCLE 0 -#endif - -namespace WTF { - -// This base class holds the non-template methods and attributes. -// The RefCounted class inherits from it reducing the template bloat -// generated by the compiler (technique called template hoisting). -class WTF_EXPORT RefCountedBase { - public: - void ref() { -#if CHECK_REF_COUNTED_LIFECYCLE - // Start thread verification as soon as the ref count gets to 2. This - // heuristic reflects the fact that items are often created on one thread - // and then given to another thread to be used. - // FIXME: Make this restriction tigher. Especially as we move to more - // common methods for sharing items across threads like CrossThreadCopier.h - // We should be able to add a "detachFromThread" method to make this - // explicit. - if (m_refCount == 1) - m_verifier.setShared(true); - // If this assert fires, it either indicates a thread safety issue or - // that the verification needs to change. See ThreadRestrictionVerifier for - // the different modes. - ASSERT(m_verifier.isSafeToUse()); - ASSERT(!m_adoptionIsRequired); -#endif - ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun); - ++m_refCount; - } - - bool hasOneRef() const { - ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun); -#if CHECK_REF_COUNTED_LIFECYCLE - ASSERT(m_verifier.isSafeToUse()); -#endif - return m_refCount == 1; - } - - int refCount() const { -#if CHECK_REF_COUNTED_LIFECYCLE - ASSERT(m_verifier.isSafeToUse()); -#endif - return m_refCount; - } - - protected: - RefCountedBase() - : m_refCount(1) -#if ENABLE(SECURITY_ASSERT) - , - m_deletionHasBegun(false) -#endif -#if CHECK_REF_COUNTED_LIFECYCLE - , - m_adoptionIsRequired(true) -#endif - { - } - - ~RefCountedBase() { - ASSERT_WITH_SECURITY_IMPLICATION(m_deletionHasBegun); -#if CHECK_REF_COUNTED_LIFECYCLE - ASSERT(!m_adoptionIsRequired); -#endif - } - - // Returns whether the pointer should be freed or not. - bool derefBase() { - ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun); -#if CHECK_REF_COUNTED_LIFECYCLE - ASSERT(m_verifier.isSafeToUse()); - ASSERT(!m_adoptionIsRequired); -#endif - - ASSERT(m_refCount > 0); - --m_refCount; - if (!m_refCount) { -#if ENABLE(SECURITY_ASSERT) - m_deletionHasBegun = true; -#endif - return true; - } - -#if CHECK_REF_COUNTED_LIFECYCLE - // Stop thread verification when the ref goes to 1 because it - // is safe to be passed to another thread at this point. - if (m_refCount == 1) - m_verifier.setShared(false); -#endif - return false; - } - -#if CHECK_REF_COUNTED_LIFECYCLE - bool deletionHasBegun() const { return m_deletionHasBegun; } -#endif - - private: -#if CHECK_REF_COUNTED_LIFECYCLE || ENABLE(SECURITY_ASSERT) - friend void adopted(RefCountedBase*); -#endif - - int m_refCount; -#if ENABLE(SECURITY_ASSERT) - bool m_deletionHasBegun; -#endif -#if CHECK_REF_COUNTED_LIFECYCLE - bool m_adoptionIsRequired; - ThreadRestrictionVerifier m_verifier; -#endif -}; - -#if CHECK_REF_COUNTED_LIFECYCLE || ENABLE(SECURITY_ASSERT) -inline void adopted(RefCountedBase* object) { - if (!object) - return; - ASSERT_WITH_SECURITY_IMPLICATION(!object->m_deletionHasBegun); -#if CHECK_REF_COUNTED_LIFECYCLE - object->m_adoptionIsRequired = false; -#endif -} -#endif - -template -class RefCounted : public RefCountedBase { - WTF_MAKE_NONCOPYABLE(RefCounted); - WTF_MAKE_FAST_ALLOCATED; - - public: - void deref() { - if (derefBase()) - delete static_cast(this); - } - - protected: -#ifdef ENABLE_INSTANCE_COUNTER - RefCounted() { incrementInstanceCount(static_cast(this)); } - - ~RefCounted() { decrementInstanceCount(static_cast(this)); } -#else - RefCounted() {} -#endif -}; - -} // namespace WTF - -using WTF::RefCounted; - -#endif // SKY_ENGINE_WTF_REFCOUNTED_H_ diff --git a/sky/engine/wtf/RefCountedLeakCounter.cpp b/sky/engine/wtf/RefCountedLeakCounter.cpp deleted file mode 100644 index a0ffc2062c00b..0000000000000 --- a/sky/engine/wtf/RefCountedLeakCounter.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/wtf/RefCountedLeakCounter.h" -#include "flutter/sky/engine/wtf/Assertions.h" - -#if ENABLE(ASSERT) -#include "flutter/sky/engine/wtf/Atomics.h" -#include "flutter/sky/engine/wtf/HashCountedSet.h" -#endif - -namespace WTF { - -#if !ENABLE(ASSERT) - -void RefCountedLeakCounter::suppressMessages(const char*) {} -void RefCountedLeakCounter::cancelMessageSuppression(const char*) {} - -RefCountedLeakCounter::RefCountedLeakCounter(const char*) {} -RefCountedLeakCounter::~RefCountedLeakCounter() {} - -void RefCountedLeakCounter::increment() {} -void RefCountedLeakCounter::decrement() {} - -#else - -#define LOG_CHANNEL_PREFIX Log -static WTFLogChannel LogRefCountedLeaks = {WTFLogChannelOn}; - -typedef HashCountedSet> ReasonSet; -static ReasonSet* leakMessageSuppressionReasons; - -void RefCountedLeakCounter::suppressMessages(const char* reason) { - if (!leakMessageSuppressionReasons) - leakMessageSuppressionReasons = new ReasonSet; - leakMessageSuppressionReasons->add(reason); -} - -void RefCountedLeakCounter::cancelMessageSuppression(const char* reason) { - ASSERT(leakMessageSuppressionReasons); - ASSERT(leakMessageSuppressionReasons->contains(reason)); - leakMessageSuppressionReasons->remove(reason); -} - -RefCountedLeakCounter::RefCountedLeakCounter(const char* description) - : m_description(description) {} - -RefCountedLeakCounter::~RefCountedLeakCounter() { - static bool loggedSuppressionReason; - if (m_count) { - if (!leakMessageSuppressionReasons || - leakMessageSuppressionReasons->isEmpty()) - WTF_LOG(RefCountedLeaks, "LEAK: %u %s", m_count, m_description); - else if (!loggedSuppressionReason) { - // This logs only one reason. Later we could change it so we log all the - // reasons. - WTF_LOG(RefCountedLeaks, "No leak checking done: %s", - leakMessageSuppressionReasons->begin()->key); - loggedSuppressionReason = true; - } - } -} - -void RefCountedLeakCounter::increment() { - atomicIncrement(&m_count); -} - -void RefCountedLeakCounter::decrement() { - atomicDecrement(&m_count); -} - -#endif - -} // namespace WTF diff --git a/sky/engine/wtf/RefCountedLeakCounter.h b/sky/engine/wtf/RefCountedLeakCounter.h deleted file mode 100644 index 34d17768645bf..0000000000000 --- a/sky/engine/wtf/RefCountedLeakCounter.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_REFCOUNTEDLEAKCOUNTER_H_ -#define SKY_ENGINE_WTF_REFCOUNTEDLEAKCOUNTER_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -struct WTF_EXPORT RefCountedLeakCounter { - static void suppressMessages(const char*); - static void cancelMessageSuppression(const char*); - - explicit RefCountedLeakCounter(const char* description); - ~RefCountedLeakCounter(); - - void increment(); - void decrement(); - -#if ENABLE(ASSERT) - private: - volatile int m_count; - const char* m_description; -#endif -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_REFCOUNTEDLEAKCOUNTER_H_ diff --git a/sky/engine/wtf/RefPtr.h b/sky/engine/wtf/RefPtr.h deleted file mode 100644 index 38c0caa2d10fc..0000000000000 --- a/sky/engine/wtf/RefPtr.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -// RefPtr and PassRefPtr are documented at http://webkit.org/coding/RefPtr.html - -#ifndef SKY_ENGINE_WTF_REFPTR_H_ -#define SKY_ENGINE_WTF_REFPTR_H_ - -#include -#include "flutter/sky/engine/wtf/HashTableDeletedValueType.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RawPtr.h" - -namespace WTF { - -template -class PassRefPtr; - -template -class RefPtr { - WTF_DISALLOW_CONSTRUCTION_FROM_ZERO(RefPtr); - WTF_DISALLOW_ZERO_ASSIGNMENT(RefPtr); - - public: - ALWAYS_INLINE RefPtr() : m_ptr(0) {} - ALWAYS_INLINE RefPtr(std::nullptr_t) : m_ptr(0) {} - ALWAYS_INLINE RefPtr(T* ptr) : m_ptr(ptr) { refIfNotNull(ptr); } - template - RefPtr(const RawPtr& ptr, EnsurePtrConvertibleArgDecl(U, T)) - : m_ptr(ptr.get()) { - refIfNotNull(m_ptr); - } - ALWAYS_INLINE explicit RefPtr(T& ref) : m_ptr(&ref) { m_ptr->ref(); } - ALWAYS_INLINE RefPtr(const RefPtr& o) : m_ptr(o.m_ptr) { - refIfNotNull(m_ptr); - } - template - RefPtr(const RefPtr& o, EnsurePtrConvertibleArgDecl(U, T)) - : m_ptr(o.get()) { - refIfNotNull(m_ptr); - } - - RefPtr(RefPtr&& o) : m_ptr(o.m_ptr) { o.m_ptr = 0; } - RefPtr& operator=(RefPtr&&); - - // See comments in PassRefPtr.h for an explanation of why this takes a const - // reference. - template - RefPtr(const PassRefPtr&, EnsurePtrConvertibleArgDecl(U, T)); - - // Hash table deleted values, which are only constructed and never copied or - // destroyed. - RefPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) {} - bool isHashTableDeletedValue() const { - return m_ptr == hashTableDeletedValue(); - } - - ALWAYS_INLINE ~RefPtr() { derefIfNotNull(m_ptr); } - - ALWAYS_INLINE T* get() const { return m_ptr; } - - void clear(); - PassRefPtr release() { - PassRefPtr tmp = adoptRef(m_ptr); - m_ptr = 0; - return tmp; - } - - T& operator*() const { return *m_ptr; } - ALWAYS_INLINE T* operator->() const { return m_ptr; } - - bool operator!() const { return !m_ptr; } - - // This conversion operator allows implicit conversion to bool but not to - // other integer types. - typedef T*(RefPtr::*UnspecifiedBoolType); - operator UnspecifiedBoolType() const { return m_ptr ? &RefPtr::m_ptr : 0; } - - RefPtr& operator=(const RefPtr&); - RefPtr& operator=(T*); - RefPtr& operator=(const PassRefPtr&); - RefPtr& operator=(std::nullptr_t) { - clear(); - return *this; - } - - template - RefPtr& operator=(const RefPtr&); - template - RefPtr& operator=(const PassRefPtr&); - template - RefPtr& operator=(const RawPtr&); - - void swap(RefPtr&); - - static T* hashTableDeletedValue() { return reinterpret_cast(-1); } - - private: - T* m_ptr; -}; - -template -template -inline RefPtr::RefPtr(const PassRefPtr& o, - EnsurePtrConvertibleArgDefn(U, T)) - : m_ptr(o.leakRef()) {} - -template -inline void RefPtr::clear() { - T* ptr = m_ptr; - m_ptr = 0; - derefIfNotNull(ptr); -} - -template -inline RefPtr& RefPtr::operator=(const RefPtr& o) { - RefPtr ptr = o; - swap(ptr); - return *this; -} - -template -inline RefPtr& RefPtr::operator=(RefPtr&& o) { - // FIXME: Instead of explicitly casting to RefPtr&& here, we should use - // std::move, but that requires us to have a standard library that supports - // move semantics. - RefPtr ptr = static_cast(o); - swap(ptr); - return *this; -} - -template -template -inline RefPtr& RefPtr::operator=(const RefPtr& o) { - RefPtr ptr = o; - swap(ptr); - return *this; -} - -template -inline RefPtr& RefPtr::operator=(T* optr) { - RefPtr ptr = optr; - swap(ptr); - return *this; -} - -template -inline RefPtr& RefPtr::operator=(const PassRefPtr& o) { - RefPtr ptr = o; - swap(ptr); - return *this; -} - -template -template -inline RefPtr& RefPtr::operator=(const PassRefPtr& o) { - RefPtr ptr = o; - swap(ptr); - return *this; -} - -template -template -inline RefPtr& RefPtr::operator=(const RawPtr& o) { - RefPtr ptr = o.get(); - swap(ptr); - return *this; -} - -template -inline void RefPtr::swap(RefPtr& o) { - std::swap(m_ptr, o.m_ptr); -} - -template -inline void swap(RefPtr& a, RefPtr& b) { - a.swap(b); -} - -template -inline bool operator==(const RefPtr& a, const RefPtr& b) { - return a.get() == b.get(); -} - -template -inline bool operator==(const RefPtr& a, U* b) { - return a.get() == b; -} - -template -inline bool operator==(T* a, const RefPtr& b) { - return a == b.get(); -} - -template -inline bool operator!=(const RefPtr& a, const RefPtr& b) { - return a.get() != b.get(); -} - -template -inline bool operator!=(const RefPtr& a, U* b) { - return a.get() != b; -} - -template -inline bool operator!=(T* a, const RefPtr& b) { - return a != b.get(); -} - -template -inline RefPtr static_pointer_cast(const RefPtr& p) { - return RefPtr(static_cast(p.get())); -} - -template -inline T* getPtr(const RefPtr& p) { - return p.get(); -} - -template -class RefPtrValuePeeker { - public: - ALWAYS_INLINE RefPtrValuePeeker(T* p) : m_ptr(p) {} - ALWAYS_INLINE RefPtrValuePeeker(std::nullptr_t) : m_ptr(0) {} - template - RefPtrValuePeeker(const RefPtr& p) : m_ptr(p.get()) {} - template - RefPtrValuePeeker(const PassRefPtr& p) : m_ptr(p.get()) {} - - ALWAYS_INLINE operator T*() const { return m_ptr; } - - private: - T* m_ptr; -}; - -} // namespace WTF - -using WTF::RefPtr; -using WTF::static_pointer_cast; - -#endif // SKY_ENGINE_WTF_REFPTR_H_ diff --git a/sky/engine/wtf/RefPtrTest.cpp b/sky/engine/wtf/RefPtrTest.cpp deleted file mode 100644 index 89d3887dcc8b9..0000000000000 --- a/sky/engine/wtf/RefPtrTest.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/wtf/RefPtr.h" - -#include -#include "flutter/sky/engine/wtf/text/StringImpl.h" - -namespace { - -TEST(RefPtrTest, Basic) { - RefPtr string; - EXPECT_TRUE(!string); - string = StringImpl::create("test"); - EXPECT_TRUE(!!string); - string.clear(); - EXPECT_TRUE(!string); -} - -TEST(RefPtrTest, MoveAssignmentOperator) { - RefPtr a = StringImpl::create("a"); - RefPtr b = StringImpl::create("b"); - // FIXME: Instead of explicitly casting to RefPtr&& here, we - // should use std::move, but that requires us to have a standard library that - // supports move semantics. - b = static_cast&&>(a); - EXPECT_TRUE(!!b); - EXPECT_TRUE(!a); -} - -} // namespace diff --git a/sky/engine/wtf/RefVector.h b/sky/engine/wtf/RefVector.h deleted file mode 100644 index 954815324e05a..0000000000000 --- a/sky/engine/wtf/RefVector.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_WTF_REFVECTOR_H_ -#define SKY_ENGINE_WTF_REFVECTOR_H_ - -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace blink { - -template -class RefVector : public RefCounted> { - public: - static PassRefPtr create() { return adoptRef(new RefVector); } - PassRefPtr copy() { return adoptRef(new RefVector(*this)); } - - const T& operator[](size_t i) const { return m_vector[i]; } - T& operator[](size_t i) { return m_vector[i]; } - const T& at(size_t i) const { return m_vector.at(i); } - T& at(size_t i) { return m_vector.at(i); } - - bool operator==(const RefVector& o) const { return m_vector == o.m_vector; } - bool operator!=(const RefVector& o) const { return m_vector != o.m_vector; } - - size_t size() const { return m_vector.size(); } - void append(const T& decoration) { m_vector.append(decoration); } - const Vector& vector() const { return m_vector; } - - private: - Vector m_vector; - RefVector() {} - RefVector(const RefVector& o) : m_vector(o.m_vector) {} -}; - -} // namespace blink - -#endif // SKY_ENGINE_WTF_REFVECTOR_H_ diff --git a/sky/engine/wtf/SaturatedArithmetic.h b/sky/engine/wtf/SaturatedArithmetic.h deleted file mode 100644 index b2a45140d65d4..0000000000000 --- a/sky/engine/wtf/SaturatedArithmetic.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_SATURATEDARITHMETIC_H_ -#define SKY_ENGINE_WTF_SATURATEDARITHMETIC_H_ - -#include -#include -#include "flutter/sky/engine/wtf/CPU.h" - -#if CPU(ARM) && COMPILER(GCC) && __OPTIMIZE__ - -// If we're building ARM on GCC we replace the C++ versions with some -// native ARM assembly for speed. -#include "flutter/sky/engine/wtf/asm/SaturatedArithmeticARM.h" - -#else - -ALWAYS_INLINE int32_t saturatedAddition(int32_t a, int32_t b) { - uint32_t ua = a; - uint32_t ub = b; - uint32_t result = ua + ub; - - // Can only overflow if the signed bit of the two values match. If the - // signed bit of the result and one of the values differ it overflowed. - - if (~(ua ^ ub) & (result ^ ua) & (1 << 31)) - return std::numeric_limits::max() + (ua >> 31); - - return result; -} - -ALWAYS_INLINE int32_t saturatedSubtraction(int32_t a, int32_t b) { - uint32_t ua = a; - uint32_t ub = b; - uint32_t result = ua - ub; - - // Can only overflow if the signed bit of the two input values differ. If - // the signed bit of the result and the first value differ it overflowed. - - if ((ua ^ ub) & (result ^ ua) & (1 << 31)) - return std::numeric_limits::max() + (ua >> 31); - - return result; -} - -inline int getMaxSaturatedSetResultForTesting(int FractionalShift) { - // For C version the set function maxes out to max int, this differs from - // the ARM asm version, see SaturatedArithmetiARM.h for the equivalent asm - // version. - return std::numeric_limits::max(); -} - -inline int getMinSaturatedSetResultForTesting(int FractionalShift) { - return std::numeric_limits::min(); -} - -ALWAYS_INLINE int saturatedSet(int value, int FractionalShift) { - const int intMaxForLayoutUnit = - std::numeric_limits::max() >> FractionalShift; - - const int intMinForLayoutUnit = - std::numeric_limits::min() >> FractionalShift; - - if (value > intMaxForLayoutUnit) - return std::numeric_limits::max(); - - if (value < intMinForLayoutUnit) - return std::numeric_limits::min(); - - return value << FractionalShift; -} - -ALWAYS_INLINE int saturatedSet(unsigned value, int FractionalShift) { - const unsigned intMaxForLayoutUnit = - std::numeric_limits::max() >> FractionalShift; - - if (value >= intMaxForLayoutUnit) - return std::numeric_limits::max(); - - return value << FractionalShift; -} - -#endif // CPU(ARM) && COMPILER(GCC) -#endif // SKY_ENGINE_WTF_SATURATEDARITHMETIC_H_ diff --git a/sky/engine/wtf/SaturatedArithmeticTest.cpp b/sky/engine/wtf/SaturatedArithmeticTest.cpp deleted file mode 100644 index 08a13ad436e56..0000000000000 --- a/sky/engine/wtf/SaturatedArithmeticTest.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2012, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include "flutter/sky/engine/wtf/SaturatedArithmetic.h" - -namespace { - -TEST(SaturatedArithmeticTest, Addition) { - EXPECT_EQ(0, saturatedAddition(0, 0)); - EXPECT_EQ(1, saturatedAddition(0, 1)); - EXPECT_EQ(100, saturatedAddition(0, 100)); - EXPECT_EQ(150, saturatedAddition(100, 50)); - - EXPECT_EQ(-1, saturatedAddition(0, -1)); - EXPECT_EQ(0, saturatedAddition(1, -1)); - EXPECT_EQ(50, saturatedAddition(100, -50)); - EXPECT_EQ(-50, saturatedAddition(50, -100)); - - EXPECT_EQ(INT_MAX - 1, saturatedAddition(INT_MAX - 1, 0)); - EXPECT_EQ(INT_MAX, saturatedAddition(INT_MAX - 1, 1)); - EXPECT_EQ(INT_MAX, saturatedAddition(INT_MAX - 1, 2)); - EXPECT_EQ(INT_MAX - 1, saturatedAddition(0, INT_MAX - 1)); - EXPECT_EQ(INT_MAX, saturatedAddition(1, INT_MAX - 1)); - EXPECT_EQ(INT_MAX, saturatedAddition(2, INT_MAX - 1)); - EXPECT_EQ(INT_MAX, saturatedAddition(INT_MAX - 1, INT_MAX - 1)); - EXPECT_EQ(INT_MAX, saturatedAddition(INT_MAX, INT_MAX)); - - EXPECT_EQ(INT_MIN, saturatedAddition(INT_MIN, 0)); - EXPECT_EQ(INT_MIN + 1, saturatedAddition(INT_MIN + 1, 0)); - EXPECT_EQ(INT_MIN + 2, saturatedAddition(INT_MIN + 1, 1)); - EXPECT_EQ(INT_MIN + 3, saturatedAddition(INT_MIN + 1, 2)); - EXPECT_EQ(INT_MIN, saturatedAddition(INT_MIN + 1, -1)); - EXPECT_EQ(INT_MIN, saturatedAddition(INT_MIN + 1, -2)); - EXPECT_EQ(INT_MIN + 1, saturatedAddition(0, INT_MIN + 1)); - EXPECT_EQ(INT_MIN, saturatedAddition(-1, INT_MIN + 1)); - EXPECT_EQ(INT_MIN, saturatedAddition(-2, INT_MIN + 1)); - - EXPECT_EQ(INT_MAX / 2 + 10000, saturatedAddition(INT_MAX / 2, 10000)); - EXPECT_EQ(INT_MAX, saturatedAddition(INT_MAX / 2 + 1, INT_MAX / 2 + 1)); - EXPECT_EQ(-1, saturatedAddition(INT_MIN, INT_MAX)); -} - -TEST(SaturatedArithmeticTest, Subtraction) { - EXPECT_EQ(0, saturatedSubtraction(0, 0)); - EXPECT_EQ(-1, saturatedSubtraction(0, 1)); - EXPECT_EQ(-100, saturatedSubtraction(0, 100)); - EXPECT_EQ(50, saturatedSubtraction(100, 50)); - - EXPECT_EQ(1, saturatedSubtraction(0, -1)); - EXPECT_EQ(2, saturatedSubtraction(1, -1)); - EXPECT_EQ(150, saturatedSubtraction(100, -50)); - EXPECT_EQ(150, saturatedSubtraction(50, -100)); - - EXPECT_EQ(INT_MAX, saturatedSubtraction(INT_MAX, 0)); - EXPECT_EQ(INT_MAX - 1, saturatedSubtraction(INT_MAX, 1)); - EXPECT_EQ(INT_MAX - 1, saturatedSubtraction(INT_MAX - 1, 0)); - EXPECT_EQ(INT_MAX, saturatedSubtraction(INT_MAX - 1, -1)); - EXPECT_EQ(INT_MAX, saturatedSubtraction(INT_MAX - 1, -2)); - EXPECT_EQ(-INT_MAX + 1, saturatedSubtraction(0, INT_MAX - 1)); - EXPECT_EQ(-INT_MAX, saturatedSubtraction(-1, INT_MAX - 1)); - EXPECT_EQ(-INT_MAX - 1, saturatedSubtraction(-2, INT_MAX - 1)); - EXPECT_EQ(-INT_MAX - 1, saturatedSubtraction(-3, INT_MAX - 1)); - - EXPECT_EQ(INT_MIN, saturatedSubtraction(INT_MIN, 0)); - EXPECT_EQ(INT_MIN + 1, saturatedSubtraction(INT_MIN + 1, 0)); - EXPECT_EQ(INT_MIN, saturatedSubtraction(INT_MIN + 1, 1)); - EXPECT_EQ(INT_MIN, saturatedSubtraction(INT_MIN + 1, 2)); - - EXPECT_EQ(0, saturatedSubtraction(INT_MIN, INT_MIN)); - EXPECT_EQ(0, saturatedSubtraction(INT_MAX, INT_MAX)); - EXPECT_EQ(INT_MAX, saturatedSubtraction(INT_MAX, INT_MIN)); -} - -TEST(SaturatedArithmeticTest, SetSigned) { - const int kFractionBits = 6; - const int intMaxForLayoutUnit = INT_MAX >> kFractionBits; - const int intMinForLayoutUnit = INT_MIN >> kFractionBits; - - EXPECT_EQ(0, saturatedSet(0, kFractionBits)); - - // Internally the max number we can represent (without saturating) - // is all the (non-sign) bits set except for the bottom n fraction bits - const int maxInternalRepresentation = INT_MAX ^ ((1 << kFractionBits) - 1); - EXPECT_EQ(maxInternalRepresentation, - saturatedSet(intMaxForLayoutUnit, kFractionBits)); - - EXPECT_EQ(getMaxSaturatedSetResultForTesting(kFractionBits), - saturatedSet(intMaxForLayoutUnit + 100, kFractionBits)); - - EXPECT_EQ((intMaxForLayoutUnit - 100) << kFractionBits, - saturatedSet(intMaxForLayoutUnit - 100, kFractionBits)); - - EXPECT_EQ(getMinSaturatedSetResultForTesting(kFractionBits), - saturatedSet(intMinForLayoutUnit, kFractionBits)); - - EXPECT_EQ(getMinSaturatedSetResultForTesting(kFractionBits), - saturatedSet(intMinForLayoutUnit - 100, kFractionBits)); - - EXPECT_EQ((intMinForLayoutUnit + 100) << kFractionBits, - saturatedSet(intMinForLayoutUnit + 100, kFractionBits)); -} - -TEST(SaturatedArithmeticTest, SetUnsigned) { - const int kFractionBits = 6; - const int intMaxForLayoutUnit = INT_MAX >> kFractionBits; - - EXPECT_EQ(0, saturatedSet((unsigned)0, kFractionBits)); - - EXPECT_EQ(getMaxSaturatedSetResultForTesting(kFractionBits), - saturatedSet((unsigned)intMaxForLayoutUnit, kFractionBits)); - - const unsigned kOverflowed = intMaxForLayoutUnit + 100; - EXPECT_EQ(getMaxSaturatedSetResultForTesting(kFractionBits), - saturatedSet(kOverflowed, kFractionBits)); - - const unsigned kNotOverflowed = intMaxForLayoutUnit - 100; - EXPECT_EQ((intMaxForLayoutUnit - 100) << kFractionBits, - saturatedSet(kNotOverflowed, kFractionBits)); -} - -} // namespace diff --git a/sky/engine/wtf/SizeLimits.cpp b/sky/engine/wtf/SizeLimits.cpp deleted file mode 100644 index 48f3a6fef945e..0000000000000 --- a/sky/engine/wtf/SizeLimits.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassRefPtr.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/ThreadRestrictionVerifier.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -#if ENABLE(ASSERT) || ENABLE(SECURITY_ASSERT) -// The debug/assertion version may get bigger. -struct SameSizeAsRefCounted { - int a; -#if ENABLE(SECURITY_ASSERT) - bool b; -#endif -#if ENABLE(ASSERT) - bool c; - ThreadRestrictionVerifier d; -#endif -}; -#else -struct SameSizeAsRefCounted { - int a; - // Don't add anything here because this should stay small. -}; -#endif -template -struct SameSizeAsVectorWithInlineCapacity; - -template -struct SameSizeAsVectorWithInlineCapacity { - void* bufferPointer; - unsigned capacity; - unsigned size; -}; - -template -struct SameSizeAsVectorWithInlineCapacity { - SameSizeAsVectorWithInlineCapacity baseCapacity; - AlignedBuffer inlineBuffer; -}; - -COMPILE_ASSERT(sizeof(OwnPtr) == sizeof(int*), OwnPtr_should_stay_small); -COMPILE_ASSERT(sizeof(PassRefPtr>) == sizeof(int*), - PassRefPtr_should_stay_small); -COMPILE_ASSERT(sizeof(RefCounted) == sizeof(SameSizeAsRefCounted), - RefCounted_should_stay_small); -COMPILE_ASSERT(sizeof(RefPtr>) == sizeof(int*), - RefPtr_should_stay_small); -COMPILE_ASSERT(sizeof(String) == sizeof(int*), String_should_stay_small); -COMPILE_ASSERT(sizeof(AtomicString) == sizeof(String), - AtomicString_should_stay_small); -COMPILE_ASSERT(sizeof(Vector) == - sizeof(SameSizeAsVectorWithInlineCapacity), - Vector_should_stay_small); -COMPILE_ASSERT(sizeof(Vector) == - sizeof(SameSizeAsVectorWithInlineCapacity), - Vector_should_stay_small); -COMPILE_ASSERT(sizeof(Vector) == - sizeof(SameSizeAsVectorWithInlineCapacity), - Vector_should_stay_small); -COMPILE_ASSERT(sizeof(Vector) == - sizeof(SameSizeAsVectorWithInlineCapacity), - Vector_should_stay_small); -} // namespace WTF diff --git a/sky/engine/wtf/SpinLock.h b/sky/engine/wtf/SpinLock.h deleted file mode 100644 index 1fae148ff9916..0000000000000 --- a/sky/engine/wtf/SpinLock.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_SPINLOCK_H_ -#define SKY_ENGINE_WTF_SPINLOCK_H_ - -// DESCRIPTION -// spinLockLock() and spinLockUnlock() are simple spinlock primitives based on -// the standard CPU primitive of atomic increment and decrement of an int at -// a given memory address. - -#include "flutter/sky/engine/wtf/Atomics.h" - -namespace WTF { - -ALWAYS_INLINE void spinLockLock(int volatile* lock) { - while (UNLIKELY(atomicTestAndSetToOne(lock))) { - while (*lock) { - } // Spin without spamming locked instructions. - } -} - -ALWAYS_INLINE void spinLockUnlock(int volatile* lock) { - atomicSetOneToZero(lock); -} - -} // namespace WTF - -using WTF::spinLockLock; -using WTF::spinLockUnlock; - -#endif // SKY_ENGINE_WTF_SPINLOCK_H_ diff --git a/sky/engine/wtf/StaticConstructors.h b/sky/engine/wtf/StaticConstructors.h deleted file mode 100644 index d18baf8a0e440..0000000000000 --- a/sky/engine/wtf/StaticConstructors.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_STATICCONSTRUCTORS_H_ -#define SKY_ENGINE_WTF_STATICCONSTRUCTORS_H_ - -// We need to avoid having static constructors. This is accomplished by defining -// a static array of the appropriate size and alignment, and defining a const -// reference that points to the buffer. During initialization, the object will -// be constructed with placement new into the buffer. This works with MSVC, GCC, -// and Clang without producing dynamic initialization code even at -O0. The only -// downside is that all external translation units will have to emit one more -// load, while a real global could be referenced directly by absolute or -// relative addressing. - -// Use an array of pointers instead of an array of char in case there is some -// alignment issue. -#define DEFINE_GLOBAL(type, name, ...) \ - void* name##Storage[(sizeof(type) + sizeof(void*) - 1) / sizeof(void*)]; \ - const type& name = *reinterpret_cast(&name##Storage); - -#endif // SKY_ENGINE_WTF_STATICCONSTRUCTORS_H_ diff --git a/sky/engine/wtf/StdLibExtras.h b/sky/engine/wtf/StdLibExtras.h deleted file mode 100644 index 0544726332255..0000000000000 --- a/sky/engine/wtf/StdLibExtras.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_STDLIBEXTRAS_H_ -#define SKY_ENGINE_WTF_STDLIBEXTRAS_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/CheckedArithmetic.h" - -// Use this to declare and define a static local variable (static T;) so that -// it is leaked so that its destructors are not called at exit. -#ifndef DEFINE_STATIC_LOCAL -#define DEFINE_STATIC_LOCAL(type, name, arguments) \ - static type& name = *new type arguments -#endif - -// Use this to declare and define a static local pointer to a ref-counted object -// so that it is leaked so that the object's destructors are not called at exit. -// This macro should be used with ref-counted objects rather than -// DEFINE_STATIC_LOCAL macro, as this macro does not lead to an extra memory -// allocation. -#ifndef DEFINE_STATIC_REF -#define DEFINE_STATIC_REF(type, name, arguments) \ - static type* name = PassRefPtr(arguments).leakRef(); -#endif - -// Use this macro to declare and define a debug-only global variable that may -// have a non-trivial constructor and destructor. When building with clang, this -// will suppress warnings about global constructors and exit-time destructors. -#ifndef NDEBUG -#if COMPILER(CLANG) -#define DEFINE_DEBUG_ONLY_GLOBAL(type, name, arguments) \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wglobal-constructors\"") _Pragma( \ - "clang diagnostic ignored \"-Wexit-time-destructors\"") static type \ - name arguments; \ - _Pragma("clang diagnostic pop") -#else -#define DEFINE_DEBUG_ONLY_GLOBAL(type, name, arguments) \ - static type name arguments; -#endif // COMPILER(CLANG) -#else -#define DEFINE_DEBUG_ONLY_GLOBAL(type, name, arguments) -#endif // NDEBUG - -/* - * The reinterpret_cast([pointer to Type2]) expressions - where - * sizeof(Type1) > sizeof(Type2) - cause the following warning on ARM with GCC: - * increases required alignment of target type. - * - * An implicit or an extra static_cast bypasses the warning. - * For more info see the following bugzilla entries: - * - https://bugs.webkit.org/show_bug.cgi?id=38045 - * - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43976 - */ -#if CPU(ARM) && COMPILER(GCC) -template -bool isPointerTypeAlignmentOkay(Type* ptr) { - return !(reinterpret_cast(ptr) % __alignof__(Type)); -} - -template -TypePtr reinterpret_cast_ptr(void* ptr) { - ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast(ptr))); - return reinterpret_cast(ptr); -} - -template -TypePtr reinterpret_cast_ptr(const void* ptr) { - ASSERT(isPointerTypeAlignmentOkay(reinterpret_cast(ptr))); - return reinterpret_cast(ptr); -} -#else -template -bool isPointerTypeAlignmentOkay(Type*) { - return true; -} -#define reinterpret_cast_ptr reinterpret_cast -#endif - -namespace WTF { - -/* - * C++'s idea of a reinterpret_cast lacks sufficient cojones. - */ -template -inline TO bitwise_cast(FROM from) { - COMPILE_ASSERT(sizeof(TO) == sizeof(FROM), - WTF_bitwise_cast_sizeof_casted_types_is_equal); - union { - FROM from; - TO to; - } u; - u.from = from; - return u.to; -} - -template -inline To safeCast(From value) { - ASSERT(isInBounds(value)); - return static_cast(value); -} - -// Macro that returns a compile time constant with the length of an array, but -// gives an error if passed a non-array. -template -char (&ArrayLengthHelperFunction(T (&)[Size]))[Size]; -// GCC needs some help to deduce a 0 length array. -#if COMPILER(GCC) -template -char (&ArrayLengthHelperFunction(T (&)[0]))[0]; -#endif -#define WTF_ARRAY_LENGTH(array) sizeof(::WTF::ArrayLengthHelperFunction(array)) - -} // namespace WTF - -// This version of placement new omits a 0 check. -enum NotNullTag { NotNull }; -inline void* operator new(size_t, NotNullTag, void* location) { - ASSERT(location); - return location; -} - -using WTF::bitwise_cast; -using WTF::safeCast; - -#endif // SKY_ENGINE_WTF_STDLIBEXTRAS_H_ diff --git a/sky/engine/wtf/StreamBuffer.h b/sky/engine/wtf/StreamBuffer.h deleted file mode 100644 index 534a28a2d1319..0000000000000 --- a/sky/engine/wtf/StreamBuffer.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_STREAMBUFFER_H_ -#define SKY_ENGINE_WTF_STREAMBUFFER_H_ - -#include "flutter/sky/engine/wtf/Deque.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" - -namespace WTF { - -template -class StreamBuffer { - private: - typedef Vector Block; - - public: - StreamBuffer() : m_size(0), m_readOffset(0) {} - - ~StreamBuffer() {} - - bool isEmpty() const { return !size(); } - - void append(const T* data, size_t size) { - if (!size) - return; - - m_size += size; - while (size) { - if (!m_buffer.size() || m_buffer.last()->size() == BlockSize) - m_buffer.append(adoptPtr(new Block)); - size_t appendSize = std::min(BlockSize - m_buffer.last()->size(), size); - m_buffer.last()->append(data, appendSize); - data += appendSize; - size -= appendSize; - } - } - - // This function consume data in the fist block. - // Specified size must be less than over equal to firstBlockSize(). - void consume(size_t size) { - ASSERT(m_size >= size); - if (!m_size) - return; - - ASSERT(m_buffer.size() > 0); - ASSERT(m_readOffset + size <= m_buffer.first()->size()); - m_readOffset += size; - m_size -= size; - if (m_readOffset >= m_buffer.first()->size()) { - m_readOffset = 0; - m_buffer.removeFirst(); - } - } - - size_t size() const { return m_size; } - - const T* firstBlockData() const { - if (!m_size) - return 0; - ASSERT(m_buffer.size() > 0); - return &m_buffer.first()->data()[m_readOffset]; - } - - size_t firstBlockSize() const { - if (!m_size) - return 0; - ASSERT(m_buffer.size() > 0); - return m_buffer.first()->size() - m_readOffset; - } - - private: - size_t m_size; - size_t m_readOffset; - Deque> m_buffer; -}; - -} // namespace WTF - -using WTF::StreamBuffer; - -#endif // SKY_ENGINE_WTF_STREAMBUFFER_H_ diff --git a/sky/engine/wtf/StringExtras.h b/sky/engine/wtf/StringExtras.h deleted file mode 100644 index a8d377f85b743..0000000000000 --- a/sky/engine/wtf/StringExtras.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_STRINGEXTRAS_H_ -#define SKY_ENGINE_WTF_STRINGEXTRAS_H_ - -#include "flutter/sky/engine/wtf/Compiler.h" -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#if OS(POSIX) -#define HAVE_STRINGS_H 1 -#endif - -#if !defined(HAVE_STRNSTR) -#if OS(MACOSX) || (OS(FREEBSD) && !defined(__GLIBC__)) -#define HAVE_STRNSTR 1 -#endif -#endif - -#include -#include -#include - -#if HAVE(STRINGS_H) -#include -#endif - -#if COMPILER(MSVC) -// FIXME: why a COMPILER check instead of OS? also, these should be HAVE checks - -#if _MSC_VER < 1900 -// snprintf is implemented in VS 2015 -inline int snprintf(char* buffer, size_t count, const char* format, ...) { - int result; - va_list args; - va_start(args, format); - result = _vsnprintf(buffer, count, format, args); - va_end(args); - - // In the case where the string entirely filled the buffer, _vsnprintf will - // not null-terminate it, but snprintf must. - if (count > 0) - buffer[count - 1] = '\0'; - - return result; -} - -inline double wtf_vsnprintf(char* buffer, - size_t count, - const char* format, - va_list args) { - int result = _vsnprintf(buffer, count, format, args); - - // In the case where the string entirely filled the buffer, _vsnprintf will - // not null-terminate it, but vsnprintf must. - if (count > 0) - buffer[count - 1] = '\0'; - - return result; -} - -// Work around a difference in Microsoft's implementation of vsnprintf, where -// vsnprintf does not null terminate the buffer. WebKit can rely on the null -// termination. Microsoft's implementation is fixed in VS 2015. -#define vsnprintf(buffer, count, format, args) \ - wtf_vsnprintf(buffer, count, format, args) -#endif - -inline int strncasecmp(const char* s1, const char* s2, size_t len) { - return _strnicmp(s1, s2, len); -} - -inline int strcasecmp(const char* s1, const char* s2) { - return _stricmp(s1, s2); -} - -#endif - -#if !HAVE(STRNSTR) - -inline char* strnstr(const char* buffer, - const char* target, - size_t bufferLength) { - size_t targetLength = strlen(target); - if (targetLength == 0) - return const_cast(buffer); - for (const char* start = buffer; - *start && start + targetLength <= buffer + bufferLength; start++) { - if (*start == *target && - strncmp(start + 1, target + 1, targetLength - 1) == 0) - return const_cast(start); - } - return 0; -} - -#endif - -#endif // SKY_ENGINE_WTF_STRINGEXTRAS_H_ diff --git a/sky/engine/wtf/StringExtrasTest.cpp b/sky/engine/wtf/StringExtrasTest.cpp deleted file mode 100644 index b87170197a9c0..0000000000000 --- a/sky/engine/wtf/StringExtrasTest.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include "flutter/sky/engine/wtf/StringExtras.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace { - -template -struct PrintfFormatTrait { - static const char format[]; -}; - -template <> -struct PrintfFormatTrait { - static const char format[]; -}; -const char PrintfFormatTrait::format[] = "%hd"; - -template <> -struct PrintfFormatTrait { - static const char format[]; -}; -const char PrintfFormatTrait::format[] = "%d"; - -template <> -struct PrintfFormatTrait { - static const char format[]; -}; -const char PrintfFormatTrait::format[] = "%ld"; - -template <> -struct PrintfFormatTrait { - static const char format[]; -}; -#if OS(WIN) -const char PrintfFormatTrait::format[] = "%I64i"; -#else -const char PrintfFormatTrait::format[] = "%lli"; -#endif // OS(WIN) - -template <> -struct PrintfFormatTrait { - static const char format[]; -}; -const char PrintfFormatTrait::format[] = "%hu"; - -template <> -struct PrintfFormatTrait { - static const char format[]; -}; -const char PrintfFormatTrait::format[] = "%u"; - -template <> -struct PrintfFormatTrait { - static const char format[]; -}; -const char PrintfFormatTrait::format[] = "%lu"; - -template <> -struct PrintfFormatTrait { - static const char format[]; -}; -#if OS(WIN) -const char PrintfFormatTrait::format[] = "%I64u"; -#else -const char PrintfFormatTrait::format[] = "%llu"; -#endif // OS(WIN) - -// FIXME: use snprintf from StringExtras.h -template -void testBoundaries() { - const unsigned bufferSize = 256; - Vector buffer; - buffer.resize(bufferSize); - - const IntegerType min = std::numeric_limits::min(); - CString minStringData = String::number(min).latin1(); - snprintf(buffer.data(), bufferSize, PrintfFormatTrait::format, - min); - EXPECT_STREQ(buffer.data(), minStringData.data()); - - const IntegerType max = std::numeric_limits::max(); - CString maxStringData = String::number(max).latin1(); - snprintf(buffer.data(), bufferSize, PrintfFormatTrait::format, - max); - EXPECT_STREQ(buffer.data(), maxStringData.data()); -} - -template -void testNumbers() { - const unsigned bufferSize = 256; - Vector buffer; - buffer.resize(bufferSize); - - for (int i = -100; i < 100; ++i) { - const IntegerType number = static_cast(i); - CString numberStringData = String::number(number).latin1(); - snprintf(buffer.data(), bufferSize, PrintfFormatTrait::format, - number); - EXPECT_STREQ(buffer.data(), numberStringData.data()); - } -} - -TEST(StringExtraTest, IntegerToStringConversionSignedIntegerBoundaries) { - testBoundaries(); - testBoundaries(); - testBoundaries(); - testBoundaries(); -} - -TEST(StringExtraTest, IntegerToStringConversionSignedIntegerRegularNumbers) { - testNumbers(); - testNumbers(); - testNumbers(); - testNumbers(); -} - -TEST(StringExtraTest, IntegerToStringConversionUnsignedIntegerBoundaries) { - testBoundaries(); - testBoundaries(); - testBoundaries(); - testBoundaries(); -} - -TEST(StringExtraTest, IntegerToStringConversionUnsignedIntegerRegularNumbers) { - testNumbers(); - testNumbers(); - testNumbers(); - testNumbers(); -} - -} // namespace diff --git a/sky/engine/wtf/StringHasher.h b/sky/engine/wtf/StringHasher.h deleted file mode 100644 index c2d7158592f42..0000000000000 --- a/sky/engine/wtf/StringHasher.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2008, 2010, 2013 Apple Inc. All rights reserved. - * Copyright (C) 2010 Patrick Gansterer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_STRINGHASHER_H_ -#define SKY_ENGINE_WTF_STRINGHASHER_H_ - -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace WTF { - -// Paul Hsieh's SuperFastHash -// http://www.azillionmonkeys.com/qed/hash.html - -// LChar data is interpreted as Latin-1-encoded (zero extended to 16 bits). - -// NOTE: The hash computation here must stay in sync with the create_hash_table -// script in JavaScriptCore and the CodeGeneratorJS.pm script in WebCore. - -// Golden ratio. Arbitrary start value to avoid mapping all zeros to a hash -// value of zero. -static const unsigned stringHashingStartValue = 0x9E3779B9U; - -class StringHasher { - public: - static const unsigned flagCount = - 8; // Save 8 bits for StringImpl to use as flags. - - StringHasher() - : m_hash(stringHashingStartValue), - m_hasPendingCharacter(false), - m_pendingCharacter(0) {} - - // The hasher hashes two characters at a time, and thus an "aligned" hasher is - // one where an even number of characters have been added. Callers that always - // add characters two at a time can use the "assuming aligned" functions. - void addCharactersAssumingAligned(UChar a, UChar b) { - ASSERT(!m_hasPendingCharacter); - m_hash += a; - m_hash = (m_hash << 16) ^ ((b << 11) ^ m_hash); - m_hash += m_hash >> 11; - } - - void addCharacter(UChar character) { - if (m_hasPendingCharacter) { - m_hasPendingCharacter = false; - addCharactersAssumingAligned(m_pendingCharacter, character); - return; - } - - m_pendingCharacter = character; - m_hasPendingCharacter = true; - } - - void addCharacters(UChar a, UChar b) { - if (m_hasPendingCharacter) { -#if ENABLE(ASSERT) - m_hasPendingCharacter = false; -#endif - addCharactersAssumingAligned(m_pendingCharacter, a); - m_pendingCharacter = b; -#if ENABLE(ASSERT) - m_hasPendingCharacter = true; -#endif - return; - } - - addCharactersAssumingAligned(a, b); - } - - template - void addCharactersAssumingAligned(const T* data, unsigned length) { - ASSERT(!m_hasPendingCharacter); - - bool remainder = length & 1; - length >>= 1; - - while (length--) { - addCharactersAssumingAligned(Converter(data[0]), Converter(data[1])); - data += 2; - } - - if (remainder) - addCharacter(Converter(*data)); - } - - template - void addCharactersAssumingAligned(const T* data, unsigned length) { - addCharactersAssumingAligned(data, length); - } - - template - void addCharacters(const T* data, unsigned length) { - if (m_hasPendingCharacter && length) { - m_hasPendingCharacter = false; - addCharactersAssumingAligned(m_pendingCharacter, Converter(*data++)); - --length; - } - addCharactersAssumingAligned(data, length); - } - - template - void addCharacters(const T* data, unsigned length) { - addCharacters(data, length); - } - - unsigned hashWithTop8BitsMasked() const { - unsigned result = avalancheBits(); - - // Reserving space from the high bits for flags preserves most of the hash's - // value, since hash lookup typically masks out the high bits anyway. - result &= (1U << (sizeof(result) * 8 - flagCount)) - 1; - - // This avoids ever returning a hash code of 0, since that is used to - // signal "hash not computed yet". Setting the high bit maintains - // reasonable fidelity to a hash code of 0 because it is likely to yield - // exactly 0 when hash lookup masks out the high bits. - if (!result) - result = 0x80000000 >> flagCount; - - return result; - } - - unsigned hash() const { - unsigned result = avalancheBits(); - - // This avoids ever returning a hash code of 0, since that is used to - // signal "hash not computed yet". Setting the high bit maintains - // reasonable fidelity to a hash code of 0 because it is likely to yield - // exactly 0 when hash lookup masks out the high bits. - if (!result) - result = 0x80000000; - - return result; - } - - template - static unsigned computeHashAndMaskTop8Bits(const T* data, unsigned length) { - StringHasher hasher; - hasher.addCharactersAssumingAligned(data, length); - return hasher.hashWithTop8BitsMasked(); - } - - template - static unsigned computeHashAndMaskTop8Bits(const T* data, unsigned length) { - return computeHashAndMaskTop8Bits(data, length); - } - - template - static unsigned computeHash(const T* data, unsigned length) { - StringHasher hasher; - hasher.addCharactersAssumingAligned(data, length); - return hasher.hash(); - } - - template - static unsigned computeHash(const T* data, unsigned length) { - return computeHash(data, length); - } - - static unsigned hashMemory(const void* data, unsigned length) { - // FIXME: Why does this function use the version of the hash that drops the - // top 8 bits? We want that for all string hashing so we can use those bits - // in StringImpl and hash strings consistently, but I don't see why we'd - // want that for general memory hashing. - ASSERT(!(length % 2)); - return computeHashAndMaskTop8Bits(static_cast(data), - length / sizeof(UChar)); - } - - template - static unsigned hashMemory(const void* data) { - COMPILE_ASSERT(!(length % 2), length_must_be_a_multiple_of_two); - return hashMemory(data, length); - } - - private: - static UChar defaultConverter(UChar character) { return character; } - - static UChar defaultConverter(LChar character) { return character; } - - unsigned avalancheBits() const { - unsigned result = m_hash; - - // Handle end case. - if (m_hasPendingCharacter) { - result += m_pendingCharacter; - result ^= result << 11; - result += result >> 17; - } - - // Force "avalanching" of final 31 bits. - result ^= result << 3; - result += result >> 5; - result ^= result << 2; - result += result >> 15; - result ^= result << 10; - - return result; - } - - unsigned m_hash; - bool m_hasPendingCharacter; - UChar m_pendingCharacter; -}; - -} // namespace WTF - -using WTF::StringHasher; - -#endif // SKY_ENGINE_WTF_STRINGHASHER_H_ diff --git a/sky/engine/wtf/StringHasherTest.cpp b/sky/engine/wtf/StringHasherTest.cpp deleted file mode 100644 index 174d70f03495f..0000000000000 --- a/sky/engine/wtf/StringHasherTest.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/* - * Copyright (C) 2013 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/StringHasher.h" - -namespace { - -static const LChar nullLChars[2] = {0, 0}; -static const UChar nullUChars[2] = {0, 0}; - -static const unsigned emptyStringHash = 0x4EC889EU; -static const unsigned singleNullCharacterHash = 0x3D3ABF44U; - -static const LChar testALChars[6] = {0x41, 0x95, 0xFF, 0x50, 0x01, 0}; -static const UChar testAUChars[6] = {0x41, 0x95, 0xFF, 0x50, 0x01, 0}; -static const UChar testBUChars[6] = {0x41, 0x95, 0xFFFF, 0x1080, 0x01, 0}; - -static const unsigned testAHash1 = 0xEA32B004; -static const unsigned testAHash2 = 0x93F0F71E; -static const unsigned testAHash3 = 0xCB609EB1; -static const unsigned testAHash4 = 0x7984A706; -static const unsigned testAHash5 = 0x0427561F; - -static const unsigned testBHash1 = 0xEA32B004; -static const unsigned testBHash2 = 0x93F0F71E; -static const unsigned testBHash3 = 0x59EB1B2C; -static const unsigned testBHash4 = 0xA7BCCC0A; -static const unsigned testBHash5 = 0x79201649; - -TEST(StringHasherTest, StringHasher) { - StringHasher hasher; - - // The initial state of the hasher. - EXPECT_EQ(emptyStringHash, hasher.hash()); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); -} - -TEST(StringHasherTest, StringHasher_addCharacter) { - StringHasher hasher; - - // Hashing a single character. - hasher = StringHasher(); - hasher.addCharacter(0); - EXPECT_EQ(singleNullCharacterHash, hasher.hash()); - EXPECT_EQ(singleNullCharacterHash & 0xFFFFFF, - hasher.hashWithTop8BitsMasked()); - - // Hashing five characters, checking the intermediate state after each is - // added. - hasher = StringHasher(); - hasher.addCharacter(testAUChars[0]); - EXPECT_EQ(testAHash1, hasher.hash()); - EXPECT_EQ(testAHash1 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacter(testAUChars[1]); - EXPECT_EQ(testAHash2, hasher.hash()); - EXPECT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacter(testAUChars[2]); - EXPECT_EQ(testAHash3, hasher.hash()); - EXPECT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacter(testAUChars[3]); - EXPECT_EQ(testAHash4, hasher.hash()); - EXPECT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacter(testAUChars[4]); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - - // Hashing a second set of five characters, including non-Latin-1 characters. - hasher = StringHasher(); - hasher.addCharacter(testBUChars[0]); - EXPECT_EQ(testBHash1, hasher.hash()); - EXPECT_EQ(testBHash1 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacter(testBUChars[1]); - EXPECT_EQ(testBHash2, hasher.hash()); - EXPECT_EQ(testBHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacter(testBUChars[2]); - EXPECT_EQ(testBHash3, hasher.hash()); - EXPECT_EQ(testBHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacter(testBUChars[3]); - EXPECT_EQ(testBHash4, hasher.hash()); - EXPECT_EQ(testBHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacter(testBUChars[4]); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); -} - -TEST(StringHasherTest, StringHasher_addCharacters) { - StringHasher hasher; - - // Hashing zero characters. - hasher = StringHasher(); - hasher.addCharacters(static_cast(0), 0); - EXPECT_EQ(emptyStringHash, hasher.hash()); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(nullLChars, 0); - EXPECT_EQ(emptyStringHash, hasher.hash()); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(static_cast(0), 0); - EXPECT_EQ(emptyStringHash, hasher.hash()); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(nullUChars, 0); - EXPECT_EQ(emptyStringHash, hasher.hash()); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - - // Hashing one character. - hasher = StringHasher(); - hasher.addCharacters(nullLChars, 1); - EXPECT_EQ(singleNullCharacterHash, hasher.hash()); - EXPECT_EQ(singleNullCharacterHash & 0xFFFFFF, - hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(nullUChars, 1); - EXPECT_EQ(singleNullCharacterHash, hasher.hash()); - EXPECT_EQ(singleNullCharacterHash & 0xFFFFFF, - hasher.hashWithTop8BitsMasked()); - - // Hashing five characters, all at once. - hasher = StringHasher(); - hasher.addCharacters(testALChars, 5); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testAUChars, 5); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testBUChars, 5); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - - // Hashing five characters, in groups of two, then the last one. - hasher = StringHasher(); - hasher.addCharacters(testALChars, 2); - EXPECT_EQ(testAHash2, hasher.hash()); - EXPECT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testALChars + 2, 2); - EXPECT_EQ(testAHash4, hasher.hash()); - EXPECT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testALChars + 4, 1); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testALChars, 2); - hasher.addCharacters(testALChars + 2, 2); - hasher.addCharacters(testALChars + 4, 1); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testAUChars, 2); - EXPECT_EQ(testAHash2, hasher.hash()); - EXPECT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testAUChars + 2, 2); - EXPECT_EQ(testAHash4, hasher.hash()); - EXPECT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testAUChars + 4, 1); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testAUChars, 2); - hasher.addCharacters(testAUChars + 2, 2); - hasher.addCharacters(testAUChars + 4, 1); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testBUChars, 2); - EXPECT_EQ(testBHash2, hasher.hash()); - EXPECT_EQ(testBHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testBUChars + 2, 2); - EXPECT_EQ(testBHash4, hasher.hash()); - EXPECT_EQ(testBHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testBUChars + 4, 1); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testBUChars, 2); - hasher.addCharacters(testBUChars + 2, 2); - hasher.addCharacters(testBUChars + 4, 1); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - - // Hashing five characters, the first three, then the last two. - hasher = StringHasher(); - hasher.addCharacters(testALChars, 3); - EXPECT_EQ(testAHash3, hasher.hash()); - EXPECT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testALChars + 3, 2); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testALChars, 3); - EXPECT_EQ(testAHash3, hasher.hash()); - EXPECT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testALChars + 3, 2); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testAUChars, 3); - EXPECT_EQ(testAHash3, hasher.hash()); - EXPECT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testAUChars + 3, 2); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testAUChars, 3); - EXPECT_EQ(testAHash3, hasher.hash()); - EXPECT_EQ(testAHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testAUChars + 3, 2); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testBUChars, 3); - EXPECT_EQ(testBHash3, hasher.hash()); - EXPECT_EQ(testBHash3 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacters(testBUChars + 3, 2); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharacters(testBUChars, 3); - hasher.addCharacters(testBUChars + 3, 2); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); -} - -TEST(StringHasherTest, StringHasher_addCharactersAssumingAligned) { - StringHasher hasher; - - // Hashing zero characters. - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(static_cast(0), 0); - EXPECT_EQ(emptyStringHash, hasher.hash()); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(nullLChars, 0); - EXPECT_EQ(emptyStringHash, hasher.hash()); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(static_cast(0), 0); - EXPECT_EQ(emptyStringHash, hasher.hash()); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(nullUChars, 0); - EXPECT_EQ(emptyStringHash, hasher.hash()); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - - // Hashing one character. - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(nullLChars, 1); - EXPECT_EQ(singleNullCharacterHash, hasher.hash()); - EXPECT_EQ(singleNullCharacterHash & 0xFFFFFF, - hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(nullUChars, 1); - EXPECT_EQ(singleNullCharacterHash, hasher.hash()); - EXPECT_EQ(singleNullCharacterHash & 0xFFFFFF, - hasher.hashWithTop8BitsMasked()); - - // Hashing five characters, all at once. - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(testALChars, 5); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(testAUChars, 5); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(testBUChars, 5); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - - // Hashing five characters, in groups of two, then the last one. - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(testALChars, 2); - EXPECT_EQ(testAHash2, hasher.hash()); - EXPECT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharactersAssumingAligned(testALChars + 2, 2); - EXPECT_EQ(testAHash4, hasher.hash()); - EXPECT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharactersAssumingAligned(testALChars + 4, 1); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(testALChars, 2); - hasher.addCharactersAssumingAligned(testALChars + 2, 2); - hasher.addCharactersAssumingAligned(testALChars + 4, 1); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(testAUChars, 2); - EXPECT_EQ(testAHash2, hasher.hash()); - EXPECT_EQ(testAHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharactersAssumingAligned(testAUChars + 2, 2); - EXPECT_EQ(testAHash4, hasher.hash()); - EXPECT_EQ(testAHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharactersAssumingAligned(testAUChars + 4, 1); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(testAUChars, 2); - hasher.addCharactersAssumingAligned(testAUChars + 2, 2); - hasher.addCharactersAssumingAligned(testAUChars + 4, 1); - EXPECT_EQ(testAHash5, hasher.hash()); - EXPECT_EQ(testAHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(testBUChars, 2); - EXPECT_EQ(testBHash2, hasher.hash()); - EXPECT_EQ(testBHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharactersAssumingAligned(testBUChars + 2, 2); - EXPECT_EQ(testBHash4, hasher.hash()); - EXPECT_EQ(testBHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharactersAssumingAligned(testBUChars + 4, 1); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher = StringHasher(); - hasher.addCharactersAssumingAligned(testBUChars, 2); - hasher.addCharactersAssumingAligned(testBUChars + 2, 2); - hasher.addCharactersAssumingAligned(testBUChars + 4, 1); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - - // Hashing five characters, first two characters one at a time, - // then two more, then the last one. - hasher = StringHasher(); - hasher.addCharacter(testBUChars[0]); - EXPECT_EQ(testBHash1, hasher.hash()); - EXPECT_EQ(testBHash1 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharacter(testBUChars[1]); - EXPECT_EQ(testBHash2, hasher.hash()); - EXPECT_EQ(testBHash2 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharactersAssumingAligned(testBUChars[2], testBUChars[3]); - EXPECT_EQ(testBHash4, hasher.hash()); - EXPECT_EQ(testBHash4 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); - hasher.addCharactersAssumingAligned(testBUChars + 4, 1); - EXPECT_EQ(testBHash5, hasher.hash()); - EXPECT_EQ(testBHash5 & 0xFFFFFF, hasher.hashWithTop8BitsMasked()); -} - -TEST(StringHasherTest, StringHasher_computeHash) { - EXPECT_EQ(emptyStringHash, - StringHasher::computeHash(static_cast(0), 0)); - EXPECT_EQ(emptyStringHash, StringHasher::computeHash(nullLChars, 0)); - EXPECT_EQ(emptyStringHash, - StringHasher::computeHash(static_cast(0), 0)); - EXPECT_EQ(emptyStringHash, StringHasher::computeHash(nullUChars, 0)); - - EXPECT_EQ(singleNullCharacterHash, StringHasher::computeHash(nullLChars, 1)); - EXPECT_EQ(singleNullCharacterHash, StringHasher::computeHash(nullUChars, 1)); - - EXPECT_EQ(testAHash5, StringHasher::computeHash(testALChars, 5)); - EXPECT_EQ(testAHash5, StringHasher::computeHash(testAUChars, 5)); - EXPECT_EQ(testBHash5, StringHasher::computeHash(testBUChars, 5)); -} - -TEST(StringHasherTest, StringHasher_computeHashAndMaskTop8Bits) { - EXPECT_EQ( - emptyStringHash & 0xFFFFFF, - StringHasher::computeHashAndMaskTop8Bits(static_cast(0), 0)); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, - StringHasher::computeHashAndMaskTop8Bits(nullLChars, 0)); - EXPECT_EQ( - emptyStringHash & 0xFFFFFF, - StringHasher::computeHashAndMaskTop8Bits(static_cast(0), 0)); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, - StringHasher::computeHashAndMaskTop8Bits(nullUChars, 0)); - - EXPECT_EQ(singleNullCharacterHash & 0xFFFFFF, - StringHasher::computeHashAndMaskTop8Bits(nullLChars, 1)); - EXPECT_EQ(singleNullCharacterHash & 0xFFFFFF, - StringHasher::computeHashAndMaskTop8Bits(nullUChars, 1)); - - EXPECT_EQ(testAHash5 & 0xFFFFFF, - StringHasher::computeHashAndMaskTop8Bits(testALChars, 5)); - EXPECT_EQ(testAHash5 & 0xFFFFFF, - StringHasher::computeHashAndMaskTop8Bits(testAUChars, 5)); - EXPECT_EQ(testBHash5 & 0xFFFFFF, - StringHasher::computeHashAndMaskTop8Bits(testBUChars, 5)); -} - -TEST(StringHasherTest, StringHasher_hashMemory) { - EXPECT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::hashMemory(0, 0)); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, - StringHasher::hashMemory(nullUChars, 0)); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, StringHasher::hashMemory<0>(0)); - EXPECT_EQ(emptyStringHash & 0xFFFFFF, - StringHasher::hashMemory<0>(nullUChars)); - - EXPECT_EQ(singleNullCharacterHash & 0xFFFFFF, - StringHasher::hashMemory(nullUChars, 2)); - EXPECT_EQ(singleNullCharacterHash & 0xFFFFFF, - StringHasher::hashMemory<2>(nullUChars)); - - EXPECT_EQ(testAHash5 & 0xFFFFFF, StringHasher::hashMemory(testAUChars, 10)); - EXPECT_EQ(testAHash5 & 0xFFFFFF, StringHasher::hashMemory<10>(testAUChars)); - EXPECT_EQ(testBHash5 & 0xFFFFFF, StringHasher::hashMemory(testBUChars, 10)); - EXPECT_EQ(testBHash5 & 0xFFFFFF, StringHasher::hashMemory<10>(testBUChars)); -} - -} // namespace diff --git a/sky/engine/wtf/TemporaryChange.h b/sky/engine/wtf/TemporaryChange.h deleted file mode 100644 index 75ace2fa528bf..0000000000000 --- a/sky/engine/wtf/TemporaryChange.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEMPORARYCHANGE_H_ -#define SKY_ENGINE_WTF_TEMPORARYCHANGE_H_ - -#include "flutter/sky/engine/wtf/Noncopyable.h" - -namespace WTF { - -// TemporaryChange<> is useful for setting a variable to a new value only within -// a particular scope. An TemporaryChange<> object changes a variable to its -// original value upon destruction, making it an alternative to writing "var = -// false;" or "var = oldVal;" at all of a block's exit points. -// -// This should be obvious, but note that an TemporaryChange<> instance should -// have a shorter lifetime than its scopedVariable, to prevent invalid memory -// writes when the TemporaryChange<> object is destroyed. - -template -class TemporaryChange { - WTF_MAKE_NONCOPYABLE(TemporaryChange); - - public: - TemporaryChange(T& scopedVariable, T newValue) - : m_scopedVariable(scopedVariable), m_originalValue(scopedVariable) { - m_scopedVariable = newValue; - } - - ~TemporaryChange() { m_scopedVariable = m_originalValue; } - - private: - T& m_scopedVariable; - T m_originalValue; -}; - -} // namespace WTF - -using WTF::TemporaryChange; - -#endif // SKY_ENGINE_WTF_TEMPORARYCHANGE_H_ diff --git a/sky/engine/wtf/TemporaryChangeTest.cpp b/sky/engine/wtf/TemporaryChangeTest.cpp deleted file mode 100644 index 9dc17d58f0a77..0000000000000 --- a/sky/engine/wtf/TemporaryChangeTest.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/TemporaryChange.h" - -namespace { - -TEST(TemporaryChangeTest, Nested) { - bool originallyFalse = false; - { - TemporaryChange change1OriginallyFalse(originallyFalse, true); - EXPECT_TRUE(originallyFalse); - { - TemporaryChange change2OriginallyFalse(originallyFalse, false); - EXPECT_FALSE(originallyFalse); - } - EXPECT_TRUE(originallyFalse); - } - EXPECT_FALSE(originallyFalse); -} - -} // namespace diff --git a/sky/engine/wtf/ThreadIdentifierDataPthreads.cpp b/sky/engine/wtf/ThreadIdentifierDataPthreads.cpp deleted file mode 100644 index 0b2de68a9a557..0000000000000 --- a/sky/engine/wtf/ThreadIdentifierDataPthreads.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2009, 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/OperatingSystem.h" - -#if USE(PTHREADS) - -#include "flutter/sky/engine/wtf/ThreadIdentifierDataPthreads.h" - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/WTF.h" - -#include - -// PTHREAD_KEYS_MAX might be not defined (e.g. in certain bionic versions), so -// explicitly define it here. -#ifndef PTHREAD_KEYS_MAX -#define PTHREAD_KEYS_MAX 1024 -#endif // PTHREAD_KEYS_MAX - -namespace WTF { - -pthread_key_t ThreadIdentifierData::m_key = PTHREAD_KEYS_MAX; - -void threadDidExit(ThreadIdentifier); - -ThreadIdentifierData::~ThreadIdentifierData() { - threadDidExit(m_identifier); -} - -void ThreadIdentifierData::initializeOnce() { - if (pthread_key_create(&m_key, destruct)) - CRASH(); -} - -ThreadIdentifier ThreadIdentifierData::identifier() { - ASSERT(m_key != PTHREAD_KEYS_MAX); - ThreadIdentifierData* threadIdentifierData = - static_cast(pthread_getspecific(m_key)); - - return threadIdentifierData ? threadIdentifierData->m_identifier : 0; -} - -void ThreadIdentifierData::initialize(ThreadIdentifier id) { - ASSERT(!identifier()); - pthread_setspecific(m_key, new ThreadIdentifierData(id)); -} - -void ThreadIdentifierData::destruct(void* data) { - if (isShutdown()) - return; - - ThreadIdentifierData* threadIdentifierData = - static_cast(data); - ASSERT(threadIdentifierData); - - if (threadIdentifierData->m_isDestroyedOnce) { - delete threadIdentifierData; - return; - } - - threadIdentifierData->m_isDestroyedOnce = true; - // Re-setting the value for key causes another destruct() call after all other - // thread-specific destructors were called. - pthread_setspecific(m_key, threadIdentifierData); -} - -} // namespace WTF - -#endif // USE(PTHREADS) diff --git a/sky/engine/wtf/ThreadIdentifierDataPthreads.h b/sky/engine/wtf/ThreadIdentifierDataPthreads.h deleted file mode 100644 index 2125b10e714fc..0000000000000 --- a/sky/engine/wtf/ThreadIdentifierDataPthreads.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_THREADIDENTIFIERDATAPTHREADS_H_ -#define SKY_ENGINE_WTF_THREADIDENTIFIERDATAPTHREADS_H_ - -#include -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/Threading.h" - -namespace WTF { - -// Holds ThreadIdentifier in the thread-specific storage and employs -// pthreads-specific 2-pass destruction to reliably remove ThreadIdentifier from -// threadMap. It assumes regular ThreadSpecific types don't use multiple-pass -// destruction. -class ThreadIdentifierData { - WTF_MAKE_NONCOPYABLE(ThreadIdentifierData); - - public: - ~ThreadIdentifierData(); - - // One time initialization for this class as a whole. - // This method must be called before initialize() and it is not thread-safe. - static void initializeOnce(); - - // Creates and puts an instance of ThreadIdentifierData into thread-specific - // storage. - static void initialize(ThreadIdentifier identifier); - - // Returns 0 if thread-specific storage was not initialized. - static ThreadIdentifier identifier(); - - private: - ThreadIdentifierData(ThreadIdentifier identifier) - : m_identifier(identifier), m_isDestroyedOnce(false) {} - - // This thread-specific destructor is called 2 times when thread terminates: - // - first, when all the other thread-specific destructors are called, it - // simply remembers it was 'destroyed once' and re-sets itself into the - // thread-specific slot to make Pthreads to call it again later. - // - second, after all thread-specific destructors were invoked, it gets - // called again - this time, we remove the ThreadIdentifier from the - // threadMap, completing the cleanup. - static void destruct(void* data); - - ThreadIdentifier m_identifier; - bool m_isDestroyedOnce; - static pthread_key_t m_key; -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_THREADIDENTIFIERDATAPTHREADS_H_ diff --git a/sky/engine/wtf/ThreadRestrictionVerifier.h b/sky/engine/wtf/ThreadRestrictionVerifier.h deleted file mode 100644 index 135347d210371..0000000000000 --- a/sky/engine/wtf/ThreadRestrictionVerifier.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_THREADRESTRICTIONVERIFIER_H_ -#define SKY_ENGINE_WTF_THREADRESTRICTIONVERIFIER_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" - -#if ENABLE(ASSERT) - -#include "flutter/sky/engine/wtf/Threading.h" - -namespace WTF { - -// Verifies that a class is used in a way that respects its lack of -// thread-safety. The default mode is to verify that the object will only be -// used on a single thread. The thread gets captured when setShared(true) is -// called. The mode may be changed by calling useMutexMode (or -// turnOffVerification). -class ThreadRestrictionVerifier { - public: - ThreadRestrictionVerifier() : m_shared(false), m_owningThread(0) {} - - // Indicates that the object may (or may not) be owned by more than one place. - void setShared(bool shared) { - bool previouslyShared = m_shared; - m_shared = shared; - - if (!m_shared) - return; - - ASSERT(shared != previouslyShared); - // Capture the current thread to verify that subsequent ref/deref happen on - // this thread. - m_owningThread = currentThread(); - } - - // Is it OK to use the object at this moment on the current thread? - bool isSafeToUse() const { - if (!m_shared) - return true; - - return m_owningThread == currentThread(); - } - - private: - bool m_shared; - - // Used by SingleThreadVerificationMode - ThreadIdentifier m_owningThread; -}; - -} // namespace WTF - -#endif // ENABLE(ASSERT) -#endif // SKY_ENGINE_WTF_THREADRESTRICTIONVERIFIER_H_ diff --git a/sky/engine/wtf/ThreadSafeRefCounted.h b/sky/engine/wtf/ThreadSafeRefCounted.h deleted file mode 100644 index ba2f7f55a9b45..0000000000000 --- a/sky/engine/wtf/ThreadSafeRefCounted.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_THREADSAFEREFCOUNTED_H_ -#define SKY_ENGINE_WTF_THREADSAFEREFCOUNTED_H_ - -#include "flutter/sky/engine/wtf/Atomics.h" -#include "flutter/sky/engine/wtf/DynamicAnnotations.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -class WTF_EXPORT ThreadSafeRefCountedBase { - WTF_MAKE_NONCOPYABLE(ThreadSafeRefCountedBase); - WTF_MAKE_FAST_ALLOCATED; - - public: - ThreadSafeRefCountedBase(int initialRefCount = 1) - : m_refCount(initialRefCount) {} - - void ref() { atomicIncrement(&m_refCount); } - - bool hasOneRef() { return refCount() == 1; } - - int refCount() const { return static_cast(m_refCount); } - - protected: - // Returns whether the pointer should be freed or not. - bool derefBase() { - WTF_ANNOTATE_HAPPENS_BEFORE(&m_refCount); - if (atomicDecrement(&m_refCount) <= 0) { - WTF_ANNOTATE_HAPPENS_AFTER(&m_refCount); - return true; - } - return false; - } - - private: - int m_refCount; -}; - -template -class ThreadSafeRefCounted : public ThreadSafeRefCountedBase { - public: - void deref() { - if (derefBase()) - delete static_cast(this); - } - - protected: - ThreadSafeRefCounted() {} -}; - -} // namespace WTF - -using WTF::ThreadSafeRefCounted; - -#endif // SKY_ENGINE_WTF_THREADSAFEREFCOUNTED_H_ diff --git a/sky/engine/wtf/ThreadSpecific.h b/sky/engine/wtf/ThreadSpecific.h deleted file mode 100644 index 545aa797860e1..0000000000000 --- a/sky/engine/wtf/ThreadSpecific.h +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * Copyright (C) 2009 Jian Li - * Copyright (C) 2012 Patrick Gansterer - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* Thread local storage is implemented by using either pthread API or Windows - * native API. There is subtle semantic discrepancy for the cleanup function - * implementation as noted below: - * @ In pthread implementation, the destructor function will be called - * repeatedly if there is still non-NULL value associated with the function. - * @ In Windows native implementation, the destructor function will be called - * only once. - * This semantic discrepancy does not impose any problem because nowhere in - * WebKit the repeated call bahavior is utilized. - */ - -#ifndef SKY_ENGINE_WTF_THREADSPECIFIC_H_ -#define SKY_ENGINE_WTF_THREADSPECIFIC_H_ - -#include "flutter/sky/engine/wtf/FastMalloc.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/WTF.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -#if USE(PTHREADS) -#include -#elif OS(WIN) -#include -#endif - -namespace WTF { - -#if OS(WIN) -// ThreadSpecificThreadExit should be called each time when a thread is -// detached. This is done automatically for threads created with -// WTF::createThread. -WTF_EXPORT void ThreadSpecificThreadExit(); -#endif - -template -class ThreadSpecific { - WTF_MAKE_NONCOPYABLE(ThreadSpecific); - - public: - ThreadSpecific(); - bool - isSet(); // Useful as a fast check to see if this thread has set this value. - T* operator->(); - operator T*(); - T& operator*(); - - private: -#if OS(WIN) - WTF_EXPORT friend void ThreadSpecificThreadExit(); -#endif - - // Not implemented. It's technically possible to destroy a thread specific - // key, but one would need to make sure that all values have been destroyed - // already (usually, that all threads that used it have exited). It's unlikely - // that any user of this call will be in that situation - and having a - // destructor defined can be confusing, given that it has such strong - // pre-requisites to work correctly. - ~ThreadSpecific(); - - T* get(); - void set(T*); - void static destroy(void* ptr); - - struct Data { - WTF_MAKE_NONCOPYABLE(Data); - - public: - Data(T* value, ThreadSpecific* owner) : value(value), owner(owner) {} - - T* value; - ThreadSpecific* owner; -#if OS(WIN) - void (*destructor)(void*); -#endif - }; - -#if USE(PTHREADS) - pthread_key_t m_key; -#elif OS(WIN) - int m_index; -#endif -}; - -#if USE(PTHREADS) - -typedef pthread_key_t ThreadSpecificKey; - -inline void threadSpecificKeyCreate(ThreadSpecificKey* key, - void (*destructor)(void*)) { - int error = pthread_key_create(key, destructor); - if (error) - CRASH(); -} - -inline void threadSpecificKeyDelete(ThreadSpecificKey key) { - int error = pthread_key_delete(key); - if (error) - CRASH(); -} - -inline void threadSpecificSet(ThreadSpecificKey key, void* value) { - pthread_setspecific(key, value); -} - -inline void* threadSpecificGet(ThreadSpecificKey key) { - return pthread_getspecific(key); -} - -template -inline ThreadSpecific::ThreadSpecific() { - int error = pthread_key_create(&m_key, destroy); - if (error) - CRASH(); -} - -template -inline T* ThreadSpecific::get() { - Data* data = static_cast(pthread_getspecific(m_key)); - return data ? data->value : 0; -} - -template -inline void ThreadSpecific::set(T* ptr) { - ASSERT(!get()); - pthread_setspecific(m_key, new Data(ptr, this)); -} - -#elif OS(WIN) - -// TLS_OUT_OF_INDEXES is not defined on WinCE. -#ifndef TLS_OUT_OF_INDEXES -#define TLS_OUT_OF_INDEXES 0xffffffff -#endif - -// The maximum number of TLS keys that can be created. For simplification, we -// assume that: 1) Once the instance of ThreadSpecific<> is created, it will not -// be destructed until the program dies. 2) We do not need to hold many -// instances of ThreadSpecific<> data. This fixed number should be far enough. -const int kMaxTlsKeySize = 256; - -WTF_EXPORT long& tlsKeyCount(); -WTF_EXPORT DWORD* tlsKeys(); - -class PlatformThreadSpecificKey; -typedef PlatformThreadSpecificKey* ThreadSpecificKey; - -WTF_EXPORT void threadSpecificKeyCreate(ThreadSpecificKey*, void (*)(void*)); -WTF_EXPORT void threadSpecificKeyDelete(ThreadSpecificKey); -WTF_EXPORT void threadSpecificSet(ThreadSpecificKey, void*); -WTF_EXPORT void* threadSpecificGet(ThreadSpecificKey); - -template -inline ThreadSpecific::ThreadSpecific() : m_index(-1) { - DWORD tlsKey = TlsAlloc(); - if (tlsKey == TLS_OUT_OF_INDEXES) - CRASH(); - - m_index = InterlockedIncrement(&tlsKeyCount()) - 1; - if (m_index >= kMaxTlsKeySize) - CRASH(); - tlsKeys()[m_index] = tlsKey; -} - -template -inline ThreadSpecific::~ThreadSpecific() { - // Does not invoke destructor functions. They will be called from - // ThreadSpecificThreadExit when the thread is detached. - TlsFree(tlsKeys()[m_index]); -} - -template -inline T* ThreadSpecific::get() { - Data* data = static_cast(TlsGetValue(tlsKeys()[m_index])); - return data ? data->value : 0; -} - -template -inline void ThreadSpecific::set(T* ptr) { - ASSERT(!get()); - Data* data = new Data(ptr, this); - data->destructor = &ThreadSpecific::destroy; - TlsSetValue(tlsKeys()[m_index], data); -} - -#else -#error ThreadSpecific is not implemented for this platform. -#endif - -template -inline void ThreadSpecific::destroy(void* ptr) { - if (isShutdown()) - return; - - Data* data = static_cast(ptr); - -#if USE(PTHREADS) - // We want get() to keep working while data destructor works, because it can - // be called indirectly by the destructor. Some pthreads implementations zero - // out the pointer before calling destroy(), so we temporarily reset it. - pthread_setspecific(data->owner->m_key, ptr); -#endif - - data->value->~T(); - fastFree(data->value); - -#if USE(PTHREADS) - pthread_setspecific(data->owner->m_key, 0); -#elif OS(WIN) - TlsSetValue(tlsKeys()[data->owner->m_index], 0); -#else -#error ThreadSpecific is not implemented for this platform. -#endif - - delete data; -} - -template -inline bool ThreadSpecific::isSet() { - return !!get(); -} - -template -inline ThreadSpecific::operator T*() { - T* ptr = static_cast(get()); - if (!ptr) { - // Set up thread-specific value's memory pointer before invoking - // constructor, in case any function it calls needs to access the value, to - // avoid recursion. - ptr = static_cast(fastZeroedMalloc(sizeof(T))); - set(ptr); - new (NotNull, ptr) T; - } - return ptr; -} - -template -inline T* ThreadSpecific::operator->() { - return operator T*(); -} - -template -inline T& ThreadSpecific::operator*() { - return *operator T*(); -} - -} // namespace WTF - -using WTF::ThreadSpecific; - -#endif // SKY_ENGINE_WTF_THREADSPECIFIC_H_ diff --git a/sky/engine/wtf/ThreadSpecificWin.cpp b/sky/engine/wtf/ThreadSpecificWin.cpp deleted file mode 100644 index 248e31e9aa296..0000000000000 --- a/sky/engine/wtf/ThreadSpecificWin.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2009 Jian Li - * Copyright (C) 2012 Patrick Gansterer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "OperatingSystem.h" -#include "ThreadSpecific.h" - -#if OS(WIN) - -#include "StdLibExtras.h" -#include "ThreadingPrimitives.h" -#include "wtf/DoublyLinkedList.h" - -namespace WTF { - -static DoublyLinkedList& destructorsList() { - DEFINE_STATIC_LOCAL(DoublyLinkedList, staticList, - ()); - return staticList; -} - -static Mutex& destructorsMutex() { - DEFINE_STATIC_LOCAL(Mutex, staticMutex, ()); - return staticMutex; -} - -class PlatformThreadSpecificKey - : public DoublyLinkedListNode { - public: - friend class DoublyLinkedListNode; - - PlatformThreadSpecificKey(void (*destructor)(void*)) - : m_destructor(destructor) { - m_tlsKey = TlsAlloc(); - if (m_tlsKey == TLS_OUT_OF_INDEXES) - CRASH(); - } - - ~PlatformThreadSpecificKey() { TlsFree(m_tlsKey); } - - void setValue(void* data) { TlsSetValue(m_tlsKey, data); } - void* value() { return TlsGetValue(m_tlsKey); } - - void callDestructor() { - if (void* data = value()) - m_destructor(data); - } - - private: - void (*m_destructor)(void*); - DWORD m_tlsKey; - PlatformThreadSpecificKey* m_prev; - PlatformThreadSpecificKey* m_next; -}; - -long& tlsKeyCount() { - static long count; - return count; -} - -DWORD* tlsKeys() { - static DWORD keys[kMaxTlsKeySize]; - return keys; -} - -void threadSpecificKeyCreate(ThreadSpecificKey* key, - void (*destructor)(void*)) { - *key = new PlatformThreadSpecificKey(destructor); - - MutexLocker locker(destructorsMutex()); - destructorsList().push(*key); -} - -void threadSpecificKeyDelete(ThreadSpecificKey key) { - MutexLocker locker(destructorsMutex()); - destructorsList().remove(key); - delete key; -} - -void threadSpecificSet(ThreadSpecificKey key, void* data) { - key->setValue(data); -} - -void* threadSpecificGet(ThreadSpecificKey key) { - return key->value(); -} - -void ThreadSpecificThreadExit() { - for (long i = 0; i < tlsKeyCount(); i++) { - // The layout of ThreadSpecific::Data does not depend on T. So we are - // safe to do the static cast to ThreadSpecific in order to access its - // data member. - ThreadSpecific::Data* data = - static_cast::Data*>(TlsGetValue(tlsKeys()[i])); - if (data) - data->destructor(data); - } - - MutexLocker locker(destructorsMutex()); - PlatformThreadSpecificKey* key = destructorsList().head(); - while (key) { - PlatformThreadSpecificKey* nextKey = key->next(); - key->callDestructor(); - key = nextKey; - } -} - -} // namespace WTF - -#endif // OS(WIN) diff --git a/sky/engine/wtf/Threading.h b/sky/engine/wtf/Threading.h deleted file mode 100644 index 35fbf5969a1b6..0000000000000 --- a/sky/engine/wtf/Threading.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_THREADING_H_ -#define SKY_ENGINE_WTF_THREADING_H_ - -#include -#include "flutter/sky/engine/wtf/WTFExport.h" - -// For portability, we do not use thread-safe statics natively supported by some -// compilers (e.g. gcc). -#define AtomicallyInitializedStatic(T, name) \ - WTF::lockAtomicallyInitializedStaticMutex(); \ - static T name; \ - WTF::unlockAtomicallyInitializedStaticMutex(); - -namespace WTF { - -typedef uint32_t ThreadIdentifier; - -// Called in the thread during initialization. -// Helpful for platforms where the thread name must be set from within the -// thread. -WTF_EXPORT void initializeCurrentThreadInternal(const char* threadName); - -WTF_EXPORT ThreadIdentifier currentThread(); - -WTF_EXPORT void lockAtomicallyInitializedStaticMutex(); -WTF_EXPORT void unlockAtomicallyInitializedStaticMutex(); - -} // namespace WTF - -using WTF::ThreadIdentifier; -using WTF::currentThread; - -#endif // SKY_ENGINE_WTF_THREADING_H_ diff --git a/sky/engine/wtf/ThreadingPrimitives.h b/sky/engine/wtf/ThreadingPrimitives.h deleted file mode 100644 index 9bc2eca60f007..0000000000000 --- a/sky/engine/wtf/ThreadingPrimitives.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef SKY_ENGINE_WTF_THREADINGPRIMITIVES_H_ -#define SKY_ENGINE_WTF_THREADINGPRIMITIVES_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Locker.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -#if OS(WIN) -#include -#endif - -#if USE(PTHREADS) -#include -#endif - -namespace WTF { - -#if USE(PTHREADS) -struct PlatformMutex { - pthread_mutex_t m_internalMutex; -#if ENABLE(ASSERT) - size_t m_recursionCount; -#endif -}; -typedef pthread_cond_t PlatformCondition; -#elif OS(WIN) -struct PlatformMutex { - CRITICAL_SECTION m_internalMutex; - size_t m_recursionCount; -}; -struct PlatformCondition { - size_t m_waitersGone; - size_t m_waitersBlocked; - size_t m_waitersToUnblock; - HANDLE m_blockLock; - HANDLE m_blockQueue; - HANDLE m_unblockLock; - - bool timedWait(PlatformMutex&, DWORD durationMilliseconds); - void signal(bool unblockAll); -}; -#else -typedef void* PlatformMutex; -typedef void* PlatformCondition; -#endif - -class WTF_EXPORT MutexBase { - WTF_MAKE_NONCOPYABLE(MutexBase); - WTF_MAKE_FAST_ALLOCATED; - - public: - ~MutexBase(); - - void lock(); - void unlock(); -#if ENABLE(ASSERT) - bool locked() { return m_mutex.m_recursionCount > 0; } -#endif - - public: - PlatformMutex& impl() { return m_mutex; } - - protected: - MutexBase(bool recursive); - - PlatformMutex m_mutex; -}; - -class WTF_EXPORT Mutex : public MutexBase { - public: - Mutex() : MutexBase(false) {} - bool tryLock(); -}; - -class WTF_EXPORT RecursiveMutex : public MutexBase { - public: - RecursiveMutex() : MutexBase(true) {} - bool tryLock(); -}; - -typedef Locker MutexLocker; - -class MutexTryLocker { - WTF_MAKE_NONCOPYABLE(MutexTryLocker); - - public: - MutexTryLocker(Mutex& mutex) : m_mutex(mutex), m_locked(mutex.tryLock()) {} - ~MutexTryLocker() { - if (m_locked) - m_mutex.unlock(); - } - - bool locked() const { return m_locked; } - - private: - Mutex& m_mutex; - bool m_locked; -}; - -#if OS(WIN) -// The absoluteTime is in seconds, starting on January 1, 1970. The time is -// assumed to use the same time zone as WTF::currentTime(). Returns an interval -// in milliseconds suitable for passing to one of the Win32 wait functions -// (e.g., ::WaitForSingleObject). -DWORD absoluteTimeToWaitTimeoutInterval(double absoluteTime); -#endif - -} // namespace WTF - -using WTF::Mutex; -using WTF::MutexBase; -using WTF::MutexLocker; -using WTF::MutexTryLocker; -using WTF::RecursiveMutex; - -#endif // SKY_ENGINE_WTF_THREADINGPRIMITIVES_H_ diff --git a/sky/engine/wtf/ThreadingPthreads.cpp b/sky/engine/wtf/ThreadingPthreads.cpp deleted file mode 100644 index e67d4b216cf55..0000000000000 --- a/sky/engine/wtf/ThreadingPthreads.cpp +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - * Copyright (C) 2011 Research In Motion Limited. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/OperatingSystem.h" -#include "flutter/sky/engine/wtf/Threading.h" - -#if USE(PTHREADS) - -#include -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/ThreadIdentifierDataPthreads.h" -#include "flutter/sky/engine/wtf/ThreadSpecific.h" -#include "flutter/sky/engine/wtf/ThreadingPrimitives.h" -#include "flutter/sky/engine/wtf/WTFThreadData.h" -#include "flutter/sky/engine/wtf/dtoa.h" -#include "wtf/dtoa/cached-powers.h" - -#include -#include -#include - -namespace WTF { - -class PthreadState { - WTF_MAKE_FAST_ALLOCATED; - - public: - enum JoinableState { - Joinable, // The default thread state. The thread can be joined on. - - Joined, // Somebody waited on this thread to exit and this thread finally - // exited. This state is here because there can be a period of time - // between when the thread exits (which causes pthread_join to - // return and the remainder of waitOnThreadCompletion to run) and - // when threadDidExit is called. We need threadDidExit to take - // charge and delete the thread data since there's nobody else to - // pick up the slack in this case (since waitOnThreadCompletion has - // already returned). - - Detached // The thread has been detached and can no longer be joined on. At - // this point, the thread must take care of cleaning up after - // itself. - }; - - // Currently all threads created by WTF start out as joinable. - PthreadState(pthread_t handle) - : m_joinableState(Joinable), m_didExit(false), m_pthreadHandle(handle) {} - - JoinableState joinableState() { return m_joinableState; } - pthread_t pthreadHandle() { return m_pthreadHandle; } - void didBecomeDetached() { m_joinableState = Detached; } - void didExit() { m_didExit = true; } - void didJoin() { m_joinableState = Joined; } - bool hasExited() { return m_didExit; } - - private: - JoinableState m_joinableState; - bool m_didExit; - pthread_t m_pthreadHandle; -}; - -typedef HashMap> ThreadMap; - -static Mutex* atomicallyInitializedStaticMutex; - -void unsafeThreadWasDetached(ThreadIdentifier); -void threadDidExit(ThreadIdentifier); -void threadWasJoined(ThreadIdentifier); - -static Mutex& threadMapMutex() { - DEFINE_STATIC_LOCAL(Mutex, mutex, ()); - return mutex; -} - -void initializeThreading() { - // This should only be called once. - ASSERT(!atomicallyInitializedStaticMutex); - - // StringImpl::empty() does not construct its static string in a threadsafe - // fashion, so ensure it has been initialized from here. - StringImpl::empty(); - atomicallyInitializedStaticMutex = new Mutex; - threadMapMutex(); - ThreadIdentifierData::initializeOnce(); - wtfThreadData(); - s_dtoaP5Mutex = new Mutex; -} - -void lockAtomicallyInitializedStaticMutex() { - ASSERT(atomicallyInitializedStaticMutex); - atomicallyInitializedStaticMutex->lock(); -} - -void unlockAtomicallyInitializedStaticMutex() { - atomicallyInitializedStaticMutex->unlock(); -} - -static ThreadMap& threadMap() { - DEFINE_STATIC_LOCAL(ThreadMap, map, ()); - return map; -} - -static ThreadIdentifier identifierByPthreadHandle( - const pthread_t& pthreadHandle) { - MutexLocker locker(threadMapMutex()); - - ThreadMap::iterator i = threadMap().begin(); - for (; i != threadMap().end(); ++i) { - if (pthread_equal(i->value->pthreadHandle(), pthreadHandle) && - !i->value->hasExited()) - return i->key; - } - - return 0; -} - -static ThreadIdentifier establishIdentifierForPthreadHandle( - const pthread_t& pthreadHandle) { - ASSERT(!identifierByPthreadHandle(pthreadHandle)); - MutexLocker locker(threadMapMutex()); - static ThreadIdentifier identifierCount = 1; - threadMap().add(identifierCount, adoptPtr(new PthreadState(pthreadHandle))); - return identifierCount++; -} - -void initializeCurrentThreadInternal(const char* threadName) { - ThreadIdentifier id = identifierByPthreadHandle(pthread_self()); - ASSERT(id); - ThreadIdentifierData::initialize(id); -} - -void threadDidExit(ThreadIdentifier threadID) { - MutexLocker locker(threadMapMutex()); - PthreadState* state = threadMap().get(threadID); - ASSERT(state); - - state->didExit(); - - if (state->joinableState() != PthreadState::Joinable) - threadMap().remove(threadID); -} - -ThreadIdentifier currentThread() { - ThreadIdentifier id = ThreadIdentifierData::identifier(); - if (id) - return id; - - // Not a WTF-created thread, ThreadIdentifier is not established yet. - id = establishIdentifierForPthreadHandle(pthread_self()); - ThreadIdentifierData::initialize(id); - return id; -} - -MutexBase::MutexBase(bool recursive) { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype( - &attr, recursive ? PTHREAD_MUTEX_RECURSIVE : PTHREAD_MUTEX_NORMAL); - - int result = pthread_mutex_init(&m_mutex.m_internalMutex, &attr); - ASSERT_UNUSED(result, !result); -#if ENABLE(ASSERT) - m_mutex.m_recursionCount = 0; -#endif - - pthread_mutexattr_destroy(&attr); -} - -MutexBase::~MutexBase() { - int result = pthread_mutex_destroy(&m_mutex.m_internalMutex); - ASSERT_UNUSED(result, !result); -} - -void MutexBase::lock() { - int result = pthread_mutex_lock(&m_mutex.m_internalMutex); - ASSERT_UNUSED(result, !result); -#if ENABLE(ASSERT) - ++m_mutex.m_recursionCount; -#endif -} - -void MutexBase::unlock() { -#if ENABLE(ASSERT) - ASSERT(m_mutex.m_recursionCount); - --m_mutex.m_recursionCount; -#endif - int result = pthread_mutex_unlock(&m_mutex.m_internalMutex); - ASSERT_UNUSED(result, !result); -} - -// There is a separate tryLock implementation for the Mutex and the -// RecursiveMutex since on Windows we need to manually check if tryLock should -// succeed or not for the non-recursive mutex. On Linux the two implementations -// are equal except we can assert the recursion count is always zero for the -// non-recursive mutex. -bool Mutex::tryLock() { - int result = pthread_mutex_trylock(&m_mutex.m_internalMutex); - if (result == 0) { -#if ENABLE(ASSERT) - // The Mutex class is not recursive, so the recursionCount should be - // zero after getting the lock. - ASSERT(!m_mutex.m_recursionCount); - ++m_mutex.m_recursionCount; -#endif - return true; - } - if (result == EBUSY) - return false; - - ASSERT_NOT_REACHED(); - return false; -} - -bool RecursiveMutex::tryLock() { - int result = pthread_mutex_trylock(&m_mutex.m_internalMutex); - if (result == 0) { -#if ENABLE(ASSERT) - ++m_mutex.m_recursionCount; -#endif - return true; - } - if (result == EBUSY) - return false; - - ASSERT_NOT_REACHED(); - return false; -} - -} // namespace WTF - -#endif // USE(PTHREADS) diff --git a/sky/engine/wtf/ThreadingWin.cpp b/sky/engine/wtf/ThreadingWin.cpp deleted file mode 100644 index 2c92285f885c9..0000000000000 --- a/sky/engine/wtf/ThreadingWin.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2009 Google Inc. All rights reserved. - * Copyright (C) 2009 Torch Mobile, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * There are numerous academic and practical works on how to implement - * pthread_cond_wait/pthread_cond_signal/pthread_cond_broadcast functions on - * Win32. Here is one example: http://www.cs.wustl.edu/~schmidt/win32-cv-1.html - * which is widely credited as a 'starting point' of modern attempts. There are - * several more or less proven implementations, one in Boost C++ library - * (http://www.boost.org) and another in pthreads-win32 - * (http://sourceware.org/pthreads-win32/). - * - * The number of articles and discussions is the evidence of significant - * difficulties in implementing these primitives correctly. The brief search of - * revisions, ChangeLog entries, discussions in comp.programming.threads and - * other places clearly documents numerous pitfalls and performance problems the - * authors had to overcome to arrive to the suitable implementations. Optimally, - * WebKit would use one of those supported/tested libraries directly. To roll - * out our own implementation is impractical, if even for the lack of sufficient - * testing. However, a faithful reproduction of the code from one of the popular - * supported libraries seems to be a good compromise. - * - * The early Boost implementation - * (http://www.boxbackup.org/trac/browser/box/nick/win/lib/win32/boost_1_32_0/libs/thread/src/condition.cpp?rev=30) - * is identical to pthreads-win32 - * (http://sourceware.org/cgi-bin/cvsweb.cgi/pthreads/pthread_cond_wait.c?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=pthreads-win32). - * Current Boost uses yet another (although seemingly equivalent) algorithm - * which came from their 'thread rewrite' effort. - * - * This file includes timedWait/signal/broadcast implementations translated to - * WebKit coding style from the latest algorithm by Alexander Terekhov and Louis - * Thomas, as captured here: - * http://sourceware.org/cgi-bin/cvsweb.cgi/pthreads/pthread_cond_wait.c?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=pthreads-win32 - * It replaces the implementation of their previous algorithm, also documented - * in the same source above. The naming and comments are left very close to - * original to enable easy cross-check. - * - * The corresponding Pthreads-win32 License is included below, and CONTRIBUTORS - * file which it refers to is added to source directory (as - * CONTRIBUTORS.pthreads-win32). - */ - -/* - * Pthreads-win32 - POSIX Threads Library for Win32 - * Copyright(C) 1998 John E. Bossom - * Copyright(C) 1999,2005 Pthreads-win32 contributors - * - * Contact Email: rpj@callisto.canberra.edu.au - * - * The current list of contributors is contained - * in the file CONTRIBUTORS included with the source - * code distribution. The list can also be seen at the - * following World Wide Web location: - * http://sources.redhat.com/pthreads-win32/contributors.html - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library in the file COPYING.LIB; - * if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#include "OperatingSystem.h" -#include "Threading.h" - -#if OS(WIN) - -#include -#include -#include -#include "HashMap.h" -#include "OwnPtr.h" -#include "PassOwnPtr.h" -#include "ThreadSpecific.h" -#include "ThreadingPrimitives.h" -#include "WTFThreadData.h" -#include "dtoa.h" -#include "dtoa/cached-powers.h" - -namespace WTF { - -// THREADNAME_INFO comes from -// . -#pragma pack(push, 8) -typedef struct tagTHREADNAME_INFO { - DWORD dwType; // must be 0x1000 - LPCSTR szName; // pointer to name (in user addr space) - DWORD dwThreadID; // thread ID (-1=caller thread) - DWORD dwFlags; // reserved for future use, must be zero -} THREADNAME_INFO; -#pragma pack(pop) - -static Mutex* atomicallyInitializedStaticMutex; - -void lockAtomicallyInitializedStaticMutex() { - ASSERT(atomicallyInitializedStaticMutex); - atomicallyInitializedStaticMutex->lock(); -} - -void unlockAtomicallyInitializedStaticMutex() { - atomicallyInitializedStaticMutex->unlock(); -} - -void initializeThreading() { - // This should only be called once. - ASSERT(!atomicallyInitializedStaticMutex); - - // StringImpl::empty() does not construct its static string in a threadsafe - // fashion, so ensure it has been initialized from here. - StringImpl::empty(); - StringImpl::empty16Bit(); - atomicallyInitializedStaticMutex = new Mutex; - wtfThreadData(); - s_dtoaP5Mutex = new Mutex; - // Force initialization of static DoubleToStringConverter converter variable - // inside EcmaScriptConverter function while we are in single thread mode. - double_conversion::DoubleToStringConverter::EcmaScriptConverter(); -} - -ThreadIdentifier currentThread() { - return static_cast(GetCurrentThreadId()); -} - -MutexBase::MutexBase(bool recursive) { - m_mutex.m_recursionCount = 0; - InitializeCriticalSection(&m_mutex.m_internalMutex); -} - -MutexBase::~MutexBase() { - DeleteCriticalSection(&m_mutex.m_internalMutex); -} - -void MutexBase::lock() { - EnterCriticalSection(&m_mutex.m_internalMutex); - ++m_mutex.m_recursionCount; -} - -void MutexBase::unlock() { - ASSERT(m_mutex.m_recursionCount); - --m_mutex.m_recursionCount; - LeaveCriticalSection(&m_mutex.m_internalMutex); -} - -bool Mutex::tryLock() { - // This method is modeled after the behavior of pthread_mutex_trylock, - // which will return an error if the lock is already owned by the - // current thread. Since the primitive Win32 'TryEnterCriticalSection' - // treats this as a successful case, it changes the behavior of several - // tests in WebKit that check to see if the current thread already - // owned this mutex (see e.g., IconDatabase::getOrCreateIconRecord) - DWORD result = TryEnterCriticalSection(&m_mutex.m_internalMutex); - - if (result != 0) { // We got the lock - // If this thread already had the lock, we must unlock and return - // false since this is a non-recursive mutex. This is to mimic the - // behavior of POSIX's pthread_mutex_trylock. We don't do this - // check in the lock method (presumably due to performance?). This - // means lock() will succeed even if the current thread has already - // entered the critical section. - if (m_mutex.m_recursionCount > 0) { - LeaveCriticalSection(&m_mutex.m_internalMutex); - return false; - } - ++m_mutex.m_recursionCount; - return true; - } - - return false; -} - -bool RecursiveMutex::tryLock() { - // CRITICAL_SECTION is recursive/reentrant so TryEnterCriticalSection will - // succeed if the current thread is already in the critical section. - DWORD result = TryEnterCriticalSection(&m_mutex.m_internalMutex); - if (result == 0) { // We didn't get the lock. - return false; - } - ++m_mutex.m_recursionCount; - return true; -} - -} // namespace WTF - -#endif // OS(WIN) diff --git a/sky/engine/wtf/TypeTraits.cpp b/sky/engine/wtf/TypeTraits.cpp deleted file mode 100644 index b7dd729fad9fb..0000000000000 --- a/sky/engine/wtf/TypeTraits.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2009, 2010 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/wtf/TypeTraits.h" - -#include "flutter/sky/engine/wtf/Assertions.h" - -namespace WTF { - -COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_bool_true); -COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_char_true); -COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_signed_char_true); -COMPILE_ASSERT(IsInteger::value, - WTF_IsInteger_unsigned_char_true); -COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_short_true); -COMPILE_ASSERT(IsInteger::value, - WTF_IsInteger_unsigned_short_true); -COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_int_true); -COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_unsigned_int_true); -COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_long_true); -COMPILE_ASSERT(IsInteger::value, - WTF_IsInteger_unsigned_long_true); -COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_long_long_true); -COMPILE_ASSERT(IsInteger::value, - WTF_IsInteger_unsigned_long_long_true); -COMPILE_ASSERT(IsInteger::value, WTF_IsInteger_wchar_t_true); -COMPILE_ASSERT(!IsInteger::value, WTF_IsInteger_char_pointer_false); -COMPILE_ASSERT(!IsInteger::value, - WTF_IsInteger_const_char_pointer_false); -COMPILE_ASSERT(!IsInteger::value, - WTF_IsInteger_volatile_char_pointer_false); -COMPILE_ASSERT(!IsInteger::value, WTF_IsInteger_double_false); -COMPILE_ASSERT(!IsInteger::value, WTF_IsInteger_float_false); - -COMPILE_ASSERT(IsFloatingPoint::value, WTF_IsFloatingPoint_float_true); -COMPILE_ASSERT(IsFloatingPoint::value, WTF_IsFloatingPoint_double_true); -COMPILE_ASSERT(IsFloatingPoint::value, - WTF_IsFloatingPoint_long_double_true); -COMPILE_ASSERT(!IsFloatingPoint::value, WTF_IsFloatingPoint_int_false); - -COMPILE_ASSERT(IsPod::value, WTF_IsPod_bool_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_char_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_signed_char_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_unsigned_char_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_short_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_unsigned_short_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_int_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_unsigned_int_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_long_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_unsigned_long_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_long_long_true); -COMPILE_ASSERT(IsPod::value, - WTF_IsPod_unsigned_long_long_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_wchar_t_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_char_pointer_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_const_char_pointer_true); -COMPILE_ASSERT(IsPod::value, - WTF_IsPod_volatile_char_pointer_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_double_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_long_double_true); -COMPILE_ASSERT(IsPod::value, WTF_IsPod_float_true); -COMPILE_ASSERT(!IsPod>::value, WTF_IsPod_struct_false); - -enum IsConvertibleToIntegerCheck {}; -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_enum_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_bool_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_char_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_signed_char_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_unsigned_char_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_short_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_unsigned_short_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_int_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_unsigned_int_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_long_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_unsigned_long_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_long_long_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_unsigned_long_long_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_wchar_t_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_double_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_long_double_true); -COMPILE_ASSERT(IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_float_true); -COMPILE_ASSERT(!IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_char_pointer_false); -COMPILE_ASSERT(!IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_const_char_pointer_false); -COMPILE_ASSERT(!IsConvertibleToInteger::value, - WTF_IsConvertibleToInteger_volatile_char_pointer_false); -COMPILE_ASSERT(!IsConvertibleToInteger>::value, - WTF_IsConvertibleToInteger_struct_false); - -COMPILE_ASSERT((IsPointerConvertible::Value), - WTF_IsPointerConvertible_same_type_true); -COMPILE_ASSERT((!IsPointerConvertible::Value), - WTF_IsPointerConvertible_int_to_unsigned_false); -COMPILE_ASSERT((IsPointerConvertible::Value), - WTF_IsPointerConvertible_int_to_const_int_true); -COMPILE_ASSERT((!IsPointerConvertible::Value), - WTF_IsPointerConvertible_const_int_to_int_false); -COMPILE_ASSERT((IsPointerConvertible::Value), - WTF_IsPointerConvertible_int_to_volatile_int_true); - -COMPILE_ASSERT((IsSameType::value), WTF_IsSameType_bool_true); -COMPILE_ASSERT((IsSameType::value), - WTF_IsSameType_int_pointer_true); -COMPILE_ASSERT((!IsSameType::value), - WTF_IsSameType_int_int_pointer_false); -COMPILE_ASSERT((!IsSameType::value), - WTF_IsSameType_const_change_false); -COMPILE_ASSERT((!IsSameType::value), - WTF_IsSameType_volatile_change_false); - -template -class TestBaseClass {}; - -class TestDerivedClass : public TestBaseClass {}; - -COMPILE_ASSERT((IsSubclass>::value), - WTF_Test_IsSubclass_Derived_From_Base); -COMPILE_ASSERT((!IsSubclass, TestDerivedClass>::value), - WTF_Test_IsSubclass_Base_From_Derived); -COMPILE_ASSERT((IsSubclassOfTemplate::value), - WTF_Test_IsSubclassOfTemplate_Base_From_Derived); -COMPILE_ASSERT( - (IsSameType, TestBaseClass>::Type, - int>::value), - WTF_Test_RemoveTemplate); -COMPILE_ASSERT( - (IsSameType::Type, int>::value), - WTF_Test_RemoveTemplate_WithoutTemplate); -COMPILE_ASSERT( - (IsPointerConvertible>::Value), - WTF_Test_IsPointerConvertible_Derived_To_Base); -COMPILE_ASSERT( - (!IsPointerConvertible, TestDerivedClass>::Value), - WTF_Test_IsPointerConvertible_Base_To_Derived); - -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_test_RemoveConst_const_bool); -COMPILE_ASSERT((!IsSameType::Type>::value), - WTF_test_RemoveConst_volatile_bool); - -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_test_RemoveVolatile_bool); -COMPILE_ASSERT((!IsSameType::Type>::value), - WTF_test_RemoveVolatile_const_bool); -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_test_RemoveVolatile_volatile_bool); - -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_test_RemoveConstVolatile_bool); -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_test_RemoveConstVolatile_const_bool); -COMPILE_ASSERT( - (IsSameType::Type>::value), - WTF_test_RemoveConstVolatile_volatile_bool); -COMPILE_ASSERT( - (IsSameType::Type>::value), - WTF_test_RemoveConstVolatile_const_volatile_bool); - -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_Test_RemovePointer_int); -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_Test_RemovePointer_int_pointer); -COMPILE_ASSERT((!IsSameType::Type>::value), - WTF_Test_RemovePointer_int_pointer_pointer); - -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_Test_RemoveReference_int); -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_Test_RemoveReference_int_reference); - -typedef int IntArray[]; -typedef int IntArraySized[4]; - -COMPILE_ASSERT((IsArray::value), WTF_Test_IsArray_int_array); -COMPILE_ASSERT((IsArray::value), - WTF_Test_IsArray_int_sized_array); - -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_Test_RemoveExtent_int_array); -COMPILE_ASSERT((IsSameType::Type>::value), - WTF_Test_RemoveReference_int_sized_array); - -} // namespace WTF diff --git a/sky/engine/wtf/TypeTraits.h b/sky/engine/wtf/TypeTraits.h deleted file mode 100644 index ee082bc4bffd6..0000000000000 --- a/sky/engine/wtf/TypeTraits.h +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * Copyright (C) 2009, 2010 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_TYPETRAITS_H_ -#define SKY_ENGINE_WTF_TYPETRAITS_H_ - -#include -#include - -namespace WTF { - -// The following are provided in this file: -// -// IsInteger::value -// IsPod::value, see the definition for a note about its limitations -// IsConvertibleToInteger::value -// -// IsArray::value -// -// IsSameType::value -// -// RemovePointer::Type -// RemoveReference::Type -// RemoveConst::Type -// RemoveVolatile::Type -// RemoveConstVolatile::Type -// RemoveExtent::Type -// -// COMPILE_ASSERT's in TypeTraits.cpp illustrate their usage and what they do. - -template -struct EnableIf; -template -struct EnableIf { - typedef T Type; -}; - -template -struct IsInteger { - static const bool value = false; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; -template <> -struct IsInteger { - static const bool value = true; -}; - -template -struct IsFloatingPoint { - static const bool value = false; -}; -template <> -struct IsFloatingPoint { - static const bool value = true; -}; -template <> -struct IsFloatingPoint { - static const bool value = true; -}; -template <> -struct IsFloatingPoint { - static const bool value = true; -}; - -template -struct IsArithmetic { - static const bool value = IsInteger::value || IsFloatingPoint::value; -}; - -template -struct IsWeak { - static const bool value = false; -}; - -enum WeakHandlingFlag { - NoWeakHandlingInCollections, - WeakHandlingInCollections -}; - -// IsPod is misnamed as it doesn't cover all plain old data (pod) types. -// Specifically, it doesn't allow for enums or for structs. -template -struct IsPod { - static const bool value = IsArithmetic::value; -}; -template -struct IsPod { - static const bool value = true; -}; - -template -class IsConvertibleToInteger { - // Avoid "possible loss of data" warning when using Microsoft's C++ compiler - // by not converting int's to doubles. - template - class IsConvertibleToDouble; - template - class IsConvertibleToDouble { - public: - static const bool value = false; - }; - - template - class IsConvertibleToDouble { - typedef char YesType; - struct NoType { - char padding[8]; - }; - - static YesType floatCheck(long double); - static NoType floatCheck(...); - static T& t; - - public: - static const bool value = sizeof(floatCheck(t)) == sizeof(YesType); - }; - - public: - static const bool value = - IsInteger::value || - IsConvertibleToDouble::value, T>::value; -}; - -template -class IsPointerConvertible { - typedef char YesType; - struct NoType { - char padding[8]; - }; - - static YesType convertCheck(To* x); - static NoType convertCheck(...); - - public: - enum { - Value = (sizeof(YesType) == sizeof(convertCheck(static_cast(0)))) - }; -}; - -template -struct IsArray { - static const bool value = false; -}; - -template -struct IsArray { - static const bool value = true; -}; - -template -struct IsArray { - static const bool value = true; -}; - -template -struct IsSameType { - static const bool value = false; -}; - -template -struct IsSameType { - static const bool value = true; -}; - -template -class IsSubclass { - typedef char YesType; - struct NoType { - char padding[8]; - }; - - static YesType subclassCheck(U*); - static NoType subclassCheck(...); - static T* t; - - public: - static const bool value = sizeof(subclassCheck(t)) == sizeof(YesType); -}; - -template class U> -class IsSubclassOfTemplate { - typedef char YesType; - struct NoType { - char padding[8]; - }; - - template - static YesType subclassCheck(U*); - static NoType subclassCheck(...); - static T* t; - - public: - static const bool value = sizeof(subclassCheck(t)) == sizeof(YesType); -}; - -template class U> -class IsSubclassOfTemplateTypenameSize { - typedef char YesType; - struct NoType { - char padding[8]; - }; - - template - static YesType subclassCheck(U*); - static NoType subclassCheck(...); - static T* t; - - public: - static const bool value = sizeof(subclassCheck(t)) == sizeof(YesType); -}; - -template class U> -class IsSubclassOfTemplateTypenameSizeTypename { - typedef char YesType; - struct NoType { - char padding[8]; - }; - - template - static YesType subclassCheck(U*); - static NoType subclassCheck(...); - static T* t; - - public: - static const bool value = sizeof(subclassCheck(t)) == sizeof(YesType); -}; - -template class U> -class IsSubclassOfTemplate3 { - typedef char YesType; - struct NoType { - char padding[8]; - }; - - template - static YesType subclassCheck(U*); - static NoType subclassCheck(...); - static T* t; - - public: - static const bool value = sizeof(subclassCheck(t)) == sizeof(YesType); -}; - -template class U> -class IsSubclassOfTemplate5 { - typedef char YesType; - struct NoType { - char padding[8]; - }; - - template - static YesType subclassCheck(U*); - static NoType subclassCheck(...); - static T* t; - - public: - static const bool value = sizeof(subclassCheck(t)) == sizeof(YesType); -}; - -template class OuterTemplate> -struct RemoveTemplate { - typedef T Type; -}; - -template class OuterTemplate> -struct RemoveTemplate, OuterTemplate> { - typedef T Type; -}; - -template -struct RemoveConst { - typedef T Type; -}; - -template -struct RemoveConst { - typedef T Type; -}; - -template -struct RemoveVolatile { - typedef T Type; -}; - -template -struct RemoveVolatile { - typedef T Type; -}; - -template -struct RemoveConstVolatile { - typedef typename RemoveVolatile::Type>::Type Type; -}; - -template -struct RemovePointer { - typedef T Type; -}; - -template -struct RemovePointer { - typedef T Type; -}; - -template -struct RemoveReference { - typedef T Type; -}; - -template -struct RemoveReference { - typedef T Type; -}; - -template -struct RemoveExtent { - typedef T Type; -}; - -template -struct RemoveExtent { - typedef T Type; -}; - -template -struct RemoveExtent { - typedef T Type; -}; - -// Determines whether this type has a vtable. -template -struct IsPolymorphic { - static const bool value = __is_polymorphic(T); -}; - -#define EnsurePtrConvertibleArgDecl(From, To) \ - typename WTF::EnableIf::Value, \ - bool>::Type = true -#define EnsurePtrConvertibleArgDefn(From, To) \ - typename WTF::EnableIf::Value, bool>::Type - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TYPETRAITS_H_ diff --git a/sky/engine/wtf/Vector.h b/sky/engine/wtf/Vector.h deleted file mode 100644 index 16deb88572d55..0000000000000 --- a/sky/engine/wtf/Vector.h +++ /dev/null @@ -1,1165 +0,0 @@ -/* - * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_VECTOR_H_ -#define SKY_ENGINE_WTF_VECTOR_H_ - -#include -#include -#include "flutter/sky/engine/wtf/Alignment.h" -#include "flutter/sky/engine/wtf/Compiler.h" -#include "flutter/sky/engine/wtf/DefaultAllocator.h" -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/NotFound.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/VectorTraits.h" -#include "flutter/sky/engine/wtf/WTF.h" - -namespace WTF { - -#if defined(MEMORY_SANITIZER_INITIAL_SIZE) -static const size_t kInitialVectorSize = 1; -#else -#ifndef WTF_VECTOR_INITIAL_SIZE -#define WTF_VECTOR_INITIAL_SIZE 4 -#endif -static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE; -#endif - -template -class Deque; - -template -struct VectorDestructor; - -template -struct VectorDestructor { - static void destruct(T*, T*) {} -}; - -template -struct VectorDestructor { - static void destruct(T* begin, T* end) { - for (T* cur = begin; cur != end; ++cur) - cur->~T(); - } -}; - -template -struct VectorInitializer; - -template -struct VectorInitializer { - static void initialize(T* begin, T* end) { - for (T* cur = begin; cur != end; ++cur) - new (NotNull, cur) T; - } -}; - -template -struct VectorInitializer { - static void initialize(T* begin, T* end) { - memset(begin, 0, - reinterpret_cast(end) - reinterpret_cast(begin)); - } -}; - -template -struct VectorMover; - -template -struct VectorMover { - static void move(const T* src, const T* srcEnd, T* dst) { - while (src != srcEnd) { - new (NotNull, dst) T(*src); - src->~T(); - ++dst; - ++src; - } - } - static void moveOverlapping(const T* src, const T* srcEnd, T* dst) { - if (src > dst) - move(src, srcEnd, dst); - else { - T* dstEnd = dst + (srcEnd - src); - while (src != srcEnd) { - --srcEnd; - --dstEnd; - new (NotNull, dstEnd) T(*srcEnd); - srcEnd->~T(); - } - } - } - static void swap(T* src, T* srcEnd, T* dst) { - std::swap_ranges(src, srcEnd, dst); - } -}; - -template -struct VectorMover { - static void move(const T* src, const T* srcEnd, T* dst) { - memcpy(dst, src, - reinterpret_cast(srcEnd) - - reinterpret_cast(src)); - } - static void moveOverlapping(const T* src, const T* srcEnd, T* dst) { - memmove(dst, src, - reinterpret_cast(srcEnd) - - reinterpret_cast(src)); - } - static void swap(T* src, T* srcEnd, T* dst) { - std::swap_ranges(reinterpret_cast(src), - reinterpret_cast(srcEnd), - reinterpret_cast(dst)); - } -}; - -template -struct VectorCopier; - -template -struct VectorCopier { - template - static void uninitializedCopy(const U* src, const U* srcEnd, T* dst) { - while (src != srcEnd) { - new (NotNull, dst) T(*src); - ++dst; - ++src; - } - } -}; - -template -struct VectorCopier { - static void uninitializedCopy(const T* src, const T* srcEnd, T* dst) { - memcpy(dst, src, - reinterpret_cast(srcEnd) - - reinterpret_cast(src)); - } - template - static void uninitializedCopy(const U* src, const U* srcEnd, T* dst) { - VectorCopier::uninitializedCopy(src, srcEnd, dst); - } -}; - -template -struct VectorFiller; - -template -struct VectorFiller { - static void uninitializedFill(T* dst, T* dstEnd, const T& val) { - while (dst != dstEnd) { - new (NotNull, dst) T(val); - ++dst; - } - } -}; - -template -struct VectorFiller { - static void uninitializedFill(T* dst, T* dstEnd, const T& val) { - COMPILE_ASSERT(sizeof(T) == sizeof(char), - Size_of_type_should_be_equal_to_one); -#if COMPILER(GCC) && defined(_FORTIFY_SOURCE) - if (!__builtin_constant_p(dstEnd - dst) || (!(dstEnd - dst))) -#endif - memset(dst, val, dstEnd - dst); - } -}; - -template -struct VectorComparer; - -template -struct VectorComparer { - static bool compare(const T* a, const T* b, size_t size) { - if (LIKELY(a && b)) - return std::equal(a, a + size, b); - return !a && !b; - } -}; - -template -struct VectorComparer { - static bool compare(const T* a, const T* b, size_t size) { - return memcmp(a, b, sizeof(T) * size) == 0; - } -}; - -template -struct VectorTypeOperations { - static void destruct(T* begin, T* end) { - VectorDestructor::needsDestruction, T>::destruct(begin, - end); - } - - static void initialize(T* begin, T* end) { - VectorInitializer::canInitializeWithMemset, T>::initialize( - begin, end); - } - - static void move(const T* src, const T* srcEnd, T* dst) { - VectorMover::canMoveWithMemcpy, T>::move(src, srcEnd, dst); - } - - static void moveOverlapping(const T* src, const T* srcEnd, T* dst) { - VectorMover::canMoveWithMemcpy, T>::moveOverlapping( - src, srcEnd, dst); - } - - static void swap(T* src, T* srcEnd, T* dst) { - VectorMover::canMoveWithMemcpy, T>::swap(src, srcEnd, dst); - } - - static void uninitializedCopy(const T* src, const T* srcEnd, T* dst) { - VectorCopier::canCopyWithMemcpy, T>::uninitializedCopy( - src, srcEnd, dst); - } - - static void uninitializedFill(T* dst, T* dstEnd, const T& val) { - VectorFiller::canFillWithMemset, T>::uninitializedFill( - dst, dstEnd, val); - } - - static bool compare(const T* a, const T* b, size_t size) { - return VectorComparer::canCompareWithMemcmp, T>::compare( - a, b, size); - } -}; - -template -class VectorBufferBase { - WTF_MAKE_NONCOPYABLE(VectorBufferBase); - - public: - void allocateBuffer(size_t newCapacity) { - typedef typename Allocator::template VectorBackingHelper< - T, VectorTraits>::Type VectorBacking; - ASSERT(newCapacity); - size_t sizeToAllocate = allocationSize(newCapacity); - m_buffer = - Allocator::template backingMalloc(sizeToAllocate); - m_capacity = sizeToAllocate / sizeof(T); - } - - size_t allocationSize(size_t capacity) const { - return Allocator::Quantizer::template quantizedSize(capacity); - } - - T* buffer() { return m_buffer; } - const T* buffer() const { return m_buffer; } - size_t capacity() const { return m_capacity; } - - protected: - VectorBufferBase() : m_buffer(0), m_capacity(0) {} - - VectorBufferBase(T* buffer, size_t capacity) - : m_buffer(buffer), m_capacity(capacity) {} - - T* m_buffer; - unsigned m_capacity; - unsigned m_size; -}; - -template -class VectorBuffer; - -template -class VectorBuffer : protected VectorBufferBase { - private: - typedef VectorBufferBase Base; - - public: - VectorBuffer() {} - - VectorBuffer(size_t capacity) { - // Calling malloc(0) might take a lock and may actually do an - // allocation on some systems. - if (capacity) - allocateBuffer(capacity); - } - - void destruct() { - deallocateBuffer(m_buffer); - m_buffer = 0; - } - - void deallocateBuffer(T* bufferToDeallocate) { - Allocator::backingFree(bufferToDeallocate); - } - - void resetBufferPointer() { - m_buffer = 0; - m_capacity = 0; - } - - void swapVectorBuffer(VectorBuffer& other) { - std::swap(m_buffer, other.m_buffer); - std::swap(m_capacity, other.m_capacity); - } - - using Base::allocateBuffer; - using Base::allocationSize; - - using Base::buffer; - using Base::capacity; - - bool hasOutOfLineBuffer() const { - // When inlineCapacity is 0 we have an out of line buffer if we have a - // buffer. - return buffer(); - } - - protected: - using Base::m_size; - - private: - using Base::m_buffer; - using Base::m_capacity; -}; - -template -class VectorBuffer : protected VectorBufferBase { - WTF_MAKE_NONCOPYABLE(VectorBuffer); - - private: - typedef VectorBufferBase Base; - - public: - VectorBuffer() : Base(inlineBuffer(), inlineCapacity) {} - - VectorBuffer(size_t capacity) : Base(inlineBuffer(), inlineCapacity) { - if (capacity > inlineCapacity) - Base::allocateBuffer(capacity); - } - - void destruct() { - deallocateBuffer(m_buffer); - m_buffer = 0; - } - - NEVER_INLINE void reallyDeallocateBuffer(T* bufferToDeallocate) { - Allocator::backingFree(bufferToDeallocate); - } - - void deallocateBuffer(T* bufferToDeallocate) { - if (UNLIKELY(bufferToDeallocate != inlineBuffer())) - reallyDeallocateBuffer(bufferToDeallocate); - } - - void resetBufferPointer() { - m_buffer = inlineBuffer(); - m_capacity = inlineCapacity; - } - - void allocateBuffer(size_t newCapacity) { - // FIXME: This should ASSERT(!m_buffer) to catch misuse/leaks. - if (newCapacity > inlineCapacity) - Base::allocateBuffer(newCapacity); - else - resetBufferPointer(); - } - - size_t allocationSize(size_t capacity) const { - if (capacity <= inlineCapacity) - return m_inlineBufferSize; - return Base::allocationSize(capacity); - } - - void swapVectorBuffer(VectorBuffer& other) { - typedef VectorTypeOperations TypeOperations; - - if (buffer() == inlineBuffer() && other.buffer() == other.inlineBuffer()) { - ASSERT(m_capacity == other.m_capacity); - if (m_size > other.m_size) { - TypeOperations::swap(inlineBuffer(), inlineBuffer() + other.m_size, - other.inlineBuffer()); - TypeOperations::move(inlineBuffer() + other.m_size, - inlineBuffer() + m_size, - other.inlineBuffer() + other.m_size); - } else { - TypeOperations::swap(inlineBuffer(), inlineBuffer() + m_size, - other.inlineBuffer()); - TypeOperations::move(other.inlineBuffer() + m_size, - other.inlineBuffer() + other.m_size, - inlineBuffer() + m_size); - } - } else if (buffer() == inlineBuffer()) { - m_buffer = other.m_buffer; - other.m_buffer = other.inlineBuffer(); - TypeOperations::move(inlineBuffer(), inlineBuffer() + m_size, - other.inlineBuffer()); - std::swap(m_capacity, other.m_capacity); - } else if (other.buffer() == other.inlineBuffer()) { - other.m_buffer = m_buffer; - m_buffer = inlineBuffer(); - TypeOperations::move(other.inlineBuffer(), - other.inlineBuffer() + other.m_size, inlineBuffer()); - std::swap(m_capacity, other.m_capacity); - } else { - std::swap(m_buffer, other.m_buffer); - std::swap(m_capacity, other.m_capacity); - } - } - - using Base::buffer; - using Base::capacity; - - bool hasOutOfLineBuffer() const { - return buffer() && buffer() != inlineBuffer(); - } - - protected: - using Base::m_size; - - private: - using Base::m_buffer; - using Base::m_capacity; - - static const size_t m_inlineBufferSize = inlineCapacity * sizeof(T); - T* inlineBuffer() { return reinterpret_cast_ptr(m_inlineBuffer.buffer); } - const T* inlineBuffer() const { - return reinterpret_cast_ptr(m_inlineBuffer.buffer); - } - - AlignedBuffer m_inlineBuffer; - template - friend class Deque; -}; - -template -class Vector; - -// VectorDestructorBase defines the destructor of a vector. This base is used in -// order to completely avoid creating a destructor for a vector that does not -// need to be destructed. By doing so, the clang compiler will have correct -// information about whether or not a vector has a trivial destructor and we use -// that in a compiler plugin to ensure the correctness of non-finalized -// garbage-collected classes and the use of VectorTraits::needsDestruction. - -// All non-GC managed vectors need a destructor. This destructor will simply -// call finalize on the actual vector type. -template -class VectorDestructorBase { - public: - ~VectorDestructorBase() { static_cast(this)->finalize(); } -}; - -// Heap-allocated vectors with no inlineCapacity never need a destructor. -template -class VectorDestructorBase {}; - -// Heap-allocator vectors with inlineCapacity need a destructor if the inline -// elements do. The use of VectorTraits::needsDestruction is delayed -// until we know that inlineCapacity is non-zero to allow classes that -// recursively refer to themselves in vector members. If inlineCapacity is -// non-zero doing so would have undefined meaning, so in this case we can use -// HeapVectorWithInlineCapacityDestructorBase to define a destructor depending -// on the value of VectorTraits::needsDestruction. -template -class HeapVectorWithInlineCapacityDestructorBase; - -template -class HeapVectorWithInlineCapacityDestructorBase { - public: - ~HeapVectorWithInlineCapacityDestructorBase() { - static_cast(this)->finalize(); - } -}; - -template -class HeapVectorWithInlineCapacityDestructorBase {}; - -template -class VectorDestructorBase - : public HeapVectorWithInlineCapacityDestructorBase< - Derived, - VectorTraits::needsDestruction> {}; - -template -class Vector : private VectorBuffer, - public VectorDestructorBase, - T, - (inlineCapacity > 0), - Allocator::isGarbageCollected> { - WTF_USE_ALLOCATOR(Vector, Allocator); - - private: - typedef VectorBuffer Base; - typedef VectorTypeOperations TypeOperations; - - public: - typedef T ValueType; - - typedef T* iterator; - typedef const T* const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_iterator const_reverse_iterator; - - Vector() { - // Unused slots are initialized to zero so that the visitor and the - // finalizer can visit them safely. canInitializeWithMemset tells us - // that the class does not expect matching constructor and - // destructor calls as long as the memory is zeroed. - COMPILE_ASSERT(!Allocator::isGarbageCollected || - !VectorTraits::needsDestruction || - VectorTraits::canInitializeWithMemset, - ClassHasProblemsWithFinalizersCalledOnClearedMemory); - COMPILE_ASSERT(!WTF::IsPolymorphic::value || - !VectorTraits::canInitializeWithMemset, - CantInitializeWithMemsetIfThereIsAVtable); - m_size = 0; - } - - explicit Vector(size_t size) : Base(size) { - // Unused slots are initialized to zero so that the visitor and the - // finalizer can visit them safely. canInitializeWithMemset tells us - // that the class does not expect matching constructor and - // destructor calls as long as the memory is zeroed. - COMPILE_ASSERT(!Allocator::isGarbageCollected || - !VectorTraits::needsDestruction || - VectorTraits::canInitializeWithMemset, - ClassHasProblemsWithFinalizersCalledOnClearedMemory); - m_size = size; - TypeOperations::initialize(begin(), end()); - } - - // Off-GC-heap vectors: Destructor should be called. - // On-GC-heap vectors: Destructor should be called for inline buffers - // (if any) but destructor shouldn't be called for vector backing since - // it is managed by the traced GC heap. - void finalize() { - if (!inlineCapacity) { - if (LIKELY(!Base::buffer())) - return; - } - if (LIKELY(m_size) && - !(Allocator::isGarbageCollected && this->hasOutOfLineBuffer())) { - TypeOperations::destruct(begin(), end()); - m_size = 0; // Partial protection against use-after-free. - } - - Base::destruct(); - } - - Vector(const Vector&); - template - explicit Vector(const Vector&); - - Vector& operator=(const Vector&); - template - Vector& operator=(const Vector&); - - Vector(Vector&&); - Vector& operator=(Vector&&); - - size_t size() const { return m_size; } - size_t capacity() const { return Base::capacity(); } - bool isEmpty() const { return !size(); } - - T& at(size_t i) { - RELEASE_ASSERT(i < size()); - return Base::buffer()[i]; - } - const T& at(size_t i) const { - RELEASE_ASSERT(i < size()); - return Base::buffer()[i]; - } - - T& operator[](size_t i) { return at(i); } - const T& operator[](size_t i) const { return at(i); } - - T* data() { return Base::buffer(); } - const T* data() const { return Base::buffer(); } - - iterator begin() { return data(); } - iterator end() { return begin() + m_size; } - const_iterator begin() const { return data(); } - const_iterator end() const { return begin() + m_size; } - - reverse_iterator rbegin() { return reverse_iterator(end()); } - reverse_iterator rend() { return reverse_iterator(begin()); } - const_reverse_iterator rbegin() const { - return const_reverse_iterator(end()); - } - const_reverse_iterator rend() const { - return const_reverse_iterator(begin()); - } - - T& first() { return at(0); } - const T& first() const { return at(0); } - T& last() { return at(size() - 1); } - const T& last() const { return at(size() - 1); } - - template - bool contains(const U&) const; - template - size_t find(const U&) const; - template - size_t reverseFind(const U&) const; - - void shrink(size_t size); - void grow(size_t size); - void resize(size_t size); - void reserveCapacity(size_t newCapacity); - void reserveInitialCapacity(size_t initialCapacity); - void shrinkToFit() { shrinkCapacity(size()); } - void shrinkToReasonableCapacity() { - if (size() * 2 < capacity()) - shrinkCapacity(size() + size() / 4 + 1); - } - - void clear() { shrinkCapacity(0); } - - template - void append(const U*, size_t); - template - void append(const U&); - template - void uncheckedAppend(const U& val); - template - void appendVector(const Vector&); - - template - void insert(size_t position, const U*, size_t); - template - void insert(size_t position, const U&); - template - void insert(size_t position, const Vector&); - - template - void prepend(const U*, size_t); - template - void prepend(const U&); - template - void prepend(const Vector&); - - void remove(size_t position); - void remove(size_t position, size_t length); - - void removeLast() { - ASSERT(!isEmpty()); - shrink(size() - 1); - } - - Vector(size_t size, const T& val) : Base(size) { - m_size = size; - TypeOperations::uninitializedFill(begin(), end(), val); - } - - void fill(const T&, size_t); - void fill(const T& val) { fill(val, size()); } - - template - void appendRange(Iterator start, Iterator end); - - void swap(Vector& other) { - Base::swapVectorBuffer(other); - std::swap(m_size, other.m_size); - } - - void reverse(); - - private: - void expandCapacity(size_t newMinCapacity); - const T* expandCapacity(size_t newMinCapacity, const T*); - template - U* expandCapacity(size_t newMinCapacity, U*); - void shrinkCapacity(size_t newCapacity); - template - void appendSlowCase(const U&); - - using Base::allocateBuffer; - using Base::allocationSize; - using Base::buffer; - using Base::capacity; - using Base::m_size; - using Base::swapVectorBuffer; -}; - -template -Vector::Vector(const Vector& other) - : Base(other.capacity()) { - m_size = other.size(); - TypeOperations::uninitializedCopy(other.begin(), other.end(), begin()); -} - -template -template -Vector::Vector( - const Vector& other) - : Base(other.capacity()) { - m_size = other.size(); - TypeOperations::uninitializedCopy(other.begin(), other.end(), begin()); -} - -template -Vector& Vector:: -operator=(const Vector& other) { - if (UNLIKELY(&other == this)) - return *this; - - if (size() > other.size()) - shrink(other.size()); - else if (other.size() > capacity()) { - clear(); - reserveCapacity(other.size()); - ASSERT(begin()); - } - - std::copy(other.begin(), other.begin() + size(), begin()); - TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end()); - m_size = other.size(); - - return *this; -} - -inline bool typelessPointersAreEqual(const void* a, const void* b) { - return a == b; -} - -template -template -Vector& Vector:: -operator=(const Vector& other) { - // If the inline capacities match, we should call the more specific - // template. If the inline capacities don't match, the two objects - // shouldn't be allocated the same address. - ASSERT(!typelessPointersAreEqual(&other, this)); - - if (size() > other.size()) - shrink(other.size()); - else if (other.size() > capacity()) { - clear(); - reserveCapacity(other.size()); - ASSERT(begin()); - } - - std::copy(other.begin(), other.begin() + size(), begin()); - TypeOperations::uninitializedCopy(other.begin() + size(), other.end(), end()); - m_size = other.size(); - - return *this; -} - -template -Vector::Vector( - Vector&& other) { - m_size = 0; - // It's a little weird to implement a move constructor using swap but this way - // we don't have to add a move constructor to VectorBuffer. - swap(other); -} - -template -Vector& Vector:: -operator=(Vector&& other) { - swap(other); - return *this; -} - -template -template -bool Vector::contains(const U& value) const { - return find(value) != kNotFound; -} - -template -template -size_t Vector::find(const U& value) const { - const T* b = begin(); - const T* e = end(); - for (const T* iter = b; iter < e; ++iter) { - if (*iter == value) - return iter - b; - } - return kNotFound; -} - -template -template -size_t Vector::reverseFind(const U& value) const { - const T* b = begin(); - const T* iter = end(); - while (iter > b) { - --iter; - if (*iter == value) - return iter - b; - } - return kNotFound; -} - -template -void Vector::fill(const T& val, size_t newSize) { - if (size() > newSize) - shrink(newSize); - else if (newSize > capacity()) { - clear(); - reserveCapacity(newSize); - ASSERT(begin()); - } - - std::fill(begin(), end(), val); - TypeOperations::uninitializedFill(end(), begin() + newSize, val); - m_size = newSize; -} - -template -template -void Vector::appendRange(Iterator start, - Iterator end) { - for (Iterator it = start; it != end; ++it) - append(*it); -} - -template -void Vector::expandCapacity( - size_t newMinCapacity) { - size_t oldCapacity = capacity(); - size_t expandedCapacity = oldCapacity; - // We use a more aggressive expansion strategy for Vectors with inline - // storage. This is because they are more likely to be on the stack, so the - // risk of heap bloat is minimized. Furthermore, exceeding the inline capacity - // limit is not supposed to happen in the common case and may indicate a - // pathological condition or microbenchmark. - if (inlineCapacity) { - expandedCapacity *= 2; - // Check for integer overflow, which could happen in the 32-bit build. - RELEASE_ASSERT(expandedCapacity > oldCapacity); - } else { - // This cannot integer overflow. - // On 64-bit, the "expanded" integer is 32-bit, and any encroachment above - // 2^32 will fail allocation in allocateBuffer(). On 32-bit, there's not - // enough address space to hold the old and new buffers. In addition, our - // underlying allocator is supposed to always fail on > (2^31 - 1) - // allocations. - expandedCapacity += (expandedCapacity / 4) + 1; - } - reserveCapacity(std::max( - newMinCapacity, - std::max(static_cast(kInitialVectorSize), expandedCapacity))); -} - -template -const T* Vector::expandCapacity( - size_t newMinCapacity, - const T* ptr) { - if (ptr < begin() || ptr >= end()) { - expandCapacity(newMinCapacity); - return ptr; - } - size_t index = ptr - begin(); - expandCapacity(newMinCapacity); - return begin() + index; -} - -template -template -inline U* Vector::expandCapacity( - size_t newMinCapacity, - U* ptr) { - expandCapacity(newMinCapacity); - return ptr; -} - -template -inline void Vector::resize(size_t size) { - if (size <= m_size) - TypeOperations::destruct(begin() + size, end()); - else { - if (size > capacity()) - expandCapacity(size); - TypeOperations::initialize(end(), begin() + size); - } - - m_size = size; -} - -template -void Vector::shrink(size_t size) { - ASSERT(size <= m_size); - TypeOperations::destruct(begin() + size, end()); - m_size = size; -} - -template -void Vector::grow(size_t size) { - ASSERT(size >= m_size); - if (size > capacity()) - expandCapacity(size); - TypeOperations::initialize(end(), begin() + size); - m_size = size; -} - -template -void Vector::reserveCapacity(size_t newCapacity) { - if (UNLIKELY(newCapacity <= capacity())) - return; - T* oldBuffer = begin(); - T* oldEnd = end(); - Base::allocateBuffer(newCapacity); - TypeOperations::move(oldBuffer, oldEnd, begin()); - Base::deallocateBuffer(oldBuffer); -} - -template -inline void Vector::reserveInitialCapacity( - size_t initialCapacity) { - ASSERT(!m_size); - ASSERT(capacity() == inlineCapacity); - if (initialCapacity > inlineCapacity) - Base::allocateBuffer(initialCapacity); -} - -template -void Vector::shrinkCapacity(size_t newCapacity) { - if (newCapacity >= capacity()) - return; - - if (newCapacity < size()) - shrink(newCapacity); - - T* oldBuffer = begin(); - if (newCapacity > 0) { - // Optimization: if we're downsizing inside the same allocator bucket, we - // can exit with no additional work. - if (Base::allocationSize(capacity()) == Base::allocationSize(newCapacity)) - return; - - T* oldEnd = end(); - Base::allocateBuffer(newCapacity); - if (begin() != oldBuffer) - TypeOperations::move(oldBuffer, oldEnd, begin()); - } else { - Base::resetBufferPointer(); - } - - Base::deallocateBuffer(oldBuffer); -} - -// Templatizing these is better than just letting the conversion happen -// implicitly, because for instance it allows a PassRefPtr to be appended to a -// RefPtr vector without refcount thrash. - -template -template -void Vector::append(const U* data, - size_t dataSize) { - ASSERT(Allocator::isAllocationAllowed()); - size_t newSize = m_size + dataSize; - if (newSize > capacity()) { - data = expandCapacity(newSize, data); - ASSERT(begin()); - } - RELEASE_ASSERT(newSize >= m_size); - T* dest = end(); - VectorCopier::canCopyWithMemcpy, T>::uninitializedCopy( - data, &data[dataSize], dest); - m_size = newSize; -} - -template -template -ALWAYS_INLINE void Vector::append(const U& val) { - ASSERT(Allocator::isAllocationAllowed()); - if (LIKELY(size() != capacity())) { - new (NotNull, end()) T(val); - ++m_size; - return; - } - - appendSlowCase(val); -} - -template -template -NEVER_INLINE void Vector::appendSlowCase( - const U& val) { - ASSERT(size() == capacity()); - - const U* ptr = &val; - ptr = expandCapacity(size() + 1, ptr); - ASSERT(begin()); - - new (NotNull, end()) T(*ptr); - ++m_size; -} - -// This version of append saves a branch in the case where you know that the -// vector's capacity is large enough for the append to succeed. - -template -template -ALWAYS_INLINE void Vector::uncheckedAppend( - const U& val) { - ASSERT(size() < capacity()); - const U* ptr = &val; - new (NotNull, end()) T(*ptr); - ++m_size; -} - -template -template -inline void Vector::appendVector( - const Vector& val) { - append(val.begin(), val.size()); -} - -template -template -void Vector::insert(size_t position, - const U* data, - size_t dataSize) { - ASSERT(Allocator::isAllocationAllowed()); - RELEASE_ASSERT(position <= size()); - size_t newSize = m_size + dataSize; - if (newSize > capacity()) { - data = expandCapacity(newSize, data); - ASSERT(begin()); - } - RELEASE_ASSERT(newSize >= m_size); - T* spot = begin() + position; - TypeOperations::moveOverlapping(spot, end(), spot + dataSize); - VectorCopier::canCopyWithMemcpy, T>::uninitializedCopy( - data, &data[dataSize], spot); - m_size = newSize; -} - -template -template -inline void Vector::insert(size_t position, - const U& val) { - ASSERT(Allocator::isAllocationAllowed()); - RELEASE_ASSERT(position <= size()); - const U* data = &val; - if (size() == capacity()) { - data = expandCapacity(size() + 1, data); - ASSERT(begin()); - } - T* spot = begin() + position; - TypeOperations::moveOverlapping(spot, end(), spot + 1); - new (NotNull, spot) T(*data); - ++m_size; -} - -template -template -inline void Vector::insert( - size_t position, - const Vector& val) { - insert(position, val.begin(), val.size()); -} - -template -template -void Vector::prepend(const U* data, - size_t dataSize) { - insert(0, data, dataSize); -} - -template -template -inline void Vector::prepend(const U& val) { - insert(0, val); -} - -template -template -inline void Vector::prepend( - const Vector& val) { - insert(0, val.begin(), val.size()); -} - -template -inline void Vector::remove(size_t position) { - RELEASE_ASSERT(position < size()); - T* spot = begin() + position; - spot->~T(); - TypeOperations::moveOverlapping(spot + 1, end(), spot); - --m_size; -} - -template -inline void Vector::remove(size_t position, - size_t length) { - ASSERT_WITH_SECURITY_IMPLICATION(position <= size()); - RELEASE_ASSERT(position + length <= size()); - T* beginSpot = begin() + position; - T* endSpot = beginSpot + length; - TypeOperations::destruct(beginSpot, endSpot); - TypeOperations::moveOverlapping(endSpot, end(), beginSpot); - m_size -= length; -} - -template -inline void Vector::reverse() { - for (size_t i = 0; i < m_size / 2; ++i) - std::swap(at(i), at(m_size - 1 - i)); -} - -template -void deleteAllValues(const Vector& collection) { - typedef - typename Vector::const_iterator iterator; - iterator end = collection.end(); - for (iterator it = collection.begin(); it != end; ++it) - delete *it; -} - -template -inline void swap(Vector& a, - Vector& b) { - a.swap(b); -} - -template -bool operator==(const Vector& a, - const Vector& b) { - if (a.size() != b.size()) - return false; - - return VectorTypeOperations::compare(a.data(), b.data(), a.size()); -} - -template -inline bool operator!=(const Vector& a, - const Vector& b) { - return !(a == b); -} - -} // namespace WTF - -using WTF::Vector; - -#endif // SKY_ENGINE_WTF_VECTOR_H_ diff --git a/sky/engine/wtf/VectorTest.cpp b/sky/engine/wtf/VectorTest.cpp deleted file mode 100644 index 2b88ff2c51f2a..0000000000000 --- a/sky/engine/wtf/VectorTest.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace { - -TEST(VectorTest, Basic) { - Vector intVector; - EXPECT_TRUE(intVector.isEmpty()); - EXPECT_EQ(0ul, intVector.size()); - EXPECT_EQ(0ul, intVector.capacity()); -} - -TEST(VectorTest, Reverse) { - Vector intVector; - intVector.append(10); - intVector.append(11); - intVector.append(12); - intVector.append(13); - intVector.reverse(); - - EXPECT_EQ(13, intVector[0]); - EXPECT_EQ(12, intVector[1]); - EXPECT_EQ(11, intVector[2]); - EXPECT_EQ(10, intVector[3]); - - intVector.append(9); - intVector.reverse(); - - EXPECT_EQ(9, intVector[0]); - EXPECT_EQ(10, intVector[1]); - EXPECT_EQ(11, intVector[2]); - EXPECT_EQ(12, intVector[3]); - EXPECT_EQ(13, intVector[4]); -} - -TEST(VectorTest, Iterator) { - Vector intVector; - intVector.append(10); - intVector.append(11); - intVector.append(12); - intVector.append(13); - - Vector::iterator it = intVector.begin(); - Vector::iterator end = intVector.end(); - EXPECT_TRUE(end != it); - - EXPECT_EQ(10, *it); - ++it; - EXPECT_EQ(11, *it); - ++it; - EXPECT_EQ(12, *it); - ++it; - EXPECT_EQ(13, *it); - ++it; - - EXPECT_TRUE(end == it); -} - -TEST(VectorTest, ReverseIterator) { - Vector intVector; - intVector.append(10); - intVector.append(11); - intVector.append(12); - intVector.append(13); - - Vector::reverse_iterator it = intVector.rbegin(); - Vector::reverse_iterator end = intVector.rend(); - EXPECT_TRUE(end != it); - - EXPECT_EQ(13, *it); - ++it; - EXPECT_EQ(12, *it); - ++it; - EXPECT_EQ(11, *it); - ++it; - EXPECT_EQ(10, *it); - ++it; - - EXPECT_TRUE(end == it); -} - -class DestructCounter { - public: - explicit DestructCounter(int i, int* destructNumber) - : m_i(i), m_destructNumber(destructNumber) {} - - ~DestructCounter() { ++(*m_destructNumber); } - int get() const { return m_i; } - - private: - int m_i; - int* m_destructNumber; -}; - -typedef WTF::Vector> OwnPtrVector; - -TEST(VectorTest, OwnPtr) { - int destructNumber = 0; - OwnPtrVector vector; - vector.append(adoptPtr(new DestructCounter(0, &destructNumber))); - vector.append(adoptPtr(new DestructCounter(1, &destructNumber))); - EXPECT_EQ(2u, vector.size()); - - OwnPtr& counter0 = vector.first(); - ASSERT_EQ(0, counter0->get()); - int counter1 = vector.last()->get(); - ASSERT_EQ(1, counter1); - ASSERT_EQ(0, destructNumber); - - size_t index = 0; - for (OwnPtrVector::iterator iter = vector.begin(); iter != vector.end(); - ++iter) { - OwnPtr* refCounter = iter; - EXPECT_EQ(index, static_cast(refCounter->get()->get())); - EXPECT_EQ(index, static_cast((*refCounter)->get())); - index++; - } - EXPECT_EQ(0, destructNumber); - - for (index = 0; index < vector.size(); index++) { - OwnPtr& refCounter = vector[index]; - EXPECT_EQ(index, static_cast(refCounter->get())); - index++; - } - EXPECT_EQ(0, destructNumber); - - EXPECT_EQ(0, vector[0]->get()); - EXPECT_EQ(1, vector[1]->get()); - vector.remove(0); - EXPECT_EQ(1, vector[0]->get()); - EXPECT_EQ(1u, vector.size()); - EXPECT_EQ(1, destructNumber); - - OwnPtr ownCounter1 = vector[0].release(); - vector.remove(0); - ASSERT_EQ(counter1, ownCounter1->get()); - ASSERT_EQ(0u, vector.size()); - ASSERT_EQ(1, destructNumber); - - ownCounter1.clear(); - EXPECT_EQ(2, destructNumber); - - size_t count = 1025; - destructNumber = 0; - for (size_t i = 0; i < count; i++) - vector.prepend(adoptPtr(new DestructCounter(i, &destructNumber))); - - // Vector relocation must not destruct OwnPtr element. - EXPECT_EQ(0, destructNumber); - EXPECT_EQ(count, vector.size()); - - OwnPtrVector copyVector; - vector.swap(copyVector); - EXPECT_EQ(0, destructNumber); - EXPECT_EQ(count, copyVector.size()); - EXPECT_EQ(0u, vector.size()); - - copyVector.clear(); - EXPECT_EQ(count, static_cast(destructNumber)); -} - -// WrappedInt class will fail if it was memmoved or memcpyed. -static HashSet constructedWrappedInts; -class WrappedInt { - public: - WrappedInt(int i = 0) : m_originalThisPtr(this), m_i(i) { - constructedWrappedInts.add(this); - } - - WrappedInt(const WrappedInt& other) - : m_originalThisPtr(this), m_i(other.m_i) { - constructedWrappedInts.add(this); - } - - WrappedInt& operator=(const WrappedInt& other) { - m_i = other.m_i; - return *this; - } - - ~WrappedInt() { - EXPECT_EQ(m_originalThisPtr, this); - EXPECT_TRUE(constructedWrappedInts.contains(this)); - constructedWrappedInts.remove(this); - } - - int get() const { return m_i; } - - private: - void* m_originalThisPtr; - int m_i; -}; - -TEST(VectorTest, SwapWithInlineCapacity) { - const size_t inlineCapacity = 2; - Vector vectorA; - vectorA.append(WrappedInt(1)); - Vector vectorB; - vectorB.append(WrappedInt(2)); - - EXPECT_EQ(vectorA.size(), vectorB.size()); - vectorA.swap(vectorB); - - EXPECT_EQ(1u, vectorA.size()); - EXPECT_EQ(2, vectorA.at(0).get()); - EXPECT_EQ(1u, vectorB.size()); - EXPECT_EQ(1, vectorB.at(0).get()); - - vectorA.append(WrappedInt(3)); - - EXPECT_GT(vectorA.size(), vectorB.size()); - vectorA.swap(vectorB); - - EXPECT_EQ(1u, vectorA.size()); - EXPECT_EQ(1, vectorA.at(0).get()); - EXPECT_EQ(2u, vectorB.size()); - EXPECT_EQ(2, vectorB.at(0).get()); - EXPECT_EQ(3, vectorB.at(1).get()); - - EXPECT_LT(vectorA.size(), vectorB.size()); - vectorA.swap(vectorB); - - EXPECT_EQ(2u, vectorA.size()); - EXPECT_EQ(2, vectorA.at(0).get()); - EXPECT_EQ(3, vectorA.at(1).get()); - EXPECT_EQ(1u, vectorB.size()); - EXPECT_EQ(1, vectorB.at(0).get()); - - vectorA.append(WrappedInt(4)); - EXPECT_GT(vectorA.size(), inlineCapacity); - vectorA.swap(vectorB); - - EXPECT_EQ(1u, vectorA.size()); - EXPECT_EQ(1, vectorA.at(0).get()); - EXPECT_EQ(3u, vectorB.size()); - EXPECT_EQ(2, vectorB.at(0).get()); - EXPECT_EQ(3, vectorB.at(1).get()); - EXPECT_EQ(4, vectorB.at(2).get()); - - vectorB.swap(vectorA); -} - -class Comparable {}; -bool operator==(const Comparable& a, const Comparable& b) { - return true; -} - -template -void compare() { - EXPECT_TRUE(Vector() == Vector()); - EXPECT_FALSE(Vector(1) == Vector(0)); - EXPECT_FALSE(Vector() == Vector(1)); - EXPECT_TRUE(Vector(1) == Vector(1)); -} - -TEST(VectorTest, Compare) { - compare(); - compare(); - compare(); -} -} // namespace diff --git a/sky/engine/wtf/VectorTraits.h b/sky/engine/wtf/VectorTraits.h deleted file mode 100644 index f1d5fb88eabdf..0000000000000 --- a/sky/engine/wtf/VectorTraits.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_VECTORTRAITS_H_ -#define SKY_ENGINE_WTF_VECTORTRAITS_H_ - -#include -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/TypeTraits.h" - -using std::pair; - -namespace WTF { - -class AtomicString; - -template -struct VectorTraitsBase { - static const bool needsDestruction = !IsPod::value; - static const bool canInitializeWithMemset = IsPod::value; - static const bool canMoveWithMemcpy = IsPod::value; - static const bool canCopyWithMemcpy = IsPod::value; - static const bool canFillWithMemset = - IsPod::value && (sizeof(T) == sizeof(char)); - static const bool canCompareWithMemcmp = IsPod::value; - static const WeakHandlingFlag weakHandlingFlag = - NoWeakHandlingInCollections; // We don't support weak handling in - // vectors. -}; - -template -struct VectorTraits : VectorTraitsBase {}; - -// Classes marked with SimpleVectorTraits will use memmov, memcpy, memcmp -// instead of constructors, copy operators, etc for initialization, move -// and comparison. -template -struct SimpleClassVectorTraits : VectorTraitsBase { - static const bool canInitializeWithMemset = true; - static const bool canMoveWithMemcpy = true; - static const bool canCompareWithMemcmp = true; -}; - -// We know OwnPtr and RefPtr are simple enough that initializing to 0 and -// moving with memcpy (and then not destructing the original) will totally -// work. -template -struct VectorTraits> : SimpleClassVectorTraits> {}; - -template -struct VectorTraits> : SimpleClassVectorTraits> {}; - -template -struct VectorTraits> { - typedef VectorTraits FirstTraits; - typedef VectorTraits SecondTraits; - - static const bool needsDestruction = - FirstTraits::needsDestruction || SecondTraits::needsDestruction; - static const bool canInitializeWithMemset = - FirstTraits::canInitializeWithMemset && - SecondTraits::canInitializeWithMemset; - static const bool canMoveWithMemcpy = - FirstTraits::canMoveWithMemcpy && SecondTraits::canMoveWithMemcpy; - static const bool canCopyWithMemcpy = - FirstTraits::canCopyWithMemcpy && SecondTraits::canCopyWithMemcpy; - static const bool canFillWithMemset = false; - static const bool canCompareWithMemcmp = - FirstTraits::canCompareWithMemcmp && SecondTraits::canCompareWithMemcmp; - static const WeakHandlingFlag weakHandlingFlag = - NoWeakHandlingInCollections; // We don't support weak handling in - // vectors. -}; - -} // namespace WTF - -#define WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(ClassName) \ - namespace WTF { \ - template <> \ - struct VectorTraits : SimpleClassVectorTraits {}; \ - } - -#define WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(ClassName) \ - namespace WTF { \ - template <> \ - struct VectorTraits : VectorTraitsBase { \ - static const bool canInitializeWithMemset = true; \ - static const bool canMoveWithMemcpy = true; \ - }; \ - } - -#define WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(ClassName) \ - namespace WTF { \ - template <> \ - struct VectorTraits : VectorTraitsBase { \ - static const bool canInitializeWithMemset = true; \ - }; \ - } - -using WTF::SimpleClassVectorTraits; -using WTF::VectorTraits; - -#endif // SKY_ENGINE_WTF_VECTORTRAITS_H_ diff --git a/sky/engine/wtf/WTF.cpp b/sky/engine/wtf/WTF.cpp deleted file mode 100644 index a61a70b1c4565..0000000000000 --- a/sky/engine/wtf/WTF.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/WTF.h" - -#include "flutter/sky/engine/wtf/DefaultAllocator.h" -#include "flutter/sky/engine/wtf/FastMalloc.h" - -namespace WTF { - -extern void initializeThreading(); - -bool s_initialized; -bool s_shutdown; -bool Partitions::s_initialized; -PartitionAllocatorGeneric Partitions::m_bufferAllocator; - -void initialize() { - // WTF, and Blink in general, cannot handle being re-initialized, even if - // shutdown first. Make that explicit here. - ASSERT(!s_initialized); - ASSERT(!s_shutdown); - s_initialized = true; - Partitions::initialize(); - initializeThreading(); -} - -void shutdown() { - ASSERT(s_initialized); - ASSERT(!s_shutdown); - s_shutdown = true; - Partitions::shutdown(); -} - -bool isShutdown() { - return s_shutdown; -} - -void Partitions::initialize() { - static int lock = 0; - // Guard against two threads hitting here in parallel. - spinLockLock(&lock); - if (!s_initialized) { - m_bufferAllocator.init(); - s_initialized = true; - } - spinLockUnlock(&lock); -} - -void Partitions::shutdown() { - fastMallocShutdown(); - m_bufferAllocator.shutdown(); -} - -} // namespace WTF diff --git a/sky/engine/wtf/WTF.h b/sky/engine/wtf/WTF.h deleted file mode 100644 index 9cdb75e93233f..0000000000000 --- a/sky/engine/wtf/WTF.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_WTF_H_ -#define SKY_ENGINE_WTF_WTF_H_ - -#include "flutter/sky/engine/wtf/Compiler.h" -#include "flutter/sky/engine/wtf/PartitionAlloc.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -// This function must be called exactly once from the main thread before using -// anything else in WTF. -WTF_EXPORT void initialize(); -WTF_EXPORT void shutdown(); -WTF_EXPORT bool isShutdown(); - -class WTF_EXPORT Partitions { - public: - static void initialize(); - static void shutdown(); - static ALWAYS_INLINE PartitionRootGeneric* getBufferPartition() { - if (UNLIKELY(!s_initialized)) - initialize(); - return m_bufferAllocator.root(); - } - - private: - static bool s_initialized; - static PartitionAllocatorGeneric m_bufferAllocator; -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_WTF_H_ diff --git a/sky/engine/wtf/WTFExport.h b/sky/engine/wtf/WTFExport.h deleted file mode 100644 index 3ec1c301d86ae..0000000000000 --- a/sky/engine/wtf/WTFExport.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_WTFEXPORT_H_ -#define SKY_ENGINE_WTF_WTFEXPORT_H_ - -#define WTF_EXPORT - -#endif // SKY_ENGINE_WTF_WTFEXPORT_H_ diff --git a/sky/engine/wtf/WTFThreadData.cpp b/sky/engine/wtf/WTFThreadData.cpp deleted file mode 100644 index df0c1c81216c1..0000000000000 --- a/sky/engine/wtf/WTFThreadData.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "flutter/sky/engine/wtf/WTFThreadData.h" - -#include "flutter/sky/engine/wtf/text/TextCodecICU.h" - -namespace WTF { - -ThreadSpecific* WTFThreadData::staticData; - -WTFThreadData::WTFThreadData() - : m_atomicStringTable(0), - m_atomicStringTableDestructor(0), - m_cachedConverterICU(adoptPtr(new ICUConverterWrapper)) {} - -WTFThreadData::~WTFThreadData() { - if (m_atomicStringTableDestructor) - m_atomicStringTableDestructor(m_atomicStringTable); -} - -} // namespace WTF diff --git a/sky/engine/wtf/WTFThreadData.h b/sky/engine/wtf/WTFThreadData.h deleted file mode 100644 index dfd2f07095be9..0000000000000 --- a/sky/engine/wtf/WTFThreadData.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef SKY_ENGINE_WTF_WTFTHREADDATA_H_ -#define SKY_ENGINE_WTF_WTFTHREADDATA_H_ - -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/ThreadSpecific.h" -#include "flutter/sky/engine/wtf/Threading.h" -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" - -namespace WTF { - -class AtomicStringTable; -struct ICUConverterWrapper; - -typedef void (*AtomicStringTableDestructor)(AtomicStringTable*); - -class WTF_EXPORT WTFThreadData { - WTF_MAKE_NONCOPYABLE(WTFThreadData); - - public: - WTFThreadData(); - ~WTFThreadData(); - - AtomicStringTable* atomicStringTable() { return m_atomicStringTable; } - - ICUConverterWrapper& cachedConverterICU() { return *m_cachedConverterICU; } - - private: - AtomicStringTable* m_atomicStringTable; - AtomicStringTableDestructor m_atomicStringTableDestructor; - OwnPtr m_cachedConverterICU; - - static ThreadSpecific* staticData; - friend WTFThreadData& wtfThreadData(); - friend class AtomicStringTable; -}; - -inline WTFThreadData& wtfThreadData() { - // WRT WebCore: - // WTFThreadData is used on main thread before it could possibly be used - // on secondary ones, so there is no need for synchronization here. - // WRT JavaScriptCore: - // wtfThreadData() is initially called from initializeThreading(), ensuring - // this is initially called in a pthread_once locked context. - if (!WTFThreadData::staticData) - WTFThreadData::staticData = new ThreadSpecific; - return **WTFThreadData::staticData; -} - -} // namespace WTF - -using WTF::WTFThreadData; -using WTF::wtfThreadData; - -#endif // SKY_ENGINE_WTF_WTFTHREADDATA_H_ diff --git a/sky/engine/wtf/allocator/PartitionAllocator.cpp b/sky/engine/wtf/allocator/PartitionAllocator.cpp deleted file mode 100644 index 86d1cca62f538..0000000000000 --- a/sky/engine/wtf/allocator/PartitionAllocator.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2014 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. - -#include "flutter/sky/engine/wtf/allocator/PartitionAllocator.h" - -#include "base/allocator/partition_allocator/partition_alloc.h" -#include "flutter/sky/engine/wtf/allocator/Partitions.h" - -namespace WTF { - -void* PartitionAllocator::AllocateBacking(size_t size, const char* type_name) { - return Partitions::BufferMalloc(size, type_name); -} - -void PartitionAllocator::FreeVectorBacking(void* address) { - Partitions::BufferFree(address); -} - -void PartitionAllocator::FreeHashTableBacking(void* address) { - Partitions::BufferFree(address); -} - -template <> -char* PartitionAllocator::AllocateVectorBacking(size_t size) { - return reinterpret_cast( - AllocateBacking(size, "PartitionAllocator::allocateVectorBacking")); -} - -template <> -char* PartitionAllocator::AllocateExpandedVectorBacking(size_t size) { - return reinterpret_cast(AllocateBacking( - size, "PartitionAllocator::allocateExpandedVectorBacking")); -} - -} // namespace WTF diff --git a/sky/engine/wtf/allocator/PartitionAllocator.h b/sky/engine/wtf/allocator/PartitionAllocator.h deleted file mode 100644 index dfae666382635..0000000000000 --- a/sky/engine/wtf/allocator/PartitionAllocator.h +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) 2013 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. - -#ifndef WTF_PartitionAllocator_h -#define WTF_PartitionAllocator_h - -// This is the allocator that is used for allocations that are not on the -// traced, garbage collected heap. It uses FastMalloc for collections, -// but uses the partition allocator for the backing store of the collections. - -#include -#include "base/allocator/partition_allocator/partition_alloc.h" -#include "flutter/sky/engine/wtf/Allocator.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/TypeTraits.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -class PartitionAllocatorDummyVisitor { - DISALLOW_NEW(); -}; - -class WTF_EXPORT PartitionAllocator { - public: - typedef PartitionAllocatorDummyVisitor Visitor; - static const bool kIsGarbageCollected = false; - - template - static size_t MaxElementCountInBackingStore() { - return base::kGenericMaxDirectMapped / sizeof(T); - } - - template - static size_t QuantizedSize(size_t count) { - CHECK_LE(count, MaxElementCountInBackingStore()); - return PartitionAllocActualSize(WTF::Partitions::BufferPartition(), - count * sizeof(T)); - } - template - static T* AllocateVectorBacking(size_t size) { - return reinterpret_cast( - AllocateBacking(size, WTF_HEAP_PROFILER_TYPE_NAME(T))); - } - template - static T* AllocateExpandedVectorBacking(size_t size) { - return reinterpret_cast( - AllocateBacking(size, WTF_HEAP_PROFILER_TYPE_NAME(T))); - } - static void FreeVectorBacking(void* address); - static inline bool ExpandVectorBacking(void*, size_t) { return false; } - static inline bool ShrinkVectorBacking(void* address, - size_t quantized_current_size, - size_t quantized_shrunk_size) { - // Optimization: if we're downsizing inside the same allocator bucket, - // we can skip reallocation. - return quantized_current_size == quantized_shrunk_size; - } - template - static T* AllocateInlineVectorBacking(size_t size) { - return AllocateVectorBacking(size); - } - static inline void FreeInlineVectorBacking(void* address) { - FreeVectorBacking(address); - } - static inline bool ExpandInlineVectorBacking(void*, size_t) { return false; } - static inline bool ShrinkInlineVectorBacking(void* address, - size_t quantized_current_size, - size_t quantized_shrunk_size) { - return ShrinkVectorBacking(address, quantized_current_size, - quantized_shrunk_size); - } - - template - static T* AllocateHashTableBacking(size_t size) { - return reinterpret_cast( - AllocateBacking(size, WTF_HEAP_PROFILER_TYPE_NAME(T))); - } - template - static T* AllocateZeroedHashTableBacking(size_t size) { - void* result = AllocateBacking(size, WTF_HEAP_PROFILER_TYPE_NAME(T)); - memset(result, 0, size); - return reinterpret_cast(result); - } - static void FreeHashTableBacking(void* address); - - template - static Return Malloc(size_t size, const char* type_name) { - return reinterpret_cast( - WTF::Partitions::FastMalloc(size, type_name)); - } - - static inline bool ExpandHashTableBacking(void*, size_t) { return false; } - static void Free(void* address) { WTF::Partitions::FastFree(address); } - template - static void* NewArray(size_t bytes) { - return Malloc(bytes, WTF_HEAP_PROFILER_TYPE_NAME(T)); - } - static void DeleteArray(void* ptr) { - Free(ptr); // Not the system free, the one from this class. - } - - static bool IsAllocationAllowed() { return true; } - static bool IsObjectResurrectionForbidden() { return false; } - - static void EnterGCForbiddenScope() {} - static void LeaveGCForbiddenScope() {} - - private: - static void* AllocateBacking(size_t, const char* type_name); -}; - -// Specializations for heap profiling, so type profiling of |char| is possible -// even in official builds (because |char| makes up a large portion of the -// heap.) -template <> -WTF_EXPORT char* PartitionAllocator::AllocateVectorBacking(size_t); -template <> -WTF_EXPORT char* PartitionAllocator::AllocateExpandedVectorBacking( - size_t); - -} // namespace WTF - -#define USE_ALLOCATOR(ClassName, Allocator) \ - public: \ - void* operator new(size_t size) { \ - return Allocator::template Malloc( \ - size, WTF_HEAP_PROFILER_TYPE_NAME(ClassName)); \ - } \ - void operator delete(void* p) { Allocator::Free(p); } \ - void* operator new[](size_t size) { \ - return Allocator::template NewArray(size); \ - } \ - void operator delete[](void* p) { Allocator::DeleteArray(p); } \ - void* operator new(size_t, NotNullTag, void* location) { \ - DCHECK(location); \ - return location; \ - } \ - void* operator new(size_t, void* location) { return location; } \ - \ - private: \ - typedef int __thisIsHereToForceASemicolonAfterThisMacro - -#endif // WTF_PartitionAllocator_h diff --git a/sky/engine/wtf/allocator/Partitions.cpp b/sky/engine/wtf/allocator/Partitions.cpp deleted file mode 100644 index 9dfe873e07e55..0000000000000 --- a/sky/engine/wtf/allocator/Partitions.cpp +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "platform/wtf/allocator/Partitions.h" - -#include "base/allocator/partition_allocator/oom.h" -#include "base/allocator/partition_allocator/page_allocator.h" -#include "base/debug/alias.h" -#include "base/lazy_instance.h" -#include "platform/wtf/allocator/PartitionAllocator.h" - -namespace WTF { - -const char* const Partitions::kAllocatedObjectPoolName = - "partition_alloc/allocated_objects"; - -static base::LazyInstance::Leaky initialization_lock_ = - LAZY_INSTANCE_INITIALIZER; -bool Partitions::initialized_ = false; - -// These statics are inlined, so cannot be LazyInstances. We create -// LazyInstances below, and then set the pointers correctly in Initialize(). -base::PartitionAllocatorGeneric* Partitions::fast_malloc_allocator_ = nullptr; -base::PartitionAllocatorGeneric* Partitions::array_buffer_allocator_ = nullptr; -base::PartitionAllocatorGeneric* Partitions::buffer_allocator_ = nullptr; -base::SizeSpecificPartitionAllocator<1024>* Partitions::layout_allocator_ = - nullptr; - -static base::LazyInstance::Leaky - lazy_fast_malloc = LAZY_INSTANCE_INITIALIZER; -static base::LazyInstance::Leaky - lazy_array_buffer = LAZY_INSTANCE_INITIALIZER; -static base::LazyInstance::Leaky lazy_buffer = - LAZY_INSTANCE_INITIALIZER; -static base::LazyInstance>::Leaky - lazy_layout = LAZY_INSTANCE_INITIALIZER; - -Partitions::ReportPartitionAllocSizeFunction Partitions::report_size_function_ = - nullptr; - -void Partitions::Initialize( - ReportPartitionAllocSizeFunction report_size_function) { - base::subtle::SpinLock::Guard guard(initialization_lock_.Get()); - - if (!initialized_) { - fast_malloc_allocator_ = lazy_fast_malloc.Pointer(); - array_buffer_allocator_ = lazy_array_buffer.Pointer(); - buffer_allocator_ = lazy_buffer.Pointer(); - layout_allocator_ = lazy_layout.Pointer(); - - base::PartitionAllocGlobalInit(&Partitions::HandleOutOfMemory); - fast_malloc_allocator_->init(); - array_buffer_allocator_->init(); - buffer_allocator_->init(); - layout_allocator_->init(); - report_size_function_ = report_size_function; - initialized_ = true; - } -} - -void Partitions::DecommitFreeableMemory() { - CHECK(IsMainThread()); - if (!initialized_) - return; - - base::PartitionPurgeMemoryGeneric( - ArrayBufferPartition(), base::PartitionPurgeDecommitEmptyPages | - base::PartitionPurgeDiscardUnusedSystemPages); - base::PartitionPurgeMemoryGeneric( - BufferPartition(), base::PartitionPurgeDecommitEmptyPages | - base::PartitionPurgeDiscardUnusedSystemPages); - base::PartitionPurgeMemoryGeneric( - FastMallocPartition(), base::PartitionPurgeDecommitEmptyPages | - base::PartitionPurgeDiscardUnusedSystemPages); - base::PartitionPurgeMemory(LayoutPartition(), - base::PartitionPurgeDecommitEmptyPages | - base::PartitionPurgeDiscardUnusedSystemPages); -} - -void Partitions::ReportMemoryUsageHistogram() { - static size_t observed_max_size_in_mb = 0; - - if (!report_size_function_) - return; - // We only report the memory in the main thread. - if (!IsMainThread()) - return; - // +1 is for rounding up the sizeInMB. - size_t size_in_mb = Partitions::TotalSizeOfCommittedPages() / 1024 / 1024 + 1; - if (size_in_mb > observed_max_size_in_mb) { - report_size_function_(size_in_mb); - observed_max_size_in_mb = size_in_mb; - } -} - -void Partitions::DumpMemoryStats( - bool is_light_dump, - base::PartitionStatsDumper* partition_stats_dumper) { - // Object model and rendering partitions are not thread safe and can be - // accessed only on the main thread. - DCHECK(IsMainThread()); - - DecommitFreeableMemory(); - PartitionDumpStatsGeneric(FastMallocPartition(), "fast_malloc", is_light_dump, - partition_stats_dumper); - PartitionDumpStatsGeneric(ArrayBufferPartition(), "array_buffer", - is_light_dump, partition_stats_dumper); - PartitionDumpStatsGeneric(BufferPartition(), "buffer", is_light_dump, - partition_stats_dumper); - PartitionDumpStats(LayoutPartition(), "layout", is_light_dump, - partition_stats_dumper); -} - -namespace { - -class LightPartitionStatsDumperImpl : public WTF::PartitionStatsDumper { - public: - LightPartitionStatsDumperImpl() : total_active_bytes_(0) {} - - void PartitionDumpTotals( - const char* partition_name, - const WTF::PartitionMemoryStats* memory_stats) override { - total_active_bytes_ += memory_stats->total_active_bytes; - } - - void PartitionsDumpBucketStats( - const char* partition_name, - const WTF::PartitionBucketMemoryStats*) override {} - - size_t TotalActiveBytes() const { return total_active_bytes_; } - - private: - size_t total_active_bytes_; -}; - -} // namespace - -size_t Partitions::TotalActiveBytes() { - LightPartitionStatsDumperImpl dumper; - WTF::Partitions::DumpMemoryStats(true, &dumper); - return dumper.TotalActiveBytes(); -} - -static NEVER_INLINE void PartitionsOutOfMemoryUsing2G() { - size_t signature = 2UL * 1024 * 1024 * 1024; - base::debug::Alias(&signature); - OOM_CRASH(); -} - -static NEVER_INLINE void PartitionsOutOfMemoryUsing1G() { - size_t signature = 1UL * 1024 * 1024 * 1024; - base::debug::Alias(&signature); - OOM_CRASH(); -} - -static NEVER_INLINE void PartitionsOutOfMemoryUsing512M() { - size_t signature = 512 * 1024 * 1024; - base::debug::Alias(&signature); - OOM_CRASH(); -} - -static NEVER_INLINE void PartitionsOutOfMemoryUsing256M() { - size_t signature = 256 * 1024 * 1024; - base::debug::Alias(&signature); - OOM_CRASH(); -} - -static NEVER_INLINE void PartitionsOutOfMemoryUsing128M() { - size_t signature = 128 * 1024 * 1024; - base::debug::Alias(&signature); - OOM_CRASH(); -} - -static NEVER_INLINE void PartitionsOutOfMemoryUsing64M() { - size_t signature = 64 * 1024 * 1024; - base::debug::Alias(&signature); - OOM_CRASH(); -} - -static NEVER_INLINE void PartitionsOutOfMemoryUsing32M() { - size_t signature = 32 * 1024 * 1024; - base::debug::Alias(&signature); - OOM_CRASH(); -} - -static NEVER_INLINE void PartitionsOutOfMemoryUsing16M() { - size_t signature = 16 * 1024 * 1024; - base::debug::Alias(&signature); - OOM_CRASH(); -} - -static NEVER_INLINE void PartitionsOutOfMemoryUsingLessThan16M() { - size_t signature = 16 * 1024 * 1024 - 1; - base::debug::Alias(&signature); - DLOG(FATAL) << "ParitionAlloc: out of memory with < 16M usage (error:" - << GetAllocPageErrorCode() << ")"; -} - -void Partitions::HandleOutOfMemory() { - volatile size_t total_usage = TotalSizeOfCommittedPages(); - uint32_t alloc_page_error_code = GetAllocPageErrorCode(); - base::debug::Alias(&alloc_page_error_code); - - if (total_usage >= 2UL * 1024 * 1024 * 1024) - PartitionsOutOfMemoryUsing2G(); - if (total_usage >= 1UL * 1024 * 1024 * 1024) - PartitionsOutOfMemoryUsing1G(); - if (total_usage >= 512 * 1024 * 1024) - PartitionsOutOfMemoryUsing512M(); - if (total_usage >= 256 * 1024 * 1024) - PartitionsOutOfMemoryUsing256M(); - if (total_usage >= 128 * 1024 * 1024) - PartitionsOutOfMemoryUsing128M(); - if (total_usage >= 64 * 1024 * 1024) - PartitionsOutOfMemoryUsing64M(); - if (total_usage >= 32 * 1024 * 1024) - PartitionsOutOfMemoryUsing32M(); - if (total_usage >= 16 * 1024 * 1024) - PartitionsOutOfMemoryUsing16M(); - PartitionsOutOfMemoryUsingLessThan16M(); -} - -} // namespace WTF diff --git a/sky/engine/wtf/allocator/Partitions.h b/sky/engine/wtf/allocator/Partitions.h deleted file mode 100644 index 58a5742e27f4e..0000000000000 --- a/sky/engine/wtf/allocator/Partitions.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef Partitions_h -#define Partitions_h - -#include -#include "base/allocator/partition_allocator/partition_alloc.h" -#include "base/allocator/partition_allocator/spin_lock.h" -#include "base/numerics/checked_math.h" -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/WTF.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -class WTF_EXPORT Partitions { - public: - typedef void (*ReportPartitionAllocSizeFunction)(size_t); - - // Name of allocator used by tracing for marking sub-allocations while take - // memory snapshots. - static const char* const kAllocatedObjectPoolName; - - static void Initialize(ReportPartitionAllocSizeFunction); - ALWAYS_INLINE static base::PartitionRootGeneric* ArrayBufferPartition() { - DCHECK(initialized_); - return array_buffer_allocator_->root(); - } - - ALWAYS_INLINE static base::PartitionRootGeneric* BufferPartition() { - DCHECK(initialized_); - return buffer_allocator_->root(); - } - - ALWAYS_INLINE static base::PartitionRootGeneric* FastMallocPartition() { - DCHECK(initialized_); - return fast_malloc_allocator_->root(); - } - - ALWAYS_INLINE static base::PartitionRoot* NodePartition() { - NOTREACHED(); - return nullptr; - } - - ALWAYS_INLINE static base::PartitionRoot* LayoutPartition() { - DCHECK(initialized_); - return layout_allocator_->root(); - } - - ALWAYS_INLINE static size_t ComputeAllocationSize(size_t count, size_t size) { - base::CheckedNumeric total = count; - total *= size; - return total.ValueOrDie(); - } - - static size_t CurrentDOMMemoryUsage() { - NOTREACHED(); - return 0; - } - - static size_t TotalSizeOfCommittedPages() { - DCHECK(initialized_); - size_t total_size = 0; - total_size += fast_malloc_allocator_->root()->total_size_of_committed_pages; - total_size += - array_buffer_allocator_->root()->total_size_of_committed_pages; - total_size += buffer_allocator_->root()->total_size_of_committed_pages; - total_size += layout_allocator_->root()->total_size_of_committed_pages; - return total_size; - } - - static size_t TotalActiveBytes(); - - static void DecommitFreeableMemory(); - - static void ReportMemoryUsageHistogram(); - - static void DumpMemoryStats(bool is_light_dump, base::PartitionStatsDumper*); - - ALWAYS_INLINE static void* BufferMalloc(size_t n, const char* type_name) { - return base::PartitionAllocGeneric(BufferPartition(), n, type_name); - } - ALWAYS_INLINE static void* BufferRealloc(void* p, - size_t n, - const char* type_name) { - return base::PartitionReallocGeneric(BufferPartition(), p, n, type_name); - } - ALWAYS_INLINE static void BufferFree(void* p) { - base::PartitionFreeGeneric(BufferPartition(), p); - } - ALWAYS_INLINE static size_t BufferActualSize(size_t n) { - return base::PartitionAllocActualSize(BufferPartition(), n); - } - static void* FastMalloc(size_t n, const char* type_name) { - return base::PartitionAllocGeneric(Partitions::FastMallocPartition(), n, - type_name); - } - static void* FastZeroedMalloc(size_t n, const char* type_name) { - void* result = FastMalloc(n, type_name); - memset(result, 0, n); - return result; - } - static void* FastRealloc(void* p, size_t n, const char* type_name) { - return base::PartitionReallocGeneric(Partitions::FastMallocPartition(), p, - n, type_name); - } - static void FastFree(void* p) { - base::PartitionFreeGeneric(Partitions::FastMallocPartition(), p); - } - - static void HandleOutOfMemory(); - - private: - static bool initialized_; - - // See Allocator.md for a description of these partitions. - static base::PartitionAllocatorGeneric* fast_malloc_allocator_; - static base::PartitionAllocatorGeneric* array_buffer_allocator_; - static base::PartitionAllocatorGeneric* buffer_allocator_; - static base::SizeSpecificPartitionAllocator<1024>* layout_allocator_; - static ReportPartitionAllocSizeFunction report_size_function_; -}; - -using base::kGenericMaxDirectMapped; -using base::kPageAllocationGranularity; -using base::kPageAllocationGranularityBaseMask; -using base::kPageAllocationGranularityOffsetMask; -using base::kSystemPageSize; - -using base::AllocPages; -using base::DecommitSystemPages; -using base::DiscardSystemPages; -using base::FreePages; -using base::GetAllocPageErrorCode; -using base::PartitionAlloc; -using base::PartitionFree; -using base::RecommitSystemPages; -using base::RoundDownToSystemPage; -using base::RoundUpToSystemPage; -using base::SetSystemPagesAccess; - -using base::PageInaccessible; -using base::PageReadWrite; -using base::PartitionAllocHooks; -using base::PartitionBucketMemoryStats; -using base::PartitionMemoryStats; -using base::PartitionStatsDumper; - -using CheckedSizeT = base::CheckedNumeric; - -} // namespace WTF - -#endif // Partitions_h diff --git a/sky/engine/wtf/asm/SaturatedArithmeticARM.h b/sky/engine/wtf/asm/SaturatedArithmeticARM.h deleted file mode 100644 index b61227e3a03a3..0000000000000 --- a/sky/engine/wtf/asm/SaturatedArithmeticARM.h +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_WTF_ASM_SATURATEDARITHMETICARM_H_ -#define SKY_ENGINE_WTF_ASM_SATURATEDARITHMETICARM_H_ - -#include -#include -#include "flutter/sky/engine/wtf/CPU.h" - -ALWAYS_INLINE int32_t saturatedAddition(int32_t a, int32_t b) { - int32_t result; - - asm("qadd %[output],%[first],%[second]" - : [output] "=r"(result) - : [first] "r"(a), [second] "r"(b)); - - return result; -} - -ALWAYS_INLINE int32_t saturatedSubtraction(int32_t a, int32_t b) { - int32_t result; - - asm("qsub %[output],%[first],%[second]" - : [output] "=r"(result) - : [first] "r"(a), [second] "r"(b)); - - return result; -} - -inline int getMaxSaturatedSetResultForTesting(int FractionalShift) { - // For ARM Asm version the set function maxes out to the biggest - // possible integer part with the fractional part zero'd out. - // e.g. 0x7fffffc0. - return std::numeric_limits::max() & ~((1 << FractionalShift) - 1); -} - -inline int getMinSaturatedSetResultForTesting(int FractionalShift) { - return std::numeric_limits::min(); -} - -ALWAYS_INLINE int saturatedSet(int value, int FractionalShift) { - // Figure out how many bits are left for storing the integer part of - // the fixed point number, and saturate our input to that - const int saturate = 32 - FractionalShift; - - int result; - - // The following ARM code will Saturate the passed value to the number of - // bits used for the whole part of the fixed point representation, then - // shift it up into place. This will result in the low bits - // all being 0's. When the value saturates this gives a different result - // to from the C++ case; in the C++ code a saturated value has all the low - // bits set to 1 (for a +ve number at least). This cannot be done rapidly - // in ARM ... we live with the difference, for the sake of speed. - - asm("ssat %[output],%[saturate],%[value]\n\t" - "lsl %[output],%[shift]" - : [output] "=r"(result) - : [value] "r"(value), [saturate] "n"(saturate), - [shift] "n"(FractionalShift)); - - return result; -} - -ALWAYS_INLINE int saturatedSet(unsigned value, int FractionalShift) { - // Here we are being passed an unsigned value to saturate, - // even though the result is returned as a signed integer. The ARM - // instruction for unsigned saturation therefore needs to be given one - // less bit (i.e. the sign bit) for the saturation to work correctly; hence - // the '31' below. - const int saturate = 31 - FractionalShift; - - // The following ARM code will Saturate the passed value to the number of - // bits used for the whole part of the fixed point representation, then - // shift it up into place. This will result in the low bits - // all being 0's. When the value saturates this gives a different result - // to from the C++ case; in the C++ code a saturated value has all the low - // bits set to 1. This cannot be done rapidly in ARM, so we live with the - // difference, for the sake of speed. - - int result; - - asm("usat %[output],%[saturate],%[value]\n\t" - "lsl %[output],%[shift]" - : [output] "=r"(result) - : [value] "r"(value), [saturate] "n"(saturate), - [shift] "n"(FractionalShift)); - - return result; -} - -#endif // SKY_ENGINE_WTF_ASM_SATURATEDARITHMETICARM_H_ diff --git a/sky/engine/wtf/dtoa.cpp b/sky/engine/wtf/dtoa.cpp deleted file mode 100644 index bdb9fc4d79674..0000000000000 --- a/sky/engine/wtf/dtoa.cpp +++ /dev/null @@ -1,1316 +0,0 @@ -/**************************************************************** - * - * The author of this software is David M. Gay. - * - * Copyright (c) 1991, 2000, 2001 by Lucent Technologies. - * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - ***************************************************************/ - -/* Please send bug reports to David M. Gay (dmg at acm dot org, - * with " at " changed at "@" and " dot " changed to "."). */ - -/* On a machine with IEEE extended-precision registers, it is - * necessary to specify double-precision (53-bit) rounding precision - * before invoking strtod or dtoa. If the machine uses (the equivalent - * of) Intel 80x87 arithmetic, the call - * _control87(PC_53, MCW_PC); - * does this with many compilers. Whether this or another call is - * appropriate depends on the compiler; for this to work, it may be - * necessary to #include "float.h" or another system-dependent header - * file. - */ - -#include "flutter/sky/engine/wtf/dtoa.h" - -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/ThreadingPrimitives.h" -#include "flutter/sky/engine/wtf/Vector.h" - -namespace WTF { - -Mutex* s_dtoaP5Mutex; - -typedef union { - double d; - uint32_t L[2]; -} U; - -#if CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN) -#define word0(x) (x)->L[0] -#define word1(x) (x)->L[1] -#else -#define word0(x) (x)->L[1] -#define word1(x) (x)->L[0] -#endif -#define dval(x) (x)->d - -#define Exp_shift 20 -#define Exp_shift1 20 -#define Exp_msk1 0x100000 -#define Exp_msk11 0x100000 -#define Exp_mask 0x7ff00000 -#define P 53 -#define Bias 1023 -#define Emin (-1022) -#define Exp_1 0x3ff00000 -#define Exp_11 0x3ff00000 -#define Ebits 11 -#define Frac_mask 0xfffff -#define Frac_mask1 0xfffff -#define Ten_pmax 22 -#define Bletch 0x10 -#define Bndry_mask 0xfffff -#define Bndry_mask1 0xfffff -#define LSB 1 -#define Sign_bit 0x80000000 -#define Log2P 1 -#define Tiny0 0 -#define Tiny1 1 -#define Quick_max 14 -#define Int_max 14 - -#define rounded_product(a, b) a *= b -#define rounded_quotient(a, b) a /= b - -#define Big0 (Frac_mask1 | Exp_msk1 * (DBL_MAX_EXP + Bias - 1)) -#define Big1 0xffffffff - -#if CPU(X86_64) -// FIXME: should we enable this on all 64-bit CPUs? -// 64-bit emulation provided by the compiler is likely to be slower than dtoa -// own code on 32-bit hardware. -#define USE_LONG_LONG -#endif - -#ifndef USE_LONG_LONG -/* The following definition of Storeinc is appropriate for MIPS processors. - * An alternative that might be better on some machines is - * *p++ = high << 16 | low & 0xffff; - */ -static ALWAYS_INLINE uint32_t* storeInc(uint32_t* p, - uint16_t high, - uint16_t low) { - uint16_t* p16 = reinterpret_cast(p); -#if CPU(BIG_ENDIAN) - p16[0] = high; - p16[1] = low; -#else - p16[1] = high; - p16[0] = low; -#endif - return p + 1; -} -#endif - -struct BigInt { - BigInt() : sign(0) {} - int sign; - - void clear() { - sign = 0; - m_words.clear(); - } - - size_t size() const { return m_words.size(); } - - void resize(size_t s) { m_words.resize(s); } - - uint32_t* words() { return m_words.data(); } - - const uint32_t* words() const { return m_words.data(); } - - void append(uint32_t w) { m_words.append(w); } - - Vector m_words; -}; - -static void multadd(BigInt& b, int m, int a) /* multiply by m and add a */ -{ -#ifdef USE_LONG_LONG - unsigned long long carry; -#else - uint32_t carry; -#endif - - int wds = b.size(); - uint32_t* x = b.words(); - int i = 0; - carry = a; - do { -#ifdef USE_LONG_LONG - unsigned long long y = *x * (unsigned long long)m + carry; - carry = y >> 32; - *x++ = (uint32_t)y & 0xffffffffUL; -#else - uint32_t xi = *x; - uint32_t y = (xi & 0xffff) * m + carry; - uint32_t z = (xi >> 16) * m + (y >> 16); - carry = z >> 16; - *x++ = (z << 16) + (y & 0xffff); -#endif - } while (++i < wds); - - if (carry) - b.append((uint32_t)carry); -} - -static int hi0bits(uint32_t x) { - int k = 0; - - if (!(x & 0xffff0000)) { - k = 16; - x <<= 16; - } - if (!(x & 0xff000000)) { - k += 8; - x <<= 8; - } - if (!(x & 0xf0000000)) { - k += 4; - x <<= 4; - } - if (!(x & 0xc0000000)) { - k += 2; - x <<= 2; - } - if (!(x & 0x80000000)) { - k++; - if (!(x & 0x40000000)) - return 32; - } - return k; -} - -static int lo0bits(uint32_t* y) { - int k; - uint32_t x = *y; - - if (x & 7) { - if (x & 1) - return 0; - if (x & 2) { - *y = x >> 1; - return 1; - } - *y = x >> 2; - return 2; - } - k = 0; - if (!(x & 0xffff)) { - k = 16; - x >>= 16; - } - if (!(x & 0xff)) { - k += 8; - x >>= 8; - } - if (!(x & 0xf)) { - k += 4; - x >>= 4; - } - if (!(x & 0x3)) { - k += 2; - x >>= 2; - } - if (!(x & 1)) { - k++; - x >>= 1; - if (!x) - return 32; - } - *y = x; - return k; -} - -static void i2b(BigInt& b, int i) { - b.sign = 0; - b.resize(1); - b.words()[0] = i; -} - -static void mult(BigInt& aRef, const BigInt& bRef) { - const BigInt* a = &aRef; - const BigInt* b = &bRef; - BigInt c; - int wa, wb, wc; - const uint32_t* x = 0; - const uint32_t* xa; - const uint32_t* xb; - const uint32_t* xae; - const uint32_t* xbe; - uint32_t* xc; - uint32_t* xc0; - uint32_t y; -#ifdef USE_LONG_LONG - unsigned long long carry, z; -#else - uint32_t carry, z; -#endif - - if (a->size() < b->size()) { - const BigInt* tmp = a; - a = b; - b = tmp; - } - - wa = a->size(); - wb = b->size(); - wc = wa + wb; - c.resize(wc); - - for (xc = c.words(), xa = xc + wc; xc < xa; xc++) - *xc = 0; - xa = a->words(); - xae = xa + wa; - xb = b->words(); - xbe = xb + wb; - xc0 = c.words(); -#ifdef USE_LONG_LONG - for (; xb < xbe; xc0++) { - if ((y = *xb++)) { - x = xa; - xc = xc0; - carry = 0; - do { - z = *x++ * (unsigned long long)y + *xc + carry; - carry = z >> 32; - *xc++ = (uint32_t)z & 0xffffffffUL; - } while (x < xae); - *xc = (uint32_t)carry; - } - } -#else - for (; xb < xbe; xb++, xc0++) { - if ((y = *xb & 0xffff)) { - x = xa; - xc = xc0; - carry = 0; - do { - z = (*x & 0xffff) * y + (*xc & 0xffff) + carry; - carry = z >> 16; - uint32_t z2 = (*x++ >> 16) * y + (*xc >> 16) + carry; - carry = z2 >> 16; - xc = storeInc(xc, z2, z); - } while (x < xae); - *xc = carry; - } - if ((y = *xb >> 16)) { - x = xa; - xc = xc0; - carry = 0; - uint32_t z2 = *xc; - do { - z = (*x & 0xffff) * y + (*xc >> 16) + carry; - carry = z >> 16; - xc = storeInc(xc, z, z2); - z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry; - carry = z2 >> 16; - } while (x < xae); - *xc = z2; - } - } -#endif - for (xc0 = c.words(), xc = xc0 + wc; wc > 0 && !*--xc; --wc) { - } - c.resize(wc); - aRef = c; -} - -struct P5Node { - WTF_MAKE_NONCOPYABLE(P5Node); - WTF_MAKE_FAST_ALLOCATED; - - public: - P5Node() {} - BigInt val; - P5Node* next; -}; - -static P5Node* p5s; -static int p5sCount; - -static ALWAYS_INLINE void pow5mult(BigInt& b, int k) { - static int p05[3] = {5, 25, 125}; - - if (int i = k & 3) - multadd(b, p05[i - 1], 0); - - if (!(k >>= 2)) - return; - - s_dtoaP5Mutex->lock(); - P5Node* p5 = p5s; - - if (!p5) { - /* first time */ - p5 = new P5Node; - i2b(p5->val, 625); - p5->next = 0; - p5s = p5; - p5sCount = 1; - } - - int p5sCountLocal = p5sCount; - s_dtoaP5Mutex->unlock(); - int p5sUsed = 0; - - for (;;) { - if (k & 1) - mult(b, p5->val); - - if (!(k >>= 1)) - break; - - if (++p5sUsed == p5sCountLocal) { - s_dtoaP5Mutex->lock(); - if (p5sUsed == p5sCount) { - ASSERT(!p5->next); - p5->next = new P5Node; - p5->next->next = 0; - p5->next->val = p5->val; - mult(p5->next->val, p5->next->val); - ++p5sCount; - } - - p5sCountLocal = p5sCount; - s_dtoaP5Mutex->unlock(); - } - p5 = p5->next; - } -} - -static ALWAYS_INLINE void lshift(BigInt& b, int k) { - int n = k >> 5; - - int origSize = b.size(); - int n1 = n + origSize + 1; - - if (k &= 0x1f) - b.resize(b.size() + n + 1); - else - b.resize(b.size() + n); - - const uint32_t* srcStart = b.words(); - uint32_t* dstStart = b.words(); - const uint32_t* src = srcStart + origSize - 1; - uint32_t* dst = dstStart + n1 - 1; - if (k) { - uint32_t hiSubword = 0; - int s = 32 - k; - for (; src >= srcStart; --src) { - *dst-- = hiSubword | *src >> s; - hiSubword = *src << k; - } - *dst = hiSubword; - ASSERT(dst == dstStart + n); - - b.resize(origSize + n + !!b.words()[n1 - 1]); - } else { - do { - *--dst = *src--; - } while (src >= srcStart); - } - for (dst = dstStart + n; dst != dstStart;) - *--dst = 0; - - ASSERT(b.size() <= 1 || b.words()[b.size() - 1]); -} - -static int cmp(const BigInt& a, const BigInt& b) { - const uint32_t *xa, *xa0, *xb, *xb0; - int i, j; - - i = a.size(); - j = b.size(); - ASSERT(i <= 1 || a.words()[i - 1]); - ASSERT(j <= 1 || b.words()[j - 1]); - if (i -= j) - return i; - xa0 = a.words(); - xa = xa0 + j; - xb0 = b.words(); - xb = xb0 + j; - for (;;) { - if (*--xa != *--xb) - return *xa < *xb ? -1 : 1; - if (xa <= xa0) - break; - } - return 0; -} - -static ALWAYS_INLINE void diff(BigInt& c, - const BigInt& aRef, - const BigInt& bRef) { - const BigInt* a = &aRef; - const BigInt* b = &bRef; - int i, wa, wb; - uint32_t* xc; - - i = cmp(*a, *b); - if (!i) { - c.sign = 0; - c.resize(1); - c.words()[0] = 0; - return; - } - if (i < 0) { - const BigInt* tmp = a; - a = b; - b = tmp; - i = 1; - } else - i = 0; - - wa = a->size(); - const uint32_t* xa = a->words(); - const uint32_t* xae = xa + wa; - wb = b->size(); - const uint32_t* xb = b->words(); - const uint32_t* xbe = xb + wb; - - c.resize(wa); - c.sign = i; - xc = c.words(); -#ifdef USE_LONG_LONG - unsigned long long borrow = 0; - do { - unsigned long long y = (unsigned long long)*xa++ - *xb++ - borrow; - borrow = y >> 32 & (uint32_t)1; - *xc++ = (uint32_t)y & 0xffffffffUL; - } while (xb < xbe); - while (xa < xae) { - unsigned long long y = *xa++ - borrow; - borrow = y >> 32 & (uint32_t)1; - *xc++ = (uint32_t)y & 0xffffffffUL; - } -#else - uint32_t borrow = 0; - do { - uint32_t y = (*xa & 0xffff) - (*xb & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - uint32_t z = (*xa++ >> 16) - (*xb++ >> 16) - borrow; - borrow = (z & 0x10000) >> 16; - xc = storeInc(xc, z, y); - } while (xb < xbe); - while (xa < xae) { - uint32_t y = (*xa & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - uint32_t z = (*xa++ >> 16) - borrow; - borrow = (z & 0x10000) >> 16; - xc = storeInc(xc, z, y); - } -#endif - while (!*--xc) - wa--; - c.resize(wa); -} - -static ALWAYS_INLINE void d2b(BigInt& b, U* d, int* e, int* bits) { - int de, k; - uint32_t* x; - uint32_t y, z; - int i; -#define d0 word0(d) -#define d1 word1(d) - - b.sign = 0; - b.resize(1); - x = b.words(); - - z = d0 & Frac_mask; - d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ - if ((de = (int)(d0 >> Exp_shift))) - z |= Exp_msk1; - if ((y = d1)) { - if ((k = lo0bits(&y))) { - x[0] = y | (z << (32 - k)); - z >>= k; - } else - x[0] = y; - if (z) { - b.resize(2); - x[1] = z; - } - - i = b.size(); - } else { - k = lo0bits(&z); - x[0] = z; - i = 1; - b.resize(1); - k += 32; - } - if (de) { - *e = de - Bias - (P - 1) + k; - *bits = P - k; - } else { - *e = 0 - Bias - (P - 1) + 1 + k; - *bits = (32 * i) - hi0bits(x[i - 1]); - } -} -#undef d0 -#undef d1 - -static const double tens[] = {1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, - 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, - 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22}; - -static const double bigtens[] = {1e16, 1e32, 1e64, 1e128, 1e256}; - -#define Scale_Bit 0x10 -#define n_bigtens 5 - -static ALWAYS_INLINE int quorem(BigInt& b, BigInt& S) { - size_t n; - uint32_t* bx; - uint32_t* bxe; - uint32_t q; - uint32_t* sx; - uint32_t* sxe; -#ifdef USE_LONG_LONG - unsigned long long borrow, carry, y, ys; -#else - uint32_t borrow, carry, y, ys; - uint32_t si, z, zs; -#endif - ASSERT(b.size() <= 1 || b.words()[b.size() - 1]); - ASSERT(S.size() <= 1 || S.words()[S.size() - 1]); - - n = S.size(); - ASSERT_WITH_MESSAGE(b.size() <= n, "oversize b in quorem"); - if (b.size() < n) - return 0; - sx = S.words(); - sxe = sx + --n; - bx = b.words(); - bxe = bx + n; - q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ - ASSERT_WITH_MESSAGE(q <= 9, "oversized quotient in quorem"); - if (q) { - borrow = 0; - carry = 0; - do { -#ifdef USE_LONG_LONG - ys = *sx++ * (unsigned long long)q + carry; - carry = ys >> 32; - y = *bx - (ys & 0xffffffffUL) - borrow; - borrow = y >> 32 & (uint32_t)1; - *bx++ = (uint32_t)y & 0xffffffffUL; -#else - si = *sx++; - ys = (si & 0xffff) * q + carry; - zs = (si >> 16) * q + (ys >> 16); - carry = zs >> 16; - y = (*bx & 0xffff) - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*bx >> 16) - (zs & 0xffff) - borrow; - borrow = (z & 0x10000) >> 16; - bx = storeInc(bx, z, y); -#endif - } while (sx <= sxe); - if (!*bxe) { - bx = b.words(); - while (--bxe > bx && !*bxe) - --n; - b.resize(n); - } - } - if (cmp(b, S) >= 0) { - q++; - borrow = 0; - carry = 0; - bx = b.words(); - sx = S.words(); - do { -#ifdef USE_LONG_LONG - ys = *sx++ + carry; - carry = ys >> 32; - y = *bx - (ys & 0xffffffffUL) - borrow; - borrow = y >> 32 & (uint32_t)1; - *bx++ = (uint32_t)y & 0xffffffffUL; -#else - si = *sx++; - ys = (si & 0xffff) + carry; - zs = (si >> 16) + (ys >> 16); - carry = zs >> 16; - y = (*bx & 0xffff) - (ys & 0xffff) - borrow; - borrow = (y & 0x10000) >> 16; - z = (*bx >> 16) - (zs & 0xffff) - borrow; - borrow = (z & 0x10000) >> 16; - bx = storeInc(bx, z, y); -#endif - } while (sx <= sxe); - bx = b.words(); - bxe = bx + n; - if (!*bxe) { - while (--bxe > bx && !*bxe) - --n; - b.resize(n); - } - } - return q; -} - -/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. - * - * Inspired by "How to Print Floating-Point Numbers Accurately" by - * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 112-126]. - * - * Modifications: - * 1. Rather than iterating, we use a simple numeric overestimate - * to determine k = floor(log10(d)). We scale relevant - * quantities using O(log2(k)) rather than O(k) multiplications. - * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't - * try to generate digits strictly left to right. Instead, we - * compute with fewer bits and propagate the carry if necessary - * when rounding the final digit up. This is often faster. - * 3. Under the assumption that input will be rounded nearest, - * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. - * That is, we allow equality in stopping tests when the - * round-nearest rule will give the same floating-point value - * as would satisfaction of the stopping test with strict - * inequality. - * 4. We remove common factors of powers of 2 from relevant - * quantities. - * 5. When converting floating-point integers less than 1e16, - * we use floating-point arithmetic rather than resorting - * to multiple-precision integers. - * 6. When asked to produce fewer than 15 digits, we first try - * to get by with floating-point arithmetic; we resort to - * multiple-precision integer arithmetic only if we cannot - * guarantee that the floating-point calculation has given - * the correctly rounded result. For k requested digits and - * "uniformly" distributed input, the probability is - * something like 10^(k-15) that we must resort to the int32_t - * calculation. - * - * Note: 'leftright' translates to 'generate shortest possible string'. - */ -template -void dtoa(DtoaBuffer result, - double dd, - int ndigits, - bool& signOut, - int& exponentOut, - unsigned& precisionOut) { - // Exactly one rounding mode must be specified. - ASSERT(roundingNone + roundingSignificantFigures + roundingDecimalPlaces == - 1); - // roundingNone only allowed (only sensible?) with leftright set. - ASSERT(!roundingNone || leftright); - - ASSERT(std::isfinite(dd)); - - int bbits, b2, b5, be, dig, i, ieps, ilim = 0, ilim0, ilim1 = 0, j, j1, k, k0, - k_check, m2, m5, s2, s5, spec_case; - int32_t L; - int denorm; - uint32_t x; - BigInt b, delta, mlo, mhi, S; - U d2, eps, u; - double ds; - char* s; - char* s0; - - u.d = dd; - - /* Infinity or NaN */ - ASSERT((word0(&u) & Exp_mask) != Exp_mask); - - // JavaScript toString conversion treats -0 as 0. - if (!dval(&u)) { - signOut = false; - exponentOut = 0; - precisionOut = 1; - result[0] = '0'; - result[1] = '\0'; - return; - } - - if (word0(&u) & Sign_bit) { - signOut = true; - word0(&u) &= ~Sign_bit; // clear sign bit - } else - signOut = false; - - d2b(b, &u, &be, &bbits); - if ((i = (int)(word0(&u) >> Exp_shift1 & (Exp_mask >> Exp_shift1)))) { - dval(&d2) = dval(&u); - word0(&d2) &= Frac_mask1; - word0(&d2) |= Exp_11; - - /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 - * log10(x) = log(x) / log(10) - * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) - * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2) - * - * This suggests computing an approximation k to log10(d) by - * - * k = (i - Bias)*0.301029995663981 - * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); - * - * We want k to be too large rather than too small. - * The error in the first-order Taylor series approximation - * is in our favor, so we just round up the constant enough - * to compensate for any error in the multiplication of - * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, - * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, - * adding 1e-13 to the constant term more than suffices. - * Hence we adjust the constant term to 0.1760912590558. - * (We could get a more accurate k by invoking log10, - * but this is probably not worthwhile.) - */ - - i -= Bias; - denorm = 0; - } else { - /* d is denormalized */ - - i = bbits + be + (Bias + (P - 1) - 1); - x = (i > 32) ? (word0(&u) << (64 - i)) | (word1(&u) >> (i - 32)) - : word1(&u) << (32 - i); - dval(&d2) = x; - word0(&d2) -= 31 * Exp_msk1; /* adjust exponent */ - i -= (Bias + (P - 1) - 1) + 1; - denorm = 1; - } - ds = (dval(&d2) - 1.5) * 0.289529654602168 + 0.1760912590558 + - (i * 0.301029995663981); - k = (int)ds; - if (ds < 0. && ds != k) - k--; /* want k = floor(ds) */ - k_check = 1; - if (k >= 0 && k <= Ten_pmax) { - if (dval(&u) < tens[k]) - k--; - k_check = 0; - } - j = bbits - i - 1; - if (j >= 0) { - b2 = 0; - s2 = j; - } else { - b2 = -j; - s2 = 0; - } - if (k >= 0) { - b5 = 0; - s5 = k; - s2 += k; - } else { - b2 -= k; - b5 = -k; - s5 = 0; - } - - if (roundingNone) { - ilim = ilim1 = -1; - i = 18; - ndigits = 0; - } - if (roundingSignificantFigures) { - if (ndigits <= 0) - ndigits = 1; - ilim = ilim1 = i = ndigits; - } - if (roundingDecimalPlaces) { - i = ndigits + k + 1; - ilim = i; - ilim1 = i - 1; - if (i <= 0) - i = 1; - } - - s = s0 = result; - - if (ilim >= 0 && ilim <= Quick_max) { - /* Try to get by with floating-point arithmetic. */ - - i = 0; - dval(&d2) = dval(&u); - k0 = k; - ilim0 = ilim; - ieps = 2; /* conservative */ - if (k > 0) { - ds = tens[k & 0xf]; - j = k >> 4; - if (j & Bletch) { - /* prevent overflows */ - j &= Bletch - 1; - dval(&u) /= bigtens[n_bigtens - 1]; - ieps++; - } - for (; j; j >>= 1, i++) { - if (j & 1) { - ieps++; - ds *= bigtens[i]; - } - } - dval(&u) /= ds; - } else if ((j1 = -k)) { - dval(&u) *= tens[j1 & 0xf]; - for (j = j1 >> 4; j; j >>= 1, i++) { - if (j & 1) { - ieps++; - dval(&u) *= bigtens[i]; - } - } - } - if (k_check && dval(&u) < 1. && ilim > 0) { - if (ilim1 <= 0) - goto fastFailed; - ilim = ilim1; - k--; - dval(&u) *= 10.; - ieps++; - } - dval(&eps) = (ieps * dval(&u)) + 7.; - word0(&eps) -= (P - 1) * Exp_msk1; - if (!ilim) { - S.clear(); - mhi.clear(); - dval(&u) -= 5.; - if (dval(&u) > dval(&eps)) - goto oneDigit; - if (dval(&u) < -dval(&eps)) - goto noDigits; - goto fastFailed; - } - if (leftright) { - /* Use Steele & White method of only - * generating digits needed. - */ - dval(&eps) = (0.5 / tens[ilim - 1]) - dval(&eps); - for (i = 0;;) { - L = (long int)dval(&u); - dval(&u) -= L; - *s++ = '0' + (int)L; - if (dval(&u) < dval(&eps)) - goto ret; - if (1. - dval(&u) < dval(&eps)) - goto bumpUp; - if (++i >= ilim) - break; - dval(&eps) *= 10.; - dval(&u) *= 10.; - } - } else { - /* Generate ilim digits, then fix them up. */ - dval(&eps) *= tens[ilim - 1]; - for (i = 1;; i++, dval(&u) *= 10.) { - L = (int32_t)(dval(&u)); - if (!(dval(&u) -= L)) - ilim = i; - *s++ = '0' + (int)L; - if (i == ilim) { - if (dval(&u) > 0.5 + dval(&eps)) - goto bumpUp; - if (dval(&u) < 0.5 - dval(&eps)) { - while (*--s == '0') { - } - s++; - goto ret; - } - break; - } - } - } - fastFailed: - s = s0; - dval(&u) = dval(&d2); - k = k0; - ilim = ilim0; - } - - /* Do we have a "small" integer? */ - - if (be >= 0 && k <= Int_max) { - /* Yes. */ - ds = tens[k]; - if (ndigits < 0 && ilim <= 0) { - S.clear(); - mhi.clear(); - if (ilim < 0 || dval(&u) <= 5 * ds) - goto noDigits; - goto oneDigit; - } - for (i = 1;; i++, dval(&u) *= 10.) { - L = (int32_t)(dval(&u) / ds); - dval(&u) -= L * ds; - *s++ = '0' + (int)L; - if (!dval(&u)) { - break; - } - if (i == ilim) { - dval(&u) += dval(&u); - if (dval(&u) > ds || (dval(&u) == ds && (L & 1))) { - bumpUp: - while (*--s == '9') - if (s == s0) { - k++; - *s = '0'; - break; - } - ++*s++; - } - break; - } - } - goto ret; - } - - m2 = b2; - m5 = b5; - mhi.clear(); - mlo.clear(); - if (leftright) { - i = denorm ? be + (Bias + (P - 1) - 1 + 1) : 1 + P - bbits; - b2 += i; - s2 += i; - i2b(mhi, 1); - } - if (m2 > 0 && s2 > 0) { - i = m2 < s2 ? m2 : s2; - b2 -= i; - m2 -= i; - s2 -= i; - } - if (b5 > 0) { - if (leftright) { - if (m5 > 0) { - pow5mult(mhi, m5); - mult(b, mhi); - } - if ((j = b5 - m5)) - pow5mult(b, j); - } else - pow5mult(b, b5); - } - i2b(S, 1); - if (s5 > 0) - pow5mult(S, s5); - - /* Check for special case that d is a normalized power of 2. */ - - spec_case = 0; - if ((roundingNone || leftright) && (!word1(&u) && !(word0(&u) & Bndry_mask) && - word0(&u) & (Exp_mask & ~Exp_msk1))) { - /* The special case */ - b2 += Log2P; - s2 += Log2P; - spec_case = 1; - } - - /* Arrange for convenient computation of quotients: - * shift left if necessary so divisor has 4 leading 0 bits. - * - * Perhaps we should just compute leading 28 bits of S once - * and for all and pass them and a shift to quorem, so it - * can do shifts and ors to compute the numerator for q. - */ - if ((i = ((s5 ? 32 - hi0bits(S.words()[S.size() - 1]) : 1) + s2) & 0x1f)) - i = 32 - i; - if (i > 4) { - i -= 4; - b2 += i; - m2 += i; - s2 += i; - } else if (i < 4) { - i += 28; - b2 += i; - m2 += i; - s2 += i; - } - if (b2 > 0) - lshift(b, b2); - if (s2 > 0) - lshift(S, s2); - if (k_check) { - if (cmp(b, S) < 0) { - k--; - multadd(b, 10, 0); /* we botched the k estimate */ - if (leftright) - multadd(mhi, 10, 0); - ilim = ilim1; - } - } - if (ilim <= 0 && roundingDecimalPlaces) { - if (ilim < 0) - goto noDigits; - multadd(S, 5, 0); - // For IEEE-754 unbiased rounding this check should be <=, such that 0.5 - // would flush to zero. - if (cmp(b, S) < 0) - goto noDigits; - goto oneDigit; - } - if (leftright) { - if (m2 > 0) - lshift(mhi, m2); - - /* Compute mlo -- check for special case - * that d is a normalized power of 2. - */ - - mlo = mhi; - if (spec_case) - lshift(mhi, Log2P); - - for (i = 1;; i++) { - dig = quorem(b, S) + '0'; - /* Do we yet have the shortest decimal string - * that will round to d? - */ - j = cmp(b, mlo); - diff(delta, S, mhi); - j1 = delta.sign ? 1 : cmp(b, delta); -#ifdef DTOA_ROUND_BIASED - if (j < 0 || !j) { -#else - // FIXME: ECMA-262 specifies that equidistant results round away from - // zero, which probably means we shouldn't be on the unbiased code path - // (the (word1(&u) & 1) clause is looking highly suspicious). I haven't - // yet understood this code well enough to make the call, but we should - // probably be enabling DTOA_ROUND_BIASED. I think the interesting corner - // case to understand is probably "Math.pow(0.5, 24).toString()". - // I believe this value is interesting because I think it is precisely - // representable in binary floating point, and its decimal representation - // has a single digit that Steele & White reduction can remove, with the - // value 5 (thus equidistant from the next numbers above and below). - // We produce the correct answer using either codepath, and I don't as - // yet understand why. :-) - if (!j1 && !(word1(&u) & 1)) { - if (dig == '9') - goto round9up; - if (j > 0) - dig++; - *s++ = dig; - goto ret; - } - if (j < 0 || (!j && !(word1(&u) & 1))) { -#endif - if ((b.words()[0] || b.size() > 1) && (j1 > 0)) { - lshift(b, 1); - j1 = cmp(b, S); - // For IEEE-754 round-to-even, this check should be (j1 > 0 || (!j1 && - // (dig & 1))), but ECMA-262 specifies that equidistant values (e.g. - // (.5).toFixed()) should be rounded away from zero. - if (j1 >= 0) { - if (dig == '9') - goto round9up; - dig++; - } - } - *s++ = dig; - goto ret; - } - if (j1 > 0) { - if (dig == '9') { /* possible if i == 1 */ - round9up: - *s++ = '9'; - goto roundoff; - } - *s++ = dig + 1; - goto ret; - } - *s++ = dig; - if (i == ilim) - break; - multadd(b, 10, 0); - multadd(mlo, 10, 0); - multadd(mhi, 10, 0); - } - } else { - for (i = 1;; i++) { - *s++ = dig = quorem(b, S) + '0'; - if (!b.words()[0] && b.size() <= 1) - goto ret; - if (i >= ilim) - break; - multadd(b, 10, 0); - } - } - - /* Round off last digit */ - - lshift(b, 1); - j = cmp(b, S); - // For IEEE-754 round-to-even, this check should be (j > 0 || (!j && (dig & - // 1))), but ECMA-262 specifies that equidistant values (e.g. (.5).toFixed()) - // should be rounded away from zero. - if (j >= 0) { - roundoff: - while (*--s == '9') - if (s == s0) { - k++; - *s++ = '1'; - goto ret; - } - ++*s++; - } else { - while (*--s == '0') { - } - s++; - } - goto ret; -noDigits: - exponentOut = 0; - precisionOut = 1; - result[0] = '0'; - result[1] = '\0'; - return; -oneDigit: - *s++ = '1'; - k++; - goto ret; -ret: - ASSERT(s > result); - *s = 0; - exponentOut = k; - precisionOut = s - result; -} - -void dtoa(DtoaBuffer result, - double dd, - bool& sign, - int& exponent, - unsigned& precision) { - // flags are roundingNone, leftright. - dtoa(result, dd, 0, sign, exponent, precision); -} - -void dtoaRoundSF(DtoaBuffer result, - double dd, - int ndigits, - bool& sign, - int& exponent, - unsigned& precision) { - // flag is roundingSignificantFigures. - dtoa(result, dd, ndigits, sign, exponent, - precision); -} - -void dtoaRoundDP(DtoaBuffer result, - double dd, - int ndigits, - bool& sign, - int& exponent, - unsigned& precision) { - // flag is roundingDecimalPlaces. - dtoa(result, dd, ndigits, sign, exponent, - precision); -} - -const char* numberToString(double d, NumberToStringBuffer buffer) { - double_conversion::StringBuilder builder(buffer, NumberToStringBufferLength); - const double_conversion::DoubleToStringConverter& converter = - double_conversion::DoubleToStringConverter::EcmaScriptConverter(); - converter.ToShortest(d, &builder); - return builder.Finalize(); -} - -static inline const char* formatStringTruncatingTrailingZerosIfNeeded( - NumberToStringBuffer buffer, - double_conversion::StringBuilder& builder) { - size_t length = builder.position(); - size_t decimalPointPosition = 0; - for (; decimalPointPosition < length; ++decimalPointPosition) { - if (buffer[decimalPointPosition] == '.') - break; - } - - // No decimal seperator found, early exit. - if (decimalPointPosition == length) - return builder.Finalize(); - - size_t truncatedLength = length - 1; - for (; truncatedLength > decimalPointPosition; --truncatedLength) { - if (buffer[truncatedLength] != '0') - break; - } - - // No trailing zeros found to strip. - if (truncatedLength == length - 1) - return builder.Finalize(); - - // If we removed all trailing zeros, remove the decimal point as well. - if (truncatedLength == decimalPointPosition) { - ASSERT(truncatedLength > 0); - --truncatedLength; - } - - // Truncate the StringBuilder, and return the final result. - builder.SetPosition(truncatedLength + 1); - return builder.Finalize(); -} - -const char* numberToFixedPrecisionString(double d, - unsigned significantFigures, - NumberToStringBuffer buffer, - bool truncateTrailingZeros) { - // Mimic String::format("%.[precision]g", ...), but use dtoas rounding - // facilities. "g": Signed value printed in f or e format, whichever is more - // compact for the given value and precision. The e format is used only when - // the exponent of the value is less than –4 or greater than or equal to the - // precision argument. Trailing zeros are truncated, and the decimal point - // appears only if one or more digits follow it. "precision": The precision - // specifies the maximum number of significant digits printed. - double_conversion::StringBuilder builder(buffer, NumberToStringBufferLength); - const double_conversion::DoubleToStringConverter& converter = - double_conversion::DoubleToStringConverter::EcmaScriptConverter(); - converter.ToPrecision(d, significantFigures, &builder); - if (!truncateTrailingZeros) - return builder.Finalize(); - return formatStringTruncatingTrailingZerosIfNeeded(buffer, builder); -} - -const char* numberToFixedWidthString(double d, - unsigned decimalPlaces, - NumberToStringBuffer buffer) { - // Mimic String::format("%.[precision]f", ...), but use dtoas rounding - // facilities. "f": Signed value having the form [ – ]dddd.dddd, where dddd is - // one or more decimal digits. The number of digits before the decimal point - // depends on the magnitude of the number, and the number of digits after the - // decimal point depends on the requested precision. "precision": The - // precision value specifies the number of digits after the decimal point. If - // a decimal point appears, at least one digit appears before it. The value is - // rounded to the appropriate number of digits. - double_conversion::StringBuilder builder(buffer, NumberToStringBufferLength); - const double_conversion::DoubleToStringConverter& converter = - double_conversion::DoubleToStringConverter::EcmaScriptConverter(); - converter.ToFixed(d, decimalPlaces, &builder); - return builder.Finalize(); -} - -namespace Internal { - -double parseDoubleFromLongString(const UChar* string, - size_t length, - size_t& parsedLength) { - Vector conversionBuffer(length); - for (size_t i = 0; i < length; ++i) - conversionBuffer[i] = isASCII(string[i]) ? string[i] : 0; - return parseDouble(conversionBuffer.data(), length, parsedLength); -} - -} // namespace Internal - -} // namespace WTF diff --git a/sky/engine/wtf/dtoa.h b/sky/engine/wtf/dtoa.h deleted file mode 100644 index e69caa1bc0d35..0000000000000 --- a/sky/engine/wtf/dtoa.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2003, 2008, 2012 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_DTOA_H_ -#define SKY_ENGINE_WTF_DTOA_H_ - -#include "flutter/sky/engine/wtf/ASCIICType.h" -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" -#include "wtf/dtoa/double-conversion.h" - -namespace WTF { - -class Mutex; - -extern Mutex* s_dtoaP5Mutex; - -typedef char DtoaBuffer[80]; - -WTF_EXPORT void dtoa(DtoaBuffer result, - double dd, - bool& sign, - int& exponent, - unsigned& precision); -WTF_EXPORT void dtoaRoundSF(DtoaBuffer result, - double dd, - int ndigits, - bool& sign, - int& exponent, - unsigned& precision); -WTF_EXPORT void dtoaRoundDP(DtoaBuffer result, - double dd, - int ndigits, - bool& sign, - int& exponent, - unsigned& precision); - -// Size = 80 for sizeof(DtoaBuffer) + some sign bits, decimal point, 'e', -// exponent digits. -const unsigned NumberToStringBufferLength = 96; -typedef char NumberToStringBuffer[NumberToStringBufferLength]; -typedef LChar NumberToLStringBuffer[NumberToStringBufferLength]; - -WTF_EXPORT const char* numberToString(double, NumberToStringBuffer); -WTF_EXPORT const char* numberToFixedPrecisionString( - double, - unsigned significantFigures, - NumberToStringBuffer, - bool truncateTrailingZeros = false); -WTF_EXPORT const char* numberToFixedWidthString(double, - unsigned decimalPlaces, - NumberToStringBuffer); - -WTF_EXPORT double parseDouble(const LChar* string, - size_t length, - size_t& parsedLength); -WTF_EXPORT double parseDouble(const UChar* string, - size_t length, - size_t& parsedLength); - -namespace Internal { -double parseDoubleFromLongString(const UChar* string, - size_t length, - size_t& parsedLength); -} - -inline double parseDouble(const LChar* string, - size_t length, - size_t& parsedLength) { - return double_conversion::StringToDoubleConverter::StringToDouble( - reinterpret_cast(string), length, &parsedLength); -} - -inline double parseDouble(const UChar* string, - size_t length, - size_t& parsedLength) { - const size_t conversionBufferSize = 64; - if (length > conversionBufferSize) - return Internal::parseDoubleFromLongString(string, length, parsedLength); - LChar conversionBuffer[conversionBufferSize]; - for (int i = 0; i < static_cast(length); ++i) - conversionBuffer[i] = isASCII(string[i]) ? string[i] : 0; - return parseDouble(conversionBuffer, length, parsedLength); -} - -} // namespace WTF - -using WTF::NumberToLStringBuffer; -using WTF::NumberToStringBuffer; -using WTF::numberToFixedPrecisionString; -using WTF::numberToFixedWidthString; -using WTF::numberToString; -using WTF::parseDouble; - -#endif // SKY_ENGINE_WTF_DTOA_H_ diff --git a/sky/engine/wtf/dtoa/LICENSE b/sky/engine/wtf/dtoa/LICENSE deleted file mode 100644 index 933718a9ef9da..0000000000000 --- a/sky/engine/wtf/dtoa/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright 2006-2011, the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sky/engine/wtf/dtoa/README b/sky/engine/wtf/dtoa/README deleted file mode 100644 index f186b420f42bc..0000000000000 --- a/sky/engine/wtf/dtoa/README +++ /dev/null @@ -1,11 +0,0 @@ -http://code.google.com/p/double-conversion - -This project (double-conversion) provides binary-decimal and decimal-binary -routines for IEEE doubles. - -The library consists of efficient conversion routines that have been extracted -from the V8 JavaScript engine. The code has been refactored and improved so that -it can be used more easily in other projects. - -There is extensive documentation in src/double-conversion.h. Other examples can -be found in test/cctest/test-conversions.cc. diff --git a/sky/engine/wtf/dtoa/bignum-dtoa.cc b/sky/engine/wtf/dtoa/bignum-dtoa.cc deleted file mode 100644 index 4c19220628d91..0000000000000 --- a/sky/engine/wtf/dtoa/bignum-dtoa.cc +++ /dev/null @@ -1,680 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include "bignum-dtoa.h" - -#include "flutter/sky/engine/wtf/dtoa/bignum.h" -#include "flutter/sky/engine/wtf/dtoa/double.h" - -namespace WTF { - -namespace double_conversion { - -static int NormalizedExponent(uint64_t significand, int exponent) { - ASSERT(significand != 0); - while ((significand & Double::kHiddenBit) == 0) { - significand = significand << 1; - exponent = exponent - 1; - } - return exponent; -} - -// Forward declarations: -// Returns an estimation of k such that 10^(k-1) <= v < 10^k. -static int EstimatePower(int exponent); -// Computes v / 10^estimated_power exactly, as a ratio of two bignums, numerator -// and denominator. -static void InitialScaledStartValues(double v, - int estimated_power, - bool need_boundary_deltas, - Bignum* numerator, - Bignum* denominator, - Bignum* delta_minus, - Bignum* delta_plus); -// Multiplies numerator/denominator so that its values lies in the range 1-10. -// Returns decimal_point s.t. -// v = numerator'/denominator' * 10^(decimal_point-1) -// where numerator' and denominator' are the values of numerator and -// denominator after the call to this function. -static void FixupMultiply10(int estimated_power, - bool is_even, - int* decimal_point, - Bignum* numerator, - Bignum* denominator, - Bignum* delta_minus, - Bignum* delta_plus); -// Generates digits from the left to the right and stops when the generated -// digits yield the shortest decimal representation of v. -static void GenerateShortestDigits(Bignum* numerator, - Bignum* denominator, - Bignum* delta_minus, - Bignum* delta_plus, - bool is_even, - Vector buffer, - int* length); -// Generates 'requested_digits' after the decimal point. -static void BignumToFixed(int requested_digits, - int* decimal_point, - Bignum* numerator, - Bignum* denominator, - Vector(buffer), - int* length); -// Generates 'count' digits of numerator/denominator. -// Once 'count' digits have been produced rounds the result depending on the -// remainder (remainders of exactly .5 round upwards). Might update the -// decimal_point when rounding up (for example for 0.9999). -static void GenerateCountedDigits(int count, - int* decimal_point, - Bignum* numerator, - Bignum* denominator, - Vector(buffer), - int* length); - -void BignumDtoa(double v, - BignumDtoaMode mode, - int requested_digits, - Vector buffer, - int* length, - int* decimal_point) { - ASSERT(v > 0); - ASSERT(!Double(v).IsSpecial()); - uint64_t significand = Double(v).Significand(); - bool is_even = (significand & 1) == 0; - int exponent = Double(v).Exponent(); - int normalized_exponent = NormalizedExponent(significand, exponent); - // estimated_power might be too low by 1. - int estimated_power = EstimatePower(normalized_exponent); - - // Shortcut for Fixed. - // The requested digits correspond to the digits after the point. If the - // number is much too small, then there is no need in trying to get any - // digits. - if (mode == BIGNUM_DTOA_FIXED && -estimated_power - 1 > requested_digits) { - buffer[0] = '\0'; - *length = 0; - // Set decimal-point to -requested_digits. This is what Gay does. - // Note that it should not have any effect anyways since the string is - // empty. - *decimal_point = -requested_digits; - return; - } - - Bignum numerator; - Bignum denominator; - Bignum delta_minus; - Bignum delta_plus; - // Make sure the bignum can grow large enough. The smallest double equals - // 4e-324. In this case the denominator needs fewer than 324*4 binary digits. - // The maximum double is 1.7976931348623157e308 which needs fewer than - // 308*4 binary digits. - ASSERT(Bignum::kMaxSignificantBits >= 324 * 4); - bool need_boundary_deltas = (mode == BIGNUM_DTOA_SHORTEST); - InitialScaledStartValues(v, estimated_power, need_boundary_deltas, &numerator, - &denominator, &delta_minus, &delta_plus); - // We now have v = (numerator / denominator) * 10^estimated_power. - FixupMultiply10(estimated_power, is_even, decimal_point, &numerator, - &denominator, &delta_minus, &delta_plus); - // We now have v = (numerator / denominator) * 10^(decimal_point-1), and - // 1 <= (numerator + delta_plus) / denominator < 10 - switch (mode) { - case BIGNUM_DTOA_SHORTEST: - GenerateShortestDigits(&numerator, &denominator, &delta_minus, - &delta_plus, is_even, buffer, length); - break; - case BIGNUM_DTOA_FIXED: - BignumToFixed(requested_digits, decimal_point, &numerator, &denominator, - buffer, length); - break; - case BIGNUM_DTOA_PRECISION: - GenerateCountedDigits(requested_digits, decimal_point, &numerator, - &denominator, buffer, length); - break; - default: - UNREACHABLE(); - } - buffer[*length] = '\0'; -} - -// The procedure starts generating digits from the left to the right and stops -// when the generated digits yield the shortest decimal representation of v. A -// decimal representation of v is a number lying closer to v than to any other -// double, so it converts to v when read. -// -// This is true if d, the decimal representation, is between m- and m+, the -// upper and lower boundaries. d must be strictly between them if !is_even. -// m- := (numerator - delta_minus) / denominator -// m+ := (numerator + delta_plus) / denominator -// -// Precondition: 0 <= (numerator+delta_plus) / denominator < 10. -// If 1 <= (numerator+delta_plus) / denominator < 10 then no leading 0 digit -// will be produced. This should be the standard precondition. -static void GenerateShortestDigits(Bignum* numerator, - Bignum* denominator, - Bignum* delta_minus, - Bignum* delta_plus, - bool is_even, - Vector buffer, - int* length) { - // Small optimization: if delta_minus and delta_plus are the same just reuse - // one of the two bignums. - if (Bignum::Equal(*delta_minus, *delta_plus)) { - delta_plus = delta_minus; - } - *length = 0; - while (true) { - uint16_t digit; - digit = numerator->DivideModuloIntBignum(*denominator); - ASSERT(digit <= 9); // digit is a uint16_t and therefore always positive. - // digit = numerator / denominator (integer division). - // numerator = numerator % denominator. - buffer[(*length)++] = digit + '0'; - - // Can we stop already? - // If the remainder of the division is less than the distance to the lower - // boundary we can stop. In this case we simply round down (discarding the - // remainder). - // Similarly we test if we can round up (using the upper boundary). - bool in_delta_room_minus; - bool in_delta_room_plus; - if (is_even) { - in_delta_room_minus = Bignum::LessEqual(*numerator, *delta_minus); - } else { - in_delta_room_minus = Bignum::Less(*numerator, *delta_minus); - } - if (is_even) { - in_delta_room_plus = - Bignum::PlusCompare(*numerator, *delta_plus, *denominator) >= 0; - } else { - in_delta_room_plus = - Bignum::PlusCompare(*numerator, *delta_plus, *denominator) > 0; - } - if (!in_delta_room_minus && !in_delta_room_plus) { - // Prepare for next iteration. - numerator->Times10(); - delta_minus->Times10(); - // We optimized delta_plus to be equal to delta_minus (if they share the - // same value). So don't multiply delta_plus if they point to the same - // object. - if (delta_minus != delta_plus) { - delta_plus->Times10(); - } - } else if (in_delta_room_minus && in_delta_room_plus) { - // Let's see if 2*numerator < denominator. - // If yes, then the next digit would be < 5 and we can round down. - int compare = Bignum::PlusCompare(*numerator, *numerator, *denominator); - if (compare < 0) { - // Remaining digits are less than .5. -> Round down (== do nothing). - } else if (compare > 0) { - // Remaining digits are more than .5 of denominator. -> Round up. - // Note that the last digit could not be a '9' as otherwise the whole - // loop would have stopped earlier. - // We still have an assert here in case the preconditions were not - // satisfied. - ASSERT(buffer[(*length) - 1] != '9'); - buffer[(*length) - 1]++; - } else { - // Halfway case. - // TODO(floitsch): need a way to solve half-way cases. - // For now let's round towards even (since this is what Gay seems to - // do). - - if ((buffer[(*length) - 1] - '0') % 2 == 0) { - // Round down => Do nothing. - } else { - ASSERT(buffer[(*length) - 1] != '9'); - buffer[(*length) - 1]++; - } - } - return; - } else if (in_delta_room_minus) { - // Round down (== do nothing). - return; - } else { // in_delta_room_plus - // Round up. - // Note again that the last digit could not be '9' since this would have - // stopped the loop earlier. - // We still have an ASSERT here, in case the preconditions were not - // satisfied. - ASSERT(buffer[(*length) - 1] != '9'); - buffer[(*length) - 1]++; - return; - } - } -} - -// Let v = numerator / denominator < 10. -// Then we generate 'count' digits of d = x.xxxxx... (without the decimal point) -// from left to right. Once 'count' digits have been produced we decide wether -// to round up or down. Remainders of exactly .5 round upwards. Numbers such -// as 9.999999 propagate a carry all the way, and change the -// exponent (decimal_point), when rounding upwards. -static void GenerateCountedDigits(int count, - int* decimal_point, - Bignum* numerator, - Bignum* denominator, - Vector(buffer), - int* length) { - ASSERT(count >= 0); - for (int i = 0; i < count - 1; ++i) { - uint16_t digit; - digit = numerator->DivideModuloIntBignum(*denominator); - ASSERT(digit <= 9); // digit is a uint16_t and therefore always positive. - // digit = numerator / denominator (integer division). - // numerator = numerator % denominator. - buffer[i] = digit + '0'; - // Prepare for next iteration. - numerator->Times10(); - } - // Generate the last digit. - uint16_t digit; - digit = numerator->DivideModuloIntBignum(*denominator); - if (Bignum::PlusCompare(*numerator, *numerator, *denominator) >= 0) { - digit++; - } - buffer[count - 1] = digit + '0'; - // Correct bad digits (in case we had a sequence of '9's). Propagate the - // carry until we hat a non-'9' or til we reach the first digit. - for (int i = count - 1; i > 0; --i) { - if (buffer[i] != '0' + 10) - break; - buffer[i] = '0'; - buffer[i - 1]++; - } - if (buffer[0] == '0' + 10) { - // Propagate a carry past the top place. - buffer[0] = '1'; - (*decimal_point)++; - } - *length = count; -} - -// Generates 'requested_digits' after the decimal point. It might omit -// trailing '0's. If the input number is too small then no digits at all are -// generated (ex.: 2 fixed digits for 0.00001). -// -// Input verifies: 1 <= (numerator + delta) / denominator < 10. -static void BignumToFixed(int requested_digits, - int* decimal_point, - Bignum* numerator, - Bignum* denominator, - Vector(buffer), - int* length) { - // Note that we have to look at more than just the requested_digits, since - // a number could be rounded up. Example: v=0.5 with requested_digits=0. - // Even though the power of v equals 0 we can't just stop here. - if (-(*decimal_point) > requested_digits) { - // The number is definitively too small. - // Ex: 0.001 with requested_digits == 1. - // Set decimal-point to -requested_digits. This is what Gay does. - // Note that it should not have any effect anyways since the string is - // empty. - *decimal_point = -requested_digits; - *length = 0; - return; - } else if (-(*decimal_point) == requested_digits) { - // We only need to verify if the number rounds down or up. - // Ex: 0.04 and 0.06 with requested_digits == 1. - ASSERT(*decimal_point == -requested_digits); - // Initially the fraction lies in range (1, 10]. Multiply the denominator - // by 10 so that we can compare more easily. - denominator->Times10(); - if (Bignum::PlusCompare(*numerator, *numerator, *denominator) >= 0) { - // If the fraction is >= 0.5 then we have to include the rounded - // digit. - buffer[0] = '1'; - *length = 1; - (*decimal_point)++; - } else { - // Note that we caught most of similar cases earlier. - *length = 0; - } - return; - } else { - // The requested digits correspond to the digits after the point. - // The variable 'needed_digits' includes the digits before the point. - int needed_digits = (*decimal_point) + requested_digits; - GenerateCountedDigits(needed_digits, decimal_point, numerator, denominator, - buffer, length); - } -} - -// Returns an estimation of k such that 10^(k-1) <= v < 10^k where -// v = f * 2^exponent and 2^52 <= f < 2^53. -// v is hence a normalized double with the given exponent. The output is an -// approximation for the exponent of the decimal approimation .digits * 10^k. -// -// The result might undershoot by 1 in which case 10^k <= v < 10^k+1. -// Note: this property holds for v's upper boundary m+ too. -// 10^k <= m+ < 10^k+1. -// (see explanation below). -// -// Examples: -// EstimatePower(0) => 16 -// EstimatePower(-52) => 0 -// -// Note: e >= 0 => EstimatedPower(e) > 0. No similar claim can be made for e<0. -static int EstimatePower(int exponent) { - // This function estimates log10 of v where v = f*2^e (with e == exponent). - // Note that 10^floor(log10(v)) <= v, but v <= 10^ceil(log10(v)). - // Note that f is bounded by its container size. Let p = 53 (the double's - // significand size). Then 2^(p-1) <= f < 2^p. - // - // Given that log10(v) == log2(v)/log2(10) and e+(len(f)-1) is quite close - // to log2(v) the function is simplified to (e+(len(f)-1)/log2(10)). - // The computed number undershoots by less than 0.631 (when we compute log3 - // and not log10). - // - // Optimization: since we only need an approximated result this computation - // can be performed on 64 bit integers. On x86/x64 architecture the speedup is - // not really measurable, though. - // - // Since we want to avoid overshooting we decrement by 1e10 so that - // floating-point imprecisions don't affect us. - // - // Explanation for v's boundary m+: the computation takes advantage of - // the fact that 2^(p-1) <= f < 2^p. Boundaries still satisfy this requirement - // (even for denormals where the delta can be much more important). - - const double k1Log10 = 0.30102999566398114; // 1/lg(10) - - // For doubles len(f) == 53 (don't forget the hidden bit). - const int kSignificandSize = 53; - double estimate = ceil((exponent + kSignificandSize - 1) * k1Log10 - 1e-10); - return static_cast(estimate); -} - -// See comments for InitialScaledStartValues. -static void InitialScaledStartValuesPositiveExponent(double v, - int estimated_power, - bool need_boundary_deltas, - Bignum* numerator, - Bignum* denominator, - Bignum* delta_minus, - Bignum* delta_plus) { - // A positive exponent implies a positive power. - ASSERT(estimated_power >= 0); - // Since the estimated_power is positive we simply multiply the denominator - // by 10^estimated_power. - - // numerator = v. - numerator->AssignUInt64(Double(v).Significand()); - numerator->Shifxleft(Double(v).Exponent()); - // denominator = 10^estimated_power. - denominator->AssignPowerUInt16(10, estimated_power); - - if (need_boundary_deltas) { - // Introduce a common denominator so that the deltas to the boundaries are - // integers. - denominator->Shifxleft(1); - numerator->Shifxleft(1); - // Let v = f * 2^e, then m+ - v = 1/2 * 2^e; With the common - // denominator (of 2) delta_plus equals 2^e. - delta_plus->AssignUInt16(1); - delta_plus->Shifxleft(Double(v).Exponent()); - // Same for delta_minus (with adjustments below if f == 2^p-1). - delta_minus->AssignUInt16(1); - delta_minus->Shifxleft(Double(v).Exponent()); - - // If the significand (without the hidden bit) is 0, then the lower - // boundary is closer than just half a ulp (unit in the last place). - // There is only one exception: if the next lower number is a denormal then - // the distance is 1 ulp. This cannot be the case for exponent >= 0 (but we - // have to test it in the other function where exponent < 0). - uint64_t v_bits = Double(v).AsUint64(); - if ((v_bits & Double::kSignificandMask) == 0) { - // The lower boundary is closer at half the distance of "normal" numbers. - // Increase the common denominator and adapt all but the delta_minus. - denominator->Shifxleft(1); // *2 - numerator->Shifxleft(1); // *2 - delta_plus->Shifxleft(1); // *2 - } - } -} - -// See comments for InitialScaledStartValues -static void InitialScaledStartValuesNegativeExponentPositivePower( - double v, - int estimated_power, - bool need_boundary_deltas, - Bignum* numerator, - Bignum* denominator, - Bignum* delta_minus, - Bignum* delta_plus) { - uint64_t significand = Double(v).Significand(); - int exponent = Double(v).Exponent(); - // v = f * 2^e with e < 0, and with estimated_power >= 0. - // This means that e is close to 0 (have a look at how estimated_power is - // computed). - - // numerator = significand - // since v = significand * 2^exponent this is equivalent to - // numerator = v * / 2^-exponent - numerator->AssignUInt64(significand); - // denominator = 10^estimated_power * 2^-exponent (with exponent < 0) - denominator->AssignPowerUInt16(10, estimated_power); - denominator->Shifxleft(-exponent); - - if (need_boundary_deltas) { - // Introduce a common denominator so that the deltas to the boundaries are - // integers. - denominator->Shifxleft(1); - numerator->Shifxleft(1); - // Let v = f * 2^e, then m+ - v = 1/2 * 2^e; With the common - // denominator (of 2) delta_plus equals 2^e. - // Given that the denominator already includes v's exponent the distance - // to the boundaries is simply 1. - delta_plus->AssignUInt16(1); - // Same for delta_minus (with adjustments below if f == 2^p-1). - delta_minus->AssignUInt16(1); - - // If the significand (without the hidden bit) is 0, then the lower - // boundary is closer than just one ulp (unit in the last place). - // There is only one exception: if the next lower number is a denormal - // then the distance is 1 ulp. Since the exponent is close to zero - // (otherwise estimated_power would have been negative) this cannot happen - // here either. - uint64_t v_bits = Double(v).AsUint64(); - if ((v_bits & Double::kSignificandMask) == 0) { - // The lower boundary is closer at half the distance of "normal" numbers. - // Increase the denominator and adapt all but the delta_minus. - denominator->Shifxleft(1); // *2 - numerator->Shifxleft(1); // *2 - delta_plus->Shifxleft(1); // *2 - } - } -} - -// See comments for InitialScaledStartValues -static void InitialScaledStartValuesNegativeExponentNegativePower( - double v, - int estimated_power, - bool need_boundary_deltas, - Bignum* numerator, - Bignum* denominator, - Bignum* delta_minus, - Bignum* delta_plus) { - const uint64_t kMinimalNormalizedExponent = - UINT64_2PART_C(0x00100000, 00000000); - uint64_t significand = Double(v).Significand(); - int exponent = Double(v).Exponent(); - // Instead of multiplying the denominator with 10^estimated_power we - // multiply all values (numerator and deltas) by 10^-estimated_power. - - // Use numerator as temporary container for power_ten. - Bignum* power_ten = numerator; - power_ten->AssignPowerUInt16(10, -estimated_power); - - if (need_boundary_deltas) { - // Since power_ten == numerator we must make a copy of 10^estimated_power - // before we complete the computation of the numerator. - // delta_plus = delta_minus = 10^estimated_power - delta_plus->AssignBignum(*power_ten); - delta_minus->AssignBignum(*power_ten); - } - - // numerator = significand * 2 * 10^-estimated_power - // since v = significand * 2^exponent this is equivalent to - // numerator = v * 10^-estimated_power * 2 * 2^-exponent. - // Remember: numerator has been abused as power_ten. So no need to assign it - // to itself. - ASSERT(numerator == power_ten); - numerator->MultiplyByUInt64(significand); - - // denominator = 2 * 2^-exponent with exponent < 0. - denominator->AssignUInt16(1); - denominator->Shifxleft(-exponent); - - if (need_boundary_deltas) { - // Introduce a common denominator so that the deltas to the boundaries are - // integers. - numerator->Shifxleft(1); - denominator->Shifxleft(1); - // With this shift the boundaries have their correct value, since - // delta_plus = 10^-estimated_power, and - // delta_minus = 10^-estimated_power. - // These assignments have been done earlier. - - // The special case where the lower boundary is twice as close. - // This time we have to look out for the exception too. - uint64_t v_bits = Double(v).AsUint64(); - if ((v_bits & Double::kSignificandMask) == 0 && - // The only exception where a significand == 0 has its boundaries at - // "normal" distances: - (v_bits & Double::kExponentMask) != kMinimalNormalizedExponent) { - numerator->Shifxleft(1); // *2 - denominator->Shifxleft(1); // *2 - delta_plus->Shifxleft(1); // *2 - } - } -} - -// Let v = significand * 2^exponent. -// Computes v / 10^estimated_power exactly, as a ratio of two bignums, numerator -// and denominator. The functions GenerateShortestDigits and -// GenerateCountedDigits will then convert this ratio to its decimal -// representation d, with the required accuracy. -// Then d * 10^estimated_power is the representation of v. -// (Note: the fraction and the estimated_power might get adjusted before -// generating the decimal representation.) -// -// The initial start values consist of: -// - a scaled numerator: s.t. numerator/denominator == v / 10^estimated_power. -// - a scaled (common) denominator. -// optionally (used by GenerateShortestDigits to decide if it has the shortest -// decimal converting back to v): -// - v - m-: the distance to the lower boundary. -// - m+ - v: the distance to the upper boundary. -// -// v, m+, m-, and therefore v - m- and m+ - v all share the same denominator. -// -// Let ep == estimated_power, then the returned values will satisfy: -// v / 10^ep = numerator / denominator. -// v's boundarys m- and m+: -// m- / 10^ep == v / 10^ep - delta_minus / denominator -// m+ / 10^ep == v / 10^ep + delta_plus / denominator -// Or in other words: -// m- == v - delta_minus * 10^ep / denominator; -// m+ == v + delta_plus * 10^ep / denominator; -// -// Since 10^(k-1) <= v < 10^k (with k == estimated_power) -// or 10^k <= v < 10^(k+1) -// we then have 0.1 <= numerator/denominator < 1 -// or 1 <= numerator/denominator < 10 -// -// It is then easy to kickstart the digit-generation routine. -// -// The boundary-deltas are only filled if need_boundary_deltas is set. -static void InitialScaledStartValues(double v, - int estimated_power, - bool need_boundary_deltas, - Bignum* numerator, - Bignum* denominator, - Bignum* delta_minus, - Bignum* delta_plus) { - if (Double(v).Exponent() >= 0) { - InitialScaledStartValuesPositiveExponent( - v, estimated_power, need_boundary_deltas, numerator, denominator, - delta_minus, delta_plus); - } else if (estimated_power >= 0) { - InitialScaledStartValuesNegativeExponentPositivePower( - v, estimated_power, need_boundary_deltas, numerator, denominator, - delta_minus, delta_plus); - } else { - InitialScaledStartValuesNegativeExponentNegativePower( - v, estimated_power, need_boundary_deltas, numerator, denominator, - delta_minus, delta_plus); - } -} - -// This routine multiplies numerator/denominator so that its values lies in the -// range 1-10. That is after a call to this function we have: -// 1 <= (numerator + delta_plus) /denominator < 10. -// Let numerator the input before modification and numerator' the argument -// after modification, then the output-parameter decimal_point is such that -// numerator / denominator * 10^estimated_power == -// numerator' / denominator' * 10^(decimal_point - 1) -// In some cases estimated_power was too low, and this is already the case. We -// then simply adjust the power so that 10^(k-1) <= v < 10^k (with k == -// estimated_power) but do not touch the numerator or denominator. -// Otherwise the routine multiplies the numerator and the deltas by 10. -static void FixupMultiply10(int estimated_power, - bool is_even, - int* decimal_point, - Bignum* numerator, - Bignum* denominator, - Bignum* delta_minus, - Bignum* delta_plus) { - bool in_range; - if (is_even) { - // For IEEE doubles half-way cases (in decimal system numbers ending with 5) - // are rounded to the closest floating-point number with even significand. - in_range = Bignum::PlusCompare(*numerator, *delta_plus, *denominator) >= 0; - } else { - in_range = Bignum::PlusCompare(*numerator, *delta_plus, *denominator) > 0; - } - if (in_range) { - // Since numerator + delta_plus >= denominator we already have - // 1 <= numerator/denominator < 10. Simply update the estimated_power. - *decimal_point = estimated_power + 1; - } else { - *decimal_point = estimated_power; - numerator->Times10(); - if (Bignum::Equal(*delta_minus, *delta_plus)) { - delta_minus->Times10(); - delta_plus->AssignBignum(*delta_minus); - } else { - delta_minus->Times10(); - delta_plus->Times10(); - } - } -} - -} // namespace double_conversion - -} // namespace WTF diff --git a/sky/engine/wtf/dtoa/bignum-dtoa.h b/sky/engine/wtf/dtoa/bignum-dtoa.h deleted file mode 100644 index 81970fa506ff3..0000000000000 --- a/sky/engine/wtf/dtoa/bignum-dtoa.h +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_BIGNUM_DTOA_H_ -#define SKY_ENGINE_WTF_DTOA_BIGNUM_DTOA_H_ - -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -enum BignumDtoaMode { - // Return the shortest correct representation. - // For example the output of 0.299999999999999988897 is (the less accurate but - // correct) 0.3. - BIGNUM_DTOA_SHORTEST, - // Return a fixed number of digits after the decimal point. - // For instance fixed(0.1, 4) becomes 0.1000 - // If the input number is big, the output will be big. - BIGNUM_DTOA_FIXED, - // Return a fixed number of digits, no matter what the exponent is. - BIGNUM_DTOA_PRECISION -}; - -// Converts the given double 'v' to ascii. -// The result should be interpreted as buffer * 10^(point-length). -// The buffer will be null-terminated. -// -// The input v must be > 0 and different from NaN, and Infinity. -// -// The output depends on the given mode: -// - SHORTEST: produce the least amount of digits for which the internal -// identity requirement is still satisfied. If the digits are printed -// (together with the correct exponent) then reading this number will give -// 'v' again. The buffer will choose the representation that is closest to -// 'v'. If there are two at the same distance, than the number is round up. -// In this mode the 'requested_digits' parameter is ignored. -// - FIXED: produces digits necessary to print a given number with -// 'requested_digits' digits after the decimal point. The produced digits -// might be too short in which case the caller has to fill the gaps with '0's. -// Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. -// Halfway cases are rounded up. The call toFixed(0.15, 2) thus returns -// buffer="2", point=0. -// Note: the length of the returned buffer has no meaning wrt the significance -// of its digits. That is, just because it contains '0's does not mean that -// any other digit would not satisfy the internal identity requirement. -// - PRECISION: produces 'requested_digits' where the first digit is not '0'. -// Even though the length of produced digits usually equals -// 'requested_digits', the function is allowed to return fewer digits, in -// which case the caller has to fill the missing digits with '0's. -// Halfway cases are again rounded up. -// 'BignumDtoa' expects the given buffer to be big enough to hold all digits -// and a terminating null-character. -void BignumDtoa(double v, - BignumDtoaMode mode, - int requested_digits, - Vector buffer, - int* length, - int* point); - -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_BIGNUM_DTOA_H_ diff --git a/sky/engine/wtf/dtoa/bignum.cc b/sky/engine/wtf/dtoa/bignum.cc deleted file mode 100644 index 095109c36dd2d..0000000000000 --- a/sky/engine/wtf/dtoa/bignum.cc +++ /dev/null @@ -1,766 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "flutter/sky/engine/wtf/dtoa/bignum.h" -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -Bignum::Bignum() - : bigits_(bigits_buffer_, kBigitCapacity), used_digits_(0), exponent_(0) { - for (int i = 0; i < kBigitCapacity; ++i) { - bigits_[i] = 0; - } -} - -template -static int BitSize(S value) { - return 8 * sizeof(value); -} - -// Guaranteed to lie in one Bigit. -void Bignum::AssignUInt16(uint16_t value) { - ASSERT(kBigitSize >= BitSize(value)); - Zero(); - if (value == 0) - return; - - EnsureCapacity(1); - bigits_[0] = value; - used_digits_ = 1; -} - -void Bignum::AssignUInt64(uint64_t value) { - const int kUInt64Size = 64; - - Zero(); - if (value == 0) - return; - - int needed_bigits = kUInt64Size / kBigitSize + 1; - EnsureCapacity(needed_bigits); - for (int i = 0; i < needed_bigits; ++i) { - bigits_[i] = (uint32_t)value & kBigitMask; - value = value >> kBigitSize; - } - used_digits_ = needed_bigits; - Clamp(); -} - -void Bignum::AssignBignum(const Bignum& other) { - exponent_ = other.exponent_; - for (int i = 0; i < other.used_digits_; ++i) { - bigits_[i] = other.bigits_[i]; - } - // Clear the excess digits (if there were any). - for (int i = other.used_digits_; i < used_digits_; ++i) { - bigits_[i] = 0; - } - used_digits_ = other.used_digits_; -} - -static uint64_t ReadUInt64(Vector buffer, - int from, - int digits_to_read) { - uint64_t result = 0; - for (int i = from; i < from + digits_to_read; ++i) { - int digit = buffer[i] - '0'; - ASSERT(0 <= digit && digit <= 9); - result = result * 10 + digit; - } - return result; -} - -void Bignum::AssignDecimalString(Vector value) { - // 2^64 = 18446744073709551616 > 10^19 - const int kMaxUint64DecimalDigits = 19; - Zero(); - int length = value.length(); - int pos = 0; - // Let's just say that each digit needs 4 bits. - while (length >= kMaxUint64DecimalDigits) { - uint64_t digits = ReadUInt64(value, pos, kMaxUint64DecimalDigits); - pos += kMaxUint64DecimalDigits; - length -= kMaxUint64DecimalDigits; - MultiplyByPowerOfTen(kMaxUint64DecimalDigits); - AddUInt64(digits); - } - uint64_t digits = ReadUInt64(value, pos, length); - MultiplyByPowerOfTen(length); - AddUInt64(digits); - Clamp(); -} - -static int HexCharValue(char c) { - if ('0' <= c && c <= '9') - return c - '0'; - if ('a' <= c && c <= 'f') - return 10 + c - 'a'; - if ('A' <= c && c <= 'F') - return 10 + c - 'A'; - UNREACHABLE(); - return 0; // To make compiler happy. -} - -void Bignum::AssignHexString(Vector value) { - Zero(); - int length = value.length(); - - int needed_bigits = length * 4 / kBigitSize + 1; - EnsureCapacity(needed_bigits); - int string_index = length - 1; - for (int i = 0; i < needed_bigits - 1; ++i) { - // These bigits are guaranteed to be "full". - Chunk current_bigit = 0; - for (int j = 0; j < kBigitSize / 4; j++) { - current_bigit += HexCharValue(value[string_index--]) << (j * 4); - } - bigits_[i] = current_bigit; - } - used_digits_ = needed_bigits - 1; - - Chunk most_significant_bigit = 0; // Could be = 0; - for (int j = 0; j <= string_index; ++j) { - most_significant_bigit <<= 4; - most_significant_bigit += HexCharValue(value[j]); - } - if (most_significant_bigit != 0) { - bigits_[used_digits_] = most_significant_bigit; - used_digits_++; - } - Clamp(); -} - -void Bignum::AddUInt64(uint64_t operand) { - if (operand == 0) - return; - Bignum other; - other.AssignUInt64(operand); - AddBignum(other); -} - -void Bignum::AddBignum(const Bignum& other) { - ASSERT(IsClamped()); - ASSERT(other.IsClamped()); - - // If this has a greater exponent than other append zero-bigits to this. - // After this call exponent_ <= other.exponent_. - Align(other); - - // There are two possibilities: - // aaaaaaaaaaa 0000 (where the 0s represent a's exponent) - // bbbbb 00000000 - // ---------------- - // ccccccccccc 0000 - // or - // aaaaaaaaaa 0000 - // bbbbbbbbb 0000000 - // ----------------- - // cccccccccccc 0000 - // In both cases we might need a carry bigit. - - EnsureCapacity(1 + Max(BigitLength(), other.BigitLength()) - exponent_); - Chunk carry = 0; - int bigit_pos = other.exponent_ - exponent_; - ASSERT(bigit_pos >= 0); - for (int i = 0; i < other.used_digits_; ++i) { - Chunk sum = bigits_[bigit_pos] + other.bigits_[i] + carry; - bigits_[bigit_pos] = sum & kBigitMask; - carry = sum >> kBigitSize; - bigit_pos++; - } - - while (carry != 0) { - Chunk sum = bigits_[bigit_pos] + carry; - bigits_[bigit_pos] = sum & kBigitMask; - carry = sum >> kBigitSize; - bigit_pos++; - } - used_digits_ = Max(bigit_pos, used_digits_); - ASSERT(IsClamped()); -} - -void Bignum::SubtractBignum(const Bignum& other) { - ASSERT(IsClamped()); - ASSERT(other.IsClamped()); - // We require this to be bigger than other. - ASSERT(LessEqual(other, *this)); - - Align(other); - - int offset = other.exponent_ - exponent_; - Chunk borrow = 0; - int i; - for (i = 0; i < other.used_digits_; ++i) { - ASSERT((borrow == 0) || (borrow == 1)); - Chunk difference = bigits_[i + offset] - other.bigits_[i] - borrow; - bigits_[i + offset] = difference & kBigitMask; - borrow = difference >> (kChunkSize - 1); - } - while (borrow != 0) { - Chunk difference = bigits_[i + offset] - borrow; - bigits_[i + offset] = difference & kBigitMask; - borrow = difference >> (kChunkSize - 1); - ++i; - } - Clamp(); -} - -void Bignum::Shifxleft(int shift_amount) { - if (used_digits_ == 0) - return; - exponent_ += shift_amount / kBigitSize; - int local_shift = shift_amount % kBigitSize; - EnsureCapacity(used_digits_ + 1); - BigitsShifxleft(local_shift); -} - -void Bignum::MultiplyByUInt32(uint32_t factor) { - if (factor == 1) - return; - if (factor == 0) { - Zero(); - return; - } - if (used_digits_ == 0) - return; - - // The product of a bigit with the factor is of size kBigitSize + 32. - // Assert that this number + 1 (for the carry) fits into double chunk. - ASSERT(kDoubleChunkSize >= kBigitSize + 32 + 1); - DoubleChunk carry = 0; - for (int i = 0; i < used_digits_; ++i) { - DoubleChunk product = static_cast(factor) * bigits_[i] + carry; - bigits_[i] = static_cast(product & kBigitMask); - carry = (product >> kBigitSize); - } - while (carry != 0) { - EnsureCapacity(used_digits_ + 1); - bigits_[used_digits_] = (uint32_t)carry & kBigitMask; - used_digits_++; - carry >>= kBigitSize; - } -} - -void Bignum::MultiplyByUInt64(uint64_t factor) { - if (factor == 1) - return; - if (factor == 0) { - Zero(); - return; - } - ASSERT(kBigitSize < 32); - uint64_t carry = 0; - uint64_t low = factor & 0xFFFFFFFF; - uint64_t high = factor >> 32; - for (int i = 0; i < used_digits_; ++i) { - uint64_t product_low = low * bigits_[i]; - uint64_t product_high = high * bigits_[i]; - uint64_t tmp = (carry & kBigitMask) + product_low; - bigits_[i] = (uint32_t)tmp & kBigitMask; - carry = (carry >> kBigitSize) + (tmp >> kBigitSize) + - (product_high << (32 - kBigitSize)); - } - while (carry != 0) { - EnsureCapacity(used_digits_ + 1); - bigits_[used_digits_] = (uint32_t)carry & kBigitMask; - used_digits_++; - carry >>= kBigitSize; - } -} - -void Bignum::MultiplyByPowerOfTen(int exponent) { - const uint64_t kFive27 = UINT64_2PART_C(0x6765c793, fa10079d); - const uint16_t kFive1 = 5; - const uint16_t kFive2 = kFive1 * 5; - const uint16_t kFive3 = kFive2 * 5; - const uint16_t kFive4 = kFive3 * 5; - const uint16_t kFive5 = kFive4 * 5; - const uint16_t kFive6 = kFive5 * 5; - const uint32_t kFive7 = kFive6 * 5; - const uint32_t kFive8 = kFive7 * 5; - const uint32_t kFive9 = kFive8 * 5; - const uint32_t kFive10 = kFive9 * 5; - const uint32_t kFive11 = kFive10 * 5; - const uint32_t kFive12 = kFive11 * 5; - const uint32_t kFive13 = kFive12 * 5; - const uint32_t kFive1_to_12[] = {kFive1, kFive2, kFive3, kFive4, - kFive5, kFive6, kFive7, kFive8, - kFive9, kFive10, kFive11, kFive12}; - - ASSERT(exponent >= 0); - if (exponent == 0) - return; - if (used_digits_ == 0) - return; - - // We shift by exponent at the end just before returning. - int remaining_exponent = exponent; - while (remaining_exponent >= 27) { - MultiplyByUInt64(kFive27); - remaining_exponent -= 27; - } - while (remaining_exponent >= 13) { - MultiplyByUInt32(kFive13); - remaining_exponent -= 13; - } - if (remaining_exponent > 0) { - MultiplyByUInt32(kFive1_to_12[remaining_exponent - 1]); - } - Shifxleft(exponent); -} - -void Bignum::Square() { - ASSERT(IsClamped()); - int product_length = 2 * used_digits_; - EnsureCapacity(product_length); - - // Comba multiplication: compute each column separately. - // Example: r = a2a1a0 * b2b1b0. - // r = 1 * a0b0 + - // 10 * (a1b0 + a0b1) + - // 100 * (a2b0 + a1b1 + a0b2) + - // 1000 * (a2b1 + a1b2) + - // 10000 * a2b2 - // - // In the worst case we have to accumulate nb-digits products of digit*digit. - // - // Assert that the additional number of bits in a DoubleChunk are enough to - // sum up used_digits of Bigit*Bigit. - if ((1 << (2 * (kChunkSize - kBigitSize))) <= used_digits_) { - UNIMPLEMENTED(); - } - DoubleChunk accumulator = 0; - // First shift the digits so we don't overwrite them. - int copy_offset = used_digits_; - for (int i = 0; i < used_digits_; ++i) { - bigits_[copy_offset + i] = bigits_[i]; - } - // We have two loops to avoid some 'if's in the loop. - for (int i = 0; i < used_digits_; ++i) { - // Process temporary digit i with power i. - // The sum of the two indices must be equal to i. - int bigit_index1 = i; - int bigit_index2 = 0; - // Sum all of the sub-products. - while (bigit_index1 >= 0) { - Chunk chunk1 = bigits_[copy_offset + bigit_index1]; - Chunk chunk2 = bigits_[copy_offset + bigit_index2]; - accumulator += static_cast(chunk1) * chunk2; - bigit_index1--; - bigit_index2++; - } - bigits_[i] = static_cast(accumulator) & kBigitMask; - accumulator >>= kBigitSize; - } - for (int i = used_digits_; i < product_length; ++i) { - int bigit_index1 = used_digits_ - 1; - int bigit_index2 = i - bigit_index1; - // Invariant: sum of both indices is again equal to i. - // Inner loop runs 0 times on last iteration, emptying accumulator. - while (bigit_index2 < used_digits_) { - Chunk chunk1 = bigits_[copy_offset + bigit_index1]; - Chunk chunk2 = bigits_[copy_offset + bigit_index2]; - accumulator += static_cast(chunk1) * chunk2; - bigit_index1--; - bigit_index2++; - } - // The overwritten bigits_[i] will never be read in further loop iterations, - // because bigit_index1 and bigit_index2 are always greater - // than i - used_digits_. - bigits_[i] = static_cast(accumulator) & kBigitMask; - accumulator >>= kBigitSize; - } - // Since the result was guaranteed to lie inside the number the - // accumulator must be 0 now. - ASSERT(accumulator == 0); - - // Don't forget to update the used_digits and the exponent. - used_digits_ = product_length; - exponent_ *= 2; - Clamp(); -} - -void Bignum::AssignPowerUInt16(uint16_t base, int power_exponent) { - ASSERT(base != 0); - ASSERT(power_exponent >= 0); - if (power_exponent == 0) { - AssignUInt16(1); - return; - } - Zero(); - int shifts = 0; - // We expect base to be in range 2-32, and most often to be 10. - // It does not make much sense to implement different algorithms for counting - // the bits. - while ((base & 1) == 0) { - base >>= 1; - shifts++; - } - int bit_size = 0; - int tmp_base = base; - while (tmp_base != 0) { - tmp_base >>= 1; - bit_size++; - } - int final_size = bit_size * power_exponent; - // 1 extra bigit for the shifting, and one for rounded final_size. - EnsureCapacity(final_size / kBigitSize + 2); - - // Left to Right exponentiation. - int mask = 1; - while (power_exponent >= mask) - mask <<= 1; - - // The mask is now pointing to the bit above the most significant 1-bit of - // power_exponent. - // Get rid of first 1-bit; - mask >>= 2; - uint64_t this_value = base; - - bool delayed_multipliciation = false; - const uint64_t max_32bits = 0xFFFFFFFF; - while (mask != 0 && this_value <= max_32bits) { - this_value = this_value * this_value; - // Verify that there is enough space in this_value to perform the - // multiplication. The first bit_size bits must be 0. - if ((power_exponent & mask) != 0) { - uint64_t base_bits_mask = - ~((static_cast(1) << (64 - bit_size)) - 1); - bool high_bits_zero = (this_value & base_bits_mask) == 0; - if (high_bits_zero) { - this_value *= base; - } else { - delayed_multipliciation = true; - } - } - mask >>= 1; - } - AssignUInt64(this_value); - if (delayed_multipliciation) { - MultiplyByUInt32(base); - } - - // Now do the same thing as a bignum. - while (mask != 0) { - Square(); - if ((power_exponent & mask) != 0) { - MultiplyByUInt32(base); - } - mask >>= 1; - } - - // And finally add the saved shifts. - Shifxleft(shifts * power_exponent); -} - -// Precondition: this/other < 16bit. -uint16_t Bignum::DivideModuloIntBignum(const Bignum& other) { - ASSERT(IsClamped()); - ASSERT(other.IsClamped()); - ASSERT(other.used_digits_ > 0); - - // Easy case: if we have less digits than the divisor than the result is 0. - // Note: this handles the case where this == 0, too. - if (BigitLength() < other.BigitLength()) { - return 0; - } - - Align(other); - - uint16_t result = 0; - - // Start by removing multiples of 'other' until both numbers have the same - // number of digits. - while (BigitLength() > other.BigitLength()) { - // This naive approach is extremely inefficient if the this divided other - // might be big. This function is implemented for doubleToString where - // the result should be small (less than 10). - ASSERT(other.bigits_[other.used_digits_ - 1] >= ((1 << kBigitSize) / 16)); - // Remove the multiples of the first digit. - // Example this = 23 and other equals 9. -> Remove 2 multiples. - result += bigits_[used_digits_ - 1]; - SubtractTimes(other, bigits_[used_digits_ - 1]); - } - - ASSERT(BigitLength() == other.BigitLength()); - - // Both bignums are at the same length now. - // Since other has more than 0 digits we know that the access to - // bigits_[used_digits_ - 1] is safe. - Chunk this_bigit = bigits_[used_digits_ - 1]; - Chunk other_bigit = other.bigits_[other.used_digits_ - 1]; - - if (other.used_digits_ == 1) { - // Shortcut for easy (and common) case. - int quotient = this_bigit / other_bigit; - bigits_[used_digits_ - 1] = this_bigit - other_bigit * quotient; - result += quotient; - Clamp(); - return result; - } - - int division_estimate = this_bigit / (other_bigit + 1); - result += division_estimate; - SubtractTimes(other, division_estimate); - - if (other_bigit * (division_estimate + 1) > this_bigit) { - // No need to even try to subtract. Even if other's remaining digits were 0 - // another subtraction would be too much. - return result; - } - - while (LessEqual(other, *this)) { - SubtractBignum(other); - result++; - } - return result; -} - -template -static int SizeInHexChars(S number) { - ASSERT(number > 0); - int result = 0; - while (number != 0) { - number >>= 4; - result++; - } - return result; -} - -static char HexCharOfValue(int value) { - ASSERT(0 <= value && value <= 16); - if (value < 10) - return value + '0'; - return value - 10 + 'A'; -} - -bool Bignum::ToHexString(char* buffer, int buffer_size) const { - ASSERT(IsClamped()); - // Each bigit must be printable as separate hex-character. - ASSERT(kBigitSize % 4 == 0); - const int kHexCharsPerBigit = kBigitSize / 4; - - if (used_digits_ == 0) { - if (buffer_size < 2) - return false; - buffer[0] = '0'; - buffer[1] = '\0'; - return true; - } - // We add 1 for the terminating '\0' character. - int needed_chars = (BigitLength() - 1) * kHexCharsPerBigit + - SizeInHexChars(bigits_[used_digits_ - 1]) + 1; - if (needed_chars > buffer_size) - return false; - int string_index = needed_chars - 1; - buffer[string_index--] = '\0'; - for (int i = 0; i < exponent_; ++i) { - for (int j = 0; j < kHexCharsPerBigit; ++j) { - buffer[string_index--] = '0'; - } - } - for (int i = 0; i < used_digits_ - 1; ++i) { - Chunk current_bigit = bigits_[i]; - for (int j = 0; j < kHexCharsPerBigit; ++j) { - buffer[string_index--] = HexCharOfValue(current_bigit & 0xF); - current_bigit >>= 4; - } - } - // And finally the last bigit. - Chunk most_significant_bigit = bigits_[used_digits_ - 1]; - while (most_significant_bigit != 0) { - buffer[string_index--] = HexCharOfValue(most_significant_bigit & 0xF); - most_significant_bigit >>= 4; - } - return true; -} - -Bignum::Chunk Bignum::BigitAt(int index) const { - if (index >= BigitLength()) - return 0; - if (index < exponent_) - return 0; - return bigits_[index - exponent_]; -} - -int Bignum::Compare(const Bignum& a, const Bignum& b) { - ASSERT(a.IsClamped()); - ASSERT(b.IsClamped()); - int bigit_length_a = a.BigitLength(); - int bigit_length_b = b.BigitLength(); - if (bigit_length_a < bigit_length_b) - return -1; - if (bigit_length_a > bigit_length_b) - return +1; - for (int i = bigit_length_a - 1; i >= Min(a.exponent_, b.exponent_); --i) { - Chunk bigit_a = a.BigitAt(i); - Chunk bigit_b = b.BigitAt(i); - if (bigit_a < bigit_b) - return -1; - if (bigit_a > bigit_b) - return +1; - // Otherwise they are equal up to this digit. Try the next digit. - } - return 0; -} - -int Bignum::PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c) { - ASSERT(a.IsClamped()); - ASSERT(b.IsClamped()); - ASSERT(c.IsClamped()); - if (a.BigitLength() < b.BigitLength()) { - return PlusCompare(b, a, c); - } - if (a.BigitLength() + 1 < c.BigitLength()) - return -1; - if (a.BigitLength() > c.BigitLength()) - return +1; - // The exponent encodes 0-bigits. So if there are more 0-digits in 'a' than - // 'b' has digits, then the bigit-length of 'a'+'b' must be equal to the one - // of 'a'. - if (a.exponent_ >= b.BigitLength() && a.BigitLength() < c.BigitLength()) { - return -1; - } - - Chunk borrow = 0; - // Starting at min_exponent all digits are == 0. So no need to compare them. - int min_exponent = Min(Min(a.exponent_, b.exponent_), c.exponent_); - for (int i = c.BigitLength() - 1; i >= min_exponent; --i) { - Chunk chunk_a = a.BigitAt(i); - Chunk chunk_b = b.BigitAt(i); - Chunk chunk_c = c.BigitAt(i); - Chunk sum = chunk_a + chunk_b; - if (sum > chunk_c + borrow) { - return +1; - } else { - borrow = chunk_c + borrow - sum; - if (borrow > 1) - return -1; - borrow <<= kBigitSize; - } - } - if (borrow == 0) - return 0; - return -1; -} - -void Bignum::Clamp() { - while (used_digits_ > 0 && bigits_[used_digits_ - 1] == 0) { - used_digits_--; - } - if (used_digits_ == 0) { - // Zero. - exponent_ = 0; - } -} - -bool Bignum::IsClamped() const { - return used_digits_ == 0 || bigits_[used_digits_ - 1] != 0; -} - -void Bignum::Zero() { - for (int i = 0; i < used_digits_; ++i) { - bigits_[i] = 0; - } - used_digits_ = 0; - exponent_ = 0; -} - -void Bignum::Align(const Bignum& other) { - if (exponent_ > other.exponent_) { - // If "X" represents a "hidden" digit (by the exponent) then we are in the - // following case (a == this, b == other): - // a: aaaaaaXXXX or a: aaaaaXXX - // b: bbbbbbX b: bbbbbbbbXX - // We replace some of the hidden digits (X) of a with 0 digits. - // a: aaaaaa000X or a: aaaaa0XX - int zero_digits = exponent_ - other.exponent_; - EnsureCapacity(used_digits_ + zero_digits); - for (int i = used_digits_ - 1; i >= 0; --i) { - bigits_[i + zero_digits] = bigits_[i]; - } - for (int i = 0; i < zero_digits; ++i) { - bigits_[i] = 0; - } - used_digits_ += zero_digits; - exponent_ -= zero_digits; - ASSERT(used_digits_ >= 0); - ASSERT(exponent_ >= 0); - } -} - -void Bignum::BigitsShifxleft(int shift_amount) { - ASSERT(shift_amount < kBigitSize); - ASSERT(shift_amount >= 0); - Chunk carry = 0; - for (int i = 0; i < used_digits_; ++i) { - Chunk new_carry = bigits_[i] >> (kBigitSize - shift_amount); - bigits_[i] = ((bigits_[i] << shift_amount) + carry) & kBigitMask; - carry = new_carry; - } - if (carry != 0) { - bigits_[used_digits_] = carry; - used_digits_++; - } -} - -void Bignum::SubtractTimes(const Bignum& other, int factor) { - ASSERT(exponent_ <= other.exponent_); - if (factor < 3) { - for (int i = 0; i < factor; ++i) { - SubtractBignum(other); - } - return; - } - Chunk borrow = 0; - int exponent_diff = other.exponent_ - exponent_; - for (int i = 0; i < other.used_digits_; ++i) { - DoubleChunk product = static_cast(factor) * other.bigits_[i]; - DoubleChunk remove = borrow + product; - Chunk difference = - bigits_[i + exponent_diff] - ((uint32_t)remove & kBigitMask); - bigits_[i + exponent_diff] = difference & kBigitMask; - borrow = static_cast((difference >> (kChunkSize - 1)) + - (remove >> kBigitSize)); - } - for (int i = other.used_digits_ + exponent_diff; i < used_digits_; ++i) { - if (borrow == 0) - return; - Chunk difference = bigits_[i] - borrow; - bigits_[i] = difference & kBigitMask; - borrow = difference >> (kChunkSize - 1); - ++i; - } - Clamp(); -} - -} // namespace double_conversion - -} // namespace WTF diff --git a/sky/engine/wtf/dtoa/bignum.h b/sky/engine/wtf/dtoa/bignum.h deleted file mode 100644 index f12728b342d55..0000000000000 --- a/sky/engine/wtf/dtoa/bignum.h +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_BIGNUM_H_ -#define SKY_ENGINE_WTF_DTOA_BIGNUM_H_ - -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -class Bignum { - public: - // 3584 = 128 * 28. We can represent 2^3584 > 10^1000 accurately. - // This bignum can encode much bigger numbers, since it contains an - // exponent. - static const int kMaxSignificantBits = 3584; - - Bignum(); - void AssignUInt16(uint16_t value); - void AssignUInt64(uint64_t value); - void AssignBignum(const Bignum& other); - - void AssignDecimalString(Vector value); - void AssignHexString(Vector value); - - void AssignPowerUInt16(uint16_t base, int exponent); - - void AddUInt16(uint16_t operand); - void AddUInt64(uint64_t operand); - void AddBignum(const Bignum& other); - // Precondition: this >= other. - void SubtractBignum(const Bignum& other); - - void Square(); - void Shifxleft(int shift_amount); - void MultiplyByUInt32(uint32_t factor); - void MultiplyByUInt64(uint64_t factor); - void MultiplyByPowerOfTen(int exponent); - void Times10() { return MultiplyByUInt32(10); } - // Pseudocode: - // int result = this / other; - // this = this % other; - // In the worst case this function is in O(this/other). - uint16_t DivideModuloIntBignum(const Bignum& other); - - bool ToHexString(char* buffer, int buffer_size) const; - - static int Compare(const Bignum& a, const Bignum& b); - static bool Equal(const Bignum& a, const Bignum& b) { - return Compare(a, b) == 0; - } - static bool LessEqual(const Bignum& a, const Bignum& b) { - return Compare(a, b) <= 0; - } - static bool Less(const Bignum& a, const Bignum& b) { - return Compare(a, b) < 0; - } - // Returns Compare(a + b, c); - static int PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c); - // Returns a + b == c - static bool PlusEqual(const Bignum& a, const Bignum& b, const Bignum& c) { - return PlusCompare(a, b, c) == 0; - } - // Returns a + b <= c - static bool PlusLessEqual(const Bignum& a, const Bignum& b, const Bignum& c) { - return PlusCompare(a, b, c) <= 0; - } - // Returns a + b < c - static bool PlusLess(const Bignum& a, const Bignum& b, const Bignum& c) { - return PlusCompare(a, b, c) < 0; - } - - private: - typedef uint32_t Chunk; - typedef uint64_t DoubleChunk; - - static const int kChunkSize = sizeof(Chunk) * 8; - static const int kDoubleChunkSize = sizeof(DoubleChunk) * 8; - // With bigit size of 28 we loose some bits, but a double still fits easily - // into two chunks, and more importantly we can use the Comba multiplication. - static const int kBigitSize = 28; - static const Chunk kBigitMask = (1 << kBigitSize) - 1; - // Every instance allocates kBigitLength chunks on the stack. Bignums cannot - // grow. There are no checks if the stack-allocated space is sufficient. - static const int kBigitCapacity = kMaxSignificantBits / kBigitSize; - - void EnsureCapacity(int size) { - if (size > kBigitCapacity) { - UNREACHABLE(); - } - } - void Align(const Bignum& other); - void Clamp(); - bool IsClamped() const; - void Zero(); - // Requires this to have enough capacity (no tests done). - // Updates used_digits_ if necessary. - // shift_amount must be < kBigitSize. - void BigitsShifxleft(int shift_amount); - // BigitLength includes the "hidden" digits encoded in the exponent. - int BigitLength() const { return used_digits_ + exponent_; } - Chunk BigitAt(int index) const; - void SubtractTimes(const Bignum& other, int factor); - - Chunk bigits_buffer_[kBigitCapacity]; - // A vector backed by bigits_buffer_. This way accesses to the array are - // checked for out-of-bounds errors. - Vector bigits_; - int used_digits_; - // The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize). - int exponent_; - - FXL_DISALLOW_COPY_AND_ASSIGN(Bignum); -}; - -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_BIGNUM_H_ diff --git a/sky/engine/wtf/dtoa/cached-powers.cc b/sky/engine/wtf/dtoa/cached-powers.cc deleted file mode 100644 index b3d490fdb5e95..0000000000000 --- a/sky/engine/wtf/dtoa/cached-powers.cc +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 2006-2008 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - -#include "cached-powers.h" -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -struct CachedPower { - uint64_t significand; - int16_t binary_exponent; - int16_t decimal_exponent; -}; - -static const double kD_1_LOG2_10 = 0.30102999566398114; // 1 / lg(10) -static const CachedPower kCachedPowers[] = { - {UINT64_2PART_C(0xfa8fd5a0, 081c0288), -1220, -348}, - {UINT64_2PART_C(0xbaaee17f, a23ebf76), -1193, -340}, - {UINT64_2PART_C(0x8b16fb20, 3055ac76), -1166, -332}, - {UINT64_2PART_C(0xcf42894a, 5dce35ea), -1140, -324}, - {UINT64_2PART_C(0x9a6bb0aa, 55653b2d), -1113, -316}, - {UINT64_2PART_C(0xe61acf03, 3d1a45df), -1087, -308}, - {UINT64_2PART_C(0xab70fe17, c79ac6ca), -1060, -300}, - {UINT64_2PART_C(0xff77b1fc, bebcdc4f), -1034, -292}, - {UINT64_2PART_C(0xbe5691ef, 416bd60c), -1007, -284}, - {UINT64_2PART_C(0x8dd01fad, 907ffc3c), -980, -276}, - {UINT64_2PART_C(0xd3515c28, 31559a83), -954, -268}, - {UINT64_2PART_C(0x9d71ac8f, ada6c9b5), -927, -260}, - {UINT64_2PART_C(0xea9c2277, 23ee8bcb), -901, -252}, - {UINT64_2PART_C(0xaecc4991, 4078536d), -874, -244}, - {UINT64_2PART_C(0x823c1279, 5db6ce57), -847, -236}, - {UINT64_2PART_C(0xc2109436, 4dfb5637), -821, -228}, - {UINT64_2PART_C(0x9096ea6f, 3848984f), -794, -220}, - {UINT64_2PART_C(0xd77485cb, 25823ac7), -768, -212}, - {UINT64_2PART_C(0xa086cfcd, 97bf97f4), -741, -204}, - {UINT64_2PART_C(0xef340a98, 172aace5), -715, -196}, - {UINT64_2PART_C(0xb23867fb, 2a35b28e), -688, -188}, - {UINT64_2PART_C(0x84c8d4df, d2c63f3b), -661, -180}, - {UINT64_2PART_C(0xc5dd4427, 1ad3cdba), -635, -172}, - {UINT64_2PART_C(0x936b9fce, bb25c996), -608, -164}, - {UINT64_2PART_C(0xdbac6c24, 7d62a584), -582, -156}, - {UINT64_2PART_C(0xa3ab6658, 0d5fdaf6), -555, -148}, - {UINT64_2PART_C(0xf3e2f893, dec3f126), -529, -140}, - {UINT64_2PART_C(0xb5b5ada8, aaff80b8), -502, -132}, - {UINT64_2PART_C(0x87625f05, 6c7c4a8b), -475, -124}, - {UINT64_2PART_C(0xc9bcff60, 34c13053), -449, -116}, - {UINT64_2PART_C(0x964e858c, 91ba2655), -422, -108}, - {UINT64_2PART_C(0xdff97724, 70297ebd), -396, -100}, - {UINT64_2PART_C(0xa6dfbd9f, b8e5b88f), -369, -92}, - {UINT64_2PART_C(0xf8a95fcf, 88747d94), -343, -84}, - {UINT64_2PART_C(0xb9447093, 8fa89bcf), -316, -76}, - {UINT64_2PART_C(0x8a08f0f8, bf0f156b), -289, -68}, - {UINT64_2PART_C(0xcdb02555, 653131b6), -263, -60}, - {UINT64_2PART_C(0x993fe2c6, d07b7fac), -236, -52}, - {UINT64_2PART_C(0xe45c10c4, 2a2b3b06), -210, -44}, - {UINT64_2PART_C(0xaa242499, 697392d3), -183, -36}, - {UINT64_2PART_C(0xfd87b5f2, 8300ca0e), -157, -28}, - {UINT64_2PART_C(0xbce50864, 92111aeb), -130, -20}, - {UINT64_2PART_C(0x8cbccc09, 6f5088cc), -103, -12}, - {UINT64_2PART_C(0xd1b71758, e219652c), -77, -4}, - {UINT64_2PART_C(0x9c400000, 00000000), -50, 4}, - {UINT64_2PART_C(0xe8d4a510, 00000000), -24, 12}, - {UINT64_2PART_C(0xad78ebc5, ac620000), 3, 20}, - {UINT64_2PART_C(0x813f3978, f8940984), 30, 28}, - {UINT64_2PART_C(0xc097ce7b, c90715b3), 56, 36}, - {UINT64_2PART_C(0x8f7e32ce, 7bea5c70), 83, 44}, - {UINT64_2PART_C(0xd5d238a4, abe98068), 109, 52}, - {UINT64_2PART_C(0x9f4f2726, 179a2245), 136, 60}, - {UINT64_2PART_C(0xed63a231, d4c4fb27), 162, 68}, - {UINT64_2PART_C(0xb0de6538, 8cc8ada8), 189, 76}, - {UINT64_2PART_C(0x83c7088e, 1aab65db), 216, 84}, - {UINT64_2PART_C(0xc45d1df9, 42711d9a), 242, 92}, - {UINT64_2PART_C(0x924d692c, a61be758), 269, 100}, - {UINT64_2PART_C(0xda01ee64, 1a708dea), 295, 108}, - {UINT64_2PART_C(0xa26da399, 9aef774a), 322, 116}, - {UINT64_2PART_C(0xf209787b, b47d6b85), 348, 124}, - {UINT64_2PART_C(0xb454e4a1, 79dd1877), 375, 132}, - {UINT64_2PART_C(0x865b8692, 5b9bc5c2), 402, 140}, - {UINT64_2PART_C(0xc83553c5, c8965d3d), 428, 148}, - {UINT64_2PART_C(0x952ab45c, fa97a0b3), 455, 156}, - {UINT64_2PART_C(0xde469fbd, 99a05fe3), 481, 164}, - {UINT64_2PART_C(0xa59bc234, db398c25), 508, 172}, - {UINT64_2PART_C(0xf6c69a72, a3989f5c), 534, 180}, - {UINT64_2PART_C(0xb7dcbf53, 54e9bece), 561, 188}, - {UINT64_2PART_C(0x88fcf317, f22241e2), 588, 196}, - {UINT64_2PART_C(0xcc20ce9b, d35c78a5), 614, 204}, - {UINT64_2PART_C(0x98165af3, 7b2153df), 641, 212}, - {UINT64_2PART_C(0xe2a0b5dc, 971f303a), 667, 220}, - {UINT64_2PART_C(0xa8d9d153, 5ce3b396), 694, 228}, - {UINT64_2PART_C(0xfb9b7cd9, a4a7443c), 720, 236}, - {UINT64_2PART_C(0xbb764c4c, a7a44410), 747, 244}, - {UINT64_2PART_C(0x8bab8eef, b6409c1a), 774, 252}, - {UINT64_2PART_C(0xd01fef10, a657842c), 800, 260}, - {UINT64_2PART_C(0x9b10a4e5, e9913129), 827, 268}, - {UINT64_2PART_C(0xe7109bfb, a19c0c9d), 853, 276}, - {UINT64_2PART_C(0xac2820d9, 623bf429), 880, 284}, - {UINT64_2PART_C(0x80444b5e, 7aa7cf85), 907, 292}, - {UINT64_2PART_C(0xbf21e440, 03acdd2d), 933, 300}, - {UINT64_2PART_C(0x8e679c2f, 5e44ff8f), 960, 308}, - {UINT64_2PART_C(0xd433179d, 9c8cb841), 986, 316}, - {UINT64_2PART_C(0x9e19db92, b4e31ba9), 1013, 324}, - {UINT64_2PART_C(0xeb96bf6e, badf77d9), 1039, 332}, - {UINT64_2PART_C(0xaf87023b, 9bf0ee6b), 1066, 340}, -}; -static const int kCachedPowersOffset = - 348; // -kCachedPowers[0].decimal_exponent - -const int PowersOfTenCache::kDecimalExponentDistance = - 8; // kCachedPowers[1].decimal_exponent - kCachedPowers[0].decimal_exponent -const int PowersOfTenCache::kMinDecimalExponent = - -348; // kCachedPowers[0].decimal_exponent -const int PowersOfTenCache::kMaxDecimalExponent = - 340; // kCachedPowers[kCachedPowersLength - 1].decimal_exponent - -#if ENABLE(ASSERT) -static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers); - -// Check that the static constants match the values in kCachedPowers. -static void validateStaticConstants() { - ASSERT(kCachedPowersOffset == -kCachedPowers[0].decimal_exponent); - ASSERT( - PowersOfTenCache::kDecimalExponentDistance == - (kCachedPowers[1].decimal_exponent - kCachedPowers[0].decimal_exponent)); - ASSERT(PowersOfTenCache::kMinDecimalExponent == - kCachedPowers[0].decimal_exponent); - ASSERT(PowersOfTenCache::kMaxDecimalExponent == - kCachedPowers[kCachedPowersLength - 1].decimal_exponent); -} -#endif - -void PowersOfTenCache::GetCachedPowerForBinaryExponentRange( - int min_exponent, - int max_exponent, - DiyFp* power, - int* decimal_exponent) { -#if ENABLE(ASSERT) - validateStaticConstants(); -#endif - int kQ = DiyFp::kSignificandSize; - double k = ceil((min_exponent + kQ - 1) * kD_1_LOG2_10); - int foo = kCachedPowersOffset; - int index = (foo + static_cast(k) - 1) / kDecimalExponentDistance + 1; - ASSERT(0 <= index && index < kCachedPowersLength); - CachedPower cached_power = kCachedPowers[index]; - ASSERT(min_exponent <= cached_power.binary_exponent); - ASSERT(cached_power.binary_exponent <= max_exponent); - *decimal_exponent = cached_power.decimal_exponent; - *power = DiyFp(cached_power.significand, cached_power.binary_exponent); -} - -void PowersOfTenCache::GetCachedPowerForDecimalExponent(int requested_exponent, - DiyFp* power, - int* found_exponent) { - ASSERT(kMinDecimalExponent <= requested_exponent); - ASSERT(requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance); -#if ENABLE(ASSERT) - validateStaticConstants(); -#endif - int index = - (requested_exponent + kCachedPowersOffset) / kDecimalExponentDistance; - CachedPower cached_power = kCachedPowers[index]; - *power = DiyFp(cached_power.significand, cached_power.binary_exponent); - *found_exponent = cached_power.decimal_exponent; - ASSERT(*found_exponent <= requested_exponent); - ASSERT(requested_exponent < *found_exponent + kDecimalExponentDistance); -} - -} // namespace double_conversion - -} // namespace WTF diff --git a/sky/engine/wtf/dtoa/cached-powers.h b/sky/engine/wtf/dtoa/cached-powers.h deleted file mode 100644 index 663fdaeb21df3..0000000000000 --- a/sky/engine/wtf/dtoa/cached-powers.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_CACHED_POWERS_H_ -#define SKY_ENGINE_WTF_DTOA_CACHED_POWERS_H_ - -#include "diy-fp.h" - -namespace WTF { - -namespace double_conversion { - -class PowersOfTenCache { - public: - // Not all powers of ten are cached. The decimal exponent of two neighboring - // cached numbers will differ by kDecimalExponentDistance. - static const int kDecimalExponentDistance; - - static const int kMinDecimalExponent; - static const int kMaxDecimalExponent; - - // Returns a cached power-of-ten with a binary exponent in the range - // [min_exponent; max_exponent] (boundaries included). - static void GetCachedPowerForBinaryExponentRange(int min_exponent, - int max_exponent, - DiyFp* power, - int* decimal_exponent); - - // Returns a cached power of ten x ~= 10^k such that - // k <= decimal_exponent < k + kCachedPowersDecimalDistance. - // The given decimal_exponent must satisfy - // kMinDecimalExponent <= requested_exponent, and - // requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance. - static void GetCachedPowerForDecimalExponent(int requested_exponent, - DiyFp* power, - int* found_exponent); -}; -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_CACHED_POWERS_H_ diff --git a/sky/engine/wtf/dtoa/diy-fp.cc b/sky/engine/wtf/dtoa/diy-fp.cc deleted file mode 100644 index ba9bd1081ab52..0000000000000 --- a/sky/engine/wtf/dtoa/diy-fp.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "diy-fp.h" -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -void DiyFp::Multiply(const DiyFp& other) { - // Simply "emulates" a 128 bit multiplication. - // However: the resulting number only contains 64 bits. The least - // significant 64 bits are only used for rounding the most significant 64 - // bits. - const uint64_t kM32 = 0xFFFFFFFFU; - uint64_t a = f_ >> 32; - uint64_t b = f_ & kM32; - uint64_t c = other.f_ >> 32; - uint64_t d = other.f_ & kM32; - uint64_t ac = a * c; - uint64_t bc = b * c; - uint64_t ad = a * d; - uint64_t bd = b * d; - uint64_t tmp = (bd >> 32) + (ad & kM32) + (bc & kM32); - // By adding 1U << 31 to tmp we round the final result. - // Halfway cases will be round up. - tmp += 1U << 31; - uint64_t result_f = ac + (ad >> 32) + (bc >> 32) + (tmp >> 32); - e_ += other.e_ + 64; - f_ = result_f; -} - -} // namespace double_conversion - -} // namespace WTF diff --git a/sky/engine/wtf/dtoa/diy-fp.h b/sky/engine/wtf/dtoa/diy-fp.h deleted file mode 100644 index 802c78e983725..0000000000000 --- a/sky/engine/wtf/dtoa/diy-fp.h +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_DIY_FP_H_ -#define SKY_ENGINE_WTF_DTOA_DIY_FP_H_ - -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -// This "Do It Yourself Floating Point" class implements a floating-point number -// with a uint64 significand and an int exponent. Normalized DiyFp numbers will -// have the most significant bit of the significand set. -// Multiplication and Subtraction do not normalize their results. -// DiyFp are not designed to contain special doubles (NaN and Infinity). -class DiyFp { - public: - static const int kSignificandSize = 64; - - DiyFp() : f_(0), e_(0) {} - DiyFp(uint64_t f, int e) : f_(f), e_(e) {} - - // this = this - other. - // The exponents of both numbers must be the same and the significand of this - // must be bigger than the significand of other. - // The result will not be normalized. - void Subtract(const DiyFp& other) { - ASSERT(e_ == other.e_); - ASSERT(f_ >= other.f_); - f_ -= other.f_; - } - - // Returns a - b. - // The exponents of both numbers must be the same and this must be bigger - // than other. The result will not be normalized. - static DiyFp Minus(const DiyFp& a, const DiyFp& b) { - DiyFp result = a; - result.Subtract(b); - return result; - } - - // this = this * other. - void Multiply(const DiyFp& other); - - // returns a * b; - static DiyFp Times(const DiyFp& a, const DiyFp& b) { - DiyFp result = a; - result.Multiply(b); - return result; - } - - void Normalize() { - ASSERT(f_ != 0); - uint64_t f = f_; - int e = e_; - - // This method is mainly called for normalizing boundaries. In general - // boundaries need to be shifted by 10 bits. We thus optimize for this case. - const uint64_t k10MSBits = UINT64_2PART_C(0xFFC00000, 00000000); - while ((f & k10MSBits) == 0) { - f <<= 10; - e -= 10; - } - while ((f & kUint64MSB) == 0) { - f <<= 1; - e--; - } - f_ = f; - e_ = e; - } - - static DiyFp Normalize(const DiyFp& a) { - DiyFp result = a; - result.Normalize(); - return result; - } - - uint64_t f() const { return f_; } - int e() const { return e_; } - - void set_f(uint64_t new_value) { f_ = new_value; } - void set_e(int new_value) { e_ = new_value; } - - private: - static const uint64_t kUint64MSB = UINT64_2PART_C(0x80000000, 00000000); - - uint64_t f_; - int e_; -}; - -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_DIY_FP_H_ diff --git a/sky/engine/wtf/dtoa/double-conversion.cc b/sky/engine/wtf/dtoa/double-conversion.cc deleted file mode 100644 index 8095ca0cde3c6..0000000000000 --- a/sky/engine/wtf/dtoa/double-conversion.cc +++ /dev/null @@ -1,595 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include "double-conversion.h" - -#include "bignum-dtoa.h" -#include "fast-dtoa.h" -#include "fixed-dtoa.h" -#include "flutter/sky/engine/wtf/dtoa/double.h" -#include "flutter/sky/engine/wtf/dtoa/strtod.h" -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -const DoubleToStringConverter& DoubleToStringConverter::EcmaScriptConverter() { - int flags = UNIQUE_ZERO | EMIT_POSITIVE_EXPONENT_SIGN; - static DoubleToStringConverter converter(flags, "Infinity", "NaN", 'e', -6, - 21, 6, 0); - return converter; -} - -bool DoubleToStringConverter::HandleSpecialValues( - double value, - StringBuilder* result_builder) const { - Double double_inspect(value); - if (double_inspect.IsInfinite()) { - if (infinity_symbol_ == NULL) - return false; - if (value < 0) { - result_builder->AddCharacter('-'); - } - result_builder->AddString(infinity_symbol_); - return true; - } - if (double_inspect.IsNan()) { - if (nan_symbol_ == NULL) - return false; - result_builder->AddString(nan_symbol_); - return true; - } - return false; -} - -void DoubleToStringConverter::CreateExponentialRepresentation( - const char* decimal_digits, - int length, - int exponent, - StringBuilder* result_builder) const { - ASSERT(length != 0); - result_builder->AddCharacter(decimal_digits[0]); - if (length != 1) { - result_builder->AddCharacter('.'); - result_builder->AddSubstring(&decimal_digits[1], length - 1); - } - result_builder->AddCharacter(exponent_character_); - if (exponent < 0) { - result_builder->AddCharacter('-'); - exponent = -exponent; - } else { - if ((flags_ & EMIT_POSITIVE_EXPONENT_SIGN) != 0) { - result_builder->AddCharacter('+'); - } - } - if (exponent == 0) { - result_builder->AddCharacter('0'); - return; - } - ASSERT(exponent < 1e4); - const int kMaxExponentLength = 5; - char buffer[kMaxExponentLength + 1]; - int first_char_pos = kMaxExponentLength; - buffer[first_char_pos] = '\0'; - while (exponent > 0) { - buffer[--first_char_pos] = '0' + (exponent % 10); - exponent /= 10; - } - result_builder->AddSubstring(&buffer[first_char_pos], - kMaxExponentLength - first_char_pos); -} - -void DoubleToStringConverter::CreateDecimalRepresentation( - const char* decimal_digits, - int length, - int decimal_point, - int digits_after_point, - StringBuilder* result_builder) const { - // Create a representation that is padded with zeros if needed. - if (decimal_point <= 0) { - // "0.00000decimal_rep". - result_builder->AddCharacter('0'); - if (digits_after_point > 0) { - result_builder->AddCharacter('.'); - result_builder->AddPadding('0', -decimal_point); - ASSERT(length <= digits_after_point - (-decimal_point)); - result_builder->AddSubstring(decimal_digits, length); - int remaining_digits = digits_after_point - (-decimal_point) - length; - result_builder->AddPadding('0', remaining_digits); - } - } else if (decimal_point >= length) { - // "decimal_rep0000.00000" or "decimal_rep.0000" - result_builder->AddSubstring(decimal_digits, length); - result_builder->AddPadding('0', decimal_point - length); - if (digits_after_point > 0) { - result_builder->AddCharacter('.'); - result_builder->AddPadding('0', digits_after_point); - } - } else { - // "decima.l_rep000" - ASSERT(digits_after_point > 0); - result_builder->AddSubstring(decimal_digits, decimal_point); - result_builder->AddCharacter('.'); - ASSERT(length - decimal_point <= digits_after_point); - result_builder->AddSubstring(&decimal_digits[decimal_point], - length - decimal_point); - int remaining_digits = digits_after_point - (length - decimal_point); - result_builder->AddPadding('0', remaining_digits); - } - if (digits_after_point == 0) { - if ((flags_ & EMIT_TRAILING_DECIMAL_POINT) != 0) { - result_builder->AddCharacter('.'); - } - if ((flags_ & EMIT_TRAILING_ZERO_AFTER_POINT) != 0) { - result_builder->AddCharacter('0'); - } - } -} - -bool DoubleToStringConverter::ToShortest(double value, - StringBuilder* result_builder) const { - if (Double(value).IsSpecial()) { - return HandleSpecialValues(value, result_builder); - } - - int decimal_point; - bool sign; - const int kDecimalRepCapacity = kBase10MaximalLength + 1; - char decimal_rep[kDecimalRepCapacity]; - int decimal_rep_length; - - DoubleToAscii(value, SHORTEST, 0, decimal_rep, kDecimalRepCapacity, &sign, - &decimal_rep_length, &decimal_point); - - bool unique_zero = (flags_ & UNIQUE_ZERO) != 0; - if (sign && (value != 0.0 || !unique_zero)) { - result_builder->AddCharacter('-'); - } - - int exponent = decimal_point - 1; - if ((decimal_in_shortest_low_ <= exponent) && - (exponent < decimal_in_shortest_high_)) { - CreateDecimalRepresentation(decimal_rep, decimal_rep_length, decimal_point, - Max(0, decimal_rep_length - decimal_point), - result_builder); - } else { - CreateExponentialRepresentation(decimal_rep, decimal_rep_length, exponent, - result_builder); - } - return true; -} - -bool DoubleToStringConverter::ToFixed(double value, - int requested_digits, - StringBuilder* result_builder) const { - ASSERT(kMaxFixedDigitsBeforePoint == 60); - const double kFirstNonFixed = 1e60; - - if (Double(value).IsSpecial()) { - return HandleSpecialValues(value, result_builder); - } - - if (requested_digits > kMaxFixedDigitsAfterPoint) - return false; - if (value >= kFirstNonFixed || value <= -kFirstNonFixed) - return false; - - // Find a sufficiently precise decimal representation of n. - int decimal_point; - bool sign; - // Add space for the '\0' byte. - const int kDecimalRepCapacity = - kMaxFixedDigitsBeforePoint + kMaxFixedDigitsAfterPoint + 1; - char decimal_rep[kDecimalRepCapacity]; - int decimal_rep_length; - DoubleToAscii(value, FIXED, requested_digits, decimal_rep, - kDecimalRepCapacity, &sign, &decimal_rep_length, - &decimal_point); - - bool unique_zero = ((flags_ & UNIQUE_ZERO) != 0); - if (sign && (value != 0.0 || !unique_zero)) { - result_builder->AddCharacter('-'); - } - - CreateDecimalRepresentation(decimal_rep, decimal_rep_length, decimal_point, - requested_digits, result_builder); - return true; -} - -bool DoubleToStringConverter::ToExponential( - double value, - int requested_digits, - StringBuilder* result_builder) const { - if (Double(value).IsSpecial()) { - return HandleSpecialValues(value, result_builder); - } - - if (requested_digits < -1) - return false; - if (requested_digits > kMaxExponentialDigits) - return false; - - int decimal_point; - bool sign; - // Add space for digit before the decimal point and the '\0' character. - const int kDecimalRepCapacity = kMaxExponentialDigits + 2; - ASSERT(kDecimalRepCapacity > kBase10MaximalLength); - char decimal_rep[kDecimalRepCapacity]; - int decimal_rep_length; - - if (requested_digits == -1) { - DoubleToAscii(value, SHORTEST, 0, decimal_rep, kDecimalRepCapacity, &sign, - &decimal_rep_length, &decimal_point); - } else { - DoubleToAscii(value, PRECISION, requested_digits + 1, decimal_rep, - kDecimalRepCapacity, &sign, &decimal_rep_length, - &decimal_point); - ASSERT(decimal_rep_length <= requested_digits + 1); - - for (int i = decimal_rep_length; i < requested_digits + 1; ++i) { - decimal_rep[i] = '0'; - } - decimal_rep_length = requested_digits + 1; - } - - bool unique_zero = ((flags_ & UNIQUE_ZERO) != 0); - if (sign && (value != 0.0 || !unique_zero)) { - result_builder->AddCharacter('-'); - } - - int exponent = decimal_point - 1; - CreateExponentialRepresentation(decimal_rep, decimal_rep_length, exponent, - result_builder); - return true; -} - -bool DoubleToStringConverter::ToPrecision(double value, - int precision, - StringBuilder* result_builder) const { - if (Double(value).IsSpecial()) { - return HandleSpecialValues(value, result_builder); - } - - if (precision < kMinPrecisionDigits || precision > kMaxPrecisionDigits) { - return false; - } - - // Find a sufficiently precise decimal representation of n. - int decimal_point; - bool sign; - // Add one for the terminating null character. - const int kDecimalRepCapacity = kMaxPrecisionDigits + 1; - char decimal_rep[kDecimalRepCapacity]; - int decimal_rep_length; - - DoubleToAscii(value, PRECISION, precision, decimal_rep, kDecimalRepCapacity, - &sign, &decimal_rep_length, &decimal_point); - ASSERT(decimal_rep_length <= precision); - - bool unique_zero = ((flags_ & UNIQUE_ZERO) != 0); - if (sign && (value != 0.0 || !unique_zero)) { - result_builder->AddCharacter('-'); - } - - // The exponent if we print the number as x.xxeyyy. That is with the - // decimal point after the first digit. - int exponent = decimal_point - 1; - - int extra_zero = ((flags_ & EMIT_TRAILING_ZERO_AFTER_POINT) != 0) ? 1 : 0; - if ((-decimal_point + 1 > max_leading_padding_zeroes_in_precision_mode_) || - (decimal_point - precision + extra_zero > - max_trailing_padding_zeroes_in_precision_mode_)) { - // Fill buffer to contain 'precision' digits. - // Usually the buffer is already at the correct length, but 'DoubleToAscii' - // is allowed to return less characters. - for (int i = decimal_rep_length; i < precision; ++i) { - decimal_rep[i] = '0'; - } - - CreateExponentialRepresentation(decimal_rep, precision, exponent, - result_builder); - } else { - CreateDecimalRepresentation(decimal_rep, decimal_rep_length, decimal_point, - Max(0, precision - decimal_point), - result_builder); - } - return true; -} - -static BignumDtoaMode DtoaToBignumDtoaMode( - DoubleToStringConverter::DtoaMode dtoa_mode) { - switch (dtoa_mode) { - case DoubleToStringConverter::SHORTEST: - return BIGNUM_DTOA_SHORTEST; - case DoubleToStringConverter::FIXED: - return BIGNUM_DTOA_FIXED; - case DoubleToStringConverter::PRECISION: - return BIGNUM_DTOA_PRECISION; - default: - UNREACHABLE(); - return BIGNUM_DTOA_SHORTEST; // To silence compiler. - } -} - -void DoubleToStringConverter::DoubleToAscii(double v, - DtoaMode mode, - int requested_digits, - char* buffer, - int buffer_length, - bool* sign, - int* length, - int* point) { - Vector vector(buffer, buffer_length); - ASSERT(!Double(v).IsSpecial()); - ASSERT(mode == SHORTEST || requested_digits >= 0); - - if (Double(v).Sign() < 0) { - *sign = true; - v = -v; - } else { - *sign = false; - } - - if (mode == PRECISION && requested_digits == 0) { - vector[0] = '\0'; - *length = 0; - return; - } - - if (v == 0) { - vector[0] = '0'; - vector[1] = '\0'; - *length = 1; - *point = 1; - return; - } - - bool fast_worked; - switch (mode) { - case SHORTEST: - fast_worked = FastDtoa(v, FAST_DTOA_SHORTEST, 0, vector, length, point); - break; - case FIXED: - fast_worked = FastFixedDtoa(v, requested_digits, vector, length, point); - break; - case PRECISION: - fast_worked = FastDtoa(v, FAST_DTOA_PRECISION, requested_digits, vector, - length, point); - break; - default: - UNREACHABLE(); - fast_worked = false; - } - if (fast_worked) - return; - - // If the fast dtoa didn't succeed use the slower bignum version. - BignumDtoaMode bignum_mode = DtoaToBignumDtoaMode(mode); - BignumDtoa(v, bignum_mode, requested_digits, vector, length, point); - vector[*length] = '\0'; -} - -// Maximum number of significant digits in decimal representation. -// The longest possible double in decimal representation is -// (2^53 - 1) * 2 ^ -1074 that is (2 ^ 53 - 1) * 5 ^ 1074 / 10 ^ 1074 -// (768 digits). If we parse a number whose first digits are equal to a -// mean of 2 adjacent doubles (that could have up to 769 digits) the result -// must be rounded to the bigger one unless the tail consists of zeros, so -// we don't need to preserve all the digits. -const int kMaxSignificantDigits = 772; - -static double SignedZero(bool sign) { - return sign ? -0.0 : 0.0; -} - -double StringToDoubleConverter::StringToDouble( - const char* input, - size_t length, - size_t* processed_characters_count) { - const char* current = input; - const char* end = input + length; - - *processed_characters_count = 0; - - // To make sure that iterator dereferencing is valid the following - // convention is used: - // 1. Each '++current' statement is followed by check for equality to 'end'. - // 3. If 'current' becomes equal to 'end' the function returns or goes to - // 'parsing_done'. - // 4. 'current' is not dereferenced after the 'parsing_done' label. - // 5. Code before 'parsing_done' may rely on 'current != end'. - if (current == end) - return 0.0; - - // The longest form of simplified number is: "-.1eXXX\0". - const int kBufferSize = kMaxSignificantDigits + 10; - char buffer[kBufferSize]; // NOLINT: size is known at compile time. - int buffer_pos = 0; - - // Exponent will be adjusted if insignificant digits of the integer part - // or insignificant leading zeros of the fractional part are dropped. - int exponent = 0; - int significant_digits = 0; - int insignificant_digits = 0; - bool nonzero_digit_dropped = false; - bool sign = false; - - if (*current == '+' || *current == '-') { - sign = (*current == '-'); - ++current; - if (current == end) - return 0.0; - } - - bool leading_zero = false; - if (*current == '0') { - ++current; - if (current == end) { - *processed_characters_count = current - input; - return SignedZero(sign); - } - - leading_zero = true; - - // Ignore leading zeros in the integer part. - while (*current == '0') { - ++current; - if (current == end) { - *processed_characters_count = current - input; - return SignedZero(sign); - } - } - } - - // Copy significant digits of the integer part (if any) to the buffer. - while (*current >= '0' && *current <= '9') { - if (significant_digits < kMaxSignificantDigits) { - ASSERT(buffer_pos < kBufferSize); - buffer[buffer_pos++] = static_cast(*current); - significant_digits++; - } else { - insignificant_digits++; // Move the digit into the exponential part. - nonzero_digit_dropped = nonzero_digit_dropped || *current != '0'; - } - ++current; - if (current == end) - goto parsing_done; - } - - if (*current == '.') { - ++current; - if (current == end) { - if (significant_digits == 0 && !leading_zero) { - return 0.0; - } else { - goto parsing_done; - } - } - - if (significant_digits == 0) { - // Integer part consists of 0 or is absent. Significant digits start after - // leading zeros (if any). - while (*current == '0') { - ++current; - if (current == end) { - *processed_characters_count = current - input; - return SignedZero(sign); - } - exponent--; // Move this 0 into the exponent. - } - } - - // There is a fractional part. - while (*current >= '0' && *current <= '9') { - if (significant_digits < kMaxSignificantDigits) { - ASSERT(buffer_pos < kBufferSize); - buffer[buffer_pos++] = static_cast(*current); - significant_digits++; - exponent--; - } else { - // Ignore insignificant digits in the fractional part. - nonzero_digit_dropped = nonzero_digit_dropped || *current != '0'; - } - ++current; - if (current == end) - goto parsing_done; - } - } - - if (!leading_zero && exponent == 0 && significant_digits == 0) { - // If leading_zeros is true then the string contains zeros. - // If exponent < 0 then string was [+-]\.0*... - // If significant_digits != 0 the string is not equal to 0. - // Otherwise there are no digits in the string. - return 0.0; - } - - // Parse exponential part. - if (*current == 'e' || *current == 'E') { - ++current; - if (current == end) { - --current; - goto parsing_done; - } - char sign = 0; - if (*current == '+' || *current == '-') { - sign = static_cast(*current); - ++current; - if (current == end) { - current -= 2; - goto parsing_done; - } - } - - if (*current < '0' || *current > '9') { - if (sign) - --current; - --current; - goto parsing_done; - } - - const int max_exponent = INT_MAX / 2; - ASSERT(-max_exponent / 2 <= exponent && exponent <= max_exponent / 2); - int num = 0; - do { - // Check overflow. - int digit = *current - '0'; - if (num >= max_exponent / 10 && - !(num == max_exponent / 10 && digit <= max_exponent % 10)) { - num = max_exponent; - } else { - num = num * 10 + digit; - } - ++current; - } while (current != end && *current >= '0' && *current <= '9'); - - exponent += (sign == '-' ? -num : num); - } - -parsing_done: - exponent += insignificant_digits; - - if (nonzero_digit_dropped) { - buffer[buffer_pos++] = '1'; - exponent--; - } - - ASSERT(buffer_pos < kBufferSize); - buffer[buffer_pos] = '\0'; - - double converted = Strtod(Vector(buffer, buffer_pos), exponent); - *processed_characters_count = current - input; - return sign ? -converted : converted; -} - -} // namespace double_conversion - -} // namespace WTF diff --git a/sky/engine/wtf/dtoa/double-conversion.h b/sky/engine/wtf/dtoa/double-conversion.h deleted file mode 100644 index 836ba4d52774c..0000000000000 --- a/sky/engine/wtf/dtoa/double-conversion.h +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_DOUBLE_CONVERSION_H_ -#define SKY_ENGINE_WTF_DTOA_DOUBLE_CONVERSION_H_ - -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -class DoubleToStringConverter { - public: - // When calling ToFixed with a double > 10^kMaxFixedDigitsBeforePoint - // or a requested_digits parameter > kMaxFixedDigitsAfterPoint then the - // function returns false. - static const int kMaxFixedDigitsBeforePoint = 60; - static const int kMaxFixedDigitsAfterPoint = 60; - - // When calling ToExponential with a requested_digits - // parameter > kMaxExponentialDigits then the function returns false. - static const int kMaxExponentialDigits = 120; - - // When calling ToPrecision with a requested_digits - // parameter < kMinPrecisionDigits or requested_digits > kMaxPrecisionDigits - // then the function returns false. - static const int kMinPrecisionDigits = 1; - static const int kMaxPrecisionDigits = 120; - - enum Flags { - NO_FLAGS = 0, - EMIT_POSITIVE_EXPONENT_SIGN = 1, - EMIT_TRAILING_DECIMAL_POINT = 2, - EMIT_TRAILING_ZERO_AFTER_POINT = 4, - UNIQUE_ZERO = 8 - }; - - // Flags should be a bit-or combination of the possible Flags-enum. - // - NO_FLAGS: no special flags. - // - EMIT_POSITIVE_EXPONENT_SIGN: when the number is converted into exponent - // form, emits a '+' for positive exponents. Example: 1.2e+2. - // - EMIT_TRAILING_DECIMAL_POINT: when the input number is an integer and is - // converted into decimal format then a trailing decimal point is appended. - // Example: 2345.0 is converted to "2345.". - // - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point - // emits a trailing '0'-character. This flag requires the - // EXMIT_TRAILING_DECIMAL_POINT flag. - // Example: 2345.0 is converted to "2345.0". - // - UNIQUE_ZERO: "-0.0" is converted to "0.0". - // - // Infinity symbol and nan_symbol provide the string representation for these - // special values. If the string is NULL and the special value is encountered - // then the conversion functions return false. - // - // The exponent_character is used in exponential representations. It is - // usually 'e' or 'E'. - // - // When converting to the shortest representation the converter will - // represent input numbers in decimal format if they are in the interval - // [10^decimal_in_shortest_low; 10^decimal_in_shortest_high[ - // (lower boundary included, greater boundary excluded). - // Example: with decimal_in_shortest_low = -6 and - // decimal_in_shortest_high = 21: - // ToShortest(0.000001) -> "0.000001" - // ToShortest(0.0000001) -> "1e-7" - // ToShortest(111111111111111111111.0) -> "111111111111111110000" - // ToShortest(100000000000000000000.0) -> "100000000000000000000" - // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" - // - // When converting to precision mode the converter may add - // max_leading_padding_zeroes before returning the number in exponential - // format. - // Example with max_leading_padding_zeroes_in_precision_mode = 6. - // ToPrecision(0.0000012345, 2) -> "0.0000012" - // ToPrecision(0.00000012345, 2) -> "1.2e-7" - // Similarily the converter may add up to - // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid - // returning an exponential representation. A zero added by the - // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. - // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: - // ToPrecision(230.0, 2) -> "230" - // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. - // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. - DoubleToStringConverter(int flags, - const char* infinity_symbol, - const char* nan_symbol, - char exponent_character, - int decimal_in_shortest_low, - int decimal_in_shortest_high, - int max_leading_padding_zeroes_in_precision_mode, - int max_trailing_padding_zeroes_in_precision_mode) - : flags_(flags), - infinity_symbol_(infinity_symbol), - nan_symbol_(nan_symbol), - exponent_character_(exponent_character), - decimal_in_shortest_low_(decimal_in_shortest_low), - decimal_in_shortest_high_(decimal_in_shortest_high), - max_leading_padding_zeroes_in_precision_mode_( - max_leading_padding_zeroes_in_precision_mode), - max_trailing_padding_zeroes_in_precision_mode_( - max_trailing_padding_zeroes_in_precision_mode) { - // When 'trailing zero after the point' is set, then 'trailing point' - // must be set too. - ASSERT(((flags & EMIT_TRAILING_DECIMAL_POINT) != 0) || - !((flags & EMIT_TRAILING_ZERO_AFTER_POINT) != 0)); - } - - // Returns a converter following the EcmaScript specification. - static const DoubleToStringConverter& EcmaScriptConverter(); - - // Computes the shortest string of digits that correctly represent the input - // number. Depending on decimal_in_shortest_low and decimal_in_shortest_high - // (see constructor) it then either returns a decimal representation, or an - // exponential representation. - // Example with decimal_in_shortest_low = -6, - // decimal_in_shortest_high = 21, - // EMIT_POSITIVE_EXPONENT_SIGN activated, and - // EMIT_TRAILING_DECIMAL_POINT deactived: - // ToShortest(0.000001) -> "0.000001" - // ToShortest(0.0000001) -> "1e-7" - // ToShortest(111111111111111111111.0) -> "111111111111111110000" - // ToShortest(100000000000000000000.0) -> "100000000000000000000" - // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" - // - // Note: the conversion may round the output if the returned string - // is accurate enough to uniquely identify the input-number. - // For example the most precise representation of the double 9e59 equals - // "899999999999999918767229449717619953810131273674690656206848", but - // the converter will return the shorter (but still correct) "9e59". - // - // Returns true if the conversion succeeds. The conversion always succeeds - // except when the input value is special and no infinity_symbol or - // nan_symbol has been given to the constructor. - bool ToShortest(double value, StringBuilder* result_builder) const; - - // Computes a decimal representation with a fixed number of digits after the - // decimal point. The last emitted digit is rounded. - // - // Examples: - // ToFixed(3.12, 1) -> "3.1" - // ToFixed(3.1415, 3) -> "3.142" - // ToFixed(1234.56789, 4) -> "1234.5679" - // ToFixed(1.23, 5) -> "1.23000" - // ToFixed(0.1, 4) -> "0.1000" - // ToFixed(1e30, 2) -> "1000000000000000019884624838656.00" - // ToFixed(0.1, 30) -> "0.100000000000000005551115123126" - // ToFixed(0.1, 17) -> "0.10000000000000001" - // - // If requested_digits equals 0, then the tail of the result depends on - // the EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT. - // Examples, for requested_digits == 0, - // let EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT be - // - false and false: then 123.45 -> 123 - // 0.678 -> 1 - // - true and false: then 123.45 -> 123. - // 0.678 -> 1. - // - true and true: then 123.45 -> 123.0 - // 0.678 -> 1.0 - // - // Returns true if the conversion succeeds. The conversion always succeeds - // except for the following cases: - // - the input value is special and no infinity_symbol or nan_symbol has - // been provided to the constructor, - // - 'value' > 10^kMaxFixedDigitsBeforePoint, or - // - 'requested_digits' > kMaxFixedDigitsAfterPoint. - // The last two conditions imply that the result will never contain more than - // 1 + kMaxFixedDigitsBeforePoint + 1 + kMaxFixedDigitsAfterPoint characters - // (one additional character for the sign, and one for the decimal point). - bool ToFixed(double value, - int requested_digits, - StringBuilder* result_builder) const; - - // Computes a representation in exponential format with requested_digits - // after the decimal point. The last emitted digit is rounded. - // If requested_digits equals -1, then the shortest exponential representation - // is computed. - // - // Examples with EMIT_POSITIVE_EXPONENT_SIGN deactivated, and - // exponent_character set to 'e'. - // ToExponential(3.12, 1) -> "3.1e0" - // ToExponential(5.0, 3) -> "5.000e0" - // ToExponential(0.001, 2) -> "1.00e-3" - // ToExponential(3.1415, -1) -> "3.1415e0" - // ToExponential(3.1415, 4) -> "3.1415e0" - // ToExponential(3.1415, 3) -> "3.142e0" - // ToExponential(123456789000000, 3) -> "1.235e14" - // ToExponential(1000000000000000019884624838656.0, -1) -> "1e30" - // ToExponential(1000000000000000019884624838656.0, 32) -> - // "1.00000000000000001988462483865600e30" - // ToExponential(1234, 0) -> "1e3" - // - // Returns true if the conversion succeeds. The conversion always succeeds - // except for the following cases: - // - the input value is special and no infinity_symbol or nan_symbol has - // been provided to the constructor, - // - 'requested_digits' > kMaxExponentialDigits. - // The last condition implies that the result will never contain more than - // kMaxExponentialDigits + 8 characters (the sign, the digit before the - // decimal point, the decimal point, the exponent character, the - // exponent's sign, and at most 3 exponent digits). - bool ToExponential(double value, - int requested_digits, - StringBuilder* result_builder) const; - - // Computes 'precision' leading digits of the given 'value' and returns them - // either in exponential or decimal format, depending on - // max_{leading|trailing}_padding_zeroes_in_precision_mode (given to the - // constructor). - // The last computed digit is rounded. - // - // Example with max_leading_padding_zeroes_in_precision_mode = 6. - // ToPrecision(0.0000012345, 2) -> "0.0000012" - // ToPrecision(0.00000012345, 2) -> "1.2e-7" - // Similarily the converter may add up to - // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid - // returning an exponential representation. A zero added by the - // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. - // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: - // ToPrecision(230.0, 2) -> "230" - // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. - // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. - // Examples for max_trailing_padding_zeroes_in_precision_mode = 3, and no - // EMIT_TRAILING_ZERO_AFTER_POINT: - // ToPrecision(123450.0, 6) -> "123450" - // ToPrecision(123450.0, 5) -> "123450" - // ToPrecision(123450.0, 4) -> "123500" - // ToPrecision(123450.0, 3) -> "123000" - // ToPrecision(123450.0, 2) -> "1.2e5" - // - // Returns true if the conversion succeeds. The conversion always succeeds - // except for the following cases: - // - the input value is special and no infinity_symbol or nan_symbol has - // been provided to the constructor, - // - precision < kMinPericisionDigits - // - precision > kMaxPrecisionDigits - // The last condition implies that the result will never contain more than - // kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the - // exponent character, the exponent's sign, and at most 3 exponent digits). - bool ToPrecision(double value, - int precision, - StringBuilder* result_builder) const; - - enum DtoaMode { - // Produce the shortest correct representation. - // For example the output of 0.299999999999999988897 is (the less accurate - // but correct) 0.3. - SHORTEST, - // Produce a fixed number of digits after the decimal point. - // For instance fixed(0.1, 4) becomes 0.1000 - // If the input number is big, the output will be big. - FIXED, - // Fixed number of digits (independent of the decimal point). - PRECISION - }; - - // The maximal number of digits that are needed to emit a double in base 10. - // A higher precision can be achieved by using more digits, but the shortest - // accurate representation of any double will never use more digits than - // kBase10MaximalLength. - // Note that DoubleToAscii null-terminates its input. So the given buffer - // should be at least kBase10MaximalLength + 1 characters long. - static const int kBase10MaximalLength = 17; - - // Converts the given double 'v' to ascii. - // The result should be interpreted as buffer * 10^(point-length). - // - // The output depends on the given mode: - // - SHORTEST: produce the least amount of digits for which the internal - // identity requirement is still satisfied. If the digits are printed - // (together with the correct exponent) then reading this number will give - // 'v' again. The buffer will choose the representation that is closest to - // 'v'. If there are two at the same distance, than the one farther away - // from 0 is chosen (halfway cases - ending with 5 - are rounded up). - // In this mode the 'requested_digits' parameter is ignored. - // - FIXED: produces digits necessary to print a given number with - // 'requested_digits' digits after the decimal point. The produced digits - // might be too short in which case the caller has to fill the remainder - // with '0's. - // Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. - // Halfway cases are rounded towards +/-Infinity (away from 0). The call - // toFixed(0.15, 2) thus returns buffer="2", point=0. - // The returned buffer may contain digits that would be truncated from the - // shortest representation of the input. - // - PRECISION: produces 'requested_digits' where the first digit is not '0'. - // Even though the length of produced digits usually equals - // 'requested_digits', the function is allowed to return fewer digits, in - // which case the caller has to fill the missing digits with '0's. - // Halfway cases are again rounded away from 0. - // DoubleToAscii expects the given buffer to be big enough to hold all - // digits and a terminating null-character. In SHORTEST-mode it expects a - // buffer of at least kBase10MaximalLength + 1. In all other modes the - // requested_digits parameter (+ 1 for the null-character) limits the size of - // the output. The given length is only used in debug mode to ensure the - // buffer is big enough. - static void DoubleToAscii(double v, - DtoaMode mode, - int requested_digits, - char* buffer, - int buffer_length, - bool* sign, - int* length, - int* point); - - private: - // If the value is a special value (NaN or Infinity) constructs the - // corresponding string using the configured infinity/nan-symbol. - // If either of them is NULL or the value is not special then the - // function returns false. - bool HandleSpecialValues(double value, StringBuilder* result_builder) const; - // Constructs an exponential representation (i.e. 1.234e56). - // The given exponent assumes a decimal point after the first decimal digit. - void CreateExponentialRepresentation(const char* decimal_digits, - int length, - int exponent, - StringBuilder* result_builder) const; - // Creates a decimal representation (i.e 1234.5678). - void CreateDecimalRepresentation(const char* decimal_digits, - int length, - int decimal_point, - int digits_after_point, - StringBuilder* result_builder) const; - - const int flags_; - const char* const infinity_symbol_; - const char* const nan_symbol_; - const char exponent_character_; - const int decimal_in_shortest_low_; - const int decimal_in_shortest_high_; - const int max_leading_padding_zeroes_in_precision_mode_; - const int max_trailing_padding_zeroes_in_precision_mode_; - - FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter); -}; - -class StringToDoubleConverter { - public: - // Performs the conversion. - // The output parameter 'processed_characters_count' is set to the number - // of characters that have been processed to read the number. - static double StringToDouble(const char* buffer, - size_t length, - size_t* processed_characters_count); - - private: - FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter); -}; - -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_DOUBLE_CONVERSION_H_ diff --git a/sky/engine/wtf/dtoa/double.h b/sky/engine/wtf/dtoa/double.h deleted file mode 100644 index 88c5810d47ec9..0000000000000 --- a/sky/engine/wtf/dtoa/double.h +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_DOUBLE_H_ -#define SKY_ENGINE_WTF_DTOA_DOUBLE_H_ - -#include "diy-fp.h" - -namespace WTF { - -namespace double_conversion { - -// We assume that doubles and uint64_t have the same endianness. -static uint64_t double_to_uint64(double d) { - return BitCast(d); -} -static double uint64_to_double(uint64_t d64) { - return BitCast(d64); -} - -// Helper functions for doubles. -class Double { - public: - static const uint64_t kSignMask = UINT64_2PART_C(0x80000000, 00000000); - static const uint64_t kExponentMask = UINT64_2PART_C(0x7FF00000, 00000000); - static const uint64_t kSignificandMask = UINT64_2PART_C(0x000FFFFF, FFFFFFFF); - static const uint64_t kHiddenBit = UINT64_2PART_C(0x00100000, 00000000); - static const int kPhysicalSignificandSize = 52; // Excludes the hidden bit. - static const int kSignificandSize = 53; - - Double() : d64_(0) {} - explicit Double(double d) : d64_(double_to_uint64(d)) {} - explicit Double(uint64_t d64) : d64_(d64) {} - explicit Double(DiyFp diy_fp) : d64_(DiyFpToUint64(diy_fp)) {} - - // The value encoded by this Double must be greater or equal to +0.0. - // It must not be special (infinity, or NaN). - DiyFp AsDiyFp() const { - ASSERT(Sign() > 0); - ASSERT(!IsSpecial()); - return DiyFp(Significand(), Exponent()); - } - - // The value encoded by this Double must be strictly greater than 0. - DiyFp AsNormalizedDiyFp() const { - ASSERT(value() > 0.0); - uint64_t f = Significand(); - int e = Exponent(); - - // The current double could be a denormal. - while ((f & kHiddenBit) == 0) { - f <<= 1; - e--; - } - // Do the final shifts in one go. - f <<= DiyFp::kSignificandSize - kSignificandSize; - e -= DiyFp::kSignificandSize - kSignificandSize; - return DiyFp(f, e); - } - - // Returns the double's bit as uint64. - uint64_t AsUint64() const { return d64_; } - - // Returns the next greater double. Returns +infinity on input +infinity. - double NextDouble() const { - if (d64_ == kInfinity) - return Double(kInfinity).value(); - if (Sign() < 0 && Significand() == 0) { - // -0.0 - return 0.0; - } - if (Sign() < 0) { - return Double(d64_ - 1).value(); - } else { - return Double(d64_ + 1).value(); - } - } - - int Exponent() const { - if (IsDenormal()) - return kDenormalExponent; - - uint64_t d64 = AsUint64(); - int biased_e = - static_cast((d64 & kExponentMask) >> kPhysicalSignificandSize); - return biased_e - kExponentBias; - } - - uint64_t Significand() const { - uint64_t d64 = AsUint64(); - uint64_t significand = d64 & kSignificandMask; - if (!IsDenormal()) { - return significand + kHiddenBit; - } else { - return significand; - } - } - - // Returns true if the double is a denormal. - bool IsDenormal() const { - uint64_t d64 = AsUint64(); - return (d64 & kExponentMask) == 0; - } - - // We consider denormals not to be special. - // Hence only Infinity and NaN are special. - bool IsSpecial() const { - uint64_t d64 = AsUint64(); - return (d64 & kExponentMask) == kExponentMask; - } - - bool IsNan() const { - uint64_t d64 = AsUint64(); - return ((d64 & kExponentMask) == kExponentMask) && - ((d64 & kSignificandMask) != 0); - } - - bool IsInfinite() const { - uint64_t d64 = AsUint64(); - return ((d64 & kExponentMask) == kExponentMask) && - ((d64 & kSignificandMask) == 0); - } - - int Sign() const { - uint64_t d64 = AsUint64(); - return (d64 & kSignMask) == 0 ? 1 : -1; - } - - // Precondition: the value encoded by this Double must be greater or equal - // than +0.0. - DiyFp UpperBoundary() const { - ASSERT(Sign() > 0); - return DiyFp(Significand() * 2 + 1, Exponent() - 1); - } - - // Computes the two boundaries of this. - // The bigger boundary (m_plus) is normalized. The lower boundary has the same - // exponent as m_plus. - // Precondition: the value encoded by this Double must be greater than 0. - void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { - ASSERT(value() > 0.0); - DiyFp v = this->AsDiyFp(); - bool significand_is_zero = (v.f() == kHiddenBit); - DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); - DiyFp m_minus; - if (significand_is_zero && v.e() != kDenormalExponent) { - // The boundary is closer. Think of v = 1000e10 and v- = 9999e9. - // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but - // at a distance of 1e8. - // The only exception is for the smallest normal: the largest denormal is - // at the same distance as its successor. - // Note: denormals have the same exponent as the smallest normals. - m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); - } else { - m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); - } - m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); - m_minus.set_e(m_plus.e()); - *out_m_plus = m_plus; - *out_m_minus = m_minus; - } - - double value() const { return uint64_to_double(d64_); } - - // Returns the significand size for a given order of magnitude. - // If v = f*2^e with 2^p-1 <= f <= 2^p then p+e is v's order of magnitude. - // This function returns the number of significant binary digits v will have - // once it's encoded into a double. In almost all cases this is equal to - // kSignificandSize. The only exceptions are denormals. They start with - // leading zeroes and their effective significand-size is hence smaller. - static int SignificandSizeForOrderOfMagnitude(int order) { - if (order >= (kDenormalExponent + kSignificandSize)) { - return kSignificandSize; - } - if (order <= kDenormalExponent) - return 0; - return order - kDenormalExponent; - } - - static double Infinity() { return Double(kInfinity).value(); } - - static double NaN() { return Double(kNaN).value(); } - - private: - static const int kExponentBias = 0x3FF + kPhysicalSignificandSize; - static const int kDenormalExponent = -kExponentBias + 1; - static const int kMaxExponent = 0x7FF - kExponentBias; - static const uint64_t kInfinity = UINT64_2PART_C(0x7FF00000, 00000000); - static const uint64_t kNaN = UINT64_2PART_C(0x7FF80000, 00000000); - - const uint64_t d64_; - - static uint64_t DiyFpToUint64(DiyFp diy_fp) { - uint64_t significand = diy_fp.f(); - int exponent = diy_fp.e(); - while (significand > kHiddenBit + kSignificandMask) { - significand >>= 1; - exponent++; - } - if (exponent >= kMaxExponent) { - return kInfinity; - } - if (exponent < kDenormalExponent) { - return 0; - } - while (exponent > kDenormalExponent && (significand & kHiddenBit) == 0) { - significand <<= 1; - exponent--; - } - uint64_t biased_exponent; - if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) { - biased_exponent = 0; - } else { - biased_exponent = static_cast(exponent + kExponentBias); - } - return (significand & kSignificandMask) | - (biased_exponent << kPhysicalSignificandSize); - } -}; - -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_DOUBLE_H_ diff --git a/sky/engine/wtf/dtoa/fast-dtoa.cc b/sky/engine/wtf/dtoa/fast-dtoa.cc deleted file mode 100644 index a80636857252d..0000000000000 --- a/sky/engine/wtf/dtoa/fast-dtoa.cc +++ /dev/null @@ -1,732 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include "fast-dtoa.h" - -#include "cached-powers.h" -#include "diy-fp.h" -#include "flutter/sky/engine/wtf/dtoa/double.h" - -namespace WTF { - -namespace double_conversion { - -// The minimal and maximal target exponent define the range of w's binary -// exponent, where 'w' is the result of multiplying the input by a cached power -// of ten. -// -// A different range might be chosen on a different platform, to optimize digit -// generation, but a smaller range requires more powers of ten to be cached. -static const int kMinimalTargetExponent = -60; -static const int kMaximalTargetExponent = -32; - -// Adjusts the last digit of the generated number, and screens out generated -// solutions that may be inaccurate. A solution may be inaccurate if it is -// outside the safe interval, or if we cannot prove that it is closer to the -// input than a neighboring representation of the same length. -// -// Input: * buffer containing the digits of too_high / 10^kappa -// * the buffer's length -// * distance_too_high_w == (too_high - w).f() * unit -// * unsafe_interval == (too_high - too_low).f() * unit -// * rest = (too_high - buffer * 10^kappa).f() * unit -// * ten_kappa = 10^kappa * unit -// * unit = the common multiplier -// Output: returns true if the buffer is guaranteed to contain the closest -// representable number to the input. -// Modifies the generated digits in the buffer to approach (round towards) w. -static bool RoundWeed(Vector buffer, - int length, - uint64_t distance_too_high_w, - uint64_t unsafe_interval, - uint64_t rest, - uint64_t ten_kappa, - uint64_t unit) { - uint64_t small_distance = distance_too_high_w - unit; - uint64_t big_distance = distance_too_high_w + unit; - // Let w_low = too_high - big_distance, and - // w_high = too_high - small_distance. - // Note: w_low < w < w_high - // - // The real w (* unit) must lie somewhere inside the interval - // ]w_low; w_high[ (often written as "(w_low; w_high)") - - // Basically the buffer currently contains a number in the unsafe interval - // ]too_low; too_high[ with too_low < w < too_high - // - // too_high - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // ^v 1 unit ^ ^ ^ ^ - // boundary_high --------------------- . . . . - // ^v 1 unit . . . . - // - - - - - - - - - - - - - - - - - - - + - - + - - - - - - . . - // . . ^ . . - // . big_distance . . . - // . . . . rest - // small_distance . . . . - // v . . . . - // w_high - - - - - - - - - - - - - - - - - - . . . . - // ^v 1 unit . . . . - // w ---------------------------------------- . . . . - // ^v 1 unit v . . . - // w_low - - - - - - - - - - - - - - - - - - - - - . . . - // . . v - // buffer --------------------------------------------------+-------+-------- - // . . - // safe_interval . - // v . - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . - // ^v 1 unit . - // boundary_low ------------------------- unsafe_interval - // ^v 1 unit v - // too_low - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - // - // Note that the value of buffer could lie anywhere inside the range too_low - // to too_high. - // - // boundary_low, boundary_high and w are approximations of the real boundaries - // and v (the input number). They are guaranteed to be precise up to one unit. - // In fact the error is guaranteed to be strictly less than one unit. - // - // Anything that lies outside the unsafe interval is guaranteed not to round - // to v when read again. - // Anything that lies inside the safe interval is guaranteed to round to v - // when read again. - // If the number inside the buffer lies inside the unsafe interval but not - // inside the safe interval then we simply do not know and bail out (returning - // false). - // - // Similarly we have to take into account the imprecision of 'w' when finding - // the closest representation of 'w'. If we have two potential - // representations, and one is closer to both w_low and w_high, then we know - // it is closer to the actual value v. - // - // By generating the digits of too_high we got the largest (closest to - // too_high) buffer that is still in the unsafe interval. In the case where - // w_high < buffer < too_high we try to decrement the buffer. - // This way the buffer approaches (rounds towards) w. - // There are 3 conditions that stop the decrementation process: - // 1) the buffer is already below w_high - // 2) decrementing the buffer would make it leave the unsafe interval - // 3) decrementing the buffer would yield a number below w_high and farther - // away than the current number. In other words: - // (buffer{-1} < w_high) && w_high - buffer{-1} > buffer - w_high - // Instead of using the buffer directly we use its distance to too_high. - // Conceptually rest ~= too_high - buffer - // We need to do the following tests in this order to avoid over- and - // underflows. - ASSERT(rest <= unsafe_interval); - while (rest < small_distance && // Negated condition 1 - unsafe_interval - rest >= ten_kappa && // Negated condition 2 - (rest + ten_kappa < small_distance || // buffer{-1} > w_high - small_distance - rest >= rest + ten_kappa - small_distance)) { - buffer[length - 1]--; - rest += ten_kappa; - } - - // We have approached w+ as much as possible. We now test if approaching w- - // would require changing the buffer. If yes, then we have two possible - // representations close to w, but we cannot decide which one is closer. - if (rest < big_distance && unsafe_interval - rest >= ten_kappa && - (rest + ten_kappa < big_distance || - big_distance - rest > rest + ten_kappa - big_distance)) { - return false; - } - - // Weeding test. - // The safe interval is [too_low + 2 ulp; too_high - 2 ulp] - // Since too_low = too_high - unsafe_interval this is equivalent to - // [too_high - unsafe_interval + 4 ulp; too_high - 2 ulp] - // Conceptually we have: rest ~= too_high - buffer - return (2 * unit <= rest) && (rest <= unsafe_interval - 4 * unit); -} - -// Rounds the buffer upwards if the result is closer to v by possibly adding -// 1 to the buffer. If the precision of the calculation is not sufficient to -// round correctly, return false. -// The rounding might shift the whole buffer in which case the kappa is -// adjusted. For example "99", kappa = 3 might become "10", kappa = 4. -// -// If 2*rest > ten_kappa then the buffer needs to be round up. -// rest can have an error of +/- 1 unit. This function accounts for the -// imprecision and returns false, if the rounding direction cannot be -// unambiguously determined. -// -// Precondition: rest < ten_kappa. -static bool RoundWeedCounted(Vector buffer, - int length, - uint64_t rest, - uint64_t ten_kappa, - uint64_t unit, - int* kappa) { - ASSERT(rest < ten_kappa); - // The following tests are done in a specific order to avoid overflows. They - // will work correctly with any uint64 values of rest < ten_kappa and unit. - // - // If the unit is too big, then we don't know which way to round. For example - // a unit of 50 means that the real number lies within rest +/- 50. If - // 10^kappa == 40 then there is no way to tell which way to round. - if (unit >= ten_kappa) - return false; - // Even if unit is just half the size of 10^kappa we are already completely - // lost. (And after the previous test we know that the expression will not - // over/underflow.) - if (ten_kappa - unit <= unit) - return false; - // If 2 * (rest + unit) <= 10^kappa we can safely round down. - if ((ten_kappa - rest > rest) && (ten_kappa - 2 * rest >= 2 * unit)) { - return true; - } - // If 2 * (rest - unit) >= 10^kappa, then we can safely round up. - if ((rest > unit) && (ten_kappa - (rest - unit) <= (rest - unit))) { - // Increment the last digit recursively until we find a non '9' digit. - buffer[length - 1]++; - for (int i = length - 1; i > 0; --i) { - if (buffer[i] != '0' + 10) - break; - buffer[i] = '0'; - buffer[i - 1]++; - } - // If the first digit is now '0'+ 10 we had a buffer with all '9's. With the - // exception of the first digit all digits are now '0'. Simply switch the - // first digit to '1' and adjust the kappa. Example: "99" becomes "10" and - // the power (the kappa) is increased. - if (buffer[0] == '0' + 10) { - buffer[0] = '1'; - (*kappa) += 1; - } - return true; - } - return false; -} - -static const uint32_t kTen4 = 10000; -static const uint32_t kTen5 = 100000; -static const uint32_t kTen6 = 1000000; -static const uint32_t kTen7 = 10000000; -static const uint32_t kTen8 = 100000000; -static const uint32_t kTen9 = 1000000000; - -// Returns the biggest power of ten that is less than or equal to the given -// number. We furthermore receive the maximum number of bits 'number' has. -// If number_bits == 0 then 0^-1 is returned -// The number of bits must be <= 32. -// Precondition: number < (1 << (number_bits + 1)). -static void BiggestPowerTen(uint32_t number, - int number_bits, - uint32_t* power, - int* exponent) { - ASSERT(number < (uint32_t)(1 << (number_bits + 1))); - - switch (number_bits) { - case 32: - case 31: - case 30: - if (kTen9 <= number) { - *power = kTen9; - *exponent = 9; - break; - } // else fallthrough - case 29: - case 28: - case 27: - if (kTen8 <= number) { - *power = kTen8; - *exponent = 8; - break; - } // else fallthrough - case 26: - case 25: - case 24: - if (kTen7 <= number) { - *power = kTen7; - *exponent = 7; - break; - } // else fallthrough - case 23: - case 22: - case 21: - case 20: - if (kTen6 <= number) { - *power = kTen6; - *exponent = 6; - break; - } // else fallthrough - case 19: - case 18: - case 17: - if (kTen5 <= number) { - *power = kTen5; - *exponent = 5; - break; - } // else fallthrough - case 16: - case 15: - case 14: - if (kTen4 <= number) { - *power = kTen4; - *exponent = 4; - break; - } // else fallthrough - case 13: - case 12: - case 11: - case 10: - if (1000 <= number) { - *power = 1000; - *exponent = 3; - break; - } // else fallthrough - case 9: - case 8: - case 7: - if (100 <= number) { - *power = 100; - *exponent = 2; - break; - } // else fallthrough - case 6: - case 5: - case 4: - if (10 <= number) { - *power = 10; - *exponent = 1; - break; - } // else fallthrough - case 3: - case 2: - case 1: - if (1 <= number) { - *power = 1; - *exponent = 0; - break; - } // else fallthrough - case 0: - *power = 0; - *exponent = -1; - break; - default: - // Following assignments are here to silence compiler warnings. - *power = 0; - *exponent = 0; - UNREACHABLE(); - } -} - -// Generates the digits of input number w. -// w is a floating-point number (DiyFp), consisting of a significand and an -// exponent. Its exponent is bounded by kMinimalTargetExponent and -// kMaximalTargetExponent. -// Hence -60 <= w.e() <= -32. -// -// Returns false if it fails, in which case the generated digits in the buffer -// should not be used. -// Preconditions: -// * low, w and high are correct up to 1 ulp (unit in the last place). That -// is, their error must be less than a unit of their last digits. -// * low.e() == w.e() == high.e() -// * low < w < high, and taking into account their error: low~ <= high~ -// * kMinimalTargetExponent <= w.e() <= kMaximalTargetExponent -// Postconditions: returns false if procedure fails. -// otherwise: -// * buffer is not null-terminated, but len contains the number of digits. -// * buffer contains the shortest possible decimal digit-sequence -// such that LOW < buffer * 10^kappa < HIGH, where LOW and HIGH are the -// correct values of low and high (without their error). -// * if more than one decimal representation gives the minimal number of -// decimal digits then the one closest to W (where W is the correct value -// of w) is chosen. -// Remark: this procedure takes into account the imprecision of its input -// numbers. If the precision is not enough to guarantee all the postconditions -// then false is returned. This usually happens rarely (~0.5%). -// -// Say, for the sake of example, that -// w.e() == -48, and w.f() == 0x1234567890abcdef -// w's value can be computed by w.f() * 2^w.e() -// We can obtain w's integral digits by simply shifting w.f() by -w.e(). -// -> w's integral part is 0x1234 -// w's fractional part is therefore 0x567890abcdef. -// Printing w's integral part is easy (simply print 0x1234 in decimal). -// In order to print its fraction we repeatedly multiply the fraction by 10 and -// get each digit. Example the first digit after the point would be computed by -// (0x567890abcdef * 10) >> 48. -> 3 -// The whole thing becomes slightly more complicated because we want to stop -// once we have enough digits. That is, once the digits inside the buffer -// represent 'w' we can stop. Everything inside the interval low - high -// represents w. However we have to pay attention to low, high and w's -// imprecision. -static bool DigitGen(DiyFp low, - DiyFp w, - DiyFp high, - Vector buffer, - int* length, - int* kappa) { - ASSERT(low.e() == w.e() && w.e() == high.e()); - ASSERT(low.f() + 1 <= high.f() - 1); - ASSERT(kMinimalTargetExponent <= w.e() && w.e() <= kMaximalTargetExponent); - // low, w and high are imprecise, but by less than one ulp (unit in the last - // place). - // If we remove (resp. add) 1 ulp from low (resp. high) we are certain that - // the new numbers are outside of the interval we want the final - // representation to lie in. - // Inversely adding (resp. removing) 1 ulp from low (resp. high) would yield - // numbers that are certain to lie in the interval. We will use this fact - // later on. - // We will now start by generating the digits within the uncertain - // interval. Later we will weed out representations that lie outside the safe - // interval and thus _might_ lie outside the correct interval. - uint64_t unit = 1; - DiyFp too_low = DiyFp(low.f() - unit, low.e()); - DiyFp too_high = DiyFp(high.f() + unit, high.e()); - // too_low and too_high are guaranteed to lie outside the interval we want the - // generated number in. - DiyFp unsafe_interval = DiyFp::Minus(too_high, too_low); - // We now cut the input number into two parts: the integral digits and the - // fractionals. We will not write any decimal separator though, but adapt - // kappa instead. - // Reminder: we are currently computing the digits (stored inside the buffer) - // such that: too_low < buffer * 10^kappa < too_high - // We use too_high for the digit_generation and stop as soon as possible. - // If we stop early we effectively round down. - DiyFp one = DiyFp(static_cast(1) << -w.e(), w.e()); - // Division by one is a shift. - uint32_t integrals = static_cast(too_high.f() >> -one.e()); - // Modulo by one is an and. - uint64_t fractionals = too_high.f() & (one.f() - 1); - uint32_t divisor; - int divisor_exponent; - BiggestPowerTen(integrals, DiyFp::kSignificandSize - (-one.e()), &divisor, - &divisor_exponent); - *kappa = divisor_exponent + 1; - *length = 0; - // Loop invariant: buffer = too_high / 10^kappa (integer division) - // The invariant holds for the first iteration: kappa has been initialized - // with the divisor exponent + 1. And the divisor is the biggest power of ten - // that is smaller than integrals. - while (*kappa > 0) { - int digit = integrals / divisor; - buffer[*length] = '0' + digit; - (*length)++; - integrals %= divisor; - (*kappa)--; - // Note that kappa now equals the exponent of the divisor and that the - // invariant thus holds again. - uint64_t rest = - (static_cast(integrals) << -one.e()) + fractionals; - // Invariant: too_high = buffer * 10^kappa + DiyFp(rest, one.e()) - // Reminder: unsafe_interval.e() == one.e() - if (rest < unsafe_interval.f()) { - // Rounding down (by not emitting the remaining digits) yields a number - // that lies within the unsafe interval. - return RoundWeed(buffer, *length, DiyFp::Minus(too_high, w).f(), - unsafe_interval.f(), rest, - static_cast(divisor) << -one.e(), unit); - } - divisor /= 10; - } - - // The integrals have been generated. We are at the point of the decimal - // separator. In the following loop we simply multiply the remaining digits by - // 10 and divide by one. We just need to pay attention to multiply associated - // data (like the interval or 'unit'), too. - // Note that the multiplication by 10 does not overflow, because w.e >= -60 - // and thus one.e >= -60. - ASSERT(one.e() >= -60); - ASSERT(fractionals < one.f()); - ASSERT(UINT64_2PART_C(0xFFFFFFFF, FFFFFFFF) / 10 >= one.f()); - while (true) { - fractionals *= 10; - unit *= 10; - unsafe_interval.set_f(unsafe_interval.f() * 10); - // Integer division by one. - int digit = static_cast(fractionals >> -one.e()); - buffer[*length] = '0' + digit; - (*length)++; - fractionals &= one.f() - 1; // Modulo by one. - (*kappa)--; - if (fractionals < unsafe_interval.f()) { - return RoundWeed(buffer, *length, DiyFp::Minus(too_high, w).f() * unit, - unsafe_interval.f(), fractionals, one.f(), unit); - } - } -} - -// Generates (at most) requested_digits digits of input number w. -// w is a floating-point number (DiyFp), consisting of a significand and an -// exponent. Its exponent is bounded by kMinimalTargetExponent and -// kMaximalTargetExponent. -// Hence -60 <= w.e() <= -32. -// -// Returns false if it fails, in which case the generated digits in the buffer -// should not be used. -// Preconditions: -// * w is correct up to 1 ulp (unit in the last place). That -// is, its error must be strictly less than a unit of its last digit. -// * kMinimalTargetExponent <= w.e() <= kMaximalTargetExponent -// -// Postconditions: returns false if procedure fails. -// otherwise: -// * buffer is not null-terminated, but length contains the number of -// digits. -// * the representation in buffer is the most precise representation of -// requested_digits digits. -// * buffer contains at most requested_digits digits of w. If there are less -// than requested_digits digits then some trailing '0's have been removed. -// * kappa is such that -// w = buffer * 10^kappa + eps with |eps| < 10^kappa / 2. -// -// Remark: This procedure takes into account the imprecision of its input -// numbers. If the precision is not enough to guarantee all the postconditions -// then false is returned. This usually happens rarely, but the failure-rate -// increases with higher requested_digits. -static bool DigitGenCounted(DiyFp w, - int requested_digits, - Vector buffer, - int* length, - int* kappa) { - ASSERT(kMinimalTargetExponent <= w.e() && w.e() <= kMaximalTargetExponent); - ASSERT(kMinimalTargetExponent >= -60); - ASSERT(kMaximalTargetExponent <= -32); - // w is assumed to have an error less than 1 unit. Whenever w is scaled we - // also scale its error. - uint64_t w_error = 1; - // We cut the input number into two parts: the integral digits and the - // fractional digits. We don't emit any decimal separator, but adapt kappa - // instead. Example: instead of writing "1.2" we put "12" into the buffer and - // increase kappa by 1. - DiyFp one = DiyFp(static_cast(1) << -w.e(), w.e()); - // Division by one is a shift. - uint32_t integrals = static_cast(w.f() >> -one.e()); - // Modulo by one is an and. - uint64_t fractionals = w.f() & (one.f() - 1); - uint32_t divisor; - int divisor_exponent; - BiggestPowerTen(integrals, DiyFp::kSignificandSize - (-one.e()), &divisor, - &divisor_exponent); - *kappa = divisor_exponent + 1; - *length = 0; - - // Loop invariant: buffer = w / 10^kappa (integer division) - // The invariant holds for the first iteration: kappa has been initialized - // with the divisor exponent + 1. And the divisor is the biggest power of ten - // that is smaller than 'integrals'. - while (*kappa > 0) { - int digit = integrals / divisor; - buffer[*length] = '0' + digit; - (*length)++; - requested_digits--; - integrals %= divisor; - (*kappa)--; - // Note that kappa now equals the exponent of the divisor and that the - // invariant thus holds again. - if (requested_digits == 0) - break; - divisor /= 10; - } - - if (requested_digits == 0) { - uint64_t rest = - (static_cast(integrals) << -one.e()) + fractionals; - return RoundWeedCounted(buffer, *length, rest, - static_cast(divisor) << -one.e(), w_error, - kappa); - } - - // The integrals have been generated. We are at the point of the decimal - // separator. In the following loop we simply multiply the remaining digits by - // 10 and divide by one. We just need to pay attention to multiply associated - // data (the 'unit'), too. - // Note that the multiplication by 10 does not overflow, because w.e >= -60 - // and thus one.e >= -60. - ASSERT(one.e() >= -60); - ASSERT(fractionals < one.f()); - ASSERT(UINT64_2PART_C(0xFFFFFFFF, FFFFFFFF) / 10 >= one.f()); - while (requested_digits > 0 && fractionals > w_error) { - fractionals *= 10; - w_error *= 10; - // Integer division by one. - int digit = static_cast(fractionals >> -one.e()); - buffer[*length] = '0' + digit; - (*length)++; - requested_digits--; - fractionals &= one.f() - 1; // Modulo by one. - (*kappa)--; - } - if (requested_digits != 0) - return false; - return RoundWeedCounted(buffer, *length, fractionals, one.f(), w_error, - kappa); -} - -// Provides a decimal representation of v. -// Returns true if it succeeds, otherwise the result cannot be trusted. -// There will be *length digits inside the buffer (not null-terminated). -// If the function returns true then -// v == (double) (buffer * 10^decimal_exponent). -// The digits in the buffer are the shortest representation possible: no -// 0.09999999999999999 instead of 0.1. The shorter representation will even be -// chosen even if the longer one would be closer to v. -// The last digit will be closest to the actual v. That is, even if several -// digits might correctly yield 'v' when read again, the closest will be -// computed. -static bool Grisu3(double v, - Vector buffer, - int* length, - int* decimal_exponent) { - DiyFp w = Double(v).AsNormalizedDiyFp(); - // boundary_minus and boundary_plus are the boundaries between v and its - // closest floating-point neighbors. Any number strictly between - // boundary_minus and boundary_plus will round to v when convert to a double. - // Grisu3 will never output representations that lie exactly on a boundary. - DiyFp boundary_minus, boundary_plus; - Double(v).NormalizedBoundaries(&boundary_minus, &boundary_plus); - ASSERT(boundary_plus.e() == w.e()); - DiyFp ten_mk; // Cached power of ten: 10^-k - int mk; // -k - int ten_mk_minimal_binary_exponent = - kMinimalTargetExponent - (w.e() + DiyFp::kSignificandSize); - int ten_mk_maximal_binary_exponent = - kMaximalTargetExponent - (w.e() + DiyFp::kSignificandSize); - PowersOfTenCache::GetCachedPowerForBinaryExponentRange( - ten_mk_minimal_binary_exponent, ten_mk_maximal_binary_exponent, &ten_mk, - &mk); - ASSERT( - (kMinimalTargetExponent <= - w.e() + ten_mk.e() + DiyFp::kSignificandSize) && - (kMaximalTargetExponent >= w.e() + ten_mk.e() + DiyFp::kSignificandSize)); - // Note that ten_mk is only an approximation of 10^-k. A DiyFp only contains a - // 64 bit significand and ten_mk is thus only precise up to 64 bits. - - // The DiyFp::Times procedure rounds its result, and ten_mk is approximated - // too. The variable scaled_w (as well as scaled_boundary_minus/plus) are now - // off by a small amount. - // In fact: scaled_w - w*10^k < 1ulp (unit in the last place) of scaled_w. - // In other words: let f = scaled_w.f() and e = scaled_w.e(), then - // (f-1) * 2^e < w*10^k < (f+1) * 2^e - DiyFp scaled_w = DiyFp::Times(w, ten_mk); - ASSERT(scaled_w.e() == - boundary_plus.e() + ten_mk.e() + DiyFp::kSignificandSize); - // In theory it would be possible to avoid some recomputations by computing - // the difference between w and boundary_minus/plus (a power of 2) and to - // compute scaled_boundary_minus/plus by subtracting/adding from - // scaled_w. However the code becomes much less readable and the speed - // enhancements are not terriffic. - DiyFp scaled_boundary_minus = DiyFp::Times(boundary_minus, ten_mk); - DiyFp scaled_boundary_plus = DiyFp::Times(boundary_plus, ten_mk); - - // DigitGen will generate the digits of scaled_w. Therefore we have - // v == (double) (scaled_w * 10^-mk). - // Set decimal_exponent == -mk and pass it to DigitGen. If scaled_w is not an - // integer than it will be updated. For instance if scaled_w == 1.23 then - // the buffer will be filled with "123" und the decimal_exponent will be - // decreased by 2. - int kappa; - bool result = DigitGen(scaled_boundary_minus, scaled_w, scaled_boundary_plus, - buffer, length, &kappa); - *decimal_exponent = -mk + kappa; - return result; -} - -// The "counted" version of grisu3 (see above) only generates requested_digits -// number of digits. This version does not generate the shortest representation, -// and with enough requested digits 0.1 will at some point print as 0.9999999... -// Grisu3 is too imprecise for real halfway cases (1.5 will not work) and -// therefore the rounding strategy for halfway cases is irrelevant. -static bool Grisu3Counted(double v, - int requested_digits, - Vector buffer, - int* length, - int* decimal_exponent) { - DiyFp w = Double(v).AsNormalizedDiyFp(); - DiyFp ten_mk; // Cached power of ten: 10^-k - int mk; // -k - int ten_mk_minimal_binary_exponent = - kMinimalTargetExponent - (w.e() + DiyFp::kSignificandSize); - int ten_mk_maximal_binary_exponent = - kMaximalTargetExponent - (w.e() + DiyFp::kSignificandSize); - PowersOfTenCache::GetCachedPowerForBinaryExponentRange( - ten_mk_minimal_binary_exponent, ten_mk_maximal_binary_exponent, &ten_mk, - &mk); - ASSERT( - (kMinimalTargetExponent <= - w.e() + ten_mk.e() + DiyFp::kSignificandSize) && - (kMaximalTargetExponent >= w.e() + ten_mk.e() + DiyFp::kSignificandSize)); - // Note that ten_mk is only an approximation of 10^-k. A DiyFp only contains a - // 64 bit significand and ten_mk is thus only precise up to 64 bits. - - // The DiyFp::Times procedure rounds its result, and ten_mk is approximated - // too. The variable scaled_w (as well as scaled_boundary_minus/plus) are now - // off by a small amount. - // In fact: scaled_w - w*10^k < 1ulp (unit in the last place) of scaled_w. - // In other words: let f = scaled_w.f() and e = scaled_w.e(), then - // (f-1) * 2^e < w*10^k < (f+1) * 2^e - DiyFp scaled_w = DiyFp::Times(w, ten_mk); - - // We now have (double) (scaled_w * 10^-mk). - // DigitGen will generate the first requested_digits digits of scaled_w and - // return together with a kappa such that scaled_w ~= buffer * 10^kappa. (It - // will not always be exactly the same since DigitGenCounted only produces a - // limited number of digits.) - int kappa; - bool result = - DigitGenCounted(scaled_w, requested_digits, buffer, length, &kappa); - *decimal_exponent = -mk + kappa; - return result; -} - -bool FastDtoa(double v, - FastDtoaMode mode, - int requested_digits, - Vector buffer, - int* length, - int* decimal_point) { - ASSERT(v > 0); - ASSERT(!Double(v).IsSpecial()); - - bool result = false; - int decimal_exponent = 0; - switch (mode) { - case FAST_DTOA_SHORTEST: - result = Grisu3(v, buffer, length, &decimal_exponent); - break; - case FAST_DTOA_PRECISION: - result = - Grisu3Counted(v, requested_digits, buffer, length, &decimal_exponent); - break; - default: - UNREACHABLE(); - } - if (result) { - *decimal_point = *length + decimal_exponent; - buffer[*length] = '\0'; - } - return result; -} - -} // namespace double_conversion - -} // namespace WTF diff --git a/sky/engine/wtf/dtoa/fast-dtoa.h b/sky/engine/wtf/dtoa/fast-dtoa.h deleted file mode 100644 index 25c70126f812a..0000000000000 --- a/sky/engine/wtf/dtoa/fast-dtoa.h +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_FAST_DTOA_H_ -#define SKY_ENGINE_WTF_DTOA_FAST_DTOA_H_ - -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -enum FastDtoaMode { - // Computes the shortest representation of the given input. The returned - // result will be the most accurate number of this length. Longer - // representations might be more accurate. - FAST_DTOA_SHORTEST, - // Computes a representation where the precision (number of digits) is - // given as input. The precision is independent of the decimal point. - FAST_DTOA_PRECISION -}; - -// FastDtoa will produce at most kFastDtoaMaximalLength digits. This does not -// include the terminating '\0' character. -static const int kFastDtoaMaximalLength = 17; - -// Provides a decimal representation of v. -// The result should be interpreted as buffer * 10^(point - length). -// -// Precondition: -// * v must be a strictly positive finite double. -// -// Returns true if it succeeds, otherwise the result can not be trusted. -// There will be *length digits inside the buffer followed by a null terminator. -// If the function returns true and mode equals -// - FAST_DTOA_SHORTEST, then -// the parameter requested_digits is ignored. -// The result satisfies -// v == (double) (buffer * 10^(point - length)). -// The digits in the buffer are the shortest representation possible. E.g. -// if 0.099999999999 and 0.1 represent the same double then "1" is returned -// with point = 0. -// The last digit will be closest to the actual v. That is, even if several -// digits might correctly yield 'v' when read again, the buffer will contain -// the one closest to v. -// - FAST_DTOA_PRECISION, then -// the buffer contains requested_digits digits. -// the difference v - (buffer * 10^(point-length)) is closest to zero for -// all possible representations of requested_digits digits. -// If there are two values that are equally close, then FastDtoa returns -// false. -// For both modes the buffer must be large enough to hold the result. -bool FastDtoa(double d, - FastDtoaMode mode, - int requested_digits, - Vector buffer, - int* length, - int* decimal_point); - -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_FAST_DTOA_H_ diff --git a/sky/engine/wtf/dtoa/fixed-dtoa.cc b/sky/engine/wtf/dtoa/fixed-dtoa.cc deleted file mode 100644 index 2671701a0da8c..0000000000000 --- a/sky/engine/wtf/dtoa/fixed-dtoa.cc +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include "fixed-dtoa.h" -#include "flutter/sky/engine/wtf/dtoa/double.h" - -namespace WTF { - -namespace double_conversion { - -// Represents a 128bit type. This class should be replaced by a native type on -// platforms that support 128bit integers. -class UInt128 { - public: - UInt128() : high_bits_(0), low_bits_(0) {} - UInt128(uint64_t high, uint64_t low) : high_bits_(high), low_bits_(low) {} - - void Multiply(uint32_t multiplicand) { - uint64_t accumulator; - - accumulator = (low_bits_ & kMask32) * multiplicand; - uint32_t part = static_cast(accumulator & kMask32); - accumulator >>= 32; - accumulator = accumulator + (low_bits_ >> 32) * multiplicand; - low_bits_ = (accumulator << 32) + part; - accumulator >>= 32; - accumulator = accumulator + (high_bits_ & kMask32) * multiplicand; - part = static_cast(accumulator & kMask32); - accumulator >>= 32; - accumulator = accumulator + (high_bits_ >> 32) * multiplicand; - high_bits_ = (accumulator << 32) + part; - ASSERT((accumulator >> 32) == 0); - } - - void Shift(int shift_amount) { - ASSERT(-64 <= shift_amount && shift_amount <= 64); - if (shift_amount == 0) { - return; - } else if (shift_amount == -64) { - high_bits_ = low_bits_; - low_bits_ = 0; - } else if (shift_amount == 64) { - low_bits_ = high_bits_; - high_bits_ = 0; - } else if (shift_amount <= 0) { - high_bits_ <<= -shift_amount; - high_bits_ += low_bits_ >> (64 + shift_amount); - low_bits_ <<= -shift_amount; - } else { - low_bits_ >>= shift_amount; - low_bits_ += high_bits_ << (64 - shift_amount); - high_bits_ >>= shift_amount; - } - } - - // Modifies *this to *this MOD (2^power). - // Returns *this DIV (2^power). - int DivModPowerOf2(int power) { - if (power >= 64) { - int result = static_cast(high_bits_ >> (power - 64)); - high_bits_ -= static_cast(result) << (power - 64); - return result; - } else { - uint64_t part_low = low_bits_ >> power; - uint64_t part_high = high_bits_ << (64 - power); - int result = static_cast(part_low + part_high); - high_bits_ = 0; - low_bits_ -= part_low << power; - return result; - } - } - - bool IsZero() const { return high_bits_ == 0 && low_bits_ == 0; } - - int BitAt(int position) { - if (position >= 64) { - return static_cast(high_bits_ >> (position - 64)) & 1; - } else { - return static_cast(low_bits_ >> position) & 1; - } - } - - private: - static const uint64_t kMask32 = 0xFFFFFFFF; - // Value == (high_bits_ << 64) + low_bits_ - uint64_t high_bits_; - uint64_t low_bits_; -}; - -static const int kDoubleSignificandSize = 53; // Includes the hidden bit. - -static void FillDigits32FixedLength(uint32_t number, - int requested_length, - Vector buffer, - int* length) { - for (int i = requested_length - 1; i >= 0; --i) { - buffer[(*length) + i] = '0' + number % 10; - number /= 10; - } - *length += requested_length; -} - -static void FillDigits32(uint32_t number, Vector buffer, int* length) { - int number_length = 0; - // We fill the digits in reverse order and exchange them afterwards. - while (number != 0) { - int digit = number % 10; - number /= 10; - buffer[(*length) + number_length] = '0' + digit; - number_length++; - } - // Exchange the digits. - int i = *length; - int j = *length + number_length - 1; - while (i < j) { - char tmp = buffer[i]; - buffer[i] = buffer[j]; - buffer[j] = tmp; - i++; - j--; - } - *length += number_length; -} - -static void FillDigits64FixedLength(uint64_t number, - int, - Vector buffer, - int* length) { - const uint32_t kTen7 = 10000000; - // For efficiency cut the number into 3 uint32_t parts, and print those. - uint32_t part2 = static_cast(number % kTen7); - number /= kTen7; - uint32_t part1 = static_cast(number % kTen7); - uint32_t part0 = static_cast(number / kTen7); - - FillDigits32FixedLength(part0, 3, buffer, length); - FillDigits32FixedLength(part1, 7, buffer, length); - FillDigits32FixedLength(part2, 7, buffer, length); -} - -static void FillDigits64(uint64_t number, Vector buffer, int* length) { - const uint32_t kTen7 = 10000000; - // For efficiency cut the number into 3 uint32_t parts, and print those. - uint32_t part2 = static_cast(number % kTen7); - number /= kTen7; - uint32_t part1 = static_cast(number % kTen7); - uint32_t part0 = static_cast(number / kTen7); - - if (part0 != 0) { - FillDigits32(part0, buffer, length); - FillDigits32FixedLength(part1, 7, buffer, length); - FillDigits32FixedLength(part2, 7, buffer, length); - } else if (part1 != 0) { - FillDigits32(part1, buffer, length); - FillDigits32FixedLength(part2, 7, buffer, length); - } else { - FillDigits32(part2, buffer, length); - } -} - -static void RoundUp(Vector buffer, int* length, int* decimal_point) { - // An empty buffer represents 0. - if (*length == 0) { - buffer[0] = '1'; - *decimal_point = 1; - *length = 1; - return; - } - // Round the last digit until we either have a digit that was not '9' or until - // we reached the first digit. - buffer[(*length) - 1]++; - for (int i = (*length) - 1; i > 0; --i) { - if (buffer[i] != '0' + 10) { - return; - } - buffer[i] = '0'; - buffer[i - 1]++; - } - // If the first digit is now '0' + 10, we would need to set it to '0' and add - // a '1' in front. However we reach the first digit only if all following - // digits had been '9' before rounding up. Now all trailing digits are '0' and - // we simply switch the first digit to '1' and update the decimal-point - // (indicating that the point is now one digit to the right). - if (buffer[0] == '0' + 10) { - buffer[0] = '1'; - (*decimal_point)++; - } -} - -// The given fractionals number represents a fixed-point number with binary -// point at bit (-exponent). -// Preconditions: -// -128 <= exponent <= 0. -// 0 <= fractionals * 2^exponent < 1 -// The buffer holds the result. -// The function will round its result. During the rounding-process digits not -// generated by this function might be updated, and the decimal-point variable -// might be updated. If this function generates the digits 99 and the buffer -// already contained "199" (thus yielding a buffer of "19999") then a -// rounding-up will change the contents of the buffer to "20000". -static void FillFractionals(uint64_t fractionals, - int exponent, - int fractional_count, - Vector buffer, - int* length, - int* decimal_point) { - ASSERT(-128 <= exponent && exponent <= 0); - // 'fractionals' is a fixed-point number, with binary point at bit - // (-exponent). Inside the function the non-converted remainder of fractionals - // is a fixed-point number, with binary point at bit 'point'. - if (-exponent <= 64) { - // One 64 bit number is sufficient. - ASSERT(fractionals >> 56 == 0); - int point = -exponent; - for (int i = 0; i < fractional_count; ++i) { - if (fractionals == 0) - break; - // Instead of multiplying by 10 we multiply by 5 and adjust the point - // location. This way the fractionals variable will not overflow. - // Invariant at the beginning of the loop: fractionals < 2^point. - // Initially we have: point <= 64 and fractionals < 2^56 - // After each iteration the point is decremented by one. - // Note that 5^3 = 125 < 128 = 2^7. - // Therefore three iterations of this loop will not overflow fractionals - // (even without the subtraction at the end of the loop body). At this - // time point will satisfy point <= 61 and therefore fractionals < 2^point - // and any further multiplication of fractionals by 5 will not overflow. - fractionals *= 5; - point--; - int digit = static_cast(fractionals >> point); - buffer[*length] = '0' + digit; - (*length)++; - fractionals -= static_cast(digit) << point; - } - // If the first bit after the point is set we have to round up. - if (((fractionals >> (point - 1)) & 1) == 1) { - RoundUp(buffer, length, decimal_point); - } - } else { // We need 128 bits. - ASSERT(64 < -exponent && -exponent <= 128); - UInt128 fractionals128 = UInt128(fractionals, 0); - fractionals128.Shift(-exponent - 64); - int point = 128; - for (int i = 0; i < fractional_count; ++i) { - if (fractionals128.IsZero()) - break; - // As before: instead of multiplying by 10 we multiply by 5 and adjust the - // point location. - // This multiplication will not overflow for the same reasons as before. - fractionals128.Multiply(5); - point--; - int digit = fractionals128.DivModPowerOf2(point); - buffer[*length] = '0' + digit; - (*length)++; - } - if (fractionals128.BitAt(point - 1) == 1) { - RoundUp(buffer, length, decimal_point); - } - } -} - -// Removes leading and trailing zeros. -// If leading zeros are removed then the decimal point position is adjusted. -static void TrimZeros(Vector buffer, int* length, int* decimal_point) { - while (*length > 0 && buffer[(*length) - 1] == '0') { - (*length)--; - } - int first_non_zero = 0; - while (first_non_zero < *length && buffer[first_non_zero] == '0') { - first_non_zero++; - } - if (first_non_zero != 0) { - for (int i = first_non_zero; i < *length; ++i) { - buffer[i - first_non_zero] = buffer[i]; - } - *length -= first_non_zero; - *decimal_point -= first_non_zero; - } -} - -bool FastFixedDtoa(double v, - int fractional_count, - Vector buffer, - int* length, - int* decimal_point) { - const uint32_t kMaxUInt32 = 0xFFFFFFFF; - uint64_t significand = Double(v).Significand(); - int exponent = Double(v).Exponent(); - // v = significand * 2^exponent (with significand a 53bit integer). - // If the exponent is larger than 20 (i.e. we may have a 73bit number) then we - // don't know how to compute the representation. 2^73 ~= 9.5*10^21. - // If necessary this limit could probably be increased, but we don't need - // more. - if (exponent > 20) - return false; - if (fractional_count > 20) - return false; - *length = 0; - // At most kDoubleSignificandSize bits of the significand are non-zero. - // Given a 64 bit integer we have 11 0s followed by 53 potentially non-zero - // bits: 0..11*..0xxx..53*..xx - if (exponent + kDoubleSignificandSize > 64) { - // The exponent must be > 11. - // - // We know that v = significand * 2^exponent. - // And the exponent > 11. - // We simplify the task by dividing v by 10^17. - // The quotient delivers the first digits, and the remainder fits into a 64 - // bit number. - // Dividing by 10^17 is equivalent to dividing by 5^17*2^17. - const uint64_t kFive17 = UINT64_2PART_C(0xB1, A2BC2EC5); // 5^17 - uint64_t divisor = kFive17; - int divisor_power = 17; - uint64_t dividend = significand; - uint32_t quotient; - uint64_t remainder; - // Let v = f * 2^e with f == significand and e == exponent. - // Then need q (quotient) and r (remainder) as follows: - // v = q * 10^17 + r - // f * 2^e = q * 10^17 + r - // f * 2^e = q * 5^17 * 2^17 + r - // If e > 17 then - // f * 2^(e-17) = q * 5^17 + r/2^17 - // else - // f = q * 5^17 * 2^(17-e) + r/2^e - if (exponent > divisor_power) { - // We only allow exponents of up to 20 and therefore (17 - e) <= 3 - dividend <<= exponent - divisor_power; - quotient = static_cast(dividend / divisor); - remainder = (dividend % divisor) << divisor_power; - } else { - divisor <<= divisor_power - exponent; - quotient = static_cast(dividend / divisor); - remainder = (dividend % divisor) << exponent; - } - FillDigits32(quotient, buffer, length); - FillDigits64FixedLength(remainder, divisor_power, buffer, length); - *decimal_point = *length; - } else if (exponent >= 0) { - // 0 <= exponent <= 11 - significand <<= exponent; - FillDigits64(significand, buffer, length); - *decimal_point = *length; - } else if (exponent > -kDoubleSignificandSize) { - // We have to cut the number. - uint64_t integrals = significand >> -exponent; - uint64_t fractionals = significand - (integrals << -exponent); - if (integrals > kMaxUInt32) { - FillDigits64(integrals, buffer, length); - } else { - FillDigits32(static_cast(integrals), buffer, length); - } - *decimal_point = *length; - FillFractionals(fractionals, exponent, fractional_count, buffer, length, - decimal_point); - } else if (exponent < -128) { - // This configuration (with at most 20 digits) means that all digits must be - // 0. - ASSERT(fractional_count <= 20); - buffer[0] = '\0'; - *length = 0; - *decimal_point = -fractional_count; - } else { - *decimal_point = 0; - FillFractionals(significand, exponent, fractional_count, buffer, length, - decimal_point); - } - TrimZeros(buffer, length, decimal_point); - buffer[*length] = '\0'; - if ((*length) == 0) { - // The string is empty and the decimal_point thus has no importance. Mimick - // Gay's dtoa and and set it to -fractional_count. - *decimal_point = -fractional_count; - } - return true; -} - -} // namespace double_conversion - -} // namespace WTF diff --git a/sky/engine/wtf/dtoa/fixed-dtoa.h b/sky/engine/wtf/dtoa/fixed-dtoa.h deleted file mode 100644 index 57528c81962ee..0000000000000 --- a/sky/engine/wtf/dtoa/fixed-dtoa.h +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_FIXED_DTOA_H_ -#define SKY_ENGINE_WTF_DTOA_FIXED_DTOA_H_ - -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -// Produces digits necessary to print a given number with -// 'fractional_count' digits after the decimal point. -// The buffer must be big enough to hold the result plus one terminating null -// character. -// -// The produced digits might be too short in which case the caller has to fill -// the gaps with '0's. -// Example: FastFixedDtoa(0.001, 5, ...) is allowed to return buffer = "1", and -// decimal_point = -2. -// Halfway cases are rounded towards +/-Infinity (away from 0). The call -// FastFixedDtoa(0.15, 2, ...) thus returns buffer = "2", decimal_point = 0. -// The returned buffer may contain digits that would be truncated from the -// shortest representation of the input. -// -// This method only works for some parameters. If it can't handle the input it -// returns false. The output is null-terminated when the function succeeds. -bool FastFixedDtoa(double v, - int fractional_count, - Vector buffer, - int* length, - int* decimal_point); - -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_FIXED_DTOA_H_ diff --git a/sky/engine/wtf/dtoa/strtod.cc b/sky/engine/wtf/dtoa/strtod.cc deleted file mode 100644 index 56dc41f8d0c6d..0000000000000 --- a/sky/engine/wtf/dtoa/strtod.cc +++ /dev/null @@ -1,429 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#include "cached-powers.h" -#include "flutter/sky/engine/wtf/dtoa/bignum.h" -#include "flutter/sky/engine/wtf/dtoa/double.h" -#include "flutter/sky/engine/wtf/dtoa/strtod.h" - -namespace WTF { - -namespace double_conversion { - -// 2^53 = 9007199254740992. -// Any integer with at most 15 decimal digits will hence fit into a double -// (which has a 53bit significand) without loss of precision. -static const int kMaxExactDoubleIntegerDecimalDigits = 15; -// 2^64 = 18446744073709551616 > 10^19 -static const int kMaxUint64DecimalDigits = 19; - -// Max double: 1.7976931348623157 x 10^308 -// Min non-zero double: 4.9406564584124654 x 10^-324 -// Any x >= 10^309 is interpreted as +infinity. -// Any x <= 10^-324 is interpreted as 0. -// Note that 2.5e-324 (despite being smaller than the min double) will be read -// as non-zero (equal to the min non-zero double). -static const int kMaxDecimalPower = 309; -static const int kMinDecimalPower = -324; - -// 2^64 = 18446744073709551616 -static const uint64_t kMaxUint64 = UINT64_2PART_C(0xFFFFFFFF, FFFFFFFF); - -static const double exact_powers_of_ten[] = { - 1.0, // 10^0 - 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0, 100000000.0, - 1000000000.0, - 10000000000.0, // 10^10 - 100000000000.0, 1000000000000.0, 10000000000000.0, 100000000000000.0, - 1000000000000000.0, 10000000000000000.0, 100000000000000000.0, - 1000000000000000000.0, 10000000000000000000.0, - 100000000000000000000.0, // 10^20 - 1000000000000000000000.0, - // 10^22 = 0x21e19e0c9bab2400000 = 0x878678326eac9 * 2^22 - 10000000000000000000000.0}; -static const int kExactPowersOfTenSize = ARRAY_SIZE(exact_powers_of_ten); - -// Maximum number of significant digits in the decimal representation. -// In fact the value is 772 (see conversions.cc), but to give us some margin -// we round up to 780. -static const int kMaxSignificantDecimalDigits = 780; - -static Vector TrimLeadingZeros(Vector buffer) { - for (int i = 0; i < buffer.length(); i++) { - if (buffer[i] != '0') { - return buffer.SubVector(i, buffer.length()); - } - } - return Vector(buffer.start(), 0); -} - -static Vector TrimTrailingZeros(Vector buffer) { - for (int i = buffer.length() - 1; i >= 0; --i) { - if (buffer[i] != '0') { - return buffer.SubVector(0, i + 1); - } - } - return Vector(buffer.start(), 0); -} - -static void TrimToMaxSignificantDigits(Vector buffer, - int exponent, - char* significant_buffer, - int* significant_exponent) { - for (int i = 0; i < kMaxSignificantDecimalDigits - 1; ++i) { - significant_buffer[i] = buffer[i]; - } - // The input buffer has been trimmed. Therefore the last digit must be - // different from '0'. - ASSERT(buffer[buffer.length() - 1] != '0'); - // Set the last digit to be non-zero. This is sufficient to guarantee - // correct rounding. - significant_buffer[kMaxSignificantDecimalDigits - 1] = '1'; - *significant_exponent = - exponent + (buffer.length() - kMaxSignificantDecimalDigits); -} - -// Reads digits from the buffer and converts them to a uint64. -// Reads in as many digits as fit into a uint64. -// When the string starts with "1844674407370955161" no further digit is read. -// Since 2^64 = 18446744073709551616 it would still be possible read another -// digit if it was less or equal than 6, but this would complicate the code. -static uint64_t ReadUint64(Vector buffer, - int* number_of_read_digits) { - uint64_t result = 0; - int i = 0; - while (i < buffer.length() && result <= (kMaxUint64 / 10 - 1)) { - int digit = buffer[i++] - '0'; - ASSERT(0 <= digit && digit <= 9); - result = 10 * result + digit; - } - *number_of_read_digits = i; - return result; -} - -// Reads a DiyFp from the buffer. -// The returned DiyFp is not necessarily normalized. -// If remaining_decimals is zero then the returned DiyFp is accurate. -// Otherwise it has been rounded and has error of at most 1/2 ulp. -static void ReadDiyFp(Vector buffer, - DiyFp* result, - int* remaining_decimals) { - int read_digits; - uint64_t significand = ReadUint64(buffer, &read_digits); - if (buffer.length() == read_digits) { - *result = DiyFp(significand, 0); - *remaining_decimals = 0; - } else { - // Round the significand. - if (buffer[read_digits] >= '5') { - significand++; - } - // Compute the binary exponent. - int exponent = 0; - *result = DiyFp(significand, exponent); - *remaining_decimals = buffer.length() - read_digits; - } -} - -static bool DoubleStrtod(Vector trimmed, - int exponent, - double* result) { -#if !defined(DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS) - // On x86 the floating-point stack can be 64 or 80 bits wide. If it is - // 80 bits wide (as is the case on Linux) then double-rounding occurs and the - // result is not accurate. - // We know that Windows32 uses 64 bits and is therefore accurate. - // Note that the ARM simulator is compiled for 32bits. It therefore exhibits - // the same problem. - return false; -#endif - if (trimmed.length() <= kMaxExactDoubleIntegerDecimalDigits) { - int read_digits; - // The trimmed input fits into a double. - // If the 10^exponent (resp. 10^-exponent) fits into a double too then we - // can compute the result-double simply by multiplying (resp. dividing) the - // two numbers. - // This is possible because IEEE guarantees that floating-point operations - // return the best possible approximation. - if (exponent < 0 && -exponent < kExactPowersOfTenSize) { - // 10^-exponent fits into a double. - *result = static_cast(ReadUint64(trimmed, &read_digits)); - ASSERT(read_digits == trimmed.length()); - *result /= exact_powers_of_ten[-exponent]; - return true; - } - if (0 <= exponent && exponent < kExactPowersOfTenSize) { - // 10^exponent fits into a double. - *result = static_cast(ReadUint64(trimmed, &read_digits)); - ASSERT(read_digits == trimmed.length()); - *result *= exact_powers_of_ten[exponent]; - return true; - } - int remaining_digits = - kMaxExactDoubleIntegerDecimalDigits - trimmed.length(); - if ((0 <= exponent) && - (exponent - remaining_digits < kExactPowersOfTenSize)) { - // The trimmed string was short and we can multiply it with - // 10^remaining_digits. As a result the remaining exponent now fits - // into a double too. - *result = static_cast(ReadUint64(trimmed, &read_digits)); - ASSERT(read_digits == trimmed.length()); - *result *= exact_powers_of_ten[remaining_digits]; - *result *= exact_powers_of_ten[exponent - remaining_digits]; - return true; - } - } - return false; -} - -// Returns 10^exponent as an exact DiyFp. -// The given exponent must be in the range [1; kDecimalExponentDistance[. -static DiyFp AdjustmentPowerOfTen(int exponent) { - ASSERT(0 < exponent); - ASSERT(exponent < PowersOfTenCache::kDecimalExponentDistance); - // Simply hardcode the remaining powers for the given decimal exponent - // distance. - ASSERT(PowersOfTenCache::kDecimalExponentDistance == 8); - switch (exponent) { - case 1: - return DiyFp(UINT64_2PART_C(0xa0000000, 00000000), -60); - case 2: - return DiyFp(UINT64_2PART_C(0xc8000000, 00000000), -57); - case 3: - return DiyFp(UINT64_2PART_C(0xfa000000, 00000000), -54); - case 4: - return DiyFp(UINT64_2PART_C(0x9c400000, 00000000), -50); - case 5: - return DiyFp(UINT64_2PART_C(0xc3500000, 00000000), -47); - case 6: - return DiyFp(UINT64_2PART_C(0xf4240000, 00000000), -44); - case 7: - return DiyFp(UINT64_2PART_C(0x98968000, 00000000), -40); - default: - UNREACHABLE(); - return DiyFp(0, 0); - } -} - -// If the function returns true then the result is the correct double. -// Otherwise it is either the correct double or the double that is just below -// the correct double. -static bool DiyFpStrtod(Vector buffer, - int exponent, - double* result) { - DiyFp input; - int remaining_decimals; - ReadDiyFp(buffer, &input, &remaining_decimals); - // Since we may have dropped some digits the input is not accurate. - // If remaining_decimals is different than 0 than the error is at most - // .5 ulp (unit in the last place). - // We don't want to deal with fractions and therefore keep a common - // denominator. - const int kDenominatorLog = 3; - const int kDenominator = 1 << kDenominatorLog; - // Move the remaining decimals into the exponent. - exponent += remaining_decimals; - int error = (remaining_decimals == 0 ? 0 : kDenominator / 2); - - int old_e = input.e(); - input.Normalize(); - error <<= old_e - input.e(); - - ASSERT(exponent <= PowersOfTenCache::kMaxDecimalExponent); - if (exponent < PowersOfTenCache::kMinDecimalExponent) { - *result = 0.0; - return true; - } - DiyFp cached_power; - int cached_decimal_exponent; - PowersOfTenCache::GetCachedPowerForDecimalExponent(exponent, &cached_power, - &cached_decimal_exponent); - - if (cached_decimal_exponent != exponent) { - int adjustment_exponent = exponent - cached_decimal_exponent; - DiyFp adjustment_power = AdjustmentPowerOfTen(adjustment_exponent); - input.Multiply(adjustment_power); - if (kMaxUint64DecimalDigits - buffer.length() >= adjustment_exponent) { - // The product of input with the adjustment power fits into a 64 bit - // integer. - ASSERT(DiyFp::kSignificandSize == 64); - } else { - // The adjustment power is exact. There is hence only an error of 0.5. - error += kDenominator / 2; - } - } - - input.Multiply(cached_power); - // The error introduced by a multiplication of a*b equals - // error_a + error_b + error_a*error_b/2^64 + 0.5 - // Substituting a with 'input' and b with 'cached_power' we have - // error_b = 0.5 (all cached powers have an error of less than 0.5 ulp), - // error_ab = 0 or 1 / kDenominator > error_a*error_b/ 2^64 - int error_b = kDenominator / 2; - int error_ab = (error == 0 ? 0 : 1); // We round up to 1. - int fixed_error = kDenominator / 2; - error += error_b + error_ab + fixed_error; - - old_e = input.e(); - input.Normalize(); - error <<= old_e - input.e(); - - // See if the double's significand changes if we add/subtract the error. - int order_of_magnitude = DiyFp::kSignificandSize + input.e(); - int effective_significand_size = - Double::SignificandSizeForOrderOfMagnitude(order_of_magnitude); - int precision_digits_count = - DiyFp::kSignificandSize - effective_significand_size; - if (precision_digits_count + kDenominatorLog >= DiyFp::kSignificandSize) { - // This can only happen for very small denormals. In this case the - // half-way multiplied by the denominator exceeds the range of an uint64. - // Simply shift everything to the right. - int shift_amount = (precision_digits_count + kDenominatorLog) - - DiyFp::kSignificandSize + 1; - input.set_f(input.f() >> shift_amount); - input.set_e(input.e() + shift_amount); - // We add 1 for the lost precision of error, and kDenominator for - // the lost precision of input.f(). - error = (error >> shift_amount) + 1 + kDenominator; - precision_digits_count -= shift_amount; - } - // We use uint64_ts now. This only works if the DiyFp uses uint64_ts too. - ASSERT(DiyFp::kSignificandSize == 64); - ASSERT(precision_digits_count < 64); - uint64_t one64 = 1; - uint64_t precision_bits_mask = (one64 << precision_digits_count) - 1; - uint64_t precision_bits = input.f() & precision_bits_mask; - uint64_t half_way = one64 << (precision_digits_count - 1); - precision_bits *= kDenominator; - half_way *= kDenominator; - DiyFp rounded_input(input.f() >> precision_digits_count, - input.e() + precision_digits_count); - if (precision_bits >= half_way + error) { - rounded_input.set_f(rounded_input.f() + 1); - } - // If the last_bits are too close to the half-way case than we are too - // inaccurate and round down. In this case we return false so that we can - // fall back to a more precise algorithm. - - *result = Double(rounded_input).value(); - if (half_way - error < precision_bits && precision_bits < half_way + error) { - // Too imprecise. The caller will have to fall back to a slower version. - // However the returned number is guaranteed to be either the correct - // double, or the next-lower double. - return false; - } else { - return true; - } -} - -// Returns the correct double for the buffer*10^exponent. -// The variable guess should be a close guess that is either the correct double -// or its lower neighbor (the nearest double less than the correct one). -// Preconditions: -// buffer.length() + exponent <= kMaxDecimalPower + 1 -// buffer.length() + exponent > kMinDecimalPower -// buffer.length() <= kMaxDecimalSignificantDigits -static double BignumStrtod(Vector buffer, - int exponent, - double guess) { - if (guess == Double::Infinity()) { - return guess; - } - - DiyFp upper_boundary = Double(guess).UpperBoundary(); - - ASSERT(buffer.length() + exponent <= kMaxDecimalPower + 1); - ASSERT(buffer.length() + exponent > kMinDecimalPower); - ASSERT(buffer.length() <= kMaxSignificantDecimalDigits); - // Make sure that the Bignum will be able to hold all our numbers. - // Our Bignum implementation has a separate field for exponents. Shifts will - // consume at most one bigit (< 64 bits). - // ln(10) == 3.3219... - ASSERT(((kMaxDecimalPower + 1) * 333 / 100) < Bignum::kMaxSignificantBits); - Bignum input; - Bignum boundary; - input.AssignDecimalString(buffer); - boundary.AssignUInt64(upper_boundary.f()); - if (exponent >= 0) { - input.MultiplyByPowerOfTen(exponent); - } else { - boundary.MultiplyByPowerOfTen(-exponent); - } - if (upper_boundary.e() > 0) { - boundary.Shifxleft(upper_boundary.e()); - } else { - input.Shifxleft(-upper_boundary.e()); - } - int comparison = Bignum::Compare(input, boundary); - if (comparison < 0) { - return guess; - } else if (comparison > 0) { - return Double(guess).NextDouble(); - } else if ((Double(guess).Significand() & 1) == 0) { - // Round towards even. - return guess; - } else { - return Double(guess).NextDouble(); - } -} - -double Strtod(Vector buffer, int exponent) { - Vector left_trimmed = TrimLeadingZeros(buffer); - Vector trimmed = TrimTrailingZeros(left_trimmed); - exponent += left_trimmed.length() - trimmed.length(); - if (trimmed.length() == 0) - return 0.0; - if (trimmed.length() > kMaxSignificantDecimalDigits) { - char significant_buffer[kMaxSignificantDecimalDigits]; - int significant_exponent; - TrimToMaxSignificantDigits(trimmed, exponent, significant_buffer, - &significant_exponent); - return Strtod( - Vector(significant_buffer, kMaxSignificantDecimalDigits), - significant_exponent); - } - if (exponent + trimmed.length() - 1 >= kMaxDecimalPower) { - return Double::Infinity(); - } - if (exponent + trimmed.length() <= kMinDecimalPower) { - return 0.0; - } - - double guess; - if (DoubleStrtod(trimmed, exponent, &guess) || - DiyFpStrtod(trimmed, exponent, &guess)) { - return guess; - } - return BignumStrtod(trimmed, exponent, guess); -} - -} // namespace double_conversion - -} // namespace WTF diff --git a/sky/engine/wtf/dtoa/strtod.h b/sky/engine/wtf/dtoa/strtod.h deleted file mode 100644 index 997a05ceb722a..0000000000000 --- a/sky/engine/wtf/dtoa/strtod.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_STRTOD_H_ -#define SKY_ENGINE_WTF_DTOA_STRTOD_H_ - -#include "flutter/sky/engine/wtf/dtoa/utils.h" - -namespace WTF { - -namespace double_conversion { - -// The buffer must only contain digits in the range [0-9]. It must not -// contain a dot or a sign. It must not start with '0', and must not be empty. -double Strtod(Vector buffer, int exponent); - -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_STRTOD_H_ diff --git a/sky/engine/wtf/dtoa/utils.h b/sky/engine/wtf/dtoa/utils.h deleted file mode 100644 index d1ea29257b17b..0000000000000 --- a/sky/engine/wtf/dtoa/utils.h +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright 2010 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifndef SKY_ENGINE_WTF_DTOA_UTILS_H_ -#define SKY_ENGINE_WTF_DTOA_UTILS_H_ - -#include - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "lib/fxl/macros.h" - -#define UNIMPLEMENTED ASSERT_NOT_REACHED -#define UNREACHABLE ASSERT_NOT_REACHED - -// Double operations detection based on target architecture. -// Linux uses a 80bit wide floating point stack on x86. This induces double -// rounding, which in turn leads to wrong results. -// An easy way to test if the floating-point operations are correct is to -// evaluate: 89255.0/1e22. If the floating-point stack is 64 bits wide then -// the result is equal to 89255e-22. -// The best way to test this, is to create a division-function and to compare -// the output of the division with the expected result. (Inlining must be -// disabled.) -// On Linux,x86 89255e-22 != Div_double(89255.0/1e22) -#if defined(_M_X64) || defined(__x86_64__) || defined(__ARMEL__) || \ - defined(__aarch64__) || defined(__MIPSEL__) -#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 -#elif defined(_M_IX86) || defined(__i386__) -#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS -#else -#error Target architecture was not detected as supported by Double-Conversion. -#endif - -#include - -// The following macro works on both 32 and 64-bit platforms. -// Usage: instead of writing 0x1234567890123456 -// write UINT64_2PART_C(0x12345678,90123456); -#define UINT64_2PART_C(a, b) (((static_cast(a) << 32) + 0x##b##u)) - -// The expression ARRAY_SIZE(a) is a compile-time constant of type -// size_t which represents the number of elements of the given -// array. You should only use ARRAY_SIZE on statically allocated -// arrays. -#define ARRAY_SIZE(a) \ - ((sizeof(a) / sizeof(*(a))) / \ - static_cast(!(sizeof(a) % sizeof(*(a))))) - -namespace WTF { - -namespace double_conversion { - -static const int kCharSize = sizeof(char); - -// Returns the maximum of the two parameters. -template -static T Max(T a, T b) { - return a < b ? b : a; -} - -// Returns the minimum of the two parameters. -template -static T Min(T a, T b) { - return a < b ? a : b; -} - -inline int StrLength(const char* string) { - size_t length = strlen(string); - ASSERT(length == static_cast(static_cast(length))); - return static_cast(length); -} - -// This is a simplified version of V8's Vector class. -template -class Vector { - public: - Vector() : start_(NULL), length_(0) {} - Vector(T* data, int length) : start_(data), length_(length) { - ASSERT(length == 0 || (length > 0 && data != NULL)); - } - - // Returns a vector using the same backing storage as this one, - // spanning from and including 'from', to but not including 'to'. - Vector SubVector(int from, int to) { - ASSERT(to <= length_); - ASSERT(from < to); - ASSERT(0 <= from); - return Vector(start() + from, to - from); - } - - // Returns the length of the vector. - int length() const { return length_; } - - // Returns whether or not the vector is empty. - bool is_empty() const { return length_ == 0; } - - // Returns the pointer to the start of the data in the vector. - T* start() const { return start_; } - - // Access individual vector elements - checks bounds in debug mode. - T& operator[](int index) const { - ASSERT(0 <= index && index < length_); - return start_[index]; - } - - T& first() { return start_[0]; } - - T& last() { return start_[length_ - 1]; } - - private: - T* start_; - int length_; -}; - -// Helper class for building result strings in a character buffer. The -// purpose of the class is to use safe operations that checks the -// buffer bounds on all operations in debug mode. -class StringBuilder { - public: - StringBuilder(char* buffer, int size) : buffer_(buffer, size), position_(0) {} - - ~StringBuilder() { - if (!is_finalized()) - Finalize(); - } - - int size() const { return buffer_.length(); } - - // Get the current position in the builder. - int position() const { - ASSERT(!is_finalized()); - return position_; - } - - // Set the current position in the builder. - void SetPosition(int position) { - ASSERT(!is_finalized()); - ASSERT_WITH_SECURITY_IMPLICATION(position < size()); - position_ = position; - } - - // Reset the position. - void Reset() { position_ = 0; } - - // Add a single character to the builder. It is not allowed to add - // 0-characters; use the Finalize() method to terminate the string - // instead. - void AddCharacter(char c) { - ASSERT(c != '\0'); - ASSERT(!is_finalized() && position_ < buffer_.length()); - buffer_[position_++] = c; - } - - // Add an entire string to the builder. Uses strlen() internally to - // compute the length of the input string. - void AddString(const char* s) { AddSubstring(s, StrLength(s)); } - - // Add the first 'n' characters of the given string 's' to the - // builder. The input string must have enough characters. - void AddSubstring(const char* s, int n) { - ASSERT(!is_finalized() && position_ + n < buffer_.length()); - ASSERT_WITH_SECURITY_IMPLICATION(static_cast(n) <= strlen(s)); - memcpy(&buffer_[position_], s, n * kCharSize); - position_ += n; - } - - // Add character padding to the builder. If count is non-positive, - // nothing is added to the builder. - void AddPadding(char c, int count) { - for (int i = 0; i < count; i++) { - AddCharacter(c); - } - } - - // Finalize the string by 0-terminating it and returning the buffer. - char* Finalize() { - ASSERT(!is_finalized() && position_ < buffer_.length()); - buffer_[position_] = '\0'; - // Make sure nobody managed to add a 0-character to the - // buffer while building the string. - ASSERT(strlen(buffer_.start()) == static_cast(position_)); - position_ = -1; - ASSERT(is_finalized()); - return buffer_.start(); - } - - private: - Vector buffer_; - int position_; - - bool is_finalized() const { return position_ < 0; } - - FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); -}; - -// The type-based aliasing rule allows the compiler to assume that pointers of -// different types (for some definition of different) never alias each other. -// Thus the following code does not work: -// -// float f = foo(); -// int fbits = *(int*)(&f); -// -// The compiler 'knows' that the int pointer can't refer to f since the types -// don't match, so the compiler may cache f in a register, leaving random data -// in fbits. Using C++ style casts makes no difference, however a pointer to -// char data is assumed to alias any other pointer. This is the 'memcpy -// exception'. -// -// Bit_cast uses the memcpy exception to move the bits from a variable of one -// type of a variable of another type. Of course the end result is likely to -// be implementation dependent. Most compilers (gcc-4.2 and MSVC 2005) -// will completely optimize BitCast away. -// -// There is an additional use for BitCast. -// Recent gccs will warn when they see casts that may result in breakage due to -// the type-based aliasing rule. If you have checked that there is no breakage -// you can use BitCast to cast one pointer type to another. This confuses gcc -// enough that it can no longer see that you have cast one pointer type to -// another thus avoiding the warning. -template -inline Dest BitCast(const Source& source) { - // Compile time assertion: sizeof(Dest) == sizeof(Source) - // A compile error here means your Dest and Source have different sizes. - COMPILE_ASSERT(sizeof(Dest) == sizeof(Source), VerifySizesAreEqual); - - Dest dest; - memcpy(&dest, &source, sizeof(dest)); - return dest; -} - -template -inline Dest BitCast(Source* source) { - return BitCast(reinterpret_cast(source)); -} - -} // namespace double_conversion - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_DTOA_UTILS_H_ diff --git a/sky/engine/wtf/testing/RunAllTests.cpp b/sky/engine/wtf/testing/RunAllTests.cpp deleted file mode 100644 index 1c1ff46380c94..0000000000000 --- a/sky/engine/wtf/testing/RunAllTests.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/MainThread.h" -#include "flutter/sky/engine/wtf/WTF.h" -#include "gtest/gtest.h" - -int main(int argc, char** argv) { - WTF::initialize(); - WTF::initializeMainThread(); - testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} diff --git a/sky/engine/wtf/testing/WTFTestHelpers.cpp b/sky/engine/wtf/testing/WTFTestHelpers.cpp deleted file mode 100644 index 55eadd3728fb3..0000000000000 --- a/sky/engine/wtf/testing/WTFTestHelpers.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "wtf/testing/WTFTestHelpers.h" - -#include // NOLINT -#include // NOLINT -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -std::ostream& operator<<(std::ostream& out, const String& string) { - if (string.isNull()) - return out << ""; - - out << '"'; - for (unsigned index = 0; index < string.length(); ++index) { - // Print shorthands for select cases. - UChar character = string[index]; - switch (character) { - case '\t': - out << "\\t"; - break; - case '\n': - out << "\\n"; - break; - case '\r': - out << "\\r"; - break; - case '"': - out << "\\\""; - break; - case '\\': - out << "\\\\"; - break; - default: - if (character >= 0x20 && character < 0x7F) { - out << static_cast(character); - } else { - // Print "\uXXXX" for control or non-ASCII characters. - out << "\\u"; - out.width(4); - out.fill('0'); - out.setf(std::ios_base::hex, std::ios_base::basefield); - out.setf(std::ios::uppercase); - out << character; - } - break; - } - } - return out << '"'; -} - -} // namespace WTF diff --git a/sky/engine/wtf/testing/WTFTestHelpers.h b/sky/engine/wtf/testing/WTFTestHelpers.h deleted file mode 100644 index 3b6e7a8db9457..0000000000000 --- a/sky/engine/wtf/testing/WTFTestHelpers.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TESTING_WTFTESTHELPERS_H_ -#define SKY_ENGINE_WTF_TESTING_WTFTESTHELPERS_H_ - -#include // NOLINT -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -// Output stream operator so gTest's macros work with WebCore strings. -std::ostream& operator<<(std::ostream&, const String&); - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TESTING_WTFTESTHELPERS_H_ diff --git a/sky/engine/wtf/testing/WTFTestHelpersTest.cpp b/sky/engine/wtf/testing/WTFTestHelpersTest.cpp deleted file mode 100644 index c317fa5cf7740..0000000000000 --- a/sky/engine/wtf/testing/WTFTestHelpersTest.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "wtf/testing/WTFTestHelpers.h" - -#include -#include -#include -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -using namespace WTF; - -namespace { - -CString toCStringThroughPrinter(const String& string) { - std::ostringstream output; - output << string; - const std::string& result = output.str(); - return CString(result.data(), result.length()); -} - -TEST(WTFTestHelpersTest, StringPrinter) { - EXPECT_EQ(CString("\"Hello!\""), toCStringThroughPrinter("Hello!")); - EXPECT_EQ(CString("\"\\\"\""), toCStringThroughPrinter("\"")); - EXPECT_EQ(CString("\"\\\\\""), toCStringThroughPrinter("\\")); - EXPECT_EQ( - CString("\"\\u0000\\u0001\\u0002\\u0003\\u0004\\u0005\\u0006\\u0007\""), - toCStringThroughPrinter(String("\x00\x01\x02\x03\x04\x05\x06\x07", 8))); - EXPECT_EQ( - CString("\"\\u0008\\t\\n\\u000B\\u000C\\r\\u000E\\u000F\""), - toCStringThroughPrinter(String("\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F", 8))); - EXPECT_EQ( - CString("\"\\u0010\\u0011\\u0012\\u0013\\u0014\\u0015\\u0016\\u0017\""), - toCStringThroughPrinter(String("\x10\x11\x12\x13\x14\x15\x16\x17", 8))); - EXPECT_EQ( - CString("\"\\u0018\\u0019\\u001A\\u001B\\u001C\\u001D\\u001E\\u001F\""), - toCStringThroughPrinter(String("\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F", 8))); - EXPECT_EQ(CString("\"\\u007F\\u0080\\u0081\""), - toCStringThroughPrinter("\x7F\x80\x81")); - EXPECT_EQ(CString("\"\""), toCStringThroughPrinter(emptyString())); - EXPECT_EQ(CString(""), toCStringThroughPrinter(String())); - - static const UChar unicodeSample[] = {0x30C6, 0x30B9, - 0x30C8}; // "Test" in Japanese. - EXPECT_EQ(CString("\"\\u30C6\\u30B9\\u30C8\""), - toCStringThroughPrinter( - String(unicodeSample, WTF_ARRAY_LENGTH(unicodeSample)))); -} - -} // namespace diff --git a/sky/engine/wtf/text/ASCIIFastPath.h b/sky/engine/wtf/text/ASCIIFastPath.h deleted file mode 100644 index a187d87c6015d..0000000000000 --- a/sky/engine/wtf/text/ASCIIFastPath.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. - * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_TEXT_ASCIIFASTPATH_H_ -#define SKY_ENGINE_WTF_TEXT_ASCIIFASTPATH_H_ - -#include -#include "flutter/sky/engine/wtf/Alignment.h" -#include "flutter/sky/engine/wtf/CPU.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace WTF { - -// Assuming that a pointer is the size of a "machine word", then -// uintptr_t is an integer type that is also a machine word. -typedef uintptr_t MachineWord; -const uintptr_t machineWordAlignmentMask = sizeof(MachineWord) - 1; - -inline bool isAlignedToMachineWord(const void* pointer) { - return !(reinterpret_cast(pointer) & machineWordAlignmentMask); -} - -template -inline T* alignToMachineWord(T* pointer) { - return reinterpret_cast(reinterpret_cast(pointer) & - ~machineWordAlignmentMask); -} - -template -struct NonASCIIMask; -template <> -struct NonASCIIMask<4, UChar> { - static inline uint32_t value() { return 0xFF80FF80U; } -}; -template <> -struct NonASCIIMask<4, LChar> { - static inline uint32_t value() { return 0x80808080U; } -}; -template <> -struct NonASCIIMask<8, UChar> { - static inline uint64_t value() { return 0xFF80FF80FF80FF80ULL; } -}; -template <> -struct NonASCIIMask<8, LChar> { - static inline uint64_t value() { return 0x8080808080808080ULL; } -}; - -template -inline bool isAllASCII(MachineWord word) { - return !(word & NonASCIIMask::value()); -} - -// Note: This function assume the input is likely all ASCII, and -// does not leave early if it is not the case. -template -inline bool charactersAreAllASCII(const CharacterType* characters, - size_t length) { - MachineWord allCharBits = 0; - const CharacterType* end = characters + length; - - // Prologue: align the input. - while (!isAlignedToMachineWord(characters) && characters != end) { - allCharBits |= *characters; - ++characters; - } - - // Compare the values of CPU word size. - const CharacterType* wordEnd = alignToMachineWord(end); - const size_t loopIncrement = sizeof(MachineWord) / sizeof(CharacterType); - while (characters < wordEnd) { - allCharBits |= *(reinterpret_cast_ptr(characters)); - characters += loopIncrement; - } - - // Process the remaining bytes. - while (characters != end) { - allCharBits |= *characters; - ++characters; - } - - MachineWord nonASCIIBitMask = - NonASCIIMask::value(); - return !(allCharBits & nonASCIIBitMask); -} - -inline void copyLCharsFromUCharSource(LChar* destination, - const UChar* source, - size_t length) { -#if COMPILER(GCC) && CPU(ARM_NEON) && \ - !(CPU(BIG_ENDIAN) || CPU(MIDDLE_ENDIAN)) && defined(NDEBUG) - const LChar* const end = destination + length; - const uintptr_t memoryAccessSize = 8; - - if (length >= (2 * memoryAccessSize) - 1) { - // Prefix: align dst on 64 bits. - const uintptr_t memoryAccessMask = memoryAccessSize - 1; - while (!isAlignedTo(destination)) - *destination++ = static_cast(*source++); - - // Vector interleaved unpack, we only store the lower 8 bits. - const uintptr_t lengthLeft = end - destination; - const LChar* const simdEnd = end - (lengthLeft % memoryAccessSize); - do { - asm("vld2.8 { d0-d1 }, [%[SOURCE]] !\n\t" - "vst1.8 { d0 }, [%[DESTINATION],:64] !\n\t" - : [SOURCE] "+r"(source), [DESTINATION] "+r"(destination) - : - : "memory", "d0", "d1"); - } while (destination != simdEnd); - } - - while (destination != end) - *destination++ = static_cast(*source++); -#else - for (size_t i = 0; i < length; ++i) { - ASSERT(!(source[i] & 0xff00)); - destination[i] = static_cast(source[i]); - } -#endif -} - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_ASCIIFASTPATH_H_ diff --git a/sky/engine/wtf/text/AtomicString.cpp b/sky/engine/wtf/text/AtomicString.cpp deleted file mode 100644 index 5eba8d146f1b9..0000000000000 --- a/sky/engine/wtf/text/AtomicString.cpp +++ /dev/null @@ -1,523 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2013 Apple Inc. - * All rights reserved. - * Copyright (C) 2010 Patrick Gansterer - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/WTFThreadData.h" -#include "flutter/sky/engine/wtf/dtoa.h" -#include "flutter/sky/engine/wtf/text/IntegerToStringConversion.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" -#include "flutter/sky/engine/wtf/unicode/UTF8.h" - -namespace WTF { - -using namespace Unicode; - -COMPILE_ASSERT(sizeof(AtomicString) == sizeof(String), - atomic_string_and_string_must_be_same_size); - -class AtomicStringTable { - WTF_MAKE_NONCOPYABLE(AtomicStringTable); - - public: - static AtomicStringTable* create(WTFThreadData& data) { - data.m_atomicStringTable = new AtomicStringTable; - data.m_atomicStringTableDestructor = AtomicStringTable::destroy; - data.m_atomicStringTable->addStaticStrings(); - return data.m_atomicStringTable; - } - - StringImpl* addStringImpl(StringImpl* string) { - if (!string->length()) - return StringImpl::empty(); - - StringImpl* result = *m_table.add(string).storedValue; - - if (!result->isAtomic()) - result->setIsAtomic(true); - - ASSERT(!string->isStatic() || result->isStatic()); - return result; - } - - HashSet& table() { return m_table; } - - private: - AtomicStringTable() {} - - void addStaticStrings() { - const StaticStringsTable& staticStrings = StringImpl::allStaticStrings(); - - StaticStringsTable::const_iterator it = staticStrings.begin(); - for (; it != staticStrings.end(); ++it) { - addStringImpl(it->value); - } - } - - static void destroy(AtomicStringTable* table) { - HashSet::iterator end = table->m_table.end(); - for (HashSet::iterator iter = table->m_table.begin(); - iter != end; ++iter) { - StringImpl* string = *iter; - if (!string->isStatic()) { - ASSERT(string->isAtomic()); - string->setIsAtomic(false); - } - } - delete table; - } - - HashSet m_table; -}; - -static inline AtomicStringTable& atomicStringTable() { - // Once possible we should make this non-lazy (constructed in WTFThreadData's - // constructor). - WTFThreadData& data = wtfThreadData(); - AtomicStringTable* table = data.atomicStringTable(); - if (UNLIKELY(!table)) - table = AtomicStringTable::create(data); - return *table; -} - -static inline HashSet& atomicStrings() { - return atomicStringTable().table(); -} - -template -static inline PassRefPtr addToStringTable(const T& value) { - HashSet::AddResult addResult = - atomicStrings().add(value); - - // If the string is newly-translated, then we need to adopt it. - // The boolean in the pair tells us if that is so. - return addResult.isNewEntry ? adoptRef(*addResult.storedValue) - : *addResult.storedValue; -} - -PassRefPtr AtomicString::add(const LChar* c) { - if (!c) - return nullptr; - if (!*c) - return StringImpl::empty(); - - return add(c, strlen(reinterpret_cast(c))); -} - -template -struct HashTranslatorCharBuffer { - const CharacterType* s; - unsigned length; -}; - -typedef HashTranslatorCharBuffer UCharBuffer; -struct UCharBufferTranslator { - static unsigned hash(const UCharBuffer& buf) { - return StringHasher::computeHashAndMaskTop8Bits(buf.s, buf.length); - } - - static bool equal(StringImpl* const& str, const UCharBuffer& buf) { - return WTF::equal(str, buf.s, buf.length); - } - - static void translate(StringImpl*& location, - const UCharBuffer& buf, - unsigned hash) { - location = StringImpl::create8BitIfPossible(buf.s, buf.length).leakRef(); - location->setHash(hash); - location->setIsAtomic(true); - } -}; - -template -struct HashAndCharacters { - unsigned hash; - const CharacterType* characters; - unsigned length; -}; - -template -struct HashAndCharactersTranslator { - static unsigned hash(const HashAndCharacters& buffer) { - ASSERT(buffer.hash == StringHasher::computeHashAndMaskTop8Bits( - buffer.characters, buffer.length)); - return buffer.hash; - } - - static bool equal(StringImpl* const& string, - const HashAndCharacters& buffer) { - return WTF::equal(string, buffer.characters, buffer.length); - } - - static void translate(StringImpl*& location, - const HashAndCharacters& buffer, - unsigned hash) { - location = StringImpl::create(buffer.characters, buffer.length).leakRef(); - location->setHash(hash); - location->setIsAtomic(true); - } -}; - -struct HashAndUTF8Characters { - unsigned hash; - const char* characters; - unsigned length; - unsigned utf16Length; -}; - -struct HashAndUTF8CharactersTranslator { - static unsigned hash(const HashAndUTF8Characters& buffer) { - return buffer.hash; - } - - static bool equal(StringImpl* const& string, - const HashAndUTF8Characters& buffer) { - if (buffer.utf16Length != string->length()) - return false; - - // If buffer contains only ASCII characters UTF-8 and UTF16 length are the - // same. - if (buffer.utf16Length != buffer.length) { - if (string->is8Bit()) { - const LChar* characters8 = string->characters8(); - return equalLatin1WithUTF8(characters8, characters8 + string->length(), - buffer.characters, - buffer.characters + buffer.length); - } - const UChar* characters16 = string->characters16(); - return equalUTF16WithUTF8(characters16, characters16 + string->length(), - buffer.characters, - buffer.characters + buffer.length); - } - - if (string->is8Bit()) { - const LChar* stringCharacters = string->characters8(); - - for (unsigned i = 0; i < buffer.length; ++i) { - ASSERT(isASCII(buffer.characters[i])); - if (stringCharacters[i] != buffer.characters[i]) - return false; - } - - return true; - } - - const UChar* stringCharacters = string->characters16(); - - for (unsigned i = 0; i < buffer.length; ++i) { - ASSERT(isASCII(buffer.characters[i])); - if (stringCharacters[i] != buffer.characters[i]) - return false; - } - - return true; - } - - static void translate(StringImpl*& location, - const HashAndUTF8Characters& buffer, - unsigned hash) { - UChar* target; - RefPtr newString = - StringImpl::createUninitialized(buffer.utf16Length, target); - - bool isAllASCII; - const char* source = buffer.characters; - if (convertUTF8ToUTF16(&source, source + buffer.length, &target, - target + buffer.utf16Length, - &isAllASCII) != conversionOK) - ASSERT_NOT_REACHED(); - - if (isAllASCII) - newString = StringImpl::create(buffer.characters, buffer.length); - - location = newString.release().leakRef(); - location->setHash(hash); - location->setIsAtomic(true); - } -}; - -PassRefPtr AtomicString::add(const UChar* s, unsigned length) { - if (!s) - return nullptr; - - if (!length) - return StringImpl::empty(); - - UCharBuffer buffer = {s, length}; - return addToStringTable(buffer); -} - -PassRefPtr AtomicString::add(const UChar* s, - unsigned length, - unsigned existingHash) { - ASSERT(s); - ASSERT(existingHash); - - if (!length) - return StringImpl::empty(); - - HashAndCharacters buffer = {existingHash, s, length}; - return addToStringTable, - HashAndCharactersTranslator>(buffer); -} - -PassRefPtr AtomicString::add(const UChar* s) { - if (!s) - return nullptr; - - unsigned length = 0; - while (s[length] != UChar(0)) - ++length; - - if (!length) - return StringImpl::empty(); - - UCharBuffer buffer = {s, length}; - return addToStringTable(buffer); -} - -struct SubstringLocation { - StringImpl* baseString; - unsigned start; - unsigned length; -}; - -struct SubstringTranslator { - static unsigned hash(const SubstringLocation& buffer) { - if (buffer.baseString->is8Bit()) - return StringHasher::computeHashAndMaskTop8Bits( - buffer.baseString->characters8() + buffer.start, buffer.length); - return StringHasher::computeHashAndMaskTop8Bits( - buffer.baseString->characters16() + buffer.start, buffer.length); - } - - static bool equal(StringImpl* const& string, - const SubstringLocation& buffer) { - if (buffer.baseString->is8Bit()) - return WTF::equal(string, buffer.baseString->characters8() + buffer.start, - buffer.length); - return WTF::equal(string, buffer.baseString->characters16() + buffer.start, - buffer.length); - } - - static void translate(StringImpl*& location, - const SubstringLocation& buffer, - unsigned hash) { - location = - buffer.baseString->substring(buffer.start, buffer.length).leakRef(); - location->setHash(hash); - location->setIsAtomic(true); - } -}; - -PassRefPtr AtomicString::add(StringImpl* baseString, - unsigned start, - unsigned length) { - if (!baseString) - return nullptr; - - if (!length || start >= baseString->length()) - return StringImpl::empty(); - - unsigned maxLength = baseString->length() - start; - if (length >= maxLength) { - if (!start) - return add(baseString); - length = maxLength; - } - - SubstringLocation buffer = {baseString, start, length}; - return addToStringTable(buffer); -} - -typedef HashTranslatorCharBuffer LCharBuffer; -struct LCharBufferTranslator { - static unsigned hash(const LCharBuffer& buf) { - return StringHasher::computeHashAndMaskTop8Bits(buf.s, buf.length); - } - - static bool equal(StringImpl* const& str, const LCharBuffer& buf) { - return WTF::equal(str, buf.s, buf.length); - } - - static void translate(StringImpl*& location, - const LCharBuffer& buf, - unsigned hash) { - location = StringImpl::create(buf.s, buf.length).leakRef(); - location->setHash(hash); - location->setIsAtomic(true); - } -}; - -typedef HashTranslatorCharBuffer CharBuffer; -struct CharBufferFromLiteralDataTranslator { - static unsigned hash(const CharBuffer& buf) { - return StringHasher::computeHashAndMaskTop8Bits( - reinterpret_cast(buf.s), buf.length); - } - - static bool equal(StringImpl* const& str, const CharBuffer& buf) { - return WTF::equal(str, buf.s, buf.length); - } - - static void translate(StringImpl*& location, - const CharBuffer& buf, - unsigned hash) { - location = StringImpl::create(buf.s, buf.length).leakRef(); - location->setHash(hash); - location->setIsAtomic(true); - } -}; - -PassRefPtr AtomicString::add(const LChar* s, unsigned length) { - if (!s) - return nullptr; - - if (!length) - return StringImpl::empty(); - - LCharBuffer buffer = {s, length}; - return addToStringTable(buffer); -} - -PassRefPtr AtomicString::addFromLiteralData(const char* characters, - unsigned length) { - ASSERT(characters); - ASSERT(length); - - CharBuffer buffer = {characters, length}; - return addToStringTable( - buffer); -} - -PassRefPtr AtomicString::addSlowCase(StringImpl* string) { - return atomicStringTable().addStringImpl(string); -} - -template -static inline HashSet::iterator findString( - const StringImpl* stringImpl) { - HashAndCharacters buffer = { - stringImpl->existingHash(), stringImpl->getCharacters(), - stringImpl->length()}; - return atomicStrings().find>( - buffer); -} - -StringImpl* AtomicString::find(const StringImpl* stringImpl) { - ASSERT(stringImpl); - ASSERT(stringImpl->existingHash()); - - if (!stringImpl->length()) - return StringImpl::empty(); - - HashSet::iterator iterator; - if (stringImpl->is8Bit()) - iterator = findString(stringImpl); - else - iterator = findString(stringImpl); - if (iterator == atomicStrings().end()) - return 0; - return *iterator; -} - -void AtomicString::remove(StringImpl* r) { - HashSet::iterator iterator; - if (r->is8Bit()) - iterator = findString(r); - else - iterator = findString(r); - RELEASE_ASSERT(iterator != atomicStrings().end()); - atomicStrings().remove(iterator); -} - -AtomicString AtomicString::lower() const { - // Note: This is a hot function in the Dromaeo benchmark. - StringImpl* impl = this->impl(); - if (UNLIKELY(!impl)) - return *this; - RefPtr newImpl = impl->lower(); - if (LIKELY(newImpl == impl)) - return *this; - return AtomicString(newImpl.release()); -} - -AtomicString AtomicString::fromUTF8Internal(const char* charactersStart, - const char* charactersEnd) { - HashAndUTF8Characters buffer; - buffer.characters = charactersStart; - buffer.hash = calculateStringHashAndLengthFromUTF8MaskingTop8Bits( - charactersStart, charactersEnd, buffer.length, buffer.utf16Length); - - if (!buffer.hash) - return nullAtom; - - AtomicString atomicString; - atomicString.m_string = - addToStringTable( - buffer); - return atomicString; -} - -AtomicString AtomicString::number(int number) { - return numberToStringSigned(number); -} - -AtomicString AtomicString::number(unsigned number) { - return numberToStringUnsigned(number); -} - -AtomicString AtomicString::number(long number) { - return numberToStringSigned(number); -} - -AtomicString AtomicString::number(unsigned long number) { - return numberToStringUnsigned(number); -} - -AtomicString AtomicString::number(long long number) { - return numberToStringSigned(number); -} - -AtomicString AtomicString::number(unsigned long long number) { - return numberToStringUnsigned(number); -} - -AtomicString AtomicString::number( - double number, - unsigned precision, - TrailingZerosTruncatingPolicy trailingZerosTruncatingPolicy) { - NumberToStringBuffer buffer; - return AtomicString(numberToFixedPrecisionString( - number, precision, buffer, - trailingZerosTruncatingPolicy == TruncateTrailingZeros)); -} - -#ifndef NDEBUG -void AtomicString::show() const { - m_string.show(); -} -#endif - -} // namespace WTF diff --git a/sky/engine/wtf/text/AtomicString.h b/sky/engine/wtf/text/AtomicString.h deleted file mode 100644 index c7859ac218458..0000000000000 --- a/sky/engine/wtf/text/AtomicString.h +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_TEXT_ATOMICSTRING_H_ -#define SKY_ENGINE_WTF_TEXT_ATOMICSTRING_H_ - -#include "flutter/sky/engine/wtf/HashTableDeletedValueType.h" -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -struct AtomicStringHash; - -class WTF_EXPORT AtomicString { - public: - static void init(); - - AtomicString() {} - AtomicString(const LChar* s) : m_string(add(s)) {} - AtomicString(const char* s) : m_string(add(s)) {} - AtomicString(const LChar* s, unsigned length) : m_string(add(s, length)) {} - AtomicString(const UChar* s, unsigned length) : m_string(add(s, length)) {} - AtomicString(const UChar* s, unsigned length, unsigned existingHash) - : m_string(add(s, length, existingHash)) {} - AtomicString(const UChar* s) : m_string(add(s)) {} - - template - explicit AtomicString(const Vector& characters) - : m_string(add(characters.data(), characters.size())) {} - - // Constructing an AtomicString from a String / StringImpl can be expensive if - // the StringImpl is not already atomic. - explicit AtomicString(StringImpl* impl) : m_string(add(impl)) {} - AtomicString(const String& s) : m_string(add(s.impl())) {} - - AtomicString(StringImpl* baseString, unsigned start, unsigned length) - : m_string(add(baseString, start, length)) {} - - enum ConstructFromLiteralTag { ConstructFromLiteral }; - AtomicString(const char* characters, unsigned length, ConstructFromLiteralTag) - : m_string(addFromLiteralData(characters, length)) {} - - template - ALWAYS_INLINE AtomicString(const char (&characters)[charactersCount], - ConstructFromLiteralTag) - : m_string(addFromLiteralData(characters, charactersCount - 1)) { - COMPILE_ASSERT(charactersCount > 1, AtomicStringFromLiteralNotEmpty); - COMPILE_ASSERT((charactersCount - 1 <= - ((unsigned(~0) - sizeof(StringImpl)) / sizeof(LChar))), - AtomicStringFromLiteralCannotOverflow); - } - - // Hash table deleted values, which are only constructed and never copied or - // destroyed. - AtomicString(WTF::HashTableDeletedValueType) - : m_string(WTF::HashTableDeletedValue) {} - bool isHashTableDeletedValue() const { - return m_string.isHashTableDeletedValue(); - } - - static StringImpl* find(const StringImpl*); - - operator const String&() const { return m_string; } - const String& string() const { return m_string; }; - - StringImpl* impl() const { return m_string.impl(); } - - bool is8Bit() const { return m_string.is8Bit(); } - const LChar* characters8() const { return m_string.characters8(); } - const UChar* characters16() const { return m_string.characters16(); } - unsigned length() const { return m_string.length(); } - - UChar operator[](unsigned i) const { return m_string[i]; } - - bool contains(UChar c) const { return m_string.contains(c); } - bool contains(const LChar* s, bool caseSensitive = true) const { - return m_string.contains(s, caseSensitive); - } - bool contains(const String& s, bool caseSensitive = true) const { - return m_string.contains(s, caseSensitive); - } - - size_t find(UChar c, size_t start = 0) const { - return m_string.find(c, start); - } - size_t find(const LChar* s, - size_t start = 0, - bool caseSentitive = true) const { - return m_string.find(s, start, caseSentitive); - } - size_t find(const String& s, - size_t start = 0, - bool caseSentitive = true) const { - return m_string.find(s, start, caseSentitive); - } - - bool startsWith(const String& s, bool caseSensitive = true) const { - return m_string.startsWith(s, caseSensitive); - } - bool startsWith(UChar character) const { - return m_string.startsWith(character); - } - template - bool startsWith(const char (&prefix)[matchLength], - bool caseSensitive = true) const { - return m_string.startsWith(prefix, caseSensitive); - } - - bool endsWith(const String& s, bool caseSensitive = true) const { - return m_string.endsWith(s, caseSensitive); - } - bool endsWith(UChar character) const { return m_string.endsWith(character); } - template - bool endsWith(const char (&prefix)[matchLength], - bool caseSensitive = true) const { - return m_string.endsWith(prefix, caseSensitive); - } - - AtomicString lower() const; - AtomicString upper() const { return AtomicString(impl()->upper()); } - - int toInt(bool* ok = 0) const { return m_string.toInt(ok); } - double toDouble(bool* ok = 0) const { return m_string.toDouble(ok); } - float toFloat(bool* ok = 0) const { return m_string.toFloat(ok); } - bool percentage(int& p) const { return m_string.percentage(p); } - - static AtomicString number(int); - static AtomicString number(unsigned); - static AtomicString number(long); - static AtomicString number(unsigned long); - static AtomicString number(long long); - static AtomicString number(unsigned long long); - - static AtomicString number( - double, - unsigned precision = 6, - TrailingZerosTruncatingPolicy = TruncateTrailingZeros); - - bool isNull() const { return m_string.isNull(); } - bool isEmpty() const { return m_string.isEmpty(); } - - static void remove(StringImpl*); - -#if USE(CF) - AtomicString(CFStringRef s) : m_string(add(s)) {} -#endif - // AtomicString::fromUTF8 will return a null string if - // the input data contains invalid UTF-8 sequences. - static AtomicString fromUTF8(const char*, size_t); - static AtomicString fromUTF8(const char*); - - CString ascii() const { return m_string.ascii(); } - CString latin1() const { return m_string.latin1(); } - CString utf8(UTF8ConversionMode mode = LenientUTF8Conversion) const { - return m_string.utf8(mode); - } - -#ifndef NDEBUG - void show() const; -#endif - - private: - String m_string; - - static PassRefPtr add(const LChar*); - ALWAYS_INLINE static PassRefPtr add(const char* s) { - return add(reinterpret_cast(s)); - }; - static PassRefPtr add(const LChar*, unsigned length); - static PassRefPtr add(const UChar*, unsigned length); - ALWAYS_INLINE static PassRefPtr add(const char* s, - unsigned length) { - return add(reinterpret_cast(s), length); - }; - static PassRefPtr add(const UChar*, - unsigned length, - unsigned existingHash); - static PassRefPtr add(const UChar*); - static PassRefPtr add(StringImpl*, - unsigned offset, - unsigned length); - ALWAYS_INLINE static PassRefPtr add(StringImpl* r) { - if (!r || r->isAtomic()) - return r; - return addSlowCase(r); - } - static PassRefPtr addFromLiteralData(const char* characters, - unsigned length); - static PassRefPtr addSlowCase(StringImpl*); -#if USE(CF) - static PassRefPtr add(CFStringRef); -#endif - - static AtomicString fromUTF8Internal(const char*, const char*); -}; - -inline bool operator==(const AtomicString& a, const AtomicString& b) { - return a.impl() == b.impl(); -} -WTF_EXPORT bool operator==(const AtomicString&, const LChar*); -inline bool operator==(const AtomicString& a, const char* b) { - return WTF::equal(a.impl(), reinterpret_cast(b)); -} -inline bool operator==(const AtomicString& a, const Vector& b) { - return a.impl() && equal(a.impl(), b.data(), b.size()); -} -inline bool operator==(const AtomicString& a, const String& b) { - return equal(a.impl(), b.impl()); -} -inline bool operator==(const LChar* a, const AtomicString& b) { - return b == a; -} -inline bool operator==(const String& a, const AtomicString& b) { - return equal(a.impl(), b.impl()); -} -inline bool operator==(const Vector& a, const AtomicString& b) { - return b == a; -} - -inline bool operator!=(const AtomicString& a, const AtomicString& b) { - return a.impl() != b.impl(); -} -inline bool operator!=(const AtomicString& a, const LChar* b) { - return !(a == b); -} -inline bool operator!=(const AtomicString& a, const char* b) { - return !(a == b); -} -inline bool operator!=(const AtomicString& a, const String& b) { - return !equal(a.impl(), b.impl()); -} -inline bool operator!=(const AtomicString& a, const Vector& b) { - return !(a == b); -} -inline bool operator!=(const LChar* a, const AtomicString& b) { - return !(b == a); -} -inline bool operator!=(const String& a, const AtomicString& b) { - return !equal(a.impl(), b.impl()); -} -inline bool operator!=(const Vector& a, const AtomicString& b) { - return !(a == b); -} - -inline bool equalIgnoringCase(const AtomicString& a, const AtomicString& b) { - return equalIgnoringCase(a.impl(), b.impl()); -} -inline bool equalIgnoringCase(const AtomicString& a, const LChar* b) { - return equalIgnoringCase(a.impl(), b); -} -inline bool equalIgnoringCase(const AtomicString& a, const char* b) { - return equalIgnoringCase(a.impl(), reinterpret_cast(b)); -} -inline bool equalIgnoringCase(const AtomicString& a, const String& b) { - return equalIgnoringCase(a.impl(), b.impl()); -} -inline bool equalIgnoringCase(const LChar* a, const AtomicString& b) { - return equalIgnoringCase(a, b.impl()); -} -inline bool equalIgnoringCase(const char* a, const AtomicString& b) { - return equalIgnoringCase(reinterpret_cast(a), b.impl()); -} -inline bool equalIgnoringCase(const String& a, const AtomicString& b) { - return equalIgnoringCase(a.impl(), b.impl()); -} - -// Define external global variables for the commonly used atomic strings. -// These are only usable from the main thread. -WTF_EXPORT extern const AtomicString& nullAtom; -WTF_EXPORT extern const AtomicString& emptyAtom; -WTF_EXPORT extern const AtomicString& starAtom; - -inline AtomicString AtomicString::fromUTF8(const char* characters, - size_t length) { - if (!characters) - return nullAtom; - if (!length) - return emptyAtom; - return fromUTF8Internal(characters, characters + length); -} - -inline AtomicString AtomicString::fromUTF8(const char* characters) { - if (!characters) - return nullAtom; - if (!*characters) - return emptyAtom; - return fromUTF8Internal(characters, 0); -} - -// AtomicStringHash is the default hash for AtomicString -template -struct DefaultHash; -template <> -struct DefaultHash { - typedef AtomicStringHash Hash; -}; - -} // namespace WTF - -WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(AtomicString); - -using WTF::AtomicString; -using WTF::emptyAtom; -using WTF::nullAtom; -using WTF::starAtom; - -#include "flutter/sky/engine/wtf/text/StringConcatenate.h" -#endif // SKY_ENGINE_WTF_TEXT_ATOMICSTRING_H_ diff --git a/sky/engine/wtf/text/AtomicStringHash.h b/sky/engine/wtf/text/AtomicStringHash.h deleted file mode 100644 index c9a80d5b352b6..0000000000000 --- a/sky/engine/wtf/text/AtomicStringHash.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_ATOMICSTRINGHASH_H_ -#define SKY_ENGINE_WTF_TEXT_ATOMICSTRINGHASH_H_ - -#include "flutter/sky/engine/wtf/HashTraits.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -namespace WTF { - -struct AtomicStringHash { - static unsigned hash(const AtomicString& key) { - return key.impl()->existingHash(); - } - - static bool equal(const AtomicString& a, const AtomicString& b) { - return a == b; - } - - static const bool safeToCompareToEmptyOrDeleted = false; -}; - -// AtomicStringHash is the default hash for AtomicString -template <> -struct HashTraits : GenericHashTraits { - // Unlike other types, we can return a const reference for AtomicString's - // empty value (nullAtom). - typedef const WTF::AtomicString& PeekOutType; - - static const WTF::AtomicString& emptyValue() { return nullAtom; } - static PeekOutType peek(const WTF::AtomicString& value) { return value; } - - static const bool emptyValueIsZero = true; - static void constructDeletedValue(WTF::AtomicString& slot, bool) { - new (NotNull, &slot) WTF::AtomicString(HashTableDeletedValue); - } - static bool isDeletedValue(const WTF::AtomicString& slot) { - return slot.isHashTableDeletedValue(); - } -}; - -} // namespace WTF - -using WTF::AtomicStringHash; - -#endif // SKY_ENGINE_WTF_TEXT_ATOMICSTRINGHASH_H_ diff --git a/sky/engine/wtf/text/AtomicStringTest.cpp b/sky/engine/wtf/text/AtomicStringTest.cpp deleted file mode 100644 index a26a16b5b9ede..0000000000000 --- a/sky/engine/wtf/text/AtomicStringTest.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2013 Samsung Electronics. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -#include - -namespace { - -TEST(AtomicStringTest, Number) { - int intValue = 1234; - ASSERT_EQ(AtomicString::number(intValue), "1234"); - intValue = -1234; - ASSERT_EQ(AtomicString::number(intValue), "-1234"); - unsigned unsignedValue = 1234u; - ASSERT_EQ(AtomicString::number(unsignedValue), "1234"); - long longValue = 6553500; - ASSERT_EQ(AtomicString::number(longValue), "6553500"); - longValue = -6553500; - ASSERT_EQ(AtomicString::number(longValue), "-6553500"); - unsigned long unsignedLongValue = 4294967295u; - ASSERT_EQ(AtomicString::number(unsignedLongValue), "4294967295"); - long long longlongValue = 9223372036854775807; - ASSERT_EQ(AtomicString::number(longlongValue), "9223372036854775807"); - longlongValue = -9223372036854775807; - ASSERT_EQ(AtomicString::number(longlongValue), "-9223372036854775807"); - unsigned long long unsignedLongLongValue = 18446744073709551615u; - ASSERT_EQ(AtomicString::number(unsignedLongLongValue), - "18446744073709551615"); - double doubleValue = 1234.56; - ASSERT_EQ(AtomicString::number(doubleValue), "1234.56"); - doubleValue = 1234.56789; - ASSERT_EQ(AtomicString::number(doubleValue, 9), "1234.56789"); -} - -TEST(AtomicStringTest, ImplEquality) { - AtomicString foo("foo"); - AtomicString bar("bar"); - AtomicString baz("baz"); - AtomicString foo2("foo"); - AtomicString baz2("baz"); - AtomicString bar2("bar"); - ASSERT_EQ(foo.impl(), foo2.impl()); - ASSERT_EQ(bar.impl(), bar2.impl()); - ASSERT_EQ(baz.impl(), baz2.impl()); - ASSERT_NE(foo.impl(), bar.impl()); - ASSERT_NE(foo.impl(), baz.impl()); - ASSERT_NE(bar.impl(), baz.impl()); -} - -} // namespace diff --git a/sky/engine/wtf/text/CString.cpp b/sky/engine/wtf/text/CString.cpp deleted file mode 100644 index 52399cccb41d8..0000000000000 --- a/sky/engine/wtf/text/CString.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2012 Apple Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/CString.h" - -#include -#include "flutter/sky/engine/wtf/PartitionAlloc.h" -#include "flutter/sky/engine/wtf/WTF.h" - -using namespace std; - -namespace WTF { - -PassRefPtr CStringBuffer::createUninitialized(size_t length) { - RELEASE_ASSERT(length < - (numeric_limits::max() - sizeof(CStringBuffer))); - - // The +1 is for the terminating NUL character. - size_t size = sizeof(CStringBuffer) + length + 1; - CStringBuffer* stringBuffer = static_cast( - partitionAllocGeneric(Partitions::getBufferPartition(), size)); - return adoptRef(new (stringBuffer) CStringBuffer(length)); -} - -void CStringBuffer::operator delete(void* ptr) { - partitionFreeGeneric(Partitions::getBufferPartition(), ptr); -} - -CString::CString(const char* str) { - if (!str) - return; - - init(str, strlen(str)); -} - -CString::CString(const char* str, size_t length) { - if (!str) { - ASSERT(!length); - return; - } - - init(str, length); -} - -void CString::init(const char* str, size_t length) { - ASSERT(str); - - m_buffer = CStringBuffer::createUninitialized(length); - memcpy(m_buffer->mutableData(), str, length); - m_buffer->mutableData()[length] = '\0'; -} - -char* CString::mutableData() { - copyBufferIfNeeded(); - if (!m_buffer) - return 0; - return m_buffer->mutableData(); -} - -CString CString::newUninitialized(size_t length, char*& characterBuffer) { - CString result; - result.m_buffer = CStringBuffer::createUninitialized(length); - char* bytes = result.m_buffer->mutableData(); - bytes[length] = '\0'; - characterBuffer = bytes; - return result; -} - -void CString::copyBufferIfNeeded() { - if (!m_buffer || m_buffer->hasOneRef()) - return; - - RefPtr buffer = m_buffer.release(); - size_t length = buffer->length(); - m_buffer = CStringBuffer::createUninitialized(length); - memcpy(m_buffer->mutableData(), buffer->data(), length + 1); -} - -bool CString::isSafeToSendToAnotherThread() const { - return !m_buffer || m_buffer->hasOneRef(); -} - -bool operator==(const CString& a, const CString& b) { - if (a.isNull() != b.isNull()) - return false; - if (a.length() != b.length()) - return false; - return !memcmp(a.data(), b.data(), a.length()); -} - -bool operator==(const CString& a, const char* b) { - if (a.isNull() != !b) - return false; - if (!b) - return true; - return !strcmp(a.data(), b); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/CString.h b/sky/engine/wtf/text/CString.h deleted file mode 100644 index 938dbd36a8034..0000000000000 --- a/sky/engine/wtf/text/CString.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2003, 2006, 2008, 2009, 2010, 2012 Apple Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_CSTRING_H_ -#define SKY_ENGINE_WTF_TEXT_CSTRING_H_ - -#include -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/RefPtr.h" -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -// CStringBuffer is the ref-counted storage class for the characters in a -// CString. The data is implicitly allocated 1 character longer than length(), -// as it is zero-terminated. -class WTF_EXPORT CStringBuffer : public RefCounted { - public: - const char* data() { return mutableData(); } - size_t length() const { return m_length; } - - private: - friend class CString; - friend class RefCounted; - // CStringBuffers are allocated out of the WTF buffer partition. - void* operator new(size_t, void* ptr) { return ptr; }; - void operator delete(void*); - - static PassRefPtr createUninitialized(size_t length); - - CStringBuffer(size_t length) : m_length(length) {} - char* mutableData() { return reinterpret_cast(this + 1); } - - const unsigned m_length; -}; - -// A container for a null-terminated char array supporting copy-on-write -// assignment. The contained char array may be null. -class WTF_EXPORT CString { - public: - CString() {} - CString(const char*); - CString(const char*, size_t length); - CString(CStringBuffer* buffer) : m_buffer(buffer) {} - static CString newUninitialized(size_t length, char*& characterBuffer); - - std::string toStdString() const { return std::string(data(), length()); } - - const char* data() const { return m_buffer ? m_buffer->data() : 0; } - char* mutableData(); - size_t length() const { return m_buffer ? m_buffer->length() : 0; } - - bool isNull() const { return !m_buffer; } - bool isSafeToSendToAnotherThread() const; - - CStringBuffer* buffer() const { return m_buffer.get(); } - - private: - void copyBufferIfNeeded(); - void init(const char*, size_t length); - RefPtr m_buffer; -}; - -WTF_EXPORT bool operator==(const CString& a, const CString& b); -inline bool operator!=(const CString& a, const CString& b) { - return !(a == b); -} -WTF_EXPORT bool operator==(const CString& a, const char* b); -inline bool operator!=(const CString& a, const char* b) { - return !(a == b); -} - -} // namespace WTF - -using WTF::CString; - -#endif // SKY_ENGINE_WTF_TEXT_CSTRING_H_ diff --git a/sky/engine/wtf/text/CStringTest.cpp b/sky/engine/wtf/text/CStringTest.cpp deleted file mode 100644 index 5abfdddfba23f..0000000000000 --- a/sky/engine/wtf/text/CStringTest.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/text/CString.h" - -namespace { - -TEST(WTF, CStringNullStringConstructor) { - CString string; - ASSERT_TRUE(string.isNull()); - ASSERT_EQ(string.data(), static_cast(0)); - ASSERT_EQ(string.length(), static_cast(0)); - - CString stringFromCharPointer(static_cast(0)); - ASSERT_TRUE(stringFromCharPointer.isNull()); - ASSERT_EQ(stringFromCharPointer.data(), static_cast(0)); - ASSERT_EQ(stringFromCharPointer.length(), static_cast(0)); - - CString stringFromCharAndLength(static_cast(0), 0); - ASSERT_TRUE(stringFromCharAndLength.isNull()); - ASSERT_EQ(stringFromCharAndLength.data(), static_cast(0)); - ASSERT_EQ(stringFromCharAndLength.length(), static_cast(0)); -} - -TEST(WTF, CStringEmptyEmptyConstructor) { - const char* emptyString = ""; - CString string(emptyString); - ASSERT_FALSE(string.isNull()); - ASSERT_EQ(string.length(), static_cast(0)); - ASSERT_EQ(string.data()[0], 0); - - CString stringWithLength(emptyString, 0); - ASSERT_FALSE(stringWithLength.isNull()); - ASSERT_EQ(stringWithLength.length(), static_cast(0)); - ASSERT_EQ(stringWithLength.data()[0], 0); -} - -TEST(WTF, CStringEmptyRegularConstructor) { - const char* referenceString = "WebKit"; - - CString string(referenceString); - ASSERT_FALSE(string.isNull()); - ASSERT_EQ(string.length(), strlen(referenceString)); - ASSERT_STREQ(referenceString, string.data()); - - CString stringWithLength(referenceString, 6); - ASSERT_FALSE(stringWithLength.isNull()); - ASSERT_EQ(stringWithLength.length(), strlen(referenceString)); - ASSERT_STREQ(referenceString, stringWithLength.data()); -} - -TEST(WTF, CStringUninitializedConstructor) { - char* buffer; - CString emptyString = CString::newUninitialized(0, buffer); - ASSERT_FALSE(emptyString.isNull()); - ASSERT_EQ(buffer, emptyString.data()); - ASSERT_EQ(buffer[0], 0); - - const size_t length = 25; - CString uninitializedString = CString::newUninitialized(length, buffer); - ASSERT_FALSE(uninitializedString.isNull()); - ASSERT_EQ(buffer, uninitializedString.data()); - ASSERT_EQ(uninitializedString.data()[length], 0); -} - -TEST(WTF, CStringZeroTerminated) { - const char* referenceString = "WebKit"; - CString stringWithLength(referenceString, 3); - ASSERT_EQ(stringWithLength.data()[3], 0); -} - -TEST(WTF, CStringCopyOnWrite) { - const char* initialString = "Webkit"; - CString string(initialString); - CString copy = string; - - string.mutableData()[3] = 'K'; - ASSERT_TRUE(string != copy); - ASSERT_STREQ(string.data(), "WebKit"); - ASSERT_STREQ(copy.data(), initialString); -} - -TEST(WTF, CStringComparison) { - // Comparison with another CString. - CString a; - CString b; - ASSERT_TRUE(a == b); - ASSERT_FALSE(a != b); - a = "a"; - b = CString(); - ASSERT_FALSE(a == b); - ASSERT_TRUE(a != b); - a = "a"; - b = "b"; - ASSERT_FALSE(a == b); - ASSERT_TRUE(a != b); - a = "a"; - b = "a"; - ASSERT_TRUE(a == b); - ASSERT_FALSE(a != b); - a = "a"; - b = "aa"; - ASSERT_FALSE(a == b); - ASSERT_TRUE(a != b); - a = ""; - b = ""; - ASSERT_TRUE(a == b); - ASSERT_FALSE(a != b); - a = ""; - b = CString(); - ASSERT_FALSE(a == b); - ASSERT_TRUE(a != b); - a = "a"; - b = ""; - ASSERT_FALSE(a == b); - ASSERT_TRUE(a != b); - - // Comparison with a const char*. - CString c; - const char* d = 0; - ASSERT_TRUE(c == d); - ASSERT_FALSE(c != d); - c = "c"; - d = 0; - ASSERT_FALSE(c == d); - ASSERT_TRUE(c != d); - c = CString(); - d = "d"; - ASSERT_FALSE(c == d); - ASSERT_TRUE(c != d); - c = "c"; - d = "d"; - ASSERT_FALSE(c == d); - ASSERT_TRUE(c != d); - c = "c"; - d = "c"; - ASSERT_TRUE(c == d); - ASSERT_FALSE(c != d); - c = "c"; - d = "cc"; - ASSERT_FALSE(c == d); - ASSERT_TRUE(c != d); - c = "cc"; - d = "c"; - ASSERT_FALSE(c == d); - ASSERT_TRUE(c != d); - c = ""; - d = ""; - ASSERT_TRUE(c == d); - ASSERT_FALSE(c != d); - c = ""; - d = 0; - ASSERT_FALSE(c == d); - ASSERT_TRUE(c != d); - c = CString(); - d = ""; - ASSERT_FALSE(c == d); - ASSERT_TRUE(c != d); - c = "a"; - d = ""; - ASSERT_FALSE(c == d); - ASSERT_TRUE(c != d); - c = ""; - d = "b"; - ASSERT_FALSE(c == d); - ASSERT_TRUE(c != d); -} - -} // namespace diff --git a/sky/engine/wtf/text/IntegerToStringConversion.h b/sky/engine/wtf/text/IntegerToStringConversion.h deleted file mode 100644 index 121ff056e3aeb..0000000000000 --- a/sky/engine/wtf/text/IntegerToStringConversion.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All Rights Reserved. - * Copyright (C) 2012 Patrick Gansterer - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_TEXT_INTEGERTOSTRINGCONVERSION_H_ -#define SKY_ENGINE_WTF_TEXT_INTEGERTOSTRINGCONVERSION_H_ - -#include "flutter/sky/engine/wtf/text/StringBuilder.h" -#include "flutter/sky/engine/wtf/text/StringImpl.h" - -namespace WTF { - -enum PositiveOrNegativeNumber { PositiveNumber, NegativeNumber }; - -template -struct ConversionTrait; - -template <> -struct ConversionTrait { - typedef PassRefPtr ReturnType; - typedef void AdditionalArgumentType; - static inline ReturnType flush(LChar* characters, unsigned length, void*) { - return StringImpl::create(characters, length); - } -}; -template <> -struct ConversionTrait { - typedef void ReturnType; - typedef StringBuilder AdditionalArgumentType; - static inline ReturnType flush(LChar* characters, - unsigned length, - StringBuilder* stringBuilder) { - stringBuilder->append(characters, length); - } -}; -template <> -struct ConversionTrait { - typedef AtomicString ReturnType; - typedef void AdditionalArgumentType; - static inline ReturnType flush(LChar* characters, unsigned length, void*) { - return AtomicString(characters, length); - } -}; - -template -struct UnsignedIntegerTrait; - -template <> -struct UnsignedIntegerTrait { - typedef unsigned Type; -}; -template <> -struct UnsignedIntegerTrait { - typedef unsigned long Type; -}; -template <> -struct UnsignedIntegerTrait { - typedef unsigned long long Type; -}; - -template -static typename ConversionTrait::ReturnType numberToStringImpl( - UnsignedIntegerType number, - typename ConversionTrait::AdditionalArgumentType* additionalArgument) { - LChar buf[sizeof(UnsignedIntegerType) * 3 + 1]; - LChar* end = buf + WTF_ARRAY_LENGTH(buf); - LChar* p = end; - - do { - *--p = static_cast((number % 10) + '0'); - number /= 10; - } while (number); - - if (NumberType == NegativeNumber) - *--p = '-'; - - return ConversionTrait::flush(p, static_cast(end - p), - additionalArgument); -} - -template -inline typename ConversionTrait::ReturnType numberToStringSigned( - SignedIntegerType number, - typename ConversionTrait::AdditionalArgumentType* additionalArgument = - 0) { - if (number < 0) - return numberToStringImpl< - T, typename UnsignedIntegerTrait::Type, - NegativeNumber>(-number, additionalArgument); - return numberToStringImpl< - T, typename UnsignedIntegerTrait::Type, - PositiveNumber>(number, additionalArgument); -} - -template -inline typename ConversionTrait::ReturnType numberToStringUnsigned( - UnsignedIntegerType number, - typename ConversionTrait::AdditionalArgumentType* additionalArgument = - 0) { - return numberToStringImpl( - number, additionalArgument); -} - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_INTEGERTOSTRINGCONVERSION_H_ diff --git a/sky/engine/wtf/text/StringBuffer.h b/sky/engine/wtf/text/StringBuffer.h deleted file mode 100644 index 5cdf1d54826b6..0000000000000 --- a/sky/engine/wtf/text/StringBuffer.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Inc. ("Apple") nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_STRINGBUFFER_H_ -#define SKY_ENGINE_WTF_TEXT_STRINGBUFFER_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/text/StringImpl.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace WTF { - -template -class StringBuffer { - WTF_MAKE_NONCOPYABLE(StringBuffer); - - public: - StringBuffer() {} - - explicit StringBuffer(unsigned length) { - CharType* characters; - m_data = StringImpl::createUninitialized(length, characters); - } - - ~StringBuffer() {} - - void shrink(unsigned newLength); - void resize(unsigned newLength) { - if (!m_data) { - CharType* characters; - m_data = StringImpl::createUninitialized(newLength, characters); - return; - } - if (newLength > m_data->length()) { - m_data = StringImpl::reallocate(m_data.release(), newLength); - return; - } - shrink(newLength); - } - - unsigned length() const { return m_data ? m_data->length() : 0; } - CharType* characters() { - return length() ? const_cast(m_data->getCharacters()) - : 0; - } - - CharType& operator[](unsigned i) { - ASSERT_WITH_SECURITY_IMPLICATION(i < length()); - return characters()[i]; - } - - PassRefPtr release() { return m_data.release(); } - - private: - RefPtr m_data; -}; - -template -void StringBuffer::shrink(unsigned newLength) { - ASSERT(m_data); - if (m_data->length() == newLength) - return; - m_data->truncateAssumingIsolated(newLength); -} - -} // namespace WTF - -using WTF::StringBuffer; - -#endif // SKY_ENGINE_WTF_TEXT_STRINGBUFFER_H_ diff --git a/sky/engine/wtf/text/StringBufferTest.cpp b/sky/engine/wtf/text/StringBufferTest.cpp deleted file mode 100644 index 124c132916e8e..0000000000000 --- a/sky/engine/wtf/text/StringBufferTest.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2014 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. - */ - -#include "flutter/sky/engine/wtf/text/StringBuffer.h" - -#include - -namespace { - -TEST(StringBuffer, Initial) { - StringBuffer buf1; - EXPECT_EQ(0u, buf1.length()); - EXPECT_FALSE(buf1.characters()); - - StringBuffer buf2(0); - EXPECT_EQ(0u, buf2.length()); - EXPECT_FALSE(buf2.characters()); - - StringBuffer buf3(1); - EXPECT_EQ(1u, buf3.length()); - EXPECT_TRUE(buf3.characters()); -} - -TEST(StringBuffer, shrink) { - StringBuffer buf(2); - EXPECT_EQ(2u, buf.length()); - buf[0] = 'a'; - buf[1] = 'b'; - - buf.shrink(1); - EXPECT_EQ(1u, buf.length()); - EXPECT_EQ('a', buf[0]); - - buf.shrink(0); - EXPECT_EQ(0u, buf.length()); -} - -} // namespace diff --git a/sky/engine/wtf/text/StringBuilder.cpp b/sky/engine/wtf/text/StringBuilder.cpp deleted file mode 100644 index 98e9c588e3627..0000000000000 --- a/sky/engine/wtf/text/StringBuilder.cpp +++ /dev/null @@ -1,408 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/StringBuilder.h" - -#include "flutter/sky/engine/wtf/dtoa.h" -#include "flutter/sky/engine/wtf/text/IntegerToStringConversion.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -static unsigned expandedCapacity(unsigned capacity, unsigned requiredLength) { - static const unsigned minimumCapacity = 16; - return std::max(requiredLength, std::max(minimumCapacity, capacity * 2)); -} - -void StringBuilder::reifyString() { - if (!m_string.isNull()) { - ASSERT(m_string.length() == m_length); - return; - } - - if (!m_length) { - m_string = StringImpl::empty(); - return; - } - - ASSERT(m_buffer && m_length <= m_buffer->length()); - if (m_length == m_buffer->length()) { - m_string = m_buffer.release(); - return; - } - - if (m_buffer->hasOneRef()) { - m_buffer->truncateAssumingIsolated(m_length); - m_string = m_buffer.release(); - return; - } - - m_string = m_buffer->substring(0, m_length); -} - -String StringBuilder::reifySubstring(unsigned position, unsigned length) const { - ASSERT(m_string.isNull()); - ASSERT(m_buffer); - unsigned substringLength = std::min(length, m_length - position); - return m_buffer->substring(position, substringLength); -} - -void StringBuilder::resize(unsigned newSize) { - // Check newSize < m_length, hence m_length > 0. - ASSERT(newSize <= m_length); - if (newSize == m_length) - return; - ASSERT(m_length); - - // If there is a buffer, we only need to duplicate it if it has more than one - // ref. - if (m_buffer) { - m_string = String(); // Clear the string to remove the reference to - // m_buffer if any before checking the reference count - // of m_buffer. - if (!m_buffer->hasOneRef()) { - if (m_buffer->is8Bit()) - allocateBuffer(m_buffer->characters8(), m_buffer->length()); - else - allocateBuffer(m_buffer->characters16(), m_buffer->length()); - } - m_length = newSize; - return; - } - - // Since m_length && !m_buffer, the string must be valid in m_string, and - // m_string.length() > 0. - ASSERT(!m_string.isEmpty()); - ASSERT(m_length == m_string.length()); - ASSERT(newSize < m_string.length()); - m_length = newSize; - RefPtr string = m_string.releaseImpl(); - if (string->hasOneRef()) { - // If we're the only ones with a reference to the string, we can - // re-purpose the string as m_buffer and continue mutating it. - m_buffer = string; - } else { - // Otherwise, we need to make a copy of the string so that we don't - // mutate a String that's held elsewhere. - m_buffer = string->substring(0, m_length); - } -} - -// Allocate a new 8 bit buffer, copying in currentCharacters (these may come -// from either m_string or m_buffer, neither will be reassigned until the copy -// has completed). -void StringBuilder::allocateBuffer(const LChar* currentCharacters, - unsigned requiredLength) { - ASSERT(m_is8Bit); - // Copy the existing data into a new buffer, set result to point to the end of - // the existing data. - RefPtr buffer = - StringImpl::createUninitialized(requiredLength, m_bufferCharacters8); - memcpy( - m_bufferCharacters8, currentCharacters, - static_cast(m_length) * sizeof(LChar)); // This can't overflow. - - // Update the builder state. - m_buffer = buffer.release(); - m_string = String(); -} - -// Allocate a new 16 bit buffer, copying in currentCharacters (these may come -// from either m_string or m_buffer, neither will be reassigned until the copy -// has completed). -void StringBuilder::allocateBuffer(const UChar* currentCharacters, - unsigned requiredLength) { - ASSERT(!m_is8Bit); - // Copy the existing data into a new buffer, set result to point to the end of - // the existing data. - RefPtr buffer = - StringImpl::createUninitialized(requiredLength, m_bufferCharacters16); - memcpy( - m_bufferCharacters16, currentCharacters, - static_cast(m_length) * sizeof(UChar)); // This can't overflow. - - // Update the builder state. - m_buffer = buffer.release(); - m_string = String(); -} - -// Allocate a new 16 bit buffer, copying in currentCharacters (which is 8 bit -// and may come from either m_string or m_buffer, neither will be reassigned -// until the copy has completed). -void StringBuilder::allocateBufferUpConvert(const LChar* currentCharacters, - unsigned requiredLength) { - ASSERT(m_is8Bit); - // Copy the existing data into a new buffer, set result to point to the end of - // the existing data. - RefPtr buffer = - StringImpl::createUninitialized(requiredLength, m_bufferCharacters16); - for (unsigned i = 0; i < m_length; ++i) - m_bufferCharacters16[i] = currentCharacters[i]; - - m_is8Bit = false; - - // Update the builder state. - m_buffer = buffer.release(); - m_string = String(); -} - -template <> -void StringBuilder::reallocateBuffer(unsigned requiredLength) { - // If the buffer has only one ref (by this StringBuilder), reallocate it, - // otherwise fall back to "allocate and copy" method. - m_string = String(); - - ASSERT(m_is8Bit); - ASSERT(m_buffer->is8Bit()); - - if (m_buffer->hasOneRef()) { - m_buffer = StringImpl::reallocate(m_buffer.release(), requiredLength); - m_bufferCharacters8 = const_cast(m_buffer->characters8()); - } else - allocateBuffer(m_buffer->characters8(), requiredLength); -} - -template <> -void StringBuilder::reallocateBuffer(unsigned requiredLength) { - // If the buffer has only one ref (by this StringBuilder), reallocate it, - // otherwise fall back to "allocate and copy" method. - m_string = String(); - - if (m_buffer->is8Bit()) { - allocateBufferUpConvert(m_buffer->characters8(), requiredLength); - } else if (m_buffer->hasOneRef()) { - m_buffer = StringImpl::reallocate(m_buffer.release(), requiredLength); - m_bufferCharacters16 = const_cast(m_buffer->characters16()); - } else - allocateBuffer(m_buffer->characters16(), requiredLength); -} - -void StringBuilder::reserveCapacity(unsigned newCapacity) { - if (m_buffer) { - // If there is already a buffer, then grow if necessary. - if (newCapacity > m_buffer->length()) { - if (m_buffer->is8Bit()) - reallocateBuffer(newCapacity); - else - reallocateBuffer(newCapacity); - } - } else { - // Grow the string, if necessary. - if (newCapacity > m_length) { - if (!m_length) { - LChar* nullPlaceholder = 0; - allocateBuffer(nullPlaceholder, newCapacity); - } else if (m_string.is8Bit()) - allocateBuffer(m_string.characters8(), newCapacity); - else - allocateBuffer(m_string.characters16(), newCapacity); - } - } -} - -// Make 'length' additional capacity be available in m_buffer, update m_string & -// m_length, return a pointer to the newly allocated storage. -template -ALWAYS_INLINE CharType* StringBuilder::appendUninitialized(unsigned length) { - ASSERT(length); - - // Calculate the new size of the builder after appending. - unsigned requiredLength = length + m_length; - RELEASE_ASSERT(requiredLength >= length); - - if ((m_buffer) && (requiredLength <= m_buffer->length())) { - // If the buffer is valid it must be at least as long as the current builder - // contents! - ASSERT(m_buffer->length() >= m_length); - unsigned currentLength = m_length; - m_string = String(); - m_length = requiredLength; - return getBufferCharacters() + currentLength; - } - - return appendUninitializedSlow(requiredLength); -} - -// Make 'length' additional capacity be available in m_buffer, update m_string & -// m_length, return a pointer to the newly allocated storage. -template -CharType* StringBuilder::appendUninitializedSlow(unsigned requiredLength) { - ASSERT(requiredLength); - - if (m_buffer) { - // If the buffer is valid it must be at least as long as the current builder - // contents! - ASSERT(m_buffer->length() >= m_length); - - reallocateBuffer(expandedCapacity(capacity(), requiredLength)); - } else { - ASSERT(m_string.length() == m_length); - allocateBuffer(m_length ? m_string.getCharacters() : 0, - expandedCapacity(capacity(), requiredLength)); - } - - CharType* result = getBufferCharacters() + m_length; - m_length = requiredLength; - return result; -} - -void StringBuilder::append(const UChar* characters, unsigned length) { - if (!length) - return; - - ASSERT(characters); - - if (m_is8Bit) { - if (length == 1 && !(*characters & ~0xff)) { - // Append as 8 bit character - LChar lChar = static_cast(*characters); - append(&lChar, 1); - return; - } - - // Calculate the new size of the builder after appending. - unsigned requiredLength = length + m_length; - RELEASE_ASSERT(requiredLength >= length); - - if (m_buffer) { - // If the buffer is valid it must be at least as long as the current - // builder contents! - ASSERT(m_buffer->length() >= m_length); - - allocateBufferUpConvert(m_buffer->characters8(), - expandedCapacity(capacity(), requiredLength)); - } else { - ASSERT(m_string.length() == m_length); - allocateBufferUpConvert(m_string.isNull() ? 0 : m_string.characters8(), - expandedCapacity(capacity(), requiredLength)); - } - - memcpy(m_bufferCharacters16 + m_length, characters, - static_cast(length) * sizeof(UChar)); - m_length = requiredLength; - } else - memcpy(appendUninitialized(length), characters, - static_cast(length) * sizeof(UChar)); -} - -void StringBuilder::append(const LChar* characters, unsigned length) { - if (!length) - return; - ASSERT(characters); - - if (m_is8Bit) { - LChar* dest = appendUninitialized(length); - if (length > 8) - memcpy(dest, characters, static_cast(length) * sizeof(LChar)); - else { - const LChar* end = characters + length; - while (characters < end) - *(dest++) = *(characters++); - } - } else { - UChar* dest = appendUninitialized(length); - const LChar* end = characters + length; - while (characters < end) - *(dest++) = *(characters++); - } -} - -void StringBuilder::appendNumber(int number) { - numberToStringSigned(number, this); -} - -void StringBuilder::appendNumber(unsigned number) { - numberToStringUnsigned(number, this); -} - -void StringBuilder::appendNumber(long number) { - numberToStringSigned(number, this); -} - -void StringBuilder::appendNumber(unsigned long number) { - numberToStringUnsigned(number, this); -} - -void StringBuilder::appendNumber(long long number) { - numberToStringSigned(number, this); -} - -void StringBuilder::appendNumber(unsigned long long number) { - numberToStringUnsigned(number, this); -} - -static void expandLCharToUCharInplace(UChar* buffer, size_t length) { - const LChar* sourceEnd = reinterpret_cast(buffer) + length; - UChar* current = buffer + length; - while (current != buffer) - *--current = *--sourceEnd; -} - -void StringBuilder::appendNumber( - double number, - unsigned precision, - TrailingZerosTruncatingPolicy trailingZerosTruncatingPolicy) { - bool truncateTrailingZeros = - trailingZerosTruncatingPolicy == TruncateTrailingZeros; - size_t numberLength; - if (m_is8Bit) { - LChar* dest = appendUninitialized(NumberToStringBufferLength); - const char* result = numberToFixedPrecisionString( - number, precision, reinterpret_cast(dest), - truncateTrailingZeros); - numberLength = strlen(result); - } else { - UChar* dest = appendUninitialized(NumberToStringBufferLength); - const char* result = numberToFixedPrecisionString( - number, precision, reinterpret_cast(dest), - truncateTrailingZeros); - numberLength = strlen(result); - expandLCharToUCharInplace(dest, numberLength); - } - ASSERT(m_length >= NumberToStringBufferLength); - // Remove what appendUninitialized added. - m_length -= NumberToStringBufferLength; - ASSERT(numberLength <= NumberToStringBufferLength); - m_length += numberLength; -} - -bool StringBuilder::canShrink() const { - // Only shrink the buffer if it's less than 80% full. Need to tune this - // heuristic! - return m_buffer && m_buffer->length() > (m_length + (m_length >> 2)); -} - -void StringBuilder::shrinkToFit() { - if (!canShrink()) - return; - if (m_is8Bit) - reallocateBuffer(m_length); - else - reallocateBuffer(m_length); - m_string = m_buffer.release(); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/StringBuilder.h b/sky/engine/wtf/text/StringBuilder.h deleted file mode 100644 index b4777eed9abc4..0000000000000 --- a/sky/engine/wtf/text/StringBuilder.h +++ /dev/null @@ -1,389 +0,0 @@ -/* - * Copyright (C) 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_STRINGBUILDER_H_ -#define SKY_ENGINE_WTF_TEXT_STRINGBUILDER_H_ - -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -class WTF_EXPORT StringBuilder { - // Disallow copying since it's expensive and we don't want code to do it by - // accident. - WTF_MAKE_NONCOPYABLE(StringBuilder); - - public: - StringBuilder() : m_bufferCharacters8(0), m_length(0), m_is8Bit(true) {} - - void append(const UChar*, unsigned); - void append(const LChar*, unsigned); - - ALWAYS_INLINE void append(const char* characters, unsigned length) { - append(reinterpret_cast(characters), length); - } - - void append(const String& string) { - if (!string.length()) - return; - - // If we're appending to an empty string, and there is not a buffer - // (reserveCapacity has not been called) then just retain the string. - if (!m_length && !m_buffer) { - m_string = string; - m_length = string.length(); - m_is8Bit = m_string.is8Bit(); - return; - } - - if (string.is8Bit()) - append(string.characters8(), string.length()); - else - append(string.characters16(), string.length()); - } - - void append(const StringBuilder& other) { - if (!other.m_length) - return; - - // If we're appending to an empty string, and there is not a buffer - // (reserveCapacity has not been called) then just retain the string. - if (!m_length && !m_buffer && !other.m_string.isNull()) { - m_string = other.m_string; - m_length = other.m_length; - return; - } - - if (other.is8Bit()) - append(other.characters8(), other.m_length); - else - append(other.characters16(), other.m_length); - } - - void append(const String& string, unsigned offset, unsigned length) { - if (!string.length()) - return; - - unsigned extent = offset + length; - if (extent < offset || extent > string.length()) - return; - - if (string.is8Bit()) - append(string.characters8() + offset, length); - else - append(string.characters16() + offset, length); - } - - void append(const StringView& string) { - if (!string.length()) - return; - - if (string.is8Bit()) - append(string.characters8(), string.length()); - else - append(string.characters16(), string.length()); - } - - void append(const char* characters) { - if (characters) - append(characters, strlen(characters)); - } - - void append(UChar c) { - if (m_buffer && m_length < m_buffer->length() && m_string.isNull()) { - if (!m_is8Bit) { - m_bufferCharacters16[m_length++] = c; - return; - } - - if (!(c & ~0xff)) { - m_bufferCharacters8[m_length++] = static_cast(c); - return; - } - } - append(&c, 1); - } - - void append(LChar c) { - if (m_buffer && m_length < m_buffer->length() && m_string.isNull()) { - if (m_is8Bit) - m_bufferCharacters8[m_length++] = c; - else - m_bufferCharacters16[m_length++] = c; - } else - append(&c, 1); - } - - void append(char c) { append(static_cast(c)); } - - void append(UChar32 c) { - if (U_IS_BMP(c)) { - append(static_cast(c)); - return; - } - append(U16_LEAD(c)); - append(U16_TRAIL(c)); - } - - template - ALWAYS_INLINE void appendLiteral(const char (&characters)[charactersCount]) { - append(characters, charactersCount - 1); - } - - void appendNumber(int); - void appendNumber(unsigned); - void appendNumber(long); - void appendNumber(unsigned long); - void appendNumber(long long); - void appendNumber(unsigned long long); - void appendNumber(double, - unsigned precision = 6, - TrailingZerosTruncatingPolicy = TruncateTrailingZeros); - - String toString() { - shrinkToFit(); - if (m_string.isNull()) - reifyString(); - return m_string; - } - - String substring(unsigned position, unsigned length) const { - if (!m_length) - return emptyString(); - if (!m_string.isNull()) - return m_string.substring(position, length); - return reifySubstring(position, length); - } - - AtomicString toAtomicString() const { - if (!m_length) - return emptyAtom; - - // If the buffer is sufficiently over-allocated, make a new AtomicString - // from a copy so its buffer is not so large. - if (canShrink()) { - if (is8Bit()) - return AtomicString(characters8(), length()); - return AtomicString(characters16(), length()); - } - - if (!m_string.isNull()) - return AtomicString(m_string); - - ASSERT(m_buffer); - return AtomicString(m_buffer.get(), 0, m_length); - } - - unsigned length() const { return m_length; } - - bool isEmpty() const { return !m_length; } - - void reserveCapacity(unsigned newCapacity); - - unsigned capacity() const { return m_buffer ? m_buffer->length() : m_length; } - - void resize(unsigned newSize); - - bool canShrink() const; - - void shrinkToFit(); - - UChar operator[](unsigned i) const { - ASSERT_WITH_SECURITY_IMPLICATION(i < m_length); - if (m_is8Bit) - return characters8()[i]; - return characters16()[i]; - } - - const LChar* characters8() const { - ASSERT(m_is8Bit); - if (!m_length) - return 0; - if (!m_string.isNull()) - return m_string.characters8(); - ASSERT(m_buffer); - return m_buffer->characters8(); - } - - const UChar* characters16() const { - ASSERT(!m_is8Bit); - if (!m_length) - return 0; - if (!m_string.isNull()) - return m_string.characters16(); - ASSERT(m_buffer); - return m_buffer->characters16(); - } - - bool is8Bit() const { return m_is8Bit; } - - void clear() { - m_length = 0; - m_string = String(); - m_buffer = nullptr; - m_bufferCharacters8 = 0; - m_is8Bit = true; - } - - void swap(StringBuilder& stringBuilder) { - std::swap(m_length, stringBuilder.m_length); - m_string.swap(stringBuilder.m_string); - m_buffer.swap(stringBuilder.m_buffer); - std::swap(m_is8Bit, stringBuilder.m_is8Bit); - std::swap(m_bufferCharacters8, stringBuilder.m_bufferCharacters8); - } - - private: - void allocateBuffer(const LChar* currentCharacters, unsigned requiredLength); - void allocateBuffer(const UChar* currentCharacters, unsigned requiredLength); - void allocateBufferUpConvert(const LChar* currentCharacters, - unsigned requiredLength); - template - void reallocateBuffer(unsigned requiredLength); - template - ALWAYS_INLINE CharType* appendUninitialized(unsigned length); - template - CharType* appendUninitializedSlow(unsigned length); - template - ALWAYS_INLINE CharType* getBufferCharacters(); - void reifyString(); - String reifySubstring(unsigned position, unsigned length) const; - - String m_string; // Pointers first: crbug.com/232031 - RefPtr m_buffer; - union { - LChar* m_bufferCharacters8; - UChar* m_bufferCharacters16; - }; - unsigned m_length; - bool m_is8Bit; -}; - -template <> -ALWAYS_INLINE LChar* StringBuilder::getBufferCharacters() { - ASSERT(m_is8Bit); - return m_bufferCharacters8; -} - -template <> -ALWAYS_INLINE UChar* StringBuilder::getBufferCharacters() { - ASSERT(!m_is8Bit); - return m_bufferCharacters16; -} - -template -bool equal(const StringBuilder& s, const CharType* buffer, unsigned length) { - if (s.length() != length) - return false; - - if (s.is8Bit()) - return equal(s.characters8(), buffer, length); - - return equal(s.characters16(), buffer, length); -} - -template -bool equalIgnoringCase(const StringBuilder& s, - const CharType* buffer, - unsigned length) { - if (s.length() != length) - return false; - - if (s.is8Bit()) - return equalIgnoringCase(s.characters8(), buffer, length); - - return equalIgnoringCase(s.characters16(), buffer, length); -} - -inline bool equalIgnoringCase(const StringBuilder& s, const char* string) { - return equalIgnoringCase(s, reinterpret_cast(string), - strlen(string)); -} - -template -bool equal(const StringBuilder& a, const StringType& b) { - if (a.length() != b.length()) - return false; - - if (!a.length()) - return true; - - if (a.is8Bit()) { - if (b.is8Bit()) - return equal(a.characters8(), b.characters8(), a.length()); - return equal(a.characters8(), b.characters16(), a.length()); - } - - if (b.is8Bit()) - return equal(a.characters16(), b.characters8(), a.length()); - return equal(a.characters16(), b.characters16(), a.length()); -} - -template -bool equalIgnoringCase(const StringBuilder& a, const StringType& b) { - if (a.length() != b.length()) - return false; - - if (!a.length()) - return true; - - if (a.is8Bit()) { - if (b.is8Bit()) - return equalIgnoringCase(a.characters8(), b.characters8(), a.length()); - return equalIgnoringCase(a.characters8(), b.characters16(), a.length()); - } - - if (b.is8Bit()) - return equalIgnoringCase(a.characters16(), b.characters8(), a.length()); - return equalIgnoringCase(a.characters16(), b.characters16(), a.length()); -} - -inline bool operator==(const StringBuilder& a, const StringBuilder& b) { - return equal(a, b); -} -inline bool operator!=(const StringBuilder& a, const StringBuilder& b) { - return !equal(a, b); -} -inline bool operator==(const StringBuilder& a, const String& b) { - return equal(a, b); -} -inline bool operator!=(const StringBuilder& a, const String& b) { - return !equal(a, b); -} -inline bool operator==(const String& a, const StringBuilder& b) { - return equal(b, a); -} -inline bool operator!=(const String& a, const StringBuilder& b) { - return !equal(b, a); -} - -} // namespace WTF - -using WTF::StringBuilder; - -#endif // SKY_ENGINE_WTF_TEXT_STRINGBUILDER_H_ diff --git a/sky/engine/wtf/text/StringBuilderTest.cpp b/sky/engine/wtf/text/StringBuilderTest.cpp deleted file mode 100644 index 59aab44b96196..0000000000000 --- a/sky/engine/wtf/text/StringBuilderTest.cpp +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * Copyright (C) 2013 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -namespace WTF { - -static std::ostream& operator<<(std::ostream& os, const String& string) { - return os << string.utf8().data(); -} - -} // namespace WTF - -namespace { - -static void expectBuilderContent(const String& expected, - const StringBuilder& builder) { - // Not using builder.toString() because it changes internal state of builder. - if (builder.is8Bit()) - EXPECT_EQ(expected, String(builder.characters8(), builder.length())); - else - EXPECT_EQ(expected, String(builder.characters16(), builder.length())); -} - -void expectEmpty(const StringBuilder& builder) { - EXPECT_EQ(0U, builder.length()); - EXPECT_TRUE(builder.isEmpty()); - EXPECT_EQ(0, builder.characters8()); -} - -TEST(StringBuilderTest, DefaultConstructor) { - StringBuilder builder; - expectEmpty(builder); -} - -TEST(StringBuilderTest, Append) { - StringBuilder builder; - builder.append(String("0123456789")); - expectBuilderContent("0123456789", builder); - builder.append("abcd"); - expectBuilderContent("0123456789abcd", builder); - builder.append("efgh", 3); - expectBuilderContent("0123456789abcdefg", builder); - builder.append(""); - expectBuilderContent("0123456789abcdefg", builder); - builder.append('#'); - expectBuilderContent("0123456789abcdefg#", builder); - - builder.toString(); // Test after reifyString(). - StringBuilder builder1; - builder.append("", 0); - expectBuilderContent("0123456789abcdefg#", builder); - builder1.append(builder.characters8(), builder.length()); - builder1.append("XYZ"); - builder.append(builder1.characters8(), builder1.length()); - expectBuilderContent("0123456789abcdefg#0123456789abcdefg#XYZ", builder); - - StringBuilder builder2; - builder2.reserveCapacity(100); - builder2.append("xyz"); - const LChar* characters = builder2.characters8(); - builder2.append("0123456789"); - ASSERT_EQ(characters, builder2.characters8()); - - // Test appending UChar32 characters to StringBuilder. - StringBuilder builderForUChar32Append; - UChar32 frakturAChar = 0x1D504; - builderForUChar32Append.append(frakturAChar); // The fraktur A is not in the - // BMP, so it's two UTF-16 code - // units long. - ASSERT_EQ(2U, builderForUChar32Append.length()); - builderForUChar32Append.append(static_cast('A')); - ASSERT_EQ(3U, builderForUChar32Append.length()); - const UChar resultArray[] = {U16_LEAD(frakturAChar), U16_TRAIL(frakturAChar), - 'A'}; - expectBuilderContent(String(resultArray, WTF_ARRAY_LENGTH(resultArray)), - builderForUChar32Append); -} - -TEST(StringBuilderTest, ToString) { - StringBuilder builder; - builder.append("0123456789"); - String string = builder.toString(); - ASSERT_EQ(String("0123456789"), string); - ASSERT_EQ(string.impl(), builder.toString().impl()); - - // Changing the StringBuilder should not affect the original result of - // toString(). - builder.append("abcdefghijklmnopqrstuvwxyz"); - ASSERT_EQ(String("0123456789"), string); - - // Changing the StringBuilder should not affect the original result of - // toString() in case the capacity is not changed. - builder.reserveCapacity(200); - string = builder.toString(); - ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyz"), string); - builder.append("ABC"); - ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyz"), string); - - // Changing the original result of toString() should not affect the content of - // the StringBuilder. - String string1 = builder.toString(); - ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyzABC"), string1); - string1.append("DEF"); - ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyzABC"), - builder.toString()); - ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyzABCDEF"), string1); - - // Resizing the StringBuilder should not affect the original result of - // toString(). - string1 = builder.toString(); - builder.resize(10); - builder.append("###"); - ASSERT_EQ(String("0123456789abcdefghijklmnopqrstuvwxyzABC"), string1); -} - -TEST(StringBuilderTest, Clear) { - StringBuilder builder; - builder.append("0123456789"); - builder.clear(); - expectEmpty(builder); -} - -TEST(StringBuilderTest, Array) { - StringBuilder builder; - builder.append("0123456789"); - EXPECT_EQ('0', static_cast(builder[0])); - EXPECT_EQ('9', static_cast(builder[9])); - builder.toString(); // Test after reifyString(). - EXPECT_EQ('0', static_cast(builder[0])); - EXPECT_EQ('9', static_cast(builder[9])); -} - -TEST(StringBuilderTest, Resize) { - StringBuilder builder; - builder.append("0123456789"); - builder.resize(10); - EXPECT_EQ(10U, builder.length()); - expectBuilderContent("0123456789", builder); - builder.resize(8); - EXPECT_EQ(8U, builder.length()); - expectBuilderContent("01234567", builder); - - builder.toString(); - builder.resize(7); - EXPECT_EQ(7U, builder.length()); - expectBuilderContent("0123456", builder); - builder.resize(0); - expectEmpty(builder); -} - -TEST(StringBuilderTest, Equal) { - StringBuilder builder1; - StringBuilder builder2; - ASSERT_TRUE(builder1 == builder2); - ASSERT_TRUE(equal(builder1, static_cast(0), 0)); - ASSERT_TRUE(builder1 == String()); - ASSERT_TRUE(String() == builder1); - ASSERT_TRUE(builder1 != String("abc")); - - builder1.append("123"); - builder1.reserveCapacity(32); - builder2.append("123"); - builder1.reserveCapacity(64); - ASSERT_TRUE(builder1 == builder2); - ASSERT_TRUE(builder1 == String("123")); - ASSERT_TRUE(String("123") == builder1); - - builder2.append("456"); - ASSERT_TRUE(builder1 != builder2); - ASSERT_TRUE(builder2 != builder1); - ASSERT_TRUE(String("123") != builder2); - ASSERT_TRUE(builder2 != String("123")); - builder2.toString(); // Test after reifyString(). - ASSERT_TRUE(builder1 != builder2); - - builder2.resize(3); - ASSERT_TRUE(builder1 == builder2); - - builder1.toString(); // Test after reifyString(). - ASSERT_TRUE(builder1 == builder2); -} - -TEST(StringBuilderTest, CanShrink) { - StringBuilder builder; - builder.reserveCapacity(256); - ASSERT_TRUE(builder.canShrink()); - for (int i = 0; i < 256; i++) - builder.append('x'); - ASSERT_EQ(builder.length(), builder.capacity()); - ASSERT_FALSE(builder.canShrink()); -} - -TEST(StringBuilderTest, ToAtomicString) { - StringBuilder builder; - builder.append("123"); - AtomicString atomicString = builder.toAtomicString(); - ASSERT_EQ(String("123"), atomicString); - - builder.reserveCapacity(256); - ASSERT_TRUE(builder.canShrink()); - for (int i = builder.length(); i < 128; i++) - builder.append('x'); - AtomicString atomicString1 = builder.toAtomicString(); - ASSERT_EQ(128u, atomicString1.length()); - ASSERT_EQ('x', atomicString1[127]); - - // Later change of builder should not affect the atomic string. - for (int i = builder.length(); i < 256; i++) - builder.append('x'); - ASSERT_EQ(128u, atomicString1.length()); - - ASSERT_FALSE(builder.canShrink()); - String string = builder.toString(); - AtomicString atomicString2 = builder.toAtomicString(); - // They should share the same StringImpl. - ASSERT_EQ(atomicString2.impl(), string.impl()); -} - -TEST(StringBuilderTest, ToAtomicStringOnEmpty) { - { // Default constructed. - StringBuilder builder; - AtomicString atomicString = builder.toAtomicString(); - ASSERT_EQ(emptyAtom, atomicString); - } - { // With capacity. - StringBuilder builder; - builder.reserveCapacity(64); - AtomicString atomicString = builder.toAtomicString(); - ASSERT_EQ(emptyAtom, atomicString); - } - { // AtomicString constructed from a null string. - StringBuilder builder; - builder.append(String()); - AtomicString atomicString = builder.toAtomicString(); - ASSERT_EQ(emptyAtom, atomicString); - } - { // AtomicString constructed from an empty string. - StringBuilder builder; - builder.append(emptyString()); - AtomicString atomicString = builder.toAtomicString(); - ASSERT_EQ(emptyAtom, atomicString); - } - { // AtomicString constructed from an empty StringBuilder. - StringBuilder builder; - StringBuilder emptyBuilder; - builder.append(emptyBuilder); - AtomicString atomicString = builder.toAtomicString(); - ASSERT_EQ(emptyAtom, atomicString); - } - { // AtomicString constructed from an empty char* string. - StringBuilder builder; - builder.append("", 0); - AtomicString atomicString = builder.toAtomicString(); - ASSERT_EQ(emptyAtom, atomicString); - } - { // Cleared StringBuilder. - StringBuilder builder; - builder.appendLiteral("WebKit"); - builder.clear(); - AtomicString atomicString = builder.toAtomicString(); - ASSERT_EQ(emptyAtom, atomicString); - } -} - -TEST(StringBuilderTest, Substring) { - { // Default constructed. - StringBuilder builder; - String substring = builder.substring(0, 10); - ASSERT_EQ(emptyString(), substring); - } - { // With capacity. - StringBuilder builder; - builder.reserveCapacity(64); - builder.append("abc"); - String substring = builder.substring(2, 10); - ASSERT_EQ(String("c"), substring); - } -} - -TEST(StringBuilderTest, AppendNumberDoubleUChar) { - const double someNumber = 1.2345; - StringBuilder reference; - reference.append(replacementCharacter); // Make it UTF-16. - reference.append(String::number(someNumber)); - StringBuilder test; - test.append(replacementCharacter); - test.appendNumber(someNumber); - ASSERT_EQ(reference, test); -} - -} // namespace diff --git a/sky/engine/wtf/text/StringConcatenate.h b/sky/engine/wtf/text/StringConcatenate.h deleted file mode 100644 index 4b22204cc7bad..0000000000000 --- a/sky/engine/wtf/text/StringConcatenate.h +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_STRINGCONCATENATE_H_ -#define SKY_ENGINE_WTF_TEXT_STRINGCONCATENATE_H_ - -#include - -#ifndef WTFString_h -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#endif - -// This macro is helpful for testing how many intermediate Strings are created -// while evaluating an expression containing operator+. -#ifndef WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING -#define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() ((void)0) -#endif - -namespace WTF { - -template -class StringTypeAdapter {}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(char buffer) : m_buffer(buffer) {} - - unsigned length() { return 1; } - - bool is8Bit() { return true; } - - void writeTo(LChar* destination) { *destination = m_buffer; } - - void writeTo(UChar* destination) { *destination = m_buffer; } - - private: - unsigned char m_buffer; -}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(LChar buffer) : m_buffer(buffer) {} - - unsigned length() { return 1; } - - bool is8Bit() { return true; } - - void writeTo(LChar* destination) { *destination = m_buffer; } - - void writeTo(UChar* destination) { *destination = m_buffer; } - - private: - LChar m_buffer; -}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(UChar buffer) : m_buffer(buffer) {} - - unsigned length() { return 1; } - - bool is8Bit() { return m_buffer <= 0xff; } - - void writeTo(LChar* destination) { - ASSERT(is8Bit()); - *destination = static_cast(m_buffer); - } - - void writeTo(UChar* destination) { *destination = m_buffer; } - - private: - UChar m_buffer; -}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(char* buffer) - : m_buffer(buffer), m_length(strlen(buffer)) {} - - unsigned length() { return m_length; } - - bool is8Bit() { return true; } - - void writeTo(LChar* destination) { - for (unsigned i = 0; i < m_length; ++i) - destination[i] = static_cast(m_buffer[i]); - } - - void writeTo(UChar* destination) { - for (unsigned i = 0; i < m_length; ++i) { - unsigned char c = m_buffer[i]; - destination[i] = c; - } - } - - private: - const char* m_buffer; - unsigned m_length; -}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(LChar* buffer) - : m_buffer(buffer), m_length(strlen(reinterpret_cast(buffer))) {} - - unsigned length() { return m_length; } - - bool is8Bit() { return true; } - - void writeTo(LChar* destination) { - memcpy(destination, m_buffer, m_length * sizeof(LChar)); - } - - void writeTo(UChar* destination) { - StringImpl::copyChars(destination, m_buffer, m_length); - } - - private: - const LChar* m_buffer; - unsigned m_length; -}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(const UChar* buffer) : m_buffer(buffer) { - size_t len = 0; - while (m_buffer[len] != UChar(0)) - ++len; - - RELEASE_ASSERT(len <= std::numeric_limits::max()); - - m_length = len; - } - - unsigned length() { return m_length; } - - bool is8Bit() { return false; } - - NO_RETURN_DUE_TO_CRASH void writeTo(LChar*) { RELEASE_ASSERT(false); } - - void writeTo(UChar* destination) { - memcpy(destination, m_buffer, m_length * sizeof(UChar)); - } - - private: - const UChar* m_buffer; - unsigned m_length; -}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(const char* buffer) - : m_buffer(buffer), m_length(strlen(buffer)) {} - - unsigned length() { return m_length; } - - bool is8Bit() { return true; } - - void writeTo(LChar* destination) { - memcpy(destination, m_buffer, - static_cast(m_length) * sizeof(LChar)); - } - - void writeTo(UChar* destination) { - for (unsigned i = 0; i < m_length; ++i) { - unsigned char c = m_buffer[i]; - destination[i] = c; - } - } - - private: - const char* m_buffer; - unsigned m_length; -}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(const LChar* buffer) - : m_buffer(buffer), - m_length(strlen(reinterpret_cast(buffer))) {} - - unsigned length() { return m_length; } - - bool is8Bit() { return true; } - - void writeTo(LChar* destination) { - memcpy(destination, m_buffer, - static_cast(m_length) * sizeof(LChar)); - } - - void writeTo(UChar* destination) { - StringImpl::copyChars(destination, m_buffer, m_length); - } - - private: - const LChar* m_buffer; - unsigned m_length; -}; - -template <> -class StringTypeAdapter> { - public: - StringTypeAdapter>(const Vector& buffer) - : m_buffer(buffer) {} - - size_t length() { return m_buffer.size(); } - - bool is8Bit() { return true; } - - void writeTo(LChar* destination) { - for (size_t i = 0; i < m_buffer.size(); ++i) - destination[i] = static_cast(m_buffer[i]); - } - - void writeTo(UChar* destination) { - for (size_t i = 0; i < m_buffer.size(); ++i) - destination[i] = static_cast(m_buffer[i]); - } - - private: - const Vector& m_buffer; -}; - -template <> -class StringTypeAdapter> { - public: - StringTypeAdapter>(const Vector& buffer) - : m_buffer(buffer) {} - - size_t length() { return m_buffer.size(); } - - bool is8Bit() { return true; } - - void writeTo(LChar* destination) { - for (size_t i = 0; i < m_buffer.size(); ++i) - destination[i] = m_buffer[i]; - } - - void writeTo(UChar* destination) { - for (size_t i = 0; i < m_buffer.size(); ++i) - destination[i] = m_buffer[i]; - } - - private: - const Vector& m_buffer; -}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(const String& string) : m_buffer(string) {} - - unsigned length() { return m_buffer.length(); } - - bool is8Bit() { return m_buffer.isNull() || m_buffer.is8Bit(); } - - void writeTo(LChar* destination) { - unsigned length = m_buffer.length(); - - ASSERT(is8Bit()); - const LChar* data = m_buffer.characters8(); - for (unsigned i = 0; i < length; ++i) - destination[i] = data[i]; - - WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); - } - - void writeTo(UChar* destination) { - unsigned length = m_buffer.length(); - - if (is8Bit()) { - const LChar* data = m_buffer.characters8(); - for (unsigned i = 0; i < length; ++i) - destination[i] = data[i]; - } else { - const UChar* data = m_buffer.characters16(); - for (unsigned i = 0; i < length; ++i) - destination[i] = data[i]; - } - - WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); - } - - private: - const String& m_buffer; -}; - -template <> -class StringTypeAdapter { - public: - StringTypeAdapter(const AtomicString& string) - : m_adapter(string.string()) {} - - unsigned length() { return m_adapter.length(); } - - bool is8Bit() { return m_adapter.is8Bit(); } - - void writeTo(LChar* destination) { m_adapter.writeTo(destination); } - void writeTo(UChar* destination) { m_adapter.writeTo(destination); } - - private: - StringTypeAdapter m_adapter; -}; - -inline void sumWithOverflow(unsigned& total, unsigned addend, bool& overflow) { - unsigned oldTotal = total; - total = oldTotal + addend; - if (total < oldTotal) - overflow = true; -} - -template -PassRefPtr makeString(StringType1 string1, StringType2 string2) { - StringTypeAdapter adapter1(string1); - StringTypeAdapter adapter2(string2); - - bool overflow = false; - unsigned length = adapter1.length(); - sumWithOverflow(length, adapter2.length(), overflow); - if (overflow) - return nullptr; - - if (adapter1.is8Bit() && adapter2.is8Bit()) { - LChar* buffer; - RefPtr resultImpl = - StringImpl::createUninitialized(length, buffer); - if (!resultImpl) - return nullptr; - - LChar* result = buffer; - adapter1.writeTo(result); - result += adapter1.length(); - adapter2.writeTo(result); - - return resultImpl.release(); - } - - UChar* buffer; - RefPtr resultImpl = - StringImpl::createUninitialized(length, buffer); - if (!resultImpl) - return nullptr; - - UChar* result = buffer; - adapter1.writeTo(result); - result += adapter1.length(); - adapter2.writeTo(result); - - return resultImpl.release(); -} - -} // namespace WTF - -#include "flutter/sky/engine/wtf/text/StringOperators.h" -#endif // SKY_ENGINE_WTF_TEXT_STRINGCONCATENATE_H_ diff --git a/sky/engine/wtf/text/StringHash.h b/sky/engine/wtf/text/StringHash.h deleted file mode 100644 index 3b02cb84ccaa9..0000000000000 --- a/sky/engine/wtf/text/StringHash.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008, 2012, 2013 Apple Inc. All rights reserved - * Copyright (C) Research In Motion Limited 2009. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_TEXT_STRINGHASH_H_ -#define SKY_ENGINE_WTF_TEXT_STRINGHASH_H_ - -#include "flutter/sky/engine/wtf/HashTraits.h" -#include "flutter/sky/engine/wtf/StringHasher.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" - -namespace WTF { - -inline bool HashTraits::isEmptyValue(const String& value) { - return value.isNull(); -} - -// The hash() functions on StringHash and CaseFoldingHash do not support -// null strings. get(), contains(), and add() on HashMap -// cause a null-pointer dereference when passed null strings. - -// FIXME: We should really figure out a way to put the computeHash function -// that's currently a member function of StringImpl into this file so we can be -// a little closer to having all the nearly-identical hash functions in one -// place. - -struct StringHash { - static unsigned hash(StringImpl* key) { return key->hash(); } - static inline bool equal(const StringImpl* a, const StringImpl* b) { - return equalNonNull(a, b); - } - - static unsigned hash(const RefPtr& key) { return key->hash(); } - static bool equal(const RefPtr& a, const RefPtr& b) { - return equal(a.get(), b.get()); - } - - static unsigned hash(const String& key) { return key.impl()->hash(); } - static bool equal(const String& a, const String& b) { - return equal(a.impl(), b.impl()); - } - - static const bool safeToCompareToEmptyOrDeleted = false; -}; - -class CaseFoldingHash { - public: - template - static inline UChar foldCase(T ch) { - return WTF::Unicode::foldCase(ch); - } - - static unsigned hash(const UChar* data, unsigned length) { - return StringHasher::computeHashAndMaskTop8Bits>( - data, length); - } - - static unsigned hash(StringImpl* str) { - if (str->is8Bit()) - return hash(str->characters8(), str->length()); - return hash(str->characters16(), str->length()); - } - - static unsigned hash(const LChar* data, unsigned length) { - return StringHasher::computeHashAndMaskTop8Bits>( - data, length); - } - - static inline unsigned hash(const char* data, unsigned length) { - return CaseFoldingHash::hash(reinterpret_cast(data), length); - } - - static inline bool equal(const StringImpl* a, const StringImpl* b) { - return equalIgnoringCaseNonNull(a, b); - } - - static unsigned hash(const RefPtr& key) { - return hash(key.get()); - } - - static bool equal(const RefPtr& a, const RefPtr& b) { - return equal(a.get(), b.get()); - } - - static unsigned hash(const String& key) { return hash(key.impl()); } - static unsigned hash(const AtomicString& key) { return hash(key.impl()); } - static bool equal(const String& a, const String& b) { - return equal(a.impl(), b.impl()); - } - static bool equal(const AtomicString& a, const AtomicString& b) { - return (a == b) || equal(a.impl(), b.impl()); - } - - static const bool safeToCompareToEmptyOrDeleted = false; -}; - -// This hash can be used in cases where the key is a hash of a string, but we -// don't want to store the string. It's not really specific to string hashing, -// but all our current uses of it are for strings. -struct AlreadyHashed : IntHash { - static unsigned hash(unsigned key) { return key; } - - // To use a hash value as a key for a hash table, we need to eliminate the - // "deleted" value, which is negative one. That could be done by changing - // the string hash function to never generate negative one, but this works - // and is still relatively efficient. - static unsigned avoidDeletedValue(unsigned hash) { - ASSERT(hash); - unsigned newHash = hash | (!(hash + 1) << 31); - ASSERT(newHash); - ASSERT(newHash != 0xFFFFFFFF); - return newHash; - } -}; - -} // namespace WTF - -using WTF::AlreadyHashed; -using WTF::CaseFoldingHash; -using WTF::StringHash; - -#endif // SKY_ENGINE_WTF_TEXT_STRINGHASH_H_ diff --git a/sky/engine/wtf/text/StringImpl.cpp b/sky/engine/wtf/text/StringImpl.cpp deleted file mode 100644 index 83c90dc6f716a..0000000000000 --- a/sky/engine/wtf/text/StringImpl.cpp +++ /dev/null @@ -1,2218 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * (C) 2001 Dirk Mueller ( mueller@kde.org ) - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All - * rights reserved. - * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "flutter/sky/engine/wtf/text/StringImpl.h" - -#include -#include -#include "flutter/sky/engine/wtf/DynamicAnnotations.h" -#include "flutter/sky/engine/wtf/LeakAnnotations.h" -#include "flutter/sky/engine/wtf/MainThread.h" -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/PartitionAlloc.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/WTF.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/StringBuffer.h" -#include "flutter/sky/engine/wtf/text/StringHash.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -#ifdef STRING_STATS -#include -#include "flutter/sky/engine/wtf/DataLog.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/RefCounted.h" -#include "flutter/sky/engine/wtf/ThreadingPrimitives.h" -#endif - -using namespace std; - -namespace WTF { - -using namespace Unicode; - -COMPILE_ASSERT(sizeof(StringImpl) == 3 * sizeof(int), - StringImpl_should_stay_small); - -#ifdef STRING_STATS - -static Mutex& statsMutex() { - DEFINE_STATIC_LOCAL(Mutex, mutex, ()); - return mutex; -} - -static HashSet& liveStrings() { - // Notice that we can't use HashSet because then HashSet would - // dedup identical strings. - DEFINE_STATIC_LOCAL(HashSet, strings, ()); - return strings; -} - -void addStringForStats(StringImpl* string) { - MutexLocker locker(statsMutex()); - liveStrings().add(string); -} - -void removeStringForStats(StringImpl* string) { - MutexLocker locker(statsMutex()); - liveStrings().remove(string); -} - -static void fillWithSnippet(const StringImpl* string, Vector& snippet) { - const unsigned kMaxSnippetLength = 64; - snippet.clear(); - - size_t expectedLength = std::min(string->length(), kMaxSnippetLength); - if (expectedLength == kMaxSnippetLength) - expectedLength += 3; // For the "...". - ++expectedLength; // For the terminating '\0'. - snippet.reserveCapacity(expectedLength); - - size_t i; - for (i = 0; i < string->length() && i < kMaxSnippetLength; ++i) { - UChar c = (*string)[i]; - if (isASCIIPrintable(c)) - snippet.append(c); - else - snippet.append('?'); - } - if (i < string->length()) { - snippet.append('.'); - snippet.append('.'); - snippet.append('.'); - } - snippet.append('\0'); -} - -static bool isUnnecessarilyWide(const StringImpl* string) { - if (string->is8Bit()) - return false; - UChar c = 0; - for (unsigned i = 0; i < string->length(); ++i) - c |= (*string)[i] >> 8; - return !c; -} - -class PerStringStats : public RefCounted { - public: - static PassRefPtr create() { - return adoptRef(new PerStringStats); - } - - void add(const StringImpl* string) { - ++m_numberOfCopies; - if (!m_length) { - m_length = string->length(); - fillWithSnippet(string, m_snippet); - } - if (string->isAtomic()) - ++m_numberOfAtomicCopies; - if (isUnnecessarilyWide(string)) - m_unnecessarilyWide = true; - } - - size_t totalCharacters() const { return m_numberOfCopies * m_length; } - - void print() { - const char* status = "ok"; - if (m_unnecessarilyWide) - status = "16"; - dataLogF("%8u copies (%s) of length %8u %s\n", m_numberOfCopies, status, - m_length, m_snippet.data()); - } - - bool m_unnecessarilyWide; - unsigned m_numberOfCopies; - unsigned m_length; - unsigned m_numberOfAtomicCopies; - Vector m_snippet; - - private: - PerStringStats() - : m_unnecessarilyWide(false), - m_numberOfCopies(0), - m_length(0), - m_numberOfAtomicCopies(0) {} -}; - -bool operator<(const RefPtr& a, - const RefPtr& b) { - if (a->m_unnecessarilyWide != b->m_unnecessarilyWide) - return !a->m_unnecessarilyWide && b->m_unnecessarilyWide; - if (a->totalCharacters() != b->totalCharacters()) - return a->totalCharacters() < b->totalCharacters(); - if (a->m_numberOfCopies != b->m_numberOfCopies) - return a->m_numberOfCopies < b->m_numberOfCopies; - if (a->m_length != b->m_length) - return a->m_length < b->m_length; - return a->m_numberOfAtomicCopies < b->m_numberOfAtomicCopies; -} - -static void printLiveStringStats() { - MutexLocker locker(statsMutex()); - HashSet& strings = liveStrings(); - - HashMap> stats; - for (HashSet::iterator iter = strings.begin(); iter != strings.end(); - ++iter) { - StringImpl* string = static_cast(*iter); - HashMap>::iterator entry = - stats.find(string); - RefPtr value = - entry == stats.end() ? RefPtr(PerStringStats::create()) - : entry->value; - value->add(string); - stats.set(string, value.release()); - } - - Vector> all; - for (HashMap>::iterator iter = - stats.begin(); - iter != stats.end(); ++iter) - all.append(iter->value); - - std::sort(all.begin(), all.end()); - std::reverse(all.begin(), all.end()); - for (size_t i = 0; i < 20 && i < all.size(); ++i) - all[i]->print(); -} - -StringStats StringImpl::m_stringStats; - -unsigned StringStats::s_stringRemovesTillPrintStats = - StringStats::s_printStringStatsFrequency; - -void StringStats::removeString(StringImpl* string) { - unsigned length = string->length(); - --m_totalNumberStrings; - - if (string->is8Bit()) { - --m_number8BitStrings; - m_total8BitData -= length; - } else { - --m_number16BitStrings; - m_total16BitData -= length; - } - - if (!--s_stringRemovesTillPrintStats) { - s_stringRemovesTillPrintStats = s_printStringStatsFrequency; - printStats(); - } -} - -void StringStats::printStats() { - dataLogF("String stats\n"); - - unsigned long long totalNumberCharacters = m_total8BitData + m_total16BitData; - double percent8Bit = - m_totalNumberStrings - ? ((double)m_number8BitStrings * 100) / (double)m_totalNumberStrings - : 0.0; - double average8bitLength = - m_number8BitStrings - ? (double)m_total8BitData / (double)m_number8BitStrings - : 0.0; - dataLogF( - "%8u (%5.2f%%) 8 bit %12llu chars %12llu bytes avg length " - "%6.1f\n", - m_number8BitStrings, percent8Bit, m_total8BitData, m_total8BitData, - average8bitLength); - - double percent16Bit = - m_totalNumberStrings - ? ((double)m_number16BitStrings * 100) / (double)m_totalNumberStrings - : 0.0; - double average16bitLength = - m_number16BitStrings - ? (double)m_total16BitData / (double)m_number16BitStrings - : 0.0; - dataLogF( - "%8u (%5.2f%%) 16 bit %12llu chars %12llu bytes avg length " - "%6.1f\n", - m_number16BitStrings, percent16Bit, m_total16BitData, - m_total16BitData * 2, average16bitLength); - - double averageLength = m_totalNumberStrings ? (double)totalNumberCharacters / - (double)m_totalNumberStrings - : 0.0; - unsigned long long totalDataBytes = m_total8BitData + m_total16BitData * 2; - dataLogF( - "%8u Total %12llu chars %12llu bytes avg length " - "%6.1f\n", - m_totalNumberStrings, totalNumberCharacters, totalDataBytes, - averageLength); - unsigned long long totalSavedBytes = m_total8BitData; - double percentSavings = totalSavedBytes - ? ((double)totalSavedBytes * 100) / - (double)(totalDataBytes + totalSavedBytes) - : 0.0; - dataLogF(" Total savings %12llu bytes (%5.2f%%)\n", totalSavedBytes, - percentSavings); - - unsigned totalOverhead = m_totalNumberStrings * sizeof(StringImpl); - double overheadPercent = (double)totalOverhead / (double)totalDataBytes * 100; - dataLogF(" StringImpl overheader: %8u (%5.2f%%)\n", totalOverhead, - overheadPercent); - - printLiveStringStats(); -} -#endif - -void* StringImpl::operator new(size_t size) { - ASSERT(size == sizeof(StringImpl)); - return partitionAllocGeneric(Partitions::getBufferPartition(), size); -} - -void StringImpl::operator delete(void* ptr) { - partitionFreeGeneric(Partitions::getBufferPartition(), ptr); -} - -inline StringImpl::~StringImpl() { - ASSERT(!isStatic()); - - STRING_STATS_REMOVE_STRING(this); - - if (isAtomic()) - AtomicString::remove(this); -} - -void StringImpl::destroyIfNotStatic() { - if (!isStatic()) - delete this; -} - -PassRefPtr StringImpl::createUninitialized(unsigned length, - LChar*& data) { - if (!length) { - data = 0; - return empty(); - } - - // Allocate a single buffer large enough to contain the StringImpl - // struct as well as the data which it contains. This removes one - // heap allocation from this call. - StringImpl* string = static_cast(partitionAllocGeneric( - Partitions::getBufferPartition(), allocationSize(length))); - - data = reinterpret_cast(string + 1); - return adoptRef(new (string) StringImpl(length, Force8BitConstructor)); -} - -PassRefPtr StringImpl::createUninitialized(unsigned length, - UChar*& data) { - if (!length) { - data = 0; - return empty(); - } - - // Allocate a single buffer large enough to contain the StringImpl - // struct as well as the data which it contains. This removes one - // heap allocation from this call. - StringImpl* string = static_cast(partitionAllocGeneric( - Partitions::getBufferPartition(), allocationSize(length))); - - data = reinterpret_cast(string + 1); - return adoptRef(new (string) StringImpl(length)); -} - -PassRefPtr StringImpl::reallocate( - PassRefPtr originalString, - unsigned length) { - ASSERT(originalString->hasOneRef()); - - if (!length) - return empty(); - - bool is8Bit = originalString->is8Bit(); - // Same as createUninitialized() except here we use realloc. - size_t size = - is8Bit ? allocationSize(length) : allocationSize(length); - originalString->~StringImpl(); - StringImpl* string = static_cast(partitionReallocGeneric( - Partitions::getBufferPartition(), originalString.leakRef(), size)); - if (is8Bit) - return adoptRef(new (string) StringImpl(length, Force8BitConstructor)); - return adoptRef(new (string) StringImpl(length)); -} - -static StaticStringsTable& staticStrings() { - DEFINE_STATIC_LOCAL(StaticStringsTable, staticStrings, ()); - return staticStrings; -} - -#if ENABLE(ASSERT) -static bool s_allowCreationOfStaticStrings = true; -#endif - -const StaticStringsTable& StringImpl::allStaticStrings() { - return staticStrings(); -} - -void StringImpl::freezeStaticStrings() { - ASSERT(isMainThread()); - -#if ENABLE(ASSERT) - s_allowCreationOfStaticStrings = false; -#endif -} - -unsigned StringImpl::m_highestStaticStringLength = 0; - -StringImpl* StringImpl::createStatic(const char* string, - unsigned length, - unsigned hash) { - ASSERT(s_allowCreationOfStaticStrings); - ASSERT(string); - ASSERT(length); - - StaticStringsTable::const_iterator it = staticStrings().find(hash); - if (it != staticStrings().end()) { - ASSERT(!memcmp(string, it->value + 1, length * sizeof(LChar))); - return it->value; - } - - // Allocate a single buffer large enough to contain the StringImpl - // struct as well as the data which it contains. This removes one - // heap allocation from this call. - RELEASE_ASSERT(length <= - ((std::numeric_limits::max() - sizeof(StringImpl)) / - sizeof(LChar))); - size_t size = sizeof(StringImpl) + length * sizeof(LChar); - - WTF_ANNOTATE_SCOPED_MEMORY_LEAK; - StringImpl* impl = static_cast( - partitionAllocGeneric(Partitions::getBufferPartition(), size)); - - LChar* data = reinterpret_cast(impl + 1); - impl = new (impl) StringImpl(length, hash, StaticString); - memcpy(data, string, length * sizeof(LChar)); -#if ENABLE(ASSERT) - impl->assertHashIsCorrect(); -#endif - - ASSERT(isMainThread()); - m_highestStaticStringLength = std::max(m_highestStaticStringLength, length); - staticStrings().add(hash, impl); - WTF_ANNOTATE_BENIGN_RACE(impl, - "Benign race on the reference counter of a static " - "string created by StringImpl::createStatic"); - - return impl; -} - -PassRefPtr StringImpl::create(const UChar* characters, - unsigned length) { - if (!characters || !length) - return empty(); - - UChar* data; - RefPtr string = createUninitialized(length, data); - memcpy(data, characters, length * sizeof(UChar)); - return string.release(); -} - -PassRefPtr StringImpl::create(const LChar* characters, - unsigned length) { - if (!characters || !length) - return empty(); - - LChar* data; - RefPtr string = createUninitialized(length, data); - memcpy(data, characters, length * sizeof(LChar)); - return string.release(); -} - -PassRefPtr StringImpl::create8BitIfPossible(const UChar* characters, - unsigned length) { - if (!characters || !length) - return empty(); - - LChar* data; - RefPtr string = createUninitialized(length, data); - - for (size_t i = 0; i < length; ++i) { - if (characters[i] & 0xff00) - return create(characters, length); - data[i] = static_cast(characters[i]); - } - - return string.release(); -} - -PassRefPtr StringImpl::create(const LChar* string) { - if (!string) - return empty(); - size_t length = strlen(reinterpret_cast(string)); - RELEASE_ASSERT(length <= numeric_limits::max()); - return create(string, length); -} - -bool StringImpl::containsOnlyWhitespace() { - // FIXME: The definition of whitespace here includes a number of characters - // that are not whitespace from the point of view of RenderText; I wonder if - // that's a problem in practice. - if (is8Bit()) { - for (unsigned i = 0; i < m_length; ++i) { - UChar c = characters8()[i]; - if (!isASCIISpace(c)) - return false; - } - - return true; - } - - for (unsigned i = 0; i < m_length; ++i) { - UChar c = characters16()[i]; - if (!isASCIISpace(c)) - return false; - } - return true; -} - -PassRefPtr StringImpl::substring(unsigned start, unsigned length) { - if (start >= m_length) - return empty(); - unsigned maxLength = m_length - start; - if (length >= maxLength) { - if (!start) - return this; - length = maxLength; - } - if (is8Bit()) - return create(characters8() + start, length); - - return create(characters16() + start, length); -} - -UChar32 StringImpl::characterStartingAt(unsigned i) { - if (is8Bit()) - return characters8()[i]; - if (U16_IS_SINGLE(characters16()[i])) - return characters16()[i]; - if (i + 1 < m_length && U16_IS_LEAD(characters16()[i]) && - U16_IS_TRAIL(characters16()[i + 1])) - return U16_GET_SUPPLEMENTARY(characters16()[i], characters16()[i + 1]); - return 0; -} - -PassRefPtr StringImpl::lower() { - // Note: This is a hot function in the Dromaeo benchmark, specifically the - // no-op code path up through the first 'return' statement. - - // First scan the string for uppercase and non-ASCII characters: - bool noUpper = true; - UChar ored = 0; - if (is8Bit()) { - const LChar* end = characters8() + m_length; - for (const LChar* chp = characters8(); chp != end; ++chp) { - if (UNLIKELY(isASCIIUpper(*chp))) - noUpper = false; - ored |= *chp; - } - // Nothing to do if the string is all ASCII with no uppercase. - if (noUpper && !(ored & ~0x7F)) - return this; - - RELEASE_ASSERT(m_length <= - static_cast(numeric_limits::max())); - int32_t length = m_length; - - LChar* data8; - RefPtr newImpl = createUninitialized(length, data8); - - if (!(ored & ~0x7F)) { - for (int32_t i = 0; i < length; ++i) - data8[i] = toASCIILower(characters8()[i]); - - return newImpl.release(); - } - - // Do a slower implementation for cases that include non-ASCII Latin-1 - // characters. - for (int32_t i = 0; i < length; ++i) - data8[i] = static_cast(Unicode::toLower(characters8()[i])); - - return newImpl.release(); - } - - const UChar* end = characters16() + m_length; - for (const UChar* chp = characters16(); chp != end; ++chp) { - if (UNLIKELY(isASCIIUpper(*chp))) - noUpper = false; - ored |= *chp; - } - // Nothing to do if the string is all ASCII with no uppercase. - if (noUpper && !(ored & ~0x7F)) - return this; - - RELEASE_ASSERT(m_length <= - static_cast(numeric_limits::max())); - int32_t length = m_length; - - if (!(ored & ~0x7F)) { - UChar* data16; - RefPtr newImpl = createUninitialized(m_length, data16); - - for (int32_t i = 0; i < length; ++i) { - UChar c = characters16()[i]; - data16[i] = toASCIILower(c); - } - return newImpl.release(); - } - - // Do a slower implementation for cases that include non-ASCII characters. - UChar* data16; - RefPtr newImpl = createUninitialized(m_length, data16); - - bool error; - int32_t realLength = - Unicode::toLower(data16, length, characters16(), m_length, &error); - if (!error && realLength == length) - return newImpl.release(); - - newImpl = createUninitialized(realLength, data16); - Unicode::toLower(data16, realLength, characters16(), m_length, &error); - if (error) - return this; - return newImpl.release(); -} - -PassRefPtr StringImpl::upper() { - // This function could be optimized for no-op cases the way lower() is, - // but in empirical testing, few actual calls to upper() are no-ops, so - // it wouldn't be worth the extra time for pre-scanning. - - RELEASE_ASSERT(m_length <= - static_cast(numeric_limits::max())); - int32_t length = m_length; - - if (is8Bit()) { - LChar* data8; - RefPtr newImpl = createUninitialized(m_length, data8); - - // Do a faster loop for the case where all the characters are ASCII. - LChar ored = 0; - for (int i = 0; i < length; ++i) { - LChar c = characters8()[i]; - ored |= c; - data8[i] = toASCIIUpper(c); - } - if (!(ored & ~0x7F)) - return newImpl.release(); - - // Do a slower implementation for cases that include non-ASCII Latin-1 - // characters. - int numberSharpSCharacters = 0; - - // There are two special cases. - // 1. latin-1 characters when converted to upper case are 16 bit - // characters. - // 2. Lower case sharp-S converts to "SS" (two characters) - for (int32_t i = 0; i < length; ++i) { - LChar c = characters8()[i]; - if (UNLIKELY(c == smallLetterSharpS)) - ++numberSharpSCharacters; - UChar upper = Unicode::toUpper(c); - if (UNLIKELY(upper > 0xff)) { - // Since this upper-cased character does not fit in an 8-bit string, we - // need to take the 16-bit path. - goto upconvert; - } - data8[i] = static_cast(upper); - } - - if (!numberSharpSCharacters) - return newImpl.release(); - - // We have numberSSCharacters sharp-s characters, but none of the other - // special characters. - newImpl = createUninitialized(m_length + numberSharpSCharacters, data8); - - LChar* dest = data8; - - for (int32_t i = 0; i < length; ++i) { - LChar c = characters8()[i]; - if (c == smallLetterSharpS) { - *dest++ = 'S'; - *dest++ = 'S'; - } else - *dest++ = static_cast(Unicode::toUpper(c)); - } - - return newImpl.release(); - } - -upconvert: - RefPtr upconverted = upconvertedString(); - const UChar* source16 = upconverted->characters16(); - - UChar* data16; - RefPtr newImpl = createUninitialized(m_length, data16); - - // Do a faster loop for the case where all the characters are ASCII. - UChar ored = 0; - for (int i = 0; i < length; ++i) { - UChar c = source16[i]; - ored |= c; - data16[i] = toASCIIUpper(c); - } - if (!(ored & ~0x7F)) - return newImpl.release(); - - // Do a slower implementation for cases that include non-ASCII characters. - bool error; - int32_t realLength = - Unicode::toUpper(data16, length, source16, m_length, &error); - if (!error && realLength == length) - return newImpl; - newImpl = createUninitialized(realLength, data16); - Unicode::toUpper(data16, realLength, source16, m_length, &error); - if (error) - return this; - return newImpl.release(); -} - -static bool inline localeIdMatchesLang(const AtomicString& localeId, - const char* lang) { - if (equalIgnoringCase(localeId, lang)) - return true; - static char localeIdPrefix[4]; - static const char delimeter[4] = "-_@"; - - size_t langLength = strlen(lang); - RELEASE_ASSERT(langLength >= 2 && langLength <= 3); - strncpy(localeIdPrefix, lang, langLength); - for (int i = 0; i < 3; ++i) { - localeIdPrefix[langLength] = delimeter[i]; - // case-insensitive comparison - if (localeId.impl() && - localeId.impl()->startsWith(localeIdPrefix, langLength + 1, false)) - return true; - } - return false; -} - -typedef int32_t (*icuCaseConverter)(UChar*, - int32_t, - const UChar*, - int32_t, - const char*, - UErrorCode*); - -static PassRefPtr caseConvert(const UChar* source16, - size_t length, - icuCaseConverter converter, - const char* locale, - StringImpl* originalString) { - UChar* data16; - int32_t targetLength = length; - RefPtr output = StringImpl::createUninitialized(length, data16); - do { - UErrorCode status = U_ZERO_ERROR; - targetLength = - converter(data16, targetLength, source16, length, locale, &status); - if (U_SUCCESS(status)) { - output->truncateAssumingIsolated(targetLength); - return output.release(); - } - if (status != U_BUFFER_OVERFLOW_ERROR) - return originalString; - // Expand the buffer. - output = StringImpl::createUninitialized(targetLength, data16); - } while (true); -} - -PassRefPtr StringImpl::lower(const AtomicString& localeIdentifier) { - // Use the more-optimized code path most of the time. - // Only Turkic (tr and az) languages and Lithuanian requires - // locale-specific lowercasing rules. Even though CLDR has el-Lower, - // it's identical to the locale-agnostic lowercasing. Context-dependent - // handling of Greek capital sigma is built into the common lowercasing - // function in ICU. - const char* localeForConversion = 0; - if (localeIdMatchesLang(localeIdentifier, "tr") || - localeIdMatchesLang(localeIdentifier, "az")) - localeForConversion = "tr"; - else if (localeIdMatchesLang(localeIdentifier, "lt")) - localeForConversion = "lt"; - else - return lower(); - - if (m_length > static_cast(numeric_limits::max())) - CRASH(); - int length = m_length; - - RefPtr upconverted = upconvertedString(); - const UChar* source16 = upconverted->characters16(); - return caseConvert(source16, length, u_strToLower, localeForConversion, this); -} - -PassRefPtr StringImpl::upper(const AtomicString& localeIdentifier) { - // Use the more-optimized code path most of the time. - // Only Turkic (tr and az) languages and Greek require locale-specific - // lowercasing rules. - icu::UnicodeString transliteratorId; - const char* localeForConversion = 0; - if (localeIdMatchesLang(localeIdentifier, "tr") || - localeIdMatchesLang(localeIdentifier, "az")) - localeForConversion = "tr"; - else if (localeIdMatchesLang(localeIdentifier, "el")) - transliteratorId = UNICODE_STRING_SIMPLE("el-Upper"); - else if (localeIdMatchesLang(localeIdentifier, "lt")) - localeForConversion = "lt"; - else - return upper(); - - if (m_length > static_cast(numeric_limits::max())) - CRASH(); - int length = m_length; - - RefPtr upconverted = upconvertedString(); - const UChar* source16 = upconverted->characters16(); - - if (localeForConversion) - return caseConvert(source16, length, u_strToUpper, localeForConversion, - this); - - // TODO(jungshik): Cache transliterator if perf penaly warrants it for Greek. - UErrorCode status = U_ZERO_ERROR; - OwnPtr translit = - adoptPtr(icu::Transliterator::createInstance(transliteratorId, - UTRANS_FORWARD, status)); - if (U_FAILURE(status)) - return upper(); - - // target will be copy-on-write. - icu::UnicodeString target(false, source16, length); - translit->transliterate(target); - - return create(reinterpret_cast(target.getBuffer()), - target.length()); -} - -PassRefPtr StringImpl::fill(UChar character) { - if (!(character & ~0x7F)) { - LChar* data; - RefPtr newImpl = createUninitialized(m_length, data); - for (unsigned i = 0; i < m_length; ++i) - data[i] = character; - return newImpl.release(); - } - UChar* data; - RefPtr newImpl = createUninitialized(m_length, data); - for (unsigned i = 0; i < m_length; ++i) - data[i] = character; - return newImpl.release(); -} - -PassRefPtr StringImpl::foldCase() { - RELEASE_ASSERT(m_length <= - static_cast(numeric_limits::max())); - int32_t length = m_length; - - if (is8Bit()) { - // Do a faster loop for the case where all the characters are ASCII. - LChar* data; - RefPtr newImpl = createUninitialized(m_length, data); - LChar ored = 0; - - for (int32_t i = 0; i < length; ++i) { - LChar c = characters8()[i]; - data[i] = toASCIILower(c); - ored |= c; - } - - if (!(ored & ~0x7F)) - return newImpl.release(); - - // Do a slower implementation for cases that include non-ASCII Latin-1 - // characters. - for (int32_t i = 0; i < length; ++i) - data[i] = static_cast(Unicode::toLower(characters8()[i])); - - return newImpl.release(); - } - - // Do a faster loop for the case where all the characters are ASCII. - UChar* data; - RefPtr newImpl = createUninitialized(m_length, data); - UChar ored = 0; - for (int32_t i = 0; i < length; ++i) { - UChar c = characters16()[i]; - ored |= c; - data[i] = toASCIILower(c); - } - if (!(ored & ~0x7F)) - return newImpl.release(); - - // Do a slower implementation for cases that include non-ASCII characters. - bool error; - int32_t realLength = - Unicode::foldCase(data, length, characters16(), m_length, &error); - if (!error && realLength == length) - return newImpl.release(); - newImpl = createUninitialized(realLength, data); - Unicode::foldCase(data, realLength, characters16(), m_length, &error); - if (error) - return this; - return newImpl.release(); -} - -template -inline PassRefPtr StringImpl::stripMatchedCharacters( - UCharPredicate predicate) { - if (!m_length) - return empty(); - - unsigned start = 0; - unsigned end = m_length - 1; - - // skip white space from start - while (start <= end && - predicate(is8Bit() ? characters8()[start] : characters16()[start])) - ++start; - - // only white space - if (start > end) - return empty(); - - // skip white space from end - while (end && predicate(is8Bit() ? characters8()[end] : characters16()[end])) - --end; - - if (!start && end == m_length - 1) - return this; - if (is8Bit()) - return create(characters8() + start, end + 1 - start); - return create(characters16() + start, end + 1 - start); -} - -class UCharPredicate { - public: - inline UCharPredicate(CharacterMatchFunctionPtr function) - : m_function(function) {} - - inline bool operator()(UChar ch) const { return m_function(ch); } - - private: - const CharacterMatchFunctionPtr m_function; -}; - -class SpaceOrNewlinePredicate { - public: - inline bool operator()(UChar ch) const { return isSpaceOrNewline(ch); } -}; - -PassRefPtr StringImpl::stripWhiteSpace() { - return stripMatchedCharacters(SpaceOrNewlinePredicate()); -} - -PassRefPtr StringImpl::stripWhiteSpace( - IsWhiteSpaceFunctionPtr isWhiteSpace) { - return stripMatchedCharacters(UCharPredicate(isWhiteSpace)); -} - -template -ALWAYS_INLINE PassRefPtr StringImpl::removeCharacters( - const CharType* characters, - CharacterMatchFunctionPtr findMatch) { - const CharType* from = characters; - const CharType* fromend = from + m_length; - - // Assume the common case will not remove any characters - while (from != fromend && !findMatch(*from)) - ++from; - if (from == fromend) - return this; - - StringBuffer data(m_length); - CharType* to = data.characters(); - unsigned outc = from - characters; - - if (outc) - memcpy(to, characters, outc * sizeof(CharType)); - - while (true) { - while (from != fromend && findMatch(*from)) - ++from; - while (from != fromend && !findMatch(*from)) - to[outc++] = *from++; - if (from == fromend) - break; - } - - data.shrink(outc); - - return data.release(); -} - -PassRefPtr StringImpl::removeCharacters( - CharacterMatchFunctionPtr findMatch) { - if (is8Bit()) - return removeCharacters(characters8(), findMatch); - return removeCharacters(characters16(), findMatch); -} - -template -inline PassRefPtr StringImpl::simplifyMatchedCharactersToSpace( - UCharPredicate predicate, - StripBehavior stripBehavior) { - StringBuffer data(m_length); - - const CharType* from = getCharacters(); - const CharType* fromend = from + m_length; - int outc = 0; - bool changedToSpace = false; - - CharType* to = data.characters(); - - if (stripBehavior == StripExtraWhiteSpace) { - while (true) { - while (from != fromend && predicate(*from)) { - if (*from != ' ') - changedToSpace = true; - ++from; - } - while (from != fromend && !predicate(*from)) - to[outc++] = *from++; - if (from != fromend) - to[outc++] = ' '; - else - break; - } - - if (outc > 0 && to[outc - 1] == ' ') - --outc; - } else { - for (; from != fromend; ++from) { - if (predicate(*from)) { - if (*from != ' ') - changedToSpace = true; - to[outc++] = ' '; - } else { - to[outc++] = *from; - } - } - } - - if (static_cast(outc) == m_length && !changedToSpace) - return this; - - data.shrink(outc); - - return data.release(); -} - -PassRefPtr StringImpl::simplifyWhiteSpace( - StripBehavior stripBehavior) { - if (is8Bit()) - return StringImpl::simplifyMatchedCharactersToSpace( - SpaceOrNewlinePredicate(), stripBehavior); - return StringImpl::simplifyMatchedCharactersToSpace( - SpaceOrNewlinePredicate(), stripBehavior); -} - -PassRefPtr StringImpl::simplifyWhiteSpace( - IsWhiteSpaceFunctionPtr isWhiteSpace, - StripBehavior stripBehavior) { - if (is8Bit()) - return StringImpl::simplifyMatchedCharactersToSpace( - UCharPredicate(isWhiteSpace), stripBehavior); - return StringImpl::simplifyMatchedCharactersToSpace( - UCharPredicate(isWhiteSpace), stripBehavior); -} - -int StringImpl::toIntStrict(bool* ok, int base) { - if (is8Bit()) - return charactersToIntStrict(characters8(), m_length, ok, base); - return charactersToIntStrict(characters16(), m_length, ok, base); -} - -unsigned StringImpl::toUIntStrict(bool* ok, int base) { - if (is8Bit()) - return charactersToUIntStrict(characters8(), m_length, ok, base); - return charactersToUIntStrict(characters16(), m_length, ok, base); -} - -int64_t StringImpl::toInt64Strict(bool* ok, int base) { - if (is8Bit()) - return charactersToInt64Strict(characters8(), m_length, ok, base); - return charactersToInt64Strict(characters16(), m_length, ok, base); -} - -uint64_t StringImpl::toUInt64Strict(bool* ok, int base) { - if (is8Bit()) - return charactersToUInt64Strict(characters8(), m_length, ok, base); - return charactersToUInt64Strict(characters16(), m_length, ok, base); -} - -intptr_t StringImpl::toIntPtrStrict(bool* ok, int base) { - if (is8Bit()) - return charactersToIntPtrStrict(characters8(), m_length, ok, base); - return charactersToIntPtrStrict(characters16(), m_length, ok, base); -} - -int StringImpl::toInt(bool* ok) { - if (is8Bit()) - return charactersToInt(characters8(), m_length, ok); - return charactersToInt(characters16(), m_length, ok); -} - -unsigned StringImpl::toUInt(bool* ok) { - if (is8Bit()) - return charactersToUInt(characters8(), m_length, ok); - return charactersToUInt(characters16(), m_length, ok); -} - -int64_t StringImpl::toInt64(bool* ok) { - if (is8Bit()) - return charactersToInt64(characters8(), m_length, ok); - return charactersToInt64(characters16(), m_length, ok); -} - -uint64_t StringImpl::toUInt64(bool* ok) { - if (is8Bit()) - return charactersToUInt64(characters8(), m_length, ok); - return charactersToUInt64(characters16(), m_length, ok); -} - -intptr_t StringImpl::toIntPtr(bool* ok) { - if (is8Bit()) - return charactersToIntPtr(characters8(), m_length, ok); - return charactersToIntPtr(characters16(), m_length, ok); -} - -double StringImpl::toDouble(bool* ok) { - if (is8Bit()) - return charactersToDouble(characters8(), m_length, ok); - return charactersToDouble(characters16(), m_length, ok); -} - -float StringImpl::toFloat(bool* ok) { - if (is8Bit()) - return charactersToFloat(characters8(), m_length, ok); - return charactersToFloat(characters16(), m_length, ok); -} - -bool equalIgnoringCase(const LChar* a, const LChar* b, unsigned length) { - while (length--) { - LChar bc = *b++; - if (foldCase(*a++) != foldCase(bc)) - return false; - } - return true; -} - -bool equalIgnoringCase(const UChar* a, const LChar* b, unsigned length) { - while (length--) { - LChar bc = *b++; - if (foldCase(*a++) != foldCase(bc)) - return false; - } - return true; -} - -size_t StringImpl::find(CharacterMatchFunctionPtr matchFunction, - unsigned start) { - if (is8Bit()) - return WTF::find(characters8(), m_length, matchFunction, start); - return WTF::find(characters16(), m_length, matchFunction, start); -} - -size_t StringImpl::find(const LChar* matchString, unsigned index) { - // Check for null or empty string to match against - if (!matchString) - return kNotFound; - size_t matchStringLength = strlen(reinterpret_cast(matchString)); - RELEASE_ASSERT(matchStringLength <= numeric_limits::max()); - unsigned matchLength = matchStringLength; - if (!matchLength) - return min(index, length()); - - // Optimization 1: fast case for strings of length 1. - if (matchLength == 1) - return WTF::find(characters16(), length(), *matchString, index); - - // Check index & matchLength are in range. - if (index > length()) - return kNotFound; - unsigned searchLength = length() - index; - if (matchLength > searchLength) - return kNotFound; - // delta is the number of additional times to test; delta == 0 means test only - // once. - unsigned delta = searchLength - matchLength; - - const UChar* searchCharacters = characters16() + index; - - // Optimization 2: keep a running hash of the strings, - // only call equal if the hashes match. - unsigned searchHash = 0; - unsigned matchHash = 0; - for (unsigned i = 0; i < matchLength; ++i) { - searchHash += searchCharacters[i]; - matchHash += matchString[i]; - } - - unsigned i = 0; - // keep looping until we match - while (searchHash != matchHash || - !equal(searchCharacters + i, matchString, matchLength)) { - if (i == delta) - return kNotFound; - searchHash += searchCharacters[i + matchLength]; - searchHash -= searchCharacters[i]; - ++i; - } - return index + i; -} - -template -ALWAYS_INLINE size_t findIgnoringCaseInternal(const CharType* searchCharacters, - const LChar* matchString, - unsigned index, - unsigned searchLength, - unsigned matchLength) { - // delta is the number of additional times to test; delta == 0 means test only - // once. - unsigned delta = searchLength - matchLength; - - unsigned i = 0; - while (!equalIgnoringCase(searchCharacters + i, matchString, matchLength)) { - if (i == delta) - return kNotFound; - ++i; - } - return index + i; -} - -size_t StringImpl::findIgnoringCase(const LChar* matchString, unsigned index) { - // Check for null or empty string to match against - if (!matchString) - return kNotFound; - size_t matchStringLength = strlen(reinterpret_cast(matchString)); - RELEASE_ASSERT(matchStringLength <= numeric_limits::max()); - unsigned matchLength = matchStringLength; - if (!matchLength) - return min(index, length()); - - // Check index & matchLength are in range. - if (index > length()) - return kNotFound; - unsigned searchLength = length() - index; - if (matchLength > searchLength) - return kNotFound; - - if (is8Bit()) - return findIgnoringCaseInternal(characters8() + index, matchString, index, - searchLength, matchLength); - return findIgnoringCaseInternal(characters16() + index, matchString, index, - searchLength, matchLength); -} - -template -ALWAYS_INLINE static size_t findInternal( - const SearchCharacterType* searchCharacters, - const MatchCharacterType* matchCharacters, - unsigned index, - unsigned searchLength, - unsigned matchLength) { - // Optimization: keep a running hash of the strings, - // only call equal() if the hashes match. - - // delta is the number of additional times to test; delta == 0 means test only - // once. - unsigned delta = searchLength - matchLength; - - unsigned searchHash = 0; - unsigned matchHash = 0; - - for (unsigned i = 0; i < matchLength; ++i) { - searchHash += searchCharacters[i]; - matchHash += matchCharacters[i]; - } - - unsigned i = 0; - // keep looping until we match - while (searchHash != matchHash || - !equal(searchCharacters + i, matchCharacters, matchLength)) { - if (i == delta) - return kNotFound; - searchHash += searchCharacters[i + matchLength]; - searchHash -= searchCharacters[i]; - ++i; - } - return index + i; -} - -size_t StringImpl::find(StringImpl* matchString) { - // Check for null string to match against - if (UNLIKELY(!matchString)) - return kNotFound; - unsigned matchLength = matchString->length(); - - // Optimization 1: fast case for strings of length 1. - if (matchLength == 1) { - if (is8Bit()) { - if (matchString->is8Bit()) - return WTF::find(characters8(), length(), - matchString->characters8()[0]); - return WTF::find(characters8(), length(), matchString->characters16()[0]); - } - if (matchString->is8Bit()) - return WTF::find(characters16(), length(), matchString->characters8()[0]); - return WTF::find(characters16(), length(), matchString->characters16()[0]); - } - - // Check matchLength is in range. - if (matchLength > length()) - return kNotFound; - - // Check for empty string to match against - if (UNLIKELY(!matchLength)) - return 0; - - if (is8Bit()) { - if (matchString->is8Bit()) - return findInternal(characters8(), matchString->characters8(), 0, - length(), matchLength); - return findInternal(characters8(), matchString->characters16(), 0, length(), - matchLength); - } - - if (matchString->is8Bit()) - return findInternal(characters16(), matchString->characters8(), 0, length(), - matchLength); - - return findInternal(characters16(), matchString->characters16(), 0, length(), - matchLength); -} - -size_t StringImpl::find(StringImpl* matchString, unsigned index) { - // Check for null or empty string to match against - if (UNLIKELY(!matchString)) - return kNotFound; - - unsigned matchLength = matchString->length(); - - // Optimization 1: fast case for strings of length 1. - if (matchLength == 1) { - if (is8Bit()) - return WTF::find(characters8(), length(), (*matchString)[0], index); - return WTF::find(characters16(), length(), (*matchString)[0], index); - } - - if (UNLIKELY(!matchLength)) - return min(index, length()); - - // Check index & matchLength are in range. - if (index > length()) - return kNotFound; - unsigned searchLength = length() - index; - if (matchLength > searchLength) - return kNotFound; - - if (is8Bit()) { - if (matchString->is8Bit()) - return findInternal(characters8() + index, matchString->characters8(), - index, searchLength, matchLength); - return findInternal(characters8() + index, matchString->characters16(), - index, searchLength, matchLength); - } - - if (matchString->is8Bit()) - return findInternal(characters16() + index, matchString->characters8(), - index, searchLength, matchLength); - - return findInternal(characters16() + index, matchString->characters16(), - index, searchLength, matchLength); -} - -template -ALWAYS_INLINE static size_t findIgnoringCaseInner( - const SearchCharacterType* searchCharacters, - const MatchCharacterType* matchCharacters, - unsigned index, - unsigned searchLength, - unsigned matchLength) { - // delta is the number of additional times to test; delta == 0 means test only - // once. - unsigned delta = searchLength - matchLength; - - unsigned i = 0; - // keep looping until we match - while ( - !equalIgnoringCase(searchCharacters + i, matchCharacters, matchLength)) { - if (i == delta) - return kNotFound; - ++i; - } - return index + i; -} - -size_t StringImpl::findIgnoringCase(StringImpl* matchString, unsigned index) { - // Check for null or empty string to match against - if (!matchString) - return kNotFound; - unsigned matchLength = matchString->length(); - if (!matchLength) - return min(index, length()); - - // Check index & matchLength are in range. - if (index > length()) - return kNotFound; - unsigned searchLength = length() - index; - if (matchLength > searchLength) - return kNotFound; - - if (is8Bit()) { - if (matchString->is8Bit()) - return findIgnoringCaseInner(characters8() + index, - matchString->characters8(), index, - searchLength, matchLength); - return findIgnoringCaseInner(characters8() + index, - matchString->characters16(), index, - searchLength, matchLength); - } - - if (matchString->is8Bit()) - return findIgnoringCaseInner(characters16() + index, - matchString->characters8(), index, - searchLength, matchLength); - - return findIgnoringCaseInner(characters16() + index, - matchString->characters16(), index, searchLength, - matchLength); -} - -size_t StringImpl::findNextLineStart(unsigned index) { - if (is8Bit()) - return WTF::findNextLineStart(characters8(), m_length, index); - return WTF::findNextLineStart(characters16(), m_length, index); -} - -size_t StringImpl::count(LChar c) const { - int count = 0; - if (is8Bit()) { - for (size_t i = 0; i < m_length; ++i) - count += characters8()[i] == c; - } else { - for (size_t i = 0; i < m_length; ++i) - count += characters16()[i] == c; - } - return count; -} - -size_t StringImpl::reverseFind(UChar c, unsigned index) { - if (is8Bit()) - return WTF::reverseFind(characters8(), m_length, c, index); - return WTF::reverseFind(characters16(), m_length, c, index); -} - -template -ALWAYS_INLINE static size_t reverseFindInner( - const SearchCharacterType* searchCharacters, - const MatchCharacterType* matchCharacters, - unsigned index, - unsigned length, - unsigned matchLength) { - // Optimization: keep a running hash of the strings, - // only call equal if the hashes match. - - // delta is the number of additional times to test; delta == 0 means test only - // once. - unsigned delta = min(index, length - matchLength); - - unsigned searchHash = 0; - unsigned matchHash = 0; - for (unsigned i = 0; i < matchLength; ++i) { - searchHash += searchCharacters[delta + i]; - matchHash += matchCharacters[i]; - } - - // keep looping until we match - while (searchHash != matchHash || - !equal(searchCharacters + delta, matchCharacters, matchLength)) { - if (!delta) - return kNotFound; - --delta; - searchHash -= searchCharacters[delta + matchLength]; - searchHash += searchCharacters[delta]; - } - return delta; -} - -size_t StringImpl::reverseFind(StringImpl* matchString, unsigned index) { - // Check for null or empty string to match against - if (!matchString) - return kNotFound; - unsigned matchLength = matchString->length(); - unsigned ourLength = length(); - if (!matchLength) - return min(index, ourLength); - - // Optimization 1: fast case for strings of length 1. - if (matchLength == 1) { - if (is8Bit()) - return WTF::reverseFind(characters8(), ourLength, (*matchString)[0], - index); - return WTF::reverseFind(characters16(), ourLength, (*matchString)[0], - index); - } - - // Check index & matchLength are in range. - if (matchLength > ourLength) - return kNotFound; - - if (is8Bit()) { - if (matchString->is8Bit()) - return reverseFindInner(characters8(), matchString->characters8(), index, - ourLength, matchLength); - return reverseFindInner(characters8(), matchString->characters16(), index, - ourLength, matchLength); - } - - if (matchString->is8Bit()) - return reverseFindInner(characters16(), matchString->characters8(), index, - ourLength, matchLength); - - return reverseFindInner(characters16(), matchString->characters16(), index, - ourLength, matchLength); -} - -template -ALWAYS_INLINE static size_t reverseFindIgnoringCaseInner( - const SearchCharacterType* searchCharacters, - const MatchCharacterType* matchCharacters, - unsigned index, - unsigned length, - unsigned matchLength) { - // delta is the number of additional times to test; delta == 0 means test only - // once. - unsigned delta = min(index, length - matchLength); - - // keep looping until we match - while (!equalIgnoringCase(searchCharacters + delta, matchCharacters, - matchLength)) { - if (!delta) - return kNotFound; - --delta; - } - return delta; -} - -size_t StringImpl::reverseFindIgnoringCase(StringImpl* matchString, - unsigned index) { - // Check for null or empty string to match against - if (!matchString) - return kNotFound; - unsigned matchLength = matchString->length(); - unsigned ourLength = length(); - if (!matchLength) - return min(index, ourLength); - - // Check index & matchLength are in range. - if (matchLength > ourLength) - return kNotFound; - - if (is8Bit()) { - if (matchString->is8Bit()) - return reverseFindIgnoringCaseInner(characters8(), - matchString->characters8(), index, - ourLength, matchLength); - return reverseFindIgnoringCaseInner(characters8(), - matchString->characters16(), index, - ourLength, matchLength); - } - - if (matchString->is8Bit()) - return reverseFindIgnoringCaseInner(characters16(), - matchString->characters8(), index, - ourLength, matchLength); - - return reverseFindIgnoringCaseInner(characters16(), - matchString->characters16(), index, - ourLength, matchLength); -} - -ALWAYS_INLINE static bool equalInner(const StringImpl* stringImpl, - unsigned startOffset, - const char* matchString, - unsigned matchLength, - bool caseSensitive) { - ASSERT(stringImpl); - ASSERT(matchLength <= stringImpl->length()); - ASSERT(startOffset + matchLength <= stringImpl->length()); - - if (caseSensitive) { - if (stringImpl->is8Bit()) - return equal(stringImpl->characters8() + startOffset, - reinterpret_cast(matchString), matchLength); - return equal(stringImpl->characters16() + startOffset, - reinterpret_cast(matchString), matchLength); - } - if (stringImpl->is8Bit()) - return equalIgnoringCase(stringImpl->characters8() + startOffset, - reinterpret_cast(matchString), - matchLength); - return equalIgnoringCase(stringImpl->characters16() + startOffset, - reinterpret_cast(matchString), - matchLength); -} - -bool StringImpl::startsWith(UChar character) const { - return m_length && (*this)[0] == character; -} - -bool StringImpl::startsWith(const char* matchString, - unsigned matchLength, - bool caseSensitive) const { - ASSERT(matchLength); - if (matchLength > length()) - return false; - return equalInner(this, 0, matchString, matchLength, caseSensitive); -} - -bool StringImpl::endsWith(StringImpl* matchString, bool caseSensitive) { - ASSERT(matchString); - if (m_length >= matchString->m_length) { - unsigned start = m_length - matchString->m_length; - return (caseSensitive ? find(matchString, start) - : findIgnoringCase(matchString, start)) == start; - } - return false; -} - -bool StringImpl::endsWith(UChar character) const { - return m_length && (*this)[m_length - 1] == character; -} - -bool StringImpl::endsWith(const char* matchString, - unsigned matchLength, - bool caseSensitive) const { - ASSERT(matchLength); - if (matchLength > length()) - return false; - unsigned startOffset = length() - matchLength; - return equalInner(this, startOffset, matchString, matchLength, caseSensitive); -} - -PassRefPtr StringImpl::replace(UChar oldC, UChar newC) { - if (oldC == newC) - return this; - - if (find(oldC) == kNotFound) - return this; - - unsigned i; - if (is8Bit()) { - if (newC <= 0xff) { - LChar* data; - LChar oldChar = static_cast(oldC); - LChar newChar = static_cast(newC); - - RefPtr newImpl = createUninitialized(m_length, data); - - for (i = 0; i != m_length; ++i) { - LChar ch = characters8()[i]; - if (ch == oldChar) - ch = newChar; - data[i] = ch; - } - return newImpl.release(); - } - - // There is the possibility we need to up convert from 8 to 16 bit, - // create a 16 bit string for the result. - UChar* data; - RefPtr newImpl = createUninitialized(m_length, data); - - for (i = 0; i != m_length; ++i) { - UChar ch = characters8()[i]; - if (ch == oldC) - ch = newC; - data[i] = ch; - } - - return newImpl.release(); - } - - UChar* data; - RefPtr newImpl = createUninitialized(m_length, data); - - for (i = 0; i != m_length; ++i) { - UChar ch = characters16()[i]; - if (ch == oldC) - ch = newC; - data[i] = ch; - } - return newImpl.release(); -} - -PassRefPtr StringImpl::replace(unsigned position, - unsigned lengthToReplace, - StringImpl* str) { - position = min(position, length()); - lengthToReplace = min(lengthToReplace, length() - position); - unsigned lengthToInsert = str ? str->length() : 0; - if (!lengthToReplace && !lengthToInsert) - return this; - - RELEASE_ASSERT((length() - lengthToReplace) < - (numeric_limits::max() - lengthToInsert)); - - if (is8Bit() && (!str || str->is8Bit())) { - LChar* data; - RefPtr newImpl = - createUninitialized(length() - lengthToReplace + lengthToInsert, data); - memcpy(data, characters8(), position * sizeof(LChar)); - if (str) - memcpy(data + position, str->characters8(), - lengthToInsert * sizeof(LChar)); - memcpy(data + position + lengthToInsert, - characters8() + position + lengthToReplace, - (length() - position - lengthToReplace) * sizeof(LChar)); - return newImpl.release(); - } - UChar* data; - RefPtr newImpl = - createUninitialized(length() - lengthToReplace + lengthToInsert, data); - if (is8Bit()) - for (unsigned i = 0; i < position; ++i) - data[i] = characters8()[i]; - else - memcpy(data, characters16(), position * sizeof(UChar)); - if (str) { - if (str->is8Bit()) - for (unsigned i = 0; i < lengthToInsert; ++i) - data[i + position] = str->characters8()[i]; - else - memcpy(data + position, str->characters16(), - lengthToInsert * sizeof(UChar)); - } - if (is8Bit()) { - for (unsigned i = 0; i < length() - position - lengthToReplace; ++i) - data[i + position + lengthToInsert] = - characters8()[i + position + lengthToReplace]; - } else { - memcpy(data + position + lengthToInsert, - characters16() + position + lengthToReplace, - (length() - position - lengthToReplace) * sizeof(UChar)); - } - return newImpl.release(); -} - -PassRefPtr StringImpl::replace(UChar pattern, - StringImpl* replacement) { - if (!replacement) - return this; - - if (replacement->is8Bit()) - return replace(pattern, replacement->characters8(), replacement->length()); - - return replace(pattern, replacement->characters16(), replacement->length()); -} - -PassRefPtr StringImpl::replace(UChar pattern, - const LChar* replacement, - unsigned repStrLength) { - ASSERT(replacement); - - size_t srcSegmentStart = 0; - unsigned matchCount = 0; - - // Count the matches. - while ((srcSegmentStart = find(pattern, srcSegmentStart)) != kNotFound) { - ++matchCount; - ++srcSegmentStart; - } - - // If we have 0 matches then we don't have to do any more work. - if (!matchCount) - return this; - - RELEASE_ASSERT(!repStrLength || - matchCount <= numeric_limits::max() / repStrLength); - - unsigned replaceSize = matchCount * repStrLength; - unsigned newSize = m_length - matchCount; - RELEASE_ASSERT(newSize < (numeric_limits::max() - replaceSize)); - - newSize += replaceSize; - - // Construct the new data. - size_t srcSegmentEnd; - unsigned srcSegmentLength; - srcSegmentStart = 0; - unsigned dstOffset = 0; - - if (is8Bit()) { - LChar* data; - RefPtr newImpl = createUninitialized(newSize, data); - - while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != kNotFound) { - srcSegmentLength = srcSegmentEnd - srcSegmentStart; - memcpy(data + dstOffset, characters8() + srcSegmentStart, - srcSegmentLength * sizeof(LChar)); - dstOffset += srcSegmentLength; - memcpy(data + dstOffset, replacement, repStrLength * sizeof(LChar)); - dstOffset += repStrLength; - srcSegmentStart = srcSegmentEnd + 1; - } - - srcSegmentLength = m_length - srcSegmentStart; - memcpy(data + dstOffset, characters8() + srcSegmentStart, - srcSegmentLength * sizeof(LChar)); - - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); - - return newImpl.release(); - } - - UChar* data; - RefPtr newImpl = createUninitialized(newSize, data); - - while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != kNotFound) { - srcSegmentLength = srcSegmentEnd - srcSegmentStart; - memcpy(data + dstOffset, characters16() + srcSegmentStart, - srcSegmentLength * sizeof(UChar)); - - dstOffset += srcSegmentLength; - for (unsigned i = 0; i < repStrLength; ++i) - data[i + dstOffset] = replacement[i]; - - dstOffset += repStrLength; - srcSegmentStart = srcSegmentEnd + 1; - } - - srcSegmentLength = m_length - srcSegmentStart; - memcpy(data + dstOffset, characters16() + srcSegmentStart, - srcSegmentLength * sizeof(UChar)); - - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); - - return newImpl.release(); -} - -PassRefPtr StringImpl::replace(UChar pattern, - const UChar* replacement, - unsigned repStrLength) { - ASSERT(replacement); - - size_t srcSegmentStart = 0; - unsigned matchCount = 0; - - // Count the matches. - while ((srcSegmentStart = find(pattern, srcSegmentStart)) != kNotFound) { - ++matchCount; - ++srcSegmentStart; - } - - // If we have 0 matches then we don't have to do any more work. - if (!matchCount) - return this; - - RELEASE_ASSERT(!repStrLength || - matchCount <= numeric_limits::max() / repStrLength); - - unsigned replaceSize = matchCount * repStrLength; - unsigned newSize = m_length - matchCount; - RELEASE_ASSERT(newSize < (numeric_limits::max() - replaceSize)); - - newSize += replaceSize; - - // Construct the new data. - size_t srcSegmentEnd; - unsigned srcSegmentLength; - srcSegmentStart = 0; - unsigned dstOffset = 0; - - if (is8Bit()) { - UChar* data; - RefPtr newImpl = createUninitialized(newSize, data); - - while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != kNotFound) { - srcSegmentLength = srcSegmentEnd - srcSegmentStart; - for (unsigned i = 0; i < srcSegmentLength; ++i) - data[i + dstOffset] = characters8()[i + srcSegmentStart]; - - dstOffset += srcSegmentLength; - memcpy(data + dstOffset, replacement, repStrLength * sizeof(UChar)); - - dstOffset += repStrLength; - srcSegmentStart = srcSegmentEnd + 1; - } - - srcSegmentLength = m_length - srcSegmentStart; - for (unsigned i = 0; i < srcSegmentLength; ++i) - data[i + dstOffset] = characters8()[i + srcSegmentStart]; - - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); - - return newImpl.release(); - } - - UChar* data; - RefPtr newImpl = createUninitialized(newSize, data); - - while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != kNotFound) { - srcSegmentLength = srcSegmentEnd - srcSegmentStart; - memcpy(data + dstOffset, characters16() + srcSegmentStart, - srcSegmentLength * sizeof(UChar)); - - dstOffset += srcSegmentLength; - memcpy(data + dstOffset, replacement, repStrLength * sizeof(UChar)); - - dstOffset += repStrLength; - srcSegmentStart = srcSegmentEnd + 1; - } - - srcSegmentLength = m_length - srcSegmentStart; - memcpy(data + dstOffset, characters16() + srcSegmentStart, - srcSegmentLength * sizeof(UChar)); - - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); - - return newImpl.release(); -} - -PassRefPtr StringImpl::replace(StringImpl* pattern, - StringImpl* replacement) { - if (!pattern || !replacement) - return this; - - unsigned patternLength = pattern->length(); - if (!patternLength) - return this; - - unsigned repStrLength = replacement->length(); - size_t srcSegmentStart = 0; - unsigned matchCount = 0; - - // Count the matches. - while ((srcSegmentStart = find(pattern, srcSegmentStart)) != kNotFound) { - ++matchCount; - srcSegmentStart += patternLength; - } - - // If we have 0 matches, we don't have to do any more work - if (!matchCount) - return this; - - unsigned newSize = m_length - matchCount * patternLength; - RELEASE_ASSERT(!repStrLength || - matchCount <= numeric_limits::max() / repStrLength); - - RELEASE_ASSERT(newSize <= - (numeric_limits::max() - matchCount * repStrLength)); - - newSize += matchCount * repStrLength; - - // Construct the new data - size_t srcSegmentEnd; - unsigned srcSegmentLength; - srcSegmentStart = 0; - unsigned dstOffset = 0; - bool srcIs8Bit = is8Bit(); - bool replacementIs8Bit = replacement->is8Bit(); - - // There are 4 cases: - // 1. This and replacement are both 8 bit. - // 2. This and replacement are both 16 bit. - // 3. This is 8 bit and replacement is 16 bit. - // 4. This is 16 bit and replacement is 8 bit. - if (srcIs8Bit && replacementIs8Bit) { - // Case 1 - LChar* data; - RefPtr newImpl = createUninitialized(newSize, data); - while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != kNotFound) { - srcSegmentLength = srcSegmentEnd - srcSegmentStart; - memcpy(data + dstOffset, characters8() + srcSegmentStart, - srcSegmentLength * sizeof(LChar)); - dstOffset += srcSegmentLength; - memcpy(data + dstOffset, replacement->characters8(), - repStrLength * sizeof(LChar)); - dstOffset += repStrLength; - srcSegmentStart = srcSegmentEnd + patternLength; - } - - srcSegmentLength = m_length - srcSegmentStart; - memcpy(data + dstOffset, characters8() + srcSegmentStart, - srcSegmentLength * sizeof(LChar)); - - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); - - return newImpl.release(); - } - - UChar* data; - RefPtr newImpl = createUninitialized(newSize, data); - while ((srcSegmentEnd = find(pattern, srcSegmentStart)) != kNotFound) { - srcSegmentLength = srcSegmentEnd - srcSegmentStart; - if (srcIs8Bit) { - // Case 3. - for (unsigned i = 0; i < srcSegmentLength; ++i) - data[i + dstOffset] = characters8()[i + srcSegmentStart]; - } else { - // Case 2 & 4. - memcpy(data + dstOffset, characters16() + srcSegmentStart, - srcSegmentLength * sizeof(UChar)); - } - dstOffset += srcSegmentLength; - if (replacementIs8Bit) { - // Cases 2 & 3. - for (unsigned i = 0; i < repStrLength; ++i) - data[i + dstOffset] = replacement->characters8()[i]; - } else { - // Case 4 - memcpy(data + dstOffset, replacement->characters16(), - repStrLength * sizeof(UChar)); - } - dstOffset += repStrLength; - srcSegmentStart = srcSegmentEnd + patternLength; - } - - srcSegmentLength = m_length - srcSegmentStart; - if (srcIs8Bit) { - // Case 3. - for (unsigned i = 0; i < srcSegmentLength; ++i) - data[i + dstOffset] = characters8()[i + srcSegmentStart]; - } else { - // Cases 2 & 4. - memcpy(data + dstOffset, characters16() + srcSegmentStart, - srcSegmentLength * sizeof(UChar)); - } - - ASSERT(dstOffset + srcSegmentLength == newImpl->length()); - - return newImpl.release(); -} - -PassRefPtr StringImpl::upconvertedString() { - if (is8Bit()) - return String::make16BitFrom8BitSource(characters8(), m_length) - .releaseImpl(); - return this; -} - -static inline bool stringImplContentEqual(const StringImpl* a, - const StringImpl* b) { - unsigned aLength = a->length(); - unsigned bLength = b->length(); - if (aLength != bLength) - return false; - - if (a->is8Bit()) { - if (b->is8Bit()) - return equal(a->characters8(), b->characters8(), aLength); - - return equal(a->characters8(), b->characters16(), aLength); - } - - if (b->is8Bit()) - return equal(a->characters16(), b->characters8(), aLength); - - return equal(a->characters16(), b->characters16(), aLength); -} - -bool equal(const StringImpl* a, const StringImpl* b) { - if (a == b) - return true; - if (!a || !b) - return false; - if (a->isAtomic() && b->isAtomic()) - return false; - - return stringImplContentEqual(a, b); -} - -template -inline bool equalInternal(const StringImpl* a, - const CharType* b, - unsigned length) { - if (!a) - return !b; - if (!b) - return false; - - if (a->length() != length) - return false; - if (a->is8Bit()) - return equal(a->characters8(), b, length); - return equal(a->characters16(), b, length); -} - -bool equal(const StringImpl* a, const LChar* b, unsigned length) { - return equalInternal(a, b, length); -} - -bool equal(const StringImpl* a, const UChar* b, unsigned length) { - return equalInternal(a, b, length); -} - -bool equal(const StringImpl* a, const LChar* b) { - if (!a) - return !b; - if (!b) - return !a; - - unsigned length = a->length(); - - if (a->is8Bit()) { - const LChar* aPtr = a->characters8(); - for (unsigned i = 0; i != length; ++i) { - LChar bc = b[i]; - LChar ac = aPtr[i]; - if (!bc) - return false; - if (ac != bc) - return false; - } - - return !b[length]; - } - - const UChar* aPtr = a->characters16(); - for (unsigned i = 0; i != length; ++i) { - LChar bc = b[i]; - if (!bc) - return false; - if (aPtr[i] != bc) - return false; - } - - return !b[length]; -} - -bool equalNonNull(const StringImpl* a, const StringImpl* b) { - ASSERT(a && b); - if (a == b) - return true; - - return stringImplContentEqual(a, b); -} - -bool equalIgnoringCase(const StringImpl* a, const StringImpl* b) { - if (a == b) - return true; - if (!a || !b) - return false; - - return CaseFoldingHash::equal(a, b); -} - -bool equalIgnoringCase(const StringImpl* a, const LChar* b) { - if (!a) - return !b; - if (!b) - return !a; - - unsigned length = a->length(); - - // Do a faster loop for the case where all the characters are ASCII. - UChar ored = 0; - bool equal = true; - if (a->is8Bit()) { - const LChar* as = a->characters8(); - for (unsigned i = 0; i != length; ++i) { - LChar bc = b[i]; - if (!bc) - return false; - UChar ac = as[i]; - ored |= ac; - equal = equal && (toASCIILower(ac) == toASCIILower(bc)); - } - - // Do a slower implementation for cases that include non-ASCII characters. - if (ored & ~0x7F) { - equal = true; - for (unsigned i = 0; i != length; ++i) - equal = equal && (foldCase(as[i]) == foldCase(b[i])); - } - - return equal && !b[length]; - } - - const UChar* as = a->characters16(); - for (unsigned i = 0; i != length; ++i) { - LChar bc = b[i]; - if (!bc) - return false; - UChar ac = as[i]; - ored |= ac; - equal = equal && (toASCIILower(ac) == toASCIILower(bc)); - } - - // Do a slower implementation for cases that include non-ASCII characters. - if (ored & ~0x7F) { - equal = true; - for (unsigned i = 0; i != length; ++i) { - equal = equal && (foldCase(as[i]) == foldCase(b[i])); - } - } - - return equal && !b[length]; -} - -bool equalIgnoringCaseNonNull(const StringImpl* a, const StringImpl* b) { - ASSERT(a && b); - if (a == b) - return true; - - unsigned length = a->length(); - if (length != b->length()) - return false; - - if (a->is8Bit()) { - if (b->is8Bit()) - return equalIgnoringCase(a->characters8(), b->characters8(), length); - - return equalIgnoringCase(b->characters16(), a->characters8(), length); - } - - if (b->is8Bit()) - return equalIgnoringCase(a->characters16(), b->characters8(), length); - - return equalIgnoringCase(a->characters16(), b->characters16(), length); -} - -bool equalIgnoringNullity(StringImpl* a, StringImpl* b) { - if (!a && b && !b->length()) - return true; - if (!b && a && !a->length()) - return true; - return equal(a, b); -} - -size_t StringImpl::sizeInBytes() const { - size_t size = length(); - if (!is8Bit()) - size *= 2; - return size + sizeof(*this); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/StringImpl.h b/sky/engine/wtf/text/StringImpl.h deleted file mode 100644 index 1fa5f956cca82..0000000000000 --- a/sky/engine/wtf/text/StringImpl.h +++ /dev/null @@ -1,836 +0,0 @@ -/* - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. - * All rights reserved. - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_TEXT_STRINGIMPL_H_ -#define SKY_ENGINE_WTF_TEXT_STRINGIMPL_H_ - -#include -#include "flutter/sky/engine/wtf/ASCIICType.h" -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/StringHasher.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace WTF { - -struct AlreadyHashed; -struct CStringTranslator; -template -struct HashAndCharactersTranslator; -struct HashAndUTF8CharactersTranslator; -struct LCharBufferTranslator; -struct CharBufferFromLiteralDataTranslator; -struct SubstringTranslator; -struct UCharBufferTranslator; - -enum TextCaseSensitivity { TextCaseSensitive, TextCaseInsensitive }; - -enum StripBehavior { StripExtraWhiteSpace, DoNotStripWhiteSpace }; - -typedef bool (*CharacterMatchFunctionPtr)(UChar); -typedef bool (*IsWhiteSpaceFunctionPtr)(UChar); -typedef HashMap StaticStringsTable; - -// Define STRING_STATS to turn on run time statistics of string sizes and memory -// usage -#undef STRING_STATS - -#ifdef STRING_STATS -struct StringStats { - inline void add8BitString(unsigned length) { - ++m_totalNumberStrings; - ++m_number8BitStrings; - m_total8BitData += length; - } - - inline void add16BitString(unsigned length) { - ++m_totalNumberStrings; - ++m_number16BitStrings; - m_total16BitData += length; - } - - void removeString(StringImpl*); - void printStats(); - - static const unsigned s_printStringStatsFrequency = 5000; - static unsigned s_stringRemovesTillPrintStats; - - unsigned m_totalNumberStrings; - unsigned m_number8BitStrings; - unsigned m_number16BitStrings; - unsigned long long m_total8BitData; - unsigned long long m_total16BitData; -}; - -void addStringForStats(StringImpl*); -void removeStringForStats(StringImpl*); - -#define STRING_STATS_ADD_8BIT_STRING(length) \ - StringImpl::stringStats().add8BitString(length); \ - addStringForStats(this) -#define STRING_STATS_ADD_16BIT_STRING(length) \ - StringImpl::stringStats().add16BitString(length); \ - addStringForStats(this) -#define STRING_STATS_REMOVE_STRING(string) \ - StringImpl::stringStats().removeString(string); \ - removeStringForStats(this) -#else -#define STRING_STATS_ADD_8BIT_STRING(length) ((void)0) -#define STRING_STATS_ADD_16BIT_STRING(length) ((void)0) -#define STRING_STATS_REMOVE_STRING(string) ((void)0) -#endif - -// You can find documentation about this class in this doc: -// https://docs.google.com/document/d/1kOCUlJdh2WJMJGDf-WoEQhmnjKLaOYRbiHz5TiGJl14/edit?usp=sharing -class WTF_EXPORT StringImpl { - WTF_MAKE_NONCOPYABLE(StringImpl); - friend struct WTF::CStringTranslator; - template - friend struct WTF::HashAndCharactersTranslator; - friend struct WTF::HashAndUTF8CharactersTranslator; - friend struct WTF::CharBufferFromLiteralDataTranslator; - friend struct WTF::LCharBufferTranslator; - friend struct WTF::SubstringTranslator; - friend struct WTF::UCharBufferTranslator; - - private: - // StringImpls are allocated out of the WTF buffer partition. - void* operator new(size_t); - void* operator new(size_t, void* ptr) { return ptr; }; - void operator delete(void*); - - // Used to construct static strings, which have an special refCount that can - // never hit zero. This means that the static string will never be destroyed, - // which is important because static strings will be shared across threads & - // ref-counted in a non-threadsafe manner. - enum ConstructEmptyStringTag { ConstructEmptyString }; - explicit StringImpl(ConstructEmptyStringTag) - : m_refCount(1), - m_length(0), - m_hash(0), - m_isAtomic(false), - m_is8Bit(true), - m_isStatic(true) { - // Ensure that the hash is computed so that AtomicStringHash can call - // existingHash() with impunity. The empty string is special because it is - // never entered into AtomicString's HashKey, but still needs to compare - // correctly. - STRING_STATS_ADD_8BIT_STRING(m_length); - hash(); - } - - enum ConstructEmptyString16BitTag { ConstructEmptyString16Bit }; - explicit StringImpl(ConstructEmptyString16BitTag) - : m_refCount(1), - m_length(0), - m_hash(0), - m_isAtomic(false), - m_is8Bit(false), - m_isStatic(true) { - STRING_STATS_ADD_16BIT_STRING(m_length); - hash(); - } - - // FIXME: there has to be a less hacky way to do this. - enum Force8Bit { Force8BitConstructor }; - StringImpl(unsigned length, Force8Bit) - : m_refCount(1), - m_length(length), - m_hash(0), - m_isAtomic(false), - m_is8Bit(true), - m_isStatic(false) { - ASSERT(m_length); - STRING_STATS_ADD_8BIT_STRING(m_length); - } - - StringImpl(unsigned length) - : m_refCount(1), - m_length(length), - m_hash(0), - m_isAtomic(false), - m_is8Bit(false), - m_isStatic(false) { - ASSERT(m_length); - STRING_STATS_ADD_16BIT_STRING(m_length); - } - - enum StaticStringTag { StaticString }; - StringImpl(unsigned length, unsigned hash, StaticStringTag) - : m_refCount(1), - m_length(length), - m_hash(hash), - m_isAtomic(false), - m_is8Bit(true), - m_isStatic(true) {} - - public: - ~StringImpl(); - - static StringImpl* createStatic(const char* string, - unsigned length, - unsigned hash); - static void freezeStaticStrings(); - static const StaticStringsTable& allStaticStrings(); - static unsigned highestStaticStringLength() { - return m_highestStaticStringLength; - } - - static PassRefPtr create(const UChar*, unsigned length); - static PassRefPtr create(const LChar*, unsigned length); - static PassRefPtr create8BitIfPossible(const UChar*, - unsigned length); - template - static PassRefPtr create8BitIfPossible( - const Vector& vector) { - return create8BitIfPossible(vector.data(), vector.size()); - } - - ALWAYS_INLINE static PassRefPtr create(const char* s, - unsigned length) { - return create(reinterpret_cast(s), length); - } - static PassRefPtr create(const LChar*); - ALWAYS_INLINE static PassRefPtr create(const char* s) { - return create(reinterpret_cast(s)); - } - - static PassRefPtr createUninitialized(unsigned length, - LChar*& data); - static PassRefPtr createUninitialized(unsigned length, - UChar*& data); - - // Reallocate the StringImpl. The originalString must be only owned by the - // PassRefPtr. Just like the input pointer of realloc(), the originalString - // can't be used after this function. - static PassRefPtr reallocate( - PassRefPtr originalString, - unsigned length); - - // If this StringImpl has only one reference, we can truncate the string by - // updating its m_length property without actually re-allocating its buffer. - void truncateAssumingIsolated(unsigned length) { - ASSERT(hasOneRef()); - ASSERT(length <= m_length); - m_length = length; - } - - unsigned length() const { return m_length; } - bool is8Bit() const { return m_is8Bit; } - - ALWAYS_INLINE const LChar* characters8() const { - ASSERT(is8Bit()); - return reinterpret_cast(this + 1); - } - ALWAYS_INLINE const UChar* characters16() const { - ASSERT(!is8Bit()); - return reinterpret_cast(this + 1); - } - - template - ALWAYS_INLINE const CharType* getCharacters() const; - - size_t sizeInBytes() const; - - bool isAtomic() const { return m_isAtomic; } - void setIsAtomic(bool isAtomic) { m_isAtomic = isAtomic; } - - bool isStatic() const { return m_isStatic; } - - private: - // The high bits of 'hash' are always empty, but we prefer to store our flags - // in the low bits because it makes them slightly more efficient to access. - // So, we shift left and right when setting and getting our hash code. - void setHash(unsigned hash) const { - ASSERT(!hasHash()); - // Multiple clients assume that StringHasher is the canonical string hash - // function. - ASSERT(hash == (is8Bit() ? StringHasher::computeHashAndMaskTop8Bits( - characters8(), m_length) - : StringHasher::computeHashAndMaskTop8Bits( - characters16(), m_length))); - m_hash = hash; - ASSERT(hash); // Verify that 0 is a valid sentinel hash value. - } - - unsigned rawHash() const { return m_hash; } - - void destroyIfNotStatic(); - - public: - bool hasHash() const { return rawHash() != 0; } - - unsigned existingHash() const { - ASSERT(hasHash()); - return rawHash(); - } - - unsigned hash() const { - if (hasHash()) - return existingHash(); - return hashSlowCase(); - } - - ALWAYS_INLINE bool hasOneRef() const { return m_refCount == 1; } - - ALWAYS_INLINE void ref() { ++m_refCount; } - - ALWAYS_INLINE void deref() { - if (hasOneRef()) { - destroyIfNotStatic(); - return; - } - - --m_refCount; - } - - static StringImpl* empty(); - static StringImpl* empty16Bit(); - - // FIXME: Does this really belong in StringImpl? - template - static void copyChars(T* destination, - const T* source, - unsigned numCharacters) { - memcpy(destination, source, numCharacters * sizeof(T)); - } - - ALWAYS_INLINE static void copyChars(UChar* destination, - const LChar* source, - unsigned numCharacters) { - for (unsigned i = 0; i < numCharacters; ++i) - destination[i] = source[i]; - } - - // Some string features, like refcounting and the atomicity flag, are not - // thread-safe. We achieve thread safety by isolation, giving each thread - // its own copy of the string. - PassRefPtr isolatedCopy() const; - - PassRefPtr substring(unsigned pos, unsigned len = UINT_MAX); - - UChar operator[](unsigned i) const { - ASSERT_WITH_SECURITY_IMPLICATION(i < m_length); - if (is8Bit()) - return characters8()[i]; - return characters16()[i]; - } - UChar32 characterStartingAt(unsigned); - - bool containsOnlyWhitespace(); - - int toIntStrict(bool* ok = 0, int base = 10); - unsigned toUIntStrict(bool* ok = 0, int base = 10); - int64_t toInt64Strict(bool* ok = 0, int base = 10); - uint64_t toUInt64Strict(bool* ok = 0, int base = 10); - intptr_t toIntPtrStrict(bool* ok = 0, int base = 10); - - int toInt(bool* ok = 0); // ignores trailing garbage - unsigned toUInt(bool* ok = 0); // ignores trailing garbage - int64_t toInt64(bool* ok = 0); // ignores trailing garbage - uint64_t toUInt64(bool* ok = 0); // ignores trailing garbage - intptr_t toIntPtr(bool* ok = 0); // ignores trailing garbage - - // FIXME: Like the strict functions above, these give false for "ok" when - // there is trailing garbage. Like the non-strict functions above, these - // return the value when there is trailing garbage. It would be better if - // these were more consistent with the above functions instead. - double toDouble(bool* ok = 0); - float toFloat(bool* ok = 0); - - PassRefPtr lower(); - PassRefPtr upper(); - PassRefPtr lower(const AtomicString& localeIdentifier); - PassRefPtr upper(const AtomicString& localeIdentifier); - - PassRefPtr fill(UChar); - // FIXME: Do we need fill(char) or can we just do the right thing if UChar is - // ASCII? - PassRefPtr foldCase(); - - PassRefPtr stripWhiteSpace(); - PassRefPtr stripWhiteSpace(IsWhiteSpaceFunctionPtr); - PassRefPtr simplifyWhiteSpace( - StripBehavior stripBehavior = StripExtraWhiteSpace); - PassRefPtr simplifyWhiteSpace( - IsWhiteSpaceFunctionPtr, - StripBehavior stripBehavior = StripExtraWhiteSpace); - - PassRefPtr removeCharacters(CharacterMatchFunctionPtr); - template - ALWAYS_INLINE PassRefPtr removeCharacters( - const CharType* characters, - CharacterMatchFunctionPtr); - - size_t find(LChar character, unsigned start = 0); - size_t find(char character, unsigned start = 0); - size_t find(UChar character, unsigned start = 0); - size_t find(CharacterMatchFunctionPtr, unsigned index = 0); - size_t find(const LChar*, unsigned index = 0); - ALWAYS_INLINE size_t find(const char* s, unsigned index = 0) { - return find(reinterpret_cast(s), index); - } - size_t find(StringImpl*); - size_t find(StringImpl*, unsigned index); - size_t findIgnoringCase(const LChar*, unsigned index = 0); - ALWAYS_INLINE size_t findIgnoringCase(const char* s, unsigned index = 0) { - return findIgnoringCase(reinterpret_cast(s), index); - } - size_t findIgnoringCase(StringImpl*, unsigned index = 0); - - size_t findNextLineStart(unsigned index = UINT_MAX); - - size_t reverseFind(UChar, unsigned index = UINT_MAX); - size_t reverseFind(StringImpl*, unsigned index = UINT_MAX); - size_t reverseFindIgnoringCase(StringImpl*, unsigned index = UINT_MAX); - - size_t count(LChar) const; - - bool startsWith(StringImpl* str, bool caseSensitive = true) { - return (caseSensitive ? reverseFind(str, 0) - : reverseFindIgnoringCase(str, 0)) == 0; - } - bool startsWith(UChar) const; - bool startsWith(const char*, unsigned matchLength, bool caseSensitive) const; - template - bool startsWith(const char (&prefix)[matchLength], - bool caseSensitive = true) const { - return startsWith(prefix, matchLength - 1, caseSensitive); - } - - bool endsWith(StringImpl*, bool caseSensitive = true); - bool endsWith(UChar) const; - bool endsWith(const char*, unsigned matchLength, bool caseSensitive) const; - template - bool endsWith(const char (&prefix)[matchLength], - bool caseSensitive = true) const { - return endsWith(prefix, matchLength - 1, caseSensitive); - } - - PassRefPtr replace(UChar, UChar); - PassRefPtr replace(UChar, StringImpl*); - ALWAYS_INLINE PassRefPtr replace(UChar pattern, - const char* replacement, - unsigned replacementLength) { - return replace(pattern, reinterpret_cast(replacement), - replacementLength); - } - PassRefPtr replace(UChar, - const LChar*, - unsigned replacementLength); - PassRefPtr replace(UChar, - const UChar*, - unsigned replacementLength); - PassRefPtr replace(StringImpl*, StringImpl*); - PassRefPtr replace(unsigned index, unsigned len, StringImpl*); - PassRefPtr upconvertedString(); - -#ifdef STRING_STATS - ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; } -#endif - - private: - template - static size_t allocationSize(unsigned length) { - RELEASE_ASSERT( - length <= ((std::numeric_limits::max() - sizeof(StringImpl)) / - sizeof(CharType))); - return sizeof(StringImpl) + length * sizeof(CharType); - } - - template - PassRefPtr stripMatchedCharacters(UCharPredicate); - template - PassRefPtr simplifyMatchedCharactersToSpace(UCharPredicate, - StripBehavior); - NEVER_INLINE unsigned hashSlowCase() const; - -#ifdef STRING_STATS - static StringStats m_stringStats; -#endif - - static unsigned m_highestStaticStringLength; - -#if ENABLE(ASSERT) - void assertHashIsCorrect() { - ASSERT(hasHash()); - ASSERT(existingHash() == - StringHasher::computeHashAndMaskTop8Bits(characters8(), length())); - } -#endif - - private: - unsigned m_refCount; - unsigned m_length; - mutable unsigned m_hash : 24; - unsigned m_isAtomic : 1; - unsigned m_is8Bit : 1; - unsigned m_isStatic : 1; -}; - -template <> -ALWAYS_INLINE const LChar* StringImpl::getCharacters() const { - return characters8(); -} - -template <> -ALWAYS_INLINE const UChar* StringImpl::getCharacters() const { - return characters16(); -} - -WTF_EXPORT bool equal(const StringImpl*, const StringImpl*); -WTF_EXPORT bool equal(const StringImpl*, const LChar*); -inline bool equal(const StringImpl* a, const char* b) { - return equal(a, reinterpret_cast(b)); -} -WTF_EXPORT bool equal(const StringImpl*, const LChar*, unsigned); -WTF_EXPORT bool equal(const StringImpl*, const UChar*, unsigned); -inline bool equal(const StringImpl* a, const char* b, unsigned length) { - return equal(a, reinterpret_cast(b), length); -} -inline bool equal(const LChar* a, StringImpl* b) { - return equal(b, a); -} -inline bool equal(const char* a, StringImpl* b) { - return equal(b, reinterpret_cast(a)); -} -WTF_EXPORT bool equalNonNull(const StringImpl* a, const StringImpl* b); - -template -ALWAYS_INLINE bool equal(const CharType* a, - const CharType* b, - unsigned length) { - return !memcmp(a, b, length * sizeof(CharType)); -} - -ALWAYS_INLINE bool equal(const LChar* a, const UChar* b, unsigned length) { - for (unsigned i = 0; i < length; ++i) { - if (a[i] != b[i]) - return false; - } - return true; -} - -ALWAYS_INLINE bool equal(const UChar* a, const LChar* b, unsigned length) { - return equal(b, a, length); -} - -WTF_EXPORT bool equalIgnoringCase(const StringImpl*, const StringImpl*); -WTF_EXPORT bool equalIgnoringCase(const StringImpl*, const LChar*); -inline bool equalIgnoringCase(const LChar* a, const StringImpl* b) { - return equalIgnoringCase(b, a); -} -WTF_EXPORT bool equalIgnoringCase(const LChar*, const LChar*, unsigned); -WTF_EXPORT bool equalIgnoringCase(const UChar*, const LChar*, unsigned); -inline bool equalIgnoringCase(const UChar* a, const char* b, unsigned length) { - return equalIgnoringCase(a, reinterpret_cast(b), length); -} -inline bool equalIgnoringCase(const LChar* a, const UChar* b, unsigned length) { - return equalIgnoringCase(b, a, length); -} -inline bool equalIgnoringCase(const char* a, const UChar* b, unsigned length) { - return equalIgnoringCase(b, reinterpret_cast(a), length); -} -inline bool equalIgnoringCase(const char* a, const LChar* b, unsigned length) { - return equalIgnoringCase(b, reinterpret_cast(a), length); -} -inline bool equalIgnoringCase(const UChar* a, const UChar* b, int length) { - ASSERT(length >= 0); - return !Unicode::umemcasecmp(a, b, length); -} -WTF_EXPORT bool equalIgnoringCaseNonNull(const StringImpl*, const StringImpl*); - -WTF_EXPORT bool equalIgnoringNullity(StringImpl*, StringImpl*); - -template -inline size_t find(const CharacterType* characters, - unsigned length, - CharacterType matchCharacter, - unsigned index = 0) { - while (index < length) { - if (characters[index] == matchCharacter) - return index; - ++index; - } - return kNotFound; -} - -ALWAYS_INLINE size_t find(const UChar* characters, - unsigned length, - LChar matchCharacter, - unsigned index = 0) { - return find(characters, length, static_cast(matchCharacter), index); -} - -inline size_t find(const LChar* characters, - unsigned length, - UChar matchCharacter, - unsigned index = 0) { - if (matchCharacter & ~0xFF) - return kNotFound; - return find(characters, length, static_cast(matchCharacter), index); -} - -inline size_t find(const LChar* characters, - unsigned length, - CharacterMatchFunctionPtr matchFunction, - unsigned index = 0) { - while (index < length) { - if (matchFunction(characters[index])) - return index; - ++index; - } - return kNotFound; -} - -inline size_t find(const UChar* characters, - unsigned length, - CharacterMatchFunctionPtr matchFunction, - unsigned index = 0) { - while (index < length) { - if (matchFunction(characters[index])) - return index; - ++index; - } - return kNotFound; -} - -template -inline size_t findNextLineStart(const CharacterType* characters, - unsigned length, - unsigned index = 0) { - while (index < length) { - CharacterType c = characters[index++]; - if ((c != '\n') && (c != '\r')) - continue; - - // There can only be a start of a new line if there are more characters - // beyond the current character. - if (index < length) { - // The 3 common types of line terminators are 1. \r\n (Windows), - // 2. \r (old MacOS) and 3. \n (Unix'es). - - if (c == '\n') - return index; // Case 3: just \n. - - CharacterType c2 = characters[index]; - if (c2 != '\n') - return index; // Case 2: just \r. - - // Case 1: \r\n. - // But, there's only a start of a new line if there are more - // characters beyond the \r\n. - if (++index < length) - return index; - } - } - return kNotFound; -} - -template -inline size_t reverseFindLineTerminator(const CharacterType* characters, - unsigned length, - unsigned index = UINT_MAX) { - if (!length) - return kNotFound; - if (index >= length) - index = length - 1; - CharacterType c = characters[index]; - while ((c != '\n') && (c != '\r')) { - if (!index--) - return kNotFound; - c = characters[index]; - } - return index; -} - -template -inline size_t reverseFind(const CharacterType* characters, - unsigned length, - CharacterType matchCharacter, - unsigned index = UINT_MAX) { - if (!length) - return kNotFound; - if (index >= length) - index = length - 1; - while (characters[index] != matchCharacter) { - if (!index--) - return kNotFound; - } - return index; -} - -ALWAYS_INLINE size_t reverseFind(const UChar* characters, - unsigned length, - LChar matchCharacter, - unsigned index = UINT_MAX) { - return reverseFind(characters, length, static_cast(matchCharacter), - index); -} - -inline size_t reverseFind(const LChar* characters, - unsigned length, - UChar matchCharacter, - unsigned index = UINT_MAX) { - if (matchCharacter & ~0xFF) - return kNotFound; - return reverseFind(characters, length, static_cast(matchCharacter), - index); -} - -inline size_t StringImpl::find(LChar character, unsigned start) { - if (is8Bit()) - return WTF::find(characters8(), m_length, character, start); - return WTF::find(characters16(), m_length, character, start); -} - -ALWAYS_INLINE size_t StringImpl::find(char character, unsigned start) { - return find(static_cast(character), start); -} - -inline size_t StringImpl::find(UChar character, unsigned start) { - if (is8Bit()) - return WTF::find(characters8(), m_length, character, start); - return WTF::find(characters16(), m_length, character, start); -} - -inline unsigned lengthOfNullTerminatedString(const UChar* string) { - size_t length = 0; - while (string[length] != UChar(0)) - ++length; - RELEASE_ASSERT(length <= std::numeric_limits::max()); - return static_cast(length); -} - -template -bool equalIgnoringNullity(const Vector& a, - StringImpl* b) { - if (!b) - return !a.size(); - if (a.size() != b->length()) - return false; - if (b->is8Bit()) - return equal(a.data(), b->characters8(), b->length()); - return equal(a.data(), b->characters16(), b->length()); -} - -template -static inline int codePointCompare(unsigned l1, - unsigned l2, - const CharacterType1* c1, - const CharacterType2* c2) { - const unsigned lmin = l1 < l2 ? l1 : l2; - unsigned pos = 0; - while (pos < lmin && *c1 == *c2) { - ++c1; - ++c2; - ++pos; - } - - if (pos < lmin) - return (c1[0] > c2[0]) ? 1 : -1; - - if (l1 == l2) - return 0; - - return (l1 > l2) ? 1 : -1; -} - -static inline int codePointCompare8(const StringImpl* string1, - const StringImpl* string2) { - return codePointCompare(string1->length(), string2->length(), - string1->characters8(), string2->characters8()); -} - -static inline int codePointCompare16(const StringImpl* string1, - const StringImpl* string2) { - return codePointCompare(string1->length(), string2->length(), - string1->characters16(), string2->characters16()); -} - -static inline int codePointCompare8To16(const StringImpl* string1, - const StringImpl* string2) { - return codePointCompare(string1->length(), string2->length(), - string1->characters8(), string2->characters16()); -} - -static inline int codePointCompare(const StringImpl* string1, - const StringImpl* string2) { - if (!string1) - return (string2 && string2->length()) ? -1 : 0; - - if (!string2) - return string1->length() ? 1 : 0; - - bool string1Is8Bit = string1->is8Bit(); - bool string2Is8Bit = string2->is8Bit(); - if (string1Is8Bit) { - if (string2Is8Bit) - return codePointCompare8(string1, string2); - return codePointCompare8To16(string1, string2); - } - if (string2Is8Bit) - return -codePointCompare8To16(string2, string1); - return codePointCompare16(string1, string2); -} - -static inline bool isSpaceOrNewline(UChar c) { - // Use isASCIISpace() for basic Latin-1. - // This will include newlines, which aren't included in Unicode DirWS. - return c <= 0x7F - ? WTF::isASCIISpace(c) - : WTF::Unicode::direction(c) == WTF::Unicode::WhiteSpaceNeutral; -} - -inline PassRefPtr StringImpl::isolatedCopy() const { - if (is8Bit()) - return create(characters8(), m_length); - return create(characters16(), m_length); -} - -struct StringHash; - -// StringHash is the default hash for StringImpl* and RefPtr -template -struct DefaultHash; -template <> -struct DefaultHash { - typedef StringHash Hash; -}; -template <> -struct DefaultHash> { - typedef StringHash Hash; -}; - -} // namespace WTF - -using WTF::StringImpl; -using WTF::TextCaseInsensitive; -using WTF::TextCaseSensitive; -using WTF::TextCaseSensitivity; -using WTF::equal; -using WTF::equalNonNull; - -#endif // SKY_ENGINE_WTF_TEXT_STRINGIMPL_H_ diff --git a/sky/engine/wtf/text/StringImplTest.cpp b/sky/engine/wtf/text/StringImplTest.cpp deleted file mode 100644 index 45099248b5150..0000000000000 --- a/sky/engine/wtf/text/StringImplTest.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include "flutter/sky/engine/wtf/text/StringImpl.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace { - -TEST(WTF, StringImplCreate8Bit) { - RefPtr testStringImpl = StringImpl::create("1224"); - ASSERT_TRUE(testStringImpl->is8Bit()); -} - -} // namespace diff --git a/sky/engine/wtf/text/StringOperators.h b/sky/engine/wtf/text/StringOperators.h deleted file mode 100644 index 2fe9bf3cd4ac9..0000000000000 --- a/sky/engine/wtf/text/StringOperators.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. - * All rights reserved. - * Copyright (C) Research In Motion Limited 2011. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_TEXT_STRINGOPERATORS_H_ -#define SKY_ENGINE_WTF_TEXT_STRINGOPERATORS_H_ - -namespace WTF { - -template -class StringAppend { - public: - StringAppend(StringType1 string1, StringType2 string2) - : m_string1(string1), m_string2(string2) {} - - operator String() const { return String(makeString(m_string1, m_string2)); } - - operator AtomicString() const { - return AtomicString(makeString(m_string1, m_string2)); - } - - bool is8Bit() { - StringTypeAdapter adapter1(m_string1); - StringTypeAdapter adapter2(m_string2); - return adapter1.is8Bit() && adapter2.is8Bit(); - } - - void writeTo(LChar* destination) { - ASSERT(is8Bit()); - StringTypeAdapter adapter1(m_string1); - StringTypeAdapter adapter2(m_string2); - adapter1.writeTo(destination); - adapter2.writeTo(destination + adapter1.length()); - } - - void writeTo(UChar* destination) { - StringTypeAdapter adapter1(m_string1); - StringTypeAdapter adapter2(m_string2); - adapter1.writeTo(destination); - adapter2.writeTo(destination + adapter1.length()); - } - - unsigned length() { - StringTypeAdapter adapter1(m_string1); - StringTypeAdapter adapter2(m_string2); - return adapter1.length() + adapter2.length(); - } - - private: - StringType1 m_string1; - StringType2 m_string2; -}; - -template -class StringTypeAdapter> { - public: - StringTypeAdapter>( - StringAppend& buffer) - : m_buffer(buffer) {} - - unsigned length() { return m_buffer.length(); } - - bool is8Bit() { return m_buffer.is8Bit(); } - - void writeTo(LChar* destination) { m_buffer.writeTo(destination); } - void writeTo(UChar* destination) { m_buffer.writeTo(destination); } - - private: - StringAppend& m_buffer; -}; - -inline StringAppend operator+(const char* string1, - const String& string2) { - return StringAppend(string1, string2); -} - -inline StringAppend operator+( - const char* string1, - const AtomicString& string2) { - return StringAppend(string1, string2); -} - -template -inline StringAppend> operator+( - const char* string1, - const StringAppend& string2) { - return StringAppend>(string1, string2); -} - -inline StringAppend operator+(const UChar* string1, - const String& string2) { - return StringAppend(string1, string2); -} - -inline StringAppend operator+( - const UChar* string1, - const AtomicString& string2) { - return StringAppend(string1, string2); -} - -template -inline StringAppend> operator+( - const UChar* string1, - const StringAppend& string2) { - return StringAppend>(string1, string2); -} - -template -StringAppend operator+(const String& string1, T string2) { - return StringAppend(string1, string2); -} - -template -StringAppend, W> operator+(const StringAppend& string1, - W string2) { - return StringAppend, W>(string1, string2); -} - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_STRINGOPERATORS_H_ diff --git a/sky/engine/wtf/text/StringOperatorsTest.cpp b/sky/engine/wtf/text/StringOperatorsTest.cpp deleted file mode 100644 index f87b9b1c94ebc..0000000000000 --- a/sky/engine/wtf/text/StringOperatorsTest.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() (++wtfStringCopyCount) - -static int wtfStringCopyCount; - -#include -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace { - -#define EXPECT_N_WTF_STRING_COPIES(count, expr) \ - do { \ - wtfStringCopyCount = 0; \ - String __testString = expr; \ - (void)__testString; \ - EXPECT_EQ(count, wtfStringCopyCount) << #expr; \ - } while (false) - -TEST(WTF, DISABLED_StringOperators) { - String string("String"); - AtomicString atomicString("AtomicString"); - const char* literal = "ASCIILiteral"; - - EXPECT_EQ(0, wtfStringCopyCount); - - EXPECT_N_WTF_STRING_COPIES(2, string + string); - EXPECT_N_WTF_STRING_COPIES(2, string + atomicString); - EXPECT_N_WTF_STRING_COPIES(2, atomicString + string); - EXPECT_N_WTF_STRING_COPIES(2, atomicString + atomicString); - - EXPECT_N_WTF_STRING_COPIES(1, "C string" + string); - EXPECT_N_WTF_STRING_COPIES(1, string + "C string"); - EXPECT_N_WTF_STRING_COPIES(1, "C string" + atomicString); - EXPECT_N_WTF_STRING_COPIES(1, atomicString + "C string"); - - EXPECT_N_WTF_STRING_COPIES(1, literal + string); - EXPECT_N_WTF_STRING_COPIES(1, string + literal); - EXPECT_N_WTF_STRING_COPIES(1, literal + atomicString); - EXPECT_N_WTF_STRING_COPIES(1, atomicString + literal); - - EXPECT_N_WTF_STRING_COPIES(2, "C string" + string + "C string" + string); - EXPECT_N_WTF_STRING_COPIES(2, "C string" + (string + "C string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, ("C string" + string) + ("C string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, string + "C string" + string + "C string"); - EXPECT_N_WTF_STRING_COPIES(2, string + ("C string" + string + "C string")); - EXPECT_N_WTF_STRING_COPIES(2, (string + "C string") + (string + "C string")); - - EXPECT_N_WTF_STRING_COPIES(2, literal + string + literal + string); - EXPECT_N_WTF_STRING_COPIES(2, literal + (string + literal + string)); - EXPECT_N_WTF_STRING_COPIES(2, (literal + string) + (literal + string)); - EXPECT_N_WTF_STRING_COPIES(2, string + literal + string + literal); - EXPECT_N_WTF_STRING_COPIES(2, string + (literal + string + literal)); - EXPECT_N_WTF_STRING_COPIES(2, (string + literal) + (string + literal)); - - EXPECT_N_WTF_STRING_COPIES(2, literal + string + "C string" + string); - EXPECT_N_WTF_STRING_COPIES(2, literal + (string + "C string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, (literal + string) + ("C string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, "C string" + string + literal + string); - EXPECT_N_WTF_STRING_COPIES(2, "C string" + (string + literal + string)); - EXPECT_N_WTF_STRING_COPIES(2, ("C string" + string) + (literal + string)); - - EXPECT_N_WTF_STRING_COPIES( - 2, literal + atomicString + "C string" + atomicString); - EXPECT_N_WTF_STRING_COPIES( - 2, literal + (atomicString + "C string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES( - 2, (literal + atomicString) + ("C string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES( - 2, "C string" + atomicString + literal + atomicString); - EXPECT_N_WTF_STRING_COPIES( - 2, "C string" + (atomicString + literal + atomicString)); - EXPECT_N_WTF_STRING_COPIES( - 2, ("C string" + atomicString) + (literal + atomicString)); - - EXPECT_N_WTF_STRING_COPIES(2, literal + atomicString + "C string" + string); - EXPECT_N_WTF_STRING_COPIES(2, literal + (atomicString + "C string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, - (literal + atomicString) + ("C string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, "C string" + atomicString + literal + string); - EXPECT_N_WTF_STRING_COPIES(2, "C string" + (atomicString + literal + string)); - EXPECT_N_WTF_STRING_COPIES(2, - ("C string" + atomicString) + (literal + string)); - - EXPECT_N_WTF_STRING_COPIES(2, literal + string + "C string" + atomicString); - EXPECT_N_WTF_STRING_COPIES(2, literal + (string + "C string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, - (literal + string) + ("C string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, "C string" + string + literal + atomicString); - EXPECT_N_WTF_STRING_COPIES(2, "C string" + (string + literal + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, - ("C string" + string) + (literal + atomicString)); - - EXPECT_N_WTF_STRING_COPIES( - 2, "C string" + atomicString + "C string" + atomicString); - EXPECT_N_WTF_STRING_COPIES( - 2, "C string" + (atomicString + "C string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES( - 2, ("C string" + atomicString) + ("C string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES( - 2, atomicString + "C string" + atomicString + "C string"); - EXPECT_N_WTF_STRING_COPIES( - 2, atomicString + ("C string" + atomicString + "C string")); - EXPECT_N_WTF_STRING_COPIES( - 2, (atomicString + "C string") + (atomicString + "C string")); - - EXPECT_N_WTF_STRING_COPIES(2, - literal + atomicString + literal + atomicString); - EXPECT_N_WTF_STRING_COPIES(2, - literal + (atomicString + literal + atomicString)); - EXPECT_N_WTF_STRING_COPIES( - 2, (literal + atomicString) + (literal + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, - atomicString + literal + atomicString + literal); - EXPECT_N_WTF_STRING_COPIES(2, - atomicString + (literal + atomicString + literal)); - EXPECT_N_WTF_STRING_COPIES( - 2, (atomicString + literal) + (atomicString + literal)); - - EXPECT_N_WTF_STRING_COPIES(2, - "C string" + string + "C string" + atomicString); - EXPECT_N_WTF_STRING_COPIES(2, - "C string" + (string + "C string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES( - 2, ("C string" + string) + ("C string" + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, - string + "C string" + atomicString + "C string"); - EXPECT_N_WTF_STRING_COPIES(2, - string + ("C string" + atomicString + "C string")); - EXPECT_N_WTF_STRING_COPIES( - 2, (string + "C string") + (atomicString + "C string")); - - EXPECT_N_WTF_STRING_COPIES(2, literal + string + literal + atomicString); - EXPECT_N_WTF_STRING_COPIES(2, literal + (string + literal + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, (literal + string) + (literal + atomicString)); - EXPECT_N_WTF_STRING_COPIES(2, string + literal + atomicString + literal); - EXPECT_N_WTF_STRING_COPIES(2, string + (literal + atomicString + literal)); - EXPECT_N_WTF_STRING_COPIES(2, (string + literal) + (atomicString + literal)); - - EXPECT_N_WTF_STRING_COPIES(2, - "C string" + atomicString + "C string" + string); - EXPECT_N_WTF_STRING_COPIES(2, - "C string" + (atomicString + "C string" + string)); - EXPECT_N_WTF_STRING_COPIES( - 2, ("C string" + atomicString) + ("C string" + string)); - EXPECT_N_WTF_STRING_COPIES(2, - atomicString + "C string" + string + "C string"); - EXPECT_N_WTF_STRING_COPIES(2, - atomicString + ("C string" + string + "C string")); - EXPECT_N_WTF_STRING_COPIES( - 2, (atomicString + "C string") + (string + "C string")); - - EXPECT_N_WTF_STRING_COPIES(2, literal + atomicString + literal + string); - EXPECT_N_WTF_STRING_COPIES(2, literal + (atomicString + literal + string)); - EXPECT_N_WTF_STRING_COPIES(2, (literal + atomicString) + (literal + string)); - EXPECT_N_WTF_STRING_COPIES(2, atomicString + literal + string + literal); - EXPECT_N_WTF_STRING_COPIES(2, atomicString + (literal + string + literal)); - EXPECT_N_WTF_STRING_COPIES(2, (atomicString + literal) + (string + literal)); -} - -} // namespace diff --git a/sky/engine/wtf/text/StringStatics.cpp b/sky/engine/wtf/text/StringStatics.cpp deleted file mode 100644 index f8449cb9cdb70..0000000000000 --- a/sky/engine/wtf/text/StringStatics.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2010 Apple Inc. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/StringStatics.h" - -#include "flutter/sky/engine/wtf/DynamicAnnotations.h" -#include "flutter/sky/engine/wtf/MainThread.h" -#include "flutter/sky/engine/wtf/StaticConstructors.h" -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#include "flutter/sky/engine/wtf/text/StringImpl.h" - -namespace WTF { - -StringImpl* StringImpl::empty() { - DEFINE_STATIC_LOCAL(StringImpl, emptyString, (ConstructEmptyString)); - WTF_ANNOTATE_BENIGN_RACE( - &emptyString, "Benign race on StringImpl::emptyString reference counter"); - return &emptyString; -} - -StringImpl* StringImpl::empty16Bit() { - DEFINE_STATIC_LOCAL(StringImpl, emptyString, (ConstructEmptyString16Bit)); - WTF_ANNOTATE_BENIGN_RACE( - &emptyString, - "Benign race on the reference counter of a static string created by" - "StringImpl::empty16Bit"); - return &emptyString; -} - -WTF_EXPORT DEFINE_GLOBAL(AtomicString, nullAtom) WTF_EXPORT - DEFINE_GLOBAL(AtomicString, emptyAtom) WTF_EXPORT - DEFINE_GLOBAL(AtomicString, starAtom) - - NEVER_INLINE unsigned StringImpl::hashSlowCase() const { - if (is8Bit()) - setHash(StringHasher::computeHashAndMaskTop8Bits(characters8(), m_length)); - else - setHash(StringHasher::computeHashAndMaskTop8Bits(characters16(), m_length)); - return existingHash(); -} - -void AtomicString::init() { - ASSERT(isMainThread()); - - new (NotNull, (void*)&nullAtom) AtomicString; - new (NotNull, (void*)&emptyAtom) AtomicString(""); -} - -void StringStatics::init() { - ASSERT(isMainThread()); - - // FIXME: These should be allocated at compile time. - new (NotNull, (void*)&starAtom) - AtomicString("*", AtomicString::ConstructFromLiteral); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/StringStatics.h b/sky/engine/wtf/text/StringStatics.h deleted file mode 100644 index ac8c7437a9215..0000000000000 --- a/sky/engine/wtf/text/StringStatics.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_STRINGSTATICS_H_ -#define SKY_ENGINE_WTF_TEXT_STRINGSTATICS_H_ - -#include "flutter/sky/engine/wtf/WTFExport.h" - -namespace WTF { - -class StringStatics { - public: - WTF_EXPORT static void init(); - - private: - StringStatics(); -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_STRINGSTATICS_H_ diff --git a/sky/engine/wtf/text/StringUTF8Adaptor.h b/sky/engine/wtf/text/StringUTF8Adaptor.h deleted file mode 100644 index 4d97930975776..0000000000000 --- a/sky/engine/wtf/text/StringUTF8Adaptor.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_STRINGUTF8ADAPTOR_H_ -#define SKY_ENGINE_WTF_TEXT_STRINGUTF8ADAPTOR_H_ - -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/TextEncoding.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -// This class lets you get UTF-8 data out of a String without mallocing a -// separate buffer to hold the data if the String happens to be 8 bit and -// contain only ASCII characters. -class StringUTF8Adaptor { - public: - enum ShouldNormalize { DoNotNormalize, Normalize }; - - explicit StringUTF8Adaptor( - const String& string, - ShouldNormalize normalize = DoNotNormalize, - UnencodableHandling handling = EntitiesForUnencodables) - : m_data(0), m_length(0) { - if (string.isEmpty()) - return; - // Unfortunately, 8 bit WTFStrings are encoded in Latin-1 and GURL uses - // UTF-8 when processing 8 bit strings. If |relative| is entirely ASCII, we - // luck out and can avoid mallocing a new buffer to hold the UTF-8 data - // because UTF-8 and Latin-1 use the same code units for ASCII code points. - if (string.is8Bit() && string.containsOnlyASCII()) { - m_data = reinterpret_cast(string.characters8()); - m_length = string.length(); - } else { - if (normalize == Normalize) - m_utf8Buffer = UTF8Encoding().normalizeAndEncode(string, handling); - else - m_utf8Buffer = string.utf8(); - m_data = m_utf8Buffer.data(); - m_length = m_utf8Buffer.length(); - } - } - - const char* data() const { return m_data; } - size_t length() const { return m_length; } - - private: - CString m_utf8Buffer; - const char* m_data; - size_t m_length; -}; - -} // namespace WTF - -using WTF::StringUTF8Adaptor; - -#endif // SKY_ENGINE_WTF_TEXT_STRINGUTF8ADAPTOR_H_ diff --git a/sky/engine/wtf/text/StringView.h b/sky/engine/wtf/text/StringView.h deleted file mode 100644 index 1f6da0ec0fc54..0000000000000 --- a/sky/engine/wtf/text/StringView.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_STRINGVIEW_H_ -#define SKY_ENGINE_WTF_TEXT_STRINGVIEW_H_ - -#include "flutter/sky/engine/wtf/text/StringImpl.h" - -namespace WTF { - -class WTF_EXPORT StringView { - public: - StringView() : m_offset(0), m_length(0) {} - - explicit StringView(PassRefPtr impl) - : m_impl(impl), m_offset(0), m_length(m_impl->length()) {} - - StringView(PassRefPtr impl, unsigned offset, unsigned length) - : m_impl(impl), m_offset(offset), m_length(length) { - ASSERT_WITH_SECURITY_IMPLICATION(offset + length <= m_impl->length()); - } - - void narrow(unsigned offset, unsigned length) { - ASSERT_WITH_SECURITY_IMPLICATION(offset + length <= m_length); - m_offset += offset; - m_length = length; - } - - bool isEmpty() const { return !m_length; } - unsigned length() const { return m_length; } - - bool is8Bit() const { return m_impl->is8Bit(); } - - const LChar* characters8() const { - if (!m_impl) - return 0; - ASSERT(is8Bit()); - return m_impl->characters8() + m_offset; - } - - const UChar* characters16() const { - if (!m_impl) - return 0; - ASSERT(!is8Bit()); - return m_impl->characters16() + m_offset; - } - - PassRefPtr toString() const { - if (!m_impl) - return m_impl; - if (m_impl->is8Bit()) - return StringImpl::create(characters8(), m_length); - return StringImpl::create(characters16(), m_length); - } - - private: - RefPtr m_impl; - unsigned m_offset; - unsigned m_length; -}; - -} // namespace WTF - -using WTF::StringView; - -#endif // SKY_ENGINE_WTF_TEXT_STRINGVIEW_H_ diff --git a/sky/engine/wtf/text/TextCodec.cpp b/sky/engine/wtf/text/TextCodec.cpp deleted file mode 100644 index d7a3b8497889a..0000000000000 --- a/sky/engine/wtf/text/TextCodec.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2006 Alexey Proskuryakov - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextCodec.h" - -#include "flutter/sky/engine/wtf/StringExtras.h" - -namespace WTF { - -TextCodec::~TextCodec() {} - -int TextCodec::getUnencodableReplacement( - unsigned codePoint, - UnencodableHandling handling, - UnencodableReplacementArray replacement) { - switch (handling) { - case QuestionMarksForUnencodables: - replacement[0] = '?'; - replacement[1] = 0; - return 1; - case EntitiesForUnencodables: - snprintf(replacement, sizeof(UnencodableReplacementArray), "&#%u;", - codePoint); - return static_cast(strlen(replacement)); - case URLEncodedEntitiesForUnencodables: - snprintf(replacement, sizeof(UnencodableReplacementArray), - "%%26%%23%u%%3B", codePoint); - return static_cast(strlen(replacement)); - } - ASSERT_NOT_REACHED(); - replacement[0] = 0; - return 0; -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextCodec.h b/sky/engine/wtf/text/TextCodec.h deleted file mode 100644 index 44b56c7e24c24..0000000000000 --- a/sky/engine/wtf/text/TextCodec.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2006 Alexey Proskuryakov - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTCODEC_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTCODEC_H_ - -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace WTF { - -class TextEncoding; - -// Specifies what will happen when a character is encountered that is -// not encodable in the character set. -enum UnencodableHandling { - // Substitutes the replacement character "?". - QuestionMarksForUnencodables, - - // Encodes the character as an XML entity. For example, U+06DE - // would be "۞" (0x6DE = 1758 in octal). - EntitiesForUnencodables, - - // Encodes the character as en entity as above, but escaped - // non-alphanumeric characters. This is used in URLs. - // For example, U+6DE would be "%26%231758%3B". - URLEncodedEntitiesForUnencodables -}; - -typedef char UnencodableReplacementArray[32]; - -enum FlushBehavior { - // More bytes are coming, don't flush the codec. - DoNotFlush = 0, - - // A fetch has hit EOF. Some codecs handle fetches differently, for compat - // reasons. - FetchEOF, - - // Do a full flush of the codec. - DataEOF -}; - -COMPILE_ASSERT(!DoNotFlush, DoNotFlush_is_falsy); -COMPILE_ASSERT(FetchEOF, FetchEOF_is_truthy); -COMPILE_ASSERT(DataEOF, DataEOF_is_truthy); - -class TextCodec { - WTF_MAKE_NONCOPYABLE(TextCodec); - WTF_MAKE_FAST_ALLOCATED; - - public: - TextCodec() {} - virtual ~TextCodec(); - - String decode(const char* str, - size_t length, - FlushBehavior flush = DoNotFlush) { - bool ignored; - return decode(str, length, flush, false, ignored); - } - - virtual String decode(const char*, - size_t length, - FlushBehavior, - bool stopOnError, - bool& sawError) = 0; - virtual CString encode(const UChar*, size_t length, UnencodableHandling) = 0; - virtual CString encode(const LChar*, size_t length, UnencodableHandling) = 0; - - // Fills a null-terminated string representation of the given - // unencodable character into the given replacement buffer. - // The length of the string (not including the null) will be returned. - static int getUnencodableReplacement(unsigned codePoint, - UnencodableHandling, - UnencodableReplacementArray); -}; - -typedef void (*EncodingNameRegistrar)(const char* alias, const char* name); - -typedef PassOwnPtr ( - *NewTextCodecFunction)(const TextEncoding&, const void* additionalData); -typedef void (*TextCodecRegistrar)(const char* name, - NewTextCodecFunction, - const void* additionalData); - -} // namespace WTF - -using WTF::TextCodec; - -#endif // SKY_ENGINE_WTF_TEXT_TEXTCODEC_H_ diff --git a/sky/engine/wtf/text/TextCodecASCIIFastPath.h b/sky/engine/wtf/text/TextCodecASCIIFastPath.h deleted file mode 100644 index 2a33abfdd2c2a..0000000000000 --- a/sky/engine/wtf/text/TextCodecASCIIFastPath.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTCODECASCIIFASTPATH_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTCODECASCIIFASTPATH_H_ - -#include "flutter/sky/engine/wtf/text/ASCIIFastPath.h" - -namespace WTF { - -template -struct UCharByteFiller; -template <> -struct UCharByteFiller<4> { - static void copy(LChar* destination, const uint8_t* source) { - memcpy(destination, source, 4); - } - - static void copy(UChar* destination, const uint8_t* source) { - destination[0] = source[0]; - destination[1] = source[1]; - destination[2] = source[2]; - destination[3] = source[3]; - } -}; -template <> -struct UCharByteFiller<8> { - static void copy(LChar* destination, const uint8_t* source) { - memcpy(destination, source, 8); - } - - static void copy(UChar* destination, const uint8_t* source) { - destination[0] = source[0]; - destination[1] = source[1]; - destination[2] = source[2]; - destination[3] = source[3]; - destination[4] = source[4]; - destination[5] = source[5]; - destination[6] = source[6]; - destination[7] = source[7]; - } -}; - -inline void copyASCIIMachineWord(LChar* destination, const uint8_t* source) { - UCharByteFiller::copy(destination, source); -} - -inline void copyASCIIMachineWord(UChar* destination, const uint8_t* source) { - UCharByteFiller::copy(destination, source); -} - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_TEXTCODECASCIIFASTPATH_H_ diff --git a/sky/engine/wtf/text/TextCodecICU.cpp b/sky/engine/wtf/text/TextCodecICU.cpp deleted file mode 100644 index 637621e8cda44..0000000000000 --- a/sky/engine/wtf/text/TextCodecICU.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2006 Alexey Proskuryakov - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextCodecICU.h" - -#include -#include -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/StringExtras.h" -#include "flutter/sky/engine/wtf/Threading.h" -#include "flutter/sky/engine/wtf/WTFThreadData.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -using std::min; - -namespace WTF { - -const size_t ConversionBufferSize = 16384; - -ICUConverterWrapper::~ICUConverterWrapper() { - if (converter) - ucnv_close(converter); -} - -static UConverter*& cachedConverterICU() { - return wtfThreadData().cachedConverterICU().converter; -} - -PassOwnPtr TextCodecICU::create(const TextEncoding& encoding, - const void*) { - return adoptPtr(new TextCodecICU(encoding)); -} - -void TextCodecICU::registerEncodingNames(EncodingNameRegistrar registrar) { - // We register Hebrew with logical ordering using a separate name. - // Otherwise, this would share the same canonical name as the - // visual ordering case, and then TextEncoding could not tell them - // apart; ICU treats these names as synonyms. - registrar("ISO-8859-8-I", "ISO-8859-8-I"); - - int32_t numEncodings = ucnv_countAvailable(); - for (int32_t i = 0; i < numEncodings; ++i) { - const char* name = ucnv_getAvailableName(i); - UErrorCode error = U_ZERO_ERROR; - // Try MIME before trying IANA to pick up commonly used names like - // 'EUC-JP' instead of horrendously long names like - // 'Extended_UNIX_Code_Packed_Format_for_Japanese'. - const char* standardName = ucnv_getStandardName(name, "MIME", &error); - if (!U_SUCCESS(error) || !standardName) { - error = U_ZERO_ERROR; - // Try IANA to pick up 'windows-12xx' and other names - // which are not preferred MIME names but are widely used. - standardName = ucnv_getStandardName(name, "IANA", &error); - if (!U_SUCCESS(error) || !standardName) - continue; - } - - // A number of these aliases are handled in Chrome's copy of ICU, but - // Chromium can be compiled with the system ICU. - - // 1. Treat GB2312 encoding as GBK (its more modern superset), to match - // other browsers. - // 2. On the Web, GB2312 is encoded as EUC-CN or HZ, while ICU provides a - // native encoding - // for encoding GB_2312-80 and several others. So, we need to override - // this behavior, too. - if (!strcmp(standardName, "GB2312") || !strcmp(standardName, "GB_2312-80")) - standardName = "GBK"; - // Similarly, EUC-KR encodings all map to an extended version, but - // per HTML5, the canonical name still should be EUC-KR. - else if (!strcmp(standardName, "EUC-KR") || - !strcmp(standardName, "KSC_5601") || - !strcmp(standardName, "cp1363")) - standardName = "EUC-KR"; - // And so on. - else if (!strcasecmp(standardName, "iso-8859-9")) // This name is returned - // in different case by - // ICU 3.2 and 3.6. - standardName = "windows-1254"; - else if (!strcmp(standardName, "TIS-620")) - standardName = "windows-874"; - - registrar(standardName, standardName); - - uint16_t numAliases = ucnv_countAliases(name, &error); - ASSERT(U_SUCCESS(error)); - if (U_SUCCESS(error)) - for (uint16_t j = 0; j < numAliases; ++j) { - error = U_ZERO_ERROR; - const char* alias = ucnv_getAlias(name, j, &error); - ASSERT(U_SUCCESS(error)); - if (U_SUCCESS(error) && alias != standardName) - registrar(alias, standardName); - } - } - - // Additional alias for MacCyrillic not present in ICU. - registrar("maccyrillic", "x-mac-cyrillic"); - - // Additional aliases that historically were present in the encoding - // table in WebKit on Macintosh that don't seem to be present in ICU. - // Perhaps we can prove these are not used on the web and remove them. - // Or perhaps we can get them added to ICU. - registrar("x-mac-roman", "macintosh"); - registrar("x-mac-ukrainian", "x-mac-cyrillic"); - registrar("cn-big5", "Big5"); - registrar("x-x-big5", "Big5"); - registrar("cn-gb", "GBK"); - registrar("csgb231280", "GBK"); - registrar("x-euc-cn", "GBK"); - registrar("x-gbk", "GBK"); - registrar("csISO88598I", "ISO-8859-8-I"); - registrar("koi", "KOI8-R"); - registrar("logical", "ISO-8859-8-I"); - registrar("visual", "ISO-8859-8"); - registrar("winarabic", "windows-1256"); - registrar("winbaltic", "windows-1257"); - registrar("wincyrillic", "windows-1251"); - registrar("iso-8859-11", "windows-874"); - registrar("iso8859-11", "windows-874"); - registrar("dos-874", "windows-874"); - registrar("wingreek", "windows-1253"); - registrar("winhebrew", "windows-1255"); - registrar("winlatin2", "windows-1250"); - registrar("winturkish", "windows-1254"); - registrar("winvietnamese", "windows-1258"); - registrar("x-cp1250", "windows-1250"); - registrar("x-cp1251", "windows-1251"); - registrar("x-euc", "EUC-JP"); - registrar("x-windows-949", "EUC-KR"); - registrar("KSC5601", "EUC-KR"); - registrar("x-uhc", "EUC-KR"); - registrar("shift-jis", "Shift_JIS"); - - // Alternative spelling of ISO encoding names. - registrar("ISO8859-1", "ISO-8859-1"); - registrar("ISO8859-2", "ISO-8859-2"); - registrar("ISO8859-3", "ISO-8859-3"); - registrar("ISO8859-4", "ISO-8859-4"); - registrar("ISO8859-5", "ISO-8859-5"); - registrar("ISO8859-6", "ISO-8859-6"); - registrar("ISO8859-7", "ISO-8859-7"); - registrar("ISO8859-8", "ISO-8859-8"); - registrar("ISO8859-8-I", "ISO-8859-8-I"); - registrar("ISO8859-9", "ISO-8859-9"); - registrar("ISO8859-10", "ISO-8859-10"); - registrar("ISO8859-13", "ISO-8859-13"); - registrar("ISO8859-14", "ISO-8859-14"); - registrar("ISO8859-15", "ISO-8859-15"); - // No need to have an entry for ISO8859-16. ISO-8859-16 has just one label - // listed in WHATWG Encoding Living Standard (http://encoding.spec.whatwg.org/ - // ). - - // Additional aliases present in the WHATWG Encoding Standard - // and Firefox (24), but not in ICU 4.6. - registrar("csiso58gb231280", "GBK"); - registrar("csiso88596e", "ISO-8859-6"); - registrar("csiso88596i", "ISO-8859-6"); - registrar("csiso88598e", "ISO-8859-8"); - registrar("gb_2312", "GBK"); - registrar("iso88591", "windows-1252"); - registrar("iso88592", "ISO-8859-2"); - registrar("iso88593", "ISO-8859-3"); - registrar("iso88594", "ISO-8859-4"); - registrar("iso88595", "ISO-8859-5"); - registrar("iso88596", "ISO-8859-6"); - registrar("iso88597", "ISO-8859-7"); - registrar("iso88598", "ISO-8859-8"); - registrar("iso88599", "windows-1254"); - registrar("iso885910", "ISO-8859-10"); - registrar("iso885911", "windows-874"); - registrar("iso885913", "ISO-8859-13"); - registrar("iso885914", "ISO-8859-14"); - registrar("iso885915", "ISO-8859-15"); - registrar("iso_8859-1", "windows-1252"); - registrar("iso_8859-2", "ISO-8859-2"); - registrar("iso_8859-3", "ISO-8859-3"); - registrar("iso_8859-4", "ISO-8859-4"); - registrar("iso_8859-5", "ISO-8859-5"); - registrar("iso_8859-6", "ISO-8859-6"); - registrar("iso_8859-7", "ISO-8859-7"); - registrar("iso_8859-8", "ISO-8859-8"); - registrar("iso_8859-9", "windows-1254"); - registrar("iso_8859-15", "ISO-8859-15"); - registrar("koi8_r", "KOI8-R"); - registrar("x-cp1252", "windows-1252"); - registrar("x-cp1253", "windows-1253"); - registrar("x-cp1254", "windows-1254"); - registrar("x-cp1255", "windows-1255"); - registrar("x-cp1256", "windows-1256"); - registrar("x-cp1257", "windows-1257"); - registrar("x-cp1258", "windows-1258"); -} - -void TextCodecICU::registerCodecs(TextCodecRegistrar registrar) { - // See comment above in registerEncodingNames. - registrar("ISO-8859-8-I", create, 0); - - int32_t numEncodings = ucnv_countAvailable(); - for (int32_t i = 0; i < numEncodings; ++i) { - const char* name = ucnv_getAvailableName(i); - UErrorCode error = U_ZERO_ERROR; - const char* standardName = ucnv_getStandardName(name, "MIME", &error); - if (!U_SUCCESS(error) || !standardName) { - error = U_ZERO_ERROR; - standardName = ucnv_getStandardName(name, "IANA", &error); - if (!U_SUCCESS(error) || !standardName) - continue; - } - registrar(standardName, create, 0); - } -} - -TextCodecICU::TextCodecICU(const TextEncoding& encoding) - : m_encoding(encoding), m_converterICU(0), m_needsGBKFallbacks(false) {} - -TextCodecICU::~TextCodecICU() { - releaseICUConverter(); -} - -void TextCodecICU::releaseICUConverter() const { - if (m_converterICU) { - UConverter*& cachedConverter = cachedConverterICU(); - if (cachedConverter) - ucnv_close(cachedConverter); - cachedConverter = m_converterICU; - m_converterICU = 0; - } -} - -void TextCodecICU::createICUConverter() const { - ASSERT(!m_converterICU); - - const char* name = m_encoding.name(); - m_needsGBKFallbacks = - name[0] == 'G' && name[1] == 'B' && name[2] == 'K' && !name[3]; - - UErrorCode err; - - UConverter*& cachedConverter = cachedConverterICU(); - if (cachedConverter) { - err = U_ZERO_ERROR; - const char* cachedName = ucnv_getName(cachedConverter, &err); - if (U_SUCCESS(err) && m_encoding == cachedName) { - m_converterICU = cachedConverter; - cachedConverter = 0; - return; - } - } - - err = U_ZERO_ERROR; - m_converterICU = ucnv_open(m_encoding.name(), &err); -#if !LOG_DISABLED - if (err == U_AMBIGUOUS_ALIAS_WARNING) - WTF_LOG_ERROR("ICU ambiguous alias warning for encoding: %s", - m_encoding.name()); -#endif - if (m_converterICU) - ucnv_setFallback(m_converterICU, TRUE); -} - -int TextCodecICU::decodeToBuffer(UChar* target, - UChar* targetLimit, - const char*& source, - const char* sourceLimit, - int32_t* offsets, - bool flush, - UErrorCode& err) { - UChar* targetStart = target; - err = U_ZERO_ERROR; - ucnv_toUnicode(m_converterICU, &target, targetLimit, &source, sourceLimit, - offsets, flush, &err); - return target - targetStart; -} - -class ErrorCallbackSetter { - public: - ErrorCallbackSetter(UConverter* converter, bool stopOnError) - : m_converter(converter), m_shouldStopOnEncodingErrors(stopOnError) { - if (m_shouldStopOnEncodingErrors) { - UErrorCode err = U_ZERO_ERROR; - ucnv_setToUCallBack(m_converter, UCNV_TO_U_CALLBACK_SUBSTITUTE, - UCNV_SUB_STOP_ON_ILLEGAL, &m_savedAction, - &m_savedContext, &err); - ASSERT(err == U_ZERO_ERROR); - } - } - ~ErrorCallbackSetter() { - if (m_shouldStopOnEncodingErrors) { - UErrorCode err = U_ZERO_ERROR; - const void* oldContext; - UConverterToUCallback oldAction; - ucnv_setToUCallBack(m_converter, m_savedAction, m_savedContext, - &oldAction, &oldContext, &err); - ASSERT(oldAction == UCNV_TO_U_CALLBACK_SUBSTITUTE); - ASSERT(!strcmp(static_cast(oldContext), - UCNV_SUB_STOP_ON_ILLEGAL)); - ASSERT(err == U_ZERO_ERROR); - } - } - - private: - UConverter* m_converter; - bool m_shouldStopOnEncodingErrors; - const void* m_savedContext; - UConverterToUCallback m_savedAction; -}; - -String TextCodecICU::decode(const char* bytes, - size_t length, - FlushBehavior flush, - bool stopOnError, - bool& sawError) { - // Get a converter for the passed-in encoding. - if (!m_converterICU) { - createICUConverter(); - ASSERT(m_converterICU); - if (!m_converterICU) { - WTF_LOG_ERROR( - "error creating ICU encoder even though encoding was in table"); - return String(); - } - } - - ErrorCallbackSetter callbackSetter(m_converterICU, stopOnError); - - StringBuilder result; - - UChar buffer[ConversionBufferSize]; - UChar* bufferLimit = buffer + ConversionBufferSize; - const char* source = reinterpret_cast(bytes); - const char* sourceLimit = source + length; - int32_t* offsets = NULL; - UErrorCode err = U_ZERO_ERROR; - - do { - int ucharsDecoded = decodeToBuffer(buffer, bufferLimit, source, sourceLimit, - offsets, flush != DoNotFlush, err); - result.append(buffer, ucharsDecoded); - } while (err == U_BUFFER_OVERFLOW_ERROR); - - if (U_FAILURE(err)) { - // flush the converter so it can be reused, and not be bothered by this - // error. - do { - decodeToBuffer(buffer, bufferLimit, source, sourceLimit, offsets, true, - err); - } while (source < sourceLimit); - sawError = true; - } - - String resultString = result.toString(); - - // - // Simplified Chinese pages use the code A3A0 to mean "full-width space", but - // ICU decodes it as U+E5E5. - if (!strcmp(m_encoding.name(), "GBK") || - !strcasecmp(m_encoding.name(), "gb18030")) - resultString.replace(0xE5E5, ideographicSpace); - - return resultString; -} - -// We need to apply these fallbacks ourselves as they are not currently -// supported by ICU and they were provided by the old TEC encoding path. Needed -// to fix . -static UChar fallbackForGBK(UChar32 character) { - switch (character) { - case 0x01F9: - return 0xE7C8; - case 0x1E3F: - return 0xE7C7; - case 0x22EF: - return 0x2026; - case 0x301C: - return 0xFF5E; - } - return 0; -} - -// Invalid character handler when writing escaped entities for unrepresentable -// characters. See the declaration of TextCodec::encode for more. -static void urlEscapedEntityCallback(const void* context, - UConverterFromUnicodeArgs* fromUArgs, - const UChar* codeUnits, - int32_t length, - UChar32 codePoint, - UConverterCallbackReason reason, - UErrorCode* err) { - if (reason == UCNV_UNASSIGNED) { - *err = U_ZERO_ERROR; - - UnencodableReplacementArray entity; - int entityLen = TextCodec::getUnencodableReplacement( - codePoint, URLEncodedEntitiesForUnencodables, entity); - ucnv_cbFromUWriteBytes(fromUArgs, entity, entityLen, 0, err); - } else - UCNV_FROM_U_CALLBACK_ESCAPE(context, fromUArgs, codeUnits, length, - codePoint, reason, err); -} - -// Substitutes special GBK characters, escaping all other unassigned entities. -static void gbkCallbackEscape(const void* context, - UConverterFromUnicodeArgs* fromUArgs, - const UChar* codeUnits, - int32_t length, - UChar32 codePoint, - UConverterCallbackReason reason, - UErrorCode* err) { - UChar outChar; - if (reason == UCNV_UNASSIGNED && (outChar = fallbackForGBK(codePoint))) { - const UChar* source = &outChar; - *err = U_ZERO_ERROR; - ucnv_cbFromUWriteUChars(fromUArgs, &source, source + 1, 0, err); - return; - } - UCNV_FROM_U_CALLBACK_ESCAPE(context, fromUArgs, codeUnits, length, codePoint, - reason, err); -} - -// Combines both gbkUrlEscapedEntityCallback and GBK character substitution. -static void gbkUrlEscapedEntityCallack(const void* context, - UConverterFromUnicodeArgs* fromUArgs, - const UChar* codeUnits, - int32_t length, - UChar32 codePoint, - UConverterCallbackReason reason, - UErrorCode* err) { - if (reason == UCNV_UNASSIGNED) { - if (UChar outChar = fallbackForGBK(codePoint)) { - const UChar* source = &outChar; - *err = U_ZERO_ERROR; - ucnv_cbFromUWriteUChars(fromUArgs, &source, source + 1, 0, err); - return; - } - urlEscapedEntityCallback(context, fromUArgs, codeUnits, length, codePoint, - reason, err); - return; - } - UCNV_FROM_U_CALLBACK_ESCAPE(context, fromUArgs, codeUnits, length, codePoint, - reason, err); -} - -static void gbkCallbackSubstitute(const void* context, - UConverterFromUnicodeArgs* fromUArgs, - const UChar* codeUnits, - int32_t length, - UChar32 codePoint, - UConverterCallbackReason reason, - UErrorCode* err) { - UChar outChar; - if (reason == UCNV_UNASSIGNED && (outChar = fallbackForGBK(codePoint))) { - const UChar* source = &outChar; - *err = U_ZERO_ERROR; - ucnv_cbFromUWriteUChars(fromUArgs, &source, source + 1, 0, err); - return; - } - UCNV_FROM_U_CALLBACK_SUBSTITUTE(context, fromUArgs, codeUnits, length, - codePoint, reason, err); -} - -class TextCodecInput { - public: - TextCodecInput(const TextEncoding& encoding, - const UChar* characters, - size_t length) - : m_begin(characters), m_end(characters + length) {} - - TextCodecInput(const TextEncoding& encoding, - const LChar* characters, - size_t length) { - m_buffer.reserveInitialCapacity(length); - for (size_t i = 0; i < length; ++i) - m_buffer.append(characters[i]); - m_begin = m_buffer.data(); - m_end = m_begin + m_buffer.size(); - } - - const UChar* begin() const { return m_begin; } - const UChar* end() const { return m_end; } - - private: - const UChar* m_begin; - const UChar* m_end; - Vector m_buffer; -}; - -CString TextCodecICU::encodeInternal(const TextCodecInput& input, - UnencodableHandling handling) { - const UChar* source = input.begin(); - const UChar* end = input.end(); - - UErrorCode err = U_ZERO_ERROR; - - switch (handling) { - case QuestionMarksForUnencodables: - ucnv_setSubstChars(m_converterICU, "?", 1, &err); - ucnv_setFromUCallBack(m_converterICU, - m_needsGBKFallbacks - ? gbkCallbackSubstitute - : UCNV_FROM_U_CALLBACK_SUBSTITUTE, - 0, 0, 0, &err); - break; - case EntitiesForUnencodables: - ucnv_setFromUCallBack( - m_converterICU, - m_needsGBKFallbacks ? gbkCallbackEscape : UCNV_FROM_U_CALLBACK_ESCAPE, - UCNV_ESCAPE_XML_DEC, 0, 0, &err); - break; - case URLEncodedEntitiesForUnencodables: - ucnv_setFromUCallBack(m_converterICU, - m_needsGBKFallbacks ? gbkUrlEscapedEntityCallack - : urlEscapedEntityCallback, - 0, 0, 0, &err); - break; - } - - ASSERT(U_SUCCESS(err)); - if (U_FAILURE(err)) - return CString(); - - Vector result; - size_t size = 0; - do { - char buffer[ConversionBufferSize]; - char* target = buffer; - char* targetLimit = target + ConversionBufferSize; - err = U_ZERO_ERROR; - ucnv_fromUnicode(m_converterICU, &target, targetLimit, &source, end, 0, - true, &err); - size_t count = target - buffer; - result.grow(size + count); - memcpy(result.data() + size, buffer, count); - size += count; - } while (err == U_BUFFER_OVERFLOW_ERROR); - - return CString(result.data(), size); -} - -template -CString TextCodecICU::encodeCommon(const CharType* characters, - size_t length, - UnencodableHandling handling) { - if (!length) - return ""; - - if (!m_converterICU) - createICUConverter(); - if (!m_converterICU) - return CString(); - - TextCodecInput input(m_encoding, characters, length); - return encodeInternal(input, handling); -} - -CString TextCodecICU::encode(const UChar* characters, - size_t length, - UnencodableHandling handling) { - return encodeCommon(characters, length, handling); -} - -CString TextCodecICU::encode(const LChar* characters, - size_t length, - UnencodableHandling handling) { - return encodeCommon(characters, length, handling); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextCodecICU.h b/sky/engine/wtf/text/TextCodecICU.h deleted file mode 100644 index cb5b7835dad3f..0000000000000 --- a/sky/engine/wtf/text/TextCodecICU.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2006 Alexey Proskuryakov - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTCODECICU_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTCODECICU_H_ - -#include -#include "flutter/sky/engine/wtf/text/TextCodec.h" -#include "flutter/sky/engine/wtf/text/TextEncoding.h" - -typedef struct UConverter UConverter; - -namespace WTF { - -class TextCodecInput; - -class TextCodecICU final : public TextCodec { - public: - static void registerEncodingNames(EncodingNameRegistrar); - static void registerCodecs(TextCodecRegistrar); - - virtual ~TextCodecICU(); - - private: - TextCodecICU(const TextEncoding&); - static PassOwnPtr create(const TextEncoding&, const void*); - - virtual String decode(const char*, - size_t length, - FlushBehavior, - bool stopOnError, - bool& sawError) override; - virtual CString encode(const UChar*, - size_t length, - UnencodableHandling) override; - virtual CString encode(const LChar*, - size_t length, - UnencodableHandling) override; - - template - CString encodeCommon(const CharType*, size_t length, UnencodableHandling); - CString encodeInternal(const TextCodecInput&, UnencodableHandling); - - void createICUConverter() const; - void releaseICUConverter() const; - bool needsGBKFallbacks() const { return m_needsGBKFallbacks; } - void setNeedsGBKFallbacks(bool needsFallbacks) { - m_needsGBKFallbacks = needsFallbacks; - } - - int decodeToBuffer(UChar* buffer, - UChar* bufferLimit, - const char*& source, - const char* sourceLimit, - int32_t* offsets, - bool flush, - UErrorCode&); - - TextEncoding m_encoding; - mutable UConverter* m_converterICU; - mutable bool m_needsGBKFallbacks; -}; - -struct ICUConverterWrapper { - WTF_MAKE_NONCOPYABLE(ICUConverterWrapper); - WTF_MAKE_FAST_ALLOCATED; - - public: - ICUConverterWrapper() : converter(0) {} - ~ICUConverterWrapper(); - - UConverter* converter; -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_TEXTCODECICU_H_ diff --git a/sky/engine/wtf/text/TextCodecLatin1.cpp b/sky/engine/wtf/text/TextCodecLatin1.cpp deleted file mode 100644 index 60ce95704054a..0000000000000 --- a/sky/engine/wtf/text/TextCodecLatin1.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextCodecLatin1.h" - -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/StringBuffer.h" -#include "flutter/sky/engine/wtf/text/TextCodecASCIIFastPath.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -using namespace WTF; - -namespace WTF { - -static const UChar table[256] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, // 00-07 - 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, // 08-0F - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, // 10-17 - 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, // 18-1F - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, // 20-27 - 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, // 28-2F - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, // 30-37 - 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, // 38-3F - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, // 40-47 - 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, // 48-4F - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, // 50-57 - 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, // 58-5F - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, // 60-67 - 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, // 68-6F - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, // 70-77 - 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, // 78-7F - 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, // 80-87 - 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, // 88-8F - 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, // 90-97 - 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178, // 98-9F - 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, // A0-A7 - 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, // A8-AF - 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, // B0-B7 - 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, // B8-BF - 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, // C0-C7 - 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, // C8-CF - 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, // D0-D7 - 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, // D8-DF - 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, // E0-E7 - 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, // E8-EF - 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, // F0-F7 - 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF // F8-FF -}; - -void TextCodecLatin1::registerEncodingNames(EncodingNameRegistrar registrar) { - registrar("windows-1252", "windows-1252"); - registrar("ISO-8859-1", "ISO-8859-1"); - registrar("US-ASCII", "US-ASCII"); - - registrar("WinLatin1", "windows-1252"); - registrar("ibm-1252", "windows-1252"); - registrar("ibm-1252_P100-2000", "windows-1252"); - - registrar("CP819", "ISO-8859-1"); - registrar("IBM819", "ISO-8859-1"); - registrar("csISOLatin1", "ISO-8859-1"); - registrar("iso-ir-100", "ISO-8859-1"); - registrar("iso_8859-1:1987", "ISO-8859-1"); - registrar("l1", "ISO-8859-1"); - registrar("latin1", "ISO-8859-1"); - - registrar("ANSI_X3.4-1968", "US-ASCII"); - registrar("ANSI_X3.4-1986", "US-ASCII"); - registrar("ASCII", "US-ASCII"); - registrar("IBM367", "US-ASCII"); - registrar("ISO646-US", "US-ASCII"); - registrar("ISO_646.irv:1991", "US-ASCII"); - registrar("cp367", "US-ASCII"); - registrar("csASCII", "US-ASCII"); - registrar("ibm-367_P100-1995", "US-ASCII"); - registrar("iso-ir-6", "US-ASCII"); - registrar("iso-ir-6-us", "US-ASCII"); - registrar("us", "US-ASCII"); - registrar("x-ansi", "US-ASCII"); -} - -static PassOwnPtr newStreamingTextDecoderWindowsLatin1( - const TextEncoding&, - const void*) { - return adoptPtr(new TextCodecLatin1); -} - -void TextCodecLatin1::registerCodecs(TextCodecRegistrar registrar) { - registrar("windows-1252", newStreamingTextDecoderWindowsLatin1, 0); - - // ASCII and Latin-1 both decode as Windows Latin-1 although they retain - // unique identities. - registrar("ISO-8859-1", newStreamingTextDecoderWindowsLatin1, 0); - registrar("US-ASCII", newStreamingTextDecoderWindowsLatin1, 0); -} - -String TextCodecLatin1::decode(const char* bytes, - size_t length, - FlushBehavior, - bool, - bool&) { - LChar* characters; - if (!length) - return emptyString(); - String result = String::createUninitialized(length, characters); - - const uint8_t* source = reinterpret_cast(bytes); - const uint8_t* end = reinterpret_cast(bytes + length); - const uint8_t* alignedEnd = alignToMachineWord(end); - LChar* destination = characters; - - while (source < end) { - if (isASCII(*source)) { - // Fast path for ASCII. Most Latin-1 text will be ASCII. - if (isAlignedToMachineWord(source)) { - while (source < alignedEnd) { - MachineWord chunk = *reinterpret_cast_ptr(source); - - if (!isAllASCII(chunk)) - goto useLookupTable; - - copyASCIIMachineWord(destination, source); - source += sizeof(MachineWord); - destination += sizeof(MachineWord); - } - - if (source == end) - break; - } - *destination = *source; - } else { - useLookupTable: - if (table[*source] > 0xff) - goto upConvertTo16Bit; - - *destination = table[*source]; - } - - ++source; - ++destination; - } - - return result; - -upConvertTo16Bit: - UChar* characters16; - String result16 = String::createUninitialized(length, characters16); - - UChar* destination16 = characters16; - - // Zero extend and copy already processed 8 bit data - LChar* ptr8 = characters; - LChar* endPtr8 = destination; - - while (ptr8 < endPtr8) - *destination16++ = *ptr8++; - - // Handle the character that triggered the 16 bit path - *destination16 = table[*source]; - ++source; - ++destination16; - - while (source < end) { - if (isASCII(*source)) { - // Fast path for ASCII. Most Latin-1 text will be ASCII. - if (isAlignedToMachineWord(source)) { - while (source < alignedEnd) { - MachineWord chunk = *reinterpret_cast_ptr(source); - - if (!isAllASCII(chunk)) - goto useLookupTable16; - - copyASCIIMachineWord(destination16, source); - source += sizeof(MachineWord); - destination16 += sizeof(MachineWord); - } - - if (source == end) - break; - } - *destination16 = *source; - } else { - useLookupTable16: - *destination16 = table[*source]; - } - - ++source; - ++destination16; - } - - return result16; -} - -template -static CString encodeComplexWindowsLatin1(const CharType* characters, - size_t length, - UnencodableHandling handling) { - Vector result(length); - char* bytes = result.data(); - - size_t resultLength = 0; - for (size_t i = 0; i < length;) { - UChar32 c; - U16_NEXT(characters, i, length, c); - unsigned char b = c; - // Do an efficient check to detect characters other than 00-7F and A0-FF. - if (b != c || (c & 0xE0) == 0x80) { - // Look for a way to encode this with Windows Latin-1. - for (b = 0x80; b < 0xA0; ++b) - if (table[b] == c) - goto gotByte; - // No way to encode this character with Windows Latin-1. - UnencodableReplacementArray replacement; - int replacementLength = - TextCodec::getUnencodableReplacement(c, handling, replacement); - result.grow(resultLength + replacementLength + length - i); - bytes = result.data(); - memcpy(bytes + resultLength, replacement, replacementLength); - resultLength += replacementLength; - continue; - } - gotByte: - bytes[resultLength++] = b; - } - - return CString(bytes, resultLength); -} - -template -CString TextCodecLatin1::encodeCommon(const CharType* characters, - size_t length, - UnencodableHandling handling) { - { - char* bytes; - CString string = CString::newUninitialized(length, bytes); - - // Convert the string a fast way and simultaneously do an efficient check to - // see if it's all ASCII. - UChar ored = 0; - for (size_t i = 0; i < length; ++i) { - UChar c = characters[i]; - bytes[i] = c; - ored |= c; - } - - if (!(ored & 0xFF80)) - return string; - } - - // If it wasn't all ASCII, call the function that handles more-complex cases. - return encodeComplexWindowsLatin1(characters, length, handling); -} - -CString TextCodecLatin1::encode(const UChar* characters, - size_t length, - UnencodableHandling handling) { - return encodeCommon(characters, length, handling); -} - -CString TextCodecLatin1::encode(const LChar* characters, - size_t length, - UnencodableHandling handling) { - return encodeCommon(characters, length, handling); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextCodecLatin1.h b/sky/engine/wtf/text/TextCodecLatin1.h deleted file mode 100644 index fede4d12541b1..0000000000000 --- a/sky/engine/wtf/text/TextCodecLatin1.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTCODECLATIN1_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTCODECLATIN1_H_ - -#include "flutter/sky/engine/wtf/text/TextCodec.h" - -namespace WTF { - -class TextCodecLatin1 final : public TextCodec { - public: - static void registerEncodingNames(EncodingNameRegistrar); - static void registerCodecs(TextCodecRegistrar); - - private: - virtual String decode(const char*, - size_t length, - FlushBehavior, - bool stopOnError, - bool& sawError) override; - virtual CString encode(const UChar*, - size_t length, - UnencodableHandling) override; - virtual CString encode(const LChar*, - size_t length, - UnencodableHandling) override; - - template - CString encodeCommon(const CharType*, size_t length, UnencodableHandling); -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_TEXTCODECLATIN1_H_ diff --git a/sky/engine/wtf/text/TextCodecReplacement.cpp b/sky/engine/wtf/text/TextCodecReplacement.cpp deleted file mode 100644 index dc3b2a3df94bb..0000000000000 --- a/sky/engine/wtf/text/TextCodecReplacement.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/wtf/text/TextCodecReplacement.h" - -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -namespace WTF { - -TextCodecReplacement::TextCodecReplacement() : m_sentEOF(false) {} - -void TextCodecReplacement::registerEncodingNames( - EncodingNameRegistrar registrar) { - // The 'replacement' label itself should not be referenceable by - // resources or script - it's a specification convenience - but much of - // the wtf/text API asserts that an encoding name is a label for itself. - // This is handled in TextEncoding by marking it as not valid. - registrar("replacement", "replacement"); - - registrar("csiso2022kr", "replacement"); - registrar("hz-gb-2312", "replacement"); - registrar("iso-2022-cn", "replacement"); - registrar("iso-2022-cn-ext", "replacement"); - registrar("iso-2022-kr", "replacement"); -} - -static PassOwnPtr newStreamingTextDecoderReplacement( - const TextEncoding&, - const void*) { - return adoptPtr(new TextCodecReplacement); -} - -void TextCodecReplacement::registerCodecs(TextCodecRegistrar registrar) { - registrar("replacement", newStreamingTextDecoderReplacement, 0); -} - -String TextCodecReplacement::decode(const char*, - size_t, - FlushBehavior, - bool, - bool& sawError) { - sawError = true; - if (m_sentEOF) - return String(); - - m_sentEOF = true; - return String(&Unicode::replacementCharacter, 1); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextCodecReplacement.h b/sky/engine/wtf/text/TextCodecReplacement.h deleted file mode 100644 index aa0620d46dfca..0000000000000 --- a/sky/engine/wtf/text/TextCodecReplacement.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014 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. - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTCODECREPLACEMENT_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTCODECREPLACEMENT_H_ - -#include "flutter/sky/engine/wtf/text/TextCodec.h" -#include "flutter/sky/engine/wtf/text/TextCodecUTF8.h" - -namespace WTF { - -class TextCodecReplacement final : public TextCodecUTF8 { - public: - TextCodecReplacement(); - - static void registerEncodingNames(EncodingNameRegistrar); - static void registerCodecs(TextCodecRegistrar); - - private: - virtual String decode(const char*, - size_t length, - FlushBehavior, - bool stopOnError, - bool& sawError) override; - - bool m_sentEOF; -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_TEXTCODECREPLACEMENT_H_ diff --git a/sky/engine/wtf/text/TextCodecReplacementTest.cpp b/sky/engine/wtf/text/TextCodecReplacementTest.cpp deleted file mode 100644 index f4b5b7f3f1fcd..0000000000000 --- a/sky/engine/wtf/text/TextCodecReplacementTest.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2014 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. - -#include "flutter/sky/engine/wtf/text/TextCodecReplacement.h" - -#include -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/TextCodec.h" -#include "flutter/sky/engine/wtf/text/TextEncoding.h" -#include "flutter/sky/engine/wtf/text/TextEncodingRegistry.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -namespace { - -// Just one example, others are listed in the codec implementation. -const char* replacementAlias = "iso-2022-kr"; - -TEST(TextCodecReplacement, Aliases) { - // "replacement" is not a valid alias for itself - EXPECT_FALSE(TextEncoding("replacement").isValid()); - EXPECT_FALSE(TextEncoding("rEpLaCeMeNt").isValid()); - - EXPECT_TRUE(TextEncoding(replacementAlias).isValid()); - EXPECT_STREQ("replacement", TextEncoding(replacementAlias).name()); -} - -TEST(TextCodecReplacement, DecodesToFFFD) { - TextEncoding encoding(replacementAlias); - OwnPtr codec(newTextCodec(encoding)); - - bool sawError = false; - const char testCase[] = "hello world"; - size_t testCaseSize = sizeof(testCase) - 1; - - const String result = - codec->decode(testCase, testCaseSize, DataEOF, false, sawError); - EXPECT_TRUE(sawError); - ASSERT_EQ(1u, result.length()); - EXPECT_EQ(0xFFFDU, result[0]); -} - -TEST(TextCodecReplacement, EncodesToUTF8) { - TextEncoding encoding(replacementAlias); - OwnPtr codec(newTextCodec(encoding)); - - // "Kanji" in Chinese characters. - const UChar testCase[] = {0x6F22, 0x5B57}; - size_t testCaseSize = WTF_ARRAY_LENGTH(testCase); - CString result = - codec->encode(testCase, testCaseSize, QuestionMarksForUnencodables); - - EXPECT_STREQ("\xE6\xBC\xA2\xE5\xAD\x97", result.data()); -} - -} // namespace - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextCodecUTF16.cpp b/sky/engine/wtf/text/TextCodecUTF16.cpp deleted file mode 100644 index 2d6e690f46a5a..0000000000000 --- a/sky/engine/wtf/text/TextCodecUTF16.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2008, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextCodecUTF16.h" - -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/StringBuffer.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -using namespace std; - -namespace WTF { - -void TextCodecUTF16::registerEncodingNames(EncodingNameRegistrar registrar) { - registrar("UTF-16LE", "UTF-16LE"); - registrar("UTF-16BE", "UTF-16BE"); - - registrar("ISO-10646-UCS-2", "UTF-16LE"); - registrar("UCS-2", "UTF-16LE"); - registrar("UTF-16", "UTF-16LE"); - registrar("Unicode", "UTF-16LE"); - registrar("csUnicode", "UTF-16LE"); - registrar("unicodeFEFF", "UTF-16LE"); - - registrar("unicodeFFFE", "UTF-16BE"); -} - -static PassOwnPtr newStreamingTextDecoderUTF16LE(const TextEncoding&, - const void*) { - return adoptPtr(new TextCodecUTF16(true)); -} - -static PassOwnPtr newStreamingTextDecoderUTF16BE(const TextEncoding&, - const void*) { - return adoptPtr(new TextCodecUTF16(false)); -} - -void TextCodecUTF16::registerCodecs(TextCodecRegistrar registrar) { - registrar("UTF-16LE", newStreamingTextDecoderUTF16LE, 0); - registrar("UTF-16BE", newStreamingTextDecoderUTF16BE, 0); -} - -String TextCodecUTF16::decode(const char* bytes, - size_t length, - FlushBehavior flush, - bool, - bool& sawError) { - // For compatibility reasons, ignore flush from fetch EOF. - const bool reallyFlush = flush != DoNotFlush && flush != FetchEOF; - - if (!length) { - if (!reallyFlush || !m_haveBufferedByte) - return String(); - sawError = true; - return String(&Unicode::replacementCharacter, 1); - } - - // FIXME: This should generate an error if there is an unpaired surrogate. - - const unsigned char* p = reinterpret_cast(bytes); - size_t numBytes = length + m_haveBufferedByte; - size_t numCharsIn = numBytes / 2; - size_t numCharsOut = - ((numBytes & 1) && reallyFlush) ? numCharsIn + 1 : numCharsIn; - - StringBuffer buffer(numCharsOut); - UChar* q = buffer.characters(); - - if (m_haveBufferedByte) { - UChar c; - if (m_littleEndian) - c = m_bufferedByte | (p[0] << 8); - else - c = (m_bufferedByte << 8) | p[0]; - *q++ = c; - m_haveBufferedByte = false; - p += 1; - numCharsIn -= 1; - } - - if (m_littleEndian) { - for (size_t i = 0; i < numCharsIn; ++i) { - UChar c = p[0] | (p[1] << 8); - p += 2; - *q++ = c; - } - } else { - for (size_t i = 0; i < numCharsIn; ++i) { - UChar c = (p[0] << 8) | p[1]; - p += 2; - *q++ = c; - } - } - - if (numBytes & 1) { - ASSERT(!m_haveBufferedByte); - - if (reallyFlush) { - sawError = true; - *q++ = Unicode::replacementCharacter; - } else { - m_haveBufferedByte = true; - m_bufferedByte = p[0]; - } - } - - buffer.shrink(q - buffer.characters()); - - return String::adopt(buffer); -} - -CString TextCodecUTF16::encode(const UChar* characters, - size_t length, - UnencodableHandling) { - // We need to be sure we can double the length without overflowing. - // Since the passed-in length is the length of an actual existing - // character buffer, each character is two bytes, and we know - // the buffer doesn't occupy the entire address space, we can - // assert here that doubling the length does not overflow size_t - // and there's no need for a runtime check. - ASSERT(length <= numeric_limits::max() / 2); - - char* bytes; - CString result = CString::newUninitialized(length * 2, bytes); - - // FIXME: CString is not a reasonable data structure for encoded UTF-16, which - // will have null characters inside it. Perhaps the result of encode should - // not be a CString. - if (m_littleEndian) { - for (size_t i = 0; i < length; ++i) { - UChar c = characters[i]; - bytes[i * 2] = c; - bytes[i * 2 + 1] = c >> 8; - } - } else { - for (size_t i = 0; i < length; ++i) { - UChar c = characters[i]; - bytes[i * 2] = c >> 8; - bytes[i * 2 + 1] = c; - } - } - - return result; -} - -CString TextCodecUTF16::encode(const LChar* characters, - size_t length, - UnencodableHandling) { - // In the LChar case, we do actually need to perform this check in release. :) - RELEASE_ASSERT(length <= numeric_limits::max() / 2); - - char* bytes; - CString result = CString::newUninitialized(length * 2, bytes); - - if (m_littleEndian) { - for (size_t i = 0; i < length; ++i) { - bytes[i * 2] = characters[i]; - bytes[i * 2 + 1] = 0; - } - } else { - for (size_t i = 0; i < length; ++i) { - bytes[i * 2] = 0; - bytes[i * 2 + 1] = characters[i]; - } - } - - return result; -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextCodecUTF16.h b/sky/engine/wtf/text/TextCodecUTF16.h deleted file mode 100644 index 66f05fb4bdfef..0000000000000 --- a/sky/engine/wtf/text/TextCodecUTF16.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTCODECUTF16_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTCODECUTF16_H_ - -#include "flutter/sky/engine/wtf/text/TextCodec.h" - -namespace WTF { - -class TextCodecUTF16 final : public TextCodec { - public: - static void registerEncodingNames(EncodingNameRegistrar); - static void registerCodecs(TextCodecRegistrar); - - TextCodecUTF16(bool littleEndian) - : m_littleEndian(littleEndian), m_haveBufferedByte(false) {} - - virtual String decode(const char*, - size_t length, - FlushBehavior, - bool stopOnError, - bool& sawError) override; - virtual CString encode(const UChar*, - size_t length, - UnencodableHandling) override; - virtual CString encode(const LChar*, - size_t length, - UnencodableHandling) override; - - private: - bool m_littleEndian; - bool m_haveBufferedByte; - unsigned char m_bufferedByte; -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_TEXTCODECUTF16_H_ diff --git a/sky/engine/wtf/text/TextCodecUTF8.cpp b/sky/engine/wtf/text/TextCodecUTF8.cpp deleted file mode 100644 index faae30ba4a162..0000000000000 --- a/sky/engine/wtf/text/TextCodecUTF8.cpp +++ /dev/null @@ -1,480 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextCodecUTF8.h" - -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/StringBuffer.h" -#include "flutter/sky/engine/wtf/text/TextCodecASCIIFastPath.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -using namespace WTF; -using namespace WTF::Unicode; -using namespace std; - -namespace WTF { - -const int nonCharacter = -1; - -PassOwnPtr TextCodecUTF8::create(const TextEncoding&, const void*) { - return adoptPtr(new TextCodecUTF8); -} - -void TextCodecUTF8::registerEncodingNames(EncodingNameRegistrar registrar) { - registrar("UTF-8", "UTF-8"); - - // Additional aliases that originally were present in the encoding - // table in WebKit on Macintosh, and subsequently added by - // TextCodecICU. Perhaps we can prove some are not used on the web - // and remove them. - registrar("unicode11utf8", "UTF-8"); - registrar("unicode20utf8", "UTF-8"); - registrar("utf8", "UTF-8"); - registrar("x-unicode20utf8", "UTF-8"); - - // Additional aliases present in the WHATWG Encoding Standard - // (http://encoding.spec.whatwg.org/) and Firefox (24), but not in ICU 4.6. - registrar("unicode-1-1-utf-8", "UTF-8"); -} - -void TextCodecUTF8::registerCodecs(TextCodecRegistrar registrar) { - registrar("UTF-8", create, 0); -} - -static inline int nonASCIISequenceLength(uint8_t firstByte) { - static const uint8_t lengths[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - return lengths[firstByte]; -} - -static inline int decodeNonASCIISequence(const uint8_t* sequence, - unsigned length) { - ASSERT(!isASCII(sequence[0])); - if (length == 2) { - ASSERT(sequence[0] <= 0xDF); - if (sequence[0] < 0xC2) - return nonCharacter; - if (sequence[1] < 0x80 || sequence[1] > 0xBF) - return nonCharacter; - return ((sequence[0] << 6) + sequence[1]) - 0x00003080; - } - if (length == 3) { - ASSERT(sequence[0] >= 0xE0 && sequence[0] <= 0xEF); - switch (sequence[0]) { - case 0xE0: - if (sequence[1] < 0xA0 || sequence[1] > 0xBF) - return nonCharacter; - break; - case 0xED: - if (sequence[1] < 0x80 || sequence[1] > 0x9F) - return nonCharacter; - break; - default: - if (sequence[1] < 0x80 || sequence[1] > 0xBF) - return nonCharacter; - } - if (sequence[2] < 0x80 || sequence[2] > 0xBF) - return nonCharacter; - return ((sequence[0] << 12) + (sequence[1] << 6) + sequence[2]) - - 0x000E2080; - } - ASSERT(length == 4); - ASSERT(sequence[0] >= 0xF0 && sequence[0] <= 0xF4); - switch (sequence[0]) { - case 0xF0: - if (sequence[1] < 0x90 || sequence[1] > 0xBF) - return nonCharacter; - break; - case 0xF4: - if (sequence[1] < 0x80 || sequence[1] > 0x8F) - return nonCharacter; - break; - default: - if (sequence[1] < 0x80 || sequence[1] > 0xBF) - return nonCharacter; - } - if (sequence[2] < 0x80 || sequence[2] > 0xBF) - return nonCharacter; - if (sequence[3] < 0x80 || sequence[3] > 0xBF) - return nonCharacter; - return ((sequence[0] << 18) + (sequence[1] << 12) + (sequence[2] << 6) + - sequence[3]) - - 0x03C82080; -} - -static inline UChar* appendCharacter(UChar* destination, int character) { - ASSERT(character != nonCharacter); - ASSERT(!U_IS_SURROGATE(character)); - if (U_IS_BMP(character)) - *destination++ = character; - else { - *destination++ = U16_LEAD(character); - *destination++ = U16_TRAIL(character); - } - return destination; -} - -void TextCodecUTF8::consumePartialSequenceByte() { - --m_partialSequenceSize; - memmove(m_partialSequence, m_partialSequence + 1, m_partialSequenceSize); -} - -void TextCodecUTF8::handleError(UChar*& destination, - bool stopOnError, - bool& sawError) { - sawError = true; - if (stopOnError) - return; - // Each error generates a replacement character and consumes one byte. - *destination++ = replacementCharacter; - consumePartialSequenceByte(); -} - -template <> -bool TextCodecUTF8::handlePartialSequence(LChar*& destination, - const uint8_t*& source, - const uint8_t* end, - bool flush, - bool, - bool&) { - ASSERT(m_partialSequenceSize); - do { - if (isASCII(m_partialSequence[0])) { - *destination++ = m_partialSequence[0]; - consumePartialSequenceByte(); - continue; - } - int count = nonASCIISequenceLength(m_partialSequence[0]); - if (!count) - return true; - - if (count > m_partialSequenceSize) { - if (count - m_partialSequenceSize > end - source) { - if (!flush) { - // The new data is not enough to complete the sequence, so - // add it to the existing partial sequence. - memcpy(m_partialSequence + m_partialSequenceSize, source, - end - source); - m_partialSequenceSize += end - source; - return false; - } - // An incomplete partial sequence at the end is an error, but it will - // create a 16 bit string due to the replacementCharacter. Let the 16 - // bit path handle the error. - return true; - } - memcpy(m_partialSequence + m_partialSequenceSize, source, - count - m_partialSequenceSize); - source += count - m_partialSequenceSize; - m_partialSequenceSize = count; - } - int character = decodeNonASCIISequence(m_partialSequence, count); - if ((character == nonCharacter) || (character > 0xff)) - return true; - - m_partialSequenceSize -= count; - *destination++ = character; - } while (m_partialSequenceSize); - - return false; -} - -template <> -bool TextCodecUTF8::handlePartialSequence(UChar*& destination, - const uint8_t*& source, - const uint8_t* end, - bool flush, - bool stopOnError, - bool& sawError) { - ASSERT(m_partialSequenceSize); - do { - if (isASCII(m_partialSequence[0])) { - *destination++ = m_partialSequence[0]; - consumePartialSequenceByte(); - continue; - } - int count = nonASCIISequenceLength(m_partialSequence[0]); - if (!count) { - handleError(destination, stopOnError, sawError); - if (stopOnError) - return false; - continue; - } - if (count > m_partialSequenceSize) { - if (count - m_partialSequenceSize > end - source) { - if (!flush) { - // The new data is not enough to complete the sequence, so - // add it to the existing partial sequence. - memcpy(m_partialSequence + m_partialSequenceSize, source, - end - source); - m_partialSequenceSize += end - source; - return false; - } - // An incomplete partial sequence at the end is an error. - handleError(destination, stopOnError, sawError); - if (stopOnError) - return false; - continue; - } - memcpy(m_partialSequence + m_partialSequenceSize, source, - count - m_partialSequenceSize); - source += count - m_partialSequenceSize; - m_partialSequenceSize = count; - } - int character = decodeNonASCIISequence(m_partialSequence, count); - if (character == nonCharacter) { - handleError(destination, stopOnError, sawError); - if (stopOnError) - return false; - continue; - } - - m_partialSequenceSize -= count; - destination = appendCharacter(destination, character); - } while (m_partialSequenceSize); - - return false; -} - -String TextCodecUTF8::decode(const char* bytes, - size_t length, - FlushBehavior flush, - bool stopOnError, - bool& sawError) { - // Each input byte might turn into a character. - // That includes all bytes in the partial-sequence buffer because - // each byte in an invalid sequence will turn into a replacement character. - StringBuffer buffer(m_partialSequenceSize + length); - - const uint8_t* source = reinterpret_cast(bytes); - const uint8_t* end = source + length; - const uint8_t* alignedEnd = alignToMachineWord(end); - LChar* destination = buffer.characters(); - - do { - if (m_partialSequenceSize) { - // Explicitly copy destination and source pointers to avoid taking - // pointers to the local variables, which may harm code generation by - // disabling some optimizations in some compilers. - LChar* destinationForHandlePartialSequence = destination; - const uint8_t* sourceForHandlePartialSequence = source; - if (handlePartialSequence(destinationForHandlePartialSequence, - sourceForHandlePartialSequence, end, flush, - stopOnError, sawError)) { - source = sourceForHandlePartialSequence; - goto upConvertTo16Bit; - } - destination = destinationForHandlePartialSequence; - source = sourceForHandlePartialSequence; - if (m_partialSequenceSize) - break; - } - - while (source < end) { - if (isASCII(*source)) { - // Fast path for ASCII. Most UTF-8 text will be ASCII. - if (isAlignedToMachineWord(source)) { - while (source < alignedEnd) { - MachineWord chunk = - *reinterpret_cast_ptr(source); - if (!isAllASCII(chunk)) - break; - copyASCIIMachineWord(destination, source); - source += sizeof(MachineWord); - destination += sizeof(MachineWord); - } - if (source == end) - break; - if (!isASCII(*source)) - continue; - } - *destination++ = *source++; - continue; - } - int count = nonASCIISequenceLength(*source); - int character; - if (!count) - character = nonCharacter; - else { - if (count > end - source) { - ASSERT_WITH_SECURITY_IMPLICATION( - end - source < static_cast(sizeof(m_partialSequence))); - ASSERT(!m_partialSequenceSize); - m_partialSequenceSize = end - source; - memcpy(m_partialSequence, source, m_partialSequenceSize); - source = end; - break; - } - character = decodeNonASCIISequence(source, count); - } - if (character == nonCharacter) { - sawError = true; - if (stopOnError) - break; - - goto upConvertTo16Bit; - } - if (character > 0xff) - goto upConvertTo16Bit; - - source += count; - *destination++ = character; - } - } while (flush && m_partialSequenceSize); - - buffer.shrink(destination - buffer.characters()); - - return String::adopt(buffer); - -upConvertTo16Bit: - StringBuffer buffer16(m_partialSequenceSize + length); - - UChar* destination16 = buffer16.characters(); - - // Copy the already converted characters - for (LChar* converted8 = buffer.characters(); converted8 < destination;) - *destination16++ = *converted8++; - - do { - if (m_partialSequenceSize) { - // Explicitly copy destination and source pointers to avoid taking - // pointers to the local variables, which may harm code generation by - // disabling some optimizations in some compilers. - UChar* destinationForHandlePartialSequence = destination16; - const uint8_t* sourceForHandlePartialSequence = source; - handlePartialSequence(destinationForHandlePartialSequence, - sourceForHandlePartialSequence, end, flush, - stopOnError, sawError); - destination16 = destinationForHandlePartialSequence; - source = sourceForHandlePartialSequence; - if (m_partialSequenceSize) - break; - } - - while (source < end) { - if (isASCII(*source)) { - // Fast path for ASCII. Most UTF-8 text will be ASCII. - if (isAlignedToMachineWord(source)) { - while (source < alignedEnd) { - MachineWord chunk = - *reinterpret_cast_ptr(source); - if (!isAllASCII(chunk)) - break; - copyASCIIMachineWord(destination16, source); - source += sizeof(MachineWord); - destination16 += sizeof(MachineWord); - } - if (source == end) - break; - if (!isASCII(*source)) - continue; - } - *destination16++ = *source++; - continue; - } - int count = nonASCIISequenceLength(*source); - int character; - if (!count) - character = nonCharacter; - else { - if (count > end - source) { - ASSERT_WITH_SECURITY_IMPLICATION( - end - source < static_cast(sizeof(m_partialSequence))); - ASSERT(!m_partialSequenceSize); - m_partialSequenceSize = end - source; - memcpy(m_partialSequence, source, m_partialSequenceSize); - source = end; - break; - } - character = decodeNonASCIISequence(source, count); - } - if (character == nonCharacter) { - sawError = true; - if (stopOnError) - break; - // Each error generates a replacement character and consumes one byte. - *destination16++ = replacementCharacter; - ++source; - continue; - } - source += count; - destination16 = appendCharacter(destination16, character); - } - } while (flush && m_partialSequenceSize); - - buffer16.shrink(destination16 - buffer16.characters()); - - return String::adopt(buffer16); -} - -template -CString TextCodecUTF8::encodeCommon(const CharType* characters, size_t length) { - // The maximum number of UTF-8 bytes needed per UTF-16 code unit is 3. - // BMP characters take only one UTF-16 code unit and can take up to 3 bytes - // (3x). Non-BMP characters take two UTF-16 code units and can take up to 4 - // bytes (2x). - if (length > numeric_limits::max() / 3) - CRASH(); - Vector bytes(length * 3); - - size_t i = 0; - size_t bytesWritten = 0; - while (i < length) { - UChar32 character; - U16_NEXT(characters, i, length, character); - // U16_NEXT will simply emit a surrogate code point if an unmatched - // surrogate is encountered; we must convert it to a U+FFFD (REPLACEMENT - // CHARACTER) here. - if (0xD800 <= character && character <= 0xDFFF) - character = replacementCharacter; - U8_APPEND_UNSAFE(bytes.data(), bytesWritten, character); - } - - return CString(reinterpret_cast(bytes.data()), bytesWritten); -} - -CString TextCodecUTF8::encode(const UChar* characters, - size_t length, - UnencodableHandling) { - return encodeCommon(characters, length); -} - -CString TextCodecUTF8::encode(const LChar* characters, - size_t length, - UnencodableHandling) { - return encodeCommon(characters, length); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextCodecUTF8.h b/sky/engine/wtf/text/TextCodecUTF8.h deleted file mode 100644 index 8ebee98fc2581..0000000000000 --- a/sky/engine/wtf/text/TextCodecUTF8.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2011 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTCODECUTF8_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTCODECUTF8_H_ - -#include "flutter/sky/engine/wtf/text/TextCodec.h" - -namespace WTF { - -class TextCodecUTF8 : public TextCodec { - public: - static void registerEncodingNames(EncodingNameRegistrar); - static void registerCodecs(TextCodecRegistrar); - - protected: - TextCodecUTF8() : m_partialSequenceSize(0) {} - - private: - static PassOwnPtr create(const TextEncoding&, const void*); - - virtual String decode(const char*, - size_t length, - FlushBehavior, - bool stopOnError, - bool& sawError) override; - virtual CString encode(const UChar*, - size_t length, - UnencodableHandling) override; - virtual CString encode(const LChar*, - size_t length, - UnencodableHandling) override; - - template - CString encodeCommon(const CharType* characters, size_t length); - - template - bool handlePartialSequence(CharType*& destination, - const uint8_t*& source, - const uint8_t* end, - bool flush, - bool stopOnError, - bool& sawError); - void handleError(UChar*& destination, bool stopOnError, bool& sawError); - void consumePartialSequenceByte(); - - int m_partialSequenceSize; - uint8_t m_partialSequence[U8_MAX_LENGTH]; -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_TEXTCODECUTF8_H_ diff --git a/sky/engine/wtf/text/TextCodecUTF8Test.cpp b/sky/engine/wtf/text/TextCodecUTF8Test.cpp deleted file mode 100644 index 80f9be30478fd..0000000000000 --- a/sky/engine/wtf/text/TextCodecUTF8Test.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2013 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextCodecUTF8.h" - -#include -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/text/TextCodec.h" -#include "flutter/sky/engine/wtf/text/TextEncoding.h" -#include "flutter/sky/engine/wtf/text/TextEncodingRegistry.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -namespace { - -TEST(TextCodecUTF8, DecodeAscii) { - TextEncoding encoding("UTF-8"); - OwnPtr codec(newTextCodec(encoding)); - - const char testCase[] = "HelloWorld"; - size_t testCaseSize = sizeof(testCase) - 1; - - bool sawError = false; - const String& result = - codec->decode(testCase, testCaseSize, DataEOF, false, sawError); - EXPECT_FALSE(sawError); - ASSERT_EQ(testCaseSize, result.length()); - for (size_t i = 0; i < testCaseSize; ++i) { - EXPECT_EQ(testCase[i], result[i]); - } -} - -TEST(TextCodecUTF8, DecodeChineseCharacters) { - TextEncoding encoding("UTF-8"); - OwnPtr codec(newTextCodec(encoding)); - - // "Kanji" in Chinese characters. - const char testCase[] = "\xe6\xbc\xa2\xe5\xad\x97"; - size_t testCaseSize = sizeof(testCase) - 1; - - bool sawError = false; - const String& result = - codec->decode(testCase, testCaseSize, DataEOF, false, sawError); - EXPECT_FALSE(sawError); - ASSERT_EQ(2u, result.length()); - EXPECT_EQ(0x6f22U, result[0]); - EXPECT_EQ(0x5b57U, result[1]); -} - -TEST(TextCodecUTF8, Decode0xFF) { - TextEncoding encoding("UTF-8"); - OwnPtr codec(newTextCodec(encoding)); - - bool sawError = false; - const String& result = codec->decode("\xff", 1, DataEOF, false, sawError); - EXPECT_TRUE(sawError); - ASSERT_EQ(1u, result.length()); - EXPECT_EQ(0xFFFDU, result[0]); -} - -} // namespace - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextCodecUserDefined.cpp b/sky/engine/wtf/text/TextCodecUserDefined.cpp deleted file mode 100644 index aaa29385d6d86..0000000000000 --- a/sky/engine/wtf/text/TextCodecUserDefined.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Apple, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextCodecUserDefined.h" - -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/StringBuffer.h" -#include "flutter/sky/engine/wtf/text/StringBuilder.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -void TextCodecUserDefined::registerEncodingNames( - EncodingNameRegistrar registrar) { - registrar("x-user-defined", "x-user-defined"); -} - -static PassOwnPtr newStreamingTextDecoderUserDefined( - const TextEncoding&, - const void*) { - return adoptPtr(new TextCodecUserDefined); -} - -void TextCodecUserDefined::registerCodecs(TextCodecRegistrar registrar) { - registrar("x-user-defined", newStreamingTextDecoderUserDefined, 0); -} - -String TextCodecUserDefined::decode(const char* bytes, - size_t length, - FlushBehavior, - bool, - bool&) { - StringBuilder result; - result.reserveCapacity(length); - - for (size_t i = 0; i < length; ++i) { - signed char c = bytes[i]; - result.append(static_cast(c & 0xF7FF)); - } - - return result.toString(); -} - -template -static CString encodeComplexUserDefined(const CharType* characters, - size_t length, - UnencodableHandling handling) { - Vector result(length); - char* bytes = result.data(); - - size_t resultLength = 0; - for (size_t i = 0; i < length;) { - UChar32 c; - U16_NEXT(characters, i, length, c); - signed char signedByte = c; - if ((signedByte & 0xF7FF) == c) - bytes[resultLength++] = signedByte; - else { - // No way to encode this character with x-user-defined. - UnencodableReplacementArray replacement; - int replacementLength = - TextCodec::getUnencodableReplacement(c, handling, replacement); - result.grow(resultLength + replacementLength + length - i); - bytes = result.data(); - memcpy(bytes + resultLength, replacement, replacementLength); - resultLength += replacementLength; - } - } - - return CString(bytes, resultLength); -} - -template -CString TextCodecUserDefined::encodeCommon(const CharType* characters, - size_t length, - UnencodableHandling handling) { - char* bytes; - CString result = CString::newUninitialized(length, bytes); - - // Convert the string a fast way and simultaneously do an efficient check to - // see if it's all ASCII. - UChar ored = 0; - for (size_t i = 0; i < length; ++i) { - UChar c = characters[i]; - bytes[i] = c; - ored |= c; - } - - if (!(ored & 0xFF80)) - return result; - - // If it wasn't all ASCII, call the function that handles more-complex cases. - return encodeComplexUserDefined(characters, length, handling); -} - -CString TextCodecUserDefined::encode(const UChar* characters, - size_t length, - UnencodableHandling handling) { - return encodeCommon(characters, length, handling); -} - -CString TextCodecUserDefined::encode(const LChar* characters, - size_t length, - UnencodableHandling handling) { - return encodeCommon(characters, length, handling); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextCodecUserDefined.h b/sky/engine/wtf/text/TextCodecUserDefined.h deleted file mode 100644 index b67e30aa864b4..0000000000000 --- a/sky/engine/wtf/text/TextCodecUserDefined.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2007 Apple, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTCODECUSERDEFINED_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTCODECUSERDEFINED_H_ - -#include "flutter/sky/engine/wtf/text/TextCodec.h" - -namespace WTF { - -class TextCodecUserDefined final : public TextCodec { - public: - static void registerEncodingNames(EncodingNameRegistrar); - static void registerCodecs(TextCodecRegistrar); - - private: - virtual String decode(const char*, - size_t length, - FlushBehavior, - bool stopOnError, - bool& sawError) override; - virtual CString encode(const UChar*, - size_t length, - UnencodableHandling) override; - virtual CString encode(const LChar*, - size_t length, - UnencodableHandling) override; - - template - CString encodeCommon(const CharType*, size_t length, UnencodableHandling); -}; - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_TEXT_TEXTCODECUSERDEFINED_H_ diff --git a/sky/engine/wtf/text/TextEncoding.cpp b/sky/engine/wtf/text/TextEncoding.cpp deleted file mode 100644 index 44ccc36e39da1..0000000000000 --- a/sky/engine/wtf/text/TextEncoding.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2006 Alexey Proskuryakov - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextEncoding.h" - -#include -#include "flutter/sky/engine/wtf/OwnPtr.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/TextEncodingRegistry.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -static const TextEncoding& UTF7Encoding() { - static TextEncoding globalUTF7Encoding("UTF-7"); - return globalUTF7Encoding; -} - -TextEncoding::TextEncoding(const char* name) - : m_name(atomicCanonicalTextEncodingName(name)) { - // Aliases are valid, but not "replacement" itself. - if (m_name && isReplacementEncoding(name)) - m_name = 0; -} - -TextEncoding::TextEncoding(const String& name) - : m_name(atomicCanonicalTextEncodingName(name)) { - // Aliases are valid, but not "replacement" itself. - if (m_name && isReplacementEncoding(name)) - m_name = 0; -} - -String TextEncoding::decode(const char* data, - size_t length, - bool stopOnError, - bool& sawError) const { - if (!m_name) - return String(); - - return newTextCodec(*this)->decode(data, length, DataEOF, stopOnError, - sawError); -} - -CString TextEncoding::encode(const String& string, - UnencodableHandling handling) const { - if (!m_name) - return CString(); - - if (string.isEmpty()) - return ""; - - OwnPtr textCodec = newTextCodec(*this); - CString encodedString; - if (string.is8Bit()) - encodedString = - textCodec->encode(string.characters8(), string.length(), handling); - else - encodedString = - textCodec->encode(string.characters16(), string.length(), handling); - return encodedString; -} - -CString TextEncoding::normalizeAndEncode(const String& string, - UnencodableHandling handling) const { - if (!m_name) - return CString(); - - if (string.isEmpty()) - return ""; - - // Text exclusively containing Latin-1 characters (U+0000..U+00FF) is left - // unaffected by NFC. This is effectively the same as saying that all - // Latin-1 text is already normalized to NFC. - // Source: http://unicode.org/reports/tr15/ - if (string.is8Bit()) - return newTextCodec(*this)->encode(string.characters8(), string.length(), - handling); - - const UChar* source = string.characters16(); - size_t length = string.length(); - - Vector normalizedCharacters; - - UErrorCode err = U_ZERO_ERROR; - if (unorm_quickCheck(source, length, UNORM_NFC, &err) != UNORM_YES) { - // First try using the length of the original string, since normalization to - // NFC rarely increases length. - normalizedCharacters.grow(length); - int32_t normalizedLength = - unorm_normalize(source, length, UNORM_NFC, 0, - normalizedCharacters.data(), length, &err); - if (err == U_BUFFER_OVERFLOW_ERROR) { - err = U_ZERO_ERROR; - normalizedCharacters.resize(normalizedLength); - normalizedLength = - unorm_normalize(source, length, UNORM_NFC, 0, - normalizedCharacters.data(), normalizedLength, &err); - } - ASSERT(U_SUCCESS(err)); - - source = normalizedCharacters.data(); - length = normalizedLength; - } - - return newTextCodec(*this)->encode(source, length, handling); -} - -bool TextEncoding::usesVisualOrdering() const { - if (noExtendedTextEncodingNameUsed()) - return false; - - static const char* const a = atomicCanonicalTextEncodingName("ISO-8859-8"); - return m_name == a; -} - -bool TextEncoding::isNonByteBasedEncoding() const { - if (noExtendedTextEncodingNameUsed()) { - return *this == UTF16LittleEndianEncoding() || - *this == UTF16BigEndianEncoding(); - } - - return *this == UTF16LittleEndianEncoding() || - *this == UTF16BigEndianEncoding() || - *this == UTF32BigEndianEncoding() || - *this == UTF32LittleEndianEncoding(); -} - -bool TextEncoding::isUTF7Encoding() const { - if (noExtendedTextEncodingNameUsed()) - return false; - - return *this == UTF7Encoding(); -} - -const TextEncoding& TextEncoding::closestByteBasedEquivalent() const { - if (isNonByteBasedEncoding()) - return UTF8Encoding(); - return *this; -} - -// HTML5 specifies that UTF-8 be used in form submission when a form is -// is a part of a document in UTF-16 probably because UTF-16 is not a -// byte-based encoding and can contain 0x00. By extension, the same -// should be done for UTF-32. In case of UTF-7, it is a byte-based encoding, -// but it's fraught with problems and we'd rather steer clear of it. -const TextEncoding& TextEncoding::encodingForFormSubmission() const { - if (isNonByteBasedEncoding() || isUTF7Encoding()) - return UTF8Encoding(); - return *this; -} - -const TextEncoding& ASCIIEncoding() { - static TextEncoding globalASCIIEncoding("ASCII"); - return globalASCIIEncoding; -} - -const TextEncoding& Latin1Encoding() { - static TextEncoding globalLatin1Encoding("latin1"); - return globalLatin1Encoding; -} - -const TextEncoding& UTF16BigEndianEncoding() { - static TextEncoding globalUTF16BigEndianEncoding("UTF-16BE"); - return globalUTF16BigEndianEncoding; -} - -const TextEncoding& UTF16LittleEndianEncoding() { - static TextEncoding globalUTF16LittleEndianEncoding("UTF-16LE"); - return globalUTF16LittleEndianEncoding; -} - -const TextEncoding& UTF32BigEndianEncoding() { - static TextEncoding globalUTF32BigEndianEncoding("UTF-32BE"); - return globalUTF32BigEndianEncoding; -} - -const TextEncoding& UTF32LittleEndianEncoding() { - static TextEncoding globalUTF32LittleEndianEncoding("UTF-32LE"); - return globalUTF32LittleEndianEncoding; -} - -const TextEncoding& UTF8Encoding() { - static TextEncoding globalUTF8Encoding("UTF-8"); - ASSERT(globalUTF8Encoding.isValid()); - return globalUTF8Encoding; -} - -const TextEncoding& WindowsLatin1Encoding() { - static TextEncoding globalWindowsLatin1Encoding("WinLatin1"); - return globalWindowsLatin1Encoding; -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextEncoding.h b/sky/engine/wtf/text/TextEncoding.h deleted file mode 100644 index a74f01b8fce17..0000000000000 --- a/sky/engine/wtf/text/TextEncoding.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTENCODING_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTENCODING_H_ - -#include "flutter/sky/engine/wtf/Forward.h" -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/text/TextCodec.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace WTF { - -class WTF_EXPORT TextEncoding { - public: - TextEncoding() : m_name(0) {} - TextEncoding(const char* name); - TextEncoding(const String& name); - - bool isValid() const { return m_name; } - const char* name() const { return m_name; } - bool usesVisualOrdering() const; - const TextEncoding& closestByteBasedEquivalent() const; - const TextEncoding& encodingForFormSubmission() const; - - String decode(const char* str, size_t length) const { - bool ignored; - return decode(str, length, false, ignored); - } - String decode(const char*, - size_t length, - bool stopOnError, - bool& sawError) const; - - // Encodes the string, but does *not* normalize first. - CString encode(const String&, UnencodableHandling) const; - - // Applies Unicode NFC normalization, then encodes the normalized string. - CString normalizeAndEncode(const String&, UnencodableHandling) const; - - private: - bool isNonByteBasedEncoding() const; - bool isUTF7Encoding() const; - - const char* m_name; -}; - -inline bool operator==(const TextEncoding& a, const TextEncoding& b) { - return a.name() == b.name(); -} -inline bool operator!=(const TextEncoding& a, const TextEncoding& b) { - return a.name() != b.name(); -} - -WTF_EXPORT const TextEncoding& ASCIIEncoding(); -WTF_EXPORT const TextEncoding& Latin1Encoding(); -WTF_EXPORT const TextEncoding& UTF16BigEndianEncoding(); -WTF_EXPORT const TextEncoding& UTF16LittleEndianEncoding(); -WTF_EXPORT const TextEncoding& UTF32BigEndianEncoding(); -WTF_EXPORT const TextEncoding& UTF32LittleEndianEncoding(); -WTF_EXPORT const TextEncoding& UTF8Encoding(); -WTF_EXPORT const TextEncoding& WindowsLatin1Encoding(); - -} // namespace WTF - -using WTF::ASCIIEncoding; -using WTF::Latin1Encoding; -using WTF::UTF16BigEndianEncoding; -using WTF::UTF16LittleEndianEncoding; -using WTF::UTF32BigEndianEncoding; -using WTF::UTF32LittleEndianEncoding; -using WTF::UTF8Encoding; -using WTF::WindowsLatin1Encoding; - -#endif // SKY_ENGINE_WTF_TEXT_TEXTENCODING_H_ diff --git a/sky/engine/wtf/text/TextEncodingRegistry.cpp b/sky/engine/wtf/text/TextEncodingRegistry.cpp deleted file mode 100644 index d8dcd4086b79f..0000000000000 --- a/sky/engine/wtf/text/TextEncodingRegistry.cpp +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextEncodingRegistry.h" - -#include "flutter/sky/engine/wtf/ASCIICType.h" -#include "flutter/sky/engine/wtf/HashMap.h" -#include "flutter/sky/engine/wtf/HashSet.h" -#include "flutter/sky/engine/wtf/MainThread.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" -#include "flutter/sky/engine/wtf/StringExtras.h" -#include "flutter/sky/engine/wtf/ThreadingPrimitives.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/TextCodecICU.h" -#include "flutter/sky/engine/wtf/text/TextCodecLatin1.h" -#include "flutter/sky/engine/wtf/text/TextCodecReplacement.h" -#include "flutter/sky/engine/wtf/text/TextCodecUTF16.h" -#include "flutter/sky/engine/wtf/text/TextCodecUTF8.h" -#include "flutter/sky/engine/wtf/text/TextCodecUserDefined.h" -#include "flutter/sky/engine/wtf/text/TextEncoding.h" - -namespace WTF { - -const size_t maxEncodingNameLength = 63; - -// Hash for all-ASCII strings that does case folding. -struct TextEncodingNameHash { - static bool equal(const char* s1, const char* s2) { - char c1; - char c2; - do { -#if defined(_MSC_FULL_VER) && _MSC_FULL_VER == 170051106 - // Workaround for a bug in the VS2012 Update 1 optimizer, remove once the - // fix is released. - // https://connect.microsoft.com/VisualStudio/feedback/details/777533/vs2012-c-optimizing-bug-when-using-inline-and-char-return-type-x86-target-only - c1 = toASCIILower(*s1++); - c2 = toASCIILower(*s2++); - if (c1 != c2) - return false; -#else - c1 = *s1++; - c2 = *s2++; - if (toASCIILower(c1) != toASCIILower(c2)) - return false; -#endif - } while (c1 && c2); - return !c1 && !c2; - } - - // This algorithm is the one-at-a-time hash from: - // http://burtleburtle.net/bob/hash/hashfaq.html - // http://burtleburtle.net/bob/hash/doobs.html - static unsigned hash(const char* s) { - unsigned h = WTF::stringHashingStartValue; - for (;;) { - char c = *s++; - if (!c) { - h += (h << 3); - h ^= (h >> 11); - h += (h << 15); - return h; - } - h += toASCIILower(c); - h += (h << 10); - h ^= (h >> 6); - } - } - - static const bool safeToCompareToEmptyOrDeleted = false; -}; - -struct TextCodecFactory { - NewTextCodecFunction function; - const void* additionalData; - TextCodecFactory(NewTextCodecFunction f = 0, const void* d = 0) - : function(f), additionalData(d) {} -}; - -typedef HashMap - TextEncodingNameMap; -typedef HashMap TextCodecMap; - -static Mutex& encodingRegistryMutex() { - // We don't have to use AtomicallyInitializedStatic here because - // this function is called on the main thread for any page before - // it is used in worker threads. - DEFINE_STATIC_LOCAL(Mutex, mutex, ()); - return mutex; -} - -static TextEncodingNameMap* textEncodingNameMap; -static TextCodecMap* textCodecMap; -static bool didExtendTextCodecMaps; - -static const char textEncodingNameBlacklist[][6] = {"UTF-7"}; - -#if ERROR_DISABLED - -static inline void checkExistingName(const char*, const char*) {} - -#else - -static void checkExistingName(const char* alias, const char* atomicName) { - const char* oldAtomicName = textEncodingNameMap->get(alias); - if (!oldAtomicName) - return; - if (oldAtomicName == atomicName) - return; - // Keep the warning silent about one case where we know this will happen. - if (strcmp(alias, "ISO-8859-8-I") == 0 && - strcmp(oldAtomicName, "ISO-8859-8-I") == 0 && - strcasecmp(atomicName, "iso-8859-8") == 0) - return; - WTF_LOG_ERROR( - "alias %s maps to %s already, but someone is trying to make it map to %s", - alias, oldAtomicName, atomicName); -} - -#endif - -static bool isUndesiredAlias(const char* alias) { - // Reject aliases with version numbers that are supported by some back-ends - // (such as "ISO_2022,locale=ja,version=0" in ICU). - for (const char* p = alias; *p; ++p) { - if (*p == ',') - return true; - } - // 8859_1 is known to (at least) ICU, but other browsers don't support this - // name - and having it caused a compatibility problem, see bug 43554. - if (0 == strcmp(alias, "8859_1")) - return true; - return false; -} - -static void addToTextEncodingNameMap(const char* alias, const char* name) { - ASSERT(strlen(alias) <= maxEncodingNameLength); - if (isUndesiredAlias(alias)) - return; - const char* atomicName = textEncodingNameMap->get(name); - ASSERT(strcmp(alias, name) == 0 || atomicName); - if (!atomicName) - atomicName = name; - checkExistingName(alias, atomicName); - textEncodingNameMap->add(alias, atomicName); -} - -static void addToTextCodecMap(const char* name, - NewTextCodecFunction function, - const void* additionalData) { - const char* atomicName = textEncodingNameMap->get(name); - ASSERT(atomicName); - textCodecMap->add(atomicName, TextCodecFactory(function, additionalData)); -} - -static void pruneBlacklistedCodecs() { - for (size_t i = 0; i < WTF_ARRAY_LENGTH(textEncodingNameBlacklist); ++i) { - const char* atomicName = - textEncodingNameMap->get(textEncodingNameBlacklist[i]); - if (!atomicName) - continue; - - Vector names; - TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); - TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); - for (; it != end; ++it) { - if (it->value == atomicName) - names.append(it->key); - } - - textEncodingNameMap->removeAll(names); - - textCodecMap->remove(atomicName); - } -} - -static void buildBaseTextCodecMaps() { - ASSERT(isMainThread()); - ASSERT(!textCodecMap); - ASSERT(!textEncodingNameMap); - - textCodecMap = new TextCodecMap; - textEncodingNameMap = new TextEncodingNameMap; - - TextCodecLatin1::registerEncodingNames(addToTextEncodingNameMap); - TextCodecLatin1::registerCodecs(addToTextCodecMap); - - TextCodecUTF8::registerEncodingNames(addToTextEncodingNameMap); - TextCodecUTF8::registerCodecs(addToTextCodecMap); - - TextCodecUTF16::registerEncodingNames(addToTextEncodingNameMap); - TextCodecUTF16::registerCodecs(addToTextCodecMap); - - TextCodecUserDefined::registerEncodingNames(addToTextEncodingNameMap); - TextCodecUserDefined::registerCodecs(addToTextCodecMap); -} - -bool isReplacementEncoding(const char* alias) { - return alias && !strcasecmp(alias, "replacement"); -} - -bool isReplacementEncoding(const String& alias) { - return alias == "replacement"; -} - -static void extendTextCodecMaps() { - TextCodecReplacement::registerEncodingNames(addToTextEncodingNameMap); - TextCodecReplacement::registerCodecs(addToTextCodecMap); - - TextCodecICU::registerEncodingNames(addToTextEncodingNameMap); - TextCodecICU::registerCodecs(addToTextCodecMap); - - pruneBlacklistedCodecs(); -} - -PassOwnPtr newTextCodec(const TextEncoding& encoding) { - MutexLocker lock(encodingRegistryMutex()); - - ASSERT(textCodecMap); - TextCodecFactory factory = textCodecMap->get(encoding.name()); - ASSERT(factory.function); - return factory.function(encoding, factory.additionalData); -} - -const char* atomicCanonicalTextEncodingName(const char* name) { - if (!name || !name[0]) - return 0; - if (!textEncodingNameMap) - buildBaseTextCodecMaps(); - - MutexLocker lock(encodingRegistryMutex()); - - if (const char* atomicName = textEncodingNameMap->get(name)) - return atomicName; - if (didExtendTextCodecMaps) - return 0; - extendTextCodecMaps(); - didExtendTextCodecMaps = true; - return textEncodingNameMap->get(name); -} - -template -const char* atomicCanonicalTextEncodingName(const CharacterType* characters, - size_t length) { - char buffer[maxEncodingNameLength + 1]; - size_t j = 0; - for (size_t i = 0; i < length; ++i) { - CharacterType c = characters[i]; - if (j == maxEncodingNameLength) - return 0; - buffer[j++] = c; - } - buffer[j] = 0; - return atomicCanonicalTextEncodingName(buffer); -} - -const char* atomicCanonicalTextEncodingName(const String& alias) { - if (!alias.length()) - return 0; - - if (alias.is8Bit()) - return atomicCanonicalTextEncodingName(alias.characters8(), - alias.length()); - - return atomicCanonicalTextEncodingName(alias.characters16(), - alias.length()); -} - -bool noExtendedTextEncodingNameUsed() { - // If the calling thread did not use extended encoding names, it is fine for - // it to use a stale false value. - return !didExtendTextCodecMaps; -} - -#ifndef NDEBUG -void dumpTextEncodingNameMap() { - unsigned size = textEncodingNameMap->size(); - fprintf(stderr, "Dumping %u entries in WTF::TextEncodingNameMap...\n", size); - - MutexLocker lock(encodingRegistryMutex()); - - TextEncodingNameMap::const_iterator it = textEncodingNameMap->begin(); - TextEncodingNameMap::const_iterator end = textEncodingNameMap->end(); - for (; it != end; ++it) - fprintf(stderr, "'%s' => '%s'\n", it->key, it->value); -} -#endif - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextEncodingRegistry.h b/sky/engine/wtf/text/TextEncodingRegistry.h deleted file mode 100644 index 9a9ee91bb1111..0000000000000 --- a/sky/engine/wtf/text/TextEncodingRegistry.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTENCODINGREGISTRY_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTENCODINGREGISTRY_H_ - -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace WTF { - -class TextCodec; -class TextEncoding; - -// Use TextResourceDecoder::decode to decode resources, since it handles BOMs. -// Use TextEncoding::encode to encode, since it takes care of normalization. -WTF_EXPORT PassOwnPtr newTextCodec(const TextEncoding&); - -// Only TextEncoding should use the following functions directly. -const char* atomicCanonicalTextEncodingName(const char* alias); -template -const char* atomicCanonicalTextEncodingName(const CharacterType*, size_t); -const char* atomicCanonicalTextEncodingName(const String&); -bool noExtendedTextEncodingNameUsed(); -bool isReplacementEncoding(const char* alias); -bool isReplacementEncoding(const String& alias); - -#ifndef NDEBUG -void dumpTextEncodingNameMap(); -#endif - -} // namespace WTF - -using WTF::atomicCanonicalTextEncodingName; -using WTF::newTextCodec; -using WTF::noExtendedTextEncodingNameUsed; -#ifndef NDEBUG -using WTF::dumpTextEncodingNameMap; -#endif - -#endif // SKY_ENGINE_WTF_TEXT_TEXTENCODINGREGISTRY_H_ diff --git a/sky/engine/wtf/text/TextPosition.cpp b/sky/engine/wtf/text/TextPosition.cpp deleted file mode 100644 index b2476710affdf..0000000000000 --- a/sky/engine/wtf/text/TextPosition.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2013, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/text/TextPosition.h" - -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/StdLibExtras.h" - -namespace WTF { - -PassOwnPtr> lineEndings(const String& text) { - OwnPtr> result(adoptPtr(new Vector())); - - unsigned start = 0; - while (start < text.length()) { - size_t lineEnd = text.find('\n', start); - if (lineEnd == kNotFound) - break; - - result->append(static_cast(lineEnd)); - start = lineEnd + 1; - } - result->append(text.length()); - - return result.release(); -} - -OrdinalNumber TextPosition::toOffset(const Vector& lineEndings) { - unsigned lineStartOffset = m_line != OrdinalNumber::first() - ? lineEndings.at(m_line.zeroBasedInt() - 1) + 1 - : 0; - return OrdinalNumber::fromZeroBasedInt(lineStartOffset + - m_column.zeroBasedInt()); -} - -TextPosition TextPosition::fromOffsetAndLineEndings( - unsigned offset, - const Vector& lineEndings) { - const unsigned* foundLineEnding = - std::lower_bound(lineEndings.begin(), lineEndings.end(), offset); - int lineIndex = foundLineEnding - &lineEndings.at(0); - unsigned lineStartOffset = - lineIndex > 0 ? lineEndings.at(lineIndex - 1) + 1 : 0; - int column = offset - lineStartOffset; - return TextPosition(OrdinalNumber::fromZeroBasedInt(lineIndex), - OrdinalNumber::fromZeroBasedInt(column)); -} - -} // namespace WTF diff --git a/sky/engine/wtf/text/TextPosition.h b/sky/engine/wtf/text/TextPosition.h deleted file mode 100644 index cc284c2295a72..0000000000000 --- a/sky/engine/wtf/text/TextPosition.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2010, Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_TEXT_TEXTPOSITION_H_ -#define SKY_ENGINE_WTF_TEXT_TEXTPOSITION_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace WTF { - -// An abstract number of element in a sequence. The sequence has a first -// element. This type should be used instead of integer because 2 contradicting -// traditions can call a first element '0' or '1' which makes integer type -// ambiguous. -class OrdinalNumber { - public: - static OrdinalNumber fromZeroBasedInt(int zeroBasedInt) { - return OrdinalNumber(zeroBasedInt); - } - static OrdinalNumber fromOneBasedInt(int oneBasedInt) { - return OrdinalNumber(oneBasedInt - 1); - } - OrdinalNumber() : m_zeroBasedValue(0) {} - - int zeroBasedInt() const { return m_zeroBasedValue; } - int oneBasedInt() const { return m_zeroBasedValue + 1; } - - bool operator==(OrdinalNumber other) { - return m_zeroBasedValue == other.m_zeroBasedValue; - } - bool operator!=(OrdinalNumber other) { return !((*this) == other); } - - static OrdinalNumber first() { return OrdinalNumber(0); } - static OrdinalNumber beforeFirst() { return OrdinalNumber(-1); } - - private: - OrdinalNumber(int zeroBasedInt) : m_zeroBasedValue(zeroBasedInt) {} - int m_zeroBasedValue; -}; - -// TextPosition structure specifies coordinates within an text resource. It is -// used mostly for saving script source position. -class TextPosition { - public: - TextPosition(OrdinalNumber line, OrdinalNumber column) - : m_line(line), m_column(column) {} - TextPosition() {} - bool operator==(const TextPosition& other) { - return m_line == other.m_line && m_column == other.m_column; - } - bool operator!=(const TextPosition& other) { return !((*this) == other); } - WTF_EXPORT OrdinalNumber toOffset(const Vector&); - - // A 'minimum' value of position, used as a default value. - static TextPosition minimumPosition() { - return TextPosition(OrdinalNumber::first(), OrdinalNumber::first()); - } - - // A value with line value less than a minimum; used as an impossible - // position. - static TextPosition belowRangePosition() { - return TextPosition(OrdinalNumber::beforeFirst(), - OrdinalNumber::beforeFirst()); - } - - // A value corresponding to a position with given offset within text having - // the specified line ending offsets. - WTF_EXPORT static TextPosition fromOffsetAndLineEndings( - unsigned, - const Vector&); - - OrdinalNumber m_line; - OrdinalNumber m_column; -}; - -WTF_EXPORT PassOwnPtr> lineEndings(const String&); - -} // namespace WTF - -using WTF::OrdinalNumber; - -using WTF::TextPosition; - -using WTF::lineEndings; - -#endif // SKY_ENGINE_WTF_TEXT_TEXTPOSITION_H_ diff --git a/sky/engine/wtf/text/WTFString.cpp b/sky/engine/wtf/text/WTFString.cpp deleted file mode 100644 index fe461cc3da440..0000000000000 --- a/sky/engine/wtf/text/WTFString.cpp +++ /dev/null @@ -1,1280 +0,0 @@ -/* - * (C) 1999 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. - * All rights reserved. - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "flutter/sky/engine/wtf/text/WTFString.h" - -#include -#include "flutter/sky/engine/wtf/ASCIICType.h" -#include "flutter/sky/engine/wtf/DataLog.h" -#include "flutter/sky/engine/wtf/HexNumber.h" -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/StringExtras.h" -#include "flutter/sky/engine/wtf/Vector.h" -#include "flutter/sky/engine/wtf/dtoa.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/IntegerToStringConversion.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" -#include "flutter/sky/engine/wtf/unicode/UTF8.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -using namespace std; - -namespace WTF { - -using namespace Unicode; -using namespace std; - -// Construct a string with UTF-16 data. -String::String(const UChar* characters, unsigned length) - : m_impl(characters ? StringImpl::create(characters, length) : nullptr) {} - -// Construct a string with UTF-16 data, from a null-terminated source. -String::String(const UChar* str) { - if (!str) - return; - m_impl = StringImpl::create(str, lengthOfNullTerminatedString(str)); -} - -// Construct a string with latin1 data. -String::String(const LChar* characters, unsigned length) - : m_impl(characters ? StringImpl::create(characters, length) : nullptr) {} - -String::String(const char* characters, unsigned length) - : m_impl(characters ? StringImpl::create( - reinterpret_cast(characters), - length) - : nullptr) {} - -// Construct a string with latin1 data, from a null-terminated source. -String::String(const LChar* characters) - : m_impl(characters ? StringImpl::create(characters) : nullptr) {} - -String::String(const char* characters) - : m_impl(characters ? StringImpl::create( - reinterpret_cast(characters)) - : nullptr) {} - -void String::append(const String& string) { - if (string.isEmpty()) - return; - if (!m_impl) { - m_impl = string.m_impl; - return; - } - - // FIXME: This is extremely inefficient. So much so that we might want to take - // this out of String's API. We can make it better by optimizing the case - // where exactly one String is pointing at this StringImpl, but even then it's - // going to require a call into the allocator every single time. - - if (m_impl->is8Bit() && string.m_impl->is8Bit()) { - LChar* data; - RELEASE_ASSERT(string.length() <= - numeric_limits::max() - m_impl->length()); - RefPtr newImpl = StringImpl::createUninitialized( - m_impl->length() + string.length(), data); - memcpy(data, m_impl->characters8(), m_impl->length() * sizeof(LChar)); - memcpy(data + m_impl->length(), string.characters8(), - string.length() * sizeof(LChar)); - m_impl = newImpl.release(); - return; - } - - UChar* data; - RELEASE_ASSERT(string.length() <= - numeric_limits::max() - m_impl->length()); - RefPtr newImpl = - StringImpl::createUninitialized(m_impl->length() + string.length(), data); - - if (m_impl->is8Bit()) - StringImpl::copyChars(data, m_impl->characters8(), m_impl->length()); - else - StringImpl::copyChars(data, m_impl->characters16(), m_impl->length()); - - if (string.impl()->is8Bit()) - StringImpl::copyChars(data + m_impl->length(), string.impl()->characters8(), - string.impl()->length()); - else - StringImpl::copyChars(data + m_impl->length(), - string.impl()->characters16(), - string.impl()->length()); - - m_impl = newImpl.release(); -} - -template -inline void String::appendInternal(CharacterType c) { - // FIXME: This is extremely inefficient. So much so that we might want to take - // this out of String's API. We can make it better by optimizing the case - // where exactly one String is pointing at this StringImpl, but even then it's - // going to require a call into the allocator every single time. - if (!m_impl) { - m_impl = StringImpl::create(&c, 1); - return; - } - - UChar* data; // FIXME: We should be able to create an 8 bit string via this - // code path. - RELEASE_ASSERT(m_impl->length() < numeric_limits::max()); - RefPtr newImpl = - StringImpl::createUninitialized(m_impl->length() + 1, data); - if (m_impl->is8Bit()) - StringImpl::copyChars(data, m_impl->characters8(), m_impl->length()); - else - StringImpl::copyChars(data, m_impl->characters16(), m_impl->length()); - data[m_impl->length()] = c; - m_impl = newImpl.release(); -} - -void String::append(LChar c) { - appendInternal(c); -} - -void String::append(UChar c) { - appendInternal(c); -} - -int codePointCompare(const String& a, const String& b) { - return codePointCompare(a.impl(), b.impl()); -} - -void String::insert(const String& string, unsigned position) { - if (string.isEmpty()) { - if (string.isNull()) - return; - if (isNull()) - m_impl = string.impl(); - return; - } - - if (string.is8Bit()) - insert(string.impl()->characters8(), string.length(), position); - else - insert(string.impl()->characters16(), string.length(), position); -} - -void String::append(const LChar* charactersToAppend, unsigned lengthToAppend) { - if (!m_impl) { - if (!charactersToAppend) - return; - m_impl = StringImpl::create(charactersToAppend, lengthToAppend); - return; - } - - if (!lengthToAppend) - return; - - ASSERT(charactersToAppend); - - unsigned strLength = m_impl->length(); - - if (m_impl->is8Bit()) { - RELEASE_ASSERT(lengthToAppend <= - numeric_limits::max() - strLength); - LChar* data; - RefPtr newImpl = - StringImpl::createUninitialized(strLength + lengthToAppend, data); - StringImpl::copyChars(data, m_impl->characters8(), strLength); - StringImpl::copyChars(data + strLength, charactersToAppend, lengthToAppend); - m_impl = newImpl.release(); - return; - } - - RELEASE_ASSERT(lengthToAppend <= numeric_limits::max() - strLength); - UChar* data; - RefPtr newImpl = - StringImpl::createUninitialized(length() + lengthToAppend, data); - StringImpl::copyChars(data, m_impl->characters16(), strLength); - StringImpl::copyChars(data + strLength, charactersToAppend, lengthToAppend); - m_impl = newImpl.release(); -} - -void String::append(const UChar* charactersToAppend, unsigned lengthToAppend) { - if (!m_impl) { - if (!charactersToAppend) - return; - m_impl = StringImpl::create(charactersToAppend, lengthToAppend); - return; - } - - if (!lengthToAppend) - return; - - unsigned strLength = m_impl->length(); - - ASSERT(charactersToAppend); - RELEASE_ASSERT(lengthToAppend <= numeric_limits::max() - strLength); - UChar* data; - RefPtr newImpl = - StringImpl::createUninitialized(strLength + lengthToAppend, data); - if (m_impl->is8Bit()) - StringImpl::copyChars(data, characters8(), strLength); - else - StringImpl::copyChars(data, characters16(), strLength); - StringImpl::copyChars(data + strLength, charactersToAppend, lengthToAppend); - m_impl = newImpl.release(); -} - -template -PassRefPtr insertInternal(PassRefPtr impl, - const CharType* charactersToInsert, - unsigned lengthToInsert, - unsigned position) { - if (!lengthToInsert) - return impl; - - ASSERT(charactersToInsert); - UChar* data; // FIXME: We should be able to create an 8 bit string here. - RELEASE_ASSERT(lengthToInsert <= - numeric_limits::max() - impl->length()); - RefPtr newImpl = - StringImpl::createUninitialized(impl->length() + lengthToInsert, data); - - if (impl->is8Bit()) - StringImpl::copyChars(data, impl->characters8(), position); - else - StringImpl::copyChars(data, impl->characters16(), position); - - StringImpl::copyChars(data + position, charactersToInsert, lengthToInsert); - - if (impl->is8Bit()) - StringImpl::copyChars(data + position + lengthToInsert, - impl->characters8() + position, - impl->length() - position); - else - StringImpl::copyChars(data + position + lengthToInsert, - impl->characters16() + position, - impl->length() - position); - - return newImpl.release(); -} - -void String::insert(const UChar* charactersToInsert, - unsigned lengthToInsert, - unsigned position) { - if (position >= length()) { - append(charactersToInsert, lengthToInsert); - return; - } - ASSERT(m_impl); - m_impl = insertInternal(m_impl.release(), charactersToInsert, lengthToInsert, - position); -} - -void String::insert(const LChar* charactersToInsert, - unsigned lengthToInsert, - unsigned position) { - if (position >= length()) { - append(charactersToInsert, lengthToInsert); - return; - } - ASSERT(m_impl); - m_impl = insertInternal(m_impl.release(), charactersToInsert, lengthToInsert, - position); -} - -UChar32 String::characterStartingAt(unsigned i) const { - if (!m_impl || i >= m_impl->length()) - return 0; - return m_impl->characterStartingAt(i); -} - -void String::ensure16Bit() { - unsigned length = this->length(); - if (!length || !is8Bit()) - return; - m_impl = make16BitFrom8BitSource(m_impl->characters8(), length).impl(); -} - -void String::truncate(unsigned position) { - if (position >= length()) - return; - if (m_impl->is8Bit()) { - LChar* data; - RefPtr newImpl = - StringImpl::createUninitialized(position, data); - memcpy(data, m_impl->characters8(), position * sizeof(LChar)); - m_impl = newImpl.release(); - } else { - UChar* data; - RefPtr newImpl = - StringImpl::createUninitialized(position, data); - memcpy(data, m_impl->characters16(), position * sizeof(UChar)); - m_impl = newImpl.release(); - } -} - -template -inline void String::removeInternal(const CharacterType* characters, - unsigned position, - int lengthToRemove) { - CharacterType* data; - RefPtr newImpl = - StringImpl::createUninitialized(length() - lengthToRemove, data); - memcpy(data, characters, position * sizeof(CharacterType)); - memcpy(data + position, characters + position + lengthToRemove, - (length() - lengthToRemove - position) * sizeof(CharacterType)); - - m_impl = newImpl.release(); -} - -void String::remove(unsigned position, int lengthToRemove) { - if (lengthToRemove <= 0) - return; - if (position >= length()) - return; - if (static_cast(lengthToRemove) > length() - position) - lengthToRemove = length() - position; - - if (is8Bit()) { - removeInternal(characters8(), position, lengthToRemove); - - return; - } - - removeInternal(characters16(), position, lengthToRemove); -} - -String String::substring(unsigned pos, unsigned len) const { - if (!m_impl) - return String(); - return m_impl->substring(pos, len); -} - -String String::lower() const { - if (!m_impl) - return String(); - return m_impl->lower(); -} - -String String::upper() const { - if (!m_impl) - return String(); - return m_impl->upper(); -} - -String String::lower(const AtomicString& localeIdentifier) const { - if (!m_impl) - return String(); - return m_impl->lower(localeIdentifier); -} - -String String::upper(const AtomicString& localeIdentifier) const { - if (!m_impl) - return String(); - return m_impl->upper(localeIdentifier); -} - -String String::stripWhiteSpace() const { - if (!m_impl) - return String(); - return m_impl->stripWhiteSpace(); -} - -String String::stripWhiteSpace(IsWhiteSpaceFunctionPtr isWhiteSpace) const { - if (!m_impl) - return String(); - return m_impl->stripWhiteSpace(isWhiteSpace); -} - -String String::simplifyWhiteSpace(StripBehavior stripBehavior) const { - if (!m_impl) - return String(); - return m_impl->simplifyWhiteSpace(stripBehavior); -} - -String String::simplifyWhiteSpace(IsWhiteSpaceFunctionPtr isWhiteSpace, - StripBehavior stripBehavior) const { - if (!m_impl) - return String(); - return m_impl->simplifyWhiteSpace(isWhiteSpace, stripBehavior); -} - -String String::removeCharacters(CharacterMatchFunctionPtr findMatch) const { - if (!m_impl) - return String(); - return m_impl->removeCharacters(findMatch); -} - -String String::foldCase() const { - if (!m_impl) - return String(); - return m_impl->foldCase(); -} - -bool String::percentage(int& result) const { - if (!m_impl || !m_impl->length()) - return false; - - if ((*m_impl)[m_impl->length() - 1] != '%') - return false; - - if (m_impl->is8Bit()) - result = charactersToIntStrict(m_impl->characters8(), m_impl->length() - 1); - else - result = - charactersToIntStrict(m_impl->characters16(), m_impl->length() - 1); - - return true; -} - -Vector String::charactersWithNullTermination() const { - if (!m_impl) - return Vector(); - - Vector result; - result.reserveInitialCapacity(length() + 1); - appendTo(result); - result.append(0); - return result; -} - -unsigned String::copyTo(UChar* buffer, unsigned pos, unsigned maxLength) const { - unsigned length = this->length(); - RELEASE_ASSERT(pos <= length); - unsigned numCharacters = std::min(length - pos, maxLength); - if (!numCharacters) - return 0; - if (is8Bit()) - StringImpl::copyChars(buffer, characters8() + pos, numCharacters); - else - StringImpl::copyChars(buffer, characters16() + pos, numCharacters); - return numCharacters; -} - -String String::format(const char* format, ...) { - va_list args; - va_start(args, format); - - Vector buffer; - - // Do the format once to get the length. - char ch; - int result = vsnprintf(&ch, 1, format, args); - // We need to call va_end() and then va_start() again here, as the - // contents of args is undefined after the call to vsnprintf - // according to http://man.cx/snprintf(3) - // - // Not calling va_end/va_start here happens to work on lots of - // systems, but fails e.g. on 64bit Linux. - va_end(args); - va_start(args, format); - - if (result == 0) - return String(""); - if (result < 0) - return String(); - unsigned len = result; - buffer.grow(len + 1); - - // Now do the formatting again, guaranteed to fit. - vsnprintf(buffer.data(), buffer.size(), format, args); - - va_end(args); - - return StringImpl::create(reinterpret_cast(buffer.data()), len); -} - -String String::number(int number) { - return numberToStringSigned(number); -} - -String String::number(unsigned number) { - return numberToStringUnsigned(number); -} - -String String::number(long number) { - return numberToStringSigned(number); -} - -String String::number(unsigned long number) { - return numberToStringUnsigned(number); -} - -String String::number(long long number) { - return numberToStringSigned(number); -} - -String String::number(unsigned long long number) { - return numberToStringUnsigned(number); -} - -String String::number( - double number, - unsigned precision, - TrailingZerosTruncatingPolicy trailingZerosTruncatingPolicy) { - NumberToStringBuffer buffer; - return String(numberToFixedPrecisionString( - number, precision, buffer, - trailingZerosTruncatingPolicy == TruncateTrailingZeros)); -} - -String String::numberToStringECMAScript(double number) { - NumberToStringBuffer buffer; - return String(numberToString(number, buffer)); -} - -String String::numberToStringFixedWidth(double number, unsigned decimalPlaces) { - NumberToStringBuffer buffer; - return String(numberToFixedWidthString(number, decimalPlaces, buffer)); -} - -int String::toIntStrict(bool* ok, int base) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toIntStrict(ok, base); -} - -unsigned String::toUIntStrict(bool* ok, int base) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toUIntStrict(ok, base); -} - -int64_t String::toInt64Strict(bool* ok, int base) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toInt64Strict(ok, base); -} - -uint64_t String::toUInt64Strict(bool* ok, int base) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toUInt64Strict(ok, base); -} - -intptr_t String::toIntPtrStrict(bool* ok, int base) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toIntPtrStrict(ok, base); -} - -int String::toInt(bool* ok) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toInt(ok); -} - -unsigned String::toUInt(bool* ok) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toUInt(ok); -} - -int64_t String::toInt64(bool* ok) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toInt64(ok); -} - -uint64_t String::toUInt64(bool* ok) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toUInt64(ok); -} - -intptr_t String::toIntPtr(bool* ok) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0; - } - return m_impl->toIntPtr(ok); -} - -double String::toDouble(bool* ok) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0.0; - } - return m_impl->toDouble(ok); -} - -float String::toFloat(bool* ok) const { - if (!m_impl) { - if (ok) - *ok = false; - return 0.0f; - } - return m_impl->toFloat(ok); -} - -String String::isolatedCopy() const { - if (!m_impl) - return String(); - return m_impl->isolatedCopy(); -} - -bool String::isSafeToSendToAnotherThread() const { - if (!impl()) - return true; - if (impl()->isStatic()) - return true; - // AtomicStrings are not safe to send between threads as ~StringImpl() - // will try to remove them from the wrong AtomicStringTable. - if (impl()->isAtomic()) - return false; - if (impl()->hasOneRef()) - return true; - return false; -} - -void String::split(const String& separator, - bool allowEmptyEntries, - Vector& result) const { - result.clear(); - - unsigned startPos = 0; - size_t endPos; - while ((endPos = find(separator, startPos)) != kNotFound) { - if (allowEmptyEntries || startPos != endPos) - result.append(substring(startPos, endPos - startPos)); - startPos = endPos + separator.length(); - } - if (allowEmptyEntries || startPos != length()) - result.append(substring(startPos)); -} - -void String::split(UChar separator, - bool allowEmptyEntries, - Vector& result) const { - result.clear(); - - unsigned startPos = 0; - size_t endPos; - while ((endPos = find(separator, startPos)) != kNotFound) { - if (allowEmptyEntries || startPos != endPos) - result.append(substring(startPos, endPos - startPos)); - startPos = endPos + 1; - } - if (allowEmptyEntries || startPos != length()) - result.append(substring(startPos)); -} - -CString String::ascii() const { - // Printable ASCII characters 32..127 and the null character are - // preserved, characters outside of this range are converted to '?'. - - unsigned length = this->length(); - if (!length) { - char* characterBuffer; - return CString::newUninitialized(length, characterBuffer); - } - - if (this->is8Bit()) { - const LChar* characters = this->characters8(); - - char* characterBuffer; - CString result = CString::newUninitialized(length, characterBuffer); - - for (unsigned i = 0; i < length; ++i) { - LChar ch = characters[i]; - characterBuffer[i] = ch && (ch < 0x20 || ch > 0x7f) ? '?' : ch; - } - - return result; - } - - const UChar* characters = this->characters16(); - - char* characterBuffer; - CString result = CString::newUninitialized(length, characterBuffer); - - for (unsigned i = 0; i < length; ++i) { - UChar ch = characters[i]; - characterBuffer[i] = ch && (ch < 0x20 || ch > 0x7f) ? '?' : ch; - } - - return result; -} - -CString String::latin1() const { - // Basic Latin1 (ISO) encoding - Unicode characters 0..255 are - // preserved, characters outside of this range are converted to '?'. - - unsigned length = this->length(); - - if (!length) - return CString("", 0); - - if (is8Bit()) - return CString(reinterpret_cast(this->characters8()), length); - - const UChar* characters = this->characters16(); - - char* characterBuffer; - CString result = CString::newUninitialized(length, characterBuffer); - - for (unsigned i = 0; i < length; ++i) { - UChar ch = characters[i]; - characterBuffer[i] = ch > 0xff ? '?' : ch; - } - - return result; -} - -// Helper to write a three-byte UTF-8 code point to the buffer, caller must -// check room is available. -static inline void putUTF8Triple(char*& buffer, UChar ch) { - ASSERT(ch >= 0x0800); - *buffer++ = static_cast(((ch >> 12) & 0x0F) | 0xE0); - *buffer++ = static_cast(((ch >> 6) & 0x3F) | 0x80); - *buffer++ = static_cast((ch & 0x3F) | 0x80); -} - -CString String::utf8(UTF8ConversionMode mode) const { - unsigned length = this->length(); - - if (!length) - return CString("", 0); - - // Allocate a buffer big enough to hold all the characters - // (an individual UTF-16 UChar can only expand to 3 UTF-8 bytes). - // Optimization ideas, if we find this function is hot: - // * We could speculatively create a CStringBuffer to contain 'length' - // characters, and resize if necessary (i.e. if the buffer contains - // non-ascii characters). (Alternatively, scan the buffer first for - // ascii characters, so we know this will be sufficient). - // * We could allocate a CStringBuffer with an appropriate size to - // have a good chance of being able to write the string into the - // buffer without reallocing (say, 1.5 x length). - if (length > numeric_limits::max() / 3) - return CString(); - Vector bufferVector(length * 3); - - char* buffer = bufferVector.data(); - - if (is8Bit()) { - const LChar* characters = this->characters8(); - - ConversionResult result = - convertLatin1ToUTF8(&characters, characters + length, &buffer, - buffer + bufferVector.size()); - ASSERT_UNUSED(result, result != targetExhausted); // (length * 3) should be - // sufficient for any - // conversion - } else { - const UChar* characters = this->characters16(); - - if (mode == StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD) { - const UChar* charactersEnd = characters + length; - char* bufferEnd = buffer + bufferVector.size(); - while (characters < charactersEnd) { - // Use strict conversion to detect unpaired surrogates. - ConversionResult result = convertUTF16ToUTF8(&characters, charactersEnd, - &buffer, bufferEnd, true); - ASSERT(result != targetExhausted); - // Conversion fails when there is an unpaired surrogate. - // Put replacement character (U+FFFD) instead of the unpaired surrogate. - if (result != conversionOK) { - ASSERT((0xD800 <= *characters && *characters <= 0xDFFF)); - // There should be room left, since one UChar hasn't been converted. - ASSERT((buffer + 3) <= bufferEnd); - putUTF8Triple(buffer, replacementCharacter); - ++characters; - } - } - } else { - bool strict = mode == StrictUTF8Conversion; - ConversionResult result = - convertUTF16ToUTF8(&characters, characters + length, &buffer, - buffer + bufferVector.size(), strict); - ASSERT(result != targetExhausted); // (length * 3) should be sufficient - // for any conversion - - // Only produced from strict conversion. - if (result == sourceIllegal) { - ASSERT(strict); - return CString(); - } - - // Check for an unconverted high surrogate. - if (result == sourceExhausted) { - if (strict) - return CString(); - // This should be one unpaired high surrogate. Treat it the same - // was as an unpaired high surrogate would have been handled in - // the middle of a string with non-strict conversion - which is - // to say, simply encode it to UTF-8. - ASSERT((characters + 1) == (this->characters16() + length)); - ASSERT((*characters >= 0xD800) && (*characters <= 0xDBFF)); - // There should be room left, since one UChar hasn't been converted. - ASSERT((buffer + 3) <= (buffer + bufferVector.size())); - putUTF8Triple(buffer, *characters); - } - } - } - - return CString(bufferVector.data(), buffer - bufferVector.data()); -} - -std::string String::toUTF8() const { - return utf8().toStdString(); -} - -String String::make8BitFrom16BitSource(const UChar* source, size_t length) { - if (!length) - return emptyString(); - - LChar* destination; - String result = String::createUninitialized(length, destination); - - copyLCharsFromUCharSource(destination, source, length); - - return result; -} - -String String::make16BitFrom8BitSource(const LChar* source, size_t length) { - if (!length) - return emptyString(); - - UChar* destination; - String result = String::createUninitialized(length, destination); - - StringImpl::copyChars(destination, source, length); - - return result; -} - -String String::fromUTF8(const LChar* stringStart, size_t length) { - RELEASE_ASSERT(length <= numeric_limits::max()); - - if (!stringStart) - return String(); - - if (!length) - return emptyString(); - - if (charactersAreAllASCII(stringStart, length)) - return StringImpl::create(stringStart, length); - - Vector buffer(length); - UChar* bufferStart = buffer.data(); - - UChar* bufferCurrent = bufferStart; - const char* stringCurrent = reinterpret_cast(stringStart); - if (convertUTF8ToUTF16( - &stringCurrent, reinterpret_cast(stringStart + length), - &bufferCurrent, bufferCurrent + buffer.size()) != conversionOK) - return String(); - - unsigned utf16Length = bufferCurrent - bufferStart; - ASSERT(utf16Length < length); - return StringImpl::create(bufferStart, utf16Length); -} - -String String::fromUTF8(const LChar* string) { - if (!string) - return String(); - return fromUTF8(string, strlen(reinterpret_cast(string))); -} - -String String::fromUTF8(const CString& s) { - return fromUTF8(s.data()); -} - -String String::fromUTF8WithLatin1Fallback(const LChar* string, size_t size) { - String utf8 = fromUTF8(string, size); - if (!utf8) - return String(string, size); - return utf8; -} - -// String Operations - -static bool isCharacterAllowedInBase(UChar c, int base) { - if (c > 0x7F) - return false; - if (isASCIIDigit(c)) - return c - '0' < base; - if (isASCIIAlpha(c)) { - if (base > 36) - base = 36; - return (c >= 'a' && c < 'a' + base - 10) || - (c >= 'A' && c < 'A' + base - 10); - } - return false; -} - -template -static inline IntegralType toIntegralType(const CharType* data, - size_t length, - bool* ok, - int base) { - static const IntegralType integralMax = numeric_limits::max(); - static const bool isSigned = numeric_limits::is_signed; - const IntegralType maxMultiplier = integralMax / base; - - IntegralType value = 0; - bool isOk = false; - bool isNegative = false; - - if (!data) - goto bye; - - // skip leading whitespace - while (length && isSpaceOrNewline(*data)) { - --length; - ++data; - } - - if (isSigned && length && *data == '-') { - --length; - ++data; - isNegative = true; - } else if (length && *data == '+') { - --length; - ++data; - } - - if (!length || !isCharacterAllowedInBase(*data, base)) - goto bye; - - while (length && isCharacterAllowedInBase(*data, base)) { - --length; - IntegralType digitValue; - CharType c = *data; - if (isASCIIDigit(c)) - digitValue = c - '0'; - else if (c >= 'a') - digitValue = c - 'a' + 10; - else - digitValue = c - 'A' + 10; - - if (value > maxMultiplier || - (value == maxMultiplier && - digitValue > (integralMax % base) + isNegative)) - goto bye; - - value = base * value + digitValue; - ++data; - } - - if (isNegative) - value = -value; - - // skip trailing space - while (length && isSpaceOrNewline(*data)) { - --length; - ++data; - } - - if (!length) - isOk = true; -bye: - if (ok) - *ok = isOk; - return isOk ? value : 0; -} - -template -static unsigned lengthOfCharactersAsInteger(const CharType* data, - size_t length) { - size_t i = 0; - - // Allow leading spaces. - for (; i != length; ++i) { - if (!isSpaceOrNewline(data[i])) - break; - } - - // Allow sign. - if (i != length && (data[i] == '+' || data[i] == '-')) - ++i; - - // Allow digits. - for (; i != length; ++i) { - if (!isASCIIDigit(data[i])) - break; - } - - return i; -} - -int charactersToIntStrict(const LChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -int charactersToIntStrict(const UChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -unsigned charactersToUIntStrict(const LChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -unsigned charactersToUIntStrict(const UChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -int64_t charactersToInt64Strict(const LChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -int64_t charactersToInt64Strict(const UChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -uint64_t charactersToUInt64Strict(const LChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -uint64_t charactersToUInt64Strict(const UChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -intptr_t charactersToIntPtrStrict(const LChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -intptr_t charactersToIntPtrStrict(const UChar* data, - size_t length, - bool* ok, - int base) { - return toIntegralType(data, length, ok, base); -} - -int charactersToInt(const LChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -int charactersToInt(const UChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -unsigned charactersToUInt(const LChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -unsigned charactersToUInt(const UChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -int64_t charactersToInt64(const LChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -int64_t charactersToInt64(const UChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -uint64_t charactersToUInt64(const LChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -uint64_t charactersToUInt64(const UChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -intptr_t charactersToIntPtr(const LChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -intptr_t charactersToIntPtr(const UChar* data, size_t length, bool* ok) { - return toIntegralType( - data, lengthOfCharactersAsInteger(data, length), ok, 10); -} - -enum TrailingJunkPolicy { DisallowTrailingJunk, AllowTrailingJunk }; - -template -static inline double toDoubleType(const CharType* data, - size_t length, - bool* ok, - size_t& parsedLength) { - size_t leadingSpacesLength = 0; - while (leadingSpacesLength < length && - isASCIISpace(data[leadingSpacesLength])) - ++leadingSpacesLength; - - double number = parseDouble(data + leadingSpacesLength, - length - leadingSpacesLength, parsedLength); - if (!parsedLength) { - if (ok) - *ok = false; - return 0.0; - } - - parsedLength += leadingSpacesLength; - if (ok) - *ok = policy == AllowTrailingJunk || parsedLength == length; - return number; -} - -double charactersToDouble(const LChar* data, size_t length, bool* ok) { - size_t parsedLength; - return toDoubleType(data, length, ok, - parsedLength); -} - -double charactersToDouble(const UChar* data, size_t length, bool* ok) { - size_t parsedLength; - return toDoubleType(data, length, ok, - parsedLength); -} - -float charactersToFloat(const LChar* data, size_t length, bool* ok) { - // FIXME: This will return ok even when the string fits into a double but not - // a float. - size_t parsedLength; - return static_cast(toDoubleType( - data, length, ok, parsedLength)); -} - -float charactersToFloat(const UChar* data, size_t length, bool* ok) { - // FIXME: This will return ok even when the string fits into a double but not - // a float. - size_t parsedLength; - return static_cast(toDoubleType( - data, length, ok, parsedLength)); -} - -float charactersToFloat(const LChar* data, - size_t length, - size_t& parsedLength) { - // FIXME: This will return ok even when the string fits into a double but not - // a float. - return static_cast( - toDoubleType(data, length, 0, parsedLength)); -} - -float charactersToFloat(const UChar* data, - size_t length, - size_t& parsedLength) { - // FIXME: This will return ok even when the string fits into a double but not - // a float. - return static_cast( - toDoubleType(data, length, 0, parsedLength)); -} - -const String& emptyString() { - DEFINE_STATIC_LOCAL(String, emptyString, (StringImpl::empty())); - return emptyString; -} - -} // namespace WTF - -#ifndef NDEBUG -// For use in the debugger -String* string(const char*); -Vector asciiDebug(StringImpl* impl); -Vector asciiDebug(String& string); - -void String::show() const { - dataLogF("%s\n", asciiDebug(impl()).data()); -} - -String* string(const char* s) { - // leaks memory! - return new String(s); -} - -Vector asciiDebug(StringImpl* impl) { - if (!impl) - return asciiDebug(String("[null]").impl()); - - Vector buffer; - for (unsigned i = 0; i < impl->length(); ++i) { - UChar ch = (*impl)[i]; - if (isASCIIPrintable(ch)) { - if (ch == '\\') - buffer.append(ch); - buffer.append(ch); - } else { - buffer.append('\\'); - buffer.append('u'); - appendUnsignedAsHexFixedSize(ch, buffer, 4); - } - } - buffer.append('\0'); - return buffer; -} - -Vector asciiDebug(String& string) { - return asciiDebug(string.impl()); -} - -#endif diff --git a/sky/engine/wtf/text/WTFString.h b/sky/engine/wtf/text/WTFString.h deleted file mode 100644 index 47d083dec29f2..0000000000000 --- a/sky/engine/wtf/text/WTFString.h +++ /dev/null @@ -1,857 +0,0 @@ -/* - * (C) 1999 Lars Knoll (knoll@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. - * All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_TEXT_WTFSTRING_H_ -#define SKY_ENGINE_WTF_TEXT_WTFSTRING_H_ - -// This file would be called String.h, but that conflicts with -// on systems without case-sensitive file systems. -#include - -#include "flutter/sky/engine/wtf/HashTableDeletedValueType.h" -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/text/ASCIIFastPath.h" -#include "flutter/sky/engine/wtf/text/StringImpl.h" -#include "flutter/sky/engine/wtf/text/StringView.h" - -namespace WTF { - -class CString; -struct StringHash; - -// Declarations of string operations - -WTF_EXPORT int charactersToIntStrict(const LChar*, - size_t, - bool* ok = 0, - int base = 10); -WTF_EXPORT int charactersToIntStrict(const UChar*, - size_t, - bool* ok = 0, - int base = 10); -WTF_EXPORT unsigned charactersToUIntStrict(const LChar*, - size_t, - bool* ok = 0, - int base = 10); -WTF_EXPORT unsigned charactersToUIntStrict(const UChar*, - size_t, - bool* ok = 0, - int base = 10); -WTF_EXPORT int64_t charactersToInt64Strict(const LChar*, - size_t, - bool* ok = 0, - int base = 10); -WTF_EXPORT int64_t charactersToInt64Strict(const UChar*, - size_t, - bool* ok = 0, - int base = 10); -WTF_EXPORT uint64_t charactersToUInt64Strict(const LChar*, - size_t, - bool* ok = 0, - int base = 10); -WTF_EXPORT uint64_t charactersToUInt64Strict(const UChar*, - size_t, - bool* ok = 0, - int base = 10); -WTF_EXPORT intptr_t charactersToIntPtrStrict(const LChar*, - size_t, - bool* ok = 0, - int base = 10); -WTF_EXPORT intptr_t charactersToIntPtrStrict(const UChar*, - size_t, - bool* ok = 0, - int base = 10); - -WTF_EXPORT int charactersToInt(const LChar*, - size_t, - bool* ok = 0); // ignores trailing garbage -WTF_EXPORT int charactersToInt(const UChar*, - size_t, - bool* ok = 0); // ignores trailing garbage -WTF_EXPORT unsigned charactersToUInt(const LChar*, - size_t, - bool* ok = 0); // ignores trailing garbage -WTF_EXPORT unsigned charactersToUInt(const UChar*, - size_t, - bool* ok = 0); // ignores trailing garbage -WTF_EXPORT int64_t charactersToInt64(const LChar*, - size_t, - bool* ok = 0); // ignores trailing garbage -WTF_EXPORT int64_t charactersToInt64(const UChar*, - size_t, - bool* ok = 0); // ignores trailing garbage -WTF_EXPORT uint64_t -charactersToUInt64(const LChar*, - size_t, - bool* ok = 0); // ignores trailing garbage -WTF_EXPORT uint64_t -charactersToUInt64(const UChar*, - size_t, - bool* ok = 0); // ignores trailing garbage -WTF_EXPORT intptr_t -charactersToIntPtr(const LChar*, - size_t, - bool* ok = 0); // ignores trailing garbage -WTF_EXPORT intptr_t -charactersToIntPtr(const UChar*, - size_t, - bool* ok = 0); // ignores trailing garbage - -// FIXME: Like the strict functions above, these give false for "ok" when there -// is trailing garbage. Like the non-strict functions above, these return the -// value when there is trailing garbage. It would be better if these were more -// consistent with the above functions instead. -WTF_EXPORT double charactersToDouble(const LChar*, size_t, bool* ok = 0); -WTF_EXPORT double charactersToDouble(const UChar*, size_t, bool* ok = 0); -WTF_EXPORT float charactersToFloat(const LChar*, size_t, bool* ok = 0); -WTF_EXPORT float charactersToFloat(const UChar*, size_t, bool* ok = 0); -WTF_EXPORT float charactersToFloat(const LChar*, size_t, size_t& parsedLength); -WTF_EXPORT float charactersToFloat(const UChar*, size_t, size_t& parsedLength); - -enum TrailingZerosTruncatingPolicy { KeepTrailingZeros, TruncateTrailingZeros }; - -enum UTF8ConversionMode { - LenientUTF8Conversion, - StrictUTF8Conversion, - StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD -}; - -template -bool isAllSpecialCharacters(const CharacterType*, size_t); - -// You can find documentation about this class in this doc: -// https://docs.google.com/document/d/1kOCUlJdh2WJMJGDf-WoEQhmnjKLaOYRbiHz5TiGJl14/edit?usp=sharing -class WTF_EXPORT String { - public: - // Construct a null string, distinguishable from an empty string. - String() {} - - // Construct a string with UTF-16 data. - String(const UChar* characters, unsigned length); - - // Construct a string by copying the contents of a vector. - // This method will never create a null string. Vectors with size() == 0 - // will return the empty string. - // NOTE: This is different from String(vector.data(), vector.size()) - // which will sometimes return a null string when vector.data() is null - // which can only occur for vectors without inline capacity. - // See: https://bugs.webkit.org/show_bug.cgi?id=109792 - template - explicit String(const Vector&); - - // Construct a string with UTF-16 data, from a null-terminated source. - String(const UChar*); - - // Construct a string with latin1 data. - String(const LChar* characters, unsigned length); - String(const char* characters, unsigned length); - - // Construct a string with latin1 data, from a null-terminated source. - String(const LChar* characters); - String(const char* characters); - - // Construct a string referencing an existing StringImpl. - String(StringImpl* impl) : m_impl(impl) {} - String(PassRefPtr impl) : m_impl(impl) {} - - void swap(String& o) { m_impl.swap(o.m_impl); } - - template - static String adopt(StringBuffer& buffer) { - if (!buffer.length()) - return StringImpl::empty(); - return String(buffer.release()); - } - - bool isNull() const { return !m_impl; } - bool isEmpty() const { return !m_impl || !m_impl->length(); } - - StringImpl* impl() const { return m_impl.get(); } - PassRefPtr releaseImpl() { return m_impl.release(); } - - unsigned length() const { - if (!m_impl) - return 0; - return m_impl->length(); - } - - const LChar* characters8() const { - if (!m_impl) - return 0; - ASSERT(m_impl->is8Bit()); - return m_impl->characters8(); - } - - const UChar* characters16() const { - if (!m_impl) - return 0; - ASSERT(!m_impl->is8Bit()); - return m_impl->characters16(); - } - - // Return characters8() or characters16() depending on CharacterType. - template - inline const CharacterType* getCharacters() const; - - bool is8Bit() const { return m_impl->is8Bit(); } - - unsigned sizeInBytes() const { - if (!m_impl) - return 0; - return m_impl->length() * (is8Bit() ? sizeof(LChar) : sizeof(UChar)); - } - - CString ascii() const; - CString latin1() const; - CString utf8(UTF8ConversionMode = LenientUTF8Conversion) const; - - // We should replace CString with std::string. - std::string toUTF8() const; - - UChar operator[](unsigned index) const { - if (!m_impl || index >= m_impl->length()) - return 0; - return (*m_impl)[index]; - } - - static String number(int); - static String number(unsigned); - static String number(long); - static String number(unsigned long); - static String number(long long); - static String number(unsigned long long); - - static String number(double, - unsigned precision = 6, - TrailingZerosTruncatingPolicy = TruncateTrailingZeros); - - // Number to String conversion following the ECMAScript definition. - static String numberToStringECMAScript(double); - static String numberToStringFixedWidth(double, unsigned decimalPlaces); - - // Find a single character or string, also with match function & latin1 forms. - size_t find(UChar c, unsigned start = 0) const { - return m_impl ? m_impl->find(c, start) : kNotFound; - } - - size_t find(const String& str) const { - return m_impl ? m_impl->find(str.impl()) : kNotFound; - } - size_t find(const String& str, unsigned start) const { - return m_impl ? m_impl->find(str.impl(), start) : kNotFound; - } - - size_t find(CharacterMatchFunctionPtr matchFunction, - unsigned start = 0) const { - return m_impl ? m_impl->find(matchFunction, start) : kNotFound; - } - size_t find(const LChar* str, unsigned start = 0) const { - return m_impl ? m_impl->find(str, start) : kNotFound; - } - - size_t findNextLineStart(unsigned start = 0) const { - return m_impl ? m_impl->findNextLineStart(start) : kNotFound; - } - - // Find the last instance of a single character or string. - size_t reverseFind(UChar c, unsigned start = UINT_MAX) const { - return m_impl ? m_impl->reverseFind(c, start) : kNotFound; - } - size_t reverseFind(const String& str, unsigned start = UINT_MAX) const { - return m_impl ? m_impl->reverseFind(str.impl(), start) : kNotFound; - } - - // Case insensitive string matching. - size_t findIgnoringCase(const LChar* str, unsigned start = 0) const { - return m_impl ? m_impl->findIgnoringCase(str, start) : kNotFound; - } - size_t findIgnoringCase(const String& str, unsigned start = 0) const { - return m_impl ? m_impl->findIgnoringCase(str.impl(), start) : kNotFound; - } - size_t reverseFindIgnoringCase(const String& str, - unsigned start = UINT_MAX) const { - return m_impl ? m_impl->reverseFindIgnoringCase(str.impl(), start) - : kNotFound; - } - - // Wrappers for find & reverseFind adding dynamic sensitivity check. - size_t find(const LChar* str, unsigned start, bool caseSensitive) const { - return caseSensitive ? find(str, start) : findIgnoringCase(str, start); - } - size_t find(const String& str, unsigned start, bool caseSensitive) const { - return caseSensitive ? find(str, start) : findIgnoringCase(str, start); - } - size_t reverseFind(const String& str, - unsigned start, - bool caseSensitive) const { - return caseSensitive ? reverseFind(str, start) - : reverseFindIgnoringCase(str, start); - } - - Vector charactersWithNullTermination() const; - unsigned copyTo(UChar* buffer, unsigned pos, unsigned maxLength) const; - - template - void appendTo(Vector&, - unsigned pos = 0, - unsigned len = UINT_MAX) const; - - template - void appendTo(BufferType&, unsigned pos = 0, unsigned len = UINT_MAX) const; - - template - void prependTo(Vector&, - unsigned pos = 0, - unsigned len = UINT_MAX) const; - - UChar32 characterStartingAt(unsigned) const; - - bool contains(UChar c) const { return find(c) != kNotFound; } - bool contains(const LChar* str, bool caseSensitive = true) const { - return find(str, 0, caseSensitive) != kNotFound; - } - bool contains(const String& str, bool caseSensitive = true) const { - return find(str, 0, caseSensitive) != kNotFound; - } - - bool startsWith(const String& s, bool caseSensitive = true) const { - return m_impl ? m_impl->startsWith(s.impl(), caseSensitive) : s.isEmpty(); - } - bool startsWith(UChar character) const { - return m_impl ? m_impl->startsWith(character) : false; - } - template - bool startsWith(const char (&prefix)[matchLength], - bool caseSensitive = true) const { - return m_impl ? m_impl->startsWith(prefix, caseSensitive) - : !matchLength; - } - - bool endsWith(const String& s, bool caseSensitive = true) const { - return m_impl ? m_impl->endsWith(s.impl(), caseSensitive) : s.isEmpty(); - } - bool endsWith(UChar character) const { - return m_impl ? m_impl->endsWith(character) : false; - } - template - bool endsWith(const char (&prefix)[matchLength], - bool caseSensitive = true) const { - return m_impl ? m_impl->endsWith(prefix, caseSensitive) - : !matchLength; - } - - void append(const String&); - void append(LChar); - void append(char c) { append(static_cast(c)); } - void append(UChar); - void append(const LChar*, unsigned length); - void append(const char* charactersToAppend, unsigned length) { - append(reinterpret_cast(charactersToAppend), length); - } - void append(const UChar*, unsigned length); - void insert(const String&, unsigned pos); - void insert(const LChar*, unsigned length, unsigned pos); - void insert(const UChar*, unsigned length, unsigned pos); - - String& replace(UChar a, UChar b) { - if (m_impl) - m_impl = m_impl->replace(a, b); - return *this; - } - String& replace(UChar a, const String& b) { - if (m_impl) - m_impl = m_impl->replace(a, b.impl()); - return *this; - } - String& replace(const String& a, const String& b) { - if (m_impl) - m_impl = m_impl->replace(a.impl(), b.impl()); - return *this; - } - String& replace(unsigned index, unsigned len, const String& b) { - if (m_impl) - m_impl = m_impl->replace(index, len, b.impl()); - return *this; - } - - template - ALWAYS_INLINE String& replaceWithLiteral( - UChar a, - const char (&characters)[charactersCount]) { - if (m_impl) - m_impl = m_impl->replace(a, characters, charactersCount - 1); - - return *this; - } - - void fill(UChar c) { - if (m_impl) - m_impl = m_impl->fill(c); - } - - void ensure16Bit(); - - void truncate(unsigned len); - void remove(unsigned pos, int len = 1); - - String substring(unsigned pos, unsigned len = UINT_MAX) const; - String left(unsigned len) const { return substring(0, len); } - String right(unsigned len) const { return substring(length() - len, len); } - - StringView createView() const { return StringView(impl()); } - StringView createView(unsigned offset, unsigned length) const { - return StringView(impl(), offset, length); - } - - // Returns a lowercase/uppercase version of the string - String lower() const; - String upper() const; - - String lower(const AtomicString& localeIdentifier) const; - String upper(const AtomicString& localeIdentifier) const; - - String stripWhiteSpace() const; - String stripWhiteSpace(IsWhiteSpaceFunctionPtr) const; - String simplifyWhiteSpace( - StripBehavior stripBehavior = StripExtraWhiteSpace) const; - String simplifyWhiteSpace( - IsWhiteSpaceFunctionPtr, - StripBehavior stripBehavior = StripExtraWhiteSpace) const; - - String removeCharacters(CharacterMatchFunctionPtr) const; - template - bool isAllSpecialCharacters() const; - - // Return the string with case folded for case insensitive comparison. - String foldCase() const; - - static String format(const char*, ...) WTF_ATTRIBUTE_PRINTF(1, 2); - - // Returns an uninitialized string. The characters needs to be written - // into the buffer returned in data before the returned string is used. - // Failure to do this will have unpredictable results. - static String createUninitialized(unsigned length, UChar*& data) { - return StringImpl::createUninitialized(length, data); - } - static String createUninitialized(unsigned length, LChar*& data) { - return StringImpl::createUninitialized(length, data); - } - - void split(const String& separator, - bool allowEmptyEntries, - Vector& result) const; - void split(const String& separator, Vector& result) const { - split(separator, false, result); - } - void split(UChar separator, - bool allowEmptyEntries, - Vector& result) const; - void split(UChar separator, Vector& result) const { - split(separator, false, result); - } - - int toIntStrict(bool* ok = 0, int base = 10) const; - unsigned toUIntStrict(bool* ok = 0, int base = 10) const; - int64_t toInt64Strict(bool* ok = 0, int base = 10) const; - uint64_t toUInt64Strict(bool* ok = 0, int base = 10) const; - intptr_t toIntPtrStrict(bool* ok = 0, int base = 10) const; - - int toInt(bool* ok = 0) const; - unsigned toUInt(bool* ok = 0) const; - int64_t toInt64(bool* ok = 0) const; - uint64_t toUInt64(bool* ok = 0) const; - intptr_t toIntPtr(bool* ok = 0) const; - - // FIXME: Like the strict functions above, these give false for "ok" when - // there is trailing garbage. Like the non-strict functions above, these - // return the value when there is trailing garbage. It would be better if - // these were more consistent with the above functions instead. - double toDouble(bool* ok = 0) const; - float toFloat(bool* ok = 0) const; - - bool percentage(int& percentage) const; - - String isolatedCopy() const; - bool isSafeToSendToAnotherThread() const; - -#if USE(CF) - String(CFStringRef); - RetainPtr createCFString() const; -#endif - - static String make8BitFrom16BitSource(const UChar*, size_t); - template - static String make8BitFrom16BitSource( - const Vector& buffer) { - return make8BitFrom16BitSource(buffer.data(), buffer.size()); - } - - static String make16BitFrom8BitSource(const LChar*, size_t); - - // String::fromUTF8 will return a null string if - // the input data contains invalid UTF-8 sequences. - static String fromUTF8(const LChar*, size_t); - static String fromUTF8(const LChar*); - static String fromUTF8(const char* s, size_t length) { - return fromUTF8(reinterpret_cast(s), length); - }; - static String fromUTF8(const char* s) { - return fromUTF8(reinterpret_cast(s)); - }; - static String fromUTF8(const CString&); - static String fromUTF8(const std::string& s) { - return fromUTF8(s.data(), s.size()); - } - - // Tries to convert the passed in string to UTF-8, but will fall back to - // Latin-1 if the string is not valid UTF-8. - static String fromUTF8WithLatin1Fallback(const LChar*, size_t); - static String fromUTF8WithLatin1Fallback(const char* s, size_t length) { - return fromUTF8WithLatin1Fallback(reinterpret_cast(s), - length); - }; - - bool containsOnlyASCII() const; - bool containsOnlyLatin1() const; - bool containsOnlyWhitespace() const { - return !m_impl || m_impl->containsOnlyWhitespace(); - } - - // Hash table deleted values, which are only constructed and never copied or - // destroyed. - String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) {} - bool isHashTableDeletedValue() const { - return m_impl.isHashTableDeletedValue(); - } - -#ifndef NDEBUG - void show() const; -#endif - - // Workaround for a compiler bug. Use operator[] instead. - UChar characterAt(unsigned index) const { - if (!m_impl || index >= m_impl->length()) - return 0; - return (*m_impl)[index]; - } - - private: - typedef struct ImplicitConversionFromWTFStringToBoolDisallowed*( - String::*UnspecifiedBoolType); - operator UnspecifiedBoolType() const; - - template - void removeInternal(const CharacterType*, unsigned, int); - - template - void appendInternal(CharacterType); - - RefPtr m_impl; -}; - -inline bool operator==(const String& a, const String& b) { - return equal(a.impl(), b.impl()); -} -inline bool operator==(const String& a, const LChar* b) { - return equal(a.impl(), b); -} -inline bool operator==(const String& a, const char* b) { - return equal(a.impl(), reinterpret_cast(b)); -} -inline bool operator==(const LChar* a, const String& b) { - return equal(a, b.impl()); -} -inline bool operator==(const char* a, const String& b) { - return equal(reinterpret_cast(a), b.impl()); -} -template -inline bool operator==(const Vector& a, const String& b) { - return equal(b.impl(), a.data(), a.size()); -} -template -inline bool operator==(const String& a, const Vector& b) { - return b == a; -} - -inline bool operator!=(const String& a, const String& b) { - return !equal(a.impl(), b.impl()); -} -inline bool operator!=(const String& a, const LChar* b) { - return !equal(a.impl(), b); -} -inline bool operator!=(const String& a, const char* b) { - return !equal(a.impl(), reinterpret_cast(b)); -} -inline bool operator!=(const LChar* a, const String& b) { - return !equal(a, b.impl()); -} -inline bool operator!=(const char* a, const String& b) { - return !equal(reinterpret_cast(a), b.impl()); -} -template -inline bool operator!=(const Vector& a, const String& b) { - return !(a == b); -} -template -inline bool operator!=(const String& a, const Vector& b) { - return b != a; -} - -inline bool equalIgnoringCase(const String& a, const String& b) { - return equalIgnoringCase(a.impl(), b.impl()); -} -inline bool equalIgnoringCase(const String& a, const LChar* b) { - return equalIgnoringCase(a.impl(), b); -} -inline bool equalIgnoringCase(const String& a, const char* b) { - return equalIgnoringCase(a.impl(), reinterpret_cast(b)); -} -inline bool equalIgnoringCase(const LChar* a, const String& b) { - return equalIgnoringCase(a, b.impl()); -} -inline bool equalIgnoringCase(const char* a, const String& b) { - return equalIgnoringCase(reinterpret_cast(a), b.impl()); -} - -inline bool equalIgnoringNullity(const String& a, const String& b) { - return equalIgnoringNullity(a.impl(), b.impl()); -} - -template -inline bool equalIgnoringNullity(const Vector& a, - const String& b) { - return equalIgnoringNullity(a, b.impl()); -} - -inline bool operator!(const String& str) { - return str.isNull(); -} - -inline void swap(String& a, String& b) { - a.swap(b); -} - -// Definitions of string operations - -template -String::String(const Vector& vector) - : m_impl(vector.size() ? StringImpl::create(vector.data(), vector.size()) - : StringImpl::empty()) {} - -template <> -inline const LChar* String::getCharacters() const { - ASSERT(is8Bit()); - return characters8(); -} - -template <> -inline const UChar* String::getCharacters() const { - ASSERT(!is8Bit()); - return characters16(); -} - -inline bool String::containsOnlyLatin1() const { - if (isEmpty()) - return true; - - if (is8Bit()) - return true; - - const UChar* characters = characters16(); - UChar ored = 0; - for (size_t i = 0; i < m_impl->length(); ++i) - ored |= characters[i]; - return !(ored & 0xFF00); -} - -inline bool String::containsOnlyASCII() const { - if (isEmpty()) - return true; - - if (is8Bit()) - return charactersAreAllASCII(characters8(), m_impl->length()); - - return charactersAreAllASCII(characters16(), m_impl->length()); -} - -WTF_EXPORT int codePointCompare(const String&, const String&); - -inline bool codePointCompareLessThan(const String& a, const String& b) { - return codePointCompare(a.impl(), b.impl()) < 0; -} - -template -inline void append(Vector& vector, - const String& string) { - unsigned length = string.length(); - if (!length) - return; - if (string.is8Bit()) { - const LChar* characters8 = string.characters8(); - vector.reserveCapacity(vector.size() + length); - for (size_t i = 0; i < length; ++i) - vector.uncheckedAppend(characters8[i]); - } else { - vector.append(string.characters16(), length); - } -} - -template -inline void appendNumber(Vector& vector, unsigned char number) { - int numberLength = number > 99 ? 3 : (number > 9 ? 2 : 1); - size_t vectorSize = vector.size(); - vector.grow(vectorSize + numberLength); - - switch (numberLength) { - case 3: - vector[vectorSize + 2] = number % 10 + '0'; - number /= 10; - - case 2: - vector[vectorSize + 1] = number % 10 + '0'; - number /= 10; - - case 1: - vector[vectorSize] = number % 10 + '0'; - } -} - -template -inline bool isAllSpecialCharacters(const CharacterType* characters, - size_t length) { - for (size_t i = 0; i < length; ++i) { - if (!isSpecialCharacter(characters[i])) - return false; - } - return true; -} - -template -inline bool String::isAllSpecialCharacters() const { - size_t len = length(); - - if (!len) - return true; - - if (is8Bit()) - return WTF::isAllSpecialCharacters(characters8(), - len); - return WTF::isAllSpecialCharacters(characters16(), - len); -} - -template -inline void String::appendTo(Vector& result, - unsigned pos, - unsigned len) const { - unsigned numberOfCharactersToCopy = std::min(len, length() - pos); - if (!numberOfCharactersToCopy) - return; - result.reserveCapacity(result.size() + numberOfCharactersToCopy); - if (is8Bit()) { - const LChar* characters8 = m_impl->characters8(); - for (size_t i = 0; i < numberOfCharactersToCopy; ++i) - result.uncheckedAppend(characters8[pos + i]); - } else { - const UChar* characters16 = m_impl->characters16(); - result.append(characters16 + pos, numberOfCharactersToCopy); - } -} - -template -inline void String::appendTo(BufferType& result, - unsigned pos, - unsigned len) const { - unsigned numberOfCharactersToCopy = std::min(len, length() - pos); - if (!numberOfCharactersToCopy) - return; - if (is8Bit()) - result.append(m_impl->characters8() + pos, numberOfCharactersToCopy); - else - result.append(m_impl->characters16() + pos, numberOfCharactersToCopy); -} - -template -inline void String::prependTo(Vector& result, - unsigned pos, - unsigned len) const { - unsigned numberOfCharactersToCopy = std::min(len, length() - pos); - if (!numberOfCharactersToCopy) - return; - if (is8Bit()) { - size_t oldSize = result.size(); - result.resize(oldSize + numberOfCharactersToCopy); - memmove(result.data() + numberOfCharactersToCopy, result.data(), - oldSize * sizeof(UChar)); - StringImpl::copyChars(result.data(), m_impl->characters8() + pos, - numberOfCharactersToCopy); - } else { - result.prepend(m_impl->characters16() + pos, numberOfCharactersToCopy); - } -} - -// StringHash is the default hash for String -template -struct DefaultHash; -template <> -struct DefaultHash { - typedef StringHash Hash; -}; - -// Shared global empty string. -WTF_EXPORT const String& emptyString(); -WTF_EXPORT extern const String& xmlnsWithColon; - -} // namespace WTF - -WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(String); - -using WTF::CString; -using WTF::KeepTrailingZeros; -using WTF::StrictUTF8Conversion; -using WTF::StrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD; -using WTF::String; -using WTF::append; -using WTF::appendNumber; -using WTF::charactersAreAllASCII; -using WTF::charactersToDouble; -using WTF::charactersToFloat; -using WTF::charactersToInt; -using WTF::charactersToInt64; -using WTF::charactersToInt64Strict; -using WTF::charactersToIntPtr; -using WTF::charactersToIntPtrStrict; -using WTF::charactersToIntStrict; -using WTF::charactersToUInt; -using WTF::charactersToUInt64; -using WTF::charactersToUInt64Strict; -using WTF::charactersToUIntStrict; -using WTF::emptyString; -using WTF::equal; -using WTF::equalIgnoringCase; -using WTF::find; -using WTF::isAllSpecialCharacters; -using WTF::isSpaceOrNewline; -using WTF::reverseFind; - -#include "flutter/sky/engine/wtf/text/AtomicString.h" -#endif // SKY_ENGINE_WTF_TEXT_WTFSTRING_H_ diff --git a/sky/engine/wtf/text/WTFStringTest.cpp b/sky/engine/wtf/text/WTFStringTest.cpp deleted file mode 100644 index fab38a17efd43..0000000000000 --- a/sky/engine/wtf/text/WTFStringTest.cpp +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Copyright (C) 2012 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include "flutter/sky/engine/wtf/MathExtras.h" -#include "flutter/sky/engine/wtf/text/CString.h" -#include "flutter/sky/engine/wtf/text/WTFString.h" - -namespace { - -TEST(WTF, StringCreationFromLiteral) { - String stringFromLiteral("Explicit construction syntax"); - ASSERT_EQ(strlen("Explicit construction syntax"), stringFromLiteral.length()); - ASSERT_TRUE(stringFromLiteral == "Explicit construction syntax"); - ASSERT_TRUE(stringFromLiteral.is8Bit()); - ASSERT_TRUE(String("Explicit construction syntax") == stringFromLiteral); -} - -TEST(WTF, StringASCII) { - CString output; - - // Null String. - output = String().ascii(); - ASSERT_STREQ("", output.data()); - - // Empty String. - output = emptyString().ascii(); - ASSERT_STREQ("", output.data()); - - // Regular String. - output = String("foobar").ascii(); - ASSERT_STREQ("foobar", output.data()); -} - -static void testNumberToStringECMAScript(double number, const char* reference) { - CString numberString = String::numberToStringECMAScript(number).latin1(); - ASSERT_STREQ(reference, numberString.data()); -} - -TEST(WTF, StringNumberToStringECMAScriptBoundaries) { - typedef std::numeric_limits Limits; - - // Infinity. - testNumberToStringECMAScript(Limits::infinity(), "Infinity"); - testNumberToStringECMAScript(-Limits::infinity(), "-Infinity"); - - // NaN. - testNumberToStringECMAScript(-Limits::quiet_NaN(), "NaN"); - - // Zeros. - testNumberToStringECMAScript(0, "0"); - testNumberToStringECMAScript(-0, "0"); - - // Min-Max. - testNumberToStringECMAScript(Limits::min(), "2.2250738585072014e-308"); - testNumberToStringECMAScript(Limits::max(), "1.7976931348623157e+308"); -} - -TEST(WTF, StringNumberToStringECMAScriptRegularNumbers) { - // Pi. - testNumberToStringECMAScript(piDouble, "3.141592653589793"); - testNumberToStringECMAScript(piFloat, "3.1415927410125732"); - testNumberToStringECMAScript(piOverTwoDouble, "1.5707963267948966"); - testNumberToStringECMAScript(piOverTwoFloat, "1.5707963705062866"); - testNumberToStringECMAScript(piOverFourDouble, "0.7853981633974483"); - testNumberToStringECMAScript(piOverFourFloat, "0.7853981852531433"); - - // e. - const double e = 2.71828182845904523536028747135266249775724709369995; - testNumberToStringECMAScript(e, "2.718281828459045"); - - // c, speed of light in m/s. - const double c = 299792458; - testNumberToStringECMAScript(c, "299792458"); - - // Golen ratio. - const double phi = 1.6180339887498948482; - testNumberToStringECMAScript(phi, "1.618033988749895"); -} - -TEST(WTF, StringReplaceWithLiteral) { - // Cases for 8Bit source. - String testString = "1224"; - ASSERT_TRUE(testString.is8Bit()); - testString.replaceWithLiteral('2', ""); - ASSERT_STREQ("14", testString.utf8().data()); - - testString = "1224"; - ASSERT_TRUE(testString.is8Bit()); - testString.replaceWithLiteral('2', "3"); - ASSERT_STREQ("1334", testString.utf8().data()); - - testString = "1224"; - ASSERT_TRUE(testString.is8Bit()); - testString.replaceWithLiteral('2', "555"); - ASSERT_STREQ("15555554", testString.utf8().data()); - - testString = "1224"; - ASSERT_TRUE(testString.is8Bit()); - testString.replaceWithLiteral('3', "NotFound"); - ASSERT_STREQ("1224", testString.utf8().data()); - - // Cases for 16Bit source. - testString = String::fromUTF8("résumé"); - ASSERT_FALSE(testString.is8Bit()); - testString.replaceWithLiteral(UChar(0x00E9 /*U+00E9 is 'é'*/), "e"); - ASSERT_STREQ("resume", testString.utf8().data()); - - testString = String::fromUTF8("résumé"); - ASSERT_FALSE(testString.is8Bit()); - testString.replaceWithLiteral(UChar(0x00E9 /*U+00E9 is 'é'*/), ""); - ASSERT_STREQ("rsum", testString.utf8().data()); - - testString = String::fromUTF8("résumé"); - ASSERT_FALSE(testString.is8Bit()); - testString.replaceWithLiteral('3', "NotFound"); - ASSERT_STREQ("résumé", testString.utf8().data()); -} - -TEST(WTF, StringComparisonOfSameStringVectors) { - Vector stringVector; - stringVector.append("one"); - stringVector.append("two"); - - Vector sameStringVector; - sameStringVector.append("one"); - sameStringVector.append("two"); - - ASSERT_EQ(stringVector, sameStringVector); -} - -TEST(WTF, SimplifyWhiteSpace) { - String extraSpaces(" Hello world "); - ASSERT_EQ(String("Hello world"), extraSpaces.simplifyWhiteSpace()); - ASSERT_EQ(String(" Hello world "), - extraSpaces.simplifyWhiteSpace(WTF::DoNotStripWhiteSpace)); - - String extraSpacesAndNewlines(" \nHello\n world\n "); - ASSERT_EQ(String("Hello world"), extraSpacesAndNewlines.simplifyWhiteSpace()); - ASSERT_EQ( - String(" Hello world "), - extraSpacesAndNewlines.simplifyWhiteSpace(WTF::DoNotStripWhiteSpace)); - - String extraSpacesAndTabs(" \nHello\t world\t "); - ASSERT_EQ(String("Hello world"), extraSpacesAndTabs.simplifyWhiteSpace()); - ASSERT_EQ(String(" Hello world "), - extraSpacesAndTabs.simplifyWhiteSpace(WTF::DoNotStripWhiteSpace)); -} - -struct CaseFoldingTestData { - const char* sourceDescription; - const char* source; - const char** localeList; - size_t localeListLength; - const char* expected; -}; - -// \xC4\xB0 = U+0130 (capital dotted I) -// \xC4\xB1 = U+0131 (lowercase dotless I) -const char* turkicInput = "Isi\xC4\xB0 \xC4\xB0s\xC4\xB1I"; -const char* greekInput = - "\xCE\x9F\xCE\x94\xCE\x8C\xCE\xA3 \xCE\x9F\xCE\xB4\xCF\x8C\xCF\x82 " - "\xCE\xA3\xCE\xBF \xCE\xA3\xCE\x9F o\xCE\xA3 \xCE\x9F\xCE\xA3 \xCF\x83 " - "\xE1\xBC\x95\xCE\xBE"; -const char* lithuanianInput = - "I \xC3\x8F J J\xCC\x88 \xC4\xAE \xC4\xAE\xCC\x88 \xC3\x8C \xC3\x8D " - "\xC4\xA8 xi\xCC\x87\xCC\x88 xj\xCC\x87\xCC\x88 x\xC4\xAF\xCC\x87\xCC\x88 " - "xi\xCC\x87\xCC\x80 xi\xCC\x87\xCC\x81 xi\xCC\x87\xCC\x83 XI X\xC3\x8F XJ " - "XJ\xCC\x88 X\xC4\xAE X\xC4\xAE\xCC\x88"; - -const char* turkicLocales[] = { - "tr", "tr-TR", "tr_TR", "tr@foo=bar", "tr-US", "TR", "tr-tr", "tR", - "az", "az-AZ", "az_AZ", "az@foo=bar", "az-US", "Az", "AZ-AZ", -}; -const char* nonTurkicLocales[] = { - "en", "en-US", "en_US", "en@foo=bar", "EN", "En", - "ja", "el", "fil", "fi", "lt", -}; -const char* greekLocales[] = { - "el", "el-GR", "el_GR", "el@foo=bar", "el-US", "EL", "el-gr", "eL", -}; -const char* nonGreekLocales[] = { - "en", "en-US", "en_US", "en@foo=bar", "EN", "En", - "ja", "tr", "az", "fil", "fi", "lt", -}; -const char* lithuanianLocales[] = { - "lt", "lt-LT", "lt_LT", "lt@foo=bar", "lt-US", "LT", "lt-lt", "lT", -}; -// Should not have "tr" or "az" because "lt" and 'tr/az' rules conflict with -// each other. -const char* nonLithuanianLocales[] = { - "en", "en-US", "en_US", "en@foo=bar", "EN", "En", "ja", "fil", "fi", "el", -}; - -TEST(WTF, StringToUpperLocale) { - CaseFoldingTestData testDataList[] = { - { - "Turkic input", - turkicInput, - turkicLocales, - sizeof(turkicLocales) / sizeof(const char*), - "IS\xC4\xB0\xC4\xB0 \xC4\xB0SII", - }, - { - "Turkic input", - turkicInput, - nonTurkicLocales, - sizeof(nonTurkicLocales) / sizeof(const char*), - "ISI\xC4\xB0 \xC4\xB0SII", - }, - { - "Greek input", - greekInput, - greekLocales, - sizeof(greekLocales) / sizeof(const char*), - "\xCE\x9F\xCE\x94\xCE\x9F\xCE\xA3 \xCE\x9F\xCE\x94\xCE\x9F\xCE\xA3 " - "\xCE\xA3\xCE\x9F \xCE\xA3\xCE\x9F \x4F\xCE\xA3 \xCE\x9F\xCE\xA3 " - "\xCE\xA3 \xCE\x95\xCE\x9E", - }, - { - "Greek input", - greekInput, - nonGreekLocales, - sizeof(nonGreekLocales) / sizeof(const char*), - "\xCE\x9F\xCE\x94\xCE\x8C\xCE\xA3 \xCE\x9F\xCE\x94\xCE\x8C\xCE\xA3 " - "\xCE\xA3\xCE\x9F \xCE\xA3\xCE\x9F \x4F\xCE\xA3 \xCE\x9F\xCE\xA3 " - "\xCE\xA3 \xE1\xBC\x9D\xCE\x9E", - }, - { - "Lithuanian input", - lithuanianInput, - lithuanianLocales, - sizeof(lithuanianLocales) / sizeof(const char*), - "I \xC3\x8F J J\xCC\x88 \xC4\xAE \xC4\xAE\xCC\x88 \xC3\x8C \xC3\x8D " - "\xC4\xA8 XI\xCC\x88 XJ\xCC\x88 X\xC4\xAE\xCC\x88 XI\xCC\x80 " - "XI\xCC\x81 XI\xCC\x83 XI X\xC3\x8F XJ XJ\xCC\x88 X\xC4\xAE " - "X\xC4\xAE\xCC\x88", - }, - { - "Lithuanian input", - lithuanianInput, - nonLithuanianLocales, - sizeof(nonLithuanianLocales) / sizeof(const char*), - "I \xC3\x8F J J\xCC\x88 \xC4\xAE \xC4\xAE\xCC\x88 \xC3\x8C \xC3\x8D " - "\xC4\xA8 XI\xCC\x87\xCC\x88 XJ\xCC\x87\xCC\x88 " - "X\xC4\xAE\xCC\x87\xCC\x88 XI\xCC\x87\xCC\x80 XI\xCC\x87\xCC\x81 " - "XI\xCC\x87\xCC\x83 XI X\xC3\x8F XJ XJ\xCC\x88 X\xC4\xAE " - "X\xC4\xAE\xCC\x88", - }, - }; - - for (size_t i = 0; i < sizeof(testDataList) / sizeof(testDataList[0]); ++i) { - const char* expected = testDataList[i].expected; - String source = String::fromUTF8(testDataList[i].source); - for (size_t j = 0; j < testDataList[i].localeListLength; ++j) { - const char* locale = testDataList[i].localeList[j]; - EXPECT_STREQ(expected, source.upper(locale).utf8().data()) - << testDataList[i].sourceDescription << "; locale=" << locale; - } - } -} - -TEST(WTF, StringToLowerLocale) { - CaseFoldingTestData testDataList[] = { - { - "Turkic input", - turkicInput, - turkicLocales, - sizeof(turkicLocales) / sizeof(const char*), - "\xC4\xB1sii is\xC4\xB1\xC4\xB1", - }, - { - "Turkic input", - turkicInput, - nonTurkicLocales, - sizeof(nonTurkicLocales) / sizeof(const char*), - // U+0130 is lowercased to U+0069 followed by U+0307 - "isii\xCC\x87 i\xCC\x87s\xC4\xB1i", - }, - { - "Greek input", - greekInput, - greekLocales, - sizeof(greekLocales) / sizeof(const char*), - "\xCE\xBF\xCE\xB4\xCF\x8C\xCF\x82 \xCE\xBF\xCE\xB4\xCF\x8C\xCF\x82 " - "\xCF\x83\xCE\xBF \xCF\x83\xCE\xBF \x6F\xCF\x82 \xCE\xBF\xCF\x82 " - "\xCF\x83 \xE1\xBC\x95\xCE\xBE", - }, - { - "Greek input", - greekInput, - nonGreekLocales, - sizeof(greekLocales) / sizeof(const char*), - "\xCE\xBF\xCE\xB4\xCF\x8C\xCF\x82 \xCE\xBF\xCE\xB4\xCF\x8C\xCF\x82 " - "\xCF\x83\xCE\xBF \xCF\x83\xCE\xBF \x6F\xCF\x82 \xCE\xBF\xCF\x82 " - "\xCF\x83 \xE1\xBC\x95\xCE\xBE", - }, - { - "Lithuanian input", - lithuanianInput, - lithuanianLocales, - sizeof(lithuanianLocales) / sizeof(const char*), - "i \xC3\xAF j j\xCC\x87\xCC\x88 \xC4\xAF \xC4\xAF\xCC\x87\xCC\x88 " - "i\xCC\x87\xCC\x80 i\xCC\x87\xCC\x81 i\xCC\x87\xCC\x83 " - "xi\xCC\x87\xCC\x88 xj\xCC\x87\xCC\x88 x\xC4\xAF\xCC\x87\xCC\x88 " - "xi\xCC\x87\xCC\x80 xi\xCC\x87\xCC\x81 xi\xCC\x87\xCC\x83 xi " - "x\xC3\xAF xj xj\xCC\x87\xCC\x88 x\xC4\xAF x\xC4\xAF\xCC\x87\xCC\x88", - }, - { - "Lithuanian input", - lithuanianInput, - nonLithuanianLocales, - sizeof(nonLithuanianLocales) / sizeof(const char*), - "\x69 \xC3\xAF \x6A \x6A\xCC\x88 \xC4\xAF \xC4\xAF\xCC\x88 \xC3\xAC " - "\xC3\xAD \xC4\xA9 \x78\x69\xCC\x87\xCC\x88 \x78\x6A\xCC\x87\xCC\x88 " - "\x78\xC4\xAF\xCC\x87\xCC\x88 \x78\x69\xCC\x87\xCC\x80 " - "\x78\x69\xCC\x87\xCC\x81 \x78\x69\xCC\x87\xCC\x83 \x78\x69 " - "\x78\xC3\xAF \x78\x6A \x78\x6A\xCC\x88 \x78\xC4\xAF " - "\x78\xC4\xAF\xCC\x88", - }, - }; - - for (size_t i = 0; i < sizeof(testDataList) / sizeof(testDataList[0]); ++i) { - const char* expected = testDataList[i].expected; - String source = String::fromUTF8(testDataList[i].source); - for (size_t j = 0; j < testDataList[i].localeListLength; ++j) { - const char* locale = testDataList[i].localeList[j]; - EXPECT_STREQ(expected, source.lower(locale).utf8().data()) - << testDataList[i].sourceDescription << "; locale=" << locale; - } - } -} - -} // namespace diff --git a/sky/engine/wtf/unicode/CharacterNames.h b/sky/engine/wtf/unicode/CharacterNames.h deleted file mode 100644 index c93ed2f1cf10c..0000000000000 --- a/sky/engine/wtf/unicode/CharacterNames.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_UNICODE_CHARACTERNAMES_H_ -#define SKY_ENGINE_WTF_UNICODE_CHARACTERNAMES_H_ - -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace WTF { -namespace Unicode { - -// Names here are taken from the Unicode standard. - -// Most of these are UChar constants, not UChar32, which makes them -// more convenient for WebCore code that mostly uses UTF-16. - -const UChar32 aegeanWordSeparatorLine = 0x10100; -const UChar32 aegeanWordSeparatorDot = 0x10101; -const UChar blackCircle = 0x25CF; -const UChar blackSquare = 0x25A0; -const UChar blackUpPointingTriangle = 0x25B2; -const UChar bullet = 0x2022; -const UChar bullseye = 0x25CE; -const UChar carriageReturn = 0x000D; -const UChar characterTabulation = 0x0009; -const UChar ethiopicPrefaceColon = 0x1366; -const UChar ethiopicWordspace = 0x1361; -const UChar fisheye = 0x25C9; -const UChar hebrewPunctuationGeresh = 0x05F3; -const UChar hebrewPunctuationGershayim = 0x05F4; -const UChar HiraganaLetterSmallA = 0x3041; -const UChar horizontalEllipsis = 0x2026; -const UChar hyphen = 0x2010; -const UChar hyphenMinus = 0x002D; -const UChar ideographicComma = 0x3001; -const UChar ideographicFullStop = 0x3002; -const UChar ideographicSpace = 0x3000; -const UChar leftDoubleQuotationMark = 0x201C; -const UChar leftSingleQuotationMark = 0x2018; -const UChar leftToRightEmbed = 0x202A; -const UChar leftToRightMark = 0x200E; -const UChar leftToRightOverride = 0x202D; -const UChar minusSign = 0x2212; -const UChar newlineCharacter = 0x000A; -const UChar noBreakSpace = 0x00A0; -const UChar objectReplacementCharacter = 0xFFFC; -const UChar popDirectionalFormatting = 0x202C; -const UChar replacementCharacter = 0xFFFD; -const UChar rightDoubleQuotationMark = 0x201D; -const UChar rightSingleQuotationMark = 0x2019; -const UChar rightToLeftEmbed = 0x202B; -const UChar rightToLeftMark = 0x200F; -const UChar rightToLeftOverride = 0x202E; -const UChar sesameDot = 0xFE45; -const UChar smallLetterSharpS = 0x00DF; -const UChar softHyphen = 0x00AD; -const UChar space = 0x0020; -const UChar tibetanMarkIntersyllabicTsheg = 0x0F0B; -const UChar tibetanMarkDelimiterTshegBstar = 0x0F0C; -const UChar32 ugariticWordDivider = 0x1039F; -const UChar whiteBullet = 0x25E6; -const UChar whiteCircle = 0x25CB; -const UChar whiteSesameDot = 0xFE46; -const UChar whiteUpPointingTriangle = 0x25B3; -const UChar yenSign = 0x00A5; -const UChar zeroWidthJoiner = 0x200D; -const UChar zeroWidthNonJoiner = 0x200C; -const UChar zeroWidthSpace = 0x200B; -const UChar zeroWidthNoBreakSpace = 0xFEFF; - -} // namespace Unicode -} // namespace WTF - -using WTF::Unicode::HiraganaLetterSmallA; -using WTF::Unicode::aegeanWordSeparatorDot; -using WTF::Unicode::aegeanWordSeparatorLine; -using WTF::Unicode::blackCircle; -using WTF::Unicode::blackSquare; -using WTF::Unicode::blackUpPointingTriangle; -using WTF::Unicode::bullet; -using WTF::Unicode::bullseye; -using WTF::Unicode::carriageReturn; -using WTF::Unicode::characterTabulation; -using WTF::Unicode::ethiopicPrefaceColon; -using WTF::Unicode::ethiopicWordspace; -using WTF::Unicode::fisheye; -using WTF::Unicode::hebrewPunctuationGeresh; -using WTF::Unicode::hebrewPunctuationGershayim; -using WTF::Unicode::horizontalEllipsis; -using WTF::Unicode::hyphen; -using WTF::Unicode::hyphenMinus; -using WTF::Unicode::ideographicComma; -using WTF::Unicode::ideographicFullStop; -using WTF::Unicode::ideographicSpace; -using WTF::Unicode::leftDoubleQuotationMark; -using WTF::Unicode::leftSingleQuotationMark; -using WTF::Unicode::leftToRightEmbed; -using WTF::Unicode::leftToRightMark; -using WTF::Unicode::leftToRightOverride; -using WTF::Unicode::minusSign; -using WTF::Unicode::newlineCharacter; -using WTF::Unicode::noBreakSpace; -using WTF::Unicode::objectReplacementCharacter; -using WTF::Unicode::popDirectionalFormatting; -using WTF::Unicode::replacementCharacter; -using WTF::Unicode::rightDoubleQuotationMark; -using WTF::Unicode::rightSingleQuotationMark; -using WTF::Unicode::rightToLeftEmbed; -using WTF::Unicode::rightToLeftMark; -using WTF::Unicode::rightToLeftOverride; -using WTF::Unicode::sesameDot; -using WTF::Unicode::softHyphen; -using WTF::Unicode::space; -using WTF::Unicode::tibetanMarkDelimiterTshegBstar; -using WTF::Unicode::tibetanMarkIntersyllabicTsheg; -using WTF::Unicode::ugariticWordDivider; -using WTF::Unicode::whiteBullet; -using WTF::Unicode::whiteCircle; -using WTF::Unicode::whiteSesameDot; -using WTF::Unicode::whiteUpPointingTriangle; -using WTF::Unicode::yenSign; -using WTF::Unicode::zeroWidthJoiner; -using WTF::Unicode::zeroWidthNoBreakSpace; -using WTF::Unicode::zeroWidthNonJoiner; -using WTF::Unicode::zeroWidthSpace; - -#endif // SKY_ENGINE_WTF_UNICODE_CHARACTERNAMES_H_ diff --git a/sky/engine/wtf/unicode/Collator.h b/sky/engine/wtf/unicode/Collator.h deleted file mode 100644 index 273ec9735de83..0000000000000 --- a/sky/engine/wtf/unicode/Collator.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_UNICODE_COLLATOR_H_ -#define SKY_ENGINE_WTF_UNICODE_COLLATOR_H_ - -#include "flutter/sky/engine/wtf/FastAllocBase.h" -#include "flutter/sky/engine/wtf/Noncopyable.h" -#include "flutter/sky/engine/wtf/PassOwnPtr.h" -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -struct UCollator; - -namespace WTF { - -class WTF_EXPORT Collator { - WTF_MAKE_NONCOPYABLE(Collator); - WTF_MAKE_FAST_ALLOCATED; - - public: - enum Result { Equal = 0, Greater = 1, Less = -1 }; - - Collator(const char* locale); // Parsing is lenient; e.g. language - // identifiers (such as "en-US") are accepted, - // too. - ~Collator(); - void setOrderLowerFirst(bool); - - static PassOwnPtr userDefault(); - - Result collate(const ::UChar*, size_t, const ::UChar*, size_t) const; - - private: - void createCollator() const; - void releaseCollator(); - mutable UCollator* m_collator; - char* m_locale; - bool m_lowerFirst; -}; -} // namespace WTF - -using WTF::Collator; - -#endif // SKY_ENGINE_WTF_UNICODE_COLLATOR_H_ diff --git a/sky/engine/wtf/unicode/UTF8.cpp b/sky/engine/wtf/unicode/UTF8.cpp deleted file mode 100644 index 32c1a207997e5..0000000000000 --- a/sky/engine/wtf/unicode/UTF8.cpp +++ /dev/null @@ -1,529 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2010 Patrick Gansterer - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/unicode/UTF8.h" - -#include "flutter/sky/engine/wtf/ASCIICType.h" -#include "flutter/sky/engine/wtf/StringHasher.h" -#include "flutter/sky/engine/wtf/unicode/CharacterNames.h" - -namespace WTF { -namespace Unicode { - -inline int inlineUTF8SequenceLengthNonASCII(char b0) { - if ((b0 & 0xC0) != 0xC0) - return 0; - if ((b0 & 0xE0) == 0xC0) - return 2; - if ((b0 & 0xF0) == 0xE0) - return 3; - if ((b0 & 0xF8) == 0xF0) - return 4; - return 0; -} - -inline int inlineUTF8SequenceLength(char b0) { - return isASCII(b0) ? 1 : inlineUTF8SequenceLengthNonASCII(b0); -} - -int UTF8SequenceLength(char b0) { - return isASCII(b0) ? 1 : inlineUTF8SequenceLengthNonASCII(b0); -} - -int decodeUTF8Sequence(const char* sequence) { - // Handle 0-byte sequences (never valid). - const unsigned char b0 = sequence[0]; - const int length = inlineUTF8SequenceLength(b0); - if (length == 0) - return -1; - - // Handle 1-byte sequences (plain ASCII). - const unsigned char b1 = sequence[1]; - if (length == 1) { - if (b1) - return -1; - return b0; - } - - // Handle 2-byte sequences. - if ((b1 & 0xC0) != 0x80) - return -1; - const unsigned char b2 = sequence[2]; - if (length == 2) { - if (b2) - return -1; - const int c = ((b0 & 0x1F) << 6) | (b1 & 0x3F); - if (c < 0x80) - return -1; - return c; - } - - // Handle 3-byte sequences. - if ((b2 & 0xC0) != 0x80) - return -1; - const unsigned char b3 = sequence[3]; - if (length == 3) { - if (b3) - return -1; - const int c = ((b0 & 0xF) << 12) | ((b1 & 0x3F) << 6) | (b2 & 0x3F); - if (c < 0x800) - return -1; - // UTF-16 surrogates should never appear in UTF-8 data. - if (c >= 0xD800 && c <= 0xDFFF) - return -1; - return c; - } - - // Handle 4-byte sequences. - if ((b3 & 0xC0) != 0x80) - return -1; - const unsigned char b4 = sequence[4]; - if (length == 4) { - if (b4) - return -1; - const int c = ((b0 & 0x7) << 18) | ((b1 & 0x3F) << 12) | - ((b2 & 0x3F) << 6) | (b3 & 0x3F); - if (c < 0x10000 || c > 0x10FFFF) - return -1; - return c; - } - - return -1; -} - -// Once the bits are split out into bytes of UTF-8, this is a mask OR-ed -// into the first byte, depending on how many bytes follow. There are -// as many entries in this table as there are UTF-8 sequence types. -// (I.e., one byte sequence, two byte... etc.). Remember that sequencs -// for *legal* UTF-8 will be 4 or fewer bytes total. -static const unsigned char firstByteMark[7] = {0x00, 0x00, 0xC0, 0xE0, - 0xF0, 0xF8, 0xFC}; - -ConversionResult convertLatin1ToUTF8(const LChar** sourceStart, - const LChar* sourceEnd, - char** targetStart, - char* targetEnd) { - ConversionResult result = conversionOK; - const LChar* source = *sourceStart; - char* target = *targetStart; - while (source < sourceEnd) { - UChar32 ch; - unsigned short bytesToWrite = 0; - const UChar32 byteMask = 0xBF; - const UChar32 byteMark = 0x80; - const LChar* oldSource = - source; // In case we have to back up because of target overflow. - ch = static_cast(*source++); - - // Figure out how many bytes the result will require - if (ch < (UChar32)0x80) - bytesToWrite = 1; - else - bytesToWrite = 2; - - target += bytesToWrite; - if (target > targetEnd) { - source = oldSource; // Back up source pointer! - target -= bytesToWrite; - result = targetExhausted; - break; - } - switch (bytesToWrite) { // note: everything falls through. - case 2: - *--target = (char)((ch | byteMark) & byteMask); - ch >>= 6; - case 1: - *--target = (char)(ch | firstByteMark[bytesToWrite]); - } - target += bytesToWrite; - } - *sourceStart = source; - *targetStart = target; - return result; -} - -ConversionResult convertUTF16ToUTF8(const UChar** sourceStart, - const UChar* sourceEnd, - char** targetStart, - char* targetEnd, - bool strict) { - ConversionResult result = conversionOK; - const UChar* source = *sourceStart; - char* target = *targetStart; - while (source < sourceEnd) { - UChar32 ch; - unsigned short bytesToWrite = 0; - const UChar32 byteMask = 0xBF; - const UChar32 byteMark = 0x80; - const UChar* oldSource = - source; // In case we have to back up because of target overflow. - ch = static_cast(*source++); - // If we have a surrogate pair, convert to UChar32 first. - if (ch >= 0xD800 && ch <= 0xDBFF) { - // If the 16 bits following the high surrogate are in the source buffer... - if (source < sourceEnd) { - UChar32 ch2 = static_cast(*source); - // If it's a low surrogate, convert to UChar32. - if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { - ch = ((ch - 0xD800) << 10) + (ch2 - 0xDC00) + 0x0010000; - ++source; - } else if (strict) { // it's an unpaired high surrogate - --source; // return to the illegal value itself - result = sourceIllegal; - break; - } - } else { // We don't have the 16 bits following the high surrogate. - --source; // return to the high surrogate - result = sourceExhausted; - break; - } - } else if (strict) { - // UTF-16 surrogate values are illegal in UTF-32 - if (ch >= 0xDC00 && ch <= 0xDFFF) { - --source; // return to the illegal value itself - result = sourceIllegal; - break; - } - } - // Figure out how many bytes the result will require - if (ch < (UChar32)0x80) { - bytesToWrite = 1; - } else if (ch < (UChar32)0x800) { - bytesToWrite = 2; - } else if (ch < (UChar32)0x10000) { - bytesToWrite = 3; - } else if (ch < (UChar32)0x110000) { - bytesToWrite = 4; - } else { - bytesToWrite = 3; - ch = replacementCharacter; - } - - target += bytesToWrite; - if (target > targetEnd) { - source = oldSource; // Back up source pointer! - target -= bytesToWrite; - result = targetExhausted; - break; - } - switch (bytesToWrite) { // note: everything falls through. - case 4: - *--target = (char)((ch | byteMark) & byteMask); - ch >>= 6; - case 3: - *--target = (char)((ch | byteMark) & byteMask); - ch >>= 6; - case 2: - *--target = (char)((ch | byteMark) & byteMask); - ch >>= 6; - case 1: - *--target = (char)(ch | firstByteMark[bytesToWrite]); - } - target += bytesToWrite; - } - *sourceStart = source; - *targetStart = target; - return result; -} - -// This must be called with the length pre-determined by the first byte. -// If presented with a length > 4, this returns false. The Unicode -// definition of UTF-8 goes up to 4-byte sequences. -static bool isLegalUTF8(const unsigned char* source, int length) { - unsigned char a; - const unsigned char* srcptr = source + length; - switch (length) { - default: - return false; - // Everything else falls through when "true"... - case 4: - if ((a = (*--srcptr)) < 0x80 || a > 0xBF) - return false; - case 3: - if ((a = (*--srcptr)) < 0x80 || a > 0xBF) - return false; - case 2: - if ((a = (*--srcptr)) > 0xBF) - return false; - - switch (*source) { - // no fall-through in this inner switch - case 0xE0: - if (a < 0xA0) - return false; - break; - case 0xED: - if (a > 0x9F) - return false; - break; - case 0xF0: - if (a < 0x90) - return false; - break; - case 0xF4: - if (a > 0x8F) - return false; - break; - default: - if (a < 0x80) - return false; - } - - case 1: - if (*source >= 0x80 && *source < 0xC2) - return false; - } - if (*source > 0xF4) - return false; - return true; -} - -// Magic values subtracted from a buffer value during UTF8 conversion. -// This table contains as many values as there might be trailing bytes -// in a UTF-8 sequence. -static const UChar32 offsetsFromUTF8[6] = {0x00000000UL, - 0x00003080UL, - 0x000E2080UL, - 0x03C82080UL, - static_cast(0xFA082080UL), - static_cast(0x82082080UL)}; - -static inline UChar32 readUTF8Sequence(const char*& sequence, unsigned length) { - UChar32 character = 0; - - // The cases all fall through. - switch (length) { - case 6: - character += static_cast(*sequence++); - character <<= 6; - case 5: - character += static_cast(*sequence++); - character <<= 6; - case 4: - character += static_cast(*sequence++); - character <<= 6; - case 3: - character += static_cast(*sequence++); - character <<= 6; - case 2: - character += static_cast(*sequence++); - character <<= 6; - case 1: - character += static_cast(*sequence++); - } - - return character - offsetsFromUTF8[length - 1]; -} - -ConversionResult convertUTF8ToUTF16(const char** sourceStart, - const char* sourceEnd, - UChar** targetStart, - UChar* targetEnd, - bool* sourceAllASCII, - bool strict) { - ConversionResult result = conversionOK; - const char* source = *sourceStart; - UChar* target = *targetStart; - UChar orAllData = 0; - while (source < sourceEnd) { - int utf8SequenceLength = inlineUTF8SequenceLength(*source); - if (sourceEnd - source < utf8SequenceLength) { - result = sourceExhausted; - break; - } - // Do this check whether lenient or strict - if (!isLegalUTF8(reinterpret_cast(source), - utf8SequenceLength)) { - result = sourceIllegal; - break; - } - - UChar32 character = readUTF8Sequence(source, utf8SequenceLength); - - if (target >= targetEnd) { - source -= utf8SequenceLength; // Back up source pointer! - result = targetExhausted; - break; - } - - if (U_IS_BMP(character)) { - // UTF-16 surrogate values are illegal in UTF-32 - if (U_IS_SURROGATE(character)) { - if (strict) { - source -= utf8SequenceLength; // return to the illegal value itself - result = sourceIllegal; - break; - } else { - *target++ = replacementCharacter; - orAllData |= replacementCharacter; - } - } else { - *target++ = character; // normal case - orAllData |= character; - } - } else if (U_IS_SUPPLEMENTARY(character)) { - // target is a character in range 0xFFFF - 0x10FFFF - if (target + 1 >= targetEnd) { - source -= utf8SequenceLength; // Back up source pointer! - result = targetExhausted; - break; - } - *target++ = U16_LEAD(character); - *target++ = U16_TRAIL(character); - orAllData = 0xffff; - } else { - if (strict) { - source -= utf8SequenceLength; // return to the start - result = sourceIllegal; - break; // Bail out; shouldn't continue - } else { - *target++ = replacementCharacter; - orAllData |= replacementCharacter; - } - } - } - *sourceStart = source; - *targetStart = target; - - if (sourceAllASCII) - *sourceAllASCII = !(orAllData & ~0x7f); - - return result; -} - -unsigned calculateStringHashAndLengthFromUTF8MaskingTop8Bits( - const char* data, - const char* dataEnd, - unsigned& dataLength, - unsigned& utf16Length) { - if (!data) - return 0; - - StringHasher stringHasher; - dataLength = 0; - utf16Length = 0; - - while (data < dataEnd || (!dataEnd && *data)) { - if (isASCII(*data)) { - stringHasher.addCharacter(*data++); - dataLength++; - utf16Length++; - continue; - } - - int utf8SequenceLength = inlineUTF8SequenceLengthNonASCII(*data); - dataLength += utf8SequenceLength; - - if (!dataEnd) { - for (int i = 1; i < utf8SequenceLength; ++i) { - if (!data[i]) - return 0; - } - } else if (dataEnd - data < utf8SequenceLength) - return 0; - - if (!isLegalUTF8(reinterpret_cast(data), - utf8SequenceLength)) - return 0; - - UChar32 character = readUTF8Sequence(data, utf8SequenceLength); - ASSERT(!isASCII(character)); - - if (U_IS_BMP(character)) { - // UTF-16 surrogate values are illegal in UTF-32 - if (U_IS_SURROGATE(character)) - return 0; - stringHasher.addCharacter(static_cast(character)); // normal case - utf16Length++; - } else if (U_IS_SUPPLEMENTARY(character)) { - stringHasher.addCharacters(static_cast(U16_LEAD(character)), - static_cast(U16_TRAIL(character))); - utf16Length += 2; - } else - return 0; - } - - return stringHasher.hashWithTop8BitsMasked(); -} - -template -ALWAYS_INLINE bool equalWithUTF8Internal(const CharType* a, - const CharType* aEnd, - const char* b, - const char* bEnd) { - while (b < bEnd) { - if (isASCII(*b)) { - if (*a++ != *b++) - return false; - continue; - } - - int utf8SequenceLength = inlineUTF8SequenceLengthNonASCII(*b); - - if (bEnd - b < utf8SequenceLength) - return false; - - if (!isLegalUTF8(reinterpret_cast(b), - utf8SequenceLength)) - return 0; - - UChar32 character = readUTF8Sequence(b, utf8SequenceLength); - ASSERT(!isASCII(character)); - - if (U_IS_BMP(character)) { - // UTF-16 surrogate values are illegal in UTF-32 - if (U_IS_SURROGATE(character)) - return false; - if (*a++ != character) - return false; - } else if (U_IS_SUPPLEMENTARY(character)) { - if (*a++ != U16_LEAD(character)) - return false; - if (*a++ != U16_TRAIL(character)) - return false; - } else - return false; - } - - return a == aEnd; -} - -bool equalUTF16WithUTF8(const UChar* a, - const UChar* aEnd, - const char* b, - const char* bEnd) { - return equalWithUTF8Internal(a, aEnd, b, bEnd); -} - -bool equalLatin1WithUTF8(const LChar* a, - const LChar* aEnd, - const char* b, - const char* bEnd) { - return equalWithUTF8Internal(a, aEnd, b, bEnd); -} - -} // namespace Unicode -} // namespace WTF diff --git a/sky/engine/wtf/unicode/UTF8.h b/sky/engine/wtf/unicode/UTF8.h deleted file mode 100644 index 34df937d251da..0000000000000 --- a/sky/engine/wtf/unicode/UTF8.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_WTF_UNICODE_UTF8_H_ -#define SKY_ENGINE_WTF_UNICODE_UTF8_H_ - -#include "flutter/sky/engine/wtf/WTFExport.h" -#include "flutter/sky/engine/wtf/unicode/Unicode.h" - -namespace WTF { -namespace Unicode { - -// Given a first byte, gives the length of the UTF-8 sequence it begins. -// Returns 0 for bytes that are not legal starts of UTF-8 sequences. -// Only allows sequences of up to 4 bytes, since that works for all Unicode -// characters (U-00000000 to U-0010FFFF). -WTF_EXPORT int UTF8SequenceLength(char); - -// Takes a null-terminated C-style string with a UTF-8 sequence in it and -// converts it to a character. Only allows Unicode characters (U-00000000 to -// U-0010FFFF). Returns -1 if the sequence is not valid (including presence of -// extra bytes). -WTF_EXPORT int decodeUTF8Sequence(const char*); - -typedef enum { - conversionOK, // conversion successful - sourceExhausted, // partial character in source, but hit end - targetExhausted, // insuff. room in target for conversion - sourceIllegal // source sequence is illegal/malformed -} ConversionResult; - -// These conversion functions take a "strict" argument. When this -// flag is set to strict, both irregular sequences and isolated surrogates -// will cause an error. When the flag is set to lenient, both irregular -// sequences and isolated surrogates are converted. -// -// Whether the flag is strict or lenient, all illegal sequences will cause -// an error return. This includes sequences such as: , , -// or in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code -// must check for illegal sequences. -// -// When the flag is set to lenient, characters over 0x10FFFF are converted -// to the replacement character; otherwise (when the flag is set to strict) -// they constitute an error. - -WTF_EXPORT ConversionResult convertUTF8ToUTF16(const char** sourceStart, - const char* sourceEnd, - UChar** targetStart, - UChar* targetEnd, - bool* isSourceAllASCII = 0, - bool strict = true); - -WTF_EXPORT ConversionResult convertLatin1ToUTF8(const LChar** sourceStart, - const LChar* sourceEnd, - char** targetStart, - char* targetEnd); - -WTF_EXPORT ConversionResult convertUTF16ToUTF8(const UChar** sourceStart, - const UChar* sourceEnd, - char** targetStart, - char* targetEnd, - bool strict = true); - -WTF_EXPORT unsigned calculateStringHashAndLengthFromUTF8MaskingTop8Bits( - const char* data, - const char* dataEnd, - unsigned& dataLength, - unsigned& utf16Length); - -WTF_EXPORT bool equalUTF16WithUTF8(const UChar* a, - const UChar* aEnd, - const char* b, - const char* bEnd); -WTF_EXPORT bool equalLatin1WithUTF8(const LChar* a, - const LChar* aEnd, - const char* b, - const char* bEnd); - -} // namespace Unicode -} // namespace WTF - -#endif // SKY_ENGINE_WTF_UNICODE_UTF8_H_ diff --git a/sky/engine/wtf/unicode/Unicode.h b/sky/engine/wtf/unicode/Unicode.h deleted file mode 100644 index 26e5aae53975f..0000000000000 --- a/sky/engine/wtf/unicode/Unicode.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2006 George Staikos - * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_UNICODE_UNICODE_H_ -#define SKY_ENGINE_WTF_UNICODE_UNICODE_H_ - -#include "flutter/sky/engine/wtf/Assertions.h" - -// Define platform neutral 8 bit character type (L is for Latin-1). -typedef unsigned char LChar; - -#include "flutter/sky/engine/wtf/unicode/icu/UnicodeIcu.h" - -COMPILE_ASSERT(sizeof(UChar) == 2, UCharIsTwoBytes); - -#endif // SKY_ENGINE_WTF_UNICODE_UNICODE_H_ diff --git a/sky/engine/wtf/unicode/icu/CollatorICU.cpp b/sky/engine/wtf/unicode/icu/CollatorICU.cpp deleted file mode 100644 index 6013680f2e4a6..0000000000000 --- a/sky/engine/wtf/unicode/icu/CollatorICU.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "flutter/sky/engine/wtf/unicode/Collator.h" - -#include -#include -#include -#include "flutter/sky/engine/wtf/Assertions.h" -#include "flutter/sky/engine/wtf/StringExtras.h" -#include "flutter/sky/engine/wtf/Threading.h" -#include "flutter/sky/engine/wtf/ThreadingPrimitives.h" - -namespace WTF { - -static UCollator* cachedCollator; -static Mutex& cachedCollatorMutex() { - AtomicallyInitializedStatic(Mutex&, mutex = *new Mutex); - return mutex; -} - -Collator::Collator(const char* locale) - : m_collator(0), - m_locale(locale ? strdup(locale) : 0), - m_lowerFirst(false) {} - -PassOwnPtr Collator::userDefault() { - return adoptPtr(new Collator(0)); -} - -Collator::~Collator() { - releaseCollator(); - free(m_locale); -} - -void Collator::setOrderLowerFirst(bool lowerFirst) { - m_lowerFirst = lowerFirst; -} - -Collator::Result Collator::collate(const UChar* lhs, - size_t lhsLength, - const UChar* rhs, - size_t rhsLength) const { - if (!m_collator) - createCollator(); - - return static_cast( - ucol_strcoll(m_collator, lhs, lhsLength, rhs, rhsLength)); -} - -void Collator::createCollator() const { - ASSERT(!m_collator); - UErrorCode status = U_ZERO_ERROR; - - { - Locker lock(cachedCollatorMutex()); - if (cachedCollator) { - const char* cachedCollatorLocale = - ucol_getLocaleByType(cachedCollator, ULOC_REQUESTED_LOCALE, &status); - ASSERT(U_SUCCESS(status)); - ASSERT(cachedCollatorLocale); - - UColAttributeValue cachedCollatorLowerFirst = - ucol_getAttribute(cachedCollator, UCOL_CASE_FIRST, &status); - ASSERT(U_SUCCESS(status)); - - // FIXME: default locale is never matched, because ucol_getLocaleByType - // returns the actual one used, not 0. - if (m_locale && 0 == strcmp(cachedCollatorLocale, m_locale) && - ((UCOL_LOWER_FIRST == cachedCollatorLowerFirst && m_lowerFirst) || - (UCOL_UPPER_FIRST == cachedCollatorLowerFirst && !m_lowerFirst))) { - m_collator = cachedCollator; - cachedCollator = 0; - return; - } - } - } - - m_collator = ucol_open(m_locale, &status); - if (U_FAILURE(status)) { - status = U_ZERO_ERROR; - m_collator = - ucol_open("", &status); // Fallback to Unicode Collation Algorithm. - } - ASSERT(U_SUCCESS(status)); - - ucol_setAttribute(m_collator, UCOL_CASE_FIRST, - m_lowerFirst ? UCOL_LOWER_FIRST : UCOL_UPPER_FIRST, - &status); - ASSERT(U_SUCCESS(status)); - - ucol_setAttribute(m_collator, UCOL_NORMALIZATION_MODE, UCOL_ON, &status); - ASSERT(U_SUCCESS(status)); -} - -void Collator::releaseCollator() { - { - Locker lock(cachedCollatorMutex()); - if (cachedCollator) - ucol_close(cachedCollator); - cachedCollator = m_collator; - m_collator = 0; - } -} - -} // namespace WTF diff --git a/sky/engine/wtf/unicode/icu/UnicodeIcu.h b/sky/engine/wtf/unicode/icu/UnicodeIcu.h deleted file mode 100644 index f8c329f5301f3..0000000000000 --- a/sky/engine/wtf/unicode/icu/UnicodeIcu.h +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (C) 2006 George Staikos - * Copyright (C) 2006 Alexey Proskuryakov - * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef SKY_ENGINE_WTF_UNICODE_ICU_UNICODEICU_H_ -#define SKY_ENGINE_WTF_UNICODE_ICU_UNICODEICU_H_ - -#include -#include - -namespace WTF { - -namespace Unicode { - -enum Direction { - LeftToRight = U_LEFT_TO_RIGHT, - RightToLeft = U_RIGHT_TO_LEFT, - EuropeanNumber = U_EUROPEAN_NUMBER, - EuropeanNumberSeparator = U_EUROPEAN_NUMBER_SEPARATOR, - EuropeanNumberTerminator = U_EUROPEAN_NUMBER_TERMINATOR, - ArabicNumber = U_ARABIC_NUMBER, - CommonNumberSeparator = U_COMMON_NUMBER_SEPARATOR, - BlockSeparator = U_BLOCK_SEPARATOR, - SegmentSeparator = U_SEGMENT_SEPARATOR, - WhiteSpaceNeutral = U_WHITE_SPACE_NEUTRAL, - OtherNeutral = U_OTHER_NEUTRAL, - LeftToRightEmbedding = U_LEFT_TO_RIGHT_EMBEDDING, - LeftToRightOverride = U_LEFT_TO_RIGHT_OVERRIDE, - RightToLeftArabic = U_RIGHT_TO_LEFT_ARABIC, - RightToLeftEmbedding = U_RIGHT_TO_LEFT_EMBEDDING, - RightToLeftOverride = U_RIGHT_TO_LEFT_OVERRIDE, - PopDirectionalFormat = U_POP_DIRECTIONAL_FORMAT, - NonSpacingMark = U_DIR_NON_SPACING_MARK, - BoundaryNeutral = U_BOUNDARY_NEUTRAL -}; - -enum DecompositionType { - DecompositionNone = U_DT_NONE, - DecompositionCanonical = U_DT_CANONICAL, - DecompositionCompat = U_DT_COMPAT, - DecompositionCircle = U_DT_CIRCLE, - DecompositionFinal = U_DT_FINAL, - DecompositionFont = U_DT_FONT, - DecompositionFraction = U_DT_FRACTION, - DecompositionInitial = U_DT_INITIAL, - DecompositionIsolated = U_DT_ISOLATED, - DecompositionMedial = U_DT_MEDIAL, - DecompositionNarrow = U_DT_NARROW, - DecompositionNoBreak = U_DT_NOBREAK, - DecompositionSmall = U_DT_SMALL, - DecompositionSquare = U_DT_SQUARE, - DecompositionSub = U_DT_SUB, - DecompositionSuper = U_DT_SUPER, - DecompositionVertical = U_DT_VERTICAL, - DecompositionWide = U_DT_WIDE, -}; - -enum CharCategory { - NoCategory = 0, - Other_NotAssigned = U_MASK(U_GENERAL_OTHER_TYPES), - Letter_Uppercase = U_MASK(U_UPPERCASE_LETTER), - Letter_Lowercase = U_MASK(U_LOWERCASE_LETTER), - Letter_Titlecase = U_MASK(U_TITLECASE_LETTER), - Letter_Modifier = U_MASK(U_MODIFIER_LETTER), - Letter_Other = U_MASK(U_OTHER_LETTER), - - Mark_NonSpacing = U_MASK(U_NON_SPACING_MARK), - Mark_Enclosing = U_MASK(U_ENCLOSING_MARK), - Mark_SpacingCombining = U_MASK(U_COMBINING_SPACING_MARK), - - Number_DecimalDigit = U_MASK(U_DECIMAL_DIGIT_NUMBER), - Number_Letter = U_MASK(U_LETTER_NUMBER), - Number_Other = U_MASK(U_OTHER_NUMBER), - - Separator_Space = U_MASK(U_SPACE_SEPARATOR), - Separator_Line = U_MASK(U_LINE_SEPARATOR), - Separator_Paragraph = U_MASK(U_PARAGRAPH_SEPARATOR), - - Other_Control = U_MASK(U_CONTROL_CHAR), - Other_Format = U_MASK(U_FORMAT_CHAR), - Other_PrivateUse = U_MASK(U_PRIVATE_USE_CHAR), - Other_Surrogate = U_MASK(U_SURROGATE), - - Punctuation_Dash = U_MASK(U_DASH_PUNCTUATION), - Punctuation_Open = U_MASK(U_START_PUNCTUATION), - Punctuation_Close = U_MASK(U_END_PUNCTUATION), - Punctuation_Connector = U_MASK(U_CONNECTOR_PUNCTUATION), - Punctuation_Other = U_MASK(U_OTHER_PUNCTUATION), - - Symbol_Math = U_MASK(U_MATH_SYMBOL), - Symbol_Currency = U_MASK(U_CURRENCY_SYMBOL), - Symbol_Modifier = U_MASK(U_MODIFIER_SYMBOL), - Symbol_Other = U_MASK(U_OTHER_SYMBOL), - - Punctuation_InitialQuote = U_MASK(U_INITIAL_PUNCTUATION), - Punctuation_FinalQuote = U_MASK(U_FINAL_PUNCTUATION) -}; - -inline UChar32 foldCase(UChar32 c) { - return u_foldCase(c, U_FOLD_CASE_DEFAULT); -} - -inline int foldCase(UChar* result, - int resultLength, - const UChar* src, - int srcLength, - bool* error) { - UErrorCode status = U_ZERO_ERROR; - int realLength = u_strFoldCase(result, resultLength, src, srcLength, - U_FOLD_CASE_DEFAULT, &status); - *error = !U_SUCCESS(status); - return realLength; -} - -inline int toLower(UChar* result, - int resultLength, - const UChar* src, - int srcLength, - bool* error) { - UErrorCode status = U_ZERO_ERROR; - int realLength = - u_strToLower(result, resultLength, src, srcLength, "", &status); - *error = !!U_FAILURE(status); - return realLength; -} - -inline UChar32 toLower(UChar32 c) { - return u_tolower(c); -} - -inline UChar32 toUpper(UChar32 c) { - return u_toupper(c); -} - -inline int toUpper(UChar* result, - int resultLength, - const UChar* src, - int srcLength, - bool* error) { - UErrorCode status = U_ZERO_ERROR; - int realLength = - u_strToUpper(result, resultLength, src, srcLength, "", &status); - *error = !!U_FAILURE(status); - return realLength; -} - -inline UChar32 toTitleCase(UChar32 c) { - return u_totitle(c); -} - -inline bool isArabicChar(UChar32 c) { - return ublock_getCode(c) == UBLOCK_ARABIC; -} - -inline bool isAlphanumeric(UChar32 c) { - return u_isalnum(c); -} - -inline bool isSeparatorSpace(UChar32 c) { - return u_charType(c) == U_SPACE_SEPARATOR; -} - -inline bool isPrintableChar(UChar32 c) { - return !!u_isprint(c); -} - -inline bool isPunct(UChar32 c) { - return !!u_ispunct(c); -} - -inline bool hasLineBreakingPropertyComplexContext(UChar32 c) { - return u_getIntPropertyValue(c, UCHAR_LINE_BREAK) == U_LB_COMPLEX_CONTEXT; -} - -inline UChar32 mirroredChar(UChar32 c) { - return u_charMirror(c); -} - -inline CharCategory category(UChar32 c) { - return static_cast(U_GET_GC_MASK(c)); -} - -inline Direction direction(UChar32 c) { - return static_cast(u_charDirection(c)); -} - -inline bool isLower(UChar32 c) { - return !!u_islower(c); -} - -inline uint8_t combiningClass(UChar32 c) { - return u_getCombiningClass(c); -} - -inline DecompositionType decompositionType(UChar32 c) { - return static_cast( - u_getIntPropertyValue(c, UCHAR_DECOMPOSITION_TYPE)); -} - -inline int umemcasecmp(const UChar* a, const UChar* b, int len) { - return u_memcasecmp(a, b, len, U_FOLD_CASE_DEFAULT); -} - -} // namespace Unicode - -} // namespace WTF - -#endif // SKY_ENGINE_WTF_UNICODE_ICU_UNICODEICU_H_ diff --git a/sky/packages/sky_engine/BUILD.gn b/sky/packages/sky_engine/BUILD.gn index 0f521b86c31e0..3ea8c4f31b84e 100644 --- a/sky/packages/sky_engine/BUILD.gn +++ b/sky/packages/sky_engine/BUILD.gn @@ -16,7 +16,6 @@ import("//third_party/dart/sdk/lib/typed_data/typed_data_sources.gni") import("$flutter_root/build/dart/rules.gni") import("$flutter_root/lib/ui/dart_ui.gni") -import("$flutter_root/sky/engine/core/core.gni") if (!is_fuchsia) { copy("copy_sky_engine_authors") { diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 60ab2b05c79bb..3541d71a1aca3 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -2161,37 +2161,6 @@ OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -Copyright 2003 Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - Copyright 2005 Nokia. All rights reserved. The portions of the attached software ("Contribution") is developed by @@ -2219,100 +2188,35 @@ OTHERWISE. -------------------------------------------------------------------------------- boringssl -Copyright 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2006, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2007, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2012, Intel Corporation. All Rights Reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy @@ -2321,275 +2225,62 @@ https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2008 Google Inc. -All Rights Reserved. +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2014, Intel Corporation. All Rights Reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Copyright 2016 Brian Smith. - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- boringssl -Copyright 2009 Google Inc. -All Rights Reserved. +OpenSSL License -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + ==================================================================== + Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. -Copyright 2009 Google Inc. All Rights Reserved. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2012, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2014, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2015, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2016 Brian Smith. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -OpenSSL License - - ==================================================================== - Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to endorse or promote products derived from this software without @@ -2745,85 +2436,26 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- -colorama +boringssl +gtest -Copyright (c) 2010 Jonathan Hartley +Copyright 2003 Google Inc. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holders, nor those of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2003-2005 Tom Wu -Copyright (c) 2012 Adam Singer (adam@solvr.io) -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, -INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF -THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -In addition, the following condition applies: - -All redistributions must retain an intact copy of this copyright notice -and disclaimer. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -2836,23 +2468,26 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -dart +boringssl +gtest -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2005, Google Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -2865,23 +2500,26 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -dart +boringssl +gtest -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2006, Google Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -2894,23 +2532,26 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -dart +boringssl +gtest -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2007, Google Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -2923,23 +2564,26 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -dart +boringssl +gtest -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2008 Google Inc. +All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -2952,23 +2596,26 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -dart +boringssl +gtest -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2008, Google Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -2981,23 +2628,26 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -dart +boringssl +gtest -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2009 Google Inc. +All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -3010,23 +2660,25 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -dart +boringssl +gtest -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2009 Google Inc. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -3039,22 +2691,26 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -dart +boringssl +gtest -Copyright 2009 The Go Authors. All rights reserved. +Copyright 2009, Google Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -3067,21 +2723,26 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -dart +boringssl +gtest + +Copyright 2015, Google Inc. +All rights reserved. -Copyright 2012, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -3094,10 +2755,71 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- +colorama + +Copyright (c) 2010 Jonathan Hartley +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holders, nor those of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- dart -observatory_pub_packages -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2003-2005 Tom Wu +Copyright (c) 2012 Adam Singer (adam@solvr.io) +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, +INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF +THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +In addition, the following condition applies: + +All redistributions must retain an intact copy of this copyright notice +and disclaimer. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3124,13 +2846,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -double-conversion +dart + +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. -Copyright 2012 the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above @@ -3140,7 +2863,6 @@ met: * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -3153,14 +2875,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -double-conversion -engine +dart + +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. -Copyright 2006-2008 the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above @@ -3170,7 +2892,6 @@ met: * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -3183,14 +2904,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -double-conversion -engine +dart -Copyright 2010 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above @@ -3200,7 +2921,6 @@ met: * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -3213,29 +2933,23 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine +dart -Copyright (C) 1999 Lars Knoll (knoll@kde.org) - (C) 1999 Antti Koivisto (koivisto@kde.org) - (C) 2007 David Smith (catfish.man@gmail.com) -Copyright (C) 2003-2013 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2010. All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. + notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -3248,6682 +2962,667 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine +dart -Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. -All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine +dart -Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine - -Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine +dart -Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine +dart -Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. +Copyright 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine - -Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. - 2006 Rob Buis -Copyright (C) 2007 Eric Seidel -Copyright (C) 2013 Google Inc. All rights reserved. -Copyright (C) 2013 Intel Corporation. All rights reserved. +dart +Copyright 2012, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine +dart +observatory_pub_packages -Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2005 Nokia. All rights reserved. +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine - -Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2005 Nokia. All rights reserved. - 2008 Eric Seidel +double-conversion +Copyright 2006-2008 the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2005 Nokia. All rights reserved. +modification, are permitted provided that the following conditions are +met: -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine - -Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2007-2009 Torch Mobile, Inc. -Copyright (C) 2011 University of Szeged. All rights reserved. +double-conversion +Copyright 2010 the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +modification, are permitted provided that the following conditions are +met: -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -engine - -Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. +double-conversion +Copyright 2012 the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +modification, are permitted provided that the following conditions are +met: -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. -Copyright (C) 2008-2009 Torch Mobile, Inc. -Copyright (C) 2013 Google Inc. All rights reserved. +Copyright (c) 2013 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +modification, are permitted provided that the following conditions are +met: -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. +Copyright 2017 The Flutter Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +modification, are permitted provided that the following conditions are +met: -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -Copyright (C) 2003, 2006, 2008, 2009, 2010, 2012 Apple Inc. -All rights reserved. +Copyright 2018 The Flutter Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +modification, are permitted provided that the following conditions are +met: -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +garnet -Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. +Copyright 2013 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. - 2006 Rob Buis -Copyright (C) 2007-2008 Torch Mobile, Inc. -Copyright (C) 2013 Google Inc. All rights reserved. +modification, are permitted provided that the following conditions are +met: -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +garnet +icu +skia +topaz -Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. -Copyright (C) 2010 Google Inc. All rights reserved. +Copyright 2015 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: +modification, are permitted provided that the following conditions are +met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +garnet +icu +topaz -Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. -Copyright (C) 2010 Google Inc. All rights reserved. -Copyright (C) 2013 Xidorn Quan (quanxunzhen@gmail.com) +Copyright 2014 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: +modification, are permitted provided that the following conditions are +met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +garnet +topaz -Copyright (C) 2003, 2006, 2010, 2013 Apple Inc. All rights reserved. +Copyright 2016 The Fuchsia Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. +modification, are permitted provided that the following conditions are +met: -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +garnet +topaz -Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. +Copyright 2017 The Fuchsia Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +modification, are permitted provided that the following conditions are +met: -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +garnet +topaz -Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. +Copyright 2018 The Fuchsia Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All -rights reserved. -Copyright (C) 2005 Alexey Proskuryakov. +modification, are permitted provided that the following conditions are +met: -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +garnet +topaz +txt -Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. +Copyright 2017 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +modification, are permitted provided that the following conditions are +met: -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +icu +skia +topaz -Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov +Copyright 2016 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +modification, are permitted provided that the following conditions are +met: -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine +observatory_pub_packages +skia +txt +vulkan -Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2005 Nokia. All rights reserved. +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine +1. Definitions. -Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. -Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. -Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov -Copyright (C) 2007-2009 Torch Mobile, Inc. + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2004, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2004, 2006, 2007, 2011 Apple Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2004, 2006, 2008, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2004, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2004, 2008, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - 2010 Dirk Schulze - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - 2010 Dirk Schulze -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2009 Torch Mobile, Inc. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. -Copyright (C) 2010 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2005, 2007, 2010 Apple Inc. All rights reserved. -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2012 Rik Cabanier (cabanier@adobe.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) -Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) -Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2008-2009 Torch Mobile, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) -Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007 Apple Computer, Inc. -Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2009 Dominik Röttsches - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007 Eric Seidel - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. -Copyright (C) 2008 Eric Seidel -Copyright (C) 2007-2008 Torch Mobile, Inc. -Copyright (C) 2013 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. -Copyright (C) 2008 Eric Seidel -Copyright (C) 2013 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2011. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. -Copyright (C) 2007-2009 Torch Mobile, Inc. -Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. -Copyright (C) 2013 Samsung Electronics. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. -Copyright (C) 2007 Alp Toker -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. -Copyright (C) 2007 Alp Toker -Copyright (C) 2008 Torch Mobile, Inc. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2008, 2013 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2011. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. -Copyright (C) 2007-2009 Torch Mobile, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. -Copyright (C) 2007-2008 Torch Mobile, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2008 Apple Inc. All rights reserved. -Copyright (C) 2007 Nicholas Shanks - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2008 Apple Inc. All rights reserved. -Copyright (C) 2007 Nicholas Shanks -Copyright (C) 2013 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2008 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2009, 2011 Apple Inc. All rights reserved. -Copyright (C) 2007-2008 Torch Mobile Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2006, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007 Apple Computer, Inc. -Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007 Apple Computer, Inc. -Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. -Copyright (C) 2010 Company 100, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007 Apple Inc. All rights reserved. -Copyright (C) 2010 Patrick Gansterer - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007 Apple, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007 Nicholas Shanks -Copyright (C) 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007, 2008 Apple Inc. All rights reserved. -Copyright (C) 2009 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007, 2008 Apple Inc. All rights reserved. -Copyright (C) 2009 Google Inc. All rights reserved. -Copyright (C) 2009 Torch Mobile, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007, 2008 Apple, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. -Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007, 2008, 2010, 2012 Apple Inc. All rights reserved. -Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007, 2009 Apple Inc. All rights reserved. -Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) -Copyright (C) 2011 Research In Motion Limited. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008 Apple Inc. All Rights Reserved. -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008 Apple Inc. All rights reserved. -Copyright (C) 2009 Jian Li -Copyright (C) 2012 Patrick Gansterer - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008 Apple Inc. All rights reserved. -Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) -Copyright (C) 2013 Xidorn Quan (quanxunzhen@gmail.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008 Dirk Schulze - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008, 2009 Paul Pedriana . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008, 2009, 2010, 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Inc. ("Apple") nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2008, 2012 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009 Apple Inc. All rights reserved. -Copyright (C) 2009 Torch Mobile, Inc. -Copyright (C) 2010 Company 100 Inc. -Copyright (C) 2013 Intel Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009 Apple Inc. All rights reserved. -Copyright (C) 2013 Intel Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009, 2010 Apple Inc. All rights reserved. -Copyright (C) 2013 Intel Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009, 2010 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2010. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2009, 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010 Apple Inc. All rights reserved. -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010, 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010, 2013 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2010, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Apple Inc. All rights reserved. -Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Google Inc. All rights reserved. -Copyright (C) 2013 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2011, 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Apple Inc. All rights reserved. -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Intel Corporation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2012 Koji Ishii - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Google, Inc. ("Google") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. -3. Neither the name of Google Inc. nor the names of its contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Google Inc. All rights reserved. -Copyright (C) 2013 Samsung Electronics. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013 Samsung Electronics. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2013, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES,:tabnew INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 1991, 2000, 2001 by Lucent Technologies. -Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. -All rights reserved. - -Permission to use, copy, modify, and distribute this software for any -purpose without fee is hereby granted, provided that this entire notice -is included in all copies of any software which is or includes a copy -or modification of this software and in all copies of the supporting -documentation for such software. - -THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED -WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY -REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY -OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2005, 2007, Google Inc. -All rights reserved. -Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2006, 2007, 2008, 2009, 2010, 2012 Google Inc. All -rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2006,2007,2008, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2008, 2009, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2008, Google Inc. All rights reserved. -Copyright (C) 2009 Dirk Schulze -Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2009, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2010, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2012 Google Inc. All rights reserved. -Copyright (C) 2013 BlackBerry Limited. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2012 Google Inc. All rights reserved. -Copyright (c) 2014 BlackBerry Limited. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2012, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2013 Samsung All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Samsung nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2013 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2013 Yandex LLC. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Yandex LLC nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2013, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2013, Opera Software ASA. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Opera Software ASA nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2014 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2014, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2016, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2017 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright 2017 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright 2018 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - -Copyright (C) 1991 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! --------------------------------------------------------------------------------- -engine -garnet - -Copyright 2013 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -icu -skia -topaz - -Copyright 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -icu -topaz - -Copyright 2014 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2016 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2017 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz -txt - -Copyright 2017 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -gif - -GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! --------------------------------------------------------------------------------- -engine -icu -skia -topaz - -Copyright 2016 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -observatory_pub_packages -skia -txt -vulkan - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions @@ -10196,80 +3895,335 @@ distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001, 2002 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001, 2002, 2003, 2004 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001-2008, 2011, 2013, 2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 1990, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000 Computing Research Labs, New Mexico State University +Copyright 2001-2004, 2011 Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000 Computing Research Labs, New Mexico State University +Copyright 2001-2014 + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- freetype2 -Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler +Copyright 2000, 2001, 2004 by +Francesco Zappa Nardelli -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. -------------------------------------------------------------------------------- freetype2 -Copyright (C) 1995-2002 Jean-loup Gailly. +Copyright 2000-2001, 2002 by +Francesco Zappa Nardelli -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. -------------------------------------------------------------------------------- freetype2 -Copyright (C) 1995-2002 Mark Adler +Copyright 2000-2001, 2003 by +Francesco Zappa Nardelli -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. -------------------------------------------------------------------------------- freetype2 -Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by +Copyright 2000-2010, 2012-2014 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy @@ -10292,7 +4246,29 @@ THE SOFTWARE. -------------------------------------------------------------------------------- freetype2 -Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by +Copyright 2001, 2002, 2012 Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2003 by Francesco Zappa Nardelli Permission is hereby granted, free of charge, to any person obtaining a copy @@ -10302,573 +4278,801 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +The FreeType Project LICENSE + + 2006-Jan-27 + +Copyright 1996-2002, 2006 by +David Turner, Robert Wilhelm, and Werner Lemberg + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + + Please replace with the value from the FreeType version you + actually use. + +Legal Terms +=========== + +0. Definitions + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. -Copyright (C) 2001, 2002 by -Francesco Zappa Nardelli +3. Advertising -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. -Copyright (C) 2001, 2002, 2003, 2004 by -Francesco Zappa Nardelli +4. Contacts -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + There are two mailing lists related to FreeType: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + o freetype@nongnu.org -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. -Copyright (C) 2001-2008, 2011, 2013, 2014 by -Francesco Zappa Nardelli + o freetype-devel@nongnu.org -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + Our home page can be found at -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 + http://www.freetype.org -Copyright 1990, 1994, 1998 The Open Group +--- end of FTL.TXT --- +-------------------------------------------------------------------------------- +garnet -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. +Copyright 2013 The Fuchsia Authors. All rights reserved. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -freetype2 +garnet -Copyright 2000 Computing Research Labs, New Mexico State University -Copyright 2001-2004, 2011 Francesco Zappa Nardelli +Copyright 2014 The Fuchsia Authors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -freetype2 +garnet -Copyright 2000 Computing Research Labs, New Mexico State University -Copyright 2001-2014 - Francesco Zappa Nardelli +Copyright 2017 The Fuchsia Authors.All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -freetype2 +garnet +topaz -Copyright 2000, 2001, 2004 by -Francesco Zappa Nardelli +Copyright 2015 The Fuchsia Authors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -freetype2 +gif -Copyright 2000-2001, 2002 by -Francesco Zappa Nardelli +GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 + Preamble -Copyright 2000-2001, 2003 by -Francesco Zappa Nardelli + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. -Copyright 2000-2010, 2012-2014 by -Francesco Zappa Nardelli + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. -Copyright 2001, 2002, 2012 Francesco Zappa Nardelli + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. -Copyright 2003 by -Francesco Zappa Nardelli + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. -The FreeType Project LICENSE + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) - 2006-Jan-27 + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. -Copyright 1996-2002, 2006 by -David Turner, Robert Wilhelm, and Werner Lemberg + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. -Introduction -============ + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. - The FreeType Project is distributed in several archive packages; - some of them may contain, in addition to the FreeType font engine, - various tools and contributions which rely on, or relate to, the - FreeType Project. + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: - This license applies to all files found in such packages, and - which do not fall under their own explicit license. The license - affects thus the FreeType font engine, the test programs, - documentation and makefiles, at the very least. + a) The modified work must itself be a software library. - This license was inspired by the BSD, Artistic, and IJG - (Independent JPEG Group) licenses, which all encourage inclusion - and use of free software in commercial and freeware products - alike. As a consequence, its main points are that: + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. - o We don't promise that this software works. However, we will be - interested in any kind of bug reports. (`as is' distribution) + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. - o You can use this software for whatever you want, in parts or - full form, without having to pay us. (`royalty-free' usage) + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. - o You may not pretend that you wrote this software. If you use - it, or only parts of it, in a program, you must acknowledge - somewhere in your documentation that you have used the - FreeType code. (`credits') + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) - We specifically permit and encourage the inclusion of this - software, with or without modifications, in commercial products. - We disclaim all warranties covering The FreeType Project and - assume no liability related to The FreeType Project. +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. - Finally, many people asked us for a preferred form for a - credit/disclaimer to use in compliance with this license. We thus - encourage you to use the following text: +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. - Portions of this software are copyright © The FreeType - Project (www.freetype.org). All rights reserved. +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. - Please replace with the value from the FreeType version you - actually use. + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. -Legal Terms -=========== + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. -0. Definitions + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. - Throughout this license, the terms `package', `FreeType Project', - and `FreeType archive' refer to the set of files originally - distributed by the authors (David Turner, Robert Wilhelm, and - Werner Lemberg) as the `FreeType Project', be they named as alpha, - beta or final release. + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. - `You' refers to the licensee, or person using the project, where - `using' is a generic term including compiling the project's source - code as well as linking it to form a `program' or `executable'. - This program is referred to as `a program using the FreeType - engine'. + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. - This license applies to all files distributed in the original - FreeType Project, including all source code, binaries and - documentation, unless otherwise stated in the file in its - original, unmodified form as distributed in the original archive. - If you are unsure whether or not a particular file is covered by - this license, you must contact us to verify this. + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. - The FreeType Project is copyright (C) 1996-2000 by David Turner, - Robert Wilhelm, and Werner Lemberg. All rights reserved except as - specified below. + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. -1. No Warranty + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) - THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO - USE, OF THE FREETYPE PROJECT. + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. -2. Redistribution + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: - This license grants a worldwide, royalty-free, perpetual and - irrevocable right and license to use, execute, perform, compile, - display, copy, create derivative works of, distribute and - sublicense the FreeType Project (in both source and object code - forms) and derivative works thereof for any purpose; and to - authorize others to exercise some or all of the rights granted - herein, subject to the following conditions: + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) - o Redistribution of source code must retain this license file - (`FTL.TXT') unaltered; any additions, deletions or changes to - the original files must be clearly indicated in accompanying - documentation. The copyright notices of the unaltered, - original files must be preserved in all copies of source - files. + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. - o Redistribution in binary form must provide a disclaimer that - states that the software is based in part of the work of the - FreeType Team, in the distribution documentation. We also - encourage you to put an URL to the FreeType web page in your - documentation, though this isn't mandatory. + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. - These conditions apply to any software derived from or based on - the FreeType Project, not just the unmodified files. If you use - our work, you must acknowledge us. However, no fee need be paid - to us. + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. -3. Advertising + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. - Neither the FreeType authors and contributors nor you shall use - the name of the other for commercial, advertising, or promotional - purposes without specific prior written permission. + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. - We suggest, but do not require, that you use one or more of the - following phrases to refer to this software in your documentation - or advertising materials: `FreeType Project', `FreeType Engine', - `FreeType library', or `FreeType Distribution'. + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: - As you have not signed this license, you are not required to - accept it. However, as the FreeType Project is copyrighted - material, only this license, or another one contracted with the - authors, grants you the right to use, distribute, and modify it. - Therefore, by using, distributing, or modifying the FreeType - Project, you indicate that you understand and accept all the terms - of this license. + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. -4. Contacts + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. - There are two mailing lists related to FreeType: + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. - o freetype@nongnu.org + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. - Discusses general use and applications of FreeType, as well as - future and wanted additions to the library and distribution. - If you are looking for support, start in this list if you - haven't found anything to help you in the documentation. + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. - o freetype-devel@nongnu.org +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. - Discusses bugs, as well as engine internals, design issues, - specific licenses, porting, etc. +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. - Our home page can be found at +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. - http://www.freetype.org + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. ---- end of FTL.TXT --- --------------------------------------------------------------------------------- -garnet + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. -Copyright 2013 The Fuchsia Authors. All rights reserved. +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + NO WARRANTY - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. -Copyright 2014 The Fuchsia Authors. All rights reserved. + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet + + Copyright (C) -Copyright 2017 The Fuchsia Authors.All rights reserved. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet -topaz +Also add information on how to contact you by electronic and paper mail. -Copyright 2015 The Fuchsia Authors. All rights reserved. +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + , 1 April 1990 + Ty Coon, President of Vice -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +That's all there is to it! -------------------------------------------------------------------------------- gif diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 0f131c42a50d7..94046e5ab57ac 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -1,1058 +1,6 @@ UNUSED LICENSES: -==================================================================================================== -ORIGIN: ../../../flutter/sky/engine/core/LICENSE-APPLE -TYPE: LicenseType.bsd ----------------------------------------------------------------------------------------------------- -Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -ORIGIN: ../../../flutter/sky/engine/core/LICENSE-LGPL-2 -TYPE: LicenseType.lgpl ----------------------------------------------------------------------------------------------------- -GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - -Copyright (C) 1991 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! -==================================================================================================== - -==================================================================================================== -ORIGIN: ../../../flutter/sky/engine/core/LICENSE-LGPL-2.1 -TYPE: LicenseType.lgpl ----------------------------------------------------------------------------------------------------- -GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! -==================================================================================================== - -==================================================================================================== -ORIGIN: ../../../flutter/sky/engine/wtf/dtoa/LICENSE -TYPE: LicenseType.bsd ----------------------------------------------------------------------------------------------------- -Copyright 2006-2011, the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USED LICENSES: @@ -1548,7 +496,6 @@ FILE: ../../../flutter/lib/ui/dart_ui.cc FILE: ../../../flutter/lib/ui/dart_ui.h FILE: ../../../flutter/lib/ui/natives.dart FILE: ../../../flutter/lib/ui/window/window.h -FILE: ../../../flutter/runtime/platform_impl.h FILE: ../../../flutter/shell/common/skia_event_tracer_impl.cc FILE: ../../../flutter/shell/platform/android/apk_asset_provider.cc FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/JSONUtil.java @@ -1559,41 +506,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/module.modulemap FILE: ../../../flutter/shell/platform/embedder/assets/EmbedderInfo.plist FILE: ../../../flutter/shell/platform/embedder/assets/embedder.modulemap FILE: ../../../flutter/shell/platform/embedder/fixtures/simple_main.dart -FILE: ../../../flutter/sky/engine/core/editing/CompositionUnderlineRangeFilter.cpp -FILE: ../../../flutter/sky/engine/core/editing/CompositionUnderlineRangeFilter.h -FILE: ../../../flutter/sky/engine/core/editing/PositionWithAffinity.cpp -FILE: ../../../flutter/sky/engine/core/editing/PositionWithAffinity.h -FILE: ../../../flutter/sky/engine/core/rendering/ClipRectsCache.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderObjectInlines.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderParagraph.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderParagraph.h -FILE: ../../../flutter/sky/engine/core/rendering/style/AppliedTextDecoration.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/AppliedTextDecoration.h -FILE: ../../../flutter/sky/engine/core/rendering/style/DataEquivalency.h -FILE: ../../../flutter/sky/engine/core/rendering/style/OutlineValueTest.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleDifference.h -FILE: ../../../flutter/sky/engine/platform/animation/TimingFunction.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/FixedPitchFontType.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontCacheTest.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/FontFamilyNames.in -FILE: ../../../flutter/sky/engine/platform/fonts/GlyphPageTreeNodeTest.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/TextBlob.h -FILE: ../../../flutter/sky/engine/platform/fonts/mobile/FontCacheMobileTest.cpp -FILE: ../../../flutter/sky/engine/platform/graphics/ImageFilter.cpp -FILE: ../../../flutter/sky/engine/platform/graphics/ImageFilter.h -FILE: ../../../flutter/sky/engine/platform/transforms/TransformationMatrixTest.cpp -FILE: ../../../flutter/sky/engine/wtf/AddressSpaceRandomization.cpp -FILE: ../../../flutter/sky/engine/wtf/AddressSpaceRandomization.h -FILE: ../../../flutter/sky/engine/wtf/CONTRIBUTORS.pthreads-win32 -FILE: ../../../flutter/sky/engine/wtf/DoubleBufferedDeque.h -FILE: ../../../flutter/sky/engine/wtf/DoubleBufferedDequeTest.cpp -FILE: ../../../flutter/sky/engine/wtf/RefPtrTest.cpp -FILE: ../../../flutter/sky/engine/wtf/RefVector.h -FILE: ../../../flutter/sky/engine/wtf/asm/SaturatedArithmeticARM.h -FILE: ../../../flutter/sky/engine/wtf/text/StringBufferTest.cpp -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecReplacement.cpp -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecReplacement.h -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecReplacementTest.cpp FILE: ../../../flutter/sky/tools/roll/patches/chromium/android_build.patch ---------------------------------------------------------------------------------------------------- Copyright 2014 The Chromium Authors. All rights reserved. @@ -1741,8 +653,6 @@ FILE: ../../../flutter/lib/ui/window/platform_message_response_dart.h FILE: ../../../flutter/lib/ui/window/pointer_data.h FILE: ../../../flutter/lib/ui/window/pointer_data_packet.h FILE: ../../../flutter/lib/ui/window/viewport_metrics.h -FILE: ../../../flutter/runtime/asset_font_selector.cc -FILE: ../../../flutter/runtime/asset_font_selector.h FILE: ../../../flutter/runtime/embedder_resources.cc FILE: ../../../flutter/runtime/embedder_resources.h FILE: ../../../flutter/runtime/fixtures/simple_main.dart @@ -1750,8 +660,6 @@ FILE: ../../../flutter/runtime/start_up.cc FILE: ../../../flutter/runtime/start_up.h FILE: ../../../flutter/runtime/test_font_data.cc FILE: ../../../flutter/runtime/test_font_data.h -FILE: ../../../flutter/runtime/test_font_selector.cc -FILE: ../../../flutter/runtime/test_font_selector.h FILE: ../../../flutter/shell/common/skia_event_tracer_impl.h FILE: ../../../flutter/shell/common/surface.cc FILE: ../../../flutter/shell/common/surface.h @@ -1804,11 +712,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_messa FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.mm FILE: ../../../flutter/shell/platform/darwin/ios/platform_view_ios.h FILE: ../../../flutter/shell/platform/darwin/ios/platform_view_ios.mm -FILE: ../../../flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/fuchsia/FontCacheFuchsia.h -FILE: ../../../flutter/sky/engine/platform/text/ICUError.cpp -FILE: ../../../flutter/sky/engine/platform/text/ICUError.h -FILE: ../../../flutter/sky/engine/platform/text/TextBox.h FILE: ../../../flutter/sky/packages/flutter_services/lib/empty.dart FILE: ../../../flutter/synchronization/pipeline.cc FILE: ../../../flutter/synchronization/pipeline.h @@ -1972,7 +875,6 @@ LIBRARY: engine ORIGIN: ../../../flutter/fml/platform/darwin/scoped_block.h + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/fml/platform/darwin/scoped_block.h -FILE: ../../../flutter/sky/engine/wtf/allocator/PartitionAllocator.h ---------------------------------------------------------------------------------------------------- Copyright (c) 2013 The Chromium Authors. All rights reserved. @@ -2100,7758 +1002,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/editing/CompositionUnderline.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/editing/CompositionUnderline.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/ClipPathOperation.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/ClipPathOperation.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/ClipRect.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/ClipRect.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/ClipRect.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/ClipRect.h -FILE: ../../../flutter/sky/engine/core/rendering/ClipRects.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/HitTestingTransformState.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/HitTestingTransformState.cpp -FILE: ../../../flutter/sky/engine/core/rendering/HitTestingTransformState.h -FILE: ../../../flutter/sky/engine/platform/animation/AnimationUtilities.h -FILE: ../../../flutter/sky/engine/platform/geometry/TransformState.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/TransformState.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/LayerPaintingInfo.h -TYPE: LicenseType.lgpl -FILE: ../../../flutter/sky/engine/core/rendering/LayerPaintingInfo.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderLayer.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderLayer.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderLayerClipper.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderLayerClipper.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderLayerStackingNode.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderLayerStackingNode.h -FILE: ../../../flutter/sky/engine/core/rendering/ScrollAlignment.cpp -FILE: ../../../flutter/sky/engine/core/rendering/ScrollAlignment.h -FILE: ../../../flutter/sky/engine/platform/text/UnicodeRange.cpp -FILE: ../../../flutter/sky/engine/platform/text/UnicodeRange.h ----------------------------------------------------------------------------------------------------- -GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/OrderIterator.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/OrderIterator.cpp -FILE: ../../../flutter/sky/engine/core/rendering/OrderIterator.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderFlexibleBox.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderFlexibleBox.h -FILE: ../../../flutter/sky/engine/platform/CalculationValue.h -FILE: ../../../flutter/sky/engine/platform/text/LocaleToScriptMapping.cpp -FILE: ../../../flutter/sky/engine/platform/text/LocaleToScriptMapping.h -FILE: ../../../flutter/sky/engine/wtf/ThreadRestrictionVerifier.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/RenderGeometryMap.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/RenderGeometryMap.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderGeometryMap.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/RenderGeometryMapStep.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/RenderGeometryMapStep.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Apple Inc. All rights reserved. -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/RenderLineBoxList.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/RenderLineBoxList.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/FloatQuad.h -FILE: ../../../flutter/sky/engine/wtf/Locker.h -FILE: ../../../flutter/sky/engine/wtf/text/AtomicStringHash.h -FILE: ../../../flutter/sky/engine/wtf/unicode/Collator.h -FILE: ../../../flutter/sky/engine/wtf/unicode/icu/CollatorICU.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/RenderLineBoxList.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/RenderLineBoxList.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/RenderObjectChildList.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/RenderObjectChildList.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009, 2010 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2010. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/RenderObjectChildList.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/RenderObjectChildList.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/RenderTreeAsText.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/RenderTreeAsText.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/RenderTreeAsText.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/RenderTreeAsText.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontFamily.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/TextRunConstructor.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/TextRunConstructor.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 1999 Lars Knoll (knoll@kde.org) - (C) 1999 Antti Koivisto (koivisto@kde.org) - (C) 2007 David Smith (catfish.man@gmail.com) -Copyright (C) 2003-2013 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2010. All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/VerticalPositionCache.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/VerticalPositionCache.h -FILE: ../../../flutter/sky/engine/platform/fonts/TypesettingFeatures.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/break_lines.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/break_lines.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2005, 2007, 2010 Apple Inc. All rights reserved. -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/line/BreakingContext.cpp -TYPE: LicenseType.lgpl -FILE: ../../../flutter/sky/engine/core/rendering/BidiRun.h -FILE: ../../../flutter/sky/engine/core/rendering/BidiRunForLine.cpp -FILE: ../../../flutter/sky/engine/core/rendering/BidiRunForLine.h -FILE: ../../../flutter/sky/engine/core/rendering/GapRects.h -FILE: ../../../flutter/sky/engine/core/rendering/HitTestLocation.cpp -FILE: ../../../flutter/sky/engine/core/rendering/HitTestLocation.h -FILE: ../../../flutter/sky/engine/core/rendering/HitTestRequest.h -FILE: ../../../flutter/sky/engine/core/rendering/HitTestResult.cpp -FILE: ../../../flutter/sky/engine/core/rendering/HitTestResult.h -FILE: ../../../flutter/sky/engine/core/rendering/InlineBox.cpp -FILE: ../../../flutter/sky/engine/core/rendering/InlineBox.h -FILE: ../../../flutter/sky/engine/core/rendering/InlineFlowBox.cpp -FILE: ../../../flutter/sky/engine/core/rendering/InlineFlowBox.h -FILE: ../../../flutter/sky/engine/core/rendering/InlineIterator.h -FILE: ../../../flutter/sky/engine/core/rendering/InlineTextBox.cpp -FILE: ../../../flutter/sky/engine/core/rendering/InlineTextBox.h -FILE: ../../../flutter/sky/engine/core/rendering/PaintInfo.h -FILE: ../../../flutter/sky/engine/core/rendering/PointerEventsHitRules.cpp -FILE: ../../../flutter/sky/engine/core/rendering/PointerEventsHitRules.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderBlock.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderBlock.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderBox.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderBox.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderBoxModelObject.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderBoxModelObject.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderInline.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderInline.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderObject.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderObject.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderOverflow.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderReplaced.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderReplaced.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderText.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderText.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderTheme.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderTheme.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderView.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderView.h -FILE: ../../../flutter/sky/engine/core/rendering/RootInlineBox.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RootInlineBox.h -FILE: ../../../flutter/sky/engine/core/rendering/break_lines.h -FILE: ../../../flutter/sky/engine/core/rendering/line/BreakingContext.cpp -FILE: ../../../flutter/sky/engine/core/rendering/line/BreakingContextInlineHeaders.h -FILE: ../../../flutter/sky/engine/core/rendering/line/LineBreaker.cpp -FILE: ../../../flutter/sky/engine/core/rendering/line/LineBreaker.h -FILE: ../../../flutter/sky/engine/core/rendering/line/LineInfo.h -FILE: ../../../flutter/sky/engine/core/rendering/line/LineLayoutState.h -FILE: ../../../flutter/sky/engine/core/rendering/line/RenderTextInfo.h -FILE: ../../../flutter/sky/engine/core/rendering/line/TrailingObjects.cpp -FILE: ../../../flutter/sky/engine/core/rendering/line/TrailingObjects.h -FILE: ../../../flutter/sky/engine/core/rendering/line/WordMeasurement.h -FILE: ../../../flutter/sky/engine/core/rendering/style/BorderData.h -FILE: ../../../flutter/sky/engine/core/rendering/style/BorderValue.h -FILE: ../../../flutter/sky/engine/core/rendering/style/CollapsedBorderValue.h -FILE: ../../../flutter/sky/engine/core/rendering/style/CounterDirectives.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/CounterDirectives.h -FILE: ../../../flutter/sky/engine/core/rendering/style/DataRef.h -FILE: ../../../flutter/sky/engine/core/rendering/style/FillLayer.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/FillLayer.h -FILE: ../../../flutter/sky/engine/core/rendering/style/OutlineValue.h -FILE: ../../../flutter/sky/engine/core/rendering/style/RenderStyle.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/RenderStyle.h -FILE: ../../../flutter/sky/engine/core/rendering/style/RenderStyleConstants.h -FILE: ../../../flutter/sky/engine/core/rendering/style/ShadowData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/ShadowData.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleBackgroundData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleBackgroundData.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleBoxData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleBoxData.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleImage.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleInheritedData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleInheritedData.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleRareInheritedData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleRareInheritedData.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleRareNonInheritedData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleRareNonInheritedData.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleSurroundData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleSurroundData.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleTransformData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleTransformData.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleVisualData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleVisualData.h -FILE: ../../../flutter/sky/engine/platform/Length.cpp -FILE: ../../../flutter/sky/engine/platform/Length.h -FILE: ../../../flutter/sky/engine/platform/LengthBox.h -FILE: ../../../flutter/sky/engine/platform/LengthFunctions.cpp -FILE: ../../../flutter/sky/engine/platform/LengthFunctions.h -FILE: ../../../flutter/sky/engine/platform/LengthSize.h -FILE: ../../../flutter/sky/engine/platform/animation/TimingFunction.h -FILE: ../../../flutter/sky/engine/platform/fonts/CustomFontData.h -FILE: ../../../flutter/sky/engine/platform/fonts/Font.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/Font.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontDescription.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontFallbackList.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontMetrics.h -FILE: ../../../flutter/sky/engine/platform/fonts/Latin1TextIterator.h -FILE: ../../../flutter/sky/engine/platform/fonts/SimpleFontData.h -FILE: ../../../flutter/sky/engine/platform/fonts/WidthIterator.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/WidthIterator.h -FILE: ../../../flutter/sky/engine/platform/geometry/FloatPoint3D.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/FloatPoint3D.h -FILE: ../../../flutter/sky/engine/platform/geometry/IntSizeHash.h -FILE: ../../../flutter/sky/engine/platform/graphics/PathTraversalState.cpp -FILE: ../../../flutter/sky/engine/platform/text/BidiCharacterRun.cpp -FILE: ../../../flutter/sky/engine/platform/text/BidiCharacterRun.h -FILE: ../../../flutter/sky/engine/platform/text/BidiContext.cpp -FILE: ../../../flutter/sky/engine/platform/text/BidiContext.h -FILE: ../../../flutter/sky/engine/platform/text/BidiResolver.h -FILE: ../../../flutter/sky/engine/platform/text/BidiRunList.h -FILE: ../../../flutter/sky/engine/platform/text/SurrogatePairAwareTextIterator.cpp -FILE: ../../../flutter/sky/engine/platform/text/SurrogatePairAwareTextIterator.h -FILE: ../../../flutter/sky/engine/platform/text/TextBreakIterator.cpp -FILE: ../../../flutter/sky/engine/platform/text/TextBreakIterator.h -FILE: ../../../flutter/sky/engine/platform/text/TextBreakIteratorICU.cpp -FILE: ../../../flutter/sky/engine/platform/text/TextBreakIteratorInternalICU.cpp -FILE: ../../../flutter/sky/engine/platform/text/TextBreakIteratorInternalICU.h -FILE: ../../../flutter/sky/engine/platform/text/TextRun.h -FILE: ../../../flutter/sky/engine/platform/transforms/IdentityTransformOperation.h -FILE: ../../../flutter/sky/engine/platform/transforms/MatrixTransformOperation.cpp -FILE: ../../../flutter/sky/engine/platform/transforms/MatrixTransformOperation.h -FILE: ../../../flutter/sky/engine/platform/transforms/RotateTransformOperation.cpp -FILE: ../../../flutter/sky/engine/platform/transforms/RotateTransformOperation.h -FILE: ../../../flutter/sky/engine/platform/transforms/ScaleTransformOperation.cpp -FILE: ../../../flutter/sky/engine/platform/transforms/ScaleTransformOperation.h -FILE: ../../../flutter/sky/engine/platform/transforms/SkewTransformOperation.cpp -FILE: ../../../flutter/sky/engine/platform/transforms/SkewTransformOperation.h -FILE: ../../../flutter/sky/engine/platform/transforms/TransformOperation.h -FILE: ../../../flutter/sky/engine/platform/transforms/TransformOperations.cpp -FILE: ../../../flutter/sky/engine/platform/transforms/TransformOperations.h -FILE: ../../../flutter/sky/engine/platform/transforms/TranslateTransformOperation.cpp -FILE: ../../../flutter/sky/engine/platform/transforms/TranslateTransformOperation.h -FILE: ../../../flutter/sky/engine/wtf/Alignment.h -FILE: ../../../flutter/sky/engine/wtf/FastMalloc.h -FILE: ../../../flutter/sky/engine/wtf/Forward.h -FILE: ../../../flutter/sky/engine/wtf/GetPtr.h -FILE: ../../../flutter/sky/engine/wtf/HashCountedSet.h -FILE: ../../../flutter/sky/engine/wtf/HashFunctions.h -FILE: ../../../flutter/sky/engine/wtf/HashMap.h -FILE: ../../../flutter/sky/engine/wtf/HashSet.h -FILE: ../../../flutter/sky/engine/wtf/HashTable.cpp -FILE: ../../../flutter/sky/engine/wtf/HashTable.h -FILE: ../../../flutter/sky/engine/wtf/HashTraits.h -FILE: ../../../flutter/sky/engine/wtf/HexNumber.h -FILE: ../../../flutter/sky/engine/wtf/LinkedHashSet.h -FILE: ../../../flutter/sky/engine/wtf/ListHashSet.h -FILE: ../../../flutter/sky/engine/wtf/Noncopyable.h -FILE: ../../../flutter/sky/engine/wtf/OperatingSystem.h -FILE: ../../../flutter/sky/engine/wtf/OwnPtr.h -FILE: ../../../flutter/sky/engine/wtf/PassRefPtr.h -FILE: ../../../flutter/sky/engine/wtf/RefCounted.h -FILE: ../../../flutter/sky/engine/wtf/RefCountedLeakCounter.cpp -FILE: ../../../flutter/sky/engine/wtf/RefCountedLeakCounter.h -FILE: ../../../flutter/sky/engine/wtf/RefPtr.h -FILE: ../../../flutter/sky/engine/wtf/StaticConstructors.h -FILE: ../../../flutter/sky/engine/wtf/StringHasher.h -FILE: ../../../flutter/sky/engine/wtf/ThreadSpecificWin.cpp -FILE: ../../../flutter/sky/engine/wtf/TypeTraits.cpp -FILE: ../../../flutter/sky/engine/wtf/TypeTraits.h -FILE: ../../../flutter/sky/engine/wtf/Vector.h -FILE: ../../../flutter/sky/engine/wtf/VectorTraits.h -FILE: ../../../flutter/sky/engine/wtf/dtoa.h -FILE: ../../../flutter/sky/engine/wtf/text/ASCIIFastPath.h -FILE: ../../../flutter/sky/engine/wtf/text/AtomicString.cpp -FILE: ../../../flutter/sky/engine/wtf/text/AtomicString.h -FILE: ../../../flutter/sky/engine/wtf/text/IntegerToStringConversion.h -FILE: ../../../flutter/sky/engine/wtf/text/StringHash.h -FILE: ../../../flutter/sky/engine/wtf/text/StringImpl.cpp -FILE: ../../../flutter/sky/engine/wtf/text/StringImpl.h -FILE: ../../../flutter/sky/engine/wtf/text/StringOperators.h -FILE: ../../../flutter/sky/engine/wtf/text/WTFString.cpp -FILE: ../../../flutter/sky/engine/wtf/text/WTFString.h -FILE: ../../../flutter/sky/engine/wtf/unicode/Unicode.h -FILE: ../../../flutter/sky/engine/wtf/unicode/icu/UnicodeIcu.h ----------------------------------------------------------------------------------------------------- -GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - -Copyright (C) 1991 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. - - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/line/LineWidth.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/line/LineWidth.cpp -FILE: ../../../flutter/sky/engine/core/rendering/line/LineWidth.h -FILE: ../../../flutter/sky/engine/platform/geometry/FloatRoundedRect.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/FloatRoundedRect.h -FILE: ../../../flutter/sky/engine/platform/geometry/FloatRoundedRectTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/style/ShadowList.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/Init.cpp -FILE: ../../../flutter/sky/engine/core/Init.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderLayerStackingNodeIterator.cpp -FILE: ../../../flutter/sky/engine/core/rendering/RenderLayerStackingNodeIterator.h -FILE: ../../../flutter/sky/engine/core/rendering/RenderOverflowTest.cpp -FILE: ../../../flutter/sky/engine/core/rendering/SubtreeLayoutScope.cpp -FILE: ../../../flutter/sky/engine/core/rendering/SubtreeLayoutScope.h -FILE: ../../../flutter/sky/engine/core/rendering/TextRunConstructor.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/ShadowList.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/ShadowList.h -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleColor.h -FILE: ../../../flutter/sky/engine/platform/Partitions.cpp -FILE: ../../../flutter/sky/engine/platform/Partitions.h -FILE: ../../../flutter/sky/engine/platform/PlatformExport.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontDataCache.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/FontDataCache.h -FILE: ../../../flutter/sky/engine/platform/geometry/RoundedRectTest.cpp -FILE: ../../../flutter/sky/engine/platform/graphics/DrawLooperBuilder.cpp -FILE: ../../../flutter/sky/engine/platform/graphics/DrawLooperBuilder.h -FILE: ../../../flutter/sky/engine/platform/text/BidiResolverTest.cpp -FILE: ../../../flutter/sky/engine/platform/text/BidiTestHarness.h -FILE: ../../../flutter/sky/engine/platform/text/BidiTextRun.cpp -FILE: ../../../flutter/sky/engine/platform/text/BidiTextRun.h -FILE: ../../../flutter/sky/engine/platform/transforms/InterpolatedTransformOperation.cpp -FILE: ../../../flutter/sky/engine/platform/transforms/InterpolatedTransformOperation.h -FILE: ../../../flutter/sky/engine/public/platform/WebBlendMode.h -FILE: ../../../flutter/sky/engine/wtf/BitwiseOperations.h -FILE: ../../../flutter/sky/engine/wtf/ByteSwap.h -FILE: ../../../flutter/sky/engine/wtf/DefaultAllocator.h -FILE: ../../../flutter/sky/engine/wtf/HashTableDeletedValueType.h -FILE: ../../../flutter/sky/engine/wtf/LinkedStack.h -FILE: ../../../flutter/sky/engine/wtf/PageAllocator.cpp -FILE: ../../../flutter/sky/engine/wtf/PageAllocator.h -FILE: ../../../flutter/sky/engine/wtf/PartitionAlloc.cpp -FILE: ../../../flutter/sky/engine/wtf/PartitionAlloc.h -FILE: ../../../flutter/sky/engine/wtf/PartitionAllocTest.cpp -FILE: ../../../flutter/sky/engine/wtf/SpinLock.h -FILE: ../../../flutter/sky/engine/wtf/WTF.cpp -FILE: ../../../flutter/sky/engine/wtf/WTF.h -FILE: ../../../flutter/sky/engine/wtf/WTFExport.h -FILE: ../../../flutter/sky/engine/wtf/allocator/Partitions.cpp -FILE: ../../../flutter/sky/engine/wtf/allocator/Partitions.h -FILE: ../../../flutter/sky/engine/wtf/text/StringStatics.h -FILE: ../../../flutter/sky/engine/wtf/text/StringUTF8Adaptor.h -FILE: ../../../flutter/sky/engine/wtf/text/StringView.h -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecUTF8Test.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/style/ShapeValue.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/style/ShapeValue.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/style/StyleFilterData.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleFilterData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleFilterData.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontWidthVariant.h -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecUTF8.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/core/rendering/style/StyleFlexibleBoxData.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleFlexibleBoxData.cpp -FILE: ../../../flutter/sky/engine/core/rendering/style/StyleFlexibleBoxData.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/FloatConversion.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/FloatConversion.h -FILE: ../../../flutter/sky/engine/wtf/MallocZoneSupport.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/Language.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/Language.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010, 2013 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/Language.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/Language.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2010, 2013 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/LengthPoint.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/LengthPoint.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2013, Opera Software ASA. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Opera Software ASA nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/NotImplemented.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/NotImplemented.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/SharedBuffer.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/SharedBuffer.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2008 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/SharedBuffer.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/SharedBuffer.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/animation/AnimationValue.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/animation/AnimationValue.h -FILE: ../../../flutter/sky/engine/platform/animation/KeyframeValueList.cpp -FILE: ../../../flutter/sky/engine/platform/animation/KeyframeValueList.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009 Apple Inc. All rights reserved. -Copyright (C) 2013 Intel Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/animation/TimingFunctionTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/animation/TimingFunctionTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2013, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/animation/UnitBezier.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/animation/UnitBezier.h -FILE: ../../../flutter/sky/engine/wtf/NotFound.h -FILE: ../../../flutter/sky/engine/wtf/StdLibExtras.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/animation/UnitBezierTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/animation/UnitBezierTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/exported/Platform.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/Decimal.cpp -FILE: ../../../flutter/sky/engine/platform/Decimal.h -FILE: ../../../flutter/sky/engine/platform/DecimalTest.cpp -FILE: ../../../flutter/sky/engine/platform/exported/Platform.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.h -FILE: ../../../flutter/sky/engine/platform/graphics/GeneratedImage.cpp -FILE: ../../../flutter/sky/engine/public/platform/Platform.h -FILE: ../../../flutter/sky/engine/wtf/ByteOrder.h -FILE: ../../../flutter/sky/engine/wtf/StreamBuffer.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/exported/WebCommon.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/exported/WebCommon.cpp -FILE: ../../../flutter/sky/engine/public/platform/WebCommon.h -FILE: ../../../flutter/sky/engine/wtf/SizeLimits.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/AlternateFontFamily.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/AlternateFontFamily.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2008 Apple Inc. All rights reserved. -Copyright (C) 2007 Nicholas Shanks -Copyright (C) 2013 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/Character.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/PurgeableVector.cpp -FILE: ../../../flutter/sky/engine/platform/PurgeableVector.h -FILE: ../../../flutter/sky/engine/platform/PurgeableVectorTest.cpp -FILE: ../../../flutter/sky/engine/platform/TestingPlatformSupport.cpp -FILE: ../../../flutter/sky/engine/platform/TestingPlatformSupport.h -FILE: ../../../flutter/sky/engine/platform/fonts/Character.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/Character.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontCacheClient.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontPlatformFeatures.h -FILE: ../../../flutter/sky/engine/platform/heap/Handle.h -FILE: ../../../flutter/sky/engine/wtf/DefaultAllocator.cpp -FILE: ../../../flutter/sky/engine/wtf/RawPtr.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontBaseline.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontBaseline.h -FILE: ../../../flutter/sky/engine/platform/fonts/FontOrientation.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontCache.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontCache.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2008 Apple Inc. All rights reserved. -Copyright (C) 2007 Nicholas Shanks - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontCache.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontCache.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. -Copyright (C) 2007-2008 Torch Mobile, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontCacheEmpty.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontCacheEmpty.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2016, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontCacheKey.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontCacheKey.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. -3. Neither the name of Google Inc. nor the names of its contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontCustomPlatformData.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontCustomPlatformData.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007 Apple Computer, Inc. -Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontData.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontData.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/FontData.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontDescription.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontDescription.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007 Nicholas Shanks -Copyright (C) 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontDescriptionTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontDescriptionTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontFaceCreationParams.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontFaceCreationParams.h -FILE: ../../../flutter/sky/engine/platform/fonts/VDMXParser.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2009, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontFallbackList.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontFallbackList.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontFamily.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontFamily.cpp -FILE: ../../../flutter/sky/engine/platform/text/TextStream.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontFeatureSettings.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontFeatureSettings.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/FontFeatureSettings.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontRenderStyle.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontRenderStyle.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2010, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontSelector.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontSelector.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontSmoothingMode.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontSmoothingMode.h -FILE: ../../../flutter/sky/engine/platform/fonts/TextRenderingMode.h -FILE: ../../../flutter/sky/engine/platform/graphics/ColorSpace.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontTest.cpp -FILE: ../../../flutter/sky/engine/public/platform/WebDiscardableMemory.h -FILE: ../../../flutter/sky/engine/wtf/InstanceCounter.cpp -FILE: ../../../flutter/sky/engine/wtf/InstanceCounter.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/FontTraits.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontTraits.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008 Apple Inc. All Rights Reserved. -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/Glyph.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/Glyph.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2011. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/GlyphBuffer.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/GlyphBuffer.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2009, 2011 Apple Inc. All rights reserved. -Copyright (C) 2007-2008 Torch Mobile Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/GlyphMetricsMap.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/GlyphMetricsMap.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/GlyphPage.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/GlyphPage.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008, 2013 Apple Inc. All rights reserved. -Copyright (C) Research In Motion Limited 2011. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/GlyphPageTreeNode.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/GlyphPageTreeNode.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/GlyphPageTreeNode.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/SegmentedFontData.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/SegmentedFontData.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/SegmentedFontData.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/SimpleFontData.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/SimpleFontData.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/WidthCache.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/WidthCache.h -FILE: ../../../flutter/sky/engine/wtf/DataLog.cpp -FILE: ../../../flutter/sky/engine/wtf/DataLog.h -FILE: ../../../flutter/sky/engine/wtf/FilePrintStream.cpp -FILE: ../../../flutter/sky/engine/wtf/FilePrintStream.h -FILE: ../../../flutter/sky/engine/wtf/PrintStream.cpp -FILE: ../../../flutter/sky/engine/wtf/PrintStream.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/apple/FontPlatformDataApple.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/FontPlatformData.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/FontPlatformData.h -FILE: ../../../flutter/sky/engine/platform/fonts/apple/FontPlatformDataApple.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/linux/FontPlatformDataLinux.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/skia/FontPlatformDataSkia.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/win/FontFallbackWin.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/harfbuzz/FontHarfBuzz.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/harfbuzz/FontHarfBuzz.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2007, 2008, 2010 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzFace.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzFaceSkia.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2012 Google Inc. All rights reserved. -Copyright (c) 2014 BlackBerry Limited. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/harfbuzz/HarfBuzzShaper.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2012 Google Inc. All rights reserved. -Copyright (C) 2013 BlackBerry Limited. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/linux/FontCacheLinux.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/linux/FontCacheLinux.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/mobile/FontCacheMobile.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/mobile/FontCacheMobile.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2017 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/opentype/OpenTypeTypes.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/opentype/OpenTypeTypes.h -FILE: ../../../flutter/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/opentype/OpenTypeVerticalData.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Koji Ishii - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/skia/FontCacheSkia.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/skia/FontCacheSkia.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/skia/FontCustomPlatformDataSkia.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/skia/FontCustomPlatformDataSkia.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007 Apple Computer, Inc. -Copyright (c) 2007, 2008, 2009, Google Inc. All rights reserved. -Copyright (C) 2010 Company 100, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/skia/SimpleFontDataSkia.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/VDMXParser.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/skia/SimpleFontDataSkia.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2008, 2009, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/win/FontCacheSkiaWin.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/win/FontCacheSkiaWin.cpp -FILE: ../../../flutter/sky/engine/platform/fonts/win/FontPlatformDataWin.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007 Apple Computer, Inc. -Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/fonts/win/FontFallbackWin.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/fonts/win/FontFallbackWin.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2006, 2007, 2008, 2009, 2010, 2012 Google Inc. All -rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/FloatBox.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/FloatBox.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/FloatBoxExtent.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/FloatBoxExtent.h -FILE: ../../../flutter/sky/engine/platform/geometry/IntRectExtent.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. -2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/FloatBoxTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/FloatBoxTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES,:tabnew INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/FloatBoxTestHelpers.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/FloatBoxTestHelpers.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/FloatBoxTestHelpers.h -FILE: ../../../flutter/sky/engine/platform/transforms/TransformOperationsTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/FloatPoint.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/FloatPoint.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/FloatPoint.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2005 Nokia. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/FloatQuad.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/FloatQuad.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008 Apple Inc. All rights reserved. -Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies) -Copyright (C) 2013 Xidorn Quan (quanxunzhen@gmail.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/FloatRect.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/FloatRect.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/FloatRect.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2005 Nokia. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/FloatSize.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/FloatSize.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2005 Nokia. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/FloatSize.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/FloatSize.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2005 Nokia. All rights reserved. - 2008 Eric Seidel - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/IntPoint.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/IntPoint.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/IntRect.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/IntRect.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/IntRect.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/IntSize.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/IntSize.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. -All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/LayoutBoxExtent.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/LayoutUnit.h -FILE: ../../../flutter/sky/engine/platform/LayoutUnitTest.cpp -FILE: ../../../flutter/sky/engine/platform/LengthBox.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/LayoutBoxExtent.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/LayoutBoxExtent.h -FILE: ../../../flutter/sky/engine/platform/geometry/LayoutPoint.h -FILE: ../../../flutter/sky/engine/platform/geometry/LayoutRect.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/LayoutRect.h -FILE: ../../../flutter/sky/engine/platform/geometry/LayoutSize.h -FILE: ../../../flutter/sky/engine/platform/graphics/RegionTracker.cpp -FILE: ../../../flutter/sky/engine/platform/graphics/RegionTracker.h -FILE: ../../../flutter/sky/engine/wtf/SaturatedArithmetic.h -FILE: ../../../flutter/sky/engine/wtf/SaturatedArithmeticTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2012, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/Region.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/Region.cpp -FILE: ../../../flutter/sky/engine/platform/geometry/Region.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010, 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/RegionTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/RegionTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/RoundedRect.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/RoundedRect.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. -Copyright (C) 2010 Google Inc. All rights reserved. -Copyright (C) 2013 Xidorn Quan (quanxunzhen@gmail.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/geometry/RoundedRect.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/geometry/RoundedRect.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. -Copyright (C) 2010 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/Color.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/Color.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/Color.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/Color.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/ColorSpace.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/ColorSpace.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2008, Google Inc. All rights reserved. -Copyright (C) 2009 Dirk Schulze -Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/DashArray.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/DashArray.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008 Dirk Schulze - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/FrameData.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/FrameData.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) -Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/FrameData.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/FrameData.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) -Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2008-2009 Torch Mobile, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/GeneratedImage.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/GeneratedImage.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/Gradient.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/Gradient.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. -Copyright (C) 2007 Alp Toker -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/Gradient.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/Gradient.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. -Copyright (C) 2007 Alp Toker -Copyright (C) 2008 Torch Mobile, Inc. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/GradientGeneratedImage.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/GradientGeneratedImage.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008, 2009, 2010, 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/GradientGeneratedImage.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/GradientGeneratedImage.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008, 2012 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/GraphicsContext.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/GraphicsContext.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/GraphicsContext.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/GraphicsContext.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. -Copyright (C) 2008-2009 Torch Mobile, Inc. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/GraphicsContextState.cpp + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/GraphicsContextState.cpp -FILE: ../../../flutter/sky/engine/wtf/allocator/PartitionAllocator.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/GraphicsContextState.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/GraphicsContextState.h -FILE: ../../../flutter/sky/engine/platform/graphics/GraphicsContextStateSaver.h -FILE: ../../../flutter/sky/engine/platform/graphics/StrokeData.cpp -FILE: ../../../flutter/sky/engine/platform/graphics/StrokeData.h -FILE: ../../../flutter/sky/engine/platform/text/TextRunIterator.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/GraphicsTypes.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/GraphicsTypes.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2012 Rik Cabanier (cabanier@adobe.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/GraphicsTypes.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/GraphicsTypes.h -FILE: ../../../flutter/sky/engine/platform/graphics/ImageObserver.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/Image.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/Image.cpp -FILE: ../../../flutter/sky/engine/platform/graphics/Image.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) -Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/ImageObserver.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/ImageObserver.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Google, Inc. ("Google") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/ImageOrientation.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/ImageOrientation.cpp -FILE: ../../../flutter/sky/engine/platform/graphics/ImageOrientation.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/Path.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/Path.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. - 2006 Rob Buis -Copyright (C) 2007 Eric Seidel -Copyright (C) 2013 Google Inc. All rights reserved. -Copyright (C) 2013 Intel Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/Path.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/Path.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved. - 2006 Rob Buis -Copyright (C) 2007-2008 Torch Mobile, Inc. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/PathTraversalState.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/PathTraversalState.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007 Eric Seidel - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/Pattern.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/Pattern.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. -Copyright (C) 2008 Eric Seidel -Copyright (C) 2013 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/Pattern.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/Pattern.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved. -Copyright (C) 2008 Eric Seidel -Copyright (C) 2007-2008 Torch Mobile, Inc. -Copyright (C) 2013 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/skia/SkSizeHash.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/skia/SkSizeHash.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/graphics/skia/SkiaUtils.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/graphics/skia/SkiaUtils.cpp -FILE: ../../../flutter/sky/engine/platform/graphics/skia/SkiaUtils.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2006,2007,2008, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/LineEnding.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/LineEnding.cpp -FILE: ../../../flutter/sky/engine/platform/text/LineEnding.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. -Copyright (C) 2010 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/NonCJKGlyphOrientation.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/NonCJKGlyphOrientation.h -FILE: ../../../flutter/sky/engine/platform/text/TextRun.cpp -FILE: ../../../flutter/sky/engine/wtf/CheckedArithmeticTest.cpp -FILE: ../../../flutter/sky/engine/wtf/DequeTest.cpp -FILE: ../../../flutter/sky/engine/wtf/DoublyLinkedList.h -FILE: ../../../flutter/sky/engine/wtf/VectorTest.cpp -FILE: ../../../flutter/sky/engine/wtf/text/StringOperatorsTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/TextBoundaries.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/TextBoundaries.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2009 Dominik Röttsches - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/TextBoundaries.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/TextBoundaries.h -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecLatin1.h -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecUTF16.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/TextDecoration.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/TextDecoration.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/TextDirection.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/TextDirection.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/TextPath.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/TextPath.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2013 Samsung All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Samsung nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/TextStream.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/TextStream.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2008, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/UnicodeBidi.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/UnicodeBidi.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/UnicodeUtilities.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/UnicodeUtilities.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All -rights reserved. -Copyright (C) 2005 Alexey Proskuryakov. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/UnicodeUtilities.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/UnicodeUtilities.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/text/UnicodeUtilitiesTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/text/UnicodeUtilitiesTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2013 Yandex LLC. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Yandex LLC nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/transforms/AffineTransform.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/transforms/AffineTransform.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - 2010 Dirk Schulze -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/transforms/AffineTransform.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/transforms/AffineTransform.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - 2010 Dirk Schulze - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/transforms/Matrix3DTransformOperation.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/transforms/Matrix3DTransformOperation.cpp -FILE: ../../../flutter/sky/engine/platform/transforms/Matrix3DTransformOperation.h -FILE: ../../../flutter/sky/engine/platform/transforms/PerspectiveTransformOperation.cpp -FILE: ../../../flutter/sky/engine/platform/transforms/PerspectiveTransformOperation.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/transforms/TransformationMatrix.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/transforms/TransformationMatrix.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2009 Torch Mobile, Inc. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/platform/transforms/TransformationMatrix.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/platform/transforms/TransformationMatrix.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/public/web/Sky.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/public/web/Sky.h -FILE: ../../../flutter/sky/engine/web/Sky.cpp -FILE: ../../../flutter/sky/engine/wtf/MainThread.cpp -FILE: ../../../flutter/sky/engine/wtf/ThreadIdentifierDataPthreads.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/ASCIICType.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/ASCIICType.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007, 2008, 2009, 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/Assertions.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/Assertions.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2007-2009 Torch Mobile, Inc. -Copyright (C) 2011 University of Szeged. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/Assertions.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/Assertions.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. -Copyright (C) 2013 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/Atomics.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/Atomics.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007, 2008, 2010, 2012 Apple Inc. All rights reserved. -Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/CPU.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/CPU.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. -Copyright (C) 2007-2009 Torch Mobile, Inc. -Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. -Copyright (C) 2013 Samsung Electronics. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/CheckedArithmetic.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/CheckedArithmetic.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/Compiler.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/Compiler.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011, 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/Deque.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/Deque.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007, 2008 Apple Inc. All rights reserved. -Copyright (C) 2009 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/DynamicAnnotations.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/DynamicAnnotations.cpp -FILE: ../../../flutter/sky/engine/wtf/DynamicAnnotations.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/EnumClass.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/EnumClass.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/FastAllocBase.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/FastAllocBase.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008, 2009 Paul Pedriana . -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/FastMalloc.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/FastMalloc.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 2005, 2007, Google Inc. -All rights reserved. -Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/HashMapTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/HashMapTest.cpp -FILE: ../../../flutter/sky/engine/wtf/TemporaryChangeTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/LeakAnnotations.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/LeakAnnotations.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Google Inc. All rights reserved. -Copyright (C) 2013 Samsung Electronics. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/MainThread.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/MainThread.h -FILE: ../../../flutter/sky/engine/wtf/ThreadSafeRefCounted.h -FILE: ../../../flutter/sky/engine/wtf/Threading.h -FILE: ../../../flutter/sky/engine/wtf/ThreadingPrimitives.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. -Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/MathExtras.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/MathExtras.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/MathExtrasTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/MathExtrasTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Intel Corporation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/NonCopyingSort.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/NonCopyingSort.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/NullPtr.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/NullPtr.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/OwnPtrCommon.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/OwnPtrCommon.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009 Apple Inc. All rights reserved. -Copyright (C) 2009 Torch Mobile, Inc. -Copyright (C) 2010 Company 100 Inc. -Copyright (C) 2013 Intel Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/PassOwnPtr.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/PassOwnPtr.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009, 2010 Apple Inc. All rights reserved. -Copyright (C) 2013 Intel Corporation. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/PassTraits.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/PassTraits.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/StringExtras.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/StringExtras.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/StringHasherTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/StringHasherTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/TemporaryChange.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/TemporaryChange.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/ThreadIdentifierDataPthreads.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/ThreadIdentifierDataPthreads.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009, 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/ThreadSpecific.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/ThreadSpecific.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008 Apple Inc. All rights reserved. -Copyright (C) 2009 Jian Li -Copyright (C) 2012 Patrick Gansterer - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/ThreadingPthreads.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/ThreadingPthreads.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007, 2009 Apple Inc. All rights reserved. -Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) -Copyright (C) 2011 Research In Motion Limited. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/ThreadingWin.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/ThreadingWin.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007, 2008 Apple Inc. All rights reserved. -Copyright (C) 2009 Google Inc. All rights reserved. -Copyright (C) 2009 Torch Mobile, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/WTFThreadData.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/WTFThreadData.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/WTFThreadData.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/WTFThreadData.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/dtoa.cpp -TYPE: LicenseType.unknown -FILE: ../../../flutter/sky/engine/wtf/dtoa.cpp ----------------------------------------------------------------------------------------------------- -Copyright (c) 1991, 2000, 2001 by Lucent Technologies. -Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. -All rights reserved. - -Permission to use, copy, modify, and distribute this software for any -purpose without fee is hereby granted, provided that this entire notice -is included in all copies of any software which is or includes a copy -or modification of this software and in all copies of the supporting -documentation for such software. - -THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED -WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY -REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY -OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/dtoa/bignum-dtoa.cc -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/dtoa/bignum-dtoa.cc -FILE: ../../../flutter/sky/engine/wtf/dtoa/bignum-dtoa.h -FILE: ../../../flutter/sky/engine/wtf/dtoa/bignum.cc -FILE: ../../../flutter/sky/engine/wtf/dtoa/bignum.h -FILE: ../../../flutter/sky/engine/wtf/dtoa/cached-powers.h -FILE: ../../../flutter/sky/engine/wtf/dtoa/diy-fp.cc -FILE: ../../../flutter/sky/engine/wtf/dtoa/diy-fp.h -FILE: ../../../flutter/sky/engine/wtf/dtoa/double-conversion.cc -FILE: ../../../flutter/sky/engine/wtf/dtoa/double-conversion.h -FILE: ../../../flutter/sky/engine/wtf/dtoa/double.h -FILE: ../../../flutter/sky/engine/wtf/dtoa/fast-dtoa.cc -FILE: ../../../flutter/sky/engine/wtf/dtoa/fast-dtoa.h -FILE: ../../../flutter/sky/engine/wtf/dtoa/fixed-dtoa.cc -FILE: ../../../flutter/sky/engine/wtf/dtoa/fixed-dtoa.h -FILE: ../../../flutter/sky/engine/wtf/dtoa/strtod.cc -FILE: ../../../flutter/sky/engine/wtf/dtoa/strtod.h -FILE: ../../../flutter/sky/engine/wtf/dtoa/utils.h ----------------------------------------------------------------------------------------------------- -Copyright 2010 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/dtoa/cached-powers.cc -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/dtoa/cached-powers.cc ----------------------------------------------------------------------------------------------------- -Copyright 2006-2008 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/AtomicStringTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/AtomicStringTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013 Samsung Electronics. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/CString.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/CString.cpp -FILE: ../../../flutter/sky/engine/wtf/text/CString.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2003, 2006, 2008, 2009, 2010, 2012 Apple Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/CStringTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/HashSetTest.cpp -FILE: ../../../flutter/sky/engine/wtf/ListHashSetTest.cpp -FILE: ../../../flutter/sky/engine/wtf/StringExtrasTest.cpp -FILE: ../../../flutter/sky/engine/wtf/text/CStringTest.cpp -FILE: ../../../flutter/sky/engine/wtf/text/StringImplTest.cpp -FILE: ../../../flutter/sky/engine/wtf/text/WTFStringTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2012 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/StringBuffer.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/StringBuffer.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2008, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of Apple Inc. ("Apple") nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/StringBuilder.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/StringBuilder.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010 Apple Inc. All rights reserved. -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/StringBuilder.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/StringBuilder.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. -Copyright (C) 2012 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/StringBuilderTest.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/StringBuilderTest.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Google Inc. All rights reserved. -Copyright (C) 2013 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/StringConcatenate.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/StringConcatenate.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/StringStatics.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/StringStatics.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010 Apple Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextCodec.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextCodec.cpp -FILE: ../../../flutter/sky/engine/wtf/text/TextCodec.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextCodecASCIIFastPath.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecASCIIFastPath.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2011 Apple Inc. All rights reserved. -Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextCodecICU.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecICU.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextCodecICU.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecICU.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2007, 2011 Apple Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextCodecLatin1.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecLatin1.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextCodecUTF16.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecUTF16.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2008, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextCodecUTF8.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecUTF8.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2008, 2011 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextCodecUserDefined.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecUserDefined.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007, 2008 Apple, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextCodecUserDefined.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextCodecUserDefined.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007 Apple, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextEncoding.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextEncoding.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. -Copyright (C) 2006 Alexey Proskuryakov -Copyright (C) 2007-2009 Torch Mobile, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextEncoding.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextEncoding.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextEncodingRegistry.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextEncodingRegistry.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. -Copyright (C) 2007-2009 Torch Mobile, Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextEncodingRegistry.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextEncodingRegistry.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextPosition.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextPosition.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2013, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/text/TextPosition.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/text/TextPosition.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2010, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/unicode/CharacterNames.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/unicode/CharacterNames.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007, 2009, 2010 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/unicode/UTF8.cpp -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/unicode/UTF8.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007 Apple Inc. All rights reserved. -Copyright (C) 2010 Patrick Gansterer - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/sky/engine/wtf/unicode/UTF8.h -TYPE: LicenseType.bsd -FILE: ../../../flutter/sky/engine/wtf/HashIterators.h -FILE: ../../../flutter/sky/engine/wtf/unicode/UTF8.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2007 Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: engine ORIGIN: ../../../garnet/LICENSE @@ -9965,8 +1115,6 @@ FILE: ../../../flutter/lib/ui/text/paragraph_builder.cc FILE: ../../../flutter/lib/ui/text/paragraph_builder.h FILE: ../../../flutter/lib/ui/text/paragraph_impl.cc FILE: ../../../flutter/lib/ui/text/paragraph_impl.h -FILE: ../../../flutter/lib/ui/text/paragraph_impl_blink.cc -FILE: ../../../flutter/lib/ui/text/paragraph_impl_blink.h FILE: ../../../flutter/lib/ui/text/paragraph_impl_txt.cc FILE: ../../../flutter/lib/ui/text/paragraph_impl_txt.h FILE: ../../../flutter/lib/ui/text/text_box.cc @@ -9979,7 +1127,6 @@ FILE: ../../../flutter/lib/ui/window/pointer_data_packet.cc FILE: ../../../flutter/lib/ui/window/window.cc FILE: ../../../flutter/runtime/dart_service_isolate.cc FILE: ../../../flutter/runtime/dart_service_isolate.h -FILE: ../../../flutter/runtime/platform_impl.cc FILE: ../../../flutter/runtime/runtime_controller.cc FILE: ../../../flutter/runtime/runtime_controller.h FILE: ../../../flutter/runtime/runtime_delegate.cc @@ -10020,8 +1167,6 @@ FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.cc FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm -FILE: ../../../flutter/sky/engine/wtf/Allocator.h -FILE: ../../../flutter/sky/engine/wtf/MakeUnique.h ---------------------------------------------------------------------------------------------------- Copyright 2015 The Chromium Authors. All rights reserved. @@ -10098,4 +1243,4 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -Total license count: 218 +Total license count: 13 From 39c02c4dc9f8ef8c0a4357df581480e60500e824 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Thu, 10 May 2018 17:21:12 -0700 Subject: [PATCH 0302/1190] Fixed Windows build after Blink removal (#5230) --- lib/ui/painting/canvas.cc | 1 + lib/ui/painting/gradient.cc | 2 ++ lib/ui/painting/path.cc | 5 +++-- lib/ui/painting/path_measure.cc | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ui/painting/canvas.cc b/lib/ui/painting/canvas.cc index d09f4eebcf794..7bfeb5cfdda9e 100644 --- a/lib/ui/painting/canvas.cc +++ b/lib/ui/painting/canvas.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/painting/canvas.h" +#define _USE_MATH_DEFINES #include #include "flutter/flow/layers/physical_shape_layer.h" diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 95694ab516fd0..9cbf5a19c5275 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#define _USE_MATH_DEFINES + #include "flutter/lib/ui/painting/gradient.h" #include "lib/tonic/converter/dart_converter.h" diff --git a/lib/ui/painting/path.cc b/lib/ui/painting/path.cc index ffd9f4b7c5b02..2ef610648e650 100644 --- a/lib/ui/painting/path.cc +++ b/lib/ui/painting/path.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/painting/path.h" +#define _USE_MATH_DEFINES #include #include "flutter/lib/ui/painting/matrix.h" @@ -215,7 +216,7 @@ void CanvasPath::addPath(CanvasPath* path, double dx, double dy) { void CanvasPath::addPathWithMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { if (!path) Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); - + SkMatrix matrix = ToSkMatrix(matrix4); matrix.setTranslateX(matrix.getTranslateX() + dx); matrix.setTranslateY(matrix.getTranslateY() + dy); @@ -233,7 +234,7 @@ void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) { void CanvasPath::extendWithPathAndMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { if (!path) Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); - + SkMatrix matrix = ToSkMatrix(matrix4); matrix.setTranslateX(matrix.getTranslateX() + dx); matrix.setTranslateY(matrix.getTranslateY() + dy); diff --git a/lib/ui/painting/path_measure.cc b/lib/ui/painting/path_measure.cc index 5bff424d7798d..e81e4b9c3b5d3 100644 --- a/lib/ui/painting/path_measure.cc +++ b/lib/ui/painting/path_measure.cc @@ -4,6 +4,7 @@ #include "flutter/lib/ui/painting/path_measure.h" +#define _USE_MATH_DEFINES #include #include "flutter/lib/ui/painting/matrix.h" From b856303c4e20a96877d9551572c71dada31537bd Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Thu, 10 May 2018 18:49:41 -0700 Subject: [PATCH 0303/1190] Revert 37e20af6a324cd4cfa1324b8c644712ef8224359 (#5232) It introduced https://github.com/dart-lang/sdk/issues/33095 --- DEPS | 8 ++++---- travis/licenses_golden/licenses_third_party | 12 +++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/DEPS b/DEPS index 81e83711646b0..74e18964c024b 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '779dc6eb85c1f2249803d017ffa785c85681ad1b', + 'dart_revision': 'e6d7d67f4b35556805dd083fed15bf3ed41f7e33', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -59,7 +59,7 @@ vars = { 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.50', + 'dart_linter_tag': '0.1.49', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', @@ -74,8 +74,8 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': 'c61b8a3a24a7b1f931bad24b1f663e2c9a4c4354', - 'dart_pub_semver_tag': '1.4.1', + 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', + 'dart_pub_semver_tag': '1.3.7', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f0e33a3b9eef1..1a2594ddd4dcb 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,9 +1,9 @@ -Signature: a21b2333b39745cc2457c3e4eb0801e3 +Signature: f59cb1bfa5d91c5f8d634a2628f29b32 UNUSED LICENSES: ==================================================================================================== -ORIGIN: ../../../flutter/sky/engine/wtf/dtoa/LICENSE +ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/COPYING TYPE: LicenseType.bsd ---------------------------------------------------------------------------------------------------- Copyright 2006-2011, the V8 project authors. All rights reserved. @@ -6027,21 +6027,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h -FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h FILE: ../../../third_party/dart/runtime/vm/hash.h -FILE: ../../../third_party/dart/runtime/vm/interpreter.cc -FILE: ../../../third_party/dart/runtime/vm/interpreter.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h FILE: ../../../third_party/dart/sdk/lib/js/_js.dart From 9ae10ef702e76585ea498bdfb2b40181017623ad Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Thu, 10 May 2018 23:50:19 -0700 Subject: [PATCH 0304/1190] Revert f6359e4111d37652409e2392fdb3cb72f1119c2a (#5233) In introduced a regression in text layout: https://github.com/flutter/flutter/issues/17502 --- third_party/txt/src/minikin/LineBreaker.cpp | 2 +- third_party/txt/src/minikin/LineBreaker.h | 2 - third_party/txt/src/txt/paragraph.cc | 48 +++++++++------------ third_party/txt/src/txt/paragraph.h | 11 ++--- third_party/txt/src/txt/paragraph_style.cc | 12 ------ third_party/txt/src/txt/paragraph_style.h | 3 -- 6 files changed, 25 insertions(+), 53 deletions(-) diff --git a/third_party/txt/src/minikin/LineBreaker.cpp b/third_party/txt/src/minikin/LineBreaker.cpp index adff2a1e7733b..0245e579b127f 100644 --- a/third_party/txt/src/minikin/LineBreaker.cpp +++ b/third_party/txt/src/minikin/LineBreaker.cpp @@ -107,7 +107,7 @@ void LineBreaker::setIndents(const std::vector& indents) { // end of line. It is the Unicode set: // [[:General_Category=Space_Separator:]-[:Line_Break=Glue:]], plus '\n'. Note: // all such characters are in the BMP, so it's ok to use code units for this. -bool isLineEndSpace(uint16_t c) { +static bool isLineEndSpace(uint16_t c) { return c == '\n' || c == ' ' || c == 0x1680 || (0x2000 <= c && c <= 0x200A && c != 0x2007) || c == 0x205F || c == 0x3000; diff --git a/third_party/txt/src/minikin/LineBreaker.h b/third_party/txt/src/minikin/LineBreaker.h index 4789850bb92fe..c4ba9b265a135 100644 --- a/third_party/txt/src/minikin/LineBreaker.h +++ b/third_party/txt/src/minikin/LineBreaker.h @@ -49,8 +49,6 @@ enum HyphenationFrequency { kHyphenationFrequency_Full = 2 }; -bool isLineEndSpace(uint16_t c); - // TODO: want to generalize to be able to handle array of line widths class LineWidths { public: diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index d5b6124a3cf1d..c429fca1f4ac7 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -258,8 +258,7 @@ bool Paragraph::ComputeLineBreaks() { size_t block_size = block_end - block_start; if (block_size == 0) { - line_ranges_.emplace_back(block_start, block_end, block_end, - block_end + 1, true); + line_ranges_.emplace_back(block_start, block_end, block_end + 1, true); line_widths_.push_back(0); continue; } @@ -312,14 +311,7 @@ bool Paragraph::ComputeLineBreaks() { bool hard_break = i == breaks_count - 1; size_t line_end_including_newline = (hard_break && line_end < text_.size()) ? line_end + 1 : line_end; - size_t line_end_excluding_whitespace = line_end; - while ( - line_end_excluding_whitespace > 0 && - minikin::isLineEndSpace(text_[line_end_excluding_whitespace - 1])) { - line_end_excluding_whitespace--; - } line_ranges_.emplace_back(line_start, line_end, - line_end_excluding_whitespace, line_end_including_newline, hard_break); line_widths_.push_back(breaker_.getWidths()[i]); } @@ -470,20 +462,13 @@ void Paragraph::Layout(double width, bool force) { } } - // Exclude trailing whitespace from right-justified lines so the last - // visible character in the line will be flush with the right margin. - size_t line_end_index = - (paragraph_style_.effective_align() == TextAlign::right) - ? line_range.end_excluding_whitespace - : line_range.end; - // Find the runs comprising this line. std::vector line_runs; for (const BidiRun& bidi_run : bidi_runs) { - if (bidi_run.start() < line_end_index && + if (bidi_run.start() < line_range.end && bidi_run.end() > line_range.start) { line_runs.emplace_back(std::max(bidi_run.start(), line_range.start), - std::min(bidi_run.end(), line_end_index), + std::min(bidi_run.end(), line_range.end), bidi_run.direction(), bidi_run.style()); } } @@ -702,7 +687,7 @@ void Paragraph::Layout(double width, bool force) { } // Adjust the glyph positions based on the alignment of the line. - double line_x_offset = GetLineXOffset(run_x_offset); + double line_x_offset = GetLineXOffset(line_number, run_x_offset); if (line_x_offset) { for (CodeUnitRun& code_unit_run : line_code_unit_runs) { for (GlyphPosition& position : code_unit_run.positions) { @@ -795,16 +780,25 @@ void Paragraph::Layout(double width, bool force) { }); } -double Paragraph::GetLineXOffset(double line_total_advance) { - if (isinf(width_)) +double Paragraph::GetLineXOffset(size_t line_number, + double line_total_advance) { + if (line_number >= line_widths_.size() || isinf(width_)) return 0; - TextAlign align = paragraph_style_.effective_align(); - - if (align == TextAlign::right) { - return width_ - line_total_advance; - } else if (align == TextAlign::center) { - return (width_ - line_total_advance) / 2; + TextAlign align = paragraph_style_.text_align; + TextDirection direction = paragraph_style_.text_direction; + + if (align == TextAlign::right || + (align == TextAlign::start && direction == TextDirection::rtl) || + (align == TextAlign::end && direction == TextDirection::ltr)) { + // If this line has a soft break, then use the line width calculated by the + // line breaker because that width excludes the soft break's whitespace. + double text_width = line_ranges_[line_number].hard_break + ? line_total_advance + : line_widths_[line_number]; + return width_ - text_width; + } else if (paragraph_style_.text_align == TextAlign::center) { + return (width_ - line_widths_[line_number]) / 2; } else { return 0; } diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index 894439abc5965..25676cfed00ba 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -187,14 +187,9 @@ class Paragraph { mutable std::unique_ptr word_breaker_; struct LineRange { - LineRange(size_t s, size_t e, size_t eew, size_t ein, bool h) - : start(s), - end(e), - end_excluding_whitespace(eew), - end_including_newline(ein), - hard_break(h) {} + LineRange(size_t s, size_t e, size_t ewn, bool h) + : start(s), end(e), end_including_newline(ewn), hard_break(h) {} size_t start, end; - size_t end_excluding_whitespace; size_t end_including_newline; bool hard_break; }; @@ -305,7 +300,7 @@ class Paragraph { // Calculate the starting X offset of a line based on the line's width and // alignment. - double GetLineXOffset(double line_total_advance); + double GetLineXOffset(size_t line_number, double line_total_advance); // Creates and draws the decorations onto the canvas. void PaintDecorations(SkCanvas* canvas, const PaintRecord& record); diff --git a/third_party/txt/src/txt/paragraph_style.cc b/third_party/txt/src/txt/paragraph_style.cc index fbb89cbfccdec..5c00409782cdc 100644 --- a/third_party/txt/src/txt/paragraph_style.cc +++ b/third_party/txt/src/txt/paragraph_style.cc @@ -37,16 +37,4 @@ bool ParagraphStyle::ellipsized() const { return !ellipsis.empty(); } -TextAlign ParagraphStyle::effective_align() const { - if (text_align == TextAlign::start) { - return (text_direction == TextDirection::ltr) ? TextAlign::left - : TextAlign::right; - } else if (text_align == TextAlign::end) { - return (text_direction == TextDirection::ltr) ? TextAlign::right - : TextAlign::left; - } else { - return text_align; - } -} - } // namespace txt diff --git a/third_party/txt/src/txt/paragraph_style.h b/third_party/txt/src/txt/paragraph_style.h index 3b04269d8eaee..13d32106c1df3 100644 --- a/third_party/txt/src/txt/paragraph_style.h +++ b/third_party/txt/src/txt/paragraph_style.h @@ -66,9 +66,6 @@ class ParagraphStyle { bool unlimited_lines() const; bool ellipsized() const; - - // Return a text alignment value that is not dependent on the text direction. - TextAlign effective_align() const; }; } // namespace txt From 3ec12d4c3f0b9279eb7f28c41a6194f8dad2b8ed Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 11 May 2018 11:42:19 -0700 Subject: [PATCH 0305/1190] Detach from JNI before exiting the GPU thread. (#5231) The GPU thread calls into Java via JNI in order to update external textures. Fixes https://github.com/flutter/flutter/issues/17329 --- shell/platform/android/android_shell_holder.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index 1fe0854296c33..15bfdc6ad48e9 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -34,11 +34,12 @@ AndroidShellHolder::AndroidShellHolder( thread_host_ = {thread_label, ThreadHost::Type::UI | ThreadHost::Type::GPU | ThreadHost::Type::IO}; - // Detach from JNI when the UI thread exits. - thread_host_.ui_thread->GetTaskRunner()->PostTask( - [key = thread_destruct_key_]() { - FXL_CHECK(pthread_setspecific(key, reinterpret_cast(1)) == 0); - }); + // Detach from JNI when the UI and GPU threads exit. + auto jni_exit_task([key = thread_destruct_key_]() { + FXL_CHECK(pthread_setspecific(key, reinterpret_cast(1)) == 0); + }); + thread_host_.ui_thread->GetTaskRunner()->PostTask(jni_exit_task); + thread_host_.gpu_thread->GetTaskRunner()->PostTask(jni_exit_task); fml::WeakPtr weak_platform_view; Shell::CreateCallback on_create_platform_view = From f58dcd75ff31ef94e422b37f0da86b1d68af753d Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 11 May 2018 14:55:59 -0400 Subject: [PATCH 0306/1190] Roll src/third_party/skia/ 1d686a962..811b944a8 (25 commits; 5 trivial rolls) (#5237) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 564 ++++++++++---------- travis/licenses_golden/licenses_third_party | 6 +- 3 files changed, 281 insertions(+), 291 deletions(-) diff --git a/DEPS b/DEPS index 74e18964c024b..a05c5f5da93d9 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1d686a962c775a69b54f165a23c20c57e506023b', + 'skia_revision': '811b944a89602d4466ea273b565642639d2a95c0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 3541d71a1aca3..7d0e2c8a1deb1 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -2161,284 +2161,6 @@ OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -Copyright 2005 Nokia. All rights reserved. - -The portions of the attached software ("Contribution") is developed by -Nokia Corporation and is licensed pursuant to the OpenSSL open source -license. - -The Contribution, originally written by Mika Kousa and Pasi Eronen of -Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites -support (see RFC 4279) to OpenSSL. - -No patent licenses or other rights except those expressly stated in -the OpenSSL open source license shall be deemed granted or received -expressly, by implication, estoppel, or otherwise. - -No assurances are provided by Nokia that the Contribution does not -infringe the patent or other intellectual property rights of any third -party or that the license provides you with all the necessary rights -to make use of the Contribution. - -THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN -ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA -SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY -OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR -OTHERWISE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2012, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2014, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2016 Brian Smith. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -OpenSSL License - - ==================================================================== - Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - - 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - - 5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - - THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - ==================================================================== - - This product includes cryptographic software written by Eric Young - (eay@cryptsoft.com). This product includes software written by Tim - Hudson (tjh@cryptsoft.com). - -Original SSLeay License - -* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -* All rights reserved. - -* This package is an SSL implementation written -* by Eric Young (eay@cryptsoft.com). -* The implementation was written so as to conform with Netscapes SSL. - -* This library is free for commercial and non-commercial use as long as -* the following conditions are aheared to. The following conditions -* apply to all code found in this distribution, be it the RC4, RSA, -* lhash, DES, etc., code; not just the SSL code. The SSL documentation -* included with this distribution is covered by the same copyright terms -* except that the holder is Tim Hudson (tjh@cryptsoft.com). - -* Copyright remains Eric Young's, and as such any Copyright notices in -* the code are not to be removed. -* If this package is used in a product, Eric Young should be given attribution -* as the author of the parts of the library used. -* This can be in the form of a textual message at program startup or -* in documentation (online or textual) provided with the package. - -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the copyright -* notice, this list of conditions and the following disclaimer. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* 3. All advertising materials mentioning features or use of this software -* must display the following acknowledgement: -* "This product includes cryptographic software written by -* Eric Young (eay@cryptsoft.com)" -* The word 'cryptographic' can be left out if the rouines from the library -* being used are not cryptographic related :-). -* 4. If you include any Windows specific code (or a derivative thereof) from -* the apps directory (application code) you must include an acknowledgement: -* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGE. - -* The licence and distribution terms for any publically available version or -* derivative of this code cannot be changed. i.e. this code cannot simply be -* copied and put under another distribution licence -* [including the GNU Public Licence.] - -ISC license used for completely new code in BoringSSL: - -/* Copyright (c) 2015, Google Inc. - - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -The code in third_party/fiat carries the MIT license: - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -The MIT License (MIT) - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl -gtest - Copyright 2003 Google Inc. All rights reserved. @@ -2469,7 +2191,33 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest + +Copyright 2005 Nokia. All rights reserved. + +The portions of the attached software ("Contribution") is developed by +Nokia Corporation and is licensed pursuant to the OpenSSL open source +license. + +The Contribution, originally written by Mika Kousa and Pasi Eronen of +Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites +support (see RFC 4279) to OpenSSL. + +No patent licenses or other rights except those expressly stated in +the OpenSSL open source license shall be deemed granted or received +expressly, by implication, estoppel, or otherwise. + +No assurances are provided by Nokia that the Contribution does not +infringe the patent or other intellectual property rights of any third +party or that the license provides you with all the necessary rights +to make use of the Contribution. + +THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN +ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA +SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY +OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR +OTHERWISE. +-------------------------------------------------------------------------------- +boringssl Copyright 2005, Google Inc. All rights reserved. @@ -2501,7 +2249,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2006, Google Inc. All rights reserved. @@ -2533,7 +2280,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2007, Google Inc. All rights reserved. @@ -2565,7 +2311,15 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest + +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl Copyright 2008 Google Inc. All Rights Reserved. @@ -2597,7 +2351,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2008, Google Inc. All rights reserved. @@ -2629,7 +2382,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2009 Google Inc. All Rights Reserved. @@ -2661,7 +2413,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2009 Google Inc. All Rights Reserved. @@ -2692,7 +2443,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest Copyright 2009, Google Inc. All rights reserved. @@ -2724,7 +2474,44 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -gtest + +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2012, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2014, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl Copyright 2015, Google Inc. All rights reserved. @@ -2755,6 +2542,209 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- +boringssl + +Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2016 Brian Smith. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +OpenSSL License + + ==================================================================== + Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + + 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + + 5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + + THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ==================================================================== + + This product includes cryptographic software written by Eric Young + (eay@cryptsoft.com). This product includes software written by Tim + Hudson (tjh@cryptsoft.com). + +Original SSLeay License + +* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +* All rights reserved. + +* This package is an SSL implementation written +* by Eric Young (eay@cryptsoft.com). +* The implementation was written so as to conform with Netscapes SSL. + +* This library is free for commercial and non-commercial use as long as +* the following conditions are aheared to. The following conditions +* apply to all code found in this distribution, be it the RC4, RSA, +* lhash, DES, etc., code; not just the SSL code. The SSL documentation +* included with this distribution is covered by the same copyright terms +* except that the holder is Tim Hudson (tjh@cryptsoft.com). + +* Copyright remains Eric Young's, and as such any Copyright notices in +* the code are not to be removed. +* If this package is used in a product, Eric Young should be given attribution +* as the author of the parts of the library used. +* This can be in the form of a textual message at program startup or +* in documentation (online or textual) provided with the package. + +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* 1. Redistributions of source code must retain the copyright +* notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* 3. All advertising materials mentioning features or use of this software +* must display the following acknowledgement: +* "This product includes cryptographic software written by +* Eric Young (eay@cryptsoft.com)" +* The word 'cryptographic' can be left out if the rouines from the library +* being used are not cryptographic related :-). +* 4. If you include any Windows specific code (or a derivative thereof) from +* the apps directory (application code) you must include an acknowledgement: +* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +* SUCH DAMAGE. + +* The licence and distribution terms for any publically available version or +* derivative of this code cannot be changed. i.e. this code cannot simply be +* copied and put under another distribution licence +* [including the GNU Public Licence.] + +ISC license used for completely new code in BoringSSL: + +/* Copyright (c) 2015, Google Inc. + + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +The code in third_party/fiat carries the MIT license: + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +The MIT License (MIT) + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- colorama Copyright (c) 2010 Jonathan Hartley diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1a2594ddd4dcb..aacfd10147a8e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f59cb1bfa5d91c5f8d634a2628f29b32 +Signature: ff5efbc65d16e7ec00644d9deb2401d4 UNUSED LICENSES: @@ -18573,7 +18573,6 @@ FILE: ../../../third_party/skia/include/core/SkImage.h FILE: ../../../third_party/skia/include/core/SkRRect.h FILE: ../../../third_party/skia/include/core/SkStrokeRec.h FILE: ../../../third_party/skia/include/core/SkSurface.h -FILE: ../../../third_party/skia/include/gpu/GrShaderCaps.h FILE: ../../../third_party/skia/include/gpu/GrSurface.h FILE: ../../../third_party/skia/include/gpu/gl/GrGLFunctions.h FILE: ../../../third_party/skia/include/pathops/SkPathOps.h @@ -18619,6 +18618,7 @@ FILE: ../../../third_party/skia/src/gpu/GrProcessorUnitTest.h FILE: ../../../third_party/skia/src/gpu/GrSWMaskHelper.cpp FILE: ../../../third_party/skia/src/gpu/GrSWMaskHelper.h FILE: ../../../third_party/skia/src/gpu/GrShaderCaps.cpp +FILE: ../../../third_party/skia/src/gpu/GrShaderCaps.h FILE: ../../../third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/GrSoftwarePathRenderer.h FILE: ../../../third_party/skia/src/gpu/GrSurface.cpp @@ -19294,7 +19294,6 @@ FILE: ../../../third_party/skia/include/effects/SkLumaColorFilter.h FILE: ../../../third_party/skia/include/effects/SkPerlinNoiseShader.h FILE: ../../../third_party/skia/include/effects/SkTileImageFilter.h FILE: ../../../third_party/skia/include/gpu/GrBlend.h -FILE: ../../../third_party/skia/include/gpu/GrCaps.h FILE: ../../../third_party/skia/include/gpu/gl/GrGLExtensions.h FILE: ../../../third_party/skia/include/ports/SkFontConfigInterface.h FILE: ../../../third_party/skia/include/ports/SkFontMgr.h @@ -19347,6 +19346,7 @@ FILE: ../../../third_party/skia/src/effects/SkDisplacementMapEffect.cpp FILE: ../../../third_party/skia/src/effects/SkDropShadowImageFilter.cpp FILE: ../../../third_party/skia/src/effects/SkLumaColorFilter.cpp FILE: ../../../third_party/skia/src/effects/SkTileImageFilter.cpp +FILE: ../../../third_party/skia/src/gpu/GrCaps.h FILE: ../../../third_party/skia/src/gpu/GrCoordTransform.h FILE: ../../../third_party/skia/src/gpu/GrGeometryProcessor.h FILE: ../../../third_party/skia/src/gpu/GrPaint.cpp From 894dfa8a7345f5bfb9b7c25efee0da48470dea74 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 11 May 2018 12:17:31 -0700 Subject: [PATCH 0307/1190] Re-land "libtxt: exclude trailing whitespace from right-justified lines" (#5234) If a line is right justified, then remove any trailing whitespace from the text range given to Minikin. Right justification shifts the line's glyphs by the layout advance computed by Minikin, and this advance should exclude whitespace so that the last visible character will be flush with the right margin. Also exclude trailing whitespace from center justified lines. Fixes https://github.com/flutter/flutter/issues/17502 Fixes https://github.com/flutter/flutter/issues/16333 --- third_party/txt/src/minikin/LineBreaker.cpp | 2 +- third_party/txt/src/minikin/LineBreaker.h | 2 + third_party/txt/src/txt/paragraph.cc | 49 ++++++++++++--------- third_party/txt/src/txt/paragraph.h | 11 +++-- third_party/txt/src/txt/paragraph_style.cc | 12 +++++ third_party/txt/src/txt/paragraph_style.h | 3 ++ 6 files changed, 54 insertions(+), 25 deletions(-) diff --git a/third_party/txt/src/minikin/LineBreaker.cpp b/third_party/txt/src/minikin/LineBreaker.cpp index 0245e579b127f..adff2a1e7733b 100644 --- a/third_party/txt/src/minikin/LineBreaker.cpp +++ b/third_party/txt/src/minikin/LineBreaker.cpp @@ -107,7 +107,7 @@ void LineBreaker::setIndents(const std::vector& indents) { // end of line. It is the Unicode set: // [[:General_Category=Space_Separator:]-[:Line_Break=Glue:]], plus '\n'. Note: // all such characters are in the BMP, so it's ok to use code units for this. -static bool isLineEndSpace(uint16_t c) { +bool isLineEndSpace(uint16_t c) { return c == '\n' || c == ' ' || c == 0x1680 || (0x2000 <= c && c <= 0x200A && c != 0x2007) || c == 0x205F || c == 0x3000; diff --git a/third_party/txt/src/minikin/LineBreaker.h b/third_party/txt/src/minikin/LineBreaker.h index c4ba9b265a135..4789850bb92fe 100644 --- a/third_party/txt/src/minikin/LineBreaker.h +++ b/third_party/txt/src/minikin/LineBreaker.h @@ -49,6 +49,8 @@ enum HyphenationFrequency { kHyphenationFrequency_Full = 2 }; +bool isLineEndSpace(uint16_t c); + // TODO: want to generalize to be able to handle array of line widths class LineWidths { public: diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index c429fca1f4ac7..bcebc596684af 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -258,7 +258,8 @@ bool Paragraph::ComputeLineBreaks() { size_t block_size = block_end - block_start; if (block_size == 0) { - line_ranges_.emplace_back(block_start, block_end, block_end + 1, true); + line_ranges_.emplace_back(block_start, block_end, block_end, + block_end + 1, true); line_widths_.push_back(0); continue; } @@ -311,7 +312,14 @@ bool Paragraph::ComputeLineBreaks() { bool hard_break = i == breaks_count - 1; size_t line_end_including_newline = (hard_break && line_end < text_.size()) ? line_end + 1 : line_end; + size_t line_end_excluding_whitespace = line_end; + while ( + line_end_excluding_whitespace > 0 && + minikin::isLineEndSpace(text_[line_end_excluding_whitespace - 1])) { + line_end_excluding_whitespace--; + } line_ranges_.emplace_back(line_start, line_end, + line_end_excluding_whitespace, line_end_including_newline, hard_break); line_widths_.push_back(breaker_.getWidths()[i]); } @@ -462,13 +470,21 @@ void Paragraph::Layout(double width, bool force) { } } + // Exclude trailing whitespace from right-justified lines so the last + // visible character in the line will be flush with the right margin. + size_t line_end_index = + (paragraph_style_.effective_align() == TextAlign::right || + paragraph_style_.effective_align() == TextAlign::center) + ? line_range.end_excluding_whitespace + : line_range.end; + // Find the runs comprising this line. std::vector line_runs; for (const BidiRun& bidi_run : bidi_runs) { - if (bidi_run.start() < line_range.end && + if (bidi_run.start() < line_end_index && bidi_run.end() > line_range.start) { line_runs.emplace_back(std::max(bidi_run.start(), line_range.start), - std::min(bidi_run.end(), line_range.end), + std::min(bidi_run.end(), line_end_index), bidi_run.direction(), bidi_run.style()); } } @@ -687,7 +703,7 @@ void Paragraph::Layout(double width, bool force) { } // Adjust the glyph positions based on the alignment of the line. - double line_x_offset = GetLineXOffset(line_number, run_x_offset); + double line_x_offset = GetLineXOffset(run_x_offset); if (line_x_offset) { for (CodeUnitRun& code_unit_run : line_code_unit_runs) { for (GlyphPosition& position : code_unit_run.positions) { @@ -780,25 +796,16 @@ void Paragraph::Layout(double width, bool force) { }); } -double Paragraph::GetLineXOffset(size_t line_number, - double line_total_advance) { - if (line_number >= line_widths_.size() || isinf(width_)) +double Paragraph::GetLineXOffset(double line_total_advance) { + if (isinf(width_)) return 0; - TextAlign align = paragraph_style_.text_align; - TextDirection direction = paragraph_style_.text_direction; - - if (align == TextAlign::right || - (align == TextAlign::start && direction == TextDirection::rtl) || - (align == TextAlign::end && direction == TextDirection::ltr)) { - // If this line has a soft break, then use the line width calculated by the - // line breaker because that width excludes the soft break's whitespace. - double text_width = line_ranges_[line_number].hard_break - ? line_total_advance - : line_widths_[line_number]; - return width_ - text_width; - } else if (paragraph_style_.text_align == TextAlign::center) { - return (width_ - line_widths_[line_number]) / 2; + TextAlign align = paragraph_style_.effective_align(); + + if (align == TextAlign::right) { + return width_ - line_total_advance; + } else if (align == TextAlign::center) { + return (width_ - line_total_advance) / 2; } else { return 0; } diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index 25676cfed00ba..894439abc5965 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -187,9 +187,14 @@ class Paragraph { mutable std::unique_ptr word_breaker_; struct LineRange { - LineRange(size_t s, size_t e, size_t ewn, bool h) - : start(s), end(e), end_including_newline(ewn), hard_break(h) {} + LineRange(size_t s, size_t e, size_t eew, size_t ein, bool h) + : start(s), + end(e), + end_excluding_whitespace(eew), + end_including_newline(ein), + hard_break(h) {} size_t start, end; + size_t end_excluding_whitespace; size_t end_including_newline; bool hard_break; }; @@ -300,7 +305,7 @@ class Paragraph { // Calculate the starting X offset of a line based on the line's width and // alignment. - double GetLineXOffset(size_t line_number, double line_total_advance); + double GetLineXOffset(double line_total_advance); // Creates and draws the decorations onto the canvas. void PaintDecorations(SkCanvas* canvas, const PaintRecord& record); diff --git a/third_party/txt/src/txt/paragraph_style.cc b/third_party/txt/src/txt/paragraph_style.cc index 5c00409782cdc..fbb89cbfccdec 100644 --- a/third_party/txt/src/txt/paragraph_style.cc +++ b/third_party/txt/src/txt/paragraph_style.cc @@ -37,4 +37,16 @@ bool ParagraphStyle::ellipsized() const { return !ellipsis.empty(); } +TextAlign ParagraphStyle::effective_align() const { + if (text_align == TextAlign::start) { + return (text_direction == TextDirection::ltr) ? TextAlign::left + : TextAlign::right; + } else if (text_align == TextAlign::end) { + return (text_direction == TextDirection::ltr) ? TextAlign::right + : TextAlign::left; + } else { + return text_align; + } +} + } // namespace txt diff --git a/third_party/txt/src/txt/paragraph_style.h b/third_party/txt/src/txt/paragraph_style.h index 13d32106c1df3..3b04269d8eaee 100644 --- a/third_party/txt/src/txt/paragraph_style.h +++ b/third_party/txt/src/txt/paragraph_style.h @@ -66,6 +66,9 @@ class ParagraphStyle { bool unlimited_lines() const; bool ellipsized() const; + + // Return a text alignment value that is not dependent on the text direction. + TextAlign effective_align() const; }; } // namespace txt From 983b119d4117e10e9466b2bf544a17795b9b5c12 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Fri, 11 May 2018 12:43:53 -0700 Subject: [PATCH 0308/1190] Roll dart to 46ab040e589adc5200370dec7952ce5150850822 (#5235) --- DEPS | 8 ++++---- travis/licenses_golden/licenses_third_party | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/DEPS b/DEPS index a05c5f5da93d9..87d87cdf3e898 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'e6d7d67f4b35556805dd083fed15bf3ed41f7e33', + 'dart_revision': '46ab040e589adc5200370dec7952ce5150850822', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -59,7 +59,7 @@ vars = { 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.49', + 'dart_linter_tag': '0.1.50', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', @@ -74,8 +74,8 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '4947e0b3cb3ec77e4e8fe0d3141ce4dc60f43256', - 'dart_pub_semver_tag': '1.3.7', + 'dart_pub_rev': '0c172864be2d2043a9d630e07f6b4eae7472653f', + 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index aacfd10147a8e..68319b82979b9 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ff5efbc65d16e7ec00644d9deb2401d4 +Signature: 40e29d5714ab910ce1c72bc57de45dd1 UNUSED LICENSES: @@ -4309,7 +4309,6 @@ FILE: ../../../third_party/dart/runtime/vm/unibrow.h FILE: ../../../third_party/dart/runtime/vm/verified_memory_test.cc FILE: ../../../third_party/dart/runtime/vm/weak_code.cc FILE: ../../../third_party/dart/runtime/vm/weak_code.h -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_serialization.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart FILE: ../../../third_party/dart/sdk/lib/collection/set.dart @@ -6027,15 +6026,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h +FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h FILE: ../../../third_party/dart/runtime/vm/hash.h +FILE: ../../../third_party/dart/runtime/vm/interpreter.cc +FILE: ../../../third_party/dart/runtime/vm/interpreter.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h FILE: ../../../third_party/dart/sdk/lib/js/_js.dart From 87da608a950e9b7502d7079cdf3cfad5eccb5d43 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 11 May 2018 14:01:29 -0700 Subject: [PATCH 0309/1190] swap brightness definition on iOS to match android (#5239) --- .../darwin/ios/framework/Source/FlutterPlatformPlugin.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index e0a803905ccb6..eae9e51ffa941 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -140,9 +140,9 @@ - (void)setSystemChromeEnabledSystemUIOverlays:(NSArray*)overlays { - (void)setSystemChromeSystemUIOverlayStyle:(NSDictionary*)message { NSString* style = message[@"statusBarBrightness"]; UIStatusBarStyle statusBarStyle; - if ([style isEqualToString:@"Brightness.light"]) + if ([style isEqualToString:@"Brightness.dark"]) statusBarStyle = UIStatusBarStyleLightContent; - else if ([style isEqualToString:@"Brightness.dark"]) + else if ([style isEqualToString:@"Brightness.light"]) statusBarStyle = UIStatusBarStyleDefault; else return; From 75f0c42824dc53bb63f1d063ed67b754eceedfe8 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 11 May 2018 15:17:40 -0700 Subject: [PATCH 0310/1190] Add required reference to fonts/fidl (#5241) --- content_handler/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index c82083e4697da..cf15e77fdf25d 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -70,6 +70,7 @@ template("flutter_content_handler") { "//third_party/dart/runtime/bin:libdart_builtin", "//third_party/dart/runtime/platform:libdart_platform", "//garnet/public/lib/app/cpp", + "//garnet/public/lib/fonts/fidl", "//garnet/public/lib/fsl", "//garnet/public/lib/fxl", "//garnet/public/lib/icu_data/cpp", From bff0e0d59769fc532c87e8c5fa4369ef756e6fe9 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 11 May 2018 15:18:35 -0700 Subject: [PATCH 0311/1190] Allow Canvas.saveLayer without bounds (#5240) Fixes https://github.com/flutter/flutter/issues/17497 --- lib/ui/painting.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 50b49647b1e9f..f97b2d271be83 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2680,11 +2680,11 @@ class Canvas extends NativeFieldWrapperClass2 { /// * [BlendMode], which discusses the use of [Paint.blendMode] with /// [saveLayer]. void saveLayer(Rect bounds, Paint paint) { - assert(_rectIsValid(bounds)); assert(paint != null); if (bounds == null) { _saveLayerWithoutBounds(paint._objects, paint._data); } else { + assert(_rectIsValid(bounds)); _saveLayer(bounds.left, bounds.top, bounds.right, bounds.bottom, paint._objects, paint._data); } From 02383050332c22745bbde596319f6ef3c5f30b3c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 11 May 2018 18:23:55 -0400 Subject: [PATCH 0312/1190] Roll src/third_party/skia/ 811b944a8..3202ac4d2 (5 commits; 1 trivial rolls) (#5242) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 87d87cdf3e898..7484f7040e182 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '811b944a89602d4466ea273b565642639d2a95c0', + 'skia_revision': '3202ac4d24de417a69c2557a37e5e1b5f70667e0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 68319b82979b9..c64d232dd180e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 40e29d5714ab910ce1c72bc57de45dd1 +Signature: efa57f231574eb0f7ee7b6f36020949d UNUSED LICENSES: From b34ab18357c182d17ba063ba17e5306e7545c3a6 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 11 May 2018 17:05:22 -0700 Subject: [PATCH 0313/1190] =?UTF-8?q?Don=E2=80=99t=20terminate=20the=20run?= =?UTF-8?q?ner=20when=20it=20has=20no=20more=20applications.=20(#5243)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead, keep it around to service more requests. There may be a race between runner shutdown and request for new applications. --- content_handler/application_runner.cc | 19 ++----------------- content_handler/application_runner.h | 5 +---- content_handler/main.cc | 8 ++++---- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc index 9dfac48e31f90..7b7f89402e699 100644 --- a/content_handler/application_runner.cc +++ b/content_handler/application_runner.cc @@ -34,9 +34,8 @@ static void SetThreadName(const std::string& thread_name) { thread_name.size()); } -ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) - : on_termination_callback_(std::move(on_termination_callback)), - host_context_(component::ApplicationContext::CreateFromStartupInfo()) { +ApplicationRunner::ApplicationRunner() + : host_context_(component::ApplicationContext::CreateFromStartupInfo()) { SkGraphics::Init(); SetupICU(); @@ -50,9 +49,6 @@ ApplicationRunner::ApplicationRunner(fxl::Closure on_termination_callback) host_context_->outgoing_services()->AddService( std::bind(&ApplicationRunner::RegisterApplication, this, std::placeholders::_1)); - - active_applications_bindings_.set_empty_set_handler( - [this]() { FireTerminationCallbackIfNecessary(); }); } ApplicationRunner::~ApplicationRunner() { @@ -82,7 +78,6 @@ void ApplicationRunner::StartApplication( void ApplicationRunner::OnApplicationTerminate(const Application* application) { active_applications_.erase(application); - FireTerminationCallbackIfNecessary(); } void ApplicationRunner::SetupICU() { @@ -106,14 +101,4 @@ void ApplicationRunner::SetupGlobalFonts() { sk_make_sp(std::move(sync_font_provider))); } -void ApplicationRunner::FireTerminationCallbackIfNecessary() { - // We have no reason to exist if: - // 1: No previously launched applications are running. - // 2: No bindings exist that may require launching more applications. - if (on_termination_callback_ && active_applications_.size() == 0 && - active_applications_bindings_.size() == 0) { - on_termination_callback_(); - } -} - } // namespace flutter diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h index bae56b79dad39..c8d87b1be8293 100644 --- a/content_handler/application_runner.h +++ b/content_handler/application_runner.h @@ -23,7 +23,7 @@ namespace flutter { class ApplicationRunner final : public Application::Delegate, public component::ApplicationRunner { public: - ApplicationRunner(fxl::Closure on_termination_callback); + ApplicationRunner(); ~ApplicationRunner(); @@ -48,7 +48,6 @@ class ApplicationRunner final : public Application::Delegate, } }; - fxl::Closure on_termination_callback_; std::unique_ptr host_context_; fidl::BindingSet active_applications_bindings_; std::unordered_map @@ -72,8 +71,6 @@ class ApplicationRunner final : public Application::Delegate, void SetupGlobalFonts(); - void FireTerminationCallbackIfNecessary(); - FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationRunner); }; diff --git a/content_handler/main.cc b/content_handler/main.cc index b5fd671a3b35b..3cbea0047c759 100644 --- a/content_handler/main.cc +++ b/content_handler/main.cc @@ -15,12 +15,12 @@ int main(int argc, char const* argv[]) { FXL_DCHECK(provider.is_valid()) << "Trace provider must be valid."; FXL_DLOG(INFO) << "Flutter application services initialized."; - flutter::ApplicationRunner runner([&loop]() { - loop.PostQuitTask(); - FXL_DLOG(INFO) << "Flutter application services terminated. Good bye..."; - }); + + flutter::ApplicationRunner runner; loop.Run(); + FXL_DLOG(INFO) << "Flutter application services terminated."; + return EXIT_SUCCESS; } From 613abf2d8a7504effb3e3082785d3ffdd0aa6421 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 11 May 2018 18:32:35 -0700 Subject: [PATCH 0314/1190] Terminate the engine immediately if there are isolate launch errors. (#5244) --- content_handler/engine.cc | 23 +++++++++++++++++++---- shell/common/engine.cc | 5 +++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 9cc528b9ad164..369a006e57e73 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -204,12 +204,27 @@ Engine::Engine(Delegate& delegate, auto run_configuration = shell::RunConfiguration::InferFromSettings(settings_); + auto on_run_failure = [weak = weak_factory_.GetWeakPtr(), // + runner = + fsl::MessageLoop::GetCurrent()->task_runner() // + ]() { + // The engine could have been killed by the caller right after the + // constructor was called but before it could run on the UI thread. + if (weak) { + weak->Terminate(); + } + }; + shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = shell_->GetEngine(), // - run_configuration = std::move(run_configuration) // + fxl::MakeCopyable([engine = shell_->GetEngine(), // + run_configuration = std::move(run_configuration), // + on_run_failure // ]() mutable { - if (!engine || !engine->Run(std::move(run_configuration))) { - FXL_LOG(ERROR) << "Could not (re)launch the engine in configuration"; + if (!engine) { + return; + } + if (!engine->Run(std::move(run_configuration))) { + on_run_failure(); } })); } diff --git a/shell/common/engine.cc b/shell/common/engine.cc index fc1714c4f4715..4958e7445ef2f 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -109,6 +109,7 @@ bool Engine::Run(RunConfiguration configuration) { } if (!PrepareAndLaunchIsolate(std::move(configuration))) { + FXL_LOG(ERROR) << "Engine not prepare and launch isolate."; return false; } @@ -143,12 +144,12 @@ bool Engine::PrepareAndLaunchIsolate(RunConfiguration configuration) { auto isolate = runtime_controller_->GetRootIsolate(); if (!isolate_configuration->PrepareIsolate(isolate)) { - FXL_DLOG(ERROR) << "Could not prepare to run the isolate."; + FXL_LOG(ERROR) << "Could not prepare to run the isolate."; return false; } if (!isolate->Run(configuration.GetEntrypoint())) { - FXL_DLOG(ERROR) << "Could not run the isolate."; + FXL_LOG(ERROR) << "Could not run the isolate."; return false; } From 620d2fd91359736029fccff705ab48c3b5a0da6e Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 11 May 2018 18:45:20 -0700 Subject: [PATCH 0315/1190] Fix use-after-move while stashing the active applications in the runner. (#5245) --- content_handler/application_runner.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc index 7b7f89402e699..7603234a3631a 100644 --- a/content_handler/application_runner.cc +++ b/content_handler/application_runner.cc @@ -72,8 +72,9 @@ void ApplicationRunner::StartApplication( std::move(controller) // controller request ); - active_applications_[thread_application_pair.second.get()] = - std::move(thread_application_pair); + auto key = thread_application_pair.second.get(); + + active_applications_[key] = std::move(thread_application_pair); } void ApplicationRunner::OnApplicationTerminate(const Application* application) { From b14a33c4723f3a3d29f7ed3be6840e3d9489eaba Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 11 May 2018 19:26:39 -0700 Subject: [PATCH 0316/1190] Perform termination in response to session errors on the platform thread. (#5246) Follows the same pattern followed for termination in response to isolate shutdown. --- content_handler/engine.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 369a006e57e73..8310c34188517 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -77,7 +77,17 @@ Engine::Engine(Delegate& delegate, OnMetricsUpdate on_session_metrics_change_callback = std::bind( &Engine::OnSessionMetricsDidChange, this, std::placeholders::_1); - fxl::Closure on_session_error_callback = std::bind(&Engine::Terminate, this); + // Session errors may occur on the GPU thread, but we must terminate ourselves + // on the platform thread. + fxl::Closure on_session_error_callback = + [runner = fsl::MessageLoop::GetCurrent()->task_runner(), + weak = weak_factory_.GetWeakPtr()]() { + runner->PostTask([weak]() { + if (weak) { + weak->Terminate(); + } + }); + }; // Grab the accessibilty context writer that can understand the semtics tree // on the platform view. From 06afdfe54ebef9168a90ca00a6721c2d36e6aafa Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 11 May 2018 20:11:02 -0700 Subject: [PATCH 0317/1190] Ensure that application termination callbacks are serviced on the runner thread. (#5247) This removes the Application::Delegate interface and instead uses a closure that captures the task runner. The interface was expected to be more complicated than it turned out to be. --- content_handler/application.cc | 10 +++++----- content_handler/application.h | 11 ++++------- content_handler/application_runner.cc | 18 +++++++++++++++++- content_handler/application_runner.h | 6 ++---- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/content_handler/application.cc b/content_handler/application.cc index cb712cefe86b0..cab1b6ceed461 100644 --- a/content_handler/application.cc +++ b/content_handler/application.cc @@ -20,7 +20,7 @@ namespace flutter { std::pair, std::unique_ptr> Application::Create( - Application::Delegate& delegate, + TerminationCallback termination_callback, component::ApplicationPackage package, component::ApplicationStartupInfo startup_info, fidl::InterfaceRequest controller) { @@ -29,7 +29,7 @@ Application::Create( fxl::AutoResetWaitableEvent latch; thread->TaskRunner()->PostTask([&]() mutable { - application.reset(new Application(delegate, // + application.reset(new Application(termination_callback, // std::move(package), // std::move(startup_info), // std::move(controller) // @@ -51,12 +51,12 @@ static std::string DebugLabelForURL(const std::string& url) { } Application::Application( - Application::Delegate& delegate, + TerminationCallback termination_callback, component::ApplicationPackage, component::ApplicationStartupInfo startup_info, fidl::InterfaceRequest application_controller_request) - : delegate_(delegate), + : termination_callback_(termination_callback), debug_label_(DebugLabelForURL(startup_info.launch_info.url)), application_controller_(this) { application_controller_.set_error_handler([this]() { Kill(); }); @@ -234,7 +234,7 @@ void Application::Kill() { } wait_callbacks_.clear(); - delegate_.OnApplicationTerminate(this); + termination_callback_(this); // WARNING: Don't do anything past this point as this instance may have been // collected. } diff --git a/content_handler/application.h b/content_handler/application.h index c2df2ff4b8ae2..8c958ef8d2f4f 100644 --- a/content_handler/application.h +++ b/content_handler/application.h @@ -31,16 +31,13 @@ class Application final : public Engine::Delegate, public component::ApplicationController, public views_v1::ViewProvider { public: - class Delegate { - public: - virtual void OnApplicationTerminate(const Application* application) = 0; - }; + using TerminationCallback = std::function; // Creates a dedicated thread to run the application and constructions the // application on it. The application can be accessed only on this thread. // This is a synchronous operation. static std::pair, std::unique_ptr> - Create(Application::Delegate& delegate, + Create(TerminationCallback termination_callback, component::ApplicationPackage package, component::ApplicationStartupInfo startup_info, fidl::InterfaceRequest controller); @@ -53,7 +50,7 @@ class Application final : public Engine::Delegate, private: blink::Settings settings_; - Delegate& delegate_; + TerminationCallback termination_callback_; const std::string debug_label_; UniqueFDIONS fdio_ns_ = UniqueFDIONSCreate(); fxl::UniqueFD application_directory_; @@ -69,7 +66,7 @@ class Application final : public Engine::Delegate, std::pair last_return_code_; Application( - Application::Delegate& delegate, + TerminationCallback termination_callback, component::ApplicationPackage package, component::ApplicationStartupInfo startup_info, fidl::InterfaceRequest controller); diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc index 7603234a3631a..baa9d2411117d 100644 --- a/content_handler/application_runner.cc +++ b/content_handler/application_runner.cc @@ -65,8 +65,24 @@ void ApplicationRunner::StartApplication( component::ApplicationPackage package, component::ApplicationStartupInfo startup_info, fidl::InterfaceRequest controller) { + // Notes on application termination: Application typically terminate on the + // thread on which they were created. This usually means the thread was + // specifically created to host the application. But we want to ensure that + // access to the active applications collection is made on the same thread. So + // we capture the runner in the termination callback. There is no risk of + // there being multiple application runner instance in the process at the same + // time. So it is safe to use the raw pointer. + Application::TerminationCallback termination_callback = + [task_runner = fsl::MessageLoop::GetCurrent()->task_runner(), // + application_runner = this // + ](const Application* application) { + task_runner->PostTask([application_runner, application]() { + application_runner->OnApplicationTerminate(application); + }); + }; + auto thread_application_pair = - Application::Create(*this, // delegate + Application::Create(termination_callback, // termination callback std::move(package), // application pacakge std::move(startup_info), // startup info std::move(controller) // controller request diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h index c8d87b1be8293..b2e7f3abb5188 100644 --- a/content_handler/application_runner.h +++ b/content_handler/application_runner.h @@ -20,8 +20,7 @@ namespace flutter { // Publishes the |component::ApplicationRunner| service and runs applications on // their own threads. -class ApplicationRunner final : public Application::Delegate, - public component::ApplicationRunner { +class ApplicationRunner final : public component::ApplicationRunner { public: ApplicationRunner(); @@ -64,8 +63,7 @@ class ApplicationRunner final : public Application::Delegate, void UnregisterApplication(const Application* application); - // |Application::Delegate| - void OnApplicationTerminate(const Application* application) override; + void OnApplicationTerminate(const Application* application); void SetupICU(); From 5f57c59b3f873983515054d543166c3948c73163 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 12 May 2018 02:24:55 -0400 Subject: [PATCH 0318/1190] Roll src/third_party/skia/ 3202ac4d2..96b0b46f2 (1 commit) (#5248) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7484f7040e182..ac05728cdf6ef 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3202ac4d24de417a69c2557a37e5e1b5f70667e0', + 'skia_revision': '96b0b46f23347b191bbabb11d2cdb3a4d21c4d0e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c64d232dd180e..f0589d3085052 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: efa57f231574eb0f7ee7b6f36020949d +Signature: ff0b01c2e4664431c573200fd69dc65c UNUSED LICENSES: From fb89534256d12ac6e2ebbcc4894b363801fda0a1 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 12 May 2018 19:08:56 -0400 Subject: [PATCH 0319/1190] Roll src/third_party/skia/ 96b0b46f2..ec48812c5 (1 commit) (#5249) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ac05728cdf6ef..f207cf7a0c751 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '96b0b46f23347b191bbabb11d2cdb3a4d21c4d0e', + 'skia_revision': 'ec48812c5a5416595d97745715a6cd10ad60fc33', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f0589d3085052..b56ed4b623b23 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ff0b01c2e4664431c573200fd69dc65c +Signature: c9d5b995dd76036e5b04020776a16a05 UNUSED LICENSES: From 966ef68596dbe55bd8ba29284814324ee2270946 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 13 May 2018 14:31:55 -0400 Subject: [PATCH 0320/1190] Roll src/third_party/skia/ ec48812c5..b06a1eb4e (1 commit) (#5250) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f207cf7a0c751..f22b60b579939 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ec48812c5a5416595d97745715a6cd10ad60fc33', + 'skia_revision': 'b06a1eb4e5793b5053981cc76c72c497650c0e1a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b56ed4b623b23..4d1c390080cc6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c9d5b995dd76036e5b04020776a16a05 +Signature: bed39f0633519c49e6d47a682b0ab82b UNUSED LICENSES: From 4a5d8bcb115f5394ac7fad2106e0a6653cd4172c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 14 May 2018 08:28:55 -0400 Subject: [PATCH 0321/1190] Roll src/third_party/skia/ b06a1eb4e..5140f9a8e (1 commit) (#5251) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f22b60b579939..1827e21d11bc0 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b06a1eb4e5793b5053981cc76c72c497650c0e1a', + 'skia_revision': '5140f9a8e424985c4c354c40c41ca6b0a9b8772a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4d1c390080cc6..da3dd2f178e49 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: bed39f0633519c49e6d47a682b0ab82b +Signature: e93f8aa56f43ff691817885cae211691 UNUSED LICENSES: From cde501491d1cdc643c674bfc2a63955d694dbd0b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 14 May 2018 12:00:56 -0400 Subject: [PATCH 0322/1190] Roll src/third_party/skia/ 5140f9a8e..16ffdd4ed (4 commits) (#5252) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1827e21d11bc0..83628e39f37ff 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5140f9a8e424985c4c354c40c41ca6b0a9b8772a', + 'skia_revision': '16ffdd4edec1e037cc04a167d5a2b634619e588b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index da3dd2f178e49..d86be24852378 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e93f8aa56f43ff691817885cae211691 +Signature: 7354a556cdef656c5f40b39816f906ce UNUSED LICENSES: From f12b5a59101ebe938bd7b1012059bee08ac4e796 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 14 May 2018 15:30:56 -0400 Subject: [PATCH 0323/1190] Roll src/third_party/skia/ 16ffdd4ed..8803ebb47 (8 commits) (#5254) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 69 ++++++++++++--------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/DEPS b/DEPS index 83628e39f37ff..1d922c6fdeb68 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '16ffdd4edec1e037cc04a167d5a2b634619e588b', + 'skia_revision': '8803ebb470e73a5738cd09c48adbafec062229a8', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d86be24852378..0a71035cac7ab 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7354a556cdef656c5f40b39816f906ce +Signature: 5ba1aaf94c9edbeab46364b9439e342c UNUSED LICENSES: @@ -17502,6 +17502,43 @@ FILE: ../../../third_party/skia/infra/bots/isolate_gcloud_linux.isolate FILE: ../../../third_party/skia/infra/bots/isolate_go.isolate FILE: ../../../third_party/skia/infra/bots/jobs.json FILE: ../../../third_party/skia/infra/bots/perf_skia_bundled.isolate +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_API26.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Chromebook_GLES.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm64-Release-Android_ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Chromebook_GLES.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Coverage.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-MSAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_CPU_LIMIT_SSE41.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SafeStack.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Mini.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SwiftShader.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-arm-Release-Chromecast.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-loongson3a-Release.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Debug-EmbededResouces.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Shared.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Debug-GDI.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-MSVC-x86_64-Debug.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Test-Ubuntu14-Clang-GCE-CPU-AVX2-x86_64-Debug-All-CT_DM_10k_SKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json @@ -17514,36 +17551,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.exp FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/env/examples/full.expected/test.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_API26.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-arm-Release-Chromebook_GLES.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-arm64-Release-Android_ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Chromebook_GLES.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Mini.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SwiftShader.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-loongson3a-Release.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Debug-EmbededResouces.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Shared.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Debug-GDI.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Release.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android.json From f943345b45e9649393cd3efb42e213775185db24 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 14 May 2018 18:59:55 -0400 Subject: [PATCH 0324/1190] Roll src/third_party/skia/ 8803ebb47..3b9effcb1 (8 commits) (#5257) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1d922c6fdeb68..255566fc9d42e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8803ebb470e73a5738cd09c48adbafec062229a8', + 'skia_revision': '3b9effcb1d1a66d418438bc552c8eb618bdee10e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 0a71035cac7ab..cecbe4976135d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5ba1aaf94c9edbeab46364b9439e342c +Signature: c0aaa46ee35cf030a322a98529dc72e0 UNUSED LICENSES: From c3c6c369ae0745aed0c465f2b139f1d742ebaec6 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 14 May 2018 16:51:19 -0700 Subject: [PATCH 0325/1190] Create a session presentation backed Vsync waiter on Fuchsia. (#5255) --- content_handler/BUILD.gn | 2 + content_handler/application_runner.cc | 21 ++++++ content_handler/application_runner.h | 12 +--- content_handler/compositor_context.cc | 6 +- content_handler/compositor_context.h | 3 +- content_handler/engine.cc | 14 +++- content_handler/engine.h | 2 + content_handler/platform_view.cc | 13 +++- content_handler/platform_view.h | 7 +- content_handler/session_connection.cc | 38 +++++++++-- content_handler/session_connection.h | 8 ++- content_handler/vsync_waiter.cc | 87 +++++++++++++++++++++++++ content_handler/vsync_waiter.h | 41 ++++++++++++ shell/common/vsync_waiter_fallback.cc | 1 + shell/common/vsync_waiter_fallback.h | 1 + travis/licenses_golden/licenses_flutter | 2 + 16 files changed, 230 insertions(+), 28 deletions(-) create mode 100644 content_handler/vsync_waiter.cc create mode 100644 content_handler/vsync_waiter.h diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index cf15e77fdf25d..6eec0b2ed97cb 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -42,6 +42,8 @@ template("flutter_content_handler") { "task_observers.cc", "task_observers.h", "unique_fdio_ns.h", + "vsync_waiter.cc", + "vsync_waiter.h", "vulkan_surface.cc", "vulkan_surface.h", "vulkan_surface_pool.cc", diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc index baa9d2411117d..bc9e3ebc0a1ea 100644 --- a/content_handler/application_runner.cc +++ b/content_handler/application_runner.cc @@ -11,6 +11,7 @@ #include "flutter/lib/ui/text/font_collection.h" #include "fuchsia_font_manager.h" +#include "lib/fxl/functional/make_copyable.h" #include "lib/icu_data/cpp/icu_data.h" #include "third_party/flutter/runtime/dart_vm.h" #include "third_party/skia/include/core/SkGraphics.h" @@ -94,7 +95,27 @@ void ApplicationRunner::StartApplication( } void ApplicationRunner::OnApplicationTerminate(const Application* application) { + auto& active_application = active_applications_.at(application); + + // Grab the items out of the entry because we will have to rethread the + // destruction. + auto application_to_destroy = std::move(active_application.application); + auto application_destruction_thread = std::move(active_application.thread); + + // Delegate the entry. active_applications_.erase(application); + + // Post the task to destroy the application and quit its message loop. + auto runner = application_destruction_thread->TaskRunner(); + runner->PostTask(fxl::MakeCopyable( + [instance = std::move(application_to_destroy)]() mutable { + instance.reset(); + + fsl::MessageLoop::GetCurrent()->PostQuitTask(); + })); + + // This works because just posted the quit task on the hosted thread. + application_destruction_thread->Join(); } void ApplicationRunner::SetupICU() { diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h index b2e7f3abb5188..e83aca58ba9b3 100644 --- a/content_handler/application_runner.h +++ b/content_handler/application_runner.h @@ -13,7 +13,6 @@ #include "lib/app/cpp/application_context.h" #include "lib/fidl/cpp/binding_set.h" #include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/functional/make_copyable.h" #include "lib/fxl/macros.h" namespace flutter { @@ -35,16 +34,7 @@ class ApplicationRunner final : public component::ApplicationRunner { std::unique_ptr> pair) : thread(std::move(pair.first)), application(std::move(pair.second)) {} - ActiveApplication() { - if (thread && application) { - thread->TaskRunner()->PostTask( - fxl::MakeCopyable([application = std::move(application)]() mutable { - application.reset(); - fsl::MessageLoop::GetCurrent()->PostQuitTask(); - })); - thread.reset(); // join - } - } + ActiveApplication() = default; }; std::unique_ptr host_context_; diff --git a/content_handler/compositor_context.cc b/content_handler/compositor_context.cc index 904ef4fad247c..bac9ebb708691 100644 --- a/content_handler/compositor_context.cc +++ b/content_handler/compositor_context.cc @@ -60,13 +60,15 @@ CompositorContext::CompositorContext( std::string debug_label, zx::eventpair import_token, OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback) + fxl::Closure session_error_callback, + zx_handle_t vsync_event_handle) : debug_label_(std::move(debug_label)), session_connection_(std::move(scenic), debug_label_, std::move(import_token), std::move(session_metrics_did_change_callback), - std::move(session_error_callback)) {} + std::move(session_error_callback), + vsync_event_handle) {} CompositorContext::~CompositorContext() = default; diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h index 199c7a0139532..9a7b66e995bcc 100644 --- a/content_handler/compositor_context.h +++ b/content_handler/compositor_context.h @@ -20,7 +20,8 @@ class CompositorContext final : public flow::CompositorContext { std::string debug_label, zx::eventpair import_token, OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback); + fxl::Closure session_error_callback, + zx_handle_t vsync_event_handle); ~CompositorContext() override; diff --git a/content_handler/engine.cc b/content_handler/engine.cc index 8310c34188517..c47dc7d09f0ae 100644 --- a/content_handler/engine.cc +++ b/content_handler/engine.cc @@ -47,6 +47,11 @@ Engine::Engine(Delegate& delegate, thread_label_(std::move(thread_label)), settings_(std::move(settings)), weak_factory_(this) { + if (zx::event::create(0, &vsync_event_) != ZX_OK) { + FXL_DLOG(ERROR) << "Could not create the vsync event."; + return; + } + // Launch the threads that will be used to run the shell. These threads will // be joined in the destructor. for (auto& thread : host_threads_) { @@ -103,7 +108,8 @@ Engine::Engine(Delegate& delegate, thread_label_, // debug label std::move(import_token), // import token on_session_metrics_change_callback, // session metrics did change - on_session_error_callback // session did encounter error + on_session_error_callback, // session did encounter error + vsync_event_.get() // vsync event handle ); // Setup the callback that will instantiate the platform view. @@ -115,7 +121,8 @@ Engine::Engine(Delegate& delegate, view_owner = std::move(view_owner), // accessibility_context_writer = std::move(accessibility_context_writer), // - export_token = std::move(export_token) // + export_token = std::move(export_token), // + vsync_handle = vsync_event_.get() // ](shell::Shell& shell) mutable { return std::make_unique( @@ -127,7 +134,8 @@ Engine::Engine(Delegate& delegate, std::move(view_owner), // view owner std::move(export_token), // export token std::move( - accessibility_context_writer) // accessibility context writer + accessibility_context_writer), // accessibility context writer + vsync_handle // vsync handle ); }); diff --git a/content_handler/engine.h b/content_handler/engine.h index 679e88355735d..747246ff01a7c 100644 --- a/content_handler/engine.h +++ b/content_handler/engine.h @@ -6,6 +6,7 @@ #include #include +#include #include "flutter/shell/common/shell.h" #include "isolate_configurator.h" @@ -49,6 +50,7 @@ class Engine final : public mozart::NativesDelegate { std::array host_threads_; std::unique_ptr isolate_configurator_; std::unique_ptr shell_; + zx::event vsync_event_; fxl::WeakPtrFactory weak_factory_; void OnMainIsolateStart(); diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc index e62f9e44ac855..4d7428d8cc2ec 100644 --- a/content_handler/platform_view.cc +++ b/content_handler/platform_view.cc @@ -13,6 +13,7 @@ #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/stringbuffer.h" #include "third_party/rapidjson/rapidjson/writer.h" +#include "vsync_waiter.h" namespace flutter { @@ -36,7 +37,8 @@ PlatformView::PlatformView( fidl::InterfaceHandle view_manager_handle, fidl::InterfaceRequest view_owner, zx::eventpair export_token, - fidl::InterfaceHandle accessibility_context_writer) + fidl::InterfaceHandle accessibility_context_writer, + zx_handle_t vsync_event_handle) : shell::PlatformView(delegate, std::move(task_runners)), debug_label_(std::move(debug_label)), view_manager_(view_manager_handle.Bind()), @@ -44,7 +46,8 @@ PlatformView::PlatformView( input_listener_(this), ime_client_(this), accessibility_bridge_(std::move(accessibility_context_writer)), - surface_(std::make_unique(debug_label_)) { + surface_(std::make_unique(debug_label_)), + vsync_event_handle_(vsync_event_handle) { // Register all error handlers. SetInterfaceErrorHandler(view_manager_, "View Manager"); SetInterfaceErrorHandler(view_, "View"); @@ -395,6 +398,12 @@ bool PlatformView::OnHandleFocusEvent(const input::FocusEvent& focus) { return false; } +// |shell::PlatformView| +std::unique_ptr PlatformView::CreateVSyncWaiter() { + return std::make_unique( + debug_label_, vsync_event_handle_, task_runners_); +} + // |shell::PlatformView| std::unique_ptr PlatformView::CreateRenderingSurface() { // This platform does not repeatly lose and gain a surface connection. So the diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h index 50a6544878564..00c9ad0cf1d5f 100644 --- a/content_handler/platform_view.h +++ b/content_handler/platform_view.h @@ -37,7 +37,8 @@ class PlatformView final : public shell::PlatformView, fidl::InterfaceRequest view_owner, zx::eventpair export_token, fidl::InterfaceHandle - accessibility_context_writer); + accessibility_context_writer, + zx_handle_t vsync_event_handle); ~PlatformView(); @@ -72,6 +73,7 @@ class PlatformView final : public shell::PlatformView, std::function /* message */)> /* handler */> platform_message_handlers_; + zx_handle_t vsync_event_handle_ = 0; void RegisterPlatformMessageHandlers(); @@ -99,6 +101,9 @@ class PlatformView final : public shell::PlatformView, bool OnHandleFocusEvent(const input::FocusEvent& focus); + // |shell::PlatformView| + std::unique_ptr CreateVSyncWaiter() override; + // |shell::PlatformView| std::unique_ptr CreateRenderingSurface() override; diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc index ef43a2fd566c5..879b45a63b8a3 100644 --- a/content_handler/session_connection.cc +++ b/content_handler/session_connection.cc @@ -6,6 +6,7 @@ #include "lib/fidl/cpp/optional.h" #include "lib/ui/scenic/fidl_helpers.h" +#include "vsync_waiter.h" namespace flutter { @@ -14,22 +15,27 @@ SessionConnection::SessionConnection( std::string debug_label, zx::eventpair import_token, OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback) + fxl::Closure session_error_callback, + zx_handle_t vsync_event_handle) : debug_label_(std::move(debug_label)), scenic_(scenic_handle.Bind()), session_(scenic_.get()), root_node_(&session_), surface_producer_(std::make_unique(&session_)), scene_update_context_(&session_, surface_producer_.get()), - metrics_changed_callback_( - std::move(session_metrics_did_change_callback)) { + metrics_changed_callback_(std::move(session_metrics_did_change_callback)), + vsync_event_handle_(vsync_event_handle) { session_.set_error_handler(std::move(session_error_callback)); session_.set_event_handler(std::bind(&SessionConnection::OnSessionEvents, this, std::placeholders::_1)); root_node_.Bind(std::move(import_token)); root_node_.SetEventMask(gfx::kMetricsEventMask); - session_.Present(0, [](auto) {}); + + // Signal is initially high inidicating availability of the session. + ToggleSignal(vsync_event_handle_, true); + + PresentSession(); } SessionConnection::~SessionConnection() = default; @@ -66,9 +72,7 @@ void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { // Flush all session ops. Paint tasks have not yet executed but those are // fenced. The compositor can start processing ops while we finalize paint // tasks. - session_.Present(0, // presentation_time. (placeholder). - [](auto) {} // callback - ); + PresentSession(); // Execute paint tasks and signal fences. auto surfaces_to_submit = scene_update_context_.ExecutePaintTasks(frame); @@ -88,4 +92,24 @@ void SessionConnection::EnqueueClearOps() { session_.Enqueue(scenic_lib::NewDetachChildrenCommand(root_node_.id())); } +void SessionConnection::PresentSession() { + ToggleSignal(vsync_event_handle_, false); + session_.Present(0, // presentation_time. (placeholder). + [handle = vsync_event_handle_](auto) { + ToggleSignal(handle, true); + } // callback + ); +} + +void SessionConnection::ToggleSignal(zx_handle_t handle, bool set) { + const auto signal = flutter::VsyncWaiter::SessionPresentSignal; + auto status = zx_object_signal(handle, // handle + set ? 0 : signal, // clear mask + set ? signal : 0 // set mask + ); + if (status != ZX_OK) { + FXL_LOG(ERROR) << "Could not toggle vsync signal: " << set; + } +} + } // namespace flutter diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h index 43218820726e6..bc107e1d50095 100644 --- a/content_handler/session_connection.h +++ b/content_handler/session_connection.h @@ -27,7 +27,8 @@ class SessionConnection final { std::string debug_label, zx::eventpair import_token, OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback); + fxl::Closure session_error_callback, + zx_handle_t vsync_event_handle); ~SessionConnection(); @@ -53,11 +54,16 @@ class SessionConnection final { std::unique_ptr surface_producer_; flow::SceneUpdateContext scene_update_context_; OnMetricsUpdate metrics_changed_callback_; + zx_handle_t vsync_event_handle_; void OnSessionEvents(fidl::VectorPtr events); void EnqueueClearOps(); + void PresentSession(); + + static void ToggleSignal(zx_handle_t handle, bool raise); + FXL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); }; diff --git a/content_handler/vsync_waiter.cc b/content_handler/vsync_waiter.cc new file mode 100644 index 0000000000000..026a2b242263a --- /dev/null +++ b/content_handler/vsync_waiter.cc @@ -0,0 +1,87 @@ +// Copyright 2018 The Fuchsia 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 "third_party/flutter/content_handler/vsync_waiter.h" + +#include "lib/fsl/tasks/message_loop.h" + +namespace flutter { + +VsyncWaiter::VsyncWaiter(std::string debug_label, + zx_handle_t session_present_handle, + blink::TaskRunners task_runners) + : shell::VsyncWaiter(task_runners), + debug_label_(std::move(debug_label)), + session_wait_(session_present_handle, SessionPresentSignal), + phase_(fxl::TimePoint::Now()), + weak_factory_(this) { + auto wait_handler = [&](async_t* async, // + async::Wait* wait, // + zx_status_t status, // + const zx_packet_signal_t* signal // + ) { + if (status != ZX_OK) { + FXL_LOG(ERROR) << "Vsync wait failed."; + return; + } + + wait->Cancel(); + + FireCallbackNow(); + }; + + session_wait_.set_handler(wait_handler); +} + +VsyncWaiter::~VsyncWaiter() { + session_wait_.Cancel(); +} + +static constexpr fxl::TimeDelta kFrameInterval = + fxl::TimeDelta::FromSecondsF(1.0 / 60.0); + +static fxl::TimePoint SnapToNextPhase(fxl::TimePoint value, + fxl::TimePoint phase, + fxl::TimeDelta interval) { + fxl::TimeDelta offset = (phase - value) % interval; + if (offset != fxl::TimeDelta::Zero()) { + offset = offset + interval; + } + return value + offset; +} + +void VsyncWaiter::AwaitVSync() { + fxl::TimePoint now = fxl::TimePoint::Now(); + fxl::TimePoint next = SnapToNextPhase(now, phase_, kFrameInterval); + task_runners_.GetUITaskRunner()->PostDelayedTask( + [self = weak_factory_.GetWeakPtr()] { + if (self) { + self->FireCallbackWhenSessionAvailable(); + } + }, + next - now); +} + +void VsyncWaiter::FireCallbackWhenSessionAvailable() { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + if (session_wait_.Begin(fsl::MessageLoop::GetCurrent()->async()) != ZX_OK) { + FXL_LOG(ERROR) << "Could not begin wait for Vsync."; + } +} + +void VsyncWaiter::FireCallbackNow() { + FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); + + auto now = fxl::TimePoint::Now(); + + // We don't know the display refresh rate on this platform. Since the target + // time is advisory, assume kFrameInterval. + auto next = now + kFrameInterval; + + phase_ = now; + + FireCallback(now, next); +} + +} // namespace flutter diff --git a/content_handler/vsync_waiter.h b/content_handler/vsync_waiter.h new file mode 100644 index 0000000000000..31c0b46247cc8 --- /dev/null +++ b/content_handler/vsync_waiter.h @@ -0,0 +1,41 @@ +// Copyright 2018 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include + +#include "flutter/shell/common/vsync_waiter.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/weak_ptr.h" + +namespace flutter { + +class VsyncWaiter final : public shell::VsyncWaiter { + public: + static constexpr zx_signals_t SessionPresentSignal = ZX_EVENT_SIGNALED; + + VsyncWaiter(std::string debug_label, + zx_handle_t session_present_handle, + blink::TaskRunners task_runners); + + ~VsyncWaiter() override; + + private: + const std::string debug_label_; + async::Wait session_wait_; + fxl::TimePoint phase_; + fxl::WeakPtrFactory weak_factory_; + + // |shell::VsyncWaiter| + void AwaitVSync() override; + + void FireCallbackWhenSessionAvailable(); + + void FireCallbackNow(); + + FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiter); +}; + +} // namespace flutter diff --git a/shell/common/vsync_waiter_fallback.cc b/shell/common/vsync_waiter_fallback.cc index bcf061bb7615f..31744d59cefbf 100644 --- a/shell/common/vsync_waiter_fallback.cc +++ b/shell/common/vsync_waiter_fallback.cc @@ -29,6 +29,7 @@ VsyncWaiterFallback::~VsyncWaiterFallback() = default; constexpr fxl::TimeDelta interval = fxl::TimeDelta::FromSecondsF(1.0 / 60.0); +// |shell::VsyncWaiter| void VsyncWaiterFallback::AwaitVSync() { fxl::TimePoint now = fxl::TimePoint::Now(); fxl::TimePoint next = SnapToNextTick(now, phase_, interval); diff --git a/shell/common/vsync_waiter_fallback.h b/shell/common/vsync_waiter_fallback.h index d3cc8faaf6ce7..6fb47658d31ff 100644 --- a/shell/common/vsync_waiter_fallback.h +++ b/shell/common/vsync_waiter_fallback.h @@ -22,6 +22,7 @@ class VsyncWaiterFallback final : public VsyncWaiter { fxl::TimePoint phase_; fxl::WeakPtrFactory weak_factory_; + // |shell::VsyncWaiter| void AwaitVSync() override; FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiterFallback); diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 94046e5ab57ac..3f2e6bfdc6ccd 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -800,6 +800,8 @@ FILE: ../../../flutter/content_handler/surface.h FILE: ../../../flutter/content_handler/task_observers.cc FILE: ../../../flutter/content_handler/task_observers.h FILE: ../../../flutter/content_handler/unique_fdio_ns.h +FILE: ../../../flutter/content_handler/vsync_waiter.cc +FILE: ../../../flutter/content_handler/vsync_waiter.h ---------------------------------------------------------------------------------------------------- Copyright 2018 The Fuchsia Authors. All rights reserved. From 765b7d46b78fedbd94ed95c94b74e88c0a7fc758 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 14 May 2018 22:27:56 -0400 Subject: [PATCH 0326/1190] Roll src/third_party/skia/ 3b9effcb1..6bbd386a0 (2 commits) (#5260) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 74 ++++++++++----------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/DEPS b/DEPS index 255566fc9d42e..5f199b2486110 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3b9effcb1d1a66d418438bc552c8eb618bdee10e', + 'skia_revision': '6bbd386a0e4bf13cd7abb887900018a56e24091b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index cecbe4976135d..83a5d9596c195 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c0aaa46ee35cf030a322a98529dc72e0 +Signature: e05867b6324d57587681f83c31bd18b5 UNUSED LICENSES: @@ -17214,6 +17214,7 @@ FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h +FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h @@ -17248,7 +17249,6 @@ FILE: ../../../third_party/skia/src/gpu/GrContextThreadSafeProxyPriv.h FILE: ../../../third_party/skia/src/gpu/GrDDLContext.cpp FILE: ../../../third_party/skia/src/gpu/GrDirectContext.cpp FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.cpp -FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.h FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h @@ -20489,6 +20489,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/include/utils/SkEventTracer.h + ../../../third_party/skia/LICENSE @@ -20935,41 +20970,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkaroundsAutogen.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp + ../../../third_party/skia/LICENSE From fb303b9e64738edd0efb4905fb9186d52ccf8bcb Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 15 May 2018 10:58:55 -0400 Subject: [PATCH 0327/1190] Roll src/third_party/skia/ 6bbd386a0..81f60ecd9 (1 commit) (#5262) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5f199b2486110..e4911bd7d99ec 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6bbd386a0e4bf13cd7abb887900018a56e24091b', + 'skia_revision': '81f60ecd9cc0e7c507f9e1f05862bee6a19ee0c6', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 83a5d9596c195..f07711234b738 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e05867b6324d57587681f83c31bd18b5 +Signature: 0e1549658d10b744f756b80ec71d56dc UNUSED LICENSES: From be6c51735c5529b033c82292f3febcd75833ed22 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 15 May 2018 08:00:30 -0700 Subject: [PATCH 0328/1190] Fix documentation mistake in painting.dart (#5236) s/`[red]`/_correct color_. --- lib/ui/painting.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index f97b2d271be83..bef7068f44df9 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -109,8 +109,8 @@ class Color { /// * `a` is the alpha value, with 0 being transparent and 255 being fully /// opaque. /// * `r` is [red], from 0 to 255. - /// * `g` is [red], from 0 to 255. - /// * `b` is [red], from 0 to 255. + /// * `g` is [green], from 0 to 255. + /// * `b` is [blue], from 0 to 255. /// /// Out of range values are brought into range using modulo 255. /// @@ -125,8 +125,8 @@ class Color { /// Create a color from red, green, blue, and opacity, similar to `rgba()` in CSS. /// /// * `r` is [red], from 0 to 255. - /// * `g` is [red], from 0 to 255. - /// * `b` is [red], from 0 to 255. + /// * `g` is [green], from 0 to 255. + /// * `b` is [blue], from 0 to 255. /// * `opacity` is alpha channel of this color as a double, with 0.0 being /// transparent and 1.0 being fully opaque. /// From e463e80ef108f289ed0d64236cea7d0b6b2f03b6 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 15 May 2018 14:28:56 -0400 Subject: [PATCH 0329/1190] Roll src/third_party/skia/ 81f60ecd9..6e9f34f0e (7 commits) (#5264) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e4911bd7d99ec..ef49449d7ce40 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '81f60ecd9cc0e7c507f9e1f05862bee6a19ee0c6', + 'skia_revision': '6e9f34f0e08902417938cc7d9d0f76083ad6fff6', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f07711234b738..509171be66f77 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0e1549658d10b744f756b80ec71d56dc +Signature: 44f02abeabaaa6e17185a06c9aa6ac8e UNUSED LICENSES: From c7ab033f9e608fb55144739eb794e84a7281b5a7 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 15 May 2018 12:05:54 -0700 Subject: [PATCH 0330/1190] Support a model where the application creates a FlutterNativeView that is never destroyed (#5256) This allows applications to start a Flutter engine instance during app startup and keep it running throughout the app process' lifetime. FlutterActivity subclasses can override createFlutterNativeView to provide a preinitialized FlutterNativeView instance and override retainFlutterNativeView to signal that the FlutterNativeView should be kept alive when the activity is destroyed. --- .../io/flutter/app/FlutterActivity.java | 5 +++++ .../flutter/app/FlutterActivityDelegate.java | 19 +++++++++++++++---- .../flutter/app/FlutterFragmentActivity.java | 5 +++++ .../io/flutter/view/FlutterNativeView.java | 16 ++++++++++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/shell/platform/android/io/flutter/app/FlutterActivity.java b/shell/platform/android/io/flutter/app/FlutterActivity.java index 39886c0b06004..72e99cd15676e 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterActivity.java @@ -60,6 +60,11 @@ public FlutterNativeView createFlutterNativeView() { return null; } + @Override + public boolean retainFlutterNativeView() { + return false; + } + @Override public final boolean hasPlugin(String key) { return pluginRegistry.hasPlugin(key); diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index 8a41d8f4bfb62..601926ac0bccc 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -85,6 +85,13 @@ public final class FlutterActivityDelegate public interface ViewFactory { FlutterView createFlutterView(Context context); FlutterNativeView createFlutterNativeView(); + + /** + * Hook for subclasses to indicate that the {@code FlutterNativeView} + * returned by {@link #createFlutterNativeView()} should not be destroyed + * when this activity is destroyed. + */ + boolean retainFlutterNativeView(); } private final Activity activity; @@ -172,9 +179,11 @@ public void onCreate(Bundle savedInstanceState) { if (loadIntent(activity.getIntent(), reuseIsolate)) { return; } - String appBundlePath = FlutterMain.findAppBundlePath(activity.getApplicationContext()); - if (appBundlePath != null) { + if (!flutterView.getFlutterNativeView().isApplicationRunning()) { + String appBundlePath = FlutterMain.findAppBundlePath(activity.getApplicationContext()); + if (appBundlePath != null) { flutterView.runFromBundle(appBundlePath, null, "main", reuseIsolate); + } } } @@ -250,7 +259,7 @@ public void onDestroy() { if (flutterView != null) { final boolean detach = flutterView.getPluginRegistry().onViewDestroy(flutterView.getFlutterNativeView()); - if (detach) { + if (detach || viewFactory.retainFlutterNativeView()) { // Detach, but do not destroy the FlutterView if a plugin // expressed interest in its FlutterNativeView. flutterView.detach(); @@ -343,7 +352,9 @@ private boolean loadIntent(Intent intent, boolean reuseIsolate) { if (route != null) { flutterView.setInitialRoute(route); } - flutterView.runFromBundle(appBundlePath, intent.getStringExtra("snapshot"), "main", reuseIsolate); + if (!flutterView.getFlutterNativeView().isApplicationRunning()) { + flutterView.runFromBundle(appBundlePath, intent.getStringExtra("snapshot"), "main", reuseIsolate); + } return true; } diff --git a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java index 050c5cd23219a..f71bcaa53a0f7 100644 --- a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java @@ -64,6 +64,11 @@ public FlutterNativeView createFlutterNativeView() { return null; } + @Override + public boolean retainFlutterNativeView() { + return false; + } + @Override public final boolean hasPlugin(String key) { return pluginRegistry.hasPlugin(key); diff --git a/shell/platform/android/io/flutter/view/FlutterNativeView.java b/shell/platform/android/io/flutter/view/FlutterNativeView.java index 034a86d09d91f..b9908b5531ece 100644 --- a/shell/platform/android/io/flutter/view/FlutterNativeView.java +++ b/shell/platform/android/io/flutter/view/FlutterNativeView.java @@ -26,6 +26,7 @@ public class FlutterNativeView implements BinaryMessenger { private long mNativePlatformView; private FlutterView mFlutterView; private final Context mContext; + private boolean applicationIsRunning; public FlutterNativeView(Context context) { mContext = context; @@ -45,6 +46,7 @@ public void destroy() { mFlutterView = null; nativeDestroy(mNativePlatformView); mNativePlatformView = 0; + applicationIsRunning = false; } public FlutterPluginRegistry getPluginRegistry() { @@ -71,12 +73,26 @@ public void assertAttached() { public void runFromBundle(String bundlePath, String snapshotOverride, String entrypoint, boolean reuseRuntimeController) { assertAttached(); + if (applicationIsRunning) + throw new AssertionError("This Flutter engine instance is already running an application"); + nativeRunBundleAndSnapshot(mNativePlatformView, bundlePath, snapshotOverride, entrypoint, reuseRuntimeController, mContext.getResources().getAssets()); + + applicationIsRunning = true; } public void runFromSource(final String assetsDirectory, final String main, final String packages) { assertAttached(); + if (applicationIsRunning) + throw new AssertionError("This Flutter engine instance is already running an application"); + nativeRunBundleAndSource(mNativePlatformView, assetsDirectory, main, packages); + + applicationIsRunning = true; + } + + public boolean isApplicationRunning() { + return applicationIsRunning; } public void setAssetBundlePathOnUI(final String assetsDirectory) { From 73a0014b7edf80e40fd0d184fbed0be2cfda5849 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 15 May 2018 12:50:10 -0700 Subject: [PATCH 0331/1190] Create an empty group that the Fuchsia bots use to determine the root_out_dir. (#5265) The Fuchsia bots seem to reference this target to figure out the root_out_directory https://fuchsia.googlesource.com/build/+/master/dart/dart_test.gni#67. Note that the presence of the flutter_tester binary location itself is not depended on. Instead, the target is used to infer the directory containing the flutter_tester after a build. Patching the //build repository in Fuchsia would mean making the tree red till a //topaz patch lands. To avoid doing this, we add back the missing reference. --- shell/platform/linux/BUILD.gn | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 shell/platform/linux/BUILD.gn diff --git a/shell/platform/linux/BUILD.gn b/shell/platform/linux/BUILD.gn new file mode 100644 index 0000000000000..cf9f9736a1163 --- /dev/null +++ b/shell/platform/linux/BUILD.gn @@ -0,0 +1,6 @@ +# Copyright 2018 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. + +group("linux") { +} From 755dbeef4ac38f41e380f37ce17ffba2f7492c0a Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Tue, 15 May 2018 12:57:01 -0700 Subject: [PATCH 0332/1190] Roll Dart to a5c11d7d0329432ca37e35bb249b20f60aa0aa31. (#5259) Update engine for removal of Dart_ReadKernelBinary and refactored build targets. --- DEPS | 4 +- content_handler/BUILD.gn | 11 +- runtime/dart_isolate.cc | 24 +- runtime/dart_vm.cc | 20 +- runtime/dart_vm.h | 5 +- runtime/dart_vm_unittests.cc | 2 +- shell/common/BUILD.gn | 1 - shell/testing/BUILD.gn | 2 - travis/licenses_golden/licenses_third_party | 2 +- travis/licenses_golden/licenses_topaz | 500 ++++++++------------ 10 files changed, 238 insertions(+), 333 deletions(-) diff --git a/DEPS b/DEPS index ef49449d7ce40..0538c654508ae 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '46ab040e589adc5200370dec7952ce5150850822', + 'dart_revision': 'a5c11d7d0329432ca37e35bb249b20f60aa0aa31', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -126,7 +126,7 @@ deps = { Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67', 'src/topaz': - Var('fuchsia_git') + '/topaz' + '@' + 'e331f910c1003d154a4de6e1b5356f8d785fd6ec', + Var('fuchsia_git') + '/topaz' + '@' + '5fa651cf9cc5f338379e34964ff5dd70052f6237', 'src/third_party/benchmark': Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22', diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 6eec0b2ed97cb..3cdaa0dab219d 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -70,7 +70,6 @@ template("flutter_content_handler") { deps = [ "//third_party/dart/runtime/bin:libdart_builtin", - "//third_party/dart/runtime/platform:libdart_platform", "//garnet/public/lib/app/cpp", "//garnet/public/lib/fonts/fidl", "//garnet/public/lib/fsl", @@ -108,10 +107,16 @@ template("flutter_content_handler") { flutter_content_handler("aot") { output_name = "flutter_aot_runner" - extra_deps = [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] + extra_deps = [ + "//third_party/dart/runtime:libdart_precompiled_runtime", + "//third_party/dart/runtime/platform:libdart_platform_precompiled_runtime", + ] } flutter_content_handler("jit") { output_name = "flutter_jit_runner" - extra_deps = [ "//third_party/dart/runtime:libdart_jit" ] + extra_deps = [ + "//third_party/dart/runtime:libdart_jit", + "//third_party/dart/runtime/platform:libdart_platform_jit", + ] } diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 976e5d22a13f4..91c91f4905d56 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -541,10 +541,10 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( // thread. service_isolate->ResetWeakPtrFactory(); - const bool isolate_snapshot_is_dart_2 = - Dart_IsDart2Snapshot(vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); + const bool isolate_snapshot_is_dart_2 = Dart_IsDart2Snapshot( + vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); const bool is_preview_dart2 = - vm->GetPlatformKernel() != nullptr || isolate_snapshot_is_dart_2; + (vm->GetPlatformKernel().GetSize() > 0) || isolate_snapshot_is_dart_2; const bool running_from_sources = !DartVM::IsRunningPrecompiledCode() && !is_preview_dart2; @@ -648,14 +648,16 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( // Create the Dart VM isolate and give it the embedder object as the baton. Dart_Isolate isolate = - vm->GetPlatformKernel() != nullptr - ? Dart_CreateIsolateFromKernel(advisory_script_uri, // - advisory_script_entrypoint, // - vm->GetPlatformKernel(), // - flags, // - embedder_isolate.get(), // - error // - ) + (vm->GetPlatformKernel().GetSize() > 0) + ? Dart_CreateIsolateFromKernel( + advisory_script_uri, // + advisory_script_entrypoint, // + vm->GetPlatformKernel().GetMapping(), // + vm->GetPlatformKernel().GetSize(), // + flags, // + embedder_isolate.get(), // + error // + ) : Dart_CreateIsolate(advisory_script_uri, // advisory_script_entrypoint, // embedder_isolate->GetIsolateSnapshot() diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 378a642681189..eeb395257c411 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -278,18 +278,6 @@ DartVM::DartVM(const Settings& settings, FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid()) << "Isolate snapshot must be valid."; - if (platform_kernel_mapping_->GetSize() > 0) { - // The platform kernel mapping lifetime is managed by this instance of the - // DartVM and hence will exceed that of the PlatformKernel. So provide an - // empty release callback. - Dart_ReleaseBufferCallback empty = [](auto arg) {}; - platform_kernel_ = reinterpret_cast(Dart_ReadKernelBinary( - platform_kernel_mapping_->GetMapping(), // buffer - platform_kernel_mapping_->GetSize(), // buffer size - empty // buffer deleter - )); - } - { TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); dart::bin::BootstrapDartIo(); @@ -340,11 +328,11 @@ DartVM::DartVM(const Settings& settings, Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); const bool is_preview_dart2 = - platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; + (platform_kernel_mapping_->GetSize() > 0) || isolate_snapshot_is_dart_2; FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? "is" : "is NOT") << " enabled. Platform kernel: " - << static_cast(platform_kernel_) + << static_cast(platform_kernel_mapping_->GetSize() > 0) << " Isolate Snapshot is Dart 2: " << isolate_snapshot_is_dart_2; @@ -453,8 +441,8 @@ const Settings& DartVM::GetSettings() const { return settings_; } -DartVM::PlatformKernel* DartVM::GetPlatformKernel() const { - return platform_kernel_; +const fml::Mapping& DartVM::GetPlatformKernel() const { + return *platform_kernel_mapping_.get(); } const DartSnapshot& DartVM::GetVMSnapshot() const { diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h index e8feb9ba1de92..12ac1c6b21b08 100644 --- a/runtime/dart_vm.h +++ b/runtime/dart_vm.h @@ -25,8 +25,6 @@ namespace blink { class DartVM : public fxl::RefCountedThreadSafe { public: - class PlatformKernel; - static fxl::RefPtr ForProcess(Settings settings); static fxl::RefPtr ForProcess( @@ -40,7 +38,7 @@ class DartVM : public fxl::RefCountedThreadSafe { const Settings& GetSettings() const; - PlatformKernel* GetPlatformKernel() const; + const fml::Mapping& GetPlatformKernel() const; const DartSnapshot& GetVMSnapshot() const; @@ -55,7 +53,6 @@ class DartVM : public fxl::RefCountedThreadSafe { const fxl::RefPtr vm_snapshot_; const fxl::RefPtr isolate_snapshot_; std::unique_ptr platform_kernel_mapping_; - PlatformKernel* platform_kernel_ = nullptr; ServiceProtocol service_protocol_; fxl::WeakPtrFactory weak_factory_; diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc index 5b2f5e6ee8299..d0664d111181b 100644 --- a/runtime/dart_vm_unittests.cc +++ b/runtime/dart_vm_unittests.cc @@ -15,7 +15,7 @@ TEST(DartVM, SimpleInitialization) { ASSERT_TRUE(vm); ASSERT_EQ(vm, DartVM::ForProcess(settings)); ASSERT_FALSE(DartVM::IsRunningPrecompiledCode()); - ASSERT_EQ(vm->GetPlatformKernel(), nullptr); + ASSERT_EQ(vm->GetPlatformKernel().GetSize(), 0u); } } // namespace blink diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 5817d1616fc13..02e5f12b7d01e 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -103,7 +103,6 @@ source_set("common") { "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/platform:libdart_platform", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index 36bc9acc452ed..e0384da218570 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -21,8 +21,6 @@ executable("testing") { "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", - "//third_party/dart/runtime/bin:libdart_builtin", - "//third_party/dart/runtime/platform:libdart_platform", "//third_party/skia", "//topaz/lib/tonic", ] diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 509171be66f77..cf2a0e105ece5 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 44f02abeabaaa6e17185a06c9aa6ac8e +Signature: d07c068461636f8685c1a5d2cc38287c UNUSED LICENSES: diff --git a/travis/licenses_golden/licenses_topaz b/travis/licenses_golden/licenses_topaz index 042b7c10fadd3..23db62a06ba5f 100644 --- a/travis/licenses_golden/licenses_topaz +++ b/travis/licenses_golden/licenses_topaz @@ -1,4 +1,4 @@ -Signature: 597710f90d5b8794763d889b25f6036c +Signature: 752ea74efe31654aef9d549b7e32340c UNUSED LICENSES: @@ -10,8 +10,7 @@ USED LICENSES: LIBRARY: topaz ORIGIN: ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../topaz/public/lib/fidl/dart/lib/bindings.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/message.dart +FILE: ../../../topaz/public/lib/app_driver/dart/lib/src/service_client.dart ---------------------------------------------------------------------------------------------------- Copyright 2014 The Chromium Authors. All rights reserved. @@ -97,7 +96,6 @@ FILE: ../../../topaz/app/chat/modules/conversation_list/lib/widgets.dart FILE: ../../../topaz/app/chat/packages/chat_models/lib/src/user_model.dart FILE: ../../../topaz/app/chat/services/chat_content_provider.fidl FILE: ../../../topaz/app/chat/services/firebase_db_client.fidl -FILE: ../../../topaz/app/color/lib/src/parse_int.dart FILE: ../../../topaz/app/contacts/agents/content_provider/lib/main.dart FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/contacts_content_provider_impl.dart FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/contacts_watcher.dart @@ -107,8 +105,6 @@ FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/store/prefix_t FILE: ../../../topaz/app/contacts/agents/content_provider/lib/store.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/main.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/models/contact_card_model.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/modular/contact_card_module_model.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/modular/link_data.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_activity.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_card.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_details.dart @@ -118,36 +114,17 @@ FILE: ../../../topaz/app/contacts/modules/contact_list/lib/models.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/actions.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/contact_item.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/contact_list_model.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/modular/contact_list_module_model.dart +FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/service/contacts_service.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/widgets/contact_list.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/widgets/contact_list_item.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/fixtures.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/models.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models/contact.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models/entry_types.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models/fixtures.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/screens/contact_card_screen.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/screens/contact_list_screen.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/address_details_group.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_card.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_details_group.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_details_row.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_header.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_list_item.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/email_details_group.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/widgets.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/main.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/modular/contacts_picker_module_model.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/contact_item_store.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/contacts_picker_store.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/link_data.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/widgets/contact_item.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/widgets/contacts_picker.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/stores.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/widgets.dart -FILE: ../../../topaz/app/contacts/services/contacts_content_provider.fidl +FILE: ../../../topaz/app/contacts/services/fidl/contacts_content_provider.fidl FILE: ../../../topaz/app/dashboard/lib/build_status_model.dart FILE: ../../../topaz/app/dashboard/lib/build_status_widget.dart FILE: ../../../topaz/app/dashboard/lib/buildbucket/build_bucket_service.dart @@ -162,14 +139,12 @@ FILE: ../../../topaz/app/dashboard/lib/service/build_service.dart FILE: ../../../topaz/app/documents/agents/content_provider/lib/main.dart FILE: ../../../topaz/app/documents/agents/content_provider/lib/src/documents_content_provider_impl.dart FILE: ../../../topaz/app/documents/modules/browser/lib/main.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/modular/browser_module_model.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/browser.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/doc_list_item.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/image_viewer.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/selectable_item.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/thumbnail.dart FILE: ../../../topaz/app/documents/modules/info/lib/main.dart -FILE: ../../../topaz/app/documents/modules/info/lib/src/modular/info_module_model.dart FILE: ../../../topaz/app/documents/modules/info/lib/src/widgets/info.dart FILE: ../../../topaz/app/documents/packages/utils/lib/utils.dart FILE: ../../../topaz/app/documents/services/document.fidl @@ -194,102 +169,18 @@ FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/src/proposal_subscribers.da FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/index.html FILE: ../../../topaz/app/maxwell/agents/module_suggester_dart/main.dart FILE: ../../../topaz/app/maxwell/agents/usage_log/main.dart -FILE: ../../../topaz/app/maxwell/modules/resolution_failed/lib/src/module_data_module_model.dart -FILE: ../../../topaz/app/music/agents/concert_agent/lib/main.dart -FILE: ../../../topaz/app/music/agents/last_fm_agent/lib/main.dart -FILE: ../../../topaz/app/music/agents/music_artist_agent/lib/main.dart -FILE: ../../../topaz/app/music/agents/music_playback_agent/lib/main.dart -FILE: ../../../topaz/app/music/agents/music_playback_agent/lib/src/command_handler.dart -FILE: ../../../topaz/app/music/agents/music_playback_agent/lib/src/player_impl.dart -FILE: ../../../topaz/app/music/modules/concert_event/lib/main.dart -FILE: ../../../topaz/app/music/modules/concert_event/lib/modular/event_module_model.dart -FILE: ../../../topaz/app/music/modules/concert_event_list/lib/main.dart -FILE: ../../../topaz/app/music/modules/concert_event_list/lib/modular/event_list_module_model.dart -FILE: ../../../topaz/app/music/modules/concert_event_list/lib/modular/event_selector.dart -FILE: ../../../topaz/app/music/modules/concert_event_page/lib/main.dart -FILE: ../../../topaz/app/music/modules/concert_event_page/lib/modular/event_page_module_model.dart -FILE: ../../../topaz/app/music/modules/last_fm_artist_bio/lib/main.dart -FILE: ../../../topaz/app/music/modules/last_fm_artist_bio/lib/modular/artist_bio_module_model.dart -FILE: ../../../topaz/app/music/modules/last_fm_artist_bio/lib/modular/artist_bio_module_screen.dart -FILE: ../../../topaz/app/music/modules/music_album/lib/main.dart -FILE: ../../../topaz/app/music/modules/music_album/lib/modular/album_module_model.dart -FILE: ../../../topaz/app/music/modules/music_artist/lib/main.dart -FILE: ../../../topaz/app/music/modules/music_artist/lib/modular/artist_module_model.dart -FILE: ../../../topaz/app/music/modules/music_artist/lib/modular/artist_module_screen.dart -FILE: ../../../topaz/app/music/modules/music_playback/lib/main.dart -FILE: ../../../topaz/app/music/modules/music_playback/lib/modular/playback_module_model.dart -FILE: ../../../topaz/app/music/modules/music_playback/lib/modular/player_status_listener.dart -FILE: ../../../topaz/app/music/packages/concert_api/lib/api.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/concert_models.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/src/artist.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/src/event.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/src/fixtures.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/src/venue.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/concert_widgets.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/concert_guide_header.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_card.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_list.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_list_item.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_page.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/fallback_image.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/loading_status.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/pageable_event_list.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/typedefs.dart -FILE: ../../../topaz/app/music/packages/last_fm_api/lib/api.dart -FILE: ../../../topaz/app/music/packages/last_fm_models/lib/last_fm_models.dart -FILE: ../../../topaz/app/music/packages/last_fm_models/lib/src/artist.dart -FILE: ../../../topaz/app/music/packages/last_fm_models/lib/src/fixtures.dart -FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/last_fm_widgets.dart -FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/src/artist_bio.dart -FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/src/loading_status.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/music_models.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/album.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/artist.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/fixtures.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/music_image.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/track.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/album_screen.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/artist_grid.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/artist_screen.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/edge_to_edge_player.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/follow_button.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/hero_banner_scaffold.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/inline_album.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/loading_status.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/playback_slider.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/player.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/track_art.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/track_list_item.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/typedefs.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/utils.dart -FILE: ../../../topaz/app/music/services/player/player.fidl -FILE: ../../../topaz/app/music/services/player/repeat_mode.fidl -FILE: ../../../topaz/app/music/services/player/status.fidl -FILE: ../../../topaz/app/music/services/player/track.fidl FILE: ../../../topaz/app/perspective/lib/main.dart FILE: ../../../topaz/app/spinning_cube/lib/spinning_cube_gem.dart -FILE: ../../../topaz/app/todo/agents/content_provider/src/main.rs -FILE: ../../../topaz/app/todo/modules/story/lib/main.dart -FILE: ../../../topaz/app/todo/modules/story/lib/src/module_model.dart -FILE: ../../../topaz/app/todo/modules/story/lib/src/screen.dart -FILE: ../../../topaz/app/todo/services/todo.fidl FILE: ../../../topaz/app/video/modules/video/lib/main.dart FILE: ../../../topaz/app/video/modules/video/lib/src/modular/player_model.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/modular/video_module_model.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/asset.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/constants.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/device_chooser.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/device_target_icon.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/loading.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/play_controls.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/player.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/remote_control.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/screen.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/scrubber.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/standby.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_app.dart -FILE: ../../../topaz/app/xi/modules/xi-core/src/main.rs FILE: ../../../topaz/app/xi/modules/xi_app/lib/main.dart FILE: ../../../topaz/app/xi/modules/xi_app/lib/src/xi_fuchsia_client.dart FILE: ../../../topaz/app/xi/packages/widgets/lib/src/editor.dart @@ -299,7 +190,6 @@ FILE: ../../../topaz/app/xi/packages/widgets/lib/src/text_line.dart FILE: ../../../topaz/app/xi/packages/widgets/lib/src/xi_app.dart FILE: ../../../topaz/app/xi/packages/widgets/lib/widgets.dart FILE: ../../../topaz/app/xi/packages/xi_client/lib/client.dart -FILE: ../../../topaz/app/xi/services/xi.fidl FILE: ../../../topaz/app/xi/xi_flutter/lib/main.dart FILE: ../../../topaz/app/xi/xi_flutter/lib/src/xi_flutter_client.dart FILE: ../../../topaz/examples/bluetooth/ble_rect/lib/main.dart @@ -324,28 +214,6 @@ FILE: ../../../topaz/examples/ledger/todo_list/lib/src/widgets/new_item_input.da FILE: ../../../topaz/examples/media/media_player_flutter/lib/asset.dart FILE: ../../../topaz/examples/media/media_player_flutter/lib/config.dart FILE: ../../../topaz/examples/media/media_player_flutter/lib/main.dart -FILE: ../../../topaz/examples/modular/counter_flutter/child/lib/home.dart -FILE: ../../../topaz/examples/modular/counter_flutter/child/lib/main.dart -FILE: ../../../topaz/examples/modular/counter_flutter/child/lib/module_model.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_embed/lib/home.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_embed/lib/main.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_embed/lib/module_model.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_story_shell/lib/home.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_story_shell/lib/main.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_story_shell/lib/module_model.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/dummy_photo_storage.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/home.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/main.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/photo.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/photo_storage.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/photo_view.dart -FILE: ../../../topaz/examples/modular/story_shell_flutter/lib/main.dart -FILE: ../../../topaz/examples/modular/suggest_shell/controller/main.cc -FILE: ../../../topaz/examples/modular/suggest_shell/view/lib/main.dart -FILE: ../../../topaz/examples/modular/todo_story/lib/data.dart -FILE: ../../../topaz/examples/modular/todo_story/lib/generator.dart -FILE: ../../../topaz/examples/modular/todo_story/lib/main.dart -FILE: ../../../topaz/examples/modular/todo_story/lib/view.dart FILE: ../../../topaz/examples/oauth_token_manager/credentials.fbs FILE: ../../../topaz/examples/oauth_token_manager/oauth_token_manager.cc FILE: ../../../topaz/examples/ui/jank/main.cc @@ -381,7 +249,7 @@ FILE: ../../../topaz/public/dart/entity_schemas/lib/entities.dart FILE: ../../../topaz/public/dart/entity_schemas/lib/src/contact.dart FILE: ../../../topaz/public/dart/entity_schemas/lib/src/email.dart FILE: ../../../topaz/public/dart/entity_schemas/lib/src/phone_number.dart -FILE: ../../../topaz/public/dart/logging/lib/logging.dart +FILE: ../../../topaz/public/dart/logging/lib/src/logging.dart FILE: ../../../topaz/public/dart/widgets/lib/src/application/application_widget.dart FILE: ../../../topaz/public/dart/widgets/lib/src/model/embedder_model.dart FILE: ../../../topaz/public/dart/widgets/lib/src/model/idle_model.dart @@ -398,6 +266,7 @@ FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/simulated_positioned.da FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/text_placeholder.dart FILE: ../../../topaz/public/lib/agent/dart/lib/agent.dart FILE: ../../../topaz/public/lib/agent/dart/lib/src/agent_impl.dart +FILE: ../../../topaz/public/lib/app/dart/src/logging.dart FILE: ../../../topaz/public/lib/component/dart/lib/component.dart FILE: ../../../topaz/public/lib/component/dart/lib/src/message_receiver_impl.dart FILE: ../../../topaz/public/lib/context/dart/context_listener_impl.dart @@ -415,7 +284,12 @@ FILE: ../../../topaz/public/lib/media/flutter/media_player.dart FILE: ../../../topaz/public/lib/media/flutter/media_player_controller.dart FILE: ../../../topaz/public/lib/media/flutter/progress_notifier.dart FILE: ../../../topaz/public/lib/module/dart/lib/module.dart -FILE: ../../../topaz/public/lib/module_resolver/dart/daisy_builder.dart +FILE: ../../../topaz/public/lib/module_resolver/dart/intent_builder.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/parse_int.dart FILE: ../../../topaz/public/lib/story/dart/lib/story.dart FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.cc FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.h @@ -495,7 +369,6 @@ FILE: ../../../topaz/shell/armadillo_user_shell/lib/maxwell_hotword.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/maxwell_voice_model.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/power_manager_power_model.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/rate_limited_retry.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/story_importance_watcher_impl.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/user_logoutter.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/wallpaper_chooser.dart FILE: ../../../topaz/shell/capybara_user_shell/lib/launcher.dart @@ -532,20 +405,16 @@ FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_form.dart FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_frame.dart FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_stage.dart FILE: ../../../topaz/shell/mondrian_story_shell/lib/tree.dart +FILE: ../../../topaz/shell/timezone/lib/timezone_picker.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_context_impl.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_overlay.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_overlay_model.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/child_constraints_changer.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/circular_button.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/clock.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/constraints_model.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/debug_text.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/device_extender.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/device_extension_state.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/main.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/memory_indicator.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/netstack_model.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/rounded_corner_decoration.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/soft_keyboard_container_impl.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_list.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_picker_device_shell_model.dart @@ -555,8 +424,7 @@ FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_shell_chooser.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_watcher_impl.dart FILE: ../../../topaz/shell/wifi_settings/lib/main.dart FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/access_point.dart -FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/wifi_settings_module_model.dart -FILE: ../../../topaz/shell/wifi_settings/lib/src/wlan_info.dart +FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/wifi_settings_model.dart ---------------------------------------------------------------------------------------------------- Copyright 2017 The Fuchsia Authors. All rights reserved. @@ -626,6 +494,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: topaz ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd +FILE: ../../../topaz/MAINTAINERS FILE: ../../../topaz/app/chat/agents/content_provider/meta/sandbox FILE: ../../../topaz/app/chat/agents/firebase_db_client/meta/sandbox FILE: ../../../topaz/app/chat/modules/conversation/lib/main.dart @@ -635,16 +504,7 @@ FILE: ../../../topaz/app/chat/modules/conversation_list/lib/main.dart FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/models/user.dart FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/time_util.dart FILE: ../../../topaz/app/contacts/agents/content_provider/meta/sandbox -FILE: ../../../topaz/app/contacts/modules/contacts/android/AndroidManifest.xml -FILE: ../../../topaz/app/contacts/modules/contacts/lib/main.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/modular_main.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/app.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/contact_api.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/screens.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_details.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/phone_details_group.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/theme.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/type_defs.dart +FILE: ../../../topaz/app/contacts/modules/contact_card/manifest.json FILE: ../../../topaz/app/contacts/modules/contacts_picker/manifest.json FILE: ../../../topaz/app/dashboard/android/app/src/main/AndroidManifest.xml FILE: ../../../topaz/app/dashboard/android/app/src/main/java/com/yourcompany/dashboard/MainActivity.java @@ -654,6 +514,7 @@ FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xhdpi/ic_laun FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png FILE: ../../../topaz/app/dashboard/android/gradle.properties +FILE: ../../../topaz/app/dashboard/config/dashboard.config FILE: ../../../topaz/app/dashboard/ios/Flutter/Debug.xcconfig FILE: ../../../topaz/app/dashboard/ios/Flutter/Release.xcconfig FILE: ../../../topaz/app/dashboard/ios/Podfile @@ -691,6 +552,7 @@ FILE: ../../../topaz/app/dashboard/ios/Runner/Base.lproj/Main.storyboard FILE: ../../../topaz/app/dashboard/ios/Runner/Info.plist FILE: ../../../topaz/app/dashboard/ios/Runner/main.m FILE: ../../../topaz/app/dashboard/meta/sandbox +FILE: ../../../topaz/app/documents/modules/info/meta/manifest.json FILE: ../../../topaz/app/file_explorer/meta/sandbox FILE: ../../../topaz/app/image/manifest.json FILE: ../../../topaz/app/ledger/ledger_dashboard/dashboard.config @@ -699,18 +561,6 @@ FILE: ../../../topaz/app/ledger/ledger_dashboard/webroot/logo.png FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/dashboard.config FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/dashboard.js FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/logo.png -FILE: ../../../topaz/app/maxwell/modules/basic_text_reporter/lib/main.dart -FILE: ../../../topaz/app/maxwell/modules/resolution_failed/lib/main.dart -FILE: ../../../topaz/app/music/agents/last_fm_agent/meta/sandbox -FILE: ../../../topaz/app/music/agents/music_artist_agent/meta/sandbox -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/res/concert_bg.jpg -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/res/myseat.png -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/res/plat_logo.png -FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/res/background.jpg -FILE: ../../../topaz/app/music/packages/music_api/lib/api.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/music_widgets.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/res/music_wallpaper.jpg -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/home_page.dart FILE: ../../../topaz/app/perspective/lib/res/module-a-photos/1-sea-withtext.png FILE: ../../../topaz/app/perspective/lib/res/module-a-photos/2-pano-withtext.png FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/1.png @@ -737,12 +587,9 @@ FILE: ../../../topaz/app/term/term_params.cc FILE: ../../../topaz/app/term/term_params.h FILE: ../../../topaz/app/term/view_controller.cc FILE: ../../../topaz/app/term/view_controller.h -FILE: ../../../topaz/app/todo/agents/content_provider/Cargo.toml FILE: ../../../topaz/app/video/modules/video/assets/video-background.png FILE: ../../../topaz/app/video/modules/video/assets/video-thumbnail.png FILE: ../../../topaz/app/video/modules/video/manifest.json -FILE: ../../../topaz/app/xi/modules/xi-core/Cargo.lock -FILE: ../../../topaz/app/xi/modules/xi-core/Cargo.toml FILE: ../../../topaz/app/xi/xi_flutter/android/AndroidManifest.xml FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-hdpi/ic_launcher.png FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-mdpi/ic_launcher.png @@ -786,21 +633,19 @@ FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Base.lproj/Main.storyboard FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Info.plist FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/main.m FILE: ../../../topaz/app/xi/xi_flutter/xi_flutter.iml -FILE: ../../../topaz/examples/media/media_player/main.cc -FILE: ../../../topaz/examples/media/media_player/media_player_params.cc -FILE: ../../../topaz/examples/media/media_player/media_player_params.h -FILE: ../../../topaz/examples/media/media_player/media_player_view.cc -FILE: ../../../topaz/examples/media/media_player/media_player_view.h +FILE: ../../../topaz/examples/fidl/echo_server_dart/lib/main.dart FILE: ../../../topaz/examples/media/media_player_flutter/media_player_flutter.config FILE: ../../../topaz/examples/media/media_player_flutter/meta/sandbox +FILE: ../../../topaz/examples/media/media_player_skia/main.cc +FILE: ../../../topaz/examples/media/media_player_skia/media_player_params.cc +FILE: ../../../topaz/examples/media/media_player_skia/media_player_params.h +FILE: ../../../topaz/examples/media/media_player_skia/media_player_view.cc +FILE: ../../../topaz/examples/media/media_player_skia/media_player_view.h FILE: ../../../topaz/examples/media/vu_meter/main.cc FILE: ../../../topaz/examples/media/vu_meter/vu_meter_params.cc FILE: ../../../topaz/examples/media/vu_meter/vu_meter_params.h FILE: ../../../topaz/examples/media/vu_meter/vu_meter_view.cc FILE: ../../../topaz/examples/media/vu_meter/vu_meter_view.h -FILE: ../../../topaz/examples/modular/hello_world_flutter/lib/main.dart -FILE: ../../../topaz/examples/ui/basic_wm/main.dart -FILE: ../../../topaz/examples/ui/basic_wm/window_manager.dart FILE: ../../../topaz/examples/ui/hello_material/main.dart FILE: ../../../topaz/examples/ui/jank/jank_view.cc FILE: ../../../topaz/examples/ui/jank/jank_view.h @@ -841,54 +686,66 @@ FILE: ../../../topaz/manifest/minimal FILE: ../../../topaz/manifest/skia FILE: ../../../topaz/manifest/third_party FILE: ../../../topaz/manifest/topaz -FILE: ../../../topaz/packages/bluetooth_settings -FILE: ../../../topaz/packages/chat -FILE: ../../../topaz/packages/color -FILE: ../../../topaz/packages/config.json +FILE: ../../../topaz/manifest/topaz-unstable +FILE: ../../../topaz/packages/all +FILE: ../../../topaz/packages/config/dashboard FILE: ../../../topaz/packages/config/ermine_user_shell FILE: ../../../topaz/packages/config/term -FILE: ../../../topaz/packages/contacts -FILE: ../../../topaz/packages/curl -FILE: ../../../topaz/packages/dart -FILE: ../../../topaz/packages/dart_examples -FILE: ../../../topaz/packages/dart_runner -FILE: ../../../topaz/packages/dart_target_unittests -FILE: ../../../topaz/packages/dart_unittests -FILE: ../../../topaz/packages/dashboard FILE: ../../../topaz/packages/default -FILE: ../../../topaz/packages/doc_checker -FILE: ../../../topaz/packages/documents -FILE: ../../../topaz/packages/ermine_user_shell -FILE: ../../../topaz/packages/examples -FILE: ../../../topaz/packages/file_explorer -FILE: ../../../topaz/packages/flutter -FILE: ../../../topaz/packages/git -FILE: ../../../topaz/packages/google_auth_provider -FILE: ../../../topaz/packages/image -FILE: ../../../topaz/packages/infinite_scroller -FILE: ../../../topaz/packages/latin-ime -FILE: ../../../topaz/packages/ledger -FILE: ../../../topaz/packages/link_viewer -FILE: ../../../topaz/packages/lua -FILE: ../../../topaz/packages/maxwell -FILE: ../../../topaz/packages/mods -FILE: ../../../topaz/packages/modular_examples -FILE: ../../../topaz/packages/mondrian -FILE: ../../../topaz/packages/music -FILE: ../../../topaz/packages/oauth_token_manager -FILE: ../../../topaz/packages/perspective -FILE: ../../../topaz/packages/speccpu2000 -FILE: ../../../topaz/packages/spinning_cube -FILE: ../../../topaz/packages/sqlite -FILE: ../../../topaz/packages/sysui -FILE: ../../../topaz/packages/term -FILE: ../../../topaz/packages/todo -FILE: ../../../topaz/packages/tools -FILE: ../../../topaz/packages/ui_examples -FILE: ../../../topaz/packages/video -FILE: ../../../topaz/packages/web_view -FILE: ../../../topaz/packages/webkit -FILE: ../../../topaz/packages/xi +FILE: ../../../topaz/packages/dev +FILE: ../../../topaz/packages/examples/all +FILE: ../../../topaz/packages/examples/dart +FILE: ../../../topaz/packages/examples/fidl +FILE: ../../../topaz/packages/examples/misc +FILE: ../../../topaz/packages/examples/mondrian +FILE: ../../../topaz/packages/examples/spinning_cube +FILE: ../../../topaz/packages/examples/ui +FILE: ../../../topaz/packages/kitchen_sink +FILE: ../../../topaz/packages/prod/all +FILE: ../../../topaz/packages/prod/bluetooth_settings +FILE: ../../../topaz/packages/prod/color +FILE: ../../../topaz/packages/prod/contacts +FILE: ../../../topaz/packages/prod/curl +FILE: ../../../topaz/packages/prod/dart +FILE: ../../../topaz/packages/prod/dart_aot_product_runner +FILE: ../../../topaz/packages/prod/dart_aot_runner +FILE: ../../../topaz/packages/prod/dart_jit_product_runner +FILE: ../../../topaz/packages/prod/dart_jit_runner +FILE: ../../../topaz/packages/prod/dart_runner +FILE: ../../../topaz/packages/prod/dashboard +FILE: ../../../topaz/packages/prod/disabled/chat +FILE: ../../../topaz/packages/prod/documents +FILE: ../../../topaz/packages/prod/file_explorer +FILE: ../../../topaz/packages/prod/flutter +FILE: ../../../topaz/packages/prod/flutter_aot +FILE: ../../../topaz/packages/prod/flutter_jit +FILE: ../../../topaz/packages/prod/google_auth_provider +FILE: ../../../topaz/packages/prod/image +FILE: ../../../topaz/packages/prod/infinite_scroller +FILE: ../../../topaz/packages/prod/latin-ime +FILE: ../../../topaz/packages/prod/maxwell +FILE: ../../../topaz/packages/prod/mods +FILE: ../../../topaz/packages/prod/mondrian +FILE: ../../../topaz/packages/prod/oauth_token_manager +FILE: ../../../topaz/packages/prod/perspective +FILE: ../../../topaz/packages/prod/spotify_auth_provider +FILE: ../../../topaz/packages/prod/sqlite +FILE: ../../../topaz/packages/prod/sysui +FILE: ../../../topaz/packages/prod/term +FILE: ../../../topaz/packages/prod/video +FILE: ../../../topaz/packages/prod/web_view +FILE: ../../../topaz/packages/prod/webkit +FILE: ../../../topaz/packages/prod/xi +FILE: ../../../topaz/packages/products/dashboard +FILE: ../../../topaz/packages/products/term +FILE: ../../../topaz/packages/sdk/dart +FILE: ../../../topaz/packages/tools/all +FILE: ../../../topaz/packages/tools/dart +FILE: ../../../topaz/packages/tools/doc_checker +FILE: ../../../topaz/packages/tools/ermine_user_shell +FILE: ../../../topaz/packages/tools/ledger +FILE: ../../../topaz/packages/tools/link_viewer +FILE: ../../../topaz/packages/topaz FILE: ../../../topaz/public/dart-pkg/fuchsia/lib/fuchsia.dart FILE: ../../../topaz/public/dart-pkg/fuchsia/sdk_ext/fuchsia.cc FILE: ../../../topaz/public/dart-pkg/fuchsia/sdk_ext/fuchsia.h @@ -899,29 +756,26 @@ FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/handle_waiter.h FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/natives.cc FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/natives.h FILE: ../../../topaz/public/dart/config/lib/config.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/interface.dart FILE: ../../../topaz/public/dart/fixtures/lib/fixtures.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/fixtures.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/name.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/names.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/namespace.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/sequence.dart +FILE: ../../../topaz/public/dart/mozart/lib/src/fakes/mozart_fakes.dart FILE: ../../../topaz/public/dart/widgets/lib/src/model/model.dart FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/rk4_spring_simulation.dart FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/ticking_double_state.dart FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/ticking_state.dart FILE: ../../../topaz/public/lib/app/dart/app.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/_sdkext -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/codec.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/enum.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/interface.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/struct.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/union.dart FILE: ../../../topaz/public/lib/ui/flutter/_sdkext FILE: ../../../topaz/public/lib/ui/flutter/child_view.dart FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/mozart.dart +FILE: ../../../topaz/public/lib/widgets/dart/lib/src/model/model.dart +FILE: ../../../topaz/runtime/MAINTAINERS FILE: ../../../topaz/runtime/dart_runner/builtin_libraries.cc FILE: ../../../topaz/runtime/dart_runner/builtin_libraries.h -FILE: ../../../topaz/runtime/dart_runner/dart2 FILE: ../../../topaz/runtime/dart_runner/dart_application_controller.cc FILE: ../../../topaz/runtime/dart_runner/dart_application_controller.h FILE: ../../../topaz/runtime/dart_runner/dart_application_runner.cc @@ -937,17 +791,24 @@ FILE: ../../../topaz/runtime/dart_runner/examples/hello_app_dart/main.dart FILE: ../../../topaz/runtime/dart_runner/examples/hello_dart/bin/hello_dart.dart FILE: ../../../topaz/runtime/dart_runner/kernel/libraries.json FILE: ../../../topaz/runtime/dart_runner/main.cc -FILE: ../../../topaz/runtime/dart_runner/meta/aot2_runtime +FILE: ../../../topaz/runtime/dart_runner/meta/aot_product_runtime FILE: ../../../topaz/runtime/dart_runner/meta/aot_runtime -FILE: ../../../topaz/runtime/dart_runner/meta/jit2_runtime +FILE: ../../../topaz/runtime/dart_runner/meta/jit_product_runtime FILE: ../../../topaz/runtime/dart_runner/meta/jit_runtime FILE: ../../../topaz/runtime/dart_runner/meta/sandbox -FILE: ../../../topaz/runtime/dart_runner/snapshotter/main.cc +FILE: ../../../topaz/runtime/flutter_runner/kernel/libraries.json FILE: ../../../topaz/runtime/flutter_runner/meta/aot_runtime FILE: ../../../topaz/runtime/flutter_runner/meta/jit_runtime FILE: ../../../topaz/runtime/flutter_runner/meta/source_runtime FILE: ../../../topaz/runtime/web_runner/web_view_component.json -FILE: ../../../topaz/runtime/web_view/extract_schema_org.js +FILE: ../../../topaz/runtime/web_view/js/package.json +FILE: ../../../topaz/runtime/web_view/js/src/entity.ts +FILE: ../../../topaz/runtime/web_view/js/src/jsonld.ts +FILE: ../../../topaz/runtime/web_view/js/src/main.ts +FILE: ../../../topaz/runtime/web_view/js/src/microdata.ts +FILE: ../../../topaz/runtime/web_view/js/src/util.ts +FILE: ../../../topaz/runtime/web_view/js/tsconfig.json +FILE: ../../../topaz/runtime/web_view/js/webpack.config.js FILE: ../../../topaz/runtime/web_view/schema_org_context.cpp FILE: ../../../topaz/shell/Armadillo.png FILE: ../../../topaz/shell/agents/home_work_agent/assets/1-portugal-the-man.jpeg @@ -1095,6 +956,7 @@ FILE: ../../../topaz/shell/docs/profiling.patch FILE: ../../../topaz/shell/docs/profiling.png FILE: ../../../topaz/shell/docs/timeline_settings.png FILE: ../../../topaz/shell/docs/vm.png +FILE: ../../../topaz/shell/ermine_user_shell/assets/launch_ermine_only.json FILE: ../../../topaz/shell/ermine_user_shell/config/ermine_user_shell.config FILE: ../../../topaz/shell/keyboard/lib/keyboard.dart FILE: ../../../topaz/shell/keyboard/lib/keys.dart @@ -1104,27 +966,21 @@ FILE: ../../../topaz/shell/keyboard/lib/res/Delete.png FILE: ../../../topaz/shell/keyboard/lib/res/Icon_Input_En.png FILE: ../../../topaz/shell/keyboard/lib/res/Space.png FILE: ../../../topaz/shell/keyboard/lib/word_suggestion_service.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/ArmadilloSilhouette.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/BlackHole.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/CapybaraSilhouette.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/Fuchsia_Logo_40dp_Accent.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/bg.jpg -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/fuchsia.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/screen_config.json FILE: ../../../topaz/shell/userpicker_device_shell/meta/sandbox FILE: ../../../topaz/shell/widgets/lib/default_bundle.dart FILE: ../../../topaz/shell/widgets/lib/key_mappings.dart FILE: ../../../topaz/shell/widgets/lib/three_column_aligned_layout_delegate.dart FILE: ../../../topaz/shell/widgets/lib/time_stringer.dart -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_0_bar_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_lock_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_lock_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_lock_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_lock_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_0_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_lock_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_lock_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_lock_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_lock_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/meta/manifest.json ---------------------------------------------------------------------------------------------------- Copyright 2016 The Fuchsia Authors. All rights reserved. @@ -1169,16 +1025,21 @@ FILE: ../../../topaz/app/chat/modules/conversation_info/lib/widgets.dart FILE: ../../../topaz/app/chat/packages/chat_models/lib/chat_models.dart FILE: ../../../topaz/app/color/lib/main.dart FILE: ../../../topaz/app/color/lib/src/color_model.dart +FILE: ../../../topaz/app/contacts/services/lib/client.dart +FILE: ../../../topaz/app/contacts/services/lib/src/contacts_content_provider_service_client.dart +FILE: ../../../topaz/app/documents/modules/browser/lib/src/models/browser_model.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/header.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/multi_select_header.dart FILE: ../../../topaz/app/term/app.cc FILE: ../../../topaz/app/term/app.h FILE: ../../../topaz/app/term/pty_server.cc FILE: ../../../topaz/app/term/pty_server.h -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_progress.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/asset.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_progress_monitor.dart FILE: ../../../topaz/auth_providers/google/constants.h FILE: ../../../topaz/auth_providers/google/factory_impl.cc FILE: ../../../topaz/auth_providers/google/factory_impl.h +FILE: ../../../topaz/auth_providers/google/factory_impl_unittest.cc FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl.cc FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl.h FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl_unittest.cc @@ -1189,10 +1050,38 @@ FILE: ../../../topaz/auth_providers/oauth/oauth_request_builder_unittest.cc FILE: ../../../topaz/auth_providers/oauth/oauth_response.cc FILE: ../../../topaz/auth_providers/oauth/oauth_response.h FILE: ../../../topaz/auth_providers/oauth/oauth_response_unittest.cc +FILE: ../../../topaz/auth_providers/spotify/constants.h +FILE: ../../../topaz/auth_providers/spotify/factory_impl.cc +FILE: ../../../topaz/auth_providers/spotify/factory_impl.h +FILE: ../../../topaz/auth_providers/spotify/factory_impl_unittest.cc +FILE: ../../../topaz/auth_providers/spotify/main.cc +FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl.cc +FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl.h +FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl_unittest.cc +FILE: ../../../topaz/examples/fidl/echo_client_dart/lib/main.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/main.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/todo_module.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_item_widget.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_list_widget.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_widget.dart FILE: ../../../topaz/examples/mine_digger/main.dart +FILE: ../../../topaz/examples/ui/async_hello_mod/main.dart +FILE: ../../../topaz/examples/ui/hello_mod/main.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/codec.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/enum.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/error.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/message.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/struct.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/types.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/union.dart FILE: ../../../topaz/public/dart/fuchsia/lib/src/fuchsia_fakes.dart +FILE: ../../../topaz/public/dart/logging/lib/src/frame_rate_tracer.dart +FILE: ../../../topaz/public/dart/sledge/lib/sledge.dart +FILE: ../../../topaz/public/dart/widgets/lib/src/model/tracing_spring_model.dart FILE: ../../../topaz/public/dart/widgets/lib/src/modular/dank_user_shell_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/maybe.dart +FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/conditional_builder.dart +FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/future_widget.dart +FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/shadowed_text.dart FILE: ../../../topaz/public/dart/zircon/lib/src/channel.dart FILE: ../../../topaz/public/dart/zircon/lib/src/channel_reader.dart FILE: ../../../topaz/public/dart/zircon/lib/src/constants.dart @@ -1204,25 +1093,76 @@ FILE: ../../../topaz/public/dart/zircon/lib/src/handle_wrapper.dart FILE: ../../../topaz/public/dart/zircon/lib/src/socket.dart FILE: ../../../topaz/public/dart/zircon/lib/src/socket_reader.dart FILE: ../../../topaz/public/dart/zircon/lib/src/vmo.dart +FILE: ../../../topaz/public/lib/app/dart/src/frame_rate_tracer.dart +FILE: ../../../topaz/public/lib/app_driver/dart/lib/app_driver.dart FILE: ../../../topaz/public/lib/app_driver/dart/lib/module_driver.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/codec2.dart +FILE: ../../../topaz/public/lib/app_driver/dart/lib/src/module_driver.dart +FILE: ../../../topaz/public/lib/component/dart/lib/src/component_context_client.dart +FILE: ../../../topaz/public/lib/entity/dart/lib/src/entity_resolver_client.dart FILE: ../../../topaz/public/lib/lifecycle/dart/lib/lifecycle.dart FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_host.dart FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_impl.dart +FILE: ../../../topaz/public/lib/media/flutter/media_progress.dart +FILE: ../../../topaz/public/lib/mod/dart/lib/mod.dart +FILE: ../../../topaz/public/lib/mod/dart/lib/src/mod.dart FILE: ../../../topaz/public/lib/module/dart/lib/src/module_context_client.dart +FILE: ../../../topaz/public/lib/module/dart/lib/src/module_controller_client.dart FILE: ../../../topaz/public/lib/module/dart/lib/src/module_host.dart FILE: ../../../topaz/public/lib/module/dart/lib/src/module_impl.dart FILE: ../../../topaz/public/lib/proposal/dart/lib/proposal.dart FILE: ../../../topaz/public/lib/proposal/dart/lib/src/proposal_factory.dart +FILE: ../../../topaz/public/lib/run_mod/dart/lib/run_mod.dart +FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/run_mod.dart +FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/widgets/mod_failure_widget.dart +FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/widgets/mod_loading_widget.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.color.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.contact.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.documents.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.intent.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.location.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.status.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/codelab.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/finance/finance_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/lyrics/lyrics_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/recipe/recipe_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/captions/captions_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/media.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/google/youtube/video_id_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/string_list_entity_codec.dart FILE: ../../../topaz/public/lib/story/dart/lib/src/link_client.dart FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_host.dart FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_impl.dart FILE: ../../../topaz/public/lib/user/dart/lib/src/dank_user_shell_impl.dart +FILE: ../../../topaz/public/lib/widgets/dart/lib/src/model/value_model.dart FILE: ../../../topaz/runtime/dart_runner/kernel/compiler.dart FILE: ../../../topaz/runtime/dart_runner/mapped_resource.cc FILE: ../../../topaz/runtime/dart_runner/mapped_resource.h FILE: ../../../topaz/runtime/dart_runner/service_isolate.cc FILE: ../../../topaz/runtime/dart_runner/service_isolate.h +FILE: ../../../topaz/runtime/dart_runner/vmservice/empty.dart +FILE: ../../../topaz/runtime/web_view/js/dist/bundle.js FILE: ../../../topaz/shell/armadillo/lib/src/now/wifi_settings.dart FILE: ../../../topaz/shell/ermine_user_shell/app.cc FILE: ../../../topaz/shell/ermine_user_shell/app.h @@ -1232,6 +1172,13 @@ FILE: ../../../topaz/shell/ermine_user_shell/tile.cc FILE: ../../../topaz/shell/ermine_user_shell/tile.h FILE: ../../../topaz/shell/ermine_user_shell/view_controller.cc FILE: ../../../topaz/shell/ermine_user_shell/view_controller.h +FILE: ../../../topaz/shell/mondrian_story_shell/lib/container_layout.dart +FILE: ../../../topaz/shell/mondrian_story_shell/lib/inset_manager.dart +FILE: ../../../topaz/shell/mondrian_story_shell/lib/pattern_layout.dart +FILE: ../../../topaz/shell/mondrian_story_shell/lib/positioned_surface.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_setup.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_setup_model.dart +FILE: ../../../topaz/shell/wifi_settings/lib/src/wlan_manager.dart ---------------------------------------------------------------------------------------------------- Copyright 2018 The Fuchsia Authors. All rights reserved. @@ -1262,42 +1209,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/app/maxwell/modules/resolution_failed/lib/src/stores.dart + ../../../topaz/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/app/maxwell/modules/resolution_failed/lib/src/stores.dart ----------------------------------------------------------------------------------------------------- -Copyright 2017, the Flutter project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: topaz ORIGIN: ../../../topaz/examples/ui/lib/type_converters.cc + ../../../LICENSE @@ -1430,11 +1341,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: topaz -ORIGIN: ../../../topaz/public/dart/fuchsia/lib/fuchsia.dart + ../../../LICENSE +ORIGIN: ../../../topaz/public/dart/fidl/lib/fidl.dart + ../../../LICENSE TYPE: LicenseType.bsd +FILE: ../../../topaz/public/dart/fidl/lib/fidl.dart FILE: ../../../topaz/public/dart/fuchsia/lib/fuchsia.dart +FILE: ../../../topaz/public/dart/logging/lib/logging.dart +FILE: ../../../topaz/public/dart/mozart/lib/mozart.dart FILE: ../../../topaz/public/dart/zircon/lib/src/fakes/zircon_fakes.dart FILE: ../../../topaz/public/dart/zircon/lib/zircon.dart +FILE: ../../../topaz/public/lib/app/dart/logging.dart +FILE: ../../../topaz/public/lib/widgets/dart/lib/model.dart ---------------------------------------------------------------------------------------------------- Copyright 2018 The Chromium Authors. All rights reserved. @@ -1537,4 +1453,4 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -Total license count: 12 +Total license count: 11 From 63fdebf209a66ca73139dda0b2a99109680cffba Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Tue, 15 May 2018 13:26:51 -0700 Subject: [PATCH 0333/1190] Revert "Roll Dart to a5c11d7d0329432ca37e35bb249b20f60aa0aa31. (#5259)" (#5266) This reverts commit 755dbeef4ac38f41e380f37ce17ffba2f7492c0a. --- DEPS | 4 +- content_handler/BUILD.gn | 11 +- runtime/dart_isolate.cc | 24 +- runtime/dart_vm.cc | 20 +- runtime/dart_vm.h | 5 +- runtime/dart_vm_unittests.cc | 2 +- shell/common/BUILD.gn | 1 + shell/testing/BUILD.gn | 2 + travis/licenses_golden/licenses_third_party | 2 +- travis/licenses_golden/licenses_topaz | 500 ++++++++++++-------- 10 files changed, 333 insertions(+), 238 deletions(-) diff --git a/DEPS b/DEPS index 0538c654508ae..ef49449d7ce40 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'a5c11d7d0329432ca37e35bb249b20f60aa0aa31', + 'dart_revision': '46ab040e589adc5200370dec7952ce5150850822', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -126,7 +126,7 @@ deps = { Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67', 'src/topaz': - Var('fuchsia_git') + '/topaz' + '@' + '5fa651cf9cc5f338379e34964ff5dd70052f6237', + Var('fuchsia_git') + '/topaz' + '@' + 'e331f910c1003d154a4de6e1b5356f8d785fd6ec', 'src/third_party/benchmark': Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22', diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 3cdaa0dab219d..6eec0b2ed97cb 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -70,6 +70,7 @@ template("flutter_content_handler") { deps = [ "//third_party/dart/runtime/bin:libdart_builtin", + "//third_party/dart/runtime/platform:libdart_platform", "//garnet/public/lib/app/cpp", "//garnet/public/lib/fonts/fidl", "//garnet/public/lib/fsl", @@ -107,16 +108,10 @@ template("flutter_content_handler") { flutter_content_handler("aot") { output_name = "flutter_aot_runner" - extra_deps = [ - "//third_party/dart/runtime:libdart_precompiled_runtime", - "//third_party/dart/runtime/platform:libdart_platform_precompiled_runtime", - ] + extra_deps = [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] } flutter_content_handler("jit") { output_name = "flutter_jit_runner" - extra_deps = [ - "//third_party/dart/runtime:libdart_jit", - "//third_party/dart/runtime/platform:libdart_platform_jit", - ] + extra_deps = [ "//third_party/dart/runtime:libdart_jit" ] } diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 91c91f4905d56..976e5d22a13f4 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -541,10 +541,10 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( // thread. service_isolate->ResetWeakPtrFactory(); - const bool isolate_snapshot_is_dart_2 = Dart_IsDart2Snapshot( - vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); + const bool isolate_snapshot_is_dart_2 = + Dart_IsDart2Snapshot(vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); const bool is_preview_dart2 = - (vm->GetPlatformKernel().GetSize() > 0) || isolate_snapshot_is_dart_2; + vm->GetPlatformKernel() != nullptr || isolate_snapshot_is_dart_2; const bool running_from_sources = !DartVM::IsRunningPrecompiledCode() && !is_preview_dart2; @@ -648,16 +648,14 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( // Create the Dart VM isolate and give it the embedder object as the baton. Dart_Isolate isolate = - (vm->GetPlatformKernel().GetSize() > 0) - ? Dart_CreateIsolateFromKernel( - advisory_script_uri, // - advisory_script_entrypoint, // - vm->GetPlatformKernel().GetMapping(), // - vm->GetPlatformKernel().GetSize(), // - flags, // - embedder_isolate.get(), // - error // - ) + vm->GetPlatformKernel() != nullptr + ? Dart_CreateIsolateFromKernel(advisory_script_uri, // + advisory_script_entrypoint, // + vm->GetPlatformKernel(), // + flags, // + embedder_isolate.get(), // + error // + ) : Dart_CreateIsolate(advisory_script_uri, // advisory_script_entrypoint, // embedder_isolate->GetIsolateSnapshot() diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index eeb395257c411..378a642681189 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -278,6 +278,18 @@ DartVM::DartVM(const Settings& settings, FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid()) << "Isolate snapshot must be valid."; + if (platform_kernel_mapping_->GetSize() > 0) { + // The platform kernel mapping lifetime is managed by this instance of the + // DartVM and hence will exceed that of the PlatformKernel. So provide an + // empty release callback. + Dart_ReleaseBufferCallback empty = [](auto arg) {}; + platform_kernel_ = reinterpret_cast(Dart_ReadKernelBinary( + platform_kernel_mapping_->GetMapping(), // buffer + platform_kernel_mapping_->GetSize(), // buffer size + empty // buffer deleter + )); + } + { TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); dart::bin::BootstrapDartIo(); @@ -328,11 +340,11 @@ DartVM::DartVM(const Settings& settings, Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); const bool is_preview_dart2 = - (platform_kernel_mapping_->GetSize() > 0) || isolate_snapshot_is_dart_2; + platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? "is" : "is NOT") << " enabled. Platform kernel: " - << static_cast(platform_kernel_mapping_->GetSize() > 0) + << static_cast(platform_kernel_) << " Isolate Snapshot is Dart 2: " << isolate_snapshot_is_dart_2; @@ -441,8 +453,8 @@ const Settings& DartVM::GetSettings() const { return settings_; } -const fml::Mapping& DartVM::GetPlatformKernel() const { - return *platform_kernel_mapping_.get(); +DartVM::PlatformKernel* DartVM::GetPlatformKernel() const { + return platform_kernel_; } const DartSnapshot& DartVM::GetVMSnapshot() const { diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h index 12ac1c6b21b08..e8feb9ba1de92 100644 --- a/runtime/dart_vm.h +++ b/runtime/dart_vm.h @@ -25,6 +25,8 @@ namespace blink { class DartVM : public fxl::RefCountedThreadSafe { public: + class PlatformKernel; + static fxl::RefPtr ForProcess(Settings settings); static fxl::RefPtr ForProcess( @@ -38,7 +40,7 @@ class DartVM : public fxl::RefCountedThreadSafe { const Settings& GetSettings() const; - const fml::Mapping& GetPlatformKernel() const; + PlatformKernel* GetPlatformKernel() const; const DartSnapshot& GetVMSnapshot() const; @@ -53,6 +55,7 @@ class DartVM : public fxl::RefCountedThreadSafe { const fxl::RefPtr vm_snapshot_; const fxl::RefPtr isolate_snapshot_; std::unique_ptr platform_kernel_mapping_; + PlatformKernel* platform_kernel_ = nullptr; ServiceProtocol service_protocol_; fxl::WeakPtrFactory weak_factory_; diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc index d0664d111181b..5b2f5e6ee8299 100644 --- a/runtime/dart_vm_unittests.cc +++ b/runtime/dart_vm_unittests.cc @@ -15,7 +15,7 @@ TEST(DartVM, SimpleInitialization) { ASSERT_TRUE(vm); ASSERT_EQ(vm, DartVM::ForProcess(settings)); ASSERT_FALSE(DartVM::IsRunningPrecompiledCode()); - ASSERT_EQ(vm->GetPlatformKernel().GetSize(), 0u); + ASSERT_EQ(vm->GetPlatformKernel(), nullptr); } } // namespace blink diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 02e5f12b7d01e..5817d1616fc13 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -103,6 +103,7 @@ source_set("common") { "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", + "//third_party/dart/runtime/platform:libdart_platform", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index e0384da218570..36bc9acc452ed 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -21,6 +21,8 @@ executable("testing") { "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", + "//third_party/dart/runtime/bin:libdart_builtin", + "//third_party/dart/runtime/platform:libdart_platform", "//third_party/skia", "//topaz/lib/tonic", ] diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index cf2a0e105ece5..509171be66f77 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d07c068461636f8685c1a5d2cc38287c +Signature: 44f02abeabaaa6e17185a06c9aa6ac8e UNUSED LICENSES: diff --git a/travis/licenses_golden/licenses_topaz b/travis/licenses_golden/licenses_topaz index 23db62a06ba5f..042b7c10fadd3 100644 --- a/travis/licenses_golden/licenses_topaz +++ b/travis/licenses_golden/licenses_topaz @@ -1,4 +1,4 @@ -Signature: 752ea74efe31654aef9d549b7e32340c +Signature: 597710f90d5b8794763d889b25f6036c UNUSED LICENSES: @@ -10,7 +10,8 @@ USED LICENSES: LIBRARY: topaz ORIGIN: ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../topaz/public/lib/app_driver/dart/lib/src/service_client.dart +FILE: ../../../topaz/public/lib/fidl/dart/lib/bindings.dart +FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/message.dart ---------------------------------------------------------------------------------------------------- Copyright 2014 The Chromium Authors. All rights reserved. @@ -96,6 +97,7 @@ FILE: ../../../topaz/app/chat/modules/conversation_list/lib/widgets.dart FILE: ../../../topaz/app/chat/packages/chat_models/lib/src/user_model.dart FILE: ../../../topaz/app/chat/services/chat_content_provider.fidl FILE: ../../../topaz/app/chat/services/firebase_db_client.fidl +FILE: ../../../topaz/app/color/lib/src/parse_int.dart FILE: ../../../topaz/app/contacts/agents/content_provider/lib/main.dart FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/contacts_content_provider_impl.dart FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/contacts_watcher.dart @@ -105,6 +107,8 @@ FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/store/prefix_t FILE: ../../../topaz/app/contacts/agents/content_provider/lib/store.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/main.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/models/contact_card_model.dart +FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/modular/contact_card_module_model.dart +FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/modular/link_data.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_activity.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_card.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_details.dart @@ -114,17 +118,36 @@ FILE: ../../../topaz/app/contacts/modules/contact_list/lib/models.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/actions.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/contact_item.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/contact_list_model.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/service/contacts_service.dart +FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/modular/contact_list_module_model.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/widgets/contact_list.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/widgets/contact_list_item.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/fixtures.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/models.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models/contact.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models/entry_types.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models/fixtures.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/screens/contact_card_screen.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/screens/contact_list_screen.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/address_details_group.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_card.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_details_group.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_details_row.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_header.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_list_item.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/email_details_group.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/widgets.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/main.dart +FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/modular/contacts_picker_module_model.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/contact_item_store.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/contacts_picker_store.dart +FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/link_data.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/widgets/contact_item.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/widgets/contacts_picker.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/stores.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/widgets.dart -FILE: ../../../topaz/app/contacts/services/fidl/contacts_content_provider.fidl +FILE: ../../../topaz/app/contacts/services/contacts_content_provider.fidl FILE: ../../../topaz/app/dashboard/lib/build_status_model.dart FILE: ../../../topaz/app/dashboard/lib/build_status_widget.dart FILE: ../../../topaz/app/dashboard/lib/buildbucket/build_bucket_service.dart @@ -139,12 +162,14 @@ FILE: ../../../topaz/app/dashboard/lib/service/build_service.dart FILE: ../../../topaz/app/documents/agents/content_provider/lib/main.dart FILE: ../../../topaz/app/documents/agents/content_provider/lib/src/documents_content_provider_impl.dart FILE: ../../../topaz/app/documents/modules/browser/lib/main.dart +FILE: ../../../topaz/app/documents/modules/browser/lib/src/modular/browser_module_model.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/browser.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/doc_list_item.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/image_viewer.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/selectable_item.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/thumbnail.dart FILE: ../../../topaz/app/documents/modules/info/lib/main.dart +FILE: ../../../topaz/app/documents/modules/info/lib/src/modular/info_module_model.dart FILE: ../../../topaz/app/documents/modules/info/lib/src/widgets/info.dart FILE: ../../../topaz/app/documents/packages/utils/lib/utils.dart FILE: ../../../topaz/app/documents/services/document.fidl @@ -169,18 +194,102 @@ FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/src/proposal_subscribers.da FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/index.html FILE: ../../../topaz/app/maxwell/agents/module_suggester_dart/main.dart FILE: ../../../topaz/app/maxwell/agents/usage_log/main.dart +FILE: ../../../topaz/app/maxwell/modules/resolution_failed/lib/src/module_data_module_model.dart +FILE: ../../../topaz/app/music/agents/concert_agent/lib/main.dart +FILE: ../../../topaz/app/music/agents/last_fm_agent/lib/main.dart +FILE: ../../../topaz/app/music/agents/music_artist_agent/lib/main.dart +FILE: ../../../topaz/app/music/agents/music_playback_agent/lib/main.dart +FILE: ../../../topaz/app/music/agents/music_playback_agent/lib/src/command_handler.dart +FILE: ../../../topaz/app/music/agents/music_playback_agent/lib/src/player_impl.dart +FILE: ../../../topaz/app/music/modules/concert_event/lib/main.dart +FILE: ../../../topaz/app/music/modules/concert_event/lib/modular/event_module_model.dart +FILE: ../../../topaz/app/music/modules/concert_event_list/lib/main.dart +FILE: ../../../topaz/app/music/modules/concert_event_list/lib/modular/event_list_module_model.dart +FILE: ../../../topaz/app/music/modules/concert_event_list/lib/modular/event_selector.dart +FILE: ../../../topaz/app/music/modules/concert_event_page/lib/main.dart +FILE: ../../../topaz/app/music/modules/concert_event_page/lib/modular/event_page_module_model.dart +FILE: ../../../topaz/app/music/modules/last_fm_artist_bio/lib/main.dart +FILE: ../../../topaz/app/music/modules/last_fm_artist_bio/lib/modular/artist_bio_module_model.dart +FILE: ../../../topaz/app/music/modules/last_fm_artist_bio/lib/modular/artist_bio_module_screen.dart +FILE: ../../../topaz/app/music/modules/music_album/lib/main.dart +FILE: ../../../topaz/app/music/modules/music_album/lib/modular/album_module_model.dart +FILE: ../../../topaz/app/music/modules/music_artist/lib/main.dart +FILE: ../../../topaz/app/music/modules/music_artist/lib/modular/artist_module_model.dart +FILE: ../../../topaz/app/music/modules/music_artist/lib/modular/artist_module_screen.dart +FILE: ../../../topaz/app/music/modules/music_playback/lib/main.dart +FILE: ../../../topaz/app/music/modules/music_playback/lib/modular/playback_module_model.dart +FILE: ../../../topaz/app/music/modules/music_playback/lib/modular/player_status_listener.dart +FILE: ../../../topaz/app/music/packages/concert_api/lib/api.dart +FILE: ../../../topaz/app/music/packages/concert_models/lib/concert_models.dart +FILE: ../../../topaz/app/music/packages/concert_models/lib/src/artist.dart +FILE: ../../../topaz/app/music/packages/concert_models/lib/src/event.dart +FILE: ../../../topaz/app/music/packages/concert_models/lib/src/fixtures.dart +FILE: ../../../topaz/app/music/packages/concert_models/lib/src/venue.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/concert_widgets.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/concert_guide_header.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_card.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_list.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_list_item.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_page.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/fallback_image.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/loading_status.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/pageable_event_list.dart +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/typedefs.dart +FILE: ../../../topaz/app/music/packages/last_fm_api/lib/api.dart +FILE: ../../../topaz/app/music/packages/last_fm_models/lib/last_fm_models.dart +FILE: ../../../topaz/app/music/packages/last_fm_models/lib/src/artist.dart +FILE: ../../../topaz/app/music/packages/last_fm_models/lib/src/fixtures.dart +FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/last_fm_widgets.dart +FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/src/artist_bio.dart +FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/src/loading_status.dart +FILE: ../../../topaz/app/music/packages/music_models/lib/music_models.dart +FILE: ../../../topaz/app/music/packages/music_models/lib/src/album.dart +FILE: ../../../topaz/app/music/packages/music_models/lib/src/artist.dart +FILE: ../../../topaz/app/music/packages/music_models/lib/src/fixtures.dart +FILE: ../../../topaz/app/music/packages/music_models/lib/src/music_image.dart +FILE: ../../../topaz/app/music/packages/music_models/lib/src/track.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/album_screen.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/artist_grid.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/artist_screen.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/edge_to_edge_player.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/follow_button.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/hero_banner_scaffold.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/inline_album.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/loading_status.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/playback_slider.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/player.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/track_art.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/track_list_item.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/typedefs.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/utils.dart +FILE: ../../../topaz/app/music/services/player/player.fidl +FILE: ../../../topaz/app/music/services/player/repeat_mode.fidl +FILE: ../../../topaz/app/music/services/player/status.fidl +FILE: ../../../topaz/app/music/services/player/track.fidl FILE: ../../../topaz/app/perspective/lib/main.dart FILE: ../../../topaz/app/spinning_cube/lib/spinning_cube_gem.dart +FILE: ../../../topaz/app/todo/agents/content_provider/src/main.rs +FILE: ../../../topaz/app/todo/modules/story/lib/main.dart +FILE: ../../../topaz/app/todo/modules/story/lib/src/module_model.dart +FILE: ../../../topaz/app/todo/modules/story/lib/src/screen.dart +FILE: ../../../topaz/app/todo/services/todo.fidl FILE: ../../../topaz/app/video/modules/video/lib/main.dart FILE: ../../../topaz/app/video/modules/video/lib/src/modular/player_model.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/modular/video_module_model.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/asset.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/constants.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/device_chooser.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/device_target_icon.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/loading.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/play_controls.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/player.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/remote_control.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/screen.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/scrubber.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/standby.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_app.dart +FILE: ../../../topaz/app/xi/modules/xi-core/src/main.rs FILE: ../../../topaz/app/xi/modules/xi_app/lib/main.dart FILE: ../../../topaz/app/xi/modules/xi_app/lib/src/xi_fuchsia_client.dart FILE: ../../../topaz/app/xi/packages/widgets/lib/src/editor.dart @@ -190,6 +299,7 @@ FILE: ../../../topaz/app/xi/packages/widgets/lib/src/text_line.dart FILE: ../../../topaz/app/xi/packages/widgets/lib/src/xi_app.dart FILE: ../../../topaz/app/xi/packages/widgets/lib/widgets.dart FILE: ../../../topaz/app/xi/packages/xi_client/lib/client.dart +FILE: ../../../topaz/app/xi/services/xi.fidl FILE: ../../../topaz/app/xi/xi_flutter/lib/main.dart FILE: ../../../topaz/app/xi/xi_flutter/lib/src/xi_flutter_client.dart FILE: ../../../topaz/examples/bluetooth/ble_rect/lib/main.dart @@ -214,6 +324,28 @@ FILE: ../../../topaz/examples/ledger/todo_list/lib/src/widgets/new_item_input.da FILE: ../../../topaz/examples/media/media_player_flutter/lib/asset.dart FILE: ../../../topaz/examples/media/media_player_flutter/lib/config.dart FILE: ../../../topaz/examples/media/media_player_flutter/lib/main.dart +FILE: ../../../topaz/examples/modular/counter_flutter/child/lib/home.dart +FILE: ../../../topaz/examples/modular/counter_flutter/child/lib/main.dart +FILE: ../../../topaz/examples/modular/counter_flutter/child/lib/module_model.dart +FILE: ../../../topaz/examples/modular/counter_flutter/parent_embed/lib/home.dart +FILE: ../../../topaz/examples/modular/counter_flutter/parent_embed/lib/main.dart +FILE: ../../../topaz/examples/modular/counter_flutter/parent_embed/lib/module_model.dart +FILE: ../../../topaz/examples/modular/counter_flutter/parent_story_shell/lib/home.dart +FILE: ../../../topaz/examples/modular/counter_flutter/parent_story_shell/lib/main.dart +FILE: ../../../topaz/examples/modular/counter_flutter/parent_story_shell/lib/module_model.dart +FILE: ../../../topaz/examples/modular/photos_flutter/lib/dummy_photo_storage.dart +FILE: ../../../topaz/examples/modular/photos_flutter/lib/home.dart +FILE: ../../../topaz/examples/modular/photos_flutter/lib/main.dart +FILE: ../../../topaz/examples/modular/photos_flutter/lib/photo.dart +FILE: ../../../topaz/examples/modular/photos_flutter/lib/photo_storage.dart +FILE: ../../../topaz/examples/modular/photos_flutter/lib/photo_view.dart +FILE: ../../../topaz/examples/modular/story_shell_flutter/lib/main.dart +FILE: ../../../topaz/examples/modular/suggest_shell/controller/main.cc +FILE: ../../../topaz/examples/modular/suggest_shell/view/lib/main.dart +FILE: ../../../topaz/examples/modular/todo_story/lib/data.dart +FILE: ../../../topaz/examples/modular/todo_story/lib/generator.dart +FILE: ../../../topaz/examples/modular/todo_story/lib/main.dart +FILE: ../../../topaz/examples/modular/todo_story/lib/view.dart FILE: ../../../topaz/examples/oauth_token_manager/credentials.fbs FILE: ../../../topaz/examples/oauth_token_manager/oauth_token_manager.cc FILE: ../../../topaz/examples/ui/jank/main.cc @@ -249,7 +381,7 @@ FILE: ../../../topaz/public/dart/entity_schemas/lib/entities.dart FILE: ../../../topaz/public/dart/entity_schemas/lib/src/contact.dart FILE: ../../../topaz/public/dart/entity_schemas/lib/src/email.dart FILE: ../../../topaz/public/dart/entity_schemas/lib/src/phone_number.dart -FILE: ../../../topaz/public/dart/logging/lib/src/logging.dart +FILE: ../../../topaz/public/dart/logging/lib/logging.dart FILE: ../../../topaz/public/dart/widgets/lib/src/application/application_widget.dart FILE: ../../../topaz/public/dart/widgets/lib/src/model/embedder_model.dart FILE: ../../../topaz/public/dart/widgets/lib/src/model/idle_model.dart @@ -266,7 +398,6 @@ FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/simulated_positioned.da FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/text_placeholder.dart FILE: ../../../topaz/public/lib/agent/dart/lib/agent.dart FILE: ../../../topaz/public/lib/agent/dart/lib/src/agent_impl.dart -FILE: ../../../topaz/public/lib/app/dart/src/logging.dart FILE: ../../../topaz/public/lib/component/dart/lib/component.dart FILE: ../../../topaz/public/lib/component/dart/lib/src/message_receiver_impl.dart FILE: ../../../topaz/public/lib/context/dart/context_listener_impl.dart @@ -284,12 +415,7 @@ FILE: ../../../topaz/public/lib/media/flutter/media_player.dart FILE: ../../../topaz/public/lib/media/flutter/media_player_controller.dart FILE: ../../../topaz/public/lib/media/flutter/progress_notifier.dart FILE: ../../../topaz/public/lib/module/dart/lib/module.dart -FILE: ../../../topaz/public/lib/module_resolver/dart/intent_builder.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/parse_int.dart +FILE: ../../../topaz/public/lib/module_resolver/dart/daisy_builder.dart FILE: ../../../topaz/public/lib/story/dart/lib/story.dart FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.cc FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.h @@ -369,6 +495,7 @@ FILE: ../../../topaz/shell/armadillo_user_shell/lib/maxwell_hotword.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/maxwell_voice_model.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/power_manager_power_model.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/rate_limited_retry.dart +FILE: ../../../topaz/shell/armadillo_user_shell/lib/story_importance_watcher_impl.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/user_logoutter.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/wallpaper_chooser.dart FILE: ../../../topaz/shell/capybara_user_shell/lib/launcher.dart @@ -405,16 +532,20 @@ FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_form.dart FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_frame.dart FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_stage.dart FILE: ../../../topaz/shell/mondrian_story_shell/lib/tree.dart -FILE: ../../../topaz/shell/timezone/lib/timezone_picker.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_context_impl.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_overlay.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_overlay_model.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/child_constraints_changer.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/circular_button.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/clock.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/constraints_model.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/debug_text.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/device_extender.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/device_extension_state.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/main.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/memory_indicator.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/netstack_model.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/rounded_corner_decoration.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/soft_keyboard_container_impl.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_list.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_picker_device_shell_model.dart @@ -424,7 +555,8 @@ FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_shell_chooser.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_watcher_impl.dart FILE: ../../../topaz/shell/wifi_settings/lib/main.dart FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/access_point.dart -FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/wifi_settings_model.dart +FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/wifi_settings_module_model.dart +FILE: ../../../topaz/shell/wifi_settings/lib/src/wlan_info.dart ---------------------------------------------------------------------------------------------------- Copyright 2017 The Fuchsia Authors. All rights reserved. @@ -494,7 +626,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: topaz ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd -FILE: ../../../topaz/MAINTAINERS FILE: ../../../topaz/app/chat/agents/content_provider/meta/sandbox FILE: ../../../topaz/app/chat/agents/firebase_db_client/meta/sandbox FILE: ../../../topaz/app/chat/modules/conversation/lib/main.dart @@ -504,7 +635,16 @@ FILE: ../../../topaz/app/chat/modules/conversation_list/lib/main.dart FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/models/user.dart FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/time_util.dart FILE: ../../../topaz/app/contacts/agents/content_provider/meta/sandbox -FILE: ../../../topaz/app/contacts/modules/contact_card/manifest.json +FILE: ../../../topaz/app/contacts/modules/contacts/android/AndroidManifest.xml +FILE: ../../../topaz/app/contacts/modules/contacts/lib/main.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/modular_main.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/app.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/contact_api.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/screens.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_details.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/phone_details_group.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/theme.dart +FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/type_defs.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/manifest.json FILE: ../../../topaz/app/dashboard/android/app/src/main/AndroidManifest.xml FILE: ../../../topaz/app/dashboard/android/app/src/main/java/com/yourcompany/dashboard/MainActivity.java @@ -514,7 +654,6 @@ FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xhdpi/ic_laun FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png FILE: ../../../topaz/app/dashboard/android/gradle.properties -FILE: ../../../topaz/app/dashboard/config/dashboard.config FILE: ../../../topaz/app/dashboard/ios/Flutter/Debug.xcconfig FILE: ../../../topaz/app/dashboard/ios/Flutter/Release.xcconfig FILE: ../../../topaz/app/dashboard/ios/Podfile @@ -552,7 +691,6 @@ FILE: ../../../topaz/app/dashboard/ios/Runner/Base.lproj/Main.storyboard FILE: ../../../topaz/app/dashboard/ios/Runner/Info.plist FILE: ../../../topaz/app/dashboard/ios/Runner/main.m FILE: ../../../topaz/app/dashboard/meta/sandbox -FILE: ../../../topaz/app/documents/modules/info/meta/manifest.json FILE: ../../../topaz/app/file_explorer/meta/sandbox FILE: ../../../topaz/app/image/manifest.json FILE: ../../../topaz/app/ledger/ledger_dashboard/dashboard.config @@ -561,6 +699,18 @@ FILE: ../../../topaz/app/ledger/ledger_dashboard/webroot/logo.png FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/dashboard.config FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/dashboard.js FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/logo.png +FILE: ../../../topaz/app/maxwell/modules/basic_text_reporter/lib/main.dart +FILE: ../../../topaz/app/maxwell/modules/resolution_failed/lib/main.dart +FILE: ../../../topaz/app/music/agents/last_fm_agent/meta/sandbox +FILE: ../../../topaz/app/music/agents/music_artist_agent/meta/sandbox +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/res/concert_bg.jpg +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/res/myseat.png +FILE: ../../../topaz/app/music/packages/concert_widgets/lib/res/plat_logo.png +FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/res/background.jpg +FILE: ../../../topaz/app/music/packages/music_api/lib/api.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/music_widgets.dart +FILE: ../../../topaz/app/music/packages/music_widgets/lib/res/music_wallpaper.jpg +FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/home_page.dart FILE: ../../../topaz/app/perspective/lib/res/module-a-photos/1-sea-withtext.png FILE: ../../../topaz/app/perspective/lib/res/module-a-photos/2-pano-withtext.png FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/1.png @@ -587,9 +737,12 @@ FILE: ../../../topaz/app/term/term_params.cc FILE: ../../../topaz/app/term/term_params.h FILE: ../../../topaz/app/term/view_controller.cc FILE: ../../../topaz/app/term/view_controller.h +FILE: ../../../topaz/app/todo/agents/content_provider/Cargo.toml FILE: ../../../topaz/app/video/modules/video/assets/video-background.png FILE: ../../../topaz/app/video/modules/video/assets/video-thumbnail.png FILE: ../../../topaz/app/video/modules/video/manifest.json +FILE: ../../../topaz/app/xi/modules/xi-core/Cargo.lock +FILE: ../../../topaz/app/xi/modules/xi-core/Cargo.toml FILE: ../../../topaz/app/xi/xi_flutter/android/AndroidManifest.xml FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-hdpi/ic_launcher.png FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-mdpi/ic_launcher.png @@ -633,19 +786,21 @@ FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Base.lproj/Main.storyboard FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Info.plist FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/main.m FILE: ../../../topaz/app/xi/xi_flutter/xi_flutter.iml -FILE: ../../../topaz/examples/fidl/echo_server_dart/lib/main.dart +FILE: ../../../topaz/examples/media/media_player/main.cc +FILE: ../../../topaz/examples/media/media_player/media_player_params.cc +FILE: ../../../topaz/examples/media/media_player/media_player_params.h +FILE: ../../../topaz/examples/media/media_player/media_player_view.cc +FILE: ../../../topaz/examples/media/media_player/media_player_view.h FILE: ../../../topaz/examples/media/media_player_flutter/media_player_flutter.config FILE: ../../../topaz/examples/media/media_player_flutter/meta/sandbox -FILE: ../../../topaz/examples/media/media_player_skia/main.cc -FILE: ../../../topaz/examples/media/media_player_skia/media_player_params.cc -FILE: ../../../topaz/examples/media/media_player_skia/media_player_params.h -FILE: ../../../topaz/examples/media/media_player_skia/media_player_view.cc -FILE: ../../../topaz/examples/media/media_player_skia/media_player_view.h FILE: ../../../topaz/examples/media/vu_meter/main.cc FILE: ../../../topaz/examples/media/vu_meter/vu_meter_params.cc FILE: ../../../topaz/examples/media/vu_meter/vu_meter_params.h FILE: ../../../topaz/examples/media/vu_meter/vu_meter_view.cc FILE: ../../../topaz/examples/media/vu_meter/vu_meter_view.h +FILE: ../../../topaz/examples/modular/hello_world_flutter/lib/main.dart +FILE: ../../../topaz/examples/ui/basic_wm/main.dart +FILE: ../../../topaz/examples/ui/basic_wm/window_manager.dart FILE: ../../../topaz/examples/ui/hello_material/main.dart FILE: ../../../topaz/examples/ui/jank/jank_view.cc FILE: ../../../topaz/examples/ui/jank/jank_view.h @@ -686,66 +841,54 @@ FILE: ../../../topaz/manifest/minimal FILE: ../../../topaz/manifest/skia FILE: ../../../topaz/manifest/third_party FILE: ../../../topaz/manifest/topaz -FILE: ../../../topaz/manifest/topaz-unstable -FILE: ../../../topaz/packages/all -FILE: ../../../topaz/packages/config/dashboard +FILE: ../../../topaz/packages/bluetooth_settings +FILE: ../../../topaz/packages/chat +FILE: ../../../topaz/packages/color +FILE: ../../../topaz/packages/config.json FILE: ../../../topaz/packages/config/ermine_user_shell FILE: ../../../topaz/packages/config/term +FILE: ../../../topaz/packages/contacts +FILE: ../../../topaz/packages/curl +FILE: ../../../topaz/packages/dart +FILE: ../../../topaz/packages/dart_examples +FILE: ../../../topaz/packages/dart_runner +FILE: ../../../topaz/packages/dart_target_unittests +FILE: ../../../topaz/packages/dart_unittests +FILE: ../../../topaz/packages/dashboard FILE: ../../../topaz/packages/default -FILE: ../../../topaz/packages/dev -FILE: ../../../topaz/packages/examples/all -FILE: ../../../topaz/packages/examples/dart -FILE: ../../../topaz/packages/examples/fidl -FILE: ../../../topaz/packages/examples/misc -FILE: ../../../topaz/packages/examples/mondrian -FILE: ../../../topaz/packages/examples/spinning_cube -FILE: ../../../topaz/packages/examples/ui -FILE: ../../../topaz/packages/kitchen_sink -FILE: ../../../topaz/packages/prod/all -FILE: ../../../topaz/packages/prod/bluetooth_settings -FILE: ../../../topaz/packages/prod/color -FILE: ../../../topaz/packages/prod/contacts -FILE: ../../../topaz/packages/prod/curl -FILE: ../../../topaz/packages/prod/dart -FILE: ../../../topaz/packages/prod/dart_aot_product_runner -FILE: ../../../topaz/packages/prod/dart_aot_runner -FILE: ../../../topaz/packages/prod/dart_jit_product_runner -FILE: ../../../topaz/packages/prod/dart_jit_runner -FILE: ../../../topaz/packages/prod/dart_runner -FILE: ../../../topaz/packages/prod/dashboard -FILE: ../../../topaz/packages/prod/disabled/chat -FILE: ../../../topaz/packages/prod/documents -FILE: ../../../topaz/packages/prod/file_explorer -FILE: ../../../topaz/packages/prod/flutter -FILE: ../../../topaz/packages/prod/flutter_aot -FILE: ../../../topaz/packages/prod/flutter_jit -FILE: ../../../topaz/packages/prod/google_auth_provider -FILE: ../../../topaz/packages/prod/image -FILE: ../../../topaz/packages/prod/infinite_scroller -FILE: ../../../topaz/packages/prod/latin-ime -FILE: ../../../topaz/packages/prod/maxwell -FILE: ../../../topaz/packages/prod/mods -FILE: ../../../topaz/packages/prod/mondrian -FILE: ../../../topaz/packages/prod/oauth_token_manager -FILE: ../../../topaz/packages/prod/perspective -FILE: ../../../topaz/packages/prod/spotify_auth_provider -FILE: ../../../topaz/packages/prod/sqlite -FILE: ../../../topaz/packages/prod/sysui -FILE: ../../../topaz/packages/prod/term -FILE: ../../../topaz/packages/prod/video -FILE: ../../../topaz/packages/prod/web_view -FILE: ../../../topaz/packages/prod/webkit -FILE: ../../../topaz/packages/prod/xi -FILE: ../../../topaz/packages/products/dashboard -FILE: ../../../topaz/packages/products/term -FILE: ../../../topaz/packages/sdk/dart -FILE: ../../../topaz/packages/tools/all -FILE: ../../../topaz/packages/tools/dart -FILE: ../../../topaz/packages/tools/doc_checker -FILE: ../../../topaz/packages/tools/ermine_user_shell -FILE: ../../../topaz/packages/tools/ledger -FILE: ../../../topaz/packages/tools/link_viewer -FILE: ../../../topaz/packages/topaz +FILE: ../../../topaz/packages/doc_checker +FILE: ../../../topaz/packages/documents +FILE: ../../../topaz/packages/ermine_user_shell +FILE: ../../../topaz/packages/examples +FILE: ../../../topaz/packages/file_explorer +FILE: ../../../topaz/packages/flutter +FILE: ../../../topaz/packages/git +FILE: ../../../topaz/packages/google_auth_provider +FILE: ../../../topaz/packages/image +FILE: ../../../topaz/packages/infinite_scroller +FILE: ../../../topaz/packages/latin-ime +FILE: ../../../topaz/packages/ledger +FILE: ../../../topaz/packages/link_viewer +FILE: ../../../topaz/packages/lua +FILE: ../../../topaz/packages/maxwell +FILE: ../../../topaz/packages/mods +FILE: ../../../topaz/packages/modular_examples +FILE: ../../../topaz/packages/mondrian +FILE: ../../../topaz/packages/music +FILE: ../../../topaz/packages/oauth_token_manager +FILE: ../../../topaz/packages/perspective +FILE: ../../../topaz/packages/speccpu2000 +FILE: ../../../topaz/packages/spinning_cube +FILE: ../../../topaz/packages/sqlite +FILE: ../../../topaz/packages/sysui +FILE: ../../../topaz/packages/term +FILE: ../../../topaz/packages/todo +FILE: ../../../topaz/packages/tools +FILE: ../../../topaz/packages/ui_examples +FILE: ../../../topaz/packages/video +FILE: ../../../topaz/packages/web_view +FILE: ../../../topaz/packages/webkit +FILE: ../../../topaz/packages/xi FILE: ../../../topaz/public/dart-pkg/fuchsia/lib/fuchsia.dart FILE: ../../../topaz/public/dart-pkg/fuchsia/sdk_ext/fuchsia.cc FILE: ../../../topaz/public/dart-pkg/fuchsia/sdk_ext/fuchsia.h @@ -756,26 +899,29 @@ FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/handle_waiter.h FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/natives.cc FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/natives.h FILE: ../../../topaz/public/dart/config/lib/config.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/interface.dart FILE: ../../../topaz/public/dart/fixtures/lib/fixtures.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/fixtures.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/name.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/names.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/namespace.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/sequence.dart -FILE: ../../../topaz/public/dart/mozart/lib/src/fakes/mozart_fakes.dart FILE: ../../../topaz/public/dart/widgets/lib/src/model/model.dart FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/rk4_spring_simulation.dart FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/ticking_double_state.dart FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/ticking_state.dart FILE: ../../../topaz/public/lib/app/dart/app.dart +FILE: ../../../topaz/public/lib/fidl/dart/lib/_sdkext +FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/codec.dart +FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/enum.dart +FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/interface.dart +FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/struct.dart +FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/union.dart FILE: ../../../topaz/public/lib/ui/flutter/_sdkext FILE: ../../../topaz/public/lib/ui/flutter/child_view.dart FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/mozart.dart -FILE: ../../../topaz/public/lib/widgets/dart/lib/src/model/model.dart -FILE: ../../../topaz/runtime/MAINTAINERS FILE: ../../../topaz/runtime/dart_runner/builtin_libraries.cc FILE: ../../../topaz/runtime/dart_runner/builtin_libraries.h +FILE: ../../../topaz/runtime/dart_runner/dart2 FILE: ../../../topaz/runtime/dart_runner/dart_application_controller.cc FILE: ../../../topaz/runtime/dart_runner/dart_application_controller.h FILE: ../../../topaz/runtime/dart_runner/dart_application_runner.cc @@ -791,24 +937,17 @@ FILE: ../../../topaz/runtime/dart_runner/examples/hello_app_dart/main.dart FILE: ../../../topaz/runtime/dart_runner/examples/hello_dart/bin/hello_dart.dart FILE: ../../../topaz/runtime/dart_runner/kernel/libraries.json FILE: ../../../topaz/runtime/dart_runner/main.cc -FILE: ../../../topaz/runtime/dart_runner/meta/aot_product_runtime +FILE: ../../../topaz/runtime/dart_runner/meta/aot2_runtime FILE: ../../../topaz/runtime/dart_runner/meta/aot_runtime -FILE: ../../../topaz/runtime/dart_runner/meta/jit_product_runtime +FILE: ../../../topaz/runtime/dart_runner/meta/jit2_runtime FILE: ../../../topaz/runtime/dart_runner/meta/jit_runtime FILE: ../../../topaz/runtime/dart_runner/meta/sandbox -FILE: ../../../topaz/runtime/flutter_runner/kernel/libraries.json +FILE: ../../../topaz/runtime/dart_runner/snapshotter/main.cc FILE: ../../../topaz/runtime/flutter_runner/meta/aot_runtime FILE: ../../../topaz/runtime/flutter_runner/meta/jit_runtime FILE: ../../../topaz/runtime/flutter_runner/meta/source_runtime FILE: ../../../topaz/runtime/web_runner/web_view_component.json -FILE: ../../../topaz/runtime/web_view/js/package.json -FILE: ../../../topaz/runtime/web_view/js/src/entity.ts -FILE: ../../../topaz/runtime/web_view/js/src/jsonld.ts -FILE: ../../../topaz/runtime/web_view/js/src/main.ts -FILE: ../../../topaz/runtime/web_view/js/src/microdata.ts -FILE: ../../../topaz/runtime/web_view/js/src/util.ts -FILE: ../../../topaz/runtime/web_view/js/tsconfig.json -FILE: ../../../topaz/runtime/web_view/js/webpack.config.js +FILE: ../../../topaz/runtime/web_view/extract_schema_org.js FILE: ../../../topaz/runtime/web_view/schema_org_context.cpp FILE: ../../../topaz/shell/Armadillo.png FILE: ../../../topaz/shell/agents/home_work_agent/assets/1-portugal-the-man.jpeg @@ -956,7 +1095,6 @@ FILE: ../../../topaz/shell/docs/profiling.patch FILE: ../../../topaz/shell/docs/profiling.png FILE: ../../../topaz/shell/docs/timeline_settings.png FILE: ../../../topaz/shell/docs/vm.png -FILE: ../../../topaz/shell/ermine_user_shell/assets/launch_ermine_only.json FILE: ../../../topaz/shell/ermine_user_shell/config/ermine_user_shell.config FILE: ../../../topaz/shell/keyboard/lib/keyboard.dart FILE: ../../../topaz/shell/keyboard/lib/keys.dart @@ -966,21 +1104,27 @@ FILE: ../../../topaz/shell/keyboard/lib/res/Delete.png FILE: ../../../topaz/shell/keyboard/lib/res/Icon_Input_En.png FILE: ../../../topaz/shell/keyboard/lib/res/Space.png FILE: ../../../topaz/shell/keyboard/lib/word_suggestion_service.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/ArmadilloSilhouette.png +FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/BlackHole.png +FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/CapybaraSilhouette.png +FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/Fuchsia_Logo_40dp_Accent.png +FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/bg.jpg +FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/fuchsia.png +FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/screen_config.json FILE: ../../../topaz/shell/userpicker_device_shell/meta/sandbox FILE: ../../../topaz/shell/widgets/lib/default_bundle.dart FILE: ../../../topaz/shell/widgets/lib/key_mappings.dart FILE: ../../../topaz/shell/widgets/lib/three_column_aligned_layout_delegate.dart FILE: ../../../topaz/shell/widgets/lib/time_stringer.dart -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_0_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_lock_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_lock_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_lock_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_lock_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/meta/manifest.json +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_0_bar_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_lock_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_lock_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_lock_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_lock_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_white_48dp.png ---------------------------------------------------------------------------------------------------- Copyright 2016 The Fuchsia Authors. All rights reserved. @@ -1025,21 +1169,16 @@ FILE: ../../../topaz/app/chat/modules/conversation_info/lib/widgets.dart FILE: ../../../topaz/app/chat/packages/chat_models/lib/chat_models.dart FILE: ../../../topaz/app/color/lib/main.dart FILE: ../../../topaz/app/color/lib/src/color_model.dart -FILE: ../../../topaz/app/contacts/services/lib/client.dart -FILE: ../../../topaz/app/contacts/services/lib/src/contacts_content_provider_service_client.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/models/browser_model.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/header.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/multi_select_header.dart FILE: ../../../topaz/app/term/app.cc FILE: ../../../topaz/app/term/app.h FILE: ../../../topaz/app/term/pty_server.cc FILE: ../../../topaz/app/term/pty_server.h -FILE: ../../../topaz/app/video/modules/video/lib/src/asset.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_progress_monitor.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_progress.dart FILE: ../../../topaz/auth_providers/google/constants.h FILE: ../../../topaz/auth_providers/google/factory_impl.cc FILE: ../../../topaz/auth_providers/google/factory_impl.h -FILE: ../../../topaz/auth_providers/google/factory_impl_unittest.cc FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl.cc FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl.h FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl_unittest.cc @@ -1050,38 +1189,10 @@ FILE: ../../../topaz/auth_providers/oauth/oauth_request_builder_unittest.cc FILE: ../../../topaz/auth_providers/oauth/oauth_response.cc FILE: ../../../topaz/auth_providers/oauth/oauth_response.h FILE: ../../../topaz/auth_providers/oauth/oauth_response_unittest.cc -FILE: ../../../topaz/auth_providers/spotify/constants.h -FILE: ../../../topaz/auth_providers/spotify/factory_impl.cc -FILE: ../../../topaz/auth_providers/spotify/factory_impl.h -FILE: ../../../topaz/auth_providers/spotify/factory_impl_unittest.cc -FILE: ../../../topaz/auth_providers/spotify/main.cc -FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl.cc -FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl.h -FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl_unittest.cc -FILE: ../../../topaz/examples/fidl/echo_client_dart/lib/main.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/main.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/todo_module.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_item_widget.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_list_widget.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_widget.dart FILE: ../../../topaz/examples/mine_digger/main.dart -FILE: ../../../topaz/examples/ui/async_hello_mod/main.dart -FILE: ../../../topaz/examples/ui/hello_mod/main.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/codec.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/enum.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/error.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/message.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/struct.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/types.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/union.dart FILE: ../../../topaz/public/dart/fuchsia/lib/src/fuchsia_fakes.dart -FILE: ../../../topaz/public/dart/logging/lib/src/frame_rate_tracer.dart -FILE: ../../../topaz/public/dart/sledge/lib/sledge.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/model/tracing_spring_model.dart FILE: ../../../topaz/public/dart/widgets/lib/src/modular/dank_user_shell_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/conditional_builder.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/future_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/shadowed_text.dart +FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/maybe.dart FILE: ../../../topaz/public/dart/zircon/lib/src/channel.dart FILE: ../../../topaz/public/dart/zircon/lib/src/channel_reader.dart FILE: ../../../topaz/public/dart/zircon/lib/src/constants.dart @@ -1093,76 +1204,25 @@ FILE: ../../../topaz/public/dart/zircon/lib/src/handle_wrapper.dart FILE: ../../../topaz/public/dart/zircon/lib/src/socket.dart FILE: ../../../topaz/public/dart/zircon/lib/src/socket_reader.dart FILE: ../../../topaz/public/dart/zircon/lib/src/vmo.dart -FILE: ../../../topaz/public/lib/app/dart/src/frame_rate_tracer.dart -FILE: ../../../topaz/public/lib/app_driver/dart/lib/app_driver.dart FILE: ../../../topaz/public/lib/app_driver/dart/lib/module_driver.dart -FILE: ../../../topaz/public/lib/app_driver/dart/lib/src/module_driver.dart -FILE: ../../../topaz/public/lib/component/dart/lib/src/component_context_client.dart -FILE: ../../../topaz/public/lib/entity/dart/lib/src/entity_resolver_client.dart +FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/codec2.dart FILE: ../../../topaz/public/lib/lifecycle/dart/lib/lifecycle.dart FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_host.dart FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_impl.dart -FILE: ../../../topaz/public/lib/media/flutter/media_progress.dart -FILE: ../../../topaz/public/lib/mod/dart/lib/mod.dart -FILE: ../../../topaz/public/lib/mod/dart/lib/src/mod.dart FILE: ../../../topaz/public/lib/module/dart/lib/src/module_context_client.dart -FILE: ../../../topaz/public/lib/module/dart/lib/src/module_controller_client.dart FILE: ../../../topaz/public/lib/module/dart/lib/src/module_host.dart FILE: ../../../topaz/public/lib/module/dart/lib/src/module_impl.dart FILE: ../../../topaz/public/lib/proposal/dart/lib/proposal.dart FILE: ../../../topaz/public/lib/proposal/dart/lib/src/proposal_factory.dart -FILE: ../../../topaz/public/lib/run_mod/dart/lib/run_mod.dart -FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/run_mod.dart -FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/widgets/mod_failure_widget.dart -FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/widgets/mod_loading_widget.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.color.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.contact.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.documents.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.intent.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.location.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.status.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/codelab.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/finance/finance_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/lyrics/lyrics_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/recipe/recipe_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/captions/captions_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/media.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/google/youtube/video_id_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/string_list_entity_codec.dart FILE: ../../../topaz/public/lib/story/dart/lib/src/link_client.dart FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_host.dart FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_impl.dart FILE: ../../../topaz/public/lib/user/dart/lib/src/dank_user_shell_impl.dart -FILE: ../../../topaz/public/lib/widgets/dart/lib/src/model/value_model.dart FILE: ../../../topaz/runtime/dart_runner/kernel/compiler.dart FILE: ../../../topaz/runtime/dart_runner/mapped_resource.cc FILE: ../../../topaz/runtime/dart_runner/mapped_resource.h FILE: ../../../topaz/runtime/dart_runner/service_isolate.cc FILE: ../../../topaz/runtime/dart_runner/service_isolate.h -FILE: ../../../topaz/runtime/dart_runner/vmservice/empty.dart -FILE: ../../../topaz/runtime/web_view/js/dist/bundle.js FILE: ../../../topaz/shell/armadillo/lib/src/now/wifi_settings.dart FILE: ../../../topaz/shell/ermine_user_shell/app.cc FILE: ../../../topaz/shell/ermine_user_shell/app.h @@ -1172,13 +1232,6 @@ FILE: ../../../topaz/shell/ermine_user_shell/tile.cc FILE: ../../../topaz/shell/ermine_user_shell/tile.h FILE: ../../../topaz/shell/ermine_user_shell/view_controller.cc FILE: ../../../topaz/shell/ermine_user_shell/view_controller.h -FILE: ../../../topaz/shell/mondrian_story_shell/lib/container_layout.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/inset_manager.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/pattern_layout.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/positioned_surface.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_setup.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_setup_model.dart -FILE: ../../../topaz/shell/wifi_settings/lib/src/wlan_manager.dart ---------------------------------------------------------------------------------------------------- Copyright 2018 The Fuchsia Authors. All rights reserved. @@ -1209,6 +1262,42 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: topaz +ORIGIN: ../../../topaz/app/maxwell/modules/resolution_failed/lib/src/stores.dart + ../../../topaz/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../topaz/app/maxwell/modules/resolution_failed/lib/src/stores.dart +---------------------------------------------------------------------------------------------------- +Copyright 2017, the Flutter project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: topaz ORIGIN: ../../../topaz/examples/ui/lib/type_converters.cc + ../../../LICENSE @@ -1341,16 +1430,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: topaz -ORIGIN: ../../../topaz/public/dart/fidl/lib/fidl.dart + ../../../LICENSE +ORIGIN: ../../../topaz/public/dart/fuchsia/lib/fuchsia.dart + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../topaz/public/dart/fidl/lib/fidl.dart FILE: ../../../topaz/public/dart/fuchsia/lib/fuchsia.dart -FILE: ../../../topaz/public/dart/logging/lib/logging.dart -FILE: ../../../topaz/public/dart/mozart/lib/mozart.dart FILE: ../../../topaz/public/dart/zircon/lib/src/fakes/zircon_fakes.dart FILE: ../../../topaz/public/dart/zircon/lib/zircon.dart -FILE: ../../../topaz/public/lib/app/dart/logging.dart -FILE: ../../../topaz/public/lib/widgets/dart/lib/model.dart ---------------------------------------------------------------------------------------------------- Copyright 2018 The Chromium Authors. All rights reserved. @@ -1453,4 +1537,4 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -Total license count: 11 +Total license count: 12 From 17a71f69691c2017cc367dde1cd0375543a743fd Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 15 May 2018 13:39:14 -0700 Subject: [PATCH 0334/1190] Build the flutter tester on Linux in the default group. (#5267) --- shell/platform/linux/BUILD.gn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/platform/linux/BUILD.gn b/shell/platform/linux/BUILD.gn index cf9f9736a1163..e512996041a61 100644 --- a/shell/platform/linux/BUILD.gn +++ b/shell/platform/linux/BUILD.gn @@ -3,4 +3,7 @@ # found in the LICENSE file. group("linux") { + deps = [ + "$flutter_root/shell/testing", + ] } From 99b326256406456cc8fd4abc0c12b4859a072dc2 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 15 May 2018 13:49:42 -0700 Subject: [PATCH 0335/1190] Mark the linux group testonly (#5268) --- shell/platform/linux/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/platform/linux/BUILD.gn b/shell/platform/linux/BUILD.gn index e512996041a61..ed185e4541532 100644 --- a/shell/platform/linux/BUILD.gn +++ b/shell/platform/linux/BUILD.gn @@ -3,6 +3,8 @@ # found in the LICENSE file. group("linux") { + testonly = true + deps = [ "$flutter_root/shell/testing", ] From 645c15fd251b826d34a3a2b36f4899c50f4676ec Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 15 May 2018 17:59:55 -0400 Subject: [PATCH 0336/1190] Roll src/third_party/skia/ 6e9f34f0e..c8799aa92 (13 commits) (#5270) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ef49449d7ce40..6e6a542f1323e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6e9f34f0e08902417938cc7d9d0f76083ad6fff6', + 'skia_revision': 'c8799aa92212400a11357d1c4ea6710e9ed8210d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 509171be66f77..aa2677fd34912 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 44f02abeabaaa6e17185a06c9aa6ac8e +Signature: 8ddb0126ef903204d99d1ccfd231a1e0 UNUSED LICENSES: From db34bb688b438f7c53c584615aaff019d0745321 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Tue, 15 May 2018 16:01:22 -0700 Subject: [PATCH 0337/1190] Roll buildroot to 78cf6d88d1a8b6f8293649508f2c1db6ad385fb0 for newer GN for Windows. (#5271) --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 6e6a542f1323e..f2eb58eb6808e 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'cc6ecd00297daff80f94638cb137bce1f044fdb3', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '78cf6d88d1a8b6f8293649508f2c1db6ad385fb0', # Fuchsia compatibility # From e32e3903282f383fbf21d6323df552f185d1c4bc Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Tue, 15 May 2018 16:13:21 -0700 Subject: [PATCH 0338/1190] Roll Dart to a5c11d7d0329432ca37e35bb249b20f60aa0aa31. (#5269) Update engine for removal of Dart_ReadKernelBinary and refactored build targets. --- DEPS | 4 +- content_handler/BUILD.gn | 11 +- runtime/dart_isolate.cc | 24 +- runtime/dart_vm.cc | 20 +- runtime/dart_vm.h | 5 +- runtime/dart_vm_unittests.cc | 2 +- shell/common/BUILD.gn | 1 - shell/testing/BUILD.gn | 2 - travis/licenses_golden/licenses_third_party | 2 +- travis/licenses_golden/licenses_topaz | 500 ++++++++------------ 10 files changed, 238 insertions(+), 333 deletions(-) diff --git a/DEPS b/DEPS index f2eb58eb6808e..fa78e12f88512 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '46ab040e589adc5200370dec7952ce5150850822', + 'dart_revision': 'a5c11d7d0329432ca37e35bb249b20f60aa0aa31', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', @@ -126,7 +126,7 @@ deps = { Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67', 'src/topaz': - Var('fuchsia_git') + '/topaz' + '@' + 'e331f910c1003d154a4de6e1b5356f8d785fd6ec', + Var('fuchsia_git') + '/topaz' + '@' + '5fa651cf9cc5f338379e34964ff5dd70052f6237', 'src/third_party/benchmark': Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22', diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn index 6eec0b2ed97cb..3cdaa0dab219d 100644 --- a/content_handler/BUILD.gn +++ b/content_handler/BUILD.gn @@ -70,7 +70,6 @@ template("flutter_content_handler") { deps = [ "//third_party/dart/runtime/bin:libdart_builtin", - "//third_party/dart/runtime/platform:libdart_platform", "//garnet/public/lib/app/cpp", "//garnet/public/lib/fonts/fidl", "//garnet/public/lib/fsl", @@ -108,10 +107,16 @@ template("flutter_content_handler") { flutter_content_handler("aot") { output_name = "flutter_aot_runner" - extra_deps = [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] + extra_deps = [ + "//third_party/dart/runtime:libdart_precompiled_runtime", + "//third_party/dart/runtime/platform:libdart_platform_precompiled_runtime", + ] } flutter_content_handler("jit") { output_name = "flutter_jit_runner" - extra_deps = [ "//third_party/dart/runtime:libdart_jit" ] + extra_deps = [ + "//third_party/dart/runtime:libdart_jit", + "//third_party/dart/runtime/platform:libdart_platform_jit", + ] } diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 976e5d22a13f4..91c91f4905d56 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -541,10 +541,10 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( // thread. service_isolate->ResetWeakPtrFactory(); - const bool isolate_snapshot_is_dart_2 = - Dart_IsDart2Snapshot(vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); + const bool isolate_snapshot_is_dart_2 = Dart_IsDart2Snapshot( + vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); const bool is_preview_dart2 = - vm->GetPlatformKernel() != nullptr || isolate_snapshot_is_dart_2; + (vm->GetPlatformKernel().GetSize() > 0) || isolate_snapshot_is_dart_2; const bool running_from_sources = !DartVM::IsRunningPrecompiledCode() && !is_preview_dart2; @@ -648,14 +648,16 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( // Create the Dart VM isolate and give it the embedder object as the baton. Dart_Isolate isolate = - vm->GetPlatformKernel() != nullptr - ? Dart_CreateIsolateFromKernel(advisory_script_uri, // - advisory_script_entrypoint, // - vm->GetPlatformKernel(), // - flags, // - embedder_isolate.get(), // - error // - ) + (vm->GetPlatformKernel().GetSize() > 0) + ? Dart_CreateIsolateFromKernel( + advisory_script_uri, // + advisory_script_entrypoint, // + vm->GetPlatformKernel().GetMapping(), // + vm->GetPlatformKernel().GetSize(), // + flags, // + embedder_isolate.get(), // + error // + ) : Dart_CreateIsolate(advisory_script_uri, // advisory_script_entrypoint, // embedder_isolate->GetIsolateSnapshot() diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 378a642681189..eeb395257c411 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -278,18 +278,6 @@ DartVM::DartVM(const Settings& settings, FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid()) << "Isolate snapshot must be valid."; - if (platform_kernel_mapping_->GetSize() > 0) { - // The platform kernel mapping lifetime is managed by this instance of the - // DartVM and hence will exceed that of the PlatformKernel. So provide an - // empty release callback. - Dart_ReleaseBufferCallback empty = [](auto arg) {}; - platform_kernel_ = reinterpret_cast(Dart_ReadKernelBinary( - platform_kernel_mapping_->GetMapping(), // buffer - platform_kernel_mapping_->GetSize(), // buffer size - empty // buffer deleter - )); - } - { TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); dart::bin::BootstrapDartIo(); @@ -340,11 +328,11 @@ DartVM::DartVM(const Settings& settings, Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); const bool is_preview_dart2 = - platform_kernel_ != nullptr || isolate_snapshot_is_dart_2; + (platform_kernel_mapping_->GetSize() > 0) || isolate_snapshot_is_dart_2; FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? "is" : "is NOT") << " enabled. Platform kernel: " - << static_cast(platform_kernel_) + << static_cast(platform_kernel_mapping_->GetSize() > 0) << " Isolate Snapshot is Dart 2: " << isolate_snapshot_is_dart_2; @@ -453,8 +441,8 @@ const Settings& DartVM::GetSettings() const { return settings_; } -DartVM::PlatformKernel* DartVM::GetPlatformKernel() const { - return platform_kernel_; +const fml::Mapping& DartVM::GetPlatformKernel() const { + return *platform_kernel_mapping_.get(); } const DartSnapshot& DartVM::GetVMSnapshot() const { diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h index e8feb9ba1de92..12ac1c6b21b08 100644 --- a/runtime/dart_vm.h +++ b/runtime/dart_vm.h @@ -25,8 +25,6 @@ namespace blink { class DartVM : public fxl::RefCountedThreadSafe { public: - class PlatformKernel; - static fxl::RefPtr ForProcess(Settings settings); static fxl::RefPtr ForProcess( @@ -40,7 +38,7 @@ class DartVM : public fxl::RefCountedThreadSafe { const Settings& GetSettings() const; - PlatformKernel* GetPlatformKernel() const; + const fml::Mapping& GetPlatformKernel() const; const DartSnapshot& GetVMSnapshot() const; @@ -55,7 +53,6 @@ class DartVM : public fxl::RefCountedThreadSafe { const fxl::RefPtr vm_snapshot_; const fxl::RefPtr isolate_snapshot_; std::unique_ptr platform_kernel_mapping_; - PlatformKernel* platform_kernel_ = nullptr; ServiceProtocol service_protocol_; fxl::WeakPtrFactory weak_factory_; diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc index 5b2f5e6ee8299..d0664d111181b 100644 --- a/runtime/dart_vm_unittests.cc +++ b/runtime/dart_vm_unittests.cc @@ -15,7 +15,7 @@ TEST(DartVM, SimpleInitialization) { ASSERT_TRUE(vm); ASSERT_EQ(vm, DartVM::ForProcess(settings)); ASSERT_FALSE(DartVM::IsRunningPrecompiledCode()); - ASSERT_EQ(vm->GetPlatformKernel(), nullptr); + ASSERT_EQ(vm->GetPlatformKernel().GetSize(), 0u); } } // namespace blink diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 5817d1616fc13..02e5f12b7d01e 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -103,7 +103,6 @@ source_set("common") { "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", - "//third_party/dart/runtime/platform:libdart_platform", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:gpu", diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index 36bc9acc452ed..e0384da218570 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -21,8 +21,6 @@ executable("testing") { "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", - "//third_party/dart/runtime/bin:libdart_builtin", - "//third_party/dart/runtime/platform:libdart_platform", "//third_party/skia", "//topaz/lib/tonic", ] diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index aa2677fd34912..7c53f81cc8dde 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8ddb0126ef903204d99d1ccfd231a1e0 +Signature: 1b192480901ca7233d44dac3da78293c UNUSED LICENSES: diff --git a/travis/licenses_golden/licenses_topaz b/travis/licenses_golden/licenses_topaz index 042b7c10fadd3..23db62a06ba5f 100644 --- a/travis/licenses_golden/licenses_topaz +++ b/travis/licenses_golden/licenses_topaz @@ -1,4 +1,4 @@ -Signature: 597710f90d5b8794763d889b25f6036c +Signature: 752ea74efe31654aef9d549b7e32340c UNUSED LICENSES: @@ -10,8 +10,7 @@ USED LICENSES: LIBRARY: topaz ORIGIN: ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../topaz/public/lib/fidl/dart/lib/bindings.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/message.dart +FILE: ../../../topaz/public/lib/app_driver/dart/lib/src/service_client.dart ---------------------------------------------------------------------------------------------------- Copyright 2014 The Chromium Authors. All rights reserved. @@ -97,7 +96,6 @@ FILE: ../../../topaz/app/chat/modules/conversation_list/lib/widgets.dart FILE: ../../../topaz/app/chat/packages/chat_models/lib/src/user_model.dart FILE: ../../../topaz/app/chat/services/chat_content_provider.fidl FILE: ../../../topaz/app/chat/services/firebase_db_client.fidl -FILE: ../../../topaz/app/color/lib/src/parse_int.dart FILE: ../../../topaz/app/contacts/agents/content_provider/lib/main.dart FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/contacts_content_provider_impl.dart FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/contacts_watcher.dart @@ -107,8 +105,6 @@ FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/store/prefix_t FILE: ../../../topaz/app/contacts/agents/content_provider/lib/store.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/main.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/models/contact_card_model.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/modular/contact_card_module_model.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/modular/link_data.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_activity.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_card.dart FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_details.dart @@ -118,36 +114,17 @@ FILE: ../../../topaz/app/contacts/modules/contact_list/lib/models.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/actions.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/contact_item.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/contact_list_model.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/modular/contact_list_module_model.dart +FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/service/contacts_service.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/widgets/contact_list.dart FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/widgets/contact_list_item.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/fixtures.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/models.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models/contact.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models/entry_types.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/models/fixtures.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/screens/contact_card_screen.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/screens/contact_list_screen.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/address_details_group.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_card.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_details_group.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_details_row.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_header.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_list_item.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/email_details_group.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/widgets.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/main.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/modular/contacts_picker_module_model.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/contact_item_store.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/contacts_picker_store.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/link_data.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/widgets/contact_item.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/widgets/contacts_picker.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/stores.dart FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/widgets.dart -FILE: ../../../topaz/app/contacts/services/contacts_content_provider.fidl +FILE: ../../../topaz/app/contacts/services/fidl/contacts_content_provider.fidl FILE: ../../../topaz/app/dashboard/lib/build_status_model.dart FILE: ../../../topaz/app/dashboard/lib/build_status_widget.dart FILE: ../../../topaz/app/dashboard/lib/buildbucket/build_bucket_service.dart @@ -162,14 +139,12 @@ FILE: ../../../topaz/app/dashboard/lib/service/build_service.dart FILE: ../../../topaz/app/documents/agents/content_provider/lib/main.dart FILE: ../../../topaz/app/documents/agents/content_provider/lib/src/documents_content_provider_impl.dart FILE: ../../../topaz/app/documents/modules/browser/lib/main.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/modular/browser_module_model.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/browser.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/doc_list_item.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/image_viewer.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/selectable_item.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/thumbnail.dart FILE: ../../../topaz/app/documents/modules/info/lib/main.dart -FILE: ../../../topaz/app/documents/modules/info/lib/src/modular/info_module_model.dart FILE: ../../../topaz/app/documents/modules/info/lib/src/widgets/info.dart FILE: ../../../topaz/app/documents/packages/utils/lib/utils.dart FILE: ../../../topaz/app/documents/services/document.fidl @@ -194,102 +169,18 @@ FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/src/proposal_subscribers.da FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/index.html FILE: ../../../topaz/app/maxwell/agents/module_suggester_dart/main.dart FILE: ../../../topaz/app/maxwell/agents/usage_log/main.dart -FILE: ../../../topaz/app/maxwell/modules/resolution_failed/lib/src/module_data_module_model.dart -FILE: ../../../topaz/app/music/agents/concert_agent/lib/main.dart -FILE: ../../../topaz/app/music/agents/last_fm_agent/lib/main.dart -FILE: ../../../topaz/app/music/agents/music_artist_agent/lib/main.dart -FILE: ../../../topaz/app/music/agents/music_playback_agent/lib/main.dart -FILE: ../../../topaz/app/music/agents/music_playback_agent/lib/src/command_handler.dart -FILE: ../../../topaz/app/music/agents/music_playback_agent/lib/src/player_impl.dart -FILE: ../../../topaz/app/music/modules/concert_event/lib/main.dart -FILE: ../../../topaz/app/music/modules/concert_event/lib/modular/event_module_model.dart -FILE: ../../../topaz/app/music/modules/concert_event_list/lib/main.dart -FILE: ../../../topaz/app/music/modules/concert_event_list/lib/modular/event_list_module_model.dart -FILE: ../../../topaz/app/music/modules/concert_event_list/lib/modular/event_selector.dart -FILE: ../../../topaz/app/music/modules/concert_event_page/lib/main.dart -FILE: ../../../topaz/app/music/modules/concert_event_page/lib/modular/event_page_module_model.dart -FILE: ../../../topaz/app/music/modules/last_fm_artist_bio/lib/main.dart -FILE: ../../../topaz/app/music/modules/last_fm_artist_bio/lib/modular/artist_bio_module_model.dart -FILE: ../../../topaz/app/music/modules/last_fm_artist_bio/lib/modular/artist_bio_module_screen.dart -FILE: ../../../topaz/app/music/modules/music_album/lib/main.dart -FILE: ../../../topaz/app/music/modules/music_album/lib/modular/album_module_model.dart -FILE: ../../../topaz/app/music/modules/music_artist/lib/main.dart -FILE: ../../../topaz/app/music/modules/music_artist/lib/modular/artist_module_model.dart -FILE: ../../../topaz/app/music/modules/music_artist/lib/modular/artist_module_screen.dart -FILE: ../../../topaz/app/music/modules/music_playback/lib/main.dart -FILE: ../../../topaz/app/music/modules/music_playback/lib/modular/playback_module_model.dart -FILE: ../../../topaz/app/music/modules/music_playback/lib/modular/player_status_listener.dart -FILE: ../../../topaz/app/music/packages/concert_api/lib/api.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/concert_models.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/src/artist.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/src/event.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/src/fixtures.dart -FILE: ../../../topaz/app/music/packages/concert_models/lib/src/venue.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/concert_widgets.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/concert_guide_header.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_card.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_list.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_list_item.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/event_page.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/fallback_image.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/loading_status.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/pageable_event_list.dart -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/src/typedefs.dart -FILE: ../../../topaz/app/music/packages/last_fm_api/lib/api.dart -FILE: ../../../topaz/app/music/packages/last_fm_models/lib/last_fm_models.dart -FILE: ../../../topaz/app/music/packages/last_fm_models/lib/src/artist.dart -FILE: ../../../topaz/app/music/packages/last_fm_models/lib/src/fixtures.dart -FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/last_fm_widgets.dart -FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/src/artist_bio.dart -FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/src/loading_status.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/music_models.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/album.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/artist.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/fixtures.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/music_image.dart -FILE: ../../../topaz/app/music/packages/music_models/lib/src/track.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/album_screen.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/artist_grid.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/artist_screen.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/edge_to_edge_player.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/follow_button.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/hero_banner_scaffold.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/inline_album.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/loading_status.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/playback_slider.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/player.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/track_art.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/track_list_item.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/typedefs.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/utils.dart -FILE: ../../../topaz/app/music/services/player/player.fidl -FILE: ../../../topaz/app/music/services/player/repeat_mode.fidl -FILE: ../../../topaz/app/music/services/player/status.fidl -FILE: ../../../topaz/app/music/services/player/track.fidl FILE: ../../../topaz/app/perspective/lib/main.dart FILE: ../../../topaz/app/spinning_cube/lib/spinning_cube_gem.dart -FILE: ../../../topaz/app/todo/agents/content_provider/src/main.rs -FILE: ../../../topaz/app/todo/modules/story/lib/main.dart -FILE: ../../../topaz/app/todo/modules/story/lib/src/module_model.dart -FILE: ../../../topaz/app/todo/modules/story/lib/src/screen.dart -FILE: ../../../topaz/app/todo/services/todo.fidl FILE: ../../../topaz/app/video/modules/video/lib/main.dart FILE: ../../../topaz/app/video/modules/video/lib/src/modular/player_model.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/modular/video_module_model.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/asset.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/constants.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/device_chooser.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/device_target_icon.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/loading.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/play_controls.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/player.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/remote_control.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/screen.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/scrubber.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/standby.dart FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_app.dart -FILE: ../../../topaz/app/xi/modules/xi-core/src/main.rs FILE: ../../../topaz/app/xi/modules/xi_app/lib/main.dart FILE: ../../../topaz/app/xi/modules/xi_app/lib/src/xi_fuchsia_client.dart FILE: ../../../topaz/app/xi/packages/widgets/lib/src/editor.dart @@ -299,7 +190,6 @@ FILE: ../../../topaz/app/xi/packages/widgets/lib/src/text_line.dart FILE: ../../../topaz/app/xi/packages/widgets/lib/src/xi_app.dart FILE: ../../../topaz/app/xi/packages/widgets/lib/widgets.dart FILE: ../../../topaz/app/xi/packages/xi_client/lib/client.dart -FILE: ../../../topaz/app/xi/services/xi.fidl FILE: ../../../topaz/app/xi/xi_flutter/lib/main.dart FILE: ../../../topaz/app/xi/xi_flutter/lib/src/xi_flutter_client.dart FILE: ../../../topaz/examples/bluetooth/ble_rect/lib/main.dart @@ -324,28 +214,6 @@ FILE: ../../../topaz/examples/ledger/todo_list/lib/src/widgets/new_item_input.da FILE: ../../../topaz/examples/media/media_player_flutter/lib/asset.dart FILE: ../../../topaz/examples/media/media_player_flutter/lib/config.dart FILE: ../../../topaz/examples/media/media_player_flutter/lib/main.dart -FILE: ../../../topaz/examples/modular/counter_flutter/child/lib/home.dart -FILE: ../../../topaz/examples/modular/counter_flutter/child/lib/main.dart -FILE: ../../../topaz/examples/modular/counter_flutter/child/lib/module_model.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_embed/lib/home.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_embed/lib/main.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_embed/lib/module_model.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_story_shell/lib/home.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_story_shell/lib/main.dart -FILE: ../../../topaz/examples/modular/counter_flutter/parent_story_shell/lib/module_model.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/dummy_photo_storage.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/home.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/main.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/photo.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/photo_storage.dart -FILE: ../../../topaz/examples/modular/photos_flutter/lib/photo_view.dart -FILE: ../../../topaz/examples/modular/story_shell_flutter/lib/main.dart -FILE: ../../../topaz/examples/modular/suggest_shell/controller/main.cc -FILE: ../../../topaz/examples/modular/suggest_shell/view/lib/main.dart -FILE: ../../../topaz/examples/modular/todo_story/lib/data.dart -FILE: ../../../topaz/examples/modular/todo_story/lib/generator.dart -FILE: ../../../topaz/examples/modular/todo_story/lib/main.dart -FILE: ../../../topaz/examples/modular/todo_story/lib/view.dart FILE: ../../../topaz/examples/oauth_token_manager/credentials.fbs FILE: ../../../topaz/examples/oauth_token_manager/oauth_token_manager.cc FILE: ../../../topaz/examples/ui/jank/main.cc @@ -381,7 +249,7 @@ FILE: ../../../topaz/public/dart/entity_schemas/lib/entities.dart FILE: ../../../topaz/public/dart/entity_schemas/lib/src/contact.dart FILE: ../../../topaz/public/dart/entity_schemas/lib/src/email.dart FILE: ../../../topaz/public/dart/entity_schemas/lib/src/phone_number.dart -FILE: ../../../topaz/public/dart/logging/lib/logging.dart +FILE: ../../../topaz/public/dart/logging/lib/src/logging.dart FILE: ../../../topaz/public/dart/widgets/lib/src/application/application_widget.dart FILE: ../../../topaz/public/dart/widgets/lib/src/model/embedder_model.dart FILE: ../../../topaz/public/dart/widgets/lib/src/model/idle_model.dart @@ -398,6 +266,7 @@ FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/simulated_positioned.da FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/text_placeholder.dart FILE: ../../../topaz/public/lib/agent/dart/lib/agent.dart FILE: ../../../topaz/public/lib/agent/dart/lib/src/agent_impl.dart +FILE: ../../../topaz/public/lib/app/dart/src/logging.dart FILE: ../../../topaz/public/lib/component/dart/lib/component.dart FILE: ../../../topaz/public/lib/component/dart/lib/src/message_receiver_impl.dart FILE: ../../../topaz/public/lib/context/dart/context_listener_impl.dart @@ -415,7 +284,12 @@ FILE: ../../../topaz/public/lib/media/flutter/media_player.dart FILE: ../../../topaz/public/lib/media/flutter/media_player_controller.dart FILE: ../../../topaz/public/lib/media/flutter/progress_notifier.dart FILE: ../../../topaz/public/lib/module/dart/lib/module.dart -FILE: ../../../topaz/public/lib/module_resolver/dart/daisy_builder.dart +FILE: ../../../topaz/public/lib/module_resolver/dart/intent_builder.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/parse_int.dart FILE: ../../../topaz/public/lib/story/dart/lib/story.dart FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.cc FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.h @@ -495,7 +369,6 @@ FILE: ../../../topaz/shell/armadillo_user_shell/lib/maxwell_hotword.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/maxwell_voice_model.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/power_manager_power_model.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/rate_limited_retry.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/story_importance_watcher_impl.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/user_logoutter.dart FILE: ../../../topaz/shell/armadillo_user_shell/lib/wallpaper_chooser.dart FILE: ../../../topaz/shell/capybara_user_shell/lib/launcher.dart @@ -532,20 +405,16 @@ FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_form.dart FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_frame.dart FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_stage.dart FILE: ../../../topaz/shell/mondrian_story_shell/lib/tree.dart +FILE: ../../../topaz/shell/timezone/lib/timezone_picker.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_context_impl.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_overlay.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_overlay_model.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/child_constraints_changer.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/circular_button.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/clock.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/constraints_model.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/debug_text.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/device_extender.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/device_extension_state.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/main.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/memory_indicator.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/netstack_model.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/rounded_corner_decoration.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/soft_keyboard_container_impl.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_list.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_picker_device_shell_model.dart @@ -555,8 +424,7 @@ FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_shell_chooser.dart FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_watcher_impl.dart FILE: ../../../topaz/shell/wifi_settings/lib/main.dart FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/access_point.dart -FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/wifi_settings_module_model.dart -FILE: ../../../topaz/shell/wifi_settings/lib/src/wlan_info.dart +FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/wifi_settings_model.dart ---------------------------------------------------------------------------------------------------- Copyright 2017 The Fuchsia Authors. All rights reserved. @@ -626,6 +494,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: topaz ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd +FILE: ../../../topaz/MAINTAINERS FILE: ../../../topaz/app/chat/agents/content_provider/meta/sandbox FILE: ../../../topaz/app/chat/agents/firebase_db_client/meta/sandbox FILE: ../../../topaz/app/chat/modules/conversation/lib/main.dart @@ -635,16 +504,7 @@ FILE: ../../../topaz/app/chat/modules/conversation_list/lib/main.dart FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/models/user.dart FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/time_util.dart FILE: ../../../topaz/app/contacts/agents/content_provider/meta/sandbox -FILE: ../../../topaz/app/contacts/modules/contacts/android/AndroidManifest.xml -FILE: ../../../topaz/app/contacts/modules/contacts/lib/main.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/modular_main.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/app.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/contact_api.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/screens.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/contact_details.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/phone_details_group.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/theme.dart -FILE: ../../../topaz/app/contacts/modules/contacts/lib/src/widgets/type_defs.dart +FILE: ../../../topaz/app/contacts/modules/contact_card/manifest.json FILE: ../../../topaz/app/contacts/modules/contacts_picker/manifest.json FILE: ../../../topaz/app/dashboard/android/app/src/main/AndroidManifest.xml FILE: ../../../topaz/app/dashboard/android/app/src/main/java/com/yourcompany/dashboard/MainActivity.java @@ -654,6 +514,7 @@ FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xhdpi/ic_laun FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png FILE: ../../../topaz/app/dashboard/android/gradle.properties +FILE: ../../../topaz/app/dashboard/config/dashboard.config FILE: ../../../topaz/app/dashboard/ios/Flutter/Debug.xcconfig FILE: ../../../topaz/app/dashboard/ios/Flutter/Release.xcconfig FILE: ../../../topaz/app/dashboard/ios/Podfile @@ -691,6 +552,7 @@ FILE: ../../../topaz/app/dashboard/ios/Runner/Base.lproj/Main.storyboard FILE: ../../../topaz/app/dashboard/ios/Runner/Info.plist FILE: ../../../topaz/app/dashboard/ios/Runner/main.m FILE: ../../../topaz/app/dashboard/meta/sandbox +FILE: ../../../topaz/app/documents/modules/info/meta/manifest.json FILE: ../../../topaz/app/file_explorer/meta/sandbox FILE: ../../../topaz/app/image/manifest.json FILE: ../../../topaz/app/ledger/ledger_dashboard/dashboard.config @@ -699,18 +561,6 @@ FILE: ../../../topaz/app/ledger/ledger_dashboard/webroot/logo.png FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/dashboard.config FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/dashboard.js FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/logo.png -FILE: ../../../topaz/app/maxwell/modules/basic_text_reporter/lib/main.dart -FILE: ../../../topaz/app/maxwell/modules/resolution_failed/lib/main.dart -FILE: ../../../topaz/app/music/agents/last_fm_agent/meta/sandbox -FILE: ../../../topaz/app/music/agents/music_artist_agent/meta/sandbox -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/res/concert_bg.jpg -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/res/myseat.png -FILE: ../../../topaz/app/music/packages/concert_widgets/lib/res/plat_logo.png -FILE: ../../../topaz/app/music/packages/last_fm_widgets/lib/res/background.jpg -FILE: ../../../topaz/app/music/packages/music_api/lib/api.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/music_widgets.dart -FILE: ../../../topaz/app/music/packages/music_widgets/lib/res/music_wallpaper.jpg -FILE: ../../../topaz/app/music/packages/music_widgets/lib/src/home_page.dart FILE: ../../../topaz/app/perspective/lib/res/module-a-photos/1-sea-withtext.png FILE: ../../../topaz/app/perspective/lib/res/module-a-photos/2-pano-withtext.png FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/1.png @@ -737,12 +587,9 @@ FILE: ../../../topaz/app/term/term_params.cc FILE: ../../../topaz/app/term/term_params.h FILE: ../../../topaz/app/term/view_controller.cc FILE: ../../../topaz/app/term/view_controller.h -FILE: ../../../topaz/app/todo/agents/content_provider/Cargo.toml FILE: ../../../topaz/app/video/modules/video/assets/video-background.png FILE: ../../../topaz/app/video/modules/video/assets/video-thumbnail.png FILE: ../../../topaz/app/video/modules/video/manifest.json -FILE: ../../../topaz/app/xi/modules/xi-core/Cargo.lock -FILE: ../../../topaz/app/xi/modules/xi-core/Cargo.toml FILE: ../../../topaz/app/xi/xi_flutter/android/AndroidManifest.xml FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-hdpi/ic_launcher.png FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-mdpi/ic_launcher.png @@ -786,21 +633,19 @@ FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Base.lproj/Main.storyboard FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Info.plist FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/main.m FILE: ../../../topaz/app/xi/xi_flutter/xi_flutter.iml -FILE: ../../../topaz/examples/media/media_player/main.cc -FILE: ../../../topaz/examples/media/media_player/media_player_params.cc -FILE: ../../../topaz/examples/media/media_player/media_player_params.h -FILE: ../../../topaz/examples/media/media_player/media_player_view.cc -FILE: ../../../topaz/examples/media/media_player/media_player_view.h +FILE: ../../../topaz/examples/fidl/echo_server_dart/lib/main.dart FILE: ../../../topaz/examples/media/media_player_flutter/media_player_flutter.config FILE: ../../../topaz/examples/media/media_player_flutter/meta/sandbox +FILE: ../../../topaz/examples/media/media_player_skia/main.cc +FILE: ../../../topaz/examples/media/media_player_skia/media_player_params.cc +FILE: ../../../topaz/examples/media/media_player_skia/media_player_params.h +FILE: ../../../topaz/examples/media/media_player_skia/media_player_view.cc +FILE: ../../../topaz/examples/media/media_player_skia/media_player_view.h FILE: ../../../topaz/examples/media/vu_meter/main.cc FILE: ../../../topaz/examples/media/vu_meter/vu_meter_params.cc FILE: ../../../topaz/examples/media/vu_meter/vu_meter_params.h FILE: ../../../topaz/examples/media/vu_meter/vu_meter_view.cc FILE: ../../../topaz/examples/media/vu_meter/vu_meter_view.h -FILE: ../../../topaz/examples/modular/hello_world_flutter/lib/main.dart -FILE: ../../../topaz/examples/ui/basic_wm/main.dart -FILE: ../../../topaz/examples/ui/basic_wm/window_manager.dart FILE: ../../../topaz/examples/ui/hello_material/main.dart FILE: ../../../topaz/examples/ui/jank/jank_view.cc FILE: ../../../topaz/examples/ui/jank/jank_view.h @@ -841,54 +686,66 @@ FILE: ../../../topaz/manifest/minimal FILE: ../../../topaz/manifest/skia FILE: ../../../topaz/manifest/third_party FILE: ../../../topaz/manifest/topaz -FILE: ../../../topaz/packages/bluetooth_settings -FILE: ../../../topaz/packages/chat -FILE: ../../../topaz/packages/color -FILE: ../../../topaz/packages/config.json +FILE: ../../../topaz/manifest/topaz-unstable +FILE: ../../../topaz/packages/all +FILE: ../../../topaz/packages/config/dashboard FILE: ../../../topaz/packages/config/ermine_user_shell FILE: ../../../topaz/packages/config/term -FILE: ../../../topaz/packages/contacts -FILE: ../../../topaz/packages/curl -FILE: ../../../topaz/packages/dart -FILE: ../../../topaz/packages/dart_examples -FILE: ../../../topaz/packages/dart_runner -FILE: ../../../topaz/packages/dart_target_unittests -FILE: ../../../topaz/packages/dart_unittests -FILE: ../../../topaz/packages/dashboard FILE: ../../../topaz/packages/default -FILE: ../../../topaz/packages/doc_checker -FILE: ../../../topaz/packages/documents -FILE: ../../../topaz/packages/ermine_user_shell -FILE: ../../../topaz/packages/examples -FILE: ../../../topaz/packages/file_explorer -FILE: ../../../topaz/packages/flutter -FILE: ../../../topaz/packages/git -FILE: ../../../topaz/packages/google_auth_provider -FILE: ../../../topaz/packages/image -FILE: ../../../topaz/packages/infinite_scroller -FILE: ../../../topaz/packages/latin-ime -FILE: ../../../topaz/packages/ledger -FILE: ../../../topaz/packages/link_viewer -FILE: ../../../topaz/packages/lua -FILE: ../../../topaz/packages/maxwell -FILE: ../../../topaz/packages/mods -FILE: ../../../topaz/packages/modular_examples -FILE: ../../../topaz/packages/mondrian -FILE: ../../../topaz/packages/music -FILE: ../../../topaz/packages/oauth_token_manager -FILE: ../../../topaz/packages/perspective -FILE: ../../../topaz/packages/speccpu2000 -FILE: ../../../topaz/packages/spinning_cube -FILE: ../../../topaz/packages/sqlite -FILE: ../../../topaz/packages/sysui -FILE: ../../../topaz/packages/term -FILE: ../../../topaz/packages/todo -FILE: ../../../topaz/packages/tools -FILE: ../../../topaz/packages/ui_examples -FILE: ../../../topaz/packages/video -FILE: ../../../topaz/packages/web_view -FILE: ../../../topaz/packages/webkit -FILE: ../../../topaz/packages/xi +FILE: ../../../topaz/packages/dev +FILE: ../../../topaz/packages/examples/all +FILE: ../../../topaz/packages/examples/dart +FILE: ../../../topaz/packages/examples/fidl +FILE: ../../../topaz/packages/examples/misc +FILE: ../../../topaz/packages/examples/mondrian +FILE: ../../../topaz/packages/examples/spinning_cube +FILE: ../../../topaz/packages/examples/ui +FILE: ../../../topaz/packages/kitchen_sink +FILE: ../../../topaz/packages/prod/all +FILE: ../../../topaz/packages/prod/bluetooth_settings +FILE: ../../../topaz/packages/prod/color +FILE: ../../../topaz/packages/prod/contacts +FILE: ../../../topaz/packages/prod/curl +FILE: ../../../topaz/packages/prod/dart +FILE: ../../../topaz/packages/prod/dart_aot_product_runner +FILE: ../../../topaz/packages/prod/dart_aot_runner +FILE: ../../../topaz/packages/prod/dart_jit_product_runner +FILE: ../../../topaz/packages/prod/dart_jit_runner +FILE: ../../../topaz/packages/prod/dart_runner +FILE: ../../../topaz/packages/prod/dashboard +FILE: ../../../topaz/packages/prod/disabled/chat +FILE: ../../../topaz/packages/prod/documents +FILE: ../../../topaz/packages/prod/file_explorer +FILE: ../../../topaz/packages/prod/flutter +FILE: ../../../topaz/packages/prod/flutter_aot +FILE: ../../../topaz/packages/prod/flutter_jit +FILE: ../../../topaz/packages/prod/google_auth_provider +FILE: ../../../topaz/packages/prod/image +FILE: ../../../topaz/packages/prod/infinite_scroller +FILE: ../../../topaz/packages/prod/latin-ime +FILE: ../../../topaz/packages/prod/maxwell +FILE: ../../../topaz/packages/prod/mods +FILE: ../../../topaz/packages/prod/mondrian +FILE: ../../../topaz/packages/prod/oauth_token_manager +FILE: ../../../topaz/packages/prod/perspective +FILE: ../../../topaz/packages/prod/spotify_auth_provider +FILE: ../../../topaz/packages/prod/sqlite +FILE: ../../../topaz/packages/prod/sysui +FILE: ../../../topaz/packages/prod/term +FILE: ../../../topaz/packages/prod/video +FILE: ../../../topaz/packages/prod/web_view +FILE: ../../../topaz/packages/prod/webkit +FILE: ../../../topaz/packages/prod/xi +FILE: ../../../topaz/packages/products/dashboard +FILE: ../../../topaz/packages/products/term +FILE: ../../../topaz/packages/sdk/dart +FILE: ../../../topaz/packages/tools/all +FILE: ../../../topaz/packages/tools/dart +FILE: ../../../topaz/packages/tools/doc_checker +FILE: ../../../topaz/packages/tools/ermine_user_shell +FILE: ../../../topaz/packages/tools/ledger +FILE: ../../../topaz/packages/tools/link_viewer +FILE: ../../../topaz/packages/topaz FILE: ../../../topaz/public/dart-pkg/fuchsia/lib/fuchsia.dart FILE: ../../../topaz/public/dart-pkg/fuchsia/sdk_ext/fuchsia.cc FILE: ../../../topaz/public/dart-pkg/fuchsia/sdk_ext/fuchsia.h @@ -899,29 +756,26 @@ FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/handle_waiter.h FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/natives.cc FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/natives.h FILE: ../../../topaz/public/dart/config/lib/config.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/interface.dart FILE: ../../../topaz/public/dart/fixtures/lib/fixtures.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/fixtures.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/name.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/names.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/namespace.dart FILE: ../../../topaz/public/dart/fixtures/lib/src/sequence.dart +FILE: ../../../topaz/public/dart/mozart/lib/src/fakes/mozart_fakes.dart FILE: ../../../topaz/public/dart/widgets/lib/src/model/model.dart FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/rk4_spring_simulation.dart FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/ticking_double_state.dart FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/ticking_state.dart FILE: ../../../topaz/public/lib/app/dart/app.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/_sdkext -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/codec.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/enum.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/interface.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/struct.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/union.dart FILE: ../../../topaz/public/lib/ui/flutter/_sdkext FILE: ../../../topaz/public/lib/ui/flutter/child_view.dart FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/mozart.dart +FILE: ../../../topaz/public/lib/widgets/dart/lib/src/model/model.dart +FILE: ../../../topaz/runtime/MAINTAINERS FILE: ../../../topaz/runtime/dart_runner/builtin_libraries.cc FILE: ../../../topaz/runtime/dart_runner/builtin_libraries.h -FILE: ../../../topaz/runtime/dart_runner/dart2 FILE: ../../../topaz/runtime/dart_runner/dart_application_controller.cc FILE: ../../../topaz/runtime/dart_runner/dart_application_controller.h FILE: ../../../topaz/runtime/dart_runner/dart_application_runner.cc @@ -937,17 +791,24 @@ FILE: ../../../topaz/runtime/dart_runner/examples/hello_app_dart/main.dart FILE: ../../../topaz/runtime/dart_runner/examples/hello_dart/bin/hello_dart.dart FILE: ../../../topaz/runtime/dart_runner/kernel/libraries.json FILE: ../../../topaz/runtime/dart_runner/main.cc -FILE: ../../../topaz/runtime/dart_runner/meta/aot2_runtime +FILE: ../../../topaz/runtime/dart_runner/meta/aot_product_runtime FILE: ../../../topaz/runtime/dart_runner/meta/aot_runtime -FILE: ../../../topaz/runtime/dart_runner/meta/jit2_runtime +FILE: ../../../topaz/runtime/dart_runner/meta/jit_product_runtime FILE: ../../../topaz/runtime/dart_runner/meta/jit_runtime FILE: ../../../topaz/runtime/dart_runner/meta/sandbox -FILE: ../../../topaz/runtime/dart_runner/snapshotter/main.cc +FILE: ../../../topaz/runtime/flutter_runner/kernel/libraries.json FILE: ../../../topaz/runtime/flutter_runner/meta/aot_runtime FILE: ../../../topaz/runtime/flutter_runner/meta/jit_runtime FILE: ../../../topaz/runtime/flutter_runner/meta/source_runtime FILE: ../../../topaz/runtime/web_runner/web_view_component.json -FILE: ../../../topaz/runtime/web_view/extract_schema_org.js +FILE: ../../../topaz/runtime/web_view/js/package.json +FILE: ../../../topaz/runtime/web_view/js/src/entity.ts +FILE: ../../../topaz/runtime/web_view/js/src/jsonld.ts +FILE: ../../../topaz/runtime/web_view/js/src/main.ts +FILE: ../../../topaz/runtime/web_view/js/src/microdata.ts +FILE: ../../../topaz/runtime/web_view/js/src/util.ts +FILE: ../../../topaz/runtime/web_view/js/tsconfig.json +FILE: ../../../topaz/runtime/web_view/js/webpack.config.js FILE: ../../../topaz/runtime/web_view/schema_org_context.cpp FILE: ../../../topaz/shell/Armadillo.png FILE: ../../../topaz/shell/agents/home_work_agent/assets/1-portugal-the-man.jpeg @@ -1095,6 +956,7 @@ FILE: ../../../topaz/shell/docs/profiling.patch FILE: ../../../topaz/shell/docs/profiling.png FILE: ../../../topaz/shell/docs/timeline_settings.png FILE: ../../../topaz/shell/docs/vm.png +FILE: ../../../topaz/shell/ermine_user_shell/assets/launch_ermine_only.json FILE: ../../../topaz/shell/ermine_user_shell/config/ermine_user_shell.config FILE: ../../../topaz/shell/keyboard/lib/keyboard.dart FILE: ../../../topaz/shell/keyboard/lib/keys.dart @@ -1104,27 +966,21 @@ FILE: ../../../topaz/shell/keyboard/lib/res/Delete.png FILE: ../../../topaz/shell/keyboard/lib/res/Icon_Input_En.png FILE: ../../../topaz/shell/keyboard/lib/res/Space.png FILE: ../../../topaz/shell/keyboard/lib/word_suggestion_service.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/ArmadilloSilhouette.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/BlackHole.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/CapybaraSilhouette.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/Fuchsia_Logo_40dp_Accent.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/bg.jpg -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/fuchsia.png -FILE: ../../../topaz/shell/userpicker_device_shell/lib/res/screen_config.json FILE: ../../../topaz/shell/userpicker_device_shell/meta/sandbox FILE: ../../../topaz/shell/widgets/lib/default_bundle.dart FILE: ../../../topaz/shell/widgets/lib/key_mappings.dart FILE: ../../../topaz/shell/widgets/lib/three_column_aligned_layout_delegate.dart FILE: ../../../topaz/shell/widgets/lib/time_stringer.dart -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_0_bar_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_lock_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_lock_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_lock_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_lock_white_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_white_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_0_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_lock_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_lock_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_lock_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_lock_grey600_48dp.png +FILE: ../../../topaz/shell/wifi_settings/meta/manifest.json ---------------------------------------------------------------------------------------------------- Copyright 2016 The Fuchsia Authors. All rights reserved. @@ -1169,16 +1025,21 @@ FILE: ../../../topaz/app/chat/modules/conversation_info/lib/widgets.dart FILE: ../../../topaz/app/chat/packages/chat_models/lib/chat_models.dart FILE: ../../../topaz/app/color/lib/main.dart FILE: ../../../topaz/app/color/lib/src/color_model.dart +FILE: ../../../topaz/app/contacts/services/lib/client.dart +FILE: ../../../topaz/app/contacts/services/lib/src/contacts_content_provider_service_client.dart +FILE: ../../../topaz/app/documents/modules/browser/lib/src/models/browser_model.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/header.dart FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/multi_select_header.dart FILE: ../../../topaz/app/term/app.cc FILE: ../../../topaz/app/term/app.h FILE: ../../../topaz/app/term/pty_server.cc FILE: ../../../topaz/app/term/pty_server.h -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_progress.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/asset.dart +FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_progress_monitor.dart FILE: ../../../topaz/auth_providers/google/constants.h FILE: ../../../topaz/auth_providers/google/factory_impl.cc FILE: ../../../topaz/auth_providers/google/factory_impl.h +FILE: ../../../topaz/auth_providers/google/factory_impl_unittest.cc FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl.cc FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl.h FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl_unittest.cc @@ -1189,10 +1050,38 @@ FILE: ../../../topaz/auth_providers/oauth/oauth_request_builder_unittest.cc FILE: ../../../topaz/auth_providers/oauth/oauth_response.cc FILE: ../../../topaz/auth_providers/oauth/oauth_response.h FILE: ../../../topaz/auth_providers/oauth/oauth_response_unittest.cc +FILE: ../../../topaz/auth_providers/spotify/constants.h +FILE: ../../../topaz/auth_providers/spotify/factory_impl.cc +FILE: ../../../topaz/auth_providers/spotify/factory_impl.h +FILE: ../../../topaz/auth_providers/spotify/factory_impl_unittest.cc +FILE: ../../../topaz/auth_providers/spotify/main.cc +FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl.cc +FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl.h +FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl_unittest.cc +FILE: ../../../topaz/examples/fidl/echo_client_dart/lib/main.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/main.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/todo_module.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_item_widget.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_list_widget.dart +FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_widget.dart FILE: ../../../topaz/examples/mine_digger/main.dart +FILE: ../../../topaz/examples/ui/async_hello_mod/main.dart +FILE: ../../../topaz/examples/ui/hello_mod/main.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/codec.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/enum.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/error.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/message.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/struct.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/types.dart +FILE: ../../../topaz/public/dart/fidl/lib/src/union.dart FILE: ../../../topaz/public/dart/fuchsia/lib/src/fuchsia_fakes.dart +FILE: ../../../topaz/public/dart/logging/lib/src/frame_rate_tracer.dart +FILE: ../../../topaz/public/dart/sledge/lib/sledge.dart +FILE: ../../../topaz/public/dart/widgets/lib/src/model/tracing_spring_model.dart FILE: ../../../topaz/public/dart/widgets/lib/src/modular/dank_user_shell_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/maybe.dart +FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/conditional_builder.dart +FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/future_widget.dart +FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/shadowed_text.dart FILE: ../../../topaz/public/dart/zircon/lib/src/channel.dart FILE: ../../../topaz/public/dart/zircon/lib/src/channel_reader.dart FILE: ../../../topaz/public/dart/zircon/lib/src/constants.dart @@ -1204,25 +1093,76 @@ FILE: ../../../topaz/public/dart/zircon/lib/src/handle_wrapper.dart FILE: ../../../topaz/public/dart/zircon/lib/src/socket.dart FILE: ../../../topaz/public/dart/zircon/lib/src/socket_reader.dart FILE: ../../../topaz/public/dart/zircon/lib/src/vmo.dart +FILE: ../../../topaz/public/lib/app/dart/src/frame_rate_tracer.dart +FILE: ../../../topaz/public/lib/app_driver/dart/lib/app_driver.dart FILE: ../../../topaz/public/lib/app_driver/dart/lib/module_driver.dart -FILE: ../../../topaz/public/lib/fidl/dart/lib/src/bindings/codec2.dart +FILE: ../../../topaz/public/lib/app_driver/dart/lib/src/module_driver.dart +FILE: ../../../topaz/public/lib/component/dart/lib/src/component_context_client.dart +FILE: ../../../topaz/public/lib/entity/dart/lib/src/entity_resolver_client.dart FILE: ../../../topaz/public/lib/lifecycle/dart/lib/lifecycle.dart FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_host.dart FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_impl.dart +FILE: ../../../topaz/public/lib/media/flutter/media_progress.dart +FILE: ../../../topaz/public/lib/mod/dart/lib/mod.dart +FILE: ../../../topaz/public/lib/mod/dart/lib/src/mod.dart FILE: ../../../topaz/public/lib/module/dart/lib/src/module_context_client.dart +FILE: ../../../topaz/public/lib/module/dart/lib/src/module_controller_client.dart FILE: ../../../topaz/public/lib/module/dart/lib/src/module_host.dart FILE: ../../../topaz/public/lib/module/dart/lib/src/module_impl.dart FILE: ../../../topaz/public/lib/proposal/dart/lib/proposal.dart FILE: ../../../topaz/public/lib/proposal/dart/lib/src/proposal_factory.dart +FILE: ../../../topaz/public/lib/run_mod/dart/lib/run_mod.dart +FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/run_mod.dart +FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/widgets/mod_failure_widget.dart +FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/widgets/mod_loading_widget.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.color.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.contact.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.documents.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.intent.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.location.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.status.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/codelab.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/finance/finance_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/lyrics/lyrics_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/recipe/recipe_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/captions/captions_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/media.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/com/google/youtube/video_id_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_data.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/entity_codec.dart +FILE: ../../../topaz/public/lib/schemas/dart/lib/src/string_list_entity_codec.dart FILE: ../../../topaz/public/lib/story/dart/lib/src/link_client.dart FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_host.dart FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_impl.dart FILE: ../../../topaz/public/lib/user/dart/lib/src/dank_user_shell_impl.dart +FILE: ../../../topaz/public/lib/widgets/dart/lib/src/model/value_model.dart FILE: ../../../topaz/runtime/dart_runner/kernel/compiler.dart FILE: ../../../topaz/runtime/dart_runner/mapped_resource.cc FILE: ../../../topaz/runtime/dart_runner/mapped_resource.h FILE: ../../../topaz/runtime/dart_runner/service_isolate.cc FILE: ../../../topaz/runtime/dart_runner/service_isolate.h +FILE: ../../../topaz/runtime/dart_runner/vmservice/empty.dart +FILE: ../../../topaz/runtime/web_view/js/dist/bundle.js FILE: ../../../topaz/shell/armadillo/lib/src/now/wifi_settings.dart FILE: ../../../topaz/shell/ermine_user_shell/app.cc FILE: ../../../topaz/shell/ermine_user_shell/app.h @@ -1232,6 +1172,13 @@ FILE: ../../../topaz/shell/ermine_user_shell/tile.cc FILE: ../../../topaz/shell/ermine_user_shell/tile.h FILE: ../../../topaz/shell/ermine_user_shell/view_controller.cc FILE: ../../../topaz/shell/ermine_user_shell/view_controller.h +FILE: ../../../topaz/shell/mondrian_story_shell/lib/container_layout.dart +FILE: ../../../topaz/shell/mondrian_story_shell/lib/inset_manager.dart +FILE: ../../../topaz/shell/mondrian_story_shell/lib/pattern_layout.dart +FILE: ../../../topaz/shell/mondrian_story_shell/lib/positioned_surface.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_setup.dart +FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_setup_model.dart +FILE: ../../../topaz/shell/wifi_settings/lib/src/wlan_manager.dart ---------------------------------------------------------------------------------------------------- Copyright 2018 The Fuchsia Authors. All rights reserved. @@ -1262,42 +1209,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/app/maxwell/modules/resolution_failed/lib/src/stores.dart + ../../../topaz/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/app/maxwell/modules/resolution_failed/lib/src/stores.dart ----------------------------------------------------------------------------------------------------- -Copyright 2017, the Flutter project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: topaz ORIGIN: ../../../topaz/examples/ui/lib/type_converters.cc + ../../../LICENSE @@ -1430,11 +1341,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: topaz -ORIGIN: ../../../topaz/public/dart/fuchsia/lib/fuchsia.dart + ../../../LICENSE +ORIGIN: ../../../topaz/public/dart/fidl/lib/fidl.dart + ../../../LICENSE TYPE: LicenseType.bsd +FILE: ../../../topaz/public/dart/fidl/lib/fidl.dart FILE: ../../../topaz/public/dart/fuchsia/lib/fuchsia.dart +FILE: ../../../topaz/public/dart/logging/lib/logging.dart +FILE: ../../../topaz/public/dart/mozart/lib/mozart.dart FILE: ../../../topaz/public/dart/zircon/lib/src/fakes/zircon_fakes.dart FILE: ../../../topaz/public/dart/zircon/lib/zircon.dart +FILE: ../../../topaz/public/lib/app/dart/logging.dart +FILE: ../../../topaz/public/lib/widgets/dart/lib/model.dart ---------------------------------------------------------------------------------------------------- Copyright 2018 The Chromium Authors. All rights reserved. @@ -1537,4 +1453,4 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -Total license count: 12 +Total license count: 11 From d1d5497999fdfab94d4b7d5734b9bb5efa5dc700 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 15 May 2018 17:40:25 -0700 Subject: [PATCH 0339/1190] Drain any pending work on the IO thread before shutting down the platform view (#5272) iOS does not allow usage of OpenGL ES APIs when the app has been moved to the background. With this change, the shell will wait until pending IO thread tasks complete and the Skia unref queue is drained before proceeding with shutdown. See https://github.com/flutter/flutter/issues/17511 --- shell/common/shell.cc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 3359290f2198e..8f096d9a707a7 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -438,13 +438,23 @@ void Shell::OnPlatformViewDestroyed(const PlatformView& view) { fxl::AutoResetWaitableEvent latch; - auto gpu_task = [rasterizer = rasterizer_->GetWeakPtr(), &latch]() { + auto io_task = [io_manager = io_manager_.get(), &latch]() { + // Execute any pending Skia object deletions while GPU access is still + // allowed. + io_manager->GetSkiaUnrefQueue()->Drain(); + // Step 3: All done. Signal the latch that the platform thread is waiting + // on. + latch.Signal(); + }; + + auto gpu_task = [rasterizer = rasterizer_->GetWeakPtr(), + io_task_runner = task_runners_.GetIOTaskRunner(), + io_task]() { if (rasterizer) { rasterizer->Teardown(); } - // Step 2: All done. Signal the latch that the platform thread is waiting - // on. - latch.Signal(); + // Step 2: Next, tell the IO thread to complete its remaining work. + fml::TaskRunner::RunNowOrPostTask(io_task_runner, io_task); }; auto ui_task = [engine = engine_->GetWeakPtr(), From d6f0f2fe87cd15a78c3ea927d1a8bbce8cc87772 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 15 May 2018 21:30:56 -0400 Subject: [PATCH 0340/1190] Roll src/third_party/skia/ c8799aa92..5b8b472b3 (7 commits) (#5273) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 31 --------------------- travis/licenses_golden/licenses_third_party | 3 +- 3 files changed, 3 insertions(+), 33 deletions(-) diff --git a/DEPS b/DEPS index fa78e12f88512..1b90704c2b7d6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c8799aa92212400a11357d1c4ea6710e9ed8210d', + 'skia_revision': '5b8b472b3373b48b33a5fbf593df521657f8e5db', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 7d0e2c8a1deb1..f1320f9ac8bc6 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -10690,37 +10690,6 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -topaz - -Copyright 2017, the Flutter project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7c53f81cc8dde..81b81e7b04455 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1b192480901ca7233d44dac3da78293c +Signature: 1998b93408d933250385e3864d3b671b UNUSED LICENSES: @@ -17427,6 +17427,7 @@ FILE: ../../../third_party/skia/animations/redcross#1.jpg FILE: ../../../third_party/skia/animations/text#1.xml FILE: ../../../third_party/skia/bench/microbench.json FILE: ../../../third_party/skia/bench/skpbench.json +FILE: ../../../third_party/skia/docker/skiaserve/Dockerfile FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh From ff884db2af98b6f80565501d0003480b4df38267 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 16 May 2018 01:00:56 -0400 Subject: [PATCH 0341/1190] Roll src/third_party/skia/ 5b8b472b3..4c2a34e48 (1 commit) (#5274) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1b90704c2b7d6..0cb3facc991d2 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5b8b472b3373b48b33a5fbf593df521657f8e5db', + 'skia_revision': '4c2a34e4804e5affa8447b590578a359bad2caf8', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 81b81e7b04455..ed021dbc6e088 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1998b93408d933250385e3864d3b671b +Signature: 3f8b7e8e119b76116a9b1f49ea17ac90 UNUSED LICENSES: From 4dc01836f598dc8202bb8dfadb7b2d731156d0eb Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 16 May 2018 08:05:55 -0400 Subject: [PATCH 0342/1190] Roll src/third_party/skia/ 4c2a34e48..682c58da4 (1 commit) (#5276) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 0cb3facc991d2..72df7de0f91d6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4c2a34e4804e5affa8447b590578a359bad2caf8', + 'skia_revision': '682c58da482155213e8cd2834b57bc6541e510a0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ed021dbc6e088..12337b9bf7df1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3f8b7e8e119b76116a9b1f49ea17ac90 +Signature: c179535b831d6ece9372e5270883cbbb UNUSED LICENSES: From bbfe5935000fd003287b93c4986d1a185bfa4996 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Wed, 16 May 2018 07:29:20 -0700 Subject: [PATCH 0343/1190] Enable flutter service protocol rpcs to run on UI isolate. (#5263) With this change if flutter tools provides isolateId parameter, then VM will run the handler on that isolate. If no isolateId is provided, VM will continue running handlers as if they were registered wit Dart_RegisterRootServiceRequestCallback. This goes towards fixing https://github.com/flutter/flutter/issues/17434 --- runtime/service_protocol.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/service_protocol.cc b/runtime/service_protocol.cc index f2960d624dcb1..3994b78ef339d 100644 --- a/runtime/service_protocol.cc +++ b/runtime/service_protocol.cc @@ -63,7 +63,7 @@ void ServiceProtocol::RemoveHandler(Handler* handler) { void ServiceProtocol::ToggleHooks(bool set) { for (const auto& endpoint : endpoints_) { - Dart_RegisterRootServiceRequestCallback( + Dart_RegisterIsolateServiceRequestCallback( endpoint.data(), // method &ServiceProtocol::HandleMessage, // callback set ? this : nullptr // user data From c95d432689578ff745bfaa5866bb14b9b87df15b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 16 May 2018 11:37:19 -0400 Subject: [PATCH 0344/1190] Roll src/third_party/skia/ 682c58da4..02faa2b99 (10 commits) (#5277) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 72df7de0f91d6..b4ae8200a0d90 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '682c58da482155213e8cd2834b57bc6541e510a0', + 'skia_revision': '02faa2b9927478bc6853fdb1521a737da4a9cd69', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 12337b9bf7df1..42112030822b2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c179535b831d6ece9372e5270883cbbb +Signature: 3f9475673095e96aa089b6804b6d6dff UNUSED LICENSES: From 30c649dd74414f85fd6b74932e5c5027e0c4c96b Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 16 May 2018 10:09:53 -0700 Subject: [PATCH 0345/1190] [fuchsia] Teach engine how to set up an isolate from a list of kernel files. (#5210) --- common/settings.h | 1 + content_handler/application.cc | 1 + runtime/dart_isolate.cc | 38 ++++++++++---- runtime/dart_isolate.h | 3 +- shell/common/isolate_configuration.cc | 73 +++++++++++++++++++++++++++ shell/common/isolate_configuration.h | 3 ++ 6 files changed, 109 insertions(+), 10 deletions(-) diff --git a/common/settings.h b/common/settings.h index 7aa561f255f2f..7e55bf8e55d04 100644 --- a/common/settings.h +++ b/common/settings.h @@ -33,6 +33,7 @@ struct Settings { std::string application_library_path; std::string application_kernel_asset; + std::string application_kernel_list_asset; std::string main_dart_file_path; std::string packages_file_path; diff --git a/content_handler/application.cc b/content_handler/application.cc index cab1b6ceed461..a2fabf51213ad 100644 --- a/content_handler/application.cc +++ b/content_handler/application.cc @@ -138,6 +138,7 @@ Application::Application( settings_.script_snapshot_path = "snapshot_blob.bin"; settings_.application_kernel_asset = "kernel_blob.dill"; + settings_.application_kernel_list_asset = "app.dilplist"; settings_.log_tag = debug_label_ + std::string{"(flutter)"}; diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 91c91f4905d56..22ff724e18b35 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -273,7 +273,9 @@ bool DartIsolate::PrepareForRunningFromPrecompiledCode() { return true; } -static bool LoadScriptSnapshot(std::shared_ptr mapping) { +static bool LoadScriptSnapshot(std::shared_ptr mapping, + bool last_piece) { + FXL_CHECK(last_piece) << "Script snapshots cannot be divided"; if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), mapping->GetSize()))) { return false; @@ -281,27 +283,40 @@ static bool LoadScriptSnapshot(std::shared_ptr mapping) { return true; } -static bool LoadKernelSnapshot(std::shared_ptr mapping) { - if (tonic::LogIfError(Dart_LoadScriptFromKernel(mapping->GetMapping(), - mapping->GetSize()))) { +static bool LoadKernelSnapshot(std::shared_ptr mapping, + bool last_piece) { + Dart_Handle library = Dart_LoadLibraryFromKernel(mapping->GetMapping(), + mapping->GetSize()); + if (tonic::LogIfError(library)) { return false; } + if (!last_piece) { + // More to come. + return true; + } + + Dart_SetRootLibrary(library); + if (tonic::LogIfError(Dart_FinalizeLoading(false))) { + return false; + } return true; } -static bool LoadSnapshot(std::shared_ptr mapping) { +static bool LoadSnapshot(std::shared_ptr mapping, + bool last_piece) { if (Dart_IsKernel(mapping->GetMapping(), mapping->GetSize())) { - return LoadKernelSnapshot(std::move(mapping)); + return LoadKernelSnapshot(std::move(mapping), last_piece); } else { - return LoadScriptSnapshot(std::move(mapping)); + return LoadScriptSnapshot(std::move(mapping), last_piece); } return false; } FXL_WARN_UNUSED_RESULT bool DartIsolate::PrepareForRunningFromSnapshot( - std::shared_ptr mapping) { + std::shared_ptr mapping, + bool last_piece) { TRACE_EVENT0("flutter", "DartIsolate::PrepareForRunningFromSnapshot"); if (phase_ != Phase::LibrariesSetup) { return false; @@ -321,10 +336,15 @@ bool DartIsolate::PrepareForRunningFromSnapshot( return false; } - if (!LoadSnapshot(mapping)) { + if (!LoadSnapshot(mapping, last_piece)) { return false; } + if (!last_piece) { + // More to come. + return true; + } + if (Dart_IsNull(Dart_RootLibrary())) { return false; } diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index 60a8dcdcd6191..0999d2f6f4f8f 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -67,7 +67,8 @@ class DartIsolate : public UIDartState { FXL_WARN_UNUSED_RESULT bool PrepareForRunningFromSnapshot( - std::shared_ptr snapshot); + std::shared_ptr snapshot, + bool last_piece = true); FXL_WARN_UNUSED_RESULT bool PrepareForRunningFromSource(const std::string& main_source_file, diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc index 3c634022a348f..eaf89b6ce333a 100644 --- a/shell/common/isolate_configuration.cc +++ b/shell/common/isolate_configuration.cc @@ -88,6 +88,35 @@ class SourceIsolateConfiguration final : public IsolateConfiguration { FXL_DISALLOW_COPY_AND_ASSIGN(SourceIsolateConfiguration); }; +class KernelListIsolateConfiguration final : public IsolateConfiguration { + public: + KernelListIsolateConfiguration( + std::vector> kernel_pieces) + : kernel_pieces_(std::move(kernel_pieces)) {} + + // |shell::IsolateConfiguration| + bool DoPrepareIsolate(blink::DartIsolate& isolate) override { + if (blink::DartVM::IsRunningPrecompiledCode()) { + return false; + } + + for (size_t i = 0; i < kernel_pieces_.size(); i++) { + bool last_piece = i + 1 == kernel_pieces_.size(); + if (!isolate.PrepareForRunningFromSnapshot(std::move(kernel_pieces_[i]), + last_piece)) { + return false; + } + } + + return true; + } + + private: + std::vector> kernel_pieces_; + + FXL_DISALLOW_COPY_AND_ASSIGN(KernelListIsolateConfiguration); +}; + std::unique_ptr IsolateConfiguration::InferFromSettings( const blink::Settings& settings, fxl::RefPtr asset_manager) { @@ -107,6 +136,7 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( // Running from kernel snapshot. { + // TODO(engine): Add AssetManager::GetAsMapping or such to avoid the copy. std::vector kernel; if (asset_manager && asset_manager->GetAsBuffer( settings.application_kernel_asset, &kernel)) { @@ -117,6 +147,7 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( // Running from script snapshot. { + // TODO(engine): Add AssetManager::GetAsMapping or such to avoid the copy. std::vector script_snapshot; if (asset_manager && asset_manager->GetAsBuffer( settings.script_snapshot_path, &script_snapshot)) { @@ -125,6 +156,42 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( } } + // Running from kernel divided into several pieces (for sharing). + { + // TODO(fuchsia): Add AssetManager::GetAsMapping or such to avoid the copy. + // TODO(fuchsia): Use async blobfs API once it becomes available. + std::vector kernel_list; + if (asset_manager && + asset_manager->GetAsBuffer(settings.application_kernel_list_asset, + &kernel_list)) { + std::vector> kernel_pieces; + + size_t piece_path_start = 0; + while (piece_path_start < kernel_list.size()) { + size_t piece_path_end = piece_path_start; + while ((piece_path_end < kernel_list.size()) && + (kernel_list[piece_path_end] != '\n')) { + piece_path_end++; + } + + std::string piece_path(reinterpret_cast(&kernel_list[piece_path_start]), + piece_path_end - piece_path_start); + std::vector piece; + if (!asset_manager->GetAsBuffer(piece_path, &piece)) { + FXL_LOG(ERROR) << "Failed to load: " << piece_path; + return nullptr; + } + + kernel_pieces.emplace_back( + std::make_unique(std::move(piece))); + + piece_path_start = piece_path_end + 1; + } + + return CreateForKernelList(std::move(kernel_pieces)); + } + } + return nullptr; } @@ -145,4 +212,10 @@ std::unique_ptr IsolateConfiguration::CreateForSource( std::move(packages_path)); } +std::unique_ptr IsolateConfiguration::CreateForKernelList( + std::vector> kernel_pieces) { + return std::make_unique( + std::move(kernel_pieces)); +} + } // namespace shell diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h index 82d06dac621b2..67494407bbe6e 100644 --- a/shell/common/isolate_configuration.h +++ b/shell/common/isolate_configuration.h @@ -33,6 +33,9 @@ class IsolateConfiguration { std::string main_path, std::string packages_path); + static std::unique_ptr CreateForKernelList( + std::vector> kernel_pieces); + IsolateConfiguration(); virtual ~IsolateConfiguration(); From f218099f7c5078629bac48cdcc215896c368a0df Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 16 May 2018 15:07:19 -0400 Subject: [PATCH 0346/1190] Roll src/third_party/skia/ 02faa2b99..94f585ed0 (8 commits) (#5280) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b4ae8200a0d90..09360f1bc967f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '02faa2b9927478bc6853fdb1521a737da4a9cd69', + 'skia_revision': '94f585ed091e252cd3cc741b19c8a226fe4a5eec', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 42112030822b2..aeb4161193484 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3f9475673095e96aa089b6804b6d6dff +Signature: 6b402c42e1de2d029b9bf59b9d6600ce UNUSED LICENSES: @@ -17328,6 +17328,8 @@ FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp FILE: ../../../third_party/skia/third_party/skcms/skcms.c FILE: ../../../third_party/skia/third_party/skcms/skcms.h +FILE: ../../../third_party/skia/third_party/skcms/src/Curve.c +FILE: ../../../third_party/skia/third_party/skcms/src/Curve.h FILE: ../../../third_party/skia/third_party/skcms/src/GaussNewton.c FILE: ../../../third_party/skia/third_party/skcms/src/GaussNewton.h FILE: ../../../third_party/skia/third_party/skcms/src/ICCProfile.c From a7b44d4ab0790c7d50e914307563529275f67aed Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 16 May 2018 13:12:56 -0700 Subject: [PATCH 0347/1190] Only send a11y events if a11y is turned on (#5281) --- .../platform/android/io/flutter/view/AccessibilityBridge.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index f88b0c31c1153..f422a5f7a39ec 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -679,7 +679,7 @@ public void onMessage(Object message, BasicMessageChannel.Reply reply) { case "tooltip": { AccessibilityEvent e = obtainAccessibilityEvent(ROOT_NODE_ID, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); e.getText().add((String) data.get("message")); - mOwner.getParent().requestSendAccessibilityEvent(mOwner, e); + sendAccessibilityEvent(e); } default: assert false; @@ -690,7 +690,7 @@ private void createWindowChangeEvent(SemanticsObject route) { AccessibilityEvent e = obtainAccessibilityEvent(route.id, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); String routeName = route.getRouteName(); e.getText().add(routeName); - mOwner.getParent().requestSendAccessibilityEvent(mOwner, e); + sendAccessibilityEvent(e); } private void willRemoveSemanticsObject(SemanticsObject object) { From 8862465855df2bee755b763411401fcb84712811 Mon Sep 17 00:00:00 2001 From: "P.Y. Laligand" Date: Wed, 16 May 2018 13:16:13 -0700 Subject: [PATCH 0348/1190] [fuchsia] Update FIDL include paths. (#5279) --- content_handler/accessibility_bridge.h | 2 +- content_handler/application.h | 6 +++--- content_handler/application_runner.h | 2 +- content_handler/compositor_context.h | 2 +- content_handler/engine.h | 4 ++-- content_handler/fuchsia_font_manager.h | 2 +- content_handler/isolate_configurator.h | 6 +++--- content_handler/platform_view.h | 8 ++++---- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h index 059baec0f5c99..b209342c662f3 100644 --- a/content_handler/accessibility_bridge.h +++ b/content_handler/accessibility_bridge.h @@ -6,7 +6,7 @@ #include -#include +#include #include "flutter/lib/ui/semantics/semantics_node.h" #include "lib/fxl/macros.h" diff --git a/content_handler/application.h b/content_handler/application.h index 8c958ef8d2f4f..f6c1dfde4101c 100644 --- a/content_handler/application.h +++ b/content_handler/application.h @@ -8,9 +8,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "engine.h" #include "flutter/common/settings.h" diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h index e83aca58ba9b3..302d3c685a345 100644 --- a/content_handler/application_runner.h +++ b/content_handler/application_runner.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include "application.h" #include "lib/app/cpp/application_context.h" diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h index 9a7b66e995bcc..b59c010387b9c 100644 --- a/content_handler/compositor_context.h +++ b/content_handler/compositor_context.h @@ -4,7 +4,7 @@ #pragma once -#include +#include #include "flutter/flow/compositor_context.h" #include "lib/fxl/macros.h" diff --git a/content_handler/engine.h b/content_handler/engine.h index 747246ff01a7c..24d942bba8d3a 100644 --- a/content_handler/engine.h +++ b/content_handler/engine.h @@ -4,8 +4,8 @@ #pragma once -#include -#include +#include +#include #include #include "flutter/shell/common/shell.h" diff --git a/content_handler/fuchsia_font_manager.h b/content_handler/fuchsia_font_manager.h index 974ed2c72a423..266ac639fc983 100644 --- a/content_handler/fuchsia_font_manager.h +++ b/content_handler/fuchsia_font_manager.h @@ -17,7 +17,7 @@ #ifndef TXT_FUCHSIA_FONT_MANAGER_H_ #define TXT_FUCHSIA_FONT_MANAGER_H_ -#include +#include #include #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkStream.h" diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h index dc6995185e4fd..c5e4aa3b2df9b 100644 --- a/content_handler/isolate_configurator.h +++ b/content_handler/isolate_configurator.h @@ -4,9 +4,9 @@ #pragma once -#include -#include -#include +#include +#include +#include #include "lib/fxl/macros.h" #include "lib/ui/flutter/sdk_ext/src/natives.h" diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h index 00c9ad0cf1d5f..fde06eaf5b59f 100644 --- a/content_handler/platform_view.h +++ b/content_handler/platform_view.h @@ -7,10 +7,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "accessibility_bridge.h" #include "flutter/lib/ui/window/viewport_metrics.h" From 4374ccc1be46f0f5e0d86b44a76cc3e1f1af8bb0 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 16 May 2018 13:45:26 -0700 Subject: [PATCH 0349/1190] Roll Dart to 43635d3372253262cbf51e55b2ccfceae4f94682. (#5282) --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index 09360f1bc967f..b823c149dc168 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'a5c11d7d0329432ca37e35bb249b20f60aa0aa31', + 'dart_revision': '43635d3372253262cbf51e55b2ccfceae4f94682', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index aeb4161193484..163578c8956de 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6b402c42e1de2d029b9bf59b9d6600ce +Signature: 09721866f40c1cfe2dd93f06b836ecf4 UNUSED LICENSES: @@ -4781,13 +4781,11 @@ FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/constant_map.da FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/core_patch.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/foreign_helper.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/interceptors.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_array.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_number.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_string.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/math_patch.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/mirrors_patch.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/mirrors_patch_cfe.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/native_helper.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/regexp_helper.dart @@ -5858,7 +5856,6 @@ FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/convert_patch.d FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/internal_patch.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/io_patch.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_helper.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_names.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_primitives.dart FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/js_rti.dart From cdd7e0887d312096465ad261aac701adf1f2f1c2 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 16 May 2018 18:37:56 -0400 Subject: [PATCH 0350/1190] Roll src/third_party/skia/ 94f585ed0..05da1c16d (9 commits; 1 trivial rolls) (#5283) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b823c149dc168..47f3807fe8a6e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '94f585ed091e252cd3cc741b19c8a226fe4a5eec', + 'skia_revision': '05da1c16dfb4a8117451124fe7474fdffcac46d8', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 163578c8956de..791a32a7c45ad 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 09721866f40c1cfe2dd93f06b836ecf4 +Signature: c1d8312a414ac65eb80364366b95d9d9 UNUSED LICENSES: From 919e8c211f518f17dbd298d9f8e39091b9e3897f Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 16 May 2018 19:27:44 -0400 Subject: [PATCH 0351/1190] Support for TwoPointConical gradients (#5275) --- lib/ui/painting.dart | 25 ++++++++++++++++++++++--- lib/ui/painting/gradient.cc | 32 +++++++++++++++++++++++++++++++- lib/ui/painting/gradient.h | 11 +++++++++++ 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index bef7068f44df9..37ec17908e63e 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2296,25 +2296,44 @@ class Gradient extends Shader { /// If `matrix4` is provided, the gradient fill will be transformed by the /// specified 4x4 matrix relative to the local coordinate system. `matrix4` must /// be a column-major matrix packed into a list of 16 values. + /// + /// If `focal` is provided and not equal to `center` or `focalRadius` is + /// provided and not equal to 0.0, the generated shader will be a two point + /// conical radial gradient, with `focal` being the center of the focal + /// circle and `focalRadius` being the radius of that circle. If `focal` is + /// provided and not equal to `center`, at least one of the two offsets must + /// not be equal to [Offset.zero]. Gradient.radial( Offset center, double radius, List colors, [ List colorStops, TileMode tileMode = TileMode.clamp, - Float64List matrix4 + Float64List matrix4, + Offset focal, + double focalRadius ]) : assert(_offsetIsValid(center)), assert(colors != null), assert(tileMode != null), assert(matrix4 == null || _matrix4IsValid(matrix4)), super._() { + focal ??= center; + focalRadius ??= 0.0; _validateColorStops(colors, colorStops); final Int32List colorsBuffer = _encodeColorList(colors); final Float32List colorStopsBuffer = colorStops == null ? null : new Float32List.fromList(colorStops); - _constructor(); - _initRadial(center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); + + if (center == focal && focalRadius != 0.0) { + _constructor(); + _initRadial(center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); + } else { + assert(center != Offset.zero || focal != Offset.zero); // will result in nullptr in Skia side + _constructor(); + _initConical(focal.dx, focal.dy, focalRadius, center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); + } } void _initRadial(double centerX, double centerY, double radius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initRadial'; + void _initConical(double startX, double startY, double startRadius, double endX, double endY, double endRadius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initTwoPointConical'; /// Creates a sweep gradient centered at `center` that starts at `startAngle` /// and ends at `endAngle`. diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 9cbf5a19c5275..71b2669100fa1 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -25,7 +25,8 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Gradient); #define FOR_EACH_BINDING(V) \ V(Gradient, initLinear) \ V(Gradient, initRadial) \ - V(Gradient, initSweep) + V(Gradient, initSweep) \ + V(Gradient, initTwoPointConical) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -109,6 +110,35 @@ void CanvasGradient::initSweep(double center_x, has_matrix ? &sk_matrix : nullptr))); } +void CanvasGradient::initTwoPointConical(double start_x, + double start_y, + double start_radius, + double end_x, + double end_y, + double end_radius, + const tonic::Int32List& colors, + const tonic::Float32List& color_stops, + SkShader::TileMode tile_mode, + const tonic::Float64List& matrix4) { + FXL_DCHECK(colors.num_elements() == color_stops.num_elements() || + color_stops.data() == nullptr); + + static_assert(sizeof(SkColor) == sizeof(int32_t), + "SkColor doesn't use int32_t."); + + SkMatrix sk_matrix; + bool has_matrix = matrix4.data() != nullptr; + if (has_matrix) { + sk_matrix = ToSkMatrix(matrix4); + } + + set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeTwoPointConical( + SkPoint::Make(start_x, start_y), start_radius, + SkPoint::Make(end_x, end_y), end_radius, + reinterpret_cast(colors.data()), color_stops.data(), + colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr))); +} + CanvasGradient::CanvasGradient() = default; CanvasGradient::~CanvasGradient() = default; diff --git a/lib/ui/painting/gradient.h b/lib/ui/painting/gradient.h index 178c17fe9b41c..4d8e8ec09191b 100644 --- a/lib/ui/painting/gradient.h +++ b/lib/ui/painting/gradient.h @@ -52,6 +52,17 @@ class CanvasGradient : public Shader { double end_angle, const tonic::Float64List& matrix4); + void initTwoPointConical(double start_x, + double start_y, + double start_radius, + double end_x, + double end_y, + double end_radius, + const tonic::Int32List& colors, + const tonic::Float32List& color_stops, + SkShader::TileMode tile_mode, + const tonic::Float64List& matrix4); + static void RegisterNatives(tonic::DartLibraryNatives* natives); private: From 5cbfa959326a2f4bfa5f55ca0f3b4b3e823c5e43 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 16 May 2018 22:07:19 -0400 Subject: [PATCH 0352/1190] Roll src/third_party/skia/ 05da1c16d..ed4921b9d (1 commit) (#5284) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 47f3807fe8a6e..87a797197d843 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '05da1c16dfb4a8117451124fe7474fdffcac46d8', + 'skia_revision': 'ed4921b9d4734dab53f514a7df7172b62b9d7824', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 791a32a7c45ad..c7e8f6d6c2abb 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c1d8312a414ac65eb80364366b95d9d9 +Signature: 6190ea9c047665e684d7d2027a5627ee UNUSED LICENSES: From 8c9558b1f5df5b849ff70ef7e27b562e377b78f0 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 17 May 2018 03:13:56 -0400 Subject: [PATCH 0353/1190] Roll src/third_party/skia/ ed4921b9d..15f1761d9 (1 commit) (#5285) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 87a797197d843..33faf3553c14d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ed4921b9d4734dab53f514a7df7172b62b9d7824', + 'skia_revision': '15f1761d9e8f7ff30295030e2575cd7abbb1b297', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c7e8f6d6c2abb..7c657665d2b2f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6190ea9c047665e684d7d2027a5627ee +Signature: 95ac8aeee21575e2baf0f724344ea6ee UNUSED LICENSES: From bb1736b7b1b974479db41ac94b13ce95942d87ed Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 17 May 2018 06:43:56 -0400 Subject: [PATCH 0354/1190] Roll src/third_party/skia/ 15f1761d9..bd74e6a02 (1 commit; 1 trivial rolls) (#5286) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 33faf3553c14d..7dadfdbab5695 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '15f1761d9e8f7ff30295030e2575cd7abbb1b297', + 'skia_revision': 'bd74e6a02ae0e7b031aa1d1cd73062dba2c93daf', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7c657665d2b2f..d00a3cf677800 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 95ac8aeee21575e2baf0f724344ea6ee +Signature: 3bb50664621584c91b765615c3d32ae1 UNUSED LICENSES: From ef0915c106c9b1c70922675262330c8cac4f2852 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Thu, 17 May 2018 07:02:28 -0400 Subject: [PATCH 0355/1190] update docs for Path.getBounds (#5261) * update docs for getBounds * Add computeMetrics suggestion * better explanation --- lib/ui/painting.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 37ec17908e63e..66419b7081643 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1792,6 +1792,20 @@ class Path extends NativeFieldWrapperClass2 { Path _transform(Float64List matrix4) native 'Path_transform'; /// Computes the bounding rectangle for this path. + /// + /// A path containing only axis-aligned points on the same straight line will + /// have no area, and therefore `Rect.isEmpty` will return true for such a + /// path. Consider checking `rect.width + rect.height > 0.0` instead, or + /// using the [computeMetrics] API to check the path length. + /// + /// For many more elaborate paths, the bounds may be inaccurate. For example, + /// when a path contains a circle, the points used to compute the bounds are + /// the circle's implied control points, which form a square around the circle; + /// if the circle has a transformation applied using [transform] then that + /// square is rotated, and the (axis-aligned, non-rotated) bounding box + /// therefore ends up grossly overestimating the actual area covered by the + /// circle. + // see https://skia.org/user/api/SkPath_Reference#SkPath_getBounds Rect getBounds() { final Float32List rect = _getBounds(); return new Rect.fromLTRB(rect[0], rect[1], rect[2], rect[3]); From 597fa9ed454a8291f5b09978ac821ba316d7c5a0 Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Thu, 17 May 2018 13:13:22 +0200 Subject: [PATCH 0356/1190] Delegate AppDelegate life-cycle callbacks to plugins via separate object (#5173) * Move the handling of delegating AppDelegate callback out of FlutterAppDelegate. Also moves the plugin registry to FlutterViewController. So each view-controller will handle its own plugins. This is intended to simplify including one or more Flutter views in an existing iOS app and giving more precise control of plugin registration. Fixes: https://github.com/flutter/flutter/issues/16539 * formatting * Update license golden file --- shell/platform/darwin/ios/BUILD.gn | 2 + .../darwin/ios/framework/Headers/Flutter.h | 1 + .../framework/Headers/FlutterAppDelegate.h | 14 +- .../ios/framework/Headers/FlutterPlugin.h | 8 + .../FlutterPluginAppLifeCycleDelegate.h | 135 +++++++++ .../framework/Headers/FlutterViewController.h | 5 +- .../framework/Source/FlutterAppDelegate.mm | 253 +++------------- .../FlutterPluginAppLifeCycleDelegate.mm | 278 ++++++++++++++++++ .../framework/Source/FlutterViewController.mm | 87 ++++++ travis/licenses_golden/licenses_flutter | 2 + 10 files changed, 566 insertions(+), 219 deletions(-) create mode 100644 shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 19d2486a69fa4..41793e0c67d40 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -22,6 +22,7 @@ _flutter_framework_headers = [ "framework/Headers/FlutterMacros.h", "framework/Headers/FlutterNavigationController.h", "framework/Headers/FlutterPlugin.h", + "framework/Headers/FlutterPluginAppLifeCycleDelegate.h", "framework/Headers/FlutterTexture.h", "framework/Headers/FlutterViewController.h", ] @@ -43,6 +44,7 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterNavigationController.mm", "framework/Source/FlutterPlatformPlugin.h", "framework/Source/FlutterPlatformPlugin.mm", + "framework/Source/FlutterPluginAppLifeCycleDelegate.mm", "framework/Source/FlutterStandardCodec.mm", "framework/Source/FlutterStandardCodec_Internal.h", "framework/Source/FlutterTextInputDelegate.h", diff --git a/shell/platform/darwin/ios/framework/Headers/Flutter.h b/shell/platform/darwin/ios/framework/Headers/Flutter.h index 939040c8e5dfd..d850854f2f517 100644 --- a/shell/platform/darwin/ios/framework/Headers/Flutter.h +++ b/shell/platform/darwin/ios/framework/Headers/Flutter.h @@ -43,6 +43,7 @@ #include "FlutterMacros.h" #include "FlutterNavigationController.h" #include "FlutterPlugin.h" +#include "FlutterPluginAppLifeCycleDelegate.h" #include "FlutterTexture.h" #include "FlutterViewController.h" diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h b/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h index 4f28e70b65fc5..f175ea2925826 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h @@ -24,22 +24,10 @@ * code as necessary from FlutterAppDelegate.mm. */ FLUTTER_EXPORT -@interface FlutterAppDelegate : UIResponder +@interface FlutterAppDelegate : UIResponder @property(strong, nonatomic) UIWindow* window; -// Can be overriden by subclasses to provide a custom FlutterBinaryMessenger, -// typically a FlutterViewController, for plugin interop. -// -// Defaults to window's rootViewController. -- (NSObject*)binaryMessenger; - -// Can be overriden by subclasses to provide a custom FlutterTextureRegistry, -// typically a FlutterViewController, for plugin interop. -// -// Defaults to window's rootViewController. -- (NSObject*)textures; - @end #endif // FLUTTER_FLUTTERDARTPROJECT_H_ diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index 646ffa30d74fd..46bee66f99dd5 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -253,6 +253,14 @@ NS_ASSUME_NONNULL_BEGIN - (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey; @end +/** + Implement this in the `UIAppDelegate` of your app to enable Flutter plugins to register themselves to the application + life cycle events. +*/ +@protocol FlutterAppLifeCycleProvider +- (void)addApplicationLifeCycleDelegate:(NSObject*)delegate; +@end + NS_ASSUME_NONNULL_END; #endif // FLUTTER_FLUTTERPLUGIN_H_ diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h b/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h new file mode 100644 index 0000000000000..676ef6f476d0b --- /dev/null +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h @@ -0,0 +1,135 @@ +// 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. + +#ifndef FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ +#define FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ + +#include "FlutterPlugin.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + Propagates `UIAppDelegate` callbacks to registered plugins. +*/ +FLUTTER_EXPORT +@interface FlutterPluginAppLifeCycleDelegate : NSObject +/** + Registers `delegate` to receive life cycle callbacks via this FlutterPluginAppLifecycleDelegate as long as it is alive. + + `delegate` will only referenced weakly. +*/ +- (void)addDelegate:(NSObject*)delegate; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + + - Returns: `NO` if any plugin vetoes application launch. + */ +- (BOOL)application:(UIApplication*)application + didFinishLaunchingWithOptions:(NSDictionary*)launchOptions; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationDidBecomeActive:(UIApplication*)application; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationWillResignActive:(UIApplication*)application; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationDidEnterBackground:(UIApplication*)application; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationWillEnterForeground:(UIApplication*)application; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationWillTerminate:(UIApplication*)application; + +/** + Called if this plugin has been registered for `UIApplicationDelegate` callbacks. + */ +- (void)application:(UIApplication*)application + didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)application:(UIApplication*)application + didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)application:(UIApplication*)application + didReceiveRemoteNotification:(NSDictionary*)userInfo + fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. +*/ +- (BOOL)application:(UIApplication*)application + openURL:(NSURL*)url + options:(NSDictionary*)options; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. + */ +- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. +*/ +- (BOOL)application:(UIApplication*)application + openURL:(NSURL*)url + sourceApplication:(NSString*)sourceApplication + annotation:(id)annotation; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. +*/ +- (void)application:(UIApplication*)application + performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem + completionHandler:(void (^)(BOOL succeeded))completionHandler + API_AVAILABLE(ios(9.0)); + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. +*/ +- (BOOL)application:(UIApplication*)application + handleEventsForBackgroundURLSession:(nonnull NSString*)identifier + completionHandler:(nonnull void (^)())completionHandler; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. +*/ +- (BOOL)application:(UIApplication*)application + performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; +@end + +NS_ASSUME_NONNULL_END + +#endif // FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ \ No newline at end of file diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h b/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h index 7ef6868a27632..524890ca2c05f 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h @@ -11,10 +11,11 @@ #include "FlutterBinaryMessenger.h" #include "FlutterDartProject.h" #include "FlutterMacros.h" +#include "FlutterPlugin.h" #include "FlutterTexture.h" FLUTTER_EXPORT -@interface FlutterViewController : UIViewController +@interface FlutterViewController : UIViewController - (instancetype)initWithProject:(FlutterDartProject*)project nibName:(NSString*)nibNameOrNil @@ -49,6 +50,8 @@ FLUTTER_EXPORT */ - (void)setInitialRoute:(NSString*)route; +- (id)pluginRegistry; + @end #endif // FLUTTER_FLUTTERVIEWCONTROLLER_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index a5132bf4ee4e0..b175966f3dbab 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -3,46 +3,28 @@ // found in the LICENSE file. #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" -#include "lib/fxl/logging.h" - -@interface FlutterAppDelegate () -@property(readonly, nonatomic) NSMutableArray* pluginDelegates; -@property(readonly, nonatomic) NSMutableDictionary* pluginPublications; -@end - -@interface FlutterAppDelegateRegistrar : NSObject -- (instancetype)initWithPlugin:(NSString*)pluginKey appDelegate:(FlutterAppDelegate*)delegate; -@end @implementation FlutterAppDelegate { - UIBackgroundTaskIdentifier _debugBackgroundTask; + FlutterPluginAppLifeCycleDelegate* _lifeCycleDelegate; } - (instancetype)init { if (self = [super init]) { - _pluginDelegates = [NSMutableArray new]; - _pluginPublications = [NSMutableDictionary new]; + _lifeCycleDelegate = [[FlutterPluginAppLifeCycleDelegate alloc] init]; } return self; } - (void)dealloc { - [_pluginDelegates release]; - [_pluginPublications release]; + [_lifeCycleDelegate release]; [super dealloc]; } - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if (![plugin application:application didFinishLaunchingWithOptions:launchOptions]) { - return NO; - } - } - } - return YES; + return [_lifeCycleDelegate application:application didFinishLaunchingWithOptions:launchOptions]; } // Returns the key window's rootViewController, if it's a FlutterViewController. @@ -65,257 +47,118 @@ - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { } - (void)applicationDidEnterBackground:(UIApplication*)application { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - // The following keeps the Flutter session alive when the device screen locks - // in debug mode. It allows continued use of features like hot reload and - // taking screenshots once the device unlocks again. - // - // Note the name is not an identifier and multiple instances can exist. - _debugBackgroundTask = [application - beginBackgroundTaskWithName:@"Flutter debug task" - expirationHandler:^{ - FXL_LOG(WARNING) - << "\nThe OS has terminated the Flutter debug connection for being " - "inactive in the background for too long.\n\n" - "There are no errors with your Flutter application.\n\n" - "To reconnect, launch your application again via 'flutter run'"; - }]; -#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationDidEnterBackground:application]; - } - } + [_lifeCycleDelegate applicationDidEnterBackground:application]; } - (void)applicationWillEnterForeground:(UIApplication*)application { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - [application endBackgroundTask:_debugBackgroundTask]; -#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationWillEnterForeground:application]; - } - } + [_lifeCycleDelegate applicationWillEnterForeground:application]; } - (void)applicationWillResignActive:(UIApplication*)application { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationWillResignActive:application]; - } - } + [_lifeCycleDelegate applicationWillResignActive:application]; } - (void)applicationDidBecomeActive:(UIApplication*)application { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationDidBecomeActive:application]; - } - } + [_lifeCycleDelegate applicationDidBecomeActive:application]; } - (void)applicationWillTerminate:(UIApplication*)application { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationWillTerminate:application]; - } - } + [_lifeCycleDelegate applicationWillTerminate:application]; } - (void)application:(UIApplication*)application didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin application:application didRegisterUserNotificationSettings:notificationSettings]; - } - } + [_lifeCycleDelegate application:application + didRegisterUserNotificationSettings:notificationSettings]; } - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; - } - } + [_lifeCycleDelegate application:application + didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } - (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - didReceiveRemoteNotification:userInfo - fetchCompletionHandler:completionHandler]) { - return; - } - } - } + [_lifeCycleDelegate application:application + didReceiveRemoteNotification:userInfo + fetchCompletionHandler:completionHandler]; } - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url options:(NSDictionary*)options { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application openURL:url options:options]) { - return YES; - } - } - } - return NO; + return [_lifeCycleDelegate application:application openURL:url options:options]; } - (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application handleOpenURL:url]) { - return YES; - } - } - } - return NO; + return [_lifeCycleDelegate application:application handleOpenURL:url]; } - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - openURL:url - sourceApplication:sourceApplication - annotation:annotation]) { - return YES; - } - } - } - return NO; + return [_lifeCycleDelegate application:application + openURL:url + sourceApplication:sourceApplication + annotation:annotation]; } - (void)application:(UIApplication*)application performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem completionHandler:(void (^)(BOOL succeeded))completionHandler NS_AVAILABLE_IOS(9_0) { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - performActionForShortcutItem:shortcutItem - completionHandler:completionHandler]) { - return; - } - } - } + [_lifeCycleDelegate application:application + performActionForShortcutItem:shortcutItem + completionHandler:completionHandler]; } - (void)application:(UIApplication*)application handleEventsForBackgroundURLSession:(nonnull NSString*)identifier completionHandler:(nonnull void (^)())completionHandler { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - handleEventsForBackgroundURLSession:identifier - completionHandler:completionHandler]) { - return; - } - } - } + [_lifeCycleDelegate application:application + handleEventsForBackgroundURLSession:identifier + completionHandler:completionHandler]; } - (void)application:(UIApplication*)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application performFetchWithCompletionHandler:completionHandler]) { - return; - } - } - } + [_lifeCycleDelegate application:application performFetchWithCompletionHandler:completionHandler]; } -// TODO(xster): move when doing https://github.com/flutter/flutter/issues/3671. -- (NSObject*)binaryMessenger { +#pragma mark - FlutterPluginRegistry methods. All delegating to the rootViewController + +- (NSObject*)registrarForPlugin:(NSString*)pluginKey { UIViewController* rootViewController = _window.rootViewController; - if ([rootViewController conformsToProtocol:@protocol(FlutterBinaryMessenger)]) { - return (NSObject*)rootViewController; + if ([rootViewController isKindOfClass:[FlutterViewController class]]) { + return + [[(FlutterViewController*)rootViewController pluginRegistry] registrarForPlugin:pluginKey]; } return nil; } -- (NSObject*)textures { +- (BOOL)hasPlugin:(NSString*)pluginKey { UIViewController* rootViewController = _window.rootViewController; - if ([rootViewController conformsToProtocol:@protocol(FlutterTextureRegistry)]) { - return (NSObject*)rootViewController; + if ([rootViewController isKindOfClass:[FlutterViewController class]]) { + return [[(FlutterViewController*)rootViewController pluginRegistry] hasPlugin:pluginKey]; } return nil; } -- (NSObject*)registrarForPlugin:(NSString*)pluginKey { - NSAssert(self.pluginPublications[pluginKey] == nil, @"Duplicate plugin key: %@", pluginKey); - self.pluginPublications[pluginKey] = [NSNull null]; - return - [[[FlutterAppDelegateRegistrar alloc] initWithPlugin:pluginKey appDelegate:self] autorelease]; -} - -- (BOOL)hasPlugin:(NSString*)pluginKey { - return _pluginPublications[pluginKey] != nil; -} - - (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey { - return _pluginPublications[pluginKey]; -} -@end - -@implementation FlutterAppDelegateRegistrar { - NSString* _pluginKey; - FlutterAppDelegate* _appDelegate; -} - -- (instancetype)initWithPlugin:(NSString*)pluginKey appDelegate:(FlutterAppDelegate*)appDelegate { - self = [super init]; - NSAssert(self, @"Super init cannot be nil"); - _pluginKey = [pluginKey retain]; - _appDelegate = [appDelegate retain]; - return self; -} - -- (void)dealloc { - [_pluginKey release]; - [_appDelegate release]; - [super dealloc]; -} - -- (NSObject*)messenger { - return [_appDelegate binaryMessenger]; -} - -- (NSObject*)textures { - return [_appDelegate textures]; -} - -- (void)publish:(NSObject*)value { - _appDelegate.pluginPublications[_pluginKey] = value; -} - -- (void)addMethodCallDelegate:(NSObject*)delegate - channel:(FlutterMethodChannel*)channel { - [channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { - [delegate handleMethodCall:call result:result]; - }]; -} - -- (void)addApplicationDelegate:(NSObject*)delegate { - [_appDelegate.pluginDelegates addObject:delegate]; + UIViewController* rootViewController = _window.rootViewController; + if ([rootViewController isKindOfClass:[FlutterViewController class]]) { + return [[(FlutterViewController*)rootViewController pluginRegistry] + valuePublishedByPlugin:pluginKey]; + } + return nil; } -- (NSString*)lookupKeyForAsset:(NSString*)asset { - return [FlutterDartProject lookupKeyForAsset:asset]; -} +#pragma mark - FlutterAppLifeCycleProvider methods -- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { - return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; +- (void)addApplicationLifeCycleDelegate:(NSObject*)delegate { + [_lifeCycleDelegate addDelegate:delegate]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm new file mode 100644 index 0000000000000..900d048c57a09 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm @@ -0,0 +1,278 @@ +// 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. + +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#include "lib/fxl/logging.h" + +@implementation FlutterPluginAppLifeCycleDelegate { + UIBackgroundTaskIdentifier _debugBackgroundTask; + + // Weak references to registered plugins. + NSPointerArray* _pluginDelegates; +} + +- (instancetype)init { + if (self = [super init]) { + _pluginDelegates = [[NSPointerArray weakObjectsPointerArray] retain]; + } + return self; +} + +- (void)dealloc { + [_pluginDelegates release]; + [super dealloc]; +} + +static BOOL isPowerOfTwo(NSUInteger x) { + return x != 0 && (x & (x - 1)) == 0; +} + +- (void)addDelegate:(NSObject*)delegate { + [_pluginDelegates addPointer:(__bridge void*)delegate]; + if (isPowerOfTwo([_pluginDelegates count])) { + [_pluginDelegates compact]; + } +} + +- (BOOL)application:(UIApplication*)application + didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { + for (id plugin in [_pluginDelegates allObjects]) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if (![plugin application:application didFinishLaunchingWithOptions:launchOptions]) { + return NO; + } + } + } + return YES; +} + +// Returns the key window's rootViewController, if it's a FlutterViewController. +// Otherwise, returns nil. +- (FlutterViewController*)rootFlutterViewController { + UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController; + if ([viewController isKindOfClass:[FlutterViewController class]]) { + return (FlutterViewController*)viewController; + } + return nil; +} + +- (void)applicationDidEnterBackground:(UIApplication*)application { +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + // The following keeps the Flutter session alive when the device screen locks + // in debug mode. It allows continued use of features like hot reload and + // taking screenshots once the device unlocks again. + // + // Note the name is not an identifier and multiple instances can exist. + _debugBackgroundTask = [application + beginBackgroundTaskWithName:@"Flutter debug task" + expirationHandler:^{ + FXL_LOG(WARNING) + << "\nThe OS has terminated the Flutter debug connection for being " + "inactive in the background for too long.\n\n" + "There are no errors with your Flutter application.\n\n" + "To reconnect, launch your application again via 'flutter run'"; + }]; +#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationDidEnterBackground:application]; + } + } +} + +- (void)applicationWillEnterForeground:(UIApplication*)application { +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + [application endBackgroundTask:_debugBackgroundTask]; +#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationWillEnterForeground:application]; + } + } +} + +- (void)applicationWillResignActive:(UIApplication*)application { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationWillResignActive:application]; + } + } +} + +- (void)applicationDidBecomeActive:(UIApplication*)application { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationDidBecomeActive:application]; + } + } +} + +- (void)applicationWillTerminate:(UIApplication*)application { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationWillTerminate:application]; + } + } +} + +- (void)application:(UIApplication*)application + didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin application:application didRegisterUserNotificationSettings:notificationSettings]; + } + } +} + +- (void)application:(UIApplication*)application + didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; + } + } +} + +- (void)application:(UIApplication*)application + didReceiveRemoteNotification:(NSDictionary*)userInfo + fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + didReceiveRemoteNotification:userInfo + fetchCompletionHandler:completionHandler]) { + return; + } + } + } +} + +- (BOOL)application:(UIApplication*)application + openURL:(NSURL*)url + options:(NSDictionary*)options { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application openURL:url options:options]) { + return YES; + } + } + } + return NO; +} + +- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application handleOpenURL:url]) { + return YES; + } + } + } + return NO; +} + +- (BOOL)application:(UIApplication*)application + openURL:(NSURL*)url + sourceApplication:(NSString*)sourceApplication + annotation:(id)annotation { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + openURL:url + sourceApplication:sourceApplication + annotation:annotation]) { + return YES; + } + } + } + return NO; +} + +- (void)application:(UIApplication*)application + performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem + completionHandler:(void (^)(BOOL succeeded))completionHandler NS_AVAILABLE_IOS(9_0) { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + performActionForShortcutItem:shortcutItem + completionHandler:completionHandler]) { + return; + } + } + } +} + +- (BOOL)application:(UIApplication*)application + handleEventsForBackgroundURLSession:(nonnull NSString*)identifier + completionHandler:(nonnull void (^)())completionHandler { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + handleEventsForBackgroundURLSession:identifier + completionHandler:completionHandler]) { + return YES; + } + } + } + return NO; +} + +- (BOOL)application:(UIApplication*)application + performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application performFetchWithCompletionHandler:completionHandler]) { + return YES; + } + } + } + return NO; +} +@end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 2e13ffb738c1b..e3076c6c05ca7 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -22,6 +22,12 @@ #include "flutter/shell/platform/darwin/ios/platform_view_ios.h" @interface FlutterViewController () +@property(nonatomic, readonly) NSMutableDictionary* pluginPublications; +@end + +@interface FlutterViewControllerRegistrar : NSObject +- (instancetype)initWithPlugin:(NSString*)pluginKey + flutterViewController:(FlutterViewController*)flutterViewController; @end @implementation FlutterViewController { @@ -93,6 +99,8 @@ - (void)performCommonViewControllerInitialization { if ([self setupShell]) { [self setupChannels]; [self setupNotificationCenterObservers]; + + _pluginPublications = [NSMutableDictionary new]; } } @@ -426,6 +434,7 @@ - (void)viewDidDisappear:(BOOL)animated { - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + [_pluginPublications release]; [super dealloc]; } @@ -971,4 +980,82 @@ - (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } +- (id)pluginRegistry { + return self; +} + +#pragma mark - FlutterPluginRegistry + +- (NSObject*)registrarForPlugin:(NSString*)pluginKey { + NSAssert(self.pluginPublications[pluginKey] == nil, @"Duplicate plugin key: %@", pluginKey); + self.pluginPublications[pluginKey] = [NSNull null]; + return + [[FlutterViewControllerRegistrar alloc] initWithPlugin:pluginKey flutterViewController:self]; +} + +- (BOOL)hasPlugin:(NSString*)pluginKey { + return _pluginPublications[pluginKey] != nil; +} + +- (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey { + return _pluginPublications[pluginKey]; +} +@end + +@implementation FlutterViewControllerRegistrar { + NSString* _pluginKey; + FlutterViewController* _flutterViewController; +} + +- (instancetype)initWithPlugin:(NSString*)pluginKey + flutterViewController:(FlutterViewController*)flutterViewController { + self = [super init]; + NSAssert(self, @"Super init cannot be nil"); + _pluginKey = [pluginKey retain]; + _flutterViewController = [flutterViewController retain]; + return self; +} + +- (void)dealloc { + [_pluginKey release]; + [_flutterViewController release]; + [super dealloc]; +} + +- (NSObject*)messenger { + return _flutterViewController; +} + +- (NSObject*)textures { + return _flutterViewController; +} + +- (void)publish:(NSObject*)value { + _flutterViewController.pluginPublications[_pluginKey] = value; +} + +- (void)addMethodCallDelegate:(NSObject*)delegate + channel:(FlutterMethodChannel*)channel { + [channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { + [delegate handleMethodCall:call result:result]; + }]; +} + +- (void)addApplicationDelegate:(NSObject*)delegate { + id appDelegate = [[UIApplication sharedApplication] delegate]; + if ([appDelegate conformsToProtocol:@protocol(FlutterAppLifeCycleProvider)]) { + id lifeCycleProvider = + (id)appDelegate; + [lifeCycleProvider addApplicationLifeCycleDelegate:delegate]; + } +} + +- (NSString*)lookupKeyForAsset:(NSString*)asset { + return [_flutterViewController lookupKeyForAsset:asset]; +} + +- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { + return [_flutterViewController lookupKeyForAsset:asset fromPackage:package]; +} + @end diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 3f2e6bfdc6ccd..f6cccfd32ac2b 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -840,6 +840,8 @@ FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_ FILE: ../../../flutter/lib/ui/painting/image_encoding.cc FILE: ../../../flutter/lib/ui/painting/image_encoding.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm ---------------------------------------------------------------------------------------------------- From f7eab94f45acb877adb7477625aa73225b04ba8d Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 17 May 2018 10:28:56 -0400 Subject: [PATCH 0357/1190] Roll src/third_party/skia/ bd74e6a02..c06754b04 (1 commit) (#5287) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7dadfdbab5695..f6e66b8b60596 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'bd74e6a02ae0e7b031aa1d1cd73062dba2c93daf', + 'skia_revision': 'c06754b0466e14e1611fa3144bf337289e6ca82f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d00a3cf677800..9f96e493a4493 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3bb50664621584c91b765615c3d32ae1 +Signature: 1d04ba7e65f3ee3c2e1884293995c470 UNUSED LICENSES: From a262da46f960a7a0955137929c3ebf7a201faf40 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 17 May 2018 13:56:56 -0400 Subject: [PATCH 0358/1190] Roll src/third_party/skia/ c06754b04..000e00df1 (12 commits; 1 trivial rolls) (#5288) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f6e66b8b60596..385ed30c1d3d7 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c06754b0466e14e1611fa3144bf337289e6ca82f', + 'skia_revision': '000e00df133695efb76ac07d028703cdf55837aa', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9f96e493a4493..09d703c4c7ce0 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1d04ba7e65f3ee3c2e1884293995c470 +Signature: db79354db894b1942cd73cb23c69eced UNUSED LICENSES: @@ -17249,6 +17249,7 @@ FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.cpp FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h +FILE: ../../../third_party/skia/src/gpu/GrQuad.cpp FILE: ../../../third_party/skia/src/gpu/GrRenderTargetProxyPriv.h FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp From 40a37126078f3eee2cd7584da04704908f47cd68 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 17 May 2018 12:55:29 -0700 Subject: [PATCH 0359/1190] Remove the content handler for its move to topaz. (#5289) --- BUILD.gn | 188 +--- content_handler/BUILD.gn | 122 --- content_handler/README.md | 4 - content_handler/accessibility_bridge.cc | 81 -- content_handler/accessibility_bridge.h | 44 - content_handler/application.cc | 308 ------ content_handler/application.h | 99 -- content_handler/application_runner.cc | 142 --- content_handler/application_runner.h | 65 -- content_handler/compositor_context.cc | 88 -- content_handler/compositor_context.h | 41 - content_handler/engine.cc | 333 ------- content_handler/engine.h | 72 -- content_handler/fuchsia_font_manager.cc | 164 ---- content_handler/fuchsia_font_manager.h | 89 -- content_handler/isolate_configurator.cc | 114 --- content_handler/isolate_configurator.h | 55 -- content_handler/main.cc | 26 - content_handler/meta/sandbox | 7 - content_handler/platform_view.cc | 577 ----------- content_handler/platform_view.h | 128 --- content_handler/session_connection.cc | 115 --- content_handler/session_connection.h | 70 -- content_handler/surface.cc | 63 -- content_handler/surface.h | 42 - content_handler/task_observers.cc | 43 - content_handler/task_observers.h | 16 - content_handler/unique_fdio_ns.h | 34 - content_handler/vsync_waiter.cc | 87 -- content_handler/vsync_waiter.h | 41 - content_handler/vulkan_surface.cc | 411 -------- content_handler/vulkan_surface.h | 123 --- content_handler/vulkan_surface_pool.cc | 181 ---- content_handler/vulkan_surface_pool.h | 78 -- content_handler/vulkan_surface_producer.cc | 211 ---- content_handler/vulkan_surface_producer.h | 77 -- travis/licenses_golden/licenses_flutter | 1024 +++++++++----------- 37 files changed, 466 insertions(+), 4897 deletions(-) delete mode 100644 content_handler/BUILD.gn delete mode 100644 content_handler/README.md delete mode 100644 content_handler/accessibility_bridge.cc delete mode 100644 content_handler/accessibility_bridge.h delete mode 100644 content_handler/application.cc delete mode 100644 content_handler/application.h delete mode 100644 content_handler/application_runner.cc delete mode 100644 content_handler/application_runner.h delete mode 100644 content_handler/compositor_context.cc delete mode 100644 content_handler/compositor_context.h delete mode 100644 content_handler/engine.cc delete mode 100644 content_handler/engine.h delete mode 100644 content_handler/fuchsia_font_manager.cc delete mode 100644 content_handler/fuchsia_font_manager.h delete mode 100644 content_handler/isolate_configurator.cc delete mode 100644 content_handler/isolate_configurator.h delete mode 100644 content_handler/main.cc delete mode 100644 content_handler/meta/sandbox delete mode 100644 content_handler/platform_view.cc delete mode 100644 content_handler/platform_view.h delete mode 100644 content_handler/session_connection.cc delete mode 100644 content_handler/session_connection.h delete mode 100644 content_handler/surface.cc delete mode 100644 content_handler/surface.h delete mode 100644 content_handler/task_observers.cc delete mode 100644 content_handler/task_observers.h delete mode 100644 content_handler/unique_fdio_ns.h delete mode 100644 content_handler/vsync_waiter.cc delete mode 100644 content_handler/vsync_waiter.h delete mode 100644 content_handler/vulkan_surface.cc delete mode 100644 content_handler/vulkan_surface.h delete mode 100644 content_handler/vulkan_surface_pool.cc delete mode 100644 content_handler/vulkan_surface_pool.h delete mode 100644 content_handler/vulkan_surface_producer.cc delete mode 100644 content_handler/vulkan_surface_producer.h diff --git a/BUILD.gn b/BUILD.gn index c69e3549a8347..836cd08366e3a 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -30,14 +30,6 @@ group("flutter") { } } - if (is_fuchsia) { - public_deps += [ - "$flutter_root/content_handler:aot", - "$flutter_root/content_handler:jit", - "$flutter_root/flow", - ] - } - # If on the host, compile all unittests targets. if (current_toolchain == host_toolchain) { if (is_mac) { @@ -70,180 +62,10 @@ config("config") { include_dirs = [ ".." ] } -if (is_fuchsia) { - import("//build/package.gni") - - package("flutter_aot_runner") { - deps = [ - "$flutter_root/content_handler:aot", - ] - if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] - } - - binary = "flutter_aot_runner" - - if (flutter_runtime_mode != "release") { - resources = [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] - } - - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] - } - - package("flutter2_aot_runner") { - deps = [ - "$flutter_root/content_handler:aot", - ] - if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] - } - - binary = "flutter_aot_runner" - - if (flutter_runtime_mode != "release") { - resources = [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] - } - - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] - } - - package("flutter_jit_runner") { - snapshot_label = "$flutter_root/lib/snapshot:generate_snapshot_bin" - snapshot_gen_dir = get_label_info(snapshot_label, "target_gen_dir") - - deps = [ - "$flutter_root/content_handler:jit", - snapshot_label, - ] - if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] - } - - binary = "flutter_jit_runner" - - resources = [ - { - path = rebase_path("$snapshot_gen_dir/vm_isolate_snapshot.bin") - dest = "vm_snapshot_data.bin" - }, - { - path = rebase_path("$snapshot_gen_dir/vm_snapshot_instructions.bin") - dest = "vm_snapshot_instructions.bin" - }, - { - path = rebase_path("$snapshot_gen_dir/isolate_snapshot.bin") - dest = "isolate_core_snapshot_data.bin" - }, - { - path = - rebase_path("$snapshot_gen_dir/isolate_snapshot_instructions.bin") - dest = "isolate_core_snapshot_instructions.bin" - }, - ] - if (flutter_runtime_mode != "release") { - resources += [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] - } - - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] - } - - package("flutter2_jit_runner") { - snapshot_label = "//topaz/runtime/flutter_runner/kernel:kernel_core_snapshot" - snapshot_gen_dir = get_label_info(snapshot_label, "target_gen_dir") - - deps = [ - "$flutter_root/content_handler:jit", - snapshot_label, - ] - if (flutter_runtime_mode != "release") { - deps += [ - "//third_party/dart/runtime/observatory:embedded_archive_observatory", - ] - } - - binary = "flutter_jit_runner" - - resources = [ - { - path = rebase_path("$snapshot_gen_dir/vm_isolate_snapshot.bin") - dest = "vm_snapshot_data.bin" - }, - { - path = rebase_path("$snapshot_gen_dir/vm_snapshot_instructions.bin") - dest = "vm_snapshot_instructions.bin" - }, - { - path = rebase_path("$snapshot_gen_dir/isolate_snapshot.bin") - dest = "isolate_core_snapshot_data.bin" - }, - { - path = - rebase_path("$snapshot_gen_dir/isolate_snapshot_instructions.bin") - dest = "isolate_core_snapshot_instructions.bin" - }, - ] - if (flutter_runtime_mode != "release") { - resources += [ - { - path = rebase_path( - "$root_gen_dir/observatory/embedded_archive_observatory.tar") - dest = "observatory.tar" - }, - ] - } - - meta = [ - { - path = rebase_path("content_handler/meta/sandbox") - dest = "sandbox" - }, - ] - } -} else { - group("dist") { - testonly = true +group("dist") { + testonly = true - deps = [ - "$flutter_root/sky/dist", - ] - } + deps = [ + "$flutter_root/sky/dist", + ] } diff --git a/content_handler/BUILD.gn b/content_handler/BUILD.gn deleted file mode 100644 index 3cdaa0dab219d..0000000000000 --- a/content_handler/BUILD.gn +++ /dev/null @@ -1,122 +0,0 @@ -# Copyright 2016 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. - -assert(is_fuchsia) - -import("//build/vulkan/config.gni") - -template("flutter_content_handler") { - invoker_output_name = invoker.output_name - extra_deps = invoker.extra_deps - - executable(target_name) { - output_name = invoker_output_name - - defines = [] - - libs = [] - - sources = [ - "accessibility_bridge.cc", - "accessibility_bridge.h", - "application.cc", - "application.h", - "application_runner.cc", - "application_runner.h", - "compositor_context.cc", - "compositor_context.h", - "engine.cc", - "engine.h", - "fuchsia_font_manager.cc", - "fuchsia_font_manager.h", - "isolate_configurator.cc", - "isolate_configurator.h", - "main.cc", - "platform_view.cc", - "platform_view.h", - "session_connection.cc", - "session_connection.h", - "surface.cc", - "surface.h", - "task_observers.cc", - "task_observers.h", - "unique_fdio_ns.h", - "vsync_waiter.cc", - "vsync_waiter.h", - "vulkan_surface.cc", - "vulkan_surface.h", - "vulkan_surface_pool.cc", - "vulkan_surface_pool.h", - "vulkan_surface_producer.cc", - "vulkan_surface_producer.h", - ] - - # The use of these dependencies is temporary and will be moved behind the - # embedder API. - flutter_deps = [ - "$flutter_root/assets", - "$flutter_root/common", - "$flutter_root/flow", - "$flutter_root/glue", - "$flutter_root/lib/ui", - "$flutter_root/runtime", - "$flutter_root/third_party/txt", - "$flutter_root/vulkan", - "$flutter_root/fml", - "$flutter_root/shell/common", - "$flutter_root/shell/gpu", - ] - - deps = [ - "//third_party/dart/runtime/bin:libdart_builtin", - "//garnet/public/lib/app/cpp", - "//garnet/public/lib/fonts/fidl", - "//garnet/public/lib/fsl", - "//garnet/public/lib/fxl", - "//garnet/public/lib/icu_data/cpp", - "//garnet/public/lib/svc/cpp", - "//garnet/public/lib/ui/input/fidl", - "//garnet/public/lib/ui/scenic:client", - "//garnet/public/lib/ui/views/fidl:v1", - "//garnet/public/lib/vulkan", - "//garnet/public/lib/zip", - "//peridot/public/lib:fidl", - "//third_party/rapidjson", - "//third_party/skia", - "//topaz/lib/tonic", - "//topaz/public/dart-pkg/fuchsia", - "//topaz/public/lib/ui/flutter/sdk_ext", - "//third_party/skia:gpu", - "//third_party/zlib:minizip", - "//zircon/public/lib/trace-provider", - ] + extra_deps + flutter_deps - - # The flags below are needed so that Dart's CPU profiler can walk the - # C++ stack. - cflags = [ - "-mno-omit-leaf-frame-pointer", - "-fno-omit-frame-pointer", - ] - - # This flag is needed so that the call to dladdr() in Dart's native symbol - # resolver can report good symbol information for the CPU profiler. - ldflags = [ "-rdynamic" ] - } -} - -flutter_content_handler("aot") { - output_name = "flutter_aot_runner" - extra_deps = [ - "//third_party/dart/runtime:libdart_precompiled_runtime", - "//third_party/dart/runtime/platform:libdart_platform_precompiled_runtime", - ] -} - -flutter_content_handler("jit") { - output_name = "flutter_jit_runner" - extra_deps = [ - "//third_party/dart/runtime:libdart_jit", - "//third_party/dart/runtime/platform:libdart_platform_jit", - ] -} diff --git a/content_handler/README.md b/content_handler/README.md deleted file mode 100644 index 4461e808d1a47..0000000000000 --- a/content_handler/README.md +++ /dev/null @@ -1,4 +0,0 @@ -Flutter Application Runner -========================== - -Implements the `component::ApplicationRunner` FIDL interface to launch and run mutliple Flutter applications within the same process. diff --git a/content_handler/accessibility_bridge.cc b/content_handler/accessibility_bridge.cc deleted file mode 100644 index 706aab3d77cea..0000000000000 --- a/content_handler/accessibility_bridge.cc +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2017 The Fuchsia 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 "accessibility_bridge.h" - -#include - -#include "lib/app/cpp/application_context.h" -#include "third_party/rapidjson/rapidjson/document.h" -#include "third_party/rapidjson/rapidjson/stringbuffer.h" -#include "third_party/rapidjson/rapidjson/writer.h" - -namespace flutter { - -AccessibilityBridge::AccessibilityBridge( - fidl::InterfaceHandle writer) - : writer_(writer.Bind()) {} - -AccessibilityBridge::~AccessibilityBridge() = default; - -void AccessibilityBridge::UpdateSemantics( - const blink::SemanticsNodeUpdates& update) { - for (const auto& update : update) { - const auto& node = update.second; - semantics_nodes_[node.id] = node; - } - std::vector visited_nodes; - UpdateVisitedForNodeAndChildren(0, &visited_nodes); - EraseUnvisitedNodes(visited_nodes); - - // The data sent to the Context Service is a JSON formatted list of labels - // for all on screen widgets. - rapidjson::Document nodes_json(rapidjson::kArrayType); - for (const int node_index : visited_nodes) { - const auto& node = semantics_nodes_[node_index]; - if (!node.label.empty()) { - rapidjson::Value value; - value.SetString(node.label.data(), node.label.size()); - nodes_json.PushBack(value, nodes_json.GetAllocator()); - } - } - - if (nodes_json.Size() > 0) { - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - nodes_json.Accept(writer); - writer_->WriteEntityTopic("/inferred/accessibility_text", - buffer.GetString()); - } -} - -void AccessibilityBridge::UpdateVisitedForNodeAndChildren( - const int id, - std::vector* visited_nodes) { - std::map::const_iterator it = - semantics_nodes_.find(id); - if (it == semantics_nodes_.end()) { - return; - } - - visited_nodes->push_back(id); - for (const int child : it->second.children) { - UpdateVisitedForNodeAndChildren(child, visited_nodes); - } -} - -void AccessibilityBridge::EraseUnvisitedNodes( - const std::vector& visited_nodes) { - const std::unordered_set visited_nodes_lookup(visited_nodes.begin(), - visited_nodes.end()); - for (auto it = semantics_nodes_.begin(); it != semantics_nodes_.end();) { - if (visited_nodes_lookup.find((*it).first) == visited_nodes_lookup.end()) { - it = semantics_nodes_.erase(it); - } else { - ++it; - } - } -} - -} // namespace flutter diff --git a/content_handler/accessibility_bridge.h b/content_handler/accessibility_bridge.h deleted file mode 100644 index b209342c662f3..0000000000000 --- a/content_handler/accessibility_bridge.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include - -#include - -#include "flutter/lib/ui/semantics/semantics_node.h" -#include "lib/fxl/macros.h" - -namespace flutter { - -// Maintain an up-to-date list of SemanticsNodes on screen, and communicate -// with the Context Service. -class AccessibilityBridge final { - public: - AccessibilityBridge(fidl::InterfaceHandle writer); - - ~AccessibilityBridge(); - - // Update the internal representation of the semantics nodes, and write the - // semantics to Context Service. - void UpdateSemantics(const blink::SemanticsNodeUpdates& update); - - private: - modular::ContextWriterPtr writer_; - std::map semantics_nodes_; - - // Walk the semantics node tree starting at |id|, and store the id of each - // visited child in |visited_nodes|. - void UpdateVisitedForNodeAndChildren(const int id, - std::vector* visited_nodes); - - // Remove any node from |semantics_nodes_| that doesn't have an id in - // |visited_nodes|. - void EraseUnvisitedNodes(const std::vector& visited_nodes); - - FXL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); -}; - -} // namespace flutter diff --git a/content_handler/application.cc b/content_handler/application.cc deleted file mode 100644 index a2fabf51213ad..0000000000000 --- a/content_handler/application.cc +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "application.h" - -#include -#include - -#include - -#include "flutter/shell/common/switches.h" -#include "lib/fsl/vmo/file.h" -#include "lib/fsl/vmo/vector.h" -#include "lib/fxl/command_line.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "task_observers.h" - -namespace flutter { - -std::pair, std::unique_ptr> -Application::Create( - TerminationCallback termination_callback, - component::ApplicationPackage package, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) { - auto thread = std::make_unique(); - std::unique_ptr application; - - fxl::AutoResetWaitableEvent latch; - thread->TaskRunner()->PostTask([&]() mutable { - application.reset(new Application(termination_callback, // - std::move(package), // - std::move(startup_info), // - std::move(controller) // - )); - latch.Signal(); - }); - thread->Run(); - latch.Wait(); - return {std::move(thread), std::move(application)}; -} - -static std::string DebugLabelForURL(const std::string& url) { - auto found = url.rfind("/"); - if (found == std::string::npos) { - return url; - } else { - return {url, found + 1}; - } -} - -Application::Application( - TerminationCallback termination_callback, - component::ApplicationPackage, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest - application_controller_request) - : termination_callback_(termination_callback), - debug_label_(DebugLabelForURL(startup_info.launch_info.url)), - application_controller_(this) { - application_controller_.set_error_handler([this]() { Kill(); }); - - FXL_DCHECK(fdio_ns_.is_valid()); - // ApplicationLaunchInfo::url non-optional. - auto& launch_info = startup_info.launch_info; - - // ApplicationLaunchInfo::arguments optional. - if (auto& arguments = launch_info.arguments) { - settings_ = shell::SettingsFromCommandLine( - fxl::CommandLineFromIterators(arguments->begin(), arguments->end())); - } - - // TODO: ApplicationLaunchInfo::out. - - // TODO: ApplicationLaunchInfo::err. - - // ApplicationLaunchInfo::service_request optional. - if (launch_info.directory_request) { - service_provider_bridge_.ServeDirectory( - std::move(launch_info.directory_request)); - } - - // ApplicationLaunchInfo::flat_namespace optional. - for (size_t i = 0; i < startup_info.flat_namespace.paths->size(); ++i) { - const auto& path = startup_info.flat_namespace.paths->at(i); - if (path == "/svc") { - continue; - } - - zx::channel dir = std::move(startup_info.flat_namespace.directories->at(i)); - zx_handle_t dir_handle = dir.release(); - if (fdio_ns_bind(fdio_ns_.get(), path->data(), dir_handle) != ZX_OK) { - FXL_DLOG(ERROR) << "Could not bind path to namespace: " << path; - zx_handle_close(dir_handle); - } - } - - application_directory_.reset(fdio_ns_opendir(fdio_ns_.get())); - FXL_DCHECK(application_directory_.is_valid()); - - application_assets_directory_.reset( - openat(application_directory_.get(), "pkg/data", O_RDONLY | O_DIRECTORY)); - - // TODO: ApplicationLaunchInfo::additional_services optional. - - // All launch arguments have been read. Perform service binding and - // final settings configuration. The next call will be to create a view - // for this application. - - service_provider_bridge_.AddService( - std::bind(&Application::CreateShellForView, this, std::placeholders::_1)); - - component::ServiceProviderPtr outgoing_services; - outgoing_services_request_ = outgoing_services.NewRequest(); - service_provider_bridge_.set_backend(std::move(outgoing_services)); - - // Setup the application controller binding. - if (application_controller_request) { - application_controller_.Bind(std::move(application_controller_request)); - } - - application_context_ = - component::ApplicationContext::CreateFrom(std::move(startup_info)); - - settings_.vm_snapshot_data_path = "pkg/data/vm_snapshot_data.bin"; - settings_.vm_snapshot_instr_path = "pkg/data/vm_snapshot_instructions.bin"; - settings_.isolate_snapshot_data_path = - "pkg/data/isolate_core_snapshot_data.bin"; - settings_.isolate_snapshot_instr_path = - "pkg/data/isolate_core_snapshot_instructions.bin"; - - settings_.enable_observatory = true; - - settings_.icu_data_path = ""; - - settings_.assets_dir = application_assets_directory_.get(); - - settings_.script_snapshot_path = "snapshot_blob.bin"; - settings_.application_kernel_asset = "kernel_blob.dill"; - settings_.application_kernel_list_asset = "app.dilplist"; - - settings_.log_tag = debug_label_ + std::string{"(flutter)"}; - -#ifndef NDEBUG - // Debug mode - settings_.dart_non_checked_mode = false; -#else // NDEBUG - // Release mode - settings_.dart_non_checked_mode = true; -#endif // NDEBUG - - settings_.task_observer_add = - std::bind(&CurrentMessageLoopAddAfterTaskObserver, std::placeholders::_1, - std::placeholders::_2); - - settings_.task_observer_remove = std::bind( - &CurrentMessageLoopRemoveAfterTaskObserver, std::placeholders::_1); - - AttemptVMLaunchWithCurrentSettings(settings_); -} - -Application::~Application() = default; - -const std::string& Application::GetDebugLabel() const { - return debug_label_; -} - -void Application::AttemptVMLaunchWithCurrentSettings( - const blink::Settings& settings) { - if (!blink::DartVM::IsRunningPrecompiledCode()) { - // We will be initializing the VM lazily in this case. - return; - } - - fsl::SizedVmo dylib_vmo; - - if (!fsl::VmoFromFilenameAt( - application_assets_directory_.get() /* /pkg/data */, "libapp.so", - &dylib_vmo)) { - FXL_LOG(ERROR) << "Dylib containing VM and isolate snapshots does not " - "exist. Will not be able to launch VM."; - return; - } - - dlerror(); - - auto library_handle = dlopen_vmo(dylib_vmo.vmo().get(), RTLD_LAZY); - - if (library_handle == nullptr) { - FXL_LOG(ERROR) << "Could not open dylib: " << dlerror(); - return; - } - - auto lib = - fml::NativeLibrary::CreateWithHandle(library_handle, // library handle - true // close the handle when done - ); - - auto symbol = [](const char* str) { - return std::string{"_"} + std::string{str}; - }; - - fxl::RefPtr vm_snapshot = - fxl::MakeRefCounted( - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kVMDataSymbol).c_str()), - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kVMInstructionsSymbol).c_str())); - - isolate_snapshot_ = fxl::MakeRefCounted( - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, symbol(blink::DartSnapshot::kIsolateDataSymbol).c_str()), - blink::DartSnapshotBuffer::CreateWithSymbolInLibrary( - lib, - symbol(blink::DartSnapshot::kIsolateInstructionsSymbol).c_str())); - - blink::DartVM::ForProcess(settings_, // - std::move(vm_snapshot), // - isolate_snapshot_ // - ); - if (blink::DartVM::ForProcessIfInitialized()) { - FXL_DLOG(INFO) << "VM successfully initialized for AOT mode."; - } else { - FXL_LOG(ERROR) << "VM could not be initialized for AOT mode."; - } -} - -// |component::ApplicationController| -void Application::Kill() { - if (last_return_code_.first) { - for (auto wait_callback : wait_callbacks_) { - wait_callback(last_return_code_.second); - } - } - wait_callbacks_.clear(); - - termination_callback_(this); - // WARNING: Don't do anything past this point as this instance may have been - // collected. -} - -// |component::ApplicationController| -void Application::Detach() { - application_controller_.set_error_handler(nullptr); -} - -// |component::ApplicationController| -void Application::Wait(WaitCallback callback) { - wait_callbacks_.emplace_back(std::move(callback)); -} - -// |flutter::Engine::Delegate| -void Application::OnEngineTerminate(const Engine* shell_holder) { - auto found = std::find_if(shell_holders_.begin(), shell_holders_.end(), - [shell_holder](const auto& holder) { - return holder.get() == shell_holder; - }); - - if (found == shell_holders_.end()) { - return; - } - - // We may launch multiple shell in this application. However, we will - // terminate when the last shell goes away. The error code return to the - // application controller will be the last isolate that had an error. - auto return_code = shell_holder->GetEngineReturnCode(); - if (return_code.first) { - last_return_code_ = return_code; - } - - shell_holders_.erase(found); - - if (shell_holders_.size() == 0) { - Kill(); - // WARNING: Don't do anything past this point because the delegate may have - // collected this instance via the termination callback. - } -} - -void Application::CreateShellForView( - fidl::InterfaceRequest view_provider_request) { - shells_bindings_.AddBinding(this, std::move(view_provider_request)); -} - -// |views_v1::ViewProvider| -void Application::CreateView( - fidl::InterfaceRequest view_owner, - fidl::InterfaceRequest) { - if (!application_context_) { - FXL_DLOG(ERROR) << "Application context was invalid when attempting to " - "create a shell for a view provider request."; - return; - } - - shell_holders_.emplace(std::make_unique( - *this, // delegate - debug_label_, // thread label - *application_context_, // application context - settings_, // settings - std::move(isolate_snapshot_), // isolate snapshot - std::move(view_owner), // view owner - std::move(fdio_ns_), // FDIO namespace - std::move(outgoing_services_request_) // outgoing request - )); -} - -} // namespace flutter diff --git a/content_handler/application.h b/content_handler/application.h deleted file mode 100644 index f6c1dfde4101c..0000000000000 --- a/content_handler/application.h +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include -#include - -#include -#include -#include - -#include "engine.h" -#include "flutter/common/settings.h" -#include "lib/app/cpp/application_context.h" -#include "lib/fidl/cpp/binding_set.h" -#include "lib/fidl/cpp/interface_request.h" -#include "lib/fsl/threading/thread.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" -#include "lib/svc/cpp/service_provider_bridge.h" -#include "unique_fdio_ns.h" - -namespace flutter { - -// Represents an instance of a Flutter application that contains one of more -// Flutter engine instances. -class Application final : public Engine::Delegate, - public component::ApplicationController, - public views_v1::ViewProvider { - public: - using TerminationCallback = std::function; - - // Creates a dedicated thread to run the application and constructions the - // application on it. The application can be accessed only on this thread. - // This is a synchronous operation. - static std::pair, std::unique_ptr> - Create(TerminationCallback termination_callback, - component::ApplicationPackage package, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller); - - // Must be called on the same thread returned from the create call. The thread - // may be collected after. - ~Application(); - - const std::string& GetDebugLabel() const; - - private: - blink::Settings settings_; - TerminationCallback termination_callback_; - const std::string debug_label_; - UniqueFDIONS fdio_ns_ = UniqueFDIONSCreate(); - fxl::UniqueFD application_directory_; - fxl::UniqueFD application_assets_directory_; - fidl::Binding application_controller_; - fidl::InterfaceRequest outgoing_services_request_; - component::ServiceProviderBridge service_provider_bridge_; - std::unique_ptr application_context_; - fidl::BindingSet shells_bindings_; - fxl::RefPtr isolate_snapshot_; - std::set> shell_holders_; - std::vector wait_callbacks_; - std::pair last_return_code_; - - Application( - TerminationCallback termination_callback, - component::ApplicationPackage package, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller); - - // |component::ApplicationController| - void Kill() override; - - // |component::ApplicationController| - void Detach() override; - - // |component::ApplicationController| - void Wait(WaitCallback callback) override; - - // |views_v1::ViewProvider| - void CreateView( - fidl::InterfaceRequest view_owner, - fidl::InterfaceRequest services) override; - - // |flutter::Engine::Delegate| - void OnEngineTerminate(const Engine* holder) override; - - void CreateShellForView( - fidl::InterfaceRequest view_provider_request); - - void AttemptVMLaunchWithCurrentSettings(const blink::Settings& settings); - - FXL_DISALLOW_COPY_AND_ASSIGN(Application); -}; - -} // namespace flutter diff --git a/content_handler/application_runner.cc b/content_handler/application_runner.cc deleted file mode 100644 index bc9e3ebc0a1ea..0000000000000 --- a/content_handler/application_runner.cc +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "application_runner.h" - -#include - -#include -#include - -#include "flutter/lib/ui/text/font_collection.h" -#include "fuchsia_font_manager.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/icu_data/cpp/icu_data.h" -#include "third_party/flutter/runtime/dart_vm.h" -#include "third_party/skia/include/core/SkGraphics.h" - -namespace flutter { - -static void SetProcessName() { - std::stringstream stream; - stream << "io.flutter.runner."; - if (blink::DartVM::IsRunningPrecompiledCode()) { - stream << "aot"; - } else { - stream << "jit"; - } - const auto name = stream.str(); - zx::process::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); -} - -static void SetThreadName(const std::string& thread_name) { - zx::thread::self().set_property(ZX_PROP_NAME, thread_name.c_str(), - thread_name.size()); -} - -ApplicationRunner::ApplicationRunner() - : host_context_(component::ApplicationContext::CreateFromStartupInfo()) { - SkGraphics::Init(); - - SetupICU(); - - SetupGlobalFonts(); - - SetProcessName(); - - SetThreadName("io.flutter.runner.main"); - - host_context_->outgoing_services()->AddService( - std::bind(&ApplicationRunner::RegisterApplication, this, - std::placeholders::_1)); -} - -ApplicationRunner::~ApplicationRunner() { - host_context_->outgoing_services() - ->RemoveService(); -} - -void ApplicationRunner::RegisterApplication( - fidl::InterfaceRequest request) { - active_applications_bindings_.AddBinding(this, std::move(request)); -} - -void ApplicationRunner::StartApplication( - component::ApplicationPackage package, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest controller) { - // Notes on application termination: Application typically terminate on the - // thread on which they were created. This usually means the thread was - // specifically created to host the application. But we want to ensure that - // access to the active applications collection is made on the same thread. So - // we capture the runner in the termination callback. There is no risk of - // there being multiple application runner instance in the process at the same - // time. So it is safe to use the raw pointer. - Application::TerminationCallback termination_callback = - [task_runner = fsl::MessageLoop::GetCurrent()->task_runner(), // - application_runner = this // - ](const Application* application) { - task_runner->PostTask([application_runner, application]() { - application_runner->OnApplicationTerminate(application); - }); - }; - - auto thread_application_pair = - Application::Create(termination_callback, // termination callback - std::move(package), // application pacakge - std::move(startup_info), // startup info - std::move(controller) // controller request - ); - - auto key = thread_application_pair.second.get(); - - active_applications_[key] = std::move(thread_application_pair); -} - -void ApplicationRunner::OnApplicationTerminate(const Application* application) { - auto& active_application = active_applications_.at(application); - - // Grab the items out of the entry because we will have to rethread the - // destruction. - auto application_to_destroy = std::move(active_application.application); - auto application_destruction_thread = std::move(active_application.thread); - - // Delegate the entry. - active_applications_.erase(application); - - // Post the task to destroy the application and quit its message loop. - auto runner = application_destruction_thread->TaskRunner(); - runner->PostTask(fxl::MakeCopyable( - [instance = std::move(application_to_destroy)]() mutable { - instance.reset(); - - fsl::MessageLoop::GetCurrent()->PostQuitTask(); - })); - - // This works because just posted the quit task on the hosted thread. - application_destruction_thread->Join(); -} - -void ApplicationRunner::SetupICU() { - if (!icu_data::Initialize(host_context_.get())) { - FXL_LOG(ERROR) << "Could not initialize ICU data."; - } -} - -void ApplicationRunner::SetupGlobalFonts() { - // Fuchsia does not have per application (shell) fonts. Instead, all fonts - // must be obtained from the font provider. - auto process_font_collection = - blink::FontCollection::ForProcess().GetFontCollection(); - - // Connect to the system font provider. - fonts::FontProviderSyncPtr sync_font_provider; - host_context_->ConnectToEnvironmentService(sync_font_provider.NewRequest()); - - // Set the default font manager. - process_font_collection->SetDefaultFontManager( - sk_make_sp(std::move(sync_font_provider))); -} - -} // namespace flutter diff --git a/content_handler/application_runner.h b/content_handler/application_runner.h deleted file mode 100644 index 302d3c685a345..0000000000000 --- a/content_handler/application_runner.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include - -#include - -#include "application.h" -#include "lib/app/cpp/application_context.h" -#include "lib/fidl/cpp/binding_set.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/macros.h" - -namespace flutter { - -// Publishes the |component::ApplicationRunner| service and runs applications on -// their own threads. -class ApplicationRunner final : public component::ApplicationRunner { - public: - ApplicationRunner(); - - ~ApplicationRunner(); - - private: - struct ActiveApplication { - std::unique_ptr thread; - std::unique_ptr application; - - ActiveApplication(std::pair, - std::unique_ptr> pair) - : thread(std::move(pair.first)), application(std::move(pair.second)) {} - - ActiveApplication() = default; - }; - - std::unique_ptr host_context_; - fidl::BindingSet active_applications_bindings_; - std::unordered_map - active_applications_; - - // |component::ApplicationRunner| - void StartApplication(component::ApplicationPackage application, - component::ApplicationStartupInfo startup_info, - fidl::InterfaceRequest - controller) override; - - void RegisterApplication( - fidl::InterfaceRequest request); - - void UnregisterApplication(const Application* application); - - void OnApplicationTerminate(const Application* application); - - void SetupICU(); - - void SetupGlobalFonts(); - - FXL_DISALLOW_COPY_AND_ASSIGN(ApplicationRunner); -}; - -} // namespace flutter diff --git a/content_handler/compositor_context.cc b/content_handler/compositor_context.cc deleted file mode 100644 index bac9ebb708691..0000000000000 --- a/content_handler/compositor_context.cc +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "compositor_context.h" - -#include "flutter/flow/layers/layer_tree.h" -#include "flutter/glue/trace_event.h" - -namespace flutter { - -class ScopedFrame final : public flow::CompositorContext::ScopedFrame { - public: - ScopedFrame(flow::CompositorContext& context, - bool instrumentation_enabled, - SessionConnection& session_connection) - : flow::CompositorContext::ScopedFrame(context, - nullptr, - nullptr, - instrumentation_enabled), - session_connection_(session_connection) {} - - private: - SessionConnection& session_connection_; - - bool Raster(flow::LayerTree& layer_tree, bool ignore_raster_cache) override { - if (!session_connection_.has_metrics()) { - return true; - } - - { - // Preroll the Flutter layer tree. This allows Flutter to perform - // pre-paint optimizations. - TRACE_EVENT0("flutter", "Preroll"); - layer_tree.Preroll(*this, true /* ignore raster cache */); - } - - { - // Traverse the Flutter layer tree so that the necessary session ops to - // represent the frame are enqueued in the underlying session. - TRACE_EVENT0("flutter", "UpdateScene"); - layer_tree.UpdateScene(session_connection_.scene_update_context(), - session_connection_.root_node()); - } - - { - // Flush all pending session ops. - TRACE_EVENT0("flutter", "SessionPresent"); - session_connection_.Present(*this); - } - - return true; - } - - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); -}; - -CompositorContext::CompositorContext( - fidl::InterfaceHandle scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback, - zx_handle_t vsync_event_handle) - : debug_label_(std::move(debug_label)), - session_connection_(std::move(scenic), - debug_label_, - std::move(import_token), - std::move(session_metrics_did_change_callback), - std::move(session_error_callback), - vsync_event_handle) {} - -CompositorContext::~CompositorContext() = default; - -std::unique_ptr -CompositorContext::AcquireFrame(GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled) { - // TODO: The AcquireFrame interface is too broad and must be refactored to get - // rid of the context and canvas arguments as those seem to be only used for - // colorspace correctness purposes on the mobile shells. - return std::make_unique(*this, // - instrumentation_enabled, // - session_connection_ // - ); -} - -} // namespace flutter diff --git a/content_handler/compositor_context.h b/content_handler/compositor_context.h deleted file mode 100644 index b59c010387b9c..0000000000000 --- a/content_handler/compositor_context.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include - -#include "flutter/flow/compositor_context.h" -#include "lib/fxl/macros.h" -#include "session_connection.h" - -namespace flutter { - -// Holds composition specific state and bindings specific to composition on -// Fuchsia. -class CompositorContext final : public flow::CompositorContext { - public: - CompositorContext(fidl::InterfaceHandle scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback, - zx_handle_t vsync_event_handle); - - ~CompositorContext() override; - - private: - const std::string debug_label_; - SessionConnection session_connection_; - - // |flow::CompositorContext| - std::unique_ptr AcquireFrame( - GrContext* gr_context, - SkCanvas* canvas, - bool instrumentation_enabled) override; - - FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); -}; - -} // namespace flutter diff --git a/content_handler/engine.cc b/content_handler/engine.cc deleted file mode 100644 index c47dc7d09f0ae..0000000000000 --- a/content_handler/engine.cc +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "engine.h" - -#include - -#include "flutter/common/task_runners.h" -#include "flutter/fml/task_runner.h" -#include "flutter/shell/common/rasterizer.h" -#include "flutter/shell/common/run_configuration.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" -#include "platform_view.h" - -namespace flutter { - -static void UpdateNativeThreadLabelNames(const std::string& label, - const blink::TaskRunners& runners) { - auto set_thread_name = [](fxl::RefPtr runner, - std::string prefix, std::string suffix) { - if (!runner) { - return; - } - fml::TaskRunner::RunNowOrPostTask(runner, [name = prefix + suffix]() { - zx::thread::self().set_property(ZX_PROP_NAME, name.c_str(), name.size()); - }); - }; - set_thread_name(runners.GetPlatformTaskRunner(), label, ".platform"); - set_thread_name(runners.GetUITaskRunner(), label, ".ui"); - set_thread_name(runners.GetGPUTaskRunner(), label, ".gpu"); - set_thread_name(runners.GetIOTaskRunner(), label, ".io"); -} - -Engine::Engine(Delegate& delegate, - std::string thread_label, - component::ApplicationContext& application_context, - blink::Settings settings, - fxl::RefPtr isolate_snapshot, - fidl::InterfaceRequest view_owner, - UniqueFDIONS fdio_ns, - fidl::InterfaceRequest - outgoing_services_request) - : delegate_(delegate), - thread_label_(std::move(thread_label)), - settings_(std::move(settings)), - weak_factory_(this) { - if (zx::event::create(0, &vsync_event_) != ZX_OK) { - FXL_DLOG(ERROR) << "Could not create the vsync event."; - return; - } - - // Launch the threads that will be used to run the shell. These threads will - // be joined in the destructor. - for (auto& thread : host_threads_) { - thread.Run(); - } - - views_v1::ViewManagerPtr view_manager; - application_context.ConnectToEnvironmentService(view_manager.NewRequest()); - - zx::eventpair import_token, export_token; - if (zx::eventpair::create(0u, &import_token, &export_token) != ZX_OK) { - FXL_DLOG(ERROR) << "Could not create event pair."; - return; - } - - // Setup the session connection. - fidl::InterfaceHandle scenic; - view_manager->GetScenic(scenic.NewRequest()); - - // Grab the parent environent services. The platform view may want to access - // some of these services. - fidl::InterfaceHandle - parent_environment_service_provider; - application_context.environment()->GetServices( - parent_environment_service_provider.NewRequest()); - - // We need to manually schedule a frame when the session metrics change. - OnMetricsUpdate on_session_metrics_change_callback = std::bind( - &Engine::OnSessionMetricsDidChange, this, std::placeholders::_1); - - // Session errors may occur on the GPU thread, but we must terminate ourselves - // on the platform thread. - fxl::Closure on_session_error_callback = - [runner = fsl::MessageLoop::GetCurrent()->task_runner(), - weak = weak_factory_.GetWeakPtr()]() { - runner->PostTask([weak]() { - if (weak) { - weak->Terminate(); - } - }); - }; - - // Grab the accessibilty context writer that can understand the semtics tree - // on the platform view. - fidl::InterfaceHandle accessibility_context_writer; - application_context.ConnectToEnvironmentService( - accessibility_context_writer.NewRequest()); - - // Create the compositor context from the scenic pointer to create the - // rasterizer. - std::unique_ptr compositor_context = - std::make_unique( - std::move(scenic), // scenic - thread_label_, // debug label - std::move(import_token), // import token - on_session_metrics_change_callback, // session metrics did change - on_session_error_callback, // session did encounter error - vsync_event_.get() // vsync event handle - ); - - // Setup the callback that will instantiate the platform view. - shell::Shell::CreateCallback on_create_platform_view = - fxl::MakeCopyable([debug_label = thread_label_, // - parent_environment_service_provider = - std::move(parent_environment_service_provider), // - view_manager = view_manager.Unbind(), // - view_owner = std::move(view_owner), // - accessibility_context_writer = - std::move(accessibility_context_writer), // - export_token = std::move(export_token), // - vsync_handle = vsync_event_.get() // - - ](shell::Shell& shell) mutable { - return std::make_unique( - shell, // delegate - debug_label, // debug label - shell.GetTaskRunners(), // task runners - std::move(parent_environment_service_provider), // services - std::move(view_manager), // view manager - std::move(view_owner), // view owner - std::move(export_token), // export token - std::move( - accessibility_context_writer), // accessibility context writer - vsync_handle // vsync handle - ); - }); - - // Setup the callback that will instantiate the rasterizer. - shell::Shell::CreateCallback on_create_rasterizer = - fxl::MakeCopyable([compositor_context = std::move(compositor_context)]( - shell::Shell& shell) mutable { - return std::make_unique( - shell.GetTaskRunners(), // task runners - std::move(compositor_context) // compositor context - ); - }); - - // Get the task runners from the managed threads. The current thread will be - // used as the "platform" thread. - blink::TaskRunners task_runners( - thread_label_, // Dart thread labels - fsl::MessageLoop::GetCurrent()->task_runner(), // platform - host_threads_[0].TaskRunner(), // gpu - host_threads_[1].TaskRunner(), // ui - host_threads_[2].TaskRunner() // io - ); - - UpdateNativeThreadLabelNames(thread_label_, task_runners); - - settings_.verbose_logging = true; - - settings_.root_isolate_create_callback = - std::bind(&Engine::OnMainIsolateStart, this); - - settings_.root_isolate_shutdown_callback = - std::bind([weak = weak_factory_.GetWeakPtr(), - runner = task_runners.GetPlatformTaskRunner()]() { - runner->PostTask([weak = std::move(weak)] { - if (weak) { - weak->OnMainIsolateShutdown(); - } - }); - }); - - if (!isolate_snapshot) { - isolate_snapshot = - blink::DartVM::ForProcess(settings_)->GetIsolateSnapshot(); - } - - shell_ = shell::Shell::Create( - task_runners, // host task runners - settings_, // shell launch settings - std::move(isolate_snapshot), // isolate snapshot - on_create_platform_view, // platform view create callback - on_create_rasterizer // rasterizer create callback - ); - - if (!shell_) { - FXL_LOG(ERROR) << "Could not launch the shell with settings: " - << settings_.ToString(); - return; - } - - // Shell has been created. Before we run the engine, setup the isolate - // configurator. - { - auto view_container = - static_cast(shell_->GetPlatformView().get()) - ->TakeViewContainer(); - - component::ApplicationEnvironmentPtr application_environment; - application_context.ConnectToEnvironmentService( - application_environment.NewRequest()); - - isolate_configurator_ = std::make_unique( - std::move(fdio_ns), // - std::move(view_container), // - std::move(application_environment), // - std::move(outgoing_services_request) // - ); - } - - // This platform does not get a separate surface platform view creation - // notification. Fire one eagerly. - shell_->GetPlatformView()->NotifyCreated(); - - // Launch the engine in the appropriate configuration. - auto run_configuration = - shell::RunConfiguration::InferFromSettings(settings_); - - auto on_run_failure = [weak = weak_factory_.GetWeakPtr(), // - runner = - fsl::MessageLoop::GetCurrent()->task_runner() // - ]() { - // The engine could have been killed by the caller right after the - // constructor was called but before it could run on the UI thread. - if (weak) { - weak->Terminate(); - } - }; - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = shell_->GetEngine(), // - run_configuration = std::move(run_configuration), // - on_run_failure // - ]() mutable { - if (!engine) { - return; - } - if (!engine->Run(std::move(run_configuration))) { - on_run_failure(); - } - })); -} - -Engine::~Engine() { - shell_.reset(); - for (const auto& thread : host_threads_) { - thread.TaskRunner()->PostTask( - []() { fsl::MessageLoop::GetCurrent()->PostQuitTask(); }); - } -} - -std::pair Engine::GetEngineReturnCode() const { - std::pair code(false, 0); - if (!shell_) { - return code; - } - fxl::AutoResetWaitableEvent latch; - fml::TaskRunner::RunNowOrPostTask( - shell_->GetTaskRunners().GetUITaskRunner(), - [&latch, &code, engine = shell_->GetEngine()]() { - if (engine) { - code = engine->GetUIIsolateReturnCode(); - } - latch.Signal(); - }); - latch.Wait(); - return code; -} - -void Engine::OnMainIsolateStart() { - if (!isolate_configurator_ || - !isolate_configurator_->ConfigureCurrentIsolate(this)) { - FXL_LOG(ERROR) << "Could not configure some native embedder bindings for a " - "new root isolate."; - } - FXL_DLOG(INFO) << "Main isolate for engine '" << thread_label_ - << "' was started."; -} - -void Engine::OnMainIsolateShutdown() { - FXL_DLOG(INFO) << "Main isolate for engine '" << thread_label_ - << "' shutting down."; - Terminate(); -} - -void Engine::Terminate() { - delegate_.OnEngineTerminate(this); - // Warning. Do not do anything after this point as the delegate may have - // collected this object. -} - -void Engine::OnSessionMetricsDidChange(double device_pixel_ratio) { - if (!shell_) { - return; - } - - shell_->GetTaskRunners().GetPlatformTaskRunner()->PostTask( - [platform_view = shell_->GetPlatformView(), device_pixel_ratio]() { - if (platform_view) { - reinterpret_cast(platform_view.get()) - ->UpdateViewportMetrics(device_pixel_ratio); - } - }); -} - -// |mozart::NativesDelegate| -void Engine::OfferServiceProvider( - fidl::InterfaceHandle service_provider, - fidl::VectorPtr services) { - if (!shell_) { - return; - } - - shell_->GetTaskRunners().GetPlatformTaskRunner()->PostTask( - fxl::MakeCopyable([platform_view = shell_->GetPlatformView(), // - service_provider = std::move(service_provider), // - services = std::move(services) // - ]() mutable { - if (platform_view) { - reinterpret_cast(platform_view.get()) - ->OfferServiceProvider(std::move(service_provider), - std::move(services)); - } - })); -} - -} // namespace flutter diff --git a/content_handler/engine.h b/content_handler/engine.h deleted file mode 100644 index 24d942bba8d3a..0000000000000 --- a/content_handler/engine.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include -#include - -#include "flutter/shell/common/shell.h" -#include "isolate_configurator.h" -#include "lib/app/cpp/application_context.h" -#include "lib/fsl/threading/thread.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" - -namespace flutter { - -// Represents an instance of running Flutter engine along with the threads that -// host the same. -class Engine final : public mozart::NativesDelegate { - public: - class Delegate { - public: - virtual void OnEngineTerminate(const Engine* holder) = 0; - }; - - Engine(Delegate& delegate, - std::string thread_label, - component::ApplicationContext& application_context, - blink::Settings settings, - fxl::RefPtr isolate_snapshot, - fidl::InterfaceRequest view_owner, - UniqueFDIONS fdio_ns, - fidl::InterfaceRequest - outgoing_services_request); - - ~Engine(); - - // Returns the Dart return code for the root isolate if one is present. This - // call is thread safe and synchronous. This call must be made infrequently. - std::pair GetEngineReturnCode() const; - - private: - Delegate& delegate_; - const std::string thread_label_; - blink::Settings settings_; - std::array host_threads_; - std::unique_ptr isolate_configurator_; - std::unique_ptr shell_; - zx::event vsync_event_; - fxl::WeakPtrFactory weak_factory_; - - void OnMainIsolateStart(); - - void OnMainIsolateShutdown(); - - void Terminate(); - - void OnSessionMetricsDidChange(double device_pixel_ratio); - - // |mozart::NativesDelegate| - void OfferServiceProvider( - fidl::InterfaceHandle service_provider, - fidl::VectorPtr services); - - FXL_DISALLOW_COPY_AND_ASSIGN(Engine); -}; - -} // namespace flutter diff --git a/content_handler/fuchsia_font_manager.cc b/content_handler/fuchsia_font_manager.cc deleted file mode 100644 index a370997a579dc..0000000000000 --- a/content_handler/fuchsia_font_manager.cc +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "fuchsia_font_manager.h" - -#include - -#include "lib/fsl/vmo/sized_vmo.h" -#include "lib/fxl/logging.h" -#include "txt/asset_font_style_set.h" - -namespace txt { - -namespace { - -void UnmapMemory(const void* buffer, void* context) { - static_assert(sizeof(void*) == sizeof(uint64_t), "pointers aren't 64-bit"); - const uint64_t size = reinterpret_cast(context); - zx::vmar::root_self().unmap(reinterpret_cast(buffer), size); -} - -sk_sp MakeSkDataFromBuffer(const mem::Buffer& data) { - if (!fsl::SizedVmo::IsSizeValid(data.vmo, data.size) || - data.size > std::numeric_limits::max()) { - return nullptr; - } - uint64_t size = data.size; - uintptr_t buffer = 0; - zx_status_t status = zx::vmar::root_self().map(0, data.vmo, 0, size, - ZX_VM_FLAG_PERM_READ, &buffer); - if (status != ZX_OK) - return nullptr; - return SkData::MakeWithProc(reinterpret_cast(buffer), size, - UnmapMemory, reinterpret_cast(size)); -} - -fonts::FontSlant ToFontSlant(SkFontStyle::Slant slant) { - return (slant == SkFontStyle::kItalic_Slant) ? fonts::FontSlant::ITALIC - : fonts::FontSlant::UPRIGHT; -} - -} // anonymous namespace - -FuchsiaFontManager::FuchsiaFontManager(fonts::FontProviderSyncPtr provider) - : font_provider_(std::move(provider)) {} - -FuchsiaFontManager::~FuchsiaFontManager() = default; - -int FuchsiaFontManager::onCountFamilies() const { - FXL_DCHECK(false); - return 0; -} - -void FuchsiaFontManager::onGetFamilyName(int index, - SkString* familyName) const { - FXL_DCHECK(false); -} - -SkFontStyleSet* FuchsiaFontManager::onCreateStyleSet(int index) const { - FXL_DCHECK(false); - return nullptr; -} - -SkFontStyleSet* FuchsiaFontManager::onMatchFamily( - const char family_name[]) const { - sk_sp typeface(onMatchFamilyStyle(family_name, SkFontStyle())); - if (!typeface) - return nullptr; - - sk_sp font_style_set( - sk_make_sp()); - font_style_set->registerTypeface(typeface); - - return font_style_set.release(); -} - -SkTypeface* FuchsiaFontManager::onMatchFamilyStyle( - const char family_name[], - const SkFontStyle& style) const { - fonts::FontRequest request; - request.family = family_name; - request.weight = style.weight(); - request.width = style.width(); - request.slant = ToFontSlant(style.slant()); - - fonts::FontResponsePtr response; - if (!font_provider_->GetFont(std::move(request), &response)) { - FXL_DLOG(ERROR) << "Unable to contact the font provider. Did you run " - "Flutter in an environment that has a font manager?"; - return nullptr; - } - - sk_sp data = MakeSkDataFromBuffer(response->data.buffer); - if (!data) - return nullptr; - - sk_sp typeface = - SkFontMgr::RefDefault()->makeFromData(std::move(data)); - - return typeface.release(); -} - -SkTypeface* FuchsiaFontManager::onMatchFamilyStyleCharacter( - const char familyName[], - const SkFontStyle&, - const char* bcp47[], - int bcp47Count, - SkUnichar character) const { - return nullptr; -} - -SkTypeface* FuchsiaFontManager::onMatchFaceStyle(const SkTypeface*, - const SkFontStyle&) const { - FXL_DCHECK(false); - return nullptr; -} - -sk_sp FuchsiaFontManager::onMakeFromData(sk_sp, - int ttcIndex) const { - FXL_DCHECK(false); - return nullptr; -} - -sk_sp FuchsiaFontManager::onMakeFromStreamIndex( - std::unique_ptr, - int ttcIndex) const { - FXL_DCHECK(false); - return nullptr; -} - -sk_sp FuchsiaFontManager::onMakeFromStreamArgs( - std::unique_ptr, - const SkFontArguments&) const { - FXL_DCHECK(false); - return nullptr; -} - -sk_sp FuchsiaFontManager::onMakeFromFile(const char path[], - int ttcIndex) const { - FXL_DCHECK(false); - return nullptr; -} - -sk_sp FuchsiaFontManager::onLegacyMakeTypeface( - const char familyName[], - SkFontStyle) const { - FXL_DCHECK(false); - return nullptr; -} - -} // namespace txt diff --git a/content_handler/fuchsia_font_manager.h b/content_handler/fuchsia_font_manager.h deleted file mode 100644 index 266ac639fc983..0000000000000 --- a/content_handler/fuchsia_font_manager.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TXT_FUCHSIA_FONT_MANAGER_H_ -#define TXT_FUCHSIA_FONT_MANAGER_H_ - -#include -#include -#include "lib/fxl/macros.h" -#include "third_party/skia/include/core/SkStream.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/ports/SkFontMgr.h" - -namespace txt { - -class FuchsiaFontManager final : public SkFontMgr { - public: - FuchsiaFontManager(fonts::FontProviderSyncPtr provider); - - ~FuchsiaFontManager() override; - - protected: - // |SkFontMgr| - int onCountFamilies() const override; - - // |SkFontMgr| - void onGetFamilyName(int index, SkString* familyName) const override; - - // |SkFontMgr| - SkFontStyleSet* onMatchFamily(const char familyName[]) const override; - - // |SkFontMgr| - SkFontStyleSet* onCreateStyleSet(int index) const override; - - // |SkFontMgr| - SkTypeface* onMatchFamilyStyle(const char familyName[], - const SkFontStyle&) const override; - - // |SkFontMgr| - SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], - const SkFontStyle&, - const char* bcp47[], - int bcp47Count, - SkUnichar character) const override; - // |SkFontMgr| - SkTypeface* onMatchFaceStyle(const SkTypeface*, - const SkFontStyle&) const override; - - // |SkFontMgr| - sk_sp onMakeFromData(sk_sp, int ttcIndex) const override; - - // |SkFontMgr| - sk_sp onMakeFromStreamIndex(std::unique_ptr, - int ttcIndex) const override; - - // |SkFontMgr| - sk_sp onMakeFromStreamArgs(std::unique_ptr, - const SkFontArguments&) const override; - - // |SkFontMgr| - sk_sp onMakeFromFile(const char path[], - int ttcIndex) const override; - - // |SkFontMgr| - sk_sp onLegacyMakeTypeface(const char familyName[], - SkFontStyle) const override; - - FXL_DISALLOW_COPY_AND_ASSIGN(FuchsiaFontManager); - - private: - mutable fonts::FontProviderSyncPtr font_provider_; -}; - -} // namespace txt - -#endif // TXT_FUCHSIA_FONT_MANAGER_H_ diff --git a/content_handler/isolate_configurator.cc b/content_handler/isolate_configurator.cc deleted file mode 100644 index e03d6cfacb3bd..0000000000000 --- a/content_handler/isolate_configurator.cc +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "isolate_configurator.h" - -#include "dart-pkg/fuchsia/sdk_ext/fuchsia.h" -#include "dart-pkg/zircon/sdk_ext/handle.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" -#include "third_party/dart/runtime/include/dart_api.h" - -namespace flutter { - -IsolateConfigurator::IsolateConfigurator( - UniqueFDIONS fdio_ns, - fidl::InterfaceHandle view_container, - fidl::InterfaceHandle - application_environment, - fidl::InterfaceRequest - outgoing_services_request) - : fdio_ns_(std::move(fdio_ns)), - view_container_(std::move(view_container)), - application_environment_(std::move(application_environment)), - outgoing_services_request_(std::move(outgoing_services_request)) {} - -IsolateConfigurator::~IsolateConfigurator() = default; - -bool IsolateConfigurator::ConfigureCurrentIsolate( - mozart::NativesDelegate* natives_delegate) { - if (used_) { - return false; - } - used_ = true; - - BindFuchsia(); - BindZircon(); - BindDartIO(); - BindScenic(natives_delegate); - - // This is now owned by the Dart bindings. So relinquish our ownership of the - // handle. - (void)fdio_ns_.release(); - - return true; -} - -void IsolateConfigurator::BindFuchsia() { - fuchsia::dart::Initialize(std::move(application_environment_), - std::move(outgoing_services_request_)); -} - -void IsolateConfigurator::BindZircon() { - // Tell dart:zircon about the FDIO namespace configured for this instance. - Dart_Handle zircon_lib = Dart_LookupLibrary(tonic::ToDart("dart:zircon")); - DART_CHECK_VALID(zircon_lib); - - Dart_Handle namespace_type = - Dart_GetType(zircon_lib, tonic::ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - DART_CHECK_VALID( - Dart_SetField(namespace_type, // - tonic::ToDart("_namespace"), // - tonic::ToDart(reinterpret_cast(fdio_ns_.get())))); -} - -void IsolateConfigurator::BindDartIO() { - // Grab the dart:io lib. - Dart_Handle io_lib = Dart_LookupLibrary(tonic::ToDart("dart:io")); - DART_CHECK_VALID(io_lib); - - // Disable dart:io exit() - Dart_Handle embedder_config_type = - Dart_GetType(io_lib, tonic::ToDart("_EmbedderConfig"), 0, nullptr); - DART_CHECK_VALID(embedder_config_type); - DART_CHECK_VALID(Dart_SetField(embedder_config_type, - tonic::ToDart("_mayExit"), Dart_False())); - - // Tell dart:io about the FDIO namespace configured for this instance. - Dart_Handle namespace_type = - Dart_GetType(io_lib, tonic::ToDart("_Namespace"), 0, nullptr); - DART_CHECK_VALID(namespace_type); - Dart_Handle namespace_args[] = { - Dart_NewInteger(reinterpret_cast(fdio_ns_.get())), // - }; - DART_CHECK_VALID(namespace_args[0]); - DART_CHECK_VALID(Dart_Invoke(namespace_type, tonic::ToDart("_setupNamespace"), - 1, namespace_args)); -} - -void IsolateConfigurator::BindScenic( - mozart::NativesDelegate* natives_delegate) { - Dart_Handle mozart_internal = - Dart_LookupLibrary(tonic::ToDart("dart:mozart.internal")); - DART_CHECK_VALID(mozart_internal); - DART_CHECK_VALID(Dart_SetNativeResolver(mozart_internal, // - mozart::NativeLookup, // - mozart::NativeSymbol) // - ); - DART_CHECK_VALID(Dart_SetField( - mozart_internal, // - tonic::ToDart("_context"), // - tonic::DartConverter::ToDart(reinterpret_cast( - static_cast(natives_delegate))))); - DART_CHECK_VALID( - Dart_SetField(mozart_internal, // - tonic::ToDart("_viewContainer"), // - tonic::ToDart(zircon::dart::Handle::Create( - view_container_.TakeChannel().release())))); -} - -} // namespace flutter diff --git a/content_handler/isolate_configurator.h b/content_handler/isolate_configurator.h deleted file mode 100644 index c5e4aa3b2df9b..0000000000000 --- a/content_handler/isolate_configurator.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include -#include - -#include "lib/fxl/macros.h" -#include "lib/ui/flutter/sdk_ext/src/natives.h" -#include "unique_fdio_ns.h" - -namespace flutter { - -// Contains all the information necessary to configure a new root isolate. This -// is a single use item. The lifetime of this object must extend past that of -// the root isolate. -class IsolateConfigurator final { - public: - IsolateConfigurator( - UniqueFDIONS fdio_ns, - fidl::InterfaceHandle view_container, - fidl::InterfaceHandle - application_environment, - fidl::InterfaceRequest - outgoing_services_request); - - ~IsolateConfigurator(); - - // Can be used only once and only on the UI thread with the newly created - // isolate already current. - bool ConfigureCurrentIsolate(mozart::NativesDelegate* natives_delegate); - - private: - bool used_ = false; - UniqueFDIONS fdio_ns_; - fidl::InterfaceHandle view_container_; - fidl::InterfaceHandle - application_environment_; - fidl::InterfaceRequest outgoing_services_request_; - - void BindFuchsia(); - - void BindZircon(); - - void BindDartIO(); - - void BindScenic(mozart::NativesDelegate* natives_delegate); - - FXL_DISALLOW_COPY_AND_ASSIGN(IsolateConfigurator); -}; - -} // namespace flutter diff --git a/content_handler/main.cc b/content_handler/main.cc deleted file mode 100644 index 3cbea0047c759..0000000000000 --- a/content_handler/main.cc +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2018 The Fuchsia 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 -#include - -#include "application_runner.h" -#include "lib/fsl/tasks/message_loop.h" - -int main(int argc, char const* argv[]) { - fsl::MessageLoop loop; - - trace::TraceProvider provider(loop.async()); - FXL_DCHECK(provider.is_valid()) << "Trace provider must be valid."; - - FXL_DLOG(INFO) << "Flutter application services initialized."; - - flutter::ApplicationRunner runner; - - loop.Run(); - - FXL_DLOG(INFO) << "Flutter application services terminated."; - - return EXIT_SUCCESS; -} diff --git a/content_handler/meta/sandbox b/content_handler/meta/sandbox deleted file mode 100644 index 1fd4f971fdaac..0000000000000 --- a/content_handler/meta/sandbox +++ /dev/null @@ -1,7 +0,0 @@ -{ - "features": [ - "root-ssl-certificates", - "system-temp", - "vulkan" - ] -} diff --git a/content_handler/platform_view.cc b/content_handler/platform_view.cc deleted file mode 100644 index 4d7428d8cc2ec..0000000000000 --- a/content_handler/platform_view.cc +++ /dev/null @@ -1,577 +0,0 @@ -// Copyright 2018 The Fuchsia 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 RAPIDJSON_HAS_STDSTRING 1 - -#include "platform_view.h" - -#include - -#include "flutter/lib/ui/window/pointer_data.h" -#include "lib/app/cpp/connect.h" -#include "third_party/rapidjson/rapidjson/document.h" -#include "third_party/rapidjson/rapidjson/stringbuffer.h" -#include "third_party/rapidjson/rapidjson/writer.h" -#include "vsync_waiter.h" - -namespace flutter { - -constexpr char kFlutterPlatformChannel[] = "flutter/platform"; -constexpr char kTextInputChannel[] = "flutter/textinput"; -constexpr char kKeyEventChannel[] = "flutter/keyevent"; - -template -void SetInterfaceErrorHandler(fidl::InterfacePtr& interface, - std::string name) { - interface.set_error_handler( - [name]() { FXL_LOG(ERROR) << "Interface error on: " << name; }); -} - -PlatformView::PlatformView( - PlatformView::Delegate& delegate, - std::string debug_label, - blink::TaskRunners task_runners, - fidl::InterfaceHandle - parent_environment_service_provider_handle, - fidl::InterfaceHandle view_manager_handle, - fidl::InterfaceRequest view_owner, - zx::eventpair export_token, - fidl::InterfaceHandle accessibility_context_writer, - zx_handle_t vsync_event_handle) - : shell::PlatformView(delegate, std::move(task_runners)), - debug_label_(std::move(debug_label)), - view_manager_(view_manager_handle.Bind()), - view_listener_(this), - input_listener_(this), - ime_client_(this), - accessibility_bridge_(std::move(accessibility_context_writer)), - surface_(std::make_unique(debug_label_)), - vsync_event_handle_(vsync_event_handle) { - // Register all error handlers. - SetInterfaceErrorHandler(view_manager_, "View Manager"); - SetInterfaceErrorHandler(view_, "View"); - SetInterfaceErrorHandler(input_connection_, "Input Connection"); - SetInterfaceErrorHandler(ime_, "Input Method Editor"); - SetInterfaceErrorHandler(clipboard_, "Clipboard"); - SetInterfaceErrorHandler(service_provider_, "Service Provider"); - SetInterfaceErrorHandler(parent_environment_service_provider_, - "Parent Environment Service Provider"); - - // Create the view. - view_manager_->CreateView(view_.NewRequest(), // view - std::move(view_owner), // view owner - view_listener_.NewBinding(), // view listener - std::move(export_token), // export token - debug_label_ // diagnostic label - ); - - // Get the services from the created view. - view_->GetServiceProvider(service_provider_.NewRequest()); - - // Get the view conatiner. This will need to be returned to the isolate - // configurator so that it can setup Mozart bindings later. - view_->GetContainer(view_container_.NewRequest()); - - // Get the input connection from the services of the view. - component::ConnectToService(service_provider_.get(), - input_connection_.NewRequest()); - - // Set the input listener on the input connection. - input_connection_->SetEventListener(input_listener_.NewBinding()); - - // Access the clipboard. - parent_environment_service_provider_ = - parent_environment_service_provider_handle.Bind(); - component::ConnectToService(parent_environment_service_provider_.get(), - clipboard_.NewRequest()); - - // Finally! Register the native platform message handlers. - RegisterPlatformMessageHandlers(); -} - -PlatformView::~PlatformView() = default; - -void PlatformView::OfferServiceProvider( - fidl::InterfaceHandle service_provider, - fidl::VectorPtr services) { - view_->OfferServiceProvider(std::move(service_provider), std::move(services)); -} - -void PlatformView::RegisterPlatformMessageHandlers() { - platform_message_handlers_[kFlutterPlatformChannel] = - std::bind(&PlatformView::HandleFlutterPlatformChannelPlatformMessage, // - this, // - std::placeholders::_1); - platform_message_handlers_[kTextInputChannel] = - std::bind(&PlatformView::HandleFlutterTextInputChannelPlatformMessage, // - this, // - std::placeholders::_1); -} - -fidl::InterfaceHandle -PlatformView::TakeViewContainer() { - return std::move(view_container_); -} - -// |views_v1::ViewListener| -void PlatformView::OnPropertiesChanged(views_v1::ViewProperties properties, - OnPropertiesChangedCallback callback) { - if (properties.view_layout) { - UpdateViewportMetrics(*properties.view_layout); - } - callback(); -} - -void PlatformView::UpdateViewportMetrics(const views_v1::ViewLayout& layout) { - metrics_.size.width = layout.size.width; - metrics_.size.height = layout.size.height; - metrics_.padding.left = layout.inset.left; - metrics_.padding.top = layout.inset.top; - metrics_.padding.right = layout.inset.right; - metrics_.padding.bottom = layout.inset.bottom; - - FlushViewportMetrics(); -} - -void PlatformView::UpdateViewportMetrics(double pixel_ratio) { - metrics_.scale = pixel_ratio; - - FlushViewportMetrics(); -} - -void PlatformView::FlushViewportMetrics() { - const auto scale = metrics_.scale; - blink::ViewportMetrics metrics = { - .device_pixel_ratio = static_cast(scale), - - .physical_width = static_cast(metrics_.size.width * scale), - .physical_height = static_cast(metrics_.size.height * scale), - - .physical_padding_top = - static_cast(metrics_.padding.top * scale), - .physical_padding_right = - static_cast(metrics_.padding.right * scale), - .physical_padding_bottom = - static_cast(metrics_.padding.bottom * scale), - .physical_padding_left = - static_cast(metrics_.padding.left * scale), - - .physical_view_inset_top = - static_cast(metrics_.view_inset.top * scale), - .physical_view_inset_right = - static_cast(metrics_.view_inset.right * scale), - .physical_view_inset_bottom = - static_cast(metrics_.view_inset.bottom * scale), - .physical_view_inset_left = - static_cast(metrics_.view_inset.left * scale), - }; - - SetViewportMetrics(metrics); -} - -// |input::InputMethodEditorClient| -void PlatformView::DidUpdateState(input::TextInputState state, - std::unique_ptr) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - rapidjson::Value encoded_state(rapidjson::kObjectType); - encoded_state.AddMember("text", state.text.get(), allocator); - encoded_state.AddMember("selectionBase", state.selection.base, allocator); - encoded_state.AddMember("selectionExtent", state.selection.extent, allocator); - switch (state.selection.affinity) { - case input::TextAffinity::UPSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.upstream"), - allocator); - break; - case input::TextAffinity::DOWNSTREAM: - encoded_state.AddMember("selectionAffinity", - rapidjson::Value("TextAffinity.downstream"), - allocator); - break; - } - encoded_state.AddMember("selectionIsDirectional", true, allocator); - encoded_state.AddMember("composingBase", state.composing.start, allocator); - encoded_state.AddMember("composingExtent", state.composing.end, allocator); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - args.PushBack(encoded_state, allocator); - - document.SetObject(); - document.AddMember("method", - rapidjson::Value("TextInputClient.updateEditingState"), - allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, // channel - std::vector(data, data + buffer.GetSize()), // message - nullptr) // response - ); -} - -// |input::InputMethodEditorClient| -void PlatformView::OnAction(input::InputMethodAction action) { - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - - rapidjson::Value args(rapidjson::kArrayType); - args.PushBack(current_text_input_client_, allocator); - - // Done is currently the only text input action defined by Flutter. - args.PushBack("TextInputAction.done", allocator); - - document.SetObject(); - document.AddMember( - "method", rapidjson::Value("TextInputClient.performAction"), allocator); - document.AddMember("args", args, allocator); - - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - DispatchPlatformMessage(fxl::MakeRefCounted( - kTextInputChannel, // channel - std::vector(data, data + buffer.GetSize()), // message - nullptr) // response - ); -} - -// |input::InputListener| -void PlatformView::OnEvent(input::InputEvent event, OnEventCallback callback) { - using Type = input::InputEvent::Tag; - switch (event.Which()) { - case Type::kPointer: - callback(OnHandlePointerEvent(event.pointer())); - return; - case Type::kKeyboard: - callback(OnHandleKeyboardEvent(event.keyboard())); - return; - case Type::kFocus: - callback(OnHandleFocusEvent(event.focus())); - return; - default: - break; - } - - callback(false); -} - -static blink::PointerData::Change GetChangeFromPointerEventPhase( - input::PointerEventPhase phase) { - switch (phase) { - case input::PointerEventPhase::ADD: - return blink::PointerData::Change::kAdd; - case input::PointerEventPhase::HOVER: - return blink::PointerData::Change::kHover; - case input::PointerEventPhase::DOWN: - return blink::PointerData::Change::kDown; - case input::PointerEventPhase::MOVE: - return blink::PointerData::Change::kMove; - case input::PointerEventPhase::UP: - return blink::PointerData::Change::kUp; - case input::PointerEventPhase::REMOVE: - return blink::PointerData::Change::kRemove; - case input::PointerEventPhase::CANCEL: - return blink::PointerData::Change::kCancel; - default: - return blink::PointerData::Change::kCancel; - } -} - -static blink::PointerData::DeviceKind GetKindFromPointerType( - input::PointerEventType type) { - switch (type) { - case input::PointerEventType::TOUCH: - return blink::PointerData::DeviceKind::kTouch; - case input::PointerEventType::MOUSE: - return blink::PointerData::DeviceKind::kMouse; - default: - return blink::PointerData::DeviceKind::kTouch; - } -} - -bool PlatformView::OnHandlePointerEvent(const input::PointerEvent& pointer) { - blink::PointerData pointer_data; - pointer_data.time_stamp = pointer.event_time / 1000; - pointer_data.change = GetChangeFromPointerEventPhase(pointer.phase); - pointer_data.kind = GetKindFromPointerType(pointer.type); - pointer_data.device = pointer.pointer_id; - pointer_data.physical_x = pointer.x * metrics_.scale; - pointer_data.physical_y = pointer.y * metrics_.scale; - // Buttons are single bit values starting with kMousePrimaryButton = 1. - pointer_data.buttons = static_cast(pointer.buttons); - - switch (pointer_data.change) { - case blink::PointerData::Change::kDown: - down_pointers_.insert(pointer_data.device); - break; - case blink::PointerData::Change::kCancel: - case blink::PointerData::Change::kUp: - down_pointers_.erase(pointer_data.device); - break; - case blink::PointerData::Change::kMove: - if (down_pointers_.count(pointer_data.device) == 0) { - pointer_data.change = blink::PointerData::Change::kHover; - } - break; - case blink::PointerData::Change::kAdd: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received add event for down pointer."; - } - break; - case blink::PointerData::Change::kRemove: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received remove event for down pointer."; - } - break; - case blink::PointerData::Change::kHover: - if (down_pointers_.count(pointer_data.device) != 0) { - FXL_DLOG(ERROR) << "Received hover event for down pointer."; - } - break; - } - - auto packet = std::make_unique(1); - packet->SetPointerData(0, pointer_data); - DispatchPointerDataPacket(std::move(packet)); - return true; -} - -bool PlatformView::OnHandleKeyboardEvent(const input::KeyboardEvent& keyboard) { - const char* type = nullptr; - if (keyboard.phase == input::KeyboardEventPhase::PRESSED) { - type = "keydown"; - } else if (keyboard.phase == input::KeyboardEventPhase::REPEAT) { - type = "keydown"; // TODO change this to keyrepeat - } else if (keyboard.phase == input::KeyboardEventPhase::RELEASED) { - type = "keyup"; - } - - if (type == nullptr) { - FXL_DLOG(ERROR) << "Unknown key event phase."; - return false; - } - - rapidjson::Document document; - auto& allocator = document.GetAllocator(); - document.SetObject(); - document.AddMember("type", rapidjson::Value(type, strlen(type)), allocator); - document.AddMember("keymap", rapidjson::Value("fuchsia"), allocator); - document.AddMember("hidUsage", keyboard.hid_usage, allocator); - document.AddMember("codePoint", keyboard.code_point, allocator); - document.AddMember("modifiers", keyboard.modifiers, allocator); - rapidjson::StringBuffer buffer; - rapidjson::Writer writer(buffer); - document.Accept(writer); - - const uint8_t* data = reinterpret_cast(buffer.GetString()); - DispatchPlatformMessage(fxl::MakeRefCounted( - kKeyEventChannel, // channel - std::vector(data, data + buffer.GetSize()), // data - nullptr) // response - ); - - return true; -} - -bool PlatformView::OnHandleFocusEvent(const input::FocusEvent& focus) { - if (!focus.focused && current_text_input_client_ != 0) { - current_text_input_client_ = 0; - if (ime_) { - ime_->Hide(); - ime_ = nullptr; - } - if (ime_client_.is_bound()) { - ime_client_.Unbind(); - } - return true; - } - return false; -} - -// |shell::PlatformView| -std::unique_ptr PlatformView::CreateVSyncWaiter() { - return std::make_unique( - debug_label_, vsync_event_handle_, task_runners_); -} - -// |shell::PlatformView| -std::unique_ptr PlatformView::CreateRenderingSurface() { - // This platform does not repeatly lose and gain a surface connection. So the - // surface is setup once during platform view setup and and returned to the - // shell on the initial (and only) |NotifyCreated| call. - return std::move(surface_); -} - -// |shell::PlatformView| -void PlatformView::HandlePlatformMessage( - fxl::RefPtr message) { - if (!message) { - return; - } - auto found = platform_message_handlers_.find(message->channel()); - if (found == platform_message_handlers_.end()) { - FXL_DLOG(ERROR) - << "Platform view received message on channel '" << message->channel() - << "' with no registed handler. And empty response will be generated. " - "Please implement the native message handler."; - PlatformView::HandlePlatformMessage(std::move(message)); - return; - } - found->second(std::move(message)); -} - -// |shell::PlatformView| -void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) { - accessibility_bridge_.UpdateSemantics(update); -} - -// Channel handler for kFlutterPlatformChannel -void PlatformView::HandleFlutterPlatformChannelPlatformMessage( - fxl::RefPtr message) { - FXL_DCHECK(message->channel() == kFlutterPlatformChannel); - const auto& data = message->data(); - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) { - return; - } - - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) { - return; - } - - fxl::RefPtr response = message->response(); - if (method->value == "Clipboard.setData") { - auto text = root["args"]["text"].GetString(); - clipboard_->Push(text); - response->CompleteEmpty(); - } else if (method->value == "Clipboard.getData") { - clipboard_->Peek([response](fidl::StringPtr text) { - rapidjson::StringBuffer json_buffer; - rapidjson::Writer writer(json_buffer); - writer.StartArray(); - writer.StartObject(); - writer.Key("text"); - writer.String(text.get()); - writer.EndObject(); - writer.EndArray(); - std::string result = json_buffer.GetString(); - response->Complete(std::vector{result.begin(), result.end()}); - }); - } else { - response->CompleteEmpty(); - } -} - -// Channel handler for kTextInputChannel -void PlatformView::HandleFlutterTextInputChannelPlatformMessage( - fxl::RefPtr message) { - FXL_DCHECK(message->channel() == kTextInputChannel); - const auto& data = message->data(); - rapidjson::Document document; - document.Parse(reinterpret_cast(data.data()), data.size()); - if (document.HasParseError() || !document.IsObject()) { - return; - } - auto root = document.GetObject(); - auto method = root.FindMember("method"); - if (method == root.MemberEnd() || !method->value.IsString()) { - return; - } - - if (method->value == "TextInput.show") { - if (ime_) { - ime_->Show(); - } - } else if (method->value == "TextInput.hide") { - if (ime_) { - ime_->Hide(); - } - } else if (method->value == "TextInput.setClient") { - current_text_input_client_ = 0; - if (ime_client_.is_bound()) - ime_client_.Unbind(); - ime_ = nullptr; - - auto args = root.FindMember("args"); - if (args == root.MemberEnd() || !args->value.IsArray() || - args->value.Size() != 2) - return; - const auto& configuration = args->value[1]; - if (!configuration.IsObject()) { - return; - } - // TODO(abarth): Read the keyboard type from the configuration. - current_text_input_client_ = args->value[0].GetInt(); - - auto initial_text_input_state = input::TextInputState{}; - initial_text_input_state.text = ""; - input_connection_->GetInputMethodEditor( - input::KeyboardType::TEXT, // keyboard type - input::InputMethodAction::DONE, // input method action - initial_text_input_state, // initial state - ime_client_.NewBinding(), // client - ime_.NewRequest() // editor - ); - } else if (method->value == "TextInput.setEditingState") { - if (ime_) { - auto args_it = root.FindMember("args"); - if (args_it == root.MemberEnd() || !args_it->value.IsObject()) { - return; - } - const auto& args = args_it->value; - input::TextInputState state; - state.text = ""; - // TODO(abarth): Deserialize state. - auto text = args.FindMember("text"); - if (text != args.MemberEnd() && text->value.IsString()) - state.text = text->value.GetString(); - auto selection_base = args.FindMember("selectionBase"); - if (selection_base != args.MemberEnd() && selection_base->value.IsInt()) - state.selection.base = selection_base->value.GetInt(); - auto selection_extent = args.FindMember("selectionExtent"); - if (selection_extent != args.MemberEnd() && - selection_extent->value.IsInt()) - state.selection.extent = selection_extent->value.GetInt(); - auto selection_affinity = args.FindMember("selectionAffinity"); - if (selection_affinity != args.MemberEnd() && - selection_affinity->value.IsString() && - selection_affinity->value == "TextAffinity.upstream") - state.selection.affinity = input::TextAffinity::UPSTREAM; - else - state.selection.affinity = input::TextAffinity::DOWNSTREAM; - // We ignore selectionIsDirectional because that concept doesn't exist on - // Fuchsia. - auto composing_base = args.FindMember("composingBase"); - if (composing_base != args.MemberEnd() && composing_base->value.IsInt()) - state.composing.start = composing_base->value.GetInt(); - auto composing_extent = args.FindMember("composingExtent"); - if (composing_extent != args.MemberEnd() && - composing_extent->value.IsInt()) - state.composing.end = composing_extent->value.GetInt(); - ime_->SetState(std::move(state)); - } - } else if (method->value == "TextInput.clearClient") { - current_text_input_client_ = 0; - if (ime_client_.is_bound()) - ime_client_.Unbind(); - ime_ = nullptr; - } else { - FXL_DLOG(ERROR) << "Unknown " << message->channel() << " method " - << method->value.GetString(); - } -} - -} // namespace flutter diff --git a/content_handler/platform_view.h b/content_handler/platform_view.h deleted file mode 100644 index fde06eaf5b59f..0000000000000 --- a/content_handler/platform_view.h +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include - -#include -#include -#include -#include - -#include "accessibility_bridge.h" -#include "flutter/lib/ui/window/viewport_metrics.h" -#include "flutter/shell/common/platform_view.h" -#include "lib/fidl/cpp/binding.h" -#include "lib/fxl/macros.h" -#include "surface.h" - -namespace flutter { - -// The per engine component residing on the platform thread is responsible for -// all platform specific integrations. -class PlatformView final : public shell::PlatformView, - public views_v1::ViewListener, - public input::InputMethodEditorClient, - public input::InputListener { - public: - PlatformView(PlatformView::Delegate& delegate, - std::string debug_label, - blink::TaskRunners task_runners, - fidl::InterfaceHandle - parent_environment_service_provider, - fidl::InterfaceHandle view_manager, - fidl::InterfaceRequest view_owner, - zx::eventpair export_token, - fidl::InterfaceHandle - accessibility_context_writer, - zx_handle_t vsync_event_handle); - - ~PlatformView(); - - void UpdateViewportMetrics(double pixel_ratio); - - fidl::InterfaceHandle TakeViewContainer(); - - void OfferServiceProvider( - fidl::InterfaceHandle service_provider, - fidl::VectorPtr services); - - private: - const std::string debug_label_; - views_v1::ViewManagerPtr view_manager_; - views_v1::ViewPtr view_; - fidl::InterfaceHandle view_container_; - component::ServiceProviderPtr service_provider_; - fidl::Binding view_listener_; - input::InputConnectionPtr input_connection_; - fidl::Binding input_listener_; - int current_text_input_client_ = 0; - fidl::Binding ime_client_; - input::InputMethodEditorPtr ime_; - component::ServiceProviderPtr parent_environment_service_provider_; - modular::ClipboardPtr clipboard_; - AccessibilityBridge accessibility_bridge_; - std::unique_ptr surface_; - blink::LogicalMetrics metrics_; - std::set down_pointers_; - std::map< - std::string /* channel */, - std::function /* message */)> /* handler */> - platform_message_handlers_; - zx_handle_t vsync_event_handle_ = 0; - - void RegisterPlatformMessageHandlers(); - - void UpdateViewportMetrics(const views_v1::ViewLayout& layout); - - void FlushViewportMetrics(); - - // |views_v1::ViewListener| - void OnPropertiesChanged(views_v1::ViewProperties properties, - OnPropertiesChangedCallback callback) override; - - // |input::InputMethodEditorClient| - void DidUpdateState(input::TextInputState state, - std::unique_ptr event) override; - - // |input::InputMethodEditorClient| - void OnAction(input::InputMethodAction action) override; - - // |input::InputListener| - void OnEvent(input::InputEvent event, OnEventCallback callback) override; - - bool OnHandlePointerEvent(const input::PointerEvent& pointer); - - bool OnHandleKeyboardEvent(const input::KeyboardEvent& keyboard); - - bool OnHandleFocusEvent(const input::FocusEvent& focus); - - // |shell::PlatformView| - std::unique_ptr CreateVSyncWaiter() override; - - // |shell::PlatformView| - std::unique_ptr CreateRenderingSurface() override; - - // |shell::PlatformView| - void HandlePlatformMessage( - fxl::RefPtr message) override; - - // |shell::PlatformView| - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; - - // Channel handler for kFlutterPlatformChannel - void HandleFlutterPlatformChannelPlatformMessage( - fxl::RefPtr message); - - // Channel handler for kTextInputChannel - void HandleFlutterTextInputChannelPlatformMessage( - fxl::RefPtr message); - - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformView); -}; - -} // namespace flutter diff --git a/content_handler/session_connection.cc b/content_handler/session_connection.cc deleted file mode 100644 index 879b45a63b8a3..0000000000000 --- a/content_handler/session_connection.cc +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2017 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. - -#include "session_connection.h" - -#include "lib/fidl/cpp/optional.h" -#include "lib/ui/scenic/fidl_helpers.h" -#include "vsync_waiter.h" - -namespace flutter { - -SessionConnection::SessionConnection( - fidl::InterfaceHandle scenic_handle, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback, - zx_handle_t vsync_event_handle) - : debug_label_(std::move(debug_label)), - scenic_(scenic_handle.Bind()), - session_(scenic_.get()), - root_node_(&session_), - surface_producer_(std::make_unique(&session_)), - scene_update_context_(&session_, surface_producer_.get()), - metrics_changed_callback_(std::move(session_metrics_did_change_callback)), - vsync_event_handle_(vsync_event_handle) { - session_.set_error_handler(std::move(session_error_callback)); - session_.set_event_handler(std::bind(&SessionConnection::OnSessionEvents, - this, std::placeholders::_1)); - - root_node_.Bind(std::move(import_token)); - root_node_.SetEventMask(gfx::kMetricsEventMask); - - // Signal is initially high inidicating availability of the session. - ToggleSignal(vsync_event_handle_, true); - - PresentSession(); -} - -SessionConnection::~SessionConnection() = default; - -void SessionConnection::OnSessionEvents(fidl::VectorPtr events) { - using Type = gfx::Event::Tag; - - for (auto& raw_event : *events) { - if (!raw_event.is_gfx()) { - continue; - } - - auto& event = raw_event.gfx(); - - switch (event.Which()) { - case Type::kMetrics: { - if (event.metrics().node_id == root_node_.id()) { - auto& metrics = event.metrics().metrics; - double device_pixel_ratio = metrics.scale_x; - scene_update_context_.set_metrics( - fidl::MakeOptional(std::move(metrics))); - if (metrics_changed_callback_) { - metrics_changed_callback_(device_pixel_ratio); - } - } - } break; - default: - break; - } - } -} - -void SessionConnection::Present(flow::CompositorContext::ScopedFrame& frame) { - // Flush all session ops. Paint tasks have not yet executed but those are - // fenced. The compositor can start processing ops while we finalize paint - // tasks. - PresentSession(); - - // Execute paint tasks and signal fences. - auto surfaces_to_submit = scene_update_context_.ExecutePaintTasks(frame); - - // Tell the surface producer that a present has occurred so it can perform - // book-keeping on buffer caches. - surface_producer_->OnSurfacesPresented(std::move(surfaces_to_submit)); - - // Prepare for the next frame. These ops won't be processed till the next - // present. - EnqueueClearOps(); -} - -void SessionConnection::EnqueueClearOps() { - // We are going to be sending down a fresh node hierarchy every frame. So just - // enqueue a detach op on the imported root node. - session_.Enqueue(scenic_lib::NewDetachChildrenCommand(root_node_.id())); -} - -void SessionConnection::PresentSession() { - ToggleSignal(vsync_event_handle_, false); - session_.Present(0, // presentation_time. (placeholder). - [handle = vsync_event_handle_](auto) { - ToggleSignal(handle, true); - } // callback - ); -} - -void SessionConnection::ToggleSignal(zx_handle_t handle, bool set) { - const auto signal = flutter::VsyncWaiter::SessionPresentSignal; - auto status = zx_object_signal(handle, // handle - set ? 0 : signal, // clear mask - set ? signal : 0 // set mask - ); - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Could not toggle vsync signal: " << set; - } -} - -} // namespace flutter diff --git a/content_handler/session_connection.h b/content_handler/session_connection.h deleted file mode 100644 index bc107e1d50095..0000000000000 --- a/content_handler/session_connection.h +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2017 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. - -#pragma once - -#include - -#include "flutter/flow/compositor_context.h" -#include "flutter/flow/scene_update_context.h" -#include "lib/fidl/cpp/interface_handle.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" -#include "lib/ui/scenic/client/resources.h" -#include "lib/ui/scenic/client/session.h" -#include "vulkan_surface_producer.h" - -namespace flutter { - -using OnMetricsUpdate = std::function; - -// The component residing on the GPU thread that is responsible for -// maintaining the Scenic session connection and presenting node updates. -class SessionConnection final { - public: - SessionConnection(fidl::InterfaceHandle scenic, - std::string debug_label, - zx::eventpair import_token, - OnMetricsUpdate session_metrics_did_change_callback, - fxl::Closure session_error_callback, - zx_handle_t vsync_event_handle); - - ~SessionConnection(); - - bool has_metrics() const { return scene_update_context_.has_metrics(); } - - const gfx::MetricsPtr& metrics() const { - return scene_update_context_.metrics(); - } - - flow::SceneUpdateContext& scene_update_context() { - return scene_update_context_; - } - - scenic_lib::ImportNode& root_node() { return root_node_; } - - void Present(flow::CompositorContext::ScopedFrame& frame); - - private: - const std::string debug_label_; - ui::ScenicPtr scenic_; - scenic_lib::Session session_; - scenic_lib::ImportNode root_node_; - std::unique_ptr surface_producer_; - flow::SceneUpdateContext scene_update_context_; - OnMetricsUpdate metrics_changed_callback_; - zx_handle_t vsync_event_handle_; - - void OnSessionEvents(fidl::VectorPtr events); - - void EnqueueClearOps(); - - void PresentSession(); - - static void ToggleSignal(zx_handle_t handle, bool raise); - - FXL_DISALLOW_COPY_AND_ASSIGN(SessionConnection); -}; - -} // namespace flutter diff --git a/content_handler/surface.cc b/content_handler/surface.cc deleted file mode 100644 index 8f3699aa04da0..0000000000000 --- a/content_handler/surface.cc +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "surface.h" - -#include -#include -#include -#include - -#include "lib/fxl/files/unique_fd.h" - -namespace flutter { - -Surface::Surface(std::string debug_label) - : debug_label_(std::move(debug_label)) {} - -Surface::~Surface() = default; - -// |shell::Surface| -bool Surface::IsValid() { - return valid_; -} - -// |shell::Surface| -std::unique_ptr Surface::AcquireFrame( - const SkISize& size) { - return std::make_unique( - nullptr, [](const shell::SurfaceFrame& surface_frame, SkCanvas* canvas) { - return true; - }); -} - -// |shell::Surface| -GrContext* Surface::GetContext() { - return nullptr; -} - -static zx_status_t DriverWatcher(int dirfd, - int event, - const char* fn, - void* cookie) { - if (event == WATCH_EVENT_ADD_FILE && !strcmp(fn, "000")) { - return ZX_ERR_STOP; - } - return ZX_OK; -} - -bool Surface::CanConnectToDisplay() { - constexpr char kGpuDriverClass[] = "/dev/class/gpu"; - fxl::UniqueFD fd(open(kGpuDriverClass, O_DIRECTORY | O_RDONLY)); - if (fd.get() < 0) { - FXL_DLOG(ERROR) << "Failed to open " << kGpuDriverClass; - return false; - } - - zx_status_t status = fdio_watch_directory( - fd.get(), DriverWatcher, zx_deadline_after(ZX_SEC(5)), nullptr); - return status == ZX_ERR_STOP; -} - -} // namespace flutter diff --git a/content_handler/surface.h b/content_handler/surface.h deleted file mode 100644 index 99f4079f9c2df..0000000000000 --- a/content_handler/surface.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "compositor_context.h" -#include "flutter/fml/memory/weak_ptr.h" -#include "flutter/shell/common/surface.h" -#include "lib/fxl/macros.h" - -namespace flutter { - -// The interface between the Flutter rasterizer and the underlying platform. May -// be constructed on any thread but will be used by the engine only on the GPU -// thread. -class Surface final : public shell::Surface { - public: - Surface(std::string debug_label); - - ~Surface() override; - - private: - const bool valid_ = CanConnectToDisplay(); - const std::string debug_label_; - - // |shell::Surface| - bool IsValid() override; - - // |shell::Surface| - std::unique_ptr AcquireFrame( - const SkISize& size) override; - - // |shell::Surface| - GrContext* GetContext() override; - - static bool CanConnectToDisplay(); - - FXL_DISALLOW_COPY_AND_ASSIGN(Surface); -}; - -} // namespace flutter diff --git a/content_handler/task_observers.cc b/content_handler/task_observers.cc deleted file mode 100644 index f23265e7b1653..0000000000000 --- a/content_handler/task_observers.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "task_observers.h" - -#include - -#include "lib/fsl/tasks/message_loop.h" - -namespace flutter { - -thread_local std::map tTaskObservers; - -static void ExecuteAfterTaskObservers() { - for (const auto& callback : tTaskObservers) { - callback.second(); - } -} - -void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, - fxl::Closure observer) { - if (!observer) { - return; - } - - if (tTaskObservers.size() == 0) { - fsl::MessageLoop::GetCurrent()->SetAfterTaskCallback( - std::bind(&ExecuteAfterTaskObservers)); - } - - tTaskObservers[key] = observer; -} - -void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key) { - tTaskObservers.erase(key); - - if (tTaskObservers.size() == 0) { - fsl::MessageLoop::GetCurrent()->ClearAfterTaskCallback(); - } -} - -} // namespace flutter diff --git a/content_handler/task_observers.h b/content_handler/task_observers.h deleted file mode 100644 index 53f6b96222000..0000000000000 --- a/content_handler/task_observers.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "lib/fxl/functional/closure.h" - -namespace flutter { - -void CurrentMessageLoopAddAfterTaskObserver(intptr_t key, - fxl::Closure observer); - -void CurrentMessageLoopRemoveAfterTaskObserver(intptr_t key); - -} // namespace flutter diff --git a/content_handler/unique_fdio_ns.h b/content_handler/unique_fdio_ns.h deleted file mode 100644 index 726137d729f85..0000000000000 --- a/content_handler/unique_fdio_ns.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include "fdio/namespace.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/memory/unique_object.h" - -namespace flutter { - -struct UniqueFDIONSTraits { - static fdio_ns_t* InvalidValue() { return nullptr; } - - static bool IsValid(fdio_ns_t* ns) { return ns != InvalidValue(); } - - static void Free(fdio_ns_t* ns) { - auto status = fdio_ns_destroy(ns); - FXL_DCHECK(status == ZX_OK); - } -}; - -using UniqueFDIONS = fxl::UniqueObject; - -inline UniqueFDIONS UniqueFDIONSCreate() { - fdio_ns_t* ns = nullptr; - if (fdio_ns_create(&ns) == ZX_OK) { - return UniqueFDIONS{ns}; - } - return UniqueFDIONS{nullptr}; -} - -} // namespace flutter diff --git a/content_handler/vsync_waiter.cc b/content_handler/vsync_waiter.cc deleted file mode 100644 index 026a2b242263a..0000000000000 --- a/content_handler/vsync_waiter.cc +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2018 The Fuchsia 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 "third_party/flutter/content_handler/vsync_waiter.h" - -#include "lib/fsl/tasks/message_loop.h" - -namespace flutter { - -VsyncWaiter::VsyncWaiter(std::string debug_label, - zx_handle_t session_present_handle, - blink::TaskRunners task_runners) - : shell::VsyncWaiter(task_runners), - debug_label_(std::move(debug_label)), - session_wait_(session_present_handle, SessionPresentSignal), - phase_(fxl::TimePoint::Now()), - weak_factory_(this) { - auto wait_handler = [&](async_t* async, // - async::Wait* wait, // - zx_status_t status, // - const zx_packet_signal_t* signal // - ) { - if (status != ZX_OK) { - FXL_LOG(ERROR) << "Vsync wait failed."; - return; - } - - wait->Cancel(); - - FireCallbackNow(); - }; - - session_wait_.set_handler(wait_handler); -} - -VsyncWaiter::~VsyncWaiter() { - session_wait_.Cancel(); -} - -static constexpr fxl::TimeDelta kFrameInterval = - fxl::TimeDelta::FromSecondsF(1.0 / 60.0); - -static fxl::TimePoint SnapToNextPhase(fxl::TimePoint value, - fxl::TimePoint phase, - fxl::TimeDelta interval) { - fxl::TimeDelta offset = (phase - value) % interval; - if (offset != fxl::TimeDelta::Zero()) { - offset = offset + interval; - } - return value + offset; -} - -void VsyncWaiter::AwaitVSync() { - fxl::TimePoint now = fxl::TimePoint::Now(); - fxl::TimePoint next = SnapToNextPhase(now, phase_, kFrameInterval); - task_runners_.GetUITaskRunner()->PostDelayedTask( - [self = weak_factory_.GetWeakPtr()] { - if (self) { - self->FireCallbackWhenSessionAvailable(); - } - }, - next - now); -} - -void VsyncWaiter::FireCallbackWhenSessionAvailable() { - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - if (session_wait_.Begin(fsl::MessageLoop::GetCurrent()->async()) != ZX_OK) { - FXL_LOG(ERROR) << "Could not begin wait for Vsync."; - } -} - -void VsyncWaiter::FireCallbackNow() { - FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); - - auto now = fxl::TimePoint::Now(); - - // We don't know the display refresh rate on this platform. Since the target - // time is advisory, assume kFrameInterval. - auto next = now + kFrameInterval; - - phase_ = now; - - FireCallback(now, next); -} - -} // namespace flutter diff --git a/content_handler/vsync_waiter.h b/content_handler/vsync_waiter.h deleted file mode 100644 index 31c0b46247cc8..0000000000000 --- a/content_handler/vsync_waiter.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2018 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include - -#include "flutter/shell/common/vsync_waiter.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" - -namespace flutter { - -class VsyncWaiter final : public shell::VsyncWaiter { - public: - static constexpr zx_signals_t SessionPresentSignal = ZX_EVENT_SIGNALED; - - VsyncWaiter(std::string debug_label, - zx_handle_t session_present_handle, - blink::TaskRunners task_runners); - - ~VsyncWaiter() override; - - private: - const std::string debug_label_; - async::Wait session_wait_; - fxl::TimePoint phase_; - fxl::WeakPtrFactory weak_factory_; - - // |shell::VsyncWaiter| - void AwaitVSync() override; - - void FireCallbackWhenSessionAvailable(); - - void FireCallbackNow(); - - FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiter); -}; - -} // namespace flutter diff --git a/content_handler/vulkan_surface.cc b/content_handler/vulkan_surface.cc deleted file mode 100644 index 524fa385a6dc7..0000000000000 --- a/content_handler/vulkan_surface.cc +++ /dev/null @@ -1,411 +0,0 @@ -// Copyright 2017 The Fuchsia 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 "vulkan_surface.h" - -#include - -#include "third_party/skia/include/core/SkCanvas.h" -#include "third_party/skia/include/gpu/GrBackendSemaphore.h" -#include "third_party/skia/include/gpu/GrBackendSurface.h" -#include "third_party/skia/include/gpu/GrContext.h" - -namespace flutter { - -VulkanSurface::VulkanSurface(vulkan::VulkanProvider& vulkan_provider, - sk_sp context, - sk_sp backend_context, - scenic_lib::Session* session, - const SkISize& size) - : vulkan_provider_(vulkan_provider), - backend_context_(std::move(backend_context)), - session_(session), - wait_(this) { - FXL_DCHECK(session_); - - zx::vmo exported_vmo; - if (!AllocateDeviceMemory(std::move(context), size, exported_vmo)) { - FXL_DLOG(INFO) << "Could not allocate device memory."; - return; - } - - if (!CreateFences()) { - FXL_DLOG(INFO) << "Could not create signal fences."; - return; - } - - if (!PushSessionImageSetupOps(session, std::move(exported_vmo))) { - FXL_DLOG(INFO) << "Could not push session image setup ops."; - return; - } - - wait_.set_object(release_event_.get()); - wait_.set_trigger(ZX_EVENT_SIGNALED); - Reset(); - - valid_ = true; -} - -VulkanSurface::~VulkanSurface() { - wait_.Cancel(); - wait_.set_object(ZX_HANDLE_INVALID); -} - -bool VulkanSurface::IsValid() const { - return valid_; -} - -SkISize VulkanSurface::GetSize() const { - if (!valid_) { - return SkISize::Make(0, 0); - } - - return SkISize::Make(sk_surface_->width(), sk_surface_->height()); -} - -vulkan::VulkanHandle VulkanSurface::SemaphoreFromEvent( - const zx::event& event) const { - VkResult result; - VkSemaphore semaphore; - - zx::event semaphore_event; - zx_status_t status = event.duplicate(ZX_RIGHT_SAME_RIGHTS, &semaphore_event); - if (status != ZX_OK) { - FXL_DLOG(ERROR) << "failed to duplicate semaphore event"; - return vulkan::VulkanHandle(); - } - - VkSemaphoreCreateInfo create_info = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, - .pNext = nullptr, - .flags = 0, - }; - - result = VK_CALL_LOG_ERROR(vulkan_provider_.vk().CreateSemaphore( - vulkan_provider_.vk_device(), &create_info, nullptr, &semaphore)); - if (result != VK_SUCCESS) { - return vulkan::VulkanHandle(); - } - - VkImportSemaphoreFuchsiaHandleInfoKHR import_info = { - .sType = VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FUCHSIA_HANDLE_INFO_KHR, - .pNext = nullptr, - .semaphore = semaphore, - .handleType = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FUCHSIA_FENCE_BIT_KHR, - .handle = static_cast(semaphore_event.release())}; - - result = - VK_CALL_LOG_ERROR(vulkan_provider_.vk().ImportSemaphoreFuchsiaHandleKHR( - vulkan_provider_.vk_device(), &import_info)); - if (result != VK_SUCCESS) { - return vulkan::VulkanHandle(); - } - - return vulkan::VulkanHandle( - semaphore, [&vulkan_provider = vulkan_provider_](VkSemaphore semaphore) { - vulkan_provider.vk().DestroySemaphore(vulkan_provider.vk_device(), - semaphore, nullptr); - }); -} - -bool VulkanSurface::CreateFences() { - if (zx::event::create(0, &acquire_event_) != ZX_OK) { - return false; - } - - acquire_semaphore_ = SemaphoreFromEvent(acquire_event_); - if (!acquire_semaphore_) { - FXL_DLOG(ERROR) << "failed to create acquire semaphore"; - return false; - } - - if (zx::event::create(0, &release_event_) != ZX_OK) { - return false; - } - - command_buffer_fence_ = vulkan_provider_.CreateFence(); - - return true; -} - -bool VulkanSurface::AllocateDeviceMemory(sk_sp context, - const SkISize& size, - zx::vmo& exported_vmo) { - if (size.isEmpty()) { - return false; - } - - if (backend_context_ == nullptr) { - return false; - } - - const SkColorType color_type = kBGRA_8888_SkColorType; - - // Create the image. - const VkImageCreateInfo image_create_info = { - .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, - .pNext = nullptr, - .flags = VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, - .imageType = VK_IMAGE_TYPE_2D, - .format = VK_FORMAT_B8G8R8A8_UNORM, - .extent = VkExtent3D{static_cast(size.width()), - static_cast(size.height()), 1}, - .mipLevels = 1, - .arrayLayers = 1, - .samples = VK_SAMPLE_COUNT_1_BIT, - .tiling = VK_IMAGE_TILING_OPTIMAL, - .usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - .sharingMode = VK_SHARING_MODE_EXCLUSIVE, - .queueFamilyIndexCount = 0, - .pQueueFamilyIndices = nullptr, - .initialLayout = VK_IMAGE_LAYOUT_UNDEFINED, - }; - - { - VkImage vk_image = VK_NULL_HANDLE; - - if (VK_CALL_LOG_ERROR(vulkan_provider_.vk().CreateImage( - vulkan_provider_.vk_device(), &image_create_info, nullptr, - &vk_image)) != VK_SUCCESS) { - return false; - } - - vk_image_ = {vk_image, - [& vulkan_provider = vulkan_provider_](VkImage image) { - vulkan_provider.vk().DestroyImage( - vulkan_provider.vk_device(), image, NULL); - }}; - } - - // Create the memory. - VkMemoryRequirements memory_reqs; - vulkan_provider_.vk().GetImageMemoryRequirements(vulkan_provider_.vk_device(), - vk_image_, &memory_reqs); - - uint32_t memory_type = 0; - for (; memory_type < 32; memory_type++) { - if ((memory_reqs.memoryTypeBits & (1 << memory_type))) { - break; - } - } - - VkExportMemoryAllocateInfoKHR export_allocate_info = { - .sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, - .pNext = nullptr, - .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR}; - - const VkMemoryAllocateInfo alloc_info = { - .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, - .pNext = &export_allocate_info, - .allocationSize = memory_reqs.size, - .memoryTypeIndex = memory_type, - }; - - { - VkDeviceMemory vk_memory = VK_NULL_HANDLE; - if (VK_CALL_LOG_ERROR(vulkan_provider_.vk().AllocateMemory( - vulkan_provider_.vk_device(), &alloc_info, NULL, &vk_memory)) != - VK_SUCCESS) { - return false; - } - - vk_memory_ = {vk_memory, [& vulkan_provider = - vulkan_provider_](VkDeviceMemory memory) { - vulkan_provider.vk().FreeMemory(vulkan_provider.vk_device(), - memory, NULL); - }}; - } - - // Bind image memory. - if (VK_CALL_LOG_ERROR(vulkan_provider_.vk().BindImageMemory( - vulkan_provider_.vk_device(), vk_image_, vk_memory_, 0)) != - VK_SUCCESS) { - return false; - } - - { - // Acquire the VMO for the device memory. - uint32_t vmo_handle = 0; - - VkMemoryGetFuchsiaHandleInfoKHR get_handle_info = { - VK_STRUCTURE_TYPE_MEMORY_GET_FUCHSIA_HANDLE_INFO_KHR, nullptr, - vk_memory_, VK_EXTERNAL_MEMORY_HANDLE_TYPE_FUCHSIA_VMO_BIT_KHR}; - if (VK_CALL_LOG_ERROR(vulkan_provider_.vk().GetMemoryFuchsiaHandleKHR( - vulkan_provider_.vk_device(), &get_handle_info, &vmo_handle)) != - VK_SUCCESS) { - return false; - } - - exported_vmo.reset(static_cast(vmo_handle)); - } - - // Assert that the VMO size was sufficient. - size_t vmo_size = 0; - if (exported_vmo.get_size(&vmo_size) != ZX_OK || - vmo_size < memory_reqs.size) { - return false; - } - - return SetupSkiaSurface(std::move(context), size, color_type, - image_create_info, memory_reqs); -} - -bool VulkanSurface::SetupSkiaSurface(sk_sp context, - const SkISize& size, - SkColorType color_type, - const VkImageCreateInfo& image_create_info, - const VkMemoryRequirements& memory_reqs) { - if (context == nullptr) { - return false; - } - - const GrVkImageInfo image_info = { - vk_image_, // image - {vk_memory_, 0, memory_reqs.size, 0}, // alloc - image_create_info.tiling, // tiling - image_create_info.initialLayout, // layout - image_create_info.format, // format - image_create_info.mipLevels, // level count - }; - - GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0, - image_info); - - SkSurfaceProps sk_surface_props( - SkSurfaceProps::InitType::kLegacyFontHost_InitType); - - auto sk_surface = - SkSurface::MakeFromBackendRenderTarget(context.get(), // - sk_render_target, // - kTopLeft_GrSurfaceOrigin, // - color_type, // - nullptr, // - &sk_surface_props // - ); - - if (!sk_surface || sk_surface->getCanvas() == nullptr) { - return false; - } - sk_surface_ = std::move(sk_surface); - - return true; -} - -bool VulkanSurface::PushSessionImageSetupOps(scenic_lib::Session* session, - zx::vmo exported_vmo) { - if (sk_surface_ == nullptr) { - return false; - } - - scenic_lib::Memory memory(session, std::move(exported_vmo), - images::MemoryType::VK_DEVICE_MEMORY); - - images::ImageInfo image_info; - image_info.width = sk_surface_->width(); - image_info.height = sk_surface_->height(); - image_info.stride = 4 * sk_surface_->width(); - image_info.pixel_format = images::PixelFormat::BGRA_8; - image_info.color_space = images::ColorSpace::SRGB; - image_info.tiling = images::Tiling::LINEAR; - - session_image_ = std::make_unique( - memory, 0 /* memory offset */, std::move(image_info)); - - return session_image_ != nullptr; -} - -scenic_lib::Image* VulkanSurface::GetImage() { - if (!valid_) { - return 0; - } - return session_image_.get(); -} - -sk_sp VulkanSurface::GetSkiaSurface() const { - return valid_ ? sk_surface_ : nullptr; -} - -size_t VulkanSurface::AdvanceAndGetAge() { - age_++; - return age_; -} - -bool VulkanSurface::FlushSessionAcquireAndReleaseEvents() { - zx::event acquire, release; - - if (acquire_event_.duplicate(ZX_RIGHT_SAME_RIGHTS, &acquire) != ZX_OK || - release_event_.duplicate(ZX_RIGHT_SAME_RIGHTS, &release) != ZX_OK) { - return false; - } - - session_->EnqueueAcquireFence(std::move(acquire)); - session_->EnqueueReleaseFence(std::move(release)); - age_ = 0; - return true; -} - -void VulkanSurface::SignalWritesFinished( - std::function on_writes_committed) { - FXL_DCHECK(on_writes_committed); - - if (!valid_) { - on_writes_committed(); - return; - } - - FXL_CHECK(pending_on_writes_committed_ == nullptr) - << "Attempted to signal a write on the surface when the previous write " - "has not yet been acknowledged by the compositor."; - - pending_on_writes_committed_ = on_writes_committed; -} - -void VulkanSurface::Reset() { - if (acquire_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK || - release_event_.signal(ZX_EVENT_SIGNALED, 0u) != ZX_OK) { - valid_ = false; - FXL_DLOG(ERROR) - << "Could not reset fences. The surface is no longer valid."; - } - - VkFence fence = command_buffer_fence_; - - if (command_buffer_) { - VK_CALL_LOG_ERROR(vulkan_provider_.vk().WaitForFences( - vulkan_provider_.vk_device(), 1, &fence, VK_TRUE, UINT64_MAX)); - command_buffer_.reset(); - } - - VK_CALL_LOG_ERROR(vulkan_provider_.vk().ResetFences( - vulkan_provider_.vk_device(), 1, &fence)); - - // Need to make a new acquire semaphore every frame or else validation layers - // get confused about why no one is waiting on it in this VkInstance - acquire_semaphore_.Reset(); - acquire_semaphore_ = SemaphoreFromEvent(acquire_event_); - if (!acquire_semaphore_) { - FXL_DLOG(ERROR) << "failed to create acquire semaphore"; - } - - wait_.Begin(async_get_default()); - - // It is safe for the caller to collect the surface in the callback. - auto callback = pending_on_writes_committed_; - pending_on_writes_committed_ = nullptr; - if (callback) { - callback(); - } -} - -void VulkanSurface::OnHandleReady(async_t* async, - async::WaitBase* wait, - zx_status_t status, - const zx_packet_signal_t* signal) { - if (status != ZX_OK) - return; - FXL_DCHECK(signal->observed & ZX_EVENT_SIGNALED); - Reset(); -} - -} // namespace flutter diff --git a/content_handler/vulkan_surface.h b/content_handler/vulkan_surface.h deleted file mode 100644 index c9156452aed98..0000000000000 --- a/content_handler/vulkan_surface.h +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include -#include - -#include - -#include "flutter/flow/scene_update_context.h" -#include "flutter/vulkan/vulkan_command_buffer.h" -#include "flutter/vulkan/vulkan_handle.h" -#include "flutter/vulkan/vulkan_proc_table.h" -#include "flutter/vulkan/vulkan_provider.h" -#include "lib/fxl/macros.h" -#include "lib/ui/scenic/client/resources.h" -#include "third_party/skia/include/core/SkSurface.h" -#include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" - -namespace flutter { - -class VulkanSurface final - : public flow::SceneUpdateContext::SurfaceProducerSurface { - public: - VulkanSurface(vulkan::VulkanProvider& vulkan_provider, - sk_sp context, - sk_sp backend_context, - scenic_lib::Session* session, - const SkISize& size); - - ~VulkanSurface() override; - - // |flow::SceneUpdateContext::SurfaceProducerSurface| - size_t AdvanceAndGetAge() override; - - // |flow::SceneUpdateContext::SurfaceProducerSurface| - bool FlushSessionAcquireAndReleaseEvents() override; - - // |flow::SceneUpdateContext::SurfaceProducerSurface| - bool IsValid() const override; - - // |flow::SceneUpdateContext::SurfaceProducerSurface| - SkISize GetSize() const override; - - // Note: It is safe for the caller to collect the surface in the - // |on_writes_committed| callback. - void SignalWritesFinished( - std::function on_writes_committed) override; - - // |flow::SceneUpdateContext::SurfaceProducerSurface| - scenic_lib::Image* GetImage() override; - - // |flow::SceneUpdateContext::SurfaceProducerSurface| - sk_sp GetSkiaSurface() const override; - - const vulkan::VulkanHandle& GetVkImage() { return vk_image_; } - - const vulkan::VulkanHandle& GetAcquireVkSemaphore() { - return acquire_semaphore_; - } - - vulkan::VulkanCommandBuffer* GetCommandBuffer( - const vulkan::VulkanHandle& pool) { - if (!command_buffer_) - command_buffer_ = std::make_unique( - vulkan_provider_.vk(), vulkan_provider_.vk_device(), pool); - return command_buffer_.get(); - } - - const vulkan::VulkanHandle& GetCommandBufferFence() { - return command_buffer_fence_; - } - - private: - void OnHandleReady(async_t* async, - async::WaitBase* wait, - zx_status_t status, - const zx_packet_signal_t* signal); - - bool AllocateDeviceMemory(sk_sp context, - const SkISize& size, - zx::vmo& exported_vmo); - - bool SetupSkiaSurface(sk_sp context, - const SkISize& size, - SkColorType color_type, - const VkImageCreateInfo& image_create_info, - const VkMemoryRequirements& memory_reqs); - - bool CreateFences(); - - bool PushSessionImageSetupOps(scenic_lib::Session* session, - zx::vmo exported_vmo); - - void Reset(); - - vulkan::VulkanHandle SemaphoreFromEvent( - const zx::event& event) const; - - vulkan::VulkanProvider& vulkan_provider_; - sk_sp backend_context_; - scenic_lib::Session* session_; - vulkan::VulkanHandle vk_image_; - vulkan::VulkanHandle vk_memory_; - vulkan::VulkanHandle command_buffer_fence_; - sk_sp sk_surface_; - std::unique_ptr session_image_; - zx::event acquire_event_; - vulkan::VulkanHandle acquire_semaphore_; - std::unique_ptr command_buffer_; - zx::event release_event_; - async::WaitMethod wait_; - std::function pending_on_writes_committed_; - size_t age_ = 0; - bool valid_ = false; - - FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurface); -}; - -} // namespace flutter diff --git a/content_handler/vulkan_surface_pool.cc b/content_handler/vulkan_surface_pool.cc deleted file mode 100644 index 93d14c2ddbff7..0000000000000 --- a/content_handler/vulkan_surface_pool.cc +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2017 The Fuchsia 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 "vulkan_surface_pool.h" - -#include - -#include "flutter/glue/trace_event.h" -#include "third_party/skia/include/gpu/GrContext.h" - -namespace flutter { - -VulkanSurfacePool::VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider, - sk_sp context, - sk_sp backend_context, - scenic_lib::Session* mozart_session) - : vulkan_provider_(vulkan_provider), - context_(std::move(context)), - backend_context_(std::move(backend_context)), - mozart_session_(mozart_session) {} - -VulkanSurfacePool::~VulkanSurfacePool() {} - -std::unique_ptr -VulkanSurfacePool::AcquireSurface(const SkISize& size) { - auto surface = GetCachedOrCreateSurface(size); - - if (surface == nullptr) { - FXL_DLOG(ERROR) << "Could not acquire surface"; - return nullptr; - } - - if (!surface->FlushSessionAcquireAndReleaseEvents()) { - FXL_DLOG(ERROR) << "Could not flush acquire/release events for buffer."; - return nullptr; - } - - return surface; -} - -std::unique_ptr -VulkanSurfacePool::GetCachedOrCreateSurface(const SkISize& size) { - auto found_in_available = available_surfaces_.find(size); - if (found_in_available == available_surfaces_.end()) { - return CreateSurface(size); - } - SurfacesSet& available_surfaces = found_in_available->second; - FXL_DCHECK(available_surfaces.size() > 0); - auto acquired_surface = std::move(available_surfaces.back()); - available_surfaces.pop_back(); - if (available_surfaces.size() == 0) { - available_surfaces_.erase(found_in_available); - } - if (acquired_surface->IsValid()) { - trace_surfaces_reused_++; - return acquired_surface; - } - // This is only likely to happen if the surface was invalidated between the - // time it was sent into the available buffers cache and accessed now. - // Extremely unlikely. - return CreateSurface(size); -} - -void VulkanSurfacePool::SubmitSurface( - std::unique_ptr - p_surface) { - TRACE_EVENT0("flutter", "VulkanSurfacePool::SubmitSurface"); - if (!p_surface) { - return; - } - - uintptr_t surface_key = reinterpret_cast(p_surface.get()); - - auto insert_iterator = - pending_surfaces_.insert(std::make_pair(surface_key, // key - std::move(p_surface) // value - )); - - if (insert_iterator.second) { - insert_iterator.first->second->SignalWritesFinished( - std::bind(&VulkanSurfacePool::RecycleSurface, this, surface_key)); - } -} - -std::unique_ptr VulkanSurfacePool::CreateSurface( - const SkISize& size) { - auto surface = std::make_unique( - vulkan_provider_, context_, backend_context_, mozart_session_, size); - if (!surface->IsValid()) { - return nullptr; - } - trace_surfaces_created_++; - return surface; -} - -void VulkanSurfacePool::RecycleSurface(uintptr_t surface_key) { - // Before we do anything, we must clear the surface from the collection of - // pending surfaces. - auto found_in_pending = pending_surfaces_.find(surface_key); - if (found_in_pending == pending_surfaces_.end()) { - return; - } - - // Grab a hold of the surface to recycle and clear the entry in the pending - // surfaces collection. - std::unique_ptr - surface_to_recycle = std::move(found_in_pending->second); - pending_surfaces_.erase(found_in_pending); - - // The surface may have become invalid (for example it the fences could - // not be reset). - if (!surface_to_recycle->IsValid()) { - return; - } - - // Recycle the buffer by putting it in the list of available surfaces if the - // maximum size of buffers in the collection is not already present. - auto& available_surfaces = available_surfaces_[surface_to_recycle->GetSize()]; - if (available_surfaces.size() < kMaxSurfacesOfSameSize) { - available_surfaces.emplace_back(std::move(surface_to_recycle)); - } -} - -void VulkanSurfacePool::AgeAndCollectOldBuffers() { - std::vector sizes_to_erase; - for (auto& surface_iterator : available_surfaces_) { - SurfacesSet& old_surfaces = surface_iterator.second; - SurfacesSet new_surfaces; - for (auto& surface : old_surfaces) { - if (surface->AdvanceAndGetAge() < kMaxSurfaceAge) { - new_surfaces.emplace_back(std::move(surface)); - } - } - if (new_surfaces.size() == 0) { - sizes_to_erase.emplace_back(surface_iterator.first); - } - old_surfaces.swap(new_surfaces); - } - for (const auto& size : sizes_to_erase) { - available_surfaces_.erase(size); - } - TraceStats(); -} - -void VulkanSurfacePool::TraceStats() { - // Resources held in cached buffers. - size_t cached_surfaces = 0; - size_t cached_surfaces_bytes = 0; - for (const auto& surfaces : available_surfaces_) { - const auto surface_count = surfaces.second.size(); - cached_surfaces += surface_count; - // TODO(chinmaygarde): Assuming for now that all surfaces are 32bpp. - cached_surfaces_bytes += - (surfaces.first.fWidth * surfaces.first.fHeight * 4 * surface_count); - } - - // Resources held by Skia. - int skia_resources = 0; - size_t skia_bytes = 0; - context_->getResourceCacheUsage(&skia_resources, &skia_bytes); - const size_t skia_cache_purgeable = - context_->getResourceCachePurgeableBytes(); - - TRACE_COUNTER("flutter", "SurfacePool", 0u, // - "CachedCount", cached_surfaces, // - "CachedBytes", cached_surfaces_bytes, // - "Created", trace_surfaces_created_, // - "Reused", trace_surfaces_reused_, // - "PendingInCompositor", pending_surfaces_.size(), // - "SkiaCacheResources", skia_resources, // - "SkiaCacheBytes", skia_bytes, // - "SkiaCachePurgeable", skia_cache_purgeable // - ); - - // Reset per present/frame stats. - trace_surfaces_created_ = 0; - trace_surfaces_reused_ = 0; -} - -} // namespace flutter diff --git a/content_handler/vulkan_surface_pool.h b/content_handler/vulkan_surface_pool.h deleted file mode 100644 index 4900816762910..0000000000000 --- a/content_handler/vulkan_surface_pool.h +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2017 The Fuchsia Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#pragma once - -#include -#include - -#include "lib/fxl/macros.h" -#include "vulkan_surface.h" - -namespace flutter { - -class VulkanSurfacePool final { - public: - static const size_t kMaxSurfacesOfSameSize = 3; - static const size_t kMaxSurfaceAge = 3; - - VulkanSurfacePool(vulkan::VulkanProvider& vulkan_provider, - sk_sp context, - sk_sp backend_context, - scenic_lib::Session* mozart_session); - - ~VulkanSurfacePool(); - - std::unique_ptr - AcquireSurface(const SkISize& size); - - void SubmitSurface( - std::unique_ptr - surface); - - void AgeAndCollectOldBuffers(); - - private: - using SurfacesSet = std::list< - std::unique_ptr>; - - template - static void HashCombine(size_t& seed, T const& v) { - seed ^= std::hash()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - } - - struct SkISizeHash { - std::size_t operator()(const SkISize& key) const { - size_t seed = 0; - HashCombine(seed, key.fWidth); - HashCombine(seed, key.fHeight); - return seed; - } - }; - - vulkan::VulkanProvider& vulkan_provider_; - sk_sp context_; - sk_sp backend_context_; - scenic_lib::Session* mozart_session_; - std::unordered_map available_surfaces_; - std::unordered_map< - uintptr_t, - std::unique_ptr> - pending_surfaces_; - size_t trace_surfaces_created_ = 0; - size_t trace_surfaces_reused_ = 0; - - std::unique_ptr - GetCachedOrCreateSurface(const SkISize& size); - - std::unique_ptr CreateSurface(const SkISize& size); - - void RecycleSurface(uintptr_t surface_key); - - void TraceStats(); - - FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfacePool); -}; - -} // namespace flutter diff --git a/content_handler/vulkan_surface_producer.cc b/content_handler/vulkan_surface_producer.cc deleted file mode 100644 index 5c04a704e5b95..0000000000000 --- a/content_handler/vulkan_surface_producer.cc +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright 2017 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. - -#include "vulkan_surface_producer.h" - -#include -#include -#include - -#include "flutter/glue/trace_event.h" -#include "third_party/skia/include/gpu/GrBackendSemaphore.h" -#include "third_party/skia/include/gpu/GrBackendSurface.h" -#include "third_party/skia/include/gpu/GrContext.h" -#include "third_party/skia/include/gpu/vk/GrVkTypes.h" - -namespace flutter { - -VulkanSurfaceProducer::VulkanSurfaceProducer( - scenic_lib::Session* mozart_session) { - valid_ = Initialize(mozart_session); - - if (valid_) { - FXL_DLOG(INFO) - << "Flutter engine: Vulkan surface producer initialization: Successful"; - } else { - FXL_LOG(ERROR) - << "Flutter engine: Vulkan surface producer initialization: Failed"; - } -} - -VulkanSurfaceProducer::~VulkanSurfaceProducer() { - // Make sure queue is idle before we start destroying surfaces - VkResult wait_result = - VK_CALL_LOG_ERROR(vk_->QueueWaitIdle(backend_context_->fQueue)); - FXL_DCHECK(wait_result == VK_SUCCESS); -}; - -bool VulkanSurfaceProducer::Initialize(scenic_lib::Session* mozart_session) { - vk_ = fxl::MakeRefCounted(); - - std::vector extensions = { - VK_KHR_SURFACE_EXTENSION_NAME, - VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, - }; - application_ = std::make_unique( - *vk_, "FlutterApplicationRunner", std::move(extensions)); - - if (!application_->IsValid() || !vk_->AreInstanceProcsSetup()) { - // Make certain the application instance was created and it setup the - // instance proc table entries. - FXL_LOG(ERROR) << "Instance proc addresses have not been setup."; - return false; - } - - // Create the device. - - logical_device_ = application_->AcquireFirstCompatibleLogicalDevice(); - - if (logical_device_ == nullptr || !logical_device_->IsValid() || - !vk_->AreDeviceProcsSetup()) { - // Make certain the device was created and it setup the device proc table - // entries. - FXL_LOG(ERROR) << "Device proc addresses have not been setup."; - return false; - } - - if (!vk_->HasAcquiredMandatoryProcAddresses()) { - FXL_LOG(ERROR) << "Failed to acquire mandatory proc addresses."; - return false; - } - - if (!vk_->IsValid()) { - FXL_LOG(ERROR) << "VulkanProcTable invalid"; - return false; - } - - auto interface = vk_->CreateSkiaInterface(); - - if (interface == nullptr || !interface->validate(0)) { - FXL_LOG(ERROR) << "Skia interface invalid."; - return false; - } - - uint32_t skia_features = 0; - if (!logical_device_->GetPhysicalDeviceFeaturesSkia(&skia_features)) { - FXL_LOG(ERROR) << "Failed to get physical device features."; - - return false; - } - - backend_context_ = sk_make_sp(); - backend_context_->fInstance = application_->GetInstance(); - backend_context_->fPhysicalDevice = - logical_device_->GetPhysicalDeviceHandle(); - backend_context_->fDevice = logical_device_->GetHandle(); - backend_context_->fQueue = logical_device_->GetQueueHandle(); - backend_context_->fGraphicsQueueIndex = - logical_device_->GetGraphicsQueueIndex(); - backend_context_->fMinAPIVersion = application_->GetAPIVersion(); - backend_context_->fFeatures = skia_features; - backend_context_->fInterface.reset(interface.release()); - - logical_device_->ReleaseDeviceOwnership(); - application_->ReleaseInstanceOwnership(); - - context_ = GrContext::MakeVulkan(backend_context_); - - context_->setResourceCacheLimits(vulkan::kGrCacheMaxCount, - vulkan::kGrCacheMaxByteSize); - - surface_pool_ = std::make_unique( - *this, context_, backend_context_, mozart_session); - - return true; -} - -void VulkanSurfaceProducer::OnSurfacesPresented( - std::vector< - std::unique_ptr> - surfaces) { - TRACE_EVENT0("flutter", "VulkanSurfaceProducer::OnSurfacesPresented"); - - // Do a single flush for all canvases derived from the context. - { - TRACE_EVENT0("flutter", "GrContext::flushAndSignalSemaphores"); - context_->flush(); - } - - if (!TransitionSurfacesToExternal(surfaces)) - FXL_LOG(ERROR) << "TransitionSurfacesToExternal failed"; - - // Submit surface - for (auto& surface : surfaces) { - SubmitSurface(std::move(surface)); - } - - // Buffer management. - surface_pool_->AgeAndCollectOldBuffers(); -} - -bool VulkanSurfaceProducer::TransitionSurfacesToExternal( - const std::vector< - std::unique_ptr>& - surfaces) { - for (auto& surface : surfaces) { - auto vk_surface = static_cast(surface.get()); - - vulkan::VulkanCommandBuffer* command_buffer = - vk_surface->GetCommandBuffer(logical_device_->GetCommandPool()); - if (!command_buffer->Begin()) - return false; - - GrBackendRenderTarget backendRT = - vk_surface->GetSkiaSurface()->getBackendRenderTarget( - SkSurface::kFlushRead_BackendHandleAccess); - if (!backendRT.isValid()) { - return false; - } - GrVkImageInfo imageInfo; - if (!backendRT.getVkImageInfo(&imageInfo)) { - return false; - } - - VkImageMemoryBarrier image_barrier = { - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = nullptr, - .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - .dstAccessMask = 0, - .oldLayout = imageInfo.fImageLayout, - .newLayout = VK_IMAGE_LAYOUT_GENERAL, - .srcQueueFamilyIndex = 0, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_EXTERNAL_KHR, - .image = vk_surface->GetVkImage(), - .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}}; - - if (!command_buffer->InsertPipelineBarrier( - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, - 0, // dependencyFlags - 0, nullptr, // memory barriers - 0, nullptr, // buffer barriers - 1, &image_barrier)) - return false; - - backendRT.setVkImageLayout(image_barrier.newLayout); - - if (!command_buffer->End()) - return false; - - if (!logical_device_->QueueSubmit( - {}, {}, {vk_surface->GetAcquireVkSemaphore()}, - {command_buffer->Handle()}, vk_surface->GetCommandBufferFence())) - return false; - } - return true; -} - -std::unique_ptr -VulkanSurfaceProducer::ProduceSurface(const SkISize& size) { - FXL_DCHECK(valid_); - return surface_pool_->AcquireSurface(size); -} - -void VulkanSurfaceProducer::SubmitSurface( - std::unique_ptr surface) { - FXL_DCHECK(valid_ && surface != nullptr); - surface_pool_->SubmitSurface(std::move(surface)); -} - -} // namespace flutter diff --git a/content_handler/vulkan_surface_producer.h b/content_handler/vulkan_surface_producer.h deleted file mode 100644 index 15c4419e8cde7..0000000000000 --- a/content_handler/vulkan_surface_producer.h +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2017 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. - -#pragma once - -#include "flutter/flow/scene_update_context.h" -#include "flutter/vulkan/vulkan_application.h" -#include "flutter/vulkan/vulkan_device.h" -#include "flutter/vulkan/vulkan_proc_table.h" -#include "flutter/vulkan/vulkan_provider.h" -#include "lib/fsl/tasks/message_loop.h" -#include "lib/fxl/macros.h" -#include "lib/ui/scenic/client/resources.h" -#include "lib/ui/scenic/client/session.h" -#include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -#include "vulkan_surface.h" -#include "vulkan_surface_pool.h" - -namespace flutter { - -class VulkanSurfaceProducer final - : public flow::SceneUpdateContext::SurfaceProducer, - public vulkan::VulkanProvider { - public: - VulkanSurfaceProducer(scenic_lib::Session* mozart_session); - - ~VulkanSurfaceProducer(); - - bool IsValid() const { return valid_; } - - // |flow::SceneUpdateContext::SurfaceProducer| - std::unique_ptr - ProduceSurface(const SkISize& size) override; - - // |flow::SceneUpdateContext::SurfaceProducer| - void SubmitSurface( - std::unique_ptr surface) - override; - - void OnSurfacesPresented( - std::vector< - std::unique_ptr> - surfaces); - - private: - // VulkanProvider - const vulkan::VulkanProcTable& vk() override { return *vk_.get(); } - const vulkan::VulkanHandle& vk_device() override { - return logical_device_->GetHandle(); - } - - bool TransitionSurfacesToExternal( - const std::vector< - std::unique_ptr>& - surfaces); - - // Note: the order here is very important. The proctable must be destroyed - // last because it contains the function pointers for VkDestroyDevice and - // VkDestroyInstance. The backend context owns the VkDevice and the - // VkInstance, so it must be destroyed after the logical device and the - // application, which own other vulkan objects associated with the device - // and instance. - fxl::RefPtr vk_; - sk_sp backend_context_; - std::unique_ptr logical_device_; - std::unique_ptr application_; - sk_sp context_; - std::unique_ptr surface_pool_; - bool valid_ = false; - - bool Initialize(scenic_lib::Session* mozart_session); - - FXL_DISALLOW_COPY_AND_ASSIGN(VulkanSurfaceProducer); -}; - -} // namespace flutter diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index f6cccfd32ac2b..0d2260672fb8a 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -7,12 +7,8 @@ USED LICENSES: ==================================================================================================== LIBRARY: engine LIBRARY: txt -ORIGIN: ../../../flutter/content_handler/session_connection.cc + ../../../LICENSE +ORIGIN: ../../../flutter/flow/layers/physical_shape_layer.cc + ../../../LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/content_handler/session_connection.cc -FILE: ../../../flutter/content_handler/session_connection.h -FILE: ../../../flutter/content_handler/vulkan_surface_producer.cc -FILE: ../../../flutter/content_handler/vulkan_surface_producer.h FILE: ../../../flutter/flow/debug_print.cc FILE: ../../../flutter/flow/debug_print.h FILE: ../../../flutter/flow/export_node.h @@ -193,300 +189,11 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: engine -LIBRARY: txt -ORIGIN: ../../../flutter/third_party/txt/LICENSE -TYPE: LicenseType.apache -FILE: ../../../flutter/content_handler/fuchsia_font_manager.cc -FILE: ../../../flutter/content_handler/fuchsia_font_manager.h -FILE: ../../../flutter/third_party/txt/benchmarks/paint_record_benchmarks.cc -FILE: ../../../flutter/third_party/txt/benchmarks/paragraph_benchmarks.cc -FILE: ../../../flutter/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc -FILE: ../../../flutter/third_party/txt/benchmarks/styled_runs_benchmarks.cc -FILE: ../../../flutter/third_party/txt/benchmarks/txt_run_all_benchmarks.cc -FILE: ../../../flutter/third_party/txt/benchmarks/utils.cc -FILE: ../../../flutter/third_party/txt/benchmarks/utils.h -FILE: ../../../flutter/third_party/txt/src/log/log.cc -FILE: ../../../flutter/third_party/txt/src/log/log.h -FILE: ../../../flutter/third_party/txt/src/minikin/CmapCoverage.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/CmapCoverage.h -FILE: ../../../flutter/third_party/txt/src/minikin/Emoji.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/Emoji.h -FILE: ../../../flutter/third_party/txt/src/minikin/FontCollection.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/FontCollection.h -FILE: ../../../flutter/third_party/txt/src/minikin/FontFamily.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/FontFamily.h -FILE: ../../../flutter/third_party/txt/src/minikin/FontLanguage.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/FontLanguage.h -FILE: ../../../flutter/third_party/txt/src/minikin/FontLanguageListCache.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/FontLanguageListCache.h -FILE: ../../../flutter/third_party/txt/src/minikin/FontUtils.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/FontUtils.h -FILE: ../../../flutter/third_party/txt/src/minikin/GraphemeBreak.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/GraphemeBreak.h -FILE: ../../../flutter/third_party/txt/src/minikin/HbFontCache.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/HbFontCache.h -FILE: ../../../flutter/third_party/txt/src/minikin/Hyphenator.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/Hyphenator.h -FILE: ../../../flutter/third_party/txt/src/minikin/Layout.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/Layout.h -FILE: ../../../flutter/third_party/txt/src/minikin/LayoutUtils.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/LayoutUtils.h -FILE: ../../../flutter/third_party/txt/src/minikin/LineBreaker.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/LineBreaker.h -FILE: ../../../flutter/third_party/txt/src/minikin/Measurement.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/Measurement.h -FILE: ../../../flutter/third_party/txt/src/minikin/MinikinFont.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/MinikinFont.h -FILE: ../../../flutter/third_party/txt/src/minikin/MinikinInternal.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/MinikinInternal.h -FILE: ../../../flutter/third_party/txt/src/minikin/SparseBitSet.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/SparseBitSet.h -FILE: ../../../flutter/third_party/txt/src/minikin/WordBreaker.cpp -FILE: ../../../flutter/third_party/txt/src/minikin/WordBreaker.h -FILE: ../../../flutter/third_party/txt/src/txt/asset_data_provider.cc -FILE: ../../../flutter/third_party/txt/src/txt/asset_data_provider.h -FILE: ../../../flutter/third_party/txt/src/txt/asset_font_manager.cc -FILE: ../../../flutter/third_party/txt/src/txt/asset_font_manager.h -FILE: ../../../flutter/third_party/txt/src/txt/font_collection.cc -FILE: ../../../flutter/third_party/txt/src/txt/font_collection.h -FILE: ../../../flutter/third_party/txt/src/txt/font_skia.cc -FILE: ../../../flutter/third_party/txt/src/txt/font_skia.h -FILE: ../../../flutter/third_party/txt/src/txt/font_style.h -FILE: ../../../flutter/third_party/txt/src/txt/font_weight.h -FILE: ../../../flutter/third_party/txt/src/txt/paint_record.cc -FILE: ../../../flutter/third_party/txt/src/txt/paint_record.h -FILE: ../../../flutter/third_party/txt/src/txt/paragraph.cc -FILE: ../../../flutter/third_party/txt/src/txt/paragraph.h -FILE: ../../../flutter/third_party/txt/src/txt/paragraph_builder.cc -FILE: ../../../flutter/third_party/txt/src/txt/paragraph_builder.h -FILE: ../../../flutter/third_party/txt/src/txt/paragraph_style.cc -FILE: ../../../flutter/third_party/txt/src/txt/paragraph_style.h -FILE: ../../../flutter/third_party/txt/src/txt/styled_runs.cc -FILE: ../../../flutter/third_party/txt/src/txt/styled_runs.h -FILE: ../../../flutter/third_party/txt/src/txt/test_font_manager.cc -FILE: ../../../flutter/third_party/txt/src/txt/test_font_manager.h -FILE: ../../../flutter/third_party/txt/src/txt/text_baseline.h -FILE: ../../../flutter/third_party/txt/src/txt/text_decoration.cc -FILE: ../../../flutter/third_party/txt/src/txt/text_decoration.h -FILE: ../../../flutter/third_party/txt/src/txt/text_style.cc -FILE: ../../../flutter/third_party/txt/src/txt/text_style.h -FILE: ../../../flutter/third_party/txt/src/utils/JenkinsHash.cpp -FILE: ../../../flutter/third_party/txt/src/utils/JenkinsHash.h -FILE: ../../../flutter/third_party/txt/src/utils/LruCache.h -FILE: ../../../flutter/third_party/txt/src/utils/TypeHelpers.h -FILE: ../../../flutter/third_party/txt/src/utils/WindowsUtils.h ----------------------------------------------------------------------------------------------------- -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==================================================================================================== - ==================================================================================================== LIBRARY: engine ORIGIN: ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/DEPS -FILE: ../../../flutter/content_handler/meta/sandbox FILE: ../../../flutter/lib/io/dart_io.cc FILE: ../../../flutter/lib/io/dart_io.h FILE: ../../../flutter/lib/snapshot/libraries.json @@ -778,60 +485,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../flutter/content_handler/application.cc + ../../../garnet/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../flutter/content_handler/application.cc -FILE: ../../../flutter/content_handler/application.h -FILE: ../../../flutter/content_handler/application_runner.cc -FILE: ../../../flutter/content_handler/application_runner.h -FILE: ../../../flutter/content_handler/compositor_context.cc -FILE: ../../../flutter/content_handler/compositor_context.h -FILE: ../../../flutter/content_handler/engine.cc -FILE: ../../../flutter/content_handler/engine.h -FILE: ../../../flutter/content_handler/isolate_configurator.cc -FILE: ../../../flutter/content_handler/isolate_configurator.h -FILE: ../../../flutter/content_handler/main.cc -FILE: ../../../flutter/content_handler/platform_view.cc -FILE: ../../../flutter/content_handler/platform_view.h -FILE: ../../../flutter/content_handler/surface.cc -FILE: ../../../flutter/content_handler/surface.h -FILE: ../../../flutter/content_handler/task_observers.cc -FILE: ../../../flutter/content_handler/task_observers.h -FILE: ../../../flutter/content_handler/unique_fdio_ns.h -FILE: ../../../flutter/content_handler/vsync_waiter.cc -FILE: ../../../flutter/content_handler/vsync_waiter.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: engine ORIGIN: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart + ../../../LICENSE @@ -977,7 +630,162 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/view/AccessibilityBridg FILE: ../../../flutter/shell/platform/android/io/flutter/view/FlutterMain.java FILE: ../../../flutter/shell/platform/android/io/flutter/view/FlutterView.java ---------------------------------------------------------------------------------------------------- -Copyright 2013 The Chromium Authors. All rights reserved. +Copyright 2013 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: engine +ORIGIN: ../../../third_party/icu/scripts/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../flutter/flow/compositor_context.cc +FILE: ../../../flutter/flow/compositor_context.h +FILE: ../../../flutter/flow/instrumentation.cc +FILE: ../../../flutter/flow/instrumentation.h +FILE: ../../../flutter/flow/layers/clip_path_layer.cc +FILE: ../../../flutter/flow/layers/clip_path_layer.h +FILE: ../../../flutter/flow/layers/clip_rect_layer.cc +FILE: ../../../flutter/flow/layers/clip_rect_layer.h +FILE: ../../../flutter/flow/layers/clip_rrect_layer.cc +FILE: ../../../flutter/flow/layers/clip_rrect_layer.h +FILE: ../../../flutter/flow/layers/color_filter_layer.cc +FILE: ../../../flutter/flow/layers/color_filter_layer.h +FILE: ../../../flutter/flow/layers/container_layer.cc +FILE: ../../../flutter/flow/layers/container_layer.h +FILE: ../../../flutter/flow/layers/layer.cc +FILE: ../../../flutter/flow/layers/layer.h +FILE: ../../../flutter/flow/layers/layer_tree.cc +FILE: ../../../flutter/flow/layers/layer_tree.h +FILE: ../../../flutter/flow/layers/opacity_layer.cc +FILE: ../../../flutter/flow/layers/opacity_layer.h +FILE: ../../../flutter/flow/layers/performance_overlay_layer.cc +FILE: ../../../flutter/flow/layers/performance_overlay_layer.h +FILE: ../../../flutter/flow/layers/picture_layer.cc +FILE: ../../../flutter/flow/layers/picture_layer.h +FILE: ../../../flutter/flow/layers/transform_layer.cc +FILE: ../../../flutter/flow/layers/transform_layer.h +FILE: ../../../flutter/lib/snapshot/snapshot.dart +FILE: ../../../flutter/lib/snapshot/snapshot.h +FILE: ../../../flutter/lib/snapshot/snapshot_fuchsia.dart +FILE: ../../../flutter/lib/ui/compositing.dart +FILE: ../../../flutter/lib/ui/compositing/scene.cc +FILE: ../../../flutter/lib/ui/compositing/scene.h +FILE: ../../../flutter/lib/ui/compositing/scene_builder.cc +FILE: ../../../flutter/lib/ui/compositing/scene_builder.h +FILE: ../../../flutter/lib/ui/geometry.dart +FILE: ../../../flutter/lib/ui/hash_codes.dart +FILE: ../../../flutter/lib/ui/hooks.dart +FILE: ../../../flutter/lib/ui/lerp.dart +FILE: ../../../flutter/lib/ui/painting.dart +FILE: ../../../flutter/lib/ui/painting/canvas.cc +FILE: ../../../flutter/lib/ui/painting/canvas.h +FILE: ../../../flutter/lib/ui/painting/gradient.cc +FILE: ../../../flutter/lib/ui/painting/gradient.h +FILE: ../../../flutter/lib/ui/painting/image_shader.cc +FILE: ../../../flutter/lib/ui/painting/image_shader.h +FILE: ../../../flutter/lib/ui/painting/matrix.cc +FILE: ../../../flutter/lib/ui/painting/matrix.h +FILE: ../../../flutter/lib/ui/painting/paint.cc +FILE: ../../../flutter/lib/ui/painting/paint.h +FILE: ../../../flutter/lib/ui/painting/path.cc +FILE: ../../../flutter/lib/ui/painting/path.h +FILE: ../../../flutter/lib/ui/painting/path_measure.cc +FILE: ../../../flutter/lib/ui/painting/path_measure.h +FILE: ../../../flutter/lib/ui/painting/picture.cc +FILE: ../../../flutter/lib/ui/painting/picture.h +FILE: ../../../flutter/lib/ui/painting/picture_recorder.cc +FILE: ../../../flutter/lib/ui/painting/picture_recorder.h +FILE: ../../../flutter/lib/ui/painting/rrect.cc +FILE: ../../../flutter/lib/ui/painting/rrect.h +FILE: ../../../flutter/lib/ui/painting/shader.cc +FILE: ../../../flutter/lib/ui/painting/shader.h +FILE: ../../../flutter/lib/ui/pointer.dart +FILE: ../../../flutter/lib/ui/text.dart +FILE: ../../../flutter/lib/ui/text/paragraph.cc +FILE: ../../../flutter/lib/ui/text/paragraph.h +FILE: ../../../flutter/lib/ui/text/paragraph_builder.cc +FILE: ../../../flutter/lib/ui/text/paragraph_builder.h +FILE: ../../../flutter/lib/ui/text/paragraph_impl.cc +FILE: ../../../flutter/lib/ui/text/paragraph_impl.h +FILE: ../../../flutter/lib/ui/text/paragraph_impl_txt.cc +FILE: ../../../flutter/lib/ui/text/paragraph_impl_txt.h +FILE: ../../../flutter/lib/ui/text/text_box.cc +FILE: ../../../flutter/lib/ui/ui.dart +FILE: ../../../flutter/lib/ui/ui_dart_state.cc +FILE: ../../../flutter/lib/ui/ui_dart_state.h +FILE: ../../../flutter/lib/ui/window.dart +FILE: ../../../flutter/lib/ui/window/pointer_data.cc +FILE: ../../../flutter/lib/ui/window/pointer_data_packet.cc +FILE: ../../../flutter/lib/ui/window/window.cc +FILE: ../../../flutter/runtime/dart_service_isolate.cc +FILE: ../../../flutter/runtime/dart_service_isolate.h +FILE: ../../../flutter/runtime/runtime_controller.cc +FILE: ../../../flutter/runtime/runtime_controller.h +FILE: ../../../flutter/runtime/runtime_delegate.cc +FILE: ../../../flutter/runtime/runtime_delegate.h +FILE: ../../../flutter/shell/common/animator.cc +FILE: ../../../flutter/shell/common/animator.h +FILE: ../../../flutter/shell/common/engine.cc +FILE: ../../../flutter/shell/common/engine.h +FILE: ../../../flutter/shell/common/picture_serializer.cc +FILE: ../../../flutter/shell/common/picture_serializer.h +FILE: ../../../flutter/shell/common/platform_view.cc +FILE: ../../../flutter/shell/common/platform_view.h +FILE: ../../../flutter/shell/common/rasterizer.cc +FILE: ../../../flutter/shell/common/rasterizer.h +FILE: ../../../flutter/shell/common/shell.cc +FILE: ../../../flutter/shell/common/shell.h +FILE: ../../../flutter/shell/common/vsync_waiter.cc +FILE: ../../../flutter/shell/common/vsync_waiter.h +FILE: ../../../flutter/shell/common/vsync_waiter_fallback.h +FILE: ../../../flutter/shell/platform/android/AndroidManifest.xml +FILE: ../../../flutter/shell/platform/android/flutter_main.cc +FILE: ../../../flutter/shell/platform/android/flutter_main.h +FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterActivity.java +FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterApplication.java +FILE: ../../../flutter/shell/platform/android/io/flutter/view/ResourceCleaner.java +FILE: ../../../flutter/shell/platform/android/io/flutter/view/ResourceExtractor.java +FILE: ../../../flutter/shell/platform/android/io/flutter/view/ResourcePaths.java +FILE: ../../../flutter/shell/platform/android/library_loader.cc +FILE: ../../../flutter/shell/platform/android/platform_view_android.cc +FILE: ../../../flutter/shell/platform/android/platform_view_android.h +FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.h +FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.mm +FILE: ../../../flutter/shell/platform/darwin/desktop/main_mac.mm +FILE: ../../../flutter/shell/platform/darwin/desktop/platform_view_mac.h +FILE: ../../../flutter/shell/platform/darwin/desktop/platform_view_mac.mm +FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.cc +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +---------------------------------------------------------------------------------------------------- +Copyright 2015 The Chromium Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1008,16 +816,23 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../garnet/LICENSE +ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd -FILE: ../../../flutter/content_handler/accessibility_bridge.cc -FILE: ../../../flutter/content_handler/accessibility_bridge.h -FILE: ../../../flutter/content_handler/vulkan_surface.cc -FILE: ../../../flutter/content_handler/vulkan_surface.h -FILE: ../../../flutter/content_handler/vulkan_surface_pool.cc -FILE: ../../../flutter/content_handler/vulkan_surface_pool.h +FILE: ../../../flutter/fml/build_config.h +FILE: ../../../flutter/fml/compiler_specific.h +FILE: ../../../flutter/fml/eintr_wrapper.h +FILE: ../../../flutter/fml/memory/ref_counted.h +FILE: ../../../flutter/fml/memory/ref_counted_internal.h +FILE: ../../../flutter/fml/memory/ref_counted_unittest.cc +FILE: ../../../flutter/fml/memory/ref_ptr.h +FILE: ../../../flutter/fml/memory/ref_ptr_internal.h +FILE: ../../../flutter/fml/memory/thread_checker.h +FILE: ../../../flutter/fml/memory/weak_ptr.h +FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc +FILE: ../../../flutter/fml/memory/weak_ptr_internal.h +FILE: ../../../flutter/fml/memory/weak_ptr_unittest.cc ---------------------------------------------------------------------------------------------------- -Copyright 2017 The Fuchsia Authors. All rights reserved. +Copyright 2016 The Fuchsia Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -1033,218 +848,301 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: txt +ORIGIN: ../../../flutter/third_party/txt/LICENSE +TYPE: LicenseType.apache +FILE: ../../../flutter/third_party/txt/benchmarks/paint_record_benchmarks.cc +FILE: ../../../flutter/third_party/txt/benchmarks/paragraph_benchmarks.cc +FILE: ../../../flutter/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc +FILE: ../../../flutter/third_party/txt/benchmarks/styled_runs_benchmarks.cc +FILE: ../../../flutter/third_party/txt/benchmarks/txt_run_all_benchmarks.cc +FILE: ../../../flutter/third_party/txt/benchmarks/utils.cc +FILE: ../../../flutter/third_party/txt/benchmarks/utils.h +FILE: ../../../flutter/third_party/txt/src/log/log.cc +FILE: ../../../flutter/third_party/txt/src/log/log.h +FILE: ../../../flutter/third_party/txt/src/minikin/CmapCoverage.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/CmapCoverage.h +FILE: ../../../flutter/third_party/txt/src/minikin/Emoji.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/Emoji.h +FILE: ../../../flutter/third_party/txt/src/minikin/FontCollection.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/FontCollection.h +FILE: ../../../flutter/third_party/txt/src/minikin/FontFamily.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/FontFamily.h +FILE: ../../../flutter/third_party/txt/src/minikin/FontLanguage.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/FontLanguage.h +FILE: ../../../flutter/third_party/txt/src/minikin/FontLanguageListCache.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/FontLanguageListCache.h +FILE: ../../../flutter/third_party/txt/src/minikin/FontUtils.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/FontUtils.h +FILE: ../../../flutter/third_party/txt/src/minikin/GraphemeBreak.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/GraphemeBreak.h +FILE: ../../../flutter/third_party/txt/src/minikin/HbFontCache.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/HbFontCache.h +FILE: ../../../flutter/third_party/txt/src/minikin/Hyphenator.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/Hyphenator.h +FILE: ../../../flutter/third_party/txt/src/minikin/Layout.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/Layout.h +FILE: ../../../flutter/third_party/txt/src/minikin/LayoutUtils.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/LayoutUtils.h +FILE: ../../../flutter/third_party/txt/src/minikin/LineBreaker.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/LineBreaker.h +FILE: ../../../flutter/third_party/txt/src/minikin/Measurement.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/Measurement.h +FILE: ../../../flutter/third_party/txt/src/minikin/MinikinFont.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/MinikinFont.h +FILE: ../../../flutter/third_party/txt/src/minikin/MinikinInternal.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/MinikinInternal.h +FILE: ../../../flutter/third_party/txt/src/minikin/SparseBitSet.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/SparseBitSet.h +FILE: ../../../flutter/third_party/txt/src/minikin/WordBreaker.cpp +FILE: ../../../flutter/third_party/txt/src/minikin/WordBreaker.h +FILE: ../../../flutter/third_party/txt/src/txt/asset_data_provider.cc +FILE: ../../../flutter/third_party/txt/src/txt/asset_data_provider.h +FILE: ../../../flutter/third_party/txt/src/txt/asset_font_manager.cc +FILE: ../../../flutter/third_party/txt/src/txt/asset_font_manager.h +FILE: ../../../flutter/third_party/txt/src/txt/font_collection.cc +FILE: ../../../flutter/third_party/txt/src/txt/font_collection.h +FILE: ../../../flutter/third_party/txt/src/txt/font_skia.cc +FILE: ../../../flutter/third_party/txt/src/txt/font_skia.h +FILE: ../../../flutter/third_party/txt/src/txt/font_style.h +FILE: ../../../flutter/third_party/txt/src/txt/font_weight.h +FILE: ../../../flutter/third_party/txt/src/txt/paint_record.cc +FILE: ../../../flutter/third_party/txt/src/txt/paint_record.h +FILE: ../../../flutter/third_party/txt/src/txt/paragraph.cc +FILE: ../../../flutter/third_party/txt/src/txt/paragraph.h +FILE: ../../../flutter/third_party/txt/src/txt/paragraph_builder.cc +FILE: ../../../flutter/third_party/txt/src/txt/paragraph_builder.h +FILE: ../../../flutter/third_party/txt/src/txt/paragraph_style.cc +FILE: ../../../flutter/third_party/txt/src/txt/paragraph_style.h +FILE: ../../../flutter/third_party/txt/src/txt/styled_runs.cc +FILE: ../../../flutter/third_party/txt/src/txt/styled_runs.h +FILE: ../../../flutter/third_party/txt/src/txt/test_font_manager.cc +FILE: ../../../flutter/third_party/txt/src/txt/test_font_manager.h +FILE: ../../../flutter/third_party/txt/src/txt/text_baseline.h +FILE: ../../../flutter/third_party/txt/src/txt/text_decoration.cc +FILE: ../../../flutter/third_party/txt/src/txt/text_decoration.h +FILE: ../../../flutter/third_party/txt/src/txt/text_style.cc +FILE: ../../../flutter/third_party/txt/src/txt/text_style.h +FILE: ../../../flutter/third_party/txt/src/utils/JenkinsHash.cpp +FILE: ../../../flutter/third_party/txt/src/utils/JenkinsHash.h +FILE: ../../../flutter/third_party/txt/src/utils/LruCache.h +FILE: ../../../flutter/third_party/txt/src/utils/TypeHelpers.h +FILE: ../../../flutter/third_party/txt/src/utils/WindowsUtils.h +---------------------------------------------------------------------------------------------------- +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../third_party/icu/scripts/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../flutter/flow/compositor_context.cc -FILE: ../../../flutter/flow/compositor_context.h -FILE: ../../../flutter/flow/instrumentation.cc -FILE: ../../../flutter/flow/instrumentation.h -FILE: ../../../flutter/flow/layers/clip_path_layer.cc -FILE: ../../../flutter/flow/layers/clip_path_layer.h -FILE: ../../../flutter/flow/layers/clip_rect_layer.cc -FILE: ../../../flutter/flow/layers/clip_rect_layer.h -FILE: ../../../flutter/flow/layers/clip_rrect_layer.cc -FILE: ../../../flutter/flow/layers/clip_rrect_layer.h -FILE: ../../../flutter/flow/layers/color_filter_layer.cc -FILE: ../../../flutter/flow/layers/color_filter_layer.h -FILE: ../../../flutter/flow/layers/container_layer.cc -FILE: ../../../flutter/flow/layers/container_layer.h -FILE: ../../../flutter/flow/layers/layer.cc -FILE: ../../../flutter/flow/layers/layer.h -FILE: ../../../flutter/flow/layers/layer_tree.cc -FILE: ../../../flutter/flow/layers/layer_tree.h -FILE: ../../../flutter/flow/layers/opacity_layer.cc -FILE: ../../../flutter/flow/layers/opacity_layer.h -FILE: ../../../flutter/flow/layers/performance_overlay_layer.cc -FILE: ../../../flutter/flow/layers/performance_overlay_layer.h -FILE: ../../../flutter/flow/layers/picture_layer.cc -FILE: ../../../flutter/flow/layers/picture_layer.h -FILE: ../../../flutter/flow/layers/transform_layer.cc -FILE: ../../../flutter/flow/layers/transform_layer.h -FILE: ../../../flutter/lib/snapshot/snapshot.dart -FILE: ../../../flutter/lib/snapshot/snapshot.h -FILE: ../../../flutter/lib/snapshot/snapshot_fuchsia.dart -FILE: ../../../flutter/lib/ui/compositing.dart -FILE: ../../../flutter/lib/ui/compositing/scene.cc -FILE: ../../../flutter/lib/ui/compositing/scene.h -FILE: ../../../flutter/lib/ui/compositing/scene_builder.cc -FILE: ../../../flutter/lib/ui/compositing/scene_builder.h -FILE: ../../../flutter/lib/ui/geometry.dart -FILE: ../../../flutter/lib/ui/hash_codes.dart -FILE: ../../../flutter/lib/ui/hooks.dart -FILE: ../../../flutter/lib/ui/lerp.dart -FILE: ../../../flutter/lib/ui/painting.dart -FILE: ../../../flutter/lib/ui/painting/canvas.cc -FILE: ../../../flutter/lib/ui/painting/canvas.h -FILE: ../../../flutter/lib/ui/painting/gradient.cc -FILE: ../../../flutter/lib/ui/painting/gradient.h -FILE: ../../../flutter/lib/ui/painting/image_shader.cc -FILE: ../../../flutter/lib/ui/painting/image_shader.h -FILE: ../../../flutter/lib/ui/painting/matrix.cc -FILE: ../../../flutter/lib/ui/painting/matrix.h -FILE: ../../../flutter/lib/ui/painting/paint.cc -FILE: ../../../flutter/lib/ui/painting/paint.h -FILE: ../../../flutter/lib/ui/painting/path.cc -FILE: ../../../flutter/lib/ui/painting/path.h -FILE: ../../../flutter/lib/ui/painting/path_measure.cc -FILE: ../../../flutter/lib/ui/painting/path_measure.h -FILE: ../../../flutter/lib/ui/painting/picture.cc -FILE: ../../../flutter/lib/ui/painting/picture.h -FILE: ../../../flutter/lib/ui/painting/picture_recorder.cc -FILE: ../../../flutter/lib/ui/painting/picture_recorder.h -FILE: ../../../flutter/lib/ui/painting/rrect.cc -FILE: ../../../flutter/lib/ui/painting/rrect.h -FILE: ../../../flutter/lib/ui/painting/shader.cc -FILE: ../../../flutter/lib/ui/painting/shader.h -FILE: ../../../flutter/lib/ui/pointer.dart -FILE: ../../../flutter/lib/ui/text.dart -FILE: ../../../flutter/lib/ui/text/paragraph.cc -FILE: ../../../flutter/lib/ui/text/paragraph.h -FILE: ../../../flutter/lib/ui/text/paragraph_builder.cc -FILE: ../../../flutter/lib/ui/text/paragraph_builder.h -FILE: ../../../flutter/lib/ui/text/paragraph_impl.cc -FILE: ../../../flutter/lib/ui/text/paragraph_impl.h -FILE: ../../../flutter/lib/ui/text/paragraph_impl_txt.cc -FILE: ../../../flutter/lib/ui/text/paragraph_impl_txt.h -FILE: ../../../flutter/lib/ui/text/text_box.cc -FILE: ../../../flutter/lib/ui/ui.dart -FILE: ../../../flutter/lib/ui/ui_dart_state.cc -FILE: ../../../flutter/lib/ui/ui_dart_state.h -FILE: ../../../flutter/lib/ui/window.dart -FILE: ../../../flutter/lib/ui/window/pointer_data.cc -FILE: ../../../flutter/lib/ui/window/pointer_data_packet.cc -FILE: ../../../flutter/lib/ui/window/window.cc -FILE: ../../../flutter/runtime/dart_service_isolate.cc -FILE: ../../../flutter/runtime/dart_service_isolate.h -FILE: ../../../flutter/runtime/runtime_controller.cc -FILE: ../../../flutter/runtime/runtime_controller.h -FILE: ../../../flutter/runtime/runtime_delegate.cc -FILE: ../../../flutter/runtime/runtime_delegate.h -FILE: ../../../flutter/shell/common/animator.cc -FILE: ../../../flutter/shell/common/animator.h -FILE: ../../../flutter/shell/common/engine.cc -FILE: ../../../flutter/shell/common/engine.h -FILE: ../../../flutter/shell/common/picture_serializer.cc -FILE: ../../../flutter/shell/common/picture_serializer.h -FILE: ../../../flutter/shell/common/platform_view.cc -FILE: ../../../flutter/shell/common/platform_view.h -FILE: ../../../flutter/shell/common/rasterizer.cc -FILE: ../../../flutter/shell/common/rasterizer.h -FILE: ../../../flutter/shell/common/shell.cc -FILE: ../../../flutter/shell/common/shell.h -FILE: ../../../flutter/shell/common/vsync_waiter.cc -FILE: ../../../flutter/shell/common/vsync_waiter.h -FILE: ../../../flutter/shell/common/vsync_waiter_fallback.h -FILE: ../../../flutter/shell/platform/android/AndroidManifest.xml -FILE: ../../../flutter/shell/platform/android/flutter_main.cc -FILE: ../../../flutter/shell/platform/android/flutter_main.h -FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterActivity.java -FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterApplication.java -FILE: ../../../flutter/shell/platform/android/io/flutter/view/ResourceCleaner.java -FILE: ../../../flutter/shell/platform/android/io/flutter/view/ResourceExtractor.java -FILE: ../../../flutter/shell/platform/android/io/flutter/view/ResourcePaths.java -FILE: ../../../flutter/shell/platform/android/library_loader.cc -FILE: ../../../flutter/shell/platform/android/platform_view_android.cc -FILE: ../../../flutter/shell/platform/android/platform_view_android.h -FILE: ../../../flutter/shell/platform/darwin/common/buffer_conversions.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.h -FILE: ../../../flutter/shell/platform/darwin/desktop/flutter_window.mm -FILE: ../../../flutter/shell/platform/darwin/desktop/main_mac.mm -FILE: ../../../flutter/shell/platform/darwin/desktop/platform_view_mac.h -FILE: ../../../flutter/shell/platform/darwin/desktop/platform_view_mac.mm -FILE: ../../../flutter/shell/platform/darwin/desktop/vsync_waiter_mac.cc -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm ----------------------------------------------------------------------------------------------------- -Copyright 2015 The Chromium Authors. All rights reserved. +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +END OF TERMS AND CONDITIONS -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== +APPENDIX: How to apply the Apache License to your work. -==================================================================================================== -LIBRARY: engine -ORIGIN: ../../../topaz/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../flutter/fml/build_config.h -FILE: ../../../flutter/fml/compiler_specific.h -FILE: ../../../flutter/fml/eintr_wrapper.h -FILE: ../../../flutter/fml/memory/ref_counted.h -FILE: ../../../flutter/fml/memory/ref_counted_internal.h -FILE: ../../../flutter/fml/memory/ref_counted_unittest.cc -FILE: ../../../flutter/fml/memory/ref_ptr.h -FILE: ../../../flutter/fml/memory/ref_ptr_internal.h -FILE: ../../../flutter/fml/memory/thread_checker.h -FILE: ../../../flutter/fml/memory/weak_ptr.h -FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc -FILE: ../../../flutter/fml/memory/weak_ptr_internal.h -FILE: ../../../flutter/fml/memory/weak_ptr_unittest.cc ----------------------------------------------------------------------------------------------------- -Copyright 2016 The Fuchsia Authors. All rights reserved. + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Copyright [yyyy] [name of copyright owner] - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. ==================================================================================================== -Total license count: 13 +Total license count: 11 From 0167f9f9088693eec1fed2680ab1bea2ae0f6024 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 17 May 2018 13:41:36 -0700 Subject: [PATCH 0360/1190] Remove dart_vm_entry_points_fuchsia.txt as it has been moved to //topaz (#5291) --- runtime/dart_vm_entry_points_fuchsia.txt | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 runtime/dart_vm_entry_points_fuchsia.txt diff --git a/runtime/dart_vm_entry_points_fuchsia.txt b/runtime/dart_vm_entry_points_fuchsia.txt deleted file mode 100644 index dab7dac8bec90..0000000000000 --- a/runtime/dart_vm_entry_points_fuchsia.txt +++ /dev/null @@ -1,16 +0,0 @@ -dart:fuchsia,::,_environment -dart:fuchsia,::,_outgoingServices -dart:io,_EmbedderConfig,_mayExit -dart:io,_Namespace,_setupNamespace -dart:mozart.internal,::,_context -dart:mozart.internal,::,_viewContainer -dart:zircon,FromFileResult,FromFileResult. -dart:zircon,GetSizeResult,GetSizeResult. -dart:zircon,Handle,Handle._ -dart:zircon,HandlePairResult,HandlePairResult. -dart:zircon,HandleResult,HandleResult. -dart:zircon,HandleWaiter,HandleWaiter._ -dart:zircon,MapResult,MapResult. -dart:zircon,ReadResult,ReadResult. -dart:zircon,WriteResult,WriteResult. -dart:zircon,_Namespace,_namespace From 45ebf1d4a6a5e16beefa1dc18e71401489739e4e Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 17 May 2018 14:09:45 -0700 Subject: [PATCH 0361/1190] Disable kernel-based expression evaluation. (#5290) This should be reverted once dartbug.com/33087 is fixed. --- runtime/dart_vm.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index eeb395257c411..a8206789d6285 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -60,6 +60,7 @@ namespace blink { static const char* kDartLanguageArgs[] = { "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", "--causal_async_stacks", "--limit-ints-to-64-bits", + "--enable_kernel_expression_compilation=false" // TODO(dartbug.com/33087) }; static const char* kDartPrecompilationArgs[] = { From 4a7940075c801b2437f6e780847c9b8bf69cf467 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 17 May 2018 14:10:19 -0700 Subject: [PATCH 0362/1190] Revert "Support for TwoPointConical gradients (#5275)" (#5293) This reverts commit 919e8c211f518f17dbd298d9f8e39091b9e3897f as it breaks flutter gradient_test. --- lib/ui/painting.dart | 25 +++---------------------- lib/ui/painting/gradient.cc | 32 +------------------------------- lib/ui/painting/gradient.h | 11 ----------- 3 files changed, 4 insertions(+), 64 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 66419b7081643..0adb6f1cae428 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2310,44 +2310,25 @@ class Gradient extends Shader { /// If `matrix4` is provided, the gradient fill will be transformed by the /// specified 4x4 matrix relative to the local coordinate system. `matrix4` must /// be a column-major matrix packed into a list of 16 values. - /// - /// If `focal` is provided and not equal to `center` or `focalRadius` is - /// provided and not equal to 0.0, the generated shader will be a two point - /// conical radial gradient, with `focal` being the center of the focal - /// circle and `focalRadius` being the radius of that circle. If `focal` is - /// provided and not equal to `center`, at least one of the two offsets must - /// not be equal to [Offset.zero]. Gradient.radial( Offset center, double radius, List colors, [ List colorStops, TileMode tileMode = TileMode.clamp, - Float64List matrix4, - Offset focal, - double focalRadius + Float64List matrix4 ]) : assert(_offsetIsValid(center)), assert(colors != null), assert(tileMode != null), assert(matrix4 == null || _matrix4IsValid(matrix4)), super._() { - focal ??= center; - focalRadius ??= 0.0; _validateColorStops(colors, colorStops); final Int32List colorsBuffer = _encodeColorList(colors); final Float32List colorStopsBuffer = colorStops == null ? null : new Float32List.fromList(colorStops); - - if (center == focal && focalRadius != 0.0) { - _constructor(); - _initRadial(center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); - } else { - assert(center != Offset.zero || focal != Offset.zero); // will result in nullptr in Skia side - _constructor(); - _initConical(focal.dx, focal.dy, focalRadius, center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); - } + _constructor(); + _initRadial(center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); } void _initRadial(double centerX, double centerY, double radius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initRadial'; - void _initConical(double startX, double startY, double startRadius, double endX, double endY, double endRadius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initTwoPointConical'; /// Creates a sweep gradient centered at `center` that starts at `startAngle` /// and ends at `endAngle`. diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 71b2669100fa1..9cbf5a19c5275 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -25,8 +25,7 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Gradient); #define FOR_EACH_BINDING(V) \ V(Gradient, initLinear) \ V(Gradient, initRadial) \ - V(Gradient, initSweep) \ - V(Gradient, initTwoPointConical) + V(Gradient, initSweep) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -110,35 +109,6 @@ void CanvasGradient::initSweep(double center_x, has_matrix ? &sk_matrix : nullptr))); } -void CanvasGradient::initTwoPointConical(double start_x, - double start_y, - double start_radius, - double end_x, - double end_y, - double end_radius, - const tonic::Int32List& colors, - const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode, - const tonic::Float64List& matrix4) { - FXL_DCHECK(colors.num_elements() == color_stops.num_elements() || - color_stops.data() == nullptr); - - static_assert(sizeof(SkColor) == sizeof(int32_t), - "SkColor doesn't use int32_t."); - - SkMatrix sk_matrix; - bool has_matrix = matrix4.data() != nullptr; - if (has_matrix) { - sk_matrix = ToSkMatrix(matrix4); - } - - set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeTwoPointConical( - SkPoint::Make(start_x, start_y), start_radius, - SkPoint::Make(end_x, end_y), end_radius, - reinterpret_cast(colors.data()), color_stops.data(), - colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr))); -} - CanvasGradient::CanvasGradient() = default; CanvasGradient::~CanvasGradient() = default; diff --git a/lib/ui/painting/gradient.h b/lib/ui/painting/gradient.h index 4d8e8ec09191b..178c17fe9b41c 100644 --- a/lib/ui/painting/gradient.h +++ b/lib/ui/painting/gradient.h @@ -52,17 +52,6 @@ class CanvasGradient : public Shader { double end_angle, const tonic::Float64List& matrix4); - void initTwoPointConical(double start_x, - double start_y, - double start_radius, - double end_x, - double end_y, - double end_radius, - const tonic::Int32List& colors, - const tonic::Float32List& color_stops, - SkShader::TileMode tile_mode, - const tonic::Float64List& matrix4); - static void RegisterNatives(tonic::DartLibraryNatives* natives); private: From 65d52d94fd648e672d2c9de9075af803a1e4ec9f Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 17 May 2018 14:11:12 -0700 Subject: [PATCH 0363/1190] Revert "Delegate AppDelegate life-cycle callbacks to plugins via separate object (#5173)" (#5294) This reverts commit 597fa9ed454a8291f5b09978ac821ba316d7c5a0 as it broke mac engine build bot. --- shell/platform/darwin/ios/BUILD.gn | 2 - .../darwin/ios/framework/Headers/Flutter.h | 1 - .../framework/Headers/FlutterAppDelegate.h | 14 +- .../ios/framework/Headers/FlutterPlugin.h | 8 - .../FlutterPluginAppLifeCycleDelegate.h | 135 --------- .../framework/Headers/FlutterViewController.h | 5 +- .../framework/Source/FlutterAppDelegate.mm | 253 +++++++++++++--- .../FlutterPluginAppLifeCycleDelegate.mm | 278 ------------------ .../framework/Source/FlutterViewController.mm | 87 ------ travis/licenses_golden/licenses_flutter | 2 - 10 files changed, 219 insertions(+), 566 deletions(-) delete mode 100644 shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h delete mode 100644 shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 41793e0c67d40..19d2486a69fa4 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -22,7 +22,6 @@ _flutter_framework_headers = [ "framework/Headers/FlutterMacros.h", "framework/Headers/FlutterNavigationController.h", "framework/Headers/FlutterPlugin.h", - "framework/Headers/FlutterPluginAppLifeCycleDelegate.h", "framework/Headers/FlutterTexture.h", "framework/Headers/FlutterViewController.h", ] @@ -44,7 +43,6 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterNavigationController.mm", "framework/Source/FlutterPlatformPlugin.h", "framework/Source/FlutterPlatformPlugin.mm", - "framework/Source/FlutterPluginAppLifeCycleDelegate.mm", "framework/Source/FlutterStandardCodec.mm", "framework/Source/FlutterStandardCodec_Internal.h", "framework/Source/FlutterTextInputDelegate.h", diff --git a/shell/platform/darwin/ios/framework/Headers/Flutter.h b/shell/platform/darwin/ios/framework/Headers/Flutter.h index d850854f2f517..939040c8e5dfd 100644 --- a/shell/platform/darwin/ios/framework/Headers/Flutter.h +++ b/shell/platform/darwin/ios/framework/Headers/Flutter.h @@ -43,7 +43,6 @@ #include "FlutterMacros.h" #include "FlutterNavigationController.h" #include "FlutterPlugin.h" -#include "FlutterPluginAppLifeCycleDelegate.h" #include "FlutterTexture.h" #include "FlutterViewController.h" diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h b/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h index f175ea2925826..4f28e70b65fc5 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h @@ -24,10 +24,22 @@ * code as necessary from FlutterAppDelegate.mm. */ FLUTTER_EXPORT -@interface FlutterAppDelegate : UIResponder +@interface FlutterAppDelegate : UIResponder @property(strong, nonatomic) UIWindow* window; +// Can be overriden by subclasses to provide a custom FlutterBinaryMessenger, +// typically a FlutterViewController, for plugin interop. +// +// Defaults to window's rootViewController. +- (NSObject*)binaryMessenger; + +// Can be overriden by subclasses to provide a custom FlutterTextureRegistry, +// typically a FlutterViewController, for plugin interop. +// +// Defaults to window's rootViewController. +- (NSObject*)textures; + @end #endif // FLUTTER_FLUTTERDARTPROJECT_H_ diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index 46bee66f99dd5..646ffa30d74fd 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -253,14 +253,6 @@ NS_ASSUME_NONNULL_BEGIN - (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey; @end -/** - Implement this in the `UIAppDelegate` of your app to enable Flutter plugins to register themselves to the application - life cycle events. -*/ -@protocol FlutterAppLifeCycleProvider -- (void)addApplicationLifeCycleDelegate:(NSObject*)delegate; -@end - NS_ASSUME_NONNULL_END; #endif // FLUTTER_FLUTTERPLUGIN_H_ diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h b/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h deleted file mode 100644 index 676ef6f476d0b..0000000000000 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h +++ /dev/null @@ -1,135 +0,0 @@ -// 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. - -#ifndef FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ -#define FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ - -#include "FlutterPlugin.h" - -NS_ASSUME_NONNULL_BEGIN - -/** - Propagates `UIAppDelegate` callbacks to registered plugins. -*/ -FLUTTER_EXPORT -@interface FlutterPluginAppLifeCycleDelegate : NSObject -/** - Registers `delegate` to receive life cycle callbacks via this FlutterPluginAppLifecycleDelegate as long as it is alive. - - `delegate` will only referenced weakly. -*/ -- (void)addDelegate:(NSObject*)delegate; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks. - - - Returns: `NO` if any plugin vetoes application launch. - */ -- (BOOL)application:(UIApplication*)application - didFinishLaunchingWithOptions:(NSDictionary*)launchOptions; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks. - */ -- (void)applicationDidBecomeActive:(UIApplication*)application; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks. - */ -- (void)applicationWillResignActive:(UIApplication*)application; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks. - */ -- (void)applicationDidEnterBackground:(UIApplication*)application; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks. - */ -- (void)applicationWillEnterForeground:(UIApplication*)application; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks. - */ -- (void)applicationWillTerminate:(UIApplication*)application; - -/** - Called if this plugin has been registered for `UIApplicationDelegate` callbacks. - */ -- (void)application:(UIApplication*)application - didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks. - */ -- (void)application:(UIApplication*)application - didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks. - */ -- (void)application:(UIApplication*)application - didReceiveRemoteNotification:(NSDictionary*)userInfo - fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles - the request. - - - Returns: `YES` if any plugin handles the request. -*/ -- (BOOL)application:(UIApplication*)application - openURL:(NSURL*)url - options:(NSDictionary*)options; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles - the request. - - - Returns: `YES` if any plugin handles the request. - */ -- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles - the request. - - - Returns: `YES` if any plugin handles the request. -*/ -- (BOOL)application:(UIApplication*)application - openURL:(NSURL*)url - sourceApplication:(NSString*)sourceApplication - annotation:(id)annotation; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks. -*/ -- (void)application:(UIApplication*)application - performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem - completionHandler:(void (^)(BOOL succeeded))completionHandler - API_AVAILABLE(ios(9.0)); - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles - the request. - - - Returns: `YES` if any plugin handles the request. -*/ -- (BOOL)application:(UIApplication*)application - handleEventsForBackgroundURLSession:(nonnull NSString*)identifier - completionHandler:(nonnull void (^)())completionHandler; - -/** - Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles - the request. - - - Returns: `YES` if any plugin handles the request. -*/ -- (BOOL)application:(UIApplication*)application - performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; -@end - -NS_ASSUME_NONNULL_END - -#endif // FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ \ No newline at end of file diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h b/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h index 524890ca2c05f..7ef6868a27632 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h @@ -11,11 +11,10 @@ #include "FlutterBinaryMessenger.h" #include "FlutterDartProject.h" #include "FlutterMacros.h" -#include "FlutterPlugin.h" #include "FlutterTexture.h" FLUTTER_EXPORT -@interface FlutterViewController : UIViewController +@interface FlutterViewController : UIViewController - (instancetype)initWithProject:(FlutterDartProject*)project nibName:(NSString*)nibNameOrNil @@ -50,8 +49,6 @@ FLUTTER_EXPORT */ - (void)setInitialRoute:(NSString*)route; -- (id)pluginRegistry; - @end #endif // FLUTTER_FLUTTERVIEWCONTROLLER_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index b175966f3dbab..a5132bf4ee4e0 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -3,28 +3,46 @@ // found in the LICENSE file. #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#include "lib/fxl/logging.h" + +@interface FlutterAppDelegate () +@property(readonly, nonatomic) NSMutableArray* pluginDelegates; +@property(readonly, nonatomic) NSMutableDictionary* pluginPublications; +@end + +@interface FlutterAppDelegateRegistrar : NSObject +- (instancetype)initWithPlugin:(NSString*)pluginKey appDelegate:(FlutterAppDelegate*)delegate; +@end @implementation FlutterAppDelegate { - FlutterPluginAppLifeCycleDelegate* _lifeCycleDelegate; + UIBackgroundTaskIdentifier _debugBackgroundTask; } - (instancetype)init { if (self = [super init]) { - _lifeCycleDelegate = [[FlutterPluginAppLifeCycleDelegate alloc] init]; + _pluginDelegates = [NSMutableArray new]; + _pluginPublications = [NSMutableDictionary new]; } return self; } - (void)dealloc { - [_lifeCycleDelegate release]; + [_pluginDelegates release]; + [_pluginPublications release]; [super dealloc]; } - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { - return [_lifeCycleDelegate application:application didFinishLaunchingWithOptions:launchOptions]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if (![plugin application:application didFinishLaunchingWithOptions:launchOptions]) { + return NO; + } + } + } + return YES; } // Returns the key window's rootViewController, if it's a FlutterViewController. @@ -47,118 +65,257 @@ - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { } - (void)applicationDidEnterBackground:(UIApplication*)application { - [_lifeCycleDelegate applicationDidEnterBackground:application]; +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + // The following keeps the Flutter session alive when the device screen locks + // in debug mode. It allows continued use of features like hot reload and + // taking screenshots once the device unlocks again. + // + // Note the name is not an identifier and multiple instances can exist. + _debugBackgroundTask = [application + beginBackgroundTaskWithName:@"Flutter debug task" + expirationHandler:^{ + FXL_LOG(WARNING) + << "\nThe OS has terminated the Flutter debug connection for being " + "inactive in the background for too long.\n\n" + "There are no errors with your Flutter application.\n\n" + "To reconnect, launch your application again via 'flutter run'"; + }]; +#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationDidEnterBackground:application]; + } + } } - (void)applicationWillEnterForeground:(UIApplication*)application { - [_lifeCycleDelegate applicationWillEnterForeground:application]; +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + [application endBackgroundTask:_debugBackgroundTask]; +#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationWillEnterForeground:application]; + } + } } - (void)applicationWillResignActive:(UIApplication*)application { - [_lifeCycleDelegate applicationWillResignActive:application]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationWillResignActive:application]; + } + } } - (void)applicationDidBecomeActive:(UIApplication*)application { - [_lifeCycleDelegate applicationDidBecomeActive:application]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationDidBecomeActive:application]; + } + } } - (void)applicationWillTerminate:(UIApplication*)application { - [_lifeCycleDelegate applicationWillTerminate:application]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationWillTerminate:application]; + } + } } - (void)application:(UIApplication*)application didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings { - [_lifeCycleDelegate application:application - didRegisterUserNotificationSettings:notificationSettings]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + [plugin application:application didRegisterUserNotificationSettings:notificationSettings]; + } + } } - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { - [_lifeCycleDelegate application:application - didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + [plugin application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; + } + } } - (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - [_lifeCycleDelegate application:application - didReceiveRemoteNotification:userInfo - fetchCompletionHandler:completionHandler]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + didReceiveRemoteNotification:userInfo + fetchCompletionHandler:completionHandler]) { + return; + } + } + } } - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url options:(NSDictionary*)options { - return [_lifeCycleDelegate application:application openURL:url options:options]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application openURL:url options:options]) { + return YES; + } + } + } + return NO; } - (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url { - return [_lifeCycleDelegate application:application handleOpenURL:url]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application handleOpenURL:url]) { + return YES; + } + } + } + return NO; } - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation { - return [_lifeCycleDelegate application:application - openURL:url - sourceApplication:sourceApplication - annotation:annotation]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + openURL:url + sourceApplication:sourceApplication + annotation:annotation]) { + return YES; + } + } + } + return NO; } - (void)application:(UIApplication*)application performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem completionHandler:(void (^)(BOOL succeeded))completionHandler NS_AVAILABLE_IOS(9_0) { - [_lifeCycleDelegate application:application - performActionForShortcutItem:shortcutItem - completionHandler:completionHandler]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + performActionForShortcutItem:shortcutItem + completionHandler:completionHandler]) { + return; + } + } + } } - (void)application:(UIApplication*)application handleEventsForBackgroundURLSession:(nonnull NSString*)identifier completionHandler:(nonnull void (^)())completionHandler { - [_lifeCycleDelegate application:application - handleEventsForBackgroundURLSession:identifier - completionHandler:completionHandler]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + handleEventsForBackgroundURLSession:identifier + completionHandler:completionHandler]) { + return; + } + } + } } - (void)application:(UIApplication*)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - [_lifeCycleDelegate application:application performFetchWithCompletionHandler:completionHandler]; + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application performFetchWithCompletionHandler:completionHandler]) { + return; + } + } + } } -#pragma mark - FlutterPluginRegistry methods. All delegating to the rootViewController - -- (NSObject*)registrarForPlugin:(NSString*)pluginKey { +// TODO(xster): move when doing https://github.com/flutter/flutter/issues/3671. +- (NSObject*)binaryMessenger { UIViewController* rootViewController = _window.rootViewController; - if ([rootViewController isKindOfClass:[FlutterViewController class]]) { - return - [[(FlutterViewController*)rootViewController pluginRegistry] registrarForPlugin:pluginKey]; + if ([rootViewController conformsToProtocol:@protocol(FlutterBinaryMessenger)]) { + return (NSObject*)rootViewController; } return nil; } -- (BOOL)hasPlugin:(NSString*)pluginKey { +- (NSObject*)textures { UIViewController* rootViewController = _window.rootViewController; - if ([rootViewController isKindOfClass:[FlutterViewController class]]) { - return [[(FlutterViewController*)rootViewController pluginRegistry] hasPlugin:pluginKey]; + if ([rootViewController conformsToProtocol:@protocol(FlutterTextureRegistry)]) { + return (NSObject*)rootViewController; } return nil; } +- (NSObject*)registrarForPlugin:(NSString*)pluginKey { + NSAssert(self.pluginPublications[pluginKey] == nil, @"Duplicate plugin key: %@", pluginKey); + self.pluginPublications[pluginKey] = [NSNull null]; + return + [[[FlutterAppDelegateRegistrar alloc] initWithPlugin:pluginKey appDelegate:self] autorelease]; +} + +- (BOOL)hasPlugin:(NSString*)pluginKey { + return _pluginPublications[pluginKey] != nil; +} + - (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey { - UIViewController* rootViewController = _window.rootViewController; - if ([rootViewController isKindOfClass:[FlutterViewController class]]) { - return [[(FlutterViewController*)rootViewController pluginRegistry] - valuePublishedByPlugin:pluginKey]; - } - return nil; + return _pluginPublications[pluginKey]; +} +@end + +@implementation FlutterAppDelegateRegistrar { + NSString* _pluginKey; + FlutterAppDelegate* _appDelegate; +} + +- (instancetype)initWithPlugin:(NSString*)pluginKey appDelegate:(FlutterAppDelegate*)appDelegate { + self = [super init]; + NSAssert(self, @"Super init cannot be nil"); + _pluginKey = [pluginKey retain]; + _appDelegate = [appDelegate retain]; + return self; +} + +- (void)dealloc { + [_pluginKey release]; + [_appDelegate release]; + [super dealloc]; +} + +- (NSObject*)messenger { + return [_appDelegate binaryMessenger]; } -#pragma mark - FlutterAppLifeCycleProvider methods +- (NSObject*)textures { + return [_appDelegate textures]; +} + +- (void)publish:(NSObject*)value { + _appDelegate.pluginPublications[_pluginKey] = value; +} + +- (void)addMethodCallDelegate:(NSObject*)delegate + channel:(FlutterMethodChannel*)channel { + [channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { + [delegate handleMethodCall:call result:result]; + }]; +} + +- (void)addApplicationDelegate:(NSObject*)delegate { + [_appDelegate.pluginDelegates addObject:delegate]; +} + +- (NSString*)lookupKeyForAsset:(NSString*)asset { + return [FlutterDartProject lookupKeyForAsset:asset]; +} -- (void)addApplicationLifeCycleDelegate:(NSObject*)delegate { - [_lifeCycleDelegate addDelegate:delegate]; +- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { + return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm deleted file mode 100644 index 900d048c57a09..0000000000000 --- a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm +++ /dev/null @@ -1,278 +0,0 @@ -// 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. - -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h" -#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" -#include "lib/fxl/logging.h" - -@implementation FlutterPluginAppLifeCycleDelegate { - UIBackgroundTaskIdentifier _debugBackgroundTask; - - // Weak references to registered plugins. - NSPointerArray* _pluginDelegates; -} - -- (instancetype)init { - if (self = [super init]) { - _pluginDelegates = [[NSPointerArray weakObjectsPointerArray] retain]; - } - return self; -} - -- (void)dealloc { - [_pluginDelegates release]; - [super dealloc]; -} - -static BOOL isPowerOfTwo(NSUInteger x) { - return x != 0 && (x & (x - 1)) == 0; -} - -- (void)addDelegate:(NSObject*)delegate { - [_pluginDelegates addPointer:(__bridge void*)delegate]; - if (isPowerOfTwo([_pluginDelegates count])) { - [_pluginDelegates compact]; - } -} - -- (BOOL)application:(UIApplication*)application - didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { - for (id plugin in [_pluginDelegates allObjects]) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - if (![plugin application:application didFinishLaunchingWithOptions:launchOptions]) { - return NO; - } - } - } - return YES; -} - -// Returns the key window's rootViewController, if it's a FlutterViewController. -// Otherwise, returns nil. -- (FlutterViewController*)rootFlutterViewController { - UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController; - if ([viewController isKindOfClass:[FlutterViewController class]]) { - return (FlutterViewController*)viewController; - } - return nil; -} - -- (void)applicationDidEnterBackground:(UIApplication*)application { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - // The following keeps the Flutter session alive when the device screen locks - // in debug mode. It allows continued use of features like hot reload and - // taking screenshots once the device unlocks again. - // - // Note the name is not an identifier and multiple instances can exist. - _debugBackgroundTask = [application - beginBackgroundTaskWithName:@"Flutter debug task" - expirationHandler:^{ - FXL_LOG(WARNING) - << "\nThe OS has terminated the Flutter debug connection for being " - "inactive in the background for too long.\n\n" - "There are no errors with your Flutter application.\n\n" - "To reconnect, launch your application again via 'flutter run'"; - }]; -#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationDidEnterBackground:application]; - } - } -} - -- (void)applicationWillEnterForeground:(UIApplication*)application { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - [application endBackgroundTask:_debugBackgroundTask]; -#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationWillEnterForeground:application]; - } - } -} - -- (void)applicationWillResignActive:(UIApplication*)application { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationWillResignActive:application]; - } - } -} - -- (void)applicationDidBecomeActive:(UIApplication*)application { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationDidBecomeActive:application]; - } - } -} - -- (void)applicationWillTerminate:(UIApplication*)application { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationWillTerminate:application]; - } - } -} - -- (void)application:(UIApplication*)application - didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - [plugin application:application didRegisterUserNotificationSettings:notificationSettings]; - } - } -} - -- (void)application:(UIApplication*)application - didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - [plugin application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; - } - } -} - -- (void)application:(UIApplication*)application - didReceiveRemoteNotification:(NSDictionary*)userInfo - fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - didReceiveRemoteNotification:userInfo - fetchCompletionHandler:completionHandler]) { - return; - } - } - } -} - -- (BOOL)application:(UIApplication*)application - openURL:(NSURL*)url - options:(NSDictionary*)options { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application openURL:url options:options]) { - return YES; - } - } - } - return NO; -} - -- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application handleOpenURL:url]) { - return YES; - } - } - } - return NO; -} - -- (BOOL)application:(UIApplication*)application - openURL:(NSURL*)url - sourceApplication:(NSString*)sourceApplication - annotation:(id)annotation { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - openURL:url - sourceApplication:sourceApplication - annotation:annotation]) { - return YES; - } - } - } - return NO; -} - -- (void)application:(UIApplication*)application - performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem - completionHandler:(void (^)(BOOL succeeded))completionHandler NS_AVAILABLE_IOS(9_0) { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - performActionForShortcutItem:shortcutItem - completionHandler:completionHandler]) { - return; - } - } - } -} - -- (BOOL)application:(UIApplication*)application - handleEventsForBackgroundURLSession:(nonnull NSString*)identifier - completionHandler:(nonnull void (^)())completionHandler { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - handleEventsForBackgroundURLSession:identifier - completionHandler:completionHandler]) { - return YES; - } - } - } - return NO; -} - -- (BOOL)application:(UIApplication*)application - performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - for (id plugin in _pluginDelegates) { - if (!plugin) { - continue; - } - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application performFetchWithCompletionHandler:completionHandler]) { - return YES; - } - } - } - return NO; -} -@end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index e3076c6c05ca7..2e13ffb738c1b 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -22,12 +22,6 @@ #include "flutter/shell/platform/darwin/ios/platform_view_ios.h" @interface FlutterViewController () -@property(nonatomic, readonly) NSMutableDictionary* pluginPublications; -@end - -@interface FlutterViewControllerRegistrar : NSObject -- (instancetype)initWithPlugin:(NSString*)pluginKey - flutterViewController:(FlutterViewController*)flutterViewController; @end @implementation FlutterViewController { @@ -99,8 +93,6 @@ - (void)performCommonViewControllerInitialization { if ([self setupShell]) { [self setupChannels]; [self setupNotificationCenterObservers]; - - _pluginPublications = [NSMutableDictionary new]; } } @@ -434,7 +426,6 @@ - (void)viewDidDisappear:(BOOL)animated { - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [_pluginPublications release]; [super dealloc]; } @@ -980,82 +971,4 @@ - (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } -- (id)pluginRegistry { - return self; -} - -#pragma mark - FlutterPluginRegistry - -- (NSObject*)registrarForPlugin:(NSString*)pluginKey { - NSAssert(self.pluginPublications[pluginKey] == nil, @"Duplicate plugin key: %@", pluginKey); - self.pluginPublications[pluginKey] = [NSNull null]; - return - [[FlutterViewControllerRegistrar alloc] initWithPlugin:pluginKey flutterViewController:self]; -} - -- (BOOL)hasPlugin:(NSString*)pluginKey { - return _pluginPublications[pluginKey] != nil; -} - -- (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey { - return _pluginPublications[pluginKey]; -} -@end - -@implementation FlutterViewControllerRegistrar { - NSString* _pluginKey; - FlutterViewController* _flutterViewController; -} - -- (instancetype)initWithPlugin:(NSString*)pluginKey - flutterViewController:(FlutterViewController*)flutterViewController { - self = [super init]; - NSAssert(self, @"Super init cannot be nil"); - _pluginKey = [pluginKey retain]; - _flutterViewController = [flutterViewController retain]; - return self; -} - -- (void)dealloc { - [_pluginKey release]; - [_flutterViewController release]; - [super dealloc]; -} - -- (NSObject*)messenger { - return _flutterViewController; -} - -- (NSObject*)textures { - return _flutterViewController; -} - -- (void)publish:(NSObject*)value { - _flutterViewController.pluginPublications[_pluginKey] = value; -} - -- (void)addMethodCallDelegate:(NSObject*)delegate - channel:(FlutterMethodChannel*)channel { - [channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { - [delegate handleMethodCall:call result:result]; - }]; -} - -- (void)addApplicationDelegate:(NSObject*)delegate { - id appDelegate = [[UIApplication sharedApplication] delegate]; - if ([appDelegate conformsToProtocol:@protocol(FlutterAppLifeCycleProvider)]) { - id lifeCycleProvider = - (id)appDelegate; - [lifeCycleProvider addApplicationLifeCycleDelegate:delegate]; - } -} - -- (NSString*)lookupKeyForAsset:(NSString*)asset { - return [_flutterViewController lookupKeyForAsset:asset]; -} - -- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { - return [_flutterViewController lookupKeyForAsset:asset fromPackage:package]; -} - @end diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 0d2260672fb8a..53d6bdc4ce7f8 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -493,8 +493,6 @@ FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_ FILE: ../../../flutter/lib/ui/painting/image_encoding.cc FILE: ../../../flutter/lib/ui/painting/image_encoding.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h -FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm ---------------------------------------------------------------------------------------------------- From a56f2f2b8440bdee10f2bba41a69d5dafa2b6bd7 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 17 May 2018 17:27:56 -0400 Subject: [PATCH 0364/1190] Roll src/third_party/skia/ 000e00df1..51371a433 (11 commits; 1 trivial rolls) (#5295) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 559 ++++++++++---------- travis/licenses_golden/licenses_third_party | 9 +- 3 files changed, 284 insertions(+), 286 deletions(-) diff --git a/DEPS b/DEPS index 385ed30c1d3d7..5bee98415a64c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '000e00df133695efb76ac07d028703cdf55837aa', + 'skia_revision': '51371a43397424ee4d3057fd5a82ec7c01eff705', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index f1320f9ac8bc6..4e2ee8e5d4f16 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -3419,70 +3419,6 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2017 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -3562,214 +3498,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine -observatory_pub_packages -skia -txt -vulkan - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. --------------------------------------------------------------------------------- -engine skia topaz @@ -4429,18 +4157,78 @@ Legal Terms o freetype-devel@nongnu.org - Discusses bugs, as well as engine internals, design issues, - specific licenses, porting, etc. + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + http://www.freetype.org + +--- end of FTL.TXT --- +-------------------------------------------------------------------------------- +garnet + +Copyright 2013 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet + +Copyright 2014 The Fuchsia Authors. All rights reserved. - Our home page can be found at +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: - http://www.freetype.org + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. ---- end of FTL.TXT --- +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- garnet -Copyright 2013 The Fuchsia Authors. All rights reserved. +Copyright 2017 The Fuchsia Authors.All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -4469,8 +4257,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- garnet +topaz -Copyright 2014 The Fuchsia Authors. All rights reserved. +Copyright 2015 The Fuchsia Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -4499,8 +4288,9 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- garnet +topaz -Copyright 2017 The Fuchsia Authors.All rights reserved. +Copyright 2017 The Fuchsia Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -4531,7 +4321,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. garnet topaz -Copyright 2015 The Fuchsia Authors. All rights reserved. +Copyright 2018 The Fuchsia Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -8841,6 +8631,213 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- +observatory_pub_packages +skia +txt +vulkan + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-------------------------------------------------------------------------------- rapidjson Copyright (c) 2006-2013 Alexander Chemeris diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 09d703c4c7ce0..eab68f4ee804b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: db79354db894b1942cd73cb23c69eced +Signature: 91e3c84a48f4788841aa803d329ab8cb UNUSED LICENSES: @@ -17328,13 +17328,10 @@ FILE: ../../../third_party/skia/third_party/skcms/skcms.c FILE: ../../../third_party/skia/third_party/skcms/skcms.h FILE: ../../../third_party/skia/third_party/skcms/src/Curve.c FILE: ../../../third_party/skia/third_party/skcms/src/Curve.h -FILE: ../../../third_party/skia/third_party/skcms/src/GaussNewton.c -FILE: ../../../third_party/skia/third_party/skcms/src/GaussNewton.h FILE: ../../../third_party/skia/third_party/skcms/src/ICCProfile.c FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.c FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.h FILE: ../../../third_party/skia/third_party/skcms/src/Macros.h -FILE: ../../../third_party/skia/third_party/skcms/src/PolyTF.c FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.c FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.h FILE: ../../../third_party/skia/third_party/skcms/src/RandomBytes.h @@ -17480,6 +17477,7 @@ FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_debu FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_release/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_sdk/VERSION FILE: ../../../third_party/skia/infra/bots/assets/mips64el_toolchain_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/moltenvk/VERSION FILE: ../../../third_party/skia/infra/bots/assets/node/VERSION FILE: ../../../third_party/skia/infra/bots/assets/procdump_win/VERSION FILE: ../../../third_party/skia/infra/bots/assets/protoc/VERSION @@ -17532,6 +17530,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.ex FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Debug-GDI.json @@ -17716,6 +17715,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Cl FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-MoltenVK_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Release-All-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Release-All.json @@ -17782,6 +17782,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-GC FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Release-All-NativeFonts.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookAir7.2-GPU-IntelHD6000-x86_64-Debug-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-MoltenVK_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Debug-All-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL1.json From 5c4201f3e9dc71b40728714e9524eade053985c8 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 17 May 2018 20:58:56 -0400 Subject: [PATCH 0365/1190] Roll src/third_party/skia/ 51371a433..dd6e62e28 (4 commits; 1 trivial rolls) (#5297) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5bee98415a64c..e60caebeda907 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '51371a43397424ee4d3057fd5a82ec7c01eff705', + 'skia_revision': 'dd6e62e289a14bd9980015ef24c6c6e8d1ac5862', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index eab68f4ee804b..ad26884e234fa 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 91e3c84a48f4788841aa803d329ab8cb +Signature: 8e24d66b5b9507989ea002b108aaa201 UNUSED LICENSES: From ea9f96b34327382404862127c8f120187fab8c02 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 18 May 2018 00:31:56 -0400 Subject: [PATCH 0366/1190] Roll src/third_party/skia/ dd6e62e28..44890ef00 (1 commit) (#5298) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e60caebeda907..07ac7122ce2f6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'dd6e62e289a14bd9980015ef24c6c6e8d1ac5862', + 'skia_revision': '44890ef00dabf8c47bbed3bba66a73bae8ed2f0d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ad26884e234fa..3ed82ef38a4fc 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8e24d66b5b9507989ea002b108aaa201 +Signature: 53f5374d887a744f11290732244b1983 UNUSED LICENSES: From 1179c38a42f5a979eec19f3b9ca72a5eb679442a Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Thu, 17 May 2018 23:50:07 -0700 Subject: [PATCH 0367/1190] Clear the raster cache result when bypassing raster cache. (#5300) https://github.com/flutter/flutter/issues/17448 --- flow/layers/picture_layer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index 552ca0443bd80..622e48a005bbe 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -19,6 +19,8 @@ void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { raster_cache_result_ = cache->GetPrerolledImage( context->gr_context, sk_picture, matrix, context->dst_color_space, is_complex_, will_change_); + } else { + raster_cache_result_ = RasterCacheResult(); } SkRect bounds = sk_picture->cullRect().makeOffset(offset_.x(), offset_.y()); From 14c3d638e9af449ad8701222260b3a5e9c0a1a38 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 18 May 2018 07:23:56 -0400 Subject: [PATCH 0368/1190] Roll src/third_party/skia/ 44890ef00..50edafacc (1 commit) (#5301) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 07ac7122ce2f6..be3ced14e1393 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '44890ef00dabf8c47bbed3bba66a73bae8ed2f0d', + 'skia_revision': '50edafacc8ea56bdc13fd2234618fe06094eec0e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3ed82ef38a4fc..6b2d292b43fa3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 53f5374d887a744f11290732244b1983 +Signature: a76aee9370c5d3ff82fa8eb3bd80fb43 UNUSED LICENSES: From 0a74ef48f22c02541381f7c72eb0ea8d4fd97481 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Fri, 18 May 2018 07:43:52 -0400 Subject: [PATCH 0369/1190] TwoPointConicGradients again (#5299) * update docs for getBounds * Add computeMetrics suggestion * better explanation * Support for TwoPointConical gradients --- lib/ui/painting.dart | 26 ++++++++++-- lib/ui/painting/gradient.cc | 32 ++++++++++++++- lib/ui/painting/gradient.h | 11 +++++ testing/dart/gradient_test.dart | 72 +++++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 testing/dart/gradient_test.dart diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 0adb6f1cae428..562eb56e1ec62 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2310,25 +2310,45 @@ class Gradient extends Shader { /// If `matrix4` is provided, the gradient fill will be transformed by the /// specified 4x4 matrix relative to the local coordinate system. `matrix4` must /// be a column-major matrix packed into a list of 16 values. + /// + /// If `focal` is provided and not equal to `center` and `focalRadius` is + /// provided and not equal to 0.0, the generated shader will be a two point + /// conical radial gradient, with `focal` being the center of the focal + /// circle and `focalRadius` being the radius of that circle. If `focal` is + /// provided and not equal to `center`, at least one of the two offsets must + /// not be equal to [Offset.zero]. Gradient.radial( Offset center, double radius, List colors, [ List colorStops, TileMode tileMode = TileMode.clamp, - Float64List matrix4 + Float64List matrix4, + Offset focal, + double focalRadius = 0.0 ]) : assert(_offsetIsValid(center)), assert(colors != null), assert(tileMode != null), assert(matrix4 == null || _matrix4IsValid(matrix4)), super._() { + focalRadius ??= 0.0; _validateColorStops(colors, colorStops); final Int32List colorsBuffer = _encodeColorList(colors); final Float32List colorStopsBuffer = colorStops == null ? null : new Float32List.fromList(colorStops); - _constructor(); - _initRadial(center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); + + // If focal is null or focal radius is null, this should be treated as a regular radial gradient + // If focal == center and the focal radius is 0.0, it's still a regular radial gradient + if (focal == null || (focal == center && focalRadius == 0.0)) { + _constructor(); + _initRadial(center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); + } else { + assert(center != Offset.zero || focal != Offset.zero); // will result in exception(s) in Skia side + _constructor(); + _initConical(focal.dx, focal.dy, focalRadius, center.dx, center.dy, radius, colorsBuffer, colorStopsBuffer, tileMode.index, matrix4); + } } void _initRadial(double centerX, double centerY, double radius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initRadial'; + void _initConical(double startX, double startY, double startRadius, double endX, double endY, double endRadius, Int32List colors, Float32List colorStops, int tileMode, Float64List matrix4) native 'Gradient_initTwoPointConical'; /// Creates a sweep gradient centered at `center` that starts at `startAngle` /// and ends at `endAngle`. diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 9cbf5a19c5275..71b2669100fa1 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -25,7 +25,8 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Gradient); #define FOR_EACH_BINDING(V) \ V(Gradient, initLinear) \ V(Gradient, initRadial) \ - V(Gradient, initSweep) + V(Gradient, initSweep) \ + V(Gradient, initTwoPointConical) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -109,6 +110,35 @@ void CanvasGradient::initSweep(double center_x, has_matrix ? &sk_matrix : nullptr))); } +void CanvasGradient::initTwoPointConical(double start_x, + double start_y, + double start_radius, + double end_x, + double end_y, + double end_radius, + const tonic::Int32List& colors, + const tonic::Float32List& color_stops, + SkShader::TileMode tile_mode, + const tonic::Float64List& matrix4) { + FXL_DCHECK(colors.num_elements() == color_stops.num_elements() || + color_stops.data() == nullptr); + + static_assert(sizeof(SkColor) == sizeof(int32_t), + "SkColor doesn't use int32_t."); + + SkMatrix sk_matrix; + bool has_matrix = matrix4.data() != nullptr; + if (has_matrix) { + sk_matrix = ToSkMatrix(matrix4); + } + + set_shader(UIDartState::CreateGPUObject(SkGradientShader::MakeTwoPointConical( + SkPoint::Make(start_x, start_y), start_radius, + SkPoint::Make(end_x, end_y), end_radius, + reinterpret_cast(colors.data()), color_stops.data(), + colors.num_elements(), tile_mode, 0, has_matrix ? &sk_matrix : nullptr))); +} + CanvasGradient::CanvasGradient() = default; CanvasGradient::~CanvasGradient() = default; diff --git a/lib/ui/painting/gradient.h b/lib/ui/painting/gradient.h index 178c17fe9b41c..4d8e8ec09191b 100644 --- a/lib/ui/painting/gradient.h +++ b/lib/ui/painting/gradient.h @@ -52,6 +52,17 @@ class CanvasGradient : public Shader { double end_angle, const tonic::Float64List& matrix4); + void initTwoPointConical(double start_x, + double start_y, + double start_radius, + double end_x, + double end_y, + double end_radius, + const tonic::Int32List& colors, + const tonic::Float32List& color_stops, + SkShader::TileMode tile_mode, + const tonic::Float64List& matrix4); + static void RegisterNatives(tonic::DartLibraryNatives* natives); private: diff --git a/testing/dart/gradient_test.dart b/testing/dart/gradient_test.dart new file mode 100644 index 0000000000000..881b70fec558d --- /dev/null +++ b/testing/dart/gradient_test.dart @@ -0,0 +1,72 @@ +// 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:typed_data' show Float64List; +import 'dart:ui'; + +import 'package:test/test.dart'; + +void main() { + test('Gradient.radial with no focal point', () { + expect( + new Gradient.radial( + Offset.zero, + null, + [const Color(0xFFFFFFFF), const Color(0xFFFFFFFF)], + [0.0, 1.0], + TileMode.mirror), + isNotNull, + ); + }); + + // this is just a radial gradient, focal point is discarded. + test('radial center and focal == Offset.zero and focalRadius == 0.0 is ok', + () { + expect( + () => new Gradient.radial( + Offset.zero, + 0.0, + [const Color(0xFFFFFFFF), const Color(0xFFFFFFFF)], + [0.0, 1.0], + TileMode.mirror, + null, + Offset.zero, + 0.0, + ), + isNotNull); + }); + + test('radial center != focal and focalRadius == 0.0 is ok', () { + expect( + () => new Gradient.radial( + Offset.zero, + 0.0, + [const Color(0xFFFFFFFF), const Color(0xFFFFFFFF)], + [0.0, 1.0], + TileMode.mirror, + null, + const Offset(2.0, 2.0), + 0.0, + ), + isNotNull); + }); + + // this would result in div/0 on skia side. + test('radial center and focal == Offset.zero and focalRadius != 0.0 assert', + () { + expect( + () => new Gradient.radial( + Offset.zero, + 0.0, + [const Color(0xFFFFFFFF), const Color(0xFFFFFFFF)], + [0.0, 1.0], + TileMode.mirror, + null, + Offset.zero, + 1.0, + ), + throwsA(const isInstanceOf()), + ); + }); +} From 7e145b111e6e2c2e6a2b9b8a03ddbf3b8263867e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 18 May 2018 10:52:56 -0400 Subject: [PATCH 0370/1190] Roll src/third_party/skia/ 50edafacc..26171e892 (3 commits) (#5303) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DEPS b/DEPS index be3ced14e1393..357fc1e631736 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '50edafacc8ea56bdc13fd2234618fe06094eec0e', + 'skia_revision': '26171e8927008f90c29d55b19a241ad541b40d3d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 6b2d292b43fa3..2fa585b0f3298 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a76aee9370c5d3ff82fa8eb3bd80fb43 +Signature: 1f2b7202c777d9751721005edd1047b5 UNUSED LICENSES: @@ -17542,6 +17542,8 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.ex FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/cross_repo_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/flutter_trybot.json @@ -17559,7 +17561,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Ubuntu14-Clang-GCE-CPU-AVX2-x86_64-Release-All-CT_BENCH_1k_SKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json @@ -17620,10 +17621,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming_client/examples/full.expected/basic.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Override.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json @@ -17649,6 +17647,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-arm64-Release-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-arm64-Release-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-arm64-Release-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Debug-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Debug-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Debug-MSAN.json @@ -17658,6 +17657,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-Fast.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-Mini.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-Vulkan_Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-EMCC-wasm-Release.json From 05a1687cf6439bd9b0c205bea9f8aeb34f0ccdfb Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Fri, 18 May 2018 08:56:34 -0700 Subject: [PATCH 0371/1190] Moving assets-for-api-docs links to point to new asset dir. (#5296) No logic changes, only links in doc comments. --- lib/ui/painting.dart | 86 ++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 562eb56e1ec62..4fad77563ea9e 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -380,7 +380,7 @@ enum BlendMode { /// /// This corresponds to the "clear" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_clear.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_clear.png) clear, /// Drop the destination image, only paint the source image. @@ -390,7 +390,7 @@ enum BlendMode { /// /// This corresponds to the "Copy" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_src.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_src.png) src, /// Drop the source image, only paint the destination image. @@ -400,7 +400,7 @@ enum BlendMode { /// /// This corresponds to the "Destination" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_dst.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_dst.png) dst, /// Composite the source image over the destination image. @@ -412,7 +412,7 @@ enum BlendMode { /// This corresponds to the "Source over Destination" Porter-Duff operator, /// also known as the Painter's Algorithm. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_srcOver.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_srcOver.png) srcOver, /// Composite the source image under the destination image. @@ -421,7 +421,7 @@ enum BlendMode { /// /// This corresponds to the "Destination over Source" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_dstOver.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_dstOver.png) /// /// This is useful when the source image should have been painted before the /// destination image, but could not be. @@ -440,7 +440,7 @@ enum BlendMode { /// /// This corresponds to the "Source in Destination" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_srcIn.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_srcIn.png) srcIn, /// Show the destination image, but only where the two images overlap. The @@ -454,7 +454,7 @@ enum BlendMode { /// /// This corresponds to the "Destination in Source" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_dstIn.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_dstIn.png) dstIn, /// Show the source image, but only where the two images do not overlap. The @@ -468,7 +468,7 @@ enum BlendMode { /// /// This corresponds to the "Source out Destination" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_srcOut.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_srcOut.png) srcOut, /// Show the destination image, but only where the two images do not overlap. The @@ -482,7 +482,7 @@ enum BlendMode { /// /// This corresponds to the "Destination out Source" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_dstOut.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_dstOut.png) dstOut, /// Composite the source image over the destination image, but only where it @@ -497,7 +497,7 @@ enum BlendMode { /// For a variant with the destination on top instead of the source, see /// [dstATop]. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_srcATop.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_srcATop.png) srcATop, /// Composite the destination image over the source image, but only where it @@ -512,7 +512,7 @@ enum BlendMode { /// For a variant with the source on top instead of the destination, see /// [srcATop]. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_dstATop.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_dstATop.png) dstATop, /// Apply a bitwise `xor` operator to the source and destination images. This @@ -520,7 +520,7 @@ enum BlendMode { /// /// This corresponds to the "Source xor Destination" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_xor.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_xor.png) xor, /// Sum the components of the source and destination images. @@ -531,7 +531,7 @@ enum BlendMode { /// /// This corresponds to the "Source plus Destination" Porter-Duff operator. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_plus.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_plus.png) plus, /// Multiply the color components of the source and destination images. @@ -544,7 +544,7 @@ enum BlendMode { /// /// For a variant that also multiplies the alpha channel, consider [multiply]. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_modulate.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_modulate.png) /// /// See also: /// @@ -575,7 +575,7 @@ enum BlendMode { /// This has similar effect to two projectors displaying their images on the /// same screen simultaneously. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_screen.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_screen.png) /// /// See also: /// @@ -599,7 +599,7 @@ enum BlendMode { /// white) is treated as the value 0.0, and values normally treated as 0.0 /// (black, transparent) are treated as 1.0. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_overlay.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_overlay.png) /// /// See also: /// @@ -615,7 +615,7 @@ enum BlendMode { /// The opacity of the output image is computed in the same way as for /// [srcOver]. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_darken.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_darken.png) darken, /// Composite the source and destination image by choosing the highest value @@ -624,7 +624,7 @@ enum BlendMode { /// The opacity of the output image is computed in the same way as for /// [srcOver]. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_lighten.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_lighten.png) lighten, /// Divide the destination by the inverse of the source. @@ -633,7 +633,7 @@ enum BlendMode { /// white) is treated as the value 0.0, and values normally treated as 0.0 /// (black, transparent) are treated as 1.0. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_colorDodge.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_colorDodge.png) colorDodge, /// Divide the inverse of the destination by the the source, and inverse the result. @@ -642,7 +642,7 @@ enum BlendMode { /// white) is treated as the value 0.0, and values normally treated as 0.0 /// (black, transparent) are treated as 1.0. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_colorBurn.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_colorBurn.png) colorBurn, /// Multiply the components of the source and destination images after @@ -657,7 +657,7 @@ enum BlendMode { /// white) is treated as the value 0.0, and values normally treated as 0.0 /// (black, transparent) are treated as 1.0. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_hardLight.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_hardLight.png) /// /// See also: /// @@ -672,7 +672,7 @@ enum BlendMode { /// /// This results in a similar but softer effect than [overlay]. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_softLight.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_softLight.png) /// /// See also: /// @@ -689,7 +689,7 @@ enum BlendMode { /// /// The effect is similar to [exclusion] but harsher. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_difference.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_difference.png) difference, /// Subtract double the product of the two images from the sum of the two @@ -703,7 +703,7 @@ enum BlendMode { /// /// The effect is similar to [difference] but softer. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_exclusion.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_exclusion.png) exclusion, /// Multiply the components of the source and destination images, including @@ -719,7 +719,7 @@ enum BlendMode { /// For a variant that multiplies the colors but does not multiply the alpha /// channel, consider [modulate]. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_multiply.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_multiply.png) multiply, // The last separable mode. /// Take the hue of the source image, and the saturation and luminosity of the @@ -731,7 +731,7 @@ enum BlendMode { /// [srcOver]. Regions that are entirely transparent in the source image take /// their hue from the destination. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_hue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_hue.png) /// /// See also: /// @@ -748,7 +748,7 @@ enum BlendMode { /// [srcOver]. Regions that are entirely transparent in the source image take /// their saturation from the destination. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_hue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_hue.png) /// /// See also: /// @@ -766,7 +766,7 @@ enum BlendMode { /// [srcOver]. Regions that are entirely transparent in the source image take /// their hue and saturation from the destination. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_color.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_color.png) /// /// See also: /// @@ -782,7 +782,7 @@ enum BlendMode { /// [srcOver]. Regions that are entirely transparent in the source image take /// their luminosity from the destination. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/blend_mode_luminosity.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/blend_mode_luminosity.png) /// /// See also: /// @@ -2184,7 +2184,7 @@ enum TileMode { /// The gradient will paint the all the regions outside the inner area with /// the color of the point closest to that region. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_clamp_radial.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_clamp_radial.png) clamp, /// Edge is repeated from first color to last. @@ -2193,8 +2193,8 @@ enum TileMode { /// to 2.0, 2.0 to 3.0, and so forth (and for linear gradients, similarly from /// -1.0 to 0.0, -2.0 to -1.0, etc). /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_linear.png) - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_radial.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_repeated_linear.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_repeated_radial.png) repeated, /// Edge is mirrored from last color to first. @@ -2204,8 +2204,8 @@ enum TileMode { /// 4.0 to 3.0, and so forth (and for linear gradients, similarly from in the /// negative direction). /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_linear.png) - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_radial.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_mirror_linear.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_mirror_radial.png) mirror, } @@ -2261,9 +2261,9 @@ class Gradient extends Shader { /// The behavior before `from` and after `to` is described by the `tileMode` /// argument. For details, see the [TileMode] enum. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_clamp_linear.png) - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_linear.png) - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_linear.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_clamp_linear.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_mirror_linear.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_repeated_linear.png) /// /// If `from`, `to`, `colors`, or `tileMode` are null, or if `colors` or /// `colorStops` contain null values, this constructor will throw a @@ -2299,9 +2299,9 @@ class Gradient extends Shader { /// The behavior before and after the radius is described by the `tileMode` /// argument. For details, see the [TileMode] enum. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_clamp_radial.png) - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_radial.png) - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_radial.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_clamp_radial.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_mirror_radial.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_repeated_radial.png) /// /// If `center`, `radius`, `colors`, or `tileMode` are null, or if `colors` or /// `colorStops` contain null values, this constructor will throw a @@ -2365,9 +2365,9 @@ class Gradient extends Shader { /// The behavior before `startAngle` and after `endAngle` is described by the /// `tileMode` argument. For details, see the [TileMode] enum. /// - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_clamp_sweep.png) - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_mirror_sweep.png) - /// ![](https://flutter.github.io/assets-for-api-docs/dart-ui/tile_mode_repeated_sweep.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_clamp_sweep.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_mirror_sweep.png) + /// ![](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/tile_mode_repeated_sweep.png) /// /// If `center`, `colors`, `tileMode`, `startAngle`, or `endAngle` are null, /// or if `colors` or `colorStops` contain null values, this constructor will From eacf06793c47d26c866a918b5339f1373a069edf Mon Sep 17 00:00:00 2001 From: liyuqian Date: Fri, 18 May 2018 10:32:56 -0700 Subject: [PATCH 0372/1190] Add debug asserts to using SkVertices::Builder (#5292) Fixes flutter/flutter#9226 --- lib/ui/painting/vertices.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/ui/painting/vertices.cc b/lib/ui/painting/vertices.cc index 0ad5144251daf..24b1577a349a6 100644 --- a/lib/ui/painting/vertices.cc +++ b/lib/ui/painting/vertices.cc @@ -60,12 +60,23 @@ void Vertices::init(SkVertices::VertexMode vertex_mode, SkVertices::Builder builder(vertex_mode, positions.num_elements() / 2, indices.num_elements(), builderFlags); + + // positions are required for SkVertices::Builder + FXL_DCHECK(positions.data()); if (positions.data()) DecodePoints(positions, builder.positions()); - if (texture_coordinates.data()) + + if (texture_coordinates.data()) { + // SkVertices::Builder assumes equal numbers of elements + FXL_DCHECK(positions.num_elements() == texture_coordinates.num_elements()); DecodePoints(texture_coordinates, builder.texCoords()); - if (colors.data()) + } + if (colors.data()) { + // SkVertices::Builder assumes equal numbers of elements + FXL_DCHECK(positions.num_elements() == colors.num_elements()); DecodeInts(colors, builder.colors()); + } + if (indices.data()) DecodeInts(indices, builder.indices()); From 34ffb6adfb2604fcd9c1bd92cc81ddac2834050d Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 18 May 2018 14:22:55 -0400 Subject: [PATCH 0373/1190] Roll src/third_party/skia/ 26171e892..ec79c39a7 (12 commits) (#5304) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 100 +------------------- 2 files changed, 5 insertions(+), 97 deletions(-) diff --git a/DEPS b/DEPS index 357fc1e631736..a55da5ea0feda 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '26171e8927008f90c29d55b19a241ad541b40d3d', + 'skia_revision': 'ec79c39a770205910f0abd762de7e19a96c986ca', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 2fa585b0f3298..e0daae72f698e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1f2b7202c777d9751721005edd1047b5 +Signature: 9817e009c5ff392b28f44dd250af7e21 UNUSED LICENSES: @@ -17504,13 +17504,11 @@ FILE: ../../../third_party/skia/infra/bots/perf_skia_bundled.isolate FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_API26.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Chromebook_GLES.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm64-Release-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Chromebook_GLES.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SafeStack.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json @@ -17533,21 +17531,17 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.ex FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Debug-GDI.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-MSVC-x86_64-Debug.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Test-Ubuntu14-Clang-GCE-CPU-AVX2-x86_64-Debug-All-CT_DM_10k_SKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Win-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/cross_repo_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision_trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json @@ -17555,8 +17549,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expec FILE: ../../../third_party/skia/infra/bots/recipe_modules/env/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json @@ -17565,22 +17557,17 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-Coverage.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SafeStack.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_ProcDump.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Win10-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-iOS-Clang-iPadPro-GPU-GT7800-arm64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed_golo.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed_once.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/exceptions.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/failed_read_version.json @@ -17619,17 +17606,8 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/swarming_timeout_old.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming_client/examples/full.expected/basic.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Override.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Perf-Ubuntu14-GCC-GCE-CPU-AVX2-x86_64-Release-All-CT_BENCH_1k_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Upload-Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/win_test.json FILE: ../../../third_party/skia/infra/bots/recipes/android_compile.expected/android_compile_nontrybot.json FILE: ../../../third_party/skia/infra/bots/recipes/android_compile.expected/android_compile_trybot.json @@ -17643,43 +17621,11 @@ FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/percommit_ FILE: ../../../third_party/skia/infra/bots/recipes/calmbench.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/calmbench.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/check_generated_files.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-arm-Release-Chromebook_GLES.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-arm64-Release-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-arm64-Release-Android_ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-arm64-Release-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Debug-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Debug-Coverage.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Debug-MSAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Debug.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-Chromebook_GLES.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-Fast.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-Mini.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-Vulkan_Coverage.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-EMCC-wasm-Release.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-arm-Release-Chromecast.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86-Debug.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Debug-NoGPU.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Shared.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-arm64-Debug-iOS.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x64-Release-iOS.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x86_64-Release.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-arm64-Release-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug-Exceptions.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Debug-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86_64-Release-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/alternate_repo.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_100k_SKPs.json @@ -17699,41 +17645,23 @@ FILE: ../../../third_party/skia/infra/bots/recipes/housekeeper.expected/Housekee FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/failed_all_updates.json FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/failed_one_update.json FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/infra_tests.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-GCC-Chorizo-GPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-MoltenVK_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Release-All-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Release-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Release-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Release-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win2016-MSVC-GCE-CPU-AVX2-x86_64-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win2016-MSVC-GCE-CPU-AVX2-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-iOS-Clang-iPadPro-GPU-GT7800-arm64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/cpu_scale_failed.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/cpu_scale_failed_golo.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/cpu_scale_failed_once.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/failed_push.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/Housekeeper-Weekly-RecreateSKPs.json @@ -17746,22 +17674,13 @@ FILE: ../../../third_party/skia/infra/bots/recipes/skqp_test.expected/Test-Debia FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS7_G930A-GPU-Adreno530-arm64-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-CPU-Snapdragon808-arm-Release-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm-Debug-All-Android_ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL1_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel2XL-GPU-Adreno540-arm64-Debug-All-Android_DDL3_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-GCC-Chorizo-GPU-Cortex_A7-arm-Release-All.json @@ -17773,13 +17692,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Release-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUCDE3815TYKHE-GPU-IntelBayTrail-x86_64-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Release-All-NativeFonts.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookAir7.2-GPU-IntelHD6000-x86_64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-MoltenVK_Vulkan.json @@ -17790,23 +17704,17 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-C FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Vulkan_Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_PreAbandonGpuContext_SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-ReleaseAndAbandonGpuContext.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC5i7RYH-CPU-AVX2-x86_64-Debug-All-NativeFonts.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC5i7RYH-CPU-AVX2-x86_64-Debug-All-NativeFonts_GDI.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Release-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ShuttleA-GPU-GTX660-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Debug-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ZBOX-GPU-GTX1070-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ZBOX-GPU-GTX1070-x86_64-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FAAA.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FDAA.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FSAA.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win8-Clang-Golo-CPU-AVX-x86-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-iOS-Clang-iPadPro-GPU-GT7800-arm64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_dm.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_get_hashes.json From 299a7c2502e94efe40c5a2a18b54467a55086842 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 11:56:37 -0700 Subject: [PATCH 0374/1190] Remove support for reading FLX archives from engine. (#5305) The embedders have moved on already. This also removes a //garnet dependency on zlib wrappers. --- assets/BUILD.gn | 7 -- assets/asset_manager.cc | 1 - assets/zip_asset_store.cc | 124 ------------------------ assets/zip_asset_store.h | 51 ---------- shell/common/run_configuration.cc | 4 - travis/licenses_golden/licenses_flutter | 2 - 6 files changed, 189 deletions(-) delete mode 100644 assets/zip_asset_store.cc delete mode 100644 assets/zip_asset_store.h diff --git a/assets/BUILD.gn b/assets/BUILD.gn index 28d7e569659f1..7247a2f3d00fc 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -9,8 +9,6 @@ source_set("assets") { "asset_resolver.h", "directory_asset_bundle.cc", "directory_asset_bundle.h", - "zip_asset_store.cc", - "zip_asset_store.h", ] deps = [ @@ -18,11 +16,6 @@ source_set("assets") { "$flutter_root/fml", "$flutter_root/glue", "//garnet/public/lib/fxl", - "//garnet/public/lib/zip", - ] - - public_deps = [ - "//third_party/zlib:minizip", ] public_configs = [ "$flutter_root:config" ] diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc index fcbe71b11a9ff..cdbe007a5ad0f 100644 --- a/assets/asset_manager.cc +++ b/assets/asset_manager.cc @@ -5,7 +5,6 @@ #include "flutter/assets/asset_manager.h" #include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/zip_asset_store.h" #include "flutter/glue/trace_event.h" #include "lib/fxl/files/path.h" diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc deleted file mode 100644 index 1b9216bd34530..0000000000000 --- a/assets/zip_asset_store.cc +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/assets/zip_asset_store.h" -#include "lib/fxl/build_config.h" - -#include - -#if !defined(OS_WIN) -#include -#endif - -#include -#include - -#include "flutter/glue/trace_event.h" - -namespace blink { - -ZipAssetStore::ZipAssetStore(std::string file_path) - : file_path_(std::move(file_path)) { - BuildStatCache(); -} - -ZipAssetStore::~ZipAssetStore() = default; - -zip::UniqueUnzipper ZipAssetStore::CreateUnzipper() const { - return zip::UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)}; -} - -// |blink::AssetResolver| -bool ZipAssetStore::IsValid() const { - return stat_cache_.size() > 0; -} - -// |blink::AssetResolver| -bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { - TRACE_EVENT0("flutter", "ZipAssetStore::GetAsBuffer"); - auto found = stat_cache_.find(asset_name); - - if (found == stat_cache_.end()) { - return false; - } - - auto unzipper = CreateUnzipper(); - - if (!unzipper.is_valid()) { - return false; - } - - int result = UNZ_OK; - - result = unzGoToFilePos(unzipper.get(), &(found->second.file_pos)); - if (result != UNZ_OK) { - FXL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result; - return false; - } - - result = unzOpenCurrentFile(unzipper.get()); - if (result != UNZ_OK) { - FXL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result; - return false; - } - - data->resize(found->second.uncompressed_size); - int total_read = 0; - while (total_read < static_cast(data->size())) { - int bytes_read = unzReadCurrentFile( - unzipper.get(), data->data() + total_read, data->size() - total_read); - if (bytes_read <= 0) { - return false; - } - total_read += bytes_read; - } - - return true; -} - -void ZipAssetStore::BuildStatCache() { - TRACE_EVENT0("flutter", "ZipAssetStore::BuildStatCache"); - - auto unzipper = CreateUnzipper(); - - if (!unzipper.is_valid()) { - return; - } - - if (unzGoToFirstFile(unzipper.get()) != UNZ_OK) { - return; - } - - do { - int result = UNZ_OK; - - // Get the current file name. - unz_file_info file_info = {}; - char file_name[255]; - result = unzGetCurrentFileInfo(unzipper.get(), &file_info, file_name, - sizeof(file_name), nullptr, 0, nullptr, 0); - if (result != UNZ_OK) { - continue; - } - - if (file_info.uncompressed_size == 0) { - continue; - } - - // Get the current file position. - unz_file_pos file_pos = {}; - result = unzGetFilePos(unzipper.get(), &file_pos); - if (result != UNZ_OK) { - continue; - } - - std::string file_name_key(file_name, file_info.size_filename); - CacheEntry entry(file_pos, file_info.uncompressed_size); - stat_cache_.emplace(std::move(file_name_key), std::move(entry)); - - } while (unzGoToNextFile(unzipper.get()) == UNZ_OK); -} - -} // namespace blink diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h deleted file mode 100644 index 558678e25bc08..0000000000000 --- a/assets/zip_asset_store.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ -#define FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ - -#include - -#include "flutter/assets/asset_resolver.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" -#include "lib/zip/unique_unzipper.h" -#include "third_party/zlib/contrib/minizip/unzip.h" - -namespace blink { - -class ZipAssetStore final : public AssetResolver { - public: - ZipAssetStore(std::string file_path); - - ~ZipAssetStore() override; - - private: - struct CacheEntry { - unz_file_pos file_pos; - size_t uncompressed_size; - CacheEntry(unz_file_pos p_file_pos, size_t p_uncompressed_size) - : file_pos(p_file_pos), uncompressed_size(p_uncompressed_size) {} - }; - - std::string file_path_; - mutable std::map stat_cache_; - - // |blink::AssetResolver| - bool IsValid() const override; - - // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; - - void BuildStatCache(); - - zip::UniqueUnzipper CreateUnzipper() const; - - FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); -}; - -} // namespace blink - -#endif // FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ diff --git a/shell/common/run_configuration.cc b/shell/common/run_configuration.cc index 7fb385fb4d9dc..8a2080ed79999 100644 --- a/shell/common/run_configuration.cc +++ b/shell/common/run_configuration.cc @@ -7,7 +7,6 @@ #include #include "flutter/assets/directory_asset_bundle.h" -#include "flutter/assets/zip_asset_store.h" #include "flutter/fml/file.h" #include "flutter/runtime/dart_vm.h" @@ -24,9 +23,6 @@ RunConfiguration RunConfiguration::InferFromSettings( std::make_unique(fml::OpenFile( settings.assets_path.c_str(), fml::OpenPermission::kRead, true))); - asset_manager->PushBack( - std::make_unique(settings.flx_path)); - return {IsolateConfiguration::InferFromSettings(settings, asset_manager), asset_manager}; } diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 53d6bdc4ce7f8..f44f0cf209419 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -322,8 +322,6 @@ ORIGIN: ../../../flutter/assets/directory_asset_bundle.cc + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/assets/directory_asset_bundle.cc FILE: ../../../flutter/assets/directory_asset_bundle.h -FILE: ../../../flutter/assets/zip_asset_store.cc -FILE: ../../../flutter/assets/zip_asset_store.h FILE: ../../../flutter/common/settings.cc FILE: ../../../flutter/common/settings.h FILE: ../../../flutter/flow/export_node.cc From f922442d58cf45518f2749eabf165236c77bbb12 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 12:09:14 -0700 Subject: [PATCH 0375/1190] Disable SVG canvas and friends. (#5306) --- tools/gn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/gn b/tools/gn index b4b15f99f1d4f..430dfffd6306a 100755 --- a/tools/gn +++ b/tools/gn @@ -69,7 +69,9 @@ def to_gn_args(args): # Skia GN args. gn_args['skia_enable_flutter_defines'] = True # Enable Flutter API guards in Skia. gn_args['skia_use_dng_sdk'] = False # RAW image handling. - gn_args['skia_use_sfntly'] = False # PDF handling. + gn_args['skia_use_sfntly'] = False # PDF handling depedency. + gn_args['skia_enable_pdf'] = False # PDF handling. + gn_args['skia_use_expat'] = False # XML handling (for SVG and friends). gn_args['skia_use_fontconfig'] = False # Use the custom font manager instead. gn_args['is_official_build'] = True # Disable Skia test utilities. From 278cdaeee91f18dc893bfdb89051814f2c37fd0b Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 12:33:19 -0700 Subject: [PATCH 0376/1190] Remove unused defines and update buildroot. (#5307) --- DEPS | 2 +- common/config.gni | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/DEPS b/DEPS index a55da5ea0feda..3e30dc1fb95b9 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '78cf6d88d1a8b6f8293649508f2c1db6ad385fb0', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'e2b647d54ab988569411517fac2e1aa28eeb4f46', # Fuchsia compatibility # diff --git a/common/config.gni b/common/config.gni index 0f50113027a3b..0c251878416bc 100644 --- a/common/config.gni +++ b/common/config.gni @@ -11,9 +11,6 @@ if (target_cpu == "arm" || target_cpu == "arm64") { } declare_args() { - # Enable asserts, even in release builds. - flutter_asserts_always_on = false - # Enable ahead-of-time compilation on platforms where AOT is optional. flutter_aot = false @@ -39,21 +36,6 @@ if (flutter_runtime_mode == "debug") { feature_defines_list += [ "FLUTTER_RUNTIME_MODE=0" ] } -if (is_debug) { - # TODO(GYP) this should also be set when release_valgrind_build is set, - # but we don't have that flag in the GN build yet. - feature_defines_list += [ "WTF_USE_DYNAMIC_ANNOTATIONS=1" ] -} - -if (!is_mac) { - # Mac OS X has not implemented support for ENABLE(OPENTYPE_VERTICAL) yet. - feature_defines_list += [ "ENABLE_OPENTYPE_VERTICAL=1" ] -} - -if (flutter_asserts_always_on) { - feature_defines_list += [ "ENABLE_ASSERT=1" ] -} - if (flutter_aot) { feature_defines_list += [ "FLUTTER_AOT=1" ] } From fe7cad4199cfd59974b3cd6bc9eeed91bb583947 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 12:55:20 -0700 Subject: [PATCH 0377/1190] Temporarily use expat on Android because the Android font manager depends on the same. (#5308) --- tools/gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gn b/tools/gn index 430dfffd6306a..74bc55bc9b40a 100755 --- a/tools/gn +++ b/tools/gn @@ -71,7 +71,7 @@ def to_gn_args(args): gn_args['skia_use_dng_sdk'] = False # RAW image handling. gn_args['skia_use_sfntly'] = False # PDF handling depedency. gn_args['skia_enable_pdf'] = False # PDF handling. - gn_args['skia_use_expat'] = False # XML handling (for SVG and friends). + gn_args['skia_use_expat'] = args.target_os == 'android' gn_args['skia_use_fontconfig'] = False # Use the custom font manager instead. gn_args['is_official_build'] = True # Disable Skia test utilities. From 088e1c00ada7f767b103c61a0d368704b70b1c50 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 18 May 2018 17:52:19 -0400 Subject: [PATCH 0378/1190] Roll src/third_party/skia/ ec79c39a7..ba5b5f517 (7 commits) (#5309) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3e30dc1fb95b9..8a839f697ed31 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ec79c39a770205910f0abd762de7e19a96c986ca', + 'skia_revision': 'ba5b5f5171680701d27c68f13e378eb5d539ae07', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e0daae72f698e..d330731712700 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9817e009c5ff392b28f44dd250af7e21 +Signature: 57045b2e98d7ae56317ce4fd35cc9778 UNUSED LICENSES: From fbf07dc332e54f5678c7e09e7572e85fa328816f Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 15:43:49 -0700 Subject: [PATCH 0379/1190] Import logging utilities from FXL. (#5310) --- fml/BUILD.gn | 17 ++- fml/export.h | 16 +++ fml/icu_util.cc | 4 +- fml/log_level.h | 28 +++++ fml/log_settings.cc | 37 +++++++ fml/log_settings.h | 40 +++++++ fml/log_settings_state.cc | 14 +++ fml/logging.cc | 104 +++++++++++++++++++ fml/logging.h | 95 +++++++++++++++++ fml/memory/ref_counted_internal.h | 20 ++-- fml/memory/ref_ptr.h | 8 +- fml/memory/thread_checker.h | 4 +- fml/memory/weak_ptr.h | 8 +- fml/memory/weak_ptr_internal.cc | 6 +- fml/memory/weak_ptr_internal.h | 2 +- fml/message_loop.cc | 6 +- fml/message_loop_impl.cc | 11 +- fml/platform/android/jni_util.cc | 14 +-- fml/platform/android/jni_weak_ref.cc | 9 +- fml/platform/android/message_loop_android.cc | 12 +-- fml/platform/android/scoped_java_ref.cc | 14 +-- fml/platform/darwin/message_loop_darwin.mm | 8 +- fml/platform/linux/message_loop_linux.cc | 10 +- fml/platform/win/message_loop_win.cc | 6 +- fml/task_runner.cc | 5 +- fml/thread_local.h | 10 +- fml/thread_local_unittests.cc | 1 + fml/unique_object.h | 4 +- travis/licenses_golden/licenses_flutter | 43 +++++++- 29 files changed, 472 insertions(+), 84 deletions(-) create mode 100644 fml/export.h create mode 100644 fml/log_level.h create mode 100644 fml/log_settings.cc create mode 100644 fml/log_settings.h create mode 100644 fml/log_settings_state.cc create mode 100644 fml/logging.cc create mode 100644 fml/logging.h diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 5295af35ae27a..dfbd2e0e83a90 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -7,19 +7,26 @@ source_set("fml") { "build_config.h", "compiler_specific.h", "eintr_wrapper.h", + "export.h", "file.h", "icu_util.cc", "icu_util.h", + "log_level.h", + "log_settings.cc", + "log_settings.h", + "log_settings_state.cc", + "logging.cc", + "logging.h", "mapping.cc", "mapping.h", - "memory/thread_checker.h", - "memory/weak_ptr.h", - "memory/weak_ptr_internal.cc", - "memory/weak_ptr_internal.h", "memory/ref_counted.h", "memory/ref_counted_internal.h", "memory/ref_ptr.h", "memory/ref_ptr_internal.h", + "memory/thread_checker.h", + "memory/weak_ptr.h", + "memory/weak_ptr_internal.cc", + "memory/weak_ptr_internal.h", "message_loop.cc", "message_loop.h", "message_loop_impl.cc", @@ -136,8 +143,8 @@ executable("fml_unittests") { testonly = true sources = [ - "memory/weak_ptr_unittest.cc", "memory/ref_counted_unittest.cc", + "memory/weak_ptr_unittest.cc", "message_loop_unittests.cc", "thread_local_unittests.cc", "thread_unittests.cc", diff --git a/fml/export.h b/fml/export.h new file mode 100644 index 0000000000000..6173bbb71c314 --- /dev/null +++ b/fml/export.h @@ -0,0 +1,16 @@ +// Copyright 2017 The Fuchsia 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_EXPORT_H_ +#define FLUTTER_FML_EXPORT_H_ + +#include "flutter/fml/build_config.h" + +#if OS_WIN +#define FML_EXPORT __declspec(dllimport) +#else +#define FML_EXPORT __attribute__((visibility("default"))) +#endif + +#endif // FLUTTER_FML_EXPORT_H_ diff --git a/fml/icu_util.cc b/fml/icu_util.cc index 88ae64034a5c2..98da2880ab07f 100644 --- a/fml/icu_util.cc +++ b/fml/icu_util.cc @@ -8,9 +8,9 @@ #include #include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" #include "flutter/fml/mapping.h" #include "flutter/fml/paths.h" -#include "lib/fxl/logging.h" #include "third_party/icu/source/common/unicode/udata.h" namespace fml { @@ -92,7 +92,7 @@ class ICUContext { void InitializeICUOnce(const std::string& icu_data_path) { static ICUContext* context = new ICUContext(icu_data_path); - FXL_CHECK(context->IsValid()) + FML_CHECK(context->IsValid()) << "Must be able to initialize the ICU context. Tried: " << icu_data_path; } diff --git a/fml/log_level.h b/fml/log_level.h new file mode 100644 index 0000000000000..737e80db2ff68 --- /dev/null +++ b/fml/log_level.h @@ -0,0 +1,28 @@ +// Copyright 2016 The Fuchsia 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_LOG_LEVEL_H_ +#define FLUTTER_FML_LOG_LEVEL_H_ + +namespace fml { + +typedef int LogSeverity; + +// Default log levels. Negative values can be used for verbose log levels. +constexpr LogSeverity LOG_INFO = 0; +constexpr LogSeverity LOG_WARNING = 1; +constexpr LogSeverity LOG_ERROR = 2; +constexpr LogSeverity LOG_FATAL = 3; +constexpr LogSeverity LOG_NUM_SEVERITIES = 4; + +// LOG_DFATAL is LOG_FATAL in debug mode, ERROR in normal mode +#ifdef NDEBUG +const LogSeverity LOG_DFATAL = LOG_ERROR; +#else +const LogSeverity LOG_DFATAL = LOG_FATAL; +#endif + +} // namespace fml + +#endif // FLUTTER_FML_LOG_LEVEL_H_ diff --git a/fml/log_settings.cc b/fml/log_settings.cc new file mode 100644 index 0000000000000..80d0e22fc99d6 --- /dev/null +++ b/fml/log_settings.cc @@ -0,0 +1,37 @@ +// Copyright 2016 The Fuchsia 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/log_settings.h" + +#include +#include + +#include +#include + +#include "flutter/fml/logging.h" + +namespace fml { +namespace state { + +// Defined in log_settings_state.cc. +extern LogSettings g_log_settings; + +} // namespace state + +void SetLogSettings(const LogSettings& settings) { + // Validate the new settings as we set them. + state::g_log_settings.min_log_level = + std::min(LOG_FATAL, settings.min_log_level); +} + +LogSettings GetLogSettings() { + return state::g_log_settings; +} + +int GetMinLogLevel() { + return std::min(state::g_log_settings.min_log_level, LOG_FATAL); +} + +} // namespace fml diff --git a/fml/log_settings.h b/fml/log_settings.h new file mode 100644 index 0000000000000..ea3381dfbcabb --- /dev/null +++ b/fml/log_settings.h @@ -0,0 +1,40 @@ +// Copyright 2016 The Fuchsia 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_LOG_SETTINGS_H_ +#define FLUTTER_FML_LOG_SETTINGS_H_ + +#include "flutter/fml/log_level.h" + +#include + +namespace fml { + +// Settings which control the behavior of FML logging. +struct LogSettings { + // The minimum logging level. + // Anything at or above this level will be logged (if applicable). + // Anything below this level will be silently ignored. + // + // The log level defaults to 0 (LOG_INFO). + // + // Log messages for FML_VLOG(x) (from flutter/fml/logging.h) are logged + // at level -x, so setting the min log level to negative values enables + // verbose logging. + LogSeverity min_log_level = LOG_INFO; +}; + +// Gets the active log settings for the current process. +void SetLogSettings(const LogSettings& settings); + +// Sets the active log settings for the current process. +LogSettings GetLogSettings(); + +// Gets the minimum log level for the current process. Never returs a value +// higher than LOG_FATAL. +int GetMinLogLevel(); + +} // namespace fml + +#endif // FLUTTER_FML_LOG_SETTINGS_H_ diff --git a/fml/log_settings_state.cc b/fml/log_settings_state.cc new file mode 100644 index 0000000000000..148c0a43e877b --- /dev/null +++ b/fml/log_settings_state.cc @@ -0,0 +1,14 @@ +// Copyright 2016 The Fuchsia 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/log_settings.h" + +namespace fml { +namespace state { + +// Declared in log_settings.cc. +LogSettings g_log_settings; + +} // namespace state +} // namespace fml diff --git a/fml/logging.cc b/fml/logging.cc new file mode 100644 index 0000000000000..7503c8e700409 --- /dev/null +++ b/fml/logging.cc @@ -0,0 +1,104 @@ +// Copyright 2016 The Fuchsia 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 +#include + +#include "flutter/fml/build_config.h" +#include "flutter/fml/log_settings.h" +#include "flutter/fml/logging.h" + +#if defined(OS_ANDROID) +#include +#elif defined(OS_IOS) +#include +#endif + +namespace fml { +namespace { + +const char* const kLogSeverityNames[LOG_NUM_SEVERITIES] = {"INFO", "WARNING", + "ERROR", "FATAL"}; + +const char* GetNameForLogSeverity(LogSeverity severity) { + if (severity >= LOG_INFO && severity < LOG_NUM_SEVERITIES) + return kLogSeverityNames[severity]; + return "UNKNOWN"; +} + +const char* StripDots(const char* path) { + while (strncmp(path, "../", 3) == 0) + path += 3; + return path; +} + +const char* StripPath(const char* path) { + auto p = strrchr(path, '/'); + if (p) + return p + 1; + else + return path; +} + +} // namespace + +LogMessage::LogMessage(LogSeverity severity, + const char* file, + int line, + const char* condition) + : severity_(severity), file_(file), line_(line) { + stream_ << "["; + if (severity >= LOG_INFO) + stream_ << GetNameForLogSeverity(severity); + else + stream_ << "VERBOSE" << -severity; + stream_ << ":" << (severity > LOG_INFO ? StripDots(file_) : StripPath(file_)) + << "(" << line_ << ")] "; + + if (condition) + stream_ << "Check failed: " << condition << ". "; +} + +LogMessage::~LogMessage() { + stream_ << std::endl; + +#if defined(OS_ANDROID) + android_LogPriority priority = + (severity_ < 0) ? ANDROID_LOG_VERBOSE : ANDROID_LOG_UNKNOWN; + switch (severity_) { + case LOG_INFO: + priority = ANDROID_LOG_INFO; + break; + case LOG_WARNING: + priority = ANDROID_LOG_WARN; + break; + case LOG_ERROR: + priority = ANDROID_LOG_ERROR; + break; + case LOG_FATAL: + priority = ANDROID_LOG_FATAL; + break; + } + __android_log_write(priority, "flutter", stream_.str().c_str()); +#elif defined(OS_IOS) + syslog(LOG_ALERT, "%s", stream_.str().c_str()); +#else + std::cerr << stream_.str(); + std::cerr.flush(); +#endif + + if (severity_ >= LOG_FATAL) { + abort(); + } +} + +int GetVlogVerbosity() { + return std::max(-1, LOG_INFO - GetMinLogLevel()); +} + +bool ShouldCreateLogMessage(LogSeverity severity) { + return severity >= GetMinLogLevel(); +} + +} // namespace fml diff --git a/fml/logging.h b/fml/logging.h new file mode 100644 index 0000000000000..178f9b91c0129 --- /dev/null +++ b/fml/logging.h @@ -0,0 +1,95 @@ +// Copyright 2016 The Fuchsia 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_LOGGING_H_ +#define FLUTTER_FML_LOGGING_H_ + +#include + +#include "flutter/fml/log_level.h" +#include "flutter/fml/macros.h" + +namespace fml { + +class LogMessageVoidify { + public: + void operator&(std::ostream&) {} +}; + +class LogMessage { + public: + LogMessage(LogSeverity severity, + const char* file, + int line, + const char* condition); + ~LogMessage(); + + std::ostream& stream() { return stream_; } + + private: + std::ostringstream stream_; + const LogSeverity severity_; + const char* file_; + const int line_; + + FML_DISALLOW_COPY_AND_ASSIGN(LogMessage); +}; + +// Gets the FML_VLOG default verbosity level. +int GetVlogVerbosity(); + +// Returns true if |severity| is at or above the current minimum log level. +// LOG_FATAL and above is always true. +bool ShouldCreateLogMessage(LogSeverity severity); + +} // namespace fml + +#define FML_LOG_STREAM(severity) \ + ::fml::LogMessage(::fml::LOG_##severity, __FILE__, __LINE__, nullptr).stream() + +#define FML_LAZY_STREAM(stream, condition) \ + !(condition) ? (void)0 : ::fml::LogMessageVoidify() & (stream) + +#define FML_EAT_STREAM_PARAMETERS(ignored) \ + true || (ignored) \ + ? (void)0 \ + : ::fml::LogMessageVoidify() & \ + ::fml::LogMessage(::fml::LOG_FATAL, 0, 0, nullptr).stream() + +#define FML_LOG_IS_ON(severity) \ + (::fml::ShouldCreateLogMessage(::fml::LOG_##severity)) + +#define FML_LOG(severity) \ + FML_LAZY_STREAM(FML_LOG_STREAM(severity), FML_LOG_IS_ON(severity)) + +#define FML_CHECK(condition) \ + FML_LAZY_STREAM( \ + ::fml::LogMessage(::fml::LOG_FATAL, __FILE__, __LINE__, #condition) \ + .stream(), \ + !(condition)) + +#define FML_VLOG_IS_ON(verbose_level) \ + ((verbose_level) <= ::fml::GetVlogVerbosity()) + +// The VLOG macros log with negative verbosities. +#define FML_VLOG_STREAM(verbose_level) \ + ::fml::LogMessage(-verbose_level, __FILE__, __LINE__, nullptr).stream() + +#define FML_VLOG(verbose_level) \ + FML_LAZY_STREAM(FML_VLOG_STREAM(verbose_level), FML_VLOG_IS_ON(verbose_level)) + +#ifndef NDEBUG +#define FML_DLOG(severity) FML_LOG(severity) +#define FML_DCHECK(condition) FML_CHECK(condition) +#else +#define FML_DLOG(severity) FML_EAT_STREAM_PARAMETERS(true) +#define FML_DCHECK(condition) FML_EAT_STREAM_PARAMETERS(condition) +#endif + +#define FML_NOTREACHED() FML_DCHECK(false) + +#define FML_NOTIMPLEMENTED() \ + FML_LOG(ERROR) << "Not implemented in: " << __PRETTY_FUNCTION__ + +#endif // FLUTTER_FML_LOGGING_H_ diff --git a/fml/memory/ref_counted_internal.h b/fml/memory/ref_counted_internal.h index bbe037d47c427..2cef256b3442c 100644 --- a/fml/memory/ref_counted_internal.h +++ b/fml/memory/ref_counted_internal.h @@ -9,8 +9,8 @@ #include +#include "flutter/fml/logging.h" #include "flutter/fml/macros.h" -#include "lib/fxl/logging.h" namespace fml { namespace internal { @@ -20,8 +20,8 @@ class RefCountedThreadSafeBase { public: void AddRef() const { #ifndef NDEBUG - FXL_DCHECK(!adoption_required_); - FXL_DCHECK(!destruction_started_); + FML_DCHECK(!adoption_required_); + FML_DCHECK(!destruction_started_); #endif ref_count_.fetch_add(1u, std::memory_order_relaxed); } @@ -30,7 +30,7 @@ class RefCountedThreadSafeBase { return ref_count_.load(std::memory_order_acquire) == 1u; } - void AssertHasOneRef() const { FXL_DCHECK(HasOneRef()); } + void AssertHasOneRef() const { FML_DCHECK(HasOneRef()); } protected: RefCountedThreadSafeBase(); @@ -39,10 +39,10 @@ class RefCountedThreadSafeBase { // Returns true if the object should self-delete. bool Release() const { #ifndef NDEBUG - FXL_DCHECK(!adoption_required_); - FXL_DCHECK(!destruction_started_); + FML_DCHECK(!adoption_required_); + FML_DCHECK(!destruction_started_); #endif - FXL_DCHECK(ref_count_.load(std::memory_order_acquire) != 0u); + FML_DCHECK(ref_count_.load(std::memory_order_acquire) != 0u); // TODO(vtl): We could add the following: // if (ref_count_.load(std::memory_order_relaxed) == 1u) { // #ifndef NDEBUG @@ -67,7 +67,7 @@ class RefCountedThreadSafeBase { #ifndef NDEBUG void Adopt() { - FXL_DCHECK(adoption_required_); + FML_DCHECK(adoption_required_); adoption_required_ = false; } #endif @@ -95,9 +95,9 @@ inline RefCountedThreadSafeBase::RefCountedThreadSafeBase() inline RefCountedThreadSafeBase::~RefCountedThreadSafeBase() { #ifndef NDEBUG - FXL_DCHECK(!adoption_required_); + FML_DCHECK(!adoption_required_); // Should only be destroyed as a result of |Release()|. - FXL_DCHECK(destruction_started_); + FML_DCHECK(destruction_started_); #endif } diff --git a/fml/memory/ref_ptr.h b/fml/memory/ref_ptr.h index 098ea40920d68..3c92f5042a1b7 100644 --- a/fml/memory/ref_ptr.h +++ b/fml/memory/ref_ptr.h @@ -12,9 +12,9 @@ #include #include +#include "flutter/fml/logging.h" #include "flutter/fml/macros.h" #include "flutter/fml/memory/ref_ptr_internal.h" -#include "lib/fxl/logging.h" namespace fml { @@ -107,12 +107,12 @@ class RefPtr final { T* get() const { return ptr_; } T& operator*() const { - FXL_DCHECK(ptr_); + FML_DCHECK(ptr_); return *ptr_; } T* operator->() const { - FXL_DCHECK(ptr_); + FML_DCHECK(ptr_); return ptr_; } @@ -189,7 +189,7 @@ class RefPtr final { friend RefPtr AdoptRef(T*); enum AdoptTag { ADOPT }; - RefPtr(T* ptr, AdoptTag) : ptr_(ptr) { FXL_DCHECK(ptr_); } + RefPtr(T* ptr, AdoptTag) : ptr_(ptr) { FML_DCHECK(ptr_); } T* ptr_; }; diff --git a/fml/memory/thread_checker.h b/fml/memory/thread_checker.h index 23e55f3e4d546..2180683309d6c 100644 --- a/fml/memory/thread_checker.h +++ b/fml/memory/thread_checker.h @@ -16,8 +16,8 @@ #include #endif +#include "flutter/fml/logging.h" #include "flutter/fml/macros.h" -#include "lib/fxl/logging.h" namespace fml { @@ -58,7 +58,7 @@ class ThreadChecker final { #ifndef NDEBUG #define FML_DECLARE_THREAD_CHECKER(c) fml::ThreadChecker c #define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) \ - FXL_DCHECK((c).IsCreationThreadCurrent()) + FML_DCHECK((c).IsCreationThreadCurrent()) #else #define FML_DECLARE_THREAD_CHECKER(c) #define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) ((void)0) diff --git a/fml/memory/weak_ptr.h b/fml/memory/weak_ptr.h index cf9485452e59a..e0f5f427b3fd7 100644 --- a/fml/memory/weak_ptr.h +++ b/fml/memory/weak_ptr.h @@ -10,10 +10,10 @@ #include +#include "flutter/fml/logging.h" #include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr_internal.h" -#include "lib/fxl/logging.h" namespace fml { @@ -86,13 +86,13 @@ class WeakPtr { T& operator*() const { FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - FXL_DCHECK(*this); + FML_DCHECK(*this); return *get(); } T* operator->() const { FML_DCHECK_CREATION_THREAD_IS_CURRENT(checker_.checker); - FXL_DCHECK(*this); + FML_DCHECK(*this); return get(); } @@ -161,7 +161,7 @@ class WeakPtrFactory { public: explicit WeakPtrFactory(T* ptr) : ptr_(ptr), flag_(fml::MakeRefCounted()) { - FXL_DCHECK(ptr_); + FML_DCHECK(ptr_); } ~WeakPtrFactory() { diff --git a/fml/memory/weak_ptr_internal.cc b/fml/memory/weak_ptr_internal.cc index e5379cbd3d0fd..c06db4672b5d6 100644 --- a/fml/memory/weak_ptr_internal.cc +++ b/fml/memory/weak_ptr_internal.cc @@ -4,7 +4,7 @@ #include "flutter/fml/memory/weak_ptr_internal.h" -#include "lib/fxl/logging.h" +#include "flutter/fml/logging.h" namespace fml { namespace internal { @@ -13,12 +13,12 @@ WeakPtrFlag::WeakPtrFlag() : is_valid_(true) {} WeakPtrFlag::~WeakPtrFlag() { // Should be invalidated before destruction. - FXL_DCHECK(!is_valid_); + FML_DCHECK(!is_valid_); } void WeakPtrFlag::Invalidate() { // Invalidation should happen exactly once. - FXL_DCHECK(is_valid_); + FML_DCHECK(is_valid_); is_valid_ = false; } diff --git a/fml/memory/weak_ptr_internal.h b/fml/memory/weak_ptr_internal.h index dca47f1a61295..246a2d851da87 100644 --- a/fml/memory/weak_ptr_internal.h +++ b/fml/memory/weak_ptr_internal.h @@ -19,7 +19,7 @@ namespace internal { // This class in not thread-safe, though references may be released on any // thread (allowing weak pointers to be destroyed/reset/reassigned on any // thread). -class FXL_EXPORT WeakPtrFlag : public fml::RefCountedThreadSafe { +class WeakPtrFlag : public fml::RefCountedThreadSafe { public: WeakPtrFlag(); diff --git a/fml/message_loop.cc b/fml/message_loop.cc index 44a0e307c1dd1..1b98148e66982 100644 --- a/fml/message_loop.cc +++ b/fml/message_loop.cc @@ -20,7 +20,7 @@ FML_THREAD_LOCAL ThreadLocal tls_message_loop([](intptr_t value) { MessageLoop& MessageLoop::GetCurrent() { auto loop = reinterpret_cast(tls_message_loop.Get()); - FXL_CHECK(loop != nullptr) + FML_CHECK(loop != nullptr) << "MessageLoop::EnsureInitializedForCurrentThread was not called on " "this thread prior to message loop use."; return *loop; @@ -41,8 +41,8 @@ bool MessageLoop::IsInitializedForCurrentThread() { MessageLoop::MessageLoop() : loop_(MessageLoopImpl::Create()), task_runner_(fxl::MakeRefCounted(loop_)) { - FXL_CHECK(loop_); - FXL_CHECK(task_runner_); + FML_CHECK(loop_); + FML_CHECK(task_runner_); } MessageLoop::~MessageLoop() = default; diff --git a/fml/message_loop_impl.cc b/fml/message_loop_impl.cc index d5f8e4e17c2b7..c960b7cdb742f 100644 --- a/fml/message_loop_impl.cc +++ b/fml/message_loop_impl.cc @@ -10,6 +10,7 @@ #include #include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" #include "flutter/fml/trace_event.h" #if OS_MACOSX @@ -43,7 +44,7 @@ MessageLoopImpl::MessageLoopImpl() : order_(0), terminated_(false) {} MessageLoopImpl::~MessageLoopImpl() = default; void MessageLoopImpl::PostTask(fxl::Closure task, fxl::TimePoint target_time) { - FXL_DCHECK(task != nullptr); + FML_DCHECK(task != nullptr); RegisterTask(task, target_time); } @@ -52,15 +53,15 @@ void MessageLoopImpl::RunExpiredTasksNow() { } void MessageLoopImpl::AddTaskObserver(intptr_t key, fxl::Closure callback) { - FXL_DCHECK(callback != nullptr); - FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) + 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."; task_observers_[key] = std::move(callback); } void MessageLoopImpl::RemoveTaskObserver(intptr_t key) { - FXL_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) + FML_DCHECK(MessageLoop::GetCurrent().GetLoopImpl().get() == this) << "Message loop task observer must be removed from the same thread as " "the loop."; task_observers_.erase(key); @@ -100,7 +101,7 @@ void MessageLoopImpl::DoTerminate() { void MessageLoopImpl::RegisterTask(fxl::Closure task, fxl::TimePoint target_time) { - FXL_DCHECK(task != nullptr); + FML_DCHECK(task != nullptr); if (terminated_) { // If the message loop has already been terminated, PostTask should destruct // |task| synchronously within this function. diff --git a/fml/platform/android/jni_util.cc b/fml/platform/android/jni_util.cc index be53c3ce6184a..86884327beb25 100644 --- a/fml/platform/android/jni_util.cc +++ b/fml/platform/android/jni_util.cc @@ -7,26 +7,26 @@ #include #include -#include "lib/fxl/logging.h" +#include "flutter/fml/logging.h" namespace fml { namespace jni { static JavaVM* g_jvm = nullptr; -#define ASSERT_NO_EXCEPTION() FXL_CHECK(env->ExceptionCheck() == JNI_FALSE); +#define ASSERT_NO_EXCEPTION() FML_CHECK(env->ExceptionCheck() == JNI_FALSE); void InitJavaVM(JavaVM* vm) { - FXL_DCHECK(g_jvm == nullptr); + FML_DCHECK(g_jvm == nullptr); g_jvm = vm; } JNIEnv* AttachCurrentThread() { - FXL_DCHECK(g_jvm != nullptr) + FML_DCHECK(g_jvm != nullptr) << "Trying to attach to current thread without calling InitJavaVM first."; JNIEnv* env = nullptr; jint ret = g_jvm->AttachCurrentThread(&env, nullptr); - FXL_DCHECK(JNI_OK == ret); + FML_DCHECK(JNI_OK == ret); return env; } @@ -97,10 +97,10 @@ std::vector StringArrayToVector(JNIEnv* env, jobjectArray array) { ScopedJavaLocalRef VectorToStringArray( JNIEnv* env, const std::vector& vector) { - FXL_DCHECK(env); + FML_DCHECK(env); ScopedJavaLocalRef string_clazz(env, env->FindClass("java/lang/String")); - FXL_DCHECK(!string_clazz.is_null()); + FML_DCHECK(!string_clazz.is_null()); jobjectArray joa = env->NewObjectArray(vector.size(), string_clazz.obj(), NULL); ASSERT_NO_EXCEPTION(); diff --git a/fml/platform/android/jni_weak_ref.cc b/fml/platform/android/jni_weak_ref.cc index c28f6660b667e..ffd2b3c855738 100644 --- a/fml/platform/android/jni_weak_ref.cc +++ b/fml/platform/android/jni_weak_ref.cc @@ -4,8 +4,8 @@ #include "flutter/fml/platform/android/jni_weak_ref.h" +#include "flutter/fml/logging.h" #include "flutter/fml/platform/android/jni_util.h" -#include "lib/fxl/logging.h" namespace fml { namespace jni { @@ -20,7 +20,7 @@ JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef( JavaObjectWeakGlobalRef::JavaObjectWeakGlobalRef(JNIEnv* env, jobject obj) : obj_(env->NewWeakGlobalRef(obj)) { - FXL_DCHECK(obj_); + FML_DCHECK(obj_); } JavaObjectWeakGlobalRef::~JavaObjectWeakGlobalRef() { @@ -46,8 +46,9 @@ ScopedJavaLocalRef GetRealObject(JNIEnv* env, jweak obj) { jobject real = NULL; if (obj) { real = env->NewLocalRef(obj); - if (!real) - FXL_DLOG(ERROR) << "The real object has been deleted!"; + if (!real) { + FML_DLOG(ERROR) << "The real object has been deleted!"; + } } return ScopedJavaLocalRef(env, real); } diff --git a/fml/platform/android/message_loop_android.cc b/fml/platform/android/message_loop_android.cc index 0720c5ef8a28b..b2298cb799131 100644 --- a/fml/platform/android/message_loop_android.cc +++ b/fml/platform/android/message_loop_android.cc @@ -32,8 +32,8 @@ MessageLoopAndroid::MessageLoopAndroid() : looper_(AcquireLooperForThread()), timer_fd_(::timerfd_create(kClockType, TFD_NONBLOCK | TFD_CLOEXEC)), running_(false) { - FXL_CHECK(looper_.is_valid()); - FXL_CHECK(timer_fd_.is_valid()); + FML_CHECK(looper_.is_valid()); + FML_CHECK(timer_fd_.is_valid()); static const int kWakeEvents = ALOOPER_EVENT_INPUT; @@ -51,16 +51,16 @@ MessageLoopAndroid::MessageLoopAndroid() read_event_fd, // callback this // baton ); - FXL_CHECK(add_result == 1); + FML_CHECK(add_result == 1); } MessageLoopAndroid::~MessageLoopAndroid() { int remove_result = ::ALooper_removeFd(looper_.get(), timer_fd_.get()); - FXL_CHECK(remove_result == 1); + FML_CHECK(remove_result == 1); } void MessageLoopAndroid::Run() { - FXL_DCHECK(looper_.get() == ALooper_forThread()); + FML_DCHECK(looper_.get() == ALooper_forThread()); running_ = true; @@ -84,7 +84,7 @@ void MessageLoopAndroid::Terminate() { void MessageLoopAndroid::WakeUp(fxl::TimePoint time_point) { bool result = TimerRearm(timer_fd_.get(), time_point); - FXL_DCHECK(result); + FML_DCHECK(result); } void MessageLoopAndroid::OnEventFired() { diff --git a/fml/platform/android/scoped_java_ref.cc b/fml/platform/android/scoped_java_ref.cc index d682f60a4fd05..f8d68c0f0df79 100644 --- a/fml/platform/android/scoped_java_ref.cc +++ b/fml/platform/android/scoped_java_ref.cc @@ -4,8 +4,8 @@ #include "flutter/fml/platform/android/scoped_java_ref.h" +#include "flutter/fml/logging.h" #include "flutter/fml/platform/android/jni_util.h" -#include "lib/fxl/logging.h" namespace fml { namespace jni { @@ -14,13 +14,13 @@ static const int kDefaultLocalFrameCapacity = 16; ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env) : env_(env) { int failed = env_->PushLocalFrame(kDefaultLocalFrameCapacity); - FXL_DCHECK(!failed); + FML_DCHECK(!failed); } ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env, int capacity) : env_(env) { int failed = env_->PushLocalFrame(capacity); - FXL_DCHECK(!failed); + FML_DCHECK(!failed); } ScopedJavaLocalFrame::~ScopedJavaLocalFrame() { @@ -31,7 +31,7 @@ JavaRef::JavaRef() : obj_(NULL) {} JavaRef::JavaRef(JNIEnv* env, jobject obj) : obj_(obj) { if (obj) { - FXL_DCHECK(env && env->GetObjectRefType(obj) == JNILocalRefType); + FML_DCHECK(env && env->GetObjectRefType(obj) == JNILocalRefType); } } @@ -41,7 +41,7 @@ JNIEnv* JavaRef::SetNewLocalRef(JNIEnv* env, jobject obj) { if (!env) { env = AttachCurrentThread(); } else { - FXL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. + FML_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. } if (obj) obj = env->NewLocalRef(obj); @@ -55,7 +55,7 @@ void JavaRef::SetNewGlobalRef(JNIEnv* env, jobject obj) { if (!env) { env = AttachCurrentThread(); } else { - FXL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. + FML_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. } if (obj) obj = env->NewGlobalRef(obj); @@ -66,7 +66,7 @@ void JavaRef::SetNewGlobalRef(JNIEnv* env, jobject obj) { void JavaRef::ResetLocalRef(JNIEnv* env) { if (obj_) { - FXL_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. + FML_DCHECK(env == AttachCurrentThread()); // Is |env| on correct thread. env->DeleteLocalRef(obj_); obj_ = NULL; } diff --git a/fml/platform/darwin/message_loop_darwin.mm b/fml/platform/darwin/message_loop_darwin.mm index 6693ab23bac63..1ba0bb2d239ca 100644 --- a/fml/platform/darwin/message_loop_darwin.mm +++ b/fml/platform/darwin/message_loop_darwin.mm @@ -7,13 +7,15 @@ #include #include +#include "flutter/fml/logging.h" + namespace fml { static constexpr CFTimeInterval kDistantFuture = 1.0e10; MessageLoopDarwin::MessageLoopDarwin() : running_(false), loop_((CFRunLoopRef)CFRetain(CFRunLoopGetCurrent())) { - FXL_DCHECK(loop_ != nullptr); + FML_DCHECK(loop_ != nullptr); // Setup the delayed wake source. CFRunLoopTimerContext timer_context = { @@ -25,7 +27,7 @@ reinterpret_cast(&MessageLoopDarwin::OnTimerFire) /* callout */, &timer_context /* context */)); - FXL_DCHECK(delayed_wake_timer_ != nullptr); + FML_DCHECK(delayed_wake_timer_ != nullptr); CFRunLoopAddTimer(loop_, delayed_wake_timer_, kCFRunLoopCommonModes); } @@ -35,7 +37,7 @@ } void MessageLoopDarwin::Run() { - FXL_DCHECK(loop_ == CFRunLoopGetCurrent()); + FML_DCHECK(loop_ == CFRunLoopGetCurrent()); running_ = true; diff --git a/fml/platform/linux/message_loop_linux.cc b/fml/platform/linux/message_loop_linux.cc index 2868f137e5d71..8effa4d188f75 100644 --- a/fml/platform/linux/message_loop_linux.cc +++ b/fml/platform/linux/message_loop_linux.cc @@ -18,15 +18,15 @@ MessageLoopLinux::MessageLoopLinux() : epoll_fd_(FML_HANDLE_EINTR(::epoll_create(1 /* unused */))), timer_fd_(::timerfd_create(kClockType, TFD_NONBLOCK | TFD_CLOEXEC)), running_(false) { - FXL_CHECK(epoll_fd_.is_valid()); - FXL_CHECK(timer_fd_.is_valid()); + FML_CHECK(epoll_fd_.is_valid()); + FML_CHECK(timer_fd_.is_valid()); bool added_source = AddOrRemoveTimerSource(true); - FXL_CHECK(added_source); + FML_CHECK(added_source); } MessageLoopLinux::~MessageLoopLinux() { bool removed_source = AddOrRemoveTimerSource(false); - FXL_CHECK(removed_source); + FML_CHECK(removed_source); } bool MessageLoopLinux::AddOrRemoveTimerSource(bool add) { @@ -78,7 +78,7 @@ void MessageLoopLinux::Terminate() { void MessageLoopLinux::WakeUp(fxl::TimePoint time_point) { bool result = TimerRearm(timer_fd_.get(), time_point); - FXL_DCHECK(result); + FML_DCHECK(result); } void MessageLoopLinux::OnEventFired() { diff --git a/fml/platform/win/message_loop_win.cc b/fml/platform/win/message_loop_win.cc index 67c592b3ea3ea..51bfec9f280ca 100644 --- a/fml/platform/win/message_loop_win.cc +++ b/fml/platform/win/message_loop_win.cc @@ -8,7 +8,7 @@ namespace fml { MessageLoopWin::MessageLoopWin() : timer_(CreateWaitableTimer(NULL, FALSE, NULL)) { - FXL_CHECK(timer_.is_valid()); + FML_CHECK(timer_.is_valid()); } MessageLoopWin::~MessageLoopWin() = default; @@ -17,7 +17,7 @@ void MessageLoopWin::Run() { running_ = true; while (running_) { - FXL_CHECK(WaitForSingleObject(timer_.get(), INFINITE) == 0); + FML_CHECK(WaitForSingleObject(timer_.get(), INFINITE) == 0); RunExpiredTasksNow(); } } @@ -33,7 +33,7 @@ void MessageLoopWin::WakeUp(fxl::TimePoint time_point) { if (time_point > now) { due_time.QuadPart = (time_point - now).ToNanoseconds() / -100; } - FXL_CHECK(SetWaitableTimer(timer_.get(), &due_time, 0, NULL, NULL, FALSE)); + FML_CHECK(SetWaitableTimer(timer_.get(), &due_time, 0, NULL, NULL, FALSE)); } } // namespace fml diff --git a/fml/task_runner.cc b/fml/task_runner.cc index 95f91de8e9124..cb505d4f38c42 100644 --- a/fml/task_runner.cc +++ b/fml/task_runner.cc @@ -8,6 +8,7 @@ #include +#include "flutter/fml/logging.h" #include "flutter/fml/message_loop.h" #include "flutter/fml/message_loop_impl.h" @@ -15,7 +16,7 @@ namespace fml { TaskRunner::TaskRunner(fxl::RefPtr loop) : loop_(std::move(loop)) { - FXL_CHECK(loop_); + FML_CHECK(loop_); } TaskRunner::~TaskRunner() = default; @@ -42,7 +43,7 @@ bool TaskRunner::RunsTasksOnCurrentThread() { void TaskRunner::RunNowOrPostTask(fxl::RefPtr runner, fxl::Closure task) { - FXL_DCHECK(runner); + FML_DCHECK(runner); if (runner->RunsTasksOnCurrentThread()) { task(); } else { diff --git a/fml/thread_local.h b/fml/thread_local.h index e450097abd6bb..a36d80601f6e6 100644 --- a/fml/thread_local.h +++ b/fml/thread_local.h @@ -8,8 +8,8 @@ #include #include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" #include "flutter/fml/macros.h" -#include "lib/fxl/logging.h" #define FML_THREAD_LOCAL_PTHREADS OS_MACOSX || OS_LINUX || OS_ANDROID @@ -59,7 +59,7 @@ class ThreadLocal { }; static inline void ThreadLocalDestroy(void* value) { - FXL_CHECK(value != nullptr); + FML_CHECK(value != nullptr); auto box = reinterpret_cast(value); box->DestroyValue(); delete box; @@ -71,14 +71,14 @@ class ThreadLocal { ThreadLocal(ThreadLocalDestroyCallback destroy) : destroy_(destroy) { auto callback = reinterpret_cast(&ThreadLocal::ThreadLocalDestroy); - FXL_CHECK(pthread_key_create(&_key, callback) == 0); + FML_CHECK(pthread_key_create(&_key, callback) == 0); } void Set(intptr_t value) { auto box = reinterpret_cast(pthread_getspecific(_key)); if (box == nullptr) { box = new Box(destroy_, value); - FXL_CHECK(pthread_setspecific(_key, box) == 0); + FML_CHECK(pthread_setspecific(_key, box) == 0); } else { box->SetValue(value); } @@ -99,7 +99,7 @@ class ThreadLocal { delete reinterpret_cast(pthread_getspecific(_key)); // Finally, collect the key - FXL_CHECK(pthread_key_delete(_key) == 0); + FML_CHECK(pthread_key_delete(_key) == 0); } private: diff --git a/fml/thread_local_unittests.cc b/fml/thread_local_unittests.cc index 70d84300f69ae..9ae5f82d35e16 100644 --- a/fml/thread_local_unittests.cc +++ b/fml/thread_local_unittests.cc @@ -4,6 +4,7 @@ #include +#include "flutter/fml/logging.h" #include "flutter/fml/thread_local.h" #include "gtest/gtest.h" diff --git a/fml/unique_object.h b/fml/unique_object.h index 4feabe57d6e5a..e5f2f8690a644 100644 --- a/fml/unique_object.h +++ b/fml/unique_object.h @@ -8,8 +8,8 @@ #include #include "flutter/fml/compiler_specific.h" +#include "flutter/fml/logging.h" #include "flutter/fml/macros.h" -#include "lib/fxl/logging.h" namespace fml { @@ -60,7 +60,7 @@ class UniqueObject { } void reset(const T& value = Traits::InvalidValue()) { - FXL_CHECK(data_.generic == Traits::InvalidValue() || + FML_CHECK(data_.generic == Traits::InvalidValue() || data_.generic != value); FreeIfNecessary(); data_.generic = value; diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index f44f0cf209419..2f1a14a290393 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -655,6 +655,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: engine +ORIGIN: ../../../garnet/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../flutter/fml/export.h +---------------------------------------------------------------------------------------------------- +Copyright 2017 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: engine ORIGIN: ../../../third_party/icu/scripts/LICENSE @@ -817,6 +852,12 @@ TYPE: LicenseType.bsd FILE: ../../../flutter/fml/build_config.h FILE: ../../../flutter/fml/compiler_specific.h FILE: ../../../flutter/fml/eintr_wrapper.h +FILE: ../../../flutter/fml/log_level.h +FILE: ../../../flutter/fml/log_settings.cc +FILE: ../../../flutter/fml/log_settings.h +FILE: ../../../flutter/fml/log_settings_state.cc +FILE: ../../../flutter/fml/logging.cc +FILE: ../../../flutter/fml/logging.h FILE: ../../../flutter/fml/memory/ref_counted.h FILE: ../../../flutter/fml/memory/ref_counted_internal.h FILE: ../../../flutter/fml/memory/ref_counted_unittest.cc @@ -1141,4 +1182,4 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==================================================================================================== -Total license count: 11 +Total license count: 12 From 99a1dde524d318b44fadc269491476f0f1693c98 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 16:02:01 -0700 Subject: [PATCH 0380/1190] Import FXL timing utilities into FML. (#5311) --- fml/BUILD.gn | 6 ++ fml/time/time_delta.h | 111 ++++++++++++++++++++++++ fml/time/time_delta_unittest.cc | 23 +++++ fml/time/time_point.cc | 76 ++++++++++++++++ fml/time/time_point.h | 70 +++++++++++++++ fml/time/time_point_unittest.cc | 18 ++++ fml/time/time_unittest.cc | 54 ++++++++++++ travis/licenses_golden/licenses_flutter | 6 ++ 8 files changed, 364 insertions(+) create mode 100644 fml/time/time_delta.h create mode 100644 fml/time/time_delta_unittest.cc create mode 100644 fml/time/time_point.cc create mode 100644 fml/time/time_point.h create mode 100644 fml/time/time_point_unittest.cc create mode 100644 fml/time/time_unittest.cc diff --git a/fml/BUILD.gn b/fml/BUILD.gn index dfbd2e0e83a90..e00cd085aed57 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -39,6 +39,9 @@ source_set("fml") { "thread.cc", "thread.h", "thread_local.h", + "time/time_delta.h", + "time/time_point.cc", + "time/time_point.h", "trace_event.cc", "trace_event.h", "unique_fd.cc", @@ -148,6 +151,9 @@ executable("fml_unittests") { "message_loop_unittests.cc", "thread_local_unittests.cc", "thread_unittests.cc", + "time/time_delta_unittest.cc", + "time/time_point_unittest.cc", + "time/time_unittest.cc", ] deps = [ diff --git a/fml/time/time_delta.h b/fml/time/time_delta.h new file mode 100644 index 0000000000000..1b7caa281084f --- /dev/null +++ b/fml/time/time_delta.h @@ -0,0 +1,111 @@ +// Copyright 2016 The Fuchsia 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_TIME_TIME_DELTA_H_ +#define FLUTTER_FML_TIME_TIME_DELTA_H_ + +#include +#include + +#include +#include + +namespace fml { + +// A TimeDelta represents the difference between two time points. +class TimeDelta { + public: + constexpr TimeDelta() = default; + + static constexpr TimeDelta Zero() { return TimeDelta(); } + static constexpr TimeDelta Min() { + return TimeDelta(std::numeric_limits::min()); + } + static constexpr TimeDelta Max() { + return TimeDelta(std::numeric_limits::max()); + } + static constexpr TimeDelta FromNanoseconds(int64_t nanos) { + return TimeDelta(nanos); + } + static constexpr TimeDelta FromMicroseconds(int64_t micros) { + return FromNanoseconds(micros * 1000); + } + static constexpr TimeDelta FromMilliseconds(int64_t millis) { + return FromMicroseconds(millis * 1000); + } + static constexpr TimeDelta FromSeconds(int64_t seconds) { + return FromMilliseconds(seconds * 1000); + } + + static constexpr TimeDelta FromSecondsF(double seconds) { + return FromNanoseconds(seconds * (1000.0 * 1000.0 * 1000.0)); + } + + constexpr int64_t ToNanoseconds() const { return delta_; } + constexpr int64_t ToMicroseconds() const { return ToNanoseconds() / 1000; } + constexpr int64_t ToMilliseconds() const { return ToMicroseconds() / 1000; } + constexpr int64_t ToSeconds() const { return ToMilliseconds() / 1000; } + + constexpr double ToNanosecondsF() const { return delta_; } + constexpr double ToMicrosecondsF() const { return delta_ / 1000.0; } + constexpr double ToMillisecondsF() const { + return delta_ / (1000.0 * 1000.0); + } + constexpr double ToSecondsF() const { + return delta_ / (1000.0 * 1000.0 * 1000.0); + } + + constexpr TimeDelta operator-(TimeDelta other) const { + return TimeDelta::FromNanoseconds(delta_ - other.delta_); + } + + constexpr TimeDelta operator+(TimeDelta other) const { + return TimeDelta::FromNanoseconds(delta_ + other.delta_); + } + + constexpr TimeDelta operator/(int64_t divisor) const { + return TimeDelta::FromNanoseconds(delta_ / divisor); + } + + constexpr int64_t operator/(TimeDelta other) const { + return delta_ / other.delta_; + } + + constexpr TimeDelta operator*(int64_t multiplier) const { + return TimeDelta::FromNanoseconds(delta_ * multiplier); + } + + constexpr TimeDelta operator%(TimeDelta other) const { + return TimeDelta::FromNanoseconds(delta_ % other.delta_); + } + + bool operator==(TimeDelta other) const { return delta_ == other.delta_; } + bool operator!=(TimeDelta other) const { return delta_ != other.delta_; } + bool operator<(TimeDelta other) const { return delta_ < other.delta_; } + bool operator<=(TimeDelta other) const { return delta_ <= other.delta_; } + bool operator>(TimeDelta other) const { return delta_ > other.delta_; } + bool operator>=(TimeDelta other) const { return delta_ >= other.delta_; } + + static constexpr TimeDelta FromTimespec(struct timespec ts) { + return TimeDelta::FromSeconds(ts.tv_sec) + + TimeDelta::FromNanoseconds(ts.tv_nsec); + } + struct timespec ToTimespec() { + struct timespec ts; + constexpr int64_t kNanosecondsPerSecond = 1000000000ll; + ts.tv_sec = static_cast(ToSeconds()); + ts.tv_nsec = delta_ % kNanosecondsPerSecond; + return ts; + } + + private: + // Private, use one of the FromFoo() types + explicit constexpr TimeDelta(int64_t delta) : delta_(delta) {} + + int64_t delta_ = 0; +}; + +} // namespace fml + +#endif // FLUTTER_FML_TIME_TIME_DELTA_H_ diff --git a/fml/time/time_delta_unittest.cc b/fml/time/time_delta_unittest.cc new file mode 100644 index 0000000000000..992b4f4a8b888 --- /dev/null +++ b/fml/time/time_delta_unittest.cc @@ -0,0 +1,23 @@ +// Copyright 2017 The Fuchsia 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/time_delta.h" + +#include "gtest/gtest.h" + +namespace fml { +namespace { + +TEST(TimeDelta, Control) { + EXPECT_LT(TimeDelta::Min(), TimeDelta::Zero()); + EXPECT_GT(TimeDelta::Max(), TimeDelta::Zero()); + + EXPECT_GT(TimeDelta::Zero(), TimeDelta::FromMilliseconds(-100)); + EXPECT_LT(TimeDelta::Zero(), TimeDelta::FromMilliseconds(100)); + + EXPECT_EQ(TimeDelta::FromMilliseconds(1000), TimeDelta::FromSeconds(1)); +} + +} // namespace +} // namespace fml diff --git a/fml/time/time_point.cc b/fml/time/time_point.cc new file mode 100644 index 0000000000000..36ca1582372df --- /dev/null +++ b/fml/time/time_point.cc @@ -0,0 +1,76 @@ +// Copyright 2016 The Fuchsia 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/time_point.h" + +#include "flutter/fml/build_config.h" + +#if defined(OS_MACOSX) || defined(OS_IOS) +#include +#include +#elif defined(OS_FUCHSIA) +#include +#elif defined(OS_WIN) +#include +#else +#include +#endif // defined(OS_MACOSX) || defined(OS_IOS) + +#include "flutter/fml/logging.h" + +namespace fml { + +// Mac OS X/iOS don't have a (useful) |clock_gettime()|. +// Note: Chromium's |base::TimeTicks::Now()| uses boot time (obtained via +// |sysctl()| with |CTL_KERN|/|KERN_BOOTTIME|). For our current purposes, +// monotonic time (which pauses during sleeps) is sufficient. TODO(vtl): If/when +// we use this for other purposes, maybe we should use boot time (maybe also on +// POSIX). +#if defined(OS_MACOSX) || defined(OS_IOS) + +mach_timebase_info_data_t GetMachTimebaseInfo() { + mach_timebase_info_data_t timebase_info = {}; + kern_return_t error = mach_timebase_info(&timebase_info); + FML_DCHECK(error == KERN_SUCCESS); + return timebase_info; +} + +// static +TimePoint TimePoint::Now() { + static mach_timebase_info_data_t timebase_info = GetMachTimebaseInfo(); + return TimePoint(mach_absolute_time() * timebase_info.numer / + timebase_info.denom); +} + +#elif defined(OS_FUCHSIA) + +// static +TimePoint TimePoint::Now() { + return TimePoint(zx_clock_get(ZX_CLOCK_MONOTONIC)); +} + +#elif defined(OS_WIN) + +TimePoint TimePoint::Now() { + uint64_t freq = 0; + uint64_t count = 0; + QueryPerformanceFrequency((LARGE_INTEGER*)&freq); + QueryPerformanceCounter((LARGE_INTEGER*)&count); + return TimePoint((count * 1000000000) / freq); +} + +#else + +// static +TimePoint TimePoint::Now() { + struct timespec ts; + int res = clock_gettime(CLOCK_MONOTONIC, &ts); + FML_DCHECK(res == 0); + (void)res; + return TimePoint::FromEpochDelta(TimeDelta::FromTimespec(ts)); +} + +#endif // defined(OS_MACOSX) || defined(OS_IOS) + +} // namespace fml diff --git a/fml/time/time_point.h b/fml/time/time_point.h new file mode 100644 index 0000000000000..500de54302a0b --- /dev/null +++ b/fml/time/time_point.h @@ -0,0 +1,70 @@ +// Copyright 2016 The Fuchsia 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_TIME_TIME_POINT_H_ +#define FLUTTER_FML_TIME_TIME_POINT_H_ + +#include + +#include + +#include "flutter/fml/time/time_delta.h" + +namespace fml { + +// A TimePoint represents a point in time represented as an integer number of +// nanoseconds elapsed since an arbitrary point in the past. +// +// WARNING: This class should not be serialized across reboots, or across +// devices: the reference point is only stable for a given device between +// reboots. +class TimePoint { + public: + // Default TimePoint with internal value 0 (epoch). + constexpr TimePoint() = default; + + static TimePoint Now(); + + static constexpr TimePoint Min() { + return TimePoint(std::numeric_limits::min()); + } + + static constexpr TimePoint Max() { + return TimePoint(std::numeric_limits::max()); + } + + static constexpr TimePoint FromEpochDelta(TimeDelta ticks) { + return TimePoint(ticks.ToNanoseconds()); + } + + TimeDelta ToEpochDelta() const { return TimeDelta::FromNanoseconds(ticks_); } + + // Compute the difference between two time points. + TimeDelta operator-(TimePoint other) const { + return TimeDelta::FromNanoseconds(ticks_ - other.ticks_); + } + + TimePoint operator+(TimeDelta duration) const { + return TimePoint(ticks_ + duration.ToNanoseconds()); + } + TimePoint operator-(TimeDelta duration) const { + return TimePoint(ticks_ - duration.ToNanoseconds()); + } + + bool operator==(TimePoint other) const { return ticks_ == other.ticks_; } + bool operator!=(TimePoint other) const { return ticks_ != other.ticks_; } + bool operator<(TimePoint other) const { return ticks_ < other.ticks_; } + bool operator<=(TimePoint other) const { return ticks_ <= other.ticks_; } + bool operator>(TimePoint other) const { return ticks_ > other.ticks_; } + bool operator>=(TimePoint other) const { return ticks_ >= other.ticks_; } + + private: + explicit constexpr TimePoint(int64_t ticks) : ticks_(ticks) {} + + int64_t ticks_ = 0; +}; + +} // namespace fml + +#endif // FLUTTER_FML_TIME_TIME_POINT_H_ diff --git a/fml/time/time_point_unittest.cc b/fml/time/time_point_unittest.cc new file mode 100644 index 0000000000000..2de07b0582442 --- /dev/null +++ b/fml/time/time_point_unittest.cc @@ -0,0 +1,18 @@ +// Copyright 2017 The Fuchsia 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/time_point.h" + +#include "gtest/gtest.h" + +namespace fml { +namespace { + +TEST(TimePoint, Control) { + EXPECT_LT(TimePoint::Min(), TimePoint::Now()); + EXPECT_GT(TimePoint::Max(), TimePoint::Now()); +} + +} // namespace +} // namespace fml diff --git a/fml/time/time_unittest.cc b/fml/time/time_unittest.cc new file mode 100644 index 0000000000000..eab352d947773 --- /dev/null +++ b/fml/time/time_unittest.cc @@ -0,0 +1,54 @@ +// Copyright 2016 The Fuchsia 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 + +#include "flutter/fml/time/time_delta.h" +#include "flutter/fml/time/time_point.h" +#include "gtest/gtest.h" + +namespace fml { +namespace { + +TEST(Time, Now) { + auto start = TimePoint::Now(); + for (int i = 0; i < 3; ++i) { + auto now = TimePoint::Now(); + EXPECT_GE(now, start); + std::this_thread::yield(); + } +} + +TEST(Time, IntConversions) { + // Integer conversions should all truncate, not round. + TimeDelta delta = TimeDelta::FromNanoseconds(102304506708ll); + EXPECT_EQ(102304506708ll, delta.ToNanoseconds()); + EXPECT_EQ(102304506ll, delta.ToMicroseconds()); + EXPECT_EQ(102304ll, delta.ToMilliseconds()); + EXPECT_EQ(102ll, delta.ToSeconds()); +} + +TEST(Time, FloatConversions) { + // Float conversions should remain close to the original value. + TimeDelta delta = TimeDelta::FromNanoseconds(102304506708ll); + EXPECT_FLOAT_EQ(102304506708.0, delta.ToNanosecondsF()); + EXPECT_FLOAT_EQ(102304506.708, delta.ToMicrosecondsF()); + EXPECT_FLOAT_EQ(102304.506708, delta.ToMillisecondsF()); + EXPECT_FLOAT_EQ(102.304506708, delta.ToSecondsF()); +} + +TEST(Time, TimespecConversions) { + struct timespec ts; + ts.tv_sec = 5; + ts.tv_nsec = 7; + TimeDelta from_timespec = TimeDelta::FromTimespec(ts); + EXPECT_EQ(5, from_timespec.ToSeconds()); + EXPECT_EQ(5 * 1000000000ll + 7, from_timespec.ToNanoseconds()); + struct timespec to_timespec = from_timespec.ToTimespec(); + EXPECT_EQ(ts.tv_sec, to_timespec.tv_sec); + EXPECT_EQ(ts.tv_nsec, to_timespec.tv_nsec); +} + +} // namespace +} // namespace fml diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 2f1a14a290393..09bfe5b0eb0f1 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -660,6 +660,8 @@ LIBRARY: engine ORIGIN: ../../../garnet/LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/fml/export.h +FILE: ../../../flutter/fml/time/time_delta_unittest.cc +FILE: ../../../flutter/fml/time/time_point_unittest.cc ---------------------------------------------------------------------------------------------------- Copyright 2017 The Fuchsia Authors. All rights reserved. @@ -868,6 +870,10 @@ FILE: ../../../flutter/fml/memory/weak_ptr.h FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc FILE: ../../../flutter/fml/memory/weak_ptr_internal.h FILE: ../../../flutter/fml/memory/weak_ptr_unittest.cc +FILE: ../../../flutter/fml/time/time_delta.h +FILE: ../../../flutter/fml/time/time_point.cc +FILE: ../../../flutter/fml/time/time_point.h +FILE: ../../../flutter/fml/time/time_unittest.cc ---------------------------------------------------------------------------------------------------- Copyright 2016 The Fuchsia Authors. All rights reserved. From ef7a459cbf065ee4de48c59c45afb93f46eaf683 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 16:22:48 -0700 Subject: [PATCH 0381/1190] Fix missing include on Windows. (#5313) --- fml/platform/win/message_loop_win.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fml/platform/win/message_loop_win.cc b/fml/platform/win/message_loop_win.cc index 51bfec9f280ca..5211fd2c162a8 100644 --- a/fml/platform/win/message_loop_win.cc +++ b/fml/platform/win/message_loop_win.cc @@ -4,6 +4,8 @@ #include "flutter/fml/platform/win/message_loop_win.h" +#include "flutter/fml/logging.h" + namespace fml { MessageLoopWin::MessageLoopWin() From 2e6aad39a29df4767132ab1ed760aa8ebe1d78ec Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 16:25:29 -0700 Subject: [PATCH 0382/1190] Import synchronization utilities into FML. (#5312) --- fml/BUILD.gn | 8 + fml/closure.h | 16 ++ fml/synchronization/thread_annotations.h | 89 +++++++++ .../thread_annotations_unittest.cc | 127 ++++++++++++ fml/synchronization/thread_checker.h | 71 +++++++ .../thread_checker_unittest.cc | 37 ++++ fml/synchronization/waitable_event.cc | 167 ++++++++++++++++ fml/synchronization/waitable_event.h | 128 ++++++++++++ .../waitable_event_unittest.cc | 187 ++++++++++++++++++ travis/licenses_golden/licenses_flutter | 8 + 10 files changed, 838 insertions(+) create mode 100644 fml/closure.h create mode 100644 fml/synchronization/thread_annotations.h create mode 100644 fml/synchronization/thread_annotations_unittest.cc create mode 100644 fml/synchronization/thread_checker.h create mode 100644 fml/synchronization/thread_checker_unittest.cc create mode 100644 fml/synchronization/waitable_event.cc create mode 100644 fml/synchronization/waitable_event.h create mode 100644 fml/synchronization/waitable_event_unittest.cc diff --git a/fml/BUILD.gn b/fml/BUILD.gn index e00cd085aed57..0e561b87cbee4 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -5,6 +5,7 @@ source_set("fml") { sources = [ "build_config.h", + "closure.h", "compiler_specific.h", "eintr_wrapper.h", "export.h", @@ -34,6 +35,10 @@ source_set("fml") { "native_library.h", "paths.cc", "paths.h", + "synchronization/thread_annotations.h", + "synchronization/thread_checker.h", + "synchronization/waitable_event.cc", + "synchronization/waitable_event.h", "task_runner.cc", "task_runner.h", "thread.cc", @@ -149,6 +154,9 @@ executable("fml_unittests") { "memory/ref_counted_unittest.cc", "memory/weak_ptr_unittest.cc", "message_loop_unittests.cc", + "synchronization/thread_annotations_unittest.cc", + "synchronization/thread_checker_unittest.cc", + "synchronization/waitable_event_unittest.cc", "thread_local_unittests.cc", "thread_unittests.cc", "time/time_delta_unittest.cc", diff --git a/fml/closure.h b/fml/closure.h new file mode 100644 index 0000000000000..f40c0b2d0cbaf --- /dev/null +++ b/fml/closure.h @@ -0,0 +1,16 @@ +// Copyright 2016 The Fuchsia 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_CLOSURE_H_ +#define FLUTTER_FML_CLOSURE_H_ + +#include + +namespace fml { + +using closure = std::function; + +} // namespace fml + +#endif // FLUTTER_FML_CLOSURE_H_ diff --git a/fml/synchronization/thread_annotations.h b/fml/synchronization/thread_annotations.h new file mode 100644 index 0000000000000..4123804e5720c --- /dev/null +++ b/fml/synchronization/thread_annotations.h @@ -0,0 +1,89 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Macros for static thread-safety analysis. +// +// These are from http://clang.llvm.org/docs/ThreadSafetyAnalysis.html (and thus +// really derive from google3's thread_annotations.h). +// +// TODO(vtl): We're still using the old-fashioned, deprecated annotations +// ("locks" instead of "capabilities"), since the new ones don't work yet (in +// particular, |TRY_ACQUIRE()| doesn't work: b/19264527). +// https://github.com/domokit/mojo/issues/314 + +#ifndef FLUTTER_FML_SYNCHRONIZATION_THREAD_ANNOTATIONS_H_ +#define FLUTTER_FML_SYNCHRONIZATION_THREAD_ANNOTATIONS_H_ + +// Enable thread-safety attributes only with clang. +// The attributes can be safely erased when compiling with other compilers. +#if defined(__clang__) +#define FML_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) +#else +#define FML_THREAD_ANNOTATION_ATTRIBUTE__(x) +#endif + +#define FML_GUARDED_BY(x) FML_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) + +#define FML_PT_GUARDED_BY(x) FML_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x)) + +#define FML_ACQUIRE(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(__VA_ARGS__)) + +#define FML_RELEASE(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(__VA_ARGS__)) + +#define FML_ACQUIRED_AFTER(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__)) + +#define FML_ACQUIRED_BEFORE(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__)) + +#define FML_EXCLUSIVE_LOCKS_REQUIRED(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__)) + +#define FML_SHARED_LOCKS_REQUIRED(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__)) + +#define FML_LOCKS_EXCLUDED(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__)) + +#define FML_LOCK_RETURNED(x) FML_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x)) + +#define FML_LOCKABLE FML_THREAD_ANNOTATION_ATTRIBUTE__(lockable) + +#define FML_SCOPED_LOCKABLE FML_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable) + +#define FML_EXCLUSIVE_LOCK_FUNCTION(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__)) + +#define FML_SHARED_LOCK_FUNCTION(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__)) + +#define FML_ASSERT_EXCLUSIVE_LOCK(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(assert_exclusive_lock(__VA_ARGS__)) + +#define FML_ASSERT_SHARED_LOCK(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_lock(__VA_ARGS__)) + +#define FML_EXCLUSIVE_TRYLOCK_FUNCTION(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__)) + +#define FML_SHARED_TRYLOCK_FUNCTION(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__)) + +#define FML_UNLOCK_FUNCTION(...) \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__)) + +#define FML_NO_THREAD_SAFETY_ANALYSIS \ + FML_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis) + +// Use this in the header to annotate a function/method as not being +// thread-safe. This is equivalent to |FML_NO_THREAD_SAFETY_ANALYSIS|, but +// semantically different: it declares that the caller must abide by additional +// restrictions. Limitation: Unfortunately, you can't apply this to a method in +// an interface (i.e., pure virtual method) and have it applied automatically to +// implementations. +#define FML_NOT_THREAD_SAFE FML_NO_THREAD_SAFETY_ANALYSIS + +#endif // FLUTTER_FML_SYNCHRONIZATION_THREAD_ANNOTATIONS_H_ diff --git a/fml/synchronization/thread_annotations_unittest.cc b/fml/synchronization/thread_annotations_unittest.cc new file mode 100644 index 0000000000000..12769451dcf36 --- /dev/null +++ b/fml/synchronization/thread_annotations_unittest.cc @@ -0,0 +1,127 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Tests of the static thread annotation macros. These fall into two categories, +// positive tests (testing that correct code compiles and works) and negative +// tests (testing that incorrect code does not compile). +// +// Unfortunately, we don't have systematic/automated negative compilation tests. +// So instead we have some cheesy macros that you can define to enable +// individual compilation failures. + +#include "flutter/fml/synchronization/thread_annotations.h" + +#include + +#include "flutter/fml/macros.h" +#include "gtest/gtest.h" + +// Uncomment these to enable particular compilation failure tests. +// #define NC_GUARDED_BY +// TODO(vtl): |ACQUIRED_{BEFORE,AFTER}()| are currently unimplemented in clang +// as of 2015-07-06 ("To be fixed in a future update."). So this actually +// compiles! +// #define NC_ACQUIRED_BEFORE + +namespace fml { +namespace { + +// Test FML_GUARDED_BY --------------------------------------------------------- + +class GuardedByClass { + public: + GuardedByClass() : x_() {} + ~GuardedByClass() {} + + void GoodSet(int x) { + mu_.lock(); + x_ = x; + mu_.unlock(); + } + +#ifdef NC_GUARDED_BY + void BadSet(int x) { x_ = x; } +#endif + + private: + std::mutex mu_; + int x_ FML_GUARDED_BY(mu_); + + FML_DISALLOW_COPY_AND_ASSIGN(GuardedByClass); +}; + +TEST(ThreadAnnotationsTest, GuardedBy) { + GuardedByClass c; + c.GoodSet(123); +} + +// Test FML_ACQUIRED_BEFORE ---------------------------------------------------- + +class AcquiredBeforeClass2; + +class AcquiredBeforeClass1 { + public: + AcquiredBeforeClass1() {} + ~AcquiredBeforeClass1() {} + + void NoOp() { + mu_.lock(); + mu_.unlock(); + } + +#ifdef NC_ACQUIRED_BEFORE + void BadMethod(AcquiredBeforeClass2* c2); +#endif + + private: + friend class AcquiredBeforeClass2; + + std::mutex mu_; + + FML_DISALLOW_COPY_AND_ASSIGN(AcquiredBeforeClass1); +}; + +class AcquiredBeforeClass2 { + public: + AcquiredBeforeClass2() {} + ~AcquiredBeforeClass2() {} + + void NoOp() { + mu_.lock(); + mu_.unlock(); + } + + void GoodMethod(AcquiredBeforeClass1* c1) { + mu_.lock(); + c1->NoOp(); + mu_.unlock(); + } + + private: + std::mutex mu_ FML_ACQUIRED_BEFORE(AcquiredBeforeClass1::mu_); + + FML_DISALLOW_COPY_AND_ASSIGN(AcquiredBeforeClass2); +}; + +#ifdef NC_ACQUIRED_BEFORE +void AcquiredBeforeClass1::BadMethod(AcquiredBeforeClass2* c2) { + mu_.lock(); + c2->NoOp(); + mu_.unlock(); +} +#endif + +TEST(ThreadAnnotationsTest, AcquiredBefore) { + AcquiredBeforeClass1 c1; + AcquiredBeforeClass2 c2; + c2.GoodMethod(&c1); +#ifdef NC_ACQUIRED_BEFORE + c1.BadMethod(&c2); +#endif +} + +// TODO(vtl): Test more things. + +} // namespace +} // namespace fml diff --git a/fml/synchronization/thread_checker.h b/fml/synchronization/thread_checker.h new file mode 100644 index 0000000000000..13a3e6824d0d3 --- /dev/null +++ b/fml/synchronization/thread_checker.h @@ -0,0 +1,71 @@ +// Copyright 2016 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// A class for checking that the current thread is/isn't the same as an initial +// thread. + +#ifndef FLUTTER_FML_SYNCHRONIZATION_THREAD_CHECKER_H_ +#define FLUTTER_FML_SYNCHRONIZATION_THREAD_CHECKER_H_ + +#include "flutter/fml/build_config.h" + +#if defined(OS_WIN) +#include +#else +#include +#endif + +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" + +namespace fml { + +// A simple class that records the identity of the thread that it was created +// on, and at later points can tell if the current thread is the same as its +// creation thread. This class is thread-safe. +// +// Note: Unlike Chromium's |base::ThreadChecker|, this is *not* Debug-only (so +// #ifdef it out if you want something Debug-only). (Rationale: Having a +// |CalledOnValidThread()| that lies in Release builds seems bad. Moreover, +// there's a small space cost to having even an empty class. ) +class ThreadChecker final { + public: +#if defined(OS_WIN) + ThreadChecker() : self_(GetCurrentThreadId()) {} + ~ThreadChecker() {} + + bool IsCreationThreadCurrent() const { return GetCurrentThreadId() == self_; } + + private: + const DWORD self_; + +#else + ThreadChecker() : self_(pthread_self()) {} + ~ThreadChecker() {} + + // Returns true if the current thread is the thread this object was created + // on and false otherwise. + bool IsCreationThreadCurrent() const { + return !!pthread_equal(pthread_self(), self_); + } + + private: + const pthread_t self_; +#endif + + FML_DISALLOW_COPY_AND_ASSIGN(ThreadChecker); +}; + +#ifndef NDEBUG +#define FML_DECLARE_THREAD_CHECKER(c) fml::ThreadChecker c +#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) \ + FML_DCHECK((c).IsCreationThreadCurrent()) +#else +#define FML_DECLARE_THREAD_CHECKER(c) +#define FML_DCHECK_CREATION_THREAD_IS_CURRENT(c) ((void)0) +#endif + +} // namespace fml + +#endif // FLUTTER_FML_SYNCHRONIZATION_THREAD_CHECKER_H_ diff --git a/fml/synchronization/thread_checker_unittest.cc b/fml/synchronization/thread_checker_unittest.cc new file mode 100644 index 0000000000000..46203e43adba4 --- /dev/null +++ b/fml/synchronization/thread_checker_unittest.cc @@ -0,0 +1,37 @@ +// Copyright 2016 The Fuchsia 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/thread_checker.h" + +#include + +#include "gtest/gtest.h" + +namespace fml { +namespace { + +TEST(ThreadCheckerTest, SameThread) { + ThreadChecker checker; + EXPECT_TRUE(checker.IsCreationThreadCurrent()); +} + +// Note: This test depends on |std::thread| being compatible with +// |pthread_self()|. +TEST(ThreadCheckerTest, DifferentThreads) { + ThreadChecker checker1; + EXPECT_TRUE(checker1.IsCreationThreadCurrent()); + + std::thread thread([&checker1]() { + ThreadChecker checker2; + EXPECT_TRUE(checker2.IsCreationThreadCurrent()); + EXPECT_FALSE(checker1.IsCreationThreadCurrent()); + }); + thread.join(); + + // Note: Without synchronization, we can't look at |checker2| from the main + // thread. +} + +} // namespace +} // namespace fml diff --git a/fml/synchronization/waitable_event.cc b/fml/synchronization/waitable_event.cc new file mode 100644 index 0000000000000..04052c60ed79d --- /dev/null +++ b/fml/synchronization/waitable_event.cc @@ -0,0 +1,167 @@ +// Copyright 2016 The Fuchsia 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/waitable_event.h" + +#include "flutter/fml/logging.h" +#include "flutter/fml/time/time_delta.h" +#include "flutter/fml/time/time_point.h" + +#include +#include + +namespace fml { + +// Waits with a timeout on |condition()|. Returns true on timeout, or false if +// |condition()| ever returns true. |condition()| should have no side effects +// (and will always be called with |*mutex| held). +template +bool WaitWithTimeoutImpl(std::unique_lock* locker, + std::condition_variable* cv, + ConditionFn condition, + TimeDelta timeout) { + FML_DCHECK(locker->owns_lock()); + + if (condition()) + return false; + + // We may get spurious wakeups. + TimeDelta wait_remaining = timeout; + TimePoint start = TimePoint::Now(); + while (true) { + if (std::cv_status::timeout == + cv->wait_for(*locker, + std::chrono::nanoseconds(wait_remaining.ToNanoseconds()))) + return true; // Definitely timed out. + + // We may have been awoken. + if (condition()) + return false; + + // Or the wakeup may have been spurious. + TimePoint now = TimePoint::Now(); + FML_DCHECK(now >= start); + TimeDelta elapsed = now - start; + // It's possible that we may have timed out anyway. + if (elapsed >= timeout) + return true; + + // Otherwise, recalculate the amount that we have left to wait. + wait_remaining = timeout - elapsed; + } +} + +// AutoResetWaitableEvent ------------------------------------------------------ + +void AutoResetWaitableEvent::Signal() { + std::lock_guard locker(mutex_); + signaled_ = true; + cv_.notify_one(); +} + +void AutoResetWaitableEvent::Reset() { + std::lock_guard locker(mutex_); + signaled_ = false; +} + +void AutoResetWaitableEvent::Wait() { + std::unique_lock locker(mutex_); + while (!signaled_) + cv_.wait(locker); + signaled_ = false; +} + +bool AutoResetWaitableEvent::WaitWithTimeout(TimeDelta timeout) { + std::unique_lock locker(mutex_); + + if (signaled_) { + signaled_ = false; + return false; + } + + // We may get spurious wakeups. + TimeDelta wait_remaining = timeout; + TimePoint start = TimePoint::Now(); + while (true) { + if (std::cv_status::timeout == + cv_.wait_for(locker, + std::chrono::nanoseconds(wait_remaining.ToNanoseconds()))) + return true; // Definitely timed out. + + // We may have been awoken. + if (signaled_) + break; + + // Or the wakeup may have been spurious. + TimePoint now = TimePoint::Now(); + FML_DCHECK(now >= start); + TimeDelta elapsed = now - start; + // It's possible that we may have timed out anyway. + if (elapsed >= timeout) + return true; + + // Otherwise, recalculate the amount that we have left to wait. + wait_remaining = timeout - elapsed; + } + + signaled_ = false; + return false; +} + +bool AutoResetWaitableEvent::IsSignaledForTest() { + std::lock_guard locker(mutex_); + return signaled_; +} + +// ManualResetWaitableEvent ---------------------------------------------------- + +void ManualResetWaitableEvent::Signal() { + std::lock_guard locker(mutex_); + signaled_ = true; + signal_id_++; + cv_.notify_all(); +} + +void ManualResetWaitableEvent::Reset() { + std::lock_guard locker(mutex_); + signaled_ = false; +} + +void ManualResetWaitableEvent::Wait() { + std::unique_lock locker(mutex_); + + if (signaled_) + return; + + auto last_signal_id = signal_id_; + do { + cv_.wait(locker); + } while (signal_id_ == last_signal_id); +} + +bool ManualResetWaitableEvent::WaitWithTimeout(TimeDelta timeout) { + std::unique_lock locker(mutex_); + + auto last_signal_id = signal_id_; + // Disable thread-safety analysis for the lambda: We could annotate it with + // |FML_EXCLUSIVE_LOCKS_REQUIRED(mutex_)|, but then the analyzer currently + // isn't able to figure out that |WaitWithTimeoutImpl()| calls it while + // holding |mutex_|. + bool rv = WaitWithTimeoutImpl( + &locker, &cv_, + [this, last_signal_id]() FML_NO_THREAD_SAFETY_ANALYSIS { + // Also check |signaled_| in case we're already signaled. + return signaled_ || signal_id_ != last_signal_id; + }, + timeout); + FML_DCHECK(rv || signaled_ || signal_id_ != last_signal_id); + return rv; +} + +bool ManualResetWaitableEvent::IsSignaledForTest() { + std::lock_guard locker(mutex_); + return signaled_; +} + +} // namespace fml diff --git a/fml/synchronization/waitable_event.h b/fml/synchronization/waitable_event.h new file mode 100644 index 0000000000000..60306aaa7897e --- /dev/null +++ b/fml/synchronization/waitable_event.h @@ -0,0 +1,128 @@ +// Copyright 2016 The Fuchsia 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 classes with functionality analogous to (but much more limited than) +// Chromium's |base::WaitableEvent|, which in turn provides functionality +// analogous to Windows's Event. (Unlike these two, we have separate types for +// the manual- and auto-reset versions.) + +#ifndef FLUTTER_FML_SYNCHRONIZATION_WAITABLE_EVENT_H_ +#define FLUTTER_FML_SYNCHRONIZATION_WAITABLE_EVENT_H_ + +#include +#include + +#include "flutter/fml/macros.h" +#include "flutter/fml/synchronization/thread_annotations.h" +#include "flutter/fml/time/time_delta.h" + +namespace fml { + +// AutoResetWaitableEvent ------------------------------------------------------ + +// An event that can be signaled and waited on. This version automatically +// returns to the unsignaled state after unblocking one waiter. (This is similar +// to Windows's auto-reset Event, which is also imitated by Chromium's +// auto-reset |base::WaitableEvent|. However, there are some limitations -- see +// |Signal()|.) This class is thread-safe. +class AutoResetWaitableEvent final { + public: + AutoResetWaitableEvent() {} + ~AutoResetWaitableEvent() {} + + // Put the event in the signaled state. Exactly one |Wait()| will be unblocked + // and the event will be returned to the unsignaled state. + // + // Notes (these are arguably bugs, but not worth working around): + // * That |Wait()| may be one that occurs on the calling thread, *after* the + // call to |Signal()|. + // * A |Signal()|, followed by a |Reset()|, may cause *no* waiting thread to + // be unblocked. + // * We rely on pthreads's queueing for picking which waiting thread to + // unblock, rather than enforcing FIFO ordering. + void Signal(); + + // Put the event into the unsignaled state. Generally, this is not recommended + // on an auto-reset event (see notes above). + void Reset(); + + // Blocks the calling thread until the event is signaled. Upon unblocking, the + // event is returned to the unsignaled state, so that (unless |Reset()| is + // called) each |Signal()| unblocks exactly one |Wait()|. + void Wait(); + + // Like |Wait()|, but with a timeout. Also unblocks if |timeout_microseconds| + // without being signaled in which case it returns true (otherwise, it returns + // false). + bool WaitWithTimeout(TimeDelta timeout); + + // Returns whether this event is in a signaled state or not. For use in tests + // only (in general, this is racy). Note: Unlike + // |base::WaitableEvent::IsSignaled()|, this doesn't reset the signaled state. + bool IsSignaledForTest(); + + private: + std::condition_variable cv_; + std::mutex mutex_; + + // True if this event is in the signaled state. + bool signaled_ = false; + + FML_DISALLOW_COPY_AND_ASSIGN(AutoResetWaitableEvent); +}; + +// ManualResetWaitableEvent ---------------------------------------------------- + +// An event that can be signaled and waited on. This version remains signaled +// until explicitly reset. (This is similar to Windows's manual-reset Event, +// which is also imitated by Chromium's manual-reset |base::WaitableEvent|.) +// This class is thread-safe. +class ManualResetWaitableEvent final { + public: + ManualResetWaitableEvent() {} + ~ManualResetWaitableEvent() {} + + // Put the event into the unsignaled state. + void Reset(); + + // Put the event in the signaled state. If this is a manual-reset event, it + // wakes all waiting threads (blocked on |Wait()| or |WaitWithTimeout()|). + // Otherwise, it wakes a single waiting thread (and returns to the unsignaled + // state), if any; if there are none, it remains signaled. + void Signal(); + + // Blocks the calling thread until the event is signaled. + void Wait(); + + // Like |Wait()|, but with a timeout. Also unblocks if |timeout_microseconds| + // without being signaled in which case it returns true (otherwise, it returns + // false). + bool WaitWithTimeout(TimeDelta timeout); + + // Returns whether this event is in a signaled state or not. For use in tests + // only (in general, this is racy). + bool IsSignaledForTest(); + + private: + std::condition_variable cv_; + std::mutex mutex_; + + // True if this event is in the signaled state. + bool signaled_ = false; + + // While |std::condition_variable::notify_all()| (|pthread_cond_broadcast()|) + // will wake all waiting threads, one has to deal with spurious wake-ups. + // Checking |signaled_| isn't sufficient, since another thread may have been + // awoken and (manually) reset |signaled_|. This is a counter that is + // incremented in |Signal()| before calling + // |std::condition_variable::notify_all()|. A waiting thread knows it was + // awoken if |signal_id_| is different from when it started waiting. + unsigned signal_id_ = 0u; + + FML_DISALLOW_COPY_AND_ASSIGN(ManualResetWaitableEvent); +}; + +} // namespace fml + +#endif // FLUTTER_FML_SYNCHRONIZATION_WAITABLE_EVENT_H_ diff --git a/fml/synchronization/waitable_event_unittest.cc b/fml/synchronization/waitable_event_unittest.cc new file mode 100644 index 0000000000000..92f40577dc9e5 --- /dev/null +++ b/fml/synchronization/waitable_event_unittest.cc @@ -0,0 +1,187 @@ +// Copyright 2016 The Fuchsia 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/waitable_event.h" + +#include +#include +#include + +#include +#include +#include +#include + +#include "flutter/fml/macros.h" +#include "gtest/gtest.h" + +#ifndef arraysize +template +char (&ArraySizeHelper(T (&array)[N]))[N]; +#define arraysize(array) (sizeof(ArraySizeHelper(array))) +#endif + +namespace fml { +namespace { + +constexpr TimeDelta kEpsilonTimeout = TimeDelta::FromMilliseconds(20); +constexpr TimeDelta kTinyTimeout = TimeDelta::FromMilliseconds(100); +constexpr TimeDelta kActionTimeout = TimeDelta::FromMilliseconds(10000); + +// Sleeps for a "very small" amount of time. + +void SleepFor(TimeDelta duration) { + std::this_thread::sleep_for( + std::chrono::nanoseconds(duration.ToNanoseconds())); +} + +void EpsilonRandomSleep() { + TimeDelta duration = + TimeDelta::FromMilliseconds(static_cast(rand()) % 20u); + SleepFor(duration); +} + +// AutoResetWaitableEvent ------------------------------------------------------ + +TEST(AutoResetWaitableEventTest, Basic) { + AutoResetWaitableEvent ev; + EXPECT_FALSE(ev.IsSignaledForTest()); + ev.Signal(); + EXPECT_TRUE(ev.IsSignaledForTest()); + ev.Wait(); + EXPECT_FALSE(ev.IsSignaledForTest()); + ev.Reset(); + EXPECT_FALSE(ev.IsSignaledForTest()); + ev.Signal(); + EXPECT_TRUE(ev.IsSignaledForTest()); + ev.Reset(); + EXPECT_FALSE(ev.IsSignaledForTest()); + EXPECT_TRUE(ev.WaitWithTimeout(TimeDelta::Zero())); + EXPECT_FALSE(ev.IsSignaledForTest()); + EXPECT_TRUE(ev.WaitWithTimeout(TimeDelta::FromMilliseconds(1))); + EXPECT_FALSE(ev.IsSignaledForTest()); + ev.Signal(); + EXPECT_TRUE(ev.IsSignaledForTest()); + EXPECT_FALSE(ev.WaitWithTimeout(TimeDelta::Zero())); + EXPECT_FALSE(ev.IsSignaledForTest()); + EXPECT_TRUE(ev.WaitWithTimeout(TimeDelta::FromMilliseconds(1))); + EXPECT_FALSE(ev.IsSignaledForTest()); + ev.Signal(); + EXPECT_FALSE(ev.WaitWithTimeout(TimeDelta::FromMilliseconds(1))); + EXPECT_FALSE(ev.IsSignaledForTest()); +} + +TEST(AutoResetWaitableEventTest, MultipleWaiters) { + AutoResetWaitableEvent ev; + + for (size_t i = 0u; i < 5u; i++) { + std::atomic_uint wake_count(0u); + std::vector threads; + for (size_t j = 0u; j < 4u; j++) { + threads.push_back(std::thread([&ev, &wake_count]() { + if (rand() % 2 == 0) + ev.Wait(); + else + EXPECT_FALSE(ev.WaitWithTimeout(kActionTimeout)); + wake_count.fetch_add(1u); + // Note: We can't say anything about the signaled state of |ev| here, + // since the main thread may have already signaled it again. + })); + } + + // Unfortunately, we can't really wait for the threads to be waiting, so we + // just sleep for a bit, and count on them having started and advanced to + // waiting. + SleepFor(kTinyTimeout + kTinyTimeout); + + for (size_t j = 0u; j < threads.size(); j++) { + unsigned old_wake_count = wake_count.load(); + EXPECT_EQ(j, old_wake_count); + + // Each |Signal()| should wake exactly one thread. + ev.Signal(); + + // Poll for |wake_count| to change. + while (wake_count.load() == old_wake_count) + SleepFor(kEpsilonTimeout); + + EXPECT_FALSE(ev.IsSignaledForTest()); + + // And once it's changed, wait a little longer, to see if any other + // threads are awoken (they shouldn't be). + SleepFor(kEpsilonTimeout); + + EXPECT_EQ(old_wake_count + 1u, wake_count.load()); + + EXPECT_FALSE(ev.IsSignaledForTest()); + } + + // Having done that, if we signal |ev| now, it should stay signaled. + ev.Signal(); + SleepFor(kEpsilonTimeout); + EXPECT_TRUE(ev.IsSignaledForTest()); + + for (auto& thread : threads) + thread.join(); + + ev.Reset(); + } +} + +// ManualResetWaitableEvent ---------------------------------------------------- + +TEST(ManualResetWaitableEventTest, Basic) { + ManualResetWaitableEvent ev; + EXPECT_FALSE(ev.IsSignaledForTest()); + ev.Signal(); + EXPECT_TRUE(ev.IsSignaledForTest()); + ev.Wait(); + EXPECT_TRUE(ev.IsSignaledForTest()); + ev.Reset(); + EXPECT_FALSE(ev.IsSignaledForTest()); + EXPECT_TRUE(ev.WaitWithTimeout(TimeDelta::Zero())); + EXPECT_FALSE(ev.IsSignaledForTest()); + EXPECT_TRUE(ev.WaitWithTimeout(TimeDelta::FromMilliseconds(1))); + EXPECT_FALSE(ev.IsSignaledForTest()); + ev.Signal(); + EXPECT_TRUE(ev.IsSignaledForTest()); + EXPECT_FALSE(ev.WaitWithTimeout(TimeDelta::Zero())); + EXPECT_TRUE(ev.IsSignaledForTest()); + EXPECT_FALSE(ev.WaitWithTimeout(TimeDelta::FromMilliseconds(1))); + EXPECT_TRUE(ev.IsSignaledForTest()); +} + +TEST(ManualResetWaitableEventTest, SignalMultiple) { + ManualResetWaitableEvent ev; + + for (size_t i = 0u; i < 10u; i++) { + for (size_t num_waiters = 1u; num_waiters < 5u; num_waiters++) { + std::vector threads; + for (size_t j = 0u; j < num_waiters; j++) { + threads.push_back(std::thread([&ev]() { + EpsilonRandomSleep(); + + if (rand() % 2 == 0) + ev.Wait(); + else + EXPECT_FALSE(ev.WaitWithTimeout(kActionTimeout)); + })); + } + + EpsilonRandomSleep(); + + ev.Signal(); + + // The threads will only terminate once they've successfully waited (or + // timed out). + for (auto& thread : threads) + thread.join(); + + ev.Reset(); + } + } +} + +} // namespace +} // namespace fml diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 09bfe5b0eb0f1..c8a178ad707e4 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -852,6 +852,7 @@ LIBRARY: engine ORIGIN: ../../../topaz/LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/fml/build_config.h +FILE: ../../../flutter/fml/closure.h FILE: ../../../flutter/fml/compiler_specific.h FILE: ../../../flutter/fml/eintr_wrapper.h FILE: ../../../flutter/fml/log_level.h @@ -870,6 +871,13 @@ FILE: ../../../flutter/fml/memory/weak_ptr.h FILE: ../../../flutter/fml/memory/weak_ptr_internal.cc FILE: ../../../flutter/fml/memory/weak_ptr_internal.h FILE: ../../../flutter/fml/memory/weak_ptr_unittest.cc +FILE: ../../../flutter/fml/synchronization/thread_annotations.h +FILE: ../../../flutter/fml/synchronization/thread_annotations_unittest.cc +FILE: ../../../flutter/fml/synchronization/thread_checker.h +FILE: ../../../flutter/fml/synchronization/thread_checker_unittest.cc +FILE: ../../../flutter/fml/synchronization/waitable_event.cc +FILE: ../../../flutter/fml/synchronization/waitable_event.h +FILE: ../../../flutter/fml/synchronization/waitable_event_unittest.cc FILE: ../../../flutter/fml/time/time_delta.h FILE: ../../../flutter/fml/time/time_point.cc FILE: ../../../flutter/fml/time/time_point.h From 7fb90810dfdf4eefd52a7d5283998d15eb88a5a4 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 16:43:13 -0700 Subject: [PATCH 0383/1190] Remove the only user of fxl::StringView in FML. (#5314) --- fml/paths.cc | 4 +++- fml/paths.h | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fml/paths.cc b/fml/paths.cc index 20c94e62fef4d..840e2116379fc 100644 --- a/fml/paths.cc +++ b/fml/paths.cc @@ -4,12 +4,14 @@ #include "flutter/fml/paths.h" +#include + #include "flutter/fml/build_config.h" namespace fml { namespace paths { -std::string JoinPaths(std::initializer_list components) { +std::string JoinPaths(std::initializer_list components) { std::stringstream stream; size_t i = 0; const size_t size = components.size(); diff --git a/fml/paths.h b/fml/paths.h index 0d4367654de4a..4e26ff818dd4f 100644 --- a/fml/paths.h +++ b/fml/paths.h @@ -8,14 +8,12 @@ #include #include -#include "lib/fxl/strings/string_view.h" - namespace fml { namespace paths { std::pair GetExecutableDirectoryPath(); -std::string JoinPaths(std::initializer_list components); +std::string JoinPaths(std::initializer_list components); } // namespace paths } // namespace fml From 5cba5774c6925230f82bd50d8a55855ab9831aa3 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 18 May 2018 17:04:36 -0700 Subject: [PATCH 0384/1190] Break the FXL from flutter/assets. (#5316) --- assets/asset_manager.cc | 3 +- assets/asset_manager.h | 13 +++---- assets/asset_resolver.h | 4 +- assets/directory_asset_bundle.cc | 4 +- assets/directory_asset_bundle.h | 6 +-- shell/common/engine.cc | 2 +- shell/common/engine.h | 4 +- shell/common/isolate_configuration.cc | 9 +++-- shell/common/isolate_configuration.h | 2 +- shell/common/run_configuration.cc | 8 ++-- shell/common/run_configuration.h | 6 +-- shell/common/shell.cc | 23 ++++++++--- .../platform/android/android_shell_holder.cc | 38 +++++++++---------- shell/platform/android/android_shell_holder.h | 2 +- .../android/platform_view_android_jni.cc | 6 +-- shell/testing/tester_main.cc | 2 +- 16 files changed, 71 insertions(+), 61 deletions(-) diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc index cdbe007a5ad0f..d7da9aeb87cc2 100644 --- a/assets/asset_manager.cc +++ b/assets/asset_manager.cc @@ -6,7 +6,6 @@ #include "flutter/assets/directory_asset_bundle.h" #include "flutter/glue/trace_event.h" -#include "lib/fxl/files/path.h" #ifdef ERROR #undef ERROR @@ -46,7 +45,7 @@ bool AssetManager::GetAsBuffer(const std::string& asset_name, return true; } } - FXL_DLOG(WARNING) << "Could not find asset: " << asset_name; + FML_DLOG(WARNING) << "Could not find asset: " << asset_name; return false; } diff --git a/assets/asset_manager.h b/assets/asset_manager.h index fc7f3ef05210e..2389ea87059fc 100644 --- a/assets/asset_manager.h +++ b/assets/asset_manager.h @@ -10,14 +10,13 @@ #include #include "flutter/assets/asset_resolver.h" -#include "lib/fxl/files/unique_fd.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/ref_counted.h" namespace blink { class AssetManager final : public AssetResolver, - public fxl::RefCountedThreadSafe { + public fml::RefCountedThreadSafe { public: void PushFront(std::unique_ptr resolver); @@ -37,9 +36,9 @@ class AssetManager final : public AssetResolver, ~AssetManager(); - FXL_DISALLOW_COPY_AND_ASSIGN(AssetManager); - FRIEND_MAKE_REF_COUNTED(AssetManager); - FRIEND_REF_COUNTED_THREAD_SAFE(AssetManager); + FML_DISALLOW_COPY_AND_ASSIGN(AssetManager); + FML_FRIEND_MAKE_REF_COUNTED(AssetManager); + FML_FRIEND_REF_COUNTED_THREAD_SAFE(AssetManager); }; } // namespace blink diff --git a/assets/asset_resolver.h b/assets/asset_resolver.h index 6cfe27961a9f4..1d70791c6c70a 100644 --- a/assets/asset_resolver.h +++ b/assets/asset_resolver.h @@ -8,7 +8,7 @@ #include #include -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace blink { @@ -24,7 +24,7 @@ class AssetResolver { std::vector* data) const = 0; private: - FXL_DISALLOW_COPY_AND_ASSIGN(AssetResolver); + FML_DISALLOW_COPY_AND_ASSIGN(AssetResolver); }; } // namespace blink diff --git a/assets/directory_asset_bundle.cc b/assets/directory_asset_bundle.cc index 8e5d4df2ab977..732161589d8aa 100644 --- a/assets/directory_asset_bundle.cc +++ b/assets/directory_asset_bundle.cc @@ -6,9 +6,9 @@ #include +#include "flutter/fml/eintr_wrapper.h" #include "flutter/fml/file.h" #include "flutter/fml/mapping.h" -#include "lib/fxl/files/eintr_wrapper.h" namespace blink { @@ -35,7 +35,7 @@ bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, } if (!is_valid_) { - FXL_DLOG(WARNING) << "Asset bundle was not valid."; + FML_DLOG(WARNING) << "Asset bundle was not valid."; return false; } diff --git a/assets/directory_asset_bundle.h b/assets/directory_asset_bundle.h index b594e1357fbe2..c3f231e0ae519 100644 --- a/assets/directory_asset_bundle.h +++ b/assets/directory_asset_bundle.h @@ -6,9 +6,9 @@ #define FLUTTER_ASSETS_DIRECTORY_ASSET_BUNDLE_H_ #include "flutter/assets/asset_resolver.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/unique_fd.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" namespace blink { @@ -31,7 +31,7 @@ class DirectoryAssetBundle : public AssetResolver { bool GetAsBuffer(const std::string& asset_name, std::vector* data) const override; - FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); + FML_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); }; } // namespace blink diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 4958e7445ef2f..175ebd54e94dc 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -70,7 +70,7 @@ fml::WeakPtr Engine::GetWeakPtr() const { } bool Engine::UpdateAssetManager( - fxl::RefPtr new_asset_manager) { + fml::RefPtr new_asset_manager) { if (asset_manager_ == new_asset_manager) { return false; } diff --git a/shell/common/engine.h b/shell/common/engine.h index edb1915a87a3a..65e907759fc4c 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -61,7 +61,7 @@ class Engine final : public blink::RuntimeDelegate { FXL_WARN_UNUSED_RESULT bool Restart(RunConfiguration configuration); - bool UpdateAssetManager(fxl::RefPtr asset_manager); + bool UpdateAssetManager(fml::RefPtr asset_manager); void BeginFrame(fxl::TimePoint frame_time); @@ -105,7 +105,7 @@ class Engine final : public blink::RuntimeDelegate { tonic::DartErrorHandleType load_script_error_; std::string initial_route_; blink::ViewportMetrics viewport_metrics_; - fxl::RefPtr asset_manager_; + fml::RefPtr asset_manager_; bool activity_running_; bool have_surface_; fml::WeakPtrFactory weak_factory_; diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc index eaf89b6ce333a..c971740568e97 100644 --- a/shell/common/isolate_configuration.cc +++ b/shell/common/isolate_configuration.cc @@ -92,7 +92,7 @@ class KernelListIsolateConfiguration final : public IsolateConfiguration { public: KernelListIsolateConfiguration( std::vector> kernel_pieces) - : kernel_pieces_(std::move(kernel_pieces)) {} + : kernel_pieces_(std::move(kernel_pieces)) {} // |shell::IsolateConfiguration| bool DoPrepareIsolate(blink::DartIsolate& isolate) override { @@ -119,7 +119,7 @@ class KernelListIsolateConfiguration final : public IsolateConfiguration { std::unique_ptr IsolateConfiguration::InferFromSettings( const blink::Settings& settings, - fxl::RefPtr asset_manager) { + fml::RefPtr asset_manager) { // Running in AOT mode. if (blink::DartVM::IsRunningPrecompiledCode()) { return CreateForPrecompiledCode(); @@ -174,8 +174,9 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( piece_path_end++; } - std::string piece_path(reinterpret_cast(&kernel_list[piece_path_start]), - piece_path_end - piece_path_start); + std::string piece_path( + reinterpret_cast(&kernel_list[piece_path_start]), + piece_path_end - piece_path_start); std::vector piece; if (!asset_manager->GetAsBuffer(piece_path, &piece)) { FXL_LOG(ERROR) << "Failed to load: " << piece_path; diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h index 67494407bbe6e..a0b9ebe2faec8 100644 --- a/shell/common/isolate_configuration.h +++ b/shell/common/isolate_configuration.h @@ -22,7 +22,7 @@ class IsolateConfiguration { public: static std::unique_ptr InferFromSettings( const blink::Settings& settings, - fxl::RefPtr asset_manager); + fml::RefPtr asset_manager); static std::unique_ptr CreateForPrecompiledCode(); diff --git a/shell/common/run_configuration.cc b/shell/common/run_configuration.cc index 8a2080ed79999..eb315f25e8280 100644 --- a/shell/common/run_configuration.cc +++ b/shell/common/run_configuration.cc @@ -14,7 +14,7 @@ namespace shell { RunConfiguration RunConfiguration::InferFromSettings( const blink::Settings& settings) { - auto asset_manager = fxl::MakeRefCounted(); + auto asset_manager = fml::MakeRefCounted(); asset_manager->PushBack(std::make_unique( fml::Duplicate(settings.assets_dir))); @@ -30,11 +30,11 @@ RunConfiguration RunConfiguration::InferFromSettings( RunConfiguration::RunConfiguration( std::unique_ptr configuration) : RunConfiguration(std::move(configuration), - fxl::MakeRefCounted()) {} + fml::MakeRefCounted()) {} RunConfiguration::RunConfiguration( std::unique_ptr configuration, - fxl::RefPtr asset_manager) + fml::RefPtr asset_manager) : isolate_configuration_(std::move(configuration)), asset_manager_(std::move(asset_manager)) {} @@ -60,7 +60,7 @@ void RunConfiguration::SetEntrypoint(std::string entrypoint) { entrypoint_ = std::move(entrypoint); } -fxl::RefPtr RunConfiguration::GetAssetManager() const { +fml::RefPtr RunConfiguration::GetAssetManager() const { return asset_manager_; } diff --git a/shell/common/run_configuration.h b/shell/common/run_configuration.h index 59aa07566685c..5d45d2a26bc09 100644 --- a/shell/common/run_configuration.h +++ b/shell/common/run_configuration.h @@ -25,7 +25,7 @@ class RunConfiguration { RunConfiguration(std::unique_ptr configuration); RunConfiguration(std::unique_ptr configuration, - fxl::RefPtr asset_manager); + fml::RefPtr asset_manager); RunConfiguration(RunConfiguration&&); @@ -37,7 +37,7 @@ class RunConfiguration { void SetEntrypoint(std::string entrypoint); - fxl::RefPtr GetAssetManager() const; + fml::RefPtr GetAssetManager() const; const std::string& GetEntrypoint() const; @@ -45,7 +45,7 @@ class RunConfiguration { private: std::unique_ptr isolate_configuration_; - fxl::RefPtr asset_manager_; + fml::RefPtr asset_manager_; std::string entrypoint_ = "main"; FXL_DISALLOW_COPY_AND_ASSIGN(RunConfiguration); diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 8f096d9a707a7..5d02f8fd19113 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -13,6 +13,8 @@ #include "flutter/assets/directory_asset_bundle.h" #include "flutter/fml/file.h" #include "flutter/fml/icu_util.h" +#include "flutter/fml/log_settings.h" +#include "flutter/fml/logging.h" #include "flutter/fml/message_loop.h" #include "flutter/glue/trace_event.h" #include "flutter/runtime/dart_vm.h" @@ -166,10 +168,21 @@ static void PerformInitializationTasks(const blink::Settings& settings) { std::call_once(gShellSettingsInitialization, [&settings] { RecordStartupTimestamp(); - fxl::LogSettings log_settings; - log_settings.min_log_level = - settings.verbose_logging ? fxl::LOG_INFO : fxl::LOG_ERROR; - fxl::SetLogSettings(log_settings); + // TODO(chinmaygarde): There are currently two loggers till the transition + // away from FXL is ongoing. Remove FXL when done. + { + fxl::LogSettings log_settings; + log_settings.min_log_level = + settings.verbose_logging ? fxl::LOG_INFO : fxl::LOG_ERROR; + fxl::SetLogSettings(log_settings); + } + + { + fml::LogSettings log_settings; + log_settings.min_log_level = + settings.verbose_logging ? fml::LOG_INFO : fml::LOG_ERROR; + fml::SetLogSettings(log_settings); + } if (settings.trace_skia) { InitSkiaEventTracer(settings.trace_skia); @@ -909,7 +922,7 @@ bool Shell::OnServiceProtocolSetAssetBundlePath( auto& allocator = response.GetAllocator(); response.SetObject(); - auto asset_manager = fxl::MakeRefCounted(); + auto asset_manager = fml::MakeRefCounted(); asset_manager->PushFront(std::make_unique( fml::OpenFile(params.at("assetDirectory").ToString().c_str(), diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index 15bfdc6ad48e9..2414e018ed982 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -84,25 +84,23 @@ AndroidShellHolder::AndroidShellHolder( is_valid_ = shell_ != nullptr; if (is_valid_) { - task_runners.GetGPUTaskRunner()->PostTask( - []() { - // Android describes -8 as "most important display threads, for - // compositing the screen and retrieving input events". Conservatively - // set the GPU thread to slightly lower priority than it. - if (::setpriority(PRIO_PROCESS, gettid(), -5) != 0) { - // Defensive fallback. Depending on the OEM, it may not be possible - // to set priority to -5. - if (::setpriority(PRIO_PROCESS, gettid(), -2) != 0) { - FXL_LOG(ERROR) << "Failed to set GPU task runner priority"; - } - } - }); - task_runners.GetUITaskRunner()->PostTask( - []() { - if (::setpriority(PRIO_PROCESS, gettid(), -1) != 0) { - FXL_LOG(ERROR) << "Failed to set UI task runner priority"; - } - }); + task_runners.GetGPUTaskRunner()->PostTask([]() { + // Android describes -8 as "most important display threads, for + // compositing the screen and retrieving input events". Conservatively + // set the GPU thread to slightly lower priority than it. + if (::setpriority(PRIO_PROCESS, gettid(), -5) != 0) { + // Defensive fallback. Depending on the OEM, it may not be possible + // to set priority to -5. + if (::setpriority(PRIO_PROCESS, gettid(), -2) != 0) { + FXL_LOG(ERROR) << "Failed to set GPU task runner priority"; + } + } + }); + task_runners.GetUITaskRunner()->PostTask([]() { + if (::setpriority(PRIO_PROCESS, gettid(), -1) != 0) { + FXL_LOG(ERROR) << "Failed to set UI task runner priority"; + } + }); } } @@ -184,7 +182,7 @@ fml::WeakPtr AndroidShellHolder::GetPlatformView() { } void AndroidShellHolder::UpdateAssetManager( - fxl::RefPtr asset_manager) { + fml::RefPtr asset_manager) { if (!IsValid() || !asset_manager) { return; } diff --git a/shell/platform/android/android_shell_holder.h b/shell/platform/android/android_shell_holder.h index 4bf42a776dfb0..0163d4bbdc1d0 100644 --- a/shell/platform/android/android_shell_holder.h +++ b/shell/platform/android/android_shell_holder.h @@ -41,7 +41,7 @@ class AndroidShellHolder { Rasterizer::Screenshot Screenshot(Rasterizer::ScreenshotType type, bool base64_encode); - void UpdateAssetManager(fxl::RefPtr asset_manager); + void UpdateAssetManager(fml::RefPtr asset_manager); private: const blink::Settings settings_; diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 9c16ebdd30cbf..20748b09aaf03 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -201,7 +201,7 @@ static void RunBundleAndSnapshot( jstring jEntrypoint, jboolean /* reuse runtime controller (unused) */, jobject jAssetManager) { - auto asset_manager = fxl::MakeRefCounted(); + auto asset_manager = fml::MakeRefCounted(); const auto bundlepath = fml::jni::JavaStringToString(env, jbundlepath); @@ -253,7 +253,7 @@ static void RunBundleAndSource(JNIEnv* env, jstring jBundlePath, jstring main, jstring packages) { - auto asset_manager = fxl::MakeRefCounted(); + auto asset_manager = fml::MakeRefCounted(); const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); @@ -304,7 +304,7 @@ void SetAssetBundlePathOnUI(JNIEnv* env, return; } - auto asset_manager = fxl::MakeRefCounted(); + auto asset_manager = fml::MakeRefCounted(); asset_manager->PushBack(std::move(directory_asset_bundle)); ANDROID_SHELL_HOLDER->UpdateAssetManager(std::move(asset_manager)); diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc index 5258d80a8659d..099774f61421a 100644 --- a/shell/testing/tester_main.cc +++ b/shell/testing/tester_main.cc @@ -156,7 +156,7 @@ int RunTester(const blink::Settings& settings, bool run_forever) { return EXIT_FAILURE; } - auto asset_manager = fxl::MakeRefCounted(); + auto asset_manager = fml::MakeRefCounted(); asset_manager->PushBack(std::make_unique( fml::Duplicate(settings.assets_dir))); asset_manager->PushBack( From b9adcfe87204692b0e95368c6184588961bb7417 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 18 May 2018 21:43:55 -0400 Subject: [PATCH 0385/1190] Roll src/third_party/skia/ ba5b5f517..da816f070 (1 commit) (#5318) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 63 +++++++++++---------- travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/DEPS b/DEPS index 8a839f697ed31..38722f5e82ce0 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ba5b5f5171680701d27c68f13e378eb5d539ae07', + 'skia_revision': 'da816f070842ec07f637efb30e2a2533bbe4bb35', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 4e2ee8e5d4f16..de8422ac17310 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -3419,6 +3419,38 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz + +Copyright 2017 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -4290,37 +4322,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. garnet topaz -Copyright 2017 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet -topaz - Copyright 2018 The Fuchsia Authors. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d330731712700..85540778dab66 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 57045b2e98d7ae56317ce4fd35cc9778 +Signature: 294851eec77266e384678e955dc9e84f UNUSED LICENSES: From 7c4410497f0d3230a6f194041642734aaf751b35 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 19 May 2018 07:07:55 -0400 Subject: [PATCH 0386/1190] Roll src/third_party/skia/ da816f070..3e1a77431 (1 commit) (#5319) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 38722f5e82ce0..a112370a05bf3 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'da816f070842ec07f637efb30e2a2533bbe4bb35', + 'skia_revision': '3e1a77431eea650171357e6d904c034a3ce78ca7', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 85540778dab66..71049b37803a1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 294851eec77266e384678e955dc9e84f +Signature: 498fc826f5a37c3a4cc273f398718767 UNUSED LICENSES: From 9b0677fb3b71778eaaf2610b8048a118bdd2afca Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 19 May 2018 15:54:55 -0400 Subject: [PATCH 0387/1190] Roll src/third_party/skia/ 3e1a77431..04d6ced50 (1 commit) (#5320) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a112370a05bf3..7efd1b9ef292e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3e1a77431eea650171357e6d904c034a3ce78ca7', + 'skia_revision': '04d6ced50cd88e4dd932704d977b78099f797e45', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 71049b37803a1..fbebd92016670 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 498fc826f5a37c3a4cc273f398718767 +Signature: d397dd66789302bc3b6d0a777a40b9fe UNUSED LICENSES: From e63046ac7ec4a2dcf7335b4a6f665f70d84b7465 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 20 May 2018 11:03:55 -0400 Subject: [PATCH 0388/1190] Roll src/third_party/skia/ 04d6ced50..da17f1e7d (1 commit) (#5321) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 7efd1b9ef292e..f61f93b335d0d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '04d6ced50cd88e4dd932704d977b78099f797e45', + 'skia_revision': 'da17f1e7df1d12798cc19bf7a751123b67bbba82', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 98f71367ca1c397e4eb06d7c98bfc52428322226 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 20 May 2018 14:28:56 -0400 Subject: [PATCH 0389/1190] Roll src/third_party/skia/ da17f1e7d..78a764860 (1 commit) (#5322) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index f61f93b335d0d..eb021865b21ff 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'da17f1e7df1d12798cc19bf7a751123b67bbba82', + 'skia_revision': '78a764860bddd4ac8a18db87aaf21fb00a636166', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 78495c1d2cf84265b004a81255b6df3932405e06 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 20 May 2018 17:58:56 -0400 Subject: [PATCH 0390/1190] Roll src/third_party/skia/ 78a764860..5191880cb (1 commit) (#5323) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index eb021865b21ff..785e8e0e0d523 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '78a764860bddd4ac8a18db87aaf21fb00a636166', + 'skia_revision': '5191880cbf3ee4d122b0d11b4945fbab0784fda7', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fbebd92016670..ed30b926aa1f6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d397dd66789302bc3b6d0a777a40b9fe +Signature: 555e6f80ac03c7cdb6b0915c6a6f9f30 UNUSED LICENSES: From c86b3b7c59c34d3615328b004d0b740c9cd84e7a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 20 May 2018 21:26:55 -0400 Subject: [PATCH 0391/1190] Roll src/third_party/skia/ 5191880cb..32a4910e5 (1 commit) (#5325) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 785e8e0e0d523..c514bff394b97 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5191880cbf3ee4d122b0d11b4945fbab0784fda7', + 'skia_revision': '32a4910e57b1fdd3c8671de1ee85e05ca21d079f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ed30b926aa1f6..fbebd92016670 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 555e6f80ac03c7cdb6b0915c6a6f9f30 +Signature: d397dd66789302bc3b6d0a777a40b9fe UNUSED LICENSES: From 537f8922c4aecaaa88a0abf0be7914f990373d49 Mon Sep 17 00:00:00 2001 From: cary-clark Date: Mon, 21 May 2018 09:04:51 -0400 Subject: [PATCH 0392/1190] remove Skia toString() use (#5326) Skia toString() is not maintained; the debugger that used it has been replaced. Replace usage with equivalent implementation. --- flow/debug_print.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/flow/debug_print.cc b/flow/debug_print.cc index 3311b9c2b43e3..4c54319e85edc 100644 --- a/flow/debug_print.cc +++ b/flow/debug_print.cc @@ -25,7 +25,9 @@ std::ostream& operator<<(std::ostream& os, const flow::MatrixDecomposition& m) { std::ostream& operator<<(std::ostream& os, const SkMatrix& m) { SkString string; - m.toString(&string); + string.printf( + "[%8.4f %8.4f %8.4f][%8.4f %8.4f %8.4f][%8.4f %8.4f %8.4f]", + m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8]); os << string.c_str(); return os; } From 946fd13a1c09d2ad48274f57f995c00fbaecc480 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 21 May 2018 09:50:56 -0400 Subject: [PATCH 0393/1190] Roll src/third_party/skia/ 32a4910e5..037be4e03 (1 commit) (#5327) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index c514bff394b97..0d316527df500 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '32a4910e57b1fdd3c8671de1ee85e05ca21d079f', + 'skia_revision': '037be4e032ef31d7bc0cf914c972af97c456b17f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From d2448888a11ab958beece5ef6df99c8d069d09db Mon Sep 17 00:00:00 2001 From: Siva Date: Mon, 21 May 2018 10:15:57 -0700 Subject: [PATCH 0394/1190] Roll Dart to version 97b6c2e09d6532eeb622d85f23109f3f3b6d2b61 (#5317) * Roll Dart to version 97b6c2e09d6532eeb622d85f23109f3f3b6d2b61 This dart roll includes the following changes: 97b6c2e09d Don't give Source and ResourceProvider to CompletionRequestImpl. 04816270fa Add Forest support for creating parenthesized conditions 7a90ed9b88 Tests for completion with nested blocks, functions, and methods. 353ddbaea1 Add Forest support for while statements 8d0bda43f3 Fix codesize regression from Cleanup after removing MirrorsData 802c25aff9 Add tests to test InstanceCreationExpressionImpl.canBeConst def6f6c86c Don't create linked groups when nothing was written. 0c2b349827 Blocks and variable declarations in Forest 5ecf69d90a [fasta] Use Object as defaultType if Object is the explicit bound 4bac17655d [kernel/vm] VM support for instantiate-to-bounds. a4494a7fb2 Make `mixin` and `interface` built-in identifiers. dc76aa34c7 Stop using a port to keep the isolate alive in async_helper. a16563931c [VM] Mark 3 more tests as pass, crash a5d4195b0b CHANGELOG entry for noSuchMethod change d49af06ce0 Fix for searching references to named parameters in hierarchy. c26435f18f [dart:io] Add length check assert to x509 code 6fee620564 Convert more IdentiferContext consts a6ad152315 Fix constant-related deprecation warnings in analyzer packages 3e8ca8e0a6 Improve class declaration header recovery ffd5a1914d Update top level function name identifier context 24f5ca0187 [fuchsia] Use Fuchsia prebuilts 1a2f317735 Update parse mixin to use computeType and add recovery tests 1d6619eba6 [infra] Upgrade checked in SDKs to 2.0.0-dev.55.0 76a30dd594 Initial implementation of 'execution.getSuggestions'. 510669a0b4 [VM] Address uncovered issues, mark test as passing abb1ee98f7 Move library related operations to DartFileEditBuilderImpl. Initialize enclosing elements into fields lazily. 7d5ebb937b A few more Analyzer/CFE type argument tests 11006c3bac Reland "[VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables" e7495e427c [dart:io] Adds X509Certificate.der and X509Certificate.pem 62ffedefdd Rewrite writing types to using existing writeXYZ() methods. e6fc78c87b Revert "Reland "[VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables"" d59745029a [fasta] Update expectation files after CL 50945 6fc4854e98 [fasta] Run instantiate-to-bound on functions 23b4a505ec Reland "[VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables" 23c8c4d101 [vm/kernel] Pass type variables through ActivationFrame for expression compilation. b827b70e89 Extract IdentifierContext.typeVariableContext into new subclass b7659e6d03 Improve typedef declaration recovery 7c1ae73a21 Fix a Dart 2 runtime bug in BodyBuilder 38cb4cbc0a [VM] Update status file to make hot-reload builders green 1be81b4a96 [VM] Skip vm/dart/appjit_test on opt-counter builder 4d22c0de58 [infra] Improve cycle time of dart2js builders 812189d3e7 Convert LargeIntAccessor to LargeIntAccessGenerator 5e98c49606 Convert ReadOnlyAccessor to ReadOnlyAccessGenerator 17e284fbc2 Convert DeferredAccessor to DeferredAccessGenerator d5719cae62 Small cleanup in compiler.dart 54173bf293 Move TypeMask cache to CommonMasks 78f348b3d5 Don't export types/masks.dart from types/types.dart d2d763411d Use AbstractValue in inference results. 1c0b52ccc0 Reapply "Cleanup after removing MirrorsData" with fix e491bc5d86 Allow to specify what dill file to initialize from 8101ee0479 [kernel] Remove unused GlobalIndexer from ast_to_binary.dart dc8e621451 [js_runtime] Avoid more casts 0ad2b1243d Use carbon copy buffer field instead of passing it around. 6d55ba3037 [dart2js] Remove checks from inlined static call sites 6363cf6d3d Add new handleParenthesizedCondition event 393a47441f fix #33138, local class name should not conflict with inline-JS in SDK 6c3a861f8f [dart2js] Check arguments declared with generic method type parameter 499c25d886 [fuchsia] Update FIDL include paths. d91af4625c Fix fix import URIs from file:// URIs on Windows. 53a51d17db Support for optional ImportPrefixGenerator to generate prefixes for new imports. 338a423416 Add Forest support for creating try statements 757ef3979c Revert "Revert "Revert "Don't do implicit new/const code generation with --preview-dart-2 enabled.""" * Update license. * barback has been removed. * Update license file. * Update license file. --- DEPS | 12 ++++-------- flutter_kernel_transformers/pubspec.yaml | 2 -- frontend_server/pubspec.yaml | 3 --- travis/licenses_golden/licenses_third_party | 2 +- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/DEPS b/DEPS index 0d316527df500..a284a5881bd21 100644 --- a/DEPS +++ b/DEPS @@ -31,11 +31,10 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '43635d3372253262cbf51e55b2ccfceae4f94682', + 'dart_revision': '97b6c2e09d6532eeb622d85f23109f3f3b6d2b61', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.6', - 'dart_barback_tag': '0.15.2+14', 'dart_bazel_worker_tag': 'v0.1.9', 'dart_boolean_selector_tag': '1.0.3', 'dart_boringssl_gen_rev': '344f455fd13d46f054726638e76026156ea73aa9', @@ -47,7 +46,7 @@ vars = { 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+2', - 'dart_dart_style_tag': '1.0.12', + 'dart_dart_style_tag': '1.0.14', 'dart_dartdoc_tag': 'v0.19.0', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', @@ -89,7 +88,7 @@ vars = { 'dart_stack_trace_tag': '1.9.2', 'dart_stream_channel_tag': '1.6.4', 'dart_string_scanner_tag': '1.0.2', - 'dart_test_tag': '0.12.30+1', + 'dart_test_tag': '0.12.38', 'dart_tuple_tag': 'v1.0.1', 'dart_typed_data_tag': '1.1.3', 'dart_usage_tag': '3.3.0', @@ -114,7 +113,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'e2b647d54ab988569411517fac2e1aa28eeb4f46', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '1e4fc3e8333b715dd091c1853578704471372cee', # Fuchsia compatibility # @@ -175,9 +174,6 @@ deps = { 'src/third_party/dart/third_party/pkg/async': Var('dart_git') + '/async.git' + '@' + Var('dart_async_tag'), - 'src/third_party/dart/third_party/pkg/barback': - Var('dart_git') + '/barback.git' + '@' + Var('dart_barback_tag'), - 'src/third_party/dart/third_party/pkg/bazel_worker': Var('dart_git') + '/bazel_worker.git' + '@' + Var('dart_bazel_worker_tag'), diff --git a/flutter_kernel_transformers/pubspec.yaml b/flutter_kernel_transformers/pubspec.yaml index 0ef451c2cc92a..65b2734b5c14b 100644 --- a/flutter_kernel_transformers/pubspec.yaml +++ b/flutter_kernel_transformers/pubspec.yaml @@ -50,8 +50,6 @@ dependency_overrides: analyzer: path: ../../third_party/dart/pkg/analyzer - barback: - path: ../../third_party/dart/third_party/pkg/barback boolean_selector: path: ../../third_party/dart/third_party/pkg/boolean_selector cli_util: diff --git a/frontend_server/pubspec.yaml b/frontend_server/pubspec.yaml index bb33fa85093f2..ecf382f755c62 100644 --- a/frontend_server/pubspec.yaml +++ b/frontend_server/pubspec.yaml @@ -26,7 +26,6 @@ dependencies: dev_dependencies: analyzer: any - barback: any boolean_selector: any cli_util: any csslib: any @@ -98,8 +97,6 @@ dependency_overrides: analyzer: path: ../../third_party/dart/pkg/analyzer - barback: - path: ../../third_party/dart/third_party/pkg/barback boolean_selector: path: ../../third_party/dart/third_party/pkg/boolean_selector cli_util: diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fbebd92016670..371c1ff7db56a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d397dd66789302bc3b6d0a777a40b9fe +Signature: 8cef2311961e171d21c317843d15be06 UNUSED LICENSES: From d800095721fa792a9ca403668fabf16473fb0ada Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 21 May 2018 13:59:37 -0400 Subject: [PATCH 0395/1190] Roll src/third_party/skia/ 037be4e03..4dc5a4540 (5 commits) (#5329) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 30 ++++++++++++++++ travis/licenses_golden/licenses_third_party | 39 +++++++++++++++++++-- 3 files changed, 68 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index a284a5881bd21..ba650be3d898e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '037be4e032ef31d7bc0cf914c972af97c456b17f', + 'skia_revision': '4dc5a454052e64227ecbfadd903f590d9361be08', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index de8422ac17310..08c8fb2c59582 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -10554,6 +10554,36 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- skia +Copyright 2018 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + NEON optimized code (C) COPYRIGHT 2009 Motorola Redistribution and use in source and binary forms, with or without diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 371c1ff7db56a..5227d9e52c970 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8cef2311961e171d21c317843d15be06 +Signature: 01ce57e5c543b4beabf9ef6c17f1453a UNUSED LICENSES: @@ -20736,6 +20736,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/core/SkFlattenablePriv.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/core/SkFlattenablePriv.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/src/core/SkMatrixImageFilter.cpp + ../../../third_party/skia/LICENSE @@ -21889,4 +21924,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 319 +Total license count: 320 From eb4d82355709ef91bbced2da2f2515c20740b995 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 21 May 2018 11:29:50 -0700 Subject: [PATCH 0396/1190] Re-add ACTION_LONG_CLICK for Android a11y (#5330) --- .../android/io/flutter/view/AccessibilityBridge.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index f422a5f7a39ec..57b171994d639 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -278,9 +278,19 @@ public boolean performAction(int virtualViewId, int action, Bundle arguments) { } switch (action) { case AccessibilityNodeInfo.ACTION_CLICK: { + // Note: TalkBack prior to Oreo doesn't use this handler and instead simulates a + // click event at the center of the SemanticsNode. Other a11y services might go + // through this handler though. mOwner.dispatchSemanticsAction(virtualViewId, Action.TAP); return true; } + case AccessibilityNodeInfo.ACTION_LONG_CLICK: { + // Note: TalkBack doesn't use this handler and instead simulates a long click event + // at the center of the SemanticsNode. Other a11y services might go through this + // handler though. + mOwner.dispatchSemanticsAction(virtualViewId, Action.LONG_PRESS); + return true; + } case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD: { if (object.hasAction(Action.SCROLL_UP)) { mOwner.dispatchSemanticsAction(virtualViewId, Action.SCROLL_UP); From 5ab81fdab319e80fca69592989a09ba96e6641a0 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Mon, 21 May 2018 14:41:56 -0400 Subject: [PATCH 0397/1190] Set fPreferExternalImagesOverES3 option in Skia (#5331) This causes Skia to fall back to the ES2 shading language when the GL driver doesn't clearly communicate that it supports the ES3 external image extension. Doing so ensures that video playback (which relies on external images) works on many more devices. --- shell/common/io_manager.cc | 4 ++++ shell/gpu/gpu_surface_gl.cc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/shell/common/io_manager.cc b/shell/common/io_manager.cc index 2b4523a46f11d..2d004fedb1656 100644 --- a/shell/common/io_manager.cc +++ b/shell/common/io_manager.cc @@ -23,6 +23,10 @@ sk_sp IOManager::CreateCompatibleResourceLoadingContext( // that feature, which will cause texture uploads to do CPU YUV conversion. options.fDisableGpuYUVConversion = true; + // To get video playback on the widest range of devices, we limit Skia to + // ES2 shading language when the ES3 external image extension is missing. + options.fPreferExternalImagesOverES3 = true; + if (auto context = GrContext::MakeGL(GrGLMakeNativeInterface(), options)) { // Do not cache textures created by the image decoder. These textures // should be deleted when they are no longer referenced by an SkImage. diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 11482e48f6099..317d2ba29f5cc 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -45,6 +45,10 @@ GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate) GrContextOptions options; options.fAvoidStencilBuffers = true; + // To get video playback on the widest range of devices, we limit Skia to + // ES2 shading language when the ES3 external image extension is missing. + options.fPreferExternalImagesOverES3 = true; + auto context = GrContext::MakeGL(GrGLMakeNativeInterface(), options); if (context == nullptr) { From 4d928e3fb5bd05030d7ffce9470e3313a2151862 Mon Sep 17 00:00:00 2001 From: ritesh-malav Date: Tue, 22 May 2018 05:46:41 +0530 Subject: [PATCH 0398/1190] Update README.md (#5238) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d38f7941de34a..30d9f7b573b1c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The Flutter Engine is a portable runtime for hosting [Flutter](https://flutter.io) applications. It implements Flutter's core libraries, including animation and graphics, file and network I/O, accessibility support, plugin architecture, and a Dart runtime and compile -toolchain. Most developers wil interact with Flutter via the [Flutter +toolchain. Most developers will interact with Flutter via the [Flutter Framework](https://github.com/flutter/flutter), which provides a modern, reactive framework, and a rich set of platform, layout and foundation widgets. From f876bd57106b527cf6ddc8c9a97d0beb4190f868 Mon Sep 17 00:00:00 2001 From: Yegor Date: Mon, 21 May 2018 17:44:23 -0700 Subject: [PATCH 0399/1190] split `children` into two ordered lists: traversal and hit test (#5091) * split `children` into two ordered lists: traversal and hit test * address comments * reduce node object byte size * link to DebugSemanticsDumpOrder --- lib/ui/semantics.dart | 71 +++++++++++-------- lib/ui/semantics/semantics_node.h | 4 +- lib/ui/semantics/semantics_update_builder.cc | 11 +-- lib/ui/semantics/semantics_update_builder.h | 4 +- .../io/flutter/view/AccessibilityBridge.java | 61 +++++++++------- .../platform/android/platform_view_android.cc | 14 ++-- .../framework/Source/accessibility_bridge.mm | 4 +- 7 files changed, 98 insertions(+), 71 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 09436ed7fae9f..14a94147ea629 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -434,11 +434,18 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { /// Update the information associated with the node with the given `id`. /// /// The semantics nodes form a tree, with the root of the tree always having - /// an id of zero. The `children` are the ids of the nodes that are immediate - /// children of this node. The system retains the nodes that are currently - /// reachable from the root. A given update need not contain information for - /// nodes that do not change in the update. If a node is not reachable from - /// the root after an update, the node will be discarded from the tree. + /// an id of zero. The `childrenInTraversalOrder` and `childrenInHitTestOrder` + /// are the ids of the nodes that are immediate children of this node. The + /// former enumerates children in traversal order, and the latter enumerates + /// the same children in the hit test order. The two lists must have the same + /// length and contain the same ids. They may only differ in the order the + /// ids are listed in. For more information about different child orders, see + /// [DebugSemanticsDumpOrder]. + /// + /// The system retains the nodes that are currently reachable from the root. + /// A given update need not contain information for nodes that do not change + /// in the update. If a node is not reachable from the root after an update, + /// the node will be discarded from the tree. /// /// The `flags` are a bit field of [SemanticsFlag]s that apply to this node. /// @@ -488,33 +495,39 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { String increasedValue, String decreasedValue, TextDirection textDirection, - int hitTestPosition, Float64List transform, + // TODO(yjbanov): remove after moving the framework to the new param names. Int32List children, + Int32List childrenInTraversalOrder, + Int32List childrenInHitTestOrder, }) { + childrenInTraversalOrder ??= children; + childrenInHitTestOrder ??= children; if (transform.length != 16) throw new ArgumentError('transform argument must have 16 entries.'); - _updateNode(id, - flags, - actions, - textSelectionBase, - textSelectionExtent, - scrollPosition, - scrollExtentMax, - scrollExtentMin, - rect.left, - rect.top, - rect.right, - rect.bottom, - label, - hint, - value, - increasedValue, - decreasedValue, - textDirection != null ? textDirection.index + 1 : 0, - hitTestPosition, - transform, - children,); + _updateNode( + id, + flags, + actions, + textSelectionBase, + textSelectionExtent, + scrollPosition, + scrollExtentMax, + scrollExtentMin, + rect.left, + rect.top, + rect.right, + rect.bottom, + label, + hint, + value, + increasedValue, + decreasedValue, + textDirection != null ? textDirection.index + 1 : 0, + transform, + childrenInTraversalOrder, + childrenInHitTestOrder, + ); } void _updateNode( int id, @@ -535,9 +548,9 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { String increasedValue, String decreasedValue, int textDirection, - int hitTestPosition, Float64List transform, - Int32List children, + Int32List childrenInTraversalOrder, + Int32List childrenInHitTestOrder, ) native 'SemanticsUpdateBuilder_updateNode'; /// Creates a [SemanticsUpdate] object that encapsulates the updates recorded diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index 55f2771c90979..3ddb431e90dc8 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -82,11 +82,11 @@ struct SemanticsNode { std::string increasedValue; std::string decreasedValue; int32_t textDirection = 0; // 0=unknown, 1=rtl, 2=ltr - int32_t hitTestPosition = -1; SkRect rect = SkRect::MakeEmpty(); SkMatrix44 transform = SkMatrix44(SkMatrix44::kIdentity_Constructor); - std::vector children; + std::vector childrenInTraversalOrder; + std::vector childrenInHitTestOrder; }; // Contains semantic nodes that need to be updated. diff --git a/lib/ui/semantics/semantics_update_builder.cc b/lib/ui/semantics/semantics_update_builder.cc index 2ff5568ec1c49..576967525b495 100644 --- a/lib/ui/semantics/semantics_update_builder.cc +++ b/lib/ui/semantics/semantics_update_builder.cc @@ -52,9 +52,9 @@ void SemanticsUpdateBuilder::updateNode(int id, std::string increasedValue, std::string decreasedValue, int textDirection, - int hitTestPosition, const tonic::Float64List& transform, - const tonic::Int32List& children) { + const tonic::Int32List& childrenInTraversalOrder, + const tonic::Int32List& childrenInHitTestOrder) { SemanticsNode node; node.id = id; node.flags = flags; @@ -71,10 +71,11 @@ void SemanticsUpdateBuilder::updateNode(int id, node.increasedValue = increasedValue; node.decreasedValue = decreasedValue; node.textDirection = textDirection; - node.hitTestPosition = hitTestPosition; node.transform.setColMajord(transform.data()); - node.children = std::vector( - children.data(), children.data() + children.num_elements()); + node.childrenInTraversalOrder = std::vector( + childrenInTraversalOrder.data(), childrenInTraversalOrder.data() + childrenInTraversalOrder.num_elements()); + node.childrenInHitTestOrder = std::vector( + childrenInHitTestOrder.data(), childrenInHitTestOrder.data() + childrenInHitTestOrder.num_elements()); nodes_[id] = node; } diff --git a/lib/ui/semantics/semantics_update_builder.h b/lib/ui/semantics/semantics_update_builder.h index 6f33330eaac4b..c4d4b277816dd 100644 --- a/lib/ui/semantics/semantics_update_builder.h +++ b/lib/ui/semantics/semantics_update_builder.h @@ -43,9 +43,9 @@ class SemanticsUpdateBuilder std::string increasedValue, std::string decreasedValue, int textDirection, - int hitTestPosition, const tonic::Float64List& transform, - const tonic::Int32List& children); + const tonic::Int32List& childrenInTraversalOrder, + const tonic::Int32List& childrenInHitTestOrder); fxl::RefPtr build(); diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 57b171994d639..a969b1bb6b443 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -259,8 +259,8 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { result.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS); } - if (object.children != null) { - for (SemanticsObject child : object.children) { + if (object.childrenInTraversalOrder != null) { + for (SemanticsObject child : object.childrenInTraversalOrder) { if (!child.hasFlag(Flag.IS_HIDDEN)) { result.addChild(mOwner, child.id); } @@ -760,7 +760,6 @@ private class SemanticsObject { String decreasedValue; String hint; TextDirection textDirection; - int hitTestPosition; boolean hadPreviousConfig = false; int previousFlags; @@ -779,7 +778,8 @@ private class SemanticsObject { private float[] transform; SemanticsObject parent; - List children; // In inverse hit test order (i.e. paint order). + List childrenInTraversalOrder; + List childrenInHitTestOrder; private boolean inverseTransformDirty = true; private float[] inverseTransform; @@ -813,12 +813,11 @@ boolean didScroll() { void log(String indent, boolean recursive) { Log.i(TAG, indent + "SemanticsObject id=" + id + " label=" + label + " actions=" + actions + " flags=" + flags + "\n" + indent + " +-- textDirection=" + textDirection + "\n"+ - indent + " +-- hitTestPosition=" + hitTestPosition + "\n"+ indent + " +-- rect.ltrb=(" + left + ", " + top + ", " + right + ", " + bottom + ")\n" + indent + " +-- transform=" + Arrays.toString(transform) + "\n"); - if (children != null && recursive) { + if (childrenInTraversalOrder != null && recursive) { String childIndent = indent + " "; - for (SemanticsObject child : children) { + for (SemanticsObject child : childrenInTraversalOrder) { child.log(childIndent, recursive); } } @@ -860,8 +859,6 @@ void updateWith(ByteBuffer buffer, String[] strings) { textDirection = TextDirection.fromInt(buffer.getInt()); - hitTestPosition = buffer.getInt(); - left = buffer.getFloat(); top = buffer.getFloat(); right = buffer.getFloat(); @@ -876,17 +873,29 @@ void updateWith(ByteBuffer buffer, String[] strings) { final int childCount = buffer.getInt(); if (childCount == 0) { - children = null; + childrenInTraversalOrder = null; + childrenInHitTestOrder = null; } else { - if (children == null) - children = new ArrayList(childCount); + if (childrenInTraversalOrder == null) + childrenInTraversalOrder = new ArrayList(childCount); + else + childrenInTraversalOrder.clear(); + + for (int i = 0; i < childCount; ++i) { + SemanticsObject child = getOrCreateObject(buffer.getInt()); + child.parent = this; + childrenInTraversalOrder.add(child); + } + + if (childrenInHitTestOrder == null) + childrenInHitTestOrder = new ArrayList(childCount); else - children.clear(); + childrenInHitTestOrder.clear(); for (int i = 0; i < childCount; ++i) { SemanticsObject child = getOrCreateObject(buffer.getInt()); child.parent = this; - children.add(child); + childrenInHitTestOrder.add(child); } } } @@ -912,10 +921,10 @@ SemanticsObject hitTest(float[] point) { final float y = point[1] / w; if (x < left || x >= right || y < top || y >= bottom) return null; - if (children != null) { + if (childrenInHitTestOrder != null) { final float[] transformedPoint = new float[4]; - for (int i = children.size() - 1; i >= 0; i -= 1) { - final SemanticsObject child = children.get(i); + for (int i = 0; i < childrenInHitTestOrder.size(); i += 1) { + final SemanticsObject child = childrenInHitTestOrder.get(i); if (child.hasFlag(Flag.IS_HIDDEN)) { continue; } @@ -951,9 +960,9 @@ void collectRoutes(List edges) { if (hasFlag(Flag.SCOPES_ROUTE)) { edges.add(this); } - if (children != null) { - for (int i = 0; i < children.size(); ++i) { - children.get(i).collectRoutes(edges); + if (childrenInTraversalOrder != null) { + for (int i = 0; i < childrenInTraversalOrder.size(); ++i) { + childrenInTraversalOrder.get(i).collectRoutes(edges); } } } @@ -966,9 +975,9 @@ String getRouteName() { return label; } } - if (children != null) { - for (int i = 0; i < children.size(); ++i) { - String newName = children.get(i).getRouteName(); + if (childrenInTraversalOrder != null) { + for (int i = 0; i < childrenInTraversalOrder.size(); ++i) { + String newName = childrenInTraversalOrder.get(i).getRouteName(); if (newName != null && !newName.isEmpty()) { return newName; } @@ -1029,9 +1038,9 @@ void updateRecursively(float[] ancestorTransform, Set visitedOb assert globalTransform != null; assert globalRect != null; - if (children != null) { - for (int i = 0; i < children.size(); ++i) { - children.get(i).updateRecursively(globalTransform, visitedObjects, forceUpdate); + if (childrenInTraversalOrder != null) { + for (int i = 0; i < childrenInTraversalOrder.size(); ++i) { + childrenInTraversalOrder.get(i).updateRecursively(globalTransform, visitedObjects, forceUpdate); } } } diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 8a241b0bfd26e..f5ab79542a09e 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -178,7 +178,7 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, // |shell::PlatformView| void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { - constexpr size_t kBytesPerNode = 36 * sizeof(int32_t); + constexpr size_t kBytesPerNode = 35 * sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t); JNIEnv* env = fml::jni::AttachCurrentThread(); @@ -190,7 +190,8 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { size_t num_bytes = 0; for (const auto& value : update) { num_bytes += kBytesPerNode; - num_bytes += value.second.children.size() * kBytesPerChild; + num_bytes += value.second.childrenInTraversalOrder.size() * kBytesPerChild; + num_bytes += value.second.childrenInHitTestOrder.size() * kBytesPerChild; } std::vector buffer(num_bytes); @@ -243,15 +244,18 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { strings.push_back(node.hint); } buffer_int32[position++] = node.textDirection; - buffer_int32[position++] = node.hitTestPosition; buffer_float32[position++] = node.rect.left(); buffer_float32[position++] = node.rect.top(); buffer_float32[position++] = node.rect.right(); buffer_float32[position++] = node.rect.bottom(); node.transform.asColMajorf(&buffer_float32[position]); position += 16; - buffer_int32[position++] = node.children.size(); - for (int32_t child : node.children) + + buffer_int32[position++] = node.childrenInTraversalOrder.size(); + for (int32_t child : node.childrenInTraversalOrder) + buffer_int32[position++] = child; + + for (int32_t child : node.childrenInHitTestOrder) buffer_int32[position++] = child; } diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index cf086608c663f..4a6d70655ed8c 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -490,11 +490,11 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { layoutChanged = layoutChanged || [object nodeWillCauseLayoutChange:&node]; scrollOccured = scrollOccured || [object nodeWillCauseScroll:&node]; [object setSemanticsNode:&node]; - const NSUInteger newChildCount = node.children.size(); + const NSUInteger newChildCount = node.childrenInTraversalOrder.size(); NSMutableArray* newChildren = [[[NSMutableArray alloc] initWithCapacity:newChildCount] autorelease]; for (NSUInteger i = 0; i < newChildCount; ++i) { - SemanticsObject* child = GetOrCreateObject(node.children[i], nodes); + SemanticsObject* child = GetOrCreateObject(node.childrenInTraversalOrder[i], nodes); child.parent = object; [newChildren addObject:child]; } From 615d6b18c9a305433645a7516c377cfd529dd121 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 22 May 2018 08:57:37 -0400 Subject: [PATCH 0400/1190] Roll src/third_party/skia/ 4dc5a4540..2c2a119f9 (20 commits) (#5335) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index ba650be3d898e..e94c510342677 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4dc5a454052e64227ecbfadd903f590d9361be08', + 'skia_revision': '2c2a119f945eedaced4bf081347a53f05cf0c39c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5227d9e52c970..12ad240a36a1c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 01ce57e5c543b4beabf9ef6c17f1453a +Signature: 13e8091faffd7972b258cb9a53e3af61 UNUSED LICENSES: @@ -17202,6 +17202,7 @@ FILE: ../../../third_party/skia/gm/makeRasterImage.cpp FILE: ../../../third_party/skia/gm/mandoline.cpp FILE: ../../../third_party/skia/gm/orientation.cpp FILE: ../../../third_party/skia/gm/pathmeasure.cpp +FILE: ../../../third_party/skia/gm/perspimages.cpp FILE: ../../../third_party/skia/gm/polygonoffset.cpp FILE: ../../../third_party/skia/gm/scaledemoji.cpp FILE: ../../../third_party/skia/gm/shadermaskfilter.cpp @@ -17263,6 +17264,7 @@ FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCSTLList.h FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h @@ -18228,7 +18230,6 @@ FILE: ../../../third_party/skia/gm/drrect.cpp FILE: ../../../third_party/skia/gm/emboss.cpp FILE: ../../../third_party/skia/gm/filterfastbounds.cpp FILE: ../../../third_party/skia/gm/glyph_pos.cpp -FILE: ../../../third_party/skia/gm/glyph_pos_align.cpp FILE: ../../../third_party/skia/gm/gradients_2pt_conical.cpp FILE: ../../../third_party/skia/gm/grayscalejpg.cpp FILE: ../../../third_party/skia/gm/imageblurtiled.cpp From fc0b9a67e73e78a23cbed41fbbda3ac3b86897f3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 22 May 2018 12:24:08 -0400 Subject: [PATCH 0401/1190] Roll src/third_party/skia/ 2c2a119f9..d6de89beb (7 commits) (#5336) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e94c510342677..271ea9e09b42a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2c2a119f945eedaced4bf081347a53f05cf0c39c', + 'skia_revision': 'd6de89bebdee9185b18c2da77c27371ad8318b4b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 12ad240a36a1c..fc909bab4ba55 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 13e8091faffd7972b258cb9a53e3af61 +Signature: 3e307f4237bc20d969a3e8c9cba463dd UNUSED LICENSES: From dee0a224aca552144a237f9c3e215c57064e00c6 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Tue, 22 May 2018 12:10:38 -0700 Subject: [PATCH 0402/1190] Support single-argument signature in Canvas.scale() (#5334) --- lib/ui/painting.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 4fad77563ea9e..6973bd2052eba 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2756,7 +2756,12 @@ class Canvas extends NativeFieldWrapperClass2 { /// Add an axis-aligned scale to the current transform, scaling by the first /// argument in the horizontal direction and the second in the vertical /// direction. - void scale(double sx, double sy) native 'Canvas_scale'; + /// + /// If [sy] is unspecified, [sx] will be used for the scale in both + /// directions. + void scale(double sx, [double sy]) => _scale(sx, sy ?? sx); + + void _scale(double sx, double sy) native 'Canvas_scale'; /// Add a rotation to the current transform. The argument is in radians clockwise. void rotate(double radians) native 'Canvas_rotate'; From 3d213f55485504118707fe771459c59d7a6e2502 Mon Sep 17 00:00:00 2001 From: Yegor Date: Tue, 22 May 2018 12:44:42 -0700 Subject: [PATCH 0403/1190] remove the no longer used `children` parameter (#5333) --- lib/ui/semantics.dart | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 14a94147ea629..da1255a0ec00b 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -496,13 +496,9 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { String decreasedValue, TextDirection textDirection, Float64List transform, - // TODO(yjbanov): remove after moving the framework to the new param names. - Int32List children, Int32List childrenInTraversalOrder, Int32List childrenInHitTestOrder, }) { - childrenInTraversalOrder ??= children; - childrenInHitTestOrder ??= children; if (transform.length != 16) throw new ArgumentError('transform argument must have 16 entries.'); _updateNode( From f0d62030d2657ed6691e63ff84f04950be3c217c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 22 May 2018 15:48:37 -0400 Subject: [PATCH 0404/1190] Roll src/third_party/skia/ d6de89beb..91dfa3b57 (9 commits) (#5338) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/DEPS b/DEPS index 271ea9e09b42a..b5adbc00000d4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd6de89bebdee9185b18c2da77c27371ad8318b4b', + 'skia_revision': '91dfa3b571f1048d70033385de2c0c8b4a07373f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fc909bab4ba55..77e95db3c95ae 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3e307f4237bc20d969a3e8c9cba463dd +Signature: baab1e3edc1b784488732fd727289171 UNUSED LICENSES: @@ -14146,9 +14146,6 @@ FILE: ../../../third_party/skia/src/core/SkColorSpace.cpp FILE: ../../../third_party/skia/src/core/SkColorSpacePriv.h FILE: ../../../third_party/skia/src/core/SkColorSpaceXform.cpp FILE: ../../../third_party/skia/src/core/SkColorSpaceXformPriv.h -FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_A2B.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_A2B.h -FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_Base.h FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.cpp FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.h FILE: ../../../third_party/skia/src/core/SkColorSpace_ICC.cpp @@ -17561,8 +17558,8 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-Coverage.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json @@ -17692,8 +17689,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Release-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Release-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Release-All-NativeFonts.json @@ -19987,7 +19984,6 @@ FILE: ../../../third_party/skia/include/utils/SkInterpolator.h FILE: ../../../third_party/skia/include/utils/SkParse.h FILE: ../../../third_party/skia/include/utils/SkParsePath.h FILE: ../../../third_party/skia/include/utils/SkRandom.h -FILE: ../../../third_party/skia/include/utils/SkTextBox.h FILE: ../../../third_party/skia/include/views/SkEvent.h FILE: ../../../third_party/skia/include/views/SkEventSink.h FILE: ../../../third_party/skia/include/views/SkKey.h @@ -20089,7 +20085,6 @@ FILE: ../../../third_party/skia/src/utils/SkBase64.h FILE: ../../../third_party/skia/src/utils/SkCamera.cpp FILE: ../../../third_party/skia/src/utils/SkParse.cpp FILE: ../../../third_party/skia/src/utils/SkParseColor.cpp -FILE: ../../../third_party/skia/src/utils/SkTextBox.cpp FILE: ../../../third_party/skia/src/views/SkEvent.cpp FILE: ../../../third_party/skia/src/views/SkEventSink.cpp FILE: ../../../third_party/skia/src/xml/SkDOM.cpp From b3e1d4dce6ef0ecc1c9b430c3e463ef75811c12c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 22 May 2018 19:12:37 -0400 Subject: [PATCH 0405/1190] Roll src/third_party/skia/ 91dfa3b57..2b8a0d184 (7 commits) (#5339) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b5adbc00000d4..fcd3c94474e79 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '91dfa3b571f1048d70033385de2c0c8b4a07373f', + 'skia_revision': '2b8a0d1844ed236259284fbc2efe08dab0ed539f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 77e95db3c95ae..5f46f22ea73b1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: baab1e3edc1b784488732fd727289171 +Signature: 7ea96de11395225b6deb956fa4348447 UNUSED LICENSES: From 4197e89d94f70d83faa4d44356d60152c01e83fb Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 22 May 2018 22:36:37 -0400 Subject: [PATCH 0406/1190] Roll src/third_party/skia/ 2b8a0d184..7257e22e4 (4 commits) (#5340) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index fcd3c94474e79..8f54b737f9314 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2b8a0d1844ed236259284fbc2efe08dab0ed539f', + 'skia_revision': '7257e22e43a56a5f4f772b687034580061cd011f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5f46f22ea73b1..71878f2eee56e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7ea96de11395225b6deb956fa4348447 +Signature: 5781565355cff7f8645e4ffb7b89a696 UNUSED LICENSES: @@ -14146,6 +14146,9 @@ FILE: ../../../third_party/skia/src/core/SkColorSpace.cpp FILE: ../../../third_party/skia/src/core/SkColorSpacePriv.h FILE: ../../../third_party/skia/src/core/SkColorSpaceXform.cpp FILE: ../../../third_party/skia/src/core/SkColorSpaceXformPriv.h +FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_A2B.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_A2B.h +FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_Base.h FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.cpp FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.h FILE: ../../../third_party/skia/src/core/SkColorSpace_ICC.cpp From 812423da5ea5f0a0e2d78e11c32a1c368f9ea554 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Wed, 23 May 2018 10:11:44 +0200 Subject: [PATCH 0407/1190] Restore functionality to run from .so file on Android (#5278) Flutter AOT builds can be done on Android using .so files (instead of separate instruction/data snapshots) using the `--build-shared-library` flag. Running from .so files stopped working after the engine refactoring in 58e84c8bf0, which this CL restores. Issue https://github.com/flutter/flutter/issues/17236 --- runtime/dart_snapshot.cc | 37 +++++++++++++++++++++++++++++++++++-- shell/common/switches.cc | 8 +++++++- 2 files changed, 42 insertions(+), 3 deletions(-) diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc index 4483ecd6c7404..1c47cffd2ff8c 100644 --- a/runtime/dart_snapshot.cc +++ b/runtime/dart_snapshot.cc @@ -21,6 +21,22 @@ const char* DartSnapshot::kIsolateDataSymbol = "kDartIsolateSnapshotData"; const char* DartSnapshot::kIsolateInstructionsSymbol = "kDartIsolateSnapshotInstructions"; +#if defined(OS_ANDROID) +// When assembling the .S file of the application, dart_bootstrap will prefix +// symbols via an `_` to ensure Mac's `dlsym()` can find it (Mac ABI prefixes C +// symbols with underscores). +// But Linux ABI does not prefix C symbols with underscores, so we have to +// explicitly look up the prefixed version. +#define SYMBOL_PREFIX "_" +#else +#define SYMBOL_PREFIX "" +#endif + +static const char* kVMDataSymbolSo = SYMBOL_PREFIX "kDartVmSnapshotData"; +static const char* kVMInstructionsSymbolSo = SYMBOL_PREFIX "kDartVmSnapshotInstructions"; +static const char* kIsolateDataSymbolSo = SYMBOL_PREFIX "kDartIsolateSnapshotData"; +static const char* kIsolateInstructionsSymbolSo = SYMBOL_PREFIX "kDartIsolateSnapshotInstructions"; + std::unique_ptr ResolveVMData(const Settings& settings) { if (settings.vm_snapshot_data_path.size() > 0) { if (auto source = DartSnapshotBuffer::CreateWithContentsOfFile( @@ -29,6 +45,14 @@ std::unique_ptr ResolveVMData(const Settings& settings) { } } + if (settings.application_library_path.size() > 0) { + auto shared_library = fml::NativeLibrary::Create(settings.application_library_path.c_str()); + if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( + shared_library, kVMDataSymbolSo)) { + return source; + } + } + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); return DartSnapshotBuffer::CreateWithSymbolInLibrary( loaded_process, DartSnapshot::kVMDataSymbol); @@ -47,7 +71,7 @@ std::unique_ptr ResolveVMInstructions( auto library = fml::NativeLibrary::Create(settings.application_library_path.c_str()); if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( - library, DartSnapshot::kVMInstructionsSymbol)) { + library, kVMInstructionsSymbolSo)) { return source; } } @@ -67,6 +91,15 @@ std::unique_ptr ResolveIsolateData( } } + if (settings.application_library_path.size() > 0) { + auto library = + fml::NativeLibrary::Create(settings.application_library_path.c_str()); + if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( + library, kIsolateDataSymbolSo)) { + return source; + } + } + auto loaded_process = fml::NativeLibrary::CreateForCurrentProcess(); return DartSnapshotBuffer::CreateWithSymbolInLibrary( loaded_process, DartSnapshot::kIsolateDataSymbol); @@ -86,7 +119,7 @@ std::unique_ptr ResolveIsolateInstructions( auto library = fml::NativeLibrary::Create(settings.application_library_path.c_str()); if (auto source = DartSnapshotBuffer::CreateWithSymbolInLibrary( - library, DartSnapshot::kIsolateInstructionsSymbol)) { + library, kIsolateInstructionsSymbolSo)) { return source; } } diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 9e76882418346..d53bdb1adfc6f 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -170,6 +170,10 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { command_line.GetOptionValue(FlagForSwitch(Switch::Packages), &settings.packages_file_path); + std::string aot_shared_library_path; + command_line.GetOptionValue(FlagForSwitch(Switch::AotSharedLibraryPath), + &aot_shared_library_path); + std::string aot_snapshot_path; command_line.GetOptionValue(FlagForSwitch(Switch::AotSnapshotPath), &aot_snapshot_path); @@ -191,7 +195,9 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { FlagForSwitch(Switch::AotIsolateSnapshotInstructions), &aot_isolate_snapshot_instr_filename); - if (aot_snapshot_path.size() > 0) { + if (aot_shared_library_path.size() > 0) { + settings.application_library_path = aot_shared_library_path; + } else if (aot_snapshot_path.size() > 0) { settings.vm_snapshot_data_path = fml::paths::JoinPaths( {aot_snapshot_path, aot_vm_snapshot_data_filename}); settings.vm_snapshot_instr_path = fml::paths::JoinPaths( From 24a48741b5ffdb34f815673e8f2dfc1b2d6dd089 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 23 May 2018 05:53:58 -0400 Subject: [PATCH 0408/1190] Roll src/third_party/skia/ 7257e22e4..4c77e817a (1 commit) (#5342) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 8f54b737f9314..05790a9c18c28 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7257e22e43a56a5f4f772b687034580061cd011f', + 'skia_revision': '4c77e817ab5d9e931f24968dde1e2524f6a59da3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 71878f2eee56e..25c091d33fd15 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5781565355cff7f8645e4ffb7b89a696 +Signature: fff13722614e422dfce4b2ca239d3ecb UNUSED LICENSES: From f55add40d6560ab8657e288a400060dd00db690a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 23 May 2018 09:24:37 -0400 Subject: [PATCH 0409/1190] Roll src/third_party/skia/ 4c77e817a..6747f5277 (2 commits) (#5343) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index 05790a9c18c28..c0a30c7b2ce0c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4c77e817ab5d9e931f24968dde1e2524f6a59da3', + 'skia_revision': '6747f52778135ee59debe52ac27d8f19333d75f2', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 25c091d33fd15..10ba59a30343d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: fff13722614e422dfce4b2ca239d3ecb +Signature: db18e92cd54a0415325976551fa6bff4 UNUSED LICENSES: @@ -14146,9 +14146,6 @@ FILE: ../../../third_party/skia/src/core/SkColorSpace.cpp FILE: ../../../third_party/skia/src/core/SkColorSpacePriv.h FILE: ../../../third_party/skia/src/core/SkColorSpaceXform.cpp FILE: ../../../third_party/skia/src/core/SkColorSpaceXformPriv.h -FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_A2B.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_A2B.h -FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_Base.h FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.cpp FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.h FILE: ../../../third_party/skia/src/core/SkColorSpace_ICC.cpp From dec097da7e1d20efcac976b01edc8396169382b1 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 23 May 2018 12:50:37 -0400 Subject: [PATCH 0410/1190] Roll src/third_party/skia/ 6747f5277..c494a708b (9 commits) (#5344) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index c0a30c7b2ce0c..7deb9f6640222 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6747f52778135ee59debe52ac27d8f19333d75f2', + 'skia_revision': 'c494a708be977a458a105318b2e2f439ab985ed8', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 10ba59a30343d..01bc87a9b9b84 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: db18e92cd54a0415325976551fa6bff4 +Signature: 84bda68def0d54dc1e31a3f20cee36ed UNUSED LICENSES: @@ -13973,8 +13973,6 @@ TYPE: LicenseType.bsd FILE: ../../../third_party/skia/bench/AndroidCodecBench.cpp FILE: ../../../third_party/skia/bench/AndroidCodecBench.h FILE: ../../../third_party/skia/bench/BlurOccludedRRectBench.cpp -FILE: ../../../third_party/skia/bench/ColorCodecBench.cpp -FILE: ../../../third_party/skia/bench/ColorCodecBench.h FILE: ../../../third_party/skia/bench/DrawLatticeBench.cpp FILE: ../../../third_party/skia/bench/EncoderBench.cpp FILE: ../../../third_party/skia/bench/GrMipMapBench.cpp @@ -17328,6 +17326,7 @@ FILE: ../../../third_party/skia/third_party/skcms/skcms.h FILE: ../../../third_party/skia/third_party/skcms/src/Curve.c FILE: ../../../third_party/skia/third_party/skcms/src/Curve.h FILE: ../../../third_party/skia/third_party/skcms/src/ICCProfile.c +FILE: ../../../third_party/skia/third_party/skcms/src/ICCProfile.h FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.c FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.h FILE: ../../../third_party/skia/third_party/skcms/src/Macros.h @@ -17668,6 +17667,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/failed FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Release-All-Android_CCPR_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Vulkan_Skpbench.json +FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/skqp_test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json From 8b0c5c1b99d15f0517287a5b023eb4fbcd3fd6a3 Mon Sep 17 00:00:00 2001 From: "P.Y. Laligand" Date: Wed, 23 May 2018 10:25:33 -0700 Subject: [PATCH 0411/1190] [fuchsia] Updated references to the gfx FIDL library. (#5341) --- flow/export_node.cc | 4 ++-- flow/scene_update_context.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flow/export_node.cc b/flow/export_node.cc index 27ab34030ca42..bf3d4a844d9f7 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -58,8 +58,8 @@ void ExportNode::Bind(SceneUpdateContext& context, container.AddChild(*node_); node_->SetTranslation(offset.x(), offset.y(), 0.f); node_->SetHitTestBehavior(hit_testable - ? gfx::HitTestBehavior::kDefault - : gfx::HitTestBehavior::kSuppress); + ? fuchsia::gfx::HitTestBehavior::kDefault + : fuchsia::gfx::HitTestBehavior::kSuppress); } } diff --git a/flow/scene_update_context.h b/flow/scene_update_context.h index ea1de247542ba..56927c7f5a337 100644 --- a/flow/scene_update_context.h +++ b/flow/scene_update_context.h @@ -119,10 +119,10 @@ class SceneUpdateContext { scenic_lib::Session* session() { return session_; } bool has_metrics() const { return !!metrics_; } - void set_metrics(gfx::MetricsPtr metrics) { + void set_metrics(fuchsia::gfx::MetricsPtr metrics) { metrics_ = std::move(metrics); } - const gfx::MetricsPtr& metrics() const { return metrics_; } + const fuchsia::gfx::MetricsPtr& metrics() const { return metrics_; } void AddChildScene(ExportNode* export_node, SkPoint offset, @@ -182,7 +182,7 @@ class SceneUpdateContext { scenic_lib::Session* const session_; SurfaceProducer* const surface_producer_; - gfx::MetricsPtr metrics_; + fuchsia::gfx::MetricsPtr metrics_; std::vector paint_tasks_; From 8f7a59b529d9397970770a29b9dfe042c12ddc54 Mon Sep 17 00:00:00 2001 From: "P.Y. Laligand" Date: Wed, 23 May 2018 12:09:23 -0700 Subject: [PATCH 0412/1190] [fuchsia] Use the real name for the GFX library... (#5346) --- flow/export_node.cc | 4 ++-- flow/scene_update_context.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flow/export_node.cc b/flow/export_node.cc index bf3d4a844d9f7..b4d37d61d65fc 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -58,8 +58,8 @@ void ExportNode::Bind(SceneUpdateContext& context, container.AddChild(*node_); node_->SetTranslation(offset.x(), offset.y(), 0.f); node_->SetHitTestBehavior(hit_testable - ? fuchsia::gfx::HitTestBehavior::kDefault - : fuchsia::gfx::HitTestBehavior::kSuppress); + ? fuchsia::ui::gfx::HitTestBehavior::kDefault + : fuchsia::ui::gfx::HitTestBehavior::kSuppress); } } diff --git a/flow/scene_update_context.h b/flow/scene_update_context.h index 56927c7f5a337..46210431ed8ee 100644 --- a/flow/scene_update_context.h +++ b/flow/scene_update_context.h @@ -119,10 +119,10 @@ class SceneUpdateContext { scenic_lib::Session* session() { return session_; } bool has_metrics() const { return !!metrics_; } - void set_metrics(fuchsia::gfx::MetricsPtr metrics) { + void set_metrics(fuchsia::ui::gfx::MetricsPtr metrics) { metrics_ = std::move(metrics); } - const fuchsia::gfx::MetricsPtr& metrics() const { return metrics_; } + const fuchsia::ui::gfx::MetricsPtr& metrics() const { return metrics_; } void AddChildScene(ExportNode* export_node, SkPoint offset, @@ -182,7 +182,7 @@ class SceneUpdateContext { scenic_lib::Session* const session_; SurfaceProducer* const surface_producer_; - fuchsia::gfx::MetricsPtr metrics_; + fuchsia::ui::gfx::MetricsPtr metrics_; std::vector paint_tasks_; From 84c2b5a03e52bd6227084d702651db2a3688a851 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 23 May 2018 16:17:37 -0400 Subject: [PATCH 0413/1190] Roll src/third_party/skia/ c494a708b..b3ba29c2e (10 commits) (#5347) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7deb9f6640222..c46ecdb62395a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c494a708be977a458a105318b2e2f439ab985ed8', + 'skia_revision': 'b3ba29c2e3a1c79db1cd810d77ec6c4001436089', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 01bc87a9b9b84..8d179db9ef069 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 84bda68def0d54dc1e31a3f20cee36ed +Signature: 68dab1c4af0c68e21508acc4199d30fb UNUSED LICENSES: From e0d4c4641386b8a81c7e9c3bc1a32172d81a785d Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 23 May 2018 15:56:28 -0700 Subject: [PATCH 0414/1190] Don't link the core snapshot in the Android engine. (#5348) Allows one to use a different core snapshot without a custom engine build by just packaging a different one in the APK. --- runtime/BUILD.gn | 9 ----- .../android/io/flutter/view/FlutterMain.java | 35 ++++++++++++------- shell/testing/BUILD.gn | 1 + 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 259f873cd5bae..73288f209113a 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -104,14 +104,6 @@ source_set("runtime") { public_configs = [ "$flutter_root:config" ] - # In AOT mode, precompiled snapshots contain the instruction buffer. - # Generation of the same requires all application specific script code to be - # specified up front. In such cases, there can be no generic snapshot. - # In Fuchsia, we load from a file instead of linking. - if (!flutter_aot && !is_fuchsia) { - deps += [ "$flutter_root/lib/snapshot" ] - } - if (flutter_runtime_mode != "release" && !is_fuchsia) { # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia # instead puts Observatory into the runner's package. @@ -135,7 +127,6 @@ executable("runtime_unittests") { ":runtime", ":runtime_fixtures", "$flutter_root/fml", - "$flutter_root/lib/snapshot", "$flutter_root/testing", "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", diff --git a/shell/platform/android/io/flutter/view/FlutterMain.java b/shell/platform/android/io/flutter/view/FlutterMain.java index 54d34294d41d0..445af70a090df 100644 --- a/shell/platform/android/io/flutter/view/FlutterMain.java +++ b/shell/platform/android/io/flutter/view/FlutterMain.java @@ -94,7 +94,7 @@ private static String fromFlutterAssets(String filePath) { private static boolean sInitialized = false; private static ResourceExtractor sResourceExtractor; - private static boolean sIsPrecompiled; + private static boolean sIsPrecompiledAsBlobs; private static boolean sIsPrecompiledAsSharedLibrary; private static Settings sSettings; @@ -201,19 +201,24 @@ public static void ensureInitializationComplete(Context applicationContext, Stri if (args != null) { Collections.addAll(shellArgs, args); } - if (sIsPrecompiled) { - shellArgs.add("--" + AOT_SNAPSHOT_PATH_KEY + "=" + - PathUtils.getDataDirectory(applicationContext)); + if (sIsPrecompiledAsSharedLibrary) { + shellArgs.add("--" + AOT_SHARED_LIBRARY_PATH + "=" + + new File(PathUtils.getDataDirectory(applicationContext), sAotSharedLibraryPath)); + } else { + if (sIsPrecompiledAsBlobs) { + shellArgs.add("--" + AOT_SNAPSHOT_PATH_KEY + "=" + + PathUtils.getDataDirectory(applicationContext)); + } else { + shellArgs.add("--cache-dir-path=" + + PathUtils.getCacheDirectory(applicationContext)); + + shellArgs.add("--" + AOT_SNAPSHOT_PATH_KEY + "=" + + PathUtils.getDataDirectory(applicationContext) + "/" + sFlutterAssetsDir); + } shellArgs.add("--" + AOT_VM_SNAPSHOT_DATA_KEY + "=" + sAotVmSnapshotData); shellArgs.add("--" + AOT_VM_SNAPSHOT_INSTR_KEY + "=" + sAotVmSnapshotInstr); shellArgs.add("--" + AOT_ISOLATE_SNAPSHOT_DATA_KEY + "=" + sAotIsolateSnapshotData); shellArgs.add("--" + AOT_ISOLATE_SNAPSHOT_INSTR_KEY + "=" + sAotIsolateSnapshotInstr); - } else if (sIsPrecompiledAsSharedLibrary) { - shellArgs.add("--" + AOT_SHARED_LIBRARY_PATH + "=" + - new File(PathUtils.getDataDirectory(applicationContext), sAotSharedLibraryPath)); - } else { - shellArgs.add("--cache-dir-path=" + - PathUtils.getCacheDirectory(applicationContext)); } if (sSettings.getLogTag() != null) { @@ -264,6 +269,10 @@ private static void initResources(Context applicationContext) { .addResources(SKY_RESOURCES) .addResource(fromFlutterAssets(sFlx)) .addResource(fromFlutterAssets(sSnapshotBlob)) + .addResource(fromFlutterAssets(sAotVmSnapshotData)) + .addResource(fromFlutterAssets(sAotVmSnapshotInstr)) + .addResource(fromFlutterAssets(sAotIsolateSnapshotData)) + .addResource(fromFlutterAssets(sAotIsolateSnapshotInstr)) .addResource(fromFlutterAssets(DEFAULT_KERNEL_BLOB)) .addResource(fromFlutterAssets(DEFAULT_PLATFORM_DILL)); if (sIsPrecompiledAsSharedLibrary) { @@ -298,21 +307,21 @@ private static Set listRootAssets(Context applicationContext) { private static void initAot(Context applicationContext) { Set assets = listRootAssets(applicationContext); - sIsPrecompiled = assets.containsAll(Arrays.asList( + sIsPrecompiledAsBlobs = assets.containsAll(Arrays.asList( sAotVmSnapshotData, sAotVmSnapshotInstr, sAotIsolateSnapshotData, sAotIsolateSnapshotInstr )); sIsPrecompiledAsSharedLibrary = assets.contains(sAotSharedLibraryPath); - if (sIsPrecompiled && sIsPrecompiledAsSharedLibrary) { + if (sIsPrecompiledAsBlobs && sIsPrecompiledAsSharedLibrary) { throw new RuntimeException( "Found precompiled app as shared library and as Dart VM snapshots."); } } public static boolean isRunningPrecompiledCode() { - return sIsPrecompiled || sIsPrecompiledAsSharedLibrary; + return sIsPrecompiledAsBlobs || sIsPrecompiledAsSharedLibrary; } public static String findAppBundlePath(Context applicationContext) { diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index e0384da218570..6c99a3466d9ae 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -17,6 +17,7 @@ executable("testing") { "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", + "$flutter_root/lib/snapshot", "$flutter_root/shell/common", "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", From 32443810e747d0a745bf5fd45bbdb1c5041a04fa Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 23 May 2018 16:03:47 -0700 Subject: [PATCH 0415/1190] Improve license script (#5345) --- tools/licenses/lib/licenses.dart | 3 +++ tools/licenses/lib/main.dart | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/licenses/lib/licenses.dart b/tools/licenses/lib/licenses.dart index 5d442efe550c0..441bc5cd7ee1e 100644 --- a/tools/licenses/lib/licenses.dart +++ b/tools/licenses/lib/licenses.dart @@ -19,6 +19,7 @@ LicenseType convertLicenseNameToType(String name) { switch (name) { case 'Apache': case 'apache-license-2.0': + case 'LICENSE-APACHE-2.0.txt': return LicenseType.apache; case 'BSD': case 'BSD.txt': @@ -38,6 +39,8 @@ LicenseType convertLicenseNameToType(String name) { return LicenseType.apsl; case 'OpenSSL': return LicenseType.openssl; + case 'LICENSE.MPLv2': + return LicenseType.mpl; // common file names that don't say what the type is case 'COPYING': case 'COPYING.txt': diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index 59443943a3683..36c650cd46f89 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -882,7 +882,8 @@ class RepositoryDirectory extends RepositoryEntry implements LicenseSource { } bool shouldRecurse(fs.IoNode entry) { - return entry.name != '.git' && + return entry.name != '.cipd' && + entry.name != '.git' && entry.name != '.github' && entry.name != '.gitignore' && entry.name != 'test' && From 47f4a2aad47de15357ae7d0bb6637e54ebe025aa Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 23 May 2018 16:05:15 -0700 Subject: [PATCH 0416/1190] Remove assert for unsupported SemanticsEvents (#5349) Not all platforms are expected to handle all SemanticsEvents. Therefore, it is ok to just drop unsupported events on the floor. --- shell/platform/android/io/flutter/view/AccessibilityBridge.java | 2 -- .../darwin/ios/framework/Source/accessibility_bridge.mm | 2 -- 2 files changed, 4 deletions(-) diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index a969b1bb6b443..ebf19111b6c7d 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -691,8 +691,6 @@ public void onMessage(Object message, BasicMessageChannel.Reply reply) { e.getText().add((String) data.get("message")); sendAccessibilityEvent(e); } - default: - assert false; } } diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 4a6d70655ed8c..dcfbf7dcfebf4 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -614,8 +614,6 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { if ([type isEqualToString:@"announce"]) { NSString* message = annotatedEvent[@"data"][@"message"]; UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, message); - } else { - NSCAssert(NO, @"Invalid event type %@", type); } } From 2e9ff1f09a600b3fbd29903a33c7bd45bd3c51bf Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 23 May 2018 16:11:57 -0700 Subject: [PATCH 0417/1190] Revert "Don't link the core snapshot in the Android engine. (#5348)" (#5352) This reverts commit e0d4c4641386b8a81c7e9c3bc1a32172d81a785d. --- runtime/BUILD.gn | 9 +++++ .../android/io/flutter/view/FlutterMain.java | 35 +++++++------------ shell/testing/BUILD.gn | 1 - 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 73288f209113a..259f873cd5bae 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -104,6 +104,14 @@ source_set("runtime") { public_configs = [ "$flutter_root:config" ] + # In AOT mode, precompiled snapshots contain the instruction buffer. + # Generation of the same requires all application specific script code to be + # specified up front. In such cases, there can be no generic snapshot. + # In Fuchsia, we load from a file instead of linking. + if (!flutter_aot && !is_fuchsia) { + deps += [ "$flutter_root/lib/snapshot" ] + } + if (flutter_runtime_mode != "release" && !is_fuchsia) { # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia # instead puts Observatory into the runner's package. @@ -127,6 +135,7 @@ executable("runtime_unittests") { ":runtime", ":runtime_fixtures", "$flutter_root/fml", + "$flutter_root/lib/snapshot", "$flutter_root/testing", "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", diff --git a/shell/platform/android/io/flutter/view/FlutterMain.java b/shell/platform/android/io/flutter/view/FlutterMain.java index 445af70a090df..54d34294d41d0 100644 --- a/shell/platform/android/io/flutter/view/FlutterMain.java +++ b/shell/platform/android/io/flutter/view/FlutterMain.java @@ -94,7 +94,7 @@ private static String fromFlutterAssets(String filePath) { private static boolean sInitialized = false; private static ResourceExtractor sResourceExtractor; - private static boolean sIsPrecompiledAsBlobs; + private static boolean sIsPrecompiled; private static boolean sIsPrecompiledAsSharedLibrary; private static Settings sSettings; @@ -201,24 +201,19 @@ public static void ensureInitializationComplete(Context applicationContext, Stri if (args != null) { Collections.addAll(shellArgs, args); } - if (sIsPrecompiledAsSharedLibrary) { - shellArgs.add("--" + AOT_SHARED_LIBRARY_PATH + "=" + - new File(PathUtils.getDataDirectory(applicationContext), sAotSharedLibraryPath)); - } else { - if (sIsPrecompiledAsBlobs) { - shellArgs.add("--" + AOT_SNAPSHOT_PATH_KEY + "=" + - PathUtils.getDataDirectory(applicationContext)); - } else { - shellArgs.add("--cache-dir-path=" + - PathUtils.getCacheDirectory(applicationContext)); - - shellArgs.add("--" + AOT_SNAPSHOT_PATH_KEY + "=" + - PathUtils.getDataDirectory(applicationContext) + "/" + sFlutterAssetsDir); - } + if (sIsPrecompiled) { + shellArgs.add("--" + AOT_SNAPSHOT_PATH_KEY + "=" + + PathUtils.getDataDirectory(applicationContext)); shellArgs.add("--" + AOT_VM_SNAPSHOT_DATA_KEY + "=" + sAotVmSnapshotData); shellArgs.add("--" + AOT_VM_SNAPSHOT_INSTR_KEY + "=" + sAotVmSnapshotInstr); shellArgs.add("--" + AOT_ISOLATE_SNAPSHOT_DATA_KEY + "=" + sAotIsolateSnapshotData); shellArgs.add("--" + AOT_ISOLATE_SNAPSHOT_INSTR_KEY + "=" + sAotIsolateSnapshotInstr); + } else if (sIsPrecompiledAsSharedLibrary) { + shellArgs.add("--" + AOT_SHARED_LIBRARY_PATH + "=" + + new File(PathUtils.getDataDirectory(applicationContext), sAotSharedLibraryPath)); + } else { + shellArgs.add("--cache-dir-path=" + + PathUtils.getCacheDirectory(applicationContext)); } if (sSettings.getLogTag() != null) { @@ -269,10 +264,6 @@ private static void initResources(Context applicationContext) { .addResources(SKY_RESOURCES) .addResource(fromFlutterAssets(sFlx)) .addResource(fromFlutterAssets(sSnapshotBlob)) - .addResource(fromFlutterAssets(sAotVmSnapshotData)) - .addResource(fromFlutterAssets(sAotVmSnapshotInstr)) - .addResource(fromFlutterAssets(sAotIsolateSnapshotData)) - .addResource(fromFlutterAssets(sAotIsolateSnapshotInstr)) .addResource(fromFlutterAssets(DEFAULT_KERNEL_BLOB)) .addResource(fromFlutterAssets(DEFAULT_PLATFORM_DILL)); if (sIsPrecompiledAsSharedLibrary) { @@ -307,21 +298,21 @@ private static Set listRootAssets(Context applicationContext) { private static void initAot(Context applicationContext) { Set assets = listRootAssets(applicationContext); - sIsPrecompiledAsBlobs = assets.containsAll(Arrays.asList( + sIsPrecompiled = assets.containsAll(Arrays.asList( sAotVmSnapshotData, sAotVmSnapshotInstr, sAotIsolateSnapshotData, sAotIsolateSnapshotInstr )); sIsPrecompiledAsSharedLibrary = assets.contains(sAotSharedLibraryPath); - if (sIsPrecompiledAsBlobs && sIsPrecompiledAsSharedLibrary) { + if (sIsPrecompiled && sIsPrecompiledAsSharedLibrary) { throw new RuntimeException( "Found precompiled app as shared library and as Dart VM snapshots."); } } public static boolean isRunningPrecompiledCode() { - return sIsPrecompiledAsBlobs || sIsPrecompiledAsSharedLibrary; + return sIsPrecompiled || sIsPrecompiledAsSharedLibrary; } public static String findAppBundlePath(Context applicationContext) { diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index 6c99a3466d9ae..e0384da218570 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -17,7 +17,6 @@ executable("testing") { "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", - "$flutter_root/lib/snapshot", "$flutter_root/shell/common", "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", From 87944d84a3f5d5b0f7a48a190d9bd4a3c379ebd4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 23 May 2018 19:42:37 -0400 Subject: [PATCH 0418/1190] Roll src/third_party/skia/ b3ba29c2e..13235d896 (5 commits) (#5354) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c46ecdb62395a..5a045675ca616 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b3ba29c2e3a1c79db1cd810d77ec6c4001436089', + 'skia_revision': '13235d8966e4242ef69264aa76ad71ac4021e506', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8d179db9ef069..76f887b472892 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 68dab1c4af0c68e21508acc4199d30fb +Signature: 2d46bf451e1f1d55a44c585ee82327af UNUSED LICENSES: From 1ef8cd2f1145b9aad4392dd831fc2bbbfa873c70 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Wed, 23 May 2018 16:53:20 -0700 Subject: [PATCH 0419/1190] Use drawImage for picture layer cache (#5315) Fixes 1. https://github.com/flutter/flutter/issues/12148 2. most part of https://github.com/flutter/flutter/issues/17731 except some tiny AA diffs. --- flow/debug_print.cc | 10 +++------ flow/layers/picture_layer.cc | 21 ++++++++++--------- flow/raster_cache.cc | 40 +++++++++++++++++------------------- flow/raster_cache.h | 34 +++++++++++++++++------------- flow/raster_cache_key.h | 26 +++++++++++++++-------- 5 files changed, 70 insertions(+), 61 deletions(-) diff --git a/flow/debug_print.cc b/flow/debug_print.cc index 4c54319e85edc..6326153aaa73e 100644 --- a/flow/debug_print.cc +++ b/flow/debug_print.cc @@ -73,13 +73,9 @@ std::ostream& operator<<(std::ostream& os, const SkPoint& r) { } std::ostream& operator<<(std::ostream& os, const flow::RasterCacheKey& k) { - os << "Picture: " << k.picture_id() << " Scale: " << k.scale_key().width() - << ", " << k.scale_key().height() -#if defined(OS_FUCHSIA) - << " Metrics scale: (" << k.metrics_scale_x() << ", " - << k.metrics_scale_y() << ")" -#endif - ; + SkString matrix_string; + k.matrix().toString(&matrix_string); + os << "Picture: " << k.picture_id() << " matrix: " << matrix_string.c_str(); return os; } diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index 622e48a005bbe..bef944e7f34a9 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -16,8 +16,13 @@ void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { SkPicture* sk_picture = picture(); if (auto cache = context->raster_cache) { + SkMatrix ctm = matrix; + ctm.postTranslate(offset_.x(), offset_.y()); +#ifndef SUPPORT_FRACTIONAL_TRANSLATION + ctm = RasterCache::GetIntegralTransCTM(ctm); +#endif raster_cache_result_ = cache->GetPrerolledImage( - context->gr_context, sk_picture, matrix, context->dst_color_space, + context->gr_context, sk_picture, ctm, context->dst_color_space, is_complex_, will_change_); } else { raster_cache_result_ = RasterCacheResult(); @@ -34,17 +39,13 @@ void PictureLayer::Paint(PaintContext& context) const { SkAutoCanvasRestore save(&context.canvas, true); context.canvas.translate(offset_.x(), offset_.y()); +#ifndef SUPPORT_FRACTIONAL_TRANSLATION + context.canvas.setMatrix( + RasterCache::GetIntegralTransCTM(context.canvas.getTotalMatrix())); +#endif if (raster_cache_result_.is_valid()) { - SkPaint paint; - paint.setFilterQuality(kLow_SkFilterQuality); - context.canvas.drawImageRect( - raster_cache_result_.image(), // image - raster_cache_result_.source_rect(), // source - raster_cache_result_.destination_rect(), // destination - &paint, // paint - SkCanvas::kStrict_SrcRectConstraint // source constraint - ); + raster_cache_result_.draw(context.canvas); } else { context.canvas.drawPicture(picture()); } diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 11a86729b489b..afd3d27dab254 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -17,6 +17,15 @@ namespace flow { +void RasterCacheResult::draw(SkCanvas& canvas) const { + SkAutoCanvasRestore auto_restore(&canvas, false); + SkIRect bounds = + RasterCache::GetDeviceBounds(logical_rect_, canvas.getTotalMatrix()); + FXL_DCHECK(bounds.size() == image_->dimensions()); + canvas.resetMatrix(); + canvas.drawImage(image_, bounds.fLeft, bounds.fTop); +} + RasterCache::RasterCache(size_t threshold) : threshold_(threshold), checkerboard_images_(false), weak_factory_(this) {} @@ -70,23 +79,16 @@ static bool IsPictureWorthRasterizing(SkPicture* picture, RasterCacheResult RasterizePicture(SkPicture* picture, GrContext* context, - const MatrixDecomposition& matrix, + const SkMatrix& ctm, SkColorSpace* dst_color_space, bool checkerboard) { TRACE_EVENT0("flutter", "RasterCachePopulate"); - const SkVector3& scale = matrix.scale(); - const SkRect logical_rect = picture->cullRect(); + SkIRect cache_rect = RasterCache::GetDeviceBounds(logical_rect, ctm); - const SkRect physical_rect = - SkRect::MakeWH(std::fabs(logical_rect.width() * scale.x()), - std::fabs(logical_rect.height() * scale.y())); - - const SkImageInfo image_info = SkImageInfo::MakeN32Premul( - std::ceil(physical_rect.width()), // physical width - std::ceil(physical_rect.height()) // physical height - ); + const SkImageInfo image_info = + SkImageInfo::MakeN32Premul(cache_rect.width(), cache_rect.height()); sk_sp surface = context @@ -108,19 +110,15 @@ RasterCacheResult RasterizePicture(SkPicture* picture, } canvas->clear(SK_ColorTRANSPARENT); - canvas->scale(std::abs(scale.x()), std::abs(scale.y())); - canvas->translate(-logical_rect.left(), -logical_rect.top()); + canvas->translate(-cache_rect.left(), -cache_rect.top()); + canvas->concat(ctm); canvas->drawPicture(picture); if (checkerboard) { DrawCheckerboard(canvas, logical_rect); } - return { - surface->makeImageSnapshot(), // image - physical_rect, // source rect - logical_rect // destination rect - }; + return {surface->makeImageSnapshot(), logical_rect}; } static inline size_t ClampSize(size_t value, size_t min, size_t max) { @@ -156,7 +154,7 @@ RasterCacheResult RasterCache::GetPrerolledImage( return {}; } - RasterCacheKey cache_key(*picture, matrix); + RasterCacheKey cache_key(*picture, transformation_matrix); Entry& entry = cache_[cache_key]; entry.access_count = ClampSize(entry.access_count + 1, 0, threshold_); @@ -168,8 +166,8 @@ RasterCacheResult RasterCache::GetPrerolledImage( } if (!entry.image.is_valid()) { - entry.image = RasterizePicture(picture, context, matrix, dst_color_space, - checkerboard_images_); + entry.image = RasterizePicture(picture, context, transformation_matrix, + dst_color_space, checkerboard_images_); } return entry.image; diff --git a/flow/raster_cache.h b/flow/raster_cache.h index 3278eb355b030..e72e7437098f4 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -19,29 +19,20 @@ namespace flow { class RasterCacheResult { public: - RasterCacheResult() - : source_rect_(SkRect::MakeEmpty()), - destination_rect_(SkRect::MakeEmpty()) {} + RasterCacheResult() {} - RasterCacheResult(sk_sp image, SkRect source, SkRect destination) - : image_(std::move(image)), - source_rect_(source), - destination_rect_(destination) {} + RasterCacheResult(sk_sp image, const SkRect& logical_rect) + : image_(std::move(image)), logical_rect_(logical_rect) {} operator bool() const { return static_cast(image_); } bool is_valid() const { return static_cast(image_); }; - sk_sp image() const { return image_; } - - const SkRect& source_rect() const { return source_rect_; } - - const SkRect& destination_rect() const { return destination_rect_; } + void draw(SkCanvas& canvas) const; private: sk_sp image_; - SkRect source_rect_; - SkRect destination_rect_; + SkRect logical_rect_; }; class RasterCache { @@ -50,6 +41,21 @@ class RasterCache { ~RasterCache(); + static SkIRect GetDeviceBounds(const SkRect& rect, const SkMatrix& ctm) { + SkRect device_rect; + ctm.mapRect(&device_rect, rect); + SkIRect bounds; + device_rect.roundOut(&bounds); + return bounds; + } + + static SkMatrix GetIntegralTransCTM(const SkMatrix& ctm) { + SkMatrix result = ctm; + result[SkMatrix::kMTransX] = SkScalarRoundToScalar(ctm.getTranslateX()); + result[SkMatrix::kMTransY] = SkScalarRoundToScalar(ctm.getTranslateY()); + return result; + } + RasterCacheResult GetPrerolledImage(GrContext* context, SkPicture* picture, const SkMatrix& transformation_matrix, diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index 1f28ea5320d36..c6f4c759378f0 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -7,6 +7,7 @@ #include #include "flutter/flow/matrix_decomposition.h" +#include "lib/fxl/logging.h" #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkPicture.h" @@ -15,14 +16,17 @@ namespace flow { class RasterCacheKey { public: - RasterCacheKey(const SkPicture& picture, const MatrixDecomposition& matrix) - : picture_id_(picture.uniqueID()), - scale_key_(SkISize::Make(matrix.scale().x() * 1e3, - matrix.scale().y() * 1e3)) {} + RasterCacheKey(const SkPicture& picture, const SkMatrix& ctm) + : picture_id_(picture.uniqueID()), matrix_(ctm) { + matrix_[SkMatrix::kMTransX] = SkScalarFraction(ctm.getTranslateX()); + matrix_[SkMatrix::kMTransY] = SkScalarFraction(ctm.getTranslateY()); +#ifndef SUPPORT_FRACTIONAL_TRANSLATION + FXL_DCHECK(matrix_.getTranslateX() == 0 && matrix_.getTranslateY() == 0); +#endif + } uint32_t picture_id() const { return picture_id_; } - - const SkISize& scale_key() const { return scale_key_; } + const SkMatrix& matrix() const { return matrix_; } struct Hash { std::size_t operator()(RasterCacheKey const& key) const { @@ -33,8 +37,7 @@ class RasterCacheKey { struct Equal { constexpr bool operator()(const RasterCacheKey& lhs, const RasterCacheKey& rhs) const { - return lhs.picture_id_ == rhs.picture_id_ && - lhs.scale_key_ == rhs.scale_key_; + return lhs.picture_id_ == rhs.picture_id_ && lhs.matrix_ == rhs.matrix_; } }; @@ -43,7 +46,12 @@ class RasterCacheKey { private: uint32_t picture_id_; - SkISize scale_key_; + + // ctm where only fractional (0-1) translations are preserved: + // matrix_ = ctm; + // matrix_[SkMatrix::kMTransX] = SkScalarFraction(ctm.getTranslateX()); + // matrix_[SkMatrix::kMTransY] = SkScalarFraction(ctm.getTranslateY()); + SkMatrix matrix_; }; } // namespace flow From 86d96fd0ce8d58d2dfcd4398eb97aa66873d3bf7 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 23 May 2018 17:09:51 -0700 Subject: [PATCH 0420/1190] Reapply "Don't link the core snapshot in the Android engine." (#5353) Add back the core snapshot to runtime_unittests and embedder_unittests. --- runtime/BUILD.gn | 8 ----- .../android/io/flutter/view/FlutterMain.java | 35 ++++++++++++------- shell/platform/embedder/BUILD.gn | 1 + shell/testing/BUILD.gn | 1 + 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 259f873cd5bae..421bf3548f440 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -104,14 +104,6 @@ source_set("runtime") { public_configs = [ "$flutter_root:config" ] - # In AOT mode, precompiled snapshots contain the instruction buffer. - # Generation of the same requires all application specific script code to be - # specified up front. In such cases, there can be no generic snapshot. - # In Fuchsia, we load from a file instead of linking. - if (!flutter_aot && !is_fuchsia) { - deps += [ "$flutter_root/lib/snapshot" ] - } - if (flutter_runtime_mode != "release" && !is_fuchsia) { # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia # instead puts Observatory into the runner's package. diff --git a/shell/platform/android/io/flutter/view/FlutterMain.java b/shell/platform/android/io/flutter/view/FlutterMain.java index 54d34294d41d0..445af70a090df 100644 --- a/shell/platform/android/io/flutter/view/FlutterMain.java +++ b/shell/platform/android/io/flutter/view/FlutterMain.java @@ -94,7 +94,7 @@ private static String fromFlutterAssets(String filePath) { private static boolean sInitialized = false; private static ResourceExtractor sResourceExtractor; - private static boolean sIsPrecompiled; + private static boolean sIsPrecompiledAsBlobs; private static boolean sIsPrecompiledAsSharedLibrary; private static Settings sSettings; @@ -201,19 +201,24 @@ public static void ensureInitializationComplete(Context applicationContext, Stri if (args != null) { Collections.addAll(shellArgs, args); } - if (sIsPrecompiled) { - shellArgs.add("--" + AOT_SNAPSHOT_PATH_KEY + "=" + - PathUtils.getDataDirectory(applicationContext)); + if (sIsPrecompiledAsSharedLibrary) { + shellArgs.add("--" + AOT_SHARED_LIBRARY_PATH + "=" + + new File(PathUtils.getDataDirectory(applicationContext), sAotSharedLibraryPath)); + } else { + if (sIsPrecompiledAsBlobs) { + shellArgs.add("--" + AOT_SNAPSHOT_PATH_KEY + "=" + + PathUtils.getDataDirectory(applicationContext)); + } else { + shellArgs.add("--cache-dir-path=" + + PathUtils.getCacheDirectory(applicationContext)); + + shellArgs.add("--" + AOT_SNAPSHOT_PATH_KEY + "=" + + PathUtils.getDataDirectory(applicationContext) + "/" + sFlutterAssetsDir); + } shellArgs.add("--" + AOT_VM_SNAPSHOT_DATA_KEY + "=" + sAotVmSnapshotData); shellArgs.add("--" + AOT_VM_SNAPSHOT_INSTR_KEY + "=" + sAotVmSnapshotInstr); shellArgs.add("--" + AOT_ISOLATE_SNAPSHOT_DATA_KEY + "=" + sAotIsolateSnapshotData); shellArgs.add("--" + AOT_ISOLATE_SNAPSHOT_INSTR_KEY + "=" + sAotIsolateSnapshotInstr); - } else if (sIsPrecompiledAsSharedLibrary) { - shellArgs.add("--" + AOT_SHARED_LIBRARY_PATH + "=" + - new File(PathUtils.getDataDirectory(applicationContext), sAotSharedLibraryPath)); - } else { - shellArgs.add("--cache-dir-path=" + - PathUtils.getCacheDirectory(applicationContext)); } if (sSettings.getLogTag() != null) { @@ -264,6 +269,10 @@ private static void initResources(Context applicationContext) { .addResources(SKY_RESOURCES) .addResource(fromFlutterAssets(sFlx)) .addResource(fromFlutterAssets(sSnapshotBlob)) + .addResource(fromFlutterAssets(sAotVmSnapshotData)) + .addResource(fromFlutterAssets(sAotVmSnapshotInstr)) + .addResource(fromFlutterAssets(sAotIsolateSnapshotData)) + .addResource(fromFlutterAssets(sAotIsolateSnapshotInstr)) .addResource(fromFlutterAssets(DEFAULT_KERNEL_BLOB)) .addResource(fromFlutterAssets(DEFAULT_PLATFORM_DILL)); if (sIsPrecompiledAsSharedLibrary) { @@ -298,21 +307,21 @@ private static Set listRootAssets(Context applicationContext) { private static void initAot(Context applicationContext) { Set assets = listRootAssets(applicationContext); - sIsPrecompiled = assets.containsAll(Arrays.asList( + sIsPrecompiledAsBlobs = assets.containsAll(Arrays.asList( sAotVmSnapshotData, sAotVmSnapshotInstr, sAotIsolateSnapshotData, sAotIsolateSnapshotInstr )); sIsPrecompiledAsSharedLibrary = assets.contains(sAotSharedLibraryPath); - if (sIsPrecompiled && sIsPrecompiledAsSharedLibrary) { + if (sIsPrecompiledAsBlobs && sIsPrecompiledAsSharedLibrary) { throw new RuntimeException( "Found precompiled app as shared library and as Dart VM snapshots."); } } public static boolean isRunningPrecompiledCode() { - return sIsPrecompiled || sIsPrecompiledAsSharedLibrary; + return sIsPrecompiledAsBlobs || sIsPrecompiledAsSharedLibrary; } public static String findAppBundlePath(Context applicationContext) { diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 5e04cfcd47abf..777dd5b869d40 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -48,6 +48,7 @@ executable("embedder_unittests") { deps = [ ":embedder", ":fixtures", + "$flutter_root/lib/snapshot", "$flutter_root/testing", ] diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index e0384da218570..6c99a3466d9ae 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -17,6 +17,7 @@ executable("testing") { "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", + "$flutter_root/lib/snapshot", "$flutter_root/shell/common", "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", From 9b51b8959eba2e9565203b769825972f5af0f3b4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 23 May 2018 23:07:37 -0400 Subject: [PATCH 0421/1190] Roll src/third_party/skia/ 13235d896..d416083ee (3 commits) (#5356) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5a045675ca616..7eda041160565 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '13235d8966e4242ef69264aa76ad71ac4021e506', + 'skia_revision': 'd416083eef5b144f65a8de67725ad49264f90884', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 76f887b472892..1d9704f8c187a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2d46bf451e1f1d55a44c585ee82327af +Signature: 1492b1d8effaf8af3de489ca82f3363b UNUSED LICENSES: From 93b3b261b0232c2ef8f735487042aaf3a382ea9a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 24 May 2018 02:32:38 -0400 Subject: [PATCH 0422/1190] Roll src/third_party/skia/ d416083ee..8517631bf (3 commits; 2 trivial rolls) (#5357) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7eda041160565..f9dea1986f251 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd416083eef5b144f65a8de67725ad49264f90884', + 'skia_revision': '8517631bf41089f0d5805741c98f4d0d5f1a7beb', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1d9704f8c187a..fd7481770ddda 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1492b1d8effaf8af3de489ca82f3363b +Signature: 3351b40a52a84c1bdeb9bfb6f393a3e7 UNUSED LICENSES: From c622c687c42e3fa70d2bab8ae534e997b0e0172b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 24 May 2018 05:47:37 -0400 Subject: [PATCH 0423/1190] Roll src/third_party/skia/ 8517631bf..e9c81ee2e (1 commit) (#5358) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index f9dea1986f251..9aa37016e385a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8517631bf41089f0d5805741c98f4d0d5f1a7beb', + 'skia_revision': 'e9c81ee2ea3a77fb4641435a97fef447c1b85128', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From f24fdba8eab9ac26bb6a9e7d8349bdd394c478f7 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 24 May 2018 09:14:38 -0400 Subject: [PATCH 0424/1190] Roll src/third_party/skia/ e9c81ee2e..84a4e5c00 (1 commit) (#5359) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9aa37016e385a..afc6d8368d2eb 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e9c81ee2ea3a77fb4641435a97fef447c1b85128', + 'skia_revision': '84a4e5c0005da6affb745296675c096e423d4eec', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fd7481770ddda..eb1981c21c82e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3351b40a52a84c1bdeb9bfb6f393a3e7 +Signature: 1935a220c7d576d51102c023b725675b UNUSED LICENSES: From 4d892132ad040bdaba78b4557294d7fe5fc191f5 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 24 May 2018 11:14:10 -0400 Subject: [PATCH 0425/1190] Roll src/third_party/skia 84a4e5c..75bf216 (5 commits) (#5361) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/DEPS b/DEPS index afc6d8368d2eb..46c229ddc0352 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '84a4e5c0005da6affb745296675c096e423d4eec', + 'skia_revision': '75bf216c033896ffeff5176e8b5f5fb79c02f8fb', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index eb1981c21c82e..a52c6fad6c0f3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1935a220c7d576d51102c023b725675b +Signature: c7da42c7a02693e3ce534e6053cae94a UNUSED LICENSES: @@ -17499,6 +17499,7 @@ FILE: ../../../third_party/skia/infra/bots/isolate_gcloud_linux.isolate FILE: ../../../third_party/skia/infra/bots/isolate_go.isolate FILE: ../../../third_party/skia/infra/bots/jobs.json FILE: ../../../third_party/skia/infra/bots/perf_skia_bundled.isolate +FILE: ../../../third_party/skia/infra/bots/recipe_modules/binary_size/examples/full.expected/binary_size.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_API26.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Chromebook_GLES.json @@ -17534,16 +17535,17 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.ex FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Test-Ubuntu14-Clang-GCE-CPU-AVX2-x86_64-Debug-All-CT_DM_10k_SKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/examples/full.expected/test.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Build-Win-Clang-x86_64-Release-ParentRevision.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/cross_repo_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/parent_revision_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/core/examples/full.expected/test.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Win-Clang-x86_64-Release-ParentRevision.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/cross_repo_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/flutter_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/parent_revision_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/test.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/doxygen/examples/full.expected/doxygen.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/env/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json From c8050e8e0d1cd8e609cb726bbe0562bfeae21e9e Mon Sep 17 00:00:00 2001 From: Vyacheslav Egorov Date: Thu, 24 May 2018 18:33:52 +0200 Subject: [PATCH 0426/1190] Generate frontend server's .packages from Dart .packages file instead of using pub get. (#5360) Dart SDK itself does not use pub which forced us to manually maintain dependecy overrides in the frontend server's pubspec.yaml. This is rather fragile and easily breaks when dependencies in one of the "internal" packages change, but the package is not published yet. This change switches us to the same model of dependcies management that Dart SDK itself is using. Down side of this is that we can no longer do pub run test in the frontend_server and have to run tests manually. --- DEPS | 27 ++------ frontend_server/pubspec.yaml | 101 ------------------------------ tools/frontend_server_packages.py | 26 ++++++++ travis/analyze.sh | 1 - travis/test.sh | 3 +- 5 files changed, 32 insertions(+), 126 deletions(-) create mode 100644 tools/frontend_server_packages.py diff --git a/DEPS b/DEPS index 46c229ddc0352..70ee6343b63eb 100644 --- a/DEPS +++ b/DEPS @@ -88,6 +88,7 @@ vars = { 'dart_stack_trace_tag': '1.9.2', 'dart_stream_channel_tag': '1.6.4', 'dart_string_scanner_tag': '1.0.2', + 'dart_term_glyph_tag': '1.0.0', 'dart_test_tag': '0.12.38', 'dart_tuple_tag': 'v1.0.1', 'dart_typed_data_tag': '1.1.3', @@ -321,6 +322,9 @@ deps = { 'src/third_party/dart/third_party/pkg/typed_data': Var('dart_git') + '/typed_data.git' + '@' + Var('dart_typed_data_tag'), + 'src/third_party/dart/third_party/pkg/term_glyph': + Var('dart_git') + '/term_glyph.git' + '@' + Var('dart_term_glyph_tag'), + 'src/third_party/dart/third_party/pkg/test': Var('dart_git') + '/test.git' + '@' + Var('dart_test_tag'), @@ -418,29 +422,8 @@ hooks = [ { 'name': 'frontend_server_packages', 'pattern': '.', - 'condition': 'host_os == "linux"', 'cwd': 'src/flutter/frontend_server/', - 'action': [ - '../../../src/third_party/dart/tools/sdks/linux/dart-sdk/bin/pub', 'get', - ], - }, - { - 'name': 'frontend_server_packages', - 'pattern': '.', - 'condition': 'host_os == "mac"', - 'cwd': 'src/flutter/frontend_server/', - 'action': [ - '../../../src/third_party/dart/tools/sdks/mac/dart-sdk/bin/pub', 'get', - ], - }, - { - 'name': 'frontend_server_packages', - 'pattern': '.', - 'condition': 'host_os == "win"', - 'cwd': 'src/flutter/frontend_server/', - 'action': [ - '..\\..\\..\\src\\third_party\\dart\\tools\\sdks\\win\\dart-sdk\\bin\\pub.bat', 'get', - ], + 'action': ['python', '../tools/frontend_server_packages.py'], }, { # Ensure that we don't accidentally reference any .pyc files whose diff --git a/frontend_server/pubspec.yaml b/frontend_server/pubspec.yaml index ecf382f755c62..de6263ccd8480 100644 --- a/frontend_server/pubspec.yaml +++ b/frontend_server/pubspec.yaml @@ -56,104 +56,3 @@ dev_dependencies: web_socket_channel: any when: any yaml: any - -dependency_overrides: - args: - path: ../../third_party/dart/third_party/pkg/args - async: - path: ../../third_party/dart/third_party/pkg/async - charcode: - path: ../../third_party/dart/third_party/pkg/charcode - collection: - path: ../../third_party/dart/third_party/pkg/collection - convert: - path: ../../third_party/dart/third_party/pkg/convert - crypto: - path: ../../third_party/dart/third_party/pkg/crypto - flutter_kernel_transformers: - path: ../flutter_kernel_transformers - front_end: - path: ../../third_party/dart/pkg/front_end/ - kernel: - path: ../../third_party/dart/pkg/kernel/ - logging: - path: ../../third_party/dart/third_party/pkg/logging - meta: - path: ../../third_party/dart/pkg/meta - quiver: - path: ../../third_party/dart/third_party/pkg/quiver - package_config: - path: ../../third_party/dart/third_party/pkg_tested/package_config - path: - path: ../../third_party/dart/third_party/pkg/path - source_span: - path: ../../third_party/dart/third_party/pkg/source_span - typed_data: - path: ../../third_party/dart/third_party/pkg/typed_data - usage: - path: ../../third_party/dart/third_party/pkg/usage - vm: - path: ../../third_party/dart/pkg/vm/ - - analyzer: - path: ../../third_party/dart/pkg/analyzer - boolean_selector: - path: ../../third_party/dart/third_party/pkg/boolean_selector - cli_util: - path: ../../third_party/dart/third_party/pkg/cli_util - csslib: - path: ../../third_party/dart/third_party/pkg/csslib - glob: - path: ../../third_party/dart/third_party/pkg/glob - html: - path: ../../third_party/dart/third_party/pkg/html - http: - path: ../../third_party/dart/third_party/pkg/http - http_multi_server: - path: ../../third_party/dart/third_party/pkg/http_multi_server - http_parser: - path: ../../third_party/dart/third_party/pkg/http_parser - matcher: - path: ../../third_party/dart/third_party/pkg/matcher - mime: - path: ../../third_party/dart/third_party/pkg/mime - mockito: - path: ../../third_party/dart/third_party/pkg/mockito - package_resolver: - path: ../../third_party/dart/third_party/pkg_tested/package_resolver - plugin: - path: ../../third_party/dart/third_party/pkg/plugin - pool: - path: ../../third_party/dart/third_party/pkg/pool - pub_semver: - path: ../../third_party/dart/third_party/pkg/pub_semver - shelf: - path: ../../third_party/dart/third_party/pkg/shelf - shelf_packages_handler: - path: ../../third_party/dart/third_party/pkg/shelf_packages_handler - shelf_static: - path: ../../third_party/dart/third_party/pkg/shelf_static - shelf_web_socket: - path: ../../third_party/dart/third_party/pkg/shelf_web_socket - source_map_stack_trace: - path: ../../third_party/dart/third_party/pkg/source_map_stack_trace - source_maps: - path: ../../third_party/dart/third_party/pkg/source_maps - stack_trace: - path: ../../third_party/dart/third_party/pkg/stack_trace - stream_channel: - path: ../../third_party/dart/third_party/pkg/stream_channel - string_scanner: - path: ../../third_party/dart/third_party/pkg/string_scanner - test: - path: ../../third_party/dart/third_party/pkg/test - utf: - path: ../../third_party/dart/third_party/pkg/utf - watcher: - path: ../../third_party/dart/third_party/pkg/watcher - web_socket_channel: - path: ../../third_party/dart/third_party/pkg/web_socket_channel - when: - path: ../../third_party/pkg/when - yaml: - path: ../../third_party/dart/third_party/pkg/yaml diff --git a/tools/frontend_server_packages.py b/tools/frontend_server_packages.py new file mode 100644 index 0000000000000..1c2bbe28c52f9 --- /dev/null +++ b/tools/frontend_server_packages.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# Copyright 2018 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. + +# This script generates .packages file for frontend server from +# Dart SDKs .packages file located in third_party/dart/.packages + +import os +import shutil + +DOT_PACKAGES = '.packages' +FRONTEND_SERVER_DIR = os.getcwd() +SRC_DIR = os.path.dirname(os.path.dirname(FRONTEND_SERVER_DIR)) +DART_PACKAGES_FILE = os.path.join(SRC_DIR, 'third_party', 'dart', DOT_PACKAGES) + +with open(DOT_PACKAGES, 'w') as packages: + with open(DART_PACKAGES_FILE, 'r') as dart_packages: + for line in dart_packages: + if line.startswith('#'): + packages.write(line) + else: + [package, path] = line.split(':', 1) + packages.write('%s:../../third_party/dart/%s' % (package, path)) + packages.write('frontend_server:./lib\n') + packages.write('flutter_kernel_transformers:../flutter_kernel_transformers/lib\n') diff --git a/travis/analyze.sh b/travis/analyze.sh index 6209e8dbf84fb..d4b9a959cbe2c 100755 --- a/travis/analyze.sh +++ b/travis/analyze.sh @@ -20,7 +20,6 @@ if [ -n "$RESULTS" ]; then fi echo "Analyzing frontend_server..." -pushd flutter/frontend_server/; pub get; popd RESULTS=`dartanalyzer \ --packages=flutter/frontend_server/.packages \ --options flutter/analysis_options.yaml \ diff --git a/travis/test.sh b/travis/test.sh index 5f2f30089fcd6..c0ea5babca926 100755 --- a/travis/test.sh +++ b/travis/test.sh @@ -1,5 +1,4 @@ #!/bin/bash cd frontend_server -pub get -pub run test/server_test.dart +dart test/server_test.dart From b60738297e40f52a25045768d938d9153c7d2cad Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 24 May 2018 10:00:16 -0700 Subject: [PATCH 0427/1190] Improve licenses script (#5355) --- tools/licenses/lib/filesystem.dart | 37 ++++++++++++++++++++++++++++-- tools/licenses/lib/licenses.dart | 10 +++++--- tools/licenses/lib/limits.dart | 6 +++++ 3 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 tools/licenses/lib/limits.dart diff --git a/tools/licenses/lib/filesystem.dart b/tools/licenses/lib/filesystem.dart index 1183afb913408..65ea72d7ec266 100644 --- a/tools/licenses/lib/filesystem.dart +++ b/tools/licenses/lib/filesystem.dart @@ -10,6 +10,7 @@ import 'package:path/path.dart' as path; import 'package:archive/archive.dart' as a; import 'cache.dart'; +import 'limits.dart'; enum FileType { binary, // won't have its own license block @@ -38,6 +39,22 @@ bool matchesSignature(List bytes, List signature) { return true; } +bool hasSubsequence(List bytes, List signature, int limit) { + if (bytes.length < limit) + limit = bytes.length; + for (int index = 0; index < limit; index += 1) { + if (bytes.length - index < signature.length) + return false; + for (int offset = 0; offset < signature.length; offset += 1) { + if (signature[offset] != -1 && bytes[index + offset] != signature[offset]) + break; + if (offset + 1 == signature.length) + return true; + } + } + return false; +} + const String kMultiLicenseFileHeader = 'Notices for files contained in'; bool isMultiLicenseNotice(Reader reader) { @@ -50,7 +67,8 @@ FileType identifyFile(String name, Reader reader) { if ((path.split(name).reversed.take(6).toList().reversed.join('/') == 'third_party/icu/source/extra/uconv/README') || // This specific ICU README isn't in UTF-8. (path.split(name).reversed.take(6).toList().reversed.join('/') == 'third_party/icu/source/samples/uresb/sr.txt') || // This specific sample contains non-UTF-8 data (unlike other sr.txt files). (path.split(name).reversed.take(2).toList().reversed.join('/') == 'builds/detect.mk') || // This specific freetype sample contains non-UTF-8 data (unlike other .mk files). - (path.split(name).reversed.take(4).toList().reversed.join('/') == 'third_party/freetype2/docs/FTL.TXT')) // This file has a copyright symbol in Latin1 in it + (path.split(name).reversed.take(4).toList().reversed.join('/') == 'third_party/freetype2/docs/FTL.TXT') || // This file has a copyright symbol in Latin1 in it + (path.split(name).reversed.take(3).toList().reversed.join('/') == 'third_party/cares/cares.rc')) // This file has a copyright symbol in Latin1 in it return FileType.latin1Text; if (path.split(name).reversed.take(6).toList().reversed.join('/') == 'dart/runtime/tests/vm/dart/bad_snapshot' || // Not any particular format path.split(name).reversed.take(8).toList().reversed.join('/') == 'third_party/android_tools/ndk/sources/cxx-stl/stlport/src/stlport.rc') // uses the word "copyright" but doesn't have a copyright header @@ -61,6 +79,12 @@ FileType identifyFile(String name, Reader reader) { if (matchesSignature(bytes, [0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00, 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58])) return FileType.metadata; // The ._* files in Mac OS X archives that gives icons and stuff } + if (path.split(name).contains('cairo')) { + bytes ??= reader(); + // "Copyright " + if (hasSubsequence(bytes, [0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0xA9, 0x20], kMaxSize)) + return FileType.latin1Text; + } switch (base) { // Build files case 'DEPS': return FileType.text; @@ -74,6 +98,7 @@ FileType identifyFile(String name, Reader reader) { case 'Changes': return FileType.text; case 'change.log': return FileType.text; case 'ChangeLog': return FileType.text; + case 'CHANGES.0': return FileType.latin1Text; case 'README': return FileType.text; case 'TODO': return FileType.text; case 'NEWS': return FileType.text; @@ -87,6 +112,7 @@ FileType identifyFile(String name, Reader reader) { case 'ECLIPSE_.RSA': return FileType.binary; // Binary data files case 'tzdata': return FileType.binary; + case 'compressed_atrace_data.txt': return FileType.binary; // Source files that don't use UTF-8 case 'Messages_de_DE.properties': // has a few non-ASCII characters they forgot to escape (from gnu-libstdc++) case 'mmx_blendtmp.h': // author name in comment contains latin1 (mesa) @@ -140,7 +166,14 @@ FileType identifyFile(String name, Reader reader) { // LLVM bitcode case '.bc': return FileType.binary; // Python code - case '.py': return FileType.text; + case '.py': + bytes ??= reader(); + // # -*- coding: Latin-1 -*- + if (matchesSignature(bytes, [0x23, 0x20, 0x2d, 0x2a, 0x2d, 0x20, 0x63, 0x6f, 0x64, + 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x4c, 0x61, 0x74, 0x69, + 0x6e, 0x2d, 0x31, 0x20, 0x2d, 0x2a, 0x2d])) + return FileType.latin1Text; + return FileType.text; case '.pyc': return FileType.binary; // compiled Python bytecode // Machine code case '.so': return FileType.binary; // ELF shared object diff --git a/tools/licenses/lib/licenses.dart b/tools/licenses/lib/licenses.dart index 441bc5cd7ee1e..7584ff9c63d2b 100644 --- a/tools/licenses/lib/licenses.dart +++ b/tools/licenses/lib/licenses.dart @@ -7,9 +7,7 @@ import 'dart:io' as system; import 'cache.dart'; import 'patterns.dart'; - -// TODO(ianh): vastly increase this before checkin -const int kMaxSize = 5 * 1024; // only look for copyrights and licenses at the top of the file +import 'limits.dart'; class FetchedContentsOf extends Key { FetchedContentsOf(dynamic value) : super(value); } @@ -26,7 +24,10 @@ LicenseType convertLicenseNameToType(String name) { return LicenseType.bsd; case 'LICENSE-LGPL-2': case 'LICENSE-LGPL-2.1': + case 'COPYING-LGPL-2.1': return LicenseType.lgpl; + case 'COPYING-GPL-3': + return LicenseType.gpl; case 'FTL.TXT': return LicenseType.freetype; case 'zlib.h': @@ -40,6 +41,7 @@ LicenseType convertLicenseNameToType(String name) { case 'OpenSSL': return LicenseType.openssl; case 'LICENSE.MPLv2': + case 'COPYING-MPL-1.1': return LicenseType.mpl; // common file names that don't say what the type is case 'COPYING': @@ -55,6 +57,7 @@ LicenseType convertLicenseNameToType(String name) { case 'NOTICE.txt': case 'Copyright': case 'copyright': + case 'license.txt': return LicenseType.unknown; // particularly weird file names case 'LICENSE-APPLE': @@ -64,6 +67,7 @@ LicenseType convertLicenseNameToType(String name) { case 'javolution.license.txt': case 'libyaml-license.txt': case 'license.patch': + case 'license.rst': case 'mh-bsd-gcc': case 'pivotal.labs.license.txt': return LicenseType.unknown; diff --git a/tools/licenses/lib/limits.dart b/tools/licenses/lib/limits.dart new file mode 100644 index 0000000000000..cd3a3cf37d33f --- /dev/null +++ b/tools/licenses/lib/limits.dart @@ -0,0 +1,6 @@ +// 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. + +// TODO(ianh): vastly increase this before checkin +const int kMaxSize = 5 * 1024; // only look for copyrights and licenses at the top of the file From 416418f670bf78dd556ccc49661a3f9d0743d2be Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 24 May 2018 14:39:55 -0400 Subject: [PATCH 0428/1190] Roll src/third_party/skia 75bf216..a0047bc (5 commits) (#5363) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 70ee6343b63eb..797656e2652d4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '75bf216c033896ffeff5176e8b5f5fb79c02f8fb', + 'skia_revision': 'a0047bcff704a9121a6d82a6f97d6124463a2e54', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a52c6fad6c0f3..b30dad765dd13 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c7da42c7a02693e3ce534e6053cae94a +Signature: c5ff57ee9491321a5677dc35fd295d3e UNUSED LICENSES: From fb709e25e31fd078be84fe0969fc86a451ecfa87 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Thu, 24 May 2018 13:24:14 -0700 Subject: [PATCH 0429/1190] [fuchsia] Plumbing for sharing between AOT snapshots. (#5351) --- runtime/dart_isolate.cc | 40 ++++++++++++++++++++----------- runtime/dart_isolate.h | 4 ++++ runtime/dart_isolate_unittests.cc | 3 +++ runtime/dart_snapshot.cc | 8 +++++++ runtime/dart_snapshot.h | 4 ++++ runtime/dart_vm.cc | 22 +++++++++++++---- runtime/dart_vm.h | 8 +++++-- runtime/runtime_controller.cc | 6 +++++ runtime/runtime_controller.h | 3 +++ shell/common/engine.cc | 2 ++ shell/common/engine.h | 1 + shell/common/shell.cc | 10 +++++++- shell/common/shell.h | 2 ++ 13 files changed, 91 insertions(+), 22 deletions(-) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 22ff724e18b35..ded3ff8f6da2a 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -35,6 +35,7 @@ namespace blink { fml::WeakPtr DartIsolate::CreateRootIsolate( const DartVM* vm, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, TaskRunners task_runners, std::unique_ptr window, fml::WeakPtr resource_context, @@ -54,6 +55,7 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( auto root_embedder_data = std::make_unique( vm, // VM std::move(isolate_snapshot), // isolate snapshot + std::move(shared_snapshot), // shared snapshot task_runners, // task runners std::move(resource_context), // resource context std::move(unref_queue), // skia unref queue @@ -94,6 +96,7 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( DartIsolate::DartIsolate(const DartVM* vm, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, TaskRunners task_runners, fml::WeakPtr resource_context, fxl::RefPtr unref_queue, @@ -110,6 +113,7 @@ DartIsolate::DartIsolate(const DartVM* vm, vm->GetSettings().log_tag), vm_(vm), isolate_snapshot_(std::move(isolate_snapshot)), + shared_snapshot_(std::move(shared_snapshot)), child_isolate_preparer_(std::move(child_isolate_preparer)), weak_factory_(std::make_unique>(this)) { FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; @@ -285,8 +289,8 @@ static bool LoadScriptSnapshot(std::shared_ptr mapping, static bool LoadKernelSnapshot(std::shared_ptr mapping, bool last_piece) { - Dart_Handle library = Dart_LoadLibraryFromKernel(mapping->GetMapping(), - mapping->GetSize()); + Dart_Handle library = + Dart_LoadLibraryFromKernel(mapping->GetMapping(), mapping->GetSize()); if (tonic::LogIfError(library)) { return false; } @@ -533,6 +537,7 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( DartIsolate::CreateRootIsolate( vm.get(), // vm vm->GetIsolateSnapshot(), // isolate snapshot + vm->GetSharedSnapshot(), // shared snapshot null_task_runners, // task runners nullptr, // window {}, // resource context @@ -657,6 +662,7 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( embedder_isolate = std::make_unique( vm, // vm raw_embedder_isolate->GetIsolateSnapshot(), // isolate_snapshot + raw_embedder_isolate->GetSharedSnapshot(), // shared_snapshot null_task_runners, // task_runners fml::WeakPtr{}, // resource_context nullptr, // unref_queue @@ -678,18 +684,20 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( embedder_isolate.get(), // error // ) - : Dart_CreateIsolate(advisory_script_uri, // - advisory_script_entrypoint, // - embedder_isolate->GetIsolateSnapshot() - ->GetData() - ->GetSnapshotPointer(), // - embedder_isolate->GetIsolateSnapshot() - ->GetInstructionsIfPresent(), // - nullptr, // - nullptr, // - flags, // - embedder_isolate.get(), // - error // + : Dart_CreateIsolate( + advisory_script_uri, // + advisory_script_entrypoint, // + embedder_isolate->GetIsolateSnapshot() + ->GetData() + ->GetSnapshotPointer(), // + embedder_isolate->GetIsolateSnapshot() + ->GetInstructionsIfPresent(), // + embedder_isolate->GetSharedSnapshot()->GetDataIfPresent(), // + embedder_isolate->GetSharedSnapshot() + ->GetInstructionsIfPresent(), // + flags, // + embedder_isolate.get(), // + error // ); if (isolate == nullptr) { @@ -753,6 +761,10 @@ fxl::RefPtr DartIsolate::GetIsolateSnapshot() const { return isolate_snapshot_; } +fxl::RefPtr DartIsolate::GetSharedSnapshot() const { + return shared_snapshot_; +} + fml::WeakPtr DartIsolate::GetWeakIsolatePtr() const { return weak_factory_ ? weak_factory_->GetWeakPtr() : fml::WeakPtr(); diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index 0999d2f6f4f8f..16b7f37641959 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -41,6 +41,7 @@ class DartIsolate : public UIDartState { static fml::WeakPtr CreateRootIsolate( const DartVM* vm, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, TaskRunners task_runners, std::unique_ptr window, fml::WeakPtr resource_context, @@ -51,6 +52,7 @@ class DartIsolate : public UIDartState { DartIsolate(const DartVM* vm, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, TaskRunners task_runners, fml::WeakPtr resource_context, fxl::RefPtr unref_queue, @@ -85,6 +87,7 @@ class DartIsolate : public UIDartState { const DartVM* GetDartVM() const; fxl::RefPtr GetIsolateSnapshot() const; + fxl::RefPtr GetSharedSnapshot() const; fml::WeakPtr GetWeakIsolatePtr() const; @@ -107,6 +110,7 @@ class DartIsolate : public UIDartState { const DartVM* vm_ = nullptr; Phase phase_ = Phase::Unknown; const fxl::RefPtr isolate_snapshot_; + const fxl::RefPtr shared_snapshot_; std::vector> shutdown_callbacks_; ChildIsolatePreparer child_isolate_preparer_; std::unique_ptr> weak_factory_; diff --git a/runtime/dart_isolate_unittests.cc b/runtime/dart_isolate_unittests.cc index d8f2e02382da1..ba808e5b74f01 100644 --- a/runtime/dart_isolate_unittests.cc +++ b/runtime/dart_isolate_unittests.cc @@ -32,6 +32,7 @@ TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) { auto root_isolate = DartIsolate::CreateRootIsolate( vm.get(), // vm vm->GetIsolateSnapshot(), // isolate snapshot + vm->GetSharedSnapshot(), // shared snapshot std::move(task_runners), // task runners nullptr, // window {}, // resource context @@ -57,6 +58,7 @@ TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) { auto root_isolate = DartIsolate::CreateRootIsolate( vm.get(), // vm vm->GetIsolateSnapshot(), // isolate snapshot + vm->GetSharedSnapshot(), // shared snapshot std::move(task_runners), // task runners nullptr, // window {}, // resource context @@ -85,6 +87,7 @@ TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) { auto root_isolate = DartIsolate::CreateRootIsolate( vm.get(), // vm vm->GetIsolateSnapshot(), // isolate snapshot + vm->GetSharedSnapshot(), // shared snapshot std::move(task_runners), // task runners nullptr, // window {}, // resource context diff --git a/runtime/dart_snapshot.cc b/runtime/dart_snapshot.cc index 1c47cffd2ff8c..1545b8880e432 100644 --- a/runtime/dart_snapshot.cc +++ b/runtime/dart_snapshot.cc @@ -170,6 +170,10 @@ fxl::RefPtr DartSnapshot::IsolateSnapshotFromSettings( #endif } +fxl::RefPtr DartSnapshot::Empty() { + return fxl::MakeRefCounted(nullptr, nullptr); +} + DartSnapshot::DartSnapshot(std::unique_ptr data, std::unique_ptr instructions) : data_(std::move(data)), instructions_(std::move(instructions)) {} @@ -192,6 +196,10 @@ const DartSnapshotBuffer* DartSnapshot::GetInstructions() const { return instructions_.get(); } +const uint8_t* DartSnapshot::GetDataIfPresent() const { + return data_ ? data_->GetSnapshotPointer() : nullptr; +} + const uint8_t* DartSnapshot::GetInstructionsIfPresent() const { return instructions_ ? instructions_->GetSnapshotPointer() : nullptr; } diff --git a/runtime/dart_snapshot.h b/runtime/dart_snapshot.h index 4f04765b4f5a9..dfc5001dc99ff 100644 --- a/runtime/dart_snapshot.h +++ b/runtime/dart_snapshot.h @@ -28,6 +28,8 @@ class DartSnapshot : public fxl::RefCountedThreadSafe { static fxl::RefPtr IsolateSnapshotFromSettings( const Settings& settings); + static fxl::RefPtr Empty(); + bool IsValid() const; bool IsValidForAOT() const; @@ -36,6 +38,8 @@ class DartSnapshot : public fxl::RefCountedThreadSafe { const DartSnapshotBuffer* GetInstructions() const; + const uint8_t* GetDataIfPresent() const; + const uint8_t* GetInstructionsIfPresent() const; private: diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index a8206789d6285..a61413b1742ef 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -228,7 +228,7 @@ static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { } fxl::RefPtr DartVM::ForProcess(Settings settings) { - return ForProcess(settings, nullptr, nullptr); + return ForProcess(settings, nullptr, nullptr, nullptr); } static std::once_flag gVMInitialization; @@ -237,10 +237,12 @@ static fxl::RefPtr gVM; fxl::RefPtr DartVM::ForProcess( Settings settings, fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot) { + fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot) { std::call_once(gVMInitialization, [settings, // vm_snapshot, // - isolate_snapshot // + isolate_snapshot, // + shared_snapshot // ]() mutable { if (!vm_snapshot) { vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings); @@ -248,9 +250,13 @@ fxl::RefPtr DartVM::ForProcess( if (!isolate_snapshot) { isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings); } + if (!shared_snapshot) { + shared_snapshot = DartSnapshot::Empty(); + } gVM = fxl::MakeRefCounted(settings, // std::move(vm_snapshot), // - std::move(isolate_snapshot) // + std::move(isolate_snapshot), // + std::move(shared_snapshot) // ); }); return gVM; @@ -262,10 +268,12 @@ fxl::RefPtr DartVM::ForProcessIfInitialized() { DartVM::DartVM(const Settings& settings, fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot) + fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot) : settings_(settings), vm_snapshot_(std::move(vm_snapshot)), isolate_snapshot_(std::move(isolate_snapshot)), + shared_snapshot_(std::move(shared_snapshot)), platform_kernel_mapping_( std::make_unique(settings.platform_kernel_path)), weak_factory_(this) { @@ -454,6 +462,10 @@ fxl::RefPtr DartVM::GetIsolateSnapshot() const { return isolate_snapshot_; } +fxl::RefPtr DartVM::GetSharedSnapshot() const { + return shared_snapshot_; +} + ServiceProtocol& DartVM::GetServiceProtocol() { return service_protocol_; } diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h index 12ac1c6b21b08..8202aad1204c4 100644 --- a/runtime/dart_vm.h +++ b/runtime/dart_vm.h @@ -30,7 +30,8 @@ class DartVM : public fxl::RefCountedThreadSafe { static fxl::RefPtr ForProcess( Settings settings, fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot); + fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot); static fxl::RefPtr ForProcessIfInitialized(); @@ -43,6 +44,7 @@ class DartVM : public fxl::RefCountedThreadSafe { const DartSnapshot& GetVMSnapshot() const; fxl::RefPtr GetIsolateSnapshot() const; + fxl::RefPtr GetSharedSnapshot() const; fxl::WeakPtr GetWeakPtr(); @@ -52,13 +54,15 @@ class DartVM : public fxl::RefCountedThreadSafe { const Settings settings_; const fxl::RefPtr vm_snapshot_; const fxl::RefPtr isolate_snapshot_; + const fxl::RefPtr shared_snapshot_; std::unique_ptr platform_kernel_mapping_; ServiceProtocol service_protocol_; fxl::WeakPtrFactory weak_factory_; DartVM(const Settings& settings, fxl::RefPtr vm_snapshot, - fxl::RefPtr isolate_snapshot); + fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot); ~DartVM(); diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 8f1d719915b3f..56ba08314b13b 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -22,12 +22,14 @@ RuntimeController::RuntimeController( RuntimeDelegate& p_client, const DartVM* p_vm, fxl::RefPtr p_isolate_snapshot, + fxl::RefPtr p_shared_snapshot, TaskRunners p_task_runners, fml::WeakPtr p_resource_context, fxl::RefPtr p_unref_queue) : RuntimeController(p_client, p_vm, std::move(p_isolate_snapshot), + std::move(p_shared_snapshot), std::move(p_task_runners), std::move(p_resource_context), std::move(p_unref_queue), @@ -37,6 +39,7 @@ RuntimeController::RuntimeController( RuntimeDelegate& p_client, const DartVM* p_vm, fxl::RefPtr p_isolate_snapshot, + fxl::RefPtr p_shared_snapshot, TaskRunners p_task_runners, fml::WeakPtr p_resource_context, fxl::RefPtr p_unref_queue, @@ -44,6 +47,7 @@ RuntimeController::RuntimeController( : client_(p_client), vm_(p_vm), isolate_snapshot_(std::move(p_isolate_snapshot)), + shared_snapshot_(std::move(p_shared_snapshot)), task_runners_(p_task_runners), resource_context_(p_resource_context), unref_queue_(p_unref_queue), @@ -51,6 +55,7 @@ RuntimeController::RuntimeController( root_isolate_( DartIsolate::CreateRootIsolate(vm_, isolate_snapshot_, + shared_snapshot_, task_runners_, std::make_unique(this), resource_context_, @@ -94,6 +99,7 @@ std::unique_ptr RuntimeController::Clone() const { client_, // vm_, // isolate_snapshot_, // + shared_snapshot_, // task_runners_, // resource_context_, // unref_queue_, // diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 290282b2e6cde..a9d32484da1ab 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -26,6 +26,7 @@ class RuntimeController final : public WindowClient { RuntimeController(RuntimeDelegate& client, const DartVM* vm, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, TaskRunners task_runners, fml::WeakPtr resource_context, fxl::RefPtr unref_queue); @@ -81,6 +82,7 @@ class RuntimeController final : public WindowClient { RuntimeDelegate& client_; const DartVM* vm_; fxl::RefPtr isolate_snapshot_; + fxl::RefPtr shared_snapshot_; TaskRunners task_runners_; fml::WeakPtr resource_context_; fxl::RefPtr unref_queue_; @@ -91,6 +93,7 @@ class RuntimeController final : public WindowClient { RuntimeController(RuntimeDelegate& client, const DartVM* vm, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, TaskRunners task_runners, fml::WeakPtr resource_context, fxl::RefPtr unref_queue, diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 175ebd54e94dc..b15a3bc31c189 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -38,6 +38,7 @@ static constexpr char kSettingsChannel[] = "flutter/settings"; Engine::Engine(Delegate& delegate, const blink::DartVM& vm, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, blink::TaskRunners task_runners, blink::Settings settings, std::unique_ptr animator, @@ -57,6 +58,7 @@ Engine::Engine(Delegate& delegate, *this, // runtime delegate &vm, // VM std::move(isolate_snapshot), // isolate snapshot + std::move(shared_snapshot), // shared snapshot std::move(task_runners), // task runners std::move(resource_context), // resource context std::move(unref_queue) // skia unref queue diff --git a/shell/common/engine.h b/shell/common/engine.h index 65e907759fc4c..e1fed0d683d61 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -41,6 +41,7 @@ class Engine final : public blink::RuntimeDelegate { Engine(Delegate& delegate, const blink::DartVM& vm, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, blink::TaskRunners task_runners, blink::Settings settings, std::unique_ptr animator, diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 5d02f8fd19113..97385fab65f72 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -41,6 +41,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( blink::TaskRunners task_runners, blink::Settings settings, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer) { if (!task_runners.IsValid()) { @@ -112,6 +113,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( &engine, // shell = shell.get(), // isolate_snapshot = std::move(isolate_snapshot), // + shared_snapshot = std::move(shared_snapshot), // vsync_waiter = std::move(vsync_waiter), // resource_context = std::move(resource_context), // unref_queue = std::move(unref_queue) // @@ -126,6 +128,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( engine = std::make_unique(*shell, // shell->GetDartVM(), // std::move(isolate_snapshot), // + std::move(shared_snapshot), // task_runners, // shell->GetSettings(), // std::move(animator), // @@ -202,7 +205,8 @@ static void PerformInitializationTasks(const blink::Settings& settings) { }); } -std::unique_ptr Shell::Create( + + std::unique_ptr Shell::Create( blink::TaskRunners task_runners, blink::Settings settings, Shell::CreateCallback on_create_platform_view, @@ -214,6 +218,7 @@ std::unique_ptr Shell::Create( return Shell::Create(std::move(task_runners), // std::move(settings), // vm->GetIsolateSnapshot(), // + blink::DartSnapshot::Empty(), // std::move(on_create_platform_view), // std::move(on_create_rasterizer) // ); @@ -223,6 +228,7 @@ std::unique_ptr Shell::Create( blink::TaskRunners task_runners, blink::Settings settings, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer) { PerformInitializationTasks(settings); @@ -241,12 +247,14 @@ std::unique_ptr Shell::Create( task_runners = std::move(task_runners), // settings, // isolate_snapshot = std::move(isolate_snapshot), // + shared_snapshot = std::move(shared_snapshot), // on_create_platform_view, // on_create_rasterizer // ]() { shell = CreateShellOnPlatformThread(std::move(task_runners), // settings, // std::move(isolate_snapshot), // + std::move(shared_snapshot), // on_create_platform_view, // on_create_rasterizer // ); diff --git a/shell/common/shell.h b/shell/common/shell.h index f1403d2fc55a9..2a8caeb476583 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -56,6 +56,7 @@ class Shell final : public PlatformView::Delegate, blink::TaskRunners task_runners, blink::Settings settings, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, CreateCallback on_create_platform_view, CreateCallback on_create_rasterizer); @@ -105,6 +106,7 @@ class Shell final : public PlatformView::Delegate, blink::TaskRunners task_runners, blink::Settings settings, fxl::RefPtr isolate_snapshot, + fxl::RefPtr shared_snapshot, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer); From 983f39c75a228cf24086c45a21f9bebbd6ead440 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 24 May 2018 14:21:42 -0700 Subject: [PATCH 0430/1190] Don't enable LTO on Windows hosts as the toolchain does not read the value. (#5364) --- tools/gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/gn b/tools/gn index 74bc55bc9b40a..923a12f6de124 100755 --- a/tools/gn +++ b/tools/gn @@ -84,7 +84,7 @@ def to_gn_args(args): # There is no point in enabling LTO in unoptimized builds. enable_lto = False - if args.target_os != 'win': + if not sys.platform.startswith('win'): # The GN arg is not available in the windows toolchain. gn_args['enable_lto'] = enable_lto From 15bb9b806f367621420d5bdf7f863d0e79890f7c Mon Sep 17 00:00:00 2001 From: Vyacheslav Egorov Date: Thu, 24 May 2018 23:58:58 +0200 Subject: [PATCH 0431/1190] Generate .packages for both flutter_kernel_transformers and frontend_server in the same way (#5362) * Generate .packages for both flutter_kernel_transformers and frontend_server in the same way * Generate more precise .packages --- DEPS | 6 +- flutter_kernel_transformers/pubspec.yaml | 99 ------------------------ tools/frontend_server_packages.py | 26 ------- tools/generate_package_files.py | 38 +++++++++ travis/analyze.sh | 1 - 5 files changed, 41 insertions(+), 129 deletions(-) delete mode 100644 tools/frontend_server_packages.py create mode 100644 tools/generate_package_files.py diff --git a/DEPS b/DEPS index 797656e2652d4..d674e4d206115 100644 --- a/DEPS +++ b/DEPS @@ -420,10 +420,10 @@ hooks = [ 'action': ['python', 'src/tools/dart/update.py'], }, { - 'name': 'frontend_server_packages', + 'name': 'generate_package_files', 'pattern': '.', - 'cwd': 'src/flutter/frontend_server/', - 'action': ['python', '../tools/frontend_server_packages.py'], + 'cwd': 'src/', + 'action': ['python', 'flutter/tools/generate_package_files.py'], }, { # Ensure that we don't accidentally reference any .pyc files whose diff --git a/flutter_kernel_transformers/pubspec.yaml b/flutter_kernel_transformers/pubspec.yaml index 65b2734b5c14b..e23088b859200 100644 --- a/flutter_kernel_transformers/pubspec.yaml +++ b/flutter_kernel_transformers/pubspec.yaml @@ -11,102 +11,3 @@ dependencies: dev_dependencies: test: any when: any - -dependency_overrides: - args: - path: ../../third_party/dart/third_party/pkg/args - async: - path: ../../third_party/dart/third_party/pkg/async - charcode: - path: ../../third_party/dart/third_party/pkg/charcode - collection: - path: ../../third_party/dart/third_party/pkg/collection - convert: - path: ../../third_party/dart/third_party/pkg/convert - crypto: - path: ../../third_party/dart/third_party/pkg/crypto - front_end: - path: ../../third_party/dart/pkg/front_end/ - kernel: - path: ../../third_party/dart/pkg/kernel/ - logging: - path: ../../third_party/dart/third_party/pkg/logging - meta: - path: ../../third_party/dart/pkg/meta - quiver: - path: ../../third_party/dart/third_party/pkg/quiver - package_config: - path: ../../third_party/dart/third_party/pkg_tested/package_config - path: - path: ../../third_party/dart/third_party/pkg/path - source_span: - path: ../../third_party/dart/third_party/pkg/source_span - typed_data: - path: ../../third_party/dart/third_party/pkg/typed_data - usage: - path: ../../third_party/dart/third_party/pkg/usage - vm: - path: ../../third_party/dart/pkg/vm/ - - analyzer: - path: ../../third_party/dart/pkg/analyzer - boolean_selector: - path: ../../third_party/dart/third_party/pkg/boolean_selector - cli_util: - path: ../../third_party/dart/third_party/pkg/cli_util - csslib: - path: ../../third_party/dart/third_party/pkg/csslib - glob: - path: ../../third_party/dart/third_party/pkg/glob - html: - path: ../../third_party/dart/third_party/pkg/html - http: - path: ../../third_party/dart/third_party/pkg/http - http_multi_server: - path: ../../third_party/dart/third_party/pkg/http_multi_server - http_parser: - path: ../../third_party/dart/third_party/pkg/http_parser - matcher: - path: ../../third_party/dart/third_party/pkg/matcher - mime: - path: ../../third_party/dart/third_party/pkg/mime - mockito: - path: ../../third_party/dart/third_party/pkg/mockito - package_resolver: - path: ../../third_party/dart/third_party/pkg_tested/package_resolver - plugin: - path: ../../third_party/dart/third_party/pkg/plugin - pool: - path: ../../third_party/dart/third_party/pkg/pool - pub_semver: - path: ../../third_party/dart/third_party/pkg/pub_semver - shelf: - path: ../../third_party/dart/third_party/pkg/shelf - shelf_packages_handler: - path: ../../third_party/dart/third_party/pkg/shelf_packages_handler - shelf_static: - path: ../../third_party/dart/third_party/pkg/shelf_static - shelf_web_socket: - path: ../../third_party/dart/third_party/pkg/shelf_web_socket - source_map_stack_trace: - path: ../../third_party/dart/third_party/pkg/source_map_stack_trace - source_maps: - path: ../../third_party/dart/third_party/pkg/source_maps - stack_trace: - path: ../../third_party/dart/third_party/pkg/stack_trace - stream_channel: - path: ../../third_party/dart/third_party/pkg/stream_channel - string_scanner: - path: ../../third_party/dart/third_party/pkg/string_scanner - test: - path: ../../third_party/dart/third_party/pkg/test - utf: - path: ../../third_party/dart/third_party/pkg/utf - watcher: - path: ../../third_party/dart/third_party/pkg/watcher - web_socket_channel: - path: ../../third_party/dart/third_party/pkg/web_socket_channel - when: - path: ../../third_party/pkg/when - yaml: - path: ../../third_party/dart/third_party/pkg/yaml diff --git a/tools/frontend_server_packages.py b/tools/frontend_server_packages.py deleted file mode 100644 index 1c2bbe28c52f9..0000000000000 --- a/tools/frontend_server_packages.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python -# Copyright 2018 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. - -# This script generates .packages file for frontend server from -# Dart SDKs .packages file located in third_party/dart/.packages - -import os -import shutil - -DOT_PACKAGES = '.packages' -FRONTEND_SERVER_DIR = os.getcwd() -SRC_DIR = os.path.dirname(os.path.dirname(FRONTEND_SERVER_DIR)) -DART_PACKAGES_FILE = os.path.join(SRC_DIR, 'third_party', 'dart', DOT_PACKAGES) - -with open(DOT_PACKAGES, 'w') as packages: - with open(DART_PACKAGES_FILE, 'r') as dart_packages: - for line in dart_packages: - if line.startswith('#'): - packages.write(line) - else: - [package, path] = line.split(':', 1) - packages.write('%s:../../third_party/dart/%s' % (package, path)) - packages.write('frontend_server:./lib\n') - packages.write('flutter_kernel_transformers:../flutter_kernel_transformers/lib\n') diff --git a/tools/generate_package_files.py b/tools/generate_package_files.py new file mode 100644 index 0000000000000..b32044d272f2f --- /dev/null +++ b/tools/generate_package_files.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# Copyright 2018 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. + +# This script generates .packages file for frontend_server and +# flutter_kernel_transformers from Dart SDKs .packages file located in +# third_party/dart/.packages + +import os +import shutil + +ALL_PACKAGES = { + 'frontend_server': ['flutter_kernel_transformers'], + 'flutter_kernel_transformers': [], +} + +SRC_DIR = os.getcwd() + +DOT_PACKAGES = '.packages' +DART_PACKAGES_FILE = os.path.join(SRC_DIR, 'third_party', 'dart', DOT_PACKAGES) + +# Generate .packages file in the given package. +def GeneratePackages(package, local_deps): + with open(os.path.join('flutter', package, DOT_PACKAGES), 'w') as packages: + with open(DART_PACKAGES_FILE, 'r') as dart_packages: + for line in dart_packages: + if line.startswith('#'): + packages.write(line) + else: + [name, path] = line.split(':', 1) + packages.write('%s:../../third_party/dart/%s' % (name, path)) + packages.write('%s:./lib\n' % (package)) + for other_package in local_deps: + packages.write('%s:../%s/lib\n' % (other_package, other_package)) + +for package, local_deps in ALL_PACKAGES.iteritems(): + GeneratePackages(package, local_deps) diff --git a/travis/analyze.sh b/travis/analyze.sh index d4b9a959cbe2c..b9ed095f2d177 100755 --- a/travis/analyze.sh +++ b/travis/analyze.sh @@ -34,7 +34,6 @@ if [ -n "$RESULTS" ]; then fi echo "Analyzing flutter_kernel_transformers..." -pushd flutter/flutter_kernel_transformers/; pub get; popd RESULTS=`dartanalyzer \ --packages=flutter/flutter_kernel_transformers/.packages \ --options flutter/analysis_options.yaml \ From df7a02d44a6cb68c3801d8c20132b5cc2223e636 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 24 May 2018 18:04:55 -0400 Subject: [PATCH 0432/1190] Roll src/third_party/skia a0047bc..20027ce (19 commits) (#5365) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index d674e4d206115..b45b961f7ecbe 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a0047bcff704a9121a6d82a6f97d6124463a2e54', + 'skia_revision': '20027ceb284f470cda25d0ae2c35140b381e91c6', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b30dad765dd13..89be1a1028fa4 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c5ff57ee9491321a5677dc35fd295d3e +Signature: 6aba9ea3cc7cb380ba5635d24cc5e067 UNUSED LICENSES: @@ -17217,6 +17217,8 @@ FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp FILE: ../../../third_party/skia/src/core/SkBlurPriv.h FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXformSteps.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXformSteps.h FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_skcms.cpp FILE: ../../../third_party/skia/src/core/SkCoverageModePriv.h FILE: ../../../third_party/skia/src/core/SkCubicMap.cpp @@ -18987,14 +18989,14 @@ FILE: ../../../third_party/skia/src/gpu/ops/GrTessellatingPathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrTessellatingPathRenderer.h FILE: ../../../third_party/skia/src/gpu/text/GrAtlasTextBlob.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasTextBlob.h -FILE: ../../../third_party/skia/src/gpu/text/GrAtlasTextContext.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrAtlasTextContext.h FILE: ../../../third_party/skia/src/gpu/text/GrDistanceFieldAdjustTable.cpp FILE: ../../../third_party/skia/src/gpu/text/GrDistanceFieldAdjustTable.h FILE: ../../../third_party/skia/src/gpu/text/GrGlyphCache.cpp FILE: ../../../third_party/skia/src/gpu/text/GrGlyphCache.h FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobCache.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobCache.h +FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.h FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkBackendContext.cpp From bb758256d5b9fd712e2d489b5970265894e0c8bc Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 24 May 2018 15:20:42 -0700 Subject: [PATCH 0433/1190] Update buildroot to pull in msvc updates. (#5366) --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index b45b961f7ecbe..91e9a2cbfcc44 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '1e4fc3e8333b715dd091c1853578704471372cee', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'cce1705f816c05e4af002eb9280f336c188f699d', # Fuchsia compatibility # From abd74ed5ed7fdfabb80226db7480ba631f230e0b Mon Sep 17 00:00:00 2001 From: Simon Lightfoot Date: Thu, 24 May 2018 23:21:33 +0100 Subject: [PATCH 0434/1190] Add support for physical keyboards on Android (#5324) * Fixes flutter/flutter#7943 * Fixes flutter/flutter#9347 * Fixes flutter/flutter#11177 --- AUTHORS | 1 + .../editing/InputConnectionAdaptor.java | 27 +++++++++++++------ .../android/io/flutter/view/FlutterView.java | 14 +++++++++- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/AUTHORS b/AUTHORS index cfae1d6367c4e..3d412bd08c5e6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -9,3 +9,4 @@ Ali Bitek Jacob Greenfield Dan Field Victor Choueiri +Simon Lightfoot diff --git a/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java b/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java index e3d8acc000ffc..af7da838a3e7a 100644 --- a/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java +++ b/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java @@ -128,36 +128,47 @@ public boolean setSelection(int start, int end) { @Override public boolean sendKeyEvent(KeyEvent event) { - final boolean result = super.sendKeyEvent(event); - if (event.getAction() == KeyEvent.ACTION_UP) { + if (event.getAction() == KeyEvent.ACTION_DOWN) { if (event.getKeyCode() == KeyEvent.KEYCODE_DEL) { int selStart = Selection.getSelectionStart(mEditable); int selEnd = Selection.getSelectionEnd(mEditable); if (selEnd > selStart) { // Delete the selection. Selection.setSelection(mEditable, selStart); - deleteSurroundingText(0, selEnd - selStart); + mEditable.delete(selStart, selEnd); + updateEditingState(); + return true; } else if (selStart > 0) { // Delete to the left of the cursor. - Selection.setSelection(mEditable, selStart - 1); - deleteSurroundingText(0, 1); + int newSel = Math.max(selStart - 1, 0); + Selection.setSelection(mEditable, newSel); + mEditable.delete(newSel, selStart); + updateEditingState(); + return true; } } else if (event.getKeyCode() == KeyEvent.KEYCODE_DPAD_LEFT) { int selStart = Selection.getSelectionStart(mEditable); int newSel = Math.max(selStart - 1, 0); setSelection(newSel, newSel); + return true; } else if (event.getKeyCode() == KeyEvent.KEYCODE_DPAD_RIGHT) { int selStart = Selection.getSelectionStart(mEditable); int newSel = Math.min(selStart + 1, mEditable.length()); setSelection(newSel, newSel); + return true; } else { // Enter a character. int character = event.getUnicodeChar(); - if (character != 0) - commitText(String.valueOf((char) character), 1); + if (character != 0) { + int selStart = Math.max(0, Selection.getSelectionStart(mEditable)); + mEditable.insert(selStart, String.valueOf((char) character)); + setSelection(selStart + 1, selStart + 1); + updateEditingState(); + } + return true; } } - return result; + return false; } @Override diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 7734c29a0e31d..e80ccc0ab153d 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -22,6 +22,7 @@ import android.util.AttributeSet; import android.util.Log; import android.util.TypedValue; +import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.Surface; @@ -33,6 +34,7 @@ import android.view.accessibility.AccessibilityNodeProvider; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; +import android.view.inputmethod.InputMethodManager; import io.flutter.app.FlutterActivity; import io.flutter.app.FlutterPluginRegistry; import io.flutter.plugin.common.*; @@ -98,6 +100,7 @@ static final class ViewportMetrics { int physicalViewInsetLeft = 0; } + private final InputMethodManager mImm; private final TextInputPlugin mTextInputPlugin; private final SurfaceHolder.Callback mSurfaceCallback; private final ViewportMetrics mMetrics; @@ -114,6 +117,7 @@ static final class ViewportMetrics { private final AtomicLong nextTextureId = new AtomicLong(0L); private FlutterNativeView mNativeView; private boolean mIsSoftwareRenderingEnabled = false; // using the software renderer or not + private InputConnection mLastInputConnection; public FlutterView(Context context) { this(context, null); @@ -197,6 +201,7 @@ public void surfaceDestroyed(SurfaceHolder holder) { "flutter/platform", JSONMethodCodec.INSTANCE); flutterPlatformChannel.setMethodCallHandler(platformPlugin); addActivityLifecycleListener(platformPlugin); + mImm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); mTextInputPlugin = new TextInputPlugin(this); setLocale(getResources().getConfiguration().locale); @@ -238,6 +243,12 @@ public boolean onKeyDown(int keyCode, KeyEvent event) { return super.onKeyDown(keyCode, event); } + if (event.getDeviceId() != KeyCharacterMap.VIRTUAL_KEYBOARD) { + if (mLastInputConnection != null && mImm.isAcceptingText()) { + mLastInputConnection.sendKeyEvent(event); + } + } + Map message = new HashMap<>(); message.put("type", "keydown"); message.put("keymap", "android"); @@ -372,7 +383,8 @@ public void destroy() { @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) { try { - return mTextInputPlugin.createInputConnection(this, outAttrs); + mLastInputConnection = mTextInputPlugin.createInputConnection(this, outAttrs); + return mLastInputConnection; } catch (JSONException e) { Log.e(TAG, "Failed to create input connection", e); return null; From e25c70c64c10601ec3bfdc06850ad96528459522 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 24 May 2018 16:05:39 -0700 Subject: [PATCH 0435/1190] Explicitly package vm and isolate snapshots on desktop and embedder targets. (#5368) These snapshots used to be included (from the runtime target) in the executable if AOT mode was disabled. The mobile shells now include this snapshot in the kernel snapshot generated on the host. However the target that run on the host still need this. The tester target was already patched but the desktop embedder targets were overlooked. The unit tests passed on the embedder target because the unit tester exectuable was including the snapshot in addition to the dylib. Now the dylib itself depends on the snapshot directly. --- shell/platform/darwin/desktop/BUILD.gn | 1 + shell/platform/embedder/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/platform/darwin/desktop/BUILD.gn b/shell/platform/darwin/desktop/BUILD.gn index 5ec3298be4aa4..ddc54b67e9e35 100644 --- a/shell/platform/darwin/desktop/BUILD.gn +++ b/shell/platform/darwin/desktop/BUILD.gn @@ -22,6 +22,7 @@ source_set("mac_desktop_platform") { deps = [ "$flutter_root/common", "$flutter_root/fml", + "$flutter_root/lib/snapshot", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 777dd5b869d40..a6834ac5915ae 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -19,6 +19,7 @@ source_set("embedder") { "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", + "$flutter_root/lib/snapshot", "$flutter_root/shell/common", "$flutter_root/shell/gpu", "//garnet/public/lib/fxl", @@ -48,7 +49,6 @@ executable("embedder_unittests") { deps = [ ":embedder", ":fixtures", - "$flutter_root/lib/snapshot", "$flutter_root/testing", ] From bbbd930283f9b43c987dcaa67a80d961f6a4830a Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Thu, 24 May 2018 17:34:25 -0700 Subject: [PATCH 0436/1190] Removed sync_async flag from engine which was causing snapshot errors. (#5367) Will be reenabled when sync-async is on by default in flutter/flutter. --- runtime/dart_vm.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index a61413b1742ef..a97ba89a1d623 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -91,7 +91,8 @@ static const char* kDartStrongModeArgs[] = { "--strong", "--reify_generic_functions", "--limit_ints_to_64_bits", - "--sync_async", + // TODO(bkonyi): uncomment when sync-async is enabled in flutter/flutter. + // "--sync_async", // clang-format on }; From 03484cee14330c04e4905b2cd4b2463e790414d3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 24 May 2018 21:29:55 -0400 Subject: [PATCH 0437/1190] Roll src/third_party/skia 20027ce..89cd4bc (2 commits) (#5371) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 91e9a2cbfcc44..2b39c18701e22 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '20027ceb284f470cda25d0ae2c35140b381e91c6', + 'skia_revision': '89cd4bcd531cc633a4d8954cd1beb11b63208a60', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 89be1a1028fa4..95fddb26b68a1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6aba9ea3cc7cb380ba5635d24cc5e067 +Signature: 7ef6410627fa39582fb8a29b443d544a UNUSED LICENSES: From 2834f7e88b327fcf9e5ccf62947f925908a6dfbc Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 25 May 2018 01:23:55 -0400 Subject: [PATCH 0438/1190] Roll src/third_party/skia 89cd4bc..c571504 (1 commits) (#5372) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2b39c18701e22..40c67b69f0fbc 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '89cd4bcd531cc633a4d8954cd1beb11b63208a60', + 'skia_revision': 'c5715041be752e19e5b12abffaf5dfc06573db4a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 95fddb26b68a1..69856ce05346d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7ef6410627fa39582fb8a29b443d544a +Signature: 0dedd7aefbf7e1df8b76d6eba9c612c5 UNUSED LICENSES: From e962e54c3b189e64b7ff61b080a999f8f493f629 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 25 May 2018 09:02:55 -0400 Subject: [PATCH 0439/1190] Roll src/third_party/skia c571504..71e83e8 (1 commits) (#5373) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 40c67b69f0fbc..67989303e56e9 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c5715041be752e19e5b12abffaf5dfc06573db4a', + 'skia_revision': '71e83e85074187fce322851546e05f435cb8c7c4', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 69856ce05346d..fbe085a8f06cd 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0dedd7aefbf7e1df8b76d6eba9c612c5 +Signature: c3796c467d712499cb6af759eff93bcf UNUSED LICENSES: From 933d406107a1f7c7b68de52d5bcaffd69d76306a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 25 May 2018 12:29:15 -0400 Subject: [PATCH 0440/1190] Roll src/third_party/skia 71e83e8..26c0e4c (4 commits) (#5374) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 11306 ------------------ tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 34 +- 4 files changed, 34 insertions(+), 11310 deletions(-) diff --git a/DEPS b/DEPS index 67989303e56e9..7388e251dc0e0 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '71e83e85074187fce322851546e05f435cb8c7c4', + 'skia_revision': '26c0e4c1f54759249c2d61b50fb5430bd73793f2', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 08c8fb2c59582..e69de29bb2d1d 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -1,11306 +0,0 @@ -boringssl - -Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) -All rights reserved. - -This package is an SSL implementation written -by Eric Young (eay@cryptsoft.com). -The implementation was written so as to conform with Netscapes SSL. - -This library is free for commercial and non-commercial use as long as -the following conditions are aheared to. The following conditions -apply to all code found in this distribution, be it the RC4, RSA, -lhash, DES, etc., code; not just the SSL code. The SSL documentation -included with this distribution is covered by the same copyright terms -except that the holder is Tim Hudson (tjh@cryptsoft.com). - -Copyright remains Eric Young's, and as such any Copyright notices in -the code are not to be removed. -If this package is used in a product, Eric Young should be given attribution -as the author of the parts of the library used. -This can be in the form of a textual message at program startup or -in documentation (online or textual) provided with the package. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - "This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)" - The word 'cryptographic' can be left out if the rouines from the library - being used are not cryptographic related :-). -4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an acknowledgement: - "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -The licence and distribution terms for any publically available version or -derivative of this code cannot be changed. i.e. this code cannot simply be -copied and put under another distribution licence -[including the GNU Public Licence.] --------------------------------------------------------------------------------- -boringssl - -Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -All rights reserved. - -This package is an SSL implementation written -by Eric Young (eay@cryptsoft.com). -The implementation was written so as to conform with Netscapes SSL. - -This library is free for commercial and non-commercial use as long as -the following conditions are aheared to. The following conditions -apply to all code found in this distribution, be it the RC4, RSA, -lhash, DES, etc., code; not just the SSL code. The SSL documentation -included with this distribution is covered by the same copyright terms -except that the holder is Tim Hudson (tjh@cryptsoft.com). - -Copyright remains Eric Young's, and as such any Copyright notices in -the code are not to be removed. -If this package is used in a product, Eric Young should be given attribution -as the author of the parts of the library used. -This can be in the form of a textual message at program startup or -in documentation (online or textual) provided with the package. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - "This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)" - The word 'cryptographic' can be left out if the rouines from the library - being used are not cryptographic related :-). -4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an acknowledgement: - "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -The licence and distribution terms for any publically available version or -derivative of this code cannot be changed. i.e. this code cannot simply be -copied and put under another distribution licence -[including the GNU Public Licence.] --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2001 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2004 Kungliga Tekniska Högskolan -(Royal Institute of Technology, Stockholm, Sweden). -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -3. Neither the name of the Institute nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2004 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2006 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2006,2007 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2008 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2010 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2012 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2013 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2014 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - "This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)" - The word 'cryptographic' can be left out if the rouines from the library - being used are not cryptographic related :-). -4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an acknowledgement: - "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -The licence and distribution terms for any publically available version or -derivative of this code cannot be changed. i.e. this code cannot simply be -copied and put under another distribution licence -[including the GNU Public Licence.] --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2014, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015, Intel Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2016, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2017, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2018, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2003 Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2005 Nokia. All rights reserved. - -The portions of the attached software ("Contribution") is developed by -Nokia Corporation and is licensed pursuant to the OpenSSL open source -license. - -The Contribution, originally written by Mika Kousa and Pasi Eronen of -Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites -support (see RFC 4279) to OpenSSL. - -No patent licenses or other rights except those expressly stated in -the OpenSSL open source license shall be deemed granted or received -expressly, by implication, estoppel, or otherwise. - -No assurances are provided by Nokia that the Contribution does not -infringe the patent or other intellectual property rights of any third -party or that the license provides you with all the necessary rights -to make use of the Contribution. - -THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN -ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA -SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY -OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR -OTHERWISE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2006, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2007, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2008 Google Inc. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009 Google Inc. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2012, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2014, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2015, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2016 Brian Smith. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -OpenSSL License - - ==================================================================== - Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - - 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - - 5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - - THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - ==================================================================== - - This product includes cryptographic software written by Eric Young - (eay@cryptsoft.com). This product includes software written by Tim - Hudson (tjh@cryptsoft.com). - -Original SSLeay License - -* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -* All rights reserved. - -* This package is an SSL implementation written -* by Eric Young (eay@cryptsoft.com). -* The implementation was written so as to conform with Netscapes SSL. - -* This library is free for commercial and non-commercial use as long as -* the following conditions are aheared to. The following conditions -* apply to all code found in this distribution, be it the RC4, RSA, -* lhash, DES, etc., code; not just the SSL code. The SSL documentation -* included with this distribution is covered by the same copyright terms -* except that the holder is Tim Hudson (tjh@cryptsoft.com). - -* Copyright remains Eric Young's, and as such any Copyright notices in -* the code are not to be removed. -* If this package is used in a product, Eric Young should be given attribution -* as the author of the parts of the library used. -* This can be in the form of a textual message at program startup or -* in documentation (online or textual) provided with the package. - -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the copyright -* notice, this list of conditions and the following disclaimer. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* 3. All advertising materials mentioning features or use of this software -* must display the following acknowledgement: -* "This product includes cryptographic software written by -* Eric Young (eay@cryptsoft.com)" -* The word 'cryptographic' can be left out if the rouines from the library -* being used are not cryptographic related :-). -* 4. If you include any Windows specific code (or a derivative thereof) from -* the apps directory (application code) you must include an acknowledgement: -* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGE. - -* The licence and distribution terms for any publically available version or -* derivative of this code cannot be changed. i.e. this code cannot simply be -* copied and put under another distribution licence -* [including the GNU Public Licence.] - -ISC license used for completely new code in BoringSSL: - -/* Copyright (c) 2015, Google Inc. - - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -The code in third_party/fiat carries the MIT license: - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -The MIT License (MIT) - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -colorama - -Copyright (c) 2010 Jonathan Hartley -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holders, nor those of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2003-2005 Tom Wu -Copyright (c) 2012 Adam Singer (adam@solvr.io) -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, -INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF -THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -In addition, the following condition applies: - -All redistributions must retain an intact copy of this copyright notice -and disclaimer. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright 2012, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -double-conversion - -Copyright 2006-2008 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -double-conversion - -Copyright 2010 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -double-conversion - -Copyright 2012 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2013 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright 2017 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright 2018 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet - -Copyright 2013 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -icu -skia -topaz - -Copyright 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -icu -topaz - -Copyright 2014 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2016 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2017 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz -txt - -Copyright 2017 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -icu -skia -topaz - -Copyright 2016 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -skia -topaz - -Copyright 2018 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -files - -Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -files - -Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -files - -Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - and Clark Cooper -Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -files - -Copyright 2000, Clark Cooper -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 1995-2002 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 1995-2002 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2001, 2002 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2001, 2002, 2003, 2004 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2001-2008, 2011, 2013, 2014 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 1990, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000 Computing Research Labs, New Mexico State University -Copyright 2001-2004, 2011 Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000 Computing Research Labs, New Mexico State University -Copyright 2001-2014 - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000, 2001, 2004 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000-2001, 2002 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000-2001, 2003 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000-2010, 2012-2014 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2001, 2002, 2012 Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2003 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -The FreeType Project LICENSE - - 2006-Jan-27 - -Copyright 1996-2002, 2006 by -David Turner, Robert Wilhelm, and Werner Lemberg - -Introduction -============ - - The FreeType Project is distributed in several archive packages; - some of them may contain, in addition to the FreeType font engine, - various tools and contributions which rely on, or relate to, the - FreeType Project. - - This license applies to all files found in such packages, and - which do not fall under their own explicit license. The license - affects thus the FreeType font engine, the test programs, - documentation and makefiles, at the very least. - - This license was inspired by the BSD, Artistic, and IJG - (Independent JPEG Group) licenses, which all encourage inclusion - and use of free software in commercial and freeware products - alike. As a consequence, its main points are that: - - o We don't promise that this software works. However, we will be - interested in any kind of bug reports. (`as is' distribution) - - o You can use this software for whatever you want, in parts or - full form, without having to pay us. (`royalty-free' usage) - - o You may not pretend that you wrote this software. If you use - it, or only parts of it, in a program, you must acknowledge - somewhere in your documentation that you have used the - FreeType code. (`credits') - - We specifically permit and encourage the inclusion of this - software, with or without modifications, in commercial products. - We disclaim all warranties covering The FreeType Project and - assume no liability related to The FreeType Project. - - Finally, many people asked us for a preferred form for a - credit/disclaimer to use in compliance with this license. We thus - encourage you to use the following text: - - Portions of this software are copyright © The FreeType - Project (www.freetype.org). All rights reserved. - - Please replace with the value from the FreeType version you - actually use. - -Legal Terms -=========== - -0. Definitions - - Throughout this license, the terms `package', `FreeType Project', - and `FreeType archive' refer to the set of files originally - distributed by the authors (David Turner, Robert Wilhelm, and - Werner Lemberg) as the `FreeType Project', be they named as alpha, - beta or final release. - - `You' refers to the licensee, or person using the project, where - `using' is a generic term including compiling the project's source - code as well as linking it to form a `program' or `executable'. - This program is referred to as `a program using the FreeType - engine'. - - This license applies to all files distributed in the original - FreeType Project, including all source code, binaries and - documentation, unless otherwise stated in the file in its - original, unmodified form as distributed in the original archive. - If you are unsure whether or not a particular file is covered by - this license, you must contact us to verify this. - - The FreeType Project is copyright (C) 1996-2000 by David Turner, - Robert Wilhelm, and Werner Lemberg. All rights reserved except as - specified below. - -1. No Warranty - - THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO - USE, OF THE FREETYPE PROJECT. - -2. Redistribution - - This license grants a worldwide, royalty-free, perpetual and - irrevocable right and license to use, execute, perform, compile, - display, copy, create derivative works of, distribute and - sublicense the FreeType Project (in both source and object code - forms) and derivative works thereof for any purpose; and to - authorize others to exercise some or all of the rights granted - herein, subject to the following conditions: - - o Redistribution of source code must retain this license file - (`FTL.TXT') unaltered; any additions, deletions or changes to - the original files must be clearly indicated in accompanying - documentation. The copyright notices of the unaltered, - original files must be preserved in all copies of source - files. - - o Redistribution in binary form must provide a disclaimer that - states that the software is based in part of the work of the - FreeType Team, in the distribution documentation. We also - encourage you to put an URL to the FreeType web page in your - documentation, though this isn't mandatory. - - These conditions apply to any software derived from or based on - the FreeType Project, not just the unmodified files. If you use - our work, you must acknowledge us. However, no fee need be paid - to us. - -3. Advertising - - Neither the FreeType authors and contributors nor you shall use - the name of the other for commercial, advertising, or promotional - purposes without specific prior written permission. - - We suggest, but do not require, that you use one or more of the - following phrases to refer to this software in your documentation - or advertising materials: `FreeType Project', `FreeType Engine', - `FreeType library', or `FreeType Distribution'. - - As you have not signed this license, you are not required to - accept it. However, as the FreeType Project is copyrighted - material, only this license, or another one contracted with the - authors, grants you the right to use, distribute, and modify it. - Therefore, by using, distributing, or modifying the FreeType - Project, you indicate that you understand and accept all the terms - of this license. - -4. Contacts - - There are two mailing lists related to FreeType: - - o freetype@nongnu.org - - Discusses general use and applications of FreeType, as well as - future and wanted additions to the library and distribution. - If you are looking for support, start in this list if you - haven't found anything to help you in the documentation. - - o freetype-devel@nongnu.org - - Discusses bugs, as well as engine internals, design issues, - specific licenses, porting, etc. - - Our home page can be found at - - http://www.freetype.org - ---- end of FTL.TXT --- --------------------------------------------------------------------------------- -garnet - -Copyright 2013 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet - -Copyright 2014 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet - -Copyright 2017 The Fuchsia Authors.All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet -topaz - -Copyright 2015 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet -topaz - -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -gif - -GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! --------------------------------------------------------------------------------- -gif - -The Graphics Interchange Format(c) is the copyright property of CompuServe -Incorporated. Only CompuServe Incorporated is authorized to define, redefine, -enhance, alter, modify or change in any way the definition of the format. - -CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free -license for the use of the Graphics Interchange Format(sm) in computer -software; computer software utilizing GIF(sm) must acknowledge ownership of the -Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in -User and Technical Documentation. Computer software utilizing GIF, which is -distributed or may be distributed without User or Technical Documentation must -display to the screen or printer a message acknowledging ownership of the -Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in -this case, the acknowledgement may be displayed in an opening screen or leading -banner, or a closing screen or trailing banner. A message such as the following -may be used: - - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 1998-2004 David Turner and Werner Lemberg -Copyright © 2004,2007,2009 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 1998-2004 David Turner and Werner Lemberg -Copyright © 2004,2007,2009,2010 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 1998-2004 David Turner and Werner Lemberg -Copyright © 2006 Behdad Esfahbod -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007 Chris Wilson -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2010,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009,2010 Red Hat, Inc. -Copyright © 2010,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009,2010 Red Hat, Inc. -Copyright © 2010,2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009,2010 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2009 Keith Stribley -Copyright © 2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2011 Codethink Limited -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2011 Codethink Limited -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2010,2011,2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2010,2011,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2011,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2012,2014 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2014 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012 Mozilla Foundation. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012,2013 Mozilla Foundation. -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2013 Red Hat, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2014 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2015 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2015 Mozilla Foundation. -Copyright © 2015 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2016 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2016 Igalia S.L. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2017 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. -For parts of HarfBuzz that are licensed under different licenses see individual -files names COPYING in subdirectories where applicable. - -Copyright © 2010,2011,2012 Google, Inc. -Copyright © 2012 Mozilla Foundation -Copyright © 2011 Codethink Limited -Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) -Copyright © 2009 Keith Stribley -Copyright © 2009 Martin Hosken and SIL International -Copyright © 2007 Chris Wilson -Copyright © 2006 Behdad Esfahbod -Copyright © 2005 David Turner -Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. -Copyright © 1998-2004 David Turner and Werner Lemberg - -For full copyright notices consult the individual files in the package. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1995-2016 International Business Machines Corporation and others -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. - -All trademarks and registered trademarks mentioned herein are the -property of their respective owners. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1998 - 1999 Unicode, Inc. All Rights reserved. - Copyright (C) 2002-2005, International Business Machines - Corporation and others. All Rights Reserved. - -This file is provided as-is by Unicode, Inc. (The Unicode Consortium). -No claims are made as to fitness for any particular purpose. No -warranties of any kind are expressed or implied. The recipient -agrees to determine applicability of information provided. If this -file has been provided on optical media by Unicode, Inc., the sole -remedy for any claim will be exchange of defective media within 90 -days of receipt. - -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form for -internal or external distribution as long as this notice remains -attached. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1999 Computer Systems and Communication Lab, - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1999 Unicode, Inc. All Rights reserved. - Copyright (C) 2002-2005, International Business Machines - Corporation and others. All Rights Reserved. - -This file is provided as-is by Unicode, Inc. (The Unicode Consortium). -No claims are made as to fitness for any particular purpose. No -warranties of any kind are expressed or implied. The recipient -agrees to determine applicability of information provided. If this -file has been provided on optical media by Unicode, Inc., the sole -remedy for any claim will be exchange of defective media within 90 -days of receipt. - -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form for -internal or external distribution as long as this notice remains -attached. --------------------------------------------------------------------------------- -icu - -Copyright (c) 2002 Unicode, Inc. All Rights reserved. - Copyright (C) 2002-2005, International Business Machines - Corporation and others. All Rights Reserved. - -This file is provided as-is by Unicode, Inc. (The Unicode Consortium). -No claims are made as to fitness for any particular purpose. No -warranties of any kind are expressed or implied. The recipient -agrees to determine applicability of information provided. If this -file has been provided on optical media by Unicode, Inc., the sole -remedy for any claim will be exchange of defective media within 90 -days of receipt. - -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form for -internal or external distribution as long as this notice remains -attached. --------------------------------------------------------------------------------- -icu - -Copyright (c) 2013 International Business Machines Corporation -and others. All Rights Reserved. - -Project: http://code.google.com/p/lao-dictionary -Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt -License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt - (copied below) - - This file is derived from the above dictionary, with slight - modifications. - - Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, - are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. Redistributions in - binary form must reproduce the above copyright notice, this list of - conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) 2014 International Business Machines Corporation -and others. All Rights Reserved. - -This list is part of a project hosted at: - github.com/kanyawtech/myanmar-karen-word-lists - -Copyright (c) 2013, LeRoy Benjamin Sharon -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: Redistributions of source code must retain the above -copyright notice, this list of conditions and the following -disclaimer. Redistributions in binary form must reproduce the -above copyright notice, this list of conditions and the following -disclaimer in the documentation and/or other materials provided -with the distribution. - - Neither the name Myanmar Karen Word Lists, nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2010. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2011. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2012. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2014. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2016. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright 1996 Chih-Hao Tsai @ Beckman Institute, - University of Illinois -c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 --------------------------------------------------------------------------------- -icu - -Copyright 2000, 2001, 2002, 2003 Nara Institute of Science -and Technology. All Rights Reserved. - -Use, reproduction, and distribution of this software is permitted. -Any copy of this software, whether in its original form or modified, -must include both the above copyright notice and the following -paragraphs. - -Nara Institute of Science and Technology (NAIST), -the copyright holders, disclaims all warranties with regard to this -software, including all implied warranties of merchantability and -fitness, in no event shall NAIST be liable for -any special, indirect or consequential damages or any damages -whatsoever resulting from loss of use, data or profits, whether in an -action of contract, negligence or other tortuous action, arising out -of or in connection with the use or performance of this software. - -A large portion of the dictionary entries -originate from ICOT Free Software. The following conditions for ICOT -Free Software applies to the current dictionary as well. - -Each User may also freely distribute the Program, whether in its -original form or modified, to any third party or parties, PROVIDED -that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear -on, or be attached to, the Program, which is distributed substantially -in the same form as set out herein and that such intended -distribution, if actually made, will neither violate or otherwise -contravene any of the laws and regulations of the countries having -jurisdiction over the User or the intended distribution itself. - -NO WARRANTY - -The program was produced on an experimental basis in the course of the -research and development conducted during the project and is provided -to users as so produced on an experimental basis. Accordingly, the -program is provided without any warranty whatsoever, whether express, -implied, statutory or otherwise. The term "warranty" used herein -includes, but is not limited to, any warranty of the quality, -performance, merchantability and fitness for a particular purpose of -the program and the nonexistence of any infringement or violation of -any right of any third party. - -Each user of the program will agree and understand, and be deemed to -have agreed and understood, that there is no warranty whatsoever for -the program and, accordingly, the entire risk arising from or -otherwise connected with the program is assumed by the user. - -Therefore, neither ICOT, the copyright holder, or any other -organization that participated in or was otherwise related to the -development of the program and their respective officials, directors, -officers and other employees shall be held liable for any and all -damages, including, without limitation, general, special, incidental -and consequential damages, arising out of or otherwise in connection -with the use or inability to use the program or any product, material -or result produced or otherwise obtained by using the program, -regardless of whether they have been advised of, or otherwise had -knowledge of, the possibility of such damages at any time during the -project or thereafter. Each user will be deemed to have agreed to the -foregoing by his or her commencement of use of the program. The term -"use" as used herein includes, but is not limited to, the use, -modification, copying and distribution of the program and the -production of secondary products from the program. - -In the case where the program, whether in its original form or -modified, was distributed or delivered to or received by a user from -any person, organization or entity other than ICOT, unless it makes or -grants independently of ICOT any specific warranty to the user in -writing, such person, organization or entity, will also be exempted -from and not be held liable to the user for any such damages as noted -above as far as the program is concerned. --------------------------------------------------------------------------------- -icu - -Copyright © 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. --------------------------------------------------------------------------------- -icu - -Copyrighy (c) 1999 TaBE Project. -Copyright (c) 1999 Pai-Hsiang Hsiao. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the TaBE Project nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -ICU License - ICU 1.8.1 and later - -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1995-2009 International Business Machines Corporation and others - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. --------------------------------------------------------------------------------- -icu - -The BSD License -http://opensource.org/licenses/bsd-license.php -Copyright (C) 2006-2008, Google Inc. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following -disclaimer in the documentation and/or other materials provided with -the distribution. - Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Unicode® Terms of Use -For the general privacy policy governing access to this site, see the Unicode Privacy Policy. For trademark usage, see the Unicode® Consortium Name and Trademark Usage Policy. - -A. Unicode Copyright. -1. Copyright © 1991-2017 Unicode, Inc. All rights reserved. -2. Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. -3. Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files solely for informational purposes and in the creation of products supporting the Unicode Standard, subject to the Terms and Conditions herein. -4. Further specifications of rights and restrictions pertaining to the use of the particular set of data files known as the "Unicode Character Database" can be found in the License. -5. Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. The online code charts carry specific restrictions. All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. -6. No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. -7. Modification is not permitted with respect to this document. All copies of this document must be verbatim. -B. Restricted Rights Legend. Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. -C. Warranties and Disclaimers. -1. This publication and/or website may include technical or typographical errors or other inaccuracies . Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. -2. If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. -3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. -D. Waiver of Damages. In no event shall Unicode or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. -E. Trademarks & Logos. -1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. -2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. -3. All third party trademarks referenced herein are the property of their respective owners. -F. Miscellaneous. -1. Jurisdiction and Venue. This server is operated from a location in the State of California, United States of America. Unicode makes no representation that the materials are appropriate for use in other locations. If you access this server from other locations, you are responsible for compliance with local laws. This Agreement, all use of this site and any claims and damages resulting from use of this site are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this site shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. -2. Modification by Unicode Unicode shall have the right to modify this Agreement at any time by posting it to this site. The user may not assign any part of this Agreement without Unicode’s prior written consent. -3. Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. -4. Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. -5. Entire Agreement. This Agreement constitutes the entire agreement between the parties. - -EXHIBIT 1 -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - -Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and -http://www.unicode.org/utility/trac/browser/. - -Unicode Data Files do not include PDF online code charts under the -directory http://www.unicode.org/Public/. - -Software includes any source code published in the Unicode Standard -or under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and -http://www.unicode.org/utility/trac/browser/. - -NOTICE TO USER: Carefully read the following legal agreement. -BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S -DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), -YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE -TERMS AND CONDITIONS OF THIS AGREEMENT. -IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE -THE DATA FILES OR SOFTWARE. - -COPYRIGHT AND PERMISSION NOTICE - -Copyright © 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009-2011, 2014-2016, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). -All Rights Reserved. -Author: Siarhei Siamashka -Copyright (C) 2013-2014, Linaro Limited. All Rights Reserved. -Author: Ragesh Radhakrishnan -Copyright (C) 2014-2016, D. R. Commander. All Rights Reserved. -Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. -Copyright (C) 2016, Siarhei Siamashka. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). -All Rights Reserved. -Author: Siarhei Siamashka -Copyright (C) 2014, Siarhei Siamashka. All Rights Reserved. -Copyright (C) 2014, Linaro Limited. All Rights Reserved. -Copyright (C) 2015, D. R. Commander. All Rights Reserved. -Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2011, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2013, MIPS Technologies, Inc., California. -All Rights Reserved. -Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) - Darko Laus (darko.laus@imgtec.com) -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2013-2014, MIPS Technologies, Inc., California. -All Rights Reserved. -Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) - Darko Laus (darko.laus@imgtec.com) -Copyright (C) 2015, D. R. Commander. All Rights Reserved. -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2014, D. R. Commander. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. -Copyright (C) 2014, Jay Foad. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2015, D. R. Commander. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2009-2014 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2009-2015 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2009-2016 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2011 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2011, 2015 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2011-2016 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. -Copyright (C) 2015-2016, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014, 2016, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014, D. R. Commander. -Copyright (C) 2013-2014, MIPS Technologies, Inc., California. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014-2015, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2010, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library - version 1.02 - -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2011, 2014, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2011, 2014-2016, D. R. Commander. -Copyright (C) 2013-2014, MIPS Technologies, Inc., California. -Copyright (C) 2014, Linaro Limited. -Copyright (C) 2015-2016, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2011, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009, 2012 Pierre Ossman for Cendio AB -Copyright (C) 2009, 2012, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009, 2012 Pierre Ossman for Cendio AB -Copyright (C) 2012, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project -to include only information relevant to libjpeg-turbo, to wordsmith certain -sections, and to remove impolitic language that existed in the libjpeg v8 -README. It is included only for reference. Please see README.md for -information specific to libjpeg-turbo. - -The Independent JPEG Group's JPEG software -========================================== - -This distribution contains a release of the Independent JPEG Group's free JPEG -software. You are welcome to redistribute this software and to use it for any -purpose, subject to the conditions under LEGAL ISSUES, below. - -This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, -Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, -Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, -and other members of the Independent JPEG Group. - -IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee -(also known as JPEG, together with ITU-T SG16). - -DOCUMENTATION ROADMAP -===================== - -This file contains the following sections: - -OVERVIEW General description of JPEG and the IJG software. -LEGAL ISSUES Copyright, lack of warranty, terms of distribution. -REFERENCES Where to learn more about JPEG. -ARCHIVE LOCATIONS Where to find newer versions of this software. -FILE FORMAT WARS Software *not* to get. -TO DO Plans for future IJG releases. - -Other documentation files in the distribution are: - -User documentation: - usage.txt Usage instructions for cjpeg, djpeg, jpegtran, - rdjpgcom, and wrjpgcom. - *.1 Unix-style man pages for programs (same info as usage.txt). - wizard.txt Advanced usage instructions for JPEG wizards only. - change.log Version-to-version change highlights. -Programmer and internal documentation: - libjpeg.txt How to use the JPEG library in your own programs. - example.c Sample code for calling the JPEG library. - structure.txt Overview of the JPEG library's internal structure. - coderules.txt Coding style rules --- please read if you contribute code. - -Please read at least usage.txt. Some information can also be found in the JPEG -FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find -out where to obtain the FAQ article. - -If you want to understand how the JPEG code works, we suggest reading one or -more of the REFERENCES, then looking at the documentation files (in roughly -the order listed) before diving into the code. - -OVERVIEW -======== - -This package contains C software to implement JPEG image encoding, decoding, -and transcoding. JPEG (pronounced "jay-peg") is a standardized compression -method for full-color and grayscale images. JPEG's strong suit is compressing -photographic images or other types of images that have smooth color and -brightness transitions between neighboring pixels. Images with sharp lines or -other abrupt features may not compress well with JPEG, and a higher JPEG -quality may have to be used to avoid visible compression artifacts with such -images. - -JPEG is lossy, meaning that the output pixels are not necessarily identical to -the input pixels. However, on photographic content and other "smooth" images, -very good compression ratios can be obtained with no visible compression -artifacts, and extremely high compression ratios are possible if you are -willing to sacrifice image quality (by reducing the "quality" setting in the -compressor.) - -This software implements JPEG baseline, extended-sequential, and progressive -compression processes. Provision is made for supporting all variants of these -processes, although some uncommon parameter settings aren't implemented yet. -We have made no provision for supporting the hierarchical or lossless -processes defined in the standard. - -We provide a set of library routines for reading and writing JPEG image files, -plus two sample applications "cjpeg" and "djpeg", which use the library to -perform conversion between JPEG and some other popular image file formats. -The library is intended to be reused in other applications. - -In order to support file conversion and viewing software, we have included -considerable functionality beyond the bare JPEG coding/decoding capability; -for example, the color quantization modules are not strictly part of JPEG -decoding, but they are essential for output to colormapped file formats or -colormapped displays. These extra functions can be compiled out of the -library if not required for a particular application. - -We have also included "jpegtran", a utility for lossless transcoding between -different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple -applications for inserting and extracting textual comments in JFIF files. - -The emphasis in designing this software has been on achieving portability and -flexibility, while also making it fast enough to be useful. In particular, -the software is not intended to be read as a tutorial on JPEG. (See the -REFERENCES section for introductory material.) Rather, it is intended to -be reliable, portable, industrial-strength code. We do not claim to have -achieved that goal in every aspect of the software, but we strive for it. - -We welcome the use of this software as a component of commercial products. -No royalty is required, but we do ask for an acknowledgement in product -documentation, as described under LEGAL ISSUES. - -LEGAL ISSUES -============ - -In plain English: - -1. We don't promise that this software works. (But if you find any bugs, - please let us know!) -2. You can use this software for whatever you want. You don't have to pay us. -3. You may not pretend that you wrote this software. If you use it in a - program, you must acknowledge somewhere in your documentation that - you've used the IJG code. - -In legalese: - -The authors make NO WARRANTY or representation, either express or implied, -with respect to this software, its quality, accuracy, merchantability, or -fitness for a particular purpose. This software is provided "AS IS", and you, -its user, assume the entire risk as to its quality and accuracy. - -This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. -All Rights Reserved except as specified below. - -Permission is hereby granted to use, copy, modify, and distribute this -software (or portions thereof) for any purpose, without fee, subject to these -conditions: -(1) If any part of the source code for this software is distributed, then this -README file must be included, with this copyright and no-warranty notice -unaltered; and any additions, deletions, or changes to the original files -must be clearly indicated in accompanying documentation. -(2) If only executable code is distributed, then the accompanying -documentation must state that "this software is based in part on the work of -the Independent JPEG Group". -(3) Permission for use of this software is granted only if the user accepts -full responsibility for any undesirable consequences; the authors accept -NO LIABILITY for damages of any kind. - -These conditions apply to any software derived from or based on the IJG code, -not just to the unmodified library. If you use our work, you ought to -acknowledge us. - -Permission is NOT granted for the use of any IJG author's name or company name -in advertising or publicity relating to this software or products derived from -it. This software may be referred to only as "the Independent JPEG Group's -software". - -We specifically permit and encourage the use of this software as the basis of -commercial products, provided that all warranty or liability claims are -assumed by the product vendor. - -The Unix configuration script "configure" was produced with GNU Autoconf. -It is copyright by the Free Software Foundation but is freely distributable. -The same holds for its supporting scripts (config.guess, config.sub, -ltmain.sh). Another support script, install-sh, is copyright by X Consortium -but is also freely distributable. - -The IJG distribution formerly included code to read and write GIF files. -To avoid entanglement with the Unisys LZW patent (now expired), GIF reading -support has been removed altogether, and the GIF writer has been simplified -to produce "uncompressed GIFs". This technique does not use the LZW -algorithm; the resulting GIF files are larger than usual, but are readable -by all standard GIF decoders. - -We are required to state that - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." - -REFERENCES -========== - -We recommend reading one or more of these references before trying to -understand the innards of the JPEG software. - -The best short technical introduction to the JPEG compression algorithm is - Wallace, Gregory K. "The JPEG Still Picture Compression Standard", - Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. -(Adjacent articles in that issue discuss MPEG motion picture compression, -applications of JPEG, and related topics.) If you don't have the CACM issue -handy, a PDF file containing a revised version of Wallace's article is -available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually -a preprint for an article that appeared in IEEE Trans. Consumer Electronics) -omits the sample images that appeared in CACM, but it includes corrections -and some added material. Note: the Wallace article is copyright ACM and IEEE, -and it may not be used for commercial purposes. - -A somewhat less technical, more leisurely introduction to JPEG can be found in -"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by -M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides -good explanations and example C code for a multitude of compression methods -including JPEG. It is an excellent source if you are comfortable reading C -code but don't know much about data compression in general. The book's JPEG -sample code is far from industrial-strength, but when you are ready to look -at a full implementation, you've got one here... - -The best currently available description of JPEG is the textbook "JPEG Still -Image Data Compression Standard" by William B. Pennebaker and Joan L. -Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. -Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG -standards (DIS 10918-1 and draft DIS 10918-2). - -The original JPEG standard is divided into two parts, Part 1 being the actual -specification, while Part 2 covers compliance testing methods. Part 1 is -titled "Digital Compression and Coding of Continuous-tone Still Images, -Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS -10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of -Continuous-tone Still Images, Part 2: Compliance testing" and has document -numbers ISO/IEC IS 10918-2, ITU-T T.83. - -The JPEG standard does not specify all details of an interchangeable file -format. For the omitted details we follow the "JFIF" conventions, revision -1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report -and thus received a formal publication status. It is available as a free -download in PDF format from -http://www.ecma-international.org/publications/techreports/E-TR-098.htm. -A PostScript version of the JFIF document is available at -http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at -http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures. - -The TIFF 6.0 file format specification can be obtained by FTP from -ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme -found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. -IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). -Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 -(Compression tag 7). Copies of this Note can be obtained from -http://www.ijg.org/files/. It is expected that the next revision -of the TIFF spec will replace the 6.0 JPEG design with the Note's design. -Although IJG's own code does not support TIFF/JPEG, the free libtiff library -uses our library to implement TIFF/JPEG per the Note. - -ARCHIVE LOCATIONS -================= - -The "official" archive site for this software is www.ijg.org. -The most recent released version can always be found there in -directory "files". - -The JPEG FAQ (Frequently Asked Questions) article is a source of some -general information about JPEG. -It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq -and other news.answers archive sites, including the official news.answers -archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. -If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu -with body - send usenet/news.answers/jpeg-faq/part1 - send usenet/news.answers/jpeg-faq/part2 - -FILE FORMAT WARS -================ - -The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together -with ITU-T SG16) currently promotes different formats containing the name -"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does -not support these formats (see REFERENCES). Indeed, one of the original -reasons for developing this free software was to help force convergence on -common, interoperable format standards for JPEG files. -Don't use an incompatible file format! -(In any case, our decoder will remain capable of reading existing JPEG -image files indefinitely.) - -TO DO -===== - -Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. --------------------------------------------------------------------------------- -libsdl -skia - -Copyright 2016 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright (c) 2010, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2010 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2011 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2012 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2013 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2014 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2015 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2016 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2017 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2006-2012 The Authors - -Contributors: -James Graham - jg307@cam.ac.uk -Anne van Kesteren - annevankesteren@gmail.com -Lachlan Hunt - lachlan.hunt@lachy.id.au -Matt McDonald - kanashii@kanashii.ca -Sam Ruby - rubys@intertwingly.net -Ian Hickson (Google) - ian@hixie.ch -Thomas Broyer - t.broyer@ltgt.net -Jacques Distler - distler@golem.ph.utexas.edu -Henri Sivonen - hsivonen@iki.fi -Adam Barth - abarth@webkit.org -Eric Seidel - eric@webkit.org -The Mozilla Foundation (contributions from Henri Sivonen since 2008) -David Flanagan (Mozilla) - dflanagan@mozilla.com -Google Inc. (contributed the Dart port) - misc@dartlang.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2013, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014 Seth Ladd. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014, Michael Bostock and Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. -Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2017, the Dart project authors. -Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2013, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2014, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2015, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2016, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages -pkg - -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages -skia -txt -vulkan - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. --------------------------------------------------------------------------------- -rapidjson - -Copyright (c) 2006-2013 Alexander Chemeris - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the product nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -rapidjson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -root_certificates - -Mozilla Public License -Version 2.0 - -1. Definitions - -1.1. “Contributor” - -means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. - -1.2. “Contributor Version” - -means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - -means Covered Software of a particular Contributor. - -1.4. “Covered Software” - -means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. - -1.5. “Incompatible With Secondary Licenses” - -means - - a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. - -1.6. “Executable Form” - -means any form of the work other than Source Code Form. - -1.7. “Larger Work” - -means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. - -1.8. “License” - -means this document. - -1.9. “Licensable” - -means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. - -1.10. “Modifications” - -means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - -means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. - -1.12. “Secondary License” - -means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - -means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - -means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. - -2. License Grants and Conditions - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its Contributions. - -This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. - -3. Responsibilities - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - -Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - -This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. - -10. Versions of the License - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. --------------------------------------------------------------------------------- -root_certificates - -Mozilla Public License Version 2.0 -================================== - -1. Definitions - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -* 6. Disclaimer of Warranty - -* Covered Software is provided under this License on an "as is" -* basis, without warranty of any kind, either expressed, implied, or -* statutory, including, without limitation, warranties that the -* Covered Software is free of defects, merchantable, fit for a -* particular purpose or non-infringing. The entire risk as to the -* quality and performance of the Covered Software is with You. -* Should any Covered Software prove defective in any respect, You -* (not any Contributor) assume the cost of any necessary servicing, -* repair, or correction. This disclaimer of warranty constitutes an -* essential part of this License. No use of any Covered Software is -* authorized under this License except under this disclaimer. - -* 7. Limitation of Liability - -* Under no circumstances and under no legal theory, whether tort -* (including negligence), contract, or otherwise, shall any -* Contributor, or anyone who distributes Covered Software as -* permitted above, be liable to You for any direct, indirect, -* special, incidental, or consequential damages of any character -* including, without limitation, damages for lost profits, loss of -* goodwill, work stoppage, computer failure or malfunction, or any -* and all other commercial damages or losses, even if such party -* shall have been informed of the possibility of such damages. This -* limitation of liability shall not apply to liability for death or -* personal injury resulting from such party's negligence to the -* extent applicable law prohibits such limitation. Some -* jurisdictions do not allow the exclusion or limitation of -* incidental or consequential damages, so this exclusion and -* limitation may not apply to You. - -8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. --------------------------------------------------------------------------------- -skcms - -Copyright (c) 2018 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skcms -skia - -Copyright 2018 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2014 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2014-2016 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and/or associated documentation files (the "Materials"), -to deal in the Materials without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Materials, and to permit persons to whom the -Materials are furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Materials. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2005 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2006 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2006-2012 The Android Open Source Project -Copyright 2012 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2007 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2008 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2008 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2009 Motorola - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2009 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2009-2015 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2010 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2010 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2011 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2011 Google Inc. -Copyright 2012 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2011 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2012 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2012 Intel Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2012 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2013 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2013 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2014 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2014 Google Inc. -Copyright 2017 ARM Ltd. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2014 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2015 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2015 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2016 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2016 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2017 ARM Ltd. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2017 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2018 Google LLC - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2018 Google, LLC - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2018 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -NEON optimized code (C) COPYRIGHT 2009 Motorola - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -tcmalloc - -Copyright (c) 2003, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -tcmalloc - -Copyright (c) 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -topaz - -Copyright 2016 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -topaz - -Copyright 2017 Th%e Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2003, 2010 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2003, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2005 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2005, 2010 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2005, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2006, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2007 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2008, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2009 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly -detect_data_type() function provided freely by Cosmin Truta, 2006 - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - -Modifications for Zip64 support -Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - -For more info read MiniZip_info.txt - -Condition of use and distribution are the same than zlib : - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - -Modifications of Unzip for Zip64 -Copyright (C) 2007-2008 Even Rouault - -Modifications for Zip64 support on both zip and unzip -Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - -For more info read MiniZip_info.txt - -Condition of use and distribution are the same than zlib : - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2004, 2005, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2004, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation -Authors: - Arjan van de Ven - Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation. All rights reserved. -Author: - Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation. All rights reserved. -Authors: - Wajdi Feghali - Jim Guilford - Vinodh Gopal - Erdinc Ozturk - Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2014 Intel Corporation - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (c) 2011 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -zlib - -Copyright (c) 2012 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -zlib - -zlib.h -- interface of the 'zlib' general purpose compression library -version 1.2.4, March 14th, 2010 - -Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. - -Jean-loup Gailly -Mark Adler diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 44dfbcc4a9821..3dcd0a08685cf 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-dev.50.0" + dart: ">=1.21.0 <=2.0.0-dev.55.0" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fbe085a8f06cd..0f075ebf53564 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c3796c467d712499cb6af759eff93bcf +Signature: 86a7c508122ae208e6a2e9fa5725cc4a UNUSED LICENSES: @@ -17208,6 +17208,7 @@ FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h +FILE: ../../../third_party/skia/include/gpu/vk/GrVkMemoryAllocator.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h @@ -17311,6 +17312,8 @@ FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp @@ -21189,6 +21192,33 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: vulkanmemoryallocator +ORIGIN: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/LICENSE.txt +TYPE: LicenseType.mit +FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h +---------------------------------------------------------------------------------------------------- +Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: zlib ORIGIN: ../../../third_party/zlib/LICENSE @@ -21924,4 +21954,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 320 +Total license count: 321 From a1a54ad1f9d845c8cff31e0d5faca2a012213b80 Mon Sep 17 00:00:00 2001 From: Brandon Parrish Date: Fri, 25 May 2018 09:55:41 -0700 Subject: [PATCH 0441/1190] Added application callback (#5369) * Added application callback * Formatting --- .../darwin/ios/framework/Headers/FlutterPlugin.h | 9 +++++++++ .../ios/framework/Source/FlutterAppDelegate.mm | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index 646ffa30d74fd..1fe71dd8b2ca1 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -146,6 +146,15 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)application:(UIApplication*)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; + +/** + Called if this plugin has been registered for `UIApplicationDelegate` callbacks. + + - Returns: `YES` if this plugin handles the request. + */ +- (BOOL)application:(UIApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler; @end /** diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index a5132bf4ee4e0..0eddadab0de12 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -235,6 +235,20 @@ - (void)application:(UIApplication*)application } } +- (void)application:(UIApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler { + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + continueUserActivity:userActivty + restorationHandler:restorationHandler]) { + return; + } + } + } +} + // TODO(xster): move when doing https://github.com/flutter/flutter/issues/3671. - (NSObject*)binaryMessenger { UIViewController* rootViewController = _window.rootViewController; From 0e1966cd504bebe931ff088e14c72ae5458dc97e Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Fri, 25 May 2018 10:31:56 -0700 Subject: [PATCH 0442/1190] Reduce log spam: failing to find an instructions buffer isn't an error for ordinary core snapshots. (#5370) --- fml/platform/posix/native_library_posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fml/platform/posix/native_library_posix.cc b/fml/platform/posix/native_library_posix.cc index 934d1d1a7c611..2fd72dfb4b87f 100644 --- a/fml/platform/posix/native_library_posix.cc +++ b/fml/platform/posix/native_library_posix.cc @@ -60,7 +60,7 @@ fxl::RefPtr NativeLibrary::CreateForCurrentProcess() { const uint8_t* NativeLibrary::ResolveSymbol(const char* symbol) { auto resolved_symbol = static_cast(::dlsym(handle_, symbol)); if (resolved_symbol == nullptr) { - FXL_DLOG(ERROR) << "Could not resolve symbol in library: " << symbol; + FXL_DLOG(INFO) << "Could not resolve symbol in library: " << symbol; } return resolved_symbol; } From 67f82eedec8b55285e45f03348865e5aad00ec78 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Fri, 25 May 2018 10:37:58 -0700 Subject: [PATCH 0443/1190] Dart SDK roll for 2018-05-25 (#5376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1be13871bb7 [ VM ] Addressed additional comments from CL 56461. 5cc37366445 [vm/frontend-server] Include errors count into compile expression response. 891efdca599 Fix status file for analyzer. ad4cfa0260f [mirrors] Add IsolateMirror.loadUri. a64bbbf6b30 Bump to watcher 0.9.7+8. eb19be5ff84 [vm/tool] Teach precompiler2 script to build ELF binaries. 7c43cfad9fd [vm] Mark superclasses of interfaces implemented. 2f7874ab99a [ VM ] Updated include path for typed_data_utils.h which was causing Flutter build to fail. 3c6907ed0d2 [vm/kernel/aot] Approximate numerous invocations per selector in TFA 75a75263d35 Clone annotations when cloning nodes that have them d3da30c152e Report errors on non-synthetic tokens 351d70674d2 Initial new union of Dart Analysis Fixes, the initial fix is to remove all unused imports in a file. e8bb129816f Adjusted setter conflict specification, cf. #33077 0a042a270f5 Fix a bug in the async transformation of let expressions 6fc0c1fa4fb [vm/kernel] Only create zone handles when necessary (e.g. in IR instructions, LocalVariable). 735f7bdcec5 Updated for expected FF failure. 02bcbc12fa2 [vm/kernel] Fix partial instantiation implementation in StreamingConstantEvaluator. 8d4a1ccaf6d Split ReadOnlyAccessGenerator ee9e1c15719 Split TypeUseGenerator 9ec756b31c7 Split DeferredAccessGenerator 163807ad406 Split LoadLibraryGenerator 51fa5c16628 Correctly transform async functions with FutureOr return types bca70073ae0 [vm/kernel] Move kernel2kenrel "constants" transformation before TFA 1d8a72cacdf Split StaticAccessGenerator 2d46ebd6a5c Fix Dart 2 runtime errors in the front end 89514bd8cf7 Cleanup library_loader. 21b65a97328 Remove unused typedef code 18407141b7a Split deferred load entity computation by class, member and local function b84f18e3929 [VM] Mark seemingly consistently failing test on windows d07b9aa0e07 Add explicit type args on generators b3862d5a922 Split SuperIndexedAccessGenerator 0ec82e24ce1 Avoid late creation of entities. 1d59ab22ce1 Fix #29014, make function type parameters invariant. 4d7bbb53ab5 Use AbstractValue in ClosedWorld 89f37416fec Fix windows bot breakage for package:build tests. 9b44fc39c86 Deprecate chaseDependencies option. 05f96af05a9 [ VM ] Fix failing non-UTF8 path test on MacOS c541cda2161 [ VM ] Fixed issue where error code was being clobbered by call to Dart_TypedDataReleaseData on Windows, resulting in OSError returning a 0 error instead of the true error code. a00dae22601 Update test_parseAwaitExpression_inSync 9cd0e808db2 Convert more identifier contexts 552680b7f04 First round of changes to dart2js to make it strong mode clean. cc4fe66de8f Replace parseTypeVariables with computeTypeParam c3b6df5eb79 Update dartdoc and dependencies to v0.19.1. 3ab7cf05904 Revert "[dart:io] Revert recent non-utf8 path handling" 7c59fe63326 Flip dartfmt to run in Dart 2 mode. ade600c4b39 Update constructor identifier context e35ed9c7495 [ VM / Build ] Added '--no-include-kernel-service' to build.py. By default, the kernel service is now included in all build modes, including product mode. Providing '--no-include-kernel-service' will build the specified configuration without the kernel service. e5eee0d57a1 Add Forest support for labeled statements 83e29023f4d Add schema-based file system 8f4c9bcf159 Add single-root file system. 1567b442ddc Add Forest support for catch clauses 9816fce2897 Fixed to use catchError instead of try/catch. 88d847ea3e6 [release] Prepare CHANGELOG.md for 2.0.0-dev.58.0 2a5724c75c8 New package:build workspace before we support it at the language level 4f5db3aef2c Update pub DEP – includes Dart2 type fixes 0a9697596e3 Add Forest support for for statements 4fb0c609387 [vm/kernel] Set active class when evaluating Dart annotations 8427d53a4d8 Extra precedence level in parser to distinguish postfix operators and selectors 1ce9b2541b9 Replace call to parseTypeVariablesOpt with computeTypeParam f7e09684b6d Split IndexedAccessGenerator and ThisIndexedAccessGenerator 9f3cd54d3bb Remove UnhandledListener 98fcc338ca0 Fix diet_listener.dart imports 3a5454a691c Split SuperPropertyAccessGenerator e0144d51bbe [VM] Add UNREACHABLE() to AOT constant evaluator in the VM fa6fd268923 Remove unused IdentifierContext instance cbe76eeea01 [release] Prepare changelog for 2.0.0-dev.57.0 e62f37f3961 Tighten failure and success of test. a80dfa12d7c Revert "Add colons" 443c23c0913 Remove subpackage_relationships_test.dart 7583fb882ab [vm] Refactor state bits to free up two bits on Function. 0271003c332 Extract parseFunctionLiteral from parseType b8cb785aed9 Improve formal parameter identifier recovery 9f1097948af [fasta] Add and use a type-inference-specific interface of BodyBuilder 3960cacc89e Make peek return null when the stack is empty 3582e30d8ec [VM] Remove unused _Random._A field in Dart sources and make constant in C++ code instead f8cca09ce3d [VM] Do not invoke the empty StackOverflowError/OutOfMemoryError constructors 39bccc125d0 Split NullAwarePropertyAccessGenerator 29253c57edd Add colons fc95fd920bb Move generators out of body_builder 39516de7531 Split ThisPropertyAccessGenerator 2d79c356e09 Start creating common superclass for generators 2a7188523e6 Fixed status cf87b84f7d5 Support Promise to Future for both DDC and dart2js. 6d8f473d4f6 [ VM / Hot Reload ] Updated kernel_service and hot reload behavior to run as long as the compiler returns valid kernel. f4f79acb61d Improve annotation identifier recovery 3bdd1731753 Call computeType rather than parseType 2c8c05f877b [dart2js] merge generator body into empty entry function 96cfc632bb0 [infra] Use a less specific browser version that works across platforms 3ac2a3fe19c Address comment from 55981 8c0f5747a08 Add build_integration package and move multi_root_file_system there. ba0da68563f Update status for new test 3f6c87d5ace [vm/compiler] Do not use Constant(#null) to reserve space on the expression stack. a7562480655 Add Forest support for assert statements and initializers a9ab8f4e7d2 [GN] Hack around Dart 2 application_snapshot deps issue 298129c3a42 Improve part of identifier recovery 371c8e4b870 Append version and CRC32 to data in FileByteStore. 6cc0d9770f7 Skip expressions by parsing them with a no-op listener. 3ccd5a06f5f [js_runtime] Fix for 'o is FutureOr' with function type T d34fe65afad Revert "New package:build workspace before we support it at the language level." 580e486386d Make CastStreamSubscription.onData handle a null callback 2a8eb8089dc [infra] Specify chrome version used by builds running on the test matrix eeec6466b6a Convert the command-line analyzer to a dart 2 snapshot. 89df6b785d3 Issue 33181. Use RefactoringWorkspace in rename refactoring to determine when element being renamed is outside the workspace. 85ddeb990a8 [release] Prepare changelog for 2.0.0-dev.56.0 7ff8adcec9d Fix an incorrect dart:mirrors test 08d466bfad9 [kernel] Treat TypeParameter.defaultType as a child in visit methods 330dcb19dab Rename remaining generators 2c9d8924e31 [fasta] Make explicit Object in bound a constraint during type inference 5924c356401 Prepare to remove expression_generator_impl.dart c771e4d1325 DDC: disallow ignore option on Stream cast failures e191d4feb5f Simplify errors on invalid arguments 7ab9ea0e4e0 Change return type of Fangorn.parenthesizedCondition 09582b46ea0 Remove FastaAccessor and Accessor a7385679685 Convert ContextAccessor to ContextAwareGenerator bbdf560ee7e Convert UnresolvedAccessor to UnresolvedNameGenerator b5c6143d74d Convert IncompleteSend to IncompleteSendGenerator 63ff7ee922f [vm/interpreter] Support closures in bytecode. Support reordered bytecode metadata sections. For now, read but ignore exceptions table in bytecode metadata. e1cabfd1d43 [dart2js] 'Fix' error in registrations 49d5ca3bb4d Switch to BigInt for ConstantValue. 9696c9dcd08 Change analysis_server tests to use /project/test.dart as the test file. e71bd048e57 [vm, kernel] Fix async stack code traversal in dart2. 714697efbb9 [vm/kernel/bytecode] Write constant pool before bytecode and exceptions table 80b48195b16 [frontend-server] Serialize compiled expression procedure into the file. 68b19b4ff44 [vm/kernel/bytecode] Add invocation kind to StaticICData constant 929b79e8653 [dart2js] Don't insert redundant checks 4cf51e6c1af Give (the old) ContextRoot path.Context to work with paths. bea580c3a45 Disallow ignore on any explicit cast failures 1cf871a4d26 Improve import/export combinator identifier recovery 79a0ef60e01 Fix for 'Convert to final field' quick assist when no return type. bbb8905075f Observatory strong mode fixes: specify type argument to .map when not inferable. 841a91b3a01 Observatory strong mode fixes: Add abstract Location.toUserString to Location. fc206a7589a Add Kill isolate service request. aad3270ab81 Observatory strong mode fixes: fix C-style parameter declarations. ea4d10915c0 Observatory strong mode fixes: make return types more specific. 0f506ba3ae9 Added period to comment for consistency. 5ab42940745 [vm] Allow for creating a CoreJIT snapshot from a kernel file. d5b99860e40 [frontend-server] Introduce compile-expression command. ac8971a98a8 New package:build workspace before we support it at the language level. 99eb2195c8e Add Forest support for break and continue statements 4d3ebab589e [vm] Fix error message when an API function is called without a current isolate. c31b9a461d9 [vm/kernel] Reference constants in Dill by offset into constants table. 0ff6c20c666 Add Forest support for return statements 85fbc71f225 More test framework cleanup 62027494294 [vm/kernel/bytecode] Support try-catch-finally in bytecode generator 78cc8a13a2b Improve type parameter recovery 3e7eef12d4d Remove reference to token.previous 5b4d67b22e1 Compute runtime completions in the context file itsef. 720b6c963c4 Improve some tests and fix a Dart 2 error ff76905aebb [dart2js] Don't try to generate stubs for generator bodies 4610daa1c10 Convert ThisAccessor to ThisAccessGenerator cb9bf910f9b Test that fasta_codes_generated.dart is up to date eec11ebe4af Convert ErrorAccessor to ErroneousExpressionGenerator a155d6c9e59 Update dependencies on async, collection, http_throttle packages ce1dc866207 Adjust status file. 21fbf7d7677 fix #33103, switch dartdevk to use Kernel nSM stubs 5632b1cb473 Adjust status file for precompiled target (see issue 33168) 41468e7c031 [VM] bypass some app_jit tests which have issues with mismatched VM options between the snapshot version and the invoked dart process. c38bca632df [fuchsia] Fix bad state error on namespace cleanup b911f78ee23 Use AbstractValue/AbstractValueDomain in function_set.dart c9ea44bd8fe Use the static type from the identifier element is local completions. 715ba58048d Remove reference to token.previous 4edb23cfc17 Bump to linter 0.1.51. 2ff2af79213 Allow running pub with --preview-dart-2 7aacf7e188b [ VM / dart:io ] Fixed memory leak in SecurityContext on MacOS. ada23cde0b8 Add deferred test for local functions f1f660fe1e6 Small cleanup 9f6e8a3a96a Move DDC to Dart 2 snapshot be5b189c19c Exclude synthetic import prefixes from runtime completion. 7ac05a120ad Add Forest support for do statements 029e1394f7d Make type promotion conditional depending on which builder is being used 817965f49d1 Runtime completion support for constructors, for loops, and function expressions. 02e47a97313 [VM] Fix for issue 32188 (cannot use `pub` with --preview-dart-2) --- DEPS | 21 ++-- frontend_server/lib/server.dart | 17 +++ tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 109 ++++++++++---------- 4 files changed, 83 insertions(+), 66 deletions(-) diff --git a/DEPS b/DEPS index 7388e251dc0e0..3a3cbf220a5d9 100644 --- a/DEPS +++ b/DEPS @@ -31,23 +31,23 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '97b6c2e09d6532eeb622d85f23109f3f3b6d2b61', + 'dart_revision': '1be13871bb70bda3ae456cc269297766eb47444d', 'dart_args_tag': '1.4.1', - 'dart_async_tag': '2.0.6', + 'dart_async_tag': '2.0.7', 'dart_bazel_worker_tag': 'v0.1.9', 'dart_boolean_selector_tag': '1.0.3', 'dart_boringssl_gen_rev': '344f455fd13d46f054726638e76026156ea73aa9', 'dart_boringssl_rev': '672f6fc2486745d0cabc3aaeb4e0a3cd13b37b12', 'dart_charcode_tag': 'v1.1.1', 'dart_cli_util_tag': '0.1.2+1', - 'dart_collection_tag': '1.14.6', + 'dart_collection_tag': '1.14.9', 'dart_convert_tag': '2.0.1', 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+2', 'dart_dart_style_tag': '1.0.14', - 'dart_dartdoc_tag': 'v0.19.0', + 'dart_dartdoc_tag': 'v0.19.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', @@ -55,16 +55,16 @@ vars = { 'dart_http_parser_tag': '3.1.1', 'dart_http_retry_tag': '0.1.1', 'dart_http_tag': '0.11.3+16', - 'dart_http_throttle_tag': '1.0.1', + 'dart_http_throttle_tag': '1.0.2', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.50', + 'dart_linter_tag': '0.1.51', 'dart_logging_tag': '0.11.3+1', - 'dart_markdown_tag': '1.1.1', + 'dart_markdown_tag': '2.0.0', 'dart_matcher_tag': '0.12.1+4', 'dart_mime_tag': '0.9.6', 'dart_mockito_tag': 'a92db054fba18bc2d605be7670aee74b7cadc00a', - 'dart_mustache4dart_tag': 'v2.1.1', + 'dart_mustache4dart_tag': 'v2.1.2', 'dart_oauth2_tag': '1.1.0', 'dart_observatory_pub_packages_rev': 'd3a3aebefbd35aa30fe7bbc2889b772b398f7d7f', 'dart_package_config_tag': '1.0.3', @@ -73,7 +73,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '0c172864be2d2043a9d630e07f6b4eae7472653f', + 'dart_pub_rev': '7bdcf4e4de85a7a8c7a322511b8198f1b6cb0a73', 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', @@ -94,10 +94,9 @@ vars = { 'dart_typed_data_tag': '1.1.3', 'dart_usage_tag': '3.3.0', 'dart_utf_tag': '0.9.0+4', - 'dart_watcher_tag': '0.9.7+7', + 'dart_watcher_tag': '0.9.7+8', 'dart_web_socket_channel_tag': '1.0.7', 'dart_yaml_tag': '2.1.13', - # Build bot tooling for iOS 'ios_tools_revision': '69b7c1b160e7107a6a98d948363772dc9caea46f', diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index 4965e82be7c3a..6ca06f27942ef 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -48,6 +48,23 @@ class _FlutterFrontendCompiler implements frontend.CompilerInterface{ void resetIncrementalCompiler() { _compiler.resetIncrementalCompiler(); } + + @override + Future compileExpression( + String expression, + List definitions, + List typeDefinitions, + String libraryUri, + String klass, + bool isStatic) { + return _compiler.compileExpression(expression, definitions, typeDefinitions, + libraryUri, klass, isStatic); + } + + @override + void reportError(String msg) { + _compiler.reportError(msg); + } } /// Entry point for this module, that creates `_FrontendCompiler` instance and diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 3dcd0a08685cf..d7a3ee5462f72 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-dev.55.0" + dart: ">=1.21.0 <=2.0.0-edge.00a51975424ac4ff73fdf04888fe073601010307" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 0f075ebf53564..5e465b16932d9 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 86a7c508122ae208e6a2e9fa5725cc4a +Signature: 67bd8b8a2ec5aeee42d6a9fb3972e546 UNUSED LICENSES: @@ -4824,7 +4824,6 @@ FILE: ../../../third_party/dart/sdk/lib/core/string.dart FILE: ../../../third_party/dart/sdk/lib/core/type.dart FILE: ../../../third_party/dart/sdk/lib/core/uri.dart FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/html/dartium/nativewrappers.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/css_class_set.dart @@ -5496,6 +5495,60 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/typed_data_utils.cc + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.cc +FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h +FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h +FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h +FILE: ../../../third_party/dart/runtime/vm/datastream.cc +FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h +FILE: ../../../third_party/dart/runtime/vm/hash.h +FILE: ../../../third_party/dart/runtime/vm/interpreter.cc +FILE: ../../../third_party/dart/runtime/vm/interpreter.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h +FILE: ../../../third_party/dart/sdk/lib/js/_js.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart +FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: dart ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/loader.dart + ../../../third_party/dart/LICENSE @@ -6021,58 +6074,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h -FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h -FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h -FILE: ../../../third_party/dart/runtime/vm/datastream.cc -FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h -FILE: ../../../third_party/dart/runtime/vm/hash.h -FILE: ../../../third_party/dart/runtime/vm/interpreter.cc -FILE: ../../../third_party/dart/runtime/vm/interpreter.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h -FILE: ../../../third_party/dart/sdk/lib/js/_js.dart -FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart -FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart -FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: double-conversion ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum-dtoa.cc From 193d873cae7c666d266be0e82ceb9f4034f7aa73 Mon Sep 17 00:00:00 2001 From: Brandon Parrish Date: Fri, 25 May 2018 11:29:11 -0700 Subject: [PATCH 0444/1190] Revert "Added application callback" (#5377) * Revert "Added application callback (#5369)" This reverts commit a1a54ad1f9d845c8cff31e0d5faca2a012213b80. --- .../darwin/ios/framework/Headers/FlutterPlugin.h | 9 --------- .../ios/framework/Source/FlutterAppDelegate.mm | 14 -------------- 2 files changed, 23 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index 1fe71dd8b2ca1..646ffa30d74fd 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -146,15 +146,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)application:(UIApplication*)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; - -/** - Called if this plugin has been registered for `UIApplicationDelegate` callbacks. - - - Returns: `YES` if this plugin handles the request. - */ -- (BOOL)application:(UIApplication*)application - continueUserActivity:(NSUserActivity*)userActivity - restorationHandler:(void (^)(NSArray*))restorationHandler; @end /** diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index 0eddadab0de12..a5132bf4ee4e0 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -235,20 +235,6 @@ - (void)application:(UIApplication*)application } } -- (void)application:(UIApplication*)application - continueUserActivity:(NSUserActivity*)userActivity - restorationHandler:(void (^)(NSArray*))restorationHandler { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - continueUserActivity:userActivty - restorationHandler:restorationHandler]) { - return; - } - } - } -} - // TODO(xster): move when doing https://github.com/flutter/flutter/issues/3671. - (NSObject*)binaryMessenger { UIViewController* rootViewController = _window.rootViewController; From b067d79ce90fc883d890e1346e70c19328a6eb7a Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 25 May 2018 12:09:36 -0700 Subject: [PATCH 0445/1190] Copy embedder header to the out directory. (#5379) This allows the stable header to be referenced from a known location. Also reduces the visibility of the framework target so that it is automatically built on the mac. --- BUILD.gn | 6 ++---- shell/platform/embedder/BUILD.gn | 37 ++++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 836cd08366e3a..cdcf0cd0fc0c0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -33,10 +33,8 @@ group("flutter") { # If on the host, compile all unittests targets. if (current_toolchain == host_toolchain) { if (is_mac) { - public_deps += [ - "$flutter_root/shell/platform/darwin:flutter_channels_unittests", - "$flutter_root/shell/platform/embedder:flutter_embedder_framework", - ] + public_deps += + [ "$flutter_root/shell/platform/darwin:flutter_channels_unittests" ] } public_deps += [ diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index a6834ac5915ae..91d86f3c8f0bd 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -57,7 +57,11 @@ executable("embedder_unittests") { } } -shared_library("flutter_engine") { +shared_library("flutter_engine_library") { + visibility = [ ":*" ] + + output_name = "flutter_engine" + deps = [ ":embedder", ] @@ -65,6 +69,16 @@ shared_library("flutter_engine") { public_configs = [ "$flutter_root:config" ] } +copy("copy_headers") { + visibility = [ ":*" ] + sources = [ + "embedder.h", + ] + outputs = [ + "$root_out_dir/flutter_embedder.h", + ] +} + if (is_mac) { _flutter_embedder_framework_dir = "$root_out_dir/FlutterEmbedder.framework" @@ -77,11 +91,11 @@ if (is_mac) { "$_flutter_embedder_framework_dir/Versions/A/FlutterEmbedder", ] deps = [ - ":flutter_engine", + ":flutter_engine_library", ] } - copy("copy_headers") { + copy("copy_framework_headers") { visibility = [ ":*" ] sources = [ "embedder.h", @@ -149,6 +163,7 @@ if (is_mac) { } action("generate_symlinks") { + visibility = [ ":*" ] script = "//build/config/mac/package_framework.py" outputs = [ "$root_build_dir/FlutterEmbedder.stamp", @@ -167,7 +182,7 @@ if (is_mac) { "FlutterEmbedder.stamp", ] deps = [ - ":copy_headers", + ":copy_framework_headers", ":copy_icu", ":copy_info_plist", ":copy_module_map", @@ -176,8 +191,22 @@ if (is_mac) { } group("flutter_embedder_framework") { + visibility = [ ":*" ] deps = [ ":generate_symlinks", ] } } + +group("flutter_engine") { + # All platforms require the embedder dylib and headers. + deps = [ + ":copy_headers", + ":flutter_engine_library", + ] + + # For the Mac, the dylib is packaged in a framework with the appropriate headers. + if (is_mac) { + deps += [ ":flutter_embedder_framework" ] + } +} From e07251b12766a7e5abd90f70ec7fb17beb24a474 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 25 May 2018 15:52:55 -0400 Subject: [PATCH 0446/1190] Roll src/third_party/skia 26c0e4c..6857df7 (6 commits) (#5380) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 11306 ++++++++++++++++++ travis/licenses_golden/licenses_third_party | 134 +- 3 files changed, 11358 insertions(+), 84 deletions(-) diff --git a/DEPS b/DEPS index 3a3cbf220a5d9..0a15da7fdea97 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '26c0e4c1f54759249c2d61b50fb5430bd73793f2', + 'skia_revision': '6857df77b06c6e5be2409926bf1901349f5466d0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index e69de29bb2d1d..08c8fb2c59582 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -0,0 +1,11306 @@ +boringssl + +Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] +-------------------------------------------------------------------------------- +boringssl + +Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2001 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2004 Kungliga Tekniska Högskolan +(Royal Institute of Technology, Stockholm, Sweden). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the Institute nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2004 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2006 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2006,2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2008 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2010 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2012 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2013 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2014 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2014, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015, Intel Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2016, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2017, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2018, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2003 Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2005 Nokia. All rights reserved. + +The portions of the attached software ("Contribution") is developed by +Nokia Corporation and is licensed pursuant to the OpenSSL open source +license. + +The Contribution, originally written by Mika Kousa and Pasi Eronen of +Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites +support (see RFC 4279) to OpenSSL. + +No patent licenses or other rights except those expressly stated in +the OpenSSL open source license shall be deemed granted or received +expressly, by implication, estoppel, or otherwise. + +No assurances are provided by Nokia that the Contribution does not +infringe the patent or other intellectual property rights of any third +party or that the license provides you with all the necessary rights +to make use of the Contribution. + +THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN +ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA +SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY +OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR +OTHERWISE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2005, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2006, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2007, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2008 Google Inc. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2008, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009 Google Inc. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2012, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2014, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2015, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2016 Brian Smith. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +OpenSSL License + + ==================================================================== + Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + + 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + + 5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + + THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ==================================================================== + + This product includes cryptographic software written by Eric Young + (eay@cryptsoft.com). This product includes software written by Tim + Hudson (tjh@cryptsoft.com). + +Original SSLeay License + +* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +* All rights reserved. + +* This package is an SSL implementation written +* by Eric Young (eay@cryptsoft.com). +* The implementation was written so as to conform with Netscapes SSL. + +* This library is free for commercial and non-commercial use as long as +* the following conditions are aheared to. The following conditions +* apply to all code found in this distribution, be it the RC4, RSA, +* lhash, DES, etc., code; not just the SSL code. The SSL documentation +* included with this distribution is covered by the same copyright terms +* except that the holder is Tim Hudson (tjh@cryptsoft.com). + +* Copyright remains Eric Young's, and as such any Copyright notices in +* the code are not to be removed. +* If this package is used in a product, Eric Young should be given attribution +* as the author of the parts of the library used. +* This can be in the form of a textual message at program startup or +* in documentation (online or textual) provided with the package. + +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* 1. Redistributions of source code must retain the copyright +* notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* 3. All advertising materials mentioning features or use of this software +* must display the following acknowledgement: +* "This product includes cryptographic software written by +* Eric Young (eay@cryptsoft.com)" +* The word 'cryptographic' can be left out if the rouines from the library +* being used are not cryptographic related :-). +* 4. If you include any Windows specific code (or a derivative thereof) from +* the apps directory (application code) you must include an acknowledgement: +* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +* SUCH DAMAGE. + +* The licence and distribution terms for any publically available version or +* derivative of this code cannot be changed. i.e. this code cannot simply be +* copied and put under another distribution licence +* [including the GNU Public Licence.] + +ISC license used for completely new code in BoringSSL: + +/* Copyright (c) 2015, Google Inc. + + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +The code in third_party/fiat carries the MIT license: + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +The MIT License (MIT) + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +colorama + +Copyright (c) 2010 Jonathan Hartley +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holders, nor those of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2003-2005 Tom Wu +Copyright (c) 2012 Adam Singer (adam@solvr.io) +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, +INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF +THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +In addition, the following condition applies: + +All redistributions must retain an intact copy of this copyright notice +and disclaimer. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright 2012, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart +observatory_pub_packages + +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +double-conversion + +Copyright 2006-2008 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +double-conversion + +Copyright 2010 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +double-conversion + +Copyright 2012 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + +Copyright (c) 2013 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + +Copyright 2017 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + +Copyright 2018 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet + +Copyright 2013 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +icu +skia +topaz + +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +icu +topaz + +Copyright 2014 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz + +Copyright 2016 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz + +Copyright 2017 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz +txt + +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +icu +skia +topaz + +Copyright 2016 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +skia +topaz + +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +files + +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +files + +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +files + +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +files + +Copyright 2000, Clark Cooper +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001, 2002 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001, 2002, 2003, 2004 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001-2008, 2011, 2013, 2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 1990, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000 Computing Research Labs, New Mexico State University +Copyright 2001-2004, 2011 Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000 Computing Research Labs, New Mexico State University +Copyright 2001-2014 + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000, 2001, 2004 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000-2001, 2002 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000-2001, 2003 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000-2010, 2012-2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2001, 2002, 2012 Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2003 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +The FreeType Project LICENSE + + 2006-Jan-27 + +Copyright 1996-2002, 2006 by +David Turner, Robert Wilhelm, and Werner Lemberg + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + + Please replace with the value from the FreeType version you + actually use. + +Legal Terms +=========== + +0. Definitions + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + http://www.freetype.org + +--- end of FTL.TXT --- +-------------------------------------------------------------------------------- +garnet + +Copyright 2013 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet + +Copyright 2014 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet + +Copyright 2017 The Fuchsia Authors.All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet +topaz + +Copyright 2015 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet +topaz + +Copyright 2018 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +gif + +GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +-------------------------------------------------------------------------------- +gif + +The Graphics Interchange Format(c) is the copyright property of CompuServe +Incorporated. Only CompuServe Incorporated is authorized to define, redefine, +enhance, alter, modify or change in any way the definition of the format. + +CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free +license for the use of the Graphics Interchange Format(sm) in computer +software; computer software utilizing GIF(sm) must acknowledge ownership of the +Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in +User and Technical Documentation. Computer software utilizing GIF, which is +distributed or may be distributed without User or Technical Documentation must +display to the screen or printer a message acknowledging ownership of the +Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in +this case, the acknowledgement may be displayed in an opening screen or leading +banner, or a closing screen or trailing banner. A message such as the following +may be used: + + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 1998-2004 David Turner and Werner Lemberg +Copyright © 2004,2007,2009 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 1998-2004 David Turner and Werner Lemberg +Copyright © 2004,2007,2009,2010 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 1998-2004 David Turner and Werner Lemberg +Copyright © 2006 Behdad Esfahbod +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007 Chris Wilson +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2010,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009,2010 Red Hat, Inc. +Copyright © 2010,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009,2010 Red Hat, Inc. +Copyright © 2010,2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009,2010 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2009 Keith Stribley +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2011 Codethink Limited +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2011 Codethink Limited +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2010,2011,2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2010,2011,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2011,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2012,2014 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2014 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012 Mozilla Foundation. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012,2013 Mozilla Foundation. +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2013 Red Hat, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2014 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2015 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2015 Mozilla Foundation. +Copyright © 2015 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2016 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2016 Igalia S.L. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2017 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +For parts of HarfBuzz that are licensed under different licenses see individual +files names COPYING in subdirectories where applicable. + +Copyright © 2010,2011,2012 Google, Inc. +Copyright © 2012 Mozilla Foundation +Copyright © 2011 Codethink Limited +Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) +Copyright © 2009 Keith Stribley +Copyright © 2009 Martin Hosken and SIL International +Copyright © 2007 Chris Wilson +Copyright © 2006 Behdad Esfahbod +Copyright © 2005 David Turner +Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. +Copyright © 1998-2004 David Turner and Werner Lemberg + +For full copyright notices consult the individual files in the package. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1995-2016 International Business Machines Corporation and others +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. + +All trademarks and registered trademarks mentioned herein are the +property of their respective owners. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1998 - 1999 Unicode, Inc. All Rights reserved. + Copyright (C) 2002-2005, International Business Machines + Corporation and others. All Rights Reserved. + +This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +No claims are made as to fitness for any particular purpose. No +warranties of any kind are expressed or implied. The recipient +agrees to determine applicability of information provided. If this +file has been provided on optical media by Unicode, Inc., the sole +remedy for any claim will be exchange of defective media within 90 +days of receipt. + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form for +internal or external distribution as long as this notice remains +attached. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1999 Computer Systems and Communication Lab, + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1999 Unicode, Inc. All Rights reserved. + Copyright (C) 2002-2005, International Business Machines + Corporation and others. All Rights Reserved. + +This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +No claims are made as to fitness for any particular purpose. No +warranties of any kind are expressed or implied. The recipient +agrees to determine applicability of information provided. If this +file has been provided on optical media by Unicode, Inc., the sole +remedy for any claim will be exchange of defective media within 90 +days of receipt. + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form for +internal or external distribution as long as this notice remains +attached. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 2002 Unicode, Inc. All Rights reserved. + Copyright (C) 2002-2005, International Business Machines + Corporation and others. All Rights Reserved. + +This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +No claims are made as to fitness for any particular purpose. No +warranties of any kind are expressed or implied. The recipient +agrees to determine applicability of information provided. If this +file has been provided on optical media by Unicode, Inc., the sole +remedy for any claim will be exchange of defective media within 90 +days of receipt. + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form for +internal or external distribution as long as this notice remains +attached. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 2013 International Business Machines Corporation +and others. All Rights Reserved. + +Project: http://code.google.com/p/lao-dictionary +Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt +License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt + (copied below) + + This file is derived from the above dictionary, with slight + modifications. + + Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, + are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. Redistributions in + binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 2014 International Business Machines Corporation +and others. All Rights Reserved. + +This list is part of a project hosted at: + github.com/kanyawtech/myanmar-karen-word-lists + +Copyright (c) 2013, LeRoy Benjamin Sharon +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: Redistributions of source code must retain the above +copyright notice, this list of conditions and the following +disclaimer. Redistributions in binary form must reproduce the +above copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided +with the distribution. + + Neither the name Myanmar Karen Word Lists, nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2010. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2011. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2012. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2014. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2016. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + University of Illinois +c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 +-------------------------------------------------------------------------------- +icu + +Copyright 2000, 2001, 2002, 2003 Nara Institute of Science +and Technology. All Rights Reserved. + +Use, reproduction, and distribution of this software is permitted. +Any copy of this software, whether in its original form or modified, +must include both the above copyright notice and the following +paragraphs. + +Nara Institute of Science and Technology (NAIST), +the copyright holders, disclaims all warranties with regard to this +software, including all implied warranties of merchantability and +fitness, in no event shall NAIST be liable for +any special, indirect or consequential damages or any damages +whatsoever resulting from loss of use, data or profits, whether in an +action of contract, negligence or other tortuous action, arising out +of or in connection with the use or performance of this software. + +A large portion of the dictionary entries +originate from ICOT Free Software. The following conditions for ICOT +Free Software applies to the current dictionary as well. + +Each User may also freely distribute the Program, whether in its +original form or modified, to any third party or parties, PROVIDED +that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear +on, or be attached to, the Program, which is distributed substantially +in the same form as set out herein and that such intended +distribution, if actually made, will neither violate or otherwise +contravene any of the laws and regulations of the countries having +jurisdiction over the User or the intended distribution itself. + +NO WARRANTY + +The program was produced on an experimental basis in the course of the +research and development conducted during the project and is provided +to users as so produced on an experimental basis. Accordingly, the +program is provided without any warranty whatsoever, whether express, +implied, statutory or otherwise. The term "warranty" used herein +includes, but is not limited to, any warranty of the quality, +performance, merchantability and fitness for a particular purpose of +the program and the nonexistence of any infringement or violation of +any right of any third party. + +Each user of the program will agree and understand, and be deemed to +have agreed and understood, that there is no warranty whatsoever for +the program and, accordingly, the entire risk arising from or +otherwise connected with the program is assumed by the user. + +Therefore, neither ICOT, the copyright holder, or any other +organization that participated in or was otherwise related to the +development of the program and their respective officials, directors, +officers and other employees shall be held liable for any and all +damages, including, without limitation, general, special, incidental +and consequential damages, arising out of or otherwise in connection +with the use or inability to use the program or any product, material +or result produced or otherwise obtained by using the program, +regardless of whether they have been advised of, or otherwise had +knowledge of, the possibility of such damages at any time during the +project or thereafter. Each user will be deemed to have agreed to the +foregoing by his or her commencement of use of the program. The term +"use" as used herein includes, but is not limited to, the use, +modification, copying and distribution of the program and the +production of secondary products from the program. + +In the case where the program, whether in its original form or +modified, was distributed or delivered to or received by a user from +any person, organization or entity other than ICOT, unless it makes or +grants independently of ICOT any specific warranty to the user in +writing, such person, organization or entity, will also be exempted +from and not be held liable to the user for any such damages as noted +above as far as the program is concerned. +-------------------------------------------------------------------------------- +icu + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. +-------------------------------------------------------------------------------- +icu + +Copyrighy (c) 1999 TaBE Project. +Copyright (c) 1999 Pai-Hsiang Hsiao. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the TaBE Project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +ICU License - ICU 1.8.1 and later + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2009 International Business Machines Corporation and others + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. +-------------------------------------------------------------------------------- +icu + +The BSD License +http://opensource.org/licenses/bsd-license.php +Copyright (C) 2006-2008, Google Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided with +the distribution. + Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Unicode® Terms of Use +For the general privacy policy governing access to this site, see the Unicode Privacy Policy. For trademark usage, see the Unicode® Consortium Name and Trademark Usage Policy. + +A. Unicode Copyright. +1. Copyright © 1991-2017 Unicode, Inc. All rights reserved. +2. Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. +3. Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files solely for informational purposes and in the creation of products supporting the Unicode Standard, subject to the Terms and Conditions herein. +4. Further specifications of rights and restrictions pertaining to the use of the particular set of data files known as the "Unicode Character Database" can be found in the License. +5. Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. The online code charts carry specific restrictions. All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. +6. No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. +7. Modification is not permitted with respect to this document. All copies of this document must be verbatim. +B. Restricted Rights Legend. Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. +C. Warranties and Disclaimers. +1. This publication and/or website may include technical or typographical errors or other inaccuracies . Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. +2. If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. +3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. +D. Waiver of Damages. In no event shall Unicode or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. +E. Trademarks & Logos. +1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. +2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. +3. All third party trademarks referenced herein are the property of their respective owners. +F. Miscellaneous. +1. Jurisdiction and Venue. This server is operated from a location in the State of California, United States of America. Unicode makes no representation that the materials are appropriate for use in other locations. If you access this server from other locations, you are responsible for compliance with local laws. This Agreement, all use of this site and any claims and damages resulting from use of this site are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this site shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. +2. Modification by Unicode Unicode shall have the right to modify this Agreement at any time by posting it to this site. The user may not assign any part of this Agreement without Unicode’s prior written consent. +3. Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. +4. Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. +5. Entire Agreement. This Agreement constitutes the entire agreement between the parties. + +EXHIBIT 1 +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +Unicode Data Files do not include PDF online code charts under the +directory http://www.unicode.org/Public/. + +Software includes any source code published in the Unicode Standard +or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009-2011, 2014-2016, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). +All Rights Reserved. +Author: Siarhei Siamashka +Copyright (C) 2013-2014, Linaro Limited. All Rights Reserved. +Author: Ragesh Radhakrishnan +Copyright (C) 2014-2016, D. R. Commander. All Rights Reserved. +Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. +Copyright (C) 2016, Siarhei Siamashka. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). +All Rights Reserved. +Author: Siarhei Siamashka +Copyright (C) 2014, Siarhei Siamashka. All Rights Reserved. +Copyright (C) 2014, Linaro Limited. All Rights Reserved. +Copyright (C) 2015, D. R. Commander. All Rights Reserved. +Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2011, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2013, MIPS Technologies, Inc., California. +All Rights Reserved. +Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) + Darko Laus (darko.laus@imgtec.com) +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2013-2014, MIPS Technologies, Inc., California. +All Rights Reserved. +Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) + Darko Laus (darko.laus@imgtec.com) +Copyright (C) 2015, D. R. Commander. All Rights Reserved. +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2014, D. R. Commander. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. +Copyright (C) 2014, Jay Foad. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2015, D. R. Commander. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2009-2014 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2009-2015 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2009-2016 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2011 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2011, 2015 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2011-2016 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. +Copyright (C) 2015-2016, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014, 2016, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014, D. R. Commander. +Copyright (C) 2013-2014, MIPS Technologies, Inc., California. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014-2015, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2010, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library - version 1.02 + +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2011, 2014, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2011, 2014-2016, D. R. Commander. +Copyright (C) 2013-2014, MIPS Technologies, Inc., California. +Copyright (C) 2014, Linaro Limited. +Copyright (C) 2015-2016, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2011, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009, 2012 Pierre Ossman for Cendio AB +Copyright (C) 2009, 2012, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009, 2012 Pierre Ossman for Cendio AB +Copyright (C) 2012, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project +to include only information relevant to libjpeg-turbo, to wordsmith certain +sections, and to remove impolitic language that existed in the libjpeg v8 +README. It is included only for reference. Please see README.md for +information specific to libjpeg-turbo. + +The Independent JPEG Group's JPEG software +========================================== + +This distribution contains a release of the Independent JPEG Group's free JPEG +software. You are welcome to redistribute this software and to use it for any +purpose, subject to the conditions under LEGAL ISSUES, below. + +This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, +Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, +Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, +and other members of the Independent JPEG Group. + +IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee +(also known as JPEG, together with ITU-T SG16). + +DOCUMENTATION ROADMAP +===================== + +This file contains the following sections: + +OVERVIEW General description of JPEG and the IJG software. +LEGAL ISSUES Copyright, lack of warranty, terms of distribution. +REFERENCES Where to learn more about JPEG. +ARCHIVE LOCATIONS Where to find newer versions of this software. +FILE FORMAT WARS Software *not* to get. +TO DO Plans for future IJG releases. + +Other documentation files in the distribution are: + +User documentation: + usage.txt Usage instructions for cjpeg, djpeg, jpegtran, + rdjpgcom, and wrjpgcom. + *.1 Unix-style man pages for programs (same info as usage.txt). + wizard.txt Advanced usage instructions for JPEG wizards only. + change.log Version-to-version change highlights. +Programmer and internal documentation: + libjpeg.txt How to use the JPEG library in your own programs. + example.c Sample code for calling the JPEG library. + structure.txt Overview of the JPEG library's internal structure. + coderules.txt Coding style rules --- please read if you contribute code. + +Please read at least usage.txt. Some information can also be found in the JPEG +FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find +out where to obtain the FAQ article. + +If you want to understand how the JPEG code works, we suggest reading one or +more of the REFERENCES, then looking at the documentation files (in roughly +the order listed) before diving into the code. + +OVERVIEW +======== + +This package contains C software to implement JPEG image encoding, decoding, +and transcoding. JPEG (pronounced "jay-peg") is a standardized compression +method for full-color and grayscale images. JPEG's strong suit is compressing +photographic images or other types of images that have smooth color and +brightness transitions between neighboring pixels. Images with sharp lines or +other abrupt features may not compress well with JPEG, and a higher JPEG +quality may have to be used to avoid visible compression artifacts with such +images. + +JPEG is lossy, meaning that the output pixels are not necessarily identical to +the input pixels. However, on photographic content and other "smooth" images, +very good compression ratios can be obtained with no visible compression +artifacts, and extremely high compression ratios are possible if you are +willing to sacrifice image quality (by reducing the "quality" setting in the +compressor.) + +This software implements JPEG baseline, extended-sequential, and progressive +compression processes. Provision is made for supporting all variants of these +processes, although some uncommon parameter settings aren't implemented yet. +We have made no provision for supporting the hierarchical or lossless +processes defined in the standard. + +We provide a set of library routines for reading and writing JPEG image files, +plus two sample applications "cjpeg" and "djpeg", which use the library to +perform conversion between JPEG and some other popular image file formats. +The library is intended to be reused in other applications. + +In order to support file conversion and viewing software, we have included +considerable functionality beyond the bare JPEG coding/decoding capability; +for example, the color quantization modules are not strictly part of JPEG +decoding, but they are essential for output to colormapped file formats or +colormapped displays. These extra functions can be compiled out of the +library if not required for a particular application. + +We have also included "jpegtran", a utility for lossless transcoding between +different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple +applications for inserting and extracting textual comments in JFIF files. + +The emphasis in designing this software has been on achieving portability and +flexibility, while also making it fast enough to be useful. In particular, +the software is not intended to be read as a tutorial on JPEG. (See the +REFERENCES section for introductory material.) Rather, it is intended to +be reliable, portable, industrial-strength code. We do not claim to have +achieved that goal in every aspect of the software, but we strive for it. + +We welcome the use of this software as a component of commercial products. +No royalty is required, but we do ask for an acknowledgement in product +documentation, as described under LEGAL ISSUES. + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltmain.sh). Another support script, install-sh, is copyright by X Consortium +but is also freely distributable. + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent (now expired), GIF reading +support has been removed altogether, and the GIF writer has been simplified +to produce "uncompressed GIFs". This technique does not use the LZW +algorithm; the resulting GIF files are larger than usual, but are readable +by all standard GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + +REFERENCES +========== + +We recommend reading one or more of these references before trying to +understand the innards of the JPEG software. + +The best short technical introduction to the JPEG compression algorithm is + Wallace, Gregory K. "The JPEG Still Picture Compression Standard", + Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. +(Adjacent articles in that issue discuss MPEG motion picture compression, +applications of JPEG, and related topics.) If you don't have the CACM issue +handy, a PDF file containing a revised version of Wallace's article is +available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually +a preprint for an article that appeared in IEEE Trans. Consumer Electronics) +omits the sample images that appeared in CACM, but it includes corrections +and some added material. Note: the Wallace article is copyright ACM and IEEE, +and it may not be used for commercial purposes. + +A somewhat less technical, more leisurely introduction to JPEG can be found in +"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by +M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides +good explanations and example C code for a multitude of compression methods +including JPEG. It is an excellent source if you are comfortable reading C +code but don't know much about data compression in general. The book's JPEG +sample code is far from industrial-strength, but when you are ready to look +at a full implementation, you've got one here... + +The best currently available description of JPEG is the textbook "JPEG Still +Image Data Compression Standard" by William B. Pennebaker and Joan L. +Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. +Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG +standards (DIS 10918-1 and draft DIS 10918-2). + +The original JPEG standard is divided into two parts, Part 1 being the actual +specification, while Part 2 covers compliance testing methods. Part 1 is +titled "Digital Compression and Coding of Continuous-tone Still Images, +Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS +10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of +Continuous-tone Still Images, Part 2: Compliance testing" and has document +numbers ISO/IEC IS 10918-2, ITU-T T.83. + +The JPEG standard does not specify all details of an interchangeable file +format. For the omitted details we follow the "JFIF" conventions, revision +1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report +and thus received a formal publication status. It is available as a free +download in PDF format from +http://www.ecma-international.org/publications/techreports/E-TR-098.htm. +A PostScript version of the JFIF document is available at +http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at +http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures. + +The TIFF 6.0 file format specification can be obtained by FTP from +ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme +found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. +IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). +Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 +(Compression tag 7). Copies of this Note can be obtained from +http://www.ijg.org/files/. It is expected that the next revision +of the TIFF spec will replace the 6.0 JPEG design with the Note's design. +Although IJG's own code does not support TIFF/JPEG, the free libtiff library +uses our library to implement TIFF/JPEG per the Note. + +ARCHIVE LOCATIONS +================= + +The "official" archive site for this software is www.ijg.org. +The most recent released version can always be found there in +directory "files". + +The JPEG FAQ (Frequently Asked Questions) article is a source of some +general information about JPEG. +It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq +and other news.answers archive sites, including the official news.answers +archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. +If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu +with body + send usenet/news.answers/jpeg-faq/part1 + send usenet/news.answers/jpeg-faq/part2 + +FILE FORMAT WARS +================ + +The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together +with ITU-T SG16) currently promotes different formats containing the name +"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does +not support these formats (see REFERENCES). Indeed, one of the original +reasons for developing this free software was to help force convergence on +common, interoperable format standards for JPEG files. +Don't use an incompatible file format! +(In any case, our decoder will remain capable of reading existing JPEG +image files indefinitely.) + +TO DO +===== + +Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. +-------------------------------------------------------------------------------- +libsdl +skia + +Copyright 2016 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright (c) 2010, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2010 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2011 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2012 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2013 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2014 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2015 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2016 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2017 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2006-2012 The Authors + +Contributors: +James Graham - jg307@cam.ac.uk +Anne van Kesteren - annevankesteren@gmail.com +Lachlan Hunt - lachlan.hunt@lachy.id.au +Matt McDonald - kanashii@kanashii.ca +Sam Ruby - rubys@intertwingly.net +Ian Hickson (Google) - ian@hixie.ch +Thomas Broyer - t.broyer@ltgt.net +Jacques Distler - distler@golem.ph.utexas.edu +Henri Sivonen - hsivonen@iki.fi +Adam Barth - abarth@webkit.org +Eric Seidel - eric@webkit.org +The Mozilla Foundation (contributions from Henri Sivonen since 2008) +David Flanagan (Mozilla) - dflanagan@mozilla.com +Google Inc. (contributed the Dart port) - misc@dartlang.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2013, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014 Seth Ladd. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014, Michael Bostock and Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014, the Dart project authors. +Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2017, the Dart project authors. +Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2013, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2015, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2016, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages +pkg + +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages +skia +txt +vulkan + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-------------------------------------------------------------------------------- +rapidjson + +Copyright (c) 2006-2013 Alexander Chemeris + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the product nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +rapidjson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +root_certificates + +Mozilla Public License +Version 2.0 + +1. Definitions + +1.1. “Contributor” + +means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. + +1.2. “Contributor Version” + +means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + +means Covered Software of a particular Contributor. + +1.4. “Covered Software” + +means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. + +1.5. “Incompatible With Secondary Licenses” + +means + + a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. + +1.6. “Executable Form” + +means any form of the work other than Source Code Form. + +1.7. “Larger Work” + +means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. + +1.8. “License” + +means this document. + +1.9. “Licensable” + +means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. + +1.10. “Modifications” + +means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + +means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. + +1.12. “Secondary License” + +means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + +means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + +means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. License Grants and Conditions + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its Contributions. + +This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. + +3. Responsibilities + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + +If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + +Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + +This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. + +10. Versions of the License + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + +If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. +-------------------------------------------------------------------------------- +root_certificates + +Mozilla Public License Version 2.0 +================================== + +1. Definitions + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +* 6. Disclaimer of Warranty + +* Covered Software is provided under this License on an "as is" +* basis, without warranty of any kind, either expressed, implied, or +* statutory, including, without limitation, warranties that the +* Covered Software is free of defects, merchantable, fit for a +* particular purpose or non-infringing. The entire risk as to the +* quality and performance of the Covered Software is with You. +* Should any Covered Software prove defective in any respect, You +* (not any Contributor) assume the cost of any necessary servicing, +* repair, or correction. This disclaimer of warranty constitutes an +* essential part of this License. No use of any Covered Software is +* authorized under this License except under this disclaimer. + +* 7. Limitation of Liability + +* Under no circumstances and under no legal theory, whether tort +* (including negligence), contract, or otherwise, shall any +* Contributor, or anyone who distributes Covered Software as +* permitted above, be liable to You for any direct, indirect, +* special, incidental, or consequential damages of any character +* including, without limitation, damages for lost profits, loss of +* goodwill, work stoppage, computer failure or malfunction, or any +* and all other commercial damages or losses, even if such party +* shall have been informed of the possibility of such damages. This +* limitation of liability shall not apply to liability for death or +* personal injury resulting from such party's negligence to the +* extent applicable law prohibits such limitation. Some +* jurisdictions do not allow the exclusion or limitation of +* incidental or consequential damages, so this exclusion and +* limitation may not apply to You. + +8. Litigation + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. +-------------------------------------------------------------------------------- +skcms + +Copyright (c) 2018 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skcms +skia + +Copyright 2018 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (C) 2014 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2011 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2014 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2014-2016 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and/or associated documentation files (the "Materials"), +to deal in the Materials without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Materials, and to permit persons to whom the +Materials are furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Materials. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2005 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2006 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2006-2012 The Android Open Source Project +Copyright 2012 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2007 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2008 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2008 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2009 Motorola + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2009 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2009-2015 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2010 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2010 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2011 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2011 Google Inc. +Copyright 2012 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2011 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2012 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2012 Intel Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2012 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2013 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2013 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2014 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2014 Google Inc. +Copyright 2017 ARM Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2014 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2015 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2015 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2016 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2016 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2017 ARM Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2017 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 Google LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 Google, LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +NEON optimized code (C) COPYRIGHT 2009 Motorola + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +tcmalloc + +Copyright (c) 2003, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +tcmalloc + +Copyright (c) 2005, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +topaz + +Copyright 2016 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +topaz + +Copyright 2017 Th%e Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2003, 2010 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2003, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2005 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2005, 2010 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2005, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2006, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2007 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2008, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2009 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly +detect_data_type() function provided freely by Cosmin Truta, 2006 + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + +Modifications for Zip64 support +Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + +For more info read MiniZip_info.txt + +Condition of use and distribution are the same than zlib : + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + +Modifications of Unzip for Zip64 +Copyright (C) 2007-2008 Even Rouault + +Modifications for Zip64 support on both zip and unzip +Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + +For more info read MiniZip_info.txt + +Condition of use and distribution are the same than zlib : + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2004, 2005, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2004, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation +Authors: + Arjan van de Ven + Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation. All rights reserved. +Author: + Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation. All rights reserved. +Authors: + Wajdi Feghali + Jim Guilford + Vinodh Gopal + Erdinc Ozturk + Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2014 Intel Corporation + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (c) 2011 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +zlib + +Copyright (c) 2012 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +zlib + +zlib.h -- interface of the 'zlib' general purpose compression library +version 1.2.4, March 14th, 2010 + +Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +Jean-loup Gailly +Mark Adler diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5e465b16932d9..8d8a2ead3305a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 67bd8b8a2ec5aeee42d6a9fb3972e546 +Signature: 0d47f4028ac70f25c99d308ef1098aa5 UNUSED LICENSES: @@ -14113,13 +14113,13 @@ FILE: ../../../third_party/skia/include/private/SkEncodedInfo.h FILE: ../../../third_party/skia/include/private/SkLeanWindows.h FILE: ../../../third_party/skia/include/private/SkSafe_math.h FILE: ../../../third_party/skia/include/utils/SkNoDrawCanvas.h +FILE: ../../../third_party/skia/modules/sksg/samples/SampleSVGPong.cpp FILE: ../../../third_party/skia/samplecode/DecodeFile.h FILE: ../../../third_party/skia/samplecode/SampleAndroidShadows.cpp FILE: ../../../third_party/skia/samplecode/SampleCode.cpp FILE: ../../../third_party/skia/samplecode/SampleMegaStroke.cpp FILE: ../../../third_party/skia/samplecode/SamplePathOverstroke.cpp FILE: ../../../third_party/skia/samplecode/SampleSVGFile.cpp -FILE: ../../../third_party/skia/samplecode/SampleSVGPong.cpp FILE: ../../../third_party/skia/src/codec/SkCodecAnimationPriv.h FILE: ../../../third_party/skia/src/codec/SkRawAdapterCodec.cpp FILE: ../../../third_party/skia/src/codec/SkRawAdapterCodec.h @@ -17165,26 +17165,6 @@ FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGImage.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGScene.h -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGClipEffect.cpp -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGClipEffect.h -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGMaskEffect.cpp -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGMaskEffect.h -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGOpacityEffect.cpp -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGOpacityEffect.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGGeometryTransform.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGGeometryTransform.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPlane.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPlane.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGRoundEffect.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGRoundEffect.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGText.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGText.h -FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.cpp -FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGGradient.h FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/FuzzRegionOp.cpp @@ -17209,11 +17189,30 @@ FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h -FILE: ../../../third_party/skia/include/gpu/vk/GrVkMemoryAllocator.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go +FILE: ../../../third_party/skia/modules/sksg/include/SkSGClipEffect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGGeometryTransform.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGGradient.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGImage.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGMaskEffect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGOpacityEffect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGPlane.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGRoundEffect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGScene.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGText.h +FILE: ../../../third_party/skia/modules/sksg/src/SkSGClipEffect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGGeometryTransform.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGGradient.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGImage.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGMaskEffect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGOpacityEffect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGPlane.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGRoundEffect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGScene.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGText.cpp FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp @@ -17313,8 +17312,6 @@ FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp @@ -17524,7 +17521,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.ex FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-arm-Release-Chromecast.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-loongson3a-Release.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Debug-EmbededResouces.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json @@ -19376,34 +19372,6 @@ FILE: ../../../third_party/skia/experimental/skottie/SkottieAnimator.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieAnimator.h FILE: ../../../third_party/skia/experimental/skottie/SkottieValue.cpp FILE: ../../../third_party/skia/experimental/skottie/SkottieValue.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGDraw.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGDraw.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGEffectNode.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGEffectNode.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGGeometryNode.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGGeometryNode.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGGroup.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGGroup.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGInvalidationController.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGInvalidationController.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGNode.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGNode.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGPaintNode.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGPaintNode.h -FILE: ../../../third_party/skia/experimental/sksg/SkSGRenderNode.cpp -FILE: ../../../third_party/skia/experimental/sksg/SkSGRenderNode.h -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGTransform.cpp -FILE: ../../../third_party/skia/experimental/sksg/effects/SkSGTransform.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGMerge.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGMerge.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPath.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGPath.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGRect.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGRect.h -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGTrimEffect.cpp -FILE: ../../../third_party/skia/experimental/sksg/geometry/SkSGTrimEffect.h -FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGColor.cpp -FILE: ../../../third_party/skia/experimental/sksg/paint/SkSGColor.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGGradient.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGGradient.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPattern.cpp @@ -19480,11 +19448,38 @@ FILE: ../../../third_party/skia/include/private/SkImageInfoPriv.h FILE: ../../../third_party/skia/include/private/SkMalloc.h FILE: ../../../third_party/skia/include/private/SkShadowFlags.h FILE: ../../../third_party/skia/include/utils/SkShadowUtils.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGColor.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGDraw.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGEffectNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGGeometryNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGGroup.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGInvalidationController.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGMerge.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGPaintNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGPath.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGRect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGRenderNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGTransform.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGTrimEffect.h +FILE: ../../../third_party/skia/modules/sksg/src/SkSGColor.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGDraw.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGEffectNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGGeometryNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGGroup.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGInvalidationController.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGMerge.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGPaintNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGPath.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGRect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGRenderNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGTransform.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGTrimEffect.cpp FILE: ../../../third_party/skia/samplecode/SampleCCPRGeometry.cpp FILE: ../../../third_party/skia/samplecode/SampleChineseFling.cpp FILE: ../../../third_party/skia/samplecode/SampleCowboy.cpp FILE: ../../../third_party/skia/samplecode/SamplePathText.cpp -FILE: ../../../third_party/skia/samplecode/SampleSGInval.cpp FILE: ../../../third_party/skia/samplecode/SampleShadowColor.cpp FILE: ../../../third_party/skia/samplecode/SampleShadowReference.cpp FILE: ../../../third_party/skia/samplecode/SampleShadowUtils.cpp @@ -21193,33 +21188,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: vulkanmemoryallocator -ORIGIN: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/LICENSE.txt -TYPE: LicenseType.mit -FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -==================================================================================================== - ==================================================================================================== LIBRARY: zlib ORIGIN: ../../../third_party/zlib/LICENSE @@ -21955,4 +21923,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 321 +Total license count: 320 From 41620c9c03da3264d4d32c93322ab09e71a528ff Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 25 May 2018 12:59:49 -0700 Subject: [PATCH 0447/1190] Use common GrGLDefines instead of guessing platform specific headers. (#5381) --- shell/gpu/gpu_surface_gl.cc | 40 +++++++++++-------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 317d2ba29f5cc..e74c93bb22ce1 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -4,18 +4,6 @@ #include "gpu_surface_gl.h" -#if OS_IOS -#include -#include -#elif OS_MACOSX -#include -#elif OS_LINUX -#include -#else -#include -#include -#endif - #include "flutter/glue/trace_event.h" #include "lib/fxl/arraysize.h" #include "lib/fxl/logging.h" @@ -24,6 +12,7 @@ #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" +#include "third_party/skia/src/gpu/gl/GrGLDefines.h" namespace shell { @@ -87,27 +76,23 @@ bool GPUSurfaceGL::IsValid() { return valid_; } -static SkColorType FirstSupportedColorType(GrContext* context, GLenum* format) { +static SkColorType FirstSupportedColorType(GrContext* context, + GrGLenum* format) { #define RETURN_IF_RENDERABLE(x, y) \ if (context->colorTypeSupportedAsSurface((x))) { \ *format = (y); \ return (x); \ } -#if (OS_MACOSX && !OS_IOS) || OS_LINUX - RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8); -#else - RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GL_RGBA8_OES); -#endif - RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GL_RGBA4); - RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GL_RGB565); + RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GR_GL_RGBA8); + RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GR_GL_RGBA4); + RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GR_GL_RGB565); return kUnknown_SkColorType; } static sk_sp WrapOnscreenSurface(GrContext* context, const SkISize& size, intptr_t fbo) { - - GLenum format; + GrGLenum format; const SkColorType color_type = FirstSupportedColorType(context, &format); const GrGLFramebufferInfo framebuffer_info = { @@ -115,7 +100,6 @@ static sk_sp WrapOnscreenSurface(GrContext* context, .fFormat = format, }; - GrBackendRenderTarget render_target(size.fWidth, // width size.fHeight, // height 0, // sample count @@ -214,11 +198,11 @@ std::unique_ptr GPUSurfaceGL::AcquireFrame(const SkISize& size) { return nullptr; } - SurfaceFrame::SubmitCallback submit_callback = [weak = weak_factory_ - .GetWeakPtr()]( - const SurfaceFrame& surface_frame, SkCanvas* canvas) { - return weak ? weak->PresentSurface(canvas) : false; - }; + SurfaceFrame::SubmitCallback submit_callback = + [weak = weak_factory_.GetWeakPtr()](const SurfaceFrame& surface_frame, + SkCanvas* canvas) { + return weak ? weak->PresentSurface(canvas) : false; + }; return std::make_unique(surface, submit_callback); } From 8caa7612f8e6391f5c3382e109af472e579757fd Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 25 May 2018 14:31:01 -0700 Subject: [PATCH 0448/1190] Create a shell with no GPU configurations unless explicitly specified by the platform. (#5383) --- shell/gpu/BUILD.gn | 44 ------------------ shell/gpu/gpu.gni | 64 ++++++++++++++++++++++++++ shell/platform/android/BUILD.gn | 9 +++- shell/platform/darwin/BUILD.gn | 1 - shell/platform/darwin/common/BUILD.gn | 1 - shell/platform/darwin/desktop/BUILD.gn | 10 +++- shell/platform/darwin/ios/BUILD.gn | 9 +++- shell/platform/embedder/BUILD.gn | 9 +++- 8 files changed, 97 insertions(+), 50 deletions(-) delete mode 100644 shell/gpu/BUILD.gn create mode 100644 shell/gpu/gpu.gni diff --git a/shell/gpu/BUILD.gn b/shell/gpu/BUILD.gn deleted file mode 100644 index cd093e1238f7f..0000000000000 --- a/shell/gpu/BUILD.gn +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2016 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("$flutter_root/shell/config.gni") - -source_set("gpu") { - sources = [ - "gpu_surface_software.cc", - "gpu_surface_software.h", - ] - - if (!is_fuchsia) { - sources += [ - "gpu_surface_gl.cc", - "gpu_surface_gl.h", - ] - } - - if (shell_enable_vulkan) { - sources += [ - "gpu_surface_vulkan.cc", - "gpu_surface_vulkan.h", - ] - } - - deps = [ - "$flutter_root/common", - "$flutter_root/flow", - "$flutter_root/fml", - "$flutter_root/glue", - "$flutter_root/shell/common", - "$flutter_root/synchronization", - "//garnet/public/lib/fxl", - "//third_party/skia", - "//third_party/skia:gpu", - ] - - public_configs = [ "$flutter_root:config" ] - - if (shell_enable_vulkan) { - deps += [ "$flutter_root/vulkan" ] - } -} diff --git a/shell/gpu/gpu.gni b/shell/gpu/gpu.gni new file mode 100644 index 0000000000000..7ec2553c368a8 --- /dev/null +++ b/shell/gpu/gpu.gni @@ -0,0 +1,64 @@ +# Copyright 2016 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("$flutter_root/shell/config.gni") + +template("shell_gpu_configuration") { + assert(defined(invoker.enable_software), + "Caller must declare if the Software backend must be enabled.") + assert(defined(invoker.enable_vulkan), + "Caller must declare if the Vulkan backend must be enabled.") + assert(defined(invoker.enable_gl), + "Caller must declare if the Open GL backend must be enabled.") + + source_set(target_name) { + # vulkan_backend_enabled = shell_enable_vulkan + # gl_backend_enabled = !is_fuchsia + # software_backend_enabled = true + + sources = [] + + gpu_dir = "$flutter_root/shell/gpu" + + if (invoker.enable_software) { + sources += [ + "$gpu_dir/gpu_surface_software.cc", + "$gpu_dir/gpu_surface_software.h", + ] + } + + if (invoker.enable_gl) { + sources += [ + "$gpu_dir/gpu_surface_gl.cc", + "$gpu_dir/gpu_surface_gl.h", + ] + } + + if (invoker.enable_vulkan) { + sources += [ + "$gpu_dir/gpu_surface_vulkan.cc", + "$gpu_dir/gpu_surface_vulkan.h", + ] + } + + deps = [ + "$flutter_root/common", + "$flutter_root/flow", + "$flutter_root/fml", + "$flutter_root/glue", + "$flutter_root/shell/common", + "$flutter_root/synchronization", + "//garnet/public/lib/fxl", + "//third_party/skia", + ] + + if (invoker.enable_vulkan || invoker.enable_gl) { + deps += [ "//third_party/skia:gpu" ] + } + + if (invoker.enable_vulkan) { + deps += [ "$flutter_root/vulkan" ] + } + } +} diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 129c877faed0f..1a35925546936 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -6,6 +6,13 @@ import("$flutter_root/common/config.gni") import("$flutter_root/shell/config.gni") import("//build/config/android/config.gni") import("//build/config/android/rules.gni") +import("$flutter_root/shell/gpu/gpu.gni") + +shell_gpu_configuration("android_gpu_configuration") { + enable_software = true + enable_vulkan = shell_enable_vulkan + enable_gl = true +} shared_library("flutter_shell_native") { visibility = [ ":*" ] @@ -45,6 +52,7 @@ shared_library("flutter_shell_native") { ] deps = [ + ":android_gpu_configuration", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/flow", @@ -52,7 +60,6 @@ shared_library("flutter_shell_native") { "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/shell/common", - "$flutter_root/shell/gpu", "//garnet/public/lib/fxl", "//third_party/skia", "//third_party/skia:gpu", diff --git a/shell/platform/darwin/BUILD.gn b/shell/platform/darwin/BUILD.gn index 721733b96490b..2e3798ec016ab 100644 --- a/shell/platform/darwin/BUILD.gn +++ b/shell/platform/darwin/BUILD.gn @@ -41,7 +41,6 @@ source_set("flutter_channels") { "$flutter_root/fml", "$flutter_root/runtime", "$flutter_root/shell/common", - "$flutter_root/shell/gpu", "//garnet/public/lib/fxl", "//third_party/skia", ] diff --git a/shell/platform/darwin/common/BUILD.gn b/shell/platform/darwin/common/BUILD.gn index 338b0479dee77..beef771ab3add 100644 --- a/shell/platform/darwin/common/BUILD.gn +++ b/shell/platform/darwin/common/BUILD.gn @@ -20,7 +20,6 @@ source_set("common") { "$flutter_root/fml", "$flutter_root/runtime", "$flutter_root/shell/common", - "$flutter_root/shell/gpu", "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", "//third_party/skia", diff --git a/shell/platform/darwin/desktop/BUILD.gn b/shell/platform/darwin/desktop/BUILD.gn index ddc54b67e9e35..b66ddc1dbc487 100644 --- a/shell/platform/darwin/desktop/BUILD.gn +++ b/shell/platform/darwin/desktop/BUILD.gn @@ -4,6 +4,14 @@ assert(is_mac) +import("$flutter_root/shell/gpu/gpu.gni") + +shell_gpu_configuration("darwin_desktop_gpu_configuration") { + enable_software = false + enable_vulkan = false + enable_gl = true +} + source_set("mac_desktop_platform") { visibility = [ ":*" ] @@ -20,11 +28,11 @@ source_set("mac_desktop_platform") { ] deps = [ + ":darwin_desktop_gpu_configuration", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/lib/snapshot", "$flutter_root/shell/common", - "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", "$flutter_root/synchronization", "//garnet/public/lib/fxl", diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 19d2486a69fa4..c4c4acea8b5f6 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -6,9 +6,16 @@ assert(is_ios) import("$flutter_root/common/config.gni") import("//build/config/ios/ios_sdk.gni") +import("$flutter_root/shell/gpu/gpu.gni") _flutter_framework_dir = "$root_out_dir/Flutter.framework" +shell_gpu_configuration("ios_gpu_configuration") { + enable_software = true + enable_gl = true + enable_vulkan = false +} + # The headers that will be copied to the Flutter.framework and be accessed # from outside the Flutter engine source root. _flutter_framework_headers = [ @@ -81,6 +88,7 @@ shared_library("create_flutter_framework_dylib") { sources += _flutter_framework_headers deps = [ + ":ios_gpu_configuration", "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", @@ -88,7 +96,6 @@ shared_library("create_flutter_framework_dylib") { "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/shell/common", - "$flutter_root/shell/gpu", "$flutter_root/shell/platform/darwin/common", "//garnet/public/lib/fxl", "//third_party/skia", diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 91d86f3c8f0bd..6761892bca49f 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -3,6 +3,13 @@ # found in the LICENSE file. import("$flutter_root/testing/testing.gni") +import("$flutter_root/shell/gpu/gpu.gni") + +shell_gpu_configuration("embedder_gpu_configuration") { + enable_software = false + enable_vulkan = false + enable_gl = true +} source_set("embedder") { sources = [ @@ -16,12 +23,12 @@ source_set("embedder") { ] deps = [ + ":embedder_gpu_configuration", "$flutter_root/assets", "$flutter_root/common", "$flutter_root/fml", "$flutter_root/lib/snapshot", "$flutter_root/shell/common", - "$flutter_root/shell/gpu", "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", From 8ebc81f4d215b841a1824717b6b3dbd19bfb9171 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Fri, 25 May 2018 14:47:31 -0700 Subject: [PATCH 0449/1190] Revert "Dart SDK roll for 2018-05-25" (#5384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts flutter/engine#5376 It was causing failures of the sort: $ flutter test --local-engine=host_debug_unopt test/cupertino/scrollbar_paint_test.dart 00:06 +0: - Paints iOS spec ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════ The following TestFailure object was thrown running a test: Expected: Object or closure painting: 'a rounded rectangle with Color(0x99777777), RRect.fromLTRBR(795.0, 4.0, 797.5, 86.0, 1.3)' Actual: ?: Which: threw the following exception: '': error: native function 'Canvas_translate' (3 arguments) cannot be found --- DEPS | 21 ++-- frontend_server/lib/server.dart | 17 --- tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 109 ++++++++++---------- 4 files changed, 66 insertions(+), 83 deletions(-) diff --git a/DEPS b/DEPS index 0a15da7fdea97..32886852794c4 100644 --- a/DEPS +++ b/DEPS @@ -31,23 +31,23 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '1be13871bb70bda3ae456cc269297766eb47444d', + 'dart_revision': '97b6c2e09d6532eeb622d85f23109f3f3b6d2b61', 'dart_args_tag': '1.4.1', - 'dart_async_tag': '2.0.7', + 'dart_async_tag': '2.0.6', 'dart_bazel_worker_tag': 'v0.1.9', 'dart_boolean_selector_tag': '1.0.3', 'dart_boringssl_gen_rev': '344f455fd13d46f054726638e76026156ea73aa9', 'dart_boringssl_rev': '672f6fc2486745d0cabc3aaeb4e0a3cd13b37b12', 'dart_charcode_tag': 'v1.1.1', 'dart_cli_util_tag': '0.1.2+1', - 'dart_collection_tag': '1.14.9', + 'dart_collection_tag': '1.14.6', 'dart_convert_tag': '2.0.1', 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+2', 'dart_dart_style_tag': '1.0.14', - 'dart_dartdoc_tag': 'v0.19.1', + 'dart_dartdoc_tag': 'v0.19.0', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', @@ -55,16 +55,16 @@ vars = { 'dart_http_parser_tag': '3.1.1', 'dart_http_retry_tag': '0.1.1', 'dart_http_tag': '0.11.3+16', - 'dart_http_throttle_tag': '1.0.2', + 'dart_http_throttle_tag': '1.0.1', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.51', + 'dart_linter_tag': '0.1.50', 'dart_logging_tag': '0.11.3+1', - 'dart_markdown_tag': '2.0.0', + 'dart_markdown_tag': '1.1.1', 'dart_matcher_tag': '0.12.1+4', 'dart_mime_tag': '0.9.6', 'dart_mockito_tag': 'a92db054fba18bc2d605be7670aee74b7cadc00a', - 'dart_mustache4dart_tag': 'v2.1.2', + 'dart_mustache4dart_tag': 'v2.1.1', 'dart_oauth2_tag': '1.1.0', 'dart_observatory_pub_packages_rev': 'd3a3aebefbd35aa30fe7bbc2889b772b398f7d7f', 'dart_package_config_tag': '1.0.3', @@ -73,7 +73,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '7bdcf4e4de85a7a8c7a322511b8198f1b6cb0a73', + 'dart_pub_rev': '0c172864be2d2043a9d630e07f6b4eae7472653f', 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', @@ -94,9 +94,10 @@ vars = { 'dart_typed_data_tag': '1.1.3', 'dart_usage_tag': '3.3.0', 'dart_utf_tag': '0.9.0+4', - 'dart_watcher_tag': '0.9.7+8', + 'dart_watcher_tag': '0.9.7+7', 'dart_web_socket_channel_tag': '1.0.7', 'dart_yaml_tag': '2.1.13', + # Build bot tooling for iOS 'ios_tools_revision': '69b7c1b160e7107a6a98d948363772dc9caea46f', diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index 6ca06f27942ef..4965e82be7c3a 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -48,23 +48,6 @@ class _FlutterFrontendCompiler implements frontend.CompilerInterface{ void resetIncrementalCompiler() { _compiler.resetIncrementalCompiler(); } - - @override - Future compileExpression( - String expression, - List definitions, - List typeDefinitions, - String libraryUri, - String klass, - bool isStatic) { - return _compiler.compileExpression(expression, definitions, typeDefinitions, - libraryUri, klass, isStatic); - } - - @override - void reportError(String msg) { - _compiler.reportError(msg); - } } /// Entry point for this module, that creates `_FrontendCompiler` instance and diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index d7a3ee5462f72..3dcd0a08685cf 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-edge.00a51975424ac4ff73fdf04888fe073601010307" + dart: ">=1.21.0 <=2.0.0-dev.55.0" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8d8a2ead3305a..dc52cfca81606 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0d47f4028ac70f25c99d308ef1098aa5 +Signature: 4403a4edf1c16ee523d18d548857b323 UNUSED LICENSES: @@ -4824,6 +4824,7 @@ FILE: ../../../third_party/dart/sdk/lib/core/string.dart FILE: ../../../third_party/dart/sdk/lib/core/type.dart FILE: ../../../third_party/dart/sdk/lib/core/uri.dart FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/html/dartium/nativewrappers.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/css_class_set.dart @@ -5495,60 +5496,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/typed_data_utils.cc + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.cc -FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h -FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h -FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h -FILE: ../../../third_party/dart/runtime/vm/datastream.cc -FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h -FILE: ../../../third_party/dart/runtime/vm/hash.h -FILE: ../../../third_party/dart/runtime/vm/interpreter.cc -FILE: ../../../third_party/dart/runtime/vm/interpreter.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h -FILE: ../../../third_party/dart/sdk/lib/js/_js.dart -FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart -FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart -FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: dart ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/loader.dart + ../../../third_party/dart/LICENSE @@ -6074,6 +6021,58 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h +FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h +FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h +FILE: ../../../third_party/dart/runtime/vm/datastream.cc +FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h +FILE: ../../../third_party/dart/runtime/vm/hash.h +FILE: ../../../third_party/dart/runtime/vm/interpreter.cc +FILE: ../../../third_party/dart/runtime/vm/interpreter.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h +FILE: ../../../third_party/dart/sdk/lib/js/_js.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart +FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: double-conversion ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum-dtoa.cc From b537231b7a3948c37de78285efe5e33e470e6983 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 25 May 2018 15:20:36 -0700 Subject: [PATCH 0450/1190] Fix build issues for the embedder on Windows. (#5386) --- shell/gpu/gpu_surface_gl.cc | 7 ++-- shell/platform/embedder/embedder.cc | 32 +++++++++---------- .../embedder/tests/embedder_unittests.cc | 29 +++++++++-------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index e74c93bb22ce1..c849b883b299a 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -95,10 +95,9 @@ static sk_sp WrapOnscreenSurface(GrContext* context, GrGLenum format; const SkColorType color_type = FirstSupportedColorType(context, &format); - const GrGLFramebufferInfo framebuffer_info = { - .fFBOID = static_cast(fbo), - .fFormat = format, - }; + GrGLFramebufferInfo framebuffer_info = {}; + framebuffer_info.fFBOID = static_cast(fbo); + framebuffer_info.fFormat = format; GrBackendRenderTarget render_target(size.fWidth, // width size.fHeight, // height diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 5279f152b2c61..db1e4cbc322d2 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -31,16 +31,14 @@ #include "lib/fxl/functional/make_copyable.h" #define SAFE_ACCESS(pointer, member, default_value) \ - ({ \ - auto _return_value = \ - static_cast<__typeof__(pointer->member)>((default_value)); \ + ([=]() { \ if (offsetof(std::remove_pointer::type, member) + \ sizeof(pointer->member) <= \ pointer->struct_size) { \ - _return_value = pointer->member; \ + return pointer->member; \ } \ - _return_value; \ - }) + return static_castmember)>((default_value)); \ + })() bool IsRendererValid(const FlutterRendererConfig* config) { if (config == nullptr || config->type != kOpenGL) { @@ -112,11 +110,11 @@ FlutterResult FlutterEngineRun(size_t version, user_data](fxl::RefPtr message) { auto handle = new FlutterPlatformMessageResponseHandle(); const FlutterPlatformMessage incoming_message = { - .struct_size = sizeof(FlutterPlatformMessage), - .channel = message->channel().c_str(), - .message = message->data().data(), - .message_size = message->data().size(), - .response_handle = handle, + sizeof(FlutterPlatformMessage), // struct_size + message->channel().c_str(), // channel + message->data().data(), // message + message->data().size(), // message_size + handle, // response_handle }; handle->message = std::move(message); return ptr(&incoming_message, user_data); @@ -188,12 +186,12 @@ FlutterResult FlutterEngineRun(size_t version, ); shell::PlatformViewEmbedder::DispatchTable dispatch_table = { - .gl_make_current_callback = make_current, - .gl_clear_current_callback = clear_current, - .gl_present_callback = present, - .gl_fbo_callback = fbo_callback, - .platform_message_response_callback = platform_message_response_callback, - .gl_make_resource_current_callback = make_resource_current_callback, + make_current, // gl_make_current_callback + clear_current, // gl_clear_current_callback + present, // gl_present_callback + fbo_callback, // gl_fbo_callback + platform_message_response_callback, // platform_message_response_callback + make_resource_current_callback, // gl_make_resource_current_callback }; shell::Shell::CreateCallback on_create_platform_view = diff --git a/shell/platform/embedder/tests/embedder_unittests.cc b/shell/platform/embedder/tests/embedder_unittests.cc index 3c25065881267..ebf059f591e29 100644 --- a/shell/platform/embedder/tests/embedder_unittests.cc +++ b/shell/platform/embedder/tests/embedder_unittests.cc @@ -16,23 +16,26 @@ TEST(EmbedderTest, MustNotRunWithInvalidArgs) { } TEST(EmbedderTest, CanLaunchAndShutdownWithValidProjectArgs) { - FlutterOpenGLRendererConfig renderer = { - .struct_size = sizeof(FlutterOpenGLRendererConfig), - .make_current = [](void*) { return false; }, - .clear_current = [](void*) { return false; }, - .present = [](void*) { return false; }, - .fbo_callback = [](void*) -> uint32_t { return 0; }, - }; + FlutterOpenGLRendererConfig renderer = {}; + renderer.struct_size = sizeof(FlutterOpenGLRendererConfig); + renderer.make_current = [](void*) { return false; }; + renderer.clear_current = [](void*) { return false; }; + renderer.present = [](void*) { return false; }; + renderer.fbo_callback = [](void*) -> uint32_t { return 0; }; std::string main = std::string(testing::GetFixturesPath()) + "/simple_main.dart"; - FlutterRendererConfig config = {.type = FlutterRendererType::kOpenGL, - .open_gl = renderer}; - FlutterProjectArgs args = {.struct_size = sizeof(FlutterProjectArgs), - .assets_path = "", - .main_path = main.c_str(), - .packages_path = ""}; + FlutterRendererConfig config = {}; + config.type = FlutterRendererType::kOpenGL; + config.open_gl = renderer; + + FlutterProjectArgs args = {}; + args.struct_size = sizeof(FlutterProjectArgs); + args.assets_path = ""; + args.main_path = main.c_str(); + args.packages_path = ""; + FlutterEngine engine = nullptr; FlutterResult result = FlutterEngineRun(FLUTTER_ENGINE_VERSION, &config, &args, nullptr, &engine); From 37f456cac0703b4b550b93b888c792f14a37bf06 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 25 May 2018 15:28:36 -0700 Subject: [PATCH 0451/1190] Fix file flags for directories and backslashes on Windows. (#5387) --- fml/platform/win/file_win.cc | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/fml/platform/win/file_win.cc b/fml/platform/win/file_win.cc index 3f5e90494b013..ad193dfe2f967 100644 --- a/fml/platform/win/file_win.cc +++ b/fml/platform/win/file_win.cc @@ -6,15 +6,16 @@ #include +#include #include #include "flutter/fml/platform/win/wstring_conversion.h" namespace fml { -fml::UniqueFD OpenFile(const std::wstring& path, - OpenPermission permission, - bool is_directory) { +static fml::UniqueFD OpenFile(std::wstring path, + OpenPermission permission, + bool is_directory) { if (path.size() == 0) { return fml::UniqueFD{}; } @@ -36,15 +37,22 @@ fml::UniqueFD OpenFile(const std::wstring& path, break; } - return fml::UniqueFD{::CreateFile( - path.c_str(), // lpFileName - desired_access, // dwDesiredAccess - FILE_SHARE_READ, // dwShareMode - 0, // lpSecurityAttributes - OPEN_EXISTING, // dwCreationDisposition - FILE_ATTRIBUTE_NORMAL, // dwFlagsAndAttributes - 0 // hTemplateFile - )}; + DWORD flags = FILE_ATTRIBUTE_NORMAL; + + if (is_directory) { + flags |= FILE_FLAG_BACKUP_SEMANTICS; + } + + std::replace(path.begin(), path.end(), '/', '\\'); + + return fml::UniqueFD{::CreateFile(path.c_str(), // lpFileName + desired_access, // dwDesiredAccess + FILE_SHARE_READ, // dwShareMode + 0, // lpSecurityAttributes + OPEN_EXISTING, // dwCreationDisposition + flags, // dwFlagsAndAttributes + 0 // hTemplateFile + )}; } fml::UniqueFD OpenFile(const char* path, From 080fbcb1759e5916f0d6cdcdfd945c053320e6b3 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 25 May 2018 15:46:08 -0700 Subject: [PATCH 0452/1190] Build the embedder dylib and its unittests on Windows. (#5388) --- BUILD.gn | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index cdcf0cd0fc0c0..1cbe0fc8fd189 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -42,17 +42,12 @@ group("flutter") { "$flutter_root/fml:fml_unittests", "$flutter_root/runtime:runtime_unittests", "$flutter_root/shell/common:shell_unittests", + "$flutter_root/shell/platform/embedder:embedder_unittests", + "$flutter_root/shell/platform/embedder:flutter_engine", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", "//garnet/public/lib/fxl:fxl_unittests", ] - - if (!is_win) { - public_deps += [ - "$flutter_root/shell/platform/embedder:embedder_unittests", - "$flutter_root/shell/platform/embedder:flutter_engine", - ] - } } } From ecedff3a56b95617acf6bcef359741a2ad6b8daa Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 25 May 2018 19:17:55 -0400 Subject: [PATCH 0453/1190] Roll src/third_party/skia 6857df7..d433ee7 (3 commits) (#5389) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 32886852794c4..176a0d34b9165 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6857df77b06c6e5be2409926bf1901349f5466d0', + 'skia_revision': 'd433ee73e17f455f89c2ab958e76e1c578264760', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index dc52cfca81606..2f66c8a881e8f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4403a4edf1c16ee523d18d548857b323 +Signature: bd639e4a2c50dd5d24ad63983b8882dc UNUSED LICENSES: From 32f49e41e58b91a7771b2f0d42ee4e08e06c3621 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 26 May 2018 10:26:55 -0400 Subject: [PATCH 0454/1190] Roll src/third_party/skia d433ee7..e2343a1 (1 commits) (#5391) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 176a0d34b9165..9c9b34b52990e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd433ee73e17f455f89c2ab958e76e1c578264760', + 'skia_revision': 'e2343a1d0997ca715275a9fb2079b8514c6f8c19', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 2b1f3dbe25894d7614587f494a25b40fdb344f4a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 26 May 2018 13:51:55 -0400 Subject: [PATCH 0455/1190] Roll src/third_party/skia e2343a1..6b6c47c (2 commits) (#5392) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9c9b34b52990e..989a190637074 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e2343a1d0997ca715275a9fb2079b8514c6f8c19', + 'skia_revision': '6b6c47c063ab7e4085b931b17a885cf3ca6d37d3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 2f66c8a881e8f..36ab6929e3035 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: bd639e4a2c50dd5d24ad63983b8882dc +Signature: 4ada86fa9de0c6438a553385de5c7e62 UNUSED LICENSES: From 1ed25ca7b7e3e3e8047df050bba4174074c9b336 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Sat, 26 May 2018 12:17:26 -0700 Subject: [PATCH 0456/1190] Roll dart to f981f097602ca434ce0a36b1f704723cad105fb6 (#5390) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Roll dart to f981f097602ca434ce0a36b1f704723cad105fb6 Changes since the last roll ``` f981f09760 Revert "Clone annotations when cloning nodes that have them" b4699ae795 Improve type parameter and type argument recovery 544863fe68 Remove the no-op rewriter tests 4d271519a1 [VM Bigint] Fix arm64 intrinsic for _estimateQuotientDigit (loop missing jump back). Add regression test. Fix arm64 disassembler (was printing "unknow" instructions). Make decoding stricter in arm64 simulator. This fix addresses https://github.com/a14n/dart-rational/issues/19 57d256377c [fuchsia] Update for port API change c09e0121f7 Observatory strong mode fixes: add explicit downcasts to button onClick callbacks. a5bf688622 Observatory strong mode fix: Avoid a String/Uri type mismatch. 1b0c2f4507 Observatory strong mode fix: Add VM.target getter. 210d175cc0 Observatory strong mode fix: Fix a callback parameter type using an explicit downcast. 08d0dcb4b0 Observatory strong mode fixes: specify some list literal types. 462e350a6a Observatory strong mode fixes: Change types of InstanceMock/Instance members. 6ed3b162d6 Added feature specification for upper/lower bounds of top/bottom types abed87be08 Make BodyBuilder.handleCatchBlock use FormalParameters as catchParameters. 5016f11c08 [fasta] Make lists of type arguments growable 48e8b4cdbb Make Forest.forStatement take the conditionStatement rather than extracting the rightSeparator 2d527801b2 Observatory strong mode fixes: fix several type annotations. 0125a5a235 Observatory strong mode fixes: Fix callback parameter types using implicit casts. c85b2fc7be Observatory strong mode fixes: Fix an int/double type mismatch 3fb22040cb Observatory strong mode fixes: make iteration types more specific. 2165d2d797 Observatory strong mode fixes: safe uses of dynamic and covariant. 6a34939ba7 Use bottom type for Link constants 20831b1d6f Move ErroneousExpressionGenerator 8e25851870 Split LargeIntAccessGenerator 7b3c3991ea Observatory strong mode fixes: add implicit downcasts. de0e35829d Discover available files before searching in known files. d17859ca11 Observatory strong mode fixes: make callback parameter types more general. ca7d545df8 Follow up on initial fix-all fixes PR, https://dart-review.googlesource.com/c/sdk/+/56220, adding some assertions and a test. 922f9697a0 [VM] Fix for issue 32901 - Isolate.resolvePackageUri has inconsistent behavior when called from a script launched via relative path. 9c70462e3c [vm] Roll boringssl to 189270cd190267f5bd60cfe8f8ce7a61d07ba6f4 785f36853f Last changes to make dart2js strong mode clean when compiling itself! 993b4caf0e Make the change to ContextRoot non-breaking. 30ad3f66ce Set DDK to run on Dart-2 VM 379232a097 Convert remaining IdentifierContext consts 819b212318 Issue 33228. Fix Dart2 error in outline computer. ec19ebd684 [vm] Fix feature detection of DBC32 versus DBC64 in snapshots with code. 00a5197542 More changes to make dart2js dart 2 strong mode clean. 2d8bf7751e CHANGELOG for invariant generic bounds de545b4079 Revert "[mirrors] Add IsolateMirror.loadUri." 1be13871bb [ VM ] Addressed additional comments from CL 56461. 5cc3736644 [vm/frontend-server] Include errors count into compile expression response. 891efdca59 Fix status file for analyzer. ad4cfa0260 [mirrors] Add IsolateMirror.loadUri. a64bbbf6b3 Bump to watcher 0.9.7+8. eb19be5ff8 [vm/tool] Teach precompiler2 script to build ELF binaries. 7c43cfad9f [vm] Mark superclasses of interfaces implemented. 2f7874ab99 [ VM ] Updated include path for typed_data_utils.h which was causing Flutter build to fail. 3c6907ed0d [vm/kernel/aot] Approximate numerous invocations per selector in TFA 75a75263d3 Clone annotations when cloning nodes that have them d3da30c152 Report errors on non-synthetic tokens 351d70674d Initial new union of Dart Analysis Fixes, the initial fix is to remove all unused imports in a file. e8bb129816 Adjusted setter conflict specification, cf. #33077 0a042a270f Fix a bug in the async transformation of let expressions 6fc0c1fa4f [vm/kernel] Only create zone handles when necessary (e.g. in IR instructions, LocalVariable). 735f7bdcec Updated for expected FF failure. 02bcbc12fa [vm/kernel] Fix partial instantiation implementation in StreamingConstantEvaluator. 8d4a1ccaf6 Split ReadOnlyAccessGenerator ee9e1c1571 Split TypeUseGenerator 9ec756b31c Split DeferredAccessGenerator 163807ad40 Split LoadLibraryGenerator 51fa5c1662 Correctly transform async functions with FutureOr return types bca70073ae [vm/kernel] Move kernel2kenrel "constants" transformation before TFA 1d8a72cacd Split StaticAccessGenerator 2d46ebd6a5 Fix Dart 2 runtime errors in the front end 89514bd8cf Cleanup library_loader. 21b65a9732 Remove unused typedef code 18407141b7 Split deferred load entity computation by class, member and local function b84f18e392 [VM] Mark seemingly consistently failing test on windows d07b9aa0e0 Add explicit type args on generators b3862d5a92 Split SuperIndexedAccessGenerator 0ec82e24ce Avoid late creation of entities. 1d59ab22ce Fix #29014, make function type parameters invariant. 4d7bbb53ab Use AbstractValue in ClosedWorld 89f37416fe Fix windows bot breakage for package:build tests. 9b44fc39c8 Deprecate chaseDependencies option. 05f96af05a [ VM ] Fix failing non-UTF8 path test on MacOS c541cda216 [ VM ] Fixed issue where error code was being clobbered by call to Dart_TypedDataReleaseData on Windows, resulting in OSError returning a 0 error instead of the true error code. a00dae2260 Update test_parseAwaitExpression_inSync 9cd0e808db Convert more identifier contexts 552680b7f0 First round of changes to dart2js to make it strong mode clean. cc4fe66de8 Replace parseTypeVariables with computeTypeParam c3b6df5eb7 Update dartdoc and dependencies to v0.19.1. 3ab7cf0590 Revert "[dart:io] Revert recent non-utf8 path handling" 7c59fe6332 Flip dartfmt to run in Dart 2 mode. ade600c4b3 Update constructor identifier context e35ed9c749 [ VM / Build ] Added '--no-include-kernel-service' to build.py. By default, the kernel service is now included in all build modes, including product mode. Providing '--no-include-kernel-service' will build the specified configuration without the kernel service. e5eee0d57a Add Forest support for labeled statements 83e29023f4 Add schema-based file system 8f4c9bcf15 Add single-root file system. 1567b442dd Add Forest support for catch clauses 9816fce289 Fixed to use catchError instead of try/catch. 88d847ea3e [release] Prepare CHANGELOG.md for 2.0.0-dev.58.0 2a5724c75c New package:build workspace before we support it at the language level 4f5db3aef2 Update pub DEP – includes Dart2 type fixes 0a9697596e Add Forest support for for statements 4fb0c60938 [vm/kernel] Set active class when evaluating Dart annotations 8427d53a4d Extra precedence level in parser to distinguish postfix operators and selectors 1ce9b2541b Replace call to parseTypeVariablesOpt with computeTypeParam f7e09684b6 Split IndexedAccessGenerator and ThisIndexedAccessGenerator 9f3cd54d3b Remove UnhandledListener 98fcc338ca Fix diet_listener.dart imports 3a5454a691 Split SuperPropertyAccessGenerator e0144d51bb [VM] Add UNREACHABLE() to AOT constant evaluator in the VM fa6fd26892 Remove unused IdentifierContext instance cbe76eeea0 [release] Prepare changelog for 2.0.0-dev.57.0 e62f37f396 Tighten failure and success of test. a80dfa12d7 Revert "Add colons" 443c23c091 Remove subpackage_relationships_test.dart 7583fb882a [vm] Refactor state bits to free up two bits on Function. 0271003c33 Extract parseFunctionLiteral from parseType b8cb785aed Improve formal parameter identifier recovery 9f1097948a [fasta] Add and use a type-inference-specific interface of BodyBuilder 3960cacc89 Make peek return null when the stack is empty 3582e30d8e [VM] Remove unused _Random._A field in Dart sources and make constant in C++ code instead f8cca09ce3 [VM] Do not invoke the empty StackOverflowError/OutOfMemoryError constructors 39bccc125d Split NullAwarePropertyAccessGenerator 29253c57ed Add colons fc95fd920b Move generators out of body_builder 39516de753 Split ThisPropertyAccessGenerator 2d79c356e0 Start creating common superclass for generators 2a7188523e Fixed status cf87b84f7d Support Promise to Future for both DDC and dart2js. 6d8f473d4f [ VM / Hot Reload ] Updated kernel_service and hot reload behavior to run as long as the compiler returns valid kernel. f4f79acb61 Improve annotation identifier recovery 3bdd173175 Call computeType rather than parseType 2c8c05f877 [dart2js] merge generator body into empty entry function 96cfc632bb [infra] Use a less specific browser version that works across platforms 3ac2a3fe19 Address comment from 55981 8c0f5747a0 Add build_integration package and move multi_root_file_system there. ba0da68563 Update status for new test 3f6c87d5ac [vm/compiler] Do not use Constant(#null) to reserve space on the expression stack. a756248065 Add Forest support for assert statements and initializers a9ab8f4e7d [GN] Hack around Dart 2 application_snapshot deps issue 298129c3a4 Improve part of identifier recovery 371c8e4b87 Append version and CRC32 to data in FileByteStore. 6cc0d9770f Skip expressions by parsing them with a no-op listener. 3ccd5a06f5 [js_runtime] Fix for 'o is FutureOr' with function type T d34fe65afa Revert "New package:build workspace before we support it at the language level." 580e486386 Make CastStreamSubscription.onData handle a null callback 2a8eb8089d [infra] Specify chrome version used by builds running on the test matrix eeec6466b6 Convert the command-line analyzer to a dart 2 snapshot. 89df6b785d Issue 33181. Use RefactoringWorkspace in rename refactoring to determine when element being renamed is outside the workspace. 85ddeb990a [release] Prepare changelog for 2.0.0-dev.56.0 7ff8adcec9 Fix an incorrect dart:mirrors test 08d466bfad [kernel] Treat TypeParameter.defaultType as a child in visit methods 330dcb19da Rename remaining generators 2c9d8924e3 [fasta] Make explicit Object in bound a constraint during type inference 5924c35640 Prepare to remove expression_generator_impl.dart c771e4d132 DDC: disallow ignore option on Stream cast failures e191d4feb5 Simplify errors on invalid arguments 7ab9ea0e4e Change return type of Fangorn.parenthesizedCondition 09582b46ea Remove FastaAccessor and Accessor a738567968 Convert ContextAccessor to ContextAwareGenerator bbdf560ee7 Convert UnresolvedAccessor to UnresolvedNameGenerator b5c6143d74 Convert IncompleteSend to IncompleteSendGenerator 63ff7ee922 [vm/interpreter] Support closures in bytecode. Support reordered bytecode metadata sections. For now, read but ignore exceptions table in bytecode metadata. e1cabfd1d4 [dart2js] 'Fix' error in registrations 49d5ca3bb4 Switch to BigInt for ConstantValue. 9696c9dcd0 Change analysis_server tests to use /project/test.dart as the test file. e71bd048e5 [vm, kernel] Fix async stack code traversal in dart2. 714697efbb [vm/kernel/bytecode] Write constant pool before bytecode and exceptions table 80b48195b1 [frontend-server] Serialize compiled expression procedure into the file. 68b19b4ff4 [vm/kernel/bytecode] Add invocation kind to StaticICData constant 929b79e865 [dart2js] Don't insert redundant checks 4cf51e6c1a Give (the old) ContextRoot path.Context to work with paths. bea580c3a4 Disallow ignore on any explicit cast failures 1cf871a4d2 Improve import/export combinator identifier recovery 79a0ef60e0 Fix for 'Convert to final field' quick assist when no return type. bbb8905075 Observatory strong mode fixes: specify type argument to .map when not inferable. 841a91b3a0 Observatory strong mode fixes: Add abstract Location.toUserString to Location. fc206a7589 Add Kill isolate service request. aad3270ab8 Observatory strong mode fixes: fix C-style parameter declarations. ea4d10915c Observatory strong mode fixes: make return types more specific. 0f506ba3ae Added period to comment for consistency. 5ab4294074 [vm] Allow for creating a CoreJIT snapshot from a kernel file. d5b99860e4 [frontend-server] Introduce compile-expression command. ac8971a98a New package:build workspace before we support it at the language level. 99eb2195c8 Add Forest support for break and continue statements 4d3ebab589 [vm] Fix error message when an API function is called without a current isolate. c31b9a461d [vm/kernel] Reference constants in Dill by offset into constants table. 0ff6c20c66 Add Forest support for return statements 85fbc71f22 More test framework cleanup 6202749429 [vm/kernel/bytecode] Support try-catch-finally in bytecode generator 78cc8a13a2 Improve type parameter recovery 3e7eef12d4 Remove reference to token.previous 5b4d67b22e Compute runtime completions in the context file itsef. 720b6c963c Improve some tests and fix a Dart 2 error ff76905aeb [dart2js] Don't try to generate stubs for generator bodies 4610daa1c1 Convert ThisAccessor to ThisAccessGenerator cb9bf910f9 Test that fasta_codes_generated.dart is up to date eec11ebe4a Convert ErrorAccessor to ErroneousExpressionGenerator a155d6c9e5 Update dependencies on async, collection, http_throttle packages ce1dc86620 Adjust status file. 21fbf7d767 fix #33103, switch dartdevk to use Kernel nSM stubs 5632b1cb47 Adjust status file for precompiled target (see issue 33168) 41468e7c03 [VM] bypass some app_jit tests which have issues with mismatched VM options between the snapshot version and the invoked dart process. c38bca632d [fuchsia] Fix bad state error on namespace cleanup b911f78ee2 Use AbstractValue/AbstractValueDomain in function_set.dart c9ea44bd8f Use the static type from the identifier element is local completions. 715ba58048 Remove reference to token.previous 4edb23cfc1 Bump to linter 0.1.51. 2ff2af7921 Allow running pub with --preview-dart-2 7aacf7e188 [ VM / dart:io ] Fixed memory leak in SecurityContext on MacOS. ada23cde0b Add deferred test for local functions f1f660fe1e Small cleanup 9f6e8a3a96 Move DDC to Dart 2 snapshot be5b189c19 Exclude synthetic import prefixes from runtime completion. 7ac05a120a Add Forest support for do statements 029e1394f7 Make type promotion conditional depending on which builder is being used 817965f49d Runtime completion support for constructors, for loops, and function expressions. 02e47a9731 [VM] Fix for issue 32188 (cannot use `pub` with --preview-dart-2) ``` * Update license. Fix to license script to accommodate boringssl additional build-time license * Revert changes to pubspec.lock * Roll to buildroot with boringssl fix * Update license --- DEPS | 26 +- frontend_server/lib/server.dart | 17 + tools/licenses/lib/main.dart | 12 +- travis/licenses_golden/licenses_third_party | 1798 +++++++++---------- 4 files changed, 934 insertions(+), 919 deletions(-) diff --git a/DEPS b/DEPS index 989a190637074..3a3a3bb2ba89d 100644 --- a/DEPS +++ b/DEPS @@ -31,23 +31,23 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '97b6c2e09d6532eeb622d85f23109f3f3b6d2b61', + 'dart_revision': 'f981f097602ca434ce0a36b1f704723cad105fb6', 'dart_args_tag': '1.4.1', - 'dart_async_tag': '2.0.6', + 'dart_async_tag': '2.0.7', 'dart_bazel_worker_tag': 'v0.1.9', 'dart_boolean_selector_tag': '1.0.3', - 'dart_boringssl_gen_rev': '344f455fd13d46f054726638e76026156ea73aa9', - 'dart_boringssl_rev': '672f6fc2486745d0cabc3aaeb4e0a3cd13b37b12', + 'dart_boringssl_gen_rev': 'fc47eaa1a245d858bae462cd64d4155605b850ea', + 'dart_boringssl_rev': '189270cd190267f5bd60cfe8f8ce7a61d07ba6f4', 'dart_charcode_tag': 'v1.1.1', 'dart_cli_util_tag': '0.1.2+1', - 'dart_collection_tag': '1.14.6', + 'dart_collection_tag': '1.14.9', 'dart_convert_tag': '2.0.1', 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+2', 'dart_dart_style_tag': '1.0.14', - 'dart_dartdoc_tag': 'v0.19.0', + 'dart_dartdoc_tag': 'v0.19.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', @@ -55,16 +55,16 @@ vars = { 'dart_http_parser_tag': '3.1.1', 'dart_http_retry_tag': '0.1.1', 'dart_http_tag': '0.11.3+16', - 'dart_http_throttle_tag': '1.0.1', + 'dart_http_throttle_tag': '1.0.2', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.50', + 'dart_linter_tag': '0.1.51', 'dart_logging_tag': '0.11.3+1', - 'dart_markdown_tag': '1.1.1', + 'dart_markdown_tag': '2.0.0', 'dart_matcher_tag': '0.12.1+4', 'dart_mime_tag': '0.9.6', 'dart_mockito_tag': 'a92db054fba18bc2d605be7670aee74b7cadc00a', - 'dart_mustache4dart_tag': 'v2.1.1', + 'dart_mustache4dart_tag': 'v2.1.2', 'dart_oauth2_tag': '1.1.0', 'dart_observatory_pub_packages_rev': 'd3a3aebefbd35aa30fe7bbc2889b772b398f7d7f', 'dart_package_config_tag': '1.0.3', @@ -73,7 +73,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '0c172864be2d2043a9d630e07f6b4eae7472653f', + 'dart_pub_rev': '7bdcf4e4de85a7a8c7a322511b8198f1b6cb0a73', 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', @@ -94,7 +94,7 @@ vars = { 'dart_typed_data_tag': '1.1.3', 'dart_usage_tag': '3.3.0', 'dart_utf_tag': '0.9.0+4', - 'dart_watcher_tag': '0.9.7+7', + 'dart_watcher_tag': '0.9.7+8', 'dart_web_socket_channel_tag': '1.0.7', 'dart_yaml_tag': '2.1.13', @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'cce1705f816c05e4af002eb9280f336c188f699d', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '02eee3f72574fd5d30454487b5083e704b32cca4', # Fuchsia compatibility # diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index 4965e82be7c3a..57969641550fa 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -44,6 +44,23 @@ class _FlutterFrontendCompiler implements frontend.CompilerInterface{ _compiler.invalidate(uri); } + @override + Future compileExpression( + String expression, + List definitions, + List typeDefinitions, + String libraryUri, + String klass, + bool isStatic) { + return _compiler.compileExpression(expression, definitions, typeDefinitions, + libraryUri, klass, isStatic); + } + + @override + void reportError(String msg) { + _compiler.reportError(msg); + } + @override void resetIncrementalCompiler() { _compiler.resetIncrementalCompiler(); diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index 36c650cd46f89..5dd177acfd2b7 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -1978,9 +1978,19 @@ class RepositoryBoringSSLSourceDirectory extends RepositoryDirectory { /// /// This license includes 23 lines of informational header text that are not /// part of the copyright notices and can be skipped. +/// It also has a trailer that mentions licenses that are used during build +/// time of BoringSSL - those can be ignored as well since they don't apply +/// to code that is distributed. class RepositoryOpenSSLLicenseFile extends RepositorySingleLicenseFile { RepositoryOpenSSLLicenseFile(RepositoryDirectory parent, fs.TextFile io) - : super(parent, io, new License.fromBodyAndType(LineSplitter.split(io.readString()).skip(23).join('\n'), LicenseType.openssl, origin: io.fullName)) { + : super(parent, io, + new License.fromBodyAndType( + LineSplitter.split(io.readString()) + .skip(23) + .takeWhile((String s) => !s.startsWith('BoringSSL uses the Chromium test infrastructure to run a continuous build,')) + .join('\n'), + LicenseType.openssl, + origin: io.fullName)) { _verifyLicense(io); } diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 36ab6929e3035..b6aa8ee511023 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4ada86fa9de0c6438a553385de5c7e62 +Signature: cd6ca7e2607cfda86903bcff3ad27234 UNUSED LICENSES: @@ -116,58 +116,7 @@ USED LICENSES: ==================================================================================================== LIBRARY: boringssl -ORIGIN: ../../../third_party/boringssl/ios-aarch64/crypto/fipsmodule/sha256-armv8.S + ../../../third_party/boringssl/src/LICENSE -TYPE: LicenseType.unknown -FILE: ../../../third_party/boringssl/ios-aarch64/crypto/fipsmodule/sha256-armv8.S -FILE: ../../../third_party/boringssl/ios-aarch64/crypto/fipsmodule/sha512-armv8.S -FILE: ../../../third_party/boringssl/linux-aarch64/crypto/fipsmodule/sha256-armv8.S -FILE: ../../../third_party/boringssl/linux-aarch64/crypto/fipsmodule/sha512-armv8.S ----------------------------------------------------------------------------------------------------- -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html -==================================================================================================== - -==================================================================================================== -LIBRARY: boringssl -ORIGIN: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/aes-armv4.S + ../../../third_party/boringssl/src/LICENSE -TYPE: LicenseType.unknown -FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/aes-armv4.S -FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/sha256-armv4.S -FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/sha512-armv4.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/aes-armv4.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/sha256-armv4.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/sha512-armv4.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/sha/sha256-armv4.S ----------------------------------------------------------------------------------------------------- -Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html -==================================================================================================== - -==================================================================================================== -LIBRARY: boringssl -ORIGIN: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/bsaes-armv7.S + ../../../third_party/boringssl/src/LICENSE -TYPE: LicenseType.unknown -FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/bsaes-armv7.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/bsaes-armv7.S ----------------------------------------------------------------------------------------------------- -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html -==================================================================================================== - -==================================================================================================== -LIBRARY: boringssl +LIBRARY: dart ORIGIN: ../../../third_party/boringssl/src/LICENSE TYPE: LicenseType.openssl FILE: ../../../third_party/boringssl/ios-aarch64/crypto/fipsmodule/sha256-armv8.S @@ -186,9 +135,6 @@ FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/sha256-armv4.S FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/sha256-armv4.S FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/sha512-armv4.S FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/sha512-armv4.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/sha/sha256-armv4.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/sha/sha256-armv4.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/sha/sha512-armv4.S FILE: ../../../third_party/boringssl/src/crypto/err/asn1.errordata FILE: ../../../third_party/boringssl/src/crypto/err/bio.errordata FILE: ../../../third_party/boringssl/src/crypto/err/bn.errordata @@ -243,6 +189,7 @@ FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/policydocs/BoringCryp FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/policydocs/BoringCrypto-Security-Policy-20170615.docx!/word/webSettings.xml FILE: ../../../third_party/boringssl/src/crypto/obj/obj_mac.num FILE: ../../../third_party/boringssl/src/crypto/poly1305/poly1305_arm_asm.S +FILE: ../../../third_party/boringssl/src/crypto/rsa_extra/print.c FILE: ../../../third_party/boringssl/src/crypto/x509/charmap.h FILE: ../../../third_party/boringssl/src/crypto/x509/many_constraints.pem FILE: ../../../third_party/boringssl/src/crypto/x509/many_names1.pem @@ -251,6 +198,7 @@ FILE: ../../../third_party/boringssl/src/crypto/x509/many_names3.pem FILE: ../../../third_party/boringssl/src/crypto/x509/some_names1.pem FILE: ../../../third_party/boringssl/src/crypto/x509/some_names2.pem FILE: ../../../third_party/boringssl/src/crypto/x509/some_names3.pem +FILE: ../../../third_party/boringssl/src/crypto/x509v3/v3_ocsp.c FILE: ../../../third_party/boringssl/src/fipstools/run_cavp.go FILE: ../../../third_party/boringssl/src/infra/config/cq.cfg FILE: ../../../third_party/boringssl/src/ssl/bio_ssl.cc @@ -286,6 +234,8 @@ FILE: ../../../third_party/boringssl/src/util/fipstools/testdata/x86_64-LabelRew FILE: ../../../third_party/boringssl/src/util/fipstools/testdata/x86_64-LabelRewrite/out.s FILE: ../../../third_party/boringssl/src/util/fipstools/testdata/x86_64-Sections/in.s FILE: ../../../third_party/boringssl/src/util/fipstools/testdata/x86_64-Sections/out.s +FILE: ../../../third_party/dart/runtime/lib/bigint.dart +FILE: ../../../third_party/dart/runtime/lib/bigint_patch.dart ---------------------------------------------------------------------------------------------------- OpenSSL License @@ -437,183 +387,562 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Licenses for support code + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== ==================================================================================================== LIBRARY: boringssl -ORIGIN: ../../../third_party/boringssl/src/crypto/asn1/a_bitstr.c -TYPE: LicenseType.bsd -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_bitstr.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_bool.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_d2i_fp.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_dup.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_enum.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_gentm.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_i2d_fp.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_int.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_mbstr.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_object.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_octet.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_print.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_strnid.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_time.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_type.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_utctm.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/a_utf8.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/asn1_lib.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/asn1_par.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/asn_pack.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/f_enum.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/f_int.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/f_string.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_dec.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_enc.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_fre.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_new.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_typ.c -FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_utl.c -FILE: ../../../third_party/boringssl/src/crypto/base64/base64.c -FILE: ../../../third_party/boringssl/src/crypto/bio/bio.c -FILE: ../../../third_party/boringssl/src/crypto/bio/bio_mem.c -FILE: ../../../third_party/boringssl/src/crypto/bio/connect.c -FILE: ../../../third_party/boringssl/src/crypto/bio/fd.c -FILE: ../../../third_party/boringssl/src/crypto/bio/file.c -FILE: ../../../third_party/boringssl/src/crypto/bio/hexdump.c -FILE: ../../../third_party/boringssl/src/crypto/bio/internal.h -FILE: ../../../third_party/boringssl/src/crypto/bio/printf.c -FILE: ../../../third_party/boringssl/src/crypto/bio/socket.c -FILE: ../../../third_party/boringssl/src/crypto/bn_extra/convert.c -FILE: ../../../third_party/boringssl/src/crypto/buf/buf.c -FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/cipher_extra.c -FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/derive_key.c -FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_null.c -FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_rc2.c -FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_rc4.c -FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/internal.h -FILE: ../../../third_party/boringssl/src/crypto/conf/conf.c -FILE: ../../../third_party/boringssl/src/crypto/conf/conf_def.h -FILE: ../../../third_party/boringssl/src/crypto/cpu-intel.c -FILE: ../../../third_party/boringssl/src/crypto/dh/check.c -FILE: ../../../third_party/boringssl/src/crypto/dh/dh.c -FILE: ../../../third_party/boringssl/src/crypto/dh/dh_test.cc -FILE: ../../../third_party/boringssl/src/crypto/digest_extra/digest_extra.c -FILE: ../../../third_party/boringssl/src/crypto/dsa/dsa.c -FILE: ../../../third_party/boringssl/src/crypto/dsa/dsa_test.cc -FILE: ../../../third_party/boringssl/src/crypto/err/err.c -FILE: ../../../third_party/boringssl/src/crypto/evp/evp.c -FILE: ../../../third_party/boringssl/src/crypto/evp/evp_asn1.c -FILE: ../../../third_party/boringssl/src/crypto/evp/evp_ctx.c -FILE: ../../../third_party/boringssl/src/crypto/evp/internal.h -FILE: ../../../third_party/boringssl/src/crypto/evp/sign.c -FILE: ../../../third_party/boringssl/src/crypto/ex_data.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/add.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/bn.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/bn_test.cc -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/cmp.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/div.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/exponentiation.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/gcd.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/generic.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/montgomery.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/mul.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/prime.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/random.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/shift.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/cipher/cipher.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/cipher/e_des.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/cipher/internal.h -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/des/des.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/des/internal.h -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/digest/digest.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/digest/digests.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/digest/internal.h -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/hmac/hmac.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/md4/md4.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/md5/md5.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/rsa/internal.h -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/rsa/rsa.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/rsa/rsa_impl.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/sha/sha1-altivec.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/sha/sha1.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/sha/sha256.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/sha/sha512.c -FILE: ../../../third_party/boringssl/src/crypto/hmac_extra/hmac_test.cc -FILE: ../../../third_party/boringssl/src/crypto/internal.h -FILE: ../../../third_party/boringssl/src/crypto/lhash/lhash.c -FILE: ../../../third_party/boringssl/src/crypto/mem.c -FILE: ../../../third_party/boringssl/src/crypto/obj/obj.c -FILE: ../../../third_party/boringssl/src/crypto/obj/obj_xref.c -FILE: ../../../third_party/boringssl/src/crypto/pem/pem_all.c -FILE: ../../../third_party/boringssl/src/crypto/pem/pem_info.c -FILE: ../../../third_party/boringssl/src/crypto/pem/pem_lib.c -FILE: ../../../third_party/boringssl/src/crypto/pem/pem_oth.c -FILE: ../../../third_party/boringssl/src/crypto/pem/pem_pk8.c -FILE: ../../../third_party/boringssl/src/crypto/pem/pem_pkey.c -FILE: ../../../third_party/boringssl/src/crypto/rc4/rc4.c -FILE: ../../../third_party/boringssl/src/crypto/rsa_extra/rsa_test.cc -FILE: ../../../third_party/boringssl/src/crypto/stack/stack.c -FILE: ../../../third_party/boringssl/src/crypto/thread.c -FILE: ../../../third_party/boringssl/src/crypto/x509/a_digest.c -FILE: ../../../third_party/boringssl/src/crypto/x509/a_sign.c -FILE: ../../../third_party/boringssl/src/crypto/x509/a_strex.c -FILE: ../../../third_party/boringssl/src/crypto/x509/a_verify.c -FILE: ../../../third_party/boringssl/src/crypto/x509/algorithm.c -FILE: ../../../third_party/boringssl/src/crypto/x509/asn1_gen.c -FILE: ../../../third_party/boringssl/src/crypto/x509/by_dir.c -FILE: ../../../third_party/boringssl/src/crypto/x509/by_file.c -FILE: ../../../third_party/boringssl/src/crypto/x509/i2d_pr.c -FILE: ../../../third_party/boringssl/src/crypto/x509/t_crl.c -FILE: ../../../third_party/boringssl/src/crypto/x509/t_req.c -FILE: ../../../third_party/boringssl/src/crypto/x509/t_x509.c -FILE: ../../../third_party/boringssl/src/crypto/x509/t_x509a.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_att.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_cmp.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_d2.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_def.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_ext.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_lu.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_obj.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_r2x.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_req.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_set.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_txt.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_v3.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509_vfy.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509name.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x509rset.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_all.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_attrib.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_crl.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_exten.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_info.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_name.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_pkey.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_pubkey.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_req.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_sig.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_spki.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_val.c -FILE: ../../../third_party/boringssl/src/crypto/x509/x_x509.c -FILE: ../../../third_party/boringssl/src/decrepit/bio/base64_bio.c -FILE: ../../../third_party/boringssl/src/decrepit/blowfish/blowfish.c -FILE: ../../../third_party/boringssl/src/decrepit/cast/cast.c -FILE: ../../../third_party/boringssl/src/decrepit/cast/cast_tables.c -FILE: ../../../third_party/boringssl/src/decrepit/cast/internal.h -FILE: ../../../third_party/boringssl/src/decrepit/des/cfb64ede.c -FILE: ../../../third_party/boringssl/src/decrepit/macros.h -FILE: ../../../third_party/boringssl/src/decrepit/rc4/rc4_decrepit.c -FILE: ../../../third_party/boringssl/src/decrepit/ripemd/internal.h -FILE: ../../../third_party/boringssl/src/decrepit/ripemd/ripemd.c -FILE: ../../../third_party/boringssl/src/decrepit/rsa/rsa_decrepit.c -FILE: ../../../third_party/boringssl/src/decrepit/ssl/ssl_decrepit.c -FILE: ../../../third_party/boringssl/src/include/openssl/asn1.h -FILE: ../../../third_party/boringssl/src/include/openssl/base64.h -FILE: ../../../third_party/boringssl/src/include/openssl/bio.h -FILE: ../../../third_party/boringssl/src/include/openssl/blowfish.h -FILE: ../../../third_party/boringssl/src/include/openssl/buf.h -FILE: ../../../third_party/boringssl/src/include/openssl/cast.h +LIBRARY: observatory_pub_packages +LIBRARY: skia +LIBRARY: vulkan +ORIGIN: ../../../flutter/third_party/txt/LICENSE +TYPE: LicenseType.apache +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/METADATA +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/aes_cbc_pkcs5_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/aes_cmac_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/aes_eax_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/aes_gcm_siv_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/aes_gcm_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/aes_siv_cmac_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/chacha20_poly1305_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/dsa_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdh_webcrypto_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP224r1_sha224_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP256r1_sha256_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP320r1_sha384_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP384r1_sha384_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_brainpoolP512r1_sha512_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha224_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp224r1_sha256_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256k1_sha256_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp256r1_sha256_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp384r1_sha512_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_secp521r1_sha512_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/ecdsa_webcrypto_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/eddsa_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/kw_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/kwp_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/rsa_signature_test.json +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/x25519_test.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/async.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/cache.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/check.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/collection.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/core.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/io.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/iterables.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/mirrors.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/pattern.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/collect.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/concat.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/countdown_timer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/enumerate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/future_stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/iteration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/metronome.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/stream_buffer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/stream_router.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/cache/cache.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/cache/map_cache.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/bimap.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/iterable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/queue.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/lru_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/multimap.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/treeset.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/core/hash.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/core/optional.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/concat.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/count.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/cycle.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/enumerate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/generating_iterable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/infinite_iterable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/merge.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/min_max.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/partition.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/range.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/pattern/glob.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/clock.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/duration_unit_constants.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/util.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/strings.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/time.dart +FILE: ../../../third_party/skia/src/images/SkWebpEncoder.cpp +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vk_platform.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan.h +FILE: ../../../third_party/vulkan/src/vulkan/vk_platform.h +FILE: ../../../third_party/vulkan/src/vulkan/vulkan.h +---------------------------------------------------------------------------------------------------- +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==================================================================================================== + +==================================================================================================== +LIBRARY: boringssl +ORIGIN: ../../../third_party/boringssl/ios-aarch64/crypto/fipsmodule/sha256-armv8.S + ../../../third_party/boringssl/src/LICENSE +TYPE: LicenseType.unknown +FILE: ../../../third_party/boringssl/ios-aarch64/crypto/fipsmodule/sha256-armv8.S +FILE: ../../../third_party/boringssl/ios-aarch64/crypto/fipsmodule/sha512-armv8.S +FILE: ../../../third_party/boringssl/linux-aarch64/crypto/fipsmodule/sha256-armv8.S +FILE: ../../../third_party/boringssl/linux-aarch64/crypto/fipsmodule/sha512-armv8.S +---------------------------------------------------------------------------------------------------- +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +==================================================================================================== + +==================================================================================================== +LIBRARY: boringssl +ORIGIN: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/aes-armv4.S + ../../../third_party/boringssl/src/LICENSE +TYPE: LicenseType.unknown +FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/aes-armv4.S +FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/sha256-armv4.S +FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/sha512-armv4.S +FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/aes-armv4.S +FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/sha256-armv4.S +FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/sha512-armv4.S +---------------------------------------------------------------------------------------------------- +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +==================================================================================================== + +==================================================================================================== +LIBRARY: boringssl +ORIGIN: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/bsaes-armv7.S + ../../../third_party/boringssl/src/LICENSE +TYPE: LicenseType.unknown +FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/bsaes-armv7.S +FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/bsaes-armv7.S +---------------------------------------------------------------------------------------------------- +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +==================================================================================================== + +==================================================================================================== +LIBRARY: boringssl +ORIGIN: ../../../third_party/boringssl/src/crypto/asn1/a_bitstr.c +TYPE: LicenseType.bsd +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_bitstr.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_bool.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_d2i_fp.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_dup.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_enum.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_gentm.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_i2d_fp.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_int.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_mbstr.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_object.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_octet.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_print.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_strnid.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_time.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_type.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_utctm.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/a_utf8.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/asn1_lib.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/asn1_par.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/asn_pack.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/f_enum.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/f_int.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/f_string.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_dec.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_enc.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_fre.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_new.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_typ.c +FILE: ../../../third_party/boringssl/src/crypto/asn1/tasn_utl.c +FILE: ../../../third_party/boringssl/src/crypto/base64/base64.c +FILE: ../../../third_party/boringssl/src/crypto/bio/bio.c +FILE: ../../../third_party/boringssl/src/crypto/bio/bio_mem.c +FILE: ../../../third_party/boringssl/src/crypto/bio/connect.c +FILE: ../../../third_party/boringssl/src/crypto/bio/fd.c +FILE: ../../../third_party/boringssl/src/crypto/bio/file.c +FILE: ../../../third_party/boringssl/src/crypto/bio/hexdump.c +FILE: ../../../third_party/boringssl/src/crypto/bio/internal.h +FILE: ../../../third_party/boringssl/src/crypto/bio/printf.c +FILE: ../../../third_party/boringssl/src/crypto/bio/socket.c +FILE: ../../../third_party/boringssl/src/crypto/bn_extra/convert.c +FILE: ../../../third_party/boringssl/src/crypto/buf/buf.c +FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/cipher_extra.c +FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/derive_key.c +FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_null.c +FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_rc2.c +FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_rc4.c +FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/internal.h +FILE: ../../../third_party/boringssl/src/crypto/conf/conf.c +FILE: ../../../third_party/boringssl/src/crypto/conf/conf_def.h +FILE: ../../../third_party/boringssl/src/crypto/cpu-intel.c +FILE: ../../../third_party/boringssl/src/crypto/dh/check.c +FILE: ../../../third_party/boringssl/src/crypto/dh/dh.c +FILE: ../../../third_party/boringssl/src/crypto/dh/dh_test.cc +FILE: ../../../third_party/boringssl/src/crypto/digest_extra/digest_extra.c +FILE: ../../../third_party/boringssl/src/crypto/dsa/dsa.c +FILE: ../../../third_party/boringssl/src/crypto/dsa/dsa_test.cc +FILE: ../../../third_party/boringssl/src/crypto/err/err.c +FILE: ../../../third_party/boringssl/src/crypto/evp/evp.c +FILE: ../../../third_party/boringssl/src/crypto/evp/evp_asn1.c +FILE: ../../../third_party/boringssl/src/crypto/evp/evp_ctx.c +FILE: ../../../third_party/boringssl/src/crypto/evp/internal.h +FILE: ../../../third_party/boringssl/src/crypto/evp/sign.c +FILE: ../../../third_party/boringssl/src/crypto/ex_data.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/add.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/bn.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/bn_test.cc +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/bytes.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/cmp.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/div.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/exponentiation.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/gcd.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/generic.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/montgomery.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/mul.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/prime.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/random.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/shift.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/cipher/cipher.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/cipher/e_des.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/cipher/internal.h +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/des/des.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/des/internal.h +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/digest/digest.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/digest/digests.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/digest/internal.h +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/hmac/hmac.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/md4/md4.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/md5/md5.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/rsa/internal.h +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/rsa/rsa.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/rsa/rsa_impl.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/sha/sha1-altivec.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/sha/sha1.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/sha/sha256.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/sha/sha512.c +FILE: ../../../third_party/boringssl/src/crypto/hmac_extra/hmac_test.cc +FILE: ../../../third_party/boringssl/src/crypto/internal.h +FILE: ../../../third_party/boringssl/src/crypto/lhash/lhash.c +FILE: ../../../third_party/boringssl/src/crypto/mem.c +FILE: ../../../third_party/boringssl/src/crypto/obj/obj.c +FILE: ../../../third_party/boringssl/src/crypto/obj/obj_xref.c +FILE: ../../../third_party/boringssl/src/crypto/pem/pem_all.c +FILE: ../../../third_party/boringssl/src/crypto/pem/pem_info.c +FILE: ../../../third_party/boringssl/src/crypto/pem/pem_lib.c +FILE: ../../../third_party/boringssl/src/crypto/pem/pem_oth.c +FILE: ../../../third_party/boringssl/src/crypto/pem/pem_pk8.c +FILE: ../../../third_party/boringssl/src/crypto/pem/pem_pkey.c +FILE: ../../../third_party/boringssl/src/crypto/rc4/rc4.c +FILE: ../../../third_party/boringssl/src/crypto/rsa_extra/rsa_test.cc +FILE: ../../../third_party/boringssl/src/crypto/stack/stack.c +FILE: ../../../third_party/boringssl/src/crypto/thread.c +FILE: ../../../third_party/boringssl/src/crypto/x509/a_digest.c +FILE: ../../../third_party/boringssl/src/crypto/x509/a_sign.c +FILE: ../../../third_party/boringssl/src/crypto/x509/a_strex.c +FILE: ../../../third_party/boringssl/src/crypto/x509/a_verify.c +FILE: ../../../third_party/boringssl/src/crypto/x509/algorithm.c +FILE: ../../../third_party/boringssl/src/crypto/x509/asn1_gen.c +FILE: ../../../third_party/boringssl/src/crypto/x509/by_dir.c +FILE: ../../../third_party/boringssl/src/crypto/x509/by_file.c +FILE: ../../../third_party/boringssl/src/crypto/x509/i2d_pr.c +FILE: ../../../third_party/boringssl/src/crypto/x509/t_crl.c +FILE: ../../../third_party/boringssl/src/crypto/x509/t_req.c +FILE: ../../../third_party/boringssl/src/crypto/x509/t_x509.c +FILE: ../../../third_party/boringssl/src/crypto/x509/t_x509a.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_att.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_cmp.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_d2.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_def.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_ext.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_lu.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_obj.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_r2x.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_req.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_set.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_txt.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_v3.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509_vfy.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509name.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x509rset.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_all.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_attrib.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_crl.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_exten.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_info.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_name.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_pkey.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_pubkey.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_req.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_sig.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_spki.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_val.c +FILE: ../../../third_party/boringssl/src/crypto/x509/x_x509.c +FILE: ../../../third_party/boringssl/src/decrepit/bio/base64_bio.c +FILE: ../../../third_party/boringssl/src/decrepit/blowfish/blowfish.c +FILE: ../../../third_party/boringssl/src/decrepit/cast/cast.c +FILE: ../../../third_party/boringssl/src/decrepit/cast/cast_tables.c +FILE: ../../../third_party/boringssl/src/decrepit/cast/internal.h +FILE: ../../../third_party/boringssl/src/decrepit/des/cfb64ede.c +FILE: ../../../third_party/boringssl/src/decrepit/macros.h +FILE: ../../../third_party/boringssl/src/decrepit/rc4/rc4_decrepit.c +FILE: ../../../third_party/boringssl/src/decrepit/ripemd/internal.h +FILE: ../../../third_party/boringssl/src/decrepit/ripemd/ripemd.c +FILE: ../../../third_party/boringssl/src/decrepit/rsa/rsa_decrepit.c +FILE: ../../../third_party/boringssl/src/decrepit/ssl/ssl_decrepit.c +FILE: ../../../third_party/boringssl/src/include/openssl/asn1.h +FILE: ../../../third_party/boringssl/src/include/openssl/base64.h +FILE: ../../../third_party/boringssl/src/include/openssl/bio.h +FILE: ../../../third_party/boringssl/src/include/openssl/blowfish.h +FILE: ../../../third_party/boringssl/src/include/openssl/buf.h +FILE: ../../../third_party/boringssl/src/include/openssl/cast.h FILE: ../../../third_party/boringssl/src/include/openssl/cipher.h FILE: ../../../third_party/boringssl/src/include/openssl/conf.h FILE: ../../../third_party/boringssl/src/include/openssl/cpu.h @@ -1090,6 +1419,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. LIBRARY: boringssl ORIGIN: ../../../third_party/boringssl/src/crypto/buf/buf_test.cc TYPE: LicenseType.unknown +FILE: ../../../third_party/boringssl/crypto_test_data.cc FILE: ../../../third_party/boringssl/src/crypto/buf/buf_test.cc FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_aesctrhmac.c FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c @@ -1165,6 +1495,43 @@ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ==================================================================================================== +==================================================================================================== +LIBRARY: boringssl +ORIGIN: ../../../third_party/boringssl/src/crypto/bytestring/unicode.c +TYPE: LicenseType.unknown +FILE: ../../../third_party/boringssl/src/crypto/bytestring/unicode.c +FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_aesccm.c +FILE: ../../../third_party/boringssl/src/crypto/cpu-aarch64-fuchsia.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/div_extra.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/bn/gcd_extra.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/ec/felem.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/ec/make_ec_scalar_base_mult_tests.go +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/ec/make_p256-x86_64-table.go +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/ec/scalar.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/ec/simple_mul.c +FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/tls/internal.h +FILE: ../../../third_party/boringssl/src/crypto/self_test.cc +FILE: ../../../third_party/boringssl/src/fipstools/cavp_kas_test.cc +FILE: ../../../third_party/boringssl/src/fipstools/cavp_tlskdf_test.cc +FILE: ../../../third_party/boringssl/src/include/openssl/e_os2.h +FILE: ../../../third_party/boringssl/src/ssl/handoff.cc +FILE: ../../../third_party/boringssl/src/third_party/wycheproof_testvectors/convert_wycheproof.go +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: boringssl ORIGIN: ../../../third_party/boringssl/src/crypto/cipher_extra/cipher_test.cc @@ -1219,33 +1586,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: boringssl -ORIGIN: ../../../third_party/boringssl/src/crypto/cipher_extra/e_aesccm.c -TYPE: LicenseType.unknown -FILE: ../../../third_party/boringssl/src/crypto/cipher_extra/e_aesccm.c -FILE: ../../../third_party/boringssl/src/crypto/cpu-aarch64-fuchsia.c -FILE: ../../../third_party/boringssl/src/crypto/fipsmodule/tls/internal.h -FILE: ../../../third_party/boringssl/src/crypto/self_test.cc -FILE: ../../../third_party/boringssl/src/fipstools/cavp_kas_test.cc -FILE: ../../../third_party/boringssl/src/fipstools/cavp_tlskdf_test.cc -FILE: ../../../third_party/boringssl/src/ssl/handoff.cc ----------------------------------------------------------------------------------------------------- -Copyright (c) 2018, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -==================================================================================================== - ==================================================================================================== LIBRARY: boringssl ORIGIN: ../../../third_party/boringssl/src/crypto/cipher_extra/tls_cbc.c @@ -2671,6 +3011,20 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: boringssl +ORIGIN: ../../../third_party/boringssl/src/crypto/rsa_extra/print.c + ../../../third_party/boringssl/src/LICENSE +TYPE: LicenseType.unknown +FILE: ../../../third_party/boringssl/src/crypto/rsa_extra/print.c +---------------------------------------------------------------------------------------------------- +Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +==================================================================================================== + ==================================================================================================== LIBRARY: boringssl ORIGIN: ../../../third_party/boringssl/src/crypto/x509/vpm_int.h @@ -3111,6 +3465,20 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: boringssl +ORIGIN: ../../../third_party/boringssl/src/crypto/x509v3/v3_ocsp.c + ../../../third_party/boringssl/src/LICENSE +TYPE: LicenseType.unknown +FILE: ../../../third_party/boringssl/src/crypto/x509v3/v3_ocsp.c +---------------------------------------------------------------------------------------------------- +Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +==================================================================================================== + ==================================================================================================== LIBRARY: boringssl ORIGIN: ../../../third_party/boringssl/src/crypto/x509v3/v3_pci.c @@ -3959,40 +4327,19 @@ FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/armv4-mont.S FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/ghash-armv4.S FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/ghashv8-armx32.S FILE: ../../../third_party/boringssl/ios-arm/crypto/fipsmodule/sha1-armv4-large.S -FILE: ../../../third_party/boringssl/linux-aarch64/crypto/aes/aesv8-armx64.S -FILE: ../../../third_party/boringssl/linux-aarch64/crypto/bn/armv8-mont.S FILE: ../../../third_party/boringssl/linux-aarch64/crypto/chacha/chacha-armv8.S FILE: ../../../third_party/boringssl/linux-aarch64/crypto/fipsmodule/aesv8-armx64.S FILE: ../../../third_party/boringssl/linux-aarch64/crypto/fipsmodule/armv8-mont.S FILE: ../../../third_party/boringssl/linux-aarch64/crypto/fipsmodule/ghashv8-armx64.S FILE: ../../../third_party/boringssl/linux-aarch64/crypto/fipsmodule/sha1-armv8.S -FILE: ../../../third_party/boringssl/linux-aarch64/crypto/modes/ghashv8-armx64.S -FILE: ../../../third_party/boringssl/linux-aarch64/crypto/sha/sha1-armv8.S -FILE: ../../../third_party/boringssl/linux-aarch64/crypto/sha/sha256-armv8.S -FILE: ../../../third_party/boringssl/linux-aarch64/crypto/sha/sha512-armv8.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/aes/aes-armv4.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/aes/aesv8-armx32.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/aes/bsaes-armv7.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/bn/armv4-mont.S FILE: ../../../third_party/boringssl/linux-arm/crypto/chacha/chacha-armv4.S FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/aesv8-armx32.S FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/armv4-mont.S FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/ghash-armv4.S FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/ghashv8-armx32.S FILE: ../../../third_party/boringssl/linux-arm/crypto/fipsmodule/sha1-armv4-large.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/modes/ghash-armv4.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/modes/ghashv8-armx32.S -FILE: ../../../third_party/boringssl/linux-arm/crypto/sha/sha1-armv4-large.S -FILE: ../../../third_party/boringssl/linux-ppc64le/crypto/aes/aesp8-ppc.S FILE: ../../../third_party/boringssl/linux-ppc64le/crypto/fipsmodule/aesp8-ppc.S FILE: ../../../third_party/boringssl/linux-ppc64le/crypto/fipsmodule/ghashp8-ppc.S -FILE: ../../../third_party/boringssl/linux-ppc64le/crypto/modes/ghashp8-ppc.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/aes/aes-586.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/aes/aesni-x86.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/aes/vpaes-x86.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/bn/bn-586.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/bn/co-586.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/bn/x86-mont.S FILE: ../../../third_party/boringssl/linux-x86/crypto/chacha/chacha-x86.S FILE: ../../../third_party/boringssl/linux-x86/crypto/fipsmodule/aes-586.S FILE: ../../../third_party/boringssl/linux-x86/crypto/fipsmodule/aesni-x86.S @@ -4005,23 +4352,9 @@ FILE: ../../../third_party/boringssl/linux-x86/crypto/fipsmodule/sha256-586.S FILE: ../../../third_party/boringssl/linux-x86/crypto/fipsmodule/sha512-586.S FILE: ../../../third_party/boringssl/linux-x86/crypto/fipsmodule/vpaes-x86.S FILE: ../../../third_party/boringssl/linux-x86/crypto/fipsmodule/x86-mont.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/md5/md5-586.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/modes/ghash-x86.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/sha/sha1-586.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/sha/sha256-586.S -FILE: ../../../third_party/boringssl/linux-x86/crypto/sha/sha512-586.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/aes/aes-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/aes/aesni-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/aes/bsaes-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/aes/vpaes-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/bn/rsaz-avx2.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/bn/rsaz-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont5.S FILE: ../../../third_party/boringssl/linux-x86_64/crypto/chacha/chacha-x86_64.S FILE: ../../../third_party/boringssl/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S FILE: ../../../third_party/boringssl/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/ec/p256-x86_64-asm.S FILE: ../../../third_party/boringssl/linux-x86_64/crypto/fipsmodule/aes-x86_64.S FILE: ../../../third_party/boringssl/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S FILE: ../../../third_party/boringssl/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S @@ -4037,19 +4370,6 @@ FILE: ../../../third_party/boringssl/linux-x86_64/crypto/fipsmodule/sha512-x86_6 FILE: ../../../third_party/boringssl/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S FILE: ../../../third_party/boringssl/linux-x86_64/crypto/fipsmodule/x86_64-mont.S FILE: ../../../third_party/boringssl/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/md5/md5-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/modes/aesni-gcm-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/modes/ghash-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/rand/rdrand-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/sha/sha1-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/sha/sha256-x86_64.S -FILE: ../../../third_party/boringssl/linux-x86_64/crypto/sha/sha512-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/aes/aes-586.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/aes/aesni-x86.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/aes/vpaes-x86.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/bn/bn-586.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/bn/co-586.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/bn/x86-mont.S FILE: ../../../third_party/boringssl/mac-x86/crypto/chacha/chacha-x86.S FILE: ../../../third_party/boringssl/mac-x86/crypto/fipsmodule/aes-586.S FILE: ../../../third_party/boringssl/mac-x86/crypto/fipsmodule/aesni-x86.S @@ -4062,23 +4382,9 @@ FILE: ../../../third_party/boringssl/mac-x86/crypto/fipsmodule/sha256-586.S FILE: ../../../third_party/boringssl/mac-x86/crypto/fipsmodule/sha512-586.S FILE: ../../../third_party/boringssl/mac-x86/crypto/fipsmodule/vpaes-x86.S FILE: ../../../third_party/boringssl/mac-x86/crypto/fipsmodule/x86-mont.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/md5/md5-586.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/modes/ghash-x86.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/sha/sha1-586.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/sha/sha256-586.S -FILE: ../../../third_party/boringssl/mac-x86/crypto/sha/sha512-586.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/aes/aes-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/aes/aesni-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/aes/bsaes-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/aes/vpaes-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/bn/rsaz-avx2.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/bn/rsaz-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont5.S FILE: ../../../third_party/boringssl/mac-x86_64/crypto/chacha/chacha-x86_64.S FILE: ../../../third_party/boringssl/mac-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S FILE: ../../../third_party/boringssl/mac-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/ec/p256-x86_64-asm.S FILE: ../../../third_party/boringssl/mac-x86_64/crypto/fipsmodule/aes-x86_64.S FILE: ../../../third_party/boringssl/mac-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S FILE: ../../../third_party/boringssl/mac-x86_64/crypto/fipsmodule/aesni-x86_64.S @@ -4094,19 +4400,6 @@ FILE: ../../../third_party/boringssl/mac-x86_64/crypto/fipsmodule/sha512-x86_64. FILE: ../../../third_party/boringssl/mac-x86_64/crypto/fipsmodule/vpaes-x86_64.S FILE: ../../../third_party/boringssl/mac-x86_64/crypto/fipsmodule/x86_64-mont.S FILE: ../../../third_party/boringssl/mac-x86_64/crypto/fipsmodule/x86_64-mont5.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/md5/md5-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/modes/aesni-gcm-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/modes/ghash-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/rand/rdrand-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/sha/sha1-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/sha/sha256-x86_64.S -FILE: ../../../third_party/boringssl/mac-x86_64/crypto/sha/sha512-x86_64.S -FILE: ../../../third_party/boringssl/win-x86/crypto/aes/aes-586.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/aes/aesni-x86.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/aes/vpaes-x86.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/bn/bn-586.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/bn/co-586.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/bn/x86-mont.asm FILE: ../../../third_party/boringssl/win-x86/crypto/chacha/chacha-x86.asm FILE: ../../../third_party/boringssl/win-x86/crypto/fipsmodule/aes-586.asm FILE: ../../../third_party/boringssl/win-x86/crypto/fipsmodule/aesni-x86.asm @@ -4119,23 +4412,9 @@ FILE: ../../../third_party/boringssl/win-x86/crypto/fipsmodule/sha256-586.asm FILE: ../../../third_party/boringssl/win-x86/crypto/fipsmodule/sha512-586.asm FILE: ../../../third_party/boringssl/win-x86/crypto/fipsmodule/vpaes-x86.asm FILE: ../../../third_party/boringssl/win-x86/crypto/fipsmodule/x86-mont.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/md5/md5-586.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/modes/ghash-x86.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/sha/sha1-586.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/sha/sha256-586.asm -FILE: ../../../third_party/boringssl/win-x86/crypto/sha/sha512-586.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/aes/aes-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/aes/aesni-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/aes/bsaes-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/aes/vpaes-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/bn/rsaz-avx2.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/bn/rsaz-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont5.asm FILE: ../../../third_party/boringssl/win-x86_64/crypto/chacha/chacha-x86_64.asm FILE: ../../../third_party/boringssl/win-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.asm FILE: ../../../third_party/boringssl/win-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/ec/p256-x86_64-asm.asm FILE: ../../../third_party/boringssl/win-x86_64/crypto/fipsmodule/aes-x86_64.asm FILE: ../../../third_party/boringssl/win-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.asm FILE: ../../../third_party/boringssl/win-x86_64/crypto/fipsmodule/aesni-x86_64.asm @@ -4151,13 +4430,6 @@ FILE: ../../../third_party/boringssl/win-x86_64/crypto/fipsmodule/sha512-x86_64. FILE: ../../../third_party/boringssl/win-x86_64/crypto/fipsmodule/vpaes-x86_64.asm FILE: ../../../third_party/boringssl/win-x86_64/crypto/fipsmodule/x86_64-mont.asm FILE: ../../../third_party/boringssl/win-x86_64/crypto/fipsmodule/x86_64-mont5.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/md5/md5-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/modes/aesni-gcm-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/modes/ghash-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/rand/rdrand-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/sha/sha1-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/sha/sha256-x86_64.asm -FILE: ../../../third_party/boringssl/win-x86_64/crypto/sha/sha512-x86_64.asm ---------------------------------------------------------------------------------------------------- ==================================================================================================== @@ -4824,7 +5096,6 @@ FILE: ../../../third_party/dart/sdk/lib/core/string.dart FILE: ../../../third_party/dart/sdk/lib/core/type.dart FILE: ../../../third_party/dart/sdk/lib/core/uri.dart FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart -FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/html/dartium/nativewrappers.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/css_class_set.dart @@ -5468,7 +5739,61 @@ FILE: ../../../third_party/dart/sdk/lib/internal/iterable.dart FILE: ../../../third_party/dart/sdk/lib/internal/sort.dart FILE: ../../../third_party/dart/utils/peg/pegparser.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/typed_data_utils.cc + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.cc +FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h +FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h +FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h +FILE: ../../../third_party/dart/runtime/vm/datastream.cc +FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h +FILE: ../../../third_party/dart/runtime/vm/hash.h +FILE: ../../../third_party/dart/runtime/vm/interpreter.cc +FILE: ../../../third_party/dart/runtime/vm/interpreter.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h +FILE: ../../../third_party/dart/sdk/lib/js/_js.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart +FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -5989,88 +6314,14 @@ and disclaimer. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd +ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/boringssl/src/LICENSE +TYPE: LicenseType.unknown FILE: ../../../third_party/dart/runtime/lib/bigint.dart FILE: ../../../third_party/dart/runtime/lib/bigint_patch.dart ---------------------------------------------------------------------------------------------------- Copyright 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h -FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h -FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h -FILE: ../../../third_party/dart/runtime/vm/datastream.cc -FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h -FILE: ../../../third_party/dart/runtime/vm/hash.h -FILE: ../../../third_party/dart/runtime/vm/interpreter.cc -FILE: ../../../third_party/dart/runtime/vm/interpreter.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h -FILE: ../../../third_party/dart/sdk/lib/js/_js.dart -FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart -FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart -FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Use of this source code is governed by a BSD-style +license that can be found in the LICENSE file ==================================================================================================== ==================================================================================================== @@ -14791,176 +15042,7 @@ FILE: ../../../third_party/libwebp/src/utils/quant_levels_dec_utils.h FILE: ../../../third_party/libwebp/src/utils/random_utils.c FILE: ../../../third_party/libwebp/src/utils/random_utils.h ---------------------------------------------------------------------------------------------------- -Copyright 2013 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: libwebp -ORIGIN: ../../../third_party/libwebp/src/dec/alpha_dec.c + ../../../third_party/libwebp/COPYING -TYPE: LicenseType.bsd -FILE: ../../../third_party/libwebp/src/dec/alpha_dec.c -FILE: ../../../third_party/libwebp/src/dec/buffer_dec.c -FILE: ../../../third_party/libwebp/src/dec/idec_dec.c -FILE: ../../../third_party/libwebp/src/dec/io_dec.c -FILE: ../../../third_party/libwebp/src/dec/webpi_dec.h -FILE: ../../../third_party/libwebp/src/dsp/cpu.c -FILE: ../../../third_party/libwebp/src/dsp/dec_sse2.c -FILE: ../../../third_party/libwebp/src/dsp/dsp.h -FILE: ../../../third_party/libwebp/src/dsp/enc.c -FILE: ../../../third_party/libwebp/src/dsp/enc_sse2.c -FILE: ../../../third_party/libwebp/src/dsp/filters.c -FILE: ../../../third_party/libwebp/src/dsp/upsampling.c -FILE: ../../../third_party/libwebp/src/dsp/upsampling_neon.c -FILE: ../../../third_party/libwebp/src/dsp/upsampling_sse2.c -FILE: ../../../third_party/libwebp/src/enc/alpha_enc.c -FILE: ../../../third_party/libwebp/src/enc/analysis_enc.c -FILE: ../../../third_party/libwebp/src/enc/config_enc.c -FILE: ../../../third_party/libwebp/src/enc/cost_enc.c -FILE: ../../../third_party/libwebp/src/enc/cost_enc.h -FILE: ../../../third_party/libwebp/src/enc/filter_enc.c -FILE: ../../../third_party/libwebp/src/enc/frame_enc.c -FILE: ../../../third_party/libwebp/src/enc/iterator_enc.c -FILE: ../../../third_party/libwebp/src/enc/picture_enc.c -FILE: ../../../third_party/libwebp/src/enc/quant_enc.c -FILE: ../../../third_party/libwebp/src/enc/syntax_enc.c -FILE: ../../../third_party/libwebp/src/enc/token_enc.c -FILE: ../../../third_party/libwebp/src/enc/tree_enc.c -FILE: ../../../third_party/libwebp/src/enc/vp8i_enc.h -FILE: ../../../third_party/libwebp/src/enc/webp_enc.c -FILE: ../../../third_party/libwebp/src/mux/muxedit.c -FILE: ../../../third_party/libwebp/src/mux/muxi.h -FILE: ../../../third_party/libwebp/src/mux/muxinternal.c -FILE: ../../../third_party/libwebp/src/mux/muxread.c -FILE: ../../../third_party/libwebp/src/utils/bit_writer_utils.c -FILE: ../../../third_party/libwebp/src/utils/bit_writer_utils.h -FILE: ../../../third_party/libwebp/src/utils/filters_utils.c -FILE: ../../../third_party/libwebp/src/utils/filters_utils.h -FILE: ../../../third_party/libwebp/src/utils/huffman_encode_utils.c -FILE: ../../../third_party/libwebp/src/utils/huffman_encode_utils.h -FILE: ../../../third_party/libwebp/src/utils/quant_levels_utils.c -FILE: ../../../third_party/libwebp/src/utils/quant_levels_utils.h -FILE: ../../../third_party/libwebp/src/utils/thread_utils.c -FILE: ../../../third_party/libwebp/src/utils/thread_utils.h -FILE: ../../../third_party/libwebp/src/webp/encode.h -FILE: ../../../third_party/libwebp/src/webp/mux.h ----------------------------------------------------------------------------------------------------- -Copyright 2011 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: libwebp -ORIGIN: ../../../third_party/libwebp/src/dec/frame_dec.c + ../../../third_party/libwebp/COPYING -TYPE: LicenseType.bsd -FILE: ../../../third_party/libwebp/src/dec/frame_dec.c -FILE: ../../../third_party/libwebp/src/dec/quant_dec.c -FILE: ../../../third_party/libwebp/src/dec/tree_dec.c -FILE: ../../../third_party/libwebp/src/dec/vp8_dec.c -FILE: ../../../third_party/libwebp/src/dec/vp8_dec.h -FILE: ../../../third_party/libwebp/src/dec/vp8i_dec.h -FILE: ../../../third_party/libwebp/src/dec/webp_dec.c -FILE: ../../../third_party/libwebp/src/dsp/dec.c -FILE: ../../../third_party/libwebp/src/dsp/yuv.c -FILE: ../../../third_party/libwebp/src/dsp/yuv.h -FILE: ../../../third_party/libwebp/src/utils/bit_reader_utils.c -FILE: ../../../third_party/libwebp/src/utils/bit_reader_utils.h -FILE: ../../../third_party/libwebp/src/webp/decode.h -FILE: ../../../third_party/libwebp/src/webp/types.h ----------------------------------------------------------------------------------------------------- -Copyright 2010 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: libwebp -ORIGIN: ../../../third_party/libwebp/src/dsp/alpha_processing_neon.c + ../../../third_party/libwebp/COPYING -TYPE: LicenseType.bsd -FILE: ../../../third_party/libwebp/src/dsp/alpha_processing_neon.c -FILE: ../../../third_party/libwebp/src/dsp/filters_neon.c ----------------------------------------------------------------------------------------------------- -Copyright 2017 Google Inc. All Rights Reserved. +Copyright 2013 Google Inc. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -14992,329 +15074,235 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== ==================================================================================================== -LIBRARY: observatory_pub_packages -LIBRARY: pkg -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE +LIBRARY: libwebp +ORIGIN: ../../../third_party/libwebp/src/dec/alpha_dec.c + ../../../third_party/libwebp/COPYING TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_memoizer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/cancelable_operation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream_consumer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream_subscription.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/future_group.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/lazy_stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/restartable_timer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_completer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_group.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_queue.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_splitter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/subscription_stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/comparators.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/location_mixin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/unparsed_frame.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/expected_function.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/group_context.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/shared.dart -FILE: ../../../third_party/pkg/when/lib/when.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -LIBRARY: skia -LIBRARY: vulkan -ORIGIN: ../../../flutter/third_party/txt/LICENSE -TYPE: LicenseType.apache -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/async.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/cache.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/check.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/collection.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/core.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/iterables.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/mirrors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/pattern.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/collect.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/concat.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/countdown_timer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/enumerate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/future_stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/iteration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/metronome.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/stream_buffer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/async/stream_router.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/cache/cache.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/cache/map_cache.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/bimap.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/iterable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/queue.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/delegates/set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/lru_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/multimap.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/collection/treeset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/core/hash.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/core/optional.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/concat.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/count.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/cycle.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/enumerate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/generating_iterable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/infinite_iterable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/merge.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/min_max.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/partition.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/range.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/iterables/zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/pattern/glob.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/clock.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/duration_unit_constants.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/util.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/strings.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/time.dart -FILE: ../../../third_party/skia/src/images/SkWebpEncoder.cpp -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vk_platform.h -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan.h -FILE: ../../../third_party/vulkan/src/vulkan/vk_platform.h -FILE: ../../../third_party/vulkan/src/vulkan/vulkan.h +FILE: ../../../third_party/libwebp/src/dec/alpha_dec.c +FILE: ../../../third_party/libwebp/src/dec/buffer_dec.c +FILE: ../../../third_party/libwebp/src/dec/idec_dec.c +FILE: ../../../third_party/libwebp/src/dec/io_dec.c +FILE: ../../../third_party/libwebp/src/dec/webpi_dec.h +FILE: ../../../third_party/libwebp/src/dsp/cpu.c +FILE: ../../../third_party/libwebp/src/dsp/dec_sse2.c +FILE: ../../../third_party/libwebp/src/dsp/dsp.h +FILE: ../../../third_party/libwebp/src/dsp/enc.c +FILE: ../../../third_party/libwebp/src/dsp/enc_sse2.c +FILE: ../../../third_party/libwebp/src/dsp/filters.c +FILE: ../../../third_party/libwebp/src/dsp/upsampling.c +FILE: ../../../third_party/libwebp/src/dsp/upsampling_neon.c +FILE: ../../../third_party/libwebp/src/dsp/upsampling_sse2.c +FILE: ../../../third_party/libwebp/src/enc/alpha_enc.c +FILE: ../../../third_party/libwebp/src/enc/analysis_enc.c +FILE: ../../../third_party/libwebp/src/enc/config_enc.c +FILE: ../../../third_party/libwebp/src/enc/cost_enc.c +FILE: ../../../third_party/libwebp/src/enc/cost_enc.h +FILE: ../../../third_party/libwebp/src/enc/filter_enc.c +FILE: ../../../third_party/libwebp/src/enc/frame_enc.c +FILE: ../../../third_party/libwebp/src/enc/iterator_enc.c +FILE: ../../../third_party/libwebp/src/enc/picture_enc.c +FILE: ../../../third_party/libwebp/src/enc/quant_enc.c +FILE: ../../../third_party/libwebp/src/enc/syntax_enc.c +FILE: ../../../third_party/libwebp/src/enc/token_enc.c +FILE: ../../../third_party/libwebp/src/enc/tree_enc.c +FILE: ../../../third_party/libwebp/src/enc/vp8i_enc.h +FILE: ../../../third_party/libwebp/src/enc/webp_enc.c +FILE: ../../../third_party/libwebp/src/mux/muxedit.c +FILE: ../../../third_party/libwebp/src/mux/muxi.h +FILE: ../../../third_party/libwebp/src/mux/muxinternal.c +FILE: ../../../third_party/libwebp/src/mux/muxread.c +FILE: ../../../third_party/libwebp/src/utils/bit_writer_utils.c +FILE: ../../../third_party/libwebp/src/utils/bit_writer_utils.h +FILE: ../../../third_party/libwebp/src/utils/filters_utils.c +FILE: ../../../third_party/libwebp/src/utils/filters_utils.h +FILE: ../../../third_party/libwebp/src/utils/huffman_encode_utils.c +FILE: ../../../third_party/libwebp/src/utils/huffman_encode_utils.h +FILE: ../../../third_party/libwebp/src/utils/quant_levels_utils.c +FILE: ../../../third_party/libwebp/src/utils/quant_levels_utils.h +FILE: ../../../third_party/libwebp/src/utils/thread_utils.c +FILE: ../../../third_party/libwebp/src/utils/thread_utils.h +FILE: ../../../third_party/libwebp/src/webp/encode.h +FILE: ../../../third_party/libwebp/src/webp/mux.h ---------------------------------------------------------------------------------------------------- -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. +Copyright 2011 Google Inc. All Rights Reserved. -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. +==================================================================================================== +LIBRARY: libwebp +ORIGIN: ../../../third_party/libwebp/src/dec/frame_dec.c + ../../../third_party/libwebp/COPYING +TYPE: LicenseType.bsd +FILE: ../../../third_party/libwebp/src/dec/frame_dec.c +FILE: ../../../third_party/libwebp/src/dec/quant_dec.c +FILE: ../../../third_party/libwebp/src/dec/tree_dec.c +FILE: ../../../third_party/libwebp/src/dec/vp8_dec.c +FILE: ../../../third_party/libwebp/src/dec/vp8_dec.h +FILE: ../../../third_party/libwebp/src/dec/vp8i_dec.h +FILE: ../../../third_party/libwebp/src/dec/webp_dec.c +FILE: ../../../third_party/libwebp/src/dsp/dec.c +FILE: ../../../third_party/libwebp/src/dsp/yuv.c +FILE: ../../../third_party/libwebp/src/dsp/yuv.h +FILE: ../../../third_party/libwebp/src/utils/bit_reader_utils.c +FILE: ../../../third_party/libwebp/src/utils/bit_reader_utils.h +FILE: ../../../third_party/libwebp/src/webp/decode.h +FILE: ../../../third_party/libwebp/src/webp/types.h +---------------------------------------------------------------------------------------------------- +Copyright 2010 Google Inc. All Rights Reserved. - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. +==================================================================================================== +LIBRARY: libwebp +ORIGIN: ../../../third_party/libwebp/src/dsp/alpha_processing_neon.c + ../../../third_party/libwebp/COPYING +TYPE: LicenseType.bsd +FILE: ../../../third_party/libwebp/src/dsp/alpha_processing_neon.c +FILE: ../../../third_party/libwebp/src/dsp/filters_neon.c +---------------------------------------------------------------------------------------------------- +Copyright 2017 Google Inc. All Rights Reserved. -END OF TERMS AND CONDITIONS +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -APPENDIX: How to apply the Apache License to your work. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. -Copyright [yyyy] [name of copyright owner] + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== - http://www.apache.org/licenses/LICENSE-2.0 +==================================================================================================== +LIBRARY: observatory_pub_packages +LIBRARY: pkg +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_memoizer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/cancelable_operation.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/future.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream_consumer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream_sink.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream_subscription.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/future_group.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/lazy_stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/restartable_timer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/future.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_completer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_group.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_queue.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_splitter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/subscription_stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.status +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/comparators.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/location_mixin.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/unparsed_frame.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/expected_function.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/group_context.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/shared.dart +FILE: ../../../third_party/pkg/when/lib/when.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== ==================================================================================================== @@ -21922,4 +21910,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 320 +Total license count: 322 From 5dd5c6758e1fae469012e251c8252c97217636f8 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 26 May 2018 17:18:55 -0400 Subject: [PATCH 0457/1190] Roll src/third_party/skia 6b6c47c..d8eb7b6 (5 commits) (#5396) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 530 +++++++++++--------- travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 283 insertions(+), 251 deletions(-) diff --git a/DEPS b/DEPS index 3a3a3bb2ba89d..08f7ddc33ee18 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6b6c47c063ab7e4085b931b17a885cf3ca6d37d3', + 'skia_revision': 'd8eb7b6b12d5b155214031d4aa4d8f582ebb91a1', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 08c8fb2c59582..88aa77d410c23 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -2065,6 +2065,15 @@ https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl +Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. Redistribution and use in source and binary forms, with or without @@ -2281,6 +2290,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl +Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + Copyright 2007, Google Inc. All rights reserved. @@ -2569,6 +2587,32 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- boringssl +The MIT License (MIT) + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl +dart + OpenSSL License ==================================================================== @@ -2719,31 +2763,248 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Licenses for support code + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl +observatory_pub_packages +skia +txt +vulkan -The MIT License (MIT) +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + http://www.apache.org/licenses/LICENSE-2.0 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. -------------------------------------------------------------------------------- colorama @@ -3042,30 +3303,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. dart Copyright 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Use of this source code is governed by a BSD-style +license that can be found in the LICENSE file -------------------------------------------------------------------------------- dart @@ -8632,213 +8871,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -observatory_pub_packages -skia -txt -vulkan - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. --------------------------------------------------------------------------------- rapidjson Copyright (c) 2006-2013 Alexander Chemeris diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b6aa8ee511023..7b1d9db36c37b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: cd6ca7e2607cfda86903bcff3ad27234 +Signature: 276fe0f9e525d7d59359272c94922089 UNUSED LICENSES: From 227bbc5aa8bfa6e197814e3ff340c483d863be6e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 26 May 2018 22:46:55 -0400 Subject: [PATCH 0458/1190] Roll src/third_party/skia d8eb7b6..3d856bd (1 commits) (#5397) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 24 ++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/DEPS b/DEPS index 08f7ddc33ee18..ff8a02f1c8e03 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd8eb7b6b12d5b155214031d4aa4d8f582ebb91a1', + 'skia_revision': '3d856bdeee7fae2ff36cdb6a9807c588fc030eb1', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7b1d9db36c37b..955cf259b8a35 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 276fe0f9e525d7d59359272c94922089 +Signature: 8c21e9221f7a33eff5ee71d6a5844990 UNUSED LICENSES: @@ -17148,10 +17148,6 @@ ORIGIN: ../../../third_party/skia/bench/GrCCGeometryBench.cpp + ../../../third_p TYPE: LicenseType.bsd FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieAdapter.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieJson.h FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/FuzzRegionOp.cpp @@ -17180,6 +17176,10 @@ FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go +FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.h +FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.h FILE: ../../../third_party/skia/modules/sksg/include/SkSGClipEffect.h FILE: ../../../third_party/skia/modules/sksg/include/SkSGGeometryTransform.h FILE: ../../../third_party/skia/modules/sksg/include/SkSGGradient.h @@ -19353,12 +19353,6 @@ FILE: ../../../third_party/skia/bench/ShadowBench.cpp FILE: ../../../third_party/skia/dm/DMGpuTestProcs.cpp FILE: ../../../third_party/skia/example/HelloWorld.cpp FILE: ../../../third_party/skia/example/HelloWorld.h -FILE: ../../../third_party/skia/experimental/skottie/Skottie.cpp -FILE: ../../../third_party/skia/experimental/skottie/Skottie.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieAnimator.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieAnimator.h -FILE: ../../../third_party/skia/experimental/skottie/SkottieValue.cpp -FILE: ../../../third_party/skia/experimental/skottie/SkottieValue.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGGradient.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGGradient.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPattern.cpp @@ -19435,6 +19429,12 @@ FILE: ../../../third_party/skia/include/private/SkImageInfoPriv.h FILE: ../../../third_party/skia/include/private/SkMalloc.h FILE: ../../../third_party/skia/include/private/SkShadowFlags.h FILE: ../../../third_party/skia/include/utils/SkShadowUtils.h +FILE: ../../../third_party/skia/modules/skottie/include/Skottie.h +FILE: ../../../third_party/skia/modules/skottie/src/Skottie.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieAnimator.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieAnimator.h +FILE: ../../../third_party/skia/modules/skottie/src/SkottieValue.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieValue.h FILE: ../../../third_party/skia/modules/sksg/include/SkSGColor.h FILE: ../../../third_party/skia/modules/sksg/include/SkSGDraw.h FILE: ../../../third_party/skia/modules/sksg/include/SkSGEffectNode.h @@ -19855,9 +19855,9 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzSkottieJSON.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp +FILE: ../../../third_party/skia/modules/skottie/fuzz/FuzzSkottieJSON.cpp ---------------------------------------------------------------------------------------------------- Copyright 2018 Google, LLC From 1fde2a2bcab3c9cb4adf55a17b26bf887b63f017 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 27 May 2018 05:04:55 -0400 Subject: [PATCH 0459/1190] Roll src/third_party/skia 3d856bd..6e71f39 (1 commits) (#5398) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ff8a02f1c8e03..28f9599998d1d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3d856bdeee7fae2ff36cdb6a9807c588fc030eb1', + 'skia_revision': '6e71f393b6cbfb439225574053462c3dfd356463', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 955cf259b8a35..c18cd306ce151 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8c21e9221f7a33eff5ee71d6a5844990 +Signature: 6277ce5d5acee94451d3aca42f83fe8c UNUSED LICENSES: From 2075de976cdea5ae7a14e99b8d82ba46b0cda649 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 28 May 2018 15:21:55 -0400 Subject: [PATCH 0460/1190] Roll src/third_party/skia 6e71f39..ca8b0bd (1 commits) (#5399) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 28f9599998d1d..670cd3710f91d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6e71f393b6cbfb439225574053462c3dfd356463', + 'skia_revision': 'ca8b0bd237eb2f4817352ce99fe82033ad39cb6d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c18cd306ce151..5dcd1f23b5ceb 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6277ce5d5acee94451d3aca42f83fe8c +Signature: 97f76f7dc34cc17626992a1ec00c79e6 UNUSED LICENSES: @@ -17412,7 +17412,7 @@ FILE: ../../../third_party/skia/animations/redcross#1.jpg FILE: ../../../third_party/skia/animations/text#1.xml FILE: ../../../third_party/skia/bench/microbench.json FILE: ../../../third_party/skia/bench/skpbench.json -FILE: ../../../third_party/skia/docker/skiaserve/Dockerfile +FILE: ../../../third_party/skia/docker/skia-release/Dockerfile FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh From 68606d7e53127c8834b1c0fdda79bdaad752b6f9 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 28 May 2018 18:45:55 -0400 Subject: [PATCH 0461/1190] Roll src/third_party/skia ca8b0bd..6016f77 (1 commits) (#5400) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 670cd3710f91d..7f0eec15a637b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ca8b0bd237eb2f4817352ce99fe82033ad39cb6d', + 'skia_revision': '6016f77594188b25d352572c6b2f84eb2daab3b5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5dcd1f23b5ceb..ea6d2cb507afc 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 97f76f7dc34cc17626992a1ec00c79e6 +Signature: 1c0e94570eaea3f2c44ffc34fbf4ab48 UNUSED LICENSES: From 3032cf82c26d6b9040caa335aa351418abd2edaa Mon Sep 17 00:00:00 2001 From: Dwayne Slater Date: Mon, 28 May 2018 20:49:18 -0400 Subject: [PATCH 0462/1190] Add @ds84182 to AUTHORS, for https://github.com/flutter/engine/pull/4730 (#5394) --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 3d412bd08c5e6..bd94ff3fe631e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -10,3 +10,4 @@ Jacob Greenfield Dan Field Victor Choueiri Simon Lightfoot +Dwayne Slater From 7e48cfa45530376262eb44709591234b00c32e0d Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Mon, 28 May 2018 18:05:43 -0700 Subject: [PATCH 0463/1190] Improve license script (#5382) --- tools/licenses/lib/licenses.dart | 2 + tools/licenses/lib/main.dart | 132 +++++++++++++++++++++++-------- 2 files changed, 101 insertions(+), 33 deletions(-) diff --git a/tools/licenses/lib/licenses.dart b/tools/licenses/lib/licenses.dart index 7584ff9c63d2b..bbcfdb00b2e5f 100644 --- a/tools/licenses/lib/licenses.dart +++ b/tools/licenses/lib/licenses.dart @@ -53,6 +53,7 @@ LicenseType convertLicenseNameToType(String name) { case 'license.html': case 'LICENSE.txt': case 'LICENSE.TXT': + case 'LICENSE.cssmin': case 'NOTICE': case 'NOTICE.txt': case 'Copyright': @@ -68,6 +69,7 @@ LicenseType convertLicenseNameToType(String name) { case 'libyaml-license.txt': case 'license.patch': case 'license.rst': + case 'LICENSE.rst': case 'mh-bsd-gcc': case 'pivotal.labs.license.txt': return LicenseType.unknown; diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index 5dd177acfd2b7..a8cf05f2bdf52 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -357,37 +357,68 @@ class RepositoryBlankLicenseFile extends RepositorySingleLicenseFile { License licenseOfType(LicenseType type) => null; } -class RepositoryOkHttpLicenseFile extends RepositorySingleLicenseFile { - RepositoryOkHttpLicenseFile(RepositoryDirectory parent, fs.TextFile io) +class RepositoryCatapultApiClientLicenseFile extends RepositorySingleLicenseFile { + RepositoryCatapultApiClientLicenseFile(RepositoryDirectory parent, fs.TextFile io) : super(parent, io, _parseLicense(io)); static final RegExp _pattern = new RegExp( - r'^((?:.|\n)*)\n' - r'Licensed under the Apache License, Version 2\.0 \(the "License"\);\n' - r'you may not use this file except in compliance with the License\.\n' - r'You may obtain a copy of the License at\n' - r'\n' - r' (http://www\.apache\.org/licenses/LICENSE-2\.0)\n' - r'\n' - r'Unless required by applicable law or agreed to in writing, software\n' - r'distributed under the License is distributed on an "AS IS" BASIS,\n' - r'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.\n' - r'See the License for the specific language governing permissions and\n' - r'limitations under the License\.\n*$', - caseSensitive: false + r' *Licensed under the Apache License, Version 2\.0 \(the "License"\);\n' + r' *you may not use this file except in compliance with the License\.\n' + r' *You may obtain a copy of the License at\n' + r' *\n' + r' *(http://www\.apache\.org/licenses/LICENSE-2\.0)\n' + r' *\n' + r' *Unless required by applicable law or agreed to in writing, software\n' + r' *distributed under the License is distributed on an "AS IS" BASIS,\n' + r' *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.\n' + r' *See the License for the specific language governing permissions and\n' + r' *limitations under the License\.\n', + multiLine: true, + caseSensitive: false, ); static License _parseLicense(fs.TextFile io) { final Match match = _pattern.firstMatch(io.readString()); - if (match == null || match.groupCount != 2) - throw 'unexpected okhttp license file contents'; - return new License.fromUrl(match.group(2), origin: io.fullName); + if (match == null || match.groupCount != 1) + throw 'unexpected apiclient license file contents'; + return new License.fromUrl(match.group(1), origin: io.fullName); + } + + @override + License licenseOfType(LicenseType type) { + return null; + } +} + +class RepositoryCatapultCoverageLicenseFile extends RepositorySingleLicenseFile { + RepositoryCatapultCoverageLicenseFile(RepositoryDirectory parent, fs.TextFile io) + : super(parent, io, _parseLicense(io)); + + static final RegExp _pattern = new RegExp( + r' *Except where noted otherwise, this software is licensed under the Apache\n' + r' *License, Version 2.0 \(the "License"\); you may not use this work except in\n' + r' *compliance with the License\. You may obtain a copy of the License at\n' + r' *\n' + r' *(http://www\.apache\.org/licenses/LICENSE-2\.0)\n' + r' *\n' + r' *Unless required by applicable law or agreed to in writing, software\n' + r' *distributed under the License is distributed on an "AS IS" BASIS,\n' + r' *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.\n' + r' *See the License for the specific language governing permissions and\n' + r' *limitations under the License\.\n', + multiLine: true, + caseSensitive: false, + ); + + static License _parseLicense(fs.TextFile io) { + final Match match = _pattern.firstMatch(io.readString()); + if (match == null || match.groupCount != 1) + throw 'unexpected coverage license file contents'; + return new License.fromUrl(match.group(1), origin: io.fullName); } @override License licenseOfType(LicenseType type) { - if (type == LicenseType.libpng) - return defaultLicense; return null; } } @@ -1774,17 +1805,6 @@ class RepositoryPkgWhenDirectory extends RepositoryDirectory { } } -class RepositoryOkHttpDirectory extends RepositoryDirectory { - RepositoryOkHttpDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io); - - @override - RepositoryFile createFile(fs.IoNode entry) { - if (entry.name == 'LICENSE') - return new RepositoryOkHttpLicenseFile(this, entry); - return super.createFile(entry); - } -} - class RepositorySkiaLibWebPDirectory extends RepositoryDirectory { RepositorySkiaLibWebPDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io); @@ -1902,6 +1922,8 @@ class RepositoryRootThirdPartyDirectory extends RepositoryGenericThirdPartyDirec return new RepositoryAndroidPlatformDirectory(this, entry); if (entry.name == 'boringssl') return new RepositoryBoringSSLDirectory(this, entry); + if (entry.name == 'catapult') + return new RepositoryCatapultDirectory(this, entry); if (entry.name == 'dart') return new RepositoryDartDirectory(this, entry); if (entry.name == 'expat') @@ -1922,8 +1944,6 @@ class RepositoryRootThirdPartyDirectory extends RepositoryGenericThirdPartyDirec return new RepositoryLibPngDirectory(this, entry); if (entry.name == 'libwebp') return new RepositoryLibWebpDirectory(this, entry); - if (entry.name == 'okhttp') - return new RepositoryOkHttpDirectory(this, entry); if (entry.name == 'pkg') return new RepositoryPkgDirectory(this, entry); if (entry.name == 'skia') @@ -2026,6 +2046,52 @@ class RepositoryBoringSSLDirectory extends RepositoryDirectory { } } +class RepositoryCatapultThirdPartyApiClientDirectory extends RepositoryDirectory { + RepositoryCatapultThirdPartyApiClientDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io); + + @override + RepositoryFile createFile(fs.IoNode entry) { + if (entry.name == 'LICENSE') + return new RepositoryCatapultApiClientLicenseFile(this, entry); + return super.createFile(entry); + } +} + +class RepositoryCatapultThirdPartyCoverageDirectory extends RepositoryDirectory { + RepositoryCatapultThirdPartyCoverageDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io); + + @override + RepositoryFile createFile(fs.IoNode entry) { + if (entry.name == 'NOTICE.txt') + return new RepositoryCatapultCoverageLicenseFile(this, entry); + return super.createFile(entry); + } +} + +class RepositoryCatapultThirdPartyDirectory extends RepositoryDirectory { + RepositoryCatapultThirdPartyDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io); + + @override + RepositoryDirectory createSubdirectory(fs.Directory entry) { + if (entry.name == 'apiclient') + return new RepositoryCatapultThirdPartyApiClientDirectory(this, entry); + if (entry.name == 'coverage') + return new RepositoryCatapultThirdPartyCoverageDirectory(this, entry); + return super.createSubdirectory(entry); + } +} + +class RepositoryCatapultDirectory extends RepositoryDirectory { + RepositoryCatapultDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io); + + @override + RepositoryDirectory createSubdirectory(fs.Directory entry) { + if (entry.name == 'third_party') + return new RepositoryCatapultThirdPartyDirectory(this, entry); + return super.createSubdirectory(entry); + } +} + class RepositoryDartRuntimeThirdPartyDirectory extends RepositoryGenericThirdPartyDirectory { RepositoryDartRuntimeThirdPartyDirectory(RepositoryDirectory parent, fs.Directory io) : super(parent, io); From 83a94d525d397f1a9ce698a843dbebe2c2b2537f Mon Sep 17 00:00:00 2001 From: liyuqian Date: Mon, 28 May 2018 18:51:00 -0700 Subject: [PATCH 0464/1190] Fix a typo in the comment (#5401) --- shell/gpu/gpu_surface_software.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/gpu/gpu_surface_software.cc b/shell/gpu/gpu_surface_software.cc index ea8c827b22405..9937135c3913a 100644 --- a/shell/gpu/gpu_surface_software.cc +++ b/shell/gpu/gpu_surface_software.cc @@ -59,7 +59,7 @@ std::unique_ptr GPUSurfaceSoftware::AcquireFrame( } GrContext* GPUSurfaceSoftware::GetContext() { - // The is no GrContext associated with a software surface. + // There is no GrContext associated with a software surface. return nullptr; } From d22b4897ec7edb33d26dcb1a4803085cef04622b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 29 May 2018 03:12:55 -0400 Subject: [PATCH 0465/1190] Roll src/third_party/skia 6016f77..62113cb (1 commits) (#5402) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 7f0eec15a637b..cfc7c21336bd3 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6016f77594188b25d352572c6b2f84eb2daab3b5', + 'skia_revision': '62113cb429636e4814ab77bbee64c0a7aad01f77', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 236c473f467a14a7054610cc52cde81c11c106e6 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 29 May 2018 06:38:55 -0400 Subject: [PATCH 0466/1190] Roll src/third_party/skia 62113cb..8e200f3 (1 commits) (#5403) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index cfc7c21336bd3..40ef077f0b277 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '62113cb429636e4814ab77bbee64c0a7aad01f77', + 'skia_revision': '8e200f3940ffa90de63b7fee987619eb8aa22141', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ea6d2cb507afc..452eee4b1e34f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1c0e94570eaea3f2c44ffc34fbf4ab48 +Signature: 2a95284a2efeb8bbf9a010362e6d8cc9 UNUSED LICENSES: From 5b3127da428ab507df7d2ad01a94bb54e43d3229 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 29 May 2018 10:02:53 -0400 Subject: [PATCH 0467/1190] Roll src/third_party/skia 8e200f3..1d1edc1 (2 commits) (#5404) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 40ef077f0b277..f51c381d7235c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8e200f3940ffa90de63b7fee987619eb8aa22141', + 'skia_revision': '1d1edc192ab46167e0d0bee3c9fb75170e35643e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 452eee4b1e34f..64597bd89be0b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2a95284a2efeb8bbf9a010362e6d8cc9 +Signature: 167f3c50d6e38faa2d885dfe2147eff8 UNUSED LICENSES: From 0dca520ccca332502ea658580162192cd69cab4d Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 29 May 2018 13:29:56 -0400 Subject: [PATCH 0468/1190] Roll src/third_party/skia 1d1edc1..36be574 (8 commits) (#5405) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f51c381d7235c..d9cbcd09d8562 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1d1edc192ab46167e0d0bee3c9fb75170e35643e', + 'skia_revision': '36be574e7bd5eb8bb41e2a0a15085e27b340cf4d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 64597bd89be0b..92fbdfd9f7f4c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 167f3c50d6e38faa2d885dfe2147eff8 +Signature: 8df45006ae83083c0e1a6ca3e52c6e15 UNUSED LICENSES: From 8c564ad1208efe2b0ef24cd0b4558f1673c2ebe3 Mon Sep 17 00:00:00 2001 From: Brandon Parrish Date: Tue, 29 May 2018 13:56:12 -0700 Subject: [PATCH 0469/1190] Correctly added application callback for dynamic links (#5385) * Correctly added application callback for dynamic links * Misspelling --- .../darwin/ios/framework/Headers/FlutterPlugin.h | 9 +++++++++ .../ios/framework/Source/FlutterAppDelegate.mm | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index 646ffa30d74fd..1fe71dd8b2ca1 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -146,6 +146,15 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)application:(UIApplication*)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; + +/** + Called if this plugin has been registered for `UIApplicationDelegate` callbacks. + + - Returns: `YES` if this plugin handles the request. + */ +- (BOOL)application:(UIApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler; @end /** diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index a5132bf4ee4e0..6e8d07d1839a6 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -235,6 +235,21 @@ - (void)application:(UIApplication*)application } } +- (BOOL)application:(UIApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler { + for (id plugin in _pluginDelegates) { + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + continueUserActivity:userActivity + restorationHandler:restorationHandler]) { + return YES; + } + } + } + return NO; +} + // TODO(xster): move when doing https://github.com/flutter/flutter/issues/3671. - (NSObject*)binaryMessenger { UIViewController* rootViewController = _window.rootViewController; From d37ab1cc0a7dc43a67bf08dff1c3eea8e78d008b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 29 May 2018 16:57:53 -0400 Subject: [PATCH 0470/1190] Roll src/third_party/skia 36be574..8363be1 (8 commits) (#5407) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index d9cbcd09d8562..4fb60c259f9af 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '36be574e7bd5eb8bb41e2a0a15085e27b340cf4d', + 'skia_revision': '8363be1a00b154082e6be178f37de4b8fa78dde0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 92fbdfd9f7f4c..6991131df1548 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8df45006ae83083c0e1a6ca3e52c6e15 +Signature: 7800acf839e69a9c38375b073b436ef4 UNUSED LICENSES: @@ -14513,7 +14513,7 @@ FILE: ../../../third_party/skia/src/gpu/ops/GrRegionOp.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrRegionOp.h FILE: ../../../third_party/skia/src/gpu/ops/GrShadowRRectOp.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrShadowRRectOp.h -FILE: ../../../third_party/skia/src/gpu/text/GrAtlasTextBlobVertexRegenerator.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyManager.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyManager.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyPipeline.cpp @@ -18974,12 +18974,12 @@ FILE: ../../../third_party/skia/src/gpu/ops/GrOp.h FILE: ../../../third_party/skia/src/gpu/ops/GrStencilPathOp.h FILE: ../../../third_party/skia/src/gpu/ops/GrTessellatingPathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrTessellatingPathRenderer.h -FILE: ../../../third_party/skia/src/gpu/text/GrAtlasTextBlob.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrAtlasTextBlob.h FILE: ../../../third_party/skia/src/gpu/text/GrDistanceFieldAdjustTable.cpp FILE: ../../../third_party/skia/src/gpu/text/GrDistanceFieldAdjustTable.h FILE: ../../../third_party/skia/src/gpu/text/GrGlyphCache.cpp FILE: ../../../third_party/skia/src/gpu/text/GrGlyphCache.h +FILE: ../../../third_party/skia/src/gpu/text/GrTextBlob.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrTextBlob.h FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobCache.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobCache.h FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.cpp From 8a69d7f7acc39f91bc92e731490e5aaad56fecde Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 29 May 2018 14:16:17 -0700 Subject: [PATCH 0471/1190] Add toString to WindowPadding (#5375) --- lib/ui/window.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/ui/window.dart b/lib/ui/window.dart index e84cb267940d8..d513b16c23f84 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -53,7 +53,7 @@ enum AppLifecycleState { /// in the foreground inactive state. Apps transition to this state when /// another activity is focused, such as a split-screen app, a phone call, /// a picture-in-picture app, a system dialog, or another window. - /// + /// /// Apps in this state should assume that they may be [paused] at any time. inactive, @@ -79,7 +79,7 @@ enum AppLifecycleState { /// A representation of distances for each of the four edges of a rectangle, /// used to encode the view insets and padding that applications should place /// around their user interface, as exposed by [Window.viewInsets] and -/// [Window.padding]. View insets and padding are preferrably read via +/// [Window.padding]. View insets and padding are preferably read via /// [MediaQuery.of]. /// /// For a generic class that represents distances around a rectangle, see the @@ -109,6 +109,11 @@ class WindowPadding { /// A window padding that has zeros for each edge. static const WindowPadding zero = const WindowPadding._(left: 0.0, top: 0.0, right: 0.0, bottom: 0.0); + + @override + String toString() { + return '$runtimeType(left: $left, top: $top, right: $right, bottom: $bottom)'; + } } /// An identifier used to select a user's language and formatting preferences, From 5441ee79ff992b8362617e1bdc91ff3b8ec8a962 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 29 May 2018 15:10:12 -0700 Subject: [PATCH 0472/1190] Allow embedders to specify a custom advisory URI and entrypoint. (#5408) The Fuchsia embedder wants to specify the application name in the field for the advisory URI. This allows embedders to specify whatever they want. --- common/settings.h | 6 ++++++ runtime/dart_isolate.h | 4 ++-- runtime/dart_isolate_unittests.cc | 12 +++++++++--- runtime/runtime_controller.cc | 32 +++++++++++++++++++++---------- runtime/runtime_controller.h | 8 +++++++- shell/common/engine.cc | 16 +++++++++------- 6 files changed, 55 insertions(+), 23 deletions(-) diff --git a/common/settings.h b/common/settings.h index 7e55bf8e55d04..547673529ee1e 100644 --- a/common/settings.h +++ b/common/settings.h @@ -48,6 +48,12 @@ struct Settings { bool endless_trace_buffer = false; bool enable_dart_profiling = false; bool dart_non_checked_mode = false; + // Used as the script URI in debug messages. Does not affect how the Dart code + // is executed. + std::string advisory_script_uri = "main.dart"; + // Used as the script entrypoint in debug messages. Does not affect how the + // Dart code is executed. + std::string advisory_script_entrypoint = "main"; // Observatory settings bool enable_observatory = false; diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index 16b7f37641959..e8219469034f7 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -46,8 +46,8 @@ class DartIsolate : public UIDartState { std::unique_ptr window, fml::WeakPtr resource_context, fxl::RefPtr unref_queue, - std::string advisory_script_uri = "main.dart", - std::string advisory_script_entrypoint = "main", + std::string advisory_script_uri, + std::string advisory_script_entrypoint, Dart_IsolateFlags* flags = nullptr); DartIsolate(const DartVM* vm, diff --git a/runtime/dart_isolate_unittests.cc b/runtime/dart_isolate_unittests.cc index ba808e5b74f01..c367484f4f48e 100644 --- a/runtime/dart_isolate_unittests.cc +++ b/runtime/dart_isolate_unittests.cc @@ -36,7 +36,9 @@ TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) { std::move(task_runners), // task runners nullptr, // window {}, // resource context - nullptr // unref qeueue + nullptr, // unref qeueue + "main.dart", // advisory uri + "main" // advisory entrypoint ); ASSERT_TRUE(root_isolate); ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); @@ -62,7 +64,9 @@ TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) { std::move(task_runners), // task runners nullptr, // window {}, // resource context - nullptr // unref qeueue + nullptr, // unref qeueue + "main.dart", // advisory uri + "main" // advisory entrypoint ); ASSERT_TRUE(root_isolate); ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); @@ -91,7 +95,9 @@ TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) { std::move(task_runners), // task runners nullptr, // window {}, // resource context - nullptr // unref qeueue + nullptr, // unref qeueue + "main.dart", // advisory uri + "main" // advisory entrypoint ); ASSERT_TRUE(root_isolate); ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 56ba08314b13b..4b4c2cdf30aad 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -25,7 +25,9 @@ RuntimeController::RuntimeController( fxl::RefPtr p_shared_snapshot, TaskRunners p_task_runners, fml::WeakPtr p_resource_context, - fxl::RefPtr p_unref_queue) + fxl::RefPtr p_unref_queue, + std::string p_advisory_script_uri, + std::string p_advisory_script_entrypoint) : RuntimeController(p_client, p_vm, std::move(p_isolate_snapshot), @@ -33,6 +35,8 @@ RuntimeController::RuntimeController( std::move(p_task_runners), std::move(p_resource_context), std::move(p_unref_queue), + std::move(p_advisory_script_uri), + std::move(p_advisory_script_entrypoint), WindowData{/* default window data */}) {} RuntimeController::RuntimeController( @@ -43,6 +47,8 @@ RuntimeController::RuntimeController( TaskRunners p_task_runners, fml::WeakPtr p_resource_context, fxl::RefPtr p_unref_queue, + std::string p_advisory_script_uri, + std::string p_advisory_script_entrypoint, WindowData p_window_data) : client_(p_client), vm_(p_vm), @@ -51,6 +57,8 @@ RuntimeController::RuntimeController( task_runners_(p_task_runners), resource_context_(p_resource_context), unref_queue_(p_unref_queue), + advisory_script_uri_(p_advisory_script_uri), + advisory_script_entrypoint_(p_advisory_script_entrypoint), window_data_(std::move(p_window_data)), root_isolate_( DartIsolate::CreateRootIsolate(vm_, @@ -59,7 +67,9 @@ RuntimeController::RuntimeController( task_runners_, std::make_unique(this), resource_context_, - unref_queue_)) { + unref_queue_, + p_advisory_script_uri, + p_advisory_script_entrypoint)) { root_isolate_->SetReturnCodeCallback([this](uint32_t code) { root_isolate_return_code_ = {true, code}; }); @@ -96,14 +106,16 @@ bool RuntimeController::IsRootIsolateRunning() const { std::unique_ptr RuntimeController::Clone() const { return std::unique_ptr(new RuntimeController( - client_, // - vm_, // - isolate_snapshot_, // - shared_snapshot_, // - task_runners_, // - resource_context_, // - unref_queue_, // - window_data_ // + client_, // + vm_, // + isolate_snapshot_, // + shared_snapshot_, // + task_runners_, // + resource_context_, // + unref_queue_, // + advisory_script_uri_, // + advisory_script_entrypoint_, // + window_data_ // )); } diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index a9d32484da1ab..746845a7c0fba 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -29,7 +29,9 @@ class RuntimeController final : public WindowClient { fxl::RefPtr shared_snapshot, TaskRunners task_runners, fml::WeakPtr resource_context, - fxl::RefPtr unref_queue); + fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint); ~RuntimeController(); @@ -86,6 +88,8 @@ class RuntimeController final : public WindowClient { TaskRunners task_runners_; fml::WeakPtr resource_context_; fxl::RefPtr unref_queue_; + std::string advisory_script_uri_; + std::string advisory_script_entrypoint_; WindowData window_data_; fml::WeakPtr root_isolate_; std::pair root_isolate_return_code_ = {false, 0}; @@ -97,6 +101,8 @@ class RuntimeController final : public WindowClient { TaskRunners task_runners, fml::WeakPtr resource_context, fxl::RefPtr unref_queue, + std::string advisory_script_uri, + std::string advisory_script_entrypoint, WindowData data); Window* GetWindowIfAvailable(); diff --git a/shell/common/engine.cc b/shell/common/engine.cc index b15a3bc31c189..0eea25f8de8e0 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -55,13 +55,15 @@ Engine::Engine(Delegate& delegate, // object as its delegate. The delegate may be called in the constructor and // we want to be fully initilazed by that point. runtime_controller_ = std::make_unique( - *this, // runtime delegate - &vm, // VM - std::move(isolate_snapshot), // isolate snapshot - std::move(shared_snapshot), // shared snapshot - std::move(task_runners), // task runners - std::move(resource_context), // resource context - std::move(unref_queue) // skia unref queue + *this, // runtime delegate + &vm, // VM + std::move(isolate_snapshot), // isolate snapshot + std::move(shared_snapshot), // shared snapshot + std::move(task_runners), // task runners + std::move(resource_context), // resource context + std::move(unref_queue), // skia unref queue + settings_.advisory_script_uri, // advisory script uri + settings_.advisory_script_entrypoint // advisory script entrypoint ); } From 16f5cd8106c75e980a4d0bb05c0505a0e1182eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Crelier?= Date: Tue, 29 May 2018 16:00:18 -0700 Subject: [PATCH 0473/1190] Roll Dart to ff815d05a52c03a318bff51ba4529ff5210b7bd6 (#5409) ``` ff815d05a5 [release] Prepare changelog for 2.0.0-dev.59.0 17afa8ef56 Give private parameters public names for constructor. 7b33203f8e Fixes to make hackernews run strong mode clean 718e1578a0 Update Analyzer AstBuilder to optionally parse function bodies 1ca17b6d03 [vm/kernel] Recognize desugared mixin applications in dart:mirrors 8b0c1f8044 Fix AstRewriteVisitor to set elements/types for instance creation nodes. 84fcf42c25 Bump analyzer version in preparation for publishing. 96dd9d49db Update Analyzer tests to pass NonExistingSource rather than null 736ddd9b0e [Observatory] Refactor observatory build to prepare for Fuchsia prebuilt b7336ab443 Improve field type argument recovery 6bc7288e70 Fix fused UTF-8/JSON decoding. 2a3d1dc9ed [vm] Prepare status for app_jitk builders (#33126) 40f61d6b0b Handle Windows line ending in generate_messages_test 7dc4fbf5a2 [fasta] Add support for annotations on enum values 2514a67614 Import link.dart directly 990c85276b Avoid allocation and bottom-type on Link 58dc4e476d Revert "[vm] Support definition of entry-points via @pragma('vm.extern') annotations." e20189ecf5 Adjusted the instantiate-to-bound algorithm to break cycles at every member, not just one. 3e50ea32b5 [vm] Support definition of entry-points via @pragma('vm.extern') annotations. e2597dfba7 Revert "Mark normal classes that were originally mixin applications" d28c5499fc [infra] Add support for app_jitk compiler to test.py (#33126) 640791c922 Add example to docs/language/informal/super-bounded-types.md. 53cd0b4af1 Mark normal classes that were originally mixin applications 6b7f3d5f54 Share non-generic signatures through init.types b79e06630c Add a recovery test ``` * modified signature in travis/licenses_golden/licenses_third_party --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4fb60c259f9af..362e43cc8da7a 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'f981f097602ca434ce0a36b1f704723cad105fb6', + 'dart_revision': 'ff815d05a52c03a318bff51ba4529ff5210b7bd6', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 6991131df1548..df985092ad605 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7800acf839e69a9c38375b073b436ef4 +Signature: 31d089189c09b6be4e8cd538f4aac979 UNUSED LICENSES: From a4f0cd7acaa9682defcdb4a6594caaea75e9775e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 29 May 2018 20:22:53 -0400 Subject: [PATCH 0474/1190] Roll src/third_party/skia 8363be1..61f36d3 (8 commits) (#5411) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 362e43cc8da7a..864224e6c31a2 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8363be1a00b154082e6be178f37de4b8fa78dde0', + 'skia_revision': '61f36d3225c72dfb4690245035d16f8c356ebf17', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index df985092ad605..431a091bca5dc 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 31d089189c09b6be4e8cd538f4aac979 +Signature: 3a7e44e0c3f364c0394fe6a1fc749c39 UNUSED LICENSES: From 0a47817ea77db4548c1c2b7e2ef669df50efeec4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 29 May 2018 23:51:53 -0400 Subject: [PATCH 0475/1190] Roll src/third_party/skia 61f36d3..09725b0 (1 commits) (#5412) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 864224e6c31a2..b48ed9723f77b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '61f36d3225c72dfb4690245035d16f8c356ebf17', + 'skia_revision': '09725b0c3fd52b008743c63feb09ec1ab8bc2eea', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 431a091bca5dc..8b99e7dcff5dd 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 3a7e44e0c3f364c0394fe6a1fc749c39 +Signature: 7ac78318eb25ae1509304393f0205070 UNUSED LICENSES: From abda89cbbb604a4632bd7c8c474035630ff83e67 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 30 May 2018 03:19:53 -0400 Subject: [PATCH 0476/1190] Roll src/third_party/skia 09725b0..264182c (1 commits) (#5413) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b48ed9723f77b..6198542b6c238 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '09725b0c3fd52b008743c63feb09ec1ab8bc2eea', + 'skia_revision': '264182c3f7d282e57a4b1d46fde3ef702b81c5c3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8b99e7dcff5dd..84c61e4e91452 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7ac78318eb25ae1509304393f0205070 +Signature: a078f54fe324409623b193b1a5595944 UNUSED LICENSES: @@ -14364,6 +14364,9 @@ FILE: ../../../third_party/skia/include/private/SkLeanWindows.h FILE: ../../../third_party/skia/include/private/SkSafe_math.h FILE: ../../../third_party/skia/include/utils/SkNoDrawCanvas.h FILE: ../../../third_party/skia/modules/sksg/samples/SampleSVGPong.cpp +FILE: ../../../third_party/skia/modules/skshaper/include/SkShaper.h +FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_harfbuzz.cpp +FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_primitive.cpp FILE: ../../../third_party/skia/samplecode/DecodeFile.h FILE: ../../../third_party/skia/samplecode/SampleAndroidShadows.cpp FILE: ../../../third_party/skia/samplecode/SampleCode.cpp From dfb437ada2a474bca231a68ed8fd2fe385eb8f90 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 30 May 2018 06:44:53 -0400 Subject: [PATCH 0477/1190] Roll src/third_party/skia 264182c..21ca043 (3 commits) (#5414) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 6198542b6c238..3e3744b6de0f4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '264182c3f7d282e57a4b1d46fde3ef702b81c5c3', + 'skia_revision': '21ca04348bfcc7c9fed519060199ac0f7fc57e2f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 84c61e4e91452..b544820ec13b0 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a078f54fe324409623b193b1a5595944 +Signature: 463f83117c305ebf9d998ed31b35785f UNUSED LICENSES: From 15be13d9fe99be62fc6236a759e6b55ebd934f2c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 30 May 2018 10:10:53 -0400 Subject: [PATCH 0478/1190] Roll src/third_party/skia 21ca043..137b874 (5 commits) (#5416) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 11338 ------------------ travis/licenses_golden/licenses_third_party | 34 +- 3 files changed, 33 insertions(+), 11341 deletions(-) diff --git a/DEPS b/DEPS index 3e3744b6de0f4..0e7a4e5a2ac2d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '21ca04348bfcc7c9fed519060199ac0f7fc57e2f', + 'skia_revision': '137b87485508e3882968a10559c2cb389dcc93c5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 88aa77d410c23..e69de29bb2d1d 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -1,11338 +0,0 @@ -boringssl - -Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) -All rights reserved. - -This package is an SSL implementation written -by Eric Young (eay@cryptsoft.com). -The implementation was written so as to conform with Netscapes SSL. - -This library is free for commercial and non-commercial use as long as -the following conditions are aheared to. The following conditions -apply to all code found in this distribution, be it the RC4, RSA, -lhash, DES, etc., code; not just the SSL code. The SSL documentation -included with this distribution is covered by the same copyright terms -except that the holder is Tim Hudson (tjh@cryptsoft.com). - -Copyright remains Eric Young's, and as such any Copyright notices in -the code are not to be removed. -If this package is used in a product, Eric Young should be given attribution -as the author of the parts of the library used. -This can be in the form of a textual message at program startup or -in documentation (online or textual) provided with the package. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - "This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)" - The word 'cryptographic' can be left out if the rouines from the library - being used are not cryptographic related :-). -4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an acknowledgement: - "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -The licence and distribution terms for any publically available version or -derivative of this code cannot be changed. i.e. this code cannot simply be -copied and put under another distribution licence -[including the GNU Public Licence.] --------------------------------------------------------------------------------- -boringssl - -Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -All rights reserved. - -This package is an SSL implementation written -by Eric Young (eay@cryptsoft.com). -The implementation was written so as to conform with Netscapes SSL. - -This library is free for commercial and non-commercial use as long as -the following conditions are aheared to. The following conditions -apply to all code found in this distribution, be it the RC4, RSA, -lhash, DES, etc., code; not just the SSL code. The SSL documentation -included with this distribution is covered by the same copyright terms -except that the holder is Tim Hudson (tjh@cryptsoft.com). - -Copyright remains Eric Young's, and as such any Copyright notices in -the code are not to be removed. -If this package is used in a product, Eric Young should be given attribution -as the author of the parts of the library used. -This can be in the form of a textual message at program startup or -in documentation (online or textual) provided with the package. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - "This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)" - The word 'cryptographic' can be left out if the rouines from the library - being used are not cryptographic related :-). -4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an acknowledgement: - "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -The licence and distribution terms for any publically available version or -derivative of this code cannot be changed. i.e. this code cannot simply be -copied and put under another distribution licence -[including the GNU Public Licence.] --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2001 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2004 Kungliga Tekniska Högskolan -(Royal Institute of Technology, Stockholm, Sweden). -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -3. Neither the name of the Institute nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2004 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2006 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2006,2007 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2008 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2010 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2012 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2013 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2014 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - "This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)" - The word 'cryptographic' can be left out if the rouines from the library - being used are not cryptographic related :-). -4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an acknowledgement: - "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -The licence and distribution terms for any publically available version or -derivative of this code cannot be changed. i.e. this code cannot simply be -copied and put under another distribution licence -[including the GNU Public Licence.] --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2014, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015, Intel Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2016, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2017, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2018, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2003 Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2005 Nokia. All rights reserved. - -The portions of the attached software ("Contribution") is developed by -Nokia Corporation and is licensed pursuant to the OpenSSL open source -license. - -The Contribution, originally written by Mika Kousa and Pasi Eronen of -Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites -support (see RFC 4279) to OpenSSL. - -No patent licenses or other rights except those expressly stated in -the OpenSSL open source license shall be deemed granted or received -expressly, by implication, estoppel, or otherwise. - -No assurances are provided by Nokia that the Contribution does not -infringe the patent or other intellectual property rights of any third -party or that the license provides you with all the necessary rights -to make use of the Contribution. - -THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN -ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA -SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY -OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR -OTHERWISE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2006, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2007, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2008 Google Inc. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009 Google Inc. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2012, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2014, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2015, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2016 Brian Smith. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -The MIT License (MIT) - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl -dart - -OpenSSL License - - ==================================================================== - Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - - 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - - 5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - - THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - ==================================================================== - - This product includes cryptographic software written by Eric Young - (eay@cryptsoft.com). This product includes software written by Tim - Hudson (tjh@cryptsoft.com). - -Original SSLeay License - -* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -* All rights reserved. - -* This package is an SSL implementation written -* by Eric Young (eay@cryptsoft.com). -* The implementation was written so as to conform with Netscapes SSL. - -* This library is free for commercial and non-commercial use as long as -* the following conditions are aheared to. The following conditions -* apply to all code found in this distribution, be it the RC4, RSA, -* lhash, DES, etc., code; not just the SSL code. The SSL documentation -* included with this distribution is covered by the same copyright terms -* except that the holder is Tim Hudson (tjh@cryptsoft.com). - -* Copyright remains Eric Young's, and as such any Copyright notices in -* the code are not to be removed. -* If this package is used in a product, Eric Young should be given attribution -* as the author of the parts of the library used. -* This can be in the form of a textual message at program startup or -* in documentation (online or textual) provided with the package. - -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the copyright -* notice, this list of conditions and the following disclaimer. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* 3. All advertising materials mentioning features or use of this software -* must display the following acknowledgement: -* "This product includes cryptographic software written by -* Eric Young (eay@cryptsoft.com)" -* The word 'cryptographic' can be left out if the rouines from the library -* being used are not cryptographic related :-). -* 4. If you include any Windows specific code (or a derivative thereof) from -* the apps directory (application code) you must include an acknowledgement: -* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGE. - -* The licence and distribution terms for any publically available version or -* derivative of this code cannot be changed. i.e. this code cannot simply be -* copied and put under another distribution licence -* [including the GNU Public Licence.] - -ISC license used for completely new code in BoringSSL: - -/* Copyright (c) 2015, Google Inc. - - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -The code in third_party/fiat carries the MIT license: - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Licenses for support code - -Parts of the TLS test suite are under the Go license. This code is not included -in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so -distributing code linked against BoringSSL does not trigger this license: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -observatory_pub_packages -skia -txt -vulkan - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. --------------------------------------------------------------------------------- -colorama - -Copyright (c) 2010 Jonathan Hartley -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holders, nor those of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2003-2005 Tom Wu -Copyright (c) 2012 Adam Singer (adam@solvr.io) -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, -INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF -THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -In addition, the following condition applies: - -All redistributions must retain an intact copy of this copyright notice -and disclaimer. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright 2009 The Go 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 - -Copyright 2012, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -double-conversion - -Copyright 2006-2008 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -double-conversion - -Copyright 2010 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -double-conversion - -Copyright 2012 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2013 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright 2017 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright 2018 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet - -Copyright 2013 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -icu -skia -topaz - -Copyright 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -icu -topaz - -Copyright 2014 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2016 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2017 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz -txt - -Copyright 2017 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -icu -skia -topaz - -Copyright 2016 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -skia -topaz - -Copyright 2018 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -files - -Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -files - -Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -files - -Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - and Clark Cooper -Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -files - -Copyright 2000, Clark Cooper -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 1995-2002 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 1995-2002 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2001, 2002 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2001, 2002, 2003, 2004 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2001-2008, 2011, 2013, 2014 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 1990, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000 Computing Research Labs, New Mexico State University -Copyright 2001-2004, 2011 Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000 Computing Research Labs, New Mexico State University -Copyright 2001-2014 - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000, 2001, 2004 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000-2001, 2002 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000-2001, 2003 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000-2010, 2012-2014 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2001, 2002, 2012 Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2003 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -The FreeType Project LICENSE - - 2006-Jan-27 - -Copyright 1996-2002, 2006 by -David Turner, Robert Wilhelm, and Werner Lemberg - -Introduction -============ - - The FreeType Project is distributed in several archive packages; - some of them may contain, in addition to the FreeType font engine, - various tools and contributions which rely on, or relate to, the - FreeType Project. - - This license applies to all files found in such packages, and - which do not fall under their own explicit license. The license - affects thus the FreeType font engine, the test programs, - documentation and makefiles, at the very least. - - This license was inspired by the BSD, Artistic, and IJG - (Independent JPEG Group) licenses, which all encourage inclusion - and use of free software in commercial and freeware products - alike. As a consequence, its main points are that: - - o We don't promise that this software works. However, we will be - interested in any kind of bug reports. (`as is' distribution) - - o You can use this software for whatever you want, in parts or - full form, without having to pay us. (`royalty-free' usage) - - o You may not pretend that you wrote this software. If you use - it, or only parts of it, in a program, you must acknowledge - somewhere in your documentation that you have used the - FreeType code. (`credits') - - We specifically permit and encourage the inclusion of this - software, with or without modifications, in commercial products. - We disclaim all warranties covering The FreeType Project and - assume no liability related to The FreeType Project. - - Finally, many people asked us for a preferred form for a - credit/disclaimer to use in compliance with this license. We thus - encourage you to use the following text: - - Portions of this software are copyright © The FreeType - Project (www.freetype.org). All rights reserved. - - Please replace with the value from the FreeType version you - actually use. - -Legal Terms -=========== - -0. Definitions - - Throughout this license, the terms `package', `FreeType Project', - and `FreeType archive' refer to the set of files originally - distributed by the authors (David Turner, Robert Wilhelm, and - Werner Lemberg) as the `FreeType Project', be they named as alpha, - beta or final release. - - `You' refers to the licensee, or person using the project, where - `using' is a generic term including compiling the project's source - code as well as linking it to form a `program' or `executable'. - This program is referred to as `a program using the FreeType - engine'. - - This license applies to all files distributed in the original - FreeType Project, including all source code, binaries and - documentation, unless otherwise stated in the file in its - original, unmodified form as distributed in the original archive. - If you are unsure whether or not a particular file is covered by - this license, you must contact us to verify this. - - The FreeType Project is copyright (C) 1996-2000 by David Turner, - Robert Wilhelm, and Werner Lemberg. All rights reserved except as - specified below. - -1. No Warranty - - THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO - USE, OF THE FREETYPE PROJECT. - -2. Redistribution - - This license grants a worldwide, royalty-free, perpetual and - irrevocable right and license to use, execute, perform, compile, - display, copy, create derivative works of, distribute and - sublicense the FreeType Project (in both source and object code - forms) and derivative works thereof for any purpose; and to - authorize others to exercise some or all of the rights granted - herein, subject to the following conditions: - - o Redistribution of source code must retain this license file - (`FTL.TXT') unaltered; any additions, deletions or changes to - the original files must be clearly indicated in accompanying - documentation. The copyright notices of the unaltered, - original files must be preserved in all copies of source - files. - - o Redistribution in binary form must provide a disclaimer that - states that the software is based in part of the work of the - FreeType Team, in the distribution documentation. We also - encourage you to put an URL to the FreeType web page in your - documentation, though this isn't mandatory. - - These conditions apply to any software derived from or based on - the FreeType Project, not just the unmodified files. If you use - our work, you must acknowledge us. However, no fee need be paid - to us. - -3. Advertising - - Neither the FreeType authors and contributors nor you shall use - the name of the other for commercial, advertising, or promotional - purposes without specific prior written permission. - - We suggest, but do not require, that you use one or more of the - following phrases to refer to this software in your documentation - or advertising materials: `FreeType Project', `FreeType Engine', - `FreeType library', or `FreeType Distribution'. - - As you have not signed this license, you are not required to - accept it. However, as the FreeType Project is copyrighted - material, only this license, or another one contracted with the - authors, grants you the right to use, distribute, and modify it. - Therefore, by using, distributing, or modifying the FreeType - Project, you indicate that you understand and accept all the terms - of this license. - -4. Contacts - - There are two mailing lists related to FreeType: - - o freetype@nongnu.org - - Discusses general use and applications of FreeType, as well as - future and wanted additions to the library and distribution. - If you are looking for support, start in this list if you - haven't found anything to help you in the documentation. - - o freetype-devel@nongnu.org - - Discusses bugs, as well as engine internals, design issues, - specific licenses, porting, etc. - - Our home page can be found at - - http://www.freetype.org - ---- end of FTL.TXT --- --------------------------------------------------------------------------------- -garnet - -Copyright 2013 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet - -Copyright 2014 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet - -Copyright 2017 The Fuchsia Authors.All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet -topaz - -Copyright 2015 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet -topaz - -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -gif - -GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! --------------------------------------------------------------------------------- -gif - -The Graphics Interchange Format(c) is the copyright property of CompuServe -Incorporated. Only CompuServe Incorporated is authorized to define, redefine, -enhance, alter, modify or change in any way the definition of the format. - -CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free -license for the use of the Graphics Interchange Format(sm) in computer -software; computer software utilizing GIF(sm) must acknowledge ownership of the -Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in -User and Technical Documentation. Computer software utilizing GIF, which is -distributed or may be distributed without User or Technical Documentation must -display to the screen or printer a message acknowledging ownership of the -Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in -this case, the acknowledgement may be displayed in an opening screen or leading -banner, or a closing screen or trailing banner. A message such as the following -may be used: - - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 1998-2004 David Turner and Werner Lemberg -Copyright © 2004,2007,2009 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 1998-2004 David Turner and Werner Lemberg -Copyright © 2004,2007,2009,2010 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 1998-2004 David Turner and Werner Lemberg -Copyright © 2006 Behdad Esfahbod -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007 Chris Wilson -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2010,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009,2010 Red Hat, Inc. -Copyright © 2010,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009,2010 Red Hat, Inc. -Copyright © 2010,2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009,2010 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2009 Keith Stribley -Copyright © 2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2011 Codethink Limited -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2011 Codethink Limited -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2010,2011,2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2010,2011,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2011,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2012,2014 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2014 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012 Mozilla Foundation. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012,2013 Mozilla Foundation. -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2013 Red Hat, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2014 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2015 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2015 Mozilla Foundation. -Copyright © 2015 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2016 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2016 Igalia S.L. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2017 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. -For parts of HarfBuzz that are licensed under different licenses see individual -files names COPYING in subdirectories where applicable. - -Copyright © 2010,2011,2012 Google, Inc. -Copyright © 2012 Mozilla Foundation -Copyright © 2011 Codethink Limited -Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) -Copyright © 2009 Keith Stribley -Copyright © 2009 Martin Hosken and SIL International -Copyright © 2007 Chris Wilson -Copyright © 2006 Behdad Esfahbod -Copyright © 2005 David Turner -Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. -Copyright © 1998-2004 David Turner and Werner Lemberg - -For full copyright notices consult the individual files in the package. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1995-2016 International Business Machines Corporation and others -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. - -All trademarks and registered trademarks mentioned herein are the -property of their respective owners. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1998 - 1999 Unicode, Inc. All Rights reserved. - Copyright (C) 2002-2005, International Business Machines - Corporation and others. All Rights Reserved. - -This file is provided as-is by Unicode, Inc. (The Unicode Consortium). -No claims are made as to fitness for any particular purpose. No -warranties of any kind are expressed or implied. The recipient -agrees to determine applicability of information provided. If this -file has been provided on optical media by Unicode, Inc., the sole -remedy for any claim will be exchange of defective media within 90 -days of receipt. - -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form for -internal or external distribution as long as this notice remains -attached. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1999 Computer Systems and Communication Lab, - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1999 Unicode, Inc. All Rights reserved. - Copyright (C) 2002-2005, International Business Machines - Corporation and others. All Rights Reserved. - -This file is provided as-is by Unicode, Inc. (The Unicode Consortium). -No claims are made as to fitness for any particular purpose. No -warranties of any kind are expressed or implied. The recipient -agrees to determine applicability of information provided. If this -file has been provided on optical media by Unicode, Inc., the sole -remedy for any claim will be exchange of defective media within 90 -days of receipt. - -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form for -internal or external distribution as long as this notice remains -attached. --------------------------------------------------------------------------------- -icu - -Copyright (c) 2002 Unicode, Inc. All Rights reserved. - Copyright (C) 2002-2005, International Business Machines - Corporation and others. All Rights Reserved. - -This file is provided as-is by Unicode, Inc. (The Unicode Consortium). -No claims are made as to fitness for any particular purpose. No -warranties of any kind are expressed or implied. The recipient -agrees to determine applicability of information provided. If this -file has been provided on optical media by Unicode, Inc., the sole -remedy for any claim will be exchange of defective media within 90 -days of receipt. - -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form for -internal or external distribution as long as this notice remains -attached. --------------------------------------------------------------------------------- -icu - -Copyright (c) 2013 International Business Machines Corporation -and others. All Rights Reserved. - -Project: http://code.google.com/p/lao-dictionary -Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt -License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt - (copied below) - - This file is derived from the above dictionary, with slight - modifications. - - Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, - are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. Redistributions in - binary form must reproduce the above copyright notice, this list of - conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) 2014 International Business Machines Corporation -and others. All Rights Reserved. - -This list is part of a project hosted at: - github.com/kanyawtech/myanmar-karen-word-lists - -Copyright (c) 2013, LeRoy Benjamin Sharon -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: Redistributions of source code must retain the above -copyright notice, this list of conditions and the following -disclaimer. Redistributions in binary form must reproduce the -above copyright notice, this list of conditions and the following -disclaimer in the documentation and/or other materials provided -with the distribution. - - Neither the name Myanmar Karen Word Lists, nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2010. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2011. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2012. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2014. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2016. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright 1996 Chih-Hao Tsai @ Beckman Institute, - University of Illinois -c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 --------------------------------------------------------------------------------- -icu - -Copyright 2000, 2001, 2002, 2003 Nara Institute of Science -and Technology. All Rights Reserved. - -Use, reproduction, and distribution of this software is permitted. -Any copy of this software, whether in its original form or modified, -must include both the above copyright notice and the following -paragraphs. - -Nara Institute of Science and Technology (NAIST), -the copyright holders, disclaims all warranties with regard to this -software, including all implied warranties of merchantability and -fitness, in no event shall NAIST be liable for -any special, indirect or consequential damages or any damages -whatsoever resulting from loss of use, data or profits, whether in an -action of contract, negligence or other tortuous action, arising out -of or in connection with the use or performance of this software. - -A large portion of the dictionary entries -originate from ICOT Free Software. The following conditions for ICOT -Free Software applies to the current dictionary as well. - -Each User may also freely distribute the Program, whether in its -original form or modified, to any third party or parties, PROVIDED -that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear -on, or be attached to, the Program, which is distributed substantially -in the same form as set out herein and that such intended -distribution, if actually made, will neither violate or otherwise -contravene any of the laws and regulations of the countries having -jurisdiction over the User or the intended distribution itself. - -NO WARRANTY - -The program was produced on an experimental basis in the course of the -research and development conducted during the project and is provided -to users as so produced on an experimental basis. Accordingly, the -program is provided without any warranty whatsoever, whether express, -implied, statutory or otherwise. The term "warranty" used herein -includes, but is not limited to, any warranty of the quality, -performance, merchantability and fitness for a particular purpose of -the program and the nonexistence of any infringement or violation of -any right of any third party. - -Each user of the program will agree and understand, and be deemed to -have agreed and understood, that there is no warranty whatsoever for -the program and, accordingly, the entire risk arising from or -otherwise connected with the program is assumed by the user. - -Therefore, neither ICOT, the copyright holder, or any other -organization that participated in or was otherwise related to the -development of the program and their respective officials, directors, -officers and other employees shall be held liable for any and all -damages, including, without limitation, general, special, incidental -and consequential damages, arising out of or otherwise in connection -with the use or inability to use the program or any product, material -or result produced or otherwise obtained by using the program, -regardless of whether they have been advised of, or otherwise had -knowledge of, the possibility of such damages at any time during the -project or thereafter. Each user will be deemed to have agreed to the -foregoing by his or her commencement of use of the program. The term -"use" as used herein includes, but is not limited to, the use, -modification, copying and distribution of the program and the -production of secondary products from the program. - -In the case where the program, whether in its original form or -modified, was distributed or delivered to or received by a user from -any person, organization or entity other than ICOT, unless it makes or -grants independently of ICOT any specific warranty to the user in -writing, such person, organization or entity, will also be exempted -from and not be held liable to the user for any such damages as noted -above as far as the program is concerned. --------------------------------------------------------------------------------- -icu - -Copyright © 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. --------------------------------------------------------------------------------- -icu - -Copyrighy (c) 1999 TaBE Project. -Copyright (c) 1999 Pai-Hsiang Hsiao. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the TaBE Project nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -ICU License - ICU 1.8.1 and later - -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1995-2009 International Business Machines Corporation and others - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. --------------------------------------------------------------------------------- -icu - -The BSD License -http://opensource.org/licenses/bsd-license.php -Copyright (C) 2006-2008, Google Inc. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following -disclaimer in the documentation and/or other materials provided with -the distribution. - Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Unicode® Terms of Use -For the general privacy policy governing access to this site, see the Unicode Privacy Policy. For trademark usage, see the Unicode® Consortium Name and Trademark Usage Policy. - -A. Unicode Copyright. -1. Copyright © 1991-2017 Unicode, Inc. All rights reserved. -2. Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. -3. Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files solely for informational purposes and in the creation of products supporting the Unicode Standard, subject to the Terms and Conditions herein. -4. Further specifications of rights and restrictions pertaining to the use of the particular set of data files known as the "Unicode Character Database" can be found in the License. -5. Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. The online code charts carry specific restrictions. All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. -6. No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. -7. Modification is not permitted with respect to this document. All copies of this document must be verbatim. -B. Restricted Rights Legend. Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. -C. Warranties and Disclaimers. -1. This publication and/or website may include technical or typographical errors or other inaccuracies . Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. -2. If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. -3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. -D. Waiver of Damages. In no event shall Unicode or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. -E. Trademarks & Logos. -1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. -2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. -3. All third party trademarks referenced herein are the property of their respective owners. -F. Miscellaneous. -1. Jurisdiction and Venue. This server is operated from a location in the State of California, United States of America. Unicode makes no representation that the materials are appropriate for use in other locations. If you access this server from other locations, you are responsible for compliance with local laws. This Agreement, all use of this site and any claims and damages resulting from use of this site are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this site shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. -2. Modification by Unicode Unicode shall have the right to modify this Agreement at any time by posting it to this site. The user may not assign any part of this Agreement without Unicode’s prior written consent. -3. Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. -4. Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. -5. Entire Agreement. This Agreement constitutes the entire agreement between the parties. - -EXHIBIT 1 -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - -Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and -http://www.unicode.org/utility/trac/browser/. - -Unicode Data Files do not include PDF online code charts under the -directory http://www.unicode.org/Public/. - -Software includes any source code published in the Unicode Standard -or under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and -http://www.unicode.org/utility/trac/browser/. - -NOTICE TO USER: Carefully read the following legal agreement. -BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S -DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), -YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE -TERMS AND CONDITIONS OF THIS AGREEMENT. -IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE -THE DATA FILES OR SOFTWARE. - -COPYRIGHT AND PERMISSION NOTICE - -Copyright © 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009-2011, 2014-2016, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). -All Rights Reserved. -Author: Siarhei Siamashka -Copyright (C) 2013-2014, Linaro Limited. All Rights Reserved. -Author: Ragesh Radhakrishnan -Copyright (C) 2014-2016, D. R. Commander. All Rights Reserved. -Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. -Copyright (C) 2016, Siarhei Siamashka. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). -All Rights Reserved. -Author: Siarhei Siamashka -Copyright (C) 2014, Siarhei Siamashka. All Rights Reserved. -Copyright (C) 2014, Linaro Limited. All Rights Reserved. -Copyright (C) 2015, D. R. Commander. All Rights Reserved. -Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2011, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2013, MIPS Technologies, Inc., California. -All Rights Reserved. -Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) - Darko Laus (darko.laus@imgtec.com) -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2013-2014, MIPS Technologies, Inc., California. -All Rights Reserved. -Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) - Darko Laus (darko.laus@imgtec.com) -Copyright (C) 2015, D. R. Commander. All Rights Reserved. -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2014, D. R. Commander. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. -Copyright (C) 2014, Jay Foad. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2015, D. R. Commander. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2009-2014 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2009-2015 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2009-2016 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2011 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2011, 2015 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2011-2016 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. -Copyright (C) 2015-2016, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014, 2016, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014, D. R. Commander. -Copyright (C) 2013-2014, MIPS Technologies, Inc., California. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014-2015, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2010, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library - version 1.02 - -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2011, 2014, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2011, 2014-2016, D. R. Commander. -Copyright (C) 2013-2014, MIPS Technologies, Inc., California. -Copyright (C) 2014, Linaro Limited. -Copyright (C) 2015-2016, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2011, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009, 2012 Pierre Ossman for Cendio AB -Copyright (C) 2009, 2012, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009, 2012 Pierre Ossman for Cendio AB -Copyright (C) 2012, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project -to include only information relevant to libjpeg-turbo, to wordsmith certain -sections, and to remove impolitic language that existed in the libjpeg v8 -README. It is included only for reference. Please see README.md for -information specific to libjpeg-turbo. - -The Independent JPEG Group's JPEG software -========================================== - -This distribution contains a release of the Independent JPEG Group's free JPEG -software. You are welcome to redistribute this software and to use it for any -purpose, subject to the conditions under LEGAL ISSUES, below. - -This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, -Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, -Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, -and other members of the Independent JPEG Group. - -IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee -(also known as JPEG, together with ITU-T SG16). - -DOCUMENTATION ROADMAP -===================== - -This file contains the following sections: - -OVERVIEW General description of JPEG and the IJG software. -LEGAL ISSUES Copyright, lack of warranty, terms of distribution. -REFERENCES Where to learn more about JPEG. -ARCHIVE LOCATIONS Where to find newer versions of this software. -FILE FORMAT WARS Software *not* to get. -TO DO Plans for future IJG releases. - -Other documentation files in the distribution are: - -User documentation: - usage.txt Usage instructions for cjpeg, djpeg, jpegtran, - rdjpgcom, and wrjpgcom. - *.1 Unix-style man pages for programs (same info as usage.txt). - wizard.txt Advanced usage instructions for JPEG wizards only. - change.log Version-to-version change highlights. -Programmer and internal documentation: - libjpeg.txt How to use the JPEG library in your own programs. - example.c Sample code for calling the JPEG library. - structure.txt Overview of the JPEG library's internal structure. - coderules.txt Coding style rules --- please read if you contribute code. - -Please read at least usage.txt. Some information can also be found in the JPEG -FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find -out where to obtain the FAQ article. - -If you want to understand how the JPEG code works, we suggest reading one or -more of the REFERENCES, then looking at the documentation files (in roughly -the order listed) before diving into the code. - -OVERVIEW -======== - -This package contains C software to implement JPEG image encoding, decoding, -and transcoding. JPEG (pronounced "jay-peg") is a standardized compression -method for full-color and grayscale images. JPEG's strong suit is compressing -photographic images or other types of images that have smooth color and -brightness transitions between neighboring pixels. Images with sharp lines or -other abrupt features may not compress well with JPEG, and a higher JPEG -quality may have to be used to avoid visible compression artifacts with such -images. - -JPEG is lossy, meaning that the output pixels are not necessarily identical to -the input pixels. However, on photographic content and other "smooth" images, -very good compression ratios can be obtained with no visible compression -artifacts, and extremely high compression ratios are possible if you are -willing to sacrifice image quality (by reducing the "quality" setting in the -compressor.) - -This software implements JPEG baseline, extended-sequential, and progressive -compression processes. Provision is made for supporting all variants of these -processes, although some uncommon parameter settings aren't implemented yet. -We have made no provision for supporting the hierarchical or lossless -processes defined in the standard. - -We provide a set of library routines for reading and writing JPEG image files, -plus two sample applications "cjpeg" and "djpeg", which use the library to -perform conversion between JPEG and some other popular image file formats. -The library is intended to be reused in other applications. - -In order to support file conversion and viewing software, we have included -considerable functionality beyond the bare JPEG coding/decoding capability; -for example, the color quantization modules are not strictly part of JPEG -decoding, but they are essential for output to colormapped file formats or -colormapped displays. These extra functions can be compiled out of the -library if not required for a particular application. - -We have also included "jpegtran", a utility for lossless transcoding between -different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple -applications for inserting and extracting textual comments in JFIF files. - -The emphasis in designing this software has been on achieving portability and -flexibility, while also making it fast enough to be useful. In particular, -the software is not intended to be read as a tutorial on JPEG. (See the -REFERENCES section for introductory material.) Rather, it is intended to -be reliable, portable, industrial-strength code. We do not claim to have -achieved that goal in every aspect of the software, but we strive for it. - -We welcome the use of this software as a component of commercial products. -No royalty is required, but we do ask for an acknowledgement in product -documentation, as described under LEGAL ISSUES. - -LEGAL ISSUES -============ - -In plain English: - -1. We don't promise that this software works. (But if you find any bugs, - please let us know!) -2. You can use this software for whatever you want. You don't have to pay us. -3. You may not pretend that you wrote this software. If you use it in a - program, you must acknowledge somewhere in your documentation that - you've used the IJG code. - -In legalese: - -The authors make NO WARRANTY or representation, either express or implied, -with respect to this software, its quality, accuracy, merchantability, or -fitness for a particular purpose. This software is provided "AS IS", and you, -its user, assume the entire risk as to its quality and accuracy. - -This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. -All Rights Reserved except as specified below. - -Permission is hereby granted to use, copy, modify, and distribute this -software (or portions thereof) for any purpose, without fee, subject to these -conditions: -(1) If any part of the source code for this software is distributed, then this -README file must be included, with this copyright and no-warranty notice -unaltered; and any additions, deletions, or changes to the original files -must be clearly indicated in accompanying documentation. -(2) If only executable code is distributed, then the accompanying -documentation must state that "this software is based in part on the work of -the Independent JPEG Group". -(3) Permission for use of this software is granted only if the user accepts -full responsibility for any undesirable consequences; the authors accept -NO LIABILITY for damages of any kind. - -These conditions apply to any software derived from or based on the IJG code, -not just to the unmodified library. If you use our work, you ought to -acknowledge us. - -Permission is NOT granted for the use of any IJG author's name or company name -in advertising or publicity relating to this software or products derived from -it. This software may be referred to only as "the Independent JPEG Group's -software". - -We specifically permit and encourage the use of this software as the basis of -commercial products, provided that all warranty or liability claims are -assumed by the product vendor. - -The Unix configuration script "configure" was produced with GNU Autoconf. -It is copyright by the Free Software Foundation but is freely distributable. -The same holds for its supporting scripts (config.guess, config.sub, -ltmain.sh). Another support script, install-sh, is copyright by X Consortium -but is also freely distributable. - -The IJG distribution formerly included code to read and write GIF files. -To avoid entanglement with the Unisys LZW patent (now expired), GIF reading -support has been removed altogether, and the GIF writer has been simplified -to produce "uncompressed GIFs". This technique does not use the LZW -algorithm; the resulting GIF files are larger than usual, but are readable -by all standard GIF decoders. - -We are required to state that - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." - -REFERENCES -========== - -We recommend reading one or more of these references before trying to -understand the innards of the JPEG software. - -The best short technical introduction to the JPEG compression algorithm is - Wallace, Gregory K. "The JPEG Still Picture Compression Standard", - Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. -(Adjacent articles in that issue discuss MPEG motion picture compression, -applications of JPEG, and related topics.) If you don't have the CACM issue -handy, a PDF file containing a revised version of Wallace's article is -available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually -a preprint for an article that appeared in IEEE Trans. Consumer Electronics) -omits the sample images that appeared in CACM, but it includes corrections -and some added material. Note: the Wallace article is copyright ACM and IEEE, -and it may not be used for commercial purposes. - -A somewhat less technical, more leisurely introduction to JPEG can be found in -"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by -M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides -good explanations and example C code for a multitude of compression methods -including JPEG. It is an excellent source if you are comfortable reading C -code but don't know much about data compression in general. The book's JPEG -sample code is far from industrial-strength, but when you are ready to look -at a full implementation, you've got one here... - -The best currently available description of JPEG is the textbook "JPEG Still -Image Data Compression Standard" by William B. Pennebaker and Joan L. -Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. -Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG -standards (DIS 10918-1 and draft DIS 10918-2). - -The original JPEG standard is divided into two parts, Part 1 being the actual -specification, while Part 2 covers compliance testing methods. Part 1 is -titled "Digital Compression and Coding of Continuous-tone Still Images, -Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS -10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of -Continuous-tone Still Images, Part 2: Compliance testing" and has document -numbers ISO/IEC IS 10918-2, ITU-T T.83. - -The JPEG standard does not specify all details of an interchangeable file -format. For the omitted details we follow the "JFIF" conventions, revision -1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report -and thus received a formal publication status. It is available as a free -download in PDF format from -http://www.ecma-international.org/publications/techreports/E-TR-098.htm. -A PostScript version of the JFIF document is available at -http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at -http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures. - -The TIFF 6.0 file format specification can be obtained by FTP from -ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme -found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. -IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). -Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 -(Compression tag 7). Copies of this Note can be obtained from -http://www.ijg.org/files/. It is expected that the next revision -of the TIFF spec will replace the 6.0 JPEG design with the Note's design. -Although IJG's own code does not support TIFF/JPEG, the free libtiff library -uses our library to implement TIFF/JPEG per the Note. - -ARCHIVE LOCATIONS -================= - -The "official" archive site for this software is www.ijg.org. -The most recent released version can always be found there in -directory "files". - -The JPEG FAQ (Frequently Asked Questions) article is a source of some -general information about JPEG. -It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq -and other news.answers archive sites, including the official news.answers -archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. -If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu -with body - send usenet/news.answers/jpeg-faq/part1 - send usenet/news.answers/jpeg-faq/part2 - -FILE FORMAT WARS -================ - -The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together -with ITU-T SG16) currently promotes different formats containing the name -"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does -not support these formats (see REFERENCES). Indeed, one of the original -reasons for developing this free software was to help force convergence on -common, interoperable format standards for JPEG files. -Don't use an incompatible file format! -(In any case, our decoder will remain capable of reading existing JPEG -image files indefinitely.) - -TO DO -===== - -Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. --------------------------------------------------------------------------------- -libsdl -skia - -Copyright 2016 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright (c) 2010, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2010 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2011 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2012 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2013 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2014 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2015 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2016 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2017 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2006-2012 The Authors - -Contributors: -James Graham - jg307@cam.ac.uk -Anne van Kesteren - annevankesteren@gmail.com -Lachlan Hunt - lachlan.hunt@lachy.id.au -Matt McDonald - kanashii@kanashii.ca -Sam Ruby - rubys@intertwingly.net -Ian Hickson (Google) - ian@hixie.ch -Thomas Broyer - t.broyer@ltgt.net -Jacques Distler - distler@golem.ph.utexas.edu -Henri Sivonen - hsivonen@iki.fi -Adam Barth - abarth@webkit.org -Eric Seidel - eric@webkit.org -The Mozilla Foundation (contributions from Henri Sivonen since 2008) -David Flanagan (Mozilla) - dflanagan@mozilla.com -Google Inc. (contributed the Dart port) - misc@dartlang.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2013, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014 Seth Ladd. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014, Michael Bostock and Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. -Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2017, the Dart project authors. -Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2013, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2014, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2015, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2016, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages -pkg - -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -rapidjson - -Copyright (c) 2006-2013 Alexander Chemeris - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the product nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -rapidjson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -root_certificates - -Mozilla Public License -Version 2.0 - -1. Definitions - -1.1. “Contributor” - -means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. - -1.2. “Contributor Version” - -means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - -means Covered Software of a particular Contributor. - -1.4. “Covered Software” - -means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. - -1.5. “Incompatible With Secondary Licenses” - -means - - a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. - -1.6. “Executable Form” - -means any form of the work other than Source Code Form. - -1.7. “Larger Work” - -means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. - -1.8. “License” - -means this document. - -1.9. “Licensable” - -means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. - -1.10. “Modifications” - -means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - -means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. - -1.12. “Secondary License” - -means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - -means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - -means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. - -2. License Grants and Conditions - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its Contributions. - -This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. - -3. Responsibilities - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - -Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - -This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. - -10. Versions of the License - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. --------------------------------------------------------------------------------- -root_certificates - -Mozilla Public License Version 2.0 -================================== - -1. Definitions - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -* 6. Disclaimer of Warranty - -* Covered Software is provided under this License on an "as is" -* basis, without warranty of any kind, either expressed, implied, or -* statutory, including, without limitation, warranties that the -* Covered Software is free of defects, merchantable, fit for a -* particular purpose or non-infringing. The entire risk as to the -* quality and performance of the Covered Software is with You. -* Should any Covered Software prove defective in any respect, You -* (not any Contributor) assume the cost of any necessary servicing, -* repair, or correction. This disclaimer of warranty constitutes an -* essential part of this License. No use of any Covered Software is -* authorized under this License except under this disclaimer. - -* 7. Limitation of Liability - -* Under no circumstances and under no legal theory, whether tort -* (including negligence), contract, or otherwise, shall any -* Contributor, or anyone who distributes Covered Software as -* permitted above, be liable to You for any direct, indirect, -* special, incidental, or consequential damages of any character -* including, without limitation, damages for lost profits, loss of -* goodwill, work stoppage, computer failure or malfunction, or any -* and all other commercial damages or losses, even if such party -* shall have been informed of the possibility of such damages. This -* limitation of liability shall not apply to liability for death or -* personal injury resulting from such party's negligence to the -* extent applicable law prohibits such limitation. Some -* jurisdictions do not allow the exclusion or limitation of -* incidental or consequential damages, so this exclusion and -* limitation may not apply to You. - -8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. --------------------------------------------------------------------------------- -skcms - -Copyright (c) 2018 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skcms -skia - -Copyright 2018 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2014 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2014-2016 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and/or associated documentation files (the "Materials"), -to deal in the Materials without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Materials, and to permit persons to whom the -Materials are furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Materials. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2005 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2006 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2006-2012 The Android Open Source Project -Copyright 2012 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2007 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2008 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2008 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2009 Motorola - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2009 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2009-2015 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2010 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2010 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2011 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2011 Google Inc. -Copyright 2012 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2011 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2012 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2012 Intel Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2012 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2013 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2013 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2014 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2014 Google Inc. -Copyright 2017 ARM Ltd. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2014 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2015 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2015 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2016 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2016 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2017 ARM Ltd. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2017 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2018 Google LLC - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2018 Google, LLC - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2018 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -NEON optimized code (C) COPYRIGHT 2009 Motorola - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -tcmalloc - -Copyright (c) 2003, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -tcmalloc - -Copyright (c) 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -topaz - -Copyright 2016 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -topaz - -Copyright 2017 Th%e Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2003, 2010 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2003, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2005 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2005, 2010 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2005, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2006, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2007 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2008, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2009 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly -detect_data_type() function provided freely by Cosmin Truta, 2006 - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - -Modifications for Zip64 support -Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - -For more info read MiniZip_info.txt - -Condition of use and distribution are the same than zlib : - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - -Modifications of Unzip for Zip64 -Copyright (C) 2007-2008 Even Rouault - -Modifications for Zip64 support on both zip and unzip -Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - -For more info read MiniZip_info.txt - -Condition of use and distribution are the same than zlib : - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2004, 2005, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2004, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation -Authors: - Arjan van de Ven - Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation. All rights reserved. -Author: - Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation. All rights reserved. -Authors: - Wajdi Feghali - Jim Guilford - Vinodh Gopal - Erdinc Ozturk - Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2014 Intel Corporation - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (c) 2011 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -zlib - -Copyright (c) 2012 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -zlib - -zlib.h -- interface of the 'zlib' general purpose compression library -version 1.2.4, March 14th, 2010 - -Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. - -Jean-loup Gailly -Mark Adler diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b544820ec13b0..354948ee36df1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 463f83117c305ebf9d998ed31b35785f +Signature: 782592db06110d1380d491ec2cb2d99e UNUSED LICENSES: @@ -17175,6 +17175,7 @@ FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h +FILE: ../../../third_party/skia/include/gpu/vk/GrVkMemoryAllocator.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h @@ -17302,6 +17303,8 @@ FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp @@ -21178,6 +21181,33 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: vulkanmemoryallocator +ORIGIN: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/LICENSE.txt +TYPE: LicenseType.mit +FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h +---------------------------------------------------------------------------------------------------- +Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== + ==================================================================================================== LIBRARY: zlib ORIGIN: ../../../third_party/zlib/LICENSE @@ -21913,4 +21943,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 322 +Total license count: 323 From b41c2ae424e4aa61ae15b69ae6380be41e0affe4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 30 May 2018 13:40:53 -0400 Subject: [PATCH 0479/1190] Roll src/third_party/skia 137b874..588f879 (6 commits) (#5418) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 0e7a4e5a2ac2d..3fa4afd540d1b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '137b87485508e3882968a10559c2cb389dcc93c5', + 'skia_revision': '588f879677d4f36e16a42dd96876534f104c2e2f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 354948ee36df1..b8b6494f336bc 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 782592db06110d1380d491ec2cb2d99e +Signature: b46f9b886db2d2259c39fc00ce7c98e1 UNUSED LICENSES: From d174c4ff012ed7f64420a3525d6cc734ad3b8352 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Wed, 30 May 2018 12:50:12 -0700 Subject: [PATCH 0480/1190] Remove unnecessary saveLayer (#5420) saveLayer is slow so we should avoid it as much as possible. If there are artifacts without saveLayer, then we should report that to Skia for the fix instead of slowing the performance with saveLayer. This PQ makes average rasterizer time drop from 25ms to 18ms in flutter_gallery transitions perf test on a Nexus 5X. This partially fixes flutter/flutter#13736 . We probably still need some work in the opacity layer to squize all the performance improvements. --- flow/layers/clip_path_layer.cc | 2 +- flow/layers/clip_rrect_layer.cc | 2 +- flow/layers/physical_shape_layer.cc | 6 +----- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index e1ab3112aec19..06dd30bd3630a 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -48,7 +48,7 @@ void ClipPathLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipPathLayer::Paint"); FXL_DCHECK(needs_painting()); - Layer::AutoSaveLayer save(context, paint_bounds(), nullptr); + SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipPath(clip_path_, true); PaintChildren(context); } diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index e72590edb372b..cef687dfcfb8a 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -46,7 +46,7 @@ void ClipRRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRRectLayer::Paint"); FXL_DCHECK(needs_painting()); - Layer::AutoSaveLayer save(context, paint_bounds(), nullptr); + SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipRRect(clip_rrect_, true); PaintChildren(context); } diff --git a/flow/layers/physical_shape_layer.cc b/flow/layers/physical_shape_layer.cc index a730f9a8f96aa..b793132cc89e2 100644 --- a/flow/layers/physical_shape_layer.cc +++ b/flow/layers/physical_shape_layer.cc @@ -91,11 +91,7 @@ void PhysicalShapeLayer::Paint(PaintContext& context) const { context.canvas.drawPath(path_, paint); SkAutoCanvasRestore save(&context.canvas, false); - if (isRect_) { - context.canvas.save(); - } else { - context.canvas.saveLayer(path_.getBounds(), nullptr); - } + context.canvas.save(); context.canvas.clipPath(path_, true); PaintChildren(context); if (context.checkerboard_offscreen_layers && !isRect_) From c8378e40169f4b1cc2645df6c64ee948bd422bf2 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Wed, 30 May 2018 13:15:49 -0700 Subject: [PATCH 0481/1190] Dart SDK roll for 2018/05/30 (#5421) 3b6caa3517b Split UnresolvedNameGenerator f50873d3451 [fuchsia] Renaming component FIDL to fuchsia.sys. 13987b073d6 Add Forest method to access the name of a variable declaration 3b86f823d0a [vm/corelib] Remove GrowableArrayMarker hack. 88127f10e4f Clean up num#toStringAsPrecision docs 1eb1885c62d tools/addlatexhash.dart: Remove unused import 03cb46a2290 [vm/perf] Fix JITDUMP integration. 9d9eff44c99 Support sharing function signatures in deferred parts for fast startup ae9f5d2a1b1 Add Forest API for logical expressions 66c590d3ad3 Add json/utf8 BOM support in changelog. d116e62d76d Improve catch parameter recovery aa8e2ee178d Revert "[vm] Add tests for determinism of script and AppJIT snapshots." ec47e524bc9 Switch to non-alpha versions for analyzer/front_end/kernel. aac0478fada [vm] Add tests for determinism of script and AppJIT snapshots. 6cc7aa803a1 Change names/declarations tasks in AnalysisDriver sync. c30af41b96c Reapply "[mirrors] Add IsolateMirror.loadUri." a40993a6aff Observatory strong mode fix: Fix incorrect types in DebuggerStackElement. 0fdfc9aa3b6 Observatory strong mode fix: Add a needed implements clause. 209029ab8ee Observatory strong mode fix: Pass through a type parameter in the implements clause for GuardedMock. 1d323687b39 Use selection to decide whether EXTRACT_LOCAL_VARIABLE and EXTRACT_METHOD are available. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3fa4afd540d1b..38abb9747ad3c 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'ff815d05a52c03a318bff51ba4529ff5210b7bd6', + 'dart_revision': '3b6caa3517bcc7150030f240deedb010f5e3bc60', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b8b6494f336bc..9ba4aa4603149 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b46f9b886db2d2259c39fc00ce7c98e1 +Signature: 03b0b20989d06168f098a5a3a9f46ef7 UNUSED LICENSES: From 6bfd413bee60ee94873cdc95c3869cd9d1ea9b27 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Wed, 30 May 2018 16:06:05 -0700 Subject: [PATCH 0482/1190] Synchronizes analysis_options.yaml files, and turns on Function typedef lint. (#5419) Addresses flutter/flutter#18028 for the engine repo, and synchronizes the analysis_options.yaml files between the engine and the flutter/flutter repo. --- analysis_options.yaml | 36 +++++++++++++------ .../track_widget_constructor_locations.dart | 4 +-- frontend_server/lib/server.dart | 2 +- frontend_server/test/server_test.dart | 3 +- lib/ui/geometry.dart | 17 ++++----- lib/ui/hooks.dart | 2 +- lib/ui/painting.dart | 10 +++--- lib/ui/semantics.dart | 4 +-- lib/ui/window.dart | 12 +++---- shell/testing/observatory/test.dart | 2 +- tools/licenses/lib/filesystem.dart | 2 +- 11 files changed, 54 insertions(+), 40 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index a0bdf532504ed..5ceb890d98720 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,13 +1,13 @@ # Specify analysis options. # # This file is a copy of analysis_options_repo.yaml from flutter repo -# as of 2018-01-07, but with "sort_constructors_first" disabled -# (because we have private fake constructors), with -# "always_require_non_null_named_parameters" disabled (because we -# can't import the meta package from the SDK), and with -# "prefer_final_fields" disabled (because we do weird things with -# private fields, especially on the Window object): -# https://github.com/lfutter/flutter/blob/master/analysis_options_repo.yaml +# as of 2018-05-30, but with: +# - "always_require_non_null_named_parameters" disabled (because we +# can't import the meta package from the SDK), and +# - "sort_constructors_first" disabled (because we have private fake +# constructors), +# - "prefer_final_fields" disabled (because we do weird things with +# private fields, especially on the Window object): analyzer: language: @@ -22,6 +22,9 @@ analyzer: missing_return: warning # allow having TODOs in the code todo: ignore + # `flutter analyze` (without `--watch`) just ignores directories + # that contain a .dartignore file, and this file does not have any + # effect on what files are actually analyzed. linter: rules: @@ -31,11 +34,12 @@ linter: - 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_require_non_null_named_parameters + # always_require_non_null_named_parameters # DIFFERENT FROM FLUTTER/FLUTTER - always_specify_types - annotate_overrides # - avoid_annotating_with_dynamic # conflicts with always_specify_types - avoid_as + # - avoid_bool_literals_in_conditional_expressions # not yet tested # - avoid_catches_without_on_clauses # we do this commonly # - avoid_catching_errors # we do this commonly - avoid_classes_with_only_static_members @@ -44,11 +48,16 @@ linter: - avoid_init_to_null - avoid_null_checks_in_equality_operators # - avoid_positional_boolean_parameters # not yet tested + # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356) + - avoid_relative_lib_imports + - avoid_renaming_method_parameters - avoid_return_types_on_setters # - avoid_returning_null # we do this commonly # - avoid_returning_this # https://github.com/dart-lang/linter/issues/842 # - avoid_setters_without_getters # not yet tested + # - avoid_single_cascade_in_expression_statements # not yet tested - avoid_slow_async_io + # - avoid_types_as_parameter_names # https://github.com/dart-lang/linter/pull/954/files # - avoid_types_on_closure_parameters # conflicts with always_specify_types # - avoid_unused_constructor_parameters # https://github.com/dart-lang/linter/pull/847 - await_only_futures @@ -85,18 +94,22 @@ linter: # - parameter_assignments # we do this commonly - prefer_adjacent_string_concatenation - prefer_asserts_in_initializer_lists - # - prefer_bool_in_asserts # not yet tested + - prefer_bool_in_asserts - 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 # not yet tested - prefer_contains + # - prefer_equal_for_default_values # not yet tested # - 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_fields # DIFFERENT FROM FLUTTER/FLUTTER - prefer_final_locals - prefer_foreach # - prefer_function_declarations_over_variables # not yet tested + - prefer_generic_function_type_aliases - prefer_initializing_formals # - prefer_interpolation_to_compose_strings # not yet tested - prefer_is_empty @@ -106,7 +119,7 @@ linter: - public_member_api_docs # this is the only difference from analysis_options.yaml - recursive_getters - slash_for_doc_comments - # - sort_constructors_first + # - sort_constructors_first # DIFFERENT FROM FLUTTER/FLUTTER - sort_unnamed_constructors_first - super_goes_last - test_types_in_equals @@ -120,6 +133,7 @@ linter: - unnecessary_null_aware_assignments - unnecessary_null_in_if_null_operators - unnecessary_overrides + - unnecessary_parenthesis # - unnecessary_statements # not yet tested - unnecessary_this - unrelated_type_equality_checks diff --git a/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart b/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart index 2a2dc16396157..27654bb062baa 100644 --- a/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart +++ b/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart @@ -18,7 +18,7 @@ import 'package:vm/frontend_server.dart' show ProgramTransformer; // // The parameter name contains a randomly generate hex string to avoid collision // with user generated parameters. -final String _creationLocationParameterName = +const String _creationLocationParameterName = r'$creationLocationd_0dea112b090073317d4'; /// Name of private field added to the Widget class and any other classes that @@ -27,7 +27,7 @@ final String _creationLocationParameterName = /// Regardless of what library a class implementing Widget is defined in, the /// private field will always be defined in the context of the widget_inspector /// library ensuring no name conflicts with regular fields. -final String _locationFieldName = r'_location'; +const String _locationFieldName = r'_location'; bool _hasNamedParameter(FunctionNode function, String name) { return function.namedParameters diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index 57969641550fa..f8cb0cc7d3eb0 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -22,7 +22,7 @@ class _FlutterFrontendCompiler implements frontend.CompilerInterface{ _FlutterFrontendCompiler(StringSink output, {bool trackWidgetCreation: false}): _compiler = new frontend.FrontendCompiler(output, - transformer: (trackWidgetCreation ? new WidgetCreatorTracker() : null)); + transformer: trackWidgetCreation ? new WidgetCreatorTracker() : null); @override Future compile(String filename, ArgResults options, {IncrementalCompiler generator}) async { diff --git a/frontend_server/test/server_test.dart b/frontend_server/test/server_test.dart index b2d8e87d13e3e..9e98639b671d9 100644 --- a/frontend_server/test/server_test.dart +++ b/frontend_server/test/server_test.dart @@ -1,11 +1,10 @@ import 'dart:async'; +import 'package:frontend_server/server.dart'; import 'package:mockito/mockito.dart'; import 'package:test/test.dart'; import 'package:vm/frontend_server.dart' as frontend show CompilerInterface; -import '../lib/server.dart'; - class _MockedCompiler extends Mock implements frontend.CompilerInterface {} Future main() async { diff --git a/lib/ui/geometry.dart b/lib/ui/geometry.dart index b35ec55b066e8..8f833741388d8 100644 --- a/lib/ui/geometry.dart +++ b/lib/ui/geometry.dart @@ -1329,18 +1329,19 @@ class RRect { /// Whether this rounded rectangle has a side with no straight section. bool get isStadium { - return ( - tlRadius == trRadius && trRadius == brRadius && brRadius == blRadius && - (width <= 2.0 * tlRadiusX || height <= 2.0 * tlRadiusY) - ); + return tlRadius == trRadius + && trRadius == brRadius + && brRadius == blRadius + && (width <= 2.0 * tlRadiusX || height <= 2.0 * tlRadiusY); } /// Whether this rounded rectangle has no side with a straight section. bool get isEllipse { - return ( - tlRadius == trRadius && trRadius == brRadius && brRadius == blRadius && - width <= 2.0 * tlRadiusX && height <= 2.0 * tlRadiusY - ); + return tlRadius == trRadius + && trRadius == brRadius + && brRadius == blRadius + && width <= 2.0 * tlRadiusX + && height <= 2.0 * tlRadiusY; } /// Whether this rounded rectangle would draw as a circle. diff --git a/lib/ui/hooks.dart b/lib/ui/hooks.dart index 57b18d1773f75..4f94a9ac962c8 100644 --- a/lib/ui/hooks.dart +++ b/lib/ui/hooks.dart @@ -39,7 +39,7 @@ void _updateWindowMetrics(double devicePixelRatio, _invoke(window.onMetricsChanged, window._onMetricsChangedZone); } -typedef String _LocaleClosure(); +typedef _LocaleClosure = String Function(); String _localeClosure() => window._locale.toString(); diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 6973bd2052eba..f9458581f3789 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1067,7 +1067,7 @@ class Paint { } // Must be kept in sync with the default in paint.cc. - static final double _kStrokeMiterLimitDefault = 4.0; + static const double _kStrokeMiterLimitDefault = 4.0; /// The limit for miters to be drawn on segments when the join is set to /// [StrokeJoin.miter] and the [style] is set to [PaintingStyle.stroke]. If @@ -1315,7 +1315,7 @@ class Image extends NativeFieldWrapperClass2 { } /// Callback signature for [decodeImageFromList]. -typedef void ImageDecoderCallback(Image result); +typedef ImageDecoderCallback = void Function(Image result); /// Information for a single frame of an animation. /// @@ -3339,13 +3339,13 @@ class PictureRecorder extends NativeFieldWrapperClass2 { } /// Generic callback signature, used by [_futurize]. -typedef void _Callback(T result); +typedef _Callback = void Function(T result); /// Signature for a method that receives a [_Callback]. /// /// Return value should be null on success, and a string error message on /// failure. -typedef String _Callbacker(_Callback callback); +typedef _Callbacker = String Function(_Callback callback); /// Converts a method that receives a value-returning callback to a method that /// returns a Future. @@ -3358,7 +3358,7 @@ typedef String _Callbacker(_Callback callback); /// Example usage: /// /// ```dart -/// typedef void IntCallback(int result); +/// typedef IntCallback = void Function(int result); /// /// String _doSomethingAndCallback(IntCallback callback) { /// new Timer(new Duration(seconds: 1), () { callback(1); }); diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index da1255a0ec00b..7d00f6ac8e5fc 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -150,7 +150,7 @@ class SemanticsAction { /// /// The map's key is the [index] of the action and the value is the action /// itself. - static final Map values = const { + static const Map values = const { _kTapIndex: tap, _kLongPressIndex: longPress, _kScrollLeftIndex: scrollLeft, @@ -369,7 +369,7 @@ class SemanticsFlag { /// The possible semantics flags. /// /// The map's key is the [index] of the flag and the value is the flag itself. - static final Map values = const { + static const Map values = const { _kHasCheckedStateIndex: hasCheckedState, _kIsCheckedIndex: isChecked, _kIsSelectedIndex: isSelected, diff --git a/lib/ui/window.dart b/lib/ui/window.dart index d513b16c23f84..f8dad72f15486 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -5,25 +5,25 @@ part of dart.ui; /// Signature of callbacks that have no arguments and return no data. -typedef void VoidCallback(); +typedef VoidCallback = void Function(); /// Signature for [Window.onBeginFrame]. -typedef void FrameCallback(Duration duration); +typedef FrameCallback = void Function(Duration duration); /// Signature for [Window.onPointerDataPacket]. -typedef void PointerDataPacketCallback(PointerDataPacket packet); +typedef PointerDataPacketCallback = void Function(PointerDataPacket packet); /// Signature for [Window.onSemanticsAction]. -typedef void SemanticsActionCallback(int id, SemanticsAction action, ByteData args); +typedef SemanticsActionCallback = void Function(int id, SemanticsAction action, ByteData args); /// Signature for responses to platform messages. /// /// Used as a parameter to [Window.sendPlatformMessage] and /// [Window.onPlatformMessage]. -typedef void PlatformMessageResponseCallback(ByteData data); +typedef PlatformMessageResponseCallback = void Function(ByteData data); /// Signature for [Window.onPlatformMessage]. -typedef void PlatformMessageCallback(String name, ByteData data, PlatformMessageResponseCallback callback); +typedef PlatformMessageCallback = void Function(String name, ByteData data, PlatformMessageResponseCallback callback); /// States that an application can be in. /// diff --git a/shell/testing/observatory/test.dart b/shell/testing/observatory/test.dart index 9d7d7f769e7fd..ba14fe41cc3e0 100644 --- a/shell/testing/observatory/test.dart +++ b/shell/testing/observatory/test.dart @@ -147,7 +147,7 @@ Future testStartPaused(Uri uri) async { Expect.equals(resumedResponse['pauseEvent']['kind'], 'Resume'); } -typedef Future TestFunction(Uri uri); +typedef TestFunction = Future Function(Uri uri); final List basicTests = [ testHttpProtocolRequest, diff --git a/tools/licenses/lib/filesystem.dart b/tools/licenses/lib/filesystem.dart index 65ea72d7ec266..67137a8614fb7 100644 --- a/tools/licenses/lib/filesystem.dart +++ b/tools/licenses/lib/filesystem.dart @@ -23,7 +23,7 @@ enum FileType { metadata, // can be skipped entirely (e.g. Mac OS X ._foo files) } -typedef List Reader(); +typedef Reader = List Function(); class BytesOf extends Key { BytesOf(dynamic value) : super(value); } class UTF8Of extends Key { UTF8Of(dynamic value) : super(value); } From 8360553053f00dd12b5d6766d98b59b6919efd02 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 31 May 2018 09:50:37 -0400 Subject: [PATCH 0483/1190] Roll src/third_party/skia 588f879..e45752e (24 commits) (#5428) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 11361 ++++++++++++++++++ travis/licenses_golden/licenses_third_party | 10 +- 3 files changed, 11371 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 38abb9747ad3c..8bf4268cb6cc9 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '588f879677d4f36e16a42dd96876534f104c2e2f', + 'skia_revision': 'e45752e58fc30e0fc83dfb89f0ffd7f624ca151c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index e69de29bb2d1d..4c6f819c95b1e 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -0,0 +1,11361 @@ +boringssl + +Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] +-------------------------------------------------------------------------------- +boringssl + +Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2001 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2004 Kungliga Tekniska Högskolan +(Royal Institute of Technology, Stockholm, Sweden). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the Institute nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2004 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2006 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2006,2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2008 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2010 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2012 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2013 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2014 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2014, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015, Intel Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2016, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2017, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2018, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2003 Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2005 Nokia. All rights reserved. + +The portions of the attached software ("Contribution") is developed by +Nokia Corporation and is licensed pursuant to the OpenSSL open source +license. + +The Contribution, originally written by Mika Kousa and Pasi Eronen of +Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites +support (see RFC 4279) to OpenSSL. + +No patent licenses or other rights except those expressly stated in +the OpenSSL open source license shall be deemed granted or received +expressly, by implication, estoppel, or otherwise. + +No assurances are provided by Nokia that the Contribution does not +infringe the patent or other intellectual property rights of any third +party or that the license provides you with all the necessary rights +to make use of the Contribution. + +THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN +ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA +SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY +OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR +OTHERWISE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2005, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2006, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2007, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2008 Google Inc. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2008, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009 Google Inc. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2012, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2014, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2015, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2016 Brian Smith. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +The MIT License (MIT) + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl +dart + +OpenSSL License + + ==================================================================== + Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + + 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + + 5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + + THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ==================================================================== + + This product includes cryptographic software written by Eric Young + (eay@cryptsoft.com). This product includes software written by Tim + Hudson (tjh@cryptsoft.com). + +Original SSLeay License + +* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +* All rights reserved. + +* This package is an SSL implementation written +* by Eric Young (eay@cryptsoft.com). +* The implementation was written so as to conform with Netscapes SSL. + +* This library is free for commercial and non-commercial use as long as +* the following conditions are aheared to. The following conditions +* apply to all code found in this distribution, be it the RC4, RSA, +* lhash, DES, etc., code; not just the SSL code. The SSL documentation +* included with this distribution is covered by the same copyright terms +* except that the holder is Tim Hudson (tjh@cryptsoft.com). + +* Copyright remains Eric Young's, and as such any Copyright notices in +* the code are not to be removed. +* If this package is used in a product, Eric Young should be given attribution +* as the author of the parts of the library used. +* This can be in the form of a textual message at program startup or +* in documentation (online or textual) provided with the package. + +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* 1. Redistributions of source code must retain the copyright +* notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* 3. All advertising materials mentioning features or use of this software +* must display the following acknowledgement: +* "This product includes cryptographic software written by +* Eric Young (eay@cryptsoft.com)" +* The word 'cryptographic' can be left out if the rouines from the library +* being used are not cryptographic related :-). +* 4. If you include any Windows specific code (or a derivative thereof) from +* the apps directory (application code) you must include an acknowledgement: +* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +* SUCH DAMAGE. + +* The licence and distribution terms for any publically available version or +* derivative of this code cannot be changed. i.e. this code cannot simply be +* copied and put under another distribution licence +* [including the GNU Public Licence.] + +ISC license used for completely new code in BoringSSL: + +/* Copyright (c) 2015, Google Inc. + + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +The code in third_party/fiat carries the MIT license: + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Licenses for support code + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +observatory_pub_packages +skia +txt +vulkan + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-------------------------------------------------------------------------------- +colorama + +Copyright (c) 2010 Jonathan Hartley +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holders, nor those of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2003-2005 Tom Wu +Copyright (c) 2012 Adam Singer (adam@solvr.io) +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, +INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF +THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +In addition, the following condition applies: + +All redistributions must retain an intact copy of this copyright notice +and disclaimer. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright 2009 The Go 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 + +Copyright 2012, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart +observatory_pub_packages + +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +double-conversion + +Copyright 2006-2008 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +double-conversion + +Copyright 2010 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +double-conversion + +Copyright 2012 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + +Copyright (c) 2013 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + +Copyright 2017 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + +Copyright 2018 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet + +Copyright 2013 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +icu +skia +topaz + +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +icu +topaz + +Copyright 2014 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz + +Copyright 2016 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz + +Copyright 2017 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz +txt + +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +icu +skia +topaz + +Copyright 2016 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +skia +topaz + +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +files + +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +files + +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +files + +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +files + +Copyright 2000, Clark Cooper +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001, 2002 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001, 2002, 2003, 2004 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001-2008, 2011, 2013, 2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 1990, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000 Computing Research Labs, New Mexico State University +Copyright 2001-2004, 2011 Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000 Computing Research Labs, New Mexico State University +Copyright 2001-2014 + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000, 2001, 2004 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000-2001, 2002 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000-2001, 2003 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000-2010, 2012-2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2001, 2002, 2012 Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2003 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +The FreeType Project LICENSE + + 2006-Jan-27 + +Copyright 1996-2002, 2006 by +David Turner, Robert Wilhelm, and Werner Lemberg + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + + Please replace with the value from the FreeType version you + actually use. + +Legal Terms +=========== + +0. Definitions + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + http://www.freetype.org + +--- end of FTL.TXT --- +-------------------------------------------------------------------------------- +garnet + +Copyright 2013 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet + +Copyright 2014 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet + +Copyright 2017 The Fuchsia Authors.All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet +topaz + +Copyright 2015 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet +topaz + +Copyright 2018 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +gif + +GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +-------------------------------------------------------------------------------- +gif + +The Graphics Interchange Format(c) is the copyright property of CompuServe +Incorporated. Only CompuServe Incorporated is authorized to define, redefine, +enhance, alter, modify or change in any way the definition of the format. + +CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free +license for the use of the Graphics Interchange Format(sm) in computer +software; computer software utilizing GIF(sm) must acknowledge ownership of the +Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in +User and Technical Documentation. Computer software utilizing GIF, which is +distributed or may be distributed without User or Technical Documentation must +display to the screen or printer a message acknowledging ownership of the +Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in +this case, the acknowledgement may be displayed in an opening screen or leading +banner, or a closing screen or trailing banner. A message such as the following +may be used: + + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 1998-2004 David Turner and Werner Lemberg +Copyright © 2004,2007,2009 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 1998-2004 David Turner and Werner Lemberg +Copyright © 2004,2007,2009,2010 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 1998-2004 David Turner and Werner Lemberg +Copyright © 2006 Behdad Esfahbod +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007 Chris Wilson +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2010,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009,2010 Red Hat, Inc. +Copyright © 2010,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009,2010 Red Hat, Inc. +Copyright © 2010,2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009,2010 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2009 Keith Stribley +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2011 Codethink Limited +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2011 Codethink Limited +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2010,2011,2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2010,2011,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2011,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2012,2014 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2014 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012 Mozilla Foundation. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012,2013 Mozilla Foundation. +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2013 Red Hat, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2014 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2015 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2015 Mozilla Foundation. +Copyright © 2015 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2016 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2016 Igalia S.L. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2017 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +For parts of HarfBuzz that are licensed under different licenses see individual +files names COPYING in subdirectories where applicable. + +Copyright © 2010,2011,2012 Google, Inc. +Copyright © 2012 Mozilla Foundation +Copyright © 2011 Codethink Limited +Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) +Copyright © 2009 Keith Stribley +Copyright © 2009 Martin Hosken and SIL International +Copyright © 2007 Chris Wilson +Copyright © 2006 Behdad Esfahbod +Copyright © 2005 David Turner +Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. +Copyright © 1998-2004 David Turner and Werner Lemberg + +For full copyright notices consult the individual files in the package. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1995-2016 International Business Machines Corporation and others +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. + +All trademarks and registered trademarks mentioned herein are the +property of their respective owners. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1998 - 1999 Unicode, Inc. All Rights reserved. + Copyright (C) 2002-2005, International Business Machines + Corporation and others. All Rights Reserved. + +This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +No claims are made as to fitness for any particular purpose. No +warranties of any kind are expressed or implied. The recipient +agrees to determine applicability of information provided. If this +file has been provided on optical media by Unicode, Inc., the sole +remedy for any claim will be exchange of defective media within 90 +days of receipt. + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form for +internal or external distribution as long as this notice remains +attached. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1999 Computer Systems and Communication Lab, + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1999 Unicode, Inc. All Rights reserved. + Copyright (C) 2002-2005, International Business Machines + Corporation and others. All Rights Reserved. + +This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +No claims are made as to fitness for any particular purpose. No +warranties of any kind are expressed or implied. The recipient +agrees to determine applicability of information provided. If this +file has been provided on optical media by Unicode, Inc., the sole +remedy for any claim will be exchange of defective media within 90 +days of receipt. + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form for +internal or external distribution as long as this notice remains +attached. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 2002 Unicode, Inc. All Rights reserved. + Copyright (C) 2002-2005, International Business Machines + Corporation and others. All Rights Reserved. + +This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +No claims are made as to fitness for any particular purpose. No +warranties of any kind are expressed or implied. The recipient +agrees to determine applicability of information provided. If this +file has been provided on optical media by Unicode, Inc., the sole +remedy for any claim will be exchange of defective media within 90 +days of receipt. + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form for +internal or external distribution as long as this notice remains +attached. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 2013 International Business Machines Corporation +and others. All Rights Reserved. + +Project: http://code.google.com/p/lao-dictionary +Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt +License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt + (copied below) + + This file is derived from the above dictionary, with slight + modifications. + + Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, + are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. Redistributions in + binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 2014 International Business Machines Corporation +and others. All Rights Reserved. + +This list is part of a project hosted at: + github.com/kanyawtech/myanmar-karen-word-lists + +Copyright (c) 2013, LeRoy Benjamin Sharon +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: Redistributions of source code must retain the above +copyright notice, this list of conditions and the following +disclaimer. Redistributions in binary form must reproduce the +above copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided +with the distribution. + + Neither the name Myanmar Karen Word Lists, nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2010. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2011. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2012. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2014. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2016. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + University of Illinois +c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 +-------------------------------------------------------------------------------- +icu + +Copyright 2000, 2001, 2002, 2003 Nara Institute of Science +and Technology. All Rights Reserved. + +Use, reproduction, and distribution of this software is permitted. +Any copy of this software, whether in its original form or modified, +must include both the above copyright notice and the following +paragraphs. + +Nara Institute of Science and Technology (NAIST), +the copyright holders, disclaims all warranties with regard to this +software, including all implied warranties of merchantability and +fitness, in no event shall NAIST be liable for +any special, indirect or consequential damages or any damages +whatsoever resulting from loss of use, data or profits, whether in an +action of contract, negligence or other tortuous action, arising out +of or in connection with the use or performance of this software. + +A large portion of the dictionary entries +originate from ICOT Free Software. The following conditions for ICOT +Free Software applies to the current dictionary as well. + +Each User may also freely distribute the Program, whether in its +original form or modified, to any third party or parties, PROVIDED +that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear +on, or be attached to, the Program, which is distributed substantially +in the same form as set out herein and that such intended +distribution, if actually made, will neither violate or otherwise +contravene any of the laws and regulations of the countries having +jurisdiction over the User or the intended distribution itself. + +NO WARRANTY + +The program was produced on an experimental basis in the course of the +research and development conducted during the project and is provided +to users as so produced on an experimental basis. Accordingly, the +program is provided without any warranty whatsoever, whether express, +implied, statutory or otherwise. The term "warranty" used herein +includes, but is not limited to, any warranty of the quality, +performance, merchantability and fitness for a particular purpose of +the program and the nonexistence of any infringement or violation of +any right of any third party. + +Each user of the program will agree and understand, and be deemed to +have agreed and understood, that there is no warranty whatsoever for +the program and, accordingly, the entire risk arising from or +otherwise connected with the program is assumed by the user. + +Therefore, neither ICOT, the copyright holder, or any other +organization that participated in or was otherwise related to the +development of the program and their respective officials, directors, +officers and other employees shall be held liable for any and all +damages, including, without limitation, general, special, incidental +and consequential damages, arising out of or otherwise in connection +with the use or inability to use the program or any product, material +or result produced or otherwise obtained by using the program, +regardless of whether they have been advised of, or otherwise had +knowledge of, the possibility of such damages at any time during the +project or thereafter. Each user will be deemed to have agreed to the +foregoing by his or her commencement of use of the program. The term +"use" as used herein includes, but is not limited to, the use, +modification, copying and distribution of the program and the +production of secondary products from the program. + +In the case where the program, whether in its original form or +modified, was distributed or delivered to or received by a user from +any person, organization or entity other than ICOT, unless it makes or +grants independently of ICOT any specific warranty to the user in +writing, such person, organization or entity, will also be exempted +from and not be held liable to the user for any such damages as noted +above as far as the program is concerned. +-------------------------------------------------------------------------------- +icu + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. +-------------------------------------------------------------------------------- +icu + +Copyrighy (c) 1999 TaBE Project. +Copyright (c) 1999 Pai-Hsiang Hsiao. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the TaBE Project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +ICU License - ICU 1.8.1 and later + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2009 International Business Machines Corporation and others + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. +-------------------------------------------------------------------------------- +icu + +The BSD License +http://opensource.org/licenses/bsd-license.php +Copyright (C) 2006-2008, Google Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided with +the distribution. + Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Unicode® Terms of Use +For the general privacy policy governing access to this site, see the Unicode Privacy Policy. For trademark usage, see the Unicode® Consortium Name and Trademark Usage Policy. + +A. Unicode Copyright. +1. Copyright © 1991-2017 Unicode, Inc. All rights reserved. +2. Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. +3. Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files solely for informational purposes and in the creation of products supporting the Unicode Standard, subject to the Terms and Conditions herein. +4. Further specifications of rights and restrictions pertaining to the use of the particular set of data files known as the "Unicode Character Database" can be found in the License. +5. Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. The online code charts carry specific restrictions. All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. +6. No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. +7. Modification is not permitted with respect to this document. All copies of this document must be verbatim. +B. Restricted Rights Legend. Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. +C. Warranties and Disclaimers. +1. This publication and/or website may include technical or typographical errors or other inaccuracies . Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. +2. If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. +3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. +D. Waiver of Damages. In no event shall Unicode or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. +E. Trademarks & Logos. +1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. +2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. +3. All third party trademarks referenced herein are the property of their respective owners. +F. Miscellaneous. +1. Jurisdiction and Venue. This server is operated from a location in the State of California, United States of America. Unicode makes no representation that the materials are appropriate for use in other locations. If you access this server from other locations, you are responsible for compliance with local laws. This Agreement, all use of this site and any claims and damages resulting from use of this site are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this site shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. +2. Modification by Unicode Unicode shall have the right to modify this Agreement at any time by posting it to this site. The user may not assign any part of this Agreement without Unicode’s prior written consent. +3. Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. +4. Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. +5. Entire Agreement. This Agreement constitutes the entire agreement between the parties. + +EXHIBIT 1 +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +Unicode Data Files do not include PDF online code charts under the +directory http://www.unicode.org/Public/. + +Software includes any source code published in the Unicode Standard +or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009-2011, 2014-2016, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). +All Rights Reserved. +Author: Siarhei Siamashka +Copyright (C) 2013-2014, Linaro Limited. All Rights Reserved. +Author: Ragesh Radhakrishnan +Copyright (C) 2014-2016, D. R. Commander. All Rights Reserved. +Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. +Copyright (C) 2016, Siarhei Siamashka. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). +All Rights Reserved. +Author: Siarhei Siamashka +Copyright (C) 2014, Siarhei Siamashka. All Rights Reserved. +Copyright (C) 2014, Linaro Limited. All Rights Reserved. +Copyright (C) 2015, D. R. Commander. All Rights Reserved. +Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2011, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2013, MIPS Technologies, Inc., California. +All Rights Reserved. +Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) + Darko Laus (darko.laus@imgtec.com) +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2013-2014, MIPS Technologies, Inc., California. +All Rights Reserved. +Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) + Darko Laus (darko.laus@imgtec.com) +Copyright (C) 2015, D. R. Commander. All Rights Reserved. +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2014, D. R. Commander. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. +Copyright (C) 2014, Jay Foad. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2015, D. R. Commander. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2009-2014 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2009-2015 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2009-2016 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2011 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2011, 2015 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2011-2016 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. +Copyright (C) 2015-2016, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014, 2016, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014, D. R. Commander. +Copyright (C) 2013-2014, MIPS Technologies, Inc., California. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014-2015, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2010, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library - version 1.02 + +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2011, 2014, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2011, 2014-2016, D. R. Commander. +Copyright (C) 2013-2014, MIPS Technologies, Inc., California. +Copyright (C) 2014, Linaro Limited. +Copyright (C) 2015-2016, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2011, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009, 2012 Pierre Ossman for Cendio AB +Copyright (C) 2009, 2012, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009, 2012 Pierre Ossman for Cendio AB +Copyright (C) 2012, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project +to include only information relevant to libjpeg-turbo, to wordsmith certain +sections, and to remove impolitic language that existed in the libjpeg v8 +README. It is included only for reference. Please see README.md for +information specific to libjpeg-turbo. + +The Independent JPEG Group's JPEG software +========================================== + +This distribution contains a release of the Independent JPEG Group's free JPEG +software. You are welcome to redistribute this software and to use it for any +purpose, subject to the conditions under LEGAL ISSUES, below. + +This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, +Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, +Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, +and other members of the Independent JPEG Group. + +IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee +(also known as JPEG, together with ITU-T SG16). + +DOCUMENTATION ROADMAP +===================== + +This file contains the following sections: + +OVERVIEW General description of JPEG and the IJG software. +LEGAL ISSUES Copyright, lack of warranty, terms of distribution. +REFERENCES Where to learn more about JPEG. +ARCHIVE LOCATIONS Where to find newer versions of this software. +FILE FORMAT WARS Software *not* to get. +TO DO Plans for future IJG releases. + +Other documentation files in the distribution are: + +User documentation: + usage.txt Usage instructions for cjpeg, djpeg, jpegtran, + rdjpgcom, and wrjpgcom. + *.1 Unix-style man pages for programs (same info as usage.txt). + wizard.txt Advanced usage instructions for JPEG wizards only. + change.log Version-to-version change highlights. +Programmer and internal documentation: + libjpeg.txt How to use the JPEG library in your own programs. + example.c Sample code for calling the JPEG library. + structure.txt Overview of the JPEG library's internal structure. + coderules.txt Coding style rules --- please read if you contribute code. + +Please read at least usage.txt. Some information can also be found in the JPEG +FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find +out where to obtain the FAQ article. + +If you want to understand how the JPEG code works, we suggest reading one or +more of the REFERENCES, then looking at the documentation files (in roughly +the order listed) before diving into the code. + +OVERVIEW +======== + +This package contains C software to implement JPEG image encoding, decoding, +and transcoding. JPEG (pronounced "jay-peg") is a standardized compression +method for full-color and grayscale images. JPEG's strong suit is compressing +photographic images or other types of images that have smooth color and +brightness transitions between neighboring pixels. Images with sharp lines or +other abrupt features may not compress well with JPEG, and a higher JPEG +quality may have to be used to avoid visible compression artifacts with such +images. + +JPEG is lossy, meaning that the output pixels are not necessarily identical to +the input pixels. However, on photographic content and other "smooth" images, +very good compression ratios can be obtained with no visible compression +artifacts, and extremely high compression ratios are possible if you are +willing to sacrifice image quality (by reducing the "quality" setting in the +compressor.) + +This software implements JPEG baseline, extended-sequential, and progressive +compression processes. Provision is made for supporting all variants of these +processes, although some uncommon parameter settings aren't implemented yet. +We have made no provision for supporting the hierarchical or lossless +processes defined in the standard. + +We provide a set of library routines for reading and writing JPEG image files, +plus two sample applications "cjpeg" and "djpeg", which use the library to +perform conversion between JPEG and some other popular image file formats. +The library is intended to be reused in other applications. + +In order to support file conversion and viewing software, we have included +considerable functionality beyond the bare JPEG coding/decoding capability; +for example, the color quantization modules are not strictly part of JPEG +decoding, but they are essential for output to colormapped file formats or +colormapped displays. These extra functions can be compiled out of the +library if not required for a particular application. + +We have also included "jpegtran", a utility for lossless transcoding between +different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple +applications for inserting and extracting textual comments in JFIF files. + +The emphasis in designing this software has been on achieving portability and +flexibility, while also making it fast enough to be useful. In particular, +the software is not intended to be read as a tutorial on JPEG. (See the +REFERENCES section for introductory material.) Rather, it is intended to +be reliable, portable, industrial-strength code. We do not claim to have +achieved that goal in every aspect of the software, but we strive for it. + +We welcome the use of this software as a component of commercial products. +No royalty is required, but we do ask for an acknowledgement in product +documentation, as described under LEGAL ISSUES. + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltmain.sh). Another support script, install-sh, is copyright by X Consortium +but is also freely distributable. + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent (now expired), GIF reading +support has been removed altogether, and the GIF writer has been simplified +to produce "uncompressed GIFs". This technique does not use the LZW +algorithm; the resulting GIF files are larger than usual, but are readable +by all standard GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + +REFERENCES +========== + +We recommend reading one or more of these references before trying to +understand the innards of the JPEG software. + +The best short technical introduction to the JPEG compression algorithm is + Wallace, Gregory K. "The JPEG Still Picture Compression Standard", + Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. +(Adjacent articles in that issue discuss MPEG motion picture compression, +applications of JPEG, and related topics.) If you don't have the CACM issue +handy, a PDF file containing a revised version of Wallace's article is +available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually +a preprint for an article that appeared in IEEE Trans. Consumer Electronics) +omits the sample images that appeared in CACM, but it includes corrections +and some added material. Note: the Wallace article is copyright ACM and IEEE, +and it may not be used for commercial purposes. + +A somewhat less technical, more leisurely introduction to JPEG can be found in +"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by +M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides +good explanations and example C code for a multitude of compression methods +including JPEG. It is an excellent source if you are comfortable reading C +code but don't know much about data compression in general. The book's JPEG +sample code is far from industrial-strength, but when you are ready to look +at a full implementation, you've got one here... + +The best currently available description of JPEG is the textbook "JPEG Still +Image Data Compression Standard" by William B. Pennebaker and Joan L. +Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. +Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG +standards (DIS 10918-1 and draft DIS 10918-2). + +The original JPEG standard is divided into two parts, Part 1 being the actual +specification, while Part 2 covers compliance testing methods. Part 1 is +titled "Digital Compression and Coding of Continuous-tone Still Images, +Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS +10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of +Continuous-tone Still Images, Part 2: Compliance testing" and has document +numbers ISO/IEC IS 10918-2, ITU-T T.83. + +The JPEG standard does not specify all details of an interchangeable file +format. For the omitted details we follow the "JFIF" conventions, revision +1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report +and thus received a formal publication status. It is available as a free +download in PDF format from +http://www.ecma-international.org/publications/techreports/E-TR-098.htm. +A PostScript version of the JFIF document is available at +http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at +http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures. + +The TIFF 6.0 file format specification can be obtained by FTP from +ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme +found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. +IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). +Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 +(Compression tag 7). Copies of this Note can be obtained from +http://www.ijg.org/files/. It is expected that the next revision +of the TIFF spec will replace the 6.0 JPEG design with the Note's design. +Although IJG's own code does not support TIFF/JPEG, the free libtiff library +uses our library to implement TIFF/JPEG per the Note. + +ARCHIVE LOCATIONS +================= + +The "official" archive site for this software is www.ijg.org. +The most recent released version can always be found there in +directory "files". + +The JPEG FAQ (Frequently Asked Questions) article is a source of some +general information about JPEG. +It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq +and other news.answers archive sites, including the official news.answers +archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. +If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu +with body + send usenet/news.answers/jpeg-faq/part1 + send usenet/news.answers/jpeg-faq/part2 + +FILE FORMAT WARS +================ + +The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together +with ITU-T SG16) currently promotes different formats containing the name +"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does +not support these formats (see REFERENCES). Indeed, one of the original +reasons for developing this free software was to help force convergence on +common, interoperable format standards for JPEG files. +Don't use an incompatible file format! +(In any case, our decoder will remain capable of reading existing JPEG +image files indefinitely.) + +TO DO +===== + +Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. +-------------------------------------------------------------------------------- +libsdl +skia + +Copyright 2016 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright (c) 2010, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2010 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2011 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2012 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2013 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2014 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2015 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2016 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2017 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2006-2012 The Authors + +Contributors: +James Graham - jg307@cam.ac.uk +Anne van Kesteren - annevankesteren@gmail.com +Lachlan Hunt - lachlan.hunt@lachy.id.au +Matt McDonald - kanashii@kanashii.ca +Sam Ruby - rubys@intertwingly.net +Ian Hickson (Google) - ian@hixie.ch +Thomas Broyer - t.broyer@ltgt.net +Jacques Distler - distler@golem.ph.utexas.edu +Henri Sivonen - hsivonen@iki.fi +Adam Barth - abarth@webkit.org +Eric Seidel - eric@webkit.org +The Mozilla Foundation (contributions from Henri Sivonen since 2008) +David Flanagan (Mozilla) - dflanagan@mozilla.com +Google Inc. (contributed the Dart port) - misc@dartlang.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2013, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014 Seth Ladd. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014, Michael Bostock and Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014, the Dart project authors. +Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2017, the Dart project authors. +Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2013, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2015, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2016, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages +pkg + +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +rapidjson + +Copyright (c) 2006-2013 Alexander Chemeris + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the product nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +rapidjson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +root_certificates + +Mozilla Public License +Version 2.0 + +1. Definitions + +1.1. “Contributor” + +means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. + +1.2. “Contributor Version” + +means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + +means Covered Software of a particular Contributor. + +1.4. “Covered Software” + +means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. + +1.5. “Incompatible With Secondary Licenses” + +means + + a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. + +1.6. “Executable Form” + +means any form of the work other than Source Code Form. + +1.7. “Larger Work” + +means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. + +1.8. “License” + +means this document. + +1.9. “Licensable” + +means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. + +1.10. “Modifications” + +means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + +means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. + +1.12. “Secondary License” + +means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + +means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + +means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. License Grants and Conditions + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its Contributions. + +This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. + +3. Responsibilities + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + +If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + +Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + +This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. + +10. Versions of the License + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + +If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. +-------------------------------------------------------------------------------- +root_certificates + +Mozilla Public License Version 2.0 +================================== + +1. Definitions + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +* 6. Disclaimer of Warranty + +* Covered Software is provided under this License on an "as is" +* basis, without warranty of any kind, either expressed, implied, or +* statutory, including, without limitation, warranties that the +* Covered Software is free of defects, merchantable, fit for a +* particular purpose or non-infringing. The entire risk as to the +* quality and performance of the Covered Software is with You. +* Should any Covered Software prove defective in any respect, You +* (not any Contributor) assume the cost of any necessary servicing, +* repair, or correction. This disclaimer of warranty constitutes an +* essential part of this License. No use of any Covered Software is +* authorized under this License except under this disclaimer. + +* 7. Limitation of Liability + +* Under no circumstances and under no legal theory, whether tort +* (including negligence), contract, or otherwise, shall any +* Contributor, or anyone who distributes Covered Software as +* permitted above, be liable to You for any direct, indirect, +* special, incidental, or consequential damages of any character +* including, without limitation, damages for lost profits, loss of +* goodwill, work stoppage, computer failure or malfunction, or any +* and all other commercial damages or losses, even if such party +* shall have been informed of the possibility of such damages. This +* limitation of liability shall not apply to liability for death or +* personal injury resulting from such party's negligence to the +* extent applicable law prohibits such limitation. Some +* jurisdictions do not allow the exclusion or limitation of +* incidental or consequential damages, so this exclusion and +* limitation may not apply to You. + +8. Litigation + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. +-------------------------------------------------------------------------------- +skcms + +Copyright (c) 2018 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skcms +skia +vulkanmemoryallocator + +Copyright 2018 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (C) 2014 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2011 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2014 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2014-2016 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and/or associated documentation files (the "Materials"), +to deal in the Materials without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Materials, and to permit persons to whom the +Materials are furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Materials. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2005 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2006 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2006-2012 The Android Open Source Project +Copyright 2012 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2007 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2008 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2008 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2009 Motorola + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2009 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2009-2015 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2010 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2010 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2011 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2011 Google Inc. +Copyright 2012 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2011 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2012 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2012 Intel Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2012 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2013 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2013 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2014 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2014 Google Inc. +Copyright 2017 ARM Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2014 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2015 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2015 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2016 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2016 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2017 ARM Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2017 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 Google LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 Google, LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +NEON optimized code (C) COPYRIGHT 2009 Motorola + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +tcmalloc + +Copyright (c) 2003, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +tcmalloc + +Copyright (c) 2005, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +topaz + +Copyright 2016 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +topaz + +Copyright 2017 Th%e Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +vulkanmemoryallocator + +Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2003, 2010 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2003, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2005 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2005, 2010 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2005, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2006, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2007 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2008, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2009 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly +detect_data_type() function provided freely by Cosmin Truta, 2006 + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + +Modifications for Zip64 support +Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + +For more info read MiniZip_info.txt + +Condition of use and distribution are the same than zlib : + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + +Modifications of Unzip for Zip64 +Copyright (C) 2007-2008 Even Rouault + +Modifications for Zip64 support on both zip and unzip +Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + +For more info read MiniZip_info.txt + +Condition of use and distribution are the same than zlib : + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2004, 2005, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2004, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation +Authors: + Arjan van de Ven + Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation. All rights reserved. +Author: + Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation. All rights reserved. +Authors: + Wajdi Feghali + Jim Guilford + Vinodh Gopal + Erdinc Ozturk + Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2014 Intel Corporation + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (c) 2011 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +zlib + +Copyright (c) 2012 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +zlib + +zlib.h -- interface of the 'zlib' general purpose compression library +version 1.2.4, March 14th, 2010 + +Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +Jean-loup Gailly +Mark Adler diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9ba4aa4603149..5eae7530c06b2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 03b0b20989d06168f098a5a3a9f46ef7 +Signature: fd66740edd10e5f34394128b5f8567d0 UNUSED LICENSES: @@ -17147,6 +17147,7 @@ Exhibit B - “Incompatible With Secondary Licenses” Notice ==================================================================================================== LIBRARY: skcms LIBRARY: skia +LIBRARY: vulkanmemoryallocator ORIGIN: ../../../third_party/skia/bench/GrCCGeometryBench.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp @@ -17158,6 +17159,7 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionSetPath.cpp +FILE: ../../../third_party/skia/gm/3dgm.cpp FILE: ../../../third_party/skia/gm/hugepath.cpp FILE: ../../../third_party/skia/gm/localmatrixshader.cpp FILE: ../../../third_party/skia/gm/makeRasterImage.cpp @@ -17207,6 +17209,7 @@ FILE: ../../../third_party/skia/modules/sksg/src/SkSGText.cpp FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp +FILE: ../../../third_party/skia/src/codec/SkColorTable.cpp FILE: ../../../third_party/skia/src/core/SkBlurPriv.h FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp FILE: ../../../third_party/skia/src/core/SkColorSpaceXformSteps.cpp @@ -17317,6 +17320,8 @@ FILE: ../../../third_party/skia/src/sksl/SkSLJIT.cpp FILE: ../../../third_party/skia/src/sksl/SkSLJIT.h FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp +FILE: ../../../third_party/skia/src/utils/Sk3D.cpp +FILE: ../../../third_party/skia/src/utils/Sk3D.h FILE: ../../../third_party/skia/third_party/skcms/skcms.c FILE: ../../../third_party/skia/third_party/skcms/skcms.h FILE: ../../../third_party/skia/third_party/skcms/src/Curve.c @@ -17334,6 +17339,8 @@ FILE: ../../../third_party/skia/third_party/skcms/src/TransferFunction.h FILE: ../../../third_party/skia/third_party/skcms/src/Transform.c FILE: ../../../third_party/skia/third_party/skcms/src/Transform.h FILE: ../../../third_party/skia/third_party/skcms/src/Transform_inl.h +FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.cpp +FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.h ---------------------------------------------------------------------------------------------------- Copyright 2018 Google Inc. @@ -17620,6 +17627,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json From 89eb6a374578286b5649b957f39732a6764bfad9 Mon Sep 17 00:00:00 2001 From: cary-clark Date: Thu, 31 May 2018 09:55:57 -0400 Subject: [PATCH 0484/1190] call existing ostream operator for SkMatrix (#5427) This permits removing the call to SkMatrix::toString(), which is deprecated. --- flow/debug_print.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/flow/debug_print.cc b/flow/debug_print.cc index 6326153aaa73e..e2d7fc3f4c882 100644 --- a/flow/debug_print.cc +++ b/flow/debug_print.cc @@ -73,9 +73,7 @@ std::ostream& operator<<(std::ostream& os, const SkPoint& r) { } std::ostream& operator<<(std::ostream& os, const flow::RasterCacheKey& k) { - SkString matrix_string; - k.matrix().toString(&matrix_string); - os << "Picture: " << k.picture_id() << " matrix: " << matrix_string.c_str(); + os << "Picture: " << k.picture_id() << " matrix: " << k.matrix(); return os; } From 15ddcd448d972381cfa9c93c041dfa31a2061e0c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 31 May 2018 13:19:37 -0400 Subject: [PATCH 0485/1190] Roll src/third_party/skia e45752e..0390d3e (8 commits) (#5429) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 8bf4268cb6cc9..b856dddad04f9 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e45752e58fc30e0fc83dfb89f0ffd7f624ca151c', + 'skia_revision': '0390d3e36b24679dd63d8aad90f90cb1cb086333', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5eae7530c06b2..1dece38bf7385 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: fd66740edd10e5f34394128b5f8567d0 +Signature: fb0171540ffdf635ec6662dfebb0bff1 UNUSED LICENSES: @@ -17673,6 +17673,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Androi FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Vulkan_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench.json +FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench_DDLTotal_9x9.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/skqp_test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json From 0b3118d39606a775c60319b82112ef42fbabc759 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 31 May 2018 16:51:37 -0400 Subject: [PATCH 0486/1190] Roll src/third_party/skia 0390d3e..458f40a (14 commits) (#5430) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/DEPS b/DEPS index b856dddad04f9..a5dde909110af 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0390d3e36b24679dd63d8aad90f90cb1cb086333', + 'skia_revision': '458f40a43e12260a3b73ee170b30d966d6c1fe56', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1dece38bf7385..d98f5c0062284 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: fb0171540ffdf635ec6662dfebb0bff1 +Signature: 4f70d46ccf69a2097702f43b31412881 UNUSED LICENSES: @@ -14358,6 +14358,7 @@ FILE: ../../../third_party/skia/include/private/GrSingleOwner.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxy.h FILE: ../../../third_party/skia/include/private/GrSwizzle.h FILE: ../../../third_party/skia/include/private/GrTextureProxy.h +FILE: ../../../third_party/skia/include/private/SkArenaAlloc.h FILE: ../../../third_party/skia/include/private/SkBitmaskEnum.h FILE: ../../../third_party/skia/include/private/SkEncodedInfo.h FILE: ../../../third_party/skia/include/private/SkLeanWindows.h @@ -14385,7 +14386,6 @@ FILE: ../../../third_party/skia/src/core/SkATrace.cpp FILE: ../../../third_party/skia/src/core/SkATrace.h FILE: ../../../third_party/skia/src/core/SkAnnotationKeys.h FILE: ../../../third_party/skia/src/core/SkArenaAlloc.cpp -FILE: ../../../third_party/skia/src/core/SkArenaAlloc.h FILE: ../../../third_party/skia/src/core/SkAutoMalloc.h FILE: ../../../third_party/skia/src/core/SkAutoPixmapStorage.cpp FILE: ../../../third_party/skia/src/core/SkAutoPixmapStorage.h @@ -17178,6 +17178,8 @@ FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkMemoryAllocator.h +FILE: ../../../third_party/skia/include/private/GrCCClipPath.h +FILE: ../../../third_party/skia/include/private/GrCCPerOpListPaths.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h @@ -17249,7 +17251,6 @@ FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.cpp @@ -17673,6 +17674,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Androi FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Vulkan_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench.json +FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench_DDLRecord_9x9.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench_DDLTotal_9x9.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/skqp_test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json @@ -18213,7 +18215,6 @@ FILE: ../../../third_party/skia/bench/RotatedRectBench.cpp FILE: ../../../third_party/skia/bench/SKPBench.cpp FILE: ../../../third_party/skia/bench/SKPBench.h FILE: ../../../third_party/skia/bench/nanobench.cpp -FILE: ../../../third_party/skia/dm/DMGpuSupport.h FILE: ../../../third_party/skia/dm/DMJsonWriter.cpp FILE: ../../../third_party/skia/dm/DMJsonWriter.h FILE: ../../../third_party/skia/gm/aaa.cpp @@ -18504,6 +18505,7 @@ FILE: ../../../third_party/skia/include/gpu/gl/GrGLFunctions.h FILE: ../../../third_party/skia/include/pathops/SkPathOps.h FILE: ../../../third_party/skia/include/private/SkChecksum.h FILE: ../../../third_party/skia/include/private/SkPathRef.h +FILE: ../../../third_party/skia/include/private/SkTInternalLList.h FILE: ../../../third_party/skia/include/private/SkWeakRefCnt.h FILE: ../../../third_party/skia/include/utils/SkNullCanvas.h FILE: ../../../third_party/skia/samplecode/SampleAnimBlur.cpp @@ -18528,7 +18530,6 @@ FILE: ../../../third_party/skia/src/core/SkRTree.cpp FILE: ../../../third_party/skia/src/core/SkRTree.h FILE: ../../../third_party/skia/src/core/SkReadBuffer.cpp FILE: ../../../third_party/skia/src/core/SkStrokeRec.cpp -FILE: ../../../third_party/skia/src/core/SkTInternalLList.h FILE: ../../../third_party/skia/src/core/SkTLList.h FILE: ../../../third_party/skia/src/core/SkTLS.cpp FILE: ../../../third_party/skia/src/core/SkTLS.h From e8fd58a503a800242fc68f1f2f115b9ba79d783e Mon Sep 17 00:00:00 2001 From: Alexander Markov Date: Thu, 31 May 2018 14:50:38 -0700 Subject: [PATCH 0487/1190] Roll Dart SDK to 1a185867a996a91be5fdd1535d89e7d3750d0050 (#5431) dart-lang/sdk@1a18586 Search for element declarations in discovered available files. dart-lang/sdk@7e899d0 Add fix-all in file fixes for the 2 additional dart analysis server fix types: USE_NOT_EQ_NULL and USE_EQ_EQ_NULL dart-lang/sdk@eb82559 Reapply "[vm] Add tests for determinism of script and AppJIT snapshots." dart-lang/sdk@f66769c Add duplicate shown/hidden name analyzer note to changelog dart-lang/sdk@95afe41 Add an implementation of the UnresolvedNameGenerator for analyzer dart-lang/sdk@fcb41fb Replace more calls to parseTypeVariablesOpt with computeTypeParamOrArg dart-lang/sdk@8e00451 Add fix-all in file fixes for the 3 additional dart analysis server fix types: ADD_NE_NULL, REMOVE_UNNECESSARY_CAST, REPLACE_BOOLEAN_WITH_BOOL dart-lang/sdk@b75da96 Move all type mask code to inferrer/typemasks and use it via an AbstractValueStrategy dart-lang/sdk@7ce2432 Add UnlinkedScope dart-lang/sdk@8e92598 [infra] Add config for custom hunk text when using git diff on status files dart-lang/sdk@14b9d7f [infra] Prepare test.py for the --preview-dart-2 VM flag flip dart-lang/sdk@00f75ad Emit a compile-time error on incorrect types of initializing formals dart-lang/sdk@b62b438 Infer Object members for dynamic receivers dart-lang/sdk@b3bae42 Fix a batch of long lines dart-lang/sdk@796f530 Report FieldInitializerOutsideConstructor error in BodyBuilder dart-lang/sdk@e1ffb22 Remove Declaration.prepareTopLevelInference dart-lang/sdk@ff8100d [infra] Add dartk reload/rollback configurations to test matrix dart-lang/sdk@b851714 Remove Declaration.computeLibraryUri dart-lang/sdk@5ecd782 [kernel] Add an option to the cloner for cloning annotations dart-lang/sdk@bb0808d Replace Builder by Declaration dart-lang/sdk@39b0efd Handle generic jsinterop classes as type arguments. dart-lang/sdk@c6129f7 Use AbstractValue in the rest of type inference dart-lang/sdk@947760f Use AbstractValue in much of inference dart-lang/sdk@3dd70ce Usa AbstractValue in the rest of ssa dart-lang/sdk@bbef9ae Use AbstractValue in most of ssa dart-lang/sdk@aecf8e8 Use AbstractValue in KernelToTypeInferenceMap and KernelTypeGraphBuilder dart-lang/sdk@032925c Remove obsolete features dart-lang/sdk@715c14c Added changelog entry for member conflict updates dart-lang/sdk@08c893d Simplify class member conflict rules. dart-lang/sdk@377eb52 [vm/kernel/bytecode] Add library reference and invocation kind to ConstantICData dart-lang/sdk@a53b585 Fix more Analyzer tests dart-lang/sdk@fa9ff9a Fix regression in deferred loading. dart-lang/sdk@2911f1f More dart2js strong mode cleanup. dart-lang/sdk@b6d20fa Enable the fix-all feature for the DartFixKind.ADD_EXPLICIT_CAST fix, tests been added as well. dart-lang/sdk@a1f6aa8 improve speed of dartdevk SDK and ddc test package summary build dart-lang/sdk@9e3842d Observatory strong mode fix: fix type errors with onDisconnect. dart-lang/sdk@3027302 [VM] Fix for issue 33277 (skip HasAttemptedReload check for kernel isolate too). dart-lang/sdk@0e3ca9a Fix strong mode runtime error in dart2js. dart-lang/sdk@3d2b660 Reland "[vm] Support definition of entry-points via @pragma('vm.extern') annotations."" dart-lang/sdk@fb4f887 [vm/kernel/aot] Fix recognition of native methods after annotations are constant evaluated dart-lang/sdk@753d954 Move to dartdoc 0.20.0 and enable preview-dart-2. dart-lang/sdk@39d902b Update pubspec to indicate that analyzer_plugin supports the latest analyzer. dart-lang/sdk@bfeb80a Observatory strong mode fixes: fix some int/double mismatches. dart-lang/sdk@7fc88c4 Observatory strong mode fix: add required calls to .toList(). dart-lang/sdk@fe3bba8 Switch integration tests to use a snapshot for the analysis server. dart-lang/sdk@cc9c8f9 Add HintCode for duplicate shown/hidden names dart-lang/sdk@e7bad54 Make dart2js only run with 64 bit ints, not the larger ints from the vm. --- DEPS | 4 ++-- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index a5dde909110af..fd619707b387a 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '3b6caa3517bcc7150030f240deedb010f5e3bc60', + 'dart_revision': '1a185867a996a91be5fdd1535d89e7d3750d0050', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', @@ -47,7 +47,7 @@ vars = { 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+2', 'dart_dart_style_tag': '1.0.14', - 'dart_dartdoc_tag': 'v0.19.1', + 'dart_dartdoc_tag': 'v0.20.0', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d98f5c0062284..b28d76b56626f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4f70d46ccf69a2097702f43b31412881 +Signature: b4c0719b4d85013e853632a2a5cfcd91 UNUSED LICENSES: @@ -4624,6 +4624,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. LIBRARY: dart ORIGIN: ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/.gitconfig FILE: ../../../third_party/dart/.mailmap FILE: ../../../third_party/dart/client/idea/.idea/.name FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Default.xml From 508884af7c6f293c23d80714409a95683fddbaa6 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Thu, 31 May 2018 16:41:58 -0700 Subject: [PATCH 0488/1190] Call SkAutoCanvasRestore with doSave = true (#5432) Although we do have a save before this SkAutoCanvasRestore so we can theoretically send in doSave = false, it's safer to set doSave to true to prevent future breakage. As discussed with mtklein@google.com and reed@google.com, saving canvas is very cheap in Skia so this should have no performance impact. Skia is also considering remove doSave argument from SkAutoCanvasRestore and always save the canvas. --- flow/raster_cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index afd3d27dab254..0922cdcec37a0 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -18,7 +18,7 @@ namespace flow { void RasterCacheResult::draw(SkCanvas& canvas) const { - SkAutoCanvasRestore auto_restore(&canvas, false); + SkAutoCanvasRestore auto_restore(&canvas, true); SkIRect bounds = RasterCache::GetDeviceBounds(logical_rect_, canvas.getTotalMatrix()); FXL_DCHECK(bounds.size() == image_->dimensions()); From de02aaf404845e54d3602ca9535b40fc7dfb27ea Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 31 May 2018 20:17:37 -0400 Subject: [PATCH 0489/1190] Roll src/third_party/skia 458f40a..e70c5fb (4 commits) (#5433) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index fd619707b387a..57baaf3613e0a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '458f40a43e12260a3b73ee170b30d966d6c1fe56', + 'skia_revision': 'e70c5fb602047dc6ece0183ad49684c4d403ee0d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b28d76b56626f..77380435e7659 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b4c0719b4d85013e853632a2a5cfcd91 +Signature: c3cf71b99139922f95594f20e65ec600 UNUSED LICENSES: From 6cef519598c09039fc951eca6998b437a7137dec Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 31 May 2018 18:51:32 -0700 Subject: [PATCH 0490/1190] Eliminate arm64 restriction in iOS framework plist (#5435) Eliminates the declaration that only arm64 is supported in Flutter.framework's Info.plist. This causes Xcode's app thinning tools to remove Flutter.framework in thinned archives for armv7 devices. --- shell/platform/darwin/ios/framework/Info.plist | 4 ---- 1 file changed, 4 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Info.plist b/shell/platform/darwin/ios/framework/Info.plist index 5aa6c1299f792..b3b0256375439 100644 --- a/shell/platform/darwin/ios/framework/Info.plist +++ b/shell/platform/darwin/ios/framework/Info.plist @@ -20,10 +20,6 @@ ???? CFBundleVersion 1.0 - UIRequiredDeviceCapabilities - - arm64 - MinimumOSVersion 8.0 From 1b30d4604dfbd70b313d0371d383c8c636f3de48 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 31 May 2018 23:42:37 -0400 Subject: [PATCH 0491/1190] Roll src/third_party/skia e70c5fb..db33ee1 (1 commits) (#5436) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 57baaf3613e0a..4e5001b0de167 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e70c5fb602047dc6ece0183ad49684c4d403ee0d', + 'skia_revision': 'db33ee143bcc997a110fcb32a00785a139dc94de', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 77380435e7659..a45f2eca554f2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c3cf71b99139922f95594f20e65ec600 +Signature: 8fa596d4801db81778bc9be966665954 UNUSED LICENSES: From 7b6acfd14d2ef888c3aad788ade2d893a3fd910f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 1 Jun 2018 06:00:37 -0400 Subject: [PATCH 0492/1190] Roll src/third_party/skia db33ee1..c4952be (1 commits) (#5437) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4e5001b0de167..5f00055b26ce6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'db33ee143bcc997a110fcb32a00785a139dc94de', + 'skia_revision': 'c4952be7d401797aa6c353b57bf97132bf3d7669', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a45f2eca554f2..1cf5d8444b0b9 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8fa596d4801db81778bc9be966665954 +Signature: 4d1a25961629656b63759ae764baaa8f UNUSED LICENSES: From 9be67586b16e806f2e17c101c833890eed103158 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 1 Jun 2018 09:19:31 -0400 Subject: [PATCH 0493/1190] Roll src/third_party/skia c4952be..22f673d (4 commits) (#5438) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 11361 ------------------ travis/licenses_golden/licenses_third_party | 69 +- 3 files changed, 35 insertions(+), 11397 deletions(-) diff --git a/DEPS b/DEPS index 5f00055b26ce6..125a2fe313a44 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c4952be7d401797aa6c353b57bf97132bf3d7669', + 'skia_revision': '22f673d42087853a151fcd5e95c129be83065cdc', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 4c6f819c95b1e..e69de29bb2d1d 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -1,11361 +0,0 @@ -boringssl - -Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) -All rights reserved. - -This package is an SSL implementation written -by Eric Young (eay@cryptsoft.com). -The implementation was written so as to conform with Netscapes SSL. - -This library is free for commercial and non-commercial use as long as -the following conditions are aheared to. The following conditions -apply to all code found in this distribution, be it the RC4, RSA, -lhash, DES, etc., code; not just the SSL code. The SSL documentation -included with this distribution is covered by the same copyright terms -except that the holder is Tim Hudson (tjh@cryptsoft.com). - -Copyright remains Eric Young's, and as such any Copyright notices in -the code are not to be removed. -If this package is used in a product, Eric Young should be given attribution -as the author of the parts of the library used. -This can be in the form of a textual message at program startup or -in documentation (online or textual) provided with the package. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - "This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)" - The word 'cryptographic' can be left out if the rouines from the library - being used are not cryptographic related :-). -4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an acknowledgement: - "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -The licence and distribution terms for any publically available version or -derivative of this code cannot be changed. i.e. this code cannot simply be -copied and put under another distribution licence -[including the GNU Public Licence.] --------------------------------------------------------------------------------- -boringssl - -Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -All rights reserved. - -This package is an SSL implementation written -by Eric Young (eay@cryptsoft.com). -The implementation was written so as to conform with Netscapes SSL. - -This library is free for commercial and non-commercial use as long as -the following conditions are aheared to. The following conditions -apply to all code found in this distribution, be it the RC4, RSA, -lhash, DES, etc., code; not just the SSL code. The SSL documentation -included with this distribution is covered by the same copyright terms -except that the holder is Tim Hudson (tjh@cryptsoft.com). - -Copyright remains Eric Young's, and as such any Copyright notices in -the code are not to be removed. -If this package is used in a product, Eric Young should be given attribution -as the author of the parts of the library used. -This can be in the form of a textual message at program startup or -in documentation (online or textual) provided with the package. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - "This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)" - The word 'cryptographic' can be left out if the rouines from the library - being used are not cryptographic related :-). -4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an acknowledgement: - "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -The licence and distribution terms for any publically available version or -derivative of this code cannot be changed. i.e. this code cannot simply be -copied and put under another distribution licence -[including the GNU Public Licence.] --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2001 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2003 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2004 Kungliga Tekniska Högskolan -(Royal Institute of Technology, Stockholm, Sweden). -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -3. Neither the name of the Institute nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2004 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2005 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2006 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2006,2007 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2008 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2010 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2011 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2012 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2013 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2014 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - "This product includes cryptographic software written by - Eric Young (eay@cryptsoft.com)" - The word 'cryptographic' can be left out if the rouines from the library - being used are not cryptographic related :-). -4. If you include any Windows specific code (or a derivative thereof) from - the apps directory (application code) you must include an acknowledgement: - "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -The licence and distribution terms for any publically available version or -derivative of this code cannot be changed. i.e. this code cannot simply be -copied and put under another distribution licence -[including the GNU Public Licence.] --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2014, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015 The OpenSSL Project. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015, Intel Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2016, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2017, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright (c) 2018, Google Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - licensing@OpenSSL.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - -4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - -5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - -6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - -THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2003 Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2005 Nokia. All rights reserved. - -The portions of the attached software ("Contribution") is developed by -Nokia Corporation and is licensed pursuant to the OpenSSL open source -license. - -The Contribution, originally written by Mika Kousa and Pasi Eronen of -Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites -support (see RFC 4279) to OpenSSL. - -No patent licenses or other rights except those expressly stated in -the OpenSSL open source license shall be deemed granted or received -expressly, by implication, estoppel, or otherwise. - -No assurances are provided by Nokia that the Contribution does not -infringe the patent or other intellectual property rights of any third -party or that the license provides you with all the necessary rights -to make use of the Contribution. - -THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN -ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA -SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY -OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR -OTHERWISE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2006, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2007, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2008 Google Inc. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009 Google Inc. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2012, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2014, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2015, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2016 Brian Smith. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -The MIT License (MIT) - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl -dart - -OpenSSL License - - ==================================================================== - Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - - 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - - 5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - - THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - ==================================================================== - - This product includes cryptographic software written by Eric Young - (eay@cryptsoft.com). This product includes software written by Tim - Hudson (tjh@cryptsoft.com). - -Original SSLeay License - -* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) -* All rights reserved. - -* This package is an SSL implementation written -* by Eric Young (eay@cryptsoft.com). -* The implementation was written so as to conform with Netscapes SSL. - -* This library is free for commercial and non-commercial use as long as -* the following conditions are aheared to. The following conditions -* apply to all code found in this distribution, be it the RC4, RSA, -* lhash, DES, etc., code; not just the SSL code. The SSL documentation -* included with this distribution is covered by the same copyright terms -* except that the holder is Tim Hudson (tjh@cryptsoft.com). - -* Copyright remains Eric Young's, and as such any Copyright notices in -* the code are not to be removed. -* If this package is used in a product, Eric Young should be given attribution -* as the author of the parts of the library used. -* This can be in the form of a textual message at program startup or -* in documentation (online or textual) provided with the package. - -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the copyright -* notice, this list of conditions and the following disclaimer. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* 3. All advertising materials mentioning features or use of this software -* must display the following acknowledgement: -* "This product includes cryptographic software written by -* Eric Young (eay@cryptsoft.com)" -* The word 'cryptographic' can be left out if the rouines from the library -* being used are not cryptographic related :-). -* 4. If you include any Windows specific code (or a derivative thereof) from -* the apps directory (application code) you must include an acknowledgement: -* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - -* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND -* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -* SUCH DAMAGE. - -* The licence and distribution terms for any publically available version or -* derivative of this code cannot be changed. i.e. this code cannot simply be -* copied and put under another distribution licence -* [including the GNU Public Licence.] - -ISC license used for completely new code in BoringSSL: - -/* Copyright (c) 2015, Google Inc. - - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -The code in third_party/fiat carries the MIT license: - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -Licenses for support code - -Parts of the TLS test suite are under the Go license. This code is not included -in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so -distributing code linked against BoringSSL does not trigger this license: - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -observatory_pub_packages -skia -txt -vulkan - -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. --------------------------------------------------------------------------------- -colorama - -Copyright (c) 2010 Jonathan Hartley -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holders, nor those of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2003-2005 Tom Wu -Copyright (c) 2012 Adam Singer (adam@solvr.io) -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, -INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF -THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT -OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -In addition, the following condition applies: - -All redistributions must retain an intact copy of this copyright notice -and disclaimer. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart - -Copyright 2009 The Go 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 - -Copyright 2012, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -dart -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -double-conversion - -Copyright 2006-2008 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -double-conversion - -Copyright 2010 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -double-conversion - -Copyright 2012 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright (c) 2013 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright 2017 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine - -Copyright 2018 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet - -Copyright 2013 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -icu -skia -topaz - -Copyright 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -icu -topaz - -Copyright 2014 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2016 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz - -Copyright 2017 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -garnet -topaz -txt - -Copyright 2017 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -icu -skia -topaz - -Copyright 2016 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -engine -skia -topaz - -Copyright 2018 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -files - -Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -files - -Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -files - -Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd - and Clark Cooper -Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -files - -Copyright 2000, Clark Cooper -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 1995-2002 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 1995-2002 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2001, 2002 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2001, 2002, 2003, 2004 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright (C) 2001-2008, 2011, 2013, 2014 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 1990, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000 Computing Research Labs, New Mexico State University -Copyright 2001-2004, 2011 Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000 Computing Research Labs, New Mexico State University -Copyright 2001-2014 - Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000, 2001, 2004 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000-2001, 2002 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000-2001, 2003 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2000-2010, 2012-2014 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2001, 2002, 2012 Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT -OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -Copyright 2003 by -Francesco Zappa Nardelli - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -freetype2 - -The FreeType Project LICENSE - - 2006-Jan-27 - -Copyright 1996-2002, 2006 by -David Turner, Robert Wilhelm, and Werner Lemberg - -Introduction -============ - - The FreeType Project is distributed in several archive packages; - some of them may contain, in addition to the FreeType font engine, - various tools and contributions which rely on, or relate to, the - FreeType Project. - - This license applies to all files found in such packages, and - which do not fall under their own explicit license. The license - affects thus the FreeType font engine, the test programs, - documentation and makefiles, at the very least. - - This license was inspired by the BSD, Artistic, and IJG - (Independent JPEG Group) licenses, which all encourage inclusion - and use of free software in commercial and freeware products - alike. As a consequence, its main points are that: - - o We don't promise that this software works. However, we will be - interested in any kind of bug reports. (`as is' distribution) - - o You can use this software for whatever you want, in parts or - full form, without having to pay us. (`royalty-free' usage) - - o You may not pretend that you wrote this software. If you use - it, or only parts of it, in a program, you must acknowledge - somewhere in your documentation that you have used the - FreeType code. (`credits') - - We specifically permit and encourage the inclusion of this - software, with or without modifications, in commercial products. - We disclaim all warranties covering The FreeType Project and - assume no liability related to The FreeType Project. - - Finally, many people asked us for a preferred form for a - credit/disclaimer to use in compliance with this license. We thus - encourage you to use the following text: - - Portions of this software are copyright © The FreeType - Project (www.freetype.org). All rights reserved. - - Please replace with the value from the FreeType version you - actually use. - -Legal Terms -=========== - -0. Definitions - - Throughout this license, the terms `package', `FreeType Project', - and `FreeType archive' refer to the set of files originally - distributed by the authors (David Turner, Robert Wilhelm, and - Werner Lemberg) as the `FreeType Project', be they named as alpha, - beta or final release. - - `You' refers to the licensee, or person using the project, where - `using' is a generic term including compiling the project's source - code as well as linking it to form a `program' or `executable'. - This program is referred to as `a program using the FreeType - engine'. - - This license applies to all files distributed in the original - FreeType Project, including all source code, binaries and - documentation, unless otherwise stated in the file in its - original, unmodified form as distributed in the original archive. - If you are unsure whether or not a particular file is covered by - this license, you must contact us to verify this. - - The FreeType Project is copyright (C) 1996-2000 by David Turner, - Robert Wilhelm, and Werner Lemberg. All rights reserved except as - specified below. - -1. No Warranty - - THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO - USE, OF THE FREETYPE PROJECT. - -2. Redistribution - - This license grants a worldwide, royalty-free, perpetual and - irrevocable right and license to use, execute, perform, compile, - display, copy, create derivative works of, distribute and - sublicense the FreeType Project (in both source and object code - forms) and derivative works thereof for any purpose; and to - authorize others to exercise some or all of the rights granted - herein, subject to the following conditions: - - o Redistribution of source code must retain this license file - (`FTL.TXT') unaltered; any additions, deletions or changes to - the original files must be clearly indicated in accompanying - documentation. The copyright notices of the unaltered, - original files must be preserved in all copies of source - files. - - o Redistribution in binary form must provide a disclaimer that - states that the software is based in part of the work of the - FreeType Team, in the distribution documentation. We also - encourage you to put an URL to the FreeType web page in your - documentation, though this isn't mandatory. - - These conditions apply to any software derived from or based on - the FreeType Project, not just the unmodified files. If you use - our work, you must acknowledge us. However, no fee need be paid - to us. - -3. Advertising - - Neither the FreeType authors and contributors nor you shall use - the name of the other for commercial, advertising, or promotional - purposes without specific prior written permission. - - We suggest, but do not require, that you use one or more of the - following phrases to refer to this software in your documentation - or advertising materials: `FreeType Project', `FreeType Engine', - `FreeType library', or `FreeType Distribution'. - - As you have not signed this license, you are not required to - accept it. However, as the FreeType Project is copyrighted - material, only this license, or another one contracted with the - authors, grants you the right to use, distribute, and modify it. - Therefore, by using, distributing, or modifying the FreeType - Project, you indicate that you understand and accept all the terms - of this license. - -4. Contacts - - There are two mailing lists related to FreeType: - - o freetype@nongnu.org - - Discusses general use and applications of FreeType, as well as - future and wanted additions to the library and distribution. - If you are looking for support, start in this list if you - haven't found anything to help you in the documentation. - - o freetype-devel@nongnu.org - - Discusses bugs, as well as engine internals, design issues, - specific licenses, porting, etc. - - Our home page can be found at - - http://www.freetype.org - ---- end of FTL.TXT --- --------------------------------------------------------------------------------- -garnet - -Copyright 2013 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet - -Copyright 2014 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet - -Copyright 2017 The Fuchsia Authors.All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet -topaz - -Copyright 2015 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -garnet -topaz - -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -gif - -GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! --------------------------------------------------------------------------------- -gif - -The Graphics Interchange Format(c) is the copyright property of CompuServe -Incorporated. Only CompuServe Incorporated is authorized to define, redefine, -enhance, alter, modify or change in any way the definition of the format. - -CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free -license for the use of the Graphics Interchange Format(sm) in computer -software; computer software utilizing GIF(sm) must acknowledge ownership of the -Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in -User and Technical Documentation. Computer software utilizing GIF, which is -distributed or may be distributed without User or Technical Documentation must -display to the screen or printer a message acknowledging ownership of the -Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in -this case, the acknowledgement may be displayed in an opening screen or leading -banner, or a closing screen or trailing banner. A message such as the following -may be used: - - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 1998-2004 David Turner and Werner Lemberg -Copyright © 2004,2007,2009 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 1998-2004 David Turner and Werner Lemberg -Copyright © 2004,2007,2009,2010 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 1998-2004 David Turner and Werner Lemberg -Copyright © 2006 Behdad Esfahbod -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007 Chris Wilson -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2010,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009 Red Hat, Inc. -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009,2010 Red Hat, Inc. -Copyright © 2010,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009,2010 Red Hat, Inc. -Copyright © 2010,2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2007,2008,2009,2010 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2009 Keith Stribley -Copyright © 2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2011 Codethink Limited -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2011 Codethink Limited -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2010,2011,2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2010,2011,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2009,2010 Red Hat, Inc. -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010 Red Hat, Inc. -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2011,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2010,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2012,2014 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2011,2014 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012 Mozilla Foundation. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2012,2013 Mozilla Foundation. -Copyright © 2012,2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2013 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2013 Red Hat, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2014 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2015 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2015 Mozilla Foundation. -Copyright © 2015 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2016 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2016 Igalia S.L. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -Copyright © 2017 Google, Inc. - - This is part of HarfBuzz, a text shaping library. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -harfbuzz - -HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. -For parts of HarfBuzz that are licensed under different licenses see individual -files names COPYING in subdirectories where applicable. - -Copyright © 2010,2011,2012 Google, Inc. -Copyright © 2012 Mozilla Foundation -Copyright © 2011 Codethink Limited -Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) -Copyright © 2009 Keith Stribley -Copyright © 2009 Martin Hosken and SIL International -Copyright © 2007 Chris Wilson -Copyright © 2006 Behdad Esfahbod -Copyright © 2005 David Turner -Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. -Copyright © 1998-2004 David Turner and Werner Lemberg - -For full copyright notices consult the individual files in the package. - -Permission is hereby granted, without written agreement and without -license or royalty fees, to use, copy, modify, and distribute this -software and its documentation for any purpose, provided that the -above copyright notice and the following two paragraphs appear in -all copies of this software. - -IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1995-2016 International Business Machines Corporation and others -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. - -All trademarks and registered trademarks mentioned herein are the -property of their respective owners. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1998 - 1999 Unicode, Inc. All Rights reserved. - Copyright (C) 2002-2005, International Business Machines - Corporation and others. All Rights Reserved. - -This file is provided as-is by Unicode, Inc. (The Unicode Consortium). -No claims are made as to fitness for any particular purpose. No -warranties of any kind are expressed or implied. The recipient -agrees to determine applicability of information provided. If this -file has been provided on optical media by Unicode, Inc., the sole -remedy for any claim will be exchange of defective media within 90 -days of receipt. - -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form for -internal or external distribution as long as this notice remains -attached. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1999 Computer Systems and Communication Lab, - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) 1999 Unicode, Inc. All Rights reserved. - Copyright (C) 2002-2005, International Business Machines - Corporation and others. All Rights Reserved. - -This file is provided as-is by Unicode, Inc. (The Unicode Consortium). -No claims are made as to fitness for any particular purpose. No -warranties of any kind are expressed or implied. The recipient -agrees to determine applicability of information provided. If this -file has been provided on optical media by Unicode, Inc., the sole -remedy for any claim will be exchange of defective media within 90 -days of receipt. - -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form for -internal or external distribution as long as this notice remains -attached. --------------------------------------------------------------------------------- -icu - -Copyright (c) 2002 Unicode, Inc. All Rights reserved. - Copyright (C) 2002-2005, International Business Machines - Corporation and others. All Rights Reserved. - -This file is provided as-is by Unicode, Inc. (The Unicode Consortium). -No claims are made as to fitness for any particular purpose. No -warranties of any kind are expressed or implied. The recipient -agrees to determine applicability of information provided. If this -file has been provided on optical media by Unicode, Inc., the sole -remedy for any claim will be exchange of defective media within 90 -days of receipt. - -Unicode, Inc. hereby grants the right to freely use the information -supplied in this file in the creation of products supporting the -Unicode Standard, and to make copies of this file in any form for -internal or external distribution as long as this notice remains -attached. --------------------------------------------------------------------------------- -icu - -Copyright (c) 2013 International Business Machines Corporation -and others. All Rights Reserved. - -Project: http://code.google.com/p/lao-dictionary -Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt -License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt - (copied below) - - This file is derived from the above dictionary, with slight - modifications. - - Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, - are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. Redistributions in - binary form must reproduce the above copyright notice, this list of - conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) 2014 International Business Machines Corporation -and others. All Rights Reserved. - -This list is part of a project hosted at: - github.com/kanyawtech/myanmar-karen-word-lists - -Copyright (c) 2013, LeRoy Benjamin Sharon -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: Redistributions of source code must retain the above -copyright notice, this list of conditions and the following -disclaimer. Redistributions in binary form must reproduce the -above copyright notice, this list of conditions and the following -disclaimer in the documentation and/or other materials provided -with the distribution. - - Neither the name Myanmar Karen Word Lists, nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2010. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2011. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2012. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2014. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright (c) IBM Corporation, 2000-2016. All rights reserved. - - Institute of Information Science, Academia - * Sinica. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the Computer Systems and Communication Lab - nor the names of its contributors may be used to endorse or - promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Copyright 1996 Chih-Hao Tsai @ Beckman Institute, - University of Illinois -c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 --------------------------------------------------------------------------------- -icu - -Copyright 2000, 2001, 2002, 2003 Nara Institute of Science -and Technology. All Rights Reserved. - -Use, reproduction, and distribution of this software is permitted. -Any copy of this software, whether in its original form or modified, -must include both the above copyright notice and the following -paragraphs. - -Nara Institute of Science and Technology (NAIST), -the copyright holders, disclaims all warranties with regard to this -software, including all implied warranties of merchantability and -fitness, in no event shall NAIST be liable for -any special, indirect or consequential damages or any damages -whatsoever resulting from loss of use, data or profits, whether in an -action of contract, negligence or other tortuous action, arising out -of or in connection with the use or performance of this software. - -A large portion of the dictionary entries -originate from ICOT Free Software. The following conditions for ICOT -Free Software applies to the current dictionary as well. - -Each User may also freely distribute the Program, whether in its -original form or modified, to any third party or parties, PROVIDED -that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear -on, or be attached to, the Program, which is distributed substantially -in the same form as set out herein and that such intended -distribution, if actually made, will neither violate or otherwise -contravene any of the laws and regulations of the countries having -jurisdiction over the User or the intended distribution itself. - -NO WARRANTY - -The program was produced on an experimental basis in the course of the -research and development conducted during the project and is provided -to users as so produced on an experimental basis. Accordingly, the -program is provided without any warranty whatsoever, whether express, -implied, statutory or otherwise. The term "warranty" used herein -includes, but is not limited to, any warranty of the quality, -performance, merchantability and fitness for a particular purpose of -the program and the nonexistence of any infringement or violation of -any right of any third party. - -Each user of the program will agree and understand, and be deemed to -have agreed and understood, that there is no warranty whatsoever for -the program and, accordingly, the entire risk arising from or -otherwise connected with the program is assumed by the user. - -Therefore, neither ICOT, the copyright holder, or any other -organization that participated in or was otherwise related to the -development of the program and their respective officials, directors, -officers and other employees shall be held liable for any and all -damages, including, without limitation, general, special, incidental -and consequential damages, arising out of or otherwise in connection -with the use or inability to use the program or any product, material -or result produced or otherwise obtained by using the program, -regardless of whether they have been advised of, or otherwise had -knowledge of, the possibility of such damages at any time during the -project or thereafter. Each user will be deemed to have agreed to the -foregoing by his or her commencement of use of the program. The term -"use" as used herein includes, but is not limited to, the use, -modification, copying and distribution of the program and the -production of secondary products from the program. - -In the case where the program, whether in its original form or -modified, was distributed or delivered to or received by a user from -any person, organization or entity other than ICOT, unless it makes or -grants independently of ICOT any specific warranty to the user in -writing, such person, organization or entity, will also be exempted -from and not be held liable to the user for any such damages as noted -above as far as the program is concerned. --------------------------------------------------------------------------------- -icu - -Copyright © 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. --------------------------------------------------------------------------------- -icu - -Copyrighy (c) 1999 TaBE Project. -Copyright (c) 1999 Pai-Hsiang Hsiao. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. -. Neither the name of the TaBE Project nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -ICU License - ICU 1.8.1 and later - -COPYRIGHT AND PERMISSION NOTICE - -Copyright (c) 1995-2009 International Business Machines Corporation and others - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, and/or sell copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies of -the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY -SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF -CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, use -or other dealings in this Software without prior written authorization -of the copyright holder. --------------------------------------------------------------------------------- -icu - -The BSD License -http://opensource.org/licenses/bsd-license.php -Copyright (C) 2006-2008, Google Inc. - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following -disclaimer in the documentation and/or other materials provided with -the distribution. - Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -icu - -Unicode® Terms of Use -For the general privacy policy governing access to this site, see the Unicode Privacy Policy. For trademark usage, see the Unicode® Consortium Name and Trademark Usage Policy. - -A. Unicode Copyright. -1. Copyright © 1991-2017 Unicode, Inc. All rights reserved. -2. Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. -3. Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files solely for informational purposes and in the creation of products supporting the Unicode Standard, subject to the Terms and Conditions herein. -4. Further specifications of rights and restrictions pertaining to the use of the particular set of data files known as the "Unicode Character Database" can be found in the License. -5. Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. The online code charts carry specific restrictions. All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. -6. No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. -7. Modification is not permitted with respect to this document. All copies of this document must be verbatim. -B. Restricted Rights Legend. Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. -C. Warranties and Disclaimers. -1. This publication and/or website may include technical or typographical errors or other inaccuracies . Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. -2. If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. -3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. -D. Waiver of Damages. In no event shall Unicode or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. -E. Trademarks & Logos. -1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. -2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. -3. All third party trademarks referenced herein are the property of their respective owners. -F. Miscellaneous. -1. Jurisdiction and Venue. This server is operated from a location in the State of California, United States of America. Unicode makes no representation that the materials are appropriate for use in other locations. If you access this server from other locations, you are responsible for compliance with local laws. This Agreement, all use of this site and any claims and damages resulting from use of this site are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this site shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. -2. Modification by Unicode Unicode shall have the right to modify this Agreement at any time by posting it to this site. The user may not assign any part of this Agreement without Unicode’s prior written consent. -3. Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. -4. Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. -5. Entire Agreement. This Agreement constitutes the entire agreement between the parties. - -EXHIBIT 1 -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - -Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and -http://www.unicode.org/utility/trac/browser/. - -Unicode Data Files do not include PDF online code charts under the -directory http://www.unicode.org/Public/. - -Software includes any source code published in the Unicode Standard -or under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and -http://www.unicode.org/utility/trac/browser/. - -NOTICE TO USER: Carefully read the following legal agreement. -BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S -DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), -YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE -TERMS AND CONDITIONS OF THIS AGREEMENT. -IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE -THE DATA FILES OR SOFTWARE. - -COPYRIGHT AND PERMISSION NOTICE - -Copyright © 1991-2017 Unicode, Inc. All rights reserved. -Distributed under the Terms of Use in http://www.unicode.org/copyright.html. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Unicode data files and any associated documentation -(the "Data Files") or Unicode software and any associated documentation -(the "Software") to deal in the Data Files or Software -without restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that either -(a) this copyright and permission notice appear with all copies -of the Data Files or Software, or -(b) this copyright and permission notice appear in associated -Documentation. - -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT OF THIRD PARTY RIGHTS. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder -shall not be used in advertising or otherwise to promote the sale, -use or other dealings in these Data Files or Software without prior -written authorization of the copyright holder. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009-2011, 2014-2016, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). -All Rights Reserved. -Author: Siarhei Siamashka -Copyright (C) 2013-2014, Linaro Limited. All Rights Reserved. -Author: Ragesh Radhakrishnan -Copyright (C) 2014-2016, D. R. Commander. All Rights Reserved. -Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. -Copyright (C) 2016, Siarhei Siamashka. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). -All Rights Reserved. -Author: Siarhei Siamashka -Copyright (C) 2014, Siarhei Siamashka. All Rights Reserved. -Copyright (C) 2014, Linaro Limited. All Rights Reserved. -Copyright (C) 2015, D. R. Commander. All Rights Reserved. -Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2011, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2013, MIPS Technologies, Inc., California. -All Rights Reserved. -Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) - Darko Laus (darko.laus@imgtec.com) -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2013-2014, MIPS Technologies, Inc., California. -All Rights Reserved. -Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) - Darko Laus (darko.laus@imgtec.com) -Copyright (C) 2015, D. R. Commander. All Rights Reserved. -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2014, D. R. Commander. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. -Copyright (C) 2014, Jay Foad. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C) 2015, D. R. Commander. All Rights Reserved. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2009-2014 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2009-2015 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2009-2016 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2011 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2011, 2015 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright (C)2011-2016 D. R. Commander. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -- Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -- Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -- Neither the name of the libjpeg-turbo Project nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. -Copyright (C) 2015-2016, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014, 2016, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014, D. R. Commander. -Copyright (C) 2013-2014, MIPS Technologies, Inc., California. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2009-2011, 2014-2015, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2010, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library - version 1.02 - -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2011, 2014, D. R. Commander. -Copyright (C) 2015, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2011, 2014-2016, D. R. Commander. -Copyright (C) 2013-2014, MIPS Technologies, Inc., California. -Copyright (C) 2014, Linaro Limited. -Copyright (C) 2015-2016, Matthieu Darbois. - -Based on the x86 SIMD extension for IJG JPEG library, -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009 Pierre Ossman for Cendio AB -Copyright (C) 2011, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009, 2012 Pierre Ossman for Cendio AB -Copyright (C) 2009, 2012, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -Copyright 2009, 2012 Pierre Ossman for Cendio AB -Copyright (C) 2012, D. R. Commander. - -Based on the x86 SIMD extension for IJG JPEG library -Copyright (C) 1999-2006, MIYASAKA Masaru. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -libjpeg-turbo - -libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project -to include only information relevant to libjpeg-turbo, to wordsmith certain -sections, and to remove impolitic language that existed in the libjpeg v8 -README. It is included only for reference. Please see README.md for -information specific to libjpeg-turbo. - -The Independent JPEG Group's JPEG software -========================================== - -This distribution contains a release of the Independent JPEG Group's free JPEG -software. You are welcome to redistribute this software and to use it for any -purpose, subject to the conditions under LEGAL ISSUES, below. - -This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, -Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, -Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, -and other members of the Independent JPEG Group. - -IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee -(also known as JPEG, together with ITU-T SG16). - -DOCUMENTATION ROADMAP -===================== - -This file contains the following sections: - -OVERVIEW General description of JPEG and the IJG software. -LEGAL ISSUES Copyright, lack of warranty, terms of distribution. -REFERENCES Where to learn more about JPEG. -ARCHIVE LOCATIONS Where to find newer versions of this software. -FILE FORMAT WARS Software *not* to get. -TO DO Plans for future IJG releases. - -Other documentation files in the distribution are: - -User documentation: - usage.txt Usage instructions for cjpeg, djpeg, jpegtran, - rdjpgcom, and wrjpgcom. - *.1 Unix-style man pages for programs (same info as usage.txt). - wizard.txt Advanced usage instructions for JPEG wizards only. - change.log Version-to-version change highlights. -Programmer and internal documentation: - libjpeg.txt How to use the JPEG library in your own programs. - example.c Sample code for calling the JPEG library. - structure.txt Overview of the JPEG library's internal structure. - coderules.txt Coding style rules --- please read if you contribute code. - -Please read at least usage.txt. Some information can also be found in the JPEG -FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find -out where to obtain the FAQ article. - -If you want to understand how the JPEG code works, we suggest reading one or -more of the REFERENCES, then looking at the documentation files (in roughly -the order listed) before diving into the code. - -OVERVIEW -======== - -This package contains C software to implement JPEG image encoding, decoding, -and transcoding. JPEG (pronounced "jay-peg") is a standardized compression -method for full-color and grayscale images. JPEG's strong suit is compressing -photographic images or other types of images that have smooth color and -brightness transitions between neighboring pixels. Images with sharp lines or -other abrupt features may not compress well with JPEG, and a higher JPEG -quality may have to be used to avoid visible compression artifacts with such -images. - -JPEG is lossy, meaning that the output pixels are not necessarily identical to -the input pixels. However, on photographic content and other "smooth" images, -very good compression ratios can be obtained with no visible compression -artifacts, and extremely high compression ratios are possible if you are -willing to sacrifice image quality (by reducing the "quality" setting in the -compressor.) - -This software implements JPEG baseline, extended-sequential, and progressive -compression processes. Provision is made for supporting all variants of these -processes, although some uncommon parameter settings aren't implemented yet. -We have made no provision for supporting the hierarchical or lossless -processes defined in the standard. - -We provide a set of library routines for reading and writing JPEG image files, -plus two sample applications "cjpeg" and "djpeg", which use the library to -perform conversion between JPEG and some other popular image file formats. -The library is intended to be reused in other applications. - -In order to support file conversion and viewing software, we have included -considerable functionality beyond the bare JPEG coding/decoding capability; -for example, the color quantization modules are not strictly part of JPEG -decoding, but they are essential for output to colormapped file formats or -colormapped displays. These extra functions can be compiled out of the -library if not required for a particular application. - -We have also included "jpegtran", a utility for lossless transcoding between -different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple -applications for inserting and extracting textual comments in JFIF files. - -The emphasis in designing this software has been on achieving portability and -flexibility, while also making it fast enough to be useful. In particular, -the software is not intended to be read as a tutorial on JPEG. (See the -REFERENCES section for introductory material.) Rather, it is intended to -be reliable, portable, industrial-strength code. We do not claim to have -achieved that goal in every aspect of the software, but we strive for it. - -We welcome the use of this software as a component of commercial products. -No royalty is required, but we do ask for an acknowledgement in product -documentation, as described under LEGAL ISSUES. - -LEGAL ISSUES -============ - -In plain English: - -1. We don't promise that this software works. (But if you find any bugs, - please let us know!) -2. You can use this software for whatever you want. You don't have to pay us. -3. You may not pretend that you wrote this software. If you use it in a - program, you must acknowledge somewhere in your documentation that - you've used the IJG code. - -In legalese: - -The authors make NO WARRANTY or representation, either express or implied, -with respect to this software, its quality, accuracy, merchantability, or -fitness for a particular purpose. This software is provided "AS IS", and you, -its user, assume the entire risk as to its quality and accuracy. - -This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. -All Rights Reserved except as specified below. - -Permission is hereby granted to use, copy, modify, and distribute this -software (or portions thereof) for any purpose, without fee, subject to these -conditions: -(1) If any part of the source code for this software is distributed, then this -README file must be included, with this copyright and no-warranty notice -unaltered; and any additions, deletions, or changes to the original files -must be clearly indicated in accompanying documentation. -(2) If only executable code is distributed, then the accompanying -documentation must state that "this software is based in part on the work of -the Independent JPEG Group". -(3) Permission for use of this software is granted only if the user accepts -full responsibility for any undesirable consequences; the authors accept -NO LIABILITY for damages of any kind. - -These conditions apply to any software derived from or based on the IJG code, -not just to the unmodified library. If you use our work, you ought to -acknowledge us. - -Permission is NOT granted for the use of any IJG author's name or company name -in advertising or publicity relating to this software or products derived from -it. This software may be referred to only as "the Independent JPEG Group's -software". - -We specifically permit and encourage the use of this software as the basis of -commercial products, provided that all warranty or liability claims are -assumed by the product vendor. - -The Unix configuration script "configure" was produced with GNU Autoconf. -It is copyright by the Free Software Foundation but is freely distributable. -The same holds for its supporting scripts (config.guess, config.sub, -ltmain.sh). Another support script, install-sh, is copyright by X Consortium -but is also freely distributable. - -The IJG distribution formerly included code to read and write GIF files. -To avoid entanglement with the Unisys LZW patent (now expired), GIF reading -support has been removed altogether, and the GIF writer has been simplified -to produce "uncompressed GIFs". This technique does not use the LZW -algorithm; the resulting GIF files are larger than usual, but are readable -by all standard GIF decoders. - -We are required to state that - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." - -REFERENCES -========== - -We recommend reading one or more of these references before trying to -understand the innards of the JPEG software. - -The best short technical introduction to the JPEG compression algorithm is - Wallace, Gregory K. "The JPEG Still Picture Compression Standard", - Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. -(Adjacent articles in that issue discuss MPEG motion picture compression, -applications of JPEG, and related topics.) If you don't have the CACM issue -handy, a PDF file containing a revised version of Wallace's article is -available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually -a preprint for an article that appeared in IEEE Trans. Consumer Electronics) -omits the sample images that appeared in CACM, but it includes corrections -and some added material. Note: the Wallace article is copyright ACM and IEEE, -and it may not be used for commercial purposes. - -A somewhat less technical, more leisurely introduction to JPEG can be found in -"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by -M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides -good explanations and example C code for a multitude of compression methods -including JPEG. It is an excellent source if you are comfortable reading C -code but don't know much about data compression in general. The book's JPEG -sample code is far from industrial-strength, but when you are ready to look -at a full implementation, you've got one here... - -The best currently available description of JPEG is the textbook "JPEG Still -Image Data Compression Standard" by William B. Pennebaker and Joan L. -Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. -Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG -standards (DIS 10918-1 and draft DIS 10918-2). - -The original JPEG standard is divided into two parts, Part 1 being the actual -specification, while Part 2 covers compliance testing methods. Part 1 is -titled "Digital Compression and Coding of Continuous-tone Still Images, -Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS -10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of -Continuous-tone Still Images, Part 2: Compliance testing" and has document -numbers ISO/IEC IS 10918-2, ITU-T T.83. - -The JPEG standard does not specify all details of an interchangeable file -format. For the omitted details we follow the "JFIF" conventions, revision -1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report -and thus received a formal publication status. It is available as a free -download in PDF format from -http://www.ecma-international.org/publications/techreports/E-TR-098.htm. -A PostScript version of the JFIF document is available at -http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at -http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures. - -The TIFF 6.0 file format specification can be obtained by FTP from -ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme -found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. -IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). -Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 -(Compression tag 7). Copies of this Note can be obtained from -http://www.ijg.org/files/. It is expected that the next revision -of the TIFF spec will replace the 6.0 JPEG design with the Note's design. -Although IJG's own code does not support TIFF/JPEG, the free libtiff library -uses our library to implement TIFF/JPEG per the Note. - -ARCHIVE LOCATIONS -================= - -The "official" archive site for this software is www.ijg.org. -The most recent released version can always be found there in -directory "files". - -The JPEG FAQ (Frequently Asked Questions) article is a source of some -general information about JPEG. -It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq -and other news.answers archive sites, including the official news.answers -archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. -If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu -with body - send usenet/news.answers/jpeg-faq/part1 - send usenet/news.answers/jpeg-faq/part2 - -FILE FORMAT WARS -================ - -The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together -with ITU-T SG16) currently promotes different formats containing the name -"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does -not support these formats (see REFERENCES). Indeed, one of the original -reasons for developing this free software was to help force convergence on -common, interoperable format standards for JPEG files. -Don't use an incompatible file format! -(In any case, our decoder will remain capable of reading existing JPEG -image files indefinitely.) - -TO DO -===== - -Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. --------------------------------------------------------------------------------- -libsdl -skia - -Copyright 2016 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright (c) 2010, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2010 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2011 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2012 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2013 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2014 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2015 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2016 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -libwebp - -Copyright 2017 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2006-2012 The Authors - -Contributors: -James Graham - jg307@cam.ac.uk -Anne van Kesteren - annevankesteren@gmail.com -Lachlan Hunt - lachlan.hunt@lachy.id.au -Matt McDonald - kanashii@kanashii.ca -Sam Ruby - rubys@intertwingly.net -Ian Hickson (Google) - ian@hixie.ch -Thomas Broyer - t.broyer@ltgt.net -Jacques Distler - distler@golem.ph.utexas.edu -Henri Sivonen - hsivonen@iki.fi -Adam Barth - abarth@webkit.org -Eric Seidel - eric@webkit.org -The Mozilla Foundation (contributions from Henri Sivonen since 2008) -David Flanagan (Mozilla) - dflanagan@mozilla.com -Google Inc. (contributed the Dart port) - misc@dartlang.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2013, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014 Seth Ladd. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014, Michael Bostock and Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. -Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2017, the Dart project authors. -Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2013, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2014, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2015, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - -Copyright 2016, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages -pkg - -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -rapidjson - -Copyright (c) 2006-2013 Alexander Chemeris - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the product nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -rapidjson - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -root_certificates - -Mozilla Public License -Version 2.0 - -1. Definitions - -1.1. “Contributor” - -means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. - -1.2. “Contributor Version” - -means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. - -1.3. “Contribution” - -means Covered Software of a particular Contributor. - -1.4. “Covered Software” - -means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. - -1.5. “Incompatible With Secondary Licenses” - -means - - a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. - -1.6. “Executable Form” - -means any form of the work other than Source Code Form. - -1.7. “Larger Work” - -means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. - -1.8. “License” - -means this document. - -1.9. “Licensable” - -means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. - -1.10. “Modifications” - -means any of the following: - - a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. “Patent Claims” of a Contributor - -means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. - -1.12. “Secondary License” - -means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. - -1.13. “Source Code Form” - -means the form of the work preferred for making modifications. - -1.14. “You” (or “Your”) - -means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. - -2. License Grants and Conditions - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or - - c. under Patent Claims infringed by Covered Software in the absence of its Contributions. - -This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. - -3. Responsibilities - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. - -8. Litigation - -Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. - -9. Miscellaneous - -This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. - -10. Versions of the License - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - -If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - “Incompatible With Secondary Licenses” Notice - - This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. --------------------------------------------------------------------------------- -root_certificates - -Mozilla Public License Version 2.0 -================================== - -1. Definitions - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -* 6. Disclaimer of Warranty - -* Covered Software is provided under this License on an "as is" -* basis, without warranty of any kind, either expressed, implied, or -* statutory, including, without limitation, warranties that the -* Covered Software is free of defects, merchantable, fit for a -* particular purpose or non-infringing. The entire risk as to the -* quality and performance of the Covered Software is with You. -* Should any Covered Software prove defective in any respect, You -* (not any Contributor) assume the cost of any necessary servicing, -* repair, or correction. This disclaimer of warranty constitutes an -* essential part of this License. No use of any Covered Software is -* authorized under this License except under this disclaimer. - -* 7. Limitation of Liability - -* Under no circumstances and under no legal theory, whether tort -* (including negligence), contract, or otherwise, shall any -* Contributor, or anyone who distributes Covered Software as -* permitted above, be liable to You for any direct, indirect, -* special, incidental, or consequential damages of any character -* including, without limitation, damages for lost profits, loss of -* goodwill, work stoppage, computer failure or malfunction, or any -* and all other commercial damages or losses, even if such party -* shall have been informed of the possibility of such damages. This -* limitation of liability shall not apply to liability for death or -* personal injury resulting from such party's negligence to the -* extent applicable law prohibits such limitation. Some -* jurisdictions do not allow the exclusion or limitation of -* incidental or consequential damages, so this exclusion and -* limitation may not apply to You. - -8. Litigation - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. --------------------------------------------------------------------------------- -skcms - -Copyright (c) 2018 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skcms -skia -vulkanmemoryallocator - -Copyright 2018 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2011 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2014 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2014-2016 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and/or associated documentation files (the "Materials"), -to deal in the Materials without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Materials, and to permit persons to whom the -Materials are furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Materials. --------------------------------------------------------------------------------- -skia - -Copyright (c) 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2005 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2006 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2006-2012 The Android Open Source Project -Copyright 2012 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2007 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2008 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2008 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2009 Motorola - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2009 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2009-2015 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2010 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2010 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2011 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2011 Google Inc. -Copyright 2012 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2011 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2012 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2012 Intel Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2012 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2013 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2013 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2014 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2014 Google Inc. -Copyright 2017 ARM Ltd. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2014 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2015 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2015 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2016 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2016 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2017 ARM Ltd. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2017 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2018 Google LLC - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2018 Google, LLC - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -Copyright 2018 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - -NEON optimized code (C) COPYRIGHT 2009 Motorola - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -tcmalloc - -Copyright (c) 2003, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -tcmalloc - -Copyright (c) 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -topaz - -Copyright 2016 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -topaz - -Copyright 2017 Th%e Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -vulkanmemoryallocator - -Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2003, 2010 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2003, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2005 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2005, 2010 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2005, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2006, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2007 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2008, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2009 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly -detect_data_type() function provided freely by Cosmin Truta, 2006 - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Jean-loup Gailly. - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1995-2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - -Modifications for Zip64 support -Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - -For more info read MiniZip_info.txt - -Condition of use and distribution are the same than zlib : - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) - -Modifications of Unzip for Zip64 -Copyright (C) 2007-2008 Even Rouault - -Modifications for Zip64 support on both zip and unzip -Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) - -For more info read MiniZip_info.txt - -Condition of use and distribution are the same than zlib : - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2004, 2005, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2004, 2010 Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation -Authors: - Arjan van de Ven - Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation. All rights reserved. -Author: - Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2013 Intel Corporation. All rights reserved. -Authors: - Wajdi Feghali - Jim Guilford - Vinodh Gopal - Erdinc Ozturk - Jim Kukunas - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (C) 2014 Intel Corporation - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- -zlib - -Copyright (c) 2011 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -zlib - -Copyright (c) 2012 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -zlib - -zlib.h -- interface of the 'zlib' general purpose compression library -version 1.2.4, March 14th, 2010 - -Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. -2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. -3. This notice may not be removed or altered from any source distribution. - -Jean-loup Gailly -Mark Adler diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1cf5d8444b0b9..b987ae2f4fce3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4d1a25961629656b63759ae764baaa8f +Signature: 86ad0fe037823a9abc6fe55c29d29bbd UNUSED LICENSES: @@ -17212,7 +17212,6 @@ FILE: ../../../third_party/skia/modules/sksg/src/SkSGText.cpp FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp -FILE: ../../../third_party/skia/src/codec/SkColorTable.cpp FILE: ../../../third_party/skia/src/core/SkBlurPriv.h FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp FILE: ../../../third_party/skia/src/core/SkColorSpaceXformSteps.cpp @@ -18512,9 +18511,9 @@ FILE: ../../../third_party/skia/include/utils/SkNullCanvas.h FILE: ../../../third_party/skia/samplecode/SampleAnimBlur.cpp FILE: ../../../third_party/skia/samplecode/SampleFatBits.cpp FILE: ../../../third_party/skia/samplecode/SampleQuadStroker.cpp +FILE: ../../../third_party/skia/src/codec/SkColorTable.h FILE: ../../../third_party/skia/src/core/SkAnnotation.cpp FILE: ../../../third_party/skia/src/core/SkBBoxHierarchy.h -FILE: ../../../third_party/skia/src/core/SkColorTable.h FILE: ../../../third_party/skia/src/core/SkDeviceProfile.cpp FILE: ../../../third_party/skia/src/core/SkDeviceProfile.h FILE: ../../../third_party/skia/src/core/SkFontDescriptor.cpp @@ -20547,40 +20546,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/codec/SkGifCodec.cpp -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/codec/SkGifCodec.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkBitmapProcState_filter.h + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/src/codec/SkColorTable.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/codec/SkColorTable.cpp FILE: ../../../third_party/skia/src/core/SkBitmapProcState_filter.h -FILE: ../../../third_party/skia/src/core/SkColorTable.cpp FILE: ../../../third_party/skia/src/core/SkCubicClipper.cpp FILE: ../../../third_party/skia/src/core/SkCubicClipper.h FILE: ../../../third_party/skia/src/core/SkEdgeClipper.cpp @@ -20623,6 +20592,36 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/codec/SkGifCodec.cpp +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/codec/SkGifCodec.cpp +---------------------------------------------------------------------------------------------------- +Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp + ../../../third_party/skia/LICENSE From bc7949980572d0936600d58d3897f4d79f69feca Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 1 Jun 2018 12:44:52 -0400 Subject: [PATCH 0494/1190] Roll src/third_party/skia 22f673d..7abeb28 (9 commits) (#5439) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 11361 ++++++++++++++++++ travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 11363 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 125a2fe313a44..1b96da4cb2ec9 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '22f673d42087853a151fcd5e95c129be83065cdc', + 'skia_revision': '7abeb28342078af39b19a1448d6147c7258f5203', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index e69de29bb2d1d..4c6f819c95b1e 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -0,0 +1,11361 @@ +boringssl + +Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] +-------------------------------------------------------------------------------- +boringssl + +Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000-2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2001 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2003 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2004 Kungliga Tekniska Högskolan +(Royal Institute of Technology, Stockholm, Sweden). +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the Institute nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2004 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2005 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2006 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2006,2007 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2008 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2010 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2012 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2013 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2014 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2014, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015, Intel Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2016, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2017, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright (c) 2018, Google Inc. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + licensing@OpenSSL.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2003 Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2005 Nokia. All rights reserved. + +The portions of the attached software ("Contribution") is developed by +Nokia Corporation and is licensed pursuant to the OpenSSL open source +license. + +The Contribution, originally written by Mika Kousa and Pasi Eronen of +Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites +support (see RFC 4279) to OpenSSL. + +No patent licenses or other rights except those expressly stated in +the OpenSSL open source license shall be deemed granted or received +expressly, by implication, estoppel, or otherwise. + +No assurances are provided by Nokia that the Contribution does not +infringe the patent or other intellectual property rights of any third +party or that the license provides you with all the necessary rights +to make use of the Contribution. + +THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN +ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA +SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY +OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR +OTHERWISE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2005, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2006, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2007, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2008 Google Inc. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2008, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009 Google Inc. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2012, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2014, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2015, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2016 Brian Smith. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +The MIT License (MIT) + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl +dart + +OpenSSL License + + ==================================================================== + Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + + 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + + 5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + + THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ==================================================================== + + This product includes cryptographic software written by Eric Young + (eay@cryptsoft.com). This product includes software written by Tim + Hudson (tjh@cryptsoft.com). + +Original SSLeay License + +* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +* All rights reserved. + +* This package is an SSL implementation written +* by Eric Young (eay@cryptsoft.com). +* The implementation was written so as to conform with Netscapes SSL. + +* This library is free for commercial and non-commercial use as long as +* the following conditions are aheared to. The following conditions +* apply to all code found in this distribution, be it the RC4, RSA, +* lhash, DES, etc., code; not just the SSL code. The SSL documentation +* included with this distribution is covered by the same copyright terms +* except that the holder is Tim Hudson (tjh@cryptsoft.com). + +* Copyright remains Eric Young's, and as such any Copyright notices in +* the code are not to be removed. +* If this package is used in a product, Eric Young should be given attribution +* as the author of the parts of the library used. +* This can be in the form of a textual message at program startup or +* in documentation (online or textual) provided with the package. + +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* 1. Redistributions of source code must retain the copyright +* notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* 3. All advertising materials mentioning features or use of this software +* must display the following acknowledgement: +* "This product includes cryptographic software written by +* Eric Young (eay@cryptsoft.com)" +* The word 'cryptographic' can be left out if the rouines from the library +* being used are not cryptographic related :-). +* 4. If you include any Windows specific code (or a derivative thereof) from +* the apps directory (application code) you must include an acknowledgement: +* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +* SUCH DAMAGE. + +* The licence and distribution terms for any publically available version or +* derivative of this code cannot be changed. i.e. this code cannot simply be +* copied and put under another distribution licence +* [including the GNU Public Licence.] + +ISC license used for completely new code in BoringSSL: + +/* Copyright (c) 2015, Google Inc. + + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +The code in third_party/fiat carries the MIT license: + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Licenses for support code + +Parts of the TLS test suite are under the Go license. This code is not included +in BoringSSL (i.e. libcrypto and libssl) when compiled, however, so +distributing code linked against BoringSSL does not trigger this license: + +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +observatory_pub_packages +skia +txt +vulkan + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +-------------------------------------------------------------------------------- +colorama + +Copyright (c) 2010 Jonathan Hartley +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holders, nor those of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2003-2005 Tom Wu +Copyright (c) 2012 Adam Singer (adam@solvr.io) +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, +INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF +THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +In addition, the following condition applies: + +All redistributions must retain an intact copy of this copyright notice +and disclaimer. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart + +Copyright 2009 The Go 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 + +Copyright 2012, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +dart +observatory_pub_packages + +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +double-conversion + +Copyright 2006-2008 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +double-conversion + +Copyright 2010 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +double-conversion + +Copyright 2012 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + +Copyright (c) 2013 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + +Copyright 2017 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine + +Copyright 2018 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet + +Copyright 2013 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +icu +skia +topaz + +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +icu +topaz + +Copyright 2014 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz + +Copyright 2016 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz + +Copyright 2017 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +garnet +topaz +txt + +Copyright 2017 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +icu +skia +topaz + +Copyright 2016 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +engine +skia +topaz + +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +files + +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +files + +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +files + +Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper +Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +files + +Copyright 2000, Clark Cooper +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 1995-2002 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2000, 2001, 2002, 2003, 2006, 2010 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001, 2002 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001, 2002, 2003, 2004 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright (C) 2001-2008, 2011, 2013, 2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 1990, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000 Computing Research Labs, New Mexico State University +Copyright 2001-2004, 2011 Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000 Computing Research Labs, New Mexico State University +Copyright 2001-2014 + Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000, 2001, 2004 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000-2001, 2002 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000-2001, 2003 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2000-2010, 2012-2014 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2001, 2002, 2012 Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +Copyright 2003 by +Francesco Zappa Nardelli + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +freetype2 + +The FreeType Project LICENSE + + 2006-Jan-27 + +Copyright 1996-2002, 2006 by +David Turner, Robert Wilhelm, and Werner Lemberg + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + + Please replace with the value from the FreeType version you + actually use. + +Legal Terms +=========== + +0. Definitions + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + http://www.freetype.org + +--- end of FTL.TXT --- +-------------------------------------------------------------------------------- +garnet + +Copyright 2013 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet + +Copyright 2014 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet + +Copyright 2017 The Fuchsia Authors.All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet +topaz + +Copyright 2015 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +garnet +topaz + +Copyright 2018 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +gif + +GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +-------------------------------------------------------------------------------- +gif + +The Graphics Interchange Format(c) is the copyright property of CompuServe +Incorporated. Only CompuServe Incorporated is authorized to define, redefine, +enhance, alter, modify or change in any way the definition of the format. + +CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free +license for the use of the Graphics Interchange Format(sm) in computer +software; computer software utilizing GIF(sm) must acknowledge ownership of the +Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in +User and Technical Documentation. Computer software utilizing GIF, which is +distributed or may be distributed without User or Technical Documentation must +display to the screen or printer a message acknowledging ownership of the +Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in +this case, the acknowledgement may be displayed in an opening screen or leading +banner, or a closing screen or trailing banner. A message such as the following +may be used: + + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 1998-2004 David Turner and Werner Lemberg +Copyright © 2004,2007,2009 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 1998-2004 David Turner and Werner Lemberg +Copyright © 2004,2007,2009,2010 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 1998-2004 David Turner and Werner Lemberg +Copyright © 2006 Behdad Esfahbod +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007 Chris Wilson +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2010,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009 Red Hat, Inc. +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009,2010 Red Hat, Inc. +Copyright © 2010,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009,2010 Red Hat, Inc. +Copyright © 2010,2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2007,2008,2009,2010 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2009 Keith Stribley +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2011 Codethink Limited +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2011 Codethink Limited +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2010,2011,2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2010,2011,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2009,2010 Red Hat, Inc. +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010 Red Hat, Inc. +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2011,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2010,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2012,2014 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2011,2014 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012 Mozilla Foundation. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2012,2013 Mozilla Foundation. +Copyright © 2012,2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2013 Red Hat, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2014 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2015 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2015 Mozilla Foundation. +Copyright © 2015 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2016 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2016 Igalia S.L. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +Copyright © 2017 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +harfbuzz + +HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. +For parts of HarfBuzz that are licensed under different licenses see individual +files names COPYING in subdirectories where applicable. + +Copyright © 2010,2011,2012 Google, Inc. +Copyright © 2012 Mozilla Foundation +Copyright © 2011 Codethink Limited +Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies) +Copyright © 2009 Keith Stribley +Copyright © 2009 Martin Hosken and SIL International +Copyright © 2007 Chris Wilson +Copyright © 2006 Behdad Esfahbod +Copyright © 2005 David Turner +Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc. +Copyright © 1998-2004 David Turner and Werner Lemberg + +For full copyright notices consult the individual files in the package. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1995-2016 International Business Machines Corporation and others +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. + +All trademarks and registered trademarks mentioned herein are the +property of their respective owners. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1998 - 1999 Unicode, Inc. All Rights reserved. + Copyright (C) 2002-2005, International Business Machines + Corporation and others. All Rights Reserved. + +This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +No claims are made as to fitness for any particular purpose. No +warranties of any kind are expressed or implied. The recipient +agrees to determine applicability of information provided. If this +file has been provided on optical media by Unicode, Inc., the sole +remedy for any claim will be exchange of defective media within 90 +days of receipt. + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form for +internal or external distribution as long as this notice remains +attached. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1999 Computer Systems and Communication Lab, + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 1999 Unicode, Inc. All Rights reserved. + Copyright (C) 2002-2005, International Business Machines + Corporation and others. All Rights Reserved. + +This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +No claims are made as to fitness for any particular purpose. No +warranties of any kind are expressed or implied. The recipient +agrees to determine applicability of information provided. If this +file has been provided on optical media by Unicode, Inc., the sole +remedy for any claim will be exchange of defective media within 90 +days of receipt. + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form for +internal or external distribution as long as this notice remains +attached. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 2002 Unicode, Inc. All Rights reserved. + Copyright (C) 2002-2005, International Business Machines + Corporation and others. All Rights Reserved. + +This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +No claims are made as to fitness for any particular purpose. No +warranties of any kind are expressed or implied. The recipient +agrees to determine applicability of information provided. If this +file has been provided on optical media by Unicode, Inc., the sole +remedy for any claim will be exchange of defective media within 90 +days of receipt. + +Unicode, Inc. hereby grants the right to freely use the information +supplied in this file in the creation of products supporting the +Unicode Standard, and to make copies of this file in any form for +internal or external distribution as long as this notice remains +attached. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 2013 International Business Machines Corporation +and others. All Rights Reserved. + +Project: http://code.google.com/p/lao-dictionary +Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt +License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt + (copied below) + + This file is derived from the above dictionary, with slight + modifications. + + Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, + are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. Redistributions in + binary form must reproduce the above copyright notice, this list of + conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) 2014 International Business Machines Corporation +and others. All Rights Reserved. + +This list is part of a project hosted at: + github.com/kanyawtech/myanmar-karen-word-lists + +Copyright (c) 2013, LeRoy Benjamin Sharon +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: Redistributions of source code must retain the above +copyright notice, this list of conditions and the following +disclaimer. Redistributions in binary form must reproduce the +above copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided +with the distribution. + + Neither the name Myanmar Karen Word Lists, nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2010. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2011. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2012. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2014. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright (c) IBM Corporation, 2000-2016. All rights reserved. + + Institute of Information Science, Academia + * Sinica. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the Computer Systems and Communication Lab + nor the names of its contributors may be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + University of Illinois +c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 +-------------------------------------------------------------------------------- +icu + +Copyright 2000, 2001, 2002, 2003 Nara Institute of Science +and Technology. All Rights Reserved. + +Use, reproduction, and distribution of this software is permitted. +Any copy of this software, whether in its original form or modified, +must include both the above copyright notice and the following +paragraphs. + +Nara Institute of Science and Technology (NAIST), +the copyright holders, disclaims all warranties with regard to this +software, including all implied warranties of merchantability and +fitness, in no event shall NAIST be liable for +any special, indirect or consequential damages or any damages +whatsoever resulting from loss of use, data or profits, whether in an +action of contract, negligence or other tortuous action, arising out +of or in connection with the use or performance of this software. + +A large portion of the dictionary entries +originate from ICOT Free Software. The following conditions for ICOT +Free Software applies to the current dictionary as well. + +Each User may also freely distribute the Program, whether in its +original form or modified, to any third party or parties, PROVIDED +that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear +on, or be attached to, the Program, which is distributed substantially +in the same form as set out herein and that such intended +distribution, if actually made, will neither violate or otherwise +contravene any of the laws and regulations of the countries having +jurisdiction over the User or the intended distribution itself. + +NO WARRANTY + +The program was produced on an experimental basis in the course of the +research and development conducted during the project and is provided +to users as so produced on an experimental basis. Accordingly, the +program is provided without any warranty whatsoever, whether express, +implied, statutory or otherwise. The term "warranty" used herein +includes, but is not limited to, any warranty of the quality, +performance, merchantability and fitness for a particular purpose of +the program and the nonexistence of any infringement or violation of +any right of any third party. + +Each user of the program will agree and understand, and be deemed to +have agreed and understood, that there is no warranty whatsoever for +the program and, accordingly, the entire risk arising from or +otherwise connected with the program is assumed by the user. + +Therefore, neither ICOT, the copyright holder, or any other +organization that participated in or was otherwise related to the +development of the program and their respective officials, directors, +officers and other employees shall be held liable for any and all +damages, including, without limitation, general, special, incidental +and consequential damages, arising out of or otherwise in connection +with the use or inability to use the program or any product, material +or result produced or otherwise obtained by using the program, +regardless of whether they have been advised of, or otherwise had +knowledge of, the possibility of such damages at any time during the +project or thereafter. Each user will be deemed to have agreed to the +foregoing by his or her commencement of use of the program. The term +"use" as used herein includes, but is not limited to, the use, +modification, copying and distribution of the program and the +production of secondary products from the program. + +In the case where the program, whether in its original form or +modified, was distributed or delivered to or received by a user from +any person, organization or entity other than ICOT, unless it makes or +grants independently of ICOT any specific warranty to the user in +writing, such person, organization or entity, will also be exempted +from and not be held liable to the user for any such damages as noted +above as far as the program is concerned. +-------------------------------------------------------------------------------- +icu + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. +-------------------------------------------------------------------------------- +icu + +Copyrighy (c) 1999 TaBE Project. +Copyright (c) 1999 Pai-Hsiang Hsiao. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. +. Neither the name of the TaBE Project nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +ICU License - ICU 1.8.1 and later + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2009 International Business Machines Corporation and others + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. +-------------------------------------------------------------------------------- +icu + +The BSD License +http://opensource.org/licenses/bsd-license.php +Copyright (C) 2006-2008, Google Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following +disclaimer in the documentation and/or other materials provided with +the distribution. + Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +icu + +Unicode® Terms of Use +For the general privacy policy governing access to this site, see the Unicode Privacy Policy. For trademark usage, see the Unicode® Consortium Name and Trademark Usage Policy. + +A. Unicode Copyright. +1. Copyright © 1991-2017 Unicode, Inc. All rights reserved. +2. Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. +3. Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files solely for informational purposes and in the creation of products supporting the Unicode Standard, subject to the Terms and Conditions herein. +4. Further specifications of rights and restrictions pertaining to the use of the particular set of data files known as the "Unicode Character Database" can be found in the License. +5. Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. The online code charts carry specific restrictions. All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. +6. No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. +7. Modification is not permitted with respect to this document. All copies of this document must be verbatim. +B. Restricted Rights Legend. Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. +C. Warranties and Disclaimers. +1. This publication and/or website may include technical or typographical errors or other inaccuracies . Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. +2. If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. +3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. +D. Waiver of Damages. In no event shall Unicode or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. +E. Trademarks & Logos. +1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. +2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. +3. All third party trademarks referenced herein are the property of their respective owners. +F. Miscellaneous. +1. Jurisdiction and Venue. This server is operated from a location in the State of California, United States of America. Unicode makes no representation that the materials are appropriate for use in other locations. If you access this server from other locations, you are responsible for compliance with local laws. This Agreement, all use of this site and any claims and damages resulting from use of this site are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this site shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. +2. Modification by Unicode Unicode shall have the right to modify this Agreement at any time by posting it to this site. The user may not assign any part of this Agreement without Unicode’s prior written consent. +3. Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. +4. Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. +5. Entire Agreement. This Agreement constitutes the entire agreement between the parties. + +EXHIBIT 1 +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +Unicode Data Files do not include PDF online code charts under the +directory http://www.unicode.org/Public/. + +Software includes any source code published in the Unicode Standard +or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2017 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009-2011, 2014-2016, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). +All Rights Reserved. +Author: Siarhei Siamashka +Copyright (C) 2013-2014, Linaro Limited. All Rights Reserved. +Author: Ragesh Radhakrishnan +Copyright (C) 2014-2016, D. R. Commander. All Rights Reserved. +Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. +Copyright (C) 2016, Siarhei Siamashka. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2009-2011, Nokia Corporation and/or its subsidiary(-ies). +All Rights Reserved. +Author: Siarhei Siamashka +Copyright (C) 2014, Siarhei Siamashka. All Rights Reserved. +Copyright (C) 2014, Linaro Limited. All Rights Reserved. +Copyright (C) 2015, D. R. Commander. All Rights Reserved. +Copyright (C) 2015-2016, Matthieu Darbois. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2011, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2013, MIPS Technologies, Inc., California. +All Rights Reserved. +Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) + Darko Laus (darko.laus@imgtec.com) +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2013-2014, MIPS Technologies, Inc., California. +All Rights Reserved. +Authors: Teodora Novkovic (teodora.novkovic@imgtec.com) + Darko Laus (darko.laus@imgtec.com) +Copyright (C) 2015, D. R. Commander. All Rights Reserved. +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2014, D. R. Commander. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2014-2015, D. R. Commander. All Rights Reserved. +Copyright (C) 2014, Jay Foad. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C) 2015, D. R. Commander. All Rights Reserved. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2009-2014 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2009-2015 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2009-2016 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2011 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2011, 2015 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright (C)2011-2016 D. R. Commander. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2013-2014, 2016, D. R. Commander. +Copyright (C) 2015-2016, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014, 2016, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014, D. R. Commander. +Copyright (C) 2013-2014, MIPS Technologies, Inc., California. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2009-2011, 2014-2015, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2010, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library - version 1.02 + +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2011, 2014, D. R. Commander. +Copyright (C) 2015, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2011, 2014-2016, D. R. Commander. +Copyright (C) 2013-2014, MIPS Technologies, Inc., California. +Copyright (C) 2014, Linaro Limited. +Copyright (C) 2015-2016, Matthieu Darbois. + +Based on the x86 SIMD extension for IJG JPEG library, +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009 Pierre Ossman for Cendio AB +Copyright (C) 2011, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009, 2012 Pierre Ossman for Cendio AB +Copyright (C) 2009, 2012, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +Copyright 2009, 2012 Pierre Ossman for Cendio AB +Copyright (C) 2012, D. R. Commander. + +Based on the x86 SIMD extension for IJG JPEG library +Copyright (C) 1999-2006, MIYASAKA Masaru. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +libjpeg-turbo + +libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project +to include only information relevant to libjpeg-turbo, to wordsmith certain +sections, and to remove impolitic language that existed in the libjpeg v8 +README. It is included only for reference. Please see README.md for +information specific to libjpeg-turbo. + +The Independent JPEG Group's JPEG software +========================================== + +This distribution contains a release of the Independent JPEG Group's free JPEG +software. You are welcome to redistribute this software and to use it for any +purpose, subject to the conditions under LEGAL ISSUES, below. + +This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone, +Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson, +Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers, +and other members of the Independent JPEG Group. + +IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee +(also known as JPEG, together with ITU-T SG16). + +DOCUMENTATION ROADMAP +===================== + +This file contains the following sections: + +OVERVIEW General description of JPEG and the IJG software. +LEGAL ISSUES Copyright, lack of warranty, terms of distribution. +REFERENCES Where to learn more about JPEG. +ARCHIVE LOCATIONS Where to find newer versions of this software. +FILE FORMAT WARS Software *not* to get. +TO DO Plans for future IJG releases. + +Other documentation files in the distribution are: + +User documentation: + usage.txt Usage instructions for cjpeg, djpeg, jpegtran, + rdjpgcom, and wrjpgcom. + *.1 Unix-style man pages for programs (same info as usage.txt). + wizard.txt Advanced usage instructions for JPEG wizards only. + change.log Version-to-version change highlights. +Programmer and internal documentation: + libjpeg.txt How to use the JPEG library in your own programs. + example.c Sample code for calling the JPEG library. + structure.txt Overview of the JPEG library's internal structure. + coderules.txt Coding style rules --- please read if you contribute code. + +Please read at least usage.txt. Some information can also be found in the JPEG +FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find +out where to obtain the FAQ article. + +If you want to understand how the JPEG code works, we suggest reading one or +more of the REFERENCES, then looking at the documentation files (in roughly +the order listed) before diving into the code. + +OVERVIEW +======== + +This package contains C software to implement JPEG image encoding, decoding, +and transcoding. JPEG (pronounced "jay-peg") is a standardized compression +method for full-color and grayscale images. JPEG's strong suit is compressing +photographic images or other types of images that have smooth color and +brightness transitions between neighboring pixels. Images with sharp lines or +other abrupt features may not compress well with JPEG, and a higher JPEG +quality may have to be used to avoid visible compression artifacts with such +images. + +JPEG is lossy, meaning that the output pixels are not necessarily identical to +the input pixels. However, on photographic content and other "smooth" images, +very good compression ratios can be obtained with no visible compression +artifacts, and extremely high compression ratios are possible if you are +willing to sacrifice image quality (by reducing the "quality" setting in the +compressor.) + +This software implements JPEG baseline, extended-sequential, and progressive +compression processes. Provision is made for supporting all variants of these +processes, although some uncommon parameter settings aren't implemented yet. +We have made no provision for supporting the hierarchical or lossless +processes defined in the standard. + +We provide a set of library routines for reading and writing JPEG image files, +plus two sample applications "cjpeg" and "djpeg", which use the library to +perform conversion between JPEG and some other popular image file formats. +The library is intended to be reused in other applications. + +In order to support file conversion and viewing software, we have included +considerable functionality beyond the bare JPEG coding/decoding capability; +for example, the color quantization modules are not strictly part of JPEG +decoding, but they are essential for output to colormapped file formats or +colormapped displays. These extra functions can be compiled out of the +library if not required for a particular application. + +We have also included "jpegtran", a utility for lossless transcoding between +different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple +applications for inserting and extracting textual comments in JFIF files. + +The emphasis in designing this software has been on achieving portability and +flexibility, while also making it fast enough to be useful. In particular, +the software is not intended to be read as a tutorial on JPEG. (See the +REFERENCES section for introductory material.) Rather, it is intended to +be reliable, portable, industrial-strength code. We do not claim to have +achieved that goal in every aspect of the software, but we strive for it. + +We welcome the use of this software as a component of commercial products. +No royalty is required, but we do ask for an acknowledgement in product +documentation, as described under LEGAL ISSUES. + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltmain.sh). Another support script, install-sh, is copyright by X Consortium +but is also freely distributable. + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent (now expired), GIF reading +support has been removed altogether, and the GIF writer has been simplified +to produce "uncompressed GIFs". This technique does not use the LZW +algorithm; the resulting GIF files are larger than usual, but are readable +by all standard GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + +REFERENCES +========== + +We recommend reading one or more of these references before trying to +understand the innards of the JPEG software. + +The best short technical introduction to the JPEG compression algorithm is + Wallace, Gregory K. "The JPEG Still Picture Compression Standard", + Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. +(Adjacent articles in that issue discuss MPEG motion picture compression, +applications of JPEG, and related topics.) If you don't have the CACM issue +handy, a PDF file containing a revised version of Wallace's article is +available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually +a preprint for an article that appeared in IEEE Trans. Consumer Electronics) +omits the sample images that appeared in CACM, but it includes corrections +and some added material. Note: the Wallace article is copyright ACM and IEEE, +and it may not be used for commercial purposes. + +A somewhat less technical, more leisurely introduction to JPEG can be found in +"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by +M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides +good explanations and example C code for a multitude of compression methods +including JPEG. It is an excellent source if you are comfortable reading C +code but don't know much about data compression in general. The book's JPEG +sample code is far from industrial-strength, but when you are ready to look +at a full implementation, you've got one here... + +The best currently available description of JPEG is the textbook "JPEG Still +Image Data Compression Standard" by William B. Pennebaker and Joan L. +Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. +Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG +standards (DIS 10918-1 and draft DIS 10918-2). + +The original JPEG standard is divided into two parts, Part 1 being the actual +specification, while Part 2 covers compliance testing methods. Part 1 is +titled "Digital Compression and Coding of Continuous-tone Still Images, +Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS +10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of +Continuous-tone Still Images, Part 2: Compliance testing" and has document +numbers ISO/IEC IS 10918-2, ITU-T T.83. + +The JPEG standard does not specify all details of an interchangeable file +format. For the omitted details we follow the "JFIF" conventions, revision +1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report +and thus received a formal publication status. It is available as a free +download in PDF format from +http://www.ecma-international.org/publications/techreports/E-TR-098.htm. +A PostScript version of the JFIF document is available at +http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at +http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures. + +The TIFF 6.0 file format specification can be obtained by FTP from +ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme +found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. +IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). +Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 +(Compression tag 7). Copies of this Note can be obtained from +http://www.ijg.org/files/. It is expected that the next revision +of the TIFF spec will replace the 6.0 JPEG design with the Note's design. +Although IJG's own code does not support TIFF/JPEG, the free libtiff library +uses our library to implement TIFF/JPEG per the Note. + +ARCHIVE LOCATIONS +================= + +The "official" archive site for this software is www.ijg.org. +The most recent released version can always be found there in +directory "files". + +The JPEG FAQ (Frequently Asked Questions) article is a source of some +general information about JPEG. +It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq +and other news.answers archive sites, including the official news.answers +archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. +If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu +with body + send usenet/news.answers/jpeg-faq/part1 + send usenet/news.answers/jpeg-faq/part2 + +FILE FORMAT WARS +================ + +The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together +with ITU-T SG16) currently promotes different formats containing the name +"JPEG" which are incompatible with original DCT-based JPEG. IJG therefore does +not support these formats (see REFERENCES). Indeed, one of the original +reasons for developing this free software was to help force convergence on +common, interoperable format standards for JPEG files. +Don't use an incompatible file format! +(In any case, our decoder will remain capable of reading existing JPEG +image files indefinitely.) + +TO DO +===== + +Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org. +-------------------------------------------------------------------------------- +libsdl +skia + +Copyright 2016 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright (c) 2010, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2010 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2011 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2012 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2013 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2014 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2015 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2016 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +libwebp + +Copyright 2017 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2006-2012 The Authors + +Contributors: +James Graham - jg307@cam.ac.uk +Anne van Kesteren - annevankesteren@gmail.com +Lachlan Hunt - lachlan.hunt@lachy.id.au +Matt McDonald - kanashii@kanashii.ca +Sam Ruby - rubys@intertwingly.net +Ian Hickson (Google) - ian@hixie.ch +Thomas Broyer - t.broyer@ltgt.net +Jacques Distler - distler@golem.ph.utexas.edu +Henri Sivonen - hsivonen@iki.fi +Adam Barth - abarth@webkit.org +Eric Seidel - eric@webkit.org +The Mozilla Foundation (contributions from Henri Sivonen since 2008) +David Flanagan (Mozilla) - dflanagan@mozilla.com +Google Inc. (contributed the Dart port) - misc@dartlang.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2013, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014 Seth Ladd. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014, Michael Bostock and Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014, the Dart project authors. +Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2017, the Dart project authors. +Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2013, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2015, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages + +Copyright 2016, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +observatory_pub_packages +pkg + +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +rapidjson + +Copyright (c) 2006-2013 Alexander Chemeris + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the product nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +rapidjson + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +root_certificates + +Mozilla Public License +Version 2.0 + +1. Definitions + +1.1. “Contributor” + +means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. + +1.2. “Contributor Version” + +means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution. + +1.3. “Contribution” + +means Covered Software of a particular Contributor. + +1.4. “Covered Software” + +means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. + +1.5. “Incompatible With Secondary Licenses” + +means + + a. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or + + b. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. + +1.6. “Executable Form” + +means any form of the work other than Source Code Form. + +1.7. “Larger Work” + +means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. + +1.8. “License” + +means this document. + +1.9. “Licensable” + +means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. + +1.10. “Modifications” + +means any of the following: + + a. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or + + b. any new file in Source Code Form that contains any Covered Software. + +1.11. “Patent Claims” of a Contributor + +means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. + +1.12. “Secondary License” + +means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. + +1.13. “Source Code Form” + +means the form of the work preferred for making modifications. + +1.14. “You” (or “Your”) + +means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. License Grants and Conditions + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + a. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and + + b. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: + + a. for any code that a Contributor has removed from Covered Software; or + + b. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or + + c. under Patent Claims infringed by Covered Software in the absence of its Contributions. + +This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. + +3. Responsibilities + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + + a. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and + + b. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + +If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. + +6. Disclaimer of Warranty + + Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. + +7. Limitation of Liability + + Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. + +8. Litigation + +Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims. + +9. Miscellaneous + +This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. + +10. Versions of the License + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses + +If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - “Incompatible With Secondary Licenses” Notice + + This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0. +-------------------------------------------------------------------------------- +root_certificates + +Mozilla Public License Version 2.0 +================================== + +1. Definitions + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +* 6. Disclaimer of Warranty + +* Covered Software is provided under this License on an "as is" +* basis, without warranty of any kind, either expressed, implied, or +* statutory, including, without limitation, warranties that the +* Covered Software is free of defects, merchantable, fit for a +* particular purpose or non-infringing. The entire risk as to the +* quality and performance of the Covered Software is with You. +* Should any Covered Software prove defective in any respect, You +* (not any Contributor) assume the cost of any necessary servicing, +* repair, or correction. This disclaimer of warranty constitutes an +* essential part of this License. No use of any Covered Software is +* authorized under this License except under this disclaimer. + +* 7. Limitation of Liability + +* Under no circumstances and under no legal theory, whether tort +* (including negligence), contract, or otherwise, shall any +* Contributor, or anyone who distributes Covered Software as +* permitted above, be liable to You for any direct, indirect, +* special, incidental, or consequential damages of any character +* including, without limitation, damages for lost profits, loss of +* goodwill, work stoppage, computer failure or malfunction, or any +* and all other commercial damages or losses, even if such party +* shall have been informed of the possibility of such damages. This +* limitation of liability shall not apply to liability for death or +* personal injury resulting from such party's negligence to the +* extent applicable law prohibits such limitation. Some +* jurisdictions do not allow the exclusion or limitation of +* incidental or consequential damages, so this exclusion and +* limitation may not apply to You. + +8. Litigation + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. +-------------------------------------------------------------------------------- +skcms + +Copyright (c) 2018 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skcms +skia +vulkanmemoryallocator + +Copyright 2018 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (C) 2014 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2011 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2014 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2014-2016 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and/or associated documentation files (the "Materials"), +to deal in the Materials without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Materials, and to permit persons to whom the +Materials are furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Materials. +-------------------------------------------------------------------------------- +skia + +Copyright (c) 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2005 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2006 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2006-2012 The Android Open Source Project +Copyright 2012 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2007 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2008 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2008 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2009 Motorola + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2009 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2009-2015 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2010 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2010 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2011 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2011 Google Inc. +Copyright 2012 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2011 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2012 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2012 Intel Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2012 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2013 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2013 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2014 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2014 Google Inc. +Copyright 2017 ARM Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2014 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2015 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2015 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2016 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2016 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2017 ARM Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2017 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 Google LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 Google, LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +Copyright 2018 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + +NEON optimized code (C) COPYRIGHT 2009 Motorola + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +tcmalloc + +Copyright (c) 2003, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +tcmalloc + +Copyright (c) 2005, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +topaz + +Copyright 2016 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +topaz + +Copyright 2017 Th%e Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +vulkanmemoryallocator + +Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2003, 2010 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2003, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2005 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2005, 2010 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2005, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2006, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2007 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2008, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2009 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly +detect_data_type() function provided freely by Cosmin Truta, 2006 + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Jean-loup Gailly. + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1995-2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + +Modifications for Zip64 support +Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + +For more info read MiniZip_info.txt + +Condition of use and distribution are the same than zlib : + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + +Modifications of Unzip for Zip64 +Copyright (C) 2007-2008 Even Rouault + +Modifications for Zip64 support on both zip and unzip +Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + +For more info read MiniZip_info.txt + +Condition of use and distribution are the same than zlib : + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2004, 2005, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2004, 2010 Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation +Authors: + Arjan van de Ven + Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation. All rights reserved. +Author: + Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2013 Intel Corporation. All rights reserved. +Authors: + Wajdi Feghali + Jim Guilford + Vinodh Gopal + Erdinc Ozturk + Jim Kukunas + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (C) 2014 Intel Corporation + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +-------------------------------------------------------------------------------- +zlib + +Copyright (c) 2011 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +zlib + +Copyright (c) 2012 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +zlib + +zlib.h -- interface of the 'zlib' general purpose compression library +version 1.2.4, March 14th, 2010 + +Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. + +Jean-loup Gailly +Mark Adler diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b987ae2f4fce3..11033698b35b2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 86ad0fe037823a9abc6fe55c29d29bbd +Signature: 93dd9ae16639de6efec53357d0cb9d62 UNUSED LICENSES: From d7e3f2d6e7d923a3939a468d7746f87285fc265a Mon Sep 17 00:00:00 2001 From: Mehmet Fidanboylu Date: Fri, 1 Jun 2018 10:16:50 -0700 Subject: [PATCH 0495/1190] Fix lint errors to prepare for building Android files in Google (#5440) --- .../android/io/flutter/app/FlutterActivityDelegate.java | 4 ++-- .../android/io/flutter/plugin/common/StandardMethodCodec.java | 1 + .../io/flutter/plugin/editing/InputConnectionAdaptor.java | 3 +-- .../platform/android/io/flutter/view/AccessibilityBridge.java | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index 601926ac0bccc..7771e90514f37 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -205,7 +205,7 @@ public void onPause() { Application app = (Application) activity.getApplicationContext(); if (app instanceof FlutterApplication) { FlutterApplication flutterApp = (FlutterApplication) app; - if (this.equals(flutterApp.getCurrentActivity())) { + if (activity.equals(flutterApp.getCurrentActivity())) { Log.i(TAG, "onPause setting current activity to null"); flutterApp.setCurrentActivity(null); } @@ -251,7 +251,7 @@ public void onDestroy() { Application app = (Application) activity.getApplicationContext(); if (app instanceof FlutterApplication) { FlutterApplication flutterApp = (FlutterApplication) app; - if (this.equals(flutterApp.getCurrentActivity())) { + if (activity.equals(flutterApp.getCurrentActivity())) { Log.i(TAG, "onDestroy setting current activity to null"); flutterApp.setCurrentActivity(null); } diff --git a/shell/platform/android/io/flutter/plugin/common/StandardMethodCodec.java b/shell/platform/android/io/flutter/plugin/common/StandardMethodCodec.java index 82cf512672442..1284c11390e09 100644 --- a/shell/platform/android/io/flutter/plugin/common/StandardMethodCodec.java +++ b/shell/platform/android/io/flutter/plugin/common/StandardMethodCodec.java @@ -84,6 +84,7 @@ public Object decodeEnvelope(ByteBuffer envelope) { return result; } } + // Falls through intentionally. case 1: { final Object code = messageCodec.readValue(envelope); final Object message = messageCodec.readValue(envelope); diff --git a/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java b/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java index af7da838a3e7a..c77524dfa06df 100644 --- a/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java +++ b/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java @@ -91,8 +91,7 @@ public boolean commitText(CharSequence text, int newCursorPosition) { @Override public boolean deleteSurroundingText(int beforeLength, int afterLength) { - if (Selection.getSelectionStart(mEditable) == -1 || - Selection.getSelectionStart(mEditable) == -1) + if (Selection.getSelectionStart(mEditable) == -1) return true; boolean result = super.deleteSurroundingText(beforeLength, afterLength); diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index ebf19111b6c7d..322e113f628e0 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -424,6 +424,7 @@ public AccessibilityNodeInfo findFocus(int focus) { if (mInputFocusedObject != null) return createAccessibilityNodeInfo(mInputFocusedObject.id); } + // Fall through to check FOCUS_ACCESSIBILITY case AccessibilityNodeInfo.FOCUS_ACCESSIBILITY: { if (mA11yFocusedObject != null) return createAccessibilityNodeInfo(mA11yFocusedObject.id); From 0470f1c8cc3e2ed7f99fc23661d1ae2396627dc1 Mon Sep 17 00:00:00 2001 From: Alexander Markov Date: Fri, 1 Jun 2018 11:05:38 -0700 Subject: [PATCH 0496/1190] Remove --limit-ints-to-64-bits Dart VM option (#5442) --- runtime/dart_vm.cc | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index a97ba89a1d623..5230380db49c2 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -58,9 +58,13 @@ namespace blink { // Arguments passed to the Dart VM in all configurations. static const char* kDartLanguageArgs[] = { - "--enable_mirrors=false", "--background_compilation", "--await_is_keyword", - "--causal_async_stacks", "--limit-ints-to-64-bits", - "--enable_kernel_expression_compilation=false" // TODO(dartbug.com/33087) + // clang-format off + "--enable_mirrors=false", + "--background_compilation", + "--await_is_keyword", + "--causal_async_stacks", + "--enable_kernel_expression_compilation=false", // TODO(dartbug.com/33087) + // clang-format on }; static const char* kDartPrecompilationArgs[] = { @@ -90,7 +94,6 @@ static const char* kDartStrongModeArgs[] = { // clang-format off "--strong", "--reify_generic_functions", - "--limit_ints_to_64_bits", // TODO(bkonyi): uncomment when sync-async is enabled in flutter/flutter. // "--sync_async", // clang-format on @@ -240,10 +243,10 @@ fxl::RefPtr DartVM::ForProcess( fxl::RefPtr vm_snapshot, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot) { - std::call_once(gVMInitialization, [settings, // - vm_snapshot, // - isolate_snapshot, // - shared_snapshot // + std::call_once(gVMInitialization, [settings, // + vm_snapshot, // + isolate_snapshot, // + shared_snapshot // ]() mutable { if (!vm_snapshot) { vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings); @@ -254,10 +257,10 @@ fxl::RefPtr DartVM::ForProcess( if (!shared_snapshot) { shared_snapshot = DartSnapshot::Empty(); } - gVM = fxl::MakeRefCounted(settings, // - std::move(vm_snapshot), // - std::move(isolate_snapshot), // - std::move(shared_snapshot) // + gVM = fxl::MakeRefCounted(settings, // + std::move(vm_snapshot), // + std::move(isolate_snapshot), // + std::move(shared_snapshot) // ); }); return gVM; From c0ec8d9f069da8dedad460fcba49ea3c287da7b6 Mon Sep 17 00:00:00 2001 From: Stanislav Baranov Date: Fri, 1 Jun 2018 12:46:27 -0700 Subject: [PATCH 0497/1190] Restore archive support removed in #5305. Codepush bundles use zip. (#5441) --- assets/BUILD.gn | 7 ++ assets/zip_asset_store.cc | 124 ++++++++++++++++++++++++ assets/zip_asset_store.h | 51 ++++++++++ travis/licenses_golden/licenses_flutter | 2 + 4 files changed, 184 insertions(+) create mode 100644 assets/zip_asset_store.cc create mode 100644 assets/zip_asset_store.h diff --git a/assets/BUILD.gn b/assets/BUILD.gn index 7247a2f3d00fc..28d7e569659f1 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -9,6 +9,8 @@ source_set("assets") { "asset_resolver.h", "directory_asset_bundle.cc", "directory_asset_bundle.h", + "zip_asset_store.cc", + "zip_asset_store.h", ] deps = [ @@ -16,6 +18,11 @@ source_set("assets") { "$flutter_root/fml", "$flutter_root/glue", "//garnet/public/lib/fxl", + "//garnet/public/lib/zip", + ] + + public_deps = [ + "//third_party/zlib:minizip", ] public_configs = [ "$flutter_root:config" ] diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc new file mode 100644 index 0000000000000..1b9216bd34530 --- /dev/null +++ b/assets/zip_asset_store.cc @@ -0,0 +1,124 @@ +// Copyright 2016 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. + +#include "flutter/assets/zip_asset_store.h" +#include "lib/fxl/build_config.h" + +#include + +#if !defined(OS_WIN) +#include +#endif + +#include +#include + +#include "flutter/glue/trace_event.h" + +namespace blink { + +ZipAssetStore::ZipAssetStore(std::string file_path) + : file_path_(std::move(file_path)) { + BuildStatCache(); +} + +ZipAssetStore::~ZipAssetStore() = default; + +zip::UniqueUnzipper ZipAssetStore::CreateUnzipper() const { + return zip::UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)}; +} + +// |blink::AssetResolver| +bool ZipAssetStore::IsValid() const { + return stat_cache_.size() > 0; +} + +// |blink::AssetResolver| +bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, + std::vector* data) const { + TRACE_EVENT0("flutter", "ZipAssetStore::GetAsBuffer"); + auto found = stat_cache_.find(asset_name); + + if (found == stat_cache_.end()) { + return false; + } + + auto unzipper = CreateUnzipper(); + + if (!unzipper.is_valid()) { + return false; + } + + int result = UNZ_OK; + + result = unzGoToFilePos(unzipper.get(), &(found->second.file_pos)); + if (result != UNZ_OK) { + FXL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result; + return false; + } + + result = unzOpenCurrentFile(unzipper.get()); + if (result != UNZ_OK) { + FXL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result; + return false; + } + + data->resize(found->second.uncompressed_size); + int total_read = 0; + while (total_read < static_cast(data->size())) { + int bytes_read = unzReadCurrentFile( + unzipper.get(), data->data() + total_read, data->size() - total_read); + if (bytes_read <= 0) { + return false; + } + total_read += bytes_read; + } + + return true; +} + +void ZipAssetStore::BuildStatCache() { + TRACE_EVENT0("flutter", "ZipAssetStore::BuildStatCache"); + + auto unzipper = CreateUnzipper(); + + if (!unzipper.is_valid()) { + return; + } + + if (unzGoToFirstFile(unzipper.get()) != UNZ_OK) { + return; + } + + do { + int result = UNZ_OK; + + // Get the current file name. + unz_file_info file_info = {}; + char file_name[255]; + result = unzGetCurrentFileInfo(unzipper.get(), &file_info, file_name, + sizeof(file_name), nullptr, 0, nullptr, 0); + if (result != UNZ_OK) { + continue; + } + + if (file_info.uncompressed_size == 0) { + continue; + } + + // Get the current file position. + unz_file_pos file_pos = {}; + result = unzGetFilePos(unzipper.get(), &file_pos); + if (result != UNZ_OK) { + continue; + } + + std::string file_name_key(file_name, file_info.size_filename); + CacheEntry entry(file_pos, file_info.uncompressed_size); + stat_cache_.emplace(std::move(file_name_key), std::move(entry)); + + } while (unzGoToNextFile(unzipper.get()) == UNZ_OK); +} + +} // namespace blink diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h new file mode 100644 index 0000000000000..558678e25bc08 --- /dev/null +++ b/assets/zip_asset_store.h @@ -0,0 +1,51 @@ +// Copyright 2016 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. + +#ifndef FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ +#define FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ + +#include + +#include "flutter/assets/asset_resolver.h" +#include "lib/fxl/macros.h" +#include "lib/fxl/memory/ref_counted.h" +#include "lib/zip/unique_unzipper.h" +#include "third_party/zlib/contrib/minizip/unzip.h" + +namespace blink { + +class ZipAssetStore final : public AssetResolver { + public: + ZipAssetStore(std::string file_path); + + ~ZipAssetStore() override; + + private: + struct CacheEntry { + unz_file_pos file_pos; + size_t uncompressed_size; + CacheEntry(unz_file_pos p_file_pos, size_t p_uncompressed_size) + : file_pos(p_file_pos), uncompressed_size(p_uncompressed_size) {} + }; + + std::string file_path_; + mutable std::map stat_cache_; + + // |blink::AssetResolver| + bool IsValid() const override; + + // |blink::AssetResolver| + bool GetAsBuffer(const std::string& asset_name, + std::vector* data) const override; + + void BuildStatCache(); + + zip::UniqueUnzipper CreateUnzipper() const; + + FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); +}; + +} // namespace blink + +#endif // FLUTTER_ASSETS_ZIP_ASSET_STORE_H_ diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index c8a178ad707e4..efeeb86c8b892 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -322,6 +322,8 @@ ORIGIN: ../../../flutter/assets/directory_asset_bundle.cc + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/assets/directory_asset_bundle.cc FILE: ../../../flutter/assets/directory_asset_bundle.h +FILE: ../../../flutter/assets/zip_asset_store.cc +FILE: ../../../flutter/assets/zip_asset_store.h FILE: ../../../flutter/common/settings.cc FILE: ../../../flutter/common/settings.h FILE: ../../../flutter/flow/export_node.cc From f81ed899032059741fec5617d2e531f46f2ea357 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 1 Jun 2018 16:10:31 -0400 Subject: [PATCH 0498/1190] Roll src/third_party/skia 7abeb28..2ab87fc (12 commits) (#5445) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1b96da4cb2ec9..7aacd31d60fcf 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7abeb28342078af39b19a1448d6147c7258f5203', + 'skia_revision': '2ab87fcc1b06a1d444482b9f244816b3e34cff6b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 11033698b35b2..2c49a85a68197 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 93dd9ae16639de6efec53357d0cb9d62 +Signature: 056e3a5e6c745734d707e8189e15bd96 UNUSED LICENSES: @@ -17211,6 +17211,7 @@ FILE: ../../../third_party/skia/modules/sksg/src/SkSGScene.cpp FILE: ../../../third_party/skia/modules/sksg/src/SkSGText.cpp FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp +FILE: ../../../third_party/skia/samplecode/SampleGlyphTransform.cpp FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp FILE: ../../../third_party/skia/src/core/SkBlurPriv.h FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp From b599b597e63a818789f01fb08fb9cf030526736d Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Fri, 1 Jun 2018 13:24:53 -0700 Subject: [PATCH 0499/1190] Update CONTRIBUTING.md (#5444) --- CONTRIBUTING.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e5f9bb574f4e..b34eda16e30d1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,8 +3,18 @@ Contributing to the Flutter engine [![Build Status](https://travis-ci.org/flutter/engine.svg)](https://travis-ci.org/flutter/engine) +_See also: [Flutter's code of conduct](https://flutter.io/design-principles/#code-of-conduct)_ + +Welcome +------- + +This guide introduces you to building and contributing to the Flutter engine. +For an introduction to contributing to the Flutter framework, see [the equivalent +document in the framework's repository](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md). + + I built it before. Remind me, how do I do it again? --------------------- +--------------------------------------------------- If you have previously built the engine (i.e. your environment is already setup) and just want a refresher, then feel free to skip to one of the following sections: From 50f623ab64f39e8dbeee3b111678fe2821d86f5b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 1 Jun 2018 19:35:31 -0400 Subject: [PATCH 0500/1190] Roll src/third_party/skia 2ab87fc..257c1fb (6 commits) (#5448) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7aacd31d60fcf..c0c3c36000b1b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2ab87fcc1b06a1d444482b9f244816b3e34cff6b', + 'skia_revision': '257c1fb7524db283f43ac3d3813e917cbe522e81', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 2c49a85a68197..8d55399dac4d8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 056e3a5e6c745734d707e8189e15bd96 +Signature: d889e9321e7641b240037eab97482afc UNUSED LICENSES: From 78f46bd427e18e1a0fea464cbd4e6bc79123279f Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 1 Jun 2018 17:34:25 -0700 Subject: [PATCH 0501/1190] Log an error and cancel DartVM init if the VM/isolate snapshots are invalid (#5449) See https://github.com/flutter/flutter/issues/18101 --- runtime/dart_vm.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 5230380db49c2..422984feb39a0 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -251,9 +251,17 @@ fxl::RefPtr DartVM::ForProcess( if (!vm_snapshot) { vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings); } + if (!(vm_snapshot && vm_snapshot->IsValid())) { + FXL_LOG(ERROR) << "VM snapshot must be valid."; + return; + } if (!isolate_snapshot) { isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings); } + if (!(isolate_snapshot && isolate_snapshot->IsValid())) { + FXL_LOG(ERROR) << "Isolate snapshot must be valid."; + return; + } if (!shared_snapshot) { shared_snapshot = DartSnapshot::Empty(); } @@ -285,12 +293,6 @@ DartVM::DartVM(const Settings& settings, FXL_DLOG(INFO) << "Attempting Dart VM launch for mode: " << (IsRunningPrecompiledCode() ? "AOT" : "Interpreter"); - FXL_DCHECK(vm_snapshot_ && vm_snapshot_->IsValid()) - << "VM snapshot must be valid."; - - FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid()) - << "Isolate snapshot must be valid."; - { TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo"); dart::bin::BootstrapDartIo(); From 16f4da984c7bf66e10ea27013c3ce3a9bf8e6255 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 1 Jun 2018 17:34:45 -0700 Subject: [PATCH 0502/1190] Parse --verbose-logging flag from intent and pass to the engine as args. (#5447) --- .../android/io/flutter/app/FlutterActivityDelegate.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index 7771e90514f37..b7c31ac9ba3fc 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -327,6 +327,9 @@ private static String[] getArgsFromIntent(Intent intent) { if (intent.getBooleanExtra("trace-skia", false)) { args.add("--trace-skia"); } + if (intent.getBooleanExtra("verbose-logging", false)) { + args.add("--verbose-logging"); + } if (!args.isEmpty()) { String[] argsArray = new String[args.size()]; return args.toArray(argsArray); From eb11142e5450fc7e81b573343028b324a0f452d3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 1 Jun 2018 22:59:53 -0400 Subject: [PATCH 0503/1190] Roll src/third_party/skia 257c1fb..a694870 (2 commits) (#5450) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c0c3c36000b1b..ad8367fe702ce 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '257c1fb7524db283f43ac3d3813e917cbe522e81', + 'skia_revision': 'a694870ef50c05ce91538d1b4109f373c816b76b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8d55399dac4d8..5069742e43b25 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d889e9321e7641b240037eab97482afc +Signature: 48b6dbb5fdf441653964fc1cc5cda8bf UNUSED LICENSES: From d3d40617f74e0fa2b544da7b2d103da8cf3d196b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 2 Jun 2018 02:25:31 -0400 Subject: [PATCH 0504/1190] Roll src/third_party/skia a694870..a09981c (2 commits) (#5451) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ad8367fe702ce..7235da2ff7fa8 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a694870ef50c05ce91538d1b4109f373c816b76b', + 'skia_revision': 'a09981cb6f777a6c966f638fc24e2b43ad591506', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5069742e43b25..f3fcfa03f3ce2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 48b6dbb5fdf441653964fc1cc5cda8bf +Signature: 1d4bd80f2ef84a949b9c24bf5435bf20 UNUSED LICENSES: From 5babb905ecf55e4b30794cdde575aa98d82f9d5a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 2 Jun 2018 12:49:31 -0400 Subject: [PATCH 0505/1190] Roll src/third_party/skia a09981c..fd6a52c (1 commits) (#5452) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7235da2ff7fa8..7959c5de0f54c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a09981cb6f777a6c966f638fc24e2b43ad591506', + 'skia_revision': 'fd6a52cc84364208f65f1ee52644192d6855ab0e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f3fcfa03f3ce2..8b4416bdf8d55 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1d4bd80f2ef84a949b9c24bf5435bf20 +Signature: d9d229c1831c1b823eed816a88a6e91b UNUSED LICENSES: From 5ca93f31fd974ed167ebf4d19753c20d2dc51034 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 3 Jun 2018 07:36:31 -0400 Subject: [PATCH 0506/1190] Roll src/third_party/skia fd6a52c..728b7f3 (1 commits) (#5453) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7959c5de0f54c..ff33e185a69d4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'fd6a52cc84364208f65f1ee52644192d6855ab0e', + 'skia_revision': '728b7f3cdd0ad6a76c10e45fc4a4a8f4c5208c6e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8b4416bdf8d55..bf4fb806a3b9b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d9d229c1831c1b823eed816a88a6e91b +Signature: a5cb5aa06d214091f9be091211d2c8ae UNUSED LICENSES: From aa5c11d3ffae91c8322b5e32c6a2c9a81c990c72 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Mon, 4 Jun 2018 16:28:07 +0200 Subject: [PATCH 0507/1190] Roll Dart SDK to 1fe279d859 (#5454) This includes the following commits dart-lang/sdk@1fe279d859 (origin/master, origin/HEAD) Fix _FutureListener.handleError() to use explicit type for Zone.runBinary dart-lang/sdk@a9257d05fb [vm] Prepare status files for dartk reload/rollback builders (#33126) dart-lang/sdk@6ac6baae8e Record interfaceTargets for calls on dynamic receivers dart-lang/sdk@82755aa303 Rename ClosedWorld to JClosedWorld and merge it with ClosedWorldRefiner dart-lang/sdk@b58cc36ddc Extract KClosedWorld from ClosedWorld. dart-lang/sdk@9a193853d4 [VM] Mark a few tests as passing dart-lang/sdk@5c2cec0e19 Make _FilesReferencingNameTask faster by using maintained FileSystemState.knownFiles list. dart-lang/sdk@5269e21913 Fix for MockSdk on Windows. dart-lang/sdk@d0b28d2040 Fix analysis_server tests on Windows. dart-lang/sdk@9d83013040 Use known FileState from FileSystemState directly. dart-lang/sdk@b3b528648b Discover all SDK libraries. dart-lang/sdk@41e1d2cc28 [dart2js] Fix --csp dart-lang/sdk@56424f08a8 [js_runtime] Test for JavaScriptFunction type tests. dart-lang/sdk@5f9fcd0bbc [vm, x64] Remove embedded address from the implementation of math.min/max. dart-lang/sdk@025cee6f1f Skip tests of snapshot determinism on Windows. dart-lang/sdk@6ba8c711fa Observatory strong mode fix: expand the class hierarchy for debug events. dart-lang/sdk@f3502f9051 Fix bug in RTI optimization dart-lang/sdk@d319d3eda4 [vm/kernel/bytecode] Do not generate bytecode for external (native) members dart-lang/sdk@7246d2e759 Fix exception in fix processor (issue 33312) dart-lang/sdk@b19560e7ad Implement stubs for the remaining converted generators dart-lang/sdk@b7266fa3b3 [vm/kernel/bytecode] Support async/async*/sync* in bytecode generator dart-lang/sdk@c6cf61752e Update PluginWatcherTest to the fact that async functions start running synchronously. dart-lang/sdk@e1549df93f Fix regression introduced in 'Use AbstractValue in most of ssa' dart-lang/sdk@184df3aee0 Make AnalysisServer.getAnalysisResult() sync to avoid changing behavior between Dart1 and Dart2. dart-lang/sdk@99a5f149ac [vm] Enable type stubs based type checks in JIT mode for some types. dart-lang/sdk@90c4215af4 [vm] Adds full GC check on all external allocations dart-lang/sdk@bef7cd354f Observatory strong mode fix: Use .nodes= instead of .children= to accommodate text nodes. dart-lang/sdk@72aae537a2 Observatory strong mode fix: clean up port mocking. dart-lang/sdk@312f02532a [js_runtime] JavaScriptFunction matches any Dart function type dart-lang/sdk@c8860b4ca2 Remove all uses of --limit-ints-to-64-bits VM option dart-lang/sdk@5db95fbb61 Upgrade mockito to latest version. dart-lang/sdk@1bc9b8d00c Mark ContextRoot.pathContext constructor argument as required. dart-lang/sdk@b7bc0d06c4 Fix state machine in _DiscoverAvailableFilesTask.perform dart-lang/sdk@2c44dc11c7 Improve type variable recovery dart-lang/sdk@789ceee184 Update version number in DEPS for dart2js_info pkg dart-lang/sdk@0629e3afa5 [VM] Fix vm/cc/DartAPI_TypeGetParameterizedTypes test dart-lang/sdk@e18fd7c3e7 Remove the test for getNavigation() and removing the analysis context. dart-lang/sdk@2a545d7153 Initial implementations for some of the generator methods dart-lang/sdk@5f42fe5822 Simplify DartCompletionContributorTest.computeSuggestions() async behaviour. dart-lang/sdk@f6ece48aba Fix the test that want to run async code to be async. dart-lang/sdk@e9a60098bb [VM] Use UserVisibleName for types in error messages reported to users to make the error more clear. This fixes the case in issue 33303. dart-lang/sdk@cb07f74f4b Clean up some of analyzers generators based on feedback dart-lang/sdk@e9818eefd8 Update analyzer status about type parameters on constructors. dart-lang/sdk@6f68bec1bc TBR: Typos fixed dart-lang/sdk@545ad130a2 Fix a couple of bugs in the analyzer forest implementation dart-lang/sdk@85b4a799eb Search references to elements and subtypes in all known (and discovered) files. dart-lang/sdk@4fb6395058 Report error when a constructor has type parameters. dart-lang/sdk@315a186dc4 Better test error handler argument types. dart-lang/sdk@0aadba1189 Revert "[vm] Enable type stubs based type checks in JIT mode for some types." dart-lang/sdk@4be50d6fa1 [vm] Enable type stubs based type checks in JIT mode for some types. dart-lang/sdk@1d8bef0d89 Remove class TypeInferenceEngineImpl dart-lang/sdk@dd83e698d8 Add 64-bit integer semantics to the specification. dart-lang/sdk@a10eda4988 update dart2js status files dart-lang/sdk@6458b5da2f Always include added files into the list of files to discover. dart-lang/sdk@c984e63f61 Skip tests of snapshot determinism in checked mode. dart-lang/sdk@99dadf4d7f Remove unneeded (and incorrectly typed) mock step dart-lang/sdk@f87933d845 Introduce tests specific to behaviors of FunctionType. dart-lang/sdk@64cfdb4cc6 Remove _explicitTypeParameters and substitute4 from FunctionTypeImpl. dart-lang/sdk@b930ae19b1 Fix regression in deferred loading (part2) dart-lang/sdk@a0c4ac14c1 Omit redundant bounds check for Dart2 on typed setters/getters. dart-lang/sdk@2ad29cbd15 Remove unnecessary uses of toExpression dart-lang/sdk@7a76a40438 Add several other generators dart-lang/sdk@483c42b899 Switch dart2js to use dart 2 vm. dart-lang/sdk@f5d991e6a1 Support extracting selected statements into a new Flutter widget. dart-lang/sdk@89c2da2846 Add generator for unlinked names dart-lang/sdk@c911a1bef6 Clean up additional dart2js strong mode runtime error and don't add method type variable in dart 1 version. dart-lang/sdk@9a02f5bf4d [vm/kernel] Fix bugs with expression evaluation in debug mode. dart-lang/sdk@0aad13db00 Revert 'Copy @failingTest annotations to mixin applications.' dart-lang/sdk@41c5da8919 [vm] Fix non-reproducibility of VM builds. dart-lang/sdk@e8659b0f28 Remove skipTypeVariables --- DEPS | 6 +++--- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index ff33e185a69d4..08076c8fd5cbc 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '1a185867a996a91be5fdd1535d89e7d3750d0050', + 'dart_revision': '1fe279d8598693e8005b71d6db386a96f2e49ce3', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', @@ -45,7 +45,7 @@ vars = { 'dart_convert_tag': '2.0.1', 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', - 'dart_dart2js_info_tag': '0.5.6+2', + 'dart_dart2js_info_tag': '0.5.6+4', 'dart_dart_style_tag': '1.0.14', 'dart_dartdoc_tag': 'v0.20.0', 'dart_fixnum_tag': '0.10.5', @@ -63,7 +63,7 @@ vars = { 'dart_markdown_tag': '2.0.0', 'dart_matcher_tag': '0.12.1+4', 'dart_mime_tag': '0.9.6', - 'dart_mockito_tag': 'a92db054fba18bc2d605be7670aee74b7cadc00a', + 'dart_mockito_tag': 'd39ac507483b9891165e422ec98d9fb480037c8b', 'dart_mustache4dart_tag': 'v2.1.2', 'dart_oauth2_tag': '1.1.0', 'dart_observatory_pub_packages_rev': 'd3a3aebefbd35aa30fe7bbc2889b772b398f7d7f', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index bf4fb806a3b9b..a33dc2bc77516 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a5cb5aa06d214091f9be091211d2c8ae +Signature: 204ca81d3ac31d08c9ca6943047dd457 UNUSED LICENSES: From ac7d442a6f5a882035b99936425e289f5eb41401 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 4 Jun 2018 12:15:31 -0400 Subject: [PATCH 0508/1190] Roll src/third_party/skia 728b7f3..7c93472 (6 commits) (#5455) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 08076c8fd5cbc..cdb8c517f2b23 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '728b7f3cdd0ad6a76c10e45fc4a4a8f4c5208c6e', + 'skia_revision': '7c93472b079a99a33d6d4d8aae269488c94b1ce4', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a33dc2bc77516..6fb165c4e4a1e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 204ca81d3ac31d08c9ca6943047dd457 +Signature: 83071fbb93b046f6d8b6a1e3611ff4a2 UNUSED LICENSES: From 975d4ead668c8a5e8abe5b0a69a6f7f3e4984579 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 4 Jun 2018 10:55:43 -0700 Subject: [PATCH 0509/1190] libtxt: support per-locale fallback font collections (#5434) A given character may render differently in various locales, and fonts on the host system may be tagged with locale metadata in order to support this. If the text renderer needs to find a fallback font for a character, it should pass the preferred locale to Skia's font manager which can use it to find the best matching font. The font collection also needs to maintain different caches of fallback fonts for each locale. See https://github.com/flutter/flutter/pull/17879 --- .../txt/src/minikin/FontCollection.cpp | 12 +++- third_party/txt/src/minikin/FontCollection.h | 3 +- third_party/txt/src/txt/font_collection.cc | 70 ++++++++++--------- third_party/txt/src/txt/font_collection.h | 34 +++++++-- third_party/txt/src/txt/paragraph.cc | 43 ++++++++---- third_party/txt/src/txt/paragraph.h | 7 ++ 6 files changed, 110 insertions(+), 59 deletions(-) diff --git a/third_party/txt/src/minikin/FontCollection.cpp b/third_party/txt/src/minikin/FontCollection.cpp index ebbb104dd146d..a9dcc66b522e3 100644 --- a/third_party/txt/src/minikin/FontCollection.cpp +++ b/third_party/txt/src/minikin/FontCollection.cpp @@ -44,6 +44,12 @@ const uint32_t TEXT_STYLE_VS = 0xFE0E; uint32_t FontCollection::sNextId = 0; +// libtxt: return a locale string for a language list ID +std::string GetFontLocale(uint32_t langListId) { + const FontLanguages& langs = FontLanguageListCache::getById(langListId); + return langs.size() ? langs[0].getString() : ""; +} + FontCollection::FontCollection(std::shared_ptr&& typeface) : mMaxChar(0) { std::vector> typefaces; @@ -295,7 +301,8 @@ const std::shared_ptr& FontCollection::getFamilyForChar( // libtxt: check if the fallback font provider can match this character if (mFallbackFontProvider) { const std::shared_ptr& fallback = - mFallbackFontProvider->matchFallbackFont(ch); + mFallbackFontProvider->matchFallbackFont(ch, + GetFontLocale(langListId)); if (fallback) { return fallback; } @@ -332,7 +339,8 @@ const std::shared_ptr& FontCollection::getFamilyForChar( // libtxt: check if the fallback font provider can match this character if (mFallbackFontProvider) { const std::shared_ptr& fallback = - mFallbackFontProvider->matchFallbackFont(ch); + mFallbackFontProvider->matchFallbackFont(ch, + GetFontLocale(langListId)); if (fallback) { return fallback; } diff --git a/third_party/txt/src/minikin/FontCollection.h b/third_party/txt/src/minikin/FontCollection.h index 1a6525cc3f7d9..48365a64ac841 100644 --- a/third_party/txt/src/minikin/FontCollection.h +++ b/third_party/txt/src/minikin/FontCollection.h @@ -38,7 +38,8 @@ class FontCollection { public: virtual ~FallbackFontProvider() = default; virtual const std::shared_ptr& matchFallbackFont( - uint32_t ch) = 0; + uint32_t ch, + std::string locale) = 0; }; struct Run { diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index 05eebb4bf7ab3..982524d4fe8ca 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -30,15 +30,16 @@ namespace txt { -namespace { - -// Font families that will be used as a last resort if no font manager provides -// a font matching a particular character. -const std::vector last_resort_fonts{ - "Arial", -}; +bool FontCollection::FamilyKey::operator==( + const FontCollection::FamilyKey& other) const { + return font_family == other.font_family && locale == other.locale; +} -} // anonymous namespace +size_t FontCollection::FamilyKey::Hasher::operator()( + const FontCollection::FamilyKey& key) const { + return std::hash()(key.font_family) ^ + std::hash()(key.locale); +} class TxtFallbackFontProvider : public minikin::FontCollection::FallbackFontProvider { @@ -47,8 +48,9 @@ class TxtFallbackFontProvider : font_collection_(font_collection) {} virtual const std::shared_ptr& matchFallbackFont( - uint32_t ch) { - return font_collection_->MatchFallbackFont(ch); + uint32_t ch, + std::string locale) { + return font_collection_->MatchFallbackFont(ch, locale); } private: @@ -92,15 +94,19 @@ void FontCollection::DisableFontFallback() { } std::shared_ptr -FontCollection::GetMinikinFontCollectionForFamily(const std::string& family) { +FontCollection::GetMinikinFontCollectionForFamily( + const std::string& font_family, + const std::string& locale) { // Look inside the font collections cache first. - auto cached = font_collections_cache_.find(family); + FamilyKey family_key(font_family, locale); + auto cached = font_collections_cache_.find(family_key); if (cached != font_collections_cache_.end()) { return cached->second; } for (sk_sp& manager : GetFontManagerOrder()) { - sk_sp font_style_set(manager->matchFamily(family.c_str())); + sk_sp font_style_set( + manager->matchFamily(font_family.c_str())); if (font_style_set == nullptr || font_style_set->count() == 0) { continue; } @@ -136,8 +142,8 @@ FontCollection::GetMinikinFontCollectionForFamily(const std::string& family) { minikin_family, }; if (enable_font_fallback_) { - for (const auto& fallback : fallback_fonts_) - minikin_families.push_back(fallback.second); + for (SkFontID font_id : fallback_fonts_for_locale_[locale]) + minikin_families.push_back(fallback_fonts_[font_id]); } // Create the minikin font collection. @@ -149,16 +155,16 @@ FontCollection::GetMinikinFontCollectionForFamily(const std::string& family) { } // Cache the font collection for future queries. - font_collections_cache_[family] = font_collection; + font_collections_cache_[family_key] = font_collection; return font_collection; } const auto default_font_family = GetDefaultFontFamily(); - if (family != default_font_family) { + if (font_family != default_font_family) { std::shared_ptr default_collection = - GetMinikinFontCollectionForFamily(default_font_family); - font_collections_cache_[family] = default_collection; + GetMinikinFontCollectionForFamily(default_font_family, ""); + font_collections_cache_[family_key] = default_collection; return default_collection; } @@ -167,21 +173,27 @@ FontCollection::GetMinikinFontCollectionForFamily(const std::string& family) { } const std::shared_ptr& FontCollection::MatchFallbackFont( - uint32_t ch) { + uint32_t ch, + std::string locale) { for (const sk_sp& manager : GetFontManagerOrder()) { - sk_sp typeface( - manager->matchFamilyStyleCharacter(0, SkFontStyle(), nullptr, 0, ch)); + std::vector bcp47; + if (!locale.empty()) + bcp47.push_back(locale.c_str()); + sk_sp typeface(manager->matchFamilyStyleCharacter( + 0, SkFontStyle(), bcp47.data(), bcp47.size(), ch)); if (!typeface) continue; - return GetFontFamilyForTypeface(typeface); + fallback_fonts_for_locale_[locale].insert(typeface->uniqueID()); + + return GetFallbackFont(typeface); } return null_family_; } const std::shared_ptr& -FontCollection::GetFontFamilyForTypeface(const sk_sp& typeface) { +FontCollection::GetFallbackFont(const sk_sp& typeface) { SkFontID typeface_id = typeface->uniqueID(); auto fallback_it = fallback_fonts_.find(typeface_id); if (fallback_it != fallback_fonts_.end()) { @@ -202,14 +214,4 @@ FontCollection::GetFontFamilyForTypeface(const sk_sp& typeface) { return insert_it.first->second; } -void FontCollection::UpdateFallbackFonts(sk_sp manager) { - for (const std::string& family : last_resort_fonts) { - sk_sp typeface( - manager->matchFamilyStyle(family.c_str(), SkFontStyle())); - if (typeface) { - GetFontFamilyForTypeface(typeface); - } - } -} - } // namespace txt diff --git a/third_party/txt/src/txt/font_collection.h b/third_party/txt/src/txt/font_collection.h index 4da4e3d02552c..0640a0974a2ea 100644 --- a/third_party/txt/src/txt/font_collection.h +++ b/third_party/txt/src/txt/font_collection.h @@ -17,8 +17,8 @@ #ifndef LIB_TXT_SRC_FONT_COLLECTION_H_ #define LIB_TXT_SRC_FONT_COLLECTION_H_ -#include #include +#include #include #include #include "lib/fxl/macros.h" @@ -28,6 +28,7 @@ #include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/ports/SkFontMgr.h" #include "txt/asset_font_manager.h" +#include "txt/text_style.h" namespace txt { @@ -44,32 +45,51 @@ class FontCollection : public std::enable_shared_from_this { void SetTestFontManager(sk_sp font_manager); std::shared_ptr GetMinikinFontCollectionForFamily( - const std::string& family); + const std::string& family, + const std::string& locale); - const std::shared_ptr& MatchFallbackFont(uint32_t ch); + const std::shared_ptr& MatchFallbackFont( + uint32_t ch, + std::string locale); // Do not provide alternative fonts that can match characters which are // missing from the requested font family. void DisableFontFallback(); private: + struct FamilyKey { + FamilyKey(const std::string& family, const std::string& loc) + : font_family(family), locale(loc) {} + + std::string font_family; + std::string locale; + + bool operator==(const FamilyKey& other) const; + + struct Hasher { + size_t operator()(const FamilyKey& key) const; + }; + }; + sk_sp default_font_manager_; sk_sp asset_font_manager_; sk_sp test_font_manager_; - std::unordered_map> + std::unordered_map, + FamilyKey::Hasher> font_collections_cache_; std::unordered_map> fallback_fonts_; + std::unordered_map> + fallback_fonts_for_locale_; std::shared_ptr null_family_; bool enable_font_fallback_; std::vector> GetFontManagerOrder() const; - const std::shared_ptr& GetFontFamilyForTypeface( + const std::shared_ptr& GetFallbackFont( const sk_sp& typeface); - void UpdateFallbackFonts(sk_sp manager); - FXL_DISALLOW_COPY_AND_ASSIGN(FontCollection); }; diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index bcebc596684af..a2fd816a84dd5 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -160,16 +160,6 @@ void GetFontAndMinikinPaint(const TextStyle& style, paint->paintFlags |= minikin::LinearTextFlag; } -sk_sp GetDefaultSkiaTypeface( - const std::shared_ptr& font_collection, - const TextStyle& style) { - std::shared_ptr collection = - font_collection->GetMinikinFontCollectionForFamily(style.font_family); - minikin::FakedFont faked_font = - collection->baseFontFaked(GetMinikinFontStyle(style)); - return static_cast(faked_font.font)->GetSkTypeface(); -} - void FindWords(const std::vector& text, size_t start, size_t end, @@ -286,8 +276,7 @@ bool Paragraph::ComputeLineBreaks() { minikin::MinikinPaint paint; GetFontAndMinikinPaint(run.style, &font, &paint); std::shared_ptr collection = - font_collection_->GetMinikinFontCollectionForFamily( - run.style.font_family); + GetMinikinFontCollectionForStyle(run.style); if (collection == nullptr) { FXL_LOG(INFO) << "Could not find font collection for family \"" << run.style.font_family << "\"."; @@ -502,8 +491,7 @@ void Paragraph::Layout(double width, bool force) { paint.setTextSize(run.style().font_size); std::shared_ptr minikin_font_collection = - font_collection_->GetMinikinFontCollectionForFamily( - run.style().font_family); + GetMinikinFontCollectionForStyle(run.style()); // Lay out this run. uint16_t* text_ptr = text_.data(); @@ -753,7 +741,7 @@ void Paragraph::Layout(double width, bool force) { if (paint_records.empty()) { SkPaint::FontMetrics metrics; TextStyle style(paragraph_style_.GetTextStyle()); - paint.setTypeface(GetDefaultSkiaTypeface(font_collection_, style)); + paint.setTypeface(GetDefaultSkiaTypeface(style)); paint.setTextSize(style.font_size); paint.getFontMetrics(&metrics); update_line_metrics(metrics, style); @@ -855,6 +843,31 @@ void Paragraph::SetFontCollection( font_collection_ = std::move(font_collection); } +std::shared_ptr +Paragraph::GetMinikinFontCollectionForStyle(const TextStyle& style) { + std::string locale; + if (!style.locale.empty()) { + uint32_t language_list_id = + minikin::FontStyle::registerLanguageList(style.locale); + const minikin::FontLanguages& langs = + minikin::FontLanguageListCache::getById(language_list_id); + if (langs.size()) { + locale = langs[0].getString(); + } + } + + return font_collection_->GetMinikinFontCollectionForFamily(style.font_family, + locale); +} + +sk_sp Paragraph::GetDefaultSkiaTypeface(const TextStyle& style) { + std::shared_ptr collection = + GetMinikinFontCollectionForStyle(style); + minikin::FakedFont faked_font = + collection->baseFontFaked(GetMinikinFontStyle(style)); + return static_cast(faked_font.font)->GetSkTypeface(); +} + // The x,y coordinates will be the very top left corner of the rendered // paragraph. void Paragraph::Paint(SkCanvas* canvas, double x, double y) { diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index 894439abc5965..edbff5e56a80f 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -313,6 +313,13 @@ class Paragraph { // Draws the background onto the canvas. void PaintBackground(SkCanvas* canvas, const PaintRecord& record); + // Obtain a Minikin font collection matching this text style. + std::shared_ptr GetMinikinFontCollectionForStyle( + const TextStyle& style); + + // Get a default SkTypeface for a text style. + sk_sp GetDefaultSkiaTypeface(const TextStyle& style); + FXL_DISALLOW_COPY_AND_ASSIGN(Paragraph); }; From 8c84737ea882433adfa0f2cbd1f41c221c1676c2 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Mon, 4 Jun 2018 14:46:12 -0400 Subject: [PATCH 0510/1190] Update GrVkBackendContext to no longer own the VkInstance and VkDevice (#5457) This changes the ownership of the VkInstance and VkDevice back to the flutter's objects. I am trying to move skia into a world where GrVkBackendContext is purely a description of the vulkan context skia should use and is just passed in during GrContext creation. It shouldn't need to be ref counted or actually do work in destructor (those changes to come later). This is just a first step towards getting there. --- vulkan/vulkan_window.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vulkan/vulkan_window.cc b/vulkan/vulkan_window.cc index 907a15a097240..4b9be79513d4b 100644 --- a/vulkan/vulkan_window.cc +++ b/vulkan/vulkan_window.cc @@ -129,11 +129,6 @@ sk_sp VulkanWindow::CreateSkiaBackendContext() { return nullptr; } - // The Skia backend context takes ownership of the device and the instance. - // Make sure we release our ownership now. - logical_device_->ReleaseDeviceOwnership(); - application_->ReleaseInstanceOwnership(); - auto context = sk_make_sp(); context->fInstance = application_->GetInstance(); context->fPhysicalDevice = logical_device_->GetPhysicalDeviceHandle(); @@ -146,6 +141,7 @@ sk_sp VulkanWindow::CreateSkiaBackendContext() { surface_->GetNativeSurface().GetSkiaExtensionName(); context->fFeatures = skia_features; context->fInterface.reset(interface.release()); + context->fOwnsInstanceAndDevice = false; return context; } From f2992a1f5ba40145951891f51c9a18687967b36d Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 4 Jun 2018 15:40:31 -0400 Subject: [PATCH 0511/1190] Roll src/third_party/skia 7c93472..69d0e51 (3 commits) (#5460) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index cdb8c517f2b23..5c9122d9c0336 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7c93472b079a99a33d6d4d8aae269488c94b1ce4', + 'skia_revision': '69d0e51d74d8a0e38626c1973655214cabda62d9', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 6fb165c4e4a1e..0edca2a949332 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 83071fbb93b046f6d8b6a1e3611ff4a2 +Signature: 23f0d61eac9d7203ad3345d8c9c4fa21 UNUSED LICENSES: From 44863aa4f5dbaaeb3233383264729138b083e9c5 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Mon, 4 Jun 2018 15:46:24 -0400 Subject: [PATCH 0512/1190] Remove uses of ReleaseOwnership from vulkan backend (#5458) * Remove uses of ReleaseOwnership from vulkan backend. Flutter no longer needs to release ownership of objects to skia so this change removes the api calls. * Remove Release call from vulkan_device.cc * Update vulkan_application.h * Update vulkan_application.cc * Update vulkan_handle.h --- vulkan/vulkan_application.cc | 4 ---- vulkan/vulkan_application.h | 2 -- vulkan/vulkan_device.cc | 4 ---- vulkan/vulkan_device.h | 2 -- vulkan/vulkan_handle.h | 5 ----- 5 files changed, 17 deletions(-) diff --git a/vulkan/vulkan_application.cc b/vulkan/vulkan_application.cc index eaba000274ca4..7ba881b843181 100644 --- a/vulkan/vulkan_application.cc +++ b/vulkan/vulkan_application.cc @@ -129,10 +129,6 @@ const VulkanHandle& VulkanApplication::GetInstance() const { return instance_; } -void VulkanApplication::ReleaseInstanceOwnership() { - instance_.ReleaseOwnership(); -} - std::vector VulkanApplication::GetPhysicalDevices() const { if (!IsValid()) { return {}; diff --git a/vulkan/vulkan_application.h b/vulkan/vulkan_application.h index a5f20c07f63ec..9274701f95801 100644 --- a/vulkan/vulkan_application.h +++ b/vulkan/vulkan_application.h @@ -38,8 +38,6 @@ class VulkanApplication { const VulkanHandle& GetInstance() const; - void ReleaseInstanceOwnership(); - std::unique_ptr AcquireFirstCompatibleLogicalDevice() const; private: diff --git a/vulkan/vulkan_device.cc b/vulkan/vulkan_device.cc index bb6c2e8a1437c..745110ed70f2c 100644 --- a/vulkan/vulkan_device.cc +++ b/vulkan/vulkan_device.cc @@ -153,10 +153,6 @@ const VulkanHandle& VulkanDevice::GetHandle() const { return device_; } -void VulkanDevice::ReleaseDeviceOwnership() { - device_.ReleaseOwnership(); -} - const VulkanHandle& VulkanDevice::GetPhysicalDeviceHandle() const { return physical_device_; diff --git a/vulkan/vulkan_device.h b/vulkan/vulkan_device.h index e9abf757f6a94..e32f37d7ed57b 100644 --- a/vulkan/vulkan_device.h +++ b/vulkan/vulkan_device.h @@ -35,8 +35,6 @@ class VulkanDevice { uint32_t GetGraphicsQueueIndex() const; - void ReleaseDeviceOwnership(); - FXL_WARN_UNUSED_RESULT bool GetSurfaceCapabilities(const VulkanSurface& surface, VkSurfaceCapabilitiesKHR* capabilities) const; diff --git a/vulkan/vulkan_handle.h b/vulkan/vulkan_handle.h index 87f535e9b9132..32f1f938e25bb 100644 --- a/vulkan/vulkan_handle.h +++ b/vulkan/vulkan_handle.h @@ -50,11 +50,6 @@ class VulkanHandle { operator Handle() const { return handle_; } - /// Relinquish responsibility of collecting the underlying handle when this - /// object is collected. It is the responsibility of the caller to ensure that - /// the lifetime of the handle extends past the lifetime of this object. - void ReleaseOwnership() { disposer_ = nullptr; } - void Reset() { DisposeIfNecessary(); } private: From 3d87b27172e36faa82c19a83cc0ff92f3c5f2e19 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 4 Jun 2018 13:28:38 -0700 Subject: [PATCH 0513/1190] libtxt: fix bug in calculating line end positions excluding whitespace (#5459) Fixes https://github.com/flutter/flutter/issues/18014 --- third_party/txt/src/txt/paragraph.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index a2fd816a84dd5..1ece631fd57c1 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -303,7 +303,7 @@ bool Paragraph::ComputeLineBreaks() { (hard_break && line_end < text_.size()) ? line_end + 1 : line_end; size_t line_end_excluding_whitespace = line_end; while ( - line_end_excluding_whitespace > 0 && + line_end_excluding_whitespace > line_start && minikin::isLineEndSpace(text_[line_end_excluding_whitespace - 1])) { line_end_excluding_whitespace--; } From 366d0e3ef7cc195de7411cff66a7a9e22c11c181 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 4 Jun 2018 15:01:58 -0700 Subject: [PATCH 0514/1190] Fix Dart project configuration for headless Dart runners. (#5461) --- .../ios/framework/Source/FlutterHeadlessDartRunner.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm index dee11d08934a5..add5a78dc4a4c 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm @@ -17,6 +17,7 @@ #include "flutter/shell/common/switches.h" #include "flutter/shell/common/thread_host.h" #include "flutter/shell/platform/darwin/common/command_line.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" #include "lib/fxl/functional/make_copyable.h" static std::unique_ptr CreateHeadlessPlatformView(shell::Shell& shell) { @@ -72,10 +73,16 @@ - (void)runWithEntrypoint:(NSString*)entrypoint { return; } + FlutterDartProject* project = + [[[FlutterDartProject alloc] initFromDefaultSourceForConfiguration] autorelease]; + + auto config = project.runConfiguration; + + config.SetEntrypoint(entrypoint.UTF8String); + // Override the default run configuration with the specified entrypoint. _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = _shell->GetEngine(), - config = shell::RunConfiguration::InferFromSettings(settings)]() mutable { + fxl::MakeCopyable([engine = _shell->GetEngine(), config = std::move(config)]() mutable { if (!engine || !engine->Run(std::move(config))) { FXL_LOG(ERROR) << "Could not launch engine with configuration."; } From 014a53f588bd36d20fbe143650d32c5aea7ee395 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 4 Jun 2018 19:07:31 -0400 Subject: [PATCH 0515/1190] Roll src/third_party/skia 69d0e51..5034384 (2 commits) (#5462) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5c9122d9c0336..1f8668e0e0153 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '69d0e51d74d8a0e38626c1973655214cabda62d9', + 'skia_revision': '503438477e842d30d6e019720700d7853915f2e3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 0edca2a949332..861f4f98b7a18 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 23f0d61eac9d7203ad3345d8c9c4fa21 +Signature: d1929243eb45378a789300ee43d0a744 UNUSED LICENSES: From 0b60f450caee527c9e21e4de85611f51b57ebe27 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 4 Jun 2018 22:32:32 -0400 Subject: [PATCH 0516/1190] Roll src/third_party/skia 5034384..ddd92dc (3 commits) (#5463) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1f8668e0e0153..cf0d74db4ad71 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '503438477e842d30d6e019720700d7853915f2e3', + 'skia_revision': 'ddd92dc70b2349d5adf31fa369b20402d4550191', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 861f4f98b7a18..5c0b4b7a0288f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d1929243eb45378a789300ee43d0a744 +Signature: ccabd57e8a0e21b3fc2bc4fc72e53066 UNUSED LICENSES: From 8ecdc30989b68580b9f1659cfc5546ab20eac77f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 5 Jun 2018 01:57:31 -0400 Subject: [PATCH 0517/1190] Roll src/third_party/skia ddd92dc..4588ff3 (1 commits) (#5464) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index cf0d74db4ad71..d9d5ebc3b47ff 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ddd92dc70b2349d5adf31fa369b20402d4550191', + 'skia_revision': '4588ff3b4f8bb97be2fefc6dddd5bbd0758e6a54', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5c0b4b7a0288f..05bc4fefdfcea 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ccabd57e8a0e21b3fc2bc4fc72e53066 +Signature: 376137409419ab35f2c40a32c30ff0c0 UNUSED LICENSES: From 2a4d926ab7a2724a3ce63293766efc70a0f9b58d Mon Sep 17 00:00:00 2001 From: Mikkel Nygaard Ravn Date: Tue, 5 Jun 2018 08:19:07 +0200 Subject: [PATCH 0518/1190] Update FlutterPluginRegistrxxx docs for iOS (#5415) --- .../ios/framework/Headers/FlutterPlugin.h | 38 +++++++++++++++++-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index 1fe71dd8b2ca1..ae6b730fa40d0 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -24,11 +24,22 @@ NS_ASSUME_NONNULL_BEGIN @protocol FlutterPlugin @required /** - Registers this plugin. + Registers this plugin using the context information and callback registration + methods exposed by the given registrar. + + The registrar is obtained from a `FlutterPluginRegistry` which keeps track of + the identity of registered plugins and provides basic support for cross-plugin + coordination. + + The caller of this method, a plugin registrant, is usually autogenerated by + Flutter tooling based on declared plugin dependencies. The generated registrant + asks the registry for a registrar for each plugin, and calls this method to + allow the plugin to initialize itself and register callbacks with application + objects available through the registrar protocol. - Parameters: - registrar: A helper providing application context and methods for - registering callbacks + registering callbacks. */ + (void)registerWithRegistrar:(NSObject*)registrar; @optional @@ -158,7 +169,13 @@ NS_ASSUME_NONNULL_BEGIN @end /** - Registration context for a single `FlutterPlugin`. + Registration context for a single `FlutterPlugin`, providing a one stop shop + for the plugin to access contextual information and register callbacks for + various application events. + + Registrars are obtained from a `FlutterPluginRegistry` which keeps track of + the identity of registered plugins and provides basic support for cross-plugin + coordination. */ @protocol FlutterPluginRegistrar /** @@ -234,7 +251,20 @@ NS_ASSUME_NONNULL_BEGIN A registry of Flutter iOS plugins. Plugins are identified by unique string keys, typically the name of the - plugin's main class. + plugin's main class. The registry tracks plugins by this key, mapping it to + a value published by the plugin during registration, if any. This provides a + very basic means of cross-plugin coordination with loose coupling between + unrelated plugins. + + Plugins typically need contextual information and the ability to register + callbacks for various application events. To keep the API of the registry + focused, these facilities are not provided directly by the registry, but by + a `FlutterPluginRegistrar`, created by the registry in exchange for the unique + key of the plugin. + + There is no implied connection between the registry and the registrar. + Specifically, callbacks registered by the plugin via the registrar may be + relayed directly to the underlying iOS application objects. */ @protocol FlutterPluginRegistry /** From d913985ec647212438dd688e0b105c5a6a4097f5 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 5 Jun 2018 05:25:31 -0400 Subject: [PATCH 0519/1190] Roll src/third_party/skia 4588ff3..9856c3d (1 commits) (#5465) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d9d5ebc3b47ff..01c31d053a694 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4588ff3b4f8bb97be2fefc6dddd5bbd0758e6a54', + 'skia_revision': '9856c3dd394ba6c010f1715e42e41eff8c03b2c6', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 05bc4fefdfcea..adbadb02a895e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 376137409419ab35f2c40a32c30ff0c0 +Signature: 2fab8ee95ff36ff1c7741e1c7cdf5194 UNUSED LICENSES: From e4597108378e4826625dddbbb8dbcf0e93da9066 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 5 Jun 2018 08:51:31 -0400 Subject: [PATCH 0520/1190] Roll src/third_party/skia 9856c3d..4295859 (1 commits) (#5466) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 01c31d053a694..b4dd21a7a1ea1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9856c3dd394ba6c010f1715e42e41eff8c03b2c6', + 'skia_revision': '4295859f4b675bdecdcc5d0d8a8ca10e779629be', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index adbadb02a895e..b7082ae27342e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2fab8ee95ff36ff1c7741e1c7cdf5194 +Signature: c10f95d8769c7f8b5cd3db6fad9ffbe8 UNUSED LICENSES: From a83b37d35acd8afd82be3f567a4b7231d5bdb928 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Tue, 5 Jun 2018 08:35:44 -0700 Subject: [PATCH 0521/1190] Roll dart to a5e41681e55d1e74684bfff530218db556d77ee8 (#5467) * Roll dart to a5e41681e55d1e74684bfff530218db556d77ee8. * Update license --- DEPS | 2 +- lib/snapshot/libraries.json | 1 - lib/snapshot/libraries.yaml | 1 - runtime/dart_vm.cc | 1 - travis/licenses_golden/licenses_third_party | 2 +- 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index b4dd21a7a1ea1..72107457afb20 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '1fe279d8598693e8005b71d6db386a96f2e49ce3', + 'dart_revision': 'a5e41681e55d1e74684bfff530218db556d77ee8', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', diff --git a/lib/snapshot/libraries.json b/lib/snapshot/libraries.json index fe0ec53dcc8b7..a59ae6c6624f6 100644 --- a/lib/snapshot/libraries.json +++ b/lib/snapshot/libraries.json @@ -11,7 +11,6 @@ "../../../third_party/dart/runtime/lib/core_patch.dart", "../../../third_party/dart/runtime/lib/array.dart", "../../../third_party/dart/runtime/lib/array_patch.dart", - "../../../third_party/dart/runtime/lib/bigint.dart", "../../../third_party/dart/runtime/lib/bigint_patch.dart", "../../../third_party/dart/runtime/lib/bool_patch.dart", "../../../third_party/dart/runtime/lib/date_patch.dart", diff --git a/lib/snapshot/libraries.yaml b/lib/snapshot/libraries.yaml index 46157be76e1fc..26c3277054c7d 100644 --- a/lib/snapshot/libraries.yaml +++ b/lib/snapshot/libraries.yaml @@ -49,7 +49,6 @@ flutter: - "../../../third_party/dart/runtime/lib/core_patch.dart" - "../../../third_party/dart/runtime/lib/array.dart" - "../../../third_party/dart/runtime/lib/array_patch.dart" - - "../../../third_party/dart/runtime/lib/bigint.dart" - "../../../third_party/dart/runtime/lib/bigint_patch.dart" - "../../../third_party/dart/runtime/lib/bool_patch.dart" - "../../../third_party/dart/runtime/lib/date_patch.dart" diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 422984feb39a0..d53db8aafcf46 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -63,7 +63,6 @@ static const char* kDartLanguageArgs[] = { "--background_compilation", "--await_is_keyword", "--causal_async_stacks", - "--enable_kernel_expression_compilation=false", // TODO(dartbug.com/33087) // clang-format on }; diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b7082ae27342e..8266bb4adb6dd 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c10f95d8769c7f8b5cd3db6fad9ffbe8 +Signature: cb51c3fb11b21564f078c78d7d5d5bc1 UNUSED LICENSES: From 7036e24440508234f63e2573f2d1899d396b2a46 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 5 Jun 2018 12:17:31 -0400 Subject: [PATCH 0522/1190] Roll src/third_party/skia 4295859..8f9c325 (6 commits) (#5468) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/DEPS b/DEPS index 72107457afb20..da86f2b693ab3 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4295859f4b675bdecdcc5d0d8a8ca10e779629be', + 'skia_revision': '8f9c325df591f5f63813376578e6287aace4aaae', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8266bb4adb6dd..8764c5e40dc1e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: cb51c3fb11b21564f078c78d7d5d5bc1 +Signature: 4d42ca1224a89af70ad1eddba8af03bc UNUSED LICENSES: @@ -234,7 +234,6 @@ FILE: ../../../third_party/boringssl/src/util/fipstools/testdata/x86_64-LabelRew FILE: ../../../third_party/boringssl/src/util/fipstools/testdata/x86_64-LabelRewrite/out.s FILE: ../../../third_party/boringssl/src/util/fipstools/testdata/x86_64-Sections/in.s FILE: ../../../third_party/boringssl/src/util/fipstools/testdata/x86_64-Sections/out.s -FILE: ../../../third_party/dart/runtime/lib/bigint.dart FILE: ../../../third_party/dart/runtime/lib/bigint_patch.dart ---------------------------------------------------------------------------------------------------- OpenSSL License @@ -4474,9 +4473,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/dart/LICENSE +ORIGIN: ../../../third_party/dart/runtime/lib/class_id.cc + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/lib/bigint.dart FILE: ../../../third_party/dart/runtime/lib/class_id.cc FILE: ../../../third_party/dart/runtime/lib/class_id.dart FILE: ../../../third_party/dart/runtime/lib/convert_patch.dart @@ -4511,7 +4509,6 @@ FILE: ../../../third_party/dart/runtime/platform/safe_stack.h FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart FILE: ../../../third_party/dart/runtime/vm/ast_transformer.cc FILE: ../../../third_party/dart/runtime/vm/ast_transformer.h -FILE: ../../../third_party/dart/runtime/vm/bigint_test.cc FILE: ../../../third_party/dart/runtime/vm/bit_set_test.cc FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc @@ -5774,6 +5771,9 @@ ORIGIN: ../../../third_party/dart/runtime/bin/typed_data_utils.cc + ../../../thi TYPE: LicenseType.bsd FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.cc FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.h +FILE: ../../../third_party/dart/runtime/vm/base64.cc +FILE: ../../../third_party/dart/runtime/vm/base64.h +FILE: ../../../third_party/dart/runtime/vm/base64_test.cc FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc @@ -6277,9 +6277,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart +ORIGIN: ../../../third_party/dart/runtime/lib/bigint_patch.dart TYPE: LicenseType.mit -FILE: ../../../third_party/dart/runtime/lib/bigint.dart FILE: ../../../third_party/dart/runtime/lib/bigint_patch.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2003-2005 Tom Wu @@ -6315,9 +6314,8 @@ and disclaimer. ==================================================================================================== LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/lib/bigint.dart + ../../../third_party/boringssl/src/LICENSE +ORIGIN: ../../../third_party/dart/runtime/lib/bigint_patch.dart + ../../../third_party/boringssl/src/LICENSE TYPE: LicenseType.unknown -FILE: ../../../third_party/dart/runtime/lib/bigint.dart FILE: ../../../third_party/dart/runtime/lib/bigint_patch.dart ---------------------------------------------------------------------------------------------------- Copyright 2009 The Go Authors. All rights reserved. From 1125bf51b28fef0549ad859a6ac08a77b2d4ffbf Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Tue, 5 Jun 2018 11:25:09 -0700 Subject: [PATCH 0523/1190] Roll buildroot to 71c24e682181d0b6a7e3974e5a678678650f4da3 (#5469) --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index da86f2b693ab3..6a3d56de2865f 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '02eee3f72574fd5d30454487b5083e704b32cca4', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '71c24e682181d0b6a7e3974e5a678678650f4da3', # Fuchsia compatibility # From 1be8766ac57ec57cfd0bb17878e45c7506d51c82 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 5 Jun 2018 15:41:32 -0400 Subject: [PATCH 0524/1190] Roll src/third_party/skia 8f9c325..5e6853d (5 commits) (#5470) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 6a3d56de2865f..5717ea757c14b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8f9c325df591f5f63813376578e6287aace4aaae', + 'skia_revision': '5e6853ddfd08c9b11351665df42eadab54e0bdae', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8764c5e40dc1e..a2dd7d46a88be 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4d42ca1224a89af70ad1eddba8af03bc +Signature: e65b667accd33ea6d59a908c7dce1eb9 UNUSED LICENSES: From cce4fd2279deff868c4f89296dd6966c9000f11e Mon Sep 17 00:00:00 2001 From: Stanislav Baranov Date: Tue, 5 Jun 2018 13:11:18 -0700 Subject: [PATCH 0525/1190] Remove unused argument. (#5471) --- .../android/io/flutter/app/FlutterActivityDelegate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index b7c31ac9ba3fc..a50e1da8c2eba 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -356,7 +356,7 @@ private boolean loadIntent(Intent intent, boolean reuseIsolate) { flutterView.setInitialRoute(route); } if (!flutterView.getFlutterNativeView().isApplicationRunning()) { - flutterView.runFromBundle(appBundlePath, intent.getStringExtra("snapshot"), "main", reuseIsolate); + flutterView.runFromBundle(appBundlePath, null, "main", reuseIsolate); } return true; } From a09b4fdcb76c6bdf4fb705022dfa734b3b0b25b9 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Tue, 5 Jun 2018 14:52:52 -0700 Subject: [PATCH 0526/1190] Adds dynamic, interpreter configs to tools/gn (#5446) Adds --dynamic and --interpreter flags to tools/gn. These flags result in engines with properties as follows: --dynamic: - JIT targeting native code on Android and DBC on iOS --interpreter - Target DBC even if running on Android. For example: gn --android --dynamic --interpreter --runtime-mode release Will generate an engine: - Without Dart asserts - Without Observatory - With JIT compililation to DBC into out/android_dynamic_release_dbc --- BUILD.gn | 4 +++- common/config.gni | 8 +++++++- runtime/BUILD.gn | 4 +++- runtime/dart_vm.cc | 14 ++++++++++--- shell/common/switches.cc | 3 ++- shell/platform/android/BUILD.gn | 4 +++- shell/platform/darwin/ios/BUILD.gn | 4 +++- tools/gn | 32 +++++++++++++++++++++++++----- 8 files changed, 59 insertions(+), 14 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 1cbe0fc8fd189..91709a0e558a9 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -17,7 +17,9 @@ group("flutter") { public_deps += [ "$flutter_root/shell/testing" ] } - if (flutter_runtime_mode != "debug") { + if (flutter_runtime_mode != "debug" && + flutter_runtime_mode != "dynamic_profile" && + flutter_runtime_mode != "dynamic_release") { public_deps += [ "$flutter_root/lib/snapshot:entry_points_json_files" ] } diff --git a/common/config.gni b/common/config.gni index 0c251878416bc..dd08c934dc22d 100644 --- a/common/config.gni +++ b/common/config.gni @@ -14,7 +14,7 @@ declare_args() { # Enable ahead-of-time compilation on platforms where AOT is optional. flutter_aot = false - # The runtime mode ("debug", "profile", or "release") + # The runtime mode ("debug", "profile", "release", "dynamic_profile", or "dynamic_release") flutter_runtime_mode = "debug" } @@ -24,6 +24,8 @@ feature_defines_list = [ "FLUTTER_RUNTIME_MODE_DEBUG=1", "FLUTTER_RUNTIME_MODE_PROFILE=2", "FLUTTER_RUNTIME_MODE_RELEASE=3", + "FLUTTER_RUNTIME_MODE_DYNAMIC_PROFILE=4", + "FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE=5", ] if (flutter_runtime_mode == "debug") { @@ -32,6 +34,10 @@ if (flutter_runtime_mode == "debug") { feature_defines_list += [ "FLUTTER_RUNTIME_MODE=2" ] } else if (flutter_runtime_mode == "release") { feature_defines_list += [ "FLUTTER_RUNTIME_MODE=3" ] +} else if (flutter_runtime_mode == "dynamic_profile") { + feature_defines_list += [ "FLUTTER_RUNTIME_MODE=4" ] +} else if (flutter_runtime_mode == "dynamic_release") { + feature_defines_list += [ "FLUTTER_RUNTIME_MODE=5" ] } else { feature_defines_list += [ "FLUTTER_RUNTIME_MODE=0" ] } diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 421bf3548f440..7ec76542fb1c7 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -104,7 +104,9 @@ source_set("runtime") { public_configs = [ "$flutter_root:config" ] - if (flutter_runtime_mode != "release" && !is_fuchsia) { + if (flutter_runtime_mode != "release" && + flutter_runtime_mode != "dynamic_release" && + !is_fuchsia) { # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia # instead puts Observatory into the runner's package. deps += [ "//third_party/dart/runtime/observatory:embedded_observatory_archive" ] diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index d53db8aafcf46..776fbab983e10 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -39,7 +39,8 @@ namespace dart { namespace observatory { -#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) +#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE) && \ + (FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE) // These two symbols are defined in |observatory_archive.cc| which is generated // by the |//third_party/dart/runtime/observatory:archive_observatory| rule. @@ -49,7 +50,8 @@ extern unsigned int observatory_assets_archive_len; extern const uint8_t* observatory_assets_archive; #endif // !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE != - // FLUTTER_RUNTIME_MODE_RELEASE) + // FLUTTER_RUNTIME_MODE_RELEASE) && (FLUTTER_RUNTIME_MODE != + // FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE) } // namespace observatory } // namespace dart @@ -150,7 +152,8 @@ bool DartFileModifiedCallback(const char* source_url, int64_t since_ms) { void ThreadExitCallback() {} Dart_Handle GetVMServiceAssetsArchiveCallback() { -#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) +#if (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_RELEASE) || \ + (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE) return nullptr; #elif OS_FUCHSIA std::vector observatory_assets_archive; @@ -325,6 +328,11 @@ DartVM::DartVM(const Settings& settings, // precompiled code only in the debug product mode. bool use_checked_mode = !settings.dart_non_checked_mode; +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_PROFILE || \ + FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE + use_checked_mode = false; +#endif + #if !OS_FUCHSIA if (IsRunningPrecompiledCode()) { use_checked_mode = false; diff --git a/shell/common/switches.cc b/shell/common/switches.cc index d53bdb1adfc6f..33752d6f94a4d 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -227,7 +227,8 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { settings.dart_flags.push_back(*it); } -#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE +#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE && \ + FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE settings.trace_skia = command_line.HasOption(FlagForSwitch(Switch::TraceSkia)); #endif diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 1a35925546936..049c6d2c0df00 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -64,7 +64,9 @@ shared_library("flutter_shell_native") { "//third_party/skia", "//third_party/skia:gpu", ] - if (flutter_runtime_mode == "debug") { + if (flutter_runtime_mode == "debug" || + flutter_runtime_mode == "dynamic_profile" || + flutter_runtime_mode == "dynamic_release") { deps += [ "//third_party/dart/runtime:libdart_jit" ] } else { deps += [ "//third_party/dart/runtime:libdart_precompiled_runtime" ] diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index c4c4acea8b5f6..ed3f86e77f0cb 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -101,7 +101,9 @@ shared_library("create_flutter_framework_dylib") { "//third_party/skia", "//third_party/skia:gpu", ] - if (flutter_runtime_mode == "debug") { + if (flutter_runtime_mode == "debug" || + flutter_runtime_mode == "dynamic_profile" || + flutter_runtime_mode == "dynamic_release") { deps += [ "$flutter_root/lib/snapshot", "//third_party/dart/runtime:libdart_jit", diff --git a/tools/gn b/tools/gn index 923a12f6de124..94dcdcf4ced73 100755 --- a/tools/gn +++ b/tools/gn @@ -16,6 +16,9 @@ def get_out_dir(args): else: target_dir = ['host'] + if args.dynamic: + target_dir.append('dynamic') + target_dir.append(args.runtime_mode) if args.simulator: @@ -24,6 +27,9 @@ def get_out_dir(args): if args.unoptimized: target_dir.append('unopt') + if args.target_os != 'ios' and args.interpreter: + target_dir.append('interpreter') + if args.android_cpu != 'arm': target_dir.append(args.android_cpu) @@ -64,6 +70,10 @@ def to_gn_args(args): if args.target_os != 'android' and args.enable_vulkan: raise Exception('--enable-vulkan is only supported on Android') + runtime_mode = args.runtime_mode + if args.dynamic and runtime_mode in ['profile', 'release']: + runtime_mode = 'dynamic_' + runtime_mode + gn_args = {} # Skia GN args. @@ -88,7 +98,7 @@ def to_gn_args(args): # The GN arg is not available in the windows toolchain. gn_args['enable_lto'] = enable_lto - aot = args.runtime_mode != 'debug' + aot = not runtime_mode in ['debug', 'dynamic_profile', 'dynamic_release'] if args.target_os == 'android': gn_args['target_os'] = 'android' elif args.target_os == 'ios': @@ -99,10 +109,14 @@ def to_gn_args(args): else: aot = False - if args.runtime_mode == 'debug': + if runtime_mode == 'debug': gn_args['dart_runtime_mode'] = 'develop' + elif runtime_mode == 'dynamic_profile': + gn_args['dart_runtime_mode'] = 'profile' + elif runtime_mode == 'dynamic_release': + gn_args['dart_runtime_mode'] = 'release' else: - gn_args['dart_runtime_mode'] = args.runtime_mode + gn_args['dart_runtime_mode'] = runtime_mode if args.target_os == 'android': gn_args['target_cpu'] = args.android_cpu @@ -120,7 +134,13 @@ def to_gn_args(args): # On iOS Devices, use the Dart bytecode interpreter so we don't incur # snapshotting and linking costs of the precompiler during development. # We can still use the JIT on the simulator though. - use_dbc = args.target_os == 'ios' and not args.simulator and args.runtime_mode == 'debug' + can_use_dbc = runtime_mode in ['debug', 'dynamic_profile', 'dynamic_release'] + use_dbc = args.target_os == 'ios' and not args.simulator and can_use_dbc + # Use dbc if it is requested on the command line and supported by the + # requested runtime mode. + if args.interpreter and not can_use_dbc: + raise Exception('--interpreter not supported with --runtime-mode=' + runtime_mode) + use_dbc = use_dbc or (args.interpreter and can_use_dbc) if use_dbc: gn_args['dart_target_arch'] = 'dbc' else: @@ -145,7 +165,7 @@ def to_gn_args(args): if target_is_32_bit: gn_args["host_cpu"] = "x86" - gn_args['flutter_runtime_mode'] = args.runtime_mode + gn_args['flutter_runtime_mode'] = runtime_mode gn_args['flutter_aot'] = aot if args.target_sysroot: @@ -186,6 +206,8 @@ def parse_args(args): parser.add_argument('--unoptimized', default=False, action='store_true') parser.add_argument('--runtime-mode', type=str, choices=['debug', 'profile', 'release'], default='debug') + parser.add_argument('--dynamic', default=False, action='store_true') + parser.add_argument('--interpreter', default=False, action='store_true') parser.add_argument('--target-os', type=str, choices=['android', 'ios', 'linux']) parser.add_argument('--android', dest='target_os', action='store_const', const='android') From df6c102d00ce73052c0c506d46b0bedf9850375f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 5 Jun 2018 19:07:32 -0400 Subject: [PATCH 0527/1190] Roll src/third_party/skia 5e6853d..3857fbf (5 commits) (#5472) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5717ea757c14b..e7419365ed7a2 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5e6853ddfd08c9b11351665df42eadab54e0bdae', + 'skia_revision': '3857fbfd3e79351252d7dcdfe179c376709c33fa', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a2dd7d46a88be..9c6a512a3319f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e65b667accd33ea6d59a908c7dce1eb9 +Signature: 8c90956f91c310595a860284ec9902de UNUSED LICENSES: @@ -20742,6 +20742,8 @@ LIBRARY: skia ORIGIN: ../../../third_party/skia/src/core/SkFlattenablePriv.h + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/skia/src/core/SkFlattenablePriv.h +FILE: ../../../third_party/skia/src/core/SkGlyphRun.cpp +FILE: ../../../third_party/skia/src/core/SkGlyphRun.h ---------------------------------------------------------------------------------------------------- Copyright 2018 The Android Open Source Project From 18b8498e6730606a4e0629658480adc1eda98c51 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 5 Jun 2018 22:32:32 -0400 Subject: [PATCH 0528/1190] Roll src/third_party/skia 3857fbf..79725d3 (2 commits) (#5475) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e7419365ed7a2..56166a8645fd2 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3857fbfd3e79351252d7dcdfe179c376709c33fa', + 'skia_revision': '79725d32714f863ca14aaeed0f1d1e778442a274', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9c6a512a3319f..8d5bf35bf0b0f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8c90956f91c310595a860284ec9902de +Signature: 407fd890d954735bd8e5eb61d327c953 UNUSED LICENSES: @@ -17187,6 +17187,7 @@ FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.cpp FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.h FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.cpp FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.h +FILE: ../../../third_party/skia/modules/skottie/src/SkottieTool.cpp FILE: ../../../third_party/skia/modules/sksg/include/SkSGClipEffect.h FILE: ../../../third_party/skia/modules/sksg/include/SkSGGeometryTransform.h FILE: ../../../third_party/skia/modules/sksg/include/SkSGGradient.h From 1b3277268aca2f73d41f695130137179201bef68 Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Wed, 6 Jun 2018 10:49:40 +0200 Subject: [PATCH 0529/1190] App life cycle delegate (#5302) * Move the handling of delegating AppDelegate callback out of FlutterAppDelegate. Also moves the plugin registry to FlutterViewController. So each view-controller will handle its own plugins. This is intended to simplify including one or more Flutter views in an existing iOS app and giving more precise control of plugin registration. Fixes: https://github.com/flutter/flutter/issues/16539 * formatting * Update license golden file * Fixed type error * FREEZE.unindexed * Fix Header types * Revert "FREEZE.unindexed" This reverts commit bebb70056c9bcb90b4321bdc2873896623ed6faa. --- shell/platform/darwin/ios/BUILD.gn | 2 + .../darwin/ios/framework/Headers/Flutter.h | 1 + .../framework/Headers/FlutterAppDelegate.h | 14 +- .../ios/framework/Headers/FlutterPlugin.h | 10 +- .../FlutterPluginAppLifeCycleDelegate.h | 135 +++++++++ .../framework/Headers/FlutterViewController.h | 5 +- .../framework/Source/FlutterAppDelegate.mm | 268 +++-------------- .../FlutterPluginAppLifeCycleDelegate.mm | 278 ++++++++++++++++++ .../framework/Source/FlutterViewController.mm | 87 ++++++ travis/licenses_golden/licenses_flutter | 2 + 10 files changed, 567 insertions(+), 235 deletions(-) create mode 100644 shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index ed3f86e77f0cb..d9450d64d65f4 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -29,6 +29,7 @@ _flutter_framework_headers = [ "framework/Headers/FlutterMacros.h", "framework/Headers/FlutterNavigationController.h", "framework/Headers/FlutterPlugin.h", + "framework/Headers/FlutterPluginAppLifeCycleDelegate.h", "framework/Headers/FlutterTexture.h", "framework/Headers/FlutterViewController.h", ] @@ -50,6 +51,7 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/FlutterNavigationController.mm", "framework/Source/FlutterPlatformPlugin.h", "framework/Source/FlutterPlatformPlugin.mm", + "framework/Source/FlutterPluginAppLifeCycleDelegate.mm", "framework/Source/FlutterStandardCodec.mm", "framework/Source/FlutterStandardCodec_Internal.h", "framework/Source/FlutterTextInputDelegate.h", diff --git a/shell/platform/darwin/ios/framework/Headers/Flutter.h b/shell/platform/darwin/ios/framework/Headers/Flutter.h index 939040c8e5dfd..d850854f2f517 100644 --- a/shell/platform/darwin/ios/framework/Headers/Flutter.h +++ b/shell/platform/darwin/ios/framework/Headers/Flutter.h @@ -43,6 +43,7 @@ #include "FlutterMacros.h" #include "FlutterNavigationController.h" #include "FlutterPlugin.h" +#include "FlutterPluginAppLifeCycleDelegate.h" #include "FlutterTexture.h" #include "FlutterViewController.h" diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h b/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h index 4f28e70b65fc5..f175ea2925826 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h @@ -24,22 +24,10 @@ * code as necessary from FlutterAppDelegate.mm. */ FLUTTER_EXPORT -@interface FlutterAppDelegate : UIResponder +@interface FlutterAppDelegate : UIResponder @property(strong, nonatomic) UIWindow* window; -// Can be overriden by subclasses to provide a custom FlutterBinaryMessenger, -// typically a FlutterViewController, for plugin interop. -// -// Defaults to window's rootViewController. -- (NSObject*)binaryMessenger; - -// Can be overriden by subclasses to provide a custom FlutterTextureRegistry, -// typically a FlutterViewController, for plugin interop. -// -// Defaults to window's rootViewController. -- (NSObject*)textures; - @end #endif // FLUTTER_FLUTTERDARTPROJECT_H_ diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index ae6b730fa40d0..42fa50840cd27 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -148,7 +148,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)application:(UIApplication*)application handleEventsForBackgroundURLSession:(nonnull NSString*)identifier - completionHandler:(nonnull void (^)())completionHandler; + completionHandler:(nonnull void (^)(void))completionHandler; /** Called if this plugin has been registered for `UIApplicationDelegate` callbacks. @@ -292,6 +292,14 @@ NS_ASSUME_NONNULL_BEGIN - (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey; @end +/** + Implement this in the `UIAppDelegate` of your app to enable Flutter plugins to register themselves to the application + life cycle events. +*/ +@protocol FlutterAppLifeCycleProvider +- (void)addApplicationLifeCycleDelegate:(NSObject*)delegate; +@end + NS_ASSUME_NONNULL_END; #endif // FLUTTER_FLUTTERPLUGIN_H_ diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h b/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h new file mode 100644 index 0000000000000..619d9871e4401 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h @@ -0,0 +1,135 @@ +// 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. + +#ifndef FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ +#define FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ + +#include "FlutterPlugin.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + Propagates `UIAppDelegate` callbacks to registered plugins. +*/ +FLUTTER_EXPORT +@interface FlutterPluginAppLifeCycleDelegate : NSObject +/** + Registers `delegate` to receive life cycle callbacks via this FlutterPluginAppLifecycleDelegate as long as it is alive. + + `delegate` will only referenced weakly. +*/ +- (void)addDelegate:(NSObject*)delegate; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + + - Returns: `NO` if any plugin vetoes application launch. + */ +- (BOOL)application:(UIApplication*)application + didFinishLaunchingWithOptions:(NSDictionary*)launchOptions; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationDidBecomeActive:(UIApplication*)application; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationWillResignActive:(UIApplication*)application; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationDidEnterBackground:(UIApplication*)application; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationWillEnterForeground:(UIApplication*)application; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)applicationWillTerminate:(UIApplication*)application; + +/** + Called if this plugin has been registered for `UIApplicationDelegate` callbacks. + */ +- (void)application:(UIApplication*)application + didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)application:(UIApplication*)application + didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. + */ +- (void)application:(UIApplication*)application + didReceiveRemoteNotification:(NSDictionary*)userInfo + fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. +*/ +- (BOOL)application:(UIApplication*)application + openURL:(NSURL*)url + options:(NSDictionary*)options; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. + */ +- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. +*/ +- (BOOL)application:(UIApplication*)application + openURL:(NSURL*)url + sourceApplication:(NSString*)sourceApplication + annotation:(id)annotation; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks. +*/ +- (void)application:(UIApplication*)application + performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem + completionHandler:(void (^)(BOOL succeeded))completionHandler + API_AVAILABLE(ios(9.0)); + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. +*/ +- (BOOL)application:(UIApplication*)application + handleEventsForBackgroundURLSession:(nonnull NSString*)identifier + completionHandler:(nonnull void (^)(void))completionHandler; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + + - Returns: `YES` if any plugin handles the request. +*/ +- (BOOL)application:(UIApplication*)application + performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; +@end + +NS_ASSUME_NONNULL_END + +#endif // FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ \ No newline at end of file diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h b/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h index 7ef6868a27632..524890ca2c05f 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h @@ -11,10 +11,11 @@ #include "FlutterBinaryMessenger.h" #include "FlutterDartProject.h" #include "FlutterMacros.h" +#include "FlutterPlugin.h" #include "FlutterTexture.h" FLUTTER_EXPORT -@interface FlutterViewController : UIViewController +@interface FlutterViewController : UIViewController - (instancetype)initWithProject:(FlutterDartProject*)project nibName:(NSString*)nibNameOrNil @@ -49,6 +50,8 @@ FLUTTER_EXPORT */ - (void)setInitialRoute:(NSString*)route; +- (id)pluginRegistry; + @end #endif // FLUTTER_FLUTTERVIEWCONTROLLER_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index 6e8d07d1839a6..d622a6b0139e5 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -3,46 +3,28 @@ // found in the LICENSE file. #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" -#include "lib/fxl/logging.h" - -@interface FlutterAppDelegate () -@property(readonly, nonatomic) NSMutableArray* pluginDelegates; -@property(readonly, nonatomic) NSMutableDictionary* pluginPublications; -@end - -@interface FlutterAppDelegateRegistrar : NSObject -- (instancetype)initWithPlugin:(NSString*)pluginKey appDelegate:(FlutterAppDelegate*)delegate; -@end @implementation FlutterAppDelegate { - UIBackgroundTaskIdentifier _debugBackgroundTask; + FlutterPluginAppLifeCycleDelegate* _lifeCycleDelegate; } - (instancetype)init { if (self = [super init]) { - _pluginDelegates = [NSMutableArray new]; - _pluginPublications = [NSMutableDictionary new]; + _lifeCycleDelegate = [[FlutterPluginAppLifeCycleDelegate alloc] init]; } return self; } - (void)dealloc { - [_pluginDelegates release]; - [_pluginPublications release]; + [_lifeCycleDelegate release]; [super dealloc]; } - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if (![plugin application:application didFinishLaunchingWithOptions:launchOptions]) { - return NO; - } - } - } - return YES; + return [_lifeCycleDelegate application:application didFinishLaunchingWithOptions:launchOptions]; } // Returns the key window's rootViewController, if it's a FlutterViewController. @@ -65,272 +47,118 @@ - (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { } - (void)applicationDidEnterBackground:(UIApplication*)application { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - // The following keeps the Flutter session alive when the device screen locks - // in debug mode. It allows continued use of features like hot reload and - // taking screenshots once the device unlocks again. - // - // Note the name is not an identifier and multiple instances can exist. - _debugBackgroundTask = [application - beginBackgroundTaskWithName:@"Flutter debug task" - expirationHandler:^{ - FXL_LOG(WARNING) - << "\nThe OS has terminated the Flutter debug connection for being " - "inactive in the background for too long.\n\n" - "There are no errors with your Flutter application.\n\n" - "To reconnect, launch your application again via 'flutter run'"; - }]; -#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationDidEnterBackground:application]; - } - } + [_lifeCycleDelegate applicationDidEnterBackground:application]; } - (void)applicationWillEnterForeground:(UIApplication*)application { -#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - [application endBackgroundTask:_debugBackgroundTask]; -#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationWillEnterForeground:application]; - } - } + [_lifeCycleDelegate applicationWillEnterForeground:application]; } - (void)applicationWillResignActive:(UIApplication*)application { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationWillResignActive:application]; - } - } + [_lifeCycleDelegate applicationWillResignActive:application]; } - (void)applicationDidBecomeActive:(UIApplication*)application { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationDidBecomeActive:application]; - } - } + [_lifeCycleDelegate applicationDidBecomeActive:application]; } - (void)applicationWillTerminate:(UIApplication*)application { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin applicationWillTerminate:application]; - } - } + [_lifeCycleDelegate applicationWillTerminate:application]; } - (void)application:(UIApplication*)application didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin application:application didRegisterUserNotificationSettings:notificationSettings]; - } - } + [_lifeCycleDelegate application:application + didRegisterUserNotificationSettings:notificationSettings]; } - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - [plugin application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; - } - } + [_lifeCycleDelegate application:application + didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } - (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - didReceiveRemoteNotification:userInfo - fetchCompletionHandler:completionHandler]) { - return; - } - } - } + [_lifeCycleDelegate application:application + didReceiveRemoteNotification:userInfo + fetchCompletionHandler:completionHandler]; } - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url options:(NSDictionary*)options { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application openURL:url options:options]) { - return YES; - } - } - } - return NO; + return [_lifeCycleDelegate application:application openURL:url options:options]; } - (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application handleOpenURL:url]) { - return YES; - } - } - } - return NO; + return [_lifeCycleDelegate application:application handleOpenURL:url]; } - (BOOL)application:(UIApplication*)application openURL:(NSURL*)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - openURL:url - sourceApplication:sourceApplication - annotation:annotation]) { - return YES; - } - } - } - return NO; + return [_lifeCycleDelegate application:application + openURL:url + sourceApplication:sourceApplication + annotation:annotation]; } - (void)application:(UIApplication*)application performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem completionHandler:(void (^)(BOOL succeeded))completionHandler NS_AVAILABLE_IOS(9_0) { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - performActionForShortcutItem:shortcutItem - completionHandler:completionHandler]) { - return; - } - } - } + [_lifeCycleDelegate application:application + performActionForShortcutItem:shortcutItem + completionHandler:completionHandler]; } - (void)application:(UIApplication*)application handleEventsForBackgroundURLSession:(nonnull NSString*)identifier completionHandler:(nonnull void (^)())completionHandler { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - handleEventsForBackgroundURLSession:identifier - completionHandler:completionHandler]) { - return; - } - } - } + [_lifeCycleDelegate application:application + handleEventsForBackgroundURLSession:identifier + completionHandler:completionHandler]; } - (void)application:(UIApplication*)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application performFetchWithCompletionHandler:completionHandler]) { - return; - } - } - } + [_lifeCycleDelegate application:application performFetchWithCompletionHandler:completionHandler]; } -- (BOOL)application:(UIApplication*)application - continueUserActivity:(NSUserActivity*)userActivity - restorationHandler:(void (^)(NSArray*))restorationHandler { - for (id plugin in _pluginDelegates) { - if ([plugin respondsToSelector:_cmd]) { - if ([plugin application:application - continueUserActivity:userActivity - restorationHandler:restorationHandler]) { - return YES; - } - } - } - return NO; -} +#pragma mark - FlutterPluginRegistry methods. All delegating to the rootViewController -// TODO(xster): move when doing https://github.com/flutter/flutter/issues/3671. -- (NSObject*)binaryMessenger { +- (NSObject*)registrarForPlugin:(NSString*)pluginKey { UIViewController* rootViewController = _window.rootViewController; - if ([rootViewController conformsToProtocol:@protocol(FlutterBinaryMessenger)]) { - return (NSObject*)rootViewController; + if ([rootViewController isKindOfClass:[FlutterViewController class]]) { + return + [[(FlutterViewController*)rootViewController pluginRegistry] registrarForPlugin:pluginKey]; } return nil; } -- (NSObject*)textures { +- (BOOL)hasPlugin:(NSString*)pluginKey { UIViewController* rootViewController = _window.rootViewController; - if ([rootViewController conformsToProtocol:@protocol(FlutterTextureRegistry)]) { - return (NSObject*)rootViewController; + if ([rootViewController isKindOfClass:[FlutterViewController class]]) { + return [[(FlutterViewController*)rootViewController pluginRegistry] hasPlugin:pluginKey]; } - return nil; -} - -- (NSObject*)registrarForPlugin:(NSString*)pluginKey { - NSAssert(self.pluginPublications[pluginKey] == nil, @"Duplicate plugin key: %@", pluginKey); - self.pluginPublications[pluginKey] = [NSNull null]; - return - [[[FlutterAppDelegateRegistrar alloc] initWithPlugin:pluginKey appDelegate:self] autorelease]; -} - -- (BOOL)hasPlugin:(NSString*)pluginKey { - return _pluginPublications[pluginKey] != nil; + return false; } - (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey { - return _pluginPublications[pluginKey]; -} -@end - -@implementation FlutterAppDelegateRegistrar { - NSString* _pluginKey; - FlutterAppDelegate* _appDelegate; -} - -- (instancetype)initWithPlugin:(NSString*)pluginKey appDelegate:(FlutterAppDelegate*)appDelegate { - self = [super init]; - NSAssert(self, @"Super init cannot be nil"); - _pluginKey = [pluginKey retain]; - _appDelegate = [appDelegate retain]; - return self; -} - -- (void)dealloc { - [_pluginKey release]; - [_appDelegate release]; - [super dealloc]; -} - -- (NSObject*)messenger { - return [_appDelegate binaryMessenger]; -} - -- (NSObject*)textures { - return [_appDelegate textures]; -} - -- (void)publish:(NSObject*)value { - _appDelegate.pluginPublications[_pluginKey] = value; -} - -- (void)addMethodCallDelegate:(NSObject*)delegate - channel:(FlutterMethodChannel*)channel { - [channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { - [delegate handleMethodCall:call result:result]; - }]; -} - -- (void)addApplicationDelegate:(NSObject*)delegate { - [_appDelegate.pluginDelegates addObject:delegate]; + UIViewController* rootViewController = _window.rootViewController; + if ([rootViewController isKindOfClass:[FlutterViewController class]]) { + return [[(FlutterViewController*)rootViewController pluginRegistry] + valuePublishedByPlugin:pluginKey]; + } + return nil; } -- (NSString*)lookupKeyForAsset:(NSString*)asset { - return [FlutterDartProject lookupKeyForAsset:asset]; -} +#pragma mark - FlutterAppLifeCycleProvider methods -- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { - return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; +- (void)addApplicationLifeCycleDelegate:(NSObject*)delegate { + [_lifeCycleDelegate addDelegate:delegate]; } @end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm new file mode 100644 index 0000000000000..900d048c57a09 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm @@ -0,0 +1,278 @@ +// 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. + +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +#include "lib/fxl/logging.h" + +@implementation FlutterPluginAppLifeCycleDelegate { + UIBackgroundTaskIdentifier _debugBackgroundTask; + + // Weak references to registered plugins. + NSPointerArray* _pluginDelegates; +} + +- (instancetype)init { + if (self = [super init]) { + _pluginDelegates = [[NSPointerArray weakObjectsPointerArray] retain]; + } + return self; +} + +- (void)dealloc { + [_pluginDelegates release]; + [super dealloc]; +} + +static BOOL isPowerOfTwo(NSUInteger x) { + return x != 0 && (x & (x - 1)) == 0; +} + +- (void)addDelegate:(NSObject*)delegate { + [_pluginDelegates addPointer:(__bridge void*)delegate]; + if (isPowerOfTwo([_pluginDelegates count])) { + [_pluginDelegates compact]; + } +} + +- (BOOL)application:(UIApplication*)application + didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { + for (id plugin in [_pluginDelegates allObjects]) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if (![plugin application:application didFinishLaunchingWithOptions:launchOptions]) { + return NO; + } + } + } + return YES; +} + +// Returns the key window's rootViewController, if it's a FlutterViewController. +// Otherwise, returns nil. +- (FlutterViewController*)rootFlutterViewController { + UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController; + if ([viewController isKindOfClass:[FlutterViewController class]]) { + return (FlutterViewController*)viewController; + } + return nil; +} + +- (void)applicationDidEnterBackground:(UIApplication*)application { +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + // The following keeps the Flutter session alive when the device screen locks + // in debug mode. It allows continued use of features like hot reload and + // taking screenshots once the device unlocks again. + // + // Note the name is not an identifier and multiple instances can exist. + _debugBackgroundTask = [application + beginBackgroundTaskWithName:@"Flutter debug task" + expirationHandler:^{ + FXL_LOG(WARNING) + << "\nThe OS has terminated the Flutter debug connection for being " + "inactive in the background for too long.\n\n" + "There are no errors with your Flutter application.\n\n" + "To reconnect, launch your application again via 'flutter run'"; + }]; +#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationDidEnterBackground:application]; + } + } +} + +- (void)applicationWillEnterForeground:(UIApplication*)application { +#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + [application endBackgroundTask:_debugBackgroundTask]; +#endif // FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationWillEnterForeground:application]; + } + } +} + +- (void)applicationWillResignActive:(UIApplication*)application { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationWillResignActive:application]; + } + } +} + +- (void)applicationDidBecomeActive:(UIApplication*)application { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationDidBecomeActive:application]; + } + } +} + +- (void)applicationWillTerminate:(UIApplication*)application { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin applicationWillTerminate:application]; + } + } +} + +- (void)application:(UIApplication*)application + didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin application:application didRegisterUserNotificationSettings:notificationSettings]; + } + } +} + +- (void)application:(UIApplication*)application + didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + [plugin application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; + } + } +} + +- (void)application:(UIApplication*)application + didReceiveRemoteNotification:(NSDictionary*)userInfo + fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + didReceiveRemoteNotification:userInfo + fetchCompletionHandler:completionHandler]) { + return; + } + } + } +} + +- (BOOL)application:(UIApplication*)application + openURL:(NSURL*)url + options:(NSDictionary*)options { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application openURL:url options:options]) { + return YES; + } + } + } + return NO; +} + +- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application handleOpenURL:url]) { + return YES; + } + } + } + return NO; +} + +- (BOOL)application:(UIApplication*)application + openURL:(NSURL*)url + sourceApplication:(NSString*)sourceApplication + annotation:(id)annotation { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + openURL:url + sourceApplication:sourceApplication + annotation:annotation]) { + return YES; + } + } + } + return NO; +} + +- (void)application:(UIApplication*)application + performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem + completionHandler:(void (^)(BOOL succeeded))completionHandler NS_AVAILABLE_IOS(9_0) { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + performActionForShortcutItem:shortcutItem + completionHandler:completionHandler]) { + return; + } + } + } +} + +- (BOOL)application:(UIApplication*)application + handleEventsForBackgroundURLSession:(nonnull NSString*)identifier + completionHandler:(nonnull void (^)())completionHandler { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + handleEventsForBackgroundURLSession:identifier + completionHandler:completionHandler]) { + return YES; + } + } + } + return NO; +} + +- (BOOL)application:(UIApplication*)application + performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application performFetchWithCompletionHandler:completionHandler]) { + return YES; + } + } + } + return NO; +} +@end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 2e13ffb738c1b..e3076c6c05ca7 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -22,6 +22,12 @@ #include "flutter/shell/platform/darwin/ios/platform_view_ios.h" @interface FlutterViewController () +@property(nonatomic, readonly) NSMutableDictionary* pluginPublications; +@end + +@interface FlutterViewControllerRegistrar : NSObject +- (instancetype)initWithPlugin:(NSString*)pluginKey + flutterViewController:(FlutterViewController*)flutterViewController; @end @implementation FlutterViewController { @@ -93,6 +99,8 @@ - (void)performCommonViewControllerInitialization { if ([self setupShell]) { [self setupChannels]; [self setupNotificationCenterObservers]; + + _pluginPublications = [NSMutableDictionary new]; } } @@ -426,6 +434,7 @@ - (void)viewDidDisappear:(BOOL)animated { - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + [_pluginPublications release]; [super dealloc]; } @@ -971,4 +980,82 @@ - (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { return [FlutterDartProject lookupKeyForAsset:asset fromPackage:package]; } +- (id)pluginRegistry { + return self; +} + +#pragma mark - FlutterPluginRegistry + +- (NSObject*)registrarForPlugin:(NSString*)pluginKey { + NSAssert(self.pluginPublications[pluginKey] == nil, @"Duplicate plugin key: %@", pluginKey); + self.pluginPublications[pluginKey] = [NSNull null]; + return + [[FlutterViewControllerRegistrar alloc] initWithPlugin:pluginKey flutterViewController:self]; +} + +- (BOOL)hasPlugin:(NSString*)pluginKey { + return _pluginPublications[pluginKey] != nil; +} + +- (NSObject*)valuePublishedByPlugin:(NSString*)pluginKey { + return _pluginPublications[pluginKey]; +} +@end + +@implementation FlutterViewControllerRegistrar { + NSString* _pluginKey; + FlutterViewController* _flutterViewController; +} + +- (instancetype)initWithPlugin:(NSString*)pluginKey + flutterViewController:(FlutterViewController*)flutterViewController { + self = [super init]; + NSAssert(self, @"Super init cannot be nil"); + _pluginKey = [pluginKey retain]; + _flutterViewController = [flutterViewController retain]; + return self; +} + +- (void)dealloc { + [_pluginKey release]; + [_flutterViewController release]; + [super dealloc]; +} + +- (NSObject*)messenger { + return _flutterViewController; +} + +- (NSObject*)textures { + return _flutterViewController; +} + +- (void)publish:(NSObject*)value { + _flutterViewController.pluginPublications[_pluginKey] = value; +} + +- (void)addMethodCallDelegate:(NSObject*)delegate + channel:(FlutterMethodChannel*)channel { + [channel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) { + [delegate handleMethodCall:call result:result]; + }]; +} + +- (void)addApplicationDelegate:(NSObject*)delegate { + id appDelegate = [[UIApplication sharedApplication] delegate]; + if ([appDelegate conformsToProtocol:@protocol(FlutterAppLifeCycleProvider)]) { + id lifeCycleProvider = + (id)appDelegate; + [lifeCycleProvider addApplicationLifeCycleDelegate:delegate]; + } +} + +- (NSString*)lookupKeyForAsset:(NSString*)asset { + return [_flutterViewController lookupKeyForAsset:asset]; +} + +- (NSString*)lookupKeyForAsset:(NSString*)asset fromPackage:(NSString*)package { + return [_flutterViewController lookupKeyForAsset:asset fromPackage:package]; +} + @end diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index efeeb86c8b892..a66035fa469c5 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -493,6 +493,8 @@ FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_ FILE: ../../../flutter/lib/ui/painting/image_encoding.cc FILE: ../../../flutter/lib/ui/painting/image_encoding.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm ---------------------------------------------------------------------------------------------------- From ed076a0ccc732a0885e086db2f9b6e7a63e01105 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 6 Jun 2018 06:49:03 -0400 Subject: [PATCH 0530/1190] Roll src/third_party/skia 79725d3..c27967f (1 commits) (#5476) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 56166a8645fd2..a931b41bedc0e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '79725d32714f863ca14aaeed0f1d1e778442a274', + 'skia_revision': 'c27967f3a466e13676e91ca641c09bb4752b0086', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8d5bf35bf0b0f..eab788acbe2ab 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 407fd890d954735bd8e5eb61d327c953 +Signature: 98b327488531cb8d4dd0cecdecda8953 UNUSED LICENSES: From e2cc35daf7d7320addc57886b812ab488aa1c0c9 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 6 Jun 2018 10:15:32 -0400 Subject: [PATCH 0531/1190] Roll src/third_party/skia c27967f..1b1a557 (4 commits) (#5477) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index a931b41bedc0e..4afef69571923 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c27967f3a466e13676e91ca641c09bb4752b0086', + 'skia_revision': '1b1a557d25a7d23aa11f23a2eae7b3560c49db7f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index eab788acbe2ab..8492214e9a564 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 98b327488531cb8d4dd0cecdecda8953 +Signature: caa775a0b2107413da617d6d12909049 UNUSED LICENSES: @@ -20743,8 +20743,6 @@ LIBRARY: skia ORIGIN: ../../../third_party/skia/src/core/SkFlattenablePriv.h + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/skia/src/core/SkFlattenablePriv.h -FILE: ../../../third_party/skia/src/core/SkGlyphRun.cpp -FILE: ../../../third_party/skia/src/core/SkGlyphRun.h ---------------------------------------------------------------------------------------------------- Copyright 2018 The Android Open Source Project From a1193cfab76f11b48b62b2d599c5cfbb09100c1e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 6 Jun 2018 13:42:32 -0400 Subject: [PATCH 0532/1190] Roll src/third_party/skia 1b1a557..2d7678d (4 commits) (#5478) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4afef69571923..fac386f158a0f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1b1a557d25a7d23aa11f23a2eae7b3560c49db7f', + 'skia_revision': '2d7678d61fb68a2c9060a9fad8ebabf4e0053576', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8492214e9a564..19648b93a3d4e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: caa775a0b2107413da617d6d12909049 +Signature: 5f2e864ad9716ee13ebb5957a3a82b47 UNUSED LICENSES: From 686d22352e15f3dc1a6d358fdd8287a34527cb4b Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 6 Jun 2018 12:22:50 -0700 Subject: [PATCH 0533/1190] libtxt: add all styles of a fallback font family to the cache (#5474) libtxt will query Skia for a fallback typeface when it encounters a character that is not found in the primary font. The font collection should make all the variants of the fallback typeface's font family available to Minikin for use in future font lookups. Fixes https://github.com/flutter/flutter/issues/17985 --- third_party/txt/src/txt/font_collection.cc | 97 ++++++++++++---------- third_party/txt/src/txt/font_collection.h | 13 ++- 2 files changed, 63 insertions(+), 47 deletions(-) diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index 982524d4fe8ca..0c2d49f07272a 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -105,45 +105,18 @@ FontCollection::GetMinikinFontCollectionForFamily( } for (sk_sp& manager : GetFontManagerOrder()) { - sk_sp font_style_set( - manager->matchFamily(font_family.c_str())); - if (font_style_set == nullptr || font_style_set->count() == 0) { + std::shared_ptr minikin_family = + CreateMinikinFontFamily(manager, font_family); + if (!minikin_family) continue; - } - - std::vector minikin_fonts; - - // Add fonts to the Minikin font family. - for (int i = 0, style_count = font_style_set->count(); i < style_count; - ++i) { - // Create the skia typeface. - sk_sp skia_typeface( - sk_sp(font_style_set->createTypeface(i))); - if (skia_typeface == nullptr) { - continue; - } - - // Create the minikin font from the skia typeface. - // Divide by 100 because the weights are given as "100", "200", etc. - minikin::Font minikin_font( - std::make_shared(skia_typeface), - minikin::FontStyle{skia_typeface->fontStyle().weight() / 100, - skia_typeface->isItalic()}); - - minikin_fonts.emplace_back(std::move(minikin_font)); - } - - // Create a Minikin font family. - auto minikin_family = - std::make_shared(std::move(minikin_fonts)); // Create a vector of font families for the Minikin font collection. std::vector> minikin_families = { minikin_family, }; if (enable_font_fallback_) { - for (SkFontID font_id : fallback_fonts_for_locale_[locale]) - minikin_families.push_back(fallback_fonts_[font_id]); + for (std::string fallback_family : fallback_fonts_for_locale_[locale]) + minikin_families.push_back(fallback_fonts_[fallback_family]); } // Create the minikin font collection. @@ -172,6 +145,39 @@ FontCollection::GetMinikinFontCollectionForFamily( return nullptr; } +std::shared_ptr FontCollection::CreateMinikinFontFamily( + const sk_sp& manager, + const std::string& family_name) { + sk_sp font_style_set( + manager->matchFamily(family_name.c_str())); + if (font_style_set == nullptr || font_style_set->count() == 0) { + return nullptr; + } + + std::vector minikin_fonts; + + // Add fonts to the Minikin font family. + for (int i = 0; i < font_style_set->count(); ++i) { + // Create the skia typeface. + sk_sp skia_typeface( + sk_sp(font_style_set->createTypeface(i))); + if (skia_typeface == nullptr) { + continue; + } + + // Create the minikin font from the skia typeface. + // Divide by 100 because the weights are given as "100", "200", etc. + minikin::Font minikin_font( + std::make_shared(skia_typeface), + minikin::FontStyle{skia_typeface->fontStyle().weight() / 100, + skia_typeface->isItalic()}); + + minikin_fonts.emplace_back(std::move(minikin_font)); + } + + return std::make_shared(std::move(minikin_fonts)); +} + const std::shared_ptr& FontCollection::MatchFallbackFont( uint32_t ch, std::string locale) { @@ -184,28 +190,33 @@ const std::shared_ptr& FontCollection::MatchFallbackFont( if (!typeface) continue; - fallback_fonts_for_locale_[locale].insert(typeface->uniqueID()); + SkString sk_family_name; + typeface->getFamilyName(&sk_family_name); + std::string family_name(sk_family_name.c_str()); + + fallback_fonts_for_locale_[locale].insert(family_name); - return GetFallbackFont(typeface); + return GetFallbackFontFamily(manager, family_name); } return null_family_; } const std::shared_ptr& -FontCollection::GetFallbackFont(const sk_sp& typeface) { - SkFontID typeface_id = typeface->uniqueID(); - auto fallback_it = fallback_fonts_.find(typeface_id); +FontCollection::GetFallbackFontFamily(const sk_sp& manager, + const std::string& family_name) { + auto fallback_it = fallback_fonts_.find(family_name); if (fallback_it != fallback_fonts_.end()) { return fallback_it->second; } - std::vector minikin_fonts; - minikin_fonts.emplace_back(std::make_shared(typeface), - minikin::FontStyle()); - auto insert_it = fallback_fonts_.insert(std::make_pair( - typeface_id, - std::make_shared(std::move(minikin_fonts)))); + std::shared_ptr minikin_family = + CreateMinikinFontFamily(manager, family_name); + if (!minikin_family) + return null_family_; + + auto insert_it = + fallback_fonts_.insert(std::make_pair(family_name, minikin_family)); // Clear the cache to force creation of new font collections that will include // this fallback font. diff --git a/third_party/txt/src/txt/font_collection.h b/third_party/txt/src/txt/font_collection.h index 0640a0974a2ea..dd91a2a951281 100644 --- a/third_party/txt/src/txt/font_collection.h +++ b/third_party/txt/src/txt/font_collection.h @@ -78,17 +78,22 @@ class FontCollection : public std::enable_shared_from_this { std::shared_ptr, FamilyKey::Hasher> font_collections_cache_; - std::unordered_map> + std::unordered_map> fallback_fonts_; - std::unordered_map> + std::unordered_map> fallback_fonts_for_locale_; std::shared_ptr null_family_; bool enable_font_fallback_; std::vector> GetFontManagerOrder() const; - const std::shared_ptr& GetFallbackFont( - const sk_sp& typeface); + std::shared_ptr CreateMinikinFontFamily( + const sk_sp& manager, + const std::string& family_name); + + const std::shared_ptr& GetFallbackFontFamily( + const sk_sp& manager, + const std::string& family_name); FXL_DISALLOW_COPY_AND_ASSIGN(FontCollection); }; From 7ec4b6115d3eff69af96250aa3f14da97880cc15 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Wed, 6 Jun 2018 14:10:52 -0700 Subject: [PATCH 0534/1190] Add diagram links for StrokeJoin and StrokeCap (#5456) This updates the documentation for StrokeJoin and StrokeCap to contain animated diagrams that describe their function. The actual diagrams reside in the assets-for-api-docs repo. --- lib/ui/painting.dart | 110 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 104 insertions(+), 6 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index f9458581f3789..e4c63b3fadaa3 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -824,37 +824,101 @@ enum FilterQuality { /// Styles to use for line endings. /// -/// See [Paint.strokeCap]. +/// See also: +/// +/// * [Paint.strokeCap] for how this value is used. +/// * [StrokeJoin] for the different kinds of line segment joins. // These enum values must be kept in sync with SkPaint::Cap. enum StrokeCap { /// Begin and end contours with a flat edge and no extension. + /// + /// ![A butt cap ends line segments with a square end that stops at the end of + /// the line segment.](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/butt_cap.png) + /// + /// Compare to the [square] cap, which has the same shape, but extends past + /// the end of the line by half a stroke width. butt, /// Begin and end contours with a semi-circle extension. + /// + /// ![A round cap adds a rounded end to the line segment that protrudes + /// by one half of the thickness of the line (which is the radius of the cap) + /// past the end of the segment.](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/round_cap.png) + /// + /// The cap is colored in the diagram above to highlight it: in normal use it + /// is the same color as the line. round, /// Begin and end contours with a half square extension. This is /// similar to extending each contour by half the stroke width (as /// given by [Paint.strokeWidth]). + /// + /// ![A square cap has a square end that effectively extends the line length + /// by half of the stroke width.](https://flutter.github.io/assets-for-api-docs/assets/dart-ui/square_cap.png) + /// + /// The cap is colored in the diagram above to highlight it: in normal use it + /// is the same color as the line. + /// + /// Compare to the [butt] cap, which has the same shape, but doesn't extend + /// past the end of the line. square, } -/// Styles to use for line joins. +/// Styles to use for line segment joins. /// /// This only affects line joins for polygons drawn by [Canvas.drawPath] and /// rectangles, not points drawn as lines with [Canvas.drawPoints]. /// -/// See [Paint.strokeJoin]. +/// See also: +/// +/// * [Paint.strokeJoin] and [Paint.strokeMiterLimit] for how this value is +/// used. +/// * [StrokeCap] for the different kinds of line endings. // These enum values must be kept in sync with SkPaint::Join. enum StrokeJoin { /// Joins between line segments form sharp corners. + /// + /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_4_join.mp4} + /// + /// The center of the line segment is colored in the diagram above to + /// highlight the join, but in normal usage the join is the same color as the + /// line. + /// + /// See also: + /// + /// * [Paint.strokeJoin], used to set the line segment join style to this + /// value. + /// * [Paint.strokeMiterLimit], used to define when a miter is drawn instead + /// of a bevel when the join is set to this value. miter, /// Joins between line segments are semi-circular. + /// + /// {@animation joinRound 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/round_join.mp4} + /// + /// The center of the line segment is colored in the diagram above to + /// highlight the join, but in normal usage the join is the same color as the + /// line. + /// + /// See also: + /// + /// * [Paint.strokeJoin], used to set the line segment join style to this + /// value. round, /// Joins between line segments connect the corners of the butt ends of the /// line segments to give a beveled appearance. + /// + /// {@animation joinBevel 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/bevel_join.mp4} + /// + /// The center of the line segment is colored in the diagram above to + /// highlight the join, but in normal usage the join is the same color as the + /// line. + /// + /// See also: + /// + /// * [Paint.strokeJoin], used to set the line segment join style to this + /// value. bevel, } @@ -1055,8 +1119,26 @@ class Paint { /// This applies to paths drawn when [style] is set to [PaintingStyle.stroke], /// It does not apply to points drawn as lines with [Canvas.drawPoints]. /// - /// Defaults to [StrokeJoin.miter], i.e. sharp corners. See also - /// [strokeMiterLimit] to control when miters are replaced by bevels. + /// Defaults to [StrokeJoin.miter], i.e. sharp corners. + /// + /// Some examples of joins: + /// + /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_4_join.mp4} + /// + /// {@animation joinRound 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/round_join.mp4} + /// + /// {@animation joinBevel 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/bevel_join.mp4} + /// + /// The centers of the line segments are colored in the diagrams above to + /// highlight the joins, but in normal usage the join is the same color as the + /// line. + /// + /// See also: + /// + /// * [strokeMiterLimit] to control when miters are replaced by bevels when + /// this is set to [StrokeJoin.miter]. + /// * [strokeCap] to control what is drawn at the ends of the stroke. + /// * [StrokeJoin] for the definitive list of stroke joins. StrokeJoin get strokeJoin { return StrokeJoin.values[_data.getInt32(_kStrokeJoinOffset, _kFakeHostEndian)]; } @@ -1073,12 +1155,28 @@ class Paint { /// [StrokeJoin.miter] and the [style] is set to [PaintingStyle.stroke]. If /// this limit is exceeded, then a [StrokeJoin.bevel] join will be drawn /// instead. This may cause some 'popping' of the corners of a path if the - /// angle between line segments is animated. + /// angle between line segments is animated, as seen in the diagrams below. /// /// This limit is expressed as a limit on the length of the miter. /// /// Defaults to 4.0. Using zero as a limit will cause a [StrokeJoin.bevel] /// join to be used all the time. + /// + /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_0_join.mp4} + /// + /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_4_join.mp4} + /// + /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_6_join.mp4} + /// + /// The centers of the line segments are colored in the diagrams above to + /// highlight the joins, but in normal usage the join is the same color as the + /// line. + /// + /// See also: + /// + /// * [strokeJoin] to control the kind of finish to place on the joins + /// between segments. + /// * [strokeCap] to control what is drawn at the ends of the stroke. double get strokeMiterLimit { return _data.getFloat32(_kStrokeMiterLimitOffset, _kFakeHostEndian); } From fca976d8c767e1ac98f8434c03c1a642dca4513e Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Wed, 6 Jun 2018 16:15:13 -0700 Subject: [PATCH 0535/1190] Fix animation diagram identifiers (#5481) I forgot that the identifiers need to be unique per page for the animation tags. This makes them unique. Doc change only, no code. --- lib/ui/painting.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index e4c63b3fadaa3..7624b948b921b 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -878,7 +878,7 @@ enum StrokeCap { enum StrokeJoin { /// Joins between line segments form sharp corners. /// - /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_4_join.mp4} + /// {@animation joinMiterEnum 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_4_join.mp4} /// /// The center of the line segment is colored in the diagram above to /// highlight the join, but in normal usage the join is the same color as the @@ -894,7 +894,7 @@ enum StrokeJoin { /// Joins between line segments are semi-circular. /// - /// {@animation joinRound 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/round_join.mp4} + /// {@animation joinRoundEnum 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/round_join.mp4} /// /// The center of the line segment is colored in the diagram above to /// highlight the join, but in normal usage the join is the same color as the @@ -909,7 +909,7 @@ enum StrokeJoin { /// Joins between line segments connect the corners of the butt ends of the /// line segments to give a beveled appearance. /// - /// {@animation joinBevel 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/bevel_join.mp4} + /// {@animation joinBevelEnum 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/bevel_join.mp4} /// /// The center of the line segment is colored in the diagram above to /// highlight the join, but in normal usage the join is the same color as the @@ -1123,11 +1123,11 @@ class Paint { /// /// Some examples of joins: /// - /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_4_join.mp4} + /// {@animation joinMiterStrokeJoin 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_4_join.mp4} /// - /// {@animation joinRound 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/round_join.mp4} + /// {@animation joinRoundStrokeJoin 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/round_join.mp4} /// - /// {@animation joinBevel 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/bevel_join.mp4} + /// {@animation joinBevelStrokeJoin 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/bevel_join.mp4} /// /// The centers of the line segments are colored in the diagrams above to /// highlight the joins, but in normal usage the join is the same color as the @@ -1162,11 +1162,11 @@ class Paint { /// Defaults to 4.0. Using zero as a limit will cause a [StrokeJoin.bevel] /// join to be used all the time. /// - /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_0_join.mp4} + /// {@animation joinMiter0Limit 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_0_join.mp4} /// - /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_4_join.mp4} + /// {@animation joinMiter4Limit 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_4_join.mp4} /// - /// {@animation joinMiter 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_6_join.mp4} + /// {@animation joinMiter6Limit 300 300 https://flutter.github.io/assets-for-api-docs/assets/dart-ui/miter_6_join.mp4} /// /// The centers of the line segments are colored in the diagrams above to /// highlight the joins, but in normal usage the join is the same color as the From 631a11b80e6ca91604df9251f48a8cf7f6ca1979 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 7 Jun 2018 09:40:57 -0400 Subject: [PATCH 0536/1190] Roll src/third_party/skia 2d7678d..18562b8 (11 commits) (#5482) https://skia.googlesource.com/skia.git/+log/2d7678d..18562b8 Created with: gclient setdep -r src/third_party/skia@18562b8 The AutoRoll server is located here: https://skia-flutter-roll.skia.org Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index fac386f158a0f..9bb8377712b13 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2d7678d61fb68a2c9060a9fad8ebabf4e0053576', + 'skia_revision': '18562b8adb9108e6bcd9ae5b89cc66deb0e49c5d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 19648b93a3d4e..9f60f3bb3be29 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5f2e864ad9716ee13ebb5957a3a82b47 +Signature: 82bfc318bdc7594176866082788271f1 UNUSED LICENSES: @@ -17427,6 +17427,8 @@ FILE: ../../../third_party/skia/animations/text#1.xml FILE: ../../../third_party/skia/bench/microbench.json FILE: ../../../third_party/skia/bench/skpbench.json FILE: ../../../third_party/skia/docker/skia-release/Dockerfile +FILE: ../../../third_party/skia/docker/skia-with-swift-shader-base/Dockerfile +FILE: ../../../third_party/skia/docker/skia-with-swift-shader-base/build-with-swift-shader-and-run FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh @@ -20743,6 +20745,8 @@ LIBRARY: skia ORIGIN: ../../../third_party/skia/src/core/SkFlattenablePriv.h + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/skia/src/core/SkFlattenablePriv.h +FILE: ../../../third_party/skia/src/core/SkGlyphRun.cpp +FILE: ../../../third_party/skia/src/core/SkGlyphRun.h ---------------------------------------------------------------------------------------------------- Copyright 2018 The Android Open Source Project From 11d36001bcc8de317332d0642a25bc0f01ec4652 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 7 Jun 2018 12:50:08 -0400 Subject: [PATCH 0537/1190] Roll src/third_party/skia 18562b8..0d22539 (3 commits) (#5483) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9bb8377712b13..86f7e12118d1f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '18562b8adb9108e6bcd9ae5b89cc66deb0e49c5d', + 'skia_revision': '0d225395faf27690c724619af35243985bf6e2df', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9f60f3bb3be29..9eb35704b8501 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 82bfc318bdc7594176866082788271f1 +Signature: b49b94a274385b7e2c0f81f990c7ebe0 UNUSED LICENSES: From 6cd1ee15ad0f64c1247a271ad516c8a9a58268c4 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 7 Jun 2018 10:42:48 -0700 Subject: [PATCH 0538/1190] Revert: Remove uses of ReleaseOwnership from vulkan backend (#5484) --- vulkan/vulkan_application.cc | 4 ++++ vulkan/vulkan_application.h | 2 ++ vulkan/vulkan_device.cc | 4 ++++ vulkan/vulkan_device.h | 2 ++ vulkan/vulkan_handle.h | 5 +++++ 5 files changed, 17 insertions(+) diff --git a/vulkan/vulkan_application.cc b/vulkan/vulkan_application.cc index 7ba881b843181..eaba000274ca4 100644 --- a/vulkan/vulkan_application.cc +++ b/vulkan/vulkan_application.cc @@ -129,6 +129,10 @@ const VulkanHandle& VulkanApplication::GetInstance() const { return instance_; } +void VulkanApplication::ReleaseInstanceOwnership() { + instance_.ReleaseOwnership(); +} + std::vector VulkanApplication::GetPhysicalDevices() const { if (!IsValid()) { return {}; diff --git a/vulkan/vulkan_application.h b/vulkan/vulkan_application.h index 9274701f95801..a5f20c07f63ec 100644 --- a/vulkan/vulkan_application.h +++ b/vulkan/vulkan_application.h @@ -38,6 +38,8 @@ class VulkanApplication { const VulkanHandle& GetInstance() const; + void ReleaseInstanceOwnership(); + std::unique_ptr AcquireFirstCompatibleLogicalDevice() const; private: diff --git a/vulkan/vulkan_device.cc b/vulkan/vulkan_device.cc index 745110ed70f2c..bb6c2e8a1437c 100644 --- a/vulkan/vulkan_device.cc +++ b/vulkan/vulkan_device.cc @@ -153,6 +153,10 @@ const VulkanHandle& VulkanDevice::GetHandle() const { return device_; } +void VulkanDevice::ReleaseDeviceOwnership() { + device_.ReleaseOwnership(); +} + const VulkanHandle& VulkanDevice::GetPhysicalDeviceHandle() const { return physical_device_; diff --git a/vulkan/vulkan_device.h b/vulkan/vulkan_device.h index e32f37d7ed57b..e9abf757f6a94 100644 --- a/vulkan/vulkan_device.h +++ b/vulkan/vulkan_device.h @@ -35,6 +35,8 @@ class VulkanDevice { uint32_t GetGraphicsQueueIndex() const; + void ReleaseDeviceOwnership(); + FXL_WARN_UNUSED_RESULT bool GetSurfaceCapabilities(const VulkanSurface& surface, VkSurfaceCapabilitiesKHR* capabilities) const; diff --git a/vulkan/vulkan_handle.h b/vulkan/vulkan_handle.h index 32f1f938e25bb..87f535e9b9132 100644 --- a/vulkan/vulkan_handle.h +++ b/vulkan/vulkan_handle.h @@ -50,6 +50,11 @@ class VulkanHandle { operator Handle() const { return handle_; } + /// Relinquish responsibility of collecting the underlying handle when this + /// object is collected. It is the responsibility of the caller to ensure that + /// the lifetime of the handle extends past the lifetime of this object. + void ReleaseOwnership() { disposer_ = nullptr; } + void Reset() { DisposeIfNecessary(); } private: From 5964ef2b7c3d266316001e46cf404de48e3bf398 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 7 Jun 2018 13:59:26 -0400 Subject: [PATCH 0539/1190] Roll src/third_party/skia 0d22539..8345aa6 (7 commits) (#5485) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 86f7e12118d1f..4a83d07f27c88 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0d225395faf27690c724619af35243985bf6e2df', + 'skia_revision': '8345aa6302c7ca25a4b9c2df913e83ef79220ab7', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9eb35704b8501..827d355afd7db 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b49b94a274385b7e2c0f81f990c7ebe0 +Signature: 5922ddcb78490ac5cfc659550e0d9c67 UNUSED LICENSES: From 45fa7e8f3be1cf313ec9b8de60107c688fb7a609 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 7 Jun 2018 14:24:03 -0700 Subject: [PATCH 0540/1190] libtxt: only apply ellipsizing to the last text run in the line (#5486) Paragraph layout breaks the text into lines, and ellipsizing (if applicable) will truncate the last run of a line at the point where word wrap would have occurred. Fixes https://github.com/flutter/flutter/issues/18198 --- third_party/txt/src/txt/paragraph.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index 1ece631fd57c1..e1bd883bf8345 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -484,7 +484,9 @@ void Paragraph::Layout(double width, bool force) { double justify_x_offset = 0; std::vector paint_records; - for (const BidiRun& run : line_runs) { + for (auto line_run_it = line_runs.begin(); line_run_it != line_runs.end(); + ++line_run_it) { + const BidiRun& run = *line_run_it; minikin::FontStyle font; minikin::MinikinPaint minikin_paint; GetFontAndMinikinPaint(run.style(), &font, &minikin_paint); @@ -503,6 +505,7 @@ void Paragraph::Layout(double width, bool force) { const std::u16string& ellipsis = paragraph_style_.ellipsis; std::vector ellipsized_text; if (ellipsis.length() && !isinf(width_) && !line_range.hard_break && + line_run_it == line_runs.end() - 1 && (line_number == line_limit - 1 || paragraph_style_.unlimited_lines())) { float ellipsis_width = layout.measureText( @@ -518,7 +521,7 @@ void Paragraph::Layout(double width, bool force) { // Truncate characters from the text until the ellipsis fits. size_t truncate_count = 0; while (truncate_count < text_count && - text_width + ellipsis_width > width_) { + run_x_offset + text_width + ellipsis_width > width_) { text_width -= text_advances[text_count - truncate_count - 1]; truncate_count++; } From 34c5bfd33ebd3373c036d565d1b6bb7d30f8ce10 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 7 Jun 2018 17:25:26 -0400 Subject: [PATCH 0541/1190] Roll src/third_party/skia 8345aa6..2e361a3 (11 commits) (#5487) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4a83d07f27c88..928c911eeaeab 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8345aa6302c7ca25a4b9c2df913e83ef79220ab7', + 'skia_revision': '2e361a3c34dd021f64c51c22fad26a187c436043', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 827d355afd7db..dd8b6df941211 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5922ddcb78490ac5cfc659550e0d9c67 +Signature: 5e73bc3b666ba23e42a959adfd24f981 UNUSED LICENSES: From f51b6b3b07e289795d7819ec60d6983ee064fec8 Mon Sep 17 00:00:00 2001 From: Stanislav Baranov Date: Thu, 7 Jun 2018 15:09:23 -0700 Subject: [PATCH 0542/1190] Support running bundles from zip file. (#5473) Support running bundles from zip file. --- assets/directory_asset_bundle.h | 2 -- .../platform/android/platform_view_android_jni.cc | 14 +++++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/assets/directory_asset_bundle.h b/assets/directory_asset_bundle.h index c3f231e0ae519..b436eaf4f95f0 100644 --- a/assets/directory_asset_bundle.h +++ b/assets/directory_asset_bundle.h @@ -22,8 +22,6 @@ class DirectoryAssetBundle : public AssetResolver { const fml::UniqueFD descriptor_; bool is_valid_ = false; - std::string GetPathForAsset(const std::string& asset_name) const; - // |blink::AssetResolver| bool IsValid() const override; diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 20748b09aaf03..de5b1df46120a 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -9,6 +9,7 @@ #include #include "flutter/assets/directory_asset_bundle.h" +#include "flutter/assets/zip_asset_store.h" #include "flutter/common/settings.h" #include "flutter/fml/file.h" #include "flutter/fml/platform/android/jni_util.h" @@ -207,9 +208,16 @@ static void RunBundleAndSnapshot( if (bundlepath.size() > 0) { // If we got a bundle path, attempt to use that as a directory asset - // bundle. - asset_manager->PushBack(std::make_unique( - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true))); + // bundle or a zip asset bundle. + const auto file_ext_index = bundlepath.rfind("."); + if (bundlepath.substr(file_ext_index) == ".zip") { + asset_manager->PushBack(std::make_unique( + bundlepath)); + } else { + asset_manager->PushBack(std::make_unique( + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true), + bundlepath)); + } // Use the last path component of the bundle path to determine the // directory in the APK assets. From 8c6953f869b4ac6376c911329183078d50b08231 Mon Sep 17 00:00:00 2001 From: Stanislav Baranov Date: Thu, 7 Jun 2018 15:36:35 -0700 Subject: [PATCH 0543/1190] Fix compile error introduce in #5473. (#5488) Fix compile error introduced in #5473. --- shell/platform/android/platform_view_android_jni.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index de5b1df46120a..30fc565c84270 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -215,8 +215,7 @@ static void RunBundleAndSnapshot( bundlepath)); } else { asset_manager->PushBack(std::make_unique( - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true), - bundlepath)); + fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true))); } // Use the last path component of the bundle path to determine the From 7637c7564fb9baa60fdcfb1ef4e02b6daf01d359 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 7 Jun 2018 20:49:25 -0400 Subject: [PATCH 0544/1190] Roll src/third_party/skia 2e361a3..9f752aa (3 commits) (#5490) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 928c911eeaeab..3742dec39468d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2e361a3c34dd021f64c51c22fad26a187c436043', + 'skia_revision': '9f752aada37c9e1e10328721ea0b480553da50d5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index dd8b6df941211..26abf57a72e9c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5e73bc3b666ba23e42a959adfd24f981 +Signature: 070bdbdf86559c6e2fd0b457f3cd476e UNUSED LICENSES: From 5d2f24aa5cbdbe3c5d41b2b261873d26f4077c79 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Thu, 7 Jun 2018 18:06:47 -0700 Subject: [PATCH 0545/1190] Fixing image encoding format conversion. (#5489) On a Linux host, we were having to convert the type of the bitmap to N32, but we weren't also fixing the channel order to RGBA, so consequently we were getting BGRA when the API was asking for RGBA. This forces the color format to be RGBA when that is what is asked for. We weren't needing to do conversion on macOS, so macOS was always getting RGBA. --- lib/ui/painting/image_encoding.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index 6db7fcf6791ec..c32c06cc2da3e 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -86,9 +86,10 @@ sk_sp EncodeImage(sk_sp image, ImageByteFormat format) { if (pixmap.colorType() != kRGBA_8888_SkColorType) { TRACE_EVENT0("flutter", "ConvertToRGBA"); - // Convert the pixel data to N32 to adhere to our API contract. - const auto image_info = SkImageInfo::MakeN32Premul(image->width(), - image->height()); + // Convert the pixel data to N32 and RGBA to adhere to our API contract. + const auto image_info = SkImageInfo::MakeN32Premul( + image->width(), image->height()).makeColorType(kRGBA_8888_SkColorType); + auto surface = SkSurface::MakeRaster(image_info); surface->writePixels(pixmap, 0, 0); if (!surface->peekPixels(&pixmap)) { From fc2234c6a37250b24710e85373f4d92afbbb3135 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 8 Jun 2018 00:13:25 -0400 Subject: [PATCH 0546/1190] Roll src/third_party/skia 9f752aa..7a45dd1 (1 commits) (#5491) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3742dec39468d..d57d420f8733d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9f752aada37c9e1e10328721ea0b480553da50d5', + 'skia_revision': '7a45dd1daca8de90f984591cf938dd089a7795a3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 26abf57a72e9c..a608f9ffc15f7 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 070bdbdf86559c6e2fd0b457f3cd476e +Signature: 9d9170a315707f18c086540ed83dd9ec UNUSED LICENSES: From 1f802b2925d82be7e7bedf093ee19da7eda51f69 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 8 Jun 2018 08:19:25 -0400 Subject: [PATCH 0547/1190] Roll src/third_party/skia 7a45dd1..88a32ef (1 commits) (#5492) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d57d420f8733d..ba3b4bc7086b1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7a45dd1daca8de90f984591cf938dd089a7795a3', + 'skia_revision': '88a32efa75cbc0fc6f84bc7a0522a94166a2ab13', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a608f9ffc15f7..fd099e39c254b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9d9170a315707f18c086540ed83dd9ec +Signature: 973688aae45f9a49d8a4b8cde2857511 UNUSED LICENSES: @@ -17303,6 +17303,7 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h +FILE: ../../../third_party/skia/src/gpu/ops/GrDebugMarkerOp.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp From b96c9fe46858dcf786f975bc57f8f2b02a743351 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 8 Jun 2018 11:45:26 -0400 Subject: [PATCH 0548/1190] Roll src/third_party/skia 88a32ef..cef57e9 (5 commits) (#5493) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ba3b4bc7086b1..417d2d35d5862 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '88a32efa75cbc0fc6f84bc7a0522a94166a2ab13', + 'skia_revision': 'cef57e94dbd1f1f9956c49f3d537de7c05e6189c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fd099e39c254b..5f7487ae54a00 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 973688aae45f9a49d8a4b8cde2857511 +Signature: c470e9023198f562f1d9a6b660ed14ed UNUSED LICENSES: From a7ff971045156b09d6524ae52a7cb859f194c520 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 8 Jun 2018 15:11:26 -0400 Subject: [PATCH 0549/1190] Roll src/third_party/skia cef57e9..89c5e88 (11 commits) (#5494) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 417d2d35d5862..679adf6a3400c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cef57e94dbd1f1f9956c49f3d537de7c05e6189c', + 'skia_revision': '89c5e8878e7957b6340de4ba1a14bded1f383fe2', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5f7487ae54a00..e75d053de092d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c470e9023198f562f1d9a6b660ed14ed +Signature: 6b12326b5605368db68bbce25dad1a5a UNUSED LICENSES: @@ -17183,6 +17183,10 @@ FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go +FILE: ../../../third_party/skia/modules/skjson/include/SkJSON.h +FILE: ../../../third_party/skia/modules/skjson/src/SkJSON.cpp +FILE: ../../../third_party/skia/modules/skjson/src/SkJSONBench.cpp +FILE: ../../../third_party/skia/modules/skjson/src/SkJSONTest.cpp FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.cpp FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.h FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.cpp @@ -19876,6 +19880,7 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp +FILE: ../../../third_party/skia/modules/skjson/src/FuzzSkJSON.cpp FILE: ../../../third_party/skia/modules/skottie/fuzz/FuzzSkottieJSON.cpp ---------------------------------------------------------------------------------------------------- Copyright 2018 Google, LLC From e634c281ef9daae0794f7bbedc27efe736341778 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 8 Jun 2018 17:05:25 -0400 Subject: [PATCH 0550/1190] Roll src/third_party/skia 89c5e88..27dddae (11 commits) (#5496) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 679adf6a3400c..79ef70ecdfc13 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '89c5e8878e7957b6340de4ba1a14bded1f383fe2', + 'skia_revision': '27dddae3130c8a6cfaa845195b2fb95cc691dd26', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e75d053de092d..98227b0f8506a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6b12326b5605368db68bbce25dad1a5a +Signature: 82494b0a08492e380acba0f74f2175c0 UNUSED LICENSES: @@ -14237,7 +14237,6 @@ FILE: ../../../third_party/skia/bench/SkRasterPipelineBench.cpp FILE: ../../../third_party/skia/bench/StreamBench.cpp FILE: ../../../third_party/skia/bench/SwizzleBench.cpp FILE: ../../../third_party/skia/bench/TileImageFilterBench.cpp -FILE: ../../../third_party/skia/bench/pack_int_uint16_t_Bench.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkPEG.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.h From d328f4e64f89a0ade5dfad304d233be6c6c2278e Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 8 Jun 2018 15:10:54 -0700 Subject: [PATCH 0551/1190] Enforce clang-format on all files in commit (#5495) * Enforce clang-format on all files in commit This re-enforces clang-format across all files changed in the commit. In c10c417, we enabled checking only for the lines changed in the diff in order to reduce the change of merge conflicts with the shell refactor landed in 58e84c8. * Reformat sources to match latest clang-format As part of re-enabling clang-format across the codebase, reformat all code to match the latest toolchain. --- .../framework/Source/FlutterPlatformPlugin.mm | 11 +++++----- .../Source/FlutterTextInputPlugin.mm | 2 +- .../framework/Source/accessibility_bridge.mm | 12 ++++++----- .../Source/accessibility_text_entry.mm | 3 ++- travis/format.sh | 21 +++++++++++++------ 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm index eae9e51ffa941..4508599757aa0 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.mm @@ -83,13 +83,14 @@ - (void)vibrateHapticFeedback:(NSString*)feedbackType { } if (@available(iOS 10, *)) { - if ([@"HapticFeedbackType.lightImpact" isEqualToString: feedbackType]) { + if ([@"HapticFeedbackType.lightImpact" isEqualToString:feedbackType]) { [[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight] impactOccurred]; - } else if ([@"HapticFeedbackType.mediumImpact" isEqualToString: feedbackType]) { - [[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium] impactOccurred]; - } else if ([@"HapticFeedbackType.heavyImpact" isEqualToString: feedbackType]) { + } else if ([@"HapticFeedbackType.mediumImpact" isEqualToString:feedbackType]) { + [[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium] + impactOccurred]; + } else if ([@"HapticFeedbackType.heavyImpact" isEqualToString:feedbackType]) { [[[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleHeavy] impactOccurred]; - } else if ([@"HapticFeedbackType.selectionClick" isEqualToString: feedbackType]) { + } else if ([@"HapticFeedbackType.selectionClick" isEqualToString:feedbackType]) { [[[UISelectionFeedbackGenerator alloc] init] selectionChanged]; } } diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 2a9f6b62ec188..79aee477a369c 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -95,7 +95,7 @@ - (id)copyWithZone:(NSZone*)zone { @end -@interface FlutterTextInputView : UIView +@interface FlutterTextInputView : UIView // UITextInput @property(nonatomic, readonly) NSMutableString* text; diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index dcfbf7dcfebf4..f923581e7f045 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -159,7 +159,8 @@ - (BOOL)isAccessibilityElement { // We enforce in the framework that no other useful semantics are merged with these nodes. if ([self node].HasFlag(blink::SemanticsFlags::kScopesRoute)) return false; - return ([self node].flags != 0 && [self node].flags != static_cast(blink::SemanticsFlags::kIsHidden)) || + return ([self node].flags != 0 && + [self node].flags != static_cast(blink::SemanticsFlags::kIsHidden)) || ![self node].label.empty() || ![self node].value.empty() || ![self node].hint.empty() || ([self node].actions & ~blink::kScrollableSemanticsActions) != 0; } @@ -219,7 +220,7 @@ - (CGRect)accessibilityFrame { return [self globalRect]; } -- (CGRect) globalRect { +- (CGRect)globalRect { SkMatrix44 globalTransform = [self node].transform; for (SemanticsObject* parent = [self parent]; parent; parent = parent.parent) { globalTransform = parent.node.transform * globalTransform; @@ -513,7 +514,8 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { NSMutableArray* newRoutes = [[[NSMutableArray alloc] init] autorelease]; [root collectRoutes:newRoutes]; for (SemanticsObject* route in newRoutes) { - if (std::find(previous_routes_.begin(), previous_routes_.end(), [route uid]) != previous_routes_.end()) { + if (std::find(previous_routes_.begin(), previous_routes_.end(), [route uid]) != + previous_routes_.end()) { lastAdded = route; } } @@ -522,8 +524,8 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { lastAdded = [newRoutes objectAtIndex:index]; } if (lastAdded != nil && [lastAdded uid] != previous_route_id_) { - previous_route_id_ = [lastAdded uid]; - routeChanged = true; + previous_route_id_ = [lastAdded uid]; + routeChanged = true; } previous_routes_.clear(); for (SemanticsObject* route in newRoutes) { diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm b/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm index 6dbfd3b56b893..ec98c5d003204 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm @@ -261,7 +261,8 @@ - (UIAccessibilityTraits)accessibilityTraits { // Adding UIAccessibilityTraitKeyboardKey to the trait list so that iOS treats it like // a keyboard entry control, thus adding support for text editing features, such as // pinch to select text, and up/down fling to move cursor. - return [super accessibilityTraits] | [self textInputSurrogate].accessibilityTraits | UIAccessibilityTraitKeyboardKey; + return [super accessibilityTraits] | [self textInputSurrogate].accessibilityTraits | + UIAccessibilityTraitKeyboardKey; } #pragma mark - UITextInput overrides diff --git a/travis/format.sh b/travis/format.sh index 277ced4084be1..8cc0d95cfe5d6 100755 --- a/travis/format.sh +++ b/travis/format.sh @@ -27,17 +27,26 @@ esac # Tools CLANG_FORMAT="../buildtools/$OS/clang/bin/clang-format" -CLANG_FORMAT_DIFF="../buildtools/$OS/clang/share/clang/clang-format-diff.py" $CLANG_FORMAT --version # Compute the diffs. FILETYPES="*.c *.cc *.cpp *.h *.m *.mm" -DIFF_OPTS="-U0 --no-color" -DIFFS="$(git diff $DIFF_OPTS -- master $FILETYPES | "$CLANG_FORMAT_DIFF" -p1 -binary "$CLANG_FORMAT")" +DIFF_OPTS="-U0 --no-color --name-only" +FILES_TO_CHECK="$(git diff $DIFF_OPTS -- master $FILETYPES)" -if [[ ! -z "$DIFFS" ]]; then +FAILED_CHECKS=0 +for f in $FILES_TO_CHECK; do + set +e + CUR_DIFF="$(diff -u "$f" <("$CLANG_FORMAT" --style=file "$f"))" + set -e + if [[ ! -z "$CUR_DIFF" ]]; then + echo "$CUR_DIFF" + FAILED_CHECKS=$(($FAILED_CHECKS+1)) + fi +done + +if [[ $FAILED_CHECKS -ne 0 ]]; then echo "" - echo "ERROR: Some files are formatted incorrectly. To fix, apply diffs below via patch -p0:" - echo "$DIFFS" + echo "ERROR: Some files are formatted incorrectly. To fix, apply diffs above via patch -p0." exit 1 fi From d4f5ef65a261eba332453a98291831b44b571835 Mon Sep 17 00:00:00 2001 From: Stanislav Baranov Date: Fri, 8 Jun 2018 15:26:29 -0700 Subject: [PATCH 0552/1190] Support for saving Dart compilation trace on device. (#5443) Support for saving Dart compilation trace on device. --- lib/ui/dart_runtime_hooks.cc | 19 +++++++++++++++++++ lib/ui/natives.dart | 11 +++++++++++ lib/ui/ui.dart | 1 + 3 files changed, 31 insertions(+) diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index 2939e896cd044..ca129cb4d9768 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -47,6 +47,7 @@ namespace blink { #define BUILTIN_NATIVE_LIST(V) \ V(Logger_PrintString, 1) \ + V(SaveCompilationTrace, 0) \ V(ScheduleMicrotask, 1) BUILTIN_NATIVE_LIST(DECLARE_FUNCTION); @@ -199,6 +200,24 @@ void Logger_PrintString(Dart_NativeArguments args) { } } +void SaveCompilationTrace(Dart_NativeArguments args) { + uint8_t* buffer = nullptr; + intptr_t length = 0; + Dart_Handle result = Dart_SaveCompilationTrace(&buffer, &length); + if (Dart_IsError(result)) { + Dart_SetReturnValue(args, result); + return; + } + + result = Dart_NewExternalTypedData(Dart_TypedData_kUint8, buffer, length); + if (Dart_IsError(result)) { + Dart_SetReturnValue(args, result); + return; + } + + Dart_SetReturnValue(args, result); +} + void ScheduleMicrotask(Dart_NativeArguments args) { Dart_Handle closure = Dart_GetNativeArgument(args, 0); UIDartState::Current()->ScheduleMicrotask(closure); diff --git a/lib/ui/natives.dart b/lib/ui/natives.dart index b5123099ae392..0a384607347f4 100644 --- a/lib/ui/natives.dart +++ b/lib/ui/natives.dart @@ -35,6 +35,17 @@ void _setupHooks() { }()); } +void saveCompilationTrace(String filePath) { + final result = _saveCompilationTrace(); + if (result is Error) + throw result; + + final file = new File(filePath); + file.writeAsBytesSync(result); +} + +dynamic _saveCompilationTrace() native 'SaveCompilationTrace'; + void _scheduleMicrotask(void callback()) native 'ScheduleMicrotask'; // Required for gen_snapshot to work correctly. diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index 149cbde2101d4..b6d22ca2939e9 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -16,6 +16,7 @@ import 'dart:async'; import 'dart:collection' as collection; import 'dart:convert'; import 'dart:developer' as developer; +import 'dart:io'; import 'dart:math' as math; import 'dart:nativewrappers'; import 'dart:typed_data'; From 8f023c5dacba213c9944e4da22c253803d31af89 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Sun, 10 Jun 2018 00:21:18 -0400 Subject: [PATCH 0553/1190] Allow custom foreground paint to be used for drawing text (#5395) * Allow specifying the foreground paint * fix typo * doc update * call paint.reset --- lib/ui/text.dart | 32 ++++++++++++++++++++------- lib/ui/text/paragraph_builder.cc | 14 +++++++++++- lib/ui/text/paragraph_builder.h | 4 +++- third_party/txt/src/txt/paragraph.cc | 18 ++++++++++----- third_party/txt/src/txt/text_style.cc | 2 ++ third_party/txt/src/txt/text_style.h | 2 ++ 6 files changed, 56 insertions(+), 16 deletions(-) diff --git a/lib/ui/text.dart b/lib/ui/text.dart index ff623068acd6b..a98b2414e6d3b 100644 --- a/lib/ui/text.dart +++ b/lib/ui/text.dart @@ -258,6 +258,7 @@ Int32List _encodeTextStyle( double height, Locale locale, Paint background, + Paint foreground, ) { final Int32List result = new Int32List(8); if (color != null) { @@ -316,6 +317,10 @@ Int32List _encodeTextStyle( result[0] |= 1 << 14; // Passed separately to native. } + if (foreground != null) { + result[0] |= 1 << 15; + // Passed separately to native. + } return result; } @@ -323,7 +328,7 @@ Int32List _encodeTextStyle( class TextStyle { /// Creates a new TextStyle object. /// - /// * `color`: The color to use when painting the text. + /// * `color`: The color to use when painting the text. If this is specified, `foreground` must be null. /// * `decoration`: The decorations to paint near the text (e.g., an underline). /// * `decorationColor`: The color in which to paint the text decorations. /// * `decorationStyle`: The style in which to paint the text decorations (e.g., dashed). @@ -337,6 +342,7 @@ class TextStyle { /// * `height`: The height of this text span, as a multiple of the font size. /// * `locale`: The locale used to select region-specific glyphs. /// * `background`: The paint drawn as a background for the text. + /// * `foreground`: The paint used to draw the text. If this is specified, `color` must be null. TextStyle({ Color color, TextDecoration decoration, @@ -352,7 +358,12 @@ class TextStyle { double height, Locale locale, Paint background, - }) : _encoded = _encodeTextStyle( + Paint foreground, + }) : assert(color == null || foreground == null, + 'Cannot provide both a color and a foreground\n' + 'The color argument is just a shorthand for "foreground: new Paint()..color = color".' + ), + _encoded = _encodeTextStyle( color, decoration, decorationColor, @@ -367,6 +378,7 @@ class TextStyle { height, locale, background, + foreground, ), _fontFamily = fontFamily ?? '', _fontSize = fontSize, @@ -374,7 +386,8 @@ class TextStyle { _wordSpacing = wordSpacing, _height = height, _locale = locale, - _background = background; + _background = background, + _foreground = foreground; final Int32List _encoded; final String _fontFamily; @@ -384,6 +397,7 @@ class TextStyle { final double _height; final Locale _locale; final Paint _background; + final Paint _foreground; @override bool operator ==(dynamic other) { @@ -398,7 +412,8 @@ class TextStyle { _wordSpacing != typedOther._wordSpacing || _height != typedOther._height || _locale != typedOther._locale || - _background != typedOther._background) + _background != typedOther._background || + _foreground != typedOther._foreground) return false; for (int index = 0; index < _encoded.length; index += 1) { if (_encoded[index] != typedOther._encoded[index]) @@ -408,7 +423,7 @@ class TextStyle { } @override - int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _letterSpacing, _wordSpacing, _height, _locale, _background); + int get hashCode => hashValues(hashList(_encoded), _fontFamily, _fontSize, _letterSpacing, _wordSpacing, _height, _locale, _background, _foreground); @override String toString() { @@ -426,7 +441,8 @@ class TextStyle { 'wordSpacing: ${ _encoded[0] & 0x0800 == 0x0800 ? "${_wordSpacing}x" : "unspecified"}, ' 'height: ${ _encoded[0] & 0x1000 == 0x1000 ? "${_height}x" : "unspecified"}, ' 'locale: ${ _encoded[0] & 0x2000 == 0x2000 ? _locale : "unspecified"}, ' - 'background: ${ _encoded[0] & 0x4000 == 0x4000 ? _background : "unspecified"}' + 'background: ${ _encoded[0] & 0x4000 == 0x4000 ? _background : "unspecified"}, ' + 'foreground: ${ _encoded[0] & 0x8000 == 0x8000 ? _foreground : "unspecified"}' ')'; } } @@ -1025,8 +1041,8 @@ class ParagraphBuilder extends NativeFieldWrapperClass2 { /// Applies the given style to the added text until [pop] is called. /// /// See [pop] for details. - void pushStyle(TextStyle style) => _pushStyle(style._encoded, style._fontFamily, style._fontSize, style._letterSpacing, style._wordSpacing, style._height, _encodeLocale(style._locale), style._background?._objects, style._background?._data); - void _pushStyle(Int32List encoded, String fontFamily, double fontSize, double letterSpacing, double wordSpacing, double height, String locale, List backgroundObjects, ByteData backgroundData) native 'ParagraphBuilder_pushStyle'; + void pushStyle(TextStyle style) => _pushStyle(style._encoded, style._fontFamily, style._fontSize, style._letterSpacing, style._wordSpacing, style._height, _encodeLocale(style._locale), style._background?._objects, style._background?._data, style._foreground?._objects, style._foreground?._data); + void _pushStyle(Int32List encoded, String fontFamily, double fontSize, double letterSpacing, double wordSpacing, double height, String locale, List backgroundObjects, ByteData backgroundData, List foregroundObjects, ByteData foregroundData) native 'ParagraphBuilder_pushStyle'; static String _encodeLocale(Locale locale) => locale?.toString() ?? ''; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index 926819eeac8aa..c9b896294c59c 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -39,6 +39,7 @@ const int tsWordSpacingIndex = 11; const int tsHeightIndex = 12; const int tsLocaleIndex = 13; const int tsBackgroundIndex = 14; +const int tsForegroundIndex = 15; const int tsColorMask = 1 << tsColorIndex; const int tsTextDecorationMask = 1 << tsTextDecorationIndex; @@ -54,6 +55,7 @@ const int tsWordSpacingMask = 1 << tsWordSpacingIndex; const int tsHeightMask = 1 << tsHeightIndex; const int tsLocaleMask = 1 << tsLocaleIndex; const int tsBackgroundMask = 1 << tsBackgroundIndex; +const int tsForegroundMask = 1 << tsForegroundIndex; // ParagraphStyle @@ -167,7 +169,9 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, double height, const std::string& locale, Dart_Handle background_objects, - Dart_Handle background_data) { + Dart_Handle background_data, + Dart_Handle foreground_objects, + Dart_Handle foreground_data) { FXL_DCHECK(encoded.num_elements() == 8); int32_t mask = encoded[0]; @@ -235,6 +239,14 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, } } + if (mask & tsForegroundMask) { + Paint foreground(foreground_objects, foreground_data); + if (foreground.paint()) { + style.has_foreground = true; + style.foreground = *foreground.paint(); + } + } + m_paragraphBuilder->PushStyle(style); } diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index fb8e368cc30ee..723c3d78fd12d 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -43,7 +43,9 @@ class ParagraphBuilder : public fxl::RefCountedThreadSafe, double height, const std::string& locale, Dart_Handle background_objects, - Dart_Handle background_data); + Dart_Handle background_data, + Dart_Handle foreground_objects, + Dart_Handle foreground_data); void pop(); diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index e1bd883bf8345..78b2ef8be9deb 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -877,7 +877,12 @@ void Paragraph::Paint(SkCanvas* canvas, double x, double y) { canvas->translate(x, y); SkPaint paint; for (const PaintRecord& record : records_) { - paint.setColor(record.style().color); + if (record.style().has_foreground) { + paint = record.style().foreground; + } else { + paint.reset(); + paint.setColor(record.style().color); + } SkPoint offset = record.offset(); PaintBackground(canvas, record); canvas->drawTextBlob(record.text(), offset.x(), offset.y(), paint); @@ -1049,8 +1054,8 @@ void Paragraph::PaintBackground(SkCanvas* canvas, const PaintRecord& record) { return; const SkPaint::FontMetrics& metrics = record.metrics(); - SkRect rect(SkRect::MakeLTRB(0, metrics.fAscent, - record.GetRunWidth(), metrics.fDescent)); + SkRect rect(SkRect::MakeLTRB(0, metrics.fAscent, record.GetRunWidth(), + metrics.fDescent)); rect.offset(record.offset()); canvas->drawRect(rect, record.style().background); } @@ -1090,15 +1095,16 @@ std::vector Paragraph::GetRectsForRange(size_t start, } // Add empty rectangles representing any newline characters within the range. - for (size_t line_number = 0; line_number < line_ranges_.size(); ++line_number) { + for (size_t line_number = 0; line_number < line_ranges_.size(); + ++line_number) { const LineRange& line = line_ranges_[line_number]; if (line.start >= end) break; if (line.end_including_newline <= start) continue; if (line_boxes.find(line_number) == line_boxes.end()) { - if (line.end != line.end_including_newline && - line.end >= start && line.end_including_newline <= end) { + if (line.end != line.end_including_newline && line.end >= start && + line.end_including_newline <= end) { SkScalar x = line_widths_[line_number]; SkScalar top = (line_number > 0) ? line_heights_[line_number - 1] : 0; SkScalar bottom = line_heights_[line_number]; diff --git a/third_party/txt/src/txt/text_style.cc b/third_party/txt/src/txt/text_style.cc index 242b6f3818b77..abf9cde1b9048 100644 --- a/third_party/txt/src/txt/text_style.cc +++ b/third_party/txt/src/txt/text_style.cc @@ -49,6 +49,8 @@ bool TextStyle::equals(const TextStyle& other) const { return false; if (locale != other.locale) return false; + if (foreground != other.foreground) + return false; return true; } diff --git a/third_party/txt/src/txt/text_style.h b/third_party/txt/src/txt/text_style.h index 2b995132a36d7..6d91b5862ff19 100644 --- a/third_party/txt/src/txt/text_style.h +++ b/third_party/txt/src/txt/text_style.h @@ -49,6 +49,8 @@ class TextStyle { std::string locale; bool has_background = false; SkPaint background; + bool has_foreground = false; + SkPaint foreground; TextStyle(); From d33bbff47055bc3f1cddfb768881b395c4ac19c2 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Sun, 10 Jun 2018 12:47:14 -0400 Subject: [PATCH 0554/1190] make analyzer happy (#5499) --- lib/ui/natives.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ui/natives.dart b/lib/ui/natives.dart index 0a384607347f4..4dfb2e481675e 100644 --- a/lib/ui/natives.dart +++ b/lib/ui/natives.dart @@ -36,11 +36,11 @@ void _setupHooks() { } void saveCompilationTrace(String filePath) { - final result = _saveCompilationTrace(); + final dynamic result = _saveCompilationTrace(); if (result is Error) throw result; - final file = new File(filePath); + final File file = new File(filePath); file.writeAsBytesSync(result); } From 16ea70b6fef34b2536cde30f4a835bdd9c2984c3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 11 Jun 2018 08:32:12 -0400 Subject: [PATCH 0555/1190] Roll src/third_party/skia 27dddae3130c..4c4650150d5f (16 commits) (#5500) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 79ef70ecdfc13..c7580f891ab54 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '27dddae3130c8a6cfaa845195b2fb95cc691dd26', + 'skia_revision': '4c4650150d5f40e4246e5e90baf5e5dfa7d008a5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 98227b0f8506a..c822977c28707 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 82494b0a08492e380acba0f74f2175c0 +Signature: f0a4cf023a553536dcdc28c1f12ac4a3 UNUSED LICENSES: @@ -17523,6 +17523,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.ex FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Mini.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Static.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json @@ -17541,7 +17542,6 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.ex FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Test-Ubuntu14-Clang-GCE-CPU-AVX2-x86_64-Debug-All-CT_DM_10k_SKPs.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/examples/full.expected/test.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json @@ -17753,7 +17753,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/upload_nano_results.expected/ FILE: ../../../third_party/skia/infra/bots/recipes/upload_skiaserve.expected/normal_bot.json FILE: ../../../third_party/skia/infra/bots/recipes/upload_skiaserve.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/resources.isolate -FILE: ../../../third_party/skia/infra/bots/skia_repo.isolate FILE: ../../../third_party/skia/infra/bots/skpbench_skia_bundled.isolate FILE: ../../../third_party/skia/infra/bots/swarm_recipe.isolate FILE: ../../../third_party/skia/infra/bots/tasks.json From 782e50069f2f5146b00cd03a8663e5164898cd03 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 11 Jun 2018 11:44:12 -0400 Subject: [PATCH 0556/1190] Roll src/third_party/skia 4c4650150d5f..46fbf8c97a13 (1 commits) (#5501) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index c7580f891ab54..d6903c8d8dcae 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4c4650150d5f40e4246e5e90baf5e5dfa7d008a5', + 'skia_revision': '46fbf8c97a13a25876d93cb3e1683c59cc84b07f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 4c911564bac6acde3623c96b215efd8c4087dbb2 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 11 Jun 2018 15:07:59 -0400 Subject: [PATCH 0557/1190] Roll src/third_party/skia 46fbf8c97a13..36f0c41eafe9 (5 commits) (#5502) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d6903c8d8dcae..3ccd1e7b9b60b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '46fbf8c97a13a25876d93cb3e1683c59cc84b07f', + 'skia_revision': '36f0c41eafe96d0446c2681b706e9d4321ede156', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c822977c28707..49c6fac3d2330 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f0a4cf023a553536dcdc28c1f12ac4a3 +Signature: a70976918111b24425112f04b6f77470 UNUSED LICENSES: From 036443d7736eb0a9e556117417bbefeb394f4d66 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 11 Jun 2018 18:31:58 -0400 Subject: [PATCH 0558/1190] Roll src/third_party/skia 36f0c41eafe9..5c12122ad91d (5 commits) (#5503) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3ccd1e7b9b60b..9bf0bc17b7f2f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '36f0c41eafe96d0446c2681b706e9d4321ede156', + 'skia_revision': '5c12122ad91dbfa4acd613a05daa921cb92aafa3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 49c6fac3d2330..9aef09eeb5c06 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a70976918111b24425112f04b6f77470 +Signature: 8e2bf7fb92334aab3eb4be89ddda0814 UNUSED LICENSES: From 0ea93c3a3e40426fd222ba22c2f60756c8a32097 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Mon, 11 Jun 2018 17:00:43 -0700 Subject: [PATCH 0559/1190] Eliminate support for Dart 1 (#5504) Eliminates support for running directly from sources or script snapshots. In debug mode, we run from a kernel snapshot; in profile and release modes, we link in AOT-compiled code. Renames --dart-non-checked-mode to --disable-dart-asserts since checked mode does not make sense in Dart 2. --- common/settings.cc | 2 - common/settings.h | 2 - runtime/dart_isolate.cc | 33 +------ runtime/dart_service_isolate.cc | 98 ++----------------- runtime/dart_service_isolate.h | 9 -- runtime/dart_vm.cc | 42 ++------ shell/common/isolate_configuration.cc | 11 --- shell/common/switches.cc | 7 -- shell/common/switches.h | 8 -- .../darwin/ios/framework/Headers/Flutter.h | 36 +++---- .../framework/Headers/FlutterDartProject.h | 3 - .../framework/Source/FlutterDartProject.mm | 32 ------ 12 files changed, 39 insertions(+), 244 deletions(-) diff --git a/common/settings.cc b/common/settings.cc index 8123b1d321ef6..9a369c420dee9 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -11,7 +11,6 @@ namespace blink { std::string Settings::ToString() const { std::stringstream stream; stream << "Settings: " << std::endl; - stream << "script_snapshot_path: " << script_snapshot_path << std::endl; stream << "vm_snapshot_data_path: " << vm_snapshot_data_path << std::endl; stream << "vm_snapshot_instr_path: " << vm_snapshot_instr_path << std::endl; stream << "isolate_snapshot_data_path: " << isolate_snapshot_data_path @@ -32,7 +31,6 @@ std::string Settings::ToString() const { stream << "trace_startup: " << trace_startup << std::endl; stream << "endless_trace_buffer: " << endless_trace_buffer << std::endl; stream << "enable_dart_profiling: " << enable_dart_profiling << std::endl; - stream << "dart_non_checked_mode: " << dart_non_checked_mode << std::endl; stream << "enable_observatory: " << enable_observatory << std::endl; stream << "observatory_port: " << observatory_port << std::endl; stream << "ipv6: " << ipv6 << std::endl; diff --git a/common/settings.h b/common/settings.h index 547673529ee1e..5124bb147a733 100644 --- a/common/settings.h +++ b/common/settings.h @@ -23,7 +23,6 @@ using TaskObserverRemove = std::function; struct Settings { // VM settings - std::string script_snapshot_path; std::string platform_kernel_path; std::string vm_snapshot_data_path; @@ -47,7 +46,6 @@ struct Settings { bool trace_startup = false; bool endless_trace_buffer = false; bool enable_dart_profiling = false; - bool dart_non_checked_mode = false; // Used as the script URI in debug messages. Does not affect how the Dart code // is executed. std::string advisory_script_uri = "main.dart"; diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index ded3ff8f6da2a..e5f2c494f82f4 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -277,18 +277,9 @@ bool DartIsolate::PrepareForRunningFromPrecompiledCode() { return true; } -static bool LoadScriptSnapshot(std::shared_ptr mapping, - bool last_piece) { - FXL_CHECK(last_piece) << "Script snapshots cannot be divided"; - if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), - mapping->GetSize()))) { - return false; - } - return true; -} - static bool LoadKernelSnapshot(std::shared_ptr mapping, bool last_piece) { + FXL_DCHECK(Dart_IsKernel(mapping->GetMapping(), mapping->GetSize())) << "Only kernel snapshots are supported"; Dart_Handle library = Dart_LoadLibraryFromKernel(mapping->GetMapping(), mapping->GetSize()); if (tonic::LogIfError(library)) { @@ -307,16 +298,6 @@ static bool LoadKernelSnapshot(std::shared_ptr mapping, return true; } -static bool LoadSnapshot(std::shared_ptr mapping, - bool last_piece) { - if (Dart_IsKernel(mapping->GetMapping(), mapping->GetSize())) { - return LoadKernelSnapshot(std::move(mapping), last_piece); - } else { - return LoadScriptSnapshot(std::move(mapping), last_piece); - } - return false; -} - FXL_WARN_UNUSED_RESULT bool DartIsolate::PrepareForRunningFromSnapshot( std::shared_ptr mapping, @@ -340,7 +321,7 @@ bool DartIsolate::PrepareForRunningFromSnapshot( return false; } - if (!LoadSnapshot(mapping, last_piece)) { + if (!LoadKernelSnapshot(mapping, last_piece)) { return false; } @@ -566,20 +547,12 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( // thread. service_isolate->ResetWeakPtrFactory(); - const bool isolate_snapshot_is_dart_2 = Dart_IsDart2Snapshot( - vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); - const bool is_preview_dart2 = - (vm->GetPlatformKernel().GetSize() > 0) || isolate_snapshot_is_dart_2; - const bool running_from_sources = - !DartVM::IsRunningPrecompiledCode() && !is_preview_dart2; - tonic::DartState::Scope scope(service_isolate); if (!DartServiceIsolate::Startup( settings.ipv6 ? "::1" : "127.0.0.1", // server IP address settings.observatory_port, // server observatory port tonic::DartState::HandleLibraryTag, // embedder library tag handler - running_from_sources, // running from source code - false, // disable websocket origin check + false, // disable websocket origin check error // error (out) )) { // Error is populated by call to startup. diff --git a/runtime/dart_service_isolate.cc b/runtime/dart_service_isolate.cc index 3239e4f437eca..9a69de58504fa 100644 --- a/runtime/dart_service_isolate.cc +++ b/runtime/dart_service_isolate.cc @@ -27,7 +27,6 @@ } #define kLibrarySourceNamePrefix "/vmservice" -static const char* kServiceIsolateScript = "vmservice_io.dart"; namespace flutter { namespace runtime { @@ -84,7 +83,6 @@ void DartServiceIsolate::Shutdown(Dart_NativeArguments args) { bool DartServiceIsolate::Startup(std::string server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, - bool running_from_sources, bool disable_origin_check, char** error) { Dart_Isolate isolate = Dart_CurrentIsolate(); @@ -108,31 +106,14 @@ bool DartServiceIsolate::Startup(std::string server_ip, &flutter::runtime::__flutter_embedded_service_isolate_resources_[0]); } - Dart_Handle result; - - if (running_from_sources) { - // Use our own library tag handler when loading service isolate sources. - Dart_SetLibraryTagHandler(DartServiceIsolate::LibraryTagHandler); - // Load main script. - Dart_Handle library = LoadScript(kServiceIsolateScript); - FXL_DCHECK(library != Dart_Null()); - SHUTDOWN_ON_ERROR(library); - // Setup native entry resolution. - result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol); - - SHUTDOWN_ON_ERROR(result); - // Finalize loading. - result = Dart_FinalizeLoading(false); - SHUTDOWN_ON_ERROR(result); - } else { - Dart_Handle uri = Dart_NewStringFromCString("dart:vmservice_io"); - Dart_Handle library = Dart_LookupLibrary(uri); - SHUTDOWN_ON_ERROR(library); - result = Dart_SetRootLibrary(library); - SHUTDOWN_ON_ERROR(result); - result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol); - SHUTDOWN_ON_ERROR(result); - } + // Set the root library for the isolate. + Dart_Handle uri = Dart_NewStringFromCString("dart:vmservice_io"); + Dart_Handle library = Dart_LookupLibrary(uri); + SHUTDOWN_ON_ERROR(library); + Dart_Handle result = Dart_SetRootLibrary(library); + SHUTDOWN_ON_ERROR(result); + result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol); + SHUTDOWN_ON_ERROR(result); // Make runnable. Dart_ExitScope(); @@ -146,7 +127,7 @@ bool DartServiceIsolate::Startup(std::string server_ip, Dart_EnterIsolate(isolate); Dart_EnterScope(); - Dart_Handle library = Dart_RootLibrary(); + library = Dart_RootLibrary(); SHUTDOWN_ON_ERROR(library); // Set the HTTP server's ip. @@ -174,30 +155,6 @@ bool DartServiceIsolate::Startup(std::string server_ip, return true; } -Dart_Handle DartServiceIsolate::GetSource(const char* name) { - const intptr_t kBufferSize = 512; - char buffer[kBufferSize]; - snprintf(&buffer[0], kBufferSize - 1, "%s/%s", kLibrarySourceNamePrefix, - name); - const char* vmservice_source = NULL; - int r = g_resources->ResourceLookup(buffer, &vmservice_source); - FXL_DCHECK(r != EmbedderResources::kNoSuchInstance); - return Dart_NewStringFromCString(vmservice_source); -} - -Dart_Handle DartServiceIsolate::LoadScript(const char* name) { - Dart_Handle url = Dart_NewStringFromCString("dart:vmservice_io"); - Dart_Handle source = GetSource(name); - return Dart_LoadScript(url, Dart_Null(), source, 0, 0); -} - -Dart_Handle DartServiceIsolate::LoadSource(Dart_Handle library, - const char* name) { - Dart_Handle url = Dart_NewStringFromCString(name); - Dart_Handle source = GetSource(name); - return Dart_LoadSource(library, url, Dart_Null(), source, 0, 0); -} - Dart_Handle DartServiceIsolate::LoadResource(Dart_Handle library, const char* resource_name) { // Prepare for invoke call. @@ -248,41 +205,4 @@ Dart_Handle DartServiceIsolate::LoadResources(Dart_Handle library) { return result; } -Dart_Handle DartServiceIsolate::LibraryTagHandler(Dart_LibraryTag tag, - Dart_Handle library, - Dart_Handle url) { - if (!Dart_IsLibrary(library)) { - return Dart_NewApiError("not a library"); - } - if (!Dart_IsString(url)) { - return Dart_NewApiError("url is not a string"); - } - const char* url_string = NULL; - Dart_Handle result = Dart_StringToCString(url, &url_string); - if (Dart_IsError(result)) { - return result; - } - Dart_Handle library_url = Dart_LibraryUrl(library); - const char* library_url_string = NULL; - result = Dart_StringToCString(library_url, &library_url_string); - if (Dart_IsError(result)) { - return result; - } - if (tag == Dart_kImportTag) { - // Embedder handles all requests for external libraries. - return g_embedder_tag_handler(tag, library, url); - } - FXL_DCHECK((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl)); - if (tag == Dart_kCanonicalizeUrl) { - // url is already canonicalized. - return url; - } - // Get source from builtin resources. - Dart_Handle source = GetSource(url_string); - if (Dart_IsError(source)) { - return source; - } - return Dart_LoadSource(library, url, Dart_Null(), source, 0, 0); -} - } // namespace blink diff --git a/runtime/dart_service_isolate.h b/runtime/dart_service_isolate.h index 59a02e2e9d495..b1d17af4f90cd 100644 --- a/runtime/dart_service_isolate.h +++ b/runtime/dart_service_isolate.h @@ -16,7 +16,6 @@ class DartServiceIsolate { static bool Startup(std::string server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, - bool running_from_sources, bool disable_origin_check, char** error); @@ -28,14 +27,6 @@ class DartServiceIsolate { static void NotifyServerState(Dart_NativeArguments args); static void Shutdown(Dart_NativeArguments args); - // Script loading. - static Dart_Handle GetSource(const char* name); - static Dart_Handle LoadScript(const char* name); - static Dart_Handle LoadSource(Dart_Handle library, const char* name); - static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, - Dart_Handle library, - Dart_Handle url); - // Observatory resource loading. static Dart_Handle LoadResources(Dart_Handle library); static Dart_Handle LoadResource(Dart_Handle library, const char* name); diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 776fbab983e10..3ca3bb77cf41b 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -83,14 +83,6 @@ static const char* kDartAssertArgs[] = { // clang-format on }; -static const char* kDartCheckedModeArgs[] = { - // clang-format off - "--enable_type_checks", - "--error_on_bad_type", - "--error_on_bad_override", - // clang-format on -}; - static const char* kDartStrongModeArgs[] = { // clang-format off "--strong", @@ -324,18 +316,18 @@ DartVM::DartVM(const Settings& settings, arraysize(kDartPrecompilationArgs)); } - // Enable checked mode if we are not running precompiled code. We run non- + // Enable asserts if we are not running precompiled code. We run non- // precompiled code only in the debug product mode. - bool use_checked_mode = !settings.dart_non_checked_mode; + bool enable_asserts = true; #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_PROFILE || \ FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE - use_checked_mode = false; + enable_asserts = false; #endif #if !OS_FUCHSIA if (IsRunningPrecompiledCode()) { - use_checked_mode = false; + enable_asserts = false; } #endif // !OS_FUCHSIA @@ -346,29 +338,12 @@ DartVM::DartVM(const Settings& settings, arraysize(kDartWriteProtectCodeArgs)); #endif - const bool isolate_snapshot_is_dart_2 = - Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); + // Require Dart 2. + FML_DCHECK(platform_kernel_mapping_->GetSize() > 0); - const bool is_preview_dart2 = - (platform_kernel_mapping_->GetSize() > 0) || isolate_snapshot_is_dart_2; - - FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? "is" : "is NOT") - << " enabled. Platform kernel: " - << static_cast(platform_kernel_mapping_->GetSize() > 0) - << " Isolate Snapshot is Dart 2: " - << isolate_snapshot_is_dart_2; - - if (is_preview_dart2) { - PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); - if (use_checked_mode) { - PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - } - } else if (use_checked_mode) { - FXL_DLOG(INFO) << "Checked mode is ON"; + PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); + if (enable_asserts) { PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); - PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); - } else { - FXL_DLOG(INFO) << "Is not Dart 2 and Checked mode is OFF"; } if (settings.start_paused) { @@ -390,6 +365,7 @@ DartVM::DartVM(const Settings& settings, PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); #endif + // Add VM dart_flags last to allow user overrides. for (size_t i = 0; i < settings.dart_flags.size(); i++) args.push_back(settings.dart_flags[i].c_str()); diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc index c971740568e97..825920d64f552 100644 --- a/shell/common/isolate_configuration.cc +++ b/shell/common/isolate_configuration.cc @@ -145,17 +145,6 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( } } - // Running from script snapshot. - { - // TODO(engine): Add AssetManager::GetAsMapping or such to avoid the copy. - std::vector script_snapshot; - if (asset_manager && asset_manager->GetAsBuffer( - settings.script_snapshot_path, &script_snapshot)) { - return CreateForSnapshot( - std::make_unique(std::move(script_snapshot))); - } - } - // Running from kernel divided into several pieces (for sharing). { // TODO(fuchsia): Add AssetManager::GetAsMapping or such to avoid the copy. diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 33752d6f94a4d..7a6dfecca36d1 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -129,10 +129,6 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { } } - // Checked mode overrides. - settings.dart_non_checked_mode = - command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); - settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); settings.start_paused = @@ -161,9 +157,6 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir), &settings.assets_path); - command_line.GetOptionValue(FlagForSwitch(Switch::Snapshot), - &settings.script_snapshot_path); - command_line.GetOptionValue(FlagForSwitch(Switch::MainDartFile), &settings.main_dart_file_path); diff --git a/shell/common/switches.h b/shell/common/switches.h index 4f694d37475fa..8433d0f0cffd1 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -93,7 +93,6 @@ DEF_SWITCH(Help, "help", "Display this help text.") DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.") DEF_SWITCH(MainDartFile, "dart-main", "The path to the main Dart file.") DEF_SWITCH(Packages, "packages", "Specify the path to the packages.") -DEF_SWITCH(Snapshot, "snapshot-blob", "Specify the path to the snapshot blob") DEF_SWITCH(StartPaused, "start-paused", "Start the application paused in the Dart debugger.") @@ -122,13 +121,6 @@ DEF_SWITCH(RunForever, "run-forever", "In non-interactive mode, keep the shell running after the Dart " "script has completed.") -DEF_SWITCH(DartNonCheckedMode, - "dart-non-checked-mode", - "Dart code runs in checked mode when the runtime mode is debug. In " - "profile and release product modes, the application code is " - "precompiled and checked mode is unsupported. However, this flag " - "may be specified if the user wishes to run in the debug product " - "mode (i.e. with JIT or DBC) with checked mode off.") DEF_SWITCHES_END void PrintUsage(const std::string& executable_name); diff --git a/shell/platform/darwin/ios/framework/Headers/Flutter.h b/shell/platform/darwin/ios/framework/Headers/Flutter.h index d850854f2f517..f789aa63e544f 100644 --- a/shell/platform/darwin/ios/framework/Headers/Flutter.h +++ b/shell/platform/darwin/ios/framework/Headers/Flutter.h @@ -8,30 +8,30 @@ /** BREAKING CHANGES: - February 28, 2018: Removed "initWithFLXArchive" and - "initWithFLXArchiveWithScriptSnapshot". + February 28, 2018: Removed "initWithFLXArchive" and "initWithFLXArchiveWithScriptSnapshot". - January 15, 2018: Marked "initWithFLXArchive" and - "initWithFLXArchiveWithScriptSnapshot" as unavailable following the - deprecation from December 11, 2017. Scheduled to be removed on February + January 15, 2018: Marked "initWithFLXArchive" and "initWithFLXArchiveWithScriptSnapshot" as + unavailable following the deprecation from December 11, 2017. Scheduled to be removed on February 19, 2018. January 09, 2018: Deprecated "FlutterStandardBigInteger" and its use in - "FlutterStandardMessageCodec" and "FlutterStandardMethodCodec". Scheduled to - be marked as unavailable once the deprecation has been available on the - flutter/flutter alpha branch for four weeks. "FlutterStandardBigInteger" was - needed because the Dart 1.0 int type had no size limit. With Dart 2.0, the - int type is a fixed-size, 64-bit signed integer. If you need to communicate - larger integers, use NSString encoding instead. - - December 11, 2017: Deprecated "initWithFLXArchive" and - "initWithFLXArchiveWithScriptSnapshot" and scheculed the same to be marked as - unavailable on January 15, 2018. Instead, "initWithFlutterAssets" and - "initWithFlutterAssetsWithScriptSnapshot" should be used. The reason for this - change is that the FLX archive will be deprecated and replaced with a flutter - assets directory containing the same files as the FLX did. + "FlutterStandardMessageCodec" and "FlutterStandardMethodCodec". Scheduled to be marked as + unavailable once the deprecation has been available on the flutter/flutter alpha branch for four + weeks. "FlutterStandardBigInteger" was needed because the Dart 1.0 int type had no size limit. With + Dart 2.0, the int type is a fixed-size, 64-bit signed integer. If you need to communicate larger + integers, use NSString encoding instead. + + December 11, 2017: Deprecated "initWithFLXArchive" and "initWithFLXArchiveWithScriptSnapshot" and + scheculed the same to be marked as unavailable on January 15, 2018. Instead, + "initWithFlutterAssets" and "initWithFlutterAssetsWithScriptSnapshot" should be used. The reason + for this change is that the FLX archive will be deprecated and replaced with a flutter assets + directory containing the same files as the FLX did. November 29, 2017: Added a BREAKING CHANGES section. + + June 11, 2018: Eliminated "initWithFlutterAssetsWithScriptSnapshot" which was only used for Dart 1 + code. Flutter is now Dart 2 only. In Dart 2, application code is loaded from a kernel snapshot in + debug mode, or AOT-compiled and linked in profile and release modes. */ #include "FlutterAppDelegate.h" diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h b/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h index 9f232ea941fda..ae92007b83fde 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h @@ -18,9 +18,6 @@ FLUTTER_EXPORT dartMain:(NSURL*)dartMainURL packages:(NSURL*)dartPackages NS_DESIGNATED_INITIALIZER; -- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL - NS_DESIGNATED_INITIALIZER; - - (instancetype)initFromDefaultSourceForConfiguration; /** diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index b1410547e71bd..ecbc599566f22 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -15,7 +15,6 @@ #include "flutter/shell/platform/darwin/common/command_line.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" -static const char* kScriptSnapshotFileName = "snapshot_blob.bin"; static const char* kVMKernelSnapshotFileName = "platform.dill"; static const char* kApplicationKernelSnapshotFileName = "kernel_blob.bin"; @@ -80,17 +79,6 @@ settings.assets_path = assetsPath.UTF8String; if (!blink::DartVM::IsRunningPrecompiledCode()) { - // Looking for the various script and kernel snapshot buffers only makes sense if we have a - // VM that can use these buffers. - { - // Check if there is a script snapshot in the assets directory we could potentially use. - NSURL* scriptSnapshotURL = [NSURL URLWithString:@(kScriptSnapshotFileName) - relativeToURL:[NSURL fileURLWithPath:assetsPath]]; - if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotURL.path]) { - settings.script_snapshot_path = scriptSnapshotURL.path.UTF8String; - } - } - { // Check if there is a VM kernel snapshot in the assets directory we could potentially // use. @@ -170,26 +158,6 @@ - (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL return self; } -- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL { - self = [super init]; - - if (self) { - _settings = DefaultSettingsForProcess(); - - if ([[NSFileManager defaultManager] fileExistsAtPath:flutterAssetsURL.path]) { - _settings.assets_path = flutterAssetsURL.path.UTF8String; - - NSURL* scriptSnapshotPath = - [NSURL URLWithString:@(kScriptSnapshotFileName) relativeToURL:flutterAssetsURL]; - if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotPath.path]) { - _settings.script_snapshot_path = scriptSnapshotPath.path.UTF8String; - } - } - } - - return self; -} - #pragma mark - Convenience initializers - (instancetype)initFromDefaultSourceForConfiguration { From be02d0cf09f13003ee59f5a9a571c9878d52d3ac Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Mon, 11 Jun 2018 18:12:10 -0700 Subject: [PATCH 0560/1190] Revert "Eliminate support for Dart 1 (#5504)" (#5505) Broke runtime_unittests, which are still running directly from source. This reverts commit 0ea93c3a3e40426fd222ba22c2f60756c8a32097. --- common/settings.cc | 2 + common/settings.h | 2 + runtime/dart_isolate.cc | 33 ++++++- runtime/dart_service_isolate.cc | 98 +++++++++++++++++-- runtime/dart_service_isolate.h | 9 ++ runtime/dart_vm.cc | 42 ++++++-- shell/common/isolate_configuration.cc | 11 +++ shell/common/switches.cc | 7 ++ shell/common/switches.h | 8 ++ .../darwin/ios/framework/Headers/Flutter.h | 36 +++---- .../framework/Headers/FlutterDartProject.h | 3 + .../framework/Source/FlutterDartProject.mm | 32 ++++++ 12 files changed, 244 insertions(+), 39 deletions(-) diff --git a/common/settings.cc b/common/settings.cc index 9a369c420dee9..8123b1d321ef6 100644 --- a/common/settings.cc +++ b/common/settings.cc @@ -11,6 +11,7 @@ namespace blink { std::string Settings::ToString() const { std::stringstream stream; stream << "Settings: " << std::endl; + stream << "script_snapshot_path: " << script_snapshot_path << std::endl; stream << "vm_snapshot_data_path: " << vm_snapshot_data_path << std::endl; stream << "vm_snapshot_instr_path: " << vm_snapshot_instr_path << std::endl; stream << "isolate_snapshot_data_path: " << isolate_snapshot_data_path @@ -31,6 +32,7 @@ std::string Settings::ToString() const { stream << "trace_startup: " << trace_startup << std::endl; stream << "endless_trace_buffer: " << endless_trace_buffer << std::endl; stream << "enable_dart_profiling: " << enable_dart_profiling << std::endl; + stream << "dart_non_checked_mode: " << dart_non_checked_mode << std::endl; stream << "enable_observatory: " << enable_observatory << std::endl; stream << "observatory_port: " << observatory_port << std::endl; stream << "ipv6: " << ipv6 << std::endl; diff --git a/common/settings.h b/common/settings.h index 5124bb147a733..547673529ee1e 100644 --- a/common/settings.h +++ b/common/settings.h @@ -23,6 +23,7 @@ using TaskObserverRemove = std::function; struct Settings { // VM settings + std::string script_snapshot_path; std::string platform_kernel_path; std::string vm_snapshot_data_path; @@ -46,6 +47,7 @@ struct Settings { bool trace_startup = false; bool endless_trace_buffer = false; bool enable_dart_profiling = false; + bool dart_non_checked_mode = false; // Used as the script URI in debug messages. Does not affect how the Dart code // is executed. std::string advisory_script_uri = "main.dart"; diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index e5f2c494f82f4..ded3ff8f6da2a 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -277,9 +277,18 @@ bool DartIsolate::PrepareForRunningFromPrecompiledCode() { return true; } +static bool LoadScriptSnapshot(std::shared_ptr mapping, + bool last_piece) { + FXL_CHECK(last_piece) << "Script snapshots cannot be divided"; + if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), + mapping->GetSize()))) { + return false; + } + return true; +} + static bool LoadKernelSnapshot(std::shared_ptr mapping, bool last_piece) { - FXL_DCHECK(Dart_IsKernel(mapping->GetMapping(), mapping->GetSize())) << "Only kernel snapshots are supported"; Dart_Handle library = Dart_LoadLibraryFromKernel(mapping->GetMapping(), mapping->GetSize()); if (tonic::LogIfError(library)) { @@ -298,6 +307,16 @@ static bool LoadKernelSnapshot(std::shared_ptr mapping, return true; } +static bool LoadSnapshot(std::shared_ptr mapping, + bool last_piece) { + if (Dart_IsKernel(mapping->GetMapping(), mapping->GetSize())) { + return LoadKernelSnapshot(std::move(mapping), last_piece); + } else { + return LoadScriptSnapshot(std::move(mapping), last_piece); + } + return false; +} + FXL_WARN_UNUSED_RESULT bool DartIsolate::PrepareForRunningFromSnapshot( std::shared_ptr mapping, @@ -321,7 +340,7 @@ bool DartIsolate::PrepareForRunningFromSnapshot( return false; } - if (!LoadKernelSnapshot(mapping, last_piece)) { + if (!LoadSnapshot(mapping, last_piece)) { return false; } @@ -547,12 +566,20 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( // thread. service_isolate->ResetWeakPtrFactory(); + const bool isolate_snapshot_is_dart_2 = Dart_IsDart2Snapshot( + vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); + const bool is_preview_dart2 = + (vm->GetPlatformKernel().GetSize() > 0) || isolate_snapshot_is_dart_2; + const bool running_from_sources = + !DartVM::IsRunningPrecompiledCode() && !is_preview_dart2; + tonic::DartState::Scope scope(service_isolate); if (!DartServiceIsolate::Startup( settings.ipv6 ? "::1" : "127.0.0.1", // server IP address settings.observatory_port, // server observatory port tonic::DartState::HandleLibraryTag, // embedder library tag handler - false, // disable websocket origin check + running_from_sources, // running from source code + false, // disable websocket origin check error // error (out) )) { // Error is populated by call to startup. diff --git a/runtime/dart_service_isolate.cc b/runtime/dart_service_isolate.cc index 9a69de58504fa..3239e4f437eca 100644 --- a/runtime/dart_service_isolate.cc +++ b/runtime/dart_service_isolate.cc @@ -27,6 +27,7 @@ } #define kLibrarySourceNamePrefix "/vmservice" +static const char* kServiceIsolateScript = "vmservice_io.dart"; namespace flutter { namespace runtime { @@ -83,6 +84,7 @@ void DartServiceIsolate::Shutdown(Dart_NativeArguments args) { bool DartServiceIsolate::Startup(std::string server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, + bool running_from_sources, bool disable_origin_check, char** error) { Dart_Isolate isolate = Dart_CurrentIsolate(); @@ -106,14 +108,31 @@ bool DartServiceIsolate::Startup(std::string server_ip, &flutter::runtime::__flutter_embedded_service_isolate_resources_[0]); } - // Set the root library for the isolate. - Dart_Handle uri = Dart_NewStringFromCString("dart:vmservice_io"); - Dart_Handle library = Dart_LookupLibrary(uri); - SHUTDOWN_ON_ERROR(library); - Dart_Handle result = Dart_SetRootLibrary(library); - SHUTDOWN_ON_ERROR(result); - result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol); - SHUTDOWN_ON_ERROR(result); + Dart_Handle result; + + if (running_from_sources) { + // Use our own library tag handler when loading service isolate sources. + Dart_SetLibraryTagHandler(DartServiceIsolate::LibraryTagHandler); + // Load main script. + Dart_Handle library = LoadScript(kServiceIsolateScript); + FXL_DCHECK(library != Dart_Null()); + SHUTDOWN_ON_ERROR(library); + // Setup native entry resolution. + result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol); + + SHUTDOWN_ON_ERROR(result); + // Finalize loading. + result = Dart_FinalizeLoading(false); + SHUTDOWN_ON_ERROR(result); + } else { + Dart_Handle uri = Dart_NewStringFromCString("dart:vmservice_io"); + Dart_Handle library = Dart_LookupLibrary(uri); + SHUTDOWN_ON_ERROR(library); + result = Dart_SetRootLibrary(library); + SHUTDOWN_ON_ERROR(result); + result = Dart_SetNativeResolver(library, GetNativeFunction, GetSymbol); + SHUTDOWN_ON_ERROR(result); + } // Make runnable. Dart_ExitScope(); @@ -127,7 +146,7 @@ bool DartServiceIsolate::Startup(std::string server_ip, Dart_EnterIsolate(isolate); Dart_EnterScope(); - library = Dart_RootLibrary(); + Dart_Handle library = Dart_RootLibrary(); SHUTDOWN_ON_ERROR(library); // Set the HTTP server's ip. @@ -155,6 +174,30 @@ bool DartServiceIsolate::Startup(std::string server_ip, return true; } +Dart_Handle DartServiceIsolate::GetSource(const char* name) { + const intptr_t kBufferSize = 512; + char buffer[kBufferSize]; + snprintf(&buffer[0], kBufferSize - 1, "%s/%s", kLibrarySourceNamePrefix, + name); + const char* vmservice_source = NULL; + int r = g_resources->ResourceLookup(buffer, &vmservice_source); + FXL_DCHECK(r != EmbedderResources::kNoSuchInstance); + return Dart_NewStringFromCString(vmservice_source); +} + +Dart_Handle DartServiceIsolate::LoadScript(const char* name) { + Dart_Handle url = Dart_NewStringFromCString("dart:vmservice_io"); + Dart_Handle source = GetSource(name); + return Dart_LoadScript(url, Dart_Null(), source, 0, 0); +} + +Dart_Handle DartServiceIsolate::LoadSource(Dart_Handle library, + const char* name) { + Dart_Handle url = Dart_NewStringFromCString(name); + Dart_Handle source = GetSource(name); + return Dart_LoadSource(library, url, Dart_Null(), source, 0, 0); +} + Dart_Handle DartServiceIsolate::LoadResource(Dart_Handle library, const char* resource_name) { // Prepare for invoke call. @@ -205,4 +248,41 @@ Dart_Handle DartServiceIsolate::LoadResources(Dart_Handle library) { return result; } +Dart_Handle DartServiceIsolate::LibraryTagHandler(Dart_LibraryTag tag, + Dart_Handle library, + Dart_Handle url) { + if (!Dart_IsLibrary(library)) { + return Dart_NewApiError("not a library"); + } + if (!Dart_IsString(url)) { + return Dart_NewApiError("url is not a string"); + } + const char* url_string = NULL; + Dart_Handle result = Dart_StringToCString(url, &url_string); + if (Dart_IsError(result)) { + return result; + } + Dart_Handle library_url = Dart_LibraryUrl(library); + const char* library_url_string = NULL; + result = Dart_StringToCString(library_url, &library_url_string); + if (Dart_IsError(result)) { + return result; + } + if (tag == Dart_kImportTag) { + // Embedder handles all requests for external libraries. + return g_embedder_tag_handler(tag, library, url); + } + FXL_DCHECK((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl)); + if (tag == Dart_kCanonicalizeUrl) { + // url is already canonicalized. + return url; + } + // Get source from builtin resources. + Dart_Handle source = GetSource(url_string); + if (Dart_IsError(source)) { + return source; + } + return Dart_LoadSource(library, url, Dart_Null(), source, 0, 0); +} + } // namespace blink diff --git a/runtime/dart_service_isolate.h b/runtime/dart_service_isolate.h index b1d17af4f90cd..59a02e2e9d495 100644 --- a/runtime/dart_service_isolate.h +++ b/runtime/dart_service_isolate.h @@ -16,6 +16,7 @@ class DartServiceIsolate { static bool Startup(std::string server_ip, intptr_t server_port, Dart_LibraryTagHandler embedder_tag_handler, + bool running_from_sources, bool disable_origin_check, char** error); @@ -27,6 +28,14 @@ class DartServiceIsolate { static void NotifyServerState(Dart_NativeArguments args); static void Shutdown(Dart_NativeArguments args); + // Script loading. + static Dart_Handle GetSource(const char* name); + static Dart_Handle LoadScript(const char* name); + static Dart_Handle LoadSource(Dart_Handle library, const char* name); + static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, + Dart_Handle library, + Dart_Handle url); + // Observatory resource loading. static Dart_Handle LoadResources(Dart_Handle library); static Dart_Handle LoadResource(Dart_Handle library, const char* name); diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 3ca3bb77cf41b..776fbab983e10 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -83,6 +83,14 @@ static const char* kDartAssertArgs[] = { // clang-format on }; +static const char* kDartCheckedModeArgs[] = { + // clang-format off + "--enable_type_checks", + "--error_on_bad_type", + "--error_on_bad_override", + // clang-format on +}; + static const char* kDartStrongModeArgs[] = { // clang-format off "--strong", @@ -316,18 +324,18 @@ DartVM::DartVM(const Settings& settings, arraysize(kDartPrecompilationArgs)); } - // Enable asserts if we are not running precompiled code. We run non- + // Enable checked mode if we are not running precompiled code. We run non- // precompiled code only in the debug product mode. - bool enable_asserts = true; + bool use_checked_mode = !settings.dart_non_checked_mode; #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_PROFILE || \ FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DYNAMIC_RELEASE - enable_asserts = false; + use_checked_mode = false; #endif #if !OS_FUCHSIA if (IsRunningPrecompiledCode()) { - enable_asserts = false; + use_checked_mode = false; } #endif // !OS_FUCHSIA @@ -338,12 +346,29 @@ DartVM::DartVM(const Settings& settings, arraysize(kDartWriteProtectCodeArgs)); #endif - // Require Dart 2. - FML_DCHECK(platform_kernel_mapping_->GetSize() > 0); + const bool isolate_snapshot_is_dart_2 = + Dart_IsDart2Snapshot(isolate_snapshot_->GetData()->GetSnapshotPointer()); - PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); - if (enable_asserts) { + const bool is_preview_dart2 = + (platform_kernel_mapping_->GetSize() > 0) || isolate_snapshot_is_dart_2; + + FXL_DLOG(INFO) << "Dart 2 " << (is_preview_dart2 ? "is" : "is NOT") + << " enabled. Platform kernel: " + << static_cast(platform_kernel_mapping_->GetSize() > 0) + << " Isolate Snapshot is Dart 2: " + << isolate_snapshot_is_dart_2; + + if (is_preview_dart2) { + PushBackAll(&args, kDartStrongModeArgs, arraysize(kDartStrongModeArgs)); + if (use_checked_mode) { + PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + } + } else if (use_checked_mode) { + FXL_DLOG(INFO) << "Checked mode is ON"; PushBackAll(&args, kDartAssertArgs, arraysize(kDartAssertArgs)); + PushBackAll(&args, kDartCheckedModeArgs, arraysize(kDartCheckedModeArgs)); + } else { + FXL_DLOG(INFO) << "Is not Dart 2 and Checked mode is OFF"; } if (settings.start_paused) { @@ -365,7 +390,6 @@ DartVM::DartVM(const Settings& settings, PushBackAll(&args, kDartFuchsiaTraceArgs, arraysize(kDartFuchsiaTraceArgs)); #endif - // Add VM dart_flags last to allow user overrides. for (size_t i = 0; i < settings.dart_flags.size(); i++) args.push_back(settings.dart_flags[i].c_str()); diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc index 825920d64f552..c971740568e97 100644 --- a/shell/common/isolate_configuration.cc +++ b/shell/common/isolate_configuration.cc @@ -145,6 +145,17 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( } } + // Running from script snapshot. + { + // TODO(engine): Add AssetManager::GetAsMapping or such to avoid the copy. + std::vector script_snapshot; + if (asset_manager && asset_manager->GetAsBuffer( + settings.script_snapshot_path, &script_snapshot)) { + return CreateForSnapshot( + std::make_unique(std::move(script_snapshot))); + } + } + // Running from kernel divided into several pieces (for sharing). { // TODO(fuchsia): Add AssetManager::GetAsMapping or such to avoid the copy. diff --git a/shell/common/switches.cc b/shell/common/switches.cc index 7a6dfecca36d1..33752d6f94a4d 100644 --- a/shell/common/switches.cc +++ b/shell/common/switches.cc @@ -129,6 +129,10 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { } } + // Checked mode overrides. + settings.dart_non_checked_mode = + command_line.HasOption(FlagForSwitch(Switch::DartNonCheckedMode)); + settings.ipv6 = command_line.HasOption(FlagForSwitch(Switch::IPv6)); settings.start_paused = @@ -157,6 +161,9 @@ blink::Settings SettingsFromCommandLine(const fxl::CommandLine& command_line) { command_line.GetOptionValue(FlagForSwitch(Switch::FlutterAssetsDir), &settings.assets_path); + command_line.GetOptionValue(FlagForSwitch(Switch::Snapshot), + &settings.script_snapshot_path); + command_line.GetOptionValue(FlagForSwitch(Switch::MainDartFile), &settings.main_dart_file_path); diff --git a/shell/common/switches.h b/shell/common/switches.h index 8433d0f0cffd1..4f694d37475fa 100644 --- a/shell/common/switches.h +++ b/shell/common/switches.h @@ -93,6 +93,7 @@ DEF_SWITCH(Help, "help", "Display this help text.") DEF_SWITCH(LogTag, "log-tag", "Tag associated with log messages.") DEF_SWITCH(MainDartFile, "dart-main", "The path to the main Dart file.") DEF_SWITCH(Packages, "packages", "Specify the path to the packages.") +DEF_SWITCH(Snapshot, "snapshot-blob", "Specify the path to the snapshot blob") DEF_SWITCH(StartPaused, "start-paused", "Start the application paused in the Dart debugger.") @@ -121,6 +122,13 @@ DEF_SWITCH(RunForever, "run-forever", "In non-interactive mode, keep the shell running after the Dart " "script has completed.") +DEF_SWITCH(DartNonCheckedMode, + "dart-non-checked-mode", + "Dart code runs in checked mode when the runtime mode is debug. In " + "profile and release product modes, the application code is " + "precompiled and checked mode is unsupported. However, this flag " + "may be specified if the user wishes to run in the debug product " + "mode (i.e. with JIT or DBC) with checked mode off.") DEF_SWITCHES_END void PrintUsage(const std::string& executable_name); diff --git a/shell/platform/darwin/ios/framework/Headers/Flutter.h b/shell/platform/darwin/ios/framework/Headers/Flutter.h index f789aa63e544f..d850854f2f517 100644 --- a/shell/platform/darwin/ios/framework/Headers/Flutter.h +++ b/shell/platform/darwin/ios/framework/Headers/Flutter.h @@ -8,30 +8,30 @@ /** BREAKING CHANGES: - February 28, 2018: Removed "initWithFLXArchive" and "initWithFLXArchiveWithScriptSnapshot". + February 28, 2018: Removed "initWithFLXArchive" and + "initWithFLXArchiveWithScriptSnapshot". - January 15, 2018: Marked "initWithFLXArchive" and "initWithFLXArchiveWithScriptSnapshot" as - unavailable following the deprecation from December 11, 2017. Scheduled to be removed on February + January 15, 2018: Marked "initWithFLXArchive" and + "initWithFLXArchiveWithScriptSnapshot" as unavailable following the + deprecation from December 11, 2017. Scheduled to be removed on February 19, 2018. January 09, 2018: Deprecated "FlutterStandardBigInteger" and its use in - "FlutterStandardMessageCodec" and "FlutterStandardMethodCodec". Scheduled to be marked as - unavailable once the deprecation has been available on the flutter/flutter alpha branch for four - weeks. "FlutterStandardBigInteger" was needed because the Dart 1.0 int type had no size limit. With - Dart 2.0, the int type is a fixed-size, 64-bit signed integer. If you need to communicate larger - integers, use NSString encoding instead. - - December 11, 2017: Deprecated "initWithFLXArchive" and "initWithFLXArchiveWithScriptSnapshot" and - scheculed the same to be marked as unavailable on January 15, 2018. Instead, - "initWithFlutterAssets" and "initWithFlutterAssetsWithScriptSnapshot" should be used. The reason - for this change is that the FLX archive will be deprecated and replaced with a flutter assets - directory containing the same files as the FLX did. + "FlutterStandardMessageCodec" and "FlutterStandardMethodCodec". Scheduled to + be marked as unavailable once the deprecation has been available on the + flutter/flutter alpha branch for four weeks. "FlutterStandardBigInteger" was + needed because the Dart 1.0 int type had no size limit. With Dart 2.0, the + int type is a fixed-size, 64-bit signed integer. If you need to communicate + larger integers, use NSString encoding instead. + + December 11, 2017: Deprecated "initWithFLXArchive" and + "initWithFLXArchiveWithScriptSnapshot" and scheculed the same to be marked as + unavailable on January 15, 2018. Instead, "initWithFlutterAssets" and + "initWithFlutterAssetsWithScriptSnapshot" should be used. The reason for this + change is that the FLX archive will be deprecated and replaced with a flutter + assets directory containing the same files as the FLX did. November 29, 2017: Added a BREAKING CHANGES section. - - June 11, 2018: Eliminated "initWithFlutterAssetsWithScriptSnapshot" which was only used for Dart 1 - code. Flutter is now Dart 2 only. In Dart 2, application code is loaded from a kernel snapshot in - debug mode, or AOT-compiled and linked in profile and release modes. */ #include "FlutterAppDelegate.h" diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h b/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h index ae92007b83fde..9f232ea941fda 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterDartProject.h @@ -18,6 +18,9 @@ FLUTTER_EXPORT dartMain:(NSURL*)dartMainURL packages:(NSURL*)dartPackages NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL + NS_DESIGNATED_INITIALIZER; + - (instancetype)initFromDefaultSourceForConfiguration; /** diff --git a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm index ecbc599566f22..b1410547e71bd 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterDartProject.mm @@ -15,6 +15,7 @@ #include "flutter/shell/platform/darwin/common/command_line.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" +static const char* kScriptSnapshotFileName = "snapshot_blob.bin"; static const char* kVMKernelSnapshotFileName = "platform.dill"; static const char* kApplicationKernelSnapshotFileName = "kernel_blob.bin"; @@ -79,6 +80,17 @@ settings.assets_path = assetsPath.UTF8String; if (!blink::DartVM::IsRunningPrecompiledCode()) { + // Looking for the various script and kernel snapshot buffers only makes sense if we have a + // VM that can use these buffers. + { + // Check if there is a script snapshot in the assets directory we could potentially use. + NSURL* scriptSnapshotURL = [NSURL URLWithString:@(kScriptSnapshotFileName) + relativeToURL:[NSURL fileURLWithPath:assetsPath]]; + if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotURL.path]) { + settings.script_snapshot_path = scriptSnapshotURL.path.UTF8String; + } + } + { // Check if there is a VM kernel snapshot in the assets directory we could potentially // use. @@ -158,6 +170,26 @@ - (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL return self; } +- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL { + self = [super init]; + + if (self) { + _settings = DefaultSettingsForProcess(); + + if ([[NSFileManager defaultManager] fileExistsAtPath:flutterAssetsURL.path]) { + _settings.assets_path = flutterAssetsURL.path.UTF8String; + + NSURL* scriptSnapshotPath = + [NSURL URLWithString:@(kScriptSnapshotFileName) relativeToURL:flutterAssetsURL]; + if ([[NSFileManager defaultManager] fileExistsAtPath:scriptSnapshotPath.path]) { + _settings.script_snapshot_path = scriptSnapshotPath.path.UTF8String; + } + } + } + + return self; +} + #pragma mark - Convenience initializers - (instancetype)initFromDefaultSourceForConfiguration { From c0ba226d8f9b8cb77e6f54360b486da1c69c4299 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 11 Jun 2018 23:14:18 -0400 Subject: [PATCH 0561/1190] Roll src/third_party/skia 5c12122ad91d..8c6b49718210 (1 commits) (#5506) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9bf0bc17b7f2f..b9d25bd1ec413 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5c12122ad91dbfa4acd613a05daa921cb92aafa3', + 'skia_revision': '8c6b49718210e585734afdfd82957a693b80340b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9aef09eeb5c06..976da8e6cc643 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8e2bf7fb92334aab3eb4be89ddda0814 +Signature: b29800b2a390b4908927324a76d34340 UNUSED LICENSES: From 59a784dd5bc445363ba8d60b4060d31f0b16aefb Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 12 Jun 2018 03:07:58 -0400 Subject: [PATCH 0562/1190] Roll src/third_party/skia 8c6b49718210..0e2608e84fe5 (1 commits) (#5507) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index b9d25bd1ec413..dd0e7c2a7fd37 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8c6b49718210e585734afdfd82957a693b80340b', + 'skia_revision': '0e2608e84fe501205f93a38c3f3e5a32ce63dc31', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 10850eaaa687a160b78907a64115d0dfe74e4050 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 12 Jun 2018 08:05:58 -0400 Subject: [PATCH 0563/1190] Roll src/third_party/skia 0e2608e84fe5..8e4d09ae7af1 (1 commits) (#5508) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index dd0e7c2a7fd37..5735532acac23 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0e2608e84fe501205f93a38c3f3e5a32ce63dc31', + 'skia_revision': '8e4d09ae7af123eb3441bef8e39492c2cebfbfbb', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 976da8e6cc643..1b0f45c4f4467 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b29800b2a390b4908927324a76d34340 +Signature: fccd3b1480141098158ce9e70f7fa291 UNUSED LICENSES: From a32853140216d861249f7eefaa3ab4fe5dcc420b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 12 Jun 2018 11:35:59 -0400 Subject: [PATCH 0564/1190] Roll src/third_party/skia 8e4d09ae7af1..2a2f67592602 (6 commits) (#5509) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 5735532acac23..c0abb1eea8974 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8e4d09ae7af123eb3441bef8e39492c2cebfbfbb', + 'skia_revision': '2a2f67592602b18527bc3fd449132d420cd5b62e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1b0f45c4f4467..a2c56532910e5 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: fccd3b1480141098158ce9e70f7fa291 +Signature: afcaaa4a09ffa595fe9401f3fe1af9f3 UNUSED LICENSES: @@ -17181,6 +17181,7 @@ FILE: ../../../third_party/skia/include/private/GrCCPerOpListPaths.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkSafe32.h +FILE: ../../../third_party/skia/include/private/SkTo.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go FILE: ../../../third_party/skia/modules/skjson/include/SkJSON.h FILE: ../../../third_party/skia/modules/skjson/src/SkJSON.cpp @@ -17228,6 +17229,7 @@ FILE: ../../../third_party/skia/src/core/SkGlyph.cpp FILE: ../../../third_party/skia/src/core/SkIPoint16.h FILE: ../../../third_party/skia/src/core/SkMaskFilterBase.h FILE: ../../../third_party/skia/src/core/SkPath_serial.cpp +FILE: ../../../third_party/skia/src/core/SkPicturePriv.h FILE: ../../../third_party/skia/src/core/SkRRectPriv.h FILE: ../../../third_party/skia/src/core/SkRectPriv.h FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.cpp @@ -17306,6 +17308,7 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h +FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrDebugMarkerOp.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h @@ -17686,7 +17689,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/skqp_test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS7_G930A-GPU-Adreno530-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm-Debug-All-Android_ASAN.json From 6b1b887398fa04beaf07033997ac707dd98c6ded Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Tue, 12 Jun 2018 18:14:24 +0200 Subject: [PATCH 0565/1190] Roll the Dart VM. (#5510) * Roll the Dart VM. c95617b19c Add a release note about the VM going sync-async 05f11aa74c [kernel] Account for defaultType in some of the Kernel visitors c39c2c8ac1 Handle type variables in optional function typed parameter in jsinterop methods a4af44b470 [VM] Do not invoke any functions during AOT compilation 5be73cd166 Make debug printing of function types more robust. 6054cb3e1f CompilerContext always expects a Future now 6213303e65 Fix some runtime check failures in tests d17ec7c131 Move inference data from JClosedWorld to GlobalTypeInferenceResults. 6fcc68bee3 Adjust test status. fe21518df8 Improve literal list recovery 134e00fd73 Treat 64 bit ints as unsigned until conversion to JS. b375d69800 [observatory] When the VM is forwarding events to the Android or Fuchsia system tracers, link to the document describing how to use them. edb1642709 [vm] Repair interpreter build. a9fef15ff3 Add FileResult and AnalysisDriver.getFileSync(). 787a43ec78 [vm] Fix some missing private name mangling in the kernel reader. 1cf348b29f Mark enum_private_test/02 as pass, crash cc1a817faa Use ZX_THREAD_STATE_BASIC on state output of ZX_INFO_THREAD. 4e0e72a65f Fix map_insert_remove_oom_test. 8421e69fbb [js_runtime] Make _checkLength more likely to be inlined b66dd3d456 Stop using generic comment syntax in observatory. b667be4861 Fix source maps strong mode runtime failure in dart2js. 7b972a653b [vm/linearscan] Account for definitions with no SSA name when processing PairLocation outputs. 09fc582bfd Fix EvalExpression test. f2883d1b4f Fix test error message expectation on Windows. 8bfbce33f1 Mark cc/Profiler_CodeTicks as failing on Windows, dartk x64 config a8c2263d3f Issue 33336. AnalysisDriver.discoverAvailableFiles() should notify the scheduler that there is work to do. b7493b663e [vm/inliner] Inline small int convertors. 6b71414296 [Test status] Update status of several triaged lib_2/mirrors tests 1f03109200 Proposed replacement for SourceFactory 60631b0944 Remove unnecessary casts from observatory. bfa8be887a Extending dartLangSpec.tex with super-bounded types and variance. daee781179 Revise beginTypeVariable event in event sequence e0ca1514a2 Mark test as failing. * Update hash. --- DEPS | 2 +- tools/licenses/pubspec.lock | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index c0abb1eea8974..a7f70cc058dbb 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'a5e41681e55d1e74684bfff530218db556d77ee8', + 'dart_revision': 'c95617b19c1bfd67bce35c8737429f4e26975ac2', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 3dcd0a08685cf..545aa1144973f 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -58,4 +58,4 @@ packages: source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-dev.55.0" + dart: ">=1.21.0 <=2.0.0-edge.2b36f923d95a41b2f1c5cbb5edd9872f68c18112" diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a2c56532910e5..cab63abbc3ff6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: afcaaa4a09ffa595fe9401f3fe1af9f3 +Signature: 958c7c25eb2b3017cd30ddcbc7c5d9d1 UNUSED LICENSES: From a4c8e1f7cc310da6e0caea24f0f1765b233186f5 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 12 Jun 2018 15:01:58 -0400 Subject: [PATCH 0566/1190] Roll src/third_party/skia 2a2f67592602..8ea971bfefb6 (5 commits) (#5511) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a7f70cc058dbb..7a900057c51df 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2a2f67592602b18527bc3fd449132d420cd5b62e', + 'skia_revision': '8ea971bfefb687a813f5b7cb62137b5d7b742dee', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index cab63abbc3ff6..6b321777ef25e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 958c7c25eb2b3017cd30ddcbc7c5d9d1 +Signature: ab27dd2fbccbe0dc2ea0869473799c13 UNUSED LICENSES: @@ -17689,6 +17689,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/skqp_test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm-Debug-All-Android_ASAN.json @@ -17725,6 +17726,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clan FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Release-All-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ShuttleA-GPU-GTX660-x86_64-Release-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Debug-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ZBOX-GPU-GTX1070-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FAAA.json From 3b1f381cc53c13ade1e90bc178163df5e9f8293a Mon Sep 17 00:00:00 2001 From: Dan Field Date: Tue, 12 Jun 2018 15:34:23 -0400 Subject: [PATCH 0567/1190] Expose approximateBytesUsed for Picture (#5378) --- lib/ui/painting.dart | 6 ++++++ lib/ui/painting/picture.cc | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 7624b948b921b..7699f847b7de5 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -3404,6 +3404,12 @@ class Picture extends NativeFieldWrapperClass2 { /// Release the resources used by this object. The object is no longer usable /// after this method is called. void dispose() native 'Picture_dispose'; + + /// Returns the approximate number of bytes allocated for this object. + /// + /// The actual size of this picture may be larger, particularly if it contains + /// references to image or other large objects. + int get approximateBytesUsed native 'Picture_GetAllocationSize'; } /// Records a [Picture] containing a sequence of graphical operations. diff --git a/lib/ui/painting/picture.cc b/lib/ui/painting/picture.cc index 34f92b8c315fd..73e3a1625458f 100644 --- a/lib/ui/painting/picture.cc +++ b/lib/ui/painting/picture.cc @@ -18,7 +18,8 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Picture); #define FOR_EACH_BINDING(V) \ V(Picture, toImage) \ - V(Picture, dispose) + V(Picture, dispose) \ + V(Picture, GetAllocationSize) DART_BIND_ALL(Picture, FOR_EACH_BINDING) From 412f8b8e5c5f199711d4e10743338739ef33fae1 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 12 Jun 2018 18:26:58 -0400 Subject: [PATCH 0568/1190] Roll src/third_party/skia 8ea971bfefb6..bb9ee9b4aa7d (10 commits) (#5514) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7a900057c51df..16451f373df81 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8ea971bfefb687a813f5b7cb62137b5d7b742dee', + 'skia_revision': 'bb9ee9b4aa7d80e8a85832a462a3123060d4bd64', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 6b321777ef25e..6662140fc504d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ab27dd2fbccbe0dc2ea0869473799c13 +Signature: 245264e071bbc5718149880a56087206 UNUSED LICENSES: @@ -17180,6 +17180,7 @@ FILE: ../../../third_party/skia/include/private/GrCCClipPath.h FILE: ../../../third_party/skia/include/private/GrCCPerOpListPaths.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h +FILE: ../../../third_party/skia/include/private/SkMacros.h FILE: ../../../third_party/skia/include/private/SkSafe32.h FILE: ../../../third_party/skia/include/private/SkTo.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go From 61a2d129cfc8c52cf1ff59b03bccf67d9b07af63 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Tue, 12 Jun 2018 15:50:48 -0700 Subject: [PATCH 0569/1190] Added IsolateNameServer functionality (#5410) * Added IsolateNameServer functionality, which allows for the association of string names with isolate SendPort ids that can be used to establish inter-isolate communications. --- lib/ui/BUILD.gn | 4 + lib/ui/dart_ui.cc | 2 + lib/ui/dart_ui.gni | 1 + lib/ui/isolate_name_server.dart | 44 ++++++ .../isolate_name_server.cc | 44 ++++++ .../isolate_name_server/isolate_name_server.h | 50 +++++++ .../isolate_name_server_natives.cc | 64 +++++++++ .../isolate_name_server_natives.h | 27 ++++ lib/ui/ui.dart | 2 + lib/ui/ui_dart_state.cc | 10 +- lib/ui/ui_dart_state.h | 7 +- runtime/dart_isolate.cc | 11 +- runtime/dart_isolate.h | 8 +- runtime/dart_vm.cc | 4 + runtime/dart_vm.h | 4 + runtime/dart_vm_unittests.cc | 14 ++ runtime/runtime_controller.cc | 4 +- runtime/runtime_controller.h | 6 +- shell/common/engine.cc | 2 +- shell/common/engine.h | 2 +- shell/common/shell.cc | 2 +- shell/common/shell.h | 2 +- testing/dart/isolate_name_server_test.dart | 128 ++++++++++++++++++ testing/run_tests.sh | 1 - travis/licenses_golden/licenses_flutter | 5 + 25 files changed, 426 insertions(+), 22 deletions(-) create mode 100644 lib/ui/isolate_name_server.dart create mode 100644 lib/ui/isolate_name_server/isolate_name_server.cc create mode 100644 lib/ui/isolate_name_server/isolate_name_server.h create mode 100644 lib/ui/isolate_name_server/isolate_name_server_natives.cc create mode 100644 lib/ui/isolate_name_server/isolate_name_server_natives.h create mode 100644 testing/dart/isolate_name_server_test.dart diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 592f985b8b7d8..027159fb897a9 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -14,6 +14,10 @@ source_set("ui") { "dart_runtime_hooks.h", "dart_ui.cc", "dart_ui.h", + "isolate_name_server/isolate_name_server.cc", + "isolate_name_server/isolate_name_server.h", + "isolate_name_server/isolate_name_server_natives.cc", + "isolate_name_server/isolate_name_server_natives.h", "painting/canvas.cc", "painting/canvas.h", "painting/codec.cc", diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc index 824152e28e8d0..306743c82f39f 100644 --- a/lib/ui/dart_ui.cc +++ b/lib/ui/dart_ui.cc @@ -7,6 +7,7 @@ #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/compositing/scene_builder.h" #include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/painting/codec.h" #include "flutter/lib/ui/painting/frame_info.h" @@ -60,6 +61,7 @@ void DartUI::InitForGlobal() { FrameInfo::RegisterNatives(g_natives); ImageFilter::RegisterNatives(g_natives); ImageShader::RegisterNatives(g_natives); + IsolateNameServerNatives::RegisterNatives(g_natives); Paragraph::RegisterNatives(g_natives); ParagraphBuilder::RegisterNatives(g_natives); Picture::RegisterNatives(g_natives); diff --git a/lib/ui/dart_ui.gni b/lib/ui/dart_ui.gni index 418b6531004a0..e1885d1d09ace 100644 --- a/lib/ui/dart_ui.gni +++ b/lib/ui/dart_ui.gni @@ -7,6 +7,7 @@ dart_ui_files = [ "$flutter_root/lib/ui/geometry.dart", "$flutter_root/lib/ui/hash_codes.dart", "$flutter_root/lib/ui/hooks.dart", + "$flutter_root/lib/ui/isolate_name_server.dart", "$flutter_root/lib/ui/lerp.dart", "$flutter_root/lib/ui/natives.dart", "$flutter_root/lib/ui/painting.dart", diff --git a/lib/ui/isolate_name_server.dart b/lib/ui/isolate_name_server.dart new file mode 100644 index 0000000000000..8dcbf79977ef7 --- /dev/null +++ b/lib/ui/isolate_name_server.dart @@ -0,0 +1,44 @@ +// 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. + +part of dart.ui; + +abstract class IsolateNameServer { + // Looks up the [SendPort] associated with a given name. Returns null + // if the name does not exist. + static SendPort lookupPortByName(String name) { + if (name == null) { + throw new ArgumentError("'name' cannot be null."); + } + return _lookupPortByName(name); + } + + // Registers a SendPort with a given name. Returns true if registration is + // successful, false if the name entry already exists. + static bool registerPortWithName(SendPort port, String name) { + if (name == null) { + throw new ArgumentError("'name' cannot be null."); + } + if (port == null) { + throw new ArgumentError("'port' cannot be null."); + } + return _registerPortWithName(port, name); + } + + // Removes a name to SendPort mapping given a name. Returns true if the + // mapping was successfully removed, false if the mapping does not exist. + static bool removePortNameMapping(String name) { + if (name == null) { + throw new ArgumentError("'name' cannot be null."); + } + return _removePortNameMapping(name); + } + + static SendPort _lookupPortByName(String name) + native 'IsolateNameServerNatives_LookupPortByName'; + static bool _registerPortWithName(SendPort port, String name) + native 'IsolateNameServerNatives_RegisterPortWithName'; + static bool _removePortNameMapping(String name) + native 'IsolateNameServerNatives_RemovePortNameMapping'; +} diff --git a/lib/ui/isolate_name_server/isolate_name_server.cc b/lib/ui/isolate_name_server/isolate_name_server.cc new file mode 100644 index 0000000000000..7a6a1fe5889e4 --- /dev/null +++ b/lib/ui/isolate_name_server/isolate_name_server.cc @@ -0,0 +1,44 @@ +// Copyright 2018 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/lib/ui/isolate_name_server/isolate_name_server.h" + +namespace blink { + +Dart_Port IsolateNameServer::LookupIsolatePortByName(const std::string& name) { + std::unique_lock lock(mutex_); + return LookupIsolatePortByNameUnprotected(name); +} + +Dart_Port IsolateNameServer::LookupIsolatePortByNameUnprotected( + const std::string& name) { + auto port_iterator = port_mapping_.find(name); + if (port_iterator != port_mapping_.end()) { + return port_iterator->second; + } + return ILLEGAL_PORT; +} + +bool IsolateNameServer::RegisterIsolatePortWithName(Dart_Port port, + const std::string& name) { + std::unique_lock lock(mutex_); + if (LookupIsolatePortByNameUnprotected(name) != ILLEGAL_PORT) { + // Name is already registered. + return false; + } + port_mapping_[name] = port; + return true; +} + +bool IsolateNameServer::RemoveIsolateNameMapping(const std::string& name) { + std::unique_lock lock(mutex_); + auto port_iterator = port_mapping_.find(name); + if (port_iterator == port_mapping_.end()) { + return false; + } + port_mapping_.erase(port_iterator); + return true; +} + +} // namespace blink diff --git a/lib/ui/isolate_name_server/isolate_name_server.h b/lib/ui/isolate_name_server/isolate_name_server.h new file mode 100644 index 0000000000000..fe1ee7910e57c --- /dev/null +++ b/lib/ui/isolate_name_server/isolate_name_server.h @@ -0,0 +1,50 @@ +// Copyright 2018 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_LIB_UI_ISOLATE_NAME_SERVER_H_ +#define FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_H_ + +#include +#include +#include + +#include "flutter/fml/synchronization/thread_annotations.h" +#include "lib/fxl/macros.h" +#include "third_party/dart/runtime/include/dart_api.h" + +#define LOCK_UNLOCK(m) FML_ACQUIRE(m) FML_RELEASE(m) + +namespace blink { + +class IsolateNameServer { + public: + IsolateNameServer() {} + + // Looks up the Dart_Port associated with a given name. Returns ILLEGAL_PORT + // if the name does not exist. + Dart_Port LookupIsolatePortByName(const std::string& name) + LOCK_UNLOCK(mutex_); + + // Registers a Dart_Port with a given name. Returns true if registration is + // successful, false if the name entry already exists. + bool RegisterIsolatePortWithName(Dart_Port port, const std::string& name) + LOCK_UNLOCK(mutex_); + + // Removes a name to Dart_Port mapping given a name. Returns true if the + // mapping was successfully removed, false if the mapping does not exist. + bool RemoveIsolateNameMapping(const std::string& name) LOCK_UNLOCK(mutex_); + + private: + Dart_Port LookupIsolatePortByNameUnprotected(const std::string& name) + FML_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + mutable std::mutex mutex_; + std::map port_mapping_ FML_GUARDED_BY(mutex_); + + FXL_DISALLOW_COPY_AND_ASSIGN(IsolateNameServer); +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_H_ diff --git a/lib/ui/isolate_name_server/isolate_name_server_natives.cc b/lib/ui/isolate_name_server/isolate_name_server_natives.cc new file mode 100644 index 0000000000000..3919f9f4898c1 --- /dev/null +++ b/lib/ui/isolate_name_server/isolate_name_server_natives.cc @@ -0,0 +1,64 @@ +// Copyright 2018 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 + +#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" +#include "flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h" +#include "flutter/lib/ui/ui_dart_state.h" +#include "lib/tonic/dart_binding_macros.h" +#include "lib/tonic/dart_library_natives.h" + +namespace blink { + +Dart_Handle IsolateNameServerNatives::LookupPortByName( + const std::string& name) { + IsolateNameServer* name_server = + UIDartState::Current()->GetIsolateNameServer(); + Dart_Port port = name_server->LookupIsolatePortByName(name); + if (port == ILLEGAL_PORT) { + return Dart_Null(); + } + return Dart_NewSendPort(port); +} + +Dart_Handle IsolateNameServerNatives::RegisterPortWithName( + Dart_Handle port_handle, + const std::string& name) { + IsolateNameServer* name_server = + UIDartState::Current()->GetIsolateNameServer(); + Dart_Port port = ILLEGAL_PORT; + Dart_SendPortGetId(port_handle, &port); + if (!name_server->RegisterIsolatePortWithName(port, name)) { + return Dart_False(); + } + return Dart_True(); +} + +Dart_Handle IsolateNameServerNatives::RemovePortNameMapping( + const std::string& name) { + IsolateNameServer* name_server = + UIDartState::Current()->GetIsolateNameServer(); + if (!name_server->RemoveIsolateNameMapping(name)) { + return Dart_False(); + } + return Dart_True(); +} + +#define FOR_EACH_BINDING(V) \ + V(IsolateNameServerNatives, LookupPortByName) \ + V(IsolateNameServerNatives, RegisterPortWithName) \ + V(IsolateNameServerNatives, RemovePortNameMapping) + +FOR_EACH_BINDING(DART_NATIVE_CALLBACK_STATIC) + +#define DART_REGISTER_NATIVE_STATIC_(CLASS, METHOD) \ + DART_REGISTER_NATIVE_STATIC(CLASS, METHOD), + +void IsolateNameServerNatives::RegisterNatives( + tonic::DartLibraryNatives* natives) { + natives->Register({FOR_EACH_BINDING(DART_REGISTER_NATIVE_STATIC_)}); +} + +} // namespace blink diff --git a/lib/ui/isolate_name_server/isolate_name_server_natives.h b/lib/ui/isolate_name_server/isolate_name_server_natives.h new file mode 100644 index 0000000000000..2ebbe6e445010 --- /dev/null +++ b/lib/ui/isolate_name_server/isolate_name_server_natives.h @@ -0,0 +1,27 @@ +// Copyright 2018 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_LIB_UI_ISOLATE_NAME_SERVER_NATIVES_H_ +#define FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_NATIVES_H_ + +#include "third_party/dart/runtime/include/dart_api.h" + +namespace tonic { +class DartLibraryNatives; +} // namespace tonic + +namespace blink { + +class IsolateNameServerNatives { + public: + static Dart_Handle LookupPortByName(const std::string& name); + static Dart_Handle RegisterPortWithName(Dart_Handle port_handle, + const std::string& name); + static Dart_Handle RemovePortNameMapping(const std::string& name); + static void RegisterNatives(tonic::DartLibraryNatives* natives); +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_NATIVES_H_ diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index b6d22ca2939e9..1d9782311f310 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -17,6 +17,7 @@ import 'dart:collection' as collection; import 'dart:convert'; import 'dart:developer' as developer; import 'dart:io'; +import 'dart:isolate' show SendPort; import 'dart:math' as math; import 'dart:nativewrappers'; import 'dart:typed_data'; @@ -25,6 +26,7 @@ part 'compositing.dart'; part 'geometry.dart'; part 'hash_codes.dart'; part 'hooks.dart'; +part 'isolate_name_server.dart'; part 'lerp.dart'; part 'natives.dart'; part 'painting.dart'; diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 77830affdd561..f7d3d4c81cca6 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -19,7 +19,8 @@ UIDartState::UIDartState(TaskRunners task_runners, fxl::RefPtr skia_unref_queue, std::string advisory_script_uri, std::string advisory_script_entrypoint, - std::string logger_prefix) + std::string logger_prefix, + IsolateNameServer* isolate_name_server) : task_runners_(std::move(task_runners)), add_callback_(std::move(add_callback)), remove_callback_(std::move(remove_callback)), @@ -27,7 +28,8 @@ UIDartState::UIDartState(TaskRunners task_runners, advisory_script_uri_(std::move(advisory_script_uri)), advisory_script_entrypoint_(std::move(advisory_script_entrypoint)), logger_prefix_(std::move(logger_prefix)), - skia_unref_queue_(std::move(skia_unref_queue)) { + skia_unref_queue_(std::move(skia_unref_queue)), + isolate_name_server_(isolate_name_server) { AddOrRemoveTaskObserver(true /* add */); } @@ -100,4 +102,8 @@ fml::WeakPtr UIDartState::GetResourceContext() const { return resource_context_; } +IsolateNameServer* UIDartState::GetIsolateNameServer() { + return isolate_name_server_; +} + } // namespace blink diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index ef1832594d3c0..5cfdf9a44f11c 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -13,6 +13,7 @@ #include "flutter/common/task_runners.h" #include "flutter/flow/skia_gpu_object.h" #include "flutter/fml/memory/weak_ptr.h" +#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" #include "lib/fxl/build_config.h" #include "lib/tonic/dart_microtask_queue.h" #include "lib/tonic/dart_persistent_value.h" @@ -46,6 +47,8 @@ class UIDartState : public tonic::DartState { fml::WeakPtr GetResourceContext() const; + IsolateNameServer* GetIsolateNameServer(); + template static flow::SkiaGPUObject CreateGPUObject(sk_sp object) { if (!object) { @@ -65,7 +68,8 @@ class UIDartState : public tonic::DartState { fxl::RefPtr skia_unref_queue, std::string advisory_script_uri, std::string advisory_script_entrypoint, - std::string logger_prefix); + std::string logger_prefix, + IsolateNameServer* isolate_name_server); ~UIDartState() override; @@ -90,6 +94,7 @@ class UIDartState : public tonic::DartState { std::unique_ptr window_; fxl::RefPtr skia_unref_queue_; tonic::DartMicrotaskQueue microtask_queue_; + IsolateNameServer* isolate_name_server_; void AddOrRemoveTaskObserver(bool add); }; diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index ded3ff8f6da2a..66af59a5872c7 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -33,7 +33,7 @@ namespace blink { fml::WeakPtr DartIsolate::CreateRootIsolate( - const DartVM* vm, + DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -94,7 +94,7 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( return embedder_isolate; } -DartIsolate::DartIsolate(const DartVM* vm, +DartIsolate::DartIsolate(DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -110,7 +110,8 @@ DartIsolate::DartIsolate(const DartVM* vm, std::move(unref_queue), advisory_script_uri, advisory_script_entrypoint, - vm->GetSettings().log_tag), + vm->GetSettings().log_tag, + vm->GetIsolateNameServer()), vm_(vm), isolate_snapshot_(std::move(isolate_snapshot)), shared_snapshot_(std::move(shared_snapshot)), @@ -131,7 +132,7 @@ DartIsolate::Phase DartIsolate::GetPhase() const { return phase_; } -const DartVM* DartIsolate::GetDartVM() const { +DartVM* DartIsolate::GetDartVM() const { return vm_; } @@ -651,7 +652,7 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( return {nullptr, {}}; } - const DartVM* vm = embedder_isolate->GetDartVM(); + DartVM* const vm = embedder_isolate->GetDartVM(); if (!is_root_isolate) { auto raw_embedder_isolate = embedder_isolate.release(); diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index e8219469034f7..ceed7a0fd7a2a 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -39,7 +39,7 @@ class DartIsolate : public UIDartState { // bindings. From the VM's perspective, this isolate is not special in any // way. static fml::WeakPtr CreateRootIsolate( - const DartVM* vm, + DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -50,7 +50,7 @@ class DartIsolate : public UIDartState { std::string advisory_script_entrypoint, Dart_IsolateFlags* flags = nullptr); - DartIsolate(const DartVM* vm, + DartIsolate(DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -84,7 +84,7 @@ class DartIsolate : public UIDartState { void AddIsolateShutdownCallback(fxl::Closure closure); - const DartVM* GetDartVM() const; + DartVM* GetDartVM() const; fxl::RefPtr GetIsolateSnapshot() const; fxl::RefPtr GetSharedSnapshot() const; @@ -107,7 +107,7 @@ class DartIsolate : public UIDartState { }; friend class DartVM; - const DartVM* vm_ = nullptr; + DartVM* const vm_ = nullptr; Phase phase_ = Phase::Unknown; const fxl::RefPtr isolate_snapshot_; const fxl::RefPtr shared_snapshot_; diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 776fbab983e10..4f24b5bad23b9 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -471,6 +471,10 @@ const DartSnapshot& DartVM::GetVMSnapshot() const { return *vm_snapshot_.get(); } +IsolateNameServer* DartVM::GetIsolateNameServer() { + return &isolate_name_server_; +} + fxl::RefPtr DartVM::GetIsolateSnapshot() const { return isolate_snapshot_; } diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h index 8202aad1204c4..8c2c6f3fe5019 100644 --- a/runtime/dart_vm.h +++ b/runtime/dart_vm.h @@ -10,6 +10,7 @@ #include #include "flutter/common/settings.h" +#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" #include "flutter/runtime/dart_isolate.h" #include "flutter/runtime/dart_snapshot.h" #include "flutter/runtime/service_protocol.h" @@ -43,6 +44,8 @@ class DartVM : public fxl::RefCountedThreadSafe { const DartSnapshot& GetVMSnapshot() const; + IsolateNameServer* GetIsolateNameServer(); + fxl::RefPtr GetIsolateSnapshot() const; fxl::RefPtr GetSharedSnapshot() const; @@ -53,6 +56,7 @@ class DartVM : public fxl::RefCountedThreadSafe { private: const Settings settings_; const fxl::RefPtr vm_snapshot_; + IsolateNameServer isolate_name_server_; const fxl::RefPtr isolate_snapshot_; const fxl::RefPtr shared_snapshot_; std::unique_ptr platform_kernel_mapping_; diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc index d0664d111181b..280375dd19feb 100644 --- a/runtime/dart_vm_unittests.cc +++ b/runtime/dart_vm_unittests.cc @@ -18,4 +18,18 @@ TEST(DartVM, SimpleInitialization) { ASSERT_EQ(vm->GetPlatformKernel().GetSize(), 0u); } +TEST(DartVM, SimpleIsolateNameServer) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + auto ns = vm->GetIsolateNameServer(); + ASSERT_EQ(ns->LookupIsolatePortByName("foobar"), ILLEGAL_PORT); + ASSERT_FALSE(ns->RemoveIsolateNameMapping("foobar")); + ASSERT_TRUE(ns->RegisterIsolatePortWithName(123, "foobar")); + ASSERT_FALSE(ns->RegisterIsolatePortWithName(123, "foobar")); + ASSERT_EQ(ns->LookupIsolatePortByName("foobar"), 123); + ASSERT_TRUE(ns->RemoveIsolateNameMapping("foobar")); +} + } // namespace blink diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 4b4c2cdf30aad..18eaaebad68bc 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -20,7 +20,7 @@ namespace blink { RuntimeController::RuntimeController( RuntimeDelegate& p_client, - const DartVM* p_vm, + DartVM* p_vm, fxl::RefPtr p_isolate_snapshot, fxl::RefPtr p_shared_snapshot, TaskRunners p_task_runners, @@ -41,7 +41,7 @@ RuntimeController::RuntimeController( RuntimeController::RuntimeController( RuntimeDelegate& p_client, - const DartVM* p_vm, + DartVM* p_vm, fxl::RefPtr p_isolate_snapshot, fxl::RefPtr p_shared_snapshot, TaskRunners p_task_runners, diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 746845a7c0fba..599d9c73b274c 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -24,7 +24,7 @@ class Window; class RuntimeController final : public WindowClient { public: RuntimeController(RuntimeDelegate& client, - const DartVM* vm, + DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -82,7 +82,7 @@ class RuntimeController final : public WindowClient { }; RuntimeDelegate& client_; - const DartVM* vm_; + DartVM* const vm_; fxl::RefPtr isolate_snapshot_; fxl::RefPtr shared_snapshot_; TaskRunners task_runners_; @@ -95,7 +95,7 @@ class RuntimeController final : public WindowClient { std::pair root_isolate_return_code_ = {false, 0}; RuntimeController(RuntimeDelegate& client, - const DartVM* vm, + DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 0eea25f8de8e0..d2f6e57807200 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -36,7 +36,7 @@ static constexpr char kLocalizationChannel[] = "flutter/localization"; static constexpr char kSettingsChannel[] = "flutter/settings"; Engine::Engine(Delegate& delegate, - const blink::DartVM& vm, + blink::DartVM& vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, blink::TaskRunners task_runners, diff --git a/shell/common/engine.h b/shell/common/engine.h index e1fed0d683d61..46602cdea9fd6 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -39,7 +39,7 @@ class Engine final : public blink::RuntimeDelegate { }; Engine(Delegate& delegate, - const blink::DartVM& vm, + blink::DartVM& vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, blink::TaskRunners task_runners, diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 97385fab65f72..0da5126e53e3d 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -400,7 +400,7 @@ fml::WeakPtr Shell::GetPlatformView() { return platform_view_->GetWeakPtr(); } -const blink::DartVM& Shell::GetDartVM() const { +blink::DartVM& Shell::GetDartVM() const { return *vm_; } diff --git a/shell/common/shell.h b/shell/common/shell.h index 2a8caeb476583..75ab39052ce21 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -72,7 +72,7 @@ class Shell final : public PlatformView::Delegate, fml::WeakPtr GetPlatformView(); - const blink::DartVM& GetDartVM() const; + blink::DartVM& GetDartVM() const; bool IsSetup() const; diff --git a/testing/dart/isolate_name_server_test.dart b/testing/dart/isolate_name_server_test.dart new file mode 100644 index 0000000000000..98dbf612ce123 --- /dev/null +++ b/testing/dart/isolate_name_server_test.dart @@ -0,0 +1,128 @@ +// 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 'dart:isolate'; +import 'dart:ui'; + +import 'package:test/test.dart'; + +const kPortName = 'foobar'; +const kErrorCode = -1; +const kStartCode = 0; +const kCloseCode = 1; +const kDeletedCode = 2; + +void isolateSpawnEntrypoint(SendPort port) { + sendHelper(int code, [String message = '']) { + port.send([code, message]); + } + + SendPort shared = IsolateNameServer.lookupPortByName(kPortName); + if (shared == null) { + sendHelper(kErrorCode, 'Could not find port: $kPortName'); + return; + } + + // ack that the SendPort lookup was successful. + sendHelper(kStartCode); + + //shared.send(kPortName); + sendHelper(kCloseCode); + + // We'll fail if the ReceivePort's callback is called more than once. Try to + // send another message to ensure we don't crash. + shared.send('garbage'); + + bool result = IsolateNameServer.removePortNameMapping(kPortName); + if (result) { + sendHelper(kDeletedCode); + } else { + sendHelper(kErrorCode, 'Was unable to remove mapping for $kPortName'); + } +} + +void main() { + tearDown(() { + IsolateNameServer.removePortNameMapping(kPortName); + }); + + test('simple isolate name server', () { + // Mapping for 'foobar' isn't set. Check these cases to ensure correct + // negative response. + expect(IsolateNameServer.lookupPortByName(kPortName), isNull); + expect(IsolateNameServer.removePortNameMapping(kPortName), isFalse); + + // Register a SendPort. + final receivePort = new ReceivePort(); + final sendPort = receivePort.sendPort; + expect(IsolateNameServer.registerPortWithName(sendPort, kPortName), isTrue); + expect(IsolateNameServer.lookupPortByName(kPortName), sendPort); + + // Check we can't register the same name twice. + final receivePort2 = new ReceivePort(); + final sendPort2 = receivePort2.sendPort; + expect( + IsolateNameServer.registerPortWithName(sendPort2, kPortName), isFalse); + expect(IsolateNameServer.lookupPortByName(kPortName), sendPort); + + // Remove the mapping. + expect(IsolateNameServer.removePortNameMapping(kPortName), isTrue); + expect(IsolateNameServer.lookupPortByName(kPortName), isNull); + + // Ensure registering a new port with the old name returns the new port. + expect( + IsolateNameServer.registerPortWithName(sendPort2, kPortName), isTrue); + expect(IsolateNameServer.lookupPortByName(kPortName), sendPort2); + }); + + test('isolate name server null args', () { + // None of our IsolateNameServer methods should accept null. + expect(() => IsolateNameServer.lookupPortByName(null), throwsArgumentError); + expect(() => IsolateNameServer.registerPortWithName(null, 'abc'), + throwsArgumentError); + final receivePort = new ReceivePort(); + final sendPort = receivePort.sendPort; + expect(() => IsolateNameServer.registerPortWithName(sendPort, null), + throwsArgumentError); + expect(() => IsolateNameServer.removePortNameMapping(null), + throwsArgumentError); + }); + + test('isolate name server multi-isolate', () async { + // Register our send port with the name server. + final receivePort = new ReceivePort(); + final sendPort = receivePort.sendPort; + expect(IsolateNameServer.registerPortWithName(sendPort, kPortName), isTrue); + + // Test driver. + final testReceivePort = new ReceivePort(); + testReceivePort.listen(expectAsync1((List response) { + final int code = response[0]; + final String message = response[1]; + switch (code) { + case kStartCode: + break; + case kCloseCode: + receivePort.close(); + break; + case kDeletedCode: + expect(IsolateNameServer.lookupPortByName(kPortName), isNull); + break; + case kErrorCode: + throw message; + default: + throw 'UNREACHABLE'; + } + }, count: 3)); + + receivePort.listen(expectAsync1((message) { + // If we don't get this message, we timeout and fail. + expect(message, kPortName); + })); + + // Run the test. + await Isolate.spawn(isolateSpawnEntrypoint, testReceivePort.sendPort); + }); +} diff --git a/testing/run_tests.sh b/testing/run_tests.sh index 73579c97160c3..26e9401d43d91 100755 --- a/testing/run_tests.sh +++ b/testing/run_tests.sh @@ -4,7 +4,6 @@ set -ex out/host_debug_unopt/fxl_unittests out/host_debug_unopt/synchronization_unittests -out/host_debug_unopt/wtf_unittests flutter/travis/analyze.sh diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index a66035fa469c5..222cc2f4523e4 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -490,6 +490,7 @@ LIBRARY: engine ORIGIN: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart +FILE: ../../../flutter/lib/ui/isolate_name_server.dart FILE: ../../../flutter/lib/ui/painting/image_encoding.cc FILE: ../../../flutter/lib/ui/painting/image_encoding.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h @@ -580,6 +581,10 @@ FILE: ../../../flutter/fml/platform/win/wstring_conversion.h FILE: ../../../flutter/fml/unique_fd.cc FILE: ../../../flutter/fml/unique_fd.h FILE: ../../../flutter/fml/unique_object.h +FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server.cc +FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server.h +FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server_natives.cc +FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h FILE: ../../../flutter/shell/common/isolate_configuration.cc FILE: ../../../flutter/shell/common/isolate_configuration.h FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc From c3976b3c7183f479717bffed3f640fb92afbd3dc Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Tue, 12 Jun 2018 17:03:13 -0700 Subject: [PATCH 0570/1190] Revert "Added IsolateNameServer functionality (#5410)" (#5516) This reverts commit 61a2d129cfc8c52cf1ff59b03bccf67d9b07af63. --- lib/ui/BUILD.gn | 4 - lib/ui/dart_ui.cc | 2 - lib/ui/dart_ui.gni | 1 - lib/ui/isolate_name_server.dart | 44 ------ .../isolate_name_server.cc | 44 ------ .../isolate_name_server/isolate_name_server.h | 50 ------- .../isolate_name_server_natives.cc | 64 --------- .../isolate_name_server_natives.h | 27 ---- lib/ui/ui.dart | 2 - lib/ui/ui_dart_state.cc | 10 +- lib/ui/ui_dart_state.h | 7 +- runtime/dart_isolate.cc | 11 +- runtime/dart_isolate.h | 8 +- runtime/dart_vm.cc | 4 - runtime/dart_vm.h | 4 - runtime/dart_vm_unittests.cc | 14 -- runtime/runtime_controller.cc | 4 +- runtime/runtime_controller.h | 6 +- shell/common/engine.cc | 2 +- shell/common/engine.h | 2 +- shell/common/shell.cc | 2 +- shell/common/shell.h | 2 +- testing/dart/isolate_name_server_test.dart | 128 ------------------ testing/run_tests.sh | 1 + travis/licenses_golden/licenses_flutter | 5 - 25 files changed, 22 insertions(+), 426 deletions(-) delete mode 100644 lib/ui/isolate_name_server.dart delete mode 100644 lib/ui/isolate_name_server/isolate_name_server.cc delete mode 100644 lib/ui/isolate_name_server/isolate_name_server.h delete mode 100644 lib/ui/isolate_name_server/isolate_name_server_natives.cc delete mode 100644 lib/ui/isolate_name_server/isolate_name_server_natives.h delete mode 100644 testing/dart/isolate_name_server_test.dart diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 027159fb897a9..592f985b8b7d8 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -14,10 +14,6 @@ source_set("ui") { "dart_runtime_hooks.h", "dart_ui.cc", "dart_ui.h", - "isolate_name_server/isolate_name_server.cc", - "isolate_name_server/isolate_name_server.h", - "isolate_name_server/isolate_name_server_natives.cc", - "isolate_name_server/isolate_name_server_natives.h", "painting/canvas.cc", "painting/canvas.h", "painting/codec.cc", diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc index 306743c82f39f..824152e28e8d0 100644 --- a/lib/ui/dart_ui.cc +++ b/lib/ui/dart_ui.cc @@ -7,7 +7,6 @@ #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/compositing/scene_builder.h" #include "flutter/lib/ui/dart_runtime_hooks.h" -#include "flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/painting/codec.h" #include "flutter/lib/ui/painting/frame_info.h" @@ -61,7 +60,6 @@ void DartUI::InitForGlobal() { FrameInfo::RegisterNatives(g_natives); ImageFilter::RegisterNatives(g_natives); ImageShader::RegisterNatives(g_natives); - IsolateNameServerNatives::RegisterNatives(g_natives); Paragraph::RegisterNatives(g_natives); ParagraphBuilder::RegisterNatives(g_natives); Picture::RegisterNatives(g_natives); diff --git a/lib/ui/dart_ui.gni b/lib/ui/dart_ui.gni index e1885d1d09ace..418b6531004a0 100644 --- a/lib/ui/dart_ui.gni +++ b/lib/ui/dart_ui.gni @@ -7,7 +7,6 @@ dart_ui_files = [ "$flutter_root/lib/ui/geometry.dart", "$flutter_root/lib/ui/hash_codes.dart", "$flutter_root/lib/ui/hooks.dart", - "$flutter_root/lib/ui/isolate_name_server.dart", "$flutter_root/lib/ui/lerp.dart", "$flutter_root/lib/ui/natives.dart", "$flutter_root/lib/ui/painting.dart", diff --git a/lib/ui/isolate_name_server.dart b/lib/ui/isolate_name_server.dart deleted file mode 100644 index 8dcbf79977ef7..0000000000000 --- a/lib/ui/isolate_name_server.dart +++ /dev/null @@ -1,44 +0,0 @@ -// 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. - -part of dart.ui; - -abstract class IsolateNameServer { - // Looks up the [SendPort] associated with a given name. Returns null - // if the name does not exist. - static SendPort lookupPortByName(String name) { - if (name == null) { - throw new ArgumentError("'name' cannot be null."); - } - return _lookupPortByName(name); - } - - // Registers a SendPort with a given name. Returns true if registration is - // successful, false if the name entry already exists. - static bool registerPortWithName(SendPort port, String name) { - if (name == null) { - throw new ArgumentError("'name' cannot be null."); - } - if (port == null) { - throw new ArgumentError("'port' cannot be null."); - } - return _registerPortWithName(port, name); - } - - // Removes a name to SendPort mapping given a name. Returns true if the - // mapping was successfully removed, false if the mapping does not exist. - static bool removePortNameMapping(String name) { - if (name == null) { - throw new ArgumentError("'name' cannot be null."); - } - return _removePortNameMapping(name); - } - - static SendPort _lookupPortByName(String name) - native 'IsolateNameServerNatives_LookupPortByName'; - static bool _registerPortWithName(SendPort port, String name) - native 'IsolateNameServerNatives_RegisterPortWithName'; - static bool _removePortNameMapping(String name) - native 'IsolateNameServerNatives_RemovePortNameMapping'; -} diff --git a/lib/ui/isolate_name_server/isolate_name_server.cc b/lib/ui/isolate_name_server/isolate_name_server.cc deleted file mode 100644 index 7a6a1fe5889e4..0000000000000 --- a/lib/ui/isolate_name_server/isolate_name_server.cc +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 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/lib/ui/isolate_name_server/isolate_name_server.h" - -namespace blink { - -Dart_Port IsolateNameServer::LookupIsolatePortByName(const std::string& name) { - std::unique_lock lock(mutex_); - return LookupIsolatePortByNameUnprotected(name); -} - -Dart_Port IsolateNameServer::LookupIsolatePortByNameUnprotected( - const std::string& name) { - auto port_iterator = port_mapping_.find(name); - if (port_iterator != port_mapping_.end()) { - return port_iterator->second; - } - return ILLEGAL_PORT; -} - -bool IsolateNameServer::RegisterIsolatePortWithName(Dart_Port port, - const std::string& name) { - std::unique_lock lock(mutex_); - if (LookupIsolatePortByNameUnprotected(name) != ILLEGAL_PORT) { - // Name is already registered. - return false; - } - port_mapping_[name] = port; - return true; -} - -bool IsolateNameServer::RemoveIsolateNameMapping(const std::string& name) { - std::unique_lock lock(mutex_); - auto port_iterator = port_mapping_.find(name); - if (port_iterator == port_mapping_.end()) { - return false; - } - port_mapping_.erase(port_iterator); - return true; -} - -} // namespace blink diff --git a/lib/ui/isolate_name_server/isolate_name_server.h b/lib/ui/isolate_name_server/isolate_name_server.h deleted file mode 100644 index fe1ee7910e57c..0000000000000 --- a/lib/ui/isolate_name_server/isolate_name_server.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2018 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_LIB_UI_ISOLATE_NAME_SERVER_H_ -#define FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_H_ - -#include -#include -#include - -#include "flutter/fml/synchronization/thread_annotations.h" -#include "lib/fxl/macros.h" -#include "third_party/dart/runtime/include/dart_api.h" - -#define LOCK_UNLOCK(m) FML_ACQUIRE(m) FML_RELEASE(m) - -namespace blink { - -class IsolateNameServer { - public: - IsolateNameServer() {} - - // Looks up the Dart_Port associated with a given name. Returns ILLEGAL_PORT - // if the name does not exist. - Dart_Port LookupIsolatePortByName(const std::string& name) - LOCK_UNLOCK(mutex_); - - // Registers a Dart_Port with a given name. Returns true if registration is - // successful, false if the name entry already exists. - bool RegisterIsolatePortWithName(Dart_Port port, const std::string& name) - LOCK_UNLOCK(mutex_); - - // Removes a name to Dart_Port mapping given a name. Returns true if the - // mapping was successfully removed, false if the mapping does not exist. - bool RemoveIsolateNameMapping(const std::string& name) LOCK_UNLOCK(mutex_); - - private: - Dart_Port LookupIsolatePortByNameUnprotected(const std::string& name) - FML_EXCLUSIVE_LOCKS_REQUIRED(mutex_); - - mutable std::mutex mutex_; - std::map port_mapping_ FML_GUARDED_BY(mutex_); - - FXL_DISALLOW_COPY_AND_ASSIGN(IsolateNameServer); -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_H_ diff --git a/lib/ui/isolate_name_server/isolate_name_server_natives.cc b/lib/ui/isolate_name_server/isolate_name_server_natives.cc deleted file mode 100644 index 3919f9f4898c1..0000000000000 --- a/lib/ui/isolate_name_server/isolate_name_server_natives.cc +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2018 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 - -#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" -#include "flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h" -#include "flutter/lib/ui/ui_dart_state.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" - -namespace blink { - -Dart_Handle IsolateNameServerNatives::LookupPortByName( - const std::string& name) { - IsolateNameServer* name_server = - UIDartState::Current()->GetIsolateNameServer(); - Dart_Port port = name_server->LookupIsolatePortByName(name); - if (port == ILLEGAL_PORT) { - return Dart_Null(); - } - return Dart_NewSendPort(port); -} - -Dart_Handle IsolateNameServerNatives::RegisterPortWithName( - Dart_Handle port_handle, - const std::string& name) { - IsolateNameServer* name_server = - UIDartState::Current()->GetIsolateNameServer(); - Dart_Port port = ILLEGAL_PORT; - Dart_SendPortGetId(port_handle, &port); - if (!name_server->RegisterIsolatePortWithName(port, name)) { - return Dart_False(); - } - return Dart_True(); -} - -Dart_Handle IsolateNameServerNatives::RemovePortNameMapping( - const std::string& name) { - IsolateNameServer* name_server = - UIDartState::Current()->GetIsolateNameServer(); - if (!name_server->RemoveIsolateNameMapping(name)) { - return Dart_False(); - } - return Dart_True(); -} - -#define FOR_EACH_BINDING(V) \ - V(IsolateNameServerNatives, LookupPortByName) \ - V(IsolateNameServerNatives, RegisterPortWithName) \ - V(IsolateNameServerNatives, RemovePortNameMapping) - -FOR_EACH_BINDING(DART_NATIVE_CALLBACK_STATIC) - -#define DART_REGISTER_NATIVE_STATIC_(CLASS, METHOD) \ - DART_REGISTER_NATIVE_STATIC(CLASS, METHOD), - -void IsolateNameServerNatives::RegisterNatives( - tonic::DartLibraryNatives* natives) { - natives->Register({FOR_EACH_BINDING(DART_REGISTER_NATIVE_STATIC_)}); -} - -} // namespace blink diff --git a/lib/ui/isolate_name_server/isolate_name_server_natives.h b/lib/ui/isolate_name_server/isolate_name_server_natives.h deleted file mode 100644 index 2ebbe6e445010..0000000000000 --- a/lib/ui/isolate_name_server/isolate_name_server_natives.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2018 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_LIB_UI_ISOLATE_NAME_SERVER_NATIVES_H_ -#define FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_NATIVES_H_ - -#include "third_party/dart/runtime/include/dart_api.h" - -namespace tonic { -class DartLibraryNatives; -} // namespace tonic - -namespace blink { - -class IsolateNameServerNatives { - public: - static Dart_Handle LookupPortByName(const std::string& name); - static Dart_Handle RegisterPortWithName(Dart_Handle port_handle, - const std::string& name); - static Dart_Handle RemovePortNameMapping(const std::string& name); - static void RegisterNatives(tonic::DartLibraryNatives* natives); -}; - -} // namespace blink - -#endif // FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_NATIVES_H_ diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index 1d9782311f310..b6d22ca2939e9 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -17,7 +17,6 @@ import 'dart:collection' as collection; import 'dart:convert'; import 'dart:developer' as developer; import 'dart:io'; -import 'dart:isolate' show SendPort; import 'dart:math' as math; import 'dart:nativewrappers'; import 'dart:typed_data'; @@ -26,7 +25,6 @@ part 'compositing.dart'; part 'geometry.dart'; part 'hash_codes.dart'; part 'hooks.dart'; -part 'isolate_name_server.dart'; part 'lerp.dart'; part 'natives.dart'; part 'painting.dart'; diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index f7d3d4c81cca6..77830affdd561 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -19,8 +19,7 @@ UIDartState::UIDartState(TaskRunners task_runners, fxl::RefPtr skia_unref_queue, std::string advisory_script_uri, std::string advisory_script_entrypoint, - std::string logger_prefix, - IsolateNameServer* isolate_name_server) + std::string logger_prefix) : task_runners_(std::move(task_runners)), add_callback_(std::move(add_callback)), remove_callback_(std::move(remove_callback)), @@ -28,8 +27,7 @@ UIDartState::UIDartState(TaskRunners task_runners, advisory_script_uri_(std::move(advisory_script_uri)), advisory_script_entrypoint_(std::move(advisory_script_entrypoint)), logger_prefix_(std::move(logger_prefix)), - skia_unref_queue_(std::move(skia_unref_queue)), - isolate_name_server_(isolate_name_server) { + skia_unref_queue_(std::move(skia_unref_queue)) { AddOrRemoveTaskObserver(true /* add */); } @@ -102,8 +100,4 @@ fml::WeakPtr UIDartState::GetResourceContext() const { return resource_context_; } -IsolateNameServer* UIDartState::GetIsolateNameServer() { - return isolate_name_server_; -} - } // namespace blink diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index 5cfdf9a44f11c..ef1832594d3c0 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -13,7 +13,6 @@ #include "flutter/common/task_runners.h" #include "flutter/flow/skia_gpu_object.h" #include "flutter/fml/memory/weak_ptr.h" -#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" #include "lib/fxl/build_config.h" #include "lib/tonic/dart_microtask_queue.h" #include "lib/tonic/dart_persistent_value.h" @@ -47,8 +46,6 @@ class UIDartState : public tonic::DartState { fml::WeakPtr GetResourceContext() const; - IsolateNameServer* GetIsolateNameServer(); - template static flow::SkiaGPUObject CreateGPUObject(sk_sp object) { if (!object) { @@ -68,8 +65,7 @@ class UIDartState : public tonic::DartState { fxl::RefPtr skia_unref_queue, std::string advisory_script_uri, std::string advisory_script_entrypoint, - std::string logger_prefix, - IsolateNameServer* isolate_name_server); + std::string logger_prefix); ~UIDartState() override; @@ -94,7 +90,6 @@ class UIDartState : public tonic::DartState { std::unique_ptr window_; fxl::RefPtr skia_unref_queue_; tonic::DartMicrotaskQueue microtask_queue_; - IsolateNameServer* isolate_name_server_; void AddOrRemoveTaskObserver(bool add); }; diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 66af59a5872c7..ded3ff8f6da2a 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -33,7 +33,7 @@ namespace blink { fml::WeakPtr DartIsolate::CreateRootIsolate( - DartVM* vm, + const DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -94,7 +94,7 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( return embedder_isolate; } -DartIsolate::DartIsolate(DartVM* vm, +DartIsolate::DartIsolate(const DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -110,8 +110,7 @@ DartIsolate::DartIsolate(DartVM* vm, std::move(unref_queue), advisory_script_uri, advisory_script_entrypoint, - vm->GetSettings().log_tag, - vm->GetIsolateNameServer()), + vm->GetSettings().log_tag), vm_(vm), isolate_snapshot_(std::move(isolate_snapshot)), shared_snapshot_(std::move(shared_snapshot)), @@ -132,7 +131,7 @@ DartIsolate::Phase DartIsolate::GetPhase() const { return phase_; } -DartVM* DartIsolate::GetDartVM() const { +const DartVM* DartIsolate::GetDartVM() const { return vm_; } @@ -652,7 +651,7 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( return {nullptr, {}}; } - DartVM* const vm = embedder_isolate->GetDartVM(); + const DartVM* vm = embedder_isolate->GetDartVM(); if (!is_root_isolate) { auto raw_embedder_isolate = embedder_isolate.release(); diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index ceed7a0fd7a2a..e8219469034f7 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -39,7 +39,7 @@ class DartIsolate : public UIDartState { // bindings. From the VM's perspective, this isolate is not special in any // way. static fml::WeakPtr CreateRootIsolate( - DartVM* vm, + const DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -50,7 +50,7 @@ class DartIsolate : public UIDartState { std::string advisory_script_entrypoint, Dart_IsolateFlags* flags = nullptr); - DartIsolate(DartVM* vm, + DartIsolate(const DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -84,7 +84,7 @@ class DartIsolate : public UIDartState { void AddIsolateShutdownCallback(fxl::Closure closure); - DartVM* GetDartVM() const; + const DartVM* GetDartVM() const; fxl::RefPtr GetIsolateSnapshot() const; fxl::RefPtr GetSharedSnapshot() const; @@ -107,7 +107,7 @@ class DartIsolate : public UIDartState { }; friend class DartVM; - DartVM* const vm_ = nullptr; + const DartVM* vm_ = nullptr; Phase phase_ = Phase::Unknown; const fxl::RefPtr isolate_snapshot_; const fxl::RefPtr shared_snapshot_; diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 4f24b5bad23b9..776fbab983e10 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -471,10 +471,6 @@ const DartSnapshot& DartVM::GetVMSnapshot() const { return *vm_snapshot_.get(); } -IsolateNameServer* DartVM::GetIsolateNameServer() { - return &isolate_name_server_; -} - fxl::RefPtr DartVM::GetIsolateSnapshot() const { return isolate_snapshot_; } diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h index 8c2c6f3fe5019..8202aad1204c4 100644 --- a/runtime/dart_vm.h +++ b/runtime/dart_vm.h @@ -10,7 +10,6 @@ #include #include "flutter/common/settings.h" -#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" #include "flutter/runtime/dart_isolate.h" #include "flutter/runtime/dart_snapshot.h" #include "flutter/runtime/service_protocol.h" @@ -44,8 +43,6 @@ class DartVM : public fxl::RefCountedThreadSafe { const DartSnapshot& GetVMSnapshot() const; - IsolateNameServer* GetIsolateNameServer(); - fxl::RefPtr GetIsolateSnapshot() const; fxl::RefPtr GetSharedSnapshot() const; @@ -56,7 +53,6 @@ class DartVM : public fxl::RefCountedThreadSafe { private: const Settings settings_; const fxl::RefPtr vm_snapshot_; - IsolateNameServer isolate_name_server_; const fxl::RefPtr isolate_snapshot_; const fxl::RefPtr shared_snapshot_; std::unique_ptr platform_kernel_mapping_; diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc index 280375dd19feb..d0664d111181b 100644 --- a/runtime/dart_vm_unittests.cc +++ b/runtime/dart_vm_unittests.cc @@ -18,18 +18,4 @@ TEST(DartVM, SimpleInitialization) { ASSERT_EQ(vm->GetPlatformKernel().GetSize(), 0u); } -TEST(DartVM, SimpleIsolateNameServer) { - Settings settings = {}; - settings.task_observer_add = [](intptr_t, fxl::Closure) {}; - settings.task_observer_remove = [](intptr_t) {}; - auto vm = DartVM::ForProcess(settings); - auto ns = vm->GetIsolateNameServer(); - ASSERT_EQ(ns->LookupIsolatePortByName("foobar"), ILLEGAL_PORT); - ASSERT_FALSE(ns->RemoveIsolateNameMapping("foobar")); - ASSERT_TRUE(ns->RegisterIsolatePortWithName(123, "foobar")); - ASSERT_FALSE(ns->RegisterIsolatePortWithName(123, "foobar")); - ASSERT_EQ(ns->LookupIsolatePortByName("foobar"), 123); - ASSERT_TRUE(ns->RemoveIsolateNameMapping("foobar")); -} - } // namespace blink diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 18eaaebad68bc..4b4c2cdf30aad 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -20,7 +20,7 @@ namespace blink { RuntimeController::RuntimeController( RuntimeDelegate& p_client, - DartVM* p_vm, + const DartVM* p_vm, fxl::RefPtr p_isolate_snapshot, fxl::RefPtr p_shared_snapshot, TaskRunners p_task_runners, @@ -41,7 +41,7 @@ RuntimeController::RuntimeController( RuntimeController::RuntimeController( RuntimeDelegate& p_client, - DartVM* p_vm, + const DartVM* p_vm, fxl::RefPtr p_isolate_snapshot, fxl::RefPtr p_shared_snapshot, TaskRunners p_task_runners, diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 599d9c73b274c..746845a7c0fba 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -24,7 +24,7 @@ class Window; class RuntimeController final : public WindowClient { public: RuntimeController(RuntimeDelegate& client, - DartVM* vm, + const DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -82,7 +82,7 @@ class RuntimeController final : public WindowClient { }; RuntimeDelegate& client_; - DartVM* const vm_; + const DartVM* vm_; fxl::RefPtr isolate_snapshot_; fxl::RefPtr shared_snapshot_; TaskRunners task_runners_; @@ -95,7 +95,7 @@ class RuntimeController final : public WindowClient { std::pair root_isolate_return_code_ = {false, 0}; RuntimeController(RuntimeDelegate& client, - DartVM* vm, + const DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, diff --git a/shell/common/engine.cc b/shell/common/engine.cc index d2f6e57807200..0eea25f8de8e0 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -36,7 +36,7 @@ static constexpr char kLocalizationChannel[] = "flutter/localization"; static constexpr char kSettingsChannel[] = "flutter/settings"; Engine::Engine(Delegate& delegate, - blink::DartVM& vm, + const blink::DartVM& vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, blink::TaskRunners task_runners, diff --git a/shell/common/engine.h b/shell/common/engine.h index 46602cdea9fd6..e1fed0d683d61 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -39,7 +39,7 @@ class Engine final : public blink::RuntimeDelegate { }; Engine(Delegate& delegate, - blink::DartVM& vm, + const blink::DartVM& vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, blink::TaskRunners task_runners, diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 0da5126e53e3d..97385fab65f72 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -400,7 +400,7 @@ fml::WeakPtr Shell::GetPlatformView() { return platform_view_->GetWeakPtr(); } -blink::DartVM& Shell::GetDartVM() const { +const blink::DartVM& Shell::GetDartVM() const { return *vm_; } diff --git a/shell/common/shell.h b/shell/common/shell.h index 75ab39052ce21..2a8caeb476583 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -72,7 +72,7 @@ class Shell final : public PlatformView::Delegate, fml::WeakPtr GetPlatformView(); - blink::DartVM& GetDartVM() const; + const blink::DartVM& GetDartVM() const; bool IsSetup() const; diff --git a/testing/dart/isolate_name_server_test.dart b/testing/dart/isolate_name_server_test.dart deleted file mode 100644 index 98dbf612ce123..0000000000000 --- a/testing/dart/isolate_name_server_test.dart +++ /dev/null @@ -1,128 +0,0 @@ -// 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 'dart:isolate'; -import 'dart:ui'; - -import 'package:test/test.dart'; - -const kPortName = 'foobar'; -const kErrorCode = -1; -const kStartCode = 0; -const kCloseCode = 1; -const kDeletedCode = 2; - -void isolateSpawnEntrypoint(SendPort port) { - sendHelper(int code, [String message = '']) { - port.send([code, message]); - } - - SendPort shared = IsolateNameServer.lookupPortByName(kPortName); - if (shared == null) { - sendHelper(kErrorCode, 'Could not find port: $kPortName'); - return; - } - - // ack that the SendPort lookup was successful. - sendHelper(kStartCode); - - //shared.send(kPortName); - sendHelper(kCloseCode); - - // We'll fail if the ReceivePort's callback is called more than once. Try to - // send another message to ensure we don't crash. - shared.send('garbage'); - - bool result = IsolateNameServer.removePortNameMapping(kPortName); - if (result) { - sendHelper(kDeletedCode); - } else { - sendHelper(kErrorCode, 'Was unable to remove mapping for $kPortName'); - } -} - -void main() { - tearDown(() { - IsolateNameServer.removePortNameMapping(kPortName); - }); - - test('simple isolate name server', () { - // Mapping for 'foobar' isn't set. Check these cases to ensure correct - // negative response. - expect(IsolateNameServer.lookupPortByName(kPortName), isNull); - expect(IsolateNameServer.removePortNameMapping(kPortName), isFalse); - - // Register a SendPort. - final receivePort = new ReceivePort(); - final sendPort = receivePort.sendPort; - expect(IsolateNameServer.registerPortWithName(sendPort, kPortName), isTrue); - expect(IsolateNameServer.lookupPortByName(kPortName), sendPort); - - // Check we can't register the same name twice. - final receivePort2 = new ReceivePort(); - final sendPort2 = receivePort2.sendPort; - expect( - IsolateNameServer.registerPortWithName(sendPort2, kPortName), isFalse); - expect(IsolateNameServer.lookupPortByName(kPortName), sendPort); - - // Remove the mapping. - expect(IsolateNameServer.removePortNameMapping(kPortName), isTrue); - expect(IsolateNameServer.lookupPortByName(kPortName), isNull); - - // Ensure registering a new port with the old name returns the new port. - expect( - IsolateNameServer.registerPortWithName(sendPort2, kPortName), isTrue); - expect(IsolateNameServer.lookupPortByName(kPortName), sendPort2); - }); - - test('isolate name server null args', () { - // None of our IsolateNameServer methods should accept null. - expect(() => IsolateNameServer.lookupPortByName(null), throwsArgumentError); - expect(() => IsolateNameServer.registerPortWithName(null, 'abc'), - throwsArgumentError); - final receivePort = new ReceivePort(); - final sendPort = receivePort.sendPort; - expect(() => IsolateNameServer.registerPortWithName(sendPort, null), - throwsArgumentError); - expect(() => IsolateNameServer.removePortNameMapping(null), - throwsArgumentError); - }); - - test('isolate name server multi-isolate', () async { - // Register our send port with the name server. - final receivePort = new ReceivePort(); - final sendPort = receivePort.sendPort; - expect(IsolateNameServer.registerPortWithName(sendPort, kPortName), isTrue); - - // Test driver. - final testReceivePort = new ReceivePort(); - testReceivePort.listen(expectAsync1((List response) { - final int code = response[0]; - final String message = response[1]; - switch (code) { - case kStartCode: - break; - case kCloseCode: - receivePort.close(); - break; - case kDeletedCode: - expect(IsolateNameServer.lookupPortByName(kPortName), isNull); - break; - case kErrorCode: - throw message; - default: - throw 'UNREACHABLE'; - } - }, count: 3)); - - receivePort.listen(expectAsync1((message) { - // If we don't get this message, we timeout and fail. - expect(message, kPortName); - })); - - // Run the test. - await Isolate.spawn(isolateSpawnEntrypoint, testReceivePort.sendPort); - }); -} diff --git a/testing/run_tests.sh b/testing/run_tests.sh index 26e9401d43d91..73579c97160c3 100755 --- a/testing/run_tests.sh +++ b/testing/run_tests.sh @@ -4,6 +4,7 @@ set -ex out/host_debug_unopt/fxl_unittests out/host_debug_unopt/synchronization_unittests +out/host_debug_unopt/wtf_unittests flutter/travis/analyze.sh diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 222cc2f4523e4..a66035fa469c5 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -490,7 +490,6 @@ LIBRARY: engine ORIGIN: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart -FILE: ../../../flutter/lib/ui/isolate_name_server.dart FILE: ../../../flutter/lib/ui/painting/image_encoding.cc FILE: ../../../flutter/lib/ui/painting/image_encoding.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h @@ -581,10 +580,6 @@ FILE: ../../../flutter/fml/platform/win/wstring_conversion.h FILE: ../../../flutter/fml/unique_fd.cc FILE: ../../../flutter/fml/unique_fd.h FILE: ../../../flutter/fml/unique_object.h -FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server.cc -FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server.h -FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server_natives.cc -FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h FILE: ../../../flutter/shell/common/isolate_configuration.cc FILE: ../../../flutter/shell/common/isolate_configuration.h FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc From c8eeee432bb362d657186faa00b3de7c468a9062 Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Wed, 13 Jun 2018 16:39:19 +0200 Subject: [PATCH 0571/1190] Roll the Dart VM. (#5517) With this roll the VM defaults to sync-async. 31e3441816 Fix bad status lines (wrong tests...) 18828ac77a Mark some co19 tests as crashing. 36e73371fb Switch analyzer_cli to using AnalysisDriver only. 2b36f923d9 Fix status file. 398ba13e4a Reapply "Make --sync-async the default for the VM." --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 16451f373df81..211a583bd4f83 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'c95617b19c1bfd67bce35c8737429f4e26975ac2', + 'dart_revision': '31e3441816c023fec5c34eefe33862f03a5d16ba', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 6662140fc504d..8b7db33c7685d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 245264e071bbc5718149880a56087206 +Signature: 7e37ea7cfaf09234ddf8a8d80067ddb8 UNUSED LICENSES: From 9fd1240bb02deec73e370ced91f70f7fcb5b1645 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 13 Jun 2018 11:54:58 -0400 Subject: [PATCH 0572/1190] Roll src/third_party/skia bb9ee9b4aa7d..dc89f192c853 (6 commits) (#5518) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 211a583bd4f83..c3128e6ea9e13 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'bb9ee9b4aa7d80e8a85832a462a3123060d4bd64', + 'skia_revision': 'dc89f192c853df57c71c42407c193571c2e1008a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8b7db33c7685d..d3f63b7fd8ff9 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7e37ea7cfaf09234ddf8a8d80067ddb8 +Signature: 4107747cb2f60224bb85f8d2733ee751 UNUSED LICENSES: @@ -17182,7 +17182,6 @@ FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkMacros.h FILE: ../../../third_party/skia/include/private/SkSafe32.h -FILE: ../../../third_party/skia/include/private/SkTo.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go FILE: ../../../third_party/skia/modules/skjson/include/SkJSON.h FILE: ../../../third_party/skia/modules/skjson/src/SkJSON.cpp From 8d8d91bfc34b6dab710b99deba8f63f437da9164 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Wed, 13 Jun 2018 11:57:10 -0700 Subject: [PATCH 0573/1190] IsolateNameServer reland (#5519) * Reland "Added IsolateNameServer functionality (#5410)" This reverts commit c3976b3c7183f479717bffed3f640fb92afbd3dc. * Fixed issue with isolate_name_server_test which caused test to timeout * Disabled thread_annotations on Android as they aren't supported in the NDK headers for std::mutex. Readded thread annotations to IsolateNameServer. --- fml/synchronization/thread_annotations.h | 4 +- lib/ui/BUILD.gn | 4 + lib/ui/dart_ui.cc | 2 + lib/ui/dart_ui.gni | 1 + lib/ui/isolate_name_server.dart | 44 ++++++ .../isolate_name_server.cc | 44 ++++++ .../isolate_name_server/isolate_name_server.h | 50 +++++++ .../isolate_name_server_natives.cc | 64 +++++++++ .../isolate_name_server_natives.h | 27 ++++ lib/ui/ui.dart | 2 + lib/ui/ui_dart_state.cc | 10 +- lib/ui/ui_dart_state.h | 7 +- runtime/dart_isolate.cc | 11 +- runtime/dart_isolate.h | 8 +- runtime/dart_vm.cc | 4 + runtime/dart_vm.h | 4 + runtime/dart_vm_unittests.cc | 14 ++ runtime/runtime_controller.cc | 4 +- runtime/runtime_controller.h | 6 +- shell/common/engine.cc | 2 +- shell/common/engine.h | 2 +- shell/common/shell.cc | 2 +- shell/common/shell.h | 2 +- testing/dart/isolate_name_server_test.dart | 135 ++++++++++++++++++ testing/run_tests.sh | 1 - travis/licenses_golden/licenses_flutter | 5 + 26 files changed, 436 insertions(+), 23 deletions(-) create mode 100644 lib/ui/isolate_name_server.dart create mode 100644 lib/ui/isolate_name_server/isolate_name_server.cc create mode 100644 lib/ui/isolate_name_server/isolate_name_server.h create mode 100644 lib/ui/isolate_name_server/isolate_name_server_natives.cc create mode 100644 lib/ui/isolate_name_server/isolate_name_server_natives.h create mode 100644 testing/dart/isolate_name_server_test.dart diff --git a/fml/synchronization/thread_annotations.h b/fml/synchronization/thread_annotations.h index 4123804e5720c..1b7bf6ecc6903 100644 --- a/fml/synchronization/thread_annotations.h +++ b/fml/synchronization/thread_annotations.h @@ -15,9 +15,11 @@ #ifndef FLUTTER_FML_SYNCHRONIZATION_THREAD_ANNOTATIONS_H_ #define FLUTTER_FML_SYNCHRONIZATION_THREAD_ANNOTATIONS_H_ +#include "flutter/fml/build_config.h" + // Enable thread-safety attributes only with clang. // The attributes can be safely erased when compiling with other compilers. -#if defined(__clang__) +#if defined(__clang__) && !defined(OS_ANDROID) #define FML_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) #else #define FML_THREAD_ANNOTATION_ATTRIBUTE__(x) diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 592f985b8b7d8..027159fb897a9 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -14,6 +14,10 @@ source_set("ui") { "dart_runtime_hooks.h", "dart_ui.cc", "dart_ui.h", + "isolate_name_server/isolate_name_server.cc", + "isolate_name_server/isolate_name_server.h", + "isolate_name_server/isolate_name_server_natives.cc", + "isolate_name_server/isolate_name_server_natives.h", "painting/canvas.cc", "painting/canvas.h", "painting/codec.cc", diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc index 824152e28e8d0..306743c82f39f 100644 --- a/lib/ui/dart_ui.cc +++ b/lib/ui/dart_ui.cc @@ -7,6 +7,7 @@ #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/compositing/scene_builder.h" #include "flutter/lib/ui/dart_runtime_hooks.h" +#include "flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/painting/codec.h" #include "flutter/lib/ui/painting/frame_info.h" @@ -60,6 +61,7 @@ void DartUI::InitForGlobal() { FrameInfo::RegisterNatives(g_natives); ImageFilter::RegisterNatives(g_natives); ImageShader::RegisterNatives(g_natives); + IsolateNameServerNatives::RegisterNatives(g_natives); Paragraph::RegisterNatives(g_natives); ParagraphBuilder::RegisterNatives(g_natives); Picture::RegisterNatives(g_natives); diff --git a/lib/ui/dart_ui.gni b/lib/ui/dart_ui.gni index 418b6531004a0..e1885d1d09ace 100644 --- a/lib/ui/dart_ui.gni +++ b/lib/ui/dart_ui.gni @@ -7,6 +7,7 @@ dart_ui_files = [ "$flutter_root/lib/ui/geometry.dart", "$flutter_root/lib/ui/hash_codes.dart", "$flutter_root/lib/ui/hooks.dart", + "$flutter_root/lib/ui/isolate_name_server.dart", "$flutter_root/lib/ui/lerp.dart", "$flutter_root/lib/ui/natives.dart", "$flutter_root/lib/ui/painting.dart", diff --git a/lib/ui/isolate_name_server.dart b/lib/ui/isolate_name_server.dart new file mode 100644 index 0000000000000..8dcbf79977ef7 --- /dev/null +++ b/lib/ui/isolate_name_server.dart @@ -0,0 +1,44 @@ +// 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. + +part of dart.ui; + +abstract class IsolateNameServer { + // Looks up the [SendPort] associated with a given name. Returns null + // if the name does not exist. + static SendPort lookupPortByName(String name) { + if (name == null) { + throw new ArgumentError("'name' cannot be null."); + } + return _lookupPortByName(name); + } + + // Registers a SendPort with a given name. Returns true if registration is + // successful, false if the name entry already exists. + static bool registerPortWithName(SendPort port, String name) { + if (name == null) { + throw new ArgumentError("'name' cannot be null."); + } + if (port == null) { + throw new ArgumentError("'port' cannot be null."); + } + return _registerPortWithName(port, name); + } + + // Removes a name to SendPort mapping given a name. Returns true if the + // mapping was successfully removed, false if the mapping does not exist. + static bool removePortNameMapping(String name) { + if (name == null) { + throw new ArgumentError("'name' cannot be null."); + } + return _removePortNameMapping(name); + } + + static SendPort _lookupPortByName(String name) + native 'IsolateNameServerNatives_LookupPortByName'; + static bool _registerPortWithName(SendPort port, String name) + native 'IsolateNameServerNatives_RegisterPortWithName'; + static bool _removePortNameMapping(String name) + native 'IsolateNameServerNatives_RemovePortNameMapping'; +} diff --git a/lib/ui/isolate_name_server/isolate_name_server.cc b/lib/ui/isolate_name_server/isolate_name_server.cc new file mode 100644 index 0000000000000..7a6a1fe5889e4 --- /dev/null +++ b/lib/ui/isolate_name_server/isolate_name_server.cc @@ -0,0 +1,44 @@ +// Copyright 2018 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/lib/ui/isolate_name_server/isolate_name_server.h" + +namespace blink { + +Dart_Port IsolateNameServer::LookupIsolatePortByName(const std::string& name) { + std::unique_lock lock(mutex_); + return LookupIsolatePortByNameUnprotected(name); +} + +Dart_Port IsolateNameServer::LookupIsolatePortByNameUnprotected( + const std::string& name) { + auto port_iterator = port_mapping_.find(name); + if (port_iterator != port_mapping_.end()) { + return port_iterator->second; + } + return ILLEGAL_PORT; +} + +bool IsolateNameServer::RegisterIsolatePortWithName(Dart_Port port, + const std::string& name) { + std::unique_lock lock(mutex_); + if (LookupIsolatePortByNameUnprotected(name) != ILLEGAL_PORT) { + // Name is already registered. + return false; + } + port_mapping_[name] = port; + return true; +} + +bool IsolateNameServer::RemoveIsolateNameMapping(const std::string& name) { + std::unique_lock lock(mutex_); + auto port_iterator = port_mapping_.find(name); + if (port_iterator == port_mapping_.end()) { + return false; + } + port_mapping_.erase(port_iterator); + return true; +} + +} // namespace blink diff --git a/lib/ui/isolate_name_server/isolate_name_server.h b/lib/ui/isolate_name_server/isolate_name_server.h new file mode 100644 index 0000000000000..fe1ee7910e57c --- /dev/null +++ b/lib/ui/isolate_name_server/isolate_name_server.h @@ -0,0 +1,50 @@ +// Copyright 2018 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_LIB_UI_ISOLATE_NAME_SERVER_H_ +#define FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_H_ + +#include +#include +#include + +#include "flutter/fml/synchronization/thread_annotations.h" +#include "lib/fxl/macros.h" +#include "third_party/dart/runtime/include/dart_api.h" + +#define LOCK_UNLOCK(m) FML_ACQUIRE(m) FML_RELEASE(m) + +namespace blink { + +class IsolateNameServer { + public: + IsolateNameServer() {} + + // Looks up the Dart_Port associated with a given name. Returns ILLEGAL_PORT + // if the name does not exist. + Dart_Port LookupIsolatePortByName(const std::string& name) + LOCK_UNLOCK(mutex_); + + // Registers a Dart_Port with a given name. Returns true if registration is + // successful, false if the name entry already exists. + bool RegisterIsolatePortWithName(Dart_Port port, const std::string& name) + LOCK_UNLOCK(mutex_); + + // Removes a name to Dart_Port mapping given a name. Returns true if the + // mapping was successfully removed, false if the mapping does not exist. + bool RemoveIsolateNameMapping(const std::string& name) LOCK_UNLOCK(mutex_); + + private: + Dart_Port LookupIsolatePortByNameUnprotected(const std::string& name) + FML_EXCLUSIVE_LOCKS_REQUIRED(mutex_); + + mutable std::mutex mutex_; + std::map port_mapping_ FML_GUARDED_BY(mutex_); + + FXL_DISALLOW_COPY_AND_ASSIGN(IsolateNameServer); +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_H_ diff --git a/lib/ui/isolate_name_server/isolate_name_server_natives.cc b/lib/ui/isolate_name_server/isolate_name_server_natives.cc new file mode 100644 index 0000000000000..3919f9f4898c1 --- /dev/null +++ b/lib/ui/isolate_name_server/isolate_name_server_natives.cc @@ -0,0 +1,64 @@ +// Copyright 2018 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 + +#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" +#include "flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h" +#include "flutter/lib/ui/ui_dart_state.h" +#include "lib/tonic/dart_binding_macros.h" +#include "lib/tonic/dart_library_natives.h" + +namespace blink { + +Dart_Handle IsolateNameServerNatives::LookupPortByName( + const std::string& name) { + IsolateNameServer* name_server = + UIDartState::Current()->GetIsolateNameServer(); + Dart_Port port = name_server->LookupIsolatePortByName(name); + if (port == ILLEGAL_PORT) { + return Dart_Null(); + } + return Dart_NewSendPort(port); +} + +Dart_Handle IsolateNameServerNatives::RegisterPortWithName( + Dart_Handle port_handle, + const std::string& name) { + IsolateNameServer* name_server = + UIDartState::Current()->GetIsolateNameServer(); + Dart_Port port = ILLEGAL_PORT; + Dart_SendPortGetId(port_handle, &port); + if (!name_server->RegisterIsolatePortWithName(port, name)) { + return Dart_False(); + } + return Dart_True(); +} + +Dart_Handle IsolateNameServerNatives::RemovePortNameMapping( + const std::string& name) { + IsolateNameServer* name_server = + UIDartState::Current()->GetIsolateNameServer(); + if (!name_server->RemoveIsolateNameMapping(name)) { + return Dart_False(); + } + return Dart_True(); +} + +#define FOR_EACH_BINDING(V) \ + V(IsolateNameServerNatives, LookupPortByName) \ + V(IsolateNameServerNatives, RegisterPortWithName) \ + V(IsolateNameServerNatives, RemovePortNameMapping) + +FOR_EACH_BINDING(DART_NATIVE_CALLBACK_STATIC) + +#define DART_REGISTER_NATIVE_STATIC_(CLASS, METHOD) \ + DART_REGISTER_NATIVE_STATIC(CLASS, METHOD), + +void IsolateNameServerNatives::RegisterNatives( + tonic::DartLibraryNatives* natives) { + natives->Register({FOR_EACH_BINDING(DART_REGISTER_NATIVE_STATIC_)}); +} + +} // namespace blink diff --git a/lib/ui/isolate_name_server/isolate_name_server_natives.h b/lib/ui/isolate_name_server/isolate_name_server_natives.h new file mode 100644 index 0000000000000..2ebbe6e445010 --- /dev/null +++ b/lib/ui/isolate_name_server/isolate_name_server_natives.h @@ -0,0 +1,27 @@ +// Copyright 2018 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_LIB_UI_ISOLATE_NAME_SERVER_NATIVES_H_ +#define FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_NATIVES_H_ + +#include "third_party/dart/runtime/include/dart_api.h" + +namespace tonic { +class DartLibraryNatives; +} // namespace tonic + +namespace blink { + +class IsolateNameServerNatives { + public: + static Dart_Handle LookupPortByName(const std::string& name); + static Dart_Handle RegisterPortWithName(Dart_Handle port_handle, + const std::string& name); + static Dart_Handle RemovePortNameMapping(const std::string& name); + static void RegisterNatives(tonic::DartLibraryNatives* natives); +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_ISOLATE_NAME_SERVER_NATIVES_H_ diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index b6d22ca2939e9..1d9782311f310 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -17,6 +17,7 @@ import 'dart:collection' as collection; import 'dart:convert'; import 'dart:developer' as developer; import 'dart:io'; +import 'dart:isolate' show SendPort; import 'dart:math' as math; import 'dart:nativewrappers'; import 'dart:typed_data'; @@ -25,6 +26,7 @@ part 'compositing.dart'; part 'geometry.dart'; part 'hash_codes.dart'; part 'hooks.dart'; +part 'isolate_name_server.dart'; part 'lerp.dart'; part 'natives.dart'; part 'painting.dart'; diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 77830affdd561..f7d3d4c81cca6 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -19,7 +19,8 @@ UIDartState::UIDartState(TaskRunners task_runners, fxl::RefPtr skia_unref_queue, std::string advisory_script_uri, std::string advisory_script_entrypoint, - std::string logger_prefix) + std::string logger_prefix, + IsolateNameServer* isolate_name_server) : task_runners_(std::move(task_runners)), add_callback_(std::move(add_callback)), remove_callback_(std::move(remove_callback)), @@ -27,7 +28,8 @@ UIDartState::UIDartState(TaskRunners task_runners, advisory_script_uri_(std::move(advisory_script_uri)), advisory_script_entrypoint_(std::move(advisory_script_entrypoint)), logger_prefix_(std::move(logger_prefix)), - skia_unref_queue_(std::move(skia_unref_queue)) { + skia_unref_queue_(std::move(skia_unref_queue)), + isolate_name_server_(isolate_name_server) { AddOrRemoveTaskObserver(true /* add */); } @@ -100,4 +102,8 @@ fml::WeakPtr UIDartState::GetResourceContext() const { return resource_context_; } +IsolateNameServer* UIDartState::GetIsolateNameServer() { + return isolate_name_server_; +} + } // namespace blink diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index ef1832594d3c0..5cfdf9a44f11c 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -13,6 +13,7 @@ #include "flutter/common/task_runners.h" #include "flutter/flow/skia_gpu_object.h" #include "flutter/fml/memory/weak_ptr.h" +#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" #include "lib/fxl/build_config.h" #include "lib/tonic/dart_microtask_queue.h" #include "lib/tonic/dart_persistent_value.h" @@ -46,6 +47,8 @@ class UIDartState : public tonic::DartState { fml::WeakPtr GetResourceContext() const; + IsolateNameServer* GetIsolateNameServer(); + template static flow::SkiaGPUObject CreateGPUObject(sk_sp object) { if (!object) { @@ -65,7 +68,8 @@ class UIDartState : public tonic::DartState { fxl::RefPtr skia_unref_queue, std::string advisory_script_uri, std::string advisory_script_entrypoint, - std::string logger_prefix); + std::string logger_prefix, + IsolateNameServer* isolate_name_server); ~UIDartState() override; @@ -90,6 +94,7 @@ class UIDartState : public tonic::DartState { std::unique_ptr window_; fxl::RefPtr skia_unref_queue_; tonic::DartMicrotaskQueue microtask_queue_; + IsolateNameServer* isolate_name_server_; void AddOrRemoveTaskObserver(bool add); }; diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index ded3ff8f6da2a..66af59a5872c7 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -33,7 +33,7 @@ namespace blink { fml::WeakPtr DartIsolate::CreateRootIsolate( - const DartVM* vm, + DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -94,7 +94,7 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( return embedder_isolate; } -DartIsolate::DartIsolate(const DartVM* vm, +DartIsolate::DartIsolate(DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -110,7 +110,8 @@ DartIsolate::DartIsolate(const DartVM* vm, std::move(unref_queue), advisory_script_uri, advisory_script_entrypoint, - vm->GetSettings().log_tag), + vm->GetSettings().log_tag, + vm->GetIsolateNameServer()), vm_(vm), isolate_snapshot_(std::move(isolate_snapshot)), shared_snapshot_(std::move(shared_snapshot)), @@ -131,7 +132,7 @@ DartIsolate::Phase DartIsolate::GetPhase() const { return phase_; } -const DartVM* DartIsolate::GetDartVM() const { +DartVM* DartIsolate::GetDartVM() const { return vm_; } @@ -651,7 +652,7 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( return {nullptr, {}}; } - const DartVM* vm = embedder_isolate->GetDartVM(); + DartVM* const vm = embedder_isolate->GetDartVM(); if (!is_root_isolate) { auto raw_embedder_isolate = embedder_isolate.release(); diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index e8219469034f7..ceed7a0fd7a2a 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -39,7 +39,7 @@ class DartIsolate : public UIDartState { // bindings. From the VM's perspective, this isolate is not special in any // way. static fml::WeakPtr CreateRootIsolate( - const DartVM* vm, + DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -50,7 +50,7 @@ class DartIsolate : public UIDartState { std::string advisory_script_entrypoint, Dart_IsolateFlags* flags = nullptr); - DartIsolate(const DartVM* vm, + DartIsolate(DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -84,7 +84,7 @@ class DartIsolate : public UIDartState { void AddIsolateShutdownCallback(fxl::Closure closure); - const DartVM* GetDartVM() const; + DartVM* GetDartVM() const; fxl::RefPtr GetIsolateSnapshot() const; fxl::RefPtr GetSharedSnapshot() const; @@ -107,7 +107,7 @@ class DartIsolate : public UIDartState { }; friend class DartVM; - const DartVM* vm_ = nullptr; + DartVM* const vm_ = nullptr; Phase phase_ = Phase::Unknown; const fxl::RefPtr isolate_snapshot_; const fxl::RefPtr shared_snapshot_; diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 776fbab983e10..4f24b5bad23b9 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -471,6 +471,10 @@ const DartSnapshot& DartVM::GetVMSnapshot() const { return *vm_snapshot_.get(); } +IsolateNameServer* DartVM::GetIsolateNameServer() { + return &isolate_name_server_; +} + fxl::RefPtr DartVM::GetIsolateSnapshot() const { return isolate_snapshot_; } diff --git a/runtime/dart_vm.h b/runtime/dart_vm.h index 8202aad1204c4..8c2c6f3fe5019 100644 --- a/runtime/dart_vm.h +++ b/runtime/dart_vm.h @@ -10,6 +10,7 @@ #include #include "flutter/common/settings.h" +#include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" #include "flutter/runtime/dart_isolate.h" #include "flutter/runtime/dart_snapshot.h" #include "flutter/runtime/service_protocol.h" @@ -43,6 +44,8 @@ class DartVM : public fxl::RefCountedThreadSafe { const DartSnapshot& GetVMSnapshot() const; + IsolateNameServer* GetIsolateNameServer(); + fxl::RefPtr GetIsolateSnapshot() const; fxl::RefPtr GetSharedSnapshot() const; @@ -53,6 +56,7 @@ class DartVM : public fxl::RefCountedThreadSafe { private: const Settings settings_; const fxl::RefPtr vm_snapshot_; + IsolateNameServer isolate_name_server_; const fxl::RefPtr isolate_snapshot_; const fxl::RefPtr shared_snapshot_; std::unique_ptr platform_kernel_mapping_; diff --git a/runtime/dart_vm_unittests.cc b/runtime/dart_vm_unittests.cc index d0664d111181b..280375dd19feb 100644 --- a/runtime/dart_vm_unittests.cc +++ b/runtime/dart_vm_unittests.cc @@ -18,4 +18,18 @@ TEST(DartVM, SimpleInitialization) { ASSERT_EQ(vm->GetPlatformKernel().GetSize(), 0u); } +TEST(DartVM, SimpleIsolateNameServer) { + Settings settings = {}; + settings.task_observer_add = [](intptr_t, fxl::Closure) {}; + settings.task_observer_remove = [](intptr_t) {}; + auto vm = DartVM::ForProcess(settings); + auto ns = vm->GetIsolateNameServer(); + ASSERT_EQ(ns->LookupIsolatePortByName("foobar"), ILLEGAL_PORT); + ASSERT_FALSE(ns->RemoveIsolateNameMapping("foobar")); + ASSERT_TRUE(ns->RegisterIsolatePortWithName(123, "foobar")); + ASSERT_FALSE(ns->RegisterIsolatePortWithName(123, "foobar")); + ASSERT_EQ(ns->LookupIsolatePortByName("foobar"), 123); + ASSERT_TRUE(ns->RemoveIsolateNameMapping("foobar")); +} + } // namespace blink diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 4b4c2cdf30aad..18eaaebad68bc 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -20,7 +20,7 @@ namespace blink { RuntimeController::RuntimeController( RuntimeDelegate& p_client, - const DartVM* p_vm, + DartVM* p_vm, fxl::RefPtr p_isolate_snapshot, fxl::RefPtr p_shared_snapshot, TaskRunners p_task_runners, @@ -41,7 +41,7 @@ RuntimeController::RuntimeController( RuntimeController::RuntimeController( RuntimeDelegate& p_client, - const DartVM* p_vm, + DartVM* p_vm, fxl::RefPtr p_isolate_snapshot, fxl::RefPtr p_shared_snapshot, TaskRunners p_task_runners, diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 746845a7c0fba..599d9c73b274c 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -24,7 +24,7 @@ class Window; class RuntimeController final : public WindowClient { public: RuntimeController(RuntimeDelegate& client, - const DartVM* vm, + DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, @@ -82,7 +82,7 @@ class RuntimeController final : public WindowClient { }; RuntimeDelegate& client_; - const DartVM* vm_; + DartVM* const vm_; fxl::RefPtr isolate_snapshot_; fxl::RefPtr shared_snapshot_; TaskRunners task_runners_; @@ -95,7 +95,7 @@ class RuntimeController final : public WindowClient { std::pair root_isolate_return_code_ = {false, 0}; RuntimeController(RuntimeDelegate& client, - const DartVM* vm, + DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, TaskRunners task_runners, diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 0eea25f8de8e0..d2f6e57807200 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -36,7 +36,7 @@ static constexpr char kLocalizationChannel[] = "flutter/localization"; static constexpr char kSettingsChannel[] = "flutter/settings"; Engine::Engine(Delegate& delegate, - const blink::DartVM& vm, + blink::DartVM& vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, blink::TaskRunners task_runners, diff --git a/shell/common/engine.h b/shell/common/engine.h index e1fed0d683d61..46602cdea9fd6 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -39,7 +39,7 @@ class Engine final : public blink::RuntimeDelegate { }; Engine(Delegate& delegate, - const blink::DartVM& vm, + blink::DartVM& vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, blink::TaskRunners task_runners, diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 97385fab65f72..0da5126e53e3d 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -400,7 +400,7 @@ fml::WeakPtr Shell::GetPlatformView() { return platform_view_->GetWeakPtr(); } -const blink::DartVM& Shell::GetDartVM() const { +blink::DartVM& Shell::GetDartVM() const { return *vm_; } diff --git a/shell/common/shell.h b/shell/common/shell.h index 2a8caeb476583..75ab39052ce21 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -72,7 +72,7 @@ class Shell final : public PlatformView::Delegate, fml::WeakPtr GetPlatformView(); - const blink::DartVM& GetDartVM() const; + blink::DartVM& GetDartVM() const; bool IsSetup() const; diff --git a/testing/dart/isolate_name_server_test.dart b/testing/dart/isolate_name_server_test.dart new file mode 100644 index 0000000000000..4df83cf771b64 --- /dev/null +++ b/testing/dart/isolate_name_server_test.dart @@ -0,0 +1,135 @@ +// 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 'dart:isolate'; +import 'dart:ui'; + +import 'package:test/test.dart'; + +const kPortName = 'foobar'; +const kErrorCode = -1; +const kStartCode = 0; +const kCloseCode = 1; +const kDeletedCode = 2; + +void isolateSpawnEntrypoint(SendPort port) { + sendHelper(int code, [String message = '']) { + port.send([code, message]); + } + + SendPort shared = IsolateNameServer.lookupPortByName(kPortName); + if (shared == null) { + sendHelper(kErrorCode, 'Could not find port: $kPortName'); + return; + } + + // ack that the SendPort lookup was successful. + sendHelper(kStartCode); + + shared.send(kPortName); + sendHelper(kCloseCode); + + // We'll fail if the ReceivePort's callback is called more than once. Try to + // send another message to ensure we don't crash. + shared.send('garbage'); + + bool result = IsolateNameServer.removePortNameMapping(kPortName); + if (result) { + sendHelper(kDeletedCode); + } else { + sendHelper(kErrorCode, 'Was unable to remove mapping for $kPortName'); + } +} + +void main() { + tearDown(() { + IsolateNameServer.removePortNameMapping(kPortName); + }); + + test('simple isolate name server', () { + // Mapping for 'foobar' isn't set. Check these cases to ensure correct + // negative response. + expect(IsolateNameServer.lookupPortByName(kPortName), isNull); + expect(IsolateNameServer.removePortNameMapping(kPortName), isFalse); + + // Register a SendPort. + final receivePort = new ReceivePort(); + final sendPort = receivePort.sendPort; + expect(IsolateNameServer.registerPortWithName(sendPort, kPortName), isTrue); + expect(IsolateNameServer.lookupPortByName(kPortName), sendPort); + + // Check we can't register the same name twice. + final receivePort2 = new ReceivePort(); + final sendPort2 = receivePort2.sendPort; + expect( + IsolateNameServer.registerPortWithName(sendPort2, kPortName), isFalse); + expect(IsolateNameServer.lookupPortByName(kPortName), sendPort); + + // Remove the mapping. + expect(IsolateNameServer.removePortNameMapping(kPortName), isTrue); + expect(IsolateNameServer.lookupPortByName(kPortName), isNull); + + // Ensure registering a new port with the old name returns the new port. + expect( + IsolateNameServer.registerPortWithName(sendPort2, kPortName), isTrue); + expect(IsolateNameServer.lookupPortByName(kPortName), sendPort2); + + // Close so the test runner doesn't hang. + receivePort.close(); + receivePort2.close(); + }); + + test('isolate name server null args', () { + // None of our IsolateNameServer methods should accept null. + expect(() => IsolateNameServer.lookupPortByName(null), throwsArgumentError); + expect(() => IsolateNameServer.registerPortWithName(null, 'abc'), + throwsArgumentError); + final receivePort = new ReceivePort(); + final sendPort = receivePort.sendPort; + expect(() => IsolateNameServer.registerPortWithName(sendPort, null), + throwsArgumentError); + expect(() => IsolateNameServer.removePortNameMapping(null), + throwsArgumentError); + receivePort.close(); + }); + + test('isolate name server multi-isolate', () async { + // Register our send port with the name server. + final receivePort = new ReceivePort(); + final sendPort = receivePort.sendPort; + expect(IsolateNameServer.registerPortWithName(sendPort, kPortName), isTrue); + + // Test driver. + final testReceivePort = new ReceivePort(); + testReceivePort.listen(expectAsync1((List response) { + final int code = response[0]; + final String message = response[1]; + switch (code) { + case kStartCode: + break; + case kCloseCode: + receivePort.close(); + break; + case kDeletedCode: + expect(IsolateNameServer.lookupPortByName(kPortName), isNull); + // Test is done, close the last ReceivePort. + testReceivePort.close(); + break; + case kErrorCode: + throw message; + default: + throw 'UNREACHABLE'; + } + }, count: 3)); + + receivePort.listen(expectAsync1((message) { + // If we don't get this message, we timeout and fail. + expect(message, kPortName); + })); + + // Run the test. + await Isolate.spawn(isolateSpawnEntrypoint, testReceivePort.sendPort); + }); +} diff --git a/testing/run_tests.sh b/testing/run_tests.sh index 73579c97160c3..26e9401d43d91 100755 --- a/testing/run_tests.sh +++ b/testing/run_tests.sh @@ -4,7 +4,6 @@ set -ex out/host_debug_unopt/fxl_unittests out/host_debug_unopt/synchronization_unittests -out/host_debug_unopt/wtf_unittests flutter/travis/analyze.sh diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index a66035fa469c5..222cc2f4523e4 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -490,6 +490,7 @@ LIBRARY: engine ORIGIN: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_locations.dart +FILE: ../../../flutter/lib/ui/isolate_name_server.dart FILE: ../../../flutter/lib/ui/painting/image_encoding.cc FILE: ../../../flutter/lib/ui/painting/image_encoding.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h @@ -580,6 +581,10 @@ FILE: ../../../flutter/fml/platform/win/wstring_conversion.h FILE: ../../../flutter/fml/unique_fd.cc FILE: ../../../flutter/fml/unique_fd.h FILE: ../../../flutter/fml/unique_object.h +FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server.cc +FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server.h +FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server_natives.cc +FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h FILE: ../../../flutter/shell/common/isolate_configuration.cc FILE: ../../../flutter/shell/common/isolate_configuration.h FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc From acf85a0460a393e9866f478bd782847c5bdbf31b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 13 Jun 2018 15:20:58 -0400 Subject: [PATCH 0574/1190] Roll src/third_party/skia dc89f192c853..e4b900bfd92f (12 commits) (#5520) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c3128e6ea9e13..ede3531677c31 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'dc89f192c853df57c71c42407c193571c2e1008a', + 'skia_revision': 'e4b900bfd92f7f2c387b13713f850af5547a5a46', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d3f63b7fd8ff9..87493f82ed503 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4107747cb2f60224bb85f8d2733ee751 +Signature: feb007cfbcf43fe8e36a11fcade31746 UNUSED LICENSES: From 2983e5db4b2977dee32ccc29a409490344b2245e Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Wed, 13 Jun 2018 12:59:45 -0700 Subject: [PATCH 0575/1190] Pinned versions of package:test and package:path for testing/dart tests (#5522) --- testing/dart/pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/dart/pubspec.yaml b/testing/dart/pubspec.yaml index 4e8a7f05bb70a..69b94607d1a7d 100644 --- a/testing/dart/pubspec.yaml +++ b/testing/dart/pubspec.yaml @@ -1,4 +1,4 @@ name: engine_tests dependencies: - test: any - path: any + test: 0.12.40 + path: 1.6.0 From efd666334479dcb8393c1b78bd5e9faddadd1dbc Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 13 Jun 2018 14:28:21 -0700 Subject: [PATCH 0576/1190] Maintain a FontCollection for each engine instance instead of a process-wide singleton (#5521) --- lib/ui/BUILD.gn | 3 ++- lib/ui/text/font_collection.cc | 7 ------- lib/ui/text/font_collection.h | 8 +++----- lib/ui/text/paragraph_builder.cc | 12 +++++++----- lib/ui/window/window.h | 2 ++ runtime/runtime_controller.cc | 4 ++++ runtime/runtime_controller.h | 4 ++++ runtime/runtime_delegate.h | 3 +++ shell/common/BUILD.gn | 2 +- shell/common/engine.cc | 8 ++++++-- shell/common/engine.h | 5 +++++ 11 files changed, 37 insertions(+), 21 deletions(-) diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 027159fb897a9..b90a8514a8dcc 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -96,7 +96,6 @@ source_set("ui") { "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/runtime:test_font", - "$flutter_root/third_party/txt", "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", @@ -107,4 +106,6 @@ source_set("ui") { if (is_fuchsia) { deps += [ "//topaz/public/dart-pkg/zircon" ] } + + public_deps = ["$flutter_root/third_party/txt"] } diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index 248468cc9701d..d45a2d92c33ae 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -16,13 +16,6 @@ namespace blink { -FontCollection& FontCollection::ForProcess() { - static std::once_flag once = {}; - static FontCollection* gCollection = nullptr; - std::call_once(once, []() { gCollection = new FontCollection(); }); - return *gCollection; -} - FontCollection::FontCollection() : collection_(std::make_shared()) { collection_->SetDefaultFontManager(SkFontMgr::RefDefault()); diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index ea9c2f46a96a0..62c94ffd8deb4 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -17,7 +17,9 @@ namespace blink { class FontCollection { public: - static FontCollection& ForProcess(); + FontCollection(); + + ~FontCollection(); std::shared_ptr GetFontCollection() const; @@ -28,10 +30,6 @@ class FontCollection { private: std::shared_ptr collection_; - FontCollection(); - - ~FontCollection(); - FXL_DISALLOW_COPY_AND_ASSIGN(FontCollection); }; diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index c9b896294c59c..80cc817c1bd60 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -8,6 +8,7 @@ #include "flutter/common/task_runners.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/window/window.h" #include "flutter/third_party/txt/src/txt/font_style.h" #include "flutter/third_party/txt/src/txt/font_weight.h" #include "flutter/third_party/txt/src/txt/paragraph_style.h" @@ -110,8 +111,8 @@ fxl::RefPtr ParagraphBuilder::create( double lineHeight, const std::u16string& ellipsis, const std::string& locale) { - return fxl::MakeRefCounted( - encoded, fontFamily, fontSize, lineHeight, ellipsis, locale); + return fxl::MakeRefCounted(encoded, fontFamily, fontSize, + lineHeight, ellipsis, locale); } ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, @@ -155,8 +156,10 @@ ParagraphBuilder::ParagraphBuilder(tonic::Int32List& encoded, style.locale = locale; } + FontCollection& font_collection = + UIDartState::Current()->window()->client()->GetFontCollection(); m_paragraphBuilder = std::make_unique( - style, blink::FontCollection::ForProcess().GetFontCollection()); + style, font_collection.GetFontCollection()); } // namespace blink ParagraphBuilder::~ParagraphBuilder() = default; @@ -207,8 +210,7 @@ void ParagraphBuilder::pushStyle(tonic::Int32List& encoded, static_cast(encoded[tsFontWeightIndex]); if (mask & tsFontStyleMask) - style.font_style = - static_cast(encoded[tsFontStyleIndex]); + style.font_style = static_cast(encoded[tsFontStyleIndex]); if (mask & tsFontFamilyMask) style.font_family = fontFamily; diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index 2feeccb65f9cc..892812a363a7d 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -20,6 +20,7 @@ class DartLibraryNatives; } // namespace tonic namespace blink { +class FontCollection; class Scene; Dart_Handle ToByteData(const std::vector& buffer); @@ -31,6 +32,7 @@ class WindowClient { virtual void Render(Scene* scene) = 0; virtual void UpdateSemantics(SemanticsUpdate* update) = 0; virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; + virtual FontCollection& GetFontCollection() = 0; protected: virtual ~WindowClient(); diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 18eaaebad68bc..c1acc813f320c 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -249,6 +249,10 @@ void RuntimeController::HandlePlatformMessage( client_.HandlePlatformMessage(std::move(message)); } +FontCollection& RuntimeController::GetFontCollection() { + return client_.GetFontCollection(); +} + Dart_Port RuntimeController::GetMainPort() { return root_isolate_ ? root_isolate_->main_port() : ILLEGAL_PORT; } diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 599d9c73b274c..07ec70a912164 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -10,6 +10,7 @@ #include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/lib/ui/ui_dart_state.h" +#include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/window.h" #include "flutter/runtime/dart_vm.h" @@ -124,6 +125,9 @@ class RuntimeController final : public WindowClient { // |blink::WindowClient| void HandlePlatformMessage(fxl::RefPtr message) override; + // |blink::WindowClient| + FontCollection& GetFontCollection() override; + FXL_DISALLOW_COPY_AND_ASSIGN(RuntimeController); }; diff --git a/runtime/runtime_delegate.h b/runtime/runtime_delegate.h index c6d6c0a92b2b4..75e89e62e44ef 100644 --- a/runtime/runtime_delegate.h +++ b/runtime/runtime_delegate.h @@ -10,6 +10,7 @@ #include "flutter/flow/layers/layer_tree.h" #include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/window/platform_message.h" #include "third_party/dart/runtime/include/dart_api.h" @@ -27,6 +28,8 @@ class RuntimeDelegate { virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; + virtual FontCollection& GetFontCollection() = 0; + protected: virtual ~RuntimeDelegate(); }; diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 02e5f12b7d01e..28718a96062e3 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -100,7 +100,6 @@ source_set("common") { "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/synchronization", - "$flutter_root/third_party/txt", "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", "//third_party/rapidjson", @@ -109,6 +108,7 @@ source_set("common") { ] public_deps = [ + "$flutter_root/third_party/txt", "//topaz/lib/tonic", ] diff --git a/shell/common/engine.cc b/shell/common/engine.cc index d2f6e57807200..8689789fa4bed 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -87,9 +87,9 @@ bool Engine::UpdateAssetManager( // Using libTXT as the text engine. if (settings_.use_test_fonts) { - blink::FontCollection::ForProcess().RegisterTestFonts(); + font_collection_.RegisterTestFonts(); } else { - blink::FontCollection::ForProcess().RegisterFonts(*asset_manager_.get()); + font_collection_.RegisterFonts(*asset_manager_.get()); } return true; @@ -377,6 +377,10 @@ void Engine::HandlePlatformMessage( } } +blink::FontCollection& Engine::GetFontCollection() { + return font_collection_; +} + void Engine::HandleAssetPlatformMessage( fxl::RefPtr message) { fxl::RefPtr response = message->response(); diff --git a/shell/common/engine.h b/shell/common/engine.h index 46602cdea9fd6..a6ac5b413f2f6 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -11,6 +11,7 @@ #include "flutter/assets/asset_manager.h" #include "flutter/common/task_runners.h" #include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/viewport_metrics.h" #include "flutter/runtime/dart_vm.h" @@ -109,6 +110,7 @@ class Engine final : public blink::RuntimeDelegate { fml::RefPtr asset_manager_; bool activity_running_; bool have_surface_; + blink::FontCollection font_collection_; fml::WeakPtrFactory weak_factory_; // |blink::RuntimeDelegate| @@ -124,6 +126,9 @@ class Engine final : public blink::RuntimeDelegate { void HandlePlatformMessage( fxl::RefPtr message) override; + // |blink::RuntimeDelegate| + blink::FontCollection& GetFontCollection() override; + void StopAnimator(); void StartAnimatorIfPossible(); From 408f1e5c2afbaf45daabee6b5461dbea447199aa Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 13 Jun 2018 15:33:59 -0700 Subject: [PATCH 0577/1190] libtxt: update the unit tests and benchmarks (#5523) * pass a locale to GetMinikinFontCollectionForFamily * provide the ICU data file path * loosen checks based on the Minikin LineBreaker's line widths (LineBreaker widths do not exactly match the advances calculated during layout) --- .../txt/benchmarks/paragraph_benchmarks.cc | 5 +- .../txt/benchmarks/txt_run_all_benchmarks.cc | 2 +- third_party/txt/tests/paragraph_unittests.cc | 69 ++++++++++--------- .../txt/tests/txt_run_all_unittests.cc | 2 +- 4 files changed, 43 insertions(+), 35 deletions(-) diff --git a/third_party/txt/benchmarks/paragraph_benchmarks.cc b/third_party/txt/benchmarks/paragraph_benchmarks.cc index cc48fc42dc0fa..0861f53f5be64 100644 --- a/third_party/txt/benchmarks/paragraph_benchmarks.cc +++ b/third_party/txt/benchmarks/paragraph_benchmarks.cc @@ -373,7 +373,7 @@ static void BM_ParagraphMinikinDoLayout(benchmark::State& state) { paint.wordSpacing = text_style.word_spacing; auto collection = GetTestFontCollection()->GetMinikinFontCollectionForFamily( - text_style.font_family); + text_style.font_family, "en-US"); while (state.KeepRunning()) { minikin::Layout layout; @@ -413,7 +413,8 @@ static void BM_ParagraphMinikinAddStyleRun(benchmark::State& state) { while (state.KeepRunning()) { for (int i = 0; i < 20; ++i) { breaker.addStyleRun( - &paint, font_collection->GetMinikinFontCollectionForFamily("Roboto"), + &paint, + font_collection->GetMinikinFontCollectionForFamily("Roboto", "en-US"), font, state.range(0) / 20 * i, state.range(0) / 20 * (i + 1), false); } } diff --git a/third_party/txt/benchmarks/txt_run_all_benchmarks.cc b/third_party/txt/benchmarks/txt_run_all_benchmarks.cc index d2de9ae7cd6c6..98b6c68fa6ac2 100644 --- a/third_party/txt/benchmarks/txt_run_all_benchmarks.cc +++ b/third_party/txt/benchmarks/txt_run_all_benchmarks.cc @@ -35,7 +35,7 @@ int main(int argc, char** argv) { } FXL_DCHECK(txt::GetFontDir().length() > 0); - fml::icu::InitializeICU(); + fml::icu::InitializeICU("icudtl.dat"); ::benchmark::RunSpecifiedBenchmarks(); } diff --git a/third_party/txt/tests/paragraph_unittests.cc b/third_party/txt/tests/paragraph_unittests.cc index 143ee492ea6c6..13027f90d4f18 100644 --- a/third_party/txt/tests/paragraph_unittests.cc +++ b/third_party/txt/tests/paragraph_unittests.cc @@ -419,41 +419,46 @@ TEST_F(ParagraphTest, DISABLE_ON_WINDOWS(RightAlignParagraph)) { ASSERT_TRUE(paragraph->records_[0].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[0].offset().y(), expected_y); expected_y += 30; - ASSERT_DOUBLE_EQ( + ASSERT_NEAR( paragraph->records_[0].offset().x(), paragraph->width_ - - paragraph->breaker_.getWidths()[paragraph->records_[0].line()]); + paragraph->breaker_.getWidths()[paragraph->records_[0].line()], + 2.0); ASSERT_TRUE(paragraph->records_[1].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[1].offset().y(), expected_y); expected_y += 30; - ASSERT_DOUBLE_EQ( + ASSERT_NEAR( paragraph->records_[1].offset().x(), paragraph->width_ - - paragraph->breaker_.getWidths()[paragraph->records_[1].line()]); + paragraph->breaker_.getWidths()[paragraph->records_[1].line()], + 2.0); ASSERT_TRUE(paragraph->records_[2].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[2].offset().y(), expected_y); expected_y += 30; - ASSERT_DOUBLE_EQ( + ASSERT_NEAR( paragraph->records_[2].offset().x(), paragraph->width_ - - paragraph->breaker_.getWidths()[paragraph->records_[2].line()]); + paragraph->breaker_.getWidths()[paragraph->records_[2].line()], + 2.0); ASSERT_TRUE(paragraph->records_[3].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[3].offset().y(), expected_y); expected_y += 30 * 10; - ASSERT_DOUBLE_EQ( + ASSERT_NEAR( paragraph->records_[3].offset().x(), paragraph->width_ - - paragraph->breaker_.getWidths()[paragraph->records_[3].line()]); + paragraph->breaker_.getWidths()[paragraph->records_[3].line()], + 2.0); ASSERT_TRUE(paragraph->records_[13].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[13].offset().y(), expected_y); - ASSERT_DOUBLE_EQ( + ASSERT_NEAR( paragraph->records_[13].offset().x(), paragraph->width_ - - paragraph->breaker_.getWidths()[paragraph->records_[13].line()]); + paragraph->breaker_.getWidths()[paragraph->records_[13].line()], + 2.0); ASSERT_EQ(paragraph_style.text_align, paragraph->GetParagraphStyle().text_align); @@ -523,45 +528,47 @@ TEST_F(ParagraphTest, DISABLE_ON_WINDOWS(CenterAlignParagraph)) { ASSERT_TRUE(paragraph->records_[0].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[0].offset().y(), expected_y); expected_y += 30; - ASSERT_DOUBLE_EQ( - paragraph->records_[0].offset().x(), - (paragraph->width_ - - paragraph->breaker_.getWidths()[paragraph->records_[0].line()]) / - 2); + ASSERT_NEAR(paragraph->records_[0].offset().x(), + (paragraph->width_ - + paragraph->breaker_.getWidths()[paragraph->records_[0].line()]) / + 2, + 2.0); ASSERT_TRUE(paragraph->records_[1].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[1].offset().y(), expected_y); expected_y += 30; - ASSERT_DOUBLE_EQ( - paragraph->records_[1].offset().x(), - (paragraph->width_ - - paragraph->breaker_.getWidths()[paragraph->records_[1].line()]) / - 2); + ASSERT_NEAR(paragraph->records_[1].offset().x(), + (paragraph->width_ - + paragraph->breaker_.getWidths()[paragraph->records_[1].line()]) / + 2, + 2.0); ASSERT_TRUE(paragraph->records_[2].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[2].offset().y(), expected_y); expected_y += 30; - ASSERT_EQ(paragraph->records_[2].offset().x(), - (paragraph->width_ - - paragraph->breaker_.getWidths()[paragraph->records_[2].line()]) / - 2); + ASSERT_NEAR(paragraph->records_[2].offset().x(), + (paragraph->width_ - + paragraph->breaker_.getWidths()[paragraph->records_[2].line()]) / + 2, + 2.0); ASSERT_TRUE(paragraph->records_[3].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[3].offset().y(), expected_y); expected_y += 30 * 10; - ASSERT_DOUBLE_EQ( - paragraph->records_[3].offset().x(), - (paragraph->width_ - - paragraph->breaker_.getWidths()[paragraph->records_[3].line()]) / - 2); + ASSERT_NEAR(paragraph->records_[3].offset().x(), + (paragraph->width_ - + paragraph->breaker_.getWidths()[paragraph->records_[3].line()]) / + 2, + 2.0); ASSERT_TRUE(paragraph->records_[13].style().equals(text_style)); ASSERT_DOUBLE_EQ(paragraph->records_[13].offset().y(), expected_y); - ASSERT_DOUBLE_EQ( + ASSERT_NEAR( paragraph->records_[13].offset().x(), (paragraph->width_ - paragraph->breaker_.getWidths()[paragraph->records_[13].line()]) / - 2); + 2, + 2.0); ASSERT_EQ(paragraph_style.text_align, paragraph->GetParagraphStyle().text_align); diff --git a/third_party/txt/tests/txt_run_all_unittests.cc b/third_party/txt/tests/txt_run_all_unittests.cc index e24fccdf781ac..5a059c02db82d 100644 --- a/third_party/txt/tests/txt_run_all_unittests.cc +++ b/third_party/txt/tests/txt_run_all_unittests.cc @@ -36,7 +36,7 @@ int main(int argc, char** argv) { } FXL_DCHECK(txt::GetFontDir().length() > 0); - fml::icu::InitializeICU(); + fml::icu::InitializeICU("icudtl.dat"); SkGraphics::Init(); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); From 53cb9c4d5c7d4060548bf57b98e39d8e066a8715 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 13 Jun 2018 18:45:58 -0400 Subject: [PATCH 0578/1190] Roll src/third_party/skia e4b900bfd92f..082a7a701f30 (8 commits) (#5524) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ede3531677c31..9a0dc294d9c16 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e4b900bfd92f7f2c387b13713f850af5547a5a46', + 'skia_revision': '082a7a701f30763c4c5cd722cd5a02d4b03da469', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 87493f82ed503..0ec3db4a7a34b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: feb007cfbcf43fe8e36a11fcade31746 +Signature: 08151ad39429a83f05dab173ac289461 UNUSED LICENSES: From fca3cb8ca975dd894f195d75f40c0c06bb11c396 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 13 Jun 2018 22:10:58 -0400 Subject: [PATCH 0579/1190] Roll src/third_party/skia 082a7a701f30..657edbede4e3 (2 commits) (#5525) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9a0dc294d9c16..061528bfd1b01 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '082a7a701f30763c4c5cd722cd5a02d4b03da469', + 'skia_revision': '657edbede4e33f9389a02bfccf7154bd3f19ec1e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 0ec3db4a7a34b..f828c23b72034 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 08151ad39429a83f05dab173ac289461 +Signature: 117e56ea69fab1b98341be8f03181c25 UNUSED LICENSES: From 64d43b6ac5a88acc1e20caf2874768d126d357f7 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 14 Jun 2018 01:36:58 -0400 Subject: [PATCH 0580/1190] Roll src/third_party/skia 657edbede4e3..28252da5cf0a (1 commits) (#5526) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 061528bfd1b01..b78eb3c492da2 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '657edbede4e33f9389a02bfccf7154bd3f19ec1e', + 'skia_revision': '28252da5cf0a37a4e93778d338945575e634ea70', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f828c23b72034..55f53cf7ff3c9 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 117e56ea69fab1b98341be8f03181c25 +Signature: e032eada9a50de28c2af6bafbc9f10aa UNUSED LICENSES: From 4609483f80120742fe0eea2f37d8f8ce7bcc1078 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 14 Jun 2018 05:00:58 -0400 Subject: [PATCH 0581/1190] Roll src/third_party/skia 28252da5cf0a..b57a861f183b (2 commits) (#5527) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b78eb3c492da2..7eafbb250503e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '28252da5cf0a37a4e93778d338945575e634ea70', + 'skia_revision': 'b57a861f183bfc6ae251297e3173faff0dc262f9', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 55f53cf7ff3c9..b3f036116dacb 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e032eada9a50de28c2af6bafbc9f10aa +Signature: 0079c4753444c0a98b48f07a4e825a2a UNUSED LICENSES: From 7f58d47b34a60e4ac8c7e8207d62df319b54409f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 14 Jun 2018 08:26:58 -0400 Subject: [PATCH 0582/1190] Roll src/third_party/skia b57a861f183b..f018b7d607a0 (1 commits) (#5528) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7eafbb250503e..a533fdbd238c7 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b57a861f183bfc6ae251297e3173faff0dc262f9', + 'skia_revision': 'f018b7d607a0859e2d6078578a9632144694072f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b3f036116dacb..c271876e604ab 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0079c4753444c0a98b48f07a4e825a2a +Signature: 5a12ea7e0d33d09cc30b06a45614803b UNUSED LICENSES: From dd49f139f069241b9c8659520d9f37010669970e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 14 Jun 2018 11:51:58 -0400 Subject: [PATCH 0583/1190] Roll src/third_party/skia f018b7d607a0..5ff4fb286ce3 (14 commits) (#5529) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a533fdbd238c7..f935a61446b55 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f018b7d607a0859e2d6078578a9632144694072f', + 'skia_revision': '5ff4fb286ce3557a811fbaaaf0600f7cab1a435c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c271876e604ab..0facdf8e3e95d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5a12ea7e0d33d09cc30b06a45614803b +Signature: 85135095151a002f17673bcdc3980091 UNUSED LICENSES: @@ -17182,6 +17182,7 @@ FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkMacros.h FILE: ../../../third_party/skia/include/private/SkSafe32.h +FILE: ../../../third_party/skia/include/private/SkTo.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go FILE: ../../../third_party/skia/modules/skjson/include/SkJSON.h FILE: ../../../third_party/skia/modules/skjson/src/SkJSON.cpp From f79fab1c97a2af91543984bcd656cb60b7ceb2db Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 14 Jun 2018 12:17:50 -0700 Subject: [PATCH 0584/1190] [dart] Roll Dart to 4b2d60cb18e418c5cb92cf22d2d959d8b70142a3 (#5530) --- DEPS | 8 ++++---- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index f935a61446b55..528bf7679a218 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '31e3441816c023fec5c34eefe33862f03a5d16ba', + 'dart_revision': '4b2d60cb18e418c5cb92cf22d2d959d8b70142a3', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', @@ -41,7 +41,7 @@ vars = { 'dart_boringssl_rev': '189270cd190267f5bd60cfe8f8ce7a61d07ba6f4', 'dart_charcode_tag': 'v1.1.1', 'dart_cli_util_tag': '0.1.2+1', - 'dart_collection_tag': '1.14.9', + 'dart_collection_tag': '1.14.10', 'dart_convert_tag': '2.0.1', 'dart_crypto_tag': '2.0.2+1', 'dart_csslib_tag': '0.14.1', @@ -58,7 +58,7 @@ vars = { 'dart_http_throttle_tag': '1.0.2', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.51', + 'dart_linter_tag': '0.1.53', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '2.0.0', 'dart_matcher_tag': '0.12.1+4', @@ -73,7 +73,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '7bdcf4e4de85a7a8c7a322511b8198f1b6cb0a73', + 'dart_pub_rev': '881a0c3fbe63af07dd043b3f5e6cbe74eacb377c', 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 0facdf8e3e95d..b47c5ebde99c7 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 85135095151a002f17673bcdc3980091 +Signature: f4ef4224785f85f49cb7b7e849799787 UNUSED LICENSES: From 1b055e5dce5b998a010eb26bed2aea6485e61866 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 14 Jun 2018 15:42:39 -0400 Subject: [PATCH 0585/1190] Roll src/third_party/skia 5ff4fb286ce3..e08ce40f4a56 (15 commits) (#5532) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 528bf7679a218..67594ce1fa6bd 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5ff4fb286ce3557a811fbaaaf0600f7cab1a435c', + 'skia_revision': 'e08ce40f4a569c692f6b3b74f3ba39ac1eddf269', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b47c5ebde99c7..6164743689c32 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f4ef4224785f85f49cb7b7e849799787 +Signature: ede469adf7a5b7f228614e322b91b29a UNUSED LICENSES: From 411be3be9a046f7716d49c98c7c4e9da19e2758c Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 14 Jun 2018 15:50:03 -0700 Subject: [PATCH 0586/1190] libtxt: hold a weak_ptr to the txt::FontCollection in the fallback provider given to Minikin (#5531) The txt::FontCollection contains a cache of minikin::FontCollection objects, which in turn hold a fallback provider that refers back to the txt::FontCollection. Using a weak_ptr in the fallback provider breaks the circular reference. --- third_party/txt/src/txt/font_collection.cc | 19 +++++++++++++++---- third_party/txt/src/txt/font_collection.h | 1 - 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index 0c2d49f07272a..0fee4c7f825f4 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -30,6 +30,12 @@ namespace txt { +namespace { + +const std::shared_ptr g_null_family; + +} // anonymous namespace + bool FontCollection::FamilyKey::operator==( const FontCollection::FamilyKey& other) const { return font_family == other.font_family && locale == other.locale; @@ -50,11 +56,16 @@ class TxtFallbackFontProvider virtual const std::shared_ptr& matchFallbackFont( uint32_t ch, std::string locale) { - return font_collection_->MatchFallbackFont(ch, locale); + std::shared_ptr fc = font_collection_.lock(); + if (fc) { + return fc->MatchFallbackFont(ch, locale); + } else { + return g_null_family; + } } private: - std::shared_ptr font_collection_; + std::weak_ptr font_collection_; }; FontCollection::FontCollection() : enable_font_fallback_(true) {} @@ -199,7 +210,7 @@ const std::shared_ptr& FontCollection::MatchFallbackFont( return GetFallbackFontFamily(manager, family_name); } - return null_family_; + return g_null_family; } const std::shared_ptr& @@ -213,7 +224,7 @@ FontCollection::GetFallbackFontFamily(const sk_sp& manager, std::shared_ptr minikin_family = CreateMinikinFontFamily(manager, family_name); if (!minikin_family) - return null_family_; + return g_null_family; auto insert_it = fallback_fonts_.insert(std::make_pair(family_name, minikin_family)); diff --git a/third_party/txt/src/txt/font_collection.h b/third_party/txt/src/txt/font_collection.h index dd91a2a951281..698eca17642a4 100644 --- a/third_party/txt/src/txt/font_collection.h +++ b/third_party/txt/src/txt/font_collection.h @@ -82,7 +82,6 @@ class FontCollection : public std::enable_shared_from_this { fallback_fonts_; std::unordered_map> fallback_fonts_for_locale_; - std::shared_ptr null_family_; bool enable_font_fallback_; std::vector> GetFontManagerOrder() const; From b8b2ff349b4d0cf1701cfa15baaa8f47065ba780 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 14 Jun 2018 19:07:16 -0400 Subject: [PATCH 0587/1190] Roll src/third_party/skia e08ce40f4a56..1986036f69f8 (8 commits) (#5537) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 67594ce1fa6bd..b3422fe9ec441 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e08ce40f4a569c692f6b3b74f3ba39ac1eddf269', + 'skia_revision': '1986036f69f81a52d390cc01899cd68d6b200e30', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 6164743689c32..4d05aff50b060 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ede469adf7a5b7f228614e322b91b29a +Signature: 1bc62460e1bd44ecdb1cc8c0d6f8442a UNUSED LICENSES: From c3c40cf958f01fc473ebfc94f7bc73fc878bc1f5 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 14 Jun 2018 16:13:56 -0700 Subject: [PATCH 0588/1190] Lazily load fonts that are embedded within the application (#5533) Previously the engine would load all embedded fonts listed in the app's font manifest during startup. This change creates a Skia font manager that is backed by the engine's AssetManager and can load embedded font assets on demand. --- lib/ui/BUILD.gn | 2 + lib/ui/text/asset_manager_font_provider.cc | 124 ++++++++++++++++++ lib/ui/text/asset_manager_font_provider.h | 79 +++++++++++ lib/ui/text/font_collection.cc | 36 +++-- lib/ui/text/font_collection.h | 2 +- shell/common/engine.cc | 2 +- third_party/txt/BUILD.gn | 28 ++-- .../txt/benchmarks/paint_record_benchmarks.cc | 2 +- .../txt/benchmarks/paragraph_benchmarks.cc | 2 +- .../paragraph_builder_benchmarks.cc | 2 +- .../txt/benchmarks/styled_runs_benchmarks.cc | 2 +- .../txt/benchmarks/txt_run_all_benchmarks.cc | 2 +- third_party/txt/benchmarks/utils.cc | 52 -------- .../txt/src/txt/asset_data_provider.cc | 73 ----------- third_party/txt/src/txt/asset_data_provider.h | 54 -------- third_party/txt/src/txt/asset_font_manager.cc | 18 ++- third_party/txt/src/txt/asset_font_manager.h | 6 +- .../txt/src/txt/asset_font_style_set.cc | 48 ------- .../txt/src/txt/asset_font_style_set.h | 44 ------- .../src/txt/directory_asset_data_provider.cc | 75 ----------- .../src/txt/directory_asset_data_provider.h | 25 ---- .../txt/font_asset_provider.h} | 34 ++--- third_party/txt/src/txt/test_font_manager.cc | 4 +- third_party/txt/src/txt/test_font_manager.h | 4 +- .../src/txt/typeface_font_asset_provider.cc | 118 +++++++++++++++++ .../src/txt/typeface_font_asset_provider.h | 84 ++++++++++++ .../txt/tests/font_collection_unittests.cc | 2 +- third_party/txt/tests/paragraph_unittests.cc | 2 +- third_party/txt/tests/render_test.cc | 8 +- .../txt/tests/txt_run_all_unittests.cc | 2 +- third_party/txt/tests/txt_test_utils.cc | 119 +++++++++++++++++ .../utils.h => tests/txt_test_utils.h} | 4 +- third_party/txt/tests/utils.h | 31 ----- travis/licenses_golden/licenses_flutter | 13 +- 34 files changed, 608 insertions(+), 495 deletions(-) create mode 100644 lib/ui/text/asset_manager_font_provider.cc create mode 100644 lib/ui/text/asset_manager_font_provider.h delete mode 100644 third_party/txt/benchmarks/utils.cc delete mode 100644 third_party/txt/src/txt/asset_data_provider.cc delete mode 100644 third_party/txt/src/txt/asset_data_provider.h delete mode 100644 third_party/txt/src/txt/asset_font_style_set.cc delete mode 100644 third_party/txt/src/txt/asset_font_style_set.h delete mode 100644 third_party/txt/src/txt/directory_asset_data_provider.cc delete mode 100644 third_party/txt/src/txt/directory_asset_data_provider.h rename third_party/txt/{tests/utils.cc => src/txt/font_asset_provider.h} (57%) create mode 100644 third_party/txt/src/txt/typeface_font_asset_provider.cc create mode 100644 third_party/txt/src/txt/typeface_font_asset_provider.h create mode 100644 third_party/txt/tests/txt_test_utils.cc rename third_party/txt/{benchmarks/utils.h => tests/txt_test_utils.h} (95%) delete mode 100644 third_party/txt/tests/utils.h diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index b90a8514a8dcc..c8f7e1fb21db4 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -58,6 +58,8 @@ source_set("ui") { "semantics/semantics_update.h", "semantics/semantics_update_builder.cc", "semantics/semantics_update_builder.h", + "text/asset_manager_font_provider.cc", + "text/asset_manager_font_provider.h", "text/font_collection.cc", "text/font_collection.h", "text/paragraph.cc", diff --git a/lib/ui/text/asset_manager_font_provider.cc b/lib/ui/text/asset_manager_font_provider.cc new file mode 100644 index 0000000000000..68cb4ac3a943b --- /dev/null +++ b/lib/ui/text/asset_manager_font_provider.cc @@ -0,0 +1,124 @@ +// 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. + +#include "flutter/lib/ui/text/asset_manager_font_provider.h" + +#include "lib/fxl/logging.h" +#include "third_party/skia/include/core/SkData.h" +#include "third_party/skia/include/core/SkStream.h" +#include "third_party/skia/include/core/SkString.h" +#include "third_party/skia/include/core/SkTypeface.h" + +namespace blink { + +namespace { + +void VectorReleaseProc(const void* ptr, void* context) { + delete reinterpret_cast*>(context); +} + +} // anonymous namespace + +AssetManagerFontProvider::AssetManagerFontProvider( + fml::RefPtr asset_manager) + : asset_manager_(asset_manager) {} + +AssetManagerFontProvider::~AssetManagerFontProvider() = default; + +// |FontAssetProvider| +size_t AssetManagerFontProvider::GetFamilyCount() const { + return family_names_.size(); +} + +// |FontAssetProvider| +std::string AssetManagerFontProvider::GetFamilyName(int index) const { + FXL_DCHECK(index >= 0 && static_cast(index) < family_names_.size()); + return family_names_[index]; +} + +// |FontAssetProvider| +SkFontStyleSet* AssetManagerFontProvider::MatchFamily( + const std::string& family_name) { + auto found = registered_families_.find(family_name); + if (found == registered_families_.end()) { + return nullptr; + } + return SkRef(&found->second); +} + +void AssetManagerFontProvider::RegisterAsset(std::string family_name, + std::string asset) { + auto family_it = registered_families_.find(family_name); + + if (family_it == registered_families_.end()) { + family_names_.push_back(family_name); + family_it = registered_families_ + .emplace(std::piecewise_construct, + std::forward_as_tuple(family_name), + std::forward_as_tuple(asset_manager_)) + .first; + } + + family_it->second.registerAsset(asset); +} + +AssetManagerFontStyleSet::AssetManagerFontStyleSet( + fml::RefPtr asset_manager) + : asset_manager_(asset_manager) {} + +AssetManagerFontStyleSet::~AssetManagerFontStyleSet() = default; + +void AssetManagerFontStyleSet::registerAsset(std::string asset) { + assets_.emplace_back(asset); +} + +int AssetManagerFontStyleSet::count() { + return assets_.size(); +} + +void AssetManagerFontStyleSet::getStyle(int index, + SkFontStyle*, + SkString* style) { + FXL_DCHECK(false); +} + +SkTypeface* AssetManagerFontStyleSet::createTypeface(int i) { + size_t index = i; + if (index >= assets_.size()) + return nullptr; + + TypefaceAsset& asset = assets_[index]; + if (!asset.typeface) { + std::unique_ptr> asset_buf = + std::make_unique>(); + if (!asset_manager_->GetAsBuffer(asset.asset, asset_buf.get())) + return nullptr; + + std::vector* asset_buf_ptr = asset_buf.release(); + sk_sp asset_data = + SkData::MakeWithProc(asset_buf_ptr->data(), asset_buf_ptr->size(), + VectorReleaseProc, asset_buf_ptr); + std::unique_ptr stream = SkMemoryStream::Make(asset_data); + + // Ownership of the stream is transferred. + asset.typeface = SkTypeface::MakeFromStream(stream.release()); + if (!asset.typeface) + return nullptr; + } + + return SkRef(asset.typeface.get()); +} + +SkTypeface* AssetManagerFontStyleSet::matchStyle(const SkFontStyle& pattern) { + if (assets_.empty()) + return nullptr; + + for (const TypefaceAsset& asset : assets_) + if (asset.typeface && asset.typeface->fontStyle() == pattern) + return SkRef(asset.typeface.get()); + + return SkRef(assets_[0].typeface.get()); +} + +} // namespace blink diff --git a/lib/ui/text/asset_manager_font_provider.h b/lib/ui/text/asset_manager_font_provider.h new file mode 100644 index 0000000000000..c0450c83ccb09 --- /dev/null +++ b/lib/ui/text/asset_manager_font_provider.h @@ -0,0 +1,79 @@ +// 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. + +#ifndef FLUTTER_LIB_UI_TEXT_ASSET_MANAGER_FONT_PROVIDER_H_ +#define FLUTTER_LIB_UI_TEXT_ASSET_MANAGER_FONT_PROVIDER_H_ + +#include +#include +#include + +#include "flutter/assets/asset_manager.h" +#include "lib/fxl/macros.h" +#include "third_party/skia/include/ports/SkFontMgr.h" +#include "txt/font_asset_provider.h" + +namespace blink { + +class AssetManagerFontStyleSet : public SkFontStyleSet { + public: + AssetManagerFontStyleSet(fml::RefPtr asset_manager); + + ~AssetManagerFontStyleSet() override; + + void registerAsset(std::string asset); + + // |SkFontStyleSet| + int count() override; + + // |SkFontStyleSet| + void getStyle(int index, SkFontStyle*, SkString* style) override; + + // |SkFontStyleSet| + SkTypeface* createTypeface(int index) override; + + // |SkFontStyleSet| + SkTypeface* matchStyle(const SkFontStyle& pattern) override; + + private: + fml::RefPtr asset_manager_; + + struct TypefaceAsset { + TypefaceAsset(std::string a) : asset(std::move(a)) {} + std::string asset; + sk_sp typeface; + }; + std::vector assets_; + + FXL_DISALLOW_COPY_AND_ASSIGN(AssetManagerFontStyleSet); +}; + +class AssetManagerFontProvider : public txt::FontAssetProvider { + public: + AssetManagerFontProvider(fml::RefPtr asset_manager); + ~AssetManagerFontProvider() override; + + void RegisterAsset(std::string family_name, std::string asset); + + // |FontAssetProvider| + size_t GetFamilyCount() const override; + + // |FontAssetProvider| + std::string GetFamilyName(int index) const override; + + // |FontAssetProvider| + SkFontStyleSet* MatchFamily(const std::string& family_name) override; + + private: + fml::RefPtr asset_manager_; + std::unordered_map + registered_families_; + std::vector family_names_; + + FXL_DISALLOW_COPY_AND_ASSIGN(AssetManagerFontProvider); +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_TEXT_ASSET_MANAGER_FONT_PROVIDER_H_ diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index d45a2d92c33ae..f0c0f7d699a8d 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -6,13 +6,16 @@ #include +#include "flutter/lib/ui/text/asset_manager_font_provider.h" #include "flutter/runtime/test_font_data.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/rapidjson.h" #include "third_party/skia/include/core/SkStream.h" +#include "third_party/skia/include/core/SkTypeface.h" #include "third_party/skia/include/ports/SkFontMgr.h" #include "txt/asset_font_manager.h" #include "txt/test_font_manager.h" +#include "txt/typeface_font_asset_provider.h" namespace blink { @@ -27,9 +30,9 @@ std::shared_ptr FontCollection::GetFontCollection() const { return collection_; } -void FontCollection::RegisterFonts(const AssetManager& asset_manager) { +void FontCollection::RegisterFonts(fml::RefPtr asset_manager) { std::vector manifest_data; - if (!asset_manager.GetAsBuffer("FontManifest.json", &manifest_data)) { + if (!asset_manager->GetAsBuffer("FontManifest.json", &manifest_data)) { FXL_DLOG(WARNING) << "Could not find the font manifest in the asset store."; return; } @@ -53,7 +56,8 @@ void FontCollection::RegisterFonts(const AssetManager& asset_manager) { return; } - auto font_asset_data_provider = std::make_unique(); + auto font_provider = + std::make_unique(asset_manager); for (const auto& family : document.GetArray()) { auto family_name = family.FindMember("family"); @@ -78,37 +82,27 @@ void FontCollection::RegisterFonts(const AssetManager& asset_manager) { } // TODO: Handle weights and styles. - std::vector font_data; - if (asset_manager.GetAsBuffer(font_asset->value.GetString(), - &font_data)) { - // The data must be copied because it needs to be moved into the - // typeface as a stream. - auto data = - SkMemoryStream::MakeCopy(font_data.data(), font_data.size()); - // Ownership of the stream is transferred. - auto typeface = SkTypeface::MakeFromStream(data.release()); - font_asset_data_provider->RegisterTypeface( - std::move(typeface), family_name->value.GetString()); - } + font_provider->RegisterAsset( + family_name->value.GetString(), font_asset->value.GetString()); } } collection_->SetAssetFontManager( - sk_make_sp(std::move(font_asset_data_provider))); + sk_make_sp(std::move(font_provider))); } void FontCollection::RegisterTestFonts() { sk_sp test_typeface = SkTypeface::MakeFromStream(GetTestFontData().release()); - std::unique_ptr asset_data_provider = - std::make_unique(); + std::unique_ptr font_provider = + std::make_unique(); - asset_data_provider->RegisterTypeface(std::move(test_typeface), - GetTestFontFamilyName()); + font_provider->RegisterTypeface(std::move(test_typeface), + GetTestFontFamilyName()); collection_->SetTestFontManager(sk_make_sp( - std::move(asset_data_provider), GetTestFontFamilyName())); + std::move(font_provider), GetTestFontFamilyName())); collection_->DisableFontFallback(); } diff --git a/lib/ui/text/font_collection.h b/lib/ui/text/font_collection.h index 62c94ffd8deb4..02cca0bb51724 100644 --- a/lib/ui/text/font_collection.h +++ b/lib/ui/text/font_collection.h @@ -23,7 +23,7 @@ class FontCollection { std::shared_ptr GetFontCollection() const; - void RegisterFonts(const AssetManager& asset_manager); + void RegisterFonts(fml::RefPtr asset_manager); void RegisterTestFonts(); diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 8689789fa4bed..de3fd23489953 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -89,7 +89,7 @@ bool Engine::UpdateAssetManager( if (settings_.use_test_fonts) { font_collection_.RegisterTestFonts(); } else { - font_collection_.RegisterFonts(*asset_manager_.get()); + font_collection_.RegisterFonts(asset_manager_); } return true; diff --git a/third_party/txt/BUILD.gn b/third_party/txt/BUILD.gn index 0cd1fff5ac506..572697af4e386 100644 --- a/third_party/txt/BUILD.gn +++ b/third_party/txt/BUILD.gn @@ -64,14 +64,9 @@ source_set("txt") { "src/minikin/SparseBitSet.h", "src/minikin/WordBreaker.cpp", "src/minikin/WordBreaker.h", - "src/txt/asset_data_provider.cc", - "src/txt/asset_data_provider.h", "src/txt/asset_font_manager.cc", "src/txt/asset_font_manager.h", - "src/txt/asset_font_style_set.cc", - "src/txt/asset_font_style_set.h", - "src/txt/directory_asset_data_provider.cc", - "src/txt/directory_asset_data_provider.h", + "src/txt/font_asset_provider.h", "src/txt/font_collection.cc", "src/txt/font_collection.h", "src/txt/font_skia.cc", @@ -96,6 +91,8 @@ source_set("txt") { "src/txt/text_decoration.h", "src/txt/text_style.cc", "src/txt/text_style.h", + "src/txt/typeface_font_asset_provider.cc", + "src/txt/typeface_font_asset_provider.h", "src/utils/JenkinsHash.cpp", "src/utils/JenkinsHash.h", "src/utils/LruCache.h", @@ -133,6 +130,19 @@ txt_common_executable_deps = [ "$flutter_root/fml", # For ICU initialization. ] +source_set("txt_test_utils") { + sources = [ + "tests/txt_test_utils.cc", + "tests/txt_test_utils.h", + ] + + deps = [ + ":txt", + "//garnet/public/lib/fxl", + "//third_party/skia", + ] +} + executable("txt_unittests") { testonly = true @@ -155,8 +165,6 @@ executable("txt_unittests") { "tests/render_test.cc", "tests/render_test.h", "tests/txt_run_all_unittests.cc", - "tests/utils.cc", - "tests/utils.h", # These tests require static fixtures. # "tests/FontCollectionItemizeTest.cpp", @@ -178,6 +186,7 @@ executable("txt_unittests") { deps = [ ":txt", + ":txt_test_utils", "//third_party/googletest:gtest", ] + txt_common_executable_deps } @@ -191,12 +200,11 @@ executable("txt_benchmarks") { "benchmarks/paragraph_builder_benchmarks.cc", "benchmarks/styled_runs_benchmarks.cc", "benchmarks/txt_run_all_benchmarks.cc", - "benchmarks/utils.cc", - "benchmarks/utils.h", ] deps = [ ":txt", + ":txt_test_utils", "//third_party/benchmark", ] + txt_common_executable_deps } diff --git a/third_party/txt/benchmarks/paint_record_benchmarks.cc b/third_party/txt/benchmarks/paint_record_benchmarks.cc index b4be01be56ee5..732af3e96a44a 100644 --- a/third_party/txt/benchmarks/paint_record_benchmarks.cc +++ b/third_party/txt/benchmarks/paint_record_benchmarks.cc @@ -16,11 +16,11 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" +#include "flutter/third_party/txt/tests/txt_test_utils.h" #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" #include "txt/paint_record.h" #include "txt/text_style.h" -#include "utils.h" namespace txt { diff --git a/third_party/txt/benchmarks/paragraph_benchmarks.cc b/third_party/txt/benchmarks/paragraph_benchmarks.cc index 0861f53f5be64..04d21996feeb8 100644 --- a/third_party/txt/benchmarks/paragraph_benchmarks.cc +++ b/third_party/txt/benchmarks/paragraph_benchmarks.cc @@ -17,6 +17,7 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" #include +#include "flutter/third_party/txt/tests/txt_test_utils.h" #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" #include "minikin/LayoutUtils.h" @@ -30,7 +31,6 @@ #include "txt/font_weight.h" #include "txt/paragraph.h" #include "txt/paragraph_builder.h" -#include "utils.h" namespace txt { diff --git a/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc b/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc index 6030c0e342396..2004889ceeaa5 100644 --- a/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc +++ b/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc @@ -16,6 +16,7 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" +#include "flutter/third_party/txt/tests/txt_test_utils.h" #include "lib/fxl/logging.h" #include "third_party/icu/source/common/unicode/unistr.h" #include "third_party/skia/include/core/SkColor.h" @@ -24,7 +25,6 @@ #include "txt/font_weight.h" #include "txt/paragraph.h" #include "txt/paragraph_builder.h" -#include "utils.h" namespace txt { diff --git a/third_party/txt/benchmarks/styled_runs_benchmarks.cc b/third_party/txt/benchmarks/styled_runs_benchmarks.cc index a0e21fc89102a..c3300ac79ab7d 100644 --- a/third_party/txt/benchmarks/styled_runs_benchmarks.cc +++ b/third_party/txt/benchmarks/styled_runs_benchmarks.cc @@ -16,11 +16,11 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" +#include "flutter/third_party/txt/tests/txt_test_utils.h" #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" #include "txt/styled_runs.h" #include "txt/text_style.h" -#include "utils.h" namespace txt { diff --git a/third_party/txt/benchmarks/txt_run_all_benchmarks.cc b/third_party/txt/benchmarks/txt_run_all_benchmarks.cc index 98b6c68fa6ac2..b5c0bbeadc75e 100644 --- a/third_party/txt/benchmarks/txt_run_all_benchmarks.cc +++ b/third_party/txt/benchmarks/txt_run_all_benchmarks.cc @@ -17,8 +17,8 @@ #include "third_party/benchmark/include/benchmark/benchmark_api.h" #include "flutter/fml/icu_util.h" +#include "flutter/third_party/txt/tests/txt_test_utils.h" #include "lib/fxl/logging.h" -#include "utils.h" // We will use a custom main to allow custom font directories for consistency. int main(int argc, char** argv) { diff --git a/third_party/txt/benchmarks/utils.cc b/third_party/txt/benchmarks/utils.cc deleted file mode 100644 index f5164f2038be6..0000000000000 --- a/third_party/txt/benchmarks/utils.cc +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "lib/fxl/command_line.h" -#include "txt/directory_asset_data_provider.h" -#include "txt/font_collection.h" -#include "utils.h" - -namespace txt { - -static std::string gFontDir; -static fxl::CommandLine gCommandLine; - -const std::string& GetFontDir() { - return gFontDir; -} - -void SetFontDir(const std::string& dir) { - gFontDir = dir; -} - -const fxl::CommandLine& GetCommandLineForProcess() { - return gCommandLine; -} - -void SetCommandLine(fxl::CommandLine cmd) { - gCommandLine = std::move(cmd); -} - -std::shared_ptr GetTestFontCollection() { - auto collection = std::make_shared(); - collection->SetAssetFontManager(sk_make_sp( - std::make_unique(GetFontDir()))); - return collection; -} - -} // namespace txt diff --git a/third_party/txt/src/txt/asset_data_provider.cc b/third_party/txt/src/txt/asset_data_provider.cc deleted file mode 100644 index fa35cc08539bb..0000000000000 --- a/third_party/txt/src/txt/asset_data_provider.cc +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "txt/asset_data_provider.h" -#include "lib/fxl/logging.h" - -namespace txt { - -AssetDataProvider::AssetDataProvider() = default; - -AssetDataProvider::~AssetDataProvider() = default; - -size_t AssetDataProvider::GetFamilyCount() const { - return family_names_.size(); -} - -const std::string& AssetDataProvider::GetFamilyName(int index) const { - return family_names_[index]; -} - -AssetFontStyleSet* AssetDataProvider::MatchFamily( - const std::string& family_name) { - auto found = registered_families_.find(family_name); - if (found == registered_families_.end()) { - return nullptr; - } - return SkRef(&found->second); -} - -void AssetDataProvider::RegisterTypeface(sk_sp typeface) { - if (typeface == nullptr) { - return; - } - - SkString sk_family_name; - typeface->getFamilyName(&sk_family_name); - - std::string family_name(sk_family_name.c_str(), sk_family_name.size()); - RegisterTypeface(std::move(typeface), std::move(family_name)); -} - -void AssetDataProvider::RegisterTypeface(sk_sp typeface, - std::string family_name_alias) { - if (family_name_alias.empty()) { - return; - } - - auto family_it = registered_families_.find(family_name_alias); - if (family_it == registered_families_.end()) { - family_names_.push_back(family_name_alias); - family_it = registered_families_ - .emplace(std::piecewise_construct, - std::forward_as_tuple(family_name_alias), - std::forward_as_tuple()) - .first; - } - family_it->second.registerTypeface(std::move(typeface)); -} - -} // namespace txt diff --git a/third_party/txt/src/txt/asset_data_provider.h b/third_party/txt/src/txt/asset_data_provider.h deleted file mode 100644 index 78659339f12b1..0000000000000 --- a/third_party/txt/src/txt/asset_data_provider.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef TXT_ASSET_DATA_PROVIDER_H_ -#define TXT_ASSET_DATA_PROVIDER_H_ - -#include -#include -#include "lib/fxl/macros.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "txt/asset_font_style_set.h" - -namespace txt { - -class AssetDataProvider { - public: - AssetDataProvider(); - - virtual ~AssetDataProvider(); - - size_t GetFamilyCount() const; - - const std::string& GetFamilyName(int index) const; - - AssetFontStyleSet* MatchFamily(const std::string& family_name); - - void RegisterTypeface(sk_sp typeface); - - void RegisterTypeface(sk_sp typeface, - std::string family_name_alias); - - private: - std::unordered_map registered_families_; - std::vector family_names_; - - FXL_DISALLOW_COPY_AND_ASSIGN(AssetDataProvider); -}; - -} // namespace txt - -#endif // TXT_ASSET_DATA_PROVIDER_H_ diff --git a/third_party/txt/src/txt/asset_font_manager.cc b/third_party/txt/src/txt/asset_font_manager.cc index e0af5f9302623..c9edd2b241d59 100644 --- a/third_party/txt/src/txt/asset_font_manager.cc +++ b/third_party/txt/src/txt/asset_font_manager.cc @@ -15,25 +15,29 @@ */ #include "txt/asset_font_manager.h" + #include + #include "lib/fxl/logging.h" +#include "third_party/skia/include/core/SkString.h" +#include "third_party/skia/include/core/SkTypeface.h" namespace txt { AssetFontManager::AssetFontManager( - std::unique_ptr data_provider) - : data_provider_(std::move(data_provider)) { - FXL_DCHECK(data_provider_ != nullptr); + std::unique_ptr font_provider) + : font_provider_(std::move(font_provider)) { + FXL_DCHECK(font_provider_ != nullptr); } AssetFontManager::~AssetFontManager() = default; int AssetFontManager::onCountFamilies() const { - return data_provider_->GetFamilyCount(); + return font_provider_->GetFamilyCount(); } void AssetFontManager::onGetFamilyName(int index, SkString* familyName) const { - familyName->set(data_provider_->GetFamilyName(index).c_str()); + familyName->set(font_provider_->GetFamilyName(index).c_str()); } SkFontStyleSet* AssetFontManager::onCreateStyleSet(int index) const { @@ -44,14 +48,14 @@ SkFontStyleSet* AssetFontManager::onCreateStyleSet(int index) const { SkFontStyleSet* AssetFontManager::onMatchFamily( const char family_name_string[]) const { std::string family_name(family_name_string); - return data_provider_->MatchFamily(family_name); + return font_provider_->MatchFamily(family_name); } SkTypeface* AssetFontManager::onMatchFamilyStyle( const char familyName[], const SkFontStyle& style) const { SkFontStyleSet* font_style_set = - data_provider_->MatchFamily(std::string(familyName)); + font_provider_->MatchFamily(std::string(familyName)); if (font_style_set == nullptr) return nullptr; return font_style_set->matchStyle(style); diff --git a/third_party/txt/src/txt/asset_font_manager.h b/third_party/txt/src/txt/asset_font_manager.h index 646caf3446c04..c6d0bc1b2f79b 100644 --- a/third_party/txt/src/txt/asset_font_manager.h +++ b/third_party/txt/src/txt/asset_font_manager.h @@ -21,13 +21,13 @@ #include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/ports/SkFontMgr.h" -#include "txt/asset_data_provider.h" +#include "txt/font_asset_provider.h" namespace txt { class AssetFontManager : public SkFontMgr { public: - AssetFontManager(std::unique_ptr data_provider); + AssetFontManager(std::unique_ptr font_provider); ~AssetFontManager() override; @@ -36,7 +36,7 @@ class AssetFontManager : public SkFontMgr { SkFontStyleSet* onMatchFamily(const char familyName[]) const override; private: - std::unique_ptr data_provider_; + std::unique_ptr font_provider_; // |SkFontMgr| int onCountFamilies() const override; diff --git a/third_party/txt/src/txt/asset_font_style_set.cc b/third_party/txt/src/txt/asset_font_style_set.cc deleted file mode 100644 index c0ebcf78e2aba..0000000000000 --- a/third_party/txt/src/txt/asset_font_style_set.cc +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2017 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. - -#include "txt/asset_font_style_set.h" -#include "lib/fxl/logging.h" - -namespace txt { - -AssetFontStyleSet::AssetFontStyleSet() = default; - -AssetFontStyleSet::~AssetFontStyleSet() = default; - -void AssetFontStyleSet::registerTypeface(sk_sp typeface) { - if (typeface == nullptr) { - return; - } - typefaces_.emplace_back(std::move(typeface)); -} - -int AssetFontStyleSet::count() { - return typefaces_.size(); -} - -void AssetFontStyleSet::getStyle(int index, SkFontStyle*, SkString* style) { - FXL_DCHECK(false); -} - -SkTypeface* AssetFontStyleSet::createTypeface(int index) { - auto index_cast = static_cast(index); - if (index_cast >= typefaces_.size()) { - return nullptr; - } - return SkRef(typefaces_[index_cast].get()); -} - -SkTypeface* AssetFontStyleSet::matchStyle(const SkFontStyle& pattern) { - if (typefaces_.empty()) - return nullptr; - - for (const sk_sp& typeface : typefaces_) - if (typeface->fontStyle() == pattern) - return typeface.get(); - - return SkRef(typefaces_[0].get()); -} - -} // namespace txt diff --git a/third_party/txt/src/txt/asset_font_style_set.h b/third_party/txt/src/txt/asset_font_style_set.h deleted file mode 100644 index 23c610917c230..0000000000000 --- a/third_party/txt/src/txt/asset_font_style_set.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017 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. - -#ifndef TXT_ASSET_FONT_STYLE_SET_H_ -#define TXT_ASSET_FONT_STYLE_SET_H_ - -#include -#include "lib/fxl/macros.h" -#include "third_party/skia/include/core/SkFontStyle.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/ports/SkFontMgr.h" - -namespace txt { - -class AssetFontStyleSet : public SkFontStyleSet { - public: - AssetFontStyleSet(); - - ~AssetFontStyleSet() override; - - void registerTypeface(sk_sp typeface); - - // |SkFontStyleSet| - int count() override; - - // |SkFontStyleSet| - void getStyle(int index, SkFontStyle*, SkString* style) override; - - // |SkFontStyleSet| - SkTypeface* createTypeface(int index) override; - - // |SkFontStyleSet| - SkTypeface* matchStyle(const SkFontStyle& pattern) override; - - private: - std::vector> typefaces_; - - FXL_DISALLOW_COPY_AND_ASSIGN(AssetFontStyleSet); -}; - -} // namespace txt - -#endif // TXT_ASSET_FONT_STYLE_SET_H_ diff --git a/third_party/txt/src/txt/directory_asset_data_provider.cc b/third_party/txt/src/txt/directory_asset_data_provider.cc deleted file mode 100644 index 0a78bcb95cf2a..0000000000000 --- a/third_party/txt/src/txt/directory_asset_data_provider.cc +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2017 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. - -#include "txt/directory_asset_data_provider.h" -#include -#include "lib/fxl/logging.h" -#include "third_party/skia/include/core/SkStream.h" -#include "third_party/skia/include/core/SkTypeface.h" -#include "utils/WindowsUtils.h" - -#if !defined(_WIN32) -#include -#endif - -namespace txt { - -DirectoryAssetDataProvider::DirectoryAssetDataProvider( - const std::string& directory_path) { -#if defined(_WIN32) - std::string path = directory_path + "\\*"; - WIN32_FIND_DATAA ffd; - HANDLE directory = FindFirstFileA(path.c_str(), &ffd); - if (directory == INVALID_HANDLE_VALUE) { - return; - } - - do { - if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { - continue; - } - - std::string file_name(ffd.cFileName); - - std::stringstream file_path; - file_path << directory_path << "/" << file_name; - - RegisterTypeface(SkTypeface::MakeFromFile(file_path.str().c_str())); - } while (FindNextFileA(directory, &ffd) != 0); - - // TODO(bkonyi): check for error here? - FindClose(directory); -#else - auto directory_closer = [](DIR* directory) { - if (directory != nullptr) { - ::closedir(directory); - } - }; - - std::unique_ptr directory( - ::opendir(directory_path.c_str()), directory_closer); - - if (directory == nullptr) { - return; - } - - for (struct dirent* entry = ::readdir(directory.get()); entry != nullptr; - entry = ::readdir(directory.get())) { - if (entry->d_type != DT_REG) { - continue; - } - - std::string file_name(entry->d_name); - - std::stringstream file_path; - file_path << directory_path << "/" << file_name; - - RegisterTypeface(SkTypeface::MakeFromFile(file_path.str().c_str())); - } -#endif -} - -DirectoryAssetDataProvider::~DirectoryAssetDataProvider() = default; - -} // namespace txt diff --git a/third_party/txt/src/txt/directory_asset_data_provider.h b/third_party/txt/src/txt/directory_asset_data_provider.h deleted file mode 100644 index 7f0a751008b05..0000000000000 --- a/third_party/txt/src/txt/directory_asset_data_provider.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 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. - -#ifndef TXT_DIRECTORY_ASSET_DATA_PROVIDER_H_ -#define TXT_DIRECTORY_ASSET_DATA_PROVIDER_H_ - -#include "lib/fxl/macros.h" -#include "txt/asset_data_provider.h" - -namespace txt { - -class DirectoryAssetDataProvider : public AssetDataProvider { - public: - DirectoryAssetDataProvider(const std::string& directory); - - ~DirectoryAssetDataProvider() override; - - private: - FXL_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetDataProvider); -}; - -} // namespace txt - -#endif // TXT_DIRECTORY_ASSET_DATA_PROVIDER_H_ diff --git a/third_party/txt/tests/utils.cc b/third_party/txt/src/txt/font_asset_provider.h similarity index 57% rename from third_party/txt/tests/utils.cc rename to third_party/txt/src/txt/font_asset_provider.h index 79e5bdc0b9bf7..397ed2ec6e483 100644 --- a/third_party/txt/tests/utils.cc +++ b/third_party/txt/src/txt/font_asset_provider.h @@ -1,5 +1,5 @@ /* - * Copyright 2017 Google, Inc. + * Copyright 2018 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,30 +14,22 @@ * limitations under the License. */ -#include +#ifndef TXT_FONT_ASSET_PROVIDER_H_ +#define TXT_FONT_ASSET_PROVIDER_H_ -#include "lib/fxl/command_line.h" -#include "utils.h" +#include "third_party/skia/include/ports/SkFontMgr.h" namespace txt { -static std::string gFontDir; -static fxl::CommandLine gCommandLine; +class FontAssetProvider { + public: + virtual ~FontAssetProvider() = default; -const std::string& GetFontDir() { - return gFontDir; -} - -void SetFontDir(const std::string& dir) { - gFontDir = dir; -} - -const fxl::CommandLine& GetCommandLineForProcess() { - return gCommandLine; -} - -void SetCommandLine(fxl::CommandLine cmd) { - gCommandLine = std::move(cmd); -} + virtual size_t GetFamilyCount() const = 0; + virtual std::string GetFamilyName(int index) const = 0; + virtual SkFontStyleSet* MatchFamily(const std::string& family_name) = 0; +}; } // namespace txt + +#endif // TXT_FONT_ASSET_PROVIDER_H_ diff --git a/third_party/txt/src/txt/test_font_manager.cc b/third_party/txt/src/txt/test_font_manager.cc index db68b938ab05b..d5ce63da79ae6 100644 --- a/third_party/txt/src/txt/test_font_manager.cc +++ b/third_party/txt/src/txt/test_font_manager.cc @@ -20,9 +20,9 @@ namespace txt { TestFontManager::TestFontManager( - std::unique_ptr data_provider, + std::unique_ptr font_provider, std::string test_font_family_name) - : AssetFontManager(std::move(data_provider)), + : AssetFontManager(std::move(font_provider)), test_font_family_name_(test_font_family_name) {} TestFontManager::~TestFontManager() = default; diff --git a/third_party/txt/src/txt/test_font_manager.h b/third_party/txt/src/txt/test_font_manager.h index 45dd6264029d2..dd4f2c32bea44 100644 --- a/third_party/txt/src/txt/test_font_manager.h +++ b/third_party/txt/src/txt/test_font_manager.h @@ -22,8 +22,8 @@ #include "lib/fxl/macros.h" #include "third_party/skia/include/ports/SkFontMgr.h" -#include "txt/asset_data_provider.h" #include "txt/asset_font_manager.h" +#include "txt/font_asset_provider.h" namespace txt { @@ -31,7 +31,7 @@ namespace txt { // one family. class TestFontManager : public AssetFontManager { public: - TestFontManager(std::unique_ptr data_provider, + TestFontManager(std::unique_ptr font_provider, std::string test_font_family_name); ~TestFontManager() override; diff --git a/third_party/txt/src/txt/typeface_font_asset_provider.cc b/third_party/txt/src/txt/typeface_font_asset_provider.cc new file mode 100644 index 0000000000000..a57af7d9d650f --- /dev/null +++ b/third_party/txt/src/txt/typeface_font_asset_provider.cc @@ -0,0 +1,118 @@ +/* + * Copyright 2018 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "txt/typeface_font_asset_provider.h" + +#include "lib/fxl/logging.h" +#include "third_party/skia/include/core/SkString.h" +#include "third_party/skia/include/core/SkTypeface.h" + +namespace txt { + +TypefaceFontAssetProvider::TypefaceFontAssetProvider() = default; + +TypefaceFontAssetProvider::~TypefaceFontAssetProvider() = default; + +// |FontAssetProvider| +size_t TypefaceFontAssetProvider::GetFamilyCount() const { + return family_names_.size(); +} + +// |FontAssetProvider| +std::string TypefaceFontAssetProvider::GetFamilyName(int index) const { + return family_names_[index]; +} + +// |FontAssetProvider| +SkFontStyleSet* TypefaceFontAssetProvider::MatchFamily( + const std::string& family_name) { + auto found = registered_families_.find(family_name); + if (found == registered_families_.end()) { + return nullptr; + } + return SkRef(&found->second); +} + +void TypefaceFontAssetProvider::RegisterTypeface(sk_sp typeface) { + if (typeface == nullptr) { + return; + } + + SkString sk_family_name; + typeface->getFamilyName(&sk_family_name); + + std::string family_name(sk_family_name.c_str(), sk_family_name.size()); + RegisterTypeface(std::move(typeface), std::move(family_name)); +} + +void TypefaceFontAssetProvider::RegisterTypeface( + sk_sp typeface, + std::string family_name_alias) { + if (family_name_alias.empty()) { + return; + } + + auto family_it = registered_families_.find(family_name_alias); + if (family_it == registered_families_.end()) { + family_names_.push_back(family_name_alias); + family_it = registered_families_ + .emplace(std::piecewise_construct, + std::forward_as_tuple(family_name_alias), + std::forward_as_tuple()) + .first; + } + family_it->second.registerTypeface(std::move(typeface)); +} + +TypefaceFontStyleSet::TypefaceFontStyleSet() = default; + +TypefaceFontStyleSet::~TypefaceFontStyleSet() = default; + +void TypefaceFontStyleSet::registerTypeface(sk_sp typeface) { + if (typeface == nullptr) { + return; + } + typefaces_.emplace_back(std::move(typeface)); +} + +int TypefaceFontStyleSet::count() { + return typefaces_.size(); +} + +void TypefaceFontStyleSet::getStyle(int index, SkFontStyle*, SkString* style) { + FXL_DCHECK(false); +} + +SkTypeface* TypefaceFontStyleSet::createTypeface(int i) { + size_t index = i; + if (index >= typefaces_.size()) { + return nullptr; + } + return SkRef(typefaces_[index].get()); +} + +SkTypeface* TypefaceFontStyleSet::matchStyle(const SkFontStyle& pattern) { + if (typefaces_.empty()) + return nullptr; + + for (const sk_sp& typeface : typefaces_) + if (typeface->fontStyle() == pattern) + return SkRef(typeface.get()); + + return SkRef(typefaces_[0].get()); +} + +} // namespace txt diff --git a/third_party/txt/src/txt/typeface_font_asset_provider.h b/third_party/txt/src/txt/typeface_font_asset_provider.h new file mode 100644 index 0000000000000..f41b5b7c3473d --- /dev/null +++ b/third_party/txt/src/txt/typeface_font_asset_provider.h @@ -0,0 +1,84 @@ +/* + * Copyright 2018 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef TXT_TYPEFACE_FONT_ASSET_PROVIDER_H_ +#define TXT_TYPEFACE_FONT_ASSET_PROVIDER_H_ + +#include +#include +#include + +#include "lib/fxl/macros.h" +#include "third_party/skia/include/ports/SkFontMgr.h" +#include "txt/font_asset_provider.h" + +namespace txt { + +class TypefaceFontStyleSet : public SkFontStyleSet { + public: + TypefaceFontStyleSet(); + + ~TypefaceFontStyleSet() override; + + void registerTypeface(sk_sp typeface); + + // |SkFontStyleSet| + int count() override; + + // |SkFontStyleSet| + void getStyle(int index, SkFontStyle*, SkString* style) override; + + // |SkFontStyleSet| + SkTypeface* createTypeface(int index) override; + + // |SkFontStyleSet| + SkTypeface* matchStyle(const SkFontStyle& pattern) override; + + private: + std::vector> typefaces_; + + FXL_DISALLOW_COPY_AND_ASSIGN(TypefaceFontStyleSet); +}; + +class TypefaceFontAssetProvider : public FontAssetProvider { + public: + TypefaceFontAssetProvider(); + ~TypefaceFontAssetProvider() override; + + void RegisterTypeface(sk_sp typeface); + + void RegisterTypeface(sk_sp typeface, + std::string family_name_alias); + + // |FontAssetProvider| + size_t GetFamilyCount() const override; + + // |FontAssetProvider| + std::string GetFamilyName(int index) const override; + + // |FontAssetProvider| + SkFontStyleSet* MatchFamily(const std::string& family_name) override; + + private: + std::unordered_map registered_families_; + std::vector family_names_; + + FXL_DISALLOW_COPY_AND_ASSIGN(TypefaceFontAssetProvider); +}; + +} // namespace txt + +#endif // TXT_TYPEFACE_FONT_ASSET_PROVIDER_H_ diff --git a/third_party/txt/tests/font_collection_unittests.cc b/third_party/txt/tests/font_collection_unittests.cc index 0b8c4856aa00a..fc81ad281c950 100644 --- a/third_party/txt/tests/font_collection_unittests.cc +++ b/third_party/txt/tests/font_collection_unittests.cc @@ -18,7 +18,7 @@ #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" #include "txt/font_collection.h" -#include "utils.h" +#include "txt_test_utils.h" namespace txt { diff --git a/third_party/txt/tests/paragraph_unittests.cc b/third_party/txt/tests/paragraph_unittests.cc index 13027f90d4f18..30c29a62c789a 100644 --- a/third_party/txt/tests/paragraph_unittests.cc +++ b/third_party/txt/tests/paragraph_unittests.cc @@ -22,7 +22,7 @@ #include "txt/font_weight.h" #include "txt/paragraph.h" #include "txt/paragraph_builder.h" -#include "utils.h" +#include "txt_test_utils.h" #define DISABLE_ON_WINDOWS(TEST) DISABLE_TEST_WINDOWS(TEST) diff --git a/third_party/txt/tests/render_test.cc b/third_party/txt/tests/render_test.cc index 802ebbfd6cebc..6b4bde573db0c 100644 --- a/third_party/txt/tests/render_test.cc +++ b/third_party/txt/tests/render_test.cc @@ -22,17 +22,13 @@ #include "third_party/skia/include/core/SkImageEncoder.h" #include "third_party/skia/include/core/SkStream.h" #include "txt/asset_font_manager.h" -#include "txt/directory_asset_data_provider.h" #include "txt/font_collection.h" -#include "utils.h" +#include "txt_test_utils.h" namespace txt { RenderTest::RenderTest() - : snapshots_(0), font_collection_(std::make_shared()) { - font_collection_->SetAssetFontManager(sk_make_sp( - std::make_unique(GetFontDir()))); -} + : snapshots_(0), font_collection_(GetTestFontCollection()) {} RenderTest::~RenderTest() = default; diff --git a/third_party/txt/tests/txt_run_all_unittests.cc b/third_party/txt/tests/txt_run_all_unittests.cc index 5a059c02db82d..a712566140c60 100644 --- a/third_party/txt/tests/txt_run_all_unittests.cc +++ b/third_party/txt/tests/txt_run_all_unittests.cc @@ -19,7 +19,7 @@ #include "lib/fxl/command_line.h" #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkGraphics.h" -#include "utils.h" +#include "txt_test_utils.h" #include diff --git a/third_party/txt/tests/txt_test_utils.cc b/third_party/txt/tests/txt_test_utils.cc new file mode 100644 index 0000000000000..da90b9cb73418 --- /dev/null +++ b/third_party/txt/tests/txt_test_utils.cc @@ -0,0 +1,119 @@ +/* + * Copyright 2017 Google, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "txt_test_utils.h" + +#include "third_party/skia/include/core/SkTypeface.h" +#include "txt/asset_font_manager.h" +#include "txt/typeface_font_asset_provider.h" +#include "utils/WindowsUtils.h" + +#if !defined(_WIN32) +#include +#endif + +namespace txt { + +static std::string gFontDir; +static fxl::CommandLine gCommandLine; + +const std::string& GetFontDir() { + return gFontDir; +} + +void SetFontDir(const std::string& dir) { + gFontDir = dir; +} + +const fxl::CommandLine& GetCommandLineForProcess() { + return gCommandLine; +} + +void SetCommandLine(fxl::CommandLine cmd) { + gCommandLine = std::move(cmd); +} + +void RegisterFontsFromPath(TypefaceFontAssetProvider& font_provider, + std::string directory_path) { +#if defined(_WIN32) + std::string path = directory_path + "\\*"; + WIN32_FIND_DATAA ffd; + HANDLE directory = FindFirstFileA(path.c_str(), &ffd); + if (directory == INVALID_HANDLE_VALUE) { + return; + } + + do { + if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { + continue; + } + + std::string file_name(ffd.cFileName); + + std::stringstream file_path; + file_path << directory_path << "/" << file_name; + + font_provider.RegisterTypeface( + SkTypeface::MakeFromFile(file_path.str().c_str())); + } while (FindNextFileA(directory, &ffd) != 0); + + // TODO(bkonyi): check for error here? + FindClose(directory); +#else + auto directory_closer = [](DIR* directory) { + if (directory != nullptr) { + ::closedir(directory); + } + }; + + std::unique_ptr directory( + ::opendir(directory_path.c_str()), directory_closer); + + if (directory == nullptr) { + return; + } + + for (struct dirent* entry = ::readdir(directory.get()); entry != nullptr; + entry = ::readdir(directory.get())) { + if (entry->d_type != DT_REG) { + continue; + } + + std::string file_name(entry->d_name); + + std::stringstream file_path; + file_path << directory_path << "/" << file_name; + + font_provider.RegisterTypeface( + SkTypeface::MakeFromFile(file_path.str().c_str())); + } +#endif +} + +std::shared_ptr GetTestFontCollection() { + std::unique_ptr font_provider = + std::make_unique(); + RegisterFontsFromPath(*font_provider, GetFontDir()); + + std::shared_ptr collection = + std::make_shared(); + collection->SetAssetFontManager( + sk_make_sp(std::move(font_provider))); + + return collection; +} + +} // namespace txt diff --git a/third_party/txt/benchmarks/utils.h b/third_party/txt/tests/txt_test_utils.h similarity index 95% rename from third_party/txt/benchmarks/utils.h rename to third_party/txt/tests/txt_test_utils.h index e75929a524bef..b69f3fa984290 100644 --- a/third_party/txt/benchmarks/utils.h +++ b/third_party/txt/tests/txt_test_utils.h @@ -14,15 +14,13 @@ * limitations under the License. */ -#include #include #include "lib/fxl/command_line.h" +#include "txt/font_collection.h" namespace txt { -class FontCollection; - const std::string& GetFontDir(); void SetFontDir(const std::string& dir); diff --git a/third_party/txt/tests/utils.h b/third_party/txt/tests/utils.h deleted file mode 100644 index 5e6286a364569..0000000000000 --- a/third_party/txt/tests/utils.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2017 Google, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "lib/fxl/command_line.h" - -namespace txt { - -const std::string& GetFontDir(); - -void SetFontDir(const std::string& dir); - -const fxl::CommandLine& GetCommandLineForProcess(); - -void SetCommandLine(fxl::CommandLine cmd); - -} // namespace txt diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 222cc2f4523e4..752670eae6e0c 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -146,10 +146,6 @@ FILE: ../../../flutter/shell/platform/embedder/embedder.cc FILE: ../../../flutter/shell/platform/embedder/embedder_include.c FILE: ../../../flutter/shell/platform/embedder/platform_view_embedder.cc FILE: ../../../flutter/shell/platform/embedder/platform_view_embedder.h -FILE: ../../../flutter/third_party/txt/src/txt/asset_font_style_set.cc -FILE: ../../../flutter/third_party/txt/src/txt/asset_font_style_set.h -FILE: ../../../flutter/third_party/txt/src/txt/directory_asset_data_provider.cc -FILE: ../../../flutter/third_party/txt/src/txt/directory_asset_data_provider.h FILE: ../../../flutter/third_party/txt/src/txt/platform.cc FILE: ../../../flutter/third_party/txt/src/txt/platform.h FILE: ../../../flutter/third_party/txt/src/txt/platform_android.cc @@ -493,6 +489,8 @@ FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_ FILE: ../../../flutter/lib/ui/isolate_name_server.dart FILE: ../../../flutter/lib/ui/painting/image_encoding.cc FILE: ../../../flutter/lib/ui/painting/image_encoding.h +FILE: ../../../flutter/lib/ui/text/asset_manager_font_provider.cc +FILE: ../../../flutter/lib/ui/text/asset_manager_font_provider.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm @@ -930,8 +928,6 @@ FILE: ../../../flutter/third_party/txt/benchmarks/paragraph_benchmarks.cc FILE: ../../../flutter/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc FILE: ../../../flutter/third_party/txt/benchmarks/styled_runs_benchmarks.cc FILE: ../../../flutter/third_party/txt/benchmarks/txt_run_all_benchmarks.cc -FILE: ../../../flutter/third_party/txt/benchmarks/utils.cc -FILE: ../../../flutter/third_party/txt/benchmarks/utils.h FILE: ../../../flutter/third_party/txt/src/log/log.cc FILE: ../../../flutter/third_party/txt/src/log/log.h FILE: ../../../flutter/third_party/txt/src/minikin/CmapCoverage.cpp @@ -970,10 +966,9 @@ FILE: ../../../flutter/third_party/txt/src/minikin/SparseBitSet.cpp FILE: ../../../flutter/third_party/txt/src/minikin/SparseBitSet.h FILE: ../../../flutter/third_party/txt/src/minikin/WordBreaker.cpp FILE: ../../../flutter/third_party/txt/src/minikin/WordBreaker.h -FILE: ../../../flutter/third_party/txt/src/txt/asset_data_provider.cc -FILE: ../../../flutter/third_party/txt/src/txt/asset_data_provider.h FILE: ../../../flutter/third_party/txt/src/txt/asset_font_manager.cc FILE: ../../../flutter/third_party/txt/src/txt/asset_font_manager.h +FILE: ../../../flutter/third_party/txt/src/txt/font_asset_provider.h FILE: ../../../flutter/third_party/txt/src/txt/font_collection.cc FILE: ../../../flutter/third_party/txt/src/txt/font_collection.h FILE: ../../../flutter/third_party/txt/src/txt/font_skia.cc @@ -997,6 +992,8 @@ FILE: ../../../flutter/third_party/txt/src/txt/text_decoration.cc FILE: ../../../flutter/third_party/txt/src/txt/text_decoration.h FILE: ../../../flutter/third_party/txt/src/txt/text_style.cc FILE: ../../../flutter/third_party/txt/src/txt/text_style.h +FILE: ../../../flutter/third_party/txt/src/txt/typeface_font_asset_provider.cc +FILE: ../../../flutter/third_party/txt/src/txt/typeface_font_asset_provider.h FILE: ../../../flutter/third_party/txt/src/utils/JenkinsHash.cpp FILE: ../../../flutter/third_party/txt/src/utils/JenkinsHash.h FILE: ../../../flutter/third_party/txt/src/utils/LruCache.h From 69253904d6ee9e47eddf4f0d7057e12250654a7c Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 14 Jun 2018 16:14:37 -0700 Subject: [PATCH 0589/1190] libtxt: fix the adjustment of code unit runs for line justification (#5536) Fixes https://github.com/flutter/flutter/issues/18483 --- third_party/txt/src/txt/paragraph.cc | 13 ++++++++----- third_party/txt/src/txt/paragraph.h | 10 ++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index 78b2ef8be9deb..cc247dd107358 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -192,8 +192,7 @@ Paragraph::GlyphPosition::GlyphPosition(double x_start, x_pos(x_start, x_start + x_advance) {} void Paragraph::GlyphPosition::Shift(double delta) { - x_pos.start += delta; - x_pos.end += delta; + x_pos.Shift(delta); } Paragraph::GlyphLine::GlyphLine(std::vector&& p, size_t tcu) @@ -212,6 +211,12 @@ Paragraph::CodeUnitRun::CodeUnitRun(std::vector&& p, font_metrics(metrics), direction(dir) {} +void Paragraph::CodeUnitRun::Shift(double delta) { + x_pos.Shift(delta); + for (GlyphPosition& position : positions) + position.Shift(delta); +} + Paragraph::Paragraph() { breaker_.setLocale(icu::Locale(), nullptr); } @@ -697,9 +702,7 @@ void Paragraph::Layout(double width, bool force) { double line_x_offset = GetLineXOffset(run_x_offset); if (line_x_offset) { for (CodeUnitRun& code_unit_run : line_code_unit_runs) { - for (GlyphPosition& position : code_unit_run.positions) { - position.Shift(line_x_offset); - } + code_unit_run.Shift(line_x_offset); } for (GlyphPosition& position : line_glyph_positions) { position.Shift(line_x_offset); diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index edbff5e56a80f..bc8dc3ea93328 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -73,11 +73,19 @@ class Paragraph { struct Range { Range() : start(), end() {} Range(T s, T e) : start(s), end(e) {} + T start, end; + bool operator==(const Range& other) const { return start == other.start && end == other.end; } + T width() { return end - start; } + + void Shift(T delta) { + start += delta; + end += delta; + } }; // Minikin Layout doLayout() and LineBreaker addStyleRun() has an @@ -260,6 +268,8 @@ class Paragraph { size_t line, const SkPaint::FontMetrics& metrics, TextDirection dir); + + void Shift(double delta); }; // Holds the laid out x positions of each glyph. From 93c47a14ffd8203df57da27b3b3e9d18a8e46045 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 14 Jun 2018 18:04:13 -0700 Subject: [PATCH 0590/1190] On snapshot, perform a device to host transfer for images resident on the GPU. (#5538) --- lib/ui/painting/image_encoding.cc | 152 ++++++++++++++++++++++-------- 1 file changed, 114 insertions(+), 38 deletions(-) diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index c32c06cc2da3e..00c9b79fe5629 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -16,6 +16,7 @@ #include "lib/tonic/dart_persistent_value.h" #include "lib/tonic/logging/dart_invoke.h" #include "lib/tonic/typed_data/uint8_list.h" +#include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkEncodedImageFormat.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSurface.h" @@ -54,61 +55,131 @@ void InvokeDataCallback(std::unique_ptr callback, } } -sk_sp EncodeImage(sk_sp image, ImageByteFormat format) { +sk_sp ConvertToRasterImageIfNecessary(sk_sp image, + GrContext* context) { + if (context == nullptr) { + // The context was null (software rendering contexts) so the image is likely + // already a raster image. Nothing more to do. + return image; + } + TRACE_EVENT0("flutter", __FUNCTION__); - if (image == nullptr) { + // Create a GPU surface with the context and then do a device to host copy of + // image contents. + auto surface = SkSurface::MakeRenderTarget( + context, SkBudgeted::kNo, + SkImageInfo::MakeN32Premul(image->dimensions())); + + if (surface == nullptr || surface->getCanvas() == nullptr) { + FXL_LOG(ERROR) << "Could not create a surface to copy the texture into."; return nullptr; } - if (format == kPNG) { - return image->encodeToData(SkEncodedImageFormat::kPNG, 0); - } + surface->getCanvas()->drawImage(image, 0, 0); + surface->getCanvas()->flush(); + + auto snapshot = surface->makeImageSnapshot(); - // Copy the GPU image snapshot into CPU memory. - auto cpu_snapshot = image->makeRasterImage(); - if (!cpu_snapshot) { - FXL_LOG(ERROR) << "Pixel copy failed."; + if (snapshot == nullptr) { + FXL_LOG(ERROR) << "Could not snapshot image to encode."; return nullptr; } + return snapshot->makeRasterImage(); +} + +sk_sp CopyImageByteData(sk_sp raster_image, + SkColorType color_type) { + FXL_DCHECK(raster_image); + SkPixmap pixmap; - if (!cpu_snapshot->peekPixels(&pixmap)) { - FXL_LOG(ERROR) << "Pixel address is not available."; + + if (!raster_image->peekPixels(&pixmap)) { + FXL_LOG(ERROR) << "Could not copy pixels from the raster image."; return nullptr; } - if (format == kRawUnmodified) { + // The color types already match. No need to swizzle. Return early. + if (pixmap.colorType() == color_type) { return SkData::MakeWithCopy(pixmap.addr(), pixmap.computeByteSize()); } - FXL_CHECK(format == kRawRGBA); - if (pixmap.colorType() != kRGBA_8888_SkColorType) { - TRACE_EVENT0("flutter", "ConvertToRGBA"); + // Perform swizzle if the type doesnt match the specification. + auto surface = SkSurface::MakeRaster( + SkImageInfo::Make(raster_image->width(), raster_image->height(), + color_type, kPremul_SkAlphaType, nullptr)); - // Convert the pixel data to N32 and RGBA to adhere to our API contract. - const auto image_info = SkImageInfo::MakeN32Premul( - image->width(), image->height()).makeColorType(kRGBA_8888_SkColorType); + if (!surface) { + FXL_LOG(ERROR) << "Could not setup the surface for swizzle."; + return nullptr; + } - auto surface = SkSurface::MakeRaster(image_info); - surface->writePixels(pixmap, 0, 0); - if (!surface->peekPixels(&pixmap)) { - FXL_LOG(ERROR) << "Pixel address is not available."; - return nullptr; - } + surface->writePixels(pixmap, 0, 0); - return SkData::MakeWithCopy(pixmap.addr32(), pixmap.computeByteSize()); - } else { - return SkData::MakeWithCopy(pixmap.addr32(), pixmap.computeByteSize()); + if (!surface->peekPixels(&pixmap)) { + FXL_LOG(ERROR) << "Pixel address is not available."; + return nullptr; + } + + return SkData::MakeWithCopy(pixmap.addr(), pixmap.computeByteSize()); +} + +sk_sp EncodeImage(sk_sp p_image, + GrContext* context, + ImageByteFormat format) { + TRACE_EVENT0("flutter", __FUNCTION__); + + // Check validity of the image. + if (p_image == nullptr) { + FXL_LOG(ERROR) << "Image was null."; + return nullptr; + } + + auto dimensions = p_image->dimensions(); + + if (dimensions.isEmpty()) { + FXL_LOG(ERROR) << "Image dimensions were empty."; + return nullptr; } + + auto raster_image = ConvertToRasterImageIfNecessary(p_image, context); + + if (raster_image == nullptr) { + FXL_LOG(ERROR) << "Could not create a raster copy of the image."; + return nullptr; + } + + switch (format) { + case kPNG: { + auto png_image = + raster_image->encodeToData(SkEncodedImageFormat::kPNG, 0); + + if (png_image == nullptr) { + FXL_LOG(ERROR) << "Could not convert raster image to PNG."; + return nullptr; + } + return png_image; + } break; + case kRawRGBA: { + return CopyImageByteData(raster_image, kRGBA_8888_SkColorType); + } break; + case kRawUnmodified: { + return CopyImageByteData(raster_image, kN32_SkColorType); + } break; + } + + FXL_LOG(ERROR) << "Unknown error encoding image."; + return nullptr; } void EncodeImageAndInvokeDataCallback( std::unique_ptr callback, sk_sp image, + GrContext* context, fxl::RefPtr ui_task_runner, ImageByteFormat format) { - sk_sp encoded = EncodeImage(std::move(image), format); + sk_sp encoded = EncodeImage(std::move(image), context, format); ui_task_runner->PostTask( fxl::MakeCopyable([callback = std::move(callback), encoded]() mutable { @@ -131,18 +202,23 @@ Dart_Handle EncodeImage(CanvasImage* canvas_image, auto callback = std::make_unique( tonic::DartState::Current(), callback_handle); - sk_sp image = canvas_image->image(); const auto& task_runners = UIDartState::Current()->GetTaskRunners(); - - task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( - [callback = std::move(callback), image, - ui_task_runner = task_runners.GetUITaskRunner(), - image_format]() mutable { - EncodeImageAndInvokeDataCallback(std::move(callback), - std::move(image), - std::move(ui_task_runner), - image_format); + auto context = UIDartState::Current()->GetResourceContext(); + + task_runners.GetIOTaskRunner()->PostTask( + fxl::MakeCopyable([callback = std::move(callback), // + image = canvas_image->image(), // + context = std::move(context), // + ui_task_runner = task_runners.GetUITaskRunner(), // + image_format // + ]() mutable { + EncodeImageAndInvokeDataCallback(std::move(callback), // + std::move(image), // + context.get(), // + std::move(ui_task_runner), // + image_format // + ); })); return Dart_Null(); From 9cec11da33258bec8e86336730fc4b0c709cde72 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 14 Jun 2018 22:32:39 -0400 Subject: [PATCH 0591/1190] Roll src/third_party/skia 1986036f69f8..76c37997541f (3 commits) (#5540) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b3422fe9ec441..3b40669fe557e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1986036f69f81a52d390cc01899cd68d6b200e30', + 'skia_revision': '76c37997541f0b138620b7a0ec55b9b409357e3e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4d05aff50b060..62d578935e1bc 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1bc62460e1bd44ecdb1cc8c0d6f8442a +Signature: 7eb5dbd25957bbdb244869ea6850ab2c UNUSED LICENSES: From 3db56312940a4f40896f095f1a81858362899d3c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 15 Jun 2018 01:57:38 -0400 Subject: [PATCH 0592/1190] Roll src/third_party/skia 76c37997541f..cdae28ee591a (1 commits) (#5541) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3b40669fe557e..6b4cda5174726 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '76c37997541f0b138620b7a0ec55b9b409357e3e', + 'skia_revision': 'cdae28ee591a3d1380f18fe605b973c7380f67e4', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 62d578935e1bc..1de2fbf2c2f2d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7eb5dbd25957bbdb244869ea6850ab2c +Signature: ac7474258002e41402faf1b49df30d5c UNUSED LICENSES: From 959d99e20f2cf974dbb7d82b2bdea9f5748cc87e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 15 Jun 2018 05:23:39 -0400 Subject: [PATCH 0593/1190] Roll src/third_party/skia cdae28ee591a..3df694fe1174 (1 commits) (#5542) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 6b4cda5174726..008446d407f58 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cdae28ee591a3d1380f18fe605b973c7380f67e4', + 'skia_revision': '3df694fe1174d48f92859c671797813eced98862', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1de2fbf2c2f2d..d2f0fb0121abd 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ac7474258002e41402faf1b49df30d5c +Signature: 5eef3f0e41dc35e92b9b4cba4a127f12 UNUSED LICENSES: From b2af86d4600a5e10bd6c18fa420a9f7f4eb97e3d Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 15 Jun 2018 08:49:39 -0400 Subject: [PATCH 0594/1190] Roll src/third_party/skia 3df694fe1174..3f13bcba3e5c (4 commits) (#5543) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 008446d407f58..00ed57308b5ae 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3df694fe1174d48f92859c671797813eced98862', + 'skia_revision': '3f13bcba3e5c8234ddd0c36e7758513bb08a72e4', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d2f0fb0121abd..4541acaccc513 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5eef3f0e41dc35e92b9b4cba4a127f12 +Signature: ed17ddfe095c4c74cc6c6fdbd9afe848 UNUSED LICENSES: From b30372d681a8eab59c8a3ad7515269b191c6258b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 15 Jun 2018 12:13:38 -0400 Subject: [PATCH 0595/1190] Roll src/third_party/skia 3f13bcba3e5c..0513dd867553 (6 commits) (#5545) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 00ed57308b5ae..e6a1e471eeb75 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3f13bcba3e5c8234ddd0c36e7758513bb08a72e4', + 'skia_revision': '0513dd8675534afdd605cea32778a4b4671b2c3d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4541acaccc513..aba65b284540f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ed17ddfe095c4c74cc6c6fdbd9afe848 +Signature: 95ec688a84a7069a5bede7ac8ed2e970 UNUSED LICENSES: From 6afe4c8e518493efcc44e2d789cf814e480d46cf Mon Sep 17 00:00:00 2001 From: Maurice Parrish Date: Fri, 15 Jun 2018 10:37:47 -0700 Subject: [PATCH 0596/1190] Added method for receiving Dynamic Links (#5534) --- .../FlutterPluginAppLifeCycleDelegate.h | 11 ++++++++++- .../ios/framework/Source/FlutterAppDelegate.mm | 8 ++++++++ .../FlutterPluginAppLifeCycleDelegate.mm | 18 ++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h b/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h index 619d9871e4401..bce71db7da1d5 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h @@ -128,8 +128,17 @@ FLUTTER_EXPORT */ - (BOOL)application:(UIApplication*)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; + +/** + Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles + the request. + - Returns: `YES` if any plugin handles the request. +*/ +- (BOOL)application:(UIApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler; @end NS_ASSUME_NONNULL_END -#endif // FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ \ No newline at end of file +#endif // FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index d622a6b0139e5..a544d516c8157 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -127,6 +127,14 @@ - (void)application:(UIApplication*)application [_lifeCycleDelegate application:application performFetchWithCompletionHandler:completionHandler]; } +- (BOOL)application:(UIApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler { + return [_lifeCycleDelegate application:application + continueUserActivity:userActivity + restorationHandler:restorationHandler]; +} + #pragma mark - FlutterPluginRegistry methods. All delegating to the rootViewController - (NSObject*)registrarForPlugin:(NSString*)pluginKey { diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm index 900d048c57a09..7e45480e44db2 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm @@ -275,4 +275,22 @@ - (BOOL)application:(UIApplication*)application } return NO; } + +- (BOOL)application:(UIApplication*)application + continueUserActivity:(NSUserActivity*)userActivity + restorationHandler:(void (^)(NSArray*))restorationHandler { + for (id plugin in _pluginDelegates) { + if (!plugin) { + continue; + } + if ([plugin respondsToSelector:_cmd]) { + if ([plugin application:application + continueUserActivity:userActivity + restorationHandler:restorationHandler]) { + return YES; + } + } + } + return NO; +} @end From 0ecd42a6b2d61412552e68a2ed94636fc48acb13 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Fri, 15 Jun 2018 14:53:50 -0400 Subject: [PATCH 0597/1190] Nosksp backend context (#5544) * Use new vulkan factory of GrContext which doens't take an sk_sp. * remove unneeded member. --- vulkan/vulkan_window.cc | 14 ++++++-------- vulkan/vulkan_window.h | 5 +---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/vulkan/vulkan_window.cc b/vulkan/vulkan_window.cc index 4b9be79513d4b..e54bb0aa95e5a 100644 --- a/vulkan/vulkan_window.cc +++ b/vulkan/vulkan_window.cc @@ -97,9 +97,9 @@ GrContext* VulkanWindow::GetSkiaGrContext() { } bool VulkanWindow::CreateSkiaGrContext() { - auto backend_context = CreateSkiaBackendContext(); + GrVkBackendContext backend_context; - if (backend_context == nullptr) { + if (!CreateSkiaBackendContext(&backend_context)) { return false; } @@ -111,25 +111,23 @@ bool VulkanWindow::CreateSkiaGrContext() { context->setResourceCacheLimits(kGrCacheMaxCount, kGrCacheMaxByteSize); - skia_vk_backend_context_ = backend_context; skia_gr_context_ = context; return true; } -sk_sp VulkanWindow::CreateSkiaBackendContext() { +bool VulkanWindow::CreateSkiaBackendContext(GrVkBackendContext* context) { auto interface = vk->CreateSkiaInterface(); if (interface == nullptr || !interface->validate(0)) { - return nullptr; + return false; } uint32_t skia_features = 0; if (!logical_device_->GetPhysicalDeviceFeaturesSkia(&skia_features)) { - return nullptr; + return false; } - auto context = sk_make_sp(); context->fInstance = application_->GetInstance(); context->fPhysicalDevice = logical_device_->GetPhysicalDeviceHandle(); context->fDevice = logical_device_->GetHandle(); @@ -142,7 +140,7 @@ sk_sp VulkanWindow::CreateSkiaBackendContext() { context->fFeatures = skia_features; context->fInterface.reset(interface.release()); context->fOwnsInstanceAndDevice = false; - return context; + return true; } sk_sp VulkanWindow::AcquireSurface() { diff --git a/vulkan/vulkan_window.h b/vulkan/vulkan_window.h index 891589e5a413f..55de23f2f7ff4 100644 --- a/vulkan/vulkan_window.h +++ b/vulkan/vulkan_window.h @@ -47,9 +47,6 @@ class VulkanWindow { private: bool valid_; fxl::RefPtr vk; - // Note: The order of objects here is important because the - // GrVkBackendContext assumes ownership of the device and instance handles. - sk_sp skia_vk_backend_context_; std::unique_ptr application_; std::unique_ptr logical_device_; std::unique_ptr surface_; @@ -58,7 +55,7 @@ class VulkanWindow { bool CreateSkiaGrContext(); - sk_sp CreateSkiaBackendContext(); + bool CreateSkiaBackendContext(GrVkBackendContext* context); FXL_WARN_UNUSED_RESULT bool RecreateSwapchain(); From 52ff9c898068d310e6a9ea76b2b0d512295f654c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 15 Jun 2018 15:39:38 -0400 Subject: [PATCH 0598/1190] Roll src/third_party/skia 0513dd867553..39c97e27921c (11 commits) (#5548) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e6a1e471eeb75..7a56f08efd3a1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0513dd8675534afdd605cea32778a4b4671b2c3d', + 'skia_revision': '39c97e27921c9e81c59d0a97d7e858b0fccf5248', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index aba65b284540f..3585d2a2801b9 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 95ec688a84a7069a5bede7ac8ed2e970 +Signature: 5ca26c34e30cdc86ce833b8621580b0b UNUSED LICENSES: From 824e45e7c13433fb89166e918536da1d9428e547 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Fri, 15 Jun 2018 14:15:35 -0700 Subject: [PATCH 0599/1190] Remove spurious log messages (#5547) These are making some of the tests that are sensitive to output flakey. --- .../android/io/flutter/app/FlutterActivityDelegate.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index a50e1da8c2eba..ef56db8b46e13 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -206,7 +206,6 @@ public void onPause() { if (app instanceof FlutterApplication) { FlutterApplication flutterApp = (FlutterApplication) app; if (activity.equals(flutterApp.getCurrentActivity())) { - Log.i(TAG, "onPause setting current activity to null"); flutterApp.setCurrentActivity(null); } } @@ -227,10 +226,7 @@ public void onResume() { Application app = (Application) activity.getApplicationContext(); if (app instanceof FlutterApplication) { FlutterApplication flutterApp = (FlutterApplication) app; - Log.i(TAG, "onResume setting current activity to this"); flutterApp.setCurrentActivity(activity); - } else { - Log.i(TAG, "onResume app wasn't a FlutterApplication!!"); } } @@ -252,7 +248,6 @@ public void onDestroy() { if (app instanceof FlutterApplication) { FlutterApplication flutterApp = (FlutterApplication) app; if (activity.equals(flutterApp.getCurrentActivity())) { - Log.i(TAG, "onDestroy setting current activity to null"); flutterApp.setCurrentActivity(null); } } From 81fbf996bd33b9c374ea980a3a83018491ec204c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 15 Jun 2018 19:05:40 -0400 Subject: [PATCH 0600/1190] Roll src/third_party/skia 39c97e27921c..7675b369322e (8 commits) (#5549) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7a56f08efd3a1..5a7ecfbf6b3f4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '39c97e27921c9e81c59d0a97d7e858b0fccf5248', + 'skia_revision': '7675b369322e3fbcb70682c2ceee417997633205', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3585d2a2801b9..1d3f844ecb87b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5ca26c34e30cdc86ce833b8621580b0b +Signature: c27afb93ffe69ba02918ac77f6e1740c UNUSED LICENSES: From 63e2071da8bd4400addab933f32b9e8728702c1b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 17 Jun 2018 05:10:38 -0400 Subject: [PATCH 0601/1190] Roll src/third_party/skia 7675b369322e..0242b59c0aaf (1 commits) (#5552) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5a7ecfbf6b3f4..4f6cf7b67ba42 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7675b369322e3fbcb70682c2ceee417997633205', + 'skia_revision': '0242b59c0aaf66e96b63d66123004c82f4ace162', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1d3f844ecb87b..76bcb0ae7d7f5 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c27afb93ffe69ba02918ac77f6e1740c +Signature: b17c992ee701a20a0b7a1c35368e5f0a UNUSED LICENSES: From 629b57a2d8826eb4b851c35270c6d2c4b6745be5 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 18 Jun 2018 08:11:39 -0400 Subject: [PATCH 0602/1190] Roll src/third_party/skia 0242b59c0aaf..63132864e966 (1 commits) (#5554) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4f6cf7b67ba42..4a9c4f5a649d9 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0242b59c0aaf66e96b63d66123004c82f4ace162', + 'skia_revision': '63132864e96657ea1a74b93acf5a00d40ebe49b3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 76bcb0ae7d7f5..d6202a83db3b1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b17c992ee701a20a0b7a1c35368e5f0a +Signature: 4f2b77437cd7f0e5a896cc1c7ae483c3 UNUSED LICENSES: From 8d4d455f45129a6744cf82a5c186778050fb1d85 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 18 Jun 2018 11:41:38 -0400 Subject: [PATCH 0603/1190] Roll src/third_party/skia 63132864e966..3567c14a41cd (2 commits) (#5555) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4a9c4f5a649d9..9a8b6a4f341da 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '63132864e96657ea1a74b93acf5a00d40ebe49b3', + 'skia_revision': '3567c14a41cd55860fcc836af32d8748c1e3c856', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d6202a83db3b1..d1af6ab918fac 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4f2b77437cd7f0e5a896cc1c7ae483c3 +Signature: 022191b4b2db9f75946c142eae572f39 UNUSED LICENSES: From 15b76dd33c9844cb8a8de169f945ec1663c6f3ea Mon Sep 17 00:00:00 2001 From: Andrew Wilson Date: Mon, 18 Jun 2018 09:43:30 -0700 Subject: [PATCH 0604/1190] Make window metrics doubles to reduce rounding issues. --- lib/ui/window/viewport_metrics.h | 22 +++++++++++----------- lib/ui/window/window.cc | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/ui/window/viewport_metrics.h b/lib/ui/window/viewport_metrics.h index 5085d06f42724..0ccb50ccc4374 100644 --- a/lib/ui/window/viewport_metrics.h +++ b/lib/ui/window/viewport_metrics.h @@ -10,17 +10,17 @@ namespace blink { struct ViewportMetrics { - float device_pixel_ratio = 1.0; - int32_t physical_width = 0; - int32_t physical_height = 0; - int32_t physical_padding_top = 0; - int32_t physical_padding_right = 0; - int32_t physical_padding_bottom = 0; - int32_t physical_padding_left = 0; - int32_t physical_view_inset_top = 0; - int32_t physical_view_inset_right = 0; - int32_t physical_view_inset_bottom = 0; - int32_t physical_view_inset_left = 0; + double device_pixel_ratio = 1.0; + double physical_width = 0; + double physical_height = 0; + double physical_padding_top = 0; + double physical_padding_right = 0; + double physical_padding_bottom = 0; + double physical_padding_left = 0; + double physical_view_inset_top = 0; + double physical_view_inset_right = 0; + double physical_view_inset_bottom = 0; + double physical_view_inset_left = 0; }; struct LogicalSize { diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 2d5d7a1569b8f..0fe9a12efaa1c 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -149,16 +149,16 @@ void Window::UpdateWindowMetrics(const ViewportMetrics& metrics) { library_.value(), "_updateWindowMetrics", { ToDart(metrics.device_pixel_ratio), - ToDart(static_cast(metrics.physical_width)), - ToDart(static_cast(metrics.physical_height)), - ToDart(static_cast(metrics.physical_padding_top)), - ToDart(static_cast(metrics.physical_padding_right)), - ToDart(static_cast(metrics.physical_padding_bottom)), - ToDart(static_cast(metrics.physical_padding_left)), - ToDart(static_cast(metrics.physical_view_inset_top)), - ToDart(static_cast(metrics.physical_view_inset_right)), - ToDart(static_cast(metrics.physical_view_inset_bottom)), - ToDart(static_cast(metrics.physical_view_inset_left)), + ToDart(metrics.physical_width), + ToDart(metrics.physical_height), + ToDart(metrics.physical_padding_top), + ToDart(metrics.physical_padding_right), + ToDart(metrics.physical_padding_bottom), + ToDart(metrics.physical_padding_left), + ToDart(metrics.physical_view_inset_top), + ToDart(metrics.physical_view_inset_right), + ToDart(metrics.physical_view_inset_bottom), + ToDart(metrics.physical_view_inset_left), }); } From f5f57536d07439d29a36610e33780e75c9102246 Mon Sep 17 00:00:00 2001 From: Andrew Wilson Date: Mon, 18 Jun 2018 09:47:37 -0700 Subject: [PATCH 0605/1190] Revert "Make window metrics doubles to reduce rounding issues." This reverts commit 15b76dd33c9844cb8a8de169f945ec1663c6f3ea. --- lib/ui/window/viewport_metrics.h | 22 +++++++++++----------- lib/ui/window/window.cc | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/ui/window/viewport_metrics.h b/lib/ui/window/viewport_metrics.h index 0ccb50ccc4374..5085d06f42724 100644 --- a/lib/ui/window/viewport_metrics.h +++ b/lib/ui/window/viewport_metrics.h @@ -10,17 +10,17 @@ namespace blink { struct ViewportMetrics { - double device_pixel_ratio = 1.0; - double physical_width = 0; - double physical_height = 0; - double physical_padding_top = 0; - double physical_padding_right = 0; - double physical_padding_bottom = 0; - double physical_padding_left = 0; - double physical_view_inset_top = 0; - double physical_view_inset_right = 0; - double physical_view_inset_bottom = 0; - double physical_view_inset_left = 0; + float device_pixel_ratio = 1.0; + int32_t physical_width = 0; + int32_t physical_height = 0; + int32_t physical_padding_top = 0; + int32_t physical_padding_right = 0; + int32_t physical_padding_bottom = 0; + int32_t physical_padding_left = 0; + int32_t physical_view_inset_top = 0; + int32_t physical_view_inset_right = 0; + int32_t physical_view_inset_bottom = 0; + int32_t physical_view_inset_left = 0; }; struct LogicalSize { diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 0fe9a12efaa1c..2d5d7a1569b8f 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -149,16 +149,16 @@ void Window::UpdateWindowMetrics(const ViewportMetrics& metrics) { library_.value(), "_updateWindowMetrics", { ToDart(metrics.device_pixel_ratio), - ToDart(metrics.physical_width), - ToDart(metrics.physical_height), - ToDart(metrics.physical_padding_top), - ToDart(metrics.physical_padding_right), - ToDart(metrics.physical_padding_bottom), - ToDart(metrics.physical_padding_left), - ToDart(metrics.physical_view_inset_top), - ToDart(metrics.physical_view_inset_right), - ToDart(metrics.physical_view_inset_bottom), - ToDart(metrics.physical_view_inset_left), + ToDart(static_cast(metrics.physical_width)), + ToDart(static_cast(metrics.physical_height)), + ToDart(static_cast(metrics.physical_padding_top)), + ToDart(static_cast(metrics.physical_padding_right)), + ToDart(static_cast(metrics.physical_padding_bottom)), + ToDart(static_cast(metrics.physical_padding_left)), + ToDart(static_cast(metrics.physical_view_inset_top)), + ToDart(static_cast(metrics.physical_view_inset_right)), + ToDart(static_cast(metrics.physical_view_inset_bottom)), + ToDart(static_cast(metrics.physical_view_inset_left)), }); } From 525dc1889166afc0b9d1a97cb59b5e1ab20a017f Mon Sep 17 00:00:00 2001 From: Andrew Wilson Date: Mon, 18 Jun 2018 10:36:58 -0700 Subject: [PATCH 0606/1190] Make window metrics doubles to reduce rounding issues. (#5556) --- lib/ui/window/viewport_metrics.h | 22 +++++++++++----------- lib/ui/window/window.cc | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/ui/window/viewport_metrics.h b/lib/ui/window/viewport_metrics.h index 5085d06f42724..0ccb50ccc4374 100644 --- a/lib/ui/window/viewport_metrics.h +++ b/lib/ui/window/viewport_metrics.h @@ -10,17 +10,17 @@ namespace blink { struct ViewportMetrics { - float device_pixel_ratio = 1.0; - int32_t physical_width = 0; - int32_t physical_height = 0; - int32_t physical_padding_top = 0; - int32_t physical_padding_right = 0; - int32_t physical_padding_bottom = 0; - int32_t physical_padding_left = 0; - int32_t physical_view_inset_top = 0; - int32_t physical_view_inset_right = 0; - int32_t physical_view_inset_bottom = 0; - int32_t physical_view_inset_left = 0; + double device_pixel_ratio = 1.0; + double physical_width = 0; + double physical_height = 0; + double physical_padding_top = 0; + double physical_padding_right = 0; + double physical_padding_bottom = 0; + double physical_padding_left = 0; + double physical_view_inset_top = 0; + double physical_view_inset_right = 0; + double physical_view_inset_bottom = 0; + double physical_view_inset_left = 0; }; struct LogicalSize { diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 2d5d7a1569b8f..0fe9a12efaa1c 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -149,16 +149,16 @@ void Window::UpdateWindowMetrics(const ViewportMetrics& metrics) { library_.value(), "_updateWindowMetrics", { ToDart(metrics.device_pixel_ratio), - ToDart(static_cast(metrics.physical_width)), - ToDart(static_cast(metrics.physical_height)), - ToDart(static_cast(metrics.physical_padding_top)), - ToDart(static_cast(metrics.physical_padding_right)), - ToDart(static_cast(metrics.physical_padding_bottom)), - ToDart(static_cast(metrics.physical_padding_left)), - ToDart(static_cast(metrics.physical_view_inset_top)), - ToDart(static_cast(metrics.physical_view_inset_right)), - ToDart(static_cast(metrics.physical_view_inset_bottom)), - ToDart(static_cast(metrics.physical_view_inset_left)), + ToDart(metrics.physical_width), + ToDart(metrics.physical_height), + ToDart(metrics.physical_padding_top), + ToDart(metrics.physical_padding_right), + ToDart(metrics.physical_padding_bottom), + ToDart(metrics.physical_padding_left), + ToDart(metrics.physical_view_inset_top), + ToDart(metrics.physical_view_inset_right), + ToDart(metrics.physical_view_inset_bottom), + ToDart(metrics.physical_view_inset_left), }); } From 28e9e0f268b3f75131c9a59b3b43dd6433abcf3b Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 18 Jun 2018 11:37:47 -0700 Subject: [PATCH 0607/1190] Create images from uncompressed pixel data (#5550) Fixes https://github.com/flutter/flutter/issues/9184 --- lib/ui/painting.dart | 45 +++++++++++++- lib/ui/painting/codec.cc | 131 +++++++++++++++++++++++++++++++++++---- 2 files changed, 162 insertions(+), 14 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 7699f847b7de5..b8aa56c718675 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1367,6 +1367,26 @@ enum ImageByteFormat { png, } +/// The format of pixel data given to [decodeImageFromPixels]. +enum PixelFormat { + /// Each pixel is 32 bits, with the highest 8 bits encoding red, the next 8 + /// bits encoding green, the next 8 bits encoding blue, and the lowest 8 bits + /// encoding alpha. + rgba8888, + + /// Each pixel is 32 bits, with the highest 8 bits encoding blue, the next 8 + /// bits encoding green, the next 8 bits encoding red, and the lowest 8 bits + /// encoding alpha. + bgra8888, +} + +class _ImageInfo { + _ImageInfo(this.width, this.height, this.format); + int width; + int height; + int format; +} + /// Opaque handle to raw decoded image data (pixels). /// /// To obtain an [Image] object, use [instantiateImageCodec]. @@ -1481,14 +1501,14 @@ class Codec extends NativeFieldWrapperClass2 { /// failed. Future instantiateImageCodec(Uint8List list) { return _futurize( - (_Callback callback) => _instantiateImageCodec(list, callback) + (_Callback callback) => _instantiateImageCodec(list, callback, null) ); } /// Instantiates a [Codec] object for an image binary data. /// /// Returns an error message if the instantiation has failed, null otherwise. -String _instantiateImageCodec(Uint8List list, _Callback callback) +String _instantiateImageCodec(Uint8List list, _Callback callback, _ImageInfo imageInfo) native 'instantiateImageCodec'; /// Loads a single image frame from a byte array into an [Image] object. @@ -1499,12 +1519,31 @@ void decodeImageFromList(Uint8List list, ImageDecoderCallback callback) { _decodeImageFromListAsync(list, callback); } -Future _decodeImageFromListAsync(Uint8List list, ImageDecoderCallback callback) async { +Future _decodeImageFromListAsync(Uint8List list, + ImageDecoderCallback callback) async { final Codec codec = await instantiateImageCodec(list); final FrameInfo frameInfo = await codec.getNextFrame(); callback(frameInfo.image); } +/// Convert an array of pixel values into an [Image] object. +/// +/// [pixels] is the pixel data in the encoding described by [format]. +void decodeImageFromPixels( + Uint8List pixels, + int width, + int height, + PixelFormat format, + ImageDecoderCallback callback +) { + final _ImageInfo imageInfo = new _ImageInfo(width, height, format.index); + final Future codecFuture = _futurize( + (_Callback callback) => _instantiateImageCodec(pixels, callback, imageInfo) + ); + codecFuture.then((Codec codec) => codec.getNextFrame()) + .then((FrameInfo frameInfo) => callback(frameInfo.image)); +} + /// Determines the winding rule that decides how the interior of a [Path] is /// calculated. /// diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index c75ec5fef3074..ddee0dedc0149 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -32,6 +32,12 @@ namespace { static constexpr const char* kInitCodecTraceTag = "InitCodec"; static constexpr const char* kCodecNextFrameTraceTag = "CodecNextFrame"; +// This must be kept in sync with the enum in painting.dart +enum PixelFormat { + kRGBA8888, + kBGRA8888, +}; + static void InvokeCodecCallback(fxl::RefPtr codec, std::unique_ptr callback, size_t trace_id) { @@ -104,15 +110,52 @@ fxl::RefPtr InitCodec(fml::WeakPtr context, return fxl::MakeRefCounted(std::move(frameInfo)); } +fxl::RefPtr InitCodecUncompressed( + fml::WeakPtr context, + sk_sp buffer, + SkImageInfo image_info, + fxl::RefPtr unref_queue, + size_t trace_id) { + TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); + TRACE_EVENT0("blink", "InitCodecUncompressed"); + + if (buffer == nullptr || buffer->isEmpty()) { + FXL_LOG(ERROR) << "InitCodecUncompressed failed - buffer was empty"; + return nullptr; + } + + sk_sp skImage; + if (context) { + SkPixmap pixmap(image_info, buffer->data(), image_info.minRowBytes()); + skImage = SkImage::MakeCrossContextFromPixmap(context.get(), pixmap, false, + nullptr, true); + } else { + skImage = SkImage::MakeRasterData(image_info, std::move(buffer), + image_info.minRowBytes()); + } + + auto image = CanvasImage::Create(); + image->set_image({skImage, unref_queue}); + auto frameInfo = fxl::MakeRefCounted(std::move(image), 0); + return fxl::MakeRefCounted(std::move(frameInfo)); +} + void InitCodecAndInvokeCodecCallback( fxl::RefPtr ui_task_runner, fml::WeakPtr context, fxl::RefPtr unref_queue, std::unique_ptr callback, sk_sp buffer, + std::unique_ptr image_info, size_t trace_id) { - auto codec = - InitCodec(context, std::move(buffer), std::move(unref_queue), trace_id); + fxl::RefPtr codec; + if (image_info) { + codec = InitCodecUncompressed(context, std::move(buffer), *image_info, + std::move(unref_queue), trace_id); + } else { + codec = + InitCodec(context, std::move(buffer), std::move(unref_queue), trace_id); + } ui_task_runner->PostTask( fxl::MakeCopyable([callback = std::move(callback), codec = std::move(codec), trace_id]() mutable { @@ -120,13 +163,74 @@ void InitCodecAndInvokeCodecCallback( })); } +bool ConvertImageInfo(Dart_Handle image_info_handle, + Dart_NativeArguments args, + SkImageInfo* image_info) { + Dart_Handle width_handle = Dart_GetField(image_info_handle, ToDart("width")); + if (!Dart_IsInteger(width_handle)) { + Dart_SetReturnValue(args, ToDart("ImageInfo.width must be an integer")); + return false; + } + Dart_Handle height_handle = + Dart_GetField(image_info_handle, ToDart("height")); + if (!Dart_IsInteger(height_handle)) { + Dart_SetReturnValue(args, ToDart("ImageInfo.height must be an integer")); + return false; + } + Dart_Handle format_handle = + Dart_GetField(image_info_handle, ToDart("format")); + if (!Dart_IsInteger(format_handle)) { + Dart_SetReturnValue(args, ToDart("ImageInfo.format must be an integer")); + return false; + } + + PixelFormat pixel_format = static_cast( + tonic::DartConverter::FromDart(format_handle)); + SkColorType color_type = kUnknown_SkColorType; + switch (pixel_format) { + case kRGBA8888: + color_type = kRGBA_8888_SkColorType; + break; + case kBGRA8888: + color_type = kBGRA_8888_SkColorType; + break; + } + if (color_type == kUnknown_SkColorType) { + Dart_SetReturnValue(args, ToDart("Invalid pixel format")); + return false; + } + + *image_info = + SkImageInfo::Make(tonic::DartConverter::FromDart(width_handle), + tonic::DartConverter::FromDart(height_handle), + color_type, kPremul_SkAlphaType); + + return true; +} + void InstantiateImageCodec(Dart_NativeArguments args) { static size_t trace_counter = 1; const size_t trace_id = trace_counter++; TRACE_FLOW_BEGIN("flutter", kInitCodecTraceTag, trace_id); - Dart_Handle exception = nullptr; + Dart_Handle callback_handle = Dart_GetNativeArgument(args, 1); + if (!Dart_IsClosure(callback_handle)) { + TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); + Dart_SetReturnValue(args, ToDart("Callback must be a function")); + return; + } + Dart_Handle image_info_handle = Dart_GetNativeArgument(args, 2); + std::unique_ptr image_info; + if (!Dart_IsNull(image_info_handle)) { + image_info = std::make_unique(); + if (!ConvertImageInfo(image_info_handle, args, image_info.get())) { + TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); + return; + } + } + + Dart_Handle exception = nullptr; tonic::Uint8List list = tonic::DartConverter::FromArguments(args, 0, exception); if (exception) { @@ -135,11 +239,15 @@ void InstantiateImageCodec(Dart_NativeArguments args) { return; } - Dart_Handle callback_handle = Dart_GetNativeArgument(args, 1); - if (!Dart_IsClosure(callback_handle)) { - TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); - Dart_SetReturnValue(args, ToDart("Callback must be a function")); - return; + if (image_info) { + int expected_size = image_info->minRowBytes() * image_info->height(); + if (list.num_elements() < expected_size) { + TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); + list.Release(); + Dart_SetReturnValue( + args, ToDart("Pixel buffer size does not match image size")); + return; + } } auto buffer = SkData::MakeWithCopy(list.data(), list.num_elements()); @@ -150,13 +258,14 @@ void InstantiateImageCodec(Dart_NativeArguments args) { task_runners.GetIOTaskRunner()->PostTask(fxl::MakeCopyable( [callback = std::make_unique( tonic::DartState::Current(), callback_handle), - buffer = std::move(buffer), trace_id, + buffer = std::move(buffer), trace_id, image_info = std::move(image_info), ui_task_runner = task_runners.GetUITaskRunner(), context = dart_state->GetResourceContext(), queue = UIDartState::Current()->GetSkiaUnrefQueue()]() mutable { InitCodecAndInvokeCodecCallback(std::move(ui_task_runner), context, std::move(queue), std::move(callback), - std::move(buffer), trace_id); + std::move(buffer), + std::move(image_info), trace_id); })); } @@ -349,7 +458,7 @@ Dart_Handle SingleFrameCodec::getNextFrame(Dart_Handle callback_handle) { void Codec::RegisterNatives(tonic::DartLibraryNatives* natives) { natives->Register({ - {"instantiateImageCodec", InstantiateImageCodec, 2, true}, + {"instantiateImageCodec", InstantiateImageCodec, 3, true}, }); natives->Register({FOR_EACH_BINDING(DART_REGISTER_NATIVE)}); } From 0c119932c0d6cb30dafd75ec717d1eda76fd7651 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 18 Jun 2018 12:08:11 -0700 Subject: [PATCH 0608/1190] Add explicit casts to pointer data members on Android. (#5558) This accounts for changes made in https://github.com/flutter/engine/pull/5556 --- .../android/platform_view_android_jni.cc | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 30fc565c84270..3c4e03ff851b5 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -211,8 +211,8 @@ static void RunBundleAndSnapshot( // bundle or a zip asset bundle. const auto file_ext_index = bundlepath.rfind("."); if (bundlepath.substr(file_ext_index) == ".zip") { - asset_manager->PushBack(std::make_unique( - bundlepath)); + asset_manager->PushBack( + std::make_unique(bundlepath)); } else { asset_manager->PushBack(std::make_unique( fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true))); @@ -332,17 +332,18 @@ static void SetViewportMetrics(JNIEnv* env, jint physicalViewInsetBottom, jint physicalViewInsetLeft) { const blink::ViewportMetrics metrics = { - .device_pixel_ratio = devicePixelRatio, - .physical_width = physicalWidth, - .physical_height = physicalHeight, - .physical_padding_top = physicalPaddingTop, - .physical_padding_right = physicalPaddingRight, - .physical_padding_bottom = physicalPaddingBottom, - .physical_padding_left = physicalPaddingLeft, - .physical_view_inset_top = physicalViewInsetTop, - .physical_view_inset_right = physicalViewInsetRight, - .physical_view_inset_bottom = physicalViewInsetBottom, - .physical_view_inset_left = physicalViewInsetLeft, + .device_pixel_ratio = static_cast(devicePixelRatio), + .physical_width = static_cast(physicalWidth), + .physical_height = static_cast(physicalHeight), + .physical_padding_top = static_cast(physicalPaddingTop), + .physical_padding_right = static_cast(physicalPaddingRight), + .physical_padding_bottom = static_cast(physicalPaddingBottom), + .physical_padding_left = static_cast(physicalPaddingLeft), + .physical_view_inset_top = static_cast(physicalViewInsetTop), + .physical_view_inset_right = static_cast(physicalViewInsetRight), + .physical_view_inset_bottom = + static_cast(physicalViewInsetBottom), + .physical_view_inset_left = static_cast(physicalViewInsetLeft), }; ANDROID_SHELL_HOLDER->SetViewportMetrics(metrics); From 6070a657c81e9640edf042159d4ecf3be93efa5c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 18 Jun 2018 15:09:39 -0400 Subject: [PATCH 0609/1190] Roll src/third_party/skia 3567c14a41cd..dfbfc738a9ed (12 commits) (#5557) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index 9a8b6a4f341da..240c0f1207029 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3567c14a41cd55860fcc836af32d8748c1e3c856', + 'skia_revision': 'dfbfc738a9edfff7a9804253175e380c230f3d21', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d1af6ab918fac..e4b2f41efb30f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 022191b4b2db9f75946c142eae572f39 +Signature: d8920d5fd3f78813d8331e7dec0731d5 UNUSED LICENSES: @@ -17192,6 +17192,7 @@ FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.cpp FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.h FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.cpp FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.h +FILE: ../../../third_party/skia/modules/skottie/src/SkottieTest.cpp FILE: ../../../third_party/skia/modules/skottie/src/SkottieTool.cpp FILE: ../../../third_party/skia/modules/sksg/include/SkSGClipEffect.h FILE: ../../../third_party/skia/modules/sksg/include/SkSGGeometryTransform.h @@ -17261,6 +17262,8 @@ FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathCache.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathCache.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.cpp FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.h FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCSTLList.h @@ -17282,9 +17285,6 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.h FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.fp FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.h FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.h @@ -17303,6 +17303,8 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.h FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrSkSLFP.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrSkSLFP.h FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.h @@ -17327,6 +17329,7 @@ FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.cpp FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.h FILE: ../../../third_party/skia/src/sksl/SkSLJIT.cpp FILE: ../../../third_party/skia/src/sksl/SkSLJIT.h +FILE: ../../../third_party/skia/src/sksl/SkSLPipelineStageCodeGenerator.cpp FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp FILE: ../../../third_party/skia/src/utils/Sk3D.cpp @@ -17838,10 +17841,10 @@ FILE: ../../../third_party/skia/src/core/SkOrderedReadBuffer.h FILE: ../../../third_party/skia/src/sksl/lex/layout.lex FILE: ../../../third_party/skia/src/sksl/lex/sksl.lex FILE: ../../../third_party/skia/src/sksl/sksl.inc -FILE: ../../../third_party/skia/src/sksl/sksl_cpu.inc FILE: ../../../third_party/skia/src/sksl/sksl_fp.inc FILE: ../../../third_party/skia/src/sksl/sksl_frag.inc FILE: ../../../third_party/skia/src/sksl/sksl_geom.inc +FILE: ../../../third_party/skia/src/sksl/sksl_pipeline.inc FILE: ../../../third_party/skia/src/sksl/sksl_vert.inc ---------------------------------------------------------------------------------------------------- Copyright (c) 2011 Google Inc. All rights reserved. @@ -19599,8 +19602,6 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrCircleEffect.h FILE: ../../../third_party/skia/src/gpu/effects/GrEllipseEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrEllipseEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrEllipseEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrNonlinearColorSpaceXformEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrNonlinearColorSpaceXformEffect.h FILE: ../../../third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrSimpleTextureEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrSimpleTextureEffect.h @@ -19669,6 +19670,7 @@ FILE: ../../../third_party/skia/src/sksl/SkSLLayoutLexer.h FILE: ../../../third_party/skia/src/sksl/SkSLLexer.cpp FILE: ../../../third_party/skia/src/sksl/SkSLLexer.h FILE: ../../../third_party/skia/src/sksl/SkSLOutputStream.h +FILE: ../../../third_party/skia/src/sksl/SkSLPipelineStageCodeGenerator.h FILE: ../../../third_party/skia/src/sksl/SkSLSectionAndParameterHelper.h FILE: ../../../third_party/skia/src/sksl/SkSLString.cpp FILE: ../../../third_party/skia/src/sksl/SkSLString.h From 01bc207da22f217c5a686002dfa01276a1212ace Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 18 Jun 2018 18:32:38 -0400 Subject: [PATCH 0610/1190] Roll src/third_party/skia dfbfc738a9ed..63b3bfb711d7 (5 commits) (#5561) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 240c0f1207029..6c3a158cf86d7 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'dfbfc738a9edfff7a9804253175e380c230f3d21', + 'skia_revision': '63b3bfb711d7e3d4f9ad75681d77a69a3c454ab0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e4b2f41efb30f..016cc5282e265 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d8920d5fd3f78813d8331e7dec0731d5 +Signature: 18227308b2ed8f05600749ae29d363e6 UNUSED LICENSES: @@ -17471,7 +17471,6 @@ FILE: ../../../third_party/skia/experimental/docs/jsonbaseddoc.htm FILE: ../../../third_party/skia/experimental/docs/svgBackend.js FILE: ../../../third_party/skia/experimental/docs/svgbaseddoc.htm FILE: ../../../third_party/skia/experimental/docs/utilities.js -FILE: ../../../third_party/skia/gm/image.h FILE: ../../../third_party/skia/infra/bots/android_bin.isolate FILE: ../../../third_party/skia/infra/bots/assets.isolate FILE: ../../../third_party/skia/infra/bots/assets/android_ndk_darwin/VERSION From b19e2d4e7b37bd1361b41048c3077cb3c85aea2a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 18 Jun 2018 22:03:39 -0400 Subject: [PATCH 0611/1190] Roll src/third_party/skia 63b3bfb711d7..5045e501d2ae (1 commits) (#5562) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 6c3a158cf86d7..83c5f439eafc1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '63b3bfb711d7e3d4f9ad75681d77a69a3c454ab0', + 'skia_revision': '5045e501d2aec23e5f1e4b46346033ac3202c6b0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 016cc5282e265..e9acead0ef587 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 18227308b2ed8f05600749ae29d363e6 +Signature: 06e26696632aa476c173d6379a190aac UNUSED LICENSES: From 549c855e89341b97436b3417542fc8f997492df7 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 18 Jun 2018 20:56:50 -0700 Subject: [PATCH 0612/1190] Roll dart sdk to 4c9689c1d2da97d0aa25cf16cc90c2e463ad157f (#5559) * Roll dart sdk to 4c9689c1d2da97d0aa25cf16cc90c2e463ad157f Changes since last roll: ``` 4c9689c1d2 [vm] Support pluggable expression compiler for `evaluate` service api call. d70c38eed8 [Gardening] Mark test as flaky on also non-kernel (legacy) 060ee6769e Make CastStreamSubscription.onData handle a null callback f7289aa219 Remove specification of naming conventions. 87131780cb Add appendix to spec which specifies JavaScript integer behavior. dfeaf79cef Fix VM accepting too many overlarge hex numbers in int.parse. c84a9f46b2 Recompute ClassHierarchy after adding noSuchMethod forwarding stubs b558a9c2f4 Handle missing compile-time errors 3df126c497 [gardening] Update status for vm-kernel-linux-debug e22706793d Treat objects with .call as "subtypes" of function types b960e5a3ed [gardening] Mark standalone_2/io/directory_test as Crash on dartkp/debug e2d72aad91 Prepare tools/bots/try_benchmarks.sh for Dart 2. de5f9ea95f Add --use-fasta-parser flags to dartanalyzer and the analysis server. e2d903c4dc Remove packages/ directory resolution from CFE aabb78f56a Update checked-in SDK to 2.0.0-dev.63.0 on mac and linux. bc8d77231d Improve flags documentation, reenable hints in dart2js. 209a602769 Tweak for fixes tests - use orElse to avoid exception. 0e4c158847 Issue 33458. Suggest 'Create Class' Quick Fix for creation without new. 44650cc9eb Pass the location of vm_platform to compile_platform from the commandline. 0bac650833 switch to dart_action until prebuilt Windows Dart VM is updated 82ed18cdb9 Update checked-in Windows SDK to 2.0.0-dev.63.0 2394097e44 Support for including/excluding the same path in ContextRoot.isAnalyzed(). f59389b688 Optimize .runtimeType impact based on usage ee1f7f5a93 Fix newly reported warnings afa8ff6292 Add a resource provider that supports file overlays a63cf8e0cb Add --no-preview-dart-2 flag. 2a396d5315 [vm/intrinsics] Intrinsify 64-bit int typed data. dd8988c9b2 - Moved all WebGL rendering/drawing constants to synthesized class WebGL. - Removed obsolete Dartium/_blink code. 541dd195bb Enable creating full kernel files in addition to outlines from the bazel worker for kernel. 8e9e8e1da0 Fix various bugs and regularize behavior of returns statements in various kinds of functions. f1d1da6164 [vm/precomp] Reduce the size of slow-path code in precompiled mode. b51d3d4146 Key string should be avoided 1e906c3f7e Add no-op entry point for IncrementalCompiler aeeb7baa96 Change error message to not use imperative tone 309baedc72 Mark some frequently flaky co19 dart2js tests. 1a08341730 Analyzer status file update ac039abc83 Add option to check if a dill is self-contained f479435bca - Removed custom handling of fill - it was wrong the method is now overloaded. - Associate the JS class SpeechSyntesisVoice with the correct Dart class (DDC). - Top-level querySelectorAll wasn't generic. - Handle "static" for attributes in the IDLs. d2a37231b3 optimize await in async* methods in dartdevc 8f0106e490 Update more Analyzer fasta tests 53c2a6f9d5 Cleanup remaining unescape string call sites 1ef4399df0 Run dartfmt --fix for dart2 on pkg/dev_compiler 38eda19be6 Fix resolve_input_uri_test on windows. 5bf6436bc9 Initial implementations of two generators 03bcc495f7 [fuchsia] Migrate process creation to fdio_spawn_vmo 0cf860f361 Remove pub_build_validity test c015e8d303 Improve invalid string literal error recovery 84f077842b Update CHANGELOG.md for 2.0.0-dev.63 release 7757fa784a [vm] Remove redundant Profiler::DumpStackTrace(). 2bc9025be3 Consider initializing formals during top-level type inference 9df6426adb Mark the library analyzer.dart as being deprecated bd956620fe Remove code that is causing a couple of hints d99aeb3e13 [kernel] Update Fuchsia suspend to use new API. 6f44d3f208 Issue 2287. Move all, but constructors and fields set in constructors, from StatelessWidget into State. 729e9942bd Support multiple files in messages test. 99575f79ca Split ContextAwareGenerator and its subclasses 41a8b79475 Use the inferred type of const lists/maps to for constant evaluation. 2972ca61f8 Fix continue in invalidation logic c54a302495 [VM] Evaluate symbols in kernel2kernel constant evaluator in AOT (even in non-const contexts) 4a7ccd5c9a Deleted TODO comment in Scoping 8dca855de1 Specify dynamic type of Futures/... returned from async/... functions 385d825469 Make frontend_server initialize from dill work again 2716b6f9a6 Add test to frontend_server that mimics the flutter benchmarks 17d2839a03 Fixed tests for FF difference. 6779ea0cc6 GN rules: add libraries_specification_uri argument to the compile_platform template. 12b33ada44 [VM interpreter] Support NativeCall kernel bytecode. db72134f90 [vm/inliner] Add smi return type of clamped convertors. 33feee3b03 [vm/kernel/bytecode] Fix arguments passing in native factory constructors c30ce41ae6 Add hook to use single-root in fasta scripts and make use of it when creating the dart2js platform files. 34ee27a52d Update to the latest pub bfb9a4eab8 linter 0.1.53 dfe6385eb0 Fix a Dart 2 runtime cast failure f7ef66f5b0 Issue 33412. Fix for race condition in knownFiles during search. aca417a256 Fix test and expected failure. 664f756914 [vm] Reduce maximum new generation size and growth rate. bd603ba3c6 Record dependencies via CompilerContext ``` --- DEPS | 4 ++-- lib/snapshot/BUILD.gn | 8 ++------ travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/DEPS b/DEPS index 83c5f439eafc1..4566d7e0f7d8c 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '4b2d60cb18e418c5cb92cf22d2d959d8b70142a3', + 'dart_revision': '4c9689c1d2da97d0aa25cf16cc90c2e463ad157f', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', @@ -73,7 +73,7 @@ vars = { 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '881a0c3fbe63af07dd043b3f5e6cbe74eacb377c', + 'dart_pub_rev': '8b9526c915bf21627a20cd0104cb6c2be25a879f', 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', diff --git a/lib/snapshot/BUILD.gn b/lib/snapshot/BUILD.gn index 76089eb4b449f..d257830ebd6ba 100644 --- a/lib/snapshot/BUILD.gn +++ b/lib/snapshot/BUILD.gn @@ -219,9 +219,7 @@ source_set("snapshot") { } compile_platform("non_strong_platform") { - sources = [ - "libraries.json", - ] + libraries_specification_uri = "libraries.json" outputs = [ "$root_out_dir/flutter_patched_sdk/platform.dill", @@ -235,9 +233,7 @@ compile_platform("non_strong_platform") { } compile_platform("strong_platform") { - sources = [ - "libraries.json", - ] + libraries_specification_uri = "libraries.json" outputs = [ "$root_out_dir/flutter_patched_sdk/platform_strong.dill", diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e9acead0ef587..893b04c2ca496 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 06e26696632aa476c173d6379a190aac +Signature: 624f651136a86d0ec2cbb3d8d21f3c50 UNUSED LICENSES: From 148eefa0428012732b68de33e968ffd3ea0538dd Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 19 Jun 2018 01:30:38 -0400 Subject: [PATCH 0613/1190] Roll src/third_party/skia 5045e501d2ae..fb3beb0591ae (6 commits) (#5563) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 4566d7e0f7d8c..9297569e704d9 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5045e501d2aec23e5f1e4b46346033ac3202c6b0', + 'skia_revision': 'fb3beb0591aed9fd6bf349eb5d08e0e485bcff08', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 893b04c2ca496..afe95d4e41b58 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 624f651136a86d0ec2cbb3d8d21f3c50 +Signature: 94538027829e7e01c4bcccc2e9bd981c UNUSED LICENSES: @@ -5121,6 +5121,11 @@ FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart @@ -5291,7 +5296,7 @@ FILE: ../../../third_party/dart/sdk/lib/io/namespace_impl.dart FILE: ../../../third_party/dart/sdk/lib/io/overrides.dart FILE: ../../../third_party/dart/sdk/lib/io/sync_socket.dart FILE: ../../../third_party/dart/sdk/lib/vmservice/named_lookup.dart -FILE: ../../../third_party/dart/utils/bazel/kernel_summary_worker.dart +FILE: ../../../third_party/dart/utils/bazel/kernel_worker.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. From 590db92b31685941498550db58a6647f2d4d08b5 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 19 Jun 2018 08:47:39 -0400 Subject: [PATCH 0614/1190] Roll src/third_party/skia fb3beb0591ae..f2030783094e (1 commits) (#5564) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/DEPS b/DEPS index 9297569e704d9..8645cbe8f28c5 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'fb3beb0591aed9fd6bf349eb5d08e0e485bcff08', + 'skia_revision': 'f2030783094e502fb74221077a5ee7cb41287fe4', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index afe95d4e41b58..b7d5fa3f42ded 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 94538027829e7e01c4bcccc2e9bd981c +Signature: c1b2926fa60a35144cd66921ba72813d UNUSED LICENSES: @@ -17290,6 +17290,9 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.h FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.fp FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.h FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.h @@ -17308,8 +17311,6 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.h FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrSkSLFP.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrSkSLFP.h FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.h @@ -17334,7 +17335,6 @@ FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.cpp FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.h FILE: ../../../third_party/skia/src/sksl/SkSLJIT.cpp FILE: ../../../third_party/skia/src/sksl/SkSLJIT.h -FILE: ../../../third_party/skia/src/sksl/SkSLPipelineStageCodeGenerator.cpp FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp FILE: ../../../third_party/skia/src/utils/Sk3D.cpp @@ -17845,10 +17845,10 @@ FILE: ../../../third_party/skia/src/core/SkOrderedReadBuffer.h FILE: ../../../third_party/skia/src/sksl/lex/layout.lex FILE: ../../../third_party/skia/src/sksl/lex/sksl.lex FILE: ../../../third_party/skia/src/sksl/sksl.inc +FILE: ../../../third_party/skia/src/sksl/sksl_cpu.inc FILE: ../../../third_party/skia/src/sksl/sksl_fp.inc FILE: ../../../third_party/skia/src/sksl/sksl_frag.inc FILE: ../../../third_party/skia/src/sksl/sksl_geom.inc -FILE: ../../../third_party/skia/src/sksl/sksl_pipeline.inc FILE: ../../../third_party/skia/src/sksl/sksl_vert.inc ---------------------------------------------------------------------------------------------------- Copyright (c) 2011 Google Inc. All rights reserved. @@ -19674,7 +19674,6 @@ FILE: ../../../third_party/skia/src/sksl/SkSLLayoutLexer.h FILE: ../../../third_party/skia/src/sksl/SkSLLexer.cpp FILE: ../../../third_party/skia/src/sksl/SkSLLexer.h FILE: ../../../third_party/skia/src/sksl/SkSLOutputStream.h -FILE: ../../../third_party/skia/src/sksl/SkSLPipelineStageCodeGenerator.h FILE: ../../../third_party/skia/src/sksl/SkSLSectionAndParameterHelper.h FILE: ../../../third_party/skia/src/sksl/SkSLString.cpp FILE: ../../../third_party/skia/src/sksl/SkSLString.h From c3573e23b02c512c6e7fbdb7297990bb7b2fd616 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 19 Jun 2018 12:12:39 -0400 Subject: [PATCH 0615/1190] Roll src/third_party/skia f2030783094e..ba61029c5b49 (5 commits) (#5565) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 8645cbe8f28c5..07b6472f88991 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f2030783094e502fb74221077a5ee7cb41287fe4', + 'skia_revision': 'ba61029c5b4939fc33a8cd5db3e7e19c6742cc4b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b7d5fa3f42ded..d6e2547e4eb6f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c1b2926fa60a35144cd66921ba72813d +Signature: 7aa15e2fb6e3537e0d23b711221da902 UNUSED LICENSES: From af9560384965a5e9ed3f95cd12d5ad978e93c9e9 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 19 Jun 2018 15:37:38 -0400 Subject: [PATCH 0616/1190] Roll src/third_party/skia ba61029c5b49..bceddbcb7260 (3 commits) (#5566) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index 07b6472f88991..5410e2b068181 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ba61029c5b4939fc33a8cd5db3e7e19c6742cc4b', + 'skia_revision': 'bceddbcb72605343aca01638f64d7a8e8cb9792d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d6e2547e4eb6f..b5b772206091c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7aa15e2fb6e3537e0d23b711221da902 +Signature: 5bc6c974e589ab091f8b9d9230af0253 UNUSED LICENSES: @@ -17154,6 +17154,7 @@ LIBRARY: vulkanmemoryallocator ORIGIN: ../../../third_party/skia/bench/GrCCGeometryBench.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp +FILE: ../../../third_party/skia/bench/JSONBench.cpp FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp @@ -17188,11 +17189,8 @@ FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h FILE: ../../../third_party/skia/include/private/SkMacros.h FILE: ../../../third_party/skia/include/private/SkSafe32.h FILE: ../../../third_party/skia/include/private/SkTo.h +FILE: ../../../third_party/skia/include/utils/Sk3D.h FILE: ../../../third_party/skia/infra/cts/run_testlab.go -FILE: ../../../third_party/skia/modules/skjson/include/SkJSON.h -FILE: ../../../third_party/skia/modules/skjson/src/SkJSON.cpp -FILE: ../../../third_party/skia/modules/skjson/src/SkJSONBench.cpp -FILE: ../../../third_party/skia/modules/skjson/src/SkJSONTest.cpp FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.cpp FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.h FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.cpp @@ -17338,7 +17336,8 @@ FILE: ../../../third_party/skia/src/sksl/SkSLJIT.h FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp FILE: ../../../third_party/skia/src/utils/Sk3D.cpp -FILE: ../../../third_party/skia/src/utils/Sk3D.h +FILE: ../../../third_party/skia/src/utils/SkJSON.cpp +FILE: ../../../third_party/skia/src/utils/SkJSON.h FILE: ../../../third_party/skia/third_party/skcms/skcms.c FILE: ../../../third_party/skia/third_party/skcms/skcms.h FILE: ../../../third_party/skia/third_party/skcms/src/Curve.c @@ -19881,6 +19880,7 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzDrawFunctions.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzGradients.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImage.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJPEGEncoder.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJSON.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp @@ -19888,7 +19888,6 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp -FILE: ../../../third_party/skia/modules/skjson/src/FuzzSkJSON.cpp FILE: ../../../third_party/skia/modules/skottie/fuzz/FuzzSkottieJSON.cpp ---------------------------------------------------------------------------------------------------- Copyright 2018 Google, LLC From edf704d0f4afb8875872cd03035b7aa1c63a5010 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 19 Jun 2018 13:12:46 -0700 Subject: [PATCH 0617/1190] Get rid of an include of an internal Skia header in GPU Surface GL. (#5568) --- shell/gpu/gpu_surface_gl.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index c849b883b299a..1d61effb0a85b 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -12,7 +12,14 @@ #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" -#include "third_party/skia/src/gpu/gl/GrGLDefines.h" + +// These are common defines present on all OpenGL headers. However, we don't +// want to perform GL header reasolution on each platform we support. So just +// define these upfront. It is unlikely we will need more. But, if we do, we can +// add the same here. +#define GPU_GL_RGBA8 0x8058 +#define GPU_GL_RGBA4 0x8056 +#define GPU_GL_RGB565 0x8D62 namespace shell { @@ -83,9 +90,9 @@ static SkColorType FirstSupportedColorType(GrContext* context, *format = (y); \ return (x); \ } - RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GR_GL_RGBA8); - RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GR_GL_RGBA4); - RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GR_GL_RGB565); + RETURN_IF_RENDERABLE(kRGBA_8888_SkColorType, GPU_GL_RGBA8); + RETURN_IF_RENDERABLE(kARGB_4444_SkColorType, GPU_GL_RGBA4); + RETURN_IF_RENDERABLE(kRGB_565_SkColorType, GPU_GL_RGB565); return kUnknown_SkColorType; } From a7fda2b48ce0193677d02484e9c2f41c49869d47 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 19 Jun 2018 13:26:06 -0700 Subject: [PATCH 0618/1190] Use SkImageFilter::MakeMatrixFilter instead of importing an internal Skia header. (#5569) Part of fixing https://bugs.chromium.org/p/skia/issues/detail?id=7741 --- lib/ui/painting/image_filter.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ui/painting/image_filter.cc b/lib/ui/painting/image_filter.cc index 299c8bb0b5daf..910b91569ebfd 100644 --- a/lib/ui/painting/image_filter.cc +++ b/lib/ui/painting/image_filter.cc @@ -12,7 +12,6 @@ #include "third_party/skia/include/effects/SkBlurImageFilter.h" #include "third_party/skia/include/effects/SkImageSource.h" #include "third_party/skia/include/effects/SkPictureImageFilter.h" -#include "third_party/skia/src/core/SkMatrixImageFilter.h" namespace blink { @@ -59,7 +58,7 @@ void ImageFilter::initBlur(double sigma_x, double sigma_y) { void ImageFilter::initMatrix(const tonic::Float64List& matrix4, int filterQuality) { - filter_ = SkMatrixImageFilter::Make( + filter_ = SkImageFilter::MakeMatrixFilter( ToSkMatrix(matrix4), static_cast(filterQuality), nullptr); } From fe9dd64d70dc44c864edb6ff9314b5e7e2978e73 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Tue, 19 Jun 2018 14:24:19 -0700 Subject: [PATCH 0619/1190] Replace AssetResolver GetAsBuffer with GetAsMapping. (#5546) Toward no-copy loading of kernel. --- assets/asset_manager.cc | 15 ++--- assets/asset_manager.h | 4 +- assets/asset_resolver.h | 6 +- assets/directory_asset_bundle.cc | 20 +++---- assets/directory_asset_bundle.h | 4 +- assets/zip_asset_store.cc | 24 ++++---- assets/zip_asset_store.h | 4 +- lib/ui/text/asset_manager_font_provider.cc | 19 +++--- lib/ui/text/font_collection.cc | 19 +++--- lib/ui/window/platform_message_response.h | 3 +- .../window/platform_message_response_dart.cc | 8 ++- .../window/platform_message_response_dart.h | 2 +- lib/ui/window/window.cc | 3 +- shell/common/engine.cc | 14 +++-- shell/common/isolate_configuration.cc | 60 +++++++++---------- shell/platform/android/apk_asset_provider.cc | 37 +++++++----- shell/platform/android/apk_asset_provider.h | 4 +- .../platform_message_response_android.cc | 14 +++-- .../platform_message_response_android.h | 2 +- .../platform/android/platform_view_android.cc | 6 +- .../android/platform_view_android_jni.cc | 8 +-- .../darwin/common/buffer_conversions.h | 6 ++ .../darwin/common/buffer_conversions.mm | 8 +++ .../Source/platform_message_response_darwin.h | 4 +- .../Source/platform_message_router.mm | 2 +- shell/platform/embedder/embedder.cc | 3 +- 26 files changed, 165 insertions(+), 134 deletions(-) diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc index d7da9aeb87cc2..fce313d01c164 100644 --- a/assets/asset_manager.cc +++ b/assets/asset_manager.cc @@ -34,19 +34,20 @@ void AssetManager::PushBack(std::unique_ptr resolver) { } // |blink::AssetResolver| -bool AssetManager::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { +std::unique_ptr AssetManager::GetAsMapping( + const std::string& asset_name) const { if (asset_name.size() == 0) { - return false; + return nullptr; } - TRACE_EVENT0("flutter", "AssetManager::GetAsBuffer"); + TRACE_EVENT0("flutter", "AssetManager::GetAsMapping"); for (const auto& resolver : resolvers_) { - if (resolver->GetAsBuffer(asset_name, data)) { - return true; + auto mapping = resolver->GetAsMapping(asset_name); + if (mapping != nullptr) { + return mapping; } } FML_DLOG(WARNING) << "Could not find asset: " << asset_name; - return false; + return nullptr; } // |blink::AssetResolver| diff --git a/assets/asset_manager.h b/assets/asset_manager.h index 2389ea87059fc..4ab58ed0f2bf7 100644 --- a/assets/asset_manager.h +++ b/assets/asset_manager.h @@ -26,8 +26,8 @@ class AssetManager final : public AssetResolver, bool IsValid() const override; // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + std::unique_ptr GetAsMapping( + const std::string& asset_name) const override; private: std::deque> resolvers_; diff --git a/assets/asset_resolver.h b/assets/asset_resolver.h index 1d70791c6c70a..d0a68f0bf2cd8 100644 --- a/assets/asset_resolver.h +++ b/assets/asset_resolver.h @@ -9,6 +9,7 @@ #include #include "flutter/fml/macros.h" +#include "flutter/fml/mapping.h" namespace blink { @@ -20,8 +21,9 @@ class AssetResolver { virtual bool IsValid() const = 0; - virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const = 0; + FML_WARN_UNUSED_RESULT + virtual std::unique_ptr GetAsMapping( + const std::string& asset_name) const = 0; private: FML_DISALLOW_COPY_AND_ASSIGN(AssetResolver); diff --git a/assets/directory_asset_bundle.cc b/assets/directory_asset_bundle.cc index 732161589d8aa..830e96d9f5d18 100644 --- a/assets/directory_asset_bundle.cc +++ b/assets/directory_asset_bundle.cc @@ -28,29 +28,23 @@ bool DirectoryAssetBundle::IsValid() const { } // |blink::AssetResolver| -bool DirectoryAssetBundle::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { - if (data == nullptr) { - return false; - } - +std::unique_ptr DirectoryAssetBundle::GetAsMapping( + const std::string& asset_name) const { if (!is_valid_) { FML_DLOG(WARNING) << "Asset bundle was not valid."; - return false; + return nullptr; } - fml::FileMapping mapping( + auto mapping = std::make_unique( fml::OpenFile(descriptor_, asset_name.c_str(), fml::OpenPermission::kRead, false /* directory */), false /* executable */); - if (mapping.GetMapping() == nullptr) { - return false; + if (mapping->GetMapping() == nullptr) { + return nullptr; } - data->resize(mapping.GetSize()); - memmove(data->data(), mapping.GetMapping(), mapping.GetSize()); - return true; + return mapping; } } // namespace blink diff --git a/assets/directory_asset_bundle.h b/assets/directory_asset_bundle.h index b436eaf4f95f0..f61ac147ff1fb 100644 --- a/assets/directory_asset_bundle.h +++ b/assets/directory_asset_bundle.h @@ -26,8 +26,8 @@ class DirectoryAssetBundle : public AssetResolver { bool IsValid() const override; // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + std::unique_ptr GetAsMapping( + const std::string& asset_name) const override; FML_DISALLOW_COPY_AND_ASSIGN(DirectoryAssetBundle); }; diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index 1b9216bd34530..532461ff32a7c 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -35,19 +35,19 @@ bool ZipAssetStore::IsValid() const { } // |blink::AssetResolver| -bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { - TRACE_EVENT0("flutter", "ZipAssetStore::GetAsBuffer"); +std::unique_ptr ZipAssetStore::GetAsMapping( + const std::string& asset_name) const { + TRACE_EVENT0("flutter", "ZipAssetStore::GetAsMapping"); auto found = stat_cache_.find(asset_name); if (found == stat_cache_.end()) { - return false; + return nullptr; } auto unzipper = CreateUnzipper(); if (!unzipper.is_valid()) { - return false; + return nullptr; } int result = UNZ_OK; @@ -55,27 +55,27 @@ bool ZipAssetStore::GetAsBuffer(const std::string& asset_name, result = unzGoToFilePos(unzipper.get(), &(found->second.file_pos)); if (result != UNZ_OK) { FXL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result; - return false; + return nullptr; } result = unzOpenCurrentFile(unzipper.get()); if (result != UNZ_OK) { FXL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result; - return false; + return nullptr; } - data->resize(found->second.uncompressed_size); + std::vector data(found->second.uncompressed_size); int total_read = 0; - while (total_read < static_cast(data->size())) { + while (total_read < static_cast(data.size())) { int bytes_read = unzReadCurrentFile( - unzipper.get(), data->data() + total_read, data->size() - total_read); + unzipper.get(), data.data() + total_read, data.size() - total_read); if (bytes_read <= 0) { - return false; + return nullptr; } total_read += bytes_read; } - return true; + return std::make_unique(std::move(data)); } void ZipAssetStore::BuildStatCache() { diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h index 558678e25bc08..61b09474a606b 100644 --- a/assets/zip_asset_store.h +++ b/assets/zip_asset_store.h @@ -36,8 +36,8 @@ class ZipAssetStore final : public AssetResolver { bool IsValid() const override; // |blink::AssetResolver| - bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + std::unique_ptr GetAsMapping( + const std::string& asset_name) const override; void BuildStatCache(); diff --git a/lib/ui/text/asset_manager_font_provider.cc b/lib/ui/text/asset_manager_font_provider.cc index 68cb4ac3a943b..bbb9a19785bce 100644 --- a/lib/ui/text/asset_manager_font_provider.cc +++ b/lib/ui/text/asset_manager_font_provider.cc @@ -14,8 +14,8 @@ namespace blink { namespace { -void VectorReleaseProc(const void* ptr, void* context) { - delete reinterpret_cast*>(context); +void MappingReleaseProc(const void* ptr, void* context) { + delete reinterpret_cast(context); } } // anonymous namespace @@ -90,15 +90,16 @@ SkTypeface* AssetManagerFontStyleSet::createTypeface(int i) { TypefaceAsset& asset = assets_[index]; if (!asset.typeface) { - std::unique_ptr> asset_buf = - std::make_unique>(); - if (!asset_manager_->GetAsBuffer(asset.asset, asset_buf.get())) + std::unique_ptr asset_mapping = + asset_manager_->GetAsMapping(asset.asset); + if (asset_mapping == nullptr) { return nullptr; + } - std::vector* asset_buf_ptr = asset_buf.release(); - sk_sp asset_data = - SkData::MakeWithProc(asset_buf_ptr->data(), asset_buf_ptr->size(), - VectorReleaseProc, asset_buf_ptr); + fml::Mapping* asset_mapping_ptr = asset_mapping.release(); + sk_sp asset_data = SkData::MakeWithProc( + asset_mapping_ptr->GetMapping(), asset_mapping_ptr->GetSize(), + MappingReleaseProc, asset_mapping_ptr); std::unique_ptr stream = SkMemoryStream::Make(asset_data); // Ownership of the stream is transferred. diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index f0c0f7d699a8d..279fb1b4800ea 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -31,19 +31,18 @@ std::shared_ptr FontCollection::GetFontCollection() const { } void FontCollection::RegisterFonts(fml::RefPtr asset_manager) { - std::vector manifest_data; - if (!asset_manager->GetAsBuffer("FontManifest.json", &manifest_data)) { + std::unique_ptr manifest_mapping = + asset_manager->GetAsMapping("FontManifest.json"); + if (manifest_mapping == nullptr) { FXL_DLOG(WARNING) << "Could not find the font manifest in the asset store."; return; } rapidjson::Document document; - static_assert(sizeof(decltype(manifest_data)::value_type) == - sizeof(decltype(document)::Ch), - ""); - document.Parse( - reinterpret_cast(manifest_data.data()), - manifest_data.size()); + static_assert(sizeof(decltype(document)::Ch) == sizeof(uint8_t), ""); + document.Parse(reinterpret_cast( + manifest_mapping->GetMapping()), + manifest_mapping->GetSize()); if (document.HasParseError()) { FXL_DLOG(WARNING) << "Error parsing the font manifest in the asset store."; @@ -82,8 +81,8 @@ void FontCollection::RegisterFonts(fml::RefPtr asset_manager) { } // TODO: Handle weights and styles. - font_provider->RegisterAsset( - family_name->value.GetString(), font_asset->value.GetString()); + font_provider->RegisterAsset(family_name->value.GetString(), + font_asset->value.GetString()); } } diff --git a/lib/ui/window/platform_message_response.h b/lib/ui/window/platform_message_response.h index 10105e182320c..7e25908829739 100644 --- a/lib/ui/window/platform_message_response.h +++ b/lib/ui/window/platform_message_response.h @@ -7,6 +7,7 @@ #include +#include "flutter/fml/mapping.h" #include "lib/fxl/memory/ref_counted.h" #include "lib/fxl/memory/ref_ptr.h" @@ -18,7 +19,7 @@ class PlatformMessageResponse public: // Callable on any thread. - virtual void Complete(std::vector data) = 0; + virtual void Complete(std::unique_ptr data) = 0; virtual void CompleteEmpty() = 0; bool is_complete() const { return is_complete_; } diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index 5d6af0ab87b83..59660fe8d1081 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -39,6 +39,12 @@ Dart_Handle WrapByteData(std::vector data) { } } +Dart_Handle WrapByteData(std::unique_ptr mapping) { + std::vector data(mapping->GetSize()); + memcpy(data.data(), mapping->GetMapping(), mapping->GetSize()); + return WrapByteData(std::move(data)); +} + } // anonymous namespace PlatformMessageResponseDart::PlatformMessageResponseDart( @@ -56,7 +62,7 @@ PlatformMessageResponseDart::~PlatformMessageResponseDart() { } } -void PlatformMessageResponseDart::Complete(std::vector data) { +void PlatformMessageResponseDart::Complete(std::unique_ptr data) { if (callback_.is_empty()) return; FXL_DCHECK(!is_complete_); diff --git a/lib/ui/window/platform_message_response_dart.h b/lib/ui/window/platform_message_response_dart.h index 67bfb3d359691..1d65c82b65828 100644 --- a/lib/ui/window/platform_message_response_dart.h +++ b/lib/ui/window/platform_message_response_dart.h @@ -16,7 +16,7 @@ class PlatformMessageResponseDart : public PlatformMessageResponse { public: // Callable on any thread. - void Complete(std::vector data) override; + void Complete(std::unique_ptr data) override; void CompleteEmpty() override; protected: diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 0fe9a12efaa1c..5878dd26e4b4f 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -98,6 +98,7 @@ void RespondToPlatformMessage(Dart_Handle window, UIDartState::Current()->window()->CompletePlatformMessageEmptyResponse( response_id); } else { + // TODO(engine): Avoid this copy. const uint8_t* buffer = static_cast(data.data()); UIDartState::Current()->window()->CompletePlatformMessageResponse( response_id, @@ -288,7 +289,7 @@ void Window::CompletePlatformMessageResponse(int response_id, return; auto response = std::move(it->second); pending_responses_.erase(it); - response->Complete(std::move(data)); + response->Complete(std::make_unique(std::move(data))); } void Window::RegisterNatives(tonic::DartLibraryNatives* natives) { diff --git a/shell/common/engine.cc b/shell/common/engine.cc index de3fd23489953..f06c155dbcbb8 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -391,12 +391,16 @@ void Engine::HandleAssetPlatformMessage( std::string asset_name(reinterpret_cast(data.data()), data.size()); - std::vector asset_data; - if (asset_manager_ && asset_manager_->GetAsBuffer(asset_name, &asset_data)) { - response->Complete(std::move(asset_data)); - } else { - response->CompleteEmpty(); + if (asset_manager_) { + std::unique_ptr asset_mapping = + asset_manager_->GetAsMapping(asset_name); + if (asset_mapping) { + response->Complete(std::move(asset_mapping)); + return; + } } + + response->CompleteEmpty(); } } // namespace shell diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc index c971740568e97..60610e47709c9 100644 --- a/shell/common/isolate_configuration.cc +++ b/shell/common/isolate_configuration.cc @@ -135,60 +135,56 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( } // Running from kernel snapshot. - { - // TODO(engine): Add AssetManager::GetAsMapping or such to avoid the copy. - std::vector kernel; - if (asset_manager && asset_manager->GetAsBuffer( - settings.application_kernel_asset, &kernel)) { - return CreateForSnapshot( - std::make_unique(std::move(kernel))); + if (asset_manager) { + std::unique_ptr kernel = + asset_manager->GetAsMapping(settings.application_kernel_asset); + if (kernel) { + return CreateForSnapshot(std::move(kernel)); } } // Running from script snapshot. - { - // TODO(engine): Add AssetManager::GetAsMapping or such to avoid the copy. - std::vector script_snapshot; - if (asset_manager && asset_manager->GetAsBuffer( - settings.script_snapshot_path, &script_snapshot)) { - return CreateForSnapshot( - std::make_unique(std::move(script_snapshot))); + if (asset_manager) { + std::unique_ptr script_snapshot = + asset_manager->GetAsMapping(settings.script_snapshot_path); + if (script_snapshot) { + return CreateForSnapshot(std::move(script_snapshot)); } } // Running from kernel divided into several pieces (for sharing). - { - // TODO(fuchsia): Add AssetManager::GetAsMapping or such to avoid the copy. - // TODO(fuchsia): Use async blobfs API once it becomes available. - std::vector kernel_list; - if (asset_manager && - asset_manager->GetAsBuffer(settings.application_kernel_list_asset, - &kernel_list)) { + // TODO(fuchsia): Use async blobfs API once it becomes available. + if (asset_manager) { + std::unique_ptr kernel_list = + asset_manager->GetAsMapping(settings.application_kernel_list_asset); + if (kernel_list) { + const char* kernel_list_str = + reinterpret_cast(kernel_list->GetMapping()); + size_t kernel_list_size = kernel_list->GetSize(); + std::vector> kernel_pieces; size_t piece_path_start = 0; - while (piece_path_start < kernel_list.size()) { + while (piece_path_start < kernel_list_size) { size_t piece_path_end = piece_path_start; - while ((piece_path_end < kernel_list.size()) && - (kernel_list[piece_path_end] != '\n')) { + while ((piece_path_end < kernel_list_size) && + (kernel_list_str[piece_path_end] != '\n')) { piece_path_end++; } - std::string piece_path( - reinterpret_cast(&kernel_list[piece_path_start]), - piece_path_end - piece_path_start); - std::vector piece; - if (!asset_manager->GetAsBuffer(piece_path, &piece)) { + std::string piece_path(&kernel_list_str[piece_path_start], + piece_path_end - piece_path_start); + std::unique_ptr piece = + asset_manager->GetAsMapping(piece_path); + if (piece == nullptr) { FXL_LOG(ERROR) << "Failed to load: " << piece_path; return nullptr; } - kernel_pieces.emplace_back( - std::make_unique(std::move(piece))); + kernel_pieces.emplace_back(std::move(piece)); piece_path_start = piece_path_end + 1; } - return CreateForKernelList(std::move(kernel_pieces)); } } diff --git a/shell/platform/android/apk_asset_provider.cc b/shell/platform/android/apk_asset_provider.cc index 268897ef5c58f..27f524cc0b746 100644 --- a/shell/platform/android/apk_asset_provider.cc +++ b/shell/platform/android/apk_asset_provider.cc @@ -21,28 +21,35 @@ bool APKAssetProvider::IsValid() const { return true; } -bool APKAssetProvider::GetAsBuffer(const std::string& asset_name, - std::vector* data) const { +class APKAssetMapping : public fml::Mapping { + public: + APKAssetMapping(AAsset* asset) : asset_(asset) {} + + ~APKAssetMapping() override { AAsset_close(asset_); } + + size_t GetSize() const override { return AAsset_getLength(asset_); } + + const uint8_t* GetMapping() const override { + return reinterpret_cast(AAsset_getBuffer(asset_)); + } + + private: + AAsset* const asset_; + + FML_DISALLOW_COPY_AND_ASSIGN(APKAssetMapping); +}; + +std::unique_ptr APKAssetProvider::GetAsMapping( + const std::string& asset_name) const { std::stringstream ss; ss << directory_.c_str() << "/" << asset_name; AAsset* asset = AAssetManager_open(assetManager_, ss.str().c_str(), AASSET_MODE_BUFFER); if (!asset) { - return false; - } - - uint8_t* buffer = (uint8_t*)AAsset_getBuffer(asset); - if (!buffer) { - FXL_LOG(ERROR) << "Got null trying to acquire buffer for asset:" << asset; - AAsset_close(asset); - return false; + return nullptr; } - data->resize(AAsset_getLength(asset)); - std::copy(buffer, buffer + data->size(), data->begin()); - - AAsset_close(asset); - return true; + return std::make_unique(asset); } } // namespace blink diff --git a/shell/platform/android/apk_asset_provider.h b/shell/platform/android/apk_asset_provider.h index 7c3f8e12a23b2..81164733a5365 100644 --- a/shell/platform/android/apk_asset_provider.h +++ b/shell/platform/android/apk_asset_provider.h @@ -30,8 +30,8 @@ class APKAssetProvider final : public AssetResolver { bool IsValid() const override; // |blink::AssetResolver| - virtual bool GetAsBuffer(const std::string& asset_name, - std::vector* data) const override; + std::unique_ptr GetAsMapping( + const std::string& asset_name) const override; FXL_DISALLOW_COPY_AND_ASSIGN(APKAssetProvider); }; diff --git a/shell/platform/android/platform_message_response_android.cc b/shell/platform/android/platform_message_response_android.cc index b1bdc49147feb..a625cdcb6d233 100644 --- a/shell/platform/android/platform_message_response_android.cc +++ b/shell/platform/android/platform_message_response_android.cc @@ -18,7 +18,8 @@ PlatformMessageResponseAndroid::PlatformMessageResponseAndroid( platform_task_runner_(std::move(platform_task_runner)) {} // |blink::PlatformMessageResponse| -void PlatformMessageResponseAndroid::Complete(std::vector data) { +void PlatformMessageResponseAndroid::Complete( + std::unique_ptr data) { platform_task_runner_->PostTask( fxl::MakeCopyable([response = response_id_, // weak_java_object = weak_java_object_, // @@ -37,9 +38,10 @@ void PlatformMessageResponseAndroid::Complete(std::vector data) { // Convert the vector to a Java byte array. fml::jni::ScopedJavaLocalRef data_array( - env, env->NewByteArray(data.size())); - env->SetByteArrayRegion(data_array.obj(), 0, data.size(), - reinterpret_cast(data.data())); + env, env->NewByteArray(data->GetSize())); + env->SetByteArrayRegion( + data_array.obj(), 0, data->GetSize(), + reinterpret_cast(data->GetMapping())); // Make the response call into Java. FlutterViewHandlePlatformMessageResponse(env, java_object.obj(), @@ -50,8 +52,8 @@ void PlatformMessageResponseAndroid::Complete(std::vector data) { // |blink::PlatformMessageResponse| void PlatformMessageResponseAndroid::CompleteEmpty() { platform_task_runner_->PostTask( - fxl::MakeCopyable([response = response_id_, // - weak_java_object = weak_java_object_ // + fxl::MakeCopyable([response = response_id_, // + weak_java_object = weak_java_object_ // ]() { // We are on the platform thread. Attempt to get the strong reference to // the Java object. diff --git a/shell/platform/android/platform_message_response_android.h b/shell/platform/android/platform_message_response_android.h index 2ee7f3336ac6d..bca5c5e123e9e 100644 --- a/shell/platform/android/platform_message_response_android.h +++ b/shell/platform/android/platform_message_response_android.h @@ -15,7 +15,7 @@ namespace shell { class PlatformMessageResponseAndroid : public blink::PlatformMessageResponse { public: // |blink::PlatformMessageResponse| - void Complete(std::vector data) override; + void Complete(std::unique_ptr data) override; // |blink::PlatformMessageResponse| void CompleteEmpty() override; diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index f5ab79542a09e..a13d9bed14967 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -106,7 +106,8 @@ void PlatformViewAndroid::InvokePlatformMessageResponseCallback( response_data, response_data + java_response_position); auto message_response = std::move(it->second); pending_responses_.erase(it); - message_response->Complete(std::move(response)); + message_response->Complete( + std::make_unique(std::move(response))); } void PlatformViewAndroid::InvokePlatformMessageEmptyResponseCallback( @@ -190,7 +191,8 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { size_t num_bytes = 0; for (const auto& value : update) { num_bytes += kBytesPerNode; - num_bytes += value.second.childrenInTraversalOrder.size() * kBytesPerChild; + num_bytes += + value.second.childrenInTraversalOrder.size() * kBytesPerChild; num_bytes += value.second.childrenInHitTestOrder.size() * kBytesPerChild; } diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 3c4e03ff851b5..30648d5bd24df 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -174,10 +174,10 @@ std::unique_ptr CreateIsolateConfiguration( const auto configuration_from_blob = [&asset_manager](const std::string& snapshot_name) -> std::unique_ptr { - std::vector blob; - if (asset_manager.GetAsBuffer(snapshot_name, &blob)) { - return IsolateConfiguration::CreateForSnapshot( - std::make_unique(std::move(blob))); + std::unique_ptr blob = + asset_manager.GetAsMapping(snapshot_name); + if (blob) { + return IsolateConfiguration::CreateForSnapshot(std::move(blob)); } return nullptr; }; diff --git a/shell/platform/darwin/common/buffer_conversions.h b/shell/platform/darwin/common/buffer_conversions.h index 68ebdc032afd9..7b48a0c8b913d 100644 --- a/shell/platform/darwin/common/buffer_conversions.h +++ b/shell/platform/darwin/common/buffer_conversions.h @@ -9,12 +9,18 @@ #include +#include "flutter/fml/mapping.h" + namespace shell { std::vector GetVectorFromNSData(NSData* data); NSData* GetNSDataFromVector(const std::vector& buffer); +std::unique_ptr GetMappingFromNSData(NSData* data); + +NSData* GetNSDataFromMapping(std::unique_ptr mapping); + } // namespace shell #endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_BUFFER_CONVERSIONS_H_ diff --git a/shell/platform/darwin/common/buffer_conversions.mm b/shell/platform/darwin/common/buffer_conversions.mm index e892228f0f652..f7238f104db7d 100644 --- a/shell/platform/darwin/common/buffer_conversions.mm +++ b/shell/platform/darwin/common/buffer_conversions.mm @@ -15,4 +15,12 @@ return [NSData dataWithBytes:buffer.data() length:buffer.size()]; } +std::unique_ptr GetMappingFromNSData(NSData* data) { + return std::make_unique(GetVectorFromNSData(data)); +} + +NSData* GetNSDataFromMapping(std::unique_ptr mapping) { + return [NSData dataWithBytes:mapping->GetMapping() length:mapping->GetSize()]; +} + } // namespace shell diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h index b861c5036e97d..2d925e2836ecf 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h +++ b/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h @@ -20,10 +20,10 @@ namespace shell { class PlatformMessageResponseDarwin : public blink::PlatformMessageResponse { public: - void Complete(std::vector data) override { + void Complete(std::unique_ptr data) override { fxl::RefPtr self(this); platform_task_runner_->PostTask(fxl::MakeCopyable([self, data = std::move(data)]() mutable { - self->callback_.get()(shell::GetNSDataFromVector(data)); + self->callback_.get()(shell::GetNSDataFromMapping(std::move(data))); })); } diff --git a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm index 3ab75bff522f8..9beee4bb89688 100644 --- a/shell/platform/darwin/ios/framework/Source/platform_message_router.mm +++ b/shell/platform/darwin/ios/framework/Source/platform_message_router.mm @@ -27,7 +27,7 @@ handler(data, ^(NSData* reply) { if (completer) { if (reply) { - completer->Complete(GetVectorFromNSData(reply)); + completer->Complete(GetMappingFromNSData(reply)); } else { completer->CompleteEmpty(); } diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index db1e4cbc322d2..f14553471c7be 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -360,7 +360,8 @@ FlutterResult FlutterEngineSendPlatformMessageResponse( if (data_length == 0) { response->CompleteEmpty(); } else { - response->Complete({data, data + data_length}); + response->Complete(std::make_unique( + std::vector({data, data + data_length}))); } delete handle; From 1174a4d9fe07427c464945311db7cfd0fa5519a8 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 19 Jun 2018 14:34:13 -0700 Subject: [PATCH 0620/1190] Load the ICU data file asset from the "flutter_shared" path (#5567) See https://github.com/flutter/flutter/issues/18514 --- DEPS | 2 +- .../android/io/flutter/view/FlutterMain.java | 37 ++++++++++++------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/DEPS b/DEPS index 5410e2b068181..deb65f2dfd089 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '71c24e682181d0b6a7e3974e5a678678650f4da3', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '457c1f45560b35072fb13c1bbf2bbe96fd077474', # Fuchsia compatibility # diff --git a/shell/platform/android/io/flutter/view/FlutterMain.java b/shell/platform/android/io/flutter/view/FlutterMain.java index 445af70a090df..876617bdc59cf 100644 --- a/shell/platform/android/io/flutter/view/FlutterMain.java +++ b/shell/platform/android/io/flutter/view/FlutterMain.java @@ -71,17 +71,14 @@ public class FlutterMain { private static final String DEFAULT_PLATFORM_DILL = "platform.dill"; private static final String DEFAULT_FLUTTER_ASSETS_DIR = "flutter_assets"; - private static final String MANIFEST = "flutter.yaml"; + // Assets that are shared among all Flutter apps within an APK. + private static final String SHARED_ASSET_DIR = "flutter_shared"; + private static final String SHARED_ASSET_ICU_DATA = "icudtl.dat"; private static String fromFlutterAssets(String filePath) { return sFlutterAssetsDir + File.separator + filePath; } - private static final Set SKY_RESOURCES = ImmutableSetBuilder.newInstance() - .add("icudtl.dat") - .add(MANIFEST) - .build(); - // Mutable because default values can be overridden via config properties private static String sAotSharedLibraryPath = DEFAULT_AOT_SHARED_LIBRARY_PATH; private static String sAotVmSnapshotData = DEFAULT_AOT_VM_SNAPSHOT_DATA; @@ -97,6 +94,7 @@ private static String fromFlutterAssets(String filePath) { private static boolean sIsPrecompiledAsBlobs; private static boolean sIsPrecompiledAsSharedLibrary; private static Settings sSettings; + private static String sIcuDataPath; private static final class ImmutableSetBuilder { static ImmutableSetBuilder newInstance() { @@ -196,8 +194,7 @@ public static void ensureInitializationComplete(Context applicationContext, Stri sResourceExtractor.waitForCompletion(); List shellArgs = new ArrayList<>(); - shellArgs.add("--icu-data-file-path=" + - new File(PathUtils.getDataDirectory(applicationContext), "icudtl.dat")); + shellArgs.add("--icu-data-file-path=" + sIcuDataPath); if (args != null) { Collections.addAll(shellArgs, args); } @@ -265,8 +262,22 @@ private static void initConfig(Context applicationContext) { private static void initResources(Context applicationContext) { Context context = applicationContext; new ResourceCleaner(context).start(); - sResourceExtractor = new ResourceExtractor(context) - .addResources(SKY_RESOURCES) + + sResourceExtractor = new ResourceExtractor(context); + + // Search for the icudtl.dat file at the old and new locations. + // TODO(jsimmons): remove the old location when all tools have been updated. + Set sharedAssets = listAssets(applicationContext, SHARED_ASSET_DIR); + String icuAssetPath; + if (sharedAssets.contains(SHARED_ASSET_ICU_DATA)) { + icuAssetPath = SHARED_ASSET_DIR + File.separator + SHARED_ASSET_ICU_DATA; + } else { + icuAssetPath = SHARED_ASSET_ICU_DATA; + } + sResourceExtractor.addResource(icuAssetPath); + sIcuDataPath = PathUtils.getDataDirectory(applicationContext) + File.separator + icuAssetPath; + + sResourceExtractor .addResource(fromFlutterAssets(sFlx)) .addResource(fromFlutterAssets(sSnapshotBlob)) .addResource(fromFlutterAssets(sAotVmSnapshotData)) @@ -293,11 +304,11 @@ private static void initResources(Context applicationContext) { * Returns a list of the file names at the root of the application's asset * path. */ - private static Set listRootAssets(Context applicationContext) { + private static Set listAssets(Context applicationContext, String path) { AssetManager manager = applicationContext.getResources().getAssets(); try { return ImmutableSetBuilder.newInstance() - .add(manager.list("")) + .add(manager.list(path)) .build(); } catch (IOException e) { Log.e(TAG, "Unable to list assets", e); @@ -306,7 +317,7 @@ private static Set listRootAssets(Context applicationContext) { } private static void initAot(Context applicationContext) { - Set assets = listRootAssets(applicationContext); + Set assets = listAssets(applicationContext, ""); sIsPrecompiledAsBlobs = assets.containsAll(Arrays.asList( sAotVmSnapshotData, sAotVmSnapshotInstr, From 52d02a45938a2a0430250a13bd5b64dd192cf334 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 19 Jun 2018 19:04:39 -0400 Subject: [PATCH 0621/1190] Roll src/third_party/skia bceddbcb7260..846bb413e161 (20 commits) (#5572) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 45 ++++++++++++--------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/DEPS b/DEPS index deb65f2dfd089..74e27c683e733 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'bceddbcb72605343aca01638f64d7a8e8cb9792d', + 'skia_revision': '846bb413e161cb556f1afdbf07f3e637bff44432', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b5b772206091c..ee950a1d6e49c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5bc6c974e589ab091f8b9d9230af0253 +Signature: 493ff7b41e2ce6a053ba89eff4558265 UNUSED LICENSES: @@ -14359,7 +14359,6 @@ FILE: ../../../third_party/skia/include/private/GrOpList.h FILE: ../../../third_party/skia/include/private/GrRenderTargetProxy.h FILE: ../../../third_party/skia/include/private/GrSingleOwner.h FILE: ../../../third_party/skia/include/private/GrSurfaceProxy.h -FILE: ../../../third_party/skia/include/private/GrSwizzle.h FILE: ../../../third_party/skia/include/private/GrTextureProxy.h FILE: ../../../third_party/skia/include/private/SkArenaAlloc.h FILE: ../../../third_party/skia/include/private/SkBitmaskEnum.h @@ -14447,9 +14446,9 @@ FILE: ../../../third_party/skia/src/core/SkSpecialImage.h FILE: ../../../third_party/skia/src/core/SkSpecialSurface.cpp FILE: ../../../third_party/skia/src/core/SkSpecialSurface.h FILE: ../../../third_party/skia/src/core/SkSwizzle.cpp -FILE: ../../../third_party/skia/src/effects/SkArithmeticImageFilter.cpp FILE: ../../../third_party/skia/src/effects/SkOverdrawColorFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkPaintImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkArithmeticImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkPaintImageFilter.cpp FILE: ../../../third_party/skia/src/gpu/GrAppliedClip.h FILE: ../../../third_party/skia/src/gpu/GrAuditTrail.cpp FILE: ../../../third_party/skia/src/gpu/GrBitmapTextureMaker.cpp @@ -14485,6 +14484,7 @@ FILE: ../../../third_party/skia/src/gpu/GrSurfaceContext.cpp FILE: ../../../third_party/skia/src/gpu/GrSurfaceContext.h FILE: ../../../third_party/skia/src/gpu/GrSurfaceContextPriv.h FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxy.cpp +FILE: ../../../third_party/skia/src/gpu/GrSwizzle.h FILE: ../../../third_party/skia/src/gpu/GrTextureAdjuster.cpp FILE: ../../../third_party/skia/src/gpu/GrTextureAdjuster.h FILE: ../../../third_party/skia/src/gpu/GrTextureContext.cpp @@ -17217,9 +17217,12 @@ FILE: ../../../third_party/skia/modules/sksg/src/SkSGPlane.cpp FILE: ../../../third_party/skia/modules/sksg/src/SkSGRoundEffect.cpp FILE: ../../../third_party/skia/modules/sksg/src/SkSGScene.cpp FILE: ../../../third_party/skia/modules/sksg/src/SkSGText.cpp +FILE: ../../../third_party/skia/samplecode/Nima.cpp +FILE: ../../../third_party/skia/samplecode/Nima.h FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp FILE: ../../../third_party/skia/samplecode/SampleGlyphTransform.cpp +FILE: ../../../third_party/skia/samplecode/SampleNima.cpp FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp FILE: ../../../third_party/skia/src/core/SkBlurPriv.h FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp @@ -17983,7 +17986,6 @@ FILE: ../../../third_party/skia/include/gpu/gl/GrGLConfig_chrome.h FILE: ../../../third_party/skia/include/gpu/gl/GrGLInterface.h FILE: ../../../third_party/skia/include/ports/SkTypeface_mac.h FILE: ../../../third_party/skia/include/ports/SkTypeface_win.h -FILE: ../../../third_party/skia/include/private/GrGLSL.h FILE: ../../../third_party/skia/include/private/SkTArray.h FILE: ../../../third_party/skia/include/utils/SkNWayCanvas.h FILE: ../../../third_party/skia/include/utils/mac/SkCGUtils.h @@ -18138,6 +18140,7 @@ FILE: ../../../third_party/skia/src/gpu/gl/GrGLUtil.cpp FILE: ../../../third_party/skia/src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp FILE: ../../../third_party/skia/src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSL.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSL.h FILE: ../../../third_party/skia/src/gpu/ops/GrAAHairLinePathRenderer.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrAAHairLinePathRenderer.h FILE: ../../../third_party/skia/src/gpu/ops/GrDefaultPathRenderer.cpp @@ -18158,6 +18161,7 @@ FILE: ../../../third_party/skia/src/pdf/SkPDFTypes.cpp FILE: ../../../third_party/skia/src/pdf/SkPDFUtils.cpp FILE: ../../../third_party/skia/src/pdf/SkPDFUtils.h FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_default.cpp +FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_default_imagefilters.cpp FILE: ../../../third_party/skia/src/ports/SkImageEncoder_WIC.cpp FILE: ../../../third_party/skia/src/ports/SkMemory_malloc.cpp FILE: ../../../third_party/skia/src/ports/SkScalerContext_win_dw.cpp @@ -18919,8 +18923,8 @@ FILE: ../../../third_party/skia/src/core/SkXfermodeInterpretation.cpp FILE: ../../../third_party/skia/src/core/SkXfermodeInterpretation.h FILE: ../../../third_party/skia/src/core/SkYUVPlanesCache.cpp FILE: ../../../third_party/skia/src/core/SkYUVPlanesCache.h -FILE: ../../../third_party/skia/src/effects/SkImageSource.cpp FILE: ../../../third_party/skia/src/effects/SkTableColorFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkImageSource.cpp FILE: ../../../third_party/skia/src/gpu/GrAutoLocaleSetter.h FILE: ../../../third_party/skia/src/gpu/GrBlend.cpp FILE: ../../../third_party/skia/src/gpu/GrBlurUtils.cpp @@ -19283,12 +19287,12 @@ FILE: ../../../third_party/skia/src/core/SkTMultiMap.h FILE: ../../../third_party/skia/src/core/SkTypefacePriv.h FILE: ../../../third_party/skia/src/core/SkValidatingReadBuffer.h FILE: ../../../third_party/skia/src/core/SkValidationUtils.h -FILE: ../../../third_party/skia/src/effects/SkAlphaThresholdFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkComposeImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkDisplacementMapEffect.cpp -FILE: ../../../third_party/skia/src/effects/SkDropShadowImageFilter.cpp FILE: ../../../third_party/skia/src/effects/SkLumaColorFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkTileImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkAlphaThresholdFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkComposeImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkDisplacementMapEffect.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkDropShadowImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkTileImageFilter.cpp FILE: ../../../third_party/skia/src/gpu/GrCaps.h FILE: ../../../third_party/skia/src/gpu/GrCoordTransform.h FILE: ../../../third_party/skia/src/gpu/GrGeometryProcessor.h @@ -19661,6 +19665,7 @@ FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_directory.cpp FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_embedded.cpp FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_empty.cpp FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_none.cpp +FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_none_imagefilters.cpp FILE: ../../../third_party/skia/src/ports/SkOSFile_ios.h FILE: ../../../third_party/skia/src/sfnt/SkOTTable_fvar.h FILE: ../../../third_party/skia/src/shaders/SkShaderBase.h @@ -19755,13 +19760,13 @@ FILE: ../../../third_party/skia/include/effects/SkOffsetImageFilter.h FILE: ../../../third_party/skia/src/core/SkImageFilter.cpp FILE: ../../../third_party/skia/src/core/SkUtilsArm.cpp FILE: ../../../third_party/skia/src/core/SkUtilsArm.h -FILE: ../../../third_party/skia/src/effects/SkColorFilterImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkLightingImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkMagnifierImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkMatrixConvolutionImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkMergeImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkMorphologyImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkOffsetImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkColorFilterImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkLightingImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkMagnifierImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkMatrixConvolutionImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkMergeImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkMorphologyImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkOffsetImageFilter.cpp FILE: ../../../third_party/skia/src/images/SkImageEncoderFns.h FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_filter_neon.h FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp @@ -20324,8 +20329,8 @@ ORIGIN: ../../../third_party/skia/include/effects/SkPictureImageFilter.h + ../.. TYPE: LicenseType.bsd FILE: ../../../third_party/skia/include/effects/SkPictureImageFilter.h FILE: ../../../third_party/skia/include/effects/SkXfermodeImageFilter.h -FILE: ../../../third_party/skia/src/effects/SkPictureImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkXfermodeImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkPictureImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkXfermodeImageFilter.cpp ---------------------------------------------------------------------------------------------------- Copyright 2013 The Android Open Source Project From 964569b7e7f339070d2baa2152dbcd2e38621e2a Mon Sep 17 00:00:00 2001 From: liyuqian Date: Tue, 19 Jun 2018 16:42:21 -0700 Subject: [PATCH 0622/1190] Improve perf overlay performance. (#5571) 1. Mark perf overlay path as volatile 2. Set sample_margin_width = 0 to get a bar graph instead of saw-tooth. Previously, the perf overlay itself could be a significant performance hit and that makes it difficult to profile flutter app. --- flow/instrumentation.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/flow/instrumentation.cc b/flow/instrumentation.cc index d8952f9ec32a1..e3e9fbd5ec26b 100644 --- a/flow/instrumentation.cc +++ b/flow/instrumentation.cc @@ -83,9 +83,8 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const { // Prepare a path for the data. // we start at the height of the last point, so it looks like we wrap around SkPath path; + path.setIsVolatile(true); const double sample_unit_width = (1.0 / kMaxSamples); - const double sample_margin_unit_width = sample_unit_width / 6.0; - const double sample_margin_width = width * sample_margin_unit_width; path.moveTo(x, bottom); path.lineTo(x, y + height * (1.0 - UnitHeight(laps_[0].ToMillisecondsF(), max_unit_interval))); @@ -97,8 +96,8 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const { const double sample_y = y + height * (1.0 - UnitHeight(laps_[i].ToMillisecondsF(), max_unit_interval)); - path.lineTo(x + width * unit_x + sample_margin_width, sample_y); - path.lineTo(x + width * unit_next_x - sample_margin_width, sample_y); + path.lineTo(x + width * unit_x, sample_y); + path.lineTo(x + width * unit_next_x, sample_y); } path.lineTo( right, @@ -146,12 +145,11 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const { paint.setColor(SK_ColorGREEN); } double sample_x = - x + width * (static_cast(current_sample_) / kMaxSamples) - - sample_margin_width; + x + width * (static_cast(current_sample_) / kMaxSamples); const auto marker_rect = SkRect::MakeLTRB( sample_x, y, - sample_x + width * sample_unit_width + sample_margin_width * 2, bottom); + sample_x + width * sample_unit_width, bottom); canvas.drawRect(marker_rect, paint); } From e3981529d1c6764dfdadace49cd6ad17455cf860 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 20 Jun 2018 09:52:40 -0400 Subject: [PATCH 0623/1190] Roll src/third_party/skia 846bb413e161..14538ddf874e (8 commits) (#5575) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 191 ++++++++++++++++---- 2 files changed, 159 insertions(+), 34 deletions(-) diff --git a/DEPS b/DEPS index 74e27c683e733..7fae4f60f7daa 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '846bb413e161cb556f1afdbf07f3e637bff44432', + 'skia_revision': '14538ddf874e1a146487dad02709929c4b63baf5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ee950a1d6e49c..041b7bccac688 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 493ff7b41e2ce6a053ba89eff4558265 +Signature: 1570c26fb3ac06244ab79c9de27df68a UNUSED LICENSES: @@ -14383,6 +14383,36 @@ FILE: ../../../third_party/skia/src/codec/SkRawCodec.cpp FILE: ../../../third_party/skia/src/codec/SkRawCodec.h FILE: ../../../third_party/skia/src/codec/SkStreamBuffer.cpp FILE: ../../../third_party/skia/src/codec/SkStreamBuffer.h +FILE: ../../../third_party/skia/src/compute/common/cl/assert_cl.c +FILE: ../../../third_party/skia/src/compute/common/cl/assert_cl.h +FILE: ../../../third_party/skia/src/compute/common/macros.h +FILE: ../../../third_party/skia/src/compute/common/util.c +FILE: ../../../third_party/skia/src/compute/common/util.h +FILE: ../../../third_party/skia/src/compute/hs/cl/bench/main.c +FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.c +FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.h +FILE: ../../../third_party/skia/src/compute/hs/gen/gen.h +FILE: ../../../third_party/skia/src/compute/hs/gen/main.c +FILE: ../../../third_party/skia/src/compute/hs/gen/networks.h +FILE: ../../../third_party/skia/src/compute/hs/gen/networks_merging.c +FILE: ../../../third_party/skia/src/compute/hs/gen/networks_sorting.c +FILE: ../../../third_party/skia/src/compute/hs/gen/target_cuda_sm3x.c +FILE: ../../../third_party/skia/src/compute/hs/gen/target_igp_genx.c +FILE: ../../../third_party/skia/src/compute/sk/SkContext_Compute.cpp +FILE: ../../../third_party/skia/src/compute/sk/SkContext_Compute.h +FILE: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.cpp +FILE: ../../../third_party/skia/src/compute/sk/SkImage_Compute.cpp +FILE: ../../../third_party/skia/src/compute/sk/SkImage_Compute.h +FILE: ../../../third_party/skia/src/compute/sk/SkSurface_Compute.cpp +FILE: ../../../third_party/skia/src/compute/sk/SkSurface_Compute.h +FILE: ../../../third_party/skia/src/compute/skc/assert_skc.c +FILE: ../../../third_party/skia/src/compute/skc/assert_skc.h +FILE: ../../../third_party/skia/src/compute/skc/render.cl +FILE: ../../../third_party/skia/src/compute/skc/styling.c +FILE: ../../../third_party/skia/src/compute/skc/styling.h +FILE: ../../../third_party/skia/src/compute/skc/styling_types.h +FILE: ../../../third_party/skia/src/compute/skc/tile.h +FILE: ../../../third_party/skia/src/compute/skc/util.c FILE: ../../../third_party/skia/src/core/Sk4x4f.h FILE: ../../../third_party/skia/src/core/SkATrace.cpp FILE: ../../../third_party/skia/src/core/SkATrace.h @@ -17224,6 +17254,24 @@ FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp FILE: ../../../third_party/skia/samplecode/SampleGlyphTransform.cpp FILE: ../../../third_party/skia/samplecode/SampleNima.cpp FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp +FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.c +FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.h +FILE: ../../../third_party/skia/src/compute/hs/cl/bench/sort.cpp +FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.c +FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.h +FILE: ../../../third_party/skia/src/compute/skc/allocator_device_cl.c +FILE: ../../../third_party/skia/src/compute/skc/allocator_device_cl.h +FILE: ../../../third_party/skia/src/compute/skc/allocator_host.c +FILE: ../../../third_party/skia/src/compute/skc/allocator_host.h +FILE: ../../../third_party/skia/src/compute/skc/interop.c +FILE: ../../../third_party/skia/src/compute/skc/interop.h +FILE: ../../../third_party/skia/src/compute/skc/runtime.h +FILE: ../../../third_party/skia/src/compute/skc/segment_ttck.cl +FILE: ../../../third_party/skia/src/compute/skc/segment_ttrk.cl +FILE: ../../../third_party/skia/src/compute/skc/suballocator.c +FILE: ../../../third_party/skia/src/compute/skc/suballocator.h +FILE: ../../../third_party/skia/src/compute/ts/transform_stack.c +FILE: ../../../third_party/skia/src/compute/ts/transform_stack.h FILE: ../../../third_party/skia/src/core/SkBlurPriv.h FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp FILE: ../../../third_party/skia/src/core/SkColorSpaceXformSteps.cpp @@ -19520,6 +19568,82 @@ FILE: ../../../third_party/skia/src/codec/SkHeifCodec.h FILE: ../../../third_party/skia/src/codec/SkJpegPriv.h FILE: ../../../third_party/skia/src/codec/SkPngPriv.h FILE: ../../../third_party/skia/src/codec/SkStubHeifDecoderAPI.h +FILE: ../../../third_party/skia/src/compute/color/color.c +FILE: ../../../third_party/skia/src/compute/color/color.h +FILE: ../../../third_party/skia/src/compute/skc/assert_state.h +FILE: ../../../third_party/skia/src/compute/skc/atomic_cl.h +FILE: ../../../third_party/skia/src/compute/skc/block.h +FILE: ../../../third_party/skia/src/compute/skc/block_pool_cl.h +FILE: ../../../third_party/skia/src/compute/skc/block_pool_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/block_pool_init.cl +FILE: ../../../third_party/skia/src/compute/skc/cl_20/extent.c +FILE: ../../../third_party/skia/src/compute/skc/cl_20/extent.h +FILE: ../../../third_party/skia/src/compute/skc/cl_20/ring_cl_svm_fine.cpp +FILE: ../../../third_party/skia/src/compute/skc/cl_20/ring_cl_svm_fine.h +FILE: ../../../third_party/skia/src/compute/skc/common.h +FILE: ../../../third_party/skia/src/compute/skc/composition.c +FILE: ../../../third_party/skia/src/compute/skc/composition.h +FILE: ../../../third_party/skia/src/compute/skc/composition_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/composition_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/config_cl.h +FILE: ../../../third_party/skia/src/compute/skc/context.c +FILE: ../../../third_party/skia/src/compute/skc/context.h +FILE: ../../../third_party/skia/src/compute/skc/cq_pool_cl.c +FILE: ../../../third_party/skia/src/compute/skc/cq_pool_cl.h +FILE: ../../../third_party/skia/src/compute/skc/device_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/device_cl_12_avx2.h +FILE: ../../../third_party/skia/src/compute/skc/device_cl_12_gen9.c +FILE: ../../../third_party/skia/src/compute/skc/device_cl_12_gen9.h +FILE: ../../../third_party/skia/src/compute/skc/export_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/extent_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/extent_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/extent_cl_12_unified.c +FILE: ../../../third_party/skia/src/compute/skc/extent_ring.c +FILE: ../../../third_party/skia/src/compute/skc/extent_ring.h +FILE: ../../../third_party/skia/src/compute/skc/fills_expand.cl +FILE: ../../../third_party/skia/src/compute/skc/grid.c +FILE: ../../../third_party/skia/src/compute/skc/grid.h +FILE: ../../../third_party/skia/src/compute/skc/handle.h +FILE: ../../../third_party/skia/src/compute/skc/handle_pool_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/handle_pool_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/macros.h +FILE: ../../../third_party/skia/src/compute/skc/main.c +FILE: ../../../third_party/skia/src/compute/skc/path.h +FILE: ../../../third_party/skia/src/compute/skc/path_builder.c +FILE: ../../../third_party/skia/src/compute/skc/path_builder.h +FILE: ../../../third_party/skia/src/compute/skc/path_builder_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/path_builder_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/paths_copy.cl +FILE: ../../../third_party/skia/src/compute/skc/paths_reclaim.cl +FILE: ../../../third_party/skia/src/compute/skc/place.cl +FILE: ../../../third_party/skia/src/compute/skc/prefix.cl +FILE: ../../../third_party/skia/src/compute/skc/raster.h +FILE: ../../../third_party/skia/src/compute/skc/raster_builder.c +FILE: ../../../third_party/skia/src/compute/skc/raster_builder.h +FILE: ../../../third_party/skia/src/compute/skc/raster_builder_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/raster_builder_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/rasterize.cl +FILE: ../../../third_party/skia/src/compute/skc/rasters_alloc.cl +FILE: ../../../third_party/skia/src/compute/skc/rasters_reclaim.cl +FILE: ../../../third_party/skia/src/compute/skc/runtime_cl.c +FILE: ../../../third_party/skia/src/compute/skc/runtime_cl.h +FILE: ../../../third_party/skia/src/compute/skc/runtime_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/runtime_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/scheduler.cpp +FILE: ../../../third_party/skia/src/compute/skc/scheduler.h +FILE: ../../../third_party/skia/src/compute/skc/skc.h +FILE: ../../../third_party/skia/src/compute/skc/skc_styling.h +FILE: ../../../third_party/skia/src/compute/skc/styling_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/styling_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/subblock.h +FILE: ../../../third_party/skia/src/compute/skc/surface.c +FILE: ../../../third_party/skia/src/compute/skc/surface.h +FILE: ../../../third_party/skia/src/compute/skc/surface_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/surface_cl_12_buffer.c +FILE: ../../../third_party/skia/src/compute/skc/types.h +FILE: ../../../third_party/skia/src/compute/skc/util.h +FILE: ../../../third_party/skia/src/compute/skc/weakref.c +FILE: ../../../third_party/skia/src/compute/skc/weakref.h FILE: ../../../third_party/skia/src/core/SkArenaAllocList.h FILE: ../../../third_party/skia/src/core/SkAutoBlitterChoose.h FILE: ../../../third_party/skia/src/core/SkBitmapProcState_utils.h @@ -20644,11 +20768,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.h + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp +FILE: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.h +FILE: ../../../third_party/skia/src/core/SkScan_AAAPath.cpp +FILE: ../../../third_party/skia/src/core/SkScan_DAAPath.cpp ---------------------------------------------------------------------------------------------------- -NEON optimized code (C) COPYRIGHT 2009 Motorola +Copyright 2016 The Android Open Source Project Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -20682,9 +20808,8 @@ LIBRARY: skia ORIGIN: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_FontConfigInterface_factory.cpp ---------------------------------------------------------------------------------------------------- -Copyright 2008 Google Inc. +NEON optimized code (C) COPYRIGHT 2009 Motorola Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -20715,21 +20840,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkDevice.h + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkDevice.h -FILE: ../../../third_party/skia/src/core/SkScalar.cpp -FILE: ../../../third_party/skia/src/core/SkTextFormatParams.h -FILE: ../../../third_party/skia/src/images/SkJPEGWriteUtility.cpp -FILE: ../../../third_party/skia/src/images/SkJPEGWriteUtility.h -FILE: ../../../third_party/skia/src/pdf/SkDeflate.cpp -FILE: ../../../third_party/skia/src/pdf/SkDeflate.h -FILE: ../../../third_party/skia/src/pdf/SkPDFFormXObject.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFFormXObject.h -FILE: ../../../third_party/skia/src/pdf/SkPDFGraphicState.h -FILE: ../../../third_party/skia/src/pdf/SkPDFTypes.h +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_FontConfigInterface_factory.cpp ---------------------------------------------------------------------------------------------------- -Copyright 2010 The Android Open Source Project +Copyright 2008 Google Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -20760,13 +20876,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkFlattenablePriv.h + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/src/core/SkDevice.h + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkFlattenablePriv.h -FILE: ../../../third_party/skia/src/core/SkGlyphRun.cpp -FILE: ../../../third_party/skia/src/core/SkGlyphRun.h +FILE: ../../../third_party/skia/src/core/SkDevice.h +FILE: ../../../third_party/skia/src/core/SkScalar.cpp +FILE: ../../../third_party/skia/src/core/SkTextFormatParams.h +FILE: ../../../third_party/skia/src/images/SkJPEGWriteUtility.cpp +FILE: ../../../third_party/skia/src/images/SkJPEGWriteUtility.h +FILE: ../../../third_party/skia/src/pdf/SkDeflate.cpp +FILE: ../../../third_party/skia/src/pdf/SkDeflate.h +FILE: ../../../third_party/skia/src/pdf/SkPDFFormXObject.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFFormXObject.h +FILE: ../../../third_party/skia/src/pdf/SkPDFGraphicState.h +FILE: ../../../third_party/skia/src/pdf/SkPDFTypes.h ---------------------------------------------------------------------------------------------------- -Copyright 2018 The Android Open Source Project +Copyright 2010 The Android Open Source Project Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -20797,13 +20921,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkMatrixImageFilter.cpp + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/src/core/SkFlattenablePriv.h + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkMatrixImageFilter.cpp -FILE: ../../../third_party/skia/src/core/SkMatrixImageFilter.h -FILE: ../../../third_party/skia/src/opts/SkColor_opts_SSE2.h +FILE: ../../../third_party/skia/src/core/SkFlattenablePriv.h +FILE: ../../../third_party/skia/src/core/SkGlyphRun.cpp +FILE: ../../../third_party/skia/src/core/SkGlyphRun.h ---------------------------------------------------------------------------------------------------- -Copyright 2014 The Android Open Source Project +Copyright 2018 The Android Open Source Project Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -20834,12 +20958,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkScan_AAAPath.cpp + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/src/core/SkMatrixImageFilter.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkScan_AAAPath.cpp -FILE: ../../../third_party/skia/src/core/SkScan_DAAPath.cpp +FILE: ../../../third_party/skia/src/core/SkMatrixImageFilter.cpp +FILE: ../../../third_party/skia/src/core/SkMatrixImageFilter.h +FILE: ../../../third_party/skia/src/opts/SkColor_opts_SSE2.h ---------------------------------------------------------------------------------------------------- -Copyright 2016 The Android Open Source Project +Copyright 2014 The Android Open Source Project Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are From 015a6fa712b488825419632bd68179368abb7ce8 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 20 Jun 2018 10:27:41 -0400 Subject: [PATCH 0624/1190] Roll src/third_party/skia 14538ddf874e..6c56055f65fc (5 commits) (#5576) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7fae4f60f7daa..36b4cf2ac3eff 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '14538ddf874e1a146487dad02709929c4b63baf5', + 'skia_revision': '6c56055f65fc5a64a6124929f6313892cea18fe0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 041b7bccac688..2c3d7620121ec 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1570c26fb3ac06244ab79c9de27df68a +Signature: 4496b02fa0d9cc770662ab523b6bcf2e UNUSED LICENSES: @@ -17375,6 +17375,8 @@ FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineLayout.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineLayout.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp FILE: ../../../third_party/skia/src/opts/SkRasterPipeline_opts.h From 18debbbe465c6e82c12c77112b1cc8c9b9d41853 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 20 Jun 2018 13:52:41 -0400 Subject: [PATCH 0625/1190] Roll src/third_party/skia 6c56055f65fc..8c5f9ef80179 (12 commits) (#5577) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 30 +++++ travis/licenses_golden/licenses_third_party | 137 ++++++++++++-------- 3 files changed, 115 insertions(+), 54 deletions(-) diff --git a/DEPS b/DEPS index 36b4cf2ac3eff..9ae5c8d14f101 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6c56055f65fc5a64a6124929f6313892cea18fe0', + 'skia_revision': '8c5f9ef801793ec8a95918ad25729de847b119eb', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 4c6f819c95b1e..b278b4bce5968 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -10557,6 +10557,36 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- skia +Copyright 2018 Google LLC. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +skia + Copyright 2018 Google, LLC Redistribution and use in source and binary forms, with or without diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 2c3d7620121ec..151d579c25af3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4496b02fa0d9cc770662ab523b6bcf2e +Signature: 959fb3fb7500bd9187794c2971d76d2c UNUSED LICENSES: @@ -14407,7 +14407,7 @@ FILE: ../../../third_party/skia/src/compute/sk/SkSurface_Compute.cpp FILE: ../../../third_party/skia/src/compute/sk/SkSurface_Compute.h FILE: ../../../third_party/skia/src/compute/skc/assert_skc.c FILE: ../../../third_party/skia/src/compute/skc/assert_skc.h -FILE: ../../../third_party/skia/src/compute/skc/render.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/render.cl FILE: ../../../third_party/skia/src/compute/skc/styling.c FILE: ../../../third_party/skia/src/compute/skc/styling.h FILE: ../../../third_party/skia/src/compute/skc/styling_types.h @@ -17259,15 +17259,15 @@ FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.h FILE: ../../../third_party/skia/src/compute/hs/cl/bench/sort.cpp FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.c FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.h -FILE: ../../../third_party/skia/src/compute/skc/allocator_device_cl.c -FILE: ../../../third_party/skia/src/compute/skc/allocator_device_cl.h FILE: ../../../third_party/skia/src/compute/skc/allocator_host.c FILE: ../../../third_party/skia/src/compute/skc/allocator_host.h -FILE: ../../../third_party/skia/src/compute/skc/interop.c -FILE: ../../../third_party/skia/src/compute/skc/interop.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/allocator_device_cl.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/allocator_device_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/gl/interop.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/gl/interop.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttck.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttrk.cl FILE: ../../../third_party/skia/src/compute/skc/runtime.h -FILE: ../../../third_party/skia/src/compute/skc/segment_ttck.cl -FILE: ../../../third_party/skia/src/compute/skc/segment_ttrk.cl FILE: ../../../third_party/skia/src/compute/skc/suballocator.c FILE: ../../../third_party/skia/src/compute/skc/suballocator.h FILE: ../../../third_party/skia/src/compute/ts/transform_stack.c @@ -19280,6 +19280,7 @@ FILE: ../../../third_party/skia/gm/xfermodes3.cpp FILE: ../../../third_party/skia/include/core/SkDataTable.h FILE: ../../../third_party/skia/include/core/SkDocument.h FILE: ../../../third_party/skia/include/core/SkFontLCDConfig.h +FILE: ../../../third_party/skia/include/core/SkFontMgr.h FILE: ../../../third_party/skia/include/core/SkFontStyle.h FILE: ../../../third_party/skia/include/core/SkImageGenerator.h FILE: ../../../third_party/skia/include/core/SkImageInfo.h @@ -19293,7 +19294,6 @@ FILE: ../../../third_party/skia/include/effects/SkTileImageFilter.h FILE: ../../../third_party/skia/include/gpu/GrBlend.h FILE: ../../../third_party/skia/include/gpu/gl/GrGLExtensions.h FILE: ../../../third_party/skia/include/ports/SkFontConfigInterface.h -FILE: ../../../third_party/skia/include/ports/SkFontMgr.h FILE: ../../../third_party/skia/include/private/GrTypesPriv.h FILE: ../../../third_party/skia/include/private/SkMessageBus.h FILE: ../../../third_party/skia/include/private/SkOnce.h @@ -19573,75 +19573,71 @@ FILE: ../../../third_party/skia/src/codec/SkStubHeifDecoderAPI.h FILE: ../../../third_party/skia/src/compute/color/color.c FILE: ../../../third_party/skia/src/compute/color/color.h FILE: ../../../third_party/skia/src/compute/skc/assert_state.h -FILE: ../../../third_party/skia/src/compute/skc/atomic_cl.h FILE: ../../../third_party/skia/src/compute/skc/block.h -FILE: ../../../third_party/skia/src/compute/skc/block_pool_cl.h -FILE: ../../../third_party/skia/src/compute/skc/block_pool_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/block_pool_init.cl -FILE: ../../../third_party/skia/src/compute/skc/cl_20/extent.c -FILE: ../../../third_party/skia/src/compute/skc/cl_20/extent.h -FILE: ../../../third_party/skia/src/compute/skc/cl_20/ring_cl_svm_fine.cpp -FILE: ../../../third_party/skia/src/compute/skc/cl_20/ring_cl_svm_fine.h FILE: ../../../third_party/skia/src/compute/skc/common.h FILE: ../../../third_party/skia/src/compute/skc/composition.c FILE: ../../../third_party/skia/src/compute/skc/composition.h -FILE: ../../../third_party/skia/src/compute/skc/composition_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/composition_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/config_cl.h FILE: ../../../third_party/skia/src/compute/skc/context.c FILE: ../../../third_party/skia/src/compute/skc/context.h -FILE: ../../../third_party/skia/src/compute/skc/cq_pool_cl.c -FILE: ../../../third_party/skia/src/compute/skc/cq_pool_cl.h -FILE: ../../../third_party/skia/src/compute/skc/device_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/device_cl_12_avx2.h -FILE: ../../../third_party/skia/src/compute/skc/device_cl_12_gen9.c -FILE: ../../../third_party/skia/src/compute/skc/device_cl_12_gen9.h -FILE: ../../../third_party/skia/src/compute/skc/export_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/extent_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/extent_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/extent_cl_12_unified.c FILE: ../../../third_party/skia/src/compute/skc/extent_ring.c FILE: ../../../third_party/skia/src/compute/skc/extent_ring.h -FILE: ../../../third_party/skia/src/compute/skc/fills_expand.cl FILE: ../../../third_party/skia/src/compute/skc/grid.c FILE: ../../../third_party/skia/src/compute/skc/grid.h FILE: ../../../third_party/skia/src/compute/skc/handle.h -FILE: ../../../third_party/skia/src/compute/skc/handle_pool_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/handle_pool_cl_12.h FILE: ../../../third_party/skia/src/compute/skc/macros.h FILE: ../../../third_party/skia/src/compute/skc/main.c FILE: ../../../third_party/skia/src/compute/skc/path.h FILE: ../../../third_party/skia/src/compute/skc/path_builder.c FILE: ../../../third_party/skia/src/compute/skc/path_builder.h -FILE: ../../../third_party/skia/src/compute/skc/path_builder_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/path_builder_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/paths_copy.cl -FILE: ../../../third_party/skia/src/compute/skc/paths_reclaim.cl -FILE: ../../../third_party/skia/src/compute/skc/place.cl -FILE: ../../../third_party/skia/src/compute/skc/prefix.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/atomic_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/block_pool_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/block_pool_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/composition_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/composition_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/config_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/cq_pool_cl.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/cq_pool_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/device_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/export_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/extent_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/extent_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/extent_cl_12_unified.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/handle_pool_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/handle_pool_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/block_pool_init.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/avx2/device_cl_12_avx2.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/gen9/device_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/gen9/device_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/fills_expand.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/paths_copy.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/paths_reclaim.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/place.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/prefix.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/rasterize.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/rasters_alloc.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/rasters_reclaim.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/path_builder_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/path_builder_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/styling_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/styling_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/surface_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/surface_cl_12_buffer.c FILE: ../../../third_party/skia/src/compute/skc/raster.h FILE: ../../../third_party/skia/src/compute/skc/raster_builder.c FILE: ../../../third_party/skia/src/compute/skc/raster_builder.h -FILE: ../../../third_party/skia/src/compute/skc/raster_builder_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/raster_builder_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/rasterize.cl -FILE: ../../../third_party/skia/src/compute/skc/rasters_alloc.cl -FILE: ../../../third_party/skia/src/compute/skc/rasters_reclaim.cl -FILE: ../../../third_party/skia/src/compute/skc/runtime_cl.c -FILE: ../../../third_party/skia/src/compute/skc/runtime_cl.h -FILE: ../../../third_party/skia/src/compute/skc/runtime_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/runtime_cl_12.h FILE: ../../../third_party/skia/src/compute/skc/scheduler.cpp FILE: ../../../third_party/skia/src/compute/skc/scheduler.h FILE: ../../../third_party/skia/src/compute/skc/skc.h FILE: ../../../third_party/skia/src/compute/skc/skc_styling.h -FILE: ../../../third_party/skia/src/compute/skc/styling_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/styling_cl_12.h FILE: ../../../third_party/skia/src/compute/skc/subblock.h FILE: ../../../third_party/skia/src/compute/skc/surface.c FILE: ../../../third_party/skia/src/compute/skc/surface.h -FILE: ../../../third_party/skia/src/compute/skc/surface_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/surface_cl_12_buffer.c FILE: ../../../third_party/skia/src/compute/skc/types.h FILE: ../../../third_party/skia/src/compute/skc/util.h FILE: ../../../third_party/skia/src/compute/skc/weakref.c @@ -20582,6 +20578,41 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/ports/SkFontMgr.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/ports/SkFontMgr.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 Google LLC. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/include/utils/SkEventTracer.h + ../../../third_party/skia/LICENSE @@ -22102,4 +22133,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 323 +Total license count: 324 From 1e40f5bc0b1d8a1ccfcaea0c551def912788d7f2 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 20 Jun 2018 10:54:58 -0700 Subject: [PATCH 0626/1190] Make Engine::GetFontCollection public (#5578) Required by the Fuchsia embedder --- shell/common/engine.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell/common/engine.h b/shell/common/engine.h index a6ac5b413f2f6..0bbb524aae179 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -99,6 +99,9 @@ class Engine final : public blink::RuntimeDelegate { void ScheduleFrame(bool regenerate_layer_tree = true) override; + // |blink::RuntimeDelegate| + blink::FontCollection& GetFontCollection() override; + private: Engine::Delegate& delegate_; const blink::Settings settings_; @@ -126,9 +129,6 @@ class Engine final : public blink::RuntimeDelegate { void HandlePlatformMessage( fxl::RefPtr message) override; - // |blink::RuntimeDelegate| - blink::FontCollection& GetFontCollection() override; - void StopAnimator(); void StartAnimatorIfPossible(); From e2899d7e6e90efb8ee287685572bd53f037d9bbb Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 20 Jun 2018 17:21:40 -0400 Subject: [PATCH 0627/1190] Roll src/third_party/skia 8c5f9ef80179..5e11777a06d5 (5 commits) (#5579) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9ae5c8d14f101..10add88a53820 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8c5f9ef801793ec8a95918ad25729de847b119eb', + 'skia_revision': '5e11777a06d591c1e6ab0523e9c7f4739e164609', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 151d579c25af3..c6e8e8cb5767d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 959fb3fb7500bd9187794c2971d76d2c +Signature: c868cd248fbd42eff9d3f0a7f2357164 UNUSED LICENSES: From a06b790eb4aec2a35f489db309c32371c397ca9d Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 20 Jun 2018 20:49:40 -0400 Subject: [PATCH 0628/1190] Roll src/third_party/skia 5e11777a06d5..ffc01057e18e (8 commits) (#5581) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 10add88a53820..1d85b26b357e8 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5e11777a06d591c1e6ab0523e9c7f4739e164609', + 'skia_revision': 'ffc01057e18e0b4fbf1cbe0e6cfb62e100ca8215', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c6e8e8cb5767d..5d75a2d58c3f1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c868cd248fbd42eff9d3f0a7f2357164 +Signature: 84288de02a899bb89385da167117ce42 UNUSED LICENSES: From 3528b4851df08a687bbb6191058d0381ebb3f34f Mon Sep 17 00:00:00 2001 From: Sigurd Meldgaard Date: Thu, 21 Jun 2018 12:43:38 +0200 Subject: [PATCH 0629/1190] Postpone dart initialization to -viewWillAppear on iOS (#5553) --- .../framework/Source/FlutterViewController.mm | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index e3076c6c05ca7..b69a40c21e0f3 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -167,18 +167,6 @@ - (BOOL)setupShell { return false; } - // Launch the Dart application with the inferred run configuration. - _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = _shell->GetEngine(), // - config = [_dartProject.get() runConfiguration] // - ]() mutable { - if (engine) { - auto result = engine->Run(std::move(config)); - if (!result) { - FXL_LOG(ERROR) << "Could not launch engine with configuration."; - } - } - })); return true; } @@ -398,6 +386,20 @@ - (void)surfaceUpdated:(BOOL)appeared { - (void)viewWillAppear:(BOOL)animated { TRACE_EVENT0("flutter", "viewWillAppear"); + + // Launch the Dart application with the inferred run configuration. + _shell->GetTaskRunners().GetUITaskRunner()->PostTask( + fxl::MakeCopyable([engine = _shell->GetEngine(), // + config = [_dartProject.get() runConfiguration] // + ]() mutable { + if (engine) { + auto result = engine->Run(std::move(config)); + if (!result) { + FXL_LOG(ERROR) << "Could not launch engine with configuration."; + } + } + })); + // Only recreate surface on subsequent appearances when viewport metrics are known. // First time surface creation is done on viewDidLayoutSubviews. if (_viewportMetrics.physical_width) From ab1b0db966db198442870339a4569c53b8f34671 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Thu, 21 Jun 2018 15:44:04 -0700 Subject: [PATCH 0630/1190] No-copy kernel loading. (#5580) Required by https://dart-review.googlesource.com/c/sdk/+/60202 --- runtime/dart_isolate.cc | 17 +++++++++++------ runtime/dart_isolate.h | 8 ++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 66af59a5872c7..8774a827f9842 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -278,8 +278,9 @@ bool DartIsolate::PrepareForRunningFromPrecompiledCode() { return true; } -static bool LoadScriptSnapshot(std::shared_ptr mapping, - bool last_piece) { +bool DartIsolate::LoadScriptSnapshot( + std::shared_ptr mapping, + bool last_piece) { FXL_CHECK(last_piece) << "Script snapshots cannot be divided"; if (tonic::LogIfError(Dart_LoadScriptFromSnapshot(mapping->GetMapping(), mapping->GetSize()))) { @@ -288,8 +289,12 @@ static bool LoadScriptSnapshot(std::shared_ptr mapping, return true; } -static bool LoadKernelSnapshot(std::shared_ptr mapping, - bool last_piece) { +bool DartIsolate::LoadKernelSnapshot( + std::shared_ptr mapping, + bool last_piece) { + // Mapping must be retained until isolate shutdown. + kernel_buffers_.push_back(mapping); + Dart_Handle library = Dart_LoadLibraryFromKernel(mapping->GetMapping(), mapping->GetSize()); if (tonic::LogIfError(library)) { @@ -308,8 +313,8 @@ static bool LoadKernelSnapshot(std::shared_ptr mapping, return true; } -static bool LoadSnapshot(std::shared_ptr mapping, - bool last_piece) { +bool DartIsolate::LoadSnapshot(std::shared_ptr mapping, + bool last_piece) { if (Dart_IsKernel(mapping->GetMapping(), mapping->GetSize())) { return LoadKernelSnapshot(std::move(mapping), last_piece); } else { diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index ceed7a0fd7a2a..fe928f40794ab 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -92,6 +92,13 @@ class DartIsolate : public UIDartState { fml::WeakPtr GetWeakIsolatePtr() const; private: + bool LoadScriptSnapshot(std::shared_ptr mapping, + bool last_piece); + bool LoadKernelSnapshot(std::shared_ptr mapping, + bool last_piece); + bool LoadSnapshot(std::shared_ptr mapping, + bool last_piece); + class AutoFireClosure { public: AutoFireClosure(fxl::Closure closure) : closure_(std::move(closure)) {} @@ -111,6 +118,7 @@ class DartIsolate : public UIDartState { Phase phase_ = Phase::Unknown; const fxl::RefPtr isolate_snapshot_; const fxl::RefPtr shared_snapshot_; + std::vector> kernel_buffers_; std::vector> shutdown_callbacks_; ChildIsolatePreparer child_isolate_preparer_; std::unique_ptr> weak_factory_; From 349d9d908508510d549f23cac0f9b6eda7ec761c Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Thu, 21 Jun 2018 15:55:28 -0700 Subject: [PATCH 0631/1190] Temporarily pin Travis Dart SDK to 2.0.0-dev.63.0 (#5586) This is a temporary workaround to unbreak the build. The breakage was caused by differences in the latest released dev Dart SDK (2.0.0-dev.64.0) and the version currently used by Flutter (2.0.0-dev.63.0). Revert once the SDK has been updated in the engine. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a5c1f32a3e622..043404ff10922 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: dart dart: - - dev + - "dev/release/2.0.0-dev.63.0" sudo: false before_script: - ./travis/setup.sh From 74ea64e912b52bb935232bb4aea458691c8bdc25 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 21 Jun 2018 18:05:54 -0700 Subject: [PATCH 0632/1190] Add a rowBytes parameter to decodeImageFromPixels (#5573) See https://github.com/flutter/flutter/issues/9184 --- lib/ui/painting.dart | 14 ++++++++--- lib/ui/painting/codec.cc | 53 ++++++++++++++++++++++++++++++---------- 2 files changed, 51 insertions(+), 16 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index b8aa56c718675..6ee345816fe48 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1381,10 +1381,13 @@ enum PixelFormat { } class _ImageInfo { - _ImageInfo(this.width, this.height, this.format); + _ImageInfo(this.width, this.height, this.format, this.rowBytes) { + rowBytes ??= width * 4; + } int width; int height; int format; + int rowBytes; } /// Opaque handle to raw decoded image data (pixels). @@ -1529,14 +1532,19 @@ Future _decodeImageFromListAsync(Uint8List list, /// Convert an array of pixel values into an [Image] object. /// /// [pixels] is the pixel data in the encoding described by [format]. +/// +/// [rowBytes] is the number of bytes consumed by each row of pixels in the +/// data buffer. If unspecified, it defaults to [width] multipled by the +/// number of bytes per pixel in the provided [format]. void decodeImageFromPixels( Uint8List pixels, int width, int height, PixelFormat format, - ImageDecoderCallback callback + ImageDecoderCallback callback, + {int rowBytes} ) { - final _ImageInfo imageInfo = new _ImageInfo(width, height, format.index); + final _ImageInfo imageInfo = new _ImageInfo(width, height, format.index, rowBytes); final Future codecFuture = _futurize( (_Callback callback) => _instantiateImageCodec(pixels, callback, imageInfo) ); diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index ddee0dedc0149..4b52881f5405c 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -38,6 +38,11 @@ enum PixelFormat { kBGRA8888, }; +struct ImageInfo { + SkImageInfo sk_info; + size_t row_bytes; +}; + static void InvokeCodecCallback(fxl::RefPtr codec, std::unique_ptr callback, size_t trace_id) { @@ -113,7 +118,7 @@ fxl::RefPtr InitCodec(fml::WeakPtr context, fxl::RefPtr InitCodecUncompressed( fml::WeakPtr context, sk_sp buffer, - SkImageInfo image_info, + ImageInfo image_info, fxl::RefPtr unref_queue, size_t trace_id) { TRACE_FLOW_STEP("flutter", kInitCodecTraceTag, trace_id); @@ -126,12 +131,12 @@ fxl::RefPtr InitCodecUncompressed( sk_sp skImage; if (context) { - SkPixmap pixmap(image_info, buffer->data(), image_info.minRowBytes()); + SkPixmap pixmap(image_info.sk_info, buffer->data(), image_info.row_bytes); skImage = SkImage::MakeCrossContextFromPixmap(context.get(), pixmap, false, nullptr, true); } else { - skImage = SkImage::MakeRasterData(image_info, std::move(buffer), - image_info.minRowBytes()); + skImage = SkImage::MakeRasterData(image_info.sk_info, std::move(buffer), + image_info.row_bytes); } auto image = CanvasImage::Create(); @@ -146,7 +151,7 @@ void InitCodecAndInvokeCodecCallback( fxl::RefPtr unref_queue, std::unique_ptr callback, sk_sp buffer, - std::unique_ptr image_info, + std::unique_ptr image_info, size_t trace_id) { fxl::RefPtr codec; if (image_info) { @@ -165,7 +170,7 @@ void InitCodecAndInvokeCodecCallback( bool ConvertImageInfo(Dart_Handle image_info_handle, Dart_NativeArguments args, - SkImageInfo* image_info) { + ImageInfo* image_info) { Dart_Handle width_handle = Dart_GetField(image_info_handle, ToDart("width")); if (!Dart_IsInteger(width_handle)) { Dart_SetReturnValue(args, ToDart("ImageInfo.width must be an integer")); @@ -183,6 +188,12 @@ bool ConvertImageInfo(Dart_Handle image_info_handle, Dart_SetReturnValue(args, ToDart("ImageInfo.format must be an integer")); return false; } + Dart_Handle row_bytes_handle = + Dart_GetField(image_info_handle, ToDart("rowBytes")); + if (!Dart_IsInteger(row_bytes_handle)) { + Dart_SetReturnValue(args, ToDart("ImageInfo.rowBytes must be an integer")); + return false; + } PixelFormat pixel_format = static_cast( tonic::DartConverter::FromDart(format_handle)); @@ -200,10 +211,26 @@ bool ConvertImageInfo(Dart_Handle image_info_handle, return false; } - *image_info = - SkImageInfo::Make(tonic::DartConverter::FromDart(width_handle), - tonic::DartConverter::FromDart(height_handle), - color_type, kPremul_SkAlphaType); + int width = tonic::DartConverter::FromDart(width_handle); + if (width <= 0) { + Dart_SetReturnValue(args, ToDart("width must be greater than zero")); + return false; + } + int height = tonic::DartConverter::FromDart(height_handle); + if (height <= 0) { + Dart_SetReturnValue(args, ToDart("height must be greater than zero")); + return false; + } + image_info->sk_info = + SkImageInfo::Make(width, height, color_type, kPremul_SkAlphaType); + image_info->row_bytes = + tonic::DartConverter::FromDart(row_bytes_handle); + + if (image_info->row_bytes < image_info->sk_info.minRowBytes()) { + Dart_SetReturnValue( + args, ToDart("rowBytes does not match the width of the image")); + return false; + } return true; } @@ -221,9 +248,9 @@ void InstantiateImageCodec(Dart_NativeArguments args) { } Dart_Handle image_info_handle = Dart_GetNativeArgument(args, 2); - std::unique_ptr image_info; + std::unique_ptr image_info; if (!Dart_IsNull(image_info_handle)) { - image_info = std::make_unique(); + image_info = std::make_unique(); if (!ConvertImageInfo(image_info_handle, args, image_info.get())) { TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); return; @@ -240,7 +267,7 @@ void InstantiateImageCodec(Dart_NativeArguments args) { } if (image_info) { - int expected_size = image_info->minRowBytes() * image_info->height(); + int expected_size = image_info->row_bytes * image_info->sk_info.height(); if (list.num_elements() < expected_size) { TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); list.Release(); From b5a48fa2c9c886df614673d063593453f854b5f5 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 21 Jun 2018 21:47:38 -0400 Subject: [PATCH 0633/1190] Roll src/third_party/skia ffc01057e18e..f01c24ff435e (34 commits) (#5590) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index 1d85b26b357e8..9a917fd16b83a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ffc01057e18e0b4fbf1cbe0e6cfb62e100ca8215', + 'skia_revision': 'f01c24ff435e432d3dea227f437c9e0c83da2bcc', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5d75a2d58c3f1..3c4aaa0f3420b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 84288de02a899bb89385da167117ce42 +Signature: b7f93be185eeb5a0d0ff208cc5267eef UNUSED LICENSES: @@ -14389,6 +14389,9 @@ FILE: ../../../third_party/skia/src/compute/common/macros.h FILE: ../../../third_party/skia/src/compute/common/util.c FILE: ../../../third_party/skia/src/compute/common/util.h FILE: ../../../third_party/skia/src/compute/hs/cl/bench/main.c +FILE: ../../../third_party/skia/src/compute/hs/cl/gen9/hs_cl.cl +FILE: ../../../third_party/skia/src/compute/hs/cl/gen9/hs_cl.h +FILE: ../../../third_party/skia/src/compute/hs/cl/gen9/hs_cl_macros.h FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.c FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.h FILE: ../../../third_party/skia/src/compute/hs/gen/gen.h @@ -17268,6 +17271,8 @@ FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/gl/interop.h FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttck.cl FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttrk.cl FILE: ../../../third_party/skia/src/compute/skc/runtime.h +FILE: ../../../third_party/skia/src/compute/skc/skc_err.h +FILE: ../../../third_party/skia/src/compute/skc/skc_types.h FILE: ../../../third_party/skia/src/compute/skc/suballocator.c FILE: ../../../third_party/skia/src/compute/skc/suballocator.h FILE: ../../../third_party/skia/src/compute/ts/transform_stack.c @@ -17719,8 +17724,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/failed_all_upd FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/failed_one_update.json FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/infra_tests.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_NoGPUThreads.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-GCC-Chorizo-GPU-Cortex_A7-arm-Release-All.json @@ -17740,8 +17745,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/Housek FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/Housekeeper-Weekly-RecreateSKPs.json FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/failed_upload.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Release-All-Android_CCPR_Skpbench.json -FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Skpbench.json -FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-PixelC-GPU-TegraX1-arm64-Release-All-Android_Vulkan_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench_DDLRecord_9x9.json FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench_DDLTotal_9x9.json @@ -19607,7 +19610,7 @@ FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/handle_pool_cl_1 FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/block_pool_init.cl FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/avx2/device_cl_12_avx2.h FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/gen9/device_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/gen9/device_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/gen9/kernel_cl_12.h FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/fills_expand.cl FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/paths_copy.cl FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/paths_reclaim.cl @@ -19620,8 +19623,6 @@ FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/path_builder_cl_ FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/path_builder_cl_12.h FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_cl_12.c FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl.h FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.c FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.h FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/styling_cl_12.c @@ -19634,6 +19635,7 @@ FILE: ../../../third_party/skia/src/compute/skc/raster_builder.h FILE: ../../../third_party/skia/src/compute/skc/scheduler.cpp FILE: ../../../third_party/skia/src/compute/skc/scheduler.h FILE: ../../../third_party/skia/src/compute/skc/skc.h +FILE: ../../../third_party/skia/src/compute/skc/skc_create_cl.h FILE: ../../../third_party/skia/src/compute/skc/skc_styling.h FILE: ../../../third_party/skia/src/compute/skc/subblock.h FILE: ../../../third_party/skia/src/compute/skc/surface.c @@ -20127,6 +20129,7 @@ FILE: ../../../third_party/skia/include/private/SkFloatingPoint.h FILE: ../../../third_party/skia/include/private/SkTDArray.h FILE: ../../../third_party/skia/include/private/SkTSearch.h FILE: ../../../third_party/skia/include/private/SkTemplates.h +FILE: ../../../third_party/skia/include/utils/SkBase64.h FILE: ../../../third_party/skia/include/utils/SkCamera.h FILE: ../../../third_party/skia/include/utils/SkInterpolator.h FILE: ../../../third_party/skia/include/utils/SkParse.h @@ -20548,6 +20551,7 @@ LIBRARY: skia ORIGIN: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h +FILE: ../../../third_party/skia/include/utils/SkTraceEventPhase.h ---------------------------------------------------------------------------------------------------- Copyright 2018 The Chromium Authors. All rights reserved. From 58ea762dc70d1878b5ab6f0ac482482b161cbc64 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 22 Jun 2018 01:11:37 -0400 Subject: [PATCH 0634/1190] Roll src/third_party/skia f01c24ff435e..5741a5ba7f36 (3 commits) (#5591) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9a917fd16b83a..2c6c09df492af 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f01c24ff435e432d3dea227f437c9e0c83da2bcc', + 'skia_revision': '5741a5ba7f369a85cb1f93466cb710bcb0bb49d5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3c4aaa0f3420b..9f15056f956d5 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b7f93be185eeb5a0d0ff208cc5267eef +Signature: 1b2c945f2cc40253978f1117db34dee1 UNUSED LICENSES: From 3b6c8395083b786d3ffa84cd7111b5ae19fd9d4b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 22 Jun 2018 10:48:34 -0400 Subject: [PATCH 0635/1190] Roll src/third_party/skia 5741a5ba7f36..5e0909776e81 (1 commits) (#5594) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 2c6c09df492af..3836e8e8210e0 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5741a5ba7f369a85cb1f93466cb710bcb0bb49d5', + 'skia_revision': '5e0909776e81803dd140255fb89fa19e3b8d158f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From f9998a07bddfdcdf923a5f3cd112248f546bfa77 Mon Sep 17 00:00:00 2001 From: bungeman Date: Fri, 22 Jun 2018 11:04:58 -0400 Subject: [PATCH 0636/1190] Change ports/SkFontMgr.h to core/SkFontMgr.h (#5593) Skia is moving ports/SkFontMgr.h to core/SkFontMgr.h. The existing ports/SkFontMgr.h is now just a forwarding header to keep users working through the transition. Update includes to point to the new location. --- lib/ui/text/asset_manager_font_provider.h | 2 +- lib/ui/text/font_collection.cc | 2 +- third_party/txt/src/txt/asset_font_manager.h | 2 +- third_party/txt/src/txt/font_asset_provider.h | 2 +- third_party/txt/src/txt/font_collection.h | 2 +- third_party/txt/src/txt/test_font_manager.h | 2 +- third_party/txt/src/txt/typeface_font_asset_provider.h | 2 +- travis/licenses_golden/licenses_third_party | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/ui/text/asset_manager_font_provider.h b/lib/ui/text/asset_manager_font_provider.h index c0450c83ccb09..f9bc2fc6a2179 100644 --- a/lib/ui/text/asset_manager_font_provider.h +++ b/lib/ui/text/asset_manager_font_provider.h @@ -11,7 +11,7 @@ #include "flutter/assets/asset_manager.h" #include "lib/fxl/macros.h" -#include "third_party/skia/include/ports/SkFontMgr.h" +#include "third_party/skia/include/core/SkFontMgr.h" #include "txt/font_asset_provider.h" namespace blink { diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index 279fb1b4800ea..67012519c9f7d 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -10,9 +10,9 @@ #include "flutter/runtime/test_font_data.h" #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/rapidjson.h" +#include "third_party/skia/include/core/SkFontMgr.h" #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" -#include "third_party/skia/include/ports/SkFontMgr.h" #include "txt/asset_font_manager.h" #include "txt/test_font_manager.h" #include "txt/typeface_font_asset_provider.h" diff --git a/third_party/txt/src/txt/asset_font_manager.h b/third_party/txt/src/txt/asset_font_manager.h index c6d0bc1b2f79b..6cfc3de65da50 100644 --- a/third_party/txt/src/txt/asset_font_manager.h +++ b/third_party/txt/src/txt/asset_font_manager.h @@ -19,8 +19,8 @@ #include #include "lib/fxl/macros.h" +#include "third_party/skia/include/core/SkFontMgr.h" #include "third_party/skia/include/core/SkStream.h" -#include "third_party/skia/include/ports/SkFontMgr.h" #include "txt/font_asset_provider.h" namespace txt { diff --git a/third_party/txt/src/txt/font_asset_provider.h b/third_party/txt/src/txt/font_asset_provider.h index 397ed2ec6e483..766064674db23 100644 --- a/third_party/txt/src/txt/font_asset_provider.h +++ b/third_party/txt/src/txt/font_asset_provider.h @@ -17,7 +17,7 @@ #ifndef TXT_FONT_ASSET_PROVIDER_H_ #define TXT_FONT_ASSET_PROVIDER_H_ -#include "third_party/skia/include/ports/SkFontMgr.h" +#include "third_party/skia/include/core/SkFontMgr.h" namespace txt { diff --git a/third_party/txt/src/txt/font_collection.h b/third_party/txt/src/txt/font_collection.h index 698eca17642a4..33cc7ff5b6b0f 100644 --- a/third_party/txt/src/txt/font_collection.h +++ b/third_party/txt/src/txt/font_collection.h @@ -25,8 +25,8 @@ #include "minikin/FontCollection.h" #include "minikin/FontFamily.h" #include "third_party/googletest/googletest/include/gtest/gtest_prod.h" // nogncheck +#include "third_party/skia/include/core/SkFontMgr.h" #include "third_party/skia/include/core/SkRefCnt.h" -#include "third_party/skia/include/ports/SkFontMgr.h" #include "txt/asset_font_manager.h" #include "txt/text_style.h" diff --git a/third_party/txt/src/txt/test_font_manager.h b/third_party/txt/src/txt/test_font_manager.h index dd4f2c32bea44..0b1ba132ee7f0 100644 --- a/third_party/txt/src/txt/test_font_manager.h +++ b/third_party/txt/src/txt/test_font_manager.h @@ -21,7 +21,7 @@ #include #include "lib/fxl/macros.h" -#include "third_party/skia/include/ports/SkFontMgr.h" +#include "third_party/skia/include/core/SkFontMgr.h" #include "txt/asset_font_manager.h" #include "txt/font_asset_provider.h" diff --git a/third_party/txt/src/txt/typeface_font_asset_provider.h b/third_party/txt/src/txt/typeface_font_asset_provider.h index f41b5b7c3473d..d540e059c3349 100644 --- a/third_party/txt/src/txt/typeface_font_asset_provider.h +++ b/third_party/txt/src/txt/typeface_font_asset_provider.h @@ -22,7 +22,7 @@ #include #include "lib/fxl/macros.h" -#include "third_party/skia/include/ports/SkFontMgr.h" +#include "third_party/skia/include/core/SkFontMgr.h" #include "txt/font_asset_provider.h" namespace txt { diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9f15056f956d5..148e1ae6ffeab 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -20584,9 +20584,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/ports/SkFontMgr.h + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/include/core/SkFontMgr.h + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/ports/SkFontMgr.h +FILE: ../../../third_party/skia/include/core/SkFontMgr.h ---------------------------------------------------------------------------------------------------- Copyright 2018 Google LLC. From 9b9936ec4a4a6225d72969299da2514429c67395 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 22 Jun 2018 14:14:34 -0400 Subject: [PATCH 0637/1190] Roll src/third_party/skia 5e0909776e81..96b1ecc25d00 (8 commits) (#5595) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 30 ---------------- travis/licenses_golden/licenses_third_party | 39 ++------------------- 3 files changed, 3 insertions(+), 68 deletions(-) diff --git a/DEPS b/DEPS index 3836e8e8210e0..5312f15500783 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5e0909776e81803dd140255fb89fa19e3b8d158f', + 'skia_revision': '96b1ecc25d00a3d52dcc51a788b0df0acdd1dad9', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index b278b4bce5968..4c6f819c95b1e 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -10557,36 +10557,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- skia -Copyright 2018 Google LLC. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -skia - Copyright 2018 Google, LLC Redistribution and use in source and binary forms, with or without diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 148e1ae6ffeab..e1eab920d0b78 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1b2c945f2cc40253978f1117db34dee1 +Signature: 7209f4630c616d4ce27e88a8b0770d0d UNUSED LICENSES: @@ -20582,41 +20582,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/core/SkFontMgr.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/core/SkFontMgr.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 Google LLC. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: skia ORIGIN: ../../../third_party/skia/include/utils/SkEventTracer.h + ../../../third_party/skia/LICENSE @@ -22137,4 +22102,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 324 +Total license count: 323 From 29b187bdd2232153cfa2a1558afd2beca15d8ad0 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 22 Jun 2018 17:39:34 -0400 Subject: [PATCH 0638/1190] Roll src/third_party/skia 96b1ecc25d00..73be50da2a1f (13 commits) (#5596) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 5312f15500783..4dd52f9ccae2f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '96b1ecc25d00a3d52dcc51a788b0df0acdd1dad9', + 'skia_revision': '73be50da2a1fe8944f2623a511fda1957eed708a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e1eab920d0b78..a69e99e4f91a0 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7209f4630c616d4ce27e88a8b0770d0d +Signature: 5e9e954fa5d3ecc99a6e5ac44747f06f UNUSED LICENSES: @@ -17250,12 +17250,12 @@ FILE: ../../../third_party/skia/modules/sksg/src/SkSGPlane.cpp FILE: ../../../third_party/skia/modules/sksg/src/SkSGRoundEffect.cpp FILE: ../../../third_party/skia/modules/sksg/src/SkSGScene.cpp FILE: ../../../third_party/skia/modules/sksg/src/SkSGText.cpp -FILE: ../../../third_party/skia/samplecode/Nima.cpp -FILE: ../../../third_party/skia/samplecode/Nima.h FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp FILE: ../../../third_party/skia/samplecode/SampleGlyphTransform.cpp FILE: ../../../third_party/skia/samplecode/SampleNima.cpp +FILE: ../../../third_party/skia/samplecode/SampleNimaActor.cpp +FILE: ../../../third_party/skia/samplecode/SampleNimaActor.h FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.c FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.h From 9c15b44ec5147d8d867ad0bcd67f300bb827e4d5 Mon Sep 17 00:00:00 2001 From: matthew-carroll Date: Fri, 22 Jun 2018 21:50:51 +0000 Subject: [PATCH 0639/1190] Android instructions format improvement in CONTRIBUTING.md (#5589) --- CONTRIBUTING.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b34eda16e30d1..71c923b71e4f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -103,11 +103,21 @@ Depending on the platform you choose below, you will need to replace `host_debug Run the following steps, from the `src` directory created in the steps above: -* `git pull upstream master` in `src/flutter` to update the Flutter Engine repo. -* `gclient sync` to update your dependencies. -* `./flutter/tools/gn --android --unoptimized` to prepare your build files for device-side executables (or `--android --android-cpu [x86|x64] --unoptimized` for x86/x64 emulators) . -* `./flutter/tools/gn --unoptimized` to prepare the build files for host-side executables. -* `ninja -C out/android_debug_unopt && ninja -C out/host_debug_unopt` to build all executables (use `out/android_debug_unopt_x64` for x86/x64 emulators). +* Update the Flutter Engine repo. + * `git pull upstream master` in `src/flutter` +* Update your dependencies + * `gclient sync` +* Prepare your build files + * `./flutter/tools/gn --android --unoptimized` for device-side executables + * `./flutter/tools/gn --android --android-cpu x86 --unoptimized` for x86 emulators + * `./flutter/tools/gn --android --android-cpu x64 --unoptimized` for x64 emulators + * `./flutter/tools/gn --unoptimized` for host-side executables +* Build your executables + * `ninja -C out/android_debug_unopt` for device-side executables + * `ninja -C out/android_debug_unopt_x86` for x86 emulators + * `ninja -C out/android_debug_unopt_x64` for x64 emulators + * `ninja -C out/host_debug_unopt` for host-side executables + * These commands can be combined. Ex: `ninja -C out/android_debug_unopt && ninja -C out/host_debug_unopt` * For Googlers, consider also using the option `-j 1000` to parallelize the build using Goma. This builds a debug-enabled ("unoptimized") binary configured to run Dart in From 1dc51f9d8657b2a9f6e34f4c9b7bd260ef2512d6 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 22 Jun 2018 21:59:34 -0400 Subject: [PATCH 0640/1190] Roll src/third_party/skia 73be50da2a1f..c2cc67b5c3a7 (1 commits) (#5599) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4dd52f9ccae2f..2b824ca2306f9 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '73be50da2a1fe8944f2623a511fda1957eed708a', + 'skia_revision': 'c2cc67b5c3a762b5001110cb5ba84c1719d2bf47', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a69e99e4f91a0..1bd629dc2f6b9 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5e9e954fa5d3ecc99a6e5ac44747f06f +Signature: 42128e050e1334a31db3dad1b535798d UNUSED LICENSES: From 9e2bc2dc706639aa127e32d0a892dd5363efa8b3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 23 Jun 2018 01:13:34 -0400 Subject: [PATCH 0641/1190] Roll src/third_party/skia c2cc67b5c3a7..7454cbdd1596 (1 commits) (#5600) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 2b824ca2306f9..e9f7c1832db2b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c2cc67b5c3a762b5001110cb5ba84c1719d2bf47', + 'skia_revision': '7454cbdd159689e52909f6313d10f66846d89ac3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From f14cfdef1c9ed42363d3e03f701628b05478f456 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 24 Jun 2018 04:59:34 -0400 Subject: [PATCH 0642/1190] Roll src/third_party/skia 7454cbdd1596..5f0cc0e06651 (1 commits) (#5602) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e9f7c1832db2b..29acd228a1104 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7454cbdd159689e52909f6313d10f66846d89ac3', + 'skia_revision': '5f0cc0e0665143d4d7b1a5ff06cf8df747068463', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1bd629dc2f6b9..baebf4240ad0e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 42128e050e1334a31db3dad1b535798d +Signature: 735395be7ffeceb29476cc9235a6687a UNUSED LICENSES: From 1e2f8c8e62d6cc159e864cb05bb7349884fd5400 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 24 Jun 2018 12:20:34 -0400 Subject: [PATCH 0643/1190] Roll src/third_party/skia 5f0cc0e06651..ebf160f308b6 (1 commits) (#5603) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/DEPS b/DEPS index 29acd228a1104..0468eb75a7b8b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5f0cc0e0665143d4d7b1a5ff06cf8df747068463', + 'skia_revision': 'ebf160f308b698c075c9c1cf8d65d40cb2486238', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index baebf4240ad0e..7a2a1c37ffae6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 735395be7ffeceb29476cc9235a6687a +Signature: 8be605988a80955e05c8d5dafaf6cd00 UNUSED LICENSES: @@ -17264,10 +17264,10 @@ FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.c FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.h FILE: ../../../third_party/skia/src/compute/skc/allocator_host.c FILE: ../../../third_party/skia/src/compute/skc/allocator_host.h +FILE: ../../../third_party/skia/src/compute/skc/interop.h FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/allocator_device_cl.c FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/allocator_device_cl.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/gl/interop.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/gl/interop.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/interop/interop_glfw.c FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttck.cl FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttrk.cl FILE: ../../../third_party/skia/src/compute/skc/runtime.h @@ -19625,17 +19625,17 @@ FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_c FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_cl_12.h FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.c FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/skc_cl.h FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/styling_cl_12.c FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/styling_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/surface_cl_12.c FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/surface_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/surface_cl_12_buffer.c FILE: ../../../third_party/skia/src/compute/skc/raster.h FILE: ../../../third_party/skia/src/compute/skc/raster_builder.c FILE: ../../../third_party/skia/src/compute/skc/raster_builder.h FILE: ../../../third_party/skia/src/compute/skc/scheduler.cpp FILE: ../../../third_party/skia/src/compute/skc/scheduler.h FILE: ../../../third_party/skia/src/compute/skc/skc.h -FILE: ../../../third_party/skia/src/compute/skc/skc_create_cl.h FILE: ../../../third_party/skia/src/compute/skc/skc_styling.h FILE: ../../../third_party/skia/src/compute/skc/subblock.h FILE: ../../../third_party/skia/src/compute/skc/surface.c From 49838532d8fbe790c18c97a0ba5cafe7966f0200 Mon Sep 17 00:00:00 2001 From: Taryn Date: Sun, 24 Jun 2018 16:18:22 -0500 Subject: [PATCH 0644/1190] Fix Colors.fromARGB docs to mention the fromRGBO constructor (#5604) --- lib/ui/painting.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 6ee345816fe48..6adb1902b3a64 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -114,7 +114,7 @@ class Color { /// /// Out of range values are brought into range using modulo 255. /// - /// See also [fromARGB], which takes the alpha value as a floating point + /// See also [fromRGBO], which takes the alpha value as a floating point /// value. const Color.fromARGB(int a, int r, int g, int b) : value = (((a & 0xff) << 24) | From 9d081192a1d9b019c0b440e36163b0df49e289c3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 24 Jun 2018 22:10:34 -0400 Subject: [PATCH 0645/1190] Roll src/third_party/skia ebf160f308b6..a2b5b6467f34 (1 commits) (#5605) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 0468eb75a7b8b..8e183d742fb55 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ebf160f308b698c075c9c1cf8d65d40cb2486238', + 'skia_revision': 'a2b5b6467f347962e0d6942da0dff9148fbb3375', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7a2a1c37ffae6..90885d38f2cc6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8be605988a80955e05c8d5dafaf6cd00 +Signature: 13246e5e35b8899d9aa6d4c87713abef UNUSED LICENSES: From be865e884bfa4b08a9d58a75dd19a6edc8a355ba Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 25 Jun 2018 07:57:34 -0400 Subject: [PATCH 0646/1190] Roll src/third_party/skia a2b5b6467f34..900b5364d12e (1 commits) (#5606) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 8e183d742fb55..e1fe97dd067e5 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a2b5b6467f347962e0d6942da0dff9148fbb3375', + 'skia_revision': '900b5364d12e6dc05c89892d72ed7de5488584b8', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 90885d38f2cc6..ddd9cd9de4574 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 13246e5e35b8899d9aa6d4c87713abef +Signature: c2937eb4b92f500117af0bc963942deb UNUSED LICENSES: From e7f28d74190af381c62d2a73bc7fb9d74fa80ef4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 25 Jun 2018 11:22:34 -0400 Subject: [PATCH 0647/1190] Roll src/third_party/skia 900b5364d12e..86d87d2e69c3 (7 commits) (#5607) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index e1fe97dd067e5..45b577db043f6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '900b5364d12e6dc05c89892d72ed7de5488584b8', + 'skia_revision': '86d87d2e69c31af9c1ff8e60ca1a1e10f0b3264c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ddd9cd9de4574..87ee6eab58b54 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c2937eb4b92f500117af0bc963942deb +Signature: e5668915b558990b53cc3ce4b38655ae UNUSED LICENSES: @@ -19075,7 +19075,6 @@ FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.h FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkBackendContext.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkCaps.cpp From b1d3c98fd0ccecb4730de65d268fe87ddf8eea63 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 25 Jun 2018 14:49:23 -0400 Subject: [PATCH 0648/1190] Roll src/third_party/skia 86d87d2e69c3..ff168d9258e0 (5 commits) (#5608) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 45b577db043f6..e92272edd2d54 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '86d87d2e69c31af9c1ff8e60ca1a1e10f0b3264c', + 'skia_revision': 'ff168d9258e0101826a8072b4ee077c3d2aa7258', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 87ee6eab58b54..37aaf40cf75e2 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e5668915b558990b53cc3ce4b38655ae +Signature: 2626d0d417beb8bb648434a16b0ef27a UNUSED LICENSES: From e18f239037511d3133ea3f1c624790cf0f69715e Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 25 Jun 2018 13:23:46 -0700 Subject: [PATCH 0649/1190] Purge the Skia font cache after deleting an engine's FontCollection (#5598) See https://github.com/flutter/flutter/issues/18728 --- lib/ui/text/font_collection.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ui/text/font_collection.cc b/lib/ui/text/font_collection.cc index 67012519c9f7d..b0ecc7514bb5f 100644 --- a/lib/ui/text/font_collection.cc +++ b/lib/ui/text/font_collection.cc @@ -11,6 +11,7 @@ #include "third_party/rapidjson/rapidjson/document.h" #include "third_party/rapidjson/rapidjson/rapidjson.h" #include "third_party/skia/include/core/SkFontMgr.h" +#include "third_party/skia/include/core/SkGraphics.h" #include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkTypeface.h" #include "txt/asset_font_manager.h" @@ -24,7 +25,10 @@ FontCollection::FontCollection() collection_->SetDefaultFontManager(SkFontMgr::RefDefault()); } -FontCollection::~FontCollection() = default; +FontCollection::~FontCollection() { + collection_.reset(); + SkGraphics::PurgeFontCache(); +} std::shared_ptr FontCollection::GetFontCollection() const { return collection_; From f205dcc6e7a26e6aa12c625b60fb66a103bb9874 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 25 Jun 2018 18:15:24 -0400 Subject: [PATCH 0650/1190] Roll src/third_party/skia ff168d9258e0..81abc43e6f0b (2 commits) (#5611) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e92272edd2d54..33b6c8db992a3 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ff168d9258e0101826a8072b4ee077c3d2aa7258', + 'skia_revision': '81abc43e6f0b1a789e1bf116820c8ede68d778ab', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 37aaf40cf75e2..fa17aef0805a8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2626d0d417beb8bb648434a16b0ef27a +Signature: c049c86efd098c259ee6e41c40950790 UNUSED LICENSES: From 0f8386b998d9b516c113cf8e2ae6b962752b1e08 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 25 Jun 2018 16:05:07 -0700 Subject: [PATCH 0651/1190] Add Dart entry points accessed from native code for decodeImageFromPixels (#5613) --- runtime/dart_vm_entry_points.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/dart_vm_entry_points.txt b/runtime/dart_vm_entry_points.txt index 008272e3f37e1..fabbf37bed1df 100644 --- a/runtime/dart_vm_entry_points.txt +++ b/runtime/dart_vm_entry_points.txt @@ -21,6 +21,10 @@ dart:ui,::,_updateLocale dart:ui,::,_updateSemanticsEnabled dart:ui,::,_updateUserSettingsData dart:ui,::,_updateWindowMetrics +dart:ui,_ImageInfo,get:width +dart:ui,_ImageInfo,get:height +dart:ui,_ImageInfo,get:format +dart:ui,_ImageInfo,get:rowBytes dart:ui,Canvas,Canvas. dart:ui,Codec,Codec._ dart:ui,Color,Color. From 923663afb40ba79a58234f488f53187d93c573ee Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 25 Jun 2018 16:15:12 -0700 Subject: [PATCH 0652/1190] Remove remaining uses of Skia private header includes. (#5570) Part of fixing https://bugs.chromium.org/p/skia/issues/detail?id=7741 --- shell/common/rasterizer.cc | 2 +- shell/common/skia_event_tracer_impl.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 6486d69aa8bbb..998fb06160b93 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -11,7 +11,7 @@ #include "third_party/skia/include/core/SkPictureRecorder.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/core/SkSurfaceCharacterization.h" -#include "third_party/skia/src/utils/SkBase64.h" +#include "third_party/skia/include/utils/SkBase64.h" namespace shell { diff --git a/shell/common/skia_event_tracer_impl.cc b/shell/common/skia_event_tracer_impl.cc index 62aad0a5f98c7..9349b4c2f3f4d 100644 --- a/shell/common/skia_event_tracer_impl.cc +++ b/shell/common/skia_event_tracer_impl.cc @@ -12,7 +12,7 @@ #include "lib/fxl/logging.h" #include "third_party/dart/runtime/include/dart_tools_api.h" #include "third_party/skia/include/utils/SkEventTracer.h" -#include "third_party/skia/src/core/SkTraceEventCommon.h" +#include "third_party/skia/include/utils/SkTraceEventPhase.h" namespace skia { From 2c158b639073f07380bc74c52f918197a269e170 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 25 Jun 2018 16:32:38 -0700 Subject: [PATCH 0653/1190] Check for calls to FlutterMain.ensureInitializationComplete before startInitialization (#5614) --- shell/platform/android/io/flutter/view/FlutterMain.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/platform/android/io/flutter/view/FlutterMain.java b/shell/platform/android/io/flutter/view/FlutterMain.java index 876617bdc59cf..6ccdd54d5ea57 100644 --- a/shell/platform/android/io/flutter/view/FlutterMain.java +++ b/shell/platform/android/io/flutter/view/FlutterMain.java @@ -187,6 +187,9 @@ public static void ensureInitializationComplete(Context applicationContext, Stri if (Looper.myLooper() != Looper.getMainLooper()) { throw new IllegalStateException("ensureInitializationComplete must be called on the main thread"); } + if (sSettings == null) { + throw new IllegalStateException("ensureInitializationComplete must be called after startInitialization"); + } if (sInitialized) { return; } From 1340970bab670def95a83cf99be5392fd20ccc02 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Mon, 25 Jun 2018 16:33:33 -0700 Subject: [PATCH 0654/1190] Assert in place of ArgumentError for null checks (#5612) For consistency with the rest of dart:ui, check required parameters with assert(param != null) rather than throwing ArgumentError. ArgumentError is typically reserved for checking the validity of non-null args -- e.g. that a list has the required number of elements. --- lib/ui/isolate_name_server.dart | 22 ++++++++++------------ testing/dart/isolate_name_server_test.dart | 14 -------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/lib/ui/isolate_name_server.dart b/lib/ui/isolate_name_server.dart index 8dcbf79977ef7..0e33f4e0799eb 100644 --- a/lib/ui/isolate_name_server.dart +++ b/lib/ui/isolate_name_server.dart @@ -7,31 +7,29 @@ part of dart.ui; abstract class IsolateNameServer { // Looks up the [SendPort] associated with a given name. Returns null // if the name does not exist. + // + // `name` must not be null. static SendPort lookupPortByName(String name) { - if (name == null) { - throw new ArgumentError("'name' cannot be null."); - } + assert(name != null, "'name' cannot be null."); return _lookupPortByName(name); } // Registers a SendPort with a given name. Returns true if registration is // successful, false if the name entry already exists. + // + // `port` and `name` must not be null. static bool registerPortWithName(SendPort port, String name) { - if (name == null) { - throw new ArgumentError("'name' cannot be null."); - } - if (port == null) { - throw new ArgumentError("'port' cannot be null."); - } + assert(port != null, "'port' cannot be null."); + assert(name != null, "'name' cannot be null."); return _registerPortWithName(port, name); } // Removes a name to SendPort mapping given a name. Returns true if the // mapping was successfully removed, false if the mapping does not exist. + // + // `name` must not be null. static bool removePortNameMapping(String name) { - if (name == null) { - throw new ArgumentError("'name' cannot be null."); - } + assert(name != null, "'name' cannot be null."); return _removePortNameMapping(name); } diff --git a/testing/dart/isolate_name_server_test.dart b/testing/dart/isolate_name_server_test.dart index 4df83cf771b64..b8e4a342ec707 100644 --- a/testing/dart/isolate_name_server_test.dart +++ b/testing/dart/isolate_name_server_test.dart @@ -81,20 +81,6 @@ void main() { receivePort2.close(); }); - test('isolate name server null args', () { - // None of our IsolateNameServer methods should accept null. - expect(() => IsolateNameServer.lookupPortByName(null), throwsArgumentError); - expect(() => IsolateNameServer.registerPortWithName(null, 'abc'), - throwsArgumentError); - final receivePort = new ReceivePort(); - final sendPort = receivePort.sendPort; - expect(() => IsolateNameServer.registerPortWithName(sendPort, null), - throwsArgumentError); - expect(() => IsolateNameServer.removePortNameMapping(null), - throwsArgumentError); - receivePort.close(); - }); - test('isolate name server multi-isolate', () async { // Register our send port with the name server. final receivePort = new ReceivePort(); From 6fe748490d1772d72274bf8b9efb72c5c2160237 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 25 Jun 2018 21:41:23 -0400 Subject: [PATCH 0655/1190] Roll src/third_party/skia 81abc43e6f0b..f46710802ad5 (3 commits) (#5615) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 33b6c8db992a3..db57262de2cc6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '81abc43e6f0b1a789e1bf116820c8ede68d778ab', + 'skia_revision': 'f46710802ad50d33fdb9c9a090e7ee83b0f0ef5b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fa17aef0805a8..3f8ddc36d8f93 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c049c86efd098c259ee6e41c40950790 +Signature: 09b8af738d791005e32c59e0e01b49ca UNUSED LICENSES: From d3fa01a473861d27906b67f79f137ef64278cacd Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 26 Jun 2018 09:40:23 -0400 Subject: [PATCH 0656/1190] Roll src/third_party/skia f46710802ad5..d4b2adeaa929 (1 commits) (#5616) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index db57262de2cc6..1c007ecd6a122 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f46710802ad50d33fdb9c9a090e7ee83b0f0ef5b', + 'skia_revision': 'd4b2adeaa929edd1664754ac6621ec524992ef03', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3f8ddc36d8f93..e3220c9e55258 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 09b8af738d791005e32c59e0e01b49ca +Signature: 6ac280cdc47485075090bb3c0fa69715 UNUSED LICENSES: From 7dab419ae19bf4570919476ca14c3540e017ae18 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 26 Jun 2018 13:05:23 -0400 Subject: [PATCH 0657/1190] Roll src/third_party/skia d4b2adeaa929..9c0ce41cf711 (7 commits) (#5617) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 1c007ecd6a122..7b44a4c743aae 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd4b2adeaa929edd1664754ac6621ec524992ef03', + 'skia_revision': '9c0ce41cf71197e06894002b1f29d34ed124e8ad', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e3220c9e55258..df48773b89ed1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6ac280cdc47485075090bb3c0fa69715 +Signature: 9ebebf36b0fd87fd5a95f5eaa35266e9 UNUSED LICENSES: @@ -20280,10 +20280,10 @@ TYPE: LicenseType.bsd FILE: ../../../third_party/skia/include/core/SkDrawFilter.h FILE: ../../../third_party/skia/include/core/SkDrawLooper.h FILE: ../../../third_party/skia/include/effects/SkBlurImageFilter.h -FILE: ../../../third_party/skia/src/core/SkBlurImageFilter.cpp FILE: ../../../third_party/skia/src/core/SkScan.h FILE: ../../../third_party/skia/src/core/SkScan_Antihair.cpp FILE: ../../../third_party/skia/src/core/SkTypeface.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkBlurImageFilter.cpp FILE: ../../../third_party/skia/src/ports/SkFontMgr_android_parser.cpp FILE: ../../../third_party/skia/src/ports/SkFontMgr_android_parser.h ---------------------------------------------------------------------------------------------------- From 33b70e0b97ba485170279d1b372c754542ef5572 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 26 Jun 2018 16:31:23 -0400 Subject: [PATCH 0658/1190] Roll src/third_party/skia 9c0ce41cf711..d47fe095cf88 (12 commits) (#5618) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 7b44a4c743aae..d9feb0f76a319 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9c0ce41cf71197e06894002b1f29d34ed124e8ad', + 'skia_revision': 'd47fe095cf88e68418915abe9d75ae9e40d07d6b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index df48773b89ed1..713e24a0a3420 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9ebebf36b0fd87fd5a95f5eaa35266e9 +Signature: b011ed8e46d01d11708c8e353e6138de UNUSED LICENSES: @@ -14354,6 +14354,8 @@ FILE: ../../../third_party/skia/include/gpu/vk/GrVkBackendContext.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkDefines.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkTypes.h FILE: ../../../third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h +FILE: ../../../third_party/skia/include/ports/SkImageGeneratorCG.h +FILE: ../../../third_party/skia/include/ports/SkImageGeneratorWIC.h FILE: ../../../third_party/skia/include/private/GrAuditTrail.h FILE: ../../../third_party/skia/include/private/GrOpList.h FILE: ../../../third_party/skia/include/private/GrRenderTargetProxy.h @@ -14608,9 +14610,7 @@ FILE: ../../../third_party/skia/src/pipe/SkRefSet.h FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface.cpp FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_empty_factory.cpp FILE: ../../../third_party/skia/src/ports/SkImageGeneratorCG.cpp -FILE: ../../../third_party/skia/src/ports/SkImageGeneratorCG.h FILE: ../../../third_party/skia/src/ports/SkImageGeneratorWIC.cpp -FILE: ../../../third_party/skia/src/ports/SkImageGeneratorWIC.h FILE: ../../../third_party/skia/src/shaders/SkColorFilterShader.h FILE: ../../../third_party/skia/src/shaders/SkColorShader.cpp FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fGradientBase.cpp From 05f5a1881f33409257456a56839de329eaec3a53 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 26 Jun 2018 19:57:23 -0400 Subject: [PATCH 0659/1190] Roll src/third_party/skia d47fe095cf88..5b201e3b0ba8 (6 commits) (#5622) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d9feb0f76a319..8bad0ba884da9 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd47fe095cf88e68418915abe9d75ae9e40d07d6b', + 'skia_revision': '5b201e3b0ba8715058051558c907e78e02d2fa8d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 713e24a0a3420..d0f61da3c0778 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b011ed8e46d01d11708c8e353e6138de +Signature: 6398b2d5b1474c97cabde51f7324444f UNUSED LICENSES: From ce417e275d9a8c0ec85ed52ac6efbcdc6ab50ee6 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 26 Jun 2018 23:22:23 -0400 Subject: [PATCH 0660/1190] Roll src/third_party/skia 5b201e3b0ba8..c421ca1d6e41 (3 commits) (#5623) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 8bad0ba884da9..f8f5e9f2cef5f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5b201e3b0ba8715058051558c907e78e02d2fa8d', + 'skia_revision': 'c421ca1d6e41214f09c0e6311c8519a15e44edd4', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d0f61da3c0778..84a847f694b31 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6398b2d5b1474c97cabde51f7324444f +Signature: d4728ff2bdd17e63a3bb7e74a61818ad UNUSED LICENSES: From 57e2e0cc8810c90195478b207521918c71b6abd1 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 27 Jun 2018 02:48:23 -0400 Subject: [PATCH 0661/1190] Roll src/third_party/skia c421ca1d6e41..37b7e4714558 (2 commits) (#5624) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f8f5e9f2cef5f..3eed3664f334f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c421ca1d6e41214f09c0e6311c8519a15e44edd4', + 'skia_revision': '37b7e471455896c368cae847141545c5c80908af', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 84a847f694b31..023b77d362897 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d4728ff2bdd17e63a3bb7e74a61818ad +Signature: f44d61e3755c0bd41d4a5000316f7187 UNUSED LICENSES: From 36f3f9552a9e6738ff1c67cd70105537949121c4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 27 Jun 2018 10:55:23 -0400 Subject: [PATCH 0662/1190] Roll src/third_party/skia 37b7e4714558..45c9dab4c3ec (1 commits) (#5626) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 3eed3664f334f..e122b954acf7d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '37b7e471455896c368cae847141545c5c80908af', + 'skia_revision': '45c9dab4c3ec43cedb28d1b8c08e166fe0c2e767', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 023b77d362897..87eaa845784a7 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f44d61e3755c0bd41d4a5000316f7187 +Signature: 7931e22bcaab7a5a84aaa011db529bf3 UNUSED LICENSES: @@ -14352,6 +14352,7 @@ FILE: ../../../third_party/skia/include/effects/SkOverdrawColorFilter.h FILE: ../../../third_party/skia/include/effects/SkPaintImageFilter.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkBackendContext.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkDefines.h +FILE: ../../../third_party/skia/include/gpu/vk/GrVkExtensions.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkTypes.h FILE: ../../../third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h FILE: ../../../third_party/skia/include/ports/SkImageGeneratorCG.h @@ -14566,7 +14567,6 @@ FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSet.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpuCommandBuffer.cpp From fbb3436eaa782c0981a316b2d3cf26a471977e9b Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 27 Jun 2018 11:06:15 -0700 Subject: [PATCH 0663/1190] Remove some unused code from the Android host (#5619) These functions were made obsolete by the engine refactoring (https://github.com/flutter/engine/commit/6baff4c821350bbcb64e7d029574b567f3801a1a) --- .../platform/android/android_shell_holder.cc | 17 ----- .../io/flutter/view/FlutterNativeView.java | 23 ------ .../android/io/flutter/view/FlutterView.java | 49 ------------ .../android/platform_view_android_jni.cc | 74 ------------------- 4 files changed, 163 deletions(-) diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index 2414e018ed982..248949535d06f 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -181,21 +181,4 @@ fml::WeakPtr AndroidShellHolder::GetPlatformView() { return platform_view_; } -void AndroidShellHolder::UpdateAssetManager( - fml::RefPtr asset_manager) { - if (!IsValid() || !asset_manager) { - return; - } - - shell_->GetTaskRunners().GetUITaskRunner()->PostTask( - [engine = shell_->GetEngine(), - asset_manager = std::move(asset_manager)]() { - if (engine) { - if (!engine->UpdateAssetManager(std::move(asset_manager))) { - FXL_DLOG(ERROR) << "Could not update asset asset manager."; - } - } - }); -} - } // namespace shell diff --git a/shell/platform/android/io/flutter/view/FlutterNativeView.java b/shell/platform/android/io/flutter/view/FlutterNativeView.java index b9908b5531ece..3d00312a081fb 100644 --- a/shell/platform/android/io/flutter/view/FlutterNativeView.java +++ b/shell/platform/android/io/flutter/view/FlutterNativeView.java @@ -81,25 +81,10 @@ public void runFromBundle(String bundlePath, String snapshotOverride, String ent applicationIsRunning = true; } - public void runFromSource(final String assetsDirectory, final String main, final String packages) { - assertAttached(); - if (applicationIsRunning) - throw new AssertionError("This Flutter engine instance is already running an application"); - - nativeRunBundleAndSource(mNativePlatformView, assetsDirectory, main, packages); - - applicationIsRunning = true; - } - public boolean isApplicationRunning() { return applicationIsRunning; } - public void setAssetBundlePathOnUI(final String assetsDirectory) { - assertAttached(); - nativeSetAssetBundlePathOnUI(mNativePlatformView, assetsDirectory); - } - public static String getObservatoryUri() { return nativeGetObservatoryUri(); } @@ -216,14 +201,6 @@ private static native void nativeRunBundleAndSnapshot(long nativePlatformViewAnd boolean reuseRuntimeController, AssetManager manager); - private static native void nativeRunBundleAndSource(long nativePlatformViewAndroid, - String bundlePath, - String main, - String packages); - - private static native void nativeSetAssetBundlePathOnUI(long nativePlatformViewAndroid, - String bundlePath); - private static native String nativeGetObservatoryUri(); // Send an empty platform message to Dart. diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index e80ccc0ab153d..8ce1c80e65ae4 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -646,55 +646,6 @@ public void runFromBundle(String bundlePath, String snapshotOverride, String ent postRun(); } - private void runFromSource(final String assetsDirectory, final String main, final String packages) { - Runnable runnable = new Runnable() { - public void run() { - assertAttached(); - preRun(); - mNativeView.runFromSource(assetsDirectory, main, packages); - postRun(); - synchronized (this) { - notify(); - } - } - }; - - try { - synchronized (runnable) { - // Post to the Android UI thread and wait for the response. - post(runnable); - runnable.wait(); - } - } catch (InterruptedException e) { - Log.e(TAG, "Thread got interrupted waiting for " + - "RunFromSourceRunnable to finish", e); - } - } - - private void setAssetBundlePath(final String assetsDirectory) { - Runnable runnable = new Runnable() { - public void run() { - assertAttached(); - mNativeView.setAssetBundlePathOnUI(assetsDirectory); - synchronized (this) { - notify(); - } - } - }; - - try { - synchronized (runnable) { - // Post to the Android UI thread and wait for the response. - post(runnable); - runnable.wait(); - } - } catch (InterruptedException e) { - Log.e(TAG, "Thread got interrupted waiting for " + - "setAssetBundlePath to finish", e); - } - } - - /** * Return the most recent frame as a bitmap. * diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 30648d5bd24df..7b0f0d7ae10c1 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -254,69 +254,6 @@ static void RunBundleAndSnapshot( ANDROID_SHELL_HOLDER->Launch(std::move(config)); } -static void RunBundleAndSource(JNIEnv* env, - jobject jcaller, - jlong shell_holder, - jstring jBundlePath, - jstring main, - jstring packages) { - auto asset_manager = fml::MakeRefCounted(); - - const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); - - if (bundlepath.size() > 0) { - auto directory = - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); - asset_manager->PushBack( - std::make_unique(std::move(directory))); - } - - auto main_file_path = fml::jni::JavaStringToString(env, main); - auto packages_file_path = fml::jni::JavaStringToString(env, packages); - - auto config = - IsolateConfiguration::CreateForSource(main_file_path, packages_file_path); - - if (!config) { - return; - } - - RunConfiguration run_configuration(std::move(config), - std::move(asset_manager)); - - ANDROID_SHELL_HOLDER->Launch(std::move(run_configuration)); -} - -void SetAssetBundlePathOnUI(JNIEnv* env, - jobject jcaller, - jlong shell_holder, - jstring jBundlePath) { - const auto bundlepath = fml::jni::JavaStringToString(env, jBundlePath); - - if (bundlepath.size() == 0) { - return; - } - - auto directory = - fml::OpenFile(bundlepath.c_str(), fml::OpenPermission::kRead, true); - - if (!directory.is_valid()) { - return; - } - - std::unique_ptr directory_asset_bundle = - std::make_unique(std::move(directory)); - - if (!directory_asset_bundle->IsValid()) { - return; - } - - auto asset_manager = fml::MakeRefCounted(); - asset_manager->PushBack(std::move(directory_asset_bundle)); - - ANDROID_SHELL_HOLDER->UpdateAssetManager(std::move(asset_manager)); -} - static void SetViewportMetrics(JNIEnv* env, jobject jcaller, jlong shell_holder, @@ -578,17 +515,6 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { "String;ZLandroid/content/res/AssetManager;)V", .fnPtr = reinterpret_cast(&shell::RunBundleAndSnapshot), }, - { - .name = "nativeRunBundleAndSource", - .signature = - "(JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", - .fnPtr = reinterpret_cast(&shell::RunBundleAndSource), - }, - { - .name = "nativeSetAssetBundlePathOnUI", - .signature = "(JLjava/lang/String;)V", - .fnPtr = reinterpret_cast(&shell::SetAssetBundlePathOnUI), - }, { .name = "nativeDetach", .signature = "(J)V", From 9e44004128aaefcdd2569c5f8aa55118dbe7471b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 27 Jun 2018 14:22:24 -0400 Subject: [PATCH 0664/1190] Roll src/third_party/skia 45c9dab4c3ec..059a9ab4bcd0 (8 commits) (#5627) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index e122b954acf7d..56c3a649fab02 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '45c9dab4c3ec43cedb28d1b8c08e166fe0c2e767', + 'skia_revision': '059a9ab4bcd07a4bfdbfef333c27ef3d277e0e46', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 87eaa845784a7..7ff93645eda33 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7931e22bcaab7a5a84aaa011db529bf3 +Signature: 844f6dfea68664f4927936e52e72d43d UNUSED LICENSES: @@ -14352,7 +14352,6 @@ FILE: ../../../third_party/skia/include/effects/SkOverdrawColorFilter.h FILE: ../../../third_party/skia/include/effects/SkPaintImageFilter.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkBackendContext.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkDefines.h -FILE: ../../../third_party/skia/include/gpu/vk/GrVkExtensions.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkTypes.h FILE: ../../../third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h FILE: ../../../third_party/skia/include/ports/SkImageGeneratorCG.h @@ -14567,6 +14566,7 @@ FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSet.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpuCommandBuffer.cpp @@ -17504,6 +17504,7 @@ FILE: ../../../third_party/skia/docker/skia-with-swift-shader-base/Dockerfile FILE: ../../../third_party/skia/docker/skia-with-swift-shader-base/build-with-swift-shader-and-run FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh +FILE: ../../../third_party/skia/docs/SkBlendMode_Reference.bmh FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh FILE: ../../../third_party/skia/docs/SkColor4f_Reference.bmh FILE: ../../../third_party/skia/docs/SkColor_Reference.bmh @@ -17514,8 +17515,10 @@ FILE: ../../../third_party/skia/docs/SkImage_Reference.bmh FILE: ../../../third_party/skia/docs/SkMatrix_Reference.bmh FILE: ../../../third_party/skia/docs/SkPaint_Reference.bmh FILE: ../../../third_party/skia/docs/SkPath_Reference.bmh +FILE: ../../../third_party/skia/docs/SkPicture_Reference.bmh FILE: ../../../third_party/skia/docs/SkPixmap_Reference.bmh FILE: ../../../third_party/skia/docs/SkPoint_Reference.bmh +FILE: ../../../third_party/skia/docs/SkRRect_Reference.bmh FILE: ../../../third_party/skia/docs/SkRect_Reference.bmh FILE: ../../../third_party/skia/docs/SkSurface_Reference.bmh FILE: ../../../third_party/skia/docs/illustrations.bmh @@ -19075,6 +19078,7 @@ FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.h FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkBackendContext.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkCaps.cpp From 2c5647cd88f1f7ae3f1a50be801c10771b010434 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 27 Jun 2018 17:48:23 -0400 Subject: [PATCH 0665/1190] Roll src/third_party/skia 059a9ab4bcd0..551dc3e91143 (5 commits) (#5629) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/DEPS b/DEPS index 56c3a649fab02..79184fc97991d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '059a9ab4bcd07a4bfdbfef333c27ef3d277e0e46', + 'skia_revision': '551dc3e911438afb7c0ab28b1060a9480a4debd3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7ff93645eda33..5d6ae8d0f5856 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 844f6dfea68664f4927936e52e72d43d +Signature: dc7df4b8d437f71f171511e5780307e1 UNUSED LICENSES: @@ -17630,7 +17630,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/env/examples/full.expe FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json @@ -17730,8 +17730,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_NoGPUThreads.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-GCC-Chorizo-GPU-Cortex_A7-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Debug-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-GPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All.json @@ -17764,8 +17764,8 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-GCC-Chorizo-GPU-Cortex_A7-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-Clang-Chorizo-GPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json From 00ddf1319586cf5110bc2b94097ba980b74b0f15 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 27 Jun 2018 16:48:59 -0700 Subject: [PATCH 0666/1190] libtxt: apply an offset to drawing operations instead of translating the canvas (#5628) Fixes https://github.com/flutter/flutter/issues/18710 --- third_party/txt/src/txt/paragraph.cc | 24 ++++++++++++++---------- third_party/txt/src/txt/paragraph.h | 8 ++++++-- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index cc247dd107358..78aa0911d3929 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -877,7 +877,7 @@ sk_sp Paragraph::GetDefaultSkiaTypeface(const TextStyle& style) { // The x,y coordinates will be the very top left corner of the rendered // paragraph. void Paragraph::Paint(SkCanvas* canvas, double x, double y) { - canvas->translate(x, y); + SkPoint base_offset = SkPoint::Make(x, y); SkPaint paint; for (const PaintRecord& record : records_) { if (record.style().has_foreground) { @@ -886,15 +886,16 @@ void Paragraph::Paint(SkCanvas* canvas, double x, double y) { paint.reset(); paint.setColor(record.style().color); } - SkPoint offset = record.offset(); - PaintBackground(canvas, record); + SkPoint offset = base_offset + record.offset(); + PaintBackground(canvas, record, base_offset); canvas->drawTextBlob(record.text(), offset.x(), offset.y(), paint); - PaintDecorations(canvas, record); + PaintDecorations(canvas, record, base_offset); } - canvas->translate(-x, -y); } -void Paragraph::PaintDecorations(SkCanvas* canvas, const PaintRecord& record) { +void Paragraph::PaintDecorations(SkCanvas* canvas, + const PaintRecord& record, + SkPoint base_offset) { if (record.style().decoration == TextDecoration::kNone) return; @@ -935,8 +936,9 @@ void Paragraph::PaintDecorations(SkCanvas* canvas, const PaintRecord& record) { paint.setStrokeWidth(underline_thickness * record.style().decoration_thickness_multiplier); - SkScalar x = record.offset().x(); - SkScalar y = record.offset().y(); + SkPoint record_offset = base_offset + record.offset(); + SkScalar x = record_offset.x(); + SkScalar y = record_offset.y(); // Setup the decorations. switch (record.style().decoration_style) { @@ -1052,14 +1054,16 @@ void Paragraph::PaintDecorations(SkCanvas* canvas, const PaintRecord& record) { } } -void Paragraph::PaintBackground(SkCanvas* canvas, const PaintRecord& record) { +void Paragraph::PaintBackground(SkCanvas* canvas, + const PaintRecord& record, + SkPoint base_offset) { if (!record.style().has_background) return; const SkPaint::FontMetrics& metrics = record.metrics(); SkRect rect(SkRect::MakeLTRB(0, metrics.fAscent, record.GetRunWidth(), metrics.fDescent)); - rect.offset(record.offset()); + rect.offset(base_offset + record.offset()); canvas->drawRect(rect, record.style().background); } diff --git a/third_party/txt/src/txt/paragraph.h b/third_party/txt/src/txt/paragraph.h index bc8dc3ea93328..00c72788225c8 100644 --- a/third_party/txt/src/txt/paragraph.h +++ b/third_party/txt/src/txt/paragraph.h @@ -318,10 +318,14 @@ class Paragraph { double GetLineXOffset(double line_total_advance); // Creates and draws the decorations onto the canvas. - void PaintDecorations(SkCanvas* canvas, const PaintRecord& record); + void PaintDecorations(SkCanvas* canvas, + const PaintRecord& record, + SkPoint base_offset); // Draws the background onto the canvas. - void PaintBackground(SkCanvas* canvas, const PaintRecord& record); + void PaintBackground(SkCanvas* canvas, + const PaintRecord& record, + SkPoint base_offset); // Obtain a Minikin font collection matching this text style. std::shared_ptr GetMinikinFontCollectionForStyle( From 48cc8f2353a537649584741252aa818d6f1f8414 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 27 Jun 2018 21:12:23 -0400 Subject: [PATCH 0667/1190] Roll src/third_party/skia 551dc3e91143..14de25dfc7c4 (2 commits) (#5630) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 79184fc97991d..84c31e4bdf1da 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '551dc3e911438afb7c0ab28b1060a9480a4debd3', + 'skia_revision': '14de25dfc7c4a6ce940e4c893f2d9ebb3da0fd1a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5d6ae8d0f5856..b7b6019550295 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: dc7df4b8d437f71f171511e5780307e1 +Signature: 06018e1634fefb118b28950b6a944b25 UNUSED LICENSES: From e3788118ef4722729b53751ab91038154060fabc Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 28 Jun 2018 00:38:44 -0400 Subject: [PATCH 0668/1190] Roll src/third_party/skia 14de25dfc7c4..e2e52e46ca63 (2 commits) (#5633) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 84c31e4bdf1da..111727e9d1264 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '14de25dfc7c4a6ce940e4c893f2d9ebb3da0fd1a', + 'skia_revision': 'e2e52e46ca63540d429656baeee48fd3a402be26', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b7b6019550295..fd27749849284 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 06018e1634fefb118b28950b6a944b25 +Signature: b7f162c3b65cca03ffc95b6b61a1d906 UNUSED LICENSES: From 29420616f1c10c399feea57064aa9650f5a19456 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 28 Jun 2018 03:49:23 -0400 Subject: [PATCH 0669/1190] Roll src/third_party/skia e2e52e46ca63..e97bb26893a1 (1 commits) (#5634) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 111727e9d1264..7d4f9e8d1df5d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e2e52e46ca63540d429656baeee48fd3a402be26', + 'skia_revision': 'e97bb26893a1c24deeb38b818a1f4c1638a9983d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 2006e7d6315589bef54bf80c48ee17ff8dcf90ee Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 28 Jun 2018 08:26:23 -0400 Subject: [PATCH 0670/1190] Roll src/third_party/skia e97bb26893a1..385804514edf (1 commits) (#5635) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 7d4f9e8d1df5d..0610ac001752e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e97bb26893a1c24deeb38b818a1f4c1638a9983d', + 'skia_revision': '385804514edf602f978975c825b78692a044c6b9', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index fd27749849284..b6191651ec436 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b7f162c3b65cca03ffc95b6b61a1d906 +Signature: 4575300c3ccc54f1b747f36d88b4460c UNUSED LICENSES: From a9e5354b7d115c53f49fbb25f68d3a8cf936eb59 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 28 Jun 2018 11:51:23 -0400 Subject: [PATCH 0671/1190] Roll src/third_party/skia 385804514edf..b1b87d9df81e (6 commits) (#5636) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 0610ac001752e..5f6cf8e49f470 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '385804514edf602f978975c825b78692a044c6b9', + 'skia_revision': 'b1b87d9df81eb4ddb25fc76a2a2a6664fc4ef0ec', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b6191651ec436..40e9d71939419 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4575300c3ccc54f1b747f36d88b4460c +Signature: bb93df10d0b6b7b727917f6b44fd7c60 UNUSED LICENSES: From c54a57ef36c6137bcb4cf8954f31c15ea7e2b199 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 28 Jun 2018 15:17:23 -0400 Subject: [PATCH 0672/1190] Roll src/third_party/skia b1b87d9df81e..a1e5630183c1 (10 commits) (#5637) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 5f6cf8e49f470..a593e3221671b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b1b87d9df81eb4ddb25fc76a2a2a6664fc4ef0ec', + 'skia_revision': 'a1e5630183c1b0d5a7d6df53f30e026aedb2c539', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 40e9d71939419..831d27f1245eb 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: bb93df10d0b6b7b727917f6b44fd7c60 +Signature: 6e6764dfa1de955bc41f3d2e2bf778b5 UNUSED LICENSES: @@ -17371,6 +17371,8 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.mm FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.cpp FILE: ../../../third_party/skia/src/gpu/ops/GrDebugMarkerOp.cpp FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp @@ -19078,7 +19080,6 @@ FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.h FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkBackendContext.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkCaps.cpp From ce06bbac58d7c68487dd09616864c904e2f71a72 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 28 Jun 2018 13:30:51 -0700 Subject: [PATCH 0673/1190] ensure a11y state is communicated back to flutter (#5631) --- shell/platform/android/io/flutter/view/FlutterView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 8ce1c80e65ae4..4e812173b5002 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -808,6 +808,7 @@ public void onAccessibilityStateChanged(boolean enabled) { if (mAccessibilityNodeProvider != null) { mAccessibilityNodeProvider.setAccessibilityEnabled(false); } + nativeSetSemanticsEnabled(mNativeView.get(), false); } resetWillNotDraw(); } @@ -846,8 +847,8 @@ void ensureAccessibilityEnabled() { mAccessibilityEnabled = true; if (mAccessibilityNodeProvider == null) { mAccessibilityNodeProvider = new AccessibilityBridge(this); - nativeSetSemanticsEnabled(mNativeView.get(), true); } + nativeSetSemanticsEnabled(mNativeView.get(), true); mAccessibilityNodeProvider.setAccessibilityEnabled(true); } From ad1bd47431aab643f88ba03ff3afe60a41374bdc Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 28 Jun 2018 18:42:23 -0400 Subject: [PATCH 0674/1190] Roll src/third_party/skia a1e5630183c1..24d18ced1ad7 (7 commits) (#5639) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index a593e3221671b..27a6ab7a52c61 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a1e5630183c1b0d5a7d6df53f30e026aedb2c539', + 'skia_revision': '24d18ced1ad79d0af22b335d7fb01238915214ef', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 831d27f1245eb..11caa73d2091a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6e6764dfa1de955bc41f3d2e2bf778b5 +Signature: 0234627dc62200a7bae86628ddc25ba5 UNUSED LICENSES: @@ -14352,6 +14352,7 @@ FILE: ../../../third_party/skia/include/effects/SkOverdrawColorFilter.h FILE: ../../../third_party/skia/include/effects/SkPaintImageFilter.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkBackendContext.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkDefines.h +FILE: ../../../third_party/skia/include/gpu/vk/GrVkExtensions.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkTypes.h FILE: ../../../third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h FILE: ../../../third_party/skia/include/ports/SkImageGeneratorCG.h @@ -14566,7 +14567,6 @@ FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSet.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpuCommandBuffer.cpp From a885bd4f9cd1f1d74ecc0b4db06e4d6ab356ac08 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 28 Jun 2018 22:07:23 -0400 Subject: [PATCH 0675/1190] Roll src/third_party/skia 24d18ced1ad7..7e2327b133db (6 commits) (#5641) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 27a6ab7a52c61..0a16f1d348d8c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '24d18ced1ad79d0af22b335d7fb01238915214ef', + 'skia_revision': '7e2327b133dba1fccf4a4ffad1b4c1ab611fb4c3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 11caa73d2091a..17a605f55c83f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0234627dc62200a7bae86628ddc25ba5 +Signature: 60788cecc091e02c86d229904769dbb2 UNUSED LICENSES: @@ -14352,7 +14352,6 @@ FILE: ../../../third_party/skia/include/effects/SkOverdrawColorFilter.h FILE: ../../../third_party/skia/include/effects/SkPaintImageFilter.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkBackendContext.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkDefines.h -FILE: ../../../third_party/skia/include/gpu/vk/GrVkExtensions.h FILE: ../../../third_party/skia/include/gpu/vk/GrVkTypes.h FILE: ../../../third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h FILE: ../../../third_party/skia/include/ports/SkImageGeneratorCG.h @@ -14567,6 +14566,7 @@ FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSet.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpuCommandBuffer.cpp @@ -19080,6 +19080,7 @@ FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.h FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkBackendContext.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkCaps.cpp From f279dfe305182a227d1ce7540b686bf0ba47ee43 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 29 Jun 2018 02:42:23 -0400 Subject: [PATCH 0676/1190] Roll src/third_party/skia 7e2327b133db..723b1f6ef941 (1 commits) (#5642) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 0a16f1d348d8c..b98c0c263338e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7e2327b133dba1fccf4a4ffad1b4c1ab611fb4c3', + 'skia_revision': '723b1f6ef9416238fc2ac86efcce7f7126d1b2dc', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 17a605f55c83f..4dc06bad9e675 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 60788cecc091e02c86d229904769dbb2 +Signature: cafb27cf00dd4019ccba3f9705a343c7 UNUSED LICENSES: From 4466d61a993fdbde2cb092b4da9bbef33d1962fe Mon Sep 17 00:00:00 2001 From: sjindel-google Date: Fri, 29 Jun 2018 13:10:12 +0200 Subject: [PATCH 0677/1190] Remove vmservice_io.main from entry points. (#5625) --- runtime/dart_vm_entry_points.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/dart_vm_entry_points.txt b/runtime/dart_vm_entry_points.txt index fabbf37bed1df..d2d6a675be2b6 100644 --- a/runtime/dart_vm_entry_points.txt +++ b/runtime/dart_vm_entry_points.txt @@ -43,4 +43,3 @@ dart:ui,SemanticsUpdate,SemanticsUpdate._ dart:ui,SemanticsUpdateBuilder,SemanticsUpdateBuilder. dart:ui,Shader,Shader._ dart:ui,TextBox,TextBox._ -dart:vmservice_io,::,main From fecd66f34630d71553134ddcc00f429f5e61bdb1 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 29 Jun 2018 09:16:23 -0400 Subject: [PATCH 0678/1190] Roll src/third_party/skia 723b1f6ef941..eb8f8106f38c (1 commits) (#5643) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b98c0c263338e..920b8eaedce72 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '723b1f6ef9416238fc2ac86efcce7f7126d1b2dc', + 'skia_revision': 'eb8f8106f38ccd975f8b513cb1272f48c5362f74', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4dc06bad9e675..4828e4b3fa326 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: cafb27cf00dd4019ccba3f9705a343c7 +Signature: 110b6be2da4e86840b6c5a3b50a4424a UNUSED LICENSES: From e6639963fbeb9feb2d17beede3253d699c25fb29 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 29 Jun 2018 12:42:23 -0400 Subject: [PATCH 0679/1190] Roll src/third_party/skia eb8f8106f38c..c91fe3ab1c5d (5 commits) (#5644) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 920b8eaedce72..f81ca94538d90 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'eb8f8106f38ccd975f8b513cb1272f48c5362f74', + 'skia_revision': 'c91fe3ab1c5dd109e436768f848dda6814755ae6', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4828e4b3fa326..a6a9b75ff5575 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 110b6be2da4e86840b6c5a3b50a4424a +Signature: 4798f2ef12da76998579ed1fe98caf52 UNUSED LICENSES: @@ -17560,6 +17560,9 @@ FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_sdk/VERSION FILE: ../../../third_party/skia/infra/bots/assets/mips64el_toolchain_linux/VERSION FILE: ../../../third_party/skia/infra/bots/assets/moltenvk/VERSION FILE: ../../../third_party/skia/infra/bots/assets/node/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/opencl_headers/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/opencl_intel_neo_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/opencl_ocl_icd_linux/VERSION FILE: ../../../third_party/skia/infra/bots/assets/procdump_win/VERSION FILE: ../../../third_party/skia/infra/bots/assets/protoc/VERSION FILE: ../../../third_party/skia/infra/bots/assets/skimage/VERSION @@ -17590,6 +17593,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.ex FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Chromebook_GLES.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-MSAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-OpenCL.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SafeStack.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ASAN.json @@ -17643,6 +17647,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-OpenCL.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json @@ -17709,6 +17714,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json +FILE: ../../../third_party/skia/infra/bots/recipes/compute_test.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-OpenCL.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_100k_SKPs.json @@ -19835,8 +19841,8 @@ FILE: ../../../third_party/skia/src/utils/SkFloatToDecimal.cpp FILE: ../../../third_party/skia/src/utils/SkFloatToDecimal.h FILE: ../../../third_party/skia/src/utils/SkJSONWriter.cpp FILE: ../../../third_party/skia/src/utils/SkJSONWriter.h -FILE: ../../../third_party/skia/src/utils/SkOffsetPolygon.cpp -FILE: ../../../third_party/skia/src/utils/SkOffsetPolygon.h +FILE: ../../../third_party/skia/src/utils/SkPolyUtils.cpp +FILE: ../../../third_party/skia/src/utils/SkPolyUtils.h FILE: ../../../third_party/skia/src/utils/SkShadowTessellator.cpp FILE: ../../../third_party/skia/src/utils/SkShadowTessellator.h FILE: ../../../third_party/skia/src/utils/SkShadowUtils.cpp From 9e450d11610641a021b539401241a88f923fa3fe Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 29 Jun 2018 16:09:40 -0400 Subject: [PATCH 0680/1190] Roll src/third_party/skia c91fe3ab1c5d..184d408b646b (10 commits) (#5645) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f81ca94538d90..fbd6bc9d0c566 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c91fe3ab1c5dd109e436768f848dda6814755ae6', + 'skia_revision': '184d408b646b9c6a2685170228649c4ed652e2a6', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a6a9b75ff5575..799461fb8e2e8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4798f2ef12da76998579ed1fe98caf52 +Signature: 1b9c8f9dd2481708e6fef88112ad582a UNUSED LICENSES: From a2bf80590b80a797659193a2d7b320fda0f21ea2 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Fri, 29 Jun 2018 16:24:12 -0700 Subject: [PATCH 0681/1190] Add antiAlias and saveCount to clipPath and restore (#5638) This would enable us to solve https://github.com/flutter/flutter/issues/18057 --- lib/ui/painting.dart | 21 +++++++++++++++------ lib/ui/painting/canvas.cc | 15 +++++++++++---- lib/ui/painting/canvas.h | 5 +++-- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 6adb1902b3a64..36db2ac2d64c4 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2886,6 +2886,15 @@ class Canvas extends NativeFieldWrapperClass2 { /// cause the new layer to be composited into the previous layer. void restore() native 'Canvas_restore'; + /// Restore the current save stack to the state where [saveCount] is gotten. + /// + /// Use [save] and [saveLayer] to push state onto the stack, and use + /// [getSaveCount] to get the [saveCount]. + /// + /// If a state was pushed with with [saveLayer], then this call will also + /// cause the new layer to be composited into the previous layer. + void restoreToCount(int saveCount) native 'Canvas_restoreToCount'; + /// Returns the number of items on the save stack, including the /// initial state. This means it returns 1 for a clean canvas, and /// that each call to [save] and [saveLayer] increments it, and that @@ -2956,11 +2965,11 @@ class Canvas extends NativeFieldWrapperClass2 { /// multiple draw commands intersect with the clip boundary, this can result /// in incorrect blending at the clip boundary. See [saveLayer] for a /// discussion of how to address that and some examples of using [clipRRect]. - void clipRRect(RRect rrect) { + void clipRRect(RRect rrect, [bool doAntiAlias = true]) { assert(_rrectIsValid(rrect)); - _clipRRect(rrect._value); + _clipRRect(rrect._value, doAntiAlias); } - void _clipRRect(Float32List rrect) native 'Canvas_clipRRect'; + void _clipRRect(Float32List rrect, bool doAntiAlias) native 'Canvas_clipRRect'; /// Reduces the clip region to the intersection of the current clip and the /// given [Path]. @@ -2969,11 +2978,11 @@ class Canvas extends NativeFieldWrapperClass2 { /// multiple draw commands intersect with the clip boundary, this can result /// in incorrect blending at the clip boundary. See [saveLayer] for a /// discussion of how to address that. - void clipPath(Path path) { + void clipPath(Path path, [bool doAntiAlias = true]) { assert(path != null); // path is checked on the engine side - _clipPath(path); + _clipPath(path, doAntiAlias); } - void _clipPath(Path path) native 'Canvas_clipPath'; + void _clipPath(Path path, bool doAntiAlias) native 'Canvas_clipPath'; /// Paints the given [Color] onto the canvas, applying the given /// [BlendMode], with the given color being the source and the background diff --git a/lib/ui/painting/canvas.cc b/lib/ui/painting/canvas.cc index 7bfeb5cfdda9e..23b8053a9ef78 100644 --- a/lib/ui/painting/canvas.cc +++ b/lib/ui/painting/canvas.cc @@ -35,6 +35,7 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Canvas); V(Canvas, saveLayerWithoutBounds) \ V(Canvas, saveLayer) \ V(Canvas, restore) \ + V(Canvas, restoreToCount) \ V(Canvas, getSaveCount) \ V(Canvas, translate) \ V(Canvas, scale) \ @@ -120,6 +121,12 @@ void Canvas::restore() { canvas_->restore(); } +void Canvas::restoreToCount(int saveCount) { + if (!canvas_) + return; + canvas_->restoreToCount(saveCount); +} + int Canvas::getSaveCount() { if (!canvas_) return 0; @@ -166,19 +173,19 @@ void Canvas::clipRect(double left, canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom), clipOp, true); } -void Canvas::clipRRect(const RRect& rrect) { +void Canvas::clipRRect(const RRect& rrect, bool doAntiAlias) { if (!canvas_) return; - canvas_->clipRRect(rrect.sk_rrect, true); + canvas_->clipRRect(rrect.sk_rrect, doAntiAlias); } -void Canvas::clipPath(const CanvasPath* path) { +void Canvas::clipPath(const CanvasPath* path, bool doAntiAlias) { if (!canvas_) return; if (!path) Dart_ThrowException( ToDart("Canvas.clipPath called with non-genuine Path.")); - canvas_->clipPath(path->path(), true); + canvas_->clipPath(path->path(), doAntiAlias); } void Canvas::drawColor(SkColor color, SkBlendMode blend_mode) { diff --git a/lib/ui/painting/canvas.h b/lib/ui/painting/canvas.h index 03dfe618f454d..e8ce866e9967a 100644 --- a/lib/ui/painting/canvas.h +++ b/lib/ui/painting/canvas.h @@ -48,6 +48,7 @@ class Canvas : public fxl::RefCountedThreadSafe, const Paint& paint, const PaintData& paint_data); void restore(); + void restoreToCount(int saveCount); int getSaveCount(); void translate(double dx, double dy); @@ -61,8 +62,8 @@ class Canvas : public fxl::RefCountedThreadSafe, double right, double bottom, SkClipOp clipOp); - void clipRRect(const RRect& rrect); - void clipPath(const CanvasPath* path); + void clipRRect(const RRect& rrect, bool doAntiAlias = true); + void clipPath(const CanvasPath* path, bool doAntiAlias = true); void drawColor(SkColor color, SkBlendMode blend_mode); void drawLine(double x1, From f0c21f327ea6601062fc5cfc71c7dbde05baa6c7 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 29 Jun 2018 19:33:39 -0400 Subject: [PATCH 0682/1190] Roll src/third_party/skia 184d408b646b..b7b9d02ac020 (7 commits) (#5646) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index fbd6bc9d0c566..a07c98b53700d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '184d408b646b9c6a2685170228649c4ed652e2a6', + 'skia_revision': 'b7b9d02ac020f7f031c30aaea0c0467cf66e4569', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 799461fb8e2e8..25b53bdb3c54e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1b9c8f9dd2481708e6fef88112ad582a +Signature: 0b9ddd563a54c92983c98b5e654e4c02 UNUSED LICENSES: From 4c4ef987a61ec7c7c821a64f92a3a9ae2110b1a9 Mon Sep 17 00:00:00 2001 From: mikejurka Date: Fri, 29 Jun 2018 17:06:55 -0700 Subject: [PATCH 0683/1190] [fuchsia] Rename scenic_lib => scenic (#5648) TEST=Compiled and ran flutter app on Fuchsia, verified it rendered and responded to input. --- flow/export_node.cc | 6 +++--- flow/export_node.h | 8 ++++---- flow/layers/clip_path_layer.cc | 2 +- flow/layers/clip_rect_layer.cc | 2 +- flow/layers/clip_rrect_layer.cc | 2 +- flow/layers/layer.h | 4 ++-- flow/layers/layer_tree.cc | 2 +- flow/layers/layer_tree.h | 2 +- flow/scene_update_context.cc | 28 ++++++++++++++-------------- flow/scene_update_context.h | 24 ++++++++++++------------ 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/flow/export_node.cc b/flow/export_node.cc index b4d37d61d65fc..9b4b62faea5c2 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -17,7 +17,7 @@ ExportNodeHolder::ExportNodeHolder( } void ExportNodeHolder::Bind(SceneUpdateContext& context, - scenic_lib::ContainerNode& container, + scenic::ContainerNode& container, const SkPoint& offset, bool hit_testable) { export_node_->Bind(context, container, offset, hit_testable); @@ -40,12 +40,12 @@ ExportNode::~ExportNode() { } void ExportNode::Bind(SceneUpdateContext& context, - scenic_lib::ContainerNode& container, + scenic::ContainerNode& container, const SkPoint& offset, bool hit_testable) { if (export_token_) { // Happens first time we bind. - node_.reset(new scenic_lib::EntityNode(container.session())); + node_.reset(new scenic::EntityNode(container.session())); node_->Export(std::move(export_token_)); // Add ourselves to the context so it can call Dispose() on us if the Scenic diff --git a/flow/export_node.h b/flow/export_node.h index e6a11175e561e..335d3ba92aba3 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -14,7 +14,7 @@ #include "lib/fxl/build_config.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" -#include "lib/ui/scenic/client/resources.h" +#include "lib/ui/scenic/cpp/resources.h" #include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" @@ -31,7 +31,7 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { // Calls Bind() on the wrapped ExportNode. void Bind(SceneUpdateContext& context, - scenic_lib::ContainerNode& container, + scenic::ContainerNode& container, const SkPoint& offset, bool hit_testable); @@ -58,7 +58,7 @@ class ExportNode { // Binds the export token to the entity node and adds it as a child of // the specified container. Must be called on the Rasterizer thread. void Bind(SceneUpdateContext& context, - scenic_lib::ContainerNode& container, + scenic::ContainerNode& container, const SkPoint& offset, bool hit_testable); @@ -73,7 +73,7 @@ class ExportNode { // Member variables can only be read or modified on Rasterizer thread. SceneUpdateContext* scene_update_context_ = nullptr; zx::eventpair export_token_; - std::unique_ptr node_; + std::unique_ptr node_; FXL_DISALLOW_COPY_AND_ASSIGN(ExportNode); }; diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index 06dd30bd3630a..e5547a39a90d3 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -33,7 +33,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { // TODO(MZ-140): Must be able to specify paths as shapes to nodes. // Treating the shape as a rectangle for now. auto bounds = clip_path_.getBounds(); - scenic_lib::Rectangle shape(context.session(), // session + scenic::Rectangle shape(context.session(), // session bounds.width(), // width bounds.height() // height ); diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index 4abdbdaf69217..0e613793426fd 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -24,7 +24,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { FXL_DCHECK(needs_system_composite()); - scenic_lib::Rectangle shape(context.session(), // session + scenic::Rectangle shape(context.session(), // session clip_rect_.width(), // width clip_rect_.height() // height ); diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index cef687dfcfb8a..67ec489d6b6c7 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -25,7 +25,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { FXL_DCHECK(needs_system_composite()); // TODO(MZ-137): Need to be able to express the radii as vectors. - scenic_lib::RoundedRectangle shape( + scenic::RoundedRectangle shape( context.session(), // session clip_rrect_.width(), // width clip_rrect_.height(), // height diff --git a/flow/layers/layer.h b/flow/layers/layer.h index cf7ad71c36fae..87539d3e98b5d 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -27,8 +27,8 @@ #if defined(OS_FUCHSIA) #include "flutter/flow/scene_update_context.h" //nogncheck -#include "lib/ui/scenic/client/resources.h" //nogncheck -#include "lib/ui/scenic/client/session.h" //nogncheck +#include "lib/ui/scenic/cpp/resources.h" //nogncheck +#include "lib/ui/scenic/cpp/session.h" //nogncheck #endif // defined(OS_FUCHSIA) diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index 67ec443dbd9bb..d5bacbd865c37 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -37,7 +37,7 @@ void LayerTree::Preroll(CompositorContext::ScopedFrame& frame, #if defined(OS_FUCHSIA) void LayerTree::UpdateScene(SceneUpdateContext& context, - scenic_lib::ContainerNode& container) { + scenic::ContainerNode& container) { TRACE_EVENT0("flutter", "LayerTree::UpdateScene"); const auto& metrics = context.metrics(); SceneUpdateContext::Transform transform(context, // context diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 548c99f0ce6b5..522fe6a34f393 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -29,7 +29,7 @@ class LayerTree { #if defined(OS_FUCHSIA) void UpdateScene(SceneUpdateContext& context, - scenic_lib::ContainerNode& container); + scenic::ContainerNode& container); #endif void Paint(CompositorContext::ScopedFrame& frame) const; diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index b9d6801cc82ee..dc72f28deef44 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -11,7 +11,7 @@ namespace flow { -SceneUpdateContext::SceneUpdateContext(scenic_lib::Session* session, +SceneUpdateContext::SceneUpdateContext(scenic::Session* session, SurfaceProducer* surface_producer) : session_(session), surface_producer_(surface_producer) { FXL_DCHECK(surface_producer_ != nullptr); @@ -40,7 +40,7 @@ void SceneUpdateContext::RemoveExportNode(ExportNode* export_node) { export_nodes_.erase(export_node); } -void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, +void SceneUpdateContext::CreateFrame(scenic::EntityNode& entity_node, const SkRRect& rrect, SkColor color, const SkRect& paint_bounds, @@ -56,7 +56,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, // and possibly for its texture. // TODO(MZ-137): Need to be able to express the radii as vectors. SkRect shape_bounds = rrect.getBounds(); - scenic_lib::RoundedRectangle shape( + scenic::RoundedRectangle shape( session_, // session rrect.width(), // width rrect.height(), // height @@ -65,7 +65,7 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, rrect.radii(SkRRect::kLowerRight_Corner).x(), // bottom_right_radius rrect.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius ); - scenic_lib::ShapeNode shape_node(session_); + scenic::ShapeNode shape_node(session_); shape_node.SetShape(shape); shape_node.SetTranslation(shape_bounds.width() * 0.5f + shape_bounds.left(), shape_bounds.height() * 0.5f + shape_bounds.top(), @@ -93,9 +93,9 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, if (inner_bounds != shape_bounds && rrect.contains(inner_bounds)) { SetShapeColor(shape_node, color); - scenic_lib::Rectangle inner_shape(session_, inner_bounds.width(), + scenic::Rectangle inner_shape(session_, inner_bounds.width(), inner_bounds.height()); - scenic_lib::ShapeNode inner_node(session_); + scenic::ShapeNode inner_node(session_); inner_node.SetShape(inner_shape); inner_node.SetTranslation(inner_bounds.width() * 0.5f + inner_bounds.left(), inner_bounds.height() * 0.5f + inner_bounds.top(), @@ -112,16 +112,16 @@ void SceneUpdateContext::CreateFrame(scenic_lib::EntityNode& entity_node, } void SceneUpdateContext::SetShapeTextureOrColor( - scenic_lib::ShapeNode& shape_node, + scenic::ShapeNode& shape_node, SkColor color, SkScalar scale_x, SkScalar scale_y, const SkRect& paint_bounds, std::vector paint_layers) { - scenic_lib::Image* image = GenerateImageIfNeeded( + scenic::Image* image = GenerateImageIfNeeded( color, scale_x, scale_y, paint_bounds, std::move(paint_layers)); if (image != nullptr) { - scenic_lib::Material material(session_); + scenic::Material material(session_); material.SetTexture(*image); shape_node.SetMaterial(material); return; @@ -130,18 +130,18 @@ void SceneUpdateContext::SetShapeTextureOrColor( SetShapeColor(shape_node, color); } -void SceneUpdateContext::SetShapeColor(scenic_lib::ShapeNode& shape_node, +void SceneUpdateContext::SetShapeColor(scenic::ShapeNode& shape_node, SkColor color) { if (SkColorGetA(color) == 0) return; - scenic_lib::Material material(session_); + scenic::Material material(session_); material.SetColor(SkColorGetR(color), SkColorGetG(color), SkColorGetB(color), SkColorGetA(color)); shape_node.SetMaterial(material); } -scenic_lib::Image* SceneUpdateContext::GenerateImageIfNeeded( +scenic::Image* SceneUpdateContext::GenerateImageIfNeeded( SkColor color, SkScalar scale_x, SkScalar scale_y, @@ -219,10 +219,10 @@ SceneUpdateContext::Entity::~Entity() { } SceneUpdateContext::Clip::Clip(SceneUpdateContext& context, - scenic_lib::Shape& shape, + scenic::Shape& shape, const SkRect& shape_bounds) : Entity(context) { - scenic_lib::ShapeNode shape_node(context.session()); + scenic::ShapeNode shape_node(context.session()); shape_node.SetShape(shape); shape_node.SetTranslation(shape_bounds.width() * 0.5f + shape_bounds.left(), shape_bounds.height() * 0.5f + shape_bounds.top(), diff --git a/flow/scene_update_context.h b/flow/scene_update_context.h index 46210431ed8ee..23beb0a887dae 100644 --- a/flow/scene_update_context.h +++ b/flow/scene_update_context.h @@ -13,7 +13,7 @@ #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/fxl/macros.h" -#include "lib/ui/scenic/client/resources.h" +#include "lib/ui/scenic/cpp/resources.h" #include "third_party/skia/include/core/SkRect.h" #include "third_party/skia/include/core/SkSurface.h" @@ -40,7 +40,7 @@ class SceneUpdateContext { virtual void SignalWritesFinished( std::function on_writes_committed) = 0; - virtual scenic_lib::Image* GetImage() = 0; + virtual scenic::Image* GetImage() = 0; virtual sk_sp GetSkiaSurface() const = 0; }; @@ -62,19 +62,19 @@ class SceneUpdateContext { ~Entity(); SceneUpdateContext& context() { return context_; } - scenic_lib::EntityNode& entity_node() { return entity_node_; } + scenic::EntityNode& entity_node() { return entity_node_; } private: SceneUpdateContext& context_; Entity* const previous_entity_; - scenic_lib::EntityNode entity_node_; + scenic::EntityNode entity_node_; }; class Clip : public Entity { public: Clip(SceneUpdateContext& context, - scenic_lib::Shape& shape, + scenic::Shape& shape, const SkRect& shape_bounds); ~Clip(); }; @@ -111,12 +111,12 @@ class SceneUpdateContext { SkRect paint_bounds_; }; - SceneUpdateContext(scenic_lib::Session* session, + SceneUpdateContext(scenic::Session* session, SurfaceProducer* surface_producer); ~SceneUpdateContext(); - scenic_lib::Session* session() { return session_; } + scenic::Session* session() { return session_; } bool has_metrics() const { return !!metrics_; } void set_metrics(fuchsia::ui::gfx::MetricsPtr metrics) { @@ -157,19 +157,19 @@ class SceneUpdateContext { std::vector layers; }; - void CreateFrame(scenic_lib::EntityNode& entity_node, + void CreateFrame(scenic::EntityNode& entity_node, const SkRRect& rrect, SkColor color, const SkRect& paint_bounds, std::vector paint_layers); - void SetShapeTextureOrColor(scenic_lib::ShapeNode& shape_node, + void SetShapeTextureOrColor(scenic::ShapeNode& shape_node, SkColor color, SkScalar scale_x, SkScalar scale_y, const SkRect& paint_bounds, std::vector paint_layers); - void SetShapeColor(scenic_lib::ShapeNode& shape_node, SkColor color); - scenic_lib::Image* GenerateImageIfNeeded(SkColor color, + void SetShapeColor(scenic::ShapeNode& shape_node, SkColor color); + scenic::Image* GenerateImageIfNeeded(SkColor color, SkScalar scale_x, SkScalar scale_y, const SkRect& paint_bounds, @@ -179,7 +179,7 @@ class SceneUpdateContext { float top_scale_x_ = 1.f; float top_scale_y_ = 1.f; - scenic_lib::Session* const session_; + scenic::Session* const session_; SurfaceProducer* const surface_producer_; fuchsia::ui::gfx::MetricsPtr metrics_; From 2261ccf87e49ab2aa6a0d28e31adc2de178472a7 Mon Sep 17 00:00:00 2001 From: mikejurka Date: Fri, 29 Jun 2018 17:24:47 -0700 Subject: [PATCH 0684/1190] [fuchsia] Update scenic lib path. (#5649) --- flow/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/BUILD.gn b/flow/BUILD.gn index 07c5d4e5d4e7b..27ce8e41c070b 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -84,7 +84,7 @@ source_set("flow") { ] public_deps += [ - "//garnet/public/lib/ui/scenic:client", + "//garnet/public/lib/ui/scenic/cpp", "//garnet/public/lib/ui/scenic/fidl", "//topaz/public/dart-pkg/zircon", ] From b88a8b3d5f8965f12f375acdb583627ed316fb00 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 30 Jun 2018 02:03:46 -0400 Subject: [PATCH 0685/1190] Roll src/third_party/skia b7b9d02ac020..cf863fb9b446 (1 commits) (#5650) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index a07c98b53700d..a76bcd9da9267 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b7b9d02ac020f7f031c30aaea0c0467cf66e4569', + 'skia_revision': 'cf863fb9b446dc19f489394e6d2d0b63e1eca9bc', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From d8770d4400d992882559ddc06a7c5d748f6c2bcc Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 30 Jun 2018 05:26:39 -0400 Subject: [PATCH 0686/1190] Roll src/third_party/skia cf863fb9b446..75e69028956d (1 commits) (#5651) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a76bcd9da9267..521d05d484cbd 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cf863fb9b446dc19f489394e6d2d0b63e1eca9bc', + 'skia_revision': '75e69028956dc4158f4f51e30390d6120f6baded', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 25b53bdb3c54e..75bc3a9ae7f0a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0b9ddd563a54c92983c98b5e654e4c02 +Signature: 5eacdc3eead452476dc6c18cbc90be0a UNUSED LICENSES: From df4dffb106fcefdd21e28579b7ffc89196a5a75c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 1 Jul 2018 02:00:39 -0400 Subject: [PATCH 0687/1190] Roll src/third_party/skia 75e69028956d..34024a7c478c (1 commits) (#5652) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 521d05d484cbd..5941c8c9c3025 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '75e69028956dc4158f4f51e30390d6120f6baded', + 'skia_revision': '34024a7c478c210faee6d9cc348f7cb7f1ca9bfb', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From bc6b2501c260a13855d741a17f98316861d2d1bd Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 2 Jul 2018 02:09:40 -0400 Subject: [PATCH 0688/1190] Roll src/third_party/skia 34024a7c478c..8451daabb23d (1 commits) (#5653) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 5941c8c9c3025..f2f1be35c585b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '34024a7c478c210faee6d9cc348f7cb7f1ca9bfb', + 'skia_revision': '8451daabb23d52454ee8d37b2f02a7ae6385a167', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 061e899b5593cf2a79e875f8a321d0ff04fc7f66 Mon Sep 17 00:00:00 2001 From: matthew-carroll Date: Mon, 2 Jul 2018 06:58:01 +0000 Subject: [PATCH 0689/1190] Support all keyboard actions. (#11344) (#5620) * Support all keyboard actions. (#11344) --- .../editing/InputConnectionAdaptor.java | 26 ++++- .../plugin/editing/TextInputPlugin.java | 26 ++++- .../Source/FlutterTextInputDelegate.h | 9 ++ .../Source/FlutterTextInputPlugin.mm | 94 +++++++++++++++++-- .../framework/Source/FlutterViewController.mm | 31 ++++++ 5 files changed, 173 insertions(+), 13 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java b/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java index c77524dfa06df..02190a84b4fbb 100644 --- a/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java +++ b/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java @@ -172,12 +172,36 @@ public boolean sendKeyEvent(KeyEvent event) { @Override public boolean performEditorAction(int actionCode) { - // TODO(abarth): Support more actions. switch (actionCode) { + // TODO(mattcarroll): is newline an appropriate action for "none"? case EditorInfo.IME_ACTION_NONE: mFlutterChannel.invokeMethod("TextInputClient.performAction", Arrays.asList(mClient, "TextInputAction.newline")); break; + case EditorInfo.IME_ACTION_UNSPECIFIED: + mFlutterChannel.invokeMethod("TextInputClient.performAction", + Arrays.asList(mClient, "TextInputAction.unspecified")); + break; + case EditorInfo.IME_ACTION_GO: + mFlutterChannel.invokeMethod("TextInputClient.performAction", + Arrays.asList(mClient, "TextInputAction.go")); + break; + case EditorInfo.IME_ACTION_SEARCH: + mFlutterChannel.invokeMethod("TextInputClient.performAction", + Arrays.asList(mClient, "TextInputAction.search")); + break; + case EditorInfo.IME_ACTION_SEND: + mFlutterChannel.invokeMethod("TextInputClient.performAction", + Arrays.asList(mClient, "TextInputAction.send")); + break; + case EditorInfo.IME_ACTION_NEXT: + mFlutterChannel.invokeMethod("TextInputClient.performAction", + Arrays.asList(mClient, "TextInputAction.next")); + break; + case EditorInfo.IME_ACTION_PREVIOUS: + mFlutterChannel.invokeMethod("TextInputClient.performAction", + Arrays.asList(mClient, "TextInputAction.previous")); + break; default: case EditorInfo.IME_ACTION_DONE: mFlutterChannel.invokeMethod("TextInputClient.performAction", diff --git a/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java b/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java index 0d8f05e3a94a4..5ada698404bdb 100644 --- a/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java +++ b/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java @@ -115,9 +115,29 @@ else if (inputType.equals("TextInputType.url")) } private static int inputActionFromTextInputAction(String inputAction) { - if (inputAction.equals("TextInputAction.newline")) - return EditorInfo.IME_ACTION_NONE; - return EditorInfo.IME_ACTION_DONE; + switch (inputAction) { + case "TextInputAction.newline": + return EditorInfo.IME_ACTION_NONE; + case "TextInputAction.none": + return EditorInfo.IME_ACTION_NONE; + case "TextInputAction.unspecified": + return EditorInfo.IME_ACTION_UNSPECIFIED; + case "TextInputAction.done": + return EditorInfo.IME_ACTION_DONE; + case "TextInputAction.go": + return EditorInfo.IME_ACTION_GO; + case "TextInputAction.search": + return EditorInfo.IME_ACTION_SEARCH; + case "TextInputAction.send": + return EditorInfo.IME_ACTION_SEND; + case "TextInputAction.next": + return EditorInfo.IME_ACTION_NEXT; + case "TextInputAction.previous": + return EditorInfo.IME_ACTION_PREVIOUS; + default: + // Present default key if bad input type is given. + return EditorInfo.IME_ACTION_UNSPECIFIED; + } } public InputConnection createInputConnection(FlutterView view, EditorInfo outAttrs) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h b/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h index e82f2c41f42a1..3136eb08ccafe 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h @@ -8,7 +8,16 @@ #import typedef NS_ENUM(NSInteger, FlutterTextInputAction) { + FlutterTextInputActionUnspecified, FlutterTextInputActionDone, + FlutterTextInputActionGo, + FlutterTextInputActionSend, + FlutterTextInputActionSearch, + FlutterTextInputActionNext, + FlutterTextInputActionContinue, + FlutterTextInputActionJoin, + FlutterTextInputActionRoute, + FlutterTextInputActionEmergencyCall, FlutterTextInputActionNewline, }; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 79aee477a369c..b188bf0ccc35b 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -5,6 +5,7 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" #include +#include static const char _kTextAffinityDownstream[] = "TextAffinity.downstream"; static const char _kTextAffinityUpstream[] = "TextAffinity.upstream"; @@ -30,9 +31,46 @@ static UIKeyboardType ToUIKeyboardType(NSDictionary* type) { } static UIReturnKeyType ToUIReturnKeyType(NSString* inputType) { - if ([inputType isEqualToString:@"TextInputType.multiline"]) + // Where did the term "unspecified" come from? iOS has a "default" and Android + // has "unspecified." These 2 terms seem to mean the same thing but we need + // to pick just one. "unspecified" was chosen because "default" is often a + // reserved word in languages with switch statements (dart, java, etc). + if ([inputType isEqualToString:@"TextInputAction.unspecified"]) + return UIReturnKeyDefault; + + if ([inputType isEqualToString:@"TextInputAction.done"]) + return UIReturnKeyDone; + + if ([inputType isEqualToString:@"TextInputAction.go"]) + return UIReturnKeyGo; + + if ([inputType isEqualToString:@"TextInputAction.send"]) + return UIReturnKeySend; + + if ([inputType isEqualToString:@"TextInputAction.search"]) + return UIReturnKeySearch; + + if ([inputType isEqualToString:@"TextInputAction.next"]) + return UIReturnKeyNext; + + if (@available(iOS 9.0, *)) + if ([inputType isEqualToString:@"TextInputAction.continueAction"]) + return UIReturnKeyContinue; + + if ([inputType isEqualToString:@"TextInputAction.join"]) + return UIReturnKeyJoin; + + if ([inputType isEqualToString:@"TextInputAction.route"]) + return UIReturnKeyRoute; + + if ([inputType isEqualToString:@"TextInputAction.emergencyCall"]) + return UIReturnKeyEmergencyCall; + + if ([inputType isEqualToString:@"TextInputAction.newline"]) return UIReturnKeyDefault; - return UIReturnKeyDone; + + // Present default key if bad input type is given. + return UIReturnKeyDefault; } static UITextAutocapitalizationType ToUITextAutocapitalizationType(NSString* inputType) { @@ -277,14 +315,52 @@ - (void)replaceRange:(UITextRange*)range withText:(NSString*)text { } - (BOOL)shouldChangeTextInRange:(UITextRange*)range replacementText:(NSString*)text { - if (self.returnKeyType == UIReturnKeyDone && [text isEqualToString:@"\n"]) { - [self resignFirstResponder]; - [self removeFromSuperview]; - [_textInputDelegate performAction:FlutterTextInputActionDone withClient:_textInputClient]; + if (self.returnKeyType == UIReturnKeyDefault && [text isEqualToString:@"\n"]) { + [_textInputDelegate performAction:FlutterTextInputActionNewline withClient:_textInputClient]; + return YES; + } + + if ([text isEqualToString:@"\n"]) { + FlutterTextInputAction action; + switch (self.returnKeyType) { + case UIReturnKeyDefault: + action = FlutterTextInputActionUnspecified; + break; + case UIReturnKeyDone: + action = FlutterTextInputActionDone; + break; + case UIReturnKeyGo: + action = FlutterTextInputActionGo; + break; + case UIReturnKeySend: + action = FlutterTextInputActionSend; + break; + case UIReturnKeySearch: + case UIReturnKeyGoogle: + case UIReturnKeyYahoo: + action = FlutterTextInputActionSearch; + break; + case UIReturnKeyNext: + action = FlutterTextInputActionNext; + break; + case UIReturnKeyContinue: + action = FlutterTextInputActionContinue; + break; + case UIReturnKeyJoin: + action = FlutterTextInputActionJoin; + break; + case UIReturnKeyRoute: + action = FlutterTextInputActionRoute; + break; + case UIReturnKeyEmergencyCall: + action = FlutterTextInputActionEmergencyCall; + break; + } + + [_textInputDelegate performAction:action withClient:_textInputClient]; return NO; } - if (self.returnKeyType == UIReturnKeyDefault && [text isEqualToString:@"\n"]) - [_textInputDelegate performAction:FlutterTextInputActionNewline withClient:_textInputClient]; + return YES; } @@ -612,7 +688,7 @@ - (void)hideTextInput { - (void)setTextInputClient:(int)client withConfiguration:(NSDictionary*)configuration { NSDictionary* inputType = configuration[@"inputType"]; _view.keyboardType = ToUIKeyboardType(inputType); - _view.returnKeyType = ToUIReturnKeyType(inputType[@"name"]); + _view.returnKeyType = ToUIReturnKeyType(configuration[@"inputAction"]); _view.autocapitalizationType = ToUITextAutocapitalizationType(inputType[@"name"]); _view.secureTextEntry = [configuration[@"obscureText"] boolValue]; NSString* autocorrect = configuration[@"autocorrect"]; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index b69a40c21e0f3..252d5e61e4bb2 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -717,9 +717,40 @@ - (void)updateEditingClient:(int)client withState:(NSDictionary*)state { - (void)performAction:(FlutterTextInputAction)action withClient:(int)client { NSString* actionString; switch (action) { + case FlutterTextInputActionUnspecified: + // Where did the term "unspecified" come from? iOS has a "default" and Android + // has "unspecified." These 2 terms seem to mean the same thing but we need + // to pick just one. "unspecified" was chosen because "default" is often a + // reserved word in languages with switch statements (dart, java, etc). + actionString = @"TextInputAction.unspecified"; + break; case FlutterTextInputActionDone: actionString = @"TextInputAction.done"; break; + case FlutterTextInputActionGo: + actionString = @"TextInputAction.go"; + break; + case FlutterTextInputActionSend: + actionString = @"TextInputAction.send"; + break; + case FlutterTextInputActionSearch: + actionString = @"TextInputAction.search"; + break; + case FlutterTextInputActionNext: + actionString = @"TextInputAction.next"; + break; + case FlutterTextInputActionContinue: + actionString = @"TextInputAction.continue"; + break; + case FlutterTextInputActionJoin: + actionString = @"TextInputAction.join"; + break; + case FlutterTextInputActionRoute: + actionString = @"TextInputAction.route"; + break; + case FlutterTextInputActionEmergencyCall: + actionString = @"TextInputAction.emergencyCall"; + break; case FlutterTextInputActionNewline: actionString = @"TextInputAction.newline"; break; From 0ec766946dc949f1c8c5c7e79925a7b70fb52a1f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 2 Jul 2018 05:34:40 -0400 Subject: [PATCH 0690/1190] Roll src/third_party/skia 8451daabb23d..00d2e8ebcb13 (1 commits) (#5654) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f2f1be35c585b..edc3923186210 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8451daabb23d52454ee8d37b2f02a7ae6385a167', + 'skia_revision': '00d2e8ebcb13c388339ff1cfbd202fff9589e77a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 75bc3a9ae7f0a..d580977f9ffad 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5eacdc3eead452476dc6c18cbc90be0a +Signature: b592c09053bd1f4b8a28fa904dfa3260 UNUSED LICENSES: From f2eb83ae20c9de50f986d5a70ee045a862ae59f6 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 2 Jul 2018 10:10:40 -0400 Subject: [PATCH 0691/1190] Roll src/third_party/skia 00d2e8ebcb13..a219419c9d76 (1 commits) (#5655) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index edc3923186210..c9d5e63b575f7 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '00d2e8ebcb13c388339ff1cfbd202fff9589e77a', + 'skia_revision': 'a219419c9d76432dca74494b611ff1f59086d139', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d580977f9ffad..2ef1750480ce1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b592c09053bd1f4b8a28fa904dfa3260 +Signature: 27a277a6f1d17cfe55747849db68a5de UNUSED LICENSES: From ad42324a62abcbc559ec8650fe2f0642c23ea3d0 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 2 Jul 2018 13:35:39 -0400 Subject: [PATCH 0692/1190] Roll src/third_party/skia a219419c9d76..d818ebf4a317 (2 commits) (#5657) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c9d5e63b575f7..51d054b9ad208 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a219419c9d76432dca74494b611ff1f59086d139', + 'skia_revision': 'd818ebf4a31724aa93fd439a2ac4195f69ae3af0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 2ef1750480ce1..06295db481b6a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 27a277a6f1d17cfe55747849db68a5de +Signature: 17d988d6163a5d451cd32d7949fdbe92 UNUSED LICENSES: From 70dcbb591c6cafee31ea53f8b91e353014766344 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 2 Jul 2018 17:02:39 -0400 Subject: [PATCH 0693/1190] Roll src/third_party/skia d818ebf4a317..9aa30c6ee0e5 (11 commits) (#5658) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/DEPS b/DEPS index 51d054b9ad208..a53581cc73aec 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd818ebf4a31724aa93fd439a2ac4195f69ae3af0', + 'skia_revision': '9aa30c6ee0e5e2ba4ccc25a4913966a65f808f28', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 06295db481b6a..502480f5a7215 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 17d988d6163a5d451cd32d7949fdbe92 +Signature: 2d5de1e7a4985bf6c894c5b328917a94 UNUSED LICENSES: @@ -17400,20 +17400,7 @@ FILE: ../../../third_party/skia/src/utils/SkJSON.cpp FILE: ../../../third_party/skia/src/utils/SkJSON.h FILE: ../../../third_party/skia/third_party/skcms/skcms.c FILE: ../../../third_party/skia/third_party/skcms/skcms.h -FILE: ../../../third_party/skia/third_party/skcms/src/Curve.c -FILE: ../../../third_party/skia/third_party/skcms/src/Curve.h -FILE: ../../../third_party/skia/third_party/skcms/src/ICCProfile.c -FILE: ../../../third_party/skia/third_party/skcms/src/ICCProfile.h -FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.c -FILE: ../../../third_party/skia/third_party/skcms/src/LinearAlgebra.h -FILE: ../../../third_party/skia/third_party/skcms/src/Macros.h -FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.c -FILE: ../../../third_party/skia/third_party/skcms/src/PortableMath.h -FILE: ../../../third_party/skia/third_party/skcms/src/RandomBytes.h -FILE: ../../../third_party/skia/third_party/skcms/src/TransferFunction.c -FILE: ../../../third_party/skia/third_party/skcms/src/TransferFunction.h -FILE: ../../../third_party/skia/third_party/skcms/src/Transform.c -FILE: ../../../third_party/skia/third_party/skcms/src/Transform.h +FILE: ../../../third_party/skia/third_party/skcms/skcms_internal.h FILE: ../../../third_party/skia/third_party/skcms/src/Transform_inl.h FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.cpp FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.h From 21c7d6a5da47165d076928fbe460badbbead24cd Mon Sep 17 00:00:00 2001 From: liyuqian Date: Mon, 2 Jul 2018 16:55:24 -0700 Subject: [PATCH 0694/1190] Revert "Add antiAlias and saveCount to clipPath and restore (#5638)" (#5660) This reverts commit a2bf80590b80a797659193a2d7b320fda0f21ea2. Reason for revert: need to fix several things including the framework test in order to unblock the engine roll. TBR: @matthew-carroll --- lib/ui/painting.dart | 21 ++++++--------------- lib/ui/painting/canvas.cc | 15 ++++----------- lib/ui/painting/canvas.h | 5 ++--- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 36db2ac2d64c4..6adb1902b3a64 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -2886,15 +2886,6 @@ class Canvas extends NativeFieldWrapperClass2 { /// cause the new layer to be composited into the previous layer. void restore() native 'Canvas_restore'; - /// Restore the current save stack to the state where [saveCount] is gotten. - /// - /// Use [save] and [saveLayer] to push state onto the stack, and use - /// [getSaveCount] to get the [saveCount]. - /// - /// If a state was pushed with with [saveLayer], then this call will also - /// cause the new layer to be composited into the previous layer. - void restoreToCount(int saveCount) native 'Canvas_restoreToCount'; - /// Returns the number of items on the save stack, including the /// initial state. This means it returns 1 for a clean canvas, and /// that each call to [save] and [saveLayer] increments it, and that @@ -2965,11 +2956,11 @@ class Canvas extends NativeFieldWrapperClass2 { /// multiple draw commands intersect with the clip boundary, this can result /// in incorrect blending at the clip boundary. See [saveLayer] for a /// discussion of how to address that and some examples of using [clipRRect]. - void clipRRect(RRect rrect, [bool doAntiAlias = true]) { + void clipRRect(RRect rrect) { assert(_rrectIsValid(rrect)); - _clipRRect(rrect._value, doAntiAlias); + _clipRRect(rrect._value); } - void _clipRRect(Float32List rrect, bool doAntiAlias) native 'Canvas_clipRRect'; + void _clipRRect(Float32List rrect) native 'Canvas_clipRRect'; /// Reduces the clip region to the intersection of the current clip and the /// given [Path]. @@ -2978,11 +2969,11 @@ class Canvas extends NativeFieldWrapperClass2 { /// multiple draw commands intersect with the clip boundary, this can result /// in incorrect blending at the clip boundary. See [saveLayer] for a /// discussion of how to address that. - void clipPath(Path path, [bool doAntiAlias = true]) { + void clipPath(Path path) { assert(path != null); // path is checked on the engine side - _clipPath(path, doAntiAlias); + _clipPath(path); } - void _clipPath(Path path, bool doAntiAlias) native 'Canvas_clipPath'; + void _clipPath(Path path) native 'Canvas_clipPath'; /// Paints the given [Color] onto the canvas, applying the given /// [BlendMode], with the given color being the source and the background diff --git a/lib/ui/painting/canvas.cc b/lib/ui/painting/canvas.cc index 23b8053a9ef78..7bfeb5cfdda9e 100644 --- a/lib/ui/painting/canvas.cc +++ b/lib/ui/painting/canvas.cc @@ -35,7 +35,6 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, Canvas); V(Canvas, saveLayerWithoutBounds) \ V(Canvas, saveLayer) \ V(Canvas, restore) \ - V(Canvas, restoreToCount) \ V(Canvas, getSaveCount) \ V(Canvas, translate) \ V(Canvas, scale) \ @@ -121,12 +120,6 @@ void Canvas::restore() { canvas_->restore(); } -void Canvas::restoreToCount(int saveCount) { - if (!canvas_) - return; - canvas_->restoreToCount(saveCount); -} - int Canvas::getSaveCount() { if (!canvas_) return 0; @@ -173,19 +166,19 @@ void Canvas::clipRect(double left, canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom), clipOp, true); } -void Canvas::clipRRect(const RRect& rrect, bool doAntiAlias) { +void Canvas::clipRRect(const RRect& rrect) { if (!canvas_) return; - canvas_->clipRRect(rrect.sk_rrect, doAntiAlias); + canvas_->clipRRect(rrect.sk_rrect, true); } -void Canvas::clipPath(const CanvasPath* path, bool doAntiAlias) { +void Canvas::clipPath(const CanvasPath* path) { if (!canvas_) return; if (!path) Dart_ThrowException( ToDart("Canvas.clipPath called with non-genuine Path.")); - canvas_->clipPath(path->path(), doAntiAlias); + canvas_->clipPath(path->path(), true); } void Canvas::drawColor(SkColor color, SkBlendMode blend_mode) { diff --git a/lib/ui/painting/canvas.h b/lib/ui/painting/canvas.h index e8ce866e9967a..03dfe618f454d 100644 --- a/lib/ui/painting/canvas.h +++ b/lib/ui/painting/canvas.h @@ -48,7 +48,6 @@ class Canvas : public fxl::RefCountedThreadSafe, const Paint& paint, const PaintData& paint_data); void restore(); - void restoreToCount(int saveCount); int getSaveCount(); void translate(double dx, double dy); @@ -62,8 +61,8 @@ class Canvas : public fxl::RefCountedThreadSafe, double right, double bottom, SkClipOp clipOp); - void clipRRect(const RRect& rrect, bool doAntiAlias = true); - void clipPath(const CanvasPath* path, bool doAntiAlias = true); + void clipRRect(const RRect& rrect); + void clipPath(const CanvasPath* path); void drawColor(SkColor color, SkBlendMode blend_mode); void drawLine(double x1, From a7d0f29c71538868ac2101ca6f98f6ea0e55b592 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 2 Jul 2018 20:26:40 -0400 Subject: [PATCH 0695/1190] Roll src/third_party/skia 9aa30c6ee0e5..ef21d7e47963 (5 commits) (#5661) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a53581cc73aec..d7def2ffd800b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9aa30c6ee0e5e2ba4ccc25a4913966a65f808f28', + 'skia_revision': 'ef21d7e47963c716895684f9f397e7cbcdb845ab', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 502480f5a7215..1fa6e0e51d667 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2d5de1e7a4985bf6c894c5b328917a94 +Signature: a7e30d118a9fe1d40e92d9a54283d232 UNUSED LICENSES: From 0fca44477fef50078c94bffcdd49a9142f8d238a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 2 Jul 2018 23:50:39 -0400 Subject: [PATCH 0696/1190] Roll src/third_party/skia ef21d7e47963..a22d924763ab (3 commits) (#5662) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d7def2ffd800b..111b849a09825 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'ef21d7e47963c716895684f9f397e7cbcdb845ab', + 'skia_revision': 'a22d924763abe9e2bafef0f9ce12a1fc8db72eca', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1fa6e0e51d667..1d7a4cc41c76f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a7e30d118a9fe1d40e92d9a54283d232 +Signature: 7f52fc5a84691ef557f817689628243b UNUSED LICENSES: From 32736d52c900533017dd3d99bb4c0bb0f6f27176 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 3 Jul 2018 03:18:39 -0400 Subject: [PATCH 0697/1190] Roll src/third_party/skia a22d924763ab..d7425b58df89 (4 commits) (#5664) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 111b849a09825..65039d74165b5 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a22d924763abe9e2bafef0f9ce12a1fc8db72eca', + 'skia_revision': 'd7425b58df89b1cf67cf9a8b0a055c1d071a6d88', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1d7a4cc41c76f..7f0a9ed8bbe9e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 7f52fc5a84691ef557f817689628243b +Signature: cd8632c3fe04e6bbbcf03aeef59aa2fd UNUSED LICENSES: From d05225ed96658e7f2d4b94f6e45f0a6aedf8cd37 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 3 Jul 2018 09:56:40 -0400 Subject: [PATCH 0698/1190] Roll src/third_party/skia d7425b58df89..94d57c477fe1 (1 commits) (#5665) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 65039d74165b5..a4e7f6c56709e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd7425b58df89b1cf67cf9a8b0a055c1d071a6d88', + 'skia_revision': '94d57c477fe122c146a034c625cebb6c44ef21b0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7f0a9ed8bbe9e..775e51f7173e3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: cd8632c3fe04e6bbbcf03aeef59aa2fd +Signature: 1d53e98f01ed69234c6cb276dfeeec61 UNUSED LICENSES: From b157d4f5683023836cdf15d42bf56fd201a7084b Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Tue, 3 Jul 2018 07:37:13 -0700 Subject: [PATCH 0699/1190] Roll dart sdk to 64641d014b77bd410e9aa10558522ae26e4210ee (#5610) * Roll dart sdk to 9c7cd04e7f285c3e74f54def9f91dbdd1a18b1ba. Changes since last roll: ``` 9c7cd04e7f [ VM / Testing ] Disabled non_utf8_* tests for FileSystemEntity classes 5c9e9a6661 [gardening] Update status file 5a193752f6 Clean up some hints e67c5953e9 Relax return restrictions. a9c624a010 [infra] Update checked in SDKs to 2.0.0-dev.65.0 12971f37a9 Update dart_style package to 1.1.0 in DEPS f67308a983 Handle invalid dill files more gracefully 9aa0c4ae3f [release] Prepare changelog for 2.0.0-dev.65.0 9a8b5f3bc2 Update app_jitk service status a16ad6d9de [infra] Make update_homebrew script work on Dart2 014a5bc678 Replace strstr with strncmp looking for path separator d2d47acdce [kernel] Include urls even when we have no source 5f17b0a0be Convert ShadowMapLiteral to MapLiteralJudgment 2c98fb3c1d Add tests showing the async impact on function type checks 8e4d5c0a38 Update formated error for nonexisting constructor a8e930caf3 Add ClassHierarchy to share code between J/KClosedWorld c9bd4df214 Document IntLiteral.value as holding a uint64 value 56d57407e1 Fix status for new test ed20faa2ed Add test for rejecting inexact numbers 31ed467871 Fix directory-prefix finding logic so it works on Windows. 2d6eaba187 pkg:build_integration: clarify that' it's not planned to be published f67cba1067 [vm] Introduce kernel_multiroot options to support multiroot compilation mode in kernel service. 2876bd08fb Doc - Fix OSError.message and errorCode doc c97f177112 Issue 33518. Fix for subtypes() in parts without library. e661c9ef54 Simplify 'as T' for simple T 65a3c4443b [observatory] Update packages and remove dead dependencies. b15572933d Update checked-in Dart SDK to 2.0.0-dev.64.1 9d3533ff72 snapshot the kernel worker in dart 2 mode and fix some dart 2 errors b29bde6232 Convert ShadowSyntheticExpression to SyntheticExpressionJudgment 2876623654 Check function types in the correct order in runZoned. 6d25212302 getStats Future should be strongly typed. ca99917fb6 Remove code awaiting void results to unblock #33145 19f60bfb52 Improve fasta parser expression recovery d632980ee0 Add tokens to more judgements 5721d8af6d - Fixed querySelectoryAll generic syntax to assert if types in list aren't of the same type T. - Fixes requestFullscreen to call operation webkitRequestFullscreen not requestFullscreen its only available when RuntimeEnabled=FullscreenUnprefixed. 3640037164 Fix second half on #33343: disallow generic functions as type arguments. 97c81d668a Remove variableSet factory methods. 98efc7917f Improve parse assert statement recovery a93e303f3f [vm/kernel/bytecode] Bytecode generation for rarely used operations a0ba81bfe7 Convert ShadowCascadeExpression to CascadeJudgment. de4d8b6cae Convert ShadowSymbolLiteral to SymbolLiteralJudgment 13c3560fc6 Count analyzer cfe integration failing tests. 77f94ec259 Convert ShadowLogicalExpression to LogicalJudgment 1a0fc733d3 Add tokens to more judgements 81191186d8 Remove unused class 284b5cce55 Partial fix of #33343. Reject generic function types as bounds. ada8188b73 Update pkg/pkg.status with the latest -DuseFastaParser status. e232ddd28c [VM] Handle [VariableGet]s for parameters/let variables differently than other const variables 5d4dbdac5c Adjust stringContentTDQ, stringContentTSQ to allow escapes. b27b62e182 [fasta] Update .expect files for non-simple bound tests aeff1c00f2 [vm/compiler] Improve CallTargets::CreateAndExpand 2ff5f8cfcb [VM] Report an error when accessing constructor parameters inside a constructor invocation 2f474a55c1 Change infer to return the expression instead of its type b9f11311f8 [vm/compiler] Fix incorrect assertion from 20ca5bbb056. f85fbde727 Expression compilation fix 6240dd5cc3 Make incremental_load_from_dill_test dart2 compliant 8747da838f Bump kernel version after e2ce88d 20ca5bbb05 [vm/jit] Introduce dynamic invocation forwarders that perform type checking f9a11ec380 [gardening] Mark language_2/const_constructor_nonconst_param_test/01 failing in dartkp 212a817322 Check whether variables is set before using GN not_needed f381778867 Update the status of analysis server tests. 8b10b1fda9 Add tokens to judgements, part 2 8c1591af9e Add a binder mechanism to the Factory API for handling labels. e132240c91 Re-enable some failing analyzer_cli --use-cfe tests. f598e6933c Drop support for Dart 1 in pub 9146cea63a Print times in seconds ec0df457a2 Convert invocation Shadow(s) to Judgment(s). 223b143167 Workaround for issue 33559. 091f8860c2 [ dart:io / tests ] Fixed issue where non_utf8* tests attempted to delete the current working directory which is not allowed on Windows. 9276b27acd Add unittest for InferenceData 70ac1f90ec Revert "Update checked-in Dart SDK to 2.0.0-dev.64.1" c270576dd4 Use FunctionNodeJudgment in FunctionExpressionJudgment. aeba82ef9a [dart2js] Fix for issue 33572 1416ed283a Convert ShadowNot to NotJudgment. a1a2d90a6c Convert ShadowForStatement to ForJudgment. 7c6211b1d8 Make unittests work with Dart 2 a8d805055a Handle covariant parameters in function types b24170259c Don't add parts without 'part of' as libraries. fea8cb1473 Revise order of type variable declaration events 6339976567 Rename lemma to binder 9d499fffe4 Start adding tokens to judgements ff7a1255aa Convert ShadowFunctionDeclaration to FunctionDeclarationJudgment, add FunctionNodeJudgment. 5bfb70ec5b Docs - Update example websockets app; use idiomatic async/await in examples ed0ba901e1 Doc - Fix library links in analyzer docs 4c697085be dart2js: Make bazel-input-provider dart2 compliant. 9b814bdf34 Use the lemma approach for NamedFunctionExpression 7c0d31092d Rename variableLemma and variableType to clarify that they refer to the loop variable. b36f353f76 Update dartdoc to 0.20.1. eafa9ae4b6 [vm/kernel] Fix StreamingConstantEvaluator to handle non-const variables 3e2708eada [VM interpreter] Fix broken interpreter build. 94abf948c4 pkg:status_file misc cleanup 02721709c3 Fix a committed solo test and mark it as passing now. c8a488c1ca Add parameters to Forest method to support labeled statements c4d6ac0cbe [vm/compiler/aot] Implement non-speculative int64 shift operation 3af363cba0 Rename typeContext to inferredType 10dcad1dd2 pkg:kernel - cleanup pubspec file 7e7fd7ffa5 Convert ShadowLiteralList into LiteralListJudgment 4fe71ec275 [fasta] Report instantiate-to-bound failure due to non-simple bounds 121fed2840 Convert ShadowDeferredCheck to DeferredCheckJudgment e2c54e9af5 Fix cascade specification. d08317b79f Make status file linter valid Dart 2 code f4d2bf313e Convert ShadowFunctionExpression to FunctionExpressionJudgment 6888bc2824 Compile time error for web int literals that cannot be represented exactly 075c713a93 Register type arguments on inlining 4ebdb31646 Separate getOutline() and getResolution() in FrontEndCompiler. 6a7bf90c42 Convert ShadowRethrow to RethrowJudgment 7661841cc5 Convert ShadowNamedFunctionExpression to NamedFunctionExpressionJudgment 6fd40725af Convert ShadowIfNullExpression to IfNullJudgment 7c327c32b7 [frontend-server] Fix starter so it works in '--incremental' mode f885a0c8f3 [vm/kernel] Fix crash when reading symbol literal from Dart annotation 16c0c0ff07 Convert ShadowStringConcatenation to StringConcatenationJudgment d0655066a5 Use the lemma approach for other variable declaring constructs. 2121c3bb56 Docs - Link to the Random.secure constructor in dartdoc 975686d5a9 [syscalls] Use vmar..._old apis. Modify existing calls to vmar routines in preparation for changing the parameter order. 7d7e7c268e [vm] Work around interaction between type and instance canonicalization in isolate messages. fa7c38dec5 [vm, standalone] Do not copy when loading kernel. 8d7c5294c6 Rename the kernel ShadowExpressions for assignments 47f394d61c Update checked-in Dart SDK to 2.0.0-dev.64.1 efd36d4cdf Updated non_utf8_* tests to better cleanup after themselves. Fixes issue d1e1af84e7 DEPS: update crypto version 530f1f6512 [build] Possible fix for 'Error while initializing Kernel isolate' e9bc3352e0 Replace and remove parseType 1b681a75c3 Modify Factory API to allow forward references to incomplete local functions and variables. f682213764 Add parameters to Factory methods to support the try statement cf6fbd9e07 Add parameters to Factory methods to support the switch statement b50ff4990a Add parameters to Factory methods for list and map literals c5855635ae Add Factory method parameters for for loops c2a22c6462 Updates to ddc/ddb tool 1a1ff9e666 Reverse the pub snapshot names d5d5daf411 Fixed cascade_test failure due to return type of operator []= being non-void. 69c807c636 Fix docs for async File methods 569341cbe0 Improve CompressionOptions docs: 8d40afc9c0 Convert ShadowTryFinally to TryFinallyJudgment. 4a9abfcacb Convert ShadowForInStatement to ForInJudgment. f2eaf6aae7 Remove type parameters from the Fasta BodyBuilder 74dd5440f1 Convert ShadowStringLiteral into StringLiteralJudgment 10641cbf42 Update status files after 52b2a869bcb93 ee19f2804a Make ResolutionStorer implement the Factory API. e2ce88dfcc Add startFileOffset on procedures et al, enable VMs GetSource 52b2a869bc Update some noSuchMethod based tests to the currently desired behavior. bf4f9a9163 Update testing scripts to run on a Dart 2 VM 8638668ecf [VM] Fix vm->native state transition in isolate_reload.cc 71ac67aed1 [kernel] Recognize noSuchMethod forwarders in class hierarchy analysis 216e8dfe85 Stop using !kernel annotations 3e85df5167 [ VM / Dart API ] Added additional methods required for Flutter background execution. fa19575a54 [vm/kernel/bytecode] Inline list of types into TypeArgumentsForInstanceAllocation constant pool entry c37bbcca7f Roll pub to the latest version. abc8793109 [VM interpreter] Adjust bytecode constant pool reading for inlined list of types in TypeArgumentsForInstanceAllocation entry. 8d3eb154e9 [vmservice] Report expression compilation errors b28ebca825 Begin reworking ResolutionStorer API to look more like the Factory class. f6871d2305 [vm/kernel/bytecode] Fix generation of InstantiateTypeArgumentsTOS bytecode 272848fe0f Convert ShadowWhileStatement to WhileJudgment. 5ccc497678 Inline constructor bodies that are called once 4df14626b3 Add parameters to Factory methods for constructor initializers dce00bc836 - fix a strong mode type error - mark a test as slow 83a4d98554 [vm] Weaken CAS to RMW when accessing the remembered and mark bits. e76fbee90f [VM interpreter] Provide arm64 stubs. Minor cleanups. a3dde1fad8 Convert ShadowSwitchStatement to SwitchStatementJudgment. e8323f578c Convert ShadowTryCatch to TryCatchJudgment. 6182b7215d [vm/kernel/bytecode] Fix passing of type arguments b343d0a80d trigger error for const A(B()) if B non-const 06a588233c Fix package_root_test.dart on mac buildbot. 8419090c8c Cleanup type variable event sequence 8da640704a [vm/linearscan] Reserve slots for catch block entry when nothing is spilled 80a8bfe657 Convert ShadowExpressionStatement to ExpressionStatementJudgment. 2f664c141f [vm] Shorten the write barrier sequence. b6aa31f7d8 Add required parameters to Factory.catchStatement 34bbb1da30 [Gardening] Move status line to the correct section. 68ecf31fc5 Update CHANGELOG.md with text for the default switching to Dart 2.0. e15b6a1cd7 Add parameters to Factory API, part 2 85c27d78c1 [Gardening] Removed incorrect entry in the status file. 2edbfd95a7 Convert ShadowVariableDeclaration to VariableDeclarationJudgment. 075027b130 Added super_no_such_method5_test also to the issue list for 33517 254d8ef153 Switch ShadowYieldStatement to YieldJudgment. 64fd6653cf Update deprecated references. 13fb4da312 Convert ShadowIfStatement to IfJudgment. 71042d3dfa linter 0.1.54 e9f994892d Cleanup unescape error messages 7b68a4516f Wrap Let with ShadowSyntheticExpression in wrapInLocatedCompileTimeError(). 7d9ac9dca5 Add a --use-fasta-parse flag to test.py; add a 'analyzer-use-fasta-parser' buildbot configuration. 591cf85c76 Re-enable the old analyzer/FE integration logic. 9bd3350f1f Convert ShadowContinueSwitchStatement to ContinueSwitchJudgment. 92f353fe29 Convert ShadowReturnStatement to ReturnJudgment. 462d2a35d3 Convert shadow nodes for 'is' and 'is!' into inference judgments a3a8d8bbd5 [VM][kernel] Don't mix in noSuchMethod forwarders 6612278b71 Skip non-utf8 file tests on reload builders, where they time out 125fae6d56 Incorporate comments from an earlier code review 188c858a4c [gardening] Fix standalone/app_snapshot_share_test 1c4b362ba5 Support noSuchMethod forwarders in dart2js 276598199e Make DDK interpret IntLiteral.value as uint64 a049e340eb Revert the fix for issue #31770 d4a69bde98 app_snapshot_share_test now runs only in dartk and dartkp mode. 75f485d6d9 [dart2js] Fix for issue 33500 828df76c85 Notify kernel service of isolate shutdown. a36fbd1990 Skip app_snapshot_share test in precompiled dart1 mode as the test spawns a dart process which runs in Dart2 mode and hence needs a kernel file generation step to run. This test now makes sense only in dartk and dartkp modes. 6dfa10d33d Generate the kernel buffers using bin_to_assembly rule instead of dill_to_cc. This should fix the clang tool errors we are seeing. 8da46d35f5 [vm] Move heap-related code to its own subdirectory (cf. compiler). 2f3c983e0a Convert ShadowStaticGet to StaticGetJudgment acd375cc77 [gardening] Silence flaky test which times out on simarm64 bot 3becdb8afd Convert property gets to judgments. 9db4b71442 Convert ShadowIntLiteral to IntJudgment 37084e677c Convert ShadowDoubleLiteral to DoubleJudgment d84d3f8e42 Convert ShadowNullLiteral to NullJudgment. 3a2a84db9c Improve misplaced factory/modifier recovery 3586fcb165 Cleanup deprecated code eac395c33d Add parameters needed by analyzer to Factory, part 1 edcd3be290 Update aot_assembly rule to temporarily use --no-preview-dart-2 until it is updated to call gen_kernel to produce a kernel file before creating the AOT snapshot. 3d96683a88 Convert ShadowDoStatement to DoJudgment. 8e8fb38c48 Convert ShadowBlock to BlockJudgment. b71fb2e086 Convert ShadowBreakStatement to BreakJudgment and ContinueJudgment. c96f23243b Enable Dart2 in dart2js by default 6b96e65c5b Convert ShadowArguments to ArgumentsJudgment. 437b492042 [gardening] Update status for reload-kernel bots a3a1113cfd Convert ShadowConditionalExpression to ConditionalJudgment. 5b2871ae88 Ensure that constructor invocation file offset is set correctly for annotations. bedbdf6a49 Add a Type parameter to Factory and update one method 119236996a [build] Remove tools/compile_platform.py ddde9820a9 Improve fasta parser parameter list recovery f5a0e3efa8 Create NamedExpressionJudgment. 165c57ffd7 Attempt to fix the windows bot 3 bb1fcebd36 [dart:io] Expose Crypto::GetRandomBytes in embedded_dart_io.h 23f87d54c6 [vm/kernel/bytecode] Implement strong mode type checks in bytecode 1e7d39504f Convert ShadowLabeledStatement to LabeledStatementJudgment. d895b49134 Support asset directories in flutter pubspec validation. 015d9eff49 Use ShadowEmptyStatement instead of EmptyStatement in blocks. 029ff9361f Track which import is referenced by each prefix. 92c24a1ee7 Skip sample_extension_app_snapshot_test on opt-counter-threshold builders 33d41a928a [VM] Fix incorrect memory allocation f3960a0111 Fix language_2/vm/optimized_guarded_field_isolates_test e496efb611 [VM] Adjust status file after 6db5f38d4ee4d ef49436487 [fasta] Update expectation files after noSuchMethod forwarders change 049195b15d Fix path to entry points json file in app_snapshot_share_test b024432a29 [VM] Disable test in reload/rollback mode due to snapshot generation 6db5f38d4e [fasta] Don't generate noSuchMethod forwarders in abstract classes 7979232580 Re-added header, only needed to remove the other resource section. a38b9bed23 Restore dart2js-checked and dart-aot in try_benchmarks.sh. 7be47cd30d Remove some dead code (including implicit setters) 1c01aa7704 Convert some ShadowExpressions into inference judgments 6e6bdb486a Ensure we run app_snapshot_share_test d7e5332057 Make dual use of a part in the same program an error. 856c7c67ea Skip standalone_2 on !strong configurations (for JIT / AOT VM) ba024be044 Mark dart2js specific argument as deprecated. 20fe2f0ada Indent error pointer correctly in the presence of tabs. bd94de8e48 Use dynamic to fix string_interpolate_test b172a42881 [VM] Catch errors for integer operations in kernel2kernel constant evaluator f288124d5a Fix InvalidInlineFunctionType example 15821a28a3 Explicit type args in body_builder 1f6925718b Add message for missing type arguments 87e045c484 Remove the helper dart script from our browser test framework 532b9aaa93 Flatten *WorldBuilder hierarchies. f1d44e39fa Update status for passing Windows Firefox co19 tests efb4f69a13 Adjust simarm status. 1a443da6ad Adjust options passed to precompile runtime. f8caffd9e6 Remove some uses of Platform.packageRoot. ebe2f1db2c Adjust status files. 6fcc95d2a4 Adjust status files. f2f6ebf547 Convert ShadowAssertInitializer to AssertInitializerJudgment. ea837c91a0 Transition tests to EvaluateCompiledExpression. 3e6e2dd7f4 Convert ShadowAssertStatement to AssertStatementJudgment. 27fefd7bb3 Convert ShadowAwaitExpression to AwaitExpressionJudgment. dd1c54c442 Convert ShadowBoolLiteral to BoolLiteralJudgement 4a353fea35 Another attempt to fix tests on Windows a69d922794 Adjust some of the test expectations based on the flip to Dart 2 mode. b3b8ca6dc4 Remove the --package-default-analysis-options flag. 9943547d5d Default pub to Dart 2 with opt out aba94f051e Convert ShadowAsExpression to AsJudgment. bc7220a4fd [VM] Turn dart2 on by default on the command line VM cdd2553a12 [vm/kernel/bytecode] Fix null handling in operator == df2bf6590d [VM runtime] Minor cleanup of stubs on all architectures as already done for x64 b140baeb55 Own files by their URIs during search. 56cee22800 Build out the initial version of the Factory class (and derived classes). 83cb0c425d Fix awaiting void in analyzer ast_test.dart. Fix at method decl. c9af309cbf Fix fasta parsing of ?. in cascade expression 67695b9842 Fix the dependencies on the dartdevk_sdk build step. 0a59b2ff90 Fix test cases that await "void." Blocks #33415, making that an error 3ba3e2a752 Revert "switch to dart_action until prebuilt Windows Dart VM is updated" 741ed336f1 Improve AstBuilder int literal recovery e77158eb38 First steps toward generating analyzer/kernel ASTs during type inference. f1c3f997bd [VM] Clear out return-value-register from call-to-runtime-stub, it needs to be GC-safe for lazy deopts 686fd133a7 [VM interpreter] Propagate unhandled exception returned from jitted code to interpreter. 8fedfc7f8c Removed DomName, DosEditable, and experimental annoations they are unused. 7d94755836 Issue 33471. Use full ResolveResult in Extract Local refactoring. 57c0fc9593 [vm/corelib] More cleanup in integer operations after _Bigint is removed 88d12fda42 Parse throw on RHS of an assignment 1dcc3264e7 Fix tests that are failing on Windows 691313f357 Move newOptionsFile() and newPackagesFile() into ResourceProviderMixin. e62f563b2d Validate sdkPath in AnalysisContextCollectionImpl. 493c421f0d Add AnalysisContextCollection. ``` * Roll dart sdk to 4552beb514c5b54fbe9c5a0791f7b95253ac09b9. Changes since last roll: ``` 4552beb514 Revert "[vm/kernel-service] Report an error if isolate compilation options change." f304948807 [vm] Refactoring: extract kernel translation helpers to a separate file 5a47f4c9fa Apply resolution for ParameterElement metadata. db7b5072af Reenable FutureOr resynthesis tests with kernel. 1f8148f862 [infra] Restore sync-async behavior to fix legacy precompiler bots d9911b8a8a Add language_2 test status entries for -cdart2analyzer --use-cfe b0b1020588 [fasta] Add more tests for noSuchMethod forwarders 90e27b19ea Check for conflicts between a static setter and a constructor or static method. b0cbc4e9cd Fix a bug in top-level type inference dependency tracking 29924c4000 In observatory use ArgumentError instead of FallThroughError bd9aa5139a Error on cyclic constructor redirect. 1a6c857a93 Remove ExpressionGenerator.buildThrowNoSuchMethodError c53746fc8a Add lexeme2 template key 2f739fd7d9 Default implementation of _makeRead and _makeWrite 36b22c7ae9 Remove unused files 583a81ade3 [infra] Make test.py's --strong option a no-op to prepare for removing it 17b53a2835 Test out no_implicit_casts on the analyzer source base. 2ee635977d Revert separation of getOutline() and getResolution() in FrontEndCompiler. fc472e03da Don't store resolution for desugaring generated NotJudgment. e0845f9359 [vm/kernel-service] Report an error if isolate compilation options change. cc30bda2be In resynthesis tests, do not attempt to distinguish missing bound from Object. a1bd1dd6ee Use standard I/O posix functions for Fuchsia, not 64 bit variants 6f284b45f7 Fixes for applying resolution to InstanceCreationExpression. 1eacd27b8e [VM runtime] Type bounds do not need to be checked during type finalization in strong mode, since bound checks are explicitly emitted where needed. 5db9e6c95e [VM interpreter] Do not load bytecode of synthesized functions with copied metadata. Fix return of native call to bytecode function. Fix stack level when returning from static field initializer. Use a zone handle for handled exception types. bcacff49ba Ignore deferredCheck() in resolution storer. 423edf86be Fix analyzer/FE integration of local generic functions with bounds. 0e7e0c945a [vm/kernel/bytecode] Generate argument checks after allocating initial context 3fd61646ce Fix analyzer/FE integration of redirected constructors involving type arguments. d03210cdf4 Fix storage of types for local functions that are generic. 4426f5a33e [gardening] Mark large_class_declaration_test Slow in debug, dart1 85253708a3 [build] Include kernel-service snapshot in the platform sdk f0bc620143 Validate location in store(). b4a426fa72 [dart:io] Adds HttpClient.connectionTimeout cb4a19b5fc misc(pkg/analyzer): update to latest pkg:matcher API d2bde00d9d Cleanup skipFormalParameters and remove unused methods 56cb7bac02 Fix for applying resolution to static field annotations. 723bcbd5f9 Added link to see webdev.dartlang.org b9dbe3a0be Fix analyzer/FE integration for `is!` expressions. bef0eca2e3 [gardening] Update status after a7f0f7ea899fe7812f54eea8f957a92153e3176e f5e8cc3517 Remove old code with incorrect instantiation to bounds on typedefs edf26852e6 linter 0.1.55 544358304d [VM] - Add --preview-dart-2 option back as a nop - Temporarily treat --checked as an alias for --enable-asserts in Dart2 mode so that google3 test scripts don't need to change. e7da604c11 More updates for -DuseFastaParser. efa4b21c4f [fuchsia] Update zx_cprng_draw a7f0f7ea89 [vm] Add source positions to stack traces of bool checks 70087c349b Fixes for applying resolution to annotations. 21b077a81c Fix incorrect handling of non-generic typedefs. 37d9e79b1b Update co19 and co19 strong branch in DEPS 7d1642e081 [gardening] Mark large_class_declaration_test Slow. dce6663028 Add message to assert to explain the problem b20dc7b98a Update the script to re-gen the analysis server spec. 29c549bfe2 [vm/kernel] Use old space in a specific Kernel FE error allocation. e13b9e8a75 [fasta] Update expectation files after cf2966ea 46167dfd88 It is OK to declare a const constructor in a class with a mixin, if it has no fields. 88a88b03dc Fix token used for large negative integers. b43dc893eb Remove spec references to Symbol constructor. cf2966ea0d [fasta] Generate noSuchMethod forwarders for abstract accessors 28ed0d743d Make it explicit that "dynamic" is exported from dart:core. ce312b9632 Add --analyzer-use-fasta and --analyzer-use-fasta-parser to test.py 25286e4a7d Add tests for optimization of Flutters use of Widget.runtimeType df2529d443 Detect when a class has a member that conflicts with a static one 50fe42a886 Reduce use of putIfAbsent 385cde3977 Resolve 'dynamic' element references. 70576f431e Roll https://github.com/dart-lang/pub/pull/1938 into the SDK. 46710a77dd Make checked flag again only enable assertions in Dart 2.0 e0905b979a Revert "Add ClassHierarchy to share code between J/KClosedWorld" 9179db84df Resynthesize typedef types properly from kernel. c53952a46d [vm/kernel/bytecode] Generate bytecode for assertions, bool checks a6c2c97d7e Rename ResynthesizeKernelStrongTest to ResynthesizeTest_Kernel cad8d4a741 Store instance creation information at arguments offset. a4c7cf388f First stab at a parsing library for named configurations. 008aa729c5 [VM interpreter] Support implicit getters and setters without compiling them. 54bc1548b0 [fuchsia] Update to Sync2Ptr 05b19947a4 Prep for analyzer 0.32.2 a1efbd326f Change FrontEndCompiler.getOutline() to return full kernels. 966541bec9 Improve literal function recovery 386efb1e6a Improve type parameter recovery 5c9add2c46 Allow Future to be assigned to Future 9c7cd04e7f [ VM / Testing ] Disabled non_utf8_* tests for FileSystemEntity classes 5c9e9a6661 [gardening] Update status file 5a193752f6 Clean up some hints e67c5953e9 Relax return restrictions. a9c624a010 [infra] Update checked in SDKs to 2.0.0-dev.65.0 12971f37a9 Update dart_style package to 1.1.0 in DEPS f67308a983 Handle invalid dill files more gracefully 9aa0c4ae3f [release] Prepare changelog for 2.0.0-dev.65.0 9a8b5f3bc2 Update app_jitk service status a16ad6d9de [infra] Make update_homebrew script work on Dart2 014a5bc678 Replace strstr with strncmp looking for path separator d2d47acdce [kernel] Include urls even when we have no source 5f17b0a0be Convert ShadowMapLiteral to MapLiteralJudgment 2c98fb3c1d Add tests showing the async impact on function type checks 8e4d5c0a38 Update formated error for nonexisting constructor a8e930caf3 Add ClassHierarchy to share code between J/KClosedWorld c9bd4df214 Document IntLiteral.value as holding a uint64 value 56d57407e1 Fix status for new test ed20faa2ed Add test for rejecting inexact numbers 31ed467871 Fix directory-prefix finding logic so it works on Windows. 2d6eaba187 pkg:build_integration: clarify that' it's not planned to be published f67cba1067 [vm] Introduce kernel_multiroot options to support multiroot compilation mode in kernel service. 2876bd08fb Doc - Fix OSError.message and errorCode doc c97f177112 Issue 33518. Fix for subtypes() in parts without library. e661c9ef54 Simplify 'as T' for simple T 65a3c4443b [observatory] Update packages and remove dead dependencies. b15572933d Update checked-in Dart SDK to 2.0.0-dev.64.1 9d3533ff72 snapshot the kernel worker in dart 2 mode and fix some dart 2 errors b29bde6232 Convert ShadowSyntheticExpression to SyntheticExpressionJudgment 2876623654 Check function types in the correct order in runZoned. 6d25212302 getStats Future should be strongly typed. ca99917fb6 Remove code awaiting void results to unblock #33145 19f60bfb52 Improve fasta parser expression recovery d632980ee0 Add tokens to more judgements 5721d8af6d - Fixed querySelectoryAll generic syntax to assert if types in list aren't of the same type T. - Fixes requestFullscreen to call operation webkitRequestFullscreen not requestFullscreen its only available when RuntimeEnabled=FullscreenUnprefixed. 3640037164 Fix second half on #33343: disallow generic functions as type arguments. 97c81d668a Remove variableSet factory methods. 98efc7917f Improve parse assert statement recovery a93e303f3f [vm/kernel/bytecode] Bytecode generation for rarely used operations a0ba81bfe7 Convert ShadowCascadeExpression to CascadeJudgment. de4d8b6cae Convert ShadowSymbolLiteral to SymbolLiteralJudgment 13c3560fc6 Count analyzer cfe integration failing tests. 77f94ec259 Convert ShadowLogicalExpression to LogicalJudgment 1a0fc733d3 Add tokens to more judgements 81191186d8 Remove unused class 284b5cce55 Partial fix of #33343. Reject generic function types as bounds. ada8188b73 Update pkg/pkg.status with the latest -DuseFastaParser status. e232ddd28c [VM] Handle [VariableGet]s for parameters/let variables differently than other const variables 5d4dbdac5c Adjust stringContentTDQ, stringContentTSQ to allow escapes. b27b62e182 [fasta] Update .expect files for non-simple bound tests aeff1c00f2 [vm/compiler] Improve CallTargets::CreateAndExpand 2ff5f8cfcb [VM] Report an error when accessing constructor parameters inside a constructor invocation 2f474a55c1 Change infer to return the expression instead of its type b9f11311f8 [vm/compiler] Fix incorrect assertion from 20ca5bbb056. f85fbde727 Expression compilation fix 6240dd5cc3 Make incremental_load_from_dill_test dart2 compliant 8747da838f Bump kernel version after e2ce88d 20ca5bbb05 [vm/jit] Introduce dynamic invocation forwarders that perform type checking f9a11ec380 [gardening] Mark language_2/const_constructor_nonconst_param_test/01 failing in dartkp 212a817322 Check whether variables is set before using GN not_needed f381778867 Update the status of analysis server tests. 8b10b1fda9 Add tokens to judgements, part 2 8c1591af9e Add a binder mechanism to the Factory API for handling labels. e132240c91 Re-enable some failing analyzer_cli --use-cfe tests. f598e6933c Drop support for Dart 1 in pub 9146cea63a Print times in seconds ec0df457a2 Convert invocation Shadow(s) to Judgment(s). 223b143167 Workaround for issue 33559. 091f8860c2 [ dart:io / tests ] Fixed issue where non_utf8* tests attempted to delete the current working directory which is not allowed on Windows. 9276b27acd Add unittest for InferenceData 70ac1f90ec Revert "Update checked-in Dart SDK to 2.0.0-dev.64.1" c270576dd4 Use FunctionNodeJudgment in FunctionExpressionJudgment. aeba82ef9a [dart2js] Fix for issue 33572 1416ed283a Convert ShadowNot to NotJudgment. a1a2d90a6c Convert ShadowForStatement to ForJudgment. 7c6211b1d8 Make unittests work with Dart 2 a8d805055a Handle covariant parameters in function types b24170259c Don't add parts without 'part of' as libraries. fea8cb1473 Revise order of type variable declaration events 6339976567 Rename lemma to binder 9d499fffe4 Start adding tokens to judgements ff7a1255aa Convert ShadowFunctionDeclaration to FunctionDeclarationJudgment, add FunctionNodeJudgment. 5bfb70ec5b Docs - Update example websockets app; use idiomatic async/await in examples ed0ba901e1 Doc - Fix library links in analyzer docs 4c697085be dart2js: Make bazel-input-provider dart2 compliant. 9b814bdf34 Use the lemma approach for NamedFunctionExpression 7c0d31092d Rename variableLemma and variableType to clarify that they refer to the loop variable. b36f353f76 Update dartdoc to 0.20.1. eafa9ae4b6 [vm/kernel] Fix StreamingConstantEvaluator to handle non-const variables 3e2708eada [VM interpreter] Fix broken interpreter build. 94abf948c4 pkg:status_file misc cleanup 02721709c3 Fix a committed solo test and mark it as passing now. c8a488c1ca Add parameters to Forest method to support labeled statements c4d6ac0cbe [vm/compiler/aot] Implement non-speculative int64 shift operation 3af363cba0 Rename typeContext to inferredType 10dcad1dd2 pkg:kernel - cleanup pubspec file 7e7fd7ffa5 Convert ShadowLiteralList into LiteralListJudgment 4fe71ec275 [fasta] Report instantiate-to-bound failure due to non-simple bounds 121fed2840 Convert ShadowDeferredCheck to DeferredCheckJudgment e2c54e9af5 Fix cascade specification. d08317b79f Make status file linter valid Dart 2 code f4d2bf313e Convert ShadowFunctionExpression to FunctionExpressionJudgment 6888bc2824 Compile time error for web int literals that cannot be represented exactly 075c713a93 Register type arguments on inlining 4ebdb31646 Separate getOutline() and getResolution() in FrontEndCompiler. 6a7bf90c42 Convert ShadowRethrow to RethrowJudgment 7661841cc5 Convert ShadowNamedFunctionExpression to NamedFunctionExpressionJudgment 6fd40725af Convert ShadowIfNullExpression to IfNullJudgment 7c327c32b7 [frontend-server] Fix starter so it works in '--incremental' mode f885a0c8f3 [vm/kernel] Fix crash when reading symbol literal from Dart annotation 16c0c0ff07 Convert ShadowStringConcatenation to StringConcatenationJudgment d0655066a5 Use the lemma approach for other variable declaring constructs. 2121c3bb56 Docs - Link to the Random.secure constructor in dartdoc 975686d5a9 [syscalls] Use vmar..._old apis. Modify existing calls to vmar routines in preparation for changing the parameter order. 7d7e7c268e [vm] Work around interaction between type and instance canonicalization in isolate messages. fa7c38dec5 [vm, standalone] Do not copy when loading kernel. 8d7c5294c6 Rename the kernel ShadowExpressions for assignments 47f394d61c Update checked-in Dart SDK to 2.0.0-dev.64.1 efd36d4cdf Updated non_utf8_* tests to better cleanup after themselves. Fixes issue d1e1af84e7 DEPS: update crypto version 530f1f6512 [build] Possible fix for 'Error while initializing Kernel isolate' e9bc3352e0 Replace and remove parseType 1b681a75c3 Modify Factory API to allow forward references to incomplete local functions and variables. f682213764 Add parameters to Factory methods to support the try statement cf6fbd9e07 Add parameters to Factory methods to support the switch statement b50ff4990a Add parameters to Factory methods for list and map literals c5855635ae Add Factory method parameters for for loops c2a22c6462 Updates to ddc/ddb tool 1a1ff9e666 Reverse the pub snapshot names d5d5daf411 Fixed cascade_test failure due to return type of operator []= being non-void. 69c807c636 Fix docs for async File methods 569341cbe0 Improve CompressionOptions docs: 8d40afc9c0 Convert ShadowTryFinally to TryFinallyJudgment. 4a9abfcacb Convert ShadowForInStatement to ForInJudgment. f2eaf6aae7 Remove type parameters from the Fasta BodyBuilder 74dd5440f1 Convert ShadowStringLiteral into StringLiteralJudgment 10641cbf42 Update status files after 52b2a869bcb93 ee19f2804a Make ResolutionStorer implement the Factory API. e2ce88dfcc Add startFileOffset on procedures et al, enable VMs GetSource 52b2a869bc Update some noSuchMethod based tests to the currently desired behavior. bf4f9a9163 Update testing scripts to run on a Dart 2 VM 8638668ecf [VM] Fix vm->native state transition in isolate_reload.cc 71ac67aed1 [kernel] Recognize noSuchMethod forwarders in class hierarchy analysis 216e8dfe85 Stop using !kernel annotations 3e85df5167 [ VM / Dart API ] Added additional methods required for Flutter background execution. fa19575a54 [vm/kernel/bytecode] Inline list of types into TypeArgumentsForInstanceAllocation constant pool entry c37bbcca7f Roll pub to the latest version. abc8793109 [VM interpreter] Adjust bytecode constant pool reading for inlined list of types in TypeArgumentsForInstanceAllocation entry. 8d3eb154e9 [vmservice] Report expression compilation errors b28ebca825 Begin reworking ResolutionStorer API to look more like the Factory class. f6871d2305 [vm/kernel/bytecode] Fix generation of InstantiateTypeArgumentsTOS bytecode 272848fe0f Convert ShadowWhileStatement to WhileJudgment. 5ccc497678 Inline constructor bodies that are called once 4df14626b3 Add parameters to Factory methods for constructor initializers dce00bc836 - fix a strong mode type error - mark a test as slow 83a4d98554 [vm] Weaken CAS to RMW when accessing the remembered and mark bits. e76fbee90f [VM interpreter] Provide arm64 stubs. Minor cleanups. a3dde1fad8 Convert ShadowSwitchStatement to SwitchStatementJudgment. e8323f578c Convert ShadowTryCatch to TryCatchJudgment. 6182b7215d [vm/kernel/bytecode] Fix passing of type arguments b343d0a80d trigger error for const A(B()) if B non-const 06a588233c Fix package_root_test.dart on mac buildbot. 8419090c8c Cleanup type variable event sequence 8da640704a [vm/linearscan] Reserve slots for catch block entry when nothing is spilled 80a8bfe657 Convert ShadowExpressionStatement to ExpressionStatementJudgment. 2f664c141f [vm] Shorten the write barrier sequence. b6aa31f7d8 Add required parameters to Factory.catchStatement 34bbb1da30 [Gardening] Move status line to the correct section. 68ecf31fc5 Update CHANGELOG.md with text for the default switching to Dart 2.0. e15b6a1cd7 Add parameters to Factory API, part 2 85c27d78c1 [Gardening] Removed incorrect entry in the status file. 2edbfd95a7 Convert ShadowVariableDeclaration to VariableDeclarationJudgment. 075027b130 Added super_no_such_method5_test also to the issue list for 33517 254d8ef153 Switch ShadowYieldStatement to YieldJudgment. 64fd6653cf Update deprecated references. 13fb4da312 Convert ShadowIfStatement to IfJudgment. 71042d3dfa linter 0.1.54 e9f994892d Cleanup unescape error messages 7b68a4516f Wrap Let with ShadowSyntheticExpression in wrapInLocatedCompileTimeError(). 7d9ac9dca5 Add a --use-fasta-parse flag to test.py; add a 'analyzer-use-fasta-parser' buildbot configuration. 591cf85c76 Re-enable the old analyzer/FE integration logic. 9bd3350f1f Convert ShadowContinueSwitchStatement to ContinueSwitchJudgment. 92f353fe29 Convert ShadowReturnStatement to ReturnJudgment. 462d2a35d3 Convert shadow nodes for 'is' and 'is!' into inference judgments a3a8d8bbd5 [VM][kernel] Don't mix in noSuchMethod forwarders 6612278b71 Skip non-utf8 file tests on reload builders, where they time out 125fae6d56 Incorporate comments from an earlier code review 188c858a4c [gardening] Fix standalone/app_snapshot_share_test 1c4b362ba5 Support noSuchMethod forwarders in dart2js 276598199e Make DDK interpret IntLiteral.value as uint64 a049e340eb Revert the fix for issue #31770 d4a69bde98 app_snapshot_share_test now runs only in dartk and dartkp mode. 75f485d6d9 [dart2js] Fix for issue 33500 828df76c85 Notify kernel service of isolate shutdown. a36fbd1990 Skip app_snapshot_share test in precompiled dart1 mode as the test spawns a dart process which runs in Dart2 mode and hence needs a kernel file generation step to run. This test now makes sense only in dartk and dartkp modes. 6dfa10d33d Generate the kernel buffers using bin_to_assembly rule instead of dill_to_cc. This should fix the clang tool errors we are seeing. 8da46d35f5 [vm] Move heap-related code to its own subdirectory (cf. compiler). 2f3c983e0a Convert ShadowStaticGet to StaticGetJudgment acd375cc77 [gardening] Silence flaky test which times out on simarm64 bot 3becdb8afd Convert property gets to judgments. 9db4b71442 Convert ShadowIntLiteral to IntJudgment 37084e677c Convert ShadowDoubleLiteral to DoubleJudgment d84d3f8e42 Convert ShadowNullLiteral to NullJudgment. 3a2a84db9c Improve misplaced factory/modifier recovery 3586fcb165 Cleanup deprecated code eac395c33d Add parameters needed by analyzer to Factory, part 1 edcd3be290 Update aot_assembly rule to temporarily use --no-preview-dart-2 until it is updated to call gen_kernel to produce a kernel file before creating the AOT snapshot. 3d96683a88 Convert ShadowDoStatement to DoJudgment. 8e8fb38c48 Convert ShadowBlock to BlockJudgment. b71fb2e086 Convert ShadowBreakStatement to BreakJudgment and ContinueJudgment. c96f23243b Enable Dart2 in dart2js by default 6b96e65c5b Convert ShadowArguments to ArgumentsJudgment. 437b492042 [gardening] Update status for reload-kernel bots a3a1113cfd Convert ShadowConditionalExpression to ConditionalJudgment. 5b2871ae88 Ensure that constructor invocation file offset is set correctly for annotations. bedbdf6a49 Add a Type parameter to Factory and update one method 119236996a [build] Remove tools/compile_platform.py ddde9820a9 Improve fasta parser parameter list recovery f5a0e3efa8 Create NamedExpressionJudgment. 165c57ffd7 Attempt to fix the windows bot 3 bb1fcebd36 [dart:io] Expose Crypto::GetRandomBytes in embedded_dart_io.h 23f87d54c6 [vm/kernel/bytecode] Implement strong mode type checks in bytecode 1e7d39504f Convert ShadowLabeledStatement to LabeledStatementJudgment. d895b49134 Support asset directories in flutter pubspec validation. 015d9eff49 Use ShadowEmptyStatement instead of EmptyStatement in blocks. 029ff9361f Track which import is referenced by each prefix. 92c24a1ee7 Skip sample_extension_app_snapshot_test on opt-counter-threshold builders 33d41a928a [VM] Fix incorrect memory allocation f3960a0111 Fix language_2/vm/optimized_guarded_field_isolates_test e496efb611 [VM] Adjust status file after 6db5f38d4ee4d ef49436487 [fasta] Update expectation files after noSuchMethod forwarders change 049195b15d Fix path to entry points json file in app_snapshot_share_test b024432a29 [VM] Disable test in reload/rollback mode due to snapshot generation 6db5f38d4e [fasta] Don't generate noSuchMethod forwarders in abstract classes 7979232580 Re-added header, only needed to remove the other resource section. a38b9bed23 Restore dart2js-checked and dart-aot in try_benchmarks.sh. 7be47cd30d Remove some dead code (including implicit setters) 1c01aa7704 Convert some ShadowExpressions into inference judgments 6e6bdb486a Ensure we run app_snapshot_share_test d7e5332057 Make dual use of a part in the same program an error. 856c7c67ea Skip standalone_2 on !strong configurations (for JIT / AOT VM) ba024be044 Mark dart2js specific argument as deprecated. 20fe2f0ada Indent error pointer correctly in the presence of tabs. bd94de8e48 Use dynamic to fix string_interpolate_test b172a42881 [VM] Catch errors for integer operations in kernel2kernel constant evaluator f288124d5a Fix InvalidInlineFunctionType example 15821a28a3 Explicit type args in body_builder 1f6925718b Add message for missing type arguments 87e045c484 Remove the helper dart script from our browser test framework 532b9aaa93 Flatten *WorldBuilder hierarchies. f1d44e39fa Update status for passing Windows Firefox co19 tests efb4f69a13 Adjust simarm status. 1a443da6ad Adjust options passed to precompile runtime. f8caffd9e6 Remove some uses of Platform.packageRoot. ebe2f1db2c Adjust status files. 6fcc95d2a4 Adjust status files. f2f6ebf547 Convert ShadowAssertInitializer to AssertInitializerJudgment. ea837c91a0 Transition tests to EvaluateCompiledExpression. 3e6e2dd7f4 Convert ShadowAssertStatement to AssertStatementJudgment. 27fefd7bb3 Convert ShadowAwaitExpression to AwaitExpressionJudgment. dd1c54c442 Convert ShadowBoolLiteral to BoolLiteralJudgement 4a353fea35 Another attempt to fix tests on Windows a69d922794 Adjust some of the test expectations based on the flip to Dart 2 mode. b3b8ca6dc4 Remove the --package-default-analysis-options flag. 9943547d5d Default pub to Dart 2 with opt out aba94f051e Convert ShadowAsExpression to AsJudgment. bc7220a4fd [VM] Turn dart2 on by default on the command line VM cdd2553a12 [vm/kernel/bytecode] Fix null handling in operator == df2bf6590d [VM runtime] Minor cleanup of stubs on all architectures as already done for x64 b140baeb55 Own files by their URIs during search. 56cee22800 Build out the initial version of the Factory class (and derived classes). 83cb0c425d Fix awaiting void in analyzer ast_test.dart. Fix at method decl. c9af309cbf Fix fasta parsing of ?. in cascade expression 67695b9842 Fix the dependencies on the dartdevk_sdk build step. 0a59b2ff90 Fix test cases that await "void." Blocks #33415, making that an error 3ba3e2a752 Revert "switch to dart_action until prebuilt Windows Dart VM is updated" 741ed336f1 Improve AstBuilder int literal recovery e77158eb38 First steps toward generating analyzer/kernel ASTs during type inference. f1c3f997bd [VM] Clear out return-value-register from call-to-runtime-stub, it needs to be GC-safe for lazy deopts 686fd133a7 [VM interpreter] Propagate unhandled exception returned from jitted code to interpreter. 8fedfc7f8c Removed DomName, DosEditable, and experimental annoations they are unused. 7d94755836 Issue 33471. Use full ResolveResult in Extract Local refactoring. 57c0fc9593 [vm/corelib] More cleanup in integer operations after _Bigint is removed 88d12fda42 Parse throw on RHS of an assignment 1dcc3264e7 Fix tests that are failing on Windows 691313f357 Move newOptionsFile() and newPackagesFile() into ResourceProviderMixin. e62f563b2d Validate sdkPath in AnalysisContextCollectionImpl. 493c421f0d Add AnalysisContextCollection. ``` * Roll dart sdk to 4552beb514c5b54fbe9c5a0791f7b95253ac09b9. Changes since last roll: ``` 4552beb514 Revert "[vm/kernel-service] Report an error if isolate compilation options change." f304948807 [vm] Refactoring: extract kernel translation helpers to a separate file 5a47f4c9fa Apply resolution for ParameterElement metadata. db7b5072af Reenable FutureOr resynthesis tests with kernel. 1f8148f862 [infra] Restore sync-async behavior to fix legacy precompiler bots d9911b8a8a Add language_2 test status entries for -cdart2analyzer --use-cfe b0b1020588 [fasta] Add more tests for noSuchMethod forwarders 90e27b19ea Check for conflicts between a static setter and a constructor or static method. b0cbc4e9cd Fix a bug in top-level type inference dependency tracking 29924c4000 In observatory use ArgumentError instead of FallThroughError bd9aa5139a Error on cyclic constructor redirect. 1a6c857a93 Remove ExpressionGenerator.buildThrowNoSuchMethodError c53746fc8a Add lexeme2 template key 2f739fd7d9 Default implementation of _makeRead and _makeWrite 36b22c7ae9 Remove unused files 583a81ade3 [infra] Make test.py's --strong option a no-op to prepare for removing it 17b53a2835 Test out no_implicit_casts on the analyzer source base. 2ee635977d Revert separation of getOutline() and getResolution() in FrontEndCompiler. fc472e03da Don't store resolution for desugaring generated NotJudgment. e0845f9359 [vm/kernel-service] Report an error if isolate compilation options change. cc30bda2be In resynthesis tests, do not attempt to distinguish missing bound from Object. a1bd1dd6ee Use standard I/O posix functions for Fuchsia, not 64 bit variants 6f284b45f7 Fixes for applying resolution to InstanceCreationExpression. 1eacd27b8e [VM runtime] Type bounds do not need to be checked during type finalization in strong mode, since bound checks are explicitly emitted where needed. 5db9e6c95e [VM interpreter] Do not load bytecode of synthesized functions with copied metadata. Fix return of native call to bytecode function. Fix stack level when returning from static field initializer. Use a zone handle for handled exception types. bcacff49ba Ignore deferredCheck() in resolution storer. 423edf86be Fix analyzer/FE integration of local generic functions with bounds. 0e7e0c945a [vm/kernel/bytecode] Generate argument checks after allocating initial context 3fd61646ce Fix analyzer/FE integration of redirected constructors involving type arguments. d03210cdf4 Fix storage of types for local functions that are generic. 4426f5a33e [gardening] Mark large_class_declaration_test Slow in debug, dart1 85253708a3 [build] Include kernel-service snapshot in the platform sdk f0bc620143 Validate location in store(). b4a426fa72 [dart:io] Adds HttpClient.connectionTimeout cb4a19b5fc misc(pkg/analyzer): update to latest pkg:matcher API d2bde00d9d Cleanup skipFormalParameters and remove unused methods 56cb7bac02 Fix for applying resolution to static field annotations. 723bcbd5f9 Added link to see webdev.dartlang.org b9dbe3a0be Fix analyzer/FE integration for `is!` expressions. bef0eca2e3 [gardening] Update status after a7f0f7ea899fe7812f54eea8f957a92153e3176e f5e8cc3517 Remove old code with incorrect instantiation to bounds on typedefs edf26852e6 linter 0.1.55 544358304d [VM] - Add --preview-dart-2 option back as a nop - Temporarily treat --checked as an alias for --enable-asserts in Dart2 mode so that google3 test scripts don't need to change. e7da604c11 More updates for -DuseFastaParser. efa4b21c4f [fuchsia] Update zx_cprng_draw a7f0f7ea89 [vm] Add source positions to stack traces of bool checks 70087c349b Fixes for applying resolution to annotations. 21b077a81c Fix incorrect handling of non-generic typedefs. 37d9e79b1b Update co19 and co19 strong branch in DEPS 7d1642e081 [gardening] Mark large_class_declaration_test Slow. dce6663028 Add message to assert to explain the problem b20dc7b98a Update the script to re-gen the analysis server spec. 29c549bfe2 [vm/kernel] Use old space in a specific Kernel FE error allocation. e13b9e8a75 [fasta] Update expectation files after cf2966ea 46167dfd88 It is OK to declare a const constructor in a class with a mixin, if it has no fields. 88a88b03dc Fix token used for large negative integers. b43dc893eb Remove spec references to Symbol constructor. cf2966ea0d [fasta] Generate noSuchMethod forwarders for abstract accessors 28ed0d743d Make it explicit that "dynamic" is exported from dart:core. ce312b9632 Add --analyzer-use-fasta and --analyzer-use-fasta-parser to test.py 25286e4a7d Add tests for optimization of Flutters use of Widget.runtimeType df2529d443 Detect when a class has a member that conflicts with a static one 50fe42a886 Reduce use of putIfAbsent 385cde3977 Resolve 'dynamic' element references. 70576f431e Roll https://github.com/dart-lang/pub/pull/1938 into the SDK. 46710a77dd Make checked flag again only enable assertions in Dart 2.0 e0905b979a Revert "Add ClassHierarchy to share code between J/KClosedWorld" 9179db84df Resynthesize typedef types properly from kernel. c53952a46d [vm/kernel/bytecode] Generate bytecode for assertions, bool checks a6c2c97d7e Rename ResynthesizeKernelStrongTest to ResynthesizeTest_Kernel cad8d4a741 Store instance creation information at arguments offset. a4c7cf388f First stab at a parsing library for named configurations. 008aa729c5 [VM interpreter] Support implicit getters and setters without compiling them. 54bc1548b0 [fuchsia] Update to Sync2Ptr 05b19947a4 Prep for analyzer 0.32.2 a1efbd326f Change FrontEndCompiler.getOutline() to return full kernels. 966541bec9 Improve literal function recovery 386efb1e6a Improve type parameter recovery 5c9add2c46 Allow Future to be assigned to Future 9c7cd04e7f [ VM / Testing ] Disabled non_utf8_* tests for FileSystemEntity classes 5c9e9a6661 [gardening] Update status file 5a193752f6 Clean up some hints e67c5953e9 Relax return restrictions. a9c624a010 [infra] Update checked in SDKs to 2.0.0-dev.65.0 12971f37a9 Update dart_style package to 1.1.0 in DEPS f67308a983 Handle invalid dill files more gracefully 9aa0c4ae3f [release] Prepare changelog for 2.0.0-dev.65.0 9a8b5f3bc2 Update app_jitk service status a16ad6d9de [infra] Make update_homebrew script work on Dart2 014a5bc678 Replace strstr with strncmp looking for path separator d2d47acdce [kernel] Include urls even when we have no source 5f17b0a0be Convert ShadowMapLiteral to MapLiteralJudgment 2c98fb3c1d Add tests showing the async impact on function type checks 8e4d5c0a38 Update formated error for nonexisting constructor a8e930caf3 Add ClassHierarchy to share code between J/KClosedWorld c9bd4df214 Document IntLiteral.value as holding a uint64 value 56d57407e1 Fix status for new test ed20faa2ed Add test for rejecting inexact numbers 31ed467871 Fix directory-prefix finding logic so it works on Windows. 2d6eaba187 pkg:build_integration: clarify that' it's not planned to be published f67cba1067 [vm] Introduce kernel_multiroot options to support multiroot compilation mode in kernel service. 2876bd08fb Doc - Fix OSError.message and errorCode doc c97f177112 Issue 33518. Fix for subtypes() in parts without library. e661c9ef54 Simplify 'as T' for simple T 65a3c4443b [observatory] Update packages and remove dead dependencies. b15572933d Update checked-in Dart SDK to 2.0.0-dev.64.1 9d3533ff72 snapshot the kernel worker in dart 2 mode and fix some dart 2 errors b29bde6232 Convert ShadowSyntheticExpression to SyntheticExpressionJudgment 2876623654 Check function types in the correct order in runZoned. 6d25212302 getStats Future should be strongly typed. ca99917fb6 Remove code awaiting void results to unblock #33145 19f60bfb52 Improve fasta parser expression recovery d632980ee0 Add tokens to more judgements 5721d8af6d - Fixed querySelectoryAll generic syntax to assert if types in list aren't of the same type T. - Fixes requestFullscreen to call operation webkitRequestFullscreen not requestFullscreen its only available when RuntimeEnabled=FullscreenUnprefixed. 3640037164 Fix second half on #33343: disallow generic functions as type arguments. 97c81d668a Remove variableSet factory methods. 98efc7917f Improve parse assert statement recovery a93e303f3f [vm/kernel/bytecode] Bytecode generation for rarely used operations a0ba81bfe7 Convert ShadowCascadeExpression to CascadeJudgment. de4d8b6cae Convert ShadowSymbolLiteral to SymbolLiteralJudgment 13c3560fc6 Count analyzer cfe integration failing tests. 77f94ec259 Convert ShadowLogicalExpression to LogicalJudgment 1a0fc733d3 Add tokens to more judgements 81191186d8 Remove unused class 284b5cce55 Partial fix of #33343. Reject generic function types as bounds. ada8188b73 Update pkg/pkg.status with the latest -DuseFastaParser status. e232ddd28c [VM] Handle [VariableGet]s for parameters/let variables differently than other const variables 5d4dbdac5c Adjust stringContentTDQ, stringContentTSQ to allow escapes. b27b62e182 [fasta] Update .expect files for non-simple bound tests aeff1c00f2 [vm/compiler] Improve CallTargets::CreateAndExpand 2ff5f8cfcb [VM] Report an error when accessing constructor parameters inside a constructor invocation 2f474a55c1 Change infer to return the expression instead of its type b9f11311f8 [vm/compiler] Fix incorrect assertion from 20ca5bbb056. f85fbde727 Expression compilation fix 6240dd5cc3 Make incremental_load_from_dill_test dart2 compliant 8747da838f Bump kernel version after e2ce88d 20ca5bbb05 [vm/jit] Introduce dynamic invocation forwarders that perform type checking f9a11ec380 [gardening] Mark language_2/const_constructor_nonconst_param_test/01 failing in dartkp 212a817322 Check whether variables is set before using GN not_needed f381778867 Update the status of analysis server tests. 8b10b1fda9 Add tokens to judgements, part 2 8c1591af9e Add a binder mechanism to the Factory API for handling labels. e132240c91 Re-enable some failing analyzer_cli --use-cfe tests. f598e6933c Drop support for Dart 1 in pub 9146cea63a Print times in seconds ec0df457a2 Convert invocation Shadow(s) to Judgment(s). 223b143167 Workaround for issue 33559. 091f8860c2 [ dart:io / tests ] Fixed issue where non_utf8* tests attempted to delete the current working directory which is not allowed on Windows. 9276b27acd Add unittest for InferenceData 70ac1f90ec Revert "Update checked-in Dart SDK to 2.0.0-dev.64.1" c270576dd4 Use FunctionNodeJudgment in FunctionExpressionJudgment. aeba82ef9a [dart2js] Fix for issue 33572 1416ed283a Convert ShadowNot to NotJudgment. a1a2d90a6c Convert ShadowForStatement to ForJudgment. 7c6211b1d8 Make unittests work with Dart 2 a8d805055a Handle covariant parameters in function types b24170259c Don't add parts without 'part of' as libraries. fea8cb1473 Revise order of type variable declaration events 6339976567 Rename lemma to binder 9d499fffe4 Start adding tokens to judgements ff7a1255aa Convert ShadowFunctionDeclaration to FunctionDeclarationJudgment, add FunctionNodeJudgment. 5bfb70ec5b Docs - Update example websockets app; use idiomatic async/await in examples ed0ba901e1 Doc - Fix library links in analyzer docs 4c697085be dart2js: Make bazel-input-provider dart2 compliant. 9b814bdf34 Use the lemma approach for NamedFunctionExpression 7c0d31092d Rename variableLemma and variableType to clarify that they refer to the loop variable. b36f353f76 Update dartdoc to 0.20.1. eafa9ae4b6 [vm/kernel] Fix StreamingConstantEvaluator to handle non-const variables 3e2708eada [VM interpreter] Fix broken interpreter build. 94abf948c4 pkg:status_file misc cleanup 02721709c3 Fix a committed solo test and mark it as passing now. c8a488c1ca Add parameters to Forest method to support labeled statements c4d6ac0cbe [vm/compiler/aot] Implement non-speculative int64 shift operation 3af363cba0 Rename typeContext to inferredType 10dcad1dd2 pkg:kernel - cleanup pubspec file 7e7fd7ffa5 Convert ShadowLiteralList into LiteralListJudgment 4fe71ec275 [fasta] Report instantiate-to-bound failure due to non-simple bounds 121fed2840 Convert ShadowDeferredCheck to DeferredCheckJudgment e2c54e9af5 Fix cascade specification. d08317b79f Make status file linter valid Dart 2 code f4d2bf313e Convert ShadowFunctionExpression to FunctionExpressionJudgment 6888bc2824 Compile time error for web int literals that cannot be represented exactly 075c713a93 Register type arguments on inlining 4ebdb31646 Separate getOutline() and getResolution() in FrontEndCompiler. 6a7bf90c42 Convert ShadowRethrow to RethrowJudgment 7661841cc5 Convert ShadowNamedFunctionExpression to NamedFunctionExpressionJudgment 6fd40725af Convert ShadowIfNullExpression to IfNullJudgment 7c327c32b7 [frontend-server] Fix starter so it works in '--incremental' mode f885a0c8f3 [vm/kernel] Fix crash when reading symbol literal from Dart annotation 16c0c0ff07 Convert ShadowStringConcatenation to StringConcatenationJudgment d0655066a5 Use the lemma approach for other variable declaring constructs. 2121c3bb56 Docs - Link to the Random.secure constructor in dartdoc 975686d5a9 [syscalls] Use vmar..._old apis. Modify existing calls to vmar routines in preparation for changing the parameter order. 7d7e7c268e [vm] Work around interaction between type and instance canonicalization in isolate messages. fa7c38dec5 [vm, standalone] Do not copy when loading kernel. 8d7c5294c6 Rename the kernel ShadowExpressions for assignments 47f394d61c Update checked-in Dart SDK to 2.0.0-dev.64.1 efd36d4cdf Updated non_utf8_* tests to better cleanup after themselves. Fixes issue d1e1af84e7 DEPS: update crypto version 530f1f6512 [build] Possible fix for 'Error while initializing Kernel isolate' e9bc3352e0 Replace and remove parseType 1b681a75c3 Modify Factory API to allow forward references to incomplete local functions and variables. f682213764 Add parameters to Factory methods to support the try statement cf6fbd9e07 Add parameters to Factory methods to support the switch statement b50ff4990a Add parameters to Factory methods for list and map literals c5855635ae Add Factory method parameters for for loops c2a22c6462 Updates to ddc/ddb tool 1a1ff9e666 Reverse the pub snapshot names d5d5daf411 Fixed cascade_test failure due to return type of operator []= being non-void. 69c807c636 Fix docs for async File methods 569341cbe0 Improve CompressionOptions docs: 8d40afc9c0 Convert ShadowTryFinally to TryFinallyJudgment. 4a9abfcacb Convert ShadowForInStatement to ForInJudgment. f2eaf6aae7 Remove type parameters from the Fasta BodyBuilder 74dd5440f1 Convert ShadowStringLiteral into StringLiteralJudgment 10641cbf42 Update status files after 52b2a869bcb93 ee19f2804a Make ResolutionStorer implement the Factory API. e2ce88dfcc Add startFileOffset on procedures et al, enable VMs GetSource 52b2a869bc Update some noSuchMethod based tests to the currently desired behavior. bf4f9a9163 Update testing scripts to run on a Dart 2 VM 8638668ecf [VM] Fix vm->native state transition in isolate_reload.cc 71ac67aed1 [kernel] Recognize noSuchMethod forwarders in class hierarchy analysis 216e8dfe85 Stop using !kernel annotations 3e85df5167 [ VM / Dart API ] Added additional methods required for Flutter background execution. fa19575a54 [vm/kernel/bytecode] Inline list of types into TypeArgumentsForInstanceAllocation constant pool entry c37bbcca7f Roll pub to the latest version. abc8793109 [VM interpreter] Adjust bytecode constant pool reading for inlined list of types in TypeArgumentsForInstanceAllocation entry. 8d3eb154e9 [vmservice] Report expression compilation errors b28ebca825 Begin reworking ResolutionStorer API to look more like the Factory class. f6871d2305 [vm/kernel/bytecode] Fix generation of InstantiateTypeArgumentsTOS bytecode 272848fe0f Convert ShadowWhileStatement to WhileJudgment. 5ccc497678 Inline constructor bodies that are called once 4df14626b3 Add parameters to Factory methods for constructor initializers dce00bc836 - fix a strong mode type error - mark a test as slow 83a4d98554 [vm] Weaken CAS to RMW when accessing the remembered and mark bits. e76fbee90f [VM interpreter] Provide arm64 stubs. Minor cleanups. a3dde1fad8 Convert ShadowSwitchStatement to SwitchStatementJudgment. e8323f578c Convert ShadowTryCatch to TryCatchJudgment. 6182b7215d [vm/kernel/bytecode] Fix passing of type arguments b343d0a80d trigger error for const A(B()) if B non-const 06a588233c Fix package_root_test.dart on mac buildbot. 8419090c8c Cleanup type variable event sequence 8da640704a [vm/linearscan] Reserve slots for catch block entry when nothing is spilled 80a8bfe657 Convert ShadowExpressionStatement to ExpressionStatementJudgment. 2f664c141f [vm] Shorten the write barrier sequence. b6aa31f7d8 Add required parameters to Factory.catchStatement 34bbb1da30 [Gardening] Move status line to the correct section. 68ecf31fc5 Update CHANGELOG.md with text for the default switching to Dart 2.0. e15b6a1cd7 Add parameters to Factory API, part 2 85c27d78c1 [Gardening] Removed incorrect entry in the status file. 2edbfd95a7 Convert ShadowVariableDeclaration to VariableDeclarationJudgment. 075027b130 Added super_no_such_method5_test also to the issue list for 33517 254d8ef153 Switch ShadowYieldStatement to YieldJudgment. 64fd6653cf Update deprecated references. 13fb4da312 Convert ShadowIfStatement to IfJudgment. 71042d3dfa linter 0.1.54 e9f994892d Cleanup unescape error messages 7b68a4516f Wrap Let with ShadowSyntheticExpression in wrapInLocatedCompileTimeError(). 7d9ac9dca5 Add a --use-fasta-parse flag to test.py; add a 'analyzer-use-fasta-parser' buildbot configuration. 591cf85c76 Re-enable the old analyzer/FE integration logic. 9bd3350f1f Convert ShadowContinueSwitchStatement to ContinueSwitchJudgment. 92f353fe29 Convert ShadowReturnStatement to ReturnJudgment. 462d2a35d3 Convert shadow nodes for 'is' and 'is!' into inference judgments a3a8d8bbd5 [VM][kernel] Don't mix in noSuchMethod forwarders 6612278b71 Skip non-utf8 file tests on reload builders, where they time out 125fae6d56 Incorporate comments from an earlier code review 188c858a4c [gardening] Fix standalone/app_snapshot_share_test 1c4b362ba5 Support noSuchMethod forwarders in dart2js 276598199e Make DDK interpret IntLiteral.value as uint64 a049e340eb Revert the fix for issue #31770 d4a69bde98 app_snapshot_share_test now runs only in dartk and dartkp mode. 75f485d6d9 [dart2js] Fix for issue 33500 828df76c85 Notify kernel service of isolate shutdown. a36fbd1990 Skip app_snapshot_share test in precompiled dart1 mode as the test spawns a dart process which runs in Dart2 mode and hence needs a kernel file generation step to run. This test now makes sense only in dartk and dartkp modes. 6dfa10d33d Generate the kernel buffers using bin_to_assembly rule instead of dill_to_cc. This should fix the clang tool errors we are seeing. 8da46d35f5 [vm] Move heap-related code to its own subdirectory (cf. compiler). 2f3c983e0a Convert ShadowStaticGet to StaticGetJudgment acd375cc77 [gardening] Silence flaky test which times out on simarm64 bot 3becdb8afd Convert property gets to judgments. 9db4b71442 Convert ShadowIntLiteral to IntJudgment 37084e677c Convert ShadowDoubleLiteral to DoubleJudgment d84d3f8e42 Convert ShadowNullLiteral to NullJudgment. 3a2a84db9c Improve misplaced factory/modifier recovery 3586fcb165 Cleanup deprecated code eac395c33d Add parameters needed by analyzer to Factory, part 1 edcd3be290 Update aot_assembly rule to temporarily use --no-preview-dart-2 until it is updated to call gen_kernel to produce a kernel file before creating the AOT snapshot. 3d96683a88 Convert ShadowDoStatement to DoJudgment. 8e8fb38c48 Convert ShadowBlock to BlockJudgment. b71fb2e086 Convert ShadowBreakStatement to BreakJudgment and ContinueJudgment. c96f23243b Enable Dart2 in dart2js by default 6b96e65c5b Convert ShadowArguments to ArgumentsJudgment. 437b492042 [gardening] Update status for reload-kernel bots a3a1113cfd Convert ShadowConditionalExpression to ConditionalJudgment. 5b2871ae88 Ensure that constructor invocation file offset is set correctly for annotations. bedbdf6a49 Add a Type parameter to Factory and update one method 119236996a [build] Remove tools/compile_platform.py ddde9820a9 Improve fasta parser parameter list recovery f5a0e3efa8 Create NamedExpressionJudgment. 165c57ffd7 Attempt to fix the windows bot 3 bb1fcebd36 [dart:io] Expose Crypto::GetRandomBytes in embedded_dart_io.h 23f87d54c6 [vm/kernel/bytecode] Implement strong mode type checks in bytecode 1e7d39504f Convert ShadowLabeledStatement to LabeledStatementJudgment. d895b49134 Support asset directories in flutter pubspec validation. 015d9eff49 Use ShadowEmptyStatement instead of EmptyStatement in blocks. 029ff9361f Track which import is referenced by each prefix. 92c24a1ee7 Skip sample_extension_app_snapshot_test on opt-counter-threshold builders 33d41a928a [VM] Fix incorrect memory allocation f3960a0111 Fix language_2/vm/optimized_guarded_field_isolates_test e496efb611 [VM] Adjust status file after 6db5f38d4ee4d ef49436487 [fasta] Update expectation files after noSuchMethod forwarders change 049195b15d Fix path to entry points json file in app_snapshot_share_test b024432a29 [VM] Disable test in reload/rollback mode due to snapshot generation 6db5f38d4e [fasta] Don't generate noSuchMethod forwarders in abstract classes 7979232580 Re-added header, only needed to remove the other resource section. a38b9bed23 Restore dart2js-checked and dart-aot in try_benchmarks.sh. 7be47cd30d Remove some dead code (including implicit setters) 1c01aa7704 Convert some ShadowExpressions into inference judgments 6e6bdb486a Ensure we run app_snapshot_share_test d7e5332057 Make dual use of a part in the same program an error. 856c7c67ea Skip standalone_2 on !strong configurations (for JIT / AOT VM) ba024be044 Mark dart2js specific argument as deprecated. 20fe2f0ada Indent error pointer correctly in the presence of tabs. bd94de8e48 Use dynamic to fix string_interpolate_test b172a42881 [VM] Catch errors for integer operations in kernel2kernel constant evaluator f288124d5a Fix InvalidInlineFunctionType example 15821a28a3 Explicit type args in body_builder 1f6925718b Add message for missing type arguments 87e045c484 Remove the helper dart script from our browser test framework 532b9aaa93 Flatten *WorldBuilder hierarchies. f1d44e39fa Update status for passing Windows Firefox co19 tests efb4f69a13 Adjust simarm status. 1a443da6ad Adjust options passed to precompile runtime. f8caffd9e6 Remove some uses of Platform.packageRoot. ebe2f1db2c Adjust status files. 6fcc95d2a4 Adjust status files. f2f6ebf547 Convert ShadowAssertInitializer to AssertInitializerJudgment. ea837c91a0 Transition tests to EvaluateCompiledExpression. 3e6e2dd7f4 Convert ShadowAssertStatement to AssertStatementJudgment. 27fefd7bb3 Convert ShadowAwaitExpression to AwaitExpressionJudgment. dd1c54c442 Convert ShadowBoolLiteral to BoolLiteralJudgement 4a353fea35 Another attempt to fix tests on Windows a69d922794 Adjust some of the test expectations based on the flip to Dart 2 mode. b3b8ca6dc4 Remove the --package-default-analysis-options flag. 9943547d5d Default pub to Dart 2 with opt out aba94f051e Convert ShadowAsExpression to AsJudgment. bc7220a4fd [VM] Turn dart2 on by default on the command line VM cdd2553a12 [vm/kernel/bytecode] Fix null handling in operator == df2bf6590d [VM runtime] Minor cleanup of stubs on all architectures as already done for x64 b140baeb55 Own files by their URIs during search. 56cee22800 Build out the initial version of the Factory class (and derived classes). 83cb0c425d Fix awaiting void in analyzer ast_test.dart. Fix at method decl. c9af309cbf Fix fasta parsing of ?. in cascade expression 67695b9842 Fix the dependencies on the dartdevk_sdk build step. 0a59b2ff90 Fix test cases that await "void." Blocks #33415, making that an error 3ba3e2a752 Revert "switch to dart_action until prebuilt Windows Dart VM is updated" 741ed336f1 Improve AstBuilder int literal recovery e77158eb38 First steps toward generating analyzer/kernel ASTs during type inference. f1c3f997bd [VM] Clear out return-value-register from call-to-runtime-stub, it needs to be GC-safe for lazy deopts 686fd133a7 [VM interpreter] Propagate unhandled exception returned from jitted code to interpreter. 8fedfc7f8c Removed DomName, DosEditable, and experimental annoations they are unused. 7d94755836 Issue 33471. Use full ResolveResult in Extract Local refactoring. 57c0fc9593 [vm/corelib] More cleanup in integer operations after _Bigint is removed 88d12fda42 Parse throw on RHS of an assignment 1dcc3264e7 Fix tests that are failing on Windows 691313f357 Move newOptionsFile() and newPackagesFile() into ResourceProviderMixin. e62f563b2d Validate sdkPath in AnalysisContextCollectionImpl. 493c421f0d Add AnalysisContextCollection. ``` --- DEPS | 24 +- frontend_server/BUILD.gn | 1 + frontend_server/lib/server.dart | 2 +- sky/packages/sky_engine/LICENSE | 83 +- travis/licenses_golden/licenses_third_party | 2047 +++++++++---------- 5 files changed, 941 insertions(+), 1216 deletions(-) diff --git a/DEPS b/DEPS index a4e7f6c56709e..0624e72b1a657 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '4c9689c1d2da97d0aa25cf16cc90c2e463ad157f', + 'dart_revision': '64641d014b77bd410e9aa10558522ae26e4210ee', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', @@ -43,11 +43,11 @@ vars = { 'dart_cli_util_tag': '0.1.2+1', 'dart_collection_tag': '1.14.10', 'dart_convert_tag': '2.0.1', - 'dart_crypto_tag': '2.0.2+1', + 'dart_crypto_tag': '2.0.5', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+4', - 'dart_dart_style_tag': '1.0.14', - 'dart_dartdoc_tag': 'v0.20.0', + 'dart_dart_style_tag': '1.1.0', + 'dart_dartdoc_tag': 'v0.20.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', 'dart_html_tag': '0.13.3', @@ -58,24 +58,24 @@ vars = { 'dart_http_throttle_tag': '1.0.2', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.53', + 'dart_linter_tag': '0.1.56', 'dart_logging_tag': '0.11.3+1', 'dart_markdown_tag': '2.0.0', - 'dart_matcher_tag': '0.12.1+4', + 'dart_matcher_tag': '0.12.3', 'dart_mime_tag': '0.9.6', 'dart_mockito_tag': 'd39ac507483b9891165e422ec98d9fb480037c8b', 'dart_mustache4dart_tag': 'v2.1.2', 'dart_oauth2_tag': '1.1.0', - 'dart_observatory_pub_packages_rev': 'd3a3aebefbd35aa30fe7bbc2889b772b398f7d7f', + 'dart_observatory_pub_packages_rev': 'caf0aecfb15077fc7a34d48e9df13606c793fddf', 'dart_package_config_tag': '1.0.3', 'dart_package_resolver_tag': '1.0.2+1', 'dart_path_tag': '1.5.1', 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', 'dart_protobuf_tag': '0.7.1', - 'dart_pub_rev': '8b9526c915bf21627a20cd0104cb6c2be25a879f', + 'dart_pub_rev': '58fe996eab8d54f28f5109c407ff0ab62fbd835d', 'dart_pub_semver_tag': '1.4.1', - 'dart_quiver_tag': '5aaa3f58c48608af5b027444d561270b53f15dbf', + 'dart_quiver_tag': '0.29.0', 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', 'dart_shelf_packages_handler_tag': '1.0.3', @@ -89,10 +89,10 @@ vars = { 'dart_stream_channel_tag': '1.6.4', 'dart_string_scanner_tag': '1.0.2', 'dart_term_glyph_tag': '1.0.0', - 'dart_test_tag': '0.12.38', + 'dart_test_tag': '1.0.0', 'dart_tuple_tag': 'v1.0.1', 'dart_typed_data_tag': '1.1.3', - 'dart_usage_tag': '3.3.0', + 'dart_usage_tag': '3.4.0', 'dart_utf_tag': '0.9.0+4', 'dart_watcher_tag': '0.9.7+8', 'dart_web_socket_channel_tag': '1.0.7', @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '457c1f45560b35072fb13c1bbf2bbe96fd077474', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'fc7d5af92fe6f12b0622e4c3082d9bed8ad01c4b', # Fuchsia compatibility # diff --git a/frontend_server/BUILD.gn b/frontend_server/BUILD.gn index b792d2bce3fb0..07b04332926c3 100644 --- a/frontend_server/BUILD.gn +++ b/frontend_server/BUILD.gn @@ -5,6 +5,7 @@ import("//third_party/dart/utils/application_snapshot.gni") application_snapshot("frontend_server") { + dart_version = 2 main_dart = "bin/starter.dart" deps = [ "$flutter_root/lib/snapshot:kernel_platform_files", diff --git a/frontend_server/lib/server.dart b/frontend_server/lib/server.dart index f8cb0cc7d3eb0..913cd38395346 100644 --- a/frontend_server/lib/server.dart +++ b/frontend_server/lib/server.dart @@ -25,7 +25,7 @@ class _FlutterFrontendCompiler implements frontend.CompilerInterface{ transformer: trackWidgetCreation ? new WidgetCreatorTracker() : null); @override - Future compile(String filename, ArgResults options, {IncrementalCompiler generator}) async { + Future compile(String filename, ArgResults options, {IncrementalCompiler generator}) async { return _compiler.compile(filename, options, generator: generator); } diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 4c6f819c95b1e..612ebfe44b0f0 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -3157,7 +3157,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3186,7 +3186,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3215,7 +3215,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3244,7 +3244,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3273,7 +3273,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -3302,13 +3302,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -Copyright 2009 The Go 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 +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. -Copyright 2012, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -3334,11 +3330,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- dart -observatory_pub_packages -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. +Copyright 2009 The Go 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 +Copyright 2012, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -8374,32 +8373,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- observatory_pub_packages -Copyright (c) 2006-2012 The Authors - -Contributors: -James Graham - jg307@cam.ac.uk -Anne van Kesteren - annevankesteren@gmail.com -Lachlan Hunt - lachlan.hunt@lachy.id.au -Matt McDonald - kanashii@kanashii.ca -Sam Ruby - rubys@intertwingly.net -Ian Hickson (Google) - ian@hixie.ch -Thomas Broyer - t.broyer@ltgt.net -Jacques Distler - distler@golem.ph.utexas.edu -Henri Sivonen - hsivonen@iki.fi -Adam Barth - abarth@webkit.org -Eric Seidel - eric@webkit.org -The Mozilla Foundation (contributions from Henri Sivonen since 2008) -David Flanagan (Mozilla) - dflanagan@mozilla.com -Google Inc. (contributed the Dart port) - misc@dartlang.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -observatory_pub_packages - Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. @@ -8508,36 +8481,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- observatory_pub_packages -Copyright (c) 2014 Seth Ladd. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -observatory_pub_packages - Copyright (c) 2014, Michael Bostock and Google Inc. All rights reserved. diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 775e51f7173e3..caefaf4fe94da 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1d53e98f01ed69234c6cb276dfeeec61 +Signature: 650df7cae093ff5f8985d89194da8c02 UNUSED LICENSES: @@ -4470,153 +4470,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: dart -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/runtime/lib/class_id.cc + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/lib/class_id.cc -FILE: ../../../third_party/dart/runtime/lib/class_id.dart -FILE: ../../../third_party/dart/runtime/lib/convert_patch.dart -FILE: ../../../third_party/dart/runtime/lib/lib_prefix.dart -FILE: ../../../third_party/dart/runtime/lib/linked_hash_map.cc -FILE: ../../../third_party/dart/runtime/lib/profiler.cc -FILE: ../../../third_party/dart/runtime/lib/profiler.dart -FILE: ../../../third_party/dart/runtime/observatory/bin/shell.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/app.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_common.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_html.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/service_io.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart -FILE: ../../../third_party/dart/runtime/observatory/lib/utils.dart -FILE: ../../../third_party/dart/runtime/observatory/web/main.dart -FILE: ../../../third_party/dart/runtime/platform/address_sanitizer.h -FILE: ../../../third_party/dart/runtime/platform/math.h -FILE: ../../../third_party/dart/runtime/platform/memory_sanitizer.h -FILE: ../../../third_party/dart/runtime/platform/safe_stack.h -FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart -FILE: ../../../third_party/dart/runtime/vm/ast_transformer.cc -FILE: ../../../third_party/dart/runtime/vm/ast_transformer.h -FILE: ../../../third_party/dart/runtime/vm/bit_set_test.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h -FILE: ../../../third_party/dart/runtime/vm/constants_arm64.h -FILE: ../../../third_party/dart/runtime/vm/cpu_arm.h -FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.h -FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.h -FILE: ../../../third_party/dart/runtime/vm/cpu_x64.h -FILE: ../../../third_party/dart/runtime/vm/cpuid.cc -FILE: ../../../third_party/dart/runtime/vm/cpuid.h -FILE: ../../../third_party/dart/runtime/vm/cpuinfo.h -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_test.cc -FILE: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc -FILE: ../../../third_party/dart/runtime/vm/debugger_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/hash_table.h -FILE: ../../../third_party/dart/runtime/vm/hash_table_test.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.h -FILE: ../../../third_party/dart/runtime/vm/instructions_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/metrics.cc -FILE: ../../../third_party/dart/runtime/vm/metrics.h -FILE: ../../../third_party/dart/runtime/vm/metrics_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/object_graph.cc -FILE: ../../../third_party/dart/runtime/vm/object_graph.h -FILE: ../../../third_party/dart/runtime/vm/object_graph_test.cc -FILE: ../../../third_party/dart/runtime/vm/regexp.cc -FILE: ../../../third_party/dart/runtime/vm/regexp.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.h -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h -FILE: ../../../third_party/dart/runtime/vm/regexp_ast.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_ast.h -FILE: ../../../third_party/dart/runtime/vm/regexp_parser.cc -FILE: ../../../third_party/dart/runtime/vm/regexp_parser.h -FILE: ../../../third_party/dart/runtime/vm/regexp_test.cc -FILE: ../../../third_party/dart/runtime/vm/report.cc -FILE: ../../../third_party/dart/runtime/vm/report.h -FILE: ../../../third_party/dart/runtime/vm/ring_buffer.h -FILE: ../../../third_party/dart/runtime/vm/ring_buffer_test.cc -FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/scavenger_test.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.h -FILE: ../../../third_party/dart/runtime/vm/spaces.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64.cc -FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64_test.cc -FILE: ../../../third_party/dart/runtime/vm/tags.cc -FILE: ../../../third_party/dart/runtime/vm/unibrow-inl.h -FILE: ../../../third_party/dart/runtime/vm/unibrow.cc -FILE: ../../../third_party/dart/runtime/vm/unibrow.h -FILE: ../../../third_party/dart/runtime/vm/verified_memory_test.cc -FILE: ../../../third_party/dart/runtime/vm/weak_code.cc -FILE: ../../../third_party/dart/runtime/vm/weak_code.h -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart -FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart -FILE: ../../../third_party/dart/sdk/lib/collection/set.dart -FILE: ../../../third_party/dart/sdk/lib/core/sink.dart -FILE: ../../../third_party/dart/sdk/lib/developer/profiler.dart -FILE: ../../../third_party/dart/sdk/lib/io/process.dart -FILE: ../../../third_party/dart/sdk/lib/io/service_object.dart -FILE: ../../../third_party/dart/sdk/lib/isolate/capability.dart -FILE: ../../../third_party/dart/sdk/lib/profiler/profiler.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/css_class_set.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: dart ORIGIN: ../../../third_party/dart/LICENSE @@ -4626,28 +4479,59 @@ FILE: ../../../third_party/dart/.mailmap FILE: ../../../third_party/dart/client/idea/.idea/.name FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Default.xml FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml +FILE: ../../../third_party/dart/runtime/.idea/codeStyles/Project.xml +FILE: ../../../third_party/dart/runtime/.idea/misc.xml +FILE: ../../../third_party/dart/runtime/.idea/modules.xml +FILE: ../../../third_party/dart/runtime/.idea/runtime.iml +FILE: ../../../third_party/dart/runtime/.idea/workspace.xml FILE: ../../../third_party/dart/runtime/CPPLINT.cfg +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_C.bin +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_CXX.bin +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.c +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CompilerIdC/a.out +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CompilerIdCXX/a.out +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/Makefile2 +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/cmake.check_cache +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/feature_tests.bin +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/feature_tests.c +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/feature_tests.cxx +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/progress.marks +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/runtime.dir/build.make +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/runtime.dir/depend.make +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/runtime.dir/flags.make +FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/runtime.dir/progress.make +FILE: ../../../third_party/dart/runtime/cmake-build-debug/runtime.cbp FILE: ../../../third_party/dart/runtime/observatory/.analysis_options -FILE: ../../../third_party/dart/runtime/observatory/dart2js.packages +FILE: ../../../third_party/dart/runtime/observatory/.idea/libraries/Dart_SDK.xml +FILE: ../../../third_party/dart/runtime/observatory/.idea/modules.xml +FILE: ../../../third_party/dart/runtime/observatory/.idea/observatory.iml +FILE: ../../../third_party/dart/runtime/observatory/.idea/workspace.xml FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/isolate_icon.png -FILE: ../../../third_party/dart/runtime/observatory/maintainers/pubspec.template FILE: ../../../third_party/dart/runtime/observatory/web/favicon.ico FILE: ../../../third_party/dart/runtime/observatory/web/index.html FILE: ../../../third_party/dart/runtime/observatory/web/third_party/trace_viewer_full.html FILE: ../../../third_party/dart/runtime/observatory/web/timeline.html +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc.rej FILE: ../../../third_party/dart/runtime/vm/snapshot_test_in.dat FILE: ../../../third_party/dart/samples/build_dart/test.foo FILE: ../../../third_party/dart/samples/build_dart_simple/test.foo FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common.dart FILE: ../../../third_party/dart/sdk/lib/libraries.json +FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/libraries/Dart_SDK.xml +FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/misc.xml +FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/modules.xml +FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/vmservice.iml +FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/workspace.xml FILE: ../../../third_party/dart/sdk/lib/vmservice_libraries.json FILE: ../../../third_party/dart/third_party/7zip.tar.gz.sha1 FILE: ../../../third_party/dart/third_party/clang.tar.gz.sha1 FILE: ../../../third_party/dart/third_party/gsutil.tar.gz.sha1 +FILE: ../../../third_party/dart/vm_outline_strong.dill ---------------------------------------------------------------------------------------------------- Copyright 2012, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -4929,8 +4813,6 @@ FILE: ../../../third_party/dart/runtime/vm/flag_list.h FILE: ../../../third_party/dart/runtime/vm/flags.cc FILE: ../../../third_party/dart/runtime/vm/flags.h FILE: ../../../third_party/dart/runtime/vm/flags_test.cc -FILE: ../../../third_party/dart/runtime/vm/freelist.h -FILE: ../../../third_party/dart/runtime/vm/freelist_test.cc FILE: ../../../third_party/dart/runtime/vm/globals.h FILE: ../../../third_party/dart/runtime/vm/growable_array.h FILE: ../../../third_party/dart/runtime/vm/growable_array_test.cc @@ -4939,9 +4821,17 @@ FILE: ../../../third_party/dart/runtime/vm/handles_impl.h FILE: ../../../third_party/dart/runtime/vm/handles_test.cc FILE: ../../../third_party/dart/runtime/vm/hash_map.h FILE: ../../../third_party/dart/runtime/vm/hash_map_test.cc -FILE: ../../../third_party/dart/runtime/vm/heap.cc -FILE: ../../../third_party/dart/runtime/vm/heap.h -FILE: ../../../third_party/dart/runtime/vm/heap_test.cc +FILE: ../../../third_party/dart/runtime/vm/heap/freelist.h +FILE: ../../../third_party/dart/runtime/vm/heap/freelist_test.cc +FILE: ../../../third_party/dart/runtime/vm/heap/heap.cc +FILE: ../../../third_party/dart/runtime/vm/heap/heap.h +FILE: ../../../third_party/dart/runtime/vm/heap/heap_test.cc +FILE: ../../../third_party/dart/runtime/vm/heap/pages.cc +FILE: ../../../third_party/dart/runtime/vm/heap/pages_test.cc +FILE: ../../../third_party/dart/runtime/vm/heap/scavenger.h +FILE: ../../../third_party/dart/runtime/vm/heap/store_buffer.cc +FILE: ../../../third_party/dart/runtime/vm/heap/store_buffer.h +FILE: ../../../third_party/dart/runtime/vm/heap/verifier.cc FILE: ../../../third_party/dart/runtime/vm/instructions_ia32.cc FILE: ../../../third_party/dart/runtime/vm/instructions_ia32.h FILE: ../../../third_party/dart/runtime/vm/instructions_ia32_test.cc @@ -4961,7 +4851,9 @@ FILE: ../../../third_party/dart/runtime/vm/native_arguments.h FILE: ../../../third_party/dart/runtime/vm/native_message_handler.cc FILE: ../../../third_party/dart/runtime/vm/native_message_handler.h FILE: ../../../third_party/dart/runtime/vm/object.cc +FILE: ../../../third_party/dart/runtime/vm/object.cc.orig FILE: ../../../third_party/dart/runtime/vm/object.h +FILE: ../../../third_party/dart/runtime/vm/object.h.orig FILE: ../../../third_party/dart/runtime/vm/object_arm_test.cc FILE: ../../../third_party/dart/runtime/vm/object_ia32_test.cc FILE: ../../../third_party/dart/runtime/vm/object_set.h @@ -4981,8 +4873,6 @@ FILE: ../../../third_party/dart/runtime/vm/os_thread_macos.h FILE: ../../../third_party/dart/runtime/vm/os_thread_win.cc FILE: ../../../third_party/dart/runtime/vm/os_thread_win.h FILE: ../../../third_party/dart/runtime/vm/os_win.cc -FILE: ../../../third_party/dart/runtime/vm/pages.cc -FILE: ../../../third_party/dart/runtime/vm/pages_test.cc FILE: ../../../third_party/dart/runtime/vm/parser.cc FILE: ../../../third_party/dart/runtime/vm/parser.h FILE: ../../../third_party/dart/runtime/vm/port.cc @@ -4995,7 +4885,6 @@ FILE: ../../../third_party/dart/runtime/vm/raw_object_snapshot.cc FILE: ../../../third_party/dart/runtime/vm/resolver_test.cc FILE: ../../../third_party/dart/runtime/vm/scanner.cc FILE: ../../../third_party/dart/runtime/vm/scanner_test.cc -FILE: ../../../third_party/dart/runtime/vm/scavenger.h FILE: ../../../third_party/dart/runtime/vm/scopes.cc FILE: ../../../third_party/dart/runtime/vm/scopes.h FILE: ../../../third_party/dart/runtime/vm/scopes_test.cc @@ -5006,8 +4895,6 @@ FILE: ../../../third_party/dart/runtime/vm/snapshot_test.cc FILE: ../../../third_party/dart/runtime/vm/snapshot_test.dart FILE: ../../../third_party/dart/runtime/vm/stack_frame.cc FILE: ../../../third_party/dart/runtime/vm/stack_frame_test.cc -FILE: ../../../third_party/dart/runtime/vm/store_buffer.cc -FILE: ../../../third_party/dart/runtime/vm/store_buffer.h FILE: ../../../third_party/dart/runtime/vm/stub_code.cc FILE: ../../../third_party/dart/runtime/vm/symbols.cc FILE: ../../../third_party/dart/runtime/vm/symbols.h @@ -5020,7 +4907,6 @@ FILE: ../../../third_party/dart/runtime/vm/unicode.cc FILE: ../../../third_party/dart/runtime/vm/unicode.h FILE: ../../../third_party/dart/runtime/vm/unit_test.cc FILE: ../../../third_party/dart/runtime/vm/utils_test.cc -FILE: ../../../third_party/dart/runtime/vm/verifier.cc FILE: ../../../third_party/dart/runtime/vm/version.h FILE: ../../../third_party/dart/runtime/vm/version_in.cc FILE: ../../../third_party/dart/runtime/vm/virtual_memory.cc @@ -5094,6 +4980,7 @@ FILE: ../../../third_party/dart/sdk/lib/core/string.dart FILE: ../../../third_party/dart/sdk/lib/core/type.dart FILE: ../../../third_party/dart/sdk/lib/core/uri.dart FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/html/dart2js/html_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/html/dartium/nativewrappers.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/css_class_set.dart @@ -5118,6 +5005,8 @@ FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/svg/dart2js/svg_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart @@ -5131,6 +5020,7 @@ FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart +FILE: ../../../third_party/dart/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. @@ -5259,9 +5149,9 @@ FILE: ../../../third_party/dart/runtime/vm/dwarf.cc FILE: ../../../third_party/dart/runtime/vm/dwarf.h FILE: ../../../third_party/dart/runtime/vm/fixed_cache.h FILE: ../../../third_party/dart/runtime/vm/fixed_cache_test.cc -FILE: ../../../third_party/dart/runtime/vm/gc_compactor.cc -FILE: ../../../third_party/dart/runtime/vm/gc_compactor.h FILE: ../../../third_party/dart/runtime/vm/gdb_helpers.cc +FILE: ../../../third_party/dart/runtime/vm/heap/compactor.cc +FILE: ../../../third_party/dart/runtime/vm/heap/compactor.h FILE: ../../../third_party/dart/runtime/vm/image_snapshot.cc FILE: ../../../third_party/dart/runtime/vm/image_snapshot.h FILE: ../../../third_party/dart/runtime/vm/json_writer.cc @@ -5546,8 +5436,6 @@ FILE: ../../../third_party/dart/runtime/observatory/web/timeline_message_handler FILE: ../../../third_party/dart/runtime/platform/atomic_fuchsia.h FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.cc FILE: ../../../third_party/dart/runtime/platform/utils_fuchsia.h -FILE: ../../../third_party/dart/runtime/vm/become.cc -FILE: ../../../third_party/dart/runtime/vm/become.h FILE: ../../../third_party/dart/runtime/vm/clustered_snapshot.cc FILE: ../../../third_party/dart/runtime/vm/clustered_snapshot.h FILE: ../../../third_party/dart/runtime/vm/code_patcher_dbc.cc @@ -5563,6 +5451,7 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_eliminati FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder_test.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc.orig FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.h FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_dbc.cc @@ -5572,6 +5461,10 @@ FILE: ../../../third_party/dart/runtime/vm/cpu_dbc.h FILE: ../../../third_party/dart/runtime/vm/cpuinfo_fuchsia.cc FILE: ../../../third_party/dart/runtime/vm/dart_api_state.cc FILE: ../../../third_party/dart/runtime/vm/debugger_dbc.cc +FILE: ../../../third_party/dart/runtime/vm/heap/become.cc +FILE: ../../../third_party/dart/runtime/vm/heap/become.h +FILE: ../../../third_party/dart/runtime/vm/heap/safepoint.cc +FILE: ../../../third_party/dart/runtime/vm/heap/safepoint.h FILE: ../../../third_party/dart/runtime/vm/instructions_dbc.cc FILE: ../../../third_party/dart/runtime/vm/instructions_dbc.h FILE: ../../../third_party/dart/runtime/vm/isolate_reload.cc @@ -5593,8 +5486,6 @@ FILE: ../../../third_party/dart/runtime/vm/os_fuchsia.cc FILE: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.cc FILE: ../../../third_party/dart/runtime/vm/os_thread_fuchsia.h FILE: ../../../third_party/dart/runtime/vm/runtime_entry_dbc.cc -FILE: ../../../third_party/dart/runtime/vm/safepoint.cc -FILE: ../../../third_party/dart/runtime/vm/safepoint.h FILE: ../../../third_party/dart/runtime/vm/signal_handler_fuchsia.cc FILE: ../../../third_party/dart/runtime/vm/simulator_dbc.cc FILE: ../../../third_party/dart/runtime/vm/simulator_dbc.h @@ -5679,12 +5570,15 @@ FILE: ../../../third_party/dart/runtime/vm/double_conversion.cc FILE: ../../../third_party/dart/runtime/vm/double_conversion.h FILE: ../../../third_party/dart/runtime/vm/exceptions.cc FILE: ../../../third_party/dart/runtime/vm/exceptions.h -FILE: ../../../third_party/dart/runtime/vm/freelist.cc -FILE: ../../../third_party/dart/runtime/vm/gc_marker.cc -FILE: ../../../third_party/dart/runtime/vm/gc_marker.h -FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.cc -FILE: ../../../third_party/dart/runtime/vm/gc_sweeper.h FILE: ../../../third_party/dart/runtime/vm/handles.h +FILE: ../../../third_party/dart/runtime/vm/heap/freelist.cc +FILE: ../../../third_party/dart/runtime/vm/heap/marker.cc +FILE: ../../../third_party/dart/runtime/vm/heap/marker.h +FILE: ../../../third_party/dart/runtime/vm/heap/pages.h +FILE: ../../../third_party/dart/runtime/vm/heap/scavenger.cc +FILE: ../../../third_party/dart/runtime/vm/heap/sweeper.cc +FILE: ../../../third_party/dart/runtime/vm/heap/sweeper.h +FILE: ../../../third_party/dart/runtime/vm/heap/verifier.h FILE: ../../../third_party/dart/runtime/vm/longjump.cc FILE: ../../../third_party/dart/runtime/vm/longjump.h FILE: ../../../third_party/dart/runtime/vm/longjump_test.cc @@ -5699,7 +5593,6 @@ FILE: ../../../third_party/dart/runtime/vm/native_entry_test.cc FILE: ../../../third_party/dart/runtime/vm/native_entry_test.h FILE: ../../../third_party/dart/runtime/vm/object_store_test.cc FILE: ../../../third_party/dart/runtime/vm/os.h -FILE: ../../../third_party/dart/runtime/vm/pages.h FILE: ../../../third_party/dart/runtime/vm/parser_test.cc FILE: ../../../third_party/dart/runtime/vm/port.h FILE: ../../../third_party/dart/runtime/vm/resolver.cc @@ -5711,7 +5604,6 @@ FILE: ../../../third_party/dart/runtime/vm/runtime_entry_ia32.cc FILE: ../../../third_party/dart/runtime/vm/runtime_entry_list.h FILE: ../../../third_party/dart/runtime/vm/runtime_entry_x64.cc FILE: ../../../third_party/dart/runtime/vm/scanner.h -FILE: ../../../third_party/dart/runtime/vm/scavenger.cc FILE: ../../../third_party/dart/runtime/vm/stack_frame.h FILE: ../../../third_party/dart/runtime/vm/stub_code.h FILE: ../../../third_party/dart/runtime/vm/stub_code_ia32_test.cc @@ -5722,7 +5614,6 @@ FILE: ../../../third_party/dart/runtime/vm/token.cc FILE: ../../../third_party/dart/runtime/vm/unicode_data.cc FILE: ../../../third_party/dart/runtime/vm/unicode_test.cc FILE: ../../../third_party/dart/runtime/vm/unit_test.h -FILE: ../../../third_party/dart/runtime/vm/verifier.h FILE: ../../../third_party/dart/runtime/vm/visitor.h FILE: ../../../third_party/dart/sdk/lib/collection/queue.dart FILE: ../../../third_party/dart/sdk/lib/core/comparable.dart @@ -5785,6 +5676,8 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.h FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h @@ -6119,6 +6012,8 @@ FILE: ../../../third_party/dart/runtime/vm/deferred_objects.h FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.cc FILE: ../../../third_party/dart/runtime/vm/deopt_instructions.h FILE: ../../../third_party/dart/runtime/vm/guard_field_test.cc +FILE: ../../../third_party/dart/runtime/vm/heap/weak_table.cc +FILE: ../../../third_party/dart/runtime/vm/heap/weak_table.h FILE: ../../../third_party/dart/runtime/vm/instructions.h FILE: ../../../third_party/dart/runtime/vm/instructions_arm.cc FILE: ../../../third_party/dart/runtime/vm/instructions_arm.h @@ -6170,8 +6065,6 @@ FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_android.cc FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_linux.cc FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_macos.cc FILE: ../../../third_party/dart/runtime/vm/thread_interrupter_win.cc -FILE: ../../../third_party/dart/runtime/vm/weak_table.cc -FILE: ../../../third_party/dart/runtime/vm/weak_table.h FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/_chrome/dart2js/chrome_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/_http/http.dart @@ -6329,115 +6222,260 @@ license that can be found in the LICENSE file ==================================================================================================== ==================================================================================================== -LIBRARY: double-conversion -ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum-dtoa.cc -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum-dtoa.cc -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum-dtoa.h -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum.cc -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum.h -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/cached-powers.h -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/diy-fp.cc -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/diy-fp.h -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/double-conversion.cc -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/fast-dtoa.h -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/fixed-dtoa.cc -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/fixed-dtoa.h -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/strtod.cc -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/strtod.h -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/utils.h ----------------------------------------------------------------------------------------------------- -Copyright 2010 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: double-conversion -ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/src/cached-powers.cc -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/cached-powers.cc ----------------------------------------------------------------------------------------------------- -Copyright 2006-2008 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: double-conversion -ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/src/double-conversion.h +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/lib/class_id.cc + ../../../third_party/dart/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/double-conversion.h -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/fast-dtoa.cc -FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/ieee.h ----------------------------------------------------------------------------------------------------- -Copyright 2012 the V8 project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +FILE: ../../../third_party/dart/runtime/lib/class_id.cc +FILE: ../../../third_party/dart/runtime/lib/class_id.dart +FILE: ../../../third_party/dart/runtime/lib/convert_patch.dart +FILE: ../../../third_party/dart/runtime/lib/lib_prefix.dart +FILE: ../../../third_party/dart/runtime/lib/linked_hash_map.cc +FILE: ../../../third_party/dart/runtime/lib/profiler.cc +FILE: ../../../third_party/dart/runtime/lib/profiler.dart +FILE: ../../../third_party/dart/runtime/observatory/bin/shell.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/app.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/object_graph.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_common.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_html.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/service_io.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/page.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/settings.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/app/view_model.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/allocation_profile.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/class_tree.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/debugger.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/heap_map.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/isolate_reconnect.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/metrics.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/vm_connect.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/src/service/object.dart +FILE: ../../../third_party/dart/runtime/observatory/lib/utils.dart +FILE: ../../../third_party/dart/runtime/observatory/web/main.dart +FILE: ../../../third_party/dart/runtime/platform/address_sanitizer.h +FILE: ../../../third_party/dart/runtime/platform/math.h +FILE: ../../../third_party/dart/runtime/platform/memory_sanitizer.h +FILE: ../../../third_party/dart/runtime/platform/safe_stack.h +FILE: ../../../third_party/dart/runtime/tools/verbose_gc_to_bmu.dart +FILE: ../../../third_party/dart/runtime/vm/ast_transformer.cc +FILE: ../../../third_party/dart/runtime/vm/ast_transformer.h +FILE: ../../../third_party/dart/runtime/vm/bit_set_test.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/code_patcher_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/assembler_arm64.h +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/il_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/range_analysis_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/method_recognizer.h +FILE: ../../../third_party/dart/runtime/vm/constants_arm64.h +FILE: ../../../third_party/dart/runtime/vm/cpu_arm.h +FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/cpu_arm64.h +FILE: ../../../third_party/dart/runtime/vm/cpu_ia32.h +FILE: ../../../third_party/dart/runtime/vm/cpu_x64.h +FILE: ../../../third_party/dart/runtime/vm/cpuid.cc +FILE: ../../../third_party/dart/runtime/vm/cpuid.h +FILE: ../../../third_party/dart/runtime/vm/cpuinfo.h +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_android.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_test.cc +FILE: ../../../third_party/dart/runtime/vm/cpuinfo_win.cc +FILE: ../../../third_party/dart/runtime/vm/debugger_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/hash_table.h +FILE: ../../../third_party/dart/runtime/vm/hash_table_test.cc +FILE: ../../../third_party/dart/runtime/vm/heap/scavenger_test.cc +FILE: ../../../third_party/dart/runtime/vm/heap/spaces.h +FILE: ../../../third_party/dart/runtime/vm/heap/weak_code.cc +FILE: ../../../third_party/dart/runtime/vm/heap/weak_code.h +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64.h +FILE: ../../../third_party/dart/runtime/vm/instructions_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/metrics.cc +FILE: ../../../third_party/dart/runtime/vm/metrics.h +FILE: ../../../third_party/dart/runtime/vm/metrics_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/object_graph.cc +FILE: ../../../third_party/dart/runtime/vm/object_graph.h +FILE: ../../../third_party/dart/runtime/vm/object_graph_test.cc +FILE: ../../../third_party/dart/runtime/vm/regexp.cc +FILE: ../../../third_party/dart/runtime/vm/regexp.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler.h +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_assembler_ir.h +FILE: ../../../third_party/dart/runtime/vm/regexp_ast.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_ast.h +FILE: ../../../third_party/dart/runtime/vm/regexp_parser.cc +FILE: ../../../third_party/dart/runtime/vm/regexp_parser.h +FILE: ../../../third_party/dart/runtime/vm/regexp_test.cc +FILE: ../../../third_party/dart/runtime/vm/report.cc +FILE: ../../../third_party/dart/runtime/vm/report.h +FILE: ../../../third_party/dart/runtime/vm/ring_buffer.h +FILE: ../../../third_party/dart/runtime/vm/ring_buffer_test.cc +FILE: ../../../third_party/dart/runtime/vm/runtime_entry_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/simulator_arm64.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_arm64.h +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64.cc +FILE: ../../../third_party/dart/runtime/vm/stub_code_arm64_test.cc +FILE: ../../../third_party/dart/runtime/vm/tags.cc +FILE: ../../../third_party/dart/runtime/vm/unibrow-inl.h +FILE: ../../../third_party/dart/runtime/vm/unibrow.cc +FILE: ../../../third_party/dart/runtime/vm/unibrow.h +FILE: ../../../third_party/dart/runtime/vm/verified_memory_test.cc +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart +FILE: ../../../third_party/dart/sdk/lib/_internal/js_runtime/lib/shared/embedded_names.dart +FILE: ../../../third_party/dart/sdk/lib/collection/set.dart +FILE: ../../../third_party/dart/sdk/lib/core/sink.dart +FILE: ../../../third_party/dart/sdk/lib/developer/profiler.dart +FILE: ../../../third_party/dart/sdk/lib/io/process.dart +FILE: ../../../third_party/dart/sdk/lib/io/service_object.dart +FILE: ../../../third_party/dart/sdk/lib/isolate/capability.dart +FILE: ../../../third_party/dart/sdk/lib/profiler/profiler.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: double-conversion +ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum-dtoa.cc +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum-dtoa.cc +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum-dtoa.h +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum.cc +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/bignum.h +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/cached-powers.h +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/diy-fp.cc +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/diy-fp.h +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/double-conversion.cc +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/fast-dtoa.h +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/fixed-dtoa.cc +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/fixed-dtoa.h +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/strtod.cc +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/strtod.h +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/utils.h +---------------------------------------------------------------------------------------------------- +Copyright 2010 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: double-conversion +ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/src/cached-powers.cc +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/cached-powers.cc +---------------------------------------------------------------------------------------------------- +Copyright 2006-2008 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: double-conversion +ORIGIN: ../../../third_party/dart/runtime/third_party/double-conversion/src/double-conversion.h +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/double-conversion.h +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/fast-dtoa.cc +FILE: ../../../third_party/dart/runtime/third_party/double-conversion/src/ieee.h +---------------------------------------------------------------------------------------------------- +Copyright 2012 the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT @@ -15284,34 +15322,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages LIBRARY: pkg -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/comparators.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_memoizer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/cancelable_operation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/event_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream_consumer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream_subscription.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/future_group.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/lazy_stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/restartable_timer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_completer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_group.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_queue.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_splitter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/subscription_stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/comparators.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/location_mixin.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/unparsed_frame.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/expected_function.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/group_context.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/example/example.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/shared.dart FILE: ../../../third_party/pkg/when/lib/when.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file @@ -15346,351 +15364,286 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/aggregate_transformer/lib/recipes-grammas/banana-pudding-recipe.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/aggregate_transformer/lib/recipes-grammas/winter-squash-pie-recipe.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/markdown_converter/lib/images/bison.jpg -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/markdown_converter/lib/index.markdown -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/example/call_parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/example/call_parser.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/af.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/am.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar_DZ.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/az.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/be.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/bg.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/bn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/br.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/bs.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ca.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/chr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/cs.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/cy.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/da.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/de.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/de_AT.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/de_CH.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/el.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_AU.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_CA.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_GB.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IE.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IN.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ISO.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_MY.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_SG.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_US.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ZA.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es_419.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es_ES.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es_MX.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es_US.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/et.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/eu.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fa.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fi.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fil.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CA.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CH.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ga.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gsw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gu.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/haw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/he.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/hi.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/hr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/hu.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/hy.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/id.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/in.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/is.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it_CH.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/iw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ja.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ka.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/kk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/km.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/kn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ko.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ky.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ln.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/lo.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/lt.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/lv.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ml.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mo.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ms.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mt.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/my.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/nb.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ne.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/nl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/no.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/no_NO.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/or.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pa.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ps.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_BR.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_PT.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ro.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ru.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sd.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sh.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/si.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sq.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sr_Latn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sv.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ta.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/te.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/th.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/tl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/tr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/uk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ur.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/uz.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/vi.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zh.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zh_CN.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zh_HK.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zh_TW.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zu.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/af.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/am.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar_DZ.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/az.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/be.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/bg.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/bn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/br.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/bs.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ca.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/chr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/cs.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/cy.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/da.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/de.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/de_AT.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/de_CH.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/el.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_AU.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_CA.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_GB.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IE.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IN.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ISO.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_MY.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_SG.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_US.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ZA.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es_419.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es_ES.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es_MX.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es_US.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/et.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/eu.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fa.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fi.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fil.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CA.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CH.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ga.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gsw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gu.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/haw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/he.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/hi.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/hr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/hu.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/hy.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/id.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/in.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/is.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it_CH.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/iw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ja.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ka.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/kk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/km.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/kn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ko.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ky.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ln.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/lo.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/lt.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/lv.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/mk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ml.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/mn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/mr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ms.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/mt.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/my.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/nb.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ne.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/nl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no_NO.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/or.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pa.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ps.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_BR.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_PT.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ro.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ru.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/si.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sq.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr_Latn.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sv.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sw.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ta.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/te.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/th.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tl.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tr.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uk.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ur.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uz.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/vi.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_CN.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_HK.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_TW.json -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zu.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/.analysis_options +---------------------------------------------------------------------------------------------------- +Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/dart.js + ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/dart.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/interop.js +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/algorithms.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/collection.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/equality.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/iterable_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/algorithms.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/iterable_zip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/unmodifiable_wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/pretty_print.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/context.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/parsed_path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_exception.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/posix.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/url.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/windows.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/chain.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/frame.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/stack_zone_specification.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/vm_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/stack_trace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/compact_vm_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_enhanced_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_individual_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/configuration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/pretty_print.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/simple_configuration.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/test_case.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/unittest.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/vm_config.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/charted-demo-screenshot.png +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_chartstate.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_chartstate.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_custom_axis.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/demo_charts.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/demo_interactive.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_bar_charts.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_bar_charts.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_cartesian_renderers.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_combo_charts.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_combo_charts.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_line_charts.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_line_charts.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_pie_charts.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_pie_charts.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_stacked_bar_charts.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_stacked_bar_charts.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/index.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/layout/treemap_demo.html +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/selection/transitions_demo.html +---------------------------------------------------------------------------------------------------- +Copyright (c) 2014, Michael Bostock and Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_custom_axis.dart +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_custom_axis.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/demo_interactive.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_cartesian_renderers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/layout/treemap_demo.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/selection/transitions_demo.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charted.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/axis_label_tooltip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/chart_tooltip.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/hovercard.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/line_marker.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/mouse_tracker.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/bar_chart_renderer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/bubble_chart_renderer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/cartesian_base_renderer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/line_chart_renderer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/stackedbar_chart_renderer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/stackedline_chart_renderer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_area.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_config.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_events.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_legend.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_renderer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_series.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_state.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_theme.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/charts.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/aggregation.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/aggregation_item.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/aggregation_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/filter_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/transpose_transformer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/layout_renderers/layout_base_renderer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/layout_renderers/pie_chart_renderer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/cartesian_area_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_axis_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_config_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_data_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_events_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_legend_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_series_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_state_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/layout_area_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/themes/quantum_theme.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/interpolators.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/interpolators/easing.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/interpolators/interpolators.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales/linear_scale.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales/log_scale.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales/ordinal_scale.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales/time_scale.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/text_metrics.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/text_metrics/segmentation.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/text_metrics/segmentation_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/text_metrics/segmentation_utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/time_interval.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/timer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/bidi_formatter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/color.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/disposer.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/lists.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/math.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/namespace.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/object_factory.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/rect.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/layout/layout.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/layout/src/hierarchy_layout.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/layout/src/pie_layout.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/layout/src/treemap_layout.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/format/number_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/format/time_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/languages/en_us.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/locale.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/selection.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/selection_scope.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/src/selection_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/src/transition_impl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/transition.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/axis.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes/arc.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes/area.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes/line.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes/rect.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/tool/build_unicode_segmentation_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/tool/build_unicode_segmentation_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/tool/hop_runner.dart ---------------------------------------------------------------------------------------------------- -Copyright 2013, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Copyright (c) 2013, Google Inc. +All rights reserved. - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/example/test_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/simple_transformer/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/bin/css.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/analyzer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/messages.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/options.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/property.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenizer_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tokenkind.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_base.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/validate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/visitor.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_file.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_http_request.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbols.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_browser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_standalone.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/message_lookup_by_library.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/locale_list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/date_format_internal.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/file_data_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/http_request_data_reader.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_formatter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_field.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_helpers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/number_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl_helpers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/lazy_locale_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/tool/generate_locale_data_files.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/lib/logging.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/core_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/description.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/error_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/interfaces.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/iterable_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/map_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/numeric_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/operator_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/string_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/core_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/description.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/error_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/expect.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/future_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/interfaces.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/iterable_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/map_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/numeric_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/operator_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/string_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/constants.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/list_range.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf16.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf32.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf8.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_16_code_unit_decoder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/util.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/utf.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/.test_config ---------------------------------------------------------------------------------------------------- -Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - +Copyright 2015, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -15720,38 +15673,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/canonicalized_map.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/command_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_results.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/help_command.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/option.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/usage_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/.status -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/aggregate_transformer/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/lazy_transformer/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/example/markdown_converter/lib/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/node_status.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/node_streams.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/static_asset_cascade.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/transformer_classifier.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/internal_asset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/aggregate_transform.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/aggregate_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/base_transform.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/declaring_aggregate_transform.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/declaring_aggregate_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/declaring_transform.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/declaring_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/lazy_aggregate_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/lazy_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transform.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/wrapping_aggregate_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/ascii.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/charcode.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/lib/html_entity.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/priority_queue.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/canonicalized_map.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/priority_queue.dart @@ -15767,16 +15690,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pa FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/characters.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/internal_style.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/lib/pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/source_span.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/colors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/file.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/location.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span_mixin.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/span_with_context.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/lib/src/utils.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/.status FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/internal_test_case.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher.dart @@ -15789,10 +15702,10 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/us FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/src/usage_impl.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/src/usage_impl_html.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/src/usage_impl_io.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/src/uuid.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/usage.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/usage_html.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/usage_io.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/lib/uuid/uuid.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/tool/grind.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file @@ -15827,164 +15740,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/arg_parser_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/delegate/stream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/null_stream_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/capture_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/error.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_sink.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/release_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/result/value.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/single_subscription_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_completer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/handler_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/stream_transformer_wrapper.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_sink_transformer/typed.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_subscription_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/stream_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed/stream_subscription.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/typed_stream_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/empty_unmodifiable_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/functions.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set_controller.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/compact_number_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/plural_rules.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/order_matchers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/meta.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_record.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/list_diff.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/property_change_record.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/to_observable.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_iterable.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/args.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/lib/src/usage.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/async.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/barback.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_forwarder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_id.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_node_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/asset_set.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/asset/internal_asset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/barback.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/build_result.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/errors.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/asset_cascade.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/group_runner.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/package_graph.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_forwarder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/phase_output.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/graph/transform_node.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/log.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/package_provider.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/serialize.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/barback_settings.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transform_logger.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/transformer/transformer_group.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/cancelable_future.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/file_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/multiset.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_pool.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/barback/lib/src/utils/stream_replayer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/dart.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/lib/interop.js -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/algorithms.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/collection.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/iterable_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/algorithms.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/iterable_zip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/unmodifiable_wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/wrappers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/css.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/css_printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/polyfill.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/csslib/lib/src/tree_printer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/pretty_print.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/context.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/parsed_path.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_exception.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/posix.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/url.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/style/windows.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/chain.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/frame.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/stack_zone_specification.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/vm_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/stack_trace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/compact_vm_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_enhanced_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/html_individual_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/pretty_print.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/simple_configuration.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/test_case.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/unittest.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/vm_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/lib/src/utf_stream.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_iterable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/dart2js.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_chain.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file +Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -16016,13 +15780,31 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/empty_unmodifiable_set.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/utf/.test_config +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/empty_unmodifiable_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/functions.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/typed_wrappers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set_controller.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/compact_number_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/plural_rules.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/order_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/meta.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/observable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/list_diff.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/property_change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/to_observable.dart ---------------------------------------------------------------------------------------------------- -Copyright 2015, the Dart project authors. All rights reserved. +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16052,18 +15834,239 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_cache.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/async_cache.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/async/lib/src/byte_collector.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_iterable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_list.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_chain.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/af.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/am.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ar_DZ.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/az.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/be.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/bg.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/bn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/br.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/bs.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ca.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/chr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/cs.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/cy.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/da.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/de.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/de_AT.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/de_CH.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/el.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_AU.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_CA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_GB.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IE.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_IN.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ISO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_MY.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_SG.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_US.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/en_ZA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es_419.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es_ES.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es_MX.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/es_US.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/et.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/eu.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fa.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fi.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fil.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/fr_CH.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ga.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gsw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/gu.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/haw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/he.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/hi.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/hr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/hu.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/hy.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/id.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/in.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/is.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/it_CH.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/iw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ja.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ka.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/kk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/km.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/kn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ko.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ky.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ln.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/lo.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/lt.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/lv.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ml.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mo.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ms.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/mt.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/my.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/nb.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ne.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/nl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/no.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/no_NO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/or.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pa.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ps.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_BR.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/pt_PT.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ro.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ru.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sd.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sh.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/si.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sq.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sr_Latn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sv.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/sw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ta.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/te.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/th.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/tl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/tr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/uk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/ur.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/uz.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/vi.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zh.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zh_CN.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zh_HK.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zh_TW.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/patterns/zu.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/af.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/am.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ar_DZ.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/az.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/be.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/bg.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/bn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/br.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/bs.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ca.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/chr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/cs.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/cy.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/da.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/de.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/de_AT.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/de_CH.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/el.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_AU.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_CA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_GB.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IE.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_IN.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ISO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_MY.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_SG.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_US.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/en_ZA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es_419.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es_ES.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es_MX.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/es_US.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/et.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/eu.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fa.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fi.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fil.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CA.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/fr_CH.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ga.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gsw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/gu.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/haw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/he.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/hi.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/hr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/hu.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/hy.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/id.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/in.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/is.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/it_CH.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/iw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ja.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ka.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/kk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/km.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/kn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ko.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ky.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ln.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/lo.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/lt.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/lv.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/mk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ml.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/mn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/mr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ms.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/mt.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/my.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/nb.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ne.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/nl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/no_NO.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/or.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pa.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ps.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_BR.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/pt_PT.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ro.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ru.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/si.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sq.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sr_Latn.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sv.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/sw.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ta.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/te.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/th.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tl.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/tr.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uk.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/ur.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/uz.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/vi.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_CN.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_HK.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zh_TW.json +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/symbols/zu.json +---------------------------------------------------------------------------------------------------- +Copyright 2013, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16093,28 +16096,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charcode/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/compiler.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/encodings.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/libraries/Dart_Packages.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/libraries/Dart_SDK.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/misc.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/modules.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/pool.iml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/vcs.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.idea/workspace.xml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/pool/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/source_span/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/usage/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart ---------------------------------------------------------------------------------------------------- -Copyright 2014, the Dart project authors. All rights reserved. +Copyright (c) 2017, the Dart project authors. +Please see the AUTHORS file +for details. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -16144,260 +16133,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/.analysis_options -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/charted-demo-screenshot.png -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_chartstate.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_chartstate.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_custom_axis.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/demo_charts.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/demo_interactive.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_bar_charts.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_bar_charts.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_cartesian_renderers.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_combo_charts.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_combo_charts.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_line_charts.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_line_charts.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_pie_charts.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_pie_charts.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_stacked_bar_charts.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_stacked_bar_charts.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/index.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/layout/treemap_demo.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/selection/transitions_demo.html ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014, Michael Bostock and Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_custom_axis.dart -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/components/demo_custom_axis.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/demo_interactive.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/charts/renderers/demo_cartesian_renderers.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/layout/treemap_demo.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/examples/selection/transitions_demo.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charted.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/axis_label_tooltip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/chart_tooltip.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/hovercard.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/line_marker.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/behaviors/mouse_tracker.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/bar_chart_renderer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/bubble_chart_renderer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/cartesian_base_renderer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/line_chart_renderer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/stackedbar_chart_renderer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/cartesian_renderers/stackedline_chart_renderer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_area.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_config.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_events.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_legend.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_renderer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_series.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_state.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/chart_theme.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/charts.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/aggregation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/aggregation_item.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/aggregation_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/filter_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/data_transformers/transpose_transformer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/layout_renderers/layout_base_renderer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/layout_renderers/pie_chart_renderer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/cartesian_area_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_axis_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_config_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_data_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_events_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_legend_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_series_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/chart_state_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/src/layout_area_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/charts/themes/quantum_theme.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/interpolators.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/interpolators/easing.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/interpolators/interpolators.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales/linear_scale.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales/log_scale.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales/ordinal_scale.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/scales/time_scale.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/text_metrics.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/text_metrics/segmentation.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/text_metrics/segmentation_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/text_metrics/segmentation_utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/time_interval.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/timer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/bidi_formatter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/color.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/disposer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/lists.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/math.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/namespace.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/object_factory.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/core/utils/rect.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/layout/layout.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/layout/src/hierarchy_layout.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/layout/src/pie_layout.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/layout/src/treemap_layout.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/format/number_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/format/time_format.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/languages/en_us.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/locale/locale.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/selection.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/selection_scope.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/src/selection_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/src/transition_impl.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/selection/transition.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/axis.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes/arc.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes/area.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes/line.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/lib/svg/shapes/rect.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/tool/build_unicode_segmentation_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/tool/build_unicode_segmentation_data.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/charted/tool/hop_runner.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2013, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_to_js_script_rewriter/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_to_js_script_rewriter/COPYRIGHT_TRANSFER -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_to_js_script_rewriter/docs.yml -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_to_js_script_rewriter/example/index.html -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_to_js_script_rewriter/example/test.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_to_js_script_rewriter/lib/dart_to_js_script_rewriter.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_to_js_script_rewriter/tool/dev.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014 Seth Ladd. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/LICENSE -TYPE: LicenseType.mit -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/.test_config -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/dom.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/dom_parsing.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/parser_console.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/char_encodings.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/constants.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/encoding_parser.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/inputstream.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/list_proxy.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/query_selector.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/token.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/tokenizer.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/treebuilder.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/html/lib/src/utils.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2006-2012 The Authors - -Contributors: -James Graham - jg307@cam.ac.uk -Anne van Kesteren - annevankesteren@gmail.com -Lachlan Hunt - lachlan.hunt@lachy.id.au -Matt McDonald - kanashii@kanashii.ca -Sam Ruby - rubys@intertwingly.net -Ian Hickson (Google) - ian@hixie.ch -Thomas Broyer - t.broyer@ltgt.net -Jacques Distler - distler@golem.ph.utexas.edu -Henri Sivonen - hsivonen@iki.fi -Adam Barth - abarth@webkit.org -Eric Seidel - eric@webkit.org -The Mozilla Foundation (contributions from Henri Sivonen since 2008) -David Flanagan (Mozilla) - dflanagan@mozilla.com -Google Inc. (contributed the Dart port) - misc@dartlang.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -==================================================================================================== - -==================================================================================================== -LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_custom.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols_data.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2017, the Dart project authors. +Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. @@ -16430,13 +16171,53 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: observatory_pub_packages -ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/args/LICENSE +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/locale_list.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_local.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_file.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbol_data_http_request.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/date_symbols.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_browser.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/intl_standalone.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/message_lookup_by_library.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/number_symbols.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/data/dates/locale_list.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/date_format_internal.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/file_data_reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/http_request_data_reader.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_formatter.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/bidi_utils.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_field.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/date_format_helpers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/number_format.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl_helpers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/lazy_locale_data.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/tool/generate_locale_data_files.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/lib/logging.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/core_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/description.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/error_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/interfaces.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/iterable_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/map_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/numeric_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/operator_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/string_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/path.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/core_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/description.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/error_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/expect.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/future_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/interfaces.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/iterable_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/map_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/numeric_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/operator_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/unittest/lib/src/matcher/string_matchers.dart ---------------------------------------------------------------------------------------------------- -Copyright (c) 2014, the Dart project authors. -Please see the AUTHORS file +Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file for details. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -22100,4 +21881,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 323 +Total license count: 321 From 51785d244d4163a058d2e2c2f4863ce509eec939 Mon Sep 17 00:00:00 2001 From: amirh Date: Tue, 3 Jul 2018 09:21:03 -0700 Subject: [PATCH 0700/1190] Remove unused Java imports (#5663) --- .../io/flutter/app/FlutterActivity.java | 1 - .../flutter/app/FlutterActivityDelegate.java | 8 ------- .../flutter/app/FlutterFragmentActivity.java | 1 - .../io/flutter/app/FlutterPluginRegistry.java | 4 ++-- .../editing/InputConnectionAdaptor.java | 4 +--- .../plugin/editing/TextInputPlugin.java | 9 ++----- .../plugin/platform/PlatformPlugin.java | 10 +++----- .../android/io/flutter/util/PathUtils.java | 2 -- .../io/flutter/view/AccessibilityBridge.java | 11 +-------- .../android/io/flutter/view/FlutterMain.java | 9 +------ .../android/io/flutter/view/FlutterView.java | 24 ++----------------- .../io/flutter/view/ResourceExtractor.java | 13 ++-------- 12 files changed, 14 insertions(+), 82 deletions(-) diff --git a/shell/platform/android/io/flutter/app/FlutterActivity.java b/shell/platform/android/io/flutter/app/FlutterActivity.java index 72e99cd15676e..9751ef4a009ec 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterActivity.java @@ -11,7 +11,6 @@ import android.os.Bundle; import io.flutter.app.FlutterActivityDelegate.ViewFactory; import io.flutter.plugin.common.PluginRegistry; -import io.flutter.plugin.common.PluginRegistry.Registrar; import io.flutter.view.FlutterNativeView; import io.flutter.view.FlutterView; diff --git a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index ef56db8b46e13..3d06d7f8505b5 100644 --- a/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -24,23 +24,15 @@ import android.view.View; import android.view.ViewGroup; import android.view.Window; -import android.view.WindowManager; import android.view.WindowManager.LayoutParams; -import android.widget.FrameLayout; -import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.PluginRegistry; -import io.flutter.plugin.common.PluginRegistry.Registrar; import io.flutter.plugin.platform.PlatformPlugin; import io.flutter.util.Preconditions; import io.flutter.view.FlutterMain; import io.flutter.view.FlutterNativeView; import io.flutter.view.FlutterView; -import io.flutter.view.TextureRegistry; import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; /** * Class that performs the actual work of tying Android {@link Activity} diff --git a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java index f71bcaa53a0f7..1ecd8857666bd 100644 --- a/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java +++ b/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java @@ -11,7 +11,6 @@ import android.support.v4.app.FragmentActivity; import io.flutter.app.FlutterActivityDelegate.ViewFactory; import io.flutter.plugin.common.PluginRegistry; -import io.flutter.plugin.common.PluginRegistry.Registrar; import io.flutter.view.FlutterNativeView; import io.flutter.view.FlutterView; diff --git a/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java b/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java index 347afa52f21fb..f29da3faf9f86 100644 --- a/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java +++ b/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java @@ -7,8 +7,8 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; -import android.util.Log; -import io.flutter.plugin.common.*; +import io.flutter.plugin.common.BinaryMessenger; +import io.flutter.plugin.common.PluginRegistry; import io.flutter.view.FlutterMain; import io.flutter.view.FlutterNativeView; import io.flutter.view.FlutterView; diff --git a/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java b/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java index 02190a84b4fbb..54ad63482cced 100644 --- a/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java +++ b/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java @@ -7,17 +7,15 @@ import android.content.Context; import android.text.Editable; import android.text.Selection; +import android.view.KeyEvent; import android.view.inputmethod.BaseInputConnection; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; -import android.view.KeyEvent; - import io.flutter.plugin.common.MethodChannel; import io.flutter.view.FlutterView; import java.util.Arrays; import java.util.HashMap; -import java.util.Map; class InputConnectionAdaptor extends BaseInputConnection { private final FlutterView mFlutterView; diff --git a/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java b/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java index 5ada698404bdb..0eded84a726a7 100644 --- a/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java +++ b/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java @@ -4,7 +4,6 @@ package io.flutter.plugin.editing; -import android.app.Activity; import android.content.Context; import android.text.Editable; import android.text.InputType; @@ -13,16 +12,12 @@ import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; - +import io.flutter.plugin.common.JSONMethodCodec; +import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.JSONMethodCodec; -import io.flutter.plugin.common.JSONUtil; -import io.flutter.plugin.common.MethodCall; import io.flutter.view.FlutterView; - -import java.util.Map; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index d46b0ac74c45b..b05ffe5ec82b4 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java @@ -5,24 +5,20 @@ package io.flutter.plugin.platform; import android.app.Activity; -import android.content.ClipboardManager; import android.content.ClipData; -import android.content.ClipDescription; +import android.content.ClipboardManager; import android.content.Context; -import android.content.Intent; import android.content.pm.ActivityInfo; import android.os.Build; +import android.util.Log; import android.view.HapticFeedbackConstants; import android.view.SoundEffectConstants; import android.view.View; import android.view.Window; -import android.util.Log; - import io.flutter.plugin.common.ActivityLifecycleListener; +import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel.MethodCallHandler; import io.flutter.plugin.common.MethodChannel.Result; -import io.flutter.plugin.common.MethodCall; - import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; diff --git a/shell/platform/android/io/flutter/util/PathUtils.java b/shell/platform/android/io/flutter/util/PathUtils.java index 93ba68497c95a..55d3fcc80b1b6 100644 --- a/shell/platform/android/io/flutter/util/PathUtils.java +++ b/shell/platform/android/io/flutter/util/PathUtils.java @@ -5,8 +5,6 @@ package io.flutter.util; import android.content.Context; -import java.io.IOException; -import java.lang.String; public final class PathUtils { public static String getDataDirectory(Context applicationContext) { diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 322e113f628e0..8925d6957cb6a 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -17,16 +17,7 @@ import io.flutter.plugin.common.StandardMessageCodec; import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMessageChannel.MessageHandler { private static final String TAG = "FlutterView"; diff --git a/shell/platform/android/io/flutter/view/FlutterMain.java b/shell/platform/android/io/flutter/view/FlutterMain.java index 6ccdd54d5ea57..66b2fff70783a 100644 --- a/shell/platform/android/io/flutter/view/FlutterMain.java +++ b/shell/platform/android/io/flutter/view/FlutterMain.java @@ -11,18 +11,11 @@ import android.os.Looper; import android.os.SystemClock; import android.util.Log; - import io.flutter.util.PathUtils; -import java.io.BufferedReader; import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; /** * A class to intialize the Flutter engine. diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 4e812173b5002..703894a614796 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -13,49 +13,29 @@ import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Rect; -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.Matrix; import android.graphics.SurfaceTexture; import android.os.Build; import android.text.format.DateFormat; import android.util.AttributeSet; import android.util.Log; import android.util.TypedValue; -import android.view.KeyCharacterMap; -import android.view.KeyEvent; -import android.view.MotionEvent; -import android.view.Surface; -import android.view.SurfaceHolder; -import android.view.SurfaceView; -import android.view.WindowInsets; -import android.view.WindowManager; +import android.view.*; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeProvider; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; -import io.flutter.app.FlutterActivity; import io.flutter.app.FlutterPluginRegistry; import io.flutter.plugin.common.*; -import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.editing.TextInputPlugin; import io.flutter.plugin.platform.PlatformPlugin; -import io.flutter.view.VsyncWaiter; - import org.json.JSONException; import org.json.JSONObject; import java.net.URI; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; +import java.util.*; import java.util.concurrent.atomic.AtomicLong; /** diff --git a/shell/platform/android/io/flutter/view/ResourceExtractor.java b/shell/platform/android/io/flutter/view/ResourceExtractor.java index 36bba7906ec1f..e796219694d37 100644 --- a/shell/platform/android/io/flutter/view/ResourceExtractor.java +++ b/shell/platform/android/io/flutter/view/ResourceExtractor.java @@ -10,23 +10,14 @@ import android.content.res.AssetManager; import android.os.AsyncTask; import android.util.Log; +import io.flutter.util.PathUtils; -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileNotFoundException; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Arrays; +import java.io.*; import java.util.Collection; import java.util.HashSet; -import java.util.LinkedList; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; -import io.flutter.util.PathUtils; - /** * A class to intialize the native code. **/ From 2a88ecf17851cee3f2b304b21b5d71f35ceff1d7 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 3 Jul 2018 13:21:40 -0400 Subject: [PATCH 0701/1190] Roll src/third_party/skia 94d57c477fe1..34aa059c1502 (8 commits) (#5666) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 38 +-------------------- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/DEPS b/DEPS index 0624e72b1a657..4213d2077ff39 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '94d57c477fe122c146a034c625cebb6c44ef21b0', + 'skia_revision': '34aa059c1502d67c9a5f4db449667a8709b69fb9', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index caefaf4fe94da..bfe9110d62aa4 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 650df7cae093ff5f8985d89194da8c02 +Signature: e2ebc854c280677e329ef08433c91e99 UNUSED LICENSES: @@ -4479,34 +4479,8 @@ FILE: ../../../third_party/dart/.mailmap FILE: ../../../third_party/dart/client/idea/.idea/.name FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Default.xml FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml -FILE: ../../../third_party/dart/runtime/.idea/codeStyles/Project.xml -FILE: ../../../third_party/dart/runtime/.idea/misc.xml -FILE: ../../../third_party/dart/runtime/.idea/modules.xml -FILE: ../../../third_party/dart/runtime/.idea/runtime.iml -FILE: ../../../third_party/dart/runtime/.idea/workspace.xml FILE: ../../../third_party/dart/runtime/CPPLINT.cfg -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_C.bin -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CMakeDetermineCompilerABI_CXX.bin -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CompilerIdC/CMakeCCompilerId.c -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CompilerIdC/a.out -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/3.10.2/CompilerIdCXX/a.out -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/Makefile2 -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/cmake.check_cache -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/feature_tests.bin -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/feature_tests.c -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/feature_tests.cxx -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/progress.marks -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/runtime.dir/build.make -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/runtime.dir/depend.make -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/runtime.dir/flags.make -FILE: ../../../third_party/dart/runtime/cmake-build-debug/CMakeFiles/runtime.dir/progress.make -FILE: ../../../third_party/dart/runtime/cmake-build-debug/runtime.cbp FILE: ../../../third_party/dart/runtime/observatory/.analysis_options -FILE: ../../../third_party/dart/runtime/observatory/.idea/libraries/Dart_SDK.xml -FILE: ../../../third_party/dart/runtime/observatory/.idea/modules.xml -FILE: ../../../third_party/dart/runtime/observatory/.idea/observatory.iml -FILE: ../../../third_party/dart/runtime/observatory/.idea/workspace.xml FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png @@ -4515,23 +4489,16 @@ FILE: ../../../third_party/dart/runtime/observatory/web/favicon.ico FILE: ../../../third_party/dart/runtime/observatory/web/index.html FILE: ../../../third_party/dart/runtime/observatory/web/third_party/trace_viewer_full.html FILE: ../../../third_party/dart/runtime/observatory/web/timeline.html -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc.rej FILE: ../../../third_party/dart/runtime/vm/snapshot_test_in.dat FILE: ../../../third_party/dart/samples/build_dart/test.foo FILE: ../../../third_party/dart/samples/build_dart_simple/test.foo FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common.dart FILE: ../../../third_party/dart/sdk/lib/libraries.json -FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/libraries/Dart_SDK.xml -FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/misc.xml -FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/modules.xml -FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/vmservice.iml -FILE: ../../../third_party/dart/sdk/lib/vmservice/.idea/workspace.xml FILE: ../../../third_party/dart/sdk/lib/vmservice_libraries.json FILE: ../../../third_party/dart/third_party/7zip.tar.gz.sha1 FILE: ../../../third_party/dart/third_party/clang.tar.gz.sha1 FILE: ../../../third_party/dart/third_party/gsutil.tar.gz.sha1 -FILE: ../../../third_party/dart/vm_outline_strong.dill ---------------------------------------------------------------------------------------------------- Copyright 2012, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -4851,9 +4818,7 @@ FILE: ../../../third_party/dart/runtime/vm/native_arguments.h FILE: ../../../third_party/dart/runtime/vm/native_message_handler.cc FILE: ../../../third_party/dart/runtime/vm/native_message_handler.h FILE: ../../../third_party/dart/runtime/vm/object.cc -FILE: ../../../third_party/dart/runtime/vm/object.cc.orig FILE: ../../../third_party/dart/runtime/vm/object.h -FILE: ../../../third_party/dart/runtime/vm/object.h.orig FILE: ../../../third_party/dart/runtime/vm/object_arm_test.cc FILE: ../../../third_party/dart/runtime/vm/object_ia32_test.cc FILE: ../../../third_party/dart/runtime/vm/object_set.h @@ -5451,7 +5416,6 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_eliminati FILE: ../../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/flow_graph_builder_test.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc.orig FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_to_il.h FILE: ../../../third_party/dart/runtime/vm/compiler/intrinsifier_dbc.cc From 2b890c8045f1bb7a36c32cdb7e7024121cd87c15 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 3 Jul 2018 16:51:39 -0400 Subject: [PATCH 0702/1190] Roll src/third_party/skia 34aa059c1502..58a1605d2b9b (6 commits) (#5667) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4213d2077ff39..bf3d054ccfd8a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '34aa059c1502d67c9a5f4db449667a8709b69fb9', + 'skia_revision': '58a1605d2b9bab077f53b6a223f9e7ce1891d3ea', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index bfe9110d62aa4..18b2bd1c0b64f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e2ebc854c280677e329ef08433c91e99 +Signature: 28e060ee3b093afd73476d9a26f7d34d UNUSED LICENSES: From b66301055852af708e87e373d811cb653b898a13 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 3 Jul 2018 20:15:40 -0400 Subject: [PATCH 0703/1190] Roll src/third_party/skia 58a1605d2b9b..6784ffa78e70 (8 commits) (#5671) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index bf3d054ccfd8a..a793654a07165 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '58a1605d2b9bab077f53b6a223f9e7ce1891d3ea', + 'skia_revision': '6784ffa78e70e17084e1b30e724a8ded175d6007', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 18b2bd1c0b64f..02732563a69bb 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 28e060ee3b093afd73476d9a26f7d34d +Signature: 35540f3e8369a48088ca70b975acf2f6 UNUSED LICENSES: @@ -17143,7 +17143,7 @@ FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp FILE: ../../../third_party/skia/src/utils/Sk3D.cpp FILE: ../../../third_party/skia/src/utils/SkJSON.cpp FILE: ../../../third_party/skia/src/utils/SkJSON.h -FILE: ../../../third_party/skia/third_party/skcms/skcms.c +FILE: ../../../third_party/skia/third_party/skcms/skcms.cc FILE: ../../../third_party/skia/third_party/skcms/skcms.h FILE: ../../../third_party/skia/third_party/skcms/skcms_internal.h FILE: ../../../third_party/skia/third_party/skcms/src/Transform_inl.h From d085f1df2cbed883a8fac6130c06b2549feed515 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Tue, 3 Jul 2018 17:17:57 -0700 Subject: [PATCH 0704/1190] Do not make an extra submit callback during SurfaceFrame destruction if the frame was already submitted (#5669) --- shell/common/surface.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/common/surface.cc b/shell/common/surface.cc index d9b620fbc633e..7101f6e5c40eb 100644 --- a/shell/common/surface.cc +++ b/shell/common/surface.cc @@ -21,7 +21,7 @@ SurfaceFrame::SurfaceFrame(sk_sp surface, } SurfaceFrame::~SurfaceFrame() { - if (submit_callback_) { + if (submit_callback_ && !submitted_) { // Dropping without a Submit. submit_callback_(*this, nullptr); } From 24af9ca6c3d08c35a5111e746247e2f60e037e26 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 3 Jul 2018 21:08:28 -0700 Subject: [PATCH 0705/1190] [fuchsia] Update gn label for fuchsia.ui.scenic (#5673) The gn label for this target changed. --- flow/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow/BUILD.gn b/flow/BUILD.gn index 27ce8e41c070b..ab5b41653970a 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -84,8 +84,8 @@ source_set("flow") { ] public_deps += [ + "//garnet/public/fidl/fuchsia.ui.scenic", "//garnet/public/lib/ui/scenic/cpp", - "//garnet/public/lib/ui/scenic/fidl", "//topaz/public/dart-pkg/zircon", ] From 5724faf86ec9857b4c58b5056b323bce5a1d1ff0 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 3 Jul 2018 22:25:40 -0700 Subject: [PATCH 0706/1190] ensure that bridge is not destroyed when semantics is still enabled (#5672) --- shell/platform/darwin/ios/platform_view_ios.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index 1fba8e5e026e5..7d64bb80cb749 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -65,7 +65,7 @@ void PlatformViewIOS::SetSemanticsEnabled(bool enabled) { if (enabled && !accessibility_bridge_) { accessibility_bridge_ = std::make_unique(owner_view_, this); - } else { + } else if (!enabled && accessibility_bridge_) { accessibility_bridge_.reset(); } PlatformView::SetSemanticsEnabled(enabled); From 74dc963abb3bfac9ae6579d394d74cf18281d08c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 4 Jul 2018 02:06:41 -0400 Subject: [PATCH 0707/1190] Roll src/third_party/skia 6784ffa78e70..233c65202e69 (1 commits) (#5674) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index a793654a07165..444ebc603d357 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6784ffa78e70e17084e1b30e724a8ded175d6007', + 'skia_revision': '233c65202e6904578904f914e976e234037df8ae', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 4128a799cd3d7b0b1bb27b5e4d298886c9580b43 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 4 Jul 2018 10:47:39 -0400 Subject: [PATCH 0708/1190] Roll src/third_party/skia 233c65202e69..cdefa23a23cf (1 commits) (#5675) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 444ebc603d357..da23d63b78656 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '233c65202e6904578904f914e976e234037df8ae', + 'skia_revision': 'cdefa23a23cfc411fb50a21d9a06bfaa8d037886', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 02732563a69bb..5fcbfc3961da8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 35540f3e8369a48088ca70b975acf2f6 +Signature: c74d54d618fbf6a33a7789221db055c2 UNUSED LICENSES: From 9f9c06234413ae0a4e3eeb385e56ed3a2fc2509a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 4 Jul 2018 14:12:39 -0400 Subject: [PATCH 0709/1190] Roll src/third_party/skia cdefa23a23cf..9b80bd5f16e6 (1 commits) (#5676) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index da23d63b78656..d81bac0b9283c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cdefa23a23cfc411fb50a21d9a06bfaa8d037886', + 'skia_revision': '9b80bd5f16e6d7cf8061dd3bd091d2c5e61eb2e2', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5fcbfc3961da8..e791348abfa6d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c74d54d618fbf6a33a7789221db055c2 +Signature: 94324d4d3f32e64cd75185ae6134e935 UNUSED LICENSES: From aa4afc14b47d40a7d5bbb3f9773e34449c25f715 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 4 Jul 2018 17:42:39 -0400 Subject: [PATCH 0710/1190] Roll src/third_party/skia 9b80bd5f16e6..5788bb9af9ad (1 commits) (#5677) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d81bac0b9283c..3023b5ecc4370 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9b80bd5f16e6d7cf8061dd3bd091d2c5e61eb2e2', + 'skia_revision': '5788bb9af9ad77ff63a6b015390ca0440d31b981', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e791348abfa6d..e43cfd3b4926d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 94324d4d3f32e64cd75185ae6134e935 +Signature: c0d3cdc8bb3fb1f3d5991a000e0152d7 UNUSED LICENSES: From c6ab9b9419d33ecbfdd4f08ba7179d90ae3921f4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 4 Jul 2018 21:36:39 -0400 Subject: [PATCH 0711/1190] Roll src/third_party/skia 5788bb9af9ad..a93486b095ea (1 commits) (#5678) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3023b5ecc4370..c6fada0ab092c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5788bb9af9ad77ff63a6b015390ca0440d31b981', + 'skia_revision': 'a93486b095eafffbb0d8bbe0b55776b063f57b60', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e43cfd3b4926d..71c9b22983bba 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c0d3cdc8bb3fb1f3d5991a000e0152d7 +Signature: 797f1c997152b21ae76821722e5be68f UNUSED LICENSES: From 23ae68dfd55a56880b37160dca58742f7b09a095 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 5 Jul 2018 01:00:39 -0400 Subject: [PATCH 0712/1190] Roll src/third_party/skia a93486b095ea..e72c144af687 (1 commits) (#5679) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c6fada0ab092c..808e47e239b06 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a93486b095eafffbb0d8bbe0b55776b063f57b60', + 'skia_revision': 'e72c144af687830af85f6d8546a61475a3c1fb9f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 71c9b22983bba..cf1d3a870ac1a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 797f1c997152b21ae76821722e5be68f +Signature: f5618f1b7e3c0ae015b4ee3c78013fe0 UNUSED LICENSES: From 6f87886257f5399dea1b15d5f5bc2098253c3516 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 5 Jul 2018 04:14:40 -0400 Subject: [PATCH 0713/1190] Roll src/third_party/skia e72c144af687..44bad2e86a01 (1 commits) (#5680) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 808e47e239b06..8ab4da635cca6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e72c144af687830af85f6d8546a61475a3c1fb9f', + 'skia_revision': '44bad2e86a017fd80b5fc32e85d94a742cd5346d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 936a38dda8b30aa6aeb4a18b2b18ce80c3232e0d Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 5 Jul 2018 09:36:40 -0400 Subject: [PATCH 0714/1190] Roll src/third_party/skia 44bad2e86a01..9eb1c7d80fb3 (1 commits) (#5681) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 8ab4da635cca6..e482251b8609e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '44bad2e86a017fd80b5fc32e85d94a742cd5346d', + 'skia_revision': '9eb1c7d80fb3a0b23c0f6a156424a381b4120d3c', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index cf1d3a870ac1a..b1651a792cad3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f5618f1b7e3c0ae015b4ee3c78013fe0 +Signature: 90cdfb7153a1a7713a680527437b039c UNUSED LICENSES: From 686ee99d83881bc14daef770f4800525edb09f41 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 5 Jul 2018 13:37:39 -0400 Subject: [PATCH 0715/1190] Roll src/third_party/skia 9eb1c7d80fb3..3f2d909d7029 (1 commits) (#5682) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e482251b8609e..b731913fcab10 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9eb1c7d80fb3a0b23c0f6a156424a381b4120d3c', + 'skia_revision': '3f2d909d70298b86d5cc2e1cad54b60c10f95f92', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b1651a792cad3..575be8efbf625 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 90cdfb7153a1a7713a680527437b039c +Signature: 0792752bb0a616c68531c43689f48a60 UNUSED LICENSES: From b04fc96c224727ea8142b41752e6ce5b30a0ec7e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 5 Jul 2018 17:03:41 -0400 Subject: [PATCH 0716/1190] Roll src/third_party/skia 3f2d909d7029..53f5db5e9833 (1 commits) (#5683) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b731913fcab10..2570a5a0cab1a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3f2d909d70298b86d5cc2e1cad54b60c10f95f92', + 'skia_revision': '53f5db5e9833f148860f5e2fa2a78fbd63e511db', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 575be8efbf625..99903ff766d89 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0792752bb0a616c68531c43689f48a60 +Signature: 99fc76a459e902ab4cb9422fc4d5e10a UNUSED LICENSES: From 37e96b9e6fdd90043506efe70e8d7fdc4120bc9b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 5 Jul 2018 22:46:40 -0400 Subject: [PATCH 0717/1190] Roll src/third_party/skia 53f5db5e9833..20b824d9fe49 (1 commits) (#5685) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2570a5a0cab1a..b49e32e7607ab 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '53f5db5e9833f148860f5e2fa2a78fbd63e511db', + 'skia_revision': '20b824d9fe497b6bff3e271e05095341d985947f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 99903ff766d89..1f50b1adc88e0 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 99fc76a459e902ab4cb9422fc4d5e10a +Signature: 50f24932796a6d36dde5a8be41a83ed6 UNUSED LICENSES: From 31bd1e29a1b9f8b167ffdc521d3db3601389ca66 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 6 Jul 2018 02:06:39 -0400 Subject: [PATCH 0718/1190] Roll src/third_party/skia 20b824d9fe49..b95bbba308b9 (1 commits) (#5686) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index b49e32e7607ab..13701d95463db 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '20b824d9fe497b6bff3e271e05095341d985947f', + 'skia_revision': 'b95bbba308b98e870a97ecb17c154e1886cef2bb', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From f5f15b78b59f6b37b8ea7b96f4e8573e5878e441 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 6 Jul 2018 08:54:39 -0400 Subject: [PATCH 0719/1190] Roll src/third_party/skia b95bbba308b9..3d3d8841ff86 (1 commits) (#5687) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 13701d95463db..62de21b7b9074 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b95bbba308b98e870a97ecb17c154e1886cef2bb', + 'skia_revision': '3d3d8841ff86171a6667621880508ba499cf541f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 1f50b1adc88e0..388d02c3eb7ee 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 50f24932796a6d36dde5a8be41a83ed6 +Signature: 408dabdc8a7813b9923326f62be8c878 UNUSED LICENSES: From 3c4bf8de31c48893d33ea041c6616021b6a8e77f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 6 Jul 2018 12:19:40 -0400 Subject: [PATCH 0720/1190] Roll src/third_party/skia 3d3d8841ff86..6667fb123911 (1 commits) (#5688) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 62de21b7b9074..51109b3e7cfa4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '3d3d8841ff86171a6667621880508ba499cf541f', + 'skia_revision': '6667fb123911674835e093423fe2924983552653', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 388d02c3eb7ee..648be9445d85b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 408dabdc8a7813b9923326f62be8c878 +Signature: 181051fa828bbf75cd5954a26c1fb692 UNUSED LICENSES: From 8aa9a815852a6b2a7f8246f108a165d0780f07d9 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 6 Jul 2018 15:44:39 -0400 Subject: [PATCH 0721/1190] Roll src/third_party/skia 6667fb123911..a50205fca5f7 (3 commits) (#5689) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 51109b3e7cfa4..4ff85f5ac1712 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6667fb123911674835e093423fe2924983552653', + 'skia_revision': 'a50205fca5f7cff36dd3adac841b4c23a90a0b7d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 648be9445d85b..9007a43883359 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 181051fa828bbf75cd5954a26c1fb692 +Signature: 027158b605469ef392da9a007203719d UNUSED LICENSES: From e3347680c0210bf8b810f1b8fddb2bf6dcf35ac4 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 6 Jul 2018 19:09:39 -0400 Subject: [PATCH 0722/1190] Roll src/third_party/skia a50205fca5f7..4f6ea65f66c9 (2 commits) (#5690) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4ff85f5ac1712..89a955562b553 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a50205fca5f7cff36dd3adac841b4c23a90a0b7d', + 'skia_revision': '4f6ea65f66c90920b3bdcb703bc6d1ace704d12f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9007a43883359..e92198bc1dc3f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 027158b605469ef392da9a007203719d +Signature: a0938e35c70b3e5f64162e57f754e1bf UNUSED LICENSES: From 6e6512287b6b1a25e19f527a657503ce355fc080 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 6 Jul 2018 22:32:40 -0400 Subject: [PATCH 0723/1190] Roll src/third_party/skia 4f6ea65f66c9..bcc3aec00422 (2 commits) (#5691) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 89a955562b553..a8d9cb578af9c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4f6ea65f66c90920b3bdcb703bc6d1ace704d12f', + 'skia_revision': 'bcc3aec00422c6597600331997a2762797bc5493', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e92198bc1dc3f..0d1cbf0246231 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a0938e35c70b3e5f64162e57f754e1bf +Signature: 2d0e2eeb377589e3c967d0b755fade68 UNUSED LICENSES: From f52955c2558a8bc2539192f88d84fe7d339f5d4b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 7 Jul 2018 02:07:39 -0400 Subject: [PATCH 0724/1190] Roll src/third_party/skia bcc3aec00422..dd962a95c5f2 (1 commits) (#5692) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index a8d9cb578af9c..0d23314cb8dab 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'bcc3aec00422c6597600331997a2762797bc5493', + 'skia_revision': 'dd962a95c5f21cba18a8ef90f2a6f974e2968142', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 89cd29fb15ad44cf93b79e378dd8967b7b6c7697 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 8 Jul 2018 02:04:39 -0400 Subject: [PATCH 0725/1190] Roll src/third_party/skia dd962a95c5f2..a717ca970b25 (1 commits) (#5694) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 0d23314cb8dab..18cc62d354c1f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'dd962a95c5f21cba18a8ef90f2a6f974e2968142', + 'skia_revision': 'a717ca970b25dbe4b9450e2cae552a6cf34c771f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From cf14ca0f743756767a6d5766fdb9a4f9e8e39e8e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 8 Jul 2018 05:28:39 -0400 Subject: [PATCH 0726/1190] Roll src/third_party/skia a717ca970b25..0dd98a59df63 (1 commits) (#5695) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 18cc62d354c1f..e1378f4e763f2 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a717ca970b25dbe4b9450e2cae552a6cf34c771f', + 'skia_revision': '0dd98a59df631d3fe3b7ef3b275a8220507a8c1d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 0d1cbf0246231..528cf521bc075 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2d0e2eeb377589e3c967d0b755fade68 +Signature: 597762d1867dbe9d6a8217ccec0011ce UNUSED LICENSES: From a36207f35b9d168ad58b86a0e13c2f3685b23798 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 9 Jul 2018 02:03:39 -0400 Subject: [PATCH 0727/1190] Roll src/third_party/skia 0dd98a59df63..a391c72a2057 (1 commits) (#5696) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index e1378f4e763f2..6f049e8d4e21e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0dd98a59df631d3fe3b7ef3b275a8220507a8c1d', + 'skia_revision': 'a391c72a20574053a00e05848aa7460d30d7b649', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 4da7d44f396561b8c2cae34f684d2a3e6c0f4786 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 9 Jul 2018 05:31:40 -0400 Subject: [PATCH 0728/1190] Roll src/third_party/skia a391c72a2057..373224c9ab3a (1 commits) (#5697) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 6f049e8d4e21e..2fa850711c9b6 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a391c72a20574053a00e05848aa7460d30d7b649', + 'skia_revision': '373224c9ab3ae3f13c45f61521e01c282016fde0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 528cf521bc075..31497db5c1a6a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 597762d1867dbe9d6a8217ccec0011ce +Signature: 4b7be2dcfc21b9440ee7eff3e5b5185f UNUSED LICENSES: From 1644f3589b8eadec62c7962010d4900af1555b46 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 9 Jul 2018 11:16:40 -0400 Subject: [PATCH 0729/1190] Roll src/third_party/skia 373224c9ab3a..1354048c8fa8 (1 commits) (#5698) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2fa850711c9b6..c1e16545146ae 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '373224c9ab3ae3f13c45f61521e01c282016fde0', + 'skia_revision': '1354048c8fa885b83e414532c011d710590d6b46', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 31497db5c1a6a..7d383226d64b6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4b7be2dcfc21b9440ee7eff3e5b5185f +Signature: a21b3cccc0c8c09e6ba4dae02ac67f00 UNUSED LICENSES: From 13d801ac25402b8a5030c3141166478345eaa942 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 9 Jul 2018 14:41:39 -0400 Subject: [PATCH 0730/1190] Roll src/third_party/skia 1354048c8fa8..d48897b576e9 (8 commits) (#5699) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c1e16545146ae..0e616bafd96ce 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1354048c8fa885b83e414532c011d710590d6b46', + 'skia_revision': 'd48897b576e9ee7df445606243d14bcb1d0b95df', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7d383226d64b6..499a21b243444 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a21b3cccc0c8c09e6ba4dae02ac67f00 +Signature: 6979166f24b82cd499b2332057c513e7 UNUSED LICENSES: From d217a951262df45a9e874403267b9d4bb0d9016c Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 9 Jul 2018 12:52:10 -0700 Subject: [PATCH 0731/1190] Remove cullRect calculation on TransformLayers with a perspective transform. (#5693) --- flow/layers/default_layer_builder.cc | 5 +++-- .../darwin/ios/framework/Source/FlutterAppDelegate.mm | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index ca228a7d58f76..fb2280b27edef 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -37,12 +37,13 @@ DefaultLayerBuilder::~DefaultLayerBuilder() = default; void DefaultLayerBuilder::PushTransform(const SkMatrix& sk_matrix) { SkMatrix inverse_sk_matrix; SkRect cullRect; - if (sk_matrix.invert(&inverse_sk_matrix)) { + // Perspective projections don't produce rectangles that are useful for + // culling for some reason. + if (!sk_matrix.hasPerspective() && sk_matrix.invert(&inverse_sk_matrix)) { inverse_sk_matrix.mapRect(&cullRect, cull_rects_.top()); } else { cullRect = kGiantRect; } - auto layer = std::make_unique(); layer->set_transform(sk_matrix); PushLayer(std::move(layer), cullRect); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index a544d516c8157..efdabb7f6b2d4 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -129,7 +129,7 @@ - (void)application:(UIApplication*)application - (BOOL)application:(UIApplication*)application continueUserActivity:(NSUserActivity*)userActivity - restorationHandler:(void (^)(NSArray*))restorationHandler { + restorationHandler:(void (^)(NSArray>*))restorationHandler { return [_lifeCycleDelegate application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; From 45db8f7c55a200ab332e78dbc59d1301f659973e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 9 Jul 2018 18:06:40 -0400 Subject: [PATCH 0732/1190] Roll src/third_party/skia d48897b576e9..8fe31406e980 (4 commits) (#5701) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 0e616bafd96ce..d9b1569708509 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd48897b576e9ee7df445606243d14bcb1d0b95df', + 'skia_revision': '8fe31406e98062af447ff1e0511ab9bbdeed7638', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 499a21b243444..c5e24a324d7c5 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6979166f24b82cd499b2332057c513e7 +Signature: ba36501c9aa5697d9114574434597320 UNUSED LICENSES: From d5fce84be8aff18657b68e4395684935e59a36fa Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 9 Jul 2018 15:22:25 -0700 Subject: [PATCH 0733/1190] revert change to app delegate that wont build on earlier xcodes (#5702) --- .../platform/darwin/ios/framework/Source/FlutterAppDelegate.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index efdabb7f6b2d4..a544d516c8157 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -129,7 +129,7 @@ - (void)application:(UIApplication*)application - (BOOL)application:(UIApplication*)application continueUserActivity:(NSUserActivity*)userActivity - restorationHandler:(void (^)(NSArray>*))restorationHandler { + restorationHandler:(void (^)(NSArray*))restorationHandler { return [_lifeCycleDelegate application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; From d9a831c5557ea06ff53260890d402b96d1af9470 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 9 Jul 2018 15:40:38 -0700 Subject: [PATCH 0734/1190] Roll dart to 84ca27a09ebd6a65cd23ee52d835d89cbe06c574. (#5700) * Roll dart to 84ca27a09ebd6a65cd23ee52d835d89cbe06c574. Changes since last roll: ``` 84ca27a09e Fix File::OpenUri on Windows. 5403f654ae Merge existing metadata into new incrementally compiled components. 3cc0a9a230 Another fix for a race in a test. 4aacaeb684 [vm/compiler] Fix handling of exception-throwing instructions in DSE 4ff4620f68 Adjust status lines for safari (take 2) c5c18a0ace Introduce percent decoding in File::OpenUri. 550f294dfc Move some analysis to analyzer-analysis-server-linux and make analyzer-analysis-server-linux a try bot. f5de04f4e1 Apply resolution to directive annotations. 6d328b7fc5 Correctly parse dartdoc before abstract class 25969b2af3 Store resolution for abstract class constructor invocation. 973f73b150 Handle invalid types from front end. bab152a0a9 Fix default in gardening tools 007dcd415d Upgrade package:http to 0.11.3+17. 2519892295 Address a race condition in a test. ed0ccc7ac9 Add more error message mappings f0560a8d66 Add error code ArgumentTypeNotAssignable to improve messaging (issue 33712) 660b8b7700 [fuchsia] Update path to timezone service acd8f345aa Update safari status 4ab082736b [gn] Remove dart_test_bootfs 1c673b1046 Include bounds in type literals 3a1b09dc63 Fix for bug #33660 810cdf8649 Add tests for bug #33660 ac05595889 Memory file system returns Uint8List from readAsBytes d26dba1619 More positions in dart2 constant evaluator eafc52aae7 Add a recovery test 8be1ddbd75 Throw FileSystemException from _FileSystemEntityAdaptor when the file does not exist. 98391f2737 [vm] Refactoring: move StreamingScopeBuilder out of kernel_binary_flowgraph 6dfc4ef663 Remove old dart2analyzer not strong status file entries. 32d208d8b0 Revert "Adjust status lines for safari" 5da24bbec2 Adjust status lines for safari c1f6c9d8c5 Fix dart2js-hostassert configuration and enable it on the CQ 1717371c99 Move InferredData to GlobalTypeInferenceResults 403e7c8022 Use DataComputer class to implement equivalence based tests 5dbf6da529 Remove generics where only ir.Node is used da9705b356 Split compileLoadedLibraries 04168fa922 Move more methods to ClassHierarchy. a4c47afcae Fix global-inference bug. 3e33c3d0fc Eliminate analysis warnings in pkg/ code. 72f3abc239 Fix force-strong flag. e3323ae918 [vm/inliner] Inline typed data on 32-bit archs. f5a3af4fcd [VM] A const bool.fromEnvironment() with an explicit defaultValue of `null` should default to `null` 1a08800dd6 Run analyzer --use-fasta-parser on the language2 tests; update status file. aa6dc1e2d5 [fasta] Resolve redirecting factories invocations after bodies are built 31cd00b12c Mark the analysis server integration tests as slow. 65ee9519d1 Force tests to fail pending implementation. d52555c26e Update the changelog for analyzer changes. d6cf9b471e Deprecate and remove the implementation of an older flag. 609a191115 Basic implementation of MOVE_FILE for files 149c5a0e0e Improve formatting of errors in golden files a600171def Update expectations after parser updates 7570fb86f2 [fasta] Set parent of annotations in BodyBuilder.finishMetadata. e8ff3d596f Deprecate and ignore the --strong flag on dartanalyzer. a5b8ed1299 Have dart2analyzer no longer use the --no-preview-dart-2 flag in test.py. 58e74023c7 Initial attempt to analyze stack traces a07b2a10c6 Changed all warnings to errors in the language specification. 5b5e36f0be Remove use of deprecated methods and constants. 1400cf66e7 Add named configurations to test matrix. 5d2405f112 Update the status file for slow tests. 9871ad23c9 [infra] Move fasta legacy mode SDK tests to their own builder bb69cc15cb Add ClassHierarchy to share code between J/KClosedWorld (second attempt) 148013f9f7 Re-add tests for MOVE_FILE refactoring. 9873f04efc Update service test to not be different in sync async mode dbd97fb8a5 Prep for analyzer 0.32.3, front_end 0.1.3, kernel 0.3.3 6e8332bf77 Remove older analyzer bots. eeb54497cf More slow test status file updates c339846594 [kernel] Move util.dart from bin to lib. 11123b774a Adjust status lines for firefox 620ab34de6 [vm] Implement reading of parameter annotations from kernel 7d7e39a952 [build] Move dart2js run for Observatory from python to GN 3c5fe3c7e4 Prevent npe when constructor cannot be resolved d50fa68176 Update strong status in host-checked mode 6218c0fbb3 Mark analyzer tests as slow. f39eaf937c [vm] Refactoring: remove dependency of StreamingScopeBuilder on StreamingFlowGraphBuilder d5ccb53f01 Remove more uses of isInstanceOf 7007137dd0 Adjustments to dart2js test matrix. 45eee81252 Check another case of StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC. 4c789e9c09 Support the instantiation of abstract constructors d3b4ba3a0b Revert "Fix #32227 export dynamic from dart:core in analyzer." aa93fa1653 Update documentation of --host-checked. afaca9f7cf Use field for class hierarchy map 46bfa7297e Have the regular analyzer bots test in dart 2 mode. 90e9fec5ae Add changelog entry for language change on int literals 8c63d578a6 [vm] Refactoring: move out classes independent of StreamingFlowGraphBuilder aa009339b3 Update test matrix for dart2js 53525542cd Add tests for instance create of an abstract generic class 33f58d5b69 Add dump-info end to end test 98a2e90d4f [vm] Combine internal and external allocation into one allocation limit. 287615986c Resolve arguments and type arguments for unresolved invocations. c99268feb9 Replace handleUnrecoverableError with handleRecoverableError 0ccdc3ec38 Reland: [dart:io] Adds Socket.startConnect c9fd95119d Add file path to ResolutionApplier error message fb762be46a Update dart_style to version 1.1.1 in DEPS db7085a292 Rename UnresolvedTargetInvocation. b803d74c9b Adjusted errors for FutureOr in class headers c407e83d0e Delete duplicate key "configurations" in test_matrix.json b303f5ad86 Add flag --named-configuration (-n) to test.py options. 22b9847cca [analyzer][cfe] Don't crash on converting errors with Severity.context 4fd04044fb Adjusted circularity prevention rule for type variable subtyping 1467909921 Call _completeOnAsyncReturn instead of .complete directly b7b24e9bbe Update dart2js-strong status across several suites 11e001595a Update analysis options files. ed6c09636f Remove old entries from pkg/pkg.status. 30807fe164 [VM interpreter] Fix InterpretCall stub. The stub was marking the thread as executing VM code too early, since the slow path of AllocateArray (called via PushArrayOfArguments) calls into the runtime. With this fix, DeltaBlueClosures can run in fully interpreted mode. 10c13e0e9e - deprecate strong-mode: options - move those settings to the language: options settings - ignore strong-mode: false in the analysis options file 3a22666ba7 Clearing a LinkedHashMap should not do big allocations adb4b4af2c Remove another call to handleUnrecoverableError fd26d67a0b Added getLegacyStats until Chrome fully supports new getStats() API. ``` * Update license hash --- DEPS | 6 +++--- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index d9b1569708509..4d897a8d495ec 100644 --- a/DEPS +++ b/DEPS @@ -31,7 +31,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '64641d014b77bd410e9aa10558522ae26e4210ee', + 'dart_revision': '84ca27a09ebd6a65cd23ee52d835d89cbe06c574', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', @@ -46,7 +46,7 @@ vars = { 'dart_crypto_tag': '2.0.5', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+4', - 'dart_dart_style_tag': '1.1.0', + 'dart_dart_style_tag': '1.1.1', 'dart_dartdoc_tag': 'v0.20.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', @@ -54,7 +54,7 @@ vars = { 'dart_http_multi_server_tag': '2.0.4', 'dart_http_parser_tag': '3.1.1', 'dart_http_retry_tag': '0.1.1', - 'dart_http_tag': '0.11.3+16', + 'dart_http_tag': '0.11.3+17', 'dart_http_throttle_tag': '1.0.2', 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c5e24a324d7c5..4be1f27dfb1e4 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ba36501c9aa5697d9114574434597320 +Signature: c34d2115c40cb3fe6d67ff2a2274d002 UNUSED LICENSES: From 3b6dedb8653c5d1b98faf161936227c07d98c705 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Mon, 9 Jul 2018 16:25:04 -0700 Subject: [PATCH 0735/1190] Add anti-alias switch to canvas clip calls (#5670) This is a reland of #5638. We removed the restoreToCount, made doAntiAlias named, and updated the comments. --- lib/ui/painting.dart | 161 ++++++++++++++++++++------------------ lib/ui/painting/canvas.cc | 13 +-- lib/ui/painting/canvas.h | 7 +- 3 files changed, 95 insertions(+), 86 deletions(-) diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 6adb1902b3a64..348432ec7229f 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -1577,16 +1577,16 @@ enum PathFillType { } /// Strategies for combining paths. -/// +/// /// See also: -/// +/// /// * [Path.combine], which uses this enum to decide how to combine two paths. // Must be kept in sync with SkPathOp enum PathOperation { /// Subtract the second path from the first path. /// /// For example, if the two paths are overlapping circles of equal diameter - /// but differing centers, the result would be a crescent portion of the + /// but differing centers, the result would be a crescent portion of the /// first circle that was not overlapped by the second circle. /// /// See also: @@ -1596,33 +1596,33 @@ enum PathOperation { difference, /// Create a new path that is the intersection of the two paths, leaving the /// overlapping pieces of the path. - /// + /// /// For example, if the two paths are overlapping circles of equal diameter /// but differing centers, the result would be only the overlapping portion /// of the two circles. - /// + /// /// See also: /// * [xor], which is the inverse of this operation intersect, /// Create a new path that is the union (inclusive-or) of the two paths. - /// + /// /// For example, if the two paths are overlapping circles of equal diameter - /// but differing centers, the result would be a figure-eight like shape + /// but differing centers, the result would be a figure-eight like shape /// matching the outer boundaries of both circles. union, - /// Create a new path that is the exclusive-or of the two paths, leaving + /// Create a new path that is the exclusive-or of the two paths, leaving /// everything but the overlapping pieces of the path. - /// + /// /// For example, if the two paths are overlapping circles of equal diameter /// but differing centers, the figure-eight like shape less the overlapping parts - /// + /// /// See also: /// * [intersect], which is the inverse of this operation xor, /// Subtract the first path from the second path. /// /// For example, if the two paths are overlapping circles of equal diameter - /// but differing centers, the result would be a crescent portion of the + /// but differing centers, the result would be a crescent portion of the /// second circle that was not overlapped by the first circle. /// /// See also: @@ -1655,8 +1655,8 @@ class Path extends NativeFieldWrapperClass2 { void _constructor() native 'Path_constructor'; /// Creates a copy of another [Path]. - /// - /// This copy is fast and does not require additional memory unless either + /// + /// This copy is fast and does not require additional memory unless either /// the `source` path or the path returned by this constructor are modified. factory Path.from(Path source) { return source._clone(); @@ -1862,7 +1862,7 @@ class Path extends NativeFieldWrapperClass2 { /// Adds a new subpath that consists of the given `path` offset by the given /// `offset`. - /// + /// /// If `matrix4` is specified, the path will be transformed by this matrix /// after the matrix is translated by the given offset. The matrix is a 4x4 /// matrix stored in column major order. @@ -1878,10 +1878,10 @@ class Path extends NativeFieldWrapperClass2 { } void _addPath(Path path, double dx, double dy) native 'Path_addPath'; void _addPathWithMatrix(Path path, double dx, double dy, Float64List matrix) native 'Path_addPathWithMatrix'; - + /// Adds the given path to this path by extending the current segment of this /// path with the the first segment of the given path. - /// + /// /// If `matrix4` is specified, the path will be transformed by this matrix /// after the matrix is translated by the given `offset`. The matrix is a 4x4 /// matrix stored in column major order. @@ -1937,16 +1937,16 @@ class Path extends NativeFieldWrapperClass2 { Path _transform(Float64List matrix4) native 'Path_transform'; /// Computes the bounding rectangle for this path. - /// + /// /// A path containing only axis-aligned points on the same straight line will /// have no area, and therefore `Rect.isEmpty` will return true for such a /// path. Consider checking `rect.width + rect.height > 0.0` instead, or /// using the [computeMetrics] API to check the path length. - /// + /// /// For many more elaborate paths, the bounds may be inaccurate. For example, /// when a path contains a circle, the points used to compute the bounds are /// the circle's implied control points, which form a square around the circle; - /// if the circle has a transformation applied using [transform] then that + /// if the circle has a transformation applied using [transform] then that /// square is rotated, and the (axis-aligned, non-rotated) bounding box /// therefore ends up grossly overestimating the actual area covered by the /// circle. @@ -1957,9 +1957,9 @@ class Path extends NativeFieldWrapperClass2 { } Float32List _getBounds() native 'Path_getBounds'; - /// Combines the two paths according to the manner specified by the given + /// Combines the two paths according to the manner specified by the given /// `operation`. - /// + /// /// The resulting path will be constructed from non-overlapping contours. The /// curve order is reduced where possible so that cubics may be turned into /// quadratics, and quadratics maybe turned into lines. @@ -1969,13 +1969,13 @@ class Path extends NativeFieldWrapperClass2 { final Path path = new Path(); if (path._op(path1, path2, operation.index)) { return path; - } + } throw new StateError('Path.combine() failed. This may be due an invalid path; in particular, check for NaN values.'); } bool _op(Path path1, Path path2, int operation) native 'Path_op'; /// Creates a [PathMetrics] object for this path. - /// + /// /// If `forceClosed` is set to true, the contours of the path will be measured /// as if they had been closed, even if they were not explicitly closed. PathMetrics computeMetrics({bool forceClosed: false}) { @@ -1984,19 +1984,19 @@ class Path extends NativeFieldWrapperClass2 { } /// The geometric description of a tangent: the angle at a point. -/// +/// /// See also: /// * [PathMetric.getTangentForOffset], which returns the tangent of an offset along a path. class Tangent { /// Creates a [Tangent] with the given values. - /// + /// /// The arguments must not be null. - const Tangent(this.position, this.vector) - : assert(position != null), + const Tangent(this.position, this.vector) + : assert(position != null), assert(vector != null); /// Creates a [Tangent] based on the angle rather than the vector. - /// + /// /// The [vector] is computed to be the unit vector at the given angle, interpreted /// as clockwise radians from the x axis. factory Tangent.fromAngle(Offset position, double angle) { @@ -2004,43 +2004,43 @@ class Tangent { } /// Position of the tangent. - /// + /// /// When used with [PathMetric.getTangentForOffset], this represents the precise /// position that the given offset along the path corresponds to. final Offset position; /// The vector of the curve at [position]. - /// + /// /// When used with [PathMetric.getTangentForOffset], this is the vector of the /// curve that is at the given offset along the path (i.e. the direction of the /// curve at [position]). final Offset vector; /// The direction of the curve at [position]. - /// + /// /// When used with [PathMetric.getTangentForOffset], this is the angle of the /// curve that is the given offset along the path (i.e. the direction of the /// curve at [position]). - /// - /// This value is in radians, with 0.0 meaning pointing along the x axis in + /// + /// This value is in radians, with 0.0 meaning pointing along the x axis in /// the positive x-axis direction, positive numbers pointing downward toward /// the negative y-axis, i.e. in a clockwise direction, and negative numbers - /// pointing upward toward the positive y-axis, i.e. in a counter-clockwise + /// pointing upward toward the positive y-axis, i.e. in a counter-clockwise /// direction. // flip the sign to be consistent with [Path.arcTo]'s `sweepAngle` double get angle => -math.atan2(vector.dy, vector.dx); } /// An iterable collection of [PathMetric] objects describing a [Path]. -/// +/// /// A [PathMetrics] object is created by using the [Path.computeMetrics] method, -/// and represents the path as it stood at the time of the call. Subsequent +/// and represents the path as it stood at the time of the call. Subsequent /// modifications of the path do not affect the [PathMetrics] object. -/// +/// /// Each path metric corresponds to a segment, or contour, of a path. -/// -/// For example, a path consisting of a [Path.lineTo], a [Path.moveTo], and -/// another [Path.lineTo] will contain two contours and thus be represented by +/// +/// For example, a path consisting of a [Path.lineTo], a [Path.moveTo], and +/// another [Path.lineTo] will contain two contours and thus be represented by /// two [PathMetric] objects. /// /// When iterating across a [PathMetrics]' contours, the [PathMetric] objects are only @@ -2048,7 +2048,7 @@ class Tangent { class PathMetrics extends collection.IterableBase { PathMetrics._(Path path, bool forceClosed) : _iterator = new PathMetricIterator._(new PathMetric._(path, forceClosed)); - + final Iterator _iterator; @override @@ -2068,25 +2068,25 @@ class PathMetricIterator implements Iterator { @override bool moveNext() { // PathMetric isn't a normal iterable - it's already initialized to its - // first Path. Should only call _moveNext when done with the first one. + // first Path. Should only call _moveNext when done with the first one. if (_firstTime == true) { _firstTime = false; return true; } else if (_pathMetric?._moveNext() == true) { return true; - } + } _pathMetric = null; return false; } } /// Utilities for measuring a [Path] and extracting subpaths. -/// -/// Iterate over the object returned by [Path.computeMetrics] to obtain +/// +/// Iterate over the object returned by [Path.computeMetrics] to obtain /// [PathMetric] objects. /// /// Once created, metrics will only be valid while the iterator is at the given -/// contour. When the next contour's [PathMetric] is obtained, this object +/// contour. When the next contour's [PathMetric] is obtained, this object /// becomes invalid. class PathMetric extends NativeFieldWrapperClass2 { /// Create a new empty [Path] object. @@ -2098,13 +2098,13 @@ class PathMetric extends NativeFieldWrapperClass2 { /// Computes the position of hte current contour at the given offset, and the /// angle of the path at that point. - /// - /// For example, calling this method with a distance of 1.41 for a line from + /// + /// For example, calling this method with a distance of 1.41 for a line from /// 0.0,0.0 to 2.0,2.0 would give a point 1.0,1.0 and the angle 45 degrees /// (but in radians). - /// + /// /// Returns null if the contour has zero [length]. - /// + /// /// The distance is clamped to the [length] of the current contour. Tangent getTangentForOffset(double distance) { final Float32List posTan = _getPosTan(distance); @@ -2113,24 +2113,24 @@ class PathMetric extends NativeFieldWrapperClass2 { return null; } else { return new Tangent( - new Offset(posTan[1], posTan[2]), - new Offset(posTan[3], posTan[4]) + new Offset(posTan[1], posTan[2]), + new Offset(posTan[3], posTan[4]) ); } } Float32List _getPosTan(double distance) native 'PathMeasure_getPosTan'; /// Given a start and stop distance, return the intervening segment(s). - /// + /// /// `start` and `end` are pinned to legal values (0..[length]) /// Returns null if the segment is 0 length or `start` > `stop`. /// Begin the segment with a moveTo if `startWithMoveTo` is true. Path extractPath(double start, double end, {bool startWithMoveTo: true}) native 'PathMeasure_getSegment'; /// Whether the contour is closed. - /// + /// /// Returns true if the contour ends with a call to [Path.close] (which may - /// have been implied when using [Path.addRect]) or if `forceClosed` was + /// have been implied when using [Path.addRect]) or if `forceClosed` was /// specified as true in the call to [Path.computeMetrics]. Returns false /// otherwise. bool get isClosed native 'PathMeasure_isClosed'; @@ -2139,10 +2139,10 @@ class PathMetric extends NativeFieldWrapperClass2 { // // A path can have a next contour if [Path.moveTo] was called after drawing began. // Return true if one exists, or false. - // + // // This is not exactly congruent with a regular [Iterator.moveNext]. // Typically, [Iterator.moveNext] should be called before accessing the - // [Iterator.current]. In this case, the [PathMetric] is valid before + // [Iterator.current]. In this case, the [PathMetric] is valid before // calling `_moveNext` - `_moveNext` should be called after the first // iteration is done instead of before. bool _moveNext() native 'PathMeasure_nextContour'; @@ -2455,10 +2455,10 @@ class Gradient extends Shader { /// If `matrix4` is provided, the gradient fill will be transformed by the /// specified 4x4 matrix relative to the local coordinate system. `matrix4` must /// be a column-major matrix packed into a list of 16 values. - /// - /// If `focal` is provided and not equal to `center` and `focalRadius` is + /// + /// If `focal` is provided and not equal to `center` and `focalRadius` is /// provided and not equal to 0.0, the generated shader will be a two point - /// conical radial gradient, with `focal` being the center of the focal + /// conical radial gradient, with `focal` being the center of the focal /// circle and `focalRadius` being the radius of that circle. If `focal` is /// provided and not equal to `center`, at least one of the two offsets must /// not be equal to [Offset.zero]. @@ -2518,7 +2518,7 @@ class Gradient extends Shader { /// or if `colors` or `colorStops` contain null values, this constructor will /// throw a [NoSuchMethodError]. /// - /// If `matrix4` is provided, the gradient fill will be transformed by the + /// If `matrix4` is provided, the gradient fill will be transformed by the /// specified 4x4 matrix relative to the local coordinate system. `matrix4` must /// be a column-major matrix packed into a list of 16 values. Gradient.sweep( @@ -2930,50 +2930,57 @@ class Canvas extends NativeFieldWrapperClass2 { /// Reduces the clip region to the intersection of the current clip and the /// given rectangle. /// - /// If the clip is not axis-aligned with the display device, and - /// [Paint.isAntiAlias] is true, then the clip will be anti-aliased. If - /// multiple draw commands intersect with the clip boundary, this can result + /// If [doAntiAlias] is true, then the clip will be anti-aliased. + /// + /// If multiple draw commands intersect with the clip boundary, this can result /// in incorrect blending at the clip boundary. See [saveLayer] for a /// discussion of how to address that. /// /// Use [ClipOp.difference] to subtract the provided rectangle from the /// current clip. - void clipRect(Rect rect, { ClipOp clipOp: ClipOp.intersect }) { + void clipRect(Rect rect, { ClipOp clipOp: ClipOp.intersect, bool doAntiAlias = true }) { assert(_rectIsValid(rect)); assert(clipOp != null); - _clipRect(rect.left, rect.top, rect.right, rect.bottom, clipOp.index); + assert(doAntiAlias != null); + _clipRect(rect.left, rect.top, rect.right, rect.bottom, clipOp.index, doAntiAlias); } void _clipRect(double left, double top, double right, double bottom, - int clipOp) native 'Canvas_clipRect'; + int clipOp, + bool doAntiAlias) native 'Canvas_clipRect'; /// Reduces the clip region to the intersection of the current clip and the /// given rounded rectangle. /// - /// If [Paint.isAntiAlias] is true, then the clip will be anti-aliased. If - /// multiple draw commands intersect with the clip boundary, this can result + /// If [doAntiAlias] is true, then the clip will be anti-aliased. + /// + /// If multiple draw commands intersect with the clip boundary, this can result /// in incorrect blending at the clip boundary. See [saveLayer] for a /// discussion of how to address that and some examples of using [clipRRect]. - void clipRRect(RRect rrect) { + void clipRRect(RRect rrect, {bool doAntiAlias = true}) { assert(_rrectIsValid(rrect)); - _clipRRect(rrect._value); + assert(doAntiAlias != null); + _clipRRect(rrect._value, doAntiAlias); } - void _clipRRect(Float32List rrect) native 'Canvas_clipRRect'; + void _clipRRect(Float32List rrect, bool doAntiAlias) native 'Canvas_clipRRect'; /// Reduces the clip region to the intersection of the current clip and the /// given [Path]. /// - /// If [Paint.isAntiAlias] is true, then the clip will be anti-aliased. If + /// If [doAntiAlias] is true, then the clip will be anti-aliased. + /// + /// If multiple draw commands intersect with the clip boundary, this can result /// multiple draw commands intersect with the clip boundary, this can result /// in incorrect blending at the clip boundary. See [saveLayer] for a /// discussion of how to address that. - void clipPath(Path path) { + void clipPath(Path path, {bool doAntiAlias = true}) { assert(path != null); // path is checked on the engine side - _clipPath(path); + assert(doAntiAlias != null); + _clipPath(path, doAntiAlias); } - void _clipPath(Path path) native 'Canvas_clipPath'; + void _clipPath(Path path, bool doAntiAlias) native 'Canvas_clipPath'; /// Paints the given [Color] onto the canvas, applying the given /// [BlendMode], with the given color being the source and the background @@ -3453,7 +3460,7 @@ class Picture extends NativeFieldWrapperClass2 { void dispose() native 'Picture_dispose'; /// Returns the approximate number of bytes allocated for this object. - /// + /// /// The actual size of this picture may be larger, particularly if it contains /// references to image or other large objects. int get approximateBytesUsed native 'Picture_GetAllocationSize'; diff --git a/lib/ui/painting/canvas.cc b/lib/ui/painting/canvas.cc index 7bfeb5cfdda9e..30687c3442ce8 100644 --- a/lib/ui/painting/canvas.cc +++ b/lib/ui/painting/canvas.cc @@ -160,25 +160,26 @@ void Canvas::clipRect(double left, double top, double right, double bottom, - SkClipOp clipOp) { + SkClipOp clipOp, + bool doAntiAlias) { if (!canvas_) return; - canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom), clipOp, true); + canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom), clipOp, doAntiAlias); } -void Canvas::clipRRect(const RRect& rrect) { +void Canvas::clipRRect(const RRect& rrect, bool doAntiAlias) { if (!canvas_) return; - canvas_->clipRRect(rrect.sk_rrect, true); + canvas_->clipRRect(rrect.sk_rrect, doAntiAlias); } -void Canvas::clipPath(const CanvasPath* path) { +void Canvas::clipPath(const CanvasPath* path, bool doAntiAlias) { if (!canvas_) return; if (!path) Dart_ThrowException( ToDart("Canvas.clipPath called with non-genuine Path.")); - canvas_->clipPath(path->path(), true); + canvas_->clipPath(path->path(), doAntiAlias); } void Canvas::drawColor(SkColor color, SkBlendMode blend_mode) { diff --git a/lib/ui/painting/canvas.h b/lib/ui/painting/canvas.h index 03dfe618f454d..e7d875ac4bf76 100644 --- a/lib/ui/painting/canvas.h +++ b/lib/ui/painting/canvas.h @@ -60,9 +60,10 @@ class Canvas : public fxl::RefCountedThreadSafe, double top, double right, double bottom, - SkClipOp clipOp); - void clipRRect(const RRect& rrect); - void clipPath(const CanvasPath* path); + SkClipOp clipOp, + bool doAntiAlias = true); + void clipRRect(const RRect& rrect, bool doAntiAlias = true); + void clipPath(const CanvasPath* path, bool doAntiAlias = true); void drawColor(SkColor color, SkBlendMode blend_mode); void drawLine(double x1, From ad419728038a63797238c250d9ccb3526e18403c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 9 Jul 2018 21:30:39 -0400 Subject: [PATCH 0736/1190] Roll src/third_party/skia 8fe31406e980..e0a9962b12ad (3 commits) (#5703) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4d897a8d495ec..1270a69c7aba5 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8fe31406e98062af447ff1e0511ab9bbdeed7638', + 'skia_revision': 'e0a9962b12adf6c1d17e76fbbb498d9c0260d924', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4be1f27dfb1e4..f4c3fb53c643d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c34d2115c40cb3fe6d67ff2a2274d002 +Signature: 2fabcb820a598ef9533a60888b88fe93 UNUSED LICENSES: @@ -5640,8 +5640,12 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.h FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h FILE: ../../../third_party/dart/runtime/vm/datastream.cc FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h From 2981cc7a311cfb172da991a9d7d00829ec98a2c0 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 10 Jul 2018 00:54:39 -0400 Subject: [PATCH 0737/1190] Roll src/third_party/skia e0a9962b12ad..6d98257725b5 (1 commits) (#5704) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 1270a69c7aba5..866e659941d2b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e0a9962b12adf6c1d17e76fbbb498d9c0260d924', + 'skia_revision': '6d98257725b59e01a1a844b1b9c9e80912512b49', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f4c3fb53c643d..b803b14da8244 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2fabcb820a598ef9533a60888b88fe93 +Signature: 0192513304a35ca466c6329255d8a136 UNUSED LICENSES: From cb27dab2bdb862cea4f350fa224ec4ec8b054075 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 10 Jul 2018 09:51:50 -0400 Subject: [PATCH 0738/1190] Roll src/third_party/skia 6d98257725b5..418e658a6922 (1 commits) (#5706) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 866e659941d2b..64572e46204fb 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6d98257725b59e01a1a844b1b9c9e80912512b49', + 'skia_revision': '418e658a6922923f8d1e1ce2cf00f0a0f6b18ff3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b803b14da8244..8a43e859a6eaf 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0192513304a35ca466c6329255d8a136 +Signature: f3b84ee0a632c415a95560b364a472ad UNUSED LICENSES: From 4945624420732831f395a70eab5857511bb4f4c9 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 10 Jul 2018 13:17:50 -0400 Subject: [PATCH 0739/1190] Roll src/third_party/skia 418e658a6922..1d784ceafa9e (10 commits) (#5707) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 64572e46204fb..a9973b5405452 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '418e658a6922923f8d1e1ce2cf00f0a0f6b18ff3', + 'skia_revision': '1d784ceafa9e0f3e32ef341900bc349f90abb81d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8a43e859a6eaf..d4e626c83ac55 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f3b84ee0a632c415a95560b364a472ad +Signature: e375cb1a3cb54ba7249a38b8e7077dd9 UNUSED LICENSES: From 6db0cc9da033379b73bd7dedc31d87ad121b4b33 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 10 Jul 2018 16:44:51 -0400 Subject: [PATCH 0740/1190] Roll src/third_party/skia 1d784ceafa9e..c69c4410be7d (13 commits) (#5709) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a9973b5405452..780f1ac7a11ed 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1d784ceafa9e0f3e32ef341900bc349f90abb81d', + 'skia_revision': 'c69c4410be7def8fa129496de994d83c497f06db', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d4e626c83ac55..606581a211f4f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e375cb1a3cb54ba7249a38b8e7077dd9 +Signature: 6c491b62819c4a5c79e0d3053d20e4f5 UNUSED LICENSES: From 958d2cfc58396281315e729d0adb27bcebad24fe Mon Sep 17 00:00:00 2001 From: liyuqian Date: Tue, 10 Jul 2018 14:26:14 -0700 Subject: [PATCH 0741/1190] Remove trailing white spaces (#5708) So our future pull requests won't be polluted by the white space changes. --- lib/ui/compositing.dart | 4 ++-- lib/ui/painting/path.h | 12 ++++++------ lib/ui/semantics.dart | 2 +- lib/ui/text.dart | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/ui/compositing.dart b/lib/ui/compositing.dart index e0be1a66fdaf8..35595f4cf685f 100644 --- a/lib/ui/compositing.dart +++ b/lib/ui/compositing.dart @@ -145,14 +145,14 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// /// Rasterization will be clipped to the given shape defined by [path]. If /// [elevation] is greater than 0.0, then a shadow is drawn around the layer. - /// [shadowColor] defines the color of the shadow if present and [color] defines the + /// [shadowColor] defines the color of the shadow if present and [color] defines the /// color of the layer background. /// /// See [pop] for details about the operation stack. void pushPhysicalShape({ Path path, double elevation, Color color, Color shadowColor}) { _pushPhysicalShape(path, elevation, color.value, shadowColor?.value ?? 0xFF000000); } - void _pushPhysicalShape(Path path, double elevation, int color, int shadowColor) native + void _pushPhysicalShape(Path path, double elevation, int color, int shadowColor) native 'SceneBuilder_pushPhysicalShape'; /// Ends the effect of the most recently pushed operation. diff --git a/lib/ui/painting/path.h b/lib/ui/painting/path.h index afe670b72ff20..69ba8d9099912 100644 --- a/lib/ui/painting/path.h +++ b/lib/ui/painting/path.h @@ -85,14 +85,14 @@ class CanvasPath : public fxl::RefCountedThreadSafe, void addPolygon(const tonic::Float32List& points, bool close); void addRRect(const RRect& rrect); void addPath(CanvasPath* path, double dx, double dy); - void addPathWithMatrix(CanvasPath* path, - double dx, - double dy, + void addPathWithMatrix(CanvasPath* path, + double dx, + double dy, tonic::Float64List& matrix4); void extendWithPath(CanvasPath* path, double dx, double dy); - void extendWithPathAndMatrix(CanvasPath* path, - double dx, - double dy, + void extendWithPathAndMatrix(CanvasPath* path, + double dx, + double dy, tonic::Float64List& matrix4); void close(); void reset(); diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 7d00f6ac8e5fc..86f6d04abb09d 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -441,7 +441,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { /// length and contain the same ids. They may only differ in the order the /// ids are listed in. For more information about different child orders, see /// [DebugSemanticsDumpOrder]. - /// + /// /// The system retains the nodes that are currently reachable from the root. /// A given update need not contain information for nodes that do not change /// in the update. If a node is not reachable from the root after an update, diff --git a/lib/ui/text.dart b/lib/ui/text.dart index a98b2414e6d3b..766fe9ced98a8 100644 --- a/lib/ui/text.dart +++ b/lib/ui/text.dart @@ -359,7 +359,7 @@ class TextStyle { Locale locale, Paint background, Paint foreground, - }) : assert(color == null || foreground == null, + }) : assert(color == null || foreground == null, 'Cannot provide both a color and a foreground\n' 'The color argument is just a shorthand for "foreground: new Paint()..color = color".' ), From fed2ea458ed49088d33eddabc546ba56d600c717 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 10 Jul 2018 16:57:23 -0700 Subject: [PATCH 0742/1190] Revert "Remove vmservice_io.main from entry points. (#5625)" (#5711) This caused failures in Flutter microbenchmarks. See: flutter/flutter#19096 and flutter/flutter#19210 This reverts commit 4466d61a993fdbde2cb092b4da9bbef33d1962fe. --- runtime/dart_vm_entry_points.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/dart_vm_entry_points.txt b/runtime/dart_vm_entry_points.txt index d2d6a675be2b6..fabbf37bed1df 100644 --- a/runtime/dart_vm_entry_points.txt +++ b/runtime/dart_vm_entry_points.txt @@ -43,3 +43,4 @@ dart:ui,SemanticsUpdate,SemanticsUpdate._ dart:ui,SemanticsUpdateBuilder,SemanticsUpdateBuilder. dart:ui,Shader,Shader._ dart:ui,TextBox,TextBox._ +dart:vmservice_io,::,main From a47d2efe9edd631752078df1a46904e099ff8dc3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 10 Jul 2018 20:09:50 -0400 Subject: [PATCH 0743/1190] Roll src/third_party/skia c69c4410be7d..36fe60d19ad9 (8 commits) (#5712) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 780f1ac7a11ed..2162515fb4114 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c69c4410be7def8fa129496de994d83c497f06db', + 'skia_revision': '36fe60d19ad9412fe4b8d92ecd36bf6b59f5269a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 606581a211f4f..ad5e704ef2af1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6c491b62819c4a5c79e0d3053d20e4f5 +Signature: 5652b6ba92413fad107102b13ac1bfe5 UNUSED LICENSES: From 4b310f36583b0e42afe82f16b9be67a4bdad7ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=91=E6=9D=B0?= Date: Wed, 11 Jul 2018 08:12:57 +0800 Subject: [PATCH 0744/1190] Implement UniqueFDTraits::Free on non-win system (#5705) --- fml/unique_fd.cc | 2 +- fml/unique_fd.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fml/unique_fd.cc b/fml/unique_fd.cc index 90c3aaa21ef15..45fd7613086e1 100644 --- a/fml/unique_fd.cc +++ b/fml/unique_fd.cc @@ -24,7 +24,7 @@ void UniqueFDTraits::Free(HANDLE fd) { namespace unix { void UniqueFDTraits::Free(int fd) { - FML_IGNORE_EINTR(fd); + close(fd); } } // namespace unix diff --git a/fml/unique_fd.h b/fml/unique_fd.h index 48dd3544e43f5..ac5b983bc8c77 100644 --- a/fml/unique_fd.h +++ b/fml/unique_fd.h @@ -12,6 +12,10 @@ #include +#else // OS_WIN + +#include + #endif // OS_WIN namespace fml { From e1c0dcd210a6f890f370deac40fc5eac630f3cd7 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 10 Jul 2018 17:26:17 -0700 Subject: [PATCH 0745/1190] update license (#5710) --- sky/packages/sky_engine/LICENSE | 754 ++++++++++++++++---------------- 1 file changed, 382 insertions(+), 372 deletions(-) diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 612ebfe44b0f0..92565ae3afb8f 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -2170,37 +2170,6 @@ OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -Copyright 2003 Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - Copyright 2005 Nokia. All rights reserved. The portions of the attached software ("Contribution") is developed by @@ -2228,69 +2197,25 @@ OTHERWISE. -------------------------------------------------------------------------------- boringssl -Copyright 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2006, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy @@ -2299,38 +2224,17 @@ https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2007, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2012, Intel Corporation. All Rights Reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy @@ -2339,281 +2243,68 @@ https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2008 Google Inc. -All Rights Reserved. +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2014, Intel Corporation. All Rights Reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Copyright 2016 Brian Smith. - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- boringssl -Copyright 2009 Google Inc. -All Rights Reserved. +The MIT License (MIT) -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -------------------------------------------------------------------------------- boringssl +dart -Copyright 2009 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2009, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2012, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2014, Intel Corporation. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2015, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl - -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl - -Copyright 2016 Brian Smith. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -boringssl - -The MIT License (MIT) - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. --------------------------------------------------------------------------------- -boringssl -dart - -OpenSSL License +OpenSSL License ==================================================================== Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. @@ -2786,6 +2477,325 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2003 Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2005, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2006, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2007, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2008 Google Inc. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2008, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2009 Google Inc. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2009 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2009, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl +gtest + +Copyright 2015, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR From e89d843497c15d9c1c24fd647a1da71f5575aedf Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 10 Jul 2018 17:36:31 -0700 Subject: [PATCH 0746/1190] Swap definitions of SystemChrome apis to match iOS (requires framework change when rolling) (#5609) --- .../io/flutter/plugin/platform/PlatformPlugin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index b05ffe5ec82b4..9268694434832 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java @@ -237,11 +237,11 @@ private void setSystemChromeSystemUIOverlayStyle(JSONObject message) { if (!message.isNull("systemNavigationBarIconBrightness")) { String systemNavigationBarIconBrightness = message.getString("systemNavigationBarIconBrightness"); switch (systemNavigationBarIconBrightness) { - case "Brightness.dark": + case "Brightness.light": //View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR flags |= 0x10; break; - case "Brightness.light": + case "Brightness.dark": flags &= ~0x10; break; } @@ -255,11 +255,11 @@ private void setSystemChromeSystemUIOverlayStyle(JSONObject message) { if (!message.isNull("statusBarIconBrightness")) { String statusBarIconBrightness = message.getString("statusBarIconBrightness"); switch (statusBarIconBrightness) { - case "Brightness.dark": + case "Brightness.light": // View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR flags |= 0x2000; break; - case "Brightness.light": + case "Brightness.dark": flags &= ~0x2000; break; } From a796e89cbdac1de5ad313fb50e55a1dd30df8c4f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 10 Jul 2018 23:32:50 -0400 Subject: [PATCH 0747/1190] Roll src/third_party/skia 36fe60d19ad9..e8d674dd7cef (1 commits) (#5715) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 790 ++++++++++---------- travis/licenses_golden/licenses_third_party | 2 +- 3 files changed, 392 insertions(+), 402 deletions(-) diff --git a/DEPS b/DEPS index 2162515fb4114..0cc099318a524 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '36fe60d19ad9412fe4b8d92ecd36bf6b59f5269a', + 'skia_revision': 'e8d674dd7cef56b6e568c1b46961770c13b19fa2', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 92565ae3afb8f..612ebfe44b0f0 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -2170,6 +2170,37 @@ OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl +Copyright 2003 Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + Copyright 2005 Nokia. All rights reserved. The portions of the attached software ("Contribution") is developed by @@ -2197,44 +2228,69 @@ OTHERWISE. -------------------------------------------------------------------------------- boringssl -Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2005, Google Inc. +All rights reserved. -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2006, Google Inc. +All rights reserved. -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html --------------------------------------------------------------------------------- -boringssl +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2012, Intel Corporation. All Rights Reserved. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy @@ -2243,17 +2299,38 @@ https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. -Copyright (c) 2014, Intel Corporation. All Rights Reserved. +Copyright 2007, Google Inc. +All rights reserved. -Licensed under the OpenSSL license (the "License"). You may not use -this file except in compliance with the License. You can obtain a copy -in the file LICENSE in the source distribution or at -https://www.openssl.org/source/license.html +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy @@ -2262,68 +2339,300 @@ https://www.openssl.org/source/license.html -------------------------------------------------------------------------------- boringssl -Copyright 2016 Brian Smith. +Copyright 2008 Google Inc. +All Rights Reserved. -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION -OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN -CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -The MIT License (MIT) - -Copyright (c) 2015-2016 the fiat-crypto authors (see -https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). +Copyright 2008, Google Inc. +All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- boringssl -dart - -OpenSSL License - - ==================================================================== - Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: +Copyright 2009 Google Inc. +All Rights Reserved. - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009 Google Inc. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2009, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2012, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2014, Intel Corporation. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2015, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +boringssl + +Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + +Licensed under the OpenSSL license (the "License"). You may not use +this file except in compliance with the License. You can obtain a copy +in the file LICENSE in the source distribution or at +https://www.openssl.org/source/license.html +-------------------------------------------------------------------------------- +boringssl + +Copyright 2016 Brian Smith. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-------------------------------------------------------------------------------- +boringssl + +The MIT License (MIT) + +Copyright (c) 2015-2016 the fiat-crypto authors (see +https://github.com/mit-plv/fiat-crypto/blob/master/AUTHORS). + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +-------------------------------------------------------------------------------- +boringssl +dart + +OpenSSL License + + ==================================================================== + Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to @@ -2477,325 +2786,6 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2003 Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2006, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2007, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2008 Google Inc. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2009 Google Inc. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2009 Google Inc. All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2009, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --------------------------------------------------------------------------------- -boringssl -gtest - -Copyright 2015, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ad5e704ef2af1..a199102b5de3a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5652b6ba92413fad107102b13ac1bfe5 +Signature: d20eb66c057c8dd5ac9453a85a6c008e UNUSED LICENSES: From 0b56ccda125618842ae5c98cbddcb782e87bd0f5 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 11 Jul 2018 02:47:50 -0400 Subject: [PATCH 0748/1190] Roll src/third_party/skia e8d674dd7cef..61cc9fabf255 (1 commits) (#5716) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 0cc099318a524..5f94d8c1a34d5 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e8d674dd7cef56b6e568c1b46961770c13b19fa2', + 'skia_revision': '61cc9fabf2554ae628c837a4bc486698ba574628', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 2e26cd3dea22a0a7d781f24d021125c9fadef1a8 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 11 Jul 2018 06:11:50 -0400 Subject: [PATCH 0749/1190] Roll src/third_party/skia 61cc9fabf255..2229b76258f7 (1 commits) (#5717) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5f94d8c1a34d5..eeb1199f46cc5 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '61cc9fabf2554ae628c837a4bc486698ba574628', + 'skia_revision': '2229b76258f70b1be76b8fdd1cfc868bd507bbd0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a199102b5de3a..acaa55a48611e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d20eb66c057c8dd5ac9453a85a6c008e +Signature: 52088928bcb0c0202199877dca519401 UNUSED LICENSES: From 110a45a0cab5f96cec2692bd3660daf5314b0511 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 11 Jul 2018 10:10:50 -0400 Subject: [PATCH 0750/1190] Roll src/third_party/skia 2229b76258f7..4ec72f7cc745 (1 commits) (#5718) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index eeb1199f46cc5..9ae8493ece1e7 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2229b76258f70b1be76b8fdd1cfc868bd507bbd0', + 'skia_revision': '4ec72f7cc745bbd98a0ae0d160e774ce8ad1a1ff', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index acaa55a48611e..8d2664a2291b8 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 52088928bcb0c0202199877dca519401 +Signature: 1e7a2c73d6034f63fa374cd00dce31b1 UNUSED LICENSES: From 48d6e1f891576f52e3bbc2965c72f879759cf495 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 11 Jul 2018 10:27:50 -0700 Subject: [PATCH 0751/1190] Custom accessibility (local context) action support for iOS and Android. (#5597) --- lib/ui/BUILD.gn | 2 + lib/ui/semantics.dart | 24 +++++++ .../semantics/custom_accessibility_action.cc | 13 ++++ .../semantics/custom_accessibility_action.h | 35 +++++++++ lib/ui/semantics/semantics_node.h | 2 + lib/ui/semantics/semantics_update.cc | 14 ++-- lib/ui/semantics/semantics_update.h | 10 ++- lib/ui/semantics/semantics_update_builder.cc | 20 ++++-- lib/ui/semantics/semantics_update_builder.h | 7 +- runtime/runtime_controller.cc | 2 +- runtime/runtime_delegate.h | 4 +- shell/common/engine.cc | 5 +- shell/common/engine.h | 7 +- shell/common/platform_view.cc | 3 +- shell/common/platform_view.h | 4 +- shell/common/shell.cc | 7 +- shell/common/shell.h | 4 +- .../io/flutter/view/AccessibilityBridge.java | 72 ++++++++++++++++++- .../io/flutter/view/FlutterNativeView.java | 7 ++ .../android/io/flutter/view/FlutterView.java | 11 +++ .../platform/android/platform_view_android.cc | 42 +++++++++-- .../platform/android/platform_view_android.h | 3 +- .../android/platform_view_android_jni.cc | 17 +++++ .../android/platform_view_android_jni.h | 5 ++ .../framework/Source/accessibility_bridge.h | 19 ++++- .../framework/Source/accessibility_bridge.mm | 47 +++++++++++- shell/platform/darwin/ios/platform_view_ios.h | 3 +- .../platform/darwin/ios/platform_view_ios.mm | 5 +- travis/licenses_golden/licenses_flutter | 2 + 29 files changed, 361 insertions(+), 35 deletions(-) create mode 100644 lib/ui/semantics/custom_accessibility_action.cc create mode 100644 lib/ui/semantics/custom_accessibility_action.h diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index c8f7e1fb21db4..8526070f9b1e2 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -58,6 +58,8 @@ source_set("ui") { "semantics/semantics_update.h", "semantics/semantics_update_builder.cc", "semantics/semantics_update_builder.h", + "semantics/custom_accessibility_action.cc", + "semantics/custom_accessibility_action.h", "text/asset_manager_font_provider.cc", "text/asset_manager_font_provider.h", "text/font_collection.cc", diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 86f6d04abb09d..174b21ae8d25a 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -26,6 +26,7 @@ class SemanticsAction { static const int _kPasteIndex = 1 << 14; static const int _kDidGainAccessibilityFocusIndex = 1 << 15; static const int _kDidLoseAccessibilityFocusIndex = 1 << 16; + static const int _kCustomAction = 1 << 17; /// The numerical value for this action. /// @@ -146,6 +147,12 @@ class SemanticsAction { /// Accessibility focus and input focus can be held by two different nodes! static const SemanticsAction didLoseAccessibilityFocus = const SemanticsAction._(_kDidLoseAccessibilityFocusIndex); + /// Indicates that the user has invoked a custom accessibility action. + /// + /// This handler is added automatically whenever a custom accessibility + /// action is added to a semantics node. + static const SemanticsAction customAction = const SemanticsAction._(_kCustomAction); + /// The possible semantics actions. /// /// The map's key is the [index] of the action and the value is the action @@ -168,6 +175,7 @@ class SemanticsAction { _kPasteIndex: paste, _kDidGainAccessibilityFocusIndex: didGainAccessibilityFocus, _kDidLoseAccessibilityFocusIndex: didLoseAccessibilityFocus, + _kCustomAction: customAction, }; @override @@ -207,6 +215,8 @@ class SemanticsAction { return 'SemanticsAction.didGainAccessibilityFocus'; case _kDidLoseAccessibilityFocusIndex: return 'SemanticsAction.didLoseAccessibilityFocus'; + case _kCustomAction: + return 'SemanticsAction.customAction'; } return null; } @@ -498,6 +508,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { Float64List transform, Int32List childrenInTraversalOrder, Int32List childrenInHitTestOrder, + Int32List customAcccessibilityActions, }) { if (transform.length != 16) throw new ArgumentError('transform argument must have 16 entries.'); @@ -523,6 +534,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { transform, childrenInTraversalOrder, childrenInHitTestOrder, + customAcccessibilityActions, ); } void _updateNode( @@ -547,8 +559,20 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { Float64List transform, Int32List childrenInTraversalOrder, Int32List childrenInHitTestOrder, + Int32List customAcccessibilityActions, ) native 'SemanticsUpdateBuilder_updateNode'; + /// Update the custom accessibility action associated with the given `id`. + /// + /// The name of the action exposed to the user is the `label`. The text + /// direction of this label is the same as the global window. + void updateCustomAction({int id, String label}) { + assert(id != null); + assert(label != null && label != ''); + _updateCustomAction(id, label); + } + void _updateCustomAction(int id, String label) native 'SemanticsUpdateBuilder_updateAction'; + /// Creates a [SemanticsUpdate] object that encapsulates the updates recorded /// by this object. /// diff --git a/lib/ui/semantics/custom_accessibility_action.cc b/lib/ui/semantics/custom_accessibility_action.cc new file mode 100644 index 0000000000000..7f404e817027c --- /dev/null +++ b/lib/ui/semantics/custom_accessibility_action.cc @@ -0,0 +1,13 @@ +// 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. + +#include "flutter/lib/ui/semantics/custom_accessibility_action.h" + +namespace blink { + +CustomAccessibilityAction::CustomAccessibilityAction() = default; + +CustomAccessibilityAction::~CustomAccessibilityAction() = default; + +} diff --git a/lib/ui/semantics/custom_accessibility_action.h b/lib/ui/semantics/custom_accessibility_action.h new file mode 100644 index 0000000000000..9ccfd4839fdfc --- /dev/null +++ b/lib/ui/semantics/custom_accessibility_action.h @@ -0,0 +1,35 @@ +// 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. + +#ifndef FLUTTER_LIB_UI_SEMANTICS_CUSTOM_ACCESSIBILITY_ACTION_H_ +#define FLUTTER_LIB_UI_SEMANTICS_CUSTOM_ACCESSIBILITY_ACTION_H_ + +#include "lib/tonic/dart_wrappable.h" +#include "lib/tonic/typed_data/float64_list.h" +#include "lib/tonic/typed_data/int32_list.h" +#include "lib/tonic/dart_library_natives.h" + +namespace blink { + +/// A custom accessibility action is used to indicate additional semantics +/// actions that a user can perform on a semantics node beyond the +/// preconfigured options. +struct CustomAccessibilityAction { + CustomAccessibilityAction(); + ~CustomAccessibilityAction(); + + int32_t id = 0; + std::string label; +}; + + +// Contains custom accessibility actions that need to be updated. +// +// The keys in the map are stable action IDs, and the values contain +// semantic information for the action corresponding to that id. +using CustomAccessibilityActionUpdates = std::unordered_map; + +} // namespace blink + +#endif //FLUTTER_LIB_UI_SEMANTICS_LOCAL_CONTEXT_ACTION_H_ diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index 3ddb431e90dc8..e0ae2ba296c69 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -35,6 +35,7 @@ enum class SemanticsAction : int32_t { kPaste = 1 << 14, kDidGainAccessibilityFocus = 1 << 15, kDidLoseAccessibilityFocus = 1 << 16, + kCustomAction = 1 << 17, }; const int kScrollableSemanticsActions = @@ -87,6 +88,7 @@ struct SemanticsNode { SkMatrix44 transform = SkMatrix44(SkMatrix44::kIdentity_Constructor); std::vector childrenInTraversalOrder; std::vector childrenInHitTestOrder; + std::vector customAccessibilityActions; }; // Contains semantic nodes that need to be updated. diff --git a/lib/ui/semantics/semantics_update.cc b/lib/ui/semantics/semantics_update.cc index fdc796e937b93..4905d95f77469 100644 --- a/lib/ui/semantics/semantics_update.cc +++ b/lib/ui/semantics/semantics_update.cc @@ -21,12 +21,14 @@ IMPLEMENT_WRAPPERTYPEINFO(ui, SemanticsUpdate); DART_BIND_ALL(SemanticsUpdate, FOR_EACH_BINDING) fxl::RefPtr SemanticsUpdate::create( - SemanticsNodeUpdates nodes) { - return fxl::MakeRefCounted(std::move(nodes)); + SemanticsNodeUpdates nodes, + CustomAccessibilityActionUpdates actions) { + return fxl::MakeRefCounted(std::move(nodes), std::move(actions)); } -SemanticsUpdate::SemanticsUpdate(SemanticsNodeUpdates nodes) - : nodes_(std::move(nodes)) {} +SemanticsUpdate::SemanticsUpdate(SemanticsNodeUpdates nodes, + CustomAccessibilityActionUpdates actions) + : nodes_(std::move(nodes)), actions_(std::move(actions)) {} SemanticsUpdate::~SemanticsUpdate() = default; @@ -34,6 +36,10 @@ SemanticsNodeUpdates SemanticsUpdate::takeNodes() { return std::move(nodes_); } +CustomAccessibilityActionUpdates SemanticsUpdate::takeActions() { + return std::move(actions_); +} + void SemanticsUpdate::dispose() { ClearDartWrapper(); } diff --git a/lib/ui/semantics/semantics_update.h b/lib/ui/semantics/semantics_update.h index dbea854e4a002..f6773239f41e6 100644 --- a/lib/ui/semantics/semantics_update.h +++ b/lib/ui/semantics/semantics_update.h @@ -6,6 +6,7 @@ #define FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_H_ #include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/semantics/custom_accessibility_action.h" #include "lib/tonic/dart_wrappable.h" namespace tonic { @@ -21,18 +22,23 @@ class SemanticsUpdate : public fxl::RefCountedThreadSafe, public: ~SemanticsUpdate() override; - static fxl::RefPtr create(SemanticsNodeUpdates nodes); + static fxl::RefPtr create(SemanticsNodeUpdates nodes, + CustomAccessibilityActionUpdates actions); SemanticsNodeUpdates takeNodes(); + CustomAccessibilityActionUpdates takeActions(); + void dispose(); static void RegisterNatives(tonic::DartLibraryNatives* natives); private: - explicit SemanticsUpdate(SemanticsNodeUpdates nodes); + explicit SemanticsUpdate(SemanticsNodeUpdates nodes, + CustomAccessibilityActionUpdates updates); SemanticsNodeUpdates nodes_; + CustomAccessibilityActionUpdates actions_; }; } // namespace blink diff --git a/lib/ui/semantics/semantics_update_builder.cc b/lib/ui/semantics/semantics_update_builder.cc index 576967525b495..c39423a358a0a 100644 --- a/lib/ui/semantics/semantics_update_builder.cc +++ b/lib/ui/semantics/semantics_update_builder.cc @@ -17,8 +17,9 @@ static void SemanticsUpdateBuilder_constructor(Dart_NativeArguments args) { IMPLEMENT_WRAPPERTYPEINFO(ui, SemanticsUpdateBuilder); -#define FOR_EACH_BINDING(V) \ - V(SemanticsUpdateBuilder, updateNode) \ +#define FOR_EACH_BINDING(V) \ + V(SemanticsUpdateBuilder, updateNode) \ + V(SemanticsUpdateBuilder, updateCustomAction) \ V(SemanticsUpdateBuilder, build) FOR_EACH_BINDING(DART_NATIVE_CALLBACK) @@ -54,7 +55,8 @@ void SemanticsUpdateBuilder::updateNode(int id, int textDirection, const tonic::Float64List& transform, const tonic::Int32List& childrenInTraversalOrder, - const tonic::Int32List& childrenInHitTestOrder) { + const tonic::Int32List& childrenInHitTestOrder, + const tonic::Int32List& localContextActions) { SemanticsNode node; node.id = id; node.flags = flags; @@ -76,11 +78,21 @@ void SemanticsUpdateBuilder::updateNode(int id, childrenInTraversalOrder.data(), childrenInTraversalOrder.data() + childrenInTraversalOrder.num_elements()); node.childrenInHitTestOrder = std::vector( childrenInHitTestOrder.data(), childrenInHitTestOrder.data() + childrenInHitTestOrder.num_elements()); + node.customAccessibilityActions = std::vector( + localContextActions.data(), localContextActions.data() + localContextActions.num_elements()); nodes_[id] = node; } +void SemanticsUpdateBuilder::updateCustomAction(int id, + std::string label) { + CustomAccessibilityAction action; + action.id = id; + action.label = label; + actions_[id] = action; +} + fxl::RefPtr SemanticsUpdateBuilder::build() { - return SemanticsUpdate::create(std::move(nodes_)); + return SemanticsUpdate::create(std::move(nodes_), std::move(actions_)); } } // namespace blink diff --git a/lib/ui/semantics/semantics_update_builder.h b/lib/ui/semantics/semantics_update_builder.h index c4d4b277816dd..dca0f0beaca91 100644 --- a/lib/ui/semantics/semantics_update_builder.h +++ b/lib/ui/semantics/semantics_update_builder.h @@ -45,7 +45,11 @@ class SemanticsUpdateBuilder int textDirection, const tonic::Float64List& transform, const tonic::Int32List& childrenInTraversalOrder, - const tonic::Int32List& childrenInHitTestOrder); + const tonic::Int32List& childrenInHitTestOrder, + const tonic::Int32List& customAccessibilityActions); + + void updateCustomAction(int id, + std::string label); fxl::RefPtr build(); @@ -55,6 +59,7 @@ class SemanticsUpdateBuilder explicit SemanticsUpdateBuilder(); SemanticsNodeUpdates nodes_; + CustomAccessibilityActionUpdates actions_; }; } // namespace blink diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index c1acc813f320c..5ef6e5a0a0305 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -240,7 +240,7 @@ void RuntimeController::Render(Scene* scene) { void RuntimeController::UpdateSemantics(SemanticsUpdate* update) { if (window_data_.semantics_enabled) { - client_.UpdateSemantics(update->takeNodes()); + client_.UpdateSemantics(update->takeNodes(), update->takeActions()); } } diff --git a/runtime/runtime_delegate.h b/runtime/runtime_delegate.h index 75e89e62e44ef..463ebbbd2807d 100644 --- a/runtime/runtime_delegate.h +++ b/runtime/runtime_delegate.h @@ -10,6 +10,7 @@ #include "flutter/flow/layers/layer_tree.h" #include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/semantics/custom_accessibility_action.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/window/platform_message.h" #include "third_party/dart/runtime/include/dart_api.h" @@ -24,7 +25,8 @@ class RuntimeDelegate { virtual void Render(std::unique_ptr layer_tree) = 0; - virtual void UpdateSemantics(blink::SemanticsNodeUpdates update) = 0; + virtual void UpdateSemantics(blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) = 0; virtual void HandlePlatformMessage(fxl::RefPtr message) = 0; diff --git a/shell/common/engine.cc b/shell/common/engine.cc index f06c155dbcbb8..60453633b126c 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -364,8 +364,9 @@ void Engine::Render(std::unique_ptr layer_tree) { animator_->Render(std::move(layer_tree)); } -void Engine::UpdateSemantics(blink::SemanticsNodeUpdates update) { - delegate_.OnEngineUpdateSemantics(*this, std::move(update)); +void Engine::UpdateSemantics(blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) { + delegate_.OnEngineUpdateSemantics(*this, std::move(update), std::move(actions)); } void Engine::HandlePlatformMessage( diff --git a/shell/common/engine.h b/shell/common/engine.h index 0bbb524aae179..eeacfc4b848ba 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -11,6 +11,7 @@ #include "flutter/assets/asset_manager.h" #include "flutter/common/task_runners.h" #include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/semantics/custom_accessibility_action.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/viewport_metrics.h" @@ -32,7 +33,8 @@ class Engine final : public blink::RuntimeDelegate { public: virtual void OnEngineUpdateSemantics( const Engine& engine, - blink::SemanticsNodeUpdates update) = 0; + blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) = 0; virtual void OnEngineHandlePlatformMessage( const Engine& engine, @@ -123,7 +125,8 @@ class Engine final : public blink::RuntimeDelegate { void Render(std::unique_ptr layer_tree) override; // |blink::RuntimeDelegate| - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + void UpdateSemantics(blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) override; // |blink::RuntimeDelegate| void HandlePlatformMessage( diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index 53cf7b736686b..cb84fbcedd715 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -74,7 +74,8 @@ fml::WeakPtr PlatformView::GetWeakPtr() const { return weak_factory_.GetWeakPtr(); } -void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update) {} +void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) {} void PlatformView::HandlePlatformMessage( fxl::RefPtr message) { diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 3ae91b178c72d..8273563f132f6 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -11,6 +11,7 @@ #include "flutter/flow/texture.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/semantics/custom_accessibility_action.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/viewport_metrics.h" @@ -95,7 +96,8 @@ class PlatformView { fml::WeakPtr GetWeakPtr() const; - virtual void UpdateSemantics(blink::SemanticsNodeUpdates update); + virtual void UpdateSemantics(blink::SemanticsNodeUpdates updates, + blink::CustomAccessibilityActionUpdates actions); virtual void HandlePlatformMessage( fxl::RefPtr message); diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 0da5126e53e3d..e6cb6fc10a84c 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -707,14 +707,15 @@ void Shell::OnAnimatorDrawLastLayerTree(const Animator& animator) { // |shell::Engine::Delegate| void Shell::OnEngineUpdateSemantics(const Engine& engine, - blink::SemanticsNodeUpdates update) { + blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) { FXL_DCHECK(is_setup_); FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); task_runners_.GetPlatformTaskRunner()->PostTask( - [view = platform_view_->GetWeakPtr(), update = std::move(update)] { + [view = platform_view_->GetWeakPtr(), update = std::move(update), actions = std::move(actions)] { if (view) { - view->UpdateSemantics(std::move(update)); + view->UpdateSemantics(std::move(update), std::move(actions)); } }); } diff --git a/shell/common/shell.h b/shell/common/shell.h index 75ab39052ce21..8f12bf0ae64e5 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -15,6 +15,7 @@ #include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/thread.h" #include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/semantics/custom_accessibility_action.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/runtime/service_protocol.h" #include "flutter/shell/common/animator.h" @@ -183,7 +184,8 @@ class Shell final : public PlatformView::Delegate, // |shell::Engine::Delegate| void OnEngineUpdateSemantics(const Engine& engine, - blink::SemanticsNodeUpdates update) override; + blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) override; // |shell::Engine::Delegate| void OnEngineHandlePlatformMessage( diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 8925d6957cb6a..b0dddf8598c3c 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -32,6 +32,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMess private static final int ROOT_NODE_ID = 0; private Map mObjects; + private Map mCustomAccessibilityActions; private final FlutterView mOwner; private boolean mAccessibilityEnabled = false; private SemanticsObject mA11yFocusedObject; @@ -59,7 +60,8 @@ enum Action { CUT(1 << 13), PASTE(1 << 14), DID_GAIN_ACCESSIBILITY_FOCUS(1 << 15), - DID_LOSE_ACCESSIBILITY_FOCUS(1 << 16); + DID_LOSE_ACCESSIBILITY_FOCUS(1 << 16), + CUSTOM_ACTION(1 << 17); Action(int value) { this.value = value; @@ -95,6 +97,7 @@ enum Flag { assert owner != null; mOwner = owner; mObjects = new HashMap(); + mCustomAccessibilityActions = new HashMap(); previousRoutes = new ArrayList<>(); mFlutterAccessibilityChannel = new BasicMessageChannel<>(owner, "flutter/accessibility", StandardMessageCodec.INSTANCE); @@ -250,6 +253,15 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { result.addAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS); } + // Actions on the local context menu + if (Build.VERSION.SDK_INT >= 21) { + if (object.customAccessibilityAction != null) { + for (CustomAccessibilityAction action : object.customAccessibilityAction) { + result.addAction(new AccessibilityNodeInfo.AccessibilityAction(action.resourceId, action.label)); + } + } + } + if (object.childrenInTraversalOrder != null) { for (SemanticsObject child : object.childrenInTraversalOrder) { if (!child.hasFlag(Flag.IS_HIDDEN)) { @@ -381,6 +393,14 @@ public boolean performAction(int virtualViewId, int action, Bundle arguments) { mOwner.dispatchSemanticsAction(virtualViewId, Action.PASTE); return true; } + default: + // might be a custom accessibility action. + final int flutterId = action - firstResourceId; + CustomAccessibilityAction contextAction = mCustomAccessibilityActions.get(flutterId); + if (contextAction != null) { + mOwner.dispatchSemanticsAction(virtualViewId, Action.CUSTOM_ACTION, contextAction.id); + return true; + } } return false; } @@ -440,6 +460,17 @@ private SemanticsObject getOrCreateObject(int id) { return object; } + private CustomAccessibilityAction getOrCreateAction(int id) { + CustomAccessibilityAction action = mCustomAccessibilityActions.get(id); + if (action == null) { + action = new CustomAccessibilityAction(); + action.id = id; + action.resourceId = id + firstResourceId; + mCustomAccessibilityActions.put(id, action); + } + return action; + } + void handleTouchExplorationExit() { if (mHoveredObject != null) { sendAccessibilityEvent(mHoveredObject.id, AccessibilityEvent.TYPE_VIEW_HOVER_EXIT); @@ -464,6 +495,16 @@ void handleTouchExploration(float x, float y) { } } + void updateCustomAccessibilityActions(ByteBuffer buffer, String[] strings) { + ArrayList updatedActions = new ArrayList(); + while (buffer.hasRemaining()) { + int id = buffer.getInt(); + CustomAccessibilityAction action = getOrCreateAction(id); + int stringIndex = buffer.getInt(); + action.label = stringIndex == -1 ? null : strings[stringIndex]; + } + } + void updateSemantics(ByteBuffer buffer, String[] strings) { ArrayList updated = new ArrayList(); while (buffer.hasRemaining()) { @@ -732,6 +773,20 @@ public static TextDirection fromInt(int value) { } } + private class CustomAccessibilityAction { + CustomAccessibilityAction() {} + + /// Resource id is the id of the custom action plus a minimum value so that the identifier + /// does not collide with existing Android accessibility actions. + int resourceId = -1; + int id = -1; + + /// The label is the user presented value which is displayed in the local context menu. + String label; + } + /// Value is derived from ACTION_TYPE_MASK in AccessibilityNodeInfo.java + static int firstResourceId = 267386881; + private class SemanticsObject { SemanticsObject() { } @@ -770,6 +825,7 @@ private class SemanticsObject { SemanticsObject parent; List childrenInTraversalOrder; List childrenInHitTestOrder; + List customAccessibilityAction; private boolean inverseTransformDirty = true; private float[] inverseTransform; @@ -888,6 +944,20 @@ void updateWith(ByteBuffer buffer, String[] strings) { childrenInHitTestOrder.add(child); } } + final int actionCount = buffer.getInt(); + if (actionCount == 0) { + customAccessibilityAction = null; + } else { + if (customAccessibilityAction == null) + customAccessibilityAction = new ArrayList(actionCount); + else + customAccessibilityAction.clear(); + + for (int i = 0; i < actionCount; i++) { + CustomAccessibilityAction action = getOrCreateAction(buffer.getInt()); + customAccessibilityAction.add(action); + } + } } private void ensureInverseTransform() { diff --git a/shell/platform/android/io/flutter/view/FlutterNativeView.java b/shell/platform/android/io/flutter/view/FlutterNativeView.java index 3d00312a081fb..c9899ee261ede 100644 --- a/shell/platform/android/io/flutter/view/FlutterNativeView.java +++ b/shell/platform/android/io/flutter/view/FlutterNativeView.java @@ -183,6 +183,13 @@ private void updateSemantics(ByteBuffer buffer, String[] strings) { mFlutterView.updateSemantics(buffer, strings); } + // Called by native to update the custom accessibility actions. + private void updateCustomAccessibilityActions(ByteBuffer buffer, String[] strings) { + if (mFlutterView == null) + return; + mFlutterView.updateCustomAccessibilityActions(buffer, strings); + } + // Called by native to notify first Flutter frame rendered. private void onFirstFrame() { if (mFlutterView == null) diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 703894a614796..8974a0bec5e10 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -712,6 +712,17 @@ public void updateSemantics(ByteBuffer buffer, String[] strings) { } } + public void updateCustomAccessibilityActions(ByteBuffer buffer, String[] strings) { + try { + if (mAccessibilityNodeProvider != null) { + buffer.order(ByteOrder.LITTLE_ENDIAN); + mAccessibilityNodeProvider.updateCustomAccessibilityActions(buffer, strings); + } + } catch (Exception ex) { + Log.e(TAG, "Uncaught exception while updating local context actions", ex); + } + } + // Called by native to notify first Flutter frame rendered. public void onFirstFrame() { // Allow listeners to remove themselves when they are called. diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index a13d9bed14967..422358da27fcb 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -178,9 +178,11 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, } // |shell::PlatformView| -void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { - constexpr size_t kBytesPerNode = 35 * sizeof(int32_t); +void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) { + constexpr size_t kBytesPerNode = 36 * sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t); + constexpr size_t kBytesPerAction = 2 * sizeof(int32_t); JNIEnv* env = fml::jni::AttachCurrentThread(); { @@ -194,6 +196,7 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { num_bytes += value.second.childrenInTraversalOrder.size() * kBytesPerChild; num_bytes += value.second.childrenInHitTestOrder.size() * kBytesPerChild; + num_bytes += value.second.customAccessibilityActions.size() * kBytesPerChild; } std::vector buffer(num_bytes); @@ -259,14 +262,45 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update) { for (int32_t child : node.childrenInHitTestOrder) buffer_int32[position++] = child; + + buffer_int32[position++] = node.customAccessibilityActions.size(); + for (int32_t child : node.customAccessibilityActions) + buffer_int32[position++] = child; } + // custom accessibility actions. + size_t num_action_bytes = actions.size() * kBytesPerAction; + std::vector actions_buffer(num_action_bytes); + int32_t* actions_buffer_int32 = reinterpret_cast(&actions_buffer[0]); + + std::vector action_strings; + size_t actions_position = 0; + for (const auto& value : actions) { + // If you edit this code, make sure you update kBytesPerAction + // to match the number of values you are + // sending. + const blink::CustomAccessibilityAction& action = value.second; + actions_buffer_int32[actions_position++] = action.id; + if (action.label.empty()) { + actions_buffer_int32[actions_position++] = -1; + } else { + actions_buffer_int32[actions_position++] = action_strings.size(); + action_strings.push_back(action.label); + } + } + + fml::jni::ScopedJavaLocalRef direct_actions_buffer( + env, env->NewDirectByteBuffer(actions_buffer.data(), actions_buffer.size())); + fml::jni::ScopedJavaLocalRef direct_buffer( env, env->NewDirectByteBuffer(buffer.data(), buffer.size())); + FlutterViewUpdateCustomAccessibilityActions( + env, view.obj(), direct_actions_buffer.obj(), + fml::jni::VectorToStringArray(env, action_strings).obj()); FlutterViewUpdateSemantics( - env, view.obj(), direct_buffer.obj(), - fml::jni::VectorToStringArray(env, strings).obj()); + env, view.obj(), direct_buffer.obj(), + fml::jni::VectorToStringArray(env, strings).obj()); } } diff --git a/shell/platform/android/platform_view_android.h b/shell/platform/android/platform_view_android.h index 9976c443f4248..b93a9834f3a25 100644 --- a/shell/platform/android/platform_view_android.h +++ b/shell/platform/android/platform_view_android.h @@ -75,7 +75,8 @@ class PlatformViewAndroid final : public PlatformView { pending_responses_; // |shell::PlatformView| - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + void UpdateSemantics(blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) override; // |shell::PlatformView| void HandlePlatformMessage( diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 7b0f0d7ae10c1..0fe2af1c5058e 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -80,6 +80,15 @@ void FlutterViewUpdateSemantics(JNIEnv* env, FXL_CHECK(CheckException(env)); } +static jmethodID g_update_custom_accessibility_actions_method = nullptr; +void FlutterViewUpdateCustomAccessibilityActions(JNIEnv* env, + jobject obj, + jobject buffer, + jobjectArray strings) { + env->CallVoidMethod(obj, g_update_custom_accessibility_actions_method, buffer, strings); + FXL_CHECK(CheckException(env)); +} + static jmethodID g_on_first_frame_method = nullptr; void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj) { env->CallVoidMethod(obj, g_on_first_frame_method); @@ -648,6 +657,14 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { return false; } + g_update_custom_accessibility_actions_method = + env->GetMethodID(g_flutter_native_view_class->obj(), "updateCustomAccessibilityActions", + "(Ljava/nio/ByteBuffer;[Ljava/lang/String;)V"); + + if (g_update_custom_accessibility_actions_method == nullptr) { + return false; + } + g_on_first_frame_method = env->GetMethodID(g_flutter_native_view_class->obj(), "onFirstFrame", "()V"); diff --git a/shell/platform/android/platform_view_android_jni.h b/shell/platform/android/platform_view_android_jni.h index 65dff978d1a9e..1a03d1303a7ec 100644 --- a/shell/platform/android/platform_view_android_jni.h +++ b/shell/platform/android/platform_view_android_jni.h @@ -27,6 +27,11 @@ void FlutterViewUpdateSemantics(JNIEnv* env, jobject buffer, jobjectArray strings); +void FlutterViewUpdateCustomAccessibilityActions(JNIEnv* env, + jobject obj, + jobject buffer, + jobjectArray strings); + void FlutterViewOnFirstFrame(JNIEnv* env, jobject obj); void SurfaceTextureAttachToGLContext(JNIEnv* env, jobject obj, jint textureId); diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h index ffe99c080324d..2ac895d575dc3 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h @@ -15,6 +15,7 @@ #include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/platform/darwin/scoped_nsobject.h" #include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/semantics/custom_accessibility_action.h" #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterChannels.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" @@ -80,6 +81,19 @@ class AccessibilityBridge; @end +/** + * An implementation of UIAccessibilityCustomAction which also contains the + * Flutter uid. + */ +@interface FlutterCustomAccessibilityAction : UIAccessibilityCustomAction + +/** + * The uid of the action defined by the flutter application. + */ +@property(nonatomic) int32_t uid; + +@end + /** * The default implementation of `SemanticsObject` for most accessibility elements * in the iOS accessibility tree. @@ -102,8 +116,10 @@ class AccessibilityBridge final { AccessibilityBridge(UIView* view, PlatformViewIOS* platform_view); ~AccessibilityBridge(); - void UpdateSemantics(blink::SemanticsNodeUpdates nodes); + void UpdateSemantics(blink::SemanticsNodeUpdates nodes, blink::CustomAccessibilityActionUpdates actions); void DispatchSemanticsAction(int32_t id, blink::SemanticsAction action); + void DispatchSemanticsAction(int32_t id, blink::SemanticsAction action, std::vector args); + UIView* textInputView(); UIView* view() const { return view_; } @@ -123,6 +139,7 @@ class AccessibilityBridge final { fml::scoped_nsprotocol accessibility_channel_; fml::WeakPtrFactory weak_factory_; int32_t previous_route_id_; + std::unordered_map actions_; std::vector previous_routes_; FXL_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridge); diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index f923581e7f045..91bed1ced7bd8 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -42,6 +42,11 @@ } // namespace +@implementation FlutterCustomAccessibilityAction + { +} +@end + /** * Represents a semantics object that has children and hence has to be presented to the OS as a * UIAccessibilityContainer. @@ -175,6 +180,20 @@ - (void)collectRoutes:(NSMutableArray*)edges { } } +- (BOOL)onCustomAccessibilityAction:(FlutterCustomAccessibilityAction*)action { + if (![self node].HasAction(blink::SemanticsAction::kCustomAction)) + return NO; + int32_t action_id = action.uid; + std::vector args; + args.push_back(3); // type=int32. + args.push_back(action_id); + args.push_back(action_id >> 8); + args.push_back(action_id >> 16); + args.push_back(action_id >> 24); + [self bridge] ->DispatchSemanticsAction([self uid], blink::SemanticsAction::kCustomAction, args); + return YES; +} + - (NSString*)routeName { // Returns the first non-null and non-empty semantic label of a child // with an NamesRoute flag. Otherwise returns nil. @@ -481,10 +500,14 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { return [platform_view_->GetTextInputPlugin() textInputView]; } -void AccessibilityBridge::UpdateSemantics(blink::SemanticsNodeUpdates nodes) { +void AccessibilityBridge::UpdateSemantics(blink::SemanticsNodeUpdates nodes, + blink::CustomAccessibilityActionUpdates actions) { BOOL layoutChanged = NO; BOOL scrollOccured = NO; - + for (const auto& entry: actions) { + const blink::CustomAccessibilityAction& action = entry.second; + actions_[action.id] = action; + } for (const auto& entry : nodes) { const blink::SemanticsNode& node = entry.second; SemanticsObject* object = GetOrCreateObject(node.id, nodes); @@ -500,6 +523,20 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { [newChildren addObject:child]; } object.children = newChildren; + if (node.customAccessibilityActions.size() > 0) { + NSMutableArray* accessibilityCustomActions = + [[[NSMutableArray alloc] init] autorelease]; + for (int32_t action_id : node.customAccessibilityActions) { + blink::CustomAccessibilityAction& action = actions_[action_id]; + NSString* label = @(action.label.data()); + SEL selector = @selector(onCustomAccessibilityAction:); + FlutterCustomAccessibilityAction* customAction = + [[FlutterCustomAccessibilityAction alloc] initWithName:label target:object selector:selector]; + customAction.uid = action_id; + [accessibilityCustomActions addObject:customAction]; + } + object.accessibilityCustomActions = accessibilityCustomActions; + } } SemanticsObject* root = objects_.get()[@(kRootNodeId)]; @@ -560,6 +597,12 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { platform_view_->DispatchSemanticsAction(uid, action, args); } +void AccessibilityBridge::DispatchSemanticsAction(int32_t uid, + blink::SemanticsAction action, + std::vector args) { + platform_view_->DispatchSemanticsAction(uid, action, args); +} + SemanticsObject* AccessibilityBridge::GetOrCreateObject(int32_t uid, blink::SemanticsNodeUpdates& updates) { SemanticsObject* object = objects_.get()[@(uid)]; diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index e7849dda44641..3dc29b8b78a2a 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -64,7 +64,8 @@ class PlatformViewIOS final : public PlatformView { fxl::RefPtr message) override; // |shell::PlatformView| - void UpdateSemantics(blink::SemanticsNodeUpdates update) override; + void UpdateSemantics(blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) override; // |shell::PlatformView| std::unique_ptr CreateVSyncWaiter() override; diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index 7d64bb80cb749..8d77716252f2b 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -72,9 +72,10 @@ } // |shell::PlatformView| -void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update) { +void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) { if (accessibility_bridge_) { - accessibility_bridge_->UpdateSemantics(std::move(update)); + accessibility_bridge_->UpdateSemantics(std::move(update), std::move(actions)); } } diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 752670eae6e0c..30bed525c7e37 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -489,6 +489,8 @@ FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_ FILE: ../../../flutter/lib/ui/isolate_name_server.dart FILE: ../../../flutter/lib/ui/painting/image_encoding.cc FILE: ../../../flutter/lib/ui/painting/image_encoding.h +FILE: ../../../flutter/lib/ui/semantics/custom_accessibility_action.cc +FILE: ../../../flutter/lib/ui/semantics/custom_accessibility_action.h FILE: ../../../flutter/lib/ui/text/asset_manager_font_provider.cc FILE: ../../../flutter/lib/ui/text/asset_manager_font_provider.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h From 0c33c2e16c85958ef60906b746e4562a4e0b0e4c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 11 Jul 2018 13:39:50 -0400 Subject: [PATCH 0752/1190] Roll src/third_party/skia 4ec72f7cc745..e923cccb258e (13 commits) (#5719) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/DEPS b/DEPS index 9ae8493ece1e7..e65845ef44a2d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4ec72f7cc745bbd98a0ae0d160e774ce8ad1a1ff', + 'skia_revision': 'e923cccb258e920d1ef91ff39a4da83d8c856d0e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8d2664a2291b8..8f69496b11799 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1e7a2c73d6034f63fa374cd00dce31b1 +Signature: 5b8c5ee1df4ba63758477360a16e93ad UNUSED LICENSES: @@ -17274,6 +17274,7 @@ FILE: ../../../third_party/skia/experimental/docs/jsonbaseddoc.htm FILE: ../../../third_party/skia/experimental/docs/svgBackend.js FILE: ../../../third_party/skia/experimental/docs/svgbaseddoc.htm FILE: ../../../third_party/skia/experimental/docs/utilities.js +FILE: ../../../third_party/skia/experimental/wasm/shell.html FILE: ../../../third_party/skia/infra/bots/android_bin.isolate FILE: ../../../third_party/skia/infra/bots/assets.isolate FILE: ../../../third_party/skia/infra/bots/assets/android_ndk_darwin/VERSION @@ -18822,7 +18823,6 @@ FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.h FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.cpp FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkBackendContext.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkCaps.cpp @@ -19677,11 +19677,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/fuzz/FuzzDrawFunctions.cpp + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/experimental/wasm/wasm_main.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/fuzz/FuzzDrawFunctions.cpp +FILE: ../../../third_party/skia/experimental/wasm/wasm_main.cpp +FILE: ../../../third_party/skia/fuzz/FuzzEncoders.cpp ---------------------------------------------------------------------------------------------------- -Copyright 2016 Mozilla Foundation +Copyright 2018 Google LLC Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -19712,11 +19713,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/fuzz/FuzzEncoders.cpp + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/fuzz/FuzzDrawFunctions.cpp + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/fuzz/FuzzEncoders.cpp +FILE: ../../../third_party/skia/fuzz/FuzzDrawFunctions.cpp ---------------------------------------------------------------------------------------------------- -Copyright 2018 Google LLC +Copyright 2016 Mozilla Foundation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are From fc780527fef1657d8239ebbd82fcdb2ffa0f7bd5 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 11 Jul 2018 12:33:36 -0700 Subject: [PATCH 0753/1190] Convert lazy SkImages to raster images when extracting pixel data (#5713) Fixes https://github.com/flutter/flutter/issues/19214 --- lib/ui/painting/image_encoding.cc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index 00c9b79fe5629..dd4b8d1cf2d32 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -57,12 +57,23 @@ void InvokeDataCallback(std::unique_ptr callback, sk_sp ConvertToRasterImageIfNecessary(sk_sp image, GrContext* context) { - if (context == nullptr) { - // The context was null (software rendering contexts) so the image is likely - // already a raster image. Nothing more to do. + SkPixmap pixmap; + if (image->peekPixels(&pixmap)) { + // This is already a raster image. return image; } + if (sk_sp raster_image = image->makeRasterImage()) { + // The image can be converted to a raster image. + return raster_image; + } + + // Cross-context images do not support makeRasterImage. Convert these images + // by drawing them into a surface. + if (context == nullptr) { + return nullptr; + } + TRACE_EVENT0("flutter", __FUNCTION__); // Create a GPU surface with the context and then do a device to host copy of From 0423ba92d508ccef7afc70061f9d74462885fd7f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 11 Jul 2018 17:03:50 -0400 Subject: [PATCH 0754/1190] Roll src/third_party/skia e923cccb258e..238069b3f58d (18 commits) (#5720) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index e65845ef44a2d..55724d02c7aee 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e923cccb258e920d1ef91ff39a4da83d8c856d0e', + 'skia_revision': '238069b3f58d3b20f710f77a64632470a3bf256a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 8f69496b11799..ac683be5eb3a0 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5b8c5ee1df4ba63758477360a16e93ad +Signature: d154c853619ca972a28b96cd8dfa10f4 UNUSED LICENSES: @@ -16937,6 +16937,7 @@ ORIGIN: ../../../third_party/skia/bench/GrCCGeometryBench.cpp + ../../../third_p TYPE: LicenseType.bsd FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp FILE: ../../../third_party/skia/bench/JSONBench.cpp +FILE: ../../../third_party/skia/bench/PolyUtilsBench.cpp FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp @@ -18335,8 +18336,6 @@ FILE: ../../../third_party/skia/samplecode/SampleQuadStroker.cpp FILE: ../../../third_party/skia/src/codec/SkColorTable.h FILE: ../../../third_party/skia/src/core/SkAnnotation.cpp FILE: ../../../third_party/skia/src/core/SkBBoxHierarchy.h -FILE: ../../../third_party/skia/src/core/SkDeviceProfile.cpp -FILE: ../../../third_party/skia/src/core/SkDeviceProfile.h FILE: ../../../third_party/skia/src/core/SkFontDescriptor.cpp FILE: ../../../third_party/skia/src/core/SkFontDescriptor.h FILE: ../../../third_party/skia/src/core/SkImagePriv.h @@ -19681,6 +19680,7 @@ ORIGIN: ../../../third_party/skia/experimental/wasm/wasm_main.cpp + ../../../thi TYPE: LicenseType.bsd FILE: ../../../third_party/skia/experimental/wasm/wasm_main.cpp FILE: ../../../third_party/skia/fuzz/FuzzEncoders.cpp +FILE: ../../../third_party/skia/fuzz/FuzzPolyUtils.cpp ---------------------------------------------------------------------------------------------------- Copyright 2018 Google LLC From 68d81a31f46a4cddad0f09fd3522909f040bce41 Mon Sep 17 00:00:00 2001 From: amirh Date: Wed, 11 Jul 2018 14:11:15 -0700 Subject: [PATCH 0755/1190] Platform Views: Android and MethodChannel APIs, and implementation skeleton. (#5684) To keep the scope of this CL as small of possible I'm leaving the actual implementation of the platform view mechanics to a following CL. This CL introduces: * A PlatformViewsController class which will be responsible for creating, resizing, and disposing platform views. * A PlatformViewRegistry which is exposed through the PluginRegistry and allows plugins to register factories for platform views. Android plugin code will add support for a new platform view type by implementing PlatformViewFactory, and registering a factory with the registry, e.g: ```java registrar.platformViewRegistry().registerViewFactory( 'webview', new FlutterWebViewFactory() ); ``` On the Dart side, the framework will ask the engine to create new platform views by sending a create message over the platformviews method channel with the unique platform view type id, dimensions, and a unique id allocated by the framework for the new platform view instance. The platformviews method channel is also used for resizing and disposing platform views. --- shell/platform/android/BUILD.gn | 7 +- .../io/flutter/app/FlutterPluginRegistry.java | 16 +++ .../flutter/plugin/common/PluginRegistry.java | 8 ++ .../flutter/plugin/platform/PlatformView.java | 17 ++++ .../plugin/platform/PlatformViewFactory.java | 11 +++ .../plugin/platform/PlatformViewRegistry.java | 23 +++++ .../platform/PlatformViewRegistryImpl.java | 30 ++++++ .../platform/PlatformViewsController.java | 98 +++++++++++++++++++ .../io/flutter/view/FlutterNativeView.java | 1 + travis/licenses_golden/licenses_flutter | 5 + 10 files changed, 215 insertions(+), 1 deletion(-) create mode 100644 shell/platform/android/io/flutter/plugin/platform/PlatformView.java create mode 100644 shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java create mode 100644 shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistry.java create mode 100644 shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistryImpl.java create mode 100644 shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 049c6d2c0df00..817c1c29250f8 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -108,8 +108,8 @@ java_library("flutter_shell_java") { "io/flutter/plugin/common/BasicMessageChannel.java", "io/flutter/plugin/common/BinaryCodec.java", "io/flutter/plugin/common/BinaryMessenger.java", - "io/flutter/plugin/common/FlutterException.java", "io/flutter/plugin/common/EventChannel.java", + "io/flutter/plugin/common/FlutterException.java", "io/flutter/plugin/common/JSONMessageCodec.java", "io/flutter/plugin/common/JSONMethodCodec.java", "io/flutter/plugin/common/JSONUtil.java", @@ -124,6 +124,11 @@ java_library("flutter_shell_java") { "io/flutter/plugin/editing/InputConnectionAdaptor.java", "io/flutter/plugin/editing/TextInputPlugin.java", "io/flutter/plugin/platform/PlatformPlugin.java", + "io/flutter/plugin/platform/PlatformView.java", + "io/flutter/plugin/platform/PlatformViewFactory.java", + "io/flutter/plugin/platform/PlatformViewRegistry.java", + "io/flutter/plugin/platform/PlatformViewRegistryImpl.java", + "io/flutter/plugin/platform/PlatformViewsController.java", "io/flutter/util/PathUtils.java", "io/flutter/util/Preconditions.java", "io/flutter/view/AccessibilityBridge.java", diff --git a/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java b/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java index f29da3faf9f86..ebf9b5f3ed3e6 100644 --- a/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java +++ b/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java @@ -9,6 +9,8 @@ import android.content.Intent; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.PluginRegistry; +import io.flutter.plugin.platform.PlatformViewRegistry; +import io.flutter.plugin.platform.PlatformViewsController; import io.flutter.view.FlutterMain; import io.flutter.view.FlutterNativeView; import io.flutter.view.FlutterView; @@ -33,6 +35,7 @@ public class FlutterPluginRegistry private FlutterNativeView mNativeView; private FlutterView mFlutterView; + private final PlatformViewsController mPlatformViewsController; private final Map mPluginMap = new LinkedHashMap<>(0); private final List mRequestPermissionsResultListeners = new ArrayList<>(0); private final List mActivityResultListeners = new ArrayList<>(0); @@ -43,6 +46,7 @@ public class FlutterPluginRegistry public FlutterPluginRegistry(FlutterNativeView nativeView, Context context) { mNativeView = nativeView; mAppContext = context; + mPlatformViewsController = new PlatformViewsController(); } @Override @@ -68,9 +72,12 @@ public Registrar registrarFor(String pluginKey) { public void attach(FlutterView flutterView, Activity activity) { mFlutterView = flutterView; mActivity = activity; + mPlatformViewsController.attachFlutterView(flutterView); } public void detach() { + mPlatformViewsController.detachFlutterView(); + mPlatformViewsController.onFlutterViewDestroyed(); mFlutterView = null; mActivity = null; } @@ -107,6 +114,11 @@ public TextureRegistry textures() { return mFlutterView; } + @Override + public PlatformViewRegistry platformViewRegistry() { + return mPlatformViewsController.getRegistry(); + } + @Override public FlutterView view() { return mFlutterView; @@ -225,4 +237,8 @@ public boolean onViewDestroy(FlutterNativeView view) { } return handled; } + + public void destroy() { + mPlatformViewsController.onFlutterViewDestroyed(); + } } diff --git a/shell/platform/android/io/flutter/plugin/common/PluginRegistry.java b/shell/platform/android/io/flutter/plugin/common/PluginRegistry.java index 129274de1abb5..4fd8a4def4368 100644 --- a/shell/platform/android/io/flutter/plugin/common/PluginRegistry.java +++ b/shell/platform/android/io/flutter/plugin/common/PluginRegistry.java @@ -7,6 +7,7 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; +import io.flutter.plugin.platform.PlatformViewRegistry; import io.flutter.view.FlutterNativeView; import io.flutter.view.FlutterView; import io.flutter.view.TextureRegistry; @@ -99,6 +100,13 @@ interface Registrar { */ TextureRegistry textures(); + /** + * Returns the application's {@link PlatformViewRegistry}. + * + * Plugins can use the platform registry to register their view factories. + */ + PlatformViewRegistry platformViewRegistry(); + /** * Returns the {@link FlutterView} that's instantiated by this plugin's * {@link #activity() activity}. diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformView.java b/shell/platform/android/io/flutter/plugin/platform/PlatformView.java new file mode 100644 index 0000000000000..9b60d1fdbf4ea --- /dev/null +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformView.java @@ -0,0 +1,17 @@ +// 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. + +package io.flutter.plugin.platform; + +import android.view.View; + +/** + * A handle to an Android view to be embedded in the Flutter hierarchy. + */ +public interface PlatformView { + /** + * Returns the Android view to be embedded in the Flutter hierarchy. + */ + View getView(); +} diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java new file mode 100644 index 0000000000000..ac70b1776d2af --- /dev/null +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java @@ -0,0 +1,11 @@ +// 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. + +package io.flutter.plugin.platform; + +import android.content.Context; + +public interface PlatformViewFactory { + PlatformView create(Context context); +} diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistry.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistry.java new file mode 100644 index 0000000000000..0a45ab7a65b59 --- /dev/null +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistry.java @@ -0,0 +1,23 @@ +// 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. + +package io.flutter.plugin.platform; + + +/** + * Registry for platform view factories. + *

+ * Plugins can register factories for specific view types. + */ +public interface PlatformViewRegistry { + + /** + * Registers a factory for a platform view. + * + * @param viewTypeId unique identifier for the platform view's type. + * @param factory factory for creating platform views of the specified type. + * @return true if succeeded, false if a factory is already registered for viewTypeId. + */ + boolean registerViewFactory(String viewTypeId, PlatformViewFactory factory); +} diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistryImpl.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistryImpl.java new file mode 100644 index 0000000000000..ea1b02c4785ab --- /dev/null +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistryImpl.java @@ -0,0 +1,30 @@ +// 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. + +package io.flutter.plugin.platform; + +import java.util.HashMap; +import java.util.Map; + +class PlatformViewRegistryImpl implements PlatformViewRegistry { + + PlatformViewRegistryImpl() { + viewFactories = new HashMap<>(); + } + + // Maps a platform view type id to its factory. + private final Map viewFactories; + + @Override + public boolean registerViewFactory(String viewTypeId, PlatformViewFactory factory) { + if (viewFactories.containsKey(viewTypeId)) + return false; + viewFactories.put(viewTypeId, factory); + return true; + } + + PlatformViewFactory getFactory(String viewTypeId) { + return viewFactories.get(viewTypeId); + } +} diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java new file mode 100644 index 0000000000000..2d10a45d81fbf --- /dev/null +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -0,0 +1,98 @@ +// 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. + +package io.flutter.plugin.platform; + +import android.util.Log; +import io.flutter.plugin.common.MethodCall; +import io.flutter.plugin.common.MethodChannel; +import io.flutter.plugin.common.StandardMethodCodec; +import io.flutter.view.FlutterView; + +import java.util.HashMap; +import java.util.Map; + +/** + * Manages platform views. + *

+ * Each {@link io.flutter.app.FlutterPluginRegistry} has a single platform views controller. + * A platform views controller can be attached to at most one Flutter view. + */ +public class PlatformViewsController implements MethodChannel.MethodCallHandler { + private static final String CHANNEL_NAME = "flutter/platform_views"; + + private final PlatformViewRegistryImpl mRegistry; + + private FlutterView mFlutterView; + + public PlatformViewsController() { + mRegistry = new PlatformViewRegistryImpl(); + } + + public void attachFlutterView(FlutterView view) { + if (mFlutterView != null) + throw new AssertionError( + "A PlatformViewsController can only be attached to a single FlutterView.\n" + + "attachFlutterView was called while a FlutterView was already attached." + ); + mFlutterView = view; + MethodChannel channel = new MethodChannel(view, CHANNEL_NAME, StandardMethodCodec.INSTANCE); + channel.setMethodCallHandler(this); + } + + public void detachFlutterView() { + mFlutterView.setMessageHandler(CHANNEL_NAME, null); + mFlutterView = null; + } + + public PlatformViewRegistry getRegistry() { + return mRegistry; + } + + public void onFlutterViewDestroyed() { + // TODO(amirh): tear down all vd resources. + } + + @Override + public void onMethodCall(MethodCall call, MethodChannel.Result result) { + switch (call.method) { + case "create": + createPlatformView(call); + break; + case "dispose": + disposePlatformView(call); + break; + case "resize": + resizePlatformView(call); + break; + } + result.success(null); + } + + private void createPlatformView(MethodCall call) { + Map args = call.arguments(); + int id = (int) args.get("id"); + String viewType = (String) args.get("viewType"); + double width = (double) args.get("width"); + double height = (double) args.get("height"); + + // TODO(amirh): implement this. + } + + private void disposePlatformView(MethodCall call) { + int id = (int) call.arguments(); + + // TODO(amirh): implement this. + } + + private void resizePlatformView(MethodCall call) { + Map args = call.arguments(); + int id = (int) args.get("id"); + double width = (double) args.get("width"); + double height = (double) args.get("height"); + + // TODO(amirh): implement this. + } + +} diff --git a/shell/platform/android/io/flutter/view/FlutterNativeView.java b/shell/platform/android/io/flutter/view/FlutterNativeView.java index c9899ee261ede..46d8f5cb0d0d7 100644 --- a/shell/platform/android/io/flutter/view/FlutterNativeView.java +++ b/shell/platform/android/io/flutter/view/FlutterNativeView.java @@ -43,6 +43,7 @@ public void detach() { } public void destroy() { + mPluginRegistry.destroy(); mFlutterView = null; nativeDestroy(mNativePlatformView); mNativePlatformView = 0; diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 30bed525c7e37..a14034994f4dd 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -494,6 +494,11 @@ FILE: ../../../flutter/lib/ui/semantics/custom_accessibility_action.h FILE: ../../../flutter/lib/ui/text/asset_manager_font_provider.cc FILE: ../../../flutter/lib/ui/text/asset_manager_font_provider.h FILE: ../../../flutter/shell/platform/android/apk_asset_provider.h +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformView.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistry.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistryImpl.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h From c5a63d28bf3735569c8187753bc490d8351a8363 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 11 Jul 2018 15:28:33 -0700 Subject: [PATCH 0756/1190] rollback chrome change (#5721) --- .../io/flutter/plugin/platform/PlatformPlugin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java index 9268694434832..b05ffe5ec82b4 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java @@ -237,11 +237,11 @@ private void setSystemChromeSystemUIOverlayStyle(JSONObject message) { if (!message.isNull("systemNavigationBarIconBrightness")) { String systemNavigationBarIconBrightness = message.getString("systemNavigationBarIconBrightness"); switch (systemNavigationBarIconBrightness) { - case "Brightness.light": + case "Brightness.dark": //View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR flags |= 0x10; break; - case "Brightness.dark": + case "Brightness.light": flags &= ~0x10; break; } @@ -255,11 +255,11 @@ private void setSystemChromeSystemUIOverlayStyle(JSONObject message) { if (!message.isNull("statusBarIconBrightness")) { String statusBarIconBrightness = message.getString("statusBarIconBrightness"); switch (statusBarIconBrightness) { - case "Brightness.light": + case "Brightness.dark": // View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR flags |= 0x2000; break; - case "Brightness.dark": + case "Brightness.light": flags &= ~0x2000; break; } From a312733d3ebfe3d9ee218dda6baed9aceb2e8cb6 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 11 Jul 2018 20:27:50 -0400 Subject: [PATCH 0757/1190] Roll src/third_party/skia 238069b3f58d..fcc10da18eb5 (3 commits) (#5723) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 55724d02c7aee..1cf58133927b8 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '238069b3f58d3b20f710f77a64632470a3bf256a', + 'skia_revision': 'fcc10da18eb533e83d8d46181819deed234ad1a3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ac683be5eb3a0..d133695d5b866 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: d154c853619ca972a28b96cd8dfa10f4 +Signature: 101cffae4e0a27ec0916e0a1917e4711 UNUSED LICENSES: From 36238bfc61af1a600eef447999b9b071115f992a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 11 Jul 2018 23:53:09 -0400 Subject: [PATCH 0758/1190] Roll src/third_party/skia fcc10da18eb5..2c312c4f58f9 (7 commits) (#5724) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/DEPS b/DEPS index 1cf58133927b8..d0d752cf18a3e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'fcc10da18eb533e83d8d46181819deed234ad1a3', + 'skia_revision': '2c312c4f58f9c151acab8ca2dd0d39fb77c5e74a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d133695d5b866..80d3c38ff2d12 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 101cffae4e0a27ec0916e0a1917e4711 +Signature: 47bd4803aa3d790b1f1eff1b371d53e6 UNUSED LICENSES: @@ -17902,7 +17902,6 @@ FILE: ../../../third_party/skia/src/effects/SkColorMatrix.cpp FILE: ../../../third_party/skia/src/effects/SkColorMatrixFilter.cpp FILE: ../../../third_party/skia/src/effects/SkLayerDrawLooper.cpp FILE: ../../../third_party/skia/src/effects/SkPackBits.cpp -FILE: ../../../third_party/skia/src/effects/SkPaintFlagsDrawFilter.cpp FILE: ../../../third_party/skia/src/effects/SkTableMaskFilter.cpp FILE: ../../../third_party/skia/src/gpu/GrContext.cpp FILE: ../../../third_party/skia/src/gpu/GrGpu.h @@ -18556,7 +18555,6 @@ FILE: ../../../third_party/skia/gm/draw_bitmap_rect_skbug4374.cpp FILE: ../../../third_party/skia/gm/drawable.cpp FILE: ../../../third_party/skia/gm/drawatlas.cpp FILE: ../../../third_party/skia/gm/drawatlascolor.cpp -FILE: ../../../third_party/skia/gm/drawfilter.cpp FILE: ../../../third_party/skia/gm/drawminibitmaprect.cpp FILE: ../../../third_party/skia/gm/fadefilter.cpp FILE: ../../../third_party/skia/gm/fontscalerdistortable.cpp @@ -20024,9 +20022,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/core/SkDrawFilter.h + ../../../third_party/skia/LICENSE +ORIGIN: ../../../third_party/skia/include/core/SkDrawLooper.h + ../../../third_party/skia/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/core/SkDrawFilter.h FILE: ../../../third_party/skia/include/core/SkDrawLooper.h FILE: ../../../third_party/skia/include/effects/SkBlurImageFilter.h FILE: ../../../third_party/skia/src/core/SkScan.h @@ -20073,7 +20070,6 @@ FILE: ../../../third_party/skia/include/core/SkMallocPixelRef.h FILE: ../../../third_party/skia/include/core/SkPixelRef.h FILE: ../../../third_party/skia/include/core/SkUnPreMultiply.h FILE: ../../../third_party/skia/include/effects/SkBlurDrawLooper.h -FILE: ../../../third_party/skia/include/effects/SkPaintFlagsDrawFilter.h FILE: ../../../third_party/skia/include/private/SkFloatBits.h FILE: ../../../third_party/skia/src/core/SkBitmap.cpp FILE: ../../../third_party/skia/src/core/SkCanvas.cpp From 883aa190bcc28e873dd5e0f3cbee2211139cf412 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 12 Jul 2018 03:23:50 -0400 Subject: [PATCH 0759/1190] Roll src/third_party/skia 2c312c4f58f9..4d6a844365e7 (2 commits) (#5725) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d0d752cf18a3e..67b7eceded878 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2c312c4f58f9c151acab8ca2dd0d39fb77c5e74a', + 'skia_revision': '4d6a844365e7f8a03e469138ae76a944d4c72c25', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 80d3c38ff2d12..be11965127ed3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 47bd4803aa3d790b1f1eff1b371d53e6 +Signature: 84984e39a9c59d173cfa75f295f427ea UNUSED LICENSES: From f963e522bd580331d0f269256d96121820f7e521 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 12 Jul 2018 06:47:50 -0400 Subject: [PATCH 0760/1190] Roll src/third_party/skia 4d6a844365e7..f09f6090c87c (1 commits) (#5726) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 67b7eceded878..2053c0575304d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4d6a844365e7f8a03e469138ae76a944d4c72c25', + 'skia_revision': 'f09f6090c87c03e858fcafe682bfdcb4b66d597e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index be11965127ed3..e23fd3b4b66de 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 84984e39a9c59d173cfa75f295f427ea +Signature: 62aa397bfc59236be59fb33e443ca260 UNUSED LICENSES: From a0f1968ad2fe501106551756822be4156c24bb5a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 12 Jul 2018 10:17:50 -0400 Subject: [PATCH 0761/1190] Roll src/third_party/skia f09f6090c87c..20326e34b90d (6 commits) (#5727) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2053c0575304d..d138b2221f990 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f09f6090c87c03e858fcafe682bfdcb4b66d597e', + 'skia_revision': '20326e34b90d2e9bc053da5edb47d6e747c7f583', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e23fd3b4b66de..f49f027f47617 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 62aa397bfc59236be59fb33e443ca260 +Signature: a6582357ad2813b6530b541bf85a1f47 UNUSED LICENSES: From f0db2045efb7dc725c113f81b604de0439b3247e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 12 Jul 2018 13:56:50 -0400 Subject: [PATCH 0762/1190] Roll src/third_party/skia 20326e34b90d..5551a94b9e0f (10 commits) (#5730) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d138b2221f990..0daae9fe8eba4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '20326e34b90d2e9bc053da5edb47d6e747c7f583', + 'skia_revision': '5551a94b9e0fc822cda36d3bb5b70a97d2be4c17', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f49f027f47617..a58b049089735 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a6582357ad2813b6530b541bf85a1f47 +Signature: f7787a22a0627fe112b9159d9a18f967 UNUSED LICENSES: From eaffe812e592909610eaed332a1e94cf8de6fd8a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 12 Jul 2018 17:56:50 -0400 Subject: [PATCH 0763/1190] Roll src/third_party/skia 5551a94b9e0f..04aa393045c6 (11 commits) (#5731) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 0daae9fe8eba4..ba79ea3d002c2 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5551a94b9e0fc822cda36d3bb5b70a97d2be4c17', + 'skia_revision': '04aa393045c6172f78d96f9f5a02c6f1cc0da445', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a58b049089735..0f6245a8cd36f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f7787a22a0627fe112b9159d9a18f967 +Signature: 1a84a68f9dd53c097cd26fff8e36a45c UNUSED LICENSES: @@ -16961,6 +16961,7 @@ FILE: ../../../third_party/skia/gm/sharedcorners.cpp FILE: ../../../third_party/skia/include/android/SkAnimatedImage.h FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h FILE: ../../../third_party/skia/include/core/SkCoverageMode.h +FILE: ../../../third_party/skia/include/core/SkFontParameters.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h From 75802deb8902bfca7c4d07b675a7fa759670b495 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 12 Jul 2018 17:12:21 -0700 Subject: [PATCH 0764/1190] Retain the original image's color type when encoding in raw unmodified format (#5735) --- lib/ui/painting/image_encoding.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index dd4b8d1cf2d32..b6ce6f4157632 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -176,7 +176,7 @@ sk_sp EncodeImage(sk_sp p_image, return CopyImageByteData(raster_image, kRGBA_8888_SkColorType); } break; case kRawUnmodified: { - return CopyImageByteData(raster_image, kN32_SkColorType); + return CopyImageByteData(raster_image, raster_image->colorType()); } break; } From b11a752f74d42702f514c91aee278891035ad728 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 13 Jul 2018 10:34:50 -0400 Subject: [PATCH 0765/1190] Roll src/third_party/skia 04aa393045c6..4a17501f5bbd (14 commits) (#5741) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index ba79ea3d002c2..5d79a45d6a6cc 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '04aa393045c6172f78d96f9f5a02c6f1cc0da445', + 'skia_revision': '4a17501f5bbd5e45a49d76d7a733393fec9701ee', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 0f6245a8cd36f..b182282f093d5 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 1a84a68f9dd53c097cd26fff8e36a45c +Signature: c757bb5e355f10b554c7c35af53b6c8d UNUSED LICENSES: @@ -19520,8 +19520,6 @@ FILE: ../../../third_party/skia/src/gpu/vk/GrVkBufferView.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkBufferView.h FILE: ../../../third_party/skia/src/gpu/vk/GrVkSemaphore.cpp FILE: ../../../third_party/skia/src/gpu/vk/GrVkSemaphore.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTexelBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTexelBuffer.h FILE: ../../../third_party/skia/src/jumper/SkJumper.cpp FILE: ../../../third_party/skia/src/jumper/SkJumper.h FILE: ../../../third_party/skia/src/jumper/SkJumper_misc.h From 4d490275f714ef1a055a9ee5da578055995327e0 Mon Sep 17 00:00:00 2001 From: amirh Date: Fri, 13 Jul 2018 09:23:43 -0700 Subject: [PATCH 0766/1190] gitignore intellij generated folder (#5729) --- shell/platform/android/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 shell/platform/android/.gitignore diff --git a/shell/platform/android/.gitignore b/shell/platform/android/.gitignore new file mode 100644 index 0000000000000..2e8ec55e9bf6b --- /dev/null +++ b/shell/platform/android/.gitignore @@ -0,0 +1,2 @@ +# Generated by Intellij's Android plugin +gen From 500f91bc4985bfbd0b5a9ad17c839e92a9a38c82 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 13 Jul 2018 09:44:22 -0700 Subject: [PATCH 0767/1190] Return a failure exit code in flutter_tester if an uncaught error occurs in a microtask (#5736) --- lib/ui/ui_dart_state.cc | 9 +++++++++ lib/ui/ui_dart_state.h | 2 ++ runtime/runtime_controller.cc | 3 +-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index f7d3d4c81cca6..24de9180ed210 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -7,6 +7,7 @@ #include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/window.h" #include "lib/tonic/converter/dart_converter.h" +#include "lib/tonic/dart_message_handler.h" using tonic::ToDart; @@ -106,4 +107,12 @@ IsolateNameServer* UIDartState::GetIsolateNameServer() { return isolate_name_server_; } +tonic::DartErrorHandleType UIDartState::GetLastError() { + tonic::DartErrorHandleType error = message_handler().isolate_last_error(); + if (error == tonic::kNoError) { + error = microtask_queue_.GetLastError(); + } + return error; +} + } // namespace blink diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index 5cfdf9a44f11c..88b56b2cf08c2 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -49,6 +49,8 @@ class UIDartState : public tonic::DartState { IsolateNameServer* GetIsolateNameServer(); + tonic::DartErrorHandleType GetLastError(); + template static flow::SkiaGPUObject CreateGPUObject(sk_sp object) { if (!object) { diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 5ef6e5a0a0305..d4c191b4a5e24 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -270,8 +270,7 @@ bool RuntimeController::HasLivePorts() { } tonic::DartErrorHandleType RuntimeController::GetLastError() { - return root_isolate_ ? root_isolate_->message_handler().isolate_last_error() - : tonic::kNoError; + return root_isolate_ ? root_isolate_->GetLastError() : tonic::kNoError; } fml::WeakPtr RuntimeController::GetRootIsolate() { From 672e587e7491d62daca4cfe6200d072bc8035fea Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Fri, 13 Jul 2018 10:55:24 -0700 Subject: [PATCH 0768/1190] Background Execution Implementation for iOS (#5539) --- analysis_options.yaml | 2 +- lib/ui/BUILD.gn | 2 + lib/ui/dart_runtime_hooks.cc | 114 +++++++++++++++++- lib/ui/dart_ui.gni | 1 + lib/ui/natives.dart | 3 + lib/ui/plugins.dart | 69 +++++++++++ lib/ui/plugins/callback_cache.cc | 87 +++++++++++++ lib/ui/plugins/callback_cache.h | 55 +++++++++ lib/ui/ui.dart | 1 + runtime/dart_isolate.cc | 42 +++++++ runtime/dart_isolate.h | 4 + shell/common/engine.cc | 14 ++- shell/common/run_configuration.cc | 10 ++ shell/common/run_configuration.h | 5 + shell/platform/darwin/ios/BUILD.gn | 5 + .../darwin/ios/framework/Headers/Flutter.h | 1 + .../framework/Headers/FlutterCallbackCache.h | 37 ++++++ .../Headers/FlutterHeadlessDartRunner.h | 31 ++++- .../Source/FlutterAppDelegate_Internal.h | 18 +++ .../framework/Source/FlutterCallbackCache.mm | 26 ++++ .../Source/FlutterHeadlessDartRunner.mm | 79 ++++++++++-- .../darwin/ios/headless_platform_view_ios.h | 38 ++++++ .../darwin/ios/headless_platform_view_ios.mm | 20 +++ shell/platform/darwin/ios/platform_view_ios.h | 9 +- .../platform/darwin/ios/platform_view_ios.mm | 11 +- testing/dart/plugin_utilities_test.dart | 43 +++++++ tools/licenses/pubspec.lock | 12 +- travis/licenses_golden/licenses_flutter | 8 ++ 28 files changed, 700 insertions(+), 47 deletions(-) create mode 100644 lib/ui/plugins.dart create mode 100644 lib/ui/plugins/callback_cache.cc create mode 100644 lib/ui/plugins/callback_cache.h create mode 100644 shell/platform/darwin/ios/framework/Headers/FlutterCallbackCache.h create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h create mode 100644 shell/platform/darwin/ios/framework/Source/FlutterCallbackCache.mm create mode 100644 shell/platform/darwin/ios/headless_platform_view_ios.h create mode 100644 shell/platform/darwin/ios/headless_platform_view_ios.mm create mode 100644 testing/dart/plugin_utilities_test.dart diff --git a/analysis_options.yaml b/analysis_options.yaml index 5ceb890d98720..6420a5457adca 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -42,7 +42,7 @@ linter: # - avoid_bool_literals_in_conditional_expressions # not yet tested # - avoid_catches_without_on_clauses # we do this commonly # - avoid_catching_errors # we do this commonly - - avoid_classes_with_only_static_members + - avoid_classes_with_only_static_members # We want to avoid classes that can be instantiated but only have statics - avoid_empty_else - avoid_function_literals_in_foreach_calls - avoid_init_to_null diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 8526070f9b1e2..f58ed6d102802 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -52,6 +52,8 @@ source_set("ui") { "painting/shader.h", "painting/vertices.cc", "painting/vertices.h", + "plugins/callback_cache.cc", + "plugins/callback_cache.h", "semantics/semantics_node.cc", "semantics/semantics_node.h", "semantics/semantics_update.cc", diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index ca129cb4d9768..e9b3cb32399f5 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -12,6 +12,7 @@ #include #include "flutter/common/settings.h" +#include "flutter/lib/ui/plugins/callback_cache.h" #include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" @@ -36,6 +37,7 @@ extern void syslog(int, const char*, ...); } #endif +using tonic::DartConverter; using tonic::LogIfError; using tonic::ToDart; @@ -48,7 +50,9 @@ namespace blink { #define BUILTIN_NATIVE_LIST(V) \ V(Logger_PrintString, 1) \ V(SaveCompilationTrace, 0) \ - V(ScheduleMicrotask, 1) + V(ScheduleMicrotask, 1) \ + V(GetCallbackHandle, 1) \ + V(GetCallbackFromHandle, 1) BUILTIN_NATIVE_LIST(DECLARE_FUNCTION); @@ -56,7 +60,7 @@ void DartRuntimeHooks::RegisterNatives(tonic::DartLibraryNatives* natives) { natives->Register({BUILTIN_NATIVE_LIST(REGISTER_FUNCTION)}); } -static Dart_Handle GetClosure(Dart_Handle builtin_library, const char* name) { +static Dart_Handle GetFunction(Dart_Handle builtin_library, const char* name) { Dart_Handle getter_name = ToDart(name); Dart_Handle closure = Dart_Invoke(builtin_library, getter_name, 0, nullptr); DART_CHECK_VALID(closure); @@ -64,7 +68,7 @@ static Dart_Handle GetClosure(Dart_Handle builtin_library, const char* name) { } static void InitDartInternal(Dart_Handle builtin_library, bool is_ui_isolate) { - Dart_Handle print = GetClosure(builtin_library, "_getPrintClosure"); + Dart_Handle print = GetFunction(builtin_library, "_getPrintClosure"); Dart_Handle internal_library = Dart_LookupLibrary(ToDart("dart:_internal")); @@ -101,7 +105,7 @@ static void InitDartAsync(Dart_Handle builtin_library, bool is_ui_isolate) { Dart_Handle schedule_microtask; if (is_ui_isolate) { schedule_microtask = - GetClosure(builtin_library, "_getScheduleMicrotaskClosure"); + GetFunction(builtin_library, "_getScheduleMicrotaskClosure"); } else { Dart_Handle isolate_lib = Dart_LookupLibrary(ToDart("dart:isolate")); Dart_Handle method_name = @@ -125,7 +129,8 @@ static void InitDartIO(Dart_Handle builtin_library, DART_CHECK_VALID(Dart_SetField(platform_type, ToDart("_nativeScript"), ToDart(script_uri))); } - Dart_Handle locale_closure = GetClosure(builtin_library, "_getLocaleClosure"); + Dart_Handle locale_closure = + GetFunction(builtin_library, "_getLocaleClosure"); DART_CHECK_VALID( Dart_SetField(platform_type, ToDart("_localeClosure"), locale_closure)); } @@ -223,4 +228,103 @@ void ScheduleMicrotask(Dart_NativeArguments args) { UIDartState::Current()->ScheduleMicrotask(closure); } +static std::string GetFunctionLibraryUrl(Dart_Handle closure) { + if (Dart_IsClosure(closure)) { + closure = Dart_ClosureFunction(closure); + DART_CHECK_VALID(closure); + } + + if (!Dart_IsFunction(closure)) { + return ""; + } + + Dart_Handle url = Dart_Null(); + Dart_Handle owner = Dart_FunctionOwner(closure); + if (Dart_IsInstance(owner)) { + owner = Dart_ClassLibrary(owner); + } + if (Dart_IsLibrary(owner)) { + url = Dart_LibraryUrl(owner); + DART_CHECK_VALID(url); + } + return DartConverter::FromDart(url); +} + +static std::string GetFunctionClassName(Dart_Handle closure) { + Dart_Handle result; + + if (Dart_IsClosure(closure)) { + closure = Dart_ClosureFunction(closure); + DART_CHECK_VALID(closure); + } + + if (!Dart_IsFunction(closure)) { + return ""; + } + + bool is_static = false; + result = Dart_FunctionIsStatic(closure, &is_static); + DART_CHECK_VALID(result); + if (!is_static) { + return ""; + } + + result = Dart_FunctionOwner(closure); + DART_CHECK_VALID(result); + + if (Dart_IsLibrary(result) || !Dart_IsInstance(result)) { + return ""; + } + return DartConverter::FromDart(Dart_ClassName(result)); +} + +static std::string GetFunctionName(Dart_Handle func) { + DART_CHECK_VALID(func); + + if (Dart_IsClosure(func)) { + func = Dart_ClosureFunction(func); + DART_CHECK_VALID(func); + } + + if (!Dart_IsFunction(func)) { + return ""; + } + + bool is_static = false; + Dart_Handle result = Dart_FunctionIsStatic(func, &is_static); + DART_CHECK_VALID(result); + if (!is_static) { + return ""; + } + + result = Dart_FunctionName(func); + if (Dart_IsError(result)) { + Dart_PropagateError(result); + return ""; + } + + return DartConverter::FromDart(result); +} + +void GetCallbackHandle(Dart_NativeArguments args) { + Dart_Handle func = Dart_GetNativeArgument(args, 0); + std::string name = GetFunctionName(func); + std::string class_name = GetFunctionClassName(func); + std::string library_path = GetFunctionLibraryUrl(func); + + if (name.empty()) { + Dart_SetReturnValue(args, Dart_Null()); + return; + } + Dart_SetReturnValue( + args, DartConverter::ToDart(DartCallbackCache::GetCallbackHandle( + name, class_name, library_path))); +} + +void GetCallbackFromHandle(Dart_NativeArguments args) { + Dart_Handle h = Dart_GetNativeArgument(args, 0); + int64_t handle = DartConverter::FromDart(h); + Dart_SetReturnValue(args, DartCallbackCache::GetCallback(handle)); +} + } // namespace blink diff --git a/lib/ui/dart_ui.gni b/lib/ui/dart_ui.gni index e1885d1d09ace..e9a315ac3694e 100644 --- a/lib/ui/dart_ui.gni +++ b/lib/ui/dart_ui.gni @@ -11,6 +11,7 @@ dart_ui_files = [ "$flutter_root/lib/ui/lerp.dart", "$flutter_root/lib/ui/natives.dart", "$flutter_root/lib/ui/painting.dart", + "$flutter_root/lib/ui/plugins.dart", "$flutter_root/lib/ui/pointer.dart", "$flutter_root/lib/ui/semantics.dart", "$flutter_root/lib/ui/text.dart", diff --git a/lib/ui/natives.dart b/lib/ui/natives.dart index 4dfb2e481675e..c31ecb0b6f51a 100644 --- a/lib/ui/natives.dart +++ b/lib/ui/natives.dart @@ -48,6 +48,9 @@ dynamic _saveCompilationTrace() native 'SaveCompilationTrace'; void _scheduleMicrotask(void callback()) native 'ScheduleMicrotask'; +int _getCallbackHandle(Function closure) native 'GetCallbackHandle'; +Function _getCallbackFromHandle(int handle) native 'GetCallbackFromHandle'; + // Required for gen_snapshot to work correctly. int _isolateId; diff --git a/lib/ui/plugins.dart b/lib/ui/plugins.dart new file mode 100644 index 0000000000000..215c52124763b --- /dev/null +++ b/lib/ui/plugins.dart @@ -0,0 +1,69 @@ +// 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. + +part of dart.ui; + +/// An wrapper for a raw callback handle. +class CallbackHandle { + final int _handle; + + /// Create an instance using a raw callback handle. + /// + /// Only values produced by a call to [CallbackHandle.toRawHandle] should be + /// used, otherwise this object will be an invalid handle. + CallbackHandle.fromRawHandle(this._handle) + : assert(_handle != null, "'_handle' must not be null."); + + /// Get the raw callback handle to pass over a [MethodChannel] or isolate + /// port. + int toRawHandle() => _handle; + + @override + int get hashCode => _handle; + + @override + bool operator ==(dynamic other) => + (other is CallbackHandle) && (_handle == other._handle); +} + +/// Functionality for Flutter plugin authors. +abstract class PluginUtilities { + // This class is only a namespace, and should not be instantiated or + // extended directly. + factory PluginUtilities._() => null; + + static Map _forwardCache = + {}; + static Map _backwardCache = + {}; + + /// Get a handle to a named top-level or static callback function which can + /// be easily passed between isolates. + /// + /// `callback` must not be null. + /// + /// Returns a [CallbackHandle] that can be provided to + /// [PluginUtilities.getCallbackFromHandle] to retrieve a tear-off of the + /// original callback. If `callback` is not a top-level or static function, + /// null is returned. + static CallbackHandle getCallbackHandle(Function callback) { + assert(callback != null, "'callback' must not be null."); + return _forwardCache.putIfAbsent(callback, + () => new CallbackHandle.fromRawHandle(_getCallbackHandle(callback))); + } + + /// Get a tear-off of a named top-level or static callback represented by a + /// handle. + /// + /// `handle` must not be null. + /// + /// If `handle` is not a valid handle returned by + /// [PluginUtilities.getCallbackHandle], null is returned. Otherwise, a + /// tear-off of the callback associated with `handle` is returned. + static Function getCallbackFromHandle(CallbackHandle handle) { + assert(handle != null, "'handle' must not be null."); + return _backwardCache.putIfAbsent( + handle, () => _getCallbackFromHandle(handle.toRawHandle())); + } +} diff --git a/lib/ui/plugins/callback_cache.cc b/lib/ui/plugins/callback_cache.cc new file mode 100644 index 0000000000000..ad31891a2f90c --- /dev/null +++ b/lib/ui/plugins/callback_cache.cc @@ -0,0 +1,87 @@ +// Copyright 2018 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/lib/ui/plugins/callback_cache.h" +#include "lib/fxl/logging.h" +#include "lib/tonic/converter/dart_converter.h" + +using tonic::ToDart; + +namespace blink { + +std::mutex DartCallbackCache::mutex_; +std::map DartCallbackCache::cache_; + +Dart_Handle DartCallbackCache::GetCallback(int64_t handle) { + std::unique_lock lock(mutex_); + auto iterator = cache_.find(handle); + if (iterator != cache_.end()) { + DartCallbackRepresentation cb = iterator->second; + return LookupDartClosure(cb.name, cb.class_name, cb.library_path); + } + return Dart_Null(); +} + +int64_t DartCallbackCache::GetCallbackHandle(const std::string& name, + const std::string& class_name, + const std::string& library_path) { + std::unique_lock lock(mutex_); + std::hash hasher; + int64_t hash = hasher(name); + hash += hasher(class_name); + hash += hasher(library_path); + + if (cache_.find(hash) == cache_.end()) { + cache_[hash] = {name, class_name, library_path}; + } + return hash; +} + +std::unique_ptr +DartCallbackCache::GetCallbackInformation(int64_t handle) { + std::unique_lock lock(mutex_); + auto iterator = cache_.find(handle); + if (iterator != cache_.end()) { + return std::make_unique(iterator->second); + } + return nullptr; +} + +Dart_Handle DartCallbackCache::LookupDartClosure( + const std::string& name, + const std::string& class_name, + const std::string& library_path) { + Dart_Handle closure_name = ToDart(name); + Dart_Handle library_name = + library_path.empty() ? Dart_Null() : ToDart(library_path); + Dart_Handle cls_name = class_name.empty() ? Dart_Null() : ToDart(class_name); + DART_CHECK_VALID(closure_name); + DART_CHECK_VALID(library_name); + DART_CHECK_VALID(cls_name); + + Dart_Handle library; + if (library_name == Dart_Null()) { + library = Dart_RootLibrary(); + } else { + library = Dart_LookupLibrary(library_name); + } + DART_CHECK_VALID(library); + + Dart_Handle closure; + if (Dart_IsNull(cls_name)) { + closure = Dart_GetClosure(library, closure_name); + } else { + Dart_Handle cls = Dart_GetClass(library, cls_name); + DART_CHECK_VALID(cls); + if (Dart_IsNull(cls)) { + closure = Dart_Null(); + } else { + closure = Dart_GetStaticMethodClosure(library, cls, closure_name); + } + } + DART_CHECK_VALID(closure); + return closure; +} + +} // namespace blink diff --git a/lib/ui/plugins/callback_cache.h b/lib/ui/plugins/callback_cache.h new file mode 100644 index 0000000000000..a32dfcbbcf02c --- /dev/null +++ b/lib/ui/plugins/callback_cache.h @@ -0,0 +1,55 @@ +// Copyright 2018 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_LIB_UI_CALLBACK_CACHE_H_ +#define FLUTTER_LIB_UI_CALLBACK_CACHE_H_ + +#include +#include +#include +#include + +#include "flutter/fml/synchronization/thread_annotations.h" +#include "lib/fxl/macros.h" +#include "third_party/dart/runtime/include/dart_api.h" + +#define DART_CALLBACK_INVALID_HANDLE -1 +#define LOCK_UNLOCK(m) FML_ACQUIRE(m) FML_RELEASE(m) + +namespace blink { + +typedef struct { + std::string name; + std::string class_name; + std::string library_path; +} DartCallbackRepresentation; + +class DartCallbackCache { + public: + static int64_t GetCallbackHandle(const std::string& name, + const std::string& class_name, + const std::string& library_path) + LOCK_UNLOCK(mutex_); + + static Dart_Handle GetCallback(int64_t handle) LOCK_UNLOCK(mutex_); + + static std::unique_ptr GetCallbackInformation( + int64_t handle) LOCK_UNLOCK(mutex_); + + private: + static Dart_Handle LookupDartClosure(const std::string& name, + const std::string& class_name, + const std::string& library_path); + + static std::mutex mutex_; + + static std::map cache_ + FML_GUARDED_BY(mutex_); + + FXL_DISALLOW_IMPLICIT_CONSTRUCTORS(DartCallbackCache); +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_CALLBACK_CACHE_H_ diff --git a/lib/ui/ui.dart b/lib/ui/ui.dart index 1d9782311f310..8c4480c072cdb 100644 --- a/lib/ui/ui.dart +++ b/lib/ui/ui.dart @@ -30,6 +30,7 @@ part 'isolate_name_server.dart'; part 'lerp.dart'; part 'natives.dart'; part 'painting.dart'; +part 'plugins.dart'; part 'pointer.dart'; part 'semantics.dart'; part 'text.dart'; diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 8774a827f9842..d1ecaf0191d9e 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -487,6 +487,48 @@ bool DartIsolate::Run(const std::string& entrypoint_name) { return true; } +FXL_WARN_UNUSED_RESULT +bool DartIsolate::RunFromLibrary(const std::string& library_name, + const std::string& entrypoint_name) { + TRACE_EVENT0("flutter", "DartIsolate::RunFromLibrary"); + if (phase_ != Phase::Ready) { + return false; + } + + tonic::DartState::Scope scope(this); + + Dart_Handle library = Dart_LookupLibrary(tonic::ToDart(library_name.c_str())); + if (tonic::LogIfError(library)) { + return false; + } + + Dart_Handle entrypoint = + Dart_GetClosure(library, tonic::ToDart(entrypoint_name.c_str())); + if (tonic::LogIfError(entrypoint)) { + return false; + } + + Dart_Handle isolate_lib = Dart_LookupLibrary(tonic::ToDart("dart:isolate")); + if (tonic::LogIfError(isolate_lib)) { + return false; + } + + Dart_Handle isolate_args[] = { + entrypoint, + Dart_Null(), + }; + + if (tonic::LogIfError(Dart_Invoke( + isolate_lib, tonic::ToDart("_startMainIsolate"), + sizeof(isolate_args) / sizeof(isolate_args[0]), isolate_args))) { + return false; + } + + phase_ = Phase::Running; + FXL_DLOG(INFO) << "New isolate is in the running state."; + return true; +} + bool DartIsolate::Shutdown() { TRACE_EVENT0("flutter", "DartIsolate::Shutdown"); // This call may be re-entrant since Dart_ShutdownIsolate can invoke the diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index fe928f40794ab..6ed4b04d415d2 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -79,6 +79,10 @@ class DartIsolate : public UIDartState { FXL_WARN_UNUSED_RESULT bool Run(const std::string& entrypoint); + FXL_WARN_UNUSED_RESULT + bool RunFromLibrary(const std::string& library_name, + const std::string& entrypoint); + FXL_WARN_UNUSED_RESULT bool Shutdown(); diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 60453633b126c..3f8896a224d70 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -152,9 +152,17 @@ bool Engine::PrepareAndLaunchIsolate(RunConfiguration configuration) { return false; } - if (!isolate->Run(configuration.GetEntrypoint())) { - FXL_LOG(ERROR) << "Could not run the isolate."; - return false; + if (configuration.GetEntrypointLibrary().empty()) { + if (!isolate->Run(configuration.GetEntrypoint())) { + FXL_LOG(ERROR) << "Could not run the isolate."; + return false; + } + } else { + if (!isolate->RunFromLibrary(configuration.GetEntrypointLibrary(), + configuration.GetEntrypoint())) { + FXL_LOG(ERROR) << "Could not run the isolate."; + return false; + } } return true; diff --git a/shell/common/run_configuration.cc b/shell/common/run_configuration.cc index eb315f25e8280..1fba1da6b9d6d 100644 --- a/shell/common/run_configuration.cc +++ b/shell/common/run_configuration.cc @@ -60,6 +60,12 @@ void RunConfiguration::SetEntrypoint(std::string entrypoint) { entrypoint_ = std::move(entrypoint); } +void RunConfiguration::SetEntrypointAndLibrary(std::string entrypoint, + std::string library) { + SetEntrypoint(entrypoint); + entrypoint_library_ = std::move(library); +} + fml::RefPtr RunConfiguration::GetAssetManager() const { return asset_manager_; } @@ -68,6 +74,10 @@ const std::string& RunConfiguration::GetEntrypoint() const { return entrypoint_; } +const std::string& RunConfiguration::GetEntrypointLibrary() const { + return entrypoint_library_; +} + std::unique_ptr RunConfiguration::TakeIsolateConfiguration() { return std::move(isolate_configuration_); diff --git a/shell/common/run_configuration.h b/shell/common/run_configuration.h index 5d45d2a26bc09..b0adf9181fa6d 100644 --- a/shell/common/run_configuration.h +++ b/shell/common/run_configuration.h @@ -37,16 +37,21 @@ class RunConfiguration { void SetEntrypoint(std::string entrypoint); + void SetEntrypointAndLibrary(std::string entrypoint, std::string library); + fml::RefPtr GetAssetManager() const; const std::string& GetEntrypoint() const; + const std::string& GetEntrypointLibrary() const; + std::unique_ptr TakeIsolateConfiguration(); private: std::unique_ptr isolate_configuration_; fml::RefPtr asset_manager_; std::string entrypoint_ = "main"; + std::string entrypoint_library_ = ""; FXL_DISALLOW_COPY_AND_ASSIGN(RunConfiguration); }; diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index d9450d64d65f4..8e0fb443f5f27 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -22,6 +22,7 @@ _flutter_framework_headers = [ "framework/Headers/Flutter.h", "framework/Headers/FlutterAppDelegate.h", "framework/Headers/FlutterBinaryMessenger.h", + "framework/Headers/FlutterCallbackCache.h", "framework/Headers/FlutterChannels.h", "framework/Headers/FlutterCodecs.h", "framework/Headers/FlutterDartProject.h", @@ -43,6 +44,8 @@ shared_library("create_flutter_framework_dylib") { sources = [ "framework/Source/FlutterAppDelegate.mm", + "framework/Source/FlutterAppDelegate_Internal.h", + "framework/Source/FlutterCallbackCache.mm", "framework/Source/FlutterChannels.mm", "framework/Source/FlutterCodecs.mm", "framework/Source/FlutterDartProject.mm", @@ -73,6 +76,8 @@ shared_library("create_flutter_framework_dylib") { "framework/Source/platform_message_router.mm", "framework/Source/vsync_waiter_ios.h", "framework/Source/vsync_waiter_ios.mm", + "headless_platform_view_ios.h", + "headless_platform_view_ios.mm", "ios_external_texture_gl.h", "ios_external_texture_gl.mm", "ios_gl_context.h", diff --git a/shell/platform/darwin/ios/framework/Headers/Flutter.h b/shell/platform/darwin/ios/framework/Headers/Flutter.h index d850854f2f517..ddadf8431368a 100644 --- a/shell/platform/darwin/ios/framework/Headers/Flutter.h +++ b/shell/platform/darwin/ios/framework/Headers/Flutter.h @@ -36,6 +36,7 @@ #include "FlutterAppDelegate.h" #include "FlutterBinaryMessenger.h" +#include "FlutterCallbackCache.h" #include "FlutterChannels.h" #include "FlutterCodecs.h" #include "FlutterDartProject.h" diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterCallbackCache.h b/shell/platform/darwin/ios/framework/Headers/FlutterCallbackCache.h new file mode 100644 index 0000000000000..7150838fafbb3 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Headers/FlutterCallbackCache.h @@ -0,0 +1,37 @@ +// 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. + +#ifndef FLUTTER_FLUTTERCALLBACKCACHE_H_ +#define FLUTTER_FLUTTERCALLBACKCACHE_H_ + +#import + +#include "FlutterMacros.h" + +FLUTTER_EXPORT +@interface FlutterCallbackInformation : NSObject +@property(retain) NSString* callbackName; +@property(retain) NSString* callbackClassName; +@property(retain) NSString* callbackLibraryPath; +@end + +FLUTTER_EXPORT +@interface FlutterCallbackCache : NSObject +/** + Returns the callback information for the given callback handle. + This callback information can be used when spawning a + FlutterHeadlessDartRunner. + + - Parameter handle: The handle for a callback, provided by the + Dart method `PluginUtilities.getCallbackHandle`. + - Returns: A FlutterCallbackInformation object which contains the name of the + callback, the name of the class in which the callback is defined, and the + path of the library which contains the callback. If the provided handle is + invalid, nil is returned. + */ ++ (FlutterCallbackInformation*)lookupCallbackInformation:(int64_t)handle; + +@end + +#endif // FLUTTER_FLUTTERCALLBACKCACHE_H_ diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h b/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h index 522766e410355..646a5164c43d9 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterHeadlessDartRunner.h @@ -7,28 +7,51 @@ #import +#include "FlutterBinaryMessenger.h" #include "FlutterDartProject.h" #include "FlutterMacros.h" +/** +A callback for when FlutterHeadlessDartRunner has attempted to start a Dart +Isolate in the background. + +- Parameter success: YES if the Isolate was started and run successfully, NO + otherwise. +*/ +typedef void (^FlutterHeadlessDartRunnerCallback)(BOOL success); + /** The FlutterHeadlessDartRunner runs Flutter Dart code with a null rasterizer, and no native drawing surface. It is appropriate for use in running Dart code e.g. in the background from a plugin. */ FLUTTER_EXPORT -@interface FlutterHeadlessDartRunner : NSObject +@interface FlutterHeadlessDartRunner : NSObject /** Runs a Dart function on an Isolate that is not the main application's Isolate. - The first call will create a new Isolate. Subsequent calls will reuse that - Isolate. The Isolate is destroyed when the FlutterHeadlessDartRunner is - destroyed. + The first call will create a new Isolate. Subsequent calls will return + immediately. - Parameter entrypoint: The name of a top-level function from the same Dart library that contains the app's main() function. */ - (void)runWithEntrypoint:(NSString*)entrypoint; +/** + Runs a Dart function on an Isolate that is not the main application's Isolate. + The first call will create a new Isolate. Subsequent calls will return + immediately. + + - Parameter entrypoint: The name of a top-level function from a Dart library. + - Parameter uri: The URI of the Dart library which contains entrypoint. + - Parameter callback: The callback to be invoked when the new Isolate is + invoked. +*/ +- (void)runWithEntrypointAndCallback:(NSString*)entrypoint + libraryUri:(NSString*)uri + completion:(FlutterHeadlessDartRunnerCallback)callback; + @end #endif // FLUTTER_FLUTTERHEADLESSDARTRUNNER_H_ diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h new file mode 100644 index 0000000000000..c01a33d6f3266 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h @@ -0,0 +1,18 @@ +// Copyright 2018 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/shell/platform/darwin/ios/framework/Headers/FlutterAppDelegate.h" + +@interface FlutterAppDelegate () + +@property(readonly, nonatomic) NSMutableArray* pluginDelegates; +@property(readonly, nonatomic) NSMutableDictionary* pluginPublications; + +@end + +@interface FlutterAppDelegateRegistrar : NSObject + +- (instancetype)initWithPlugin:(NSString*)pluginKey appDelegate:(FlutterAppDelegate*)delegate; + +@end diff --git a/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache.mm b/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache.mm new file mode 100644 index 0000000000000..61ff0b165d385 --- /dev/null +++ b/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache.mm @@ -0,0 +1,26 @@ +// 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 "flutter/shell/platform/darwin/ios/framework/Headers/FlutterCallbackCache.h" + +#include "flutter/lib/ui/plugins/callback_cache.h" + +@implementation FlutterCallbackInformation +@end + +@implementation FlutterCallbackCache + ++ (FlutterCallbackInformation*)lookupCallbackInformation:(int64_t)handle { + auto info = blink::DartCallbackCache::GetCallbackInformation(handle); + if (info == nullptr) { + return nil; + } + FlutterCallbackInformation* new_info = [[FlutterCallbackInformation alloc] init]; + new_info.callbackName = [NSString stringWithUTF8String:info->name.c_str()]; + new_info.callbackClassName = [NSString stringWithUTF8String:info->class_name.c_str()]; + new_info.callbackLibraryPath = [NSString stringWithUTF8String:info->library_path.c_str()]; + return new_info; +} + +@end \ No newline at end of file diff --git a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm index add5a78dc4a4c..0a422e2f77b06 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterHeadlessDartRunner.mm @@ -8,6 +8,7 @@ #include #include +#include #include "flutter/fml/message_loop.h" #include "flutter/shell/common/engine.h" @@ -17,29 +18,44 @@ #include "flutter/shell/common/switches.h" #include "flutter/shell/common/thread_host.h" #include "flutter/shell/platform/darwin/common/command_line.h" +#include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterDartProject_Internal.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h" +#include "flutter/shell/platform/darwin/ios/headless_platform_view_ios.h" +#include "flutter/shell/platform/darwin/ios/platform_view_ios.h" #include "lib/fxl/functional/make_copyable.h" -static std::unique_ptr CreateHeadlessPlatformView(shell::Shell& shell) { - return std::make_unique(shell, shell.GetTaskRunners()); +static std::unique_ptr CreateHeadlessPlatformView( + shell::Shell& shell) { + return std::make_unique(shell, shell.GetTaskRunners()); } static std::unique_ptr CreateHeadlessRasterizer(shell::Shell& shell) { return std::make_unique(shell.GetTaskRunners()); } +static std::string CreateShellLabel() { + static size_t count = 1; + std::stringstream stream; + stream << "io.flutter.headless."; + stream << count++; + return stream.str(); +} + @implementation FlutterHeadlessDartRunner { shell::ThreadHost _threadHost; std::unique_ptr _shell; } -- (void)runWithEntrypoint:(NSString*)entrypoint { +- (void)runWithEntrypointAndCallback:(NSString*)entrypoint + libraryUri:(NSString*)uri + completion:(FlutterHeadlessDartRunnerCallback)callback { if (_shell != nullptr || entrypoint.length == 0) { FXL_LOG(ERROR) << "This headless dart runner was already used to run some code."; return; } - const auto label = "io.flutter.headless"; + const auto label = CreateShellLabel(); // Create the threads to run the shell on. _threadHost = { @@ -59,6 +75,10 @@ - (void)runWithEntrypoint:(NSString*)entrypoint { auto settings = shell::SettingsFromCommandLine(shell::CommandLineFromNSProcessInfo()); + // These values set the name of the isolate for debugging. + settings.advisory_script_entrypoint = entrypoint.UTF8String; + settings.advisory_script_uri = uri.UTF8String; + // Create the shell. This is a blocking operation. _shell = shell::Shell::Create( std::move(task_runners), // task runners @@ -77,16 +97,61 @@ - (void)runWithEntrypoint:(NSString*)entrypoint { [[[FlutterDartProject alloc] initFromDefaultSourceForConfiguration] autorelease]; auto config = project.runConfiguration; - - config.SetEntrypoint(entrypoint.UTF8String); + config.SetEntrypointAndLibrary(entrypoint.UTF8String, uri.UTF8String); // Override the default run configuration with the specified entrypoint. _shell->GetTaskRunners().GetUITaskRunner()->PostTask( - fxl::MakeCopyable([engine = _shell->GetEngine(), config = std::move(config)]() mutable { + fxl::MakeCopyable([engine = _shell->GetEngine(), config = std::move(config), + callback = Block_copy(callback)]() mutable { + BOOL success = NO; + FXL_LOG(INFO) << "Attempting to launch background engine configuration..."; if (!engine || !engine->Run(std::move(config))) { FXL_LOG(ERROR) << "Could not launch engine with configuration."; + } else { + FXL_LOG(INFO) << "Background Isolate successfully started and run."; + success = YES; + } + if (callback != nil) { + callback(success); + Block_release(callback); } })); } +- (void)runWithEntrypoint:(NSString*)entrypoint { + [self runWithEntrypointAndCallback:entrypoint libraryUri:nil completion:nil]; +} + +#pragma mark - FlutterBinaryMessenger + +- (void)sendOnChannel:(NSString*)channel message:(NSData*)message { + [self sendOnChannel:channel message:message binaryReply:nil]; +} + +- (void)sendOnChannel:(NSString*)channel + message:(NSData*)message + binaryReply:(FlutterBinaryReply)callback { + NSAssert(channel, @"The channel must not be null"); + fxl::RefPtr response = + (callback == nil) ? nullptr + : fxl::MakeRefCounted( + ^(NSData* reply) { + callback(reply); + }, + _shell->GetTaskRunners().GetPlatformTaskRunner()); + fxl::RefPtr platformMessage = + (message == nil) ? fxl::MakeRefCounted(channel.UTF8String, response) + : fxl::MakeRefCounted( + channel.UTF8String, shell::GetVectorFromNSData(message), response); + + _shell->GetPlatformView()->DispatchPlatformMessage(platformMessage); +} + +- (void)setMessageHandlerOnChannel:(NSString*)channel + binaryMessageHandler:(FlutterBinaryMessageHandler)handler { + reinterpret_cast(_shell->GetPlatformView().get()) + ->GetPlatformMessageRouter() + .SetMessageHandler(channel.UTF8String, handler); +} + @end diff --git a/shell/platform/darwin/ios/headless_platform_view_ios.h b/shell/platform/darwin/ios/headless_platform_view_ios.h new file mode 100644 index 0000000000000..4b93080956cc0 --- /dev/null +++ b/shell/platform/darwin/ios/headless_platform_view_ios.h @@ -0,0 +1,38 @@ +// 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. + +#ifndef SHELL_PLATFORM_IOS_HEADLESS_PLATFORM_VIEW_IOS_H_ +#define SHELL_PLATFORM_IOS_HEADLESS_PLATFORM_VIEW_IOS_H_ + +#include + +#include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/platform/darwin/scoped_nsobject.h" +#include "flutter/shell/common/platform_view.h" +#include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h" +#include "lib/fxl/functional/closure.h" +#include "lib/fxl/macros.h" + +namespace shell { + +class HeadlessPlatformViewIOS : public PlatformView { + public: + explicit HeadlessPlatformViewIOS(Delegate& delegate, + blink::TaskRunners task_runners); + virtual ~HeadlessPlatformViewIOS(); + + PlatformMessageRouter& GetPlatformMessageRouter(); + + private: + PlatformMessageRouter platform_message_router_; + + // |shell::PlatformView| + void HandlePlatformMessage(fxl::RefPtr message); + + FXL_DISALLOW_COPY_AND_ASSIGN(HeadlessPlatformViewIOS); +}; + +} // namespace shell + +#endif // SHELL_PLATFORM_IOS_HEADLESS_PLATFORM_VIEW_IOS_H_ \ No newline at end of file diff --git a/shell/platform/darwin/ios/headless_platform_view_ios.mm b/shell/platform/darwin/ios/headless_platform_view_ios.mm new file mode 100644 index 0000000000000..87ee75891a1e6 --- /dev/null +++ b/shell/platform/darwin/ios/headless_platform_view_ios.mm @@ -0,0 +1,20 @@ + +#include "flutter/shell/platform/darwin/ios/headless_platform_view_ios.h" + +namespace shell { + +HeadlessPlatformViewIOS::HeadlessPlatformViewIOS(PlatformView::Delegate& delegate, + blink::TaskRunners task_runners) + : PlatformView(delegate, std::move(task_runners)) {} + +HeadlessPlatformViewIOS::~HeadlessPlatformViewIOS() = default; + +PlatformMessageRouter& HeadlessPlatformViewIOS::GetPlatformMessageRouter() { + return platform_message_router_; +} + +// |shell::PlatformView| +void HeadlessPlatformViewIOS::HandlePlatformMessage(fxl::RefPtr message) { + platform_message_router_.HandlePlatformMessage(std::move(message)); +} +} \ No newline at end of file diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index 3dc29b8b78a2a..8d1de7a0c092a 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -14,14 +14,14 @@ #include "flutter/shell/platform/darwin/ios/framework/Headers/FlutterViewController.h" #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h" #include "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge.h" -#include "flutter/shell/platform/darwin/ios/framework/Source/platform_message_router.h" +#include "flutter/shell/platform/darwin/ios/headless_platform_view_ios.h" #include "flutter/shell/platform/darwin/ios/ios_surface.h" #include "lib/fxl/functional/closure.h" #include "lib/fxl/macros.h" namespace shell { -class PlatformViewIOS final : public PlatformView { +class PlatformViewIOS final : public HeadlessPlatformViewIOS { public: explicit PlatformViewIOS(PlatformView::Delegate& delegate, blink::TaskRunners task_runners, @@ -30,8 +30,6 @@ class PlatformViewIOS final : public PlatformView { ~PlatformViewIOS() override; - PlatformMessageRouter& GetPlatformMessageRouter(); - FlutterViewController* GetOwnerViewController() const; void RegisterExternalTexture(int64_t id, NSObject* texture); @@ -59,9 +57,6 @@ class PlatformViewIOS final : public PlatformView { // |shell::PlatformView| void SetSemanticsEnabled(bool enabled) override; - // |shell::PlatformView| - void HandlePlatformMessage( - fxl::RefPtr message) override; // |shell::PlatformView| void UpdateSemantics(blink::SemanticsNodeUpdates update, diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index 8d77716252f2b..f1cfc70e35f33 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -21,7 +21,7 @@ blink::TaskRunners task_runners, FlutterViewController* owner_controller, FlutterView* owner_view) - : PlatformView(delegate, std::move(task_runners)), + : HeadlessPlatformViewIOS(delegate, std::move(task_runners)), owner_controller_(owner_controller), owner_view_(owner_view), ios_surface_(owner_view_.createSurface) { @@ -36,10 +36,6 @@ return owner_controller_; } -PlatformMessageRouter& PlatformViewIOS::GetPlatformMessageRouter() { - return platform_message_router_; -} - void PlatformViewIOS::RegisterExternalTexture(int64_t texture_id, NSObject* texture) { RegisterTexture(std::make_shared(texture_id, texture)); @@ -79,11 +75,6 @@ } } -// |shell::PlatformView| -void PlatformViewIOS::HandlePlatformMessage(fxl::RefPtr message) { - platform_message_router_.HandlePlatformMessage(std::move(message)); -} - // |shell::PlatformView| std::unique_ptr PlatformViewIOS::CreateVSyncWaiter() { return std::make_unique(task_runners_); diff --git a/testing/dart/plugin_utilities_test.dart b/testing/dart/plugin_utilities_test.dart new file mode 100644 index 0000000000000..89f43824bc2dc --- /dev/null +++ b/testing/dart/plugin_utilities_test.dart @@ -0,0 +1,43 @@ +// 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:ui'; + +import 'package:test/test.dart'; + +String top() => "top"; + +class Foo { + const Foo(); + static int getInt() => 1; + double getDouble() => 1.0; +} + +const Foo foo = const Foo(); + +void main() { + test('PluginUtilities Callback Handles', () { + // Top level callback. + final hTop = PluginUtilities.getCallbackHandle(top); + expect(hTop, isNotNull); + expect(hTop, isNot(0)); + expect(PluginUtilities.getCallbackHandle(top), hTop); + final topClosure = PluginUtilities.getCallbackFromHandle(hTop); + expect(topClosure, isNotNull); + expect(topClosure(), "top"); + + // Static method callback + final hGetInt = PluginUtilities.getCallbackHandle(Foo.getInt); + expect(hGetInt, isNotNull); + expect(hGetInt, isNot(0)); + expect(PluginUtilities.getCallbackHandle(Foo.getInt), hGetInt); + final getIntClosure = PluginUtilities.getCallbackFromHandle(hGetInt); + expect(getIntClosure, isNotNull); + expect(getIntClosure(), 1); + + // Instance method callbacks cannot be looked up. + final foo = new Foo(); + expect(PluginUtilities.getCallbackHandle(foo.getDouble), isNull); + }); +} diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 545aa1144973f..75d0f144fde64 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -1,61 +1,53 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See http://pub.dartlang.org/doc/glossary.html#lockfile packages: archive: - dependency: "direct main" description: name: archive url: "https://pub.dartlang.org" source: hosted version: "1.0.33" args: - dependency: "direct main" description: name: args url: "https://pub.dartlang.org" source: hosted version: "0.13.7" charcode: - dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted version: "1.1.1" collection: - dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted version: "1.14.5" convert: - dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted version: "2.0.1" crypto: - dependency: "direct main" description: name: crypto url: "https://pub.dartlang.org" source: hosted version: "2.0.2+1" path: - dependency: "direct main" description: name: path url: "https://pub.dartlang.org" source: hosted version: "1.5.1" typed_data: - dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <=2.0.0-edge.2b36f923d95a41b2f1c5cbb5edd9872f68c18112" + dart: ">=1.21.0 <2.0.0" diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index a14034994f4dd..29035a43eb7ae 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -206,6 +206,7 @@ FILE: ../../../flutter/shell/platform/darwin/desktop/Info.plist FILE: ../../../flutter/shell/platform/darwin/ios/framework/Flutter.podspec FILE: ../../../flutter/shell/platform/darwin/ios/framework/Info.plist FILE: ../../../flutter/shell/platform/darwin/ios/framework/module.modulemap +FILE: ../../../flutter/shell/platform/darwin/ios/headless_platform_view_ios.mm FILE: ../../../flutter/shell/platform/embedder/assets/EmbedderInfo.plist FILE: ../../../flutter/shell/platform/embedder/assets/embedder.modulemap FILE: ../../../flutter/shell/platform/embedder/fixtures/simple_main.dart @@ -489,6 +490,7 @@ FILE: ../../../flutter/flutter_kernel_transformers/lib/track_widget_constructor_ FILE: ../../../flutter/lib/ui/isolate_name_server.dart FILE: ../../../flutter/lib/ui/painting/image_encoding.cc FILE: ../../../flutter/lib/ui/painting/image_encoding.h +FILE: ../../../flutter/lib/ui/plugins.dart FILE: ../../../flutter/lib/ui/semantics/custom_accessibility_action.cc FILE: ../../../flutter/lib/ui/semantics/custom_accessibility_action.h FILE: ../../../flutter/lib/ui/text/asset_manager_font_provider.cc @@ -499,10 +501,13 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/Platfor FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistry.java FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistryImpl.java FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterCallbackCache.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/accessibility_text_entry.mm +FILE: ../../../flutter/shell/platform/darwin/ios/headless_platform_view_ios.h ---------------------------------------------------------------------------------------------------- Copyright 2018 The Chromium Authors. All rights reserved. @@ -590,12 +595,15 @@ FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server.cc FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server.h FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server_natives.cc FILE: ../../../flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h +FILE: ../../../flutter/lib/ui/plugins/callback_cache.cc +FILE: ../../../flutter/lib/ui/plugins/callback_cache.h FILE: ../../../flutter/shell/common/isolate_configuration.cc FILE: ../../../flutter/shell/common/isolate_configuration.h FILE: ../../../flutter/shell/platform/android/android_shell_holder.cc FILE: ../../../flutter/shell/platform/android/android_shell_holder.h FILE: ../../../flutter/shell/platform/android/platform_message_response_android.cc FILE: ../../../flutter/shell/platform/android/platform_message_response_android.h +FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate_Internal.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/platform_message_response_darwin.mm ---------------------------------------------------------------------------------------------------- From 2daa0aaf4270bdd2fbff4fa4b5b06f973e8ec834 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 13 Jul 2018 14:19:50 -0400 Subject: [PATCH 0769/1190] Roll src/third_party/skia 4a17501f5bbd..0df21136e3dc (7 commits) (#5742) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5d79a45d6a6cc..9ce3a9504d9b1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4a17501f5bbd5e45a49d76d7a733393fec9701ee', + 'skia_revision': '0df21136e3dc5434149695f09b79aff271430365', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b182282f093d5..5c70d7dcd6079 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c757bb5e355f10b554c7c35af53b6c8d +Signature: 6f5b7034b4b2017ac58a7a51fa655935 UNUSED LICENSES: From 3eb8c04efc87b10d25b7e238b82a3f673f62b31c Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 13 Jul 2018 12:37:42 -0700 Subject: [PATCH 0770/1190] fix typo in interop code (#5743) --- lib/ui/semantics.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 174b21ae8d25a..91766160d0f17 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -571,7 +571,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { assert(label != null && label != ''); _updateCustomAction(id, label); } - void _updateCustomAction(int id, String label) native 'SemanticsUpdateBuilder_updateAction'; + void _updateCustomAction(int id, String label) native 'SemanticsUpdateBuilder_updateCustomAction'; /// Creates a [SemanticsUpdate] object that encapsulates the updates recorded /// by this object. From e1cf837a20ff96ff642f48483accb6db033b055e Mon Sep 17 00:00:00 2001 From: liyuqian Date: Fri, 13 Jul 2018 12:38:16 -0700 Subject: [PATCH 0771/1190] Add ClipMode to ClipPath/ClipRRect and PhysicalShape layers (#5647) For flutter/flutter#18057 --- flow/layers/clip_path_layer.cc | 11 +++- flow/layers/clip_path_layer.h | 3 +- flow/layers/clip_rect_layer.cc | 11 +++- flow/layers/clip_rect_layer.h | 3 +- flow/layers/clip_rrect_layer.cc | 11 +++- flow/layers/clip_rrect_layer.h | 3 +- flow/layers/default_layer_builder.cc | 18 +++--- flow/layers/default_layer_builder.h | 9 +-- flow/layers/layer.h | 13 +++++ flow/layers/layer_builder.h | 9 +-- flow/layers/physical_shape_layer.cc | 25 +++++++-- flow/layers/physical_shape_layer.h | 3 +- lib/ui/compositing.dart | 49 +++++++++++----- lib/ui/compositing/scene_builder.cc | 19 ++++--- lib/ui/compositing/scene_builder.h | 8 +-- lib/ui/painting.dart | 83 ++++++++++++++++++++++++++++ 16 files changed, 219 insertions(+), 59 deletions(-) diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index e5547a39a90d3..d6c091ee15e91 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -12,7 +12,7 @@ namespace flow { -ClipPathLayer::ClipPathLayer() = default; +ClipPathLayer::ClipPathLayer(ClipMode clip_mode) : clip_mode_(clip_mode) {} ClipPathLayer::~ClipPathLayer() = default; @@ -38,6 +38,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { bounds.height() // height ); + // TODO(liyuqian): respect clip_mode_ SceneUpdateContext::Clip clip(context, shape, bounds); UpdateSceneChildren(context); } @@ -49,8 +50,14 @@ void ClipPathLayer::Paint(PaintContext& context) const { FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); - context.canvas.clipPath(clip_path_, true); + context.canvas.clipPath(clip_path_, clip_mode_ != ClipMode::hardEdge); + if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + context.canvas.saveLayer(paint_bounds(), nullptr); + } PaintChildren(context); + if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + context.canvas.restore(); + } } } // namespace flow diff --git a/flow/layers/clip_path_layer.h b/flow/layers/clip_path_layer.h index 87a37bdc8aaab..78017144eda2d 100644 --- a/flow/layers/clip_path_layer.h +++ b/flow/layers/clip_path_layer.h @@ -11,7 +11,7 @@ namespace flow { class ClipPathLayer : public ContainerLayer { public: - ClipPathLayer(); + ClipPathLayer(ClipMode clip_mode = ClipMode::antiAlias); ~ClipPathLayer() override; void set_clip_path(const SkPath& clip_path) { clip_path_ = clip_path; } @@ -26,6 +26,7 @@ class ClipPathLayer : public ContainerLayer { private: SkPath clip_path_; + ClipMode clip_mode_; FXL_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); }; diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index 0e613793426fd..0fca7ab821063 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -6,7 +6,7 @@ namespace flow { -ClipRectLayer::ClipRectLayer() = default; +ClipRectLayer::ClipRectLayer(ClipMode clip_mode) : clip_mode_(clip_mode) {} ClipRectLayer::~ClipRectLayer() = default; @@ -29,6 +29,7 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { clip_rect_.height() // height ); + // TODO(liyuqian): respect clip_mode_ SceneUpdateContext::Clip clip(context, shape, clip_rect_); UpdateSceneChildren(context); } @@ -39,9 +40,15 @@ void ClipRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); FXL_DCHECK(needs_painting()); - SkAutoCanvasRestore save(&context.canvas, true); + SkAutoCanvasRestore save(&context.canvas, clip_mode_ != ClipMode::hardEdge); context.canvas.clipRect(paint_bounds()); + if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + context.canvas.saveLayer(paint_bounds(), nullptr); + } PaintChildren(context); + if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + context.canvas.restore(); + } } } // namespace flow diff --git a/flow/layers/clip_rect_layer.h b/flow/layers/clip_rect_layer.h index a7dfecc88eebc..6e508563599d0 100644 --- a/flow/layers/clip_rect_layer.h +++ b/flow/layers/clip_rect_layer.h @@ -11,7 +11,7 @@ namespace flow { class ClipRectLayer : public ContainerLayer { public: - ClipRectLayer(); + ClipRectLayer(ClipMode clip_mode); ~ClipRectLayer() override; void set_clip_rect(const SkRect& clip_rect) { clip_rect_ = clip_rect; } @@ -25,6 +25,7 @@ class ClipRectLayer : public ContainerLayer { private: SkRect clip_rect_; + ClipMode clip_mode_; FXL_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); }; diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index 67ec489d6b6c7..0a7ce3864a5b2 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -6,7 +6,7 @@ namespace flow { -ClipRRectLayer::ClipRRectLayer() = default; +ClipRRectLayer::ClipRRectLayer(ClipMode clip_mode) : clip_mode_(clip_mode) {} ClipRRectLayer::~ClipRRectLayer() = default; @@ -36,6 +36,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { clip_rrect_.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius ); + // TODO(liyuqian): respect clip_mode_ SceneUpdateContext::Clip clip(context, shape, clip_rrect_.getBounds()); UpdateSceneChildren(context); } @@ -47,8 +48,14 @@ void ClipRRectLayer::Paint(PaintContext& context) const { FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); - context.canvas.clipRRect(clip_rrect_, true); + context.canvas.clipRRect(clip_rrect_, clip_mode_ != ClipMode::hardEdge); + if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + context.canvas.saveLayer(paint_bounds(), nullptr); + } PaintChildren(context); + if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + context.canvas.restore(); + } } } // namespace flow diff --git a/flow/layers/clip_rrect_layer.h b/flow/layers/clip_rrect_layer.h index 5763313c97195..24c7badf9b58e 100644 --- a/flow/layers/clip_rrect_layer.h +++ b/flow/layers/clip_rrect_layer.h @@ -11,7 +11,7 @@ namespace flow { class ClipRRectLayer : public ContainerLayer { public: - ClipRRectLayer(); + ClipRRectLayer(ClipMode clip_mode); ~ClipRRectLayer() override; void set_clip_rrect(const SkRRect& clip_rrect) { clip_rrect_ = clip_rrect; } @@ -26,6 +26,7 @@ class ClipRRectLayer : public ContainerLayer { private: SkRRect clip_rrect_; + ClipMode clip_mode_; FXL_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); }; diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index fb2280b27edef..c17f77cc14023 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -49,32 +49,33 @@ void DefaultLayerBuilder::PushTransform(const SkMatrix& sk_matrix) { PushLayer(std::move(layer), cullRect); } -void DefaultLayerBuilder::PushClipRect(const SkRect& clipRect) { +void DefaultLayerBuilder::PushClipRect(const SkRect& clipRect, ClipMode clip_mode) { SkRect cullRect; if (!cullRect.intersect(clipRect, cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); } - auto layer = std::make_unique(); + auto layer = std::make_unique(clip_mode); layer->set_clip_rect(clipRect); PushLayer(std::move(layer), cullRect); } -void DefaultLayerBuilder::PushClipRoundedRect(const SkRRect& rrect) { +void DefaultLayerBuilder::PushClipRoundedRect(const SkRRect& rrect, ClipMode clip_mode) { SkRect cullRect; if (!cullRect.intersect(rrect.rect(), cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); } - auto layer = std::make_unique(); + auto layer = std::make_unique(clip_mode); layer->set_clip_rrect(rrect); PushLayer(std::move(layer), cullRect); } -void DefaultLayerBuilder::PushClipPath(const SkPath& path) { +void DefaultLayerBuilder::PushClipPath(const SkPath& path, ClipMode clip_mode) { + FXL_DCHECK(clip_mode != ClipMode::none); SkRect cullRect; if (!cullRect.intersect(path.getBounds(), cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); } - auto layer = std::make_unique(); + auto layer = std::make_unique(clip_mode); layer->set_clip_path(path); PushLayer(std::move(layer), cullRect); } @@ -113,12 +114,13 @@ void DefaultLayerBuilder::PushPhysicalShape(const SkPath& sk_path, double elevation, SkColor color, SkColor shadow_color, - SkScalar device_pixel_ratio) { + SkScalar device_pixel_ratio, + ClipMode clip_mode) { SkRect cullRect; if (!cullRect.intersect(sk_path.getBounds(), cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); } - auto layer = std::make_unique(); + auto layer = std::make_unique(clip_mode); layer->set_path(sk_path); layer->set_elevation(elevation); layer->set_color(color); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index cadd173ab5a84..267eaad83f9d7 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -24,13 +24,13 @@ class DefaultLayerBuilder final : public LayerBuilder { void PushTransform(const SkMatrix& matrix) override; // |flow::LayerBuilder| - void PushClipRect(const SkRect& rect) override; + void PushClipRect(const SkRect& rect, ClipMode clip_mode = ClipMode::antiAlias) override; // |flow::LayerBuilder| - void PushClipRoundedRect(const SkRRect& rect) override; + void PushClipRoundedRect(const SkRRect& rect, ClipMode clip_mode = ClipMode::antiAlias) override; // |flow::LayerBuilder| - void PushClipPath(const SkPath& path) override; + void PushClipPath(const SkPath& path, ClipMode clip_mode = ClipMode::antiAlias) override; // |flow::LayerBuilder| void PushOpacity(int alpha) override; @@ -51,7 +51,8 @@ class DefaultLayerBuilder final : public LayerBuilder { double elevation, SkColor color, SkColor shadow_color, - SkScalar device_pixel_ratio) override; + SkScalar device_pixel_ratio, + ClipMode clip_mode) override; // |flow::LayerBuilder| void PushPerformanceOverlay(uint64_t enabled_options, diff --git a/flow/layers/layer.h b/flow/layers/layer.h index 87539d3e98b5d..464787ebdab3d 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -34,6 +34,19 @@ namespace flow { +// This should be an exact copy of the Clip enum in painting.dart. +// +// We call it Clip in public Dart API to provide our developers the shortest +// name and the best experience. We call it ClipMode in C++ because we want to +// avoid name conflicts and refactoring C++ names without a nice IDE function +// is tedious. +enum ClipMode { + none, + hardEdge, + antiAlias, + antiAliasWithSaveLayer +}; + class ContainerLayer; // Represents a single composited layer. Created on the UI thread but then diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index a29e959514428..93195b0364ca6 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -32,11 +32,11 @@ class LayerBuilder { virtual void PushTransform(const SkMatrix& matrix) = 0; - virtual void PushClipRect(const SkRect& rect) = 0; + virtual void PushClipRect(const SkRect& rect, ClipMode clip_mode = ClipMode::antiAlias) = 0; - virtual void PushClipRoundedRect(const SkRRect& rect) = 0; + virtual void PushClipRoundedRect(const SkRRect& rect, ClipMode clip_mode = ClipMode::antiAlias) = 0; - virtual void PushClipPath(const SkPath& path) = 0; + virtual void PushClipPath(const SkPath& path, ClipMode clip_mode = ClipMode::antiAlias) = 0; virtual void PushOpacity(int alpha) = 0; @@ -52,7 +52,8 @@ class LayerBuilder { double elevation, SkColor color, SkColor shadow_color, - SkScalar device_pixel_ratio) = 0; + SkScalar device_pixel_ratio, + ClipMode clip_mode) = 0; virtual void PushPerformanceOverlay(uint64_t enabled_options, const SkRect& rect) = 0; diff --git a/flow/layers/physical_shape_layer.cc b/flow/layers/physical_shape_layer.cc index b793132cc89e2..a60b38dc5e8c6 100644 --- a/flow/layers/physical_shape_layer.cc +++ b/flow/layers/physical_shape_layer.cc @@ -9,7 +9,7 @@ namespace flow { -PhysicalShapeLayer::PhysicalShapeLayer() : isRect_(false) {} +PhysicalShapeLayer::PhysicalShapeLayer(ClipMode clip_mode) : isRect_(false), clip_mode_(clip_mode) {} PhysicalShapeLayer::~PhysicalShapeLayer() = default; @@ -90,12 +90,25 @@ void PhysicalShapeLayer::Paint(PaintContext& context) const { paint.setColor(color_); context.canvas.drawPath(path_, paint); - SkAutoCanvasRestore save(&context.canvas, false); - context.canvas.save(); - context.canvas.clipPath(path_, true); + int saveCount = context.canvas.save(); + switch(clip_mode_) { + case ClipMode::hardEdge: + context.canvas.clipPath(path_, false); + break; + case ClipMode::antiAlias: + context.canvas.clipPath(path_, true); + break; + case ClipMode::antiAliasWithSaveLayer: + context.canvas.clipPath(path_, true); + context.canvas.saveLayer(paint_bounds(), nullptr); + break; + case ClipMode::none: + break; + } + PaintChildren(context); - if (context.checkerboard_offscreen_layers && !isRect_) - DrawCheckerboard(&context.canvas, path_.getBounds()); + + context.canvas.restoreToCount(saveCount); } void PhysicalShapeLayer::DrawShadow(SkCanvas* canvas, diff --git a/flow/layers/physical_shape_layer.h b/flow/layers/physical_shape_layer.h index c3df356b63e1e..9ed4e3a50efb8 100644 --- a/flow/layers/physical_shape_layer.h +++ b/flow/layers/physical_shape_layer.h @@ -11,7 +11,7 @@ namespace flow { class PhysicalShapeLayer : public ContainerLayer { public: - PhysicalShapeLayer(); + PhysicalShapeLayer(ClipMode clip_mode); ~PhysicalShapeLayer() override; void set_path(const SkPath& path); @@ -44,6 +44,7 @@ class PhysicalShapeLayer : public ContainerLayer { SkPath path_; bool isRect_; SkRRect frameRRect_; + ClipMode clip_mode_; }; } // namespace flow diff --git a/lib/ui/compositing.dart b/lib/ui/compositing.dart index 35595f4cf685f..f83a7deb4af4d 100644 --- a/lib/ui/compositing.dart +++ b/lib/ui/compositing.dart @@ -66,29 +66,44 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// /// Rasterization outside the given rectangle is discarded. /// - /// See [pop] for details about the operation stack. - void pushClipRect(Rect rect) { - _pushClipRect(rect.left, rect.right, rect.top, rect.bottom); + /// See [pop] for details about the operation stack, and [Clip] for different clip modes. + /// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]). + void pushClipRect(Rect rect, {Clip clip = Clip.antiAlias}) { + assert(clip != null); + assert(clip != Clip.none); + _pushClipRect(rect.left, rect.right, rect.top, rect.bottom, clip.index); } void _pushClipRect(double left, double right, double top, - double bottom) native 'SceneBuilder_pushClipRect'; + double bottom, + int clipMode) native 'SceneBuilder_pushClipRect'; /// Pushes a rounded-rectangular clip operation onto the operation stack. /// /// Rasterization outside the given rounded rectangle is discarded. /// - /// See [pop] for details about the operation stack. - void pushClipRRect(RRect rrect) => _pushClipRRect(rrect._value); - void _pushClipRRect(Float32List rrect) native 'SceneBuilder_pushClipRRect'; + /// See [pop] for details about the operation stack, and [Clip] for different clip modes. + /// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]). + void pushClipRRect(RRect rrect, {Clip clip = Clip.antiAlias}) { + assert(clip != null); + assert(clip != Clip.none); + _pushClipRRect(rrect._value, clip.index); + } + void _pushClipRRect(Float32List rrect, int clipMode) native 'SceneBuilder_pushClipRRect'; /// Pushes a path clip operation onto the operation stack. /// /// Rasterization outside the given path is discarded. /// - /// See [pop] for details about the operation stack. - void pushClipPath(Path path) native 'SceneBuilder_pushClipPath'; + /// See [pop] for details about the operation stack. See [Clip] for different clip modes. + /// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]). + void pushClipPath(Path path, {Clip clip = Clip.antiAlias}) { + assert(clip != null); + assert(clip != Clip.none); + _pushClipPath(path, clip.index); + } + void _pushClipPath(Path path, int clipMode) native 'SceneBuilder_pushClipPath'; /// Pushes an opacity operation onto the operation stack. /// @@ -143,16 +158,20 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// Pushes a physical layer operation for an arbitrary shape onto the /// operation stack. /// - /// Rasterization will be clipped to the given shape defined by [path]. If - /// [elevation] is greater than 0.0, then a shadow is drawn around the layer. + /// By default, the layer's content will not be clipped (clip = [Clip.none]). + /// If clip equals [Clip.hardEdge], [Clip.antiAlias], or [Clip.antiAliasWithSaveLayer], + /// then the content is clipped to the given shape defined by [path]. + /// + /// If [elevation] is greater than 0.0, then a shadow is drawn around the layer. /// [shadowColor] defines the color of the shadow if present and [color] defines the /// color of the layer background. /// - /// See [pop] for details about the operation stack. - void pushPhysicalShape({ Path path, double elevation, Color color, Color shadowColor}) { - _pushPhysicalShape(path, elevation, color.value, shadowColor?.value ?? 0xFF000000); + /// See [pop] for details about the operation stack, and [Clip] for different clip modes. + // ignore: deprecated_member_use + void pushPhysicalShape({ Path path, double elevation, Color color, Color shadowColor, Clip clip = defaultClipBehavior}) { + _pushPhysicalShape(path, elevation, color.value, shadowColor?.value ?? 0xFF000000, clip.index); } - void _pushPhysicalShape(Path path, double elevation, int color, int shadowColor) native + void _pushPhysicalShape(Path path, double elevation, int color, int shadowColor, int clipMode) native 'SceneBuilder_pushPhysicalShape'; /// Ends the effect of the most recently pushed operation. diff --git a/lib/ui/compositing/scene_builder.cc b/lib/ui/compositing/scene_builder.cc index 60b911cb4ddec..fda3b8ee85813 100644 --- a/lib/ui/compositing/scene_builder.cc +++ b/lib/ui/compositing/scene_builder.cc @@ -62,16 +62,17 @@ void SceneBuilder::pushTransform(const tonic::Float64List& matrix4) { void SceneBuilder::pushClipRect(double left, double right, double top, - double bottom) { - layer_builder_->PushClipRect(SkRect::MakeLTRB(left, top, right, bottom)); + double bottom, + int clipMode) { + layer_builder_->PushClipRect(SkRect::MakeLTRB(left, top, right, bottom), static_cast(clipMode)); } -void SceneBuilder::pushClipRRect(const RRect& rrect) { - layer_builder_->PushClipRoundedRect(rrect.sk_rrect); +void SceneBuilder::pushClipRRect(const RRect& rrect, int clipMode) { + layer_builder_->PushClipRoundedRect(rrect.sk_rrect, static_cast(clipMode)); } -void SceneBuilder::pushClipPath(const CanvasPath* path) { - layer_builder_->PushClipPath(path->path()); +void SceneBuilder::pushClipPath(const CanvasPath* path, int clipMode) { + layer_builder_->PushClipPath(path->path(), static_cast(clipMode)); } void SceneBuilder::pushOpacity(int alpha) { @@ -103,13 +104,15 @@ void SceneBuilder::pushShaderMask(Shader* shader, void SceneBuilder::pushPhysicalShape(const CanvasPath* path, double elevation, int color, - int shadow_color) { + int shadow_color, + int clip_mode) { layer_builder_->PushPhysicalShape( path->path(), // elevation, // static_cast(color), // static_cast(shadow_color), - UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio); + UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio, + static_cast(clip_mode)); } void SceneBuilder::pop() { diff --git a/lib/ui/compositing/scene_builder.h b/lib/ui/compositing/scene_builder.h index fd1e20d2aa0bc..ebbc35efa2064 100644 --- a/lib/ui/compositing/scene_builder.h +++ b/lib/ui/compositing/scene_builder.h @@ -35,9 +35,9 @@ class SceneBuilder : public fxl::RefCountedThreadSafe, ~SceneBuilder() override; void pushTransform(const tonic::Float64List& matrix4); - void pushClipRect(double left, double right, double top, double bottom); - void pushClipRRect(const RRect& rrect); - void pushClipPath(const CanvasPath* path); + void pushClipRect(double left, double right, double top, double bottom, int clipMode); + void pushClipRRect(const RRect& rrect, int clipMode); + void pushClipPath(const CanvasPath* path, int clipMode); void pushOpacity(int alpha); void pushColorFilter(int color, int blendMode); void pushBackdropFilter(ImageFilter* filter); @@ -47,7 +47,7 @@ class SceneBuilder : public fxl::RefCountedThreadSafe, double maskRectTop, double maskRectBottom, int blendMode); - void pushPhysicalShape(const CanvasPath* path, double elevation, int color, int shadowColor); + void pushPhysicalShape(const CanvasPath* path, double elevation, int color, int shadowColor, int clipMode); void pop(); diff --git a/lib/ui/painting.dart b/lib/ui/painting.dart index 348432ec7229f..e2fe0521a6ac7 100644 --- a/lib/ui/painting.dart +++ b/lib/ui/painting.dart @@ -942,6 +942,89 @@ enum PaintingStyle { stroke, } + +/// Different ways to clip a widget's content. +enum Clip { + /// No clip at all. + /// + /// This is the default option for most widgets: if the content does not + /// overflow the widget boundary, don't pay any performance cost for clipping. + /// + /// If the content does overflow, please explicitly specify the following + /// [Clip] options: + /// * [hardEdge], which is the fastest clipping, but with lower fidelity. + /// * [antiAlias], which is a little slower than [hardEdge], but with smoothed edges. + /// * [antiAliasWithSaveLayer], which is much slower than [antiAlias], and should + /// rarely be used. + none, + + /// Clip, but do not apply anti-aliasing. + /// + /// This mode enables clipping, but curves and non-axis-aligned straight lines will be + /// jagged as no effort is made to anti-alias. + /// + /// Faster than other clipping modes, but slower than [none]. + /// + /// This is a reasonable choice when clipping is needed, if the container is an axis- + /// aligned rectangle or an axis-aligned rounded rectangle with very small corner radii. + /// + /// See also: + /// + /// * [antiAlias], which is more reasonable when clipping is needed and the shape is not + /// an axis-aligned rectangle. + hardEdge, + + /// Clip with anti-aliasing. + /// + /// This mode has anti-aliased clipping edges to achieve a smoother look. + /// + /// It' s much faster than [antiAliasWithSaveLayer], but slower than [hardEdge]. + /// + /// This will be the common case when dealing with circles and arcs. + /// + /// Different from [hardEdge] and [antiAliasWithSaveLayer], this clipping may have + /// bleeding edge artifacts. + /// (See https://fiddle.skia.org/c/21cb4c2b2515996b537f36e7819288ae for an example.) + /// + /// See also: + /// + /// * [hardEdge], which is a little faster, but with lower fidelity. + /// * [antiAliasWithSaveLayer], which is much slower, but can avoid the + /// bleeding edges if there's no other way. + /// * [Paint.isAntiAlias], which is the anti-aliasing switch for general draw operations. + antiAlias, + + /// Clip with anti-aliasing and saveLayer immediately following the clip. + /// + /// This mode not only clips with anti-aliasing, but also allocates an offscreen + /// buffer. All subsequent paints are carried out on that buffer before finally + /// being clipped and composited back. + /// + /// This is very slow. It has no bleeding edge artifacts (that [antiAlias] has) + /// but it changes the semantics as an offscreen buffer is now introduced. + /// (See https://github.com/flutter/flutter/issues/18057#issuecomment-394197336 + /// for a difference between paint without saveLayer and paint with saveLayer.) + /// + /// This will be only rarely needed. One case where you might need this is if + /// you have an image overlaid on a very different background color. In these + /// cases, consider whether you can avoid overlaying multiple colors in one + /// spot (e.g. by having the background color only present where the image is + /// absent). If you can, [antiAlias] would be fine and much faster. + /// + /// See also: + /// + /// * [antiAlias], which is much faster, and has similar clipping results. + antiAliasWithSaveLayer, +} + +/// The global default value of whether and how to clip a widget. This is only for +/// temporary migration from default-to-clip to default-to-NOT-clip. +/// +// TODO(liyuqian): Set it to Clip.none. (https://github.com/flutter/flutter/issues/18057) +// We currently have Clip.antiAlias to preserve our old behaviors. +@Deprecated("Do not use this as it'll soon be removed after we set the default behavior to Clip.none.") +const Clip defaultClipBehavior = Clip.antiAlias; + // If we actually run on big endian machines, we'll need to do something smarter // here. We don't use [Endian.Host] because it's not a compile-time // constant and can't propagate into the set/get calls. From 9ece2752aa2be393194a1ea2cba2e264aec62c91 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 13 Jul 2018 13:47:31 -0700 Subject: [PATCH 0772/1190] Add assistiveTechnologyEnabled flag to window (#5740) --- lib/ui/hooks.dart | 5 ++++ lib/ui/window.dart | 24 +++++++++++++++++++ lib/ui/window/window.cc | 10 ++++++++ lib/ui/window/window.h | 1 + runtime/runtime_controller.cc | 13 +++++++++- runtime/runtime_controller.h | 3 +++ shell/common/engine.cc | 4 ++++ shell/common/engine.h | 2 ++ shell/common/platform_view.cc | 4 ++++ shell/common/platform_view.h | 5 ++++ shell/common/shell.cc | 14 +++++++++++ shell/common/shell.h | 4 ++++ .../android/io/flutter/view/FlutterView.java | 5 ++++ .../android/platform_view_android_jni.cc | 12 ++++++++++ .../framework/Source/FlutterViewController.mm | 12 ++++++---- shell/platform/darwin/ios/platform_view_ios.h | 6 +++++ .../platform/darwin/ios/platform_view_ios.mm | 11 +++++++++ 17 files changed, 129 insertions(+), 6 deletions(-) diff --git a/lib/ui/hooks.dart b/lib/ui/hooks.dart index 4f94a9ac962c8..d889a1917387d 100644 --- a/lib/ui/hooks.dart +++ b/lib/ui/hooks.dart @@ -70,6 +70,11 @@ void _updateSemanticsEnabled(bool enabled) { _invoke(window.onSemanticsEnabledChanged, window._onSemanticsEnabledChangedZone); } +void _updateAssistiveTechnologyEnabled(bool enabled) { + window._assistiveTechnologyEnabled = enabled; + _invoke(window._onAssistiveTechnologyEnabled, window._onAssistiveTechnologyEnabledZone); +} + void _dispatchPlatformMessage(String name, ByteData data, int responseId) { if (window.onPlatformMessage != null) { _invoke3( diff --git a/lib/ui/window.dart b/lib/ui/window.dart index f8dad72f15486..26ca82f6e9ca0 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -637,6 +637,30 @@ class Window { bool get semanticsEnabled => _semanticsEnabled; bool _semanticsEnabled = false; + /// Whether the user is using assitive technologies to interact with the + /// application. + /// + /// This includes screen readers such as TalkBack on Android and VoiceOVer + /// on iOS, as well as hardware switches, and more. + /// + /// The [onAssistiveTechnologyEnabled] callback is called whenever this value + /// changes. + bool get assistiveTechnologyEnabled => _assistiveTechnologyEnabled; + bool _assistiveTechnologyEnabled = false; + + /// A callback that is invoked when the value of [assistiveTechnologyEnabled] + /// changes. + /// + /// The framework invokes this callback in the same zone in which the callback + /// was set. + VoidCallback get onAssistiveTechnologyEnabled => _onAssistiveTechnologyEnabled; + VoidCallback _onAssistiveTechnologyEnabled; + Zone _onAssistiveTechnologyEnabledZone; + set onAssistiveTechnologyEnabled(VoidCallback callback) { + _onAssistiveTechnologyEnabled = callback; + _onAssistiveTechnologyEnabledZone = Zone.current; + } + /// A callback that is invoked when the value of [semanticsEnabled] changes. /// /// The framework invokes this callback in the same zone in which the diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 5878dd26e4b4f..e5bbdd73e1995 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -199,6 +199,16 @@ void Window::UpdateSemanticsEnabled(bool enabled) { {ToDart(enabled)}); } +void Window::UpdateAssistiveTechnologyEnabled(bool enabled) { + tonic::DartState* dart_state = library_.dart_state().get(); + if (!dart_state) + return; + tonic::DartState::Scope scope(dart_state); + + DartInvokeField(library_.value(), "_updateAssistiveTechnologyEnabled", + {ToDart(enabled)}); +} + void Window::DispatchPlatformMessage(fxl::RefPtr message) { tonic::DartState* dart_state = library_.dart_state().get(); if (!dart_state) diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index 892812a363a7d..e10fb8503a6a6 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -54,6 +54,7 @@ class Window final { const std::string& country_code); void UpdateUserSettingsData(const std::string& data); void UpdateSemanticsEnabled(bool enabled); + void UpdateAssistiveTechnologyEnabled(bool enabled); void DispatchPlatformMessage(fxl::RefPtr message); void DispatchPointerDataPacket(const PointerDataPacket& packet); void DispatchSemanticsAction(int32_t id, diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index d4c191b4a5e24..982d4d3cd6156 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -122,7 +122,8 @@ std::unique_ptr RuntimeController::Clone() const { bool RuntimeController::FlushRuntimeStateToIsolate() { return SetViewportMetrics(window_data_.viewport_metrics) && SetLocale(window_data_.language_code, window_data_.country_code) && - SetSemanticsEnabled(window_data_.semantics_enabled); + SetSemanticsEnabled(window_data_.semantics_enabled) && + SetAssistiveTechnologyEnabled(window_data_.assistive_technology_enabled); } bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { @@ -170,6 +171,16 @@ bool RuntimeController::SetSemanticsEnabled(bool enabled) { return false; } +bool RuntimeController::SetAssistiveTechnologyEnabled(bool enabled) { + window_data_.assistive_technology_enabled = enabled; + if (auto window = GetWindowIfAvailable()) { + window->UpdateAssistiveTechnologyEnabled(window_data_.assistive_technology_enabled); + return true; + } + + return false; +} + bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) { if (auto window = GetWindowIfAvailable()) { window->BeginFrame(frame_time); diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 07ec70a912164..ad9959091cd59 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -47,6 +47,8 @@ class RuntimeController final : public WindowClient { bool SetSemanticsEnabled(bool enabled); + bool SetAssistiveTechnologyEnabled(bool enabled); + bool BeginFrame(fxl::TimePoint frame_time); bool NotifyIdle(int64_t deadline); @@ -80,6 +82,7 @@ class RuntimeController final : public WindowClient { std::string country_code; std::string user_settings_data = "{}"; bool semantics_enabled = false; + bool assistive_technology_enabled = false; }; RuntimeDelegate& client_; diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 3f8896a224d70..7765f594b443f 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -339,6 +339,10 @@ void Engine::SetSemanticsEnabled(bool enabled) { runtime_controller_->SetSemanticsEnabled(enabled); } +void Engine::SetAssistiveTechnologyEnabled(bool enabled) { + runtime_controller_->SetAssistiveTechnologyEnabled(enabled); +} + void Engine::StopAnimator() { animator_->Stop(); } diff --git a/shell/common/engine.h b/shell/common/engine.h index eeacfc4b848ba..79b20755667cc 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -99,6 +99,8 @@ class Engine final : public blink::RuntimeDelegate { void SetSemanticsEnabled(bool enabled); + void SetAssistiveTechnologyEnabled(bool enabled); + void ScheduleFrame(bool regenerate_layer_tree = true) override; // |blink::RuntimeDelegate| diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index cb84fbcedd715..e1aaf5d858d2b 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -52,6 +52,10 @@ void PlatformView::SetSemanticsEnabled(bool enabled) { delegate_.OnPlatformViewSetSemanticsEnabled(*this, enabled); } +void PlatformView::SetAssistiveTechnologyEnabled(bool enabled) { + delegate_.OnPlatformViewSetAssistiveTechnologyEnabled(*this, enabled); +} + void PlatformView::SetViewportMetrics(const blink::ViewportMetrics& metrics) { delegate_.OnPlatformViewSetViewportMetrics(*this, metrics); } diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 8273563f132f6..02e942fa44943 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -58,6 +58,9 @@ class PlatformView { virtual void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, bool enabled) = 0; + virtual void OnPlatformViewSetAssistiveTechnologyEnabled(const PlatformView& view, + bool enabled) = 0; + virtual void OnPlatformViewRegisterTexture( const PlatformView& view, std::shared_ptr texture) = 0; @@ -84,6 +87,8 @@ class PlatformView { virtual void SetSemanticsEnabled(bool enabled); + virtual void SetAssistiveTechnologyEnabled(bool enabled); + void SetViewportMetrics(const blink::ViewportMetrics& metrics); void NotifyCreated(); diff --git a/shell/common/shell.cc b/shell/common/shell.cc index e6cb6fc10a84c..43c769142de25 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -574,6 +574,20 @@ void Shell::OnPlatformViewSetSemanticsEnabled(const PlatformView& view, }); } +void Shell::OnPlatformViewSetAssistiveTechnologyEnabled(const PlatformView& view, + bool enabled) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), enabled] { + if (engine) { + engine->SetAssistiveTechnologyEnabled(enabled); + } + }); +} + // |shell::PlatformView::Delegate| void Shell::OnPlatformViewRegisterTexture( const PlatformView& view, diff --git a/shell/common/shell.h b/shell/common/shell.h index 8f12bf0ae64e5..2aa98bb1d60ac 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -149,6 +149,10 @@ class Shell final : public PlatformView::Delegate, void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, bool enabled) override; + // |shell::PlatformView::Delegate| + void OnPlatformViewSetAssistiveTechnologyEnabled(const PlatformView& view, + bool enabled) override; + // |shell::PlatformView::Delegate| void OnPlatformViewRegisterTexture( const PlatformView& view, diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 8974a0bec5e10..66e4bde3d5bd1 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -669,6 +669,9 @@ private static native void nativeDispatchSemanticsAction(long nativePlatformView private static native void nativeSetSemanticsEnabled(long nativePlatformViewAndroid, boolean enabled); + + private static native void nativeSetAssistiveTechnologyEnabled(long nativePlatformViewAndroid, + boolean enabled); private static native boolean nativeGetIsSoftwareRenderingEnabled(); @@ -812,11 +815,13 @@ public void onTouchExplorationStateChanged(boolean enabled) { if (enabled) { mTouchExplorationEnabled = true; ensureAccessibilityEnabled(); + nativeSetAssistiveTechnologyEnabled(mNativeView.get(), true); } else { mTouchExplorationEnabled = false; if (mAccessibilityNodeProvider != null) { mAccessibilityNodeProvider.handleTouchExplorationExit(); } + nativeSetAssistiveTechnologyEnabled(mNativeView.get(), false); } resetWillNotDraw(); } diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 0fe2af1c5058e..24c229581d41d 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -429,6 +429,13 @@ static void SetSemanticsEnabled(JNIEnv* env, ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled); } +static void SetAssistiveTechnologyEnabled(JNIEnv* env, + jobject jcaller, + jlong shell_holder, + jboolean enabled) { + ANDROID_SHELL_HOLDER->GetPlatformView()->SetAssistiveTechnologyEnabled(enabled); +} + static jboolean GetIsSoftwareRendering(JNIEnv* env, jobject jcaller) { return FlutterMain::Get().GetSettings().enable_software_rendering; } @@ -600,6 +607,11 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { .signature = "(JZ)V", .fnPtr = reinterpret_cast(&shell::SetSemanticsEnabled), }, + { + .name = "nativeSetAssistiveTechnologyEnabled", + .signature = "(JZ)V", + .fnPtr = reinterpret_cast(&shell::SetAssistiveTechnologyEnabled), + }, { .name = "nativeGetIsSoftwareRenderingEnabled", .signature = "()Z", diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 252d5e61e4bb2..d77c6bd397462 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -792,16 +792,18 @@ - (NSUInteger)supportedInterfaceOrientations { #pragma mark - Accessibility - (void)onAccessibilityStatusChanged:(NSNotification*)notification { + auto platformView = _shell->GetPlatformView(); #if TARGET_OS_SIMULATOR // There doesn't appear to be any way to determine whether the accessibility // inspector is enabled on the simulator. We conservatively always turn on the - // accessibility bridge in the simulator. - bool enabled = true; + // accessibility bridge in the simulator, but never assistive technology. + platformView->SetSemanticsEnabled(true); + platformView->SetAssistiveTechnologyEnabled(false); #else - bool enabled = UIAccessibilityIsVoiceOverRunning() || UIAccessibilityIsSwitchControlRunning() || - UIAccessibilityIsSpeakScreenEnabled(); + bool enabled = UIAccessibilityIsVoiceOverRunning() || UIAccessibilityIsSwitchControlRunning(); + platformView->SetSemanticsEnabled(enabled || UIAccessibilityIsSpeakScreenEnabled()); + platformView->SetAssistiveTechnologyEnabled(enabled); #endif - _shell->GetPlatformView()->SetSemanticsEnabled(enabled); } #pragma mark - Memory Notifications diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index 8d1de7a0c092a..9bd758b55f8ba 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -57,6 +57,12 @@ class PlatformViewIOS final : public HeadlessPlatformViewIOS { // |shell::PlatformView| void SetSemanticsEnabled(bool enabled) override; + // |shell::PlatformView| + void SetAssistiveTechnologyEnabled(bool enabled) override; + + // |shell::PlatformView| + void HandlePlatformMessage( + fxl::RefPtr message) override; // |shell::PlatformView| void UpdateSemantics(blink::SemanticsNodeUpdates update, diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index f1cfc70e35f33..df960dc2fd823 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -67,6 +67,17 @@ PlatformView::SetSemanticsEnabled(enabled); } +// |shell:PlatformView| +void PlatformViewIOS::SetAssistiveTechnologyEnabled(bool enabled) { + if (enabled && !accessibility_bridge_) { + accessibility_bridge_ = std::make_unique(owner_view_, this); + } + // Note: since the accessibility bridge is needed for both semantics and + // assistive technologies, but you cannot have the latter without the + // former, we only destroy the bridge in SetSemanticsEnabled and not here. + PlatformView::SetAssistiveTechnologyEnabled(enabled); +} + // |shell::PlatformView| void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update, blink::CustomAccessibilityActionUpdates actions) { From 80a85e4a173bce4728a628a876ed80c061e1bfb5 Mon Sep 17 00:00:00 2001 From: amirh Date: Fri, 13 Jul 2018 14:08:24 -0700 Subject: [PATCH 0773/1190] Implement PlatformViewsController. (#5722) Each platform view created (by a plugin supplied factory) is attached to a virtual display. The virtual displays are controlled by VirtualDisplayController objects. The PlatformViewsController maintains a mapping from a platform view's id to its VirtualDisplayController, which allows it to operate on the virtual display for a given platform view ID when asked so over the method channel. This is using API level 20 APIs, on lower API levels all platform views method channel calls are noops. We can make this work on API 19 with some refactoring to the TextureRegistry (allow the engine Java code to recycle a texture entry id). This CL also adds a platform view id parameter to the PlatformViewFactory#create() method. This allows plugins to route platform channel messages to specific instances of a platform view. TBD in future CLs: * Forward touch events to the platform views. * Support accessibility for platform views. flutter/flutter#19030 --- shell/platform/android/BUILD.gn | 2 + .../flutter/plugin/platform/PlatformView.java | 10 ++ .../plugin/platform/PlatformViewFactory.java | 8 +- .../platform/PlatformViewsController.java | 129 +++++++++++++++--- .../platform/SingleViewPresentation.java | 64 +++++++++ .../platform/VirtualDisplayController.java | 102 ++++++++++++++ travis/licenses_golden/licenses_flutter | 2 + 7 files changed, 298 insertions(+), 19 deletions(-) create mode 100644 shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java create mode 100644 shell/platform/android/io/flutter/plugin/platform/VirtualDisplayController.java diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 817c1c29250f8..b922bf23170f3 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -129,6 +129,8 @@ java_library("flutter_shell_java") { "io/flutter/plugin/platform/PlatformViewRegistry.java", "io/flutter/plugin/platform/PlatformViewRegistryImpl.java", "io/flutter/plugin/platform/PlatformViewsController.java", + "io/flutter/plugin/platform/SingleViewPresentation.java", + "io/flutter/plugin/platform/VirtualDisplayController.java", "io/flutter/util/PathUtils.java", "io/flutter/util/Preconditions.java", "io/flutter/view/AccessibilityBridge.java", diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformView.java b/shell/platform/android/io/flutter/plugin/platform/PlatformView.java index 9b60d1fdbf4ea..6e379e96a6ba0 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformView.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformView.java @@ -14,4 +14,14 @@ public interface PlatformView { * Returns the Android view to be embedded in the Flutter hierarchy. */ View getView(); + + /** + * Dispose this platform view. + * + *

The {@link PlatformView} object is unusable after this method is called. + * + *

Plugins implementing {@link PlatformView} must clear all references to the View object and the PlatformView + * after this method is called. Failing to do so will result in a memory leak. + */ + void dispose(); } diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java index ac70b1776d2af..9cb7731e1ccb6 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewFactory.java @@ -7,5 +7,11 @@ import android.content.Context; public interface PlatformViewFactory { - PlatformView create(Context context); + /** + * Creates a new Android view to be embedded in the Flutter hierarchy. + * + * @param context the context to be used when creating the view, this is different than FlutterView's context. + * @param viewId unique identifier for the created instance, this value is known on the Dart side. + */ + PlatformView create(Context context, int viewId); } diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index 2d10a45d81fbf..77051ee37087f 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -4,11 +4,15 @@ package io.flutter.plugin.platform; +import android.annotation.TargetApi; +import android.content.Context; +import android.os.Build; import android.util.Log; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.StandardMethodCodec; import io.flutter.view.FlutterView; +import io.flutter.view.TextureRegistry; import java.util.HashMap; import java.util.Map; @@ -20,14 +24,22 @@ * A platform views controller can be attached to at most one Flutter view. */ public class PlatformViewsController implements MethodChannel.MethodCallHandler { + private static final String TAG = "PlatformViewsController"; + private static final String CHANNEL_NAME = "flutter/platform_views"; + // API level 20 is required for VirtualDisplay#setSurface which we use when resizing a platform view. + private static final int MINIMAL_SDK = Build.VERSION_CODES.KITKAT_WATCH; + private final PlatformViewRegistryImpl mRegistry; private FlutterView mFlutterView; + private final HashMap vdControllers; + public PlatformViewsController() { mRegistry = new PlatformViewRegistryImpl(); + vdControllers = new HashMap<>(); } public void attachFlutterView(FlutterView view) { @@ -51,48 +63,129 @@ public PlatformViewRegistry getRegistry() { } public void onFlutterViewDestroyed() { - // TODO(amirh): tear down all vd resources. + for (VirtualDisplayController controller : vdControllers.values()) { + controller.dispose(); + } + vdControllers.clear(); } @Override - public void onMethodCall(MethodCall call, MethodChannel.Result result) { + public void onMethodCall(final MethodCall call, final MethodChannel.Result result) { + if (Build.VERSION.SDK_INT < MINIMAL_SDK) { + Log.e(TAG, "Trying to use platform views with API " + Build.VERSION.SDK_INT + + ", required API level is: " + MINIMAL_SDK); + return; + } switch (call.method) { case "create": - createPlatformView(call); - break; + createPlatformView(call, result); + return; case "dispose": - disposePlatformView(call); - break; + disposePlatformView(call, result); + return; case "resize": - resizePlatformView(call); - break; + resizePlatformView(call, result); + return; } - result.success(null); + result.notImplemented(); } - private void createPlatformView(MethodCall call) { + @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) + private void createPlatformView(MethodCall call, MethodChannel.Result result) { Map args = call.arguments(); int id = (int) args.get("id"); String viewType = (String) args.get("viewType"); - double width = (double) args.get("width"); - double height = (double) args.get("height"); + double logicalWidth = (double) args.get("width"); + double logicalHeight = (double) args.get("height"); + + if (vdControllers.containsKey(id)) { + result.error( + "error", + "Trying to create an already created platform view, view id: " + id, + null + ); + return; + } - // TODO(amirh): implement this. + PlatformViewFactory viewFactory = mRegistry.getFactory(viewType); + if (viewFactory == null) { + result.error( + "error", + "Trying to create a platform view of unregistered type: " + viewType, + null + ); + return; + } + + TextureRegistry.SurfaceTextureEntry textureEntry = mFlutterView.createSurfaceTexture(); + VirtualDisplayController vdController = VirtualDisplayController.create( + mFlutterView.getContext(), + viewFactory, + textureEntry.surfaceTexture(), + toPhysicalPixels(logicalWidth), + toPhysicalPixels(logicalHeight), + id + ); + + if (vdController == null) { + result.error( + "error", + "Failed creating virtual display for a " + viewType + " with id: " + id, + null + ); + return; + } + + vdControllers.put(id, vdController); + + // TODO(amirh): copy accessibility nodes to the FlutterView's accessibility tree. + + result.success(textureEntry.id()); } - private void disposePlatformView(MethodCall call) { - int id = (int) call.arguments(); + private void disposePlatformView(MethodCall call, MethodChannel.Result result) { + int id = call.arguments(); + + VirtualDisplayController vdController = vdControllers.get(id); + if (vdController == null) { + result.error( + "error", + "Trying to dispose a platform view with unknown id: " + id, + null + ); + return; + } - // TODO(amirh): implement this. + vdController.dispose(); + vdControllers.remove(id); + result.success(null); } - private void resizePlatformView(MethodCall call) { + private void resizePlatformView(MethodCall call, MethodChannel.Result result) { Map args = call.arguments(); int id = (int) args.get("id"); double width = (double) args.get("width"); double height = (double) args.get("height"); - // TODO(amirh): implement this. + VirtualDisplayController vdController = vdControllers.get(id); + if (vdController == null) { + result.error( + "error", + "Trying to resize a platform view with unknown id: " + id, + null + ); + return; + } + vdController.resize( + toPhysicalPixels(width), + toPhysicalPixels(height) + ); + result.success(null); + } + + private int toPhysicalPixels(double logicalPixels) { + float density = mFlutterView.getContext().getResources().getDisplayMetrics().density; + return (int) Math.round(logicalPixels * density); } } diff --git a/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java b/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java new file mode 100644 index 0000000000000..72bbca92a928c --- /dev/null +++ b/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java @@ -0,0 +1,64 @@ +// 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. + +package io.flutter.plugin.platform; + +import android.annotation.TargetApi; +import android.app.Presentation; +import android.content.Context; +import android.os.Build; +import android.os.Bundle; +import android.view.Display; +import android.widget.FrameLayout; + +@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) +class SingleViewPresentation extends Presentation { + private final PlatformViewFactory mViewFactory; + + private PlatformView mView; + private int mViewId; + + // As the root view of a display cannot be detached, we use this mContainer + // as the root, and attach mView to it. This allows us to detach mView. + private FrameLayout mContainer; + + /** + * Creates a presentation that will use the view factory to create a new + * platform view in the presentation's onCreate, and attach it. + */ + public SingleViewPresentation(Context outerContext, Display display, PlatformViewFactory viewFactory, int viewId) { + super(outerContext, display); + mViewFactory = viewFactory; + mViewId = viewId; + } + + /** + * Creates a presentation that will attach an already existing view as + * its root view. + * + *

The display's density must match the density of the context used + * when the view was created. + */ + public SingleViewPresentation(Context outerContext, Display display, PlatformView view) { + super(outerContext, display); + mViewFactory = null; + mView = view; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (mView == null) { + mView = mViewFactory.create(getContext(), mViewId); + } + mContainer = new FrameLayout(getContext()); + mContainer.addView(mView.getView()); + setContentView(mContainer); + } + + public PlatformView detachView() { + mContainer.removeView(mView.getView()); + return mView; + } +} diff --git a/shell/platform/android/io/flutter/plugin/platform/VirtualDisplayController.java b/shell/platform/android/io/flutter/plugin/platform/VirtualDisplayController.java new file mode 100644 index 0000000000000..5514d4334e091 --- /dev/null +++ b/shell/platform/android/io/flutter/plugin/platform/VirtualDisplayController.java @@ -0,0 +1,102 @@ +// 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. + +package io.flutter.plugin.platform; + +import android.annotation.TargetApi; +import android.content.Context; +import android.graphics.SurfaceTexture; +import android.hardware.display.DisplayManager; +import android.hardware.display.VirtualDisplay; +import android.os.Build; +import android.view.Surface; +import android.view.View; + +@TargetApi(Build.VERSION_CODES.KITKAT_WATCH) +class VirtualDisplayController { + + public static VirtualDisplayController create( + Context context, + PlatformViewFactory viewFactory, + SurfaceTexture surfaceTexture, + int width, + int height, + int viewId + ) { + surfaceTexture.setDefaultBufferSize(width, height); + Surface surface = new Surface(surfaceTexture); + DisplayManager displayManager = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE); + + int densityDpi = context.getResources().getDisplayMetrics().densityDpi; + VirtualDisplay virtualDisplay = displayManager.createVirtualDisplay( + "flutter-vd", + width, + height, + densityDpi, + surface, + 0 + ); + + if (virtualDisplay == null) { + return null; + } + + return new VirtualDisplayController(context, virtualDisplay, viewFactory, surface, surfaceTexture, viewId); + } + + private final Context mContext; + private final int mDensityDpi; + private final SurfaceTexture mSurfaceTexture; + private VirtualDisplay mVirtualDisplay; + private SingleViewPresentation mPresentation; + private Surface mSurface; + + + private VirtualDisplayController( + Context context, + VirtualDisplay virtualDisplay, + PlatformViewFactory viewFactory, + Surface surface, + SurfaceTexture surfaceTexture, + int viewId + ) { + mSurfaceTexture = surfaceTexture; + mSurface = surface; + mContext = context; + mVirtualDisplay = virtualDisplay; + mDensityDpi = context.getResources().getDisplayMetrics().densityDpi; + mPresentation = new SingleViewPresentation(context, mVirtualDisplay.getDisplay(), viewFactory, viewId); + mPresentation.show(); + } + + public void resize(int width, int height) { + PlatformView view = mPresentation.detachView(); + mPresentation.hide(); + // We detach the surface to prevent it being destroyed when releasing the vd. + // + // setSurface is only available starting API 20. We could support API 19 by re-creating a new + // SurfaceTexture here. This will require refactoring the TextureRegistry to allow recycling texture + // entry IDs. + mVirtualDisplay.setSurface(null); + mVirtualDisplay.release(); + + mSurfaceTexture.setDefaultBufferSize(width, height); + DisplayManager displayManager = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE); + mVirtualDisplay = displayManager.createVirtualDisplay( + "flutter-vd", + width, + height, + mDensityDpi, + mSurface, + 0 + ); + mPresentation = new SingleViewPresentation(mContext, mVirtualDisplay.getDisplay(), view); + mPresentation.show(); + } + + public void dispose() { + mPresentation.detachView().dispose(); + mVirtualDisplay.release(); + } +} diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 29035a43eb7ae..3cdcba8d4ac5f 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -501,6 +501,8 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/Platfor FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistry.java FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewRegistryImpl.java FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java +FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/platform/VirtualDisplayController.java FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterCallbackCache.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h FILE: ../../../flutter/shell/platform/darwin/ios/framework/Source/FlutterCallbackCache.mm From a28c3e759e718c141d9e580115257764f362296c Mon Sep 17 00:00:00 2001 From: liyuqian Date: Fri, 13 Jul 2018 14:32:26 -0700 Subject: [PATCH 0774/1190] Add trailing spaces presubmit check (#5733) So we'll no longer need #5734 and #5708 --- travis/format.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/travis/format.sh b/travis/format.sh index 8cc0d95cfe5d6..38f08d7d97d43 100755 --- a/travis/format.sh +++ b/travis/format.sh @@ -32,7 +32,7 @@ $CLANG_FORMAT --version # Compute the diffs. FILETYPES="*.c *.cc *.cpp *.h *.m *.mm" DIFF_OPTS="-U0 --no-color --name-only" -FILES_TO_CHECK="$(git diff $DIFF_OPTS -- master $FILETYPES)" +FILES_TO_CHECK="$(git diff $DIFF_OPTS master -- $FILETYPES)" FAILED_CHECKS=0 for f in $FILES_TO_CHECK; do @@ -50,3 +50,16 @@ if [[ $FAILED_CHECKS -ne 0 ]]; then echo "ERROR: Some files are formatted incorrectly. To fix, apply diffs above via patch -p0." exit 1 fi + +FILETYPES="*.c *.cc *.cpp *.h *.m *.mm *.dart" + +set +e +TRAILING_SPACES=$(git diff $DIFF_OPTS master -- $FILETYPES | xargs grep --line-number --with-filename '\s\+$') +set -e + +if [[ ! -z "$TRAILING_SPACES" ]]; then + echo "$TRAILING_SPACES" + echo "" + echo "ERROR: Some files have trailing spaces. To fix, try something like \`find . -name "*.dart" -exec sed -i -e 's/\s\+$//' {} \;\`." + exit 1 +fi From 9af920ef22f311588b649ba876127993f5c1362c Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 13 Jul 2018 15:55:49 -0700 Subject: [PATCH 0775/1190] Revert "Add assistiveTechnologyEnabled flag to window" (#5746) Reverts flutter/engine#5740 --- lib/ui/hooks.dart | 5 ---- lib/ui/window.dart | 24 ------------------- lib/ui/window/window.cc | 10 -------- lib/ui/window/window.h | 1 - runtime/runtime_controller.cc | 13 +--------- runtime/runtime_controller.h | 3 --- shell/common/engine.cc | 4 ---- shell/common/engine.h | 2 -- shell/common/platform_view.cc | 4 ---- shell/common/platform_view.h | 5 ---- shell/common/shell.cc | 14 ----------- shell/common/shell.h | 4 ---- .../android/io/flutter/view/FlutterView.java | 5 ---- .../android/platform_view_android_jni.cc | 12 ---------- .../framework/Source/FlutterViewController.mm | 12 ++++------ shell/platform/darwin/ios/platform_view_ios.h | 6 ----- .../platform/darwin/ios/platform_view_ios.mm | 11 --------- 17 files changed, 6 insertions(+), 129 deletions(-) diff --git a/lib/ui/hooks.dart b/lib/ui/hooks.dart index d889a1917387d..4f94a9ac962c8 100644 --- a/lib/ui/hooks.dart +++ b/lib/ui/hooks.dart @@ -70,11 +70,6 @@ void _updateSemanticsEnabled(bool enabled) { _invoke(window.onSemanticsEnabledChanged, window._onSemanticsEnabledChangedZone); } -void _updateAssistiveTechnologyEnabled(bool enabled) { - window._assistiveTechnologyEnabled = enabled; - _invoke(window._onAssistiveTechnologyEnabled, window._onAssistiveTechnologyEnabledZone); -} - void _dispatchPlatformMessage(String name, ByteData data, int responseId) { if (window.onPlatformMessage != null) { _invoke3( diff --git a/lib/ui/window.dart b/lib/ui/window.dart index 26ca82f6e9ca0..f8dad72f15486 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -637,30 +637,6 @@ class Window { bool get semanticsEnabled => _semanticsEnabled; bool _semanticsEnabled = false; - /// Whether the user is using assitive technologies to interact with the - /// application. - /// - /// This includes screen readers such as TalkBack on Android and VoiceOVer - /// on iOS, as well as hardware switches, and more. - /// - /// The [onAssistiveTechnologyEnabled] callback is called whenever this value - /// changes. - bool get assistiveTechnologyEnabled => _assistiveTechnologyEnabled; - bool _assistiveTechnologyEnabled = false; - - /// A callback that is invoked when the value of [assistiveTechnologyEnabled] - /// changes. - /// - /// The framework invokes this callback in the same zone in which the callback - /// was set. - VoidCallback get onAssistiveTechnologyEnabled => _onAssistiveTechnologyEnabled; - VoidCallback _onAssistiveTechnologyEnabled; - Zone _onAssistiveTechnologyEnabledZone; - set onAssistiveTechnologyEnabled(VoidCallback callback) { - _onAssistiveTechnologyEnabled = callback; - _onAssistiveTechnologyEnabledZone = Zone.current; - } - /// A callback that is invoked when the value of [semanticsEnabled] changes. /// /// The framework invokes this callback in the same zone in which the diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index e5bbdd73e1995..5878dd26e4b4f 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -199,16 +199,6 @@ void Window::UpdateSemanticsEnabled(bool enabled) { {ToDart(enabled)}); } -void Window::UpdateAssistiveTechnologyEnabled(bool enabled) { - tonic::DartState* dart_state = library_.dart_state().get(); - if (!dart_state) - return; - tonic::DartState::Scope scope(dart_state); - - DartInvokeField(library_.value(), "_updateAssistiveTechnologyEnabled", - {ToDart(enabled)}); -} - void Window::DispatchPlatformMessage(fxl::RefPtr message) { tonic::DartState* dart_state = library_.dart_state().get(); if (!dart_state) diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index e10fb8503a6a6..892812a363a7d 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -54,7 +54,6 @@ class Window final { const std::string& country_code); void UpdateUserSettingsData(const std::string& data); void UpdateSemanticsEnabled(bool enabled); - void UpdateAssistiveTechnologyEnabled(bool enabled); void DispatchPlatformMessage(fxl::RefPtr message); void DispatchPointerDataPacket(const PointerDataPacket& packet); void DispatchSemanticsAction(int32_t id, diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 982d4d3cd6156..d4c191b4a5e24 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -122,8 +122,7 @@ std::unique_ptr RuntimeController::Clone() const { bool RuntimeController::FlushRuntimeStateToIsolate() { return SetViewportMetrics(window_data_.viewport_metrics) && SetLocale(window_data_.language_code, window_data_.country_code) && - SetSemanticsEnabled(window_data_.semantics_enabled) && - SetAssistiveTechnologyEnabled(window_data_.assistive_technology_enabled); + SetSemanticsEnabled(window_data_.semantics_enabled); } bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { @@ -171,16 +170,6 @@ bool RuntimeController::SetSemanticsEnabled(bool enabled) { return false; } -bool RuntimeController::SetAssistiveTechnologyEnabled(bool enabled) { - window_data_.assistive_technology_enabled = enabled; - if (auto window = GetWindowIfAvailable()) { - window->UpdateAssistiveTechnologyEnabled(window_data_.assistive_technology_enabled); - return true; - } - - return false; -} - bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) { if (auto window = GetWindowIfAvailable()) { window->BeginFrame(frame_time); diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index ad9959091cd59..07ec70a912164 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -47,8 +47,6 @@ class RuntimeController final : public WindowClient { bool SetSemanticsEnabled(bool enabled); - bool SetAssistiveTechnologyEnabled(bool enabled); - bool BeginFrame(fxl::TimePoint frame_time); bool NotifyIdle(int64_t deadline); @@ -82,7 +80,6 @@ class RuntimeController final : public WindowClient { std::string country_code; std::string user_settings_data = "{}"; bool semantics_enabled = false; - bool assistive_technology_enabled = false; }; RuntimeDelegate& client_; diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 7765f594b443f..3f8896a224d70 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -339,10 +339,6 @@ void Engine::SetSemanticsEnabled(bool enabled) { runtime_controller_->SetSemanticsEnabled(enabled); } -void Engine::SetAssistiveTechnologyEnabled(bool enabled) { - runtime_controller_->SetAssistiveTechnologyEnabled(enabled); -} - void Engine::StopAnimator() { animator_->Stop(); } diff --git a/shell/common/engine.h b/shell/common/engine.h index 79b20755667cc..eeacfc4b848ba 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -99,8 +99,6 @@ class Engine final : public blink::RuntimeDelegate { void SetSemanticsEnabled(bool enabled); - void SetAssistiveTechnologyEnabled(bool enabled); - void ScheduleFrame(bool regenerate_layer_tree = true) override; // |blink::RuntimeDelegate| diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index e1aaf5d858d2b..cb84fbcedd715 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -52,10 +52,6 @@ void PlatformView::SetSemanticsEnabled(bool enabled) { delegate_.OnPlatformViewSetSemanticsEnabled(*this, enabled); } -void PlatformView::SetAssistiveTechnologyEnabled(bool enabled) { - delegate_.OnPlatformViewSetAssistiveTechnologyEnabled(*this, enabled); -} - void PlatformView::SetViewportMetrics(const blink::ViewportMetrics& metrics) { delegate_.OnPlatformViewSetViewportMetrics(*this, metrics); } diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 02e942fa44943..8273563f132f6 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -58,9 +58,6 @@ class PlatformView { virtual void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, bool enabled) = 0; - virtual void OnPlatformViewSetAssistiveTechnologyEnabled(const PlatformView& view, - bool enabled) = 0; - virtual void OnPlatformViewRegisterTexture( const PlatformView& view, std::shared_ptr texture) = 0; @@ -87,8 +84,6 @@ class PlatformView { virtual void SetSemanticsEnabled(bool enabled); - virtual void SetAssistiveTechnologyEnabled(bool enabled); - void SetViewportMetrics(const blink::ViewportMetrics& metrics); void NotifyCreated(); diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 43c769142de25..e6cb6fc10a84c 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -574,20 +574,6 @@ void Shell::OnPlatformViewSetSemanticsEnabled(const PlatformView& view, }); } -void Shell::OnPlatformViewSetAssistiveTechnologyEnabled(const PlatformView& view, - bool enabled) { - FXL_DCHECK(is_setup_); - FXL_DCHECK(&view == platform_view_.get()); - FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); - - task_runners_.GetUITaskRunner()->PostTask( - [engine = engine_->GetWeakPtr(), enabled] { - if (engine) { - engine->SetAssistiveTechnologyEnabled(enabled); - } - }); -} - // |shell::PlatformView::Delegate| void Shell::OnPlatformViewRegisterTexture( const PlatformView& view, diff --git a/shell/common/shell.h b/shell/common/shell.h index 2aa98bb1d60ac..8f12bf0ae64e5 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -149,10 +149,6 @@ class Shell final : public PlatformView::Delegate, void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, bool enabled) override; - // |shell::PlatformView::Delegate| - void OnPlatformViewSetAssistiveTechnologyEnabled(const PlatformView& view, - bool enabled) override; - // |shell::PlatformView::Delegate| void OnPlatformViewRegisterTexture( const PlatformView& view, diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 66e4bde3d5bd1..8974a0bec5e10 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -669,9 +669,6 @@ private static native void nativeDispatchSemanticsAction(long nativePlatformView private static native void nativeSetSemanticsEnabled(long nativePlatformViewAndroid, boolean enabled); - - private static native void nativeSetAssistiveTechnologyEnabled(long nativePlatformViewAndroid, - boolean enabled); private static native boolean nativeGetIsSoftwareRenderingEnabled(); @@ -815,13 +812,11 @@ public void onTouchExplorationStateChanged(boolean enabled) { if (enabled) { mTouchExplorationEnabled = true; ensureAccessibilityEnabled(); - nativeSetAssistiveTechnologyEnabled(mNativeView.get(), true); } else { mTouchExplorationEnabled = false; if (mAccessibilityNodeProvider != null) { mAccessibilityNodeProvider.handleTouchExplorationExit(); } - nativeSetAssistiveTechnologyEnabled(mNativeView.get(), false); } resetWillNotDraw(); } diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 24c229581d41d..0fe2af1c5058e 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -429,13 +429,6 @@ static void SetSemanticsEnabled(JNIEnv* env, ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled); } -static void SetAssistiveTechnologyEnabled(JNIEnv* env, - jobject jcaller, - jlong shell_holder, - jboolean enabled) { - ANDROID_SHELL_HOLDER->GetPlatformView()->SetAssistiveTechnologyEnabled(enabled); -} - static jboolean GetIsSoftwareRendering(JNIEnv* env, jobject jcaller) { return FlutterMain::Get().GetSettings().enable_software_rendering; } @@ -607,11 +600,6 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { .signature = "(JZ)V", .fnPtr = reinterpret_cast(&shell::SetSemanticsEnabled), }, - { - .name = "nativeSetAssistiveTechnologyEnabled", - .signature = "(JZ)V", - .fnPtr = reinterpret_cast(&shell::SetAssistiveTechnologyEnabled), - }, { .name = "nativeGetIsSoftwareRenderingEnabled", .signature = "()Z", diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index d77c6bd397462..252d5e61e4bb2 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -792,18 +792,16 @@ - (NSUInteger)supportedInterfaceOrientations { #pragma mark - Accessibility - (void)onAccessibilityStatusChanged:(NSNotification*)notification { - auto platformView = _shell->GetPlatformView(); #if TARGET_OS_SIMULATOR // There doesn't appear to be any way to determine whether the accessibility // inspector is enabled on the simulator. We conservatively always turn on the - // accessibility bridge in the simulator, but never assistive technology. - platformView->SetSemanticsEnabled(true); - platformView->SetAssistiveTechnologyEnabled(false); + // accessibility bridge in the simulator. + bool enabled = true; #else - bool enabled = UIAccessibilityIsVoiceOverRunning() || UIAccessibilityIsSwitchControlRunning(); - platformView->SetSemanticsEnabled(enabled || UIAccessibilityIsSpeakScreenEnabled()); - platformView->SetAssistiveTechnologyEnabled(enabled); + bool enabled = UIAccessibilityIsVoiceOverRunning() || UIAccessibilityIsSwitchControlRunning() || + UIAccessibilityIsSpeakScreenEnabled(); #endif + _shell->GetPlatformView()->SetSemanticsEnabled(enabled); } #pragma mark - Memory Notifications diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index 9bd758b55f8ba..8d1de7a0c092a 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -57,12 +57,6 @@ class PlatformViewIOS final : public HeadlessPlatformViewIOS { // |shell::PlatformView| void SetSemanticsEnabled(bool enabled) override; - // |shell::PlatformView| - void SetAssistiveTechnologyEnabled(bool enabled) override; - - // |shell::PlatformView| - void HandlePlatformMessage( - fxl::RefPtr message) override; // |shell::PlatformView| void UpdateSemantics(blink::SemanticsNodeUpdates update, diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index df960dc2fd823..f1cfc70e35f33 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -67,17 +67,6 @@ PlatformView::SetSemanticsEnabled(enabled); } -// |shell:PlatformView| -void PlatformViewIOS::SetAssistiveTechnologyEnabled(bool enabled) { - if (enabled && !accessibility_bridge_) { - accessibility_bridge_ = std::make_unique(owner_view_, this); - } - // Note: since the accessibility bridge is needed for both semantics and - // assistive technologies, but you cannot have the latter without the - // former, we only destroy the bridge in SetSemanticsEnabled and not here. - PlatformView::SetAssistiveTechnologyEnabled(enabled); -} - // |shell::PlatformView| void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update, blink::CustomAccessibilityActionUpdates actions) { From b8e0c926269f0f624a255982e203055b96cca8a7 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Fri, 13 Jul 2018 17:33:03 -0700 Subject: [PATCH 0776/1190] Update license script to run with newer Dart versions (#5748) --- tools/licenses/lib/licenses.dart | 12 ++++++------ tools/licenses/lib/main.dart | 2 +- tools/licenses/pubspec.lock | 20 ++++++++++++++------ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/tools/licenses/lib/licenses.dart b/tools/licenses/lib/licenses.dart index bbcfdb00b2e5f..e38b2dfd566de 100644 --- a/tools/licenses/lib/licenses.dart +++ b/tools/licenses/lib/licenses.dart @@ -114,7 +114,7 @@ abstract class License implements Comparable { if (result is! UniqueLicense || result.type != type) throw 'tried to add a UniqueLicense $type, but it was a duplicate of a ${result.runtimeType} ${result.type}'; return true; - }); + }()); return result; } @@ -126,7 +126,7 @@ abstract class License implements Comparable { if (result is! TemplateLicense || result.type != type) throw 'tried to add a TemplateLicense $type, but it was a duplicate of a ${result.runtimeType} ${result.type}'; return true; - }); + }()); return result; } @@ -138,7 +138,7 @@ abstract class License implements Comparable { if (result is! MessageLicense || result.type != type) throw 'tried to add a MessageLicense $type, but it was a duplicate of a ${result.runtimeType} ${result.type}'; return true; - }); + }()); return result; } @@ -148,7 +148,7 @@ abstract class License implements Comparable { if (result is! BlankLicense || result.type != type) throw 'tried to add a BlankLicense $type, but it was a duplicate of a ${result.runtimeType} ${result.type}'; return true; - }); + }()); return result; } @@ -310,7 +310,7 @@ abstract class License implements Comparable { throw 'incorrectly created a $runtimeType for a $type'; } return true; - }); + }()); final LicenseType detectedType = convertBodyToType(body); if (detectedType != LicenseType.unknown && detectedType != type && !yesWeKnowWhatItLooksLikeButItIsNot) throw 'Created a license of type $type but it looks like $detectedType\.'; @@ -789,7 +789,7 @@ Iterable<_LicenseMatch> _tryReferenceByType(String body, RegExp pattern, License String copyrights = _reformat(match.getCopyrights()); assert(needsCopyright && copyrights.isNotEmpty || !needsCopyright && copyrights.isEmpty); return true; - }); + }()); if (needsCopyright) yield* _expand(template, match.getCopyrights(), match.getEntireLicense(), match.start, match.end, debug: '_tryReferenceByType', origin: origin); else diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index a8cf05f2bdf52..ed88763d1b4ca 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -956,7 +956,7 @@ class RepositoryDirectory extends RepositoryEntry implements LicenseSource { } } - int get count => _files.length + _subdirectories.fold(0, (int count, RepositoryDirectory child) => count + child.count); + int get count => _files.length + _subdirectories.fold(0, (int count, RepositoryDirectory child) => count + child.count); @override List nearestLicensesFor(String name) { diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock index 75d0f144fde64..ef590e249229f 100644 --- a/tools/licenses/pubspec.lock +++ b/tools/licenses/pubspec.lock @@ -1,53 +1,61 @@ # Generated by pub -# See http://pub.dartlang.org/doc/glossary.html#lockfile +# See https://www.dartlang.org/tools/pub/glossary#lockfile packages: archive: + dependency: "direct main" description: name: archive url: "https://pub.dartlang.org" source: hosted version: "1.0.33" args: + dependency: "direct main" description: name: args url: "https://pub.dartlang.org" source: hosted version: "0.13.7" charcode: + dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.1" + version: "1.1.2" collection: + dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.5" + version: "1.14.10" convert: + dependency: transitive description: name: convert url: "https://pub.dartlang.org" source: hosted version: "2.0.1" crypto: + dependency: "direct main" description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.0.2+1" + version: "2.0.6" path: + dependency: "direct main" description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.6.1" typed_data: + dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted version: "1.1.5" sdks: - dart: ">=1.21.0 <2.0.0" + dart: ">=2.0.0-dev.62.0 <=2.0.0-dev.67.0.flutter-84ca27a09e" From e8474702028a377cf96373f34e8a6e79fd50833e Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Fri, 13 Jul 2018 17:53:28 -0700 Subject: [PATCH 0777/1190] Switch to Fuchsia's ICU (#5744) --- DEPS | 4 ++-- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 9ce3a9504d9b1..43600c7c66a3e 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'fc7d5af92fe6f12b0622e4c3082d9bed8ad01c4b', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '72fdb2c8c3af8efab8f273fe15d909f47b19559e', # Fuchsia compatibility # @@ -152,7 +152,7 @@ deps = { Var('chromium_git') + '/chromium/src/ios.git' + '@' + Var('ios_tools_revision'), 'src/third_party/icu': - Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '08cb956852a5ccdba7f9c941728bb833529ba3c6', + Var('fuchsia_git') + '/third_party/icu' + '@' + 'e6cfa9c5f36c9f31dfa8547323d77dc040d3f038', 'src/third_party/dart': Var('dart_git') + '/sdk.git' + '@' + Var('dart_revision'), diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5c70d7dcd6079..d003129dfd015 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6f5b7034b4b2017ac58a7a51fa655935 +Signature: 77b0d527bb49e012bd8e598dd241e5f9 UNUSED LICENSES: From d319ecfc580273158fe93758d54edc50ca6aadf9 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 13 Jul 2018 21:38:51 -0400 Subject: [PATCH 0778/1190] Roll src/third_party/skia 0df21136e3dc..a4e94c6f5b5c (9 commits) (#5751) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 43600c7c66a3e..fd67e1d7c68c7 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0df21136e3dc5434149695f09b79aff271430365', + 'skia_revision': 'a4e94c6f5b5c81b86f4615e8fa557b187abccb48', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d003129dfd015..01116856c155b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 77b0d527bb49e012bd8e598dd241e5f9 +Signature: cae82c55cda8dfa057e97c5863c4f456 UNUSED LICENSES: From e632fb8160989888456948ce6f412d83b525810b Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 13 Jul 2018 19:59:59 -0700 Subject: [PATCH 0779/1190] Expose keyboardAppearance field in iOS FlutterTextInputPlugin.mm (#5714) --- .../darwin/ios/framework/Source/FlutterTextInputPlugin.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index b188bf0ccc35b..1fa0f618c293a 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -687,9 +687,17 @@ - (void)hideTextInput { - (void)setTextInputClient:(int)client withConfiguration:(NSDictionary*)configuration { NSDictionary* inputType = configuration[@"inputType"]; + NSString* keyboardAppearance = configuration[@"keyboardAppearance"]; _view.keyboardType = ToUIKeyboardType(inputType); _view.returnKeyType = ToUIReturnKeyType(configuration[@"inputAction"]); _view.autocapitalizationType = ToUITextAutocapitalizationType(inputType[@"name"]); + if ([keyboardAppearance isEqualToString:@"Brightness.dark"]) { + _view.keyboardAppearance = UIKeyboardAppearanceDark; + } else if ([keyboardAppearance isEqualToString:@"Brightness.light"]) { + _view.keyboardAppearance = UIKeyboardAppearanceLight; + } else { + _view.keyboardAppearance = UIKeyboardAppearanceDefault; + } _view.secureTextEntry = [configuration[@"obscureText"] boolValue]; NSString* autocorrect = configuration[@"autocorrect"]; _view.autocorrectionType = autocorrect && ![autocorrect boolValue] From 847ee6ddb9c069a5fe548395e23fa58f98dd84ac Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 14 Jul 2018 01:02:50 -0400 Subject: [PATCH 0780/1190] Roll src/third_party/skia a4e94c6f5b5c..2efdb333ae27 (2 commits) (#5753) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index fd67e1d7c68c7..3d55ae363a616 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'a4e94c6f5b5c81b86f4615e8fa557b187abccb48', + 'skia_revision': '2efdb333ae27974108aa7d0fa501ca390b6c924e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 01116856c155b..7a2cc9f84c09b 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: cae82c55cda8dfa057e97c5863c4f456 +Signature: f7ccb51561b54732d5f404cfd4b9d21d UNUSED LICENSES: From abe344cc1ded42c89f1aa4ff5cbe7cba38779280 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 14 Jul 2018 04:13:50 -0400 Subject: [PATCH 0781/1190] Roll src/third_party/skia 2efdb333ae27..d1d28414e337 (1 commits) (#5754) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 3d55ae363a616..229e982a1baa3 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '2efdb333ae27974108aa7d0fa501ca390b6c924e', + 'skia_revision': 'd1d28414e3375ca4e2df538460fc81e96a074c14', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 5176651bc1e53294b4c7301e06eb81acfef3c7ef Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 14 Jul 2018 07:36:50 -0400 Subject: [PATCH 0782/1190] Roll src/third_party/skia d1d28414e337..bc2e86dd5900 (1 commits) (#5755) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 229e982a1baa3..5c8702e699edc 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd1d28414e3375ca4e2df538460fc81e96a074c14', + 'skia_revision': 'bc2e86dd5900e3746ab7e9606cca6e589cd6bb81', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7a2cc9f84c09b..f841488efc356 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f7ccb51561b54732d5f404cfd4b9d21d +Signature: cac465ea871a6498b89ab7b8911a2dab UNUSED LICENSES: From b2c2762029f8292feeaa25cbfaf3ca6949242609 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 14 Jul 2018 15:19:50 -0400 Subject: [PATCH 0783/1190] Roll src/third_party/skia bc2e86dd5900..6f6fdf91f66d (1 commits) (#5756) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 5c8702e699edc..742f9bada9939 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'bc2e86dd5900e3746ab7e9606cca6e589cd6bb81', + 'skia_revision': '6f6fdf91f66d2d98c099d832fd19d0c451c107b2', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f841488efc356..92c61bd8f1aa0 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: cac465ea871a6498b89ab7b8911a2dab +Signature: c73b76cde1b2912764f5f755db5b3fdd UNUSED LICENSES: From 626d90f1d6ec001cd2c50f65d6b3955a3226475b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 14 Jul 2018 23:13:50 -0400 Subject: [PATCH 0784/1190] Roll src/third_party/skia 6f6fdf91f66d..0c604ed06b71 (1 commits) (#5757) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 742f9bada9939..0dd25de93f092 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6f6fdf91f66d2d98c099d832fd19d0c451c107b2', + 'skia_revision': '0c604ed06b71dacaa7d685c0a833b8d07c2729b5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 92c61bd8f1aa0..710de6129faff 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c73b76cde1b2912764f5f755db5b3fdd +Signature: c143ac1fded04c8d59418fca0da804cc UNUSED LICENSES: From 9082357158fbef0ae6be742cadd88a8d9d5f6120 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 15 Jul 2018 02:23:50 -0400 Subject: [PATCH 0785/1190] Roll src/third_party/skia 0c604ed06b71..c053fb8e34db (1 commits) (#5758) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 0dd25de93f092..b974089f571ee 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0c604ed06b71dacaa7d685c0a833b8d07c2729b5', + 'skia_revision': 'c053fb8e34dbf83fa505fccd71ccaad2134036bf', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 5cbe74109560536c9fb663e145d6e0830d065fce Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 15 Jul 2018 07:12:50 -0400 Subject: [PATCH 0786/1190] Roll src/third_party/skia c053fb8e34db..612d5214a2ae (1 commits) (#5759) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b974089f571ee..44f637a4ddb15 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c053fb8e34dbf83fa505fccd71ccaad2134036bf', + 'skia_revision': '612d5214a2aeae875cb76a6bfe355d4f7c6893a5', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 710de6129faff..c0574961341e4 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c143ac1fded04c8d59418fca0da804cc +Signature: ee261da828d9e2c14867755627b4ebdf UNUSED LICENSES: From 42bac3d072b6366aed337827d8696a8782d0a04e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 15 Jul 2018 20:25:50 -0400 Subject: [PATCH 0787/1190] Roll src/third_party/skia 612d5214a2ae..fea9e90e2cdb (1 commits) (#5760) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 44f637a4ddb15..e45a002e2d50a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '612d5214a2aeae875cb76a6bfe355d4f7c6893a5', + 'skia_revision': 'fea9e90e2cdbdaa7830efe1da3d52f37b3a6f80d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index c0574961341e4..f8a1e0db3b80a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: ee261da828d9e2c14867755627b4ebdf +Signature: f710788d4edf6d843ef3196af31d123b UNUSED LICENSES: From f7c3293b3914f0ff93f09584b3957505d0712dad Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 16 Jul 2018 02:10:50 -0400 Subject: [PATCH 0788/1190] Roll src/third_party/skia fea9e90e2cdb..e0a458f02f53 (1 commits) (#5761) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index e45a002e2d50a..b15e2856843db 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'fea9e90e2cdbdaa7830efe1da3d52f37b3a6f80d', + 'skia_revision': 'e0a458f02f5344f06cce4de96a2a479e17602639', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 47bf2f00e4243614972b45977cf885ee81248c77 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 16 Jul 2018 07:03:35 -0400 Subject: [PATCH 0789/1190] Roll src/third_party/skia e0a458f02f53..12e69e7c8944 (1 commits) (#5762) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index b15e2856843db..8cd2b7e112725 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e0a458f02f5344f06cce4de96a2a479e17602639', + 'skia_revision': '12e69e7c8944ce940090d2c719476addf3c8104b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f8a1e0db3b80a..722cbbe70e1ae 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: f710788d4edf6d843ef3196af31d123b +Signature: 970ce99a2eecc15bedd6be22db6874e9 UNUSED LICENSES: @@ -17502,13 +17502,14 @@ FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/skqp_test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-All-Android_NoGPUThreads.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Release-All-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-MotoG4-CPU-Snapdragon617-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm-Debug-All-Android_ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android_NoGPUThreads.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm-Debug-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Release-All.json From ac99ab83f7fda69bc869b91788152ba757c7c4e1 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 16 Jul 2018 10:35:03 -0400 Subject: [PATCH 0790/1190] Roll src/third_party/skia 12e69e7c8944..6196fc1e540d (5 commits) (#5763) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 8cd2b7e112725..521b10fd0f41a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '12e69e7c8944ce940090d2c719476addf3c8104b', + 'skia_revision': '6196fc1e540db82fd99042309438b33b0c0e1e0e', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 722cbbe70e1ae..3b017aba17343 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 970ce99a2eecc15bedd6be22db6874e9 +Signature: 6e61fc41102ec541eb2da9a952a2c569 UNUSED LICENSES: From 2e57ecd38f17b08dd8f89389bdf81c26f37bc385 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 16 Jul 2018 09:04:20 -0700 Subject: [PATCH 0791/1190] Revert rollback of "add assistiveTechnologyEnabled to window" (#5750) --- lib/ui/hooks.dart | 5 + lib/ui/window.dart | 25 ++ lib/ui/window/window.cc | 39 ++-- lib/ui/window/window.h | 1 + runtime/dart_vm_entry_points.txt | 1 + runtime/runtime_controller.cc | 15 +- runtime/runtime_controller.h | 5 +- shell/common/engine.cc | 7 +- shell/common/engine.h | 9 +- shell/common/platform_view.cc | 9 +- shell/common/platform_view.h | 8 +- shell/common/shell.cc | 28 ++- shell/common/shell.h | 13 +- .../android/io/flutter/view/FlutterView.java | 217 ++++++++---------- .../android/platform_view_android_jni.cc | 23 +- .../framework/Source/FlutterViewController.mm | 12 +- shell/platform/darwin/ios/platform_view_ios.h | 7 +- .../platform/darwin/ios/platform_view_ios.mm | 11 + 18 files changed, 273 insertions(+), 162 deletions(-) diff --git a/lib/ui/hooks.dart b/lib/ui/hooks.dart index 4f94a9ac962c8..c5834a39394b5 100644 --- a/lib/ui/hooks.dart +++ b/lib/ui/hooks.dart @@ -70,6 +70,11 @@ void _updateSemanticsEnabled(bool enabled) { _invoke(window.onSemanticsEnabledChanged, window._onSemanticsEnabledChangedZone); } +void _updateAssistiveTechnologyEnabled(bool enabled) { + window._assistiveTechnologyEnabled = enabled; + _invoke(window.onAssistiveTechnologyEnabled, window._onAssistiveTechnologyEnabledZone); +} + void _dispatchPlatformMessage(String name, ByteData data, int responseId) { if (window.onPlatformMessage != null) { _invoke3( diff --git a/lib/ui/window.dart b/lib/ui/window.dart index f8dad72f15486..f20b236fc2c75 100644 --- a/lib/ui/window.dart +++ b/lib/ui/window.dart @@ -649,6 +649,31 @@ class Window { _onSemanticsEnabledChangedZone = Zone.current; } + /// Whether the user is using assitive technologies to interact with the + /// application. + /// + /// This includes screen readers such as TalkBack on Android and VoiceOVer + /// on iOS, as well as hardware switches, and more. + /// + /// The [onAssistiveTechnologyEnabled] callback is called whenever this value + /// changes. + bool get assistiveTechnologyEnabled => _assistiveTechnologyEnabled; + bool _assistiveTechnologyEnabled = false; + + /// A callback that is invoked when the value of [assistiveTechnologyEnabled] + /// changes. + /// + /// The framework invokes this callback in the same zone in which the callback + /// was set. + VoidCallback get onAssistiveTechnologyEnabled => _onAssistiveTechnologyEnabled; + VoidCallback _onAssistiveTechnologyEnabled; + Zone _onAssistiveTechnologyEnabledZone; + set onAssistiveTechnologyEnabled(VoidCallback callback) { + _onAssistiveTechnologyEnabled = callback; + _onAssistiveTechnologyEnabledZone = Zone.current; + } + + /// A callback that is invoked whenever the user requests an action to be /// performed. /// diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 5878dd26e4b4f..3afbe602ad6d8 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -146,21 +146,20 @@ void Window::UpdateWindowMetrics(const ViewportMetrics& metrics) { if (!dart_state) return; tonic::DartState::Scope scope(dart_state); - DartInvokeField( - library_.value(), "_updateWindowMetrics", - { - ToDart(metrics.device_pixel_ratio), - ToDart(metrics.physical_width), - ToDart(metrics.physical_height), - ToDart(metrics.physical_padding_top), - ToDart(metrics.physical_padding_right), - ToDart(metrics.physical_padding_bottom), - ToDart(metrics.physical_padding_left), - ToDart(metrics.physical_view_inset_top), - ToDart(metrics.physical_view_inset_right), - ToDart(metrics.physical_view_inset_bottom), - ToDart(metrics.physical_view_inset_left), - }); + DartInvokeField(library_.value(), "_updateWindowMetrics", + { + ToDart(metrics.device_pixel_ratio), + ToDart(metrics.physical_width), + ToDart(metrics.physical_height), + ToDart(metrics.physical_padding_top), + ToDart(metrics.physical_padding_right), + ToDart(metrics.physical_padding_bottom), + ToDart(metrics.physical_padding_left), + ToDart(metrics.physical_view_inset_top), + ToDart(metrics.physical_view_inset_right), + ToDart(metrics.physical_view_inset_bottom), + ToDart(metrics.physical_view_inset_left), + }); } void Window::UpdateLocale(const std::string& language_code, @@ -199,6 +198,16 @@ void Window::UpdateSemanticsEnabled(bool enabled) { {ToDart(enabled)}); } +void Window::UpdateAssistiveTechnologyEnabled(bool enabled) { + tonic::DartState* dart_state = library_.dart_state().get(); + if (!dart_state) + return; + tonic::DartState::Scope scope(dart_state); + + DartInvokeField(library_.value(), "_updateAssistiveTechnologyEnabled", + {ToDart(enabled)}); +} + void Window::DispatchPlatformMessage(fxl::RefPtr message) { tonic::DartState* dart_state = library_.dart_state().get(); if (!dart_state) diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index 892812a363a7d..e10fb8503a6a6 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -54,6 +54,7 @@ class Window final { const std::string& country_code); void UpdateUserSettingsData(const std::string& data); void UpdateSemanticsEnabled(bool enabled); + void UpdateAssistiveTechnologyEnabled(bool enabled); void DispatchPlatformMessage(fxl::RefPtr message); void DispatchPointerDataPacket(const PointerDataPacket& packet); void DispatchSemanticsAction(int32_t id, diff --git a/runtime/dart_vm_entry_points.txt b/runtime/dart_vm_entry_points.txt index fabbf37bed1df..9a1a6d5f4bfcf 100644 --- a/runtime/dart_vm_entry_points.txt +++ b/runtime/dart_vm_entry_points.txt @@ -19,6 +19,7 @@ dart:ui,::,_getScheduleMicrotaskClosure dart:ui,::,_setupHooks dart:ui,::,_updateLocale dart:ui,::,_updateSemanticsEnabled +dart:ui,::,_updateAssistiveTechnologyEnabled dart:ui,::,_updateUserSettingsData dart:ui,::,_updateWindowMetrics dart:ui,_ImageInfo,get:width diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index d4c191b4a5e24..e2cbfaf110a80 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -122,7 +122,9 @@ std::unique_ptr RuntimeController::Clone() const { bool RuntimeController::FlushRuntimeStateToIsolate() { return SetViewportMetrics(window_data_.viewport_metrics) && SetLocale(window_data_.language_code, window_data_.country_code) && - SetSemanticsEnabled(window_data_.semantics_enabled); + SetSemanticsEnabled(window_data_.semantics_enabled) && + SetAssistiveTechnologyEnabled( + window_data_.assistive_technology_enabled); } bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) { @@ -170,6 +172,17 @@ bool RuntimeController::SetSemanticsEnabled(bool enabled) { return false; } +bool RuntimeController::SetAssistiveTechnologyEnabled(bool enabled) { + window_data_.assistive_technology_enabled = enabled; + if (auto window = GetWindowIfAvailable()) { + window->UpdateAssistiveTechnologyEnabled( + window_data_.assistive_technology_enabled); + return true; + } + + return false; +} + bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) { if (auto window = GetWindowIfAvailable()) { window->BeginFrame(frame_time); diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index 07ec70a912164..bcb51c640c48d 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -9,8 +9,8 @@ #include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" -#include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/text/font_collection.h" +#include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/window.h" #include "flutter/runtime/dart_vm.h" @@ -47,6 +47,8 @@ class RuntimeController final : public WindowClient { bool SetSemanticsEnabled(bool enabled); + bool SetAssistiveTechnologyEnabled(bool enabled); + bool BeginFrame(fxl::TimePoint frame_time); bool NotifyIdle(int64_t deadline); @@ -80,6 +82,7 @@ class RuntimeController final : public WindowClient { std::string country_code; std::string user_settings_data = "{}"; bool semantics_enabled = false; + bool assistive_technology_enabled = false; }; RuntimeDelegate& client_; diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 3f8896a224d70..f8726697472f0 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -339,6 +339,10 @@ void Engine::SetSemanticsEnabled(bool enabled) { runtime_controller_->SetSemanticsEnabled(enabled); } +void Engine::SetAssistiveTechnologyEnabled(bool enabled) { + runtime_controller_->SetAssistiveTechnologyEnabled(enabled); +} + void Engine::StopAnimator() { animator_->Stop(); } @@ -374,7 +378,8 @@ void Engine::Render(std::unique_ptr layer_tree) { void Engine::UpdateSemantics(blink::SemanticsNodeUpdates update, blink::CustomAccessibilityActionUpdates actions) { - delegate_.OnEngineUpdateSemantics(*this, std::move(update), std::move(actions)); + delegate_.OnEngineUpdateSemantics(*this, std::move(update), + std::move(actions)); } void Engine::HandlePlatformMessage( diff --git a/shell/common/engine.h b/shell/common/engine.h index eeacfc4b848ba..336a54b4ef40a 100644 --- a/shell/common/engine.h +++ b/shell/common/engine.h @@ -10,8 +10,8 @@ #include "flutter/assets/asset_manager.h" #include "flutter/common/task_runners.h" -#include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/lib/ui/semantics/custom_accessibility_action.h" +#include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/viewport_metrics.h" @@ -99,6 +99,8 @@ class Engine final : public blink::RuntimeDelegate { void SetSemanticsEnabled(bool enabled); + void SetAssistiveTechnologyEnabled(bool enabled); + void ScheduleFrame(bool regenerate_layer_tree = true) override; // |blink::RuntimeDelegate| @@ -125,8 +127,9 @@ class Engine final : public blink::RuntimeDelegate { void Render(std::unique_ptr layer_tree) override; // |blink::RuntimeDelegate| - void UpdateSemantics(blink::SemanticsNodeUpdates update, - blink::CustomAccessibilityActionUpdates actions) override; + void UpdateSemantics( + blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) override; // |blink::RuntimeDelegate| void HandlePlatformMessage( diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index cb84fbcedd715..5ae0f2d5db4ae 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -52,6 +52,10 @@ void PlatformView::SetSemanticsEnabled(bool enabled) { delegate_.OnPlatformViewSetSemanticsEnabled(*this, enabled); } +void PlatformView::SetAssistiveTechnologyEnabled(bool enabled) { + delegate_.OnPlatformViewSetAssistiveTechnologyEnabled(*this, enabled); +} + void PlatformView::SetViewportMetrics(const blink::ViewportMetrics& metrics) { delegate_.OnPlatformViewSetViewportMetrics(*this, metrics); } @@ -74,8 +78,9 @@ fml::WeakPtr PlatformView::GetWeakPtr() const { return weak_factory_.GetWeakPtr(); } -void PlatformView::UpdateSemantics(blink::SemanticsNodeUpdates update, - blink::CustomAccessibilityActionUpdates actions) {} +void PlatformView::UpdateSemantics( + blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) {} void PlatformView::HandlePlatformMessage( fxl::RefPtr message) { diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index 8273563f132f6..d803baa8e1c51 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -10,8 +10,8 @@ #include "flutter/common/task_runners.h" #include "flutter/flow/texture.h" #include "flutter/fml/memory/weak_ptr.h" -#include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/lib/ui/semantics/custom_accessibility_action.h" +#include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/viewport_metrics.h" @@ -58,6 +58,10 @@ class PlatformView { virtual void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, bool enabled) = 0; + virtual void OnPlatformViewSetAssistiveTechnologyEnabled( + const PlatformView& view, + bool enabled) = 0; + virtual void OnPlatformViewRegisterTexture( const PlatformView& view, std::shared_ptr texture) = 0; @@ -84,6 +88,8 @@ class PlatformView { virtual void SetSemanticsEnabled(bool enabled); + virtual void SetAssistiveTechnologyEnabled(bool enabled); + void SetViewportMetrics(const blink::ViewportMetrics& metrics); void NotifyCreated(); diff --git a/shell/common/shell.cc b/shell/common/shell.cc index e6cb6fc10a84c..caa67d6a37887 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -205,8 +205,7 @@ static void PerformInitializationTasks(const blink::Settings& settings) { }); } - - std::unique_ptr Shell::Create( +std::unique_ptr Shell::Create( blink::TaskRunners task_runners, blink::Settings settings, Shell::CreateCallback on_create_platform_view, @@ -574,6 +573,21 @@ void Shell::OnPlatformViewSetSemanticsEnabled(const PlatformView& view, }); } +void Shell::OnPlatformViewSetAssistiveTechnologyEnabled( + const PlatformView& view, + bool enabled) { + FXL_DCHECK(is_setup_); + FXL_DCHECK(&view == platform_view_.get()); + FXL_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread()); + + task_runners_.GetUITaskRunner()->PostTask( + [engine = engine_->GetWeakPtr(), enabled] { + if (engine) { + engine->SetAssistiveTechnologyEnabled(enabled); + } + }); +} + // |shell::PlatformView::Delegate| void Shell::OnPlatformViewRegisterTexture( const PlatformView& view, @@ -706,14 +720,16 @@ void Shell::OnAnimatorDrawLastLayerTree(const Animator& animator) { } // |shell::Engine::Delegate| -void Shell::OnEngineUpdateSemantics(const Engine& engine, - blink::SemanticsNodeUpdates update, - blink::CustomAccessibilityActionUpdates actions) { +void Shell::OnEngineUpdateSemantics( + const Engine& engine, + blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) { FXL_DCHECK(is_setup_); FXL_DCHECK(task_runners_.GetUITaskRunner()->RunsTasksOnCurrentThread()); task_runners_.GetPlatformTaskRunner()->PostTask( - [view = platform_view_->GetWeakPtr(), update = std::move(update), actions = std::move(actions)] { + [view = platform_view_->GetWeakPtr(), update = std::move(update), + actions = std::move(actions)] { if (view) { view->UpdateSemantics(std::move(update), std::move(actions)); } diff --git a/shell/common/shell.h b/shell/common/shell.h index 8f12bf0ae64e5..f755f67e97cf6 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -14,8 +14,8 @@ #include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/thread.h" -#include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/lib/ui/semantics/custom_accessibility_action.h" +#include "flutter/lib/ui/semantics/semantics_node.h" #include "flutter/lib/ui/window/platform_message.h" #include "flutter/runtime/service_protocol.h" #include "flutter/shell/common/animator.h" @@ -149,6 +149,10 @@ class Shell final : public PlatformView::Delegate, void OnPlatformViewSetSemanticsEnabled(const PlatformView& view, bool enabled) override; + // |shell::PlatformView::Delegate| + void OnPlatformViewSetAssistiveTechnologyEnabled(const PlatformView& view, + bool enabled) override; + // |shell::PlatformView::Delegate| void OnPlatformViewRegisterTexture( const PlatformView& view, @@ -183,9 +187,10 @@ class Shell final : public PlatformView::Delegate, void OnAnimatorDrawLastLayerTree(const Animator& animator) override; // |shell::Engine::Delegate| - void OnEngineUpdateSemantics(const Engine& engine, - blink::SemanticsNodeUpdates update, - blink::CustomAccessibilityActionUpdates actions) override; + void OnEngineUpdateSemantics( + const Engine& engine, + blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) override; // |shell::Engine::Delegate| void OnEngineHandlePlatformMessage( diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index 8974a0bec5e10..e403785a93899 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -41,9 +41,9 @@ /** * An Android view containing a Flutter app. */ -public class FlutterView extends SurfaceView - implements BinaryMessenger, TextureRegistry, AccessibilityManager.AccessibilityStateChangeListener { - +public class FlutterView + extends SurfaceView implements BinaryMessenger, TextureRegistry, + AccessibilityManager.AccessibilityStateChangeListener { /** * Interface for those objects that maintain and expose a reference to a * {@code FlutterView} (such as a full-screen Flutter activity). @@ -129,7 +129,7 @@ public FlutterView(Context context, AttributeSet attrs, FlutterNativeView native TypedValue typedValue = new TypedValue(); context.getTheme().resolveAttribute(android.R.attr.colorBackground, typedValue, true); if (typedValue.type >= TypedValue.TYPE_FIRST_COLOR_INT - && typedValue.type <= TypedValue.TYPE_LAST_COLOR_INT) { + && typedValue.type <= TypedValue.TYPE_LAST_COLOR_INT) { color = typedValue.data; } // TODO(abarth): Consider letting the developer override this color. @@ -156,29 +156,29 @@ public void surfaceDestroyed(SurfaceHolder holder) { }; getHolder().addCallback(mSurfaceCallback); - mAccessibilityManager = (AccessibilityManager) getContext() - .getSystemService(Context.ACCESSIBILITY_SERVICE); + mAccessibilityManager = + (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); mActivityLifecycleListeners = new ArrayList<>(); mFirstFrameListeners = new ArrayList<>(); // Configure the platform plugins and flutter channels. - mFlutterLocalizationChannel = new MethodChannel(this, "flutter/localization", - JSONMethodCodec.INSTANCE); - mFlutterNavigationChannel = new MethodChannel(this, "flutter/navigation", - JSONMethodCodec.INSTANCE); - mFlutterKeyEventChannel = new BasicMessageChannel<>(this, "flutter/keyevent", - JSONMessageCodec.INSTANCE); - mFlutterLifecycleChannel = new BasicMessageChannel<>(this, "flutter/lifecycle", - StringCodec.INSTANCE); - mFlutterSystemChannel = new BasicMessageChannel<>(this, "flutter/system", - JSONMessageCodec.INSTANCE); - mFlutterSettingsChannel = new BasicMessageChannel<>(this, "flutter/settings", - JSONMessageCodec.INSTANCE); + mFlutterLocalizationChannel = + new MethodChannel(this, "flutter/localization", JSONMethodCodec.INSTANCE); + mFlutterNavigationChannel = + new MethodChannel(this, "flutter/navigation", JSONMethodCodec.INSTANCE); + mFlutterKeyEventChannel = + new BasicMessageChannel<>(this, "flutter/keyevent", JSONMessageCodec.INSTANCE); + mFlutterLifecycleChannel = + new BasicMessageChannel<>(this, "flutter/lifecycle", StringCodec.INSTANCE); + mFlutterSystemChannel = + new BasicMessageChannel<>(this, "flutter/system", JSONMessageCodec.INSTANCE); + mFlutterSettingsChannel = + new BasicMessageChannel<>(this, "flutter/settings", JSONMessageCodec.INSTANCE); PlatformPlugin platformPlugin = new PlatformPlugin(activity); - MethodChannel flutterPlatformChannel = new MethodChannel(this, - "flutter/platform", JSONMethodCodec.INSTANCE); + MethodChannel flutterPlatformChannel = + new MethodChannel(this, "flutter/platform", JSONMethodCodec.INSTANCE); flutterPlatformChannel.setMethodCallHandler(platformPlugin); addActivityLifecycleListener(platformPlugin); mImm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE); @@ -310,15 +310,15 @@ public void popRoute() { } private void setUserSettings() { - Map message = new HashMap<>(); - message.put("textScaleFactor", getResources().getConfiguration().fontScale); - message.put("alwaysUse24HourFormat", DateFormat.is24HourFormat(getContext())); - mFlutterSettingsChannel.send(message); + Map message = new HashMap<>(); + message.put("textScaleFactor", getResources().getConfiguration().fontScale); + message.put("alwaysUse24HourFormat", DateFormat.is24HourFormat(getContext())); + mFlutterSettingsChannel.send(message); } private void setLocale(Locale locale) { - mFlutterLocalizationChannel.invokeMethod("setLocale", - Arrays.asList(locale.getLanguage(), locale.getCountry())); + mFlutterLocalizationChannel.invokeMethod( + "setLocale", Arrays.asList(locale.getLanguage(), locale.getCountry())); } @Override @@ -333,8 +333,7 @@ float getDevicePixelRatio() { } public FlutterNativeView detach() { - if (!isAttached()) - return null; + if (!isAttached()) return null; if (mDiscoveryReceiver != null) { getContext().unregisterReceiver(mDiscoveryReceiver); } @@ -347,8 +346,7 @@ public FlutterNativeView detach() { } public void destroy() { - if (!isAttached()) - return; + if (!isAttached()) return; if (mDiscoveryReceiver != null) { getContext().unregisterReceiver(mDiscoveryReceiver); @@ -425,8 +423,7 @@ private int getPointerDeviceTypeForToolType(int toolType) { } } - private void addPointerForIndex(MotionEvent event, int pointerIndex, - ByteBuffer packet) { + private void addPointerForIndex(MotionEvent event, int pointerIndex, ByteBuffer packet) { int pointerChange = getPointerChangeForAction(event.getActionMasked()); if (pointerChange == -1) { return; @@ -463,8 +460,8 @@ private void addPointerForIndex(MotionEvent event, int pointerIndex, packet.putDouble(1.0); // pressure_max if (pointerKind == kPointerDeviceKindStylus) { - packet - .putDouble(event.getAxisValue(MotionEvent.AXIS_DISTANCE, pointerIndex)); // distance + packet.putDouble( + event.getAxisValue(MotionEvent.AXIS_DISTANCE, pointerIndex)); // distance packet.putDouble(0.0); // distance_max } else { packet.putDouble(0.0); // distance @@ -478,7 +475,7 @@ private void addPointerForIndex(MotionEvent event, int pointerIndex, packet.putDouble(0.0); // radius_max packet.putDouble( - event.getAxisValue(MotionEvent.AXIS_ORIENTATION, pointerIndex)); // orientation + event.getAxisValue(MotionEvent.AXIS_ORIENTATION, pointerIndex)); // orientation if (pointerKind == kPointerDeviceKindStylus) { packet.putDouble(event.getAxisValue(MotionEvent.AXIS_TILT, pointerIndex)); // tilt @@ -508,17 +505,16 @@ public boolean onTouchEvent(MotionEvent event) { int pointerCount = event.getPointerCount(); - ByteBuffer packet = ByteBuffer - .allocateDirect(pointerCount * kPointerDataFieldCount * kBytePerField); + ByteBuffer packet = + ByteBuffer.allocateDirect(pointerCount * kPointerDataFieldCount * kBytePerField); packet.order(ByteOrder.LITTLE_ENDIAN); int maskedAction = event.getActionMasked(); // ACTION_UP, ACTION_POINTER_UP, ACTION_DOWN, and ACTION_POINTER_DOWN // only apply to a single pointer, other events apply to all pointers. - if (maskedAction == MotionEvent.ACTION_UP - || maskedAction == MotionEvent.ACTION_POINTER_UP - || maskedAction == MotionEvent.ACTION_DOWN - || maskedAction == MotionEvent.ACTION_POINTER_DOWN) { + if (maskedAction == MotionEvent.ACTION_UP || maskedAction == MotionEvent.ACTION_POINTER_UP + || maskedAction == MotionEvent.ACTION_DOWN + || maskedAction == MotionEvent.ACTION_POINTER_DOWN) { addPointerForIndex(event, event.getActionIndex(), packet); } else { // ACTION_MOVE may not actually mean all pointers have moved @@ -600,16 +596,14 @@ private boolean isAttached() { } void assertAttached() { - if (!isAttached()) - throw new AssertionError("Platform view is not attached"); + if (!isAttached()) throw new AssertionError("Platform view is not attached"); } private void preRun() { resetAccessibilityTree(); } - private void postRun() { - } + private void postRun() {} public void runFromBundle(String bundlePath, String snapshotOverride) { runFromBundle(bundlePath, snapshotOverride, "main", false); @@ -619,7 +613,8 @@ public void runFromBundle(String bundlePath, String snapshotOverride, String ent runFromBundle(bundlePath, snapshotOverride, entrypoint, false); } - public void runFromBundle(String bundlePath, String snapshotOverride, String entrypoint, boolean reuseRuntimeController) { + public void runFromBundle(String bundlePath, String snapshotOverride, String entrypoint, + boolean reuseRuntimeController) { assertAttached(); preRun(); mNativeView.runFromBundle(bundlePath, snapshotOverride, entrypoint, reuseRuntimeController); @@ -636,68 +631,57 @@ public Bitmap getBitmap() { return nativeGetBitmap(mNativeView.get()); } - private static native void nativeSurfaceCreated(long nativePlatformViewAndroid, - Surface surface, - int backgroundColor); + private static native void nativeSurfaceCreated( + long nativePlatformViewAndroid, Surface surface, int backgroundColor); - private static native void nativeSurfaceChanged(long nativePlatformViewAndroid, - int width, - int height); + private static native void nativeSurfaceChanged( + long nativePlatformViewAndroid, int width, int height); private static native void nativeSurfaceDestroyed(long nativePlatformViewAndroid); private static native void nativeSetViewportMetrics(long nativePlatformViewAndroid, - float devicePixelRatio, - int physicalWidth, - int physicalHeight, - int physicalPaddingTop, - int physicalPaddingRight, - int physicalPaddingBottom, - int physicalPaddingLeft, - int physicalViewInsetTop, - int physicalViewInsetRight, - int physicalViewInsetBottom, - int physicalViewInsetLeft); + float devicePixelRatio, int physicalWidth, int physicalHeight, int physicalPaddingTop, + int physicalPaddingRight, int physicalPaddingBottom, int physicalPaddingLeft, + int physicalViewInsetTop, int physicalViewInsetRight, int physicalViewInsetBottom, + int physicalViewInsetLeft); private static native Bitmap nativeGetBitmap(long nativePlatformViewAndroid); - private static native void nativeDispatchPointerDataPacket(long nativePlatformViewAndroid, - ByteBuffer buffer, int position); + private static native void nativeDispatchPointerDataPacket( + long nativePlatformViewAndroid, ByteBuffer buffer, int position); + + private static native void nativeDispatchSemanticsAction( + long nativePlatformViewAndroid, int id, int action, ByteBuffer args, int argsPosition); - private static native void nativeDispatchSemanticsAction(long nativePlatformViewAndroid, int id, - int action, ByteBuffer args, int argsPosition); + private static native void nativeSetSemanticsEnabled( + long nativePlatformViewAndroid, boolean enabled); - private static native void nativeSetSemanticsEnabled(long nativePlatformViewAndroid, - boolean enabled); + private static native void nativeSetAssistiveTechnologyEnabled( + long nativePlatformViewAndroid, boolean enabled); private static native boolean nativeGetIsSoftwareRenderingEnabled(); - private static native void nativeRegisterTexture(long nativePlatformViewAndroid, long textureId, SurfaceTexture surfaceTexture); + private static native void nativeRegisterTexture( + long nativePlatformViewAndroid, long textureId, SurfaceTexture surfaceTexture); - private static native void nativeMarkTextureFrameAvailable(long nativePlatformViewAndroid, long textureId); + private static native void nativeMarkTextureFrameAvailable( + long nativePlatformViewAndroid, long textureId); - private static native void nativeUnregisterTexture(long nativePlatformViewAndroid, long textureId); + private static native void nativeUnregisterTexture( + long nativePlatformViewAndroid, long textureId); private void updateViewportMetrics() { - if (!isAttached()) - return; - nativeSetViewportMetrics(mNativeView.get(), - mMetrics.devicePixelRatio, - mMetrics.physicalWidth, - mMetrics.physicalHeight, - mMetrics.physicalPaddingTop, - mMetrics.physicalPaddingRight, - mMetrics.physicalPaddingBottom, - mMetrics.physicalPaddingLeft, - mMetrics.physicalViewInsetTop, - mMetrics.physicalViewInsetRight, - mMetrics.physicalViewInsetBottom, - mMetrics.physicalViewInsetLeft); - - WindowManager wm = (WindowManager) getContext() - .getSystemService(Context.WINDOW_SERVICE); + if (!isAttached()) return; + nativeSetViewportMetrics(mNativeView.get(), mMetrics.devicePixelRatio, + mMetrics.physicalWidth, mMetrics.physicalHeight, mMetrics.physicalPaddingTop, + mMetrics.physicalPaddingRight, mMetrics.physicalPaddingBottom, + mMetrics.physicalPaddingLeft, mMetrics.physicalViewInsetTop, + mMetrics.physicalViewInsetRight, mMetrics.physicalViewInsetBottom, + mMetrics.physicalViewInsetLeft); + + WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE); float fps = wm.getDefaultDisplay().getRefreshRate(); - VsyncWaiter.refreshPeriodNanos = (long)(1000000000.0 / fps); + VsyncWaiter.refreshPeriodNanos = (long) (1000000000.0 / fps); } // Called by native to update the semantics/accessibility tree. @@ -743,8 +727,7 @@ protected void dispatchSemanticsAction(int id, AccessibilityBridge.Action action } protected void dispatchSemanticsAction(int id, AccessibilityBridge.Action action, Object args) { - if (!isAttached()) - return; + if (!isAttached()) return; ByteBuffer encodedArgs = null; int position = 0; if (args != null) { @@ -777,8 +760,8 @@ protected void onDetachedFromWindow() { super.onDetachedFromWindow(); mAccessibilityManager.removeAccessibilityStateChangeListener(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { - mAccessibilityManager - .removeTouchExplorationStateChangeListener(mTouchExplorationListener); + mAccessibilityManager.removeTouchExplorationStateChangeListener( + mTouchExplorationListener); } } @@ -805,18 +788,19 @@ public void onAccessibilityStateChanged(boolean enabled) { } class TouchExplorationListener - implements AccessibilityManager.TouchExplorationStateChangeListener { - + implements AccessibilityManager.TouchExplorationStateChangeListener { @Override public void onTouchExplorationStateChanged(boolean enabled) { if (enabled) { mTouchExplorationEnabled = true; ensureAccessibilityEnabled(); + nativeSetAssistiveTechnologyEnabled(mNativeView.get(), true); } else { mTouchExplorationEnabled = false; if (mAccessibilityNodeProvider != null) { mAccessibilityNodeProvider.handleTouchExplorationExit(); } + nativeSetAssistiveTechnologyEnabled(mNativeView.get(), false); } resetWillNotDraw(); } @@ -824,17 +808,16 @@ public void onTouchExplorationStateChanged(boolean enabled) { @Override public AccessibilityNodeProvider getAccessibilityNodeProvider() { - if (mAccessibilityEnabled) - return mAccessibilityNodeProvider; - // TODO(goderbauer): when a11y is off this should return a one-off snapshot of the a11y tree. + if (mAccessibilityEnabled) return mAccessibilityNodeProvider; + // TODO(goderbauer): when a11y is off this should return a one-off snapshot of the a11y + // tree. return null; } private AccessibilityBridge mAccessibilityNodeProvider; void ensureAccessibilityEnabled() { - if (!isAttached()) - return; + if (!isAttached()) return; mAccessibilityEnabled = true; if (mAccessibilityNodeProvider == null) { mAccessibilityNodeProvider = new AccessibilityBridge(this); @@ -853,8 +836,8 @@ private boolean handleAccessibilityHoverEvent(MotionEvent event) { if (!mTouchExplorationEnabled) { return false; } - if (event.getAction() == MotionEvent.ACTION_HOVER_ENTER || - event.getAction() == MotionEvent.ACTION_HOVER_MOVE) { + if (event.getAction() == MotionEvent.ACTION_HOVER_ENTER + || event.getAction() == MotionEvent.ACTION_HOVER_MOVE) { mAccessibilityNodeProvider.handleTouchExploration(event.getX(), event.getY()); } else if (event.getAction() == MotionEvent.ACTION_HOVER_EXIT) { mAccessibilityNodeProvider.handleTouchExplorationExit(); @@ -892,7 +875,6 @@ public void setMessageHandler(String channel, BinaryMessageHandler handler) { * and the tool scrapes the log lines for the data. */ private class DiscoveryReceiver extends BroadcastReceiver { - @Override public void onReceive(Context context, Intent intent) { URI observatoryUri = URI.create(FlutterNativeView.getObservatoryUri()); @@ -900,7 +882,8 @@ public void onReceive(Context context, Intent intent) { try { discover.put("id", getContext().getPackageName()); discover.put("observatoryPort", observatoryUri.getPort()); - Log.i(TAG, "DISCOVER: " + discover); // The tool looks for this data. See android_device.dart. + Log.i(TAG, "DISCOVER: " + discover); // The tool looks for this data. See + // android_device.dart. } catch (JSONException e) { } } @@ -909,16 +892,14 @@ public void onReceive(Context context, Intent intent) { /** * Listener will be called on the Android UI thread once when Flutter renders the first frame. */ - public interface FirstFrameListener { - void onFirstFrame(); - } + public interface FirstFrameListener { void onFirstFrame(); } @Override public TextureRegistry.SurfaceTextureEntry createSurfaceTexture() { final SurfaceTexture surfaceTexture = new SurfaceTexture(0); surfaceTexture.detachFromGLContext(); - final SurfaceTextureRegistryEntry entry = new SurfaceTextureRegistryEntry( - nextTextureId.getAndIncrement(), surfaceTexture); + final SurfaceTextureRegistryEntry entry = + new SurfaceTextureRegistryEntry(nextTextureId.getAndIncrement(), surfaceTexture); nativeRegisterTexture(mNativeView.get(), entry.id(), surfaceTexture); return entry; } @@ -931,17 +912,19 @@ final class SurfaceTextureRegistryEntry implements TextureRegistry.SurfaceTextur SurfaceTextureRegistryEntry(long id, SurfaceTexture surfaceTexture) { this.id = id; this.surfaceTexture = surfaceTexture; - this.surfaceTexture.setOnFrameAvailableListener(new SurfaceTexture.OnFrameAvailableListener() { - @Override - public void onFrameAvailable(SurfaceTexture texture) { - nativeMarkTextureFrameAvailable(mNativeView.get(), SurfaceTextureRegistryEntry.this.id); - } - }); + this.surfaceTexture.setOnFrameAvailableListener( + new SurfaceTexture.OnFrameAvailableListener() { + @Override + public void onFrameAvailable(SurfaceTexture texture) { + nativeMarkTextureFrameAvailable( + mNativeView.get(), SurfaceTextureRegistryEntry.this.id); + } + }); } @Override public SurfaceTexture surfaceTexture() { - return surfaceTexture; + return surfaceTexture; } @Override diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 0fe2af1c5058e..418065f400db9 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -85,7 +85,8 @@ void FlutterViewUpdateCustomAccessibilityActions(JNIEnv* env, jobject obj, jobject buffer, jobjectArray strings) { - env->CallVoidMethod(obj, g_update_custom_accessibility_actions_method, buffer, strings); + env->CallVoidMethod(obj, g_update_custom_accessibility_actions_method, buffer, + strings); FXL_CHECK(CheckException(env)); } @@ -429,6 +430,14 @@ static void SetSemanticsEnabled(JNIEnv* env, ANDROID_SHELL_HOLDER->GetPlatformView()->SetSemanticsEnabled(enabled); } +static void SetAssistiveTechnologyEnabled(JNIEnv* env, + jobject jcaller, + jlong shell_holder, + jboolean enabled) { + ANDROID_SHELL_HOLDER->GetPlatformView()->SetAssistiveTechnologyEnabled( + enabled); +} + static jboolean GetIsSoftwareRendering(JNIEnv* env, jobject jcaller) { return FlutterMain::Get().GetSettings().enable_software_rendering; } @@ -600,6 +609,12 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { .signature = "(JZ)V", .fnPtr = reinterpret_cast(&shell::SetSemanticsEnabled), }, + { + .name = "nativeSetAssistiveTechnologyEnabled", + .signature = "(JZ)V", + .fnPtr = + reinterpret_cast(&shell::SetAssistiveTechnologyEnabled), + }, { .name = "nativeGetIsSoftwareRenderingEnabled", .signature = "()Z", @@ -657,9 +672,9 @@ bool PlatformViewAndroid::Register(JNIEnv* env) { return false; } - g_update_custom_accessibility_actions_method = - env->GetMethodID(g_flutter_native_view_class->obj(), "updateCustomAccessibilityActions", - "(Ljava/nio/ByteBuffer;[Ljava/lang/String;)V"); + g_update_custom_accessibility_actions_method = env->GetMethodID( + g_flutter_native_view_class->obj(), "updateCustomAccessibilityActions", + "(Ljava/nio/ByteBuffer;[Ljava/lang/String;)V"); if (g_update_custom_accessibility_actions_method == nullptr) { return false; diff --git a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm index 252d5e61e4bb2..a266ad7ea0ac9 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterViewController.mm @@ -792,16 +792,18 @@ - (NSUInteger)supportedInterfaceOrientations { #pragma mark - Accessibility - (void)onAccessibilityStatusChanged:(NSNotification*)notification { + auto platformView = _shell->GetPlatformView(); #if TARGET_OS_SIMULATOR // There doesn't appear to be any way to determine whether the accessibility // inspector is enabled on the simulator. We conservatively always turn on the - // accessibility bridge in the simulator. - bool enabled = true; + // accessibility bridge in the simulator, but never assistive technology. + platformView->SetSemanticsEnabled(true); + platformView->SetAssistiveTechnologyEnabled(false); #else - bool enabled = UIAccessibilityIsVoiceOverRunning() || UIAccessibilityIsSwitchControlRunning() || - UIAccessibilityIsSpeakScreenEnabled(); + bool enabled = UIAccessibilityIsVoiceOverRunning() || UIAccessibilityIsSwitchControlRunning(); + platformView->SetSemanticsEnabled(enabled || UIAccessibilityIsSpeakScreenEnabled()); + platformView->SetAssistiveTechnologyEnabled(enabled); #endif - _shell->GetPlatformView()->SetSemanticsEnabled(enabled); } #pragma mark - Memory Notifications diff --git a/shell/platform/darwin/ios/platform_view_ios.h b/shell/platform/darwin/ios/platform_view_ios.h index 8d1de7a0c092a..ee6b076c3ba3e 100644 --- a/shell/platform/darwin/ios/platform_view_ios.h +++ b/shell/platform/darwin/ios/platform_view_ios.h @@ -57,10 +57,13 @@ class PlatformViewIOS final : public HeadlessPlatformViewIOS { // |shell::PlatformView| void SetSemanticsEnabled(bool enabled) override; + // |shell::PlatformView| + void SetAssistiveTechnologyEnabled(bool enabled) override; // |shell::PlatformView| - void UpdateSemantics(blink::SemanticsNodeUpdates update, - blink::CustomAccessibilityActionUpdates actions) override; + void UpdateSemantics( + blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) override; // |shell::PlatformView| std::unique_ptr CreateVSyncWaiter() override; diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index f1cfc70e35f33..df960dc2fd823 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -67,6 +67,17 @@ PlatformView::SetSemanticsEnabled(enabled); } +// |shell:PlatformView| +void PlatformViewIOS::SetAssistiveTechnologyEnabled(bool enabled) { + if (enabled && !accessibility_bridge_) { + accessibility_bridge_ = std::make_unique(owner_view_, this); + } + // Note: since the accessibility bridge is needed for both semantics and + // assistive technologies, but you cannot have the latter without the + // former, we only destroy the bridge in SetSemanticsEnabled and not here. + PlatformView::SetAssistiveTechnologyEnabled(enabled); +} + // |shell::PlatformView| void PlatformViewIOS::UpdateSemantics(blink::SemanticsNodeUpdates update, blink::CustomAccessibilityActionUpdates actions) { From 1d126dab31595748fc7abc38b6be29bfe8ffeadd Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 16 Jul 2018 09:18:07 -0700 Subject: [PATCH 0792/1190] Enable sync-async (#5765) --- runtime/dart_vm.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 4f24b5bad23b9..40a8bfef58800 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -95,8 +95,7 @@ static const char* kDartStrongModeArgs[] = { // clang-format off "--strong", "--reify_generic_functions", - // TODO(bkonyi): uncomment when sync-async is enabled in flutter/flutter. - // "--sync_async", + "--sync_async", // clang-format on }; From b420524504c17c9ad602d805240bbd1a3b6ac5b7 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 16 Jul 2018 10:52:43 -0700 Subject: [PATCH 0793/1190] Revert "Switch to Fuchsia's ICU (#5744)" (#5766) --- DEPS | 4 ++-- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 521b10fd0f41a..4ab9cfb91ec3e 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '72fdb2c8c3af8efab8f273fe15d909f47b19559e', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'fc7d5af92fe6f12b0622e4c3082d9bed8ad01c4b', # Fuchsia compatibility # @@ -152,7 +152,7 @@ deps = { Var('chromium_git') + '/chromium/src/ios.git' + '@' + Var('ios_tools_revision'), 'src/third_party/icu': - Var('fuchsia_git') + '/third_party/icu' + '@' + 'e6cfa9c5f36c9f31dfa8547323d77dc040d3f038', + Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '08cb956852a5ccdba7f9c941728bb833529ba3c6', 'src/third_party/dart': Var('dart_git') + '/sdk.git' + '@' + Var('dart_revision'), diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3b017aba17343..9fe734048b701 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6e61fc41102ec541eb2da9a952a2c569 +Signature: 0201531d27503443ddc76f217a51b2a9 UNUSED LICENSES: From 6edaa70620f6d32d7e635773914b02b62b1ff121 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 16 Jul 2018 11:00:08 -0700 Subject: [PATCH 0794/1190] Revert "Switch to Fuchsia's ICU (#5744)" (#5766) From d3fadff3018ae5ac572f55724832d818f22b1382 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 16 Jul 2018 14:43:35 -0400 Subject: [PATCH 0795/1190] Roll src/third_party/skia 6196fc1e540d..71ed661963ba (5 commits) (#5768) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 4ab9cfb91ec3e..8cc5e969891a1 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6196fc1e540db82fd99042309438b33b0c0e1e0e', + 'skia_revision': '71ed661963ba57200e6f9b3d5ad64105b607bb98', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9fe734048b701..7124f9fd2b2b4 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0201531d27503443ddc76f217a51b2a9 +Signature: da85bd02e083491af1287f4e2ad6f9d3 UNUSED LICENSES: From 316b026807c50d65ba1b6724ac954711683f1b01 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 16 Jul 2018 12:04:05 -0700 Subject: [PATCH 0796/1190] Handle Android vsync callbacks that occur after the VsyncWaiter has been deleted (#5749) Fixes https://github.com/flutter/flutter/issues/19159 --- shell/common/animator.h | 2 +- shell/common/platform_view.h | 1 - shell/common/vsync_waiter.h | 8 ++--- .../platform/android/vsync_waiter_android.cc | 36 ++++++------------- shell/platform/android/vsync_waiter_android.h | 1 + 5 files changed, 16 insertions(+), 32 deletions(-) diff --git a/shell/common/animator.h b/shell/common/animator.h index 53b2ac6884158..8ddd852b67017 100644 --- a/shell/common/animator.h +++ b/shell/common/animator.h @@ -64,7 +64,7 @@ class Animator final { Delegate& delegate_; blink::TaskRunners task_runners_; - std::unique_ptr waiter_; + std::shared_ptr waiter_; fxl::TimePoint last_begin_frame_time_; int64_t dart_frame_deadline_; diff --git a/shell/common/platform_view.h b/shell/common/platform_view.h index d803baa8e1c51..9f5fca77d2af3 100644 --- a/shell/common/platform_view.h +++ b/shell/common/platform_view.h @@ -125,7 +125,6 @@ class PlatformView { protected: PlatformView::Delegate& delegate_; const blink::TaskRunners task_runners_; - std::unique_ptr vsync_waiter_; SkISize size_; fml::WeakPtrFactory weak_factory_; diff --git a/shell/common/vsync_waiter.h b/shell/common/vsync_waiter.h index 82231fdf4f853..b6d9ee2255abd 100644 --- a/shell/common/vsync_waiter.h +++ b/shell/common/vsync_waiter.h @@ -14,7 +14,7 @@ namespace shell { -class VsyncWaiter { +class VsyncWaiter : public std::enable_shared_from_this { public: using Callback = std::function; @@ -23,6 +23,9 @@ class VsyncWaiter { void AsyncWaitForVsync(Callback callback); + void FireCallback(fxl::TimePoint frame_start_time, + fxl::TimePoint frame_target_time); + protected: const blink::TaskRunners task_runners_; std::mutex callback_mutex_; @@ -32,9 +35,6 @@ class VsyncWaiter { virtual void AwaitVSync() = 0; - void FireCallback(fxl::TimePoint frame_start_time, - fxl::TimePoint frame_target_time); - FXL_DISALLOW_COPY_AND_ASSIGN(VsyncWaiter); }; diff --git a/shell/platform/android/vsync_waiter_android.cc b/shell/platform/android/vsync_waiter_android.cc index 052de023b9a12..51c2f461bc3ad 100644 --- a/shell/platform/android/vsync_waiter_android.cc +++ b/shell/platform/android/vsync_waiter_android.cc @@ -16,8 +16,6 @@ namespace shell { -static jlong CreatePendingCallback(VsyncWaiter::Callback callback); - static void ConsumePendingCallback(jlong java_baton, fxl::TimePoint frame_start_time, fxl::TimePoint frame_target_time); @@ -32,12 +30,9 @@ VsyncWaiterAndroid::~VsyncWaiterAndroid() = default; // |shell::VsyncWaiter| void VsyncWaiterAndroid::AwaitVSync() { - auto java_baton = - CreatePendingCallback(std::bind(&VsyncWaiterAndroid::FireCallback, // - this, // - std::placeholders::_1, // - std::placeholders::_2 // - )); + std::weak_ptr* weak_this = + new std::weak_ptr(shared_from_this()); + jlong java_baton = reinterpret_cast(weak_this); task_runners_.GetPlatformTaskRunner()->PostTask([java_baton]() { JNIEnv* env = fml::jni::AttachCurrentThread(); @@ -86,27 +81,16 @@ bool VsyncWaiterAndroid::Register(JNIEnv* env) { return env->RegisterNatives(clazz, methods, arraysize(methods)) == 0; } -struct PendingCallbackData { - VsyncWaiter::Callback callback; - - PendingCallbackData(VsyncWaiter::Callback p_callback) - : callback(std::move(p_callback)) { - FXL_DCHECK(callback); - } -}; - -static jlong CreatePendingCallback(VsyncWaiter::Callback callback) { - // This delete for this new is balanced in the consume call. - auto data = new PendingCallbackData(std::move(callback)); - return reinterpret_cast(data); -} - static void ConsumePendingCallback(jlong java_baton, fxl::TimePoint frame_start_time, fxl::TimePoint frame_target_time) { - auto data = reinterpret_cast(java_baton); - data->callback(frame_start_time, frame_target_time); - delete data; + auto weak_this = reinterpret_cast*>(java_baton); + auto shared_this = weak_this->lock(); + delete weak_this; + + if (shared_this) { + shared_this->FireCallback(frame_start_time, frame_target_time); + } } } // namespace shell diff --git a/shell/platform/android/vsync_waiter_android.h b/shell/platform/android/vsync_waiter_android.h index fd72a0a21f563..857bce3e2c123 100644 --- a/shell/platform/android/vsync_waiter_android.h +++ b/shell/platform/android/vsync_waiter_android.h @@ -6,6 +6,7 @@ #define SHELL_PLATFORM_ANDROID_VSYNC_WAITER_ANDROID_H_ #include +#include #include "flutter/fml/memory/weak_ptr.h" #include "flutter/shell/common/vsync_waiter.h" #include "lib/fxl/macros.h" From e02bd9247908da3501605ad5691d7ba3971851ca Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 16 Jul 2018 13:23:58 -0700 Subject: [PATCH 0797/1190] Roll buildroot to 7b5fd64b26afe194fa49463bad204b2cfba47fb6 (#5769) --- DEPS | 2 +- .../darwin/desktop/flutter_application_delegate.mm | 6 +++--- shell/platform/darwin/desktop/flutter_window.mm | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DEPS b/DEPS index 8cc5e969891a1..a47a48dbf425d 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'fc7d5af92fe6f12b0622e4c3082d9bed8ad01c4b', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '7b5fd64b26afe194fa49463bad204b2cfba47fb6', # Fuchsia compatibility # diff --git a/shell/platform/darwin/desktop/flutter_application_delegate.mm b/shell/platform/darwin/desktop/flutter_application_delegate.mm index 03076b848b25f..50670cf25bbed 100644 --- a/shell/platform/darwin/desktop/flutter_application_delegate.mm +++ b/shell/platform/darwin/desktop/flutter_application_delegate.mm @@ -26,20 +26,20 @@ - (void)configureMainMenuBar { action:@selector(onNewFlutterWindow:) keyEquivalent:@""] autorelease]; newEngineItem.keyEquivalent = @"n"; - newEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; + newEngineItem.keyEquivalentModifierMask = NSEventModifierFlagCommand; NSMenuItem* shutdownEngineItem = [[[NSMenuItem alloc] initWithTitle:@"Shutdown Engine" action:@selector(onShutdownFlutterWindow:) keyEquivalent:@""] autorelease]; shutdownEngineItem.keyEquivalent = @"w"; - shutdownEngineItem.keyEquivalentModifierMask = NSCommandKeyMask; + shutdownEngineItem.keyEquivalentModifierMask = NSEventModifierFlagCommand; NSMenuItem* quitItem = [[[NSMenuItem alloc] initWithTitle:@"Quit" action:@selector(onQuitFlutterApplication:) keyEquivalent:@""] autorelease]; quitItem.keyEquivalent = @"q"; - quitItem.keyEquivalentModifierMask = NSCommandKeyMask; + quitItem.keyEquivalentModifierMask = NSEventModifierFlagCommand; [mainMenu addItem:engineItem]; [engineItem setSubmenu:engineMenu]; diff --git a/shell/platform/darwin/desktop/flutter_window.mm b/shell/platform/darwin/desktop/flutter_window.mm index 097b71a560c76..d6e19dec130c0 100644 --- a/shell/platform/darwin/desktop/flutter_window.mm +++ b/shell/platform/darwin/desktop/flutter_window.mm @@ -52,11 +52,11 @@ @implementation FlutterWindow { } - (instancetype)init { - self = - [super initWithContentRect:NSMakeRect(10.0, 10.0, 800.0, 600.0) - styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask - backing:NSBackingStoreBuffered - defer:YES]; + self = [super initWithContentRect:NSMakeRect(10.0, 10.0, 800.0, 600.0) + styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | + NSWindowStyleMaskResizable + backing:NSBackingStoreBuffered + defer:YES]; if (self) { self.delegate = self; [self setupRenderSurface]; From 6c7ddd818521681f21d583dc20ee5c5f9ec8494f Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 16 Jul 2018 15:02:57 -0700 Subject: [PATCH 0798/1190] Remove the dependency on the Garnet zip library (#5770) --- assets/BUILD.gn | 1 - assets/zip_asset_store.cc | 8 ++++++-- assets/zip_asset_store.h | 11 +++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/assets/BUILD.gn b/assets/BUILD.gn index 28d7e569659f1..580ecfb6ea41b 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -18,7 +18,6 @@ source_set("assets") { "$flutter_root/fml", "$flutter_root/glue", "//garnet/public/lib/fxl", - "//garnet/public/lib/zip", ] public_deps = [ diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index 532461ff32a7c..6f1ecd65af4d6 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -18,6 +18,10 @@ namespace blink { +void UniqueUnzipperTraits::Free(void* file) { + unzClose(file); +} + ZipAssetStore::ZipAssetStore(std::string file_path) : file_path_(std::move(file_path)) { BuildStatCache(); @@ -25,8 +29,8 @@ ZipAssetStore::ZipAssetStore(std::string file_path) ZipAssetStore::~ZipAssetStore() = default; -zip::UniqueUnzipper ZipAssetStore::CreateUnzipper() const { - return zip::UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)}; +UniqueUnzipper ZipAssetStore::CreateUnzipper() const { + return UniqueUnzipper{::unzOpen2(file_path_.c_str(), nullptr)}; } // |blink::AssetResolver| diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h index 61b09474a606b..0854194abe4e2 100644 --- a/assets/zip_asset_store.h +++ b/assets/zip_asset_store.h @@ -10,11 +10,18 @@ #include "flutter/assets/asset_resolver.h" #include "lib/fxl/macros.h" #include "lib/fxl/memory/ref_counted.h" -#include "lib/zip/unique_unzipper.h" #include "third_party/zlib/contrib/minizip/unzip.h" namespace blink { +struct UniqueUnzipperTraits { + static inline void* InvalidValue() { return nullptr; } + static inline bool IsValid(void* value) { return value != InvalidValue(); } + static void Free(void* file); +}; + +using UniqueUnzipper = fml::UniqueObject; + class ZipAssetStore final : public AssetResolver { public: ZipAssetStore(std::string file_path); @@ -41,7 +48,7 @@ class ZipAssetStore final : public AssetResolver { void BuildStatCache(); - zip::UniqueUnzipper CreateUnzipper() const; + UniqueUnzipper CreateUnzipper() const; FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); }; From d0b8a1074f1828ea4528ca77f47ee968f24347a2 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 16 Jul 2018 18:06:35 -0400 Subject: [PATCH 0799/1190] Roll src/third_party/skia 71ed661963ba..bfc63c1ea410 (6 commits) (#5771) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a47a48dbf425d..70ed8527f086d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '71ed661963ba57200e6f9b3d5ad64105b607bb98', + 'skia_revision': 'bfc63c1ea41047fc5e299ebf2086309eaa8e79ce', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7124f9fd2b2b4..823ba9243d188 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: da85bd02e083491af1287f4e2ad6f9d3 +Signature: 8e05d60480d41d595239d017c8d467ce UNUSED LICENSES: From 7d15db622c53cb7246dd406bd3c2670ef3d970d3 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 16 Jul 2018 16:04:05 -0700 Subject: [PATCH 0800/1190] Diff against upstream/master (if available) in the format checker script (#5772) upstream/master represents the tip of tree in local engine repositories configured based on https://github.com/flutter/engine/blob/master/CONTRIBUTING.md --- travis/format.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/travis/format.sh b/travis/format.sh index 38f08d7d97d43..3a29bc0606a6b 100755 --- a/travis/format.sh +++ b/travis/format.sh @@ -32,7 +32,12 @@ $CLANG_FORMAT --version # Compute the diffs. FILETYPES="*.c *.cc *.cpp *.h *.m *.mm" DIFF_OPTS="-U0 --no-color --name-only" -FILES_TO_CHECK="$(git diff $DIFF_OPTS master -- $FILETYPES)" +if git remote get-url upstream >/dev/null 2>&1; then + UPSTREAM=upstream/master +else + UPSTREAM=master +fi; +FILES_TO_CHECK="$(git diff $DIFF_OPTS $UPSTREAM -- $FILETYPES)" FAILED_CHECKS=0 for f in $FILES_TO_CHECK; do From bf93bde75b55aec334df6149ce5a3fd871267186 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 16 Jul 2018 19:58:35 -0400 Subject: [PATCH 0801/1190] Roll src/third_party/skia bfc63c1ea410..7701599cef6f (3 commits) (#5773) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/DEPS b/DEPS index 70ed8527f086d..15300d417a744 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'bfc63c1ea41047fc5e299ebf2086309eaa8e79ce', + 'skia_revision': '7701599cef6f5a467804a2c2aaf3ba2de194382b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 823ba9243d188..04a41f4ccaad6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8e05d60480d41d595239d017c8d467ce +Signature: dc36a5f9e5a0b06686a449bfafe95450 UNUSED LICENSES: @@ -17893,8 +17893,6 @@ FILE: ../../../third_party/skia/src/core/SkPictureRecord.h FILE: ../../../third_party/skia/src/core/SkPixelRef.cpp FILE: ../../../third_party/skia/src/core/SkPtrRecorder.cpp FILE: ../../../third_party/skia/src/core/SkReadBuffer.h -FILE: ../../../third_party/skia/src/core/SkRefDict.cpp -FILE: ../../../third_party/skia/src/core/SkRefDict.h FILE: ../../../third_party/skia/src/core/SkTypefaceCache.cpp FILE: ../../../third_party/skia/src/core/SkTypefaceCache.h FILE: ../../../third_party/skia/src/core/SkUnPreMultiply.cpp From 29f869f39054e61f628b6ca80a97a5d850f8a839 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 16 Jul 2018 20:57:35 -0400 Subject: [PATCH 0802/1190] Roll src/third_party/skia 7701599cef6f..0c64e52aea82 (1 commits) (#5775) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 15300d417a744..3fee82dd2411e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '7701599cef6f5a467804a2c2aaf3ba2de194382b', + 'skia_revision': '0c64e52aea82deaf8c4157e0a0ac62fcaa0023c8', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 04a41f4ccaad6..7c53032dfce3f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: dc36a5f9e5a0b06686a449bfafe95450 +Signature: 075d60597db6bcfff5096dfb2cdcb97f UNUSED LICENSES: From afd784395c13d82d73f0f6c3e5863b5473ee4101 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 16 Jul 2018 22:42:35 -0400 Subject: [PATCH 0803/1190] Roll src/third_party/skia 0c64e52aea82..9fb90f83997a (1 commits) (#5776) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3fee82dd2411e..473c82e29ca12 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '0c64e52aea82deaf8c4157e0a0ac62fcaa0023c8', + 'skia_revision': '9fb90f83997a71076b8ce2e178750f3ad9570d38', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7c53032dfce3f..5b3227beda211 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 075d60597db6bcfff5096dfb2cdcb97f +Signature: 8649680513e50821415fa59f4d8561c8 UNUSED LICENSES: From 41acc22b555dd94ccc2b1acb258c75a79b245a51 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 02:06:35 -0400 Subject: [PATCH 0804/1190] Roll src/third_party/skia 9fb90f83997a..bf2a980d03db (1 commits) (#5777) Auto-roller completed checks. Merging. --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 473c82e29ca12..92ae4e96af21f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9fb90f83997a71076b8ce2e178750f3ad9570d38', + 'skia_revision': 'bf2a980d03db8b2e8ab6c389bb05b11d710602fa', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the From 7b8bfdf163ed3d7b795afb722ed56949daa43c0f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 04:35:35 -0400 Subject: [PATCH 0805/1190] Roll src/third_party/skia bf2a980d03db..9c98576bceff (1 commits) (#5778) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 92ae4e96af21f..c325ae87dfb43 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'bf2a980d03db8b2e8ab6c389bb05b11d710602fa', + 'skia_revision': '9c98576bceffc721a71550ea9c0942d9a008da3b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 5b3227beda211..b9925838fa84f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8649680513e50821415fa59f4d8561c8 +Signature: 2dbbd4c3dedf9ed2eecd5df2a3490be5 UNUSED LICENSES: From 0045eede13a9a35f82f0809461c991b0b50c31ed Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 08:02:35 -0400 Subject: [PATCH 0806/1190] Roll src/third_party/skia 9c98576bceff..94fee93c9b23 (1 commits) (#5779) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c325ae87dfb43..ad60d7bf06f80 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9c98576bceffc721a71550ea9c0942d9a008da3b', + 'skia_revision': '94fee93c9b23bd1a32604753da8bef755d6c8a95', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b9925838fa84f..7127f6221aa5e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2dbbd4c3dedf9ed2eecd5df2a3490be5 +Signature: 059d14894b7d95b937c30ed8499aec9e UNUSED LICENSES: From 45b6f0feaa74b251b12d05aca777b862272f312f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 08:49:53 -0400 Subject: [PATCH 0807/1190] Roll src/third_party/skia 94fee93c9b23..4fa31782fc55 (1 commits) (#5780) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ad60d7bf06f80..ec5fa40e33910 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '94fee93c9b23bd1a32604753da8bef755d6c8a95', + 'skia_revision': '4fa31782fc55c43e0ba1566034207fa18089c0e7', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 7127f6221aa5e..b9925838fa84f 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 059d14894b7d95b937c30ed8499aec9e +Signature: 2dbbd4c3dedf9ed2eecd5df2a3490be5 UNUSED LICENSES: From 4eb2a5ea47817941bd22ae0e59c188f6e126e620 Mon Sep 17 00:00:00 2001 From: egdaniel Date: Tue, 17 Jul 2018 08:59:36 -0400 Subject: [PATCH 0808/1190] Remove use of GrVkInterface in vulkan. (#5764) --- vulkan/vulkan_proc_table.cc | 17 +++++++++++++++++ vulkan/vulkan_proc_table.h | 3 +++ vulkan/vulkan_window.cc | 7 +++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/vulkan/vulkan_proc_table.cc b/vulkan/vulkan_proc_table.cc index f6be9a83e02ad..9f0e62311584e 100644 --- a/vulkan/vulkan_proc_table.cc +++ b/vulkan/vulkan_proc_table.cc @@ -227,4 +227,21 @@ sk_sp VulkanProcTable::CreateSkiaInterface() const { 0 /* extensions */); } +GrVkGetProc VulkanProcTable::CreateSkiaGetProc() const { + if (!IsValid()) { + return nullptr; + } + + return [this](const char* proc_name, VkInstance instance, VkDevice device) { + if (device != VK_NULL_HANDLE) { + auto result = AcquireProc(proc_name, {device, nullptr}); + if (result != nullptr) { + return result; + } + } + + return AcquireProc(proc_name, {instance, nullptr}); + }; +} + } // namespace vulkan diff --git a/vulkan/vulkan_proc_table.h b/vulkan/vulkan_proc_table.h index e00b5b7e8cc79..95f028a567ac8 100644 --- a/vulkan/vulkan_proc_table.h +++ b/vulkan/vulkan_proc_table.h @@ -11,6 +11,7 @@ #include "lib/fxl/memory/ref_counted.h" #include "lib/fxl/memory/ref_ptr.h" #include "third_party/skia/include/core/SkRefCnt.h" +#include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" #include "third_party/skia/include/gpu/vk/GrVkInterface.h" namespace vulkan { @@ -59,7 +60,9 @@ class VulkanProcTable : public fxl::RefCountedThreadSafe { bool SetupDeviceProcAddresses(const VulkanHandle& device); + // CreateSkiaInterface is deprecated. sk_sp CreateSkiaInterface() const; + GrVkGetProc CreateSkiaGetProc() const; #define DEFINE_PROC(name) Proc name; diff --git a/vulkan/vulkan_window.cc b/vulkan/vulkan_window.cc index e54bb0aa95e5a..dc26140b5a889 100644 --- a/vulkan/vulkan_window.cc +++ b/vulkan/vulkan_window.cc @@ -13,7 +13,6 @@ #include "flutter/vulkan/vulkan_surface.h" #include "flutter/vulkan/vulkan_swapchain.h" #include "third_party/skia/include/gpu/GrContext.h" -#include "third_party/skia/include/gpu/vk/GrVkInterface.h" namespace vulkan { @@ -117,9 +116,9 @@ bool VulkanWindow::CreateSkiaGrContext() { } bool VulkanWindow::CreateSkiaBackendContext(GrVkBackendContext* context) { - auto interface = vk->CreateSkiaInterface(); + auto getProc = vk->CreateSkiaGetProc(); - if (interface == nullptr || !interface->validate(0)) { + if (getProc == nullptr) { return false; } @@ -138,7 +137,7 @@ bool VulkanWindow::CreateSkiaBackendContext(GrVkBackendContext* context) { kKHR_swapchain_GrVkExtensionFlag | surface_->GetNativeSurface().GetSkiaExtensionName(); context->fFeatures = skia_features; - context->fInterface.reset(interface.release()); + context->fGetProc = std::move(getProc); context->fOwnsInstanceAndDevice = false; return true; } From df86a0e92bd9b8a77407c1b8fe899fe670c2d986 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 09:12:36 -0400 Subject: [PATCH 0809/1190] Roll src/third_party/skia 4fa31782fc55..f960398f3319 (1 commits) (#5781) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index ec5fa40e33910..b6fbc5ffa90d8 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4fa31782fc55c43e0ba1566034207fa18089c0e7', + 'skia_revision': 'f960398f331912adceb3455cd10c65e33ce184e0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b9925838fa84f..772ea9ebed517 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 2dbbd4c3dedf9ed2eecd5df2a3490be5 +Signature: 63ee5af2dc1f7fec2c7437291709992f UNUSED LICENSES: From 28bda9bd89ddc0440b31d0046958e6d30c980197 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 09:54:35 -0400 Subject: [PATCH 0810/1190] Roll src/third_party/skia f960398f3319..9b4bd5990154 (1 commits) (#5782) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b6fbc5ffa90d8..f21660134e14f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f960398f331912adceb3455cd10c65e33ce184e0', + 'skia_revision': '9b4bd599015445dbbfb85af3159404c1c5c21bc4', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 772ea9ebed517..30888e7eb5a9c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 63ee5af2dc1f7fec2c7437291709992f +Signature: 66d7a6e3c5c82a5743b39957f8752f66 UNUSED LICENSES: From a579d84e36c6d4d9b4c3f60ff9da676139084731 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 10:43:35 -0400 Subject: [PATCH 0811/1190] Roll src/third_party/skia 9b4bd5990154..f6db495d2d3d (1 commits) (#5783) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f21660134e14f..38bfb4e6d7e58 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9b4bd599015445dbbfb85af3159404c1c5c21bc4', + 'skia_revision': 'f6db495d2d3d1d535c51048a06091706e74f48f4', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 30888e7eb5a9c..cc32cd1c5d165 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 66d7a6e3c5c82a5743b39957f8752f66 +Signature: c5f056a24a3b1c738a9302b070169028 UNUSED LICENSES: From a4f15c6f9a3d068451fc330c13a277ceaeb245c7 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 11:08:35 -0400 Subject: [PATCH 0812/1190] Roll src/third_party/skia f6db495d2d3d..6dd4b209091b (1 commits) (#5785) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 38bfb4e6d7e58..6819a36aec448 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f6db495d2d3d1d535c51048a06091706e74f48f4', + 'skia_revision': '6dd4b209091b876832218e8adf1909669960bf98', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index cc32cd1c5d165..a371f53cab944 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: c5f056a24a3b1c738a9302b070169028 +Signature: a4330b4cc2f8fcb33366c1679747b4e7 UNUSED LICENSES: From 133ba55df5bc206a354724bc5c9d1121d393d3af Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 11:33:35 -0400 Subject: [PATCH 0813/1190] Roll src/third_party/skia 6dd4b209091b..b609e6dc6a02 (1 commits) (#5786) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 6819a36aec448..678585dec82cf 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6dd4b209091b876832218e8adf1909669960bf98', + 'skia_revision': 'b609e6dc6a02336aed04caaddcdd5ccfbe7ba9ec', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a371f53cab944..b6a472d883649 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: a4330b4cc2f8fcb33366c1679747b4e7 +Signature: fe8f50abcc4fc21f3470cd0689b18a6b UNUSED LICENSES: @@ -16958,6 +16958,7 @@ FILE: ../../../third_party/skia/gm/polygonoffset.cpp FILE: ../../../third_party/skia/gm/scaledemoji.cpp FILE: ../../../third_party/skia/gm/shadermaskfilter.cpp FILE: ../../../third_party/skia/gm/sharedcorners.cpp +FILE: ../../../third_party/skia/gm/skinning.cpp FILE: ../../../third_party/skia/include/android/SkAnimatedImage.h FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h FILE: ../../../third_party/skia/include/core/SkCoverageMode.h From 2d866b48f48f72ae09b8ff9803c7f6e41d0dceae Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 13:22:35 -0400 Subject: [PATCH 0814/1190] Roll src/third_party/skia b609e6dc6a02..462417d3d868 (1 commits) (#5787) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 678585dec82cf..007426b3db68b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b609e6dc6a02336aed04caaddcdd5ccfbe7ba9ec', + 'skia_revision': '462417d3d8683a8efe3b4d5813b972e478655ac3', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b6a472d883649..3f68c30026c70 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: fe8f50abcc4fc21f3470cd0689b18a6b +Signature: bb7381dffd960bd66a62e4cccd5bc44e UNUSED LICENSES: From c7da3aa72d2daa42fe1c74ee5dc65b9b6a2c7803 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 17 Jul 2018 14:08:35 -0400 Subject: [PATCH 0815/1190] Roll src/third_party/skia 462417d3d868..9e0d7e4072e4 (2 commits) (#5789) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 24 +++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/DEPS b/DEPS index 007426b3db68b..58e88f892e99e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '462417d3d8683a8efe3b4d5813b972e478655ac3', + 'skia_revision': '9e0d7e4072e43495a3907bb2bac7824e8e60c368', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3f68c30026c70..326b4adc5222d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: bb7381dffd960bd66a62e4cccd5bc44e +Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 UNUSED LICENSES: @@ -14397,18 +14397,28 @@ FILE: ../../../third_party/skia/src/compute/common/macros.h FILE: ../../../third_party/skia/src/compute/common/util.c FILE: ../../../third_party/skia/src/compute/common/util.h FILE: ../../../third_party/skia/src/compute/hs/cl/bench/main.c -FILE: ../../../third_party/skia/src/compute/hs/cl/gen9/hs_cl.cl -FILE: ../../../third_party/skia/src/compute/hs/cl/gen9/hs_cl.h -FILE: ../../../third_party/skia/src/compute/hs/cl/gen9/hs_cl_macros.h FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.c FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.h +FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_target.h +FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_cl.cl +FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_cl.h +FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_cl_macros.h +FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_target.h FILE: ../../../third_party/skia/src/compute/hs/gen/gen.h FILE: ../../../third_party/skia/src/compute/hs/gen/main.c FILE: ../../../third_party/skia/src/compute/hs/gen/networks.h FILE: ../../../third_party/skia/src/compute/hs/gen/networks_merging.c FILE: ../../../third_party/skia/src/compute/hs/gen/networks_sorting.c -FILE: ../../../third_party/skia/src/compute/hs/gen/target_cuda_sm3x.c -FILE: ../../../third_party/skia/src/compute/hs/gen/target_igp_genx.c +FILE: ../../../third_party/skia/src/compute/hs/gen/target_cuda.c +FILE: ../../../third_party/skia/src/compute/hs/gen/target_glsl.c +FILE: ../../../third_party/skia/src/compute/hs/gen/target_opencl.c +FILE: ../../../third_party/skia/src/compute/hs/vk/hs_spirv_target.h +FILE: ../../../third_party/skia/src/compute/hs/vk/hs_vk_launcher.c +FILE: ../../../third_party/skia/src/compute/hs/vk/hs_vk_launcher.h +FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_glsl.h +FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_glsl_macros.h +FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_kernels.h +FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_target.h FILE: ../../../third_party/skia/src/compute/sk/SkContext_Compute.cpp FILE: ../../../third_party/skia/src/compute/sk/SkContext_Compute.h FILE: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.cpp @@ -17012,6 +17022,7 @@ FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.c FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.h FILE: ../../../third_party/skia/src/compute/hs/cl/bench/sort.cpp +FILE: ../../../third_party/skia/src/compute/hs/gen/target_debug.c FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.c FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.h FILE: ../../../third_party/skia/src/compute/skc/allocator_host.c @@ -17050,6 +17061,7 @@ FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.h FILE: ../../../third_party/skia/src/core/SkSafeRange.h FILE: ../../../third_party/skia/src/core/SkStrikeCache.cpp FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp +FILE: ../../../third_party/skia/src/core/SkTextBlobPriv.h FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp From 5557e3006e8346b2d3cccf3fa68859a00947641f Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 17 Jul 2018 11:58:42 -0700 Subject: [PATCH 0816/1190] Fix allocation of JNI byte buffer on API level 22 and below (#5788) --- .../platform/android/platform_view_android.cc | 39 ++++++++++++------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 422358da27fcb..a72a85200d054 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -178,8 +178,9 @@ void PlatformViewAndroid::DispatchSemanticsAction(JNIEnv* env, } // |shell::PlatformView| -void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update, - blink::CustomAccessibilityActionUpdates actions) { +void PlatformViewAndroid::UpdateSemantics( + blink::SemanticsNodeUpdates update, + blink::CustomAccessibilityActionUpdates actions) { constexpr size_t kBytesPerNode = 36 * sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t); constexpr size_t kBytesPerAction = 2 * sizeof(int32_t); @@ -196,7 +197,8 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update, num_bytes += value.second.childrenInTraversalOrder.size() * kBytesPerChild; num_bytes += value.second.childrenInHitTestOrder.size() * kBytesPerChild; - num_bytes += value.second.customAccessibilityActions.size() * kBytesPerChild; + num_bytes += + value.second.customAccessibilityActions.size() * kBytesPerChild; } std::vector buffer(num_bytes); @@ -271,7 +273,8 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update, // custom accessibility actions. size_t num_action_bytes = actions.size() * kBytesPerAction; std::vector actions_buffer(num_action_bytes); - int32_t* actions_buffer_int32 = reinterpret_cast(&actions_buffer[0]); + int32_t* actions_buffer_int32 = + reinterpret_cast(&actions_buffer[0]); std::vector action_strings; size_t actions_position = 0; @@ -289,18 +292,24 @@ void PlatformViewAndroid::UpdateSemantics(blink::SemanticsNodeUpdates update, } } - fml::jni::ScopedJavaLocalRef direct_actions_buffer( - env, env->NewDirectByteBuffer(actions_buffer.data(), actions_buffer.size())); - - fml::jni::ScopedJavaLocalRef direct_buffer( - env, env->NewDirectByteBuffer(buffer.data(), buffer.size())); + // Calling NewDirectByteBuffer in API level 22 and below with a size of zero + // will cause a JNI crash. + if (actions_buffer.size() > 0) { + fml::jni::ScopedJavaLocalRef direct_actions_buffer( + env, env->NewDirectByteBuffer(actions_buffer.data(), + actions_buffer.size())); + FlutterViewUpdateCustomAccessibilityActions( + env, view.obj(), direct_actions_buffer.obj(), + fml::jni::VectorToStringArray(env, action_strings).obj()); + } - FlutterViewUpdateCustomAccessibilityActions( - env, view.obj(), direct_actions_buffer.obj(), - fml::jni::VectorToStringArray(env, action_strings).obj()); - FlutterViewUpdateSemantics( - env, view.obj(), direct_buffer.obj(), - fml::jni::VectorToStringArray(env, strings).obj()); + if (buffer.size() > 0) { + fml::jni::ScopedJavaLocalRef direct_buffer( + env, env->NewDirectByteBuffer(buffer.data(), buffer.size())); + FlutterViewUpdateSemantics( + env, view.obj(), direct_buffer.obj(), + fml::jni::VectorToStringArray(env, strings).obj()); + } } } From 3fe63fd5d980d9f7bcbccff20c74a181e60ee2b8 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Wed, 18 Jul 2018 11:08:25 -0700 Subject: [PATCH 0817/1190] Add presubmit check for engine to flutter roll (#5790) This prevents us from getting flutter far behind engine in the future. The additional travis check will also stop the skia autoroller even if we foget to turn it off. --- .travis.yml | 1 + travis/check_roll.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 travis/check_roll.sh diff --git a/.travis.yml b/.travis.yml index 043404ff10922..1364ad1932260 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ sudo: false before_script: - ./travis/setup.sh script: + - ./travis/check_roll.sh - ./travis/format.sh - ./travis/build.sh - ./travis/test.sh diff --git a/travis/check_roll.sh b/travis/check_roll.sh new file mode 100755 index 0000000000000..296300d3eaef8 --- /dev/null +++ b/travis/check_roll.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if git remote get-url upstream >/dev/null 2>&1; then + UPSTREAM=upstream/master +else + UPSTREAM=master +fi; + +FLUTTER_VERSION="$(curl -s https://raw.githubusercontent.com/flutter/flutter/master/bin/internal/engine.version)" +BEHIND="$(git rev-list $FLUTTER_VERSION..$UPSTREAM --oneline | wc -l)" +MAX_BEHIND=16 # no more than 4 bisections to identify the issue + +if [[ $BEHIND -le $MAX_BEHIND ]]; then + echo "OK, the flutter/engine to flutter/flutter roll is only $BEHIND commits behind." +else + echo "ERROR: The flutter/engine to flutter/flutter roll is $BEHIND commits behind!" + echo " It exceeds our max allowance of $MAX_BEHIND. Unless that this commit fixes the roll," + echo " please roll engine into flutter first before merging more commits into engine." + exit 1 +fi + From 16da4710da34794e80d00fa08bb41e1282f859b2 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 18 Jul 2018 14:29:35 -0400 Subject: [PATCH 0818/1190] Roll src/third_party/skia 9e0d7e4072e4..8f8bf8880d9d (32 commits) (#5794) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 58e88f892e99e..c2bd0674a1f47 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9e0d7e4072e43495a3907bb2bac7824e8e60c368', + 'skia_revision': '8f8bf8880d9d9fe8280fa29304063ecc7207e59f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 326b4adc5222d..829626fc6a6b6 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 +Signature: 0661924778e60bfba48a12d35c06f5b7 UNUSED LICENSES: @@ -14326,6 +14326,7 @@ FILE: ../../../third_party/skia/gm/hardstop_gradients.cpp FILE: ../../../third_party/skia/gm/imagemakewithfilter.cpp FILE: ../../../third_party/skia/gm/imagemasksubset.cpp FILE: ../../../third_party/skia/gm/lattice.cpp +FILE: ../../../third_party/skia/gm/lightingshader2.cpp FILE: ../../../third_party/skia/gm/occludedrrectblur.cpp FILE: ../../../third_party/skia/gm/overdrawcolorfilter.cpp FILE: ../../../third_party/skia/gm/pathmaskcache.cpp @@ -14381,6 +14382,7 @@ FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_primitive.cpp FILE: ../../../third_party/skia/samplecode/DecodeFile.h FILE: ../../../third_party/skia/samplecode/SampleAndroidShadows.cpp FILE: ../../../third_party/skia/samplecode/SampleCode.cpp +FILE: ../../../third_party/skia/samplecode/SampleLitAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleMegaStroke.cpp FILE: ../../../third_party/skia/samplecode/SamplePathOverstroke.cpp FILE: ../../../third_party/skia/samplecode/SampleSVGFile.cpp @@ -14469,6 +14471,7 @@ FILE: ../../../third_party/skia/src/core/SkICCPriv.h FILE: ../../../third_party/skia/src/core/SkImageFilterCache.cpp FILE: ../../../third_party/skia/src/core/SkImageFilterCache.h FILE: ../../../third_party/skia/src/core/SkLRUCache.h +FILE: ../../../third_party/skia/src/core/SkLights.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.h FILE: ../../../third_party/skia/src/core/SkLiteRecorder.cpp @@ -14477,6 +14480,12 @@ FILE: ../../../third_party/skia/src/core/SkMSAN.h FILE: ../../../third_party/skia/src/core/SkMakeUnique.h FILE: ../../../third_party/skia/src/core/SkMatrixPriv.h FILE: ../../../third_party/skia/src/core/SkModeColorFilter.h +FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.h +FILE: ../../../third_party/skia/src/core/SkNormalMapSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalMapSource.h +FILE: ../../../third_party/skia/src/core/SkNormalSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalSource.h FILE: ../../../third_party/skia/src/core/SkOverdrawCanvas.cpp FILE: ../../../third_party/skia/src/core/SkPM4f.h FILE: ../../../third_party/skia/src/core/SkPM4fPriv.h @@ -18583,6 +18592,7 @@ FILE: ../../../third_party/skia/gm/imagesource2.cpp FILE: ../../../third_party/skia/gm/largeglyphblur.cpp FILE: ../../../third_party/skia/gm/lcdblendmodes.cpp FILE: ../../../third_party/skia/gm/lcdoverlap.cpp +FILE: ../../../third_party/skia/gm/lightingshader.cpp FILE: ../../../third_party/skia/gm/localmatriximagefilter.cpp FILE: ../../../third_party/skia/gm/localmatriximageshader.cpp FILE: ../../../third_party/skia/gm/mipmap.cpp @@ -18611,6 +18621,7 @@ FILE: ../../../third_party/skia/include/codec/SkAndroidCodec.h FILE: ../../../third_party/skia/include/codec/SkCodec.h FILE: ../../../third_party/skia/include/core/SkEncodedImageFormat.h FILE: ../../../third_party/skia/include/core/SkFilterQuality.h +FILE: ../../../third_party/skia/include/core/SkLights.h FILE: ../../../third_party/skia/include/core/SkPixmap.h FILE: ../../../third_party/skia/include/core/SkPngChunkReader.h FILE: ../../../third_party/skia/include/core/SkPoint3.h @@ -18641,6 +18652,7 @@ FILE: ../../../third_party/skia/samplecode/SampleAnimatedText.cpp FILE: ../../../third_party/skia/samplecode/SampleAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleClipDrawMatch.cpp FILE: ../../../third_party/skia/samplecode/SampleFilterQuality.cpp +FILE: ../../../third_party/skia/samplecode/SampleLighting.cpp FILE: ../../../third_party/skia/samplecode/SamplePathFuzz.cpp FILE: ../../../third_party/skia/samplecode/SampleShip.cpp FILE: ../../../third_party/skia/samplecode/SampleXfer.cpp @@ -18909,6 +18921,8 @@ FILE: ../../../third_party/skia/src/ports/SkOSLibrary_posix.cpp FILE: ../../../third_party/skia/src/ports/SkOSLibrary_win.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.h +FILE: ../../../third_party/skia/src/shaders/SkLightingShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkLightingShader.h FILE: ../../../third_party/skia/src/svg/SkSVGCanvas.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.h @@ -19883,6 +19897,7 @@ FILE: ../../../third_party/skia/include/effects/SkGradientShader.h FILE: ../../../third_party/skia/include/effects/SkTableMaskFilter.h FILE: ../../../third_party/skia/include/private/SkFixed.h FILE: ../../../third_party/skia/include/private/SkFloatingPoint.h +FILE: ../../../third_party/skia/include/private/SkNoncopyable.h FILE: ../../../third_party/skia/include/private/SkTDArray.h FILE: ../../../third_party/skia/include/private/SkTSearch.h FILE: ../../../third_party/skia/include/private/SkTemplates.h From 624cf7e25a2938c89975864fc2559ebcd839876e Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 18 Jul 2018 12:07:21 -0700 Subject: [PATCH 0819/1190] Fix Dart 2 reload when running from a snapshot instead of platform.dill. (#5792) Without this flag, the VM will attempt to interpret a kernel file as source code. Affects Fuchsia (FL-71) and code-push. --- runtime/dart_isolate.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index d1ecaf0191d9e..5f2389a11d37c 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -720,6 +720,16 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( ); } + // TODO(rmacnak): This flag setting business preserves a side effect of using + // Dart_CreateIsolateFromKernel. It should be removed when some of the + // internal logic in reload no longer uses this flag. + Dart_IsolateFlags nonnull_flags; + if (flags == nullptr) { + Dart_IsolateFlagsInitialize(&nonnull_flags); + flags = &nonnull_flags; + } + flags->use_dart_frontend = true; + // Create the Dart VM isolate and give it the embedder object as the baton. Dart_Isolate isolate = (vm->GetPlatformKernel().GetSize() > 0) From e8d172cf30090154f1f5216dfb32bd51357eb163 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 18 Jul 2018 13:18:05 -0700 Subject: [PATCH 0820/1190] Revert "Fix Dart 2 reload when running from a snapshot instead of platform.dill. (#5792)" (#5795) This reverts commit 624cf7e25a2938c89975864fc2559ebcd839876e. --- runtime/dart_isolate.cc | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 5f2389a11d37c..d1ecaf0191d9e 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -720,16 +720,6 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( ); } - // TODO(rmacnak): This flag setting business preserves a side effect of using - // Dart_CreateIsolateFromKernel. It should be removed when some of the - // internal logic in reload no longer uses this flag. - Dart_IsolateFlags nonnull_flags; - if (flags == nullptr) { - Dart_IsolateFlagsInitialize(&nonnull_flags); - flags = &nonnull_flags; - } - flags->use_dart_frontend = true; - // Create the Dart VM isolate and give it the embedder object as the baton. Dart_Isolate isolate = (vm->GetPlatformKernel().GetSize() > 0) From 8d046a727ab130368201c3ce472b7915208145e9 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 18 Jul 2018 13:32:11 -0700 Subject: [PATCH 0821/1190] Revert "Roll src/third_party/skia 9e0d7e4072e4..8f8bf8880d9d (32 commits) (#5794)" (#5797) This reverts commit 16da4710da34794e80d00fa08bb41e1282f859b2. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 17 +---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/DEPS b/DEPS index c2bd0674a1f47..58e88f892e99e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '8f8bf8880d9d9fe8280fa29304063ecc7207e59f', + 'skia_revision': '9e0d7e4072e43495a3907bb2bac7824e8e60c368', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 829626fc6a6b6..326b4adc5222d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0661924778e60bfba48a12d35c06f5b7 +Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 UNUSED LICENSES: @@ -14326,7 +14326,6 @@ FILE: ../../../third_party/skia/gm/hardstop_gradients.cpp FILE: ../../../third_party/skia/gm/imagemakewithfilter.cpp FILE: ../../../third_party/skia/gm/imagemasksubset.cpp FILE: ../../../third_party/skia/gm/lattice.cpp -FILE: ../../../third_party/skia/gm/lightingshader2.cpp FILE: ../../../third_party/skia/gm/occludedrrectblur.cpp FILE: ../../../third_party/skia/gm/overdrawcolorfilter.cpp FILE: ../../../third_party/skia/gm/pathmaskcache.cpp @@ -14382,7 +14381,6 @@ FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_primitive.cpp FILE: ../../../third_party/skia/samplecode/DecodeFile.h FILE: ../../../third_party/skia/samplecode/SampleAndroidShadows.cpp FILE: ../../../third_party/skia/samplecode/SampleCode.cpp -FILE: ../../../third_party/skia/samplecode/SampleLitAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleMegaStroke.cpp FILE: ../../../third_party/skia/samplecode/SamplePathOverstroke.cpp FILE: ../../../third_party/skia/samplecode/SampleSVGFile.cpp @@ -14471,7 +14469,6 @@ FILE: ../../../third_party/skia/src/core/SkICCPriv.h FILE: ../../../third_party/skia/src/core/SkImageFilterCache.cpp FILE: ../../../third_party/skia/src/core/SkImageFilterCache.h FILE: ../../../third_party/skia/src/core/SkLRUCache.h -FILE: ../../../third_party/skia/src/core/SkLights.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.h FILE: ../../../third_party/skia/src/core/SkLiteRecorder.cpp @@ -14480,12 +14477,6 @@ FILE: ../../../third_party/skia/src/core/SkMSAN.h FILE: ../../../third_party/skia/src/core/SkMakeUnique.h FILE: ../../../third_party/skia/src/core/SkMatrixPriv.h FILE: ../../../third_party/skia/src/core/SkModeColorFilter.h -FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.cpp -FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.h -FILE: ../../../third_party/skia/src/core/SkNormalMapSource.cpp -FILE: ../../../third_party/skia/src/core/SkNormalMapSource.h -FILE: ../../../third_party/skia/src/core/SkNormalSource.cpp -FILE: ../../../third_party/skia/src/core/SkNormalSource.h FILE: ../../../third_party/skia/src/core/SkOverdrawCanvas.cpp FILE: ../../../third_party/skia/src/core/SkPM4f.h FILE: ../../../third_party/skia/src/core/SkPM4fPriv.h @@ -18592,7 +18583,6 @@ FILE: ../../../third_party/skia/gm/imagesource2.cpp FILE: ../../../third_party/skia/gm/largeglyphblur.cpp FILE: ../../../third_party/skia/gm/lcdblendmodes.cpp FILE: ../../../third_party/skia/gm/lcdoverlap.cpp -FILE: ../../../third_party/skia/gm/lightingshader.cpp FILE: ../../../third_party/skia/gm/localmatriximagefilter.cpp FILE: ../../../third_party/skia/gm/localmatriximageshader.cpp FILE: ../../../third_party/skia/gm/mipmap.cpp @@ -18621,7 +18611,6 @@ FILE: ../../../third_party/skia/include/codec/SkAndroidCodec.h FILE: ../../../third_party/skia/include/codec/SkCodec.h FILE: ../../../third_party/skia/include/core/SkEncodedImageFormat.h FILE: ../../../third_party/skia/include/core/SkFilterQuality.h -FILE: ../../../third_party/skia/include/core/SkLights.h FILE: ../../../third_party/skia/include/core/SkPixmap.h FILE: ../../../third_party/skia/include/core/SkPngChunkReader.h FILE: ../../../third_party/skia/include/core/SkPoint3.h @@ -18652,7 +18641,6 @@ FILE: ../../../third_party/skia/samplecode/SampleAnimatedText.cpp FILE: ../../../third_party/skia/samplecode/SampleAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleClipDrawMatch.cpp FILE: ../../../third_party/skia/samplecode/SampleFilterQuality.cpp -FILE: ../../../third_party/skia/samplecode/SampleLighting.cpp FILE: ../../../third_party/skia/samplecode/SamplePathFuzz.cpp FILE: ../../../third_party/skia/samplecode/SampleShip.cpp FILE: ../../../third_party/skia/samplecode/SampleXfer.cpp @@ -18921,8 +18909,6 @@ FILE: ../../../third_party/skia/src/ports/SkOSLibrary_posix.cpp FILE: ../../../third_party/skia/src/ports/SkOSLibrary_win.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.h -FILE: ../../../third_party/skia/src/shaders/SkLightingShader.cpp -FILE: ../../../third_party/skia/src/shaders/SkLightingShader.h FILE: ../../../third_party/skia/src/svg/SkSVGCanvas.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.h @@ -19897,7 +19883,6 @@ FILE: ../../../third_party/skia/include/effects/SkGradientShader.h FILE: ../../../third_party/skia/include/effects/SkTableMaskFilter.h FILE: ../../../third_party/skia/include/private/SkFixed.h FILE: ../../../third_party/skia/include/private/SkFloatingPoint.h -FILE: ../../../third_party/skia/include/private/SkNoncopyable.h FILE: ../../../third_party/skia/include/private/SkTDArray.h FILE: ../../../third_party/skia/include/private/SkTSearch.h FILE: ../../../third_party/skia/include/private/SkTemplates.h From 1a66f895ba930450a7430acb9538d340d1cbce7f Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 18 Jul 2018 14:06:27 -0700 Subject: [PATCH 0822/1190] Roll Dart to 937ee2e8ca4b76499e24cd463f07bfb736bccd74. (#5745) --- DEPS | 24 +++++++++------------ travis/licenses_golden/licenses_third_party | 13 +++++------ 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/DEPS b/DEPS index 58e88f892e99e..817f4d33e721c 100644 --- a/DEPS +++ b/DEPS @@ -31,11 +31,11 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '84ca27a09ebd6a65cd23ee52d835d89cbe06c574', + 'dart_revision': '937ee2e8ca4b76499e24cd463f07bfb736bccd74', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', - 'dart_bazel_worker_tag': 'v0.1.9', + 'dart_bazel_worker_tag': '0.1.11', 'dart_boolean_selector_tag': '1.0.3', 'dart_boringssl_gen_rev': 'fc47eaa1a245d858bae462cd64d4155605b850ea', 'dart_boringssl_rev': '189270cd190267f5bd60cfe8f8ce7a61d07ba6f4', @@ -46,7 +46,7 @@ vars = { 'dart_crypto_tag': '2.0.5', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+4', - 'dart_dart_style_tag': '1.1.1', + 'dart_dart_style_tag': '1.1.2', 'dart_dartdoc_tag': 'v0.20.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', @@ -56,34 +56,33 @@ vars = { 'dart_http_retry_tag': '0.1.1', 'dart_http_tag': '0.11.3+17', 'dart_http_throttle_tag': '1.0.2', - 'dart_intl_tag': '0.15.2', + 'dart_intl_tag': '0.15.6', 'dart_json_rpc_2_tag': '2.0.6', 'dart_linter_tag': '0.1.56', 'dart_logging_tag': '0.11.3+1', - 'dart_markdown_tag': '2.0.0', + 'dart_markdown_tag': '2.0.1', 'dart_matcher_tag': '0.12.3', 'dart_mime_tag': '0.9.6', 'dart_mockito_tag': 'd39ac507483b9891165e422ec98d9fb480037c8b', 'dart_mustache4dart_tag': 'v2.1.2', - 'dart_oauth2_tag': '1.1.0', + 'dart_oauth2_tag': '1.2.1', 'dart_observatory_pub_packages_rev': 'caf0aecfb15077fc7a34d48e9df13606c793fddf', 'dart_package_config_tag': '1.0.3', 'dart_package_resolver_tag': '1.0.2+1', 'dart_path_tag': '1.5.1', 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', - 'dart_protobuf_tag': '0.7.1', + 'dart_protobuf_tag': '0.9.0', 'dart_pub_rev': '58fe996eab8d54f28f5109c407ff0ab62fbd835d', 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '0.29.0', - 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', 'dart_shelf_packages_handler_tag': '1.0.3', 'dart_shelf_static_rev': 'v0.2.7', - 'dart_shelf_tag': '0.7.2', + 'dart_shelf_tag': '0.7.3+2', 'dart_shelf_web_socket_tag': '0.2.2', 'dart_source_map_stack_trace_tag': '1.1.4', - 'dart_source_maps_tag': '0.10.4', + 'dart_source_maps_tag': '0.10.6', 'dart_source_span_tag': '1.4.0', 'dart_stack_trace_tag': '1.9.2', 'dart_stream_channel_tag': '1.6.4', @@ -96,7 +95,7 @@ vars = { 'dart_utf_tag': '0.9.0+4', 'dart_watcher_tag': '0.9.7+8', 'dart_web_socket_channel_tag': '1.0.7', - 'dart_yaml_tag': '2.1.13', + 'dart_yaml_tag': '2.1.14', # Build bot tooling for iOS 'ios_tools_revision': '69b7c1b160e7107a6a98d948363772dc9caea46f', @@ -283,9 +282,6 @@ deps = { 'src/third_party/dart/third_party/pkg/quiver': Var('chromium_git') + '/external/github.com/google/quiver-dart' + '@' + Var('dart_quiver_tag'), - 'src/third_party/dart/third_party/pkg/resource': - Var('dart_git') + '/resource.git' + '@' + Var('dart_resource_rev'), - 'src/third_party/dart/third_party/pkg/shelf': Var('dart_git') + '/shelf.git' + '@' + Var('dart_shelf_tag'), diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 326b4adc5222d..6c7c16e4f2731 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 +Signature: 8ab62fe95c1ef8d1c186d49def733f8e UNUSED LICENSES: @@ -4480,7 +4480,6 @@ FILE: ../../../third_party/dart/client/idea/.idea/.name FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Default.xml FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml FILE: ../../../third_party/dart/runtime/CPPLINT.cfg -FILE: ../../../third_party/dart/runtime/observatory/.analysis_options FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png @@ -4490,8 +4489,6 @@ FILE: ../../../third_party/dart/runtime/observatory/web/index.html FILE: ../../../third_party/dart/runtime/observatory/web/third_party/trace_viewer_full.html FILE: ../../../third_party/dart/runtime/observatory/web/timeline.html FILE: ../../../third_party/dart/runtime/vm/snapshot_test_in.dat -FILE: ../../../third_party/dart/samples/build_dart/test.foo -FILE: ../../../third_party/dart/samples/build_dart_simple/test.foo FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common.dart FILE: ../../../third_party/dart/sdk/lib/libraries.json @@ -4884,10 +4881,6 @@ FILE: ../../../third_party/dart/runtime/vm/virtual_memory_win.cc FILE: ../../../third_party/dart/runtime/vm/zone.cc FILE: ../../../third_party/dart/runtime/vm/zone.h FILE: ../../../third_party/dart/runtime/vm/zone_test.cc -FILE: ../../../third_party/dart/samples/build_dart/bin/test.dart -FILE: ../../../third_party/dart/samples/build_dart/build.dart -FILE: ../../../third_party/dart/samples/build_dart_simple/build.dart -FILE: ../../../third_party/dart/samples/build_dart_simple/test.dart FILE: ../../../third_party/dart/samples/sample_extension/sample_asynchronous_extension.dart FILE: ../../../third_party/dart/samples/sample_extension/sample_extension.cc FILE: ../../../third_party/dart/samples/sample_extension/sample_extension_dllmain_win.cc @@ -5642,6 +5635,10 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.cc From 91c16af0c5e6cfb857240d661be1bfa168fe37ff Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 18 Jul 2018 14:38:03 -0700 Subject: [PATCH 0823/1190] Revert "Roll Dart to 937ee2e8ca4b76499e24cd463f07bfb736bccd74. (#5745)" (#5799) This reverts commit 1a66f895ba930450a7430acb9538d340d1cbce7f. --- DEPS | 24 ++++++++++++--------- travis/licenses_golden/licenses_third_party | 13 ++++++----- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/DEPS b/DEPS index 817f4d33e721c..58e88f892e99e 100644 --- a/DEPS +++ b/DEPS @@ -31,11 +31,11 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '937ee2e8ca4b76499e24cd463f07bfb736bccd74', + 'dart_revision': '84ca27a09ebd6a65cd23ee52d835d89cbe06c574', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', - 'dart_bazel_worker_tag': '0.1.11', + 'dart_bazel_worker_tag': 'v0.1.9', 'dart_boolean_selector_tag': '1.0.3', 'dart_boringssl_gen_rev': 'fc47eaa1a245d858bae462cd64d4155605b850ea', 'dart_boringssl_rev': '189270cd190267f5bd60cfe8f8ce7a61d07ba6f4', @@ -46,7 +46,7 @@ vars = { 'dart_crypto_tag': '2.0.5', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+4', - 'dart_dart_style_tag': '1.1.2', + 'dart_dart_style_tag': '1.1.1', 'dart_dartdoc_tag': 'v0.20.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', @@ -56,33 +56,34 @@ vars = { 'dart_http_retry_tag': '0.1.1', 'dart_http_tag': '0.11.3+17', 'dart_http_throttle_tag': '1.0.2', - 'dart_intl_tag': '0.15.6', + 'dart_intl_tag': '0.15.2', 'dart_json_rpc_2_tag': '2.0.6', 'dart_linter_tag': '0.1.56', 'dart_logging_tag': '0.11.3+1', - 'dart_markdown_tag': '2.0.1', + 'dart_markdown_tag': '2.0.0', 'dart_matcher_tag': '0.12.3', 'dart_mime_tag': '0.9.6', 'dart_mockito_tag': 'd39ac507483b9891165e422ec98d9fb480037c8b', 'dart_mustache4dart_tag': 'v2.1.2', - 'dart_oauth2_tag': '1.2.1', + 'dart_oauth2_tag': '1.1.0', 'dart_observatory_pub_packages_rev': 'caf0aecfb15077fc7a34d48e9df13606c793fddf', 'dart_package_config_tag': '1.0.3', 'dart_package_resolver_tag': '1.0.2+1', 'dart_path_tag': '1.5.1', 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', - 'dart_protobuf_tag': '0.9.0', + 'dart_protobuf_tag': '0.7.1', 'dart_pub_rev': '58fe996eab8d54f28f5109c407ff0ab62fbd835d', 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '0.29.0', + 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', 'dart_shelf_packages_handler_tag': '1.0.3', 'dart_shelf_static_rev': 'v0.2.7', - 'dart_shelf_tag': '0.7.3+2', + 'dart_shelf_tag': '0.7.2', 'dart_shelf_web_socket_tag': '0.2.2', 'dart_source_map_stack_trace_tag': '1.1.4', - 'dart_source_maps_tag': '0.10.6', + 'dart_source_maps_tag': '0.10.4', 'dart_source_span_tag': '1.4.0', 'dart_stack_trace_tag': '1.9.2', 'dart_stream_channel_tag': '1.6.4', @@ -95,7 +96,7 @@ vars = { 'dart_utf_tag': '0.9.0+4', 'dart_watcher_tag': '0.9.7+8', 'dart_web_socket_channel_tag': '1.0.7', - 'dart_yaml_tag': '2.1.14', + 'dart_yaml_tag': '2.1.13', # Build bot tooling for iOS 'ios_tools_revision': '69b7c1b160e7107a6a98d948363772dc9caea46f', @@ -282,6 +283,9 @@ deps = { 'src/third_party/dart/third_party/pkg/quiver': Var('chromium_git') + '/external/github.com/google/quiver-dart' + '@' + Var('dart_quiver_tag'), + 'src/third_party/dart/third_party/pkg/resource': + Var('dart_git') + '/resource.git' + '@' + Var('dart_resource_rev'), + 'src/third_party/dart/third_party/pkg/shelf': Var('dart_git') + '/shelf.git' + '@' + Var('dart_shelf_tag'), diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 6c7c16e4f2731..326b4adc5222d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8ab62fe95c1ef8d1c186d49def733f8e +Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 UNUSED LICENSES: @@ -4480,6 +4480,7 @@ FILE: ../../../third_party/dart/client/idea/.idea/.name FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Default.xml FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml FILE: ../../../third_party/dart/runtime/CPPLINT.cfg +FILE: ../../../third_party/dart/runtime/observatory/.analysis_options FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png @@ -4489,6 +4490,8 @@ FILE: ../../../third_party/dart/runtime/observatory/web/index.html FILE: ../../../third_party/dart/runtime/observatory/web/third_party/trace_viewer_full.html FILE: ../../../third_party/dart/runtime/observatory/web/timeline.html FILE: ../../../third_party/dart/runtime/vm/snapshot_test_in.dat +FILE: ../../../third_party/dart/samples/build_dart/test.foo +FILE: ../../../third_party/dart/samples/build_dart_simple/test.foo FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common.dart FILE: ../../../third_party/dart/sdk/lib/libraries.json @@ -4881,6 +4884,10 @@ FILE: ../../../third_party/dart/runtime/vm/virtual_memory_win.cc FILE: ../../../third_party/dart/runtime/vm/zone.cc FILE: ../../../third_party/dart/runtime/vm/zone.h FILE: ../../../third_party/dart/runtime/vm/zone_test.cc +FILE: ../../../third_party/dart/samples/build_dart/bin/test.dart +FILE: ../../../third_party/dart/samples/build_dart/build.dart +FILE: ../../../third_party/dart/samples/build_dart_simple/build.dart +FILE: ../../../third_party/dart/samples/build_dart_simple/test.dart FILE: ../../../third_party/dart/samples/sample_extension/sample_asynchronous_extension.dart FILE: ../../../third_party/dart/samples/sample_extension/sample_extension.cc FILE: ../../../third_party/dart/samples/sample_extension/sample_extension_dllmain_win.cc @@ -5635,10 +5642,6 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.cc From 3054f31837e469f4ec736e48ee872f48976b0e02 Mon Sep 17 00:00:00 2001 From: amirh Date: Wed, 18 Jul 2018 15:20:59 -0700 Subject: [PATCH 0824/1190] Add touch events to the platform views method channel API. (#5796) --- .../platform/PlatformViewsController.java | 55 ++++++++++++++++++- .../platform/SingleViewPresentation.java | 7 +++ .../platform/VirtualDisplayController.java | 6 ++ 3 files changed, 67 insertions(+), 1 deletion(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index 77051ee37087f..417eb021e088a 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -5,9 +5,10 @@ package io.flutter.plugin.platform; import android.annotation.TargetApi; -import android.content.Context; import android.os.Build; import android.util.Log; +import android.view.MotionEvent; +import android.view.View; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.plugin.common.StandardMethodCodec; @@ -15,6 +16,7 @@ import io.flutter.view.TextureRegistry; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -86,6 +88,9 @@ public void onMethodCall(final MethodCall call, final MethodChannel.Result resul case "resize": resizePlatformView(call, result); return; + case "touch": + onTouch(call, result); + return; } result.notImplemented(); } @@ -183,6 +188,54 @@ private void resizePlatformView(MethodCall call, MethodChannel.Result result) { result.success(null); } + private void onTouch(MethodCall call, MethodChannel.Result result) { + List args = call.arguments(); + + int id = (int) args.get(0); + int downTime = (int) args.get(1); + int eventTime = (int) args.get(2); + int action = (int) args.get(3); + double x = (double) args.get(4); + double y = (double) args.get(5); + double pressure = (double) args.get(6); + double size = (double) args.get(7); + int metaState = (int) args.get(8); + double xPrecision = (double) args.get(9); + double yPrecision = (double) args.get(10); + int deviceId = (int) args.get(11); + int edgeFlags = (int) args.get(12); + + View view = vdControllers.get(id).getView(); + if (view == null) { + result.error( + "error", + "Sending touch to an unknown view with id: " + id, + null + ); + return; + } + + float density = mFlutterView.getContext().getResources().getDisplayMetrics().density; + + MotionEvent event = MotionEvent.obtain( + downTime, + eventTime, + action, + (float) x * density, + (float) y * density, + (float) pressure, + (float) size, + metaState, + (float) xPrecision, + (float) yPrecision, + deviceId, + edgeFlags + ); + + view.onTouchEvent(event); + result.success(null); + } + private int toPhysicalPixels(double logicalPixels) { float density = mFlutterView.getContext().getResources().getDisplayMetrics().density; return (int) Math.round(logicalPixels * density); diff --git a/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java b/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java index 72bbca92a928c..b305c40fafa90 100644 --- a/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java +++ b/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java @@ -10,6 +10,7 @@ import android.os.Build; import android.os.Bundle; import android.view.Display; +import android.view.View; import android.widget.FrameLayout; @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @@ -61,4 +62,10 @@ public PlatformView detachView() { mContainer.removeView(mView.getView()); return mView; } + + public View getView() { + if (mView == null) + return null; + return mView.getView(); + } } diff --git a/shell/platform/android/io/flutter/plugin/platform/VirtualDisplayController.java b/shell/platform/android/io/flutter/plugin/platform/VirtualDisplayController.java index 5514d4334e091..3caa6f3df19a4 100644 --- a/shell/platform/android/io/flutter/plugin/platform/VirtualDisplayController.java +++ b/shell/platform/android/io/flutter/plugin/platform/VirtualDisplayController.java @@ -99,4 +99,10 @@ public void dispose() { mPresentation.detachView().dispose(); mVirtualDisplay.release(); } + + public View getView() { + if (mPresentation == null) + return null; + return mPresentation.getView(); + } } From 55b423f07ff747c2303c957fe151487b45585192 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 18 Jul 2018 15:32:38 -0700 Subject: [PATCH 0825/1190] Ensure assistiveTechnologyEnabled is initialized when the android view is set up (#5793) --- shell/platform/android/io/flutter/view/FlutterView.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/platform/android/io/flutter/view/FlutterView.java b/shell/platform/android/io/flutter/view/FlutterView.java index e403785a93899..d80165563594d 100644 --- a/shell/platform/android/io/flutter/view/FlutterView.java +++ b/shell/platform/android/io/flutter/view/FlutterView.java @@ -745,6 +745,9 @@ protected void onAttachedToWindow() { if (mAccessibilityEnabled || mTouchExplorationEnabled) { ensureAccessibilityEnabled(); } + if (mTouchExplorationEnabled) { + nativeSetAssistiveTechnologyEnabled(mNativeView.get(), true); + } resetWillNotDraw(); mAccessibilityManager.addAccessibilityStateChangeListener(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { From 69695493b87ef838d20cc202004d0e8e9bd798a9 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 18 Jul 2018 17:20:34 -0700 Subject: [PATCH 0826/1190] Switch to Fuchsia's ICU (#5774) --- DEPS | 4 ++-- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 58e88f892e99e..b3a6d66bdc211 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '7b5fd64b26afe194fa49463bad204b2cfba47fb6', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '2a03d22ee81cbccfc782f0b2b24684199f37f399', # Fuchsia compatibility # @@ -152,7 +152,7 @@ deps = { Var('chromium_git') + '/chromium/src/ios.git' + '@' + Var('ios_tools_revision'), 'src/third_party/icu': - Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '08cb956852a5ccdba7f9c941728bb833529ba3c6', + Var('fuchsia_git') + '/third_party/icu' + '@' + 'e6cfa9c5f36c9f31dfa8547323d77dc040d3f038', 'src/third_party/dart': Var('dart_git') + '/sdk.git' + '@' + Var('dart_revision'), diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 326b4adc5222d..9aa6f5fa52096 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 +Signature: 0d78cdd444f7e8760ac5f4366191af52 UNUSED LICENSES: From b523ee8478a604ea0bb773593a4df7cdb264d9f8 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Wed, 18 Jul 2018 18:24:59 -0700 Subject: [PATCH 0827/1190] Revert "Switch to Fuchsia's ICU (#5774)" (#5801) This reverts commit 69695493b87ef838d20cc202004d0e8e9bd798a9. --- DEPS | 4 ++-- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index b3a6d66bdc211..58e88f892e99e 100644 --- a/DEPS +++ b/DEPS @@ -114,7 +114,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '2a03d22ee81cbccfc782f0b2b24684199f37f399', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + '7b5fd64b26afe194fa49463bad204b2cfba47fb6', # Fuchsia compatibility # @@ -152,7 +152,7 @@ deps = { Var('chromium_git') + '/chromium/src/ios.git' + '@' + Var('ios_tools_revision'), 'src/third_party/icu': - Var('fuchsia_git') + '/third_party/icu' + '@' + 'e6cfa9c5f36c9f31dfa8547323d77dc040d3f038', + Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '08cb956852a5ccdba7f9c941728bb833529ba3c6', 'src/third_party/dart': Var('dart_git') + '/sdk.git' + '@' + Var('dart_revision'), diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 9aa6f5fa52096..326b4adc5222d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0d78cdd444f7e8760ac5f4366191af52 +Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 UNUSED LICENSES: From 09ff9493e08c0c937bcd2c6f780981e2a7c5f2b5 Mon Sep 17 00:00:00 2001 From: sjindel-google Date: Thu, 19 Jul 2018 15:21:21 +0200 Subject: [PATCH 0828/1190] Re-land removal of vmservice_io from release builds. (#5784) --- runtime/dart_vm_entry_points.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/dart_vm_entry_points.txt b/runtime/dart_vm_entry_points.txt index 9a1a6d5f4bfcf..c7b9734d2a7ba 100644 --- a/runtime/dart_vm_entry_points.txt +++ b/runtime/dart_vm_entry_points.txt @@ -44,4 +44,3 @@ dart:ui,SemanticsUpdate,SemanticsUpdate._ dart:ui,SemanticsUpdateBuilder,SemanticsUpdateBuilder. dart:ui,Shader,Shader._ dart:ui,TextBox,TextBox._ -dart:vmservice_io,::,main From 5d0e13a45b210b9b05427cccfc5f94928ae701ab Mon Sep 17 00:00:00 2001 From: Stanislav Baranov Date: Thu, 19 Jul 2018 08:55:04 -0700 Subject: [PATCH 0829/1190] Fix starting isolate directly from CoreJIT snapshot. (#5798) --- runtime/dart_isolate.cc | 9 ++------- shell/common/isolate_configuration.cc | 15 ++++++--------- shell/common/isolate_configuration.h | 2 +- .../platform/android/platform_view_android_jni.cc | 5 +++-- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index d1ecaf0191d9e..1b887a7748731 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -257,10 +257,6 @@ bool DartIsolate::PrepareForRunningFromPrecompiledCode() { return false; } - if (!DartVM::IsRunningPrecompiledCode()) { - return false; - } - tonic::DartState::Scope scope(this); if (Dart_IsNull(Dart_RootLibrary())) { @@ -342,9 +338,8 @@ bool DartIsolate::PrepareForRunningFromSnapshot( tonic::DartState::Scope scope(this); - if (!Dart_IsNull(Dart_RootLibrary())) { - return false; - } + // Use root library provided by kernel in favor of one provided by snapshot. + Dart_SetRootLibrary(Dart_Null()); if (!LoadSnapshot(mapping, last_piece)) { return false; diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc index 60610e47709c9..06e62fedfb534 100644 --- a/shell/common/isolate_configuration.cc +++ b/shell/common/isolate_configuration.cc @@ -31,20 +31,17 @@ bool IsolateConfiguration::PrepareIsolate( return DoPrepareIsolate(*isolate); } -class PrecompiledIsolateConfiguration final : public IsolateConfiguration { +class AppSnapshotIsolateConfiguration final : public IsolateConfiguration { public: - PrecompiledIsolateConfiguration() = default; + AppSnapshotIsolateConfiguration() = default; // |shell::IsolateConfiguration| bool DoPrepareIsolate(blink::DartIsolate& isolate) override { - if (!blink::DartVM::IsRunningPrecompiledCode()) { - return false; - } return isolate.PrepareForRunningFromPrecompiledCode(); } private: - FXL_DISALLOW_COPY_AND_ASSIGN(PrecompiledIsolateConfiguration); + FXL_DISALLOW_COPY_AND_ASSIGN(AppSnapshotIsolateConfiguration); }; class SnapshotIsolateConfiguration : public IsolateConfiguration { @@ -122,7 +119,7 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( fml::RefPtr asset_manager) { // Running in AOT mode. if (blink::DartVM::IsRunningPrecompiledCode()) { - return CreateForPrecompiledCode(); + return CreateForAppSnapshot(); } // Run from sources. @@ -193,8 +190,8 @@ std::unique_ptr IsolateConfiguration::InferFromSettings( } std::unique_ptr -IsolateConfiguration::CreateForPrecompiledCode() { - return std::make_unique(); +IsolateConfiguration::CreateForAppSnapshot() { + return std::make_unique(); } std::unique_ptr IsolateConfiguration::CreateForSnapshot( diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h index a0b9ebe2faec8..19e4834c3e2c7 100644 --- a/shell/common/isolate_configuration.h +++ b/shell/common/isolate_configuration.h @@ -24,7 +24,7 @@ class IsolateConfiguration { const blink::Settings& settings, fml::RefPtr asset_manager); - static std::unique_ptr CreateForPrecompiledCode(); + static std::unique_ptr CreateForAppSnapshot(); static std::unique_ptr CreateForSnapshot( std::unique_ptr snapshot); diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 418065f400db9..05cfa0d48c27d 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -178,7 +178,7 @@ static void SurfaceDestroyed(JNIEnv* env, jobject jcaller, jlong shell_holder) { std::unique_ptr CreateIsolateConfiguration( const blink::AssetManager& asset_manager) { if (blink::DartVM::IsRunningPrecompiledCode()) { - return IsolateConfiguration::CreateForPrecompiledCode(); + return IsolateConfiguration::CreateForAppSnapshot(); } const auto configuration_from_blob = @@ -200,7 +200,8 @@ std::unique_ptr CreateIsolateConfiguration( return script; } - return nullptr; + // This happens when starting isolate directly from CoreJIT snapshot. + return IsolateConfiguration::CreateForAppSnapshot(); } static void RunBundleAndSnapshot( From 0bf69f02dff0ef68b7a80123c14c7f9c42d8c510 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 19 Jul 2018 12:24:35 -0400 Subject: [PATCH 0830/1190] Roll src/third_party/skia 9e0d7e4072e4..297c3c8e85bd (62 commits) (#5802) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 22 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 58e88f892e99e..836cd2b196088 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9e0d7e4072e43495a3907bb2bac7824e8e60c368', + 'skia_revision': '297c3c8e85bdb7ed79aaa6a596f52874d79e7a25', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 326b4adc5222d..f21b22b811f91 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 +Signature: 269ed69e5b1c4ac7737ac3a120ae3248 UNUSED LICENSES: @@ -14326,6 +14326,7 @@ FILE: ../../../third_party/skia/gm/hardstop_gradients.cpp FILE: ../../../third_party/skia/gm/imagemakewithfilter.cpp FILE: ../../../third_party/skia/gm/imagemasksubset.cpp FILE: ../../../third_party/skia/gm/lattice.cpp +FILE: ../../../third_party/skia/gm/lightingshader2.cpp FILE: ../../../third_party/skia/gm/occludedrrectblur.cpp FILE: ../../../third_party/skia/gm/overdrawcolorfilter.cpp FILE: ../../../third_party/skia/gm/pathmaskcache.cpp @@ -14381,6 +14382,7 @@ FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_primitive.cpp FILE: ../../../third_party/skia/samplecode/DecodeFile.h FILE: ../../../third_party/skia/samplecode/SampleAndroidShadows.cpp FILE: ../../../third_party/skia/samplecode/SampleCode.cpp +FILE: ../../../third_party/skia/samplecode/SampleLitAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleMegaStroke.cpp FILE: ../../../third_party/skia/samplecode/SamplePathOverstroke.cpp FILE: ../../../third_party/skia/samplecode/SampleSVGFile.cpp @@ -14469,6 +14471,7 @@ FILE: ../../../third_party/skia/src/core/SkICCPriv.h FILE: ../../../third_party/skia/src/core/SkImageFilterCache.cpp FILE: ../../../third_party/skia/src/core/SkImageFilterCache.h FILE: ../../../third_party/skia/src/core/SkLRUCache.h +FILE: ../../../third_party/skia/src/core/SkLights.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.h FILE: ../../../third_party/skia/src/core/SkLiteRecorder.cpp @@ -14477,6 +14480,12 @@ FILE: ../../../third_party/skia/src/core/SkMSAN.h FILE: ../../../third_party/skia/src/core/SkMakeUnique.h FILE: ../../../third_party/skia/src/core/SkMatrixPriv.h FILE: ../../../third_party/skia/src/core/SkModeColorFilter.h +FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.h +FILE: ../../../third_party/skia/src/core/SkNormalMapSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalMapSource.h +FILE: ../../../third_party/skia/src/core/SkNormalSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalSource.h FILE: ../../../third_party/skia/src/core/SkOverdrawCanvas.cpp FILE: ../../../third_party/skia/src/core/SkPM4f.h FILE: ../../../third_party/skia/src/core/SkPM4fPriv.h @@ -16973,6 +16982,7 @@ FILE: ../../../third_party/skia/include/android/SkAnimatedImage.h FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/core/SkFontParameters.h +FILE: ../../../third_party/skia/include/effects/SkOpPathEffect.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h @@ -17064,6 +17074,8 @@ FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp FILE: ../../../third_party/skia/src/core/SkTextBlobPriv.h FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h +FILE: ../../../third_party/skia/src/effects/SkOpPE.h +FILE: ../../../third_party/skia/src/effects/SkOpPathEffect.cpp FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp FILE: ../../../third_party/skia/src/effects/SkTrimPE.h FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp @@ -17135,6 +17147,7 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlGpuCommandBuffer.h FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.h FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.mm FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.cpp @@ -17162,6 +17175,7 @@ FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp FILE: ../../../third_party/skia/src/utils/Sk3D.cpp FILE: ../../../third_party/skia/src/utils/SkJSON.cpp FILE: ../../../third_party/skia/src/utils/SkJSON.h +FILE: ../../../third_party/skia/src/utils/win/SkDWriteNTDDI_VERSION.h FILE: ../../../third_party/skia/third_party/skcms/skcms.cc FILE: ../../../third_party/skia/third_party/skcms/skcms.h FILE: ../../../third_party/skia/third_party/skcms/skcms_internal.h @@ -18583,6 +18597,7 @@ FILE: ../../../third_party/skia/gm/imagesource2.cpp FILE: ../../../third_party/skia/gm/largeglyphblur.cpp FILE: ../../../third_party/skia/gm/lcdblendmodes.cpp FILE: ../../../third_party/skia/gm/lcdoverlap.cpp +FILE: ../../../third_party/skia/gm/lightingshader.cpp FILE: ../../../third_party/skia/gm/localmatriximagefilter.cpp FILE: ../../../third_party/skia/gm/localmatriximageshader.cpp FILE: ../../../third_party/skia/gm/mipmap.cpp @@ -18611,6 +18626,7 @@ FILE: ../../../third_party/skia/include/codec/SkAndroidCodec.h FILE: ../../../third_party/skia/include/codec/SkCodec.h FILE: ../../../third_party/skia/include/core/SkEncodedImageFormat.h FILE: ../../../third_party/skia/include/core/SkFilterQuality.h +FILE: ../../../third_party/skia/include/core/SkLights.h FILE: ../../../third_party/skia/include/core/SkPixmap.h FILE: ../../../third_party/skia/include/core/SkPngChunkReader.h FILE: ../../../third_party/skia/include/core/SkPoint3.h @@ -18641,6 +18657,7 @@ FILE: ../../../third_party/skia/samplecode/SampleAnimatedText.cpp FILE: ../../../third_party/skia/samplecode/SampleAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleClipDrawMatch.cpp FILE: ../../../third_party/skia/samplecode/SampleFilterQuality.cpp +FILE: ../../../third_party/skia/samplecode/SampleLighting.cpp FILE: ../../../third_party/skia/samplecode/SamplePathFuzz.cpp FILE: ../../../third_party/skia/samplecode/SampleShip.cpp FILE: ../../../third_party/skia/samplecode/SampleXfer.cpp @@ -18909,6 +18926,8 @@ FILE: ../../../third_party/skia/src/ports/SkOSLibrary_posix.cpp FILE: ../../../third_party/skia/src/ports/SkOSLibrary_win.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.h +FILE: ../../../third_party/skia/src/shaders/SkLightingShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkLightingShader.h FILE: ../../../third_party/skia/src/svg/SkSVGCanvas.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.h @@ -19883,6 +19902,7 @@ FILE: ../../../third_party/skia/include/effects/SkGradientShader.h FILE: ../../../third_party/skia/include/effects/SkTableMaskFilter.h FILE: ../../../third_party/skia/include/private/SkFixed.h FILE: ../../../third_party/skia/include/private/SkFloatingPoint.h +FILE: ../../../third_party/skia/include/private/SkNoncopyable.h FILE: ../../../third_party/skia/include/private/SkTDArray.h FILE: ../../../third_party/skia/include/private/SkTSearch.h FILE: ../../../third_party/skia/include/private/SkTemplates.h From bb323c145cf9e443636af777888ea8f3d7c1c9eb Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Thu, 19 Jul 2018 12:48:24 -0400 Subject: [PATCH 0831/1190] Revert "Roll src/third_party/skia 9e0d7e4072e4..297c3c8e85bd (62 commits) (#5802)" (#5803) This reverts commit 0bf69f02dff0ef68b7a80123c14c7f9c42d8c510. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 22 +-------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/DEPS b/DEPS index 836cd2b196088..58e88f892e99e 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '297c3c8e85bdb7ed79aaa6a596f52874d79e7a25', + 'skia_revision': '9e0d7e4072e43495a3907bb2bac7824e8e60c368', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f21b22b811f91..326b4adc5222d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 269ed69e5b1c4ac7737ac3a120ae3248 +Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 UNUSED LICENSES: @@ -14326,7 +14326,6 @@ FILE: ../../../third_party/skia/gm/hardstop_gradients.cpp FILE: ../../../third_party/skia/gm/imagemakewithfilter.cpp FILE: ../../../third_party/skia/gm/imagemasksubset.cpp FILE: ../../../third_party/skia/gm/lattice.cpp -FILE: ../../../third_party/skia/gm/lightingshader2.cpp FILE: ../../../third_party/skia/gm/occludedrrectblur.cpp FILE: ../../../third_party/skia/gm/overdrawcolorfilter.cpp FILE: ../../../third_party/skia/gm/pathmaskcache.cpp @@ -14382,7 +14381,6 @@ FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_primitive.cpp FILE: ../../../third_party/skia/samplecode/DecodeFile.h FILE: ../../../third_party/skia/samplecode/SampleAndroidShadows.cpp FILE: ../../../third_party/skia/samplecode/SampleCode.cpp -FILE: ../../../third_party/skia/samplecode/SampleLitAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleMegaStroke.cpp FILE: ../../../third_party/skia/samplecode/SamplePathOverstroke.cpp FILE: ../../../third_party/skia/samplecode/SampleSVGFile.cpp @@ -14471,7 +14469,6 @@ FILE: ../../../third_party/skia/src/core/SkICCPriv.h FILE: ../../../third_party/skia/src/core/SkImageFilterCache.cpp FILE: ../../../third_party/skia/src/core/SkImageFilterCache.h FILE: ../../../third_party/skia/src/core/SkLRUCache.h -FILE: ../../../third_party/skia/src/core/SkLights.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.h FILE: ../../../third_party/skia/src/core/SkLiteRecorder.cpp @@ -14480,12 +14477,6 @@ FILE: ../../../third_party/skia/src/core/SkMSAN.h FILE: ../../../third_party/skia/src/core/SkMakeUnique.h FILE: ../../../third_party/skia/src/core/SkMatrixPriv.h FILE: ../../../third_party/skia/src/core/SkModeColorFilter.h -FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.cpp -FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.h -FILE: ../../../third_party/skia/src/core/SkNormalMapSource.cpp -FILE: ../../../third_party/skia/src/core/SkNormalMapSource.h -FILE: ../../../third_party/skia/src/core/SkNormalSource.cpp -FILE: ../../../third_party/skia/src/core/SkNormalSource.h FILE: ../../../third_party/skia/src/core/SkOverdrawCanvas.cpp FILE: ../../../third_party/skia/src/core/SkPM4f.h FILE: ../../../third_party/skia/src/core/SkPM4fPriv.h @@ -16982,7 +16973,6 @@ FILE: ../../../third_party/skia/include/android/SkAnimatedImage.h FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/core/SkFontParameters.h -FILE: ../../../third_party/skia/include/effects/SkOpPathEffect.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h @@ -17074,8 +17064,6 @@ FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp FILE: ../../../third_party/skia/src/core/SkTextBlobPriv.h FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h -FILE: ../../../third_party/skia/src/effects/SkOpPE.h -FILE: ../../../third_party/skia/src/effects/SkOpPathEffect.cpp FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp FILE: ../../../third_party/skia/src/effects/SkTrimPE.h FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp @@ -17147,7 +17135,6 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlGpuCommandBuffer.h FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.h FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.mm FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.cpp @@ -17175,7 +17162,6 @@ FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp FILE: ../../../third_party/skia/src/utils/Sk3D.cpp FILE: ../../../third_party/skia/src/utils/SkJSON.cpp FILE: ../../../third_party/skia/src/utils/SkJSON.h -FILE: ../../../third_party/skia/src/utils/win/SkDWriteNTDDI_VERSION.h FILE: ../../../third_party/skia/third_party/skcms/skcms.cc FILE: ../../../third_party/skia/third_party/skcms/skcms.h FILE: ../../../third_party/skia/third_party/skcms/skcms_internal.h @@ -18597,7 +18583,6 @@ FILE: ../../../third_party/skia/gm/imagesource2.cpp FILE: ../../../third_party/skia/gm/largeglyphblur.cpp FILE: ../../../third_party/skia/gm/lcdblendmodes.cpp FILE: ../../../third_party/skia/gm/lcdoverlap.cpp -FILE: ../../../third_party/skia/gm/lightingshader.cpp FILE: ../../../third_party/skia/gm/localmatriximagefilter.cpp FILE: ../../../third_party/skia/gm/localmatriximageshader.cpp FILE: ../../../third_party/skia/gm/mipmap.cpp @@ -18626,7 +18611,6 @@ FILE: ../../../third_party/skia/include/codec/SkAndroidCodec.h FILE: ../../../third_party/skia/include/codec/SkCodec.h FILE: ../../../third_party/skia/include/core/SkEncodedImageFormat.h FILE: ../../../third_party/skia/include/core/SkFilterQuality.h -FILE: ../../../third_party/skia/include/core/SkLights.h FILE: ../../../third_party/skia/include/core/SkPixmap.h FILE: ../../../third_party/skia/include/core/SkPngChunkReader.h FILE: ../../../third_party/skia/include/core/SkPoint3.h @@ -18657,7 +18641,6 @@ FILE: ../../../third_party/skia/samplecode/SampleAnimatedText.cpp FILE: ../../../third_party/skia/samplecode/SampleAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleClipDrawMatch.cpp FILE: ../../../third_party/skia/samplecode/SampleFilterQuality.cpp -FILE: ../../../third_party/skia/samplecode/SampleLighting.cpp FILE: ../../../third_party/skia/samplecode/SamplePathFuzz.cpp FILE: ../../../third_party/skia/samplecode/SampleShip.cpp FILE: ../../../third_party/skia/samplecode/SampleXfer.cpp @@ -18926,8 +18909,6 @@ FILE: ../../../third_party/skia/src/ports/SkOSLibrary_posix.cpp FILE: ../../../third_party/skia/src/ports/SkOSLibrary_win.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.h -FILE: ../../../third_party/skia/src/shaders/SkLightingShader.cpp -FILE: ../../../third_party/skia/src/shaders/SkLightingShader.h FILE: ../../../third_party/skia/src/svg/SkSVGCanvas.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.h @@ -19902,7 +19883,6 @@ FILE: ../../../third_party/skia/include/effects/SkGradientShader.h FILE: ../../../third_party/skia/include/effects/SkTableMaskFilter.h FILE: ../../../third_party/skia/include/private/SkFixed.h FILE: ../../../third_party/skia/include/private/SkFloatingPoint.h -FILE: ../../../third_party/skia/include/private/SkNoncopyable.h FILE: ../../../third_party/skia/include/private/SkTDArray.h FILE: ../../../third_party/skia/include/private/SkTSearch.h FILE: ../../../third_party/skia/include/private/SkTemplates.h From 482469bad8094ff05fd66dfc07149fbef4ae00ac Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Thu, 19 Jul 2018 10:28:57 -0700 Subject: [PATCH 0832/1190] Roll Dart to 937ee2e8ca4b76499e24cd463f07bfb736bccd74. (#5800) Fix rename of dart_resource_rev mistaken as a removal. --- DEPS | 24 ++++++++++----------- travis/licenses_golden/licenses_third_party | 13 +++++------ 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/DEPS b/DEPS index 58e88f892e99e..276304ff6ac9a 100644 --- a/DEPS +++ b/DEPS @@ -31,11 +31,11 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '84ca27a09ebd6a65cd23ee52d835d89cbe06c574', + 'dart_revision': '937ee2e8ca4b76499e24cd463f07bfb736bccd74', 'dart_args_tag': '1.4.1', 'dart_async_tag': '2.0.7', - 'dart_bazel_worker_tag': 'v0.1.9', + 'dart_bazel_worker_tag': '0.1.11', 'dart_boolean_selector_tag': '1.0.3', 'dart_boringssl_gen_rev': 'fc47eaa1a245d858bae462cd64d4155605b850ea', 'dart_boringssl_rev': '189270cd190267f5bd60cfe8f8ce7a61d07ba6f4', @@ -46,7 +46,7 @@ vars = { 'dart_crypto_tag': '2.0.5', 'dart_csslib_tag': '0.14.1', 'dart_dart2js_info_tag': '0.5.6+4', - 'dart_dart_style_tag': '1.1.1', + 'dart_dart_style_tag': '1.1.2', 'dart_dartdoc_tag': 'v0.20.1', 'dart_fixnum_tag': '0.10.5', 'dart_glob_tag': '1.1.5', @@ -56,34 +56,34 @@ vars = { 'dart_http_retry_tag': '0.1.1', 'dart_http_tag': '0.11.3+17', 'dart_http_throttle_tag': '1.0.2', - 'dart_intl_tag': '0.15.2', + 'dart_intl_tag': '0.15.6', 'dart_json_rpc_2_tag': '2.0.6', 'dart_linter_tag': '0.1.56', 'dart_logging_tag': '0.11.3+1', - 'dart_markdown_tag': '2.0.0', + 'dart_markdown_tag': '2.0.1', 'dart_matcher_tag': '0.12.3', 'dart_mime_tag': '0.9.6', 'dart_mockito_tag': 'd39ac507483b9891165e422ec98d9fb480037c8b', 'dart_mustache4dart_tag': 'v2.1.2', - 'dart_oauth2_tag': '1.1.0', + 'dart_oauth2_tag': '1.2.1', 'dart_observatory_pub_packages_rev': 'caf0aecfb15077fc7a34d48e9df13606c793fddf', 'dart_package_config_tag': '1.0.3', 'dart_package_resolver_tag': '1.0.2+1', 'dart_path_tag': '1.5.1', 'dart_plugin_tag': '0.2.0+2', 'dart_pool_tag': '1.3.4', - 'dart_protobuf_tag': '0.7.1', + 'dart_protobuf_tag': '0.9.0', 'dart_pub_rev': '58fe996eab8d54f28f5109c407ff0ab62fbd835d', 'dart_pub_semver_tag': '1.4.1', 'dart_quiver_tag': '0.29.0', - 'dart_resource_rev': 'af5a5bf65511943398146cf146e466e5f0b95cb9', + 'dart_resource_tag': '2.1.4', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', 'dart_shelf_packages_handler_tag': '1.0.3', 'dart_shelf_static_rev': 'v0.2.7', - 'dart_shelf_tag': '0.7.2', + 'dart_shelf_tag': '0.7.3+2', 'dart_shelf_web_socket_tag': '0.2.2', 'dart_source_map_stack_trace_tag': '1.1.4', - 'dart_source_maps_tag': '0.10.4', + 'dart_source_maps_tag': '0.10.6', 'dart_source_span_tag': '1.4.0', 'dart_stack_trace_tag': '1.9.2', 'dart_stream_channel_tag': '1.6.4', @@ -96,7 +96,7 @@ vars = { 'dart_utf_tag': '0.9.0+4', 'dart_watcher_tag': '0.9.7+8', 'dart_web_socket_channel_tag': '1.0.7', - 'dart_yaml_tag': '2.1.13', + 'dart_yaml_tag': '2.1.14', # Build bot tooling for iOS 'ios_tools_revision': '69b7c1b160e7107a6a98d948363772dc9caea46f', @@ -284,7 +284,7 @@ deps = { Var('chromium_git') + '/external/github.com/google/quiver-dart' + '@' + Var('dart_quiver_tag'), 'src/third_party/dart/third_party/pkg/resource': - Var('dart_git') + '/resource.git' + '@' + Var('dart_resource_rev'), + Var('dart_git') + '/resource.git' + '@' + Var('dart_resource_tag'), 'src/third_party/dart/third_party/pkg/shelf': Var('dart_git') + '/shelf.git' + '@' + Var('dart_shelf_tag'), diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 326b4adc5222d..6c7c16e4f2731 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 9d07cf4ed9f6c4ece22105db33c2e6f4 +Signature: 8ab62fe95c1ef8d1c186d49def733f8e UNUSED LICENSES: @@ -4480,7 +4480,6 @@ FILE: ../../../third_party/dart/client/idea/.idea/.name FILE: ../../../third_party/dart/client/idea/.idea/inspectionProfiles/Project_Default.xml FILE: ../../../third_party/dart/client/idea/.idea/vcs.xml FILE: ../../../third_party/dart/runtime/CPPLINT.cfg -FILE: ../../../third_party/dart/runtime/observatory/.analysis_options FILE: ../../../third_party/dart/runtime/observatory/lib/elements.dart FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/chromium_icon.png FILE: ../../../third_party/dart/runtime/observatory/lib/src/elements/img/dart_icon.png @@ -4490,8 +4489,6 @@ FILE: ../../../third_party/dart/runtime/observatory/web/index.html FILE: ../../../third_party/dart/runtime/observatory/web/third_party/trace_viewer_full.html FILE: ../../../third_party/dart/runtime/observatory/web/timeline.html FILE: ../../../third_party/dart/runtime/vm/snapshot_test_in.dat -FILE: ../../../third_party/dart/samples/build_dart/test.foo -FILE: ../../../third_party/dart/samples/build_dart_simple/test.foo FILE: ../../../third_party/dart/sdk/lib/html/html_common/conversions_dart2js.dart FILE: ../../../third_party/dart/sdk/lib/html/html_common/html_common.dart FILE: ../../../third_party/dart/sdk/lib/libraries.json @@ -4884,10 +4881,6 @@ FILE: ../../../third_party/dart/runtime/vm/virtual_memory_win.cc FILE: ../../../third_party/dart/runtime/vm/zone.cc FILE: ../../../third_party/dart/runtime/vm/zone.h FILE: ../../../third_party/dart/runtime/vm/zone_test.cc -FILE: ../../../third_party/dart/samples/build_dart/bin/test.dart -FILE: ../../../third_party/dart/samples/build_dart/build.dart -FILE: ../../../third_party/dart/samples/build_dart_simple/build.dart -FILE: ../../../third_party/dart/samples/build_dart_simple/test.dart FILE: ../../../third_party/dart/samples/sample_extension/sample_asynchronous_extension.dart FILE: ../../../third_party/dart/samples/sample_extension/sample_extension.cc FILE: ../../../third_party/dart/samples/sample_extension/sample_extension_dllmain_win.cc @@ -5642,6 +5635,10 @@ FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.cc FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.h FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.cc From d1c71e5206bd9546f4ff64b7336c4e74e3f4ccfd Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 19 Jul 2018 18:07:18 -0700 Subject: [PATCH 0833/1190] add text capitalization support to ios and android (#5752) --- .../plugin/editing/TextInputPlugin.java | 76 +++++++++---------- .../Source/FlutterTextInputPlugin.mm | 26 ++++--- 2 files changed, 50 insertions(+), 52 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java b/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java index 0eded84a726a7..220776b35140a 100644 --- a/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java +++ b/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java @@ -26,7 +26,6 @@ * Android implementation of the text input plugin. */ public class TextInputPlugin implements MethodCallHandler { - private final FlutterView mView; private final InputMethodManager mImm; private final MethodChannel mFlutterChannel; @@ -37,9 +36,9 @@ public class TextInputPlugin implements MethodCallHandler { public TextInputPlugin(FlutterView view) { mView = view; - mImm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); - mFlutterChannel = new MethodChannel(view, "flutter/textinput", - JSONMethodCodec.INSTANCE); + mImm = (InputMethodManager) view.getContext().getSystemService( + Context.INPUT_METHOD_SERVICE); + mFlutterChannel = new MethodChannel(view, "flutter/textinput", JSONMethodCodec.INSTANCE); mFlutterChannel.setMethodCallHandler(this); } @@ -72,22 +71,17 @@ public void onMethodCall(MethodCall call, Result result) { } } - private static int inputTypeFromTextInputType( - JSONObject type, boolean obscureText, boolean autocorrect) throws JSONException { - + private static int inputTypeFromTextInputType(JSONObject type, boolean obscureText, + boolean autocorrect, String textCapitalization) throws JSONException { String inputType = type.getString("name"); - if (inputType.equals("TextInputType.datetime")) - return InputType.TYPE_CLASS_DATETIME; + if (inputType.equals("TextInputType.datetime")) return InputType.TYPE_CLASS_DATETIME; if (inputType.equals("TextInputType.number")) { int textType = InputType.TYPE_CLASS_NUMBER; - if (type.optBoolean("signed")) - textType |= InputType.TYPE_NUMBER_FLAG_SIGNED; - if (type.optBoolean("decimal")) - textType |= InputType.TYPE_NUMBER_FLAG_DECIMAL; + if (type.optBoolean("signed")) textType |= InputType.TYPE_NUMBER_FLAG_SIGNED; + if (type.optBoolean("decimal")) textType |= InputType.TYPE_NUMBER_FLAG_DECIMAL; return textType; } - if (inputType.equals("TextInputType.phone")) - return InputType.TYPE_CLASS_PHONE; + if (inputType.equals("TextInputType.phone")) return InputType.TYPE_CLASS_PHONE; int textType = InputType.TYPE_CLASS_TEXT; if (inputType.equals("TextInputType.multiline")) @@ -101,9 +95,13 @@ else if (inputType.equals("TextInputType.url")) textType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS; textType |= InputType.TYPE_TEXT_VARIATION_PASSWORD; } else { - if (autocorrect) - textType |= InputType.TYPE_TEXT_FLAG_AUTO_CORRECT; - if (inputType.equals("TextInputType.text") || inputType.equals("TextInputType.multiline")) + if (autocorrect) textType |= InputType.TYPE_TEXT_FLAG_AUTO_CORRECT; + } + if (textCapitalization.equals("TextCapitalization.characters")) { + textType |= InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS; + } else if (textCapitalization.equals("TextCapitalization.words")) { + textType |= InputType.TYPE_TEXT_FLAG_CAP_WORDS; + } else if (textCapitalization.equals("TextCapitalization.sentences")) { textType |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES; } return textType; @@ -136,22 +134,21 @@ private static int inputActionFromTextInputAction(String inputAction) { } public InputConnection createInputConnection(FlutterView view, EditorInfo outAttrs) - throws JSONException { - if (mClient == 0) - return null; - - outAttrs.inputType = inputTypeFromTextInputType( - mConfiguration.getJSONObject("inputType"), - mConfiguration.optBoolean("obscureText"), - mConfiguration.optBoolean("autocorrect", true)); + throws JSONException { + if (mClient == 0) return null; + + outAttrs.inputType = inputTypeFromTextInputType(mConfiguration.getJSONObject("inputType"), + mConfiguration.optBoolean("obscureText"), + mConfiguration.optBoolean("autocorrect", true), + mConfiguration.getString("textCapitalization")); outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_FULLSCREEN; int enterAction; if (mConfiguration.isNull("inputAction")) { // If an explicit input action isn't set, then default to none for multi-line fields // and done for single line fields. enterAction = (InputType.TYPE_TEXT_FLAG_MULTI_LINE & outAttrs.inputType) != 0 - ? EditorInfo.IME_ACTION_NONE - : EditorInfo.IME_ACTION_DONE; + ? EditorInfo.IME_ACTION_NONE + : EditorInfo.IME_ACTION_DONE; } else { enterAction = inputActionFromTextInputAction(mConfiguration.getString("inputAction")); } @@ -161,7 +158,8 @@ public InputConnection createInputConnection(FlutterView view, EditorInfo outAtt } outAttrs.imeOptions |= enterAction; - InputConnectionAdaptor connection = new InputConnectionAdaptor(view, mClient, mFlutterChannel, mEditable); + InputConnectionAdaptor connection = + new InputConnectionAdaptor(view, mClient, mFlutterChannel, mEditable); outAttrs.initialSelStart = Selection.getSelectionStart(mEditable); outAttrs.initialSelEnd = Selection.getSelectionEnd(mEditable); @@ -189,25 +187,21 @@ private void setTextInputClient(FlutterView view, int client, JSONObject configu private void applyStateToSelection(JSONObject state) throws JSONException { int selStart = state.getInt("selectionBase"); int selEnd = state.getInt("selectionExtent"); - if (selStart >= 0 && selStart <= mEditable.length() && - selEnd >= 0 && selEnd <= mEditable.length()) { + if (selStart >= 0 && selStart <= mEditable.length() && selEnd >= 0 + && selEnd <= mEditable.length()) { Selection.setSelection(mEditable, selStart, selEnd); } else { Selection.removeSelection(mEditable); } } - private void setTextInputEditingState(FlutterView view, JSONObject state) - throws JSONException { - if (!mRestartInputPending && - state.getString("text").equals(mEditable.toString())) { + private void setTextInputEditingState(FlutterView view, JSONObject state) throws JSONException { + if (!mRestartInputPending && state.getString("text").equals(mEditable.toString())) { applyStateToSelection(state); - mImm.updateSelection( - mView, - Math.max(Selection.getSelectionStart(mEditable), 0), - Math.max(Selection.getSelectionEnd(mEditable), 0), - BaseInputConnection.getComposingSpanStart(mEditable), - BaseInputConnection.getComposingSpanEnd(mEditable)); + mImm.updateSelection(mView, Math.max(Selection.getSelectionStart(mEditable), 0), + Math.max(Selection.getSelectionEnd(mEditable), 0), + BaseInputConnection.getComposingSpanStart(mEditable), + BaseInputConnection.getComposingSpanEnd(mEditable)); } else { mEditable.replace(0, mEditable.length(), state.getString("text")); applyStateToSelection(state); diff --git a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 1fa0f618c293a..dd4492d7e0069 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -4,8 +4,8 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h" -#include #include +#include static const char _kTextAffinityDownstream[] = "TextAffinity.downstream"; static const char _kTextAffinityUpstream[] = "TextAffinity.upstream"; @@ -30,6 +30,18 @@ static UIKeyboardType ToUIKeyboardType(NSDictionary* type) { return UIKeyboardTypeDefault; } +static UITextAutocapitalizationType ToUITextAutoCapitalizationType(NSDictionary* type) { + NSString* textCapitalization = type[@"textCapitalization"]; + if ([textCapitalization isEqualToString:@"TextCapitalization.characters"]) { + return UITextAutocapitalizationTypeAllCharacters; + } else if ([textCapitalization isEqualToString:@"TextCapitalization.sentences"]) { + return UITextAutocapitalizationTypeSentences; + } else if ([textCapitalization isEqualToString:@"TextCapitalization.words"]) { + return UITextAutocapitalizationTypeWords; + } + return UITextAutocapitalizationTypeNone; +} + static UIReturnKeyType ToUIReturnKeyType(NSString* inputType) { // Where did the term "unspecified" come from? iOS has a "default" and Android // has "unspecified." These 2 terms seem to mean the same thing but we need @@ -73,14 +85,6 @@ static UIReturnKeyType ToUIReturnKeyType(NSString* inputType) { return UIReturnKeyDefault; } -static UITextAutocapitalizationType ToUITextAutocapitalizationType(NSString* inputType) { - if ([inputType isEqualToString:@"TextInputType.text"]) - return UITextAutocapitalizationTypeSentences; - if ([inputType isEqualToString:@"TextInputType.multiline"]) - return UITextAutocapitalizationTypeSentences; - return UITextAutocapitalizationTypeNone; -} - #pragma mark - FlutterTextPosition @implementation FlutterTextPosition @@ -690,10 +694,10 @@ - (void)setTextInputClient:(int)client withConfiguration:(NSDictionary*)configur NSString* keyboardAppearance = configuration[@"keyboardAppearance"]; _view.keyboardType = ToUIKeyboardType(inputType); _view.returnKeyType = ToUIReturnKeyType(configuration[@"inputAction"]); - _view.autocapitalizationType = ToUITextAutocapitalizationType(inputType[@"name"]); + _view.autocapitalizationType = ToUITextAutoCapitalizationType(configuration); if ([keyboardAppearance isEqualToString:@"Brightness.dark"]) { _view.keyboardAppearance = UIKeyboardAppearanceDark; - } else if ([keyboardAppearance isEqualToString:@"Brightness.light"]) { + } else if ([keyboardAppearance isEqualToString:@"Brightness.light"]) { _view.keyboardAppearance = UIKeyboardAppearanceLight; } else { _view.keyboardAppearance = UIKeyboardAppearanceDefault; From 4e55ff9a4978ab5de56d9776859089cad5b1326c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 20 Jul 2018 09:50:40 -0400 Subject: [PATCH 0834/1190] Roll src/third_party/skia 9e0d7e4072e4..9c4dfadabd1e (82 commits) (#5807) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 27 +++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index 276304ff6ac9a..a7b15f340e5ca 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9e0d7e4072e43495a3907bb2bac7824e8e60c368', + 'skia_revision': '9c4dfadabd1edabbd49e760edf4f067a2b03dd6f', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 6c7c16e4f2731..a1bf9479d47bd 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8ab62fe95c1ef8d1c186d49def733f8e +Signature: dea0b609afbc198fc181a95601bbb22f UNUSED LICENSES: @@ -14323,6 +14323,7 @@ FILE: ../../../third_party/skia/gm/hardstop_gradients.cpp FILE: ../../../third_party/skia/gm/imagemakewithfilter.cpp FILE: ../../../third_party/skia/gm/imagemasksubset.cpp FILE: ../../../third_party/skia/gm/lattice.cpp +FILE: ../../../third_party/skia/gm/lightingshader2.cpp FILE: ../../../third_party/skia/gm/occludedrrectblur.cpp FILE: ../../../third_party/skia/gm/overdrawcolorfilter.cpp FILE: ../../../third_party/skia/gm/pathmaskcache.cpp @@ -14378,6 +14379,7 @@ FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_primitive.cpp FILE: ../../../third_party/skia/samplecode/DecodeFile.h FILE: ../../../third_party/skia/samplecode/SampleAndroidShadows.cpp FILE: ../../../third_party/skia/samplecode/SampleCode.cpp +FILE: ../../../third_party/skia/samplecode/SampleLitAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleMegaStroke.cpp FILE: ../../../third_party/skia/samplecode/SamplePathOverstroke.cpp FILE: ../../../third_party/skia/samplecode/SampleSVGFile.cpp @@ -14466,6 +14468,7 @@ FILE: ../../../third_party/skia/src/core/SkICCPriv.h FILE: ../../../third_party/skia/src/core/SkImageFilterCache.cpp FILE: ../../../third_party/skia/src/core/SkImageFilterCache.h FILE: ../../../third_party/skia/src/core/SkLRUCache.h +FILE: ../../../third_party/skia/src/core/SkLights.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.cpp FILE: ../../../third_party/skia/src/core/SkLiteDL.h FILE: ../../../third_party/skia/src/core/SkLiteRecorder.cpp @@ -14474,6 +14477,12 @@ FILE: ../../../third_party/skia/src/core/SkMSAN.h FILE: ../../../third_party/skia/src/core/SkMakeUnique.h FILE: ../../../third_party/skia/src/core/SkMatrixPriv.h FILE: ../../../third_party/skia/src/core/SkModeColorFilter.h +FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.h +FILE: ../../../third_party/skia/src/core/SkNormalMapSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalMapSource.h +FILE: ../../../third_party/skia/src/core/SkNormalSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalSource.h FILE: ../../../third_party/skia/src/core/SkOverdrawCanvas.cpp FILE: ../../../third_party/skia/src/core/SkPM4f.h FILE: ../../../third_party/skia/src/core/SkPM4fPriv.h @@ -16970,6 +16979,7 @@ FILE: ../../../third_party/skia/include/android/SkAnimatedImage.h FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h FILE: ../../../third_party/skia/include/core/SkCoverageMode.h FILE: ../../../third_party/skia/include/core/SkFontParameters.h +FILE: ../../../third_party/skia/include/effects/SkOpPathEffect.h FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h @@ -17061,6 +17071,8 @@ FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp FILE: ../../../third_party/skia/src/core/SkTextBlobPriv.h FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h +FILE: ../../../third_party/skia/src/effects/SkOpPE.h +FILE: ../../../third_party/skia/src/effects/SkOpPathEffect.cpp FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp FILE: ../../../third_party/skia/src/effects/SkTrimPE.h FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp @@ -17132,6 +17144,7 @@ FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlGpuCommandBuffer.h FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.h FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.mm FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.cpp @@ -17159,6 +17172,7 @@ FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp FILE: ../../../third_party/skia/src/utils/Sk3D.cpp FILE: ../../../third_party/skia/src/utils/SkJSON.cpp FILE: ../../../third_party/skia/src/utils/SkJSON.h +FILE: ../../../third_party/skia/src/utils/win/SkDWriteNTDDI_VERSION.h FILE: ../../../third_party/skia/third_party/skcms/skcms.cc FILE: ../../../third_party/skia/third_party/skcms/skcms.h FILE: ../../../third_party/skia/third_party/skcms/skcms_internal.h @@ -17306,6 +17320,7 @@ FILE: ../../../third_party/skia/infra/bots/assets/go/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_debug/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_release/VERSION FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_sdk/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/lottie-samples/VERSION FILE: ../../../third_party/skia/infra/bots/assets/mips64el_toolchain_linux/VERSION FILE: ../../../third_party/skia/infra/bots/assets/moltenvk/VERSION FILE: ../../../third_party/skia/infra/bots/assets/node/VERSION @@ -17394,6 +17409,7 @@ FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.e FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_ASAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-Coverage.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader.json FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-OpenCL.json @@ -17529,6 +17545,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Release-All-SwiftShader.json @@ -17541,6 +17558,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang- FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Debug-All-CommandBuffer.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL1.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL3.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Lottie.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Vulkan_Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_PreAbandonGpuContext_SK_CPU_LIMIT_SSE41.json @@ -17561,7 +17579,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_dm.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_get_hashes.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_pull.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_push.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/internal_bot_1.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/internal_bot_2.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/trybot.json FILE: ../../../third_party/skia/infra/bots/recipes/upload_calmbench_results.expected/normal_bot.json @@ -18580,6 +18597,7 @@ FILE: ../../../third_party/skia/gm/imagesource2.cpp FILE: ../../../third_party/skia/gm/largeglyphblur.cpp FILE: ../../../third_party/skia/gm/lcdblendmodes.cpp FILE: ../../../third_party/skia/gm/lcdoverlap.cpp +FILE: ../../../third_party/skia/gm/lightingshader.cpp FILE: ../../../third_party/skia/gm/localmatriximagefilter.cpp FILE: ../../../third_party/skia/gm/localmatriximageshader.cpp FILE: ../../../third_party/skia/gm/mipmap.cpp @@ -18608,6 +18626,7 @@ FILE: ../../../third_party/skia/include/codec/SkAndroidCodec.h FILE: ../../../third_party/skia/include/codec/SkCodec.h FILE: ../../../third_party/skia/include/core/SkEncodedImageFormat.h FILE: ../../../third_party/skia/include/core/SkFilterQuality.h +FILE: ../../../third_party/skia/include/core/SkLights.h FILE: ../../../third_party/skia/include/core/SkPixmap.h FILE: ../../../third_party/skia/include/core/SkPngChunkReader.h FILE: ../../../third_party/skia/include/core/SkPoint3.h @@ -18638,6 +18657,7 @@ FILE: ../../../third_party/skia/samplecode/SampleAnimatedText.cpp FILE: ../../../third_party/skia/samplecode/SampleAtlas.cpp FILE: ../../../third_party/skia/samplecode/SampleClipDrawMatch.cpp FILE: ../../../third_party/skia/samplecode/SampleFilterQuality.cpp +FILE: ../../../third_party/skia/samplecode/SampleLighting.cpp FILE: ../../../third_party/skia/samplecode/SamplePathFuzz.cpp FILE: ../../../third_party/skia/samplecode/SampleShip.cpp FILE: ../../../third_party/skia/samplecode/SampleXfer.cpp @@ -18906,6 +18926,8 @@ FILE: ../../../third_party/skia/src/ports/SkOSLibrary_posix.cpp FILE: ../../../third_party/skia/src/ports/SkOSLibrary_win.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.cpp FILE: ../../../third_party/skia/src/shaders/SkImageShader.h +FILE: ../../../third_party/skia/src/shaders/SkLightingShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkLightingShader.h FILE: ../../../third_party/skia/src/svg/SkSVGCanvas.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.cpp FILE: ../../../third_party/skia/src/svg/SkSVGDevice.h @@ -19880,6 +19902,7 @@ FILE: ../../../third_party/skia/include/effects/SkGradientShader.h FILE: ../../../third_party/skia/include/effects/SkTableMaskFilter.h FILE: ../../../third_party/skia/include/private/SkFixed.h FILE: ../../../third_party/skia/include/private/SkFloatingPoint.h +FILE: ../../../third_party/skia/include/private/SkNoncopyable.h FILE: ../../../third_party/skia/include/private/SkTDArray.h FILE: ../../../third_party/skia/include/private/SkTSearch.h FILE: ../../../third_party/skia/include/private/SkTemplates.h From 663b4925b8379d6c1262381dd0bf6bc6e20301a9 Mon Sep 17 00:00:00 2001 From: Joshua Seaton Date: Fri, 20 Jul 2018 10:12:38 -0700 Subject: [PATCH 0835/1190] [fml][fxl] Migrate AutoResetWaitableEvent to fml version. (#5808) Thanks Jason for the speedy review --- flow/texture.h | 3 ++- fml/message_loop_unittests.cc | 12 ++++++------ fml/thread.cc | 4 ++-- runtime/service_protocol.cc | 6 +++--- shell/common/platform_view.cc | 2 +- shell/common/rasterizer.h | 2 +- shell/common/shell.cc | 16 ++++++++-------- shell/common/shell.h | 2 +- shell/common/shell_unittests.cc | 2 +- shell/platform/android/platform_view_android.cc | 4 ++-- .../platform/darwin/desktop/platform_view_mac.mm | 2 +- .../darwin/ios/framework/Source/FlutterView.mm | 2 +- shell/platform/darwin/ios/platform_view_ios.mm | 2 +- shell/testing/tester_main.cc | 6 +++--- 14 files changed, 33 insertions(+), 32 deletions(-) diff --git a/flow/texture.h b/flow/texture.h index f5e4430834084..0e8b3eaeb2cb2 100644 --- a/flow/texture.h +++ b/flow/texture.h @@ -7,7 +7,8 @@ #include -#include "lib/fxl/synchronization/waitable_event.h" +#include "flutter/fml/synchronization/waitable_event.h" +#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { diff --git a/fml/message_loop_unittests.cc b/fml/message_loop_unittests.cc index cd2acd308b46a..e154c1d4add91 100644 --- a/fml/message_loop_unittests.cc +++ b/fml/message_loop_unittests.cc @@ -7,9 +7,9 @@ #include #include "flutter/fml/message_loop.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/task_runner.h" #include "gtest/gtest.h" -#include "lib/fxl/synchronization/waitable_event.h" #define TIME_SENSITIVE(x) TimeSensitiveTest_##x #if OS_WIN @@ -28,8 +28,8 @@ TEST(MessageLoop, GetCurrent) { TEST(MessageLoop, DifferentThreadsHaveDifferentLoops) { fml::MessageLoop* loop1 = nullptr; - fxl::AutoResetWaitableEvent latch1; - fxl::AutoResetWaitableEvent term1; + fml::AutoResetWaitableEvent latch1; + fml::AutoResetWaitableEvent term1; std::thread thread1([&loop1, &latch1, &term1]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); loop1 = &fml::MessageLoop::GetCurrent(); @@ -38,8 +38,8 @@ TEST(MessageLoop, DifferentThreadsHaveDifferentLoops) { }); fml::MessageLoop* loop2 = nullptr; - fxl::AutoResetWaitableEvent latch2; - fxl::AutoResetWaitableEvent term2; + fml::AutoResetWaitableEvent latch2; + fml::AutoResetWaitableEvent term2; std::thread thread2([&loop2, &latch2, &term2]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); loop2 = &fml::MessageLoop::GetCurrent(); @@ -135,7 +135,7 @@ TEST(MessageLoop, DelayedTasksAtSameTimeAreRunInOrder) { TEST(MessageLoop, CheckRunsTaskOnCurrentThread) { fxl::RefPtr runner; - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; std::thread thread([&runner, &latch]() { fml::MessageLoop::EnsureInitializedForCurrentThread(); auto& loop = fml::MessageLoop::GetCurrent(); diff --git a/fml/thread.cc b/fml/thread.cc index ea1060db03050..2f71c07ffcd13 100644 --- a/fml/thread.cc +++ b/fml/thread.cc @@ -18,12 +18,12 @@ #include #include "flutter/fml/message_loop.h" -#include "lib/fxl/synchronization/waitable_event.h" +#include "flutter/fml/synchronization/waitable_event.h" namespace fml { Thread::Thread(const std::string& name) : joined_(false) { - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; fxl::RefPtr runner; thread_ = std::make_unique([&latch, &runner, name]() -> void { SetCurrentThreadName(name); diff --git a/runtime/service_protocol.cc b/runtime/service_protocol.cc index 3994b78ef339d..bbb30aeb53b7d 100644 --- a/runtime/service_protocol.cc +++ b/runtime/service_protocol.cc @@ -13,7 +13,7 @@ #include #include -#include "lib/fxl/synchronization/waitable_event.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "rapidjson/stringbuffer.h" #include "rapidjson/writer.h" #include "third_party/dart/runtime/include/dart_tools_api.h" @@ -138,7 +138,7 @@ static bool HandleMessageOnHandler( const ServiceProtocol::Handler::ServiceProtocolMap& params, rapidjson::Document& document) { FXL_DCHECK(handler); - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; bool result = false; fml::TaskRunner::RunNowOrPostTask( handler->GetServiceProtocolHandlerTaskRunner(method), @@ -240,7 +240,7 @@ bool ServiceProtocol::HandleListViewsMethod( std::lock_guard lock(handlers_mutex_); std::vector> descriptions; for (const auto& handler : handlers_) { - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; Handler::Description description; fml::TaskRunner::RunNowOrPostTask( diff --git a/shell/common/platform_view.cc b/shell/common/platform_view.cc index 5ae0f2d5db4ae..2f0aee3f37e36 100644 --- a/shell/common/platform_view.cc +++ b/shell/common/platform_view.cc @@ -6,11 +6,11 @@ #include +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/vsync_waiter_fallback.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/gpu/GrContextOptions.h" #include "third_party/skia/include/gpu/gl/GrGLInterface.h" diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 873b817f8db0f..482ecbef3c587 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -11,10 +11,10 @@ #include "flutter/flow/compositor_context.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/surface.h" #include "flutter/synchronization/pipeline.h" #include "lib/fxl/functional/closure.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { diff --git a/shell/common/shell.cc b/shell/common/shell.cc index caa67d6a37887..ec39d96ab7308 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -67,7 +67,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( // first because it has state that the other subsystems depend on. It must // first be booted and the necessary references obtained to initialize the // other subsystems. - fxl::AutoResetWaitableEvent io_latch; + fml::AutoResetWaitableEvent io_latch; std::unique_ptr io_manager; fml::WeakPtr resource_context; fxl::RefPtr unref_queue; @@ -90,7 +90,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( io_latch.Wait(); // Create the rasterizer on the GPU thread. - fxl::AutoResetWaitableEvent gpu_latch; + fml::AutoResetWaitableEvent gpu_latch; std::unique_ptr rasterizer; fml::TaskRunner::RunNowOrPostTask( task_runners.GetGPUTaskRunner(), [&gpu_latch, // @@ -105,7 +105,7 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( }); // Create the engine on the UI thread. - fxl::AutoResetWaitableEvent ui_latch; + fml::AutoResetWaitableEvent ui_latch; std::unique_ptr engine; fml::TaskRunner::RunNowOrPostTask( shell->GetTaskRunners().GetUITaskRunner(), @@ -237,7 +237,7 @@ std::unique_ptr Shell::Create( return nullptr; } - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; std::unique_ptr shell; fml::TaskRunner::RunNowOrPostTask( task_runners.GetPlatformTaskRunner(), @@ -304,7 +304,7 @@ Shell::~Shell() { vm->GetServiceProtocol().RemoveHandler(this); } - fxl::AutoResetWaitableEvent ui_latch, gpu_latch, platform_latch, io_latch; + fml::AutoResetWaitableEvent ui_latch, gpu_latch, platform_latch, io_latch; fml::TaskRunner::RunNowOrPostTask( task_runners_.GetUITaskRunner(), @@ -415,7 +415,7 @@ void Shell::OnPlatformViewCreated(const PlatformView& view, // setup/suspension of all activities that may be interacting with the GPU in // a synchronous fashion. - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; auto gpu_task = fxl::MakeCopyable([rasterizer = rasterizer_->GetWeakPtr(), // surface = std::move(surface), // &latch]() mutable { @@ -456,7 +456,7 @@ void Shell::OnPlatformViewDestroyed(const PlatformView& view) { // setup/suspension of all activities that may be interacting with the GPU in // a synchronous fashion. - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; auto io_task = [io_manager = io_manager_.get(), &latch]() { // Execute any pending Skia object deletions while GPU access is still @@ -974,7 +974,7 @@ Rasterizer::Screenshot Shell::Screenshot( Rasterizer::ScreenshotType screenshot_type, bool base64_encode) { TRACE_EVENT0("flutter", "Shell::Screenshot"); - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; Rasterizer::Screenshot screenshot; fml::TaskRunner::RunNowOrPostTask( task_runners_.GetGPUTaskRunner(), [&latch, // diff --git a/shell/common/shell.h b/shell/common/shell.h index f755f67e97cf6..4f4876734fc66 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -13,6 +13,7 @@ #include "flutter/flow/texture.h" #include "flutter/fml/memory/thread_checker.h" #include "flutter/fml/memory/weak_ptr.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/thread.h" #include "flutter/lib/ui/semantics/custom_accessibility_action.h" #include "flutter/lib/ui/semantics/semantics_node.h" @@ -31,7 +32,6 @@ #include "lib/fxl/strings/string_view.h" #include "lib/fxl/synchronization/thread_annotations.h" #include "lib/fxl/synchronization/thread_checker.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { diff --git a/shell/common/shell_unittests.cc b/shell/common/shell_unittests.cc index c68c76d802974..e422f478264ba 100644 --- a/shell/common/shell_unittests.cc +++ b/shell/common/shell_unittests.cc @@ -9,12 +9,12 @@ #include #include "flutter/fml/message_loop.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/shell.h" #include "flutter/shell/common/thread_host.h" #include "gtest/gtest.h" -#include "lib/fxl/synchronization/waitable_event.h" #define CURRENT_TEST_NAME \ std::string { \ diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index a72a85200d054..0dec68ca9ab2c 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -7,13 +7,13 @@ #include #include +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/android/android_external_texture_gl.h" #include "flutter/shell/platform/android/android_surface_gl.h" #include "flutter/shell/platform/android/platform_message_response_android.h" #include "flutter/shell/platform/android/platform_view_android_jni.h" #include "flutter/shell/platform/android/vsync_waiter_android.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { @@ -45,7 +45,7 @@ void PlatformViewAndroid::NotifyDestroyed() { } void PlatformViewAndroid::NotifyChanged(const SkISize& size) { - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; fml::TaskRunner::RunNowOrPostTask( task_runners_.GetGPUTaskRunner(), // [&latch, surface = android_surface_.get(), size]() { diff --git a/shell/platform/darwin/desktop/platform_view_mac.mm b/shell/platform/darwin/desktop/platform_view_mac.mm index f25fa6945af23..d3657dea2616a 100644 --- a/shell/platform/darwin/desktop/platform_view_mac.mm +++ b/shell/platform/darwin/desktop/platform_view_mac.mm @@ -7,13 +7,13 @@ #include #include +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/trace_event.h" #include "flutter/shell/common/io_manager.h" #include "flutter/shell/common/rasterizer.h" #include "flutter/shell/common/switches.h" #include "flutter/shell/platform/darwin/desktop/vsync_waiter_mac.h" #include "lib/fxl/command_line.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { diff --git a/shell/platform/darwin/ios/framework/Source/FlutterView.mm b/shell/platform/darwin/ios/framework/Source/FlutterView.mm index 1f49acd7e66fd..32c54f632992f 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterView.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterView.mm @@ -8,6 +8,7 @@ #include "flutter/common/task_runners.h" #include "flutter/flow/layers/layer_tree.h" #include "flutter/fml/platform/darwin/cf_utils.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/trace_event.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" @@ -15,7 +16,6 @@ #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h" #include "flutter/shell/platform/darwin/ios/ios_surface_gl.h" #include "flutter/shell/platform/darwin/ios/ios_surface_software.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/skia/include/utils/mac/SkCGUtils.h" @interface FlutterView () diff --git a/shell/platform/darwin/ios/platform_view_ios.mm b/shell/platform/darwin/ios/platform_view_ios.mm index df960dc2fd823..04d664dfc62df 100644 --- a/shell/platform/darwin/ios/platform_view_ios.mm +++ b/shell/platform/darwin/ios/platform_view_ios.mm @@ -9,11 +9,11 @@ #include #include "flutter/common/task_runners.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/trace_event.h" #include "flutter/shell/common/io_manager.h" #include "flutter/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.h" #include "flutter/shell/platform/darwin/ios/ios_external_texture_gl.h" -#include "lib/fxl/synchronization/waitable_event.h" namespace shell { diff --git a/shell/testing/tester_main.cc b/shell/testing/tester_main.cc index 099774f61421a..9763bd8dd7854 100644 --- a/shell/testing/tester_main.cc +++ b/shell/testing/tester_main.cc @@ -11,6 +11,7 @@ #include "flutter/fml/file.h" #include "flutter/fml/message_loop.h" #include "flutter/fml/paths.h" +#include "flutter/fml/synchronization/waitable_event.h" #include "flutter/fml/task_runner.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/rasterizer.h" @@ -19,7 +20,6 @@ #include "flutter/shell/common/thread_host.h" #include "lib/fxl/files/path.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/fxl/synchronization/waitable_event.h" #include "third_party/dart/runtime/bin/embedded_dart_io.h" #ifdef ERROR @@ -177,7 +177,7 @@ int RunTester(const blink::Settings& settings, bool run_forever) { bool engine_did_run = false; - fxl::AutoResetWaitableEvent sync_run_latch; + fml::AutoResetWaitableEvent sync_run_latch; fml::TaskRunner::RunNowOrPostTask( shell->GetTaskRunners().GetUITaskRunner(), fxl::MakeCopyable([&sync_run_latch, &completion_observer, @@ -208,7 +208,7 @@ int RunTester(const blink::Settings& settings, bool run_forever) { // Cleanup the completion observer synchronously as it is living on the // stack. - fxl::AutoResetWaitableEvent latch; + fml::AutoResetWaitableEvent latch; fml::TaskRunner::RunNowOrPostTask( shell->GetTaskRunners().GetUITaskRunner(), [&latch, &completion_observer] { From d5ceee874b52d322b0d41ba14ddccc2997110549 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 20 Jul 2018 13:16:39 -0400 Subject: [PATCH 0836/1190] Roll src/third_party/skia 9c4dfadabd1e..fa0720436319 (7 commits) (#5809) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a7b15f340e5ca..3518f536bd903 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '9c4dfadabd1edabbd49e760edf4f067a2b03dd6f', + 'skia_revision': 'fa072043631970f27f9f337a0cfd6ddecff1c75b', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index a1bf9479d47bd..ad07dc5f6463e 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: dea0b609afbc198fc181a95601bbb22f +Signature: e609fc404a32d8c5cec3c4ec2c51e52d UNUSED LICENSES: From 4c9f40a320ba8011a81737e5e945378ac71b9d40 Mon Sep 17 00:00:00 2001 From: Joshua Seaton Date: Fri, 20 Jul 2018 10:53:27 -0700 Subject: [PATCH 0837/1190] [fml] Remove unused ResourceMapping code. (#5811) ResourceMapping-related code is no longer used.Moreover, there is an ASan related-error in ResourceMappingDarwin: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket.appspot.com/8940466063445826656/+/steps/test_results/0/steps/s___out_release-x64_host_tests_dart_schema_tests/0/logs/stdio/0 --- fml/BUILD.gn | 2 -- fml/icu_util.cc | 9 ------ fml/mapping.h | 4 --- fml/platform/darwin/resource_mapping_darwin.h | 31 ------------------- .../darwin/resource_mapping_darwin.mm | 25 --------------- fml/platform/posix/mapping_posix.cc | 19 ------------ fml/platform/win/mapping_win.cc | 10 ------ travis/licenses_golden/licenses_flutter | 2 -- 8 files changed, 102 deletions(-) delete mode 100644 fml/platform/darwin/resource_mapping_darwin.h delete mode 100644 fml/platform/darwin/resource_mapping_darwin.mm diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 0e561b87cbee4..0551319ea2595 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -77,8 +77,6 @@ source_set("fml") { "platform/darwin/paths_darwin.mm", "platform/darwin/platform_version.h", "platform/darwin/platform_version.mm", - "platform/darwin/resource_mapping_darwin.h", - "platform/darwin/resource_mapping_darwin.mm", "platform/darwin/scoped_block.h", "platform/darwin/scoped_block.mm", "platform/darwin/scoped_nsobject.h", diff --git a/fml/icu_util.cc b/fml/icu_util.cc index 98da2880ab07f..03082886e18b7 100644 --- a/fml/icu_util.cc +++ b/fml/icu_util.cc @@ -38,15 +38,6 @@ class ICUContext { return true; } - // Check to see if the mapping is in the resources bundle. - if (PlatformHasResourcesBundle()) { - auto resource = GetResourceMapping(icu_data_path); - if (resource != nullptr && resource->GetSize() != 0) { - mapping_ = std::move(resource); - return true; - } - } - // Check if the mapping can by directly accessed via a file path. In this // case, the data file needs to be next to the executable. auto directory = fml::paths::GetExecutableDirectoryPath(); diff --git a/fml/mapping.h b/fml/mapping.h index 465a66239ae68..e3d840dc8c6e8 100644 --- a/fml/mapping.h +++ b/fml/mapping.h @@ -29,10 +29,6 @@ class Mapping { FML_DISALLOW_COPY_AND_ASSIGN(Mapping); }; -bool PlatformHasResourcesBundle(); - -std::unique_ptr GetResourceMapping(const std::string& resource_name); - class FileMapping : public Mapping { public: FileMapping(const std::string& path, bool executable = false); diff --git a/fml/platform/darwin/resource_mapping_darwin.h b/fml/platform/darwin/resource_mapping_darwin.h deleted file mode 100644 index 4cbc158b900af..0000000000000 --- a/fml/platform/darwin/resource_mapping_darwin.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 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. - -#ifndef FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_ -#define FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_ - -#include "flutter/fml/macros.h" -#include "flutter/fml/mapping.h" - -namespace fml { - -class ResourceMappingDarwin : public Mapping { - public: - ResourceMappingDarwin(const std::string& resource); - - ~ResourceMappingDarwin() override; - - size_t GetSize() const override; - - const uint8_t* GetMapping() const override; - - private: - FileMapping actual_; - - FML_DISALLOW_COPY_AND_ASSIGN(ResourceMappingDarwin); -}; - -} // namespace fml - -#endif // FLUTTER_FML_PLATFORM_DARWIN_RESOURCE_MAPPING_DARWIN_H_ diff --git a/fml/platform/darwin/resource_mapping_darwin.mm b/fml/platform/darwin/resource_mapping_darwin.mm deleted file mode 100644 index 3ee100121ad0f..0000000000000 --- a/fml/platform/darwin/resource_mapping_darwin.mm +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 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. - -#include "flutter/fml/platform/darwin/resource_mapping_darwin.h" - -#include - -namespace fml { - -ResourceMappingDarwin::ResourceMappingDarwin(const std::string& resource) - : actual_([[[NSBundle mainBundle] pathForResource:@(resource.c_str()) ofType:nil] UTF8String], - false) {} - -ResourceMappingDarwin::~ResourceMappingDarwin() = default; - -size_t ResourceMappingDarwin::GetSize() const { - return actual_.GetSize(); -} - -const uint8_t* ResourceMappingDarwin::GetMapping() const { - return actual_.GetMapping(); -} - -} // namespace fml diff --git a/fml/platform/posix/mapping_posix.cc b/fml/platform/posix/mapping_posix.cc index b9f8fe5de98f0..e1dbdedbb5ff2 100644 --- a/fml/platform/posix/mapping_posix.cc +++ b/fml/platform/posix/mapping_posix.cc @@ -15,31 +15,12 @@ #include "flutter/fml/eintr_wrapper.h" #include "flutter/fml/unique_fd.h" -#if OS_MACOSX - -#include "flutter/fml/platform/darwin/resource_mapping_darwin.h" -using PlatformResourceMapping = fml::ResourceMappingDarwin; - -#else - -using PlatformResourceMapping = fml::FileMapping; - -#endif - namespace fml { Mapping::Mapping() = default; Mapping::~Mapping() = default; -bool PlatformHasResourcesBundle() { - return !std::is_same::value; -} - -std::unique_ptr GetResourceMapping(const std::string& resource_name) { - return std::make_unique(resource_name); -} - FileMapping::FileMapping(const std::string& path, bool executable) : FileMapping( fml::UniqueFD{FML_HANDLE_EINTR(::open(path.c_str(), O_RDONLY))}, diff --git a/fml/platform/win/mapping_win.cc b/fml/platform/win/mapping_win.cc index 9dd5dcf6f2249..096173587879d 100644 --- a/fml/platform/win/mapping_win.cc +++ b/fml/platform/win/mapping_win.cc @@ -13,22 +13,12 @@ #include "flutter/fml/file.h" #include "flutter/fml/platform/win/wstring_conversion.h" -using PlatformResourceMapping = fml::FileMapping; - namespace fml { Mapping::Mapping() = default; Mapping::~Mapping() = default; -bool PlatformHasResourcesBundle() { - return !std::is_same::value; -} - -std::unique_ptr GetResourceMapping(const std::string& resource_name) { - return std::make_unique(resource_name); -} - FileMapping::FileMapping(const std::string& path, bool executable) : FileMapping(OpenFile(path.c_str(), executable ? OpenPermission::kExecute diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 3cdcba8d4ac5f..9939512991de1 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -51,8 +51,6 @@ FILE: ../../../flutter/fml/platform/darwin/message_loop_darwin.mm FILE: ../../../flutter/fml/platform/darwin/paths_darwin.mm FILE: ../../../flutter/fml/platform/darwin/platform_version.h FILE: ../../../flutter/fml/platform/darwin/platform_version.mm -FILE: ../../../flutter/fml/platform/darwin/resource_mapping_darwin.h -FILE: ../../../flutter/fml/platform/darwin/resource_mapping_darwin.mm FILE: ../../../flutter/fml/platform/darwin/scoped_block.mm FILE: ../../../flutter/fml/platform/darwin/scoped_nsobject.h FILE: ../../../flutter/fml/platform/darwin/scoped_nsobject.mm From 96f5f5b96c7220ffc8c4ce22ed895616a15ad3a0 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 20 Jul 2018 11:17:59 -0700 Subject: [PATCH 0838/1190] Semantics framework updates (#5601) --- lib/ui/semantics.dart | 83 ++++- lib/ui/semantics/semantics_node.h | 5 + .../io/flutter/view/AccessibilityBridge.java | 291 +++++++++++------- .../framework/Source/accessibility_bridge.mm | 38 ++- 4 files changed, 300 insertions(+), 117 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 91766160d0f17..42494e56aea44 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -27,6 +27,7 @@ class SemanticsAction { static const int _kDidGainAccessibilityFocusIndex = 1 << 15; static const int _kDidLoseAccessibilityFocusIndex = 1 << 16; static const int _kCustomAction = 1 << 17; + static const int _kDismissIndex = 1 << 18; /// The numerical value for this action. /// @@ -148,11 +149,20 @@ class SemanticsAction { static const SemanticsAction didLoseAccessibilityFocus = const SemanticsAction._(_kDidLoseAccessibilityFocusIndex); /// Indicates that the user has invoked a custom accessibility action. - /// + /// /// This handler is added automatically whenever a custom accessibility /// action is added to a semantics node. static const SemanticsAction customAction = const SemanticsAction._(_kCustomAction); + /// A request that the node should be dismissed. + /// + /// A [Snackbar], for example, may have a dismiss action to indicate to the + /// user that it can be removed after it is no longer relevant. On Android, + /// (with TalkBack) special hint text is spoken when focusing the node and + /// a custom action is availible in the local context menu. On iOS, + /// (with VoiceOver) users can perform a standard gesture to dismiss it. + static const SemanticsAction dismiss = const SemanticsAction._(_kDismissIndex); + /// The possible semantics actions. /// /// The map's key is the [index] of the action and the value is the action @@ -176,6 +186,7 @@ class SemanticsAction { _kDidGainAccessibilityFocusIndex: didGainAccessibilityFocus, _kDidLoseAccessibilityFocusIndex: didLoseAccessibilityFocus, _kCustomAction: customAction, + _kDismissIndex: dismiss, }; @override @@ -217,6 +228,8 @@ class SemanticsAction { return 'SemanticsAction.didLoseAccessibilityFocus'; case _kCustomAction: return 'SemanticsAction.customAction'; + case _kDismissIndex: + return 'SemanticsAction.dismiss'; } return null; } @@ -238,6 +251,10 @@ class SemanticsFlag { static const int _kScopesRouteIndex= 1 << 11; static const int _kNamesRouteIndex = 1 << 12; static const int _kIsHiddenIndex = 1 << 13; + static const int _kIsImageIndex = 1 << 14; + static const int _kIsLiveRegionIndex = 1 << 15; + static const int _kHasToggledStateIndex = 1 << 16; + static const int _kIsToggledIndex = 1 << 17; const SemanticsFlag._(this.index); @@ -248,7 +265,13 @@ class SemanticsFlag { /// The semantics node has the quality of either being "checked" or "unchecked". /// + /// This flag is mutually exclusive with [hasToggledState]. + /// /// For example, a checkbox or a radio button widget has checked state. + /// + /// See also: + /// + /// * [SemanticsFlag.isChecked], which controls whether the node is "checked" or "unchecked". static const SemanticsFlag hasCheckedState = const SemanticsFlag._(_kHasCheckedStateIndex); /// Whether a semantics node that [hasCheckedState] is checked. @@ -257,6 +280,10 @@ class SemanticsFlag { /// "unchecked". /// /// For example, if a checkbox has a visible checkmark, [isChecked] is true. + /// + /// See also: + /// + /// * [SemanticsFlag.hasCheckedState], which enables a checked state. static const SemanticsFlag isChecked = const SemanticsFlag._(_kIsCheckedIndex); @@ -376,6 +403,44 @@ class SemanticsFlag { /// used to implement accessibility scrolling on iOS. static const SemanticsFlag isHidden = const SemanticsFlag._(_kIsHiddenIndex); + /// Whether the semantics node represents an image. + /// + /// Both TalkBack and VoiceOver will inform the user the the semantics node + /// represents an image. + static const SemanticsFlag isImage = const SemanticsFlag._(_kIsImageIndex); + + /// Whether the semantics node is a live region. + /// + /// A live region indicates that updates to semantics node are important. + /// Platforms may use this information to make polite announcements to the + /// user to inform them of updates to this node. + /// + /// An example of a live region is a [SnackBar] widget. On Android, A live + /// region causes a polite announcement to be generated automatically, even + /// if the user does not have focus of the widget. + static const SemanticsFlag isLiveRegion = const SemanticsFlag._(_kIsLiveRegionIndex); + + /// The semantics node has the quality of either being "on" or "off". + /// + /// This flag is mutually exclusive with [hasCheckedState]. + /// + /// For example, a switch has toggled state. + /// + /// See also: + /// + /// * [SemanticsFlag.isToggled], which controls whether the node is "on" or "off". + static const SemanticsFlag hasToggledState = const SemanticsFlag._(_kHasToggledStateIndex); + + /// If true, the semantics node is "on". If false, the semantics node is + /// "off". + /// + /// For example, if a switch is in the on position, [isToggled] is true. + /// + /// See also: + /// + /// * [SemanticsFlag.hasToggledState], which enables a toggled state. + static const SemanticsFlag isToggled = const SemanticsFlag._(_kIsToggledIndex); + /// The possible semantics flags. /// /// The map's key is the [index] of the flag and the value is the flag itself. @@ -394,6 +459,10 @@ class SemanticsFlag { _kScopesRouteIndex: scopesRoute, _kNamesRouteIndex: namesRoute, _kIsHiddenIndex: isHidden, + _kIsImageIndex: isImage, + _kIsLiveRegionIndex: isLiveRegion, + _kHasToggledStateIndex: hasToggledState, + _kIsToggledIndex: isToggled, }; @override @@ -427,6 +496,14 @@ class SemanticsFlag { return 'SemanticsFlag.namesRoute'; case _kIsHiddenIndex: return 'SemanticsFlag.isHidden'; + case _kIsImageIndex: + return 'SemanticsFlag.isImage'; + case _kIsLiveRegionIndex: + return 'SemanticsFlag.isLiveRegion'; + case _kHasToggledStateIndex: + return 'SemanticsFlag.hasToggledState'; + case _kIsToggledIndex: + return 'SemanticsFlag.isToggled'; } return null; } @@ -563,8 +640,8 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { ) native 'SemanticsUpdateBuilder_updateNode'; /// Update the custom accessibility action associated with the given `id`. - /// - /// The name of the action exposed to the user is the `label`. The text + /// + /// The name of the action exposed to the user is the `label`. The text /// direction of this label is the same as the global window. void updateCustomAction({int id, String label}) { assert(id != null); diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index e0ae2ba296c69..2ade1f49a905b 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -36,6 +36,7 @@ enum class SemanticsAction : int32_t { kDidGainAccessibilityFocus = 1 << 15, kDidLoseAccessibilityFocus = 1 << 16, kCustomAction = 1 << 17, + kDismiss = 1 << 18, }; const int kScrollableSemanticsActions = @@ -60,6 +61,10 @@ enum class SemanticsFlags : int32_t { kScopesRoute = 1 << 11, kNamesRoute = 1 << 12, kIsHidden = 1 << 13, + kIsImage = 1 << 14, + kIsLiveRegion = 1 << 15, + kHasToggledState = 1 << 16, + kIsToggled = 1 << 17, }; struct SemanticsNode { diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index b0dddf8598c3c..ecd78af4bb01e 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -19,7 +19,8 @@ import java.nio.ByteBuffer; import java.util.*; -class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMessageChannel.MessageHandler { +class AccessibilityBridge + extends AccessibilityNodeProvider implements BasicMessageChannel.MessageHandler { private static final String TAG = "FlutterView"; // Constants from higher API levels. @@ -61,7 +62,8 @@ enum Action { PASTE(1 << 14), DID_GAIN_ACCESSIBILITY_FOCUS(1 << 15), DID_LOSE_ACCESSIBILITY_FOCUS(1 << 16), - CUSTOM_ACTION(1 << 17); + CUSTOM_ACTION(1 << 17), + DISMISS(1 << 18); Action(int value) { this.value = value; @@ -84,7 +86,11 @@ enum Flag { IS_OBSCURED(1 << 10), SCOPES_ROUTE(1 << 11), NAMES_ROUTE(1 << 12), - IS_HIDDEN(1 << 13); + IS_HIDDEN(1 << 13), + IS_IMAGE(1 << 14), + IS_LIVE_REGION(1 << 15), + HAS_TOGGLED_STATE(1 << 16), + IS_TOGGLED(1 << 17); Flag(int value) { this.value = value; @@ -99,8 +105,8 @@ enum Flag { mObjects = new HashMap(); mCustomAccessibilityActions = new HashMap(); previousRoutes = new ArrayList<>(); - mFlutterAccessibilityChannel = new BasicMessageChannel<>(owner, "flutter/accessibility", - StandardMessageCodec.INSTANCE); + mFlutterAccessibilityChannel = new BasicMessageChannel<>( + owner, "flutter/accessibility", StandardMessageCodec.INSTANCE); } void setAccessibilityEnabled(boolean accessibilityEnabled) { @@ -118,25 +124,29 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { if (virtualViewId == View.NO_ID) { AccessibilityNodeInfo result = AccessibilityNodeInfo.obtain(mOwner); mOwner.onInitializeAccessibilityNodeInfo(result); - if (mObjects.containsKey(ROOT_NODE_ID)) + if (mObjects.containsKey(ROOT_NODE_ID)) { result.addChild(mOwner, ROOT_NODE_ID); + } return result; } SemanticsObject object = mObjects.get(virtualViewId); - if (object == null) + if (object == null) { return null; + } AccessibilityNodeInfo result = AccessibilityNodeInfo.obtain(mOwner, virtualViewId); result.setPackageName(mOwner.getContext().getPackageName()); result.setClassName("android.view.View"); result.setSource(mOwner, virtualViewId); result.setFocusable(object.isFocusable()); - if (mInputFocusedObject != null) + if (mInputFocusedObject != null) { result.setFocused(mInputFocusedObject.id == virtualViewId); + } - if (mA11yFocusedObject != null) + if (mA11yFocusedObject != null) { result.setAccessibilityFocused(mA11yFocusedObject.id == virtualViewId); + } if (object.hasFlag(Flag.IS_TEXT_FIELD)) { result.setPassword(object.hasFlag(Flag.IS_OBSCURED)); @@ -146,6 +156,10 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { if (object.textSelectionBase != -1 && object.textSelectionExtent != -1) { result.setTextSelection(object.textSelectionBase, object.textSelectionExtent); } + // Text fields will always be created as a live region, so that updates to + // the label trigger polite announcements. This makes it easy to follow a11y + // guidelines for text fields on Android. + result.setLiveRegion(View.ACCESSIBILITY_LIVE_REGION_POLITE); } // Cursor movements @@ -174,7 +188,16 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { } if (object.hasFlag(Flag.IS_BUTTON)) { - result.setClassName("android.widget.Button"); + result.setClassName("android.widget.Button"); + } + if (object.hasFlag(Flag.IS_IMAGE)) { + result.setClassName("android.widget.ImageView"); + // TODO(jonahwilliams): Figure out a way conform to the expected id from TalkBack's + // CustomLabelManager. talkback/src/main/java/labeling/CustomLabelManager.java#L525 + } + if (object.hasAction(Action.DISMISS)) { + result.setDismissable(true); + result.addAction(AccessibilityNodeInfo.ACTION_DISMISS); } if (object.parent != null) { @@ -196,8 +219,8 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { } result.setBoundsInScreen(bounds); result.setVisibleToUser(true); - result.setEnabled(!object.hasFlag(Flag.HAS_ENABLED_STATE) || - object.hasFlag(Flag.IS_ENABLED)); + result.setEnabled( + !object.hasFlag(Flag.HAS_ENABLED_STATE) || object.hasFlag(Flag.IS_ENABLED)); if (object.hasAction(Action.TAP)) { result.addAction(AccessibilityNodeInfo.ACTION_CLICK); @@ -224,6 +247,8 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { } } if (object.hasAction(Action.INCREASE) || object.hasAction(Action.DECREASE)) { + // TODO(jonahwilliams): support AccessibilityAction.ACTION_SET_PROGRESS once SDK is + // updated. result.setClassName("android.widget.SeekBar"); if (object.hasAction(Action.INCREASE)) { result.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD); @@ -232,15 +257,23 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { result.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD); } } + if (object.hasFlag(Flag.IS_LIVE_REGION)) { + result.setLiveRegion(View.ACCESSIBILITY_LIVE_REGION_POLITE); + } boolean hasCheckedState = object.hasFlag(Flag.HAS_CHECKED_STATE); - result.setCheckable(hasCheckedState); + boolean hasToggledState = object.hasFlag(Flag.HAS_TOGGLED_STATE); + assert !(hasCheckedState && hasToggledState); + result.setCheckable(hasCheckedState || hasToggledState); if (hasCheckedState) { result.setChecked(object.hasFlag(Flag.IS_CHECKED)); if (object.hasFlag(Flag.IS_IN_MUTUALLY_EXCLUSIVE_GROUP)) result.setClassName("android.widget.RadioButton"); else result.setClassName("android.widget.CheckBox"); + } else if (hasToggledState) { + result.setChecked(object.hasFlag(Flag.IS_TOGGLED)); + result.setClassName("android.widget.Switch"); } result.setSelected(object.hasFlag(Flag.IS_SELECTED)); @@ -257,7 +290,8 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { if (Build.VERSION.SDK_INT >= 21) { if (object.customAccessibilityAction != null) { for (CustomAccessibilityAction action : object.customAccessibilityAction) { - result.addAction(new AccessibilityNodeInfo.AccessibilityAction(action.resourceId, action.label)); + result.addAction(new AccessibilityNodeInfo.AccessibilityAction( + action.resourceId, action.label)); } } } @@ -334,13 +368,15 @@ public boolean performAction(int virtualViewId, int action, Bundle arguments) { } case AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS: { mOwner.dispatchSemanticsAction(virtualViewId, Action.DID_LOSE_ACCESSIBILITY_FOCUS); - sendAccessibilityEvent(virtualViewId, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED); + sendAccessibilityEvent( + virtualViewId, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED); mA11yFocusedObject = null; return true; } case AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS: { mOwner.dispatchSemanticsAction(virtualViewId, Action.DID_GAIN_ACCESSIBILITY_FOCUS); - sendAccessibilityEvent(virtualViewId, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED); + sendAccessibilityEvent( + virtualViewId, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED); if (mA11yFocusedObject == null) { // When Android focuses a node, it doesn't invalidate the view. @@ -364,15 +400,17 @@ public boolean performAction(int virtualViewId, int action, Bundle arguments) { case AccessibilityNodeInfo.ACTION_SET_SELECTION: { final Map selection = new HashMap(); final boolean hasSelection = arguments != null - && arguments.containsKey( - AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT) - && arguments.containsKey( - AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT); + && arguments.containsKey( + AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT) + && arguments.containsKey( + AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT); if (hasSelection) { - selection.put("base", arguments.getInt( - AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT)); - selection.put("extent", arguments.getInt( - AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT)); + selection.put("base", + arguments.getInt( + AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_START_INT)); + selection.put("extent", + arguments.getInt( + AccessibilityNodeInfo.ACTION_ARGUMENT_SELECTION_END_INT)); } else { // Clear the selection selection.put("base", object.textSelectionExtent); @@ -393,35 +431,44 @@ public boolean performAction(int virtualViewId, int action, Bundle arguments) { mOwner.dispatchSemanticsAction(virtualViewId, Action.PASTE); return true; } + case AccessibilityNodeInfo.ACTION_DISMISS: { + mOwner.dispatchSemanticsAction(virtualViewId, Action.DISMISS); + return true; + } default: // might be a custom accessibility action. final int flutterId = action - firstResourceId; - CustomAccessibilityAction contextAction = mCustomAccessibilityActions.get(flutterId); + CustomAccessibilityAction contextAction = + mCustomAccessibilityActions.get(flutterId); if (contextAction != null) { - mOwner.dispatchSemanticsAction(virtualViewId, Action.CUSTOM_ACTION, contextAction.id); + mOwner.dispatchSemanticsAction( + virtualViewId, Action.CUSTOM_ACTION, contextAction.id); return true; } } return false; } - boolean performCursorMoveAction(SemanticsObject object, int virtualViewId, Bundle arguments, boolean forward) { - final int granularity = arguments.getInt( - AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT); + boolean performCursorMoveAction( + SemanticsObject object, int virtualViewId, Bundle arguments, boolean forward) { + final int granularity = + arguments.getInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT); final boolean extendSelection = arguments.getBoolean( - AccessibilityNodeInfo.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN); + AccessibilityNodeInfo.ACTION_ARGUMENT_EXTEND_SELECTION_BOOLEAN); switch (granularity) { case AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER: { if (forward && object.hasAction(Action.MOVE_CURSOR_FORWARD_BY_CHARACTER)) { - mOwner.dispatchSemanticsAction(virtualViewId, Action.MOVE_CURSOR_FORWARD_BY_CHARACTER, extendSelection); + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_FORWARD_BY_CHARACTER, extendSelection); return true; } if (!forward && object.hasAction(Action.MOVE_CURSOR_BACKWARD_BY_CHARACTER)) { - mOwner.dispatchSemanticsAction(virtualViewId, Action.MOVE_CURSOR_BACKWARD_BY_CHARACTER, extendSelection); + mOwner.dispatchSemanticsAction(virtualViewId, + Action.MOVE_CURSOR_BACKWARD_BY_CHARACTER, extendSelection); return true; } } - // TODO(goderbauer): support other granularities. + // TODO(goderbauer): support other granularities. } return false; } @@ -444,20 +491,19 @@ public AccessibilityNodeInfo findFocus(int focus) { return null; } - private SemanticsObject getRootObject() { - assert mObjects.containsKey(0); - return mObjects.get(0); + assert mObjects.containsKey(0); + return mObjects.get(0); } private SemanticsObject getOrCreateObject(int id) { - SemanticsObject object = mObjects.get(id); - if (object == null) { - object = new SemanticsObject(); - object.id = id; - mObjects.put(id, object); - } - return object; + SemanticsObject object = mObjects.get(id); + if (object == null) { + object = new SemanticsObject(); + object.id = id; + mObjects.put(id, object); + } + return object; } private CustomAccessibilityAction getOrCreateAction(int id) { @@ -482,7 +528,7 @@ void handleTouchExploration(float x, float y) { if (mObjects.isEmpty()) { return; } - SemanticsObject newObject = getRootObject().hitTest(new float[]{ x, y, 0, 1 }); + SemanticsObject newObject = getRootObject().hitTest(new float[] {x, y, 0, 1}); if (newObject != mHoveredObject) { // sending ENTER before EXIT is how Android wants it if (newObject != null) { @@ -496,7 +542,8 @@ void handleTouchExploration(float x, float y) { } void updateCustomAccessibilityActions(ByteBuffer buffer, String[] strings) { - ArrayList updatedActions = new ArrayList(); + ArrayList updatedActions = + new ArrayList(); while (buffer.hasRemaining()) { int id = buffer.getInt(); CustomAccessibilityAction action = getOrCreateAction(id); @@ -526,10 +573,10 @@ void updateSemantics(ByteBuffer buffer, String[] strings) { SemanticsObject rootObject = getRootObject(); List newRoutes = new ArrayList<>(); if (rootObject != null) { - final float[] identity = new float[16]; - Matrix.setIdentityM(identity, 0); - rootObject.updateRecursively(identity, visitedObjects, false); - rootObject.collectRoutes(newRoutes); + final float[] identity = new float[16]; + Matrix.setIdentityM(identity, 0); + rootObject.updateRecursively(identity, visitedObjects, false); + rootObject.collectRoutes(newRoutes); } // Dispatch a TYPE_WINDOW_STATE_CHANGED event if the most recent route id changed from the @@ -602,6 +649,14 @@ void updateSemantics(ByteBuffer buffer, String[] strings) { } sendAccessibilityEvent(event); } + if (object.hasFlag(Flag.IS_LIVE_REGION) && !object.hadFlag(Flag.IS_LIVE_REGION)) { + sendAccessibilityEvent(object.id, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + } else if (object.hasFlag(Flag.IS_TEXT_FIELD) && object.didChangeLabel() + && mInputFocusedObject != null && mInputFocusedObject.id == object.id) { + // Text fields should announce when their label changes while focused. We use a live + // region tag to do so, and this event triggers that update. + sendAccessibilityEvent(object.id, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + } if (mA11yFocusedObject != null && mA11yFocusedObject.id == object.id && !object.hadFlag(Flag.IS_SELECTED) && object.hasFlag(Flag.IS_SELECTED)) { AccessibilityEvent event = @@ -610,8 +665,7 @@ void updateSemantics(ByteBuffer buffer, String[] strings) { sendAccessibilityEvent(event); } if (mInputFocusedObject != null && mInputFocusedObject.id == object.id - && object.hadFlag(Flag.IS_TEXT_FIELD) - && object.hasFlag(Flag.IS_TEXT_FIELD)) { + && object.hadFlag(Flag.IS_TEXT_FIELD) && object.hasFlag(Flag.IS_TEXT_FIELD)) { String oldValue = object.previousValue != null ? object.previousValue : ""; String newValue = object.value != null ? object.value : ""; AccessibilityEvent event = createTextChangedEvent(object.id, oldValue, newValue); @@ -622,7 +676,7 @@ void updateSemantics(ByteBuffer buffer, String[] strings) { if (object.previousTextSelectionBase != object.textSelectionBase || object.previousTextSelectionExtent != object.textSelectionExtent) { AccessibilityEvent selectionEvent = obtainAccessibilityEvent( - object.id, AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED); + object.id, AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED); selectionEvent.getText().add(newValue); selectionEvent.setFromIndex(object.textSelectionBase); selectionEvent.setToIndex(object.textSelectionExtent); @@ -634,7 +688,8 @@ void updateSemantics(ByteBuffer buffer, String[] strings) { } private AccessibilityEvent createTextChangedEvent(int id, String oldValue, String newValue) { - AccessibilityEvent e = obtainAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED); + AccessibilityEvent e = + obtainAccessibilityEvent(id, AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED); e.setBeforeText(oldValue); e.getText().add(newValue); @@ -645,7 +700,7 @@ private AccessibilityEvent createTextChangedEvent(int id, String oldValue, Strin } } if (i >= oldValue.length() && i >= newValue.length()) { - return null; // Text did not change + return null; // Text did not change } int firstDifference = i; e.setFromIndex(firstDifference); @@ -694,10 +749,10 @@ private void sendAccessibilityEvent(AccessibilityEvent event) { // Message Handler for [mFlutterAccessibilityChannel]. public void onMessage(Object message, BasicMessageChannel.Reply reply) { @SuppressWarnings("unchecked") - final HashMap annotatedEvent = (HashMap)message; - final String type = (String)annotatedEvent.get("type"); + final HashMap annotatedEvent = (HashMap) message; + final String type = (String) annotatedEvent.get("type"); @SuppressWarnings("unchecked") - final HashMap data = (HashMap)annotatedEvent.get("data"); + final HashMap data = (HashMap) annotatedEvent.get("data"); switch (type) { case "announce": @@ -720,15 +775,27 @@ public void onMessage(Object message, BasicMessageChannel.Reply reply) { break; } case "tooltip": { - AccessibilityEvent e = obtainAccessibilityEvent(ROOT_NODE_ID, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); + AccessibilityEvent e = obtainAccessibilityEvent( + ROOT_NODE_ID, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); e.getText().add((String) data.get("message")); sendAccessibilityEvent(e); } + // Requires that the node id provided corresponds to a live region, or TalkBack will + // ignore the event. The event will cause talkback to read out the new label even + // if node is not focused. + case "updateLiveRegion": { + Integer nodeId = (Integer) annotatedEvent.get("nodeId"); + if (nodeId == null) { + return; + } + sendAccessibilityEvent(nodeId, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); + } } } private void createWindowChangeEvent(SemanticsObject route) { - AccessibilityEvent e = obtainAccessibilityEvent(route.id, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); + AccessibilityEvent e = + obtainAccessibilityEvent(route.id, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); String routeName = route.getRouteName(); e.getText().add(routeName); sendAccessibilityEvent(e); @@ -739,7 +806,8 @@ private void willRemoveSemanticsObject(SemanticsObject object) { assert mObjects.get(object.id) == object; object.parent = null; if (mA11yFocusedObject == object) { - sendAccessibilityEvent(mA11yFocusedObject.id, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED); + sendAccessibilityEvent(mA11yFocusedObject.id, + AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED); mA11yFocusedObject = null; } if (mInputFocusedObject == object) { @@ -753,14 +821,17 @@ private void willRemoveSemanticsObject(SemanticsObject object) { void reset() { mObjects.clear(); if (mA11yFocusedObject != null) - sendAccessibilityEvent(mA11yFocusedObject.id, AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED); + sendAccessibilityEvent(mA11yFocusedObject.id, + AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED); mA11yFocusedObject = null; mHoveredObject = null; sendAccessibilityEvent(0, AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED); } private enum TextDirection { - UNKNOWN, LTR, RTL; + UNKNOWN, + LTR, + RTL; public static TextDirection fromInt(int value) { switch (value) { @@ -775,7 +846,7 @@ public static TextDirection fromInt(int value) { private class CustomAccessibilityAction { CustomAccessibilityAction() {} - + /// Resource id is the id of the custom action plus a minimum value so that the identifier /// does not collide with existing Android accessibility actions. int resourceId = -1; @@ -788,7 +859,7 @@ private class CustomAccessibilityAction { static int firstResourceId = 267386881; private class SemanticsObject { - SemanticsObject() { } + SemanticsObject() {} int id = -1; @@ -815,6 +886,7 @@ private class SemanticsObject { float previousScrollExtentMax; float previousScrollExtentMin; String previousValue; + String previousLabel; private float left; private float top; @@ -856,22 +928,32 @@ boolean didScroll() { && previousScrollPosition != scrollPosition; } + boolean didChangeLabel() { + if (label == null && previousLabel == null) { + return false; + } + return label == null || previousLabel == null || !label.equals(previousLabel); + } + void log(String indent, boolean recursive) { - Log.i(TAG, indent + "SemanticsObject id=" + id + " label=" + label + " actions=" + actions + " flags=" + flags + "\n" + - indent + " +-- textDirection=" + textDirection + "\n"+ - indent + " +-- rect.ltrb=(" + left + ", " + top + ", " + right + ", " + bottom + ")\n" + - indent + " +-- transform=" + Arrays.toString(transform) + "\n"); - if (childrenInTraversalOrder != null && recursive) { - String childIndent = indent + " "; - for (SemanticsObject child : childrenInTraversalOrder) { - child.log(childIndent, recursive); - } - } + Log.i(TAG, + indent + "SemanticsObject id=" + id + " label=" + label + " actions=" + actions + + " flags=" + flags + "\n" + indent + " +-- textDirection=" + + textDirection + "\n" + indent + " +-- rect.ltrb=(" + left + ", " + + top + ", " + right + ", " + bottom + ")\n" + indent + + " +-- transform=" + Arrays.toString(transform) + "\n"); + if (childrenInTraversalOrder != null && recursive) { + String childIndent = indent + " "; + for (SemanticsObject child : childrenInTraversalOrder) { + child.log(childIndent, recursive); + } + } } void updateWith(ByteBuffer buffer, String[] strings) { hadPreviousConfig = true; previousValue = value; + previousLabel = label; previousFlags = flags; previousActions = actions; previousTextSelectionBase = textSelectionBase; @@ -910,10 +992,12 @@ void updateWith(ByteBuffer buffer, String[] strings) { right = buffer.getFloat(); bottom = buffer.getFloat(); - if (transform == null) + if (transform == null) { transform = new float[16]; - for (int i = 0; i < 16; ++i) + } + for (int i = 0; i < 16; ++i) { transform[i] = buffer.getFloat(); + } inverseTransformDirty = true; globalGeometryDirty = true; @@ -949,7 +1033,8 @@ void updateWith(ByteBuffer buffer, String[] strings) { customAccessibilityAction = null; } else { if (customAccessibilityAction == null) - customAccessibilityAction = new ArrayList(actionCount); + customAccessibilityAction = + new ArrayList(actionCount); else customAccessibilityAction.clear(); @@ -961,13 +1046,16 @@ void updateWith(ByteBuffer buffer, String[] strings) { } private void ensureInverseTransform() { - if (!inverseTransformDirty) + if (!inverseTransformDirty) { return; + } inverseTransformDirty = false; - if (inverseTransform == null) + if (inverseTransform == null) { inverseTransform = new float[16]; - if (!Matrix.invertM(inverseTransform, 0, transform, 0)) + } + if (!Matrix.invertM(inverseTransform, 0, transform, 0)) { Arrays.fill(inverseTransform, 0); + } } Rect getGlobalRect() { @@ -979,8 +1067,7 @@ SemanticsObject hitTest(float[] point) { final float w = point[3]; final float x = point[0] / w; final float y = point[1] / w; - if (x < left || x >= right || y < top || y >= bottom) - return null; + if (x < left || x >= right || y < top || y >= bottom) return null; if (childrenInHitTestOrder != null) { final float[] transformedPoint = new float[4]; for (int i = 0; i < childrenInHitTestOrder.size(); i += 1) { @@ -1009,11 +1096,9 @@ boolean isFocusable() { } int scrollableActions = Action.SCROLL_RIGHT.value | Action.SCROLL_LEFT.value | Action.SCROLL_UP.value | Action.SCROLL_DOWN.value; - return (actions & ~scrollableActions) != 0 - || flags != 0 - || (label != null && !label.isEmpty()) - || (value != null && !value.isEmpty()) - || (hint != null && !hint.isEmpty()); + return (actions & ~scrollableActions) != 0 || flags != 0 + || (label != null && !label.isEmpty()) || (value != null && !value.isEmpty()) + || (hint != null && !hint.isEmpty()); } void collectRoutes(List edges) { @@ -1046,15 +1131,18 @@ String getRouteName() { return null; } - void updateRecursively(float[] ancestorTransform, Set visitedObjects, boolean forceUpdate) { + void updateRecursively(float[] ancestorTransform, Set visitedObjects, + boolean forceUpdate) { visitedObjects.add(this); - if (globalGeometryDirty) + if (globalGeometryDirty) { forceUpdate = true; + } if (forceUpdate) { - if (globalTransform == null) + if (globalTransform == null) { globalTransform = new float[16]; + } Matrix.multiplyMM(globalTransform, 0, ancestorTransform, 0, transform, 0); final float[] sample = new float[4]; @@ -1082,15 +1170,12 @@ void updateRecursively(float[] ancestorTransform, Set visitedOb sample[1] = bottom; transformPoint(point4, globalTransform, sample); - if (globalRect == null) - globalRect = new Rect(); + if (globalRect == null) globalRect = new Rect(); - globalRect.set( - Math.round(min(point1[0], point2[0], point3[0], point4[0])), - Math.round(min(point1[1], point2[1], point3[1], point4[1])), - Math.round(max(point1[0], point2[0], point3[0], point4[0])), - Math.round(max(point1[1], point2[1], point3[1], point4[1])) - ); + globalRect.set(Math.round(min(point1[0], point2[0], point3[0], point4[0])), + Math.round(min(point1[1], point2[1], point3[1], point4[1])), + Math.round(max(point1[0], point2[0], point3[0], point4[0])), + Math.round(max(point1[1], point2[1], point3[1], point4[1]))); globalGeometryDirty = false; } @@ -1100,7 +1185,8 @@ void updateRecursively(float[] ancestorTransform, Set visitedOb if (childrenInTraversalOrder != null) { for (int i = 0; i < childrenInTraversalOrder.size(); ++i) { - childrenInTraversalOrder.get(i).updateRecursively(globalTransform, visitedObjects, forceUpdate); + childrenInTraversalOrder.get(i).updateRecursively( + globalTransform, visitedObjects, forceUpdate); } } } @@ -1124,11 +1210,10 @@ private float max(float a, float b, float c, float d) { private String getValueLabelHint() { StringBuilder sb = new StringBuilder(); - String[] array = { value, label, hint }; - for (String word: array) { + String[] array = {value, label, hint}; + for (String word : array) { if (word != null && word.length() > 0) { - if (sb.length() > 0) - sb.append(", "); + if (sb.length() > 0) sb.append(", "); sb.append(word); } } diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index 91bed1ced7bd8..b619325a96888 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -42,8 +42,7 @@ } // namespace -@implementation FlutterCustomAccessibilityAction - { +@implementation FlutterCustomAccessibilityAction { } @end @@ -185,12 +184,12 @@ - (BOOL)onCustomAccessibilityAction:(FlutterCustomAccessibilityAction*)action { return NO; int32_t action_id = action.uid; std::vector args; - args.push_back(3); // type=int32. + args.push_back(3); // type=int32. args.push_back(action_id); args.push_back(action_id >> 8); args.push_back(action_id >> 16); args.push_back(action_id >> 24); - [self bridge] ->DispatchSemanticsAction([self uid], blink::SemanticsAction::kCustomAction, args); + [self bridge] -> DispatchSemanticsAction([self uid], blink::SemanticsAction::kCustomAction, args); return YES; } @@ -313,6 +312,13 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { return YES; } +- (BOOL)accessibilityPerformEscape { + if (![self node].HasAction(blink::SemanticsAction::kDismiss)) + return NO; + [self bridge] -> DispatchSemanticsAction([self uid], blink::SemanticsAction::kDismiss); + return YES; +} + #pragma mark UIAccessibilityFocus overrides - (void)accessibilityElementDidBecomeFocused { @@ -361,7 +367,9 @@ - (UIAccessibilityTraits)accessibilityTraits { [self node].HasAction(blink::SemanticsAction::kDecrease)) { traits |= UIAccessibilityTraitAdjustable; } + // TODO(jonahwilliams): switches should have a value of "on" or "off" if ([self node].HasFlag(blink::SemanticsFlags::kIsSelected) || + [self node].HasFlag(blink::SemanticsFlags::kIsToggled) || [self node].HasFlag(blink::SemanticsFlags::kIsChecked)) { traits |= UIAccessibilityTraitSelected; } @@ -375,6 +383,12 @@ - (UIAccessibilityTraits)accessibilityTraits { if ([self node].HasFlag(blink::SemanticsFlags::kIsHeader)) { traits |= UIAccessibilityTraitHeader; } + if ([self node].HasFlag(blink::SemanticsFlags::kIsImage)) { + traits |= UIAccessibilityTraitImage; + } + if ([self node].HasFlag(blink::SemanticsFlags::kIsLiveRegion)) { + traits |= UIAccessibilityTraitUpdatesFrequently; + } return traits; } @@ -504,7 +518,7 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { blink::CustomAccessibilityActionUpdates actions) { BOOL layoutChanged = NO; BOOL scrollOccured = NO; - for (const auto& entry: actions) { + for (const auto& entry : actions) { const blink::CustomAccessibilityAction& action = entry.second; actions_[action.id] = action; } @@ -524,14 +538,16 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { } object.children = newChildren; if (node.customAccessibilityActions.size() > 0) { - NSMutableArray* accessibilityCustomActions = + NSMutableArray* accessibilityCustomActions = [[[NSMutableArray alloc] init] autorelease]; for (int32_t action_id : node.customAccessibilityActions) { blink::CustomAccessibilityAction& action = actions_[action_id]; NSString* label = @(action.label.data()); SEL selector = @selector(onCustomAccessibilityAction:); - FlutterCustomAccessibilityAction* customAction = - [[FlutterCustomAccessibilityAction alloc] initWithName:label target:object selector:selector]; + FlutterCustomAccessibilityAction* customAction = + [[FlutterCustomAccessibilityAction alloc] initWithName:label + target:object + selector:selector]; customAction.uid = action_id; [accessibilityCustomActions addObject:customAction]; } @@ -597,10 +613,10 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { platform_view_->DispatchSemanticsAction(uid, action, args); } -void AccessibilityBridge::DispatchSemanticsAction(int32_t uid, - blink::SemanticsAction action, +void AccessibilityBridge::DispatchSemanticsAction(int32_t uid, + blink::SemanticsAction action, std::vector args) { - platform_view_->DispatchSemanticsAction(uid, action, args); + platform_view_->DispatchSemanticsAction(uid, action, args); } SemanticsObject* AccessibilityBridge::GetOrCreateObject(int32_t uid, From 4c7618ac71ca0ed7371b98029b44135eddc882be Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 20 Jul 2018 16:43:39 -0400 Subject: [PATCH 0839/1190] Roll src/third_party/skia fa0720436319..d3509a42638a (7 commits) (#5814) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3518f536bd903..fd5cfd7423d71 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'fa072043631970f27f9f337a0cfd6ddecff1c75b', + 'skia_revision': 'd3509a42638a06b328917723fcaad1d4393431b2', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ad07dc5f6463e..149cff896ad28 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: e609fc404a32d8c5cec3c4ec2c51e52d +Signature: b27955c580f9ae994990c5643b3c06fb UNUSED LICENSES: From e555ea573e4932b8b367bb758c82a0784d895aa6 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Fri, 20 Jul 2018 13:47:55 -0700 Subject: [PATCH 0840/1190] Remove trailing white spaces (#5734) * Remove trailing white spaces * Fix clang-format --- lib/ui/semantics/custom_accessibility_action.h | 10 +++++----- lib/ui/semantics/semantics_update_builder.h | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/ui/semantics/custom_accessibility_action.h b/lib/ui/semantics/custom_accessibility_action.h index 9ccfd4839fdfc..a5762b54aff20 100644 --- a/lib/ui/semantics/custom_accessibility_action.h +++ b/lib/ui/semantics/custom_accessibility_action.h @@ -5,14 +5,14 @@ #ifndef FLUTTER_LIB_UI_SEMANTICS_CUSTOM_ACCESSIBILITY_ACTION_H_ #define FLUTTER_LIB_UI_SEMANTICS_CUSTOM_ACCESSIBILITY_ACTION_H_ +#include "lib/tonic/dart_library_natives.h" #include "lib/tonic/dart_wrappable.h" #include "lib/tonic/typed_data/float64_list.h" #include "lib/tonic/typed_data/int32_list.h" -#include "lib/tonic/dart_library_natives.h" namespace blink { -/// A custom accessibility action is used to indicate additional semantics +/// A custom accessibility action is used to indicate additional semantics /// actions that a user can perform on a semantics node beyond the /// preconfigured options. struct CustomAccessibilityAction { @@ -23,13 +23,13 @@ struct CustomAccessibilityAction { std::string label; }; - // Contains custom accessibility actions that need to be updated. // // The keys in the map are stable action IDs, and the values contain // semantic information for the action corresponding to that id. -using CustomAccessibilityActionUpdates = std::unordered_map; +using CustomAccessibilityActionUpdates = + std::unordered_map; } // namespace blink -#endif //FLUTTER_LIB_UI_SEMANTICS_LOCAL_CONTEXT_ACTION_H_ +#endif // FLUTTER_LIB_UI_SEMANTICS_LOCAL_CONTEXT_ACTION_H_ diff --git a/lib/ui/semantics/semantics_update_builder.h b/lib/ui/semantics/semantics_update_builder.h index dca0f0beaca91..307590b57365e 100644 --- a/lib/ui/semantics/semantics_update_builder.h +++ b/lib/ui/semantics/semantics_update_builder.h @@ -48,8 +48,7 @@ class SemanticsUpdateBuilder const tonic::Int32List& childrenInHitTestOrder, const tonic::Int32List& customAccessibilityActions); - void updateCustomAction(int id, - std::string label); + void updateCustomAction(int id, std::string label); fxl::RefPtr build(); From 2a77a4130a499550f6be9c9e974f8a2248d8692d Mon Sep 17 00:00:00 2001 From: liyuqian Date: Fri, 20 Jul 2018 14:40:15 -0700 Subject: [PATCH 0841/1190] Make git diff range more robust in format.sh (#5813) The new approach follows https://github.com/flutter/flutter/pull/19412 which is suggested by Cirrus in https://github.com/cirruslabs/cirrus-ci-docs/issues/17 --- travis/format.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/travis/format.sh b/travis/format.sh index 3a29bc0606a6b..87ad1dd48415c 100755 --- a/travis/format.sh +++ b/travis/format.sh @@ -32,12 +32,17 @@ $CLANG_FORMAT --version # Compute the diffs. FILETYPES="*.c *.cc *.cpp *.h *.m *.mm" DIFF_OPTS="-U0 --no-color --name-only" + if git remote get-url upstream >/dev/null 2>&1; then - UPSTREAM=upstream/master + UPSTREAM=upstream else - UPSTREAM=master + UPSTREAM=origin fi; -FILES_TO_CHECK="$(git diff $DIFF_OPTS $UPSTREAM -- $FILETYPES)" + + +BASE_SHA="$(git fetch $UPSTREAM master > /dev/null 2>&1 && \ + (git merge-base --fork-point FETCH_HEAD HEAD || git merge-base FETCH_HEAD HEAD))" +FILES_TO_CHECK="$(git diff $DIFF_OPTS $BASE_SHA..HEAD -- $FILETYPES)" FAILED_CHECKS=0 for f in $FILES_TO_CHECK; do @@ -59,7 +64,7 @@ fi FILETYPES="*.c *.cc *.cpp *.h *.m *.mm *.dart" set +e -TRAILING_SPACES=$(git diff $DIFF_OPTS master -- $FILETYPES | xargs grep --line-number --with-filename '\s\+$') +TRAILING_SPACES=$(git diff $DIFF_OPTS $BASE_SHA..HEAD -- $FILETYPES | xargs grep --line-number --with-filename '\s\+$') set -e if [[ ! -z "$TRAILING_SPACES" ]]; then From 81ec6000d8a6a66467dff4e6c7867f3c7e7b7c69 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 20 Jul 2018 20:08:40 -0400 Subject: [PATCH 0842/1190] Roll src/third_party/skia d3509a42638a..6f6de6524c73 (5 commits) (#5819) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index fd5cfd7423d71..9a04c8176139d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'd3509a42638a06b328917723fcaad1d4393431b2', + 'skia_revision': '6f6de6524c735e70e130456d973be603ead2d8df', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 149cff896ad28..3c52f0da5d8e1 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: b27955c580f9ae994990c5643b3c06fb +Signature: 67c5a75ba172abdd242905ffaed7810f UNUSED LICENSES: @@ -14245,6 +14245,7 @@ FILE: ../../../third_party/skia/bench/SkRasterPipelineBench.cpp FILE: ../../../third_party/skia/bench/StreamBench.cpp FILE: ../../../third_party/skia/bench/SwizzleBench.cpp FILE: ../../../third_party/skia/bench/TileImageFilterBench.cpp +FILE: ../../../third_party/skia/bench/VertexColorSpaceBench.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkPEG.h FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.cpp FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.h From fadfff7fd9efcb72f3a7be83222320843016f534 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Fri, 20 Jul 2018 17:09:51 -0700 Subject: [PATCH 0843/1190] Mention that running git clone isn't necessary (#5816) This copies https://github.com/flutter/engine/pull/5810 in order to use the newest format.sh to pass Travis. --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71c923b71e4f4..cf89c87879e9b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ Getting the code and configuring your environment ------------------------------------------------- * Ensure all the dependencies described in the previous section, in particular git, ssh, depot_tools, python, and curl, are installed. - * Fork `https://github.com/flutter/engine` into your own GitHub account. If you already have a fork, and are now installing a development environment on a new machine, make sure you've updated your fork so that you don't use stale configuration options from long ago. + * Fork `https://github.com/flutter/engine` into your own GitHub account. If you already have a fork, and are now installing a development environment on a new machine, make sure you've updated your fork so that you don't use stale configuration options from long ago. Do not use `git clone` to check out this repository; `gclient` will do it for you. * If you haven't configured your machine with an SSH key that's known to github then follow the directions here: https://help.github.com/articles/generating-ssh-keys/. * Create an empty directory for your copy of the repository. For best results, call it `engine`: some of the tools assume this name when working across repositories. (They can be configured to use other names too, so this isn't a strict requirement.) @@ -66,7 +66,7 @@ solutions = [ ``` * `cd engine` (Change to the directory in which you put the `.gclient` file.) - * `gclient sync` This will fetch all the source code that Flutter depends on. Avoid interrupting this script, it can leave your repository in an inconsistent state that is tedious to clean up. + * `gclient sync` This will fetch all the source code that Flutter depends on. Avoid interrupting this script, it can leave your repository in an inconsistent state that is tedious to clean up. (This step automatically runs `git clone`, among other things.) * `cd src/flutter` (Change to the `flutter` directory of the `src` directory that `gclient sync` created in your `engine` directory.) * `git remote add upstream git@github.com:flutter/engine.git` (So that you fetch from the master `flutter/engine` repository, not your clone, when running `git fetch` et al.) * `cd ..` (Return to the `src` directory that `gclient sync` created in your `engine` directory.) From fb0bc05d7bb4a177b13d58564d6b880591a55e7c Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Fri, 20 Jul 2018 23:33:39 -0400 Subject: [PATCH 0844/1190] Roll src/third_party/skia 6f6de6524c73..cc22d4d2fb02 (1 commits) (#5820) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9a04c8176139d..422f85478972d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '6f6de6524c735e70e130456d973be603ead2d8df', + 'skia_revision': 'cc22d4d2fb02ce54aa08a9258515896227421647', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 3c52f0da5d8e1..76639a0600115 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 67c5a75ba172abdd242905ffaed7810f +Signature: 60e49be5e00d4f09f205a09e8746dd69 UNUSED LICENSES: From 04633f326ca450ed3d4a39a2529b729effb9627c Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Fri, 20 Jul 2018 21:13:36 -0700 Subject: [PATCH 0845/1190] Generate process global trace identifiers for pipeline flow traces. (#5818) --- synchronization/pipeline.cc | 9 +++++++++ synchronization/pipeline.h | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/synchronization/pipeline.cc b/synchronization/pipeline.cc index 304fdca9604a7..df8505dbee7a9 100644 --- a/synchronization/pipeline.cc +++ b/synchronization/pipeline.cc @@ -3,3 +3,12 @@ // found in the LICENSE file. #include "flutter/synchronization/pipeline.h" + +namespace flutter { + +size_t GetNextPipelineTraceID() { + static std::atomic_size_t PipelineLastTraceID = {0}; + return ++PipelineLastTraceID; +} + +} // namespace flutter diff --git a/synchronization/pipeline.h b/synchronization/pipeline.h index 3b17fb2c4d3d2..23bf0abecd6db 100644 --- a/synchronization/pipeline.h +++ b/synchronization/pipeline.h @@ -24,6 +24,8 @@ enum class PipelineConsumeResult { MoreAvailable, }; +size_t GetNextPipelineTraceID(); + template class Pipeline : public fxl::RefCountedThreadSafe> { public: @@ -84,8 +86,7 @@ class Pipeline : public fxl::RefCountedThreadSafe> { FXL_DISALLOW_COPY_AND_ASSIGN(ProducerContinuation); }; - explicit Pipeline(uint32_t depth) - : empty_(depth), available_(0), last_trace_id_(0) {} + explicit Pipeline(uint32_t depth) : empty_(depth), available_(0) {} ~Pipeline() = default; @@ -99,7 +100,7 @@ class Pipeline : public fxl::RefCountedThreadSafe> { return ProducerContinuation{ std::bind(&Pipeline::ProducerCommit, this, std::placeholders::_1, std::placeholders::_2), // continuation - ++last_trace_id_}; // trace id + GetNextPipelineTraceID()}; // trace id } using Consumer = std::function; @@ -143,7 +144,6 @@ class Pipeline : public fxl::RefCountedThreadSafe> { Semaphore available_; std::mutex queue_mutex_; std::queue> queue_; - std::atomic_size_t last_trace_id_; void ProducerCommit(ResourcePtr resource, size_t trace_id) { { From 926f546deb11847d057827c0b136f1013c4dfa63 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sat, 21 Jul 2018 17:42:39 -0400 Subject: [PATCH 0846/1190] Roll src/third_party/skia cc22d4d2fb02..dfe1fe40796e (1 commits) (#5821) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 422f85478972d..72036b9c9b2c5 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'cc22d4d2fb02ce54aa08a9258515896227421647', + 'skia_revision': 'dfe1fe40796ea5b61bba177488aa7eb63c9495cf', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 76639a0600115..b708657916ec4 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 60e49be5e00d4f09f205a09e8746dd69 +Signature: 00ec67f7d223ab6ac207e745fccd226b UNUSED LICENSES: From 5886949c959061b502788528dbce0edbf3ecd63f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Sun, 22 Jul 2018 04:43:39 -0400 Subject: [PATCH 0847/1190] Roll src/third_party/skia dfe1fe40796e..df795638b9bd (1 commits) (#5822) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 72036b9c9b2c5..9f8974e384b18 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'dfe1fe40796ea5b61bba177488aa7eb63c9495cf', + 'skia_revision': 'df795638b9bd23d03bea7aafb4ecae221172631a', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index b708657916ec4..32df30efa06d9 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 00ec67f7d223ab6ac207e745fccd226b +Signature: de349efcf6b531d759fc95c13f9f1a31 UNUSED LICENSES: From b7b13b5e99c61cfc7a59f15b674f7645edfdbd51 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 23 Jul 2018 09:56:39 -0400 Subject: [PATCH 0848/1190] Roll src/third_party/skia df795638b9bd..5e6cd2affe41 (1 commits) (#5824) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 9f8974e384b18..e3e5ffc48d260 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'df795638b9bd23d03bea7aafb4ecae221172631a', + 'skia_revision': '5e6cd2affe41af71399c247fcd144e8d28a3ec16', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 32df30efa06d9..cd7fbff1610f7 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: de349efcf6b531d759fc95c13f9f1a31 +Signature: 5b24be30125478f261c3cc0e386c743f UNUSED LICENSES: From b8cd25b4fcae781c781797c9a80ff193f4488f1f Mon Sep 17 00:00:00 2001 From: najeira Date: Tue, 24 Jul 2018 01:38:13 +0900 Subject: [PATCH 0849/1190] libtxt: fix a bug that used incorrect buffer size depending on conditions (#5804) * libtxt: fix a bug that used incorrect buffer size depending on conditions * Update AUTHORS * clang-format --- AUTHORS | 1 + third_party/txt/src/txt/paragraph.cc | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index bd94ff3fe631e..ddcf4d7bd4e18 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,3 +11,4 @@ Dan Field Victor Choueiri Simon Lightfoot Dwayne Slater +Tetsuhiro Ueda diff --git a/third_party/txt/src/txt/paragraph.cc b/third_party/txt/src/txt/paragraph.cc index 78aa0911d3929..e034bc5df7f8c 100644 --- a/third_party/txt/src/txt/paragraph.cc +++ b/third_party/txt/src/txt/paragraph.cc @@ -504,6 +504,7 @@ void Paragraph::Layout(double width, bool force) { uint16_t* text_ptr = text_.data(); size_t text_start = run.start(); size_t text_count = run.end() - run.start(); + size_t text_size = text_.size(); // Apply ellipsizing if the run was not completely laid out and this // is the last line (or lines are unlimited). @@ -541,6 +542,7 @@ void Paragraph::Layout(double width, bool force) { text_ptr = ellipsized_text.data(); text_start = 0; text_count = ellipsized_text.size(); + text_size = text_count; // If there is no line limit, then skip all lines after the ellipsized // line. @@ -550,9 +552,8 @@ void Paragraph::Layout(double width, bool force) { } } - layout.doLayout(text_ptr, text_start, text_count, text_.size(), - run.is_rtl(), font, minikin_paint, - minikin_font_collection); + layout.doLayout(text_ptr, text_start, text_count, text_size, run.is_rtl(), + font, minikin_paint, minikin_font_collection); if (layout.nGlyphs() == 0) continue; From 768daa4d3adbadb8f39b9f0505efa50539755aa2 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 23 Jul 2018 13:13:45 -0400 Subject: [PATCH 0850/1190] Roll src/third_party/skia 5e6cd2affe41..206dbe8a21b6 (5 commits) (#5828) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index e3e5ffc48d260..39b4991ad748a 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '5e6cd2affe41af71399c247fcd144e8d28a3ec16', + 'skia_revision': '206dbe8a21b614bbf09b9d2b488ff453e41fdfd9', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index cd7fbff1610f7..e88a7e067645d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 5b24be30125478f261c3cc0e386c743f +Signature: 6e1d38dcddca35597d5a9f61d9723560 UNUSED LICENSES: From f949f7d43f7e91db6b1124249a90749cb6bbe93b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 23 Jul 2018 14:01:41 -0400 Subject: [PATCH 0851/1190] Roll src/third_party/skia 206dbe8a21b6..e35055f31c7f (1 commits) (#5829) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 39b4991ad748a..3004533ca9676 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '206dbe8a21b614bbf09b9d2b488ff453e41fdfd9', + 'skia_revision': 'e35055f31c7f2a2c7f3c693b9231c44d181ec599', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e88a7e067645d..515e3851edf47 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 6e1d38dcddca35597d5a9f61d9723560 +Signature: 8c6862be68434710cbc30d73df250d2d UNUSED LICENSES: From 0bad812c726ef2f5e6eca647b27ed6f46f36e737 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 23 Jul 2018 11:49:35 -0700 Subject: [PATCH 0852/1190] Migrate to a standalone Tonic repository separated from Topaz (#5817) --- DEPS | 4 +- lib/io/BUILD.gn | 2 +- lib/io/dart_io.cc | 2 +- lib/ui/BUILD.gn | 4 +- lib/ui/compositing/scene.cc | 15 +- lib/ui/compositing/scene.h | 5 +- lib/ui/compositing/scene_builder.cc | 17 +- lib/ui/compositing/scene_builder.h | 19 +- lib/ui/compositing/scene_host.cc | 7 +- lib/ui/compositing/scene_host.h | 5 +- lib/ui/dart_runtime_hooks.cc | 16 +- lib/ui/dart_runtime_hooks.h | 2 +- lib/ui/dart_ui.cc | 4 +- lib/ui/dart_wrapper.h | 28 +++ .../isolate_name_server_natives.cc | 4 +- lib/ui/painting/canvas.cc | 11 +- lib/ui/painting/canvas.h | 11 +- lib/ui/painting/codec.cc | 16 +- lib/ui/painting/codec.h | 5 +- lib/ui/painting/frame_info.cc | 4 +- lib/ui/painting/frame_info.h | 5 +- lib/ui/painting/gradient.cc | 8 +- lib/ui/painting/gradient.h | 8 +- lib/ui/painting/image.cc | 8 +- lib/ui/painting/image.h | 5 +- lib/ui/painting/image_encoding.cc | 8 +- lib/ui/painting/image_encoding.h | 2 +- lib/ui/painting/image_filter.cc | 8 +- lib/ui/painting/image_filter.h | 7 +- lib/ui/painting/image_shader.cc | 8 +- lib/ui/painting/image_shader.h | 4 +- lib/ui/painting/matrix.h | 2 +- lib/ui/painting/paint.cc | 10 +- lib/ui/painting/paint.h | 2 +- lib/ui/painting/path.cc | 31 ++- lib/ui/painting/path.h | 9 +- lib/ui/painting/path_measure.cc | 8 +- lib/ui/painting/path_measure.h | 14 +- lib/ui/painting/picture.cc | 8 +- lib/ui/painting/picture.h | 5 +- lib/ui/painting/picture_recorder.cc | 8 +- lib/ui/painting/picture_recorder.h | 5 +- lib/ui/painting/rrect.cc | 4 +- lib/ui/painting/rrect.h | 2 +- lib/ui/painting/shader.h | 5 +- lib/ui/painting/vertices.cc | 4 +- lib/ui/painting/vertices.h | 9 +- lib/ui/plugins/callback_cache.cc | 2 +- .../semantics/custom_accessibility_action.h | 8 +- lib/ui/semantics/semantics_update.cc | 11 +- lib/ui/semantics/semantics_update.h | 12 +- lib/ui/semantics/semantics_update_builder.cc | 72 +++--- lib/ui/semantics/semantics_update_builder.h | 9 +- lib/ui/text/paragraph.cc | 8 +- lib/ui/text/paragraph.h | 5 +- lib/ui/text/paragraph_builder.cc | 8 +- lib/ui/text/paragraph_builder.h | 7 +- lib/ui/text/paragraph_impl_txt.cc | 2 +- lib/ui/text/text_box.cc | 6 +- lib/ui/text/text_box.h | 2 +- lib/ui/ui_dart_state.cc | 4 +- lib/ui/ui_dart_state.h | 6 +- .../window/platform_message_response_dart.cc | 18 +- .../window/platform_message_response_dart.h | 2 +- lib/ui/window/window.cc | 30 +-- lib/ui/window/window.h | 2 +- runtime/BUILD.gn | 4 +- runtime/dart_isolate.cc | 169 +++++++------- runtime/dart_isolate.h | 36 +-- runtime/dart_isolate_unittests.cc | 9 +- runtime/dart_service_isolate.cc | 6 +- runtime/dart_vm.cc | 16 +- runtime/runtime_controller.cc | 43 ++-- runtime/runtime_controller.h | 4 +- shell/common/BUILD.gn | 4 +- shell/common/engine.cc | 12 +- shell/common/isolate_configuration.cc | 11 +- shell/common/isolate_configuration.h | 2 +- shell/platform/embedder/BUILD.gn | 2 +- shell/testing/BUILD.gn | 2 +- tools/licenses/pubspec.lock | 61 ----- travis/licenses_golden/licenses_flutter | 3 +- travis/licenses_golden/licenses_third_party | 211 +++++++++++++++++- 83 files changed, 695 insertions(+), 492 deletions(-) create mode 100644 lib/ui/dart_wrapper.h delete mode 100644 tools/licenses/pubspec.lock diff --git a/DEPS b/DEPS index 3004533ca9676..3b1e18b73ead7 100644 --- a/DEPS +++ b/DEPS @@ -125,8 +125,8 @@ deps = { 'src/garnet': Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67', - 'src/topaz': - Var('fuchsia_git') + '/topaz' + '@' + '5fa651cf9cc5f338379e34964ff5dd70052f6237', + 'src/third_party/tonic': + Var('fuchsia_git') + '/tonic' + '@' + 'e586d2975fedec0aa6c3ec87de287789172a0948', 'src/third_party/benchmark': Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22', diff --git a/lib/io/BUILD.gn b/lib/io/BUILD.gn index d6240a4690285..21e654f209b92 100644 --- a/lib/io/BUILD.gn +++ b/lib/io/BUILD.gn @@ -12,7 +12,7 @@ source_set("io") { "//third_party/dart/runtime:dart_api", "//third_party/dart/runtime/bin:embedded_dart_io", "//garnet/public/lib/fxl", - "//topaz/lib/tonic/converter", + "//third_party/tonic", ] configs += [ diff --git a/lib/io/dart_io.cc b/lib/io/dart_io.cc index 07cc17cdcd95a..272ea58de9f4d 100644 --- a/lib/io/dart_io.cc +++ b/lib/io/dart_io.cc @@ -4,10 +4,10 @@ #include "flutter/lib/io/dart_io.h" -#include "lib/tonic/converter/dart_converter.h" #include "third_party/dart/runtime/bin/crypto.h" #include "third_party/dart/runtime/bin/io_natives.h" #include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/tonic/converter/dart_converter.h" using tonic::ToDart; diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index f58ed6d102802..81d0720a18aa0 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -14,6 +14,7 @@ source_set("ui") { "dart_runtime_hooks.h", "dart_ui.cc", "dart_ui.h", + "dart_wrapper.h", "isolate_name_server/isolate_name_server.cc", "isolate_name_server/isolate_name_server.h", "isolate_name_server/isolate_name_server_natives.cc", @@ -102,12 +103,13 @@ source_set("ui") { "$flutter_root/fml", "$flutter_root/glue", "$flutter_root/runtime:test_font", + "//garnet/public/lib/fxl", "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", "//third_party/skia:effects", "//third_party/skia:gpu", - "//topaz/lib/tonic", + "//third_party/tonic", ] if (is_fuchsia) { deps += [ "//topaz/public/dart-pkg/zircon" ] diff --git a/lib/ui/compositing/scene.cc b/lib/ui/compositing/scene.cc index 69279c1375fcd..34970914f84a7 100644 --- a/lib/ui/compositing/scene.cc +++ b/lib/ui/compositing/scene.cc @@ -7,15 +7,14 @@ #include "flutter/glue/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" -#include "lib/tonic/dart_persistent_value.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/logging/dart_invoke.h" #include "third_party/skia/include/core/SkImageInfo.h" #include "third_party/skia/include/core/SkSurface.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" +#include "third_party/tonic/dart_persistent_value.h" +#include "third_party/tonic/logging/dart_invoke.h" namespace blink { @@ -152,7 +151,7 @@ Dart_Handle Scene::toImage(uint32_t width, image_callback = std::move(image_callback), // unref_queue = std::move(unref_queue) // ]() mutable { - auto dart_state = image_callback->dart_state().get(); + auto dart_state = image_callback->dart_state().lock(); if (!dart_state) { // The root isolate could have died in the meantime. return; diff --git a/lib/ui/compositing/scene.h b/lib/ui/compositing/scene.h index 92f4b5ae154f7..fde6849936e2f 100644 --- a/lib/ui/compositing/scene.h +++ b/lib/ui/compositing/scene.h @@ -9,7 +9,7 @@ #include #include "flutter/flow/layers/layer_tree.h" -#include "lib/tonic/dart_wrappable.h" +#include "flutter/lib/ui/dart_wrapper.h" #include "third_party/skia/include/core/SkPicture.h" namespace tonic { @@ -18,8 +18,7 @@ class DartLibraryNatives; namespace blink { -class Scene : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class Scene : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Scene); diff --git a/lib/ui/compositing/scene_builder.cc b/lib/ui/compositing/scene_builder.cc index fda3b8ee85813..f10690b5b3cdd 100644 --- a/lib/ui/compositing/scene_builder.cc +++ b/lib/ui/compositing/scene_builder.cc @@ -9,11 +9,11 @@ #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" #include "lib/fxl/build_config.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" #include "third_party/skia/include/core/SkColorFilter.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { @@ -64,15 +64,18 @@ void SceneBuilder::pushClipRect(double left, double top, double bottom, int clipMode) { - layer_builder_->PushClipRect(SkRect::MakeLTRB(left, top, right, bottom), static_cast(clipMode)); + layer_builder_->PushClipRect(SkRect::MakeLTRB(left, top, right, bottom), + static_cast(clipMode)); } void SceneBuilder::pushClipRRect(const RRect& rrect, int clipMode) { - layer_builder_->PushClipRoundedRect(rrect.sk_rrect, static_cast(clipMode)); + layer_builder_->PushClipRoundedRect(rrect.sk_rrect, + static_cast(clipMode)); } void SceneBuilder::pushClipPath(const CanvasPath* path, int clipMode) { - layer_builder_->PushClipPath(path->path(), static_cast(clipMode)); + layer_builder_->PushClipPath(path->path(), + static_cast(clipMode)); } void SceneBuilder::pushOpacity(int alpha) { diff --git a/lib/ui/compositing/scene_builder.h b/lib/ui/compositing/scene_builder.h index ebbc35efa2064..b26dbf68031b2 100644 --- a/lib/ui/compositing/scene_builder.h +++ b/lib/ui/compositing/scene_builder.h @@ -12,18 +12,17 @@ #include "flutter/flow/layers/layer_builder.h" #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/compositing/scene_host.h" +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/image_filter.h" #include "flutter/lib/ui/painting/path.h" #include "flutter/lib/ui/painting/picture.h" #include "flutter/lib/ui/painting/rrect.h" #include "flutter/lib/ui/painting/shader.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float64_list.h" +#include "third_party/tonic/typed_data/float64_list.h" namespace blink { -class SceneBuilder : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class SceneBuilder : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(SceneBuilder); @@ -35,7 +34,11 @@ class SceneBuilder : public fxl::RefCountedThreadSafe, ~SceneBuilder() override; void pushTransform(const tonic::Float64List& matrix4); - void pushClipRect(double left, double right, double top, double bottom, int clipMode); + void pushClipRect(double left, + double right, + double top, + double bottom, + int clipMode); void pushClipRRect(const RRect& rrect, int clipMode); void pushClipPath(const CanvasPath* path, int clipMode); void pushOpacity(int alpha); @@ -47,7 +50,11 @@ class SceneBuilder : public fxl::RefCountedThreadSafe, double maskRectTop, double maskRectBottom, int blendMode); - void pushPhysicalShape(const CanvasPath* path, double elevation, int color, int shadowColor, int clipMode); + void pushPhysicalShape(const CanvasPath* path, + double elevation, + int color, + int shadowColor, + int clipMode); void pop(); diff --git a/lib/ui/compositing/scene_host.cc b/lib/ui/compositing/scene_host.cc index f5e0cfb3547d8..3503dccd0e606 100644 --- a/lib/ui/compositing/scene_host.cc +++ b/lib/ui/compositing/scene_host.cc @@ -5,10 +5,9 @@ #include "flutter/lib/ui/compositing/scene_host.h" #include "flutter/lib/ui/ui_dart_state.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" -#include "lib/tonic/dart_wrappable.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" #ifdef OS_FUCHSIA #include "dart-pkg/zircon/sdk_ext/handle.h" diff --git a/lib/ui/compositing/scene_host.h b/lib/ui/compositing/scene_host.h index 0d142b6199c70..e9e4068ce10d2 100644 --- a/lib/ui/compositing/scene_host.h +++ b/lib/ui/compositing/scene_host.h @@ -7,7 +7,7 @@ #include -#include "lib/tonic/dart_wrappable.h" +#include "flutter/lib/ui/dart_wrapper.h" #if defined(OS_FUCHSIA) #include "flutter/flow/export_node.h" @@ -19,8 +19,7 @@ class DartLibraryNatives; namespace blink { -class SceneHost : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class SceneHost : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(SceneHost); diff --git a/lib/ui/dart_runtime_hooks.cc b/lib/ui/dart_runtime_hooks.cc index e9b3cb32399f5..187913df31846 100644 --- a/lib/ui/dart_runtime_hooks.cc +++ b/lib/ui/dart_runtime_hooks.cc @@ -16,17 +16,17 @@ #include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_library_natives.h" -#include "lib/tonic/dart_microtask_queue.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" #include "third_party/dart/runtime/bin/embedded_dart_io.h" #include "third_party/dart/runtime/include/dart_api.h" #include "third_party/dart/runtime/include/dart_tools_api.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_library_natives.h" +#include "third_party/tonic/dart_microtask_queue.h" +#include "third_party/tonic/dart_state.h" +#include "third_party/tonic/logging/dart_error.h" +#include "third_party/tonic/logging/dart_invoke.h" +#include "third_party/tonic/scopes/dart_api_scope.h" +#include "third_party/tonic/scopes/dart_isolate_scope.h" #if defined(OS_ANDROID) #include diff --git a/lib/ui/dart_runtime_hooks.h b/lib/ui/dart_runtime_hooks.h index 4574fa9f18314..b71d57beda273 100644 --- a/lib/ui/dart_runtime_hooks.h +++ b/lib/ui/dart_runtime_hooks.h @@ -6,8 +6,8 @@ #define FLUTTER_LIB_UI_DART_RUNTIME_HOOKS_H_ #include "lib/fxl/macros.h" -#include "lib/tonic/dart_library_natives.h" #include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/dart_ui.cc b/lib/ui/dart_ui.cc index 306743c82f39f..0bf84899ce1f3 100644 --- a/lib/ui/dart_ui.cc +++ b/lib/ui/dart_ui.cc @@ -26,8 +26,8 @@ #include "flutter/lib/ui/text/paragraph_builder.h" #include "flutter/lib/ui/window/window.h" #include "lib/fxl/build_config.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/logging/dart_error.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/logging/dart_error.h" using tonic::ToDart; diff --git a/lib/ui/dart_wrapper.h b/lib/ui/dart_wrapper.h new file mode 100644 index 0000000000000..fb30369e5155a --- /dev/null +++ b/lib/ui/dart_wrapper.h @@ -0,0 +1,28 @@ +// Copyright 2015 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. + +#ifndef FLUTTER_LIB_UI_DART_WRAPPER_H_ +#define FLUTTER_LIB_UI_DART_WRAPPER_H_ + +#include "lib/fxl/memory/ref_counted.h" +#include "third_party/tonic/dart_wrappable.h" + +namespace blink { + +template +class RefCountedDartWrappable : public fxl::RefCountedThreadSafe, + public tonic::DartWrappable { + public: + virtual void RetainDartWrappableReference() const override { + fxl::RefCountedThreadSafe::AddRef(); + } + + virtual void ReleaseDartWrappableReference() const override { + fxl::RefCountedThreadSafe::Release(); + } +}; + +} // namespace blink + +#endif // FLUTTER_LIB_UI_DART_WRAPPER_H_ diff --git a/lib/ui/isolate_name_server/isolate_name_server_natives.cc b/lib/ui/isolate_name_server/isolate_name_server_natives.cc index 3919f9f4898c1..543cd168b5223 100644 --- a/lib/ui/isolate_name_server/isolate_name_server_natives.cc +++ b/lib/ui/isolate_name_server/isolate_name_server_natives.cc @@ -7,8 +7,8 @@ #include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" #include "flutter/lib/ui/isolate_name_server/isolate_name_server_natives.h" #include "flutter/lib/ui/ui_dart_state.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/painting/canvas.cc b/lib/ui/painting/canvas.cc index 30687c3442ce8..6365897d7fe56 100644 --- a/lib/ui/painting/canvas.cc +++ b/lib/ui/painting/canvas.cc @@ -12,13 +12,13 @@ #include "flutter/lib/ui/painting/matrix.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkRSXform.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" using tonic::ToDart; @@ -164,7 +164,8 @@ void Canvas::clipRect(double left, bool doAntiAlias) { if (!canvas_) return; - canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom), clipOp, doAntiAlias); + canvas_->clipRect(SkRect::MakeLTRB(left, top, right, bottom), clipOp, + doAntiAlias); } void Canvas::clipRRect(const RRect& rrect, bool doAntiAlias) { diff --git a/lib/ui/painting/canvas.h b/lib/ui/painting/canvas.h index e7d875ac4bf76..76ed5159bb978 100644 --- a/lib/ui/painting/canvas.h +++ b/lib/ui/painting/canvas.h @@ -5,18 +5,18 @@ #ifndef FLUTTER_LIB_UI_PAINTING_CANVAS_H_ #define FLUTTER_LIB_UI_PAINTING_CANVAS_H_ +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/paint.h" #include "flutter/lib/ui/painting/path.h" #include "flutter/lib/ui/painting/picture.h" #include "flutter/lib/ui/painting/picture_recorder.h" #include "flutter/lib/ui/painting/rrect.h" #include "flutter/lib/ui/painting/vertices.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float32_list.h" -#include "lib/tonic/typed_data/float64_list.h" -#include "lib/tonic/typed_data/int32_list.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/utils/SkShadowUtils.h" +#include "third_party/tonic/typed_data/float32_list.h" +#include "third_party/tonic/typed_data/float64_list.h" +#include "third_party/tonic/typed_data/int32_list.h" namespace tonic { class DartLibraryNatives; @@ -25,8 +25,7 @@ class DartLibraryNatives; namespace blink { class CanvasImage; -class Canvas : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class Canvas : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Canvas); diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 4b52881f5405c..4af9a99840648 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -9,13 +9,13 @@ #include "flutter/lib/ui/painting/frame_info.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/fxl/logging.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/typed_data/uint8_list.h" #include "third_party/skia/include/codec/SkCodec.h" #include "third_party/skia/include/core/SkPixelRef.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" +#include "third_party/tonic/dart_state.h" +#include "third_party/tonic/logging/dart_invoke.h" +#include "third_party/tonic/typed_data/uint8_list.h" #ifdef ERROR #undef ERROR @@ -46,7 +46,7 @@ struct ImageInfo { static void InvokeCodecCallback(fxl::RefPtr codec, std::unique_ptr callback, size_t trace_id) { - tonic::DartState* dart_state = callback->dart_state().get(); + std::shared_ptr dart_state = callback->dart_state().lock(); if (!dart_state) { TRACE_FLOW_END("flutter", kInitCodecTraceTag, trace_id); return; @@ -328,7 +328,7 @@ bool copy_to(SkBitmap* dst, SkColorType dstColorType, const SkBitmap& src) { void InvokeNextFrameCallback(fxl::RefPtr frameInfo, std::unique_ptr callback, size_t trace_id) { - tonic::DartState* dart_state = callback->dart_state().get(); + std::shared_ptr dart_state = callback->dart_state().lock(); if (!dart_state) { TRACE_FLOW_END("flutter", kCodecNextFrameTraceTag, trace_id); return; @@ -473,7 +473,7 @@ Dart_Handle SingleFrameCodec::getNextFrame(Dart_Handle callback_handle) { auto callback = std::make_unique( tonic::DartState::Current(), callback_handle); - tonic::DartState* dart_state = callback->dart_state().get(); + std::shared_ptr dart_state = callback->dart_state().lock(); if (!dart_state) { return ToDart("Invalid dart state"); } diff --git a/lib/ui/painting/codec.h b/lib/ui/painting/codec.h index 9fdce1a8c1a33..54fa44b6cdd61 100644 --- a/lib/ui/painting/codec.h +++ b/lib/ui/painting/codec.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_CODEC_H_ #define FLUTTER_LIB_UI_PAINTING_CODEC_H_ +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/frame_info.h" -#include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/codec/SkCodec.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkImage.h" @@ -22,8 +22,7 @@ namespace blink { // A handle to an SkCodec object. // // Doesn't mirror SkCodec's API but provides a simple sequential access API. -class Codec : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class Codec : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); public: diff --git a/lib/ui/painting/frame_info.cc b/lib/ui/painting/frame_info.cc index 81c7c277d1f49..03af5b4feb070 100644 --- a/lib/ui/painting/frame_info.cc +++ b/lib/ui/painting/frame_info.cc @@ -5,8 +5,8 @@ #include "flutter/lib/ui/painting/frame_info.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/painting/frame_info.h b/lib/ui/painting/frame_info.h index 862d6f08a6d2d..a1c6f1abbc6dc 100644 --- a/lib/ui/painting/frame_info.h +++ b/lib/ui/painting/frame_info.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_FRAME_INFO_H_ #define FLUTTER_LIB_UI_PAINTING_FRAME_INFO_H_ +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/image.h" -#include "lib/tonic/dart_wrappable.h" namespace tonic { class DartLibraryNatives; @@ -15,8 +15,7 @@ class DartLibraryNatives; namespace blink { // A single animation frame. -class FrameInfo final : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class FrameInfo final : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); public: diff --git a/lib/ui/painting/gradient.cc b/lib/ui/painting/gradient.cc index 71b2669100fa1..9ec6f06304da3 100644 --- a/lib/ui/painting/gradient.cc +++ b/lib/ui/painting/gradient.cc @@ -6,10 +6,10 @@ #include "flutter/lib/ui/painting/gradient.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/painting/gradient.h b/lib/ui/painting/gradient.h index 4d8e8ec09191b..ae695c8dda610 100644 --- a/lib/ui/painting/gradient.h +++ b/lib/ui/painting/gradient.h @@ -5,13 +5,13 @@ #ifndef FLUTTER_LIB_UI_PAINTING_GRADIENT_H_ #define FLUTTER_LIB_UI_PAINTING_GRADIENT_H_ +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/matrix.h" #include "flutter/lib/ui/painting/shader.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float32_list.h" -#include "lib/tonic/typed_data/float64_list.h" -#include "lib/tonic/typed_data/int32_list.h" #include "third_party/skia/include/effects/SkGradientShader.h" +#include "third_party/tonic/typed_data/float32_list.h" +#include "third_party/tonic/typed_data/float64_list.h" +#include "third_party/tonic/typed_data/int32_list.h" namespace tonic { class DartLibraryNatives; diff --git a/lib/ui/painting/image.cc b/lib/ui/painting/image.cc index ef45856230ff0..d6ed502c033cd 100644 --- a/lib/ui/painting/image.cc +++ b/lib/ui/painting/image.cc @@ -5,10 +5,10 @@ #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/painting/image_encoding.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/painting/image.h b/lib/ui/painting/image.h index e92db979ed797..538c3af8986e6 100644 --- a/lib/ui/painting/image.h +++ b/lib/ui/painting/image.h @@ -6,8 +6,8 @@ #define FLUTTER_LIB_UI_PAINTING_IMAGE_H_ #include "flutter/flow/skia_gpu_object.h" +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/ui_dart_state.h" -#include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkImage.h" namespace tonic { @@ -16,8 +16,7 @@ class DartLibraryNatives; namespace blink { -class CanvasImage final : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class CanvasImage final : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(CanvasImage); diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index b6ce6f4157632..e403be9510c21 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -13,13 +13,13 @@ #include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/tonic/dart_persistent_value.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/typed_data/uint8_list.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkEncodedImageFormat.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSurface.h" +#include "third_party/tonic/dart_persistent_value.h" +#include "third_party/tonic/logging/dart_invoke.h" +#include "third_party/tonic/typed_data/uint8_list.h" using tonic::DartInvoke; using tonic::DartPersistentValue; @@ -41,7 +41,7 @@ enum ImageByteFormat { void InvokeDataCallback(std::unique_ptr callback, sk_sp buffer) { - tonic::DartState* dart_state = callback->dart_state().get(); + std::shared_ptr dart_state = callback->dart_state().lock(); if (!dart_state) { return; } diff --git a/lib/ui/painting/image_encoding.h b/lib/ui/painting/image_encoding.h index 2f7618db9854b..39e3144f12e07 100644 --- a/lib/ui/painting/image_encoding.h +++ b/lib/ui/painting/image_encoding.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_ENCODING_H_ #define FLUTTER_LIB_UI_PAINTING_IMAGE_ENCODING_H_ -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/painting/image_filter.cc b/lib/ui/painting/image_filter.cc index 910b91569ebfd..77cfeada86885 100644 --- a/lib/ui/painting/image_filter.cc +++ b/lib/ui/painting/image_filter.cc @@ -5,13 +5,13 @@ #include "flutter/lib/ui/painting/image_filter.h" #include "flutter/lib/ui/painting/matrix.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" #include "third_party/skia/include/effects/SkBlurImageFilter.h" #include "third_party/skia/include/effects/SkImageSource.h" #include "third_party/skia/include/effects/SkPictureImageFilter.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/painting/image_filter.h b/lib/ui/painting/image_filter.h index 0c3afa5c16dff..95d53ac85f0e8 100644 --- a/lib/ui/painting/image_filter.h +++ b/lib/ui/painting/image_filter.h @@ -5,16 +5,15 @@ #ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_FILTER_H_ #define FLUTTER_LIB_UI_PAINTING_IMAGE_FILTER_H_ +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/painting/picture.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float64_list.h" #include "third_party/skia/include/core/SkImageFilter.h" +#include "third_party/tonic/typed_data/float64_list.h" namespace blink { -class ImageFilter : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class ImageFilter : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(ImageFilter); diff --git a/lib/ui/painting/image_shader.cc b/lib/ui/painting/image_shader.cc index a4ddbba0ea24b..0094f565c9cea 100644 --- a/lib/ui/painting/image_shader.cc +++ b/lib/ui/painting/image_shader.cc @@ -5,10 +5,10 @@ #include "flutter/lib/ui/painting/image_shader.h" #include "flutter/lib/ui/ui_dart_state.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" using tonic::ToDart; diff --git a/lib/ui/painting/image_shader.h b/lib/ui/painting/image_shader.h index 1bdb310a59c85..6e031aebea3df 100644 --- a/lib/ui/painting/image_shader.h +++ b/lib/ui/painting/image_shader.h @@ -5,14 +5,14 @@ #ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_SHADER_H_ #define FLUTTER_LIB_UI_PAINTING_IMAGE_SHADER_H_ +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/gradient.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/painting/matrix.h" #include "flutter/lib/ui/painting/shader.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float64_list.h" #include "third_party/skia/include/core/SkMatrix.h" #include "third_party/skia/include/core/SkShader.h" +#include "third_party/tonic/typed_data/float64_list.h" namespace tonic { class DartLibraryNatives; diff --git a/lib/ui/painting/matrix.h b/lib/ui/painting/matrix.h index af59739209f37..25307b1b387c0 100644 --- a/lib/ui/painting/matrix.h +++ b/lib/ui/painting/matrix.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_MATRIX_H_ #define FLUTTER_LIB_UI_PAINTING_MATRIX_H_ -#include "lib/tonic/typed_data/float64_list.h" #include "third_party/skia/include/core/SkMatrix.h" +#include "third_party/tonic/typed_data/float64_list.h" namespace blink { diff --git a/lib/ui/painting/paint.cc b/lib/ui/painting/paint.cc index 2bb02b18bfe70..1c04f9781e9da 100644 --- a/lib/ui/painting/paint.cc +++ b/lib/ui/painting/paint.cc @@ -6,11 +6,11 @@ #include "flutter/lib/ui/painting/shader.h" #include "lib/fxl/logging.h" -#include "lib/tonic/typed_data/dart_byte_data.h" #include "third_party/skia/include/core/SkColorFilter.h" #include "third_party/skia/include/core/SkMaskFilter.h" #include "third_party/skia/include/core/SkShader.h" #include "third_party/skia/include/core/SkString.h" +#include "third_party/tonic/typed_data/dart_byte_data.h" namespace blink { @@ -140,7 +140,9 @@ Paint::Paint(Dart_Handle paint_objects, Dart_Handle paint_data) { namespace tonic { blink::Paint DartConverter::FromArguments( - Dart_NativeArguments args, int index, Dart_Handle& exception) { + Dart_NativeArguments args, + int index, + Dart_Handle& exception) { Dart_Handle paint_objects = Dart_GetNativeArgument(args, index); FXL_DCHECK(!LogIfError(paint_objects)); @@ -151,7 +153,9 @@ blink::Paint DartConverter::FromArguments( } blink::PaintData DartConverter::FromArguments( - Dart_NativeArguments args, int index, Dart_Handle& exception) { + Dart_NativeArguments args, + int index, + Dart_Handle& exception) { return blink::PaintData(); } diff --git a/lib/ui/painting/paint.h b/lib/ui/painting/paint.h index 29a0d359d2d37..2dd4ea14d91b6 100644 --- a/lib/ui/painting/paint.h +++ b/lib/ui/painting/paint.h @@ -5,8 +5,8 @@ #ifndef FLUTTER_LIB_UI_PAINTING_PAINT_H_ #define FLUTTER_LIB_UI_PAINTING_PAINT_H_ -#include "lib/tonic/converter/dart_converter.h" #include "third_party/skia/include/core/SkPaint.h" +#include "third_party/tonic/converter/dart_converter.h" namespace blink { diff --git a/lib/ui/painting/path.cc b/lib/ui/painting/path.cc index 2ef610648e650..a67ee9d2e3061 100644 --- a/lib/ui/painting/path.cc +++ b/lib/ui/painting/path.cc @@ -8,10 +8,10 @@ #include #include "flutter/lib/ui/painting/matrix.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" using tonic::ToDart; @@ -213,9 +213,14 @@ void CanvasPath::addPath(CanvasPath* path, double dx, double dy) { path_.addPath(path->path(), dx, dy, SkPath::kAppend_AddPathMode); } -void CanvasPath::addPathWithMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { - if (!path) - Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); +void CanvasPath::addPathWithMatrix(CanvasPath* path, + double dx, + double dy, + tonic::Float64List& matrix4) { + if (!path) { + Dart_ThrowException( + ToDart("Path.addPathWithMatrix called with non-genuine Path.")); + } SkMatrix matrix = ToSkMatrix(matrix4); matrix.setTranslateX(matrix.getTranslateX() + dx); @@ -231,9 +236,14 @@ void CanvasPath::extendWithPath(CanvasPath* path, double dx, double dy) { path_.addPath(path->path(), dx, dy, SkPath::kExtend_AddPathMode); } -void CanvasPath::extendWithPathAndMatrix(CanvasPath* path, double dx, double dy, tonic::Float64List& matrix4) { - if (!path) - Dart_ThrowException(ToDart("Path.addPathWithMatrix called with non-genuine Path.")); +void CanvasPath::extendWithPathAndMatrix(CanvasPath* path, + double dx, + double dy, + tonic::Float64List& matrix4) { + if (!path) { + Dart_ThrowException( + ToDart("Path.addPathWithMatrix called with non-genuine Path.")); + } SkMatrix matrix = ToSkMatrix(matrix4); matrix.setTranslateX(matrix.getTranslateX() + dx); @@ -277,7 +287,6 @@ tonic::Float32List CanvasPath::getBounds() { return rect; } - bool CanvasPath::op(CanvasPath* path1, CanvasPath* path2, int operation) { return Op(path1->path(), path2->path(), (SkPathOp)operation, &path_); } diff --git a/lib/ui/painting/path.h b/lib/ui/painting/path.h index 69ba8d9099912..c52d98cded0b2 100644 --- a/lib/ui/painting/path.h +++ b/lib/ui/painting/path.h @@ -5,12 +5,12 @@ #ifndef FLUTTER_LIB_UI_PAINTING_PATH_H_ #define FLUTTER_LIB_UI_PAINTING_PATH_H_ +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/rrect.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float32_list.h" -#include "lib/tonic/typed_data/float64_list.h" #include "third_party/skia/include/core/SkPath.h" #include "third_party/skia/include/pathops/SkPathOps.h" +#include "third_party/tonic/typed_data/float32_list.h" +#include "third_party/tonic/typed_data/float64_list.h" namespace tonic { class DartLibraryNatives; @@ -18,8 +18,7 @@ class DartLibraryNatives; namespace blink { -class CanvasPath : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class CanvasPath : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(CanvasPath); diff --git a/lib/ui/painting/path_measure.cc b/lib/ui/painting/path_measure.cc index e81e4b9c3b5d3..17922325d1686 100644 --- a/lib/ui/painting/path_measure.cc +++ b/lib/ui/painting/path_measure.cc @@ -8,10 +8,10 @@ #include #include "flutter/lib/ui/painting/matrix.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" using tonic::ToDart; diff --git a/lib/ui/painting/path_measure.h b/lib/ui/painting/path_measure.h index 7862081a88ec1..db8ef6b3e3d08 100644 --- a/lib/ui/painting/path_measure.h +++ b/lib/ui/painting/path_measure.h @@ -5,11 +5,11 @@ #ifndef FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ #define FLUTTER_LIB_UI_PAINTING_PATH_MEASURE_H_ +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/path.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float64_list.h" #include "third_party/skia/include/core/SkPath.h" #include "third_party/skia/include/core/SkPathMeasure.h" +#include "third_party/tonic/typed_data/float64_list.h" namespace tonic { class DartLibraryNatives; @@ -20,19 +20,21 @@ class DartLibraryNatives; namespace blink { -class CanvasPathMeasure : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class CanvasPathMeasure : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(CanvasPathMeasure); public: ~CanvasPathMeasure() override; - static fxl::RefPtr Create(const CanvasPath* path, bool forceClosed); + static fxl::RefPtr Create(const CanvasPath* path, + bool forceClosed); void setPath(const CanvasPath* path, bool isClosed); float getLength(); tonic::Float32List getPosTan(float distance); - fxl::RefPtr getSegment(float startD, float stopD, bool startWithMoveTo); + fxl::RefPtr getSegment(float startD, + float stopD, + bool startWithMoveTo); bool isClosed(); bool nextContour(); diff --git a/lib/ui/painting/picture.cc b/lib/ui/painting/picture.cc index 73e3a1625458f..096164de350e9 100644 --- a/lib/ui/painting/picture.cc +++ b/lib/ui/painting/picture.cc @@ -6,11 +6,11 @@ #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/ui_dart_state.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" #include "third_party/skia/include/core/SkImage.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/painting/picture.h b/lib/ui/painting/picture.h index d916086b02f02..1578fab7429be 100644 --- a/lib/ui/painting/picture.h +++ b/lib/ui/painting/picture.h @@ -6,8 +6,8 @@ #define FLUTTER_LIB_UI_PAINTING_PICTURE_H_ #include "flutter/flow/skia_gpu_object.h" +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/image.h" -#include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkPicture.h" namespace tonic { @@ -17,8 +17,7 @@ class DartLibraryNatives; namespace blink { class Canvas; -class Picture : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class Picture : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Picture); diff --git a/lib/ui/painting/picture_recorder.cc b/lib/ui/painting/picture_recorder.cc index e870e400a7230..af3fe130e8401 100644 --- a/lib/ui/painting/picture_recorder.cc +++ b/lib/ui/painting/picture_recorder.cc @@ -6,10 +6,10 @@ #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/painting/picture.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/painting/picture_recorder.h b/lib/ui/painting/picture_recorder.h index 61e83bd834516..328fdefd916bd 100644 --- a/lib/ui/painting/picture_recorder.h +++ b/lib/ui/painting/picture_recorder.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_LIB_UI_PAINTING_PICTURE_RECORDER_H_ #define FLUTTER_LIB_UI_PAINTING_PICTURE_RECORDER_H_ -#include "lib/tonic/dart_wrappable.h" +#include "flutter/lib/ui/dart_wrapper.h" #include "third_party/skia/include/core/SkPictureRecorder.h" namespace tonic { @@ -16,8 +16,7 @@ namespace blink { class Canvas; class Picture; -class PictureRecorder : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class PictureRecorder : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(PictureRecorder); diff --git a/lib/ui/painting/rrect.cc b/lib/ui/painting/rrect.cc index 3f1b6134ca3f5..ad2d0da5e66f3 100644 --- a/lib/ui/painting/rrect.cc +++ b/lib/ui/painting/rrect.cc @@ -5,8 +5,8 @@ #include "flutter/lib/ui/painting/rrect.h" #include "lib/fxl/logging.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/typed_data/float32_list.h" +#include "third_party/tonic/logging/dart_error.h" +#include "third_party/tonic/typed_data/float32_list.h" using namespace blink; diff --git a/lib/ui/painting/rrect.h b/lib/ui/painting/rrect.h index 54cf8f7c1aad1..c06769bfecc2c 100644 --- a/lib/ui/painting/rrect.h +++ b/lib/ui/painting/rrect.h @@ -5,9 +5,9 @@ #ifndef FLUTTER_LIB_UI_PAINTING_RRECT_H_ #define FLUTTER_LIB_UI_PAINTING_RRECT_H_ -#include "lib/tonic/converter/dart_converter.h" #include "third_party/dart/runtime/include/dart_api.h" #include "third_party/skia/include/core/SkRRect.h" +#include "third_party/tonic/converter/dart_converter.h" namespace blink { diff --git a/lib/ui/painting/shader.h b/lib/ui/painting/shader.h index 205197250eb84..8b1cdb2469581 100644 --- a/lib/ui/painting/shader.h +++ b/lib/ui/painting/shader.h @@ -6,14 +6,13 @@ #define FLUTTER_LIB_UI_PAINTING_SHADER_H_ #include "flutter/flow/skia_gpu_object.h" +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/ui_dart_state.h" -#include "lib/tonic/dart_wrappable.h" #include "third_party/skia/include/core/SkShader.h" namespace blink { -class Shader : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class Shader : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Shader); diff --git a/lib/ui/painting/vertices.cc b/lib/ui/painting/vertices.cc index 24b1577a349a6..542451fb8de9e 100644 --- a/lib/ui/painting/vertices.cc +++ b/lib/ui/painting/vertices.cc @@ -4,8 +4,8 @@ #include "flutter/lib/ui/painting/vertices.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { diff --git a/lib/ui/painting/vertices.h b/lib/ui/painting/vertices.h index 47b5133ae6a8c..8178e9763be09 100644 --- a/lib/ui/painting/vertices.h +++ b/lib/ui/painting/vertices.h @@ -5,10 +5,10 @@ #ifndef FLUTTER_LIB_UI_PAINTING_VERTICES_H_ #define FLUTTER_LIB_UI_PAINTING_VERTICES_H_ -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float32_list.h" -#include "lib/tonic/typed_data/int32_list.h" +#include "flutter/lib/ui/dart_wrapper.h" #include "third_party/skia/include/core/SkVertices.h" +#include "third_party/tonic/typed_data/float32_list.h" +#include "third_party/tonic/typed_data/int32_list.h" namespace tonic { class DartLibraryNatives; @@ -16,8 +16,7 @@ class DartLibraryNatives; namespace blink { -class Vertices : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class Vertices : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Vertices); diff --git a/lib/ui/plugins/callback_cache.cc b/lib/ui/plugins/callback_cache.cc index ad31891a2f90c..1799fcbc73ec5 100644 --- a/lib/ui/plugins/callback_cache.cc +++ b/lib/ui/plugins/callback_cache.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/plugins/callback_cache.h" #include "lib/fxl/logging.h" -#include "lib/tonic/converter/dart_converter.h" +#include "third_party/tonic/converter/dart_converter.h" using tonic::ToDart; diff --git a/lib/ui/semantics/custom_accessibility_action.h b/lib/ui/semantics/custom_accessibility_action.h index a5762b54aff20..07fe9a3c4a593 100644 --- a/lib/ui/semantics/custom_accessibility_action.h +++ b/lib/ui/semantics/custom_accessibility_action.h @@ -5,10 +5,10 @@ #ifndef FLUTTER_LIB_UI_SEMANTICS_CUSTOM_ACCESSIBILITY_ACTION_H_ #define FLUTTER_LIB_UI_SEMANTICS_CUSTOM_ACCESSIBILITY_ACTION_H_ -#include "lib/tonic/dart_library_natives.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float64_list.h" -#include "lib/tonic/typed_data/int32_list.h" +#include "third_party/tonic/dart_library_natives.h" +#include "third_party/tonic/dart_wrappable.h" +#include "third_party/tonic/typed_data/float64_list.h" +#include "third_party/tonic/typed_data/int32_list.h" namespace blink { diff --git a/lib/ui/semantics/semantics_update.cc b/lib/ui/semantics/semantics_update.cc index 4905d95f77469..9e655b392b2ee 100644 --- a/lib/ui/semantics/semantics_update.cc +++ b/lib/ui/semantics/semantics_update.cc @@ -7,10 +7,10 @@ #include #include "flutter/lib/ui/painting/matrix.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { @@ -23,7 +23,8 @@ DART_BIND_ALL(SemanticsUpdate, FOR_EACH_BINDING) fxl::RefPtr SemanticsUpdate::create( SemanticsNodeUpdates nodes, CustomAccessibilityActionUpdates actions) { - return fxl::MakeRefCounted(std::move(nodes), std::move(actions)); + return fxl::MakeRefCounted(std::move(nodes), + std::move(actions)); } SemanticsUpdate::SemanticsUpdate(SemanticsNodeUpdates nodes, diff --git a/lib/ui/semantics/semantics_update.h b/lib/ui/semantics/semantics_update.h index f6773239f41e6..f6984fea6e195 100644 --- a/lib/ui/semantics/semantics_update.h +++ b/lib/ui/semantics/semantics_update.h @@ -5,9 +5,9 @@ #ifndef FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_H_ #define FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_H_ -#include "flutter/lib/ui/semantics/semantics_node.h" +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/semantics/custom_accessibility_action.h" -#include "lib/tonic/dart_wrappable.h" +#include "flutter/lib/ui/semantics/semantics_node.h" namespace tonic { class DartLibraryNatives; @@ -15,15 +15,15 @@ class DartLibraryNatives; namespace blink { -class SemanticsUpdate : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class SemanticsUpdate : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(SemanticsUpdate); public: ~SemanticsUpdate() override; - static fxl::RefPtr create(SemanticsNodeUpdates nodes, - CustomAccessibilityActionUpdates actions); + static fxl::RefPtr create( + SemanticsNodeUpdates nodes, + CustomAccessibilityActionUpdates actions); SemanticsNodeUpdates takeNodes(); diff --git a/lib/ui/semantics/semantics_update_builder.cc b/lib/ui/semantics/semantics_update_builder.cc index c39423a358a0a..6950250761bb4 100644 --- a/lib/ui/semantics/semantics_update_builder.cc +++ b/lib/ui/semantics/semantics_update_builder.cc @@ -4,10 +4,10 @@ #include "flutter/lib/ui/semantics/semantics_update_builder.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { @@ -17,8 +17,8 @@ static void SemanticsUpdateBuilder_constructor(Dart_NativeArguments args) { IMPLEMENT_WRAPPERTYPEINFO(ui, SemanticsUpdateBuilder); -#define FOR_EACH_BINDING(V) \ - V(SemanticsUpdateBuilder, updateNode) \ +#define FOR_EACH_BINDING(V) \ + V(SemanticsUpdateBuilder, updateNode) \ V(SemanticsUpdateBuilder, updateCustomAction) \ V(SemanticsUpdateBuilder, build) @@ -35,28 +35,29 @@ SemanticsUpdateBuilder::SemanticsUpdateBuilder() = default; SemanticsUpdateBuilder::~SemanticsUpdateBuilder() = default; -void SemanticsUpdateBuilder::updateNode(int id, - int flags, - int actions, - int textSelectionBase, - int textSelectionExtent, - double scrollPosition, - double scrollExtentMax, - double scrollExtentMin, - double left, - double top, - double right, - double bottom, - std::string label, - std::string hint, - std::string value, - std::string increasedValue, - std::string decreasedValue, - int textDirection, - const tonic::Float64List& transform, - const tonic::Int32List& childrenInTraversalOrder, - const tonic::Int32List& childrenInHitTestOrder, - const tonic::Int32List& localContextActions) { +void SemanticsUpdateBuilder::updateNode( + int id, + int flags, + int actions, + int textSelectionBase, + int textSelectionExtent, + double scrollPosition, + double scrollExtentMax, + double scrollExtentMin, + double left, + double top, + double right, + double bottom, + std::string label, + std::string hint, + std::string value, + std::string increasedValue, + std::string decreasedValue, + int textDirection, + const tonic::Float64List& transform, + const tonic::Int32List& childrenInTraversalOrder, + const tonic::Int32List& childrenInHitTestOrder, + const tonic::Int32List& localContextActions) { SemanticsNode node; node.id = id; node.flags = flags; @@ -74,17 +75,20 @@ void SemanticsUpdateBuilder::updateNode(int id, node.decreasedValue = decreasedValue; node.textDirection = textDirection; node.transform.setColMajord(transform.data()); - node.childrenInTraversalOrder = std::vector( - childrenInTraversalOrder.data(), childrenInTraversalOrder.data() + childrenInTraversalOrder.num_elements()); + node.childrenInTraversalOrder = + std::vector(childrenInTraversalOrder.data(), + childrenInTraversalOrder.data() + + childrenInTraversalOrder.num_elements()); node.childrenInHitTestOrder = std::vector( - childrenInHitTestOrder.data(), childrenInHitTestOrder.data() + childrenInHitTestOrder.num_elements()); + childrenInHitTestOrder.data(), + childrenInHitTestOrder.data() + childrenInHitTestOrder.num_elements()); node.customAccessibilityActions = std::vector( - localContextActions.data(), localContextActions.data() + localContextActions.num_elements()); + localContextActions.data(), + localContextActions.data() + localContextActions.num_elements()); nodes_[id] = node; } -void SemanticsUpdateBuilder::updateCustomAction(int id, - std::string label) { +void SemanticsUpdateBuilder::updateCustomAction(int id, std::string label) { CustomAccessibilityAction action; action.id = id; action.label = label; diff --git a/lib/ui/semantics/semantics_update_builder.h b/lib/ui/semantics/semantics_update_builder.h index 307590b57365e..b02a1d1a4dd59 100644 --- a/lib/ui/semantics/semantics_update_builder.h +++ b/lib/ui/semantics/semantics_update_builder.h @@ -5,16 +5,15 @@ #ifndef FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_BUILDER_H_ #define FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_BUILDER_H_ +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/semantics/semantics_update.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/float64_list.h" -#include "lib/tonic/typed_data/int32_list.h" +#include "third_party/tonic/typed_data/float64_list.h" +#include "third_party/tonic/typed_data/int32_list.h" namespace blink { class SemanticsUpdateBuilder - : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { + : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(SemanticsUpdateBuilder); diff --git a/lib/ui/text/paragraph.cc b/lib/ui/text/paragraph.cc index 22871b9947e93..b26b0b94f0b1b 100644 --- a/lib/ui/text/paragraph.cc +++ b/lib/ui/text/paragraph.cc @@ -8,10 +8,10 @@ #include "flutter/common/task_runners.h" #include "lib/fxl/logging.h" #include "lib/fxl/tasks/task_runner.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" using tonic::ToDart; diff --git a/lib/ui/text/paragraph.h b/lib/ui/text/paragraph.h index 473e9bb9dd11d..2b6ebf561faec 100644 --- a/lib/ui/text/paragraph.h +++ b/lib/ui/text/paragraph.h @@ -6,12 +6,12 @@ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_H_ #include "flutter/fml/message_loop.h" +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/canvas.h" #include "flutter/lib/ui/text/paragraph_impl.h" #include "flutter/lib/ui/text/paragraph_impl_txt.h" #include "flutter/lib/ui/text/text_box.h" #include "flutter/third_party/txt/src/txt/paragraph.h" -#include "lib/tonic/dart_wrappable.h" namespace tonic { class DartLibraryNatives; @@ -19,8 +19,7 @@ class DartLibraryNatives; namespace blink { -class Paragraph : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class Paragraph : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(Paragraph); diff --git a/lib/ui/text/paragraph_builder.cc b/lib/ui/text/paragraph_builder.cc index 80cc817c1bd60..47c97e6aab63e 100644 --- a/lib/ui/text/paragraph_builder.cc +++ b/lib/ui/text/paragraph_builder.cc @@ -15,11 +15,11 @@ #include "flutter/third_party/txt/src/txt/text_decoration.h" #include "flutter/third_party/txt/src/txt/text_style.h" #include "lib/fxl/tasks/task_runner.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_binding_macros.h" -#include "lib/tonic/dart_library_natives.h" #include "third_party/icu/source/common/unicode/ustring.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_binding_macros.h" +#include "third_party/tonic/dart_library_natives.h" namespace blink { namespace { diff --git a/lib/ui/text/paragraph_builder.h b/lib/ui/text/paragraph_builder.h index 723c3d78fd12d..82d88cc3ee06e 100644 --- a/lib/ui/text/paragraph_builder.h +++ b/lib/ui/text/paragraph_builder.h @@ -6,11 +6,11 @@ #define FLUTTER_LIB_UI_TEXT_PARAGRAPH_BUILDER_H_ #include +#include "flutter/lib/ui/dart_wrapper.h" #include "flutter/lib/ui/painting/paint.h" #include "flutter/lib/ui/text/paragraph.h" #include "flutter/third_party/txt/src/txt/paragraph_builder.h" -#include "lib/tonic/dart_wrappable.h" -#include "lib/tonic/typed_data/int32_list.h" +#include "third_party/tonic/typed_data/int32_list.h" namespace tonic { class DartLibraryNatives; @@ -20,8 +20,7 @@ namespace blink { class Paragraph; -class ParagraphBuilder : public fxl::RefCountedThreadSafe, - public tonic::DartWrappable { +class ParagraphBuilder : public RefCountedDartWrappable { DEFINE_WRAPPERTYPEINFO(); FRIEND_MAKE_REF_COUNTED(ParagraphBuilder); diff --git a/lib/ui/text/paragraph_impl_txt.cc b/lib/ui/text/paragraph_impl_txt.cc index 28c6ea19a8157..374f8d95d7727 100644 --- a/lib/ui/text/paragraph_impl_txt.cc +++ b/lib/ui/text/paragraph_impl_txt.cc @@ -9,8 +9,8 @@ #include "flutter/lib/ui/text/paragraph_impl.h" #include "lib/fxl/logging.h" #include "lib/fxl/tasks/task_runner.h" -#include "lib/tonic/converter/dart_converter.h" #include "third_party/skia/include/core/SkPoint.h" +#include "third_party/tonic/converter/dart_converter.h" using tonic::ToDart; diff --git a/lib/ui/text/text_box.cc b/lib/ui/text/text_box.cc index 5c9c269351b4b..6cfdab2bfbf73 100644 --- a/lib/ui/text/text_box.cc +++ b/lib/ui/text/text_box.cc @@ -5,9 +5,9 @@ #include "flutter/lib/ui/text/text_box.h" #include "lib/fxl/logging.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/logging/dart_error.h" +#include "third_party/tonic/dart_class_library.h" +#include "third_party/tonic/dart_state.h" +#include "third_party/tonic/logging/dart_error.h" using namespace blink; diff --git a/lib/ui/text/text_box.h b/lib/ui/text/text_box.h index d7acd3e507fba..839142ddcba8d 100644 --- a/lib/ui/text/text_box.h +++ b/lib/ui/text/text_box.h @@ -5,9 +5,9 @@ #ifndef FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ #define FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ -#include "lib/tonic/converter/dart_converter.h" #include "third_party/dart/runtime/include/dart_api.h" #include "third_party/skia/include/core/SkRect.h" +#include "third_party/tonic/converter/dart_converter.h" namespace blink { diff --git a/lib/ui/ui_dart_state.cc b/lib/ui/ui_dart_state.cc index 24de9180ed210..863870f4b23d7 100644 --- a/lib/ui/ui_dart_state.cc +++ b/lib/ui/ui_dart_state.cc @@ -6,8 +6,8 @@ #include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/window.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_message_handler.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_message_handler.h" using tonic::ToDart; diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index 88b56b2cf08c2..597031ca7be17 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -15,11 +15,11 @@ #include "flutter/fml/memory/weak_ptr.h" #include "flutter/lib/ui/isolate_name_server/isolate_name_server.h" #include "lib/fxl/build_config.h" -#include "lib/tonic/dart_microtask_queue.h" -#include "lib/tonic/dart_persistent_value.h" -#include "lib/tonic/dart_state.h" #include "third_party/dart/runtime/include/dart_api.h" #include "third_party/skia/include/gpu/GrContext.h" +#include "third_party/tonic/dart_microtask_queue.h" +#include "third_party/tonic/dart_persistent_value.h" +#include "third_party/tonic/dart_state.h" namespace blink { class FontSelector; diff --git a/lib/ui/window/platform_message_response_dart.cc b/lib/ui/window/platform_message_response_dart.cc index 59660fe8d1081..f6c21b5d5aacf 100644 --- a/lib/ui/window/platform_message_response_dart.cc +++ b/lib/ui/window/platform_message_response_dart.cc @@ -9,8 +9,8 @@ #include "flutter/common/task_runners.h" #include "flutter/lib/ui/window/window.h" #include "lib/fxl/functional/make_copyable.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/logging/dart_invoke.h" +#include "third_party/tonic/dart_state.h" +#include "third_party/tonic/logging/dart_invoke.h" namespace blink { @@ -55,10 +55,8 @@ PlatformMessageResponseDart::PlatformMessageResponseDart( PlatformMessageResponseDart::~PlatformMessageResponseDart() { if (!callback_.is_empty()) { - ui_task_runner_->PostTask( - fxl::MakeCopyable([callback = std::move(callback_)]() mutable { - callback.Clear(); - })); + ui_task_runner_->PostTask(fxl::MakeCopyable( + [callback = std::move(callback_)]() mutable { callback.Clear(); })); } } @@ -68,8 +66,9 @@ void PlatformMessageResponseDart::Complete(std::unique_ptr data) { FXL_DCHECK(!is_complete_); is_complete_ = true; ui_task_runner_->PostTask(fxl::MakeCopyable( - [ callback = std::move(callback_), data = std::move(data) ]() mutable { - tonic::DartState* dart_state = callback.dart_state().get(); + [callback = std::move(callback_), data = std::move(data)]() mutable { + std::shared_ptr dart_state = + callback.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); @@ -86,7 +85,8 @@ void PlatformMessageResponseDart::CompleteEmpty() { is_complete_ = true; ui_task_runner_->PostTask( fxl::MakeCopyable([callback = std::move(callback_)]() mutable { - tonic::DartState* dart_state = callback.dart_state().get(); + std::shared_ptr dart_state = + callback.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); diff --git a/lib/ui/window/platform_message_response_dart.h b/lib/ui/window/platform_message_response_dart.h index 1d65c82b65828..bb29df7446d74 100644 --- a/lib/ui/window/platform_message_response_dart.h +++ b/lib/ui/window/platform_message_response_dart.h @@ -7,7 +7,7 @@ #include "flutter/fml/message_loop.h" #include "flutter/lib/ui/window/platform_message_response.h" -#include "lib/tonic/dart_persistent_value.h" +#include "third_party/tonic/dart_persistent_value.h" namespace blink { diff --git a/lib/ui/window/window.cc b/lib/ui/window/window.cc index 3afbe602ad6d8..160a9f2e03cfb 100644 --- a/lib/ui/window/window.cc +++ b/lib/ui/window/window.cc @@ -7,12 +7,12 @@ #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/platform_message_response_dart.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_args.h" -#include "lib/tonic/dart_library_natives.h" -#include "lib/tonic/dart_microtask_queue.h" -#include "lib/tonic/logging/dart_invoke.h" -#include "lib/tonic/typed_data/dart_byte_data.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_args.h" +#include "third_party/tonic/dart_library_natives.h" +#include "third_party/tonic/dart_microtask_queue.h" +#include "third_party/tonic/logging/dart_invoke.h" +#include "third_party/tonic/typed_data/dart_byte_data.h" using tonic::DartInvokeField; using tonic::DartState; @@ -142,7 +142,7 @@ void Window::DidCreateIsolate() { void Window::UpdateWindowMetrics(const ViewportMetrics& metrics) { viewport_metrics_ = metrics; - tonic::DartState* dart_state = library_.dart_state().get(); + std::shared_ptr dart_state = library_.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); @@ -164,7 +164,7 @@ void Window::UpdateWindowMetrics(const ViewportMetrics& metrics) { void Window::UpdateLocale(const std::string& language_code, const std::string& country_code) { - tonic::DartState* dart_state = library_.dart_state().get(); + std::shared_ptr dart_state = library_.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); @@ -177,7 +177,7 @@ void Window::UpdateLocale(const std::string& language_code, } void Window::UpdateUserSettingsData(const std::string& data) { - tonic::DartState* dart_state = library_.dart_state().get(); + std::shared_ptr dart_state = library_.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); @@ -189,7 +189,7 @@ void Window::UpdateUserSettingsData(const std::string& data) { } void Window::UpdateSemanticsEnabled(bool enabled) { - tonic::DartState* dart_state = library_.dart_state().get(); + std::shared_ptr dart_state = library_.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); @@ -199,7 +199,7 @@ void Window::UpdateSemanticsEnabled(bool enabled) { } void Window::UpdateAssistiveTechnologyEnabled(bool enabled) { - tonic::DartState* dart_state = library_.dart_state().get(); + std::shared_ptr dart_state = library_.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); @@ -209,7 +209,7 @@ void Window::UpdateAssistiveTechnologyEnabled(bool enabled) { } void Window::DispatchPlatformMessage(fxl::RefPtr message) { - tonic::DartState* dart_state = library_.dart_state().get(); + std::shared_ptr dart_state = library_.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); @@ -230,7 +230,7 @@ void Window::DispatchPlatformMessage(fxl::RefPtr message) { } void Window::DispatchPointerDataPacket(const PointerDataPacket& packet) { - tonic::DartState* dart_state = library_.dart_state().get(); + std::shared_ptr dart_state = library_.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); @@ -245,7 +245,7 @@ void Window::DispatchPointerDataPacket(const PointerDataPacket& packet) { void Window::DispatchSemanticsAction(int32_t id, SemanticsAction action, std::vector args) { - tonic::DartState* dart_state = library_.dart_state().get(); + std::shared_ptr dart_state = library_.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); @@ -261,7 +261,7 @@ void Window::DispatchSemanticsAction(int32_t id, } void Window::BeginFrame(fxl::TimePoint frameTime) { - tonic::DartState* dart_state = library_.dart_state().get(); + std::shared_ptr dart_state = library_.dart_state().lock(); if (!dart_state) return; tonic::DartState::Scope scope(dart_state); diff --git a/lib/ui/window/window.h b/lib/ui/window/window.h index e10fb8503a6a6..650bb18f2e0df 100644 --- a/lib/ui/window/window.h +++ b/lib/ui/window/window.h @@ -12,8 +12,8 @@ #include "flutter/lib/ui/window/pointer_data_packet.h" #include "flutter/lib/ui/window/viewport_metrics.h" #include "lib/fxl/time/time_point.h" -#include "lib/tonic/dart_persistent_value.h" #include "third_party/skia/include/gpu/GrContext.h" +#include "third_party/tonic/dart_persistent_value.h" namespace tonic { class DartLibraryNatives; diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 7ec76542fb1c7..fd649a3448f00 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -99,7 +99,7 @@ source_set("runtime") { "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/rapidjson", "//third_party/skia", - "//topaz/lib/tonic", + "//third_party/tonic", ] public_configs = [ "$flutter_root:config" ] @@ -134,7 +134,7 @@ executable("runtime_unittests") { "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", "//third_party/skia", - "//topaz/lib/tonic", + "//third_party/tonic", ] if (is_linux) { diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 1b887a7748731..bd2c23505411b 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -14,17 +14,17 @@ #include "flutter/runtime/dart_service_isolate.h" #include "flutter/runtime/dart_vm.h" #include "lib/fxl/files/path.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_class_provider.h" -#include "lib/tonic/dart_message_handler.h" -#include "lib/tonic/dart_state.h" -#include "lib/tonic/dart_sticky_error.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/scopes/dart_isolate_scope.h" #include "third_party/dart/runtime/include/dart_api.h" #include "third_party/dart/runtime/include/dart_tools_api.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_class_library.h" +#include "third_party/tonic/dart_class_provider.h" +#include "third_party/tonic/dart_message_handler.h" +#include "third_party/tonic/dart_state.h" +#include "third_party/tonic/dart_sticky_error.h" +#include "third_party/tonic/file_loader/file_loader.h" +#include "third_party/tonic/scopes/dart_api_scope.h" +#include "third_party/tonic/scopes/dart_isolate_scope.h" #ifdef ERROR #undef ERROR @@ -32,7 +32,7 @@ namespace blink { -fml::WeakPtr DartIsolate::CreateRootIsolate( +std::weak_ptr DartIsolate::CreateRootIsolate( DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, @@ -45,25 +45,26 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( Dart_IsolateFlags* flags) { TRACE_EVENT0("flutter", "DartIsolate::CreateRootIsolate"); Dart_Isolate vm_isolate = nullptr; - fml::WeakPtr embedder_isolate; + std::weak_ptr embedder_isolate; char* error = nullptr; // Since this is the root isolate, we fake a parent embedder data object. We // cannot use unique_ptr here because the destructor is private (since the // isolate lifecycle is entirely managed by the VM). - auto root_embedder_data = std::make_unique( - vm, // VM - std::move(isolate_snapshot), // isolate snapshot - std::move(shared_snapshot), // shared snapshot - task_runners, // task runners - std::move(resource_context), // resource context - std::move(unref_queue), // skia unref queue - advisory_script_uri, // advisory URI - advisory_script_entrypoint, // advisory entrypoint - nullptr // child isolate preparer will be set when this isolate is - // prepared to run - ); + auto root_embedder_data = std::make_unique>( + std::make_shared( + vm, // VM + std::move(isolate_snapshot), // isolate snapshot + std::move(shared_snapshot), // shared snapshot + task_runners, // task runners + std::move(resource_context), // resource context + std::move(unref_queue), // skia unref queue + advisory_script_uri, // advisory URI + advisory_script_entrypoint, // advisory entrypoint + nullptr // child isolate preparer will be set when this isolate is + // prepared to run + )); std::tie(vm_isolate, embedder_isolate) = CreateDartVMAndEmbedderObjectPair( advisory_script_uri.c_str(), // advisory script URI @@ -84,9 +85,11 @@ fml::WeakPtr DartIsolate::CreateRootIsolate( return {}; } - if (embedder_isolate) { + std::shared_ptr shared_embedder_isolate = + embedder_isolate.lock(); + if (shared_embedder_isolate) { // Only root isolates can interact with windows. - embedder_isolate->SetWindow(std::move(window)); + shared_embedder_isolate->SetWindow(std::move(window)); } root_embedder_data.release(); @@ -115,8 +118,7 @@ DartIsolate::DartIsolate(DartVM* vm, vm_(vm), isolate_snapshot_(std::move(isolate_snapshot)), shared_snapshot_(std::move(shared_snapshot)), - child_isolate_preparer_(std::move(child_isolate_preparer)), - weak_factory_(std::make_unique>(this)) { + child_isolate_preparer_(std::move(child_isolate_preparer)) { FXL_DCHECK(isolate_snapshot_) << "Must contain a valid isolate snapshot."; if (vm_ == nullptr) { @@ -150,7 +152,9 @@ bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { return false; } - if (Dart_IsolateData(dart_isolate) != this) { + auto isolate_data = static_cast*>( + Dart_IsolateData(dart_isolate)); + if (isolate_data->get() != this) { return false; } @@ -168,8 +172,12 @@ bool DartIsolate::Initialize(Dart_Isolate dart_isolate, bool is_root_isolate) { if (is_root_isolate) { if (auto task_runner = GetTaskRunners().GetUITaskRunner()) { // Isolates may not have any particular thread affinity. Only initialize - // the message handler if a task runner is explicitly specified. - message_handler().Initialize(task_runner); + // the task dispatcher if a task runner is explicitly specified. + tonic::DartMessageHandler::TaskDispatcher dispatcher = + [task_runner](std::function task) { + task_runner->PostTask(task); + }; + message_handler().Initialize(dispatcher); } } @@ -576,7 +584,7 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( flags->load_vmservice_library = true; - fml::WeakPtr weak_service_isolate = + std::weak_ptr weak_service_isolate = DartIsolate::CreateRootIsolate( vm.get(), // vm vm->GetIsolateSnapshot(), // isolate snapshot @@ -593,7 +601,8 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( flags // flags ); - if (!weak_service_isolate) { + std::shared_ptr service_isolate = weak_service_isolate.lock(); + if (!service_isolate) { *error = strdup("Could not create the service isolate."); FXL_DLOG(ERROR) << *error; return nullptr; @@ -602,13 +611,6 @@ Dart_Isolate DartIsolate::DartCreateAndStartServiceIsolate( // The engine never holds a strong reference to the VM service isolate. Since // we are about to lose our last weak reference to it, start the VM service // while we have this reference. - DartIsolate* service_isolate = weak_service_isolate.get(); - - // The service isolate is created and destroyed on arbitrary Dart pool threads - // and can not support a weak pointer factory that must be bound to a specific - // thread. - service_isolate->ResetWeakPtrFactory(); - const bool isolate_snapshot_is_dart_2 = Dart_IsDart2Snapshot( vm->GetIsolateSnapshot()->GetData()->GetSnapshotPointer()); const bool is_preview_dart2 = @@ -642,7 +644,7 @@ Dart_Isolate DartIsolate::DartIsolateCreateCallback( const char* package_root, const char* package_config, Dart_IsolateFlags* flags, - DartIsolate* parent_embedder_isolate, + std::shared_ptr* parent_embedder_isolate, char** error) { if (parent_embedder_isolate == nullptr && strcmp(advisory_script_uri, DART_VM_SERVICE_ISOLATE_NAME) == 0) { @@ -673,28 +675,30 @@ Dart_Isolate DartIsolate::DartIsolateCreateCallback( .first; } -std::pair> +std::pair> DartIsolate::CreateDartVMAndEmbedderObjectPair( const char* advisory_script_uri, const char* advisory_script_entrypoint, const char* package_root, const char* package_config, Dart_IsolateFlags* flags, - DartIsolate* p_parent_embedder_isolate, + std::shared_ptr* p_parent_embedder_isolate, bool is_root_isolate, char** error) { TRACE_EVENT0("flutter", "DartIsolate::CreateDartVMAndEmbedderObjectPair"); - std::unique_ptr embedder_isolate{p_parent_embedder_isolate}; + std::unique_ptr> embedder_isolate( + p_parent_embedder_isolate); - if (embedder_isolate == nullptr || embedder_isolate->GetDartVM() == nullptr) { + if (embedder_isolate == nullptr || + (*embedder_isolate)->GetDartVM() == nullptr) { *error = strdup("Parent isolate did not have embedder specific callback data."); FXL_DLOG(ERROR) << *error; return {nullptr, {}}; } - DartVM* const vm = embedder_isolate->GetDartVM(); + DartVM* const vm = (*embedder_isolate)->GetDartVM(); if (!is_root_isolate) { auto raw_embedder_isolate = embedder_isolate.release(); @@ -702,17 +706,17 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( blink::TaskRunners null_task_runners(advisory_script_uri, nullptr, nullptr, nullptr, nullptr); - embedder_isolate = std::make_unique( - vm, // vm - raw_embedder_isolate->GetIsolateSnapshot(), // isolate_snapshot - raw_embedder_isolate->GetSharedSnapshot(), // shared_snapshot - null_task_runners, // task_runners - fml::WeakPtr{}, // resource_context - nullptr, // unref_queue - advisory_script_uri, // advisory_script_uri - advisory_script_entrypoint, // advisory_script_entrypoint - raw_embedder_isolate->child_isolate_preparer_ // child isolate preparer - ); + embedder_isolate = std::make_unique>( + std::make_shared( + vm, // vm + (*raw_embedder_isolate)->GetIsolateSnapshot(), // isolate_snapshot + (*raw_embedder_isolate)->GetSharedSnapshot(), // shared_snapshot + null_task_runners, // task_runners + fml::WeakPtr{}, // resource_context + nullptr, // unref_queue + advisory_script_uri, // advisory_script_uri + advisory_script_entrypoint, // advisory_script_entrypoint + (*raw_embedder_isolate)->child_isolate_preparer_)); } // Create the Dart VM isolate and give it the embedder object as the baton. @@ -728,52 +732,51 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( error // ) : Dart_CreateIsolate( - advisory_script_uri, // - advisory_script_entrypoint, // - embedder_isolate->GetIsolateSnapshot() + advisory_script_uri, advisory_script_entrypoint, + (*embedder_isolate) + ->GetIsolateSnapshot() ->GetData() - ->GetSnapshotPointer(), // - embedder_isolate->GetIsolateSnapshot() - ->GetInstructionsIfPresent(), // - embedder_isolate->GetSharedSnapshot()->GetDataIfPresent(), // - embedder_isolate->GetSharedSnapshot() - ->GetInstructionsIfPresent(), // - flags, // - embedder_isolate.get(), // - error // - ); + ->GetSnapshotPointer(), + (*embedder_isolate) + ->GetIsolateSnapshot() + ->GetInstructionsIfPresent(), + (*embedder_isolate)->GetSharedSnapshot()->GetDataIfPresent(), + (*embedder_isolate) + ->GetSharedSnapshot() + ->GetInstructionsIfPresent(), + flags, embedder_isolate.get(), error); if (isolate == nullptr) { FXL_DLOG(ERROR) << *error; return {nullptr, {}}; } - if (!embedder_isolate->Initialize(isolate, is_root_isolate)) { + if (!(*embedder_isolate)->Initialize(isolate, is_root_isolate)) { *error = strdup("Embedder could not initialize the Dart isolate."); FXL_DLOG(ERROR) << *error; return {nullptr, {}}; } - if (!embedder_isolate->LoadLibraries(is_root_isolate)) { + if (!(*embedder_isolate)->LoadLibraries(is_root_isolate)) { *error = strdup("Embedder could not load libraries in the new Dart isolate."); FXL_DLOG(ERROR) << *error; return {nullptr, {}}; } - auto weak_embedder_isolate = embedder_isolate->GetWeakIsolatePtr(); + auto weak_embedder_isolate = (*embedder_isolate)->GetWeakIsolatePtr(); // Root isolates will be setup by the engine and the service isolate (which is // also a root isolate) by the utility routines in the VM. However, secondary // isolates will be run by the VM if they are marked as runnable. if (!is_root_isolate) { - FXL_DCHECK(embedder_isolate->child_isolate_preparer_); - if (!embedder_isolate->child_isolate_preparer_(embedder_isolate.get())) { + FXL_DCHECK((*embedder_isolate)->child_isolate_preparer_); + if (!(*embedder_isolate) + ->child_isolate_preparer_((*embedder_isolate).get())) { *error = strdup("Could not prepare the child isolate to run."); FXL_DLOG(ERROR) << *error; return {nullptr, {}}; } - embedder_isolate->ResetWeakPtrFactory(); } // The ownership of the embedder object is controlled by the Dart VM. So the @@ -783,7 +786,8 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( } // |Dart_IsolateShutdownCallback| -void DartIsolate::DartIsolateShutdownCallback(DartIsolate* embedder_isolate) { +void DartIsolate::DartIsolateShutdownCallback( + std::shared_ptr* embedder_isolate) { if (!tonic::DartStickyError::IsSet()) { return; } @@ -796,7 +800,8 @@ void DartIsolate::DartIsolateShutdownCallback(DartIsolate* embedder_isolate) { } // |Dart_IsolateCleanupCallback| -void DartIsolate::DartIsolateCleanupCallback(DartIsolate* embedder_isolate) { +void DartIsolate::DartIsolateCleanupCallback( + std::shared_ptr* embedder_isolate) { delete embedder_isolate; } @@ -808,14 +813,8 @@ fxl::RefPtr DartIsolate::GetSharedSnapshot() const { return shared_snapshot_; } -fml::WeakPtr DartIsolate::GetWeakIsolatePtr() const { - return weak_factory_ ? weak_factory_->GetWeakPtr() - : fml::WeakPtr(); -} - -void DartIsolate::ResetWeakPtrFactory() { - FXL_CHECK(weak_factory_); - weak_factory_.reset(); +std::weak_ptr DartIsolate::GetWeakIsolatePtr() { + return std::static_pointer_cast(shared_from_this()); } void DartIsolate::AddIsolateShutdownCallback(fxl::Closure closure) { diff --git a/runtime/dart_isolate.h b/runtime/dart_isolate.h index 6ed4b04d415d2..b19c59fcd0084 100644 --- a/runtime/dart_isolate.h +++ b/runtime/dart_isolate.h @@ -15,8 +15,8 @@ #include "flutter/runtime/dart_snapshot.h" #include "lib/fxl/compiler_specific.h" #include "lib/fxl/macros.h" -#include "lib/tonic/dart_state.h" #include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/tonic/dart_state.h" namespace blink { class DartVM; @@ -38,7 +38,7 @@ class DartIsolate : public UIDartState { // The root isolate of a Flutter application is special because it gets Window // bindings. From the VM's perspective, this isolate is not special in any // way. - static fml::WeakPtr CreateRootIsolate( + static std::weak_ptr CreateRootIsolate( DartVM* vm, fxl::RefPtr isolate_snapshot, fxl::RefPtr shared_snapshot, @@ -93,7 +93,7 @@ class DartIsolate : public UIDartState { fxl::RefPtr GetIsolateSnapshot() const; fxl::RefPtr GetSharedSnapshot() const; - fml::WeakPtr GetWeakIsolatePtr() const; + std::weak_ptr GetWeakIsolatePtr(); private: bool LoadScriptSnapshot(std::shared_ptr mapping, @@ -125,7 +125,6 @@ class DartIsolate : public UIDartState { std::vector> kernel_buffers_; std::vector> shutdown_callbacks_; ChildIsolatePreparer child_isolate_preparer_; - std::unique_ptr> weak_factory_; FXL_WARN_UNUSED_RESULT bool Initialize(Dart_Isolate isolate, bool is_root_isolate); @@ -138,8 +137,6 @@ class DartIsolate : public UIDartState { FXL_WARN_UNUSED_RESULT bool MarkIsolateRunnable(); - void ResetWeakPtrFactory(); - // |Dart_IsolateCreateCallback| static Dart_Isolate DartIsolateCreateCallback( const char* advisory_script_uri, @@ -147,7 +144,7 @@ class DartIsolate : public UIDartState { const char* package_root, const char* package_config, Dart_IsolateFlags* flags, - DartIsolate* embedder_isolate, + std::shared_ptr* embedder_isolate, char** error); static Dart_Isolate DartCreateAndStartServiceIsolate( @@ -159,21 +156,24 @@ class DartIsolate : public UIDartState { char** error); static std::pair /* embedder */> - CreateDartVMAndEmbedderObjectPair(const char* advisory_script_uri, - const char* advisory_script_entrypoint, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - DartIsolate* parent_embedder_isolate, - bool is_root_isolate, - char** error); + std::weak_ptr /* embedder */> + CreateDartVMAndEmbedderObjectPair( + const char* advisory_script_uri, + const char* advisory_script_entrypoint, + const char* package_root, + const char* package_config, + Dart_IsolateFlags* flags, + std::shared_ptr* parent_embedder_isolate, + bool is_root_isolate, + char** error); // |Dart_IsolateShutdownCallback| - static void DartIsolateShutdownCallback(DartIsolate* embedder_isolate); + static void DartIsolateShutdownCallback( + std::shared_ptr* embedder_isolate); // |Dart_IsolateCleanupCallback| - static void DartIsolateCleanupCallback(DartIsolate* embedder_isolate); + static void DartIsolateCleanupCallback( + std::shared_ptr* embedder_isolate); FXL_DISALLOW_COPY_AND_ASSIGN(DartIsolate); }; diff --git a/runtime/dart_isolate_unittests.cc b/runtime/dart_isolate_unittests.cc index c367484f4f48e..8a0de50acca0f 100644 --- a/runtime/dart_isolate_unittests.cc +++ b/runtime/dart_isolate_unittests.cc @@ -29,7 +29,7 @@ TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) { GetCurrentTaskRunner(), // GetCurrentTaskRunner() // ); - auto root_isolate = DartIsolate::CreateRootIsolate( + auto weak_isolate = DartIsolate::CreateRootIsolate( vm.get(), // vm vm->GetIsolateSnapshot(), // isolate snapshot vm->GetSharedSnapshot(), // shared snapshot @@ -40,6 +40,7 @@ TEST_F(DartIsolateTest, RootIsolateCreationAndShutdown) { "main.dart", // advisory uri "main" // advisory entrypoint ); + auto root_isolate = weak_isolate.lock(); ASSERT_TRUE(root_isolate); ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); ASSERT_TRUE(root_isolate->Shutdown()); @@ -57,7 +58,7 @@ TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) { GetCurrentTaskRunner(), // GetCurrentTaskRunner() // ); - auto root_isolate = DartIsolate::CreateRootIsolate( + auto weak_isolate = DartIsolate::CreateRootIsolate( vm.get(), // vm vm->GetIsolateSnapshot(), // isolate snapshot vm->GetSharedSnapshot(), // shared snapshot @@ -68,6 +69,7 @@ TEST_F(DartIsolateTest, IsolateCanAssociateSnapshot) { "main.dart", // advisory uri "main" // advisory entrypoint ); + auto root_isolate = weak_isolate.lock(); ASSERT_TRUE(root_isolate); ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( @@ -88,7 +90,7 @@ TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) { GetCurrentTaskRunner(), // GetCurrentTaskRunner() // ); - auto root_isolate = DartIsolate::CreateRootIsolate( + auto weak_isolate = DartIsolate::CreateRootIsolate( vm.get(), // vm vm->GetIsolateSnapshot(), // isolate snapshot vm->GetSharedSnapshot(), // shared snapshot @@ -99,6 +101,7 @@ TEST_F(DartIsolateTest, CanResolveAndInvokeMethod) { "main.dart", // advisory uri "main" // advisory entrypoint ); + auto root_isolate = weak_isolate.lock(); ASSERT_TRUE(root_isolate); ASSERT_EQ(root_isolate->GetPhase(), DartIsolate::Phase::LibrariesSetup); ASSERT_TRUE(root_isolate->PrepareForRunningFromSource( diff --git a/runtime/dart_service_isolate.cc b/runtime/dart_service_isolate.cc index 3239e4f437eca..212b880687325 100644 --- a/runtime/dart_service_isolate.cc +++ b/runtime/dart_service_isolate.cc @@ -8,10 +8,10 @@ #include "flutter/runtime/embedder_resources.h" #include "lib/fxl/logging.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_library_natives.h" -#include "lib/tonic/logging/dart_error.h" #include "third_party/dart/runtime/include/dart_api.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_library_natives.h" +#include "third_party/tonic/logging/dart_error.h" #define RETURN_ERROR_HANDLE(handle) \ if (Dart_IsError(handle)) { \ diff --git a/runtime/dart_vm.cc b/runtime/dart_vm.cc index 40a8bfef58800..072502ef7a92d 100644 --- a/runtime/dart_vm.cc +++ b/runtime/dart_vm.cc @@ -22,15 +22,15 @@ #include "lib/fxl/files/file.h" #include "lib/fxl/logging.h" #include "lib/fxl/time/time_delta.h" -#include "lib/tonic/converter/dart_converter.h" -#include "lib/tonic/dart_class_library.h" -#include "lib/tonic/dart_class_provider.h" -#include "lib/tonic/dart_sticky_error.h" -#include "lib/tonic/file_loader/file_loader.h" -#include "lib/tonic/logging/dart_error.h" -#include "lib/tonic/scopes/dart_api_scope.h" -#include "lib/tonic/typed_data/uint8_list.h" #include "third_party/dart/runtime/bin/embedded_dart_io.h" +#include "third_party/tonic/converter/dart_converter.h" +#include "third_party/tonic/dart_class_library.h" +#include "third_party/tonic/dart_class_provider.h" +#include "third_party/tonic/dart_sticky_error.h" +#include "third_party/tonic/file_loader/file_loader.h" +#include "third_party/tonic/logging/dart_error.h" +#include "third_party/tonic/scopes/dart_api_scope.h" +#include "third_party/tonic/typed_data/uint8_list.h" #ifdef ERROR #undef ERROR diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index e2cbfaf110a80..22b84579800b9 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -10,7 +10,7 @@ #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" #include "flutter/runtime/runtime_delegate.h" -#include "lib/tonic/dart_message_handler.h" +#include "third_party/tonic/dart_message_handler.h" #ifdef ERROR #undef ERROR @@ -70,11 +70,12 @@ RuntimeController::RuntimeController( unref_queue_, p_advisory_script_uri, p_advisory_script_entrypoint)) { - root_isolate_->SetReturnCodeCallback([this](uint32_t code) { + std::shared_ptr root_isolate = root_isolate_.lock(); + root_isolate->SetReturnCodeCallback([this](uint32_t code) { root_isolate_return_code_ = {true, code}; }); if (auto window = GetWindowIfAvailable()) { - tonic::DartState::Scope scope(root_isolate_.get()); + tonic::DartState::Scope scope(root_isolate); window->DidCreateIsolate(); if (!FlushRuntimeStateToIsolate()) { FXL_DLOG(ERROR) << "Could not setup intial isolate state."; @@ -87,9 +88,10 @@ RuntimeController::RuntimeController( RuntimeController::~RuntimeController() { FXL_DCHECK(Dart_CurrentIsolate() == nullptr); - if (root_isolate_) { - root_isolate_->SetReturnCodeCallback(nullptr); - auto result = root_isolate_->Shutdown(); + std::shared_ptr root_isolate = root_isolate_.lock(); + if (root_isolate) { + root_isolate->SetReturnCodeCallback(nullptr); + auto result = root_isolate->Shutdown(); if (!result) { FXL_DLOG(ERROR) << "Could not shutdown the root isolate."; } @@ -98,8 +100,9 @@ RuntimeController::~RuntimeController() { } bool RuntimeController::IsRootIsolateRunning() const { - if (root_isolate_) { - return root_isolate_->GetPhase() == DartIsolate::Phase::Running; + std::shared_ptr root_isolate = root_isolate_.lock(); + if (root_isolate) { + return root_isolate->GetPhase() == DartIsolate::Phase::Running; } return false; } @@ -192,11 +195,12 @@ bool RuntimeController::BeginFrame(fxl::TimePoint frame_time) { } bool RuntimeController::NotifyIdle(int64_t deadline) { - if (!root_isolate_) { + std::shared_ptr root_isolate = root_isolate_.lock(); + if (!root_isolate) { return false; } - tonic::DartState::Scope scope(root_isolate_.get()); + tonic::DartState::Scope scope(root_isolate); Dart_NotifyIdle(deadline); return true; } @@ -236,7 +240,8 @@ bool RuntimeController::DispatchSemanticsAction(int32_t id, } Window* RuntimeController::GetWindowIfAvailable() { - return root_isolate_ ? root_isolate_->window() : nullptr; + std::shared_ptr root_isolate = root_isolate_.lock(); + return root_isolate ? root_isolate->window() : nullptr; } std::string RuntimeController::DefaultRouteName() { @@ -267,26 +272,30 @@ FontCollection& RuntimeController::GetFontCollection() { } Dart_Port RuntimeController::GetMainPort() { - return root_isolate_ ? root_isolate_->main_port() : ILLEGAL_PORT; + std::shared_ptr root_isolate = root_isolate_.lock(); + return root_isolate ? root_isolate->main_port() : ILLEGAL_PORT; } std::string RuntimeController::GetIsolateName() { - return root_isolate_ ? root_isolate_->debug_name() : ""; + std::shared_ptr root_isolate = root_isolate_.lock(); + return root_isolate ? root_isolate->debug_name() : ""; } bool RuntimeController::HasLivePorts() { - if (!root_isolate_) { + std::shared_ptr root_isolate = root_isolate_.lock(); + if (!root_isolate) { return false; } - tonic::DartState::Scope scope(root_isolate_.get()); + tonic::DartState::Scope scope(root_isolate); return Dart_HasLivePorts(); } tonic::DartErrorHandleType RuntimeController::GetLastError() { - return root_isolate_ ? root_isolate_->GetLastError() : tonic::kNoError; + std::shared_ptr root_isolate = root_isolate_.lock(); + return root_isolate ? root_isolate->GetLastError() : tonic::kNoError; } -fml::WeakPtr RuntimeController::GetRootIsolate() { +std::weak_ptr RuntimeController::GetRootIsolate() { return root_isolate_; } diff --git a/runtime/runtime_controller.h b/runtime/runtime_controller.h index bcb51c640c48d..a2d32c097df15 100644 --- a/runtime/runtime_controller.h +++ b/runtime/runtime_controller.h @@ -71,7 +71,7 @@ class RuntimeController final : public WindowClient { tonic::DartErrorHandleType GetLastError(); - fml::WeakPtr GetRootIsolate(); + std::weak_ptr GetRootIsolate(); std::pair GetRootIsolateReturnCode(); @@ -95,7 +95,7 @@ class RuntimeController final : public WindowClient { std::string advisory_script_uri_; std::string advisory_script_entrypoint_; WindowData window_data_; - fml::WeakPtr root_isolate_; + std::weak_ptr root_isolate_; std::pair root_isolate_return_code_ = {false, 0}; RuntimeController(RuntimeDelegate& client, diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 28718a96062e3..6748ecde87e6d 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -109,7 +109,7 @@ source_set("common") { public_deps = [ "$flutter_root/third_party/txt", - "//topaz/lib/tonic", + "//third_party/tonic", ] public_configs = [ "$flutter_root:config" ] @@ -129,7 +129,7 @@ executable("shell_unittests") { "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", "//third_party/skia", - "//topaz/lib/tonic", + "//third_party/tonic", ] if (is_linux) { ldflags = [ "-rdynamic" ] diff --git a/shell/common/engine.cc b/shell/common/engine.cc index f8726697472f0..790fb70a13b0e 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -117,7 +117,8 @@ bool Engine::Run(RunConfiguration configuration) { return false; } - auto isolate = runtime_controller_->GetRootIsolate(); + std::shared_ptr isolate = + runtime_controller_->GetRootIsolate().lock(); bool isolate_running = isolate && isolate->GetPhase() == blink::DartIsolate::Phase::Running; @@ -145,9 +146,14 @@ bool Engine::PrepareAndLaunchIsolate(RunConfiguration configuration) { auto isolate_configuration = configuration.TakeIsolateConfiguration(); - auto isolate = runtime_controller_->GetRootIsolate(); + std::shared_ptr isolate = + runtime_controller_->GetRootIsolate().lock(); - if (!isolate_configuration->PrepareIsolate(isolate)) { + if (!isolate) { + return false; + } + + if (!isolate_configuration->PrepareIsolate(*isolate)) { FXL_LOG(ERROR) << "Could not prepare to run the isolate."; return false; } diff --git a/shell/common/isolate_configuration.cc b/shell/common/isolate_configuration.cc index 06e62fedfb534..2b3474108b41d 100644 --- a/shell/common/isolate_configuration.cc +++ b/shell/common/isolate_configuration.cc @@ -16,19 +16,14 @@ IsolateConfiguration::IsolateConfiguration() = default; IsolateConfiguration::~IsolateConfiguration() = default; -bool IsolateConfiguration::PrepareIsolate( - fml::WeakPtr isolate) { - if (!isolate) { - return false; - } - - if (isolate->GetPhase() != blink::DartIsolate::Phase::LibrariesSetup) { +bool IsolateConfiguration::PrepareIsolate(blink::DartIsolate& isolate) { + if (isolate.GetPhase() != blink::DartIsolate::Phase::LibrariesSetup) { FXL_DLOG(ERROR) << "Isolate was in incorrect phase to be prepared for running."; return false; } - return DoPrepareIsolate(*isolate); + return DoPrepareIsolate(isolate); } class AppSnapshotIsolateConfiguration final : public IsolateConfiguration { diff --git a/shell/common/isolate_configuration.h b/shell/common/isolate_configuration.h index 19e4834c3e2c7..1f88195179345 100644 --- a/shell/common/isolate_configuration.h +++ b/shell/common/isolate_configuration.h @@ -40,7 +40,7 @@ class IsolateConfiguration { virtual ~IsolateConfiguration(); - bool PrepareIsolate(fml::WeakPtr isolate); + bool PrepareIsolate(blink::DartIsolate& isolate); protected: virtual bool DoPrepareIsolate(blink::DartIsolate& isolate) = 0; diff --git a/shell/platform/embedder/BUILD.gn b/shell/platform/embedder/BUILD.gn index 6761892bca49f..661facca6a2a8 100644 --- a/shell/platform/embedder/BUILD.gn +++ b/shell/platform/embedder/BUILD.gn @@ -34,7 +34,7 @@ source_set("embedder") { "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", "//third_party/skia:gpu", - "//topaz/lib/tonic", + "//third_party/tonic", ] public_configs = [ "$flutter_root:config" ] diff --git a/shell/testing/BUILD.gn b/shell/testing/BUILD.gn index 6c99a3466d9ae..67d8f73d1d33a 100644 --- a/shell/testing/BUILD.gn +++ b/shell/testing/BUILD.gn @@ -23,7 +23,7 @@ executable("testing") { "//third_party/dart/runtime:libdart_jit", "//third_party/dart/runtime/bin:embedded_dart_io", "//third_party/skia", - "//topaz/lib/tonic", + "//third_party/tonic", ] if (is_fuchsia) { diff --git a/tools/licenses/pubspec.lock b/tools/licenses/pubspec.lock deleted file mode 100644 index ef590e249229f..0000000000000 --- a/tools/licenses/pubspec.lock +++ /dev/null @@ -1,61 +0,0 @@ -# Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile -packages: - archive: - dependency: "direct main" - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.33" - args: - dependency: "direct main" - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.7" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.14.10" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - crypto: - dependency: "direct main" - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - path: - dependency: "direct main" - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.1" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.5" -sdks: - dart: ">=2.0.0-dev.62.0 <=2.0.0-dev.67.0.flutter-84ca27a09e" diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index 9939512991de1..a6564cf81cd7b 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -752,6 +752,7 @@ FILE: ../../../flutter/lib/ui/compositing/scene.cc FILE: ../../../flutter/lib/ui/compositing/scene.h FILE: ../../../flutter/lib/ui/compositing/scene_builder.cc FILE: ../../../flutter/lib/ui/compositing/scene_builder.h +FILE: ../../../flutter/lib/ui/dart_wrapper.h FILE: ../../../flutter/lib/ui/geometry.dart FILE: ../../../flutter/lib/ui/hash_codes.dart FILE: ../../../flutter/lib/ui/hooks.dart @@ -871,7 +872,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: engine -ORIGIN: ../../../topaz/LICENSE +ORIGIN: ../../../third_party/tonic/LICENSE TYPE: LicenseType.bsd FILE: ../../../flutter/fml/build_config.h FILE: ../../../flutter/fml/closure.h diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 515e3851edf47..57c1e926bfc03 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 8c6862be68434710cbc30d73df250d2d +Signature: 63e223afa271c52f6f62e3cbfb842bc7 UNUSED LICENSES: @@ -21116,6 +21116,213 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: tonic +ORIGIN: ../../../garnet/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/tonic/dart_list.cc +FILE: ../../../third_party/tonic/dart_list.h +FILE: ../../../third_party/tonic/file_loader/file_loader_fuchsia.cc +FILE: ../../../third_party/tonic/file_loader/file_loader_posix.cc +FILE: ../../../third_party/tonic/file_loader/file_loader_win.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/path_win.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/portable_unistd.h +FILE: ../../../third_party/tonic/filesystem/filesystem/symlink_win.cc +FILE: ../../../third_party/tonic/platform/platform_utils.h +FILE: ../../../third_party/tonic/platform/platform_utils_posix.cc +FILE: ../../../third_party/tonic/platform/platform_utils_win.cc +---------------------------------------------------------------------------------------------------- +Copyright 2017 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: tonic +ORIGIN: ../../../third_party/tonic/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/tonic/common/build_config.h +FILE: ../../../third_party/tonic/converter/dart_converter.cc +FILE: ../../../third_party/tonic/converter/dart_converter.h +FILE: ../../../third_party/tonic/dart_message_handler.cc +FILE: ../../../third_party/tonic/dart_message_handler.h +FILE: ../../../third_party/tonic/dart_microtask_queue.cc +FILE: ../../../third_party/tonic/dart_microtask_queue.h +FILE: ../../../third_party/tonic/dart_sticky_error.cc +FILE: ../../../third_party/tonic/dart_sticky_error.h +FILE: ../../../third_party/tonic/file_loader/file_loader.cc +FILE: ../../../third_party/tonic/file_loader/file_loader.h +FILE: ../../../third_party/tonic/filesystem/filesystem/build_config.h +FILE: ../../../third_party/tonic/filesystem/filesystem/directory.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/directory.h +FILE: ../../../third_party/tonic/filesystem/filesystem/eintr_wrapper.h +FILE: ../../../third_party/tonic/filesystem/filesystem/file.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/file.h +FILE: ../../../third_party/tonic/filesystem/filesystem/file_descriptor.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/file_descriptor.h +FILE: ../../../third_party/tonic/filesystem/filesystem/path.h +FILE: ../../../third_party/tonic/filesystem/filesystem/path_posix.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/scoped_temp_dir.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/scoped_temp_dir.h +FILE: ../../../third_party/tonic/filesystem/filesystem/symlink.h +FILE: ../../../third_party/tonic/filesystem/filesystem/symlink_posix.cc +FILE: ../../../third_party/tonic/logging/dart_error.cc +FILE: ../../../third_party/tonic/logging/dart_error.h +FILE: ../../../third_party/tonic/logging/dart_invoke.cc +FILE: ../../../third_party/tonic/logging/dart_invoke.h +FILE: ../../../third_party/tonic/parsers/packages_map.cc +FILE: ../../../third_party/tonic/parsers/packages_map.h +FILE: ../../../third_party/tonic/scopes/dart_api_scope.h +FILE: ../../../third_party/tonic/scopes/dart_isolate_scope.cc +FILE: ../../../third_party/tonic/scopes/dart_isolate_scope.h +FILE: ../../../third_party/tonic/typed_data/dart_byte_data.h +FILE: ../../../third_party/tonic/typed_data/int32_list.h +FILE: ../../../third_party/tonic/typed_data/uint8_list.h +---------------------------------------------------------------------------------------------------- +Copyright 2016 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: tonic +ORIGIN: ../../../third_party/tonic/common/macros.h + ../../../third_party/tonic/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/tonic/common/macros.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: tonic +ORIGIN: ../../../third_party/tonic/typed_data/dart_byte_data.cc + ../../../third_party/tonic/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/tonic/dart_args.h +FILE: ../../../third_party/tonic/dart_binding_macros.h +FILE: ../../../third_party/tonic/dart_class_library.cc +FILE: ../../../third_party/tonic/dart_class_library.h +FILE: ../../../third_party/tonic/dart_class_provider.cc +FILE: ../../../third_party/tonic/dart_class_provider.h +FILE: ../../../third_party/tonic/dart_library_natives.cc +FILE: ../../../third_party/tonic/dart_library_natives.h +FILE: ../../../third_party/tonic/dart_persistent_value.cc +FILE: ../../../third_party/tonic/dart_persistent_value.h +FILE: ../../../third_party/tonic/dart_state.cc +FILE: ../../../third_party/tonic/dart_state.h +FILE: ../../../third_party/tonic/dart_wrappable.cc +FILE: ../../../third_party/tonic/dart_wrappable.h +FILE: ../../../third_party/tonic/dart_wrapper_info.h +FILE: ../../../third_party/tonic/typed_data/dart_byte_data.cc +FILE: ../../../third_party/tonic/typed_data/float32_list.cc +FILE: ../../../third_party/tonic/typed_data/float32_list.h +FILE: ../../../third_party/tonic/typed_data/float64_list.cc +FILE: ../../../third_party/tonic/typed_data/float64_list.h +FILE: ../../../third_party/tonic/typed_data/int32_list.cc +FILE: ../../../third_party/tonic/typed_data/uint8_list.cc +---------------------------------------------------------------------------------------------------- +Copyright 2015 The Fuchsia Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: vulkanmemoryallocator ORIGIN: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/LICENSE.txt @@ -21878,4 +22085,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 321 +Total license count: 325 From 244ebd660c24650bec9918ee20a4be7ef380be42 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Mon, 23 Jul 2018 12:28:17 -0700 Subject: [PATCH 0853/1190] Reapply "Fix Dart 2 reload when running from a snapshot instead of platform.dill." (#5830) Without this flag, the VM will attempt to interpret a kernel file as source code. Affects Fuchsia (FL-71) and code-push. --- runtime/dart_isolate.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index bd2c23505411b..51073de246664 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -719,6 +719,20 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( (*raw_embedder_isolate)->child_isolate_preparer_)); } + // TODO(rmacnak): This flag setting business preserves a side effect of using + // Dart_CreateIsolateFromKernel. It should be removed when some of the + // internal logic in reload no longer uses this flag. + Dart_IsolateFlags nonnull_flags; + if (flags == nullptr) { + Dart_IsolateFlagsInitialize(&nonnull_flags); + flags = &nonnull_flags; + } + bool dart2 = (vm->GetPlatformKernel().GetSize() > 0) || + Dart_IsDart2Snapshot(embedder_isolate->GetIsolateSnapshot() + ->GetData() + ->GetSnapshotPointer()); + flags->use_dart_frontend = dart2; + // Create the Dart VM isolate and give it the embedder object as the baton. Dart_Isolate isolate = (vm->GetPlatformKernel().GetSize() > 0) From 33a4aef1d112821a16f2f9254f2001643412d38b Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 23 Jul 2018 13:25:17 -0700 Subject: [PATCH 0854/1190] Fix build break caused by https://github.com/flutter/engine/pull/5830 (#5831) --- runtime/dart_isolate.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 51073de246664..c215917cb9dd9 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -728,7 +728,8 @@ DartIsolate::CreateDartVMAndEmbedderObjectPair( flags = &nonnull_flags; } bool dart2 = (vm->GetPlatformKernel().GetSize() > 0) || - Dart_IsDart2Snapshot(embedder_isolate->GetIsolateSnapshot() + Dart_IsDart2Snapshot((*embedder_isolate) + ->GetIsolateSnapshot() ->GetData() ->GetSnapshotPointer()); flags->use_dart_frontend = dart2; From 380eb84c433c7f318018e0d7ba5363f445067d2e Mon Sep 17 00:00:00 2001 From: egdaniel Date: Mon, 23 Jul 2018 18:27:41 -0400 Subject: [PATCH 0855/1190] Remove unused function CreateSkiaInterface (#5812) * Remove unused function CreateSkiaInterface. * Remove include. --- vulkan/vulkan_proc_table.cc | 21 --------------------- vulkan/vulkan_proc_table.h | 3 --- 2 files changed, 24 deletions(-) diff --git a/vulkan/vulkan_proc_table.cc b/vulkan/vulkan_proc_table.cc index 9f0e62311584e..b759298139774 100644 --- a/vulkan/vulkan_proc_table.cc +++ b/vulkan/vulkan_proc_table.cc @@ -206,27 +206,6 @@ PFN_vkVoidFunction VulkanProcTable::AcquireProc( return GetDeviceProcAddr(device, proc_name); } -sk_sp VulkanProcTable::CreateSkiaInterface() const { - if (!IsValid()) { - return nullptr; - } - - GrVkInterface::GetProc proc = [this](const char* proc_name, - VkInstance instance, VkDevice device) { - if (device != VK_NULL_HANDLE) { - auto result = AcquireProc(proc_name, {device, nullptr}); - if (result != nullptr) { - return result; - } - } - - return AcquireProc(proc_name, {instance, nullptr}); - }; - - return sk_make_sp(proc, instance_, device_, - 0 /* extensions */); -} - GrVkGetProc VulkanProcTable::CreateSkiaGetProc() const { if (!IsValid()) { return nullptr; diff --git a/vulkan/vulkan_proc_table.h b/vulkan/vulkan_proc_table.h index 95f028a567ac8..45e40196b594d 100644 --- a/vulkan/vulkan_proc_table.h +++ b/vulkan/vulkan_proc_table.h @@ -12,7 +12,6 @@ #include "lib/fxl/memory/ref_ptr.h" #include "third_party/skia/include/core/SkRefCnt.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" -#include "third_party/skia/include/gpu/vk/GrVkInterface.h" namespace vulkan { @@ -60,8 +59,6 @@ class VulkanProcTable : public fxl::RefCountedThreadSafe { bool SetupDeviceProcAddresses(const VulkanHandle& device); - // CreateSkiaInterface is deprecated. - sk_sp CreateSkiaInterface() const; GrVkGetProc CreateSkiaGetProc() const; #define DEFINE_PROC(name) Proc name; From 5474415e1d4b9fd681e589bc92a8d6b49b89ba4f Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Mon, 23 Jul 2018 18:30:13 -0400 Subject: [PATCH 0856/1190] Roll src/third_party/skia e35055f31c7f..b8eeb808d84f (5 commits) (#5832) Auto-roller completed checks. Merging. --- DEPS | 2 +- sky/packages/sky_engine/LICENSE | 35 +++++++++++++++++++++ travis/licenses_golden/licenses_third_party | 3 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 3b1e18b73ead7..937e1e3b39ead 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e35055f31c7f2a2c7f3c693b9231c44d181ec599', + 'skia_revision': 'b8eeb808d84f7892fad9ce8ff6ce62c7fcacb217', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 612ebfe44b0f0..415c36d2a164a 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -3639,6 +3639,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine garnet +tonic topaz Copyright 2016 The Fuchsia Authors. All rights reserved. @@ -3671,6 +3672,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- engine garnet +tonic topaz Copyright 2017 The Fuchsia Authors. All rights reserved. @@ -4527,6 +4529,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- garnet +tonic topaz Copyright 2015 The Fuchsia Authors. All rights reserved. @@ -4558,6 +4561,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- garnet +tonic topaz Copyright 2018 The Fuchsia Authors. All rights reserved. @@ -10694,6 +10698,37 @@ distribution. contributors may be used to endorse or promote products derived from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-------------------------------------------------------------------------------- +topaz + +Copyright 2017, the Flutter project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 57c1e926bfc03..cbb87579ef1f3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 63e223afa271c52f6f62e3cbfb842bc7 +Signature: af1324c973cac6d6a9db224502ab1ddf UNUSED LICENSES: @@ -17566,6 +17566,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-G FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-ReleaseAndAbandonGpuContext.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC5i7RYH-CPU-AVX2-x86_64-Debug-All-NativeFonts_GDI.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Release-All-ANGLE.json From 29f475c8de767db7ccc31c1609e3709af26bcce9 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 23 Jul 2018 17:48:08 -0700 Subject: [PATCH 0857/1190] Update tonic to pull in fixes to assertions and build failures on Windows. (#5833) --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index 937e1e3b39ead..94b2ae3c0ebf9 100644 --- a/DEPS +++ b/DEPS @@ -126,7 +126,7 @@ deps = { Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67', 'src/third_party/tonic': - Var('fuchsia_git') + '/tonic' + '@' + 'e586d2975fedec0aa6c3ec87de287789172a0948', + Var('fuchsia_git') + '/tonic' + '@' + '81fc7ad248fba238a71b04d34595edbe37128346', 'src/third_party/benchmark': Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22', diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index cbb87579ef1f3..d30876134851a 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: af1324c973cac6d6a9db224502ab1ddf +Signature: 283abf2ccdd240a0a917afb4e1429f48 UNUSED LICENSES: @@ -21128,7 +21128,6 @@ FILE: ../../../third_party/tonic/file_loader/file_loader_posix.cc FILE: ../../../third_party/tonic/file_loader/file_loader_win.cc FILE: ../../../third_party/tonic/filesystem/filesystem/path_win.cc FILE: ../../../third_party/tonic/filesystem/filesystem/portable_unistd.h -FILE: ../../../third_party/tonic/filesystem/filesystem/symlink_win.cc FILE: ../../../third_party/tonic/platform/platform_utils.h FILE: ../../../third_party/tonic/platform/platform_utils_posix.cc FILE: ../../../third_party/tonic/platform/platform_utils_win.cc @@ -21177,20 +21176,11 @@ FILE: ../../../third_party/tonic/dart_sticky_error.cc FILE: ../../../third_party/tonic/dart_sticky_error.h FILE: ../../../third_party/tonic/file_loader/file_loader.cc FILE: ../../../third_party/tonic/file_loader/file_loader.h -FILE: ../../../third_party/tonic/filesystem/filesystem/build_config.h -FILE: ../../../third_party/tonic/filesystem/filesystem/directory.cc -FILE: ../../../third_party/tonic/filesystem/filesystem/directory.h FILE: ../../../third_party/tonic/filesystem/filesystem/eintr_wrapper.h FILE: ../../../third_party/tonic/filesystem/filesystem/file.cc FILE: ../../../third_party/tonic/filesystem/filesystem/file.h -FILE: ../../../third_party/tonic/filesystem/filesystem/file_descriptor.cc -FILE: ../../../third_party/tonic/filesystem/filesystem/file_descriptor.h FILE: ../../../third_party/tonic/filesystem/filesystem/path.h FILE: ../../../third_party/tonic/filesystem/filesystem/path_posix.cc -FILE: ../../../third_party/tonic/filesystem/filesystem/scoped_temp_dir.cc -FILE: ../../../third_party/tonic/filesystem/filesystem/scoped_temp_dir.h -FILE: ../../../third_party/tonic/filesystem/filesystem/symlink.h -FILE: ../../../third_party/tonic/filesystem/filesystem/symlink_posix.cc FILE: ../../../third_party/tonic/logging/dart_error.cc FILE: ../../../third_party/tonic/logging/dart_error.h FILE: ../../../third_party/tonic/logging/dart_invoke.cc From 95e91e31fad816738d3fef341256620e1819b6d9 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 23 Jul 2018 18:03:45 -0700 Subject: [PATCH 0858/1190] Update tonic to pull in Android build fixes. (#5834) --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 94b2ae3c0ebf9..ad041a6b2a13f 100644 --- a/DEPS +++ b/DEPS @@ -126,7 +126,7 @@ deps = { Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67', 'src/third_party/tonic': - Var('fuchsia_git') + '/tonic' + '@' + '81fc7ad248fba238a71b04d34595edbe37128346', + Var('fuchsia_git') + '/tonic' + '@' + '57d508b12462db686573edcbc97891d90cf92f90', 'src/third_party/benchmark': Var('fuchsia_git') + '/third_party/benchmark' + '@' + '296537bc48d380adf21567c5d736ab79f5363d22', From 5bc1e68b698eea75643c9dc94fa630d6fc59b090 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Tue, 24 Jul 2018 10:46:07 -0700 Subject: [PATCH 0859/1190] Remove check_roll from Travis (#5846) Merged on red as there's only license hash mismatch. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1364ad1932260..043404ff10922 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ sudo: false before_script: - ./travis/setup.sh script: - - ./travis/check_roll.sh - ./travis/format.sh - ./travis/build.sh - ./travis/test.sh From e12b52841ee5185bc1b5f038a43a6ec80d966f55 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 24 Jul 2018 17:23:32 -0400 Subject: [PATCH 0860/1190] Roll src/third_party/skia b8eeb808d84f..75e5406be66a (17 commits) (#5852) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index ad041a6b2a13f..a5455b71a15e4 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b8eeb808d84f7892fad9ce8ff6ce62c7fcacb217', + 'skia_revision': '75e5406be66a8c13544050e934e900866e2ac524', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index d30876134851a..f747d389279c5 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 283abf2ccdd240a0a917afb4e1429f48 +Signature: 0bab67b709b7fe3f4d0d1d6d1fc984a6 UNUSED LICENSES: @@ -510,6 +510,12 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/qu FILE: ../../../third_party/skia/src/images/SkWebpEncoder.cpp FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vk_platform.h FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_android.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_core.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_ios.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_macos.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_win32.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_xcb.h FILE: ../../../third_party/vulkan/src/vulkan/vk_platform.h FILE: ../../../third_party/vulkan/src/vulkan/vulkan.h ---------------------------------------------------------------------------------------------------- @@ -17554,6 +17560,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Cl FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Release-All-NativeFonts.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookAir7.2-GPU-IntelHD6000-x86_64-Debug-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Metal.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-MoltenVK_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Debug-All-CommandBuffer.json @@ -17677,7 +17684,6 @@ FILE: ../../../third_party/skia/site/user/sample/gradient_correct.png FILE: ../../../third_party/skia/site/user/sample/gradient_wrong.png FILE: ../../../third_party/skia/site/user/sample/transfer_fn.png FILE: ../../../third_party/skia/src/core/SkOrderedReadBuffer.h -FILE: ../../../third_party/skia/src/sksl/lex/layout.lex FILE: ../../../third_party/skia/src/sksl/lex/sksl.lex FILE: ../../../third_party/skia/src/sksl/sksl.inc FILE: ../../../third_party/skia/src/sksl/sksl_cpu.inc @@ -19573,8 +19579,6 @@ FILE: ../../../third_party/skia/src/sksl/SkSLCPP.h FILE: ../../../third_party/skia/src/sksl/SkSLCPPCodeGenerator.h FILE: ../../../third_party/skia/src/sksl/SkSLFileOutputStream.h FILE: ../../../third_party/skia/src/sksl/SkSLHCodeGenerator.h -FILE: ../../../third_party/skia/src/sksl/SkSLLayoutLexer.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLLayoutLexer.h FILE: ../../../third_party/skia/src/sksl/SkSLLexer.cpp FILE: ../../../third_party/skia/src/sksl/SkSLLexer.h FILE: ../../../third_party/skia/src/sksl/SkSLOutputStream.h From 5cd8b45300ea65d1581993a1030ed18251b1c7a3 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Tue, 24 Jul 2018 20:47:14 -0400 Subject: [PATCH 0861/1190] Roll src/third_party/skia 75e5406be66a..4c7a750e5543 (2 commits) (#5854) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a5455b71a15e4..a8f81b1504b43 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '75e5406be66a8c13544050e934e900866e2ac524', + 'skia_revision': '4c7a750e5543ef5c8993c225bc8598927b95d7a0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index f747d389279c5..ff9af14b56e67 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0bab67b709b7fe3f4d0d1d6d1fc984a6 +Signature: 38ea50f0a1fa516bd29a596b753fe454 UNUSED LICENSES: @@ -17510,6 +17510,7 @@ FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_NoGPUThreads.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-GPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json From 75ad43954f146cacd081c5bfeaed3d4b647bfcf9 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Jul 2018 02:33:14 -0400 Subject: [PATCH 0862/1190] Roll src/third_party/skia 4c7a750e5543..15020ea2cf44 (1 commits) (#5855) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index a8f81b1504b43..f2fccbf46b46b 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '4c7a750e5543ef5c8993c225bc8598927b95d7a0', + 'skia_revision': '15020ea2cf442bafd86d852dcd1df52964319cec', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index ff9af14b56e67..4cb80d7ca30d3 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 38ea50f0a1fa516bd29a596b753fe454 +Signature: 51774566e33ddb7ee26a0ef214fea0e2 UNUSED LICENSES: From 3fa83d2d2364a09b8c177a8c3c37346754a237be Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Jul 2018 07:39:13 -0400 Subject: [PATCH 0863/1190] Roll src/third_party/skia 15020ea2cf44..c062b6be5a01 (1 commits) (#5856) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index f2fccbf46b46b..f885f67b4ee72 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '15020ea2cf442bafd86d852dcd1df52964319cec', + 'skia_revision': 'c062b6be5a01b3f4845c64181b1588d03c02d1e1', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 4cb80d7ca30d3..254de7349913c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 51774566e33ddb7ee26a0ef214fea0e2 +Signature: cc13c8fecc409a9119ce5b430750af97 UNUSED LICENSES: From a726e1d854a6b7e755a9644cfd2e8121cee80f4b Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Jul 2018 11:08:32 -0400 Subject: [PATCH 0864/1190] Roll src/third_party/skia c062b6be5a01..396661825f45 (3 commits) (#5857) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/DEPS b/DEPS index f885f67b4ee72..c328105bb877f 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'c062b6be5a01b3f4845c64181b1588d03c02d1e1', + 'skia_revision': '396661825f454a652ef3db41ed5bfa7c5174153d', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 254de7349913c..49d44b5e9e09c 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: cc13c8fecc409a9119ce5b430750af97 +Signature: 994e2c6cfd441d2ac7f125e1a3ea3e1c UNUSED LICENSES: @@ -17510,7 +17510,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Cl FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_NoGPUThreads.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Debug-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-GPU-Cortex_A7-arm-Release-All.json FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json From 42bd86d6db3d403f98d5d4f05340d76889031e3f Mon Sep 17 00:00:00 2001 From: amirh Date: Wed, 25 Jul 2018 08:51:56 -0700 Subject: [PATCH 0865/1190] Make the virtual display's presentation window non focusable. (#5845) When the FlutterView's window loses focus Flutter cannot bring up the keyboard (so e.g tapping on text fields doesn't work). This workaround makes sure that Flutter text fields are working but unfortunately now the embedded Android view cannot bring up the keyboard as it's window is not focused. Submitting this until as a stop gap while we're trying to figure out if it's possible to allow both windows to bring up the keyboard. --- .../flutter/plugin/platform/SingleViewPresentation.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java b/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java index b305c40fafa90..f743061de6626 100644 --- a/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java +++ b/shell/platform/android/io/flutter/plugin/platform/SingleViewPresentation.java @@ -11,6 +11,7 @@ import android.os.Bundle; import android.view.Display; import android.view.View; +import android.view.WindowManager; import android.widget.FrameLayout; @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @@ -32,6 +33,10 @@ public SingleViewPresentation(Context outerContext, Display display, PlatformVie super(outerContext, display); mViewFactory = viewFactory; mViewId = viewId; + getWindow().setFlags( + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE + ); } /** @@ -45,6 +50,10 @@ public SingleViewPresentation(Context outerContext, Display display, PlatformVie super(outerContext, display); mViewFactory = null; mView = view; + getWindow().setFlags( + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, + WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE + ); } @Override From f50e218d99bef8148eda249e86396f17777d6612 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Wed, 25 Jul 2018 09:57:10 -0700 Subject: [PATCH 0866/1190] Rename clip mode to clip behavior (#5853) * Rename clip mode to clip behavior So we're consistent across flutter/flutter and flutter/engine * Clang format --- flow/layers/clip_path_layer.cc | 15 ++++++++------- flow/layers/clip_path_layer.h | 4 ++-- flow/layers/clip_rect_layer.cc | 15 ++++++++------- flow/layers/clip_rect_layer.h | 4 ++-- flow/layers/clip_rrect_layer.cc | 11 ++++++----- flow/layers/clip_rrect_layer.h | 4 ++-- flow/layers/default_layer_builder.cc | 22 ++++++++++++---------- flow/layers/default_layer_builder.h | 11 +++++++---- flow/layers/layer.h | 16 +++------------- flow/layers/layer_builder.h | 11 +++++++---- flow/layers/physical_shape_layer.cc | 24 +++++++++++++----------- flow/layers/physical_shape_layer.h | 4 ++-- lib/ui/compositing/scene_builder.cc | 16 ++++++++-------- lib/ui/compositing/scene_builder.h | 8 ++++---- 14 files changed, 84 insertions(+), 81 deletions(-) diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index d6c091ee15e91..5a234aa5ee103 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -12,7 +12,8 @@ namespace flow { -ClipPathLayer::ClipPathLayer(ClipMode clip_mode) : clip_mode_(clip_mode) {} +ClipPathLayer::ClipPathLayer(Clip clip_behavior) + : clip_behavior_(clip_behavior) {} ClipPathLayer::~ClipPathLayer() = default; @@ -34,11 +35,11 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { // Treating the shape as a rectangle for now. auto bounds = clip_path_.getBounds(); scenic::Rectangle shape(context.session(), // session - bounds.width(), // width - bounds.height() // height + bounds.width(), // width + bounds.height() // height ); - // TODO(liyuqian): respect clip_mode_ + // TODO(liyuqian): respect clip_behavior_ SceneUpdateContext::Clip clip(context, shape, bounds); UpdateSceneChildren(context); } @@ -50,12 +51,12 @@ void ClipPathLayer::Paint(PaintContext& context) const { FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); - context.canvas.clipPath(clip_path_, clip_mode_ != ClipMode::hardEdge); - if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + context.canvas.clipPath(clip_path_, clip_behavior_ != Clip::hardEdge); + if (clip_behavior_ == Clip::antiAliasWithSaveLayer) { context.canvas.saveLayer(paint_bounds(), nullptr); } PaintChildren(context); - if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + if (clip_behavior_ == Clip::antiAliasWithSaveLayer) { context.canvas.restore(); } } diff --git a/flow/layers/clip_path_layer.h b/flow/layers/clip_path_layer.h index 78017144eda2d..818285af8d098 100644 --- a/flow/layers/clip_path_layer.h +++ b/flow/layers/clip_path_layer.h @@ -11,7 +11,7 @@ namespace flow { class ClipPathLayer : public ContainerLayer { public: - ClipPathLayer(ClipMode clip_mode = ClipMode::antiAlias); + ClipPathLayer(Clip clip_behavior = Clip::antiAlias); ~ClipPathLayer() override; void set_clip_path(const SkPath& clip_path) { clip_path_ = clip_path; } @@ -26,7 +26,7 @@ class ClipPathLayer : public ContainerLayer { private: SkPath clip_path_; - ClipMode clip_mode_; + Clip clip_behavior_; FXL_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); }; diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index 0fca7ab821063..6f345678f87a3 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -6,7 +6,8 @@ namespace flow { -ClipRectLayer::ClipRectLayer(ClipMode clip_mode) : clip_mode_(clip_mode) {} +ClipRectLayer::ClipRectLayer(Clip clip_behavior) + : clip_behavior_(clip_behavior) {} ClipRectLayer::~ClipRectLayer() = default; @@ -25,11 +26,11 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { FXL_DCHECK(needs_system_composite()); scenic::Rectangle shape(context.session(), // session - clip_rect_.width(), // width - clip_rect_.height() // height + clip_rect_.width(), // width + clip_rect_.height() // height ); - // TODO(liyuqian): respect clip_mode_ + // TODO(liyuqian): respect clip_behavior_ SceneUpdateContext::Clip clip(context, shape, clip_rect_); UpdateSceneChildren(context); } @@ -40,13 +41,13 @@ void ClipRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); FXL_DCHECK(needs_painting()); - SkAutoCanvasRestore save(&context.canvas, clip_mode_ != ClipMode::hardEdge); + SkAutoCanvasRestore save(&context.canvas, clip_behavior_ != Clip::hardEdge); context.canvas.clipRect(paint_bounds()); - if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + if (clip_behavior_ == Clip::antiAliasWithSaveLayer) { context.canvas.saveLayer(paint_bounds(), nullptr); } PaintChildren(context); - if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + if (clip_behavior_ == Clip::antiAliasWithSaveLayer) { context.canvas.restore(); } } diff --git a/flow/layers/clip_rect_layer.h b/flow/layers/clip_rect_layer.h index 6e508563599d0..0744076ec478b 100644 --- a/flow/layers/clip_rect_layer.h +++ b/flow/layers/clip_rect_layer.h @@ -11,7 +11,7 @@ namespace flow { class ClipRectLayer : public ContainerLayer { public: - ClipRectLayer(ClipMode clip_mode); + ClipRectLayer(Clip clip_behavior); ~ClipRectLayer() override; void set_clip_rect(const SkRect& clip_rect) { clip_rect_ = clip_rect; } @@ -25,7 +25,7 @@ class ClipRectLayer : public ContainerLayer { private: SkRect clip_rect_; - ClipMode clip_mode_; + Clip clip_behavior_; FXL_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); }; diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index 0a7ce3864a5b2..d21ce637f7f75 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -6,7 +6,8 @@ namespace flow { -ClipRRectLayer::ClipRRectLayer(ClipMode clip_mode) : clip_mode_(clip_mode) {} +ClipRRectLayer::ClipRRectLayer(Clip clip_behavior) + : clip_behavior_(clip_behavior) {} ClipRRectLayer::~ClipRRectLayer() = default; @@ -36,7 +37,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { clip_rrect_.radii(SkRRect::kLowerLeft_Corner).x() // bottom_left_radius ); - // TODO(liyuqian): respect clip_mode_ + // TODO(liyuqian): respect clip_behavior_ SceneUpdateContext::Clip clip(context, shape, clip_rrect_.getBounds()); UpdateSceneChildren(context); } @@ -48,12 +49,12 @@ void ClipRRectLayer::Paint(PaintContext& context) const { FXL_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); - context.canvas.clipRRect(clip_rrect_, clip_mode_ != ClipMode::hardEdge); - if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + context.canvas.clipRRect(clip_rrect_, clip_behavior_ != Clip::hardEdge); + if (clip_behavior_ == Clip::antiAliasWithSaveLayer) { context.canvas.saveLayer(paint_bounds(), nullptr); } PaintChildren(context); - if (clip_mode_ == ClipMode::antiAliasWithSaveLayer) { + if (clip_behavior_ == Clip::antiAliasWithSaveLayer) { context.canvas.restore(); } } diff --git a/flow/layers/clip_rrect_layer.h b/flow/layers/clip_rrect_layer.h index 24c7badf9b58e..7888a15ef838f 100644 --- a/flow/layers/clip_rrect_layer.h +++ b/flow/layers/clip_rrect_layer.h @@ -11,7 +11,7 @@ namespace flow { class ClipRRectLayer : public ContainerLayer { public: - ClipRRectLayer(ClipMode clip_mode); + ClipRRectLayer(Clip clip_behavior); ~ClipRRectLayer() override; void set_clip_rrect(const SkRRect& clip_rrect) { clip_rrect_ = clip_rrect; } @@ -26,7 +26,7 @@ class ClipRRectLayer : public ContainerLayer { private: SkRRect clip_rrect_; - ClipMode clip_mode_; + Clip clip_behavior_; FXL_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); }; diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index c17f77cc14023..031bf24d9b262 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -26,7 +26,7 @@ namespace flow { -static const SkRect kGiantRect = SkRect::MakeLTRB( -1E9F, -1E9F, 1E9F, 1E9F ); +static const SkRect kGiantRect = SkRect::MakeLTRB(-1E9F, -1E9F, 1E9F, 1E9F); DefaultLayerBuilder::DefaultLayerBuilder() { cull_rects_.push(kGiantRect); @@ -49,33 +49,35 @@ void DefaultLayerBuilder::PushTransform(const SkMatrix& sk_matrix) { PushLayer(std::move(layer), cullRect); } -void DefaultLayerBuilder::PushClipRect(const SkRect& clipRect, ClipMode clip_mode) { +void DefaultLayerBuilder::PushClipRect(const SkRect& clipRect, + Clip clip_behavior) { SkRect cullRect; if (!cullRect.intersect(clipRect, cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); } - auto layer = std::make_unique(clip_mode); + auto layer = std::make_unique(clip_behavior); layer->set_clip_rect(clipRect); PushLayer(std::move(layer), cullRect); } -void DefaultLayerBuilder::PushClipRoundedRect(const SkRRect& rrect, ClipMode clip_mode) { +void DefaultLayerBuilder::PushClipRoundedRect(const SkRRect& rrect, + Clip clip_behavior) { SkRect cullRect; if (!cullRect.intersect(rrect.rect(), cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); } - auto layer = std::make_unique(clip_mode); + auto layer = std::make_unique(clip_behavior); layer->set_clip_rrect(rrect); PushLayer(std::move(layer), cullRect); } -void DefaultLayerBuilder::PushClipPath(const SkPath& path, ClipMode clip_mode) { - FXL_DCHECK(clip_mode != ClipMode::none); +void DefaultLayerBuilder::PushClipPath(const SkPath& path, Clip clip_behavior) { + FXL_DCHECK(clip_behavior != Clip::none); SkRect cullRect; if (!cullRect.intersect(path.getBounds(), cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); } - auto layer = std::make_unique(clip_mode); + auto layer = std::make_unique(clip_behavior); layer->set_clip_path(path); PushLayer(std::move(layer), cullRect); } @@ -115,12 +117,12 @@ void DefaultLayerBuilder::PushPhysicalShape(const SkPath& sk_path, SkColor color, SkColor shadow_color, SkScalar device_pixel_ratio, - ClipMode clip_mode) { + Clip clip_behavior) { SkRect cullRect; if (!cullRect.intersect(sk_path.getBounds(), cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); } - auto layer = std::make_unique(clip_mode); + auto layer = std::make_unique(clip_behavior); layer->set_path(sk_path); layer->set_elevation(elevation); layer->set_color(color); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index 267eaad83f9d7..d5a2643a5a389 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -24,13 +24,16 @@ class DefaultLayerBuilder final : public LayerBuilder { void PushTransform(const SkMatrix& matrix) override; // |flow::LayerBuilder| - void PushClipRect(const SkRect& rect, ClipMode clip_mode = ClipMode::antiAlias) override; + void PushClipRect(const SkRect& rect, + Clip clip_behavior = Clip::antiAlias) override; // |flow::LayerBuilder| - void PushClipRoundedRect(const SkRRect& rect, ClipMode clip_mode = ClipMode::antiAlias) override; + void PushClipRoundedRect(const SkRRect& rect, + Clip clip_behavior = Clip::antiAlias) override; // |flow::LayerBuilder| - void PushClipPath(const SkPath& path, ClipMode clip_mode = ClipMode::antiAlias) override; + void PushClipPath(const SkPath& path, + Clip clip_behavior = Clip::antiAlias) override; // |flow::LayerBuilder| void PushOpacity(int alpha) override; @@ -52,7 +55,7 @@ class DefaultLayerBuilder final : public LayerBuilder { SkColor color, SkColor shadow_color, SkScalar device_pixel_ratio, - ClipMode clip_mode) override; + Clip clip_behavior) override; // |flow::LayerBuilder| void PushPerformanceOverlay(uint64_t enabled_options, diff --git a/flow/layers/layer.h b/flow/layers/layer.h index 464787ebdab3d..06ea2b2e6733a 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -27,25 +27,15 @@ #if defined(OS_FUCHSIA) #include "flutter/flow/scene_update_context.h" //nogncheck -#include "lib/ui/scenic/cpp/resources.h" //nogncheck -#include "lib/ui/scenic/cpp/session.h" //nogncheck +#include "lib/ui/scenic/cpp/resources.h" //nogncheck +#include "lib/ui/scenic/cpp/session.h" //nogncheck #endif // defined(OS_FUCHSIA) namespace flow { // This should be an exact copy of the Clip enum in painting.dart. -// -// We call it Clip in public Dart API to provide our developers the shortest -// name and the best experience. We call it ClipMode in C++ because we want to -// avoid name conflicts and refactoring C++ names without a nice IDE function -// is tedious. -enum ClipMode { - none, - hardEdge, - antiAlias, - antiAliasWithSaveLayer -}; +enum Clip { none, hardEdge, antiAlias, antiAliasWithSaveLayer }; class ContainerLayer; diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index 93195b0364ca6..3cb6ea1fb40ce 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -32,11 +32,14 @@ class LayerBuilder { virtual void PushTransform(const SkMatrix& matrix) = 0; - virtual void PushClipRect(const SkRect& rect, ClipMode clip_mode = ClipMode::antiAlias) = 0; + virtual void PushClipRect(const SkRect& rect, + Clip clip_behavior = Clip::antiAlias) = 0; - virtual void PushClipRoundedRect(const SkRRect& rect, ClipMode clip_mode = ClipMode::antiAlias) = 0; + virtual void PushClipRoundedRect(const SkRRect& rect, + Clip clip_behavior = Clip::antiAlias) = 0; - virtual void PushClipPath(const SkPath& path, ClipMode clip_mode = ClipMode::antiAlias) = 0; + virtual void PushClipPath(const SkPath& path, + Clip clip_behavior = Clip::antiAlias) = 0; virtual void PushOpacity(int alpha) = 0; @@ -53,7 +56,7 @@ class LayerBuilder { SkColor color, SkColor shadow_color, SkScalar device_pixel_ratio, - ClipMode clip_mode) = 0; + Clip clip_behavior) = 0; virtual void PushPerformanceOverlay(uint64_t enabled_options, const SkRect& rect) = 0; diff --git a/flow/layers/physical_shape_layer.cc b/flow/layers/physical_shape_layer.cc index a60b38dc5e8c6..8f9e59d6f1ac2 100644 --- a/flow/layers/physical_shape_layer.cc +++ b/flow/layers/physical_shape_layer.cc @@ -9,7 +9,8 @@ namespace flow { -PhysicalShapeLayer::PhysicalShapeLayer(ClipMode clip_mode) : isRect_(false), clip_mode_(clip_mode) {} +PhysicalShapeLayer::PhysicalShapeLayer(Clip clip_behavior) + : isRect_(false), clip_behavior_(clip_behavior) {} PhysicalShapeLayer::~PhysicalShapeLayer() = default; @@ -91,18 +92,18 @@ void PhysicalShapeLayer::Paint(PaintContext& context) const { context.canvas.drawPath(path_, paint); int saveCount = context.canvas.save(); - switch(clip_mode_) { - case ClipMode::hardEdge: + switch (clip_behavior_) { + case Clip::hardEdge: context.canvas.clipPath(path_, false); break; - case ClipMode::antiAlias: + case Clip::antiAlias: context.canvas.clipPath(path_, true); break; - case ClipMode::antiAliasWithSaveLayer: + case Clip::antiAliasWithSaveLayer: context.canvas.clipPath(path_, true); context.canvas.saveLayer(paint_bounds(), nullptr); break; - case ClipMode::none: + case Clip::none: break; } @@ -131,11 +132,12 @@ void PhysicalShapeLayer::DrawShadow(SkCanvas* canvas, SkColor inAmbient = SkColorSetA(color, kAmbientAlpha * SkColorGetA(color)); SkColor inSpot = SkColorSetA(color, kSpotAlpha * SkColorGetA(color)); SkColor ambientColor, spotColor; - SkShadowUtils::ComputeTonalColors(inAmbient, inSpot, - &ambientColor, &spotColor); - SkShadowUtils::DrawShadow(canvas, path, SkPoint3::Make(0, 0, dpr * elevation), - SkPoint3::Make(shadow_x, shadow_y, dpr * kLightHeight), - dpr * kLightRadius, ambientColor, spotColor, flags); + SkShadowUtils::ComputeTonalColors(inAmbient, inSpot, &ambientColor, + &spotColor); + SkShadowUtils::DrawShadow( + canvas, path, SkPoint3::Make(0, 0, dpr * elevation), + SkPoint3::Make(shadow_x, shadow_y, dpr * kLightHeight), + dpr * kLightRadius, ambientColor, spotColor, flags); } } // namespace flow diff --git a/flow/layers/physical_shape_layer.h b/flow/layers/physical_shape_layer.h index 9ed4e3a50efb8..344656c662b24 100644 --- a/flow/layers/physical_shape_layer.h +++ b/flow/layers/physical_shape_layer.h @@ -11,7 +11,7 @@ namespace flow { class PhysicalShapeLayer : public ContainerLayer { public: - PhysicalShapeLayer(ClipMode clip_mode); + PhysicalShapeLayer(Clip clip_behavior); ~PhysicalShapeLayer() override; void set_path(const SkPath& path); @@ -44,7 +44,7 @@ class PhysicalShapeLayer : public ContainerLayer { SkPath path_; bool isRect_; SkRRect frameRRect_; - ClipMode clip_mode_; + Clip clip_behavior_; }; } // namespace flow diff --git a/lib/ui/compositing/scene_builder.cc b/lib/ui/compositing/scene_builder.cc index f10690b5b3cdd..543b397597c64 100644 --- a/lib/ui/compositing/scene_builder.cc +++ b/lib/ui/compositing/scene_builder.cc @@ -63,19 +63,19 @@ void SceneBuilder::pushClipRect(double left, double right, double top, double bottom, - int clipMode) { + int clipBehavior) { layer_builder_->PushClipRect(SkRect::MakeLTRB(left, top, right, bottom), - static_cast(clipMode)); + static_cast(clipBehavior)); } -void SceneBuilder::pushClipRRect(const RRect& rrect, int clipMode) { +void SceneBuilder::pushClipRRect(const RRect& rrect, int clipBehavior) { layer_builder_->PushClipRoundedRect(rrect.sk_rrect, - static_cast(clipMode)); + static_cast(clipBehavior)); } -void SceneBuilder::pushClipPath(const CanvasPath* path, int clipMode) { +void SceneBuilder::pushClipPath(const CanvasPath* path, int clipBehavior) { layer_builder_->PushClipPath(path->path(), - static_cast(clipMode)); + static_cast(clipBehavior)); } void SceneBuilder::pushOpacity(int alpha) { @@ -108,14 +108,14 @@ void SceneBuilder::pushPhysicalShape(const CanvasPath* path, double elevation, int color, int shadow_color, - int clip_mode) { + int clip_behavior) { layer_builder_->PushPhysicalShape( path->path(), // elevation, // static_cast(color), // static_cast(shadow_color), UIDartState::Current()->window()->viewport_metrics().device_pixel_ratio, - static_cast(clip_mode)); + static_cast(clip_behavior)); } void SceneBuilder::pop() { diff --git a/lib/ui/compositing/scene_builder.h b/lib/ui/compositing/scene_builder.h index b26dbf68031b2..081396425a43c 100644 --- a/lib/ui/compositing/scene_builder.h +++ b/lib/ui/compositing/scene_builder.h @@ -38,9 +38,9 @@ class SceneBuilder : public RefCountedDartWrappable { double right, double top, double bottom, - int clipMode); - void pushClipRRect(const RRect& rrect, int clipMode); - void pushClipPath(const CanvasPath* path, int clipMode); + int clipBehavior); + void pushClipRRect(const RRect& rrect, int clipBehavior); + void pushClipPath(const CanvasPath* path, int clipBehavior); void pushOpacity(int alpha); void pushColorFilter(int color, int blendMode); void pushBackdropFilter(ImageFilter* filter); @@ -54,7 +54,7 @@ class SceneBuilder : public RefCountedDartWrappable { double elevation, int color, int shadowColor, - int clipMode); + int clipBehavior); void pop(); From 0b4432769945acd1fc55f034c69d857f987c43bb Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Jul 2018 14:39:14 -0400 Subject: [PATCH 0867/1190] Roll src/third_party/skia 396661825f45..1c94a8fabed7 (8 commits) (#5859) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_third_party | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index c328105bb877f..f8b2f63dea7b7 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '396661825f454a652ef3db41ed5bfa7c5174153d', + 'skia_revision': '1c94a8fabed7196e985a0ed81ce8325c8f606940', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 49d44b5e9e09c..48d4bdde9cba0 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 994e2c6cfd441d2ac7f125e1a3ea3e1c +Signature: 0c3e9f3f3ab44d4f91025837ff70b788 UNUSED LICENSES: From 216908652915c2b1d1db5d21352499db88e393d6 Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Mon, 23 Jul 2018 10:18:57 -0700 Subject: [PATCH 0868/1190] Synthesize Android MotionEvents with the long form obtain method. The simple form MotionEvent.obtain method I used before does not allow to synthesize multi pointer events. --- .../platform/PlatformViewsController.java | 88 +++++++++++++++---- 1 file changed, 72 insertions(+), 16 deletions(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index 417eb021e088a..52281f9d7a497 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -15,10 +15,14 @@ import io.flutter.view.FlutterView; import io.flutter.view.TextureRegistry; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import static android.view.MotionEvent.PointerCoords; +import static android.view.MotionEvent.PointerProperties; + /** * Manages platform views. *

@@ -191,19 +195,26 @@ private void resizePlatformView(MethodCall call, MethodChannel.Result result) { private void onTouch(MethodCall call, MethodChannel.Result result) { List args = call.arguments(); + float density = mFlutterView.getContext().getResources().getDisplayMetrics().density; + int id = (int) args.get(0); int downTime = (int) args.get(1); int eventTime = (int) args.get(2); int action = (int) args.get(3); - double x = (double) args.get(4); - double y = (double) args.get(5); - double pressure = (double) args.get(6); - double size = (double) args.get(7); - int metaState = (int) args.get(8); - double xPrecision = (double) args.get(9); - double yPrecision = (double) args.get(10); + int pointerCount = (int) args.get(4); + PointerProperties[] pointerProperties = + parsePointerPropertiesList(args.get(5)).toArray(new PointerProperties[pointerCount]); + PointerCoords[] pointerCoords = + parsePointerCoordsList(args.get(6), density).toArray(new PointerCoords[pointerCount]); + + int metaState = (int) args.get(7); + int buttonState = (int) args.get(8); + float xPrecision = (float) (double) args.get(9); + float yPrecision = (float) (double) args.get(10); int deviceId = (int) args.get(11); int edgeFlags = (int) args.get(12); + int source = (int) args.get(13); + int flags = (int) args.get(14); View view = vdControllers.get(id).getView(); if (view == null) { @@ -215,27 +226,72 @@ private void onTouch(MethodCall call, MethodChannel.Result result) { return; } - float density = mFlutterView.getContext().getResources().getDisplayMetrics().density; - MotionEvent event = MotionEvent.obtain( downTime, eventTime, action, - (float) x * density, - (float) y * density, - (float) pressure, - (float) size, + pointerCount, + pointerProperties, + pointerCoords, metaState, - (float) xPrecision, - (float) yPrecision, + buttonState, + xPrecision, + yPrecision, deviceId, - edgeFlags + edgeFlags, + source, + flags ); view.onTouchEvent(event); result.success(null); } + @SuppressWarnings("unchecked") + private static List parsePointerPropertiesList(Object rawPropertiesList) { + List rawProperties = (List) rawPropertiesList; + List pointerProperties = new ArrayList<>(); + for (Object o : rawProperties) { + pointerProperties.add(parsePointerProperties(o)); + } + return pointerProperties; + } + + @SuppressWarnings("unchecked") + private static PointerProperties parsePointerProperties(Object rawProperties) { + List propertiesList = (List) rawProperties; + PointerProperties properties = new MotionEvent.PointerProperties(); + properties.id = (int) propertiesList.get(0); + properties.toolType = (int) propertiesList.get(1); + return properties; + } + + @SuppressWarnings("unchecked") + private static List parsePointerCoordsList(Object rawCoordsList, float density) { + List rawCoords = (List) rawCoordsList; + List pointerCoords = new ArrayList<>(); + for (Object o : rawCoords) { + pointerCoords.add(parsePointerCoords(o, density)); + } + return pointerCoords; + } + + @SuppressWarnings("unchecked") + private static PointerCoords parsePointerCoords(Object rawCoords, float density) { + List coordsList = (List) rawCoords; + PointerCoords coords = new MotionEvent.PointerCoords(); + coords.orientation = (float) (double) coordsList.get(0); + coords.pressure = (float) (double) coordsList.get(1); + coords.size = (float) (double) coordsList.get(2); + coords.toolMajor = (float) (double) coordsList.get(3) * density; + coords.toolMinor = (float) (double) coordsList.get(4) * density; + coords.touchMajor = (float) (double) coordsList.get(5) * density; + coords.touchMinor = (float) (double) coordsList.get(6) * density; + coords.x = (float) (double) coordsList.get(7) * density; + coords.y = (float) (double) coordsList.get(8) * density; + return coords; + } + private int toPhysicalPixels(double logicalPixels) { float density = mFlutterView.getContext().getResources().getDisplayMetrics().density; return (int) Math.round(logicalPixels * density); From d2d8bf3941d87173bc6220f5c85de0246b18dae0 Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Wed, 25 Jul 2018 12:04:54 -0700 Subject: [PATCH 0869/1190] Pass touch events to embedded Android views with dispatchTouchEvents. Was previously calling onTouchEvent directly which doesn't make the event go through the full pipeline (e.g onInterceptTouchEvent is not called). --- .../io/flutter/plugin/platform/PlatformViewsController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index 52281f9d7a497..0515c0291b1cf 100644 --- a/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -243,7 +243,7 @@ private void onTouch(MethodCall call, MethodChannel.Result result) { flags ); - view.onTouchEvent(event); + view.dispatchTouchEvent(event); result.success(null); } From 7d17da76dbcf7df462d5051f61fde7b38aa4c98a Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 25 Jul 2018 12:26:24 -0700 Subject: [PATCH 0870/1190] Package Skia licenses into a separate file from other third party libraries (#5861) Fixes https://github.com/flutter/flutter/issues/19776 --- tools/licenses/lib/main.dart | 21 +- travis/licenses_golden/licenses_skia | 5678 +++++++++++++++++++ travis/licenses_golden/licenses_third_party | 5507 +----------------- travis/licenses_golden/licenses_topaz | 1456 ----- 4 files changed, 5808 insertions(+), 6854 deletions(-) create mode 100644 travis/licenses_golden/licenses_skia delete mode 100644 travis/licenses_golden/licenses_topaz diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index ed88763d1b4ca..06ea43faeb8cb 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -910,8 +910,17 @@ class RepositoryDirectory extends RepositoryEntry implements LicenseSource { } } } + + for (RepositoryDirectory child in virtualSubdirectories) { + _subdirectories.add(child); + _childrenByName[child.name] = child; + } } + // Override this to add additional child directories that do not represent a + // direct child of this directory's filesystem node. + List get virtualSubdirectories => []; + bool shouldRecurse(fs.IoNode entry) { return entry.name != '.cipd' && entry.name != '.git' && @@ -1913,6 +1922,7 @@ class RepositoryRootThirdPartyDirectory extends RepositoryGenericThirdPartyDirec && entry.name != 'instrumented_libraries' // unused according to chinmay && entry.name != 'android_tools' // excluded on advice && entry.name != 'googletest' // only used by tests + && entry.name != 'skia' // treated as a separate component && super.shouldRecurse(entry); } @@ -1946,8 +1956,6 @@ class RepositoryRootThirdPartyDirectory extends RepositoryGenericThirdPartyDirec return new RepositoryLibWebpDirectory(this, entry); if (entry.name == 'pkg') return new RepositoryPkgDirectory(this, entry); - if (entry.name == 'skia') - return new RepositorySkiaDirectory(this, entry); if (entry.name == 'vulkan') return new RepositoryVulkanDirectory(this, entry); return super.createSubdirectory(entry); @@ -2392,6 +2400,15 @@ class RepositoryRoot extends RepositoryDirectory { return new RepositoryTopazDirectory(this, entry); return super.createSubdirectory(entry); } + + @override + List get virtualSubdirectories { + // Skia is updated more frequently than other third party libraries and + // is therefore represented as a separate top-level component. + fs.Directory thirdPartyNode = io.walk.firstWhere((fs.IoNode node) => node.name == 'third_party'); + fs.IoNode skiaNode = thirdPartyNode.walk.firstWhere((fs.IoNode node) => node.name == 'skia'); + return [new RepositorySkiaDirectory(this, skiaNode)]; + } } diff --git a/travis/licenses_golden/licenses_skia b/travis/licenses_golden/licenses_skia new file mode 100644 index 0000000000000..01ee09ae1a837 --- /dev/null +++ b/travis/licenses_golden/licenses_skia @@ -0,0 +1,5678 @@ +Signature: b4bc250fabee117ed72a44a8cdf156a3 + +UNUSED LICENSES: + +==================================================================================================== +ORIGIN: ../../../third_party/skia/third_party/gif/LICENSE +TYPE: LicenseType.unknown +---------------------------------------------------------------------------------------------------- +Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version +1.1 (the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the +License. + +The Original Code is mozilla.org code. + +The Initial Developer of the Original Code is +Netscape Communications Corporation. +Portions created by the Initial Developer are Copyright (C) 1998 +the Initial Developer. All Rights Reserved. + +Contributor(s): + Chris Saari + Apple Computer + +Alternatively, the contents of this file may be used under the terms of +either the GNU General Public License Version 2 or later (the "GPL"), or +the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +in which case the provisions of the GPL or the LGPL are applicable instead +of those above. If you wish to allow use of your version of this file only +under the terms of either the GPL or the LGPL, and not to allow others to +use your version of this file under the terms of the MPL, indicate your +decision by deleting the provisions above and replace them with the notice +and other provisions required by the GPL or the LGPL. If you do not delete +the provisions above, a recipient may use your version of this file under +the terms of any one of the MPL, the GPL or the LGPL. +==================================================================================================== +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +USED LICENSES: + +==================================================================================================== +LIBRARY: gif +ORIGIN: ../../../third_party/skia/third_party/gif/SkGifImageReader.cpp +TYPE: LicenseType.lgpl +FILE: ../../../third_party/skia/third_party/gif/SkGifImageReader.cpp +FILE: ../../../third_party/skia/third_party/gif/SkGifImageReader.h +---------------------------------------------------------------------------------------------------- +GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! +==================================================================================================== + +==================================================================================================== +LIBRARY: gif +ORIGIN: ../../../third_party/skia/third_party/gif/SkGifImageReader.cpp +TYPE: LicenseType.unknown +FILE: ../../../third_party/skia/third_party/gif/SkGifImageReader.cpp +---------------------------------------------------------------------------------------------------- +The Graphics Interchange Format(c) is the copyright property of CompuServe +Incorporated. Only CompuServe Incorporated is authorized to define, redefine, +enhance, alter, modify or change in any way the definition of the format. + +CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free +license for the use of the Graphics Interchange Format(sm) in computer +software; computer software utilizing GIF(sm) must acknowledge ownership of the +Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in +User and Technical Documentation. Computer software utilizing GIF, which is +distributed or may be distributed without User or Technical Documentation must +display to the screen or printer a message acknowledging ownership of the +Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in +this case, the acknowledgement may be displayed in an opening screen or leading +banner, or a closing screen or trailing banner. A message such as the following +may be used: + + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." +==================================================================================================== + +==================================================================================================== +LIBRARY: harfbuzz +ORIGIN: ../../../third_party/skia/third_party/harfbuzz/hb-buffer-deserialize-json.hh +TYPE: LicenseType.unknown +FILE: ../../../third_party/skia/third_party/harfbuzz/hb-buffer-deserialize-json.hh +FILE: ../../../third_party/skia/third_party/harfbuzz/hb-buffer-deserialize-text.hh +---------------------------------------------------------------------------------------------------- +Copyright © 2013 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +==================================================================================================== + +==================================================================================================== +LIBRARY: harfbuzz +ORIGIN: ../../../third_party/skia/third_party/harfbuzz/hb-ot-shape-complex-indic-machine.hh +TYPE: LicenseType.unknown +FILE: ../../../third_party/skia/third_party/harfbuzz/hb-ot-shape-complex-indic-machine.hh +FILE: ../../../third_party/skia/third_party/harfbuzz/hb-ot-shape-complex-myanmar-machine.hh +---------------------------------------------------------------------------------------------------- +Copyright © 2011,2012 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +==================================================================================================== + +==================================================================================================== +LIBRARY: harfbuzz +ORIGIN: ../../../third_party/skia/third_party/harfbuzz/hb-ot-shape-complex-use-machine.hh +TYPE: LicenseType.unknown +FILE: ../../../third_party/skia/third_party/harfbuzz/hb-ot-shape-complex-use-machine.hh +---------------------------------------------------------------------------------------------------- +Copyright © 2015 Mozilla Foundation. +Copyright © 2015 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +==================================================================================================== + +==================================================================================================== +LIBRARY: harfbuzz +ORIGIN: ../../../third_party/skia/third_party/harfbuzz/hb-version.h +TYPE: LicenseType.unknown +FILE: ../../../third_party/skia/third_party/harfbuzz/hb-version.h +---------------------------------------------------------------------------------------------------- +Copyright © 2011 Google, Inc. + + This is part of HarfBuzz, a text shaping library. + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that the +above copyright notice and the following two paragraphs appear in +all copies of this software. + +IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR +DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. + +THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS +ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO +PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. +==================================================================================================== + +==================================================================================================== +LIBRARY: libsdl +LIBRARY: skia +ORIGIN: ../../../third_party/skia/bench/AndroidCodecBench.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/AndroidCodecBench.cpp +FILE: ../../../third_party/skia/bench/AndroidCodecBench.h +FILE: ../../../third_party/skia/bench/BlurOccludedRRectBench.cpp +FILE: ../../../third_party/skia/bench/DrawLatticeBench.cpp +FILE: ../../../third_party/skia/bench/EncoderBench.cpp +FILE: ../../../third_party/skia/bench/GrMipMapBench.cpp +FILE: ../../../third_party/skia/bench/HardStopGradientBench_ScaleNumColors.cpp +FILE: ../../../third_party/skia/bench/HardStopGradientBench_ScaleNumHardStops.cpp +FILE: ../../../third_party/skia/bench/HardStopGradientBench_SpecialHardStops.cpp +FILE: ../../../third_party/skia/bench/ImageCacheBudgetBench.cpp +FILE: ../../../third_party/skia/bench/PDFBench.cpp +FILE: ../../../third_party/skia/bench/QuickRejectBench.cpp +FILE: ../../../third_party/skia/bench/ShapesBench.cpp +FILE: ../../../third_party/skia/bench/SkRasterPipelineBench.cpp +FILE: ../../../third_party/skia/bench/StreamBench.cpp +FILE: ../../../third_party/skia/bench/SwizzleBench.cpp +FILE: ../../../third_party/skia/bench/TileImageFilterBench.cpp +FILE: ../../../third_party/skia/bench/VertexColorSpaceBench.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkPEG.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttributeParser.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttributeParser.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGCircle.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGCircle.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGClipPath.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGClipPath.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGContainer.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGContainer.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGDOM.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGDOM.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGDefs.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGEllipse.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGEllipse.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGG.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGHiddenContainer.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGIDMapper.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGLine.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGLine.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGLinearGradient.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGLinearGradient.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGNode.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGNode.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPath.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPath.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPoly.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPoly.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRect.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRect.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRenderContext.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRenderContext.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGSVG.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGSVG.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGShape.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGShape.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGStop.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGStop.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTransformableNode.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTransformableNode.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTypes.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.h +FILE: ../../../third_party/skia/experimental/xps_to_png/xps_to_png.cs +FILE: ../../../third_party/skia/fuzz/Fuzz.h +FILE: ../../../third_party/skia/fuzz/FuzzGradients.cpp +FILE: ../../../third_party/skia/fuzz/FuzzParsePath.cpp +FILE: ../../../third_party/skia/fuzz/FuzzPathop.cpp +FILE: ../../../third_party/skia/fuzz/fuzz.cpp +FILE: ../../../third_party/skia/gm/OverStroke.cpp +FILE: ../../../third_party/skia/gm/animatedGif.cpp +FILE: ../../../third_party/skia/gm/animatedimageblurs.cpp +FILE: ../../../third_party/skia/gm/arcto.cpp +FILE: ../../../third_party/skia/gm/bigrect.cpp +FILE: ../../../third_party/skia/gm/bitmapimage.cpp +FILE: ../../../third_party/skia/gm/blurcircles2.cpp +FILE: ../../../third_party/skia/gm/bug5252.cpp +FILE: ../../../third_party/skia/gm/bug530095.cpp +FILE: ../../../third_party/skia/gm/bug615686.cpp +FILE: ../../../third_party/skia/gm/circulararcs.cpp +FILE: ../../../third_party/skia/gm/clip_error.cpp +FILE: ../../../third_party/skia/gm/colorfilteralpha8.cpp +FILE: ../../../third_party/skia/gm/colorspacexform.cpp +FILE: ../../../third_party/skia/gm/complexclip4.cpp +FILE: ../../../third_party/skia/gm/complexclip_blur_tiled.cpp +FILE: ../../../third_party/skia/gm/croppedrects.cpp +FILE: ../../../third_party/skia/gm/dashcircle.cpp +FILE: ../../../third_party/skia/gm/drawregion.cpp +FILE: ../../../third_party/skia/gm/drawregionmodes.cpp +FILE: ../../../third_party/skia/gm/encode-platform.cpp +FILE: ../../../third_party/skia/gm/encode-srgb.cpp +FILE: ../../../third_party/skia/gm/filterbug.cpp +FILE: ../../../third_party/skia/gm/gamut.cpp +FILE: ../../../third_party/skia/gm/hardstop_gradients.cpp +FILE: ../../../third_party/skia/gm/imagemakewithfilter.cpp +FILE: ../../../third_party/skia/gm/imagemasksubset.cpp +FILE: ../../../third_party/skia/gm/lattice.cpp +FILE: ../../../third_party/skia/gm/lightingshader2.cpp +FILE: ../../../third_party/skia/gm/occludedrrectblur.cpp +FILE: ../../../third_party/skia/gm/overdrawcolorfilter.cpp +FILE: ../../../third_party/skia/gm/pathmaskcache.cpp +FILE: ../../../third_party/skia/gm/readpixels.cpp +FILE: ../../../third_party/skia/gm/rectangletexture.cpp +FILE: ../../../third_party/skia/gm/rrectclipdrawpaint.cpp +FILE: ../../../third_party/skia/gm/shapes.cpp +FILE: ../../../third_party/skia/gm/showmiplevels.cpp +FILE: ../../../third_party/skia/gm/simplerect.cpp +FILE: ../../../third_party/skia/gm/skbug_4868.cpp +FILE: ../../../third_party/skia/gm/skbug_5321.cpp +FILE: ../../../third_party/skia/gm/stroke_rect_shader.cpp +FILE: ../../../third_party/skia/gm/strokedlines.cpp +FILE: ../../../third_party/skia/gm/subsetshader.cpp +FILE: ../../../third_party/skia/gm/textblobblockreordering.cpp +FILE: ../../../third_party/skia/gm/windowrectangles.cpp +FILE: ../../../third_party/skia/include/codec/SkCodecAnimation.h +FILE: ../../../third_party/skia/include/core/SkBlendMode.h +FILE: ../../../third_party/skia/include/core/SkClipOp.h +FILE: ../../../third_party/skia/include/core/SkColorSpace.h +FILE: ../../../third_party/skia/include/core/SkColorSpaceXform.h +FILE: ../../../third_party/skia/include/core/SkICC.h +FILE: ../../../third_party/skia/include/core/SkMilestone.h +FILE: ../../../third_party/skia/include/core/SkOverdrawCanvas.h +FILE: ../../../third_party/skia/include/core/SkRasterHandleAllocator.h +FILE: ../../../third_party/skia/include/core/SkSwizzle.h +FILE: ../../../third_party/skia/include/core/SkYUVSizeInfo.h +FILE: ../../../third_party/skia/include/effects/SkArithmeticImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkOverdrawColorFilter.h +FILE: ../../../third_party/skia/include/effects/SkPaintImageFilter.h +FILE: ../../../third_party/skia/include/gpu/vk/GrVkBackendContext.h +FILE: ../../../third_party/skia/include/gpu/vk/GrVkDefines.h +FILE: ../../../third_party/skia/include/gpu/vk/GrVkTypes.h +FILE: ../../../third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h +FILE: ../../../third_party/skia/include/ports/SkImageGeneratorCG.h +FILE: ../../../third_party/skia/include/ports/SkImageGeneratorWIC.h +FILE: ../../../third_party/skia/include/private/GrAuditTrail.h +FILE: ../../../third_party/skia/include/private/GrOpList.h +FILE: ../../../third_party/skia/include/private/GrRenderTargetProxy.h +FILE: ../../../third_party/skia/include/private/GrSingleOwner.h +FILE: ../../../third_party/skia/include/private/GrSurfaceProxy.h +FILE: ../../../third_party/skia/include/private/GrTextureProxy.h +FILE: ../../../third_party/skia/include/private/SkArenaAlloc.h +FILE: ../../../third_party/skia/include/private/SkBitmaskEnum.h +FILE: ../../../third_party/skia/include/private/SkEncodedInfo.h +FILE: ../../../third_party/skia/include/private/SkLeanWindows.h +FILE: ../../../third_party/skia/include/private/SkSafe_math.h +FILE: ../../../third_party/skia/include/utils/SkNoDrawCanvas.h +FILE: ../../../third_party/skia/modules/sksg/samples/SampleSVGPong.cpp +FILE: ../../../third_party/skia/modules/skshaper/include/SkShaper.h +FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_harfbuzz.cpp +FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_primitive.cpp +FILE: ../../../third_party/skia/samplecode/DecodeFile.h +FILE: ../../../third_party/skia/samplecode/SampleAndroidShadows.cpp +FILE: ../../../third_party/skia/samplecode/SampleCode.cpp +FILE: ../../../third_party/skia/samplecode/SampleLitAtlas.cpp +FILE: ../../../third_party/skia/samplecode/SampleMegaStroke.cpp +FILE: ../../../third_party/skia/samplecode/SamplePathOverstroke.cpp +FILE: ../../../third_party/skia/samplecode/SampleSVGFile.cpp +FILE: ../../../third_party/skia/src/codec/SkCodecAnimationPriv.h +FILE: ../../../third_party/skia/src/codec/SkRawAdapterCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkRawAdapterCodec.h +FILE: ../../../third_party/skia/src/codec/SkRawCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkRawCodec.h +FILE: ../../../third_party/skia/src/codec/SkStreamBuffer.cpp +FILE: ../../../third_party/skia/src/codec/SkStreamBuffer.h +FILE: ../../../third_party/skia/src/compute/common/cl/assert_cl.c +FILE: ../../../third_party/skia/src/compute/common/cl/assert_cl.h +FILE: ../../../third_party/skia/src/compute/common/macros.h +FILE: ../../../third_party/skia/src/compute/common/util.c +FILE: ../../../third_party/skia/src/compute/common/util.h +FILE: ../../../third_party/skia/src/compute/hs/cl/bench/main.c +FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.c +FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.h +FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_target.h +FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_cl.cl +FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_cl.h +FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_cl_macros.h +FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_target.h +FILE: ../../../third_party/skia/src/compute/hs/gen/gen.h +FILE: ../../../third_party/skia/src/compute/hs/gen/main.c +FILE: ../../../third_party/skia/src/compute/hs/gen/networks.h +FILE: ../../../third_party/skia/src/compute/hs/gen/networks_merging.c +FILE: ../../../third_party/skia/src/compute/hs/gen/networks_sorting.c +FILE: ../../../third_party/skia/src/compute/hs/gen/target_cuda.c +FILE: ../../../third_party/skia/src/compute/hs/gen/target_glsl.c +FILE: ../../../third_party/skia/src/compute/hs/gen/target_opencl.c +FILE: ../../../third_party/skia/src/compute/hs/vk/hs_spirv_target.h +FILE: ../../../third_party/skia/src/compute/hs/vk/hs_vk_launcher.c +FILE: ../../../third_party/skia/src/compute/hs/vk/hs_vk_launcher.h +FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_glsl.h +FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_glsl_macros.h +FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_kernels.h +FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_target.h +FILE: ../../../third_party/skia/src/compute/sk/SkContext_Compute.cpp +FILE: ../../../third_party/skia/src/compute/sk/SkContext_Compute.h +FILE: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.cpp +FILE: ../../../third_party/skia/src/compute/sk/SkImage_Compute.cpp +FILE: ../../../third_party/skia/src/compute/sk/SkImage_Compute.h +FILE: ../../../third_party/skia/src/compute/sk/SkSurface_Compute.cpp +FILE: ../../../third_party/skia/src/compute/sk/SkSurface_Compute.h +FILE: ../../../third_party/skia/src/compute/skc/assert_skc.c +FILE: ../../../third_party/skia/src/compute/skc/assert_skc.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/render.cl +FILE: ../../../third_party/skia/src/compute/skc/styling.c +FILE: ../../../third_party/skia/src/compute/skc/styling.h +FILE: ../../../third_party/skia/src/compute/skc/styling_types.h +FILE: ../../../third_party/skia/src/compute/skc/tile.h +FILE: ../../../third_party/skia/src/compute/skc/util.c +FILE: ../../../third_party/skia/src/core/Sk4x4f.h +FILE: ../../../third_party/skia/src/core/SkATrace.cpp +FILE: ../../../third_party/skia/src/core/SkATrace.h +FILE: ../../../third_party/skia/src/core/SkAnnotationKeys.h +FILE: ../../../third_party/skia/src/core/SkArenaAlloc.cpp +FILE: ../../../third_party/skia/src/core/SkAutoMalloc.h +FILE: ../../../third_party/skia/src/core/SkAutoPixmapStorage.cpp +FILE: ../../../third_party/skia/src/core/SkAutoPixmapStorage.h +FILE: ../../../third_party/skia/src/core/SkBlendModePriv.h +FILE: ../../../third_party/skia/src/core/SkClipOpPriv.h +FILE: ../../../third_party/skia/src/core/SkColorLookUpTable.cpp +FILE: ../../../third_party/skia/src/core/SkColorLookUpTable.h +FILE: ../../../third_party/skia/src/core/SkColorMatrixFilterRowMajor255.h +FILE: ../../../third_party/skia/src/core/SkColorSpace.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpacePriv.h +FILE: ../../../third_party/skia/src/core/SkColorSpaceXform.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXformPriv.h +FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.h +FILE: ../../../third_party/skia/src/core/SkColorSpace_ICC.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpace_XYZ.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpace_XYZ.h +FILE: ../../../third_party/skia/src/core/SkCpu.cpp +FILE: ../../../third_party/skia/src/core/SkCpu.h +FILE: ../../../third_party/skia/src/core/SkDeduper.h +FILE: ../../../third_party/skia/src/core/SkExchange.h +FILE: ../../../third_party/skia/src/core/SkFixed15.h +FILE: ../../../third_party/skia/src/core/SkFuzzLogging.h +FILE: ../../../third_party/skia/src/core/SkGammas.h +FILE: ../../../third_party/skia/src/core/SkGlobalInitialization_core.cpp +FILE: ../../../third_party/skia/src/core/SkICC.cpp +FILE: ../../../third_party/skia/src/core/SkICCPriv.h +FILE: ../../../third_party/skia/src/core/SkImageFilterCache.cpp +FILE: ../../../third_party/skia/src/core/SkImageFilterCache.h +FILE: ../../../third_party/skia/src/core/SkLRUCache.h +FILE: ../../../third_party/skia/src/core/SkLights.cpp +FILE: ../../../third_party/skia/src/core/SkLiteDL.cpp +FILE: ../../../third_party/skia/src/core/SkLiteDL.h +FILE: ../../../third_party/skia/src/core/SkLiteRecorder.cpp +FILE: ../../../third_party/skia/src/core/SkLiteRecorder.h +FILE: ../../../third_party/skia/src/core/SkMSAN.h +FILE: ../../../third_party/skia/src/core/SkMakeUnique.h +FILE: ../../../third_party/skia/src/core/SkMatrixPriv.h +FILE: ../../../third_party/skia/src/core/SkModeColorFilter.h +FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.h +FILE: ../../../third_party/skia/src/core/SkNormalMapSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalMapSource.h +FILE: ../../../third_party/skia/src/core/SkNormalSource.cpp +FILE: ../../../third_party/skia/src/core/SkNormalSource.h +FILE: ../../../third_party/skia/src/core/SkOverdrawCanvas.cpp +FILE: ../../../third_party/skia/src/core/SkPM4f.h +FILE: ../../../third_party/skia/src/core/SkPM4fPriv.h +FILE: ../../../third_party/skia/src/core/SkPathMeasurePriv.h +FILE: ../../../third_party/skia/src/core/SkPipe.h +FILE: ../../../third_party/skia/src/core/SkRasterPipeline.cpp +FILE: ../../../third_party/skia/src/core/SkRasterPipeline.h +FILE: ../../../third_party/skia/src/core/SkRasterPipelineBlitter.cpp +FILE: ../../../third_party/skia/src/core/SkRecordedDrawable.cpp +FILE: ../../../third_party/skia/src/core/SkRecordedDrawable.h +FILE: ../../../third_party/skia/src/core/SkSRGB.cpp +FILE: ../../../third_party/skia/src/core/SkSRGB.h +FILE: ../../../third_party/skia/src/core/SkScaleToSides.h +FILE: ../../../third_party/skia/src/core/SkScopeExit.h +FILE: ../../../third_party/skia/src/core/SkSinglyLinkedList.h +FILE: ../../../third_party/skia/src/core/SkSpecialImage.cpp +FILE: ../../../third_party/skia/src/core/SkSpecialImage.h +FILE: ../../../third_party/skia/src/core/SkSpecialSurface.cpp +FILE: ../../../third_party/skia/src/core/SkSpecialSurface.h +FILE: ../../../third_party/skia/src/core/SkSwizzle.cpp +FILE: ../../../third_party/skia/src/effects/SkOverdrawColorFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkArithmeticImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkPaintImageFilter.cpp +FILE: ../../../third_party/skia/src/gpu/GrAppliedClip.h +FILE: ../../../third_party/skia/src/gpu/GrAuditTrail.cpp +FILE: ../../../third_party/skia/src/gpu/GrBitmapTextureMaker.cpp +FILE: ../../../third_party/skia/src/gpu/GrBitmapTextureMaker.h +FILE: ../../../third_party/skia/src/gpu/GrBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/GrBuffer.h +FILE: ../../../third_party/skia/src/gpu/GrClipStackClip.cpp +FILE: ../../../third_party/skia/src/gpu/GrClipStackClip.h +FILE: ../../../third_party/skia/src/gpu/GrColorSpaceXform.cpp +FILE: ../../../third_party/skia/src/gpu/GrColorSpaceXform.h +FILE: ../../../third_party/skia/src/gpu/GrContextPriv.h +FILE: ../../../third_party/skia/src/gpu/GrFixedClip.h +FILE: ../../../third_party/skia/src/gpu/GrGpuCommandBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/GrGpuCommandBuffer.h +FILE: ../../../third_party/skia/src/gpu/GrImageTextureMaker.cpp +FILE: ../../../third_party/skia/src/gpu/GrImageTextureMaker.h +FILE: ../../../third_party/skia/src/gpu/GrOpList.cpp +FILE: ../../../third_party/skia/src/gpu/GrProgramDesc.cpp +FILE: ../../../third_party/skia/src/gpu/GrReducedClip.cpp +FILE: ../../../third_party/skia/src/gpu/GrReducedClip.h +FILE: ../../../third_party/skia/src/gpu/GrRenderTargetContextPriv.h +FILE: ../../../third_party/skia/src/gpu/GrRenderTargetProxy.cpp +FILE: ../../../third_party/skia/src/gpu/GrResourceHandle.h +FILE: ../../../third_party/skia/src/gpu/GrScissorState.h +FILE: ../../../third_party/skia/src/gpu/GrShaderVar.cpp +FILE: ../../../third_party/skia/src/gpu/GrShaderVar.h +FILE: ../../../third_party/skia/src/gpu/GrShape.cpp +FILE: ../../../third_party/skia/src/gpu/GrShape.h +FILE: ../../../third_party/skia/src/gpu/GrStencilSettings.h +FILE: ../../../third_party/skia/src/gpu/GrStyle.cpp +FILE: ../../../third_party/skia/src/gpu/GrStyle.h +FILE: ../../../third_party/skia/src/gpu/GrSurfaceContext.cpp +FILE: ../../../third_party/skia/src/gpu/GrSurfaceContext.h +FILE: ../../../third_party/skia/src/gpu/GrSurfaceContextPriv.h +FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxy.cpp +FILE: ../../../third_party/skia/src/gpu/GrSwizzle.h +FILE: ../../../third_party/skia/src/gpu/GrTextureAdjuster.cpp +FILE: ../../../third_party/skia/src/gpu/GrTextureAdjuster.h +FILE: ../../../third_party/skia/src/gpu/GrTextureContext.cpp +FILE: ../../../third_party/skia/src/gpu/GrTextureContext.h +FILE: ../../../third_party/skia/src/gpu/GrTextureMaker.cpp +FILE: ../../../third_party/skia/src/gpu/GrTextureMaker.h +FILE: ../../../third_party/skia/src/gpu/GrTextureOpList.cpp +FILE: ../../../third_party/skia/src/gpu/GrTextureOpList.h +FILE: ../../../third_party/skia/src/gpu/GrTextureProducer.cpp +FILE: ../../../third_party/skia/src/gpu/GrTextureProducer.h +FILE: ../../../third_party/skia/src/gpu/GrTextureProxy.cpp +FILE: ../../../third_party/skia/src/gpu/GrTextureRenderTargetProxy.cpp +FILE: ../../../third_party/skia/src/gpu/GrTextureRenderTargetProxy.h +FILE: ../../../third_party/skia/src/gpu/GrUserStencilSettings.h +FILE: ../../../third_party/skia/src/gpu/GrWindowRectangles.h +FILE: ../../../third_party/skia/src/gpu/GrWindowRectsState.h +FILE: ../../../third_party/skia/src/gpu/effects/GrSRGBEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrSRGBEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrShadowGeoProc.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrShadowGeoProc.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLBuffer.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpuCommandBuffer.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLTestInterface.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLTestInterface.h +FILE: ../../../third_party/skia/src/gpu/gl/glfw/GrGLMakeNativeInterface_glfw.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLColorSpaceXformHelper.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLProgramDataManager.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrPathStencilSettings.h +FILE: ../../../third_party/skia/src/gpu/ops/GrRegionOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrRegionOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrShadowRRectOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrShadowRRectOp.h +FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyManager.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyManager.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyPipeline.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyPipeline.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorPool.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorPool.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSet.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSet.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpuCommandBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpuCommandBuffer.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageView.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageView.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipeline.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipeline.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineState.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineState.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateBuilder.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateBuilder.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateCache.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateDataManager.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateDataManager.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkResourceProvider.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkResourceProvider.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkSampler.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkSampler.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkUniformHandler.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkUniformHandler.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkVaryingHandler.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkVaryingHandler.h +FILE: ../../../third_party/skia/src/images/SkImageEncoderPriv.h +FILE: ../../../third_party/skia/src/opts/SkChecksum_opts.h +FILE: ../../../third_party/skia/src/opts/SkOpts_avx.cpp +FILE: ../../../third_party/skia/src/opts/SkOpts_crc32.cpp +FILE: ../../../third_party/skia/src/opts/SkOpts_sse42.cpp +FILE: ../../../third_party/skia/src/opts/SkSwizzler_opts.h +FILE: ../../../third_party/skia/src/pdf/SkBitmapKey.h +FILE: ../../../third_party/skia/src/pdf/SkPDFConvertType1FontStream.h +FILE: ../../../third_party/skia/src/pdf/SkPDFDocument.h +FILE: ../../../third_party/skia/src/pdf/SkPDFMakeCIDGlyphWidthsArray.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFMakeCIDGlyphWidthsArray.h +FILE: ../../../third_party/skia/src/pdf/SkPDFMakeToUnicodeCmap.h +FILE: ../../../third_party/skia/src/pipe/SkPipeCanvas.cpp +FILE: ../../../third_party/skia/src/pipe/SkPipeCanvas.h +FILE: ../../../third_party/skia/src/pipe/SkPipeFormat.h +FILE: ../../../third_party/skia/src/pipe/SkPipeReader.cpp +FILE: ../../../third_party/skia/src/pipe/SkRefSet.h +FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_empty_factory.cpp +FILE: ../../../third_party/skia/src/ports/SkImageGeneratorCG.cpp +FILE: ../../../third_party/skia/src/ports/SkImageGeneratorWIC.cpp +FILE: ../../../third_party/skia/src/shaders/SkColorFilterShader.h +FILE: ../../../third_party/skia/src/shaders/SkColorShader.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fGradientBase.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fGradientBase.h +FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fGradientPriv.h +FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fLinearGradient.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fLinearGradient.h +FILE: ../../../third_party/skia/src/sksl/SkSLCFGGenerator.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLCFGGenerator.h +FILE: ../../../third_party/skia/src/sksl/SkSLCPPCodeGenerator.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLCodeGenerator.h +FILE: ../../../third_party/skia/src/sksl/SkSLCompiler.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLCompiler.h +FILE: ../../../third_party/skia/src/sksl/SkSLContext.h +FILE: ../../../third_party/skia/src/sksl/SkSLErrorReporter.h +FILE: ../../../third_party/skia/src/sksl/SkSLGLSLCodeGenerator.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLGLSLCodeGenerator.h +FILE: ../../../third_party/skia/src/sksl/SkSLHCodeGenerator.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLIRGenerator.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLIRGenerator.h +FILE: ../../../third_party/skia/src/sksl/SkSLMain.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLMemoryLayout.h +FILE: ../../../third_party/skia/src/sksl/SkSLMetalCodeGenerator.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLMetalCodeGenerator.h +FILE: ../../../third_party/skia/src/sksl/SkSLParser.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLParser.h +FILE: ../../../third_party/skia/src/sksl/SkSLPosition.h +FILE: ../../../third_party/skia/src/sksl/SkSLSPIRVCodeGenerator.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLSPIRVCodeGenerator.h +FILE: ../../../third_party/skia/src/sksl/SkSLUtil.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLUtil.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTBinaryExpression.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTBlock.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTBoolLiteral.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTBreakStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTCallSuffix.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTContinueStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTDeclaration.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTDiscardStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTDoStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTExpression.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTExpressionStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTExtension.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTFieldSuffix.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTFloatLiteral.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTForStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTFunction.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTIdentifier.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTIfStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTIndexSuffix.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTIntLiteral.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTInterfaceBlock.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTModifiersDeclaration.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTNode.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTParameter.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTPositionNode.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTPrecision.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTPrefixExpression.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTReturnStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSection.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSuffix.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSuffixExpression.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTTernaryExpression.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTType.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTVarDeclaration.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTVarDeclarationStatement.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTWhileStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLBinaryExpression.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLBlock.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLBoolLiteral.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLBreakStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLConstructor.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLContinueStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLDiscardStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLDoStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLExpression.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLExpressionStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLExtension.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLField.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLFieldAccess.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLFloatLiteral.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLForStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLFunctionCall.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLFunctionDeclaration.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLFunctionDefinition.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLFunctionReference.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLIRNode.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLIfStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLIndexExpression.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLIntLiteral.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLInterfaceBlock.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLLayout.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLModifiers.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLModifiersDeclaration.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLNop.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLPostfixExpression.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLPrefixExpression.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLProgram.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLProgramElement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLReturnStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLSection.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLSetting.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLSwizzle.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLSymbol.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLSymbolTable.cpp +FILE: ../../../third_party/skia/src/sksl/ir/SkSLSymbolTable.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLTernaryExpression.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLType.cpp +FILE: ../../../third_party/skia/src/sksl/ir/SkSLType.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLTypeReference.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLUnresolvedFunction.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLVarDeclarations.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLVarDeclarationsStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariable.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLWhileStatement.h +FILE: ../../../third_party/skia/src/utils/SkMultiPictureDocument.cpp +FILE: ../../../third_party/skia/src/utils/SkMultiPictureDocument.h +FILE: ../../../third_party/skia/src/utils/SkMultiPictureDocumentPriv.h +FILE: ../../../third_party/skia/src/utils/SkOSPath.h +FILE: ../../../third_party/skia/third_party/libsdl/SDL_config_premake.h +---------------------------------------------------------------------------------------------------- +Copyright 2016 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skcms +LIBRARY: skia +LIBRARY: vulkanmemoryallocator +ORIGIN: ../../../third_party/skia/bench/GrCCGeometryBench.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp +FILE: ../../../third_party/skia/bench/JSONBench.cpp +FILE: ../../../third_party/skia/bench/PolyUtilsBench.cpp +FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp +FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp +FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp +FILE: ../../../third_party/skia/fuzz/FuzzRegionOp.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathDeserialize.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionSetPath.cpp +FILE: ../../../third_party/skia/gm/3dgm.cpp +FILE: ../../../third_party/skia/gm/hugepath.cpp +FILE: ../../../third_party/skia/gm/localmatrixshader.cpp +FILE: ../../../third_party/skia/gm/makeRasterImage.cpp +FILE: ../../../third_party/skia/gm/mandoline.cpp +FILE: ../../../third_party/skia/gm/orientation.cpp +FILE: ../../../third_party/skia/gm/pathmeasure.cpp +FILE: ../../../third_party/skia/gm/perspimages.cpp +FILE: ../../../third_party/skia/gm/polygonoffset.cpp +FILE: ../../../third_party/skia/gm/scaledemoji.cpp +FILE: ../../../third_party/skia/gm/shadermaskfilter.cpp +FILE: ../../../third_party/skia/gm/sharedcorners.cpp +FILE: ../../../third_party/skia/gm/skinning.cpp +FILE: ../../../third_party/skia/include/android/SkAnimatedImage.h +FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h +FILE: ../../../third_party/skia/include/core/SkCoverageMode.h +FILE: ../../../third_party/skia/include/core/SkFontParameters.h +FILE: ../../../third_party/skia/include/effects/SkOpPathEffect.h +FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h +FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h +FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h +FILE: ../../../third_party/skia/include/gpu/vk/GrVkMemoryAllocator.h +FILE: ../../../third_party/skia/include/private/GrCCClipPath.h +FILE: ../../../third_party/skia/include/private/GrCCPerOpListPaths.h +FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h +FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h +FILE: ../../../third_party/skia/include/private/SkMacros.h +FILE: ../../../third_party/skia/include/private/SkSafe32.h +FILE: ../../../third_party/skia/include/private/SkTo.h +FILE: ../../../third_party/skia/include/utils/Sk3D.h +FILE: ../../../third_party/skia/infra/cts/run_testlab.go +FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.h +FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.h +FILE: ../../../third_party/skia/modules/skottie/src/SkottieTest.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieTool.cpp +FILE: ../../../third_party/skia/modules/sksg/include/SkSGClipEffect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGGeometryTransform.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGGradient.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGImage.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGMaskEffect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGOpacityEffect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGPlane.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGRoundEffect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGScene.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGText.h +FILE: ../../../third_party/skia/modules/sksg/src/SkSGClipEffect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGGeometryTransform.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGGradient.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGImage.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGMaskEffect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGOpacityEffect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGPlane.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGRoundEffect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGScene.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGText.cpp +FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp +FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp +FILE: ../../../third_party/skia/samplecode/SampleGlyphTransform.cpp +FILE: ../../../third_party/skia/samplecode/SampleNima.cpp +FILE: ../../../third_party/skia/samplecode/SampleNimaActor.cpp +FILE: ../../../third_party/skia/samplecode/SampleNimaActor.h +FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp +FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.c +FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.h +FILE: ../../../third_party/skia/src/compute/hs/cl/bench/sort.cpp +FILE: ../../../third_party/skia/src/compute/hs/gen/target_debug.c +FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.c +FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.h +FILE: ../../../third_party/skia/src/compute/skc/allocator_host.c +FILE: ../../../third_party/skia/src/compute/skc/allocator_host.h +FILE: ../../../third_party/skia/src/compute/skc/interop.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/allocator_device_cl.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/allocator_device_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/interop/interop_glfw.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttck.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttrk.cl +FILE: ../../../third_party/skia/src/compute/skc/runtime.h +FILE: ../../../third_party/skia/src/compute/skc/skc_err.h +FILE: ../../../third_party/skia/src/compute/skc/skc_types.h +FILE: ../../../third_party/skia/src/compute/skc/suballocator.c +FILE: ../../../third_party/skia/src/compute/skc/suballocator.h +FILE: ../../../third_party/skia/src/compute/ts/transform_stack.c +FILE: ../../../third_party/skia/src/compute/ts/transform_stack.h +FILE: ../../../third_party/skia/src/core/SkBlurPriv.h +FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXformSteps.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXformSteps.h +FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_skcms.cpp +FILE: ../../../third_party/skia/src/core/SkCoverageModePriv.h +FILE: ../../../third_party/skia/src/core/SkCubicMap.cpp +FILE: ../../../third_party/skia/src/core/SkCubicMap.h +FILE: ../../../third_party/skia/src/core/SkDeferredDisplayList.cpp +FILE: ../../../third_party/skia/src/core/SkGlyph.cpp +FILE: ../../../third_party/skia/src/core/SkIPoint16.h +FILE: ../../../third_party/skia/src/core/SkMaskFilterBase.h +FILE: ../../../third_party/skia/src/core/SkPath_serial.cpp +FILE: ../../../third_party/skia/src/core/SkPicturePriv.h +FILE: ../../../third_party/skia/src/core/SkRRectPriv.h +FILE: ../../../third_party/skia/src/core/SkRectPriv.h +FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.cpp +FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.h +FILE: ../../../third_party/skia/src/core/SkSafeRange.h +FILE: ../../../third_party/skia/src/core/SkStrikeCache.cpp +FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp +FILE: ../../../third_party/skia/src/core/SkTextBlobPriv.h +FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp +FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h +FILE: ../../../third_party/skia/src/effects/SkOpPE.h +FILE: ../../../third_party/skia/src/effects/SkOpPathEffect.cpp +FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp +FILE: ../../../third_party/skia/src/effects/SkTrimPE.h +FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp +FILE: ../../../third_party/skia/src/gpu/GrContextThreadSafeProxyPriv.h +FILE: ../../../third_party/skia/src/gpu/GrDDLContext.cpp +FILE: ../../../third_party/skia/src/gpu/GrDirectContext.cpp +FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.cpp +FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h +FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp +FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h +FILE: ../../../third_party/skia/src/gpu/GrQuad.cpp +FILE: ../../../third_party/skia/src/gpu/GrRenderTargetProxyPriv.h +FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h +FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp +FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp +FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathCache.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathCache.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCSTLList.h +FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.h +FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlGpuCommandBuffer.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.mm +FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrDebugMarkerOp.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h +FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineLayout.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineLayout.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp +FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp +FILE: ../../../third_party/skia/src/opts/SkRasterPipeline_opts.h +FILE: ../../../third_party/skia/src/pdf/SkClusterator.cpp +FILE: ../../../third_party/skia/src/pdf/SkClusterator.h +FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.h +FILE: ../../../third_party/skia/src/sksl/SkSLJIT.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLJIT.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp +FILE: ../../../third_party/skia/src/utils/Sk3D.cpp +FILE: ../../../third_party/skia/src/utils/SkJSON.cpp +FILE: ../../../third_party/skia/src/utils/SkJSON.h +FILE: ../../../third_party/skia/src/utils/win/SkDWriteNTDDI_VERSION.h +FILE: ../../../third_party/skia/third_party/skcms/skcms.cc +FILE: ../../../third_party/skia/third_party/skcms/skcms.h +FILE: ../../../third_party/skia/third_party/skcms/skcms_internal.h +FILE: ../../../third_party/skia/third_party/skcms/src/Transform_inl.h +FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.cpp +FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skcms +ORIGIN: ../../../third_party/skia/third_party/skcms/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/third_party/skcms/version.sha1 +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +LIBRARY: vulkan +ORIGIN: ../../../flutter/third_party/txt/LICENSE +TYPE: LicenseType.apache +FILE: ../../../third_party/skia/src/images/SkWebpEncoder.cpp +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vk_platform.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_android.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_core.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_ios.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_macos.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_win32.h +FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_xcb.h +---------------------------------------------------------------------------------------------------- +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/icu/scripts/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/core/SkTraceEventCommon.h +---------------------------------------------------------------------------------------------------- +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/CQ_COMMITTERS +FILE: ../../../third_party/skia/DEPS +FILE: ../../../third_party/skia/Doxyfile +FILE: ../../../third_party/skia/animations/checkbox.xml +FILE: ../../../third_party/skia/animations/chest#1.jpg +FILE: ../../../third_party/skia/animations/fire#1.jpg +FILE: ../../../third_party/skia/animations/images#1.xml +FILE: ../../../third_party/skia/animations/jet#1.jpg +FILE: ../../../third_party/skia/animations/lines#1.xml +FILE: ../../../third_party/skia/animations/movie#1.xml +FILE: ../../../third_party/skia/animations/paths#1.xml +FILE: ../../../third_party/skia/animations/redcross#1.jpg +FILE: ../../../third_party/skia/animations/text#1.xml +FILE: ../../../third_party/skia/bench/microbench.json +FILE: ../../../third_party/skia/bench/skpbench.json +FILE: ../../../third_party/skia/docker/skia-release/Dockerfile +FILE: ../../../third_party/skia/docker/skia-with-swift-shader-base/Dockerfile +FILE: ../../../third_party/skia/docker/skia-with-swift-shader-base/build-with-swift-shader-and-run +FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh +FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh +FILE: ../../../third_party/skia/docs/SkBlendMode_Reference.bmh +FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh +FILE: ../../../third_party/skia/docs/SkColor4f_Reference.bmh +FILE: ../../../third_party/skia/docs/SkColor_Reference.bmh +FILE: ../../../third_party/skia/docs/SkIPoint_Reference.bmh +FILE: ../../../third_party/skia/docs/SkIRect_Reference.bmh +FILE: ../../../third_party/skia/docs/SkImageInfo_Reference.bmh +FILE: ../../../third_party/skia/docs/SkImage_Reference.bmh +FILE: ../../../third_party/skia/docs/SkMatrix_Reference.bmh +FILE: ../../../third_party/skia/docs/SkPaint_Reference.bmh +FILE: ../../../third_party/skia/docs/SkPath_Reference.bmh +FILE: ../../../third_party/skia/docs/SkPicture_Reference.bmh +FILE: ../../../third_party/skia/docs/SkPixmap_Reference.bmh +FILE: ../../../third_party/skia/docs/SkPoint_Reference.bmh +FILE: ../../../third_party/skia/docs/SkRRect_Reference.bmh +FILE: ../../../third_party/skia/docs/SkRect_Reference.bmh +FILE: ../../../third_party/skia/docs/SkSurface_Reference.bmh +FILE: ../../../third_party/skia/docs/illustrations.bmh +FILE: ../../../third_party/skia/docs/markup.bmh +FILE: ../../../third_party/skia/docs/overview.bmh +FILE: ../../../third_party/skia/docs/status.json +FILE: ../../../third_party/skia/docs/undocumented.bmh +FILE: ../../../third_party/skia/docs/usingBookmaker.bmh +FILE: ../../../third_party/skia/experimental/docs/animationCommon.js +FILE: ../../../third_party/skia/experimental/docs/backend.js +FILE: ../../../third_party/skia/experimental/docs/canvasBackend.js +FILE: ../../../third_party/skia/experimental/docs/exampleSlides.js +FILE: ../../../third_party/skia/experimental/docs/interpolatorFunctions.js +FILE: ../../../third_party/skia/experimental/docs/jsonbaseddoc.htm +FILE: ../../../third_party/skia/experimental/docs/svgBackend.js +FILE: ../../../third_party/skia/experimental/docs/svgbaseddoc.htm +FILE: ../../../third_party/skia/experimental/docs/utilities.js +FILE: ../../../third_party/skia/experimental/wasm/shell.html +FILE: ../../../third_party/skia/infra/bots/android_bin.isolate +FILE: ../../../third_party/skia/infra/bots/assets.isolate +FILE: ../../../third_party/skia/infra/bots/assets/android_ndk_darwin/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/android_ndk_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/android_ndk_windows/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/android_sdk_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/armhf_sysroot/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/cast_toolchain/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/chromebook_arm_gles/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/chromebook_x86_64_gles/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/clang_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/clang_win/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/cmake_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/emscripten_sdk/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/gcloud_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/go/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_debug/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_release/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_sdk/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/lottie-samples/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/mips64el_toolchain_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/moltenvk/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/node/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/opencl_headers/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/opencl_intel_neo_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/opencl_ocl_icd_linux/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/procdump_win/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/protoc/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/skimage/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/skp/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/svg/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/valgrind/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/win_ninja/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/win_toolchain/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/win_toolchain_2015/VERSION +FILE: ../../../third_party/skia/infra/bots/assets/win_vulkan_sdk/VERSION +FILE: ../../../third_party/skia/infra/bots/calmbench.isolate +FILE: ../../../third_party/skia/infra/bots/cfg.json +FILE: ../../../third_party/skia/infra/bots/ct/blacklists/get_images_from_skps_100k_c37e844a6f8708-eee762104c75bd.json +FILE: ../../../third_party/skia/infra/bots/ct/blacklists/get_images_from_skps_100k_fad657e-276e633.json +FILE: ../../../third_party/skia/infra/bots/empty.isolate +FILE: ../../../third_party/skia/infra/bots/infrabots.isolate +FILE: ../../../third_party/skia/infra/bots/ios_bin.isolate +FILE: ../../../third_party/skia/infra/bots/isolate_android_sdk_linux.isolate +FILE: ../../../third_party/skia/infra/bots/isolate_gcloud_linux.isolate +FILE: ../../../third_party/skia/infra/bots/isolate_go.isolate +FILE: ../../../third_party/skia/infra/bots/jobs.json +FILE: ../../../third_party/skia/infra/bots/perf_skia_bundled.isolate +FILE: ../../../third_party/skia/infra/bots/recipe_modules/binary_size/examples/full.expected/binary_size.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_API26.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Chromebook_GLES.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Chromebook_GLES.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Coverage.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-MSAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-OpenCL.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_CPU_LIMIT_SSE41.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SafeStack.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Mini.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Static.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SwiftShader.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-arm-Release-Chromecast.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-loongson3a-Release.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Shared.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/examples/full.expected/test.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Win-Clang-x86_64-Release-ParentRevision.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/cross_repo_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/flutter_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/parent_revision_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/test.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/test.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/doxygen/examples/full.expected/doxygen.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/env/examples/full.expected/test.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-Coverage.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-OpenCL.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_ProcDump.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed_golo.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed_once.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/exceptions.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/failed_read_version.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/retry_ios_install.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/retry_ios_install_retries_exhausted.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/git/examples/full.expected/test.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/gsutil/examples/full.expected/failed_all_uploads.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/gsutil/examples/full.expected/failed_one_upload.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/gsutil/examples/full.expected/gsutil_tests.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/infra/examples/full.expected/failed_all_updates.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/infra/examples/full.expected/failed_one_update.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/infra/examples/full.expected/infra_tests.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/always-use-exparchive.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/basic.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/discover.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-batch-bmiss.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-batch-emiss.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-batch.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-miss.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-multi-miss.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-multi.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/extra.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/missing.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/none.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/run/examples/full.expected/test.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/skia_swarming/examples/full.expected/test.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/basic.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/show_isolated_out_in_collect_step.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/show_shards_in_collect_step.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/swarming_expired_new.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/swarming_expired_old.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/swarming_timeout_new.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/swarming_timeout_old.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/trybot.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming_client/examples/full.expected/basic.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json +FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/win_test.json +FILE: ../../../third_party/skia/infra/bots/recipes/android_compile.expected/android_compile_nontrybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/android_compile.expected/android_compile_trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_bookmaker.json +FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_failed_extract_fiddles.json +FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_failed_fiddlecli.json +FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_failed_fiddles.json +FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_failed_upload.json +FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/percommit_bookmaker.json +FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/percommit_failed_validation.json +FILE: ../../../third_party/skia/infra/bots/recipes/calmbench.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/calmbench.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/check_generated_files.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json +FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json +FILE: ../../../third_party/skia/infra/bots/recipes/compute_test.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-OpenCL.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_100k_SKPs.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_10k_SKPs.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_10k_SKPs_Trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_1m_SKPs.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_1m_SKPs_2slaves_failure.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_1m_SKPs_slave3_failure.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_SKPs_UnknownBuilder.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_GPU_BENCH_10k_SKPs.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_GPU_BENCH_1k_SKPs.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_IMG_DECODE_100k_SKPs.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_IMG_DECODE_10k_SKPs.json +FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_IMG_DECODE_10k_SKPs_Trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/housekeeper.expected/Housekeeper-PerCommit-Trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/housekeeper.expected/Housekeeper-PerCommit.json +FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/failed_all_updates.json +FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/failed_one_update.json +FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/infra_tests.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_NoGPUThreads.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Debug-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-GPU-Cortex_A7-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-MoltenVK_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Release-All-CommandBuffer.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Release-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-iOS-Clang-iPadPro-GPU-GT7800-arm64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json +FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/Housekeeper-Weekly-RecreateSKPs.json +FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/failed_upload.json +FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Release-All-Android_CCPR_Skpbench.json +FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench.json +FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench_DDLRecord_9x9.json +FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench_DDLTotal_9x9.json +FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/skqp_test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-All-Android_NoGPUThreads.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Release-All-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-MotoG4-CPU-Snapdragon617-arm-Release-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm-Debug-All-Android_ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-Clang-Chorizo-GPU-Cortex_A7-arm-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Release-All-SwiftShader.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Release-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Release-All-NativeFonts.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookAir7.2-GPU-IntelHD6000-x86_64-Debug-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Metal.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-MoltenVK_Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Debug-All-CommandBuffer.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL1.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL3.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Lottie.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Vulkan_Coverage.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_PreAbandonGpuContext_SK_CPU_LIMIT_SSE41.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-ReleaseAndAbandonGpuContext.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC5i7RYH-CPU-AVX2-x86_64-Debug-All-NativeFonts_GDI.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Release-All-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ShuttleA-GPU-GTX660-x86_64-Release-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Debug-All-ANGLE.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ZBOX-GPU-GTX1070-x86_64-Debug-All-Vulkan.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FAAA.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FDAA.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FSAA.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-iOS-Clang-iPadPro-GPU-GT7800-arm64-Release-All.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_dm.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_get_hashes.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_pull.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_push.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/internal_bot_2.json +FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_calmbench_results.expected/normal_bot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_calmbench_results.expected/trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/alternate_bucket.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/failed_all.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/failed_once.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/normal_bot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/alternate_bucket.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/failed_all.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/failed_once.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/normal_bot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_nano_results.expected/normal_bot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_nano_results.expected/trybot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_skiaserve.expected/normal_bot.json +FILE: ../../../third_party/skia/infra/bots/recipes/upload_skiaserve.expected/trybot.json +FILE: ../../../third_party/skia/infra/bots/resources.isolate +FILE: ../../../third_party/skia/infra/bots/skpbench_skia_bundled.isolate +FILE: ../../../third_party/skia/infra/bots/swarm_recipe.isolate +FILE: ../../../third_party/skia/infra/bots/tasks.json +FILE: ../../../third_party/skia/infra/bots/test_skia_bundled.isolate +FILE: ../../../third_party/skia/infra/bots/tools/luci-go/linux64/isolate.sha1 +FILE: ../../../third_party/skia/infra/bots/tools/luci-go/mac64/isolate.sha1 +FILE: ../../../third_party/skia/infra/bots/tools/luci-go/win64/isolate.exe.sha1 +FILE: ../../../third_party/skia/infra/branch-config/cq.cfg +FILE: ../../../third_party/skia/infra/config/recipes.cfg +FILE: ../../../third_party/skia/infra/cts/whitelist_devices.json +FILE: ../../../third_party/skia/infra/project-config/cr-buildbucket.cfg +FILE: ../../../third_party/skia/infra/project-config/project.cfg +FILE: ../../../third_party/skia/infra/project-config/refs.cfg +FILE: ../../../third_party/skia/public.bzl +FILE: ../../../third_party/skia/site/METADATA +FILE: ../../../third_party/skia/site/dev/METADATA +FILE: ../../../third_party/skia/site/dev/design/PdfLogicalDocumentStructure.png +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.1.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.1.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.1.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.1.svg +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.2.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.2.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.2.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.2.svg +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.1.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.1.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.1.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.1.svg +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.2.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.2.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.2.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.2.svg +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.3.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.3.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.3.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.3.svg +FILE: ../../../third_party/skia/site/dev/design/conical/lemma1.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/lemma1.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/lemma1.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/lemma1.svg +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.1.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.1.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.1.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.1.svg +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.2.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.2.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.2.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.2.svg +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/lemma4.ggb!/geogebra.xml +FILE: ../../../third_party/skia/site/dev/design/conical/lemma4.ggb!/geogebra_javascript.js +FILE: ../../../third_party/skia/site/dev/design/conical/lemma4.ggb!/geogebra_thumbnail.png +FILE: ../../../third_party/skia/site/dev/design/conical/lemma4.svg +FILE: ../../../third_party/skia/site/dev/tools/debugger.png +FILE: ../../../third_party/skia/site/dev/tools/image.png +FILE: ../../../third_party/skia/site/dev/tools/onlinedebugger.png +FILE: ../../../third_party/skia/site/dev/tools/tracing.png +FILE: ../../../third_party/skia/site/dev/tools/tracing_load.png +FILE: ../../../third_party/skia/site/favicon.ico +FILE: ../../../third_party/skia/site/user/METADATA +FILE: ../../../third_party/skia/site/user/api/METADATA +FILE: ../../../third_party/skia/site/user/api/catalog.htm +FILE: ../../../third_party/skia/site/user/sample/architecture.png +FILE: ../../../third_party/skia/site/user/sample/detail_correct.png +FILE: ../../../third_party/skia/site/user/sample/detail_wrong.png +FILE: ../../../third_party/skia/site/user/sample/gamut_correct.png +FILE: ../../../third_party/skia/site/user/sample/gamut_wrong.png +FILE: ../../../third_party/skia/site/user/sample/gradient_correct.png +FILE: ../../../third_party/skia/site/user/sample/gradient_wrong.png +FILE: ../../../third_party/skia/site/user/sample/transfer_fn.png +FILE: ../../../third_party/skia/src/core/SkOrderedReadBuffer.h +FILE: ../../../third_party/skia/src/sksl/lex/sksl.lex +FILE: ../../../third_party/skia/src/sksl/sksl.inc +FILE: ../../../third_party/skia/src/sksl/sksl_cpu.inc +FILE: ../../../third_party/skia/src/sksl/sksl_fp.inc +FILE: ../../../third_party/skia/src/sksl/sksl_frag.inc +FILE: ../../../third_party/skia/src/sksl/sksl_geom.inc +FILE: ../../../third_party/skia/src/sksl/sksl_vert.inc +---------------------------------------------------------------------------------------------------- +Copyright (c) 2011 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/bench/AAClipBench.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/AAClipBench.cpp +FILE: ../../../third_party/skia/bench/Benchmark.cpp +FILE: ../../../third_party/skia/bench/Benchmark.h +FILE: ../../../third_party/skia/bench/BitmapBench.cpp +FILE: ../../../third_party/skia/bench/BitmapRectBench.cpp +FILE: ../../../third_party/skia/bench/BlurBench.cpp +FILE: ../../../third_party/skia/bench/ChromeBench.cpp +FILE: ../../../third_party/skia/bench/DashBench.cpp +FILE: ../../../third_party/skia/bench/FontScalerBench.cpp +FILE: ../../../third_party/skia/bench/GradientBench.cpp +FILE: ../../../third_party/skia/bench/MatrixBench.cpp +FILE: ../../../third_party/skia/bench/MutexBench.cpp +FILE: ../../../third_party/skia/bench/PathBench.cpp +FILE: ../../../third_party/skia/bench/PathIterBench.cpp +FILE: ../../../third_party/skia/bench/PicturePlaybackBench.cpp +FILE: ../../../third_party/skia/bench/RectBench.cpp +FILE: ../../../third_party/skia/bench/RegionBench.cpp +FILE: ../../../third_party/skia/bench/RepeatTileBench.cpp +FILE: ../../../third_party/skia/bench/ScalarBench.cpp +FILE: ../../../third_party/skia/bench/ShaderMaskBench.cpp +FILE: ../../../third_party/skia/bench/TextBench.cpp +FILE: ../../../third_party/skia/bench/VertBench.cpp +FILE: ../../../third_party/skia/experimental/Networking/SkSockets.cpp +FILE: ../../../third_party/skia/experimental/Networking/SkSockets.h +FILE: ../../../third_party/skia/gm/aaclip.cpp +FILE: ../../../third_party/skia/gm/aarectmodes.cpp +FILE: ../../../third_party/skia/gm/arithmode.cpp +FILE: ../../../third_party/skia/gm/bitmapcopy.cpp +FILE: ../../../third_party/skia/gm/bitmapfilters.cpp +FILE: ../../../third_party/skia/gm/bitmaprect.cpp +FILE: ../../../third_party/skia/gm/blurs.cpp +FILE: ../../../third_party/skia/gm/clip_strokerect.cpp +FILE: ../../../third_party/skia/gm/color4f.cpp +FILE: ../../../third_party/skia/gm/colormatrix.cpp +FILE: ../../../third_party/skia/gm/complexclip.cpp +FILE: ../../../third_party/skia/gm/complexclip2.cpp +FILE: ../../../third_party/skia/gm/convexpaths.cpp +FILE: ../../../third_party/skia/gm/cubicpaths.cpp +FILE: ../../../third_party/skia/gm/degeneratesegments.cpp +FILE: ../../../third_party/skia/gm/dftext.cpp +FILE: ../../../third_party/skia/gm/drawbitmaprect.cpp +FILE: ../../../third_party/skia/gm/drawlooper.cpp +FILE: ../../../third_party/skia/gm/emptypath.cpp +FILE: ../../../third_party/skia/gm/encode.cpp +FILE: ../../../third_party/skia/gm/extractbitmap.cpp +FILE: ../../../third_party/skia/gm/filltypes.cpp +FILE: ../../../third_party/skia/gm/filltypespersp.cpp +FILE: ../../../third_party/skia/gm/filterbitmap.cpp +FILE: ../../../third_party/skia/gm/filterindiabox.cpp +FILE: ../../../third_party/skia/gm/fontscaler.cpp +FILE: ../../../third_party/skia/gm/gammatext.cpp +FILE: ../../../third_party/skia/gm/giantbitmap.cpp +FILE: ../../../third_party/skia/gm/gm.cpp +FILE: ../../../third_party/skia/gm/gm.h +FILE: ../../../third_party/skia/gm/gradients.cpp +FILE: ../../../third_party/skia/gm/gradtext.cpp +FILE: ../../../third_party/skia/gm/hairmodes.cpp +FILE: ../../../third_party/skia/gm/hittestpath.cpp +FILE: ../../../third_party/skia/gm/image.cpp +FILE: ../../../third_party/skia/gm/imageblur.cpp +FILE: ../../../third_party/skia/gm/imageblur2.cpp +FILE: ../../../third_party/skia/gm/imagefiltersbase.cpp +FILE: ../../../third_party/skia/gm/imagefilterscropped.cpp +FILE: ../../../third_party/skia/gm/lcdtext.cpp +FILE: ../../../third_party/skia/gm/linepaths.cpp +FILE: ../../../third_party/skia/gm/ninepatchstretch.cpp +FILE: ../../../third_party/skia/gm/pathfill.cpp +FILE: ../../../third_party/skia/gm/pathreverse.cpp +FILE: ../../../third_party/skia/gm/points.cpp +FILE: ../../../third_party/skia/gm/poly2poly.cpp +FILE: ../../../third_party/skia/gm/quadpaths.cpp +FILE: ../../../third_party/skia/gm/shadertext.cpp +FILE: ../../../third_party/skia/gm/shadertext2.cpp +FILE: ../../../third_party/skia/gm/shadertext3.cpp +FILE: ../../../third_party/skia/gm/shadows.cpp +FILE: ../../../third_party/skia/gm/strokefill.cpp +FILE: ../../../third_party/skia/gm/strokerects.cpp +FILE: ../../../third_party/skia/gm/strokes.cpp +FILE: ../../../third_party/skia/gm/tablecolorfilter.cpp +FILE: ../../../third_party/skia/gm/texteffects.cpp +FILE: ../../../third_party/skia/gm/tilemodes.cpp +FILE: ../../../third_party/skia/gm/tilemodes_scaled.cpp +FILE: ../../../third_party/skia/gm/tinybitmap.cpp +FILE: ../../../third_party/skia/gm/verttext.cpp +FILE: ../../../third_party/skia/gm/verttext2.cpp +FILE: ../../../third_party/skia/gm/xfermodes.cpp +FILE: ../../../third_party/skia/include/core/SkData.h +FILE: ../../../third_party/skia/include/core/SkImageEncoder.h +FILE: ../../../third_party/skia/include/core/SkImageFilter.h +FILE: ../../../third_party/skia/include/core/SkMatrix44.h +FILE: ../../../third_party/skia/include/core/SkSize.h +FILE: ../../../third_party/skia/include/core/SkTLazy.h +FILE: ../../../third_party/skia/include/effects/SkLayerDrawLooper.h +FILE: ../../../third_party/skia/include/gpu/GrRenderTarget.h +FILE: ../../../third_party/skia/include/gpu/GrTexture.h +FILE: ../../../third_party/skia/include/gpu/gl/GrGLConfig.h +FILE: ../../../third_party/skia/include/gpu/gl/GrGLConfig_chrome.h +FILE: ../../../third_party/skia/include/gpu/gl/GrGLInterface.h +FILE: ../../../third_party/skia/include/ports/SkTypeface_mac.h +FILE: ../../../third_party/skia/include/ports/SkTypeface_win.h +FILE: ../../../third_party/skia/include/private/SkTArray.h +FILE: ../../../third_party/skia/include/utils/SkNWayCanvas.h +FILE: ../../../third_party/skia/include/utils/mac/SkCGUtils.h +FILE: ../../../third_party/skia/include/views/SkTouchGesture.h +FILE: ../../../third_party/skia/samplecode/ClockFaceView.cpp +FILE: ../../../third_party/skia/samplecode/Sample2PtRadial.cpp +FILE: ../../../third_party/skia/samplecode/SampleAAClip.cpp +FILE: ../../../third_party/skia/samplecode/SampleAARectModes.cpp +FILE: ../../../third_party/skia/samplecode/SampleAARects.cpp +FILE: ../../../third_party/skia/samplecode/SampleAll.cpp +FILE: ../../../third_party/skia/samplecode/SampleAnimator.cpp +FILE: ../../../third_party/skia/samplecode/SampleArc.cpp +FILE: ../../../third_party/skia/samplecode/SampleBigBlur.cpp +FILE: ../../../third_party/skia/samplecode/SampleBigGradient.cpp +FILE: ../../../third_party/skia/samplecode/SampleBitmapRect.cpp +FILE: ../../../third_party/skia/samplecode/SampleBlur.cpp +FILE: ../../../third_party/skia/samplecode/SampleCamera.cpp +FILE: ../../../third_party/skia/samplecode/SampleCircle.cpp +FILE: ../../../third_party/skia/samplecode/SampleClamp.cpp +FILE: ../../../third_party/skia/samplecode/SampleClip.cpp +FILE: ../../../third_party/skia/samplecode/SampleCode.h +FILE: ../../../third_party/skia/samplecode/SampleColorFilter.cpp +FILE: ../../../third_party/skia/samplecode/SampleComplexClip.cpp +FILE: ../../../third_party/skia/samplecode/SampleConcavePaths.cpp +FILE: ../../../third_party/skia/samplecode/SampleDash.cpp +FILE: ../../../third_party/skia/samplecode/SampleDegenerateTwoPtRadials.cpp +FILE: ../../../third_party/skia/samplecode/SampleDither.cpp +FILE: ../../../third_party/skia/samplecode/SampleEffects.cpp +FILE: ../../../third_party/skia/samplecode/SampleEmboss.cpp +FILE: ../../../third_party/skia/samplecode/SampleFillType.cpp +FILE: ../../../third_party/skia/samplecode/SampleFilter2.cpp +FILE: ../../../third_party/skia/samplecode/SampleFontCache.cpp +FILE: ../../../third_party/skia/samplecode/SampleFontScalerTest.cpp +FILE: ../../../third_party/skia/samplecode/SampleFuzz.cpp +FILE: ../../../third_party/skia/samplecode/SampleGradients.cpp +FILE: ../../../third_party/skia/samplecode/SampleHairCurves.cpp +FILE: ../../../third_party/skia/samplecode/SampleHairModes.cpp +FILE: ../../../third_party/skia/samplecode/SampleHairline.cpp +FILE: ../../../third_party/skia/samplecode/SampleLCD.cpp +FILE: ../../../third_party/skia/samplecode/SampleLayerMask.cpp +FILE: ../../../third_party/skia/samplecode/SampleLayers.cpp +FILE: ../../../third_party/skia/samplecode/SampleLines.cpp +FILE: ../../../third_party/skia/samplecode/SampleMeasure.cpp +FILE: ../../../third_party/skia/samplecode/SamplePatch.cpp +FILE: ../../../third_party/skia/samplecode/SamplePath.cpp +FILE: ../../../third_party/skia/samplecode/SamplePathClip.cpp +FILE: ../../../third_party/skia/samplecode/SamplePathEffects.cpp +FILE: ../../../third_party/skia/samplecode/SamplePathFill.cpp +FILE: ../../../third_party/skia/samplecode/SamplePoints.cpp +FILE: ../../../third_party/skia/samplecode/SamplePolyToPoly.cpp +FILE: ../../../third_party/skia/samplecode/SampleRegion.cpp +FILE: ../../../third_party/skia/samplecode/SampleRepeatTile.cpp +FILE: ../../../third_party/skia/samplecode/SampleShaderText.cpp +FILE: ../../../third_party/skia/samplecode/SampleShaders.cpp +FILE: ../../../third_party/skia/samplecode/SampleSlides.cpp +FILE: ../../../third_party/skia/samplecode/SampleStrokePath.cpp +FILE: ../../../third_party/skia/samplecode/SampleStrokeRect.cpp +FILE: ../../../third_party/skia/samplecode/SampleText.cpp +FILE: ../../../third_party/skia/samplecode/SampleTextAlpha.cpp +FILE: ../../../third_party/skia/samplecode/SampleTextBox.cpp +FILE: ../../../third_party/skia/samplecode/SampleTextOnPath.cpp +FILE: ../../../third_party/skia/samplecode/SampleTextureDomain.cpp +FILE: ../../../third_party/skia/samplecode/SampleTiling.cpp +FILE: ../../../third_party/skia/samplecode/SampleVertices.cpp +FILE: ../../../third_party/skia/samplecode/SampleWritePixels.cpp +FILE: ../../../third_party/skia/samplecode/SampleXfermodesBlur.cpp +FILE: ../../../third_party/skia/samplecode/vertexdump.cpp +FILE: ../../../third_party/skia/src/core/SkAAClip.cpp +FILE: ../../../third_party/skia/src/core/SkAAClip.h +FILE: ../../../third_party/skia/src/core/SkAdvancedTypefaceMetrics.h +FILE: ../../../third_party/skia/src/core/SkBitmapProcState.cpp +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrix.h +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_procs.h +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_sample.h +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_shaderproc.h +FILE: ../../../third_party/skia/src/core/SkBlitMask.h +FILE: ../../../third_party/skia/src/core/SkBlitRow.h +FILE: ../../../third_party/skia/src/core/SkBlitRow_D32.cpp +FILE: ../../../third_party/skia/src/core/SkClipStack.cpp +FILE: ../../../third_party/skia/src/core/SkClipStack.h +FILE: ../../../third_party/skia/src/core/SkColorMatrixFilterRowMajor255.cpp +FILE: ../../../third_party/skia/src/core/SkConvertPixels.h +FILE: ../../../third_party/skia/src/core/SkData.cpp +FILE: ../../../third_party/skia/src/core/SkDevice.cpp +FILE: ../../../third_party/skia/src/core/SkDither.cpp +FILE: ../../../third_party/skia/src/core/SkDrawProcs.h +FILE: ../../../third_party/skia/src/core/SkEdgeBuilder.cpp +FILE: ../../../third_party/skia/src/core/SkEdgeBuilder.h +FILE: ../../../third_party/skia/src/core/SkFlattenable.cpp +FILE: ../../../third_party/skia/src/core/SkFontStream.cpp +FILE: ../../../third_party/skia/src/core/SkLineClipper.cpp +FILE: ../../../third_party/skia/src/core/SkLineClipper.h +FILE: ../../../third_party/skia/src/core/SkMallocPixelRef.cpp +FILE: ../../../third_party/skia/src/core/SkMatrix44.cpp +FILE: ../../../third_party/skia/src/core/SkPictureData.cpp +FILE: ../../../third_party/skia/src/core/SkPictureData.h +FILE: ../../../third_party/skia/src/core/SkPictureFlat.cpp +FILE: ../../../third_party/skia/src/core/SkPictureFlat.h +FILE: ../../../third_party/skia/src/core/SkPictureRecord.cpp +FILE: ../../../third_party/skia/src/core/SkPictureRecord.h +FILE: ../../../third_party/skia/src/core/SkPixelRef.cpp +FILE: ../../../third_party/skia/src/core/SkPtrRecorder.cpp +FILE: ../../../third_party/skia/src/core/SkReadBuffer.h +FILE: ../../../third_party/skia/src/core/SkTypefaceCache.cpp +FILE: ../../../third_party/skia/src/core/SkTypefaceCache.h +FILE: ../../../third_party/skia/src/core/SkUnPreMultiply.cpp +FILE: ../../../third_party/skia/src/core/SkWriteBuffer.h +FILE: ../../../third_party/skia/src/core/SkWriter32.cpp +FILE: ../../../third_party/skia/src/effects/SkColorMatrix.cpp +FILE: ../../../third_party/skia/src/effects/SkColorMatrixFilter.cpp +FILE: ../../../third_party/skia/src/effects/SkLayerDrawLooper.cpp +FILE: ../../../third_party/skia/src/effects/SkPackBits.cpp +FILE: ../../../third_party/skia/src/effects/SkTableMaskFilter.cpp +FILE: ../../../third_party/skia/src/gpu/GrContext.cpp +FILE: ../../../third_party/skia/src/gpu/GrGpu.h +FILE: ../../../third_party/skia/src/gpu/GrGpuResource.cpp +FILE: ../../../third_party/skia/src/gpu/GrPaint.h +FILE: ../../../third_party/skia/src/gpu/GrPathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/GrPathRenderer.h +FILE: ../../../third_party/skia/src/gpu/GrPathRendererChain.cpp +FILE: ../../../third_party/skia/src/gpu/GrPathRendererChain.h +FILE: ../../../third_party/skia/src/gpu/GrPathUtils.cpp +FILE: ../../../third_party/skia/src/gpu/GrPathUtils.h +FILE: ../../../third_party/skia/src/gpu/GrRenderTarget.cpp +FILE: ../../../third_party/skia/src/gpu/GrStencilAttachment.cpp +FILE: ../../../third_party/skia/src/gpu/GrStencilAttachment.h +FILE: ../../../third_party/skia/src/gpu/GrStencilSettings.cpp +FILE: ../../../third_party/skia/src/gpu/GrTexture.cpp +FILE: ../../../third_party/skia/src/gpu/SkGpuDevice.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLCreateNullInterface.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLDefines.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLGLSL.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLGLSL.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpu.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpu.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpuProgramCache.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLIRect.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLInterface.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLMakeNativeInterface_none.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLProgram.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLProgram.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLRenderTarget.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLStencilAttachment.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLStencilAttachment.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLTexture.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLTexture.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLUtil.cpp +FILE: ../../../third_party/skia/src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp +FILE: ../../../third_party/skia/src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSL.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSL.h +FILE: ../../../third_party/skia/src/gpu/ops/GrAAHairLinePathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrAAHairLinePathRenderer.h +FILE: ../../../third_party/skia/src/gpu/ops/GrDefaultPathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrDefaultPathRenderer.h +FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp +FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_none.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFConvertType1FontStream.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFDevice.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFDevice.h +FILE: ../../../third_party/skia/src/pdf/SkPDFDocument.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFFont.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFFont.h +FILE: ../../../third_party/skia/src/pdf/SkPDFGraphicState.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFMakeToUnicodeCmap.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFShader.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFShader.h +FILE: ../../../third_party/skia/src/pdf/SkPDFTypes.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFUtils.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFUtils.h +FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_default.cpp +FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_default_imagefilters.cpp +FILE: ../../../third_party/skia/src/ports/SkImageEncoder_WIC.cpp +FILE: ../../../third_party/skia/src/ports/SkMemory_malloc.cpp +FILE: ../../../third_party/skia/src/ports/SkScalerContext_win_dw.cpp +FILE: ../../../third_party/skia/src/shaders/SkBitmapProcShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkEmptyShader.h +FILE: ../../../third_party/skia/src/utils/SkBitSet.h +FILE: ../../../third_party/skia/src/utils/SkNWayCanvas.cpp +FILE: ../../../third_party/skia/src/utils/SkOSPath.cpp +FILE: ../../../third_party/skia/src/utils/SkParsePath.cpp +FILE: ../../../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp +FILE: ../../../third_party/skia/src/utils/win/SkAutoCoInitialize.cpp +FILE: ../../../third_party/skia/src/utils/win/SkAutoCoInitialize.h +FILE: ../../../third_party/skia/src/utils/win/SkHRESULT.cpp +FILE: ../../../third_party/skia/src/utils/win/SkHRESULT.h +FILE: ../../../third_party/skia/src/utils/win/SkIStream.cpp +FILE: ../../../third_party/skia/src/utils/win/SkIStream.h +FILE: ../../../third_party/skia/src/utils/win/SkTScopedComPtr.h +FILE: ../../../third_party/skia/src/utils/win/SkWGL.h +FILE: ../../../third_party/skia/src/utils/win/SkWGL_win.cpp +FILE: ../../../third_party/skia/src/views/SkView.cpp +FILE: ../../../third_party/skia/src/xps/SkXPSDevice.cpp +FILE: ../../../third_party/skia/src/xps/SkXPSDevice.h +---------------------------------------------------------------------------------------------------- +Copyright 2011 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/bench/AlternatingColorPatternBench.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/AlternatingColorPatternBench.cpp +FILE: ../../../third_party/skia/bench/BezierBench.cpp +FILE: ../../../third_party/skia/bench/BlurRectsBench.cpp +FILE: ../../../third_party/skia/bench/GMBench.cpp +FILE: ../../../third_party/skia/bench/GMBench.h +FILE: ../../../third_party/skia/bench/GeometryBench.cpp +FILE: ../../../third_party/skia/bench/ImageFilterCollapse.cpp +FILE: ../../../third_party/skia/bench/ImageFilterDAGBench.cpp +FILE: ../../../third_party/skia/bench/PatchBench.cpp +FILE: ../../../third_party/skia/bench/PictureNestingBench.cpp +FILE: ../../../third_party/skia/bench/RecordingBench.cpp +FILE: ../../../third_party/skia/bench/RecordingBench.h +FILE: ../../../third_party/skia/bench/RectanizerBench.cpp +FILE: ../../../third_party/skia/bench/RotatedRectBench.cpp +FILE: ../../../third_party/skia/bench/SKPBench.cpp +FILE: ../../../third_party/skia/bench/SKPBench.h +FILE: ../../../third_party/skia/bench/nanobench.cpp +FILE: ../../../third_party/skia/dm/DMJsonWriter.cpp +FILE: ../../../third_party/skia/dm/DMJsonWriter.h +FILE: ../../../third_party/skia/gm/aaa.cpp +FILE: ../../../third_party/skia/gm/beziers.cpp +FILE: ../../../third_party/skia/gm/blurcircles.cpp +FILE: ../../../third_party/skia/gm/cgm.c +FILE: ../../../third_party/skia/gm/cgms.cpp +FILE: ../../../third_party/skia/gm/clipdrawdraw.cpp +FILE: ../../../third_party/skia/gm/coloremoji_blendmodes.cpp +FILE: ../../../third_party/skia/gm/colorfilters.cpp +FILE: ../../../third_party/skia/gm/colorwheel.cpp +FILE: ../../../third_party/skia/gm/complexclip3.cpp +FILE: ../../../third_party/skia/gm/convexpolyclip.cpp +FILE: ../../../third_party/skia/gm/convexpolyeffect.cpp +FILE: ../../../third_party/skia/gm/discard.cpp +FILE: ../../../third_party/skia/gm/drrect.cpp +FILE: ../../../third_party/skia/gm/emboss.cpp +FILE: ../../../third_party/skia/gm/filterfastbounds.cpp +FILE: ../../../third_party/skia/gm/glyph_pos.cpp +FILE: ../../../third_party/skia/gm/gradients_2pt_conical.cpp +FILE: ../../../third_party/skia/gm/grayscalejpg.cpp +FILE: ../../../third_party/skia/gm/imageblurtiled.cpp +FILE: ../../../third_party/skia/gm/imagefiltersclipped.cpp +FILE: ../../../third_party/skia/gm/imagefilterscropexpand.cpp +FILE: ../../../third_party/skia/gm/imagefiltersscaled.cpp +FILE: ../../../third_party/skia/gm/imageresizetiled.cpp +FILE: ../../../third_party/skia/gm/matriximagefilter.cpp +FILE: ../../../third_party/skia/gm/multipicturedraw.cpp +FILE: ../../../third_party/skia/gm/patch.cpp +FILE: ../../../third_party/skia/gm/picture.cpp +FILE: ../../../third_party/skia/gm/pictureshader.cpp +FILE: ../../../third_party/skia/gm/pictureshadertile.cpp +FILE: ../../../third_party/skia/gm/recordopts.cpp +FILE: ../../../third_party/skia/gm/smallarc.cpp +FILE: ../../../third_party/skia/gm/stroketext.cpp +FILE: ../../../third_party/skia/gm/surface.cpp +FILE: ../../../third_party/skia/gm/tallstretchedbitmaps.cpp +FILE: ../../../third_party/skia/gm/textblob.cpp +FILE: ../../../third_party/skia/gm/textblobshader.cpp +FILE: ../../../third_party/skia/gm/texturedomaineffect.cpp +FILE: ../../../third_party/skia/gm/tiledscaledbitmap.cpp +FILE: ../../../third_party/skia/gm/variedtext.cpp +FILE: ../../../third_party/skia/gm/yuvtorgbeffect.cpp +FILE: ../../../third_party/skia/include/c/sk_canvas.h +FILE: ../../../third_party/skia/include/c/sk_data.h +FILE: ../../../third_party/skia/include/c/sk_image.h +FILE: ../../../third_party/skia/include/c/sk_maskfilter.h +FILE: ../../../third_party/skia/include/c/sk_matrix.h +FILE: ../../../third_party/skia/include/c/sk_paint.h +FILE: ../../../third_party/skia/include/c/sk_path.h +FILE: ../../../third_party/skia/include/c/sk_picture.h +FILE: ../../../third_party/skia/include/c/sk_shader.h +FILE: ../../../third_party/skia/include/c/sk_surface.h +FILE: ../../../third_party/skia/include/c/sk_types.h +FILE: ../../../third_party/skia/include/core/SkBBHFactory.h +FILE: ../../../third_party/skia/include/core/SkBlurTypes.h +FILE: ../../../third_party/skia/include/core/SkDrawable.h +FILE: ../../../third_party/skia/include/core/SkFont.h +FILE: ../../../third_party/skia/include/core/SkMultiPictureDraw.h +FILE: ../../../third_party/skia/include/core/SkPictureRecorder.h +FILE: ../../../third_party/skia/include/core/SkSurfaceProps.h +FILE: ../../../third_party/skia/include/core/SkTextBlob.h +FILE: ../../../third_party/skia/include/gpu/GrGpuResource.h +FILE: ../../../third_party/skia/include/gpu/GrResourceKey.h +FILE: ../../../third_party/skia/include/gpu/gl/GrGLAssembleInterface.h +FILE: ../../../third_party/skia/include/ports/SkFontMgr_indirect.h +FILE: ../../../third_party/skia/include/ports/SkRemotableFontMgr.h +FILE: ../../../third_party/skia/samplecode/SampleHT.cpp +FILE: ../../../third_party/skia/samplecode/SampleIdentityScale.cpp +FILE: ../../../third_party/skia/samplecode/SampleRectanizer.cpp +FILE: ../../../third_party/skia/samplecode/SampleSubpixelTranslate.cpp +FILE: ../../../third_party/skia/src/c/sk_surface.cpp +FILE: ../../../third_party/skia/src/core/SkBBHFactory.cpp +FILE: ../../../third_party/skia/src/core/SkBitmapCache.cpp +FILE: ../../../third_party/skia/src/core/SkBitmapCache.h +FILE: ../../../third_party/skia/src/core/SkBlitMask_D32.cpp +FILE: ../../../third_party/skia/src/core/SkCachedData.cpp +FILE: ../../../third_party/skia/src/core/SkCachedData.h +FILE: ../../../third_party/skia/src/core/SkCanvasPriv.h +FILE: ../../../third_party/skia/src/core/SkConvertPixels.cpp +FILE: ../../../third_party/skia/src/core/SkDistanceFieldGen.cpp +FILE: ../../../third_party/skia/src/core/SkDistanceFieldGen.h +FILE: ../../../third_party/skia/src/core/SkDrawable.cpp +FILE: ../../../third_party/skia/src/core/SkFont.cpp +FILE: ../../../third_party/skia/src/core/SkForceCPlusPlusLinking.cpp +FILE: ../../../third_party/skia/src/core/SkHalf.cpp +FILE: ../../../third_party/skia/src/core/SkHalf.h +FILE: ../../../third_party/skia/src/core/SkImageGenerator.cpp +FILE: ../../../third_party/skia/src/core/SkMaskCache.cpp +FILE: ../../../third_party/skia/src/core/SkMaskCache.h +FILE: ../../../third_party/skia/src/core/SkMultiPictureDraw.cpp +FILE: ../../../third_party/skia/src/core/SkPicturePlayback.cpp +FILE: ../../../third_party/skia/src/core/SkPicturePlayback.h +FILE: ../../../third_party/skia/src/core/SkPictureRecorder.cpp +FILE: ../../../third_party/skia/src/core/SkRecord.h +FILE: ../../../third_party/skia/src/core/SkRecordDraw.cpp +FILE: ../../../third_party/skia/src/core/SkRecordDraw.h +FILE: ../../../third_party/skia/src/core/SkRecordOpts.cpp +FILE: ../../../third_party/skia/src/core/SkRecordOpts.h +FILE: ../../../third_party/skia/src/core/SkRecorder.cpp +FILE: ../../../third_party/skia/src/core/SkRecorder.h +FILE: ../../../third_party/skia/src/core/SkRecords.h +FILE: ../../../third_party/skia/src/core/SkSurfacePriv.h +FILE: ../../../third_party/skia/src/core/SkTaskGroup.cpp +FILE: ../../../third_party/skia/src/core/SkTaskGroup.h +FILE: ../../../third_party/skia/src/core/SkTextBlob.cpp +FILE: ../../../third_party/skia/src/core/SkTextMapStateProc.h +FILE: ../../../third_party/skia/src/core/SkVertState.cpp +FILE: ../../../third_party/skia/src/core/SkVertState.h +FILE: ../../../third_party/skia/src/fonts/SkFontMgr_indirect.cpp +FILE: ../../../third_party/skia/src/fonts/SkRemotableFontMgr.cpp +FILE: ../../../third_party/skia/src/gpu/GrDefaultGeoProcFactory.cpp +FILE: ../../../third_party/skia/src/gpu/GrDefaultGeoProcFactory.h +FILE: ../../../third_party/skia/src/gpu/GrFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/GrGpuResourceCacheAccess.h +FILE: ../../../third_party/skia/src/gpu/GrGpuResourceRef.cpp +FILE: ../../../third_party/skia/src/gpu/GrGpuResourceRef.h +FILE: ../../../third_party/skia/src/gpu/GrPathRendering.cpp +FILE: ../../../third_party/skia/src/gpu/GrPathRendering.h +FILE: ../../../third_party/skia/src/gpu/GrPendingProgramElement.h +FILE: ../../../third_party/skia/src/gpu/GrPrimitiveProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/GrProcessorAnalysis.cpp +FILE: ../../../third_party/skia/src/gpu/GrProcessorAnalysis.h +FILE: ../../../third_party/skia/src/gpu/GrProgramDesc.h +FILE: ../../../third_party/skia/src/gpu/GrProgramElement.h +FILE: ../../../third_party/skia/src/gpu/GrRectanizer_pow2.h +FILE: ../../../third_party/skia/src/gpu/GrRectanizer_skyline.h +FILE: ../../../third_party/skia/src/gpu/GrResourceCache.cpp +FILE: ../../../third_party/skia/src/gpu/GrResourceCache.h +FILE: ../../../third_party/skia/src/gpu/GrSKSLPrettyPrint.cpp +FILE: ../../../third_party/skia/src/gpu/GrSKSLPrettyPrint.h +FILE: ../../../third_party/skia/src/gpu/GrSurfacePriv.h +FILE: ../../../third_party/skia/src/gpu/GrTRecorder.h +FILE: ../../../third_party/skia/src/gpu/GrTexturePriv.h +FILE: ../../../third_party/skia/src/gpu/GrTracing.h +FILE: ../../../third_party/skia/src/gpu/GrXferProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrBicubicEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrConvexPolyEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrConvexPolyEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrCoverageSetOpXP.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrCoverageSetOpXP.h +FILE: ../../../third_party/skia/src/gpu/effects/GrDisableColorXP.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrDisableColorXP.h +FILE: ../../../third_party/skia/src/gpu/effects/GrMatrixConvolutionEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrMatrixConvolutionEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrOvalEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrOvalEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrPorterDuffXferProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrRRectEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrRRectEffect.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLAssembleInterface.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLPathRendering.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLPathRendering.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLTextureRenderTarget.h +FILE: ../../../third_party/skia/src/gpu/gl/android/GrGLMakeNativeInterface_android.cpp +FILE: ../../../third_party/skia/src/gpu/gl/builders/GrGLProgramBuilder.cpp +FILE: ../../../third_party/skia/src/gpu/gl/builders/GrGLProgramBuilder.h +FILE: ../../../third_party/skia/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp +FILE: ../../../third_party/skia/src/gpu/gl/builders/GrGLShaderStringBuilder.h +FILE: ../../../third_party/skia/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp +FILE: ../../../third_party/skia/src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp +FILE: ../../../third_party/skia/src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLGeometryProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLShaderBuilder.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLShaderBuilder.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLXferProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrDashOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrDashOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.h +FILE: ../../../third_party/skia/src/image/SkReadPixelsRec.h +FILE: ../../../third_party/skia/src/image/SkSurface_Gpu.h +FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_matrix_neon.h +FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts_arm.cpp +FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts_none.cpp +FILE: ../../../third_party/skia/src/pathops/SkOpBuilder.cpp +FILE: ../../../third_party/skia/src/pathops/SkOpSpan.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsTSect.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsTSect.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsTightBounds.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_android.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_fontconfig.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp +FILE: ../../../third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp +FILE: ../../../third_party/skia/src/ports/SkScalerContext_win_dw.h +FILE: ../../../third_party/skia/src/ports/SkTypeface_win_dw.cpp +FILE: ../../../third_party/skia/src/ports/SkTypeface_win_dw.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_EBDT.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_EBLC.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_EBSC.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_gasp.h +FILE: ../../../third_party/skia/src/shaders/SkLocalMatrixShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkLocalMatrixShader.h +FILE: ../../../third_party/skia/src/shaders/SkPictureShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkPictureShader.h +FILE: ../../../third_party/skia/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/SkTwoPointConicalGradient_gpu.h +FILE: ../../../third_party/skia/src/utils/SkDashPath.cpp +FILE: ../../../third_party/skia/src/utils/SkDashPathPriv.h +FILE: ../../../third_party/skia/src/utils/SkEventTracer.cpp +FILE: ../../../third_party/skia/src/utils/SkMatrix22.cpp +FILE: ../../../third_party/skia/src/utils/SkMatrix22.h +FILE: ../../../third_party/skia/src/utils/SkPatchUtils.cpp +FILE: ../../../third_party/skia/src/utils/SkPatchUtils.h +FILE: ../../../third_party/skia/src/utils/win/SkDWrite.cpp +FILE: ../../../third_party/skia/src/utils/win/SkDWrite.h +---------------------------------------------------------------------------------------------------- +Copyright 2014 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/bench/BenchLogger.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/BenchLogger.cpp +FILE: ../../../third_party/skia/bench/BenchLogger.h +FILE: ../../../third_party/skia/bench/ChecksumBench.cpp +FILE: ../../../third_party/skia/bench/GameBench.cpp +FILE: ../../../third_party/skia/bench/GrMemoryPoolBench.cpp +FILE: ../../../third_party/skia/bench/LineBench.cpp +FILE: ../../../third_party/skia/bench/Matrix44Bench.cpp +FILE: ../../../third_party/skia/bench/MatrixConvolutionBench.cpp +FILE: ../../../third_party/skia/bench/MorphologyBench.cpp +FILE: ../../../third_party/skia/bench/RTreeBench.cpp +FILE: ../../../third_party/skia/bench/RefCntBench.cpp +FILE: ../../../third_party/skia/bench/TableBench.cpp +FILE: ../../../third_party/skia/gm/bigmatrix.cpp +FILE: ../../../third_party/skia/gm/blurrect.cpp +FILE: ../../../third_party/skia/gm/colorfilterimagefilter.cpp +FILE: ../../../third_party/skia/gm/composeshader.cpp +FILE: ../../../third_party/skia/gm/dashcubics.cpp +FILE: ../../../third_party/skia/gm/dashing.cpp +FILE: ../../../third_party/skia/gm/distantclip.cpp +FILE: ../../../third_party/skia/gm/fatpathfill.cpp +FILE: ../../../third_party/skia/gm/getpostextpath.cpp +FILE: ../../../third_party/skia/gm/imagefiltersgraph.cpp +FILE: ../../../third_party/skia/gm/imagemagnifier.cpp +FILE: ../../../third_party/skia/gm/lighting.cpp +FILE: ../../../third_party/skia/gm/matrixconvolution.cpp +FILE: ../../../third_party/skia/gm/modecolorfilters.cpp +FILE: ../../../third_party/skia/gm/morphology.cpp +FILE: ../../../third_party/skia/gm/patheffects.cpp +FILE: ../../../third_party/skia/gm/pathinterior.cpp +FILE: ../../../third_party/skia/gm/rrect.cpp +FILE: ../../../third_party/skia/gm/rrects.cpp +FILE: ../../../third_party/skia/gm/samplerstress.cpp +FILE: ../../../third_party/skia/gm/simpleaaclip.cpp +FILE: ../../../third_party/skia/gm/srcmode.cpp +FILE: ../../../third_party/skia/gm/strokerect.cpp +FILE: ../../../third_party/skia/gm/typeface.cpp +FILE: ../../../third_party/skia/gm/verylargebitmap.cpp +FILE: ../../../third_party/skia/include/core/SkAnnotation.h +FILE: ../../../third_party/skia/include/core/SkImage.h +FILE: ../../../third_party/skia/include/core/SkRRect.h +FILE: ../../../third_party/skia/include/core/SkStrokeRec.h +FILE: ../../../third_party/skia/include/core/SkSurface.h +FILE: ../../../third_party/skia/include/gpu/GrSurface.h +FILE: ../../../third_party/skia/include/gpu/gl/GrGLFunctions.h +FILE: ../../../third_party/skia/include/pathops/SkPathOps.h +FILE: ../../../third_party/skia/include/private/SkChecksum.h +FILE: ../../../third_party/skia/include/private/SkPathRef.h +FILE: ../../../third_party/skia/include/private/SkTInternalLList.h +FILE: ../../../third_party/skia/include/private/SkWeakRefCnt.h +FILE: ../../../third_party/skia/include/utils/SkNullCanvas.h +FILE: ../../../third_party/skia/samplecode/SampleAnimBlur.cpp +FILE: ../../../third_party/skia/samplecode/SampleFatBits.cpp +FILE: ../../../third_party/skia/samplecode/SampleQuadStroker.cpp +FILE: ../../../third_party/skia/src/codec/SkColorTable.h +FILE: ../../../third_party/skia/src/core/SkAnnotation.cpp +FILE: ../../../third_party/skia/src/core/SkBBoxHierarchy.h +FILE: ../../../third_party/skia/src/core/SkFontDescriptor.cpp +FILE: ../../../third_party/skia/src/core/SkFontDescriptor.h +FILE: ../../../third_party/skia/src/core/SkImagePriv.h +FILE: ../../../third_party/skia/src/core/SkMD5.cpp +FILE: ../../../third_party/skia/src/core/SkMD5.h +FILE: ../../../third_party/skia/src/core/SkMaskGamma.cpp +FILE: ../../../third_party/skia/src/core/SkMaskGamma.h +FILE: ../../../third_party/skia/src/core/SkMathPriv.h +FILE: ../../../third_party/skia/src/core/SkPaintDefaults.h +FILE: ../../../third_party/skia/src/core/SkRRect.cpp +FILE: ../../../third_party/skia/src/core/SkRTree.cpp +FILE: ../../../third_party/skia/src/core/SkRTree.h +FILE: ../../../third_party/skia/src/core/SkReadBuffer.cpp +FILE: ../../../third_party/skia/src/core/SkStrokeRec.cpp +FILE: ../../../third_party/skia/src/core/SkTLList.h +FILE: ../../../third_party/skia/src/core/SkTLS.cpp +FILE: ../../../third_party/skia/src/core/SkTLS.h +FILE: ../../../third_party/skia/src/core/SkTextToPathIter.h +FILE: ../../../third_party/skia/src/core/SkWriteBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/GrMemoryPool.cpp +FILE: ../../../third_party/skia/src/gpu/GrMemoryPool.h +FILE: ../../../third_party/skia/src/gpu/GrPath.cpp +FILE: ../../../third_party/skia/src/gpu/GrPath.h +FILE: ../../../third_party/skia/src/gpu/GrProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/GrProcessor.h +FILE: ../../../third_party/skia/src/gpu/GrProcessorUnitTest.h +FILE: ../../../third_party/skia/src/gpu/GrSWMaskHelper.cpp +FILE: ../../../third_party/skia/src/gpu/GrSWMaskHelper.h +FILE: ../../../third_party/skia/src/gpu/GrShaderCaps.cpp +FILE: ../../../third_party/skia/src/gpu/GrShaderCaps.h +FILE: ../../../third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/GrSoftwarePathRenderer.h +FILE: ../../../third_party/skia/src/gpu/GrSurface.cpp +FILE: ../../../third_party/skia/src/gpu/GrTextureStripAtlas.h +FILE: ../../../third_party/skia/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrTextureDomain.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrTextureDomain.h +FILE: ../../../third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLCaps.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLCaps.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLPath.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLPath.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLProgramDataManager.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLProgramDataManager.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLUtil.h +FILE: ../../../third_party/skia/src/gpu/ops/GrAAConvexPathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrAAConvexPathRenderer.h +FILE: ../../../third_party/skia/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrStencilAndCoverPathRenderer.h +FILE: ../../../third_party/skia/src/image/SkImage.cpp +FILE: ../../../third_party/skia/src/image/SkImage_Base.h +FILE: ../../../third_party/skia/src/image/SkImage_Gpu.cpp +FILE: ../../../third_party/skia/src/image/SkImage_Raster.cpp +FILE: ../../../third_party/skia/src/image/SkSurface.cpp +FILE: ../../../third_party/skia/src/image/SkSurface_Base.h +FILE: ../../../third_party/skia/src/image/SkSurface_Gpu.cpp +FILE: ../../../third_party/skia/src/image/SkSurface_Raster.cpp +FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp +FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.h +FILE: ../../../third_party/skia/src/pathops/SkAddIntersections.cpp +FILE: ../../../third_party/skia/src/pathops/SkAddIntersections.h +FILE: ../../../third_party/skia/src/pathops/SkDCubicLineIntersection.cpp +FILE: ../../../third_party/skia/src/pathops/SkDLineIntersection.cpp +FILE: ../../../third_party/skia/src/pathops/SkDQuadLineIntersection.cpp +FILE: ../../../third_party/skia/src/pathops/SkIntersectionHelper.h +FILE: ../../../third_party/skia/src/pathops/SkIntersections.cpp +FILE: ../../../third_party/skia/src/pathops/SkIntersections.h +FILE: ../../../third_party/skia/src/pathops/SkLineParameters.h +FILE: ../../../third_party/skia/src/pathops/SkOpAngle.cpp +FILE: ../../../third_party/skia/src/pathops/SkOpAngle.h +FILE: ../../../third_party/skia/src/pathops/SkOpCubicHull.cpp +FILE: ../../../third_party/skia/src/pathops/SkOpEdgeBuilder.cpp +FILE: ../../../third_party/skia/src/pathops/SkOpEdgeBuilder.h +FILE: ../../../third_party/skia/src/pathops/SkOpSegment.cpp +FILE: ../../../third_party/skia/src/pathops/SkOpSegment.h +FILE: ../../../third_party/skia/src/pathops/SkOpSpan.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsBounds.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsCommon.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsCommon.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsCubic.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsCubic.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsCurve.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsLine.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsLine.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsOp.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsPoint.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsPoint.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsQuad.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsQuad.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsRect.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsRect.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsSimplify.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsTypes.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsTypes.h +FILE: ../../../third_party/skia/src/pathops/SkPathWriter.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathWriter.h +FILE: ../../../third_party/skia/src/pathops/SkReduceOrder.cpp +FILE: ../../../third_party/skia/src/pathops/SkReduceOrder.h +FILE: ../../../third_party/skia/src/sfnt/SkIBMFamilyClass.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTableTypes.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V0.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V1.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V2.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V3.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V4.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_VA.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_glyf.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_head.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_hhea.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_loca.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_maxp.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_maxp_CFF.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_maxp_TT.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_name.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_post.h +FILE: ../../../third_party/skia/src/sfnt/SkOTUtils.cpp +FILE: ../../../third_party/skia/src/sfnt/SkOTUtils.h +FILE: ../../../third_party/skia/src/sfnt/SkPanose.h +FILE: ../../../third_party/skia/src/sfnt/SkSFNTHeader.h +FILE: ../../../third_party/skia/src/shaders/gradients/SkGradientShaderPriv.h +FILE: ../../../third_party/skia/src/shaders/gradients/SkLinearGradient.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/SkLinearGradient.h +FILE: ../../../third_party/skia/src/shaders/gradients/SkRadialGradient.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/SkRadialGradient.h +FILE: ../../../third_party/skia/src/shaders/gradients/SkSweepGradient.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/SkSweepGradient.h +FILE: ../../../third_party/skia/src/shaders/gradients/SkTwoPointConicalGradient.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/SkTwoPointConicalGradient.h +FILE: ../../../third_party/skia/src/utils/SkFloatUtils.h +FILE: ../../../third_party/skia/src/utils/SkNullCanvas.cpp +FILE: ../../../third_party/skia/src/utils/mac/SkStream_mac.cpp +FILE: ../../../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp +FILE: ../../../third_party/skia/src/utils/win/SkDWriteFontFileStream.h +FILE: ../../../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp +FILE: ../../../third_party/skia/src/utils/win/SkDWriteGeometrySink.h +---------------------------------------------------------------------------------------------------- +Copyright 2012 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/bench/BigPathBench.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/BigPathBench.cpp +FILE: ../../../third_party/skia/bench/BitmapRegionDecoderBench.cpp +FILE: ../../../third_party/skia/bench/BitmapRegionDecoderBench.h +FILE: ../../../third_party/skia/bench/CodecBench.cpp +FILE: ../../../third_party/skia/bench/CodecBench.h +FILE: ../../../third_party/skia/bench/CodecBenchPriv.h +FILE: ../../../third_party/skia/bench/ControlBench.cpp +FILE: ../../../third_party/skia/bench/DrawBitmapAABench.cpp +FILE: ../../../third_party/skia/bench/ImageBench.cpp +FILE: ../../../third_party/skia/bench/InterpBench.cpp +FILE: ../../../third_party/skia/bench/MathBench.cpp +FILE: ../../../third_party/skia/bench/MipMapBench.cpp +FILE: ../../../third_party/skia/bench/PictureOverheadBench.cpp +FILE: ../../../third_party/skia/bench/SKPAnimationBench.cpp +FILE: ../../../third_party/skia/bench/SKPAnimationBench.h +FILE: ../../../third_party/skia/bench/Sk4fBench.cpp +FILE: ../../../third_party/skia/bench/SkGlyphCacheBench.cpp +FILE: ../../../third_party/skia/bench/StrokeBench.cpp +FILE: ../../../third_party/skia/bench/TextBlobBench.cpp +FILE: ../../../third_party/skia/bench/TopoSortBench.cpp +FILE: ../../../third_party/skia/bench/nanobench.h +FILE: ../../../third_party/skia/dm/DMSrcSink.cpp +FILE: ../../../third_party/skia/dm/DMSrcSink.h +FILE: ../../../third_party/skia/example/SkiaSDLExample.cpp +FILE: ../../../third_party/skia/experimental/c-api-example/skia-c-example.c +FILE: ../../../third_party/skia/experimental/go-demo/main.go +FILE: ../../../third_party/skia/experimental/go-skia/ctypes.go +FILE: ../../../third_party/skia/experimental/go-skia/skia.go +FILE: ../../../third_party/skia/experimental/go-skia/types.go +FILE: ../../../third_party/skia/experimental/tools/coreGraphicsPdf2png.cpp +FILE: ../../../third_party/skia/gm/SkAnimTimer.h +FILE: ../../../third_party/skia/gm/aaxfermodes.cpp +FILE: ../../../third_party/skia/gm/addarc.cpp +FILE: ../../../third_party/skia/gm/all_bitmap_configs.cpp +FILE: ../../../third_party/skia/gm/anisotropic.cpp +FILE: ../../../third_party/skia/gm/annotated_text.cpp +FILE: ../../../third_party/skia/gm/badpaint.cpp +FILE: ../../../third_party/skia/gm/bigrrectaaeffect.cpp +FILE: ../../../third_party/skia/gm/bigtileimagefilter.cpp +FILE: ../../../third_party/skia/gm/blend.cpp +FILE: ../../../third_party/skia/gm/blurredclippedcircle.cpp +FILE: ../../../third_party/skia/gm/bmpfilterqualityrepeat.cpp +FILE: ../../../third_party/skia/gm/concavepaths.cpp +FILE: ../../../third_party/skia/gm/constcolorprocessor.cpp +FILE: ../../../third_party/skia/gm/convex_all_line_paths.cpp +FILE: ../../../third_party/skia/gm/draw_bitmap_rect_skbug4374.cpp +FILE: ../../../third_party/skia/gm/drawable.cpp +FILE: ../../../third_party/skia/gm/drawatlas.cpp +FILE: ../../../third_party/skia/gm/drawatlascolor.cpp +FILE: ../../../third_party/skia/gm/drawminibitmaprect.cpp +FILE: ../../../third_party/skia/gm/fadefilter.cpp +FILE: ../../../third_party/skia/gm/fontscalerdistortable.cpp +FILE: ../../../third_party/skia/gm/gamma.cpp +FILE: ../../../third_party/skia/gm/image_pict.cpp +FILE: ../../../third_party/skia/gm/image_shader.cpp +FILE: ../../../third_party/skia/gm/imagefilters.cpp +FILE: ../../../third_party/skia/gm/imagefiltersstroked.cpp +FILE: ../../../third_party/skia/gm/imagefilterstransformed.cpp +FILE: ../../../third_party/skia/gm/imagefromyuvtextures.cpp +FILE: ../../../third_party/skia/gm/imagescalealigned.cpp +FILE: ../../../third_party/skia/gm/imagesource2.cpp +FILE: ../../../third_party/skia/gm/largeglyphblur.cpp +FILE: ../../../third_party/skia/gm/lcdblendmodes.cpp +FILE: ../../../third_party/skia/gm/lcdoverlap.cpp +FILE: ../../../third_party/skia/gm/lightingshader.cpp +FILE: ../../../third_party/skia/gm/localmatriximagefilter.cpp +FILE: ../../../third_party/skia/gm/localmatriximageshader.cpp +FILE: ../../../third_party/skia/gm/mipmap.cpp +FILE: ../../../third_party/skia/gm/path_stroke_with_zero_length.cpp +FILE: ../../../third_party/skia/gm/pathcontourstart.cpp +FILE: ../../../third_party/skia/gm/pdf_never_embed.cpp +FILE: ../../../third_party/skia/gm/perspshaders.cpp +FILE: ../../../third_party/skia/gm/pictureimagegenerator.cpp +FILE: ../../../third_party/skia/gm/pixelsnap.cpp +FILE: ../../../third_party/skia/gm/plus.cpp +FILE: ../../../third_party/skia/gm/repeated_bitmap.cpp +FILE: ../../../third_party/skia/gm/scaledstrokes.cpp +FILE: ../../../third_party/skia/gm/skbug_257.cpp +FILE: ../../../third_party/skia/gm/smallpaths.cpp +FILE: ../../../third_party/skia/gm/stlouisarch.cpp +FILE: ../../../third_party/skia/gm/textblobcolortrans.cpp +FILE: ../../../third_party/skia/gm/textblobgeometrychange.cpp +FILE: ../../../third_party/skia/gm/textblobmixedsizes.cpp +FILE: ../../../third_party/skia/gm/textblobrandomfont.cpp +FILE: ../../../third_party/skia/gm/textblobtransforms.cpp +FILE: ../../../third_party/skia/gm/textblobuseaftergpufree.cpp +FILE: ../../../third_party/skia/gm/transparency.cpp +FILE: ../../../third_party/skia/include/android/SkBRDAllocator.h +FILE: ../../../third_party/skia/include/android/SkBitmapRegionDecoder.h +FILE: ../../../third_party/skia/include/codec/SkAndroidCodec.h +FILE: ../../../third_party/skia/include/codec/SkCodec.h +FILE: ../../../third_party/skia/include/core/SkEncodedImageFormat.h +FILE: ../../../third_party/skia/include/core/SkFilterQuality.h +FILE: ../../../third_party/skia/include/core/SkLights.h +FILE: ../../../third_party/skia/include/core/SkPixmap.h +FILE: ../../../third_party/skia/include/core/SkPngChunkReader.h +FILE: ../../../third_party/skia/include/core/SkPoint3.h +FILE: ../../../third_party/skia/include/core/SkRSXform.h +FILE: ../../../third_party/skia/include/core/SkRWBuffer.h +FILE: ../../../third_party/skia/include/core/SkTraceMemoryDump.h +FILE: ../../../third_party/skia/include/effects/SkImageSource.h +FILE: ../../../third_party/skia/include/effects/SkTableColorFilter.h +FILE: ../../../third_party/skia/include/gpu/GrContextOptions.h +FILE: ../../../third_party/skia/include/gpu/GrSamplerState.h +FILE: ../../../third_party/skia/include/gpu/gl/GrGLTypes.h +FILE: ../../../third_party/skia/include/gpu/vk/GrVkInterface.h +FILE: ../../../third_party/skia/include/ports/SkFontMgr_android.h +FILE: ../../../third_party/skia/include/ports/SkFontMgr_directory.h +FILE: ../../../third_party/skia/include/ports/SkFontMgr_empty.h +FILE: ../../../third_party/skia/include/ports/SkFontMgr_fontconfig.h +FILE: ../../../third_party/skia/include/private/SkAtomics.h +FILE: ../../../third_party/skia/include/private/SkMutex.h +FILE: ../../../third_party/skia/include/private/SkSemaphore.h +FILE: ../../../third_party/skia/include/private/SkSpinlock.h +FILE: ../../../third_party/skia/include/private/SkTHash.h +FILE: ../../../third_party/skia/include/private/SkThreadID.h +FILE: ../../../third_party/skia/include/svg/SkSVGCanvas.h +FILE: ../../../third_party/skia/include/utils/SkPaintFilterCanvas.h +FILE: ../../../third_party/skia/samplecode/PerlinPatch.cpp +FILE: ../../../third_party/skia/samplecode/SampleAAGeometry.cpp +FILE: ../../../third_party/skia/samplecode/SampleAnimatedText.cpp +FILE: ../../../third_party/skia/samplecode/SampleAtlas.cpp +FILE: ../../../third_party/skia/samplecode/SampleClipDrawMatch.cpp +FILE: ../../../third_party/skia/samplecode/SampleFilterQuality.cpp +FILE: ../../../third_party/skia/samplecode/SampleLighting.cpp +FILE: ../../../third_party/skia/samplecode/SamplePathFuzz.cpp +FILE: ../../../third_party/skia/samplecode/SampleShip.cpp +FILE: ../../../third_party/skia/samplecode/SampleXfer.cpp +FILE: ../../../third_party/skia/src/android/SkBitmapRegionCodec.cpp +FILE: ../../../third_party/skia/src/android/SkBitmapRegionCodec.h +FILE: ../../../third_party/skia/src/android/SkBitmapRegionDecoder.cpp +FILE: ../../../third_party/skia/src/android/SkBitmapRegionDecoderPriv.h +FILE: ../../../third_party/skia/src/c/sk_c_from_to.h +FILE: ../../../third_party/skia/src/c/sk_paint.cpp +FILE: ../../../third_party/skia/src/c/sk_types_priv.h +FILE: ../../../third_party/skia/src/codec/SkAndroidCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkBmpCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkBmpCodec.h +FILE: ../../../third_party/skia/src/codec/SkBmpMaskCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkBmpMaskCodec.h +FILE: ../../../third_party/skia/src/codec/SkBmpRLECodec.cpp +FILE: ../../../third_party/skia/src/codec/SkBmpRLECodec.h +FILE: ../../../third_party/skia/src/codec/SkBmpStandardCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkBmpStandardCodec.h +FILE: ../../../third_party/skia/src/codec/SkCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkCodecImageGenerator.cpp +FILE: ../../../third_party/skia/src/codec/SkCodecImageGenerator.h +FILE: ../../../third_party/skia/src/codec/SkGifCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkGifCodec.h +FILE: ../../../third_party/skia/src/codec/SkIcoCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkIcoCodec.h +FILE: ../../../third_party/skia/src/codec/SkJpegCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkJpegCodec.h +FILE: ../../../third_party/skia/src/codec/SkJpegDecoderMgr.cpp +FILE: ../../../third_party/skia/src/codec/SkJpegDecoderMgr.h +FILE: ../../../third_party/skia/src/codec/SkJpegUtility.cpp +FILE: ../../../third_party/skia/src/codec/SkJpegUtility.h +FILE: ../../../third_party/skia/src/codec/SkMaskSwizzler.cpp +FILE: ../../../third_party/skia/src/codec/SkMaskSwizzler.h +FILE: ../../../third_party/skia/src/codec/SkMasks.cpp +FILE: ../../../third_party/skia/src/codec/SkMasks.h +FILE: ../../../third_party/skia/src/codec/SkPngCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkPngCodec.h +FILE: ../../../third_party/skia/src/codec/SkSampledCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkSampledCodec.h +FILE: ../../../third_party/skia/src/codec/SkSampler.cpp +FILE: ../../../third_party/skia/src/codec/SkSampler.h +FILE: ../../../third_party/skia/src/codec/SkSwizzler.cpp +FILE: ../../../third_party/skia/src/codec/SkSwizzler.h +FILE: ../../../third_party/skia/src/codec/SkWbmpCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkWbmpCodec.h +FILE: ../../../third_party/skia/src/codec/SkWebpAdapterCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkWebpAdapterCodec.h +FILE: ../../../third_party/skia/src/codec/SkWebpCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkWebpCodec.h +FILE: ../../../third_party/skia/src/core/Sk4px.h +FILE: ../../../third_party/skia/src/core/SkBigPicture.cpp +FILE: ../../../third_party/skia/src/core/SkBigPicture.h +FILE: ../../../third_party/skia/src/core/SkBitmapController.cpp +FILE: ../../../third_party/skia/src/core/SkBitmapController.h +FILE: ../../../third_party/skia/src/core/SkBitmapProvider.cpp +FILE: ../../../third_party/skia/src/core/SkBitmapProvider.h +FILE: ../../../third_party/skia/src/core/SkFindAndPlaceGlyph.h +FILE: ../../../third_party/skia/src/core/SkFontMgr.cpp +FILE: ../../../third_party/skia/src/core/SkImageCacherator.h +FILE: ../../../third_party/skia/src/core/SkLatticeIter.cpp +FILE: ../../../third_party/skia/src/core/SkLatticeIter.h +FILE: ../../../third_party/skia/src/core/SkLocalMatrixImageFilter.cpp +FILE: ../../../third_party/skia/src/core/SkMiniRecorder.cpp +FILE: ../../../third_party/skia/src/core/SkMiniRecorder.h +FILE: ../../../third_party/skia/src/core/SkNextID.h +FILE: ../../../third_party/skia/src/core/SkNx.h +FILE: ../../../third_party/skia/src/core/SkOpts.cpp +FILE: ../../../third_party/skia/src/core/SkOpts.h +FILE: ../../../third_party/skia/src/core/SkPathPriv.h +FILE: ../../../third_party/skia/src/core/SkPictureCommon.h +FILE: ../../../third_party/skia/src/core/SkPictureImageGenerator.cpp +FILE: ../../../third_party/skia/src/core/SkPictureImageGenerator.h +FILE: ../../../third_party/skia/src/core/SkPixmap.cpp +FILE: ../../../third_party/skia/src/core/SkPixmapPriv.h +FILE: ../../../third_party/skia/src/core/SkPoint3.cpp +FILE: ../../../third_party/skia/src/core/SkRWBuffer.cpp +FILE: ../../../third_party/skia/src/core/SkRecord.cpp +FILE: ../../../third_party/skia/src/core/SkRecordPattern.h +FILE: ../../../third_party/skia/src/core/SkRecords.cpp +FILE: ../../../third_party/skia/src/core/SkSemaphore.cpp +FILE: ../../../third_party/skia/src/core/SkSharedMutex.cpp +FILE: ../../../third_party/skia/src/core/SkSharedMutex.h +FILE: ../../../third_party/skia/src/core/SkSpinlock.cpp +FILE: ../../../third_party/skia/src/core/SkTDPQueue.h +FILE: ../../../third_party/skia/src/core/SkTTopoSort.h +FILE: ../../../third_party/skia/src/core/SkTextBlobRunIterator.h +FILE: ../../../third_party/skia/src/core/SkThreadID.cpp +FILE: ../../../third_party/skia/src/core/SkTime.cpp +FILE: ../../../third_party/skia/src/core/SkXfermodeInterpretation.cpp +FILE: ../../../third_party/skia/src/core/SkXfermodeInterpretation.h +FILE: ../../../third_party/skia/src/core/SkYUVPlanesCache.cpp +FILE: ../../../third_party/skia/src/core/SkYUVPlanesCache.h +FILE: ../../../third_party/skia/src/effects/SkTableColorFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkImageSource.cpp +FILE: ../../../third_party/skia/src/gpu/GrAutoLocaleSetter.h +FILE: ../../../third_party/skia/src/gpu/GrBlend.cpp +FILE: ../../../third_party/skia/src/gpu/GrBlurUtils.cpp +FILE: ../../../third_party/skia/src/gpu/GrBlurUtils.h +FILE: ../../../third_party/skia/src/gpu/GrCaps.cpp +FILE: ../../../third_party/skia/src/gpu/GrDrawOpAtlas.cpp +FILE: ../../../third_party/skia/src/gpu/GrDrawOpAtlas.h +FILE: ../../../third_party/skia/src/gpu/GrDrawOpTest.cpp +FILE: ../../../third_party/skia/src/gpu/GrDrawOpTest.h +FILE: ../../../third_party/skia/src/gpu/GrDrawingManager.cpp +FILE: ../../../third_party/skia/src/gpu/GrDrawingManager.h +FILE: ../../../third_party/skia/src/gpu/GrFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/GrGpuResourcePriv.h +FILE: ../../../third_party/skia/src/gpu/GrMesh.h +FILE: ../../../third_party/skia/src/gpu/GrNonAtomicRef.h +FILE: ../../../third_party/skia/src/gpu/GrOpFlushState.cpp +FILE: ../../../third_party/skia/src/gpu/GrOpFlushState.h +FILE: ../../../third_party/skia/src/gpu/GrPipeline.cpp +FILE: ../../../third_party/skia/src/gpu/GrPipeline.h +FILE: ../../../third_party/skia/src/gpu/GrProcessorUnitTest.cpp +FILE: ../../../third_party/skia/src/gpu/GrQuad.h +FILE: ../../../third_party/skia/src/gpu/GrRenderTargetContext.cpp +FILE: ../../../third_party/skia/src/gpu/GrRenderTargetContext.h +FILE: ../../../third_party/skia/src/gpu/GrRenderTargetPriv.h +FILE: ../../../third_party/skia/src/gpu/GrResourceProvider.cpp +FILE: ../../../third_party/skia/src/gpu/GrResourceProvider.h +FILE: ../../../third_party/skia/src/gpu/GrTessellator.cpp +FILE: ../../../third_party/skia/src/gpu/GrTessellator.h +FILE: ../../../third_party/skia/src/gpu/GrTestUtils.cpp +FILE: ../../../third_party/skia/src/gpu/GrTestUtils.h +FILE: ../../../third_party/skia/src/gpu/GrXferProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/GrYUVProvider.cpp +FILE: ../../../third_party/skia/src/gpu/GrYUVProvider.h +FILE: ../../../third_party/skia/src/gpu/SkGpuDevice_drawTexture.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrCustomXfermode.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrCustomXfermode.h +FILE: ../../../third_party/skia/src/gpu/effects/GrXfermodeFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrXfermodeFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLTextureRenderTarget.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLUniformHandler.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLUniformHandler.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLVaryingHandler.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLVaryingHandler.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLBlend.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLBlend.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLProgramBuilder.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLProgramBuilder.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLProgramDataManager.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLUniformHandler.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLUtil.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLUtil.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLVarying.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLVarying.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLXferProcessor.h +FILE: ../../../third_party/skia/src/gpu/ops/GrAAConvexTessellator.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrAAConvexTessellator.h +FILE: ../../../third_party/skia/src/gpu/ops/GrAAFillRectOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrAALinearizingConvexPathRenderer.h +FILE: ../../../third_party/skia/src/gpu/ops/GrAAStrokeRectOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrAtlasTextOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrAtlasTextOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrClearOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrCopySurfaceOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrCopySurfaceOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrDashLinePathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrDashLinePathRenderer.h +FILE: ../../../third_party/skia/src/gpu/ops/GrDrawAtlasOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrDrawAtlasOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrDrawOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrDrawPathOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrDrawPathOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrDrawVerticesOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrDrawVerticesOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrLatticeOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrLatticeOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrMeshDrawOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrMeshDrawOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrNonAAStrokeRectOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrStencilPathOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrTessellatingPathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrTessellatingPathRenderer.h +FILE: ../../../third_party/skia/src/gpu/text/GrDistanceFieldAdjustTable.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrDistanceFieldAdjustTable.h +FILE: ../../../third_party/skia/src/gpu/text/GrGlyphCache.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrGlyphCache.h +FILE: ../../../third_party/skia/src/gpu/text/GrTextBlob.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrTextBlob.h +FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobCache.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobCache.h +FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.h +FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.cpp +FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkCaps.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkCaps.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkCommandBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkCommandBuffer.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpu.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpu.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkImage.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkImage.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkIndexBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkIndexBuffer.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkInterface.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkMemory.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkMemory.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkRenderPass.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkRenderPass.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkRenderTarget.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkRenderTarget.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkResource.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkStencilAttachment.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkStencilAttachment.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkTexture.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkTexture.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkTextureRenderTarget.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkTextureRenderTarget.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkTransferBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkTransferBuffer.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkUniformBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkUniformBuffer.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkUtil.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkUtil.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkVertexBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkVertexBuffer.h +FILE: ../../../third_party/skia/src/image/SkImage_Gpu.h +FILE: ../../../third_party/skia/src/image/SkImage_Lazy.cpp +FILE: ../../../third_party/skia/src/opts/Sk4px_NEON.h +FILE: ../../../third_party/skia/src/opts/Sk4px_SSE2.h +FILE: ../../../third_party/skia/src/opts/Sk4px_none.h +FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts.h +FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts_arm_neon.cpp +FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts_arm_neon.h +FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts.h +FILE: ../../../third_party/skia/src/opts/SkColor_opts_neon.h +FILE: ../../../third_party/skia/src/opts/SkMorphologyImageFilter_opts.h +FILE: ../../../third_party/skia/src/opts/SkNx_neon.h +FILE: ../../../third_party/skia/src/opts/SkNx_sse.h +FILE: ../../../third_party/skia/src/opts/SkOpts_sse41.cpp +FILE: ../../../third_party/skia/src/opts/SkOpts_ssse3.cpp +FILE: ../../../third_party/skia/src/opts/SkXfermode_opts.h +FILE: ../../../third_party/skia/src/pathops/SkDConicLineIntersection.cpp +FILE: ../../../third_party/skia/src/pathops/SkDCubicToQuads.cpp +FILE: ../../../third_party/skia/src/pathops/SkOpCoincidence.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsConic.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsConic.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsCurve.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsWinding.cpp +FILE: ../../../third_party/skia/src/pdf/SkDocument_PDF_None.cpp +FILE: ../../../third_party/skia/src/pdf/SkJpegInfo.cpp +FILE: ../../../third_party/skia/src/pdf/SkJpegInfo.h +FILE: ../../../third_party/skia/src/pdf/SkPDFBitmap.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFBitmap.h +FILE: ../../../third_party/skia/src/pdf/SkPDFCanon.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFCanon.h +FILE: ../../../third_party/skia/src/pdf/SkPDFMetadata.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFMetadata.h +FILE: ../../../third_party/skia/src/ports/SkFontMgr_android_factory.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_directory_factory.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_embedded_factory.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_fontconfig_factory.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_win_dw_factory.cpp +FILE: ../../../third_party/skia/src/ports/SkOSLibrary.h +FILE: ../../../third_party/skia/src/ports/SkOSLibrary_posix.cpp +FILE: ../../../third_party/skia/src/ports/SkOSLibrary_win.cpp +FILE: ../../../third_party/skia/src/shaders/SkImageShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkImageShader.h +FILE: ../../../third_party/skia/src/shaders/SkLightingShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkLightingShader.h +FILE: ../../../third_party/skia/src/svg/SkSVGCanvas.cpp +FILE: ../../../third_party/skia/src/svg/SkSVGDevice.cpp +FILE: ../../../third_party/skia/src/svg/SkSVGDevice.h +FILE: ../../../third_party/skia/src/utils/SkPaintFilterCanvas.cpp +FILE: ../../../third_party/skia/src/utils/SkWhitelistChecksums.inc +FILE: ../../../third_party/skia/src/utils/SkWhitelistTypefaces.cpp +FILE: ../../../third_party/skia/src/xps/SkXPSDocument.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2015 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/bench/BlendmodeBench.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/BlendmodeBench.cpp +FILE: ../../../third_party/skia/bench/BlurImageFilterBench.cpp +FILE: ../../../third_party/skia/bench/BlurRectBench.cpp +FILE: ../../../third_party/skia/bench/BlurRoundRectBench.cpp +FILE: ../../../third_party/skia/bench/ChartBench.cpp +FILE: ../../../third_party/skia/bench/CmapBench.cpp +FILE: ../../../third_party/skia/bench/ColorFilterBench.cpp +FILE: ../../../third_party/skia/bench/ColorPrivBench.cpp +FILE: ../../../third_party/skia/bench/CoverageBench.cpp +FILE: ../../../third_party/skia/bench/DisplacementBench.cpp +FILE: ../../../third_party/skia/bench/FSRectBench.cpp +FILE: ../../../third_party/skia/bench/FontCacheBench.cpp +FILE: ../../../third_party/skia/bench/GrResourceCacheBench.cpp +FILE: ../../../third_party/skia/bench/HairlinePathBench.cpp +FILE: ../../../third_party/skia/bench/ImageCacheBench.cpp +FILE: ../../../third_party/skia/bench/LightingBench.cpp +FILE: ../../../third_party/skia/bench/MagnifierBench.cpp +FILE: ../../../third_party/skia/bench/MemsetBench.cpp +FILE: ../../../third_party/skia/bench/MergeBench.cpp +FILE: ../../../third_party/skia/bench/PerlinNoiseBench.cpp +FILE: ../../../third_party/skia/bench/PremulAndUnpremulAlphaOpsBench.cpp +FILE: ../../../third_party/skia/bench/RectoriBench.cpp +FILE: ../../../third_party/skia/bench/RegionContainBench.cpp +FILE: ../../../third_party/skia/bench/ResultsWriter.h +FILE: ../../../third_party/skia/bench/SortBench.cpp +FILE: ../../../third_party/skia/bench/TileBench.cpp +FILE: ../../../third_party/skia/bench/WritePixelsBench.cpp +FILE: ../../../third_party/skia/bench/gUniqueGlyphIDs.h +FILE: ../../../third_party/skia/dm/DM.cpp +FILE: ../../../third_party/skia/gm/alphagradients.cpp +FILE: ../../../third_party/skia/gm/arcofzorro.cpp +FILE: ../../../third_party/skia/gm/beziereffects.cpp +FILE: ../../../third_party/skia/gm/bigblurs.cpp +FILE: ../../../third_party/skia/gm/bigtext.cpp +FILE: ../../../third_party/skia/gm/bitmappremul.cpp +FILE: ../../../third_party/skia/gm/bitmaprecttest.cpp +FILE: ../../../third_party/skia/gm/bitmapshader.cpp +FILE: ../../../third_party/skia/gm/bleed.cpp +FILE: ../../../third_party/skia/gm/blurquickreject.cpp +FILE: ../../../third_party/skia/gm/blurroundrect.cpp +FILE: ../../../third_party/skia/gm/circularclips.cpp +FILE: ../../../third_party/skia/gm/clippedbitmapshaders.cpp +FILE: ../../../third_party/skia/gm/coloremoji.cpp +FILE: ../../../third_party/skia/gm/conicpaths.cpp +FILE: ../../../third_party/skia/gm/copyTo4444.cpp +FILE: ../../../third_party/skia/gm/displacement.cpp +FILE: ../../../third_party/skia/gm/downsamplebitmap.cpp +FILE: ../../../third_party/skia/gm/dropshadowimagefilter.cpp +FILE: ../../../third_party/skia/gm/dstreadshuffle.cpp +FILE: ../../../third_party/skia/gm/fontcache.cpp +FILE: ../../../third_party/skia/gm/fontmgr.cpp +FILE: ../../../third_party/skia/gm/gm_expectations.h +FILE: ../../../third_party/skia/gm/gradientDirtyLaundry.cpp +FILE: ../../../third_party/skia/gm/gradient_matrix.cpp +FILE: ../../../third_party/skia/gm/gradients_no_texture.cpp +FILE: ../../../third_party/skia/gm/hairlines.cpp +FILE: ../../../third_party/skia/gm/imagealphathreshold.cpp +FILE: ../../../third_party/skia/gm/imagesource.cpp +FILE: ../../../third_party/skia/gm/internal_links.cpp +FILE: ../../../third_party/skia/gm/inversepaths.cpp +FILE: ../../../third_party/skia/gm/lumafilter.cpp +FILE: ../../../third_party/skia/gm/megalooper.cpp +FILE: ../../../third_party/skia/gm/mixedtextblobs.cpp +FILE: ../../../third_party/skia/gm/nested.cpp +FILE: ../../../third_party/skia/gm/nonclosedpaths.cpp +FILE: ../../../third_party/skia/gm/offsetimagefilter.cpp +FILE: ../../../third_party/skia/gm/ovals.cpp +FILE: ../../../third_party/skia/gm/pathopsinverse.cpp +FILE: ../../../third_party/skia/gm/pathopsskpclip.cpp +FILE: ../../../third_party/skia/gm/perlinnoise.cpp +FILE: ../../../third_party/skia/gm/pictureimagefilter.cpp +FILE: ../../../third_party/skia/gm/polygons.cpp +FILE: ../../../third_party/skia/gm/rects.cpp +FILE: ../../../third_party/skia/gm/resizeimagefilter.cpp +FILE: ../../../third_party/skia/gm/roundrects.cpp +FILE: ../../../third_party/skia/gm/shallowgradient.cpp +FILE: ../../../third_party/skia/gm/skbug1719.cpp +FILE: ../../../third_party/skia/gm/spritebitmap.cpp +FILE: ../../../third_party/skia/gm/stringart.cpp +FILE: ../../../third_party/skia/gm/textbloblooper.cpp +FILE: ../../../third_party/skia/gm/thinrects.cpp +FILE: ../../../third_party/skia/gm/thinstrokedrects.cpp +FILE: ../../../third_party/skia/gm/tileimagefilter.cpp +FILE: ../../../third_party/skia/gm/vertices.cpp +FILE: ../../../third_party/skia/gm/xfermodeimagefilter.cpp +FILE: ../../../third_party/skia/gm/xfermodes2.cpp +FILE: ../../../third_party/skia/gm/xfermodes3.cpp +FILE: ../../../third_party/skia/include/core/SkDataTable.h +FILE: ../../../third_party/skia/include/core/SkDocument.h +FILE: ../../../third_party/skia/include/core/SkFontLCDConfig.h +FILE: ../../../third_party/skia/include/core/SkFontMgr.h +FILE: ../../../third_party/skia/include/core/SkFontStyle.h +FILE: ../../../third_party/skia/include/core/SkImageGenerator.h +FILE: ../../../third_party/skia/include/core/SkImageInfo.h +FILE: ../../../third_party/skia/include/effects/SkAlphaThresholdFilter.h +FILE: ../../../third_party/skia/include/effects/SkComposeImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkDisplacementMapEffect.h +FILE: ../../../third_party/skia/include/effects/SkDropShadowImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkLumaColorFilter.h +FILE: ../../../third_party/skia/include/effects/SkPerlinNoiseShader.h +FILE: ../../../third_party/skia/include/effects/SkTileImageFilter.h +FILE: ../../../third_party/skia/include/gpu/GrBlend.h +FILE: ../../../third_party/skia/include/gpu/gl/GrGLExtensions.h +FILE: ../../../third_party/skia/include/ports/SkFontConfigInterface.h +FILE: ../../../third_party/skia/include/private/GrTypesPriv.h +FILE: ../../../third_party/skia/include/private/SkMessageBus.h +FILE: ../../../third_party/skia/include/private/SkOnce.h +FILE: ../../../third_party/skia/include/private/SkTFitsIn.h +FILE: ../../../third_party/skia/include/private/SkTLogic.h +FILE: ../../../third_party/skia/include/utils/SkCanvasStateUtils.h +FILE: ../../../third_party/skia/include/utils/SkFrontBufferedStream.h +FILE: ../../../third_party/skia/include/utils/SkLua.h +FILE: ../../../third_party/skia/include/utils/SkLuaCanvas.h +FILE: ../../../third_party/skia/samplecode/SampleChart.cpp +FILE: ../../../third_party/skia/samplecode/SampleClock.cpp +FILE: ../../../third_party/skia/samplecode/SampleFilterFuzz.cpp +FILE: ../../../third_party/skia/samplecode/SampleLua.cpp +FILE: ../../../third_party/skia/samplecode/SampleManyRects.cpp +FILE: ../../../third_party/skia/samplecode/SamplePdfFileViewer.cpp +FILE: ../../../third_party/skia/samplecode/SampleStringArt.cpp +FILE: ../../../third_party/skia/samplecode/SampleUnpremul.cpp +FILE: ../../../third_party/skia/src/core/SkBitmapDevice.cpp +FILE: ../../../third_party/skia/src/core/SkBitmapDevice.h +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrix_template.h +FILE: ../../../third_party/skia/src/core/SkDataTable.cpp +FILE: ../../../third_party/skia/src/core/SkDiscardableMemory.h +FILE: ../../../third_party/skia/src/core/SkDocument.cpp +FILE: ../../../third_party/skia/src/core/SkDrawLooper.cpp +FILE: ../../../third_party/skia/src/core/SkFontStream.h +FILE: ../../../third_party/skia/src/core/SkGpuBlurUtils.cpp +FILE: ../../../third_party/skia/src/core/SkGpuBlurUtils.h +FILE: ../../../third_party/skia/src/core/SkMatrixUtils.h +FILE: ../../../third_party/skia/src/core/SkMipMap.cpp +FILE: ../../../third_party/skia/src/core/SkMipMap.h +FILE: ../../../third_party/skia/src/core/SkPaintPriv.cpp +FILE: ../../../third_party/skia/src/core/SkPaintPriv.h +FILE: ../../../third_party/skia/src/core/SkPathRef.cpp +FILE: ../../../third_party/skia/src/core/SkResourceCache.cpp +FILE: ../../../third_party/skia/src/core/SkResourceCache.h +FILE: ../../../third_party/skia/src/core/SkStreamPriv.h +FILE: ../../../third_party/skia/src/core/SkStringUtils.cpp +FILE: ../../../third_party/skia/src/core/SkStringUtils.h +FILE: ../../../third_party/skia/src/core/SkTDynamicHash.h +FILE: ../../../third_party/skia/src/core/SkTMultiMap.h +FILE: ../../../third_party/skia/src/core/SkTypefacePriv.h +FILE: ../../../third_party/skia/src/core/SkValidatingReadBuffer.h +FILE: ../../../third_party/skia/src/core/SkValidationUtils.h +FILE: ../../../third_party/skia/src/effects/SkLumaColorFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkAlphaThresholdFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkComposeImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkDisplacementMapEffect.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkDropShadowImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkTileImageFilter.cpp +FILE: ../../../third_party/skia/src/gpu/GrCaps.h +FILE: ../../../third_party/skia/src/gpu/GrCoordTransform.h +FILE: ../../../third_party/skia/src/gpu/GrGeometryProcessor.h +FILE: ../../../third_party/skia/src/gpu/GrPaint.cpp +FILE: ../../../third_party/skia/src/gpu/GrPathProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/GrPathProcessor.h +FILE: ../../../third_party/skia/src/gpu/GrPrimitiveProcessor.h +FILE: ../../../third_party/skia/src/gpu/GrRectanizer_skyline.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrBezierEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrBezierEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrBicubicEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrBitmapTextGeoProc.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrBitmapTextGeoProc.h +FILE: ../../../third_party/skia/src/gpu/effects/GrDistanceFieldGeoProc.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrDistanceFieldGeoProc.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLContext.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLContext.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLExtensions.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLVertexArray.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLVertexArray.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLGeometryProcessor.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLPrimitiveProcessor.h +FILE: ../../../third_party/skia/src/gpu/ops/GrOvalOpFactory.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrOvalOpFactory.h +FILE: ../../../third_party/skia/src/lazy/SkDiscardableMemoryPool.cpp +FILE: ../../../third_party/skia/src/lazy/SkDiscardableMemoryPool.h +FILE: ../../../third_party/skia/src/pathops/SkOpCoincidence.h +FILE: ../../../third_party/skia/src/pathops/SkOpContour.cpp +FILE: ../../../third_party/skia/src/pathops/SkOpContour.h +FILE: ../../../third_party/skia/src/pathops/SkPathOpsDebug.cpp +FILE: ../../../third_party/skia/src/pathops/SkPathOpsDebug.h +FILE: ../../../third_party/skia/src/pdf/SkPDFResourceDict.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFResourceDict.h +FILE: ../../../third_party/skia/src/ports/SkDiscardableMemory_none.cpp +FILE: ../../../third_party/skia/src/ports/SkFontConfigTypeface.h +FILE: ../../../third_party/skia/src/ports/SkFontMgr_FontConfigInterface.cpp +FILE: ../../../third_party/skia/src/ports/SkOSFile_posix.cpp +FILE: ../../../third_party/skia/src/ports/SkOSFile_win.cpp +FILE: ../../../third_party/skia/src/ports/SkTLS_none.cpp +FILE: ../../../third_party/skia/src/ports/SkTLS_pthread.cpp +FILE: ../../../third_party/skia/src/ports/SkTLS_win.cpp +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_name.cpp +FILE: ../../../third_party/skia/src/sfnt/SkTTCFHeader.h +FILE: ../../../third_party/skia/src/shaders/SkColorFilterShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkPerlinNoiseShader.cpp +FILE: ../../../third_party/skia/src/utils/SkCanvasStack.cpp +FILE: ../../../third_party/skia/src/utils/SkCanvasStack.h +FILE: ../../../third_party/skia/src/utils/SkCanvasStateUtils.cpp +FILE: ../../../third_party/skia/src/utils/SkFrontBufferedStream.cpp +FILE: ../../../third_party/skia/src/utils/SkLua.cpp +FILE: ../../../third_party/skia/src/utils/SkLuaCanvas.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2013 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/bench/ClipMaskBench.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/ClipMaskBench.cpp +FILE: ../../../third_party/skia/bench/ClipStrategyBench.cpp +FILE: ../../../third_party/skia/bench/ColorCanvasDrawBitmapBench.cpp +FILE: ../../../third_party/skia/bench/CubicKLMBench.cpp +FILE: ../../../third_party/skia/bench/MultitextureImageBench.cpp +FILE: ../../../third_party/skia/bench/PathTextBench.cpp +FILE: ../../../third_party/skia/bench/ShadowBench.cpp +FILE: ../../../third_party/skia/dm/DMGpuTestProcs.cpp +FILE: ../../../third_party/skia/example/HelloWorld.cpp +FILE: ../../../third_party/skia/example/HelloWorld.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGGradient.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGGradient.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPattern.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPattern.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.h +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.cpp +FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.h +FILE: ../../../third_party/skia/experimental/tools/gerrit-change-id-to-number +FILE: ../../../third_party/skia/fuzz/FuzzCanvas.cpp +FILE: ../../../third_party/skia/gm/alpha_image.cpp +FILE: ../../../third_party/skia/gm/atlastext.cpp +FILE: ../../../third_party/skia/gm/bitmaptiled.cpp +FILE: ../../../third_party/skia/gm/blurignorexform.cpp +FILE: ../../../third_party/skia/gm/blurimagevmask.cpp +FILE: ../../../third_party/skia/gm/blurpositioning.cpp +FILE: ../../../third_party/skia/gm/blurtextsmallradii.cpp +FILE: ../../../third_party/skia/gm/bug6643.cpp +FILE: ../../../third_party/skia/gm/bug6783.cpp +FILE: ../../../third_party/skia/gm/circle_sizes.cpp +FILE: ../../../third_party/skia/gm/crbug_691386.cpp +FILE: ../../../third_party/skia/gm/crbug_788500.cpp +FILE: ../../../third_party/skia/gm/crosscontextimage.cpp +FILE: ../../../third_party/skia/gm/dftext_blob_persp.cpp +FILE: ../../../third_party/skia/gm/drrect_small_inner.cpp +FILE: ../../../third_party/skia/gm/encode-alpha-jpeg.cpp +FILE: ../../../third_party/skia/gm/flippity.cpp +FILE: ../../../third_party/skia/gm/gammaencodedpremul.cpp +FILE: ../../../third_party/skia/gm/highcontrastfilter.cpp +FILE: ../../../third_party/skia/gm/hsl.cpp +FILE: ../../../third_party/skia/gm/imageblurclampmode.cpp +FILE: ../../../third_party/skia/gm/imageblurrepeatmode.cpp +FILE: ../../../third_party/skia/gm/jpg_color_cube.cpp +FILE: ../../../third_party/skia/gm/makecolorspace.cpp +FILE: ../../../third_party/skia/gm/manypaths.cpp +FILE: ../../../third_party/skia/gm/pictureshadercache.cpp +FILE: ../../../third_party/skia/gm/radial_gradient_precision.cpp +FILE: ../../../third_party/skia/gm/savelayer.cpp +FILE: ../../../third_party/skia/gm/shadowutils.cpp +FILE: ../../../third_party/skia/gm/shapes_as_paths.cpp +FILE: ../../../third_party/skia/gm/simple_magnification.cpp +FILE: ../../../third_party/skia/gm/srgb.cpp +FILE: ../../../third_party/skia/gm/testgradient.cpp +FILE: ../../../third_party/skia/gm/text_scale_skew.cpp +FILE: ../../../third_party/skia/gm/thinconcavepaths.cpp +FILE: ../../../third_party/skia/gm/tonalshadows.cpp +FILE: ../../../third_party/skia/gm/tosrgb_colorfilter.cpp +FILE: ../../../third_party/skia/include/android/SkAndroidFrameworkUtils.h +FILE: ../../../third_party/skia/include/atlastext/SkAtlasTextContext.h +FILE: ../../../third_party/skia/include/atlastext/SkAtlasTextFont.h +FILE: ../../../third_party/skia/include/atlastext/SkAtlasTextRenderer.h +FILE: ../../../third_party/skia/include/atlastext/SkAtlasTextTarget.h +FILE: ../../../third_party/skia/include/codec/SkEncodedOrigin.h +FILE: ../../../third_party/skia/include/core/SkColorSpaceXformCanvas.h +FILE: ../../../third_party/skia/include/core/SkDeferredDisplayListRecorder.h +FILE: ../../../third_party/skia/include/core/SkExecutor.h +FILE: ../../../third_party/skia/include/core/SkFontArguments.h +FILE: ../../../third_party/skia/include/core/SkSerialProcs.h +FILE: ../../../third_party/skia/include/core/SkSurfaceCharacterization.h +FILE: ../../../third_party/skia/include/core/SkVertices.h +FILE: ../../../third_party/skia/include/effects/SkHighContrastFilter.h +FILE: ../../../third_party/skia/include/effects/SkToSRGBColorFilter.h +FILE: ../../../third_party/skia/include/encode/SkEncoder.h +FILE: ../../../third_party/skia/include/encode/SkJpegEncoder.h +FILE: ../../../third_party/skia/include/encode/SkPngEncoder.h +FILE: ../../../third_party/skia/include/encode/SkWebpEncoder.h +FILE: ../../../third_party/skia/include/gpu/GrBackendSemaphore.h +FILE: ../../../third_party/skia/include/gpu/GrBackendSurface.h +FILE: ../../../third_party/skia/include/gpu/mock/GrMockTypes.h +FILE: ../../../third_party/skia/include/gpu/mtl/GrMtlTypes.h +FILE: ../../../third_party/skia/include/private/GrSharedEnums.h +FILE: ../../../third_party/skia/include/private/SkDeferredDisplayList.h +FILE: ../../../third_party/skia/include/private/SkImageInfoPriv.h +FILE: ../../../third_party/skia/include/private/SkMalloc.h +FILE: ../../../third_party/skia/include/private/SkShadowFlags.h +FILE: ../../../third_party/skia/include/utils/SkShadowUtils.h +FILE: ../../../third_party/skia/modules/skottie/include/Skottie.h +FILE: ../../../third_party/skia/modules/skottie/src/Skottie.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieAnimator.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieAnimator.h +FILE: ../../../third_party/skia/modules/skottie/src/SkottieValue.cpp +FILE: ../../../third_party/skia/modules/skottie/src/SkottieValue.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGColor.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGDraw.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGEffectNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGGeometryNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGGroup.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGInvalidationController.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGMerge.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGPaintNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGPath.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGRect.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGRenderNode.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGTransform.h +FILE: ../../../third_party/skia/modules/sksg/include/SkSGTrimEffect.h +FILE: ../../../third_party/skia/modules/sksg/src/SkSGColor.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGDraw.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGEffectNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGGeometryNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGGroup.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGInvalidationController.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGMerge.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGPaintNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGPath.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGRect.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGRenderNode.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGTransform.cpp +FILE: ../../../third_party/skia/modules/sksg/src/SkSGTrimEffect.cpp +FILE: ../../../third_party/skia/samplecode/SampleCCPRGeometry.cpp +FILE: ../../../third_party/skia/samplecode/SampleChineseFling.cpp +FILE: ../../../third_party/skia/samplecode/SampleCowboy.cpp +FILE: ../../../third_party/skia/samplecode/SamplePathText.cpp +FILE: ../../../third_party/skia/samplecode/SampleShadowColor.cpp +FILE: ../../../third_party/skia/samplecode/SampleShadowReference.cpp +FILE: ../../../third_party/skia/samplecode/SampleShadowUtils.cpp +FILE: ../../../third_party/skia/src/android/SkAndroidFrameworkUtils.cpp +FILE: ../../../third_party/skia/src/atlastext/SkAtlasTextContext.cpp +FILE: ../../../third_party/skia/src/atlastext/SkAtlasTextTarget.cpp +FILE: ../../../third_party/skia/src/atlastext/SkInternalAtlasTextContext.cpp +FILE: ../../../third_party/skia/src/atlastext/SkInternalAtlasTextContext.h +FILE: ../../../third_party/skia/src/c/sk_effects.cpp +FILE: ../../../third_party/skia/src/codec/SkBmpBaseCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkBmpBaseCodec.h +FILE: ../../../third_party/skia/src/codec/SkFrameHolder.h +FILE: ../../../third_party/skia/src/codec/SkHeifCodec.cpp +FILE: ../../../third_party/skia/src/codec/SkHeifCodec.h +FILE: ../../../third_party/skia/src/codec/SkJpegPriv.h +FILE: ../../../third_party/skia/src/codec/SkPngPriv.h +FILE: ../../../third_party/skia/src/codec/SkStubHeifDecoderAPI.h +FILE: ../../../third_party/skia/src/compute/color/color.c +FILE: ../../../third_party/skia/src/compute/color/color.h +FILE: ../../../third_party/skia/src/compute/skc/assert_state.h +FILE: ../../../third_party/skia/src/compute/skc/block.h +FILE: ../../../third_party/skia/src/compute/skc/common.h +FILE: ../../../third_party/skia/src/compute/skc/composition.c +FILE: ../../../third_party/skia/src/compute/skc/composition.h +FILE: ../../../third_party/skia/src/compute/skc/context.c +FILE: ../../../third_party/skia/src/compute/skc/context.h +FILE: ../../../third_party/skia/src/compute/skc/extent_ring.c +FILE: ../../../third_party/skia/src/compute/skc/extent_ring.h +FILE: ../../../third_party/skia/src/compute/skc/grid.c +FILE: ../../../third_party/skia/src/compute/skc/grid.h +FILE: ../../../third_party/skia/src/compute/skc/handle.h +FILE: ../../../third_party/skia/src/compute/skc/macros.h +FILE: ../../../third_party/skia/src/compute/skc/main.c +FILE: ../../../third_party/skia/src/compute/skc/path.h +FILE: ../../../third_party/skia/src/compute/skc/path_builder.c +FILE: ../../../third_party/skia/src/compute/skc/path_builder.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/atomic_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/block_pool_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/block_pool_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/composition_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/composition_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/config_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/cq_pool_cl.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/cq_pool_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/device_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/export_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/extent_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/extent_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/extent_cl_12_unified.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/handle_pool_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/handle_pool_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/block_pool_init.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/avx2/device_cl_12_avx2.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/gen9/device_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/gen9/kernel_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/fills_expand.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/paths_copy.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/paths_reclaim.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/place.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/prefix.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/rasterize.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/rasters_alloc.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/rasters_reclaim.cl +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/path_builder_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/path_builder_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/skc_cl.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/styling_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/styling_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/surface_cl_12.c +FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/surface_cl_12.h +FILE: ../../../third_party/skia/src/compute/skc/raster.h +FILE: ../../../third_party/skia/src/compute/skc/raster_builder.c +FILE: ../../../third_party/skia/src/compute/skc/raster_builder.h +FILE: ../../../third_party/skia/src/compute/skc/scheduler.cpp +FILE: ../../../third_party/skia/src/compute/skc/scheduler.h +FILE: ../../../third_party/skia/src/compute/skc/skc.h +FILE: ../../../third_party/skia/src/compute/skc/skc_styling.h +FILE: ../../../third_party/skia/src/compute/skc/subblock.h +FILE: ../../../third_party/skia/src/compute/skc/surface.c +FILE: ../../../third_party/skia/src/compute/skc/surface.h +FILE: ../../../third_party/skia/src/compute/skc/types.h +FILE: ../../../third_party/skia/src/compute/skc/util.h +FILE: ../../../third_party/skia/src/compute/skc/weakref.c +FILE: ../../../third_party/skia/src/compute/skc/weakref.h +FILE: ../../../third_party/skia/src/core/SkArenaAllocList.h +FILE: ../../../third_party/skia/src/core/SkAutoBlitterChoose.h +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_utils.h +FILE: ../../../third_party/skia/src/core/SkBlendMode.cpp +FILE: ../../../third_party/skia/src/core/SkBlitter_RGB565.cpp +FILE: ../../../third_party/skia/src/core/SkClipStackDevice.cpp +FILE: ../../../third_party/skia/src/core/SkClipStackDevice.h +FILE: ../../../third_party/skia/src/core/SkColorSpaceXformCanvas.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXformer.cpp +FILE: ../../../third_party/skia/src/core/SkColorSpaceXformer.h +FILE: ../../../third_party/skia/src/core/SkCoverageDelta.cpp +FILE: ../../../third_party/skia/src/core/SkCoverageDelta.h +FILE: ../../../third_party/skia/src/core/SkDeferredDisplayListRecorder.cpp +FILE: ../../../third_party/skia/src/core/SkDrawShadowInfo.cpp +FILE: ../../../third_party/skia/src/core/SkDrawShadowInfo.h +FILE: ../../../third_party/skia/src/core/SkDraw_vertices.cpp +FILE: ../../../third_party/skia/src/core/SkExecutor.cpp +FILE: ../../../third_party/skia/src/core/SkFDot6Constants.cpp +FILE: ../../../third_party/skia/src/core/SkFontMgrPriv.h +FILE: ../../../third_party/skia/src/core/SkGaussFilter.cpp +FILE: ../../../third_party/skia/src/core/SkGaussFilter.h +FILE: ../../../third_party/skia/src/core/SkImageFilterPriv.h +FILE: ../../../third_party/skia/src/core/SkMaskBlurFilter.cpp +FILE: ../../../third_party/skia/src/core/SkMaskBlurFilter.h +FILE: ../../../third_party/skia/src/core/SkRasterClipStack.h +FILE: ../../../third_party/skia/src/core/SkSafeMath.h +FILE: ../../../third_party/skia/src/core/SkSpriteBlitter_RGB565.cpp +FILE: ../../../third_party/skia/src/core/SkTaskGroup2D.cpp +FILE: ../../../third_party/skia/src/core/SkTaskGroup2D.h +FILE: ../../../third_party/skia/src/core/SkThreadedBMPDevice.cpp +FILE: ../../../third_party/skia/src/core/SkThreadedBMPDevice.h +FILE: ../../../third_party/skia/src/core/SkUnPreMultiplyPriv.h +FILE: ../../../third_party/skia/src/core/SkVertices.cpp +FILE: ../../../third_party/skia/src/core/SkVptr.h +FILE: ../../../third_party/skia/src/core/SkWritePixelsRec.h +FILE: ../../../third_party/skia/src/effects/SkDashImpl.h +FILE: ../../../third_party/skia/src/effects/SkHighContrastFilter.cpp +FILE: ../../../third_party/skia/src/effects/SkToSRGBColorFilter.cpp +FILE: ../../../third_party/skia/src/gpu/GrAHardwareBufferImageGenerator.cpp +FILE: ../../../third_party/skia/src/gpu/GrAHardwareBufferImageGenerator.h +FILE: ../../../third_party/skia/src/gpu/GrBackendSurface.cpp +FILE: ../../../third_party/skia/src/gpu/GrBackendTextureImageGenerator.cpp +FILE: ../../../third_party/skia/src/gpu/GrBackendTextureImageGenerator.h +FILE: ../../../third_party/skia/src/gpu/GrColorSpaceInfo.cpp +FILE: ../../../third_party/skia/src/gpu/GrColorSpaceInfo.h +FILE: ../../../third_party/skia/src/gpu/GrDeferredProxyUploader.h +FILE: ../../../third_party/skia/src/gpu/GrDeferredUpload.h +FILE: ../../../third_party/skia/src/gpu/GrOnFlushResourceProvider.cpp +FILE: ../../../third_party/skia/src/gpu/GrOnFlushResourceProvider.h +FILE: ../../../third_party/skia/src/gpu/GrProcessorSet.cpp +FILE: ../../../third_party/skia/src/gpu/GrProcessorSet.h +FILE: ../../../third_party/skia/src/gpu/GrResourceAllocator.cpp +FILE: ../../../third_party/skia/src/gpu/GrResourceAllocator.h +FILE: ../../../third_party/skia/src/gpu/GrSemaphore.h +FILE: ../../../third_party/skia/src/gpu/GrStencilClip.h +FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyPriv.h +FILE: ../../../third_party/skia/src/gpu/GrTextureProxyCacheAccess.h +FILE: ../../../third_party/skia/src/gpu/GrTextureProxyPriv.h +FILE: ../../../third_party/skia/src/gpu/SkGr.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCAtlas.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCAtlas.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipProcessor.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCoverageProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCoverageProcessor.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCoverageProcessor_VSImpl.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCubicShader.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCubicShader.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCGeometry.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCGeometry.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathParser.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathParser.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.h +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp +FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.h +FILE: ../../../third_party/skia/src/gpu/effects/GrAtlasedShaderHelpers.h +FILE: ../../../third_party/skia/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrBlurredEdgeFragmentProcessor.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrBlurredEdgeFragmentProcessor.h +FILE: ../../../third_party/skia/src/gpu/effects/GrCircleEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrCircleEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrCircleEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrEllipseEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrEllipseEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrEllipseEffect.h +FILE: ../../../third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp +FILE: ../../../third_party/skia/src/gpu/effects/GrSimpleTextureEffect.fp +FILE: ../../../third_party/skia/src/gpu/effects/GrSimpleTextureEffect.h +FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpuCommandBuffer.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLSemaphore.cpp +FILE: ../../../third_party/skia/src/gpu/gl/GrGLSemaphore.h +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp +FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.h +FILE: ../../../third_party/skia/src/gpu/mock/GrMockBuffer.h +FILE: ../../../third_party/skia/src/gpu/mock/GrMockCaps.h +FILE: ../../../third_party/skia/src/gpu/mock/GrMockGpu.cpp +FILE: ../../../third_party/skia/src/gpu/mock/GrMockGpu.h +FILE: ../../../third_party/skia/src/gpu/mock/GrMockGpuCommandBuffer.h +FILE: ../../../third_party/skia/src/gpu/mock/GrMockStencilAttachment.h +FILE: ../../../third_party/skia/src/gpu/mock/GrMockTexture.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlCaps.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlCaps.mm +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlGpu.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlGpu.mm +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlRenderTarget.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlRenderTarget.mm +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTexture.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTexture.mm +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTrampoline.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTrampoline.mm +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlUtil.h +FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlUtil.mm +FILE: ../../../third_party/skia/src/gpu/ops/GrClearOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrDebugMarkerOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrNonAAFillRectOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrRectOpFactory.h +FILE: ../../../third_party/skia/src/gpu/ops/GrSemaphoreOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrSemaphoreOp.h +FILE: ../../../third_party/skia/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrSimpleMeshDrawOpHelper.h +FILE: ../../../third_party/skia/src/gpu/ops/GrStencilPathOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrTextureOp.cpp +FILE: ../../../third_party/skia/src/gpu/ops/GrTextureOp.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkBufferView.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkBufferView.h +FILE: ../../../third_party/skia/src/gpu/vk/GrVkSemaphore.cpp +FILE: ../../../third_party/skia/src/gpu/vk/GrVkSemaphore.h +FILE: ../../../third_party/skia/src/jumper/SkJumper.cpp +FILE: ../../../third_party/skia/src/jumper/SkJumper.h +FILE: ../../../third_party/skia/src/jumper/SkJumper_misc.h +FILE: ../../../third_party/skia/src/opts/SkUtils_opts.h +FILE: ../../../third_party/skia/src/pdf/SkKeyedImage.cpp +FILE: ../../../third_party/skia/src/pdf/SkKeyedImage.h +FILE: ../../../third_party/skia/src/pdf/SkPDFGradientShader.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFGradientShader.h +FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_directory.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_embedded.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_empty.cpp +FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_none.cpp +FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_none_imagefilters.cpp +FILE: ../../../third_party/skia/src/ports/SkOSFile_ios.h +FILE: ../../../third_party/skia/src/sfnt/SkOTTable_fvar.h +FILE: ../../../third_party/skia/src/shaders/SkShaderBase.h +FILE: ../../../third_party/skia/src/sksl/SkSLCPP.h +FILE: ../../../third_party/skia/src/sksl/SkSLCPPCodeGenerator.h +FILE: ../../../third_party/skia/src/sksl/SkSLFileOutputStream.h +FILE: ../../../third_party/skia/src/sksl/SkSLHCodeGenerator.h +FILE: ../../../third_party/skia/src/sksl/SkSLLexer.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLLexer.h +FILE: ../../../third_party/skia/src/sksl/SkSLOutputStream.h +FILE: ../../../third_party/skia/src/sksl/SkSLSectionAndParameterHelper.h +FILE: ../../../third_party/skia/src/sksl/SkSLString.cpp +FILE: ../../../third_party/skia/src/sksl/SkSLString.h +FILE: ../../../third_party/skia/src/sksl/SkSLStringStream.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTEnum.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSwitchCase.h +FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSwitchStatement.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLEnum.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLSetting.cpp +FILE: ../../../third_party/skia/src/sksl/ir/SkSLSwitchCase.h +FILE: ../../../third_party/skia/src/sksl/ir/SkSLSwitchStatement.h +FILE: ../../../third_party/skia/src/sksl/lex/DFA.h +FILE: ../../../third_party/skia/src/sksl/lex/DFAState.h +FILE: ../../../third_party/skia/src/sksl/lex/LexUtil.h +FILE: ../../../third_party/skia/src/sksl/lex/Main.cpp +FILE: ../../../third_party/skia/src/sksl/lex/NFA.cpp +FILE: ../../../third_party/skia/src/sksl/lex/NFA.h +FILE: ../../../third_party/skia/src/sksl/lex/NFAState.h +FILE: ../../../third_party/skia/src/sksl/lex/NFAtoDFA.h +FILE: ../../../third_party/skia/src/sksl/lex/RegexNode.cpp +FILE: ../../../third_party/skia/src/sksl/lex/RegexNode.h +FILE: ../../../third_party/skia/src/sksl/lex/RegexParser.cpp +FILE: ../../../third_party/skia/src/sksl/lex/RegexParser.h +FILE: ../../../third_party/skia/src/sksl/sksl_enums.inc +FILE: ../../../third_party/skia/src/utils/SkFloatToDecimal.cpp +FILE: ../../../third_party/skia/src/utils/SkFloatToDecimal.h +FILE: ../../../third_party/skia/src/utils/SkJSONWriter.cpp +FILE: ../../../third_party/skia/src/utils/SkJSONWriter.h +FILE: ../../../third_party/skia/src/utils/SkPolyUtils.cpp +FILE: ../../../third_party/skia/src/utils/SkPolyUtils.h +FILE: ../../../third_party/skia/src/utils/SkShadowTessellator.cpp +FILE: ../../../third_party/skia/src/utils/SkShadowTessellator.h +FILE: ../../../third_party/skia/src/utils/SkShadowUtils.cpp +FILE: ../../../third_party/skia/src/utils/SkThreadUtils_pthread.cpp +FILE: ../../../third_party/skia/src/utils/SkThreadUtils_win.cpp +FILE: ../../../third_party/skia/src/xps/SkXPSDocument.h +---------------------------------------------------------------------------------------------------- +Copyright 2017 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/bench/ReadPixBench.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/bench/ReadPixBench.cpp +FILE: ../../../third_party/skia/bench/WriterBench.cpp +FILE: ../../../third_party/skia/include/effects/SkColorFilterImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkLightingImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkMagnifierImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkMatrixConvolutionImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkMergeImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkMorphologyImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkOffsetImageFilter.h +FILE: ../../../third_party/skia/src/core/SkImageFilter.cpp +FILE: ../../../third_party/skia/src/core/SkUtilsArm.cpp +FILE: ../../../third_party/skia/src/core/SkUtilsArm.h +FILE: ../../../third_party/skia/src/effects/imagefilters/SkColorFilterImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkLightingImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkMagnifierImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkMatrixConvolutionImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkMergeImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkMorphologyImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkOffsetImageFilter.cpp +FILE: ../../../third_party/skia/src/images/SkImageEncoderFns.h +FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_filter_neon.h +FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp +FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.h +FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp +FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp +FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2012 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/experimental/wasm/wasm_main.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/experimental/wasm/wasm_main.cpp +FILE: ../../../third_party/skia/fuzz/FuzzEncoders.cpp +FILE: ../../../third_party/skia/fuzz/FuzzPolyUtils.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2018 Google LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/fuzz/FuzzDrawFunctions.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/fuzz/FuzzDrawFunctions.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2016 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/fuzz/oss_fuzz/FuzzAPIImageFilter.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/fuzz/FuzzCommon.h +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzAPIImageFilter.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzAnimatedImage.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzDrawFunctions.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzGradients.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImage.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJPEGEncoder.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJSON.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp +FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp +FILE: ../../../third_party/skia/modules/skottie/fuzz/FuzzSkottieJSON.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2018 Google, LLC + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/gm/circles.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/gm/circles.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2012 Intel Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/config/SkUserConfig.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/config/SkUserConfig.h +FILE: ../../../third_party/skia/include/core/SkBitmap.h +FILE: ../../../third_party/skia/include/core/SkCanvas.h +FILE: ../../../third_party/skia/include/core/SkColor.h +FILE: ../../../third_party/skia/include/core/SkColorFilter.h +FILE: ../../../third_party/skia/include/core/SkColorPriv.h +FILE: ../../../third_party/skia/include/core/SkDeque.h +FILE: ../../../third_party/skia/include/core/SkFlattenable.h +FILE: ../../../third_party/skia/include/core/SkGraphics.h +FILE: ../../../third_party/skia/include/core/SkMaskFilter.h +FILE: ../../../third_party/skia/include/core/SkMath.h +FILE: ../../../third_party/skia/include/core/SkMatrix.h +FILE: ../../../third_party/skia/include/core/SkMetaData.h +FILE: ../../../third_party/skia/include/core/SkPaint.h +FILE: ../../../third_party/skia/include/core/SkPath.h +FILE: ../../../third_party/skia/include/core/SkPathEffect.h +FILE: ../../../third_party/skia/include/core/SkPathMeasure.h +FILE: ../../../third_party/skia/include/core/SkPoint.h +FILE: ../../../third_party/skia/include/core/SkPostConfig.h +FILE: ../../../third_party/skia/include/core/SkPreConfig.h +FILE: ../../../third_party/skia/include/core/SkRect.h +FILE: ../../../third_party/skia/include/core/SkRefCnt.h +FILE: ../../../third_party/skia/include/core/SkScalar.h +FILE: ../../../third_party/skia/include/core/SkShader.h +FILE: ../../../third_party/skia/include/core/SkStream.h +FILE: ../../../third_party/skia/include/core/SkString.h +FILE: ../../../third_party/skia/include/core/SkTime.h +FILE: ../../../third_party/skia/include/core/SkTypeface.h +FILE: ../../../third_party/skia/include/core/SkTypes.h +FILE: ../../../third_party/skia/include/effects/Sk1DPathEffect.h +FILE: ../../../third_party/skia/include/effects/Sk2DPathEffect.h +FILE: ../../../third_party/skia/include/effects/SkBlurMaskFilter.h +FILE: ../../../third_party/skia/include/effects/SkCornerPathEffect.h +FILE: ../../../third_party/skia/include/effects/SkDashPathEffect.h +FILE: ../../../third_party/skia/include/effects/SkDiscretePathEffect.h +FILE: ../../../third_party/skia/include/effects/SkGradientShader.h +FILE: ../../../third_party/skia/include/effects/SkTableMaskFilter.h +FILE: ../../../third_party/skia/include/private/SkFixed.h +FILE: ../../../third_party/skia/include/private/SkFloatingPoint.h +FILE: ../../../third_party/skia/include/private/SkNoncopyable.h +FILE: ../../../third_party/skia/include/private/SkTDArray.h +FILE: ../../../third_party/skia/include/private/SkTSearch.h +FILE: ../../../third_party/skia/include/private/SkTemplates.h +FILE: ../../../third_party/skia/include/utils/SkBase64.h +FILE: ../../../third_party/skia/include/utils/SkCamera.h +FILE: ../../../third_party/skia/include/utils/SkInterpolator.h +FILE: ../../../third_party/skia/include/utils/SkParse.h +FILE: ../../../third_party/skia/include/utils/SkParsePath.h +FILE: ../../../third_party/skia/include/utils/SkRandom.h +FILE: ../../../third_party/skia/include/views/SkEvent.h +FILE: ../../../third_party/skia/include/views/SkEventSink.h +FILE: ../../../third_party/skia/include/views/SkKey.h +FILE: ../../../third_party/skia/include/views/SkView.h +FILE: ../../../third_party/skia/src/core/SkAlphaRuns.cpp +FILE: ../../../third_party/skia/src/core/SkAnalyticEdge.cpp +FILE: ../../../third_party/skia/src/core/SkAnalyticEdge.h +FILE: ../../../third_party/skia/src/core/SkAntiRun.h +FILE: ../../../third_party/skia/src/core/SkBlitBWMaskTemplate.h +FILE: ../../../third_party/skia/src/core/SkBlitter.cpp +FILE: ../../../third_party/skia/src/core/SkBlitter.h +FILE: ../../../third_party/skia/src/core/SkBlitter_A8.cpp +FILE: ../../../third_party/skia/src/core/SkBlitter_ARGB32.cpp +FILE: ../../../third_party/skia/src/core/SkBlitter_Sprite.cpp +FILE: ../../../third_party/skia/src/core/SkBlurMF.cpp +FILE: ../../../third_party/skia/src/core/SkBlurMask.cpp +FILE: ../../../third_party/skia/src/core/SkBlurMask.h +FILE: ../../../third_party/skia/src/core/SkBuffer.cpp +FILE: ../../../third_party/skia/src/core/SkBuffer.h +FILE: ../../../third_party/skia/src/core/SkColor.cpp +FILE: ../../../third_party/skia/src/core/SkColorData.h +FILE: ../../../third_party/skia/src/core/SkColorFilter.cpp +FILE: ../../../third_party/skia/src/core/SkCoreBlitters.h +FILE: ../../../third_party/skia/src/core/SkDebug.cpp +FILE: ../../../third_party/skia/src/core/SkDeque.cpp +FILE: ../../../third_party/skia/src/core/SkDescriptor.h +FILE: ../../../third_party/skia/src/core/SkDraw.cpp +FILE: ../../../third_party/skia/src/core/SkDraw.h +FILE: ../../../third_party/skia/src/core/SkEdge.cpp +FILE: ../../../third_party/skia/src/core/SkEdge.h +FILE: ../../../third_party/skia/src/core/SkEndian.h +FILE: ../../../third_party/skia/src/core/SkFDot6.h +FILE: ../../../third_party/skia/src/core/SkFDot6Constants.h +FILE: ../../../third_party/skia/src/core/SkGeometry.cpp +FILE: ../../../third_party/skia/src/core/SkGeometry.h +FILE: ../../../third_party/skia/src/core/SkGlyph.h +FILE: ../../../third_party/skia/src/core/SkGlyphCache.cpp +FILE: ../../../third_party/skia/src/core/SkGlyphCache.h +FILE: ../../../third_party/skia/src/core/SkGraphics.cpp +FILE: ../../../third_party/skia/src/core/SkMask.h +FILE: ../../../third_party/skia/src/core/SkMaskFilter.cpp +FILE: ../../../third_party/skia/src/core/SkMatrix.cpp +FILE: ../../../third_party/skia/src/core/SkMetaData.cpp +FILE: ../../../third_party/skia/src/core/SkModeColorFilter.cpp +FILE: ../../../third_party/skia/src/core/SkOSFile.h +FILE: ../../../third_party/skia/src/core/SkPaint.cpp +FILE: ../../../third_party/skia/src/core/SkPath.cpp +FILE: ../../../third_party/skia/src/core/SkPathEffect.cpp +FILE: ../../../third_party/skia/src/core/SkPointPriv.h +FILE: ../../../third_party/skia/src/core/SkRect.cpp +FILE: ../../../third_party/skia/src/core/SkRegion.cpp +FILE: ../../../third_party/skia/src/core/SkRegionPriv.h +FILE: ../../../third_party/skia/src/core/SkRegion_path.cpp +FILE: ../../../third_party/skia/src/core/SkScalerContext.cpp +FILE: ../../../third_party/skia/src/core/SkScalerContext.h +FILE: ../../../third_party/skia/src/core/SkScan.cpp +FILE: ../../../third_party/skia/src/core/SkScanPriv.h +FILE: ../../../third_party/skia/src/core/SkScan_AntiPath.cpp +FILE: ../../../third_party/skia/src/core/SkScan_Hairline.cpp +FILE: ../../../third_party/skia/src/core/SkScan_Path.cpp +FILE: ../../../third_party/skia/src/core/SkSpriteBlitter.h +FILE: ../../../third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp +FILE: ../../../third_party/skia/src/core/SkStream.cpp +FILE: ../../../third_party/skia/src/core/SkString.cpp +FILE: ../../../third_party/skia/src/core/SkStroke.h +FILE: ../../../third_party/skia/src/core/SkStrokerPriv.cpp +FILE: ../../../third_party/skia/src/core/SkStrokerPriv.h +FILE: ../../../third_party/skia/src/core/SkTSearch.cpp +FILE: ../../../third_party/skia/src/core/SkTSort.h +FILE: ../../../third_party/skia/src/core/SkUtils.cpp +FILE: ../../../third_party/skia/src/core/SkUtils.h +FILE: ../../../third_party/skia/src/core/SkXfermode.cpp +FILE: ../../../third_party/skia/src/core/SkXfermodePriv.h +FILE: ../../../third_party/skia/src/effects/Sk1DPathEffect.cpp +FILE: ../../../third_party/skia/src/effects/Sk2DPathEffect.cpp +FILE: ../../../third_party/skia/src/effects/SkCornerPathEffect.cpp +FILE: ../../../third_party/skia/src/effects/SkDashPathEffect.cpp +FILE: ../../../third_party/skia/src/effects/SkDiscretePathEffect.cpp +FILE: ../../../third_party/skia/src/effects/SkEmbossMask.cpp +FILE: ../../../third_party/skia/src/effects/SkEmbossMask.h +FILE: ../../../third_party/skia/src/effects/SkEmbossMaskFilter.cpp +FILE: ../../../third_party/skia/src/effects/SkEmbossMaskFilter.h +FILE: ../../../third_party/skia/src/images/SkPngEncoder.cpp +FILE: ../../../third_party/skia/src/ports/SkDebug_android.cpp +FILE: ../../../third_party/skia/src/ports/SkDebug_stdio.cpp +FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType.cpp +FILE: ../../../third_party/skia/src/ports/SkFontHost_mac.cpp +FILE: ../../../third_party/skia/src/ports/SkFontHost_win.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom.h +FILE: ../../../third_party/skia/src/ports/SkOSFile_stdio.cpp +FILE: ../../../third_party/skia/src/shaders/SkBitmapProcShader.h +FILE: ../../../third_party/skia/src/shaders/SkComposeShader.cpp +FILE: ../../../third_party/skia/src/shaders/SkComposeShader.h +FILE: ../../../third_party/skia/src/shaders/SkShader.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/SkGradientShader.cpp +FILE: ../../../third_party/skia/src/utils/SkBase64.cpp +FILE: ../../../third_party/skia/src/utils/SkBase64.h +FILE: ../../../third_party/skia/src/utils/SkCamera.cpp +FILE: ../../../third_party/skia/src/utils/SkParse.cpp +FILE: ../../../third_party/skia/src/utils/SkParseColor.cpp +FILE: ../../../third_party/skia/src/views/SkEvent.cpp +FILE: ../../../third_party/skia/src/views/SkEventSink.cpp +FILE: ../../../third_party/skia/src/xml/SkDOM.cpp +FILE: ../../../third_party/skia/src/xml/SkDOM.h +FILE: ../../../third_party/skia/src/xml/SkXMLParser.cpp +FILE: ../../../third_party/skia/src/xml/SkXMLParser.h +FILE: ../../../third_party/skia/src/xml/SkXMLWriter.cpp +FILE: ../../../third_party/skia/src/xml/SkXMLWriter.h +---------------------------------------------------------------------------------------------------- +Copyright 2006 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/core/SkDrawLooper.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/core/SkDrawLooper.h +FILE: ../../../third_party/skia/include/effects/SkBlurImageFilter.h +FILE: ../../../third_party/skia/src/core/SkScan.h +FILE: ../../../third_party/skia/src/core/SkScan_Antihair.cpp +FILE: ../../../third_party/skia/src/core/SkTypeface.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkBlurImageFilter.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_android_parser.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_android_parser.h +---------------------------------------------------------------------------------------------------- +Copyright 2011 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/core/SkMallocPixelRef.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/core/SkMallocPixelRef.h +FILE: ../../../third_party/skia/include/core/SkPixelRef.h +FILE: ../../../third_party/skia/include/core/SkUnPreMultiply.h +FILE: ../../../third_party/skia/include/effects/SkBlurDrawLooper.h +FILE: ../../../third_party/skia/include/private/SkFloatBits.h +FILE: ../../../third_party/skia/src/core/SkBitmap.cpp +FILE: ../../../third_party/skia/src/core/SkCanvas.cpp +FILE: ../../../third_party/skia/src/core/SkDither.h +FILE: ../../../third_party/skia/src/core/SkMath.cpp +FILE: ../../../third_party/skia/src/core/SkPathMeasure.cpp +FILE: ../../../third_party/skia/src/core/SkPoint.cpp +FILE: ../../../third_party/skia/src/core/SkPtrRecorder.h +FILE: ../../../third_party/skia/src/core/SkReader32.h +FILE: ../../../third_party/skia/src/core/SkStroke.cpp +FILE: ../../../third_party/skia/src/core/SkWriter32.h +FILE: ../../../third_party/skia/src/effects/SkPackBits.h +FILE: ../../../third_party/skia/src/ports/SkFontMgr_empty_factory.cpp +FILE: ../../../third_party/skia/src/ports/SkImageEncoder_CG.cpp +FILE: ../../../third_party/skia/src/utils/SkInterpolator.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2008 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/core/SkPicture.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/core/SkPicture.h +FILE: ../../../third_party/skia/include/effects/SkColorMatrix.h +FILE: ../../../third_party/skia/include/effects/SkColorMatrixFilter.h +FILE: ../../../third_party/skia/src/core/SkBitmapProcState.h +FILE: ../../../third_party/skia/src/core/SkMask.cpp +FILE: ../../../third_party/skia/src/core/SkPicture.cpp +FILE: ../../../third_party/skia/src/images/SkJpegEncoder.cpp +FILE: ../../../third_party/skia/src/shaders/SkColorShader.h +---------------------------------------------------------------------------------------------------- +Copyright 2007 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/core/SkRegion.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/core/SkRegion.h +---------------------------------------------------------------------------------------------------- +Copyright 2005 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/effects/SkPictureImageFilter.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/effects/SkPictureImageFilter.h +FILE: ../../../third_party/skia/include/effects/SkXfermodeImageFilter.h +FILE: ../../../third_party/skia/src/effects/imagefilters/SkPictureImageFilter.cpp +FILE: ../../../third_party/skia/src/effects/imagefilters/SkXfermodeImageFilter.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2013 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/gpu/GrConfig.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/gpu/GrConfig.h +FILE: ../../../third_party/skia/include/gpu/GrContext.h +FILE: ../../../third_party/skia/include/gpu/GrTypes.h +FILE: ../../../third_party/skia/include/private/GrColor.h +FILE: ../../../third_party/skia/src/core/SkImageInfo.cpp +FILE: ../../../third_party/skia/src/core/SkRasterClip.cpp +FILE: ../../../third_party/skia/src/core/SkRasterClip.h +FILE: ../../../third_party/skia/src/core/SkStrikeCache.h +FILE: ../../../third_party/skia/src/gpu/GrAllocator.h +FILE: ../../../third_party/skia/src/gpu/GrBufferAllocPool.cpp +FILE: ../../../third_party/skia/src/gpu/GrBufferAllocPool.h +FILE: ../../../third_party/skia/src/gpu/GrClip.h +FILE: ../../../third_party/skia/src/gpu/GrFixedClip.cpp +FILE: ../../../third_party/skia/src/gpu/GrGlyph.h +FILE: ../../../third_party/skia/src/gpu/GrGpu.cpp +FILE: ../../../third_party/skia/src/gpu/GrRect.h +FILE: ../../../third_party/skia/src/gpu/GrRectanizer.h +FILE: ../../../third_party/skia/src/gpu/GrRectanizer_pow2.cpp +FILE: ../../../third_party/skia/src/gpu/GrRenderTargetOpList.cpp +FILE: ../../../third_party/skia/src/gpu/GrRenderTargetOpList.h +FILE: ../../../third_party/skia/src/gpu/SkGpuDevice.h +FILE: ../../../third_party/skia/src/gpu/SkGr.cpp +FILE: ../../../third_party/skia/src/ports/SkDebug_win.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/SkGradientBitmapCache.cpp +FILE: ../../../third_party/skia/src/shaders/gradients/SkGradientBitmapCache.h +FILE: ../../../third_party/skia/src/views/SkTouchGesture.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2010 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h +FILE: ../../../third_party/skia/include/utils/SkTraceEventPhase.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/include/utils/SkEventTracer.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/include/utils/SkEventTracer.h +---------------------------------------------------------------------------------------------------- +Copyright (C) 2014 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/infra/bots/ct/ct_skps.isolate + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/infra/bots/ct/ct_skps.isolate +---------------------------------------------------------------------------------------------------- +Copyright (c) 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/infra/bots/gen_tasks.go + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/infra/bots/gen_tasks.go +---------------------------------------------------------------------------------------------------- +Copyright 2016 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/codec/SkCodecPriv.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/codec/SkCodecPriv.h +FILE: ../../../third_party/skia/src/core/SkLocalMatrixImageFilter.h +FILE: ../../../third_party/skia/src/ports/SkImageGenerator_none.cpp +FILE: ../../../third_party/skia/src/ports/SkImageGenerator_skia.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2015 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/codec/SkColorTable.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/codec/SkColorTable.cpp +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_filter.h +FILE: ../../../third_party/skia/src/core/SkCubicClipper.cpp +FILE: ../../../third_party/skia/src/core/SkCubicClipper.h +FILE: ../../../third_party/skia/src/core/SkEdgeClipper.cpp +FILE: ../../../third_party/skia/src/core/SkEdgeClipper.h +FILE: ../../../third_party/skia/src/core/SkFontLCDConfig.cpp +FILE: ../../../third_party/skia/src/core/SkQuadClipper.cpp +FILE: ../../../third_party/skia/src/core/SkQuadClipper.h +FILE: ../../../third_party/skia/src/images/SkImageEncoder.cpp +FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp +FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.h +FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_SSE2.h +FILE: ../../../third_party/skia/src/opts/opts_check_x86.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2009 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/codec/SkGifCodec.cpp +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/codec/SkGifCodec.cpp +---------------------------------------------------------------------------------------------------- +Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.h +FILE: ../../../third_party/skia/src/core/SkScan_AAAPath.cpp +FILE: ../../../third_party/skia/src/core/SkScan_DAAPath.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2016 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp +---------------------------------------------------------------------------------------------------- +NEON optimized code (C) COPYRIGHT 2009 Motorola + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp +FILE: ../../../third_party/skia/src/ports/SkFontMgr_FontConfigInterface_factory.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2008 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/core/SkDevice.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/core/SkDevice.h +FILE: ../../../third_party/skia/src/core/SkScalar.cpp +FILE: ../../../third_party/skia/src/core/SkTextFormatParams.h +FILE: ../../../third_party/skia/src/images/SkJPEGWriteUtility.cpp +FILE: ../../../third_party/skia/src/images/SkJPEGWriteUtility.h +FILE: ../../../third_party/skia/src/pdf/SkDeflate.cpp +FILE: ../../../third_party/skia/src/pdf/SkDeflate.h +FILE: ../../../third_party/skia/src/pdf/SkPDFFormXObject.cpp +FILE: ../../../third_party/skia/src/pdf/SkPDFFormXObject.h +FILE: ../../../third_party/skia/src/pdf/SkPDFGraphicState.h +FILE: ../../../third_party/skia/src/pdf/SkPDFTypes.h +---------------------------------------------------------------------------------------------------- +Copyright 2010 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/core/SkFlattenablePriv.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/core/SkFlattenablePriv.h +FILE: ../../../third_party/skia/src/core/SkGlyphRun.cpp +FILE: ../../../third_party/skia/src/core/SkGlyphRun.h +---------------------------------------------------------------------------------------------------- +Copyright 2018 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/core/SkMatrixImageFilter.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/core/SkMatrixImageFilter.cpp +FILE: ../../../third_party/skia/src/core/SkMatrixImageFilter.h +FILE: ../../../third_party/skia/src/opts/SkColor_opts_SSE2.h +---------------------------------------------------------------------------------------------------- +Copyright 2014 The Android Open Source Project + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/core/SkTraceEvent.h + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/core/SkTraceEvent.h +---------------------------------------------------------------------------------------------------- +Copyright (c) 2014 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/gpu/GrDistanceFieldGenFromVector.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/gpu/GrDistanceFieldGenFromVector.cpp +FILE: ../../../third_party/skia/src/gpu/GrDistanceFieldGenFromVector.h +---------------------------------------------------------------------------------------------------- +Copyright 2017 ARM Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2014 Google Inc. +Copyright 2017 ARM Ltd. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2009 Motorola + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp +FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.h +FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct_factory.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2009-2015 Google Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp +FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.h +---------------------------------------------------------------------------------------------------- +Copyright 2006-2012 The Android Open Source Project +Copyright 2012 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/ports/SkMemory_mozalloc.cpp + ../../../third_party/skia/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/skia/src/ports/SkMemory_mozalloc.cpp +---------------------------------------------------------------------------------------------------- +Copyright 2011 Google Inc. +Copyright 2012 Mozilla Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: skia +ORIGIN: ../../../third_party/skia/src/sksl/GLSL.std.450.h +TYPE: LicenseType.unknown +FILE: ../../../third_party/skia/src/sksl/GLSL.std.450.h +FILE: ../../../third_party/skia/src/sksl/spirv.h +---------------------------------------------------------------------------------------------------- +Copyright (c) 2014-2016 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and/or associated documentation files (the "Materials"), +to deal in the Materials without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Materials, and to permit persons to whom the +Materials are furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Materials. +==================================================================================================== + +==================================================================================================== +LIBRARY: vulkanmemoryallocator +ORIGIN: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/LICENSE.txt +TYPE: LicenseType.mit +FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h +---------------------------------------------------------------------------------------------------- +Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +==================================================================================================== +Total license count: 53 diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index 48d4bdde9cba0..e2e81370bf544 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 0c3e9f3f3ab44d4f91025837ff70b788 +Signature: 4cffaa132f0dd7025b2e5a04444af676 UNUSED LICENSES: @@ -71,46 +71,6 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ==================================================================================================== - -==================================================================================================== -ORIGIN: ../../../third_party/skia/third_party/gif/LICENSE -TYPE: LicenseType.unknown ----------------------------------------------------------------------------------------------------- -Version: MPL 1.1/GPL 2.0/LGPL 2.1 - -The contents of this file are subject to the Mozilla Public License Version -1.1 (the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at -http://www.mozilla.org/MPL - -Software distributed under the License is distributed on an "AS IS" basis, -WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -for the specific language governing rights and limitations under the -License. - -The Original Code is mozilla.org code. - -The Initial Developer of the Original Code is -Netscape Communications Corporation. -Portions created by the Initial Developer are Copyright (C) 1998 -the Initial Developer. All Rights Reserved. - -Contributor(s): - Chris Saari - Apple Computer - -Alternatively, the contents of this file may be used under the terms of -either the GNU General Public License Version 2 or later (the "GPL"), or -the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -in which case the provisions of the GPL or the LGPL are applicable instead -of those above. If you wish to allow use of your version of this file only -under the terms of either the GPL or the LGPL, and not to allow others to -use your version of this file under the terms of the MPL, indicate your -decision by deleting the provisions above and replace them with the notice -and other provisions required by the GPL or the LGPL. If you do not delete -the provisions above, a recipient may use your version of this file under -the terms of any one of the MPL, the GPL or the LGPL. -==================================================================================================== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USED LICENSES: @@ -425,7 +385,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== LIBRARY: boringssl LIBRARY: observatory_pub_packages -LIBRARY: skia LIBRARY: vulkan ORIGIN: ../../../flutter/third_party/txt/LICENSE TYPE: LicenseType.apache @@ -507,15 +466,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/qu FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/src/time/util.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/strings.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/quiver/lib/time.dart -FILE: ../../../third_party/skia/src/images/SkWebpEncoder.cpp -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vk_platform.h -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan.h -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_android.h -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_core.h -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_ios.h -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_macos.h -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_win32.h -FILE: ../../../third_party/skia/third_party/vulkan/vulkan/vulkan_xcb.h FILE: ../../../third_party/vulkan/src/vulkan/vk_platform.h FILE: ../../../third_party/vulkan/src/vulkan/vulkan.h ---------------------------------------------------------------------------------------------------- @@ -7694,544 +7644,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ==================================================================================================== -==================================================================================================== -LIBRARY: gif -ORIGIN: ../../../third_party/skia/third_party/gif/SkGifImageReader.cpp -TYPE: LicenseType.lgpl -FILE: ../../../third_party/skia/third_party/gif/SkGifImageReader.cpp -FILE: ../../../third_party/skia/third_party/gif/SkGifImageReader.h ----------------------------------------------------------------------------------------------------- -GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! -==================================================================================================== - -==================================================================================================== -LIBRARY: gif -ORIGIN: ../../../third_party/skia/third_party/gif/SkGifImageReader.cpp -TYPE: LicenseType.unknown -FILE: ../../../third_party/skia/third_party/gif/SkGifImageReader.cpp ----------------------------------------------------------------------------------------------------- -The Graphics Interchange Format(c) is the copyright property of CompuServe -Incorporated. Only CompuServe Incorporated is authorized to define, redefine, -enhance, alter, modify or change in any way the definition of the format. - -CompuServe Incorporated hereby grants a limited, non-exclusive, royalty-free -license for the use of the Graphics Interchange Format(sm) in computer -software; computer software utilizing GIF(sm) must acknowledge ownership of the -Graphics Interchange Format and its Service Mark by CompuServe Incorporated, in -User and Technical Documentation. Computer software utilizing GIF, which is -distributed or may be distributed without User or Technical Documentation must -display to the screen or printer a message acknowledging ownership of the -Graphics Interchange Format and the Service Mark by CompuServe Incorporated; in -this case, the acknowledgement may be displayed in an opening screen or leading -banner, or a closing screen or trailing banner. A message such as the following -may be used: - - "The Graphics Interchange Format(c) is the Copyright property of - CompuServe Incorporated. GIF(sm) is a Service Mark property of - CompuServe Incorporated." -==================================================================================================== - ==================================================================================================== LIBRARY: harfbuzz ORIGIN: ../../../third_party/harfbuzz/COPYING @@ -8354,8 +7766,6 @@ FILE: ../../../third_party/harfbuzz/src/hb-buffer-deserialize-text.hh FILE: ../../../third_party/harfbuzz/src/hb-deprecated.h FILE: ../../../third_party/harfbuzz/src/hb-ot-layout-jstf-table.hh FILE: ../../../third_party/harfbuzz/src/hb-ot-shape-complex-hangul.cc -FILE: ../../../third_party/skia/third_party/harfbuzz/hb-buffer-deserialize-json.hh -FILE: ../../../third_party/skia/third_party/harfbuzz/hb-buffer-deserialize-text.hh ---------------------------------------------------------------------------------------------------- Copyright © 2013 Google, Inc. @@ -8709,7 +8119,6 @@ TYPE: LicenseType.unknown FILE: ../../../third_party/harfbuzz/src/hb-fallback-shape.cc FILE: ../../../third_party/harfbuzz/src/hb-uniscribe.h FILE: ../../../third_party/harfbuzz/src/hb-version.h -FILE: ../../../third_party/skia/third_party/harfbuzz/hb-version.h ---------------------------------------------------------------------------------------------------- Copyright © 2011 Google, Inc. @@ -8988,8 +8397,6 @@ FILE: ../../../third_party/harfbuzz/src/hb-ot-shape-complex-indic.cc FILE: ../../../third_party/harfbuzz/src/hb-ot-shape-complex-myanmar-machine.hh FILE: ../../../third_party/harfbuzz/src/hb-ot-shape-fallback.cc FILE: ../../../third_party/harfbuzz/src/hb-ot-shape-normalize.cc -FILE: ../../../third_party/skia/third_party/harfbuzz/hb-ot-shape-complex-indic-machine.hh -FILE: ../../../third_party/skia/third_party/harfbuzz/hb-ot-shape-complex-myanmar-machine.hh ---------------------------------------------------------------------------------------------------- Copyright © 2011,2012 Google, Inc. @@ -9326,7 +8733,6 @@ FILE: ../../../third_party/harfbuzz/src/hb-ot-shape-complex-arabic-private.hh FILE: ../../../third_party/harfbuzz/src/hb-ot-shape-complex-use-machine.hh FILE: ../../../third_party/harfbuzz/src/hb-ot-shape-complex-use-private.hh FILE: ../../../third_party/harfbuzz/src/hb-ot-shape-complex-use.cc -FILE: ../../../third_party/skia/third_party/harfbuzz/hb-ot-shape-complex-use-machine.hh ---------------------------------------------------------------------------------------------------- Copyright © 2015 Mozilla Foundation. Copyright © 2015 Google, Inc. @@ -9717,85 +9123,6 @@ ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. ==================================================================================================== -==================================================================================================== -LIBRARY: icu -LIBRARY: skia -ORIGIN: ../../../third_party/icu/fuzzers/icu_converter_fuzzer.cc + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/icu/fuzzers/icu_converter_fuzzer.cc -FILE: ../../../third_party/icu/fuzzers/icu_regex.dict -FILE: ../../../third_party/icu/fuzzers/icu_uregex_open_fuzzer.cc -FILE: ../../../third_party/skia/infra/bots/gen_tasks.go ----------------------------------------------------------------------------------------------------- -Copyright 2016 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: icu -LIBRARY: skia -ORIGIN: ../../../third_party/icu/scripts/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/icu/fuzzers/icu_unicode_string_codepage_create_fuzzer.cc -FILE: ../../../third_party/icu/scripts/accept_lang.list -FILE: ../../../third_party/icu/scripts/chrome_ui_languages.list -FILE: ../../../third_party/icu/scripts/currencies.list -FILE: ../../../third_party/skia/src/core/SkTraceEventCommon.h ----------------------------------------------------------------------------------------------------- -Copyright 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: icu ORIGIN: ../../../LICENSE @@ -11046,6 +10373,81 @@ use or other dealings in these Data Files or Software without prior written authorization of the copyright holder. ==================================================================================================== +==================================================================================================== +LIBRARY: icu +ORIGIN: ../../../third_party/icu/fuzzers/icu_converter_fuzzer.cc + ../../../LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/icu/fuzzers/icu_converter_fuzzer.cc +FILE: ../../../third_party/icu/fuzzers/icu_regex.dict +FILE: ../../../third_party/icu/fuzzers/icu_uregex_open_fuzzer.cc +---------------------------------------------------------------------------------------------------- +Copyright 2016 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + +==================================================================================================== +LIBRARY: icu +ORIGIN: ../../../third_party/icu/scripts/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/icu/fuzzers/icu_unicode_string_codepage_create_fuzzer.cc +FILE: ../../../third_party/icu/scripts/accept_lang.list +FILE: ../../../third_party/icu/scripts/chrome_ui_languages.list +FILE: ../../../third_party/icu/scripts/currencies.list +---------------------------------------------------------------------------------------------------- +Copyright 2015 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: icu ORIGIN: ../../../third_party/icu/source/common/unicode/appendable.h @@ -14229,570 +13631,6 @@ FILE: ../../../third_party/libpng/pngwutil.c ==================================================================================================== -==================================================================================================== -LIBRARY: libsdl -LIBRARY: skia -ORIGIN: ../../../third_party/skia/bench/AndroidCodecBench.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/bench/AndroidCodecBench.cpp -FILE: ../../../third_party/skia/bench/AndroidCodecBench.h -FILE: ../../../third_party/skia/bench/BlurOccludedRRectBench.cpp -FILE: ../../../third_party/skia/bench/DrawLatticeBench.cpp -FILE: ../../../third_party/skia/bench/EncoderBench.cpp -FILE: ../../../third_party/skia/bench/GrMipMapBench.cpp -FILE: ../../../third_party/skia/bench/HardStopGradientBench_ScaleNumColors.cpp -FILE: ../../../third_party/skia/bench/HardStopGradientBench_ScaleNumHardStops.cpp -FILE: ../../../third_party/skia/bench/HardStopGradientBench_SpecialHardStops.cpp -FILE: ../../../third_party/skia/bench/ImageCacheBudgetBench.cpp -FILE: ../../../third_party/skia/bench/PDFBench.cpp -FILE: ../../../third_party/skia/bench/QuickRejectBench.cpp -FILE: ../../../third_party/skia/bench/ShapesBench.cpp -FILE: ../../../third_party/skia/bench/SkRasterPipelineBench.cpp -FILE: ../../../third_party/skia/bench/StreamBench.cpp -FILE: ../../../third_party/skia/bench/SwizzleBench.cpp -FILE: ../../../third_party/skia/bench/TileImageFilterBench.cpp -FILE: ../../../third_party/skia/bench/VertexColorSpaceBench.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkPEG.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttribute.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttributeParser.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGAttributeParser.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGCircle.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGCircle.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGClipPath.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGClipPath.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGContainer.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGContainer.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGDOM.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGDOM.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGDefs.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGEllipse.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGEllipse.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGG.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGHiddenContainer.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGIDMapper.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGLine.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGLine.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGLinearGradient.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGLinearGradient.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGNode.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGNode.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPath.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPath.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPoly.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPoly.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRect.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRect.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRenderContext.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRenderContext.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGSVG.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGSVG.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGShape.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGShape.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGStop.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGStop.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTransformableNode.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTransformableNode.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGTypes.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGValue.h -FILE: ../../../third_party/skia/experimental/xps_to_png/xps_to_png.cs -FILE: ../../../third_party/skia/fuzz/Fuzz.h -FILE: ../../../third_party/skia/fuzz/FuzzGradients.cpp -FILE: ../../../third_party/skia/fuzz/FuzzParsePath.cpp -FILE: ../../../third_party/skia/fuzz/FuzzPathop.cpp -FILE: ../../../third_party/skia/fuzz/fuzz.cpp -FILE: ../../../third_party/skia/gm/OverStroke.cpp -FILE: ../../../third_party/skia/gm/animatedGif.cpp -FILE: ../../../third_party/skia/gm/animatedimageblurs.cpp -FILE: ../../../third_party/skia/gm/arcto.cpp -FILE: ../../../third_party/skia/gm/bigrect.cpp -FILE: ../../../third_party/skia/gm/bitmapimage.cpp -FILE: ../../../third_party/skia/gm/blurcircles2.cpp -FILE: ../../../third_party/skia/gm/bug5252.cpp -FILE: ../../../third_party/skia/gm/bug530095.cpp -FILE: ../../../third_party/skia/gm/bug615686.cpp -FILE: ../../../third_party/skia/gm/circulararcs.cpp -FILE: ../../../third_party/skia/gm/clip_error.cpp -FILE: ../../../third_party/skia/gm/colorfilteralpha8.cpp -FILE: ../../../third_party/skia/gm/colorspacexform.cpp -FILE: ../../../third_party/skia/gm/complexclip4.cpp -FILE: ../../../third_party/skia/gm/complexclip_blur_tiled.cpp -FILE: ../../../third_party/skia/gm/croppedrects.cpp -FILE: ../../../third_party/skia/gm/dashcircle.cpp -FILE: ../../../third_party/skia/gm/drawregion.cpp -FILE: ../../../third_party/skia/gm/drawregionmodes.cpp -FILE: ../../../third_party/skia/gm/encode-platform.cpp -FILE: ../../../third_party/skia/gm/encode-srgb.cpp -FILE: ../../../third_party/skia/gm/filterbug.cpp -FILE: ../../../third_party/skia/gm/gamut.cpp -FILE: ../../../third_party/skia/gm/hardstop_gradients.cpp -FILE: ../../../third_party/skia/gm/imagemakewithfilter.cpp -FILE: ../../../third_party/skia/gm/imagemasksubset.cpp -FILE: ../../../third_party/skia/gm/lattice.cpp -FILE: ../../../third_party/skia/gm/lightingshader2.cpp -FILE: ../../../third_party/skia/gm/occludedrrectblur.cpp -FILE: ../../../third_party/skia/gm/overdrawcolorfilter.cpp -FILE: ../../../third_party/skia/gm/pathmaskcache.cpp -FILE: ../../../third_party/skia/gm/readpixels.cpp -FILE: ../../../third_party/skia/gm/rectangletexture.cpp -FILE: ../../../third_party/skia/gm/rrectclipdrawpaint.cpp -FILE: ../../../third_party/skia/gm/shapes.cpp -FILE: ../../../third_party/skia/gm/showmiplevels.cpp -FILE: ../../../third_party/skia/gm/simplerect.cpp -FILE: ../../../third_party/skia/gm/skbug_4868.cpp -FILE: ../../../third_party/skia/gm/skbug_5321.cpp -FILE: ../../../third_party/skia/gm/stroke_rect_shader.cpp -FILE: ../../../third_party/skia/gm/strokedlines.cpp -FILE: ../../../third_party/skia/gm/subsetshader.cpp -FILE: ../../../third_party/skia/gm/textblobblockreordering.cpp -FILE: ../../../third_party/skia/gm/windowrectangles.cpp -FILE: ../../../third_party/skia/include/codec/SkCodecAnimation.h -FILE: ../../../third_party/skia/include/core/SkBlendMode.h -FILE: ../../../third_party/skia/include/core/SkClipOp.h -FILE: ../../../third_party/skia/include/core/SkColorSpace.h -FILE: ../../../third_party/skia/include/core/SkColorSpaceXform.h -FILE: ../../../third_party/skia/include/core/SkICC.h -FILE: ../../../third_party/skia/include/core/SkMilestone.h -FILE: ../../../third_party/skia/include/core/SkOverdrawCanvas.h -FILE: ../../../third_party/skia/include/core/SkRasterHandleAllocator.h -FILE: ../../../third_party/skia/include/core/SkSwizzle.h -FILE: ../../../third_party/skia/include/core/SkYUVSizeInfo.h -FILE: ../../../third_party/skia/include/effects/SkArithmeticImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkOverdrawColorFilter.h -FILE: ../../../third_party/skia/include/effects/SkPaintImageFilter.h -FILE: ../../../third_party/skia/include/gpu/vk/GrVkBackendContext.h -FILE: ../../../third_party/skia/include/gpu/vk/GrVkDefines.h -FILE: ../../../third_party/skia/include/gpu/vk/GrVkTypes.h -FILE: ../../../third_party/skia/include/ports/SkFontMgr_FontConfigInterface.h -FILE: ../../../third_party/skia/include/ports/SkImageGeneratorCG.h -FILE: ../../../third_party/skia/include/ports/SkImageGeneratorWIC.h -FILE: ../../../third_party/skia/include/private/GrAuditTrail.h -FILE: ../../../third_party/skia/include/private/GrOpList.h -FILE: ../../../third_party/skia/include/private/GrRenderTargetProxy.h -FILE: ../../../third_party/skia/include/private/GrSingleOwner.h -FILE: ../../../third_party/skia/include/private/GrSurfaceProxy.h -FILE: ../../../third_party/skia/include/private/GrTextureProxy.h -FILE: ../../../third_party/skia/include/private/SkArenaAlloc.h -FILE: ../../../third_party/skia/include/private/SkBitmaskEnum.h -FILE: ../../../third_party/skia/include/private/SkEncodedInfo.h -FILE: ../../../third_party/skia/include/private/SkLeanWindows.h -FILE: ../../../third_party/skia/include/private/SkSafe_math.h -FILE: ../../../third_party/skia/include/utils/SkNoDrawCanvas.h -FILE: ../../../third_party/skia/modules/sksg/samples/SampleSVGPong.cpp -FILE: ../../../third_party/skia/modules/skshaper/include/SkShaper.h -FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_harfbuzz.cpp -FILE: ../../../third_party/skia/modules/skshaper/src/SkShaper_primitive.cpp -FILE: ../../../third_party/skia/samplecode/DecodeFile.h -FILE: ../../../third_party/skia/samplecode/SampleAndroidShadows.cpp -FILE: ../../../third_party/skia/samplecode/SampleCode.cpp -FILE: ../../../third_party/skia/samplecode/SampleLitAtlas.cpp -FILE: ../../../third_party/skia/samplecode/SampleMegaStroke.cpp -FILE: ../../../third_party/skia/samplecode/SamplePathOverstroke.cpp -FILE: ../../../third_party/skia/samplecode/SampleSVGFile.cpp -FILE: ../../../third_party/skia/src/codec/SkCodecAnimationPriv.h -FILE: ../../../third_party/skia/src/codec/SkRawAdapterCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkRawAdapterCodec.h -FILE: ../../../third_party/skia/src/codec/SkRawCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkRawCodec.h -FILE: ../../../third_party/skia/src/codec/SkStreamBuffer.cpp -FILE: ../../../third_party/skia/src/codec/SkStreamBuffer.h -FILE: ../../../third_party/skia/src/compute/common/cl/assert_cl.c -FILE: ../../../third_party/skia/src/compute/common/cl/assert_cl.h -FILE: ../../../third_party/skia/src/compute/common/macros.h -FILE: ../../../third_party/skia/src/compute/common/util.c -FILE: ../../../third_party/skia/src/compute/common/util.h -FILE: ../../../third_party/skia/src/compute/hs/cl/bench/main.c -FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.c -FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_launcher.h -FILE: ../../../third_party/skia/src/compute/hs/cl/hs_cl_target.h -FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_cl.cl -FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_cl.h -FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_cl_macros.h -FILE: ../../../third_party/skia/src/compute/hs/cl/intel/gen8/u64/hs_target.h -FILE: ../../../third_party/skia/src/compute/hs/gen/gen.h -FILE: ../../../third_party/skia/src/compute/hs/gen/main.c -FILE: ../../../third_party/skia/src/compute/hs/gen/networks.h -FILE: ../../../third_party/skia/src/compute/hs/gen/networks_merging.c -FILE: ../../../third_party/skia/src/compute/hs/gen/networks_sorting.c -FILE: ../../../third_party/skia/src/compute/hs/gen/target_cuda.c -FILE: ../../../third_party/skia/src/compute/hs/gen/target_glsl.c -FILE: ../../../third_party/skia/src/compute/hs/gen/target_opencl.c -FILE: ../../../third_party/skia/src/compute/hs/vk/hs_spirv_target.h -FILE: ../../../third_party/skia/src/compute/hs/vk/hs_vk_launcher.c -FILE: ../../../third_party/skia/src/compute/hs/vk/hs_vk_launcher.h -FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_glsl.h -FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_glsl_macros.h -FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_kernels.h -FILE: ../../../third_party/skia/src/compute/hs/vk/intel/gen8/u64/hs_target.h -FILE: ../../../third_party/skia/src/compute/sk/SkContext_Compute.cpp -FILE: ../../../third_party/skia/src/compute/sk/SkContext_Compute.h -FILE: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.cpp -FILE: ../../../third_party/skia/src/compute/sk/SkImage_Compute.cpp -FILE: ../../../third_party/skia/src/compute/sk/SkImage_Compute.h -FILE: ../../../third_party/skia/src/compute/sk/SkSurface_Compute.cpp -FILE: ../../../third_party/skia/src/compute/sk/SkSurface_Compute.h -FILE: ../../../third_party/skia/src/compute/skc/assert_skc.c -FILE: ../../../third_party/skia/src/compute/skc/assert_skc.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/render.cl -FILE: ../../../third_party/skia/src/compute/skc/styling.c -FILE: ../../../third_party/skia/src/compute/skc/styling.h -FILE: ../../../third_party/skia/src/compute/skc/styling_types.h -FILE: ../../../third_party/skia/src/compute/skc/tile.h -FILE: ../../../third_party/skia/src/compute/skc/util.c -FILE: ../../../third_party/skia/src/core/Sk4x4f.h -FILE: ../../../third_party/skia/src/core/SkATrace.cpp -FILE: ../../../third_party/skia/src/core/SkATrace.h -FILE: ../../../third_party/skia/src/core/SkAnnotationKeys.h -FILE: ../../../third_party/skia/src/core/SkArenaAlloc.cpp -FILE: ../../../third_party/skia/src/core/SkAutoMalloc.h -FILE: ../../../third_party/skia/src/core/SkAutoPixmapStorage.cpp -FILE: ../../../third_party/skia/src/core/SkAutoPixmapStorage.h -FILE: ../../../third_party/skia/src/core/SkBlendModePriv.h -FILE: ../../../third_party/skia/src/core/SkClipOpPriv.h -FILE: ../../../third_party/skia/src/core/SkColorLookUpTable.cpp -FILE: ../../../third_party/skia/src/core/SkColorLookUpTable.h -FILE: ../../../third_party/skia/src/core/SkColorMatrixFilterRowMajor255.h -FILE: ../../../third_party/skia/src/core/SkColorSpace.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpacePriv.h -FILE: ../../../third_party/skia/src/core/SkColorSpaceXform.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpaceXformPriv.h -FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpace_A2B.h -FILE: ../../../third_party/skia/src/core/SkColorSpace_ICC.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpace_XYZ.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpace_XYZ.h -FILE: ../../../third_party/skia/src/core/SkCpu.cpp -FILE: ../../../third_party/skia/src/core/SkCpu.h -FILE: ../../../third_party/skia/src/core/SkDeduper.h -FILE: ../../../third_party/skia/src/core/SkExchange.h -FILE: ../../../third_party/skia/src/core/SkFixed15.h -FILE: ../../../third_party/skia/src/core/SkFuzzLogging.h -FILE: ../../../third_party/skia/src/core/SkGammas.h -FILE: ../../../third_party/skia/src/core/SkGlobalInitialization_core.cpp -FILE: ../../../third_party/skia/src/core/SkICC.cpp -FILE: ../../../third_party/skia/src/core/SkICCPriv.h -FILE: ../../../third_party/skia/src/core/SkImageFilterCache.cpp -FILE: ../../../third_party/skia/src/core/SkImageFilterCache.h -FILE: ../../../third_party/skia/src/core/SkLRUCache.h -FILE: ../../../third_party/skia/src/core/SkLights.cpp -FILE: ../../../third_party/skia/src/core/SkLiteDL.cpp -FILE: ../../../third_party/skia/src/core/SkLiteDL.h -FILE: ../../../third_party/skia/src/core/SkLiteRecorder.cpp -FILE: ../../../third_party/skia/src/core/SkLiteRecorder.h -FILE: ../../../third_party/skia/src/core/SkMSAN.h -FILE: ../../../third_party/skia/src/core/SkMakeUnique.h -FILE: ../../../third_party/skia/src/core/SkMatrixPriv.h -FILE: ../../../third_party/skia/src/core/SkModeColorFilter.h -FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.cpp -FILE: ../../../third_party/skia/src/core/SkNormalFlatSource.h -FILE: ../../../third_party/skia/src/core/SkNormalMapSource.cpp -FILE: ../../../third_party/skia/src/core/SkNormalMapSource.h -FILE: ../../../third_party/skia/src/core/SkNormalSource.cpp -FILE: ../../../third_party/skia/src/core/SkNormalSource.h -FILE: ../../../third_party/skia/src/core/SkOverdrawCanvas.cpp -FILE: ../../../third_party/skia/src/core/SkPM4f.h -FILE: ../../../third_party/skia/src/core/SkPM4fPriv.h -FILE: ../../../third_party/skia/src/core/SkPathMeasurePriv.h -FILE: ../../../third_party/skia/src/core/SkPipe.h -FILE: ../../../third_party/skia/src/core/SkRasterPipeline.cpp -FILE: ../../../third_party/skia/src/core/SkRasterPipeline.h -FILE: ../../../third_party/skia/src/core/SkRasterPipelineBlitter.cpp -FILE: ../../../third_party/skia/src/core/SkRecordedDrawable.cpp -FILE: ../../../third_party/skia/src/core/SkRecordedDrawable.h -FILE: ../../../third_party/skia/src/core/SkSRGB.cpp -FILE: ../../../third_party/skia/src/core/SkSRGB.h -FILE: ../../../third_party/skia/src/core/SkScaleToSides.h -FILE: ../../../third_party/skia/src/core/SkScopeExit.h -FILE: ../../../third_party/skia/src/core/SkSinglyLinkedList.h -FILE: ../../../third_party/skia/src/core/SkSpecialImage.cpp -FILE: ../../../third_party/skia/src/core/SkSpecialImage.h -FILE: ../../../third_party/skia/src/core/SkSpecialSurface.cpp -FILE: ../../../third_party/skia/src/core/SkSpecialSurface.h -FILE: ../../../third_party/skia/src/core/SkSwizzle.cpp -FILE: ../../../third_party/skia/src/effects/SkOverdrawColorFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkArithmeticImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkPaintImageFilter.cpp -FILE: ../../../third_party/skia/src/gpu/GrAppliedClip.h -FILE: ../../../third_party/skia/src/gpu/GrAuditTrail.cpp -FILE: ../../../third_party/skia/src/gpu/GrBitmapTextureMaker.cpp -FILE: ../../../third_party/skia/src/gpu/GrBitmapTextureMaker.h -FILE: ../../../third_party/skia/src/gpu/GrBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/GrBuffer.h -FILE: ../../../third_party/skia/src/gpu/GrClipStackClip.cpp -FILE: ../../../third_party/skia/src/gpu/GrClipStackClip.h -FILE: ../../../third_party/skia/src/gpu/GrColorSpaceXform.cpp -FILE: ../../../third_party/skia/src/gpu/GrColorSpaceXform.h -FILE: ../../../third_party/skia/src/gpu/GrContextPriv.h -FILE: ../../../third_party/skia/src/gpu/GrFixedClip.h -FILE: ../../../third_party/skia/src/gpu/GrGpuCommandBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/GrGpuCommandBuffer.h -FILE: ../../../third_party/skia/src/gpu/GrImageTextureMaker.cpp -FILE: ../../../third_party/skia/src/gpu/GrImageTextureMaker.h -FILE: ../../../third_party/skia/src/gpu/GrOpList.cpp -FILE: ../../../third_party/skia/src/gpu/GrProgramDesc.cpp -FILE: ../../../third_party/skia/src/gpu/GrReducedClip.cpp -FILE: ../../../third_party/skia/src/gpu/GrReducedClip.h -FILE: ../../../third_party/skia/src/gpu/GrRenderTargetContextPriv.h -FILE: ../../../third_party/skia/src/gpu/GrRenderTargetProxy.cpp -FILE: ../../../third_party/skia/src/gpu/GrResourceHandle.h -FILE: ../../../third_party/skia/src/gpu/GrScissorState.h -FILE: ../../../third_party/skia/src/gpu/GrShaderVar.cpp -FILE: ../../../third_party/skia/src/gpu/GrShaderVar.h -FILE: ../../../third_party/skia/src/gpu/GrShape.cpp -FILE: ../../../third_party/skia/src/gpu/GrShape.h -FILE: ../../../third_party/skia/src/gpu/GrStencilSettings.h -FILE: ../../../third_party/skia/src/gpu/GrStyle.cpp -FILE: ../../../third_party/skia/src/gpu/GrStyle.h -FILE: ../../../third_party/skia/src/gpu/GrSurfaceContext.cpp -FILE: ../../../third_party/skia/src/gpu/GrSurfaceContext.h -FILE: ../../../third_party/skia/src/gpu/GrSurfaceContextPriv.h -FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxy.cpp -FILE: ../../../third_party/skia/src/gpu/GrSwizzle.h -FILE: ../../../third_party/skia/src/gpu/GrTextureAdjuster.cpp -FILE: ../../../third_party/skia/src/gpu/GrTextureAdjuster.h -FILE: ../../../third_party/skia/src/gpu/GrTextureContext.cpp -FILE: ../../../third_party/skia/src/gpu/GrTextureContext.h -FILE: ../../../third_party/skia/src/gpu/GrTextureMaker.cpp -FILE: ../../../third_party/skia/src/gpu/GrTextureMaker.h -FILE: ../../../third_party/skia/src/gpu/GrTextureOpList.cpp -FILE: ../../../third_party/skia/src/gpu/GrTextureOpList.h -FILE: ../../../third_party/skia/src/gpu/GrTextureProducer.cpp -FILE: ../../../third_party/skia/src/gpu/GrTextureProducer.h -FILE: ../../../third_party/skia/src/gpu/GrTextureProxy.cpp -FILE: ../../../third_party/skia/src/gpu/GrTextureRenderTargetProxy.cpp -FILE: ../../../third_party/skia/src/gpu/GrTextureRenderTargetProxy.h -FILE: ../../../third_party/skia/src/gpu/GrUserStencilSettings.h -FILE: ../../../third_party/skia/src/gpu/GrWindowRectangles.h -FILE: ../../../third_party/skia/src/gpu/GrWindowRectsState.h -FILE: ../../../third_party/skia/src/gpu/effects/GrSRGBEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrSRGBEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrShadowGeoProc.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrShadowGeoProc.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLBuffer.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpuCommandBuffer.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLTestInterface.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLTestInterface.h -FILE: ../../../third_party/skia/src/gpu/gl/glfw/GrGLMakeNativeInterface_glfw.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLColorSpaceXformHelper.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLProgramDataManager.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrPathStencilSettings.h -FILE: ../../../third_party/skia/src/gpu/ops/GrRegionOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrRegionOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrShadowRRectOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrShadowRRectOp.h -FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyManager.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyManager.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyPipeline.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkCopyPipeline.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorPool.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorPool.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSet.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSet.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkDescriptorSetManager.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkExtensions.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkFramebuffer.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpuCommandBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpuCommandBuffer.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageView.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageView.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipeline.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipeline.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineState.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineState.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateBuilder.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateBuilder.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateCache.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateDataManager.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineStateDataManager.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkResourceProvider.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkResourceProvider.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkSampler.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkSampler.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkUniformHandler.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkUniformHandler.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkVaryingHandler.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkVaryingHandler.h -FILE: ../../../third_party/skia/src/images/SkImageEncoderPriv.h -FILE: ../../../third_party/skia/src/opts/SkChecksum_opts.h -FILE: ../../../third_party/skia/src/opts/SkOpts_avx.cpp -FILE: ../../../third_party/skia/src/opts/SkOpts_crc32.cpp -FILE: ../../../third_party/skia/src/opts/SkOpts_sse42.cpp -FILE: ../../../third_party/skia/src/opts/SkSwizzler_opts.h -FILE: ../../../third_party/skia/src/pdf/SkBitmapKey.h -FILE: ../../../third_party/skia/src/pdf/SkPDFConvertType1FontStream.h -FILE: ../../../third_party/skia/src/pdf/SkPDFDocument.h -FILE: ../../../third_party/skia/src/pdf/SkPDFMakeCIDGlyphWidthsArray.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFMakeCIDGlyphWidthsArray.h -FILE: ../../../third_party/skia/src/pdf/SkPDFMakeToUnicodeCmap.h -FILE: ../../../third_party/skia/src/pipe/SkPipeCanvas.cpp -FILE: ../../../third_party/skia/src/pipe/SkPipeCanvas.h -FILE: ../../../third_party/skia/src/pipe/SkPipeFormat.h -FILE: ../../../third_party/skia/src/pipe/SkPipeReader.cpp -FILE: ../../../third_party/skia/src/pipe/SkRefSet.h -FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_empty_factory.cpp -FILE: ../../../third_party/skia/src/ports/SkImageGeneratorCG.cpp -FILE: ../../../third_party/skia/src/ports/SkImageGeneratorWIC.cpp -FILE: ../../../third_party/skia/src/shaders/SkColorFilterShader.h -FILE: ../../../third_party/skia/src/shaders/SkColorShader.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fGradientBase.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fGradientBase.h -FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fGradientPriv.h -FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fLinearGradient.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/Sk4fLinearGradient.h -FILE: ../../../third_party/skia/src/sksl/SkSLCFGGenerator.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLCFGGenerator.h -FILE: ../../../third_party/skia/src/sksl/SkSLCPPCodeGenerator.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLCodeGenerator.h -FILE: ../../../third_party/skia/src/sksl/SkSLCompiler.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLCompiler.h -FILE: ../../../third_party/skia/src/sksl/SkSLContext.h -FILE: ../../../third_party/skia/src/sksl/SkSLErrorReporter.h -FILE: ../../../third_party/skia/src/sksl/SkSLGLSLCodeGenerator.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLGLSLCodeGenerator.h -FILE: ../../../third_party/skia/src/sksl/SkSLHCodeGenerator.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLIRGenerator.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLIRGenerator.h -FILE: ../../../third_party/skia/src/sksl/SkSLMain.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLMemoryLayout.h -FILE: ../../../third_party/skia/src/sksl/SkSLMetalCodeGenerator.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLMetalCodeGenerator.h -FILE: ../../../third_party/skia/src/sksl/SkSLParser.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLParser.h -FILE: ../../../third_party/skia/src/sksl/SkSLPosition.h -FILE: ../../../third_party/skia/src/sksl/SkSLSPIRVCodeGenerator.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLSPIRVCodeGenerator.h -FILE: ../../../third_party/skia/src/sksl/SkSLUtil.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLUtil.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTBinaryExpression.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTBlock.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTBoolLiteral.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTBreakStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTCallSuffix.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTContinueStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTDeclaration.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTDiscardStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTDoStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTExpression.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTExpressionStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTExtension.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTFieldSuffix.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTFloatLiteral.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTForStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTFunction.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTIdentifier.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTIfStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTIndexSuffix.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTIntLiteral.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTInterfaceBlock.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTModifiersDeclaration.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTNode.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTParameter.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTPositionNode.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTPrecision.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTPrefixExpression.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTReturnStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSection.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSuffix.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSuffixExpression.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTTernaryExpression.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTType.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTVarDeclaration.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTVarDeclarationStatement.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTWhileStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLBinaryExpression.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLBlock.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLBoolLiteral.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLBreakStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLConstructor.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLContinueStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLDiscardStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLDoStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLExpression.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLExpressionStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLExtension.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLField.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLFieldAccess.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLFloatLiteral.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLForStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLFunctionCall.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLFunctionDeclaration.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLFunctionDefinition.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLFunctionReference.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLIRNode.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLIfStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLIndexExpression.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLIntLiteral.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLInterfaceBlock.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLLayout.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLModifiers.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLModifiersDeclaration.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLNop.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLPostfixExpression.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLPrefixExpression.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLProgram.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLProgramElement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLReturnStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLSection.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLSetting.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLSwizzle.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLSymbol.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLSymbolTable.cpp -FILE: ../../../third_party/skia/src/sksl/ir/SkSLSymbolTable.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLTernaryExpression.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLType.cpp -FILE: ../../../third_party/skia/src/sksl/ir/SkSLType.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLTypeReference.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLUnresolvedFunction.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLVarDeclarations.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLVarDeclarationsStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariable.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLWhileStatement.h -FILE: ../../../third_party/skia/src/utils/SkMultiPictureDocument.cpp -FILE: ../../../third_party/skia/src/utils/SkMultiPictureDocument.h -FILE: ../../../third_party/skia/src/utils/SkMultiPictureDocumentPriv.h -FILE: ../../../third_party/skia/src/utils/SkOSPath.h -FILE: ../../../third_party/skia/third_party/libsdl/SDL_config_premake.h ----------------------------------------------------------------------------------------------------- -Copyright 2016 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: libwebp ORIGIN: ../../../third_party/libwebp/COPYING @@ -16953,253 +15791,26 @@ Exhibit B - “Incompatible With Secondary Licenses” Notice ==================================================================================================== ==================================================================================================== -LIBRARY: skcms -LIBRARY: skia -LIBRARY: vulkanmemoryallocator -ORIGIN: ../../../third_party/skia/bench/GrCCGeometryBench.cpp + ../../../third_party/skia/LICENSE +LIBRARY: tcmalloc +ORIGIN: ../../../third_party/dart/third_party/tcmalloc/COPYING TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/bench/GrCCGeometryBench.cpp -FILE: ../../../third_party/skia/bench/JSONBench.cpp -FILE: ../../../third_party/skia/bench/PolyUtilsBench.cpp -FILE: ../../../third_party/skia/bench/ShaderMaskFilterBench.cpp -FILE: ../../../third_party/skia/fuzz/FuzzCommon.cpp -FILE: ../../../third_party/skia/fuzz/FuzzPathMeasure.cpp -FILE: ../../../third_party/skia/fuzz/FuzzRegionOp.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathDeserialize.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionDeserialize.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRegionSetPath.cpp -FILE: ../../../third_party/skia/gm/3dgm.cpp -FILE: ../../../third_party/skia/gm/hugepath.cpp -FILE: ../../../third_party/skia/gm/localmatrixshader.cpp -FILE: ../../../third_party/skia/gm/makeRasterImage.cpp -FILE: ../../../third_party/skia/gm/mandoline.cpp -FILE: ../../../third_party/skia/gm/orientation.cpp -FILE: ../../../third_party/skia/gm/pathmeasure.cpp -FILE: ../../../third_party/skia/gm/perspimages.cpp -FILE: ../../../third_party/skia/gm/polygonoffset.cpp -FILE: ../../../third_party/skia/gm/scaledemoji.cpp -FILE: ../../../third_party/skia/gm/shadermaskfilter.cpp -FILE: ../../../third_party/skia/gm/sharedcorners.cpp -FILE: ../../../third_party/skia/gm/skinning.cpp -FILE: ../../../third_party/skia/include/android/SkAnimatedImage.h -FILE: ../../../third_party/skia/include/core/SkCanvasVirtualEnforcer.h -FILE: ../../../third_party/skia/include/core/SkCoverageMode.h -FILE: ../../../third_party/skia/include/core/SkFontParameters.h -FILE: ../../../third_party/skia/include/effects/SkOpPathEffect.h -FILE: ../../../third_party/skia/include/effects/SkShaderMaskFilter.h -FILE: ../../../third_party/skia/include/effects/SkTrimPathEffect.h -FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkarounds.h -FILE: ../../../third_party/skia/include/gpu/vk/GrVkMemoryAllocator.h -FILE: ../../../third_party/skia/include/private/GrCCClipPath.h -FILE: ../../../third_party/skia/include/private/GrCCPerOpListPaths.h -FILE: ../../../third_party/skia/include/private/GrSurfaceProxyRef.h -FILE: ../../../third_party/skia/include/private/GrVkTypesPriv.h -FILE: ../../../third_party/skia/include/private/SkMacros.h -FILE: ../../../third_party/skia/include/private/SkSafe32.h -FILE: ../../../third_party/skia/include/private/SkTo.h -FILE: ../../../third_party/skia/include/utils/Sk3D.h -FILE: ../../../third_party/skia/infra/cts/run_testlab.go -FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.cpp -FILE: ../../../third_party/skia/modules/skottie/src/SkottieAdapter.h -FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.cpp -FILE: ../../../third_party/skia/modules/skottie/src/SkottieJson.h -FILE: ../../../third_party/skia/modules/skottie/src/SkottieTest.cpp -FILE: ../../../third_party/skia/modules/skottie/src/SkottieTool.cpp -FILE: ../../../third_party/skia/modules/sksg/include/SkSGClipEffect.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGGeometryTransform.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGGradient.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGImage.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGMaskEffect.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGOpacityEffect.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGPlane.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGRoundEffect.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGScene.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGText.h -FILE: ../../../third_party/skia/modules/sksg/src/SkSGClipEffect.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGGeometryTransform.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGGradient.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGImage.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGMaskEffect.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGOpacityEffect.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGPlane.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGRoundEffect.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGScene.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGText.cpp -FILE: ../../../third_party/skia/samplecode/SampleAnimatedImage.cpp -FILE: ../../../third_party/skia/samplecode/SampleFlutterAnimate.cpp -FILE: ../../../third_party/skia/samplecode/SampleGlyphTransform.cpp -FILE: ../../../third_party/skia/samplecode/SampleNima.cpp -FILE: ../../../third_party/skia/samplecode/SampleNimaActor.cpp -FILE: ../../../third_party/skia/samplecode/SampleNimaActor.h -FILE: ../../../third_party/skia/src/android/SkAnimatedImage.cpp -FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.c -FILE: ../../../third_party/skia/src/compute/common/cl/find_cl.h -FILE: ../../../third_party/skia/src/compute/hs/cl/bench/sort.cpp -FILE: ../../../third_party/skia/src/compute/hs/gen/target_debug.c -FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.c -FILE: ../../../third_party/skia/src/compute/hs/gen/transpose.h -FILE: ../../../third_party/skia/src/compute/skc/allocator_host.c -FILE: ../../../third_party/skia/src/compute/skc/allocator_host.h -FILE: ../../../third_party/skia/src/compute/skc/interop.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/allocator_device_cl.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/allocator_device_cl.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/interop/interop_glfw.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttck.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/segment_ttrk.cl -FILE: ../../../third_party/skia/src/compute/skc/runtime.h -FILE: ../../../third_party/skia/src/compute/skc/skc_err.h -FILE: ../../../third_party/skia/src/compute/skc/skc_types.h -FILE: ../../../third_party/skia/src/compute/skc/suballocator.c -FILE: ../../../third_party/skia/src/compute/skc/suballocator.h -FILE: ../../../third_party/skia/src/compute/ts/transform_stack.c -FILE: ../../../third_party/skia/src/compute/ts/transform_stack.h -FILE: ../../../third_party/skia/src/core/SkBlurPriv.h -FILE: ../../../third_party/skia/src/core/SkCanvasPriv.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpaceXformSteps.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpaceXformSteps.h -FILE: ../../../third_party/skia/src/core/SkColorSpaceXform_skcms.cpp -FILE: ../../../third_party/skia/src/core/SkCoverageModePriv.h -FILE: ../../../third_party/skia/src/core/SkCubicMap.cpp -FILE: ../../../third_party/skia/src/core/SkCubicMap.h -FILE: ../../../third_party/skia/src/core/SkDeferredDisplayList.cpp -FILE: ../../../third_party/skia/src/core/SkGlyph.cpp -FILE: ../../../third_party/skia/src/core/SkIPoint16.h -FILE: ../../../third_party/skia/src/core/SkMaskFilterBase.h -FILE: ../../../third_party/skia/src/core/SkPath_serial.cpp -FILE: ../../../third_party/skia/src/core/SkPicturePriv.h -FILE: ../../../third_party/skia/src/core/SkRRectPriv.h -FILE: ../../../third_party/skia/src/core/SkRectPriv.h -FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.cpp -FILE: ../../../third_party/skia/src/core/SkRemoteGlyphCache.h -FILE: ../../../third_party/skia/src/core/SkSafeRange.h -FILE: ../../../third_party/skia/src/core/SkStrikeCache.cpp -FILE: ../../../third_party/skia/src/core/SkSurfaceCharacterization.cpp -FILE: ../../../third_party/skia/src/core/SkTextBlobPriv.h -FILE: ../../../third_party/skia/src/core/SkTypeface_remote.cpp -FILE: ../../../third_party/skia/src/core/SkTypeface_remote.h -FILE: ../../../third_party/skia/src/effects/SkOpPE.h -FILE: ../../../third_party/skia/src/effects/SkOpPathEffect.cpp -FILE: ../../../third_party/skia/src/effects/SkShaderMaskFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkTrimPE.h -FILE: ../../../third_party/skia/src/effects/SkTrimPathEffect.cpp -FILE: ../../../third_party/skia/src/gpu/GrContextThreadSafeProxyPriv.h -FILE: ../../../third_party/skia/src/gpu/GrDDLContext.cpp -FILE: ../../../third_party/skia/src/gpu/GrDirectContext.cpp -FILE: ../../../third_party/skia/src/gpu/GrDriverBugWorkarounds.cpp -FILE: ../../../third_party/skia/src/gpu/GrFPArgs.h -FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.cpp -FILE: ../../../third_party/skia/src/gpu/GrProxyProvider.h -FILE: ../../../third_party/skia/src/gpu/GrQuad.cpp -FILE: ../../../third_party/skia/src/gpu/GrRenderTargetProxyPriv.h -FILE: ../../../third_party/skia/src/gpu/GrResourceProviderPriv.h -FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyRef.cpp -FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.cpp -FILE: ../../../third_party/skia/src/gpu/GrUninstantiateProxyTracker.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipPath.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCConicShader.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCDrawPathsOp.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathCache.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathCache.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPerFlushResources.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCSTLList.h -FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrAARectEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrAlphaThresholdFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrArithmeticFP.h -FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrCircleBlurFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrConfigConversionEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrConstColorProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrDitherEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrLumaColorFilterEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrMagnifierEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrOverdrawFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrPremulInputFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrRRectBlurEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrRectBlurEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrUnpremulInputFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrYUVtoRGBEffect.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlGpuCommandBuffer.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTextureRenderTarget.mm -FILE: ../../../third_party/skia/src/gpu/ops/GrClearStencilClipOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrDebugMarkerOp.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrAtlasManager.h -FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrSDFMaskFilter.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkAMDMemoryAllocator.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkImageLayout.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineLayout.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkPipelineLayout.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTypesPriv.cpp -FILE: ../../../third_party/skia/src/opts/SkOpts_hsw.cpp -FILE: ../../../third_party/skia/src/opts/SkRasterPipeline_opts.h -FILE: ../../../third_party/skia/src/pdf/SkClusterator.cpp -FILE: ../../../third_party/skia/src/pdf/SkClusterator.h -FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLInterpreter.h -FILE: ../../../third_party/skia/src/sksl/SkSLJIT.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLJIT.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLAppendStage.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLVariableReference.cpp -FILE: ../../../third_party/skia/src/utils/Sk3D.cpp -FILE: ../../../third_party/skia/src/utils/SkJSON.cpp -FILE: ../../../third_party/skia/src/utils/SkJSON.h -FILE: ../../../third_party/skia/src/utils/win/SkDWriteNTDDI_VERSION.h -FILE: ../../../third_party/skia/third_party/skcms/skcms.cc -FILE: ../../../third_party/skia/third_party/skcms/skcms.h -FILE: ../../../third_party/skia/third_party/skcms/skcms_internal.h -FILE: ../../../third_party/skia/third_party/skcms/src/Transform_inl.h -FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.cpp -FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/GrVulkanMemoryAllocator.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 Google Inc. +FILE: ../../../third_party/dart/third_party/tcmalloc/configure_command +FILE: ../../../third_party/dart/third_party/tcmalloc/include/config.h +---------------------------------------------------------------------------------------------------- +Copyright (c) 2005, Google Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -17217,24 +15828,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== ==================================================================================================== -LIBRARY: skcms -ORIGIN: ../../../third_party/skia/third_party/skcms/LICENSE +LIBRARY: tcmalloc +ORIGIN: ../../../third_party/dart/third_party/tcmalloc/include/gperftools/tcmalloc.h TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/third_party/skcms/version.sha1 +FILE: ../../../third_party/dart/third_party/tcmalloc/include/gperftools/tcmalloc.h ---------------------------------------------------------------------------------------------------- -Copyright (c) 2018 Google Inc. All rights reserved. +Copyright (c) 2003, Google Inc. +All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. @@ -17252,447 +15864,21 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== ==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/LICENSE +LIBRARY: tonic +ORIGIN: ../../../garnet/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/CQ_COMMITTERS -FILE: ../../../third_party/skia/DEPS -FILE: ../../../third_party/skia/Doxyfile -FILE: ../../../third_party/skia/animations/checkbox.xml -FILE: ../../../third_party/skia/animations/chest#1.jpg -FILE: ../../../third_party/skia/animations/fire#1.jpg -FILE: ../../../third_party/skia/animations/images#1.xml -FILE: ../../../third_party/skia/animations/jet#1.jpg -FILE: ../../../third_party/skia/animations/lines#1.xml -FILE: ../../../third_party/skia/animations/movie#1.xml -FILE: ../../../third_party/skia/animations/paths#1.xml -FILE: ../../../third_party/skia/animations/redcross#1.jpg -FILE: ../../../third_party/skia/animations/text#1.xml -FILE: ../../../third_party/skia/bench/microbench.json -FILE: ../../../third_party/skia/bench/skpbench.json -FILE: ../../../third_party/skia/docker/skia-release/Dockerfile -FILE: ../../../third_party/skia/docker/skia-with-swift-shader-base/Dockerfile -FILE: ../../../third_party/skia/docker/skia-with-swift-shader-base/build-with-swift-shader-and-run -FILE: ../../../third_party/skia/docs/SkAutoCanvasRestore_Reference.bmh -FILE: ../../../third_party/skia/docs/SkBitmap_Reference.bmh -FILE: ../../../third_party/skia/docs/SkBlendMode_Reference.bmh -FILE: ../../../third_party/skia/docs/SkCanvas_Reference.bmh -FILE: ../../../third_party/skia/docs/SkColor4f_Reference.bmh -FILE: ../../../third_party/skia/docs/SkColor_Reference.bmh -FILE: ../../../third_party/skia/docs/SkIPoint_Reference.bmh -FILE: ../../../third_party/skia/docs/SkIRect_Reference.bmh -FILE: ../../../third_party/skia/docs/SkImageInfo_Reference.bmh -FILE: ../../../third_party/skia/docs/SkImage_Reference.bmh -FILE: ../../../third_party/skia/docs/SkMatrix_Reference.bmh -FILE: ../../../third_party/skia/docs/SkPaint_Reference.bmh -FILE: ../../../third_party/skia/docs/SkPath_Reference.bmh -FILE: ../../../third_party/skia/docs/SkPicture_Reference.bmh -FILE: ../../../third_party/skia/docs/SkPixmap_Reference.bmh -FILE: ../../../third_party/skia/docs/SkPoint_Reference.bmh -FILE: ../../../third_party/skia/docs/SkRRect_Reference.bmh -FILE: ../../../third_party/skia/docs/SkRect_Reference.bmh -FILE: ../../../third_party/skia/docs/SkSurface_Reference.bmh -FILE: ../../../third_party/skia/docs/illustrations.bmh -FILE: ../../../third_party/skia/docs/markup.bmh -FILE: ../../../third_party/skia/docs/overview.bmh -FILE: ../../../third_party/skia/docs/status.json -FILE: ../../../third_party/skia/docs/undocumented.bmh -FILE: ../../../third_party/skia/docs/usingBookmaker.bmh -FILE: ../../../third_party/skia/experimental/docs/animationCommon.js -FILE: ../../../third_party/skia/experimental/docs/backend.js -FILE: ../../../third_party/skia/experimental/docs/canvasBackend.js -FILE: ../../../third_party/skia/experimental/docs/exampleSlides.js -FILE: ../../../third_party/skia/experimental/docs/interpolatorFunctions.js -FILE: ../../../third_party/skia/experimental/docs/jsonbaseddoc.htm -FILE: ../../../third_party/skia/experimental/docs/svgBackend.js -FILE: ../../../third_party/skia/experimental/docs/svgbaseddoc.htm -FILE: ../../../third_party/skia/experimental/docs/utilities.js -FILE: ../../../third_party/skia/experimental/wasm/shell.html -FILE: ../../../third_party/skia/infra/bots/android_bin.isolate -FILE: ../../../third_party/skia/infra/bots/assets.isolate -FILE: ../../../third_party/skia/infra/bots/assets/android_ndk_darwin/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/android_ndk_linux/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/android_ndk_windows/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/android_sdk_linux/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/armhf_sysroot/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/cast_toolchain/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/chromebook_arm_gles/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/chromebook_x86_64_gles/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/clang_linux/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/clang_win/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/cmake_linux/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/emscripten_sdk/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/gcloud_linux/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/go/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_debug/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_intel_driver_release/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/linux_vulkan_sdk/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/lottie-samples/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/mips64el_toolchain_linux/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/moltenvk/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/node/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/opencl_headers/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/opencl_intel_neo_linux/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/opencl_ocl_icd_linux/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/procdump_win/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/protoc/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/skimage/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/skp/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/svg/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/valgrind/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/win_ninja/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/win_toolchain/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/win_toolchain_2015/VERSION -FILE: ../../../third_party/skia/infra/bots/assets/win_vulkan_sdk/VERSION -FILE: ../../../third_party/skia/infra/bots/calmbench.isolate -FILE: ../../../third_party/skia/infra/bots/cfg.json -FILE: ../../../third_party/skia/infra/bots/ct/blacklists/get_images_from_skps_100k_c37e844a6f8708-eee762104c75bd.json -FILE: ../../../third_party/skia/infra/bots/ct/blacklists/get_images_from_skps_100k_fad657e-276e633.json -FILE: ../../../third_party/skia/infra/bots/empty.isolate -FILE: ../../../third_party/skia/infra/bots/infrabots.isolate -FILE: ../../../third_party/skia/infra/bots/ios_bin.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_android_sdk_linux.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_gcloud_linux.isolate -FILE: ../../../third_party/skia/infra/bots/isolate_go.isolate -FILE: ../../../third_party/skia/infra/bots/jobs.json -FILE: ../../../third_party/skia/infra/bots/perf_skia_bundled.isolate -FILE: ../../../third_party/skia/infra/bots/recipe_modules/binary_size/examples/full.expected/binary_size.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_API26.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Android_ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-arm-Release-Chromebook_GLES.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Chromebook_GLES.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-Coverage.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-MSAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-OpenCL.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Debug-SafeStack.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Fast.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Mini.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Static.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SwiftShader.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-Clang-x86_64-Release-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-EMCC-wasm-Release.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-arm-Release-Chromecast.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-loongson3a-Release.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-NoGPU.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian9-GCC-x86_64-Release-Shared.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-arm64-Release-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86-Debug-Exceptions.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Build-Win-Clang-x86_64-Release-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/build/examples/full.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/builder_name_schema.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/builder_name_schema/examples/full.expected/test.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Build-Win-Clang-x86_64-Release-ParentRevision.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/cross_repo_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/flutter_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/parent_revision_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/checkout/examples/full.expected/test.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/failed_gsutil.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/ct/examples/full.expected/test.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/doxygen/examples/full.expected/doxygen.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/env/examples/full.expected/test.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-ChromeOS-Clang-SamsungChromebookPlus-GPU-MaliT860-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-Coverage.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-OpenCL.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Debug-All-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_ProcDump.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed_golo.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/cpu_scale_failed_once.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/exceptions.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/failed_read_version.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/retry_ios_install.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/flavor/examples/full.expected/retry_ios_install_retries_exhausted.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/git/examples/full.expected/test.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/gsutil/examples/full.expected/failed_all_uploads.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/gsutil/examples/full.expected/failed_one_upload.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/gsutil/examples/full.expected/gsutil_tests.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/infra/examples/full.expected/failed_all_updates.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/infra/examples/full.expected/failed_one_update.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/infra/examples/full.expected/infra_tests.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/always-use-exparchive.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/basic.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/discover.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-batch-bmiss.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-batch-emiss.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-batch.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-miss.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-multi-miss.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive-multi.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/exparchive.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/extra.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/missing.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/isolate/examples/full.expected/none.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/run/examples/full.expected/test.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/skia_swarming/examples/full.expected/test.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/basic.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/show_isolated_out_in_collect_step.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/show_shards_in_collect_step.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/swarming_expired_new.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/swarming_expired_old.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/swarming_timeout_new.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/swarming_timeout_old.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming/examples/full.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/swarming_client/examples/full.expected/basic.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Build-Debian9-Clang-x86_64-Release-SKNX_NO_SIMD.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/Housekeeper-Weekly-RecreateSKPs.json -FILE: ../../../third_party/skia/infra/bots/recipe_modules/vars/examples/full.expected/win_test.json -FILE: ../../../third_party/skia/infra/bots/recipes/android_compile.expected/android_compile_nontrybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/android_compile.expected/android_compile_trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_bookmaker.json -FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_failed_extract_fiddles.json -FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_failed_fiddlecli.json -FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_failed_fiddles.json -FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/nightly_failed_upload.json -FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/percommit_bookmaker.json -FILE: ../../../third_party/skia/infra/bots/recipes/bookmaker.expected/percommit_failed_validation.json -FILE: ../../../third_party/skia/infra/bots/recipes/calmbench.expected/Calmbench-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/calmbench.expected/Calmbench-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/check_generated_files.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-universal-devrel-Android_SKQP.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-NoDEPS.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-Clang-x86_64-Release-ParentRevision.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Debian9-GCC-x86_64-Release-Flutter_Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipes/compile.expected/Build-Win-Clang-x86-Debug.json -FILE: ../../../third_party/skia/infra/bots/recipes/compute_test.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-OpenCL.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_10k_SKPs_UnknownBuilder.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_CPU_BENCH_10k_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_100k_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_10k_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_10k_SKPs_Trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_1m_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_1m_SKPs_2slaves_failure.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_1m_SKPs_slave3_failure.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_DM_SKPs_UnknownBuilder.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_GPU_BENCH_10k_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_GPU_BENCH_1k_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_IMG_DECODE_100k_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_IMG_DECODE_10k_SKPs.json -FILE: ../../../third_party/skia/infra/bots/recipes/ct_skps.expected/CT_IMG_DECODE_10k_SKPs_Trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/housekeeper.expected/Housekeeper-PerCommit-Trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/housekeeper.expected/Housekeeper-PerCommit.json -FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/failed_all_updates.json -FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/failed_one_update.json -FILE: ../../../third_party/skia/infra/bots/recipes/infra.expected/infra_tests.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-Android_NoGPUThreads.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Chromecast-Clang-Chorizo-GPU-Cortex_A7-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-MoltenVK_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Release-All-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Release-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/Perf-iOS-Clang-iPadPro-GPU-GT7800-arm64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/perf.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json -FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/Housekeeper-Weekly-RecreateSKPs.json -FILE: ../../../third_party/skia/infra/bots/recipes/recreate_skps.expected/failed_upload.json -FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Android-Clang-Pixel-GPU-Adreno530-arm64-Release-All-Android_CCPR_Skpbench.json -FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench.json -FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench_DDLRecord_9x9.json -FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Vulkan_Skpbench_DDLTotal_9x9.json -FILE: ../../../third_party/skia/infra/bots/recipes/skpbench.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/skqp_test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-universal-devrel-All-Android_SKQP.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-AndroidOne-GPU-Mali400MP2-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS6-GPU-MaliT760-arm64-Debug-All-Android_NoGPUThreads.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-GalaxyS7_G930FD-GPU-MaliT880-arm64-Release-All-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-MotoG4-CPU-Snapdragon617-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NVIDIA_Shield-GPU-TegraX1-arm64-Debug-All-Android_CCPR.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus5-GPU-Adreno330-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Release-All-Android.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm-Debug-All-Android_ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Android-Clang-Pixel-GPU-Adreno530-arm64-Debug-All-Android_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-ChromeOS-Clang-AcerChromebookR13Convertible-GPU-PowerVRGX6250-arm-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-Clang-Chorizo-CPU-Cortex_A7-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast-Clang-Chorizo-GPU-Cortex_A7-arm-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-TSAN.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-GPU-SwiftShader-x86_64-Release-All-SwiftShader.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Release-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBook10.1-GPU-IntelHD615-x86_64-Release-All-NativeFonts.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookAir7.2-GPU-IntelHD6000-x86_64-Debug-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Metal.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-MoltenVK_Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-CPU-AVX-x86_64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Debug-All-CommandBuffer.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL1.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-DDL3.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Lottie.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Vulkan_Coverage.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_PreAbandonGpuContext_SK_CPU_LIMIT_SSE41.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-ReleaseAndAbandonGpuContext.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC5i7RYH-CPU-AVX2-x86_64-Debug-All-NativeFonts_GDI.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Release-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ShuttleA-GPU-GTX660-x86_64-Release-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ShuttleC-GPU-GTX960-x86_64-Debug-All-ANGLE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win10-Clang-ZBOX-GPU-GTX1070-x86_64-Debug-All-Vulkan.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FAAA.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FDAA.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Win2016-Clang-GCE-CPU-AVX2-x86_64-Debug-All-FSAA.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-iOS-Clang-iPadPro-GPU-GT7800-arm64-Release-All.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_dm.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_get_hashes.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_pull.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/failed_push.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/internal_bot_2.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_calmbench_results.expected/normal_bot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_calmbench_results.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/alternate_bucket.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/failed_all.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/failed_once.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/normal_bot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_coverage_results.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/alternate_bucket.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/failed_all.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/failed_once.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/normal_bot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_dm_results.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_nano_results.expected/normal_bot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_nano_results.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_skiaserve.expected/normal_bot.json -FILE: ../../../third_party/skia/infra/bots/recipes/upload_skiaserve.expected/trybot.json -FILE: ../../../third_party/skia/infra/bots/resources.isolate -FILE: ../../../third_party/skia/infra/bots/skpbench_skia_bundled.isolate -FILE: ../../../third_party/skia/infra/bots/swarm_recipe.isolate -FILE: ../../../third_party/skia/infra/bots/tasks.json -FILE: ../../../third_party/skia/infra/bots/test_skia_bundled.isolate -FILE: ../../../third_party/skia/infra/bots/tools/luci-go/linux64/isolate.sha1 -FILE: ../../../third_party/skia/infra/bots/tools/luci-go/mac64/isolate.sha1 -FILE: ../../../third_party/skia/infra/bots/tools/luci-go/win64/isolate.exe.sha1 -FILE: ../../../third_party/skia/infra/branch-config/cq.cfg -FILE: ../../../third_party/skia/infra/config/recipes.cfg -FILE: ../../../third_party/skia/infra/cts/whitelist_devices.json -FILE: ../../../third_party/skia/infra/project-config/cr-buildbucket.cfg -FILE: ../../../third_party/skia/infra/project-config/project.cfg -FILE: ../../../third_party/skia/infra/project-config/refs.cfg -FILE: ../../../third_party/skia/public.bzl -FILE: ../../../third_party/skia/site/METADATA -FILE: ../../../third_party/skia/site/dev/METADATA -FILE: ../../../third_party/skia/site/dev/design/PdfLogicalDocumentStructure.png -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.1.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.1.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.1.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.1.svg -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.2.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.2.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.2.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.2.svg -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.2.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.1.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.1.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.1.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.1.svg -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.2.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.2.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.2.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.2.svg -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.3.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.3.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.3.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/corollary2.3.3.svg -FILE: ../../../third_party/skia/site/dev/design/conical/lemma1.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/lemma1.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/lemma1.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/lemma1.svg -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.1.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.1.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.1.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.1.svg -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.2.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.2.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.2.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.2.svg -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/lemma3.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/lemma4.ggb!/geogebra.xml -FILE: ../../../third_party/skia/site/dev/design/conical/lemma4.ggb!/geogebra_javascript.js -FILE: ../../../third_party/skia/site/dev/design/conical/lemma4.ggb!/geogebra_thumbnail.png -FILE: ../../../third_party/skia/site/dev/design/conical/lemma4.svg -FILE: ../../../third_party/skia/site/dev/tools/debugger.png -FILE: ../../../third_party/skia/site/dev/tools/image.png -FILE: ../../../third_party/skia/site/dev/tools/onlinedebugger.png -FILE: ../../../third_party/skia/site/dev/tools/tracing.png -FILE: ../../../third_party/skia/site/dev/tools/tracing_load.png -FILE: ../../../third_party/skia/site/favicon.ico -FILE: ../../../third_party/skia/site/user/METADATA -FILE: ../../../third_party/skia/site/user/api/METADATA -FILE: ../../../third_party/skia/site/user/api/catalog.htm -FILE: ../../../third_party/skia/site/user/sample/architecture.png -FILE: ../../../third_party/skia/site/user/sample/detail_correct.png -FILE: ../../../third_party/skia/site/user/sample/detail_wrong.png -FILE: ../../../third_party/skia/site/user/sample/gamut_correct.png -FILE: ../../../third_party/skia/site/user/sample/gamut_wrong.png -FILE: ../../../third_party/skia/site/user/sample/gradient_correct.png -FILE: ../../../third_party/skia/site/user/sample/gradient_wrong.png -FILE: ../../../third_party/skia/site/user/sample/transfer_fn.png -FILE: ../../../third_party/skia/src/core/SkOrderedReadBuffer.h -FILE: ../../../third_party/skia/src/sksl/lex/sksl.lex -FILE: ../../../third_party/skia/src/sksl/sksl.inc -FILE: ../../../third_party/skia/src/sksl/sksl_cpu.inc -FILE: ../../../third_party/skia/src/sksl/sksl_fp.inc -FILE: ../../../third_party/skia/src/sksl/sksl_frag.inc -FILE: ../../../third_party/skia/src/sksl/sksl_geom.inc -FILE: ../../../third_party/skia/src/sksl/sksl_vert.inc ----------------------------------------------------------------------------------------------------- -Copyright (c) 2011 Google Inc. All rights reserved. +FILE: ../../../third_party/tonic/dart_list.cc +FILE: ../../../third_party/tonic/dart_list.h +FILE: ../../../third_party/tonic/file_loader/file_loader_fuchsia.cc +FILE: ../../../third_party/tonic/file_loader/file_loader_posix.cc +FILE: ../../../third_party/tonic/file_loader/file_loader_win.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/path_win.cc +FILE: ../../../third_party/tonic/filesystem/filesystem/portable_unistd.h +FILE: ../../../third_party/tonic/platform/platform_utils.h +FILE: ../../../third_party/tonic/platform/platform_utils_posix.cc +FILE: ../../../third_party/tonic/platform/platform_utils_win.cc +---------------------------------------------------------------------------------------------------- +Copyright 2017 The Fuchsia Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -17722,3452 +15908,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== ==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/bench/AAClipBench.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/bench/AAClipBench.cpp -FILE: ../../../third_party/skia/bench/Benchmark.cpp -FILE: ../../../third_party/skia/bench/Benchmark.h -FILE: ../../../third_party/skia/bench/BitmapBench.cpp -FILE: ../../../third_party/skia/bench/BitmapRectBench.cpp -FILE: ../../../third_party/skia/bench/BlurBench.cpp -FILE: ../../../third_party/skia/bench/ChromeBench.cpp -FILE: ../../../third_party/skia/bench/DashBench.cpp -FILE: ../../../third_party/skia/bench/FontScalerBench.cpp -FILE: ../../../third_party/skia/bench/GradientBench.cpp -FILE: ../../../third_party/skia/bench/MatrixBench.cpp -FILE: ../../../third_party/skia/bench/MutexBench.cpp -FILE: ../../../third_party/skia/bench/PathBench.cpp -FILE: ../../../third_party/skia/bench/PathIterBench.cpp -FILE: ../../../third_party/skia/bench/PicturePlaybackBench.cpp -FILE: ../../../third_party/skia/bench/RectBench.cpp -FILE: ../../../third_party/skia/bench/RegionBench.cpp -FILE: ../../../third_party/skia/bench/RepeatTileBench.cpp -FILE: ../../../third_party/skia/bench/ScalarBench.cpp -FILE: ../../../third_party/skia/bench/ShaderMaskBench.cpp -FILE: ../../../third_party/skia/bench/TextBench.cpp -FILE: ../../../third_party/skia/bench/VertBench.cpp -FILE: ../../../third_party/skia/experimental/Networking/SkSockets.cpp -FILE: ../../../third_party/skia/experimental/Networking/SkSockets.h -FILE: ../../../third_party/skia/gm/aaclip.cpp -FILE: ../../../third_party/skia/gm/aarectmodes.cpp -FILE: ../../../third_party/skia/gm/arithmode.cpp -FILE: ../../../third_party/skia/gm/bitmapcopy.cpp -FILE: ../../../third_party/skia/gm/bitmapfilters.cpp -FILE: ../../../third_party/skia/gm/bitmaprect.cpp -FILE: ../../../third_party/skia/gm/blurs.cpp -FILE: ../../../third_party/skia/gm/clip_strokerect.cpp -FILE: ../../../third_party/skia/gm/color4f.cpp -FILE: ../../../third_party/skia/gm/colormatrix.cpp -FILE: ../../../third_party/skia/gm/complexclip.cpp -FILE: ../../../third_party/skia/gm/complexclip2.cpp -FILE: ../../../third_party/skia/gm/convexpaths.cpp -FILE: ../../../third_party/skia/gm/cubicpaths.cpp -FILE: ../../../third_party/skia/gm/degeneratesegments.cpp -FILE: ../../../third_party/skia/gm/dftext.cpp -FILE: ../../../third_party/skia/gm/drawbitmaprect.cpp -FILE: ../../../third_party/skia/gm/drawlooper.cpp -FILE: ../../../third_party/skia/gm/emptypath.cpp -FILE: ../../../third_party/skia/gm/encode.cpp -FILE: ../../../third_party/skia/gm/extractbitmap.cpp -FILE: ../../../third_party/skia/gm/filltypes.cpp -FILE: ../../../third_party/skia/gm/filltypespersp.cpp -FILE: ../../../third_party/skia/gm/filterbitmap.cpp -FILE: ../../../third_party/skia/gm/filterindiabox.cpp -FILE: ../../../third_party/skia/gm/fontscaler.cpp -FILE: ../../../third_party/skia/gm/gammatext.cpp -FILE: ../../../third_party/skia/gm/giantbitmap.cpp -FILE: ../../../third_party/skia/gm/gm.cpp -FILE: ../../../third_party/skia/gm/gm.h -FILE: ../../../third_party/skia/gm/gradients.cpp -FILE: ../../../third_party/skia/gm/gradtext.cpp -FILE: ../../../third_party/skia/gm/hairmodes.cpp -FILE: ../../../third_party/skia/gm/hittestpath.cpp -FILE: ../../../third_party/skia/gm/image.cpp -FILE: ../../../third_party/skia/gm/imageblur.cpp -FILE: ../../../third_party/skia/gm/imageblur2.cpp -FILE: ../../../third_party/skia/gm/imagefiltersbase.cpp -FILE: ../../../third_party/skia/gm/imagefilterscropped.cpp -FILE: ../../../third_party/skia/gm/lcdtext.cpp -FILE: ../../../third_party/skia/gm/linepaths.cpp -FILE: ../../../third_party/skia/gm/ninepatchstretch.cpp -FILE: ../../../third_party/skia/gm/pathfill.cpp -FILE: ../../../third_party/skia/gm/pathreverse.cpp -FILE: ../../../third_party/skia/gm/points.cpp -FILE: ../../../third_party/skia/gm/poly2poly.cpp -FILE: ../../../third_party/skia/gm/quadpaths.cpp -FILE: ../../../third_party/skia/gm/shadertext.cpp -FILE: ../../../third_party/skia/gm/shadertext2.cpp -FILE: ../../../third_party/skia/gm/shadertext3.cpp -FILE: ../../../third_party/skia/gm/shadows.cpp -FILE: ../../../third_party/skia/gm/strokefill.cpp -FILE: ../../../third_party/skia/gm/strokerects.cpp -FILE: ../../../third_party/skia/gm/strokes.cpp -FILE: ../../../third_party/skia/gm/tablecolorfilter.cpp -FILE: ../../../third_party/skia/gm/texteffects.cpp -FILE: ../../../third_party/skia/gm/tilemodes.cpp -FILE: ../../../third_party/skia/gm/tilemodes_scaled.cpp -FILE: ../../../third_party/skia/gm/tinybitmap.cpp -FILE: ../../../third_party/skia/gm/verttext.cpp -FILE: ../../../third_party/skia/gm/verttext2.cpp -FILE: ../../../third_party/skia/gm/xfermodes.cpp -FILE: ../../../third_party/skia/include/core/SkData.h -FILE: ../../../third_party/skia/include/core/SkImageEncoder.h -FILE: ../../../third_party/skia/include/core/SkImageFilter.h -FILE: ../../../third_party/skia/include/core/SkMatrix44.h -FILE: ../../../third_party/skia/include/core/SkSize.h -FILE: ../../../third_party/skia/include/core/SkTLazy.h -FILE: ../../../third_party/skia/include/effects/SkLayerDrawLooper.h -FILE: ../../../third_party/skia/include/gpu/GrRenderTarget.h -FILE: ../../../third_party/skia/include/gpu/GrTexture.h -FILE: ../../../third_party/skia/include/gpu/gl/GrGLConfig.h -FILE: ../../../third_party/skia/include/gpu/gl/GrGLConfig_chrome.h -FILE: ../../../third_party/skia/include/gpu/gl/GrGLInterface.h -FILE: ../../../third_party/skia/include/ports/SkTypeface_mac.h -FILE: ../../../third_party/skia/include/ports/SkTypeface_win.h -FILE: ../../../third_party/skia/include/private/SkTArray.h -FILE: ../../../third_party/skia/include/utils/SkNWayCanvas.h -FILE: ../../../third_party/skia/include/utils/mac/SkCGUtils.h -FILE: ../../../third_party/skia/include/views/SkTouchGesture.h -FILE: ../../../third_party/skia/samplecode/ClockFaceView.cpp -FILE: ../../../third_party/skia/samplecode/Sample2PtRadial.cpp -FILE: ../../../third_party/skia/samplecode/SampleAAClip.cpp -FILE: ../../../third_party/skia/samplecode/SampleAARectModes.cpp -FILE: ../../../third_party/skia/samplecode/SampleAARects.cpp -FILE: ../../../third_party/skia/samplecode/SampleAll.cpp -FILE: ../../../third_party/skia/samplecode/SampleAnimator.cpp -FILE: ../../../third_party/skia/samplecode/SampleArc.cpp -FILE: ../../../third_party/skia/samplecode/SampleBigBlur.cpp -FILE: ../../../third_party/skia/samplecode/SampleBigGradient.cpp -FILE: ../../../third_party/skia/samplecode/SampleBitmapRect.cpp -FILE: ../../../third_party/skia/samplecode/SampleBlur.cpp -FILE: ../../../third_party/skia/samplecode/SampleCamera.cpp -FILE: ../../../third_party/skia/samplecode/SampleCircle.cpp -FILE: ../../../third_party/skia/samplecode/SampleClamp.cpp -FILE: ../../../third_party/skia/samplecode/SampleClip.cpp -FILE: ../../../third_party/skia/samplecode/SampleCode.h -FILE: ../../../third_party/skia/samplecode/SampleColorFilter.cpp -FILE: ../../../third_party/skia/samplecode/SampleComplexClip.cpp -FILE: ../../../third_party/skia/samplecode/SampleConcavePaths.cpp -FILE: ../../../third_party/skia/samplecode/SampleDash.cpp -FILE: ../../../third_party/skia/samplecode/SampleDegenerateTwoPtRadials.cpp -FILE: ../../../third_party/skia/samplecode/SampleDither.cpp -FILE: ../../../third_party/skia/samplecode/SampleEffects.cpp -FILE: ../../../third_party/skia/samplecode/SampleEmboss.cpp -FILE: ../../../third_party/skia/samplecode/SampleFillType.cpp -FILE: ../../../third_party/skia/samplecode/SampleFilter2.cpp -FILE: ../../../third_party/skia/samplecode/SampleFontCache.cpp -FILE: ../../../third_party/skia/samplecode/SampleFontScalerTest.cpp -FILE: ../../../third_party/skia/samplecode/SampleFuzz.cpp -FILE: ../../../third_party/skia/samplecode/SampleGradients.cpp -FILE: ../../../third_party/skia/samplecode/SampleHairCurves.cpp -FILE: ../../../third_party/skia/samplecode/SampleHairModes.cpp -FILE: ../../../third_party/skia/samplecode/SampleHairline.cpp -FILE: ../../../third_party/skia/samplecode/SampleLCD.cpp -FILE: ../../../third_party/skia/samplecode/SampleLayerMask.cpp -FILE: ../../../third_party/skia/samplecode/SampleLayers.cpp -FILE: ../../../third_party/skia/samplecode/SampleLines.cpp -FILE: ../../../third_party/skia/samplecode/SampleMeasure.cpp -FILE: ../../../third_party/skia/samplecode/SamplePatch.cpp -FILE: ../../../third_party/skia/samplecode/SamplePath.cpp -FILE: ../../../third_party/skia/samplecode/SamplePathClip.cpp -FILE: ../../../third_party/skia/samplecode/SamplePathEffects.cpp -FILE: ../../../third_party/skia/samplecode/SamplePathFill.cpp -FILE: ../../../third_party/skia/samplecode/SamplePoints.cpp -FILE: ../../../third_party/skia/samplecode/SamplePolyToPoly.cpp -FILE: ../../../third_party/skia/samplecode/SampleRegion.cpp -FILE: ../../../third_party/skia/samplecode/SampleRepeatTile.cpp -FILE: ../../../third_party/skia/samplecode/SampleShaderText.cpp -FILE: ../../../third_party/skia/samplecode/SampleShaders.cpp -FILE: ../../../third_party/skia/samplecode/SampleSlides.cpp -FILE: ../../../third_party/skia/samplecode/SampleStrokePath.cpp -FILE: ../../../third_party/skia/samplecode/SampleStrokeRect.cpp -FILE: ../../../third_party/skia/samplecode/SampleText.cpp -FILE: ../../../third_party/skia/samplecode/SampleTextAlpha.cpp -FILE: ../../../third_party/skia/samplecode/SampleTextBox.cpp -FILE: ../../../third_party/skia/samplecode/SampleTextOnPath.cpp -FILE: ../../../third_party/skia/samplecode/SampleTextureDomain.cpp -FILE: ../../../third_party/skia/samplecode/SampleTiling.cpp -FILE: ../../../third_party/skia/samplecode/SampleVertices.cpp -FILE: ../../../third_party/skia/samplecode/SampleWritePixels.cpp -FILE: ../../../third_party/skia/samplecode/SampleXfermodesBlur.cpp -FILE: ../../../third_party/skia/samplecode/vertexdump.cpp -FILE: ../../../third_party/skia/src/core/SkAAClip.cpp -FILE: ../../../third_party/skia/src/core/SkAAClip.h -FILE: ../../../third_party/skia/src/core/SkAdvancedTypefaceMetrics.h -FILE: ../../../third_party/skia/src/core/SkBitmapProcState.cpp -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrix.h -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_procs.h -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_sample.h -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_shaderproc.h -FILE: ../../../third_party/skia/src/core/SkBlitMask.h -FILE: ../../../third_party/skia/src/core/SkBlitRow.h -FILE: ../../../third_party/skia/src/core/SkBlitRow_D32.cpp -FILE: ../../../third_party/skia/src/core/SkClipStack.cpp -FILE: ../../../third_party/skia/src/core/SkClipStack.h -FILE: ../../../third_party/skia/src/core/SkColorMatrixFilterRowMajor255.cpp -FILE: ../../../third_party/skia/src/core/SkConvertPixels.h -FILE: ../../../third_party/skia/src/core/SkData.cpp -FILE: ../../../third_party/skia/src/core/SkDevice.cpp -FILE: ../../../third_party/skia/src/core/SkDither.cpp -FILE: ../../../third_party/skia/src/core/SkDrawProcs.h -FILE: ../../../third_party/skia/src/core/SkEdgeBuilder.cpp -FILE: ../../../third_party/skia/src/core/SkEdgeBuilder.h -FILE: ../../../third_party/skia/src/core/SkFlattenable.cpp -FILE: ../../../third_party/skia/src/core/SkFontStream.cpp -FILE: ../../../third_party/skia/src/core/SkLineClipper.cpp -FILE: ../../../third_party/skia/src/core/SkLineClipper.h -FILE: ../../../third_party/skia/src/core/SkMallocPixelRef.cpp -FILE: ../../../third_party/skia/src/core/SkMatrix44.cpp -FILE: ../../../third_party/skia/src/core/SkPictureData.cpp -FILE: ../../../third_party/skia/src/core/SkPictureData.h -FILE: ../../../third_party/skia/src/core/SkPictureFlat.cpp -FILE: ../../../third_party/skia/src/core/SkPictureFlat.h -FILE: ../../../third_party/skia/src/core/SkPictureRecord.cpp -FILE: ../../../third_party/skia/src/core/SkPictureRecord.h -FILE: ../../../third_party/skia/src/core/SkPixelRef.cpp -FILE: ../../../third_party/skia/src/core/SkPtrRecorder.cpp -FILE: ../../../third_party/skia/src/core/SkReadBuffer.h -FILE: ../../../third_party/skia/src/core/SkTypefaceCache.cpp -FILE: ../../../third_party/skia/src/core/SkTypefaceCache.h -FILE: ../../../third_party/skia/src/core/SkUnPreMultiply.cpp -FILE: ../../../third_party/skia/src/core/SkWriteBuffer.h -FILE: ../../../third_party/skia/src/core/SkWriter32.cpp -FILE: ../../../third_party/skia/src/effects/SkColorMatrix.cpp -FILE: ../../../third_party/skia/src/effects/SkColorMatrixFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkLayerDrawLooper.cpp -FILE: ../../../third_party/skia/src/effects/SkPackBits.cpp -FILE: ../../../third_party/skia/src/effects/SkTableMaskFilter.cpp -FILE: ../../../third_party/skia/src/gpu/GrContext.cpp -FILE: ../../../third_party/skia/src/gpu/GrGpu.h -FILE: ../../../third_party/skia/src/gpu/GrGpuResource.cpp -FILE: ../../../third_party/skia/src/gpu/GrPaint.h -FILE: ../../../third_party/skia/src/gpu/GrPathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/GrPathRenderer.h -FILE: ../../../third_party/skia/src/gpu/GrPathRendererChain.cpp -FILE: ../../../third_party/skia/src/gpu/GrPathRendererChain.h -FILE: ../../../third_party/skia/src/gpu/GrPathUtils.cpp -FILE: ../../../third_party/skia/src/gpu/GrPathUtils.h -FILE: ../../../third_party/skia/src/gpu/GrRenderTarget.cpp -FILE: ../../../third_party/skia/src/gpu/GrStencilAttachment.cpp -FILE: ../../../third_party/skia/src/gpu/GrStencilAttachment.h -FILE: ../../../third_party/skia/src/gpu/GrStencilSettings.cpp -FILE: ../../../third_party/skia/src/gpu/GrTexture.cpp -FILE: ../../../third_party/skia/src/gpu/SkGpuDevice.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLCreateNullInterface.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLDefines.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLGLSL.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLGLSL.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpu.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpu.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpuProgramCache.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLIRect.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLInterface.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLMakeNativeInterface_none.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLProgram.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLProgram.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLRenderTarget.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLRenderTarget.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLStencilAttachment.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLStencilAttachment.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLTexture.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLTexture.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLUtil.cpp -FILE: ../../../third_party/skia/src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp -FILE: ../../../third_party/skia/src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSL.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSL.h -FILE: ../../../third_party/skia/src/gpu/ops/GrAAHairLinePathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrAAHairLinePathRenderer.h -FILE: ../../../third_party/skia/src/gpu/ops/GrDefaultPathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrDefaultPathRenderer.h -FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_none.cpp -FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_none.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFConvertType1FontStream.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFDevice.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFDevice.h -FILE: ../../../third_party/skia/src/pdf/SkPDFDocument.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFFont.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFFont.h -FILE: ../../../third_party/skia/src/pdf/SkPDFGraphicState.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFMakeToUnicodeCmap.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFShader.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFShader.h -FILE: ../../../third_party/skia/src/pdf/SkPDFTypes.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFUtils.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFUtils.h -FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_default.cpp -FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_default_imagefilters.cpp -FILE: ../../../third_party/skia/src/ports/SkImageEncoder_WIC.cpp -FILE: ../../../third_party/skia/src/ports/SkMemory_malloc.cpp -FILE: ../../../third_party/skia/src/ports/SkScalerContext_win_dw.cpp -FILE: ../../../third_party/skia/src/shaders/SkBitmapProcShader.cpp -FILE: ../../../third_party/skia/src/shaders/SkEmptyShader.h -FILE: ../../../third_party/skia/src/utils/SkBitSet.h -FILE: ../../../third_party/skia/src/utils/SkNWayCanvas.cpp -FILE: ../../../third_party/skia/src/utils/SkOSPath.cpp -FILE: ../../../third_party/skia/src/utils/SkParsePath.cpp -FILE: ../../../third_party/skia/src/utils/mac/SkCreateCGImageRef.cpp -FILE: ../../../third_party/skia/src/utils/win/SkAutoCoInitialize.cpp -FILE: ../../../third_party/skia/src/utils/win/SkAutoCoInitialize.h -FILE: ../../../third_party/skia/src/utils/win/SkHRESULT.cpp -FILE: ../../../third_party/skia/src/utils/win/SkHRESULT.h -FILE: ../../../third_party/skia/src/utils/win/SkIStream.cpp -FILE: ../../../third_party/skia/src/utils/win/SkIStream.h -FILE: ../../../third_party/skia/src/utils/win/SkTScopedComPtr.h -FILE: ../../../third_party/skia/src/utils/win/SkWGL.h -FILE: ../../../third_party/skia/src/utils/win/SkWGL_win.cpp -FILE: ../../../third_party/skia/src/views/SkView.cpp -FILE: ../../../third_party/skia/src/xps/SkXPSDevice.cpp -FILE: ../../../third_party/skia/src/xps/SkXPSDevice.h ----------------------------------------------------------------------------------------------------- -Copyright 2011 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/bench/AlternatingColorPatternBench.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/bench/AlternatingColorPatternBench.cpp -FILE: ../../../third_party/skia/bench/BezierBench.cpp -FILE: ../../../third_party/skia/bench/BlurRectsBench.cpp -FILE: ../../../third_party/skia/bench/GMBench.cpp -FILE: ../../../third_party/skia/bench/GMBench.h -FILE: ../../../third_party/skia/bench/GeometryBench.cpp -FILE: ../../../third_party/skia/bench/ImageFilterCollapse.cpp -FILE: ../../../third_party/skia/bench/ImageFilterDAGBench.cpp -FILE: ../../../third_party/skia/bench/PatchBench.cpp -FILE: ../../../third_party/skia/bench/PictureNestingBench.cpp -FILE: ../../../third_party/skia/bench/RecordingBench.cpp -FILE: ../../../third_party/skia/bench/RecordingBench.h -FILE: ../../../third_party/skia/bench/RectanizerBench.cpp -FILE: ../../../third_party/skia/bench/RotatedRectBench.cpp -FILE: ../../../third_party/skia/bench/SKPBench.cpp -FILE: ../../../third_party/skia/bench/SKPBench.h -FILE: ../../../third_party/skia/bench/nanobench.cpp -FILE: ../../../third_party/skia/dm/DMJsonWriter.cpp -FILE: ../../../third_party/skia/dm/DMJsonWriter.h -FILE: ../../../third_party/skia/gm/aaa.cpp -FILE: ../../../third_party/skia/gm/beziers.cpp -FILE: ../../../third_party/skia/gm/blurcircles.cpp -FILE: ../../../third_party/skia/gm/cgm.c -FILE: ../../../third_party/skia/gm/cgms.cpp -FILE: ../../../third_party/skia/gm/clipdrawdraw.cpp -FILE: ../../../third_party/skia/gm/coloremoji_blendmodes.cpp -FILE: ../../../third_party/skia/gm/colorfilters.cpp -FILE: ../../../third_party/skia/gm/colorwheel.cpp -FILE: ../../../third_party/skia/gm/complexclip3.cpp -FILE: ../../../third_party/skia/gm/convexpolyclip.cpp -FILE: ../../../third_party/skia/gm/convexpolyeffect.cpp -FILE: ../../../third_party/skia/gm/discard.cpp -FILE: ../../../third_party/skia/gm/drrect.cpp -FILE: ../../../third_party/skia/gm/emboss.cpp -FILE: ../../../third_party/skia/gm/filterfastbounds.cpp -FILE: ../../../third_party/skia/gm/glyph_pos.cpp -FILE: ../../../third_party/skia/gm/gradients_2pt_conical.cpp -FILE: ../../../third_party/skia/gm/grayscalejpg.cpp -FILE: ../../../third_party/skia/gm/imageblurtiled.cpp -FILE: ../../../third_party/skia/gm/imagefiltersclipped.cpp -FILE: ../../../third_party/skia/gm/imagefilterscropexpand.cpp -FILE: ../../../third_party/skia/gm/imagefiltersscaled.cpp -FILE: ../../../third_party/skia/gm/imageresizetiled.cpp -FILE: ../../../third_party/skia/gm/matriximagefilter.cpp -FILE: ../../../third_party/skia/gm/multipicturedraw.cpp -FILE: ../../../third_party/skia/gm/patch.cpp -FILE: ../../../third_party/skia/gm/picture.cpp -FILE: ../../../third_party/skia/gm/pictureshader.cpp -FILE: ../../../third_party/skia/gm/pictureshadertile.cpp -FILE: ../../../third_party/skia/gm/recordopts.cpp -FILE: ../../../third_party/skia/gm/smallarc.cpp -FILE: ../../../third_party/skia/gm/stroketext.cpp -FILE: ../../../third_party/skia/gm/surface.cpp -FILE: ../../../third_party/skia/gm/tallstretchedbitmaps.cpp -FILE: ../../../third_party/skia/gm/textblob.cpp -FILE: ../../../third_party/skia/gm/textblobshader.cpp -FILE: ../../../third_party/skia/gm/texturedomaineffect.cpp -FILE: ../../../third_party/skia/gm/tiledscaledbitmap.cpp -FILE: ../../../third_party/skia/gm/variedtext.cpp -FILE: ../../../third_party/skia/gm/yuvtorgbeffect.cpp -FILE: ../../../third_party/skia/include/c/sk_canvas.h -FILE: ../../../third_party/skia/include/c/sk_data.h -FILE: ../../../third_party/skia/include/c/sk_image.h -FILE: ../../../third_party/skia/include/c/sk_maskfilter.h -FILE: ../../../third_party/skia/include/c/sk_matrix.h -FILE: ../../../third_party/skia/include/c/sk_paint.h -FILE: ../../../third_party/skia/include/c/sk_path.h -FILE: ../../../third_party/skia/include/c/sk_picture.h -FILE: ../../../third_party/skia/include/c/sk_shader.h -FILE: ../../../third_party/skia/include/c/sk_surface.h -FILE: ../../../third_party/skia/include/c/sk_types.h -FILE: ../../../third_party/skia/include/core/SkBBHFactory.h -FILE: ../../../third_party/skia/include/core/SkBlurTypes.h -FILE: ../../../third_party/skia/include/core/SkDrawable.h -FILE: ../../../third_party/skia/include/core/SkFont.h -FILE: ../../../third_party/skia/include/core/SkMultiPictureDraw.h -FILE: ../../../third_party/skia/include/core/SkPictureRecorder.h -FILE: ../../../third_party/skia/include/core/SkSurfaceProps.h -FILE: ../../../third_party/skia/include/core/SkTextBlob.h -FILE: ../../../third_party/skia/include/gpu/GrGpuResource.h -FILE: ../../../third_party/skia/include/gpu/GrResourceKey.h -FILE: ../../../third_party/skia/include/gpu/gl/GrGLAssembleInterface.h -FILE: ../../../third_party/skia/include/ports/SkFontMgr_indirect.h -FILE: ../../../third_party/skia/include/ports/SkRemotableFontMgr.h -FILE: ../../../third_party/skia/samplecode/SampleHT.cpp -FILE: ../../../third_party/skia/samplecode/SampleIdentityScale.cpp -FILE: ../../../third_party/skia/samplecode/SampleRectanizer.cpp -FILE: ../../../third_party/skia/samplecode/SampleSubpixelTranslate.cpp -FILE: ../../../third_party/skia/src/c/sk_surface.cpp -FILE: ../../../third_party/skia/src/core/SkBBHFactory.cpp -FILE: ../../../third_party/skia/src/core/SkBitmapCache.cpp -FILE: ../../../third_party/skia/src/core/SkBitmapCache.h -FILE: ../../../third_party/skia/src/core/SkBlitMask_D32.cpp -FILE: ../../../third_party/skia/src/core/SkCachedData.cpp -FILE: ../../../third_party/skia/src/core/SkCachedData.h -FILE: ../../../third_party/skia/src/core/SkCanvasPriv.h -FILE: ../../../third_party/skia/src/core/SkConvertPixels.cpp -FILE: ../../../third_party/skia/src/core/SkDistanceFieldGen.cpp -FILE: ../../../third_party/skia/src/core/SkDistanceFieldGen.h -FILE: ../../../third_party/skia/src/core/SkDrawable.cpp -FILE: ../../../third_party/skia/src/core/SkFont.cpp -FILE: ../../../third_party/skia/src/core/SkForceCPlusPlusLinking.cpp -FILE: ../../../third_party/skia/src/core/SkHalf.cpp -FILE: ../../../third_party/skia/src/core/SkHalf.h -FILE: ../../../third_party/skia/src/core/SkImageGenerator.cpp -FILE: ../../../third_party/skia/src/core/SkMaskCache.cpp -FILE: ../../../third_party/skia/src/core/SkMaskCache.h -FILE: ../../../third_party/skia/src/core/SkMultiPictureDraw.cpp -FILE: ../../../third_party/skia/src/core/SkPicturePlayback.cpp -FILE: ../../../third_party/skia/src/core/SkPicturePlayback.h -FILE: ../../../third_party/skia/src/core/SkPictureRecorder.cpp -FILE: ../../../third_party/skia/src/core/SkRecord.h -FILE: ../../../third_party/skia/src/core/SkRecordDraw.cpp -FILE: ../../../third_party/skia/src/core/SkRecordDraw.h -FILE: ../../../third_party/skia/src/core/SkRecordOpts.cpp -FILE: ../../../third_party/skia/src/core/SkRecordOpts.h -FILE: ../../../third_party/skia/src/core/SkRecorder.cpp -FILE: ../../../third_party/skia/src/core/SkRecorder.h -FILE: ../../../third_party/skia/src/core/SkRecords.h -FILE: ../../../third_party/skia/src/core/SkSurfacePriv.h -FILE: ../../../third_party/skia/src/core/SkTaskGroup.cpp -FILE: ../../../third_party/skia/src/core/SkTaskGroup.h -FILE: ../../../third_party/skia/src/core/SkTextBlob.cpp -FILE: ../../../third_party/skia/src/core/SkTextMapStateProc.h -FILE: ../../../third_party/skia/src/core/SkVertState.cpp -FILE: ../../../third_party/skia/src/core/SkVertState.h -FILE: ../../../third_party/skia/src/fonts/SkFontMgr_indirect.cpp -FILE: ../../../third_party/skia/src/fonts/SkRemotableFontMgr.cpp -FILE: ../../../third_party/skia/src/gpu/GrDefaultGeoProcFactory.cpp -FILE: ../../../third_party/skia/src/gpu/GrDefaultGeoProcFactory.h -FILE: ../../../third_party/skia/src/gpu/GrFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/GrGpuResourceCacheAccess.h -FILE: ../../../third_party/skia/src/gpu/GrGpuResourceRef.cpp -FILE: ../../../third_party/skia/src/gpu/GrGpuResourceRef.h -FILE: ../../../third_party/skia/src/gpu/GrPathRendering.cpp -FILE: ../../../third_party/skia/src/gpu/GrPathRendering.h -FILE: ../../../third_party/skia/src/gpu/GrPendingProgramElement.h -FILE: ../../../third_party/skia/src/gpu/GrPrimitiveProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/GrProcessorAnalysis.cpp -FILE: ../../../third_party/skia/src/gpu/GrProcessorAnalysis.h -FILE: ../../../third_party/skia/src/gpu/GrProgramDesc.h -FILE: ../../../third_party/skia/src/gpu/GrProgramElement.h -FILE: ../../../third_party/skia/src/gpu/GrRectanizer_pow2.h -FILE: ../../../third_party/skia/src/gpu/GrRectanizer_skyline.h -FILE: ../../../third_party/skia/src/gpu/GrResourceCache.cpp -FILE: ../../../third_party/skia/src/gpu/GrResourceCache.h -FILE: ../../../third_party/skia/src/gpu/GrSKSLPrettyPrint.cpp -FILE: ../../../third_party/skia/src/gpu/GrSKSLPrettyPrint.h -FILE: ../../../third_party/skia/src/gpu/GrSurfacePriv.h -FILE: ../../../third_party/skia/src/gpu/GrTRecorder.h -FILE: ../../../third_party/skia/src/gpu/GrTexturePriv.h -FILE: ../../../third_party/skia/src/gpu/GrTracing.h -FILE: ../../../third_party/skia/src/gpu/GrXferProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrBicubicEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrConvexPolyEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrConvexPolyEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrCoverageSetOpXP.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrCoverageSetOpXP.h -FILE: ../../../third_party/skia/src/gpu/effects/GrDisableColorXP.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrDisableColorXP.h -FILE: ../../../third_party/skia/src/gpu/effects/GrMatrixConvolutionEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrMatrixConvolutionEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrOvalEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrOvalEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrPorterDuffXferProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrRRectEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrRRectEffect.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLAssembleInterface.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLPathRendering.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLPathRendering.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLTextureRenderTarget.h -FILE: ../../../third_party/skia/src/gpu/gl/android/GrGLMakeNativeInterface_android.cpp -FILE: ../../../third_party/skia/src/gpu/gl/builders/GrGLProgramBuilder.cpp -FILE: ../../../third_party/skia/src/gpu/gl/builders/GrGLProgramBuilder.h -FILE: ../../../third_party/skia/src/gpu/gl/builders/GrGLShaderStringBuilder.cpp -FILE: ../../../third_party/skia/src/gpu/gl/builders/GrGLShaderStringBuilder.h -FILE: ../../../third_party/skia/src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp -FILE: ../../../third_party/skia/src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp -FILE: ../../../third_party/skia/src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLGeometryProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLShaderBuilder.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLShaderBuilder.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLXferProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrDashOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrDashOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.h -FILE: ../../../third_party/skia/src/image/SkReadPixelsRec.h -FILE: ../../../third_party/skia/src/image/SkSurface_Gpu.h -FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_matrix_neon.h -FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts_arm.cpp -FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts_none.cpp -FILE: ../../../third_party/skia/src/pathops/SkOpBuilder.cpp -FILE: ../../../third_party/skia/src/pathops/SkOpSpan.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsTSect.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsTSect.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsTightBounds.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_android.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_fontconfig.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp -FILE: ../../../third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp -FILE: ../../../third_party/skia/src/ports/SkScalerContext_win_dw.h -FILE: ../../../third_party/skia/src/ports/SkTypeface_win_dw.cpp -FILE: ../../../third_party/skia/src/ports/SkTypeface_win_dw.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_EBDT.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_EBLC.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_EBSC.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_gasp.h -FILE: ../../../third_party/skia/src/shaders/SkLocalMatrixShader.cpp -FILE: ../../../third_party/skia/src/shaders/SkLocalMatrixShader.h -FILE: ../../../third_party/skia/src/shaders/SkPictureShader.cpp -FILE: ../../../third_party/skia/src/shaders/SkPictureShader.h -FILE: ../../../third_party/skia/src/shaders/gradients/SkTwoPointConicalGradient_gpu.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/SkTwoPointConicalGradient_gpu.h -FILE: ../../../third_party/skia/src/utils/SkDashPath.cpp -FILE: ../../../third_party/skia/src/utils/SkDashPathPriv.h -FILE: ../../../third_party/skia/src/utils/SkEventTracer.cpp -FILE: ../../../third_party/skia/src/utils/SkMatrix22.cpp -FILE: ../../../third_party/skia/src/utils/SkMatrix22.h -FILE: ../../../third_party/skia/src/utils/SkPatchUtils.cpp -FILE: ../../../third_party/skia/src/utils/SkPatchUtils.h -FILE: ../../../third_party/skia/src/utils/win/SkDWrite.cpp -FILE: ../../../third_party/skia/src/utils/win/SkDWrite.h ----------------------------------------------------------------------------------------------------- -Copyright 2014 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/bench/BenchLogger.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/bench/BenchLogger.cpp -FILE: ../../../third_party/skia/bench/BenchLogger.h -FILE: ../../../third_party/skia/bench/ChecksumBench.cpp -FILE: ../../../third_party/skia/bench/GameBench.cpp -FILE: ../../../third_party/skia/bench/GrMemoryPoolBench.cpp -FILE: ../../../third_party/skia/bench/LineBench.cpp -FILE: ../../../third_party/skia/bench/Matrix44Bench.cpp -FILE: ../../../third_party/skia/bench/MatrixConvolutionBench.cpp -FILE: ../../../third_party/skia/bench/MorphologyBench.cpp -FILE: ../../../third_party/skia/bench/RTreeBench.cpp -FILE: ../../../third_party/skia/bench/RefCntBench.cpp -FILE: ../../../third_party/skia/bench/TableBench.cpp -FILE: ../../../third_party/skia/gm/bigmatrix.cpp -FILE: ../../../third_party/skia/gm/blurrect.cpp -FILE: ../../../third_party/skia/gm/colorfilterimagefilter.cpp -FILE: ../../../third_party/skia/gm/composeshader.cpp -FILE: ../../../third_party/skia/gm/dashcubics.cpp -FILE: ../../../third_party/skia/gm/dashing.cpp -FILE: ../../../third_party/skia/gm/distantclip.cpp -FILE: ../../../third_party/skia/gm/fatpathfill.cpp -FILE: ../../../third_party/skia/gm/getpostextpath.cpp -FILE: ../../../third_party/skia/gm/imagefiltersgraph.cpp -FILE: ../../../third_party/skia/gm/imagemagnifier.cpp -FILE: ../../../third_party/skia/gm/lighting.cpp -FILE: ../../../third_party/skia/gm/matrixconvolution.cpp -FILE: ../../../third_party/skia/gm/modecolorfilters.cpp -FILE: ../../../third_party/skia/gm/morphology.cpp -FILE: ../../../third_party/skia/gm/patheffects.cpp -FILE: ../../../third_party/skia/gm/pathinterior.cpp -FILE: ../../../third_party/skia/gm/rrect.cpp -FILE: ../../../third_party/skia/gm/rrects.cpp -FILE: ../../../third_party/skia/gm/samplerstress.cpp -FILE: ../../../third_party/skia/gm/simpleaaclip.cpp -FILE: ../../../third_party/skia/gm/srcmode.cpp -FILE: ../../../third_party/skia/gm/strokerect.cpp -FILE: ../../../third_party/skia/gm/typeface.cpp -FILE: ../../../third_party/skia/gm/verylargebitmap.cpp -FILE: ../../../third_party/skia/include/core/SkAnnotation.h -FILE: ../../../third_party/skia/include/core/SkImage.h -FILE: ../../../third_party/skia/include/core/SkRRect.h -FILE: ../../../third_party/skia/include/core/SkStrokeRec.h -FILE: ../../../third_party/skia/include/core/SkSurface.h -FILE: ../../../third_party/skia/include/gpu/GrSurface.h -FILE: ../../../third_party/skia/include/gpu/gl/GrGLFunctions.h -FILE: ../../../third_party/skia/include/pathops/SkPathOps.h -FILE: ../../../third_party/skia/include/private/SkChecksum.h -FILE: ../../../third_party/skia/include/private/SkPathRef.h -FILE: ../../../third_party/skia/include/private/SkTInternalLList.h -FILE: ../../../third_party/skia/include/private/SkWeakRefCnt.h -FILE: ../../../third_party/skia/include/utils/SkNullCanvas.h -FILE: ../../../third_party/skia/samplecode/SampleAnimBlur.cpp -FILE: ../../../third_party/skia/samplecode/SampleFatBits.cpp -FILE: ../../../third_party/skia/samplecode/SampleQuadStroker.cpp -FILE: ../../../third_party/skia/src/codec/SkColorTable.h -FILE: ../../../third_party/skia/src/core/SkAnnotation.cpp -FILE: ../../../third_party/skia/src/core/SkBBoxHierarchy.h -FILE: ../../../third_party/skia/src/core/SkFontDescriptor.cpp -FILE: ../../../third_party/skia/src/core/SkFontDescriptor.h -FILE: ../../../third_party/skia/src/core/SkImagePriv.h -FILE: ../../../third_party/skia/src/core/SkMD5.cpp -FILE: ../../../third_party/skia/src/core/SkMD5.h -FILE: ../../../third_party/skia/src/core/SkMaskGamma.cpp -FILE: ../../../third_party/skia/src/core/SkMaskGamma.h -FILE: ../../../third_party/skia/src/core/SkMathPriv.h -FILE: ../../../third_party/skia/src/core/SkPaintDefaults.h -FILE: ../../../third_party/skia/src/core/SkRRect.cpp -FILE: ../../../third_party/skia/src/core/SkRTree.cpp -FILE: ../../../third_party/skia/src/core/SkRTree.h -FILE: ../../../third_party/skia/src/core/SkReadBuffer.cpp -FILE: ../../../third_party/skia/src/core/SkStrokeRec.cpp -FILE: ../../../third_party/skia/src/core/SkTLList.h -FILE: ../../../third_party/skia/src/core/SkTLS.cpp -FILE: ../../../third_party/skia/src/core/SkTLS.h -FILE: ../../../third_party/skia/src/core/SkTextToPathIter.h -FILE: ../../../third_party/skia/src/core/SkWriteBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/GrMemoryPool.cpp -FILE: ../../../third_party/skia/src/gpu/GrMemoryPool.h -FILE: ../../../third_party/skia/src/gpu/GrPath.cpp -FILE: ../../../third_party/skia/src/gpu/GrPath.h -FILE: ../../../third_party/skia/src/gpu/GrProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/GrProcessor.h -FILE: ../../../third_party/skia/src/gpu/GrProcessorUnitTest.h -FILE: ../../../third_party/skia/src/gpu/GrSWMaskHelper.cpp -FILE: ../../../third_party/skia/src/gpu/GrSWMaskHelper.h -FILE: ../../../third_party/skia/src/gpu/GrShaderCaps.cpp -FILE: ../../../third_party/skia/src/gpu/GrShaderCaps.h -FILE: ../../../third_party/skia/src/gpu/GrSoftwarePathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/GrSoftwarePathRenderer.h -FILE: ../../../third_party/skia/src/gpu/GrSurface.cpp -FILE: ../../../third_party/skia/src/gpu/GrTextureStripAtlas.h -FILE: ../../../third_party/skia/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrTextureDomain.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrTextureDomain.h -FILE: ../../../third_party/skia/src/gpu/effects/GrTextureStripAtlas.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLCaps.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLCaps.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLPath.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLPath.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLProgramDataManager.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLProgramDataManager.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLUtil.h -FILE: ../../../third_party/skia/src/gpu/ops/GrAAConvexPathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrAAConvexPathRenderer.h -FILE: ../../../third_party/skia/src/gpu/ops/GrStencilAndCoverPathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrStencilAndCoverPathRenderer.h -FILE: ../../../third_party/skia/src/image/SkImage.cpp -FILE: ../../../third_party/skia/src/image/SkImage_Base.h -FILE: ../../../third_party/skia/src/image/SkImage_Gpu.cpp -FILE: ../../../third_party/skia/src/image/SkImage_Raster.cpp -FILE: ../../../third_party/skia/src/image/SkSurface.cpp -FILE: ../../../third_party/skia/src/image/SkSurface_Base.h -FILE: ../../../third_party/skia/src/image/SkSurface_Gpu.cpp -FILE: ../../../third_party/skia/src/image/SkSurface_Raster.cpp -FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_arm_neon.cpp -FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.h -FILE: ../../../third_party/skia/src/pathops/SkAddIntersections.cpp -FILE: ../../../third_party/skia/src/pathops/SkAddIntersections.h -FILE: ../../../third_party/skia/src/pathops/SkDCubicLineIntersection.cpp -FILE: ../../../third_party/skia/src/pathops/SkDLineIntersection.cpp -FILE: ../../../third_party/skia/src/pathops/SkDQuadLineIntersection.cpp -FILE: ../../../third_party/skia/src/pathops/SkIntersectionHelper.h -FILE: ../../../third_party/skia/src/pathops/SkIntersections.cpp -FILE: ../../../third_party/skia/src/pathops/SkIntersections.h -FILE: ../../../third_party/skia/src/pathops/SkLineParameters.h -FILE: ../../../third_party/skia/src/pathops/SkOpAngle.cpp -FILE: ../../../third_party/skia/src/pathops/SkOpAngle.h -FILE: ../../../third_party/skia/src/pathops/SkOpCubicHull.cpp -FILE: ../../../third_party/skia/src/pathops/SkOpEdgeBuilder.cpp -FILE: ../../../third_party/skia/src/pathops/SkOpEdgeBuilder.h -FILE: ../../../third_party/skia/src/pathops/SkOpSegment.cpp -FILE: ../../../third_party/skia/src/pathops/SkOpSegment.h -FILE: ../../../third_party/skia/src/pathops/SkOpSpan.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsBounds.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsCommon.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsCommon.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsCubic.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsCubic.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsCurve.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsLine.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsLine.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsOp.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsPoint.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsPoint.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsQuad.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsQuad.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsRect.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsRect.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsSimplify.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsTypes.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsTypes.h -FILE: ../../../third_party/skia/src/pathops/SkPathWriter.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathWriter.h -FILE: ../../../third_party/skia/src/pathops/SkReduceOrder.cpp -FILE: ../../../third_party/skia/src/pathops/SkReduceOrder.h -FILE: ../../../third_party/skia/src/sfnt/SkIBMFamilyClass.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTableTypes.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V0.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V1.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V2.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V3.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_V4.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_OS_2_VA.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_glyf.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_head.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_hhea.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_loca.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_maxp.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_maxp_CFF.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_maxp_TT.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_name.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_post.h -FILE: ../../../third_party/skia/src/sfnt/SkOTUtils.cpp -FILE: ../../../third_party/skia/src/sfnt/SkOTUtils.h -FILE: ../../../third_party/skia/src/sfnt/SkPanose.h -FILE: ../../../third_party/skia/src/sfnt/SkSFNTHeader.h -FILE: ../../../third_party/skia/src/shaders/gradients/SkGradientShaderPriv.h -FILE: ../../../third_party/skia/src/shaders/gradients/SkLinearGradient.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/SkLinearGradient.h -FILE: ../../../third_party/skia/src/shaders/gradients/SkRadialGradient.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/SkRadialGradient.h -FILE: ../../../third_party/skia/src/shaders/gradients/SkSweepGradient.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/SkSweepGradient.h -FILE: ../../../third_party/skia/src/shaders/gradients/SkTwoPointConicalGradient.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/SkTwoPointConicalGradient.h -FILE: ../../../third_party/skia/src/utils/SkFloatUtils.h -FILE: ../../../third_party/skia/src/utils/SkNullCanvas.cpp -FILE: ../../../third_party/skia/src/utils/mac/SkStream_mac.cpp -FILE: ../../../third_party/skia/src/utils/win/SkDWriteFontFileStream.cpp -FILE: ../../../third_party/skia/src/utils/win/SkDWriteFontFileStream.h -FILE: ../../../third_party/skia/src/utils/win/SkDWriteGeometrySink.cpp -FILE: ../../../third_party/skia/src/utils/win/SkDWriteGeometrySink.h ----------------------------------------------------------------------------------------------------- -Copyright 2012 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/bench/BigPathBench.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/bench/BigPathBench.cpp -FILE: ../../../third_party/skia/bench/BitmapRegionDecoderBench.cpp -FILE: ../../../third_party/skia/bench/BitmapRegionDecoderBench.h -FILE: ../../../third_party/skia/bench/CodecBench.cpp -FILE: ../../../third_party/skia/bench/CodecBench.h -FILE: ../../../third_party/skia/bench/CodecBenchPriv.h -FILE: ../../../third_party/skia/bench/ControlBench.cpp -FILE: ../../../third_party/skia/bench/DrawBitmapAABench.cpp -FILE: ../../../third_party/skia/bench/ImageBench.cpp -FILE: ../../../third_party/skia/bench/InterpBench.cpp -FILE: ../../../third_party/skia/bench/MathBench.cpp -FILE: ../../../third_party/skia/bench/MipMapBench.cpp -FILE: ../../../third_party/skia/bench/PictureOverheadBench.cpp -FILE: ../../../third_party/skia/bench/SKPAnimationBench.cpp -FILE: ../../../third_party/skia/bench/SKPAnimationBench.h -FILE: ../../../third_party/skia/bench/Sk4fBench.cpp -FILE: ../../../third_party/skia/bench/SkGlyphCacheBench.cpp -FILE: ../../../third_party/skia/bench/StrokeBench.cpp -FILE: ../../../third_party/skia/bench/TextBlobBench.cpp -FILE: ../../../third_party/skia/bench/TopoSortBench.cpp -FILE: ../../../third_party/skia/bench/nanobench.h -FILE: ../../../third_party/skia/dm/DMSrcSink.cpp -FILE: ../../../third_party/skia/dm/DMSrcSink.h -FILE: ../../../third_party/skia/example/SkiaSDLExample.cpp -FILE: ../../../third_party/skia/experimental/c-api-example/skia-c-example.c -FILE: ../../../third_party/skia/experimental/go-demo/main.go -FILE: ../../../third_party/skia/experimental/go-skia/ctypes.go -FILE: ../../../third_party/skia/experimental/go-skia/skia.go -FILE: ../../../third_party/skia/experimental/go-skia/types.go -FILE: ../../../third_party/skia/experimental/tools/coreGraphicsPdf2png.cpp -FILE: ../../../third_party/skia/gm/SkAnimTimer.h -FILE: ../../../third_party/skia/gm/aaxfermodes.cpp -FILE: ../../../third_party/skia/gm/addarc.cpp -FILE: ../../../third_party/skia/gm/all_bitmap_configs.cpp -FILE: ../../../third_party/skia/gm/anisotropic.cpp -FILE: ../../../third_party/skia/gm/annotated_text.cpp -FILE: ../../../third_party/skia/gm/badpaint.cpp -FILE: ../../../third_party/skia/gm/bigrrectaaeffect.cpp -FILE: ../../../third_party/skia/gm/bigtileimagefilter.cpp -FILE: ../../../third_party/skia/gm/blend.cpp -FILE: ../../../third_party/skia/gm/blurredclippedcircle.cpp -FILE: ../../../third_party/skia/gm/bmpfilterqualityrepeat.cpp -FILE: ../../../third_party/skia/gm/concavepaths.cpp -FILE: ../../../third_party/skia/gm/constcolorprocessor.cpp -FILE: ../../../third_party/skia/gm/convex_all_line_paths.cpp -FILE: ../../../third_party/skia/gm/draw_bitmap_rect_skbug4374.cpp -FILE: ../../../third_party/skia/gm/drawable.cpp -FILE: ../../../third_party/skia/gm/drawatlas.cpp -FILE: ../../../third_party/skia/gm/drawatlascolor.cpp -FILE: ../../../third_party/skia/gm/drawminibitmaprect.cpp -FILE: ../../../third_party/skia/gm/fadefilter.cpp -FILE: ../../../third_party/skia/gm/fontscalerdistortable.cpp -FILE: ../../../third_party/skia/gm/gamma.cpp -FILE: ../../../third_party/skia/gm/image_pict.cpp -FILE: ../../../third_party/skia/gm/image_shader.cpp -FILE: ../../../third_party/skia/gm/imagefilters.cpp -FILE: ../../../third_party/skia/gm/imagefiltersstroked.cpp -FILE: ../../../third_party/skia/gm/imagefilterstransformed.cpp -FILE: ../../../third_party/skia/gm/imagefromyuvtextures.cpp -FILE: ../../../third_party/skia/gm/imagescalealigned.cpp -FILE: ../../../third_party/skia/gm/imagesource2.cpp -FILE: ../../../third_party/skia/gm/largeglyphblur.cpp -FILE: ../../../third_party/skia/gm/lcdblendmodes.cpp -FILE: ../../../third_party/skia/gm/lcdoverlap.cpp -FILE: ../../../third_party/skia/gm/lightingshader.cpp -FILE: ../../../third_party/skia/gm/localmatriximagefilter.cpp -FILE: ../../../third_party/skia/gm/localmatriximageshader.cpp -FILE: ../../../third_party/skia/gm/mipmap.cpp -FILE: ../../../third_party/skia/gm/path_stroke_with_zero_length.cpp -FILE: ../../../third_party/skia/gm/pathcontourstart.cpp -FILE: ../../../third_party/skia/gm/pdf_never_embed.cpp -FILE: ../../../third_party/skia/gm/perspshaders.cpp -FILE: ../../../third_party/skia/gm/pictureimagegenerator.cpp -FILE: ../../../third_party/skia/gm/pixelsnap.cpp -FILE: ../../../third_party/skia/gm/plus.cpp -FILE: ../../../third_party/skia/gm/repeated_bitmap.cpp -FILE: ../../../third_party/skia/gm/scaledstrokes.cpp -FILE: ../../../third_party/skia/gm/skbug_257.cpp -FILE: ../../../third_party/skia/gm/smallpaths.cpp -FILE: ../../../third_party/skia/gm/stlouisarch.cpp -FILE: ../../../third_party/skia/gm/textblobcolortrans.cpp -FILE: ../../../third_party/skia/gm/textblobgeometrychange.cpp -FILE: ../../../third_party/skia/gm/textblobmixedsizes.cpp -FILE: ../../../third_party/skia/gm/textblobrandomfont.cpp -FILE: ../../../third_party/skia/gm/textblobtransforms.cpp -FILE: ../../../third_party/skia/gm/textblobuseaftergpufree.cpp -FILE: ../../../third_party/skia/gm/transparency.cpp -FILE: ../../../third_party/skia/include/android/SkBRDAllocator.h -FILE: ../../../third_party/skia/include/android/SkBitmapRegionDecoder.h -FILE: ../../../third_party/skia/include/codec/SkAndroidCodec.h -FILE: ../../../third_party/skia/include/codec/SkCodec.h -FILE: ../../../third_party/skia/include/core/SkEncodedImageFormat.h -FILE: ../../../third_party/skia/include/core/SkFilterQuality.h -FILE: ../../../third_party/skia/include/core/SkLights.h -FILE: ../../../third_party/skia/include/core/SkPixmap.h -FILE: ../../../third_party/skia/include/core/SkPngChunkReader.h -FILE: ../../../third_party/skia/include/core/SkPoint3.h -FILE: ../../../third_party/skia/include/core/SkRSXform.h -FILE: ../../../third_party/skia/include/core/SkRWBuffer.h -FILE: ../../../third_party/skia/include/core/SkTraceMemoryDump.h -FILE: ../../../third_party/skia/include/effects/SkImageSource.h -FILE: ../../../third_party/skia/include/effects/SkTableColorFilter.h -FILE: ../../../third_party/skia/include/gpu/GrContextOptions.h -FILE: ../../../third_party/skia/include/gpu/GrSamplerState.h -FILE: ../../../third_party/skia/include/gpu/gl/GrGLTypes.h -FILE: ../../../third_party/skia/include/gpu/vk/GrVkInterface.h -FILE: ../../../third_party/skia/include/ports/SkFontMgr_android.h -FILE: ../../../third_party/skia/include/ports/SkFontMgr_directory.h -FILE: ../../../third_party/skia/include/ports/SkFontMgr_empty.h -FILE: ../../../third_party/skia/include/ports/SkFontMgr_fontconfig.h -FILE: ../../../third_party/skia/include/private/SkAtomics.h -FILE: ../../../third_party/skia/include/private/SkMutex.h -FILE: ../../../third_party/skia/include/private/SkSemaphore.h -FILE: ../../../third_party/skia/include/private/SkSpinlock.h -FILE: ../../../third_party/skia/include/private/SkTHash.h -FILE: ../../../third_party/skia/include/private/SkThreadID.h -FILE: ../../../third_party/skia/include/svg/SkSVGCanvas.h -FILE: ../../../third_party/skia/include/utils/SkPaintFilterCanvas.h -FILE: ../../../third_party/skia/samplecode/PerlinPatch.cpp -FILE: ../../../third_party/skia/samplecode/SampleAAGeometry.cpp -FILE: ../../../third_party/skia/samplecode/SampleAnimatedText.cpp -FILE: ../../../third_party/skia/samplecode/SampleAtlas.cpp -FILE: ../../../third_party/skia/samplecode/SampleClipDrawMatch.cpp -FILE: ../../../third_party/skia/samplecode/SampleFilterQuality.cpp -FILE: ../../../third_party/skia/samplecode/SampleLighting.cpp -FILE: ../../../third_party/skia/samplecode/SamplePathFuzz.cpp -FILE: ../../../third_party/skia/samplecode/SampleShip.cpp -FILE: ../../../third_party/skia/samplecode/SampleXfer.cpp -FILE: ../../../third_party/skia/src/android/SkBitmapRegionCodec.cpp -FILE: ../../../third_party/skia/src/android/SkBitmapRegionCodec.h -FILE: ../../../third_party/skia/src/android/SkBitmapRegionDecoder.cpp -FILE: ../../../third_party/skia/src/android/SkBitmapRegionDecoderPriv.h -FILE: ../../../third_party/skia/src/c/sk_c_from_to.h -FILE: ../../../third_party/skia/src/c/sk_paint.cpp -FILE: ../../../third_party/skia/src/c/sk_types_priv.h -FILE: ../../../third_party/skia/src/codec/SkAndroidCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkBmpCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkBmpCodec.h -FILE: ../../../third_party/skia/src/codec/SkBmpMaskCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkBmpMaskCodec.h -FILE: ../../../third_party/skia/src/codec/SkBmpRLECodec.cpp -FILE: ../../../third_party/skia/src/codec/SkBmpRLECodec.h -FILE: ../../../third_party/skia/src/codec/SkBmpStandardCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkBmpStandardCodec.h -FILE: ../../../third_party/skia/src/codec/SkCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkCodecImageGenerator.cpp -FILE: ../../../third_party/skia/src/codec/SkCodecImageGenerator.h -FILE: ../../../third_party/skia/src/codec/SkGifCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkGifCodec.h -FILE: ../../../third_party/skia/src/codec/SkIcoCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkIcoCodec.h -FILE: ../../../third_party/skia/src/codec/SkJpegCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkJpegCodec.h -FILE: ../../../third_party/skia/src/codec/SkJpegDecoderMgr.cpp -FILE: ../../../third_party/skia/src/codec/SkJpegDecoderMgr.h -FILE: ../../../third_party/skia/src/codec/SkJpegUtility.cpp -FILE: ../../../third_party/skia/src/codec/SkJpegUtility.h -FILE: ../../../third_party/skia/src/codec/SkMaskSwizzler.cpp -FILE: ../../../third_party/skia/src/codec/SkMaskSwizzler.h -FILE: ../../../third_party/skia/src/codec/SkMasks.cpp -FILE: ../../../third_party/skia/src/codec/SkMasks.h -FILE: ../../../third_party/skia/src/codec/SkPngCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkPngCodec.h -FILE: ../../../third_party/skia/src/codec/SkSampledCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkSampledCodec.h -FILE: ../../../third_party/skia/src/codec/SkSampler.cpp -FILE: ../../../third_party/skia/src/codec/SkSampler.h -FILE: ../../../third_party/skia/src/codec/SkSwizzler.cpp -FILE: ../../../third_party/skia/src/codec/SkSwizzler.h -FILE: ../../../third_party/skia/src/codec/SkWbmpCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkWbmpCodec.h -FILE: ../../../third_party/skia/src/codec/SkWebpAdapterCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkWebpAdapterCodec.h -FILE: ../../../third_party/skia/src/codec/SkWebpCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkWebpCodec.h -FILE: ../../../third_party/skia/src/core/Sk4px.h -FILE: ../../../third_party/skia/src/core/SkBigPicture.cpp -FILE: ../../../third_party/skia/src/core/SkBigPicture.h -FILE: ../../../third_party/skia/src/core/SkBitmapController.cpp -FILE: ../../../third_party/skia/src/core/SkBitmapController.h -FILE: ../../../third_party/skia/src/core/SkBitmapProvider.cpp -FILE: ../../../third_party/skia/src/core/SkBitmapProvider.h -FILE: ../../../third_party/skia/src/core/SkFindAndPlaceGlyph.h -FILE: ../../../third_party/skia/src/core/SkFontMgr.cpp -FILE: ../../../third_party/skia/src/core/SkImageCacherator.h -FILE: ../../../third_party/skia/src/core/SkLatticeIter.cpp -FILE: ../../../third_party/skia/src/core/SkLatticeIter.h -FILE: ../../../third_party/skia/src/core/SkLocalMatrixImageFilter.cpp -FILE: ../../../third_party/skia/src/core/SkMiniRecorder.cpp -FILE: ../../../third_party/skia/src/core/SkMiniRecorder.h -FILE: ../../../third_party/skia/src/core/SkNextID.h -FILE: ../../../third_party/skia/src/core/SkNx.h -FILE: ../../../third_party/skia/src/core/SkOpts.cpp -FILE: ../../../third_party/skia/src/core/SkOpts.h -FILE: ../../../third_party/skia/src/core/SkPathPriv.h -FILE: ../../../third_party/skia/src/core/SkPictureCommon.h -FILE: ../../../third_party/skia/src/core/SkPictureImageGenerator.cpp -FILE: ../../../third_party/skia/src/core/SkPictureImageGenerator.h -FILE: ../../../third_party/skia/src/core/SkPixmap.cpp -FILE: ../../../third_party/skia/src/core/SkPixmapPriv.h -FILE: ../../../third_party/skia/src/core/SkPoint3.cpp -FILE: ../../../third_party/skia/src/core/SkRWBuffer.cpp -FILE: ../../../third_party/skia/src/core/SkRecord.cpp -FILE: ../../../third_party/skia/src/core/SkRecordPattern.h -FILE: ../../../third_party/skia/src/core/SkRecords.cpp -FILE: ../../../third_party/skia/src/core/SkSemaphore.cpp -FILE: ../../../third_party/skia/src/core/SkSharedMutex.cpp -FILE: ../../../third_party/skia/src/core/SkSharedMutex.h -FILE: ../../../third_party/skia/src/core/SkSpinlock.cpp -FILE: ../../../third_party/skia/src/core/SkTDPQueue.h -FILE: ../../../third_party/skia/src/core/SkTTopoSort.h -FILE: ../../../third_party/skia/src/core/SkTextBlobRunIterator.h -FILE: ../../../third_party/skia/src/core/SkThreadID.cpp -FILE: ../../../third_party/skia/src/core/SkTime.cpp -FILE: ../../../third_party/skia/src/core/SkXfermodeInterpretation.cpp -FILE: ../../../third_party/skia/src/core/SkXfermodeInterpretation.h -FILE: ../../../third_party/skia/src/core/SkYUVPlanesCache.cpp -FILE: ../../../third_party/skia/src/core/SkYUVPlanesCache.h -FILE: ../../../third_party/skia/src/effects/SkTableColorFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkImageSource.cpp -FILE: ../../../third_party/skia/src/gpu/GrAutoLocaleSetter.h -FILE: ../../../third_party/skia/src/gpu/GrBlend.cpp -FILE: ../../../third_party/skia/src/gpu/GrBlurUtils.cpp -FILE: ../../../third_party/skia/src/gpu/GrBlurUtils.h -FILE: ../../../third_party/skia/src/gpu/GrCaps.cpp -FILE: ../../../third_party/skia/src/gpu/GrDrawOpAtlas.cpp -FILE: ../../../third_party/skia/src/gpu/GrDrawOpAtlas.h -FILE: ../../../third_party/skia/src/gpu/GrDrawOpTest.cpp -FILE: ../../../third_party/skia/src/gpu/GrDrawOpTest.h -FILE: ../../../third_party/skia/src/gpu/GrDrawingManager.cpp -FILE: ../../../third_party/skia/src/gpu/GrDrawingManager.h -FILE: ../../../third_party/skia/src/gpu/GrFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/GrGpuResourcePriv.h -FILE: ../../../third_party/skia/src/gpu/GrMesh.h -FILE: ../../../third_party/skia/src/gpu/GrNonAtomicRef.h -FILE: ../../../third_party/skia/src/gpu/GrOpFlushState.cpp -FILE: ../../../third_party/skia/src/gpu/GrOpFlushState.h -FILE: ../../../third_party/skia/src/gpu/GrPipeline.cpp -FILE: ../../../third_party/skia/src/gpu/GrPipeline.h -FILE: ../../../third_party/skia/src/gpu/GrProcessorUnitTest.cpp -FILE: ../../../third_party/skia/src/gpu/GrQuad.h -FILE: ../../../third_party/skia/src/gpu/GrRenderTargetContext.cpp -FILE: ../../../third_party/skia/src/gpu/GrRenderTargetContext.h -FILE: ../../../third_party/skia/src/gpu/GrRenderTargetPriv.h -FILE: ../../../third_party/skia/src/gpu/GrResourceProvider.cpp -FILE: ../../../third_party/skia/src/gpu/GrResourceProvider.h -FILE: ../../../third_party/skia/src/gpu/GrTessellator.cpp -FILE: ../../../third_party/skia/src/gpu/GrTessellator.h -FILE: ../../../third_party/skia/src/gpu/GrTestUtils.cpp -FILE: ../../../third_party/skia/src/gpu/GrTestUtils.h -FILE: ../../../third_party/skia/src/gpu/GrXferProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/GrYUVProvider.cpp -FILE: ../../../third_party/skia/src/gpu/GrYUVProvider.h -FILE: ../../../third_party/skia/src/gpu/SkGpuDevice_drawTexture.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrCustomXfermode.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrCustomXfermode.h -FILE: ../../../third_party/skia/src/gpu/effects/GrXfermodeFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrXfermodeFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLTextureRenderTarget.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLUniformHandler.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLUniformHandler.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLVaryingHandler.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLVaryingHandler.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLBlend.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLBlend.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLProgramBuilder.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLProgramBuilder.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLProgramDataManager.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLUniformHandler.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLUtil.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLUtil.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLVarying.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLVarying.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLXferProcessor.h -FILE: ../../../third_party/skia/src/gpu/ops/GrAAConvexTessellator.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrAAConvexTessellator.h -FILE: ../../../third_party/skia/src/gpu/ops/GrAAFillRectOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrAALinearizingConvexPathRenderer.h -FILE: ../../../third_party/skia/src/gpu/ops/GrAAStrokeRectOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrAtlasTextOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrAtlasTextOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrClearOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrCopySurfaceOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrCopySurfaceOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrDashLinePathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrDashLinePathRenderer.h -FILE: ../../../third_party/skia/src/gpu/ops/GrDrawAtlasOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrDrawAtlasOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrDrawOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrDrawPathOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrDrawPathOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrDrawVerticesOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrDrawVerticesOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrLatticeOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrLatticeOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrMeshDrawOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrMeshDrawOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrNonAAStrokeRectOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrStencilPathOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrTessellatingPathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrTessellatingPathRenderer.h -FILE: ../../../third_party/skia/src/gpu/text/GrDistanceFieldAdjustTable.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrDistanceFieldAdjustTable.h -FILE: ../../../third_party/skia/src/gpu/text/GrGlyphCache.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrGlyphCache.h -FILE: ../../../third_party/skia/src/gpu/text/GrTextBlob.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrTextBlob.h -FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobCache.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrTextBlobCache.h -FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrTextContext.h -FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.cpp -FILE: ../../../third_party/skia/src/gpu/text/GrTextUtils.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkBuffer.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkCaps.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkCaps.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkCommandBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkCommandBuffer.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpu.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkGpu.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkImage.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkImage.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkIndexBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkIndexBuffer.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkInterface.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkMemory.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkMemory.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkRenderPass.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkRenderPass.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkRenderTarget.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkRenderTarget.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkResource.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkStencilAttachment.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkStencilAttachment.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTexture.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTexture.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTextureRenderTarget.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTextureRenderTarget.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTransferBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkTransferBuffer.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkUniformBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkUniformBuffer.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkUtil.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkUtil.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkVertexBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkVertexBuffer.h -FILE: ../../../third_party/skia/src/image/SkImage_Gpu.h -FILE: ../../../third_party/skia/src/image/SkImage_Lazy.cpp -FILE: ../../../third_party/skia/src/opts/Sk4px_NEON.h -FILE: ../../../third_party/skia/src/opts/Sk4px_SSE2.h -FILE: ../../../third_party/skia/src/opts/Sk4px_none.h -FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts.h -FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts_arm_neon.cpp -FILE: ../../../third_party/skia/src/opts/SkBlitMask_opts_arm_neon.h -FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts.h -FILE: ../../../third_party/skia/src/opts/SkColor_opts_neon.h -FILE: ../../../third_party/skia/src/opts/SkMorphologyImageFilter_opts.h -FILE: ../../../third_party/skia/src/opts/SkNx_neon.h -FILE: ../../../third_party/skia/src/opts/SkNx_sse.h -FILE: ../../../third_party/skia/src/opts/SkOpts_sse41.cpp -FILE: ../../../third_party/skia/src/opts/SkOpts_ssse3.cpp -FILE: ../../../third_party/skia/src/opts/SkXfermode_opts.h -FILE: ../../../third_party/skia/src/pathops/SkDConicLineIntersection.cpp -FILE: ../../../third_party/skia/src/pathops/SkDCubicToQuads.cpp -FILE: ../../../third_party/skia/src/pathops/SkOpCoincidence.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsConic.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsConic.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsCurve.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsWinding.cpp -FILE: ../../../third_party/skia/src/pdf/SkDocument_PDF_None.cpp -FILE: ../../../third_party/skia/src/pdf/SkJpegInfo.cpp -FILE: ../../../third_party/skia/src/pdf/SkJpegInfo.h -FILE: ../../../third_party/skia/src/pdf/SkPDFBitmap.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFBitmap.h -FILE: ../../../third_party/skia/src/pdf/SkPDFCanon.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFCanon.h -FILE: ../../../third_party/skia/src/pdf/SkPDFMetadata.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFMetadata.h -FILE: ../../../third_party/skia/src/ports/SkFontMgr_android_factory.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_directory_factory.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_embedded_factory.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_fontconfig_factory.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_win_dw_factory.cpp -FILE: ../../../third_party/skia/src/ports/SkOSLibrary.h -FILE: ../../../third_party/skia/src/ports/SkOSLibrary_posix.cpp -FILE: ../../../third_party/skia/src/ports/SkOSLibrary_win.cpp -FILE: ../../../third_party/skia/src/shaders/SkImageShader.cpp -FILE: ../../../third_party/skia/src/shaders/SkImageShader.h -FILE: ../../../third_party/skia/src/shaders/SkLightingShader.cpp -FILE: ../../../third_party/skia/src/shaders/SkLightingShader.h -FILE: ../../../third_party/skia/src/svg/SkSVGCanvas.cpp -FILE: ../../../third_party/skia/src/svg/SkSVGDevice.cpp -FILE: ../../../third_party/skia/src/svg/SkSVGDevice.h -FILE: ../../../third_party/skia/src/utils/SkPaintFilterCanvas.cpp -FILE: ../../../third_party/skia/src/utils/SkWhitelistChecksums.inc -FILE: ../../../third_party/skia/src/utils/SkWhitelistTypefaces.cpp -FILE: ../../../third_party/skia/src/xps/SkXPSDocument.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2015 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/bench/BlendmodeBench.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/bench/BlendmodeBench.cpp -FILE: ../../../third_party/skia/bench/BlurImageFilterBench.cpp -FILE: ../../../third_party/skia/bench/BlurRectBench.cpp -FILE: ../../../third_party/skia/bench/BlurRoundRectBench.cpp -FILE: ../../../third_party/skia/bench/ChartBench.cpp -FILE: ../../../third_party/skia/bench/CmapBench.cpp -FILE: ../../../third_party/skia/bench/ColorFilterBench.cpp -FILE: ../../../third_party/skia/bench/ColorPrivBench.cpp -FILE: ../../../third_party/skia/bench/CoverageBench.cpp -FILE: ../../../third_party/skia/bench/DisplacementBench.cpp -FILE: ../../../third_party/skia/bench/FSRectBench.cpp -FILE: ../../../third_party/skia/bench/FontCacheBench.cpp -FILE: ../../../third_party/skia/bench/GrResourceCacheBench.cpp -FILE: ../../../third_party/skia/bench/HairlinePathBench.cpp -FILE: ../../../third_party/skia/bench/ImageCacheBench.cpp -FILE: ../../../third_party/skia/bench/LightingBench.cpp -FILE: ../../../third_party/skia/bench/MagnifierBench.cpp -FILE: ../../../third_party/skia/bench/MemsetBench.cpp -FILE: ../../../third_party/skia/bench/MergeBench.cpp -FILE: ../../../third_party/skia/bench/PerlinNoiseBench.cpp -FILE: ../../../third_party/skia/bench/PremulAndUnpremulAlphaOpsBench.cpp -FILE: ../../../third_party/skia/bench/RectoriBench.cpp -FILE: ../../../third_party/skia/bench/RegionContainBench.cpp -FILE: ../../../third_party/skia/bench/ResultsWriter.h -FILE: ../../../third_party/skia/bench/SortBench.cpp -FILE: ../../../third_party/skia/bench/TileBench.cpp -FILE: ../../../third_party/skia/bench/WritePixelsBench.cpp -FILE: ../../../third_party/skia/bench/gUniqueGlyphIDs.h -FILE: ../../../third_party/skia/dm/DM.cpp -FILE: ../../../third_party/skia/gm/alphagradients.cpp -FILE: ../../../third_party/skia/gm/arcofzorro.cpp -FILE: ../../../third_party/skia/gm/beziereffects.cpp -FILE: ../../../third_party/skia/gm/bigblurs.cpp -FILE: ../../../third_party/skia/gm/bigtext.cpp -FILE: ../../../third_party/skia/gm/bitmappremul.cpp -FILE: ../../../third_party/skia/gm/bitmaprecttest.cpp -FILE: ../../../third_party/skia/gm/bitmapshader.cpp -FILE: ../../../third_party/skia/gm/bleed.cpp -FILE: ../../../third_party/skia/gm/blurquickreject.cpp -FILE: ../../../third_party/skia/gm/blurroundrect.cpp -FILE: ../../../third_party/skia/gm/circularclips.cpp -FILE: ../../../third_party/skia/gm/clippedbitmapshaders.cpp -FILE: ../../../third_party/skia/gm/coloremoji.cpp -FILE: ../../../third_party/skia/gm/conicpaths.cpp -FILE: ../../../third_party/skia/gm/copyTo4444.cpp -FILE: ../../../third_party/skia/gm/displacement.cpp -FILE: ../../../third_party/skia/gm/downsamplebitmap.cpp -FILE: ../../../third_party/skia/gm/dropshadowimagefilter.cpp -FILE: ../../../third_party/skia/gm/dstreadshuffle.cpp -FILE: ../../../third_party/skia/gm/fontcache.cpp -FILE: ../../../third_party/skia/gm/fontmgr.cpp -FILE: ../../../third_party/skia/gm/gm_expectations.h -FILE: ../../../third_party/skia/gm/gradientDirtyLaundry.cpp -FILE: ../../../third_party/skia/gm/gradient_matrix.cpp -FILE: ../../../third_party/skia/gm/gradients_no_texture.cpp -FILE: ../../../third_party/skia/gm/hairlines.cpp -FILE: ../../../third_party/skia/gm/imagealphathreshold.cpp -FILE: ../../../third_party/skia/gm/imagesource.cpp -FILE: ../../../third_party/skia/gm/internal_links.cpp -FILE: ../../../third_party/skia/gm/inversepaths.cpp -FILE: ../../../third_party/skia/gm/lumafilter.cpp -FILE: ../../../third_party/skia/gm/megalooper.cpp -FILE: ../../../third_party/skia/gm/mixedtextblobs.cpp -FILE: ../../../third_party/skia/gm/nested.cpp -FILE: ../../../third_party/skia/gm/nonclosedpaths.cpp -FILE: ../../../third_party/skia/gm/offsetimagefilter.cpp -FILE: ../../../third_party/skia/gm/ovals.cpp -FILE: ../../../third_party/skia/gm/pathopsinverse.cpp -FILE: ../../../third_party/skia/gm/pathopsskpclip.cpp -FILE: ../../../third_party/skia/gm/perlinnoise.cpp -FILE: ../../../third_party/skia/gm/pictureimagefilter.cpp -FILE: ../../../third_party/skia/gm/polygons.cpp -FILE: ../../../third_party/skia/gm/rects.cpp -FILE: ../../../third_party/skia/gm/resizeimagefilter.cpp -FILE: ../../../third_party/skia/gm/roundrects.cpp -FILE: ../../../third_party/skia/gm/shallowgradient.cpp -FILE: ../../../third_party/skia/gm/skbug1719.cpp -FILE: ../../../third_party/skia/gm/spritebitmap.cpp -FILE: ../../../third_party/skia/gm/stringart.cpp -FILE: ../../../third_party/skia/gm/textbloblooper.cpp -FILE: ../../../third_party/skia/gm/thinrects.cpp -FILE: ../../../third_party/skia/gm/thinstrokedrects.cpp -FILE: ../../../third_party/skia/gm/tileimagefilter.cpp -FILE: ../../../third_party/skia/gm/vertices.cpp -FILE: ../../../third_party/skia/gm/xfermodeimagefilter.cpp -FILE: ../../../third_party/skia/gm/xfermodes2.cpp -FILE: ../../../third_party/skia/gm/xfermodes3.cpp -FILE: ../../../third_party/skia/include/core/SkDataTable.h -FILE: ../../../third_party/skia/include/core/SkDocument.h -FILE: ../../../third_party/skia/include/core/SkFontLCDConfig.h -FILE: ../../../third_party/skia/include/core/SkFontMgr.h -FILE: ../../../third_party/skia/include/core/SkFontStyle.h -FILE: ../../../third_party/skia/include/core/SkImageGenerator.h -FILE: ../../../third_party/skia/include/core/SkImageInfo.h -FILE: ../../../third_party/skia/include/effects/SkAlphaThresholdFilter.h -FILE: ../../../third_party/skia/include/effects/SkComposeImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkDisplacementMapEffect.h -FILE: ../../../third_party/skia/include/effects/SkDropShadowImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkLumaColorFilter.h -FILE: ../../../third_party/skia/include/effects/SkPerlinNoiseShader.h -FILE: ../../../third_party/skia/include/effects/SkTileImageFilter.h -FILE: ../../../third_party/skia/include/gpu/GrBlend.h -FILE: ../../../third_party/skia/include/gpu/gl/GrGLExtensions.h -FILE: ../../../third_party/skia/include/ports/SkFontConfigInterface.h -FILE: ../../../third_party/skia/include/private/GrTypesPriv.h -FILE: ../../../third_party/skia/include/private/SkMessageBus.h -FILE: ../../../third_party/skia/include/private/SkOnce.h -FILE: ../../../third_party/skia/include/private/SkTFitsIn.h -FILE: ../../../third_party/skia/include/private/SkTLogic.h -FILE: ../../../third_party/skia/include/utils/SkCanvasStateUtils.h -FILE: ../../../third_party/skia/include/utils/SkFrontBufferedStream.h -FILE: ../../../third_party/skia/include/utils/SkLua.h -FILE: ../../../third_party/skia/include/utils/SkLuaCanvas.h -FILE: ../../../third_party/skia/samplecode/SampleChart.cpp -FILE: ../../../third_party/skia/samplecode/SampleClock.cpp -FILE: ../../../third_party/skia/samplecode/SampleFilterFuzz.cpp -FILE: ../../../third_party/skia/samplecode/SampleLua.cpp -FILE: ../../../third_party/skia/samplecode/SampleManyRects.cpp -FILE: ../../../third_party/skia/samplecode/SamplePdfFileViewer.cpp -FILE: ../../../third_party/skia/samplecode/SampleStringArt.cpp -FILE: ../../../third_party/skia/samplecode/SampleUnpremul.cpp -FILE: ../../../third_party/skia/src/core/SkBitmapDevice.cpp -FILE: ../../../third_party/skia/src/core/SkBitmapDevice.h -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrix_template.h -FILE: ../../../third_party/skia/src/core/SkDataTable.cpp -FILE: ../../../third_party/skia/src/core/SkDiscardableMemory.h -FILE: ../../../third_party/skia/src/core/SkDocument.cpp -FILE: ../../../third_party/skia/src/core/SkDrawLooper.cpp -FILE: ../../../third_party/skia/src/core/SkFontStream.h -FILE: ../../../third_party/skia/src/core/SkGpuBlurUtils.cpp -FILE: ../../../third_party/skia/src/core/SkGpuBlurUtils.h -FILE: ../../../third_party/skia/src/core/SkMatrixUtils.h -FILE: ../../../third_party/skia/src/core/SkMipMap.cpp -FILE: ../../../third_party/skia/src/core/SkMipMap.h -FILE: ../../../third_party/skia/src/core/SkPaintPriv.cpp -FILE: ../../../third_party/skia/src/core/SkPaintPriv.h -FILE: ../../../third_party/skia/src/core/SkPathRef.cpp -FILE: ../../../third_party/skia/src/core/SkResourceCache.cpp -FILE: ../../../third_party/skia/src/core/SkResourceCache.h -FILE: ../../../third_party/skia/src/core/SkStreamPriv.h -FILE: ../../../third_party/skia/src/core/SkStringUtils.cpp -FILE: ../../../third_party/skia/src/core/SkStringUtils.h -FILE: ../../../third_party/skia/src/core/SkTDynamicHash.h -FILE: ../../../third_party/skia/src/core/SkTMultiMap.h -FILE: ../../../third_party/skia/src/core/SkTypefacePriv.h -FILE: ../../../third_party/skia/src/core/SkValidatingReadBuffer.h -FILE: ../../../third_party/skia/src/core/SkValidationUtils.h -FILE: ../../../third_party/skia/src/effects/SkLumaColorFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkAlphaThresholdFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkComposeImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkDisplacementMapEffect.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkDropShadowImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkTileImageFilter.cpp -FILE: ../../../third_party/skia/src/gpu/GrCaps.h -FILE: ../../../third_party/skia/src/gpu/GrCoordTransform.h -FILE: ../../../third_party/skia/src/gpu/GrGeometryProcessor.h -FILE: ../../../third_party/skia/src/gpu/GrPaint.cpp -FILE: ../../../third_party/skia/src/gpu/GrPathProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/GrPathProcessor.h -FILE: ../../../third_party/skia/src/gpu/GrPrimitiveProcessor.h -FILE: ../../../third_party/skia/src/gpu/GrRectanizer_skyline.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrBezierEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrBezierEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrBicubicEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrBitmapTextGeoProc.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrBitmapTextGeoProc.h -FILE: ../../../third_party/skia/src/gpu/effects/GrDistanceFieldGeoProc.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrDistanceFieldGeoProc.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLContext.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLContext.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLExtensions.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLVertexArray.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLVertexArray.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLGeometryProcessor.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLPrimitiveProcessor.h -FILE: ../../../third_party/skia/src/gpu/ops/GrOvalOpFactory.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrOvalOpFactory.h -FILE: ../../../third_party/skia/src/lazy/SkDiscardableMemoryPool.cpp -FILE: ../../../third_party/skia/src/lazy/SkDiscardableMemoryPool.h -FILE: ../../../third_party/skia/src/pathops/SkOpCoincidence.h -FILE: ../../../third_party/skia/src/pathops/SkOpContour.cpp -FILE: ../../../third_party/skia/src/pathops/SkOpContour.h -FILE: ../../../third_party/skia/src/pathops/SkPathOpsDebug.cpp -FILE: ../../../third_party/skia/src/pathops/SkPathOpsDebug.h -FILE: ../../../third_party/skia/src/pdf/SkPDFResourceDict.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFResourceDict.h -FILE: ../../../third_party/skia/src/ports/SkDiscardableMemory_none.cpp -FILE: ../../../third_party/skia/src/ports/SkFontConfigTypeface.h -FILE: ../../../third_party/skia/src/ports/SkFontMgr_FontConfigInterface.cpp -FILE: ../../../third_party/skia/src/ports/SkOSFile_posix.cpp -FILE: ../../../third_party/skia/src/ports/SkOSFile_win.cpp -FILE: ../../../third_party/skia/src/ports/SkTLS_none.cpp -FILE: ../../../third_party/skia/src/ports/SkTLS_pthread.cpp -FILE: ../../../third_party/skia/src/ports/SkTLS_win.cpp -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_name.cpp -FILE: ../../../third_party/skia/src/sfnt/SkTTCFHeader.h -FILE: ../../../third_party/skia/src/shaders/SkColorFilterShader.cpp -FILE: ../../../third_party/skia/src/shaders/SkPerlinNoiseShader.cpp -FILE: ../../../third_party/skia/src/utils/SkCanvasStack.cpp -FILE: ../../../third_party/skia/src/utils/SkCanvasStack.h -FILE: ../../../third_party/skia/src/utils/SkCanvasStateUtils.cpp -FILE: ../../../third_party/skia/src/utils/SkFrontBufferedStream.cpp -FILE: ../../../third_party/skia/src/utils/SkLua.cpp -FILE: ../../../third_party/skia/src/utils/SkLuaCanvas.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2013 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/bench/ClipMaskBench.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/bench/ClipMaskBench.cpp -FILE: ../../../third_party/skia/bench/ClipStrategyBench.cpp -FILE: ../../../third_party/skia/bench/ColorCanvasDrawBitmapBench.cpp -FILE: ../../../third_party/skia/bench/CubicKLMBench.cpp -FILE: ../../../third_party/skia/bench/MultitextureImageBench.cpp -FILE: ../../../third_party/skia/bench/PathTextBench.cpp -FILE: ../../../third_party/skia/bench/ShadowBench.cpp -FILE: ../../../third_party/skia/dm/DMGpuTestProcs.cpp -FILE: ../../../third_party/skia/example/HelloWorld.cpp -FILE: ../../../third_party/skia/example/HelloWorld.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGGradient.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGGradient.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPattern.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGPattern.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGRadialGradient.h -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.cpp -FILE: ../../../third_party/skia/experimental/svg/model/SkSVGUse.h -FILE: ../../../third_party/skia/experimental/tools/gerrit-change-id-to-number -FILE: ../../../third_party/skia/fuzz/FuzzCanvas.cpp -FILE: ../../../third_party/skia/gm/alpha_image.cpp -FILE: ../../../third_party/skia/gm/atlastext.cpp -FILE: ../../../third_party/skia/gm/bitmaptiled.cpp -FILE: ../../../third_party/skia/gm/blurignorexform.cpp -FILE: ../../../third_party/skia/gm/blurimagevmask.cpp -FILE: ../../../third_party/skia/gm/blurpositioning.cpp -FILE: ../../../third_party/skia/gm/blurtextsmallradii.cpp -FILE: ../../../third_party/skia/gm/bug6643.cpp -FILE: ../../../third_party/skia/gm/bug6783.cpp -FILE: ../../../third_party/skia/gm/circle_sizes.cpp -FILE: ../../../third_party/skia/gm/crbug_691386.cpp -FILE: ../../../third_party/skia/gm/crbug_788500.cpp -FILE: ../../../third_party/skia/gm/crosscontextimage.cpp -FILE: ../../../third_party/skia/gm/dftext_blob_persp.cpp -FILE: ../../../third_party/skia/gm/drrect_small_inner.cpp -FILE: ../../../third_party/skia/gm/encode-alpha-jpeg.cpp -FILE: ../../../third_party/skia/gm/flippity.cpp -FILE: ../../../third_party/skia/gm/gammaencodedpremul.cpp -FILE: ../../../third_party/skia/gm/highcontrastfilter.cpp -FILE: ../../../third_party/skia/gm/hsl.cpp -FILE: ../../../third_party/skia/gm/imageblurclampmode.cpp -FILE: ../../../third_party/skia/gm/imageblurrepeatmode.cpp -FILE: ../../../third_party/skia/gm/jpg_color_cube.cpp -FILE: ../../../third_party/skia/gm/makecolorspace.cpp -FILE: ../../../third_party/skia/gm/manypaths.cpp -FILE: ../../../third_party/skia/gm/pictureshadercache.cpp -FILE: ../../../third_party/skia/gm/radial_gradient_precision.cpp -FILE: ../../../third_party/skia/gm/savelayer.cpp -FILE: ../../../third_party/skia/gm/shadowutils.cpp -FILE: ../../../third_party/skia/gm/shapes_as_paths.cpp -FILE: ../../../third_party/skia/gm/simple_magnification.cpp -FILE: ../../../third_party/skia/gm/srgb.cpp -FILE: ../../../third_party/skia/gm/testgradient.cpp -FILE: ../../../third_party/skia/gm/text_scale_skew.cpp -FILE: ../../../third_party/skia/gm/thinconcavepaths.cpp -FILE: ../../../third_party/skia/gm/tonalshadows.cpp -FILE: ../../../third_party/skia/gm/tosrgb_colorfilter.cpp -FILE: ../../../third_party/skia/include/android/SkAndroidFrameworkUtils.h -FILE: ../../../third_party/skia/include/atlastext/SkAtlasTextContext.h -FILE: ../../../third_party/skia/include/atlastext/SkAtlasTextFont.h -FILE: ../../../third_party/skia/include/atlastext/SkAtlasTextRenderer.h -FILE: ../../../third_party/skia/include/atlastext/SkAtlasTextTarget.h -FILE: ../../../third_party/skia/include/codec/SkEncodedOrigin.h -FILE: ../../../third_party/skia/include/core/SkColorSpaceXformCanvas.h -FILE: ../../../third_party/skia/include/core/SkDeferredDisplayListRecorder.h -FILE: ../../../third_party/skia/include/core/SkExecutor.h -FILE: ../../../third_party/skia/include/core/SkFontArguments.h -FILE: ../../../third_party/skia/include/core/SkSerialProcs.h -FILE: ../../../third_party/skia/include/core/SkSurfaceCharacterization.h -FILE: ../../../third_party/skia/include/core/SkVertices.h -FILE: ../../../third_party/skia/include/effects/SkHighContrastFilter.h -FILE: ../../../third_party/skia/include/effects/SkToSRGBColorFilter.h -FILE: ../../../third_party/skia/include/encode/SkEncoder.h -FILE: ../../../third_party/skia/include/encode/SkJpegEncoder.h -FILE: ../../../third_party/skia/include/encode/SkPngEncoder.h -FILE: ../../../third_party/skia/include/encode/SkWebpEncoder.h -FILE: ../../../third_party/skia/include/gpu/GrBackendSemaphore.h -FILE: ../../../third_party/skia/include/gpu/GrBackendSurface.h -FILE: ../../../third_party/skia/include/gpu/mock/GrMockTypes.h -FILE: ../../../third_party/skia/include/gpu/mtl/GrMtlTypes.h -FILE: ../../../third_party/skia/include/private/GrSharedEnums.h -FILE: ../../../third_party/skia/include/private/SkDeferredDisplayList.h -FILE: ../../../third_party/skia/include/private/SkImageInfoPriv.h -FILE: ../../../third_party/skia/include/private/SkMalloc.h -FILE: ../../../third_party/skia/include/private/SkShadowFlags.h -FILE: ../../../third_party/skia/include/utils/SkShadowUtils.h -FILE: ../../../third_party/skia/modules/skottie/include/Skottie.h -FILE: ../../../third_party/skia/modules/skottie/src/Skottie.cpp -FILE: ../../../third_party/skia/modules/skottie/src/SkottieAnimator.cpp -FILE: ../../../third_party/skia/modules/skottie/src/SkottieAnimator.h -FILE: ../../../third_party/skia/modules/skottie/src/SkottieValue.cpp -FILE: ../../../third_party/skia/modules/skottie/src/SkottieValue.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGColor.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGDraw.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGEffectNode.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGGeometryNode.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGGroup.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGInvalidationController.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGMerge.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGNode.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGPaintNode.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGPath.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGRect.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGRenderNode.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGTransform.h -FILE: ../../../third_party/skia/modules/sksg/include/SkSGTrimEffect.h -FILE: ../../../third_party/skia/modules/sksg/src/SkSGColor.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGDraw.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGEffectNode.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGGeometryNode.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGGroup.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGInvalidationController.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGMerge.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGNode.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGPaintNode.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGPath.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGRect.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGRenderNode.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGTransform.cpp -FILE: ../../../third_party/skia/modules/sksg/src/SkSGTrimEffect.cpp -FILE: ../../../third_party/skia/samplecode/SampleCCPRGeometry.cpp -FILE: ../../../third_party/skia/samplecode/SampleChineseFling.cpp -FILE: ../../../third_party/skia/samplecode/SampleCowboy.cpp -FILE: ../../../third_party/skia/samplecode/SamplePathText.cpp -FILE: ../../../third_party/skia/samplecode/SampleShadowColor.cpp -FILE: ../../../third_party/skia/samplecode/SampleShadowReference.cpp -FILE: ../../../third_party/skia/samplecode/SampleShadowUtils.cpp -FILE: ../../../third_party/skia/src/android/SkAndroidFrameworkUtils.cpp -FILE: ../../../third_party/skia/src/atlastext/SkAtlasTextContext.cpp -FILE: ../../../third_party/skia/src/atlastext/SkAtlasTextTarget.cpp -FILE: ../../../third_party/skia/src/atlastext/SkInternalAtlasTextContext.cpp -FILE: ../../../third_party/skia/src/atlastext/SkInternalAtlasTextContext.h -FILE: ../../../third_party/skia/src/c/sk_effects.cpp -FILE: ../../../third_party/skia/src/codec/SkBmpBaseCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkBmpBaseCodec.h -FILE: ../../../third_party/skia/src/codec/SkFrameHolder.h -FILE: ../../../third_party/skia/src/codec/SkHeifCodec.cpp -FILE: ../../../third_party/skia/src/codec/SkHeifCodec.h -FILE: ../../../third_party/skia/src/codec/SkJpegPriv.h -FILE: ../../../third_party/skia/src/codec/SkPngPriv.h -FILE: ../../../third_party/skia/src/codec/SkStubHeifDecoderAPI.h -FILE: ../../../third_party/skia/src/compute/color/color.c -FILE: ../../../third_party/skia/src/compute/color/color.h -FILE: ../../../third_party/skia/src/compute/skc/assert_state.h -FILE: ../../../third_party/skia/src/compute/skc/block.h -FILE: ../../../third_party/skia/src/compute/skc/common.h -FILE: ../../../third_party/skia/src/compute/skc/composition.c -FILE: ../../../third_party/skia/src/compute/skc/composition.h -FILE: ../../../third_party/skia/src/compute/skc/context.c -FILE: ../../../third_party/skia/src/compute/skc/context.h -FILE: ../../../third_party/skia/src/compute/skc/extent_ring.c -FILE: ../../../third_party/skia/src/compute/skc/extent_ring.h -FILE: ../../../third_party/skia/src/compute/skc/grid.c -FILE: ../../../third_party/skia/src/compute/skc/grid.h -FILE: ../../../third_party/skia/src/compute/skc/handle.h -FILE: ../../../third_party/skia/src/compute/skc/macros.h -FILE: ../../../third_party/skia/src/compute/skc/main.c -FILE: ../../../third_party/skia/src/compute/skc/path.h -FILE: ../../../third_party/skia/src/compute/skc/path_builder.c -FILE: ../../../third_party/skia/src/compute/skc/path_builder.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/atomic_cl.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/block_pool_cl.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/block_pool_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/composition_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/composition_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/config_cl.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/cq_pool_cl.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/cq_pool_cl.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/device_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/export_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/extent_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/extent_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/extent_cl_12_unified.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/handle_pool_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/handle_pool_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/block_pool_init.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/avx2/device_cl_12_avx2.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/gen9/device_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/devices/gen9/kernel_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/fills_expand.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/paths_copy.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/paths_reclaim.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/place.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/prefix.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/rasterize.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/rasters_alloc.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/kernels/rasters_reclaim.cl -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/path_builder_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/path_builder_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/raster_builder_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/runtime_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/skc_cl.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/styling_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/styling_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/surface_cl_12.c -FILE: ../../../third_party/skia/src/compute/skc/platforms/cl_12/surface_cl_12.h -FILE: ../../../third_party/skia/src/compute/skc/raster.h -FILE: ../../../third_party/skia/src/compute/skc/raster_builder.c -FILE: ../../../third_party/skia/src/compute/skc/raster_builder.h -FILE: ../../../third_party/skia/src/compute/skc/scheduler.cpp -FILE: ../../../third_party/skia/src/compute/skc/scheduler.h -FILE: ../../../third_party/skia/src/compute/skc/skc.h -FILE: ../../../third_party/skia/src/compute/skc/skc_styling.h -FILE: ../../../third_party/skia/src/compute/skc/subblock.h -FILE: ../../../third_party/skia/src/compute/skc/surface.c -FILE: ../../../third_party/skia/src/compute/skc/surface.h -FILE: ../../../third_party/skia/src/compute/skc/types.h -FILE: ../../../third_party/skia/src/compute/skc/util.h -FILE: ../../../third_party/skia/src/compute/skc/weakref.c -FILE: ../../../third_party/skia/src/compute/skc/weakref.h -FILE: ../../../third_party/skia/src/core/SkArenaAllocList.h -FILE: ../../../third_party/skia/src/core/SkAutoBlitterChoose.h -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_utils.h -FILE: ../../../third_party/skia/src/core/SkBlendMode.cpp -FILE: ../../../third_party/skia/src/core/SkBlitter_RGB565.cpp -FILE: ../../../third_party/skia/src/core/SkClipStackDevice.cpp -FILE: ../../../third_party/skia/src/core/SkClipStackDevice.h -FILE: ../../../third_party/skia/src/core/SkColorSpaceXformCanvas.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpaceXformer.cpp -FILE: ../../../third_party/skia/src/core/SkColorSpaceXformer.h -FILE: ../../../third_party/skia/src/core/SkCoverageDelta.cpp -FILE: ../../../third_party/skia/src/core/SkCoverageDelta.h -FILE: ../../../third_party/skia/src/core/SkDeferredDisplayListRecorder.cpp -FILE: ../../../third_party/skia/src/core/SkDrawShadowInfo.cpp -FILE: ../../../third_party/skia/src/core/SkDrawShadowInfo.h -FILE: ../../../third_party/skia/src/core/SkDraw_vertices.cpp -FILE: ../../../third_party/skia/src/core/SkExecutor.cpp -FILE: ../../../third_party/skia/src/core/SkFDot6Constants.cpp -FILE: ../../../third_party/skia/src/core/SkFontMgrPriv.h -FILE: ../../../third_party/skia/src/core/SkGaussFilter.cpp -FILE: ../../../third_party/skia/src/core/SkGaussFilter.h -FILE: ../../../third_party/skia/src/core/SkImageFilterPriv.h -FILE: ../../../third_party/skia/src/core/SkMaskBlurFilter.cpp -FILE: ../../../third_party/skia/src/core/SkMaskBlurFilter.h -FILE: ../../../third_party/skia/src/core/SkRasterClipStack.h -FILE: ../../../third_party/skia/src/core/SkSafeMath.h -FILE: ../../../third_party/skia/src/core/SkSpriteBlitter_RGB565.cpp -FILE: ../../../third_party/skia/src/core/SkTaskGroup2D.cpp -FILE: ../../../third_party/skia/src/core/SkTaskGroup2D.h -FILE: ../../../third_party/skia/src/core/SkThreadedBMPDevice.cpp -FILE: ../../../third_party/skia/src/core/SkThreadedBMPDevice.h -FILE: ../../../third_party/skia/src/core/SkUnPreMultiplyPriv.h -FILE: ../../../third_party/skia/src/core/SkVertices.cpp -FILE: ../../../third_party/skia/src/core/SkVptr.h -FILE: ../../../third_party/skia/src/core/SkWritePixelsRec.h -FILE: ../../../third_party/skia/src/effects/SkDashImpl.h -FILE: ../../../third_party/skia/src/effects/SkHighContrastFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkToSRGBColorFilter.cpp -FILE: ../../../third_party/skia/src/gpu/GrAHardwareBufferImageGenerator.cpp -FILE: ../../../third_party/skia/src/gpu/GrAHardwareBufferImageGenerator.h -FILE: ../../../third_party/skia/src/gpu/GrBackendSurface.cpp -FILE: ../../../third_party/skia/src/gpu/GrBackendTextureImageGenerator.cpp -FILE: ../../../third_party/skia/src/gpu/GrBackendTextureImageGenerator.h -FILE: ../../../third_party/skia/src/gpu/GrColorSpaceInfo.cpp -FILE: ../../../third_party/skia/src/gpu/GrColorSpaceInfo.h -FILE: ../../../third_party/skia/src/gpu/GrDeferredProxyUploader.h -FILE: ../../../third_party/skia/src/gpu/GrDeferredUpload.h -FILE: ../../../third_party/skia/src/gpu/GrOnFlushResourceProvider.cpp -FILE: ../../../third_party/skia/src/gpu/GrOnFlushResourceProvider.h -FILE: ../../../third_party/skia/src/gpu/GrProcessorSet.cpp -FILE: ../../../third_party/skia/src/gpu/GrProcessorSet.h -FILE: ../../../third_party/skia/src/gpu/GrResourceAllocator.cpp -FILE: ../../../third_party/skia/src/gpu/GrResourceAllocator.h -FILE: ../../../third_party/skia/src/gpu/GrSemaphore.h -FILE: ../../../third_party/skia/src/gpu/GrStencilClip.h -FILE: ../../../third_party/skia/src/gpu/GrSurfaceProxyPriv.h -FILE: ../../../third_party/skia/src/gpu/GrTextureProxyCacheAccess.h -FILE: ../../../third_party/skia/src/gpu/GrTextureProxyPriv.h -FILE: ../../../third_party/skia/src/gpu/SkGr.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCAtlas.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCAtlas.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCClipProcessor.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCoverageProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCoverageProcessor.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCoverageProcessor_VSImpl.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCubicShader.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCCubicShader.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCGeometry.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCGeometry.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathParser.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathParser.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCPathProcessor.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCCQuadraticShader.h -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp -FILE: ../../../third_party/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.h -FILE: ../../../third_party/skia/src/gpu/effects/GrAtlasedShaderHelpers.h -FILE: ../../../third_party/skia/src/gpu/effects/GrBlurredEdgeFragmentProcessor.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrBlurredEdgeFragmentProcessor.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrBlurredEdgeFragmentProcessor.h -FILE: ../../../third_party/skia/src/gpu/effects/GrCircleEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrCircleEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrCircleEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrEllipseEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrEllipseEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrEllipseEffect.h -FILE: ../../../third_party/skia/src/gpu/effects/GrSimpleTextureEffect.cpp -FILE: ../../../third_party/skia/src/gpu/effects/GrSimpleTextureEffect.fp -FILE: ../../../third_party/skia/src/gpu/effects/GrSimpleTextureEffect.h -FILE: ../../../third_party/skia/src/gpu/gl/GrGLGpuCommandBuffer.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLSemaphore.cpp -FILE: ../../../third_party/skia/src/gpu/gl/GrGLSemaphore.h -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp -FILE: ../../../third_party/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.h -FILE: ../../../third_party/skia/src/gpu/mock/GrMockBuffer.h -FILE: ../../../third_party/skia/src/gpu/mock/GrMockCaps.h -FILE: ../../../third_party/skia/src/gpu/mock/GrMockGpu.cpp -FILE: ../../../third_party/skia/src/gpu/mock/GrMockGpu.h -FILE: ../../../third_party/skia/src/gpu/mock/GrMockGpuCommandBuffer.h -FILE: ../../../third_party/skia/src/gpu/mock/GrMockStencilAttachment.h -FILE: ../../../third_party/skia/src/gpu/mock/GrMockTexture.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlCaps.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlCaps.mm -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlGpu.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlGpu.mm -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlRenderTarget.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlRenderTarget.mm -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTexture.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTexture.mm -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTrampoline.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlTrampoline.mm -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlUtil.h -FILE: ../../../third_party/skia/src/gpu/mtl/GrMtlUtil.mm -FILE: ../../../third_party/skia/src/gpu/ops/GrClearOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrDebugMarkerOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrNonAAFillRectOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrRectOpFactory.h -FILE: ../../../third_party/skia/src/gpu/ops/GrSemaphoreOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrSemaphoreOp.h -FILE: ../../../third_party/skia/src/gpu/ops/GrSimpleMeshDrawOpHelper.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrSimpleMeshDrawOpHelper.h -FILE: ../../../third_party/skia/src/gpu/ops/GrStencilPathOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrTextureOp.cpp -FILE: ../../../third_party/skia/src/gpu/ops/GrTextureOp.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkBufferView.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkBufferView.h -FILE: ../../../third_party/skia/src/gpu/vk/GrVkSemaphore.cpp -FILE: ../../../third_party/skia/src/gpu/vk/GrVkSemaphore.h -FILE: ../../../third_party/skia/src/jumper/SkJumper.cpp -FILE: ../../../third_party/skia/src/jumper/SkJumper.h -FILE: ../../../third_party/skia/src/jumper/SkJumper_misc.h -FILE: ../../../third_party/skia/src/opts/SkUtils_opts.h -FILE: ../../../third_party/skia/src/pdf/SkKeyedImage.cpp -FILE: ../../../third_party/skia/src/pdf/SkKeyedImage.h -FILE: ../../../third_party/skia/src/pdf/SkPDFGradientShader.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFGradientShader.h -FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_directory.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_embedded.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom_empty.cpp -FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_none.cpp -FILE: ../../../third_party/skia/src/ports/SkGlobalInitialization_none_imagefilters.cpp -FILE: ../../../third_party/skia/src/ports/SkOSFile_ios.h -FILE: ../../../third_party/skia/src/sfnt/SkOTTable_fvar.h -FILE: ../../../third_party/skia/src/shaders/SkShaderBase.h -FILE: ../../../third_party/skia/src/sksl/SkSLCPP.h -FILE: ../../../third_party/skia/src/sksl/SkSLCPPCodeGenerator.h -FILE: ../../../third_party/skia/src/sksl/SkSLFileOutputStream.h -FILE: ../../../third_party/skia/src/sksl/SkSLHCodeGenerator.h -FILE: ../../../third_party/skia/src/sksl/SkSLLexer.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLLexer.h -FILE: ../../../third_party/skia/src/sksl/SkSLOutputStream.h -FILE: ../../../third_party/skia/src/sksl/SkSLSectionAndParameterHelper.h -FILE: ../../../third_party/skia/src/sksl/SkSLString.cpp -FILE: ../../../third_party/skia/src/sksl/SkSLString.h -FILE: ../../../third_party/skia/src/sksl/SkSLStringStream.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTEnum.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSwitchCase.h -FILE: ../../../third_party/skia/src/sksl/ast/SkSLASTSwitchStatement.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLEnum.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLSetting.cpp -FILE: ../../../third_party/skia/src/sksl/ir/SkSLSwitchCase.h -FILE: ../../../third_party/skia/src/sksl/ir/SkSLSwitchStatement.h -FILE: ../../../third_party/skia/src/sksl/lex/DFA.h -FILE: ../../../third_party/skia/src/sksl/lex/DFAState.h -FILE: ../../../third_party/skia/src/sksl/lex/LexUtil.h -FILE: ../../../third_party/skia/src/sksl/lex/Main.cpp -FILE: ../../../third_party/skia/src/sksl/lex/NFA.cpp -FILE: ../../../third_party/skia/src/sksl/lex/NFA.h -FILE: ../../../third_party/skia/src/sksl/lex/NFAState.h -FILE: ../../../third_party/skia/src/sksl/lex/NFAtoDFA.h -FILE: ../../../third_party/skia/src/sksl/lex/RegexNode.cpp -FILE: ../../../third_party/skia/src/sksl/lex/RegexNode.h -FILE: ../../../third_party/skia/src/sksl/lex/RegexParser.cpp -FILE: ../../../third_party/skia/src/sksl/lex/RegexParser.h -FILE: ../../../third_party/skia/src/sksl/sksl_enums.inc -FILE: ../../../third_party/skia/src/utils/SkFloatToDecimal.cpp -FILE: ../../../third_party/skia/src/utils/SkFloatToDecimal.h -FILE: ../../../third_party/skia/src/utils/SkJSONWriter.cpp -FILE: ../../../third_party/skia/src/utils/SkJSONWriter.h -FILE: ../../../third_party/skia/src/utils/SkPolyUtils.cpp -FILE: ../../../third_party/skia/src/utils/SkPolyUtils.h -FILE: ../../../third_party/skia/src/utils/SkShadowTessellator.cpp -FILE: ../../../third_party/skia/src/utils/SkShadowTessellator.h -FILE: ../../../third_party/skia/src/utils/SkShadowUtils.cpp -FILE: ../../../third_party/skia/src/utils/SkThreadUtils_pthread.cpp -FILE: ../../../third_party/skia/src/utils/SkThreadUtils_win.cpp -FILE: ../../../third_party/skia/src/xps/SkXPSDocument.h ----------------------------------------------------------------------------------------------------- -Copyright 2017 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/bench/ReadPixBench.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/bench/ReadPixBench.cpp -FILE: ../../../third_party/skia/bench/WriterBench.cpp -FILE: ../../../third_party/skia/include/effects/SkColorFilterImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkLightingImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkMagnifierImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkMatrixConvolutionImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkMergeImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkMorphologyImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkOffsetImageFilter.h -FILE: ../../../third_party/skia/src/core/SkImageFilter.cpp -FILE: ../../../third_party/skia/src/core/SkUtilsArm.cpp -FILE: ../../../third_party/skia/src/core/SkUtilsArm.h -FILE: ../../../third_party/skia/src/effects/imagefilters/SkColorFilterImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkLightingImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkMagnifierImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkMatrixConvolutionImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkMergeImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkMorphologyImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkOffsetImageFilter.cpp -FILE: ../../../third_party/skia/src/images/SkImageEncoderFns.h -FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_filter_neon.h -FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.cpp -FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_SSSE3.h -FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_SSE2.cpp -FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp -FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_arm_neon.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2012 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/experimental/wasm/wasm_main.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/experimental/wasm/wasm_main.cpp -FILE: ../../../third_party/skia/fuzz/FuzzEncoders.cpp -FILE: ../../../third_party/skia/fuzz/FuzzPolyUtils.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2018 Google LLC - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/fuzz/FuzzDrawFunctions.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/fuzz/FuzzDrawFunctions.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2016 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/fuzz/oss_fuzz/FuzzAPIImageFilter.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/fuzz/FuzzCommon.h -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzAPIImageFilter.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzAnimatedImage.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzDrawFunctions.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzGradients.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzImage.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJPEGEncoder.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzJSON.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzNullCanvas.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPNGEncoder.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzPathMeasure.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp -FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzWEBPEncoder.cpp -FILE: ../../../third_party/skia/modules/skottie/fuzz/FuzzSkottieJSON.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2018 Google, LLC - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/gm/circles.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/gm/circles.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2012 Intel Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/config/SkUserConfig.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/config/SkUserConfig.h -FILE: ../../../third_party/skia/include/core/SkBitmap.h -FILE: ../../../third_party/skia/include/core/SkCanvas.h -FILE: ../../../third_party/skia/include/core/SkColor.h -FILE: ../../../third_party/skia/include/core/SkColorFilter.h -FILE: ../../../third_party/skia/include/core/SkColorPriv.h -FILE: ../../../third_party/skia/include/core/SkDeque.h -FILE: ../../../third_party/skia/include/core/SkFlattenable.h -FILE: ../../../third_party/skia/include/core/SkGraphics.h -FILE: ../../../third_party/skia/include/core/SkMaskFilter.h -FILE: ../../../third_party/skia/include/core/SkMath.h -FILE: ../../../third_party/skia/include/core/SkMatrix.h -FILE: ../../../third_party/skia/include/core/SkMetaData.h -FILE: ../../../third_party/skia/include/core/SkPaint.h -FILE: ../../../third_party/skia/include/core/SkPath.h -FILE: ../../../third_party/skia/include/core/SkPathEffect.h -FILE: ../../../third_party/skia/include/core/SkPathMeasure.h -FILE: ../../../third_party/skia/include/core/SkPoint.h -FILE: ../../../third_party/skia/include/core/SkPostConfig.h -FILE: ../../../third_party/skia/include/core/SkPreConfig.h -FILE: ../../../third_party/skia/include/core/SkRect.h -FILE: ../../../third_party/skia/include/core/SkRefCnt.h -FILE: ../../../third_party/skia/include/core/SkScalar.h -FILE: ../../../third_party/skia/include/core/SkShader.h -FILE: ../../../third_party/skia/include/core/SkStream.h -FILE: ../../../third_party/skia/include/core/SkString.h -FILE: ../../../third_party/skia/include/core/SkTime.h -FILE: ../../../third_party/skia/include/core/SkTypeface.h -FILE: ../../../third_party/skia/include/core/SkTypes.h -FILE: ../../../third_party/skia/include/effects/Sk1DPathEffect.h -FILE: ../../../third_party/skia/include/effects/Sk2DPathEffect.h -FILE: ../../../third_party/skia/include/effects/SkBlurMaskFilter.h -FILE: ../../../third_party/skia/include/effects/SkCornerPathEffect.h -FILE: ../../../third_party/skia/include/effects/SkDashPathEffect.h -FILE: ../../../third_party/skia/include/effects/SkDiscretePathEffect.h -FILE: ../../../third_party/skia/include/effects/SkGradientShader.h -FILE: ../../../third_party/skia/include/effects/SkTableMaskFilter.h -FILE: ../../../third_party/skia/include/private/SkFixed.h -FILE: ../../../third_party/skia/include/private/SkFloatingPoint.h -FILE: ../../../third_party/skia/include/private/SkNoncopyable.h -FILE: ../../../third_party/skia/include/private/SkTDArray.h -FILE: ../../../third_party/skia/include/private/SkTSearch.h -FILE: ../../../third_party/skia/include/private/SkTemplates.h -FILE: ../../../third_party/skia/include/utils/SkBase64.h -FILE: ../../../third_party/skia/include/utils/SkCamera.h -FILE: ../../../third_party/skia/include/utils/SkInterpolator.h -FILE: ../../../third_party/skia/include/utils/SkParse.h -FILE: ../../../third_party/skia/include/utils/SkParsePath.h -FILE: ../../../third_party/skia/include/utils/SkRandom.h -FILE: ../../../third_party/skia/include/views/SkEvent.h -FILE: ../../../third_party/skia/include/views/SkEventSink.h -FILE: ../../../third_party/skia/include/views/SkKey.h -FILE: ../../../third_party/skia/include/views/SkView.h -FILE: ../../../third_party/skia/src/core/SkAlphaRuns.cpp -FILE: ../../../third_party/skia/src/core/SkAnalyticEdge.cpp -FILE: ../../../third_party/skia/src/core/SkAnalyticEdge.h -FILE: ../../../third_party/skia/src/core/SkAntiRun.h -FILE: ../../../third_party/skia/src/core/SkBlitBWMaskTemplate.h -FILE: ../../../third_party/skia/src/core/SkBlitter.cpp -FILE: ../../../third_party/skia/src/core/SkBlitter.h -FILE: ../../../third_party/skia/src/core/SkBlitter_A8.cpp -FILE: ../../../third_party/skia/src/core/SkBlitter_ARGB32.cpp -FILE: ../../../third_party/skia/src/core/SkBlitter_Sprite.cpp -FILE: ../../../third_party/skia/src/core/SkBlurMF.cpp -FILE: ../../../third_party/skia/src/core/SkBlurMask.cpp -FILE: ../../../third_party/skia/src/core/SkBlurMask.h -FILE: ../../../third_party/skia/src/core/SkBuffer.cpp -FILE: ../../../third_party/skia/src/core/SkBuffer.h -FILE: ../../../third_party/skia/src/core/SkColor.cpp -FILE: ../../../third_party/skia/src/core/SkColorData.h -FILE: ../../../third_party/skia/src/core/SkColorFilter.cpp -FILE: ../../../third_party/skia/src/core/SkCoreBlitters.h -FILE: ../../../third_party/skia/src/core/SkDebug.cpp -FILE: ../../../third_party/skia/src/core/SkDeque.cpp -FILE: ../../../third_party/skia/src/core/SkDescriptor.h -FILE: ../../../third_party/skia/src/core/SkDraw.cpp -FILE: ../../../third_party/skia/src/core/SkDraw.h -FILE: ../../../third_party/skia/src/core/SkEdge.cpp -FILE: ../../../third_party/skia/src/core/SkEdge.h -FILE: ../../../third_party/skia/src/core/SkEndian.h -FILE: ../../../third_party/skia/src/core/SkFDot6.h -FILE: ../../../third_party/skia/src/core/SkFDot6Constants.h -FILE: ../../../third_party/skia/src/core/SkGeometry.cpp -FILE: ../../../third_party/skia/src/core/SkGeometry.h -FILE: ../../../third_party/skia/src/core/SkGlyph.h -FILE: ../../../third_party/skia/src/core/SkGlyphCache.cpp -FILE: ../../../third_party/skia/src/core/SkGlyphCache.h -FILE: ../../../third_party/skia/src/core/SkGraphics.cpp -FILE: ../../../third_party/skia/src/core/SkMask.h -FILE: ../../../third_party/skia/src/core/SkMaskFilter.cpp -FILE: ../../../third_party/skia/src/core/SkMatrix.cpp -FILE: ../../../third_party/skia/src/core/SkMetaData.cpp -FILE: ../../../third_party/skia/src/core/SkModeColorFilter.cpp -FILE: ../../../third_party/skia/src/core/SkOSFile.h -FILE: ../../../third_party/skia/src/core/SkPaint.cpp -FILE: ../../../third_party/skia/src/core/SkPath.cpp -FILE: ../../../third_party/skia/src/core/SkPathEffect.cpp -FILE: ../../../third_party/skia/src/core/SkPointPriv.h -FILE: ../../../third_party/skia/src/core/SkRect.cpp -FILE: ../../../third_party/skia/src/core/SkRegion.cpp -FILE: ../../../third_party/skia/src/core/SkRegionPriv.h -FILE: ../../../third_party/skia/src/core/SkRegion_path.cpp -FILE: ../../../third_party/skia/src/core/SkScalerContext.cpp -FILE: ../../../third_party/skia/src/core/SkScalerContext.h -FILE: ../../../third_party/skia/src/core/SkScan.cpp -FILE: ../../../third_party/skia/src/core/SkScanPriv.h -FILE: ../../../third_party/skia/src/core/SkScan_AntiPath.cpp -FILE: ../../../third_party/skia/src/core/SkScan_Hairline.cpp -FILE: ../../../third_party/skia/src/core/SkScan_Path.cpp -FILE: ../../../third_party/skia/src/core/SkSpriteBlitter.h -FILE: ../../../third_party/skia/src/core/SkSpriteBlitter_ARGB32.cpp -FILE: ../../../third_party/skia/src/core/SkStream.cpp -FILE: ../../../third_party/skia/src/core/SkString.cpp -FILE: ../../../third_party/skia/src/core/SkStroke.h -FILE: ../../../third_party/skia/src/core/SkStrokerPriv.cpp -FILE: ../../../third_party/skia/src/core/SkStrokerPriv.h -FILE: ../../../third_party/skia/src/core/SkTSearch.cpp -FILE: ../../../third_party/skia/src/core/SkTSort.h -FILE: ../../../third_party/skia/src/core/SkUtils.cpp -FILE: ../../../third_party/skia/src/core/SkUtils.h -FILE: ../../../third_party/skia/src/core/SkXfermode.cpp -FILE: ../../../third_party/skia/src/core/SkXfermodePriv.h -FILE: ../../../third_party/skia/src/effects/Sk1DPathEffect.cpp -FILE: ../../../third_party/skia/src/effects/Sk2DPathEffect.cpp -FILE: ../../../third_party/skia/src/effects/SkCornerPathEffect.cpp -FILE: ../../../third_party/skia/src/effects/SkDashPathEffect.cpp -FILE: ../../../third_party/skia/src/effects/SkDiscretePathEffect.cpp -FILE: ../../../third_party/skia/src/effects/SkEmbossMask.cpp -FILE: ../../../third_party/skia/src/effects/SkEmbossMask.h -FILE: ../../../third_party/skia/src/effects/SkEmbossMaskFilter.cpp -FILE: ../../../third_party/skia/src/effects/SkEmbossMaskFilter.h -FILE: ../../../third_party/skia/src/images/SkPngEncoder.cpp -FILE: ../../../third_party/skia/src/ports/SkDebug_android.cpp -FILE: ../../../third_party/skia/src/ports/SkDebug_stdio.cpp -FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType.cpp -FILE: ../../../third_party/skia/src/ports/SkFontHost_mac.cpp -FILE: ../../../third_party/skia/src/ports/SkFontHost_win.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_custom.h -FILE: ../../../third_party/skia/src/ports/SkOSFile_stdio.cpp -FILE: ../../../third_party/skia/src/shaders/SkBitmapProcShader.h -FILE: ../../../third_party/skia/src/shaders/SkComposeShader.cpp -FILE: ../../../third_party/skia/src/shaders/SkComposeShader.h -FILE: ../../../third_party/skia/src/shaders/SkShader.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/SkGradientShader.cpp -FILE: ../../../third_party/skia/src/utils/SkBase64.cpp -FILE: ../../../third_party/skia/src/utils/SkBase64.h -FILE: ../../../third_party/skia/src/utils/SkCamera.cpp -FILE: ../../../third_party/skia/src/utils/SkParse.cpp -FILE: ../../../third_party/skia/src/utils/SkParseColor.cpp -FILE: ../../../third_party/skia/src/views/SkEvent.cpp -FILE: ../../../third_party/skia/src/views/SkEventSink.cpp -FILE: ../../../third_party/skia/src/xml/SkDOM.cpp -FILE: ../../../third_party/skia/src/xml/SkDOM.h -FILE: ../../../third_party/skia/src/xml/SkXMLParser.cpp -FILE: ../../../third_party/skia/src/xml/SkXMLParser.h -FILE: ../../../third_party/skia/src/xml/SkXMLWriter.cpp -FILE: ../../../third_party/skia/src/xml/SkXMLWriter.h ----------------------------------------------------------------------------------------------------- -Copyright 2006 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/core/SkDrawLooper.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/core/SkDrawLooper.h -FILE: ../../../third_party/skia/include/effects/SkBlurImageFilter.h -FILE: ../../../third_party/skia/src/core/SkScan.h -FILE: ../../../third_party/skia/src/core/SkScan_Antihair.cpp -FILE: ../../../third_party/skia/src/core/SkTypeface.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkBlurImageFilter.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_android_parser.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_android_parser.h ----------------------------------------------------------------------------------------------------- -Copyright 2011 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/core/SkMallocPixelRef.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/core/SkMallocPixelRef.h -FILE: ../../../third_party/skia/include/core/SkPixelRef.h -FILE: ../../../third_party/skia/include/core/SkUnPreMultiply.h -FILE: ../../../third_party/skia/include/effects/SkBlurDrawLooper.h -FILE: ../../../third_party/skia/include/private/SkFloatBits.h -FILE: ../../../third_party/skia/src/core/SkBitmap.cpp -FILE: ../../../third_party/skia/src/core/SkCanvas.cpp -FILE: ../../../third_party/skia/src/core/SkDither.h -FILE: ../../../third_party/skia/src/core/SkMath.cpp -FILE: ../../../third_party/skia/src/core/SkPathMeasure.cpp -FILE: ../../../third_party/skia/src/core/SkPoint.cpp -FILE: ../../../third_party/skia/src/core/SkPtrRecorder.h -FILE: ../../../third_party/skia/src/core/SkReader32.h -FILE: ../../../third_party/skia/src/core/SkStroke.cpp -FILE: ../../../third_party/skia/src/core/SkWriter32.h -FILE: ../../../third_party/skia/src/effects/SkPackBits.h -FILE: ../../../third_party/skia/src/ports/SkFontMgr_empty_factory.cpp -FILE: ../../../third_party/skia/src/ports/SkImageEncoder_CG.cpp -FILE: ../../../third_party/skia/src/utils/SkInterpolator.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2008 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/core/SkPicture.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/core/SkPicture.h -FILE: ../../../third_party/skia/include/effects/SkColorMatrix.h -FILE: ../../../third_party/skia/include/effects/SkColorMatrixFilter.h -FILE: ../../../third_party/skia/src/core/SkBitmapProcState.h -FILE: ../../../third_party/skia/src/core/SkMask.cpp -FILE: ../../../third_party/skia/src/core/SkPicture.cpp -FILE: ../../../third_party/skia/src/images/SkJpegEncoder.cpp -FILE: ../../../third_party/skia/src/shaders/SkColorShader.h ----------------------------------------------------------------------------------------------------- -Copyright 2007 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/core/SkRegion.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/core/SkRegion.h ----------------------------------------------------------------------------------------------------- -Copyright 2005 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/effects/SkPictureImageFilter.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/effects/SkPictureImageFilter.h -FILE: ../../../third_party/skia/include/effects/SkXfermodeImageFilter.h -FILE: ../../../third_party/skia/src/effects/imagefilters/SkPictureImageFilter.cpp -FILE: ../../../third_party/skia/src/effects/imagefilters/SkXfermodeImageFilter.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2013 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/gpu/GrConfig.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/gpu/GrConfig.h -FILE: ../../../third_party/skia/include/gpu/GrContext.h -FILE: ../../../third_party/skia/include/gpu/GrTypes.h -FILE: ../../../third_party/skia/include/private/GrColor.h -FILE: ../../../third_party/skia/src/core/SkImageInfo.cpp -FILE: ../../../third_party/skia/src/core/SkRasterClip.cpp -FILE: ../../../third_party/skia/src/core/SkRasterClip.h -FILE: ../../../third_party/skia/src/core/SkStrikeCache.h -FILE: ../../../third_party/skia/src/gpu/GrAllocator.h -FILE: ../../../third_party/skia/src/gpu/GrBufferAllocPool.cpp -FILE: ../../../third_party/skia/src/gpu/GrBufferAllocPool.h -FILE: ../../../third_party/skia/src/gpu/GrClip.h -FILE: ../../../third_party/skia/src/gpu/GrFixedClip.cpp -FILE: ../../../third_party/skia/src/gpu/GrGlyph.h -FILE: ../../../third_party/skia/src/gpu/GrGpu.cpp -FILE: ../../../third_party/skia/src/gpu/GrRect.h -FILE: ../../../third_party/skia/src/gpu/GrRectanizer.h -FILE: ../../../third_party/skia/src/gpu/GrRectanizer_pow2.cpp -FILE: ../../../third_party/skia/src/gpu/GrRenderTargetOpList.cpp -FILE: ../../../third_party/skia/src/gpu/GrRenderTargetOpList.h -FILE: ../../../third_party/skia/src/gpu/SkGpuDevice.h -FILE: ../../../third_party/skia/src/gpu/SkGr.cpp -FILE: ../../../third_party/skia/src/ports/SkDebug_win.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/SkGradientBitmapCache.cpp -FILE: ../../../third_party/skia/src/shaders/gradients/SkGradientBitmapCache.h -FILE: ../../../third_party/skia/src/views/SkTouchGesture.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2010 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/gpu/GrDriverBugWorkaroundsAutogen.h -FILE: ../../../third_party/skia/include/utils/SkTraceEventPhase.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/include/utils/SkEventTracer.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/include/utils/SkEventTracer.h ----------------------------------------------------------------------------------------------------- -Copyright (C) 2014 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/infra/bots/ct/ct_skps.isolate + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/infra/bots/ct/ct_skps.isolate ----------------------------------------------------------------------------------------------------- -Copyright (c) 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/codec/SkCodecPriv.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/codec/SkCodecPriv.h -FILE: ../../../third_party/skia/src/core/SkLocalMatrixImageFilter.h -FILE: ../../../third_party/skia/src/ports/SkImageGenerator_none.cpp -FILE: ../../../third_party/skia/src/ports/SkImageGenerator_skia.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2015 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/codec/SkColorTable.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/codec/SkColorTable.cpp -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_filter.h -FILE: ../../../third_party/skia/src/core/SkCubicClipper.cpp -FILE: ../../../third_party/skia/src/core/SkCubicClipper.h -FILE: ../../../third_party/skia/src/core/SkEdgeClipper.cpp -FILE: ../../../third_party/skia/src/core/SkEdgeClipper.h -FILE: ../../../third_party/skia/src/core/SkFontLCDConfig.cpp -FILE: ../../../third_party/skia/src/core/SkQuadClipper.cpp -FILE: ../../../third_party/skia/src/core/SkQuadClipper.h -FILE: ../../../third_party/skia/src/images/SkImageEncoder.cpp -FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.cpp -FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_opts_SSE2.h -FILE: ../../../third_party/skia/src/opts/SkBlitRow_opts_SSE2.h -FILE: ../../../third_party/skia/src/opts/opts_check_x86.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2009 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/codec/SkGifCodec.cpp -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/codec/SkGifCodec.cpp ----------------------------------------------------------------------------------------------------- -Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/compute/sk/SkDevice_Compute.h -FILE: ../../../third_party/skia/src/core/SkScan_AAAPath.cpp -FILE: ../../../third_party/skia/src/core/SkScan_DAAPath.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2016 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp ----------------------------------------------------------------------------------------------------- -NEON optimized code (C) COPYRIGHT 2009 Motorola - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkBitmapProcState_matrixProcs.cpp -FILE: ../../../third_party/skia/src/ports/SkFontMgr_FontConfigInterface_factory.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2008 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkDevice.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkDevice.h -FILE: ../../../third_party/skia/src/core/SkScalar.cpp -FILE: ../../../third_party/skia/src/core/SkTextFormatParams.h -FILE: ../../../third_party/skia/src/images/SkJPEGWriteUtility.cpp -FILE: ../../../third_party/skia/src/images/SkJPEGWriteUtility.h -FILE: ../../../third_party/skia/src/pdf/SkDeflate.cpp -FILE: ../../../third_party/skia/src/pdf/SkDeflate.h -FILE: ../../../third_party/skia/src/pdf/SkPDFFormXObject.cpp -FILE: ../../../third_party/skia/src/pdf/SkPDFFormXObject.h -FILE: ../../../third_party/skia/src/pdf/SkPDFGraphicState.h -FILE: ../../../third_party/skia/src/pdf/SkPDFTypes.h ----------------------------------------------------------------------------------------------------- -Copyright 2010 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkFlattenablePriv.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkFlattenablePriv.h -FILE: ../../../third_party/skia/src/core/SkGlyphRun.cpp -FILE: ../../../third_party/skia/src/core/SkGlyphRun.h ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkMatrixImageFilter.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkMatrixImageFilter.cpp -FILE: ../../../third_party/skia/src/core/SkMatrixImageFilter.h -FILE: ../../../third_party/skia/src/opts/SkColor_opts_SSE2.h ----------------------------------------------------------------------------------------------------- -Copyright 2014 The Android Open Source Project - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/core/SkTraceEvent.h + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/core/SkTraceEvent.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/gpu/GrDistanceFieldGenFromVector.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/gpu/GrDistanceFieldGenFromVector.cpp -FILE: ../../../third_party/skia/src/gpu/GrDistanceFieldGenFromVector.h ----------------------------------------------------------------------------------------------------- -Copyright 2017 ARM Ltd. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2014 Google Inc. -Copyright 2017 ARM Ltd. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2009 Motorola - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.cpp -FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct.h -FILE: ../../../third_party/skia/src/ports/SkFontConfigInterface_direct_factory.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2009-2015 Google Inc. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.cpp -FILE: ../../../third_party/skia/src/ports/SkFontHost_FreeType_common.h ----------------------------------------------------------------------------------------------------- -Copyright 2006-2012 The Android Open Source Project -Copyright 2012 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/ports/SkMemory_mozalloc.cpp + ../../../third_party/skia/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/skia/src/ports/SkMemory_mozalloc.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2011 Google Inc. -Copyright 2012 Mozilla Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: skia -ORIGIN: ../../../third_party/skia/src/sksl/GLSL.std.450.h -TYPE: LicenseType.unknown -FILE: ../../../third_party/skia/src/sksl/GLSL.std.450.h -FILE: ../../../third_party/skia/src/sksl/spirv.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2014-2016 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and/or associated documentation files (the "Materials"), -to deal in the Materials without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Materials, and to permit persons to whom the -Materials are furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Materials. -==================================================================================================== - -==================================================================================================== -LIBRARY: tcmalloc -ORIGIN: ../../../third_party/dart/third_party/tcmalloc/COPYING -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/tcmalloc/configure_command -FILE: ../../../third_party/dart/third_party/tcmalloc/include/config.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2005, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: tcmalloc -ORIGIN: ../../../third_party/dart/third_party/tcmalloc/include/gperftools/tcmalloc.h -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/tcmalloc/include/gperftools/tcmalloc.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2003, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: tonic -ORIGIN: ../../../garnet/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/tonic/dart_list.cc -FILE: ../../../third_party/tonic/dart_list.h -FILE: ../../../third_party/tonic/file_loader/file_loader_fuchsia.cc -FILE: ../../../third_party/tonic/file_loader/file_loader_posix.cc -FILE: ../../../third_party/tonic/file_loader/file_loader_win.cc -FILE: ../../../third_party/tonic/filesystem/filesystem/path_win.cc -FILE: ../../../third_party/tonic/filesystem/filesystem/portable_unistd.h -FILE: ../../../third_party/tonic/platform/platform_utils.h -FILE: ../../../third_party/tonic/platform/platform_utils_posix.cc -FILE: ../../../third_party/tonic/platform/platform_utils_win.cc ----------------------------------------------------------------------------------------------------- -Copyright 2017 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: tonic -ORIGIN: ../../../third_party/tonic/LICENSE +LIBRARY: tonic +ORIGIN: ../../../third_party/tonic/LICENSE TYPE: LicenseType.bsd FILE: ../../../third_party/tonic/common/build_config.h FILE: ../../../third_party/tonic/converter/dart_converter.cc @@ -21318,33 +16060,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: vulkanmemoryallocator -ORIGIN: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/LICENSE.txt -TYPE: LicenseType.mit -FILE: ../../../third_party/skia/third_party/vulkanmemoryallocator/include/vk_mem_alloc.h ----------------------------------------------------------------------------------------------------- -Copyright (c) 2017-2018 Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -==================================================================================================== - ==================================================================================================== LIBRARY: zlib ORIGIN: ../../../third_party/zlib/LICENSE @@ -22080,4 +16795,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 325 +Total license count: 279 diff --git a/travis/licenses_golden/licenses_topaz b/travis/licenses_golden/licenses_topaz deleted file mode 100644 index 23db62a06ba5f..0000000000000 --- a/travis/licenses_golden/licenses_topaz +++ /dev/null @@ -1,1456 +0,0 @@ -Signature: 752ea74efe31654aef9d549b7e32340c - -UNUSED LICENSES: - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -USED LICENSES: - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/public/lib/app_driver/dart/lib/src/service_client.dart ----------------------------------------------------------------------------------------------------- -Copyright 2014 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../garnet/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/app/bluetooth_settings/lib/main.dart -FILE: ../../../topaz/app/bluetooth_settings/lib/src/modular/module_model.dart -FILE: ../../../topaz/app/bluetooth_settings/lib/src/screen.dart -FILE: ../../../topaz/app/chat/agents/content_provider/lib/main.dart -FILE: ../../../topaz/app/chat/agents/content_provider/lib/src/base_page_watcher.dart -FILE: ../../../topaz/app/chat/agents/content_provider/lib/src/chat_content_provider_impl.dart -FILE: ../../../topaz/app/chat/agents/content_provider/lib/src/chat_message_transporter.dart -FILE: ../../../topaz/app/chat/agents/content_provider/lib/src/conversation_list_watcher.dart -FILE: ../../../topaz/app/chat/agents/content_provider/lib/src/conversation_watcher.dart -FILE: ../../../topaz/app/chat/agents/content_provider/lib/src/firebase_chat_message_transporter.dart -FILE: ../../../topaz/app/chat/agents/content_provider/lib/src/proposer.dart -FILE: ../../../topaz/app/chat/agents/firebase_db_client/lib/main.dart -FILE: ../../../topaz/app/chat/agents/firebase_db_client/lib/src/exceptions.dart -FILE: ../../../topaz/app/chat/agents/firebase_db_client/lib/src/firebase_db_client_impl.dart -FILE: ../../../topaz/app/chat/agents/firebase_db_client/lib/src/firebase_db_connector_impl.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/fixtures.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/models.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/fixtures/fixtures.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/models.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/models/command_message.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/models/image_url_message.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/models/message.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/models/section.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/models/text_message.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/modular/conversation_module_model.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/modular/conversation_screen.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/modular/embedder.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/widgets/chat_bubble.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/widgets/chat_conversation.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/widgets/chat_section.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/widgets/message_input.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/widgets.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/fixtures.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/models.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/fixtures/fixtures.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/models.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/models/conversation.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/models/form_model.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/modular/conversation_list_module_model.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/modular/conversation_list_screen.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/chat_conversation_list.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/chat_conversation_list_item.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/chat_group_avatar.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/constants.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/error_screen.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/new_chat_conversation_form.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/widgets.dart -FILE: ../../../topaz/app/chat/packages/chat_models/lib/src/user_model.dart -FILE: ../../../topaz/app/chat/services/chat_content_provider.fidl -FILE: ../../../topaz/app/chat/services/firebase_db_client.fidl -FILE: ../../../topaz/app/contacts/agents/content_provider/lib/main.dart -FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/contacts_content_provider_impl.dart -FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/contacts_watcher.dart -FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/modular/entity_helpers.dart -FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/store/contacts_store.dart -FILE: ../../../topaz/app/contacts/agents/content_provider/lib/src/store/prefix_tree.dart -FILE: ../../../topaz/app/contacts/agents/content_provider/lib/store.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/main.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/models/contact_card_model.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_activity.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_card.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/contact_details.dart -FILE: ../../../topaz/app/contacts/modules/contact_card/lib/src/widgets/header.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/main.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/models.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/actions.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/contact_item.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/models/contact_list_model.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/service/contacts_service.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/widgets/contact_list.dart -FILE: ../../../topaz/app/contacts/modules/contact_list/lib/src/widgets/contact_list_item.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/main.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/contact_item_store.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/stores/contacts_picker_store.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/widgets/contact_item.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/src/widgets/contacts_picker.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/stores.dart -FILE: ../../../topaz/app/contacts/modules/contacts_picker/lib/widgets.dart -FILE: ../../../topaz/app/contacts/services/fidl/contacts_content_provider.fidl -FILE: ../../../topaz/app/dashboard/lib/build_status_model.dart -FILE: ../../../topaz/app/dashboard/lib/build_status_widget.dart -FILE: ../../../topaz/app/dashboard/lib/buildbucket/build_bucket_service.dart -FILE: ../../../topaz/app/dashboard/lib/chatter.dart -FILE: ../../../topaz/app/dashboard/lib/dashboard_app.dart -FILE: ../../../topaz/app/dashboard/lib/dashboard_module_model.dart -FILE: ../../../topaz/app/dashboard/lib/enums.dart -FILE: ../../../topaz/app/dashboard/lib/info_text.dart -FILE: ../../../topaz/app/dashboard/lib/main.dart -FILE: ../../../topaz/app/dashboard/lib/service/build_info.dart -FILE: ../../../topaz/app/dashboard/lib/service/build_service.dart -FILE: ../../../topaz/app/documents/agents/content_provider/lib/main.dart -FILE: ../../../topaz/app/documents/agents/content_provider/lib/src/documents_content_provider_impl.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/main.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/browser.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/doc_list_item.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/image_viewer.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/selectable_item.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/thumbnail.dart -FILE: ../../../topaz/app/documents/modules/info/lib/main.dart -FILE: ../../../topaz/app/documents/modules/info/lib/src/widgets/info.dart -FILE: ../../../topaz/app/documents/packages/utils/lib/utils.dart -FILE: ../../../topaz/app/documents/services/document.fidl -FILE: ../../../topaz/app/file_explorer/lib/folder_widget.dart -FILE: ../../../topaz/app/file_explorer/lib/main.dart -FILE: ../../../topaz/app/image/lib/main.dart -FILE: ../../../topaz/app/image/lib/src/modular/module_model.dart -FILE: ../../../topaz/app/infinite_scroller/lib/main.dart -FILE: ../../../topaz/app/latin-ime/hard_kb_ime/main.dart -FILE: ../../../topaz/app/latin-ime/main.dart -FILE: ../../../topaz/app/ledger/ledger_dashboard/main.dart -FILE: ../../../topaz/app/ledger/ledger_dashboard/src/data_handler.dart -FILE: ../../../topaz/app/ledger/ledger_dashboard/src/ledger_debug_data_handler.dart -FILE: ../../../topaz/app/ledger/ledger_dashboard/webroot/index.html -FILE: ../../../topaz/app/link_viewer/lib/main.dart -FILE: ../../../topaz/app/link_viewer/lib/src/modular/module_model.dart -FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/main.dart -FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/src/action_log.dart -FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/src/context.dart -FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/src/data_handler.dart -FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/src/proposal_subscribers.dart -FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/index.html -FILE: ../../../topaz/app/maxwell/agents/module_suggester_dart/main.dart -FILE: ../../../topaz/app/maxwell/agents/usage_log/main.dart -FILE: ../../../topaz/app/perspective/lib/main.dart -FILE: ../../../topaz/app/spinning_cube/lib/spinning_cube_gem.dart -FILE: ../../../topaz/app/video/modules/video/lib/main.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/modular/player_model.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/constants.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/loading.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/play_controls.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/player.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/screen.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/scrubber.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_app.dart -FILE: ../../../topaz/app/xi/modules/xi_app/lib/main.dart -FILE: ../../../topaz/app/xi/modules/xi_app/lib/src/xi_fuchsia_client.dart -FILE: ../../../topaz/app/xi/packages/widgets/lib/src/editor.dart -FILE: ../../../topaz/app/xi/packages/widgets/lib/src/home_page.dart -FILE: ../../../topaz/app/xi/packages/widgets/lib/src/line_cache.dart -FILE: ../../../topaz/app/xi/packages/widgets/lib/src/text_line.dart -FILE: ../../../topaz/app/xi/packages/widgets/lib/src/xi_app.dart -FILE: ../../../topaz/app/xi/packages/widgets/lib/widgets.dart -FILE: ../../../topaz/app/xi/packages/xi_client/lib/client.dart -FILE: ../../../topaz/app/xi/xi_flutter/lib/main.dart -FILE: ../../../topaz/app/xi/xi_flutter/lib/src/xi_flutter_client.dart -FILE: ../../../topaz/examples/bluetooth/ble_rect/lib/main.dart -FILE: ../../../topaz/examples/bluetooth/ble_rect/lib/src/modular/module_model.dart -FILE: ../../../topaz/examples/bluetooth/ble_rect/lib/src/screen.dart -FILE: ../../../topaz/examples/bluetooth/ble_scanner/lib/main.dart -FILE: ../../../topaz/examples/bluetooth/ble_scanner/lib/src/manufacturer_names.dart -FILE: ../../../topaz/examples/bluetooth/ble_scanner/lib/src/modular/module_model.dart -FILE: ../../../topaz/examples/bluetooth/ble_scanner/lib/src/screen.dart -FILE: ../../../topaz/examples/bluetooth/ble_scanner/lib/src/widgets/scan_filter_button.dart -FILE: ../../../topaz/examples/bluetooth/ble_scanner/lib/src/widgets/scan_filter_dialog.dart -FILE: ../../../topaz/examples/bluetooth/ble_scanner/lib/src/widgets/scan_results_widget.dart -FILE: ../../../topaz/examples/bluetooth/eddystone_advertiser/lib/main.dart -FILE: ../../../topaz/examples/bluetooth/eddystone_advertiser/lib/src/modular/module_model.dart -FILE: ../../../topaz/examples/bluetooth/eddystone_advertiser/lib/src/screen.dart -FILE: ../../../topaz/examples/eddystone_agent/main.dart -FILE: ../../../topaz/examples/ledger/todo_list/lib/main.dart -FILE: ../../../topaz/examples/ledger/todo_list/lib/src/ledger_helpers.dart -FILE: ../../../topaz/examples/ledger/todo_list/lib/src/modular/todo_list_module_model.dart -FILE: ../../../topaz/examples/ledger/todo_list/lib/src/modular/todo_list_module_screen.dart -FILE: ../../../topaz/examples/ledger/todo_list/lib/src/widgets/new_item_input.dart -FILE: ../../../topaz/examples/media/media_player_flutter/lib/asset.dart -FILE: ../../../topaz/examples/media/media_player_flutter/lib/config.dart -FILE: ../../../topaz/examples/media/media_player_flutter/lib/main.dart -FILE: ../../../topaz/examples/oauth_token_manager/credentials.fbs -FILE: ../../../topaz/examples/oauth_token_manager/oauth_token_manager.cc -FILE: ../../../topaz/examples/ui/jank/main.cc -FILE: ../../../topaz/examples/ui/lib/host_canvas_cycler.cc -FILE: ../../../topaz/examples/ui/lib/host_canvas_cycler.h -FILE: ../../../topaz/examples/ui/lib/host_surfaces.cc -FILE: ../../../topaz/examples/ui/lib/host_surfaces.h -FILE: ../../../topaz/examples/ui/lib/image_info.cc -FILE: ../../../topaz/examples/ui/lib/image_info.h -FILE: ../../../topaz/examples/ui/lib/skia_view.cc -FILE: ../../../topaz/examples/ui/lib/skia_view.h -FILE: ../../../topaz/examples/ui/paint/main.cc -FILE: ../../../topaz/examples/ui/sketchy_flutter/lib/main.dart -FILE: ../../../topaz/examples/ui/sketchy_flutter/lib/scenic.dart -FILE: ../../../topaz/examples/ui/sketchy_flutter/lib/scenic_widget.dart -FILE: ../../../topaz/examples/ui/sketchy_flutter/lib/src/resources.dart -FILE: ../../../topaz/examples/ui/sketchy_flutter/lib/src/session.dart -FILE: ../../../topaz/lib/tonic/dart_list.cc -FILE: ../../../topaz/lib/tonic/dart_list.h -FILE: ../../../topaz/lib/tonic/file_loader/file_loader_fuchsia.cc -FILE: ../../../topaz/lib/tonic/file_loader/file_loader_posix.cc -FILE: ../../../topaz/lib/tonic/file_loader/file_loader_win.cc -FILE: ../../../topaz/lib/tonic/platform/platform_utils.h -FILE: ../../../topaz/lib/tonic/platform/platform_utils_posix.cc -FILE: ../../../topaz/lib/tonic/platform/platform_utils_win.cc -FILE: ../../../topaz/public/dart-pkg/zircon/lib/src/handle.dart -FILE: ../../../topaz/public/dart-pkg/zircon/lib/src/system.dart -FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/handle.cc -FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/handle.h -FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/system.cc -FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/system.h -FILE: ../../../topaz/public/dart/entity_schemas/lib/entities.dart -FILE: ../../../topaz/public/dart/entity_schemas/lib/src/contact.dart -FILE: ../../../topaz/public/dart/entity_schemas/lib/src/email.dart -FILE: ../../../topaz/public/dart/entity_schemas/lib/src/phone_number.dart -FILE: ../../../topaz/public/dart/logging/lib/src/logging.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/application/application_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/model/embedder_model.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/model/idle_model.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/model/spring_model.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/model/ticking_model.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/modular/device_shell_model.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/modular/device_shell_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/modular/module_impl.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/modular/module_model.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/modular/module_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/modular/user_shell_model.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/modular/user_shell_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/simulated_positioned.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/text_placeholder.dart -FILE: ../../../topaz/public/lib/agent/dart/lib/agent.dart -FILE: ../../../topaz/public/lib/agent/dart/lib/src/agent_impl.dart -FILE: ../../../topaz/public/lib/app/dart/src/logging.dart -FILE: ../../../topaz/public/lib/component/dart/lib/component.dart -FILE: ../../../topaz/public/lib/component/dart/lib/src/message_receiver_impl.dart -FILE: ../../../topaz/public/lib/context/dart/context_listener_impl.dart -FILE: ../../../topaz/public/lib/decomposition/dart/decomposition.dart -FILE: ../../../topaz/public/lib/device/dart/lib/device.dart -FILE: ../../../topaz/public/lib/device/dart/lib/src/device_shell_impl.dart -FILE: ../../../topaz/public/lib/entity/dart/lib/entity.dart -FILE: ../../../topaz/public/lib/entity/dart/lib/src/entity_client.dart -FILE: ../../../topaz/public/lib/ledger/dart/lib/ledger.dart -FILE: ../../../topaz/public/lib/ledger/dart/lib/src/utils.dart -FILE: ../../../topaz/public/lib/media/dart/audio_player_controller.dart -FILE: ../../../topaz/public/lib/media/dart/audio_policy.dart -FILE: ../../../topaz/public/lib/media/dart/timeline.dart -FILE: ../../../topaz/public/lib/media/flutter/media_player.dart -FILE: ../../../topaz/public/lib/media/flutter/media_player_controller.dart -FILE: ../../../topaz/public/lib/media/flutter/progress_notifier.dart -FILE: ../../../topaz/public/lib/module/dart/lib/module.dart -FILE: ../../../topaz/public/lib/module_resolver/dart/intent_builder.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/email_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/phone_number_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/parse_int.dart -FILE: ../../../topaz/public/lib/story/dart/lib/story.dart -FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.cc -FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/src/natives.h -FILE: ../../../topaz/public/lib/user/dart/lib/src/user_shell_impl.dart -FILE: ../../../topaz/public/lib/user/dart/lib/user.dart -FILE: ../../../topaz/runtime/dart_runner/embedder/script_runner_snapshot.dart -FILE: ../../../topaz/runtime/dart_runner/integration/main.dart -FILE: ../../../topaz/runtime/web_runner/lib/dart/web_view.dart -FILE: ../../../topaz/runtime/web_runner/services/web_view.fidl -FILE: ../../../topaz/runtime/web_view/schema_org_context.h -FILE: ../../../topaz/runtime/web_view/test_webview.cpp -FILE: ../../../topaz/runtime/web_view/test_webview_link.cpp -FILE: ../../../topaz/runtime/web_view/web_view_impl.cpp -FILE: ../../../topaz/runtime/web_view/web_view_impl.h -FILE: ../../../topaz/runtime/web_view/web_view_provider.cpp -FILE: ../../../topaz/runtime/web_view/web_view_provider.h -FILE: ../../../topaz/shell/agents/home_work_agent/lib/home_work_proposer.dart -FILE: ../../../topaz/shell/agents/home_work_agent/lib/main.dart -FILE: ../../../topaz/shell/armadillo/lib/common.dart -FILE: ../../../topaz/shell/armadillo/lib/next.dart -FILE: ../../../topaz/shell/armadillo/lib/now.dart -FILE: ../../../topaz/shell/armadillo/lib/overview.dart -FILE: ../../../topaz/shell/armadillo/lib/recent.dart -FILE: ../../../topaz/shell/armadillo/lib/src/common/debug_enabler.dart -FILE: ../../../topaz/shell/armadillo/lib/src/common/debug_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/common/elevations.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/interruption_overlay.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/next_builder.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/peek_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/suggestion_layout.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/voice_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/context_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/important_info.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/minimized_now_bar.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/now_builder.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/now_minimization_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/now_user_and_maximized_info.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/now_user_image.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/power_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/quick_settings_progress_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/timezone_picker.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/user_context_text.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/volume_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/overview/conductor_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/overview/default_scroll_configuration.dart -FILE: ../../../topaz/shell/armadillo/lib/src/overview/idle_mode_builder.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/candidate_info.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/cluster_layout.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/display_mode.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/drag_direction.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/edge_scroll_drag_target.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/focus_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/kenichi_edge_scrolling.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/line_segment.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/long_press_gesture_detector.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/panel_drag_target.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/panel_drag_target_generator.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/panel_event_handler.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/panel_resizing_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/panel_resizing_overlay.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/recents_builder.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_cluster_drag_data.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_cluster_drag_state_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_cluster_entrance_transition_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_drag_transition_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_rearrangement_scrim_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/target_influence_overlay.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/target_overlay.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/active_agents_manager.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/armadillo_user_shell_model.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/audio_policy_volume_model.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/context_provider_context_model.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/focus_request_watcher_impl.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/focused_stories_tracker.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/initial_focus_setter.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/maxwell_hotword.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/maxwell_voice_model.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/power_manager_power_model.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/rate_limited_retry.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/user_logoutter.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/wallpaper_chooser.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/launcher.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/launcher_toggle.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/main.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/root.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/status_panel.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/status_tray.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/widgets/animated_content_builder.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/widgets/system_overlay.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/widgets/toggle.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/window/model.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/window/window.dart -FILE: ../../../topaz/shell/capybara_user_shell/lib/window_playground.dart -FILE: ../../../topaz/shell/infra/config/cq.cfg -FILE: ../../../topaz/shell/kernel_panic/lib/kernel_panic.dart -FILE: ../../../topaz/shell/kernel_panic/lib/main.dart -FILE: ../../../topaz/shell/kernel_panic/lib/qr_code_widget.dart -FILE: ../../../topaz/shell/mondrian_story_shell/examples/manual/lib/main.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/child_view.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/copresent_layout.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/flux.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/isometric_widget.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/layout_model.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/logo.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/main.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/model.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/overview.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/sim.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/sized_surface.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_details.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_director.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_form.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_frame.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/surface_stage.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/tree.dart -FILE: ../../../topaz/shell/timezone/lib/timezone_picker.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_context_impl.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_overlay.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/authentication_overlay_model.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/circular_button.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/clock.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/device_extender.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/device_extension_state.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/main.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/netstack_model.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/soft_keyboard_container_impl.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_list.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_picker_device_shell_model.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_picker_device_shell_screen.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_picker_screen.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_shell_chooser.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_watcher_impl.dart -FILE: ../../../topaz/shell/wifi_settings/lib/main.dart -FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/access_point.dart -FILE: ../../../topaz/shell/wifi_settings/lib/src/fuchsia/wifi_settings_model.dart ----------------------------------------------------------------------------------------------------- -Copyright 2017 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../third_party/icu/scripts/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/shell/widgets/lib/icon_slider.dart ----------------------------------------------------------------------------------------------------- -Copyright 2015 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/MAINTAINERS -FILE: ../../../topaz/app/chat/agents/content_provider/meta/sandbox -FILE: ../../../topaz/app/chat/agents/firebase_db_client/meta/sandbox -FILE: ../../../topaz/app/chat/modules/conversation/lib/main.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/widgets.dart -FILE: ../../../topaz/app/chat/modules/conversation/lib/src/widgets/time_util.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/main.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/models/user.dart -FILE: ../../../topaz/app/chat/modules/conversation_list/lib/src/widgets/time_util.dart -FILE: ../../../topaz/app/contacts/agents/content_provider/meta/sandbox -FILE: ../../../topaz/app/contacts/modules/contact_card/manifest.json -FILE: ../../../topaz/app/contacts/modules/contacts_picker/manifest.json -FILE: ../../../topaz/app/dashboard/android/app/src/main/AndroidManifest.xml -FILE: ../../../topaz/app/dashboard/android/app/src/main/java/com/yourcompany/dashboard/MainActivity.java -FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -FILE: ../../../topaz/app/dashboard/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -FILE: ../../../topaz/app/dashboard/android/gradle.properties -FILE: ../../../topaz/app/dashboard/config/dashboard.config -FILE: ../../../topaz/app/dashboard/ios/Flutter/Debug.xcconfig -FILE: ../../../topaz/app/dashboard/ios/Flutter/Release.xcconfig -FILE: ../../../topaz/app/dashboard/ios/Podfile -FILE: ../../../topaz/app/dashboard/ios/Podfile.lock -FILE: ../../../topaz/app/dashboard/ios/Pods/Manifest.lock -FILE: ../../../topaz/app/dashboard/ios/Pods/Pods.xcodeproj/project.pbxproj -FILE: ../../../topaz/app/dashboard/ios/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-Runner.xcscheme -FILE: ../../../topaz/app/dashboard/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-acknowledgements.markdown -FILE: ../../../topaz/app/dashboard/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-acknowledgements.plist -FILE: ../../../topaz/app/dashboard/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-dummy.m -FILE: ../../../topaz/app/dashboard/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig -FILE: ../../../topaz/app/dashboard/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig -FILE: ../../../topaz/app/dashboard/ios/Runner.xcodeproj/project.pbxproj -FILE: ../../../topaz/app/dashboard/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata -FILE: ../../../topaz/app/dashboard/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme -FILE: ../../../topaz/app/dashboard/ios/Runner.xcworkspace/contents.xcworkspacedata -FILE: ../../../topaz/app/dashboard/ios/Runner/AppDelegate.h -FILE: ../../../topaz/app/dashboard/ios/Runner/AppDelegate.m -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@1x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@3x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -FILE: ../../../topaz/app/dashboard/ios/Runner/Base.lproj/LaunchScreen.storyboard -FILE: ../../../topaz/app/dashboard/ios/Runner/Base.lproj/Main.storyboard -FILE: ../../../topaz/app/dashboard/ios/Runner/Info.plist -FILE: ../../../topaz/app/dashboard/ios/Runner/main.m -FILE: ../../../topaz/app/dashboard/meta/sandbox -FILE: ../../../topaz/app/documents/modules/info/meta/manifest.json -FILE: ../../../topaz/app/file_explorer/meta/sandbox -FILE: ../../../topaz/app/image/manifest.json -FILE: ../../../topaz/app/ledger/ledger_dashboard/dashboard.config -FILE: ../../../topaz/app/ledger/ledger_dashboard/webroot/dashboard.js -FILE: ../../../topaz/app/ledger/ledger_dashboard/webroot/logo.png -FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/dashboard.config -FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/dashboard.js -FILE: ../../../topaz/app/maxwell/agents/mi_dashboard/webroot/logo.png -FILE: ../../../topaz/app/perspective/lib/res/module-a-photos/1-sea-withtext.png -FILE: ../../../topaz/app/perspective/lib/res/module-a-photos/2-pano-withtext.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/1.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/10.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/11.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/2.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/3.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/4.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/5.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/6.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/7.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/8.png -FILE: ../../../topaz/app/perspective/lib/res/module-b-gallery-photos/9.png -FILE: ../../../topaz/app/perspective/lib/res/module-c-video/1-vid.png -FILE: ../../../topaz/app/spinning_cube/lib/main.dart -FILE: ../../../topaz/app/term/config/term.config -FILE: ../../../topaz/app/term/key_util.cc -FILE: ../../../topaz/app/term/key_util.h -FILE: ../../../topaz/app/term/main.cc -FILE: ../../../topaz/app/term/meta/sandbox -FILE: ../../../topaz/app/term/term_model.cc -FILE: ../../../topaz/app/term/term_model.h -FILE: ../../../topaz/app/term/term_params.cc -FILE: ../../../topaz/app/term/term_params.h -FILE: ../../../topaz/app/term/view_controller.cc -FILE: ../../../topaz/app/term/view_controller.h -FILE: ../../../topaz/app/video/modules/video/assets/video-background.png -FILE: ../../../topaz/app/video/modules/video/assets/video-thumbnail.png -FILE: ../../../topaz/app/video/modules/video/manifest.json -FILE: ../../../topaz/app/xi/xi_flutter/android/AndroidManifest.xml -FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-hdpi/ic_launcher.png -FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-mdpi/ic_launcher.png -FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-xhdpi/ic_launcher.png -FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-xxhdpi/ic_launcher.png -FILE: ../../../topaz/app/xi/xi_flutter/android/res/mipmap-xxxhdpi/ic_launcher.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Flutter/Debug.xcconfig -FILE: ../../../topaz/app/xi/xi_flutter/ios/Flutter/Release.xcconfig -FILE: ../../../topaz/app/xi/xi_flutter/ios/Podfile -FILE: ../../../topaz/app/xi/xi_flutter/ios/Podfile.lock -FILE: ../../../topaz/app/xi/xi_flutter/ios/Pods/Manifest.lock -FILE: ../../../topaz/app/xi/xi_flutter/ios/Pods/Pods.xcodeproj/project.pbxproj -FILE: ../../../topaz/app/xi/xi_flutter/ios/Pods/Pods.xcodeproj/xcshareddata/xcschemes/Pods-Runner.xcscheme -FILE: ../../../topaz/app/xi/xi_flutter/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-acknowledgements.markdown -FILE: ../../../topaz/app/xi/xi_flutter/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-acknowledgements.plist -FILE: ../../../topaz/app/xi/xi_flutter/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-dummy.m -FILE: ../../../topaz/app/xi/xi_flutter/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig -FILE: ../../../topaz/app/xi/xi_flutter/ios/Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner.xcodeproj/project.pbxproj -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/AppDelegate.h -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/AppDelegate.m -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@1x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@3x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Base.lproj/LaunchScreen.storyboard -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Base.lproj/Main.storyboard -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/Info.plist -FILE: ../../../topaz/app/xi/xi_flutter/ios/Runner/main.m -FILE: ../../../topaz/app/xi/xi_flutter/xi_flutter.iml -FILE: ../../../topaz/examples/fidl/echo_server_dart/lib/main.dart -FILE: ../../../topaz/examples/media/media_player_flutter/media_player_flutter.config -FILE: ../../../topaz/examples/media/media_player_flutter/meta/sandbox -FILE: ../../../topaz/examples/media/media_player_skia/main.cc -FILE: ../../../topaz/examples/media/media_player_skia/media_player_params.cc -FILE: ../../../topaz/examples/media/media_player_skia/media_player_params.h -FILE: ../../../topaz/examples/media/media_player_skia/media_player_view.cc -FILE: ../../../topaz/examples/media/media_player_skia/media_player_view.h -FILE: ../../../topaz/examples/media/vu_meter/main.cc -FILE: ../../../topaz/examples/media/vu_meter/vu_meter_params.cc -FILE: ../../../topaz/examples/media/vu_meter/vu_meter_params.h -FILE: ../../../topaz/examples/media/vu_meter/vu_meter_view.cc -FILE: ../../../topaz/examples/media/vu_meter/vu_meter_view.h -FILE: ../../../topaz/examples/ui/hello_material/main.dart -FILE: ../../../topaz/examples/ui/jank/jank_view.cc -FILE: ../../../topaz/examples/ui/jank/jank_view.h -FILE: ../../../topaz/examples/ui/lib/skia_font_loader.cc -FILE: ../../../topaz/examples/ui/lib/skia_font_loader.h -FILE: ../../../topaz/examples/ui/lib/skia_vmo_data.cc -FILE: ../../../topaz/examples/ui/lib/skia_vmo_data.h -FILE: ../../../topaz/examples/ui/paint/paint_view.cc -FILE: ../../../topaz/examples/ui/paint/paint_view.h -FILE: ../../../topaz/lib/tonic/converter/dart_converter.cc -FILE: ../../../topaz/lib/tonic/converter/dart_converter.h -FILE: ../../../topaz/lib/tonic/dart_message_handler.cc -FILE: ../../../topaz/lib/tonic/dart_message_handler.h -FILE: ../../../topaz/lib/tonic/dart_microtask_queue.cc -FILE: ../../../topaz/lib/tonic/dart_microtask_queue.h -FILE: ../../../topaz/lib/tonic/dart_sticky_error.cc -FILE: ../../../topaz/lib/tonic/dart_sticky_error.h -FILE: ../../../topaz/lib/tonic/file_loader/file_loader.cc -FILE: ../../../topaz/lib/tonic/file_loader/file_loader.h -FILE: ../../../topaz/lib/tonic/logging/dart_error.cc -FILE: ../../../topaz/lib/tonic/logging/dart_error.h -FILE: ../../../topaz/lib/tonic/logging/dart_invoke.cc -FILE: ../../../topaz/lib/tonic/logging/dart_invoke.h -FILE: ../../../topaz/lib/tonic/parsers/packages_map.cc -FILE: ../../../topaz/lib/tonic/parsers/packages_map.h -FILE: ../../../topaz/lib/tonic/scopes/dart_api_scope.h -FILE: ../../../topaz/lib/tonic/scopes/dart_isolate_scope.cc -FILE: ../../../topaz/lib/tonic/scopes/dart_isolate_scope.h -FILE: ../../../topaz/lib/tonic/typed_data/dart_byte_data.h -FILE: ../../../topaz/lib/tonic/typed_data/int32_list.h -FILE: ../../../topaz/lib/tonic/typed_data/uint8_list.h -FILE: ../../../topaz/manifest/dart -FILE: ../../../topaz/manifest/dart_head -FILE: ../../../topaz/manifest/dart_third_party_pkg -FILE: ../../../topaz/manifest/dart_third_party_pkg_head -FILE: ../../../topaz/manifest/flutter -FILE: ../../../topaz/manifest/minimal -FILE: ../../../topaz/manifest/skia -FILE: ../../../topaz/manifest/third_party -FILE: ../../../topaz/manifest/topaz -FILE: ../../../topaz/manifest/topaz-unstable -FILE: ../../../topaz/packages/all -FILE: ../../../topaz/packages/config/dashboard -FILE: ../../../topaz/packages/config/ermine_user_shell -FILE: ../../../topaz/packages/config/term -FILE: ../../../topaz/packages/default -FILE: ../../../topaz/packages/dev -FILE: ../../../topaz/packages/examples/all -FILE: ../../../topaz/packages/examples/dart -FILE: ../../../topaz/packages/examples/fidl -FILE: ../../../topaz/packages/examples/misc -FILE: ../../../topaz/packages/examples/mondrian -FILE: ../../../topaz/packages/examples/spinning_cube -FILE: ../../../topaz/packages/examples/ui -FILE: ../../../topaz/packages/kitchen_sink -FILE: ../../../topaz/packages/prod/all -FILE: ../../../topaz/packages/prod/bluetooth_settings -FILE: ../../../topaz/packages/prod/color -FILE: ../../../topaz/packages/prod/contacts -FILE: ../../../topaz/packages/prod/curl -FILE: ../../../topaz/packages/prod/dart -FILE: ../../../topaz/packages/prod/dart_aot_product_runner -FILE: ../../../topaz/packages/prod/dart_aot_runner -FILE: ../../../topaz/packages/prod/dart_jit_product_runner -FILE: ../../../topaz/packages/prod/dart_jit_runner -FILE: ../../../topaz/packages/prod/dart_runner -FILE: ../../../topaz/packages/prod/dashboard -FILE: ../../../topaz/packages/prod/disabled/chat -FILE: ../../../topaz/packages/prod/documents -FILE: ../../../topaz/packages/prod/file_explorer -FILE: ../../../topaz/packages/prod/flutter -FILE: ../../../topaz/packages/prod/flutter_aot -FILE: ../../../topaz/packages/prod/flutter_jit -FILE: ../../../topaz/packages/prod/google_auth_provider -FILE: ../../../topaz/packages/prod/image -FILE: ../../../topaz/packages/prod/infinite_scroller -FILE: ../../../topaz/packages/prod/latin-ime -FILE: ../../../topaz/packages/prod/maxwell -FILE: ../../../topaz/packages/prod/mods -FILE: ../../../topaz/packages/prod/mondrian -FILE: ../../../topaz/packages/prod/oauth_token_manager -FILE: ../../../topaz/packages/prod/perspective -FILE: ../../../topaz/packages/prod/spotify_auth_provider -FILE: ../../../topaz/packages/prod/sqlite -FILE: ../../../topaz/packages/prod/sysui -FILE: ../../../topaz/packages/prod/term -FILE: ../../../topaz/packages/prod/video -FILE: ../../../topaz/packages/prod/web_view -FILE: ../../../topaz/packages/prod/webkit -FILE: ../../../topaz/packages/prod/xi -FILE: ../../../topaz/packages/products/dashboard -FILE: ../../../topaz/packages/products/term -FILE: ../../../topaz/packages/sdk/dart -FILE: ../../../topaz/packages/tools/all -FILE: ../../../topaz/packages/tools/dart -FILE: ../../../topaz/packages/tools/doc_checker -FILE: ../../../topaz/packages/tools/ermine_user_shell -FILE: ../../../topaz/packages/tools/ledger -FILE: ../../../topaz/packages/tools/link_viewer -FILE: ../../../topaz/packages/topaz -FILE: ../../../topaz/public/dart-pkg/fuchsia/lib/fuchsia.dart -FILE: ../../../topaz/public/dart-pkg/fuchsia/sdk_ext/fuchsia.cc -FILE: ../../../topaz/public/dart-pkg/fuchsia/sdk_ext/fuchsia.h -FILE: ../../../topaz/public/dart-pkg/zircon/lib/src/handle_waiter.dart -FILE: ../../../topaz/public/dart-pkg/zircon/lib/zircon.dart -FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/handle_waiter.cc -FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/handle_waiter.h -FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/natives.cc -FILE: ../../../topaz/public/dart-pkg/zircon/sdk_ext/natives.h -FILE: ../../../topaz/public/dart/config/lib/config.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/interface.dart -FILE: ../../../topaz/public/dart/fixtures/lib/fixtures.dart -FILE: ../../../topaz/public/dart/fixtures/lib/src/fixtures.dart -FILE: ../../../topaz/public/dart/fixtures/lib/src/name.dart -FILE: ../../../topaz/public/dart/fixtures/lib/src/names.dart -FILE: ../../../topaz/public/dart/fixtures/lib/src/namespace.dart -FILE: ../../../topaz/public/dart/fixtures/lib/src/sequence.dart -FILE: ../../../topaz/public/dart/mozart/lib/src/fakes/mozart_fakes.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/model/model.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/rk4_spring_simulation.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/ticking_double_state.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/ticking_state.dart -FILE: ../../../topaz/public/lib/app/dart/app.dart -FILE: ../../../topaz/public/lib/ui/flutter/_sdkext -FILE: ../../../topaz/public/lib/ui/flutter/child_view.dart -FILE: ../../../topaz/public/lib/ui/flutter/sdk_ext/mozart.dart -FILE: ../../../topaz/public/lib/widgets/dart/lib/src/model/model.dart -FILE: ../../../topaz/runtime/MAINTAINERS -FILE: ../../../topaz/runtime/dart_runner/builtin_libraries.cc -FILE: ../../../topaz/runtime/dart_runner/builtin_libraries.h -FILE: ../../../topaz/runtime/dart_runner/dart_application_controller.cc -FILE: ../../../topaz/runtime/dart_runner/dart_application_controller.h -FILE: ../../../topaz/runtime/dart_runner/dart_application_runner.cc -FILE: ../../../topaz/runtime/dart_runner/dart_application_runner.h -FILE: ../../../topaz/runtime/dart_runner/embedder/builtin.dart -FILE: ../../../topaz/runtime/dart_runner/embedder/snapshot.cc.tmpl -FILE: ../../../topaz/runtime/dart_runner/embedder/snapshot.dart -FILE: ../../../topaz/runtime/dart_runner/embedder/snapshot.h -FILE: ../../../topaz/runtime/dart_runner/examples/goodbye_dart/goodbye_dart.dart -FILE: ../../../topaz/runtime/dart_runner/examples/greeting/greeting.dart -FILE: ../../../topaz/runtime/dart_runner/examples/hello_app_dart/interfaces/hello.fidl -FILE: ../../../topaz/runtime/dart_runner/examples/hello_app_dart/main.dart -FILE: ../../../topaz/runtime/dart_runner/examples/hello_dart/bin/hello_dart.dart -FILE: ../../../topaz/runtime/dart_runner/kernel/libraries.json -FILE: ../../../topaz/runtime/dart_runner/main.cc -FILE: ../../../topaz/runtime/dart_runner/meta/aot_product_runtime -FILE: ../../../topaz/runtime/dart_runner/meta/aot_runtime -FILE: ../../../topaz/runtime/dart_runner/meta/jit_product_runtime -FILE: ../../../topaz/runtime/dart_runner/meta/jit_runtime -FILE: ../../../topaz/runtime/dart_runner/meta/sandbox -FILE: ../../../topaz/runtime/flutter_runner/kernel/libraries.json -FILE: ../../../topaz/runtime/flutter_runner/meta/aot_runtime -FILE: ../../../topaz/runtime/flutter_runner/meta/jit_runtime -FILE: ../../../topaz/runtime/flutter_runner/meta/source_runtime -FILE: ../../../topaz/runtime/web_runner/web_view_component.json -FILE: ../../../topaz/runtime/web_view/js/package.json -FILE: ../../../topaz/runtime/web_view/js/src/entity.ts -FILE: ../../../topaz/runtime/web_view/js/src/jsonld.ts -FILE: ../../../topaz/runtime/web_view/js/src/main.ts -FILE: ../../../topaz/runtime/web_view/js/src/microdata.ts -FILE: ../../../topaz/runtime/web_view/js/src/util.ts -FILE: ../../../topaz/runtime/web_view/js/tsconfig.json -FILE: ../../../topaz/runtime/web_view/js/webpack.config.js -FILE: ../../../topaz/runtime/web_view/schema_org_context.cpp -FILE: ../../../topaz/shell/Armadillo.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/1-portugal-the-man.jpeg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/9-hotel.jpg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/9-nonch-harpin.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/ask_proposals.json -FILE: ../../../topaz/shell/agents/home_work_agent/assets/calendar.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/cc0_calafia.jpg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/cc0_music.jpg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/chat_96dp.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/cinefilm_96.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/contextual_location_proposals.json -FILE: ../../../topaz/shell/agents/home_work_agent/assets/danielle_cc0.jpg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/docs.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/drawing.jpeg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/expenses_96.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/google_photos.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/ic_stat_3_googblue_2x_web_24dp.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/inbox_96dp.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/logo_fitness_color_2x_web_96.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/logo_mostly_sunny_light_color_96dp.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/miguel_cc0.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/music_96dp.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/panda.png.jpg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/pavlova.jpg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/shamra.jpg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/simon_96.jpg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/slides.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/sophie_cc0.jpg -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_calendar.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_cinefilm.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_expense.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_fluxMemories.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_googleIO.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_hype.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_marketing.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_natureSense.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_overthrough.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_phonecall.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_steps.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_threepeaks.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_toetheline.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_topcook.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/story_truefoods.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/tahiti_240.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/threepeaks.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/truefood.png -FILE: ../../../topaz/shell/agents/home_work_agent/assets/youtube_96dp.png -FILE: ../../../topaz/shell/agents/home_work_agent/meta/sandbox -FILE: ../../../topaz/shell/armadillo/lib/res/Background.jpg -FILE: ../../../topaz/shell/armadillo/lib/res/googlelogo_color_62x24dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/googlemic_color_24dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/guest_user_image.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_airplanemode_active_black.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_airplanemode_inactive_grey600.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_20_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_30_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_50_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_60_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_80_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_90_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_alert_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_charging_20_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_charging_30_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_charging_50_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_charging_60_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_charging_80_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_charging_90_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_charging_full_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_full_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_battery_unknown_white_48dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_brightness_high_grey600.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_do_not_disturb_off_grey600.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_do_not_disturb_on_black.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_mic_grey600_1x_web_24dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_screen_lock_rotation_black.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_screen_rotation_black.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_signal_cellular_connected_no_internet_0_bar_grey600_24dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_signal_wifi_3_bar_grey600_24dp.png -FILE: ../../../topaz/shell/armadillo/lib/res/ic_volume_up_grey600.png -FILE: ../../../topaz/shell/armadillo/lib/res/logo_googleg_24dpx4.png -FILE: ../../../topaz/shell/armadillo/lib/src/common/nothing.dart -FILE: ../../../topaz/shell/armadillo/lib/src/common/size_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/common/wrapper_builder.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/expand_suggestion.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/peeking_overlay.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/selected_suggestion_overlay.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/splash_painter.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/splash_suggestion.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/suggestion.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/suggestion_list.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/suggestion_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/next/suggestion_widget.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/now.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/quick_settings.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/toggle_icon.dart -FILE: ../../../topaz/shell/armadillo/lib/src/now/vertical_shifter.dart -FILE: ../../../topaz/shell/armadillo/lib/src/overview/armadillo.dart -FILE: ../../../topaz/shell/armadillo/lib/src/overview/conductor.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/armadillo_drag_target.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/armadillo_overlay.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/optional_wrapper.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/panel.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/panel_drag_targets.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/place_holder_story.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/render_story_list_body.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/scroll_locker.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/simulated_fractional.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/simulated_fractionally_sized_box.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/simulated_padding.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/simulated_sized_box.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/simulated_transform.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_bar.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_cluster.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_cluster_drag_feedback.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_cluster_id.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_cluster_panels_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_cluster_stories_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_cluster_widget.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_full_size_simulated_sized_box.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_list.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_list_body_parent_data.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_list_layout.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_model.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_panels.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_positioned.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_time_randomizer.dart -FILE: ../../../topaz/shell/armadillo/lib/src/recent/story_title.dart -FILE: ../../../topaz/shell/armadillo_user_shell/assets/AgentIcon.png -FILE: ../../../topaz/shell/armadillo_user_shell/assets/aparna-home.jpg -FILE: ../../../topaz/shell/armadillo_user_shell/assets/aparna-sf.jpg -FILE: ../../../topaz/shell/armadillo_user_shell/assets/aparna-work.jpg -FILE: ../../../topaz/shell/armadillo_user_shell/assets/contextual_config.json -FILE: ../../../topaz/shell/armadillo_user_shell/assets/danielle-home.jpg -FILE: ../../../topaz/shell/armadillo_user_shell/lib/hit_test_model.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/main.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/story_provider_story_generator.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/story_provider_watcher_impl.dart -FILE: ../../../topaz/shell/armadillo_user_shell/lib/suggestion_provider_suggestion_model.dart -FILE: ../../../topaz/shell/armadillo_user_shell/meta/sandbox -FILE: ../../../topaz/shell/capybara_user_shell/lib/res/background.jpg -FILE: ../../../topaz/shell/docs/buttons.png -FILE: ../../../topaz/shell/docs/profiling.patch -FILE: ../../../topaz/shell/docs/profiling.png -FILE: ../../../topaz/shell/docs/timeline_settings.png -FILE: ../../../topaz/shell/docs/vm.png -FILE: ../../../topaz/shell/ermine_user_shell/assets/launch_ermine_only.json -FILE: ../../../topaz/shell/ermine_user_shell/config/ermine_user_shell.config -FILE: ../../../topaz/shell/keyboard/lib/keyboard.dart -FILE: ../../../topaz/shell/keyboard/lib/keys.dart -FILE: ../../../topaz/shell/keyboard/lib/res/ArrowDown.png -FILE: ../../../topaz/shell/keyboard/lib/res/ArrowUp.png -FILE: ../../../topaz/shell/keyboard/lib/res/Delete.png -FILE: ../../../topaz/shell/keyboard/lib/res/Icon_Input_En.png -FILE: ../../../topaz/shell/keyboard/lib/res/Space.png -FILE: ../../../topaz/shell/keyboard/lib/word_suggestion_service.dart -FILE: ../../../topaz/shell/userpicker_device_shell/meta/sandbox -FILE: ../../../topaz/shell/widgets/lib/default_bundle.dart -FILE: ../../../topaz/shell/widgets/lib/key_mappings.dart -FILE: ../../../topaz/shell/widgets/lib/three_column_aligned_layout_delegate.dart -FILE: ../../../topaz/shell/widgets/lib/time_stringer.dart -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_0_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_1_bar_lock_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_2_bar_lock_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_3_bar_lock_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/assets/ic_signal_wifi_4_bar_lock_grey600_48dp.png -FILE: ../../../topaz/shell/wifi_settings/meta/manifest.json ----------------------------------------------------------------------------------------------------- -Copyright 2016 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/app/chat/modules/conversation_info/lib/src/modular/conversation_info_module_model.dart + ../../../topaz/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/app/chat/modules/conversation_info/lib/main.dart -FILE: ../../../topaz/app/chat/modules/conversation_info/lib/src/modular/conversation_info_module_model.dart -FILE: ../../../topaz/app/chat/modules/conversation_info/lib/src/modular/conversation_info_screen.dart -FILE: ../../../topaz/app/chat/modules/conversation_info/lib/src/widgets.dart -FILE: ../../../topaz/app/chat/modules/conversation_info/lib/src/widgets/participants_section.dart -FILE: ../../../topaz/app/chat/modules/conversation_info/lib/src/widgets/title_section.dart -FILE: ../../../topaz/app/chat/modules/conversation_info/lib/widgets.dart -FILE: ../../../topaz/app/chat/packages/chat_models/lib/chat_models.dart -FILE: ../../../topaz/app/color/lib/main.dart -FILE: ../../../topaz/app/color/lib/src/color_model.dart -FILE: ../../../topaz/app/contacts/services/lib/client.dart -FILE: ../../../topaz/app/contacts/services/lib/src/contacts_content_provider_service_client.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/models/browser_model.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/header.dart -FILE: ../../../topaz/app/documents/modules/browser/lib/src/widgets/multi_select_header.dart -FILE: ../../../topaz/app/term/app.cc -FILE: ../../../topaz/app/term/app.h -FILE: ../../../topaz/app/term/pty_server.cc -FILE: ../../../topaz/app/term/pty_server.h -FILE: ../../../topaz/app/video/modules/video/lib/src/asset.dart -FILE: ../../../topaz/app/video/modules/video/lib/src/widgets/video_progress_monitor.dart -FILE: ../../../topaz/auth_providers/google/constants.h -FILE: ../../../topaz/auth_providers/google/factory_impl.cc -FILE: ../../../topaz/auth_providers/google/factory_impl.h -FILE: ../../../topaz/auth_providers/google/factory_impl_unittest.cc -FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl.cc -FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl.h -FILE: ../../../topaz/auth_providers/google/google_auth_provider_impl_unittest.cc -FILE: ../../../topaz/auth_providers/google/main.cc -FILE: ../../../topaz/auth_providers/oauth/oauth_request_builder.cc -FILE: ../../../topaz/auth_providers/oauth/oauth_request_builder.h -FILE: ../../../topaz/auth_providers/oauth/oauth_request_builder_unittest.cc -FILE: ../../../topaz/auth_providers/oauth/oauth_response.cc -FILE: ../../../topaz/auth_providers/oauth/oauth_response.h -FILE: ../../../topaz/auth_providers/oauth/oauth_response_unittest.cc -FILE: ../../../topaz/auth_providers/spotify/constants.h -FILE: ../../../topaz/auth_providers/spotify/factory_impl.cc -FILE: ../../../topaz/auth_providers/spotify/factory_impl.h -FILE: ../../../topaz/auth_providers/spotify/factory_impl_unittest.cc -FILE: ../../../topaz/auth_providers/spotify/main.cc -FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl.cc -FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl.h -FILE: ../../../topaz/auth_providers/spotify/spotify_auth_provider_impl_unittest.cc -FILE: ../../../topaz/examples/fidl/echo_client_dart/lib/main.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/main.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/todo_module.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_item_widget.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_list_widget.dart -FILE: ../../../topaz/examples/ledger/todo_list_sledge/lib/widgets/todo_widget.dart -FILE: ../../../topaz/examples/mine_digger/main.dart -FILE: ../../../topaz/examples/ui/async_hello_mod/main.dart -FILE: ../../../topaz/examples/ui/hello_mod/main.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/codec.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/enum.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/error.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/message.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/struct.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/types.dart -FILE: ../../../topaz/public/dart/fidl/lib/src/union.dart -FILE: ../../../topaz/public/dart/fuchsia/lib/src/fuchsia_fakes.dart -FILE: ../../../topaz/public/dart/logging/lib/src/frame_rate_tracer.dart -FILE: ../../../topaz/public/dart/sledge/lib/sledge.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/model/tracing_spring_model.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/modular/dank_user_shell_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/conditional_builder.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/future_widget.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/shadowed_text.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/channel.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/channel_reader.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/constants.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/errors.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/fakes/handle.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/fakes/handle_waiter.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/fakes/system.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/handle_wrapper.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/socket.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/socket_reader.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/vmo.dart -FILE: ../../../topaz/public/lib/app/dart/src/frame_rate_tracer.dart -FILE: ../../../topaz/public/lib/app_driver/dart/lib/app_driver.dart -FILE: ../../../topaz/public/lib/app_driver/dart/lib/module_driver.dart -FILE: ../../../topaz/public/lib/app_driver/dart/lib/src/module_driver.dart -FILE: ../../../topaz/public/lib/component/dart/lib/src/component_context_client.dart -FILE: ../../../topaz/public/lib/entity/dart/lib/src/entity_resolver_client.dart -FILE: ../../../topaz/public/lib/lifecycle/dart/lib/lifecycle.dart -FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_host.dart -FILE: ../../../topaz/public/lib/lifecycle/dart/lib/src/lifecycle_impl.dart -FILE: ../../../topaz/public/lib/media/flutter/media_progress.dart -FILE: ../../../topaz/public/lib/mod/dart/lib/mod.dart -FILE: ../../../topaz/public/lib/mod/dart/lib/src/mod.dart -FILE: ../../../topaz/public/lib/module/dart/lib/src/module_context_client.dart -FILE: ../../../topaz/public/lib/module/dart/lib/src/module_controller_client.dart -FILE: ../../../topaz/public/lib/module/dart/lib/src/module_host.dart -FILE: ../../../topaz/public/lib/module/dart/lib/src/module_impl.dart -FILE: ../../../topaz/public/lib/proposal/dart/lib/proposal.dart -FILE: ../../../topaz/public/lib/proposal/dart/lib/src/proposal_factory.dart -FILE: ../../../topaz/public/lib/run_mod/dart/lib/run_mod.dart -FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/run_mod.dart -FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/widgets/mod_failure_widget.dart -FILE: ../../../topaz/public/lib/run_mod/dart/lib/src/widgets/mod_loading_widget.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.color.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.contact.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.documents.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.intent.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.location.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com.fuchsia.status.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/codelab.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/finance/finance_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/lyrics/lyrics_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/codelab/recipe/recipe_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/asset_specifier/asset_specifier_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/captions/captions_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/media.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/fuchsia/media/progress/media_progress_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/com/google/youtube/video_id_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.color/color_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/contact_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.contact/filter_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.documents/documents_id_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.intent/intent_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/geolocation_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.location/street_location_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/com.fuchsia.status/status_entity_data.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/entity_codec.dart -FILE: ../../../topaz/public/lib/schemas/dart/lib/src/string_list_entity_codec.dart -FILE: ../../../topaz/public/lib/story/dart/lib/src/link_client.dart -FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_host.dart -FILE: ../../../topaz/public/lib/story/dart/lib/src/link_watcher_impl.dart -FILE: ../../../topaz/public/lib/user/dart/lib/src/dank_user_shell_impl.dart -FILE: ../../../topaz/public/lib/widgets/dart/lib/src/model/value_model.dart -FILE: ../../../topaz/runtime/dart_runner/kernel/compiler.dart -FILE: ../../../topaz/runtime/dart_runner/mapped_resource.cc -FILE: ../../../topaz/runtime/dart_runner/mapped_resource.h -FILE: ../../../topaz/runtime/dart_runner/service_isolate.cc -FILE: ../../../topaz/runtime/dart_runner/service_isolate.h -FILE: ../../../topaz/runtime/dart_runner/vmservice/empty.dart -FILE: ../../../topaz/runtime/web_view/js/dist/bundle.js -FILE: ../../../topaz/shell/armadillo/lib/src/now/wifi_settings.dart -FILE: ../../../topaz/shell/ermine_user_shell/app.cc -FILE: ../../../topaz/shell/ermine_user_shell/app.h -FILE: ../../../topaz/shell/ermine_user_shell/find_unique_ptr.h -FILE: ../../../topaz/shell/ermine_user_shell/main.cc -FILE: ../../../topaz/shell/ermine_user_shell/tile.cc -FILE: ../../../topaz/shell/ermine_user_shell/tile.h -FILE: ../../../topaz/shell/ermine_user_shell/view_controller.cc -FILE: ../../../topaz/shell/ermine_user_shell/view_controller.h -FILE: ../../../topaz/shell/mondrian_story_shell/lib/container_layout.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/inset_manager.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/pattern_layout.dart -FILE: ../../../topaz/shell/mondrian_story_shell/lib/positioned_surface.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_setup.dart -FILE: ../../../topaz/shell/userpicker_device_shell/lib/user_setup_model.dart -FILE: ../../../topaz/shell/wifi_settings/lib/src/wlan_manager.dart ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/examples/ui/lib/type_converters.cc + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/examples/ui/lib/type_converters.cc -FILE: ../../../topaz/examples/ui/lib/type_converters.h ----------------------------------------------------------------------------------------------------- -Copyright 2016 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/examples/ui/noodles/main.cc + ../../../topaz/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/examples/ui/noodles/main.cc -FILE: ../../../topaz/examples/ui/noodles/noodles_view.cc -FILE: ../../../topaz/examples/ui/noodles/noodles_view.h -FILE: ../../../topaz/lib/tonic/dart_args.h -FILE: ../../../topaz/lib/tonic/dart_binding_macros.h -FILE: ../../../topaz/lib/tonic/dart_class_library.cc -FILE: ../../../topaz/lib/tonic/dart_class_library.h -FILE: ../../../topaz/lib/tonic/dart_class_provider.cc -FILE: ../../../topaz/lib/tonic/dart_class_provider.h -FILE: ../../../topaz/lib/tonic/dart_library_natives.cc -FILE: ../../../topaz/lib/tonic/dart_library_natives.h -FILE: ../../../topaz/lib/tonic/dart_persistent_value.cc -FILE: ../../../topaz/lib/tonic/dart_persistent_value.h -FILE: ../../../topaz/lib/tonic/dart_state.cc -FILE: ../../../topaz/lib/tonic/dart_state.h -FILE: ../../../topaz/lib/tonic/dart_wrappable.cc -FILE: ../../../topaz/lib/tonic/dart_wrappable.h -FILE: ../../../topaz/lib/tonic/dart_wrapper_info.h -FILE: ../../../topaz/lib/tonic/typed_data/dart_byte_data.cc -FILE: ../../../topaz/lib/tonic/typed_data/float32_list.cc -FILE: ../../../topaz/lib/tonic/typed_data/float32_list.h -FILE: ../../../topaz/lib/tonic/typed_data/float64_list.cc -FILE: ../../../topaz/lib/tonic/typed_data/float64_list.h -FILE: ../../../topaz/lib/tonic/typed_data/int32_list.cc -FILE: ../../../topaz/lib/tonic/typed_data/uint8_list.cc ----------------------------------------------------------------------------------------------------- -Copyright 2015 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/public/dart/entity_schemas/lib/src/video.dart + ../../../topaz/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/public/dart/entity_schemas/lib/src/video.dart ----------------------------------------------------------------------------------------------------- -Copyright 2017 Th%e Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/public/dart/fidl/lib/fidl.dart + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/public/dart/fidl/lib/fidl.dart -FILE: ../../../topaz/public/dart/fuchsia/lib/fuchsia.dart -FILE: ../../../topaz/public/dart/logging/lib/logging.dart -FILE: ../../../topaz/public/dart/mozart/lib/mozart.dart -FILE: ../../../topaz/public/dart/zircon/lib/src/fakes/zircon_fakes.dart -FILE: ../../../topaz/public/dart/zircon/lib/zircon.dart -FILE: ../../../topaz/public/lib/app/dart/logging.dart -FILE: ../../../topaz/public/lib/widgets/dart/lib/model.dart ----------------------------------------------------------------------------------------------------- -Copyright 2018 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/public/dart/widgets/lib/src/widgets/alphatar.dart + ../../../LICENSE -TYPE: LicenseType.bsd -FILE: ../../../topaz/public/dart/widgets/lib/application.dart -FILE: ../../../topaz/public/dart/widgets/lib/model.dart -FILE: ../../../topaz/public/dart/widgets/lib/modular.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/alphatar.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/fuchsia_spinner.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/mondrian_spinner.dart -FILE: ../../../topaz/public/dart/widgets/lib/src/widgets/window_media_query.dart -FILE: ../../../topaz/public/dart/widgets/lib/widgets.dart ----------------------------------------------------------------------------------------------------- -Copyright 2017 The Chromium Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - -==================================================================================================== -LIBRARY: topaz -ORIGIN: ../../../topaz/runtime/web_view/main.cpp -TYPE: LicenseType.bsd -FILE: ../../../topaz/runtime/web_view/main.cpp ----------------------------------------------------------------------------------------------------- -Copyright 2016 The Fuchsia Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== -Total license count: 11 From 336c23f846a2683d043d3a3b504ae27eaf447efc Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 25 Jul 2018 13:20:48 -0700 Subject: [PATCH 0871/1190] Remove //flutter/glue and use FML directly. (#5862) --- assets/BUILD.gn | 1 - assets/asset_manager.cc | 2 +- assets/zip_asset_store.cc | 2 +- flow/BUILD.gn | 1 - flow/layers/layer.h | 2 +- flow/layers/layer_tree.cc | 2 +- flow/raster_cache.cc | 2 +- flow/scene_update_context.cc | 4 +-- fml/trace_event.h | 18 +++++++++++ glue/BUILD.gn | 30 ------------------- glue/README.md | 5 ---- glue/stack_trace.h | 14 --------- glue/stack_trace_base.cc | 11 ------- glue/stack_trace_fuchsia.cc | 11 ------- glue/trace_event.h | 26 ---------------- lib/ui/BUILD.gn | 9 +++--- lib/ui/compositing/scene.cc | 2 +- lib/ui/painting/codec.cc | 2 +- lib/ui/painting/image_encoding.cc | 2 +- runtime/BUILD.gn | 4 +-- runtime/runtime_controller.cc | 2 +- shell/common/BUILD.gn | 1 - shell/common/animator.cc | 2 +- shell/common/engine.cc | 2 +- shell/common/shell.cc | 2 +- shell/gpu/gpu.gni | 1 - shell/gpu/gpu_surface_gl.cc | 2 +- shell/platform/darwin/ios/BUILD.gn | 1 - .../ios/framework/Source/vsync_waiter_ios.mm | 2 +- synchronization/BUILD.gn | 2 +- synchronization/pipeline.h | 2 +- travis/licenses_golden/licenses_flutter | 4 --- 32 files changed, 42 insertions(+), 131 deletions(-) delete mode 100644 glue/BUILD.gn delete mode 100644 glue/README.md delete mode 100644 glue/stack_trace.h delete mode 100644 glue/stack_trace_base.cc delete mode 100644 glue/stack_trace_fuchsia.cc delete mode 100644 glue/trace_event.h diff --git a/assets/BUILD.gn b/assets/BUILD.gn index 580ecfb6ea41b..febd1eda76f6c 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -16,7 +16,6 @@ source_set("assets") { deps = [ "$flutter_root/common", "$flutter_root/fml", - "$flutter_root/glue", "//garnet/public/lib/fxl", ] diff --git a/assets/asset_manager.cc b/assets/asset_manager.cc index fce313d01c164..2155d24a78a26 100644 --- a/assets/asset_manager.cc +++ b/assets/asset_manager.cc @@ -5,7 +5,7 @@ #include "flutter/assets/asset_manager.h" #include "flutter/assets/directory_asset_bundle.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #ifdef ERROR #undef ERROR diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index 6f1ecd65af4d6..79f0cd16eca99 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -14,7 +14,7 @@ #include #include -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" namespace blink { diff --git a/flow/BUILD.gn b/flow/BUILD.gn index ab5b41653970a..a63dfad95ddfc 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -67,7 +67,6 @@ source_set("flow") { deps = [ "$flutter_root/common", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/synchronization", "//third_party/skia", "//third_party/skia:gpu", diff --git a/flow/layers/layer.h b/flow/layers/layer.h index 06ea2b2e6733a..d1a4f0ba13905 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -11,7 +11,7 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/build_config.h" #include "lib/fxl/logging.h" #include "lib/fxl/macros.h" diff --git a/flow/layers/layer_tree.cc b/flow/layers/layer_tree.cc index d5bacbd865c37..8f6f7494ae2fa 100644 --- a/flow/layers/layer_tree.cc +++ b/flow/layers/layer_tree.cc @@ -5,7 +5,7 @@ #include "flutter/flow/layers/layer_tree.h" #include "flutter/flow/layers/layer.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "third_party/skia/include/core/SkPictureRecorder.h" namespace flow { diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 0922cdcec37a0..33d5a99d2c6d5 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -7,7 +7,7 @@ #include #include "flutter/flow/paint_utils.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index dc72f28deef44..c4cb57e59afea 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -7,7 +7,7 @@ #include "flutter/flow/export_node.h" #include "flutter/flow/layers/layer.h" #include "flutter/flow/matrix_decomposition.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" namespace flow { @@ -94,7 +94,7 @@ void SceneUpdateContext::CreateFrame(scenic::EntityNode& entity_node, SetShapeColor(shape_node, color); scenic::Rectangle inner_shape(session_, inner_bounds.width(), - inner_bounds.height()); + inner_bounds.height()); scenic::ShapeNode inner_node(session_); inner_node.SetShape(inner_shape); inner_node.SetTranslation(inner_bounds.width() * 0.5f + inner_bounds.left(), diff --git a/fml/trace_event.h b/fml/trace_event.h index 775dea4e6b75e..a3996c1738839 100644 --- a/fml/trace_event.h +++ b/fml/trace_event.h @@ -5,6 +5,22 @@ #ifndef FLUTTER_FML_TRACE_EVENT_H_ #define FLUTTER_FML_TRACE_EVENT_H_ +#if defined(__Fuchsia__) + +// Forward to the system tracing mechanism on Fuchsia. + +#include + +#define TRACE_EVENT0(a, b) TRACE_DURATION(a, b) +#define TRACE_EVENT1(a, b, c, d) TRACE_DURATION(a, b, c, d) +#define TRACE_EVENT2(a, b, c, d, e, f) TRACE_DURATION(a, b, c, d, e, f) +#define TRACE_EVENT_ASYNC_BEGIN0(a, b, c) TRACE_ASYNC_BEGIN(a, b, c) +#define TRACE_EVENT_ASYNC_END0(a, b, c) TRACE_ASYNC_END(a, b, c) +#define TRACE_EVENT_ASYNC_BEGIN1(a, b, c, d, e) TRACE_ASYNC_BEGIN(a, b, c, d, e) +#define TRACE_EVENT_ASYNC_END1(a, b, c, d, e) TRACE_ASYNC_END(a, b, c, d, e) + +#else // defined(__Fuchsia__) + #include #include #include @@ -121,4 +137,6 @@ class ScopedInstantEnd { } // namespace tracing } // namespace fml +#endif // defined(__Fuchsia__) + #endif // FLUTTER_FML_TRACE_EVENT_H_ diff --git a/glue/BUILD.gn b/glue/BUILD.gn deleted file mode 100644 index 4112bf29205d3..0000000000000 --- a/glue/BUILD.gn +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2016 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. - -source_set("glue") { - sources = [ - "stack_trace.h", - "trace_event.h", - ] - - deps = [ - "//garnet/public/lib/fxl", - ] - - public_configs = [ - "$flutter_root:config", - ] - - if (is_fuchsia) { - sources += [ "stack_trace_fuchsia.cc" ] - - public_deps = [ - "//zircon/public/lib/trace", - ] - } else { - sources += [ "stack_trace_base.cc" ] - - deps += [ "$flutter_root/fml" ] - } -} diff --git a/glue/README.md b/glue/README.md deleted file mode 100644 index 965351d87403e..0000000000000 --- a/glue/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Glue - -This library provides glue between Flutter and //base, which lets us isolate our -dependency on //base. Eventually, we'll drive the contents of this library to -zero and remove our dependency on //base. diff --git a/glue/stack_trace.h b/glue/stack_trace.h deleted file mode 100644 index 63a091672b83a..0000000000000 --- a/glue/stack_trace.h +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_GLU_STACK_TRACE_H_ -#define FLUTTER_GLU_STACK_TRACE_H_ - -namespace glue { - -void PrintStackTrace(); - -} // namespace glue - -#endif // FLUTTER_GLU_STACK_TRACE_H_ diff --git a/glue/stack_trace_base.cc b/glue/stack_trace_base.cc deleted file mode 100644 index abd82c661d28c..0000000000000 --- a/glue/stack_trace_base.cc +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/glue/stack_trace.h" - -namespace glue { - -void PrintStackTrace() {} - -} // namespace glue diff --git a/glue/stack_trace_fuchsia.cc b/glue/stack_trace_fuchsia.cc deleted file mode 100644 index abd82c661d28c..0000000000000 --- a/glue/stack_trace_fuchsia.cc +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2016 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. - -#include "flutter/glue/stack_trace.h" - -namespace glue { - -void PrintStackTrace() {} - -} // namespace glue diff --git a/glue/trace_event.h b/glue/trace_event.h deleted file mode 100644 index b2df9327e38ef..0000000000000 --- a/glue/trace_event.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 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. - -#ifndef FLUTTER_GLUE_TRACE_EVENT_H_ -#define FLUTTER_GLUE_TRACE_EVENT_H_ - -#if defined(__Fuchsia__) - -#include - -#define TRACE_EVENT0(a, b) TRACE_DURATION(a, b) -#define TRACE_EVENT1(a, b, c, d) TRACE_DURATION(a, b, c, d) -#define TRACE_EVENT2(a, b, c, d, e, f) TRACE_DURATION(a, b, c, d, e, f) -#define TRACE_EVENT_ASYNC_BEGIN0(a, b, c) TRACE_ASYNC_BEGIN(a, b, c) -#define TRACE_EVENT_ASYNC_END0(a, b, c) TRACE_ASYNC_END(a, b, c) -#define TRACE_EVENT_ASYNC_BEGIN1(a, b, c, d, e) TRACE_ASYNC_BEGIN(a, b, c, d, e) -#define TRACE_EVENT_ASYNC_END1(a, b, c, d, e) TRACE_ASYNC_END(a, b, c, d, e) - -#else // defined(__Fuchsia__) - -#include "flutter/fml/trace_event.h" // nogncheck - -#endif // defined(__Fuchsia__) - -#endif // FLUTTER_GLUE_TRACE_EVENT_H_ diff --git a/lib/ui/BUILD.gn b/lib/ui/BUILD.gn index 81d0720a18aa0..3135bda390aea 100644 --- a/lib/ui/BUILD.gn +++ b/lib/ui/BUILD.gn @@ -55,14 +55,14 @@ source_set("ui") { "painting/vertices.h", "plugins/callback_cache.cc", "plugins/callback_cache.h", + "semantics/custom_accessibility_action.cc", + "semantics/custom_accessibility_action.h", "semantics/semantics_node.cc", "semantics/semantics_node.h", "semantics/semantics_update.cc", "semantics/semantics_update.h", "semantics/semantics_update_builder.cc", "semantics/semantics_update_builder.h", - "semantics/custom_accessibility_action.cc", - "semantics/custom_accessibility_action.h", "text/asset_manager_font_provider.cc", "text/asset_manager_font_provider.h", "text/font_collection.cc", @@ -101,7 +101,6 @@ source_set("ui") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/runtime:test_font", "//garnet/public/lib/fxl", "//third_party/dart/runtime/bin:embedded_dart_io", @@ -115,5 +114,7 @@ source_set("ui") { deps += [ "//topaz/public/dart-pkg/zircon" ] } - public_deps = ["$flutter_root/third_party/txt"] + public_deps = [ + "$flutter_root/third_party/txt", + ] } diff --git a/lib/ui/compositing/scene.cc b/lib/ui/compositing/scene.cc index 34970914f84a7..34ca9060d88d9 100644 --- a/lib/ui/compositing/scene.cc +++ b/lib/ui/compositing/scene.cc @@ -4,7 +4,7 @@ #include "flutter/lib/ui/compositing/scene.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "lib/fxl/functional/make_copyable.h" #include "third_party/skia/include/core/SkImageInfo.h" diff --git a/lib/ui/painting/codec.cc b/lib/ui/painting/codec.cc index 4af9a99840648..05de814f1fc0a 100644 --- a/lib/ui/painting/codec.cc +++ b/lib/ui/painting/codec.cc @@ -5,7 +5,7 @@ #include "flutter/lib/ui/painting/codec.h" #include "flutter/common/task_runners.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/ui/painting/frame_info.h" #include "lib/fxl/functional/make_copyable.h" #include "lib/fxl/logging.h" diff --git a/lib/ui/painting/image_encoding.cc b/lib/ui/painting/image_encoding.cc index e403be9510c21..987da761a51de 100644 --- a/lib/ui/painting/image_encoding.cc +++ b/lib/ui/painting/image_encoding.cc @@ -8,7 +8,7 @@ #include #include "flutter/common/task_runners.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/ui/painting/image.h" #include "flutter/lib/ui/ui_dart_state.h" #include "lib/fxl/build_config.h" diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index fd649a3448f00..a1c861e58fa9f 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -90,7 +90,6 @@ source_set("runtime") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/lib/io", "$flutter_root/lib/ui", "$flutter_root/third_party/txt", @@ -105,8 +104,7 @@ source_set("runtime") { public_configs = [ "$flutter_root:config" ] if (flutter_runtime_mode != "release" && - flutter_runtime_mode != "dynamic_release" && - !is_fuchsia) { + flutter_runtime_mode != "dynamic_release" && !is_fuchsia) { # Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia # instead puts Observatory into the runner's package. deps += [ "//third_party/dart/runtime/observatory:embedded_observatory_archive" ] diff --git a/runtime/runtime_controller.cc b/runtime/runtime_controller.cc index 22b84579800b9..c53375371b5f7 100644 --- a/runtime/runtime_controller.cc +++ b/runtime/runtime_controller.cc @@ -5,7 +5,7 @@ #include "flutter/runtime/runtime_controller.h" #include "flutter/fml/message_loop.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/ui/compositing/scene.h" #include "flutter/lib/ui/ui_dart_state.h" #include "flutter/lib/ui/window/window.h" diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 6748ecde87e6d..b0a09cf467d49 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -96,7 +96,6 @@ source_set("common") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/synchronization", diff --git a/shell/common/animator.cc b/shell/common/animator.cc index 60177a18f89ab..fe941eba80c06 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -4,7 +4,7 @@ #include "flutter/shell/common/animator.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/time/stopwatch.h" #include "third_party/dart/runtime/include/dart_tools_api.h" diff --git a/shell/common/engine.cc b/shell/common/engine.cc index 790fb70a13b0e..d65ab82b8c7ce 100644 --- a/shell/common/engine.cc +++ b/shell/common/engine.cc @@ -8,7 +8,7 @@ #include #include "flutter/common/settings.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/lib/snapshot/snapshot.h" #include "flutter/lib/ui/text/font_collection.h" #include "flutter/shell/common/animator.h" diff --git a/shell/common/shell.cc b/shell/common/shell.cc index ec39d96ab7308..71c066c6967db 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -16,7 +16,7 @@ #include "flutter/fml/log_settings.h" #include "flutter/fml/logging.h" #include "flutter/fml/message_loop.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/runtime/dart_vm.h" #include "flutter/runtime/start_up.h" #include "flutter/shell/common/engine.h" diff --git a/shell/gpu/gpu.gni b/shell/gpu/gpu.gni index 7ec2553c368a8..502e362e13767 100644 --- a/shell/gpu/gpu.gni +++ b/shell/gpu/gpu.gni @@ -46,7 +46,6 @@ template("shell_gpu_configuration") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/shell/common", "$flutter_root/synchronization", "//garnet/public/lib/fxl", diff --git a/shell/gpu/gpu_surface_gl.cc b/shell/gpu/gpu_surface_gl.cc index 1d61effb0a85b..7e24bf37ecd73 100644 --- a/shell/gpu/gpu_surface_gl.cc +++ b/shell/gpu/gpu_surface_gl.cc @@ -4,7 +4,7 @@ #include "gpu_surface_gl.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/arraysize.h" #include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkColorFilter.h" diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 8e0fb443f5f27..89c593f34ee1e 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -99,7 +99,6 @@ shared_library("create_flutter_framework_dylib") { "$flutter_root/common", "$flutter_root/flow", "$flutter_root/fml", - "$flutter_root/glue", "$flutter_root/lib/ui", "$flutter_root/runtime", "$flutter_root/shell/common", diff --git a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm index 4589368acd3fb..94fecda2532f8 100644 --- a/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm +++ b/shell/platform/darwin/ios/framework/Source/vsync_waiter_ios.mm @@ -11,7 +11,7 @@ #include #include "flutter/common/task_runners.h" -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "lib/fxl/logging.h" @interface VSyncClient : NSObject diff --git a/synchronization/BUILD.gn b/synchronization/BUILD.gn index 9ee7680cc1160..72d4a45e7cdd6 100644 --- a/synchronization/BUILD.gn +++ b/synchronization/BUILD.gn @@ -13,7 +13,7 @@ source_set("synchronization") { public_configs = [ "$flutter_root:config" ] public_deps = [ - "$flutter_root/glue", + "$flutter_root/fml", "//garnet/public/lib/fxl", ] } diff --git a/synchronization/pipeline.h b/synchronization/pipeline.h index 23bf0abecd6db..db86fac256f9d 100644 --- a/synchronization/pipeline.h +++ b/synchronization/pipeline.h @@ -5,7 +5,7 @@ #ifndef SYNCHRONIZATION_PIPELINE_H_ #define SYNCHRONIZATION_PIPELINE_H_ -#include "flutter/glue/trace_event.h" +#include "flutter/fml/trace_event.h" #include "flutter/synchronization/pipeline.h" #include "flutter/synchronization/semaphore.h" #include "lib/fxl/functional/closure.h" diff --git a/travis/licenses_golden/licenses_flutter b/travis/licenses_golden/licenses_flutter index a6564cf81cd7b..d3103a58e4356 100644 --- a/travis/licenses_golden/licenses_flutter +++ b/travis/licenses_golden/licenses_flutter @@ -332,10 +332,6 @@ FILE: ../../../flutter/flow/raster_cache.cc FILE: ../../../flutter/flow/raster_cache.h FILE: ../../../flutter/flow/scene_update_context.cc FILE: ../../../flutter/flow/scene_update_context.h -FILE: ../../../flutter/glue/stack_trace.h -FILE: ../../../flutter/glue/stack_trace_base.cc -FILE: ../../../flutter/glue/stack_trace_fuchsia.cc -FILE: ../../../flutter/glue/trace_event.h FILE: ../../../flutter/lib/ui/painting/image_filter.cc FILE: ../../../flutter/lib/ui/painting/image_filter.h FILE: ../../../flutter/lib/ui/semantics.dart From 228cecc293d0f9be8683933a0f4a14e91e5b9f51 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 25 Jul 2018 14:30:41 -0700 Subject: [PATCH 0872/1190] Make //flutter/synchronization Garnet free. (#5865) --- assets/BUILD.gn | 1 - assets/zip_asset_store.cc | 6 +++--- assets/zip_asset_store.h | 5 ++--- shell/common/animator.cc | 2 +- shell/common/animator.h | 4 ++-- shell/common/rasterizer.cc | 2 +- shell/common/rasterizer.h | 2 +- shell/common/shell.cc | 2 +- shell/common/shell.h | 2 +- synchronization/BUILD.gn | 1 - synchronization/pipeline.h | 13 ++++++------- synchronization/semaphore.cc | 16 ++++++++-------- synchronization/semaphore.h | 9 ++++----- 13 files changed, 30 insertions(+), 35 deletions(-) diff --git a/assets/BUILD.gn b/assets/BUILD.gn index febd1eda76f6c..f28e9bdd0a6ea 100644 --- a/assets/BUILD.gn +++ b/assets/BUILD.gn @@ -16,7 +16,6 @@ source_set("assets") { deps = [ "$flutter_root/common", "$flutter_root/fml", - "//garnet/public/lib/fxl", ] public_deps = [ diff --git a/assets/zip_asset_store.cc b/assets/zip_asset_store.cc index 79f0cd16eca99..7823f6e594396 100644 --- a/assets/zip_asset_store.cc +++ b/assets/zip_asset_store.cc @@ -3,7 +3,7 @@ // found in the LICENSE file. #include "flutter/assets/zip_asset_store.h" -#include "lib/fxl/build_config.h" +#include "flutter/fml/build_config.h" #include @@ -58,13 +58,13 @@ std::unique_ptr ZipAssetStore::GetAsMapping( result = unzGoToFilePos(unzipper.get(), &(found->second.file_pos)); if (result != UNZ_OK) { - FXL_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result; + FML_LOG(WARNING) << "unzGetCurrentFileInfo failed, error=" << result; return nullptr; } result = unzOpenCurrentFile(unzipper.get()); if (result != UNZ_OK) { - FXL_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result; + FML_LOG(WARNING) << "unzOpenCurrentFile failed, error=" << result; return nullptr; } diff --git a/assets/zip_asset_store.h b/assets/zip_asset_store.h index 0854194abe4e2..f801e0b0cca25 100644 --- a/assets/zip_asset_store.h +++ b/assets/zip_asset_store.h @@ -8,8 +8,7 @@ #include #include "flutter/assets/asset_resolver.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" +#include "flutter/fml/macros.h" #include "third_party/zlib/contrib/minizip/unzip.h" namespace blink { @@ -50,7 +49,7 @@ class ZipAssetStore final : public AssetResolver { UniqueUnzipper CreateUnzipper() const; - FXL_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); + FML_DISALLOW_COPY_AND_ASSIGN(ZipAssetStore); }; } // namespace blink diff --git a/shell/common/animator.cc b/shell/common/animator.cc index fe941eba80c06..d929a11e3b0dc 100644 --- a/shell/common/animator.cc +++ b/shell/common/animator.cc @@ -18,7 +18,7 @@ Animator::Animator(Delegate& delegate, waiter_(std::move(waiter)), last_begin_frame_time_(), dart_frame_deadline_(0), - layer_tree_pipeline_(fxl::MakeRefCounted(2)), + layer_tree_pipeline_(fml::MakeRefCounted(2)), pending_frame_semaphore_(1), frame_number_(1), paused_(false), diff --git a/shell/common/animator.h b/shell/common/animator.h index 8ddd852b67017..eae7b8ce3ef93 100644 --- a/shell/common/animator.h +++ b/shell/common/animator.h @@ -28,7 +28,7 @@ class Animator final { virtual void OnAnimatorDraw( const Animator& animator, - fxl::RefPtr> pipeline) = 0; + fml::RefPtr> pipeline) = 0; virtual void OnAnimatorDrawLastLayerTree(const Animator& animator) = 0; }; @@ -68,7 +68,7 @@ class Animator final { fxl::TimePoint last_begin_frame_time_; int64_t dart_frame_deadline_; - fxl::RefPtr layer_tree_pipeline_; + fml::RefPtr layer_tree_pipeline_; flutter::Semaphore pending_frame_semaphore_; LayerTreePipeline::ProducerContinuation producer_continuation_; int64_t frame_number_; diff --git a/shell/common/rasterizer.cc b/shell/common/rasterizer.cc index 998fb06160b93..862702e11c22d 100644 --- a/shell/common/rasterizer.cc +++ b/shell/common/rasterizer.cc @@ -61,7 +61,7 @@ void Rasterizer::DrawLastLayerTree() { } void Rasterizer::Draw( - fxl::RefPtr> pipeline) { + fml::RefPtr> pipeline) { TRACE_EVENT0("flutter", "GPURasterizer::Draw"); flutter::Pipeline::Consumer consumer = diff --git a/shell/common/rasterizer.h b/shell/common/rasterizer.h index 482ecbef3c587..8bb02a14f3e72 100644 --- a/shell/common/rasterizer.h +++ b/shell/common/rasterizer.h @@ -39,7 +39,7 @@ class Rasterizer final { flow::TextureRegistry* GetTextureRegistry(); - void Draw(fxl::RefPtr> pipeline); + void Draw(fml::RefPtr> pipeline); enum class ScreenshotType { SkiaPicture, diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 71c066c6967db..0b1413a2c7a4b 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -695,7 +695,7 @@ void Shell::OnAnimatorNotifyIdle(const Animator& animator, int64_t deadline) { // |shell::Animator::Delegate| void Shell::OnAnimatorDraw( const Animator& animator, - fxl::RefPtr> pipeline) { + fml::RefPtr> pipeline) { FXL_DCHECK(is_setup_); task_runners_.GetGPUTaskRunner()->PostTask( diff --git a/shell/common/shell.h b/shell/common/shell.h index 4f4876734fc66..59dafe469e1be 100644 --- a/shell/common/shell.h +++ b/shell/common/shell.h @@ -181,7 +181,7 @@ class Shell final : public PlatformView::Delegate, // |shell::Animator::Delegate| void OnAnimatorDraw( const Animator& animator, - fxl::RefPtr> pipeline) override; + fml::RefPtr> pipeline) override; // |shell::Animator::Delegate| void OnAnimatorDrawLastLayerTree(const Animator& animator) override; diff --git a/synchronization/BUILD.gn b/synchronization/BUILD.gn index 72d4a45e7cdd6..258e49a182445 100644 --- a/synchronization/BUILD.gn +++ b/synchronization/BUILD.gn @@ -14,7 +14,6 @@ source_set("synchronization") { public_deps = [ "$flutter_root/fml", - "//garnet/public/lib/fxl", ] } diff --git a/synchronization/pipeline.h b/synchronization/pipeline.h index db86fac256f9d..726adf64de842 100644 --- a/synchronization/pipeline.h +++ b/synchronization/pipeline.h @@ -5,12 +5,11 @@ #ifndef SYNCHRONIZATION_PIPELINE_H_ #define SYNCHRONIZATION_PIPELINE_H_ +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/trace_event.h" #include "flutter/synchronization/pipeline.h" #include "flutter/synchronization/semaphore.h" -#include "lib/fxl/functional/closure.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" #include #include @@ -27,7 +26,7 @@ enum class PipelineConsumeResult { size_t GetNextPipelineTraceID(); template -class Pipeline : public fxl::RefCountedThreadSafe> { +class Pipeline : public fml::RefCountedThreadSafe> { public: using Resource = R; using ResourcePtr = std::unique_ptr; @@ -83,7 +82,7 @@ class Pipeline : public fxl::RefCountedThreadSafe> { TRACE_EVENT_ASYNC_BEGIN0("flutter", "PipelineProduce", trace_id_); } - FXL_DISALLOW_COPY_AND_ASSIGN(ProducerContinuation); + FML_DISALLOW_COPY_AND_ASSIGN(ProducerContinuation); }; explicit Pipeline(uint32_t depth) : empty_(depth), available_(0) {} @@ -105,7 +104,7 @@ class Pipeline : public fxl::RefCountedThreadSafe> { using Consumer = std::function; - FXL_WARN_UNUSED_RESULT + FML_WARN_UNUSED_RESULT PipelineConsumeResult Consume(Consumer consumer) { if (consumer == nullptr) { return PipelineConsumeResult::NoneAvailable; @@ -155,7 +154,7 @@ class Pipeline : public fxl::RefCountedThreadSafe> { available_.Signal(); } - FXL_DISALLOW_COPY_AND_ASSIGN(Pipeline); + FML_DISALLOW_COPY_AND_ASSIGN(Pipeline); }; } // namespace flutter diff --git a/synchronization/semaphore.cc b/synchronization/semaphore.cc index 4dc5f6220e350..f3a6039b15f11 100644 --- a/synchronization/semaphore.cc +++ b/synchronization/semaphore.cc @@ -4,8 +4,8 @@ #include "flutter/synchronization/semaphore.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/logging.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" #if OS_MACOSX #include @@ -47,7 +47,7 @@ class PlatformSemaphore { dispatch_semaphore_t _sem; const uint32_t _initial; - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); + FML_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; } // namespace flutter @@ -88,14 +88,14 @@ class PlatformSemaphore { private: HANDLE _sem; - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); + FML_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; } // namespace flutter #else #include -#include "lib/fxl/files/eintr_wrapper.h" +#include "flutter/fml/eintr_wrapper.h" namespace flutter { @@ -109,7 +109,7 @@ class PlatformSemaphore { int result = ::sem_destroy(&sem_); // Can only be EINVAL which should not be possible since we checked for // validity. - FXL_DCHECK(result == 0); + FML_DCHECK(result == 0); } } @@ -120,7 +120,7 @@ class PlatformSemaphore { return false; } - return HANDLE_EINTR(::sem_trywait(&sem_)) == 0; + return FML_HANDLE_EINTR(::sem_trywait(&sem_)) == 0; } void Signal() { @@ -137,7 +137,7 @@ class PlatformSemaphore { bool valid_; sem_t sem_; - FXL_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); + FML_DISALLOW_COPY_AND_ASSIGN(PlatformSemaphore); }; } // namespace flutter diff --git a/synchronization/semaphore.h b/synchronization/semaphore.h index bb35957e58c8b..e2df8b3d81ad8 100644 --- a/synchronization/semaphore.h +++ b/synchronization/semaphore.h @@ -7,9 +7,8 @@ #include -#include "lib/fxl/compiler_specific.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/time/time_delta.h" +#include "flutter/fml/compiler_specific.h" +#include "flutter/fml/macros.h" namespace flutter { @@ -23,7 +22,7 @@ class Semaphore { bool IsValid() const; - FXL_WARN_UNUSED_RESULT + FML_WARN_UNUSED_RESULT bool TryWait(); void Signal(); @@ -31,7 +30,7 @@ class Semaphore { private: std::unique_ptr _impl; - FXL_DISALLOW_COPY_AND_ASSIGN(Semaphore); + FML_DISALLOW_COPY_AND_ASSIGN(Semaphore); }; } // namespace flutter From d559afb3203d68c70f9c8b466210df4bc9205fb8 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 25 Jul 2018 15:26:02 -0700 Subject: [PATCH 0873/1190] Support customizing standard accessibility actions on Android. (#5823) --- lib/ui/semantics.dart | 31 +++++++--- .../semantics/custom_accessibility_action.h | 2 + lib/ui/semantics/semantics_update_builder.cc | 7 ++- lib/ui/semantics/semantics_update_builder.h | 5 +- .../io/flutter/view/AccessibilityBridge.java | 59 +++++++++++++++---- .../platform/android/platform_view_android.cc | 9 ++- .../framework/Source/accessibility_bridge.mm | 5 ++ 7 files changed, 94 insertions(+), 24 deletions(-) diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index 42494e56aea44..7e58c93d717cf 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -585,7 +585,9 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { Float64List transform, Int32List childrenInTraversalOrder, Int32List childrenInHitTestOrder, + @Deprecated('use additionalActions instead') Int32List customAcccessibilityActions, + Int32List additionalActions, }) { if (transform.length != 16) throw new ArgumentError('transform argument must have 16 entries.'); @@ -611,7 +613,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { transform, childrenInTraversalOrder, childrenInHitTestOrder, - customAcccessibilityActions, + additionalActions ?? customAcccessibilityActions, ); } void _updateNode( @@ -636,19 +638,30 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { Float64List transform, Int32List childrenInTraversalOrder, Int32List childrenInHitTestOrder, - Int32List customAcccessibilityActions, + Int32List additionalActions, ) native 'SemanticsUpdateBuilder_updateNode'; - /// Update the custom accessibility action associated with the given `id`. + /// Update the custom semantics action associated with the given `id`. + /// + /// The name of the action exposed to the user is the `label`. For overriden + /// standard actions this value is ignored. + /// + /// The `hint` should describe what happens when an action occurs, not the + /// manner in which a tap is accomplished. For example, use "delete" instead + /// of "double tap to delete". + /// + /// The text direction of the `hint` and `label` is the same as the global + /// window. /// - /// The name of the action exposed to the user is the `label`. The text - /// direction of this label is the same as the global window. - void updateCustomAction({int id, String label}) { + /// For overriden standard actions, `overrideId` corresponds with a + /// [SemanticsAction.index] value. For custom actions this argument should not be + /// provided. + void updateCustomAction({int id, String label, String hint, int overrideId = -1}) { assert(id != null); - assert(label != null && label != ''); - _updateCustomAction(id, label); + assert(overrideId != null); + _updateCustomAction(id, label, hint, overrideId); } - void _updateCustomAction(int id, String label) native 'SemanticsUpdateBuilder_updateCustomAction'; + void _updateCustomAction(int id, String label, String hint, int overrideId) native 'SemanticsUpdateBuilder_updateCustomAction'; /// Creates a [SemanticsUpdate] object that encapsulates the updates recorded /// by this object. diff --git a/lib/ui/semantics/custom_accessibility_action.h b/lib/ui/semantics/custom_accessibility_action.h index 07fe9a3c4a593..3eb8356416143 100644 --- a/lib/ui/semantics/custom_accessibility_action.h +++ b/lib/ui/semantics/custom_accessibility_action.h @@ -20,7 +20,9 @@ struct CustomAccessibilityAction { ~CustomAccessibilityAction(); int32_t id = 0; + int32_t overrideId = -1; std::string label; + std::string hint; }; // Contains custom accessibility actions that need to be updated. diff --git a/lib/ui/semantics/semantics_update_builder.cc b/lib/ui/semantics/semantics_update_builder.cc index 6950250761bb4..618f80552b9ac 100644 --- a/lib/ui/semantics/semantics_update_builder.cc +++ b/lib/ui/semantics/semantics_update_builder.cc @@ -88,10 +88,15 @@ void SemanticsUpdateBuilder::updateNode( nodes_[id] = node; } -void SemanticsUpdateBuilder::updateCustomAction(int id, std::string label) { +void SemanticsUpdateBuilder::updateCustomAction(int id, + std::string label, + std::string hint, + int overrideId) { CustomAccessibilityAction action; action.id = id; + action.overrideId = overrideId; action.label = label; + action.hint = hint; actions_[id] = action; } diff --git a/lib/ui/semantics/semantics_update_builder.h b/lib/ui/semantics/semantics_update_builder.h index b02a1d1a4dd59..9022fe3421fca 100644 --- a/lib/ui/semantics/semantics_update_builder.h +++ b/lib/ui/semantics/semantics_update_builder.h @@ -47,7 +47,10 @@ class SemanticsUpdateBuilder const tonic::Int32List& childrenInHitTestOrder, const tonic::Int32List& customAccessibilityActions); - void updateCustomAction(int id, std::string label); + void updateCustomAction(int id, + std::string label, + std::string hint, + int overrideId); fxl::RefPtr build(); diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index ecd78af4bb01e..01302abbd1c4b 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -223,12 +223,24 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { !object.hasFlag(Flag.HAS_ENABLED_STATE) || object.hasFlag(Flag.IS_ENABLED)); if (object.hasAction(Action.TAP)) { - result.addAction(AccessibilityNodeInfo.ACTION_CLICK); - result.setClickable(true); + if (Build.VERSION.SDK_INT >= 21 && object.onTapOverride != null) { + result.addAction(new AccessibilityNodeInfo.AccessibilityAction( + AccessibilityNodeInfo.ACTION_CLICK, object.onTapOverride.hint)); + result.setClickable(true); + } else { + result.addAction(AccessibilityNodeInfo.ACTION_CLICK); + result.setClickable(true); + } } if (object.hasAction(Action.LONG_PRESS)) { - result.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK); - result.setLongClickable(true); + if (Build.VERSION.SDK_INT >= 21 && object.onLongPressOverride != null) { + result.addAction(new AccessibilityNodeInfo.AccessibilityAction(AccessibilityNodeInfo.ACTION_LONG_CLICK, + object.onLongPressOverride.hint)); + result.setLongClickable(true); + } else { + result.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK); + result.setLongClickable(true); + } } if (object.hasAction(Action.SCROLL_LEFT) || object.hasAction(Action.SCROLL_UP) || object.hasAction(Action.SCROLL_RIGHT) || object.hasAction(Action.SCROLL_DOWN)) { @@ -288,8 +300,8 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { // Actions on the local context menu if (Build.VERSION.SDK_INT >= 21) { - if (object.customAccessibilityAction != null) { - for (CustomAccessibilityAction action : object.customAccessibilityAction) { + if (object.customAccessibilityActions != null) { + for (CustomAccessibilityAction action : object.customAccessibilityActions) { result.addAction(new AccessibilityNodeInfo.AccessibilityAction( action.resourceId, action.label)); } @@ -547,8 +559,11 @@ void updateCustomAccessibilityActions(ByteBuffer buffer, String[] strings) { while (buffer.hasRemaining()) { int id = buffer.getInt(); CustomAccessibilityAction action = getOrCreateAction(id); + action.overrideId = buffer.getInt(); int stringIndex = buffer.getInt(); action.label = stringIndex == -1 ? null : strings[stringIndex]; + stringIndex = buffer.getInt(); + action.hint = stringIndex == -1 ? null : strings[stringIndex]; } } @@ -851,9 +866,17 @@ private class CustomAccessibilityAction { /// does not collide with existing Android accessibility actions. int resourceId = -1; int id = -1; + int overrideId = -1; /// The label is the user presented value which is displayed in the local context menu. String label; + + /// The hint is the text used in overriden standard actions. + String hint; + + boolean isStandardAction() { + return overrideId != -1; + } } /// Value is derived from ACTION_TYPE_MASK in AccessibilityNodeInfo.java static int firstResourceId = 267386881; @@ -897,7 +920,9 @@ private class SemanticsObject { SemanticsObject parent; List childrenInTraversalOrder; List childrenInHitTestOrder; - List customAccessibilityAction; + List customAccessibilityActions; + CustomAccessibilityAction onTapOverride; + CustomAccessibilityAction onLongPressOverride; private boolean inverseTransformDirty = true; private float[] inverseTransform; @@ -1030,17 +1055,27 @@ void updateWith(ByteBuffer buffer, String[] strings) { } final int actionCount = buffer.getInt(); if (actionCount == 0) { - customAccessibilityAction = null; + customAccessibilityActions = null; } else { - if (customAccessibilityAction == null) - customAccessibilityAction = + if (customAccessibilityActions == null) + customAccessibilityActions = new ArrayList(actionCount); else - customAccessibilityAction.clear(); + customAccessibilityActions.clear(); for (int i = 0; i < actionCount; i++) { CustomAccessibilityAction action = getOrCreateAction(buffer.getInt()); - customAccessibilityAction.add(action); + if (action.overrideId == Action.TAP.value) { + onTapOverride = action; + } else if (action.overrideId == Action.LONG_PRESS.value) { + onLongPressOverride = action; + } else { + // If we recieve a different overrideId it means that we were passed + // a standard action to override that we don't yet support. + assert action.overrideId == -1; + customAccessibilityActions.add(action); + } + customAccessibilityActions.add(action); } } } diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 0dec68ca9ab2c..f34dd1c711156 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -183,7 +183,7 @@ void PlatformViewAndroid::UpdateSemantics( blink::CustomAccessibilityActionUpdates actions) { constexpr size_t kBytesPerNode = 36 * sizeof(int32_t); constexpr size_t kBytesPerChild = sizeof(int32_t); - constexpr size_t kBytesPerAction = 2 * sizeof(int32_t); + constexpr size_t kBytesPerAction = 4 * sizeof(int32_t); JNIEnv* env = fml::jni::AttachCurrentThread(); { @@ -284,12 +284,19 @@ void PlatformViewAndroid::UpdateSemantics( // sending. const blink::CustomAccessibilityAction& action = value.second; actions_buffer_int32[actions_position++] = action.id; + actions_buffer_int32[actions_position++] = action.overrideId; if (action.label.empty()) { actions_buffer_int32[actions_position++] = -1; } else { actions_buffer_int32[actions_position++] = action_strings.size(); action_strings.push_back(action.label); } + if (action.hint.empty()) { + actions_buffer_int32[actions_position++] = -1; + } else { + actions_buffer_int32[actions_position++] = action_strings.size(); + action_strings.push_back(action.hint); + } } // Calling NewDirectByteBuffer in API level 22 and below with a size of zero diff --git a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm index b619325a96888..8ef64177d46d0 100644 --- a/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm +++ b/shell/platform/darwin/ios/framework/Source/accessibility_bridge.mm @@ -542,6 +542,11 @@ - (BOOL)accessibilityScroll:(UIAccessibilityScrollDirection)direction { [[[NSMutableArray alloc] init] autorelease]; for (int32_t action_id : node.customAccessibilityActions) { blink::CustomAccessibilityAction& action = actions_[action_id]; + if (action.overrideId != -1) { + // iOS does not support overriding standard actions, so we ignore any + // custom actions that have an override id provided. + continue; + } NSString* label = @(action.label.data()); SEL selector = @selector(onCustomAccessibilityAction:); FlutterCustomAccessibilityAction* customAction = From 1d1c8c7b56d17d973ad86c9d88dd3969f8a3404c Mon Sep 17 00:00:00 2001 From: liyuqian Date: Wed, 25 Jul 2018 15:39:01 -0700 Subject: [PATCH 0874/1190] Rename clip to clipBehavior in compositing.dart (#5868) The is a follow up of https://github.com/flutter/engine/pull/5853 --- lib/ui/compositing.dart | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/ui/compositing.dart b/lib/ui/compositing.dart index f83a7deb4af4d..9e3b4a3060b9c 100644 --- a/lib/ui/compositing.dart +++ b/lib/ui/compositing.dart @@ -68,10 +68,10 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// /// See [pop] for details about the operation stack, and [Clip] for different clip modes. /// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]). - void pushClipRect(Rect rect, {Clip clip = Clip.antiAlias}) { - assert(clip != null); - assert(clip != Clip.none); - _pushClipRect(rect.left, rect.right, rect.top, rect.bottom, clip.index); + void pushClipRect(Rect rect, {Clip clipBehavior = Clip.antiAlias}) { + assert(clipBehavior != null); + assert(clipBehavior != Clip.none); + _pushClipRect(rect.left, rect.right, rect.top, rect.bottom, clipBehavior.index); } void _pushClipRect(double left, double right, @@ -85,10 +85,10 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// /// See [pop] for details about the operation stack, and [Clip] for different clip modes. /// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]). - void pushClipRRect(RRect rrect, {Clip clip = Clip.antiAlias}) { - assert(clip != null); - assert(clip != Clip.none); - _pushClipRRect(rrect._value, clip.index); + void pushClipRRect(RRect rrect, {Clip clipBehavior = Clip.antiAlias}) { + assert(clipBehavior != null); + assert(clipBehavior != Clip.none); + _pushClipRRect(rrect._value, clipBehavior.index); } void _pushClipRRect(Float32List rrect, int clipMode) native 'SceneBuilder_pushClipRRect'; @@ -98,10 +98,10 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// /// See [pop] for details about the operation stack. See [Clip] for different clip modes. /// By default, the clip will be anti-aliased (clip = [Clip.antiAlias]). - void pushClipPath(Path path, {Clip clip = Clip.antiAlias}) { - assert(clip != null); - assert(clip != Clip.none); - _pushClipPath(path, clip.index); + void pushClipPath(Path path, {Clip clipBehavior = Clip.antiAlias}) { + assert(clipBehavior != null); + assert(clipBehavior != Clip.none); + _pushClipPath(path, clipBehavior.index); } void _pushClipPath(Path path, int clipMode) native 'SceneBuilder_pushClipPath'; @@ -168,8 +168,8 @@ class SceneBuilder extends NativeFieldWrapperClass2 { /// /// See [pop] for details about the operation stack, and [Clip] for different clip modes. // ignore: deprecated_member_use - void pushPhysicalShape({ Path path, double elevation, Color color, Color shadowColor, Clip clip = defaultClipBehavior}) { - _pushPhysicalShape(path, elevation, color.value, shadowColor?.value ?? 0xFF000000, clip.index); + void pushPhysicalShape({ Path path, double elevation, Color color, Color shadowColor, Clip clipBehavior = defaultClipBehavior}) { + _pushPhysicalShape(path, elevation, color.value, shadowColor?.value ?? 0xFF000000, clipBehavior.index); } void _pushPhysicalShape(Path path, double elevation, int color, int shadowColor, int clipMode) native 'SceneBuilder_pushPhysicalShape'; From cfcb701afca758a1ed3b20738eb6342d24db750a Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Jul 2018 18:56:49 -0400 Subject: [PATCH 0875/1190] Roll src/third_party/skia 1c94a8fabed7..68300c270916 (4 commits) (#5867) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_skia | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/DEPS b/DEPS index f8b2f63dea7b7..d100f320a6308 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '1c94a8fabed7196e985a0ed81ce8325c8f606940', + 'skia_revision': '68300c270916b2740fccdbe6c6dce8f085e83316', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_skia b/travis/licenses_golden/licenses_skia index 01ee09ae1a837..5568147218768 100644 --- a/travis/licenses_golden/licenses_skia +++ b/travis/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: b4bc250fabee117ed72a44a8cdf156a3 +Signature: 0ff53a57d8b9dcec397777902a8fc1da UNUSED LICENSES: @@ -2116,7 +2116,6 @@ FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Chromecast FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-MSAN.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-SK_USE_DISCARDABLE_SCALEDIMAGECACHE.json -FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-T8888.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-shard_00_10-Coverage.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-Lottie.json FILE: ../../../third_party/skia/infra/bots/recipes/test.expected/Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_FORCE_RASTER_PIPELINE_BLITTER.json @@ -4021,10 +4020,6 @@ FILE: ../../../third_party/skia/src/core/SkMaskBlurFilter.h FILE: ../../../third_party/skia/src/core/SkRasterClipStack.h FILE: ../../../third_party/skia/src/core/SkSafeMath.h FILE: ../../../third_party/skia/src/core/SkSpriteBlitter_RGB565.cpp -FILE: ../../../third_party/skia/src/core/SkTaskGroup2D.cpp -FILE: ../../../third_party/skia/src/core/SkTaskGroup2D.h -FILE: ../../../third_party/skia/src/core/SkThreadedBMPDevice.cpp -FILE: ../../../third_party/skia/src/core/SkThreadedBMPDevice.h FILE: ../../../third_party/skia/src/core/SkUnPreMultiplyPriv.h FILE: ../../../third_party/skia/src/core/SkVertices.cpp FILE: ../../../third_party/skia/src/core/SkVptr.h From 7624c8a39146b65b2c0289d2e23f589355c53052 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Wed, 25 Jul 2018 22:16:48 -0400 Subject: [PATCH 0876/1190] Roll src/third_party/skia 68300c270916..97613523e357 (2 commits) (#5870) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_skia | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index d100f320a6308..82f8be9e3cb80 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '68300c270916b2740fccdbe6c6dce8f085e83316', + 'skia_revision': '97613523e3579b3569993a2ff70b065dec1e1002', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_skia b/travis/licenses_golden/licenses_skia index 5568147218768..332549ae8c78b 100644 --- a/travis/licenses_golden/licenses_skia +++ b/travis/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: 0ff53a57d8b9dcec397777902a8fc1da +Signature: 89f7b22ab7b01dbcbf4a34c6ad5fa94d UNUSED LICENSES: From 619374392895c278725887c49240d2e50bc23150 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Jul 2018 01:37:49 -0400 Subject: [PATCH 0877/1190] Roll src/third_party/skia 97613523e357..e54cd95dc3ae (1 commits) (#5872) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_skia | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 82f8be9e3cb80..b471a5a4c7907 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': '97613523e3579b3569993a2ff70b065dec1e1002', + 'skia_revision': 'e54cd95dc3ae5fa8520d23648a8646521177bbc0', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_skia b/travis/licenses_golden/licenses_skia index 332549ae8c78b..e2734e77619f3 100644 --- a/travis/licenses_golden/licenses_skia +++ b/travis/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: 89f7b22ab7b01dbcbf4a34c6ad5fa94d +Signature: cf45095d864b0b2bf9a71d5bb2fa03b3 UNUSED LICENSES: From aef291b1e2c61b2e5eaffb632ec6ca2eb3859fea Mon Sep 17 00:00:00 2001 From: liyuqian Date: Thu, 26 Jul 2018 00:14:43 -0700 Subject: [PATCH 0878/1190] Unify trailing spaces / new lines (#5871) --- fml/platform/win/paths_win.cc | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/fml/platform/win/paths_win.cc b/fml/platform/win/paths_win.cc index 505d40ae2236d..80b71d7a513e3 100644 --- a/fml/platform/win/paths_win.cc +++ b/fml/platform/win/paths_win.cc @@ -1,28 +1,28 @@ -// Copyright 2017 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. - -#include "flutter/fml/paths.h" - -#include - -#include "lib/fxl/files/path.h" - -namespace fml { -namespace paths { - -std::pair GetExecutableDirectoryPath() { - HMODULE module = GetModuleHandle(NULL); - if (module == NULL) { - return {false, ""}; - } - char path[MAX_PATH]; - DWORD read_size = GetModuleFileNameA(module, path, MAX_PATH); - if (read_size == 0 || read_size == MAX_PATH) { - return {false, ""}; - } - return {true, files::GetDirectoryName(std::string{path, read_size})}; -} - -} // namespace paths -} // namespace fml +// Copyright 2017 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. + +#include "flutter/fml/paths.h" + +#include + +#include "lib/fxl/files/path.h" + +namespace fml { +namespace paths { + +std::pair GetExecutableDirectoryPath() { + HMODULE module = GetModuleHandle(NULL); + if (module == NULL) { + return {false, ""}; + } + char path[MAX_PATH]; + DWORD read_size = GetModuleFileNameA(module, path, MAX_PATH); + if (read_size == 0 || read_size == MAX_PATH) { + return {false, ""}; + } + return {true, files::GetDirectoryName(std::string{path, read_size})}; +} + +} // namespace paths +} // namespace fml From 2193ff45cfd61b68c6e4474993708e75019eee90 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Jul 2018 06:01:49 -0400 Subject: [PATCH 0879/1190] Roll src/third_party/skia e54cd95dc3ae..f3ac64df1741 (1 commits) (#5873) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_skia | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index b471a5a4c7907..2188d8f70481d 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'e54cd95dc3ae5fa8520d23648a8646521177bbc0', + 'skia_revision': 'f3ac64df17419f7fa6af2eeed5092638e956e196', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_skia b/travis/licenses_golden/licenses_skia index e2734e77619f3..ff8465290ac72 100644 --- a/travis/licenses_golden/licenses_skia +++ b/travis/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: cf45095d864b0b2bf9a71d5bb2fa03b3 +Signature: 0269caa640ab270b301733f8d3744549 UNUSED LICENSES: From 66f87f4f4cd704c49e465d0c2a87cdc794de359e Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Jul 2018 09:23:48 -0400 Subject: [PATCH 0880/1190] Roll src/third_party/skia f3ac64df1741..b64db38b854b (1 commits) (#5874) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_skia | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 2188d8f70481d..8bde648fb977c 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'f3ac64df17419f7fa6af2eeed5092638e956e196', + 'skia_revision': 'b64db38b854bd8f6d564b7741ebf4795d130d168', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_skia b/travis/licenses_golden/licenses_skia index ff8465290ac72..fb1be0537c713 100644 --- a/travis/licenses_golden/licenses_skia +++ b/travis/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: 0269caa640ab270b301733f8d3744549 +Signature: 539a1849c5471865264c3a4b9dd168f6 UNUSED LICENSES: From f480e32347ca4b6450e680cd6b45d0e79dd74714 Mon Sep 17 00:00:00 2001 From: Stanislav Baranov Date: Thu, 26 Jul 2018 08:52:19 -0700 Subject: [PATCH 0881/1190] Support hot reload in corejit mode (#5866) Since frontend_server --incremental doesn't support --link-platform, instead of baking host app into the snapshot, load it from kernel file when running in debug mode. --- .../android/platform_view_android_jni.cc | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/shell/platform/android/platform_view_android_jni.cc b/shell/platform/android/platform_view_android_jni.cc index 05cfa0d48c27d..a88d5c0306be8 100644 --- a/shell/platform/android/platform_view_android_jni.cc +++ b/shell/platform/android/platform_view_android_jni.cc @@ -184,18 +184,26 @@ std::unique_ptr CreateIsolateConfiguration( const auto configuration_from_blob = [&asset_manager](const std::string& snapshot_name) -> std::unique_ptr { - std::unique_ptr blob = - asset_manager.GetAsMapping(snapshot_name); + auto blob = asset_manager.GetAsMapping(snapshot_name); + auto delta = asset_manager.GetAsMapping("kernel_delta.bin"); + if (blob && delta) { + std::vector> kernels; + kernels.emplace_back(std::move(blob)); + kernels.emplace_back(std::move(delta)); + return IsolateConfiguration::CreateForKernelList(std::move(kernels)); + } if (blob) { return IsolateConfiguration::CreateForSnapshot(std::move(blob)); } + if (delta) { + return IsolateConfiguration::CreateForSnapshot(std::move(delta)); + } return nullptr; }; if (auto kernel = configuration_from_blob("kernel_blob.bin")) { return kernel; } - if (auto script = configuration_from_blob("snapshot_blob.bin")) { return script; } @@ -209,14 +217,13 @@ static void RunBundleAndSnapshot( jobject jcaller, jlong shell_holder, jstring jbundlepath, - jstring /* snapshot override (unused) */, + jstring jsnapshotOverride, jstring jEntrypoint, jboolean /* reuse runtime controller (unused) */, jobject jAssetManager) { auto asset_manager = fml::MakeRefCounted(); const auto bundlepath = fml::jni::JavaStringToString(env, jbundlepath); - if (bundlepath.size() > 0) { // If we got a bundle path, attempt to use that as a directory asset // bundle or a zip asset bundle. @@ -244,8 +251,13 @@ static void RunBundleAndSnapshot( } } - auto isolate_configuration = CreateIsolateConfiguration(*asset_manager); + const auto defaultpath = fml::jni::JavaStringToString(env, jsnapshotOverride); + if (defaultpath.size() > 0) { + asset_manager->PushBack(std::make_unique( + fml::OpenFile(defaultpath.c_str(), fml::OpenPermission::kRead, true))); + } + auto isolate_configuration = CreateIsolateConfiguration(*asset_manager); if (!isolate_configuration) { FXL_DLOG(ERROR) << "Isolate configuration could not be determined for engine launch."; From 2c6fa0d7b026d3b4c8196820946016ec821bd171 Mon Sep 17 00:00:00 2001 From: skia-flutter-autoroll <37626415+skia-flutter-autoroll@users.noreply.github.com> Date: Thu, 26 Jul 2018 12:45:49 -0400 Subject: [PATCH 0882/1190] Roll src/third_party/skia b64db38b854b..897f256413c1 (4 commits) (#5875) Auto-roller completed checks. Merging. --- DEPS | 2 +- travis/licenses_golden/licenses_skia | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEPS b/DEPS index 8bde648fb977c..ab820ab4e1093 100644 --- a/DEPS +++ b/DEPS @@ -23,7 +23,7 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'skia_git': 'https://skia.googlesource.com', - 'skia_revision': 'b64db38b854bd8f6d564b7741ebf4795d130d168', + 'skia_revision': '897f256413c13d932a3c6f34eebe156c96defab8', # When updating the Dart revision, ensure that all entries that are # dependencies of Dart are also updated to match the entries in the diff --git a/travis/licenses_golden/licenses_skia b/travis/licenses_golden/licenses_skia index fb1be0537c713..6c44515be15cc 100644 --- a/travis/licenses_golden/licenses_skia +++ b/travis/licenses_golden/licenses_skia @@ -1,4 +1,4 @@ -Signature: 539a1849c5471865264c3a4b9dd168f6 +Signature: 5707f0851de1ee8f47c3e8a14c377845 UNUSED LICENSES: From 503ba7c4103d2cd40161019d94a15c74ad06eaad Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Thu, 26 Jul 2018 11:08:47 -0700 Subject: [PATCH 0883/1190] Dart SDK roll for 2018/07/26 (#5876) --- DEPS | 100 ++++----- tools/licenses/lib/filesystem.dart | 38 ++-- tools/licenses/lib/licenses.dart | 16 +- tools/licenses/lib/main.dart | 20 +- travis/licenses_golden/licenses_third_party | 230 +++++++++++++------- 5 files changed, 243 insertions(+), 161 deletions(-) diff --git a/DEPS b/DEPS index ab820ab4e1093..a4419555160c8 100644 --- a/DEPS +++ b/DEPS @@ -31,73 +31,73 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '937ee2e8ca4b76499e24cd463f07bfb736bccd74', + 'dart_revision': '9c69e7e1d29ecf349715ca2ddd437c9d0bbba0d7', - 'dart_args_tag': '1.4.1', - 'dart_async_tag': '2.0.7', + 'dart_args_tag': '1.4.4', + 'dart_async_tag': '2.0.8', 'dart_bazel_worker_tag': '0.1.11', - 'dart_boolean_selector_tag': '1.0.3', + 'dart_boolean_selector_tag': '1.0.4', 'dart_boringssl_gen_rev': 'fc47eaa1a245d858bae462cd64d4155605b850ea', 'dart_boringssl_rev': '189270cd190267f5bd60cfe8f8ce7a61d07ba6f4', - 'dart_charcode_tag': 'v1.1.1', - 'dart_cli_util_tag': '0.1.2+1', - 'dart_collection_tag': '1.14.10', - 'dart_convert_tag': '2.0.1', - 'dart_crypto_tag': '2.0.5', - 'dart_csslib_tag': '0.14.1', + 'dart_charcode_tag': 'v1.1.2', + 'dart_cli_util_rev': '4ad7ccbe3195fd2583b30f86a86697ef61e80f41', + 'dart_collection_tag': '1.14.11', + 'dart_convert_tag': '2.0.2', + 'dart_crypto_tag': '2.0.6', + 'dart_csslib_tag': '0.14.4+1', 'dart_dart2js_info_tag': '0.5.6+4', - 'dart_dart_style_tag': '1.1.2', - 'dart_dartdoc_tag': 'v0.20.1', - 'dart_fixnum_tag': '0.10.5', - 'dart_glob_tag': '1.1.5', - 'dart_html_tag': '0.13.3', - 'dart_http_multi_server_tag': '2.0.4', + 'dart_dart_style_tag': '1.1.3', + 'dart_dartdoc_tag': 'v0.20.2', + 'dart_fixnum_tag': '0.10.8', + 'dart_glob_tag': '1.1.7', + 'dart_html_tag': '0.13.3+2', + 'dart_http_multi_server_tag': '2.0.5', 'dart_http_parser_tag': '3.1.1', 'dart_http_retry_tag': '0.1.1', 'dart_http_tag': '0.11.3+17', 'dart_http_throttle_tag': '1.0.2', 'dart_intl_tag': '0.15.6', - 'dart_json_rpc_2_tag': '2.0.6', - 'dart_linter_tag': '0.1.56', - 'dart_logging_tag': '0.11.3+1', - 'dart_markdown_tag': '2.0.1', + 'dart_json_rpc_2_tag': '2.0.9', + 'dart_linter_tag': '0.1.58', + 'dart_logging_tag': '0.11.3+2', + 'dart_markdown_tag': '2.0.2', 'dart_matcher_tag': '0.12.3', - 'dart_mime_tag': '0.9.6', + 'dart_mime_tag': '0.9.6+2', 'dart_mockito_tag': 'd39ac507483b9891165e422ec98d9fb480037c8b', 'dart_mustache4dart_tag': 'v2.1.2', 'dart_oauth2_tag': '1.2.1', - 'dart_observatory_pub_packages_rev': 'caf0aecfb15077fc7a34d48e9df13606c793fddf', - 'dart_package_config_tag': '1.0.3', - 'dart_package_resolver_tag': '1.0.2+1', - 'dart_path_tag': '1.5.1', - 'dart_plugin_tag': '0.2.0+2', - 'dart_pool_tag': '1.3.4', + 'dart_observatory_pub_packages_rev': '0894122173b0f98eb08863a7712e78407d4477bc', + 'dart_package_config_tag': '1.0.5', + 'dart_package_resolver_tag': '1.0.4', + 'dart_path_tag': '1.6.2', + 'dart_plugin_tag': 'f5b4b0e32d1406d62daccea030ba6457d14b1c47', + 'dart_pool_tag': '1.3.6', 'dart_protobuf_tag': '0.9.0', 'dart_pub_rev': '58fe996eab8d54f28f5109c407ff0ab62fbd835d', - 'dart_pub_semver_tag': '1.4.1', - 'dart_quiver_tag': '0.29.0', - 'dart_resource_tag': '2.1.4', + 'dart_pub_semver_tag': '1.4.2', + 'dart_quiver_tag': '0.29.0+2', + 'dart_resource_rev': '2.1.5', 'dart_root_certificates_rev': '16ef64be64c7dfdff2b9f4b910726e635ccc519e', - 'dart_shelf_packages_handler_tag': '1.0.3', - 'dart_shelf_static_rev': 'v0.2.7', - 'dart_shelf_tag': '0.7.3+2', - 'dart_shelf_web_socket_tag': '0.2.2', - 'dart_source_map_stack_trace_tag': '1.1.4', - 'dart_source_maps_tag': '0.10.6', - 'dart_source_span_tag': '1.4.0', - 'dart_stack_trace_tag': '1.9.2', - 'dart_stream_channel_tag': '1.6.4', - 'dart_string_scanner_tag': '1.0.2', - 'dart_term_glyph_tag': '1.0.0', + 'dart_shelf_packages_handler_tag': '1.0.4', + 'dart_shelf_static_rev': 'v0.2.8', + 'dart_shelf_tag': '0.7.3+3', + 'dart_shelf_web_socket_tag': '0.2.2+3', + 'dart_source_map_stack_trace_tag': '1.1.5', + 'dart_source_maps_tag': '8af7cc1a1c3a193c1fba5993ce22a546a319c40e', + 'dart_source_span_tag': '1.4.1', + 'dart_stack_trace_tag': '1.9.3', + 'dart_stream_channel_tag': '1.6.8', + 'dart_string_scanner_tag': '1.0.3', + 'dart_term_glyph_tag': '1.0.1', + 'dart_test_reflective_loader_tag': '0.1.4', 'dart_test_tag': '1.0.0', 'dart_tuple_tag': 'v1.0.1', - 'dart_typed_data_tag': '1.1.3', + 'dart_typed_data_tag': '1.1.6', 'dart_usage_tag': '3.4.0', - 'dart_utf_tag': '0.9.0+4', - 'dart_watcher_tag': '0.9.7+8', - 'dart_web_socket_channel_tag': '1.0.7', - 'dart_yaml_tag': '2.1.14', - + 'dart_utf_tag': '0.9.0+5', + 'dart_watcher_rev': '0.9.7+10', + 'dart_web_socket_channel_tag': '1.0.9', + 'dart_yaml_tag': '2.1.15', # Build bot tooling for iOS 'ios_tools_revision': '69b7c1b160e7107a6a98d948363772dc9caea46f', @@ -185,7 +185,7 @@ deps = { Var('dart_git') + '/charcode.git' + '@' + Var('dart_charcode_tag'), 'src/third_party/dart/third_party/pkg/cli_util': - Var('dart_git') + '/cli_util.git' + '@' + Var('dart_cli_util_tag'), + Var('dart_git') + '/cli_util.git' + '@' + Var('dart_cli_util_rev'), 'src/third_party/dart/third_party/pkg/collection': Var('dart_git') + '/collection.git' + '@' + Var('dart_collection_tag'), @@ -284,7 +284,7 @@ deps = { Var('chromium_git') + '/external/github.com/google/quiver-dart' + '@' + Var('dart_quiver_tag'), 'src/third_party/dart/third_party/pkg/resource': - Var('dart_git') + '/resource.git' + '@' + Var('dart_resource_tag'), + Var('dart_git') + '/resource.git' + '@' + Var('dart_resource_rev'), 'src/third_party/dart/third_party/pkg/shelf': Var('dart_git') + '/shelf.git' + '@' + Var('dart_shelf_tag'), @@ -338,7 +338,7 @@ deps = { Var('dart_git') + '/usage.git' + '@' + Var('dart_usage_tag'), 'src/third_party/dart/third_party/pkg/watcher': - Var('dart_git') + '/watcher.git' + '@' + Var('dart_watcher_tag'), + Var('dart_git') + '/watcher.git' + '@' + Var('dart_watcher_rev'), 'src/third_party/dart/third_party/pkg/web_socket_channel': Var('dart_git') + '/web_socket_channel.git' + '@' + Var('dart_web_socket_channel_tag'), diff --git a/tools/licenses/lib/filesystem.dart b/tools/licenses/lib/filesystem.dart index 67137a8614fb7..1482d6dc945cc 100644 --- a/tools/licenses/lib/filesystem.dart +++ b/tools/licenses/lib/filesystem.dart @@ -26,7 +26,7 @@ enum FileType { typedef Reader = List Function(); class BytesOf extends Key { BytesOf(dynamic value) : super(value); } -class UTF8Of extends Key { UTF8Of(dynamic value) : super(value); } +class utf8Of extends Key { utf8Of(dynamic value) : super(value); } class Latin1Of extends Key { Latin1Of(dynamic value) : super(value); } bool matchesSignature(List bytes, List signature) { @@ -59,7 +59,7 @@ const String kMultiLicenseFileHeader = 'Notices for files contained in'; bool isMultiLicenseNotice(Reader reader) { List bytes = reader(); - return (ASCII.decode(bytes.take(kMultiLicenseFileHeader.length).toList(), allowInvalid: true) == kMultiLicenseFileHeader); + return (ascii.decode(bytes.take(kMultiLicenseFileHeader.length).toList(), allowInvalid: true) == kMultiLicenseFileHeader); } FileType identifyFile(String name, Reader reader) { @@ -114,7 +114,7 @@ FileType identifyFile(String name, Reader reader) { case 'tzdata': return FileType.binary; case 'compressed_atrace_data.txt': return FileType.binary; // Source files that don't use UTF-8 - case 'Messages_de_DE.properties': // has a few non-ASCII characters they forgot to escape (from gnu-libstdc++) + case 'Messages_de_DE.properties': // has a few non-ascii characters they forgot to escape (from gnu-libstdc++) case 'mmx_blendtmp.h': // author name in comment contains latin1 (mesa) case 'calling_convention.txt': // contains a soft hyphen instead of a real hyphen for some reason (mesa) // Character encoding data files @@ -310,11 +310,11 @@ abstract class TextFile extends File { } // mixin -abstract class UTF8TextFile extends TextFile { +abstract class utf8TextFile extends TextFile { @override String readString() { try { - return cache(new UTF8Of(this), () => UTF8.decode(readBytes())); + return cache(new utf8Of(this), () => utf8.decode(readBytes())); } on FormatException { print(fullName); rethrow; @@ -330,15 +330,15 @@ abstract class Latin1TextFile extends TextFile { final List bytes = readBytes(); if (bytes.any((int byte) => byte == 0x00)) throw '$fullName contains a U+0000 NULL and is probably not actually encoded as Win1252'; - bool isUTF8 = false; + bool isutf8 = false; try { - cache(new UTF8Of(this), () => UTF8.decode(readBytes())); - isUTF8 = true; + cache(new utf8Of(this), () => utf8.decode(readBytes())); + isutf8 = true; } on FormatException { } - if (isUTF8) + if (isutf8) throw '$fullName contains valid UTF-8 and is probably not actually encoded as Win1252'; - return LATIN1.decode(bytes); + return latin1.decode(bytes); }); } } @@ -460,7 +460,7 @@ class FileSystemDirectory extends IoNode implements Directory { case FileType.tar: yield new FileSystemTarFile(fileEntity); break; case FileType.gz: yield new FileSystemGZipFile(fileEntity); break; case FileType.bzip2: yield new FileSystemBZip2File(fileEntity); break; - case FileType.text: yield new FileSystemUTF8TextFile(fileEntity); break; + case FileType.text: yield new FileSystemutf8TextFile(fileEntity); break; case FileType.latin1Text: yield new FileSystemLatin1TextFile(fileEntity); break; case FileType.metadata: break; // ignore this file } @@ -499,8 +499,8 @@ class FileSystemFile extends IoNode implements File { } } -class FileSystemUTF8TextFile extends FileSystemFile with UTF8TextFile { - FileSystemUTF8TextFile(io.File file) : super(file); +class FileSystemutf8TextFile extends FileSystemFile with utf8TextFile { + FileSystemutf8TextFile(io.File file) : super(file); } class FileSystemLatin1TextFile extends FileSystemFile with Latin1TextFile { @@ -554,7 +554,7 @@ class ArchiveDirectory extends IoNode implements Directory { case FileType.tar: _files.add(new ArchiveTarFile(entryFullName, entry)); break; case FileType.gz: _files.add(new ArchiveGZipFile(entryFullName, entry)); break; case FileType.bzip2: _files.add(new ArchiveBZip2File(entryFullName, entry)); break; - case FileType.text: _files.add(new ArchiveUTF8TextFile(entryFullName, entry)); break; + case FileType.text: _files.add(new Archiveutf8TextFile(entryFullName, entry)); break; case FileType.latin1Text: _files.add(new ArchiveLatin1TextFile(entryFullName, entry)); break; case FileType.metadata: break; // ignore this file } @@ -595,8 +595,8 @@ class ArchiveFile extends IoNode implements File { } } -class ArchiveUTF8TextFile extends ArchiveFile with UTF8TextFile { - ArchiveUTF8TextFile(String fullName, a.ArchiveFile file) : super(fullName, file); +class Archiveutf8TextFile extends ArchiveFile with utf8TextFile { + Archiveutf8TextFile(String fullName, a.ArchiveFile file) : super(fullName, file); } class ArchiveLatin1TextFile extends ArchiveFile with Latin1TextFile { @@ -634,7 +634,7 @@ class InMemoryFile extends IoNode implements File { case FileType.tar: return new InMemoryTarFile(fullName, bytes); break; case FileType.gz: return new InMemoryGZipFile(fullName, bytes); break; case FileType.bzip2: return new InMemoryBZip2File(fullName, bytes); break; - case FileType.text: return new InMemoryUTF8TextFile(fullName, bytes); break; + case FileType.text: return new InMemoryutf8TextFile(fullName, bytes); break; case FileType.latin1Text: return new InMemoryLatin1TextFile(fullName, bytes); break; case FileType.metadata: break; // ignore this file } @@ -654,8 +654,8 @@ class InMemoryFile extends IoNode implements File { List readBytes() => _bytes; } -class InMemoryUTF8TextFile extends InMemoryFile with UTF8TextFile { - InMemoryUTF8TextFile(String fullName, List file) : super(fullName, file); +class InMemoryutf8TextFile extends InMemoryFile with utf8TextFile { + InMemoryutf8TextFile(String fullName, List file) : super(fullName, file); } class InMemoryLatin1TextFile extends InMemoryFile with Latin1TextFile { diff --git a/tools/licenses/lib/licenses.dart b/tools/licenses/lib/licenses.dart index e38b2dfd566de..682b51d21813c 100644 --- a/tools/licenses/lib/licenses.dart +++ b/tools/licenses/lib/licenses.dart @@ -322,25 +322,25 @@ abstract class License implements Comparable { throw 'incomplete license detected:\n---\n$body\n---'; // if (type == LicenseType.unknown) // print('need detector for:\n----\n$body\n----'); - bool isUTF8 = true; + bool isutf8 = true; List latin1Encoded; try { - latin1Encoded = LATIN1.encode(body); - isUTF8 = false; + latin1Encoded = latin1.encode(body); + isutf8 = false; } on ArgumentError { } - if (!isUTF8) { + if (!isutf8) { bool isAscii = false; try { - ASCII.decode(latin1Encoded); + ascii.decode(latin1Encoded); isAscii = true; } on FormatException { } if (isAscii) return; try { - UTF8.decode(latin1Encoded); - isUTF8 = true; + utf8.decode(latin1Encoded); + isutf8 = true; } on FormatException { } - if (isUTF8) + if (isutf8) throw 'tried to create a License object with text that appears to have been misdecoded as Latin1 instead of as UTF-8:\n$body'; } } diff --git a/tools/licenses/lib/main.dart b/tools/licenses/lib/main.dart index 06ea43faeb8cb..b6c32643dce8d 100644 --- a/tools/licenses/lib/main.dart +++ b/tools/licenses/lib/main.dart @@ -92,7 +92,7 @@ class RepositorySourceFile extends RepositoryLicensedFile { try { contents = io.readString(); } on FormatException { - print('non-UTF8 data in $io'); + print('non-utf8 data in $io'); system.exit(2); } _licenses = determineLicensesFor(contents, name, parent, origin: '$this'); @@ -736,33 +736,33 @@ class RepositoryMultiLicenseNoticesForFilesFile extends RepositoryLicenseFile { // "Notices for files contained in the" // ...then have a second line which is 60 "=" characters final List> contents = splitIntList(io.readBytes(), 0x0A).toList(); - if (!ASCII.decode(contents[0]).startsWith('Notices for files contained in') || - ASCII.decode(contents[1]) != '============================================================\n') + if (!ascii.decode(contents[0]).startsWith('Notices for files contained in') || + ascii.decode(contents[1]) != '============================================================\n') throw 'unrecognised syntax: ${io.fullName}'; int index = 2; while (index < contents.length) { - if (ASCII.decode(contents[index]) != 'Notices for file(s):\n') + if (ascii.decode(contents[index]) != 'Notices for file(s):\n') throw 'unrecognised syntax on line ${index + 1}: ${io.fullName}'; index += 1; final List names = []; do { - names.add(ASCII.decode(contents[index])); + names.add(ascii.decode(contents[index])); index += 1; - } while (ASCII.decode(contents[index]) != '------------------------------------------------------------\n'); + } while (ascii.decode(contents[index]) != '------------------------------------------------------------\n'); index += 1; final List> body = >[]; do { body.add(contents[index]); index += 1; } while (index < contents.length && - ASCII.decode(contents[index], allowInvalid: true) != '============================================================\n'); + ascii.decode(contents[index], allowInvalid: true) != '============================================================\n'); index += 1; final List bodyBytes = body.expand((List line) => line).toList(); String bodyText; try { - bodyText = UTF8.decode(bodyBytes); + bodyText = utf8.decode(bodyBytes); } on FormatException { - bodyText = LATIN1.decode(bodyBytes); + bodyText = latin1.decode(bodyBytes); } License license = new License.unique(bodyText, LicenseType.unknown, origin: io.fullName); for (String name in names) { @@ -2545,7 +2545,7 @@ Future main(List arguments) async { system.File goldenFile = new system.File( path.join(argResults['golden'], 'licenses_${component.io.name}')); String goldenSignature = await goldenFile.openRead() - .transform(UTF8.decoder).transform(new LineSplitter()).first; + .transform(utf8.decoder).transform(new LineSplitter()).first; Match goldenMatch = signaturePattern.matchAsPrefix(goldenSignature); if (goldenMatch != null && goldenMatch.group(1) == signature) { system.stderr.writeln(' Skipping this component - no change in signature'); diff --git a/travis/licenses_golden/licenses_third_party b/travis/licenses_golden/licenses_third_party index e2e81370bf544..6f77ad554264d 100644 --- a/travis/licenses_golden/licenses_third_party +++ b/travis/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 4cffaa132f0dd7025b2e5a04444af676 +Signature: 41552c06fa23e14a905292ca7a566ea8 UNUSED LICENSES: @@ -34,6 +34,38 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_internal/LICENSE +TYPE: LicenseType.bsd +---------------------------------------------------------------------------------------------------- +Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== ORIGIN: ../../../third_party/rapidjson/LICENSE TYPE: LicenseType.bsd @@ -5444,6 +5476,76 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: dart +ORIGIN: ../../../third_party/dart/runtime/bin/dart_embedder_api_impl.cc + ../../../third_party/dart/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/runtime/bin/dart_embedder_api_impl.cc +FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.cc +FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.h +FILE: ../../../third_party/dart/runtime/include/dart_embedder_api.h +FILE: ../../../third_party/dart/runtime/vm/base64.cc +FILE: ../../../third_party/dart/runtime/vm/base64.h +FILE: ../../../third_party/dart/runtime/vm/base64_test.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h +FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.h +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.cc +FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.h +FILE: ../../../third_party/dart/runtime/vm/constants.h +FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h +FILE: ../../../third_party/dart/runtime/vm/datastream.cc +FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h +FILE: ../../../third_party/dart/runtime/vm/hash.h +FILE: ../../../third_party/dart/runtime/vm/interpreter.cc +FILE: ../../../third_party/dart/runtime/vm/interpreter.h +FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc +FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h +FILE: ../../../third_party/dart/sdk/lib/js/_js.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart +FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart +FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: dart ORIGIN: ../../../third_party/dart/runtime/bin/process_test.cc + ../../../third_party/dart/LICENSE @@ -5574,73 +5676,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== -==================================================================================================== -LIBRARY: dart -ORIGIN: ../../../third_party/dart/runtime/bin/typed_data_utils.cc + ../../../third_party/dart/LICENSE -TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.cc -FILE: ../../../third_party/dart/runtime/bin/typed_data_utils.h -FILE: ../../../third_party/dart/runtime/vm/base64.cc -FILE: ../../../third_party/dart/runtime/vm/base64.h -FILE: ../../../third_party/dart/runtime/vm/base64_test.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/assembler/disassembler_kbc.h -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/backend/code_statistics.h -FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/compiler_pass.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/bytecode_reader.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/constant_evaluator.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_fingerprints.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/kernel_translation_helper.h -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.cc -FILE: ../../../third_party/dart/runtime/vm/compiler/frontend/scope_builder.h -FILE: ../../../third_party/dart/runtime/vm/constants_kbc.h -FILE: ../../../third_party/dart/runtime/vm/datastream.cc -FILE: ../../../third_party/dart/runtime/vm/finalizable_data.h -FILE: ../../../third_party/dart/runtime/vm/hash.h -FILE: ../../../third_party/dart/runtime/vm/interpreter.cc -FILE: ../../../third_party/dart/runtime/vm/interpreter.h -FILE: ../../../third_party/dart/runtime/vm/stack_frame_kbc.h -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.cc -FILE: ../../../third_party/dart/runtime/vm/type_testing_stubs.h -FILE: ../../../third_party/dart/sdk/lib/js/_js.dart -FILE: ../../../third_party/dart/sdk/lib/js/_js_client.dart -FILE: ../../../third_party/dart/sdk/lib/js/_js_server.dart -FILE: ../../../third_party/dart/sdk/lib/typed_data/unmodifiable_typed_data.dart ----------------------------------------------------------------------------------------------------- -Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file -for details. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -==================================================================================================== - ==================================================================================================== LIBRARY: dart ORIGIN: ../../../third_party/dart/runtime/bin/vmservice/loader.dart + ../../../third_party/dart/LICENSE @@ -14574,6 +14609,7 @@ TYPE: LicenseType.bsd FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_iterable.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_list.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/combined_wrappers/combined_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/dart_internal/lib/extract_type_arguments.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/dart2js.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/stack_trace/lib/src/lazy_chain.dart ---------------------------------------------------------------------------------------------------- @@ -14615,7 +14651,6 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/co FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_map.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/equality_set.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/functions.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/typed_wrappers.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/collection/lib/src/union_set_controller.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/lib/src/intl/compact_number_format.dart @@ -14623,12 +14658,17 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/order_matchers.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/lib/meta.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/observable.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_record.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/list_diff.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/differs.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/differs/list_differ.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/differs/map_differ.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/internal.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_list.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/observable_map.dart -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/property_change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/records.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/records/list_change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/records/map_change_record.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/records/property_change_record.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/to_observable.dart ---------------------------------------------------------------------------------------------------- Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file @@ -15025,6 +15065,7 @@ FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/in FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/intl/tool/generate_locale_data_files.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/logging/lib/logging.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/core_matchers.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/custom_matcher.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/description.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/error_matchers.dart FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/interfaces.dart @@ -15076,11 +15117,52 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ==================================================================================================== +==================================================================================================== +LIBRARY: observatory_pub_packages +ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/equals_matcher.dart + ../../../third_party/dart/third_party/observatory_pub_packages/packages/browser/LICENSE +TYPE: LicenseType.bsd +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/equals_matcher.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/feature_matcher.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/having_matcher.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/matcher/lib/src/type_matcher.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_map.dart +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/path/lib/src/path_set.dart +---------------------------------------------------------------------------------------------------- +Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +for details. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================================================== + ==================================================================================================== LIBRARY: observatory_pub_packages ORIGIN: ../../../third_party/dart/third_party/observatory_pub_packages/packages/meta/LICENSE TYPE: LicenseType.bsd -FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/.analysis_options +FILE: ../../../third_party/dart/third_party/observatory_pub_packages/packages/observable/lib/src/change_notifier.dart ---------------------------------------------------------------------------------------------------- Copyright 2016, the Dart project authors. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -16795,4 +16877,4 @@ freely, subject to the following restrictions: misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. ==================================================================================================== -Total license count: 279 +Total license count: 281 From 9f8285ac6c18eeb64492628254ce154a7cb0a6d2 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 26 Jul 2018 12:49:34 -0700 Subject: [PATCH 0884/1190] Remove all dependencies on Garnet. (#5869) --- BUILD.gn | 1 - DEPS | 3 - common/BUILD.gn | 1 - common/settings.h | 8 +- common/task_runners.cc | 16 +- common/task_runners.h | 29 +- flow/BUILD.gn | 4 - flow/compositor_context.h | 6 +- flow/debug_print.h | 2 +- flow/export_node.cc | 24 +- flow/export_node.h | 24 +- flow/instrumentation.cc | 19 +- flow/instrumentation.h | 24 +- flow/layers/backdrop_filter_layer.cc | 2 +- flow/layers/backdrop_filter_layer.h | 2 +- flow/layers/child_scene_layer.cc | 2 +- flow/layers/child_scene_layer.h | 6 +- flow/layers/clip_path_layer.cc | 4 +- flow/layers/clip_path_layer.h | 2 +- flow/layers/clip_rect_layer.cc | 4 +- flow/layers/clip_rect_layer.h | 2 +- flow/layers/clip_rrect_layer.cc | 4 +- flow/layers/clip_rrect_layer.h | 2 +- flow/layers/color_filter_layer.cc | 2 +- flow/layers/color_filter_layer.h | 2 +- flow/layers/container_layer.cc | 4 +- flow/layers/container_layer.h | 2 +- flow/layers/default_layer_builder.cc | 6 +- flow/layers/default_layer_builder.h | 6 +- flow/layers/layer.h | 8 +- flow/layers/layer_builder.h | 6 +- flow/layers/layer_tree.h | 12 +- flow/layers/opacity_layer.cc | 2 +- flow/layers/opacity_layer.h | 2 +- flow/layers/performance_overlay_layer.h | 4 +- flow/layers/physical_shape_layer.cc | 4 +- flow/layers/picture_layer.cc | 6 +- flow/layers/picture_layer.h | 2 +- flow/layers/shader_mask_layer.cc | 2 +- flow/layers/shader_mask_layer.h | 2 +- flow/layers/texture_layer.h | 2 +- flow/layers/transform_layer.cc | 4 +- flow/layers/transform_layer.h | 2 +- flow/matrix_decomposition.h | 4 +- flow/matrix_decomposition_unittests.cc | 2 +- flow/raster_cache.cc | 4 +- flow/raster_cache.h | 8 +- flow/raster_cache_key.h | 6 +- flow/scene_update_context.cc | 12 +- flow/scene_update_context.h | 18 +- flow/skia_gpu_object.cc | 6 +- flow/skia_gpu_object.h | 28 +- flow/texture.h | 6 +- fml/BUILD.gn | 11 +- fml/arraysize.h | 16 + fml/command_line.cc | 165 +++++++ fml/command_line.h | 242 ++++++++++ fml/command_line_unittest.cc | 447 ++++++++++++++++++ fml/file.h | 3 + fml/make_copyable.h | 63 +++ fml/memory/ref_counted.h | 4 +- fml/memory/thread_checker.h | 4 +- fml/message_loop.cc | 12 +- fml/message_loop.h | 12 +- fml/message_loop_impl.cc | 24 +- fml/message_loop_impl.h | 28 +- fml/message_loop_unittests.cc | 28 +- fml/native_library.h | 17 +- fml/paths.h | 7 + fml/platform/android/message_loop_android.cc | 2 +- fml/platform/android/message_loop_android.h | 7 +- fml/platform/darwin/message_loop_darwin.h | 6 +- fml/platform/darwin/message_loop_darwin.mm | 4 +- fml/platform/darwin/paths_darwin.mm | 4 +- fml/platform/linux/message_loop_linux.cc | 4 +- fml/platform/linux/message_loop_linux.h | 6 +- fml/platform/linux/paths_linux.cc | 2 +- fml/platform/linux/timerfd.cc | 2 +- fml/platform/linux/timerfd.h | 4 +- fml/platform/posix/file_posix.cc | 7 + fml/platform/posix/native_library_posix.cc | 18 +- fml/platform/posix/paths_posix.cc | 48 ++ fml/platform/win/file_win.cc | 15 + fml/platform/win/message_loop_win.cc | 6 +- fml/platform/win/message_loop_win.h | 10 +- fml/platform/win/native_library_win.cc | 12 +- fml/platform/win/paths_win.cc | 57 ++- fml/string_view.cc | 212 +++++++++ fml/string_view.h | 167 +++++++ fml/string_view_unittest.cc | 418 ++++++++++++++++ fml/task_runner.cc | 18 +- fml/task_runner.h | 30 +- fml/thread.cc | 6 +- fml/thread.h | 4 +- lib/io/BUILD.gn | 9 +- lib/io/dart_io.h | 4 +- lib/ui/BUILD.gn | 1 - lib/ui/compositing/scene.cc | 10 +- lib/ui/compositing/scene.h | 4 +- lib/ui/compositing/scene_builder.cc | 6 +- lib/ui/compositing/scene_builder.h | 8 +- lib/ui/compositing/scene_host.cc | 14 +- lib/ui/compositing/scene_host.h | 14 +- lib/ui/dart_runtime_hooks.cc | 4 +- lib/ui/dart_runtime_hooks.h | 4 +- lib/ui/dart_ui.cc | 4 +- lib/ui/dart_ui.h | 4 +- lib/ui/dart_wrapper.h | 8 +- .../isolate_name_server/isolate_name_server.h | 4 +- lib/ui/painting/canvas.cc | 6 +- lib/ui/painting/canvas.h | 4 +- lib/ui/painting/codec.cc | 62 +-- lib/ui/painting/codec.h | 16 +- lib/ui/painting/frame_info.h | 10 +- lib/ui/painting/gradient.cc | 14 +- lib/ui/painting/gradient.h | 4 +- lib/ui/painting/image.h | 6 +- lib/ui/painting/image_encoding.cc | 32 +- lib/ui/painting/image_filter.cc | 4 +- lib/ui/painting/image_filter.h | 4 +- lib/ui/painting/image_shader.cc | 4 +- lib/ui/painting/image_shader.h | 4 +- lib/ui/painting/matrix.cc | 4 +- lib/ui/painting/paint.cc | 12 +- lib/ui/painting/path.cc | 12 +- lib/ui/painting/path.h | 16 +- lib/ui/painting/path_measure.cc | 8 +- lib/ui/painting/path_measure.h | 6 +- lib/ui/painting/picture.cc | 8 +- lib/ui/painting/picture.h | 6 +- lib/ui/painting/picture_recorder.cc | 8 +- lib/ui/painting/picture_recorder.h | 10 +- lib/ui/painting/rrect.cc | 4 +- lib/ui/painting/shader.h | 2 +- lib/ui/painting/vertices.cc | 10 +- lib/ui/painting/vertices.h | 4 +- lib/ui/plugins/callback_cache.cc | 2 +- lib/ui/plugins/callback_cache.h | 4 +- lib/ui/semantics/semantics_update.cc | 4 +- lib/ui/semantics/semantics_update.h | 4 +- lib/ui/semantics/semantics_update_builder.cc | 2 +- lib/ui/semantics/semantics_update_builder.h | 8 +- lib/ui/text/asset_manager_font_provider.cc | 6 +- lib/ui/text/asset_manager_font_provider.h | 6 +- lib/ui/text/font_collection.cc | 4 +- lib/ui/text/font_collection.h | 6 +- lib/ui/text/paragraph.cc | 4 +- lib/ui/text/paragraph.h | 6 +- lib/ui/text/paragraph_builder.cc | 10 +- lib/ui/text/paragraph_builder.h | 6 +- lib/ui/text/paragraph_impl_txt.cc | 4 +- lib/ui/text/text_box.cc | 4 +- lib/ui/ui_dart_state.cc | 6 +- lib/ui/ui_dart_state.h | 10 +- lib/ui/window/platform_message.cc | 4 +- lib/ui/window/platform_message.h | 18 +- lib/ui/window/platform_message_response.h | 8 +- .../window/platform_message_response_dart.cc | 14 +- .../window/platform_message_response_dart.h | 6 +- lib/ui/window/pointer_data_packet.h | 4 +- lib/ui/window/window.cc | 16 +- lib/ui/window/window.h | 10 +- runtime/BUILD.gn | 2 - runtime/dart_isolate.cc | 70 +-- runtime/dart_isolate.h | 52 +- runtime/dart_isolate_unittests.cc | 6 +- runtime/dart_service_isolate.cc | 28 +- runtime/dart_snapshot.cc | 30 +- runtime/dart_snapshot.h | 18 +- runtime/dart_snapshot_buffer.cc | 12 +- runtime/dart_snapshot_buffer.h | 4 +- runtime/dart_vm.cc | 66 +-- runtime/dart_vm.h | 52 +- runtime/dart_vm_unittests.cc | 4 +- runtime/embedder_resources.cc | 10 +- runtime/runtime_controller.cc | 28 +- runtime/runtime_controller.h | 28 +- runtime/runtime_delegate.h | 9 +- runtime/service_protocol.cc | 40 +- runtime/service_protocol.h | 41 +- shell/common/BUILD.gn | 2 - shell/common/animator.cc | 17 +- shell/common/animator.h | 18 +- shell/common/engine.cc | 40 +- shell/common/engine.h | 28 +- shell/common/io_manager.cc | 10 +- shell/common/io_manager.h | 11 +- shell/common/isolate_configuration.cc | 12 +- shell/common/isolate_configuration.h | 4 +- shell/common/platform_view.cc | 14 +- shell/common/platform_view.h | 14 +- shell/common/rasterizer.cc | 12 +- shell/common/rasterizer.h | 8 +- shell/common/run_configuration.h | 6 +- shell/common/shell.cc | 185 ++++---- shell/common/shell.h | 40 +- shell/common/shell_unittests.cc | 10 +- shell/common/skia_event_tracer_impl.cc | 4 +- shell/common/surface.cc | 4 +- shell/common/surface.h | 6 +- shell/common/switches.cc | 14 +- shell/common/switches.h | 8 +- shell/common/thread_host.h | 2 +- shell/common/vsync_waiter.cc | 4 +- shell/common/vsync_waiter.h | 12 +- shell/common/vsync_waiter_fallback.cc | 22 +- shell/common/vsync_waiter_fallback.h | 12 +- shell/gpu/gpu.gni | 1 - shell/gpu/gpu_surface_gl.cc | 22 +- shell/gpu/gpu_surface_gl.h | 8 +- shell/gpu/gpu_surface_software.cc | 2 +- shell/gpu/gpu_surface_software.h | 8 +- shell/gpu/gpu_surface_vulkan.cc | 12 +- shell/gpu/gpu_surface_vulkan.h | 10 +- shell/platform/android/BUILD.gn | 1 - shell/platform/android/android_context_gl.cc | 28 +- shell/platform/android/android_context_gl.h | 24 +- .../platform/android/android_environment_gl.h | 12 +- .../android/android_external_texture_gl.h | 2 +- .../platform/android/android_native_window.h | 14 +- .../platform/android/android_shell_holder.cc | 22 +- shell/platform/android/android_shell_holder.h | 6 +- shell/platform/android/android_surface.h | 4 +- shell/platform/android/android_surface_gl.cc | 28 +- shell/platform/android/android_surface_gl.h | 10 +- .../android/android_surface_software.cc | 4 +- .../android/android_surface_software.h | 8 +- .../android/android_surface_vulkan.cc | 8 +- .../platform/android/android_surface_vulkan.h | 10 +- shell/platform/android/apk_asset_provider.cc | 2 +- shell/platform/android/apk_asset_provider.h | 4 +- shell/platform/android/flutter_main.cc | 18 +- shell/platform/android/flutter_main.h | 4 +- shell/platform/android/library_loader.cc | 6 +- .../platform_message_response_android.cc | 8 +- .../platform_message_response_android.h | 10 +- .../platform/android/platform_view_android.cc | 20 +- .../platform/android/platform_view_android.h | 15 +- .../android/platform_view_android_jni.cc | 26 +- .../android/platform_view_android_jni.h | 2 +- .../platform/android/vsync_waiter_android.cc | 24 +- shell/platform/android/vsync_waiter_android.h | 4 +- shell/platform/darwin/BUILD.gn | 1 - shell/platform/darwin/common/BUILD.gn | 1 - shell/platform/darwin/common/command_line.h | 6 +- shell/platform/darwin/common/command_line.mm | 4 +- shell/platform/darwin/desktop/BUILD.gn | 1 - .../platform/darwin/desktop/flutter_window.mm | 12 +- shell/platform/darwin/desktop/main_mac.mm | 6 +- .../darwin/desktop/platform_view_mac.h | 4 +- .../darwin/desktop/platform_view_mac.mm | 2 +- .../darwin/desktop/vsync_waiter_mac.cc | 8 +- .../darwin/desktop/vsync_waiter_mac.h | 4 +- shell/platform/darwin/ios/BUILD.gn | 1 - .../framework/Source/FlutterDartProject.mm | 2 +- .../Source/FlutterHeadlessDartRunner.mm | 24 +- .../FlutterPluginAppLifeCycleDelegate.mm | 4 +- .../framework/Source/FlutterViewController.mm | 26 +- .../framework/Source/accessibility_bridge.h | 13 +- .../framework/Source/accessibility_bridge.mm | 10 +- .../framework/Source/flutter_touch_mapper.h | 4 +- .../Source/platform_message_response_darwin.h | 18 +- .../Source/platform_message_router.h | 6 +- .../Source/platform_message_router.mm | 4 +- .../ios/framework/Source/vsync_waiter_ios.h | 4 +- .../ios/framework/Source/vsync_waiter_ios.mm | 10 +- .../darwin/ios/headless_platform_view_ios.h | 8 +- .../darwin/ios/headless_platform_view_ios.mm | 2 +- .../darwin/ios/ios_external_texture_gl.h | 2 +- .../darwin/ios/ios_external_texture_gl.mm | 6 +- shell/platform/darwin/ios/ios_gl_context.h | 4 +- shell/platform/darwin/ios/ios_gl_context.mm | 38 +- shell/platform/darwin/ios/ios_surface.h | 4 +- shell/platform/darwin/ios/ios_surface_gl.h | 4 +- .../darwin/ios/ios_surface_software.h | 4 +- .../darwin/ios/ios_surface_software.mm | 2 +- shell/platform/darwin/ios/platform_view_ios.h | 8 +- .../platform/darwin/ios/platform_view_ios.mm | 8 +- shell/platform/embedder/BUILD.gn | 1 - shell/platform/embedder/embedder.cc | 23 +- shell/platform/embedder/embedder_engine.cc | 10 +- shell/platform/embedder/embedder_engine.h | 9 +- .../embedder/platform_view_embedder.cc | 2 +- .../embedder/platform_view_embedder.h | 8 +- shell/testing/BUILD.gn | 1 - shell/testing/tester_main.cc | 28 +- testing/BUILD.gn | 1 - testing/thread_test.cc | 4 +- testing/thread_test.h | 10 +- third_party/txt/BUILD.gn | 4 +- .../txt/benchmarks/paint_record_benchmarks.cc | 4 +- .../txt/benchmarks/paragraph_benchmarks.cc | 4 +- .../paragraph_builder_benchmarks.cc | 2 +- .../txt/benchmarks/styled_runs_benchmarks.cc | 4 +- .../txt/benchmarks/txt_run_all_benchmarks.cc | 8 +- third_party/txt/src/log/log.h | 14 +- third_party/txt/src/txt/asset_font_manager.cc | 18 +- third_party/txt/src/txt/asset_font_manager.h | 4 +- third_party/txt/src/txt/font_collection.cc | 2 +- third_party/txt/src/txt/font_collection.h | 6 +- third_party/txt/src/txt/font_skia.h | 4 +- third_party/txt/src/txt/paint_record.cc | 2 +- third_party/txt/src/txt/paint_record.h | 6 +- third_party/txt/src/txt/paragraph.cc | 4 +- third_party/txt/src/txt/paragraph.h | 6 +- third_party/txt/src/txt/paragraph_builder.cc | 2 +- third_party/txt/src/txt/paragraph_builder.h | 4 +- third_party/txt/src/txt/platform.h | 2 +- third_party/txt/src/txt/styled_runs.cc | 2 +- third_party/txt/src/txt/test_font_manager.cc | 2 +- third_party/txt/src/txt/test_font_manager.h | 4 +- .../src/txt/typeface_font_asset_provider.cc | 4 +- .../src/txt/typeface_font_asset_provider.h | 6 +- .../txt/tests/font_collection_unittests.cc | 4 +- third_party/txt/tests/paragraph_unittests.cc | 2 +- third_party/txt/tests/render_test.cc | 4 +- third_party/txt/tests/render_test.h | 4 +- .../txt/tests/txt_run_all_unittests.cc | 10 +- third_party/txt/tests/txt_test_utils.cc | 6 +- third_party/txt/tests/txt_test_utils.h | 6 +- travis/licenses_golden/licenses_flutter | 37 +- vulkan/BUILD.gn | 2 +- vulkan/vulkan_application.cc | 18 +- vulkan/vulkan_application.h | 4 +- vulkan/vulkan_backbuffer.cc | 8 +- vulkan/vulkan_backbuffer.h | 10 +- vulkan/vulkan_command_buffer.cc | 2 +- vulkan/vulkan_command_buffer.h | 12 +- vulkan/vulkan_debug_report.cc | 11 +- vulkan/vulkan_debug_report.h | 4 +- vulkan/vulkan_device.cc | 12 +- vulkan/vulkan_device.h | 20 +- vulkan/vulkan_handle.h | 6 +- vulkan/vulkan_image.h | 8 +- vulkan/vulkan_interface.h | 6 +- vulkan/vulkan_native_surface.h | 2 +- vulkan/vulkan_native_surface_android.h | 4 +- vulkan/vulkan_native_surface_magma.h | 4 +- vulkan/vulkan_proc_table.cc | 12 +- vulkan/vulkan_proc_table.h | 14 +- vulkan/vulkan_surface.cc | 4 +- vulkan/vulkan_surface.h | 4 +- vulkan/vulkan_swapchain.cc | 60 +-- vulkan/vulkan_swapchain.h | 8 +- vulkan/vulkan_utilities.h | 2 +- vulkan/vulkan_window.cc | 30 +- vulkan/vulkan_window.h | 12 +- 347 files changed, 3580 insertions(+), 1729 deletions(-) create mode 100644 fml/arraysize.h create mode 100644 fml/command_line.cc create mode 100644 fml/command_line.h create mode 100644 fml/command_line_unittest.cc create mode 100644 fml/make_copyable.h create mode 100644 fml/platform/posix/paths_posix.cc create mode 100644 fml/string_view.cc create mode 100644 fml/string_view.h create mode 100644 fml/string_view_unittest.cc diff --git a/BUILD.gn b/BUILD.gn index 91709a0e558a9..699af81e24c73 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -48,7 +48,6 @@ group("flutter") { "$flutter_root/shell/platform/embedder:flutter_engine", "$flutter_root/synchronization:synchronization_unittests", "$flutter_root/third_party/txt:txt_unittests", - "//garnet/public/lib/fxl:fxl_unittests", ] } } diff --git a/DEPS b/DEPS index a4419555160c8..e8e8c5e343e6f 100644 --- a/DEPS +++ b/DEPS @@ -122,9 +122,6 @@ deps = { # build. Eventually, we'll manage these dependencies together with Fuchsia # and not have to specific specific hashes. - 'src/garnet': - Var('fuchsia_git') + '/garnet' + '@' + 'b7492b5f34e32248b164eb48ae8e67995aebda67', - 'src/third_party/tonic': Var('fuchsia_git') + '/tonic' + '@' + '57d508b12462db686573edcbc97891d90cf92f90', diff --git a/common/BUILD.gn b/common/BUILD.gn index 47cd7d3d62644..c0212e3528920 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -18,7 +18,6 @@ source_set("common") { deps = [ "$flutter_root/fml", - "//garnet/public/lib/fxl", ] public_configs = [ diff --git a/common/settings.h b/common/settings.h index 547673529ee1e..124529b90c57d 100644 --- a/common/settings.h +++ b/common/settings.h @@ -12,13 +12,13 @@ #include #include +#include "flutter/fml/closure.h" #include "flutter/fml/unique_fd.h" -#include "lib/fxl/functional/closure.h" namespace blink { using TaskObserverAdd = - std::function; + std::function; using TaskObserverRemove = std::function; struct Settings { @@ -70,10 +70,10 @@ struct Settings { TaskObserverRemove task_observer_remove; // The main isolate is current when this callback is made. This is a good spot // to perform native Dart bindings for libraries not built in. - fxl::Closure root_isolate_create_callback; + fml::closure root_isolate_create_callback; // The isolate is not current and may have already been destroyed when this // call is made. - fxl::Closure root_isolate_shutdown_callback; + fml::closure root_isolate_shutdown_callback; bool enable_software_rendering = false; bool skia_deterministic_rendering_on_cpu = false; bool verbose_logging = false; diff --git a/common/task_runners.cc b/common/task_runners.cc index 1a09daec1815c..bb62c8e9c04e3 100644 --- a/common/task_runners.cc +++ b/common/task_runners.cc @@ -9,10 +9,10 @@ namespace blink { TaskRunners::TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io) + fml::RefPtr platform, + fml::RefPtr gpu, + fml::RefPtr ui, + fml::RefPtr io) : label_(std::move(label)), platform_(std::move(platform)), gpu_(std::move(gpu)), @@ -25,19 +25,19 @@ const std::string& TaskRunners::GetLabel() const { return label_; } -fxl::RefPtr TaskRunners::GetPlatformTaskRunner() const { +fml::RefPtr TaskRunners::GetPlatformTaskRunner() const { return platform_; } -fxl::RefPtr TaskRunners::GetUITaskRunner() const { +fml::RefPtr TaskRunners::GetUITaskRunner() const { return ui_; } -fxl::RefPtr TaskRunners::GetIOTaskRunner() const { +fml::RefPtr TaskRunners::GetIOTaskRunner() const { return io_; } -fxl::RefPtr TaskRunners::GetGPUTaskRunner() const { +fml::RefPtr TaskRunners::GetGPUTaskRunner() const { return gpu_; } diff --git a/common/task_runners.h b/common/task_runners.h index f41ae147ebad0..642a8a158f12d 100644 --- a/common/task_runners.h +++ b/common/task_runners.h @@ -7,40 +7,41 @@ #include -#include "lib/fxl/macros.h" -#include "lib/fxl/tasks/task_runner.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/task_runner.h" namespace blink { class TaskRunners { public: TaskRunners(std::string label, - fxl::RefPtr platform, - fxl::RefPtr gpu, - fxl::RefPtr ui, - fxl::RefPtr io); + fml::RefPtr platform, + fml::RefPtr gpu, + fml::RefPtr ui, + fml::RefPtr io); ~TaskRunners(); const std::string& GetLabel() const; - fxl::RefPtr GetPlatformTaskRunner() const; + fml::RefPtr GetPlatformTaskRunner() const; - fxl::RefPtr GetUITaskRunner() const; + fml::RefPtr GetUITaskRunner() const; - fxl::RefPtr GetIOTaskRunner() const; + fml::RefPtr GetIOTaskRunner() const; - fxl::RefPtr GetGPUTaskRunner() const; + fml::RefPtr GetGPUTaskRunner() const; bool IsValid() const; private: const std::string label_; - fxl::RefPtr platform_; - fxl::RefPtr gpu_; - fxl::RefPtr ui_; - fxl::RefPtr io_; + fml::RefPtr platform_; + fml::RefPtr gpu_; + fml::RefPtr ui_; + fml::RefPtr io_; }; + } // namespace blink #endif // FLUTTER_COMMON_TASK_RUNNERS_H_ diff --git a/flow/BUILD.gn b/flow/BUILD.gn index a63dfad95ddfc..77853058e14a5 100644 --- a/flow/BUILD.gn +++ b/flow/BUILD.gn @@ -58,10 +58,6 @@ source_set("flow") { "texture.h", ] - public_deps = [ - "//garnet/public/lib/fxl", - ] - public_configs = [ "$flutter_root:config" ] deps = [ diff --git a/flow/compositor_context.h b/flow/compositor_context.h index 14c2449dbecd0..5a6700ff3186f 100644 --- a/flow/compositor_context.h +++ b/flow/compositor_context.h @@ -11,7 +11,7 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkPictureRecorder.h" @@ -44,7 +44,7 @@ class CompositorContext { SkCanvas* canvas_; const bool instrumentation_enabled_; - FXL_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); + FML_DISALLOW_COPY_AND_ASSIGN(ScopedFrame); }; CompositorContext(); @@ -81,7 +81,7 @@ class CompositorContext { void EndFrame(ScopedFrame& frame, bool enable_instrumentation); - FXL_DISALLOW_COPY_AND_ASSIGN(CompositorContext); + FML_DISALLOW_COPY_AND_ASSIGN(CompositorContext); }; } // namespace flow diff --git a/flow/debug_print.h b/flow/debug_print.h index 78a28fe38562d..d58dcbed28bed 100644 --- a/flow/debug_print.h +++ b/flow/debug_print.h @@ -7,7 +7,7 @@ #include "flutter/flow/matrix_decomposition.h" #include "flutter/flow/raster_cache_key.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkMatrix.h" #include "third_party/skia/include/core/SkMatrix44.h" #include "third_party/skia/include/core/SkPoint3.h" diff --git a/flow/export_node.cc b/flow/export_node.cc index 9b4b62faea5c2..e837f525f35c4 100644 --- a/flow/export_node.cc +++ b/flow/export_node.cc @@ -4,16 +4,16 @@ #include "flutter/flow/export_node.h" -#include "lib/fxl/functional/make_copyable.h" +#include "flutter/fml/make_copyable.h" namespace flow { ExportNodeHolder::ExportNodeHolder( - fxl::RefPtr gpu_task_runner, - fxl::RefPtr export_token_handle) + fml::RefPtr gpu_task_runner, + fml::RefPtr export_token_handle) : gpu_task_runner_(std::move(gpu_task_runner)), export_node_(std::make_unique(export_token_handle)) { - FXL_DCHECK(gpu_task_runner_); + FML_DCHECK(gpu_task_runner_); } void ExportNodeHolder::Bind(SceneUpdateContext& context, @@ -25,18 +25,18 @@ void ExportNodeHolder::Bind(SceneUpdateContext& context, ExportNodeHolder::~ExportNodeHolder() { gpu_task_runner_->PostTask( - fxl::MakeCopyable([export_node = std::move(export_node_)]() { + fml::MakeCopyable([export_node = std::move(export_node_)]() { export_node->Dispose(true); })); } -ExportNode::ExportNode(fxl::RefPtr export_token_handle) +ExportNode::ExportNode(fml::RefPtr export_token_handle) : export_token_(export_token_handle->ReleaseHandle()) {} ExportNode::~ExportNode() { // Ensure that we properly released the node. - FXL_DCHECK(!node_); - FXL_DCHECK(scene_update_context_ == nullptr); + FML_DCHECK(!node_); + FML_DCHECK(scene_update_context_ == nullptr); } void ExportNode::Bind(SceneUpdateContext& context, @@ -57,9 +57,9 @@ void ExportNode::Bind(SceneUpdateContext& context, if (node_) { container.AddChild(*node_); node_->SetTranslation(offset.x(), offset.y(), 0.f); - node_->SetHitTestBehavior(hit_testable - ? fuchsia::ui::gfx::HitTestBehavior::kDefault - : fuchsia::ui::gfx::HitTestBehavior::kSuppress); + node_->SetHitTestBehavior( + hit_testable ? fuchsia::ui::gfx::HitTestBehavior::kDefault + : fuchsia::ui::gfx::HitTestBehavior::kSuppress); } } @@ -70,7 +70,7 @@ void ExportNode::Dispose(bool remove_from_scene_update_context) { // 1. A node was never created, or // 2. A node was created but was already dereferenced (i.e. Dispose has // already been called). - FXL_DCHECK(scene_update_context_ || !node_); + FML_DCHECK(scene_update_context_ || !node_); if (remove_from_scene_update_context && scene_update_context_) { scene_update_context_->RemoveExportNode(this); diff --git a/flow/export_node.h b/flow/export_node.h index 335d3ba92aba3..c7a3db98aacc6 100644 --- a/flow/export_node.h +++ b/flow/export_node.h @@ -11,9 +11,9 @@ #include "dart-pkg/zircon/sdk_ext/handle.h" #include "flutter/flow/scene_update_context.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/ref_counted.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/ref_counted.h" #include "lib/ui/scenic/cpp/resources.h" #include "third_party/flutter/fml/task_runner.h" #include "third_party/skia/include/core/SkPoint.h" @@ -23,10 +23,10 @@ namespace flow { // Wrapper class for ExportNode to use on UI Thread. When ExportNodeHolder is // destroyed, a task is posted on the Rasterizer thread to dispose the resources // held by the ExportNode. -class ExportNodeHolder : public fxl::RefCountedThreadSafe { +class ExportNodeHolder : public fml::RefCountedThreadSafe { public: - ExportNodeHolder(fxl::RefPtr gpu_task_runner, - fxl::RefPtr export_token_handle); + ExportNodeHolder(fml::RefPtr gpu_task_runner, + fml::RefPtr export_token_handle); ~ExportNodeHolder(); // Calls Bind() on the wrapped ExportNode. @@ -38,12 +38,12 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { ExportNode* export_node() { return export_node_.get(); } private: - fxl::RefPtr gpu_task_runner_; + fml::RefPtr gpu_task_runner_; std::unique_ptr export_node_; - FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); - FRIEND_REF_COUNTED_THREAD_SAFE(ExportNodeHolder); - FXL_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder); + FML_FRIEND_MAKE_REF_COUNTED(ExportNodeHolder); + FML_FRIEND_REF_COUNTED_THREAD_SAFE(ExportNodeHolder); + FML_DISALLOW_COPY_AND_ASSIGN(ExportNodeHolder); }; // Represents a node which is being exported from the session. @@ -51,7 +51,7 @@ class ExportNodeHolder : public fxl::RefCountedThreadSafe { // must be created and destroyed by the rasterizer thread. class ExportNode { public: - ExportNode(fxl::RefPtr export_token_handle); + ExportNode(fml::RefPtr export_token_handle); ~ExportNode(); @@ -75,7 +75,7 @@ class ExportNode { zx::eventpair export_token_; std::unique_ptr node_; - FXL_DISALLOW_COPY_AND_ASSIGN(ExportNode); + FML_DISALLOW_COPY_AND_ASSIGN(ExportNode); }; } // namespace flow diff --git a/flow/instrumentation.cc b/flow/instrumentation.cc index e3e9fbd5ec26b..a032a0ab32777 100644 --- a/flow/instrumentation.cc +++ b/flow/instrumentation.cc @@ -14,28 +14,28 @@ namespace flow { static const size_t kMaxSamples = 120; static const size_t kMaxFrameMarkers = 8; -Stopwatch::Stopwatch() : start_(fxl::TimePoint::Now()), current_sample_(0) { - const fxl::TimeDelta delta = fxl::TimeDelta::Zero(); +Stopwatch::Stopwatch() : start_(fml::TimePoint::Now()), current_sample_(0) { + const fml::TimeDelta delta = fml::TimeDelta::Zero(); laps_.resize(kMaxSamples, delta); } Stopwatch::~Stopwatch() = default; void Stopwatch::Start() { - start_ = fxl::TimePoint::Now(); + start_ = fml::TimePoint::Now(); current_sample_ = (current_sample_ + 1) % kMaxSamples; } void Stopwatch::Stop() { - laps_[current_sample_] = fxl::TimePoint::Now() - start_; + laps_[current_sample_] = fml::TimePoint::Now() - start_; } -void Stopwatch::SetLapTime(const fxl::TimeDelta& delta) { +void Stopwatch::SetLapTime(const fml::TimeDelta& delta) { current_sample_ = (current_sample_ + 1) % kMaxSamples; laps_[current_sample_] = delta; } -const fxl::TimeDelta& Stopwatch::LastLap() const { +const fml::TimeDelta& Stopwatch::LastLap() const { return laps_[(current_sample_ - 1) % kMaxSamples]; } @@ -51,8 +51,8 @@ static inline double UnitHeight(double frame_time_ms, return unitHeight; } -fxl::TimeDelta Stopwatch::MaxDelta() const { - fxl::TimeDelta max_delta; +fml::TimeDelta Stopwatch::MaxDelta() const { + fml::TimeDelta max_delta; for (size_t i = 0; i < kMaxSamples; i++) { if (laps_[i] > max_delta) max_delta = laps_[i]; @@ -148,8 +148,7 @@ void Stopwatch::Visualize(SkCanvas& canvas, const SkRect& rect) const { x + width * (static_cast(current_sample_) / kMaxSamples); const auto marker_rect = SkRect::MakeLTRB( - sample_x, y, - sample_x + width * sample_unit_width, bottom); + sample_x, y, sample_x + width * sample_unit_width, bottom); canvas.drawRect(marker_rect, paint); } diff --git a/flow/instrumentation.h b/flow/instrumentation.h index 1692c8aec4955..19f3b0cfd8bc8 100644 --- a/flow/instrumentation.h +++ b/flow/instrumentation.h @@ -7,9 +7,9 @@ #include -#include "lib/fxl/macros.h" -#include "lib/fxl/time/time_delta.h" -#include "lib/fxl/time/time_point.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/time/time_delta.h" +#include "flutter/fml/time/time_point.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { @@ -22,11 +22,11 @@ class Stopwatch { ~Stopwatch(); - const fxl::TimeDelta& LastLap() const; + const fml::TimeDelta& LastLap() const; - fxl::TimeDelta CurrentLap() const { return fxl::TimePoint::Now() - start_; } + fml::TimeDelta CurrentLap() const { return fml::TimePoint::Now() - start_; } - fxl::TimeDelta MaxDelta() const; + fml::TimeDelta MaxDelta() const; void Visualize(SkCanvas& canvas, const SkRect& rect) const; @@ -34,14 +34,14 @@ class Stopwatch { void Stop(); - void SetLapTime(const fxl::TimeDelta& delta); + void SetLapTime(const fml::TimeDelta& delta); private: - fxl::TimePoint start_; - std::vector laps_; + fml::TimePoint start_; + std::vector laps_; size_t current_sample_; - FXL_DISALLOW_COPY_AND_ASSIGN(Stopwatch); + FML_DISALLOW_COPY_AND_ASSIGN(Stopwatch); }; class Counter { @@ -57,7 +57,7 @@ class Counter { private: size_t count_; - FXL_DISALLOW_COPY_AND_ASSIGN(Counter); + FML_DISALLOW_COPY_AND_ASSIGN(Counter); }; class CounterValues { @@ -80,7 +80,7 @@ class CounterValues { std::vector values_; size_t current_sample_; - FXL_DISALLOW_COPY_AND_ASSIGN(CounterValues); + FML_DISALLOW_COPY_AND_ASSIGN(CounterValues); }; } // namespace flow diff --git a/flow/layers/backdrop_filter_layer.cc b/flow/layers/backdrop_filter_layer.cc index 5186284fcce35..b8d04803f1935 100644 --- a/flow/layers/backdrop_filter_layer.cc +++ b/flow/layers/backdrop_filter_layer.cc @@ -14,7 +14,7 @@ BackdropFilterLayer::~BackdropFilterLayer() = default; void BackdropFilterLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); Layer::AutoSaveLayer(context, SkCanvas::SaveLayerRec{&paint_bounds(), nullptr, filter_.get(), 0}); diff --git a/flow/layers/backdrop_filter_layer.h b/flow/layers/backdrop_filter_layer.h index 00b1a22240541..a54f844a429e1 100644 --- a/flow/layers/backdrop_filter_layer.h +++ b/flow/layers/backdrop_filter_layer.h @@ -21,7 +21,7 @@ class BackdropFilterLayer : public ContainerLayer { private: sk_sp filter_; - FXL_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer); + FML_DISALLOW_COPY_AND_ASSIGN(BackdropFilterLayer); }; } // namespace flow diff --git a/flow/layers/child_scene_layer.cc b/flow/layers/child_scene_layer.cc index 8b36ce09c64a3..744aee5e87888 100644 --- a/flow/layers/child_scene_layer.cc +++ b/flow/layers/child_scene_layer.cc @@ -19,7 +19,7 @@ void ChildSceneLayer::Paint(PaintContext& context) const { } void ChildSceneLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // TODO(MZ-191): Set clip. // It's worth asking whether all children should be clipped implicitly diff --git a/flow/layers/child_scene_layer.h b/flow/layers/child_scene_layer.h index d28009095c021..b52ceb28b2d4f 100644 --- a/flow/layers/child_scene_layer.h +++ b/flow/layers/child_scene_layer.h @@ -21,7 +21,7 @@ class ChildSceneLayer : public Layer { void set_size(const SkSize& size) { size_ = size; } void set_export_node_holder( - fxl::RefPtr export_node_holder) { + fml::RefPtr export_node_holder) { export_node_holder_ = std::move(export_node_holder); } @@ -36,10 +36,10 @@ class ChildSceneLayer : public Layer { private: SkPoint offset_; SkSize size_; - fxl::RefPtr export_node_holder_; + fml::RefPtr export_node_holder_; bool hit_testable_ = true; - FXL_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ChildSceneLayer); }; } // namespace flow diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index 5a234aa5ee103..3c71823c48503 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -29,7 +29,7 @@ void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // TODO(MZ-140): Must be able to specify paths as shapes to nodes. // Treating the shape as a rectangle for now. @@ -48,7 +48,7 @@ void ClipPathLayer::UpdateScene(SceneUpdateContext& context) { void ClipPathLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipPathLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipPath(clip_path_, clip_behavior_ != Clip::hardEdge); diff --git a/flow/layers/clip_path_layer.h b/flow/layers/clip_path_layer.h index 818285af8d098..33b043029ba10 100644 --- a/flow/layers/clip_path_layer.h +++ b/flow/layers/clip_path_layer.h @@ -28,7 +28,7 @@ class ClipPathLayer : public ContainerLayer { SkPath clip_path_; Clip clip_behavior_; - FXL_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ClipPathLayer); }; } // namespace flow diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index 6f345678f87a3..bc9ce7d099bad 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -23,7 +23,7 @@ void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); scenic::Rectangle shape(context.session(), // session clip_rect_.width(), // width @@ -39,7 +39,7 @@ void ClipRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, clip_behavior_ != Clip::hardEdge); context.canvas.clipRect(paint_bounds()); diff --git a/flow/layers/clip_rect_layer.h b/flow/layers/clip_rect_layer.h index 0744076ec478b..576e6a5d029a7 100644 --- a/flow/layers/clip_rect_layer.h +++ b/flow/layers/clip_rect_layer.h @@ -27,7 +27,7 @@ class ClipRectLayer : public ContainerLayer { SkRect clip_rect_; Clip clip_behavior_; - FXL_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ClipRectLayer); }; } // namespace flow diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index d21ce637f7f75..046a0d45404ef 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -23,7 +23,7 @@ void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // TODO(MZ-137): Need to be able to express the radii as vectors. scenic::RoundedRectangle shape( @@ -46,7 +46,7 @@ void ClipRRectLayer::UpdateScene(SceneUpdateContext& context) { void ClipRRectLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ClipRRectLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.clipRRect(clip_rrect_, clip_behavior_ != Clip::hardEdge); diff --git a/flow/layers/clip_rrect_layer.h b/flow/layers/clip_rrect_layer.h index 7888a15ef838f..7e8f0934a337f 100644 --- a/flow/layers/clip_rrect_layer.h +++ b/flow/layers/clip_rrect_layer.h @@ -28,7 +28,7 @@ class ClipRRectLayer : public ContainerLayer { SkRRect clip_rrect_; Clip clip_behavior_; - FXL_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ClipRRectLayer); }; } // namespace flow diff --git a/flow/layers/color_filter_layer.cc b/flow/layers/color_filter_layer.cc index 6b1330eb40593..a3c678aa1539e 100644 --- a/flow/layers/color_filter_layer.cc +++ b/flow/layers/color_filter_layer.cc @@ -12,7 +12,7 @@ ColorFilterLayer::~ColorFilterLayer() = default; void ColorFilterLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ColorFilterLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); sk_sp color_filter = SkColorFilter::MakeModeFilter(color_, blend_mode_); diff --git a/flow/layers/color_filter_layer.h b/flow/layers/color_filter_layer.h index dcd7543b55d53..e129bad66f000 100644 --- a/flow/layers/color_filter_layer.h +++ b/flow/layers/color_filter_layer.h @@ -24,7 +24,7 @@ class ColorFilterLayer : public ContainerLayer { SkColor color_; SkBlendMode blend_mode_; - FXL_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ColorFilterLayer); }; } // namespace flow diff --git a/flow/layers/container_layer.cc b/flow/layers/container_layer.cc index b437d4369bf11..f398c96ad1afe 100644 --- a/flow/layers/container_layer.cc +++ b/flow/layers/container_layer.cc @@ -38,7 +38,7 @@ void ContainerLayer::PrerollChildren(PrerollContext* context, } void ContainerLayer::PaintChildren(PaintContext& context) const { - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); // Intentionally not tracing here as there should be no self-time // and the trace event on this common function has a small overhead. @@ -56,7 +56,7 @@ void ContainerLayer::UpdateScene(SceneUpdateContext& context) { } void ContainerLayer::UpdateSceneChildren(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); // Paint all of the layers which need to be drawn into the container. // These may be flattened down to a containing diff --git a/flow/layers/container_layer.h b/flow/layers/container_layer.h index 9b30d28c9f44a..0da0a7185963e 100644 --- a/flow/layers/container_layer.h +++ b/flow/layers/container_layer.h @@ -38,7 +38,7 @@ class ContainerLayer : public Layer { private: std::vector> layers_; - FXL_DISALLOW_COPY_AND_ASSIGN(ContainerLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ContainerLayer); }; } // namespace flow diff --git a/flow/layers/default_layer_builder.cc b/flow/layers/default_layer_builder.cc index 031bf24d9b262..33fac9704bb66 100644 --- a/flow/layers/default_layer_builder.cc +++ b/flow/layers/default_layer_builder.cc @@ -72,7 +72,7 @@ void DefaultLayerBuilder::PushClipRoundedRect(const SkRRect& rrect, } void DefaultLayerBuilder::PushClipPath(const SkPath& path, Clip clip_behavior) { - FXL_DCHECK(clip_behavior != Clip::none); + FML_DCHECK(clip_behavior != Clip::none); SkRect cullRect; if (!cullRect.intersect(path.getBounds(), cull_rects_.top())) { cullRect = SkRect::MakeEmpty(); @@ -178,7 +178,7 @@ void DefaultLayerBuilder::PushTexture(const SkPoint& offset, void DefaultLayerBuilder::PushChildScene( const SkPoint& offset, const SkSize& size, - fxl::RefPtr export_token_holder, + fml::RefPtr export_token_holder, bool hit_testable) { if (!current_layer_) { return; @@ -211,7 +211,7 @@ std::unique_ptr DefaultLayerBuilder::TakeLayer() { void DefaultLayerBuilder::PushLayer(std::unique_ptr layer, const SkRect& cullRect) { - FXL_DCHECK(layer); + FML_DCHECK(layer); cull_rects_.push(cullRect); diff --git a/flow/layers/default_layer_builder.h b/flow/layers/default_layer_builder.h index d5a2643a5a389..0dd87a3dd75a8 100644 --- a/flow/layers/default_layer_builder.h +++ b/flow/layers/default_layer_builder.h @@ -9,7 +9,7 @@ #include "flutter/flow/layers/container_layer.h" #include "flutter/flow/layers/layer_builder.h" -#include "garnet/public/lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace flow { @@ -76,7 +76,7 @@ class DefaultLayerBuilder final : public LayerBuilder { // |flow::LayerBuilder| void PushChildScene(const SkPoint& offset, const SkSize& size, - fxl::RefPtr export_token_holder, + fml::RefPtr export_token_holder, bool hit_testable) override; #endif // defined(OS_FUCHSIA) @@ -95,7 +95,7 @@ class DefaultLayerBuilder final : public LayerBuilder { void PushLayer(std::unique_ptr layer, const SkRect& cullRect); - FXL_DISALLOW_COPY_AND_ASSIGN(DefaultLayerBuilder); + FML_DISALLOW_COPY_AND_ASSIGN(DefaultLayerBuilder); }; } // namespace flow diff --git a/flow/layers/layer.h b/flow/layers/layer.h index d1a4f0ba13905..173c2890b6ae8 100644 --- a/flow/layers/layer.h +++ b/flow/layers/layer.h @@ -11,10 +11,10 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache.h" #include "flutter/flow/texture.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" #include "flutter/fml/trace_event.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColorFilter.h" @@ -112,7 +112,7 @@ class Layer { bool needs_system_composite_; SkRect paint_bounds_; - FXL_DISALLOW_COPY_AND_ASSIGN(Layer); + FML_DISALLOW_COPY_AND_ASSIGN(Layer); }; } // namespace flow diff --git a/flow/layers/layer_builder.h b/flow/layers/layer_builder.h index 3cb6ea1fb40ce..c1b34bf306434 100644 --- a/flow/layers/layer_builder.h +++ b/flow/layers/layer_builder.h @@ -9,7 +9,7 @@ #include "flutter/flow/layers/layer.h" #include "flutter/flow/skia_gpu_object.h" -#include "garnet/public/lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkBlendMode.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkImageFilter.h" @@ -74,7 +74,7 @@ class LayerBuilder { virtual void PushChildScene( const SkPoint& offset, const SkSize& size, - fxl::RefPtr export_token_holder, + fml::RefPtr export_token_holder, bool hit_testable) = 0; #endif // defined(OS_FUCHSIA) @@ -99,7 +99,7 @@ class LayerBuilder { bool checkerboard_raster_cache_images_ = false; bool checkerboard_offscreen_layers_ = false; - FXL_DISALLOW_COPY_AND_ASSIGN(LayerBuilder); + FML_DISALLOW_COPY_AND_ASSIGN(LayerBuilder); }; } // namespace flow diff --git a/flow/layers/layer_tree.h b/flow/layers/layer_tree.h index 522fe6a34f393..bae883ca207be 100644 --- a/flow/layers/layer_tree.h +++ b/flow/layers/layer_tree.h @@ -11,8 +11,8 @@ #include "flutter/flow/compositor_context.h" #include "flutter/flow/layers/layer.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/time/time_delta.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/time/time_delta.h" #include "third_party/skia/include/core/SkPicture.h" #include "third_party/skia/include/core/SkSize.h" @@ -46,11 +46,11 @@ class LayerTree { void set_frame_size(const SkISize& frame_size) { frame_size_ = frame_size; } - void set_construction_time(const fxl::TimeDelta& delta) { + void set_construction_time(const fml::TimeDelta& delta) { construction_time_ = delta; } - const fxl::TimeDelta& construction_time() const { return construction_time_; } + const fml::TimeDelta& construction_time() const { return construction_time_; } // The number of frame intervals missed after which the compositor must // trace the rasterized picture to a trace file. Specify 0 to disable all @@ -74,12 +74,12 @@ class LayerTree { private: SkISize frame_size_; // Physical pixels. std::unique_ptr root_layer_; - fxl::TimeDelta construction_time_; + fml::TimeDelta construction_time_; uint32_t rasterizer_tracing_threshold_; bool checkerboard_raster_cache_images_; bool checkerboard_offscreen_layers_; - FXL_DISALLOW_COPY_AND_ASSIGN(LayerTree); + FML_DISALLOW_COPY_AND_ASSIGN(LayerTree); }; } // namespace flow diff --git a/flow/layers/opacity_layer.cc b/flow/layers/opacity_layer.cc index e6916f0762036..84b8bd64c0224 100644 --- a/flow/layers/opacity_layer.cc +++ b/flow/layers/opacity_layer.cc @@ -12,7 +12,7 @@ OpacityLayer::~OpacityLayer() = default; void OpacityLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "OpacityLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkPaint paint; paint.setAlpha(alpha_); diff --git a/flow/layers/opacity_layer.h b/flow/layers/opacity_layer.h index 2ec0a1acf9a07..b27829385046b 100644 --- a/flow/layers/opacity_layer.h +++ b/flow/layers/opacity_layer.h @@ -24,7 +24,7 @@ class OpacityLayer : public ContainerLayer { private: int alpha_; - FXL_DISALLOW_COPY_AND_ASSIGN(OpacityLayer); + FML_DISALLOW_COPY_AND_ASSIGN(OpacityLayer); }; } // namespace flow diff --git a/flow/layers/performance_overlay_layer.h b/flow/layers/performance_overlay_layer.h index 77448107147a4..3296a308bddbd 100644 --- a/flow/layers/performance_overlay_layer.h +++ b/flow/layers/performance_overlay_layer.h @@ -6,7 +6,7 @@ #define FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_ #include "flutter/flow/layers/layer.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" namespace flow { @@ -24,7 +24,7 @@ class PerformanceOverlayLayer : public Layer { private: int options_; - FXL_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer); + FML_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer); }; } // namespace flow diff --git a/flow/layers/physical_shape_layer.cc b/flow/layers/physical_shape_layer.cc index 8f9e59d6f1ac2..53a7d29f30df4 100644 --- a/flow/layers/physical_shape_layer.cc +++ b/flow/layers/physical_shape_layer.cc @@ -64,7 +64,7 @@ void PhysicalShapeLayer::Preroll(PrerollContext* context, #if defined(OS_FUCHSIA) void PhysicalShapeLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); SceneUpdateContext::Frame frame(context, frameRRect_, color_, elevation_); for (auto& layer : layers()) { @@ -80,7 +80,7 @@ void PhysicalShapeLayer::UpdateScene(SceneUpdateContext& context) { void PhysicalShapeLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PhysicalShapeLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); if (elevation_ != 0) { DrawShadow(&context.canvas, path_, shadow_color_, elevation_, diff --git a/flow/layers/picture_layer.cc b/flow/layers/picture_layer.cc index bef944e7f34a9..3cbf15a609ad1 100644 --- a/flow/layers/picture_layer.cc +++ b/flow/layers/picture_layer.cc @@ -4,7 +4,7 @@ #include "flutter/flow/layers/picture_layer.h" -#include "lib/fxl/logging.h" +#include "flutter/fml/logging.h" namespace flow { @@ -34,8 +34,8 @@ void PictureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void PictureLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "PictureLayer::Paint"); - FXL_DCHECK(picture_.get()); - FXL_DCHECK(needs_painting()); + FML_DCHECK(picture_.get()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.translate(offset_.x(), offset_.y()); diff --git a/flow/layers/picture_layer.h b/flow/layers/picture_layer.h index c67929b7cb455..12e2807c33d23 100644 --- a/flow/layers/picture_layer.h +++ b/flow/layers/picture_layer.h @@ -41,7 +41,7 @@ class PictureLayer : public Layer { bool will_change_ = false; RasterCacheResult raster_cache_result_; - FXL_DISALLOW_COPY_AND_ASSIGN(PictureLayer); + FML_DISALLOW_COPY_AND_ASSIGN(PictureLayer); }; } // namespace flow diff --git a/flow/layers/shader_mask_layer.cc b/flow/layers/shader_mask_layer.cc index 4ed67334b8326..3ea69322fcd2f 100644 --- a/flow/layers/shader_mask_layer.cc +++ b/flow/layers/shader_mask_layer.cc @@ -12,7 +12,7 @@ ShaderMaskLayer::~ShaderMaskLayer() = default; void ShaderMaskLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "ShaderMaskLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); Layer::AutoSaveLayer(context, paint_bounds(), nullptr); PaintChildren(context); diff --git a/flow/layers/shader_mask_layer.h b/flow/layers/shader_mask_layer.h index 0b9e728cdda11..ed059722fea55 100644 --- a/flow/layers/shader_mask_layer.h +++ b/flow/layers/shader_mask_layer.h @@ -29,7 +29,7 @@ class ShaderMaskLayer : public ContainerLayer { SkRect mask_rect_; SkBlendMode blend_mode_; - FXL_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer); + FML_DISALLOW_COPY_AND_ASSIGN(ShaderMaskLayer); }; } // namespace flow diff --git a/flow/layers/texture_layer.h b/flow/layers/texture_layer.h index 75f0fe66abaec..93581c3472b0e 100644 --- a/flow/layers/texture_layer.h +++ b/flow/layers/texture_layer.h @@ -31,7 +31,7 @@ class TextureLayer : public Layer { SkSize size_; int64_t texture_id_; - FXL_DISALLOW_COPY_AND_ASSIGN(TextureLayer); + FML_DISALLOW_COPY_AND_ASSIGN(TextureLayer); }; } // namespace flow diff --git a/flow/layers/transform_layer.cc b/flow/layers/transform_layer.cc index be6a6f81c478c..a70cc299dd9a4 100644 --- a/flow/layers/transform_layer.cc +++ b/flow/layers/transform_layer.cc @@ -24,7 +24,7 @@ void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { #if defined(OS_FUCHSIA) void TransformLayer::UpdateScene(SceneUpdateContext& context) { - FXL_DCHECK(needs_system_composite()); + FML_DCHECK(needs_system_composite()); SceneUpdateContext::Transform transform(context, transform_); UpdateSceneChildren(context); @@ -34,7 +34,7 @@ void TransformLayer::UpdateScene(SceneUpdateContext& context) { void TransformLayer::Paint(PaintContext& context) const { TRACE_EVENT0("flutter", "TransformLayer::Paint"); - FXL_DCHECK(needs_painting()); + FML_DCHECK(needs_painting()); SkAutoCanvasRestore save(&context.canvas, true); context.canvas.concat(transform_); diff --git a/flow/layers/transform_layer.h b/flow/layers/transform_layer.h index 47fd7d5cefc0c..f8209302aa170 100644 --- a/flow/layers/transform_layer.h +++ b/flow/layers/transform_layer.h @@ -27,7 +27,7 @@ class TransformLayer : public ContainerLayer { private: SkMatrix transform_; - FXL_DISALLOW_COPY_AND_ASSIGN(TransformLayer); + FML_DISALLOW_COPY_AND_ASSIGN(TransformLayer); }; } // namespace flow diff --git a/flow/matrix_decomposition.h b/flow/matrix_decomposition.h index 1392ed8aad020..d65d12a77e674 100644 --- a/flow/matrix_decomposition.h +++ b/flow/matrix_decomposition.h @@ -5,7 +5,7 @@ #ifndef FLUTTER_FLOW_MATRIX_DECOMPOSITION_H_ #define FLUTTER_FLOW_MATRIX_DECOMPOSITION_H_ -#include "lib/fxl/macros.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkMatrix.h" #include "third_party/skia/include/core/SkMatrix44.h" #include "third_party/skia/include/core/SkPoint3.h" @@ -43,7 +43,7 @@ class MatrixDecomposition { SkVector4 perspective_; SkVector4 rotation_; - FXL_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition); + FML_DISALLOW_COPY_AND_ASSIGN(MatrixDecomposition); }; } // namespace flow diff --git a/flow/matrix_decomposition_unittests.cc b/flow/matrix_decomposition_unittests.cc index df80090881512..130f290d58399 100644 --- a/flow/matrix_decomposition_unittests.cc +++ b/flow/matrix_decomposition_unittests.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "lib/fxl/build_config.h" +#include "flutter/fml/build_config.h" #if defined(OS_WIN) #define _USE_MATH_DEFINES diff --git a/flow/raster_cache.cc b/flow/raster_cache.cc index 33d5a99d2c6d5..a3aef6e3d1410 100644 --- a/flow/raster_cache.cc +++ b/flow/raster_cache.cc @@ -7,8 +7,8 @@ #include #include "flutter/flow/paint_utils.h" +#include "flutter/fml/logging.h" #include "flutter/fml/trace_event.h" -#include "lib/fxl/logging.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColorSpaceXformCanvas.h" #include "third_party/skia/include/core/SkImage.h" @@ -21,7 +21,7 @@ void RasterCacheResult::draw(SkCanvas& canvas) const { SkAutoCanvasRestore auto_restore(&canvas, true); SkIRect bounds = RasterCache::GetDeviceBounds(logical_rect_, canvas.getTotalMatrix()); - FXL_DCHECK(bounds.size() == image_->dimensions()); + FML_DCHECK(bounds.size() == image_->dimensions()); canvas.resetMatrix(); canvas.drawImage(image_, bounds.fLeft, bounds.fTop); } diff --git a/flow/raster_cache.h b/flow/raster_cache.h index e72e7437098f4..348ab8000da39 100644 --- a/flow/raster_cache.h +++ b/flow/raster_cache.h @@ -10,8 +10,8 @@ #include "flutter/flow/instrumentation.h" #include "flutter/flow/raster_cache_key.h" -#include "lib/fxl/macros.h" -#include "lib/fxl/memory/weak_ptr.h" +#include "flutter/fml/macros.h" +#include "flutter/fml/memory/weak_ptr.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkSize.h" @@ -79,9 +79,9 @@ class RasterCache { const size_t threshold_; RasterCacheKey::Map cache_; bool checkerboard_images_; - fxl::WeakPtrFactory weak_factory_; + fml::WeakPtrFactory weak_factory_; - FXL_DISALLOW_COPY_AND_ASSIGN(RasterCache); + FML_DISALLOW_COPY_AND_ASSIGN(RasterCache); }; } // namespace flow diff --git a/flow/raster_cache_key.h b/flow/raster_cache_key.h index c6f4c759378f0..3f20072df8e3b 100644 --- a/flow/raster_cache_key.h +++ b/flow/raster_cache_key.h @@ -7,8 +7,8 @@ #include #include "flutter/flow/matrix_decomposition.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" #include "third_party/skia/include/core/SkImage.h" #include "third_party/skia/include/core/SkPicture.h" @@ -21,7 +21,7 @@ class RasterCacheKey { matrix_[SkMatrix::kMTransX] = SkScalarFraction(ctm.getTranslateX()); matrix_[SkMatrix::kMTransY] = SkScalarFraction(ctm.getTranslateY()); #ifndef SUPPORT_FRACTIONAL_TRANSLATION - FXL_DCHECK(matrix_.getTranslateX() == 0 && matrix_.getTranslateY() == 0); + FML_DCHECK(matrix_.getTranslateX() == 0 && matrix_.getTranslateY() == 0); #endif } diff --git a/flow/scene_update_context.cc b/flow/scene_update_context.cc index c4cb57e59afea..576bde7fa1aff 100644 --- a/flow/scene_update_context.cc +++ b/flow/scene_update_context.cc @@ -14,7 +14,7 @@ namespace flow { SceneUpdateContext::SceneUpdateContext(scenic::Session* session, SurfaceProducer* surface_producer) : session_(session), surface_producer_(surface_producer) { - FXL_DCHECK(surface_producer_ != nullptr); + FML_DCHECK(surface_producer_ != nullptr); } SceneUpdateContext::~SceneUpdateContext() { @@ -27,7 +27,7 @@ SceneUpdateContext::~SceneUpdateContext() { void SceneUpdateContext::AddChildScene(ExportNode* export_node, SkPoint offset, bool hit_testable) { - FXL_DCHECK(top_entity_); + FML_DCHECK(top_entity_); export_node->Bind(*this, top_entity_->entity_node(), offset, hit_testable); } @@ -161,7 +161,7 @@ scenic::Image* SceneUpdateContext::GenerateImageIfNeeded( auto surface = surface_producer_->ProduceSurface(physical_size); if (!surface) { - FXL_LOG(ERROR) << "Could not acquire a surface from the surface producer " + FML_LOG(ERROR) << "Could not acquire a surface from the surface producer " "of size: " << physical_size.width() << "x" << physical_size.height(); return nullptr; @@ -185,7 +185,7 @@ SceneUpdateContext::ExecutePaintTasks(CompositorContext::ScopedFrame& frame) { TRACE_EVENT0("flutter", "SceneUpdateContext::ExecutePaintTasks"); std::vector> surfaces_to_submit; for (auto& task : paint_tasks_) { - FXL_DCHECK(task.surface); + FML_DCHECK(task.surface); SkCanvas* canvas = task.surface->GetSkiaSurface()->getCanvas(); Layer::PaintContext context = {*canvas, frame.context().frame_time(), frame.context().engine_time(), @@ -214,7 +214,7 @@ SceneUpdateContext::Entity::Entity(SceneUpdateContext& context) } SceneUpdateContext::Entity::~Entity() { - FXL_DCHECK(context_.top_entity_ == this); + FML_DCHECK(context_.top_entity_ == this); context_.top_entity_ = previous_entity_; } @@ -302,7 +302,7 @@ SceneUpdateContext::Frame::~Frame() { } void SceneUpdateContext::Frame::AddPaintedLayer(Layer* layer) { - FXL_DCHECK(layer->needs_painting()); + FML_DCHECK(layer->needs_painting()); paint_layers_.push_back(layer); paint_bounds_.join(layer->paint_bounds()); } diff --git a/flow/scene_update_context.h b/flow/scene_update_context.h index 23beb0a887dae..ac9659476ce4e 100644 --- a/flow/scene_update_context.h +++ b/flow/scene_update_context.h @@ -10,9 +10,9 @@ #include #include "flutter/flow/compositor_context.h" -#include "lib/fxl/build_config.h" -#include "lib/fxl/logging.h" -#include "lib/fxl/macros.h" +#include "flutter/fml/build_config.h" +#include "flutter/fml/logging.h" +#include "flutter/fml/macros.h" #include "lib/ui/scenic/cpp/resources.h" #include "third_party/skia/include/core/SkRect.h" #include "third_party/skia/include/core/SkSurface.h" @@ -142,7 +142,7 @@ class SceneUpdateContext { // CPU wait. Once Vulkan semaphores are available, this method must return // void and the implementation must submit surfaces on its own as soon as the // specific canvas operations are done. - FXL_WARN_UNUSED_RESULT + FML_WARN_UNUSED_RESULT std::vector> ExecutePaintTasks( CompositorContext::ScopedFrame& frame); @@ -170,10 +170,10 @@ class SceneUpdateContext { std::vector paint_layers); void SetShapeColor(scenic::ShapeNode& shape_node, SkColor color); scenic::Image* GenerateImageIfNeeded(SkColor color, - SkScalar scale_x, - SkScalar scale_y, - const SkRect& paint_bounds, - std::vector paint_layers); + SkScalar scale_x, + SkScalar scale_y, + const SkRect& paint_bounds, + std::vector paint_layers); Entity* top_entity_ = nullptr; float top_scale_x_ = 1.f; @@ -189,7 +189,7 @@ class SceneUpdateContext { // Save ExportNodes so we can dispose them in our destructor. std::set export_nodes_; - FXL_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext); + FML_DISALLOW_COPY_AND_ASSIGN(SceneUpdateContext); }; } // namespace flow diff --git a/flow/skia_gpu_object.cc b/flow/skia_gpu_object.cc index ce2312f921580..bf9d9a8ec599f 100644 --- a/flow/skia_gpu_object.cc +++ b/flow/skia_gpu_object.cc @@ -8,8 +8,8 @@ namespace flow { -SkiaUnrefQueue::SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay) +SkiaUnrefQueue::SkiaUnrefQueue(fml::RefPtr task_runner, + fml::TimeDelta delay) : task_runner_(std::move(task_runner)), drain_delay_(delay), drain_pending_(false) {} @@ -24,7 +24,7 @@ void SkiaUnrefQueue::Unref(SkRefCnt* object) { if (!drain_pending_) { drain_pending_ = true; task_runner_->PostDelayedTask( - [strong = fxl::Ref(this)]() { strong->Drain(); }, drain_delay_); + [strong = fml::Ref(this)]() { strong->Drain(); }, drain_delay_); } } diff --git a/flow/skia_gpu_object.h b/flow/skia_gpu_object.h index 4711f80c6f4fd..7379b7936ec42 100644 --- a/flow/skia_gpu_object.h +++ b/flow/skia_gpu_object.h @@ -8,16 +8,16 @@ #include #include +#include "flutter/fml/memory/ref_counted.h" #include "flutter/fml/memory/weak_ptr.h" #include "flutter/fml/task_runner.h" -#include "lib/fxl/memory/ref_ptr.h" #include "third_party/skia/include/core/SkRefCnt.h" namespace flow { // A queue that holds Skia objects that must be destructed on the the given task // runner. -class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { +class SkiaUnrefQueue : public fml::RefCountedThreadSafe { public: void Unref(SkRefCnt* object); @@ -29,20 +29,20 @@ class SkiaUnrefQueue : public fxl::RefCountedThreadSafe { void Drain(); private: - const fxl::RefPtr task_runner_; - const fxl::TimeDelta drain_delay_; + const fml::RefPtr task_runner_; + const fml::TimeDelta drain_delay_; std::mutex mutex_; std::deque objects_; bool drain_pending_; - SkiaUnrefQueue(fxl::RefPtr task_runner, - fxl::TimeDelta delay); + SkiaUnrefQueue(fml::RefPtr task_runner, + fml::TimeDelta delay); ~SkiaUnrefQueue(); - FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); - FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); + FML_FRIEND_REF_COUNTED_THREAD_SAFE(SkiaUnrefQueue); + FML_FRIEND_MAKE_REF_COUNTED(SkiaUnrefQueue); + FML_DISALLOW_COPY_AND_ASSIGN(SkiaUnrefQueue); }; /// An object whose deallocation needs to be performed on an specific unref @@ -55,9 +55,9 @@ class SkiaGPUObject { SkiaGPUObject() = default; - SkiaGPUObject(sk_sp object, fxl::RefPtr queue) + SkiaGPUObject(sk_sp object, fml::RefPtr queue) : object_(std::move(object)), queue_(std::move(queue)) { - FXL_DCHECK(queue_ && object_); + FML_DCHECK(queue_ && object_); } SkiaGPUObject(SkiaGPUObject&&) = default; @@ -73,14 +73,14 @@ class SkiaGPUObject { queue_->Unref(object_.release()); } queue_ = nullptr; - FXL_DCHECK(object_ == nullptr); + FML_DCHECK(object_ == nullptr); } private: sk_sp object_; - fxl::RefPtr queue_; + fml::RefPtr queue_; - FXL_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); + FML_DISALLOW_COPY_AND_ASSIGN(SkiaGPUObject); }; } // namespace flow diff --git a/flow/texture.h b/flow/texture.h index 0e8b3eaeb2cb2..92e0130da35ff 100644 --- a/flow/texture.h +++ b/flow/texture.h @@ -7,8 +7,8 @@ #include +#include "flutter/fml/macros.h" #include "flutter/fml/synchronization/waitable_event.h" -#include "lib/fxl/macros.h" #include "third_party/skia/include/core/SkCanvas.h" namespace flow { @@ -38,7 +38,7 @@ class Texture { private: int64_t id_; - FXL_DISALLOW_COPY_AND_ASSIGN(Texture); + FML_DISALLOW_COPY_AND_ASSIGN(Texture); }; class TextureRegistry { @@ -64,7 +64,7 @@ class TextureRegistry { private: std::map> mapping_; - FXL_DISALLOW_COPY_AND_ASSIGN(TextureRegistry); + FML_DISALLOW_COPY_AND_ASSIGN(TextureRegistry); }; } // namespace flow diff --git a/fml/BUILD.gn b/fml/BUILD.gn index 0551319ea2595..6d605ddf59f1a 100644 --- a/fml/BUILD.gn +++ b/fml/BUILD.gn @@ -4,8 +4,11 @@ source_set("fml") { sources = [ + "arraysize.h", "build_config.h", "closure.h", + "command_line.cc", + "command_line.h", "compiler_specific.h", "eintr_wrapper.h", "export.h", @@ -18,6 +21,7 @@ source_set("fml") { "log_settings_state.cc", "logging.cc", "logging.h", + "make_copyable.h", "mapping.cc", "mapping.h", "memory/ref_counted.h", @@ -35,6 +39,8 @@ source_set("fml") { "native_library.h", "paths.cc", "paths.h", + "string_view.cc", + "string_view.h", "synchronization/thread_annotations.h", "synchronization/thread_checker.h", "synchronization/waitable_event.cc", @@ -55,7 +61,6 @@ source_set("fml") { ] deps = [ - "//garnet/public/lib/fxl", "//third_party/dart/runtime:dart_api", # These need to be in sync with the Fuchsia buildroot. @@ -141,6 +146,7 @@ source_set("fml") { "platform/posix/file_posix.cc", "platform/posix/mapping_posix.cc", "platform/posix/native_library_posix.cc", + "platform/posix/paths_posix.cc", ] } } @@ -149,9 +155,11 @@ executable("fml_unittests") { testonly = true sources = [ + "command_line_unittest.cc", "memory/ref_counted_unittest.cc", "memory/weak_ptr_unittest.cc", "message_loop_unittests.cc", + "string_view_unittest.cc", "synchronization/thread_annotations_unittest.cc", "synchronization/thread_checker_unittest.cc", "synchronization/waitable_event_unittest.cc", @@ -165,7 +173,6 @@ executable("fml_unittests") { deps = [ "$flutter_root/fml", "$flutter_root/testing", - "//garnet/public/lib/fxl", "//third_party/dart/runtime:libdart_jit", ] } diff --git a/fml/arraysize.h b/fml/arraysize.h new file mode 100644 index 0000000000000..8457369884a97 --- /dev/null +++ b/fml/arraysize.h @@ -0,0 +1,16 @@ +// Copyright 2016 The Fuchsia 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_ARRAYSIZE_H_ +#define FLUTTER_FML_ARRAYSIZE_H_ + +#include + +#ifndef arraysize +template +char (&ArraySizeHelper(T (&array)[N]))[N]; +#define arraysize(array) (sizeof(ArraySizeHelper(array))) +#endif + +#endif // FLUTTER_FML_ARRAYSIZE_H_ diff --git a/fml/command_line.cc b/fml/command_line.cc new file mode 100644 index 0000000000000..24012867edc84 --- /dev/null +++ b/fml/command_line.cc @@ -0,0 +1,165 @@ +// Copyright 2016 The Fuchsia 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/command_line.h" + +namespace fml { + +// CommandLine ----------------------------------------------------------------- + +CommandLine::Option::Option(const std::string& name) : name(name) {} + +CommandLine::Option::Option(const std::string& name, const std::string& value) + : name(name), value(value) {} + +CommandLine::CommandLine() = default; + +CommandLine::CommandLine(const CommandLine& from) = default; + +CommandLine::CommandLine(CommandLine&& from) = default; + +CommandLine::CommandLine(const std::string& argv0, + const std::vector